summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitattributes6
-rw-r--r--.readthedocs.yaml29
-rw-r--r--Makefile.in5
-rw-r--r--Resource/Init/gs_epsf.ps6
-rw-r--r--Resource/Init/gs_fonts.ps9
-rw-r--r--Resource/Init/gs_init.ps4
-rw-r--r--Resource/Init/gs_type1.ps8
-rw-r--r--Resource/Init/pdf_draw.ps2
-rw-r--r--Resource/Init/pdf_main.ps518
-rwxr-xr-xautogen.sh16
-rw-r--r--base/cal.mak12
-rw-r--r--base/fapi_ft.c77
-rw-r--r--base/freetype.mak16
-rw-r--r--base/gdevabuf.c38
-rw-r--r--base/gdevdflt.c41
-rw-r--r--base/gdevepo.c3
-rw-r--r--base/gdevflp.c335
-rw-r--r--base/gdevflp.h9
-rw-r--r--base/gdevkrnlsclass.c7
-rw-r--r--base/gdevm8.c7
-rw-r--r--base/gdevmpla.c28
-rw-r--r--base/gdevnfwd.c16
-rw-r--r--base/gdevnup.c9
-rw-r--r--base/gdevoflt.c107
-rw-r--r--base/gdevp14.c160
-rw-r--r--base/gdevprn.c10
-rw-r--r--base/gdevsclass.c114
-rw-r--r--base/gdevsclass.h4
-rw-r--r--base/gsargs.c43
-rw-r--r--base/gscdefs.h9
-rw-r--r--base/gscdevn.c11
-rw-r--r--base/gscms.h5
-rw-r--r--base/gscspace.h3
-rw-r--r--base/gsdevice.c6
-rw-r--r--base/gsdparam.c113
-rw-r--r--base/gsdps1.c32
-rw-r--r--base/gsequivc.c10
-rw-r--r--base/gsequivc.h2
-rw-r--r--base/gserrors.h13
-rw-r--r--base/gsfcmap.c1
-rw-r--r--base/gsftopts.h11
-rw-r--r--base/gsgstate.c10
-rw-r--r--base/gsht.c6
-rw-r--r--base/gshtscr.c11
-rw-r--r--base/gsicc.c4
-rw-r--r--base/gsicc_blacktext.c262
-rw-r--r--base/gsicc_blacktext.h23
-rw-r--r--base/gsicc_cache.c84
-rw-r--r--base/gsicc_cache.h2
-rw-r--r--base/gsicc_cms.h2
-rw-r--r--base/gsicc_lcms2mt.c1
-rw-r--r--base/gsicc_manage.c47
-rw-r--r--base/gsicc_nocm.c10
-rw-r--r--base/gsicc_profilecache.c21
-rw-r--r--base/gsmchunk.c31
-rw-r--r--base/gsovrc.c52
-rw-r--r--base/gspaint.c118
-rw-r--r--base/gsparamx.c9
-rw-r--r--base/gspath1.c15
-rw-r--r--base/gsptype1.c21
-rw-r--r--base/gssprintf.c19
-rw-r--r--base/gssprintf.h5
-rw-r--r--base/gstext.c36
-rw-r--r--base/gstiffio.c8
-rw-r--r--base/gstiffio.h3
-rw-r--r--base/gstrans.c31
-rw-r--r--base/gstrans.h3
-rw-r--r--base/gstype2.c21
-rw-r--r--base/gstype42.c36
-rw-r--r--base/gxblend.c10
-rw-r--r--base/gxchar.c13
-rw-r--r--base/gxcldev.h6
-rw-r--r--base/gxclimag.c17
-rw-r--r--base/gxclipm.c3
-rw-r--r--base/gxclist.c4
-rw-r--r--base/gxclpath.c105
-rw-r--r--base/gxclpath.h3
-rw-r--r--base/gxclrast.c52
-rw-r--r--base/gxclread.c6
-rw-r--r--base/gxclthrd.c17
-rw-r--r--base/gxcmap.c25
-rw-r--r--base/gxcpath.c8
-rw-r--r--base/gxdevcli.h14
-rw-r--r--base/gxdevice.h10
-rw-r--r--base/gxdevsop.h10
-rw-r--r--base/gxdownscale.c2
-rw-r--r--base/gxfapi.h4
-rw-r--r--base/gxfill.c11
-rw-r--r--base/gxgstate.h8
-rw-r--r--base/gxipixel.c64
-rw-r--r--base/gxiscale.c32
-rw-r--r--base/gxp1fill.c6
-rw-r--r--base/gxpaint.c10
-rw-r--r--base/gxpcmap.c89
-rw-r--r--base/gxpcolor.h5
-rw-r--r--base/gxpflat.c10
-rw-r--r--base/gxshade6.c3
-rw-r--r--base/gxstroke.c10
-rw-r--r--base/gxtext.h4
-rw-r--r--base/gxttfb.c21
-rw-r--r--base/gxtype1.c40
-rw-r--r--base/gxtype1.h4
-rw-r--r--base/lcms2mt.mak13
-rw-r--r--base/lib.mak21
-rw-r--r--base/mkromfs.c9
-rw-r--r--base/msvclib.mak15
-rw-r--r--base/pagelist.c246
-rw-r--r--base/pagelist.h33
-rw-r--r--base/scfd.c11
-rw-r--r--base/siscale.c31
-rw-r--r--base/spdiff.c11
-rw-r--r--base/stream.c11
-rw-r--r--base/ttfmain.c41
-rw-r--r--base/ttfoutl.h4
-rw-r--r--base/ttinterp.c39
-rw-r--r--base/ttobjs.c5
-rw-r--r--base/unix-gcc.mak1
-rw-r--r--base/version.mak8
-rw-r--r--base/winlib.mak5
-rwxr-xr-xconfigure112
-rw-r--r--configure.ac64
-rw-r--r--cups/gdevcups.c245
-rw-r--r--demos/java/gsviewer/install_darwin.sh11
-rw-r--r--demos/java/gsviewer/install_linux.sh7
-rw-r--r--devices/extract.mak10
-rw-r--r--devices/gdevclj.c4
-rw-r--r--devices/gdevpng.c5
-rw-r--r--devices/gdevpsd.c16
-rw-r--r--devices/gdevsppr.c4
-rw-r--r--devices/gdevtfax.c11
-rw-r--r--devices/gdevtifs.c23
-rw-r--r--devices/gdevtifs.h12
-rw-r--r--devices/gdevtsep.c118
-rw-r--r--devices/gdevxini.c30
-rw-r--r--devices/gxfcopy.c23
-rw-r--r--devices/vector/doc_common.c16
-rw-r--r--devices/vector/doc_common.h15
-rw-r--r--devices/vector/gdevdocxw.c16
-rw-r--r--devices/vector/gdevpdf.c150
-rw-r--r--devices/vector/gdevpdfb.c53
-rw-r--r--devices/vector/gdevpdfb.h7
-rw-r--r--devices/vector/gdevpdfd.c30
-rw-r--r--devices/vector/gdevpdfe.c34
-rw-r--r--devices/vector/gdevpdfg.c2
-rw-r--r--devices/vector/gdevpdfi.c15
-rw-r--r--devices/vector/gdevpdfj.c6
-rw-r--r--devices/vector/gdevpdfo.c2
-rw-r--r--devices/vector/gdevpdfp.c31
-rw-r--r--devices/vector/gdevpdft.c8
-rw-r--r--devices/vector/gdevpdfu.c7
-rw-r--r--devices/vector/gdevpdfx.h9
-rw-r--r--devices/vector/gdevpdte.c2
-rw-r--r--devices/vector/gdevpdtt.c38
-rw-r--r--devices/vector/gdevpsdp.c20
-rw-r--r--devices/vector/gdevpsft.c10
-rw-r--r--devices/vector/gdevpsu.c8
-rw-r--r--devices/vector/gdevtxtw.c22
-rw-r--r--devices/vector/gdevxps.c19
-rw-r--r--doc/API.htm1756
-rw-r--r--doc/C-style.htm1604
-rw-r--r--doc/Commprod.htm318
-rw-r--r--doc/DLL.htm754
-rw-r--r--doc/Deprecated.htm5769
-rw-r--r--doc/Develop.htm4823
-rw-r--r--doc/Devices.htm2175
-rw-r--r--doc/Drivers.htm3407
-rw-r--r--doc/Fonts.htm348
-rw-r--r--doc/GPDL.htm566
-rw-r--r--doc/Ghostscript.pdf1882
-rw-r--r--doc/History9.htm201
-rw-r--r--doc/HowToBuildTheDocs.txt100
-rw-r--r--doc/Install.htm419
-rw-r--r--doc/Internal.htm95
-rw-r--r--doc/Language.htm2293
-rw-r--r--doc/Lib.htm1023
-rw-r--r--doc/Make.htm1459
-rw-r--r--doc/News.htm80
-rw-r--r--doc/Ps-style.htm530
-rw-r--r--doc/Ps2epsi.htm204
-rw-r--r--doc/Psfiles.htm865
-rw-r--r--doc/Readme.htm560
-rw-r--r--doc/Release.htm824
-rw-r--r--doc/SavedPages.htm289
-rw-r--r--doc/Search.htm188
-rw-r--r--doc/Source.htm430
-rw-r--r--doc/Unix-lpr.htm279
-rw-r--r--doc/Use.htm5437
-rw-r--r--doc/VectorDevices.htm1503
-rw-r--r--doc/WhatIsGS.htm161
-rw-r--r--doc/default.css362
-rw-r--r--doc/gdevds32.c255
-rw-r--r--doc/gs-style.css56
-rw-r--r--doc/gs-vms.hlp286
-rw-r--r--doc/gsdoc.el704
-rw-r--r--doc/images/.DS_Storebin6148 -> 0 bytes
-rw-r--r--doc/images/Artifex_logo.pngbin1471 -> 0 bytes
-rw-r--r--doc/images/favicon.pngbin1585 -> 0 bytes
-rw-r--r--doc/images/ghostscript_logo.pngbin6319 -> 0 bytes
-rw-r--r--doc/images/hamburger-light.pngbin403 -> 0 bytes
-rw-r--r--doc/images/icon-search.pngbin3122 -> 0 bytes
-rw-r--r--doc/images/x-light.pngbin388 -> 0 bytes
-rw-r--r--doc/index.htm9
-rw-r--r--doc/index.html30
-rw-r--r--doc/index.js10
-rw-r--r--doc/language-bindings/c-sharp-ghost-api.html2
-rw-r--r--doc/language-bindings/c-sharp-ghost-mono.html2
-rw-r--r--doc/language-bindings/c-sharp-ghost-net.html2
-rw-r--r--doc/language-bindings/c-sharp-intro.html4
-rw-r--r--doc/language-bindings/demo-code.html2
-rw-r--r--doc/language-bindings/images/favicon.svg (renamed from doc/images/favicon.svg)0
-rw-r--r--doc/language-bindings/index.html2
-rw-r--r--doc/language-bindings/java-gsjavajar.html2
-rw-r--r--doc/language-bindings/java-intro.html4
-rw-r--r--doc/language-bindings/md/c-sharp-intro.md2
-rw-r--r--doc/language-bindings/md/java-intro.md2
-rw-r--r--doc/language-bindings/python-gsapi.html2
-rw-r--r--doc/language-bindings/python-intro.html2
-rw-r--r--doc/pscet_status.txt5415
-rw-r--r--doc/sample_downscale_device.htm235
-rw-r--r--doc/site.js14
-rw-r--r--doc/src/API.rst1387
-rw-r--r--doc/src/C-style.rst1060
-rw-r--r--doc/src/Develop.rst1650
-rw-r--r--doc/src/DeviceSubclassing.rst549
-rw-r--r--doc/src/Devices.rst1333
-rw-r--r--doc/src/Drivers.rst1732
-rw-r--r--doc/src/Fonts.rst419
-rw-r--r--doc/src/GPDL.rst448
-rw-r--r--doc/src/Install.rst274
-rw-r--r--doc/src/Language.rst1284
-rw-r--r--doc/src/LanguageBindings.rst131
-rw-r--r--doc/src/LanguageBindingsCSharp.rst2148
-rw-r--r--doc/src/LanguageBindingsJava.rst1415
-rw-r--r--doc/src/LanguageBindingsPython.rst969
-rw-r--r--doc/src/Lib.rst607
-rw-r--r--doc/src/Make.rst1031
-rw-r--r--doc/src/News.rst17
-rw-r--r--doc/src/Ps-style.rst330
-rw-r--r--doc/src/Ps2epsi.rst93
-rw-r--r--doc/src/Psfiles.rst460
-rw-r--r--doc/src/Readme.rst239
-rw-r--r--doc/src/SampleDownscaleDevice.rst142
-rw-r--r--doc/src/SavedPages.rst171
-rw-r--r--doc/src/Source.rst222
-rw-r--r--doc/src/Unix-lpr.rst121
-rw-r--r--doc/src/UnsupportedDevices.rst4208
-rw-r--r--doc/src/Use.rst3163
-rw-r--r--doc/src/VectorDevices.rst1303
-rw-r--r--doc/src/_static/custom.css105
-rw-r--r--doc/src/_static/export-jar.pngbin0 -> 203606 bytes
-rw-r--r--doc/src/_static/favicon.svg39
-rw-r--r--doc/src/_static/ghostnet-wpf-example.pngbin0 -> 353078 bytes
-rw-r--r--doc/src/_static/ghostscript-white-plus-text.pngbin0 -> 22484 bytes
-rw-r--r--doc/src/_static/gsviewer.pngbin0 -> 63958 bytes
-rw-r--r--doc/src/_static/linking-jar.pngbin0 -> 112169 bytes
-rw-r--r--doc/src/conf.py249
-rw-r--r--doc/src/footer.rst7
-rw-r--r--doc/src/index.rst1
-rw-r--r--doc/src/requirements.txt1
-rw-r--r--doc/src/thirdparty.rst212
-rw-r--r--doc/src/toc.rst38
-rw-r--r--doc/style.css433
-rw-r--r--doc/subclass.htm722
-rw-r--r--doc/thirdparty.htm215
-rw-r--r--extract/Makefile26
-rw-r--r--extract/README19
-rw-r--r--extract/include/extract.h33
-rw-r--r--extract/src/astring.c14
-rw-r--r--extract/src/boxer.c621
-rw-r--r--extract/src/buffer-test.c20
-rw-r--r--extract/src/buffer.c30
-rw-r--r--extract/src/document.c34
-rw-r--r--extract/src/document.h93
-rw-r--r--extract/src/docx.c167
-rw-r--r--extract/src/docx.h4
-rw-r--r--extract/src/docx_template.c38
-rwxr-xr-xextract/src/docx_template_build.py46
-rw-r--r--extract/src/extract-exe.c26
-rw-r--r--extract/src/extract.c662
-rw-r--r--extract/src/html.c228
-rw-r--r--extract/src/join.c215
-rw-r--r--extract/src/mem.c2
-rw-r--r--extract/src/memento.c5
-rwxr-xr-xextract/src/memento.py6
-rw-r--r--extract/src/misc-test.c16
-rw-r--r--extract/src/odt.c134
-rw-r--r--extract/src/odt.h2
-rw-r--r--extract/src/odt_template.c16
-rw-r--r--extract/src/outf.c2
-rw-r--r--extract/src/rect.c57
-rw-r--r--extract/src/text.c11
-rw-r--r--extract/src/xml.c3
-rw-r--r--extract/src/zip-test.c24
-rw-r--r--extract/src/zip.c64
-rw-r--r--extract/test/Python2clipped.pdf.mutool-norotate.docx.dir.ref/word/document.xml12
-rw-r--r--extract/test/Python2clipped.pdf.mutool.docx.dir.ref/word/document.xml30
-rw-r--r--extract/test/Python2clipped.pdf.mutool.text.ref12
-rw-r--r--extract/test/agstat.pdf.mutool.html.ref516
-rw-r--r--extract/test/background_lines_1.pdf.mutool.html.ref69
-rw-r--r--extract/test/background_lines_2.pdf.mutool.html.ref60
-rw-r--r--extract/test/column_span_1.pdf.mutool.html.ref646
-rw-r--r--extract/test/column_span_2.pdf.mutool.html.ref57
-rw-r--r--extract/test/electoral_roll.pdf.mutool.html.ref116
-rw-r--r--extract/test/rotated.pdf.mutool.html.ref149
-rw-r--r--extract/test/row_span.pdf.mutool.html.ref136
-rw-r--r--extract/test/table.pdf.mutool.html.ref54
-rw-r--r--extract/test/twotables_1.pdf.mutool.html.ref73
-rw-r--r--extract/test/twotables_2.pdf.mutool.html.ref226
-rw-r--r--freetype/CMakeLists.txt68
-rw-r--r--freetype/ChangeLog1526
-rw-r--r--freetype/ChangeLog.202613
-rw-r--r--freetype/ChangeLog.219438
-rw-r--r--freetype/ChangeLog.222837
-rw-r--r--freetype/ChangeLog.237948
-rw-r--r--freetype/ChangeLog.246360
-rw-r--r--freetype/ChangeLog.255161
-rw-r--r--freetype/ChangeLog.265711
-rw-r--r--freetype/ChangeLog.272106
-rw-r--r--freetype/ChangeLog.283136
-rw-r--r--freetype/ChangeLog.292352
-rw-r--r--freetype/Makefile2
-rw-r--r--freetype/README10
-rw-r--r--freetype/README.git2
-rwxr-xr-xfreetype/autogen.sh4
-rw-r--r--freetype/builds/amiga/README2
-rw-r--r--freetype/builds/amiga/include/config/ftconfig.h2
-rw-r--r--freetype/builds/amiga/include/config/ftmodule.h2
-rw-r--r--freetype/builds/amiga/makefile2
-rw-r--r--freetype/builds/amiga/makefile.os42
-rw-r--r--freetype/builds/amiga/smakefile2
-rw-r--r--freetype/builds/amiga/src/base/ftdebug.c2
-rw-r--r--freetype/builds/amiga/src/base/ftsystem.c2
-rw-r--r--freetype/builds/ansi/ansi-def.mk2
-rw-r--r--freetype/builds/ansi/ansi.mk2
-rw-r--r--freetype/builds/beos/beos-def.mk2
-rw-r--r--freetype/builds/beos/beos.mk2
-rw-r--r--freetype/builds/beos/detect.mk2
-rw-r--r--freetype/builds/cmake/FindBrotliDec.cmake2
-rw-r--r--freetype/builds/cmake/iOS.cmake2
-rwxr-xr-xfreetype/builds/cmake/testbuild.sh2
-rw-r--r--freetype/builds/compiler/ansi-cc.mk2
-rw-r--r--freetype/builds/compiler/bcc-dev.mk2
-rw-r--r--freetype/builds/compiler/bcc.mk2
-rw-r--r--freetype/builds/compiler/emx.mk2
-rw-r--r--freetype/builds/compiler/gcc-dev.mk2
-rw-r--r--freetype/builds/compiler/gcc.mk2
-rw-r--r--freetype/builds/compiler/intelc.mk2
-rw-r--r--freetype/builds/compiler/unix-lcc.mk2
-rw-r--r--freetype/builds/compiler/visualage.mk2
-rw-r--r--freetype/builds/compiler/visualc.mk2
-rw-r--r--freetype/builds/compiler/watcom.mk2
-rw-r--r--freetype/builds/compiler/win-lcc.mk2
-rw-r--r--freetype/builds/detect.mk2
-rw-r--r--freetype/builds/dos/detect.mk2
-rw-r--r--freetype/builds/dos/dos-def.mk2
-rw-r--r--freetype/builds/dos/dos-emx.mk2
-rw-r--r--freetype/builds/dos/dos-gcc.mk2
-rw-r--r--freetype/builds/dos/dos-wat.mk2
-rw-r--r--freetype/builds/exports.mk2
-rw-r--r--freetype/builds/freetype.mk2
-rw-r--r--freetype/builds/link_dos.mk2
-rw-r--r--freetype/builds/link_std.mk2
-rw-r--r--freetype/builds/mac/freetype-Info.plist2
-rw-r--r--freetype/builds/mac/ftmac.c4
-rw-r--r--freetype/builds/meson/extract_freetype_version.py4
-rw-r--r--freetype/builds/meson/extract_libtool_version.py4
-rw-r--r--freetype/builds/meson/generate_reference_docs.py4
-rw-r--r--freetype/builds/meson/parse_modules_cfg.py5
-rw-r--r--freetype/builds/meson/process_ftoption_h.py4
-rw-r--r--freetype/builds/modules.mk2
-rw-r--r--freetype/builds/os2/detect.mk2
-rw-r--r--freetype/builds/os2/os2-def.mk2
-rw-r--r--freetype/builds/os2/os2-dev.mk2
-rw-r--r--freetype/builds/os2/os2-gcc.mk2
-rw-r--r--freetype/builds/symbian/bld.inf2
-rw-r--r--freetype/builds/symbian/freetype.mmp2
-rw-r--r--freetype/builds/toplevel.mk9
-rw-r--r--freetype/builds/unix/aclocal.m4251
-rw-r--r--freetype/builds/unix/configure.ac121
-rw-r--r--freetype/builds/unix/configure.raw119
-rw-r--r--freetype/builds/unix/detect.mk2
-rw-r--r--freetype/builds/unix/freetype-config.in2
-rw-r--r--freetype/builds/unix/freetype2.in8
-rw-r--r--freetype/builds/unix/freetype2.m42
-rw-r--r--freetype/builds/unix/ft-munmap.m42
-rw-r--r--freetype/builds/unix/ftconfig.h.in2
-rw-r--r--freetype/builds/unix/ftsystem.c2
-rw-r--r--freetype/builds/unix/install.mk2
-rw-r--r--[-rwxr-xr-x]freetype/builds/unix/ltmain.sh855
-rw-r--r--freetype/builds/unix/unix-cc.in12
-rw-r--r--freetype/builds/unix/unix-def.in36
-rw-r--r--freetype/builds/unix/unix-dev.mk2
-rw-r--r--freetype/builds/unix/unix-lcc.mk2
-rw-r--r--freetype/builds/unix/unix.mk2
-rw-r--r--freetype/builds/unix/unixddef.mk2
-rw-r--r--freetype/builds/vms/ftconfig.h2
-rw-r--r--freetype/builds/vms/ftsystem.c2
-rw-r--r--freetype/builds/wince/ftdebug.c2
-rw-r--r--freetype/builds/wince/vc2005-ce/index.html2
-rw-r--r--freetype/builds/wince/vc2008-ce/index.html2
-rw-r--r--freetype/builds/windows/detect.mk2
-rw-r--r--freetype/builds/windows/ftdebug.c8
-rw-r--r--freetype/builds/windows/ftsystem.c91
-rw-r--r--freetype/builds/windows/vc2010/freetype.vcxproj1
-rw-r--r--freetype/builds/windows/vc2010/freetype.vcxproj.filters5
-rw-r--r--freetype/builds/windows/vc2010/index.html2
-rw-r--r--freetype/builds/windows/visualc/freetype.vcproj8
-rw-r--r--freetype/builds/windows/visualc/index.html2
-rw-r--r--freetype/builds/windows/visualce/index.html2
-rw-r--r--freetype/builds/windows/w32-bcc.mk2
-rw-r--r--freetype/builds/windows/w32-bccd.mk2
-rw-r--r--freetype/builds/windows/w32-dev.mk2
-rw-r--r--freetype/builds/windows/w32-gcc.mk2
-rw-r--r--freetype/builds/windows/w32-icc.mk2
-rw-r--r--freetype/builds/windows/w32-intl.mk2
-rw-r--r--freetype/builds/windows/w32-lcc.mk2
-rw-r--r--freetype/builds/windows/w32-mingw32.mk2
-rw-r--r--freetype/builds/windows/w32-vcc.mk2
-rw-r--r--freetype/builds/windows/w32-wat.mk2
-rw-r--r--freetype/builds/windows/win32-def.mk2
-rw-r--r--freetype/devel/ft2build.h2
-rw-r--r--freetype/devel/ftoption.h22
-rw-r--r--freetype/docs/CHANGES83
-rw-r--r--freetype/docs/CUSTOMIZE2
-rw-r--r--freetype/docs/DEBUG2
-rw-r--r--freetype/docs/DOCGUIDE2
-rw-r--r--freetype/docs/INSTALL2
-rw-r--r--freetype/docs/INSTALL.ANY2
-rw-r--r--freetype/docs/INSTALL.CROSS2
-rw-r--r--freetype/docs/INSTALL.GNU2
-rw-r--r--freetype/docs/INSTALL.UNIX2
-rw-r--r--freetype/docs/INSTALL.VMS2
-rw-r--r--freetype/docs/LICENSE.TXT39
-rw-r--r--freetype/docs/TODO2
-rw-r--r--freetype/docs/VERSIONS.TXT4
-rw-r--r--freetype/docs/formats.txt2
-rw-r--r--freetype/docs/freetype-config.12
-rw-r--r--freetype/docs/oldlogs/ChangeLog.202
-rw-r--r--freetype/docs/oldlogs/ChangeLog.212
-rw-r--r--freetype/docs/oldlogs/ChangeLog.2102
-rw-r--r--freetype/docs/oldlogs/ChangeLog.222
-rw-r--r--freetype/docs/oldlogs/ChangeLog.232
-rw-r--r--freetype/docs/oldlogs/ChangeLog.242
-rw-r--r--freetype/docs/oldlogs/ChangeLog.252
-rw-r--r--freetype/docs/oldlogs/ChangeLog.262
-rw-r--r--freetype/docs/oldlogs/ChangeLog.272
-rw-r--r--freetype/docs/oldlogs/ChangeLog.282
-rw-r--r--freetype/docs/oldlogs/ChangeLog.292
-rw-r--r--freetype/docs/raster.txt2
-rw-r--r--freetype/docs/reference/404.html38
-rw-r--r--freetype/docs/reference/assets/fonts/font-awesome.css4
-rw-r--r--freetype/docs/reference/assets/fonts/material-icons.css13
-rw-r--r--freetype/docs/reference/assets/fonts/specimen/FontAwesome.ttfbin165548 -> 0 bytes
-rw-r--r--freetype/docs/reference/assets/fonts/specimen/FontAwesome.woffbin98024 -> 0 bytes
-rw-r--r--freetype/docs/reference/assets/fonts/specimen/FontAwesome.woff2bin77160 -> 0 bytes
-rw-r--r--freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.ttfbin128180 -> 0 bytes
-rw-r--r--freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.woffbin57620 -> 0 bytes
-rw-r--r--freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.woff2bin44300 -> 0 bytes
-rw-r--r--freetype/docs/reference/assets/images/icons/bitbucket.1b09e088.svg1
-rw-r--r--freetype/docs/reference/assets/images/icons/github.f0b8504a.svg1
-rw-r--r--freetype/docs/reference/assets/images/icons/gitlab.6dd19c00.svg1
-rw-r--r--freetype/docs/reference/assets/javascripts/application.c33a9706.js60
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.ar.js20
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.da.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.de.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.du.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.es.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.fi.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.fr.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.hu.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.it.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.ja.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.jp.js1
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.multi.js1
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.nl.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.no.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.pt.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.ro.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.ru.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.stemmer.support.js9
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.sv.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.th.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.tr.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/lunr/lunr.vi.js17
-rw-r--r--freetype/docs/reference/assets/javascripts/modernizr.86422ebf.js1
-rw-r--r--freetype/docs/reference/assets/stylesheets/application-palette.a8b3c06d.css1
-rw-r--r--freetype/docs/reference/assets/stylesheets/application.adb8469c.css1
-rw-r--r--freetype/docs/reference/ft2-auto_hinter.html38
-rw-r--r--freetype/docs/reference/ft2-base_interface.html250
-rw-r--r--freetype/docs/reference/ft2-basic_types.html44
-rw-r--r--freetype/docs/reference/ft2-bdf_fonts.html38
-rw-r--r--freetype/docs/reference/ft2-bitmap_handling.html38
-rw-r--r--freetype/docs/reference/ft2-bzip2.html38
-rw-r--r--freetype/docs/reference/ft2-cache_subsystem.html38
-rw-r--r--freetype/docs/reference/ft2-cff_driver.html38
-rw-r--r--freetype/docs/reference/ft2-cid_fonts.html38
-rw-r--r--freetype/docs/reference/ft2-color_management.html38
-rw-r--r--freetype/docs/reference/ft2-computations.html38
-rw-r--r--freetype/docs/reference/ft2-debugging_apis.html38
-rw-r--r--freetype/docs/reference/ft2-error_code_values.html42
-rw-r--r--freetype/docs/reference/ft2-error_enumerations.html38
-rw-r--r--freetype/docs/reference/ft2-font_formats.html42
-rw-r--r--freetype/docs/reference/ft2-gasp_table.html38
-rw-r--r--freetype/docs/reference/ft2-glyph_management.html152
-rw-r--r--freetype/docs/reference/ft2-glyph_stroker.html38
-rw-r--r--freetype/docs/reference/ft2-glyph_variants.html38
-rw-r--r--freetype/docs/reference/ft2-gx_validation.html38
-rw-r--r--freetype/docs/reference/ft2-gzip.html38
-rw-r--r--freetype/docs/reference/ft2-header_file_macros.html59
-rw-r--r--freetype/docs/reference/ft2-header_inclusion.html38
-rw-r--r--freetype/docs/reference/ft2-incremental.html38
-rw-r--r--freetype/docs/reference/ft2-index.html79
-rw-r--r--freetype/docs/reference/ft2-layer_management.html42
-rw-r--r--freetype/docs/reference/ft2-lcd_rendering.html38
-rw-r--r--freetype/docs/reference/ft2-list_processing.html38
-rw-r--r--freetype/docs/reference/ft2-lzw.html38
-rw-r--r--freetype/docs/reference/ft2-mac_specific.html38
-rw-r--r--freetype/docs/reference/ft2-module_management.html38
-rw-r--r--freetype/docs/reference/ft2-multiple_masters.html39
-rw-r--r--freetype/docs/reference/ft2-ot_svg_driver.html1256
-rw-r--r--freetype/docs/reference/ft2-ot_validation.html38
-rw-r--r--freetype/docs/reference/ft2-outline_processing.html42
-rw-r--r--freetype/docs/reference/ft2-parameter_tags.html60
-rw-r--r--freetype/docs/reference/ft2-pcf_driver.html42
-rw-r--r--freetype/docs/reference/ft2-pfr_fonts.html38
-rw-r--r--freetype/docs/reference/ft2-preamble.html38
-rw-r--r--freetype/docs/reference/ft2-properties.html79
-rw-r--r--freetype/docs/reference/ft2-quick_advance.html38
-rw-r--r--freetype/docs/reference/ft2-raster.html38
-rw-r--r--freetype/docs/reference/ft2-sfnt_names.html38
-rw-r--r--freetype/docs/reference/ft2-sizes_management.html38
-rw-r--r--freetype/docs/reference/ft2-svg_fonts.html1582
-rw-r--r--freetype/docs/reference/ft2-system_interface.html38
-rw-r--r--freetype/docs/reference/ft2-t1_cid_driver.html38
-rw-r--r--freetype/docs/reference/ft2-truetype_engine.html38
-rw-r--r--freetype/docs/reference/ft2-truetype_tables.html38
-rw-r--r--freetype/docs/reference/ft2-tt_driver.html45
-rw-r--r--freetype/docs/reference/ft2-type1_tables.html60
-rw-r--r--freetype/docs/reference/ft2-user_allocation.html38
-rw-r--r--freetype/docs/reference/ft2-version.html40
-rw-r--r--freetype/docs/reference/ft2-winfnt_fonts.html42
-rw-r--r--freetype/docs/reference/index.html50
-rw-r--r--freetype/docs/reference/search/search_index.json2
-rw-r--r--freetype/docs/reference/sitemap.xml116
-rw-r--r--freetype/docs/reference/sitemap.xml.gzbin226 -> 229 bytes
-rw-r--r--freetype/docs/release19
-rw-r--r--freetype/include/freetype/config/ftconfig.h2
-rw-r--r--freetype/include/freetype/config/ftheader.h14
-rw-r--r--freetype/include/freetype/config/ftmodule.h1
-rw-r--r--freetype/include/freetype/config/ftoption.h22
-rw-r--r--freetype/include/freetype/config/ftstdlib.h2
-rw-r--r--freetype/include/freetype/config/integer-types.h7
-rw-r--r--freetype/include/freetype/config/mac-support.h2
-rw-r--r--freetype/include/freetype/config/public-macros.h5
-rw-r--r--freetype/include/freetype/freetype.h278
-rw-r--r--freetype/include/freetype/ftadvanc.h2
-rw-r--r--freetype/include/freetype/ftbbox.h2
-rw-r--r--freetype/include/freetype/ftbdf.h2
-rw-r--r--freetype/include/freetype/ftbitmap.h2
-rw-r--r--freetype/include/freetype/ftbzip2.h2
-rw-r--r--freetype/include/freetype/ftcache.h2
-rw-r--r--freetype/include/freetype/ftchapters.h2
-rw-r--r--freetype/include/freetype/ftcid.h2
-rw-r--r--freetype/include/freetype/ftcolor.h8
-rw-r--r--freetype/include/freetype/ftdriver.h75
-rw-r--r--freetype/include/freetype/fterrdef.h6
-rw-r--r--freetype/include/freetype/fterrors.h2
-rw-r--r--freetype/include/freetype/ftfntfmt.h2
-rw-r--r--freetype/include/freetype/ftgasp.h2
-rw-r--r--freetype/include/freetype/ftglyph.h102
-rw-r--r--freetype/include/freetype/ftgxval.h2
-rw-r--r--freetype/include/freetype/ftgzip.h2
-rw-r--r--freetype/include/freetype/ftimage.h19
-rw-r--r--freetype/include/freetype/ftincrem.h2
-rw-r--r--freetype/include/freetype/ftlcdfil.h2
-rw-r--r--freetype/include/freetype/ftlist.h2
-rw-r--r--freetype/include/freetype/ftlogging.h2
-rw-r--r--freetype/include/freetype/ftlzw.h2
-rw-r--r--freetype/include/freetype/ftmac.h2
-rw-r--r--freetype/include/freetype/ftmm.h5
-rw-r--r--freetype/include/freetype/ftmodapi.h2
-rw-r--r--freetype/include/freetype/ftmoderr.h2
-rw-r--r--freetype/include/freetype/ftotval.h2
-rw-r--r--freetype/include/freetype/ftoutln.h14
-rw-r--r--freetype/include/freetype/ftparams.h17
-rw-r--r--freetype/include/freetype/ftpfr.h2
-rw-r--r--freetype/include/freetype/ftrender.h2
-rw-r--r--freetype/include/freetype/ftsizes.h2
-rw-r--r--freetype/include/freetype/ftsnames.h2
-rw-r--r--freetype/include/freetype/ftstroke.h2
-rw-r--r--freetype/include/freetype/ftsynth.h2
-rw-r--r--freetype/include/freetype/ftsystem.h2
-rw-r--r--freetype/include/freetype/fttrigon.h2
-rw-r--r--freetype/include/freetype/fttypes.h2
-rw-r--r--freetype/include/freetype/ftwinfnt.h2
-rw-r--r--freetype/include/freetype/internal/autohint.h2
-rw-r--r--freetype/include/freetype/internal/cffotypes.h2
-rw-r--r--freetype/include/freetype/internal/cfftypes.h2
-rw-r--r--freetype/include/freetype/internal/compiler-macros.h10
-rw-r--r--freetype/include/freetype/internal/ftcalc.h15
-rw-r--r--freetype/include/freetype/internal/ftdebug.h2
-rw-r--r--freetype/include/freetype/internal/ftdrv.h2
-rw-r--r--freetype/include/freetype/internal/ftgloadr.h2
-rw-r--r--freetype/include/freetype/internal/ftmemory.h2
-rw-r--r--freetype/include/freetype/internal/ftobjs.h5
-rw-r--r--freetype/include/freetype/internal/ftpsprop.h2
-rw-r--r--freetype/include/freetype/internal/ftrfork.h2
-rw-r--r--freetype/include/freetype/internal/ftserv.h2
-rw-r--r--freetype/include/freetype/internal/ftstream.h2
-rw-r--r--freetype/include/freetype/internal/fttrace.h6
-rw-r--r--freetype/include/freetype/internal/ftvalid.h2
-rw-r--r--freetype/include/freetype/internal/psaux.h2
-rw-r--r--freetype/include/freetype/internal/pshints.h2
-rw-r--r--freetype/include/freetype/internal/services/svbdf.h2
-rw-r--r--freetype/include/freetype/internal/services/svcfftl.h2
-rw-r--r--freetype/include/freetype/internal/services/svcid.h2
-rw-r--r--freetype/include/freetype/internal/services/svfntfmt.h2
-rw-r--r--freetype/include/freetype/internal/services/svgldict.h2
-rw-r--r--freetype/include/freetype/internal/services/svgxval.h2
-rw-r--r--freetype/include/freetype/internal/services/svkern.h2
-rw-r--r--freetype/include/freetype/internal/services/svmetric.h2
-rw-r--r--freetype/include/freetype/internal/services/svmm.h2
-rw-r--r--freetype/include/freetype/internal/services/svotval.h2
-rw-r--r--freetype/include/freetype/internal/services/svpfr.h2
-rw-r--r--freetype/include/freetype/internal/services/svpostnm.h2
-rw-r--r--freetype/include/freetype/internal/services/svprop.h2
-rw-r--r--freetype/include/freetype/internal/services/svpscmap.h2
-rw-r--r--freetype/include/freetype/internal/services/svpsinfo.h2
-rw-r--r--freetype/include/freetype/internal/services/svsfnt.h2
-rw-r--r--freetype/include/freetype/internal/services/svttcmap.h2
-rw-r--r--freetype/include/freetype/internal/services/svtteng.h2
-rw-r--r--freetype/include/freetype/internal/services/svttglyf.h2
-rw-r--r--freetype/include/freetype/internal/services/svwinfnt.h2
-rw-r--r--freetype/include/freetype/internal/sfnt.h44
-rw-r--r--freetype/include/freetype/internal/svginterface.h46
-rw-r--r--freetype/include/freetype/internal/t1types.h2
-rw-r--r--freetype/include/freetype/internal/tttypes.h14
-rw-r--r--freetype/include/freetype/internal/wofftypes.h2
-rw-r--r--freetype/include/freetype/otsvg.h336
-rw-r--r--freetype/include/freetype/t1tables.h168
-rw-r--r--freetype/include/freetype/ttnameid.h2
-rw-r--r--freetype/include/freetype/tttables.h2
-rw-r--r--freetype/include/freetype/tttags.h3
-rw-r--r--freetype/include/ft2build.h2
-rw-r--r--freetype/meson.build73
-rw-r--r--freetype/meson_options.txt8
-rw-r--r--freetype/modules.cfg5
-rw-r--r--freetype/src/autofit/afangles.c285
-rw-r--r--freetype/src/autofit/afangles.h7
-rw-r--r--freetype/src/autofit/afblue.c2
-rw-r--r--freetype/src/autofit/afblue.cin2
-rw-r--r--freetype/src/autofit/afblue.dat2
-rw-r--r--freetype/src/autofit/afblue.h2
-rw-r--r--freetype/src/autofit/afblue.hin2
-rw-r--r--freetype/src/autofit/afcjk.c14
-rw-r--r--freetype/src/autofit/afcjk.h2
-rw-r--r--freetype/src/autofit/afcover.h2
-rw-r--r--freetype/src/autofit/afdummy.c2
-rw-r--r--freetype/src/autofit/afdummy.h2
-rw-r--r--freetype/src/autofit/aferrors.h2
-rw-r--r--freetype/src/autofit/afglobal.c10
-rw-r--r--freetype/src/autofit/afglobal.h2
-rw-r--r--freetype/src/autofit/afhints.c6
-rw-r--r--freetype/src/autofit/afhints.h2
-rw-r--r--freetype/src/autofit/afindic.c2
-rw-r--r--freetype/src/autofit/afindic.h2
-rw-r--r--freetype/src/autofit/aflatin.c12
-rw-r--r--freetype/src/autofit/aflatin.h2
-rw-r--r--freetype/src/autofit/aflatin2.c2428
-rw-r--r--freetype/src/autofit/aflatin2.h46
-rw-r--r--freetype/src/autofit/afloader.c2
-rw-r--r--freetype/src/autofit/afloader.h2
-rw-r--r--freetype/src/autofit/afmodule.c2
-rw-r--r--freetype/src/autofit/afmodule.h2
-rw-r--r--freetype/src/autofit/afranges.c2
-rw-r--r--freetype/src/autofit/afranges.h2
-rw-r--r--freetype/src/autofit/afscript.h2
-rw-r--r--freetype/src/autofit/afshaper.c2
-rw-r--r--freetype/src/autofit/afshaper.h2
-rw-r--r--freetype/src/autofit/afstyles.h2
-rw-r--r--freetype/src/autofit/aftypes.h2
-rw-r--r--freetype/src/autofit/afwarp.c373
-rw-r--r--freetype/src/autofit/afwarp.h66
-rw-r--r--freetype/src/autofit/afwrtsys.h52
-rw-r--r--freetype/src/autofit/afws-decl.h2
-rw-r--r--freetype/src/autofit/afws-iter.h2
-rw-r--r--freetype/src/autofit/autofit.c2
-rw-r--r--freetype/src/autofit/module.mk2
-rw-r--r--freetype/src/autofit/rules.mk2
-rw-r--r--freetype/src/base/ftadvanc.c2
-rw-r--r--freetype/src/base/ftbase.c2
-rw-r--r--freetype/src/base/ftbase.h3
-rw-r--r--freetype/src/base/ftbbox.c2
-rw-r--r--freetype/src/base/ftbdf.c2
-rw-r--r--freetype/src/base/ftbitmap.c10
-rw-r--r--freetype/src/base/ftcalc.c2
-rw-r--r--freetype/src/base/ftcid.c2
-rw-r--r--freetype/src/base/ftcolor.c2
-rw-r--r--freetype/src/base/ftdbgmem.c2
-rw-r--r--freetype/src/base/ftdebug.c2
-rw-r--r--freetype/src/base/fterrors.c2
-rw-r--r--freetype/src/base/ftfntfmt.c2
-rw-r--r--freetype/src/base/ftfstype.c2
-rw-r--r--freetype/src/base/ftgasp.c2
-rw-r--r--freetype/src/base/ftgloadr.c16
-rw-r--r--freetype/src/base/ftglyph.c253
-rw-r--r--freetype/src/base/ftgxval.c2
-rw-r--r--freetype/src/base/fthash.c2
-rw-r--r--freetype/src/base/ftinit.c2
-rw-r--r--freetype/src/base/ftlcdfil.c2
-rw-r--r--freetype/src/base/ftmac.c8
-rw-r--r--freetype/src/base/ftmm.c2
-rw-r--r--freetype/src/base/ftobjs.c119
-rw-r--r--freetype/src/base/ftotval.c2
-rw-r--r--freetype/src/base/ftoutln.c2
-rw-r--r--freetype/src/base/ftpatent.c2
-rw-r--r--freetype/src/base/ftpfr.c2
-rw-r--r--freetype/src/base/ftpsprop.c2
-rw-r--r--freetype/src/base/ftrfork.c28
-rw-r--r--freetype/src/base/ftsnames.c2
-rw-r--r--freetype/src/base/ftstream.c2
-rw-r--r--freetype/src/base/ftstroke.c2
-rw-r--r--freetype/src/base/ftsynth.c2
-rw-r--r--freetype/src/base/ftsystem.c2
-rw-r--r--freetype/src/base/fttrigon.c2
-rw-r--r--freetype/src/base/fttype1.c2
-rw-r--r--freetype/src/base/ftutil.c2
-rw-r--r--freetype/src/base/ftver.rc8
-rw-r--r--freetype/src/base/ftwinfnt.c2
-rw-r--r--freetype/src/base/rules.mk2
-rw-r--r--freetype/src/bdf/README6
-rw-r--r--freetype/src/bdf/bdflib.c8
-rw-r--r--freetype/src/bzip2/ftbzip2.c47
-rw-r--r--freetype/src/bzip2/rules.mk2
-rw-r--r--freetype/src/cache/ftcache.c2
-rw-r--r--freetype/src/cache/ftcbasic.c6
-rw-r--r--freetype/src/cache/ftccache.c2
-rw-r--r--freetype/src/cache/ftccache.h4
-rw-r--r--freetype/src/cache/ftccback.h2
-rw-r--r--freetype/src/cache/ftccmap.c4
-rw-r--r--freetype/src/cache/ftcerror.h2
-rw-r--r--freetype/src/cache/ftcglyph.c2
-rw-r--r--freetype/src/cache/ftcglyph.h8
-rw-r--r--freetype/src/cache/ftcimage.c5
-rw-r--r--freetype/src/cache/ftcimage.h8
-rw-r--r--freetype/src/cache/ftcmanag.c2
-rw-r--r--freetype/src/cache/ftcmanag.h2
-rw-r--r--freetype/src/cache/ftcmru.c6
-rw-r--r--freetype/src/cache/ftcmru.h2
-rw-r--r--freetype/src/cache/ftcsbits.c10
-rw-r--r--freetype/src/cache/ftcsbits.h4
-rw-r--r--freetype/src/cache/rules.mk2
-rw-r--r--freetype/src/cff/cff.c2
-rw-r--r--freetype/src/cff/cffcmap.c4
-rw-r--r--freetype/src/cff/cffcmap.h2
-rw-r--r--freetype/src/cff/cffdrivr.c2
-rw-r--r--freetype/src/cff/cffdrivr.h2
-rw-r--r--freetype/src/cff/cfferrs.h2
-rw-r--r--freetype/src/cff/cffgload.c88
-rw-r--r--freetype/src/cff/cffgload.h2
-rw-r--r--freetype/src/cff/cffload.c2
-rw-r--r--freetype/src/cff/cffload.h2
-rw-r--r--freetype/src/cff/cffobjs.c6
-rw-r--r--freetype/src/cff/cffobjs.h2
-rw-r--r--freetype/src/cff/cffparse.c2
-rw-r--r--freetype/src/cff/cffparse.h2
-rw-r--r--freetype/src/cff/cfftoken.h2
-rw-r--r--freetype/src/cff/module.mk2
-rw-r--r--freetype/src/cff/rules.mk2
-rw-r--r--freetype/src/cid/ciderrs.h2
-rw-r--r--freetype/src/cid/cidgload.c2
-rw-r--r--freetype/src/cid/cidgload.h2
-rw-r--r--freetype/src/cid/cidload.c2
-rw-r--r--freetype/src/cid/cidload.h2
-rw-r--r--freetype/src/cid/cidobjs.c2
-rw-r--r--freetype/src/cid/cidobjs.h2
-rw-r--r--freetype/src/cid/cidparse.c2
-rw-r--r--freetype/src/cid/cidparse.h2
-rw-r--r--freetype/src/cid/cidriver.c2
-rw-r--r--freetype/src/cid/cidriver.h2
-rw-r--r--freetype/src/cid/cidtoken.h2
-rw-r--r--freetype/src/cid/module.mk2
-rw-r--r--freetype/src/cid/rules.mk2
-rw-r--r--freetype/src/cid/type1cid.c2
-rw-r--r--freetype/src/dlg/dlgwrap.c2
-rw-r--r--freetype/src/dlg/rules.mk2
-rw-r--r--freetype/src/gxvalid/README2
-rw-r--r--freetype/src/gxvalid/gxvalid.c2
-rw-r--r--freetype/src/gxvalid/gxvalid.h2
-rw-r--r--freetype/src/gxvalid/gxvbsln.c2
-rw-r--r--freetype/src/gxvalid/gxvcommn.c6
-rw-r--r--freetype/src/gxvalid/gxvcommn.h2
-rw-r--r--freetype/src/gxvalid/gxverror.h2
-rw-r--r--freetype/src/gxvalid/gxvfeat.c2
-rw-r--r--freetype/src/gxvalid/gxvfeat.h2
-rw-r--r--freetype/src/gxvalid/gxvfgen.c2
-rw-r--r--freetype/src/gxvalid/gxvjust.c2
-rw-r--r--freetype/src/gxvalid/gxvkern.c2
-rw-r--r--freetype/src/gxvalid/gxvlcar.c2
-rw-r--r--freetype/src/gxvalid/gxvmod.c2
-rw-r--r--freetype/src/gxvalid/gxvmod.h2
-rw-r--r--freetype/src/gxvalid/gxvmort.c2
-rw-r--r--freetype/src/gxvalid/gxvmort.h2
-rw-r--r--freetype/src/gxvalid/gxvmort0.c2
-rw-r--r--freetype/src/gxvalid/gxvmort1.c2
-rw-r--r--freetype/src/gxvalid/gxvmort2.c2
-rw-r--r--freetype/src/gxvalid/gxvmort4.c2
-rw-r--r--freetype/src/gxvalid/gxvmort5.c2
-rw-r--r--freetype/src/gxvalid/gxvmorx.c2
-rw-r--r--freetype/src/gxvalid/gxvmorx.h2
-rw-r--r--freetype/src/gxvalid/gxvmorx0.c2
-rw-r--r--freetype/src/gxvalid/gxvmorx1.c2
-rw-r--r--freetype/src/gxvalid/gxvmorx2.c2
-rw-r--r--freetype/src/gxvalid/gxvmorx4.c2
-rw-r--r--freetype/src/gxvalid/gxvmorx5.c2
-rw-r--r--freetype/src/gxvalid/gxvopbd.c2
-rw-r--r--freetype/src/gxvalid/gxvprop.c2
-rw-r--r--freetype/src/gxvalid/gxvtrak.c2
-rw-r--r--freetype/src/gxvalid/module.mk2
-rw-r--r--freetype/src/gxvalid/rules.mk2
-rw-r--r--freetype/src/gzip/README.freetype22
-rw-r--r--freetype/src/gzip/adler32.c188
-rw-r--r--freetype/src/gzip/crc32.c1116
-rw-r--r--freetype/src/gzip/crc32.h9446
-rw-r--r--freetype/src/gzip/ftgzip.c62
-rw-r--r--freetype/src/gzip/ftzconf.h530
-rw-r--r--freetype/src/gzip/gzguts.h219
-rw-r--r--freetype/src/gzip/infback.c641
-rw-r--r--freetype/src/gzip/infblock.c392
-rw-r--r--freetype/src/gzip/infblock.h36
-rw-r--r--freetype/src/gzip/infcodes.c254
-rw-r--r--freetype/src/gzip/infcodes.h31
-rw-r--r--freetype/src/gzip/inffast.c323
-rw-r--r--freetype/src/gzip/inffast.h11
-rw-r--r--freetype/src/gzip/inffixed.h241
-rw-r--r--freetype/src/gzip/inflate.c1843
-rw-r--r--freetype/src/gzip/inflate.h131
-rw-r--r--freetype/src/gzip/inftrees.c710
-rw-r--r--freetype/src/gzip/inftrees.h112
-rw-r--r--freetype/src/gzip/infutil.c86
-rw-r--r--freetype/src/gzip/infutil.h98
-rw-r--r--freetype/src/gzip/patches/freetype-zlib.diff372
-rw-r--r--freetype/src/gzip/rules.mk14
-rw-r--r--freetype/src/gzip/zlib.h1962
-rw-r--r--freetype/src/gzip/zutil.c232
-rw-r--r--freetype/src/gzip/zutil.h208
-rw-r--r--freetype/src/lzw/ftlzw.c4
-rw-r--r--freetype/src/lzw/ftzopen.c2
-rw-r--r--freetype/src/lzw/ftzopen.h2
-rw-r--r--freetype/src/lzw/rules.mk2
-rw-r--r--freetype/src/otvalid/module.mk2
-rw-r--r--freetype/src/otvalid/otvalid.c2
-rw-r--r--freetype/src/otvalid/otvalid.h2
-rw-r--r--freetype/src/otvalid/otvbase.c2
-rw-r--r--freetype/src/otvalid/otvcommn.c2
-rw-r--r--freetype/src/otvalid/otvcommn.h2
-rw-r--r--freetype/src/otvalid/otverror.h2
-rw-r--r--freetype/src/otvalid/otvgdef.c2
-rw-r--r--freetype/src/otvalid/otvgpos.c2
-rw-r--r--freetype/src/otvalid/otvgpos.h2
-rw-r--r--freetype/src/otvalid/otvgsub.c2
-rw-r--r--freetype/src/otvalid/otvjstf.c2
-rw-r--r--freetype/src/otvalid/otvmath.c2
-rw-r--r--freetype/src/otvalid/otvmod.c2
-rw-r--r--freetype/src/otvalid/otvmod.h2
-rw-r--r--freetype/src/otvalid/rules.mk2
-rw-r--r--freetype/src/pcf/pcfread.c25
-rw-r--r--freetype/src/pfr/module.mk2
-rw-r--r--freetype/src/pfr/pfr.c2
-rw-r--r--freetype/src/pfr/pfrcmap.c2
-rw-r--r--freetype/src/pfr/pfrcmap.h2
-rw-r--r--freetype/src/pfr/pfrdrivr.c2
-rw-r--r--freetype/src/pfr/pfrdrivr.h2
-rw-r--r--freetype/src/pfr/pfrerror.h2
-rw-r--r--freetype/src/pfr/pfrgload.c2
-rw-r--r--freetype/src/pfr/pfrgload.h2
-rw-r--r--freetype/src/pfr/pfrload.c4
-rw-r--r--freetype/src/pfr/pfrload.h2
-rw-r--r--freetype/src/pfr/pfrobjs.c4
-rw-r--r--freetype/src/pfr/pfrobjs.h2
-rw-r--r--freetype/src/pfr/pfrsbit.c2
-rw-r--r--freetype/src/pfr/pfrsbit.h2
-rw-r--r--freetype/src/pfr/pfrtypes.h2
-rw-r--r--freetype/src/pfr/rules.mk2
-rw-r--r--freetype/src/psaux/afmparse.c2
-rw-r--r--freetype/src/psaux/afmparse.h2
-rw-r--r--freetype/src/psaux/cffdecode.c4
-rw-r--r--freetype/src/psaux/cffdecode.h2
-rw-r--r--freetype/src/psaux/module.mk2
-rw-r--r--freetype/src/psaux/psaux.c2
-rw-r--r--freetype/src/psaux/psauxerr.h2
-rw-r--r--freetype/src/psaux/psauxmod.c2
-rw-r--r--freetype/src/psaux/psauxmod.h2
-rw-r--r--freetype/src/psaux/psconv.c10
-rw-r--r--freetype/src/psaux/psconv.h2
-rw-r--r--freetype/src/psaux/psintrp.c16
-rw-r--r--freetype/src/psaux/psobjs.c81
-rw-r--r--freetype/src/psaux/psobjs.h2
-rw-r--r--freetype/src/psaux/rules.mk2
-rw-r--r--freetype/src/psaux/t1cmap.c2
-rw-r--r--freetype/src/psaux/t1cmap.h2
-rw-r--r--freetype/src/psaux/t1decode.c2
-rw-r--r--freetype/src/psaux/t1decode.h2
-rw-r--r--freetype/src/pshinter/module.mk2
-rw-r--r--freetype/src/pshinter/pshalgo.c41
-rw-r--r--freetype/src/pshinter/pshalgo.h2
-rw-r--r--freetype/src/pshinter/pshglob.c4
-rw-r--r--freetype/src/pshinter/pshglob.h2
-rw-r--r--freetype/src/pshinter/pshinter.c2
-rw-r--r--freetype/src/pshinter/pshmod.c2
-rw-r--r--freetype/src/pshinter/pshmod.h2
-rw-r--r--freetype/src/pshinter/pshnterr.h2
-rw-r--r--freetype/src/pshinter/pshrec.c105
-rw-r--r--freetype/src/pshinter/pshrec.h2
-rw-r--r--freetype/src/pshinter/rules.mk2
-rw-r--r--freetype/src/psnames/module.mk2
-rw-r--r--freetype/src/psnames/psmodule.c2
-rw-r--r--freetype/src/psnames/psmodule.h2
-rw-r--r--freetype/src/psnames/psnamerr.h2
-rw-r--r--freetype/src/psnames/psnames.c2
-rw-r--r--freetype/src/psnames/pstables.h2
-rw-r--r--freetype/src/psnames/rules.mk2
-rw-r--r--freetype/src/raster/ftmisc.h2
-rw-r--r--freetype/src/raster/ftraster.c4
-rw-r--r--freetype/src/raster/ftraster.h2
-rw-r--r--freetype/src/raster/ftrend1.c2
-rw-r--r--freetype/src/raster/ftrend1.h2
-rw-r--r--freetype/src/raster/module.mk2
-rw-r--r--freetype/src/raster/raster.c2
-rw-r--r--freetype/src/raster/rasterrs.h2
-rw-r--r--freetype/src/raster/rules.mk2
-rw-r--r--freetype/src/sdf/ftbsdf.c36
-rw-r--r--freetype/src/sdf/ftsdf.c101
-rw-r--r--freetype/src/sdf/ftsdf.h2
-rw-r--r--freetype/src/sdf/ftsdfcommon.c2
-rw-r--r--freetype/src/sdf/ftsdfcommon.h4
-rw-r--r--freetype/src/sdf/ftsdferrs.h2
-rw-r--r--freetype/src/sdf/ftsdfrend.c20
-rw-r--r--freetype/src/sdf/ftsdfrend.h2
-rw-r--r--freetype/src/sdf/module.mk2
-rw-r--r--freetype/src/sdf/rules.mk2
-rw-r--r--freetype/src/sdf/sdf.c2
-rw-r--r--freetype/src/sfnt/module.mk2
-rw-r--r--freetype/src/sfnt/pngshim.c6
-rw-r--r--freetype/src/sfnt/pngshim.h2
-rw-r--r--freetype/src/sfnt/rules.mk3
-rw-r--r--freetype/src/sfnt/sfdriver.c29
-rw-r--r--freetype/src/sfnt/sfdriver.h2
-rw-r--r--freetype/src/sfnt/sferrors.h2
-rw-r--r--freetype/src/sfnt/sfnt.c3
-rw-r--r--freetype/src/sfnt/sfobjs.c83
-rw-r--r--freetype/src/sfnt/sfobjs.h2
-rw-r--r--freetype/src/sfnt/sfwoff.c3
-rw-r--r--freetype/src/sfnt/sfwoff.h2
-rw-r--r--freetype/src/sfnt/sfwoff2.c70
-rw-r--r--freetype/src/sfnt/sfwoff2.h3
-rw-r--r--freetype/src/sfnt/ttbdf.c2
-rw-r--r--freetype/src/sfnt/ttbdf.h2
-rw-r--r--freetype/src/sfnt/ttcmap.c4
-rw-r--r--freetype/src/sfnt/ttcmap.h2
-rw-r--r--freetype/src/sfnt/ttcmapc.h2
-rw-r--r--freetype/src/sfnt/ttcolr.c43
-rw-r--r--freetype/src/sfnt/ttcolr.h2
-rw-r--r--freetype/src/sfnt/ttcpal.c2
-rw-r--r--freetype/src/sfnt/ttcpal.h2
-rw-r--r--freetype/src/sfnt/ttkern.c21
-rw-r--r--freetype/src/sfnt/ttkern.h2
-rw-r--r--freetype/src/sfnt/ttload.c3
-rw-r--r--freetype/src/sfnt/ttload.h2
-rw-r--r--freetype/src/sfnt/ttmtx.c2
-rw-r--r--freetype/src/sfnt/ttmtx.h2
-rw-r--r--freetype/src/sfnt/ttpost.c2
-rw-r--r--freetype/src/sfnt/ttpost.h2
-rw-r--r--freetype/src/sfnt/ttsbit.c37
-rw-r--r--freetype/src/sfnt/ttsbit.h2
-rw-r--r--freetype/src/sfnt/ttsvg.c403
-rw-r--r--freetype/src/sfnt/ttsvg.h43
-rw-r--r--freetype/src/sfnt/woff2tags.c2
-rw-r--r--freetype/src/sfnt/woff2tags.h2
-rw-r--r--freetype/src/smooth/ftgrays.c4
-rw-r--r--freetype/src/smooth/ftgrays.h2
-rw-r--r--freetype/src/smooth/ftsmerrs.h2
-rw-r--r--freetype/src/smooth/ftsmooth.c2
-rw-r--r--freetype/src/smooth/ftsmooth.h2
-rw-r--r--freetype/src/smooth/module.mk2
-rw-r--r--freetype/src/smooth/rules.mk2
-rw-r--r--freetype/src/smooth/smooth.c2
-rw-r--r--freetype/src/svg/ftsvg.c350
-rw-r--r--freetype/src/svg/ftsvg.h35
-rw-r--r--freetype/src/svg/module.mk23
-rw-r--r--freetype/src/svg/rules.mk70
-rw-r--r--freetype/src/svg/svg.c24
-rw-r--r--freetype/src/svg/svgtypes.h42
-rw-r--r--freetype/src/tools/afblue.pl2
-rw-r--r--freetype/src/tools/glnames.py2
-rwxr-xr-xfreetype/src/tools/update-copyright-year2
-rw-r--r--freetype/src/truetype/module.mk2
-rw-r--r--freetype/src/truetype/rules.mk2
-rw-r--r--freetype/src/truetype/truetype.c2
-rw-r--r--freetype/src/truetype/ttdriver.c2
-rw-r--r--freetype/src/truetype/ttdriver.h2
-rw-r--r--freetype/src/truetype/tterrors.h2
-rw-r--r--freetype/src/truetype/ttgload.c227
-rw-r--r--freetype/src/truetype/ttgload.h2
-rw-r--r--freetype/src/truetype/ttgxvar.c18
-rw-r--r--freetype/src/truetype/ttgxvar.h2
-rw-r--r--freetype/src/truetype/ttinterp.c55
-rw-r--r--freetype/src/truetype/ttinterp.h2
-rw-r--r--freetype/src/truetype/ttobjs.c7
-rw-r--r--freetype/src/truetype/ttobjs.h4
-rw-r--r--freetype/src/truetype/ttpload.c52
-rw-r--r--freetype/src/truetype/ttpload.h2
-rw-r--r--freetype/src/truetype/ttsubpix.c2
-rw-r--r--freetype/src/truetype/ttsubpix.h2
-rw-r--r--freetype/src/type1/module.mk2
-rw-r--r--freetype/src/type1/rules.mk2
-rw-r--r--freetype/src/type1/t1afm.c4
-rw-r--r--freetype/src/type1/t1afm.h2
-rw-r--r--freetype/src/type1/t1driver.c2
-rw-r--r--freetype/src/type1/t1driver.h2
-rw-r--r--freetype/src/type1/t1errors.h2
-rw-r--r--freetype/src/type1/t1gload.c2
-rw-r--r--freetype/src/type1/t1gload.h2
-rw-r--r--freetype/src/type1/t1load.c20
-rw-r--r--freetype/src/type1/t1load.h2
-rw-r--r--freetype/src/type1/t1objs.c6
-rw-r--r--freetype/src/type1/t1objs.h2
-rw-r--r--freetype/src/type1/t1parse.c2
-rw-r--r--freetype/src/type1/t1parse.h2
-rw-r--r--freetype/src/type1/t1tokens.h2
-rw-r--r--freetype/src/type1/type1.c2
-rw-r--r--freetype/src/type42/module.mk2
-rw-r--r--freetype/src/type42/rules.mk2
-rw-r--r--freetype/src/type42/t42drivr.c15
-rw-r--r--freetype/src/type42/t42drivr.h2
-rw-r--r--freetype/src/type42/t42error.h2
-rw-r--r--freetype/src/type42/t42objs.c17
-rw-r--r--freetype/src/type42/t42objs.h2
-rw-r--r--freetype/src/type42/t42parse.c69
-rw-r--r--freetype/src/type42/t42parse.h2
-rw-r--r--freetype/src/type42/t42types.h2
-rw-r--r--freetype/src/type42/type42.c2
-rw-r--r--freetype/src/winfonts/fnterrs.h2
-rw-r--r--freetype/src/winfonts/module.mk2
-rw-r--r--freetype/src/winfonts/rules.mk2
-rw-r--r--freetype/src/winfonts/winfnt.c10
-rw-r--r--freetype/src/winfonts/winfnt.h2
-rw-r--r--freetype/version.sed5
-rw-r--r--freetype/vms_make.com2
-rw-r--r--jpeg/Makefile.am11
-rw-r--r--jpeg/Makefile.in29
-rw-r--r--jpeg/README33
-rw-r--r--jpeg/aclocal.m483
-rwxr-xr-xjpeg/ar-lib17
-rw-r--r--jpeg/cdaltui.txt138
-rw-r--r--jpeg/cderror.h3
-rw-r--r--jpeg/change.log14
-rw-r--r--jpeg/cjpegalt.c791
-rwxr-xr-xjpeg/compile6
-rwxr-xr-xjpeg/config.guess1476
-rwxr-xr-xjpeg/config.sub1801
-rwxr-xr-xjpeg/configure15885
-rw-r--r--jpeg/configure.ac139
-rwxr-xr-xjpeg/depcomp2
-rw-r--r--jpeg/djpegalt.c766
-rw-r--r--jpeg/filelist.txt4
-rwxr-xr-xjpeg/install-sh518
-rw-r--r--jpeg/install.txt117
-rw-r--r--jpeg/jcarith.c12
-rw-r--r--jpeg/jccoefct.c150
-rw-r--r--jpeg/jcdctmgr.c29
-rw-r--r--jpeg/jchuff.c14
-rw-r--r--jpeg/jcmaster.c28
-rw-r--r--jpeg/jcparam.c21
-rw-r--r--jpeg/jcprepct.c22
-rw-r--r--jpeg/jcsample.c16
-rw-r--r--jpeg/jctrans.c56
-rw-r--r--jpeg/jdapimin.c35
-rw-r--r--jpeg/jdarith.c12
-rw-r--r--jpeg/jdcoefct.c113
-rw-r--r--jpeg/jdcolor.c107
-rw-r--r--jpeg/jdhuff.c14
-rw-r--r--jpeg/jdinput.c39
-rw-r--r--jpeg/jdmainct.c48
-rw-r--r--jpeg/jdmaster.c29
-rw-r--r--jpeg/jdmerge.c4
-rw-r--r--jpeg/jdsample.c75
-rw-r--r--jpeg/jidctint.c50
-rw-r--r--jpeg/jpegint.h13
-rw-r--r--jpeg/jpeglib.h4
-rw-r--r--jpeg/jquant1.c32
-rw-r--r--jpeg/jquant2.c18
-rw-r--r--jpeg/jutils.c99
-rw-r--r--jpeg/jversion.h6
-rw-r--r--jpeg/makeasln.v1626
-rw-r--r--jpeg/makecvcx.v1680
-rw-r--r--jpeg/makecvcx.v17195
-rw-r--r--jpeg/makedvcx.v1680
-rw-r--r--jpeg/makedvcx.v17195
-rw-r--r--jpeg/makefile.ansi11
-rw-r--r--jpeg/makefile.b3211
-rw-r--r--jpeg/makefile.bcc11
-rw-r--r--jpeg/makefile.dj11
-rw-r--r--jpeg/makefile.manx11
-rw-r--r--jpeg/makefile.mc611
-rw-r--r--jpeg/makefile.mms11
-rw-r--r--jpeg/makefile.sas11
-rw-r--r--jpeg/makefile.unix11
-rw-r--r--jpeg/makefile.vc45
-rw-r--r--jpeg/makefile.vms2
-rw-r--r--jpeg/makefile.vs45
-rw-r--r--jpeg/makefile.wat11
-rw-r--r--jpeg/makejsln.v1610
-rw-r--r--jpeg/makejvcx.v1672
-rw-r--r--jpeg/makejvcx.v17222
-rw-r--r--jpeg/makervcx.v1678
-rw-r--r--jpeg/makervcx.v17178
-rw-r--r--jpeg/maketvcx.v1680
-rw-r--r--jpeg/maketvcx.v17193
-rw-r--r--jpeg/makewvcx.v1678
-rw-r--r--jpeg/makewvcx.v17178
-rwxr-xr-xjpeg/missing2
-rw-r--r--jpeg/rdgif.c12
-rw-r--r--jpeg/rdppm.c33
-rw-r--r--jpeg/rdswitch.c11
-rw-r--r--jpeg/testimg.jpgbin5764 -> 5770 bytes
-rw-r--r--jpeg/testimgp.jpgbin5645 -> 5655 bytes
-rw-r--r--jpeg/transupp.c2
-rw-r--r--jpeg/wrbmp.c2
-rw-r--r--jpeg/wrppm.c21
-rw-r--r--lcms2mt/src/cmsvirt.c2
-rw-r--r--lcms2mt/src/cmsxform.c30
-rw-r--r--lcms2mt/src/lcms2_internal.h2
-rw-r--r--lib/pdf_info.ps160
-rw-r--r--lib/viewcmyk.ps2
-rw-r--r--lib/viewjpeg.ps3
-rw-r--r--lib/viewpbm.ps2
-rw-r--r--lib/viewpcx.ps2
-rw-r--r--lib/viewraw.ps2
-rw-r--r--lib/viewrgb.ps2
-rw-r--r--lib/zugferd.ps2
-rw-r--r--man/dvipdf.14
-rw-r--r--man/gs.14
-rw-r--r--man/gslp.14
-rw-r--r--man/gsnd.14
-rw-r--r--man/pdf2dsc.14
-rw-r--r--man/pdf2ps.14
-rw-r--r--man/pf2afm.14
-rw-r--r--man/pfbtopfa.14
-rw-r--r--man/printafm.14
-rw-r--r--man/ps2ascii.14
-rw-r--r--man/ps2epsi.14
-rw-r--r--man/ps2pdf.14
-rw-r--r--man/ps2pdfwr.14
-rw-r--r--man/ps2ps.14
-rw-r--r--pdf/ghostpdf.c222
-rw-r--r--pdf/ghostpdf.h47
-rw-r--r--pdf/pdf.mak2
-rw-r--r--pdf/pdf_annot.c189
-rw-r--r--pdf/pdf_array.c102
-rw-r--r--pdf/pdf_array.h2
-rw-r--r--pdf/pdf_check.c348
-rw-r--r--pdf/pdf_check.h4
-rw-r--r--pdf/pdf_cmap.c33
-rw-r--r--pdf/pdf_colour.c432
-rw-r--r--pdf/pdf_colour.h4
-rw-r--r--pdf/pdf_deref.c394
-rw-r--r--pdf/pdf_dict.c223
-rw-r--r--pdf/pdf_dict.h4
-rw-r--r--pdf/pdf_doc.c406
-rw-r--r--pdf/pdf_errors.h9
-rw-r--r--pdf/pdf_fapi.c166
-rw-r--r--pdf/pdf_file.c137
-rw-r--r--pdf/pdf_fmap.c132
-rw-r--r--pdf/pdf_font.c938
-rw-r--r--pdf/pdf_font.h7
-rw-r--r--pdf/pdf_font0.c66
-rw-r--r--pdf/pdf_font1.c369
-rw-r--r--pdf/pdf_font1.h4
-rw-r--r--pdf/pdf_font11.c84
-rw-r--r--pdf/pdf_font1C.c434
-rw-r--r--pdf/pdf_font1C.h5
-rw-r--r--pdf/pdf_font3.c46
-rw-r--r--pdf/pdf_fontTT.c311
-rw-r--r--pdf/pdf_fontTT.h3
-rw-r--r--pdf/pdf_font_types.h34
-rw-r--r--pdf/pdf_fontps.c39
-rw-r--r--pdf/pdf_fontps.h4
-rw-r--r--pdf/pdf_func.c50
-rw-r--r--pdf/pdf_gstate.c624
-rw-r--r--pdf/pdf_image.c165
-rw-r--r--pdf/pdf_int.c831
-rw-r--r--pdf/pdf_int.h5
-rw-r--r--pdf/pdf_mark.c326
-rw-r--r--pdf/pdf_misc.c9
-rw-r--r--pdf/pdf_misc.h3
-rw-r--r--pdf/pdf_obj.c135
-rw-r--r--pdf/pdf_obj.h88
-rw-r--r--pdf/pdf_optcontent.c135
-rw-r--r--pdf/pdf_page.c304
-rw-r--r--pdf/pdf_page.h26
-rw-r--r--pdf/pdf_path.c458
-rw-r--r--pdf/pdf_pattern.c51
-rw-r--r--pdf/pdf_repair.c153
-rw-r--r--pdf/pdf_sec.c78
-rw-r--r--pdf/pdf_shading.c39
-rw-r--r--pdf/pdf_stack.c108
-rw-r--r--pdf/pdf_stack.h85
-rw-r--r--pdf/pdf_text.c458
-rw-r--r--pdf/pdf_tokens.h116
-rw-r--r--pdf/pdf_trans.c89
-rw-r--r--pdf/pdf_types.h59
-rw-r--r--pdf/pdf_warnings.h11
-rw-r--r--pdf/pdf_xref.c407
-rw-r--r--pdf/pdftop.c28
-rw-r--r--psi/dwmain.rc6
-rw-r--r--psi/gsdll32.rc6
-rw-r--r--psi/idstack.c5
-rw-r--r--psi/ierrors.h7
-rw-r--r--psi/iinit.c4
-rw-r--r--psi/mkfilelt.cpp368
-rw-r--r--psi/msvc.mak26
-rw-r--r--psi/nsisinst.nsi34
-rw-r--r--psi/winint.mak12
-rw-r--r--psi/zbfont.c5
-rw-r--r--psi/zchar.c4
-rw-r--r--psi/zcharout.c18
-rw-r--r--psi/zcie.c10
-rw-r--r--psi/zcolor.c3
-rw-r--r--psi/zdevice.c7
-rw-r--r--psi/zfapi.c17
-rw-r--r--psi/zfile.c15
-rw-r--r--psi/zfont2.c18
-rw-r--r--psi/zfsample.c7
-rw-r--r--psi/zpdfops.c605
-rw-r--r--tiff/CMakeLists.txt780
-rw-r--r--tiff/ChangeLog990
-rw-r--r--tiff/HOWTO-RELEASE11
-rw-r--r--tiff/Makefile.am7
-rw-r--r--tiff/Makefile.in87
-rw-r--r--tiff/Makefile.vc60
-rw-r--r--tiff/RELEASE-DATE2
-rw-r--r--tiff/SConstruct169
-rw-r--r--tiff/VERSION2
-rw-r--r--tiff/aclocal.m450
-rwxr-xr-xtiff/autogen.sh14
-rw-r--r--tiff/build/CMakeLists.txt2
-rw-r--r--tiff/build/Makefile.in11
-rw-r--r--tiff/cmake/AutotoolsCompat.cmake32
-rw-r--r--tiff/cmake/AutotoolsVersion.cmake50
-rw-r--r--tiff/cmake/CXXLibrary.cmake (renamed from tiff/contrib/ras/CMakeLists.txt)14
-rw-r--r--tiff/cmake/CompilerChecks.cmake124
-rw-r--r--tiff/cmake/DeflateCodec.cmake45
-rw-r--r--tiff/cmake/FindCMath.cmake72
-rw-r--r--tiff/cmake/FindDeflate.cmake116
-rw-r--r--tiff/cmake/FindJBIG.cmake116
-rw-r--r--tiff/cmake/FindJPEG.cmake142
-rw-r--r--tiff/cmake/FindLERC.cmake86
-rw-r--r--tiff/cmake/FindLibLZMA.cmake126
-rw-r--r--tiff/cmake/FindWebP.cmake91
-rw-r--r--tiff/cmake/FindZSTD.cmake107
-rw-r--r--tiff/cmake/IncludeChecks.cmake36
-rw-r--r--tiff/cmake/InternalCodecs.cmake46
-rw-r--r--tiff/cmake/JBIGCodec.cmake47
-rw-r--r--tiff/cmake/JPEGCodec.cmake56
-rw-r--r--tiff/cmake/LERCCodec.cmake32
-rw-r--r--tiff/cmake/LZMACodec.cmake (renamed from tiff/contrib/mfs/CMakeLists.txt)14
-rw-r--r--tiff/cmake/LargeFileSupport.cmake (renamed from tiff/contrib/tags/CMakeLists.txt)16
-rw-r--r--tiff/cmake/LibraryFeatures.cmake60
-rw-r--r--tiff/cmake/LinkerChecks.cmake50
-rw-r--r--tiff/cmake/OpenGLChecks.cmake43
-rw-r--r--tiff/cmake/PixarLogCodec.cmake33
-rw-r--r--tiff/cmake/PkgConfig.cmake36
-rw-r--r--tiff/cmake/ProcessorChecks.cmake47
-rw-r--r--tiff/cmake/Release.cmake31
-rw-r--r--tiff/cmake/ReleaseScript.cmake32
-rw-r--r--tiff/cmake/SymbolChecks.cmake43
-rw-r--r--tiff/cmake/TypeSizeChecks.cmake52
-rw-r--r--tiff/cmake/WebPCodec.cmake (renamed from tiff/contrib/dbs/xtiff/CMakeLists.txt)18
-rw-r--r--tiff/cmake/WindowsSupport.cmake (renamed from tiff/contrib/pds/CMakeLists.txt)23
-rw-r--r--tiff/cmake/ZSTDCodec.cmake53
-rw-r--r--tiff/config.h.in275
-rwxr-xr-xtiff/config/config.guess1117
-rwxr-xr-xtiff/config/config.sub2615
-rwxr-xr-xtiff/config/install-sh47
-rw-r--r--tiff/config/ltmain.sh250
-rwxr-xr-xtiff/config/test-driver10
-rwxr-xr-xtiff/configure1283
-rw-r--r--tiff/configure.ac303
-rw-r--r--tiff/configure.com1356
-rw-r--r--tiff/contrib/CMakeLists.txt8
-rw-r--r--tiff/contrib/Makefile.in11
-rw-r--r--tiff/contrib/addtiffo/CMakeLists.txt8
-rw-r--r--tiff/contrib/addtiffo/Makefile.am1
-rw-r--r--tiff/contrib/addtiffo/Makefile.in14
-rwxr-xr-xtiff/contrib/addtiffo/Makefile.vc28
-rw-r--r--tiff/contrib/addtiffo/tif_overview.c108
-rw-r--r--tiff/contrib/addtiffo/tif_ovrcache.c6
-rw-r--r--tiff/contrib/addtiffo/tif_ovrcache.h28
-rw-r--r--tiff/contrib/dbs/CMakeLists.txt12
-rw-r--r--tiff/contrib/dbs/Makefile.in13
-rw-r--r--tiff/contrib/dbs/tiff-grayscale.c6
-rw-r--r--tiff/contrib/dbs/tiff-palette.c8
-rw-r--r--tiff/contrib/dbs/tiff-rgb.c4
-rw-r--r--tiff/contrib/dbs/xtiff/Makefile.am1
-rw-r--r--tiff/contrib/dbs/xtiff/Makefile.in12
-rw-r--r--tiff/contrib/dbs/xtiff/xtiff.c40
-rw-r--r--tiff/contrib/iptcutil/CMakeLists.txt9
-rw-r--r--tiff/contrib/iptcutil/Makefile.in13
-rw-r--r--tiff/contrib/iptcutil/iptcutil.c6
-rw-r--r--tiff/contrib/mfs/Makefile.am1
-rw-r--r--tiff/contrib/mfs/Makefile.in12
-rw-r--r--tiff/contrib/pds/Makefile.am1
-rw-r--r--tiff/contrib/pds/Makefile.in12
-rw-r--r--tiff/contrib/pds/tif_imageiter.c76
-rw-r--r--tiff/contrib/pds/tif_imageiter.h36
-rw-r--r--tiff/contrib/pds/tif_pdsdirread.c188
-rw-r--r--tiff/contrib/pds/tif_pdsdirwrite.c138
-rw-r--r--tiff/contrib/ras/Makefile.am1
-rw-r--r--tiff/contrib/ras/Makefile.in12
-rw-r--r--tiff/contrib/stream/CMakeLists.txt28
-rw-r--r--tiff/contrib/stream/Makefile.am1
-rw-r--r--tiff/contrib/stream/Makefile.in12
-rw-r--r--tiff/contrib/tags/Makefile.am1
-rw-r--r--tiff/contrib/tags/Makefile.in12
-rw-r--r--tiff/contrib/tags/README2
-rw-r--r--tiff/contrib/tags/maketif.c2
-rw-r--r--tiff/contrib/tags/xtif_dir.c10
-rw-r--r--tiff/contrib/tags/xtiffiop.h6
-rw-r--r--tiff/contrib/win_dib/CMakeLists.txt30
-rw-r--r--tiff/contrib/win_dib/Makefile.am1
-rw-r--r--tiff/contrib/win_dib/Makefile.in12
-rw-r--r--tiff/contrib/win_dib/README.Tiffile2
-rw-r--r--tiff/contrib/win_dib/README.tiff2dib4
-rw-r--r--tiff/contrib/win_dib/Tiffile.cpp68
-rw-r--r--tiff/contrib/win_dib/tiff2dib.c16
-rw-r--r--tiff/html/CMakeLists.txt2
-rw-r--r--tiff/html/Makefile.am3
-rw-r--r--tiff/html/Makefile.in14
-rw-r--r--tiff/html/addingtags.html2
-rw-r--r--tiff/html/build.html176
-rw-r--r--tiff/html/contrib.html10
-rw-r--r--tiff/html/images/CMakeLists.txt2
-rw-r--r--tiff/html/images/Makefile.in11
-rw-r--r--tiff/html/index.html4
-rw-r--r--tiff/html/internals.html41
-rw-r--r--tiff/html/libtiff.html32
-rw-r--r--tiff/html/man/CMakeLists.txt2
-rw-r--r--tiff/html/man/Makefile.in11
-rw-r--r--tiff/html/man/TIFFDataWidth.3tiff.html2
-rw-r--r--tiff/html/man/TIFFFieldPassCount.3tiff.html4
-rw-r--r--tiff/html/man/TIFFFieldReadCount.3tiff.html4
-rw-r--r--tiff/html/man/TIFFFieldTag.3tiff.html2
-rw-r--r--tiff/html/man/TIFFFieldWriteCount.3tiff.html4
-rw-r--r--tiff/html/man/TIFFGetField.3tiff.html98
-rw-r--r--tiff/html/man/TIFFRGBAImage.3tiff.html10
-rw-r--r--tiff/html/man/TIFFReadRGBAImage.3tiff.html10
-rw-r--r--tiff/html/man/TIFFReadRGBAStrip.3tiff.html2
-rw-r--r--tiff/html/man/TIFFReadRGBATile.3tiff.html2
-rw-r--r--tiff/html/man/TIFFReadScanline.3tiff.html2
-rw-r--r--tiff/html/man/TIFFReadTile.3tiff.html4
-rw-r--r--tiff/html/man/TIFFSetDirectory.3tiff.html2
-rw-r--r--tiff/html/man/TIFFSetField.3tiff.html92
-rw-r--r--tiff/html/man/TIFFWriteScanline.3tiff.html2
-rw-r--r--tiff/html/man/TIFFWriteTile.3tiff.html4
-rw-r--r--tiff/html/man/TIFFcodec.3tiff.html6
-rw-r--r--tiff/html/man/TIFFcolor.3tiff.html40
-rw-r--r--tiff/html/man/TIFFquery.3tiff.html2
-rw-r--r--tiff/html/man/TIFFstrip.3tiff.html8
-rw-r--r--tiff/html/man/TIFFswab.3tiff.html8
-rw-r--r--tiff/html/man/TIFFtile.3tiff.html12
-rw-r--r--tiff/html/man/libtiff.3tiff.html18
-rw-r--r--tiff/html/v3.4beta007.html2
-rw-r--r--tiff/html/v3.4beta016.html2
-rw-r--r--tiff/html/v3.4beta028.html2
-rw-r--r--tiff/html/v3.5.7.html4
-rw-r--r--tiff/html/v3.6.0.html4
-rw-r--r--tiff/html/v3.6.1.html6
-rw-r--r--tiff/html/v3.7.0.html2
-rw-r--r--tiff/html/v3.7.0alpha.html2
-rw-r--r--tiff/html/v3.7.0beta.html2
-rw-r--r--tiff/html/v3.7.0beta2.html2
-rw-r--r--tiff/html/v3.7.1.html2
-rw-r--r--tiff/html/v3.7.2.html2
-rw-r--r--tiff/html/v3.7.3.html2
-rw-r--r--tiff/html/v3.7.4.html2
-rw-r--r--tiff/html/v3.8.0.html6
-rw-r--r--tiff/html/v3.8.1.html2
-rw-r--r--tiff/html/v3.8.2.html2
-rw-r--r--tiff/html/v3.9.0beta.html4
-rw-r--r--tiff/html/v3.9.1.html2
-rw-r--r--tiff/html/v3.9.2.html2
-rw-r--r--tiff/html/v4.0.0.html2
-rw-r--r--tiff/html/v4.0.4beta.html2
-rw-r--r--tiff/html/v4.0.7.html2
-rw-r--r--tiff/html/v4.0.8.html2
-rw-r--r--tiff/html/v4.0.9.html2
-rw-r--r--tiff/html/v4.1.0.html10
-rw-r--r--tiff/html/v4.2.0.html10
-rw-r--r--tiff/html/v4.3.0.html186
-rwxr-xr-x[-rw-r--r--]tiff/libtiff/CMakeLists.txt195
-rw-r--r--tiff/libtiff/Makefile.am14
-rw-r--r--tiff/libtiff/Makefile.in109
-rw-r--r--tiff/libtiff/Makefile.vc100
-rw-r--r--tiff/libtiff/SConstruct71
-rw-r--r--tiff/libtiff/mkg3states.c17
-rw-r--r--tiff/libtiff/tif_aux.c106
-rw-r--r--tiff/libtiff/tif_close.c4
-rw-r--r--tiff/libtiff/tif_codec.c12
-rw-r--r--tiff/libtiff/tif_color.c42
-rw-r--r--tiff/libtiff/tif_compress.c30
-rw-r--r--tiff/libtiff/tif_config.h-vms46
-rw-r--r--tiff/libtiff/tif_config.h.cmake.in148
-rw-r--r--tiff/libtiff/tif_config.h.in238
-rw-r--r--tiff/libtiff/tif_config.vc.h21
-rw-r--r--tiff/libtiff/tif_config.wince.h69
-rw-r--r--tiff/libtiff/tif_dir.c464
-rw-r--r--tiff/libtiff/tif_dir.h88
-rw-r--r--tiff/libtiff/tif_dirinfo.c24
-rw-r--r--tiff/libtiff/tif_dirread.c2034
-rw-r--r--tiff/libtiff/tif_dirwrite.c1020
-rw-r--r--tiff/libtiff/tif_dumpmode.c22
-rw-r--r--tiff/libtiff/tif_extension.c4
-rw-r--r--tiff/libtiff/tif_fax3.c369
-rw-r--r--tiff/libtiff/tif_fax3.h14
-rw-r--r--tiff/libtiff/tif_getimage.c500
-rw-r--r--tiff/libtiff/tif_jbig.c14
-rw-r--r--tiff/libtiff/tif_jpeg.c180
-rw-r--r--tiff/libtiff/tif_lerc.c1277
-rw-r--r--tiff/libtiff/tif_luv.c311
-rw-r--r--tiff/libtiff/tif_lzma.c32
-rw-r--r--tiff/libtiff/tif_lzw.c86
-rw-r--r--tiff/libtiff/tif_next.c24
-rw-r--r--tiff/libtiff/tif_ojpeg.c648
-rw-r--r--tiff/libtiff/tif_open.c46
-rw-r--r--tiff/libtiff/tif_packbits.c64
-rw-r--r--tiff/libtiff/tif_pixarlog.c238
-rw-r--r--tiff/libtiff/tif_predict.c130
-rw-r--r--tiff/libtiff/tif_predict.h2
-rw-r--r--tiff/libtiff/tif_print.c201
-rw-r--r--tiff/libtiff/tif_read.c495
-rw-r--r--tiff/libtiff/tif_stream.cxx74
-rw-r--r--tiff/libtiff/tif_strip.c115
-rw-r--r--tiff/libtiff/tif_swab.c28
-rw-r--r--tiff/libtiff/tif_thunder.c33
-rw-r--r--tiff/libtiff/tif_tile.c82
-rw-r--r--tiff/libtiff/tif_unix.c18
-rw-r--r--tiff/libtiff/tif_webp.c42
-rw-r--r--tiff/libtiff/tif_win32.c30
-rw-r--r--tiff/libtiff/tif_write.c110
-rw-r--r--tiff/libtiff/tif_zip.c56
-rw-r--r--tiff/libtiff/tif_zstd.c19
-rw-r--r--tiff/libtiff/tiff.h60
-rw-r--r--tiff/libtiff/tiffconf.h.cmake.in19
-rw-r--r--tiff/libtiff/tiffconf.h.in16
-rw-r--r--tiff/libtiff/tiffconf.vc.h78
-rw-r--r--tiff/libtiff/tiffconf.wince.h110
-rw-r--r--tiff/libtiff/tiffio.h254
-rw-r--r--tiff/libtiff/tiffiop.h165
-rw-r--r--tiff/libtiff/tiffvers.h4
-rw-r--r--tiff/m4/libtool.m455
-rw-r--r--tiff/man/CMakeLists.txt2
-rw-r--r--tiff/man/Makefile.in11
-rw-r--r--tiff/man/TIFFDataWidth.3tiff2
-rw-r--r--tiff/man/TIFFFieldPassCount.3tiff4
-rw-r--r--tiff/man/TIFFFieldReadCount.3tiff4
-rw-r--r--tiff/man/TIFFFieldTag.3tiff2
-rw-r--r--tiff/man/TIFFFieldWriteCount.3tiff4
-rw-r--r--tiff/man/TIFFGetField.3tiff98
-rw-r--r--tiff/man/TIFFRGBAImage.3tiff8
-rw-r--r--tiff/man/TIFFReadEncodedStrip.3tiff2
-rw-r--r--tiff/man/TIFFReadRGBAImage.3tiff6
-rw-r--r--tiff/man/TIFFReadRGBAStrip.3tiff2
-rw-r--r--tiff/man/TIFFReadRGBATile.3tiff2
-rw-r--r--tiff/man/TIFFReadScanline.3tiff2
-rw-r--r--tiff/man/TIFFReadTile.3tiff2
-rw-r--r--tiff/man/TIFFSetDirectory.3tiff2
-rw-r--r--tiff/man/TIFFSetField.3tiff92
-rw-r--r--tiff/man/TIFFWriteScanline.3tiff2
-rw-r--r--tiff/man/TIFFWriteTile.3tiff2
-rw-r--r--tiff/man/TIFFcodec.3tiff6
-rw-r--r--tiff/man/TIFFcolor.3tiff34
-rw-r--r--tiff/man/TIFFquery.3tiff2
-rw-r--r--tiff/man/TIFFstrip.3tiff8
-rw-r--r--tiff/man/TIFFswab.3tiff8
-rw-r--r--tiff/man/TIFFtile.3tiff8
-rw-r--r--tiff/man/libtiff.3tiff20
-rw-r--r--tiff/man/tiffcrop.112
-rw-r--r--tiff/man/tiffsplit.112
-rw-r--r--tiff/nmake.opt220
-rwxr-xr-x[-rw-r--r--]tiff/port/CMakeLists.txt61
-rw-r--r--tiff/port/Makefile.am5
-rw-r--r--tiff/port/Makefile.in92
-rw-r--r--tiff/port/Makefile.vc83
-rw-r--r--tiff/port/_strtol.h160
-rw-r--r--tiff/port/_strtoul.h127
-rw-r--r--tiff/port/lfind.c60
-rw-r--r--tiff/port/libport.h42
-rw-r--r--tiff/port/libport_config.h.cmake.in13
-rw-r--r--tiff/port/libport_config.h.in12
-rw-r--r--tiff/port/snprintf.c42
-rw-r--r--tiff/port/strcasecmp.c49
-rw-r--r--tiff/port/strtol.c45
-rw-r--r--tiff/port/strtoll.c44
-rw-r--r--tiff/port/strtoul.c44
-rw-r--r--tiff/port/strtoull.c44
-rw-r--r--tiff/test/CMakeLists.txt70
-rw-r--r--tiff/test/Makefile.in13
-rw-r--r--tiff/test/ascii_tag.c8
-rw-r--r--tiff/test/check_tag.c36
-rw-r--r--tiff/test/custom_dir.c20
-rw-r--r--tiff/test/custom_dir_EXIF_231.c268
-rw-r--r--tiff/test/defer_strile_writing.c2
-rw-r--r--tiff/test/long_tag.c10
-rw-r--r--tiff/test/rational_precision2double.c22
-rw-r--r--tiff/test/raw_decode.c42
-rw-r--r--tiff/test/rewrite_tag.c34
-rw-r--r--tiff/test/short_tag.c24
-rw-r--r--tiff/test/strip.c56
-rw-r--r--tiff/test/strip_rw.c18
-rw-r--r--tiff/test/testtypes.c19
-rw-r--r--tiff/test/tifftest.h6
-rwxr-xr-x[-rw-r--r--]tiff/tools/CMakeLists.txt122
-rw-r--r--tiff/tools/Makefile.am5
-rw-r--r--tiff/tools/Makefile.in18
-rw-r--r--tiff/tools/Makefile.vc51
-rw-r--r--tiff/tools/fax2ps.c72
-rw-r--r--tiff/tools/fax2tiff.c130
-rw-r--r--tiff/tools/pal2rgb.c159
-rw-r--r--tiff/tools/ppm2tiff.c118
-rw-r--r--tiff/tools/raw2tiff.c238
-rw-r--r--tiff/tools/rgb2ycbcr.c110
-rw-r--r--tiff/tools/thumbnail.c218
-rw-r--r--tiff/tools/tiff2bw.c182
-rw-r--r--tiff/tools/tiff2pdf.c874
-rw-r--r--tiff/tools/tiff2ps.c467
-rw-r--r--tiff/tools/tiff2rgba.c155
-rw-r--r--tiff/tools/tiffcmp.c173
-rw-r--r--tiff/tools/tiffcp.c706
-rw-r--r--tiff/tools/tiffcrop.c2192
-rw-r--r--tiff/tools/tiffdither.c92
-rw-r--r--tiff/tools/tiffdump.c268
-rw-r--r--tiff/tools/tiffgt.c32
-rw-r--r--tiff/tools/tiffinfo.c161
-rw-r--r--tiff/tools/tiffmedian.c112
-rw-r--r--tiff/tools/tiffset.c48
-rw-r--r--tiff/tools/tiffsplit.c81
-rw-r--r--toolbin/genfontmap.ps6
-rwxr-xr-xtoolbin/localcluster/clusterpush.pl2
-rw-r--r--windows/ghostscript.vcxproj4
-rw-r--r--windows/ghostscript.vcxproj.filters6
-rw-r--r--zlib/contrib/amd64/amd64-match.S452
-rw-r--r--zlib/contrib/asm686/README.68651
-rw-r--r--zlib/contrib/asm686/match.S357
-rw-r--r--zlib/contrib/inflate86/inffas86.c1157
-rw-r--r--zlib/contrib/inflate86/inffast.S1368
-rw-r--r--zlib/contrib/masmx64/bld_ml64.bat2
-rw-r--r--zlib/contrib/masmx64/gvmat64.asm553
-rw-r--r--zlib/contrib/masmx64/inffas8664.c186
-rw-r--r--zlib/contrib/masmx64/inffasx64.asm396
-rw-r--r--zlib/contrib/masmx64/readme.txt31
-rw-r--r--zlib/contrib/masmx86/bld_ml32.bat2
-rw-r--r--zlib/contrib/masmx86/inffas32.asm1080
-rw-r--r--zlib/contrib/masmx86/match686.asm479
-rw-r--r--zlib/contrib/masmx86/readme.txt27
-rw-r--r--zlib/doc/crc-doc.1.0.pdfbin0 -> 776142 bytes
-rw-r--r--zlib/examples/gznorm.c470
-rw-r--r--zlib/examples/zran.h40
1568 files changed, 94044 insertions, 153252 deletions
diff --git a/.gitattributes b/.gitattributes
index 3e4baa0c..756a55be 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -2,6 +2,8 @@
[attr]tabs whitespace=trailing-space,space-before-tab,indent-with-non-tab,tabwidth=4
[attr]spaces whitespace=trailing-space,space-before-tab,tabs-in-indent
[attr]makefile whitespace=trailing-space,space-before-tab,indent-with-non-tab,tabwidth=8
+[attr]rst -whitespace
+[attr]svg -whitespace
* text=auto
Make* makefile
@@ -14,9 +16,11 @@ Make* makefile
*.htm spaces
*.css spaces
*.pdf binary
+*.rst rst
+*.svg svg
# Source files
*.c spaces
*.h spaces
-*.md text \ No newline at end of file
+*.md text
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644
index 00000000..1b7dd799
--- /dev/null
+++ b/.readthedocs.yaml
@@ -0,0 +1,29 @@
+# .readthedocs.yaml
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required
+version: 2
+
+# Set the version of Python and other tools you might need
+build:
+ os: ubuntu-20.04
+ tools:
+ python: "3.9"
+ # You can also specify other tool versions:
+ # nodejs: "16"
+ # rust: "1.55"
+ # golang: "1.17"
+
+# Build documentation in the docs/ directory with Sphinx
+sphinx:
+ configuration: doc/src/conf.py
+
+# If using Sphinx, optionally build your docs in additional formats such as PDF
+formats:
+ - pdf
+
+# Optionally declare the Python requirements required to build your docs
+python:
+ install:
+ - requirements: doc/src/requirements.txt
diff --git a/Makefile.in b/Makefile.in
index ff786e2b..cc1a13b3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -249,10 +249,9 @@ EXTRACT_DIR=@EXTRACT_DIR@
FT_BRIDGE=@FT_BRIDGE@
SHARE_FT=@SHARE_FT@
FTSRCDIR=@FTSRCDIR@
-FT_CFLAGS=@FT_CFLAGS@ -DSHARE_FT=@SHARE_FT@
+FT_CFLAGS=@FT_CFLAGS@ @FT_HIDDEN_CFLAGS@ -DSHARE_FT=@SHARE_FT@
FT_LIBS=@FT_LIBS@
FT_LIB_PATH=@FT_LIB_PATH@
-FT_CONFIG_SYSTEM_ZLIB=@FT_SYS_ZLIB@
# Define whether to compile in UFST.
# FAPI/UFST depends on UFST_BRIDGE being undefined - hence the construct below.
@@ -350,7 +349,7 @@ URF_DEV=@URF_DEV@
SURFX_H=@SURFX_H@
EXPATSRCDIR=@EXPATDIR@
-EXPAT_CFLAGS=@EXPAT_CFLAGS@
+EXPAT_CFLAGS=@EXPAT_CFLAGS@ @XML_HIDDEN_CFLAGS@
EXPATGENDIR=$(GLGENDIR)
EXPATOBJDIR=$(GLOBJDIR)
EXPATINCDIR = $(EXPATSRCDIR)$(D)lib
diff --git a/Resource/Init/gs_epsf.ps b/Resource/Init/gs_epsf.ps
index 7f2329d6..fce2e236 100644
--- a/Resource/Init/gs_epsf.ps
+++ b/Resource/Init/gs_epsf.ps
@@ -1,4 +1,4 @@
-% Copyright (C) 2001-2021 Artifex Software, Inc.
+% Copyright (C) 2001-2022 Artifex Software, Inc.
% All Rights Reserved.
%
% This software is provided AS-IS with no warranty, either express or
@@ -120,7 +120,9 @@
% even if HiResBoundingBox occurs first in the EPS file.
//systemdict /EPSBoundingBoxState get 1 index lt {
% save the BBoxString for possible FitPage when EndComments is seen
- exch dup //systemdict /EPSBoundingBoxString 3 -1 roll .forceput
+ exch dup currentglobal //true setglobal exch
+ dup length string copy //systemdict /EPSBoundingBoxString 3 -1 roll .forceput
+ setglobal
EPSBoundingBoxParse
{
//systemdict /EPSCrop known {
diff --git a/Resource/Init/gs_fonts.ps b/Resource/Init/gs_fonts.ps
index aaee616f..1b1f852a 100644
--- a/Resource/Init/gs_fonts.ps
+++ b/Resource/Init/gs_fonts.ps
@@ -1,4 +1,4 @@
-% Copyright (C) 2001-2021 Artifex Software, Inc.
+% Copyright (C) 2001-2022 Artifex Software, Inc.
% All Rights Reserved.
%
% This software is provided AS-IS with no warranty, either express or
@@ -432,6 +432,7 @@ FONTPATH
/FONTMAP where
{
dup /FONTMAP get /FONTMAP exch [ exch //.pathlist exec] put
+ /FONTMAP dup where pop exch get {/PermitFileReading exch .addcontrolpath} forall
} if
% Try to enumerate native fonts registered with the os
@@ -929,10 +930,14 @@ FAKEFONTS not { (%END FAKEFONTS) .skipeof } if
} if
% No aliasing.
% This mode is incompatible with high level devices.
+ defaultfontname /None eq { /findfont cvx /invalidfont signalerror } if
cleartomark mark defaultfontname
} {
dup .substitutefont
- 2 copy eq { pop defaultfontname } if
+ 2 copy eq {
+ defaultfontname /None eq { /findfont cvx /invalidfont signalerror } if
+ pop defaultfontname
+ } if
//.checkalias exec
QUIET not {
SHORTERRORS {
diff --git a/Resource/Init/gs_init.ps b/Resource/Init/gs_init.ps
index ada1811b..f1e6d7d6 100644
--- a/Resource/Init/gs_init.ps
+++ b/Resource/Init/gs_init.ps
@@ -1,4 +1,4 @@
-% Copyright (C) 2001-2021 Artifex Software, Inc.
+% Copyright (C) 2001-2022 Artifex Software, Inc.
% All Rights Reserved.
%
% This software is provided AS-IS with no warranty, either express or
@@ -34,7 +34,7 @@
% Interpreter library version number
% NOTE: the interpreter code requires that the first non-comment token
% in this file be an integer, and that it match the compiled-in version!
-9561
+10000
% Check the interpreter revision.
dup revision ne
diff --git a/Resource/Init/gs_type1.ps b/Resource/Init/gs_type1.ps
index fa3cdd88..ef365093 100644
--- a/Resource/Init/gs_type1.ps
+++ b/Resource/Init/gs_type1.ps
@@ -1,4 +1,4 @@
-% Copyright (C) 2001-2021 Artifex Software, Inc.
+% Copyright (C) 2001-2022 Artifex Software, Inc.
% All Rights Reserved.
%
% This software is provided AS-IS with no warranty, either express or
@@ -224,6 +224,12 @@ currentdict /.loadfont1 .undef
ifelse
/.notdef CharStrings /.notdef get
} if
+ dup type /integertype eq
+ currentdict /CFFCharStrings known and
+ {
+ CFFCharStrings exch .knownget not
+ { CFFCharStrings 0 get} if
+ } if
end
} bind def
diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps
index 691a8bd6..117b362c 100644
--- a/Resource/Init/pdf_draw.ps
+++ b/Resource/Init/pdf_draw.ps
@@ -1421,7 +1421,7 @@ currentdict end readonly def
% untouched as set above.
%
currentpagedevice dup
- /Overprint get /simulate eq
+ /Overprint .knownget {/simulate eq}{false} ifelse
1 index /PageSpotColors known not and
exch /PageUsesOverprint .knownget not { //false } if
and
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps
index 3259c0fe..4aa2595f 100644
--- a/Resource/Init/pdf_main.ps
+++ b/Resource/Init/pdf_main.ps
@@ -258,6 +258,9 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
% Uses currentdict as an argument to pdfclose, which closes /PDFfile. Also
% executes restore and various cleanup activities.
%
+% pdfavailable - pdfavailable <bool>
+% Determines if there is a PDF interpreter available
+%
% Also Used by gsview 5
% =====================
% pdfopen <file> pdfopen <dict>
@@ -341,10 +344,14 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
/PageUsesTransparency exch % << >> <<page dict>> /PageUsesTransparency bool
3 index 3 1 roll % << >> <<page dict>> <<info dict>> << >> /PageUsesTransparency bool
put % <</PageUsesTransparency bool>> <<page dict>>
- /NumSpots get % <</PageUsesTransparency bool>> int
- /PageSpotColors exch % <</PageUsesTransparency bool>> /PageSpotColors int
- 2 index 3 1 roll % <</PageUsesTransparency bool>> <<page dict>> /PageSpotColors int
- put % <</PageUsesTransparency bool /PageSpotColors int >>
+ currentpagedevice /PageSpotColors known {
+ /NumSpots get % <</PageUsesTransparency bool>> int
+ /PageSpotColors exch % <</PageUsesTransparency bool>> /PageSpotColors int
+ 2 index 3 1 roll % <</PageUsesTransparency bool>> <<page dict>> /PageSpotColors int
+ put % <</PageUsesTransparency bool /PageSpotColors int >>
+ }{
+ pop
+ } ifelse
setpagedevice
}bind def
@@ -364,6 +371,7 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
3 1 roll eq
or % square media or square page, no point in rotating
{
+ pop pop pop pop
//false
}
{
@@ -409,15 +417,33 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
translate
% Now use the box and media values to calculate the required x/y scale factors
- 3 -1 roll div % box boxwidth mediawidth (mediaheight / boxheight)
- 3 1 roll % box (mediaheight / boxheight) boxwidth mediawidth
- exch % box (mediaheight / boxheight) mediawidth boxwidth
- div % box (mediaheight / boxheight) (mediawidth / boxwidth)
-
- 2 copy % box Yscale Xscale Yscale Xscale
- gt {exch} if % select smallest scale factor
- pop %
- dup scale % and scale page isomorphically
+ 4 copy % Stack - box boxwidth boxheight mediawidth mediaheight boxwidth boxheight mediawidth mediaheight
+ 3 -1 roll div % box boxwidth boxheight mediawidth mediaheight boxwidth mediawidth (mediaheight / boxheight)
+ 3 1 roll % box boxwidth boxheight mediawidth mediaheight (mediaheight / boxheight) boxwidth mediawidth
+ exch % box boxwidth boxheight mediawidth mediaheight (mediaheight / boxheight) mediawidth boxwidth
+ div % box boxwidth boxheight mediawidth mediaheight (mediaheight / boxheight) (mediawidth / boxwidth)
+
+ % Stack - box boxwidth boxheight mediawidth mediaheight Yscale Xscale
+
+ % Centre the output on the media
+ 2 copy % box boxwidth boxheight mediawidth mediaheight Yscale Xscale Yscale Xscale
+ gt {
+ exch pop % box boxwidth boxheight mediawidth mediaheight Xscale
+ dup 4 index mul % box boxwidth boxheight mediawidth mediaheight Xscale (boxheight * Xscale)
+ 3 -1 roll sub dup
+ 0 lt {-1 mul} if % box boxwidth boxheight mediawidth Xscale ((boxheight * Xscale) - mediaheight)
+ dup 0 ne {2 div} if % box boxwidth boxheight mediawidth Xscale (heightdiff / 2)
+ 0 exch translate % box boxwidth boxheight mediawidth Xscale
+ } {
+ pop % box boxwidth boxheight mediawidth mediaheight Yscale
+ dup 5 index mul % box boxwidth boxheight mediawidth mediaheight Yscale (boxwidth * Yscale)
+ 4 -1 roll sub dup
+ 0 lt {-1 mul} if % box boxwidth boxheight mediaheight Yscale ((boxwidth * Yscale) - mediawidth)
+ dup 0 ne {2 div} if % box boxwidth boxheight mediawidth Yscale (widthdiff / 2)
+ 0 translate % box boxwidth boxheight mediawidth Yscale
+ } ifelse
+ dup scale % scale both axes the same
+ pop pop pop % remove the leftover boxwidth, boxheight and mediawidth/height
} bind def
/newpdf_get_media_box { % <pagedict> get_media_box <box> <bool>
@@ -772,172 +798,88 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
% NB device parameters will already have been sent to the device and used to configure it
% so here we should only handle parameters which control the behaviour of the interpreter.
%
+/PDFSwitches [ /QUIET /PDFPassword /PDFDEBUG /PDFSTOPONERROR /PDFSTOPONWARNING /NOTRANSPARENCY /FirstPage /LastPage
+ /PDFNOCIDFALLBACK /NO_PDFMARK_OUTLINES /NO_PDFMARK_DESTS /PDFFitPage /Printed /UsePDFX3Profile
+ /UseBleedBox /UseCropBox /UseArtBox /UseTrimBox /ShowAcroForm /ShowAnnots /PreserveAnnots
+ /NoUserUnit /RENDERTTNOTDEF /DOPDFMARKS /PDFINFO /SHOWANNOTTYPES /PRESERVEANNOTTYPES
+ /CIDFSubstPath /CIDFSubstFont /SUBSTFONT /IgnoreToUnicode /NONATIVEFONTMAP ] def
+
/newpdf_gather_parameters
{
10 dict begin
- /PDFSwitches [ /QUIET /PDFPassword /PDFDEBUG /PDFSTOPONERROR /PDFSTOPONWARNING /NOTRANSPARENCY /FirstPage /LastPage
- /PDFNOCIDFALLBACK /NO_PDFMARK_OUTLINES /NO_PDFMARK_DESTS /PDFFitPage /Printed /UsePDFX3Profile
- /UseBleedBox /UseCropBox /UseArtBox /UseTrimBox /ShowAcroForm /ShowAnnots /PreserveAnnots
- /NoUserUnit /RENDERTTNOTDEF /DOPDFMARKS /PDFINFO /SHOWANNOTTYPES /PRESERVEANNOTTYPES
- /CIDSubstPath /CIDSubstFont /IgnoreToUnicode /NONATIVEFONTMAP ] def
-
- 0 1 PDFSwitches length 1 sub {
- PDFSwitches exch get dup where {
- exch dup 3 1 roll get def
- }
- {
- pop
- } ifelse
- } for
- currentdict /PDFSwitches undef
+
+ //PDFSwitches {
+ dup where
+ { exch dup 3 1 roll get def }
+ { pop } ifelse
+ } forall
+
+ % This isn't a command line parameter, we track it internally, but we need to
+ % send it to the interpreter. It is used to 'offset' the page Dest for Link
+ % annotations and Outlines by the numebr of pages processed so far.
+ /PageCount CumulativePageCount def
+
currentdict end
} bind executeonly def
+currentdict /PDFSwitches undef
+
/newpdf_pagecount
{
- PDFFile //null eq not
+ currentdict /PDFInfo known
{
- PDFFile {.PDFInfo} stopped not
+ PDFInfo
+ }
+ {
+ PDFFile //null eq not
{
- dup /NumPages known
+ PDFSTOPONERROR
{
- /NumPages get
+ PDFFile .PDFInfo //false
}
{
- pop 0
+ PDFFile {.PDFInfo} stopped
} ifelse
}
{
- pop 0
- } ifelse
+ //true
+ }ifelse
+
+ {
+ <</NumPages 0>>
+ } if
+ } ifelse
+
+ dup /NumPages known
+ {
+ /NumPages get
}
{
- 0
+ pop 0
} ifelse
}bind def
/newpdf_runpdfpagerange
{
/PageList where {
- pop PageList
- (even) anchorsearch {
- pop length 0 gt {
- /runpdfpagerange cvx /syntaxerror signalerror
- } if
- /PDFPageList pdfpagecount 1 add array def
- 2 2 pdfpagecount {
- PDFPageList exch 1 put
- } for
- QUIET not {
- (Processing even-numbered pages\n) print (1 through ) print pdfpagecount =only
- (.) = flush
- } if
- } {
- (odd) anchorsearch {
- pop length 0 gt {
- /runpdfpagerange cvx /syntaxerror signalerror
- } if
- /PDFPageList pdfpagecount 1 add array def
- 1 2 pdfpagecount {
- PDFPageList exch 1 put
- } for
- QUIET not {
- (Processing odd-numbered pages\n) print (1 through ) print pdfpagecount =only
- (.) = flush
- } if
- } {
- %% validate string contents, check for digit comma or minus
- dup
- {
- dup 44 eq not {
- dup 45 eq not {
- dup 48 lt 1 index 57 gt or {
- /runpdfpagerange cvx /syntaxerror signalerror
- } if
- } if
- } if
- pop
- }
- forall
- /PDFPageList pdfpagecount 1 add array def
- {
- (,) search {
- %% We now have (post) (,) (pre)
- exch pop %% get rid of the (,), leave the (post) as the string for the next iteration, deal with the section up to the comma
- (-) search {
- %% Now we have (end) (-) (start)
- exch pop %% get rid of the minus (end) (start)
- 0 exch {48 sub exch 10 mul add} forall
- %% Make sure the start of the range is inside the number of available pages
- dup pdfpagecount le {
- exch
- %% deal with a trailing '-' by replacing it with the number of pages in the file
- dup length 0 eq {
- pop pdfpagecount
- }{
- 0 exch {48 sub exch 10 mul add} forall
- } ifelse
- 1 exch %% start 1 end
- %% Make sure the end of the range is inside the number of available pages
- dup pdfpagecount gt {pop pdfpagecount} if
- {PDFPageList exch 1 put} for
- } {
- %% start of range invalid, drop this range.
- pop pop
- }ifelse
- }{
- %% no minus signs, must be a simple page number
- 0 exch {48 sub exch 10 mul add} forall
- %% ensure its in the valid range of pages
- dup pdfpagecount le {
- PDFPageList exch 1 put
- } {
- pop
- } ifelse
- } ifelse
- }{
- %% no commas separating pages, just the original string (), deal with its as a section, then exit the loop
- (-) search {
- %% Now we have (end) (-) (start)
- exch pop %% get rid of the minus (end) (start)
- 0 exch {48 sub exch 10 mul add} forall
- %% Make sure the start of the range is inside the number of available pages
- dup pdfpagecount le {
- exch
- %% deal with a trailing '-' by replacing it with the number of pages in the file
- dup length 0 eq {
- pop pdfpagecount
- }{
- 0 exch {48 sub exch 10 mul add} forall
- } ifelse
- 1 exch %% start 1 end
- %% Make sure the end of the range is inside the number of available pages
- dup pdfpagecount gt {pop pdfpagecount} if
- {PDFPageList exch 1 put} for
- } {
- %% start of range invalid, drop this range.
- pop pop
- }ifelse
- }{
- %% no minus signs, must be a simple page number
- 0 exch {48 sub exch 10 mul add} forall
- %% ensure its in the valid range of pages
- dup pdfpagecount le {
- PDFPageList exch 1 put
- } {
- pop
- } ifelse
- } ifelse
- exit %% done all the sections.
- } ifelse
- } loop
- QUIET not {
- (Processing pages ) print PageList =only
- (.) = flush
- } if
- } ifelse
- } ifelse
- 1 pdfpagecount
+ pop
+ % make sure string is NUL terminated as C expects.
+ PageList 1 string dup 0 0 put concatstrings
+ pdfpagecount
+ .PDFparsePageList
+ dup 0 eq { % No ranges, error
+ (\n **** Error: Invalid PageList: ) print
+ PageList print
+ (\n No pages will be processed.) = flush
+ /runpdfpagerange cvx /syntaxerror signalerror
+ } if
+ array astore % move integer triples from the stack to the array
+ % newpdf PDFPageList is an array of 3 elements per range: even/odd flag, start, end
+ /PDFPageList exch def
+ QUIET not {
+ (Processing pages ) print PageList =only (.) = flush
+ } if
+ 1 pdfpagecount % dummy parameters for newpdf_dopages
}{
/FirstPage where {
pop FirstPage dup pdfpagecount gt {
@@ -963,22 +905,27 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
/newpdf_runpdf
{
runpdfbegin % <file> runpdfbegin -
- PDFInfo /Collection known
+ PDFInfo type /dicttype eq
{
- PDFInfo /Collection get
- pdfclose
- dup length 1 sub 0 2 3 -1 roll
+ PDFInfo /Collection known
{
- 1 index exch get (r) file runpdf
- } for
- pop
- }
- {
- process_trailer_attrs % - process_trailer_attrs -
- runpdfpagerange % - runpdfpagerange <int> <int>
- dopdfpages % <int> <int> dopdfpages -
- runpdfend % - runpdfend -
- } ifelse
+ PDFInfo /Collection get
+ pdfclose
+ dup length 1 sub 0 2 3 -1 roll
+ {
+ 1 index exch get (r) file runpdf
+ } for
+ pop
+ }
+ {
+ process_trailer_attrs % - process_trailer_attrs -
+ runpdfpagerange % - runpdfpagerange <int> <int>
+ dopdfpages % <int> <int> dopdfpages -
+ runpdfend % - runpdfend -
+ } ifelse
+ } {
+ pop pop
+ }ifelse
} bind def
/newpdf_runpdfbegin
@@ -986,6 +933,8 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
/pdfdict 10 dict def
pdfdict begin
+ currentpagedevice /PageCount get
+ /CumulativePageCount exch def
% This is for the benefit of pdf2dsc which assumes it will be present
/Trailer << >> def
/PDFSave save def
@@ -1011,28 +960,51 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
/pget {2 copy known {get //true}{pop pop //false}ifelse}bind def
newpdf_gather_parameters
- {.PDFInit} stopped
- {
- /PDFFile //null def
- /PDFInfo //null def
- }
+ PDFSTOPONERROR
{
+ .PDFInit
/PDFFile exch def
pdfopen
/PDFInfo exch def
pop
+ }
+ {
+ {.PDFInit} stopped
+ {
+ ( **** Error: Failed to initialise PDF interpreter.\n) newpdf_pdfformaterror
+ /PDFFile //null def
+ /PDFInfo //null def
+ }
+ {
+ /PDFFile exch def
+ pdfopen
+ /PDFInfo exch def
+ pop
+ }ifelse
}ifelse
} bind def
/newpdf_pdfgetpage
{
- PDFFile exch 1 sub {.PDFPageInfo} stopped
+ dup 1 sub
+ PDFSTOPONERROR
{
- pop pop
- ( **** Error: Couldn't get page info.\n) newpdf_pdfformaterror
- ( Output may be incorrect.\n) newpdf_pdfformaterror
- //null
- } if
+ PDFFile exch .PDFPageInfo
+ dup 3 -1 roll
+ /Page# exch put
+ }
+ {
+ PDFFile exch {.PDFPageInfo} stopped
+ {
+ pop pop
+ ( **** Error: Couldn't get page info.\n) newpdf_pdfformaterror
+ ( Output may be incorrect.\n) newpdf_pdfformaterror
+ //null
+ }{
+ dup 3 -1 roll
+ /Page# exch put
+ } ifelse
+ }ifelse
} bind def
/newpdf_process_trailer_attrs
@@ -1052,54 +1024,88 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
/newpdf_pdfshowpage_finish
{
- /Page# get PDFFile exch 1 sub {.PDFDrawPage} stopped
+ PDFSTOPONERROR
{
- pop pop
- ( **** Error: Page drawing error occured.\n) newpdf_pdfformaterror
- ( Output may be incorrect.\n) newpdf_pdfformaterror
- } if
- {showpage} stopped
+ /Page# get PDFFile exch 1 sub .PDFDrawPage
+ showpage
+ }
{
- ( **** Error: Page drawing error occured.\n) newpdf_pdfformaterror
- ( Could not draw this page at all, page will be missing in the output.\n) newpdf_pdfformaterror
- } if
+ /Page# get PDFFile exch 1 sub {.PDFDrawPage} stopped
+ {
+ pop pop
+ ( **** Error: Page drawing error occurred.\n) newpdf_pdfformaterror
+ ( Output may be incorrect.\n) newpdf_pdfformaterror
+ } if
+ {showpage} stopped
+ {
+ ( **** Error: Page drawing error occurred.\n) newpdf_pdfformaterror
+ ( Could not draw this page at all, page will be missing in the output.\n) newpdf_pdfformaterror
+ } if
+ }ifelse
grestore
} bind def
/newpdf_pdfshowpage
{
- pdfshowpage_init
- pdfshowpage_setpage
- pdfshowpage_finish
+ /PDFINFO where {/PDFINFO get}{//false}ifelse
+ {
+ /Page# get PDFFile exch 1 sub {.PDFDrawPage} stopped pop
+ }
+ {
+ pdfshowpage_init
+ pdfshowpage_setpage
+ pdfshowpage_finish
+ }ifelse
} bind def
/newpdf_runpdfend
{
+ % Get the accumulated count of pages processed so far
+ % and the number of pages in this file. Do this before
+ % we close the file and restore the state. Save the values
+ % on the stack.
+ pdfpagecount
+ CumulativePageCount
+
pdfclose
PDFSave restore
+
end % pdfdict
+
+ % add the number of pages in this file to the accumulated count,
+ % and store that in the device for later reuse. This allows us to
+ % add the number of pages already in the output to the 'Dest' of
+ % Outlines and Link annotations.
+ add <</PageCount 3 -1 roll >> setpagedevice
} bind def
/newpdf_pdfopen
{
dup PDFFile //null ne
{
- PDFFile {.PDFStream} stopped
+ PDFSTOPONERROR
{
- pop pop
- ( **** Error: Couldn't initialise file.\n) newpdf_pdfformaterror
- ( Output may be incorrect.\n) newpdf_pdfformaterror
- <</NumPages 0>>
+ PDFFile .PDFStream
+ PDFFile .PDFInfo
}
{
- PDFFile {.PDFInfo} stopped
+ PDFFile {.PDFStream} stopped
{
- pop
- ( **** Error: Couldn't get page information.\n) newpdf_pdfformaterror
+ pop pop
+ ( **** Error: Couldn't initialise file.\n) newpdf_pdfformaterror
( Output may be incorrect.\n) newpdf_pdfformaterror
<</NumPages 0>>
- } if
- } ifelse
+ }
+ {
+ PDFFile {.PDFInfo} stopped
+ {
+ pop
+ ( **** Error: Couldn't get page information.\n) newpdf_pdfformaterror
+ ( Output may be incorrect.\n) newpdf_pdfformaterror
+ <</NumPages 0>>
+ } if
+ } ifelse
+ }ifelse
}
{
pop
@@ -1109,30 +1115,48 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
/newpdf_pdfclose
{
- PDFFile {.PDFClose} stopped
+ PDFSTOPONERROR
{
- pop
- } if
+ PDFFile .PDFClose
+ }
+ {
+ PDFFile {.PDFClose} stopped
+ {
+ pop
+ } if
+ }ifelse
+} bind def
+
+/pdfavailable
+{
+ .PDFAvailable NEWPDF not or
} bind def
% <int> <int> dopdfpages -
% First Page and then LastPage
+% If PDFPageList array exists, the parameters are 1 pdfpagecount and are ignored.
/newpdf_dopdfpages
{
//DisablePageHandlerDevice exec
- 1 exch
- {
- %% If we have a array of pages to render, use it.
- /PDFPageList where {
- pop dup PDFPageList exch get 1 eq
- }
- {//true} ifelse
-
+ %% If we have a array of page ranges to render, use it.
+ /PDFPageList where {
+ pop
+ pop pop % don't use dummy parameters
+ PDFPageList
+ % process the ranges (3 elements per range)
+ 0 3 2 index length 1 sub {
+ 1 index 1 index get % even = 2, odd = 1 any = 0
+ 2 index 2 index 1 add get % start of range
+ exch
+ 3 index 3 index 2 add get % end of range
+ exch
+ % stack: start end even/odd
+ 0 eq { 1 } { 2 } ifelse
+ 2 index 2 index gt { neg } if % negate increment for reverse range
+ exch
{
- dup pdfgetpage
+ pdfgetpage
dup //null ne {
- exch 1 index
- /Page# 3 -1 roll put
pdfshowpage
} {
PDFSTOPONERROR {
@@ -1143,10 +1167,28 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
( not found.\n) newpdf_pdfformaterror
} ifelse
} ifelse
- }{
- pop
- }ifelse
- } for
+ } for
+ pop % for loop index
+ } for
+ pop % done with array
+ } {
+ % else, Process the pages given by the FirstPage, LastPage
+ 1 exch
+ {
+ pdfgetpage
+ dup //null ne {
+ pdfshowpage
+ } {
+ PDFSTOPONERROR {
+ /dopdfpages cvx /syntaxerror signalerror
+ } {
+ pop pop
+ ( **** Error: page) newpdf_pdfformaterror
+ ( not found.\n) newpdf_pdfformaterror
+ } ifelse
+ } ifelse
+ } for
+ } ifelse
//EnablePageHandlerDevice exec
} bind def
@@ -1195,10 +1237,20 @@ systemdict /NEWPDF known not {/NEWPDF //true def} if
% stack: tempname tempfile
dup 0 setfileposition
dup
- runpdf
+ pdfavailable {
+ runpdf
+ }{
+ closefile
+ (%stderr) (w) file ( **** ERROR: No PDF interpreter available, unable to process PDF files as input.\n)writestring
+ } ifelse
closefile deletefile
} {
- runpdf
+ pdfavailable {
+ runpdf
+ }{
+ closefile
+ (%stderr) (w) file ( **** ERROR: No PDF interpreter available, unable to process PDF files as input.\n)writestring
+ } ifelse
} ifelse
} {
pop pop pop pop cvx .runps % (%!PS) found first
@@ -1219,6 +1271,7 @@ currentdict /runpdfstring .undef
newpdf_runpdfbegin
}
{
+ (%stderr) (w) file (\n **** Warning: You are using the legacy PDF interpreter \(-dNEWPDF=false\) which is now deprecated and unsupported\n) writestring
userdict begin
% It turns out that the PDF interpreter uses memory more
% effectively if it is run under at least one level of save.
@@ -1596,7 +1649,26 @@ currentdict /EnablePageHandlerDevice undef
/runpdf { % <file> runpdf -
/NEWPDF where {/NEWPDF get} {//true} ifelse
- {newpdf_runpdf}
+ {
+ dup type /filetype eq
+ {
+ dup
+ PDFSTOPONERROR
+ {
+ newpdf_runpdf
+ }
+ {
+ {newpdf_runpdf} stopped
+ {
+ ( **** Error: PDF interpreter encountered an error processing the file.\n) pdfformaterror
+ } if
+ }ifelse
+ closefile
+ }
+ {
+ ( **** Error: Attempt to process something other than a file object in runpdf.\n) pdfformaterror
+ } ifelse
+ }
{
%% Get the PDF filename (it *must* be a file even if it came from stdin it gets
%% copied to a temporary file) and store it in pdfdict. We will use this for
diff --git a/autogen.sh b/autogen.sh
index 09f732b4..357ca69e 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,6 +1,10 @@
#!/bin/sh
# Run this to set up the build system: configure, makefiles, etc.
-
+#
+# NOCONFIGURE
+# If set to any value it will generate all files but not invoke the
+# generated configure script.
+# e.g. NOCONFIGURE=1 ./autogen.sh
package="ghostscript"
@@ -44,11 +48,13 @@ echo " running autoreconf"
autoreconf || exit 1
-if test -z "$*"; then
+if test x"$NOCONFIGURE" = x""; then
+ if test -z "$*"; then
echo "I am going to run ./configure with no arguments - if you wish "
echo "to pass any to it, please specify them on the $0 command line."
-else
+ else
echo "running ./configure $@"
-fi
+ fi
-$srcdir/configure "$@" && echo
+ $srcdir/configure "$@" && echo
+fi
diff --git a/base/cal.mak b/base/cal.mak
index 606c2f2b..51665f7a 100644
--- a/base/cal.mak
+++ b/base/cal.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2019-2021 Artifex Software, Inc.
+# Copyright (C) 2019-2022 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -82,7 +82,7 @@ $(GLOBJ)cal.dev : $(ECHOGS_XE) $(cal_OBJS) \
$(SETMOD) $(GLOBJ)cal $(cal_OBJS)
# define our specific compiler
-CAL_CC=$(CC) $(CCFLAGS) $(CAL_CFLAGS) $(I_)$(CAL_GEN)$(_I) $(I_)$(CAL_SRC)$(_I)
+CAL_CC=$(CC) $(CCFLAGS) $(CAL_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(I_)$(CAL_GEN)$(_I) $(I_)$(CAL_SRC)$(_I)
CAL_O=$(O_)$(CAL_OBJ)$(CAL_PREFIX)
CAL_DEP=$(AK) $(CAL_MAK) $(MAKEDIRS)
@@ -103,16 +103,16 @@ $(CAL_OBJ)$(CAL_PREFIX)doubler.$(OBJ) : $(CAL_SRC)doubler.c $(cal_HDRS) $(CAL_DE
$(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(CAL_NEON_CFLAGS) $(CAL_O)doubler.$(OBJ) $(C_) $(CAL_SRC)doubler.c
$(CAL_OBJ)$(CAL_PREFIX)cmsavx2.$(OBJ) : $(CAL_SRC)cmsavx2.c $(cal_HDRS) $(CAL_DEP)
- $(CAL_CC) $(CAL_AVX2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmsavx2.$(OBJ) $(C_) $(CAL_SRC)cmsavx2.c
+ $(CAL_CC) $(CAL_AVX2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmsavx2.$(OBJ) $(C_) $(CAL_SRC)cmsavx2.c
$(CAL_OBJ)$(CAL_PREFIX)cmssse42.$(OBJ) : $(CAL_SRC)cmssse42.c $(cal_HDRS) $(CAL_DEP)
- $(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmssse42.$(OBJ) $(C_) $(CAL_SRC)cmssse42.c
+ $(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmssse42.$(OBJ) $(C_) $(CAL_SRC)cmssse42.c
$(CAL_OBJ)$(CAL_PREFIX)cmsneon.$(OBJ) : $(CAL_SRC)cmsneon.c $(cal_HDRS) $(CAL_DEP)
- $(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(CAL_NEON_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)include $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmsneon.$(OBJ) $(C_) $(CAL_SRC)cmsneon.c
+ $(CAL_CC) $(CAL_SSE4_2_CFLAGS) $(CAL_NEON_CFLAGS) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)cmsneon.$(OBJ) $(C_) $(CAL_SRC)cmsneon.c
$(CAL_OBJ)$(CAL_PREFIX)lcms2mt_cal.$(OBJ) : $(CAL_SRC)lcms2mt_cal.c $(cal_HDRS) $(CAL_DEP) $(gsmemory_h)
- $(CAL_CC) $(I_)$(LCMS2MTSRCDIR)$(D)include $(I_)$(GLSRC) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)lcms2mt_cal.$(OBJ) $(C_) $(CAL_SRC)lcms2mt_cal.c
+ $(CAL_CC) $(I_)$(GLSRC) $(I_)$(LCMS2MTSRCDIR)$(D)src $(CAL_O)lcms2mt_cal.$(OBJ) $(C_) $(CAL_SRC)lcms2mt_cal.c
$(CAL_OBJ)$(CAL_PREFIX)blendavx2.$(OBJ) : $(CAL_SRC)blendavx2.c $(cal_HDRS) $(CAL_DEP) $(gxblend_h)
$(CAL_CC) $(CAL_AVX2_CFLAGS) $(I_)$(GLSRC) $(CAL_O)blendavx2.$(OBJ) $(C_) $(CAL_SRC)blendavx2.c
diff --git a/base/fapi_ft.c b/base/fapi_ft.c
index c7cb22ea..a4b4fe69 100644
--- a/base/fapi_ft.c
+++ b/base/fapi_ft.c
@@ -59,7 +59,6 @@
#include FT_TRUETYPE_TABLES_H
#include FT_MULTIPLE_MASTERS_H
#include FT_TYPE1_TABLES_H
-#include FT_SIZES_H
/* Note: structure definitions here start with FF_, which stands for 'FAPI FreeType". */
@@ -707,20 +706,6 @@ load_glyph(gs_fapi_server * a_server, gs_fapi_font * a_fapi_font,
if (ft_error == FT_Err_Out_Of_Memory
|| ft_error == FT_Err_Array_Too_Large) {
- /* An out of memory error can leave the FT TTF hinting context in a partially initialized state.
- Meaning bad things can happen if we try to render another glyph using the same context.
- Ideally this would be handled by FT internally, but that means some implications for supporting
- out of spec fonts, and performance.
- By destroying, recreating and resetting the size, it invalidates the (possibly corrupt) hinting
- context, and ensures a fresh start in any subsequent call.
- */
- FT_Size ftsize = NULL;
- FT_Done_Size(ft_face->size);
- FT_New_Size(face->ft_face, &ftsize);
- FT_Activate_Size(ftsize);
- ft_error = FT_Set_Char_Size(face->ft_face, face->width, face->height, face->horz_res, face->vert_res);
- if (ft_error != 0) return_error(gs_error_invalidfont);
-
return (gs_error_VMerror);
}
@@ -857,7 +842,7 @@ load_glyph(gs_fapi_server * a_server, gs_fapi_font * a_fapi_font,
FF_free(s->ftmemory, bmg);
}
}
- else {
+ else if (ft_face->glyph->format == FT_GLYPH_FORMAT_OUTLINE) {
FT_OutlineGlyph olg;
ft_error = FT_Get_Glyph(ft_face->glyph, (FT_Glyph *) & olg);
@@ -1292,31 +1277,45 @@ gs_fapi_ft_get_scaled_font(gs_fapi_server * a_server, gs_fapi_font * a_font,
/* Get the length of the TrueType data. */
unsigned long ms;
- code = a_font->get_long(a_font, gs_fapi_font_feature_TT_size, 0, &ms);
- if (code < 0)
- return code;
- if (ms == 0)
- return_error(gs_error_invalidfont);
-
- open_args.memory_size = (FT_Long)ms;
-
- /* Load the TrueType data into a single buffer. */
- open_args.memory_base = own_font_data =
- FF_alloc(s->ftmemory, open_args.memory_size);
- if (!own_font_data)
- return_error(gs_error_VMerror);
-
- own_font_data_len = open_args.memory_size;
+ if (a_font->retrieve_tt_font != NULL) {
+ code = a_font->retrieve_tt_font(a_font, &own_font_data, &ms);
+ if (code == 0) {
+ data_owned = false;
+ open_args.memory_base = own_font_data;
+ open_args.memory_size = own_font_data_len = ms;
+ }
+ }
+ else
+ code = gs_error_unregistered;
- code = a_font->serialize_tt_font(a_font, own_font_data,
- open_args.memory_size);
- if (code < 0)
- return code;
+ if (code < 0) {
+ code = a_font->get_long(a_font, gs_fapi_font_feature_TT_size, 0, &ms);
+ if (code < 0)
+ return code;
+ if (ms == 0)
+ return_error(gs_error_invalidfont);
+
+ open_args.memory_size = (FT_Long)ms;
+
+ /* Load the TrueType data into a single buffer. */
+ open_args.memory_base = own_font_data =
+ FF_alloc(s->ftmemory, open_args.memory_size);
+ if (!own_font_data)
+ return_error(gs_error_VMerror);
+
+ own_font_data_len = open_args.memory_size;
+
+ code = a_font->serialize_tt_font(a_font, own_font_data,
+ open_args.memory_size);
+ if (code < 0)
+ return code;
+ }
/* We always load incrementally. */
ft_inc_int = new_inc_int(a_server, a_font);
if (!ft_inc_int) {
- FF_free(s->ftmemory, own_font_data);
+ if (data_owned)
+ FF_free(s->ftmemory, own_font_data);
return_error(gs_error_VMerror);
}
}
@@ -1334,7 +1333,8 @@ gs_fapi_ft_get_scaled_font(gs_fapi_server * a_server, gs_fapi_font * a_font,
&ft_face);
if (ft_error) {
delete_inc_int (a_server, ft_inc_int);
- FF_free(s->ftmemory, own_font_data);
+ if (data_owned)
+ FF_free(s->ftmemory, own_font_data);
return ft_to_gs_error(ft_error);
}
}
@@ -1344,7 +1344,8 @@ gs_fapi_ft_get_scaled_font(gs_fapi_server * a_server, gs_fapi_font * a_font,
new_face(a_server, ft_face, ft_inc_int, ft_strm,
own_font_data, own_font_data_len, data_owned);
if (!face) {
- FF_free(s->ftmemory, own_font_data);
+ if (data_owned)
+ FF_free(s->ftmemory, own_font_data);
FT_Done_Face(ft_face);
delete_inc_int(a_server, ft_inc_int);
return_error(gs_error_VMerror);
diff --git a/base/freetype.mak b/base/freetype.mak
index eda8c46c..0ee15c90 100644
--- a/base/freetype.mak
+++ b/base/freetype.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2021 Artifex Software, Inc.
+# Copyright (C) 2001-2022 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -33,10 +33,9 @@ FTO_=$(O_)$(FTOBJ)
# Define our local compiler alias
# we must define FT2_BUILD_LIBRARY to get internal declarations
# If GS is using the system zlib, freetype should also do so,
-# FT_CONFIG_SYSTEM_ZLIB is set by the top makefile.
-FTCC=$(CC) $(I_)$(FTGEN)$(_I) $(I_)$(FTSRCDIR)$(D)include$(_I) \
+FTCC=$(CC) $(I_)$(FTGEN)$(_I) $(I_)$(FTSRCDIR)$(D)include$(_I) $(FT_CFLAGS) \
$(D_)FT_CONFIG_OPTIONS_H=\"$(FTCONFH)\"$(_D) $(D_)FT2_BUILD_LIBRARY$(_D) \
- $(D_)DARWIN_NO_CARBON$(_D) $(FT_CONFIG_SYSTEM_ZLIB) $(CCFLAGS)
+ $(D_)DARWIN_NO_CARBON$(_D) $(D_)FT_CONFIG_OPTION_SYSTEM_ZLIB$(_D) $(CCFLAGS)
# Define the name of this makefile.
FT_MAK=$(GLSRC)freetype.mak $(TOP_MAKEFILES)
@@ -214,6 +213,9 @@ ft_sdf=\
$(FTOBJ)ftsdfcommon.$(OBJ) \
$(FTOBJ)ftsdfrend.$(OBJ) \
+ft_svg=\
+ $(FTOBJ)ftsvg.$(OBJ)
+
# instantiate the requested build option (shared or compiled in)
$(FTGEN)freetype.dev : $(FTGEN)freetype_$(SHARE_FT).dev $(FT_MAK) $(GENFTCONFH) $(MAKEDIRS)
$(CP_) $(FTGEN)freetype_$(SHARE_FT).dev $(FTGEN)freetype.dev
@@ -228,7 +230,7 @@ $(FTGEN)freetype_0.dev : $(FT_MAK) $(ECHOGS_XE) \
$(ft_autofit) $(ft_base) $(ft_bdf) $(ft_cache) $(ft_cff) $(ft_cid) \
$(ft_gzip) $(ft_lzw) $(ft_pcf) $(ft_pfr) $(ft_psaux) $(ft_pshinter) \
$(ft_psnames) $(ft_raster) $(ft_smooth) $(ft_sfnt) $(ft_truetype) \
- $(ft_type1) $(ft_type42) $(ft_winfonts) $(ft_sdf) $(GENFTCONFH) $(MAKEDIRS)
+ $(ft_type1) $(ft_type42) $(ft_winfonts) $(ft_sdf) $(ft_svg) $(GENFTCONFH) $(MAKEDIRS)
$(SETMOD) $(FTGEN)freetype_0 $(ft_autofit)
$(ADDMOD) $(FTGEN)freetype_0 $(ft_base)
$(ADDMOD) $(FTGEN)freetype_0 $(ft_bdf)
@@ -250,6 +252,7 @@ $(FTGEN)freetype_0.dev : $(FT_MAK) $(ECHOGS_XE) \
$(ADDMOD) $(FTGEN)freetype_0 $(ft_type42)
$(ADDMOD) $(FTGEN)freetype_0 $(ft_winfonts)
$(ADDMOD) $(FTGEN)freetype_0 $(ft_sdf)
+ $(ADDMOD) $(FTGEN)freetype_0 $(ft_svg)
# custom build rules for each source file
@@ -664,3 +667,6 @@ $(FTOBJ)ftsdfcommon.$(OBJ) : $(FTSRC)sdf$(D)ftsdfcommon.c $(FT_MAK) $(GENFTCONFH
$(FTOBJ)ftsdfrend.$(OBJ) : $(FTSRC)sdf$(D)ftsdfrend.c $(FT_MAK) $(GENFTCONFH) $(MAKEDIRS)
$(FTCC) $(FTO_)ftsdfrend.$(OBJ) $(C_) $(FTSRC)sdf$(D)ftsdfrend.c
+
+$(FTOBJ)ftsvg.$(OBJ) : $(FTSRC)svg$(D)ftsvg.c $(FT_MAK) $(GENFTCONFH) $(MAKEDIRS)
+ $(FTCC) $(FTO_)ftsvg.$(OBJ) $(C_) $(FTSRC)svg$(D)ftsvg.c
diff --git a/base/gdevabuf.c b/base/gdevabuf.c
index e22418a3..7430c66e 100644
--- a/base/gdevabuf.c
+++ b/base/gdevabuf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -22,6 +22,7 @@
#include "gdevmem.h" /* private definitions */
#include "gzstate.h"
#include "gxdevcli.h"
+#include "gxdevsop.h"
/* ================ Alpha devices ================ */
@@ -74,6 +75,7 @@ static dev_proc_copy_mono(mem_abuf_copy_mono);
static dev_proc_fill_rectangle(mem_abuf_fill_rectangle);
static dev_proc_get_clipping_box(mem_abuf_get_clipping_box);
static dev_proc_fill_rectangle_hl_color(mem_abuf_fill_rectangle_hl_color);
+static dev_proc_fill_stroke_path(mem_abuf_fill_stroke_path);
/* The device descriptor. */
static void
@@ -88,6 +90,7 @@ mem_alpha_initialize_device_procs(gx_device *dev)
set_dev_proc(dev, copy_color, gx_default_copy_color);
set_dev_proc(dev, strip_copy_rop2, gx_no_strip_copy_rop2);
set_dev_proc(dev, fill_rectangle_hl_color, mem_abuf_fill_rectangle_hl_color);
+ set_dev_proc(dev, fill_stroke_path, mem_abuf_fill_stroke_path);
}
static const gx_device_memory mem_alpha_buffer_device =
@@ -414,6 +417,39 @@ mem_abuf_fill_rectangle_hl_color(gx_device * dev, const gs_fixed_rect *rect,
return 0;
}
+/*
+ * Fill/Stroke a path. This is the default implementation of the driver
+ * fill_path procedure.
+ */
+int
+mem_abuf_fill_stroke_path(gx_device * pdev, const gs_gstate * pgs,
+ gx_path * ppath,
+ const gx_fill_params * params_fill,
+ const gx_device_color * pdevc_fill,
+ const gx_stroke_params * params_stroke,
+ const gx_device_color * pdevc_stroke,
+ const gx_clip_path * pcpath)
+{
+ int orig_state;
+ int code;
+
+ orig_state = dev_proc(pdev, dev_spec_op)(pdev, gxdso_overprint_op, (void *)OP_STATE_FILL, 0);
+ code = dev_proc(pdev, fill_path)(pdev, pgs, ppath, params_fill, pdevc_fill, pcpath);
+
+ if (code < 0)
+ return code;
+ /* Swap colors to make sure the pgs colorspace is correct for stroke */
+ gs_swapcolors_quick(pgs);
+ (void)dev_proc(pdev, dev_spec_op)(pdev, gxdso_overprint_op, (void *)OP_STATE_STROKE, 0);
+ code = dev_proc(pdev, stroke_path)(pdev, pgs, ppath, params_stroke, pdevc_stroke, pcpath);
+ gs_swapcolors_quick(pgs);
+ if (orig_state >= 0)
+ (void)dev_proc(pdev, dev_spec_op)(pdev, gxdso_overprint_op, (void *)(intptr_t)orig_state, 0);
+
+ return code;
+}
+
+
/* Get the clipping box. We must scale this up by the number of alpha bits. */
static void
mem_abuf_get_clipping_box(gx_device * dev, gs_fixed_rect * pbox)
diff --git a/base/gdevdflt.c b/base/gdevdflt.c
index f93e968d..df85e1f9 100644
--- a/base/gdevdflt.c
+++ b/base/gdevdflt.c
@@ -729,6 +729,7 @@ gx_device_fill_in_procs(register gx_device * dev)
fill_dev_proc(dev, process_page, gx_default_process_page);
fill_dev_proc(dev, transform_pixel_region, gx_default_transform_pixel_region);
fill_dev_proc(dev, fill_stroke_path, gx_default_fill_stroke_path);
+ fill_dev_proc(dev, lock_pattern, gx_default_lock_pattern);
}
@@ -1260,6 +1261,7 @@ int gx_copy_device_procs(gx_device *dest, const gx_device *src, const gx_device
set_dev_proc(dest, process_page, dev_proc(&prototype, process_page));
set_dev_proc(dest, transform_pixel_region, dev_proc(&prototype, transform_pixel_region));
set_dev_proc(dest, fill_stroke_path, dev_proc(&prototype, fill_stroke_path));
+ set_dev_proc(dest, lock_pattern, dev_proc(&prototype, lock_pattern));
/*
* We absolutely must set the 'set_graphics_type_tag' to the default subclass one
@@ -1346,6 +1348,9 @@ int gx_device_subclass(gx_device *dev_to_subclass, gx_device *new_prototype, uns
child_dev->stype = a_std;
child_dev->stype_is_dynamic = 1;
+ /* At this point, the only counted reference to the child is from its parent, and we need it to use the right allocator */
+ rc_init(child_dev, dev_to_subclass->memory->stable_memory, 1);
+
psubclass_data = (void *)gs_alloc_bytes(dev_to_subclass->memory->non_gc_memory, private_data_size, "subclass memory for subclassing device");
if (psubclass_data == 0){
gs_free_const_object(dev_to_subclass->memory->non_gc_memory, b_std, "gs_device_subclass(stype)");
@@ -1431,12 +1436,15 @@ void gx_device_unsubclass(gx_device *dev)
gx_device *parent, *child;
gs_memory_struct_type_t *a_std = 0, *b_std = 0;
int dynamic, ref_count;
+ gs_memory_t *rcmem;
/* This should not happen... */
if (!dev)
return;
ref_count = dev->rc.ref_count;
+ rcmem = dev->rc.memory;
+
child = dev->child;
psubclass_data = (generic_subclass_data *)dev->subclass_data;
parent = dev->parent;
@@ -1483,6 +1491,7 @@ void gx_device_unsubclass(gx_device *dev)
* when we copy back the subclassed device.
*/
dev->rc.ref_count = ref_count;
+ dev->rc.memory = rcmem;
/* If we have a chain of devices, make sure the chain beyond the
* device we're unsubclassing doesn't get broken, we need to
@@ -1501,12 +1510,6 @@ void gx_device_unsubclass(gx_device *dev)
* devices it's possible that their child pointer can then be NULL.
*/
if (child) {
- if (child->icc_struct)
- rc_decrement(child->icc_struct, "gx_device_unsubclass, icc_struct");
- if (child->PageList)
- rc_decrement(child->PageList, "gx_device_unsubclass, PageList");
- if (child->NupControl)
- rc_decrement(child->NupControl, "gx_device_unsubclass, NupControl");
/* We cannot afford to free the child device if its stype is not
* dynamic because we can't 'null' the finalise routine, and we
* cannot permit the device to be finalised because we have copied
@@ -1519,8 +1522,7 @@ void gx_device_unsubclass(gx_device *dev)
* just security here. */
child->parent = NULL;
child->child = NULL;
- /* Make certain the memory will be freed, zap the reference count */
- child->rc.ref_count = 0;
+
/* We *don't* want to run the finalize routine. This would free
* the stype and properly handle the icc_struct and PageList,
* but for devices with a custom finalize (eg psdcmyk) it might
@@ -1529,22 +1531,27 @@ void gx_device_unsubclass(gx_device *dev)
* variable is just to get rid of const warnings.
*/
b_std = (gs_memory_struct_type_t *)child->stype;
- b_std->finalize = NULL;
- /* Having patched the stype, we need to make sure the memory
+ gs_free_const_object(dev->memory->non_gc_memory, b_std, "gs_device_unsubclass(stype)");
+ /* Make this into a generic device */
+ child->stype = &st_device;
+ child->stype_is_dynamic = false;
+
+ /* We can't simply discard the child device, because there may be references to it elsewhere,
+ but equally, we really don't want it doing anything, so set the procs so actions are just discarded.
+ */
+ gx_copy_device_procs(child, (gx_device *)&gs_null_device, (gx_device *)&gs_null_device);
+
+ /* Having changed the stype, we need to make sure the memory
* manager uses it. It keeps a copy in its own data structure,
* and would use that copy, which would mean it would call the
* finalize routine that we just patched out.
*/
- gs_set_object_type(dev->memory->stable_memory, child, b_std);
+ gs_set_object_type(dev->memory->stable_memory, child, child->stype);
+ child->finalize = NULL;
/* Now (finally) free the child memory */
- gs_free_object(dev->memory->stable_memory, child, "gx_device_unsubclass(device)");
- /* And the stype for it */
- gs_free_const_object(dev->memory->non_gc_memory, b_std, "gs_device_unsubclass(stype)");
- child = 0;
+ rc_decrement(child, "gx_device_unsubclass(device)");
}
}
- if(child)
- child->parent = dev;
dev->parent = parent;
/* If this device has a dynamic stype, we wnt to keep using it, but we copied
diff --git a/base/gdevepo.c b/base/gdevepo.c
index f8c46c54..eea3300e 100644
--- a/base/gdevepo.c
+++ b/base/gdevepo.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -235,6 +235,7 @@ disable_self(gx_device *dev)
set_dev_proc(dev, process_page, default_subclass_process_page);
set_dev_proc(dev, transform_pixel_region, default_subclass_transform_pixel_region);
set_dev_proc(dev, fill_stroke_path, default_subclass_fill_stroke_path);
+ set_dev_proc(dev, lock_pattern, default_subclass_lock_pattern);
}
int
diff --git a/base/gdevflp.c b/base/gdevflp.c
index 3c1ad135..53928044 100644
--- a/base/gdevflp.c
+++ b/base/gdevflp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -30,6 +30,7 @@
*/
#include "math_.h"
+#include "string_.h" /* for strlen */
#include "memory_.h"
#include "gx.h"
#include "gserrors.h"
@@ -49,6 +50,7 @@
#include "gximage.h" /* For gx_image_enum */
#include "gdevsclass.h"
#include "gdevflp.h"
+#include "pagelist.h"
#include <stdlib.h>
/* GC descriptor */
@@ -137,134 +139,8 @@ gx_device_flp gs_flp_device =
static int ParsePageList(gx_device *dev, first_last_subclass_data *psubclass_data, char *PageList)
{
- char *str, *oldstr, *workstr, c, *ArgCopy;
- int LastPage, Page, byte, bit, i, prev_page = -1;
-
- psubclass_data->ProcessedPageList = true;
- if (strcmp(PageList, "even") == 0) {
- psubclass_data->EvenOdd = even;
- } else {
- if (strcmp(PageList, "odd") == 0) {
- psubclass_data->EvenOdd = odd;
- } else {
- psubclass_data->EvenOdd = none;
-
- /* validation of parameter */
- str = PageList;
- do {
- /* Must be digit, ',' or - */
- if (*str != ',' && *str != '-' && (*str < 0x30 || *str > 0x39)) {
- return (gs_note_error(gs_error_typecheck));
- }
- /* Check we don't have 2 special characters (, or -) in a row */
- if ((*str == ',' || *str == '-') && (*(str+1) == ',' || *(str+1) == '-'))
- return (gs_note_error(gs_error_typecheck));
- } while(*(++str));
-
- str = PageList;
- oldstr = str;
- do {
- str = strchr(oldstr, ',');
- /* Check for trailing ',' in parameter, zap it if we find one. */
- if (str) {
- if (*(str + 1))
- oldstr = ++str;
- else {
- *str = 0x00;
- break;
- }
- }
- }while (str);
-
- /* In case last set is a page range */
- str = strchr(oldstr, '-');
- if (!str)
- str = oldstr;
- else {
- /* We permit a trailing '-' to indicate all pages from this one to the end */
- if (*(str + 1))
- str++;
- else {
- *str = 0x00;
- str = oldstr;
- psubclass_data->FromToEnd = atoi(str);
- }
- }
- /* str should now point to the last page number (we hope!) */
- psubclass_data->LastListPage = LastPage = atoi(str);
-
- psubclass_data->PageArraySize = (LastPage + 7) / 8;
- psubclass_data->PageArray = gs_alloc_bytes(dev->memory->non_gc_memory, psubclass_data->PageArraySize, "array of pages selected");
- if (!psubclass_data->PageArray) {
- psubclass_data->PageArraySize = 0;
- return (gs_note_error(gs_error_VMerror));
- }
- memset(psubclass_data->PageArray, 0x00, psubclass_data->PageArraySize);
-
- oldstr = ArgCopy = (char *)gs_alloc_bytes(dev->memory->non_gc_memory, strlen(PageList) + 1, "temp working string");
- if (!ArgCopy) {
- gs_free_object(dev->memory->non_gc_memory, psubclass_data->PageArray, "free array of pages selected");
- psubclass_data->PageArray = 0;
- psubclass_data->PageArraySize = 0;
- return (gs_note_error(gs_error_VMerror));
- }
- memcpy(ArgCopy, PageList, strlen(PageList) + 1);
- do {
- str = strchr(oldstr, ',');
- if (str)
- *str++ = 0x00;
- /* oldstr now points to a null terminated string and is either a number or a number pair */
- workstr = strchr(oldstr, '-');
- if (workstr) {
- *workstr++ = 0x00;
- /* oldstr points to null terminated string of start, workstr to null terminated string of end */
- Page = atoi(oldstr) - 1;
- if (Page < 0)
- Page = 0;
-
- LastPage = atoi(workstr) - 1;
- if (LastPage < 0)
- LastPage = 0;
-
- if (LastPage < Page || Page <= prev_page) {
- /* Strictly monotonic increasing required */
- emprintf(dev->memory, "\n**** Error : rangecheck processing PageList\n");
- return_error(gs_error_rangecheck);
- }
- prev_page = LastPage;
-
- for (i=Page; i<= LastPage;i++) {
- if (i > psubclass_data->LastListPage - 1) {
- emprintf(dev->memory, "\n**** Error : rangecheck processing PageList\n");
- return_error(gs_error_rangecheck);
- }
- byte = (int)(i / 8);
- bit = i % 8;
- c = 0x01 << bit;
- ((char *)psubclass_data->PageArray)[byte] |= c;
- }
- } else {
- Page = atoi(oldstr) - 1;
- if (Page < 0)
- Page = 0;
- if (Page <= prev_page || Page > psubclass_data->LastListPage - 1) {
- /* Strictly monotonic increasing required */
- emprintf(dev->memory, "\n**** Error : rangecheck processing PageList\n");
- return_error(gs_error_rangecheck);
- }
- prev_page = Page;
-
- byte = (int)(Page / 8);
- bit = Page % 8;
- c = 0x01 << bit;
- ((char *)psubclass_data->PageArray)[byte] |= c;
- }
- oldstr = str;
- } while (str);
- gs_free_object(dev->memory->non_gc_memory, ArgCopy, "free temp working string");
- }
- }
- return 0;
+ return pagelist_parse_to_array(PageList, dev->memory->non_gc_memory, 0x7fffffff,
+ &(psubclass_data->page_range_array));
}
static int SkipPage(gx_device *dev)
@@ -277,51 +153,28 @@ static int SkipPage(gx_device *dev)
return 0;
/* If we haven't parsed any extant PageList, do it now */
- if (dev->PageList && !psubclass_data->ProcessedPageList) {
+ if (dev->PageList && psubclass_data->page_range_array == NULL) {
code = ParsePageList(dev, psubclass_data, dev->PageList->Pages);
- if (code < 0)
+ if (code < 0) {
+ emprintf1(dev->memory, "*** Invalid PageList=%s ***\n", dev->PageList->Pages);
return code;
- psubclass_data->ProcessedPageList = true;
+ }
}
- if (psubclass_data->PageArray) {
- if (psubclass_data->FromToEnd != 0 && psubclass_data->PageCount >= psubclass_data->FromToEnd - 1)
- return 0;
- else {
- if (psubclass_data->PageCount > psubclass_data->LastListPage - 1)
- return 1;
- else {
- int byte, bit;
- char c;
-
- byte = (int)((psubclass_data->PageCount) / 8);
- bit = (psubclass_data->PageCount) % 8;
- c = 0x01 << bit;
- if (((char *)psubclass_data->PageArray)[byte] & c)
- return 0;
- else
- return 1;
- }
- }
+ /* SkipPage can only handle PageList that moves forward */
+ if (psubclass_data->page_range_array != NULL &&
+ pagelist_test_ordered(psubclass_data->page_range_array) == false) {
+ emprintf(dev->memory, "*** Bad PageList: Must be increasing order. ***\n");
+ return gs_error_rangecheck;
+ }
+
+ if (psubclass_data->page_range_array != NULL) {
+ /* PageCount is 0 based, page_range_array starts at page 1 */
+ return pagelist_test_printed(psubclass_data->page_range_array, psubclass_data->PageCount + 1) == false;
} else {
- if (psubclass_data->EvenOdd != none) {
- /* Page count is 0 based so the even/odd tests are 'upside down' */
- if (psubclass_data->PageCount % 2 == 0) {
- if (psubclass_data->EvenOdd == odd)
- return 0;
- else
- return 1;
- } else {
- if (psubclass_data->EvenOdd == even)
- return 0;
- else
- return 1;
- }
- } else {
- if (psubclass_data->PageCount >= dev->FirstPage - 1)
- if (!dev->LastPage || psubclass_data->PageCount <= dev->LastPage - 1)
- return 0;
- }
+ if (psubclass_data->PageCount >= dev->FirstPage - 1)
+ if (!dev->LastPage || psubclass_data->PageCount <= dev->LastPage - 1)
+ return 0;
}
return 1;
}
@@ -344,11 +197,10 @@ int flp_close_device(gx_device *dev)
{
first_last_subclass_data *psubclass_data = dev->subclass_data;
- if (psubclass_data->PageArraySize)
+ if (psubclass_data->page_range_array != NULL)
{
- gs_free(dev->memory->non_gc_memory, psubclass_data->PageArray, 1, psubclass_data->PageArraySize, "array of pages selected");
- psubclass_data->PageArray = 0;
- psubclass_data->PageArraySize = 0;
+ pagelist_free_range_array(dev->memory->non_gc_memory, psubclass_data->page_range_array);
+ psubclass_data->page_range_array = NULL;
}
return default_subclass_close_device(dev);
@@ -399,7 +251,7 @@ flp_rc_free_pages_list(gs_memory_t * mem, void *ptr_in, client_name_t cname)
gdev_pagelist *PageList = (gdev_pagelist *)ptr_in;
if (PageList->rc.ref_count <= 1) {
- gs_free(mem->non_gc_memory, PageList->Pages, 1, PagesSize, "free page list");
+ gs_free(mem->non_gc_memory, PageList->Pages, 1, strlen(PageList->Pages), "free page list");
gs_free(mem->non_gc_memory, PageList, 1, sizeof(gdev_pagelist), "free structure to hold page list");
}
}
@@ -411,90 +263,91 @@ flp_put_params(gx_device * dev, gs_param_list * plist)
int code, ecode = 0;
gs_param_string pagelist;
- code = param_read_int(plist, "FirstPage", &dev->FirstPage);
+ code = param_read_bool(plist, "DisablePageHandler", &temp_bool);
if (code < 0)
ecode = code;
if (code == 0) {
- first_last_subclass_data *psubclass_data = dev->subclass_data;
+ dev->DisablePageHandler = temp_bool;
+ if (dev->DisablePageHandler == false) {
+ first_last_subclass_data *psubclass_data = dev->subclass_data;
- dev->DisablePageHandler = false;
- psubclass_data->PageCount = 0;
- if (dev->PageList) {
- rc_decrement(dev->PageList, "flp_put_params");
- dev->PageList = NULL;
- }
- if (psubclass_data->PageArray != NULL) {
- gs_free(dev->memory->non_gc_memory, psubclass_data->PageArray, 1, psubclass_data->PageArraySize, "array of pages selected");
- psubclass_data->PageArray = NULL;
- psubclass_data->PageArraySize = 0;
+ psubclass_data->PageCount = 0;
+ psubclass_data->page_range_array = NULL;
}
}
- code = param_read_int(plist, "LastPage", &dev->LastPage);
- if (code < 0)
- ecode = code;
- if (code == 0) {
- first_last_subclass_data *psubclass_data = dev->subclass_data;
+ if (dev->DisablePageHandler == false) {
+ code = param_read_int(plist, "FirstPage", &dev->FirstPage);
+ if (code < 0)
+ ecode = code;
+ if (code == 0) {
+ first_last_subclass_data *psubclass_data = dev->subclass_data;
- dev->DisablePageHandler = false;
- psubclass_data->PageCount = 0;
- if (dev->PageList) {
- rc_decrement(dev->PageList, "flp_put_params");
- dev->PageList = NULL;
- }
- if (psubclass_data->PageArray != NULL) {
- gs_free(dev->memory->non_gc_memory, psubclass_data->PageArray, 1, psubclass_data->PageArraySize, "array of pages selected");
- psubclass_data->PageArray = NULL;
- psubclass_data->PageArraySize = 0;
+ dev->DisablePageHandler = false;
+ psubclass_data->PageCount = 0;
+ psubclass_data->page_range_array = NULL;
+ if (dev->PageList) {
+ rc_decrement(dev->PageList, "flp_put_params");
+ dev->PageList = NULL;
+ }
+ if (psubclass_data->page_range_array != NULL) {
+ pagelist_free_range_array(dev->memory->non_gc_memory, psubclass_data->page_range_array);
+ psubclass_data->page_range_array = NULL;
+ }
}
- }
- code = param_read_bool(plist, "DisablePageHandler", &temp_bool);
- if (code < 0)
- ecode = code;
- if (code == 0) {
- dev->DisablePageHandler = temp_bool;
- if (dev->DisablePageHandler == false) {
+ code = param_read_int(plist, "LastPage", &dev->LastPage);
+ if (code < 0)
+ ecode = code;
+ if (code == 0) {
first_last_subclass_data *psubclass_data = dev->subclass_data;
+ dev->DisablePageHandler = false;
psubclass_data->PageCount = 0;
+ psubclass_data->page_range_array = NULL;
+ if (dev->PageList) {
+ rc_decrement(dev->PageList, "flp_put_params");
+ dev->PageList = NULL;
+ }
+ if (psubclass_data->page_range_array != NULL) {
+ pagelist_free_range_array(dev->memory->non_gc_memory, psubclass_data->page_range_array);
+ psubclass_data->page_range_array = NULL;
+ }
}
- }
- code = param_read_string(plist, "PageList", &pagelist);
- if (code < 0)
- ecode = code;
+ code = param_read_string(plist, "PageList", &pagelist);
+ if (code < 0)
+ ecode = code;
- if (code == 0 && pagelist.size > 0) {
- first_last_subclass_data *psubclass_data = dev->subclass_data;
+ if (code == 0 && pagelist.size > 0) {
+ first_last_subclass_data *psubclass_data = dev->subclass_data;
- if (dev->PageList)
- rc_decrement(dev->PageList, "flp_put_params");
+ if (dev->PageList)
+ rc_decrement(dev->PageList, "flp_put_params");
- if (psubclass_data->PageArray != NULL) {
- gs_free(dev->memory->non_gc_memory, psubclass_data->PageArray, 1, psubclass_data->PageArraySize, "array of pages selected");
- psubclass_data->PageArray = NULL;
- psubclass_data->PageArraySize = 0;
- }
+ if (psubclass_data->page_range_array != NULL) {
+ pagelist_free_range_array(dev->memory->non_gc_memory, psubclass_data->page_range_array);
+ psubclass_data->page_range_array = NULL;
+ }
- dev->PageList = (gdev_pagelist *)gs_alloc_bytes(dev->memory->non_gc_memory, sizeof(gdev_pagelist), "structure to hold page list");
- if (!dev->PageList)
- return gs_note_error(gs_error_VMerror);
- dev->PageList->Pages = (void *)gs_alloc_bytes(dev->memory->non_gc_memory, pagelist.size + 1, "String to hold page list");
- if (!dev->PageList->Pages){
- gs_free(dev->memory->non_gc_memory, dev->PageList, 1, sizeof(gdev_pagelist), "free structure to hold page list");
- dev->PageList = 0;
- return gs_note_error(gs_error_VMerror);
+ dev->PageList = (gdev_pagelist *)gs_alloc_bytes(dev->memory->non_gc_memory, sizeof(gdev_pagelist), "structure to hold page list");
+ if (!dev->PageList)
+ return gs_note_error(gs_error_VMerror);
+ dev->PageList->Pages = (void *)gs_alloc_bytes(dev->memory->non_gc_memory, pagelist.size + 1, "String to hold page list");
+ if (!dev->PageList->Pages){
+ gs_free(dev->memory->non_gc_memory, dev->PageList, 1, sizeof(gdev_pagelist), "free structure to hold page list");
+ dev->PageList = 0;
+ return gs_note_error(gs_error_VMerror);
+ }
+ memset(dev->PageList->Pages, 0x00, pagelist.size + 1);
+ memcpy(dev->PageList->Pages, pagelist.data, pagelist.size);
+ rc_init_free(dev->PageList, dev->memory->non_gc_memory, 1, flp_rc_free_pages_list);
+ psubclass_data->page_range_array = NULL;
+ dev->DisablePageHandler = false;
+ psubclass_data->PageCount = 0;
+ psubclass_data->page_range_array = NULL;
}
- memset(dev->PageList->Pages, 0x00, pagelist.size + 1);
- memcpy(dev->PageList->Pages, pagelist.data, pagelist.size);
- dev->PageList->PagesSize = pagelist.size + 1;
- rc_init_free(dev->PageList, dev->memory->non_gc_memory, 1, flp_rc_free_pages_list);
- psubclass_data->ProcessedPageList = false;
- dev->DisablePageHandler = false;
- psubclass_data->PageCount = 0;
}
-
code = default_subclass_put_params(dev, plist);
if (code < 0)
@@ -989,11 +842,15 @@ int flp_fill_linear_color_triangle(gx_device *dev, const gs_fill_attributes *fa,
int flp_fillpage(gx_device *dev, gs_gstate * pgs, gx_device_color *pdevc)
{
+ first_last_subclass_data *psubclass_data = dev->subclass_data;
int code = SkipPage(dev);
if (code < 0)
return code;
- if (!code)
+
+ /* allow fillpage to be processed at the first page */
+ /* This is needed to allow all parsers to start with non-ordered PageList */
+ if (!code || psubclass_data->PageCount == 0)
return default_subclass_fillpage(dev, pgs, pdevc);
return 0;
@@ -1175,4 +1032,4 @@ flp_initialize_device_procs(gx_device *dev)
set_dev_proc(dev, process_page, flp_process_page);
set_dev_proc(dev, transform_pixel_region, flp_transform_pixel_region);
set_dev_proc(dev, fill_stroke_path, flp_fill_stroke_path);
-} \ No newline at end of file
+}
diff --git a/base/gdevflp.h b/base/gdevflp.h
index 453f401a..fb888199 100644
--- a/base/gdevflp.h
+++ b/base/gdevflp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -33,12 +33,7 @@ typedef enum {none, even, odd} flp_EOType;
typedef struct {
subclass_common;
int PageCount;
- int ProcessedPageList;
- void *PageArray;
- int PageArraySize;
- int LastListPage;
- int FromToEnd;
- flp_EOType EvenOdd;
+ int *page_range_array;
} first_last_subclass_data;
typedef struct flp_text_enum_s {
diff --git a/base/gdevkrnlsclass.c b/base/gdevkrnlsclass.c
index 8ae05fb2..cff5ae95 100644
--- a/base/gdevkrnlsclass.c
+++ b/base/gdevkrnlsclass.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -24,6 +24,11 @@
*/
#define FORCE_TESTING_SUBCLASSING 0
+/* This installs the 'kernel' device classes. If you add any devices here you should
+ * almost certainly edit gdevp14.c, gs_pdf14_device_push() and add the new device to the list
+ * of devices which the push of the compositor claims are already installed (to prevent
+ * a second copy being installed by gdev_prn_open).
+ */
int install_internal_subclass_devices(gx_device **ppdev, int *devices_loaded)
{
int code = 0;
diff --git a/base/gdevm8.c b/base/gdevm8.c
index 6717c585..a94c107f 100644
--- a/base/gdevm8.c
+++ b/base/gdevm8.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -195,6 +195,7 @@ mapped8_copyN1(chunk * dest, const byte * line, int first_bit,
goto enter7;
}
do {
+ sbyte = *sptr++;
enter0: if (sbyte & 128)
*pptr = b1;
pptr++;
@@ -219,11 +220,13 @@ mapped8_copyN1(chunk * dest, const byte * line, int first_bit,
enter7: if (sbyte & 1)
*pptr = b1;
pptr++;
- sbyte = *sptr++;
count -= 8;
} while (count >= 0);
bit = 128;
count += 8;
+ if (count > 0)
+ /* read the byte containing the trailing bits */
+ sbyte = *sptr++;
} else {
/* Less than 1 byte to do */
bit = 0x80>>first_bit;
diff --git a/base/gdevmpla.c b/base/gdevmpla.c
index 79b29116..4103b021 100644
--- a/base/gdevmpla.c
+++ b/base/gdevmpla.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1732,6 +1732,9 @@ plane_strip_copy_rop2(gx_device_memory * mdev,
int code;
const gdev_mem_functions *fns;
int n;
+ dev_proc_encode_color(*save_encode);
+ dev_proc_get_color_mapping_procs(*save_gcmp);
+ gx_color_index save_black, save_white;
/* assert(planar_height == 0); */
@@ -1742,6 +1745,24 @@ plane_strip_copy_rop2(gx_device_memory * mdev,
* so ensure we have the right ones in there. */
set_dev_proc(mdev, get_bits_rectangle, fns->get_bits_rectangle);
set_dev_proc(mdev, fill_rectangle, fns->fill_rectangle);
+ /* We are about to change the number of components, so the cached black
+ * and white values are no longer correct. */
+ save_black = mdev->cached_colors.black;
+ save_white = mdev->cached_colors.white;
+ mdev->cached_colors.black = gx_no_color_index;
+ mdev->cached_colors.white = gx_no_color_index;
+ /* The strip_copy_rop2 routine can end up trying to calculate black
+ * and white values. For this it will call 'get_color_mapping_procs'
+ * and encode_color. We can't have it calling the devices own ones
+ * because they assume multiple planes, not just one. Store the
+ * originals, and swap them out for sane ones. It's possible that
+ * for some crazy devices, these choices might not be perfect,
+ * but it's hard to see what we could do better, so those devices
+ * might need to implement their own strip_copy_rop2. */
+ save_encode = dev_proc(mdev, encode_color);
+ save_gcmp = dev_proc(mdev, get_color_mapping_procs);
+ set_dev_proc(mdev, get_color_mapping_procs, gx_default_DevGray_get_color_mapping_procs);
+ set_dev_proc(mdev, encode_color, gx_default_gray_encode_color);
/* mdev->color_info.depth is restored by MEM_RESTORE_PARAMS below. */
mdev->color_info.depth = mdev->planes[plane].depth;
n = mdev->color_info.num_components;
@@ -1750,9 +1771,14 @@ plane_strip_copy_rop2(gx_device_memory * mdev,
id, scolors, textures, tcolors,
x, y, width, height,
phase_x, phase_y, lop, planar_height);
+ /* Restore color details. */
mdev->color_info.num_components = n;
set_dev_proc(mdev, get_bits_rectangle, mem_planar_get_bits_rectangle);
set_dev_proc(mdev, fill_rectangle, mem_planar_fill_rectangle);
+ set_dev_proc(mdev, encode_color, save_encode);
+ set_dev_proc(mdev, get_color_mapping_procs, save_gcmp);
+ mdev->cached_colors.black = save_black;
+ mdev->cached_colors.white = save_white;
/* The following effectively does: mdev->line_ptrs -= mdev->height * plane; */
MEM_RESTORE_PARAMS(mdev, save);
return code;
diff --git a/base/gdevnfwd.c b/base/gdevnfwd.c
index 948bfa09..4b23cbcb 100644
--- a/base/gdevnfwd.c
+++ b/base/gdevnfwd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -106,6 +106,7 @@ gx_device_forward_fill_in_procs(register gx_device_forward * dev)
fill_dev_proc(dev, strip_tile_rect_devn, gx_forward_strip_tile_rect_devn);
fill_dev_proc(dev, transform_pixel_region, gx_forward_transform_pixel_region);
fill_dev_proc(dev, fill_stroke_path, gx_forward_fill_stroke_path);
+ fill_dev_proc(dev, lock_pattern, gx_forward_lock_pattern);
gx_device_fill_in_procs((gx_device *) dev);
}
@@ -367,6 +368,19 @@ gx_forward_fill_stroke_path(gx_device * dev, const gs_gstate * pgs,
}
int
+gx_forward_lock_pattern(gx_device * dev, gs_gstate * pgs, gs_id pattern_id, int lock)
+{
+ gx_device_forward * const fdev = (gx_device_forward *)dev;
+ gx_device *tdev = fdev->target;
+ dev_proc_lock_pattern((*proc)) =
+ (tdev == 0 ? (tdev = dev, gx_default_lock_pattern) :
+ dev_proc(tdev, lock_pattern));
+
+ return proc(tdev, pgs, pattern_id, lock);
+
+}
+
+int
gx_forward_fill_mask(gx_device * dev,
const byte * data, int dx, int raster, gx_bitmap_id id,
int x, int y, int w, int h,
diff --git a/base/gdevnup.c b/base/gdevnup.c
index b9f4f356..fa8aa3b7 100644
--- a/base/gdevnup.c
+++ b/base/gdevnup.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -342,7 +342,12 @@ copy_and_modify_sub(gs_param_list *plto, gs_param_list *plfrom, int *present)
code = (code > 0 ? gs_note_error(gs_error_unknownerror) : code);
break;
}
- gs_param_list_set_persistent_keys(plto, key.persistent);
+ /* We used to use 'key.persistent' to determine whether we needed to copy the
+ * key (by setting persistent_keys in the param list to false), but that isn't
+ * correct! We are going to use the heap buffer 'string_key', not the original
+ * key, and since that's on the heap it is NOT persistent....
+ */
+ gs_param_list_set_persistent_keys(plto, false);
switch (value.type) {
case gs_param_type_dict:
coll_type = gs_param_collection_dict_any;
diff --git a/base/gdevoflt.c b/base/gdevoflt.c
index 98f16f49..ff9424c7 100644
--- a/base/gdevoflt.c
+++ b/base/gdevoflt.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -32,8 +32,10 @@
#include "gdevprn.h"
#include "gdevp14.h" /* Needed to patch up the procs after compositor creation */
#include "gximage.h" /* For gx_image_enum */
+#include "gximag3x.h"
#include "gdevsclass.h"
#include "gdevoflt.h"
+#include "gximag3x.h"
int gs_is_pdf14trans_compositor(const gs_composite_t * pct);
@@ -110,6 +112,7 @@ obj_filter_initialize_device_procs(gx_device *dev)
set_dev_proc(dev, strip_copy_rop2, obj_filter_strip_copy_rop2);
set_dev_proc(dev, strip_tile_rect_devn, obj_filter_strip_tile_rect_devn);
set_dev_proc(dev, fill_stroke_path, obj_filter_fill_stroke_path);
+ set_dev_proc(dev, composite, default_subclass_composite_front);
}
const
@@ -219,8 +222,10 @@ int obj_filter_strip_tile_rectangle(gx_device *dev, const gx_strip_bitmap *tiles
typedef struct obj_filter_image_enum_s {
gx_image_enum_common;
- int y;
- int height;
+ int y, mask_y;
+ int height, mask_height;
+ int type;
+ int InterleaveType;
} obj_filter_image_enum;
gs_private_st_composite(st_obj_filter_image_enum, obj_filter_image_enum, "obj_filter_image_enum",
obj_filter_image_enum_enum_ptrs, obj_filter_image_enum_reloc_ptrs);
@@ -243,15 +248,25 @@ obj_filter_image_plane_data(gx_image_enum_common_t * info,
{
obj_filter_image_enum *pie = (obj_filter_image_enum *)info;
- if (height > pie->height - pie->y)
- height = pie->height - pie->y;
+ if (pie->type == 3 && pie->InterleaveType == interleave_separate_source) {
+ pie->y += height;
+ pie->mask_y += height;
+ *rows_used = height;
- pie->y += height;
- *rows_used = height;
+ if (pie->y < pie->height || pie->mask_y < pie->mask_height)
+ return 0;
+ return 1;
+ } else {
+ if (height > pie->height - pie->y)
+ height = pie->height - pie->y;
+
+ pie->y += height;
+ *rows_used = height;
- if (pie->y < pie->height)
- return 0;
- return 1;
+ if (pie->y < pie->height)
+ return 0;
+ return 1;
+ }
}
static int
@@ -299,8 +314,76 @@ int obj_filter_begin_typed_image(gx_device *dev, const gs_gstate *pgs, const gs_
pie->memory = memory;
pie->skipping = true;
pie->height = pim->Height;
- pie->y = 0;
-
+ pie->mask_y = pie->y = 0;
+ pie->type = pic->type->index;
+
+ if (pic->type->index == 3) {
+ const gs_image3_t *pim = (const gs_image3_t *)pic;
+
+ switch (pim->InterleaveType)
+ {
+ case interleave_chunky:
+ /* Add the mask data to the depth of the image data. */
+ pie->num_planes = 1;
+ break;
+ case interleave_scan_lines:
+ /*
+ * There is only 1 plane, with dynamically changing width & depth.
+ * Initialize it for the mask data, since that is what will be
+ * read first.
+ */
+ pie->num_planes = 1;
+ pie->plane_depths[0] = 1;
+ pie->plane_widths[0] = pim->MaskDict.Width;
+ break;
+ case interleave_separate_source:
+ /* Insert the mask data as a separate plane before the image data. */
+ pie->num_planes = 2;
+ pie->plane_depths[1] = pie->plane_depths[0];
+ pie->plane_widths[1] = pie->plane_widths[0];
+ pie->plane_widths[0] = pim->MaskDict.Width;
+ pie->plane_depths[0] = 1;
+ pie->mask_height = pim->MaskDict.Height;
+ break;
+ }
+ pie->InterleaveType = pim->InterleaveType;
+ }
+ if (pic->type->index == IMAGE3X_IMAGETYPE) {
+ const gs_image3x_t *pim = (const gs_image3x_t *)pic;
+
+ if (pim->Opacity.MaskDict.BitsPerComponent != 0) {
+ switch(pim->Opacity.InterleaveType) {
+ case interleave_separate_source:
+ pie->num_planes++;
+ pie->plane_depths[1] = pie->plane_depths[0];
+ pie->plane_widths[1] = pie->plane_widths[0];
+ pie->plane_depths[0] = pim->Opacity.MaskDict.BitsPerComponent;
+ pie->plane_widths[0] = pim->Opacity.MaskDict.Width;
+ break;
+ case interleave_chunky:
+ pie->plane_depths[0] += pim->BitsPerComponent;
+ break;
+ default: /* can't happen */
+ return_error(gs_error_Fatal);
+ }
+ }
+ if (pim->Shape.MaskDict.BitsPerComponent != 0) {
+ switch(pim->Shape.InterleaveType) {
+ case interleave_separate_source:
+ pie->num_planes++;
+ pie->plane_depths[1] = pie->plane_depths[0];
+ pie->plane_widths[1] = pie->plane_widths[0];
+ pie->plane_depths[0] = pim->Shape.MaskDict.BitsPerComponent;
+ pie->plane_widths[0] = pim->Shape.MaskDict.Width;
+ break;
+ case interleave_chunky:
+ pie->plane_depths[0] += pim->BitsPerComponent;
+ break;
+ default: /* can't happen */
+ return_error(gs_error_Fatal);
+ }
+ }
+ }
return 0;
}
diff --git a/base/gdevp14.c b/base/gdevp14.c
index b3018f85..0b47ae6d 100644
--- a/base/gdevp14.c
+++ b/base/gdevp14.c
@@ -1647,6 +1647,22 @@ pdf14_pop_transparency_group(gs_gstate *pgs, pdf14_ctx *ctx,
(nos->has_alpha_g ? 1 : 0)));
}
+ /* Before we get started, lets see if we have somehow gotten into
+ what should be an impossible situation where the group color
+ information does not match the buffer color information. This
+ can occur is there were memory issues that have perhaps blown
+ away information, or in the example of Bug 705197 the PDF interpreter
+ reuses a pattern during a circular reference causing an aliasing
+ of two nested patterns, one of which has a softmask. The change in
+ the buffer size of the inner one blows away the buffer of the
+ outer one leading to a mismatch of color spaces. Here
+ we can at least catch the case when the color space sizes have
+ changed and avoid buffer over-runs that would occur when we try
+ to do the group composition */
+ if (nos->n_chan - 1 != nos->group_color_info->num_components ||
+ tos->n_chan - 1 != tos_num_color_comp)
+ return_error(gs_error_Fatal);
+
nos_num_color_comp = nos->group_color_info->num_components - tos->num_spots;
tos_num_color_comp = tos_num_color_comp - tos->num_spots;
@@ -3119,48 +3135,6 @@ pdf14_blend_image_mixed_buffer16(byte* buf_ptr_, int width, int height, int rows
}
}
-static pdf14_buf*
-insert_empty_planes(pdf14_ctx* ctx, pdf14_buf** src_buf, int num_new_planes, int insert_index)
-{
- int planestride = (*src_buf)->planestride;
- int src_n_planes = (*src_buf)->n_planes;
- int src_n_chan = (*src_buf)->n_chan;
- int des_n_planes = src_n_planes + num_new_planes;
- int des_n_chan = src_n_chan + num_new_planes;
- byte *src_ptr = (*src_buf)->data;
- byte* des_ptr;
- byte *des_data;
- bool deep = ctx->deep;
-
- des_data = gs_alloc_bytes(ctx->memory,
- (size_t)planestride * des_n_planes + CAL_SLOP,
- "insert_empty_planes");
- if (des_data == NULL)
- return NULL;
-
- des_ptr = des_data;
-
- /* First copy portion prior to insert point */
- memcpy(des_ptr, src_ptr, (planestride * insert_index) << deep);
-
- /* New planes */
- des_ptr += (planestride * insert_index) << deep;
- src_ptr += (planestride * insert_index) << deep;
- memset(des_ptr, 0, (planestride * num_new_planes) << deep);
-
- /* Extra planes (i.e. doc spots, tags) */
- des_ptr += (planestride * num_new_planes) << deep;
- memcpy(des_ptr, src_ptr, (planestride * (src_n_planes - insert_index)) << deep);
-
- /* Set up buffer structure */
- gs_free_object(ctx->memory, (*src_buf)->data, "insert_empty_planes");
- (*src_buf)->n_planes = des_n_planes;
- (*src_buf)->n_chan = des_n_chan;
- (*src_buf)->data = des_data;
-
- return *src_buf;
-}
-
static int
pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
gs_gstate* pgs, pdf14_buf* buf, int planestride_in,
@@ -3418,30 +3392,6 @@ pdf14_put_blended_image_cmykspot(gx_device* dev, gx_device* target,
tag_offset = buf->has_tags ? buf->n_chan : 0;
}
- /* We may need to pad the buffers to ensure that any additional spot
- channels that are not created by the ICC color conversion (or
- non-conversion if this is not an NCLR profile) get placed properly.
- It is up to the target device to
- handle these planes how it sees fit based upon the image data
- and/or any tags plane during any put image call. We *could*
- do something here to possibly communicate through the put_image
- call where the page related spots start, but that would/could
- be confusing, especially for long term maintenance. Easier just
- to have put_image hand all the data */
- if (dev_target_profile->spotnames != NULL &&
- dev_target_profile->spotnames->count > des_profile->num_comps) {
- int num_new_planes = dev_target_profile->spotnames->count - des_profile->num_comps;
- int insert_index = des_profile->num_comps;
- pdf14_buf* result;
-
- result = insert_empty_planes(pdev->ctx, &buf, num_new_planes, insert_index);
- if (result == NULL)
- return_error(gs_error_VMerror);
-
- num_comp = buf->n_chan;
- tag_offset = buf->has_tags ? buf->n_chan : 0;
- buf_ptr = buf->data + (rect.p.y - buf->rect.p.y) * buf->rowstride + ((rect.p.x - buf->rect.p.x) << deep);
- }
#if RAW_DUMP
/* Dump after the CS transform */
dump_raw_buffer_be(target->memory, height, width, buf->n_planes, planestride, rowstride,
@@ -3859,6 +3809,9 @@ gs_pdf14_device_copy_params(gx_device *dev, const gx_device *target)
dev->icc_struct->supports_devn = profile_targ->supports_devn;
dev->icc_struct->usefastcolor = profile_targ->usefastcolor;
dev->icc_struct->blacktext = profile_targ->blacktext;
+ dev->icc_struct->blackvector = profile_targ->blackvector;
+ dev->icc_struct->blackthresholdL = profile_targ->blackthresholdL;
+ dev->icc_struct->blackthresholdC = profile_targ->blackthresholdC;
switch (pdev->blend_cs_state) {
case PDF14_BLEND_CS_UNSPECIFIED:
@@ -5179,7 +5132,7 @@ pdf14_tile_pattern_fill(gx_device * pdev, const gs_gstate * pgs,
curr_clip_rect = cpath_intersection.rect_list->list.head->next;
for( k = 0; k < cpath_intersection.rect_list->list.count && code >= 0; k++){
if_debug5m('v', pgs->memory,
- "[v]pdf14_tile_pattern_fill, (%d, %d), %d x %d pat_id %d \n",
+ "[v]pdf14_tile_pattern_fill, (%d, %d), %d x %d pat_id %u \n",
curr_clip_rect->xmin, curr_clip_rect->ymin,
curr_clip_rect->xmax-curr_clip_rect->xmin,
curr_clip_rect->ymax-curr_clip_rect->ymin, (int)ptile->id);
@@ -5191,7 +5144,7 @@ pdf14_tile_pattern_fill(gx_device * pdev, const gs_gstate * pgs,
} else if (cpath_intersection.rect_list->list.count == 1) {
/* The case when there is just a single rect */
if_debug5m('v', pgs->memory,
- "[v]pdf14_tile_pattern_fill, (%d, %d), %d x %d pat_id %d \n",
+ "[v]pdf14_tile_pattern_fill, (%d, %d), %d x %d pat_id %u \n",
cpath_intersection.rect_list->list.single.xmin,
cpath_intersection.rect_list->list.single.ymin,
cpath_intersection.rect_list->list.single.xmax-
@@ -6292,7 +6245,17 @@ pdf14_copy_mono(gx_device * dev,
/* Set up for the start of each line of the area. */
sptr = line;
sbyte = *sptr++;
- bit = first_bit;
+ /* The +1 here is 'sacrificial', we are going to decrement it by 1 immediately in
+ * the loop below so adding 1 means that we don't fall into the bit == 0
+ * case and incorrectly read a new byte from the source. This weirdness is because
+ * the original code wouold read off the end of the buffer if the number of bits in
+ * the raster was an exact multiple of 8. If it was also a multiple of the word
+ * size we might read unallocated memory. Moving the 'sbyte = *sptr++' from the end
+ * of the loop to the beginning meant we would not read past the end of the buffer
+ * because we would drop out of the 'do ... while (count-- > 0)' loop before
+ * reading another byte.
+ */
+ bit = first_bit + 1;
count = w;
run_length = 0;
startx = x;
@@ -6301,6 +6264,13 @@ pdf14_copy_mono(gx_device * dev,
/* Loop across each pixel of a line. */
do {
+ /* Move to the next input bit. */
+ if (bit == 0) {
+ bit = 7;
+ sbyte = *sptr++;
+ }
+ else
+ bit--;
bit_value = (sbyte >> bit) & 1;
if (bit_value == current_bit) {
/* The value did not change, simply increment our run length */
@@ -6320,13 +6290,6 @@ pdf14_copy_mono(gx_device * dev,
current_color = bit_value ? one : zero;
current_bit = bit_value;
}
- /* Move to the next input bit. */
- if (bit == 0) {
- bit = 7;
- sbyte = *sptr++;
- }
- else
- bit--;
} while (--count > 0);
/* Fill the last rectangle in the line. */
if (run_length != 0 && current_color != gx_no_color_index) {
@@ -8432,6 +8395,11 @@ pdf14_cmap_separation_direct(frac all, gx_device_color * pdc, const gs_gstate *
} else {
frac comp_value[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ if (pgs->color_component_map.sep_type == SEP_NONE) {
+ color_set_null(pdc);
+ return;
+ }
+
/* map to the color model */
for (i = pgs->color_component_map.num_components - 1; i >= 0; i--)
comp_value[i] = all;
@@ -8867,6 +8835,7 @@ gs_pdf14_device_push(gs_memory_t *mem, gs_gstate * pgs,
new_target->PageHandlerPushed = true;
new_target->ObjectHandlerPushed = true;
+ new_target->NupHandlerPushed = true;
/* if the device has separations already defined (by SeparationOrderNames) */
/* we need to copy them (allocating new names) so the colorants are in the */
/* same order as the target device. */
@@ -10699,7 +10668,7 @@ pdf14_clist_composite(gx_device * dev, gx_device ** pcdev,
gx_device *target = ((pdf14_device *)(tdev->save_p14dev))->target;
gs_image1_t image;
gs_color_space *pcs;
- gx_image_enum_common_t *info;
+ gx_image_enum_common_t *info = NULL;
gx_image_plane_t planes;
gsicc_rendering_param_t render_cond;
cmm_dev_profile_t *dev_profile;
@@ -10814,9 +10783,15 @@ pdf14_clist_composite(gx_device * dev, gx_device ** pcdev,
if ((code = info->procs->plane_data(info, &planes, 1, &rows_used)) < 0)
goto put_accum_error;
}
- code = info->procs->end_image(info, true);
put_accum_error:
+ if (info != NULL) {
+ if (code < 0)
+ (void)info->procs->end_image(info, true);
+ else
+ code = info->procs->end_image(info, true);
+ }
+
gs_free_object(pdev->memory, linebuf, "pdf14_put_image");
/* This will also decrement the device profile */
rc_decrement_only_cs(pcs, "pdf14_put_image");
@@ -11841,7 +11816,7 @@ c_pdf14trans_clist_read_update(gs_composite_t * pcte, gx_device * cdev,
* was buffered into the output device.
*/
pclist_devn_params = dev_proc(cdev, ret_devn_params)(cdev);
- if (pclist_devn_params != NULL && pclist_devn_params->page_spot_colors != 0) {
+ if (pclist_devn_params != NULL && pclist_devn_params->page_spot_colors > 0) {
int num_comp = p14dev->color_info.num_components;
/*
* The number of components for the PDF14 device is the sum
@@ -11850,18 +11825,23 @@ c_pdf14trans_clist_read_update(gs_composite_t * pcte, gx_device * cdev,
* device (which coming into this are the same as the p14dev)
* are smaller than the number of page spot colors then
* use that for the number of components. Otherwise use
- * the page_spot_colors.
+ * the page_spot_colors. The exception is, if we had used
+ * the sICCOutputColors setting, then just use that, which
+ * should be already baked into num_comp
*/
- p14dev->devn_params.page_spot_colors =
- pclist_devn_params->page_spot_colors;
- if (num_comp < p14dev->devn_params.page_spot_colors + 4 ) {
- p14dev->color_info.num_components = num_comp;
- } else {
- /* if page_spot_colors < 0, this will be wrong, so don't update num_components */
- if (p14dev->devn_params.page_spot_colors >= 0) {
- p14dev->color_info.num_components =
- p14dev->devn_params.num_std_colorant_names +
- p14dev->devn_params.page_spot_colors;
+
+ if (cdev->icc_struct->spotnames == NULL) {
+ p14dev->devn_params.page_spot_colors =
+ pclist_devn_params->page_spot_colors;
+ if (num_comp < p14dev->devn_params.page_spot_colors + 4 ) {
+ p14dev->color_info.num_components = num_comp;
+ } else {
+ /* if page_spot_colors < 0, this will be wrong, so don't update num_components */
+ if (p14dev->devn_params.page_spot_colors >= 0) {
+ p14dev->color_info.num_components =
+ p14dev->devn_params.num_std_colorant_names +
+ p14dev->devn_params.page_spot_colors;
+ }
}
}
/* limit the num_components to the max. */
diff --git a/base/gdevprn.c b/base/gdevprn.c
index 296e9734..e2d1da4a 100644
--- a/base/gdevprn.c
+++ b/base/gdevprn.c
@@ -303,7 +303,7 @@ gdev_prn_allocate(gx_device *pdev, gdev_space_params *new_space_params,
ppdev->orig_procs = pdev->procs;
for ( pass = 1; pass <= (reallocate ? 2 : 1); ++pass ) {
ulong mem_space;
- ulong pdf14_trans_buffer_size = 0;
+ size_t pdf14_trans_buffer_size = 0;
byte *base = 0;
bool bufferSpace_is_default = false;
gdev_space_params space_params;
@@ -335,7 +335,7 @@ gdev_prn_allocate(gx_device *pdev, gdev_space_params *new_space_params,
mem_space = buf_space.bits + buf_space.line_ptrs;
if (ppdev->page_uses_transparency) {
pdf14_trans_buffer_size = (ESTIMATED_PDF14_ROW_SPACE(max(1, pdev->width), pdev->color_info.num_components, deep ? 16 : 8) >> 3);
- if (new_height < (max_ulong - mem_space) / pdf14_trans_buffer_size) {
+ if (new_height < (max_size_t - mem_space) / pdf14_trans_buffer_size) {
pdf14_trans_buffer_size *= pdev->height;
} else {
size_ok = 0;
@@ -457,6 +457,7 @@ gdev_prn_allocate(gx_device *pdev, gdev_space_params *new_space_params,
pdev->procs = ppdev->orig_procs;
ppdev->orig_procs.open_device = 0; /* prevent uninit'd restore of procs */
gs_free_object(pdev->memory->non_gc_memory, ppdev->bg_print, "prn bg_print");
+ ppdev->bg_print = NULL;
return_error(code);
}
}
@@ -505,6 +506,7 @@ gdev_prn_allocate(gx_device *pdev, gdev_space_params *new_space_params,
}
if (code < 0) {
gs_free_object(pdev->memory->non_gc_memory, ppdev->bg_print, "prn bg_print");
+ ppdev->bg_print = NULL;
}
return code;
}
@@ -1802,8 +1804,8 @@ gdev_prn_initialize_device_procs_gray(gx_device *dev)
set_dev_proc(dev, map_rgb_color, gx_default_gray_map_rgb_color);
set_dev_proc(dev, map_color_rgb, gx_default_gray_map_color_rgb);
- set_dev_proc(dev, encode_color, gx_default_gray_map_rgb_color);
- set_dev_proc(dev, decode_color, gx_default_gray_map_color_rgb);
+ set_dev_proc(dev, encode_color, gx_default_gray_encode_color);
+ set_dev_proc(dev, decode_color, gx_default_gray_decode_color);
}
void gdev_prn_initialize_device_procs_gray_bg(gx_device *dev)
diff --git a/base/gdevsclass.c b/base/gdevsclass.c
index 2f757b76..eda152eb 100644
--- a/base/gdevsclass.c
+++ b/base/gdevsclass.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -359,6 +359,99 @@ int default_subclass_get_bits_rectangle(gx_device *dev, const gs_int_rect *prect
return gx_default_get_bits_rectangle(dev, prect, params);
}
+static void subclass_composite_front_finalize(gx_device *dev)
+{
+ generic_subclass_data *psubclass_data = (generic_subclass_data *)dev->parent->subclass_data;
+
+ dev->parent->child = psubclass_data->pre_composite_device;
+ psubclass_data->saved_finalize_method(dev);
+}
+
+int default_subclass_composite_front(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte,
+ gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev)
+{
+ int code = 0;
+ gs_pdf14trans_t *pct = (gs_pdf14trans_t *)pcte;
+ generic_subclass_data *psubclass_data = (generic_subclass_data *)dev->subclass_data;
+ gx_device *thisdev = dev;
+
+ if (dev->child) {
+ code = dev_proc(dev->child, composite)(dev->child, pcdev, pcte, pgs, memory, cdev);
+ if (code < 0)
+ return code;
+
+ if (gs_is_pdf14trans_compositor(pcte)) {
+ switch(pct->params.pdf14_op)
+ {
+ case PDF14_POP_DEVICE:
+ if (psubclass_data->pre_composite_device != NULL) {
+ if (dev->child) {
+ dev->child->parent = NULL;
+ dev->child->child = NULL;
+ dev->child->finalize = psubclass_data->saved_finalize_method;
+ rc_decrement(dev->child, "default_subclass_composite_front");
+ }
+ dev->child = psubclass_data->pre_composite_device;
+ psubclass_data->pre_composite_device = NULL;
+ psubclass_data->saved_finalize_method = NULL;
+ while (dev) {
+ memcpy(&(dev->color_info), &(dev->child->color_info), sizeof(gx_device_color_info));
+ dev = dev->parent;
+ }
+ }
+ break;
+ case PDF14_PUSH_DEVICE:
+ /* *pcdev is always returned containing a device capable of doing
+ * compositing. This may mean it is a new device. If this wants
+ * to be the new 'device' in the graphics state, then code will
+ * return as 1. */
+ if (code == 1) {
+ /* We want this device to stay ahead of the compositor; the newly created compositor has
+ * inserted itself in front of our child device, so basically we want to replace
+ * our current child with the newly created compositor. I hope !
+ */
+ psubclass_data = (generic_subclass_data *)dev->subclass_data;
+ if (psubclass_data == NULL)
+ return_error(gs_error_undefined);
+ psubclass_data->pre_composite_device = dev->child;
+ psubclass_data->saved_finalize_method = (*pcdev)->finalize;
+ (*pcdev)->finalize = subclass_composite_front_finalize;
+
+ (*pcdev)->child = dev->child;
+ dev->child = *pcdev;
+ (*pcdev)->parent = dev;
+ while (dev) {
+ memcpy(&dev->color_info, &(*pcdev)->color_info, sizeof(gx_device_color_info));
+ dev = dev->parent;
+ }
+ }
+ break;
+ default:
+ /* It seems like many operations can result in the pdf14 device altering its color
+ * info, presumably as we push different blending spaces. Ick. In order to stay in sync
+ * any time we have inserted a compositor after this class, we must update the color info
+ * of this device after every operation, in case it changes....
+ */
+ if (psubclass_data->pre_composite_device != NULL) {
+ while (dev) {
+ memcpy(&(dev->color_info), &(dev->child->color_info), sizeof(gx_device_color_info));
+ dev = dev->parent;
+ }
+ }
+ break;
+ }
+
+ }
+ /* We are inserting the compositor code after this device, or the compositor
+ * did not create a new compositor. Either way we don't want the compositor code
+ * to think we want to push a new device, so just return this device to the caller.
+ */
+ *pcdev = thisdev;
+ return 0;
+ }
+ return 0;
+}
+
int default_subclass_composite(gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte,
gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev)
{
@@ -439,7 +532,7 @@ int default_subclass_composite(gx_device *dev, gx_device **pcdev, const gs_compo
else {
/* See the 2 comments above. Now, if the child did not create a new compositor (eg its a clist)
* then it returns pcdev pointing to the passed in device (the child in our case). Now this is a
- * problem, if we return with pcdev == child->dev, and teh current device is 'dev' then the
+ * problem, if we return with pcdev == child->dev, and the current device is 'dev' then the
* compositor code will think we wanted to push a new device and will select the child device.
* so here if pcdev == dev->child we change it to be our own device, so that the calling code
* won't redirect the device in the graphics state.
@@ -757,6 +850,13 @@ int default_subclass_fill_stroke_path(gx_device *dev, const gs_gstate *pgs, gx_p
return 0;
}
+int default_subclass_lock_pattern(gx_device *dev, gs_gstate *pgs, gs_id pattern_id, int lock)
+{
+ if (dev->child)
+ return dev_proc(dev->child, lock_pattern)(dev->child, pgs, pattern_id, lock);
+ return 0;
+}
+
int default_subclass_transform_pixel_region(gx_device *dev, transform_pixel_region_reason reason, transform_pixel_region_data *data)
{
if (dev->child)
@@ -776,13 +876,16 @@ void default_subclass_finalize(const gs_memory_t *cmem, void *vptr)
if (dev->finalize)
dev->finalize(dev);
+ /* Use rc_decrement_only here not rc_decrement because rc_decrement zeroes the
+ * pointer if the count reaches 0. That would be disastrous for us because we
+ * rely on recursively calling finalize in order to fix up the chain of devices.
+ */
+ rc_decrement_only(dev->child, "de-reference child device");
+
if (psubclass_data) {
gs_free_object(dev->memory->non_gc_memory, psubclass_data, "gx_epo_finalize(suclass data)");
dev->subclass_data = NULL;
}
- if (dev->child) {
- gs_free_object(dev->memory->stable_memory, dev->child, "free child device memory for subclassing device");
- }
if (dev->stype_is_dynamic)
gs_free_const_object(dev->memory->non_gc_memory, dev->stype,
"default_subclass_finalize");
@@ -860,6 +963,7 @@ void default_subclass_initialize_device_procs(gx_device *dev)
set_dev_proc(dev, process_page, default_subclass_process_page);
set_dev_proc(dev, transform_pixel_region, default_subclass_transform_pixel_region);
set_dev_proc(dev, fill_stroke_path, default_subclass_fill_stroke_path);
+ set_dev_proc(dev, lock_pattern, default_subclass_lock_pattern);
}
int
diff --git a/base/gdevsclass.h b/base/gdevsclass.h
index 2fb440d6..be8b8283 100644
--- a/base/gdevsclass.h
+++ b/base/gdevsclass.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -55,6 +55,7 @@ dev_proc_strip_tile_rectangle(default_subclass_strip_tile_rectangle);
dev_proc_get_clipping_box(default_subclass_get_clipping_box);
dev_proc_begin_typed_image(default_subclass_begin_typed_image);
dev_proc_get_bits_rectangle(default_subclass_get_bits_rectangle);
+dev_proc_composite(default_subclass_composite_front);
dev_proc_composite(default_subclass_composite);
dev_proc_get_hardware_params(default_subclass_get_hardware_params);
dev_proc_text_begin(default_subclass_text_begin);
@@ -89,6 +90,7 @@ dev_proc_copy_alpha_hl_color(default_subclass_copy_alpha_hl_color);
dev_proc_process_page(default_subclass_process_page);
dev_proc_transform_pixel_region(default_subclass_transform_pixel_region);
dev_proc_fill_stroke_path(default_subclass_fill_stroke_path);
+dev_proc_lock_pattern(default_subclass_lock_pattern);
dev_page_proc_install(default_subclass_install);
dev_page_proc_begin_page(default_subclass_begin_page);
dev_page_proc_end_page(default_subclass_end_page);
diff --git a/base/gsargs.c b/base/gsargs.c
index a2023d5e..a17998f9 100644
--- a/base/gsargs.c
+++ b/base/gsargs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -214,6 +214,7 @@ arg_next(arg_list * pal, const char **argstr, const gs_memory_t *errmem)
int c;
int i;
bool in_quote, eol;
+ int prev_c_was_equals = 0;
*argstr = NULL;
@@ -304,9 +305,10 @@ arg_next(arg_list * pal, const char **argstr, const gs_memory_t *errmem)
c = get_codepoint(pal, pas);
if (c == '\n')
c = get_codepoint(pal, pas);
+ prev_c_was_equals = 0;
continue; /* Next char */
}
- if (c == '\\') {
+ if (c == '\\' && pal->depth > 0) {
/* Check for \ followed by newline. */
c = get_codepoint(pal, pas);
if (is_eol(c)) {
@@ -315,18 +317,33 @@ arg_next(arg_list * pal, const char **argstr, const gs_memory_t *errmem)
if (c == '\n')
c = get_codepoint(pal, pas);
eol = true;
+ prev_c_was_equals = 0;
continue; /* Next char */
}
- /* \ anywhere else is treated as a printing character. */
- /* This is different from the Unix shells. */
- if (i >= arg_str_max - 1) {
- cstr[i] = 0;
- errprintf(errmem, "Command too long: %s\n", cstr);
- return_error(gs_error_Fatal);
+ {
+ char what;
+
+ if (c == '"') {
+ /* currently \" is treated as literal ". No other literals yet.
+ * We may expand this in future. */
+ what = c;
+ c = get_codepoint(pal, pas);
+ } else {
+ /* \ anywhere else is treated as a printing character. */
+ /* This is different from the Unix shells. */
+ what = '\\';
+ }
+
+ if (i >= arg_str_max - 1) {
+ cstr[i] = 0;
+ errprintf(errmem, "Command too long: %s\n", cstr);
+ return_error(gs_error_Fatal);
+ }
+ cstr[i++] = what;
+ eol = false;
+ prev_c_was_equals = 0;
+ continue; /* Next char */
}
- cstr[i++] = '\\';
- eol = false;
- continue; /* Next char */
}
/* c will become part of the argument */
if (i >= arg_str_max - 1) {
@@ -341,7 +358,7 @@ arg_next(arg_list * pal, const char **argstr, const gs_memory_t *errmem)
* have to have carefully quoted double-quotes to make them survive the
* shell anyway! */
if (c == '"' && pal->depth > 0) {
- if (i == 0 && !in_quote)
+ if ((i == 0 || prev_c_was_equals) && !in_quote)
in_quote = true;
else if (in_quote) {
/* Need to check the next char to see if we're closing at the end */
@@ -355,6 +372,7 @@ arg_next(arg_list * pal, const char **argstr, const gs_memory_t *errmem)
/* Not a close quote, just a literal quote. */
i += codepoint_to_utf8(&cstr[i], '"');
eol = false;
+ prev_c_was_equals = 0;
continue; /* Jump to the start of the loop without reading another char. */
} else
i += codepoint_to_utf8(&cstr[i], c);
@@ -362,6 +380,7 @@ arg_next(arg_list * pal, const char **argstr, const gs_memory_t *errmem)
else
i += codepoint_to_utf8(&cstr[i], c);
eol = is_eol(c);
+ prev_c_was_equals = (c == '=');
c = get_codepoint(pal, pas);
}
cstr[i] = 0;
diff --git a/base/gscdefs.h b/base/gscdefs.h
index a5cb3f91..a7b56456 100644
--- a/base/gscdefs.h
+++ b/base/gscdefs.h
@@ -17,6 +17,15 @@
# define gscdefs_INCLUDED
+/* If we are cluster testing, then we want to nobble stuff
+ * that might change between versions. */
+#ifdef CLUSTER
+#undef GS_PRODUCTFAMILY
+#define GS_PRODUCTFAMILY "GPL Ghostscript"
+#undef GS_PRODUCT
+#define GS_PRODUCT GS_PRODUCTFAMILY
+#endif
+
#define GS_STRINGIZE2(s) #s
#define GS_STRINGIZE(s) GS_STRINGIZE2(s)
diff --git a/base/gscdevn.c b/base/gscdevn.c
index ef2086b3..a7f317d6 100644
--- a/base/gscdevn.c
+++ b/base/gscdevn.c
@@ -126,6 +126,7 @@ gs_cspace_new_DeviceN(
pcsdevn->num_process_names = 0;
pcsdevn->process_names = NULL;
pcsdevn->mem = pmem->non_gc_memory;
+ pcsdevn->all_none = false;
/* Allocate space for color names list. */
code = alloc_device_n_map(&pcsdevn->map, pmem, "gs_cspace_build_DeviceN");
@@ -577,6 +578,7 @@ check_DeviceN_component_names(const gs_color_space * pcs, gs_gstate * pgs)
= &pgs->color_component_map;
gx_device * dev = pgs->device;
bool non_match = false;
+ int none_count = 0;
pcolor_component_map->num_components = num_comp;
pcolor_component_map->cspace_id = pcs->id;
@@ -642,10 +644,15 @@ check_DeviceN_component_names(const gs_color_space * pcs, gs_gstate * pgs)
pcolor_component_map->color_map[i] = -1 and watching
for this case later during the remap operation. */
pcolor_component_map->color_map[i] = -1;
+ none_count++;
}
}
}
pcolor_component_map->use_alt_cspace = non_match;
+
+ if (none_count == num_comp)
+ return 1;
+
return 0;
}
@@ -706,6 +713,10 @@ gx_install_DeviceN(gs_color_space * pcs, gs_gstate * pgs)
if (code < 0)
return code;
+ /* Indicates all colorants are /None */
+ if (code > 0)
+ pcs->params.device_n.all_none = true;
+
if (pgs->icc_manager->device_named != NULL) {
pcs->params.device_n.named_color_supported =
gsicc_support_named_color(pcs, pgs);
diff --git a/base/gscms.h b/base/gscms.h
index 7fb362fe..b87f6091 100644
--- a/base/gscms.h
+++ b/base/gscms.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -291,6 +291,9 @@ struct cmm_dev_profile_s {
bool pageneutralcolor; /* Only valid if graydetection true */
bool usefastcolor; /* Used when we want to use no cm */
bool blacktext; /* Force text to be pure black */
+ bool blackvector; /* Force vectors to be pure black */
+ float blackthresholdL; /* Luminance threshold */
+ float blackthresholdC; /* Chrominance threshold */
bool supports_devn; /* If the target handles devn colors */
gs_overprint_control_t overprint_control; /* enable is the default */
gsicc_namelist_t *spotnames; /* If our device profiles are devn */
diff --git a/base/gscspace.h b/base/gscspace.h
index 9804efe2..91bb7c78 100644
--- a/base/gscspace.h
+++ b/base/gscspace.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -251,6 +251,7 @@ typedef struct gs_device_n_params_s {
gs_color_space *devn_process_space;
uint num_process_names;
char **process_names;
+ bool all_none;
} gs_device_n_params;
/* Define an abstract type for the client color space data */
diff --git a/base/gsdevice.c b/base/gsdevice.c
index 9af9403d..bc58cdc7 100644
--- a/base/gsdevice.c
+++ b/base/gsdevice.c
@@ -1225,11 +1225,11 @@ int gx_device_delete_output_file(const gx_device * dev, const char *fname)
while (*fmt != 'l' && *fmt != '%')
--fmt;
if (*fmt == 'l')
- gs_snprintf(pfname, len, parsed.fname, count1);
+ gs_snprintf(pfname, gp_file_name_sizeof, parsed.fname, count1);
else
- gs_snprintf(pfname, len, parsed.fname, (int)count1);
+ gs_snprintf(pfname, gp_file_name_sizeof, parsed.fname, (int)count1);
} else if (parsed.len && strchr(parsed.fname, '%')) /* filename with "%%" but no "%nnd" */
- gs_snprintf(pfname, len, parsed.fname);
+ gs_snprintf(pfname, gp_file_name_sizeof, parsed.fname);
else
pfname[0] = 0; /* 0 to use "fname", not "pfname" */
if (pfname[0]) {
diff --git a/base/gsdparam.c b/base/gsdparam.c
index 069b2138..07863706 100644
--- a/base/gsdparam.c
+++ b/base/gsdparam.c
@@ -32,6 +32,9 @@ extern gx_device_nup gs_nup_device;
/* This is for backward compatibility only. */
#define PAGESIZE_IS_MEDIASIZE
+#define BLACKTHRESHOLDL 90
+#define BLACKTHRESHOLDC 3
+
/* Names corresponding to gs_overprint_control_t enum */
static const char *const overprint_control_names[] = {
gs_overprint_control_names, 0
@@ -96,6 +99,9 @@ int gx_default_get_param(gx_device *dev, char *Param, void *list)
bool graydetection = false;
bool usefastcolor = false; /* set for unmanaged color */
bool blacktext = false;
+ bool blackvector = false;
+ float blackthresholdL = BLACKTHRESHOLDL;
+ float blackthresholdC = BLACKTHRESHOLDC;
/* By default overprinting only valid with cmyk devices */
gs_overprint_control_t overprint_control = gs_overprint_control_enable;
bool prebandthreshold = true, temp_bool = false;
@@ -354,6 +360,9 @@ int gx_default_get_param(gx_device *dev, char *Param, void *list)
graydetection = dev_profile->graydetection;
usefastcolor = dev_profile->usefastcolor;
blacktext = dev_profile->blacktext;
+ blackvector = dev_profile->blackvector;
+ blackthresholdC = dev_profile->blackthresholdC;
+ blackthresholdL = dev_profile->blackthresholdL;
overprint_control = dev_profile->overprint_control;
prebandthreshold = dev_profile->prebandthreshold;
/* With respect to Output profiles that have non-standard colorants,
@@ -397,6 +406,15 @@ int gx_default_get_param(gx_device *dev, char *Param, void *list)
if (strcmp(Param, "BlackText") == 0) {
return param_write_bool(plist, "BlackText", &blacktext);
}
+ if (strcmp(Param, "BlackVector") == 0) {
+ return param_write_bool(plist, "BlackVector", &blackvector);
+ }
+ if (strcmp(Param, "BlackThresholdL") == 0) {
+ return param_write_float(plist, "BlackThresholdL", &blackthresholdL);
+ }
+ if (strcmp(Param, "BlackThresholdC") == 0) {
+ return param_write_float(plist, "BlackThresholdC", &blackthresholdC);
+ }
if (strcmp(Param, "Overprint") == 0) {
gs_param_string opc_name;
const char *s = overprint_control_names[(int)overprint_control];
@@ -539,6 +557,9 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
bool graydetection = false;
bool usefastcolor = false; /* set for unmanaged color */
bool blacktext = false;
+ bool blackvector = false;
+ float blackthresholdL = BLACKTHRESHOLDL;
+ float blackthresholdC = BLACKTHRESHOLDC;
/* By default, only overprint if the device supports it */
gs_overprint_control_t overprint_control = gs_overprint_control_enable;
bool prebandthreshold = true, temp_bool;
@@ -654,6 +675,9 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
graydetection = dev_profile->graydetection;
usefastcolor = dev_profile->usefastcolor;
blacktext = dev_profile->blacktext;
+ blackvector = dev_profile->blackvector;
+ blackthresholdC = dev_profile->blackthresholdC;
+ blackthresholdL = dev_profile->blackthresholdL;
overprint_control = dev_profile->overprint_control;
prebandthreshold = dev_profile->prebandthreshold;
/* With respect to Output profiles that have non-standard colorants,
@@ -715,6 +739,9 @@ gx_default_get_params(gx_device * dev, gs_param_list * plist)
(code = param_write_bool(plist, "GrayDetection", &graydetection)) < 0 ||
(code = param_write_bool(plist, "UseFastColor", &usefastcolor)) < 0 ||
(code = param_write_bool(plist, "BlackText", &blacktext)) < 0 ||
+ (code = param_write_bool(plist, "BlackVector", &blackvector)) < 0 ||
+ (code = param_write_float(plist, "BlackThresholdL", &blackthresholdL)) < 0 ||
+ (code = param_write_float(plist, "BlackThresholdC", &blackthresholdC)) < 0 ||
(code = param_write_bool(plist, "PreBandThreshold", &prebandthreshold)) < 0 ||
(code = param_write_string(plist,"OutputICCProfile", &(profile_array[0]))) < 0 ||
(code = param_write_string(plist,"VectorICCProfile", &(profile_array[1]))) < 0 ||
@@ -1239,6 +1266,62 @@ gx_default_put_blacktext(bool blacktext, gx_device* dev)
}
static int
+gx_default_put_blackthresholds(float blackthresholdL, float blackthresholdC, gx_device *dev)
+{
+ int code = 0;
+ cmm_dev_profile_t* profile_struct;
+
+ if (dev_proc(dev, get_profile) == NULL) {
+ if (dev->icc_struct == NULL) {
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
+ if (dev->icc_struct == NULL)
+ return_error(gs_error_VMerror);
+ }
+ dev->icc_struct->blackthresholdL = blackthresholdL;
+ dev->icc_struct->blackthresholdC = blackthresholdC;
+ } else {
+ code = dev_proc(dev, get_profile)(dev, &profile_struct);
+ if (profile_struct == NULL) {
+ /* Create now */
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
+ profile_struct = dev->icc_struct;
+ if (profile_struct == NULL)
+ return_error(gs_error_VMerror);
+ }
+ profile_struct->blackthresholdL = blackthresholdL;
+ profile_struct->blackthresholdC = blackthresholdC;
+ }
+ return code;
+}
+
+static int
+gx_default_put_blackvector(bool blackvector, gx_device* dev)
+{
+ int code = 0;
+ cmm_dev_profile_t* profile_struct;
+
+ if (dev_proc(dev, get_profile) == NULL) {
+ if (dev->icc_struct == NULL) {
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
+ if (dev->icc_struct == NULL)
+ return_error(gs_error_VMerror);
+ }
+ dev->icc_struct->blackvector = blackvector;
+ } else {
+ code = dev_proc(dev, get_profile)(dev, &profile_struct);
+ if (profile_struct == NULL) {
+ /* Create now */
+ dev->icc_struct = gsicc_new_device_profile_array(dev);
+ profile_struct = dev->icc_struct;
+ if (profile_struct == NULL)
+ return_error(gs_error_VMerror);
+ }
+ profile_struct->blackvector = blackvector;
+ }
+ return code;
+}
+
+static int
gx_default_put_overprint_control(gs_overprint_control_t overprint_control, gx_device * dev)
{
int code = 0;
@@ -1461,7 +1544,7 @@ rc_free_pages_list(gs_memory_t * mem, void *ptr_in, client_name_t cname)
gdev_pagelist *PageList = (gdev_pagelist *)ptr_in;
if (PageList->rc.ref_count <= 1) {
- gs_free(mem->non_gc_memory, PageList->Pages, 1, PagesSize, "free page list");
+ gs_free(mem->non_gc_memory, PageList->Pages, 1, strlen(PageList->Pages), "free page list");
gs_free(mem->non_gc_memory, PageList, 1, sizeof(gdev_pagelist), "free structure to hold page list");
}
}
@@ -1515,6 +1598,9 @@ gx_default_put_params(gx_device * dev, gs_param_list * plist)
bool graydetection = false;
bool usefastcolor = false;
bool blacktext = false;
+ bool blackvector = false;
+ float blackthresholdL = BLACKTHRESHOLDL;
+ float blackthresholdC = BLACKTHRESHOLDC;
gs_overprint_control_t overprint_control = gs_overprint_control_enable;
bool prebandthreshold = false;
bool use_antidropout = dev->color_info.use_antidropout_downscaler;
@@ -1535,6 +1621,9 @@ gx_default_put_params(gx_device * dev, gs_param_list * plist)
devicegraytok = dev->icc_struct->devicegraytok;
usefastcolor = dev->icc_struct->usefastcolor;
blacktext = dev->icc_struct->blacktext;
+ blackvector = dev->icc_struct->blackvector;
+ blackthresholdL = dev->icc_struct->blackthresholdL;
+ blackthresholdC = dev->icc_struct->blackthresholdC;
prebandthreshold = dev->icc_struct->prebandthreshold;
overprint_control = dev->icc_struct->overprint_control;
} else {
@@ -1850,6 +1939,21 @@ nce:
ecode = code;
param_signal_error(plist, param_name, ecode);
}
+ if ((code = param_read_bool(plist, (param_name = "BlackVector"),
+ &blackvector)) < 0) {
+ ecode = code;
+ param_signal_error(plist, param_name, ecode);
+ }
+ if ((code = param_read_float(plist, (param_name = "BlackThresholdL"),
+ &blackthresholdL)) < 0) {
+ ecode = code;
+ param_signal_error(plist, param_name, ecode);
+ }
+ if ((code = param_read_float(plist, (param_name = "BlackThresholdC"),
+ &blackthresholdC)) < 0) {
+ ecode = code;
+ param_signal_error(plist, param_name, ecode);
+ }
if ((code = param_put_enum(plist, "Overprint",
(int*)&overprint_control, overprint_control_names, ecode)) < 0) {
ecode = code;
@@ -2108,7 +2212,6 @@ label:\
}
memset(dev->PageList->Pages, 0x00, pagelist.size + 1);
memcpy(dev->PageList->Pages, pagelist.data, pagelist.size);
- dev->PageList->PagesSize = pagelist.size + 1;
rc_init_free(dev->PageList, dev->memory->non_gc_memory, 1, rc_free_pages_list);
}
@@ -2296,6 +2399,12 @@ label:\
code = gx_default_put_blacktext(blacktext, dev);
if (code < 0)
return code;
+ code = gx_default_put_blackvector(blackvector, dev);
+ if (code < 0)
+ return code;
+ code = gx_default_put_blackthresholds(blackthresholdL, blackthresholdC, dev);
+ if (code < 0)
+ return code;
code = gx_default_put_overprint_control(overprint_control, dev);
if (code < 0)
return code;
diff --git a/base/gsdps1.c b/base/gsdps1.c
index 06998b7b..e06d8cae 100644
--- a/base/gsdps1.c
+++ b/base/gsdps1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -182,6 +182,16 @@ gs_rectclip(gs_gstate * pgs, const gs_rect * pr, uint count)
return 0;
}
+/* Setup for black vector handling */
+static inline bool black_vectors(gs_gstate *pgs, gx_device *dev)
+{
+ if (dev->icc_struct != NULL && dev->icc_struct->blackvector &&
+ pgs->black_textvec_state == NULL) {
+ return gsicc_setup_blacktextvec(pgs, dev, false);
+ }
+ return false;
+}
+
/* Fill a list of rectangles. */
/* We take the trouble to do this efficiently in the simple cases. */
int
@@ -199,13 +209,16 @@ gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
dev_proc(pdev, dev_spec_op)(pdev, gxdso_supports_hlcolor,
NULL, 0));
bool center_of_pixel = (pgs->fill_adjust.x == 0 && pgs->fill_adjust.y == 0);
+ bool black_vector = false;
/* Processing a fill object operation */
ensure_tag_is_set(pgs, pgs->device, GS_VECTOR_TAG); /* NB: may unset_dev_color */
+ black_vector = black_vectors(pgs, pgs->device); /* Set vector fill to black */
+
code = gx_set_dev_color(pgs);
if (code != 0)
- return code;
+ goto exit;
if ( !(pgs->device->page_uses_transparency ||
dev_proc(pgs->device, dev_spec_op)(pgs->device,
@@ -231,7 +244,7 @@ gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
/* We should never plot anything for an empty clip rectangle */
if ((clip_rect.p.x >= clip_rect.q.x) &&
(clip_rect.p.y >= clip_rect.q.y))
- return 0;
+ goto exit;
for (i = 0; i < count; ++i) {
gs_fixed_point p, q;
gs_fixed_rect draw_rect;
@@ -258,7 +271,7 @@ gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
code = dev_proc(pdev, fill_rectangle_hl_color)(pdev,
&draw_rect, pgs2, pdc, pcpath);
if (code < 0)
- return code;
+ goto exit;
}
} else {
int x, y, w, h;
@@ -296,7 +309,8 @@ gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
goto slow;
}
}
- return 0;
+ code = 0;
+ goto exit;
slow:rlist = pr + i;
rcount = count - i;
} {
@@ -304,7 +318,7 @@ gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
if (do_save) {
if ((code = gs_gsave(pgs)) < 0)
- return code;
+ goto exit;
code = gs_newpath(pgs);
}
if ((code >= 0) &&
@@ -317,6 +331,12 @@ gs_rectfill(gs_gstate * pgs, const gs_rect * pr, uint count)
else if (code < 0)
gs_newpath(pgs);
}
+
+exit:
+ if (black_vector) {
+ /* Restore color */
+ gsicc_restore_blacktextvec(pgs, false);
+ }
return code;
}
diff --git a/base/gsequivc.c b/base/gsequivc.c
index 441183ed..477fe7f6 100644
--- a/base/gsequivc.c
+++ b/base/gsequivc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -472,9 +472,10 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs,
0 /* blend_profile */, 0 /* postren_profile */,
{ {0} } /* rendercond[] */, 0 /* devicegraytok */,
0 /* graydection */, 0 /* pageneutralcolor */,
- 0 /* usefastcolor */, 0 /* blacktext */, 0 /* supports_devn */,
- 0 /* overprint_control */, 0 /* spotnames */,
- 0 /* prebandthreshold */, 0 /* memory */,
+ 0 /* usefastcolor */, 0 /* blacktext */, 0 /* blackvector */,
+ 0.0 /* blackthresholdL */, 0.0 /* blackthresholdC */,
+ 0 /* supports_devn */, 0 /* overprint_control */,
+ 0 /* spotnames */, 0 /* prebandthreshold */, 0 /* memory */,
{ 0 } /* rc_header */
};
@@ -502,6 +503,7 @@ capture_spot_equivalent_cmyk_colors(gx_device * pdev, const gs_gstate * pgs,
temp_profile.usefastcolor = false; /* This avoids a few headaches */
temp_profile.blacktext = false;
+ temp_profile.blackvector = false;
temp_profile.prebandthreshold = true;
temp_profile.supports_devn = false;
temp_profile.rendercond[0] = render_cond;
diff --git a/base/gsequivc.h b/base/gsequivc.h
index d5501b2d..4317be2d 100644
--- a/base/gsequivc.h
+++ b/base/gsequivc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
diff --git a/base/gserrors.h b/base/gserrors.h
index 0e4982d7..d91422d6 100644
--- a/base/gserrors.h
+++ b/base/gserrors.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -62,6 +62,15 @@ enum gs_error_type {
/* invalidid is for the NeXT DPS extension. */
gs_error_invalidid = -30,
+/* We need a specific stackoverflow error for the PDF interpreter to avoid dropping into
+ * the Postscript interpreter's stack extending code, when the PDF interpreter is called from
+ * Postscript
+ */
+ gs_error_pdf_stackoverflow = -31,
+
+/* Internal error for the C-based PDF interpreter, to indicate a circular PDF reference */
+ gs_error_circular_reference = -32,
+
/* ------ Pseudo-errors used internally ------ */
gs_error_hit_detected = -99,
@@ -121,8 +130,6 @@ enum gs_error_type {
*/
gs_error_handled = -111,
-/* Internal error for the C-based PDF interpreter, to indicate a circular PDF reference */
- gs_error_circular_reference = -112,
};
/* We do provide a typedef type for external API use */
diff --git a/base/gsfcmap.c b/base/gsfcmap.c
index 3c9317d5..246a0aa3 100644
--- a/base/gsfcmap.c
+++ b/base/gsfcmap.c
@@ -586,6 +586,7 @@ gs_cmap_ToUnicode_alloc(gs_memory_t *mem, int id, int num_codes, int key_size, i
"gs_cmap_ToUnicode_alloc");
if (map == NULL) {
gs_cmap_free(*ppcmap, mem);
+ *ppcmap = NULL;
return_error(gs_error_VMerror);
}
memset(map, 0, (size_t)num_codes * (value_size + 2));
diff --git a/base/gsftopts.h b/base/gsftopts.h
index 7fcacac2..0f891e24 100644
--- a/base/gsftopts.h
+++ b/base/gsftopts.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -17,3 +17,12 @@
/* Freetype build customisations */
#undef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
+#undef FT_CONFIG_OPTION_USE_LZW
+#undef FT_CONFIG_OPTION_USE_ZLIB
+#undef FT_CONFIG_OPTION_USE_BZIP2
+#undef FT_CONFIG_OPTION_USE_PNG
+#undef FT_CONFIG_OPTION_USE_HARFBUZZ
+#undef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#undef TT_CONFIG_OPTION_BDF
+#undef T1_CONFIG_OPTION_NO_AFM
+#undef TT_CONFIG_OPTION_COLOR_LAYERS
diff --git a/base/gsgstate.c b/base/gsgstate.c
index 0f7d182a..76b511c5 100644
--- a/base/gsgstate.c
+++ b/base/gsgstate.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -149,7 +149,7 @@ gs_gstate_initialize(gs_gstate * pgs, gs_memory_t * mem)
pgs->icc_profile_cache = gsicc_profilecache_new(pgs->memory);
if (pgs->icc_profile_cache == NULL)
return_error(gs_error_VMerror);
- pgs->black_text_state = NULL;
+ pgs->black_textvec_state = NULL;
#if ENABLE_CUSTOM_COLOR_CALLBACK
pgs->custom_color_callback = INIT_CUSTOM_COLOR_PTR;
#endif
@@ -179,7 +179,7 @@ gs_gstate_copied(gs_gstate * pgs)
rc_increment(pgs->icc_link_cache);
rc_increment(pgs->icc_profile_cache);
rc_increment(pgs->icc_manager);
- rc_increment(pgs->black_text_state);
+ rc_increment(pgs->black_textvec_state);
}
/* Adjust reference counts before assigning one gs_gstate to another. */
@@ -209,7 +209,7 @@ gs_gstate_pre_assign(gs_gstate *pto, const gs_gstate *pfrom)
RCCOPY(icc_link_cache);
RCCOPY(icc_profile_cache);
RCCOPY(icc_manager);
- RCCOPY(black_text_state);
+ RCCOPY(black_textvec_state);
#undef RCCOPY
}
@@ -250,6 +250,6 @@ gs_gstate_release(gs_gstate * pgs)
RCDECR(icc_link_cache);
RCDECR(icc_profile_cache);
RCDECR(icc_manager);
- RCDECR(black_text_state);
+ RCDECR(black_textvec_state);
#undef RCDECR
}
diff --git a/base/gsht.c b/base/gsht.c
index 738c1661..3fc57192 100644
--- a/base/gsht.c
+++ b/base/gsht.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1133,7 +1133,7 @@ gx_gstate_dev_ht_install(
* be cleared immediately below, so subsequently it will not be
* possible to tell if that this information is being shared.
*/
- if (pdht->components != NULL) {
+ if (pdht->components != NULL && !mem_diff) {
int input_ncomps = pdht->num_comp;
for (i = 0; i < input_ncomps; i++) {
@@ -1149,7 +1149,7 @@ gx_gstate_dev_ht_install(
memset(p_s_order, 0, sizeof(*p_s_order));
}
}
- if (used_default) {
+ if (used_default && !mem_diff) {
memset(&pdht->order, 0, sizeof(pdht->order));
}
diff --git a/base/gshtscr.c b/base/gshtscr.c
index 29cd93e1..fe6a1c5a 100644
--- a/base/gshtscr.c
+++ b/base/gshtscr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -344,6 +344,15 @@ pick_cell_size(gs_screen_halftone * ph, const gs_matrix * pmat, ulong max_size,
if (u0 == 0 && v0 == 0)
return_error(gs_error_rangecheck);
+
+ /* We increment rt in a loop below until (u+v) * rt
+ * is at least 4. Make sure that rt has enough range
+ * to satisfy that calculation. If it doesn't then
+ * give up (silly values).
+ */
+ if ((fabs(u0) + fabs(v0)) < ((double)5.0 / max_int))
+ return_error(gs_error_rangecheck);
+
while ((fabs(u0) + fabs(v0)) * rt < 4)
++rt;
phcp->C = 0;
diff --git a/base/gsicc.c b/base/gsicc.c
index d8e2bd3a..62f68880 100644
--- a/base/gsicc.c
+++ b/base/gsicc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -474,6 +474,8 @@ gx_remap_ICC(const gs_client_color * pcc, const gs_color_space * pcs,
#endif
return_error(gs_error_unknownerror);
}
+
+
code = gx_remap_ICC_with_link(pcc, pcs, pdc, pgs, dev, select, icc_link);
/* Release the link */
gsicc_release_link(icc_link);
diff --git a/base/gsicc_blacktext.c b/base/gsicc_blacktext.c
index 82699233..d24b90d5 100644
--- a/base/gsicc_blacktext.c
+++ b/base/gsicc_blacktext.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -21,88 +21,250 @@
#include "gsstruct.h"
#include "gzstate.h"
#include "gsicc_blacktext.h"
+#include "gsicc_cache.h"
-/* gsicc_blacktext_state_t is going to be storing GCed items
+/* gsicc_blacktextvec_state_t is going to be storing GCed items
(color spaces and client colors) and so will need to be GCed */
-gs_private_st_ptrs4(st_blacktext_state, gsicc_blacktext_state_t,
- "gsicc_blacktext_state", blacktext_state_enum_ptrs,
- blacktext_state_reloc_ptrs, pcs[0], pcs[1], pcc[0], pcc[1]);
+gs_private_st_ptrs4(st_blacktextvec_state, gsicc_blacktextvec_state_t,
+ "gsicc_blacktextvec_state", blacktextvec_state_enum_ptrs,
+ blacktextvec_state_reloc_ptrs, pcs, pcs_alt, pcc, pcc_alt);
static void
-rc_gsicc_blacktext_state_free(gs_memory_t *mem, void *ptr_in,
+rc_gsicc_blacktextvec_state_free(gs_memory_t *mem, void *ptr_in,
client_name_t cname)
{
- gsicc_blacktext_state_t *state = (gsicc_blacktext_state_t*)ptr_in;
+ gsicc_blacktextvec_state_t *state = (gsicc_blacktextvec_state_t*)ptr_in;
- rc_decrement_cs(state->pcs[0], "rc_gsicc_blacktext_state_free");
- rc_decrement_cs(state->pcs[1], "rc_gsicc_blacktext_state_free");
+ rc_decrement_cs(state->pcs, "rc_gsicc_blacktextvec_state_free");
+ rc_decrement_cs(state->pcs_alt, "rc_gsicc_blacktextvec_state_free");
- gs_free_object(mem->stable_memory, state,
- "rc_gsicc_blacktext_state_free");
+ gs_free_object(state->memory, state,
+ "rc_gsicc_blacktextvec_state_free");
}
-gsicc_blacktext_state_t*
-gsicc_blacktext_state_new(gs_memory_t *memory)
+gsicc_blacktextvec_state_t*
+gsicc_blacktextvec_state_new(gs_memory_t *memory, bool is_text)
{
- gsicc_blacktext_state_t *result;
+ gsicc_blacktextvec_state_t *result;
- result = gs_alloc_struct(memory->stable_memory, gsicc_blacktext_state_t,
- &st_blacktext_state, "gsicc_blacktext_state_new");
+ result = gs_alloc_struct(memory->stable_memory, gsicc_blacktextvec_state_t,
+ &st_blacktextvec_state, "gsicc_blacktextvec_state_new");
if (result == NULL)
return NULL;
- rc_init_free(result, memory->stable_memory, 1, rc_gsicc_blacktext_state_free);
- result->memory = memory;
- result->pcs[0] = NULL;
- result->pcs[1] = NULL;
- result->pcc[0] = NULL;
- result->pcc[1] = NULL;
+ rc_init_free(result, memory->stable_memory, 1, rc_gsicc_blacktextvec_state_free);
+ result->memory = memory->stable_memory;
+ result->pcs = NULL;
+ result->pcs_alt = NULL;
+ result->pcc = NULL;
+ result->pcc_alt = NULL;
+ result->is_text = is_text;
return result;
}
+/* Crude white color check. Only valid for ICC based RGB, CMYK, Gray, and LAB CS.
+ Makes some assumptions about profile. Also may want some tolerance check. */
+bool gsicc_is_white_blacktextvec(gs_gstate *pgs, gx_device *dev, gs_color_space* pcs, gs_client_color* pcc)
+{
+ double Lstar = 0;
+ double astar = 0;
+ double bstar = 0;
+ cmm_dev_profile_t* dev_profile;
+
+ dev_proc(dev, get_profile)(dev, &dev_profile);
+
+ if (gs_color_space_get_index(pcs) == gs_color_space_index_ICC) {
+ if (pcs->cmm_icc_profile_data->data_cs == gsCIELAB) {
+ if (pcc->paint.values[0] >= dev_profile->blackthresholdL &&
+ fabs(pcc->paint.values[1]) < dev_profile->blackthresholdC &&
+ fabs(pcc->paint.values[2]) < dev_profile->blackthresholdC)
+ return true;
+ else
+ return false;
+ }
+ /* For all others, lets get to CIELAB value */
+ if (pgs->icc_manager->lab_profile != NULL) {
+ gsicc_link_t *icc_link;
+ gsicc_rendering_param_t rendering_params;
+ unsigned short psrc[4];
+ unsigned short pdes[3];
+
+ rendering_params.black_point_comp = gsBLACKPTCOMP_ON;
+ rendering_params.graphics_type_tag = GS_UNKNOWN_TAG;
+ rendering_params.override_icc = false;
+ rendering_params.preserve_black = gsBKPRESNOTSPECIFIED;
+ rendering_params.rendering_intent = gsRELATIVECOLORIMETRIC;
+ rendering_params.cmm = gsCMM_DEFAULT;
+
+ icc_link = gsicc_get_link_profile(pgs, NULL, pcs->cmm_icc_profile_data,
+ pgs->icc_manager->lab_profile, &rendering_params,
+ pgs->memory, false);
+ if (icc_link == NULL)
+ return false;
+
+ switch (pcs->cmm_icc_profile_data->data_cs) {
+ case gsGRAY:
+ psrc[0] = (unsigned short)(pcc->paint.values[0] * 65535);
+ break;
+ case gsRGB:
+ psrc[0] = (unsigned short)(pcc->paint.values[0] * 65535);
+ psrc[1] = (unsigned short)(pcc->paint.values[1] * 65535);
+ psrc[2] = (unsigned short)(pcc->paint.values[2] * 65535);
+ break;
+ case gsCMYK:
+ psrc[0] = (unsigned short)(pcc->paint.values[0] * 65535);
+ psrc[1] = (unsigned short)(pcc->paint.values[1] * 65535);
+ psrc[2] = (unsigned short)(pcc->paint.values[2] * 65535);
+ psrc[3] = (unsigned short)(pcc->paint.values[3] * 65535);
+ break;
+ default:
+ gsicc_release_link(icc_link);
+ return false;
+ }
+ (icc_link->procs.map_color)(NULL, icc_link, psrc, pdes, 2);
+ gsicc_release_link(icc_link);
+
+ Lstar = pdes[0] * 100.0 / 65535.0;
+ astar = pdes[1] * 256.0 / 65535.0 - 128.0;
+ bstar = pdes[2] * 256.0 / 65535.0 - 128.0;
+
+ if (Lstar >= dev_profile->blackthresholdL &&
+ fabs(astar) < dev_profile->blackthresholdC &&
+ fabs(bstar) < dev_profile->blackthresholdC)
+ return true;
+ else
+ return false;
+ } else {
+ /* Something to fall back on */
+ switch (pcs->cmm_icc_profile_data->data_cs) {
+ case gsGRAY:
+ if (pcc->paint.values[0] == 1.0)
+ return true;
+ else
+ return false;
+ break;
+ case gsRGB:
+ if (pcc->paint.values[0] == 1.0 && pcc->paint.values[1] == 1.0 &&
+ pcc->paint.values[2] == 1.0)
+ return true;
+ else
+ return false;
+ break;
+ case gsCMYK:
+ if (pcc->paint.values[0] == 0.0 && pcc->paint.values[1] == 0.0 &&
+ pcc->paint.values[2] == 0.0 && pcc->paint.values[3] == 0.0)
+ return true;
+ else
+ return false;
+ break;
+ default:
+ return false;
+ }
+ }
+ } else
+ return false;
+}
+
+bool gsicc_setup_blacktextvec(gs_gstate *pgs, gx_device *dev, bool is_text)
+{
+ gs_color_space *pcs_curr = gs_currentcolorspace_inline(pgs);
+ gs_color_space *pcs_alt = gs_swappedcolorspace_inline(pgs);
+
+ /* If neither space is ICC then we are not doing anything */
+ if (!gs_color_space_is_ICC(pcs_curr) && !gs_color_space_is_ICC(pcs_alt))
+ return false;
+
+ /* Create a new object to hold the cs details */
+ pgs->black_textvec_state = gsicc_blacktextvec_state_new(pgs->memory, is_text);
+ if (pgs->black_textvec_state == NULL)
+ return false; /* No error just move on */
+
+ /* If curr space is ICC then store it */
+ if (gs_color_space_is_ICC(pcs_curr)) {
+ rc_increment_cs(pcs_curr); /* We are storing the cs. Will decrement when structure is released */
+ pgs->black_textvec_state->pcs = pcs_curr;
+ pgs->black_textvec_state->pcc = pgs->color[0].ccolor;
+ cs_adjust_color_count(pgs, 1); /* The set_gray will do a decrement, only need if pattern */
+ pgs->black_textvec_state->value[0] = pgs->color[0].ccolor->paint.values[0];
+
+ if (gsicc_is_white_blacktextvec(pgs, dev, pcs_curr, pgs->color[0].ccolor))
+ gs_setgray(pgs, 1.0);
+ else
+ gs_setgray(pgs, 0.0);
+ }
+
+ /* If alt space is ICC then store it */
+ if (gs_color_space_is_ICC(pcs_alt)) {
+ rc_increment_cs(pcs_alt); /* We are storing the cs. Will decrement when structure is released */
+ pgs->black_textvec_state->pcs_alt = pcs_alt;
+
+ gs_swapcolors_quick(pgs); /* Have to swap for set_gray and adjust color count */
+ pgs->black_textvec_state->pcc_alt = pgs->color[0].ccolor;
+ cs_adjust_color_count(pgs, 1); /* The set_gray will do a decrement, only need if pattern */
+ pgs->black_textvec_state->value[1] = pgs->color[0].ccolor->paint.values[0];
+
+ if (gsicc_is_white_blacktextvec(pgs, dev, pcs_alt, pgs->color[0].ccolor))
+ gs_setgray(pgs, 1.0);
+ else
+ gs_setgray(pgs, 0.0);
+ gs_swapcolors_quick(pgs);
+ }
+
+ pgs->black_textvec_state->is_fill = pgs->is_fill_color;
+ return true; /* Need to clean up */
+}
+
void
-gsicc_restore_black_text(gs_gstate *pgs)
+gsicc_restore_blacktextvec(gs_gstate *pgs, bool is_text)
{
- gsicc_blacktext_state_t *state = pgs->black_text_state;
+ gsicc_blacktextvec_state_t *state = pgs->black_textvec_state;
int code;
if (state == NULL)
return;
+ if (is_text != state->is_text)
+ return;
+
/* Make sure state and original are same fill_color condition */
if (state->rc.ref_count == 1) {
- if ((state->is_fill && pgs->is_fill_color) ||
- (!state->is_fill && !pgs->is_fill_color)) {
-
- if ((code = gs_setcolorspace_only(pgs, pgs->black_text_state->pcs[0])) >= 0) {
- /* current client color is gray. no need to decrement */
- pgs->color[0].ccolor = pgs->black_text_state->pcc[0];
- pgs->color[0].ccolor->paint.values[0] = pgs->black_text_state->value[0];
+ if ((state->is_fill && pgs->is_fill_color) || (!state->is_fill && !pgs->is_fill_color)) {
+ if (pgs->black_textvec_state->pcs != NULL) {
+ if ((code = gs_setcolorspace_only(pgs, pgs->black_textvec_state->pcs)) >= 0) {
+ /* current client color is gray. no need to decrement */
+ pgs->color[0].ccolor = pgs->black_textvec_state->pcc;
+ pgs->color[0].ccolor->paint.values[0] = pgs->black_textvec_state->value[0];
+ }
+ gx_unset_dev_color(pgs);
}
- gs_swapcolors_quick(pgs);
- if ((code = gs_setcolorspace_only(pgs, pgs->black_text_state->pcs[1])) >= 0) {
- pgs->color[0].ccolor = pgs->black_text_state->pcc[1];
- pgs->color[0].ccolor->paint.values[0] = pgs->black_text_state->value[1];
-
+ if (pgs->black_textvec_state->pcs_alt != NULL) {
+ gs_swapcolors_quick(pgs);
+ if ((code = gs_setcolorspace_only(pgs, pgs->black_textvec_state->pcs_alt)) >= 0) {
+ pgs->color[0].ccolor = pgs->black_textvec_state->pcc_alt;
+ pgs->color[0].ccolor->paint.values[0] = pgs->black_textvec_state->value[1];
+ }
+ gs_swapcolors_quick(pgs);
+ gx_unset_alt_dev_color(pgs);
}
- gs_swapcolors_quick(pgs);
-
} else {
-
- if ((code = gs_setcolorspace_only(pgs, pgs->black_text_state->pcs[1])) >= 0) {
- pgs->color[0].ccolor = pgs->black_text_state->pcc[1];
- pgs->color[0].ccolor->paint.values[0] = pgs->black_text_state->value[1];
+ if (pgs->black_textvec_state->pcs_alt != NULL) {
+ if ((code = gs_setcolorspace_only(pgs, pgs->black_textvec_state->pcs_alt)) >= 0) {
+ pgs->color[0].ccolor = pgs->black_textvec_state->pcc_alt;
+ pgs->color[0].ccolor->paint.values[0] = pgs->black_textvec_state->value[1];
+ }
+ gx_unset_dev_color(pgs);
}
- gs_swapcolors_quick(pgs);
- if ((code = gs_setcolorspace_only(pgs, pgs->black_text_state->pcs[0])) >= 0) {
- pgs->color[0].ccolor = pgs->black_text_state->pcc[0];
- pgs->color[0].ccolor->paint.values[0] = pgs->black_text_state->value[0];
+ if (pgs->black_textvec_state->pcs != NULL) {
+ gs_swapcolors_quick(pgs);
+ if ((code = gs_setcolorspace_only(pgs, pgs->black_textvec_state->pcs)) >= 0) {
+ pgs->color[0].ccolor = pgs->black_textvec_state->pcc;
+ pgs->color[0].ccolor->paint.values[0] = pgs->black_textvec_state->value[0];
+ }
+ gs_swapcolors_quick(pgs);
+ gx_unset_alt_dev_color(pgs);
}
- gs_swapcolors_quick(pgs);
}
- gx_unset_dev_color(pgs);
- gx_unset_alt_dev_color(pgs);
}
rc_decrement(state, "gsicc_restore_black_text");
- pgs->black_text_state = NULL;
+ pgs->black_textvec_state = NULL;
} \ No newline at end of file
diff --git a/base/gsicc_blacktext.h b/base/gsicc_blacktext.h
index 09d541a5..30311659 100644
--- a/base/gsicc_blacktext.h
+++ b/base/gsicc_blacktext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -16,19 +16,22 @@
#ifndef gsicc_blacktext_INCLUDED
# define gsicc_blacktext_INCLUDED
-typedef struct gsicc_blacktext_state_s gsicc_blacktext_state_t;
+typedef struct gsicc_blacktextvec_state_s gsicc_blacktextvec_state_t;
-struct gsicc_blacktext_state_s {
+struct gsicc_blacktextvec_state_s {
gs_memory_t *memory;
rc_header rc;
bool is_fill; /* Needed for proper color restore */
- gs_color_space *pcs[2]; /* If doing black text, color spaces to restore */
- gs_client_color *pcc[2]; /* If doing black text, client colors to restore */
- float value[2]; /* DeviceGray setting blows away the client color
- zero value */
+ gs_color_space *pcs; /* color spaces to restore */
+ gs_color_space *pcs_alt;
+ gs_client_color *pcc; /* client colors to restore */
+ gs_client_color *pcc_alt; /* client colors to restore */
+ float value[2]; /* DeviceGray setting blows away the client color zero value */
+ bool is_text;
};
-gsicc_blacktext_state_t* gsicc_blacktext_state_new(gs_memory_t *memory);
-void gsicc_restore_black_text(gs_gstate *pgs);
-
+gsicc_blacktextvec_state_t* gsicc_blacktextvec_state_new(gs_memory_t *memory, bool is_text);
+void gsicc_restore_blacktextvec(gs_gstate *pgs, bool is_text);
+bool gsicc_setup_blacktextvec(gs_gstate *pgs, gx_device *dev, bool is_text);
+bool gsicc_is_white_blacktextvec(gs_gstate *pgs, gx_device *dev, gs_color_space *pcs, gs_client_color *pcc);
#endif
diff --git a/base/gsicc_cache.c b/base/gsicc_cache.c
index 13eb003a..fd1f78b5 100644
--- a/base/gsicc_cache.c
+++ b/base/gsicc_cache.c
@@ -35,6 +35,7 @@
#include "gxsync.h"
#include "gzstate.h"
#include "stdint_.h"
+#include "assert_.h"
/*
* Note that the the external memory used to maintain
* links in the CMS is generally not visible to GS.
@@ -62,7 +63,7 @@ static int gsicc_compute_linkhash(gsicc_manager_t *icc_manager, gx_device *dev,
gsicc_rendering_param_t *rendering_params,
gsicc_hashlink_t *hash);
-static void gsicc_remove_link(gsicc_link_t *link, const gs_memory_t *memory);
+static void gsicc_remove_link(gsicc_link_t *link);
static void gsicc_get_buff_hash(unsigned char *data, int64_t *hash, unsigned int num_bytes);
@@ -101,24 +102,25 @@ gsicc_cache_new(gs_memory_t *memory)
/* We want this to be maintained in stable_memory. It should be be effected by the
save and restores */
- result = gs_alloc_struct(memory->stable_memory, gsicc_link_cache_t, &st_icc_linkcache,
+ memory = memory->stable_memory;
+ result = gs_alloc_struct(memory, gsicc_link_cache_t, &st_icc_linkcache,
"gsicc_cache_new");
if ( result == NULL )
return(NULL);
result->head = NULL;
result->num_links = 0;
result->cache_full = false;
- result->memory = memory->stable_memory;
+ result->memory = memory;
result->full_wait = NULL; /* Required so finaliser can work when result freed. */
- rc_init_free(result, memory->stable_memory, 1, rc_gsicc_link_cache_free);
- result->lock = gx_monitor_label(gx_monitor_alloc(memory->stable_memory),
+ rc_init_free(result, memory, 1, rc_gsicc_link_cache_free);
+ result->lock = gx_monitor_label(gx_monitor_alloc(memory),
"gsicc_cache_new");
if (result->lock == NULL) {
rc_decrement(result, "gsicc_cache_new");
return(NULL);
}
- result->full_wait = gx_semaphore_label(gx_semaphore_alloc(memory->stable_memory),
- "gsicc_cache_new");
+ result->full_wait = gx_semaphore_label(gx_semaphore_alloc(memory),
+ "gsicc_cache_new");
if (result->full_wait == NULL) {
/* Don't free result->lock, as the finaliser for result does that! */
rc_decrement(result, "gsicc_cache_new");
@@ -136,11 +138,15 @@ rc_gsicc_link_cache_free(gs_memory_t * mem, void *ptr_in, client_name_t cname)
/* Ending the entire cache. The ref counts on all the links should be 0 */
gsicc_link_cache_t *link_cache = (gsicc_link_cache_t * ) ptr_in;
- if_debug2m(gs_debug_flag_icc, mem,
+ /* mem is unused, but we are passed it anyway by the ref counting mechanisms. */
+ assert(link_cache != NULL && mem == link_cache->memory);
+ if (link_cache == NULL)
+ return;
+ if_debug2m(gs_debug_flag_icc, link_cache->memory,
"[icc] Removing link cache = "PRI_INTPTR" memory = "PRI_INTPTR"\n",
(intptr_t)link_cache, (intptr_t)link_cache->memory);
/* NB: freeing the link_cache will call icc_linkcache_finalize */
- gs_free_object(mem->stable_memory, link_cache, "rc_gsicc_link_cache_free");
+ gs_free_object(link_cache->memory, link_cache, "rc_gsicc_link_cache_free");
}
/* release the monitor of the link_cache when it is freed */
@@ -149,17 +155,21 @@ icc_linkcache_finalize(const gs_memory_t *mem, void *ptr)
{
gsicc_link_cache_t *link_cache = (gsicc_link_cache_t * ) ptr;
+ /* mem is unused, but we are passed it anyway by the ref counting mechanisms. */
+ assert(link_cache != NULL && mem == link_cache->memory);
+ if (link_cache == NULL)
+ return;
while (link_cache->head != NULL) {
if (link_cache->head->ref_count != 0) {
- emprintf2(mem, "link at "PRI_INTPTR" being removed, but has ref_count = %d\n",
+ emprintf2(link_cache->memory, "link at "PRI_INTPTR" being removed, but has ref_count = %d\n",
(intptr_t)link_cache->head, link_cache->head->ref_count);
link_cache->head->ref_count = 0; /* force removal */
}
- gsicc_remove_link(link_cache->head, mem);
+ gsicc_remove_link(link_cache->head);
}
#ifdef DEBUG
if (link_cache->num_links != 0) {
- emprintf1(mem, "num_links is %d, should be 0.\n", link_cache->num_links);
+ emprintf1(link_cache->memory, "num_links is %d, should be 0.\n", link_cache->num_links);
}
#endif
if (link_cache->rc.ref_count == 0) {
@@ -276,7 +286,8 @@ gsicc_alloc_link(gs_memory_t *memory, gsicc_hashlink_t hashcode)
/* The link has to be added in stable memory. We want them
to be maintained across the gsave and grestore process */
- result = gs_alloc_struct(memory->stable_memory, gsicc_link_t, &st_icc_link,
+ memory = memory->stable_memory;
+ result = gs_alloc_struct(memory, gsicc_link_t, &st_icc_link,
"gsicc_alloc_link");
if (result == NULL)
return NULL;
@@ -299,12 +310,12 @@ gsicc_alloc_link(gs_memory_t *memory, gsicc_hashlink_t hashcode)
result->includes_devlink = 0;
result->is_identity = false;
result->valid = false; /* not yet complete */
- result->memory = memory->stable_memory;
+ result->memory = memory;
- result->lock = gx_monitor_label(gx_monitor_alloc(memory->stable_memory),
+ result->lock = gx_monitor_label(gx_monitor_alloc(memory),
"gsicc_link_new");
if (result->lock == NULL) {
- gs_free_object(memory->stable_memory, result, "gsicc_alloc_link(lock)");
+ gs_free_object(memory, result, "gsicc_alloc_link(lock)");
return NULL;
}
gx_monitor_enter(result->lock); /* this link is owned by this thread until built and made "valid" */
@@ -356,11 +367,13 @@ gsicc_link_free_contents(gsicc_link_t *icc_link)
}
void
-gsicc_link_free(gsicc_link_t *icc_link, const gs_memory_t *memory)
+gsicc_link_free(gsicc_link_t *icc_link)
{
+ if (icc_link == NULL)
+ return;
gsicc_link_free_contents(icc_link);
- gs_free_object(memory->stable_memory, icc_link, "gsicc_link_free");
+ gs_free_object(icc_link->memory, icc_link, "gsicc_link_free");
}
void
@@ -589,14 +602,15 @@ gsicc_findcachelink(gsicc_hashlink_t hash, gsicc_link_cache_t *icc_link_cache,
/* Remove link from cache. Notify CMS and free */
static void
-gsicc_remove_link(gsicc_link_t *link, const gs_memory_t *memory)
+gsicc_remove_link(gsicc_link_t *link)
{
gsicc_link_t *curr, *prev;
gsicc_link_cache_t *icc_link_cache = link->icc_link_cache;
+ const gs_memory_t *memory = link->memory;
if_debug2m(gs_debug_flag_icc, memory,
"[icc] Removing link = "PRI_INTPTR" memory = "PRI_INTPTR"\n",
- (intptr_t)link, (intptr_t)memory->stable_memory);
+ (intptr_t)link, (intptr_t)memory);
/* NOTE: link->ref_count must be 0: assert ? */
gx_monitor_enter(icc_link_cache->lock);
if (link->ref_count != 0) {
@@ -627,7 +641,7 @@ gsicc_remove_link(gsicc_link_t *link, const gs_memory_t *memory)
gx_semaphore_signal(icc_link_cache->full_wait); /* let a waiting thread run */
}
gx_monitor_leave(icc_link_cache->lock);
- gsicc_link_free(link, memory); /* outside link cache now. */
+ gsicc_link_free(link); /* outside link cache now. */
} else {
/* even if we didn't find the link to remove, unlock the cache */
gx_monitor_leave(icc_link_cache->lock);
@@ -789,11 +803,8 @@ gsicc_get_link(const gs_gstate *pgs1, gx_device *dev_in,
if (render_cond.cmm == gsCMM_NONE) {
gsicc_link_t *link;
- if (gs_input_profile->data_cs == gsRGB) {
- link = gsicc_nocm_get_link(pgs, dev, 3);
- } else {
- link = gsicc_nocm_get_link(pgs, dev, 4);
- }
+ link = gsicc_nocm_get_link(pgs, dev, gs_input_profile->num_comps);
+
/* Set the identity case if we are in that situation */
if (link != NULL) {
if (gs_input_profile->num_comps ==
@@ -885,6 +896,8 @@ gsicc_alloc_link_entry(gsicc_link_cache_t *icc_link_cache,
gsicc_link_t *link;
int retries = 0;
+ assert(cache_mem == cache_mem->stable_memory);
+
*ret_link = NULL;
/* First see if we can add a link */
/* TODO: this should be based on memory usage, not just num_links */
@@ -931,13 +944,13 @@ gsicc_alloc_link_entry(gsicc_link_cache_t *icc_link_cache,
/* Even if we remove this link, we may still be maxed out so*/
/* the outermost 'while' will check to make sure some other */
/* thread did not grab the one we remove. */
- gsicc_remove_link(link, cache_mem);
+ gsicc_remove_link(link);
}
}
/* insert an empty link that we will reserve so we can unlock while */
/* building the link contents. If successful, the entry will set */
/* the hash for the link, Set valid=false, and lock the profile */
- (*ret_link) = gsicc_alloc_link(cache_mem->stable_memory, hash);
+ (*ret_link) = gsicc_alloc_link(cache_mem, hash);
/* NB: the link returned will be have the lock owned by this thread */
/* the lock will be released when the link becomes valid. */
if (*ret_link) {
@@ -1056,14 +1069,12 @@ gsicc_get_link_profile(const gs_gstate *pgs, gx_device *dev,
We also have the Replace option. */
if (gs_input_profile->rend_is_valid &&
gs_input_profile->rend_cond.cmm == gsCMM_NONE) {
- if (gs_input_profile->data_cs == gsRGB) {
- link = gsicc_nocm_get_link(pgs, dev, 3);
- } else {
- link = gsicc_nocm_get_link(pgs, dev, 4);
- }
+
+ link = gsicc_nocm_get_link(pgs, dev, gs_input_profile->num_comps);
+
/* Set the identity case if we are in that situation */
if (link != NULL) {
- if (gs_input_profile->num_comps ==
+ if (dev_profile != NULL && gs_input_profile->num_comps ==
dev_profile->device_profile[GS_DEFAULT_DEVICE_PROFILE]->num_comps) {
link->is_identity = true;
}
@@ -1218,10 +1229,11 @@ gsicc_get_link_profile(const gs_gstate *pgs, gx_device *dev,
gs_input_profile->default_match == DEFAULT_GRAY &&
pgs->icc_manager != NULL && devicegraytok) {
if (icc_manager->graytok_profile == NULL) {
+ assert(pgs->icc_manager->memory == pgs->icc_manager->memory->stable_memory);
icc_manager->graytok_profile =
gsicc_set_iccsmaskprofile(GRAY_TO_K, strlen(GRAY_TO_K),
pgs->icc_manager,
- pgs->icc_manager->memory->stable_memory);
+ pgs->icc_manager->memory);
if (icc_manager->graytok_profile == NULL) {
/* Cant create the link */
link->ref_count--;
@@ -1307,7 +1319,7 @@ icc_link_error:
does not maintain an invalid entry. Any other allocations
(e.g. profile handles) would get freed when the profiles
are freed */
- gsicc_remove_link(link, cache_mem);
+ gsicc_remove_link(link);
return NULL;
}
diff --git a/base/gsicc_cache.h b/base/gsicc_cache.h
index c9f51b3b..cbd223b5 100644
--- a/base/gsicc_cache.h
+++ b/base/gsicc_cache.h
@@ -51,7 +51,7 @@ gsicc_link_t* gsicc_get_link_profile(const gs_gstate *pgs, gx_device *dev,
gsicc_rendering_param_t *rendering_params,
gs_memory_t *memory, bool devicegraytok);
void gsicc_release_link(gsicc_link_t *icclink);
-void gsicc_link_free(gsicc_link_t *icc_link, const gs_memory_t *memory);
+void gsicc_link_free(gsicc_link_t *icc_link);
bool gsicc_profiles_equal(cmm_profile_t *profile1, cmm_profile_t *profile2);
void gsicc_get_icc_buff_hash(unsigned char *buffer, int64_t *hash, unsigned int buff_size);
int64_t gsicc_get_hash(cmm_profile_t *profile);
diff --git a/base/gsicc_cms.h b/base/gsicc_cms.h
index d3e0e1de..8f768c7b 100644
--- a/base/gsicc_cms.h
+++ b/base/gsicc_cms.h
@@ -41,7 +41,7 @@ int gsicc_mcm_begin_monitor(gsicc_link_cache_t *cache, gx_device *dev);
gsicc_link_t* gsicc_rcm_get_link(const gs_gstate *pgs, gx_device *dev,
gsicc_colorbuffer_t data_cs);
gsicc_link_t* gsicc_nocm_get_link(const gs_gstate *pgs, gx_device *dev,
- gs_color_space_index src_index );
+ int num_input );
gcmmhprofile_t gscms_get_profile_handle_mem(unsigned char *buffer,
unsigned int input_size,
gs_memory_t *mem);
diff --git a/base/gsicc_lcms2mt.c b/base/gsicc_lcms2mt.c
index ac83787b..0506b278 100644
--- a/base/gsicc_lcms2mt.c
+++ b/base/gsicc_lcms2mt.c
@@ -892,7 +892,6 @@ gscms_create(gs_memory_t *memory)
#endif
#ifdef WITH_CAL
- cmsPlugin(ctx, cal_cms_extensions());
cmsPlugin(ctx, cal_cms_extensions2());
#endif
diff --git a/base/gsicc_manage.c b/base/gsicc_manage.c
index 91be6537..08d5bf19 100644
--- a/base/gsicc_manage.c
+++ b/base/gsicc_manage.c
@@ -40,6 +40,7 @@
#include "gpmisc.h"
#include "gxdevice.h"
#include "gxdevsop.h"
+#include "assert_.h"
#define ICC_HEADER_SIZE 128
#define CREATE_V2_DATA 0
@@ -251,19 +252,17 @@ gsicc_initialize_iccsmask(gsicc_manager_t *icc_manager)
/* Load the gray, rgb, and cmyk profiles */
if ((icc_manager->smask_profiles->smask_gray =
gsicc_set_iccsmaskprofile(SMASK_GRAY_ICC, strlen(SMASK_GRAY_ICC),
- icc_manager, stable_mem) ) == NULL) {
- return gs_throw(-1, "failed to load gray smask profile");
- }
+ icc_manager, stable_mem) ) == NULL)
+ goto error;
if ((icc_manager->smask_profiles->smask_rgb =
gsicc_set_iccsmaskprofile(SMASK_RGB_ICC, strlen(SMASK_RGB_ICC),
- icc_manager, stable_mem)) == NULL) {
- return gs_throw(-1, "failed to load rgb smask profile");
- }
+ icc_manager, stable_mem)) == NULL)
+ goto error;
if ((icc_manager->smask_profiles->smask_cmyk =
gsicc_set_iccsmaskprofile(SMASK_CMYK_ICC, strlen(SMASK_CMYK_ICC),
- icc_manager, stable_mem)) == NULL) {
- return gs_throw(-1, "failed to load cmyk smask profile");
- }
+ icc_manager, stable_mem)) == NULL)
+ goto error;
+
/* Set these as "default" so that pdfwrite or other high level devices
will know that these are manufactured profiles, and default spaces
should be used */
@@ -271,6 +270,20 @@ gsicc_initialize_iccsmask(gsicc_manager_t *icc_manager)
icc_manager->smask_profiles->smask_rgb->default_match = DEFAULT_RGB;
icc_manager->smask_profiles->smask_cmyk->default_match = DEFAULT_CMYK;
return 0;
+
+error:
+ if (icc_manager->smask_profiles->smask_gray)
+ rc_free_icc_profile(stable_mem, icc_manager->smask_profiles->smask_gray, "gsicc_initialize_iccsmask");
+ icc_manager->smask_profiles->smask_gray = NULL;
+ if (icc_manager->smask_profiles->smask_rgb)
+ rc_free_icc_profile(stable_mem, icc_manager->smask_profiles->smask_rgb, "gsicc_initialize_iccsmask");
+ icc_manager->smask_profiles->smask_rgb = NULL;
+ if (icc_manager->smask_profiles->smask_cmyk)
+ rc_free_icc_profile(stable_mem, icc_manager->smask_profiles->smask_cmyk, "gsicc_initialize_iccsmask");
+ icc_manager->smask_profiles->smask_cmyk = NULL;
+ gs_free_object(stable_mem, icc_manager->smask_profiles, "gsicc_initialize_iccsmask");
+ icc_manager->smask_profiles = NULL;
+ return gs_throw(-1, "failed to load an smask profile");
}
static int
@@ -1455,6 +1468,7 @@ gsicc_new_device_profile_array(gx_device *dev)
result->pageneutralcolor = false;
result->usefastcolor = false; /* Default is to not use fast color */
result->blacktext = false;
+ result->blackvector = false;
result->prebandthreshold = true;
result->supports_devn = false;
result->overprint_control = gs_overprint_control_enable; /* Default overprint if the device can */
@@ -2358,11 +2372,12 @@ gsicc_manager_new(gs_memory_t *memory)
/* Allocated in stable gc memory. This done since the profiles
may be introduced late in the process. */
- result = gs_alloc_struct(memory->stable_memory, gsicc_manager_t, &st_gsicc_manager,
+ memory = memory->stable_memory;
+ result = gs_alloc_struct(memory, gsicc_manager_t, &st_gsicc_manager,
"gsicc_manager_new");
if ( result == NULL )
return NULL;
- rc_init_free(result, memory->stable_memory, 1, rc_gsicc_manager_free);
+ rc_init_free(result, memory, 1, rc_gsicc_manager_free);
result->default_gray = NULL;
result->default_rgb = NULL;
result->default_cmyk = NULL;
@@ -2372,14 +2387,14 @@ gsicc_manager_new(gs_memory_t *memory)
result->device_named = NULL;
result->device_n = NULL;
result->smask_profiles = NULL;
- result->memory = memory->stable_memory;
+ result->memory = memory;
result->srcgtag_profile = NULL;
result->override_internal = false;
return result;
}
static void gsicc_manager_free_contents(gsicc_manager_t *icc_manager,
- client_name_t cname)
+ client_name_t cname)
{
int k;
gsicc_devicen_entry_t *device_n, *device_n_next;
@@ -2419,6 +2434,8 @@ rc_gsicc_manager_free(gs_memory_t * mem, void *ptr_in, client_name_t cname)
and then free the structure */
gsicc_manager_t *icc_manager = (gsicc_manager_t * ) ptr_in;
+ assert(mem == icc_manager->memory);
+
gs_free_object(icc_manager->memory, icc_manager, "rc_gsicc_manager_free");
}
@@ -2466,7 +2483,7 @@ gsicc_load_profile_buffer(cmm_profile_t *profile, stream *s,
/* Allocates and loads the named color structure from the stream. */
static int
gsicc_load_namedcolor_buffer(cmm_profile_t *profile, stream *s,
- gs_memory_t *memory)
+ gs_memory_t *memory)
{
int num_bytes,profile_size;
unsigned char *buffer_ptr;
@@ -2484,7 +2501,7 @@ gsicc_load_namedcolor_buffer(cmm_profile_t *profile, stream *s,
return code;
/* Allocate the buffer, stuff with the profile */
buffer_ptr = gs_alloc_bytes(memory->non_gc_memory, profile_size,
- "gsicc_load_profile");
+ "gsicc_load_profile");
if (buffer_ptr == NULL)
return gs_throw(gs_error_VMerror, "Insufficient memory for profile buffer");
num_bytes = sfread(buffer_ptr,sizeof(unsigned char),profile_size,s);
diff --git a/base/gsicc_nocm.c b/base/gsicc_nocm.c
index a592e3b1..18b99dc3 100644
--- a/base/gsicc_nocm.c
+++ b/base/gsicc_nocm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -349,7 +349,7 @@ gsicc_nocm_copy_curve(gx_transfer_map *in_map, gs_memory_t *mem)
transformation case. */
gsicc_link_t*
gsicc_nocm_get_link(const gs_gstate *pgs, gx_device *dev,
- gs_color_space_index src_index)
+ int num_input)
{
gsicc_link_t *result;
gsicc_hashlink_t hash;
@@ -378,8 +378,8 @@ gsicc_nocm_get_link(const gs_gstate *pgs, gx_device *dev,
a lot of link requests. */
hash.rend_hash = gsCMM_NONE;
hash.des_hash = dev->color_info.num_components;
- hash.src_hash = src_index;
- hash.link_hashcode = src_index + hash.des_hash * 256 + hash.rend_hash * 4096;
+ hash.src_hash = num_input;
+ hash.link_hashcode = num_input + hash.des_hash * 256 + hash.rend_hash * 4096;
/* Check the cache for a hit. */
result = gsicc_findcachelink(hash, pgs->icc_link_cache, false, false);
@@ -426,7 +426,7 @@ gsicc_nocm_get_link(const gs_gstate *pgs, gx_device *dev,
}
nocm_link->num_out = min(dev->color_info.num_components,
GS_CLIENT_COLOR_MAX_COMPONENTS);
- nocm_link->num_in = src_index;
+ nocm_link->num_in = num_input;
result->num_input = nocm_link->num_in;
result->num_output = nocm_link->num_out;
diff --git a/base/gsicc_profilecache.c b/base/gsicc_profilecache.c
index 3accf4c8..5f545059 100644
--- a/base/gsicc_profilecache.c
+++ b/base/gsicc_profilecache.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -28,6 +28,7 @@
#include "gscms.h"
#include "gsicc_profilecache.h"
#include "gserrors.h"
+#include "assert_.h"
#define ICC_CACHE_MAXPROFILE 50
@@ -54,11 +55,12 @@ gsicc_profilecache_new(gs_memory_t *memory)
/* We want this to be maintained in stable_memory. It should not be effected by the
save and restores */
- result = gs_alloc_struct(memory->stable_memory, gsicc_profile_cache_t,
+ memory = memory->stable_memory;
+ result = gs_alloc_struct(memory, gsicc_profile_cache_t,
&st_profile_cache, "gsicc_profilecache_new");
if ( result == NULL )
return(NULL);
- rc_init_free(result, memory->stable_memory, 1, rc_gsicc_profile_cache_free);
+ rc_init_free(result, memory, 1, rc_gsicc_profile_cache_free);
result->head = NULL;
result->num_entries = 0;
result->memory = memory;
@@ -71,10 +73,11 @@ rc_gsicc_profile_cache_free(gs_memory_t * mem, void *ptr_in, client_name_t cname
gsicc_profile_cache_t *profile_cache = (gsicc_profile_cache_t * ) ptr_in;
gsicc_profile_entry_t *curr = profile_cache->head, *next;
+ assert(mem->stable_memory == profile_cache->memory);
while (curr != NULL ){
next = curr->next;
rc_decrement(curr->color_space, "rc_gsicc_profile_cache_free");
- gs_free_object(profile_cache->memory->stable_memory, curr,
+ gs_free_object(profile_cache->memory, curr,
"rc_gsicc_profile_cache_free");
profile_cache->num_entries--;
curr = next;
@@ -84,7 +87,7 @@ rc_gsicc_profile_cache_free(gs_memory_t * mem, void *ptr_in, client_name_t cname
emprintf1(mem,"gsicc_profile_cache_free, num_entries is %d (should be 0).\n",
profile_cache->num_entries);
#endif
- gs_free_object(profile_cache->memory->stable_memory, profile_cache,
+ gs_free_object(profile_cache->memory, profile_cache,
"rc_gsicc_profile_cache_free");
}
@@ -100,8 +103,8 @@ gsicc_add_cs(gs_gstate * pgs, gs_color_space * colorspace, uint64_t dictkey)
/* The entry has to be added in stable memory. We want them
to be maintained across the gsave and grestore process */
- result = gs_alloc_struct(memory->stable_memory, gsicc_profile_entry_t,
- &st_profile_entry, "gsicc_add_cs");
+ result = gs_alloc_struct(memory, gsicc_profile_entry_t,
+ &st_profile_entry, "gsicc_add_cs");
if (result == NULL)
return; /* FIXME */
@@ -178,7 +181,7 @@ gsicc_remove_cs_entry(gsicc_profile_cache_t *profile_cache)
#ifdef DEBUG
if (profile_cache->num_entries != 0) {
emprintf1(memory, "profile cache list empty, but list has num_entries=%d.\n",
- profile_cache->num_entries);
+ profile_cache->num_entries);
}
#endif
} else {
@@ -191,5 +194,5 @@ gsicc_remove_cs_entry(gsicc_profile_cache_t *profile_cache)
"[icc] Remove cs from cache = "PRI_INTPTR", hash = %"PRIu64"\n",
(intptr_t)curr->color_space, (uint64_t)curr->key);
rc_decrement(curr->color_space, "gsicc_remove_cs_entry");
- gs_free_object(memory->stable_memory, curr, "gsicc_remove_cs_entry");
+ gs_free_object(memory, curr, "gsicc_remove_cs_entry");
}
diff --git a/base/gsmchunk.c b/base/gsmchunk.c
index f221ac30..5d3dbebe 100644
--- a/base/gsmchunk.c
+++ b/base/gsmchunk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -369,6 +369,20 @@ static int dump_free_size(gs_memory_t *mem, chunk_free_node_t *node, int depth,
return 1 + count + dump_free_size(mem, node->right_size, depth + 2 + (depth&1), size, addr);
}
+#ifdef DEBUG_CHUNK_PRINT
+static size_t
+largest_free_block(chunk_free_node_t *size)
+{
+ if (size == NULL)
+ return 0;
+ while (1) {
+ if (size->right_size == NULL)
+ return size->size;
+ size = size->right_size;
+ }
+}
+#endif
+
void
gs_memory_chunk_dump_memory(const gs_memory_t *mem)
{
@@ -381,10 +395,12 @@ gs_memory_chunk_dump_memory(const gs_memory_t *mem)
#ifdef DEBUG_CHUNK_PRINT
dmlprintf1(cmem->target, "Chunk "PRI_INTPTR":\n", (intptr_t)cmem);
+ dmlprintf3(cmem->target, "Used=%"PRIxSIZE", Max Used=%"PRIxSIZE", Total Free=%"PRIxSIZE"\n", cmem->used, cmem->max_used, cmem->total_free);
+ dmlprintf1(cmem->target, "Largest free block=%d bytes\n", largest_free_block(cmem->free_size));
#ifdef DEBUG_CHUNK_PRINT_SLABS
{
chunk_slab_t *slab;
- dmlprintf(cmem->target, "Slabs\n");
+ dmlprintf(cmem->target, "Slabs:\n");
for (slab = cmem->slabs; slab != NULL; slab = slab->next)
dmlprintf1(cmem->target, " "PRI_INTPTR"\n", (intptr_t)slab);
}
@@ -778,16 +794,16 @@ chunk_obj_alloc(gs_memory_t *mem, size_t size, gs_memory_type_ptr_t type, client
#ifdef DEBUG_CHUNK_PRINT
#ifdef DEBUG_SEQ
- dmlprintf4(cmem->target, "Event %x: malloc(chunk="PRI_INTPTR", size="PRIxSIZE", cname=%s)\n",
+ dmlprintf4(mem, "Event %x: malloc(chunk="PRI_INTPTR", size=%"PRIxSIZE", cname=%s)\n",
cmem->sequence, (intptr_t)cmem, newsize, cname);
#else
- dmlprintf3(cmem->target, "malloc(chunk="PRI_INTPTR", size="PRIxSIZE", cname=%s)\n",
+ dmlprintf3(mem, "malloc(chunk="PRI_INTPTR", size=%"PRIxSIZE", cname=%s)\n",
(intptr_t)cmem, newsize, cname);
#endif
#endif
/* Large blocks are allocated directly */
- if (SINGLE_OBJECT_CHUNK(newsize)) {
+ if (SINGLE_OBJECT_CHUNK(size)) {
obj = (chunk_obj_node_t *)gs_alloc_bytes_immovable(cmem->target, newsize, cname);
if (obj == NULL)
return NULL;
@@ -906,6 +922,7 @@ chunk_obj_alloc(gs_memory_t *mem, size_t size, gs_memory_type_ptr_t type, client
/* No appropriate free space slot. We need to allocate a new slab. */
chunk_slab_t *slab;
uint slab_size = newsize + SIZEOF_ROUND_ALIGN(chunk_slab_t);
+
if (slab_size <= (CHUNK_SIZE>>1))
slab_size = CHUNK_SIZE;
slab = (chunk_slab_t *)gs_alloc_bytes_immovable(cmem->target, slab_size, cname);
@@ -956,10 +973,10 @@ chunk_obj_alloc(gs_memory_t *mem, size_t size, gs_memory_type_ptr_t type, client
client_name_string(cname), size, (intptr_t) obj);
#ifdef DEBUG_CHUNK_PRINT
#ifdef DEBUG_SEQ
- dmlprintf5(cmem->target, "Event %x: malloced(chunk="PRI_INTPTR", addr="PRI_INTPTR", size=%"PRIxSIZE", cname=%s)\n",
+ dmlprintf5(mem, "Event %x: malloced(chunk="PRI_INTPTR", addr="PRI_INTPTR", size=%"PRIxSIZE", cname=%s)\n",
obj->sequence, (intptr_t)cmem, (intptr_t)obj, obj->size, cname);
#else
- dmlprintf4(cmem->target, "malloced(chunk="PRI_INTPTR", addr="PRI_INTPTR", size=%"PRI_xSIZE", cname=%s)\n",
+ dmlprintf4(mem, "malloced(chunk="PRI_INTPTR", addr="PRI_INTPTR", size=%"PRIxSIZE", cname=%s)\n",
(intptr_t)cmem, (intptr_t)obj, obj->size, cname);
#endif
#endif
diff --git a/base/gsovrc.c b/base/gsovrc.c
index 745ebfbe..574e1e2e 100644
--- a/base/gsovrc.c
+++ b/base/gsovrc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -424,6 +424,7 @@ nooverprint_initialize_device_procs(gx_device *dev)
set_dev_proc(dev, copy_planes, gx_forward_copy_planes);
set_dev_proc(dev, copy_alpha_hl_color, gx_forward_copy_alpha_hl_color);
set_dev_proc(dev, fill_stroke_path, gx_forward_fill_stroke_path);
+ set_dev_proc(dev, lock_pattern, gx_forward_lock_pattern);
}
/*
@@ -903,7 +904,9 @@ overprint_copy_alpha_hl_color(gx_device * dev, const byte * data, int data_x,
overprint_device_t * opdev = (overprint_device_t *)dev;
int code;
- opdev->copy_alpha_hl = true;
+ if ((opdev->op_state == OP_STATE_FILL && !opdev->retain_none_fill) ||
+ (opdev->op_state == OP_STATE_STROKE && !opdev->retain_none_stroke))
+ opdev->copy_alpha_hl = true;
code = gx_default_copy_alpha_hl_color(dev, data, data_x, raster, id, x, y,
width, height, pdcolor, depth);
opdev->copy_alpha_hl = false;
@@ -930,7 +933,7 @@ overprint_copy_planes(gx_device * dev, const byte * data, int data_x, int raster
uchar num_comps;
uchar k,j;
gs_memory_t * mem = dev->memory;
- gx_color_index comps = opdev->op_state == OP_STATE_FILL ? opdev->drawn_comps_fill : opdev->drawn_comps_stroke;
+ gx_color_index comps_orig = opdev->op_state == OP_STATE_FILL ? opdev->drawn_comps_fill : opdev->drawn_comps_stroke;
byte *curr_data = (byte *) data + data_x;
int row, offset;
@@ -972,6 +975,7 @@ overprint_copy_planes(gx_device * dev, const byte * data, int data_x, int raster
/* step through the height */
row = 0;
while (h-- > 0 && code >= 0) {
+ gx_color_index comps = comps_orig;
gb_rect.p.y = y++;
gb_rect.q.y = y;
offset = row * raster_in + data_x;
@@ -981,23 +985,23 @@ overprint_copy_planes(gx_device * dev, const byte * data, int data_x, int raster
for (k = 0; k < tdev->color_info.num_components; k++) {
/* First set the params to zero for all planes except the one we want */
for (j = 0; j < tdev->color_info.num_components; j++)
- gb_params.data[j] = 0;
- gb_params.data[k] = gb_buff + k * raster;
- code = dev_proc(tdev, get_bits_rectangle) (tdev, &gb_rect,
- &gb_params);
- if (code < 0) {
- gs_free_object(mem, gb_buff, "overprint_copy_planes" );
- return code;
- }
- /* Skip the plane if this component is not to be drawn. If
- its the one that we want to draw, replace it with our
- buffer data */
- if ((comps & 0x01) == 1) {
- memcpy(gb_params.data[k], curr_data, w);
- }
- /* Next plane */
- curr_data += plane_height * raster_in;
- comps >>= 1;
+ gb_params.data[j] = 0;
+ gb_params.data[k] = gb_buff + k * raster;
+ code = dev_proc(tdev, get_bits_rectangle) (tdev, &gb_rect,
+ &gb_params);
+ if (code < 0) {
+ gs_free_object(mem, gb_buff, "overprint_copy_planes" );
+ return code;
+ }
+ /* Skip the plane if this component is not to be drawn. If
+ its the one that we want to draw, replace it with our
+ buffer data */
+ if ((comps & 0x01) == 1) {
+ memcpy(gb_params.data[k], curr_data, w);
+ }
+ /* Next plane */
+ curr_data += plane_height * raster_in;
+ comps >>= 1;
}
code = dev_proc(tdev, copy_planes)(tdev, gb_buff, 0, raster,
gs_no_bitmap_id, x, y - 1, w, 1, 1);
@@ -1300,6 +1304,14 @@ overprint_dev_spec_op(gx_device* pdev, int dev_spec_op,
if (dev_spec_op == gxdso_overprint_active)
return !opdev->is_idle;
+ if (dev_spec_op == gxdso_overprint_op)
+ {
+ int ret = opdev->op_state;
+ if ((intptr_t)data >= 0)
+ opdev->op_state = (intptr_t)data;
+ return ret;
+ }
+
if (dev_spec_op == gxdso_device_child) {
gxdso_device_child_request *d = (gxdso_device_child_request *)data;
if (d->target == pdev) {
diff --git a/base/gspaint.c b/base/gspaint.c
index f7127e0e..d67ef36b 100644
--- a/base/gspaint.c
+++ b/base/gspaint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -273,10 +273,23 @@ alpha_buffer_release(gs_gstate * pgs, bool newpath)
return code;
}
+/* Setup for black vector handling */
+static inline bool black_vectors(gs_gstate *pgs, gx_device *dev)
+{
+ if (dev->icc_struct != NULL && dev->icc_struct->blackvector &&
+ pgs->black_textvec_state == NULL) {
+ return gsicc_setup_blacktextvec(pgs, dev, false);
+ }
+ return false;
+}
+
static int do_fill(gs_gstate *pgs, int rule)
{
int code, abits, acode, rcode = 0;
bool devn;
+ bool black_vector = false;
+ bool in_smask =
+ (dev_proc(pgs->device, dev_spec_op)(pgs->device, gxdso_in_smask_construction, NULL, 0)) > 0;
/* We need to distinguish text from vectors to set the object tag.
@@ -294,17 +307,18 @@ static int do_fill(gs_gstate *pgs, int rule)
handle that, we'll have to add a flag to the path structure, or to the path
segment structure (depending on how fine grained we require it to be).
*/
- if (pgs->show_gstate == NULL)
+ if (pgs->show_gstate == NULL && !in_smask) {
ensure_tag_is_set(pgs, pgs->device, GS_VECTOR_TAG); /* NB: may unset_dev_color */
- else
+ black_vector = black_vectors(pgs, pgs->device); /* Set vector fill to black */
+ } else
ensure_tag_is_set(pgs, pgs->device, GS_TEXT_TAG); /* NB: may unset_dev_color */
code = gx_set_dev_color(pgs);
if (code != 0)
- return code;
+ goto out;
code = gs_gstate_color_load(pgs);
if (code < 0)
- return code;
+ goto out;
if (pgs->overprint || (!pgs->overprint && dev_proc(pgs->device, dev_spec_op)(pgs->device,
gxdso_overprint_active, NULL, 0))) {
@@ -314,7 +328,7 @@ static int do_fill(gs_gstate *pgs, int rule)
"[overprint] Fill Overprint\n");
code = gs_do_set_overprint(pgs);
if (code < 0)
- return code;
+ goto out;
op_params.op_state = OP_STATE_FILL;
gs_gstate_update_overprint(pgs, &op_params);
@@ -330,10 +344,14 @@ static int do_fill(gs_gstate *pgs, int rule)
if (abits > 1) {
acode = alpha_buffer_init(pgs, pgs->fill_adjust.x,
pgs->fill_adjust.y, abits, devn);
- if (acode == 2) /* Special case for no fill required */
- return 0;
- if (acode < 0)
- return acode;
+ if (acode == 2) { /* Special case for no fill required */
+ code = 0;
+ goto out;
+ }
+ if (acode < 0) {
+ code = acode;
+ goto out;
+ }
} else
acode = 0;
code = gx_fill_path(pgs->path, gs_currentdevicecolor_inline(pgs), pgs, rule,
@@ -343,6 +361,12 @@ static int do_fill(gs_gstate *pgs, int rule)
if (code >= 0 && rcode < 0)
code = rcode;
+out:
+ if (black_vector) {
+ /* Restore color */
+ gsicc_restore_blacktextvec(pgs, false);
+ }
+
return code;
}
@@ -397,6 +421,10 @@ do_stroke(gs_gstate * pgs)
int code, abits, acode, rcode = 0;
bool devn;
bool is_fill_correct = true;
+ bool black_vector = false;
+ bool in_smask =
+ (dev_proc(pgs->device, dev_spec_op)(pgs->device, gxdso_in_smask_construction, NULL, 0)) > 0;
+
/* We need to distinguish text from vectors to set the object tag.
@@ -414,17 +442,18 @@ do_stroke(gs_gstate * pgs)
handle that, we'll have to add a flag to the path structure, or to the path
segment structure (depending on how fine grained we require it to be).
*/
- if (pgs->show_gstate == NULL)
+ if (pgs->show_gstate == NULL && !in_smask) {
ensure_tag_is_set(pgs, pgs->device, GS_VECTOR_TAG); /* NB: may unset_dev_color */
- else
+ black_vector = black_vectors(pgs, pgs->device);
+ } else
ensure_tag_is_set(pgs, pgs->device, GS_TEXT_TAG); /* NB: may unset_dev_color */
code = gx_set_dev_color(pgs);
if (code != 0)
- return code;
+ goto out;
code = gs_gstate_color_load(pgs);
if (code < 0)
- return code;
+ goto out;
if (pgs->stroke_overprint || (!pgs->stroke_overprint && dev_proc(pgs->device, dev_spec_op)(pgs->device,
@@ -446,7 +475,7 @@ do_stroke(gs_gstate * pgs)
if (!is_fill_correct) {
pgs->is_fill_color = true;
}
- return code;
+ goto out;
}
op_params.op_state = OP_STATE_STROKE;
@@ -487,13 +516,15 @@ do_stroke(gs_gstate * pgs)
if (!is_fill_correct) {
pgs->is_fill_color = true;
}
- return 0;
+ code = 0;
+ goto out;
}
if (acode < 0) {
if (!is_fill_correct) {
pgs->is_fill_color = true;
}
- return acode;
+ code = acode;
+ goto out;
}
gs_setlinewidth(pgs, new_width);
scale_dash_pattern(pgs, scale);
@@ -523,6 +554,12 @@ do_stroke(gs_gstate * pgs)
if (!is_fill_correct) {
pgs->is_fill_color = true;
}
+
+out:
+ if (black_vector) {
+ /* Restore color */
+ gsicc_restore_blacktextvec(pgs, false);
+ }
return code;
}
@@ -603,6 +640,10 @@ static int do_fill_stroke(gs_gstate *pgs, int rule, int *restart)
int code, abits, acode = 0, rcode = 0;
bool devn;
float orig_width, scale, orig_flatness;
+ bool black_vector = false;
+ bool in_smask =
+ (dev_proc(pgs->device, dev_spec_op)(pgs->device, gxdso_in_smask_construction, NULL, 0)) > 0;
+
/* It is either our first time, or the stroke was a pattern and
we are coming back from the error if restart < 1 (0 is first
@@ -615,7 +656,7 @@ static int do_fill_stroke(gs_gstate *pgs, int rule, int *restart)
if(gs_currentdevicecolor_inline(pgs)->colors.pattern.p_tile != NULL) {
id = gs_currentdevicecolor_inline(pgs)->colors.pattern.p_tile->id;
- code = gx_pattern_cache_entry_set_lock(pgs, id, true);
+ code = dev_proc(pgs->device, lock_pattern)(pgs->device, pgs, id, true);
} else {
code = 0;
}
@@ -643,30 +684,31 @@ static int do_fill_stroke(gs_gstate *pgs, int rule, int *restart)
handle that, we'll have to add a flag to the path structure, or to the path
segment structure (depending on how fine grained we require it to be).
*/
- if (pgs->show_gstate == NULL)
+ if (pgs->show_gstate == NULL && !in_smask) {
ensure_tag_is_set(pgs, pgs->device, GS_VECTOR_TAG); /* NB: may unset_dev_color */
- else
+ black_vector = black_vectors(pgs, pgs->device);
+ } else
ensure_tag_is_set(pgs, pgs->device, GS_TEXT_TAG); /* NB: may unset_dev_color */
/* if we are at restart == 0, we set the stroke color. */
code = gx_set_dev_color(pgs);
if (code != 0)
- return code; /* may be gs_error_Remap_color or real error */
+ goto out2; /* may be gs_error_Remap_color or real error */
code = gs_gstate_color_load(pgs);
if (code < 0)
- return code;
+ goto out2;
/* If this was a pattern color, make sure and lock it in the pattern_cache */
if (gx_dc_is_pattern1_color(gs_currentdevicecolor_inline(pgs))) {
gs_id id;
if(gs_currentdevicecolor_inline(pgs)->colors.pattern.p_tile != NULL) {
id = gs_currentdevicecolor_inline(pgs)->colors.pattern.p_tile->id;
- code = gx_pattern_cache_entry_set_lock(pgs, id, true);
+ code = dev_proc(pgs->device, lock_pattern)(pgs->device, pgs, id, true);
} else {
code = 0;
}
- if (code < 0)
- return code; /* lock failed -- tile not in cache? */
+ if (code < 0)
+ goto out2; /* lock failed -- tile not in cache? */
}
}
@@ -676,7 +718,7 @@ static int do_fill_stroke(gs_gstate *pgs, int rule, int *restart)
"[overprint] StrokeFill Stroke Set Overprint\n");
code = gs_do_set_overprint(pgs);
if (code < 0)
- return code;
+ goto out2;
}
*restart = 1; /* finished, successfully with stroke_color */
@@ -690,7 +732,7 @@ static int do_fill_stroke(gs_gstate *pgs, int rule, int *restart)
code = gx_set_dev_color(pgs);
if (code != 0) {
- return code;
+ goto out2;
}
code = gs_gstate_color_load(pgs);
if (code < 0) {
@@ -769,23 +811,28 @@ static int do_fill_stroke(gs_gstate *pgs, int rule, int *restart)
if(gs_currentdevicecolor_inline(pgs)->colors.pattern.p_tile != NULL) {
id = gs_currentdevicecolor_inline(pgs)->colors.pattern.p_tile->id;
- code = gx_pattern_cache_entry_set_lock(pgs, id, false);
+ code = dev_proc(pgs->device, lock_pattern)(pgs->device, pgs, id, false);
} else {
code = 0;
}
if (code < 0)
- return code; /* lock failed -- tile not in cache? */
+ goto out2; /* lock failed -- tile not in cache? */
}
}
out:
+ if (black_vector) {
+ /* Restore color */
+ gsicc_restore_blacktextvec(pgs, false);
+ }
+
if (gx_dc_is_pattern1_color(gs_swappeddevicecolor_inline(pgs))) {
gs_id id;
if (gs_swappeddevicecolor_inline(pgs)->colors.pattern.p_tile != NULL) {
id = gs_swappeddevicecolor_inline(pgs)->colors.pattern.p_tile->id;
- rcode = gx_pattern_cache_entry_set_lock(pgs, id, false);
- if (rcode < 0)
- return rcode; /* unlock failed -- shouldn't be possible */
+ rcode = dev_proc(pgs->device, lock_pattern)(pgs->device, pgs, id, false);
+ if (rcode < 0)
+ return rcode; /* unlock failed -- shouldn't be possible */
} else {
code = 0;
}
@@ -793,6 +840,13 @@ out:
if (code >= 0 && acode < 0)
code = acode;
return code;
+
+out2:
+ if (black_vector) {
+ /* Restore color */
+ gsicc_restore_blacktextvec(pgs, false);
+ }
+ return code;
}
/* Fill the current path using a specified rule. */
diff --git a/base/gsparamx.c b/base/gsparamx.c
index 8ca19a5b..2009c53c 100644
--- a/base/gsparamx.c
+++ b/base/gsparamx.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -144,7 +144,12 @@ param_list_copy(gs_param_list *plto, gs_param_list *plfrom)
code = (code > 0 ? gs_note_error(gs_error_unknownerror) : code);
break;
}
- gs_param_list_set_persistent_keys(plto, key.persistent);
+ /* We used to use 'key.persistent' to determine whether we needed to copy the
+ * key (by setting persistent_keys in the param list to false), but that isn't
+ * correct! We are going to use the heap buffer 'string_key', not the original
+ * key, and since that's on the heap it is NOT persistent....
+ */
+ gs_param_list_set_persistent_keys(plto, false);
switch (value.type) {
case gs_param_type_dict:
coll_type = gs_param_collection_dict_any;
diff --git a/base/gspath1.c b/base/gspath1.c
index e9b91b06..cc56cb1d 100644
--- a/base/gspath1.c
+++ b/base/gspath1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -219,6 +219,9 @@ gs_gstate_arc_add(gx_path * ppath, gs_gstate * pgs, bool clockwise,
ang2 += 180;
ar = -ar;
}
+ if (ang1 > (max_int - 360) || ang2 > (max_int - 360))
+ return_error(gs_error_limitcheck);
+
arc.radius = ar;
arc.action = (add_line ? arc_lineto : arc_moveto);
arc.notes = sn_none;
@@ -228,8 +231,9 @@ gs_gstate_arc_add(gx_path * ppath, gs_gstate * pgs, bool clockwise,
arc.p3.x = axc + ar * arc.sincos.cos;
arc.p3.y = ayc + ar * arc.sincos.sin;
if (clockwise) {
- while (ang1 < ang2)
- ang2 -= 360;
+ if (ang1 < ang2) {
+ ang2 -= ceil((ang2 - ang1) / 360) * 360;
+ }
if (ang2 < 0) {
double adjust = ceil(-ang2 / 360) * 360;
@@ -258,8 +262,9 @@ gs_gstate_arc_add(gx_path * ppath, gs_gstate * pgs, bool clockwise,
arc.notes = sn_not_first;
}
} else {
- while (ang2 < ang1)
- ang2 += 360;
+ if (ang2 < ang1) {
+ ang2 += ceil((ang1 - ang2) / 360) * 360;
+ }
if (ang1 < 0) {
double adjust = ceil(-ang1 / 360) * 360;
diff --git a/base/gsptype1.c b/base/gsptype1.c
index 28a88d02..2e032716 100644
--- a/base/gsptype1.c
+++ b/base/gsptype1.c
@@ -227,13 +227,14 @@ gs_pattern1_make_pattern(gs_client_color * pcc,
* losing content. */
inst.size.x = (int)floor(bbw+0.5);
inst.size.y = (int)floor(bbh+0.5);
- /* Ensure we never round down to 0. */
- if (bbw > 0 && inst.size.x == 0)
- inst.size.x = 1;
- if (bbh > 0 && inst.size.y == 0)
- inst.size.y = 1;
}
+ /* Ensure we never round down to 0. Or below zero (bug 705768). */
+ if (inst.size.x <= 0)
+ inst.size.x = bbw > 0 ? 1 : 0;
+ if (inst.size.y <= 0)
+ inst.size.y = bbh > 0 ? 1 : 0;
+
/* After compute_inst_matrix above, we are guaranteed that
* inst.step_matrix.xx > 0 and inst.step_matrix.yy > 0.
* Similarly, we are guaranteed that inst.size.x >= 0 and
@@ -1615,10 +1616,10 @@ gx_pattern_cache_lookup(gx_device_color * pdevc, const gs_gstate * pgs,
return true;
}
if (pcache != 0) {
- gx_color_tile *ctile = &pcache->tiles[id % pcache->num_tiles];
+ gx_color_tile *ctile = gx_pattern_cache_find_tile_for_id(pcache, id);
bool internal_accum = true;
if (pgs->have_pattern_streams) {
- int code = dev_proc(dev, dev_spec_op)(dev, gxdso_pattern_load, NULL, id);
+ int code = dev_proc(dev, dev_spec_op)(dev, gxdso_pattern_load, &id, sizeof(gx_bitmap_id));
internal_accum = (code == 0);
if (code < 0)
return false;
@@ -1960,7 +1961,7 @@ gx_dc_pattern_write(
Just write the tile id. */
gs_id id = ptile->id; /* Ensure sizeof(gs_id). */
if_debug2m('v', dev->memory,
- "[v*] Writing trans tile ID into clist, uid = %ld id = %ld \n",
+ "[v*] Writing trans tile ID into clist, uid = %ld id = %u \n",
ptile->uid.id, ptile->id);
memcpy(dp, &ptile->id, sizeof(id));
*psize = sizeof(gs_id);
@@ -1972,7 +1973,7 @@ gx_dc_pattern_write(
the clist */
if (ptile->ttrans != NULL) {
if_debug2m('v', dev->memory,
- "[v*] Writing trans tile into clist, uid = %ld id = %ld \n",
+ "[v*] Writing trans tile into clist, uid = %ld id = %u \n",
ptile->uid.id, ptile->id);
return gx_dc_pattern_trans_write_raster(ptile, offset, data, psize);
}
@@ -2286,7 +2287,7 @@ gx_dc_pattern_read(
ptile->ttrans->deep = deep;
pdevc->type = &gx_dc_pattern_trans;
if_debug2m('v', pgs->memory,
- "[v*] Reading trans tile from clist into cache, uid = %ld id = %ld \n",
+ "[v*] Reading trans tile from clist into cache, uid = %ld id = %u \n",
ptile->uid.id, ptile->id);
code = gx_dc_pattern_read_trans_buff(ptile, offset1, dp, left, mem);
diff --git a/base/gssprintf.c b/base/gssprintf.c
index 2b24580e..e2e1702c 100644
--- a/base/gssprintf.c
+++ b/base/gssprintf.c
@@ -1472,25 +1472,6 @@ int gs_snprintf(char *buf, int len,
return (cc == -1) ? (int)len - 1 : cc;
}
-int gs_sprintf(char *buf, const char *format, ...)
-{
- int cc;
- va_list ap;
- apr_vformatter_buff_t vbuff;
-
- /* save one byte for nul terminator */
- vbuff.curpos = buf;
- vbuff.endpos = buf + NUM_BUF_SIZE - 1;
-
- va_start(ap, format);
- cc = apr_vformatter(snprintf_flush, &vbuff, format, ap);
- va_end(ap);
- *vbuff.curpos = '\0';
-
- return cc;
-}
-
-
int gs_vsnprintf(char *buf, int len, const char *format,
va_list ap)
{
diff --git a/base/gssprintf.h b/base/gssprintf.h
index 0b5f6d3d..961a68b9 100644
--- a/base/gssprintf.h
+++ b/base/gssprintf.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -28,8 +28,5 @@ int
gs_vsprintf(char *zBuf, const char *zFormat, va_list ap);
int
-gs_sprintf(char *zBuf, const char *zFormat, ...);
-
-int
gs_sscanf(char *buf, const char *format, ...);
#endif
diff --git a/base/gstext.c b/base/gstext.c
index 306c476d..07cdb549 100644
--- a/base/gstext.c
+++ b/base/gstext.c
@@ -324,34 +324,8 @@ gs_text_begin(gs_gstate * pgs, const gs_text_params_t * text,
/* Processing a text object operation */
ensure_tag_is_set(pgs, pgs->device, GS_TEXT_TAG); /* NB: may unset_dev_color */
- if (black_text && pgs->black_text_state == NULL) {
- gs_color_space *pcs_curr = gs_currentcolorspace_inline(pgs);
- gs_color_space *pcs_alt = gs_swappedcolorspace_inline(pgs);
-
- pgs->black_text_state = gsicc_blacktext_state_new(pgs->memory);
- if (pgs->black_text_state == NULL)
- return gs_error_VMerror;
-
- rc_increment_cs(pcs_curr);
- rc_increment_cs(pcs_alt);
- pgs->black_text_state->pcs[0] = pcs_curr;
- pgs->black_text_state->pcs[1] = pcs_alt;
-
- pgs->black_text_state->pcc[0] = pgs->color[0].ccolor;
- cs_adjust_color_count(pgs, 1); /* The set_gray will do a decrement */
- pgs->black_text_state->value[0] = pgs->color[0].ccolor->paint.values[0];
- gs_setgray(pgs, 0.0);
-
- gs_swapcolors_quick(pgs);
-
- pgs->black_text_state->pcc[1] = pgs->color[0].ccolor;
- cs_adjust_color_count(pgs, 1);
- pgs->black_text_state->value[1] = pgs->color[0].ccolor->paint.values[0];
- gs_setgray(pgs, 0.0);
-
- gs_swapcolors_quick(pgs);
-
- pgs->black_text_state->is_fill = pgs->is_fill_color;
+ if (black_text && pgs->black_textvec_state == NULL) {
+ gsicc_setup_blacktextvec(pgs, (gx_device *)pgs->device, true);
}
code = gx_set_dev_color(pgs);
@@ -405,7 +379,7 @@ gs_text_begin(gs_gstate * pgs, const gs_text_params_t * text,
/* we need to know if we are doing a highlevel device.
Also we need to know if we are doing any stroke
or stroke fill operations. This determines when
- we need to release the black_text_state structure. */
+ we need to release the black_textvec_state structure. */
if (code >= 0 && *ppte != NULL) {
if (black_text) {
if (!((*ppte)->k_text_release)) {
@@ -821,8 +795,8 @@ rc_free_text_enum(gs_memory_t * mem, void *obj, client_name_t cname)
void
gs_text_release(gs_gstate *pgs, gs_text_enum_t * pte, client_name_t cname)
{
- if (pgs != NULL && pgs->black_text_state != NULL)
- gsicc_restore_black_text(pgs);
+ if (pgs != NULL && pgs->black_textvec_state != NULL)
+ gsicc_restore_blacktextvec(pgs, true);
rc_decrement_only(pte, cname);
}
diff --git a/base/gstiffio.c b/base/gstiffio.c
index bb2ce85e..919ffab6 100644
--- a/base/gstiffio.c
+++ b/base/gstiffio.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -170,6 +170,12 @@ tiff_from_filep(gx_device_printer *dev, const char *name, gp_file *filep, int b
return t;
}
+int tiff_filename_from_tiff(TIFF *t, char **name)
+{
+ *name = (char *)TIFFFileName(t);
+ return 0;
+}
+
static void
gs_tifsWarningHandlerEx(thandle_t client_data, const char* module, const char* fmt, va_list ap)
{
diff --git a/base/gstiffio.h b/base/gstiffio.h
index 405e0fac..9ab9bfad 100644
--- a/base/gstiffio.h
+++ b/base/gstiffio.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -23,5 +23,6 @@
TIFF *
tiff_from_filep(gx_device_printer *dev, const char *name, gp_file *filep, int big_endian, bool usebigtiff);
void tiff_set_handlers (void);
+int tiff_filename_from_tiff(TIFF *t, char **name);
#endif /* gstiffio_INCLUDED */
diff --git a/base/gstrans.c b/base/gstrans.c
index 42207f99..d57b02ee 100644
--- a/base/gstrans.c
+++ b/base/gstrans.c
@@ -222,6 +222,7 @@ gs_begin_transparency_group(gs_gstate *pgs,
params.blend_mode = pgs->blend_mode;
params.text_group = ptgp->text_group;
params.shade_group = ptgp->shade_group;
+ params.ColorSpace = ptgp->ColorSpace;
/* This function is called during the c-list writer side.
Store some information so that we know what the color space is
so that we can adjust according later during the clist reader.
@@ -560,6 +561,7 @@ gs_begin_transparency_mask(gs_gstate * pgs,
params.subtype = ptmp->subtype;
params.Background_components = ptmp->Background_components;
memcpy(params.Background, ptmp->Background, l);
+ params.ColorSpace = ptmp->ColorSpace;
params.Matte_components = ptmp->Matte_components;
memcpy(params.Matte, ptmp->Matte, m);
params.GrayBackground = ptmp->GrayBackground;
@@ -820,16 +822,27 @@ gs_push_pdf14trans_device(gs_gstate * pgs, bool is_pattern, bool retain,
params.overprint_sim_push = true;
}
- /* If we have an NCLR ICC profile, the extra spot colorants do not
- get included in the transparency buffers. This is also true
- for any extra colorant names listed, which go beyond the profile.
- Finally, we could have a CMYK profile with colorants listed, that
- go beyond CMYK. To detect, simply look at dev_profile->spotnames */
+ /* If we have an NCLR ICC profile, the extra spot colorants do
+ * get included in the transparency buffers. Trying to avoid
+ * including them became a rube goldberg mess in terms of knowing
+ * which colorants are on the page vs what has been specified and
+ * any aliasing between these two. Just too many things to go wrong.
+ * So we allocate all and carry around. If you are doing special
+ * spot handling with transparency this is the cost. */
+
if (dev_profile->spotnames != NULL && dev_profile->spotnames->count > 4) {
- /* Making an assumption here, that list is CMYK + extra. */
- int delta = dev_profile->spotnames->count - 4;
- params.num_spot_colors_int -= delta;
- params.num_spot_colors -= delta;
+ /* Making an assumption here, that list is CMYK + extra.
+ An error should have been thrown by the target device if not. */
+ int avail_page_spots = pgs->device->color_info.num_components - 4;
+ params.num_spot_colors_int = avail_page_spots;
+ params.num_spot_colors = avail_page_spots;
+
+ /* This should not be possible, but lets be safe. We can't have a negative
+ number of source spots to carry forward, so apply threshold. */
+ if (params.num_spot_colors_int < 0)
+ params.num_spot_colors_int = 0;
+ if (params.num_spot_colors < 0)
+ params.num_spot_colors = 0;
}
/* If we happen to be in a situation where we are going out to a device
diff --git a/base/gstrans.h b/base/gstrans.h
index d7bf1e0d..65bf017d 100644
--- a/base/gstrans.h
+++ b/base/gstrans.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -107,6 +107,7 @@ struct gs_pdf14trans_params_s {
bool function_is_identity;
int Background_components;
float Background[GS_CLIENT_COLOR_MAX_COMPONENTS];
+ const gs_color_space *ColorSpace;
int Matte_components;
float Matte[GS_CLIENT_COLOR_MAX_COMPONENTS];
float GrayBackground; /* This is used to determine if the
diff --git a/base/gstype2.c b/base/gstype2.c
index a4a44335..e6d70f13 100644
--- a/base/gstype2.c
+++ b/base/gstype2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -49,6 +49,7 @@
BEGIN\
if ( pcis->init_done < 0 )\
{ ipsp->ip = cip, ipsp->dstate = state;\
+ ipsp->ip_end = endp;\
return type2_sbw(pcis, csp, cstack, ipsp, explicit_width);\
}\
END
@@ -130,7 +131,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
cs_ptr csp;
#define clear CLEAR_CSTACK(cstack, csp)
ip_state_t *ipsp = &pcis->ipstack[pcis->ips_count - 1];
- register const byte *cip;
+ register const byte *cip, *endp = NULL;
register crypt_state state;
register int c;
cs_ptr ap;
@@ -176,9 +177,15 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
cip = pgd->bits.data;
if (cip == 0)
return (gs_note_error(gs_error_invalidfont));
+ endp = cip + pgd->bits.size;
goto call;
for (;;) {
- uint c0 = *cip++;
+ uint c0;
+
+ if (endp != NULL && cip > endp)
+ return_error(gs_error_invalidfont);
+
+ c0 = *cip++;
charstring_next(c0, state, c, encrypted);
if (c >= c_num1) {
@@ -223,6 +230,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
return_error(gs_error_invalidfont);
case c_callsubr:
if (CS_CHECK_CSTACK_BOUNDS(csp, cstack)) {
+ CS_CHECK_IPSTACK(&(ipsp[1]), pcis->ipstack);
c = fixed2int_var(*csp) + pdata->subroutineNumberBias;
code = pdata->procs.subr_data
(pfont, c, false, &ipsp[1].cs_data);
@@ -241,6 +249,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
cont: if (ipsp < pcis->ipstack || ipsp->ip == 0)
return (gs_note_error(gs_error_invalidfont));
cip = ipsp->ip;
+ endp = ipsp->ip_end;
state = ipsp->dstate;
continue;
case c_undoc15:
@@ -465,6 +474,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
}
if_debug0m('1', pfont->memory, "\n");
ipsp->ip = cip;
+ ipsp->ip_end = endp;
ipsp->dstate = state;
if (c == c2_cntrmask) {
/****** NYI ******/
@@ -556,6 +566,7 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
continue;
case c2_callgsubr:
if (CS_CHECK_CSTACK_BOUNDS(csp, cstack)) {
+ CS_CHECK_IPSTACK(&(ipsp[1]), pcis->ipstack);
c = fixed2int_var(*csp) + pdata->gsubrNumberBias;
code = pdata->procs.subr_data
(pfont, c, true, &ipsp[1].cs_data);
@@ -573,8 +584,10 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
}
--csp;
ipsp->ip = cip, ipsp->dstate = state;
+ ipsp->ip_end = endp;
++ipsp;
cip = ipsp->cs_data.bits.data;
+ endp = cip + ipsp->cs_data.bits.size;
call:
state = crypt_charstring_seed;
if (encrypted) {
@@ -688,6 +701,8 @@ gs_type2_interpret(gs_type1_state * pcis, const gs_glyph_data_t *pgd,
csp -= 3;
break;
case ce2_neg:
+ if (!CS_CHECK_CSTACK_BOUNDS(csp, cstack))
+ return_error(gs_error_invalidfont);
*csp = -*csp;
break;
case ce2_eq:
diff --git a/base/gstype42.c b/base/gstype42.c
index 3cc92213..5ef1c227 100644
--- a/base/gstype42.c
+++ b/base/gstype42.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -68,6 +68,8 @@ font_proc_font_info(gs_truetype_font_info); /* Type check. */
#define PUTU16(p, n, offs) {(p + offs)[0] = n >> 8 & 255; (p + offs)[1] = n & 255;}
+static byte const ver10[4] = {0x00, 0x01, 0x00, 0x00};
+static byte const ver20[4] = {0x00, 0x02, 0x00, 0x00};
/* ---------------- Font level ---------------- */
@@ -207,7 +209,14 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
if (!memcmp(tab, "cmap", 4))
pfont->data.cmap = offset;
else if (!memcmp(tab, "post", 4)) {
- pfont->data.post_offset = offset;
+ byte ver[4];
+ READ_SFNTS(pfont, offset, 4, ver);
+ if (memcmp(ver, ver10, 4) == 0 || memcmp(ver, ver20, 4) == 0) {
+ pfont->data.post_offset = offset;
+ }
+ else {
+ pfont->data.post_offset = 0;
+ }
}
else if (!memcmp(tab, "glyf", 4)) {
pfont->data.glyf = offset;
@@ -269,8 +278,13 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
pfont->data.os2_offset = offset;
}
}
- loca_size >>= pfont->data.indexToLocFormat + 1;
+ loca_size >>= (pfont->data.indexToLocFormat == 0 ? 1 : 2);
pfont->data.numGlyphs = loca_size - 1;
+ if (pfont->data.numGlyphs > 65535) {
+ pfont->data.numGlyphs = 65535;
+ loca_size = (65536 << (pfont->data.indexToLocFormat == 0 ? 1 : 2));
+ }
+
if (pfont->data.numGlyphs > (int)pfont->data.trueNumGlyphs) {
/* pfont->key_name.chars is ASCIIZ due to copy_font_name. */
char buf[gs_font_name_max + 2];
@@ -403,8 +417,10 @@ gs_type42_font_init(gs_font_type42 * pfont, int subfontID)
qsort(psortary, loca_size, sizeof(gs_type42_font_init_sort_t), gs_type42_font_init_compare);
while (num_valid_loca_elm > 0 && psortary[num_valid_loca_elm - 1].glyph_offset > glyph_size)
num_valid_loca_elm --;
- if (0 == num_valid_loca_elm)
+ if (0 == num_valid_loca_elm) {
+ gs_free_object(pfont->memory, psortary, "gs_type42_font_init(sort loca)");
return_error(gs_error_invalidfont);
+ }
for (i = num_valid_loca_elm; i--;) {
long old_length;
@@ -754,8 +770,6 @@ gs_type42_find_post_name(gs_font_type42 * pfont, gs_glyph glyph, gs_string *gnam
if (pfont->FontType == ft_TrueType) {
if (pfont->data.post_offset != 0) {
byte ver[4];
- byte const ver10[4] = {0x00, 0x01, 0x00, 0x00};
- byte const ver20[4] = {0x00, 0x02, 0x00, 0x00};
READ_SFNTS(pfont, pfont->data.post_offset, 4, ver);
if (!memcmp(ver, ver10, 4)){
@@ -801,6 +815,9 @@ gs_type42_find_post_name(gs_font_type42 * pfont, gs_glyph glyph, gs_string *gnam
}
}
}
+ else {
+ code2 = gs_error_invalidfont;
+ }
}
}
else
@@ -1283,8 +1300,13 @@ parse_pieces(gs_font_type42 *pfont, gs_glyph glyph, gs_glyph *pieces,
memset(&mat, 0, sizeof(mat)); /* arbitrary */
for (i = 0; flags & TT_CG_MORE_COMPONENTS; ++i) {
- if (pieces)
+ if (pieces) {
pieces[i] = U16(gdata + 2) + GS_MIN_GLYPH_INDEX;
+ if (U16(gdata + 2) > pfont->data.numGlyphs) {
+ *pnum_pieces = 0;
+ return_error(gs_error_invalidfont);
+ }
+ }
gs_type42_parse_component(&gdata, &flags, &mat, NULL, pfont, &mat);
}
*pnum_pieces = i;
diff --git a/base/gxblend.c b/base/gxblend.c
index bd36994b..afb5ea94 100644
--- a/base/gxblend.c
+++ b/base/gxblend.c
@@ -2716,7 +2716,7 @@ do_dump_raw_buffer(const gs_memory_t *mem, int num_rows, int width, int n_chan,
dlprintf2("%02d)%s.pam\n",global_index,filename);dflush();
gs_snprintf(full_file_name,sizeof(full_file_name),"%02d)%s.pam",global_index,filename);
fid = gp_fopen(mem,full_file_name,"wb");
- fprintf(fid, "P7\nWIDTH %d\nHEIGHT %d\nDEPTH 2\nMAXVAL %d\nTUPLTYPE GRAYSCALE_ALPHA\nENDHDR\n",
+ gp_fprintf(fid, "P7\nWIDTH %d\nHEIGHT %d\nDEPTH 2\nMAXVAL %d\nTUPLTYPE GRAYSCALE_ALPHA\nENDHDR\n",
width, num_rows, deep ? 65535 : 255);
if (deep) {
for(y=0; y<num_rows; y++)
@@ -2737,7 +2737,7 @@ do_dump_raw_buffer(const gs_memory_t *mem, int num_rows, int width, int n_chan,
dlprintf2("%02d)%s_shape.pgm\n",global_index,filename);dflush();
gs_snprintf(full_file_name,sizeof(full_file_name),"%02d)%s_shape.pgm",global_index,filename);
fid = gp_fopen(mem,full_file_name,"wb");
- fprintf(fid, "P5\n%d %d %d\n",
+ gp_fprintf(fid, "P5\n%d %d %d\n",
width, num_rows, deep ? 65535 : 255);
if (deep) {
for(y=0; y<num_rows; y++)
@@ -2759,7 +2759,7 @@ do_dump_raw_buffer(const gs_memory_t *mem, int num_rows, int width, int n_chan,
dprintf2("%02d)%s.pam\n",global_index,filename);dflush();
gs_snprintf(full_file_name,sizeof(full_file_name),"%02d)%s.pam",global_index,filename);
fid = gp_fopen(mem,full_file_name,"wb");
- fprintf(fid, "P7\nWIDTH %d\nHEIGHT %d\nDEPTH 4\nMAXVAL %d\nTUPLTYPE RGB_ALPHA\nENDHDR\n",
+ gp_fprintf(fid, "P7\nWIDTH %d\nHEIGHT %d\nDEPTH 4\nMAXVAL %d\nTUPLTYPE RGB_ALPHA\nENDHDR\n",
width, num_rows, deep ? 65535 : 255);
if (deep) {
for(y=0; y<num_rows; y++)
@@ -2779,7 +2779,7 @@ do_dump_raw_buffer(const gs_memory_t *mem, int num_rows, int width, int n_chan,
if (n_chan > 4) {
gs_snprintf(full_file_name,sizeof(full_file_name),"%02d)%s_shape.pgm",global_index,filename);
fid = gp_fopen(mem,full_file_name,"wb");
- fprintf(fid, "P5\n%d %d %d\n",
+ gp_fprintf(fid, "P5\n%d %d %d\n",
width, num_rows, deep ? 65535 : 255);
if (deep) {
for(y=0; y<num_rows; y++)
@@ -2798,7 +2798,7 @@ do_dump_raw_buffer(const gs_memory_t *mem, int num_rows, int width, int n_chan,
if (n_chan == 6) {
gs_snprintf(full_file_name,sizeof(full_file_name),"%02d)%s_tags.pgm",global_index,filename);
fid = gp_fopen(mem, full_file_name,"wb");
- fprintf(fid, "P5\n%d %d 255\n", width, num_rows);
+ gp_fprintf(fid, "P5\n%d %d 255\n", width, num_rows);
if (deep) {
for(y=0; y<num_rows; y++)
for(x=0; x<width; x++)
diff --git a/base/gxchar.c b/base/gxchar.c
index 1c534ccb..e3ffa83e 100644
--- a/base/gxchar.c
+++ b/base/gxchar.c
@@ -168,12 +168,19 @@ gx_default_text_begin(gx_device * dev, gs_gstate * pgs1,
if (dev_null == 0)
return_error(gs_error_VMerror);
+
+ /* Set up a null device that forwards xfont requests properly. */
+ /* We have to set the device up here, so the contents are
+ initialised, and safe to free in the event of an error.
+ */
+ gs_make_null_device(dev_null, gs_currentdevice_inline(pgs), mem);
+
/* Do an extra gsave and suppress output */
- if ((code = gs_gsave(pgs)) < 0)
+ if ((code = gs_gsave(pgs)) < 0) {
+ gs_free_object(mem, dev_null, "gx_default_text_begin");
return code;
+ }
penum->level = pgs->level; /* for level check in show_update */
- /* Set up a null device that forwards xfont requests properly. */
- gs_make_null_device(dev_null, gs_currentdevice_inline(pgs), mem);
pgs->ctm_default_set = false;
penum->dev_null = dev_null;
/* Retain this device, since it is referenced from the enumerator. */
diff --git a/base/gxcldev.h b/base/gxcldev.h
index 66020503..708b1779 100644
--- a/base/gxcldev.h
+++ b/base/gxcldev.h
@@ -204,7 +204,7 @@ typedef enum {
cmd_op_path = 0xf0, /* (see below) */
cmd_opv_fill = 0xf0,
cmd_opv_rgapto = 0xf1, /* dx%, dy% */
- /* UNUSED 0xf2 */
+ cmd_opv_lock_pattern = 0xf2, /* lock, id */
cmd_opv_eofill = 0xf3,
cmd_opv_fill_stroke = 0xf4,
cmd_opv_eofill_stroke = 0xf5,
@@ -220,12 +220,12 @@ typedef enum {
/* UNUSED 0xff */
#define cmd_path_op_name_strings\
- "fill", "rgapto", "?f2?", "eofill",\
+ "fill", "rgapto", "lock_pattern", "eofill",\
"fill_stroke", "eofill_stroke", "stroke", "?f7?",\
"?f8?", "polyfill", "?fa?", "?fb?",\
"fill_trapezoid", "?fd?", "?fe?", "?ff?"
-/* unused cmd_op values: 0xf2, 0xf7, 0xf8, 0xfa, 0xfb, 0xfd, 0xfe, 0xff */
+/* unused cmd_op values: 0xf7, 0xf8, 0xfa, 0xfb, 0xfd, 0xfe, 0xff */
} gx_cmd_op;
#define cmd_op_name_strings\
diff --git a/base/gxclimag.c b/base/gxclimag.c
index 4f99e481..c1996569 100644
--- a/base/gxclimag.c
+++ b/base/gxclimag.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1885,6 +1885,17 @@ image_band_box(gx_device * dev, const clist_image_enum * pie, int y, int h,
return (pbox->p.x < pbox->q.x && pbox->p.y < pbox->q.y);
}
+inline static bool
+icc_info_notequal(clist_icc_color_t info1, clist_icc_color_t info2)
+{
+ if (info1.data_cs != info2.data_cs || info1.default_match != info2.default_match ||
+ info1.icc_num_components != info2.icc_num_components || info1.is_lab != info2.is_lab ||
+ info1.icc_hash != info2.icc_hash)
+ return true;
+ else
+ return false;
+}
+
/* Determine which image-related properties are unknown */
static uint /* mask of unknown properties(see pcls->known) */
clist_image_unknowns(gx_device *dev, const clist_image_enum *pie)
@@ -1914,10 +1925,12 @@ clist_image_unknowns(gx_device *dev, const clist_image_enum *pie)
cdev->color_space.space = 0; /* for GC */
} else { /* not masked */
if (cdev->color_space.id != pie->color_space.id ||
- cdev->color_space.space != pie->color_space.space) {
+ cdev->color_space.space != pie->color_space.space ||
+ icc_info_notequal(cdev->color_space.icc_info, pie->color_space.icc_info)) {
unknown |= color_space_known;
cdev->color_space.space = pie->color_space.space;
cdev->color_space = pie->color_space;
+ memcpy(&(cdev->color_space.icc_info), &(pie->color_space.icc_info), sizeof(clist_icc_color_t));
}
}
if (cdev->gs_gstate.fill_adjust.x != pgs->fill_adjust.x ||
diff --git a/base/gxclipm.c b/base/gxclipm.c
index 627f28a5..b4cd6555 100644
--- a/base/gxclipm.c
+++ b/base/gxclipm.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -77,6 +77,7 @@ mask_clip_initialize_device_procs(gx_device *dev)
set_dev_proc(dev, copy_alpha_hl_color, mask_clip_copy_alpha_hl_color);
set_dev_proc(dev, transform_pixel_region, gx_default_transform_pixel_region);
set_dev_proc(dev, fill_stroke_path, gx_forward_fill_stroke_path);
+ set_dev_proc(dev, lock_pattern, gx_forward_lock_pattern);
/* Ideally these defaults would be set up automatically for us. */
set_dev_proc(dev, open_device, gx_default_open_device);
diff --git a/base/gxclist.c b/base/gxclist.c
index 3b778f53..488875ba 100644
--- a/base/gxclist.c
+++ b/base/gxclist.c
@@ -174,6 +174,7 @@ clist_initialize_device_procs(gx_device *dev)
set_dev_proc(dev, copy_alpha_hl_color, clist_copy_alpha_hl_color);
set_dev_proc(dev, process_page, clist_process_page);
set_dev_proc(dev, fill_stroke_path, clist_fill_stroke_path);
+ set_dev_proc(dev, lock_pattern, clist_lock_pattern);
}
/*------------------- Choose the implementation -----------------------
@@ -708,6 +709,7 @@ clist_open(gx_device *dev)
errxit:
/* prevent leak */
gs_free_object(cdev->memory->non_gc_memory, cdev->cache_chunk, "free tile cache for clist");
+ dev->is_open = save_is_open;
cdev->cache_chunk = NULL;
return code;
}
@@ -1543,5 +1545,7 @@ open_c:
pdev->buf = NULL;
}
}
+ if (code < 0)
+ pdev->is_open = save_is_open;
return code;
}
diff --git a/base/gxclpath.c b/base/gxclpath.c
index c202178c..83cb44e0 100644
--- a/base/gxclpath.c
+++ b/base/gxclpath.c
@@ -927,6 +927,28 @@ clist_fill_path(gx_device * dev, const gs_gstate * pgs, gx_path * ppath,
return 0;
}
+int clist_lock_pattern(gx_device * pdev, gs_gstate * pgs, gs_id pattern, int lock)
+{
+ gx_device_clist_writer * const cdev =
+ &((gx_device_clist *)pdev)->writer;
+ byte *dp;
+ int code;
+
+ /* We need to both lock now, and ensure that we lock on reading this back. */
+ code = gx_pattern_cache_entry_set_lock(pgs, pattern, lock);
+ if (code < 0)
+ return code;
+
+ code = set_cmd_put_all_op(&dp, cdev, cmd_opv_lock_pattern,
+ 1 + 1 + sizeof(pattern));
+
+ if (code < 0)
+ return code;
+ dp[1] = lock;
+ memcpy(dp+2, &pattern, sizeof(pattern));
+ return 0;
+}
+
int
clist_fill_stroke_path(gx_device * pdev, const gs_gstate * pgs,
gx_path * ppath,
@@ -1563,6 +1585,47 @@ cmd_put_segment(cmd_segment_writer * psw, byte op,
#define cmd_put_rlineto(psw, operands, notes)\
cmd_put_segment(psw, cmd_opv_rlineto, operands, notes)
+
+/* Bug 693235 shows a problem with a 'large' stroke, that
+ * extends from almost the minimum extent permissible
+ * to almost the positive extent permissible. When we band
+ * that, and play it back, we subtract the y offset of the band
+ * from it, and that causes a very negative number to tip over
+ * to being a very positive number.
+ *
+ * To avoid this, we spot 'far out' entries in the path, and
+ * reduce them to being 'less far out'.
+ *
+ * We pick 'far out' as being outside the central 1/4 of our
+ * 2d plane. This is far larger than is ever going to be used
+ * by a real device (famous last words!).
+ *
+ * We reduce the lines by moving to 1/4 of the way along them.
+ *
+ * If we only ever actually want to render the central 1/16 of
+ * the plane (which is still far more generous than we'd expect),
+ * the reduced lines should be suitably small not to overflow,
+ * and yet not be reduced so much that the reduction is ever visible.
+ *
+ * In practice this gives us a 4 million x 4 million maximum
+ * resolution.
+ */
+
+static int
+far_out(gs_fixed_point out)
+{
+ return (out.y >= max_fixed/2 || out.y <= -(max_fixed/2) || out.x >= max_fixed/2 || out.x <= -(max_fixed/2));
+}
+
+static void
+reduce_line(fixed *m0, fixed *m1, fixed x0, fixed y0, fixed x1, fixed y1)
+{
+ /* We want to find m0, m1, 1/4 of the way from x0, y0 to x1, y1. */
+ /* Sacrifice 2 bits of accuracy to avoid overflow. */
+ *m0 = (x0/4) + 3*(x1/4);
+ *m1 = (y0/4) + 3*(y1/4);
+}
+
/*
* Write a path. We go to a lot of trouble to omit segments that are
* entirely outside the band.
@@ -1716,6 +1779,20 @@ cmd_put_path(gx_device_clist_writer * cldev, gx_clist_state * pcls,
}
/* If we skipped any segments, put out a moveto/lineto. */
if (side && ((open < 0) || (px != out.x || py != out.y || first_point()))) {
+ if (far_out(out)) {
+ /* out is far enough out that we have to worry about wrapping on playback. Reduce the extent. */
+ if (open >= 0) {
+ fixed mid[2];
+ fixed m0, m1;
+ reduce_line(&m0, &m1, out.x, out.y, px, py);
+ mid[0] = m0 - px, mid[1] = m1 - py;
+ code = cmd_put_rlineto(&writer, mid, out_notes);
+ if (code < 0)
+ return code;
+ px = m0, py = m1;
+ }
+ reduce_line(&out.x, &out.y, out.x, out.y, A, B);
+ }
C = out.x - px, D = out.y - py;
if (open < 0) {
first = out;
@@ -1758,6 +1835,20 @@ cmd_put_path(gx_device_clist_writer * cldev, gx_clist_state * pcls,
}
/* If we skipped any segments, put out a moveto/lineto. */
if (side && ((open < 0) || (px != out.x || py != out.y || first_point()))) {
+ if (far_out(out)) {
+ /* out is far enough out that we have to worry about wrapping on playback. Reduce the extent. */
+ if (open >= 0) {
+ fixed mid[2];
+ fixed m0, m1;
+ reduce_line(&m0, &m1, out.x, out.y, px, py);
+ mid[0] = m0 - px, mid[1] = m1 - py;
+ code = cmd_put_rlineto(&writer, mid, out_notes);
+ if (code < 0)
+ return code;
+ px = m0, py = m1;
+ }
+ reduce_line(&out.x, &out.y, out.x, out.y, A, B);
+ }
C = out.x - px, D = out.y - py;
if (open < 0) {
first = out;
@@ -1805,6 +1896,20 @@ cmd_put_path(gx_device_clist_writer * cldev, gx_clist_state * pcls,
/* we skipped any segments at the beginning of the path. */
close:if (side != start_side) { /* If we skipped any segments, put out a moveto/lineto. */
if (side && (px != out.x || py != out.y || first_point())) {
+ if (far_out(out)) {
+ /* out is far enough out that we have to worry about wrapping on playback. Reduce the extent. */
+ if (open >= 0) {
+ fixed mid[2];
+ fixed m0, m1;
+ reduce_line(&m0, &m1, out.x, out.y, px, py);
+ mid[0] = m0 - px, mid[1] = m1 - py;
+ code = cmd_put_rlineto(&writer, mid, out_notes);
+ if (code < 0)
+ return code;
+ px = m0, py = m1;
+ }
+ reduce_line(&out.x, &out.y, out.x, out.y, A, B);
+ }
C = out.x - px, D = out.y - py;
code = cmd_put_rlineto(&writer, &C, out_notes);
if (code < 0)
diff --git a/base/gxclpath.h b/base/gxclpath.h
index c334222c..ccf12353 100644
--- a/base/gxclpath.h
+++ b/base/gxclpath.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -132,6 +132,7 @@ extern const char *cmd_extend_op_names[256];
dev_proc_fill_path(clist_fill_path);
dev_proc_stroke_path(clist_stroke_path);
dev_proc_fill_stroke_path(clist_fill_stroke_path);
+dev_proc_lock_pattern(clist_lock_pattern);
dev_proc_fill_parallelogram(clist_fill_parallelogram);
dev_proc_fill_triangle(clist_fill_triangle);
diff --git a/base/gxclrast.c b/base/gxclrast.c
index c38faa49..d3049ebc 100644
--- a/base/gxclrast.c
+++ b/base/gxclrast.c
@@ -747,9 +747,9 @@ in: /* Initialize for a new page. */
op = *cbp++;
#ifdef DEBUG
if (gs_debug_c('L')) {
- long offset = (long)clist_file_offset(st, cbp - 1 - cbuf.data);
+ int64_t offset = clist_file_offset(st, cbp - 1 - cbuf.data);
- dmlprintf1(mem, "[L] %ld:", offset);
+ dmlprintf1(mem, "[L] %"PRIu64":", offset);
clist_debug_op(mem, cbp-1);
}
#endif
@@ -1146,6 +1146,8 @@ do_opv_set_bits:
cbp = cmd_read_data(&cbuf, plane_bits, 1, cbp);
if (width_bytes > 0 && state.rect.height > 0)
memset(plane_bits+1, *plane_bits, width_bytes * state.rect.height - 1);
+ if (pln == 0)
+ source = data_bits;
} else if (compression) { /* Decompress the image data. */
stream_cursor_read r;
@@ -2014,14 +2016,26 @@ idata: data_size = 0;
}
continue;
case cmd_op_path >> 4:
- {
+ if (op == cmd_opv_rgapto)
+ goto rgapto;
+ else if (op == cmd_opv_lock_pattern) {
+ gs_id id;
+ int lock = *cbp++;
+ cmd_get_value(id, cbp);
+ if_debug2m('L', mem, "id=0x%lx, lock=%d\n", id, lock);
+ /* We currently lock the pattern in all the bands, even in ones
+ * where we haven't used the pattern. This can cause the following
+ * call to return with 'undefined' because the pattern is not
+ * found. Just swallow this error and continue. */
+ code = gx_pattern_cache_entry_set_lock(&gs_gstate, id, lock);
+ if (code == gs_error_undefined)
+ code = 0;
+ if (code < 0)
+ goto out;
+ continue;
+ } else {
gx_path fpath;
- gx_path *ppath;
-
- if (op == cmd_opv_rgapto)
- goto rgapto;
-
- ppath = &path;
+ gx_path *ppath = &path;
if_debug0m('L', mem, "\n");
/* if in clip, flatten path first */
@@ -2059,26 +2073,6 @@ idata: data_size = 0;
code = (*dev_proc(tdev, fill_stroke_path))(tdev, &gs_gstate, ppath,
&fill_params, &fill_color,
&stroke_params, &stroke_color, pcpath);
- /* if the color is a pattern, it may have had the "is_locked" flag set */
- /* clear those now (see do_fill_stroke). */
- if (gx_dc_is_pattern1_color(&stroke_color)) {
- if (stroke_color.colors.pattern.p_tile != NULL) {
- gs_id id = stroke_color.colors.pattern.p_tile->id;
-
- code = gx_pattern_cache_entry_set_lock(&gs_gstate, id, false);
- if (code < 0)
- return code; /* unlock failed -- should not happen */
- }
- }
- if (gx_dc_is_pattern1_color(&fill_color)) {
- if (fill_color.colors.pattern.p_tile != NULL) {
- gs_id id = fill_color.colors.pattern.p_tile->id;
-
- code = gx_pattern_cache_entry_set_lock(&gs_gstate, id, false);
- if (code < 0)
- return code; /* unlock failed -- should not happen */
- }
- }
break;
case cmd_opv_stroke:
stroke_params.flatness = gs_gstate.flatness;
diff --git a/base/gxclread.c b/base/gxclread.c
index 03945e81..b17d5a1e 100644
--- a/base/gxclread.c
+++ b/base/gxclread.c
@@ -294,6 +294,12 @@ buffer_segment_index(const stream_band_read_state *ss, uint buffer_offset, uint
return i;
}
}
+ /* Now cope with the case where we've read exactly to the end of the buffer.
+ * There might be more data still to come. */
+ if (buffer_offset == offset) {
+ *poffset0 = offset0;
+ return i-1;
+ }
#ifdef EXTRA_OFFSET_MAP_DEBUGGING
dmlprintf1(ss->local_memory, "buffer_segment_index fail: buffer_offset=%d not found\n", buffer_offset);
exit(1);
diff --git a/base/gxclthrd.c b/base/gxclthrd.c
index 6af40a7f..c12af70c 100644
--- a/base/gxclthrd.c
+++ b/base/gxclthrd.c
@@ -113,12 +113,15 @@ setup_device_and_mem_for_thread(gs_memory_t *chunk_base_mem, gx_device *dev, boo
* will spot the same profile being used, and treat it as a no-op. Otherwise it will try to find
* a profile with the 'special' name "OI_PROFILE" and throw an error.
*/
- if (!gscms_is_threadsafe() || (dev->icc_struct != NULL &&
- ((dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE] != NULL &&
- strncmp(dev->icc_struct->device_profile[GS_DEFAULT_DEVICE_PROFILE]->name,
- OI_PROFILE, strlen(OI_PROFILE)) == 0)
- || (dev->icc_struct->proof_profile != NULL &&
- strncmp(dev->icc_struct->proof_profile->name, OI_PROFILE, strlen(OI_PROFILE)) == 0)))) {
+#define DEV_PROFILE_IS(DEV, PROFILE, MATCH) \
+ ((DEV)->icc_struct != NULL &&\
+ (DEV)->icc_struct->PROFILE != NULL &&\
+ strcmp((DEV)->icc_struct->PROFILE->name, MATCH) == 0)
+
+ if (bg_print ||
+ !gscms_is_threadsafe() ||
+ DEV_PROFILE_IS(dev, device_profile[GS_DEFAULT_DEVICE_PROFILE], OI_PROFILE) ||
+ DEV_PROFILE_IS(dev, proof_profile, OI_PROFILE)) {
ndev->icc_struct = gsicc_new_device_profile_array(ndev);
if (!ndev->icc_struct) {
emprintf1(ndev->memory,
@@ -252,7 +255,7 @@ setup_device_and_mem_for_thread(gs_memory_t *chunk_base_mem, gx_device *dev, boo
}
rc_increment(*cachep);
ncdev->icc_cache_cl = *cachep;
- } else if ((ncdev->icc_cache_cl = gsicc_cache_new(thread_mem)) == NULL)
+ } else if ((ncdev->icc_cache_cl = gsicc_cache_new(thread_mem->thread_safe_memory)) == NULL)
goto out_cleanup;
}
if (bg_print) {
diff --git a/base/gxcmap.c b/base/gxcmap.c
index 067d18b7..bdf83cba 100644
--- a/base/gxcmap.c
+++ b/base/gxcmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1361,6 +1361,11 @@ cmap_separation_halftoned(frac all, gx_device_color * pdc,
for (i = 0; i < pgs->color_component_map.num_colorants; i++)
cm_comps[i] = comp_value;
} else {
+ if (pgs->color_component_map.sep_type == SEP_NONE) {
+ color_set_null(pdc);
+ return;
+ }
+
/* map to the color model */
map_components_to_colorants(&all, &(pgs->color_component_map), cm_comps,
pgs->color_component_map.num_colorants);
@@ -1427,8 +1432,12 @@ cmap_separation_direct(frac all, gx_device_color * pdc, const gs_gstate * pgs,
if (des_profile->data_cs == gsCIELAB || des_profile->islab) {
use_rgb2dev_icc = true;
}
- }
- else {
+ } else {
+ if (pgs->color_component_map.sep_type == SEP_NONE) {
+ color_set_null(pdc);
+ return;
+ }
+
/* map to the color model */
map_components_to_colorants(&comp_value, &(pgs->color_component_map), cm_comps,
pgs->color_component_map.num_colorants);
@@ -1532,6 +1541,11 @@ cmap_devicen_halftoned(const frac * pcc,
cmm_dev_profile_t *dev_profile = NULL;
cmm_profile_t *des_profile = NULL;
+ if (pcs->params.device_n.all_none == true) {
+ color_set_null(pdc);
+ return;
+ }
+
dev_proc(dev, get_profile)(dev, &dev_profile);
gsicc_extract_profile(dev->graphics_type_tag,
dev_profile, &des_profile, &render_cond);
@@ -1579,6 +1593,11 @@ cmap_devicen_direct(const frac * pcc,
cmm_dev_profile_t *dev_profile = NULL;
cmm_profile_t *des_profile = NULL;
+ if (pcs->params.device_n.all_none == true) {
+ color_set_null(pdc);
+ return;
+ }
+
dev_proc(dev, get_profile)(dev, &dev_profile);
gsicc_extract_profile(dev->graphics_type_tag,
dev_profile, &des_profile, &render_cond);
diff --git a/base/gxcpath.c b/base/gxcpath.c
index 437b0654..c1c5453f 100644
--- a/base/gxcpath.c
+++ b/base/gxcpath.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -562,9 +562,11 @@ cpath_set_rectangle(gx_clip_path * pcpath, gs_fixed_rect * pbox)
int code = cpath_alloc_list(&pcpath->rect_list, pcpath->path.memory,
"gx_cpath_from_rectangle");
- rc_decrement(rlist, "gx_cpath_from_rectangle");
- if (code < 0)
+ if (code < 0) {
+ pcpath->rect_list = rlist;
return code;
+ }
+ rc_decrement(rlist, "gx_cpath_from_rectangle");
rlist = pcpath->rect_list;
}
cpath_init_rectangle(pcpath, pbox);
diff --git a/base/gxdevcli.h b/base/gxdevcli.h
index 2476ea33..5c9831b9 100644
--- a/base/gxdevcli.h
+++ b/base/gxdevcli.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -705,7 +705,6 @@ typedef struct gdev_nupcontrol_s {
typedef struct gdev_pagelist_s {
rc_header rc;
char *Pages;
- int PagesSize;
} gdev_pagelist;
#define dev_t_proc_initialize_device_procs(proc, dev_t)\
@@ -997,6 +996,16 @@ typedef enum FILTER_FLAGS {
#define dev_proc_fill_stroke_path(proc)\
dev_t_proc_fill_stroke_path(proc, gx_device)
+ /* Added in release 9.57 */
+
+#define dev_t_proc_lock_pattern(proc, dev_t)\
+ int proc(dev_t *dev,\
+ gs_gstate *pgs,\
+ gs_id pattern_id,\
+ int lock)
+#define dev_proc_lock_pattern(proc)\
+ dev_t_proc_lock_pattern(proc, gx_device)
+
/* Added in release 3.60 */
#define dev_t_proc_fill_mask(proc, dev_t)\
@@ -1508,6 +1517,7 @@ typedef struct {
dev_t_proc_process_page((*process_page), dev_t);\
dev_t_proc_transform_pixel_region((*transform_pixel_region), dev_t);\
dev_t_proc_fill_stroke_path((*fill_stroke_path), dev_t);\
+ dev_t_proc_lock_pattern((*lock_pattern), dev_t);\
}
/*
diff --git a/base/gxdevice.h b/base/gxdevice.h
index d9b0134d..99dd610e 100644
--- a/base/gxdevice.h
+++ b/base/gxdevice.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -318,6 +318,7 @@ dev_proc_copy_alpha_hl_color(gx_default_copy_alpha_hl_color);
dev_proc_process_page(gx_default_process_page);
dev_proc_transform_pixel_region(gx_default_transform_pixel_region);
dev_proc_fill_stroke_path(gx_default_fill_stroke_path);
+dev_proc_lock_pattern(gx_default_lock_pattern);
dev_proc_begin_transparency_group(gx_default_begin_transparency_group);
dev_proc_end_transparency_group(gx_default_end_transparency_group);
dev_proc_begin_transparency_mask(gx_default_begin_transparency_mask);
@@ -418,6 +419,7 @@ dev_proc_strip_tile_rect_devn(gx_forward_strip_tile_rect_devn);
dev_proc_copy_alpha_hl_color(gx_forward_copy_alpha_hl_color);
dev_proc_transform_pixel_region(gx_forward_transform_pixel_region);
dev_proc_fill_stroke_path(gx_forward_fill_stroke_path);
+dev_proc_lock_pattern(gx_forward_lock_pattern);
void gx_forward_device_initialize_procs(gx_device *dev);
/* ---------------- Implementation utilities ---------------- */
@@ -665,13 +667,17 @@ int gs_is_pdf14trans_compositor(const gs_composite_t * pct);
#define subclass_common\
t_dev_proc_composite *saved_compositor_method;\
- gx_device_forward *forwarding_dev
+ gx_device_forward *forwarding_dev;\
+ gx_device *pre_composite_device;\
+ void (*saved_finalize_method)(gx_device *)
typedef int (t_dev_proc_composite) (gx_device *dev, gx_device **pcdev, const gs_composite_t *pcte, gs_gstate *pgs, gs_memory_t *memory, gx_device *cdev);
typedef struct {
t_dev_proc_composite *saved_compositor_method;
gx_device_forward *forwarding_dev;
+ gx_device *pre_composite_device;
+ void (*saved_finalize_method)(gx_device *);
} generic_subclass_data;
int gx_copy_device_procs(gx_device *dest, const gx_device *src, const gx_device *prototype);
diff --git a/base/gxdevsop.h b/base/gxdevsop.h
index cfde902a..89eed4b3 100644
--- a/base/gxdevsop.h
+++ b/base/gxdevsop.h
@@ -353,7 +353,7 @@ enum {
gxdso_is_encoding_direct,
/* gxdso_event_info:
* data = dev_param_req_t
- * size = sizeof(dev_param-req_t
+ * size = sizeof(dev_param_req_t)
* Passes a single name in request->Param, naming the event which occurred.
* Used to send a warning to pdfwrite that some event has happened we want to know about.
* Currently this is used in pdf_font.ps to signal that a substittue font has been
@@ -450,6 +450,14 @@ enum {
*/
gxdso_overprintsim_state,
+ /* Get/Set information about the overprint op state.
+ * data = overprint op state to set (OP_STATE_{NONE, FILL, STROKE}) or -1
+ * for no change.
+ * size = 0
+ * Returns -1 if unhandled, otherwise the current state.
+ */
+ gxdso_overprint_op,
+
/* Add new gxdso_ keys above this. */
gxdso_pattern__LAST
};
diff --git a/base/gxdownscale.c b/base/gxdownscale.c
index 1f8138cb..8ed12267 100644
--- a/base/gxdownscale.c
+++ b/base/gxdownscale.c
@@ -2168,7 +2168,7 @@ static int
planar_skew_line(gx_downscale_liner *liner_, void *params_, int row)
{
liner_skew *liner = (liner_skew *)liner_;
- int code;
+ int code = 0;
gs_get_bits_params_t *params = (gs_get_bits_params_t *)params_;
int i;
diff --git a/base/gxfapi.h b/base/gxfapi.h
index 1ff8018f..f9ba46d3 100644
--- a/base/gxfapi.h
+++ b/base/gxfapi.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -200,6 +200,8 @@ struct gs_fapi_font_s
int (*serialize_tt_font) (gs_fapi_font *ff, void *buf, int buf_size);
+ int (*retrieve_tt_font) (gs_fapi_font *ff, void **buf, int *buf_size);
+
int (*get_charstring) (gs_fapi_font *ff, int index, byte *buf, ushort buf_length);
int (*get_charstring_name) (gs_fapi_font *ff, int index, byte *buf, ushort buf_length);
diff --git a/base/gxfill.c b/base/gxfill.c
index e33cb778..81b5ba50 100644
--- a/base/gxfill.c
+++ b/base/gxfill.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -670,6 +670,15 @@ gx_default_fill_path(gx_device * pdev, const gs_gstate * pgs,
return gx_general_fill_path(pdev, pgs, ppath, params, pdevc, pcpath);
}
+int
+gx_default_lock_pattern(gx_device *pdev,
+ gs_gstate *pgs,
+ gs_id pattern_id,
+ int lock)
+{
+ return gx_pattern_cache_entry_set_lock(pgs, pattern_id, lock);
+}
+
/*
* Fill/Stroke a path. This is the default implementation of the driver
* fill_path procedure.
diff --git a/base/gxgstate.h b/base/gxgstate.h
index b1ce6a08..c199a958 100644
--- a/base/gxgstate.h
+++ b/base/gxgstate.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -270,7 +270,7 @@ struct gs_gstate_s {
gsicc_manager_t *icc_manager; /* ICC color manager, profile */
gsicc_link_cache_t *icc_link_cache; /* ICC linked transforms */
gsicc_profile_cache_t *icc_profile_cache; /* ICC profiles from PS. */
- gsicc_blacktext_state_t *black_text_state; /* Used to store and restore cs for black text */
+ gsicc_blacktextvec_state_t *black_textvec_state; /* Used to store and restore cs for black text */
CUSTOM_COLOR_PTR /* Pointer to custom color callback struct */
const gx_color_map_procs *
@@ -378,7 +378,7 @@ struct gs_gstate_s {
s->icc_link_cache = __state_init.icc_link_cache; \
s->icc_profile_cache = __state_init.icc_profile_cache; \
s->get_cmap_procs = __state_init.get_cmap_procs; \
- s->black_text_state = NULL; \
+ s->black_textvec_state = NULL; \
s->show_gstate = NULL; \
s->is_fill_color = 1; \
s->strokeconstantalpha = 1.0; \
@@ -422,7 +422,7 @@ struct_proc_finalize(gs_gstate_finalize);
m(17, font) \
m(18, root_font) \
m(19, show_gstate) \
- m(20, black_text_state)
+ m(20, black_textvec_state)
#define gs_gstate_num_ptrs 21
diff --git a/base/gxipixel.c b/base/gxipixel.c
index 2f367e14..8b81aaa5 100644
--- a/base/gxipixel.c
+++ b/base/gxipixel.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -434,7 +434,7 @@ gx_image_enum_begin(gx_device * dev, const gs_gstate * pgs,
/* Can we restrict the amount of image we need? */
while (pcpath) /* So we can break out of it */
{
- gs_rect rect, rect_out;
+ gs_rect rect, rect_src;
gs_matrix mi;
const gs_matrix *m = pgs != NULL ? &ctm_only(pgs) : NULL;
gs_fixed_rect obox;
@@ -449,15 +449,42 @@ gx_image_enum_begin(gx_device * dev, const gs_gstate * pgs,
rect.p.y = fixed2float(obox.p.y);
rect.q.x = fixed2float(obox.q.x);
rect.q.y = fixed2float(obox.q.y);
- code = gs_bbox_transform(&rect, &mi, &rect_out);
+ /* rect is in destination space. Calculate rect_src, in source space. */
+ code = gs_bbox_transform(&rect, &mi, &rect_src);
if (code < 0) {
/* Give up trying to shrink the render/decode boxes, but continue processing */
break;
}
- irect.p.x = (int)(rect_out.p.x-1.0);
- irect.p.y = (int)(rect_out.p.y-1.0);
- irect.q.x = (int)(rect_out.q.x+1.0);
- irect.q.y = (int)(rect_out.q.y+1.0);
+ /* Need to expand the region to allow for the fact that the mitchell
+ * scaler reads multiple pixels in. */
+ /* If mi.{xx,yy} > 1 then we are downscaling. During downscaling,
+ * the support increases to ensure that we don't lose pixels contributions
+ * entirely. */
+ {
+ float support = any_abs(mi.xx);
+ int isupport;
+ if (any_abs(mi.yy) > support)
+ support = any_abs(mi.yy);
+ if (any_abs(mi.xy) > support)
+ support = any_abs(mi.xy);
+ if (any_abs(mi.yx) > support)
+ support = any_abs(mi.yx);
+ /* If upscaling (support < 1) then we need 2 extra lines on each side of the source region
+ * (2 being the maximum support for mitchell scaling).
+ * If downscaling, then the number of lines is increased to avoid individual
+ * contributions dropping out. */
+ isupport = 2; /* Mitchell support. */
+ if (support > 1)
+ isupport = (int)ceil(isupport * support);
+ rect_src.p.x -= isupport;
+ rect_src.p.y -= isupport;
+ rect_src.q.x += isupport;
+ rect_src.q.y += isupport;
+ }
+ irect.p.x = (int)floor(rect_src.p.x);
+ irect.p.y = (int)floor(rect_src.p.y);
+ irect.q.x = (int)ceil(rect_src.q.x);
+ irect.q.y = (int)ceil(rect_src.q.y);
/* We therefore only need to render within irect. Restrict rrect to this. */
if (penum->rrect.x < irect.p.x) {
penum->rrect.w -= irect.p.x - penum->rrect.x;
@@ -481,29 +508,6 @@ gx_image_enum_begin(gx_device * dev, const gs_gstate * pgs,
if (penum->rrect.h < 0)
penum->rrect.h = 0;
}
- /* Need to expand the region to allow for the fact that the mitchell
- * scaler reads multiple pixels in. */
- /* If mi.{xx,yy} > 1 then we are downscaling. During downscaling,
- * the support increases to ensure that we don't lose pixels contributions
- * entirely. */
- /* I do not understand the need for the +/- 1 fudge factors,
- * but they seem to be required. Increasing the decode rectangle can
- * never be bad at least... RJW */
- {
- float support = any_abs(mi.xx);
- int isupport;
- if (any_abs(mi.yy) > support)
- support = any_abs(mi.yy);
- if (any_abs(mi.xy) > support)
- support = any_abs(mi.xy);
- if (any_abs(mi.yx) > support)
- support = any_abs(mi.yx);
- isupport = (int)(MAX_ISCALE_SUPPORT * (support+1)) + 1;
- irect.p.x -= isupport;
- irect.p.y -= isupport;
- irect.q.x += isupport;
- irect.q.y += isupport;
- }
if (penum->drect.x < irect.p.x) {
penum->drect.w -= irect.p.x - penum->drect.x;
if (penum->drect.w < 0)
diff --git a/base/gxiscale.c b/base/gxiscale.c
index 7cd34f9b..90e52786 100644
--- a/base/gxiscale.c
+++ b/base/gxiscale.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -643,6 +643,25 @@ gs_image_class_0_interpolate(gx_image_enum * penum, irender_proc_t *render_fn)
&image_render_interpolate_landscape_icc);
return 0;
} else {
+
+ /* If we are doing fastcolor we may still have
+ a decode situation. To avoid yet another
+ variable, use the existing one in the
+ icc setup */
+ if (dev_profile->usefastcolor) {
+ int k;
+ int src_num_comp = cs_num_components(penum->pcs);
+
+ penum->icc_setup.need_decode = false;
+ /* Check if we need to do any decoding. If yes, then that will slow us down */
+ for (k = 0; k < src_num_comp; k++) {
+ if ( penum->map[k].decoding != sd_none ) {
+ penum->icc_setup.need_decode = true;
+ break;
+ }
+ }
+ }
+
*render_fn = (penum->posture == image_portrait ?
&image_render_interpolate :
&image_render_interpolate_landscape);
@@ -677,8 +696,15 @@ initial_decode(gx_image_enum * penum, const byte * buffer, int data_x, int h,
cs is neither a device color nor a CIE color (i.e. if it's DeviceN,
Index or Separation) The color space cannot be a pattern for an image */
need_decode = (penum->icc_setup.need_decode || is_devn_sep_index);
- } else
- need_decode = is_devn_sep_index;
+ } else {
+ cmm_dev_profile_t *dev_profile;
+
+ dev_proc(penum->dev, get_profile)(penum->dev, &dev_profile);
+ if (dev_profile != NULL && dev_profile->usefastcolor)
+ need_decode = (penum->icc_setup.need_decode || is_devn_sep_index);
+ else
+ need_decode = is_devn_sep_index;
+ }
if (h != 0) {
/* Convert the unpacked data to concrete values in the source buffer. */
diff --git a/base/gxp1fill.c b/base/gxp1fill.c
index 15b395da..519e853c 100644
--- a/base/gxp1fill.c
+++ b/base/gxp1fill.c
@@ -368,8 +368,9 @@ gx_dc_pattern_fill_rectangle(const gx_device_color * pdevc, int x, int y,
bits = &ptile->tbits;
code = tile_fill_init(&state, pdevc, dev, false); /* This _may_ allocate state.cdev */
- if (code < 0)
- return code;
+ if (code < 0) {
+ goto exit;
+ }
if (ptile->is_simple && ptile->cdev == NULL) {
int px =
imod(-(int)fastfloor(ptile->step_matrix.tx - state.phase.x + 0.5),
@@ -417,6 +418,7 @@ gx_dc_pattern_fill_rectangle(const gx_device_color * pdevc, int x, int y,
&tbits, tile_pattern_clist);
}
}
+exit:
if (CLIPDEV_INSTALLED) {
tile_clip_free((gx_device_tile_clip *)state.cdev);
state.cdev = NULL;
diff --git a/base/gxpaint.c b/base/gxpaint.c
index 2e4955c1..cd0f573e 100644
--- a/base/gxpaint.c
+++ b/base/gxpaint.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -72,8 +72,8 @@ gx_stroke_fill(gx_path * ppath, gs_gstate * pgs)
(dev, (const gs_gstate *)pgs, ppath, &params,
gs_currentdevicecolor_inline(pgs), pcpath);
- if (pgs->black_text_state) {
- gsicc_restore_black_text(pgs);
+ if (pgs->black_textvec_state) {
+ gsicc_restore_blacktextvec(pgs, true);
}
return code;
@@ -103,8 +103,8 @@ gx_fill_stroke_path(gs_gstate * pgs, int rule)
&stroke_params, gs_swappeddevicecolor_inline(pgs),
pcpath);
- if (pgs->black_text_state) {
- gsicc_restore_black_text(pgs);
+ if (pgs->black_textvec_state) {
+ gsicc_restore_blacktextvec(pgs, true);
}
return code;
diff --git a/base/gxpcmap.c b/base/gxpcmap.c
index 86af0885..e8b28b64 100644
--- a/base/gxpcmap.c
+++ b/base/gxpcmap.c
@@ -40,6 +40,8 @@
#include "gdevp14.h"
#include "gxgetbit.h"
#include "gscoord.h"
+#include "gsicc_blacktext.h"
+#include "gscspace.h"
#if RAW_PATTERN_DUMP
unsigned int global_pat_index = 0;
@@ -133,6 +135,7 @@ pattern_accum_initialize_device_procs(gx_device *dev)
set_dev_proc(dev, strip_tile_rect_devn, gx_default_strip_tile_rect_devn);
set_dev_proc(dev, transform_pixel_region, gx_default_transform_pixel_region);
set_dev_proc(dev, fill_stroke_path, gx_default_fill_stroke_path);
+ set_dev_proc(dev, lock_pattern, gx_default_lock_pattern);
set_dev_proc(dev, copy_alpha_hl_color, gx_default_copy_alpha_hl_color);
}
@@ -946,7 +949,7 @@ gx_pattern_cache_free_entry(gx_pattern_cache * pcache, gx_color_tile * ctile)
if (ctile->ttrans != NULL) {
if_debug2m('v', mem,
- "[v*] Freeing trans pattern from cache, uid = %ld id = %ld\n",
+ "[v*] Freeing trans pattern from cache, uid = %ld id = %u\n",
ctile->uid.id, ctile->id);
if ( ctile->ttrans->pdev14 == NULL) {
/* This can happen if we came from the clist */
@@ -979,6 +982,41 @@ gx_pattern_cache_free_entry(gx_pattern_cache * pcache, gx_color_tile * ctile)
}
}
+/*
+ Historically, the pattern cache has used a very simple hashing
+ scheme whereby pattern A goes into slot idx = (A.id % num_tiles).
+ Unfortunately, now we allow tiles to be 'locked' into the
+ pattern cache, we might run into the case where we want both
+ tiles A and B to be in the cache at once where:
+ (A.id % num_tiles) == (B.id % num_tiles).
+
+ We have a maximum of 2 locked tiles, and one of those can be
+ placed while the other one is locked. So we only need to cope
+ with a single 'collision'.
+
+ We therefore allow tiles to either go in at idx or at
+ (idx + 1) % num_tiles. This means we need to be prepared to
+ search a bit further for them, hence we now have 2 helper
+ functions to do this.
+*/
+
+/* We can have at most 1 locked tile while looking for a place to
+ * put another tile. */
+gx_color_tile *
+gx_pattern_cache_find_tile_for_id(gx_pattern_cache *pcache, gs_id id)
+{
+ gx_color_tile *ctile = &pcache->tiles[id % pcache->num_tiles];
+ gx_color_tile *ctile2 = &pcache->tiles[(id+1) % pcache->num_tiles];
+ if (ctile->id == id || ctile->id == gs_no_id)
+ return ctile;
+ if (ctile2->id == id || ctile2->id == gs_no_id)
+ return ctile2;
+ if (!ctile->is_locked)
+ return ctile;
+ return ctile2;
+}
+
+
/* Given the size of a new pattern tile, free entries from the cache until */
/* enough space is available (or nothing left to free). */
/* This will allow 1 oversized entry */
@@ -1123,7 +1161,7 @@ gx_pattern_cache_add_entry(gs_gstate * pgs,
used = size_b + size_c;
}
id = pinst->id;
- ctile = &pcache->tiles[id % pcache->num_tiles];
+ ctile = gx_pattern_cache_find_tile_for_id(pcache, id);
gx_pattern_cache_free_entry(pcache, ctile); /* ensure that this cache slot is empty */
ctile->id = id;
ctile->is_planar = pinst->is_planar;
@@ -1156,7 +1194,7 @@ gx_pattern_cache_add_entry(gs_gstate * pgs,
ctile->tmask.data = 0;
if (trans != 0) {
if_debug2m('v', pgs->memory,
- "[v*] Adding trans pattern to cache, uid = %ld id = %ld\n",
+ "[v*] Adding trans pattern to cache, uid = %ld id = %u\n",
ctile->uid.id, ctile->id);
ctile->ttrans = trans;
}
@@ -1193,15 +1231,13 @@ gx_pattern_cache_add_entry(gs_gstate * pgs,
int
gx_pattern_cache_entry_set_lock(gs_gstate *pgs, gs_id id, bool new_lock_value)
{
- gx_pattern_cache *pcache;
gx_color_tile *ctile;
int code = ensure_pattern_cache(pgs);
if (code < 0)
return code;
- pcache = pgs->pattern_cache;
- ctile = &pcache->tiles[id % pcache->num_tiles];
- if (ctile->id != id)
+ ctile = gx_pattern_cache_find_tile_for_id(pgs->pattern_cache, id);
+ if (ctile == NULL)
return_error(gs_error_undefined);
ctile->is_locked = new_lock_value;
return 0;
@@ -1218,7 +1254,7 @@ gx_pattern_cache_get_entry(gs_gstate * pgs, gs_id id, gx_color_tile ** pctile)
if (code < 0)
return code;
pcache = pgs->pattern_cache;
- ctile = &pcache->tiles[id % pcache->num_tiles];
+ ctile = gx_pattern_cache_find_tile_for_id(pcache, id);
gx_pattern_cache_free_entry(pgs->pattern_cache, ctile);
ctile->id = id;
*pctile = ctile;
@@ -1245,7 +1281,7 @@ gx_pattern_cache_add_dummy_entry(gs_gstate *pgs,
if (code < 0)
return code;
pcache = pgs->pattern_cache;
- ctile = &pcache->tiles[id % pcache->num_tiles];
+ ctile = gx_pattern_cache_find_tile_for_id(pcache, id);
gx_pattern_cache_free_entry(pcache, ctile);
ctile->id = id;
ctile->depth = depth;
@@ -1490,7 +1526,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_gstate * pgs,
if (code < 0)
goto fail;
if (pinst->templat.uses_transparency) {
- if_debug0m('v', mem, "gx_pattern_load: pushing the pdf14 compositor device into this graphics state\n");
+ if_debug1m('v', mem, "gx_pattern_load: pushing the pdf14 compositor device into this graphics state pat_id = %u\n", pinst->id);
if ((code = gs_push_pdf14trans_device(saved, true, false, 0, 0)) < 0) /* spot_color_count taken from pdf14 target values */
return code;
saved->device->is_open = true;
@@ -1550,7 +1586,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_gstate * pgs,
/* Send the compositor command to close the PDF14 device */
code = gs_pop_pdf14trans_device(saved, true);
if (code < 0)
- return code;
+ goto fail;
} else {
/* Not a clist, get PDF14 buffer information */
code =
@@ -1561,7 +1597,7 @@ gx_pattern_load(gx_device_color * pdc, const gs_gstate * pgs,
/* PDF14 device (and buffer) is destroyed when pattern cache
entry is removed */
if (code < 0)
- return code;
+ goto fail;
}
}
/* We REALLY don't like the following cast.... */
@@ -1610,6 +1646,8 @@ fail:
cdev->common.data = 0;
}
dev_proc(adev, close_device)((gx_device *)adev);
+ gx_device_set_target(adev, NULL);
+ rc_decrement(adev, "gx_pattern_load");
gs_gstate_free_chain(saved);
return code;
}
@@ -1633,10 +1671,29 @@ gs_pattern1_remap_color(const gs_client_color * pc, const gs_color_space * pcs,
return 0;
}
if (pinst->templat.PaintType == 2) { /* uncolored */
- if (pcs->base_space)
- code = (pcs->base_space->type->remap_color)
- (pc, pcs->base_space, pdc, pgs, dev, select);
- else
+ if (pcs->base_space) {
+ if (dev->icc_struct != NULL && dev->icc_struct->blackvector) {
+ gs_client_color temppc;
+ gs_color_space *graycs = gs_cspace_new_DeviceGray(pgs->memory);
+
+ if (graycs == NULL) {
+ code = (pcs->base_space->type->remap_color)
+ (pc, pcs->base_space, pdc, pgs, dev, select);
+ } else {
+ if (gsicc_is_white_blacktextvec((gs_gstate*) pgs,
+ dev, (gs_color_space*) pcs, (gs_client_color*) pc))
+ temppc.paint.values[0] = 1.0;
+ else
+ temppc.paint.values[0] = 0.0;
+ code = (graycs->type->remap_color)
+ (&temppc, graycs, pdc, pgs, dev, select);
+ rc_decrement_cs(graycs, "gs_pattern1_remap_color");
+ }
+ } else {
+ code = (pcs->base_space->type->remap_color)
+ (pc, pcs->base_space, pdc, pgs, dev, select);
+ }
+ } else
code = gs_note_error(gs_error_unregistered);
if (code < 0)
return code;
diff --git a/base/gxpcolor.h b/base/gxpcolor.h
index 197b7532..043a296e 100644
--- a/base/gxpcolor.h
+++ b/base/gxpcolor.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -296,6 +296,9 @@ bool gx_device_is_pattern_accum(gx_device *dev);
/* This will allow 1 oversized entry */
void gx_pattern_cache_ensure_space(gs_gstate * pgs, size_t needed);
+gx_color_tile *
+gx_pattern_cache_find_tile_for_id(gx_pattern_cache *pcache, gs_id id);
+
void gx_pattern_cache_update_used(gs_gstate *pgs, size_t used);
/* Update cache tile space */
diff --git a/base/gxpflat.c b/base/gxpflat.c
index 61d43ee4..23aa0cd8 100644
--- a/base/gxpflat.c
+++ b/base/gxpflat.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -560,7 +560,13 @@ top :
return code;
notes |= sn_not_first;
goto top;
- } else if (k == -1) {
+ } else if (k < 0) {
+ /* This used to be k == -1, but... If we have a very long curve, we will first
+ * go through the code above to split the long curve into 2. In fact for very
+ * long curves we can go through that multiple times. This can lead to k being
+ * < -1 by the time we finish subdividing the curve, and that meant we did not
+ * satisfy the exit condition here, leading to a loop until VM error.
+ */
/* fixme : Don't need to init the iterator. Just wanted to check in_range. */
return gx_path_add_curve_notes(ppath, pc->p1.x, pc->p1.y, pc->p2.x, pc->p2.y,
pc->pt.x, pc->pt.y, notes);
diff --git a/base/gxshade6.c b/base/gxshade6.c
index 334e05a6..5183e607 100644
--- a/base/gxshade6.c
+++ b/base/gxshade6.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -295,6 +295,7 @@ init_patch_fill_state(patch_fill_state_t *pfs)
pfs->color_stack = NULL;
pfs->color_stack_limit = NULL;
pfs->unlinear = !is_linear_color_applicable(pfs);
+ pfs->pcic = NULL;
return alloc_patch_fill_memory(pfs, pfs->pgs->memory, pcs);
}
diff --git a/base/gxstroke.c b/base/gxstroke.c
index 6546e00b..34537843 100644
--- a/base/gxstroke.c
+++ b/base/gxstroke.c
@@ -558,7 +558,7 @@ gx_stroke_path_only_aux(gx_path *ppath, /* lgtm[cpp/use-of-goto] */
double device_dot_length = pgs_lp->dot_length * fixed_1;
const subpath *psub;
gs_matrix initial_matrix;
- bool initial_matrix_reflected;
+ bool initial_matrix_reflected, flattened_path = false;
note_flags flags;
(*dev_proc(pdev, get_initial_matrix)) (pdev, &initial_matrix);
@@ -741,6 +741,7 @@ gx_stroke_path_only_aux(gx_path *ppath, /* lgtm[cpp/use-of-goto] */
)
return code;
spath = &fpath;
+ flattened_path = true;
}
if (dash_count) {
float max_dash_len = 0;
@@ -1137,7 +1138,8 @@ gx_stroke_path_only_aux(gx_path *ppath, /* lgtm[cpp/use-of-goto] */
exf:
if (dash_count)
gx_path_free(&dpath, "gx_stroke_path exit(dash path)");
- if (ppath->curve_count)
+ /* If we flattened the path then we set spath to &fpath. If we flattned the path then now we need to free fpath */
+ if(flattened_path)
gx_path_free(&fpath, "gx_stroke_path exit(flattened path)");
return code;
}
@@ -2728,7 +2730,9 @@ add_pie_join(gx_path * ppath, pl_ptr plp, pl_ptr nplp, bool reflected,
r = (double)(nplp->width.x) /* x2 */ * (plp->width.y) /* y1 */;
if (l == r) {
- if (cap)
+ /* Colinear. Suppress drawing a cap unless the path reverses direction. */
+ if (cap &&
+ ((double)(plp->width.x) * (nplp->width.x) + (double)(nplp->width.y) * (plp->width.y)) < 0)
return add_pie_cap(ppath, &plp->e);
else
return gx_path_add_line(ppath, plp->e.ce.x, plp->e.ce.y);
diff --git a/base/gxtext.h b/base/gxtext.h
index babaaf1e..100c70e5 100644
--- a/base/gxtext.h
+++ b/base/gxtext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -124,7 +124,7 @@ rc_free_proc(rc_free_text_enum);
int bytes_decoded; \
gs_point FontBBox_as_Metrics2; /* used with FontType 9,11 && WMode 1 */\
ulong text_enum_id; /* debug purpose only - not used by algorythm. */\
- bool k_text_release; /* Set at time of gs_text_begin to know to do release of black_text_state */\
+ bool k_text_release; /* Set at time of gs_text_begin to know to do release of black_textvec_state */\
/* The following is controlled by a device. */\
bool device_disabled_grid_fitting;\
/* Following two members moved from the show enumerator */\
diff --git a/base/gxttfb.c b/base/gxttfb.c
index 582c05c8..2e4a7e15 100644
--- a/base/gxttfb.c
+++ b/base/gxttfb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -687,9 +687,9 @@ static int grid_fit(gx_device_spot_analyzer *padev, gx_path *path,
o->post_transform.a = o->post_transform.d = 1;
o->post_transform.b = o->post_transform.c = 0;
o->post_transform.tx = o->post_transform.ty = 0;
- ttfOutliner__DrawGlyphOutline(o);
- if (e->error < 0)
- return e->error;
+ code = ttfOutliner__DrawGlyphOutline(o);
+ if (code < 0)
+ return code;
code = t1_hinter__set_font42_data(&h.super, FontType, &pfont->data, false);
if (code < 0)
return code;
@@ -734,8 +734,8 @@ static int grid_fit(gx_device_spot_analyzer *padev, gx_path *path,
return code;
code = t1_hinter__endglyph(&h.super);
} else {
- ttfOutliner__DrawGlyphOutline(o);
- if (e->error < 0)
+ code = ttfOutliner__DrawGlyphOutline(o);
+ if (code < 0)
return e->error;
}
return code;
@@ -755,6 +755,7 @@ int gx_ttf_outline(ttfFont *ttf, gx_ttfReader *r, gs_font_type42 *pfont, int gly
bool dg;
uint gftt = gs_currentgridfittt(pfont->dir);
bool ttin = (gftt & 1);
+ int code;
/* gs_currentgridfittt values (binary) :
00 - no grid fitting;
01 - Grid fit with TT interpreter; On failure warn and render unhinted.
@@ -801,14 +802,16 @@ int gx_ttf_outline(ttfFont *ttf, gx_ttfReader *r, gs_font_type42 *pfont, int gly
case fNoError:
if (!design_grid && !ttin && auth)
return grid_fit(pfont->dir->san, path, pfont, pscale, &e, &o);
- ttfOutliner__DrawGlyphOutline(&o);
- if (e.error)
- return e.error;
+ code = ttfOutliner__DrawGlyphOutline(&o);
+ if (code < 0)
+ return code;
return 0;
case fMemoryError:
return_error(gs_error_VMerror);
case fUnimplemented:
return_error(gs_error_unregistered);
+ case fBadFontData:
+ return_error(gs_error_invalidfont);
default:
{ int code = r->super.Error(&r->super);
diff --git a/base/gxtype1.c b/base/gxtype1.c
index d3af50ec..b2b593a4 100644
--- a/base/gxtype1.c
+++ b/base/gxtype1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -459,6 +459,7 @@ gs_type1_piece_codes(/*const*/ gs_font_type1 *pfont, /* lgtm[cpp/use-of-goto] */
else {
c = fixed2int_var(*csp) + pdata->gsubrNumberBias;
}
+ CS_CHECK_IPSTACK(ipsp + 1, ipstack);
code = pdata->procs.subr_data
(pfont, c, true, &ipsp[1].cs_data);
if (code < 0)
@@ -479,6 +480,7 @@ gs_type1_piece_codes(/*const*/ gs_font_type1 *pfont, /* lgtm[cpp/use-of-goto] */
else {
c = fixed2int_var(*csp) + pdata->subroutineNumberBias;
}
+ CS_CHECK_IPSTACK(ipsp + 1, ipstack);
code = pdata->procs.subr_data
(pfont, c, false, &ipsp[1].cs_data);
if (code < 0)
@@ -498,6 +500,7 @@ c_return:
else
call_depth--;
gs_glyph_data_free(&ipsp->cs_data, "gs_type1_piece_codes");
+ CS_CHECK_IPSTACK(ipsp, ipstack);
--ipsp;
if (ipsp < ipstack)
return (gs_note_error(gs_error_invalidfont));
@@ -545,21 +548,26 @@ c_return:
case ce1_seac:
goto do_seac;
case ce1_callothersubr:
- switch (fixed2int_var(*csp)) {
- default:
- goto out;
- case 3:
- if (csp >= &(cstack[1]))
- csp -= 2;
- goto top;
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- cnext;
+ if (CS_CHECK_CSTACK_BOUNDS(csp, cstack)) {
+ switch (fixed2int_var(*csp)) {
+ default:
+ goto out;
+ case 3:
+ if (csp >= &(cstack[1]))
+ csp -= 2;
+ goto top;
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ case 18:
+ cnext;
+ }
+ }
+ else {
+ return_error(gs_error_invalidfont);
}
}
}
diff --git a/base/gxtype1.h b/base/gxtype1.h
index 86911386..0c382396 100644
--- a/base/gxtype1.h
+++ b/base/gxtype1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -196,7 +196,7 @@ typedef fixed *cs_ptr;
#define CS_CHECK_IPSTACK(ips, ipstack)\
BEGIN\
- if (ips > &ipstack[ipstack_size + 1] \
+ if (ips > &ipstack[ipstack_size] \
|| ips < &ipstack[0])\
return_error(gs_error_invalidfont);\
END
diff --git a/base/lcms2mt.mak b/base/lcms2mt.mak
index e03e7e34..7897d1c8 100644
--- a/base/lcms2mt.mak
+++ b/base/lcms2mt.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2021 Artifex Software, Inc.
+# Copyright (C) 2001-2022 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -166,8 +166,15 @@ $(LCMS2OBJ)cmswtpnt.$(OBJ) : $(LCMS2SRC)cmswtpnt.c $(LCMS2_DEPS)
$(LCMS2OBJ)cmsvirt.$(OBJ) : $(LCMS2SRC)cmsvirt.c $(LCMS2_DEPS)
$(LCMS2_CC) $(LCMS2O_)cmsvirt.$(OBJ) $(C_) $(LCMS2SRC)cmsvirt.c
-$(LCMS2OBJ)cmsxform.$(OBJ) : $(LCMS2SRC)cmsxform.c $(LCMS2_DEPS)
- $(LCMS2_CC) $(LCMS2O_)cmsxform.$(OBJ) $(C_) $(LCMS2SRC)cmsxform.c
+$(LCMS2OBJ)cmsxform_0.$(OBJ) : $(LCMS2SRC)cmsxform.c $(LCMS2_DEPS)
+ $(LCMS2_CC) $(LCMS2O_)cmsxform_0.$(OBJ) $(C_) $(LCMS2SRC)cmsxform.c
+
+$(LCMS2OBJ)cmsxform_1.$(OBJ) : $(LCMS2SRC)cmsxform.c $(CAL_SRC)$(D)cal_cms.h $(LCMS2_DEPS)
+ $(LCMS2_CC) $(LCMS2O_)cmsxform_1.$(OBJ) $(I_)$(CAL_SRC)$(_I) $(D_)WITH_CAL$(_D) $(C_) $(LCMS2SRC)cmsxform.c
+
+$(LCMS2OBJ)cmsxform.$(OBJ) : $(LCMS2OBJ)cmsxform_$(WITH_CAL).$(OBJ) $(AK) \
+ $(LIB_MAK) $(MAKEDIRS)
+ $(CP_) $(LCMS2OBJ)cmsxform_$(WITH_CAL).$(OBJ) $(LCMS2OBJ)cmsxform.$(OBJ)
$(LCMS2OBJ)cmsalpha.$(OBJ) : $(LCMS2SRC)cmsalpha.c $(LCMS2_DEPS)
$(LCMS2_CC) $(LCMS2O_)cmsalpha.$(OBJ) $(C_) $(LCMS2SRC)cmsalpha.c
diff --git a/base/lib.mak b/base/lib.mak
index 4dc6c26e..dc3c9501 100644
--- a/base/lib.mak
+++ b/base/lib.mak
@@ -196,6 +196,7 @@ gxsync_h=$(GLSRC)gxsync.h
gxclthrd_h=$(GLSRC)gxclthrd.h
gxdevsop_h=$(GLSRC)gxdevsop.h
gdevflp_h=$(GLSRC)gdevflp.h
+pagelist_h=$(GLSRC)pagelist.h
gdevkrnlsclass_h=$(GLSRC)gdevkrnlsclass.h
gdevsclass_h=$(GLSRC)gdevsclass.h
@@ -1415,11 +1416,15 @@ $(GLOBJ)gxdownscale_1.$(OBJ) : $(GLSRC)gxdownscale.c $(AK) $(string__h)\
$(GLOBJ)gxdownscale.$(OBJ) : $(GLOBJ)gxdownscale_$(WITH_CAL).$(OBJ) $(AK) $(gp_h)
$(CP_) $(GLOBJ)gxdownscale_$(WITH_CAL).$(OBJ) $(GLOBJ)gxdownscale.$(OBJ)
+# ---- Various subclass devices ----
+subclass_=$(GLOBJ)gdevflp.$(OBJ) $(GLOBJ)gdevkrnlsclass.$(OBJ) $(GLOBJ)gdevepo.$(OBJ) \
+ $(GLOBJ)gdevoflt.$(OBJ) $(GLOBJ)gdevnup.$(OBJ) $(GLOBJ)gdevsclass.$(OBJ)
+
###### Create a pseudo-"feature" for the entire graphics library.
-LIB0s=$(GLOBJ)gpmisc.$(OBJ) $(GLOBJ)stream.$(OBJ) $(GLOBJ)strmio.$(OBJ)
-LIB1s=$(GLOBJ)gsalloc.$(OBJ) $(GLOBJ)gxdownscale.$(OBJ) $(downscale_) $(GLOBJ)gdevprn.$(OBJ) $(GLOBJ)gdevflp.$(OBJ) $(GLOBJ)gdevkrnlsclass.$(OBJ) $(GLOBJ)gdevepo.$(OBJ)
-LIB2s=$(GLOBJ)gdevmplt.$(OBJ) $(GLOBJ)gsbitcom.$(OBJ) $(GLOBJ)gsbitops.$(OBJ) $(GLOBJ)gsbittab.$(OBJ) $(GLOBJ)gdevoflt.$(OBJ) $(GLOBJ)gdevnup.$(OBJ) $(GLOBJ)gdevsclass.$(OBJ)
+LIB0s=$(GLOBJ)gpmisc.$(OBJ) $(GLOBJ)stream.$(OBJ) $(GLOBJ)strmio.$(OBJ) $(GLOBJ)pagelist.$(OBJ)
+LIB1s=$(GLOBJ)gsalloc.$(OBJ) $(GLOBJ)gxdownscale.$(OBJ) $(downscale_) $(GLOBJ)gdevprn.$(OBJ) $(subclass_)
+LIB2s=$(GLOBJ)gdevmplt.$(OBJ) $(GLOBJ)gsbitcom.$(OBJ) $(GLOBJ)gsbitops.$(OBJ) $(GLOBJ)gsbittab.$(OBJ)
# Note: gschar.c is no longer required for a standard build;
# we include it only for backward compatibility for library clients.
LIB3s=$(GLOBJ)gscedata.$(OBJ) $(GLOBJ)gscencs.$(OBJ) $(GLOBJ)gschar.$(OBJ) $(GLOBJ)gscolor.$(OBJ)
@@ -2072,11 +2077,14 @@ $(GLOBJ)gdevmplt.$(OBJ) : $(GLSRC)gdevmplt.c $(gdevmplt_h) $(gdevp14_h)\
$(memory__h)
$(GLCC) $(GLO_)gdevmplt.$(OBJ) $(C_) $(GLSRC)gdevmplt.c
+$(GLOBJ)pagelist.$(OBJ) : $(GLSRC)pagelist.c $(pagelist_h) $(gserrors_h) $(memory__h)
+ $(GLCC) $(GLO_)pagelist.$(OBJ) $(C_) $(GLSRC)pagelist.c
+
$(GLOBJ)gdevflp.$(OBJ) : $(GLSRC)gdevflp.c $(gdevflp_h) $(gdevp14_h) \
$(gdevprn_h) $(gdevsclass_h) $(gsdevice_h) $(gserrors_h) $(gsparam_h)\
$(gsstype_h) $(gx_h) $(gxcmap_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h) \
$(gxgstate_h) $(gximage_h) $(gxiparam_h) $(gxpaint_h) $(gxpath_h) $(math__h)\
- $(memory__h)
+ $(string__h) $(memory__h)
$(GLCC) $(GLO_)gdevflp.$(OBJ) $(C_) $(GLSRC)gdevflp.c
$(GLOBJ)gdevepo.$(OBJ) : $(GLSRC)gdevepo.c $(gdevepo_h) $(gdevp14_h) \
@@ -2650,7 +2658,8 @@ $(GLOBJ)gxpcmap.$(OBJ) : $(GLSRC)gxpcmap.c $(AK) $(gx_h) $(gserrors_h)\
$(gsstruct_h) $(gsutil_h) $(gp_h) $(gxcoord_h) $(gxgetbit_h)\
$(gxcolor2_h) $(gxcspace_h) $(gxdcolor_h) $(gxdevice_h) $(gxdevmem_h)\
$(gxfixed_h) $(gxmatrix_h) $(gxpcolor_h) $(gxclist_h) $(gxcldev_h)\
- $(gzstate_h) $(gdevp14_h) $(gdevmpla_h) $(LIB_MAK) $(MAKEDIRS)
+ $(gzstate_h) $(gdevp14_h) $(gdevmpla_h) $(gsicc_blacktext_h)\
+ $(gscspace_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gxpcmap.$(OBJ) $(C_) $(GLSRC)gxpcmap.c
# ---------------- PostScript Type 1 (and Type 4) fonts ---------------- #
@@ -3000,7 +3009,7 @@ $(GLOBJ)gsicc_profilecache.$(OBJ) : $(GLSRC)gsicc_profilecache.c $(AK)\
$(GLOBJ)gsicc_blacktext.$(OBJ) : $(GLSRC)gsicc_blacktext.c $(AK)\
$(gsmemory_h) $(gsstruct_h) $(gzstate_h) $(gsicc_blacktext_h)\
- $(LIB_MAK) $(MAKEDIRS)
+ $(gsicc_cache_h) $(LIB_MAK) $(MAKEDIRS)
$(GLCC) $(GLO_)gsicc_blacktext.$(OBJ) $(C_) $(GLSRC)gsicc_blacktext.c
$(GLOBJ)gsicc_lcms2mt_1_0.$(OBJ) : $(GLSRC)gsicc_lcms2mt.c\
diff --git a/base/mkromfs.c b/base/mkromfs.c
index d46450b5..2b9d4363 100644
--- a/base/mkromfs.c
+++ b/base/mkromfs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -2690,6 +2690,11 @@ main(int argc, char *argv[])
Xlist_head = Xlist_scan;
}
printf("Total %%rom%% structure size is %d bytes.\n", totlen);
-
+ if (splits.outname != NULL)
+ free(splits.outname);
+ if (splits.outname_formatted != NULL)
+ free(splits.outname_formatted);
+ if (splits.sizes != NULL)
+ free(splits.sizes);
return 0;
}
diff --git a/base/msvclib.mak b/base/msvclib.mak
index ba70f67c..61b90106 100644
--- a/base/msvclib.mak
+++ b/base/msvclib.mak
@@ -665,6 +665,21 @@ MS_TOOLSET_VERSION=14.29.30133
MSVC_VERSION=16
MS_TOOLSET_VERSION=14.29.30133
!endif
+!if "$(_NMAKE_VER)" == "14.29.30142.1"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.29.30133
+!endif
+!if "$(_NMAKE_VER)" == "14.29.30145.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.29.30133
+!endif
+!if "$(_NMAKE_VER)" == "14.29.30146.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.29.30133
+!endif
!endif
!ifndef MSVC_VERSION
diff --git a/base/pagelist.c b/base/pagelist.c
new file mode 100644
index 00000000..c687b7b9
--- /dev/null
+++ b/base/pagelist.c
@@ -0,0 +1,246 @@
+/* Copyright (C) 2022-2022 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
+/* Functions to parse a PageList string and processing utilitiess */
+
+
+#include "memory_.h"
+#include "string_.h" /* for strcspn */
+#include <stdlib.h> /* for atoi */
+#include "gsmemory.h"
+#include "gserrors.h"
+#include "pagelist.h"
+
+/* array contains an "ordered" flag, then even/odd, start, end triples */
+
+/* Allocate an array of ranges. A range of 0-0 terminates the list */
+/* Note the first int 0 is order unknown, < 0 is unordered, > 0 is */
+/* ordered and thus is suitable for sequential parsers like PS or PCL. */
+/* This first int is also used by test_printed as the offset into the */
+/* array for fast processing by SkipPage. */
+/* returns error code < 0 or number of ranges if success. */
+int
+pagelist_parse_to_array(char *page_list, gs_memory_t *mem, int num_pages, int **parray)
+{
+ int i = 0, range_count = 0;
+ int *pagelist_array = NULL;
+ char *p = page_list;
+ int prev_end = 0; /* used to track if the ranges are ordered */
+ int ordered = 1; /* default is ordered, until it's not */
+ int comma, len;
+
+ *parray = NULL; /* in case PageList is empty */
+ if (page_list[0] == 0)
+ return gs_error_rangecheck; /* empty list not valid */
+
+ do {
+ len = strlen(p);
+ comma = strcspn(p, ",");
+ p += comma + 1;
+ if (comma > 0)
+ range_count++;
+ } while (comma < len);
+ if (range_count == 0)
+ return gs_error_rangecheck; /* not valid */
+
+ range_count++; /* room for the end of list marker: 0, 0, 0 */
+ pagelist_array = (int *)gs_alloc_byte_array(mem, 1 + (range_count * 3), sizeof(int), "pagelist_parse_to_array");
+ *parray = pagelist_array; /* return the array (NULL is OK) */
+ if (pagelist_array == NULL)
+ return gs_error_VMerror;
+
+ memset(pagelist_array, 0, (1 + range_count * 3) * sizeof(int));
+ /* Fill the array */
+
+ p = page_list; /* go back to start of string */
+ for (i=1; i < (range_count - 1) * 3; ) {
+ /* Parsing method from Michael Vrhel's code in xps */
+ int dash, start, end, even_odd;
+
+ even_odd = 0;
+ start = 1;
+ end = -1; /* internal flag for last page */
+ len = strlen(p);
+ comma = strcspn(p, ",");
+ dash = strcspn(p, "-");
+
+ if (comma == 0) {
+ p++;
+ continue; /* skip leading or adjacent commas */
+ }
+ if (strncmp(p, "even", 4) == 0) {
+ even_odd = 2;
+ p += 4;
+ } else if (strncmp(p, "odd", 3) == 0) {
+ even_odd = 1;
+ p += 3;
+ }
+ /* check if the next after "even" or "odd" is ':' */
+ if (even_odd != 0) {
+ start = even_odd; /* default is entire range */
+ end = -1;
+ if (*p == ':')
+ p++; /* skip to the range */
+ len = strlen(p);
+ comma = strcspn(p, ",");
+ dash = strcspn(p, "-");
+ }
+ if (comma > 0 && *p != 0) {
+ /* We have a range to process */
+ if (dash < comma) {
+ /* Dash at start */
+ if (dash == 0) {
+ start = -1;
+ end = atoi(p + dash + 1);
+ } else {
+ start = atoi(p);
+ /* Dash at end */
+ if (p[dash + 1] == 0 || p[dash + 1] == ',') {
+ end = -1;
+ } else {
+ end = atoi(p + dash + 1);
+ }
+ }
+ } else {
+ start = atoi(p);
+ end = start;
+ }
+ }
+ if (comma == len)
+ p += comma;
+ else
+ p += comma + 1;
+
+ /* If even or odd, and we have a "num_pages" flag == -1, adjust to proper value */
+ if (even_odd == 2) {
+ if (start == -1)
+ start = num_pages & -2;
+ if (end == -1)
+ end = num_pages & -2;
+ } else if (even_odd == 1) {
+ if (start == -1)
+ start = num_pages - (1 & (num_pages ^ 1));
+ if (end == -1)
+ end = num_pages - (1 & (num_pages ^ 1));
+ } else {
+ if (start == -1)
+ start = num_pages;
+ if (end == -1)
+ end = num_pages;
+ }
+ /* Store this range, bump the index as we do */
+ pagelist_array[i++] = even_odd;
+ pagelist_array[i++] = start;
+ pagelist_array[i++] = end;
+
+ if (start <= prev_end || start > end)
+ ordered = -1;
+ prev_end = end;
+ }
+ /* Note final array entries are 0, 0, 0 from memset above */
+ pagelist_array[0] = ordered;
+ return range_count;
+}
+
+/* function to calculate the total number of pages to be output */
+int
+pagelist_number_of_pages(const int *parray)
+{
+ int count = 0, i;
+
+ /* loop over ranges until start == 0 */
+ for (i=1; parray[i+1] != 0; i += 3) {
+ int start = parray[i+1];
+ int end = parray[i+2];
+
+ if (end >= start)
+ count += 1 + end - start;
+ else
+ count += 1 + start - end;
+ }
+ return count;
+}
+
+/* Return true if this pagelist is in strict increasing order */
+bool
+pagelist_test_ordered(int *parray)
+{
+ int prev;
+ int i;
+
+ /* check flag (fast for use by the flp SkipPage function */
+ if (parray[0] > 0)
+ return true;
+ if (parray[0] < 0)
+ return false;
+
+ /* parray[0] == 0, scan until start of range is 0 */
+ prev = 0; /* page 1 or more is legal */
+ for (i=1; parray[i+1] != 0; i += 3) {
+ if (parray[i+1] <= prev || parray[i+1] < parray[i+2])
+ break; /* NOT ordered */
+ prev = parray[i+2]; /* advance to end of range */
+ }
+ /* if we made it to the marker at the end, then the list is ordered */
+ parray[0] = (parray[i+1] == 0) ? 1 : -1;
+ return parray[0] > 0;
+}
+
+/* Return true if this page is to be printed. (For sequential processing) */
+/* This assumes/requires that the PageList is strictly sequential. */
+bool
+pagelist_test_printed(int *parray, int pagenum)
+{
+ int i = parray[0];
+
+ if (i <= 0) { /* shouldn't happen */
+ pagelist_test_ordered(parray); /* in case caller didn't do this */
+ i = parray[0];
+ if (i < 0)
+ return false; /* list is NOT ordered, punt */
+ }
+
+ /* advance to next range if pagenum past the end of this range */
+ /* stopping at the 0, 0, 0 marker (start == 0) */
+ while (pagenum > parray[i+2] && parray[i+1] != 0) {
+ i += 3; /* bump to next range for next call */
+ parray[0] = i; /* update for next entry */
+ }
+ if (parray[i+1] == 0)
+ return false; /* reached end of ranges */
+
+ /* First Test even, then odd */
+ if (parray[i] == 2 && (pagenum & 1) == 1)
+ return false;
+ if (parray[i] == 1 && (pagenum & 1) == 0)
+ return false;
+
+ /* Fast case for ordered list and sequential page numbers (FLP device) */
+ if (i > 0) {
+ if (pagenum >= parray[i+1] && pagenum <= parray[i+2]) {
+ return true; /* page was in this range */
+ } else {
+ if (pagenum < parray[i+1])
+ return false; /* pagennum in between ranges that skip */
+ }
+ }
+ return false;
+}
+
+void
+pagelist_free_range_array(gs_memory_t *mem, int *parray)
+{
+ gs_free_object(mem, parray, "flp_close_device");
+}
diff --git a/base/pagelist.h b/base/pagelist.h
new file mode 100644
index 00000000..832b2157
--- /dev/null
+++ b/base/pagelist.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2022-2022 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
+/* Functions to parse a PageList string and processing utilitiess */
+
+/* Allocate an array of ranges. A range of 0-0 terminates the list */
+/* array contains even/odd flag, start, end (3 ints per range). */
+/* returns error code < 0 or number of ranges if success */
+int pagelist_parse_to_array(char *pPageList, gs_memory_t *mem, int num_pages, int **parray);
+
+/* function to calculate the total number of pages to be output */
+int pagelist_number_of_pages(const int *parray);
+
+/* Return true if this pagelist is in strict increasing order */
+bool pagelist_test_ordered(int *parray);
+
+/* Return true if this page is to be printed (for sequential processing) */
+/* This assumes that the PageList is strictly sequential, tested by client. */
+bool pagelist_test_printed(int *parray, int pagenum);
+
+void pagelist_free_range_array(gs_memory_t *mem, int *parray);
diff --git a/base/scfd.c b/base/scfd.c
index 03085fbf..6d538890 100644
--- a/base/scfd.c
+++ b/base/scfd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -211,17 +211,18 @@ static inline int skip_data(stream_CFD_state *ss, stream_cursor_read *pr, int rl
static inline int invert_data(stream_CFD_state *ss, stream_cursor_read *pr, int *rlen, byte black_byte)
{
+ byte *qlim = ss->lbuf + ss->raster + CFD_BUFFER_SLOP;
cfd_declare_state;
cfd_load_state();
(void)rlimit;
- if (q >= ss->lbuf + ss->raster + CFD_BUFFER_SLOP || q < ss->lbufstart) {
+ if (q >= qlim || q < ss->lbufstart) {
return(-1);
}
if ( (*rlen) > qbit )
{
- if (q + ((*rlen - qbit) >> 3) > ss->lbuf + ss->raster + CFD_BUFFER_SLOP) {
+ if (q + ((*rlen - qbit) >> 3) > qlim) {
return(-1);
}
@@ -233,6 +234,10 @@ static inline int invert_data(stream_CFD_state *ss, stream_cursor_read *pr, int
}
(*rlen) -= qbit;
+ if (q + ((*rlen) >> 3) >= qlim) {
+ return(-1);
+ }
+
switch ( (*rlen) >> 3 )
{
case 7: /* original rlen possibly >= 64 */
diff --git a/base/siscale.c b/base/siscale.c
index 5bf212c1..128b1fad 100644
--- a/base/siscale.c
+++ b/base/siscale.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -210,7 +210,7 @@ calculate_contrib(
int i, j;
int last_index = -1;
- if_debug1('w', "[w]calculate_contrib scale=%lg\n", scale);
+ if_debug1('W', "[W]calculate_contrib scale=%lg\n", scale);
if (scale < 1.0) {
double clamped_scale = max(scale, min_scale);
WidthIn = ((double)fWidthIn) / clamped_scale;
@@ -250,7 +250,7 @@ calculate_contrib(
int last_pixel = clamp_pixel(right);
CONTRIB *p;
- if_debug4('w', "[w]i=%d, i+offset=%lg scale=%lg center=%lg : ", starting_output_index + i,
+ if_debug4('W', "[W]i=%d, i+offset=%lg scale=%lg center=%lg : ", starting_output_index + i,
starting_output_index + i + (double)src_y_offset / src_size * dst_size, scale, center);
if (last_pixel > last_index)
last_index = last_pixel;
@@ -275,7 +275,7 @@ calculate_contrib(
ie = (int)(e + 0.5);
p[k].weight += ie;
e -= ie;
- if_debug2('w', " %d %f", k, (float)p[k].weight);
+ if_debug2('W', " %d %f", k, (float)p[k].weight);
}
} else {
@@ -293,10 +293,10 @@ calculate_contrib(
ie = (int)(e + 0.5);
p[k].weight += ie;
e -= ie;
- if_debug2('w', " %d %f", k, (float)p[k].weight);
+ if_debug2('W', " %d %f", k, (float)p[k].weight);
}
}
- if_debug0('w', "\n");
+ if_debug0('W', "\n");
}
return last_index;
}
@@ -860,16 +860,18 @@ calculate_dst_contrib(stream_IScale_state * ss, int y)
int limited_WidthOut = (ss->params.WidthOut + abs_interp_limit - 1) / abs_interp_limit;
int limited_EntireHeightOut = (ss->params.EntireHeightOut + abs_interp_limit - 1) / abs_interp_limit;
uint row_size = limited_WidthOut * ss->params.spp_interp;
- int last_index =
- calculate_contrib(&ss->dst_next_list, ss->dst_items,
+ int last_index, first_index_mod;
+
+ if_debug2m('W', ss->memory, "[W]calculate_dst_contrib for y = %d, y+offset=%d\n", y, y + ss->src_y_offset);
+
+ last_index = calculate_contrib(&ss->dst_next_list, ss->dst_items,
(double)limited_EntireHeightOut / ss->params.EntireHeightIn,
y, ss->src_y_offset, limited_EntireHeightOut, ss->params.EntireHeightIn,
1, ss->params.HeightIn, ss->max_support, row_size,
(double)ss->params.MaxValueOut / 255, ss->filter_width,
ss->filter, ss->min_scale);
- int first_index_mod = ss->dst_next_list.first_pixel / row_size;
+ first_index_mod = ss->dst_next_list.first_pixel / row_size;
- if_debug2m('w', ss->memory, "[W]calculate_dst_contrib for y = %d, y+offset=%d\n", y, y + ss->src_y_offset);
ss->dst_last_index = last_index;
last_index %= ss->max_support;
if (last_index < first_index_mod) { /* Shuffle the indices to account for wraparound. */
@@ -1101,7 +1103,8 @@ s_IScale_process(stream_state * st, stream_cursor_read * pr,
row = ss->dst;
}
/* Apply filter to zoom vertically from tmp to dst. */
- if (ss->params.Active)
+ if (ss->params.Active) {
+ if_debug1('w', "[w]zoom_y y = %d\n", ss->dst_y);
ss->zoom_y(row, /* Where to scale to */
ss->tmp, /* Line buffer */
limited_LeftMarginOut, /* Skip */
@@ -1109,6 +1112,7 @@ s_IScale_process(stream_state * st, stream_cursor_read * pr,
limited_WidthOut, /* Stride */
ss->params.spp_interp, /* Color count */
&ss->dst_next_list, ss->dst_items);
+ }
/* Idiotic C coercion rules allow T* and void* to be */
/* inter-assigned freely, but not compared! */
if ((void *)row != ss->dst) /* no buffering */
@@ -1156,8 +1160,9 @@ s_IScale_process(stream_state * st, stream_cursor_read * pr,
ss->src_offset = 0;
}
/* Apply filter to zoom horizontally from src to tmp. */
- if_debug2('w', "[w]zoom_x y = %d to tmp row %d\n",
- ss->src_y, (ss->src_y % ss->max_support));
+ if_debug3('w', "[w]zoom_x y = %d to tmp row %d%s\n",
+ ss->src_y, (ss->src_y % ss->max_support),
+ ss->params.Active ? "" : " (Inactive)");
if (ss->params.Active)
ss->zoom_x(/* Where to scale to (dst line address in tmp buffer) */
ss->tmp + (ss->src_y % ss->max_support) *
diff --git a/base/spdiff.c b/base/spdiff.c
index c5df1bf0..eeef2101 100644
--- a/base/spdiff.c
+++ b/base/spdiff.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -19,6 +19,7 @@
#include "memory_.h"
#include "strimpl.h"
#include "spdiffx.h"
+#include "gserrors.h"
/* ------ PixelDifferenceEncode/Decode ------ */
@@ -64,6 +65,9 @@ s_PDiffE_init(stream_state * st)
0, 0, 0, 0, 0, 0, 0, cBits16
};
+ if (ss->Colors > s_PDiff_max_Colors)
+ return_error(gs_error_rangecheck);
+
ss->row_count = (bits_per_row + 7) >> 3;
ss->end_mask = (1 << (-bits_per_row & 7)) - 1;
ss->case_index =
@@ -76,11 +80,12 @@ s_PDiffE_init(stream_state * st)
static int
s_PDiffD_init(stream_state * st)
{
+ int code = 0;
stream_PDiff_state *const ss = (stream_PDiff_state *) st;
- s_PDiffE_init(st);
+ code = s_PDiffE_init(st);
ss->case_index += cDecode - cEncode;
- return 0;
+ return code;
}
/* Process a buffer. Note that this handles both Encode and Decode. */
diff --git a/base/stream.c b/base/stream.c
index 6f68d7c2..5c4c3d1d 100644
--- a/base/stream.c
+++ b/base/stream.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -110,6 +110,8 @@ s_init(stream *s, gs_memory_t * mem)
s->prev = s->next = 0; /* clean for GC */
s->file_name.data = 0; /* ibid. */
s->file_name.size = 0;
+ s->end_status = 0;
+ s->modes = 0;
s->close_strm = false; /* default */
s->close_at_eod = true; /* default */
s->cbuf_string_memory = NULL;
@@ -1294,6 +1296,7 @@ s_add_filter(stream **ps, const stream_template *templat,
int
s_close_filters(stream **ps, stream *target)
{
+ int code = 0;
while (*ps != target) {
stream *s = *ps;
gs_memory_t *mem = s->state->memory;
@@ -1304,8 +1307,8 @@ s_close_filters(stream **ps, stream *target)
int status = sclose(s);
stream_state *ss = s->state; /* sclose may set this to s */
- if (status < 0)
- return status;
+ if (code == 0)
+ code = status;
if (s->cbuf_string_memory != NULL) { /* stream owns string buffer, so free it */
gs_free_object(cbuf_string_memory, cbuf, "s_close_filters(cbuf)");
@@ -1320,7 +1323,7 @@ s_close_filters(stream **ps, stream *target)
}
*ps = next;
}
- return 0;
+ return code;
}
/* ------ Stream closing ------ */
diff --git a/base/ttfmain.c b/base/ttfmain.c
index 4ee5dfd8..82593a00 100644
--- a/base/ttfmain.c
+++ b/base/ttfmain.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -533,6 +533,10 @@ retry:
subglyph.bbox.xMax = ttfReader__Short(r);
subglyph.bbox.yMax = ttfReader__Short(r);
+ if (exec->metrics.x_scale1 == 0 || exec->metrics.x_scale2 == 0
+ || exec->metrics.y_scale1 == 0 || exec->metrics.y_scale2 == 0) {
+ goto errex;
+ }
gOutline->xMinB = Scale_X(&exec->metrics, subglyph.bbox.xMin);
gOutline->yMinB = Scale_Y(&exec->metrics, subglyph.bbox.yMin);
gOutline->xMaxB = Scale_X(&exec->metrics, subglyph.bbox.xMax);
@@ -646,8 +650,15 @@ retry:
e->m.tx = Scale_X( &exec->metrics, e->arg1 ) << 10;
e->m.ty = Scale_Y( &exec->metrics, e->arg2 ) << 10;
} else {
- e->m.tx = (pts->org_x[e->arg1] - pts->org_x[gOutline->pointCount + e->arg2]) << 10;
- e->m.ty = (pts->org_y[e->arg1] - pts->org_y[gOutline->pointCount + e->arg2]) << 10;
+ if (e->arg1 < 0 || e->arg1 > pts->n_points
+ || ((int)gOutline->pointCount + e->arg2) < 0 || (gOutline->pointCount + e->arg2) > pts->n_points) {
+ error = fBadFontData;
+ goto ex;
+ }
+ else {
+ e->m.tx = (pts->org_x[e->arg1] - pts->org_x[gOutline->pointCount + e->arg2]) << 10;
+ e->m.ty = (pts->org_y[e->arg1] - pts->org_y[gOutline->pointCount + e->arg2]) << 10;
+ }
}
MoveGlyphOutline(pts, nPointsStored, &out, &e->m);
for (j = nContoursStored; j < out.contourCount + nContoursStored; j++)
@@ -875,7 +886,7 @@ static FontError ttfOutliner__BuildGlyphOutline(ttfOutliner *self, int glyphInde
#define AVECTOR_BUG 1 /* Work around a bug in AVector fonts. */
-void ttfOutliner__DrawGlyphOutline(ttfOutliner *self)
+int ttfOutliner__DrawGlyphOutline(ttfOutliner *self)
{ ttfGlyphOutline* out = &self->out;
FloatMatrix *m = &self->post_transform;
ttfFont *pFont = self->pFont;
@@ -890,10 +901,23 @@ void ttfOutliner__DrawGlyphOutline(ttfOutliner *self)
short sp, ctr;
FloatPoint p0, p1, p2, p3;
# if AVECTOR_BUG
- F26Dot6 expand_x = Scale_X(&exec->metrics, pFont->nUnitsPerEm * 2);
- F26Dot6 expand_y = Scale_Y(&exec->metrics, pFont->nUnitsPerEm * 2);
- F26Dot6 xMin = out->xMinB - expand_x, xMax = out->xMaxB + expand_x;
- F26Dot6 yMin = out->yMinB - expand_y, yMax = out->yMaxB + expand_y;
+ F26Dot6 expand_x;
+ F26Dot6 expand_y;
+ F26Dot6 xMin, xMax;
+ F26Dot6 yMin, yMax;
+
+
+ if (exec->metrics.x_scale1 == 0 || exec->metrics.x_scale2 == 0
+ || exec->metrics.y_scale1 == 0 || exec->metrics.y_scale2 == 0) {
+ return_error(gs_error_invalidfont);
+ }
+
+ expand_x = Scale_X(&exec->metrics, pFont->nUnitsPerEm * 2);
+ expand_y = Scale_Y(&exec->metrics, pFont->nUnitsPerEm * 2);
+ xMin = out->xMinB - expand_x;
+ xMax = out->xMaxB + expand_x;
+ yMin = out->yMinB - expand_y;
+ yMax = out->yMaxB + expand_y;
# endif
TransformF26Dot6PointFloat(&p1, out->advance.x, out->advance.y, m);
@@ -1014,6 +1038,7 @@ void ttfOutliner__DrawGlyphOutline(ttfOutliner *self)
onCurve += pts;
sp = *endP++;
}
+ return 0;
}
FontError ttfOutliner__Outline(ttfOutliner *self, int glyphIndex,
diff --git a/base/ttfoutl.h b/base/ttfoutl.h
index 32dd8d22..e339e973 100644
--- a/base/ttfoutl.h
+++ b/base/ttfoutl.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -195,6 +195,6 @@ void ttfOutliner__init(ttfOutliner *, ttfFont *f, ttfReader *r, ttfExport *exp,
bool bOutline, bool bFirst, bool bVertical);
FontError ttfOutliner__Outline(ttfOutliner *this, int glyphIndex,
float orig_x, float orig_y, FloatMatrix *m1);
-void ttfOutliner__DrawGlyphOutline(ttfOutliner *this);
+int ttfOutliner__DrawGlyphOutline(ttfOutliner *this);
#endif
diff --git a/base/ttinterp.c b/base/ttinterp.c
index fe44a844..4429439b 100644
--- a/base/ttinterp.c
+++ b/base/ttinterp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1825,6 +1825,12 @@ static int nInstrCount=0;
{
if ( args[1] == 0 )
{
+ if ( BOUNDS(CUR.IP + args[0], CUR.codeSize ) )
+ {
+ CUR.error = TT_Err_Invalid_Reference;
+ return;
+ }
+
CUR.IP += (Int)(args[0]);
CUR.step_ins = FALSE;
@@ -2319,7 +2325,8 @@ static int nInstrCount=0;
L = (Int)CUR.code[CUR.IP + 1];
- if ( BOUNDS( L, CUR.stackSize+1-CUR.top ) )
+ if ( BOUNDS( L, CUR.stackSize+1-CUR.top )
+ || BOUNDS( L, CUR.codeSize+1-CUR.IP))
{
CUR.error = TT_Err_Stack_Overflow;
return;
@@ -2343,7 +2350,9 @@ static int nInstrCount=0;
L = (Int)CUR.code[CUR.IP + 1];
- if ( BOUNDS( L, CUR.stackSize+1-CUR.top ) )
+ /* GET_ShortIns() reads two values from the execution stream */
+ if ( BOUNDS( L, CUR.stackSize+1-CUR.top )
+ || BOUNDS( L * 2, CUR.codeSize+1-CUR.IP))
{
CUR.error = TT_Err_Stack_Overflow;
return;
@@ -4059,7 +4068,8 @@ static int nInstrCount=0;
if ( BOUNDS( b0, CUR.zp0.n_points ) ||
BOUNDS( b1, CUR.zp0.n_points ) ||
BOUNDS( a0, CUR.zp1.n_points ) ||
- BOUNDS( a1, CUR.zp1.n_points ) )
+ BOUNDS( a1, CUR.zp1.n_points ) ||
+ BOUNDS( point, CUR.zp2.n_points) )
{
CUR.error = TT_Err_Invalid_Reference;
return;
@@ -4378,9 +4388,15 @@ static int nInstrCount=0;
end_point = CUR.pts.contours[contour];
first_point = point;
- while ( point <= end_point && (CUR.pts.touch[point] & mask) == 0 )
+ while ( point <= end_point && point < CUR.pts.n_points && (CUR.pts.touch[point] & mask) == 0 )
point++;
+ if (BOUNDS(point, CUR.pts.n_points ))
+ {
+ CUR.error = TT_Err_Invalid_Reference;
+ return;
+ }
+
if ( point <= end_point )
{
first_touched = point;
@@ -4392,12 +4408,21 @@ static int nInstrCount=0;
{
if ( (CUR.pts.touch[point] & mask) != 0 )
{
- Interp( (Int)(cur_touched + 1),
+ if (BOUNDS(cur_touched, CUR.pts.n_points)
+ || BOUNDS(point, CUR.pts.n_points))
+ {
+ CUR.error = TT_Err_Invalid_Reference;
+ return;
+ }
+ else
+ {
+ Interp( (Int)(cur_touched + 1),
(Int)(point - 1),
(Int)cur_touched,
(Int)point,
&V );
- cur_touched = point;
+ cur_touched = point;
+ }
}
point++;
diff --git a/base/ttobjs.c b/base/ttobjs.c
index 75eacb9c..5fa95a88 100644
--- a/base/ttobjs.c
+++ b/base/ttobjs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -303,6 +303,9 @@ static int free_aux(ttfMemory *mem, void *ptr)
if (n_points < 100)
n_points = 100; /* Bug 689907 */
+ exec->n_contours = exec->n_points = 0;
+ exec->twilight.n_points = 0;
+
if ( ALLOC_ARRAY( exec->callStack, exec->callSize, callSize, TCallRecord ) ||
/* reserve interpreter call stack */
diff --git a/base/unix-gcc.mak b/base/unix-gcc.mak
index 04ebcff8..5d659fa3 100644
--- a/base/unix-gcc.mak
+++ b/base/unix-gcc.mak
@@ -201,7 +201,6 @@ SHARE_FT=0
FTSRCDIR=./freetype
FT_CFLAGS=-I./freetype/include
FT_LIBS=
-FT_CONFIG_SYSTEM_ZLIB=
# Define whether to compile in UFST.
# FAPI/UFST depends on UFST_BRIDGE being undefined - hence the construct below.
diff --git a/base/version.mak b/base/version.mak
index 98fb46e1..f5abe371 100644
--- a/base/version.mak
+++ b/base/version.mak
@@ -13,11 +13,11 @@
# Makefile fragment containing the current revision identification.
# Major, minor and patch version numbers.
-GS_VERSION_MAJOR=9
-GS_VERSION_MINOR=56
-GS_VERSION_PATCH=1
+GS_VERSION_MAJOR=10
+GS_VERSION_MINOR=00
+GS_VERSION_PATCH=0
# Revision date: year x 10000 + month x 100 + day.
-GS_REVISIONDATE=20220404
+GS_REVISIONDATE=20220921
# Derived values
GS_VERSION=$(GS_VERSION_MAJOR)$(GS_VERSION_MINOR)$(GS_VERSION_PATCH)
GS_DOT_VERSION=$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR).$(GS_VERSION_PATCH)
diff --git a/base/winlib.mak b/base/winlib.mak
index 5664a61b..ea561491 100644
--- a/base/winlib.mak
+++ b/base/winlib.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2021 Artifex Software, Inc.
+# Copyright (C) 2001-2022 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -128,7 +128,8 @@ BEGINFILES=$(GLGENDIR)\ccf32.tr\
$(GLOBJDIR)\*.res $(GLOBJDIR)\*.ico\
$(BINDIR)\$(GSDLL).dll $(BINDIR)\$(GSCONSOLE).exe\
$(BINDIR)\setupgs.exe $(BINDIR)\uninstgs.exe\
- $(GLOBJDIR)\cups\*.h $(AUXDIR)\*.sbr $(AUXDIR)\*.pdb \
+ $(GLOBJDIR)\cups\*.h $(GLOBJDIR)\*.h $(GLOBJDIR)\*.c $(AUXDIR)\*.sbr \
+ $(AUXDIR)\*.pdb \
$(BEGINFILES2)
# Include the generic makefiles.
diff --git a/configure b/configure
index 5b40d106..7a67709a 100755
--- a/configure
+++ b/configure
@@ -697,6 +697,8 @@ GS_DYNAMIC_LDFLAGS
DYNAMIC_FLAGS
DYNAMIC_DEVS
DYNAMIC_CFLAGS
+XML_HIDDEN_CFLAGS
+FT_HIDDEN_CFLAGS
GPDL_SONAME_MAJOR_MINOR
GPDL_SONAME_MAJOR
GPDL_SONAME
@@ -861,6 +863,7 @@ LIBOBJS
SUB_MAKE_OPTION
ORDER_ONLY
OBJDIR_BSDMAKE_WORKAROUND
+MAKE_EXISTS
HAVE_SSE2
EGREP
GREP
@@ -939,6 +942,7 @@ enable_contrib
with_arch_h
with_sanitizer
enable_sse2
+with_make
with_large_color_index
enable_threading
with_tesseract
@@ -1639,9 +1643,9 @@ Optional Features:
--disable-openjpeg Do not use OpenJPEG for JPX decoding
--disable-gtk Do not build the gtk loader
--disable-compile-inits Do not compile in initialization files
- --enable-hidden-visibility
- hide all shared library symbols which are not part
- of its public API
+ --disable-hidden-visibility
+ expose all shared library symbols even those which
+ are not part of its public API
--enable-dynamic Enable dynamically loaded drivers
--disable-bswap32 Do not use bswap32 instrinsic
--disable-byteswap-h Do not use byteswap.h functions
@@ -1655,6 +1659,8 @@ Optional Packages:
--with-sanitizer=[address/memory]
Sanitizer for 'sanitize' target (defaults to
'address')
+ --with-make=["make" program name]
+ If you use a version of make not called "make"
--without-tesseract do not try to use the Tesseract library for OCR
--with-libiconv=[no/gnu/native]
@@ -5694,6 +5700,58 @@ done
+
+# Check whether --with-make was given.
+if test "${with_make+set}" = set; then :
+ withval=$with_make; MAKE=$with_make
+else
+ MAKE=make
+fi
+
+
+# Extract the first word of "$MAKE", so it can be a program name with args.
+set dummy $MAKE; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MAKE_EXISTS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MAKE_EXISTS"; then
+ ac_cv_prog_MAKE_EXISTS="$MAKE_EXISTS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MAKE_EXISTS="yes"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_prog_MAKE_EXISTS" && ac_cv_prog_MAKE_EXISTS="no"
+fi
+fi
+MAKE_EXISTS=$ac_cv_prog_MAKE_EXISTS
+if test -n "$MAKE_EXISTS"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKE_EXISTS" >&5
+$as_echo "$MAKE_EXISTS" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+if test x"$MAKE_EXISTS" = x"no" ; then
+ as_fn_error $? "Required make program '$MAKE' not found." "$LINENO" 5
+fi
+
OBJDIR_BSDMAKE_WORKAROUND=obj
SUB_MAKE_OPTION=
ORDER_ONLY=""
@@ -8295,15 +8353,6 @@ if test -z "$SHARE_ZLIB"; then
" "$LINENO" 5
fi
-FT_SYS_ZLIB=""
-if test x$FT_BRIDGE != x0; then
- if test xx$SHARE_FT != x1; then
- if test x$SHARE_ZLIB != x0; then
- FT_SYS_ZLIB="-DFT_CONFIG_OPTION_SYSTEM_ZLIB"
- fi
- fi
-fi
-
@@ -8316,7 +8365,7 @@ if test x"$enable_auxtools_only" = x"yes" ; then
else
LIBPNGDIR=src
PNGDEVS=''
- PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha'
+ PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha png16malpha'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for local png library source" >&5
$as_echo_n "checking for local png library source... " >&6; }
if test -f $srcdir/libpng/pngread.c; then
@@ -8796,7 +8845,7 @@ if test x"$SHARE_LIBTIFF" = x"0" ; then
if ! test -d "$LIBTIFFCONFDIR" ; then
mkdir "$LIBTIFFCONFDIR"
fi
- cd "$LIBTIFFCONFDIR" && "$absolute_source_path/$LIBTIFFDIR/configure" $GS_TIFF_CONFIGURE_OPTS --disable-jbig --disable-lzma --disable-zstd --disable-webp --disable-libdeflate $SUBCONFIG_OPTS
+ cd "$LIBTIFFCONFDIR" && "$absolute_source_path/$LIBTIFFDIR/configure" $GS_TIFF_CONFIGURE_OPTS --disable-lerc --disable-jbig --disable-lzma --disable-zstd --disable-webp --disable-libdeflate $SUBCONFIG_OPTS
status=$?
if test $status -ne 0 ; then
as_fn_error $status "libtiff configure script failed" "$LINENO" 5
@@ -9862,6 +9911,7 @@ main ()
unsigned char buf1[128];
input1 = _mm_loadu_si128((const __m128i *)buf1);
input1 = _mm_hadd_epi32(input1, input1);
+ (void)_mm_extract_epi64(input1, 0);
return(0);
;
@@ -9906,6 +9956,7 @@ main ()
unsigned char buf1[256];
input1 = _mm256_loadu_si256((const __m256i *)buf1);
input1 = _mm256_adds_epu8(input1, input1);
+ (void)_mm256_insert_epi64(input1, 0, 0);
return(0);
;
@@ -9984,12 +10035,15 @@ $as_echo "no" >&6; }
CAL_NEON_CFLAGS=""
if test "x$HAVE_SSE4_2" != x; then
CAL_SSE4_2_CFLAGS="-msse4.2"
+ CAL_CFLAGS="$CAL_CFLAGS $HAVE_SSE4_2"
fi
if test "x$HAVE_AVX2" != x; then
CAL_AVX2_CFLAGS="-mavx2"
+ CAL_CFLAGS="$CAL_CFLAGS $HAVE_AVX2"
fi
if test "x$HAVE_NEON" != x; then
CAL_NEON_CFLAGS="-mfpu=neon -mcpu=cortex-a53"
+ CAL_CFLAGS="$CAL_CFLAGS $HAVE_NEON"
fi
fi
@@ -11019,6 +11073,14 @@ PDF_MAK="\$(GLSRCDIR)\$(D)stub.mak"
PDFROMFS_MAK="\$(GLSRCDIR)\$(D)stub.mak"
if test x"$with_pdf" != x"no" ; then
+
+ if test x"$JBIG2_DECODER" = x""; then
+ as_fn_error $? "No JBIG2 decoder available, required for PDF support" "$LINENO" 5
+ fi
+ if test x"$JPX_DECODER" = x""; then
+ as_fn_error $? "No JPX/JPEG2000 decoder available, required for PDF support" "$LINENO" 5
+ fi
+
if test -f $srcdir/pdf/pdf.mak; then
# Check whether --with-pdf was given.
@@ -11428,18 +11490,18 @@ GPDL_SONAME="lib\$(GPDL${libname1}"
GPDL_SONAME_MAJOR="lib\$(GPDL${libname2}"
GPDL_SONAME_MAJOR_MINOR="lib\$(GPDL${libname3}"
-hide_symbols=no
+hide_symbols=yes
attr_default=
attr_hidden=
_ldflags=
# Check whether --enable-hidden-visibility was given.
if test "${enable_hidden_visibility+set}" = set; then :
- enableval=$enable_hidden_visibility; hide_symbols=yes
+ enableval=$enable_hidden_visibility; hide_symbols=no
fi
-if test x$hide_symbols = xyes -a x"$GCC" = x"yes"; then
+if test x"$hide_symbols" = x"yes" -a x"$GCC" = x"yes"; then
attr_default="__attribute__((visibility(\\\"default\\\")))"
attr_hidden="__attribute__((visibility(\\\"hidden\\\")))"
fi
@@ -11461,7 +11523,7 @@ case $host in
SO_LIB_EXT=".so"
;;
*-mingw*|*-msys*)
- if test x$hide_symbols = xyes; then
+ if test x"$hide_symbols" = x"yes"; then
attr_default="__declspec(dllexport)"
attr_hidden=""
else
@@ -11493,7 +11555,7 @@ case $host in
GPDL_SONAME_MAJOR_MINOR="lib\$(GPDL${libname2}"
;;
*-cygwin*)
- if test x$hide_symbols = xyes; then
+ if test x"$hide_symbols" = x"yes"; then
attr_default="__declspec(dllexport)"
attr_hidden=""
fi
@@ -11543,7 +11605,7 @@ case $host in
DYNAMIC_CFLAGS="-fPIC $DYNAMIC_CFLAGS"
else
DYNAMIC_CFLAGS="-KPIC $DYNAMIC_CFLAGS"
- #if test x$hide_symbols = xyes; then
+ #if test x"$hide_symbols" = x"yes"; then
# attr_default="__global"
# attr_hidden="__hidden"
# _ldflags="-xldscope=hidden"
@@ -11580,16 +11642,17 @@ case $host in
;;
esac
-if test x$hide_symbols = xyes ; then
+if test x"$hide_symbols" = x"yes" ; then
if test x"$GCC" = x"yes"; then
DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -fvisibility=hidden"
fi
DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -DGSDLLEXPORT=\"$attr_default\""
if test "x$FT_BRIDGE" = x1 -a "x$SHARE_FT" = x0 ; then
- DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -D\"FT_EXPORT(x)\"=\"$attr_hidden x\""
+ # disable warnings for redefined macros, so our abuse of FT_EXPORT() to hide symbols doesn't flag warnings
+ FT_HIDDEN_CFLAGS="-Wp,-w -D\"FT_EXPORT(x)\"=\"$attr_hidden x\" -D\"FT_EXPORT_DEF(x)\"=\"$attr_hidden x\""
fi
if test "x$SHARE_EXPAT" = x0 ; then
- DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -DXML_STATIC -DXMLIMPORT=\"$attr_hidden\""
+ XML_HIDDEN_CFLAGS="-DXML_STATIC -DXMLIMPORT=\"$attr_hidden\""
fi
fi
@@ -11611,6 +11674,9 @@ fi
+
+
+
# Check whether --enable-dynamic was given.
if test "${enable_dynamic+set}" = set; then :
enableval=$enable_dynamic;
diff --git a/configure.ac b/configure.ac
index e955b2f1..bb578250 100644
--- a/configure.ac
+++ b/configure.ac
@@ -560,6 +560,16 @@ dnl feature set of GNU make. We still prefer GNU make,
dnl but......
dnl --------------------------------------------------
+AC_ARG_WITH([make], AS_HELP_STRING([--with-make=@<:@"make" program name@:>@],
+ [If you use a version of make not called "make"]),
+ [MAKE=$with_make], [MAKE=make])
+
+AC_CHECK_PROG(MAKE_EXISTS,[$MAKE],[yes],[no])
+
+if test x"$MAKE_EXISTS" = x"no" ; then
+ AC_MSG_ERROR([Required make program '$MAKE' not found.])
+fi
+
OBJDIR_BSDMAKE_WORKAROUND=obj
SUB_MAKE_OPTION=
ORDER_ONLY=""
@@ -1416,17 +1426,6 @@ if test -z "$SHARE_ZLIB"; then
])
fi
-dnl if GS is to use the system zlib, freetype
-dnl should do the same
-FT_SYS_ZLIB=""
-if test x$FT_BRIDGE != x0; then
- if test xx$SHARE_FT != x1; then
- if test x$SHARE_ZLIB != x0; then
- FT_SYS_ZLIB="-DFT_CONFIG_OPTION_SYSTEM_ZLIB"
- fi
- fi
-fi
-
AC_SUBST(SHARE_ZLIB)
AC_SUBST(AUX_SHARED_ZLIB)
AC_SUBST(ZLIBCFLAGS)
@@ -1440,7 +1439,7 @@ if test x"$enable_auxtools_only" = x"yes" ; then
else
LIBPNGDIR=src
PNGDEVS=''
- PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha'
+ PNGDEVS_ALL='png48 png16m pnggray pngmono pngmonod png256 png16 pngalpha png16malpha'
AC_MSG_CHECKING([for local png library source])
if test -f $srcdir/libpng/pngread.c; then
AC_MSG_RESULT([yes])
@@ -1660,7 +1659,7 @@ if test x"$SHARE_LIBTIFF" = x"0" ; then
if ! test -d "$LIBTIFFCONFDIR" ; then
mkdir "$LIBTIFFCONFDIR"
fi
- cd "$LIBTIFFCONFDIR" && "$absolute_source_path/$LIBTIFFDIR/configure" $GS_TIFF_CONFIGURE_OPTS --disable-jbig --disable-lzma --disable-zstd --disable-webp --disable-libdeflate $SUBCONFIG_OPTS
+ cd "$LIBTIFFCONFDIR" && "$absolute_source_path/$LIBTIFFDIR/configure" $GS_TIFF_CONFIGURE_OPTS --disable-lerc --disable-jbig --disable-lzma --disable-zstd --disable-webp --disable-libdeflate $SUBCONFIG_OPTS
status=$?
if test $status -ne 0 ; then
AC_MSG_ERROR([libtiff configure script failed], $status)
@@ -2212,6 +2211,7 @@ if test x$WITH_CAL != x0; then
unsigned char buf1[[128]];
input1 = _mm_loadu_si128((const __m128i *)buf1);
input1 = _mm_hadd_epi32(input1, input1);
+ (void)_mm_extract_epi64(input1, 0);
return(0);
])],
[HAVE_SSE4_2="-DHAVE_SSE4_2"], [HAVE_SSE4_2=""])
@@ -2238,6 +2238,7 @@ if test x$WITH_CAL != x0; then
unsigned char buf1[[256]];
input1 = _mm256_loadu_si256((const __m256i *)buf1);
input1 = _mm256_adds_epu8(input1, input1);
+ (void)_mm256_insert_epi64(input1, 0, 0);
return(0);
])],
[HAVE_AVX2="-DHAVE_AVX2"], [HAVE_AVX2=""])
@@ -2286,12 +2287,15 @@ if test x$WITH_CAL != x0; then
CAL_NEON_CFLAGS=""
if test "x$HAVE_SSE4_2" != x; then
CAL_SSE4_2_CFLAGS="-msse4.2"
+ CAL_CFLAGS="$CAL_CFLAGS $HAVE_SSE4_2"
fi
if test "x$HAVE_AVX2" != x; then
CAL_AVX2_CFLAGS="-mavx2"
+ CAL_CFLAGS="$CAL_CFLAGS $HAVE_AVX2"
fi
if test "x$HAVE_NEON" != x; then
CAL_NEON_CFLAGS="-mfpu=neon -mcpu=cortex-a53"
+ CAL_CFLAGS="$CAL_CFLAGS $HAVE_NEON"
fi
fi
@@ -2479,6 +2483,14 @@ PDF_MAK="\$(GLSRCDIR)\$(D)stub.mak"
PDFROMFS_MAK="\$(GLSRCDIR)\$(D)stub.mak"
if test x"$with_pdf" != x"no" ; then
+
+ if test x"$JBIG2_DECODER" = x""; then
+ AC_MSG_ERROR([No JBIG2 decoder available, required for PDF support])
+ fi
+ if test x"$JPX_DECODER" = x""; then
+ AC_MSG_ERROR([No JPX/JPEG2000 decoder available, required for PDF support])
+ fi
+
if test -f $srcdir/pdf/pdf.mak; then
AC_ARG_WITH([pdf], AS_HELP_STRING([--with-pdf=NAME],
[name of the Ghostpdf executible (if the source is available, ignored otherwise) [[gpdf]]]),
@@ -2883,17 +2895,17 @@ GPDL_SONAME="lib\$(GPDL${libname1}"
GPDL_SONAME_MAJOR="lib\$(GPDL${libname2}"
GPDL_SONAME_MAJOR_MINOR="lib\$(GPDL${libname3}"
-hide_symbols=no
+hide_symbols=yes
attr_default=
attr_hidden=
_ldflags=
AC_ARG_ENABLE([hidden-visibility],
- AS_HELP_STRING([--enable-hidden-visibility],
- [hide all shared library symbols which are not part of its public API]),
- [hide_symbols=yes])
+ AS_HELP_STRING([--disable-hidden-visibility],
+ [expose all shared library symbols even those which are not part of its public API]),
+ [hide_symbols=no])
-if test x$hide_symbols = xyes -a x"$GCC" = x"yes"; then
+if test x"$hide_symbols" = x"yes" -a x"$GCC" = x"yes"; then
attr_default="__attribute__((visibility(\\\"default\\\")))"
attr_hidden="__attribute__((visibility(\\\"hidden\\\")))"
fi
@@ -2915,7 +2927,7 @@ case $host in
SO_LIB_EXT=".so"
;;
*-mingw*|*-msys*)
- if test x$hide_symbols = xyes; then
+ if test x"$hide_symbols" = x"yes"; then
attr_default="__declspec(dllexport)"
attr_hidden=""
else
@@ -2947,7 +2959,7 @@ case $host in
GPDL_SONAME_MAJOR_MINOR="lib\$(GPDL${libname2}"
;;
*-cygwin*)
- if test x$hide_symbols = xyes; then
+ if test x"$hide_symbols" = x"yes"; then
attr_default="__declspec(dllexport)"
attr_hidden=""
fi
@@ -2997,7 +3009,7 @@ case $host in
DYNAMIC_CFLAGS="-fPIC $DYNAMIC_CFLAGS"
else
DYNAMIC_CFLAGS="-KPIC $DYNAMIC_CFLAGS"
- #if test x$hide_symbols = xyes; then
+ #if test x"$hide_symbols" = x"yes"; then
# attr_default="__global"
# attr_hidden="__hidden"
# _ldflags="-xldscope=hidden"
@@ -3034,16 +3046,17 @@ case $host in
;;
esac
-if test x$hide_symbols = xyes ; then
+if test x"$hide_symbols" = x"yes" ; then
if test x"$GCC" = x"yes"; then
DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -fvisibility=hidden"
fi
DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -DGSDLLEXPORT=\"$attr_default\""
if test "x$FT_BRIDGE" = x1 -a "x$SHARE_FT" = x0 ; then
- DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -D\"FT_EXPORT(x)\"=\"$attr_hidden x\""
+ # disable warnings for redefined macros, so our abuse of FT_EXPORT() to hide symbols doesn't flag warnings
+ FT_HIDDEN_CFLAGS="-Wp,-w -D\"FT_EXPORT(x)\"=\"$attr_hidden x\" -D\"FT_EXPORT_DEF(x)\"=\"$attr_hidden x\""
fi
if test "x$SHARE_EXPAT" = x0 ; then
- DYNAMIC_CFLAGS="$DYNAMIC_CFLAGS -DXML_STATIC -DXMLIMPORT=\"$attr_hidden\""
+ XML_HIDDEN_CFLAGS="-DXML_STATIC -DXMLIMPORT=\"$attr_hidden\""
fi
fi
@@ -3065,6 +3078,9 @@ AC_SUBST(GPDL_SONAME)
AC_SUBST(GPDL_SONAME_MAJOR)
AC_SUBST(GPDL_SONAME_MAJOR_MINOR)
+AC_SUBST(FT_HIDDEN_CFLAGS)
+AC_SUBST(XML_HIDDEN_CFLAGS)
+
AC_ARG_ENABLE([dynamic], AS_HELP_STRING([--enable-dynamic],
[Enable dynamically loaded drivers]),
[
diff --git a/cups/gdevcups.c b/cups/gdevcups.c
index eb20ed20..6405122e 100644
--- a/cups/gdevcups.c
+++ b/cups/gdevcups.c
@@ -313,6 +313,9 @@ typedef struct gx_device_cups_s
int Matrix[3][3][CUPS_MAX_VALUE + 1];/* Color transform matrix LUT */
int user_icc;
int cupsRasterVersion;
+ char cupsBackSideOrientation[64];
+ int cupsBackSideFlipMargins;
+ int cupsManualCopies;
char pageSizeRequested[64];
/* Used by cups_put_params(): */
@@ -462,6 +465,9 @@ cups_initialize_device_procs(gx_device *dev)
{{0x00},{0x00},{0x00}}}, /* Matrix */\
0, /* user_icc */\
3, /* cupsRasterVersion */\
+ "Normal", /* cupsBackSideOrientation */\
+ 0, /* cupsBackSideFlipMargins */\
+ 0, /* cupsManualCopies */\
"" /* pageSizeRequested */
gx_device_cups gs_cups_device = { gs_xxx_device("cups", "") };
@@ -1114,6 +1120,27 @@ cups_get_params(gx_device *pdev, /* I - Device info */
goto done;
#endif /* CUPS_RASTER_SYNCv1 */
+ /*
+ * Variables for PPD-less use only. If these settings are defined in the
+ * PPD file, the PPD file's definitions get priority.
+ */
+
+ if ((code = param_write_int(plist, "cupsRasterVersion",
+ (int *)&(cups->cupsRasterVersion))) < 0)
+ goto done;
+
+ param_string_from_transient_string(s, cups->cupsBackSideOrientation);
+ if ((code = param_write_string(plist, "cupsBackSideOrientation", &s)) < 0)
+ goto done;
+
+ b = cups->cupsBackSideFlipMargins;
+ if ((code = param_write_bool(plist, "cupsBackSideFlipMargins", &b)) < 0)
+ goto done;
+
+ b = cups->cupsManualCopies;
+ if ((code = param_write_bool(plist, "cupsManualCopies", &b)) < 0)
+ goto done;
+
done:
#ifdef CUPS_DEBUG2
@@ -2989,7 +3016,8 @@ cups_print_pages(gx_device_printer *pdev,
if (num_copies < 1)
num_copies = 1;
- if (cups->PPD != NULL && !cups->PPD->manual_copies)
+ if ((cups->PPD == NULL && !cups->cupsManualCopies) ||
+ (cups->PPD != NULL && !cups->PPD->manual_copies))
{
cups->header.NumCopies = num_copies;
num_copies = 1;
@@ -3279,6 +3307,69 @@ cups_put_params(gx_device *pdev, /* I - Device info */
goto done;
}
+ /*
+ * Variables for PPD-less use only. If these settings are defined in the
+ * PPD file, the PPD file's definitions get priority.
+ */
+
+ if ((code = param_read_int(plist, "cupsRasterVersion", &intval)) < 0)
+ {
+ dmprintf1(pdev->memory, "ERROR: Error setting %s ...\n",
+ "cupsRasterVersion");
+ param_signal_error(plist, "cupsRasterVersion", code); \
+ goto done;
+ }
+ else if (code == 0)
+ cups->cupsRasterVersion = (int)intval;
+
+ if ((code = param_read_string(plist, "cupsBackSideOrientation",
+ &stringval)) < 0)
+ {
+ dmprintf1(pdev->memory, "ERROR: Error setting %s...\n",
+ "cupsBackSideOrientation");
+ param_signal_error(plist, "cupsBackSideOrientation", code);
+ goto done;
+ }
+ else if (code == 0)
+ {
+ intval = min(sizeof(cups->cupsBackSideOrientation) - 1, stringval.size);
+ strncpy(cups->cupsBackSideOrientation, (const char *)(stringval.data),
+ intval);
+ cups->cupsBackSideOrientation[intval] = '\0';
+ }
+
+ if ((code = param_read_bool(plist, "cupsBackSideFlipMargins",
+ &boolval)) < 0)
+ {
+ if ((code = param_read_null(plist, "cupsBackSideFlipMargins")) < 0)
+ {
+ dmprintf1(pdev->memory, "ERROR: Error setting %s ...\n",
+ "cupsBackSideFlipMargins");
+ param_signal_error(plist, "cupsBackSideFlipMargins", code);
+ goto done;
+ }
+ if (code == 0)
+ cups->cupsBackSideFlipMargins = CUPS_FALSE;
+ }
+ else if (code == 0)
+ cups->cupsBackSideFlipMargins = (cups_bool_t)boolval;
+
+ if ((code = param_read_bool(plist, "cupsManualCopies",
+ &boolval)) < 0)
+ {
+ if ((code = param_read_null(plist, "cupsManualCopies")) < 0)
+ {
+ dmprintf1(pdev->memory, "ERROR: Error setting %s ...\n",
+ "cupsManualCopies");
+ param_signal_error(plist, "cupsManualCopies", code);
+ goto done;
+ }
+ if (code == 0)
+ cups->cupsManualCopies = CUPS_FALSE;
+ }
+ else if (code == 0)
+ cups->cupsManualCopies = (cups_bool_t)boolval;
+
/*
* Then process standard page device options...
*/
@@ -3900,6 +3991,86 @@ cups_put_params(gx_device *pdev, /* I - Device info */
else
{
/* No PPD file available */
+#ifdef CUPS_DEBUG
+ dmprintf1(pdev->memory, "DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex);
+ dmprintf1(pdev->memory, "DEBUG2: cups->header.Tumble = %d\n", cups->header.Tumble);
+ dmprintf1(pdev->memory, "DEBUG2: cups->page = %d\n", cups->page);
+#endif /* CUPS_DEBUG */
+
+#ifdef CUPS_DEBUG
+ dmprintf1(pdev->memory, "DEBUG2: cupsBackSideOrientation = %s\n",
+ cups->cupsBackSideOrientation);
+#endif /* CUPS_DEBUG */
+
+#ifdef CUPS_DEBUG
+ if (cups->cupsBackSideFlipMargins)
+ dmprintf0(pdev->memory, "DEBUG2: Duplex requires flipped margins\n");
+#endif /* CUPS_DEBUG */
+
+ if (cups->header.Duplex &&
+ (cups->header.Tumble &&
+ (!strcasecmp(cups->cupsBackSideOrientation, "Flipped"))) &&
+ !(cups->page & 1))
+ {
+ xflip = 1;
+ if (!cups->cupsBackSideFlipMargins) {
+#ifdef CUPS_DEBUG
+ dmprintf(pdev->memory, "DEBUG2: (1) Flip: X=1 Y=0\n");
+#endif /* CUPS_DEBUG */
+ yflip = 0;
+ } else {
+#ifdef CUPS_DEBUG
+ dmprintf(pdev->memory, "DEBUG2: (1) Flip: X=1 Y=1\n");
+#endif /* CUPS_DEBUG */
+ yflip = 1;
+ }
+ }
+ else if (cups->header.Duplex &&
+ (!cups->header.Tumble &&
+ (!strcasecmp(cups->cupsBackSideOrientation, "Flipped"))) &&
+ !(cups->page & 1))
+ {
+ xflip = 0;
+ if (!cups->cupsBackSideFlipMargins) {
+#ifdef CUPS_DEBUG
+ dmprintf(pdev->memory, "DEBUG2: (2) Flip: X=0 Y=1\n");
+#endif /* CUPS_DEBUG */
+ yflip = 1;
+ } else {
+#ifdef CUPS_DEBUG
+ dmprintf(pdev->memory, "DEBUG2: (2) Flip: X=0 Y=0\n");
+#endif /* CUPS_DEBUG */
+ yflip = 0;
+ }
+ }
+ else if (cups->header.Duplex &&
+ ((!cups->header.Tumble &&
+ (!strcasecmp(cups->cupsBackSideOrientation, "Rotated"))) ||
+ (cups->header.Tumble &&
+ (!strcasecmp(cups->cupsBackSideOrientation, "ManualTumble")))) &&
+ !(cups->page & 1))
+ {
+ xflip = 1;
+ if (cups->cupsBackSideFlipMargins) {
+#ifdef CUPS_DEBUG
+ dmprintf(pdev->memory, "DEBUG2: (3) Flip: X=1 Y=0\n");
+#endif /* CUPS_DEBUG */
+ yflip = 0;
+ } else {
+#ifdef CUPS_DEBUG
+ dmprintf(pdev->memory, "DEBUG2: (3) Flip: X=1 Y=1\n");
+#endif /* CUPS_DEBUG */
+ yflip = 1;
+ }
+ }
+ else
+ {
+#ifdef CUPS_DEBUG
+ dmprintf(pdev->memory, "DEBUG2: (4) Flip: X=0 Y=0\n");
+#endif /* CUPS_DEBUG */
+ xflip = 0;
+ yflip = 0;
+ }
mediasize[0] = cups->MediaSize[0];
mediasize[1] = cups->MediaSize[1];
#ifdef CUPS_RASTER_SYNCv1
@@ -3914,6 +4085,14 @@ cups_put_params(gx_device *pdev, /* I - Device info */
margins[1] = pdev->HWMargins[1] / 72.0;
margins[2] = pdev->HWMargins[2] / 72.0;
margins[3] = pdev->HWMargins[3] / 72.0;
+ if (xflip == 1)
+ {
+ swap = margins[0]; margins[0] = margins[2]; margins[2] = swap;
+ }
+ if (yflip == 1)
+ {
+ swap = margins[1]; margins[1] = margins[3]; margins[3] = swap;
+ }
#ifdef CUPS_RASTER_SYNCv1
}
else
@@ -4799,6 +4978,8 @@ cups_print_chunked(gx_device_printer *pdev,
#endif
ystart, yend, ystep; /* Loop control for scanline order */
ppd_attr_t *backside = NULL;
+ char *backside_str = "Normal";
+ int flip_duplex = 0;
#ifdef CUPS_DEBUG
dmprintf1(pdev->memory, "DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex);
@@ -4810,30 +4991,34 @@ cups_print_chunked(gx_device_printer *pdev,
if (cups->PPD) {
backside = ppdFindAttr(cups->PPD, "cupsBackSide", NULL);
if (backside) {
-#ifdef CUPS_DEBUG
- dmprintf1(pdev->memory, "DEBUG2: cupsBackSide = %s\n", backside->value);
-#endif /* CUPS_DEBUG */
+ backside_str = backside->value;
cups->PPD->flip_duplex = 0;
}
+ flip_duplex = cups->PPD->flip_duplex;
}
- if (cups->header.Duplex && cups->PPD &&
+ else
+ backside_str = cups->cupsBackSideOrientation;
+#ifdef CUPS_DEBUG
+ dmprintf1(pdev->memory, "DEBUG2: Back side orientation: %s\n", backside_str);
+#endif /* CUPS_DEBUG */
+ if (cups->header.Duplex &&
((!cups->header.Tumble &&
- (cups->PPD->flip_duplex ||
- (backside && !strcasecmp(backside->value, "Rotated")))) ||
+ (flip_duplex ||
+ (!strcasecmp(backside_str, "Rotated")))) ||
(cups->header.Tumble &&
- (backside && (!strcasecmp(backside->value, "Flipped") ||
- !strcasecmp(backside->value, "ManualTumble"))))) &&
+ ((!strcasecmp(backside_str, "Flipped") ||
+ !strcasecmp(backside_str, "ManualTumble"))))) &&
!(cups->page & 1))
xflip = 1;
else
xflip = 0;
- if (cups->header.Duplex && cups->PPD &&
+ if (cups->header.Duplex &&
((!cups->header.Tumble &&
- (cups->PPD->flip_duplex ||
- (backside && (!strcasecmp(backside->value, "Flipped") ||
- !strcasecmp(backside->value, "Rotated"))))) ||
+ (flip_duplex ||
+ ((!strcasecmp(backside_str, "Flipped") ||
+ !strcasecmp(backside_str, "Rotated"))))) ||
(cups->header.Tumble &&
- (backside && !strcasecmp(backside->value, "ManualTumble")))) &&
+ (!strcasecmp(backside_str, "ManualTumble")))) &&
!(cups->page & 1)) {
#ifdef CUPS_DEBUG
yflip = 1;
@@ -5032,6 +5217,8 @@ cups_print_banded(gx_device_printer *pdev,
#endif
ystart, yend, ystep; /* Loop control for scanline order */
ppd_attr_t *backside = NULL;
+ char *backside_str = "Normal";
+ int flip_duplex = 0;
#ifdef CUPS_DEBUG
dmprintf1(pdev->memory, "DEBUG2: cups->header.Duplex = %d\n", cups->header.Duplex);
@@ -5043,30 +5230,34 @@ cups_print_banded(gx_device_printer *pdev,
if (cups->PPD) {
backside = ppdFindAttr(cups->PPD, "cupsBackSide", NULL);
if (backside) {
-#ifdef CUPS_DEBUG
- dmprintf1(pdev->memory, "DEBUG2: cupsBackSide = %s\n", backside->value);
-#endif /* CUPS_DEBUG */
+ backside_str = backside->value;
cups->PPD->flip_duplex = 0;
}
+ flip_duplex = cups->PPD->flip_duplex;
}
- if (cups->header.Duplex && cups->PPD &&
+ else
+ backside_str = cups->cupsBackSideOrientation;
+#ifdef CUPS_DEBUG
+ dmprintf1(pdev->memory, "DEBUG2: Back side orientation: %s\n", backside_str);
+#endif /* CUPS_DEBUG */
+ if (cups->header.Duplex &&
((!cups->header.Tumble &&
- (cups->PPD->flip_duplex ||
- (backside && !strcasecmp(backside->value, "Rotated")))) ||
+ (flip_duplex ||
+ (!strcasecmp(backside_str, "Rotated")))) ||
(cups->header.Tumble &&
- (backside && (!strcasecmp(backside->value, "Flipped") ||
- !strcasecmp(backside->value, "ManualTumble"))))) &&
+ ((!strcasecmp(backside_str, "Flipped") ||
+ !strcasecmp(backside_str, "ManualTumble"))))) &&
!(cups->page & 1))
xflip = 1;
else
xflip = 0;
- if (cups->header.Duplex && cups->PPD &&
+ if (cups->header.Duplex &&
((!cups->header.Tumble &&
- (cups->PPD->flip_duplex ||
- (backside && (!strcasecmp(backside->value, "Flipped") ||
- !strcasecmp(backside->value, "Rotated"))))) ||
+ (flip_duplex ||
+ ((!strcasecmp(backside_str, "Flipped") ||
+ !strcasecmp(backside_str, "Rotated"))))) ||
(cups->header.Tumble &&
- (backside && !strcasecmp(backside->value, "ManualTumble")))) &&
+ (!strcasecmp(backside_str, "ManualTumble")))) &&
!(cups->page & 1)) {
#ifdef CUPS_DEBUG
yflip = 1;
diff --git a/demos/java/gsviewer/install_darwin.sh b/demos/java/gsviewer/install_darwin.sh
deleted file mode 100644
index b6c58b86..00000000
--- a/demos/java/gsviewer/install_darwin.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!bin/bash
-
-echo "Copy gs_jni.dylib"
-cp "../jni/gs_jni/gs_jni.dylib" "gs_jni.dylib"
-
-cd ../../../sobin
-
-echo "Copy libgpdl.dylib"
-cp $(readlink "libgpdl.dylib") "../demos/java/gsviewer"
-
-cd ../demos/java/gsviewer \ No newline at end of file
diff --git a/demos/java/gsviewer/install_linux.sh b/demos/java/gsviewer/install_linux.sh
deleted file mode 100644
index 4772d70a..00000000
--- a/demos/java/gsviewer/install_linux.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!bin/bash
-
-cd ../jni/gs_jni
-
-bash install_linux.sh
-
-cd ../../gsviewer \ No newline at end of file
diff --git a/devices/extract.mak b/devices/extract.mak
index 71f30825..1ed6080b 100644
--- a/devices/extract.mak
+++ b/devices/extract.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2021 Artifex Software, Inc.
+# Copyright (C) 2001-2022 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -22,6 +22,9 @@ $(extract_out_prefix)alloc.$(OBJ): $(EXTRACT_DIR)/src/alloc.c $(MAKEDIR
$(extract_out_prefix)astring.$(OBJ): $(EXTRACT_DIR)/src/astring.c $(MAKEDIRS)
$(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/astring.c
+$(extract_out_prefix)boxer.$(OBJ): $(EXTRACT_DIR)/src/boxer.c $(MAKEDIRS)
+ $(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/boxer.c
+
$(extract_out_prefix)buffer.$(OBJ): $(EXTRACT_DIR)/src/buffer.c $(MAKEDIRS)
$(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/buffer.c
@@ -55,6 +58,9 @@ $(extract_out_prefix)odt_template.$(OBJ): $(EXTRACT_DIR)/src/odt_template.c $(
$(extract_out_prefix)outf.$(OBJ): $(EXTRACT_DIR)/src/outf.c $(MAKEDIRS)
$(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/outf.c
+$(extract_out_prefix)rect.$(OBJ): $(EXTRACT_DIR)/src/rect.c $(MAKEDIRS)
+ $(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/rect.c
+
$(extract_out_prefix)sys.$(OBJ): $(EXTRACT_DIR)/src/sys.c $(MAKEDIRS)
$(extract_cc)$@ $(C_) $(EXTRACT_DIR)/src/sys.c
@@ -70,6 +76,7 @@ $(extract_out_prefix)zip.$(OBJ): $(EXTRACT_DIR)/src/zip.c $(MAKEDIRS)
EXTRACT_OBJS = \
$(extract_out_prefix)alloc.$(OBJ) \
$(extract_out_prefix)astring.$(OBJ) \
+ $(extract_out_prefix)boxer.$(OBJ) \
$(extract_out_prefix)buffer.$(OBJ) \
$(extract_out_prefix)document.$(OBJ) \
$(extract_out_prefix)docx.$(OBJ) \
@@ -81,6 +88,7 @@ EXTRACT_OBJS = \
$(extract_out_prefix)odt.$(OBJ) \
$(extract_out_prefix)odt_template.$(OBJ) \
$(extract_out_prefix)outf.$(OBJ) \
+ $(extract_out_prefix)rect.$(OBJ) \
$(extract_out_prefix)sys.$(OBJ) \
$(extract_out_prefix)text.$(OBJ) \
$(extract_out_prefix)xml.$(OBJ) \
diff --git a/devices/gdevclj.c b/devices/gdevclj.c
index 4d4d9c71..26bf0f0e 100644
--- a/devices/gdevclj.c
+++ b/devices/gdevclj.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -380,7 +380,7 @@ pack_and_compress_scanline(
}
/* clear to up a longword boundary */
- while ((((ulong)p_c) & (sizeof(ulong) - 1)) != 0) {
+ while ((((intptr_t)p_c) & (sizeof(ulong) - 1)) != 0) {
*p_c++ = 0;
*p_m++ = 0;
*p_y++ = 0;
diff --git a/devices/gdevpng.c b/devices/gdevpng.c
index 554c664c..e9e776b5 100644
--- a/devices/gdevpng.c
+++ b/devices/gdevpng.c
@@ -632,6 +632,10 @@ do_png_print_page(gx_device_png * pdev, gp_file * file, bool monod)
num_palette = 0;
}
/* add comment */
+#ifdef CLUSTER
+ strncpy(software_key, "GPL Ghostscript", sizeof(software_key));
+ strncpy(software_text, "GPL Ghostscript", sizeof(software_text));
+#else
strncpy(software_key, "Software", sizeof(software_key));
{
int major = (int)(gs_revision / 1000);
@@ -640,6 +644,7 @@ do_png_print_page(gx_device_png * pdev, gp_file * file, bool monod)
gs_snprintf(software_text, sizeof(software_text), "%s %d.%02d.%d", gs_product, major, minor, patch);
}
+#endif
text_png.compression = -1; /* uncompressed */
text_png.key = software_key;
text_png.text = software_text;
diff --git a/devices/gdevpsd.c b/devices/gdevpsd.c
index d538b784..2a54a471 100644
--- a/devices/gdevpsd.c
+++ b/devices/gdevpsd.c
@@ -942,12 +942,20 @@ psd_setup(psd_write_ctx *xc, gx_devn_prn_device *dev, gp_file *file, int w, int
xc->num_channels = i;
if (dev->color_info.polarity == GX_CINFO_POLARITY_SUBTRACTIVE
&& strcmp(dev->dname, "psdcmykog") != 0) {
+
+ /* Note: num_separation_order_names is only set if
+ SeparationColorNames was setup. If this was not set,
+ we need may need to make use of the ICCOutputColors
+ and page spot colors for our setup. */
if (dev->devn_params.num_separation_order_names == 0) {
/* Page spot colors has been truncated to ensure max
colorants of the target device is not exceeded. This
is set if PDF file was encountered and should be used.
- Also make sure PS file does not exceed limit of device. */
- if (dev->devn_params.page_spot_colors > 0)
+ Also make sure PS file does not exceed limit of device.
+ However, if ICCOutputColors was specified, that should
+ take precedence. */
+ if (dev->devn_params.page_spot_colors > 0 &&
+ dev->icc_struct->spotnames == NULL)
xc->n_extra_channels = dev->devn_params.page_spot_colors;
else {
if (dev->devn_params.separations.num_separations <= (dev->color_info.max_components - NUM_CMYK_COMPONENTS))
@@ -1008,13 +1016,13 @@ psd_setup(psd_write_ctx *xc, gx_devn_prn_device *dev, gp_file *file, int w, int
bool has_tags = (pdev_psd->color_model == psd_DEVICE_CMYKT);
xc->num_channels += xc->n_extra_channels;
- for (i=xc->base_num_channels; i < xc->num_channels; i++) {
+ for (i=xc->base_num_channels + has_tags; i < xc->num_channels; i++) {
int j;
const char *curr = "\377";
int curr_size = 1;
bool compare;
- for (j=xc->base_num_channels; j < (xc->num_channels - has_tags); j++) {
+ for (j=xc->base_num_channels + has_tags; j < xc->num_channels; j++) {
devn_separation_name *separation_name;
separation_name = &(dev->devn_params.separations.names[j - xc->base_num_channels]);
diff --git a/devices/gdevsppr.c b/devices/gdevsppr.c
index 29d34dd9..2806253d 100644
--- a/devices/gdevsppr.c
+++ b/devices/gdevsppr.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -101,7 +101,7 @@ err_code_string(int err_code)
{
if ((err_code<EMOTOR)||(err_code>ESERIAL))
{
- gs_sprintf(err_buffer,"err_code out of range: %d",err_code);
+ gs_snprintf(err_buffer, 80, "err_code out of range: %d",err_code);
return err_buffer;
}
return errmsg[err_code];
diff --git a/devices/gdevtfax.c b/devices/gdevtfax.c
index 531eb964..5acd2626 100644
--- a/devices/gdevtfax.c
+++ b/devices/gdevtfax.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -47,7 +47,7 @@ struct gx_device_tfax_s {
/* The type and range of FillOrder follows TIFF 6 spec */
bool BigEndian; /* true = big endian; false = little endian*/
bool UseBigTIFF;
- uint16 Compression; /* same values as TIFFTAG_COMPRESSION */
+ uint16_t Compression; /* same values as TIFFTAG_COMPRESSION */
bool write_datetime;
TIFF *tif; /* For TIFF output only */
};
@@ -71,7 +71,10 @@ tfax_initialize_device_procs(gx_device *dev)
#define TFAX_DEVICE(dname, print_page, compr)\
{\
FAX_DEVICE_BODY(gx_device_tfax, tfax_initialize_device_procs, dname, print_page),\
- TIFF_DEFAULT_STRIP_SIZE /* strip size byte count */,\
+ /* We want Fax output to be contained in one strip because apparently 'many' fax readers have\
+ * problems reading TIFF images in strips (see commit 0abc209b8460396cdece8fc824c053a2662c4cbf\
+ */\
+ 0 /* strip size byte count */,\
ARCH_IS_BIG_ENDIAN /* default to native endian (i.e. use big endian iff the platform is so*/,\
false, /* default to not using bigtiff */\
compr,\
@@ -160,7 +163,7 @@ tfax_put_params(gx_device * dev, gs_param_list * plist)
bool big_endian = tfdev->BigEndian;
bool usebigtiff = tfdev->UseBigTIFF;
bool write_datetime = tfdev->write_datetime;
- uint16 compr = tfdev->Compression;
+ uint16_t compr = tfdev->Compression;
gs_param_string comprstr;
switch (code = param_read_long(plist, (param_name = "MaxStripSize"), &mss)) {
diff --git a/devices/gdevtifs.c b/devices/gdevtifs.c
index 9c629afa..55ae5a7d 100644
--- a/devices/gdevtifs.c
+++ b/devices/gdevtifs.c
@@ -149,7 +149,7 @@ tiff_put_some_params(gx_device * dev, gs_param_list * plist, int which)
bool big_endian = tfdev->BigEndian;
bool usebigtiff = tfdev->UseBigTIFF;
bool write_datetime = tfdev->write_datetime;
- uint16 compr = tfdev->Compression;
+ uint16_t compr = tfdev->Compression;
gs_param_string comprstr;
long mss = tfdev->MaxStripSize;
long aw = tfdev->AdjustWidth;
@@ -325,11 +325,16 @@ int tiff_set_compression(gx_device_printer *pdev,
TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP, pdev->height);
}
else {
- int rows = max_strip_size /
+ int rows = 0;
+
+ if (pdev->width >=1) {
+ rows = max_strip_size /
gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- TIFFSetField(tif,
+ TIFFSetField(tif,
TIFFTAG_ROWSPERSTRIP,
TIFFDefaultStripSize(tif, max(1, rows)));
+ } else
+ return_error(gs_error_rangecheck);
}
return 0;
@@ -355,6 +360,7 @@ int tiff_set_fields_for_printer(gx_device_printer *pdev,
TIFFSetField(tif, TIFFTAG_XRESOLUTION, (float)xpi);
TIFFSetField(tif, TIFFTAG_YRESOLUTION, (float)ypi);
+#ifndef CLUSTER
{
char revs[32];
#define maxSoftware 40
@@ -372,6 +378,7 @@ int tiff_set_fields_for_printer(gx_device_printer *pdev,
TIFFSetField(tif, TIFFTAG_SOFTWARE, softwareValue);
}
+#endif
if (writedatetime) {
struct tm tms;
time_t t;
@@ -458,7 +465,7 @@ tiff_print_page(gx_device_printer *dev, TIFF *tif, int min_feature_size)
if (row - line_lag >= 0) {
#if defined(ARCH_IS_BIG_ENDIAN) && (!ARCH_IS_BIG_ENDIAN)
if (bpc == 16)
- TIFFSwabArrayOfShort((uint16 *)data,
+ TIFFSwabArrayOfShort((uint16_t *)data,
dev->width * (long)dev->color_info.num_components);
#endif
@@ -565,7 +572,7 @@ tiff_downscale_and_print_page(gx_device_printer *dev, TIFF *tif,
static struct compression_string {
- uint16 id;
+ uint16_t id;
const char *str;
} compression_strings [] = {
{ COMPRESSION_NONE, "none" },
@@ -579,7 +586,7 @@ static struct compression_string {
};
int
-tiff_compression_param_string(gs_param_string *param, uint16 id)
+tiff_compression_param_string(gs_param_string *param, uint16_t id)
{
struct compression_string *c;
for (c = compression_strings; c->str; c++)
@@ -591,7 +598,7 @@ tiff_compression_param_string(gs_param_string *param, uint16 id)
}
int
-tiff_compression_id(uint16 *id, gs_param_string *param)
+tiff_compression_id(uint16_t *id, gs_param_string *param)
{
struct compression_string *c;
for (c = compression_strings; c->str; c++)
@@ -604,7 +611,7 @@ tiff_compression_id(uint16 *id, gs_param_string *param)
return_error(gs_error_undefined);
}
-int tiff_compression_allowed(uint16 compression, byte depth)
+int tiff_compression_allowed(uint16_t compression, byte depth)
{
return ((depth == 1 && (compression == COMPRESSION_NONE ||
compression == COMPRESSION_CCITTRLE ||
diff --git a/devices/gdevtifs.h b/devices/gdevtifs.h
index bbd01bb6..17eacb51 100644
--- a/devices/gdevtifs.h
+++ b/devices/gdevtifs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -32,7 +32,7 @@ typedef struct gx_device_tiff_s {
gx_prn_device_common;
bool BigEndian; /* true = big endian; false = little endian*/
bool UseBigTIFF; /* true = output big tiff file, false don't */
- uint16 Compression; /* same values as TIFFTAG_COMPRESSION */
+ uint16_t Compression; /* same values as TIFFTAG_COMPRESSION */
long MaxStripSize;
long AdjustWidth; /* 0 = no adjust, 1 = adjust to fax values, >1 = adjust to this */
bool write_datetime;
@@ -63,7 +63,7 @@ void tiff_set_handlers (void);
* Sets the compression tag for TIFF and updates the rows_per_strip tag to
* reflect max_strip_size under the new compression scheme.
*/
-#define TIFF_DEFAULT_STRIP_SIZE 1048576
+#define TIFF_DEFAULT_STRIP_SIZE 8192
#define TIFF_DEFAULT_DOWNSCALE 1
@@ -80,17 +80,17 @@ int gdev_tiff_begin_page(gx_device_tiff *tfdev, gp_file *file);
/*
* Returns the gs_param_string that corresponds to the tiff COMPRESSION_* id.
*/
-int tiff_compression_param_string(gs_param_string *param, uint16 id);
+int tiff_compression_param_string(gs_param_string *param, uint16_t id);
/*
* Returns the COMPRESSION_* id which corresponds to 'str'.
*/
-int tiff_compression_id(uint16 *id, gs_param_string *param);
+int tiff_compression_id(uint16_t *id, gs_param_string *param);
/*
* Returns true if 'compression' can be used for encoding a data with a bit
* depth of 'depth' (crle, g3, and g4 only work on 1-bit devices).
*/
-int tiff_compression_allowed(uint16 compression, byte depth);
+int tiff_compression_allowed(uint16_t compression, byte depth);
#endif /* gdevtifs_INCLUDED */
diff --git a/devices/gdevtsep.c b/devices/gdevtsep.c
index fd859ddc..6d75d600 100644
--- a/devices/gdevtsep.c
+++ b/devices/gdevtsep.c
@@ -445,7 +445,7 @@ tiffscaled24_print_page(gx_device_printer * pdev, gp_file * file)
static void
tiff_set_cmyk_fields(gx_device_printer *pdev, TIFF *tif,
short bits_per_sample,
- uint16 compression,
+ uint16_t compression,
long max_strip_size)
{
TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bits_per_sample);
@@ -667,7 +667,7 @@ static dev_proc_decode_color(tiffsep1_decode_color);
bool UseBigTIFF; /* true = output bigtiff, false don't */ \
bool write_datetime; /* true = write DATETIME tag, false = don't */ \
bool PrintSpotCMYK; /* true = print CMYK equivalents for spot inks; false = do nothing */\
- uint16 Compression; /* for the separation files, same values as TIFFTAG_COMPRESSION */\
+ uint16_t Compression; /* for the separation files, same values as TIFFTAG_COMPRESSION */\
long MaxStripSize;\
long BitsPerComponent;\
int max_spots;\
@@ -678,7 +678,8 @@ static dev_proc_decode_color(tiffsep1_decode_color);
bool warning_given; /* avoid issuing lots of warnings */\
gp_file *comp_file; /* Underlying file for tiff_comp */\
TIFF *tiff_comp; /* tiff file for comp file */\
- gsicc_link_t *icclink /* link profile if we are doing post rendering */
+ gsicc_link_t *icclink; /* link profile if we are doing post rendering */\
+ unsigned int page_num_comps /* Number of components at end of page, for cleanup */
/*
* A structure definition for a DeviceN type device
@@ -1224,26 +1225,16 @@ int
tiffsep1_prn_close(gx_device * pdev)
{
tiffsep1_device * const tfdev = (tiffsep1_device *) pdev;
- int num_dev_comp = tfdev->color_info.num_components;
- int num_std_colorants = tfdev->devn_params.num_std_colorant_names;
- int num_order = tfdev->devn_params.num_separation_order_names;
- int num_spot = tfdev->devn_params.separations.num_separations;
char *name= NULL;
int code = gdev_prn_close(pdev);
short map_comp_to_sep[GX_DEVICE_COLOR_MAX_COMPONENTS];
int comp_num;
- int num_comp = number_output_separations(num_dev_comp, num_std_colorants,
- num_order, num_spot);
const char *fmt;
gs_parsed_file_name_t parsed;
if (code < 0)
return code;
- name = (char *)gs_alloc_bytes(pdev->memory, gp_file_name_sizeof, "tiffsep1_prn_close(name)");
- if (!name)
- return_error(gs_error_VMerror);
-
code = gx_parse_output_file_name(&parsed, &fmt, tfdev->fname,
strlen(tfdev->fname), pdev->memory);
if (code < 0) {
@@ -1278,33 +1269,44 @@ tiffsep1_prn_close(gx_device * pdev)
build_comp_to_sep_map((tiffsep_device *)tfdev, map_comp_to_sep);
/* Close the separation files */
- for (comp_num = 0; comp_num < num_comp; comp_num++ ) {
- if (tfdev->sep_file[comp_num] != NULL) {
- int sep_num = map_comp_to_sep[comp_num];
+ for (comp_num = 0; comp_num < tfdev->page_num_comps; comp_num++ ) {
+ const char *lname_empty = "";
+ char *lname = NULL;
- code = create_separation_file_name((tiffsep_device *)tfdev, name,
- gp_file_name_sizeof, sep_num, true);
- if (code < 0) {
- goto done;
- }
- code = gx_device_close_output_file(pdev, name, tfdev->sep_file[comp_num]);
+ if (tfdev->tiff[comp_num] != NULL) {
+ tiff_filename_from_tiff(tfdev->tiff[comp_num], &name);
+ }
+ else {
+ name = (char *)lname_empty;
+ }
+
+ lname = (char *)gs_alloc_bytes(tfdev->memory, strlen(name) + 1, "tiffsep1_prn_close");
+ if (lname == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto done;
+ }
+ memcpy(lname, name, strlen(name) + 1);
+
+ if (tfdev->tiff[comp_num]) {
+ void *t = TIFFClientdata(tfdev->tiff[comp_num]);
+
+ TIFFCleanup(tfdev->tiff[comp_num]);
+ gs_free(pdev->memory, t, sizeof(tifs_io_private), 1, "tiffsep1_prn_close");
+ tfdev->tiff[comp_num] = NULL;
+ }
+ if (tfdev->sep_file[comp_num] != NULL) {
+ code = gx_device_close_output_file(pdev, lname, tfdev->sep_file[comp_num]);
if (code >= 0)
- code = gs_remove_outputfile_control_path(pdev->memory, name);
+ code = gs_remove_outputfile_control_path(pdev->memory, lname);
if (code < 0) {
goto done;
}
tfdev->sep_file[comp_num] = NULL;
}
- if (tfdev->tiff[comp_num]) {
- TIFFCleanup(tfdev->tiff[comp_num]);
- tfdev->tiff[comp_num] = NULL;
- }
+ gs_free_object(tfdev->memory, lname, "tiffsep1_prn_close");
}
done:
-
- if (name)
- gs_free_object(pdev->memory, name, "tiffsep1_prn_close(name)");
return code;
}
@@ -1730,26 +1732,18 @@ int
tiffsep_prn_close(gx_device * pdev)
{
tiffsep_device * const pdevn = (tiffsep_device *) pdev;
- int num_dev_comp = pdevn->color_info.num_components;
- int num_std_colorants = pdevn->devn_params.num_std_colorant_names;
- int num_order = pdevn->devn_params.num_separation_order_names;
- int num_spot = pdevn->devn_params.separations.num_separations;
short map_comp_to_sep[GX_DEVICE_COLOR_MAX_COMPONENTS];
char *name = NULL;
int code;
int comp_num;
- int num_comp = number_output_separations(num_dev_comp, num_std_colorants,
- num_order, num_spot);
gsicc_free_link_dev(pdevn->icclink);
pdevn->icclink = NULL;
- name = (char *)gs_alloc_bytes(pdevn->memory, gp_file_name_sizeof, "tiffsep_prn_close(name)");
- if (!name)
- return_error(gs_error_VMerror);
-
if (pdevn->tiff_comp) {
+ void *t = TIFFClientdata(pdevn->tiff_comp);
TIFFCleanup(pdevn->tiff_comp);
+ gs_free(pdev->memory, t, sizeof(tifs_io_private), 1, "tiffsep_prn_close");
pdevn->tiff_comp = NULL;
}
code = gdev_prn_close(pdev);
@@ -1759,27 +1753,44 @@ tiffsep_prn_close(gx_device * pdev)
build_comp_to_sep_map(pdevn, map_comp_to_sep);
/* Close the separation files */
- for (comp_num = 0; comp_num < num_comp; comp_num++ ) {
- if (pdevn->sep_file[comp_num] != NULL) {
- int sep_num = pdevn->devn_params.separation_order_map[comp_num];
+ for (comp_num = 0; comp_num < pdevn->page_num_comps; comp_num++ ) {
+ const char *lname_empty = "";
+ char *lname = NULL;
- code = create_separation_file_name(pdevn, name,
- gp_file_name_sizeof, sep_num, true);
- if (code < 0) {
- goto done;
- }
- code = tiffsep_close_sep_file(pdevn, name, comp_num);
+ if (pdevn->tiff[comp_num] != NULL) {
+ tiff_filename_from_tiff(pdevn->tiff[comp_num], &name);
+ }
+ else {
+ name = (char *)lname_empty;
+ }
+
+ lname = (char *)gs_alloc_bytes(pdevn->memory, strlen(name) + 1, "tiffsep1_prn_close");
+ if (lname == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto done;
+ }
+ memcpy(lname, name, strlen(name) + 1);
+
+ if (pdevn->tiff[comp_num]) {
+ void *t = TIFFClientdata(pdevn->tiff[comp_num]);
+ TIFFCleanup(pdevn->tiff[comp_num]);
+ gs_free(pdevn->memory, t, sizeof(tifs_io_private), 1, "tiffsep_prn_close");
+ pdevn->tiff[comp_num] = NULL;
+ }
+
+ if (pdevn->sep_file[comp_num]) {
+ code = gx_device_close_output_file((gx_device *)pdevn, lname, pdevn->sep_file[comp_num]);
if (code >= 0)
- code = gs_remove_outputfile_control_path(pdevn->memory, name);
+ code = gs_remove_outputfile_control_path(pdevn->memory, lname);
if (code < 0) {
goto done;
}
+ pdevn->sep_file[comp_num] = NULL;
}
+ gs_free_object(pdevn->memory, lname, "tiffsep1_prn_close");
}
done:
- if (name)
- gs_free_object(pdev->memory, name, "tiffsep_prn_close(name)");
return code;
}
@@ -2123,6 +2134,7 @@ tiffsep_print_page(gx_device_printer * pdev, gp_file * file)
/* Set up the separation output files */
num_comp = number_output_separations( tfdev->color_info.num_components,
num_std_colorants, num_order, num_spot);
+ tfdev->page_num_comps = num_comp;
if (!tfdev->NoSeparationFiles && !num_order && num_comp < num_std_colorants + num_spot) {
dmlprintf(pdev->memory, "Warning: skipping one or more colour separations, see: Devices.htm#TIFF\n");
@@ -2493,6 +2505,8 @@ tiffsep1_print_page(gx_device_printer * pdev, gp_file * file)
/* Set up the separation output files */
num_comp = number_output_separations(tfdev->color_info.num_components,
num_std_colorants, num_order, num_spot);
+ tfdev->page_num_comps = num_comp;
+
build_cmyk_map((gx_device *)tfdev, num_comp, &tfdev->equiv_cmyk_colors, cmyk_map);
if (tfdev->PrintSpotCMYK) {
code = print_cmyk_equivalent_colors((tiffsep_device *)tfdev, num_comp, cmyk_map);
diff --git a/devices/gdevxini.c b/devices/gdevxini.c
index fafcd42a..fcaab232 100644
--- a/devices/gdevxini.c
+++ b/devices/gdevxini.c
@@ -906,16 +906,22 @@ gdev_x_put_params(gx_device * dev, gs_param_list * plist)
/* Get work area */
x_get_work_area(xdev, &area_width, &area_height);
- /* Preserve screen resolution */
- dev->x_pixels_per_inch = values.x_pixels_per_inch;
- dev->y_pixels_per_inch = values.y_pixels_per_inch;
- dev->HWResolution[0] = values.HWResolution[0];
- dev->HWResolution[1] = values.HWResolution[1];
-
- /* Recompute window size using screen resolution and available work area size*/
- /* pixels */
- dev->width = min(dev->width, area_width);
- dev->height = min(dev->height, area_height);
+ /* Prioritize HWResolution over page size. If we can't fit the
+ page size at the requested resolution in the available screen
+ area, keep the resolution, clamp the page size.
+ This replaces the previous solution which refused requests to
+ change resolution at all.
+ */
+ if (dev->width > area_width) {
+ outprintf(dev->memory, "\nWARNING: page width %f at %f dpi exceeds available area, clamping width to %f\n",
+ ((dev->width / 72.0) * dev->HWResolution[0]), dev->HWResolution[0], ((area_width / 72) * dev->HWResolution[0]));
+ dev->width = area_width;
+ }
+ if (dev->height > area_height) {
+ outprintf(dev->memory, "\nWARNING: page height %f at %f dpi exceeds available area, clamping height to %f\n",
+ ((dev->height / 72.0) * dev->HWResolution[1]), dev->HWResolution[1], ((area_height / 72) * dev->HWResolution[1]));
+ dev->height = area_height;
+ }
if (dev->width <= 0 || dev->height <= 0) {
emprintf3(dev->memory, "Requested pagesize %d x %d not supported by %s device\n",
@@ -924,8 +930,8 @@ gdev_x_put_params(gx_device * dev, gs_param_list * plist)
}
/* points */
- dev->MediaSize[0] = (float)dev->width / xdev->x_pixels_per_inch * 72;
- dev->MediaSize[1] = (float)dev->height / xdev->y_pixels_per_inch * 72;
+ dev->MediaSize[0] = (float)dev->width / dev->HWResolution[0] * 72;
+ dev->MediaSize[1] = (float)dev->height / dev->HWResolution[1] * 72;
dw = dev->width - values.width;
dh = dev->height - values.height;
diff --git a/devices/gxfcopy.c b/devices/gxfcopy.c
index 76f0a19e..571ff646 100644
--- a/devices/gxfcopy.c
+++ b/devices/gxfcopy.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -2108,6 +2108,8 @@ gs_copy_font(gs_font *font, const gs_matrix *orig_matrix, gs_memory_t *mem, gs_f
copied = gs_alloc_struct(mem, gs_font, fstype,
"gs_copy_font(copied font)");
if (copied) {
+ gs_font_base *bfont = (gs_font_base *)copied;
+
/* Initialize the copied font - minumum we need
* so we can safely free it in the "fail:" case
* below
@@ -2118,6 +2120,15 @@ gs_copy_font(gs_font *font, const gs_matrix *orig_matrix, gs_memory_t *mem, gs_f
copied->is_resource = false;
gs_notify_init(&copied->notify_list, mem);
copied->base = copied;
+
+ bfont->FAPI = 0;
+ bfont->FAPI_font_data = 0;
+ bfont->encoding_index = ENCODING_INDEX_UNKNOWN;
+ code = uid_copy(&bfont->UID, mem, "gs_copy_font(UID)");
+ if (code < 0) {
+ uid_set_invalid(&bfont->UID);
+ goto fail;
+ }
}
cfdata = gs_alloc_struct(mem, gs_copied_font_data_t,
&st_gs_copied_font_data,
@@ -2179,16 +2190,6 @@ gs_copy_font(gs_font *font, const gs_matrix *orig_matrix, gs_memory_t *mem, gs_f
copied->procs.encode_char = procs->encode_char;
copied->procs.glyph_info = procs->glyph_info;
copied->procs.glyph_outline = procs->glyph_outline;
- {
- gs_font_base *bfont = (gs_font_base *)copied;
-
- bfont->FAPI = 0;
- bfont->FAPI_font_data = 0;
- bfont->encoding_index = ENCODING_INDEX_UNKNOWN;
- code = uid_copy(&bfont->UID, mem, "gs_copy_font(UID)");
- if (code < 0)
- goto fail;
- }
cfdata->procs = procs;
memset(glyphs, 0, glyphs_size * sizeof(*glyphs));
diff --git a/devices/vector/doc_common.c b/devices/vector/doc_common.c
index c7d38836..4575aea4 100644
--- a/devices/vector/doc_common.c
+++ b/devices/vector/doc_common.c
@@ -1,3 +1,18 @@
+/* Copyright (C) 2018-2022 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
#include "doc_common.h"
#include "gxfont.h"
@@ -32,6 +47,7 @@ font_orig_matrix(const gs_font *font, gs_glyph cid, gs_matrix *pmat)
case ft_encrypted2:
case ft_CID_encrypted:
case ft_user_defined:
+ case ft_PDF_user_defined:
case ft_PCL_user_defined:
case ft_GL2_stick_user_defined:
case ft_GL2_531:
diff --git a/devices/vector/doc_common.h b/devices/vector/doc_common.h
index 24369054..08fba48b 100644
--- a/devices/vector/doc_common.h
+++ b/devices/vector/doc_common.h
@@ -1,3 +1,18 @@
+/* Copyright (C) 2018-2022 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
#ifndef gdevtxtw_INCLUDED
#define gdevtxtw_INCLUDED
diff --git a/devices/vector/gdevdocxw.c b/devices/vector/gdevdocxw.c
index b637a4c8..7783bff4 100644
--- a/devices/vector/gdevdocxw.c
+++ b/devices/vector/gdevdocxw.c
@@ -273,7 +273,8 @@ docxwrite_open_device(gx_device * dev)
code = s_errno_to_gs();
goto end;
}
- if (extract_page_begin(tdev->extract)) {
+ /* Pass dummy page bbox for now; our simple use of extract ignores it. */
+ if (extract_page_begin(tdev->extract, 0, 0, 0, 0)) {
code = s_errno_to_gs();
goto end;
}
@@ -383,7 +384,8 @@ docxwrite_output_page(gx_device * dev, int num_copies, int flush)
goto end;
}
}
- if (extract_page_begin(tdev->extract)) {
+ /* Pass dummy page bbox for now; our simple use of extract ignores it. */
+ if (extract_page_begin(tdev->extract, 0, 0, 0, 0)) {
code = s_errno_to_gs();
goto end;
}
@@ -939,13 +941,16 @@ docxwrite_process_cmap_text(gx_device_docxwrite_t *tdev, gs_text_enum_t *pte)
txt_get_unicode(penum->dev, (gs_font *)pte->orig_font, glyph, chr, &buffer[0]);
+ /* Pass dummy glyph bbox because our use of extract does not
+ currently cause it to be used. */
if (extract_add_char(
tdev->extract,
tdev->x,
fixed2float(penum->origin.y) - penum->text_state->matrix.ty,
buffer[0] /*ucs*/,
glyph_width / penum->text_state->size /*adv*/,
- 0 /*autosplit*/
+ 0 /*autosplit*/,
+ 0, 0, 0, 0 /* bbox*/
)) {
return s_errno_to_gs();
}
@@ -1095,13 +1100,16 @@ docxwrite_process_plain_text(gx_device_docxwrite_t *tdev, gs_text_enum_t *pte)
* 'extra' code points' widths to 0.
*/
+ /* Pass dummy glyph bbox because our use of extract does not currently
+ cause it to be used. */
if (extract_add_char(
tdev->extract,
tdev->x,
fixed2float(penum->origin.y) - penum->text_state->matrix.ty,
chr2[0] /*ucs*/,
glyph_width / penum->text_state->size /*adv*/,
- 0 /*autosplit*/
+ 0 /*autosplit*/,
+ 0, 0, 0, 0 /*bbox*/
)) {
return s_errno_to_gs();
}
diff --git a/devices/vector/gdevpdf.c b/devices/vector/gdevpdf.c
index cb268f62..40beb06a 100644
--- a/devices/vector/gdevpdf.c
+++ b/devices/vector/gdevpdf.c
@@ -425,6 +425,7 @@ pdf_initialize_ids(gx_device_pdf * pdev)
* date and time, rather than (for example) %%CreationDate from the
* PostScript file. We think this is wrong, but we do the same.
*/
+ if (!pdev->OmitInfoDate)
{
struct tm tms;
time_t t;
@@ -466,6 +467,7 @@ pdf_initialize_ids(gx_device_pdf * pdev)
static int
pdf_compute_fileID(gx_device_pdf * pdev)
{
+
/* We compute a file identifier when beginning a document
to allow its usage with PDF encryption. Due to that,
in contradiction to the Adobe recommendation, our
@@ -933,10 +935,14 @@ pdf_ferror(gx_device_pdf *pdev)
{
gp_fflush(pdev->file);
gp_fflush(pdev->xref.file);
- sflush(pdev->strm);
- sflush(pdev->asides.strm);
- sflush(pdev->streams.strm);
- sflush(pdev->pictures.strm);
+ if (pdev->strm->file != NULL)
+ sflush(pdev->strm);
+ if (pdev->asides.strm->file != NULL)
+ sflush(pdev->asides.strm);
+ if (pdev->streams.strm->file != NULL)
+ sflush(pdev->streams.strm);
+ if (pdev->pictures.strm->file != NULL)
+ sflush(pdev->pictures.strm);
return gp_ferror(pdev->file) || gp_ferror(pdev->xref.file) ||
gp_ferror(pdev->asides.file) || gp_ferror(pdev->streams.file) ||
gp_ferror(pdev->pictures.file);
@@ -1139,13 +1145,14 @@ pdf_write_page(gx_device_pdf *pdev, int page_num)
pdf_page_t *page;
double mediabox[4] = {0, 0};
stream *s;
- const cos_value_t *v_mediabox;
+ const cos_value_t *v_mediabox = NULL;
if (pdev->pages == NULL)
return_error(gs_error_undefined);
page = &pdev->pages[page_num - 1];
- v_mediabox = cos_dict_find_c_key(page->Page, "/MediaBox");
+ if (page->Page != NULL)
+ v_mediabox = cos_dict_find_c_key(page->Page, "/MediaBox");
page_id = pdf_page_id(pdev, page_num);
/* If we have not been given a MediaBox overriding pdfmark, use the current media size. */
@@ -1170,7 +1177,8 @@ pdf_write_page(gx_device_pdf *pdev, int page_num)
buf[l] = 0;
if (sscanf(buf, "[ %g %g %g %g ]",
&temp[0], &temp[1], &temp[2], &temp[3]) == 4) {
- cos_dict_delete_c_key(page->Page, "/MediaBox");
+ if (page->Page)
+ cos_dict_delete_c_key(page->Page, "/MediaBox");
}
pprintg4(s, "<</Type/Page/MediaBox [%g %g %g %g]\n",
temp[0], temp[1], temp[2], temp[3]);
@@ -1178,13 +1186,20 @@ pdf_write_page(gx_device_pdf *pdev, int page_num)
mediabox[i] = temp[i];
}
if (pdev->PDFX) {
- const cos_value_t *v_trimbox = cos_dict_find_c_key(page->Page, "/TrimBox");
- const cos_value_t *v_artbox = cos_dict_find_c_key(page->Page, "/ArtBox");
- const cos_value_t *v_cropbox = cos_dict_find_c_key(page->Page, "/CropBox");
- const cos_value_t *v_bleedbox = cos_dict_find_c_key(page->Page, "/BleedBox");
- double trimbox[4] = {0, 0}, bleedbox[4] = {0, 0};
+ const cos_value_t *v_trimbox = NULL;
+ const cos_value_t *v_artbox = NULL;
+ const cos_value_t *v_cropbox = NULL;
+ const cos_value_t *v_bleedbox = NULL;
+ float trimbox[4] = {0, 0}, bleedbox[4] = {0, 0};
bool print_bleedbox = false;
+ if (page->Page != NULL) {
+ v_trimbox = cos_dict_find_c_key(page->Page, "/TrimBox");
+ v_artbox = cos_dict_find_c_key(page->Page, "/ArtBox");
+ v_cropbox = cos_dict_find_c_key(page->Page, "/CropBox");
+ v_bleedbox = cos_dict_find_c_key(page->Page, "/BleedBox");
+ }
+
trimbox[2] = bleedbox[2] = mediabox[2];
trimbox[3] = bleedbox[3] = mediabox[3];
/* Offsets are [left right top bottom] according to the Acrobat 7.0
@@ -1203,9 +1218,10 @@ pdf_write_page(gx_device_pdf *pdev, int page_num)
trimbox[1] = temp[1];
trimbox[2] = temp[2];
trimbox[3] = temp[3];
- cos_dict_delete_c_key(page->Page, "/TrimBox");
+ if (page->Page != NULL)
+ cos_dict_delete_c_key(page->Page, "/TrimBox");
}
- if (v_artbox != NULL && v_artbox->value_type == COS_VALUE_SCALAR)
+ if (v_artbox != NULL && v_artbox->value_type == COS_VALUE_SCALAR && page->Page != NULL)
cos_dict_delete_c_key(page->Page, "/ArtBox");
} else if (v_artbox != NULL && v_artbox->value_type == COS_VALUE_SCALAR) {
@@ -1225,7 +1241,8 @@ pdf_write_page(gx_device_pdf *pdev, int page_num)
trimbox[1] = temp[1];
trimbox[2] = temp[2];
trimbox[3] = temp[3];
- cos_dict_delete_c_key(page->Page, "/ArtBox");
+ if (page->Page != NULL)
+ cos_dict_delete_c_key(page->Page, "/ArtBox");
}
} else {
if (pdev->PDFXTrimBoxToMediaBoxOffset.size >= 4 &&
@@ -1267,7 +1284,8 @@ pdf_write_page(gx_device_pdf *pdev, int page_num)
else
bleedbox[3] = temp[3];
print_bleedbox = true;
- cos_dict_delete_c_key(page->Page, "/BleedBox");
+ if (page->Page != NULL)
+ cos_dict_delete_c_key(page->Page, "/BleedBox");
}
} else if (pdev->PDFXSetBleedBoxToMediaBox)
print_bleedbox = true;
@@ -1330,7 +1348,8 @@ pdf_write_page(gx_device_pdf *pdev, int page_num)
buf[l] = 0;
if (sscanf(buf, "[ %g %g %g %g ]",
&temp[0], &temp[1], &temp[2], &temp[3]) == 4) {
- cos_dict_delete_c_key(page->Page, "/CropBox");
+ if (page->Page != NULL)
+ cos_dict_delete_c_key(page->Page, "/CropBox");
/* Ensure that CropBox is no larger than MediaBox. The spec says *nothing* about
* this, but Acrobat Preflight complains if it is larger. This can happen because
* we apply 'round_box_coord' to the mediabox at the start of this rouinte.
@@ -1386,14 +1405,16 @@ pdf_write_page(gx_device_pdf *pdev, int page_num)
}
}
- if (cos_dict_find_c_key(page->Page, "/TrimBox") == NULL &&
- cos_dict_find_c_key(page->Page, "/ArtBox") == NULL)
- pprintg4(s, "/TrimBox [%g %g %g %g]\n",
- trimbox[0], trimbox[1], trimbox[2], trimbox[3]);
- if (print_bleedbox &&
- cos_dict_find_c_key(page->Page, "/BleedBox") == NULL)
- pprintg4(s, "/BleedBox [%g %g %g %g]\n",
- bleedbox[0], bleedbox[1], bleedbox[2], bleedbox[3]);
+ if (page->Page != NULL) {
+ if (cos_dict_find_c_key(page->Page, "/TrimBox") == NULL &&
+ cos_dict_find_c_key(page->Page, "/ArtBox") == NULL)
+ pprintg4(s, "/TrimBox [%g %g %g %g]\n",
+ trimbox[0], trimbox[1], trimbox[2], trimbox[3]);
+ if (print_bleedbox &&
+ cos_dict_find_c_key(page->Page, "/BleedBox") == NULL)
+ pprintg4(s, "/BleedBox [%g %g %g %g]\n",
+ bleedbox[0], bleedbox[1], bleedbox[2], bleedbox[3]);
+ }
}
pdf_print_orientation(pdev, page);
if (page->UserUnit != 1)
@@ -1480,7 +1501,8 @@ pdf_write_page(gx_device_pdf *pdev, int page_num)
/* Write any elements stored by pdfmarks. */
- cos_dict_elements_write(page->Page, pdev);
+ if (page->Page != NULL)
+ cos_dict_elements_write(page->Page, pdev);
stream_puts(s, ">>\n");
pdf_end_obj(pdev, resourcePage);
@@ -1906,7 +1928,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params
* +1 for the linearisation dict and +1 for the primary hint stream.
*/
linear_params->FirsttrailerOffset = gp_ftell(linear_params->Lin_File.file);
- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n",
+ if (pdev->OmitID)
+ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n",
+ linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, 0);
+ else
+ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %d>>\nstartxref\r\n0\n%%%%EOF\n \n",
linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, 0);
gp_fwrite(LDict, strlen(LDict), 1, linear_params->Lin_File.file);
@@ -2442,7 +2468,11 @@ static int pdf_linearise(gx_device_pdf *pdev, pdf_linearisation_t *linear_params
if (code != 0)
return_error(gs_error_ioerror);
- gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n",
+ if (pdev->OmitID)
+ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n",
+ linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, mainxref);
+ else
+ gs_snprintf(LDict, sizeof(LDict), "\ntrailer\n<</Size %ld/Info %d 0 R/Root %d 0 R/ID[%s%s]/Prev %"PRId64">>\nstartxref\r\n0\n%%%%EOF\n",
linear_params->LastResource + 3, pdev->ResourceUsage[linear_params->Info_id].NewObjectNumber, pdev->ResourceUsage[linear_params->Catalog_id].NewObjectNumber, fileID, fileID, mainxref);
gp_fwrite(LDict, strlen(LDict), 1, linear_params->sfile);
@@ -2871,10 +2901,12 @@ pdf_close(gx_device * dev)
COS_WRITE_OBJECT(pdev->PageLabels, pdev, resourceLabels);
}
- /* Write the document metadata. */
- code1 = pdf_document_metadata(pdev);
- if (code >= 0)
- code = code1;
+ if (!pdev->OmitXMP) {
+ /* Write the document metadata. */
+ code1 = pdf_document_metadata(pdev);
+ if (code >= 0)
+ code = code1;
+ }
/* Write the Catalog. */
@@ -3136,10 +3168,12 @@ pdf_close(gx_device * dev)
stream_puts(s, "trailer\n");
pprintld3(s, "<< /Size %ld /Root %ld 0 R /Info %ld 0 R\n",
pdev->next_id, Catalog_id, Info_id);
- stream_puts(s, "/ID [");
- psdf_write_string(pdev->strm, pdev->fileID, sizeof(pdev->fileID), 0);
- psdf_write_string(pdev->strm, pdev->fileID, sizeof(pdev->fileID), 0);
- stream_puts(s, "]\n");
+ if (!pdev->OmitID) {
+ stream_puts(s, "/ID [");
+ psdf_write_string(pdev->strm, pdev->fileID, sizeof(pdev->fileID), 0);
+ psdf_write_string(pdev->strm, pdev->fileID, sizeof(pdev->fileID), 0);
+ stream_puts(s, "]\n");
+ }
if (pdev->OwnerPassword.size > 0) {
pprintld1(s, "/Encrypt %ld 0 R ", Encrypt_id);
}
@@ -3429,6 +3463,27 @@ error_cleanup:
}
}
+ /* Free named objects. */
+
+ if (pdev->NI_stack != NULL) {
+ cos_release((cos_object_t *)pdev->NI_stack, "Release Name Index stack");
+ gs_free_object(mem, pdev->NI_stack, "Free Name Index stack");
+ pdev->NI_stack = 0;
+ }
+
+ if (pdev->local_named_objects != NULL) {
+ cos_dict_objects_delete(pdev->local_named_objects);
+ COS_FREE(pdev->local_named_objects, "pdf_close(local_named_objects)");
+ pdev->local_named_objects = 0;
+ }
+
+ if (pdev->global_named_objects != NULL) {
+ /* global resources include the Catalog object and apparently the Info dict */
+ cos_dict_objects_delete(pdev->global_named_objects);
+ COS_FREE(pdev->global_named_objects, "pdf_close(global_named_objects)");
+ pdev->global_named_objects = 0;
+ }
+
code1 = pdf_free_resource_objects(pdev, resourceOther);
if (code >= 0)
code = code1;
@@ -3477,27 +3532,6 @@ error_cleanup:
pdev->last_resource = 0;
}
- /* Free named objects. */
-
- if (pdev->NI_stack != NULL) {
- cos_release((cos_object_t *)pdev->NI_stack, "Release Name Index stack");
- gs_free_object(mem, pdev->NI_stack, "Free Name Index stack");
- pdev->NI_stack = 0;
- }
-
- if (pdev->local_named_objects != NULL) {
- cos_dict_objects_delete(pdev->local_named_objects);
- COS_FREE(pdev->local_named_objects, "pdf_close(local_named_objects)");
- pdev->local_named_objects = 0;
- }
-
- if (pdev->global_named_objects != NULL) {
- /* global resources include the Catalog object and apparently the Info dict */
- cos_dict_objects_delete(pdev->global_named_objects);
- COS_FREE(pdev->global_named_objects, "pdf_close(global_named_objects)");
- pdev->global_named_objects = 0;
- }
-
/* Wrap up. */
pdev->font_cache = 0;
@@ -3517,7 +3551,7 @@ error_cleanup:
for (i=0;i < pdev->num_pages;i++) {
if (pdev->pages[i].Page != NULL) {
emprintf(pdev->memory,
- "Page object was reserved for an Annotation destinatio, but no such page was drawn, annotation in output will be invalid.\n");
+ "Page object was reserved for an Annotation destination, but no such page was drawn, annotation in output will be invalid.\n");
gs_free_object(mem, pdev->pages[i].Page, "Free Page object");
pdev->pages[i].Page = NULL;
}
diff --git a/devices/vector/gdevpdfb.c b/devices/vector/gdevpdfb.c
index a7b36d82..1851bab3 100644
--- a/devices/vector/gdevpdfb.c
+++ b/devices/vector/gdevpdfb.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -137,7 +137,7 @@ pdf_copy_mono(gx_device_pdf *pdev,
pdf_stream_position_t ipos;
pdf_resource_t *pres = 0;
byte invert = 0;
- bool in_line = false;
+ bool in_line = false, char_proc_begun = false;
gs_show_enum *show_enum = (gs_show_enum *)pdev->pte;
int x_offset, y_offset;
double width;
@@ -181,6 +181,7 @@ pdf_copy_mono(gx_device_pdf *pdev,
&pcp, &ipos);
if (code < 0)
return code;
+ char_proc_begun = true;
y_offset = -y_offset;
width = psdf_round(pdev->char_width.x, 100, 10); /* See
pdf_write_Widths about rounding. We need to provide
@@ -192,7 +193,7 @@ pdf_copy_mono(gx_device_pdf *pdev,
pdf_image_writer_init(&writer);
code = pdf_begin_write_image(pdev, &writer, gs_no_id, w, h, NULL, true);
if (code < 0)
- return code;
+ goto fail;
pres = (pdf_resource_t *) pcp;
goto wr;
} else if (pdev->pte != NULL) {
@@ -216,13 +217,17 @@ pdf_copy_mono(gx_device_pdf *pdev,
set_image_color(pdev, zero);
} else if (zero == pdev->black && one == pdev->white) {
pcs = gs_cspace_new_DeviceGray(pdev->memory);
- if (pcs == NULL)
- return_error(gs_error_VMerror);
+ if (pcs == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto fail;
+ }
gs_image_t_init(&image, pcs);
} else if (zero == pdev->white && one == pdev->black) {
pcs = gs_cspace_new_DeviceGray(pdev->memory);
- if (pcs == NULL)
- return_error(gs_error_VMerror);
+ if (pcs == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto fail;
+ }
gs_image_t_init(&image, pcs);
invert = 0xff;
} else {
@@ -240,13 +245,14 @@ pdf_copy_mono(gx_device_pdf *pdev,
code = pdf_cspace_init_Device(pdev->memory, &pcs_base, ncomp);
if (code < 0)
- return code;
+ goto fail;
c[0] = psdf_adjust_color_index((gx_device_vector *)pdev, zero);
c[1] = psdf_adjust_color_index((gx_device_vector *)pdev, one);
pcs = gs_cspace_alloc(pdev->memory, &gs_color_space_type_Indexed);
if (pcs == NULL) {
rc_decrement_cs(pcs_base, "pdf_copy_mono");
- return_error(gs_error_VMerror);
+ code = gs_note_error(gs_error_VMerror);
+ goto fail;
}
pcs->base_space = pcs_base;
pcs->params.indexed.hival = 1;
@@ -267,14 +273,14 @@ pdf_copy_mono(gx_device_pdf *pdev,
code = pdf_open_page(pdev, PDF_IN_STREAM);
if (code < 0)
- return code;
+ goto fail;
in_line = nbytes < pdev->MaxInlineImageSize;
if (in_line)
pdf_put_image_matrix(pdev, &image.ImageMatrix, 1.0);
pdf_image_writer_init(&writer);
code = pdf_begin_write_image(pdev, &writer, gs_no_id, w, h, NULL, in_line);
if (code < 0)
- return code;
+ goto fail;
}
wr:
if (image.ImageMask)
@@ -287,7 +293,7 @@ pdf_copy_mono(gx_device_pdf *pdev,
code = pdf_color_space_named(pdev, NULL, &cs_value, NULL, pcs,
&writer.pin->color_spaces, in_line, NULL, 0, false);
if (code < 0)
- return code;
+ goto fail;
pcsvalue = &cs_value;
}
/*
@@ -322,33 +328,37 @@ pdf_copy_mono(gx_device_pdf *pdev,
code = pdf_begin_image_data(pdev, &writer, (const gs_pixel_image_t *)&image,
pcsvalue, 0);
if (code < 0)
- return code;
+ goto fail;
code = pdf_copy_mask_bits(writer.binary[0].strm, base, sourcex, raster,
w, h, invert);
if (code < 0)
- return code;
+ goto fail;
code = pdf_end_image_binary(pdev, &writer, writer.height);
if (code < 0)
- return code;
+ goto fail;
if (!pres) {
switch ((code = pdf_end_write_image(pdev, &writer))) {
default: /* error */
- return code;
+ goto fail;
case 1:
- return 0;
+ code = 0;
+ goto fail;
case 0:
- return pdf_do_image(pdev, writer.pres, &image.ImageMatrix,
+ code = pdf_do_image(pdev, writer.pres, &image.ImageMatrix,
true);
+ goto fail;
}
}
writer.end_string = ""; /* no Q */
switch ((code = pdf_end_write_image(pdev, &writer))) {
default: /* error */
+ goto fail;
return code;
case 0: /* not possible */
- return_error(gs_error_Fatal);
+ code = gs_note_error(gs_error_Fatal);
+ goto fail;
case 1:
break;
}
@@ -365,6 +375,11 @@ pdf_copy_mono(gx_device_pdf *pdev,
imat.yy /= h;
return pdf_do_char_image(pdev, (const pdf_char_proc_t *)pres, &imat);
}
+
+fail:
+ if (char_proc_begun)
+ (void)pdf_end_char_proc(pdev, &ipos);
+ return code;
}
int
gdev_pdf_copy_mono(gx_device * dev,
diff --git a/devices/vector/gdevpdfb.h b/devices/vector/gdevpdfb.h
index b85dffe3..b6439f53 100644
--- a/devices/vector/gdevpdfb.h
+++ b/devices/vector/gdevpdfb.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -237,7 +237,10 @@ const gx_device_pdf PDF_DEVICE_IDENT =
0, /* OCR_char_code */
0, /* OCR_glyph */
NULL, /* ocr_glyphs */
- 0 /* initial_pattern_state */
+ 0, /* initial_pattern_state */
+ false, /* OmitInfoDate */
+ false, /* OmitXMP */
+ false /* OmitID */
};
#else
diff --git a/devices/vector/gdevpdfd.c b/devices/vector/gdevpdfd.c
index ea40111b..892fc4c9 100644
--- a/devices/vector/gdevpdfd.c
+++ b/devices/vector/gdevpdfd.c
@@ -973,13 +973,13 @@ lcvd_close_device_with_writing(gx_device *pdev)
pdf_lcvd_t *cvd = (pdf_lcvd_t *)pdev;
int code, code1;
- code = pdf_dump_converted_image(cvd->pdev, cvd);
+ code = pdf_dump_converted_image(cvd->pdev, cvd, 0);
code1 = cvd->std_close_device((gx_device *)&cvd->mdev);
return code < 0 ? code : code1;
}
static int
-write_image(gx_device_pdf *pdev, gx_device_memory *mdev, gs_matrix *m)
+write_image(gx_device_pdf *pdev, gx_device_memory *mdev, gs_matrix *m, int for_pattern)
{
gs_image_t image;
pdf_image_writer writer;
@@ -990,7 +990,7 @@ write_image(gx_device_pdf *pdev, gx_device_memory *mdev, gs_matrix *m)
pdf_put_matrix(pdev, NULL, m, " cm\n");
code = pdf_copy_color_data(pdev, mdev->base, sourcex,
mdev->raster, gx_no_bitmap_id, 0, 0, mdev->width, mdev->height,
- &image, &writer, 2);
+ &image, &writer, for_pattern);
if (code == 1)
code = 0; /* Empty image. */
else if (code == 0)
@@ -1176,7 +1176,7 @@ mask_to_clip(gx_device_pdf *pdev, int width, int height,
}
static int
-write_subimage(gx_device_pdf *pdev, gx_device_memory *mdev, int x, int y, int x1, int y1)
+write_subimage(gx_device_pdf *pdev, gx_device_memory *mdev, int x, int y, int x1, int y1, int for_pattern)
{
gs_image_t image;
pdf_image_writer writer;
@@ -1190,7 +1190,7 @@ write_subimage(gx_device_pdf *pdev, gx_device_memory *mdev, int x, int y, int x1
code = pdf_copy_color_data(pdev, mdev->base + mdev->raster * Y, X,
mdev->raster, gx_no_bitmap_id,
X, Y, X1 - X, Y1 - Y,
- &image, &writer, 2);
+ &image, &writer, for_pattern);
if (code < 0)
return code;
if (!writer.pres)
@@ -1199,7 +1199,7 @@ write_subimage(gx_device_pdf *pdev, gx_device_memory *mdev, int x, int y, int x1
}
static int
-write_image_with_clip(gx_device_pdf *pdev, pdf_lcvd_t *cvd)
+write_image_with_clip(gx_device_pdf *pdev, pdf_lcvd_t *cvd, int for_pattern)
{
int x = 0, y = 0;
int code, code1;
@@ -1219,7 +1219,7 @@ write_image_with_clip(gx_device_pdf *pdev, pdf_lcvd_t *cvd)
if (code < 0)
return code;
if (code > 0) {
- code1 = write_subimage(pdev, &cvd->mdev, x, y, x1, y1);
+ code1 = write_subimage(pdev, &cvd->mdev, x, y, x1, y1, for_pattern);
if (code1 < 0)
return code1;
}
@@ -1241,14 +1241,14 @@ write_image_with_clip(gx_device_pdf *pdev, pdf_lcvd_t *cvd)
}
int
-pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd)
+pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd, int for_pattern)
{
int code = 0;
if (!cvd->path_is_empty || cvd->has_background) {
if (!cvd->has_background)
stream_puts(pdev->strm, "W n\n");
- code = write_image(pdev, &cvd->mdev, (cvd->write_matrix ? &cvd->m : NULL));
+ code = write_image(pdev, &cvd->mdev, (cvd->write_matrix ? &cvd->m : NULL), for_pattern);
cvd->path_is_empty = true;
} else if (!cvd->mask_is_empty && pdev->PatternImagemask) {
/* Convert to imagemask with a pattern color. */
@@ -1288,7 +1288,7 @@ pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd)
if (code >= 0) {
stream_puts(pdev->strm, "W n\n");
- code = write_image(pdev, &cvd->mdev, NULL);
+ code = write_image(pdev, &cvd->mdev, NULL, for_pattern);
}
pres = pdev->accumulating_substream_resource;
if (code >= 0) {
@@ -1302,7 +1302,7 @@ pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd)
}
if (code >= 0)
code = (*dev_proc(pdev, dev_spec_op))((gx_device *)pdev,
- gxdso_pattern_load, &inst, id);
+ gxdso_pattern_load, &id, sizeof(gs_id));
if (code >= 0)
code = pdf_cs_Pattern_colored(pdev, &v);
if (code >= 0) {
@@ -1315,7 +1315,7 @@ pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd)
} else if (!cvd->mask_is_empty && !pdev->PatternImagemask) {
/* Convert to image with a clipping path. */
stream_puts(pdev->strm, "q\n");
- code = write_image_with_clip(pdev, cvd);
+ code = write_image_with_clip(pdev, cvd, for_pattern);
stream_puts(pdev->strm, "Q\n");
}
if (code > 0)
@@ -1338,7 +1338,7 @@ lcvd_handle_fill_path_as_shading_coverage(gx_device *dev,
if (gx_path_is_null(ppath)) {
/* use the mask. */
if (!cvd->path_is_empty) {
- code = pdf_dump_converted_image(pdev, cvd);
+ code = pdf_dump_converted_image(pdev, cvd, 2);
if (code < 0)
return code;
stream_puts(pdev->strm, "Q q\n");
@@ -1362,7 +1362,7 @@ lcvd_handle_fill_path_as_shading_coverage(gx_device *dev,
gs_make_translation(cvd->path_offset.x, cvd->path_offset.y, &m);
/* use the clipping. */
if (!cvd->mask_is_empty) {
- code = pdf_dump_converted_image(pdev, cvd);
+ code = pdf_dump_converted_image(pdev, cvd, 2);
if (code < 0)
return code;
stream_puts(pdev->strm, "Q q\n");
@@ -1685,7 +1685,7 @@ gdev_pdf_fill_path(gx_device * dev, const gs_gstate * pgs, gx_path * ppath,
code = gs_shading_do_fill_rectangle(pi.templat.Shading,
NULL, (gx_device *)&cvd.mdev, pgs2, !pi.shfill);
if (code >= 0)
- code = pdf_dump_converted_image(pdev, &cvd);
+ code = pdf_dump_converted_image(pdev, &cvd, 2);
stream_puts(pdev->strm, "Q Q\n");
pdf_remove_masked_image_converter(pdev, &cvd, need_mask);
gs_setmatrix((gs_gstate *)pgs, &save_ctm);
diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c
index ec011d8b..66767bd9 100644
--- a/devices/vector/gdevpdfe.c
+++ b/devices/vector/gdevpdfe.c
@@ -568,7 +568,7 @@ pdf_make_uuid(const byte node[6], uint64_t uuid_time, ulong time_seq, char *buf,
writehex(&p, node[4], 1);
writehex(&p, node[5], 1);
*p = 0;
- strncpy(buf, b, buf_length);
+ strncpy(buf, b, strlen(b) + 1);
}
static int
@@ -696,21 +696,23 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
pdf_xml_attribute_name(s, "xmlns:xmp");
pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/");
pdf_xml_tag_end(s);
- {
- pdf_xml_tag_open_beg(s, "xmp:ModifyDate");
- pdf_xml_tag_end(s);
- mod_date_time[mod_date_time_len] = 0x00;
- pdf_xml_copy(s, mod_date_time);
- pdf_xml_tag_close(s, "xmp:ModifyDate");
- pdf_xml_newline(s);
- }
- {
- pdf_xml_tag_open_beg(s, "xmp:CreateDate");
- pdf_xml_tag_end(s);
- cre_date_time[cre_date_time_len] = 0x00;
- pdf_xml_copy(s, cre_date_time);
- pdf_xml_tag_close(s, "xmp:CreateDate");
- pdf_xml_newline(s);
+ if (!pdev->OmitInfoDate) {
+ {
+ pdf_xml_tag_open_beg(s, "xmp:ModifyDate");
+ pdf_xml_tag_end(s);
+ mod_date_time[mod_date_time_len] = 0x00;
+ pdf_xml_copy(s, mod_date_time);
+ pdf_xml_tag_close(s, "xmp:ModifyDate");
+ pdf_xml_newline(s);
+ }
+ {
+ pdf_xml_tag_open_beg(s, "xmp:CreateDate");
+ pdf_xml_tag_end(s);
+ cre_date_time[cre_date_time_len] = 0x00;
+ pdf_xml_copy(s, cre_date_time);
+ pdf_xml_tag_close(s, "xmp:CreateDate");
+ pdf_xml_newline(s);
+ }
}
{
pdf_xml_tag_open_beg(s, "xmp:CreatorTool");
diff --git a/devices/vector/gdevpdfg.c b/devices/vector/gdevpdfg.c
index d61712b0..3e2a2b6d 100644
--- a/devices/vector/gdevpdfg.c
+++ b/devices/vector/gdevpdfg.c
@@ -3069,7 +3069,7 @@ pdf_prepare_drawing(gx_device_pdf *pdev, const gs_gstate *pgs,
break;
default:
emprintf(pdev->memory,
- "\nSetting Overprint Mode to 1\n not permitted in PDF/A, unrecognised PDFACompatibilityLevel,\nreverting to normal PDF output\n");
+ "\nSetting Halftone Phase or Halftone Offset\n not permitted in PDF/A, unrecognised PDFACompatibilityLevel,\nreverting to normal PDF output\n");
pdev->AbortPDFAX = true;
pdev->PDFA = 0;
break;
diff --git a/devices/vector/gdevpdfi.c b/devices/vector/gdevpdfi.c
index 1e1a9daa..1de48cee 100644
--- a/devices/vector/gdevpdfi.c
+++ b/devices/vector/gdevpdfi.c
@@ -1872,7 +1872,7 @@ use_image_as_pattern(gx_device_pdf *pdev, pdf_resource_t *pres1,
}
if (code >= 0)
code = (*dev_proc(pdev, dev_spec_op))((gx_device *)pdev,
- gxdso_pattern_load, &inst, id);
+ gxdso_pattern_load, &id, sizeof(gs_id));
if (code >= 0) {
stream_puts(pdev->strm, "q ");
code = pdf_cs_Pattern_colored(pdev, &v);
@@ -2032,7 +2032,7 @@ pdf_image_end_image(gx_image_enum_common_t * info, bool draw_last)
static int
pdf_image_end_image_cvd(gx_image_enum_common_t * info, bool draw_last)
{ pdf_lcvd_t *cvd = (pdf_lcvd_t *)info->dev;
- int code = pdf_dump_converted_image(cvd->pdev, cvd);
+ int code = pdf_dump_converted_image(cvd->pdev, cvd, 0);
int code1 = gx_image1_end_image(info, draw_last);
int code2 = gs_closedevice((gx_device *)cvd->mask);
int code3 = gs_closedevice((gx_device *)cvd);
@@ -2214,8 +2214,10 @@ pdf_image3x_make_mcde(gx_device *dev, const gs_gstate *pgs,
code = pdf_begin_typed_image
((gx_device_pdf *)dev, pgs, pmat, pic, prect, pdcolor, pcpath, mem,
pinfo, PDF_IMAGE_TYPE3_DATA);
- if (code < 0)
+ if (code < 0) {
+ rc_decrement(*pmcdev, "pdf_image3x_make_mcde");
return code;
+ }
if ((*pinfo)->procs != &pdf_image_enum_procs) {
/* We couldn't handle the image. Bail out. */
gx_image_end(*pinfo, false);
@@ -2695,7 +2697,6 @@ gdev_pdf_dev_spec_op(gx_device *pdev1, int dev_spec_op, void *data, int size)
gs_pattern1_instance_t *pinst = param->pinst;
gs_gstate *pgs = param->graphics_state;
- id = param->pinst_id;
code = pdf_check_soft_mask(pdev, (gs_gstate *)pgs);
if (code < 0)
return code;
@@ -2735,7 +2736,7 @@ gdev_pdf_dev_spec_op(gx_device *pdev1, int dev_spec_op, void *data, int size)
memset(pdev->initial_pattern_states[pdev->PatternDepth], 0x00, sizeof(gs_gstate));
reset_gstate_for_pattern(pdev, pdev->initial_pattern_states[pdev->PatternDepth], pgs);
- code = pdf_enter_substream(pdev, resourcePattern, id, &pres, false,
+ code = pdf_enter_substream(pdev, resourcePattern, pinst->id, &pres, false,
pdev->CompressStreams);
if (code < 0) {
gs_free_object(pdev->pdf_memory->non_gc_memory, pdev->initial_pattern_states[pdev->PatternDepth], "Freeing dangling pattern state");
@@ -2751,7 +2752,7 @@ gdev_pdf_dev_spec_op(gx_device *pdev1, int dev_spec_op, void *data, int size)
* the ID is restored when we finish capturing the pattern.
*/
pdev->state.soft_mask_id = pgs->soft_mask_id;
- pres->rid = id;
+ pres->rid = pinst->id;
code = pdf_store_pattern1_params(pdev, pres, pinst);
if (code < 0) {
gs_free_object(pdev->pdf_memory->non_gc_memory, pdev->initial_pattern_states[pdev->PatternDepth], "Freeing dangling pattern state");
@@ -2830,7 +2831,7 @@ gdev_pdf_dev_spec_op(gx_device *pdev1, int dev_spec_op, void *data, int size)
}
return 1;
case gxdso_pattern_load:
- pres = pdf_find_resource_by_gs_id(pdev, resourcePattern, id);
+ pres = pdf_find_resource_by_gs_id(pdev, resourcePattern, *((gx_bitmap_id *)data));
if (pres == 0)
return 0;
pres = pdf_substitute_pattern(pres);
diff --git a/devices/vector/gdevpdfj.c b/devices/vector/gdevpdfj.c
index 02692510..5888ac70 100644
--- a/devices/vector/gdevpdfj.c
+++ b/devices/vector/gdevpdfj.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -348,8 +348,10 @@ pdf_begin_write_image(gx_device_pdf * pdev, pdf_image_writer * piw,
}
pdev->strm = pdev->streams.strm;
pdev->strm = cos_write_stream_alloc(data, pdev, "pdf_begin_write_image");
- if (pdev->strm == 0)
+ if (pdev->strm == 0) {
+ pdev->strm = save_strm;
return_error(gs_error_VMerror);
+ }
if (!mask)
piw->data = data;
piw->height = h;
diff --git a/devices/vector/gdevpdfo.c b/devices/vector/gdevpdfo.c
index 3ec00f5e..e00a9258 100644
--- a/devices/vector/gdevpdfo.c
+++ b/devices/vector/gdevpdfo.c
@@ -1485,6 +1485,8 @@ cos_dict_find(const cos_dict_t *pcd, const byte *key_data, uint key_size)
const cos_value_t *
cos_dict_find_c_key(const cos_dict_t *pcd, const char *key)
{
+ if (pcd == NULL)
+ return NULL;
return cos_dict_find(pcd, (const byte *)key, strlen(key));
}
diff --git a/devices/vector/gdevpdfp.c b/devices/vector/gdevpdfp.c
index 42fa1c52..690a9e13 100644
--- a/devices/vector/gdevpdfp.c
+++ b/devices/vector/gdevpdfp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -129,6 +129,9 @@ static const gs_param_item_t pdf_param_items[] = {
pi("NoOutputFonts", gs_param_type_bool, FlattenFonts),
pi("WantsPageLabels", gs_param_type_bool, WantsPageLabels),
pi("UserUnit", gs_param_type_float, UserUnit),
+ pi("OmitInfoDate", gs_param_type_bool, OmitInfoDate),
+ pi("OmitID", gs_param_type_bool, OmitID),
+ pi("OmitXMP", gs_param_type_bool, OmitXMP),
#undef pi
gs_param_item_end
};
@@ -297,6 +300,13 @@ gdev_pdf_get_param(gx_device *dev, char *Param, void *list)
}
#endif
+ if (strcmp(Param, "OmitInfoDate") == 0)
+ return(param_write_bool(plist, "OmitInfoDate", &pdev->OmitInfoDate));
+ if (strcmp(Param, "OmitXMP") == 0)
+ return(param_write_bool(plist, "OmitXMP", &pdev->OmitXMP));
+ if (strcmp(Param, "OmitID") == 0)
+ return(param_write_bool(plist, "OmitID", &pdev->OmitID));
+
return gdev_psdf_get_param(dev, Param, list);
}
@@ -649,6 +659,25 @@ gdev_pdf_put_params_impl(gx_device * dev, const gx_device_pdf * save_dev, gs_par
param_signal_error(plist, param_name, code);
}
+ if (pdev->OmitInfoDate && pdev->PDFX != 0) {
+ emprintf(pdev->memory, "\nIt is not possible to omit the CreationDate when creating PDF/X\nOmitInfoDate is being ignored.\n");
+ pdev->OmitInfoDate = 0;
+ }
+
+ if (pdev->OmitID && pdev->CompatibilityLevel > 1.7) {
+ emprintf(pdev->memory, "\nIt is not possible to omit the ID array when creating a version 2.0 or greater PDF\nOmitID is being ignored.\n");
+ pdev->OmitID = 0;
+ }
+ if (pdev->OmitID && pdev->OwnerPassword.size != 0) {
+ emprintf(pdev->memory, "\nIt is not possible to omit the ID array when creating an encrypted PDF\nOmitID is being ignored.\n");
+ pdev->OmitID = 0;
+ }
+
+ if (pdev->OmitXMP && pdev->PDFA != 0) {
+ emprintf(pdev->memory, "\nIt is not possible to omit the XMP metadta when creating a PDF/A\nOmitXMP is being ignored.\n");
+ pdev->OmitXMP = 0;
+ }
+
/* PDFA and PDFX are stored in the page device dictionary and therefore
* set on every setpagedevice. However, if we have encountered a file which
* can't be made this way, and the PDFACompatibilityPolicy is 1, we want to
diff --git a/devices/vector/gdevpdft.c b/devices/vector/gdevpdft.c
index 72f082f9..6f50df01 100644
--- a/devices/vector/gdevpdft.c
+++ b/devices/vector/gdevpdft.c
@@ -110,8 +110,12 @@ pdf_make_group_dict(gx_device_pdf * pdev, const gs_pdf14trans_params_t * pparams
if (pgs != NULL && pparams->group_color_type != UNKNOWN) {
const gs_color_space *cs = gs_currentcolorspace_inline(pgs);
- code = pdf_color_space_named(pdev, pgs, &cs_value, NULL, cs,
- &pdf_color_space_names, false, NULL, 0, false);
+ if (pparams->ColorSpace == NULL)
+ code = pdf_color_space_named(pdev, pgs, &cs_value, NULL, cs,
+ &pdf_color_space_names, false, NULL, 0, false);
+ else
+ code = pdf_color_space_named(pdev, pgs, &cs_value, NULL, pparams->ColorSpace,
+ &pdf_color_space_names, false, NULL, 0, false);
if (code < 0)
return code;
code = cos_dict_put_c_key(group_dict, "/CS", &cs_value);
diff --git a/devices/vector/gdevpdfu.c b/devices/vector/gdevpdfu.c
index f12fa38e..9545bd58 100644
--- a/devices/vector/gdevpdfu.c
+++ b/devices/vector/gdevpdfu.c
@@ -1589,10 +1589,15 @@ pdf_begin_aside(gx_device_pdf * pdev, pdf_resource_t ** plist,
pdf_resource_type_t type)
{
long id = pdf_begin_separate(pdev, type);
+ int code = 0;
if (id < 0)
return (int)id;
- return pdf_alloc_aside(pdev, plist, pst, ppres, id);
+ code = pdf_alloc_aside(pdev, plist, pst, ppres, id);
+ if (code < 0)
+ (void)pdf_end_separate(pdev, type);
+
+ return code;
}
/* Begin a resource of a given type. */
diff --git a/devices/vector/gdevpdfx.h b/devices/vector/gdevpdfx.h
index 774a5156..098fc4fc 100644
--- a/devices/vector/gdevpdfx.h
+++ b/devices/vector/gdevpdfx.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -946,7 +946,7 @@ struct gx_device_pdf_s {
* anything in the image processing routines.
*/
float UserUnit;
- pdf_OCR_usage UseOCR; /* Never, AsNeeded or Always */
+ pdf_OCR_usage UseOCR; /* Never, AsNeeded or Always */
gs_text_enum_t* OCRSaved; /* Saved state of the text enumerator before rendering glyph bitmaps for later OCR */
pdf_OCR_stage OCRStage; /* Used to control a (sort of) state machine when using OCR to get a Unicode value for a glyph */
int *OCRUnicode; /* Used to pass back the Unicode value from the OCR engine to the text processing */
@@ -954,6 +954,9 @@ struct gx_device_pdf_s {
gs_glyph OCR_glyph; /* Passes the current glyph code from text processing to the image processing code when rendering glyph bitmaps for OCR */
ocr_glyph_t *ocr_glyphs; /* Records bitmaps and other data from text processing when doing OCR */
gs_gstate **initial_pattern_states;
+ bool OmitInfoDate; /* If true, do not emit CreationDate and ModDate in the Infor dictionary and XMP Metadata (must not be true for PDF/X support) */
+ bool OmitXMP; /* If true, do not emit an XMP /Metadata block and do not reference it from the Catalog (must not be true for PDF/A output) */
+ bool OmitID; /* If true, do not emit a /ID array in the trailer dicionary (must not be true for encrypted files or PDF 2.0) */
};
#define is_in_page(pdev)\
@@ -1290,7 +1293,7 @@ typedef struct pdf_lcvd_s {
int pdf_setup_masked_image_converter(gx_device_pdf *pdev, gs_memory_t *mem, const gs_matrix *m, pdf_lcvd_t **pcvd,
bool need_mask, int x, int y, int w, int h, bool write_on_close);
-int pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd);
+int pdf_dump_converted_image(gx_device_pdf *pdev, pdf_lcvd_t *cvd, int for_pattern);
void pdf_remove_masked_image_converter(gx_device_pdf *pdev, pdf_lcvd_t *cvd, bool need_mask);
/* ------ Miscellaneous output ------ */
diff --git a/devices/vector/gdevpdte.c b/devices/vector/gdevpdte.c
index 5e50d2cf..9760094b 100644
--- a/devices/vector/gdevpdte.c
+++ b/devices/vector/gdevpdte.c
@@ -382,6 +382,8 @@ pdf_add_ToUnicode(gx_device_pdf *pdev, gs_font *font, pdf_font_resource_t *pdfon
if (!unicode) {
unicode = (ushort *)gs_alloc_bytes(pdev->memory, length * sizeof(short), "temporary Unicode array");
+ if (unicode == NULL)
+ return_error(gs_error_VMerror);
length = font->procs.decode_glyph((gs_font *)font, glyph, ch, unicode, length);
}
diff --git a/devices/vector/gdevpdtt.c b/devices/vector/gdevpdtt.c
index 98ce8892..9483e051 100644
--- a/devices/vector/gdevpdtt.c
+++ b/devices/vector/gdevpdtt.c
@@ -86,6 +86,30 @@ pdf_text_current_width(const gs_text_enum_t *pte, gs_point *pwidth)
return gs_text_current_width(penum->pte_default, pwidth);
return_error(gs_error_rangecheck); /* can't happen */
}
+
+static void
+pdf_show_text_release(gs_text_enum_t *pte, client_name_t cname)
+{
+ gs_show_enum *const penum = (gs_show_enum *)pte;
+ gs_text_enum_procs_t *procs = (gs_text_enum_procs_t *)penum->procs;
+
+ penum->cc = 0;
+ if (penum->dev_cache2) {
+ gx_device_retain((gx_device *)penum->dev_cache2, false);
+ penum->dev_cache2 = 0;
+ }
+ if (penum->dev_cache) {
+ gx_device_retain((gx_device *)penum->dev_cache, false);
+ penum->dev_cache = 0;
+ }
+ if (penum->dev_null) {
+ gx_device_retain((gx_device *)penum->dev_null, false);
+ penum->dev_null = 0;
+ }
+ gx_default_text_release(pte, cname);
+ gs_free_object(penum->memory->non_gc_memory, procs, "pdf_show_text_release");
+}
+
static int
pdf_text_set_cache(gs_text_enum_t *pte, const double *pw,
gs_text_cache_control_t control)
@@ -655,7 +679,7 @@ gdev_pdf_text_begin(gx_device * dev, gs_gstate * pgs,
penum->output_char_code = GS_NO_CHAR;
code = gs_text_enum_init((gs_text_enum_t *)penum, &pdf_text_procs,
dev, pgs, text, font, pcpath, mem);
- penum->k_text_release = 1; /* early release of black_text_state */
+ penum->k_text_release = 1; /* early release of black_textvec_state */
if (code < 0) {
gs_free_object(mem, penum, "gdev_pdf_text_begin");
@@ -3392,12 +3416,18 @@ pdf_text_process(gs_text_enum_t *pte)
*/
gs_show_enum psenum = *(gs_show_enum *)pte_default;
gs_gstate *pgs = (gs_gstate *)penum->pgs;
- gs_text_enum_procs_t special_procs = *pte_default->procs;
+ gs_text_enum_procs_t *special_procs;
void (*save_proc)(gx_device *, gs_matrix *) = pdev->procs.get_initial_matrix;
gs_matrix m, savem;
- special_procs.set_cache = pdf_text_set_cache;
- pte_default->procs = &special_procs;
+ special_procs = (gs_text_enum_procs_t *)gs_alloc_bytes(pte_default->memory->non_gc_memory, sizeof(gs_text_enum_procs_t), "pdf_text_process");
+ if (special_procs == NULL)
+ return_error(gs_error_VMerror);
+
+ *special_procs = *pte_default->procs;
+ special_procs->set_cache = pdf_text_set_cache;
+ special_procs->release = pdf_show_text_release;
+ pte_default->procs = special_procs;
{
/* We should not come here if we already have a cached character (except for the special case
diff --git a/devices/vector/gdevpsdp.c b/devices/vector/gdevpsdp.c
index fc944539..cf6933ec 100644
--- a/devices/vector/gdevpsdp.c
+++ b/devices/vector/gdevpsdp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1254,13 +1254,17 @@ gdev_psdf_put_params(gx_device * dev, gs_param_list * plist)
exit:
if (!(pdev->params.LockDistillerParams && params.LockDistillerParams)) {
/* Only update the device paramters if there was no error */
- /* If we have any copied param_string_arrays, start by freeing them */
- if (pdev->params.PSPageOptions.size && params.PSPageOptions.size) {
- int ix;
-
- for (ix = 0; ix < pdev->params.PSPageOptions.size;ix++)
- gs_free_object(mem->non_gc_memory, (byte *)pdev->params.PSPageOptions.data[ix].data, "freeing old string array copy");
- gs_free_object(mem->non_gc_memory, (byte *)pdev->params.PSPageOptions.data, "freeing old string array");
+ /* Do not permit changes to pdev->Params.PSPageOptions, it doesn't make any sense */
+ if (pdev->params.PSPageOptions.size != 0) {
+ if (params.PSPageOptions.size != 0 && params.PSPageOptions.data != pdev->params.PSPageOptions.data) {
+ int ix;
+
+ for (ix = 0; ix < pdev->params.PSPageOptions.size;ix++)
+ gs_free_object(mem->non_gc_memory, (byte *)params.PSPageOptions.data[ix].data, "freeing old string array copy");
+ gs_free_object(mem->non_gc_memory, (byte *)params.PSPageOptions.data, "freeing old string array");
+ }
+ params.PSPageOptions.data = pdev->params.PSPageOptions.data;
+ params.PSPageOptions.size = pdev->params.PSPageOptions.size;
}
pdev->params = params;
} else {
diff --git a/devices/vector/gdevpsft.c b/devices/vector/gdevpsft.c
index ae6600be..4d6384f2 100644
--- a/devices/vector/gdevpsft.c
+++ b/devices/vector/gdevpsft.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -845,7 +845,6 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
length = u32(tab + 12);
/* Copy the table data now (a rudiment of old code). */
memcpy(&tables[numTables * 16], tab, 16);
-
switch (u32(tab)) {
case W('h','e','a','d'):
if (length < 54)
@@ -900,13 +899,16 @@ psf_write_truetype_data(stream *s, gs_font_type42 *pfont, int options,
/* falls through */
case W('c','v','t',' '):
case W('f','p','g','m'):
- case W('g','a','s','p'):
- case W('k','e','r','n'):
case W('p','r','e','p'):
break; /* always copy these if present */
+ case W('D','S','I','G'):
case W('E','B','D','T'):
case W('E','B','L','C'):
case W('E','B','S','C'):
+ case W('G','D','E','F'):
+ case W('G','P','O','S'):
+ case W('g','a','s','p'):
+ case W('k','e','r','n'):
continue;
default:
if (writing_cid)
diff --git a/devices/vector/gdevpsu.c b/devices/vector/gdevpsu.c
index 83b8bdbb..123dda69 100644
--- a/devices/vector/gdevpsu.c
+++ b/devices/vector/gdevpsu.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -180,8 +180,12 @@ psw_begin_file_header(gp_file *f, const gx_device *dev, const gs_rect *pbbox,
fputs("%...............................................................\n", f);
fputs("%...............................................................\n", f);
}
+#ifdef CLUSTER
+ fprintf(f, "%%%%Creator: GPL Ghostscript (%s)\n", dev->dname);
+#else
fprintf(f, "%%%%Creator: %s %ld (%s)\n", gs_product, (long)gs_revision,
dev->dname);
+#endif
{
time_t t;
struct tm tms;
@@ -204,7 +208,9 @@ psw_begin_file_header(gp_file *f, const gx_device *dev, const gs_rect *pbbox,
else if (pdpc->LanguageLevel == 1.5)
fputs("%%Extensions: CMYK\n", f);
psw_print_lines(f, psw_begin_prolog);
+#ifndef CLUSTER
fprintf(f, "%% %s\n", gs_copyright);
+#endif
fputs("%%BeginResource: procset ", f);
fflush(f);
psw_print_procset_name(f, dev, pdpc);
diff --git a/devices/vector/gdevtxtw.c b/devices/vector/gdevtxtw.c
index 5c885f5f..71be58b6 100644
--- a/devices/vector/gdevtxtw.c
+++ b/devices/vector/gdevtxtw.c
@@ -1167,7 +1167,7 @@ txtwrite_put_params(gx_device * dev, gs_param_list * plist)
if (code < 0)
return code;
- if (ofs.data != 0) { /* Close the file if it's open. */
+ if (ofs.data != 0 && (ofs.size != strlen(tdev->fname) || strncmp((const char *)ofs.data, tdev->fname, ofs.size)) != 0) { /* Close the file if it's open. */
if (tdev->file != 0) {
gp_fclose(tdev->file);
tdev->file = 0;
@@ -1185,10 +1185,10 @@ txtwrite_put_params(gx_device * dev, gs_param_list * plist)
dev->is_open = false;
code = gx_default_put_params(dev, plist);
+ dev->is_open = open;
if (code < 0)
return code;
- dev->is_open = open;
dev->interpolate_control = 0;
@@ -1875,10 +1875,14 @@ textw_text_process(gs_text_enum_t *pte)
if (!penum->SpanDeltaX)
return gs_note_error(gs_error_VMerror);
}
+retry:
{
switch (font->FontType) {
case ft_CID_encrypted:
case ft_CID_TrueType:
+ errprintf(pte->memory, "\n\n*** The txtwrite device does not currently support the use of CID-Keyed fonts. ***\n\n");
+ return_error(gs_error_typecheck);
+ break;
case ft_composite:
code = txtwrite_process_cmap_text(pte);
break;
@@ -1886,13 +1890,14 @@ textw_text_process(gs_text_enum_t *pte)
case ft_encrypted2:
case ft_TrueType:
case ft_user_defined:
+ case ft_PDF_user_defined:
case ft_PCL_user_defined:
case ft_GL2_stick_user_defined:
case ft_GL2_531:
code = txtwrite_process_plain_text(pte);
break;
default:
- return_error(gs_error_rangecheck);
+ return_error(gs_error_rangecheck);
break;
}
if (code == 0) {
@@ -1935,6 +1940,9 @@ textw_text_process(gs_text_enum_t *pte)
penum->pte_fallback = pte_fallback;
gs_text_enum_copy_dynamic(pte_fallback, pte, false);
+ if (font->FontType == ft_PDF_user_defined && pte->text.size != 1)
+ pte_fallback->text.size = pte->index + 1;
+
code = gs_text_process(pte_fallback);
if (code != 0) {
penum->returned.current_char = pte_fallback->returned.current_char;
@@ -1943,6 +1951,8 @@ textw_text_process(gs_text_enum_t *pte)
}
gs_text_release(NULL, pte_fallback, "txtwrite_text_process");
penum->pte_fallback = 0;
+ if (font->FontType == ft_PDF_user_defined)
+ goto retry;
}
}
return code;
@@ -1954,7 +1964,11 @@ textw_text_process(gs_text_enum_t *pte)
static int
textw_text_resync(gs_text_enum_t *pte, const gs_text_enum_t *pfrom)
{
- return gs_text_resync(pte, pfrom);
+ if ((pte->text.operation ^ pfrom->text.operation) & ~TEXT_FROM_ANY)
+ return_error(gs_error_rangecheck);
+ pte->text = pfrom->text;
+ gs_text_enum_copy_dynamic(pte, pfrom, false);
+ return 0;
}
static bool
textw_text_is_width_only(const gs_text_enum_t *pte)
diff --git a/devices/vector/gdevxps.c b/devices/vector/gdevxps.c
index 1ab854be..20d9dbd5 100644
--- a/devices/vector/gdevxps.c
+++ b/devices/vector/gdevxps.c
@@ -1790,7 +1790,7 @@ static TIFF* tiff_from_name(gx_device_xps *dev, const char *name, int big_endian
static int tiff_set_values(xps_image_enum_t *pie, TIFF *tif,
cmm_profile_t *profile, bool force8bit);
static void xps_tiff_set_handlers(void);
-static void tiff_client_release(gx_device_xps* dev, TIFF* t);
+static void xps_tiff_cleanup(xps_image_enum_t *xpie);
/* Check if we have the ICC profile in the package */
static xps_icc_data_t*
@@ -1930,6 +1930,7 @@ xps_begin_typed_image(gx_device *dev,
pie->buffer = NULL;
pie->devc_buffer = NULL;
pie->pgs = NULL;
+ pie->tif = NULL;
/* Set the brush types to image */
xps_setstrokebrush(xdev, xps_imagebrush);
@@ -2295,8 +2296,7 @@ xps_image_end_image(gx_image_enum_common_t * info, bool draw_last)
/* N.B. Write the final strip, if any. */
code = TIFFWriteDirectory(pie->tif);
- tiff_client_release((gx_device_xps*)(pie->dev), pie->tif);
- TIFFCleanup(pie->tif);
+ xps_tiff_cleanup(pie);
/* Stuff the image into the zip archive and close the file */
code = xps_add_tiff_image(pie);
@@ -2573,11 +2573,14 @@ tiff_from_name(gx_device_xps *dev, const char *name, int big_endian, bool usebig
return t;
}
-static void
-tiff_client_release(gx_device_xps *dev, TIFF *t)
+static void xps_tiff_cleanup(xps_image_enum_t *xpie)
{
- gs_free_object(dev->memory->non_gc_memory, TIFFClientdata(t),
- "tiff_client_release");
+ if (xpie->tif != NULL) {
+ void *t = TIFFClientdata(xpie->tif);
+ TIFFCleanup(xpie->tif);
+ xpie->tif = NULL;
+ gs_free_object(xpie->memory->non_gc_memory, t, "xps_image_enum_finalize");
+ }
}
static void
@@ -2586,6 +2589,8 @@ xps_image_enum_finalize(const gs_memory_t *cmem, void *vptr)
xps_image_enum_t *xpie = (xps_image_enum_t *)vptr;
gx_device_xps *xdev = (gx_device_xps *)xpie->dev;
+ xps_tiff_cleanup(xpie);
+
xpie->dev = NULL;
if (xpie->pcs != NULL)
rc_decrement(xpie->pcs, "xps_image_end_image (pcs)");
diff --git a/doc/API.htm b/doc/API.htm
deleted file mode 100644
index 5c6f677a..00000000
--- a/doc/API.htm
+++ /dev/null
@@ -1,1756 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>The Ghostscript Interpreter Application Programming Interface (API)</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1>Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a>
- </header>
- <main>
-
- <article>
-
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>API</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-
-<ul class="toc">
- <li><a href="#API">What is the Ghostscript Interpreter API?</a></li>
- <li><a href="#Exported_functions ">Exported functions</a></li>
- <li>
- <ul>
- <li><a href="#revision"><code>gsapi_revision</code></a></li>
- <li><a href="#new_instance"><code>gsapi_new_instance</code></a></li>
- <li><a href="#delete_instance"><code>gsapi_delete_instance</code></a></li>
- <li><a href="#set_stdio_with_handle"><code>gsapi_set_stdio_with_handle</code></a></li>
- <li><a href="#set_stdio"><code>gsapi_set_stdio</code></a></li>
- <li><a href="#set_poll_with_handle"><code>gsapi_set_poll_with_handle</code></a></li>
- <li><a href="#set_poll"><code>gsapi_set_poll</code></a></li>
- <li><a href="#set_display_callback"><code>gsapi_set_display_callback</code></a></li>
- <li><a href="#register_callout"><code>gsapi_register_callout</code></a></li>
- <li><a href="#deregister_callout"><code>gsapi_deregister_callout</code></a></li>
- <li><a href="#set_arg_encoding"><code>gsapi_set_arg_encoding</code></a></li>
- <li><a href="#get_default_device_list"><code>gsapi_get_default_device_list</code></a></li>
- <li><a href="#set_default_device_list"><code>gsapi_set_default_device_list</code></a></li>
- <li><a href="#run"><code>gsapi_run_string_begin</code></a></li>
- <li><a href="#run"><code>gsapi_run_string_continue</code></a></li>
- <li><a href="#run"><code>gsapi_run_string_end</code></a></li>
- <li><a href="#run"><code>gsapi_run_string_with_length</code></a></li>
- <li><a href="#run"><code>gsapi_run_string</code></a></li>
- <li><a href="#run"><code>gsapi_run_file</code></a></li>
- <li><a href="#init"><code>gsapi_init_with_args</code></a></li>
- <li><a href="#exit"><code>gsapi_exit</code></a></li>
- <li><a href="#set_param"><code>gsapi_set_param</code></a></li>
- <li><a href="#get_param"><code>gsapi_get_param</code></a></li>
- <li><a href="#enumerate_params"><code>gsapi_enumerate_params</code></a></li>
- <li><a href="#add_control_path"><code>gsapi_add_control_path</code></a></li>
- <li><a href="#remove_control_path"><code>gsapi_remove_control_path</code></a></li>
- <li><a href="#purge_control_paths"><code>gsapi_purge_control_paths</code></a></li>
- <li><a href="#activate_path_control"><code>gsapi_activate_path_control</code></a></li>
- <li><a href="#is_path_control_active"><code>gsapi_is_path_control_active</code></a></li>
- <li><a href="#add_fs"><code>gsapi_add_fs</code></a></li>
- <li><a href="#remove_fs"><code>gsapi_remove_fs</code></a></li>
- <li><a href="#return_codes">Return codes</a></li>
- <li><a href="#gsapi_fs_t">gsapi_fs_t</a></li>
- <li><a href="#callout">Callouts</a></li>
- </ul>
- </li>
- <li><a href="#Example_usage">Example usage</a></li>
- <li><a href="#stdio">Standard input and output</a></li>
- <li><a href="#display">Display device</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript overview</a>.</p>
-
-<p>
-<b>WARNING:</b> The API described in this document is subject to changes in
-future releases, possibly ones that are not backward compatible with what
-is described here.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-
-<h2><a name="API"></a>What is the Ghostscript Interpreter API?</h2>
-
-<p>
-The Ghostscript interpreter can be built as a dynamic link library
-(DLL) on Microsoft Windows, as a shared object on the
-Linux, Unix and MacOS X platforms. With some changes, it could be built
-as a static library. This document describes the Application Programming
-Interface (API) for the Ghostscript interpreter library.
-This should not be confused with the
-<a href="Lib.htm">Ghostscript library</a> which provides a graphics
-library but not the interpreter.</p>
-<p>
-This supercedes the old <a href="DLL.htm">DLL</a> interface.</p>
-<p>
-To provide the interface described in the
-<a href="Use.htm">usage documentation</a>, a smaller independent
-executable loads the DLL/shared object.
-This executable must provide all the interaction with the windowing system,
-including image windows and, if necessary, a text window.</p>
-
-<p>
-The Ghostscript interpreter library's name and characteristics differ
-for each platform:</p>
-
-<ul>
-<li>The Win32 DLL <code>gsdll32.dll</code>
-can be used by multiple programs simultaneously, but only once
-within each process.</li>
-
-<li>The OS/2 DLL <code>gsdll2.dll</code> has
-MULTIPLE NONSHARED data segments and can be called by multiple programs
-simultaneously.</li>
-
-<li>The Linux shared object <code>libgs.so</code>
-can be used by multiple programs simultaneously.</li>
- </ul>
-<p>
-The source for the executable is in <code>dw</code>*.* (Windows),
-<code>dp</code>*.* (OS/2) and <code>dx</code>*.* (Linux/Unix).
-See these source files for examples of how to use the DLL.</p>
-
-<p>
-The source file <tt>dxmainc.c</tt> can also serve as an example of how to use the
-shared library component on MacOS X, providing the same command-line tool it does
-on any linux, bsd or similar operating system.</p>
-<p>
-At this stage, Ghostscript does not support multiple instances
-of the interpreter within a single process.</p>
-
-<hr>
-
-<h2><a name="Exported_functions"></a>Exported functions</h2>
-
-<p>
-The functions exported by the DLL/shared object are described
-in the header file <a href="../psi/iapi.h"><code>iapi.h</code></a>
-and are summarised below. Omitted from the summary are
-the calling convention (e.g. __stdcall), details of return
-values and error handling.</p>
-
-
-<ul>
-<li><code>
-int
-<a href="#revision">gsapi_revision</a>
-(gsapi_revision_t *pr, int len);
-</code></li>
-
-<li><code>
-int
-<a href="#new_instance">gsapi_new_instance</a>
-(void **pinstance, void *caller_handle);
-</code></li>
-
-<li><code>
-void
-<a href="#delete_instance">gsapi_delete_instance</a>
-(void *instance);
-</code></li>
-
-<li><code>
-int
-<a href="#set_stdio_with_handle">gsapi_set_stdio_with_handle</a>
-(void *instance,
- int(*stdin_fn)(void *caller_handle, char *buf, int len),
- int(*stdout_fn)(void *caller_handle, const char *str, int len),
- int(*stderr_fn)(void *caller_handle, const char *str, int len),
- void *caller_handle);
-</code></li>
-
-<li><code>
-int
-<a href="#set_stdio">gsapi_set_stdio</a>
-(void *instance,
- int(*stdin_fn)(void *caller_handle, char *buf, int len),
- int(*stdout_fn)(void *caller_handle, const char *str, int len),
- int(*stderr_fn)(void *caller_handle, const char *str, int len));
-</code></li>
-
-<li><code>
-int
-<a href="#set_poll_with_handle">gsapi_set_poll_with_handle</a>
-(void *instance, int(*poll_fn)(void *caller_handle), void *caller_handle);
-</code></li>
-
-<li><code>
-int
-<a href="#set_poll">gsapi_set_poll</a>
-(void *instance, int(*poll_fn)(void *caller_handle));
-</code></li>
-
-<li><code>
-int
-<a href="#set_display_callback">gsapi_set_display_callback</a>
-(void *instance, display_callback *callback);
-</code></li>
-
-<li><code>
-int
-<a href="#register_callout">gsapi_register_callout</a>
-(void *instance, gs_callout callout, void *callout_handle);
-</code></li>
-
-<li><code>
-void
-<a href="#deregister_callout">gsapi_deregister_callout</a>
-(void *instance, gs_callout callout, void *callout_handle);
-</code></li>
-
-<li><code>
-int
-<a href="#set_arg_encoding">gsapi_set_arg_encoding</a>
-(void *instance, int encoding);
-</code></li>
-
-<li><code>
-int
-<a href="#get_default_device_list">gsapi_get_default_device_list</a>(void *instance, char **list, int *listlen);
-</code></li>
-
-<li><code>
-int
-<a href="#set_default_device_list">gsapi_set_default_device_list</a>(void *instance, const char *list, int listlen);
-</code></li>
-
-<li><code>
-int
-<a href="#run">gsapi_run_string_begin</a>
-(void *instance, int user_errors, int *pexit_code);
-</code></li>
-
-<li><code>
-int
-<a href="#run">gsapi_run_string_continue</a>
-(void *instance,
- const char *str, unsigned int length, int user_errors, int *pexit_code);
-</code></li>
-
-<li><code>
-int
-<a href="#run">gsapi_run_string_end</a>
-(void *instance, int user_errors, int *pexit_code);
-</code></li>
-
-<li><code>
-int
-<a href="#run">gsapi_run_string_with_length</a>
-(void *instance,
- const char *str, unsigned int length, int user_errors, int *pexit_code);
-</code></li>
-
-<li><code>
-int
-<a href="#run">gsapi_run_string</a>
-(void *instance,
- const char *str, int user_errors, int *pexit_code);
-</code></li>
-
-<li><code>
-int
-<a href="#run">gsapi_run_file</a>
-(void *instance,
- const char *file_name, int user_errors, int *pexit_code);
-</code></li>
-
-<li><code>
-int
-<a href="#init">gsapi_init_with_args</a>
-(void *instance, int argc, char **argv);
-</code></li>
-
-<li><code>
-int
-<a href="#exit">gsapi_exit</a>
-(void *instance);
-</code></li>
-
-<li><code>
-int
-<a href="#set_param">gsapi_set_param</a>(void *instance, const char *param, const void *value, gs_set_param_type type);
-</code></li>
-
-<li><code>
- int
- <a href="#get_param">gsapi_get_param</a>(void *instance, const char *param, void *value, gs_set_param_type type);
-</code></li>
-
-<li><code>
-int
-<a href="#enumerate_params">gsapi_enumerate_params</a>(void *instance, void **iter, const char **key, gs_set_param_type *type);
-</code></li>
-
-<li><code>
-int
-<a href="#add_control_path">gsapi_add_control_path</a>(void *instance, int type, const char *path);
-</code></li>
-
-<li><code>
-int
-<a href="#remove_control_path">gsapi_remove_control_path</a>(void *instance, int type, const char *path);
-</code></li>
-
-<li><code>
-void
-<a href="#purge_control_paths">gsapi_purge_control_paths</a>(void *instance, int type);
-</code></li>
-
-<li><code>
-void
-<a href="#activate_path_control">gsapi_activate_path_control</a>(void *instance, int enable);
-</code></li>
-
-<li><code>
-int
-<a href="#is_path_control_active">gsapi_is_path_control_active</a>(void *instance);
-</code></li>
-
-<li><code>
-int
-<a href="#add_fs">gsapi_add_fs</a>
-(void *instance,
- gsapi_fs_t *fs, void *secret);
-</code></li>
-
-<li><code>
-void
-<a href="#remove_fs">gsapi_remove_fs</a>
-(void *instance,
- gsapi_fs_t *fs, void *secret);
-</code></li>
-
-</ul>
-
-<h3><a name="revision"></a><code>gsapi_revision()</code></h3>
-
-<blockquote>
-This function returns the revision numbers and strings of the Ghostscript
-interpreter library; you should call it before any other interpreter
-library functions to make sure that the correct version of the
-Ghostscript interpreter has been loaded.
-
-<blockquote>
-<pre>
-typedef struct gsapi_revision_s {
- const char *product;
- const char *copyright;
- long revision;
- long revisiondate;
-} gsapi_revision_t;
-gsapi_revision_t r;
-
-if (gsapi_revision(&amp;r, sizeof(r)) == 0) {
- if (r.revision &lt; 650)
- printf("Need at least Ghostscript 6.50");
-}
-else {
- printf("revision structure size is incorrect");
-}
-</pre></blockquote>
-</blockquote>
-
-
-<h3><a name="new_instance"></a><code>gsapi_new_instance()</code></h3>
-<blockquote>
-Create a new instance of Ghostscript.
-This instance is passed to most other gsapi functions.
-The caller_handle is the default value that will be provided to callback functions.
-
-<b>On some platforms (those that do not support threading), only one
-instance of Ghostscript is supported at a time; any attempt to create
-more than one at a time would result in gsapi_new_instance
-returning an error.</p>
-
-<p>While the core Ghostscript devices are believed to be thread safe
-now, a handful of devices are known not to be (at least the x11 devices,
-uniprint, and the open printing devices). A new mechanism has been
-implemented that allows devices to check for concurrent use and to
-refuse to start up. The devices shipped with Ghostscript known to use
-global variables have had these calls added to them. Any authors of
-non-standard Ghostscript devices that use global variables should
-consider adding the same calls to their own code.</p>
-<p>
-The first parameter, is a pointer to an opaque pointer (&quot;<code>void **</code>&quot;).
-The opaque pointer (&quot;<code>void *</code>&quot;) must be initialised to <code>NULL</code> before
-the call to <code>gsapi_new_instance()</code>. See <a href="#Example_1">Example 1</a>.
-</blockquote>
-
-
-<h3><a name="delete_instance"></a><code>gsapi_delete_instance()</code></h3>
-<blockquote>
-Destroy an instance of Ghostscript.
-Before you call this, Ghostscript must have finished.
-If Ghostscript has been initialised, you must call
-<code>gsapi_exit</code> before <code>gsapi_delete_instance</code>.
-</blockquote>
-
-
-<h3><a name="set_stdio_with_handle"></a><code>gsapi_set_stdio_with_handle()</code></h3>
-<blockquote>
-<p>Set the callback functions for stdio, together with the
-handle to use in the callback functions.
-The stdin callback function should return the number of
-characters read, 0 for EOF, or -1 for error.
-The stdout and stderr callback functions should return
-the number of characters written.
-<p><b>NOTE:</b> These callbacks do not affect output device I/O when
-using &quot;<code>%stdout</code>&quot; as the output file. In that
-case, device output will still be directed to the process &quot;stdout&quot;
-file descriptor, not to the stdio callback.
-</blockquote>
-
-<h3><a name="set_stdio"></a><code>gsapi_set_stdio()</code></h3>
-<blockquote>
-<p>Set the callback functions for stdio. The handle used
-in the callbacks will be taken from the value passed
-to <code><a href="#new_instance">gsapi_new_instance</a></code>. Otherwise the behaviour of this
-function matches <code><a href="#set_stdio_with_handle">gsapi_set_stdio_with_handle</a></code>.
-</blockquote>
-
-
-<h3><a name="set_poll_with_handle"></a><code>gsapi_set_poll_with_handle()</code></h3>
-<blockquote>
-Set the callback function for polling, together with the handle to pass
-to the callback function. This function will only be called if
-the Ghostscript interpreter was compiled with <code>CHECK_INTERRUPTS</code>
-as described in <code><a href="../base/gpcheck.h">gpcheck.h</a></code>.
-<p>
-The polling function should return zero if all is well, and return
-negative if it wants ghostscript to abort. This is often
-used for checking for a user cancel. This can also be used for
-handling window events or cooperative multitasking.</p>
-<p>
-The polling function is called very frequently during interpretation and
-rendering so it must be fast. If the function is slow, then using a counter
-to return 0 immediately some number of times can be used to reduce the
-performance impact.</p>
-</blockquote>
-
-<h3><a name="set_poll"></a><code>gsapi_set_poll()</code></h3>
-<blockquote>
-Set the callback function for polling. The handle passed to the
-callback function will be taken from the handle passed to
-<code><a href="#new_instance">gsapi_new_instance</a></code>.
-Otherwise the behaviour of this function matches
-<code><a href="#set_poll_with_handle">gsapi_set_poll_with_handle</a></code>.
-</blockquote>
-
-<h3><a name="set_display_callback"></a><code>gsapi_set_display_callback()</code></h3>
-<blockquote>
-<b>This call is deprecated; please use
-<code><a href="#register_callout">gsapi_register_callout</a></code>
-to register a <a href="#callout">callout</a> handler for the
-<a href="#display">display</a> device in preference.</b>
-Set the callback structure for the <a href="#display">display</a>
-device. The handle passed in the callback functions is taken from
-the <code>DisplayHandle</code> parameter (or NULL if there is no
-such parameter). If the <a href="#display">display</a> device is used,
-this must be called after
-<code>gsapi_new_instance()</code>
-and before <code>gsapi_init_with_args()</code>.
-See <code><a href="../devices/gdevdsp.h">gdevdsp.h</a></code>
-for more details.
-</blockquote>
-
-<h3><a name="register_callout"></a><code>gsapi_register_callout()</code></h3>
-<blockquote>
-<p>This call registers a <code><a href="#callout">callout</a></code>
-handler.</p>
-</blockquote>
-
-<h3><a name="deregister_callout"></a><code>gsapi_deregister_callout()</code></h3>
-<blockquote>
-<p>This call deregisters a <code><a href="#callout">callout</a></code> handler
-previously registered with <code><a href="#register_callout">gsapi_register_callout</a></code>.
-All three arguments must match exactly for the callout handler to
-be deregistered.</p>
-</blockquote>
-
-<h3><a name="set_arg_encoding"></a><code>gsapi_set_arg_encoding()</code></h3>
-<blockquote>
-Set the encoding used for the interpretation of all subsequent args
-supplied via the gsapi interface on this instance. By default we
-expect args to be in encoding 0 (the 'local' encoding for this OS).
-On Windows this means "the currently selected codepage". On Linux this
-typically means utf8. This means that omitting to call this function
-will leave Ghostscript running exactly as it always has. Please note
-that use of the 'local' encoding is now deprecated and should be
-avoided in new code.
-This must be called after <code>gsapi_new_instance()</code>
-and before <code>gsapi_init_with_args()</code>.
-</blockquote>
-
-<h3><a name="set_default_device_list"></a><code>set_default_device_list()</code></h3>
-<blockquote>
-Set the string containing the list of default device names,
-for example "display x11alpha x11 bbox". Allows the calling
-application to influence which device(s) gs will try, in order,
-in it's selection of the default device.
-This must be called after <code>gsapi_new_instance()</code>
-and before <code>gsapi_init_with_args()</code>.
-</blockquote>
-
-<h3><a name="get_default_device_list"></a><code>get_default_device_list()</code></h3>
-<blockquote>
-Returns a pointer to the current default device string.
-This must be called after <code>gsapi_new_instance()</code>
-and before <code>gsapi_init_with_args()</code>.
-</blockquote>
-
-<h3><a name="init"></a><code>gsapi_init_with_args()</code></h3>
-<blockquote>
-Initialise the interpreter.
-This calls <code>gs_main_init_with_args()</code> in
-<code><a href="../psi/imainarg.c">imainarg.c</a></code>.
-See below for <a href="#return_codes">return codes</a>.
-The arguments are the same as the "C" main function:
-argv[0] is ignored and the user supplied arguments
-are argv[1] to argv[argc-1].
-</blockquote>
-
-<h3><a name="run"></a><code>gsapi_run_*()</code></h3>
-<blockquote>
-The <code>gsapi_run_*</code> functions are like
-<code>gs_main_run_*</code> except that the error_object is omitted.
-If these functions return &lt;= -100, either quit or a fatal
-error has occured. You must call <code>gsapi_exit()</code> next.
-The only exception is <code>gsapi_run_string_continue()</code>
-which will return <code>gs_error_NeedInput</code> if all is well.
-See below for <a href="#return_codes">return codes</a>.
-<p>
-The address passed in <code>pexit_code</code> will be used to return the
-exit code for the interpreter in case of a quit or fatal error. The
-<code>user_errors</code> argument is normally set to zero to indicate that
-errors should be handled through the normal mechanisms within the
-interpreted code. If set to a negative value, the functions will return
-an error code directly to the caller, bypassing the interpreted
-language. The interpreted language's error handler is bypassed, regardless of
-<code>user_errors</code> parameter, for the <code>gs_error_interrupt</code>
-generated when <a href="#set_poll">the polling callback</a> returns a negative
-value. A positive <code>user_errors</code> is treated the same as zero.</p>
-<p>
-There is a 64 KB length limit on any buffer submitted to a
-<code>gsapi_run_*</code> function for processing. If you have more
-than 65535 bytes of input then you must split it into smaller
-pieces and submit each in a separate
-<code>gsapi_run_string_continue()</code> call.</p>
-</blockquote>
-
-<h3><a name="exit"></a><code>gsapi_exit()</code></h3>
-<blockquote>
-Exit the interpreter.
-This must be called on shutdown if <code>gsapi_init_with_args()</code>
-has been called, and just before <code>gsapi_delete_instance()</code>.
-</blockquote>
-
-<h3><a name="set_param"></a><code>gsapi_set_param()</code></h3>
-<blockquote>
-Set a parameter.
-Broadly, this is equivalent to setting a parameter using <code>-d</code>, <code>-s</code> or <code>-p</code> on the command line. This call cannot be made during a <code>run_string</code> operation.
-<p>
-Parameters in this context are not the same as 'arguments' as processed by <code>gsapi_init_with_args</code>, but often the same thing can be achieved. For example, with <code>gsapi_init_with_args</code>, we can pass &quot;<code>-r200</code>&quot; to change the resolution. Broadly the same thing can be achieved by using <code>gsapi_set_param</code> to set a parsed value of &quot;<code>&lt;&lt;/HWResolution [ 200.0 200.0 ]&gt;&gt;</code>&quot;.
-<p>
-Note, that internally, when we set a parameter, we perform an <code>initgraphics</code> operation. This means that using <code>set_param</code> other than at the start of a page is likely to give unexpected results.
-<p>Further, note that attempting to set a parameter that the device does not recognise will be silently ignored, and that parameter will not be found in subsequent <code>gsapi_get_param</code> calls.
-<p>The <code>type</code> argument dictates the kind of object that <code>value</code> points to:
-<pre><code>typedef enum {
- gs_spt_invalid = -1,
- gs_spt_null = 0, /* void * is NULL */
- gs_spt_bool = 1, /* void * is a pointer to an int (0 false,
- * non-zero true). */
- gs_spt_int = 2, /* void * is a pointer to an int */
- gs_spt_float = 3, /* void * is a float * */
- gs_spt_name = 4, /* void * is a char * */
- gs_spt_string = 5, /* void * is a char * */
- gs_spt_long = 6, /* void * is a long * */
- gs_spt_i64 = 7, /* void * is an int64_t * */
- gs_spt_size_t = 8, /* void * is a size_t * */
- gs_spt_parsed = 9, /* void * is a pointer to a char * to be parsed */
-
- /* Setting a typed param causes it to be instantly fed to to the
- * device. This can cause the device to reinitialise itself. Hence,
- * setting a sequence of typed params can cause the device to reset
- * itself several times. Accordingly, if you OR the type with
- * gs_spt_more_to_come, the param will held ready to be passed into
- * the device, and will only actually be sent when the next typed
- * param is set without this flag (or on device init). Not valid
- * for get_typed_param. */
- gs_spt_more_to_come = 1<<31
-} gs_set_param_type;
-</code></pre>
-<p>Combining a type value by ORRing it with the <code>gs_spt_more_to_come</code> flag will cause the <code>set_param</code> operation to be queued internally, but not actually be sent to the device. Thus a series of <code>set_param</code> operations can be queued, for example as below:
-<pre>
- int code = gsapi_set_param(instance,
- "HWResolution",
- "[300 300]",
- gs_spt_parsed | gs_spt_more_to_come);
- if (code >= 0) {
- int i = 1;
- code = gsapi_set_param(instance,
- "FirstPage",
- &i,
- gs_spt_int | gs_spt_more_to_come);
- }
- if (code >= 0) {
- int i = 3;
- code = gsapi_set_param(instance,
- "DownScaleFactor",
- &i,
- gs_spt_int);
- }
-</pre>
-<p>This enables a series of set operations to be performed 'atomically'. This can be useful for performance, in that any reconfigurations to the device (such as page size changes or memory reallocations) will only happen when all the parameters are sent, rather than potentially each time each one is sent.
-</blockquote>
-
-<h3><a name="get_param"></a><code>gsapi_get_param()</code></h3>
-<blockquote>
-Get a parameter.
-Retrieve the current value of a parameter.
-<p>If an error occurs, the return value is negative. Otherwise the return value is the number of bytes required for storage of the value. Call once with <code>value = NULL</code> to get the number of bytes required, then call again with <code>value</code> pointing to at least the required number of bytes where the value will be copied out. Note that the caller is required to know the type of value in order to get it. For all types other than <code>string</code>, <code>name</code>, and <code>parsed</code> knowing the type means you already know the size required.
-<p>
-This call retrieves parameters/values that have made it to the device. Thus, any values set using the <code>gs_spt_more_to_come</code> without a following call without that flag will not be retrieved. Similarly, attempting to get a parameter before <code>gsapi_init_with_args</code> has been called will not list any, even if <code>gsapi_set_param</code> has been used.
-<p>
-Attempting to read a parameter that is not set will return <code>gs_error_undefined (-21)</code>. Note that calling <code>gsapi_set_param</code> followed by <code>gsapi_get_param</code> may not find the value, if the device did not recognise the key as being one of its configuration keys.
-</blockquote>
-
-<h3><a name="enumerate_params"></a><code>gsapi_enumerate_params()</code></h3>
-<blockquote>
-Enumerate the current parameters.
-Call repeatedly to list out the current parameters.
-<p>
- The first call should have <code>*iter = NULL</code>. Subsequent calls should pass the same pointer in so the iterator can be updated. Negative return codes indicate error, 0 success, and 1 indicates that there are no more keys to read. On success, <code>key</code> will be updated to point to a null terminated string with the key name that is guaranteed to be valid until the next call to <code>gsapi_enumerate_params</code>. If <code>type</code> is non <code>NULL</code> then <code>*type</code> will be updated to have the type of the parameter.
-<p>
-Note that only one enumeration can happen at a time. Starting a second enumeration will reset the first.
-<p>
-The enumeration only returns parameters/values that have made it to the device. Thus, any values set using the <code>gs_spt_more_to_come</code> without a following call without that flag will not be retrieved. Similarly, attempting to enumerate parameters before <code>gsapi_init_with_args</code> has been called will not list any, even if <code>gsapi_set_param</code> has been used.
-</blockquote>
-
-<h3><a name="add_control_path"></a><code>gsapi_add_control_path()</code></h3>
-<blockquote>
-Add a (case sensitive) path to one of the lists of permitted paths for file access.
-See <a href="Use.htm#Safer">here</a> for more information about permitted paths.
-</blockquote>
-
-<h3><a name="remove_control_path"></a><code>gsapi_remove_control_path()</code></h3>
-<blockquote>
-Remove a (case sensitive) path from one of the lists of permitted paths for file access.
-See <a href="Use.htm#Safer">here</a> for more information about permitted paths.
-</blockquote>
-
-<h3><a name="purge_control_paths"></a><code>gsapi_purge_control_paths()</code></h3>
-<blockquote>
-Clear all the paths from one of the lists of permitted paths for file access.
-See <a href="Use.htm#Safer">here</a> for more information about permitted paths.
-</blockquote>
-
-<h3><a name="activate_path_control"></a><code>gsapi_activate_path_control()</code></h3>
-<blockquote>
-Enable/Disable path control (i.e. whether paths are checked against permitted paths
-before access is granted).
-See <a href="Use.htm#Safer">here</a> for more information about permitted paths.
-</blockquote>
-
-<h3><a name="is_path_control_active"></a><code>gsapi_is_path_control_active()</code></h3>
-<blockquote>
-Query whether path control is activated or not.
-See <a href="Use.htm#Safer">here</a> for more information about permitted paths.
-</blockquote>
-
-<h3><a name="add_fs"></a><code>gsapi_add_fs()</code></h3>
-<blockquote>
-Adds a new 'Filing System' to the interpreter.
-This enables callers to implement their own filing systems. The system
-starts with just the conventional 'file' handlers installed, to allow
-access to the local filing system. Whenever files are to be opened
-from the interpreter, the file paths are offered around each registered
-filing system in turn (from most recently registered to oldest), until
-either an error is given, or the file is opened successfully.
-<p>
-Details of the <code>gsapi_fs_t</code> are given
-<a href="#gsapi_fs_t">below</a>.
-</blockquote>
-
-<h3><a name="remove_fs"></a><code>gsapi_remove_fs()</code></h3>
-<blockquote>
-Remove a previously registered 'Filing System' from the interpreter.
-Both the function pointers within the <code>gs_fs_t</code> and the
-secret value must match exactly.
-<p>
-</blockquote>
-
-<h3><a name="return_codes"></a>Return codes</h3>
-
-<p>
-The <code>gsapi_init_with_args</code>, <code>gsapi_run_*</code> and
-<code>gsapi_exit</code> functions return an integer code.</p>
-
-<table>
-<tr>
- <th colspan="3">Return Codes from gsapi_*()</th>
-</tr>
-<tr>
- <th>CODE</th>
- <th colspan="2">STATUS</th>
-</tr>
-<tr>
- <td>0</td>
- <td colspan="2">No errors</td>
-</tr>
-<tr>
- <td>gs_error_Quit</td>
- <td colspan="2">"<code>quit</code>" has been executed. This is not an error. <code>gsapi_exit()</code> must be called next.</td>
-</tr>
-<tr>
- <td>gs_error_interrupt</td>
- <td colspan="2"><a href="#set_poll">The polling callback function</a> returned a negative value, requesting Ghostscript to abort.</td>
-</tr>
-<tr>
- <td>gs_error_NeedInput</td>
- <td colspan="2">More input is needed by <code>gsapi_run_string_continue()</code>. This is not an error.</td>
-</tr>
-<tr>
- <td>gs_error_Info</td>
- <td colspan="2">"<code>gs -h</code>" has been executed. This is not an error. <code>gsapi_exit()</code> must be called next.</td>
-</tr>
-<tr>
- <td>&lt; 0</td>
- <td colspan="2">Error</td>
-</tr>
-<tr>
- <td>&lt;= gs_error_Fatal</td>
- <td colspan="2">Fatal error. <code>gsapi_exit()</code> must be called next.</td>
-</tr>
-</table>
-
-<p>
-The <code>gsapi_run_*()</code> functions do not flush stdio.
-If you want to see output from Ghostscript you
-must do this explicitly as shown in the example below.</p>
-
-<p>
-When executing a string with <code>gsapi_run_string_*()</code>,
-<code>currentfile</code> is the input from the string.
-Reading from <code>%stdin</code> uses the stdin callback.</p>
-
-<h3><a name="gsapi_fs_t"></a>gsapi_fs_t</h3>
-<p>Each 'filing system' within gs is a structure of function
-pointers; each function pointer gives a handler from taking a
-different named resource (a file, a pipe, a printer, a scratch
-file etc) and attempts to open it.
-
-<pre>
-typedef struct
-{
- int (*open_file)(const gs_memory_t *mem,
- void *secret,
- const char *fname,
- const char *mode,
- gp_file **file);
- int (*open_pipe)(const gs_memory_t *mem,
- void *secret,
- const char *fname,
- char *rfname, /* 4096 bytes */
- const char *mode,
- gp_file **file);
- int (*open_scratch)(const gs_memory_t *mem,
- void *secret,
- const char *prefix,
- char *rfname, /* 4096 bytes */
- const char *mode,
- int rm,
- gp_file **file);
- int (*open_printer)(const gs_memory_t *mem,
- void *secret,
- char *fname, /* 4096 bytes */
- int binary,
- gp_file **file);
- int (*open_handle)(const gs_memory_t *mem,
- void *secret,
- char *fname, /* 4096 bytes */
- const char *mode,
- gp_file **file);
-} gsapi_fs_t;
-</pre>
-<p>If the filename (always given in utf-8 format) is recognised as
-being one that the filing system handles (perhaps by the prefix used),
-then it should open the file, fill in the <code>gp_file</code>
-pointer and return 0.
-<p>If the filename is not-recognised as being one that the filing
-system handles, then returning 0 will cause the filename to be
-offered to other registered filing systems.
-<p>If an error is returned (perhaps gs_error_invalidfileaccess),
-then no other filing system will be allowed to try to open the
-file. This provides a mechanism whereby a caller to gsapi can
-completely control access to all files accessed via <code>gp_fopen</code>
-at runtime.
-<p>Note, that while most file access within ghostscript will be
-redirected via these functions, stdio will not; see the existing
-mechanisms within Ghostscript for intercepting/replacing this.
-<ul>
-<li>The <code>open_file</code> function pointer will be called when
-something (most often a call to <code>gp_fopen</code>) attempts to
-open a file.
-<li>The <code>open_pipe</code> function pointer will be called when
-something (most often a call to <code>gp_popen</code>) attempts to
-open a pipe. <code>rfname</code> points to a 4K buffer in which the
-actual name of the opened pipe should be returned.
-<li>The <code>open_scratch</code> function pointer will be called when
-something (most often a call to <code>gp_open_scratch_file</code> or
-<code>gp_open_scratch_file_rm</code>) attempts to open a temporary file.
-<code>rfname</code> points to a 4K buffer in which the actual name of
-the opened pipe should be returned. If <code>rm</code> is true, then
-the file should be set to delete itself when all handles to it are closed.
-<li>The <code>open_printer</code> function pointer will be called when
-something (most often a call to <code>gp_open_printer</code>) attempts
-to open a stream to a printer. If <code>binary</code> is true, then
-the stream should be opened as binary; most streams will be binary by
-default - this has historical meaning on OS/2.
-<li>The <code>open_handle</code> function pointer will be called when
-something (most often a call via the postscript <code>%handle%</code>
-IO device) attempts to open a Windows handle. This entry point will
-never be called on non-Windows builds.
-</ul>
-<p>Any of these which are left as NULL will never be called; a filing
-system with all of the entries left as NULL is therefore pointless.
-<p>The most complex part of the implementation of these functions
-is the creation of a <code>gp_file</code> instance to return. There are
-some helper functions for this, best explained by example.
-<p>Let us consider a hypothetical filing system that encrypts data as
-it is written, and decrypts it as it is read back. As each file is
-read and written the encryption/decryption routines will need to use
-some state, carried between calls to the filing system. We therefore
-might define a new type 'derived' from <code>gp_file</code> as follows:
-
-<pre>
-typedef struct
-{
- gp_file base;
- /* State private to the implementation of this file for encryption/decryption */
- /* For example: */
- int foo;
- char *bar;
-} gp_file_crypt;
-</pre>
-
-<p>An implementation of <code>gs_fs_t</code> for our 'crypt' filing system
-might then look like this:
-
-<pre>
-gsapi_fs_t gs_fs_crypt =
-{
- crypt_open_file,
- NULL, /* open_pipe */
- NULL, /* open_scratch */
- NULL, /* open_printer */
- NULL /* open_handle */
-};
-</pre>
-
-<p>In the above definition, we define a single handler, to cope with the
-opening of our input/output files. If we wanted to encrypt/decrypt
-other files too (perhaps the temporary files we produce) we'd need to
-define additional handlers (such as <code>open_scratch</code>).
-
-<p>Our handler might look as follows:
-<pre>
-int crypt_open_file(const gs_memory_t *mem,
- void *secret,
- const char *filename,
- const char *mode,
- gp_file **file)
-{
- gp_file_crypt crypt;
-
- /* Ignore any filename not starting with "crypt://" */
- if (strncmp(filename, "crypt://", 8) != 0)
- return 0;
-
- /* Allocate us an instance (and fill in the non-crypt-specific
- * internals) */
- crypt = (gp_file_crypt *)gp_file_alloc(mem, &crypt_ops, sizeof(*crypt), "gp_file_crypt");
- if (crypt == NULL)
- return gs_error_VMerror; /* Allocation failed */
-
- /* Setup the crypt-specific state */
- crypt->foo = 1;
- crypt->bar = gs_alloc_bytes(mem->non_gc_memory, 256, "bar");
- /* If allocations fail, we need to clean up before exiting */
- if (crypt->bar) {
- gp_file_dealloc(crypt);
- return gs_error_VMerror;
- }
-
- /* Return the new instance */
- *file = &crypt.base;
- return 0;
-}
-</pre>
-
-<p>The crucial part of this function is the definition of <code>crypt_ops</code>,
-an instance of the <code>gp_file_ops_t</code> type; a table of function pointers
-that implement the actual operations required.
-
-<pre>
-typedef struct {
- int (*close)(gp_file *);
- int (*getc)(gp_file *);
- int (*putc)(gp_file *, int);
- int (*read)(gp_file *, size_t size, unsigned int count, void *buf);
- int (*write)(gp_file *, size_t size, unsigned int count, const void *buf);
- int (*seek)(gp_file *, gs_offset_t offset, int whence);
- gs_offset_t (*tell)(gp_file *);
- int (*eof)(gp_file *);
- gp_file *(*dup)(gp_file *, const char *mode);
- int (*seekable)(gp_file *);
- int (*pread)(gp_file *, size_t count, gs_offset_t offset, void *buf);
- int (*pwrite)(gp_file *, size_t count, gs_offset_t offset, const void *buf);
- int (*is_char_buffered)(gp_file *file);
- void (*fflush)(gp_file *file);
- int (*ferror)(gp_file *file);
- FILE *(*get_file)(gp_file *file);
- void (*clearerr)(gp_file *file);
- gp_file *(*reopen)(gp_file *f, const char *fname, const char *mode);
-} gp_file_ops_t;
-</pre>
-
-<p>These functions generally follow the same patterns as the posix functions that match them,
-and so in many cases we will describe these with references to such.
-Whenever these routines are called, they will be passed a <code>gp_file</code> pointer.
-This pointer will have originated from the <code>crypt_open_file</code> call, and so can
-safely be cast back to a <code>gp_file_crypt</code> pointer to allow private data to be accessed.
-
-<dl>
-<dt><code>close(gp_file *)</code>
-<dd>close the given file; free any storage in the crypt specific parts of <code>gp_file_crypt</code>,
-but not the gp_file_crypt structure itself.
-
-<dt><code>int getc(gp_file *)</code>
-<dd>Get a single character from the file, returning it as an int (or -1 for EOF).
-Behaves like <code>fgetc(FILE *)</code>.
-
-<dt><code>int putc(gp_file *, int)</code>
-<dd>Put a single character to the file, returning the character on success, or
-EOF (and setting the error indicator) on error.
-Behaves like <code>fgetc(FILE *)</code>.
-
-<dt><code>int read(gp_file *, size_t size, unsigned int count, void *buf)</code>
-<dd>Reads count entries of size bytes the file into buf, returning the number
-of entries read. Behaves like <code>fread(FILE *, size, count, buf)</code>.
-
-<dt><code>int write(gp_file *, size_t size, unsigned int count, const void *buf)</code>
-<dd>Writes count entries of size bytes from buf into the file, returning the
-number of entries written. Behaves like <code>fwrite(FILE *, size, count, buf)</code>.
-
-<dt><code>int seek(gp_file *, gs_offset_t offset, int whence)</code>
-<dd>Seeks within the file. Behaves like <code>fseek(FILE *, offset, whence)</code>.
-
-<dt><code>gs_offset_t tell(gp_file *)</code>
-<dd>Returns the current offset within the file. Behaves like <code>ftell(FILE *)</code>.
-
-<dt><code>int eof(gp_file *)</code>
-<dd>Returns 1 if we are at the end of the file, 0 otherwise. Behaves like
-<code>feof(FILE *)</code>.
-
-<dt><code>gp_file * dup(gp_file *, const char *mode)</code>
-<dd>Optional function, only used if clist files are to be stored in this filing system.
-Behaves like <code>fdup(FILE *)</code>. Leave NULL if not implemented.
-
-<dt><code>int seekable(gp_file *)</code>
-<dd>Returns 1 if the file is seekable, 0 otherwise. Certain output devices will
-only work with seekable files.
-
-<dt><code>int pread(gp_file *, size_t count, gs_offset_t offset, void *buf)</code>
-<dd>Optional function, only used if clist files are to be stored in this filing system.
-Behaves like an atomic <code>fseek(FILE *, offset, 0)</code> and <code>fread(FILE *, 1, count, buf)</code>.
-Akin to <code>pread</code>.
-
-<dt><code>int pwrite(gp_file *, size_t count, gs_offset_t offset, const void *buf)</code>
-<dd>Optional function, only used if clist files are to be stored in this filing system.
-Behaves like an atomic <code>fseek(FILE *, offset, 0)</code> and <code>fwrite(FILE *, 1, count, buf)</code>.
-Akin to <code>pwrite</code>.
-
-<dt><code>int is_char_buffered(gp_file *file)</code>
-<dd>Returns 1 if the file is character buffered, 0 otherwise. Used for handling
-reading from terminals. Very unlikely to be used, so returning 0 all the time
-should be safe. Leave NULL to indicate "always 0".
-
-<dt><code>void fflush(gp_file *file)</code>
-<dd>Ensures that any buffered data is written to the file. Behaves like <code>fflush(FILE *)</code>.
-Leave NULL to indicate that no flushing is ever required.
-
-<dt><code>int ferror(gp_file *file)</code>
-<dd>Returns non-zero if there has been an error, or 0 otherwise. Behaves like <code>ferror(FILE *)</code>.
-
-<dt><code>FILE * get_file(gp_file *file)</code>
-<dd>Optional: Gets the FILE * pointer that backs this file. Required for a few devices
-that insist on working with FILE *'s direct. Generally safe to leave this set to NULL, and those
-devices will fail gracefully.
-
-<dt><code>void clearerr(gp_file *file)</code>
-<dd>Clear the error and EOF values for a file. Behaves like <code>clearerror(FILE *)</code>.
-
-<dt><code>gp_file * reopen(gp_file *f, const char *fname, const char *mode)</code>
-<dd>Optional function, only used if the <code>gp_file</code> came from an <code>open_scratch</code>
-call; can be left as NULL if the <code>open_scratch</code> pointer is set to NULL.
-Reopen a stream with a different mode. Behaves like
-<code>freopen(fname, mode, FILE *)</code>.
-</dl>
-
-<h3><a name="callout"></a>Callouts</h3>
-<blockquote>
-<p>Callouts are a mechanism
-for the core code (specifically devices) to communicate with the
-user of gsapi. This communication can take the form of passing
-information out vis-a-vis what devices are doing, or requesting
-configuration from the caller to affect exactly how the device
-itself works.</p>
-<p>This is deliberately an extensible system, so exact details of
-callouts should be documented with the device in question. In general
-however a callout handler will be of the form:</p>
-<pre>
-typedef int (*gs_callout)(void *callout_handle,
- const char *device_name,
- int id,
- int size,
- void *data);
-</pre>
-<p>The <code>callout_handle</code> value passed to the callout will
-be the value passed in at registration. The <code>device_name</code>
-should be a null-terminated string giving the name of the device
-(though care should be taken to cope with the case where
-<code>device_name</code> is NULL for potential future uses).
-The <code>id</code> value will have a (device-specific) meaning; see
-the documentation for the device in question for more details. The
-same <code>id</code> value may be used to mean different things in
-different devices.
-Finally, <code>size</code> and <code>data</code> have callout
-specific meanings, but typically, <code>data</code> will be a pointer
-to data block (which may either be uninitialised or wholly/partially
-initialised on entry, and may be updated on exit), and <code>size</code>
-will be the size (in bytes) of the block pointed to by <code>data</code>.
-</p>
-<p>A return value of -1 (<code>gs_error_unknownerror</code>) means
-the callout was not recognised by the handler, and should be passed
-to more handlers. Other negative values are interpreted as standard
-Ghostscript error values, and stop the propagation of the callout.
-Non-negative return codes mean the callout was handled and should
-not be passed to any more registered callout handlers.</p>
-</blockquote>
-
-<hr>
-<h2><a name="Example_usage"></a>Example Usage</h2>
-<p>To try out the following examples in a development environment like Microsoft's
-developer tools or Metrowerks Codewarrior, create a new project, save the example
-source code as a <tt>.c</tt> file and add it, along with the Ghostscript dll or shared
-library. You will also need to make sure the Ghostscript headers are available, either
-by adding their location (the <tt>src</tt> directory in the Ghostscript source
-distribution) to the project's search path, or by copying ierrors.h and iapi.h into the
-same directory as the example source.</p>
-
-<h3><a name="Example_1"></a>Example 1</h3>
-<pre>
-/* Example of using GS DLL as a ps2pdf converter. */
-
-#if defined(_WIN32) &amp;&amp; !defined(_Windows)
-# define _Windows
-#endif
-#ifdef _Windows
-/* add this source to a project with gsdll32.dll, or compile it directly with:
- * cl -D_Windows -Isrc -Febin\ps2pdf.exe ps2pdf.c bin\gsdll32.lib
- */
-# include &lt;windows.h&gt;
-# define GSDLLEXPORT __declspec(dllimport)
-#endif
-
-#include "ierrors.h"
-#include "iapi.h"
-
-void *minst = NULL;
-
-int main(int argc, char *argv[])
-{
- int code, code1;
- const char * gsargv[7];
- int gsargc;
- gsargv[0] = "";
- gsargv[1] = "-dNOPAUSE";
- gsargv[2] = "-dBATCH";
- gsargv[3] = "-dSAFER";
- gsargv[4] = "-sDEVICE=pdfwrite";
- gsargv[5] = "-sOutputFile=out.pdf";
- gsargv[6] = "input.ps";
- gsargc=7;
-
- code = gsapi_new_instance(&amp;minst, NULL);
- if (code &lt; 0)
- return 1;
- code = gsapi_set_arg_encoding(minst, GS_ARG_ENCODING_UTF8);
- if (code == 0)
- code = gsapi_init_with_args(minst, gsargc, gsargv);
- code1 = gsapi_exit(minst);
- if ((code == 0) || (code == gs_error_Quit))
- code = code1;
-
- gsapi_delete_instance(minst);
-
- if ((code == 0) || (code == gs_error_Quit))
- return 0;
- return 1;
-}
-</pre>
-
-<h3>Example 2</h3>
-<pre>
-/* Similar to command line gs */
-
-#if defined(_WIN32) &amp;&amp; !defined(_Windows)
-# define _Windows
-#endif
-#ifdef _Windows
-/* Compile directly with:
- * cl -D_Windows -Isrc -Febin\gstest.exe gstest.c bin\gsdll32.lib
- */
-# include &lt;windows.h&gt;
-# define GSDLLEXPORT __declspec(dllimport)
-#endif
-#include &lt;stdio.h&gt;
-#include "ierrors.h"
-#include "iapi.h"
-
-/* stdio functions */
-static int GSDLLCALL
-gsdll_stdin(void *instance, char *buf, int len)
-{
- int ch;
- int count = 0;
- while (count &lt; len) {
- ch = fgetc(stdin);
- if (ch == EOF)
- return 0;
- *buf++ = ch;
- count++;
- if (ch == '\n')
- break;
- }
- return count;
-}
-
-static int GSDLLCALL
-gsdll_stdout(void *instance, const char *str, int len)
-{
- fwrite(str, 1, len, stdout);
- fflush(stdout);
- return len;
-}
-
-static int GSDLLCALL
-gsdll_stderr(void *instance, const char *str, int len)
-{
- fwrite(str, 1, len, stderr);
- fflush(stderr);
- return len;
-}
-
-void *minst = NULL;
-const char start_string[] = "systemdict /start get exec\n";
-
-int main(int argc, char *argv[])
-{
- int code, code1;
- int exit_code;
-
- code = gsapi_new_instance(&amp;minst, NULL);
- if (code &lt; 0)
- return 1;
- gsapi_set_stdio(minst, gsdll_stdin, gsdll_stdout, gsdll_stderr);
- code = gsapi_set_arg_encoding(minst, GS_ARG_ENCODING_UTF8);
- if (code == 0)
- code = gsapi_init_with_args(minst, argc, argv);
- if (code == 0)
- code = gsapi_run_string(minst, start_string, 0, &amp;exit_code);
- code1 = gsapi_exit(minst);
- if ((code == 0) || (code == gs_error_Quit))
- code = code1;
-
- gsapi_delete_instance(minst);
-
- if ((code == 0) || (code == gs_error_Quit))
- return 0;
- return 1;
-}
-</pre>
-
-<h3>Example 3</h3>
-
-<p>Replace main() in either of the above with the following code,
-showing how you can feed Ghostscript piecemeal:</p>
-<pre>
-const char *command = "1 2 add == flush\n";
-
-int main(int argc, char *argv[])
-{
- int code, code1;
- int exit_code;
-
- code = gsapi_new_instance(&amp;minst, NULL);
- if (code &lt; 0)
- return 1;
- code = gsapi_set_arg_encoding(minst, GS_ARG_ENCODING_UTF8);
- if (code == 0)
- code = gsapi_init_with_args(minst, argc, argv);
-
- if (code == 0) {
- gsapi_run_string_begin(minst, 0, &amp;exit_code);
- gsapi_run_string_continue(minst, command, strlen(command), 0, &amp;exit_code);
- gsapi_run_string_continue(minst, "qu", 2, 0, &amp;exit_code);
- gsapi_run_string_continue(minst, "it", 2, 0, &amp;exit_code);
- gsapi_run_string_end(minst, 0, &amp;exit_code);
- }
-
- code1 = gsapi_exit(minst);
- if ((code == 0) || (code == gs_error_Quit))
- code = code1;
-
- gsapi_delete_instance(minst);
-
- if ((code == 0) || (code == gs_error_Quit))
- return 0;
- return 1;
-}
-</pre>
-
-<h3>Example 4</h3>
-
-<p>When feeding Ghostscript piecemeal buffers, one can use the normal
-operators to configure things and invoke library routines. For example,
-to parse a PDF file one could say:</p>
-
-<pre>
- code = gsapi_run_string(minst, "(example.pdf) .runlibfile", 0, &amp;exit_code);
-</pre>
-
-<p>and Ghostscript would open and process the file named "example.pdf" as
-if it had been passed as an argument to
-<code>gsapi_init_with_args()</code>.</p>
-<hr>
-<h2><a name="Multiple_threads"></a>Multiple threads</h2>
-<p>The Ghostscript library should have been compiled with a
-thread safe run time library.
-Synchronisation of threads is entirely up to the caller.
-The exported <a href="#Exported_functions "><code>gsapi_*()</code></a>
-functions must be called from one thread only.</p>
-<hr>
-<h2><a name="stdio"></a>Standard input and output</h2>
-<p>
-When using the Ghostscript interpreter library interface, you have a
-choice of two standard input/output methods.</p>
-<ul>
-<li>If you do nothing, the "C" stdio will be used.</li>
-<li>If you use <code>gsapi_set_stdio()</code>, all stdio will
- be redirected to the callback functions you provide.
- This would be used in a graphical user interface environment
- where stdio is not available, or where you wish to process
- Ghostscript input or output.</li>
-</ul>
-<p>
-The callback functions are described in
-<a href="../psi/iapi.h"><code>iapi.h</code></a>.</p>
-
-<hr>
-<h2><a name="display"></a>Display device</h2>
-<p>
-The <code>display</code> device is available for use with
-the Ghostscript interpreter library. While originally designed
-for allowing screen display of rendered output from Ghostscript,
-this is now powerful enough to provide a simple mechanism for
-getting rendered output suitable for use in all manner of
-output scenarios, including printing.</p>
-<p>Details of the API and options are given in the file
-<code><a href="../devices/gdevdsp.h">gdevdsp.h</a></code>.
-This device provides you with access to the raster output of
-Ghostscript. It is the callers responsibility to copy this raster
-to a display window or printer.</p>
-<p>
-In order for this device to operate, it needs access to a structure
-containing a set of callback functions, and a callback handle (an
-opaque <code>void *</code> that can be used by caller to locate its
-own state). There are 2 ways that the device can get this
-information, a legacy method, and a modern method.
-</p>
-<dl>
-<dt>Legacy method</dt>
-<dd>
-<p>The address of the callback structure, is provided
-using <code>gsapi_set_display_callback()</code>.
-This must be called after
-<code>gsapi_new_instance()</code>
-and before
-<code>gsapi_init_with_args()</code>.</p>
-<p>
-With this call, the callback handle is passed as NULL by default, but can
-be overridden by using a parameter. We actively dislike
-this way of working, as we consider passing addresses
-via the command line distasteful. The handle can be
-set using</p>
-<blockquote>
- -sDisplayHandle=1234
-</blockquote>
-<p>
-Where "1234" is a string. The API was changed to use a string
-rather than an integer/long value when support for 64 bit systems
-arrived. A display "handle" is often a pointer, and since these
-command line options have to survive being processed by Postscript
-machinery, and Postscript only permits 32 bit number values, a
-different representation was required. Hence changing the value
-to a string, so that 64 bit values can be supported. The string
-formats allowed are:</p>
-<blockquote>
-<code>1234</code> - implicit base 10
-</blockquote>
-<blockquote>
-<code>10#1234</code> - explicit base 10
-</blockquote>
-<blockquote>
-<code>16#04d2</code> - explicit base 16
-</blockquote>
-<p>
-The "number string" is parsed by the display device to retrieve
-the number value, and is then assigned to the void pointer
-parameter "pHandle" in the display device structure. Thus, for
-a trivial example, passing <code>-sDisplayHandle=0</code> will result
-in the first parameter passed to your display device callbacks being:
-<code>(void *)0</code>.</p>
-<p>
-The previous API, using a number value:</p>
-<blockquote>
- -dDisplayHandle=1234
-</blockquote>
-<p>
-is still supported on 32 bit systems, but will cause a "typecheck"
-error on 64 bit systems, and is considered deprecated. It should
-not be used in new code.</p>
-</dd>
-<dt>Modern method
-<dd>
-<p>The preferred method is to register a callout handler using
-<code><a href="#register_callout">gsapi_register_callout</a></code>.
-When this handler is called for the <code>&quot;display&quot;</code>
-device, with <code>id = 0</code> (= <code>DISPLAY_CALLOUT_GET_CALLBACK</code>),
-then <code>data</code> should point to an empty <code>gs_display_get_callback_t</code>
-block, with <code>size = sizeof(gs_display_get_callback_t)</code>.
-</p>
-<pre>
-typedef struct {
- display_callback *callback;
- void *caller_handle;
-} gs_display_get_callback_t;
-</pre>
-<p>The handler should fill in the structure before returning,
-with a return code of 0.</p>
-</dd>
-</dl>
-<p>
-Note, that the <code>DisplayHandle</code> value is only consulted for
-display device callbacks registered using the (legacy, now deprecated)
-<code>gsapi_set_display_callback</code> API, not the preferred
-<code>gsapi_register_callout</code> based mechanism.
-
-<p>
-The device raster format can be configured using</p>
-<blockquote>
- -dDisplayFormat=NNNN
-</blockquote>
-<p>Options include</p>
-<ul>
-<li> native, gray, RGB, CMYK or separation color spaces.</li>
-<li> alpha byte (ignored).</li>
-<li> 1 to 16 bits/component.</li>
-<li> bigendian (RGB) or littleendian (BGR) order.</li>
-<li> top first or bottom first raster.</li>
-<li> 16 bits/pixel with 555 or 565 bitfields.</li>
-<li> Chunky, Planar and Planar interleaved formats.</li>
-<li> "Full screen" or "Rectangle Request" modes of operation.</li>
-</ul>
-<p>The operation of the device is best described with a walkthrough
-of some example code that uses it. For simplicity and clarity, we
-have omitted the error handling code in this example; in production
-code, every place where we get a <code>code</code> value returned
-we should check it for failure (a negative value) and clean up
-accordingly. First, we create an instance of Ghostscript:</p>
-<pre>
- void *minst = NULL;
- code = gsapi_new_instance(&amp;minst, NULL);
- code = gsapi_set_stdio(minst, gsdll_stdin, gsdll_stdout, gsdll_stderr);
-</pre>
-<p>Next, we have to give the display device the address of our
-callback structure. In old code, we would do so using something
-like this:</p>
-<pre>
- code = gsapi_set_display_callback(minst, &amp;display_callback);
-</pre>
-<p>We strongly recommend that you don't do that, but instead use the
-more modern <a href="callout">callout</a> mechanism:</p>
-<pre>
- code = gsapi_register_callout(minst, my_callout_handler, state);
-</pre>
-<p>where <code>state</code> is any <code>void *</code> value you like,
-usually a pointer to help you reach any internal state you may need.
-Earlier in your code you would have the definition of
-<code>my_callout_handler</code> that might look like this:</p>
-<pre>
- static int
- my_callout_handler(void *instance,
- void *callout_handle,
- const char *device_name,
- int id,
- int size,
- void *data)
-{
- /* On entry, callout_handle == the value of state passed in
- * to gsapi_register_callout. */
- /* We are only interested in callouts from the display device. */
- if (device_name == NULL || strcmp(device_name, "display"))
- return -1;
-
- if (id == DISPLAY_CALLOUT_GET_CALLBACK)
- {
- /* Fill in the supplied block with the details of our callback
- * handler, and the handle to use. In this instance, the handle
- * is the pointer to our test structure. */
- gs_display_get_callback_t *cb = (gs_display_get_callback_t *)data;
- cb->callback = &display_callback;
- cb->caller_handle = callout_handle;
- return 0;
- }
- return -1;
-}
-</pre>
-<p>As you can see, this callout handler only responds to callouts
-for the display device, and then only for one particular function
-(<code>id</code>). It returns the same <code>display_callback</code>
-structure as the deprecated, legacy mechanism passed in using
-<code>gsapi_set_display_callback</code>, with the added benefit that
-the <code>caller_handle</code> value can be passed in too. In this
-example we pass in the same value as was used for <code>callout_handle</code>,
-but implementations are free to use any value they want.</p>
-<p>Returning to our example, we now set up a set of arguments to
-setup Ghostscript:</p>
-<pre>
- int argc = 0;
- /* Allow for up to 32 args of up to 64 chars each. */
- char argv[32][64];
- sprintf(argc[argc++], "gs");
- sprintf(argv[argc++], "-sDEVICE=display");
-</pre>
-<p>The zeroth arg is a dummy argument to match the standard C mechanism
-for passing arguments to a program. Traditionally this is the name of
-the program being invoked. Next, we tell Ghostscript to use the display
-device.</p>
-<pre>
- sprintf(argv[argc++], "-sDEVICE=display");
-</pre>
-Next we tell the display device what output format to use. The
-format is flexible enough to support common Windows, OS/2, Linux
-and Mac raster formats. <p>The format values are described in
-<code><a href="../devices/gdevdsp.h">gdevdsp.h</a></code>.
-To select the display device with a Windows 24-bit RGB raster:</p>
-<pre>
- sprintf(argv[argc++], "-dDisplayFormat=%d",
- DISPLAY_COLORS_RGB | DISPLAY_ALPHA_NONE | DISPLAY_DEPTH_8 |
- DISPLAY_LITTLEENDIAN | DISPLAY_BOTTOMFIRST);
-</pre>
-<p>If (and only if) you used the legacy mechanism described above, you
-will need another argument to pass in the <code>caller_handle</code>
-value to be parroted back to the functions listed within
-<code>display_callback</code>:</p>
-<pre>
- sprintf(arg2, "-dDisplayHandle=%d", callout_handle);
-</pre>
-<p>Any other arguments that you want can be added to the end of
-the command line, typically including a file to run. Then we pass
-that all to Ghostscript:
-<pre>
- code = gsapi_init_with_args(minst, argc, argv);
-</pre>
-
-<p><a name="display_callback"></a>At this point you should start to
-see your display callback functions being called. Exactly which callback
-functions are provided, and how they respond will determine exactly
-how the display device operates. The primary choice will be whether the
-device runs in &quot;full page&quot; or &quot;rectangle request&quot;
- mode. Details of these are given below.</p>
-
-<p>Once we have finished processing the file, we can process
-other files using <code>gsapi_run_file</code>, or feed in data
-using <code>gsapi_run_string</code>. Once you have finished, you
-can shut the interpreter down and exit, using:</p>
-
-<pre>
- code = gsapi_exit(minst);
- gsapi_delete_instance(minst);
-</pre>
-
-<p>A full list of the display callback functions can be found in
-<code><a href="../devices/gdevdsp.h">gdevdsp.h</a></code>. There
-are several different versions of the callback, corresponding to
-different &quot;generations&quot; of the device. In general
-you should use the latest one. The <code>size</code> field of
-the structure should be initialised to the size of the structure
-in bytes.</p>
-
-<h3><a name="display_open"></a>display_open</h3>
-
-<pre>int (*display_open)(void *handle, void *device);</pre>
-
-<p>This function will be called when the display device is
-opened. The device may be opened and closed many times,
-sometimes without any output being produced.</p>
-
-<h3><a name="display_preclose"></a>display_preclose</h3>
-
-<pre>int (*display_preclose)(void *handle, void *device);</pre>
-
-<p>This function will be called when the display device is
-about to be closed. The device will not actually be closed
-until this function returns.</p>
-
-<h3><a name="display_close"></a>display_close</h3>
-
-<pre>int (*display_close)(void *handle, void *device);</pre>
-
-<p>This function will be called once the display device has
-been closed. There will be no more events from the device
-unless/until it is reopened.</p>
-
-<h3><a name="display_presize"></a>display_presize</h3>
-
-<pre>int (*display_presize)(void *handle, void *device,
- int width, int height, int raster, unsigned int format);</pre>
-
-<p>This function will be called when the display device is
-about to be resized. The device will only be resized if this
-function returns 0.</p>
-
-<h3><a name="display_size"></a>display_size</h3>
-
-<pre>int (*display_size)(void *handle, void *device, int width, int height,
- int raster, unsigned int format, unsigned char *pimage);</pre>
-
-<p>This function will be called when the display device is
-has been resized. The pointer to the raster image is pimage.</p>
-
-<h3><a name="display_sync"></a>display_sync</h3>
-
-<pre>int (*display_sync)(void *handle, void *device);</pre>
-
-<p>This function may be called periodically during display
-to flush the page to the display.</p>
-
-<h3><a name="display_page"></a>display_page</h3>
-
-<pre>int (*display_page)(void *handle, void *device, int copies, int flush);</pre>
-
-<p>This function is called on a &quot;showpage&quot; operation
-(i.e. at the end of every page). Operation will continue as soon as
-this function returns.</p>
-
-<h3><a name="display_update"></a>display_update</h3>
-
-<pre>int (*display_update)(void *handle, void *device,
- int x, int y, int w, int h);</pre>
-
-<p>This function <strong>may</strong> get called repeatedly
-during rendering to indicate that an area of the output has
-been updated. Certain types of rendering will not see this
-function called back at all (in particular files using
-transparency).</p>
-
-<h3><a name="display_memalloc"></a>display_memalloc</h3>
-
-<pre>int (*display_memalloc)(void *handle, void *device,
- size_t long size);</pre>
-
-<p><strong>Note:</strong> In older versions of this API,
-size is an <code>unsigned long</code> rather than a
-<code>size_t</code>.</p>
-<p>If this function pointer is sent as NULL, then the
-display device will handle all the memory allocations
-internally, and will always work in full page rendering
-mode.</p>
-<p>Otherwise, this function will be called to allocate
-the storage for the page to be rendered into. If a non-NULL
-value is returned, then the device will proceed to render
-the full page into it. If NULL is returned, then the device
-will check a) whether we are using a V2 or greater display
-callback structure and b) whether that structure specifies
-a <code>rectangle_request</code> function pointer.</p>
-<p>If both of those conditions are true, then the device
-will continue in rectangle request mode. Otherwise it will
-fail with an out of memory error.</p>
-
-
-<h3><a name="display_memfree"></a>display_memfree</h3>
-
-<pre>int (*display_memfree)(void *handle, void *device, void *ptr);</pre>
-
-<p>This function should be NULL if and only if
-<code><a href="#display_memalloc">display_memalloc</a></code> is
-NULL. Any memory allocated using <code>display_memalloc</code> will be
-freed via this function.</p>
-
-<h3><a name="display_separation"></a>display_separation</h3>
-<pre>int (*display_separation)(void *handle, void *device,
- int component, const char *component_name,
- unsigned short c, unsigned short m,
- unsigned short y, unsigned short k);</pre>
-
-<p>When using <code>DISPLAY_COLORS_SEPARATION</code>, this function
- will be called once for every separation component - first
- &quot;Cyan&quot;, &quot;Magenta&quot;, &quot;Yellow&quot; and
- &quot;Black&quot;, then any spot colors used. The supplied
- <code>c</code>, <code>m</code>, <code>y</code> and <code>k</code>
- values give the equivalent color for each spot. Each colorant
- value ranges from 0 (for none) to 65535 (full).</p>
-<p>In separation color mode you are expected to count the number
-of calls you get to this function after each
-<code><a href="#display_size">display_size</a></code> to know how many
-colors you are dealing with.</p>
-
-<h3><a name="display_adjust_band_height"></a>display_adjust_band_height</h3>
-<pre>int (*display_adjust_band_height)(void *handle, void *device,
- int bandheight);</pre>
-
-<p>When running in &quot;rectangle request mode&quot; the device
-first renders the page to a display list internally. It can then
-be played back repeatedly so that different regions (rectangles)
-of the page can be extracted in sequence. A common use of this is
-to support &quot;banded&quot; operation, where the page is divided
-into multiple non-overlapping bands of a fixed height.</p>
-<p>The display device itself will pick an appropriate band height
-for it to use. If this function pointer is left as NULL then this
-value will be used unchanged. Otherwise, the proposed value will
-be offered to this function. This function can override the choice
-of bandheight, by returning the value that it would like to be
-used in preference.</p>
-<p>In general, this figure should (as much as possible) only be
-adjusted downwards. For example, a device targeting an inkjet printer
-with 200 nozzles in the print head might like to extract bands
-that are a multiple of 200 lines high. So the function might
-return <code>max(200, 200*(bandheight/200))</code>. If the function
-returns 0, then the existing value will be used unchanged.</p>
-<p>Any size rectangle can be chosen with any size bandheight,
-so ultimately the value chosen here will not matter much. It
-may make some small difference in speed in some cases.</p>
-
-<h3><a name="display_rectangle_request"></a>display_rectangle_request</h3>
-<pre>int (*display_rectangle_request)(void *handle, void *device,
- void **memory, int *ox, int *oy,
- int *raster, int *plane_raster,
- int *x, int *y, int *w, int *h);</pre>
-
-<p>If the display device chooses to use rectangle request mode,
-this function will be called repeatedly to request a rectangle
-to render. Ghostscript will render the rectangle, and call this
-function again. The implementer is expected to handle the rectangle
-that has just been rendered, and to return the details of another
-rectangle to render. This will continue until a rectangle with
-zero height or width is returned, whereupon Ghostscript will
-continue operation.</p>
-<p>On entry, <code>*raster</code> and <code>*plane_raster</code>
-are set to the values expected by the format in use. All the
-other pointers point to uninitialised values.</p>
-<p>On exit, the values should be updated appropriately. The
-implementor is expected to store the values returned so that
-the rendered output given can be correctly interpreted when
- control returns to this function.</p>
-<p><code>memory</code> should be updated to point to a block of
-memory to use for the rendered output. Pixel (<code>*ox</code>,
-<code>*oy</code>) is the first pixel represented in that block.
-<code>*raster</code> is the number of bytes difference between
-the address of component 0 of Pixel(<code>*ox</code>, <code>*oy</code>)
-and the address of component 0 of Pixel(<code>*ox</code>,
-<code>1+*oy</code>). <code>*plane_raster</code> is the number of
-bytes difference between the address of component 0 of
-Pixel(<code>*ox</code>, <code>*oy</code>) and the address of
-component 1 of Pixel(<code>*ox</code>, <code>*oy</code>), if in
-planar mode, 0 otherwise. <code>*x</code>, <code>*y</code>,
-<code>*w</code> and <code>*h</code> give the rectangle requested
-within that memory block.</p>
-<p>Any set of rectangles can be rendered with this method, so this
-can be used to drive Ghostscript in various ways. Firstly, it is
-simple to request a set of non-overlapping &quot;bands&quot; that
-cover the page, to drive a printer. Alternatively, rectangles can
-be chosen to fill a given block of memory to implement a window
-panning around a larger page. Either the whole image could be
-redrawn each time, or smaller rectangles around the edge of the
-panned area could be requested. The choice is down to the caller.</p>
-
-<p>
-Some examples of driving this code in full page mode are in
-<code><a href="../psi/dwmain.c">dwmain.c</a></code> (Windows),
-<code><a href="../psi/dpmain.c">dpmain.c</a></code> (OS/2) and
-<code><a href="../psi/dxmain.c">dxmain.c</a></code> (X11/Linux), and
-<code><a href="../psi/dmmain.c">dmmain.c</a></code> (MacOS Classic or Carbon).</p>
-<p>Alternatively an example that drives this code in both full page
-and rectangle request mode can be found in
-<code><a href="../demos/c/api_test.c">api_test.c</a></code>.</p>
-
-<p>
-On some platforms, the calling convention for the display device callbacks in
-<code><a href="../devices/gdevdsp.h">gdevdsp.h</a></code>
-is not the same as the exported
-<a href="#Exported_functions "><code>gsapi_*()</code></a>
-functions in <a href="../psi/iapi.h"><code>iapi.h</code></a>.</p></p>
-
-<!-- [2.0 end contents] ==================================================== -->
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small></p>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.</p>
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.</p>
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/C-style.htm b/doc/C-style.htm
deleted file mode 100644
index 60443821..00000000
--- a/doc/C-style.htm
+++ /dev/null
@@ -1,1604 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Ghostscript C Coding Guidelines</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
-
- <article>
-
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>C Style</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-
-<ul class="toc">
- <li><a href="#Introduction">Introduction</a></li>
- <li><a href="#C_language">C language do's and don'ts</a></li>
- <li>
- <ul>
- <li>Preprocessor:
- <a href="#Conditionals">Conditionals</a>,
- <a href="#Macros">Macros</a>,
- <a href="#Preprocessor_other">Other</a></li>
- <li><a href="#Lexical_elements">Lexical elements</a></li>
- <li><a href="#Scoping">Scoping</a></li>
- <li>Data types:
- <a href="#Scalars">Scalars</a>,
- <a href="#Arrays">Arrays</a>,
- <a href="#Typedefs">Typedefs</a>,
- <a href="#Structures">Structures</a>,
- <a href="#Unions">Unions</a></li>
- <li><a href="#Expressions">Expressions</a></li>
- <li><a href="#Statements">Statements</a></li>
- <li><a href="#Procedures">Procedures</a> (prototypes and definitions)</li>
- <li><a href="#Standard_library">Standard library</a></li>
- </ul>
- </li>
- <li><a href="#Language_extensions">Language extensions</a></li>
- <li><a href="#Stylistic_conventions">Stylistic conventions</a></li>
- <li>
- <ul>
- <li>Formatting:
- <a href="#Indentation">Indentation</a>,
- <a href="#Spaces">Spaces</a>,
- <a href="#Parentheses">Parentheses</a></li>
- <li><a href="#Preprocessor_style">Preprocessor</a></li>
- <li><a href="#Naming">Naming</a></li>
- <li><a href="#Types">Types</a></li>
- <li><a href="#Procedures_style">Procedures</a>,</li>
- <li>Miscellany:
- <a href="#Local_variables">Local variables</a>,
- <a href="#Compiler_warnings">Compiler warnings</a></li>
- </ul>
- </li>
- <li><a href="#File_structuring">File structuring and naming</a></li>
- <li>
- <ul>
- <li><a href="#All_files">All files</a></li>
- <li><a href="#Makefiles">Makefiles</a></li>
- <li><a href="#General_C_code">General C Code</a></li>
- <li><a href="#Headers">Headers (<code>.h</code> files)</a></li>
- <li><a href="#Source">Source (<code>.c</code> files)</a></li>
- </ul>
- </li>
- <li><a href="#Conventions">Ghostscript conventions</a></li>
- <li>
- <ul>
- <li><a href="#Specific_names">Specific names</a>:
- <a href="#code"><code>code</code></a>,
- <a href="#status"><code>status</code></a></li>
- <li><a href="#Structure_type_descriptors">Structure type descriptors</a></li>
- <li><a href="#Objects">"Objects"</a></li>
- <li><a href="#Error_handling">Error handling</a></li>
- </ul>
- </li>
-</ul>
-
-
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>
-For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Introduction"></a>Introduction</h2>
-
-<p>
-This document describes Ghostscript's C coding conventions. It is primarily
-<em>prescriptive</em>, documenting what developers should do when writing
-new code; the companion developer documentation (<a
- href="Develop.htm">Develop.htm</a>) is primarily <em>descriptive</em>,
-documenting the way things are.</p>
-
-<p>
-We encourage following the general language usage and stylistic rules for
-any code that will be integrated with Ghostscript, even if the code doesn't
-use Ghostscript's run-time facilities or have anything to do with
-PostScript, PDF, or page description languages. Ghostscript itself follows
-some additional conventions; these are documented separately under "<a
-href="#Conventions">Ghostscript conventions</a>" below.</p>
-
-<hr>
-
-<h2><a name="C_language"></a>C language do's and don'ts</h2>
-
-<p>
-There are several different versions of the C language, and even of the ANSI
-C standard. Ghostscript versions through 7.0 were designed to compile on
-pre-ANSI compilers as well as on many compilers that implemented the ANSI
-standard with varying faithfulness. Ghostscript versions since 7.0 do not
-cater for pre-ANSI compilers: they must conform to the ANSI 1989 standard
-(ANS X3.159-1989), with certain restrictions and a few conventional
-additions.</p>
-
-<h3>Preprocessor</h3>
-
-<h4><a name="Conditionals"></a>Conditionals</h4>
-
-<p>Restrictions:</p>
-
-<ul>
-
-<li>Don't assume that <code>#if</code> will treat undefined names as 0.
-While the ANSI standard requires this, it may produce a warning.</li>
-
-<li>In <code>.c</code> files, don't use preprocessor conditionals that
-test for individual platforms or compilers. Use them only in header files
-named xxx<code>_.h</code>.</li>
-
-</ul>
-
-<h4><a name="Macros"></a>Macros</h4>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Don't redefine a macro, even with the same definition, without using
-<code>#undef</code>.</li>
-
-<li><code>CAPITALIZE</code> macro names unless there is a good reason not
-to.</li>
-
-<li>Even though the legacy code contains some macros which contain
-control flow statments, avoid the use of this in new code and do not
-create macros which contain hidden control flow, especially 'return'.
-The use of control flow in macros complicates debug significantly
-requiring tedious expansion of macros to build a module to be debugged
-or resorting to disassembly windows to set breakpoints or to trace
-flow.</li>
-
-<li>Don't use a macro call within a macro argument if the call expands to a
-token sequence that includes any commas not within parentheses: this
-produces different results depending on whether the compiler expands the
-inner call before or after the argument is substituted into the macro body.
-(The ANSI standard says that calls must be expanded after substitution, but
-some compilers do it the other way.)</li>
-
-<li>Don't use macro names, even inadvertently, in string constants. Some
-compilers erroneously try to expand them.</li>
-
-<li>Don't use macros to define shorthands for casted pointers. For
-instance, avoid
-
-<blockquote><code>
-#define fdev ((gx_device_fubar *)dev)
-</code></blockquote>
-
-<p>
-and instead use</p>
-
-<blockquote><code>
-gx_device_fubar * const fdev = (gx_device_fubar *)dev;
-</code></blockquote>
-
-<p>
-The use of <code>const</code> alerts the reader that this is effectively
-a synonym.</p>
-</li>
-
-<li>If a macro generates anything larger than a single expression (that is,
-one or more statements), surround it with <code>BEGIN</code> and
-<code>END</code>. These work around the fact that simple statements and
-compound statements in C can't be substituted for each other syntactically.</li>
-
-<li>If a macro introduces local variables, only use names that end with an
-underscore (<code>_</code>), such as <code>code_</code>. This avoids
-clashes both with ordinary variable names (which should never end with an
-underscore) and with system-defined names (which may begin with an
-underscore).</li>
-
-</ul>
-
-<h3><a name="Preprocessor_other"></a>Other</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Only use <code>#pragma</code> in files that are explicitly identified
-as being platform-dependent. Many compilers complain if this is used at
-all, and some complain if they don't recognize the specific pragma being
-requested (both incorrect according to the ANSI standard).</li>
-
-</ul>
-
-<h3><a name="Lexical_elements"></a>Lexical elements</h3>
-
-<p>
-Do not use:</p>
-
-<ul>
-
-<li>ANSI trigraphs (??x)</li>
-<li>Nested comments (/* /* */ */) (not ANSI compliant, but often accepted)</li>
-<li>Multi-character character constants ('abc')</li>
-<li>Wide-character character or string constants (L'x', L"x")</li>
-
-</ul>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Procedure and static variable names must be 31 characters or less.</li>
-
-<li>Externally visible procedure and variable names must be unique in the
-first 23 characters.</li>
-
-</ul>
-
-<h3><a name="Scoping"></a>Scoping (extern, static, ...)</h3>
-
-<p>
-Do not use:</p>
-
-<ul>
-
-<li><code>register</code></li>
-
-</ul>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Do not allow a global variable (constant) to have more than one
-non-<code>extern</code> definition, even though some ANSI C compilers
-allow this. Every global constant should have exactly one definition, in a
-<code>.c</code> file, and preferably just one <code>extern</code>
-declaration, in a header file.</li>
-
-<li><code>static</code> or variables must be
-<code>const</code> and initialized: non-<code>const</code> statically
-allocated variables are incompatible with reentrancy, and we're in the
-process of eliminating all of them.</li>
-
-<li>Do not use <code>extern</code> in <code>.c</code> files, only in
-<code>.h</code> files, unless you have a very good reason for it (e.g.,
-as in <a href="../psi/iconf.c">iconf.c</a>). There are too many such
-<code>extern</code>s in the code now: we are eliminating them over time.</li>
-
-<li>Do not declare the same name as both <code>static</code>
-and non-<code>static</code> within the same
-compilation. (Some compilers complain, some do not.) This is especially a
-problem for procedures: it is easy to declare a procedure as
-<code>static</code> near the beginning of a file and accidentally not
-declare it <code>static</code> where it is defined later in the file.</li>
-
-<li>Even though the ANSI standard allows initialized external declarations
-(<code>extern&nbsp;int&nbsp;x&nbsp;=&nbsp;0</code>), don't use them.</li>
-
-</ul>
-
-<h3><a name="Scalars"></a>Scalars</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Avoid using <code>char</code>, except for <code>char&nbsp;*</code>
-for a pointer to a string. Don't assume that <code>char</code> is
-signed; also don't assume it is unsigned.</li>
-
-<li>Never cast a <code>float</code> to a <code>double</code>
-explicitly. ANSI compilers in their default mode do all floating point
-computations in double precision, and handle such casts automatically.</li>
-
-<li>Don't use <code>long long</code>: even though it is in the ANSI
-standard, not all compilers support it. Use the
-<code>(u)int64_t</code> types from <code>stdint_.h</code> instead.</li>
-
-<li>Don't assume anything about whether <code>sizeof(long)</code> is less
-than, equal to, or greater than <code>sizeof(ptr)</code>. (However, you
-can make such comparisons in preprocessor conditionals using
-<code>ARCH_SIZEOF_LONG</code> and <code>ARCH_SIZEOF_PTR</code>.)</li>
-
-</ul>
-
-<h3><a name="Arrays"></a>Arrays</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Don't declare arrays of size 0. (The newer ANSI standard allows this,
-but the older one doesn't.)</li>
-
-<li>Don't declare an array of size 1 at the end of a structure to indicate
-that a variable-size array follows.</li>
-
-<li>Don't declare initialized <code>auto</code> arrays.</li>
-
-</ul>
-
-<h3><a name="Typedefs"></a>Typedefs</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Don't use <code>typedef</code> for function types, such as:
-
-<blockquote>
-<code>typedef int proc_xyz_t(double, int *);</code>
-</blockquote>
-
-<p>Many compilers don't handle this correctly -- they will give errors, or
-do the wrong thing, when declaring variables of type
-<code>proc_xyz_t</code> and/or <code>proc_xyz_t *</code>. Instead, do
-this:</p>
-
-<blockquote>
-<code>#define PROC_XYZ(proc) int proc(double, int *)<br>
-PROC_XYZ(some_proc); /* declare a procedure of this type */<br>
-typedef PROC_XYZ((*proc_xyz_ptr_t)); /* define a type for procedure ptrs */<br>
-<br>
-proc_xyz_ptr_t pp; /* pointer to procedure */</code>
-</blockquote>
-</li>
-<li>Don't redefine <code>typedef</code>'ed names, even with the same
-definition. Some compilers complain about this, and the standard doesn't
-allow it.</li>
-
-</ul>
-
-<h3><a name="Structures"></a>Structures</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Don't use anonymous structures if you can possibly avoid it, except
-occasionally as components of other structures. Ideally, use the
-<code>struct</code> keyword only for declaring named structure types,
-like this:
-
-<blockquote>
-<code>typedef struct xxx_s {</code><br>
-&nbsp;&nbsp;&nbsp;... members ...<br>
-<code>} xxx_t;</code>
-</blockquote>
-</li>
-<li>Use <code>struct</code> only when declaring structure types, never
-for referring to them (e.g., never declare a variable as type
-<code>struct&nbsp;xxx_s&nbsp;*</code>).</li>
-
-<li>Don't assume that the compiler will (or won't) insert padding in
-structures to align members for best performance. To preserve alignment,
-only declare structure members that are narrower than an <code>int</code>
-if there will be a lot of instances of that structure in memory. For such
-structures, insert <code>byte</code> and/or <code>short</code> padding
-members as necessary to re-establish <code>int</code> alignment.</li>
-
-<li>Don't declare initialized <code>auto</code> structures.</li>
-
-</ul>
-
-<h3><a name="Unions"></a>Unions</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Use unions only as components of structures, not as typedefs in their
-own right.</li>
-
-<li>Don't attempt to initialize unions: not all compilers support this, even
-though it is in the 1989 ANSI standard.</li>
-
-</ul>
-
-<h3><a name="Expressions"></a>Expressions</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Don't assign a larger integer data type to a smaller one without a cast
-(<code>int_x&nbsp;=&nbsp;long_y</code>).</li>
-
-<li>It's OK to use the address of a structure or array element
-(<code>&amp;p-&gt;e</code>, <code>&amp;a[i]</code>) locally, or pass it to a
-procedure that won't store it, but don't store such an address in allocated
-storage unless you're very sure of what you're doing.</li>
-
-<li>Don't use conditional expressions with structure or union values.
-(Pointers to structures or unions are OK.)</li>
-
-<li>For calling a variable or parameter procedure, use
-<code>ptr-&gt;func(...)</code>. Some old code uses explicit indirection,
-<code>(*ptr-&gt;func)(...)</code>: don't use this in new code.</li>
-
-<li>Don't write expressions that depend on order of evaluation, unless the
-order is created explicitly by use of <code>||</code>,
-<code>&amp;&amp;</code>, <code>?:</code>, <code>,</code>, or
-function nesting (the arguments of a function must be evaluated before the
-function is called). In particular, don't assume that the arguments of a
-function will be evaluated left-to-right, or that the left side of an
-assignment will be evaluated before the right.</li>
-
-<li>Don't mix integer and enumerated types ad lib: treat enumerated types as
-distinct from integer types, and use casts to convert between the two.
-(Some compilers generate warnings if you do not do this.)</li>
-
-</ul>
-
-<h3><a name="Statements"></a>Statements</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>If you use an expression as a statement, other than an assignment or a
-function call with <code>void</code> return value, enclose it explicitly
-in <code>DISCARD()</code>.</li>
-
-<li>The type of the operand of a <code>switch</code> must match the type
-of the case labels, whether the labels are <code>int</code>s or the
-members of an <code>enum</code> type. (Use a cast if necessary.)</li>
-
-<li>It is OK for one case of a switch to "fall through" into another (i.e.,
-for the statement just before a case label not to be a control transfer),
-but a comment <code>/*&nbsp;falls&nbsp;through&nbsp;*/</code> is
-required.</li>
-
-<li>If you are returning an error code specified explicitly (e.g.,
-<code>return&nbsp;gs_error_rangecheck</code>), use
-<code>return_error()</code> rather than plain <code>return</code>.
-However, if the program is simply propagating an error code generated
-elsewhere, as opposed to generating the error, use <code>return</code>
-(e.g., <code>if&nbsp;(code&nbsp;&lt;&nbsp;0)&nbsp;return&nbsp;code</code>).</li>
-
-</ul>
-
-<h3><a name="Procedures"></a>Procedures</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Provide a prototype for every procedure, and make sure the prototype is
-available at every call site. If the procedure is local to a file
-(<code>static</code>), the prototype should precede the procedure, in
-the same file; if the procedure is global, the prototype should be in a
-header file.</li>
-
-<li>If a procedure parameter is itself a procedure, do list its parameter
-types rather than just using <code>()</code>. For example:
-
-<blockquote><code>
-int foo(int (*callback)(int, int));
-</code></blockquote>
-
-<p>
-rather than just</p>
-
-<blockquote><code>
-int foo(int (*callback)());
-</code></blockquote>
-</li>
-<li>Don't use the <code>P</code>* macros in new code. (See the
-Procedures section of <a href="#Language_extensions">Language extensions</a>
-below for more information.)</li>
-
-<li>Always provide an explicit return type for procedures, in both the
-prototype and the definition: don't rely on the implicit declaration as
-<code>int</code>.</li>
-
-<li>Don't use <code>float</code> as the return type of a procedure,
-unless there's a special reason. Floating point hardware typically does
-everything in double precision internally and has to do extra work to
-convert between double and single precision.</li>
-
-<li>Don't declare parameters as being of type <code>float</code>,
-<code>short</code>, or <code>char</code>. If you do this and forget
-to include the prototype at a call site, ANSI compilers will generate
-incompatible calling sequences. Use <code>double</code> instead of
-<code>float</code>, and use <code>int</code> or <code>uint</code>
-instead of <code>short</code> or <code>char</code>.</li>
-
-</ul>
-
-<h3><a name="Standard_library"></a>Standard library</h3>
-
-<p>
-Restrictions:</p>
-
-<ul>
-
-<li>Only use library features that are documented in the established ANSI
-standard (e.g., Harbison &amp; Steele's book). Do not use procedures that are
-"standards" promulgated by Microsoft (e.g., <code>stricmp</code>), or
-originate in BSD Unix (e.g., <code>strcasecmp</code>), or were added in
-later versions of the standard such as C 9X.</li>
-
-<li>Do not use any features from <code>stdio.h</code> that assume the
-existence of <code>stdin</code>, <code>stdout</code>, or
-<code>stderr</code>. See <a href="../base/gsio.h">gsio.h</a> for the full
-list. Instead, use <code>gs_stdin</code> et al.</li>
-
-</ul>
-
-<hr>
-
-<h2><a name="Language_extensions"></a>Language extensions</h2>
-
-<h3>Scoping</h3>
-
-<dl>
-
-<dt><code>static</code></dt>
-
-<dd>Ghostscript assumes the compiler supports the <code>static</code>
-keyword for declaring variables and procedures as local to a particular
-source file.</dd>
-
-<dt><code>inline</code></dt>
-
-<dd><code>inline</code> is available even if the compiler does not
-support it. Be aware, however, that it may have no effect. In particular,
-do not use <code>inline</code> in header files. Instead, use the
-<code>extern_inline</code> facility described just below.</dd>
-
-<dt><code>extern_inline</code></dt>
-
-<dd>Compilers that do support <code>inline</code> vary in how they decide
-whether to (also) compile a closed-code copy of the procedure. Because of
-this, putting an <code>inline</code> procedure in a header file may
-produce multiple closed copies, causing duplicate name errors at link time.
-<code>extern_inline</code> provides a safe way to put
-<code>inline</code> procedures in header files, regardless of compiler.
-Unfortunately, the only way we've found to make this fully portable involves
-a fair amount of boilerplate. For details, please see <a
-href="../base/stdpre.h">stdpre.h</a>.</dd>
-
-</dl>
-
-<h3>Scalar types</h3>
-
-<dl>
-
-<dt><code>bool, true, false</code></dt>
-
-<dd><code>bool</code> is intended as a Boolean type, with canonical
-values <code>true</code> and <code>false</code>. In a more reasonable
-language, such as Java, <code>bool</code> is an enumerated type requiring
-an explicit cast to or from <code>int</code>; however, because C's
-conditionals are defined as producing <code>int</code> values, we can't
-even define <code>bool</code> as a C <code>enum</code> without
-provoking compiler warnings.
-<p>
-Even though <code>bool</code> is a synonym for <code>int</code>, treat
-them as conceptually different types:</p>
-
-
-<ul>
-<li>Initialize or set <code>bool</code> variables to <code>true</code>
-or <code>false</code>, not 0 or 1.</li>
-<li>Use the Boolean operators <code>!</code>, <code>&amp;&amp;</code>,
-and <code>||</code> only with Booleans. Don't use the idiom
-<code>!!x</code> to create a Boolean that is true iff <code>x</code>
-!= 0: use <code>x != 0</code>.</li>
-<li>Use an explicit <code>(int)</code> cast to convert a Boolean to an
-integer.</li>
-</ul>
-</dd>
-<dt><code>byte, ushort, uint, ulong</code></dt>
-
-<dd>These types are simply shorthands for <code>unsigned char, short, int,
-long</code>.
-
-<p>
-In addition, the use of <code>byte *</code> indicates a
-Ghostscript-style string, with explicit length given separately, as
-opposed to a null terminated C-style string, which is <code>char
-*</code>.</p>
-</dd>
-<dt><code>bits8, bits16, bits32</code></dt>
-
-<dd>These are unsigned integer types of the given width. Use them wherever
-the actual width matters: do <em>not</em>, for example, use
-<code>short</code> assuming that it is 16 bits wide. New code can use
-the C99 fixed-width types from <code>stdint_.h</code>.</dd>
-
-</dl>
-
-<hr>
-
-<h2><a name="Stylistic_conventions"></a>Stylistic conventions</h2>
-
-<p>
-Ghostscript's coding rules cover not only the use of the language, but also
-many stylistic issues like the choice of names and the use of whitespace.
-The stylistic rules are meant to produce code that is easy to read. It's
-important to observe them as much as possible in order to maintain a
-consistent style, but if you find these rules getting in your way or
-producing ugly-looking results once in a while, it's OK to break it.</p>
-
-<h3><a name="Formatting"></a>Formatting</h3>
-
-<h4><a name="Indentation"></a>Indentation</h4>
-
-<p>
-We've formatted all of our code using the GNU <code>indent</code> program.</p>
-
-<blockquote><code>
-indent&nbsp;-bad&nbsp;-nbap&nbsp;-nsob&nbsp;-br&nbsp;-ce&nbsp;-cli4&nbsp;-npcs&nbsp;-ncs&nbsp;\<br>
-&nbsp;&nbsp;&nbsp;-i4&nbsp;-di0&nbsp;-psl&nbsp;-lp&nbsp;-lps&nbsp;-nut&nbsp;somefile.c
-</code></blockquote>
-
-<p>
-does a 98% accurate job of producing our preferred style. Unfortunately,
-there are bugs in all versions of GNU <code>indent</code>, requiring
-both pre- and post-processing of the code.</p>
-
-<p>
-Put indentation points every 4 spaces. Never use tab stops!</p>
-
-<p>
-Don't indent the initial <code>#</code> of preprocessor commands.
-However, for nested preprocessor commands, do use indentation between the
-<code>#</code> and the command itself. Use 2 spaces per level of
-nesting, e.g.:</p>
-
-<blockquote>
-<code>#ifndef&nbsp;xyz</code><br>
-<code>#&nbsp;&nbsp;define&nbsp;xyz&nbsp;0</code><br>
-<code>#endif</code>
-</blockquote>
-
-<p>
-For assignments (including chain assignments), put the entire statement on
-one line if it will fit; if not, break it after a <code>=</code> and
-indent all the following lines. I.e., format like this:</p>
-
-<blockquote>
-var1&nbsp;<code>=</code>&nbsp;value<code>;</code><br>
-var1&nbsp;<code>=</code>&nbsp;var2&nbsp;<code>=</code>&nbsp;value<code>;</code><br>
-var1&nbsp;<code>=</code><br>
-&nbsp;&nbsp;&nbsp;&nbsp;value<code>;</code><br>
-var1&nbsp;<code>=</code><br>
-&nbsp;&nbsp;&nbsp;&nbsp;var2&nbsp;<code>=</code>&nbsp;value<code>;</code><br>
-var1&nbsp;<code>=</code>&nbsp;var2&nbsp;<code>=</code><br>
-&nbsp;&nbsp;&nbsp;&nbsp;value<code>;</code>
-</blockquote>
-
-<p>
-But not like this:</p>
-
-<blockquote>
-var1&nbsp;<code>=</code><br>
-var2&nbsp;<code>=</code> value<code>;</code>
-</blockquote>
-
-<p>
-Indent in-line blocks thus:</p>
-
-<blockquote>
-<code>{</code><br>
-&nbsp;&nbsp;&nbsp;... declarations ...<br>
-&nbsp;&nbsp;&nbsp;{{ blank line if any declarations above }}<br>
-&nbsp;&nbsp;&nbsp;... statements ...<br>
-<code>}</code>
-</blockquote>
-
-<p>
-Similarly, indent procedures thus:</p>
-
-<blockquote>
-return_type<br>
-proc_name(... arguments ...)<br>
-<code>{</code><br>
-&nbsp;&nbsp;&nbsp;... declarations ...<br>
-&nbsp;&nbsp;&nbsp;{{ blank line if any declarations above }}<br>
-&nbsp;&nbsp;&nbsp;... statements ...<br>
-<code>}</code>
-</blockquote>
-
-<p>
-If a control construct (<code>if</code>, <code>do</code>,
-<code>while</code>, or <code>for</code>) has a one-line body, use
-this:</p>
-
-<blockquote>
-... control construct ...<br>
-&nbsp;&nbsp;&nbsp;... subordinate simple statement ...
-</blockquote>
-
-<p>This is considered particularly important so that a breakpoint can be
-set inside the conditional easily.</p>
-
-<p>
-If it has a multi-line body, use this:</p>
-
-<blockquote>
-... control construct ... <code>{</code><br>
-&nbsp;&nbsp;&nbsp;... subordinate code ...<br>
-<code>}</code>
-</blockquote>
-
-<p>
-If the subordinate code has declarations, see blocks above.</p>
-
-<p>
-For if-else statements, do this:</p>
-
-<blockquote>
-<code>if (</code> ...<code> ) {</code><br>
-&nbsp;&nbsp;&nbsp;... subordinate code ...<br>
-<code>} else if (</code> ...<code> ) {</code><br>
-&nbsp;&nbsp;&nbsp;... subordinate code ...<br>
-<code>} else {</code><br>
-&nbsp;&nbsp;&nbsp;... subordinate code ...<br>
-<code>}</code>
-</blockquote>
-
-<p>
-When there are more than two alternatives, as in the example above, use the
-above ("parallel") syntax rather than the following ("nested") syntax:</p>
-
-<blockquote>
-<code>if (</code> ...<code> ) {</code><br>
-&nbsp;&nbsp;&nbsp;... subordinate code ...<br>
-<code>} else {</code><br>
-<code>&nbsp;&nbsp;&nbsp;if (</code> ...<code> ) {</code><br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;... subordinate code ...<br>
-<code>&nbsp;&nbsp;&nbsp;} else {</code><br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;... subordinate code ...<br>
-<code>&nbsp;&nbsp;&nbsp;}</code><br>
-<code>}</code>
-</blockquote>
-
-<p>
-Similarly, for do-while statements, do this:</p>
-
-<blockquote>
-<code>do {</code><br>
-&nbsp;&nbsp;&nbsp;... body ...<br>
-<code>} while (</code> ... condition ... <code>);</code>
-</blockquote>
-
-<h4><a name="Spaces"></a>Spaces</h4>
-
-<p>
-Do put a space:</p>
-<ul>
-<li>after every comma and semicolon, unless it ends a line;</li>
-<li>around every binary operator other than "<code>-&gt;</code>" and
-"<code>.</code>", although you can omit the spaces around the innermost
-operator in a nested expression if you like;</li>
-<li>on both sides of the parentheses of an <code>if</code>, <code>for</code>, or <code>while</code>.</li>
-</ul>
-
-<p>
-Don't put a space:</p>
-<ul>
-<li>at the end of a line;</li>
-<li>before a comma or semicolon;</li>
-<li>after unary prefix operators;</li>
-<li>before the parenthesis of a macro or procedure call.</li>
-</ul>
-
-<h4><a name="Parentheses"></a>Parentheses</h4>
-
-<p>
-Parentheses are important in only a few places:</p>
-
-<ul>
-<li>Around the inner subexpressions in expressions that mix
-<code>&amp;&amp;</code> and <code>||</code>, even if they are not
-required by precedence, for example:
-
-<blockquote><code>
-(xx &amp;&amp; yy) || zz
-</code></blockquote>
-</li>
-<li>Similarly around inner subexpressions in expressions that mix
-<code>&amp;</code>, <code>|</code>, or shifts, especially if mixing
-these with other operators, for instance:
-
-<blockquote><code>
-(x &lt;&lt; 3) | (y &gt;&gt; 5)
-</code></blockquote>
-</li>
-<li>In macro definitions around every use of an argument that logically
-could be an expression, for example:
-
-<blockquote><code>
-((x) * (x) + (y) * (y))
-</code></blockquote>
-</li>
-</ul>
-
-<p>
-Anywhere else, given the choice, use fewer parentheses.</p>
-
-<p>
-For stylistic consistency with the existing Ghostscript code, put
-parentheses around conditional expressions even if they aren't
-syntactically required, unless you really dislike doing this. Note that
-the parentheses should go around the entire expression, not the condition.
-For instance, instead of:</p>
-
-<blockquote><code>
-hpgl_add_point_to_path(pgls, arccoord_x, arccoord_y,<br>
-&nbsp;&nbsp;&nbsp;(pgls-&gt;g.pen_down) ? gs_lineto : gs_moveto);
-</code></blockquote>
-
-<p>
-use:</p>
-
-<blockquote><code>
-hpgl_add_point_to_path(pgls, arccoord_x, arccoord_y,<br>
-&nbsp;&nbsp;&nbsp;(pgls-&gt;g.pen_down ? gs_lineto : gs_moveto));
-</code></blockquote>
-
-<h3><a name="Preprocessor_style"></a>Preprocessor</h3>
-
-<h4>Conditionals</h4>
-
-<p>
-Using preprocessor conditionals can easily lead to unreadable code, since
-the eye really wants to read linearly rather than having to parse the
-conditionals just to figure out what code is relevant. It's OK to use
-conditionals that have small scope and that don't change the structure or
-logic of the program (typically, they select between different sets of
-values depending on some configuration parameter), but where possible, break
-up source modules rather than use conditionals that affect the structure or
-logic.</p>
-
-<h4>Macros</h4>
-
-<p>
-Ghostscript code uses macros heavily to effectively extend the rather
-weak abstraction capabilities of the C language, specifically in the area of
-memory management and garbage collection: in order to read Ghostscript code
-effectively, you simply have to learn some of these macros as though they
-were part of the language. The current code also uses macros heavily for
-other purposes, but we are trying to phase these out as rapidly as possible,
-because they make the code harder to read and debug, and to use the
-rules that follow consistently in new code.</p>
-
-<p>
-Define macros in the smallest scope you can manage (procedure, file, or
-<code>.h</code> file), and <code>#undef</code> them at the end of
-that scope: that way, someone reading the code can see the definitions
-easily when reading the uses. If that isn't appropriate, define them in as
-large a scope as possible, so that they effectively become part of the
-language. This places an additional burden on the reader, but it can be
-amortized over reading larger amounts of code.</p>
-
-<p>
-Try hard to use procedures instead of macros. Use "<code>inline</code>"
-if you really think the extra speed is needed, but only within a
-<code>.c</code> file: don't put inline procedures in <code>.h</code>
-files, because most compilers don't honor "<code>inline</code>" and
-you'll wind up with a copy of the procedure in every <code>.c</code>
-file that includes the <code>.h</code> file.</p>
-
-<p>
-If you define a macro that looks like a procedure, make sure it will work
-wherever a procedure will work. In particular, put parentheses around every
-use of an argument within the macro body, so that the macro will parse
-correctly if some of the arguments are expressions, and put parentheses
-around the entire macro body. (This is still subject to the problem that an
-argument may be evaluated more than once, but there is no way around this in
-C, since C doesn't provide for local variables within expressions.)</p>
-
-<p>
-If you define macros for special loop control structures, make their uses
-look somewhat like ordinary loops, for instance:</p>
-
-<blockquote>
-<code>BEGIN_RECT(xx, yy) {</code><br>
-&nbsp;&nbsp;... body indented one position ...<br>
-<code>} END_RECT(xx, yy);</code>
-</blockquote>
-
-<p>
-If at all possible, don't use free variables in macros -- that is, variables
-that aren't apparent as arguments of the macro. If you must use free
-variables, list them all in a comment at the point where the macro is
-defined.</p>
-
-<p>
-If you define new macros or groups of macros, especially if they aren't
-simply inline procedures or named constant values, put some extra effort
-into documenting them, to compensate for the fact that macros are
-intrinsically harder to understand than procedures.</p>
-
-<h3><a name="Comments"></a>Comments</h3>
-
-<p>
-The most important descriptive comments are ones in header files that
-describe structures, including invariants; but every procedure or structure
-declaration, or group of other declarations, should have a comment. Don't
-spend a lot of time commenting executable code unless something unusual or
-subtle is going on.</p>
-
-<h3><a name="Naming"></a>Naming</h3>
-
-<p>
-Use fully spelled-out English words in names, rather than contractions.
-This is most important for procedure and macro names, global variables and
-constants, values of <code>#define</code> and <code>enum</code>,
-<code>struct</code> and other <code>typedef</code> names, and
-structure member names, and for argument and variable names which have
-uninformative types like <code>int</code>. It's not very important for
-arguments or local variables of distinctive types, or for local index or
-count variables.</p>
-
-<p>
-Avoid names that run English words together:
-"<code>hpgl_compute_arc_center</code>" is better than
-"<code>hpgl_compute_arccenter</code>". However, for terms drawn from
-some predefined source, like the names of PostScript operators, use a term
-in its well-known form (for instance, <code>gs_setlinewidth</code>
-rather than <code>gs_set_line_width</code>).</p>
-
-<p>
-Procedures, variables, and structures visible outside a single
-<code>.c</code> file should generally have prefixes that indicate what
-subsystem they belong to (in the case of Ghostscript, <code>gs_</code>
-or <code>gx_</code>). This rule isn't followed very consistently.</p>
-
-<h3><a name="Types"></a>Types</h3>
-
-<p>
-Many older structure names don't have <code>_t</code> on the end, but
-this suffix should be used in all new code. (The <code>_s</code>
-structure name is needed only to satisfy some debuggers. No code other than
-the structure declaration should refer to it.)</p>
-
-<p>
-Declare structure types that contain pointers to other instances of
-themselves like this:</p>
-
-<blockquote>
-<code>typedef struct xxx_s xxx_t;</code><br>
-<code>struct xxx_s {</code><br>
-&nbsp;&nbsp;&nbsp;... members ...<br>
-&nbsp;&nbsp;&nbsp;<code>xxx_t *</code>ptr_member_name;<br>
-&nbsp;&nbsp;&nbsp;... members ...<br>
-<code>};</code>
-</blockquote>
-
-<p>
-If, to maintain data abstraction and avoid including otherwise unnecessary
-header files, you find that you want the type <code>xxx_t</code> to be
-available in a header file that doesn't include the definition of the
-structure <code>xxx_s</code>, use this approach:</p>
-
-<blockquote>
-<code>#ifndef xxx_DEFINED</code><br>
-<code>#&nbsp;&nbsp;define xxx_DEFINED</code><br>
-<code>typedef struct xxx_s xxx_t;</code><br>
-<code>#endif</code><br>
-<code>struct xxx_s {</code><br>
-&nbsp;&nbsp;&nbsp;... members ...<br>
-<code>};</code>
-</blockquote>
-
-<p>
-You can then copy the first 4 lines in other header files. (Don't ever
-include them in an executable code file.)</p>
-
-<p>
-Don't bother using <code>const</code> for anything other than with
-pointers as described below. However, in those places where it is necessary
-to cast a pointer of type <code>const&nbsp;T&nbsp;*</code> to type
-<code>T&nbsp;*</code>, always include a comment that explains why you are
-"breaking const".</p>
-
-<h4>Pointers</h4>
-
-<p>
-Use <code>const</code> for pointer referents (that is,
-<code>const&nbsp;T&nbsp;*</code>) wherever possible and appropriate.</p>
-
-<p>
-If you find yourself wanting to use <code>void&nbsp;*</code>, try to
-find an alternative using unions or (in the case of super- and subclasses)
-casts, unless you're writing something like a memory manager that really
-treats memory as opaque.</p>
-
-<h3><a name="Procedures_style"></a>Procedures</h3>
-
-<p> In general, don't create procedures that are private and only called
-from one place. However, if a compound statement (especially an arm of
-a conditional) is too long for the eye easily to match its enclosing
-braces "<code>{...}</code>" -- that is, longer than 10 or 15 lines --
-and it doesn't use or set a lot of state held in outer local variables,
-it may be more readable if you put it in a procedure.</p>
-
-<h3>Miscellany</h3>
-
-<h4><a name="Local_variables"></a>Local variables</h4>
-
-<p>
-Don't assign new values to procedure parameters. It makes debugging very
-confusing when the parameter values printed for a procedure are not the
-ones actually supplied by the caller. Instead use a separate local
-variable initialized to the value of the parameter.</p>
-
-<p>
-If a local variable is only assigned a value once, assign it that value at
-its declaration, if possible. For example,</p>
-
-<blockquote>
-<code>int x = </code>some expression <code>;</code>
-</blockquote>
-
-<p>
-rather than</p>
-
-<blockquote>
-<code>int x;</code><br>
-...<br>
-<code>x = </code> some expression <code>;</code>
-</blockquote>
-
-<p>
-Use a local pointer variable like this to "narrow" pointer types:</p>
-
-<blockquote>
-<code>int</code><br>
-someproc(... <code>gx_device *dev</code> ...)<br>
-<code>{<br>
-&nbsp;&nbsp;&nbsp;gx_device_printer *const pdev = (gx_device_printer *)dev;</code><br>
-&nbsp;&nbsp;&nbsp;...<br>
-<code>}</code>
-</blockquote>
-
-<p>
-Don't "shadow" a local variable or procedure parameter with an inner local
-variable of the same name. I.e., don't do this:</p>
-
-<blockquote>
-<code>int</code><br>
-someproc(... <code>int x</code> ...)<br>
-<code>{</code><br>
-&nbsp;&nbsp;&nbsp;...<br>
-<code>&nbsp;&nbsp;&nbsp;int x;</code><br>
-&nbsp;&nbsp;&nbsp;...<br>
-<code>}</code>
-</blockquote>
-
-<h4><a name="Compiler_warnings"></a>Compiler warnings</h4>
-
-<p>
-We want Ghostscript to compile with no warnings. This is a constant
-battle as compilers change and new code is added. Work hard to eliminate
-warnings by improving the code structure instead of patching over them.
-If the compiler can't figure out that a variable is always initialized,
-a future reader will probably have trouble as well.</p>
-
-<hr>
-
-<h2><a name="File_structuring"></a>File structuring</h2>
-
-<h3><a name="All_files"></a>All files</h3>
-
-<p>
-Keep file names within the "8.3" format for portability:</p>
-<ul>
-<li>Use only letters, digits, dash, and underscore in file names.</li>
-<li>Don't assume upper and lower case letters are distinct.</li>
-<li>Put no more than 8 characters before the ".", if any.</li>
-<li>If there is a ".", put between 1 and 3 characters after the ".".</li>
-</ul>
-
-<p>
-For files other than documentation files, use only lower case letters
-in the names; for HTML documentation files, capitalize the first letter.</p>
-
-<p>
-Every code file should start with comments containing</p>
-
-<ol>
-<li>a copyright notice,</li>
-<li>the name of the file in the form of an RCS Id:
-
-<blockquote><code>
-/* &#36;Id: filename.ext &#36;*/
-</code></blockquote>
-
-<p>
-(using the comment convention appropriate to the language of the file), and</p>
-</li>
-<li>a summary, no more than one line, of what the file contains.</li>
-</ol>
-
-<p>
-If you create a file by copying the beginning of another file, be sure to
-update the copyright year and change the file name.</p>
-
-<h3><a name="Makefiles"></a>Makefiles</h3>
-
-<p>
-Use the extension <code>.mak</code> for makefiles.</p>
-
-<p>
-For each</p>
-
-<blockquote><code>
-#include "xxx.h"
-</code></blockquote>
-
-<p>
-make sure there is a dependency on <code>&#36;(xxx_h)</code> in the
-makefile. If xxx ends with a "<code>_</code>", this rule still holds,
-so that if you code</p>
-
-<blockquote><code>
-#include "math_.h"
-</code></blockquote>
-
-<p>
-the makefile must contain a dependency on "<code>&#36;(math__h)</code>"
-(note the two underscores "<code>__</code>").</p>
-
-<p>
-List the dependencies bottom-to-top, like the <code>#include</code>
-statements themselves; within each level, list them alphabetically. Do
-this also with <code>#include</code> statements themselves whenever
-possible (but sometimes there are inter-header dependencies that require
-bending this rule).</p>
-
-<p>
-For compatibility with the build utilities on OpenVMS, always put a space
-before the colon that separates the target(s) of a rule from the dependents.</p>
-
-<h3><a name="General_C_code"></a>General C code</h3>
-
-<p>
-List <code>#include</code> statements from "bottom" to "top", that is,
-in the following order:</p>
-
-<blockquote><ol>
-<li>System includes (<code>"xxx_.h"</code>)</li>
-<li><code>gs*.h</code></li>
-<li><code>gx*.h</code> (yes, <code>gs</code> and <code>gx</code>
-are in the wrong order.)</li>
-<li><code>s*.h</code></li>
-<li><code>i*.h</code> (or other interpreter headers that don't start
-with "<code>i</code>")</li>
-</ol></blockquote>
-
-<h3><a name="Headers"></a>Headers (<code>.h</code> files)</h3>
-
-<p>
-In header files, always use the following at the beginning of a header file
-to prevent double inclusion:</p>
-
-<blockquote>
-{{ Copyright notice etc. }}<br><br>
-
-<code>#ifndef </code>&lt;filename&gt;<code>_INCLUDED</code><br>
-<code>#define </code>&lt;filename&gt;<code>_INCLUDED</code><br><br>
-
-{{ The contents of the file }}<br><br>
-
-<code>#endif /* </code>&lt;filename&gt;<code>_INCLUDED */</code>
-</blockquote>
-
-<p>
-The header file is the first place that a reader goes for
-information about procedures, structures, constants, etc., so ensure that
-every procedure and structure has a comment that says what it does. Divide
-procedures into meaningful groups set off by some distinguished form of
-comment.</p>
-
-<h3><a name="Source"></a>Source (<code>.c</code> files)</h3>
-
-<p>
-After the initial comments, arrange C files in the following order:</p>
-
-<blockquote><ol>
-<li><code>#include</code> statements</li>
-<li>Exported data declarations</li>
-<li>Explicit externs (if necessary)</li>
-<li>Forward declarations of procedures</li>
-<li>Private data declarations</li>
-<li>Exported procedures</li>
-<li>Private procedures</li>
-</ol></blockquote>
-
-<p>
-Be flexible about the order of the declarations if necessary to improve
-readability. Many older files don't follow this order, often without good
-reason.</p>
-
-<hr>
-
-<h2><a name="Conventions"></a>Ghostscript conventions</h2>
-
-<h3><a name="Specific_names"></a>Specific names</h3>
-
-<p>
-The Ghostscript code uses certain names consistently for certain kinds of
-values. Some of the commonest and least obvious are these two:</p>
-
-<h4><a name="code"></a><code>code</code></h4>
-
-<blockquote>
-<p>A value to be returned from a procedure:</p>
-
-<table>
-<tr>
- <td align="right">&lt; 0</td>
- <td colspan="2">An error code defined in <a href="../base/gserrors.h">gserrors.h</a> (or <a href="../psi/ierrors.h">ierrors.h</a>)</td>
-</tr>
-<tr>
- <td align="right">0</td>
- <td colspan="2">Normal return</td>
-</tr>
-<tr>
- <td align="right">&gt; 0</td>
- <td colspan="2">A non-standard but successful return (which must be documented, preferably with the procedure's prototype)</td>
-</tr>
-</table>
-
-</blockquote>
-
-<h4><a name="status"></a><code>status</code></h4>
-
-<blockquote>
-<p>A value returned from a stream procedure:</p>
-
-<table>
-<tr>
- <td align="right">&lt; 0</td>
- <td colspan="2">An exceptional condition as defined in <a href="../base/scommon.h">scommon.h</a></td>
-</tr>
-<tr>
- <td align="right">0</td>
- <td colspan="2">Normal return (or, from the "<code>process</code>" procedure, means that more input is needed)</td>
-</tr>
-<tr>
- <td align="right">1</td>
- <td colspan="2">More output space is needed (from the "<code>process</code>" procedure)</td>
-</tr>
-</table>
-</blockquote>
-
-<h3><a name="Structure_type_descriptors"></a>Structure type descriptors</h3>
-
-<p>
-The Ghostscript memory manager requires run-time type information for every
-structure. (We don't document this in detail here: see the <a
-href="Develop.htm#Structure_descriptors">Structure descriptors</a> section
-of the developer documentation for details.) Putting the descriptor for a
-structure next to the structure definition will help keep the two
-consistent, so immediately after the definition of a structure
-<code>xxx_s</code>, define its structure descriptor:</p>
-
-<blockquote>
-<code>struct xxx_s {</code><br>
-&nbsp;&nbsp;&nbsp;... members ...<br>
-<code>};</code><br>
-<code>#define private_st_xxx()&nbsp;&nbsp;/* in </code>&lt;filename&gt;<code>.c */\</code><br>
-<code>&nbsp;&nbsp;gs_private_st_</code>&lt;whatever&gt;<code>(st_xxx, xxx_t,\</code><br>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;"xxx_t", xxx_enum_ptrs, xxx_reloc_ptrs,\</code><br>
-<code>&nbsp;&nbsp;&nbsp;&nbsp;</code>... additional parameters as needed ...<code>)</code>
-</blockquote>
-
-<p>
-The file that implements operations on this structure
-(&lt;filename&gt;<code>.c</code>) should then include, near the
-beginning, the line:</p>
-
-<blockquote>
-<code>private_st_xxx();</code>
-</blockquote>
-
-<p>
-In much existing code, structure descriptors are declared as
-<code>public</code>, which allows clients to allocate instances of the
-structure directly. We now consider this bad design. Instead, structure
-descriptors should always be <code>static</code>; the implementation
-file should provide one or more procedures for allocating instances, e.g.,</p>
-
-<blockquote>
-<code>xxx_t *gs_xxx_alloc(P1(gs_memory_t *mem));</code>
-</blockquote>
-
-<p>
-If it is necessary to make a structure descriptor public, it should be
-declared in its clients as</p>
-
-<blockquote>
-<code>extern_st(st_xxx);</code>
-</blockquote>
-
-<h3><a name="Objects"></a>"Objects"</h3>
-
-<p>
-Ghostscript makes heavy use of object-oriented constructs, including
-analogues of classes, instances, subclassing, and class-associated
-procedures. However, these constructs are implemented in C rather than C++,
-for two reasons:</p>
-
-<ul>
-
-<li>The first Ghostscript code was written in 1986, long before C++ was
-codified or was well supported by tools. Even today, C++ tools rarely
-support C++ as well as C tools support C.</li>
-
-<li>C++ imposes its own implementations for virtual procedures, inheritance,
-run-time type information, and (to some extent) memory management.
-Ghostscript requires use of its own memory manager, and also sometimes
-requires the ability to change the virtual procedures of an object
-dynamically.</li>
-
-</ul>
-
-<h4>Classes</h4>
-
-<p>
-The source code representation of a class is simply a
-<code>typedef</code> for a C <code>struct</code>. See <a
-href="C-style.htm#Structures">Structures</a>, above, for details.</p>
-
-<h4>Procedures</h4>
-
-<p>
-Ghostscript has no special construct for non-virtual procedures associated
-with a class. In some cases, the <code>typedef</code> for the class is
-in a header file but the <code>struct</code> declaration is in the
-implementation code file: this provides an extra level of opaqueness, since
-clients then can't see the representation and must make all accesses through
-procedures. You should use this approach in new code, if it doesn't
-increase the size of the code too much or require procedure calls for very
-heavily used accesses.</p>
-
-<p>
-Ghostscript uses three different approaches for storing and accessing
-virtual procedures, plus a fourth one that is recommended but not currently
-used. For exposition, we assume the class (type) is named
-<code>xxx_t</code>, it has a virtual procedure
-<code>void&nbsp;(*virtu)(P1(xxx_t&nbsp;*))</code>, and we have a variable
-declared as <code>xxx_t&nbsp;*pxx</code>.</p>
-
-<ol>
-
-<li>The procedures are stored in a separate, constant structure of type
-<code>xxx_procs</code>, of which <code>virtu</code> is a member. The
-structure definition of <code>xxx_t</code> includes a member defined as
-<code>const&nbsp;xxx_procs&nbsp;*procs</code> (always named
-<code>procs</code>). The construct for calling the virtual procedure is
-<code>pxx-&gt;procs-&gt;virtu(pxx)</code>.</li>
-
-<li>The procedures are defined in a structure of type
-<code>xxx_procs</code> as above. The structure definition of
-<code>xxx_t</code> includes a member defined as
-<code>xxx_procs&nbsp;procs</code> (always named <code>procs</code>).
-The construct for calling the virtual procedure is
-<code>pxx-&gt;procs.virtu(pxx)</code>.</li>
-
-<li>The procedures are not defined in a separate structure: each procedure
-is a separate member of <code>xxx_t</code>. The construct for calling
-the virtual procedure is <code>pxx-&gt;virtu(pxx)</code>.</li>
-
-<li>The procedures are defined in a structure of type
-<code>xxx_procs</code> as above. The structure definition of
-<code>xxx_t</code> includes a member defined as
-<code>xxx_procs&nbsp;procs[1]</code> (always named
-<code>procs</code>). The construct for calling the virtual procedure is
-again <code>pxx-&gt;procs-&gt;virtu(pxx)</code>.</li>
-
-</ol>
-
-<p>
-Note that in approach 1, the procedures are in a shared constant structure;
-in approaches 2 - 4, they are in a per-instance structure that can be
-changed dynamically, which is sometimes important.</p>
-
-<p>
-In the present Ghostscript code, approach 1 is most common, followed by 2
-and 3; 4 is not used at all. For new code, you should use 1 or 4: that way,
-all virtual procedure calls have the same form, regardless of whether the
-procedures are shared and constant or per-instance and mutable.</p>
-
-<h4>Subclassing</h4>
-
-<p>
-Ghostscript's class mechanism allows for subclasses that can add data
-members, or can add procedure members if approach 1 or 3 (above) is used.
-Since C doesn't support subclassing, we use a convention to accomplish it.
-In the example below, <code>gx_device</code> is the root class; it has a
-subclass <code>gx_device_forward</code>, which in turn has a subclass
-<code>gx_device_null</code>. First we define a macro for all the members
-of the root class, and the root class type. (As for structures in general,
-classes need a structure descriptor, as discussed in <a
-href="#Structures">Structures</a> above: we include these in the examples
-below.)</p>
-
-<blockquote><code>
-#define gx_device_common\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;type1 member1;\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;</code>...<code><br>
-&nbsp;&nbsp;&nbsp;&nbsp;typeN memberN<br>
-<br>
-typedef struct gx_device_s {<br>
-&nbsp;&nbsp;&nbsp;&nbsp;gx_device_common;<br>
-} gx_device;<br>
-<br>
-#define private_st_gx_device()&nbsp;&nbsp;/* in gsdevice.c */\<br>
-&nbsp;&nbsp;gs_private_st_</code>&lt;whatever&gt;<code>(st_gx_device, gx_device,\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;"gx_device", device_enum_ptrs, device_reloc_ptrs,\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;</code>... additional parameters as needed ...<code>)
-</code></blockquote>
-
-<p>
-We then define a similar macro and type for the subclass.</p>
-
-<blockquote><code>
-#define gx_device_forward_common\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;gx_device_common;\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;gx_device *target<br>
-<br>
-typedef struct gx_device_forward_s {<br>
-&nbsp;&nbsp;&nbsp;&nbsp;gx_device_forward_common;<br>
-} gx_device_forward;<br>
-<br>
-#define private_st_device_forward()&nbsp;&nbsp;/* in gsdevice.c */\<br>
-&nbsp;&nbsp;gs_private_st_suffix_add1(st_device_forward, gx_device_forward,\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;"gx_device_forward", device_forward_enum_ptrs, device_forward_reloc_ptrs,\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;gx_device, target)
-</code></blockquote>
-
-<p>
-Finally, we define a leaf class, which doesn't need a macro because we don't
-currently subclass it. (We can create the macro later if needed, with no
-changes anywhere else.) In this particular case, the leaf class has no
-additional data members, but it could have some.</p>
-
-<blockquote><code>
-typedef struct gx_device_null_s {<br>
-&nbsp;&nbsp;&nbsp;&nbsp;gx_device_forward_common;<br>
-};<br>
-<br>
-#define private_st_device_null()&nbsp;&nbsp;/* in gsdevice.c */\<br>
-&nbsp;&nbsp;gs_private_st_suffix_add0_local(st_device_null, gx_device_null,\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;"gx_device_null", device_null_enum_ptrs, device_null_reloc_ptrs,\<br>
-&nbsp;&nbsp;&nbsp;&nbsp;gx_device_forward)
-</code></blockquote>
-
-<p>
-Note that the above example is <strong>not</strong> the actual definition of
-the <code>gx_device</code> structure type: the actual type has some
-additional complications because it has a finalization procedure. See <a
-href="../base/gxdevcli.h">base/gxdevcli.h</a> for the details.</p>
-
-<p>
-If you add members to a root class (such as <code>gx_device</code> in
-this example), or change existing members, do this in the
-<code>gx_device_common</code> macro, not the <code>gx_device</code>
-structure definition. Similarly, to change the
-<code>gx_device_forward</code> class, modify the
-<code>gx_device_forward_common</code> macro, not the structure
-definition. Only change the structure definition if the class is a leaf
-class (one with no <code>_common</code> macro and no possibility of
-subclassing), like <code>gx_device_null</code>.</p>
-
-<h3><a name="Error_handling"></a>Error handling</h3>
-
-<p>
-Every caller should check for error returns and, in general, propagate them
-to <b>its</b> callers. By convention, nearly every procedure returns an
-<code>int</code> to indicate the outcome of the call:</p>
-
-<blockquote>
-<table>
-<tr>
- <td align="right">&lt; 0</td>
- <td colspan="2">Error return</td>
-</tr>
-<tr>
- <td align="right">0</td>
- <td colspan="2">Normal return</td>
-</tr>
-<tr>
- <td align="right">&gt; 0</td>
- <td colspan="2">Non-error return other than the normal case</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-To make a procedure generate an error and return it, as opposed to
-propagating an error generated by a lower procedure, you should use</p>
-
-<blockquote>
-<code>return_error(</code><em>error_number</em><code>);</code>
-</blockquote>
-
-<p>
-Sometimes it is more convenient to generate the error in one place and
-return it in another. In this case, you should use</p>
-<blockquote>
-<code>code = gs_note_error(</code><em>error_number</em><code>);</code><br>
-...<br>
-<code>return code;</code>
-</blockquote>
-
-<p>
-In executables built for debugging, the <code>-E</code> (or
-<code>-Z#</code>) command line switch causes <code>return_error</code>
-and <code>gs_note_error</code> to print the error number and the source
-file and line: this is often helpful for identifying the original cause of
-an error.</p>
-
-<p>
-See the file <a href="../base/gserrors.h">base/gserrors.h</a> for the error
-return codes used by the graphics library, most of which correspond directly
-to PostScript error conditions.</p>
-
-<!-- [2.0 end contents] ==================================================== -->
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small></p>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.</p>
-
-<p>This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.</p>
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Commprod.htm b/doc/Commprod.htm
deleted file mode 100644
index 594e4f8d..00000000
--- a/doc/Commprod.htm
+++ /dev/null
@@ -1,318 +0,0 @@
-<!doctype html>
-<html>
-<head>
-<meta charset="UTF-8">
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
-<link rel="shortcut icon" type="image/png" href="../../images/favicon.png">
-<title>Conditions on Distributing Ghostscript in a Commercial Context</title>
- <!-- Originally: commprod.txt -->
-<link href="style.css" rel="stylesheet" type="text/css">
-<link href="gs-style.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
-
- <div class="header">
- <div class="row">
- <div class="col-lt-6 logo"><a href="https://www.ghostscript.com/"><img src="images/ghostscript_logo.png" width="108" height="119" alt=""></a></div>
- <div class="col-6"><div class="row"><div class="artifexlogo"><a href="https://artifex.com" target="_blank"><img src="images/Artifex_logo.png" width="194" height="40" alt=""></a></div>
- <div class="col-12"><div class="button button1"><a href="https://artifex.com/contact-us/" title="Contact Us" target="_blank">Contact Us</a></div>
- <div class="button button2 hidden-xs"><a href="https://www.ghostscript.com/download.html" title="Download">Download</a></div></div></div>
- </div>
- </div>
- </div>
-
- <div class="banner">
- <div class="row">
- <div class="col-12">Conditions on Distributing Ghostscript in a Commercial Context</div>
- </div>
- </div>
-
- <div class="main">
- <div class="row">
- <div id="sidebar">
- <div class="sidebar-item"></div>
- <div class="col-2 leftnav">
-<ul>
- <li><a href="https://www.ghostscript.com/">Home</a></li>
- <li><a href="https://www.ghostscript.com/license.html">Licensing</a></li>
- <li><a href="https://www.ghostscript.com/releases.html">Releases</a></li>
- <li><a href="https://www.ghostscript.com/documentation.html" title="Documentation">Documentation</a></li>
- <li><a href="https://www.ghostscript.com/download.html" title="Download">Download</a></li>
- <li><a href="https://www.ghostscript.com/performance.html" title="Performance">Performance</a></li>
- <li><a href="http://jbig2dec.com/" title="jbig2dec">jbig2dec</a></li>
- <li><a href="http://git.ghostscript.com/?p=ghostpdl.git;a=summary">Source</a></li>
- <li><a href="http://bugs.ghostscript.com/">Bugs</a></li>
- <li><a href="https://www.ghostscript.com/faq.html" title="FAQ">FAQ</a></li>
- </ul>
- </div>
- </div>
- <div class="col-10 page">
-
-<!--START EDITING HERE-->
-
-<h2>Table of contents</h2>
-
-<ul>
-<li><a href="#GPL">The GNU Affero General Public License (AGPL)</a></li>
-<li><a href="#examples">Distribution examples</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>
-This document sets forth the conditions under which Ghostscript may be
-distributed in a commercial context: under a written license from <a
-href="http://artifex.com/">Artifex Software</a> Inc., the copyright
-holder's exclusive commercial licensing partner, or under certain other
-very limited conditions.</p>
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<hr>
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<p>
-The use of the public-access "free" versions of Ghostscript</p>
-
-<h2><a name="GPL"></a>The GNU Affero General Public License (AGPL)</h2>
-
-<p>
-Ghostscript is a copyrighted work whose copyright is owned by
-Artifex Software, Inc.
-Some versions of Ghostscript are distributed freely under the name
-GPL Ghostscript or (for older versions) GNU Ghostscript; these versions
-are distributed with a license called the GNU
-<a href="http://www.gnu.org/licenses/agpl-3.0.html">Affero General Public License</a>
-(also known as the "AGPL", or "copyleft"), which allows gratis and commercial distribution under certain conditions, most
-particularly, source complete source disclosure.
-</p>
-
-<p>
-Versions of Ghostscript between version 4.03 and 8.54 were also
-distributed under a more restrictive license disallowing commercial
-redistribution entirely. These versions were labelled "AFPL Ghostsript" or
-just "Ghostscript", and were governed by the Aladdin Free Public License.
-</p>
-
-<p>
-The full AGPL is included under the name
-<code>COPYING</code> in the GPL Ghostscript fileset, and
-can also be obtained directly from the Free Software Foundation:</p>
-
-<blockquote><address><a name="FSF_address"></a>
-Free Software Foundation, Inc. (FSF)<br>
-59 Temple Place, Suite 330<br>
-Boston, MA 02111-1307 U.S.A.<br>
-+1-617-542-5942 telephone<br>
-+1-617-542-2652 fax (including Japan):<br>
-<a href="mailto:gnu@gnu.org">gnu@gnu.org</a><br>
-<a href="http://www.gnu.org/">http://www.gnu.org/</a>
-</address></blockquote>
-
-<p>
-The AGPL gotten directly from the FSF or the contents of the
-<code>COPYING</code> file are authoritative, but for those
-unfamiliar with the AGPL, we now summarize its provisions.</p>
-
-<p>1. Anyone may copy and distribute GPL Ghostscript (both source
-and object code), but they must distribute the source code as well as
-the object code (or, if they distribute only the object code, they must
-include an offer in writing to provide the source code at no more than
-reproduction cost), keep all copyright and other notices, and include the
-AGPL with the copies. (Note that this allows anyone receiving such a copy
-to distribute it freely as well.)</p>
-
-<p>2. Anyone may modify GPL Ghostscript, but the provisions of (1)
-apply to modified or derived works as well.</p>
-
-<p>
-Provision (2) effectively prevents the development of proprietary commercial
-products that incorporate GPL Ghostscript without a commercial license
-as a part, since these are "derived works" in the legal sense.</p>
-
-<p><strong> IF YOUR ENTIRE APPLICATION IS LICENSED TO THE PUBLIC
-UNDER EITHER
-THE AFPL OR THE GNU AGPL, YOU CAN DISTRIBUTE AFPL GHOSTSCRIPT OR GNU
-GHOSTSCRIPT, RESPECTIVELY, WITH YOUR APPLICATION WITHOUT A COMMERCIAL
-LICENSE . . .</strong></p>
-
-<p> If your application, including all of its source code, is
-licensed
-to the public under the GNU AGPL, you are authorized to ship
-GPL Ghostscript with your application
-under the terms of those license agreements. You do not need a
-commercial license from Artifex. The terms of the GNU AGPL
-include the requirement that your application be licensed as a whole at
-no charge to all third parties. Moreover, the entire application must be
-licensed to the public under the GNU AGPL or AFPL respectively.</p>
-
-<p> IF YOUR APPLICATION IS NOT LICENSED TO THE PUBLIC UNDER
-THE GNU AGPL AND YOU PLAN TO DISTRIBUTE GHOSTSCRIPT SOFTWARE. . .</p>
-
-<p> If your application (including its source code) is not licensed
-to the public under the GNU AGPL, you are not authorized to ship
-GPL Ghostscript with your application under the terms of the GNU AGPL
-if any one of the following is true:</p>
-
-<ul>
-<li> your application contains a copy of some or all of GPL
-Ghostscript;</li>
-<li> your application is derived from, is based on, or constitutes a
-revision of some or all of AGPL or Ghostscript;</li>
-<li> your application includes one or more functions that use some or
-all of AGPL or Ghostscript.</li>
-</ul>
-
-<p>
- These criteria apply to your application as a whole. Even if only
-one section of your application satisfies one of these criteria, you are
-not authorized to ship GPL Ghostscript with your application
-unless your application, including all of its source code, is licensed
-to the public under the GNU AGPL.</p>
-
-<p>
- If your application (including its source code) is NOT licensed to
-the public under the GNU AGPL and you intend to distribute
-Ghostscript (either internally or externally) for use with and usable by
-your application, you MUST first obtain a commercial license from
-Artifex.</p>
-<hr>
-<h2><a name="examples"></a>Examples of Distribution</h2>
-
-<p>
- Some examples of distribution requiring a commercial license
-include:</p>
-<p>
- 1. Distributing Ghostscript (or any component thereof) within your
-non-GNU AGPL application.</p>
-<p>
- 2. Distributing Ghostscript on the same media with your
-non-GNU AGPL application for use with and by your application.</p>
-<p>
- 3. Distributing Ghostscript embedded within hardware.</p>
-
-
-
-<p>
-Questions have arisen at times in particular cases regarding provision (3)
-as to whether GPL Ghostscript is "aggregated" with other parts of a
-commercial product, or whether the product has become a "derived work."
-Normally, combining GPL Ghostscript with another piece of software
-creates
-a "derived work"; we consider GPL Ghostscript to be "aggregated" with
-another piece of software, which we will refer to as "the application",
-only if all of the following conditions are met:</p>
-
-<ul>
-<li> The code and documentation for GPL Ghostscript are physically
-separated from the code and documentation for the application. For
-electronic form, it is both necessary and sufficient to put the GNU
-Ghostscript code and documentation in their own directory tree(s).</li>
-
-<li> GPL Ghostscript, as delivered with the application, is usable
-independently of the application. More precisely, if a user deletes from
-the computer system all files delivered with the application except those
-in the GPL Ghostscript directories, the user will still be able to use
-GPL Ghostscript as described in GPL Ghostscript's documentation. Among
-other things, this requires that GPL Ghostscript not call any routines
-in the application, and not require any data or other files supplied as
-part of the application.</li>
-
-<li> The application calls GPL Ghostscript in a way that allows an
-ordinary user to substitute another program for GPL Ghostscript.
-(Typically this requires use of a shell script or batch file, or a
-system call like "<code>exec</code>".) More precisely, if the user
-deletes from the computer system all the files in the GPL Ghostscript
-directories, and replaces the GPL Ghostscript executable with another
-program with the same name and conforming to the same documentation, the
-application will continue to work with it. One implication of this is
-that the GPL Ghostscript documentation must specify all properties of
-GPL Ghostscript on which the application relies; for example, if GPL
-Ghostscript has been modified by the addition of command line switches
-or language elements such as new operators, the documentation must
-describe any such additions that the application uses.</li>
-
-<li> The conditions of the GNU AGPL are met with respect to GPL Ghostscript,
-including the requirement for propagation of the AGPL and the requirement
-for delivering (or an offer to deliver) source code.</li>
-</ul>
-
-<p>
-Regarding this last point, the AGPL clearly intends that if the distributor
-only offers to provide the GPL Ghostscript source code (as opposed to
-actually distributing the source code with every copy of the application),
-then they must deliver the source code in a timely way to anyone
-requesting it.</p>
-
-<p>
-The AGPL makes it clear that if someone receives GPL Ghostscript only in
-its AGPL-licensed form, they only have a right to distribute it if they
-comply with the AGPL. Artifex Software, Inc., as the copyright holder,
-takes this requirement very seriously, and will, if necessary, take
-legal action to ensure that anyone distributing GPL Ghostscript with the
-AGPL complies with the conditions set forth above.</p>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2021 Artifex Software, Inc. All rights
-reserved.</small></p>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied. This software is distributed under license and may not be copied,
-modified or distributed except as expressly authorized under the terms
-of the license contained in the file LICENSE in this distribution. For more information about licensing, please visit
-http://www.artifex.com/licensing/or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861.</p>
-
-<p>
-<small>Ghostscript version 9.55.0, 27 September 2021
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
-
- </div>
- </div>
- </div>
-
- <div class="footer">
- <div class="row">
- <div class="col-7 footleft">
- <ul>
- <li><a href="https://artifex.com/contact-us/" target="blank">CONTACT US</a></li>
- <li><a href="https://artifex.com/about-us/" target="blank">ABOUT</a></li>
- <li><a href="https://ghostscript.com/security.html">SECURITY</a></li>
- </ul>
- </div>
- <div class="col-1 footcenter">
- <ul>
- <li><a href="https://artifex.com/support/" target="blank">SUPPORT</a></li>
- <li><a href="https://artifex.com/blog/artifex/" target="blank">BLOG</a></li>
- <li><a href="https://artifex.com/privacy-policy/" target="blank">PRIVACY</a></li>
- </ul>
- </div>
- <div class="col-ft-3 footright"><img src="images/Artifex_logo.png" width="194" height="40" alt=""/> <br>
- © Copyright 2019-2021 Artifex Software, Inc. <br>
- All rights reserved.
- </div>
- </div>
- </div>
-
- <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
- <script src="index.js"></script>
-</body>
-</html>
diff --git a/doc/DLL.htm b/doc/DLL.htm
deleted file mode 100644
index 325b87e2..00000000
--- a/doc/DLL.htm
+++ /dev/null
@@ -1,754 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>How to Use the Ghostscript Dynamic Link Library (DLL)</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>How to Use the Ghostscript Dynamic Link Library (DLL)</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#DLL">What is the Ghostscript DLL?</a></li>
- <li><a href="#Common_functions">Platform-independent DLL functions</a></li>
- <li>
- <ul>
- <li><a href="#revision"><code>gsdll_revision()</code></a></li>
- <li><a href="#init"><code>gsdll_init()</code></a></li>
- <li><a href="#execute_begin"><code>gsdll_execute_begin()</code></a></li>
- <li><a href="#execute_cont"><code>gsdll_execute_cont()</code></a></li>
- <li><a href="#execute_end"><code>gsdll_execute_end()</code></a></li>
- <li><a href="#exit"><code>gsdll_exit()</code></a></li>
- <li><a href="#lock_device"><code>gsdll_lock_device()</code></a></li>
- </ul>
- </li>
- <li><a href="#Callback">Callback function</a></li>
- <li><a href="#OS2_device">Ghostscript DLL device for OS/2</a></li>
- <li>
- <ul>
- <li><a href="#OS2_bmp"><code>gsdll_get_bitmap()</code></a></li>
- <li><a href="#OS2_example">Example DLL usage for OS/2</a></li>
- </ul>
- </li>
- <li><a href="#Win_device">Ghostscript DLL device for MS Windows</a></li>
- <li>
- <ul>
- <li><a href="#Win_copydib"><code>gsdll_copy_dib()</code></a></li>
- <li><a href="#Win_copypalette"><code>gsdll_copy_palette()</code></a></li>
- <li><a href="#Win_draw"><code>gsdll_draw()</code></a></li>
- <li><a href="#Win_get_row"><code>gsdll_get_bitmap_row()</code></a></li>
- </ul>
- </li>
- <li><a href="#Win16">Ghostscript DLL Device for 16-bit MS Windows</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.
-
-<p>
-<b>WARNING: The API described in this document is obsolete and will
-be removed in the future.</b>
-The current Ghostscript Interpreter API
-is described in <a href="API.htm">API.htm</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="DLL"></a>What is the Ghostscript DLL?</h2>
-
-<p>
-For the OS/2, Win16 and Win32 platforms, Ghostscript is built as a dynamic
-link library (DLL), and to provide the interface described in the <a
-href="Use.htm">usage documentation</a>, a smaller independent executable
-(<code>.EXE</code>) loads this DLL, which provides all the interaction
-with the windowing system, including image windows and, if necessary, a
-text window. This document describes the DLL interface, which consists of
-eight main functions, <a href="#functions">seven platform-independent
-ones</a> provided by the DLL and one, <a href="#Callback">the callback
-function</a>, provided by the caller. The DLL provides some other
-platform-specific functions for display devices.
-
-<p>
-The DLL's name and characteristics differ among the three platforms:
-
-<ul>
-<li>The <a href="#OS2_device">OS/2 DLL <code>GSDLL2.DLL</code></a> has
-MULTIPLE NONSHARED data segments and can be called by multiple programs
-simultaneously.</li>
-
-<li>The <a href="#Win_device">Win32 DLL <code>GSDLL32.DLL</code></a> has
-MULTIPLE NONSHARED data segments. Under Win32s it can be used by only one
-program at a time, but under Windows 95/98 or Windows NT it can be called by
-multiple programs simultaneously.</li>
-
-<li>The <a href="#Win16">Win16 DLL <code>GSDLL16.DLL</code></a> is a
-large-memory model DLL with far static data. Due to the limitations of
-16-bit MS Windows -- Windows 3.n -- the DLL can be used by only one program
-at a time.</li>
-</ul>
-
-<p>
-The source for the executable is in <code>dp</code>*.* (OS/2) and
-<code>dw</code>*.* (Windows). See these source files for examples of
-how to use the DLL.
-
-<hr>
-
-<h2><a name="Common_functions"></a>Platform-independent DLL functions</h2>
-
-<p>
-The seven functions provided by the DLL are
-<ul>
-<li><code>int GSDLLAPI <a href="#revision">gsdll_revision</a>(char **product, char **copyright, long *gs_revision, long *gs_revisiondate)</code></li>
-<li><code>int GSDLLAPI <a href="#init">gsdll_init</a>(GSDLL_CALLBACK callback, HWND hwnd, int argc, char *argv[]);</code></li>
-<li><code>int GSDLLAPI <a href="#execute_begin">gsdll_execute_begin</a>(void);</code></li>
-<li><code>int GSDLLAPI <a href="#execute_cont">gsdll_execute_cont</a>(const char *str, int len);</code></li>
-<li><code>int GSDLLAPI <a href="#execute_end">gsdll_execute_end</a>(void);</code></li>
-<li><code>int GSDLLAPI <a href="#exit">gsdll_exit</a>(void);</code></li>
-<li><code>int GSDLLAPI <a href="#lock_device">gsdll_lock_device</a>(unsigned char *device, int flag);</code>
-
-<p>
-where <code>GSDLLAPI</code> is defined under OS/2 as
-
-<blockquote><code>
-#define GSDLLAPI
-</code></blockquote>
-
-<p>
-and under MS Windows as
-
-<blockquote><code>
-#define GSDLLAPI CALLBACK _export
-</code></blockquote>
-</li>
-</ul>
-
-<h3><a name="revision"></a><code>gsdll_revision()</code></h3>
-
-<blockquote>
-This function returns the revision numbers and strings of the Ghostscript
-DLL; you should call it before <code>gsdll_init()</code> to make sure
-that the correct version of the Ghostscript DLL has been loaded. For
-example
-
-<blockquote>
-<pre>char *product;
-char *copyright;
-long revision;
-long revisiondate;
-gsdll_revision(&amp;product, &amp;copyright, &amp;revision, &amp;revisiondate);
-</pre></blockquote>
-
-<p>
-You may use <code>NULL</code> pointers if you do not want a particular
-value.
-</blockquote>
-
-<h3><a name="init"></a><code>gsdll_init()</code></h3>
-
-<blockquote>
-<code>gsdll_init()</code> must be called after loading the DLL and
-before executing any Ghostscript commands. The arguments are the address
-of the callback function, a parent window handle, the count of arguments
-and an array of pointers to the arguments. For example
-
-<blockquote>
-<pre>char *argv[5];
-argv[0] = "gswin.exe";
-argv[1] = "-Ic:\\gs;c:\gs\\fonts";
-argv[2] = "-dNOPAUSE",
-argv[3] = "-sDEVICE=djet500",
-argv[4] = NULL;
-argc = 4;
-
-code = gsdll_init(gsdll_callback, hwnd, argc, argv);
-</pre></blockquote>
-
-<p>
-<code>hwnd</code> is used as the parent window handle for any windows
-created by Ghostscript. <code>hwnd</code> may be <code>NULL</code>
-if the caller has no windows, but if it is <code>NULL</code>, you should
-avoid using devices which may open windows.
-
-<p>
-A return code of 0 (zero) indicates no errors, and the code may now call
-<code>gsdll_execute_begin()</code> or <code>gsdll_exit()</code>. If
-the return value is non-zero then <code>gsdll_exit()</code> must not be
-called.
-
-<p>
-A return value of <code>GSDLL_INIT_QUIT</code> indicates that one of the
-command line files or arguments called "<code>quit</code>", or that
-Ghostscript was reading stdin and reached end-of-file. This is not an
-error. <code>gsdll_exit()</code> must not be called.
-
-<p>
-A return value of <code>GSDLL_INIT_IN_USE</code> indicates that the DLL
-is in use by another application (Windows 3.1 only). The DLL should be
-immediately unloaded (or the caller terminated).
-<code>gsdll_exit()</code> must not be called.
-</blockquote>
-
-<h3><a name="execute_begin"></a><code>gsdll_execute_begin()</code></h3>
-
-<blockquote>
-This must be called after <code>gsdll_init()</code> and before
-<code>gsdll_execute_cont()</code>.
-</blockquote>
-
-<h3><a name="execute_cont"></a><code>gsdll_execute_cont()</code></h3>
-
-<blockquote>
-After successfully calling <code>gsdll_init()</code> and
-<code>gsdll_execute_begin()</code>, commands may be given to Ghostscript
-with <code>gsdll_execute_cont()</code>. Examples are:
-
-<blockquote>
-<pre>char *command = "1 2 add == flush\n";
-code = gsdll_execute_cont(command, strlen(command));
-command = "qu"
-code = gsdll_execute_cont(command, strlen(command));
-command = "it\n"
-code = gsdll_execute_cont(command, strlen(command));
-</pre>
-
-<a name="cont_returns"></a>
-<table>
-<tr>
- <th colspan="2">Return codes from gsdll_execute_cont()</th>
-</tr>
-<tr>
- <th align="left">Code</th>
-
- <th align="left">Status</th>
-</tr>
-<tr>
- <td align="left">0</td>
-
- <td>No errors</td>
- </tr>
-<tr>
- <td align="left">&lt; 0</td>
-
- <td>Error</td>
- </tr>
-<tr>
- <td align="left">&lt;= -100</td>
-
- <td>"<code>quit</code>" has been executed, or fatal error.
-<code>gsdll_exit()</code> must then be called: do not call
-<code>gsdll_execute_end()</code>.</td>
- </tr>
-</table>
-</blockquote>
-
-<code>gsdll_execute_cont()</code>
-does not flush stdio, so if you want to see output from Ghostscript you
-must do this explicitly as shown in the example above.
-
-<p>
-When executing a string with <code>gsdll_execute_cont()</code>,
-<code>currentfile</code> is the input from
-<code>gsdll_execute_cont()</code>. Reading from <code>%stdin</code>
-uses the callback.
-
-<p>
-Please note that there is a 64 KB length limit on the passed string.
-If you have more than 65535 bytes of input to process at a given time,
-it must be split into separate smaller buffers, each passed on a
-separate call.
-
-</blockquote>
-
-<h3><a name="execute_end"></a><code>gsdll_execute_end()</code></h3>
-
-<blockquote>
-If <code>gsdll_execute_cont()</code> did not return an error, then
-<code>gsdll_execute_end()</code> must be called after
-<code>gsdll_execute_cont()</code> and before
-<code>gsdll_exit()</code>.
-</blockquote>
-
-<h3><a name="exit"></a><code>gsdll_exit()</code></h3>
-
-<blockquote>
-Call gsdll_exit() to terminate the Ghostscript DLL. It must be called if a
-fatal error has occurred; see the <a href="#cont_returns">return value
-of <code>gsdll_execute_cont()</code></a>. After calling
-<code>gsdll_exit()</code>, there are two options:
-
-<ul>
-<li>Unload the DLL, either by terminating the application or by
-calling <code>DosFreeModule</code> (OS/2) or <code>FreeLibrary</code> (MS Windows).
-
-<li>Call <code>gsdll_init()</code> again to restart Ghostscript.
-</ul>
-</blockquote>
-
-<h3><a name="lock_device"></a><code>gsdll_lock_device()</code></h3>
-
-<blockquote>
-Since the caller may be multithreaded, a lock is needed to control access
-to the display device, and <code>gsdll_lock_device()</code> provides that
-locking.
-
-<blockquote>
-<pre>int gsdll_lock_device(unsigned char *device, int flag);
- /* Lock the device if flag = TRUE */
- /* Unlock the device if flag = FALSE */
- /* device is a pointer to Ghostscript os2dll or mswindll device */
- /* from GSDLL_DEVICE message. */
- /* Return value is the lock count. */
-</pre>
-
-<table>
-<tr>
- <th colspan="2">Locking and unlocking devices</th>
- </tr>
-<tr>
- <td>To lock a device</td>
-
- <td><code>gsdll_lock_device(device, 1)</code>;</td>
- </tr>
-<tr>
- <td>To unlock a device</td>
-
- <td><code>gsdll_lock_device(device, 0)</code>;</td>
- </tr>
-</table>
-</blockquote>
-
-<p>
-This function is typically used to lock the device while repainting a
-window or copying the device bitmap to the clipboard. Ghostscript may draw
-into the device bitmap or update the palette entries while the device is
-locked by the caller, but locking the device prevents the Ghostscript DLL
-from closing the device or changing its size or depth.
-
-<p>
-Under OS/2, Windows 95/98 and Windows NT, this lock is implemented using a
-mutual exclusion semaphore (mutex). The return value is the lock count,
-which is either 0 ("unlocked") or 1 ("locked"). The function blocks until
-the device is locked by the caller.
-
-<p>
-Under Win16 or Win32s, <code>gsdll_lock_device()</code> always returns
-immediately with a lock count as its return value. A lock count of 2 or
-more is definite indication of an error, probably calling the function
-twice. Access to the device should be controlled by checking the Windows
-message queue only when the bitmap is not being accessed.
-</blockquote>
-
-<hr>
-
-<h2><a name="Callback"></a>Callback function</h2>
-
-<blockquote>
-As an argument to <a href="#init"><code>gsdll_init()</code></a> the
-caller must provide a callback function which the DLL invokes for stdio and
-to notify the caller about device events. The function provided by the
-caller has this prototype:
-
-<blockquote><code>
-int gsdll_callback(int&nbsp;message, char&nbsp;*str, unsigned&nbsp;long&nbsp;count);
-</code></blockquote>
-
-<p>
-The Pascal calling convention is not used. An example callback function
-is:
-
-<blockquote>
-<pre>int
-gsdll_callback(int message, char *str, unsigned long count)
-{
-char *p;
- switch (message) {
- case GSDLL_STDIN:
- p = fgets(str, count, stdin);
- if (p)
- return strlen(str);
- else
- return 0;
- case GSDLL_STDOUT:
- if (str != (char *)NULL)
- fwrite(str, 1, count, stdout);
- return count;
- case GSDLL_DEVICE:
- fprintf(stdout,"Callback: DEVICE %p %s\n", str,
- count ? "open" : "close");
- break;
- case GSDLL_SYNC:
- fprintf(stdout,"Callback: SYNC %p\n", str);
- break;
- case GSDLL_PAGE:
- fprintf(stdout,"Callback: PAGE %p\n", str);
- break;
- case GSDLL_SIZE:
- fprintf(stdout,"Callback: SIZE %p width=%d height=%d\n", str,
- (int)(count &amp; 0xffff), (int)((count&gt;&gt;16) &amp; 0xffff) );
- break;
- case GSDLL_POLL:
- return 0; /* no error */
- default:
- fprintf(stdout,"Callback: Unknown message=%d\n",message);
- break;
- }
- return 0;
-}
-</pre>
-
-<table>
- <tr>
- <th colspan="3">Messages used by callback</th>
- </tr>
-<tr>
- <th align="left">Symbol</th>
-
- <th align="left">Value</th>
-
- <th align="left">Use</th>
- </tr>
-<tr>
- <td><code>GSDLL_STDIN</code></td>
-
- <td>1</td>
-
- <td>get <code>count</code> characters to <code>str</code> from stdin, return number of characters read</td>
- </tr>
-<tr>
- <td><code>GSDLL_STDOUT</code></td>
-
- <td>2</td>
-
- <td>put <code>count</code> characters from <code>str</code>
- to stdout, return number of characters written</td>
- </tr>
-<tr>
- <td><code>GSDLL_DEVICE</code></td>
-
- <td>3</td>
-
- <td>device <code>str</code> has been opened if
- <code>count</code>&nbsp;=&nbsp;1, closed if
- <code>count</code>&nbsp;=&nbsp;0</td>
- </tr>
-<tr>
- <td><code>GSDLL_SYNC</code></td>
-
- <td>4</td>
-
- <td>sync_output for device <code>str</code></td>
- </tr>
-<tr>
- <td><code>GSDLL_PAGE</code></td>
-
- <td>5</td>
-
- <td>output_page for device <code>str</code></td>
- </tr>
-<tr>
- <td><code>GSDLL_SIZE</code></td>
-
- <td>6</td>
-
- <td>resize for device <code>str</code>:
- LOWORD(<code>count</code>) is new <code>xsize</code>,
- HIWORD(<code>count</code>) is new <code>ysize</code></td>
- </tr>
-<tr>
- <td><code>GSDLL_POLL</code></td>
-
- <td>7</td>
-
- <td>Called from <code>gp_check_interrupt()</code><br>
- Can be used by the caller to poll the message queue.
- Normally returns 0. To abort
- <code>gsdll_execute_cont()</code>, return a non-zero
- error code until <code>gsdll_execute_cont()</code>
- returns.</td>
- </tr>
-</table>
-</blockquote>
-</blockquote>
-
-<hr>
-
-<h2><a name="OS2_device"></a>Ghostscript DLL device for OS/2</h2>
-
-<p>
-The <code>os2dll</code> device is provided in the Ghostscript DLL for
-use by the caller. No drawing facilities are provided by the DLL because
-the DLL may be loaded by a text-only (non-PM) application. The caller is
-notified via the <code>gsdll_callback()</code> when a new
-<code>os2dll</code> device is opened or closed
-(<code>GSDLL_DEVICE</code>), when the window should be redrawn
-(<code>GSDLL_SYNC</code> or <code>GSDLL_PAGE</code>) or when the
-bitmap size changes (<code>GSDLL_SIZE</code>).
-Note that more than one <code>os2dll</code> device may be opened.
-
-<h3><a name="OS2_bmp"></a><code>gsdll_get_bitmap()</code></h3>
-
-<blockquote>
-<code>gsdll_get_bitmap()</code> returns a pointer to a bitmap in BMP
-format. The <code>os2dll</code> device draws into this bitmap.
-
-<blockquote>
-<pre>unsigned long gsdll_get_bitmap(unsigned char *device, unsigned char **pbitmap);
- /* return in pbitmap the address of the bitmap */
- /* device is a pointer to Ghostscript os2dll device from GSDLL_DEVICE message */
-</pre></blockquote>
-
-<p>
-The caller can then display the bitmap however it likes, but should lock
-the bitmap with <code>gsdll_lock_device()</code> before painting from
-it, and unlock it afterwards. The bitmap address does not change until the
-<code>os2dll</code> device is closed; however the bitmap size and
-palette may change whenever the bitmap is not locked.
-</blockquote>
-
-<h3><a name="OS2_example"></a>Example DLL usage for OS/2</h3>
-
-<p>
-The example here shows a minimal usage of the Ghostscript DLL under OS/2.
-The sample callback function above is needed.
-
-<blockquote>
-<pre>#define INCL_DOS
-#include &lt;os2.h&gt;
-#include &lt;stdio.h&gt;
-#include "gsdll.h"
-
-PFN_gsdll_init pgsdll_init;
-PFN_gsdll_execute_begin pgsdll_execute_begin;
-PFN_gsdll_execute_cont pgsdll_execute_cont;
-PFN_gsdll_execute_end pgsdll_execute_end;
-PFN_gsdll_exit pgsdll_exit;
-
-HMODULE hmodule_gsdll;
-char buf[256];
-
-int
-main(int argc, char *argv[])
-{
-int code;
-APIRET rc;
- if (!DosLoadModule(buf, sizeof(buf), "GSDLL2", &amp;hmodule_gsdll)) {
- fprintf(stderr, "Loaded GSDLL2\n");
- DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_init", (PFN *)(&amp;pgsdll_init));
- DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_execute_begin", (PFN *)(&amp;pgsdll_execute_begin));
- DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_execute_cont", (PFN *)(&amp;pgsdll_execute_cont));
- DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_execute_end", (PFN *)(&amp;pgsdll_execute_end));
- DosQueryProcAddr(hmodule_gsdll, 0, "gsdll_exit", (PFN *)(&amp;pgsdll_exit));
- }
- else {
- fprintf(stderr, "Can't load GSDLL2\n");
- }
-
- code = (*pgsdll_init)(gsdll_callback, NULL, argc, argv);
- fprintf(stdout,"gsdll_init returns %d\n", code);
- code = (*pgsdll_execute_begin)();
- if (code==0) {
- while (fgets(buf, sizeof(buf), stdin)) {
- code = (*pgsdll_execute_cont)(buf, strlen(buf));
- fprintf(stdout,"gsdll_execute returns %d\n", code);
- if (code &lt; 0)
- break;
- }
- if (!code)
- code = (*pgsdll_execute_end)();
- code = (*pgsdll_exit)();
- fprintf(stdout,"gsdll_exit returns %d\n", code);
- }
- rc = DosFreeModule(hmodule_gsdll);
- fprintf(stdout,"DosFreeModule returns %d\n", rc);
- return 0;
-}
-</pre></blockquote>
-
-<hr>
-
-<h2><a name="Win_device"></a>Ghostscript DLL device for MS Windows</h2>
-
-<p>
-The <code>mswindll</code> device is provided in the Ghostscript DLL for
-use by the caller. The caller is notified via the
-<code>gsdll_callback()</code> when a new <code>mswindll</code> device
-is opened or closed (<code>GSDLL_DEVICE</code>), when the window should
-be redrawn (<code>GSDLL_SYNC</code> or <code>GSDLL_PAGE</code>) or
-when the bitmap size changes (<code>GSDLL_SIZE</code>). Note that more
-than one <code>mswindll</code> device may be opened.
-
-<p>
-Four DLL functions are available to use the <code>mswindll</code>
-device.
-
-<h3><a name="Win_copydib"></a><code>gsdll_copy_dib()</code></h3>
-
-<blockquote>
-Copy the <code>mswindll</code> bitmap to the clipboard.
-
-<blockquote>
-<pre>HGLOBAL GSDLLAPI gsdll_copy_dib(unsigned char *device);
- /* make a copy of the device bitmap and return shared memory handle to it */
- /* device is a pointer to Ghostscript device from GSDLL_DEVICE message */
-</pre></blockquote>
-</blockquote>
-
-<h3><a name="Win_copypalette"></a><code>gsdll_copy_palette()</code></h3>
-
-<blockquote>
-Copy the <code>mswindll</code> palette to the clipboard.
-
-<blockquote>
-<pre>HPALETTE GSDLLAPI gsdll_copy_palette(unsigned char *device);
-/* make a copy of the device palette and return a handle to it */
-/* device is a pointer to Ghostscript device from GSDLL_DEVICE message */
-</pre></blockquote>
-</blockquote>
-
-<h3><a name="Win_draw"></a><code>gsdll_draw()</code></h3>
-
-<blockquote>
-Display output from the <code>mswindll</code> device. The caller should
-create a window and call <code>gsdll_draw()</code> in response to the
-<code>WM_PAINT</code> message. The device context <code>hdc</code>
-must be for a device because <code>SetDIBitsToDevice()</code> is used.
-
-<blockquote>
-<pre>void GSDLLAPI gsdll_draw(unsigned char *device, HDC hdc,
- LPRECT dest, LPRECT src);
-/* copy the rectangle src from the device bitmap */
-/* to the rectangle dest on the device given by hdc */
-/* hdc must be a device context for a device (NOT a bitmap) */
-/* device is a pointer to Ghostscript device from GSDLL_DEVICE message */
-</pre></blockquote>
-</blockquote>
-
-<h3><a name="Win_get_row"></a><code>gsdll_get_bitmap_row()</code></h3>
-
-<blockquote>
-Get a BMP header, a palette, and a pointer to a row in the bitmap. This
-function exists to allow the bitmap to be copied to a file or structured
-storage without the overhead of having two copies of the bitmap in memory
-at the same time.
-
-<p>
-Ghostscript can change the palette while the device is locked. Do not call
-this function while Ghostscript is busy.
-
-<blockquote>
-<pre>int GSDLLAPI gsdll_get_bitmap_row(unsigned char *device, LPBITMAPINFOHEADER pbmih,
- LPRGBQUAD prgbquad, LPBYTE *ppbyte, unsigned int row)
-/* If pbmih nonzero, copy the BITMAPINFOHEADER.
- * If prgbquad nonzero, copy the palette.
- * number of entries copied is given by pbmih-&gt;biClrUsed
- * If ppbyte nonzero, return pointer to row.
- * pointer is only valid while device is locked
- */
-</pre></blockquote>
-</blockquote>
-
-<hr>
-
-<h2><a name="Win16"></a>Ghostscript DLL Device for 16-bit MS Windows</h2>
-
-<p>
-This platform has the most problems of the three. Support for it may be
-dropped in future.
-
-<p>
-The Win16 DLL <code>GSDLL16.DLL</code> is a large-memory model DLL with
-far static data. Due to the limitations of 16-bit MS Windows, the DLL can
-be used by only one program at a time.
-
-<p>
-However, <code>GSDLL16</code> is marked as having SINGLE SHARED data
-segments, allowing multiple applications to load it with no error
-indication. (The DLL wouldn't load at all if MULTIPLE NONSHARED was used).
-Nonetheless, <b>it cannot be used by more than one application at a
-time</b>, so applications loading <code>GSDLL16</code> should check the
-return value of <code>gsdll_init()</code>: if this value is non-zero,
-then <code>GSDLL16</code> is already in use by another application and
-should <b><em>not</em></b> be used: <code>GSDLL16</code> should be
-unloaded immediately using <code>FreeLibrary()</code>, or the calling
-program should quit without attempting to use the library..
-
-<p>
-The segmented architecture of the Intel 80286 causes the usual amount of
-grief when using <code>GSDLL16</code>. Because the callback is called
-from the DLL, which is using a different data segment, the callback must be
-declared as <code>_far&nbsp;_export</code>:
-
-<blockquote>
-<pre>int _far _export gsdll_callback(int message, char *str, unsigned long count);
-</pre></blockquote>
-
-<p>
-Instead of giving <code>gsdll_init()</code> the address of
-<code>gsdll_callback()</code>, it should instead be given the address of
-a thunk created by <code>MakeProcInstance</code>. This thunk changes
-the data segment back to that used by the caller:
-
-<blockquote>
-<pre>FARPROC lpfnCallback;
-lpfnCallback = (FARPROC)MakeProcInstance((FARPROC)gsdll_callback, hInstance);
-code = (*pgsdll_init)((GSDLL_CALLBACK)lpfnCallback, NULL, argc, argv);
-if (!code) {
- fprintf(stderr, "GSDLL16 is already in use\n");
- return -1;
-}
-</pre></blockquote>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Deprecated.htm b/doc/Deprecated.htm
deleted file mode 100644
index 62be1773..00000000
--- a/doc/Deprecated.htm
+++ /dev/null
@@ -1,5769 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Deprecated Ghostscript Features</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Deprecated Ghostscript Features</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-
-<ul class="toc">
- <li><a href="#Options">Deprecated Options</a></li>
- <li><a href="#HP8_color_inkjet">H-P 8xx, 1100, and 1600 color inkjet printers</a></li>
- <li>
- <ul>
- <li><a href="#HP8_gdevcd8">Drivers contained in <code>gdevcd8.c</code></a></li>
- <li><a href="#HP8_further_documentation">Further documentation</a></li>
- </ul>
- </li>
- <li><a href="#HP880_color_inkjet">H-P 812, 815, 832, 880, 882, 895, and 970 color inkjet printers</a></li>
- <li>
- <ul>
- <li><a href="#HP880_gdevcd8">Drivers contained in <code>gdevcd8.c</code></a></li>
- <li><a href="#HP880_further_documentation">Further documentation</a></li>
- </ul>
- </li>
- <li><a href="#HP_color_inkjet">Other H-P color inkjet printers</a></li>
- <li>
- <ul>
- <li><a href="#HP_gdevcdj">Drivers contained in <code>gdevcdj.c</code></a></li>
- <li><a href="#HP_paper_size">Default paper size</a></li>
- <li><a href="#HP_limits">Deskjet physical limits</a></li>
- <li><a href="#HP_command_line">Printer properties (command-line parameters)</a></li>
- <li>
- <ul>
- <li><a href="#HP_bpp">Bits per pixel</a></li>
- <li><a href="#HP_deskjet_properties">Deskjet properties</a></li>
- <li><a href="#HP_paintjet_properties">Paintjet XL300 / Paintjet XL properties</a></li>
- </ul>
- </li>
- <li><a href="#HP_gamma">Gamma correction</a></li>
- <li><a href="#HP_resolution_enhance">HP's resolution-enhanced mode for Inkjet printers</a></li>
- <li><a href="#HP_tips">General tips</a></li>
- </ul>
- </li>
-
- <li><a href="#BJC_8200">Canon BJC-8200 printer</a></li>
- <li><a href="#BJC">Other Canon BubbleJet (BJC) printers</a></li>
- <li>
- <ul>
- <li><a href="#BJC_history">History</a></li>
- <li><a href="#BJC_build">Configuring and building the BJC drivers</a></li>
- <li>
- <ul>
- <li><a href="#BJC_defaults">Modify values in <code>gdevbjc.h</code></a></li>
- <li><a href="#BJC_CMYK_RGB">CMYK-to-RGB color conversion</a></li>
- <li><a href="#BJC_vertical_centering">Vertical centering of the printable area</a></li>
- <li><a href="#BJC_margins">Page margins</a></li>
- <li><a href="#BJC_compile">Makefile and compilation</a></li>
- </ul>
- </li>
- <li><a href="#BJC_usage">Use of the drivers</a></li>
- <li>
- <ul>
- <li><a href="#BJC_options">Supported Options and Defaults</a></li>
- <li><a href="#BJC_device_info">Device information</a></li>
- <li><a href="#BJC_HW_margins">Hardware margins</a></li>
- <li><a href="#BJC_PPD">PostScript printer description (PPD) files</a></li>
- <li><a href="#BJC_PPD_custom">Customizing the PPD files</a></li>
- </ul>
- </li>
-
- <li><a href="#BJC_bugs">How to report problems</a></li>
- <li><a href="#BJC_acks">Acknowledgements</a></li>
- </ul>
- </li>
-
- <li><a href="#STC_epson_stylus">Epson Stylus color printer (see also <code>uniprint</code>)</a></li>
- <li>
- <ul>
- <li><a href="#STC_usage">Usage</a></li>
- <li><a href="#STC_options">Options</a></li>
- <li><a href="#STC_FAQ">Application note and FAQ</a></li>
- <li>
- <ul>
- <li><a href="#STC_FAQ_A3">Support for A3 paper</a></li>
- <li><a href="#STC_FAQ_margins">Margins, PageSize</a></li>
- <li><a href="#STC_FAQ_II_IIS_1500">Stylus Color II / IIs and 1500</a></li>
- </ul>
- </li>
- <li><a href="#STC_recommendations">Recommendations</a></li>
- <li>
- <ul>
- <li><a href="#STC_dither_experiment">Color dithering experiments with <code>gdevstc</code> 1.21</a></li>
- </ul>
- </li>
- <li><a href="#STC_color_transform">Color transformation</a></li>
- <li><a href="#STC_CAM"><code>ColorAdjustMatrix</code></a></li>
- <li><a href="#STC_RGBCMYK_coding">RGB / CMYK coding and transfer, and <code>BitsPerPixel</code></a></li>
- <li><a href="#What_is_weaving">What is weaving?</a></li>
- <li><a href="#STC_print_modes">Print mode parameters</a></li>
- <li>
- <ul>
- <li><a href="#STC_unidirectional"><code>Unidirectional</code></a></li>
- <li><a href="#STC_noweave"><code>Microweave</code>, <code>noWeave</code> and <code>OutputCode=deltarow</code></a></li>
- <li><a href="#STC_model"><code>Model</code></a></li>
- </ul>
- </li>
- <li><a href="#STC_Pitfalls">Bugs and pitfalls</a></li>
- <li><a href="#STC_Tests">Tests</a></li>
- <li>
- <ul>
- <li><a href="#STC_OutputCodes">The various OutputCodes</a></li>
- <li><a href="#STC_printing_time">Printing time related to other options</a></li>
- </ul>
- </li>
- <li><a href="#STC_acks">Acknowledgments</a></li>
- </ul>
- </li>
- <li><a href="#Uniprint">uniprint, a flexible unified printer driver</a></li>
- <li>
- <ul>
- <li><a href="#Uni_state">The state of this driver</a></li>
- <li><a href="#Uni_background">Notes on <code>uniprint</code>'s background</a></li>
- <li><a href="#Uni_make_pfile">Godzilla's guide to the creation of Unified Printer Parameter (<code>.upp</code>) files</a></li>
- <li><a href="#Uni_all_parameters">All parameters in brief</a></li>
- <li><a href="#Uni_honors"><code>Uniprint</code>'s Roll of Honor</a></li>
- <li><a href="#Uni_weaving_howto"><code>Uniprint</code> weaving parameters howto</a></li>
- <li><a href="#Uni_esc300">Extension to <code>uniprint</code> for the Epson Stylus Color 300</a></li>
- </ul>
- </li>
-</ul>
-
-
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p><strong>These devices are no longer supported and/or superceeded by newer methods.
-The documentation is kept here for reference. Be advised that these devices
-will be removed in future versions of Ghostscript.</strong></p>
-
-<p>Supported devices are descripted in <a href="Devices">Details of Ghostscript
-output devices</a>.</p>
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>. You may also be interested in <a href="Make.htm">how to
-build Ghostscript</a> and <a href="Install.htm">install it</a>, as well as
-the description of the <a href="Drivers.htm">driver interface</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Options"></a>Deprecated options</h2>
-
-<p>
-For compatibility with older versions of Ghostscript, <tt>-sOUTPUTFILE</tt>
-is a synonym for <tt>-sOutputFile</tt>. It should not be used in new code.</p>
-
-<hr>
-
-<h2><a name="HP8_color_inkjet"></a>H-P 8xx, 1100, and 1600 color inkjet printers</h2>
-
-<p>
-This section, written by Uli Wortmann &lt;<a
-href="mailto:uliw@erdw.ethz.ch">uliw@erdw.ethz.ch</a>&gt;, deals with the
-DeskJet 670, 690, 850, 855, 870, 890, 1100, and 1600.</p>
-
-<h3><a name="HP8_gdevcd8"></a>Drivers contained in <code>gdevcd8.c</code></h3>
-
-<p>
-The source module <code>gdevcd8.c</code> contains four generic drivers:</p>
-
-<blockquote>
-<table>
-<tr>
- <td><code>cdj670</code></td>
- <td colspan="2">HP DeskJet 670 and 690</td>
-</tr>
-<tr>
- <td><code>cdj850</code></td>
- <td colspan="2">HP DeskJet 850, 855, 870, and 1100</td>
-</tr>
-<tr>
- <td><code>cdj890</code></td>
- <td colspan="2">HP DeskJet 890</td>
-</tr>
-<tr>
- <td><code>cdj1600</code></td>
- <td colspan="2">HP DeskJet 1600</td>
-</tr>
-</table>
-</blockquote>
-
-<h3><a name="HP8_further_documentation"></a>Further documentation</h3>
-<p> <strong>Credits:</strong> Much of the driver is based on ideas derived from the
- cdj550 driver of George Cameron. The support for the hp670, hp690, hp890
- and hp1600 was added by Martin Gerbershagen.</p>
-<blockquote>
- <table>
- <tr>
- <th width="20%">Date</th>
- <th width="20%">Version</th>
- <th width="60%">Comments</th>
-</tr>
-
-<tr>
- <td>11.11.96</td>
- <td>Version 1.0</td>
- <td></td>
-</tr>
-<tr>
- <td>25.08.97</td>
- <td>Version 1.2</td>
- <td>Resolved all but one of the known bugs, introduced a couple of perfomance improvements. Complete new color-transfer-function handling (see gamma).</td>
-</tr>
-<tr>
- <td>01.06.98</td>
- <td>Version 1.3</td>
- <td>Due to the most welcome contribution of Martin Gerbershagen
- (ger@ulm.temic.de), support for the hp670, hp690 and hp890 and
- hp1600 has been added. Martin has also resolved all known bugs.<br>
- Problems:Dark colors are still pale.</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-The hp690 is supported through the hp670 device, the hp855, hp870 and the
-hp1100 through the hp850 device. The driver needs no longer special
-switches to be invoked except <code>-sDEVICE=cdj850</code>,
-<code>-sDEVICE=CDJ890</code>, <code>-sDEVICE=CDJ670</code>, or
-<code>-sDevice=CDJ1600</code>. The following switches are supported.</p>
-
-<blockquote>
-<table>
-<tr>
- <td><code>-dPapertype=</code></td>
-
- <td>0</td>
-
- <td>plain paper [default]</td>
-</tr>
-<tr>
- <td></td>
-
- <td>1</td>
-
- <td>bond paper</td>
-</tr>
-<tr>
- <td></td>
-
- <td>2</td>
-
- <td>special paper</td>
-</tr>
-<tr>
- <td></td>
-
- <td>3</td>
-
- <td>glossy film</td>
-</tr>
-<tr>
- <td></td>
-
- <td>4</td>
-
- <td>transparency film</td>
-</tr>
-<tr>
- <td></td>
- <td>&nbsp;</td>
- <td>Currently the lookup tables are unsuited for printing on
- special paper or transparencies. For these please revert to the
- gamma functions.</td>
-</tr>
-<tr>
- <td><code>-dQuality=</code></td>
-
- <td>-1</td>
-
- <td>draft</td>
-</tr>
-<tr>
- <td></td>
- <td>0</td>
-
- <td>normal [default]</td>
-</tr>
-<tr>
- <td></td>
- <td>1</td>
-
- <td>presentation</td>
-</tr>
-<tr>
- <td><code>-dRetStatus=</code></td>
-
- <td>0</td>
-
- <td>C-RET off</td>
-</tr>
-<tr>
- <td></td>
-
- <td>1</td>
-
- <td>C-RET on [default]</td>
-</tr>
-<tr>
- <td><code>-dMasterGamma=</code></td>
-
- <td>3.0</td>
-
- <td>[default = 1.0]</td>
-</tr>
-</table>
-</blockquote>
-
-<blockquote>
-<b>Note:</b> To take advantage of the calibrated color-transfer functions,
-be sure not to have any gamma statements left! If you need to (i.e., for
-overhead transparencies), you still can use the gamma functions, but they
-will override the built-in calibration. To use gamma in the traditional
-way, set MasterGamma to any value greater than 1.0 and less than 10.0. To
-adjust individual gamma values, you have to additionally set MasterGamma to
-a value greater than 1.0 and less than 10.0. With the next release, gamma
-functions will be dropped.
-</blockquote>
-
-<p>
-When using the driver, be aware that printing at 600dpi involves
-processing large amounts of data (&gt; 188MB !). Therefore the
-driver is not what you would expect to be a fast driver ;-)
-This is no problem when printing a full-sized color page (because
-printing itself is slow), but it's really annoying if you print only
-text pages. Maybe I can optimize the code for text-only pages in a
-later release. Right now, it is recommended to use the highest
-possible optimisation level your compiler offers.
-For the time being, use the cdj550 device with <code>-sBitsPerPixel=3</code>
-for fast proof prints. If you simply want to print 600dpi BW data,
-use the cdj550 device with <code>-sBitsPerPixel=8</code> (or 1).</p>
-
-<p>
-Since the printer itself is slow, it may help to set the process priority
-of the gs process to "regular" or even less. On a 486/100MHz this is still
-sufficient to maintain a continuous data flow. Note to OS/2 users: simply
-put the gs window into the background or minimize it. Also make sure that
-<code>print01.sys</code> is invoked without the <code>/irq</code>
-switch (great speed improvement under Warp4).</p>
-
-<p>
-The printer default settings compensate for dot-gain by a calibrated
-color-transfer function. If this appears to be too light for your business
-graphs, or for overhead transparencies, feel free to set
-<code>-dMasterGamma=1.7</code>. Furthermore, you may tweak the gamma
-values independently by setting <code>-dGammaValC</code>,
-<code>-dGammaValM</code>, <code>-dGammaValY</code> or
-<code>-dGammaValK</code> (if not set, the values default to
-<code>MasterGamma</code>). This will only work when
-<code>-dMasterGamma</code> is set to a value greater than 1.0.</p>
-
-<p>
-Further information, bugs, tips etc, can be found at my website. To learn
-more about gamma, see
-<a href="ftp://ftp.igd.fhg.de/pub/doc/colour/GammaFAQ.pdf">ftp://ftp.igd.fhg.de/pub/doc/colour/GammaFAQ.pdf</a>.</p>
-
-<p>
-Depending on how you transfer the files, under UNIX you may need to remove
-the CRs of the CR-LF sequence used for end-of-line on DOS-based (MS
-Windows-based) systems. You can do this in unpacking the files with <code>unzip&nbsp;-a&nbsp;hp850.zip</code>.</p>
-
-<p>
-To compile with gs5.x or later, simply add to your makefile</p>
-<blockquote>
-DEVICE_DEVS4=cdj850.dev cdj670.dev cdj890.dev cdj1600.dev
-</blockquote>
-
-<p>
-Have fun!</p>
-
-<p>
-Uli &lt;<a href="mailto:uliw@erdw.ethz.ch">uliw@erdw.ethz.ch</a>&gt;
-<br><a href="http://www.erdw.ethz.ch/~bonk/">http://www.erdw.ethz.ch/~bonk/</a></p>
-
-<hr>
-
-<h2><a name="HP880_color_inkjet"></a>H-P 812, 815, 832, 880, 882, 895, and 970 color inkjet printers</h2>
-
-<p>
-This section, written by Matthew Gelhaus &lt;<a
-href="mailto:hp880@gelhaus.net">hp880@gelhaus.net</a>&gt;, deals with the
-DeskJet 812, 815, 832, 880, 882, 895, and 970.</p>
-
-<p>
-This is a modified version of the <a href="#HP8_color_inkjet">HP8xx driver</a>
-written by Uli Wortmann. More information and download are available at
-<a href="http://www.gelhaus.net/hp880c/">http://www.gelhaus.net/hp880c/</a>.</p>
-
-<h3><a name="HP880_gdevcd8"></a>Drivers contained in <code>gdevcd8.c</code></h3>
-
-<p>
-The source module <code>gdevcd8.c</code> contains one generic driver:</p>
-
-<blockquote>
-<table>
-<tr>
- <td><code>cdj880</code></td>
- <td>HP DeskJet 812, 815, 832, 880, 882, 895, and 970</td>
-</tr>
-</table>
-</blockquote>
-
-<h3><a name="HP880_further_documentation"></a>Further documentation</h3>
-
-<p>
-<b>Credits:</b> This driver is based on the cdj850 driver by Uli Wortmann, and shares the same
-internal structure, although the PCL3+ interpretation has changed.</p>
-
-<blockquote>
-<table>
- <tr>
- <th width="20%">Date</th>
- <th width="20%">Version</th>
- <th width="60%">Comments</th>
-</tr>
-
-<tr>
- <td>15.03.99</td>
-
- <td>Version 1.3</td>
-
- <td>Initial version, based on Version 1.3 of Uli Wortmann's driver.</td>
-</tr>
-<tr>
- <td>26.02.00</td>
-
- <td>Version 1.4beta</td>
-
- <td>Greatly improved color handling &amp; dithering, but not yet complete enough
- to use for text.</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-All printers are supported through the cdj880 device. Invoke with
-<code>-sDEVICE=cdj880</code>. The following switches are supported.</p>
-
-<blockquote>
-<table>
-<tr>
- <td><code>-dPapertype=</code></td>
-
- <td>0</td>
-
- <td>plain paper [default]</td>
-</tr>
-<tr>
- <td></td>
- <td>1</td>
-
- <td>bond paper</td>
-</tr>
-<tr>
- <td></td>
-
- <td>2</td>
-
- <td>special paper</td>
-</tr>
-<tr>
- <td></td>
-
- <td>3</td>
-
- <td>glossy film</td>
-</tr>
-<tr>
- <td></td>
-
- <td>4</td>
-
- <td>transparency film</td>
-</tr>
-<tr>
- <td></td>
- <td>&nbsp;</td>
- <td>Currently the lookup tables are unsuited for printing on
- special paper or transparencies. For these please revert to the
- gamma functions.</td>
-</tr>
-<tr>
- <td><code>-dQuality=</code></td>
-
- <td>-1</td>
-
- <td>draft</td>
-</tr>
-<tr>
- <td></td>
-
- <td>0</td>
-
- <td>normal [default]</td>
-</tr>
-<tr>
- <td></td>
-
- <td>1</td>
-
- <td>presentation</td>
-</tr>
-<tr>
- <td><code>-dMasterGamma=</code></td>
-
- <td>3.0</td>
-
- <td>[default = 1.0]</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-The printer default settings compensate for dot-gain by a pre-defined
-color-transfer function. If this appears to be too light for your business
-graphs, or for overhead transparencies, feel free to set
-<code>-dMasterGamma=1.7</code>. Furthermore, you may tweak the gamma
-values independently by setting <code>-dGammaValC</code>,
-<code>-dGammaValM</code>, <code>-dGammaValY</code> or
-<code>-dGammaValK</code> (if not set, the values default to
-<code>MasterGamma</code>). This will only work when
-<code>-dMasterGamma</code> is set to a value greater than 1.0.</p>
-
-<p>
-Further information, bugs, tips etc, can be found at my website.</p>
-
-<p>
-To compile with gs6.x or later, simply add to your makefile</p>
-<blockquote>
-DEVICE_DEVS4=&#36;(DD)cdj880.dev
-</blockquote>
-
-<p>
-Matthew Gelhaus &lt;<a href="mailto:hp880@gelhaus.net">mailto:hp880@gelhaus.net</a>&gt;
-<br><a href="http://www.gelhaus.net/hp880c/">http://www.gelhaus.net/hp880c/</a></p>
-
-<hr>
-
-<h2><a name="HP_color_inkjet"></a>H-P color inkjet printers</h2>
-
-<p>
-This section, written by George Cameron, deals with the DeskJet 500C,
-DeskJet 550C, PaintJet, PaintJet XL, PaintJet XL300, the DEC LJ250
-operating in PaintJet-compatible mode.</p>
-
-<h3><a name="HP_gdevcdj"></a>Drivers contained in <code>gdevcdj.c</code></h3>
-
-<p>
-The source module <code>gdevcdj.c</code> contains six generic drivers:</p>
-
-<blockquote>
-<table>
-<tr>
- <td><code>cdj500</code></td>
- <td>HP DeskJet 500C and 540C</td>
-</tr>
-<tr>
- <td><code>cdj550</code></td>
- <td>HP DeskJet 550C, 560C, 660C, 660Cse</td>
-</tr>
-<tr>
- <td><code>pjxl300</code></td>
- <td>HP PaintJet XL300, DeskJet 1200C, and CopyJet</td>
-</tr>
-<tr>
- <td><code>pjtest</code></td>
- <td>HP PaintJet</td>
-</tr>
-<tr>
- <td><code>pjxltest</code></td>
- <td>HP PaintJet XL</td>
-</tr>
-<tr>
- <td><code>declj250</code></td>
- <td>DEC LJ250</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-All these drivers have 8-bit (monochrome), 16-bit and 24-bit (colour) and
-for the DJ 550C, 32-bit (colour, CMYK mode) options in addition to standard
-colour and mono drivers. It is also possible to set various
-printer-specific parameters from the command line, for example</p>
-
-<blockquote><code>
-gs&nbsp;-sDEVICE=cDeskJet&nbsp;-dBitsPerPixel=16&nbsp;-dDepletion=1&nbsp;-dShingling=2&nbsp;tiger.eps
-</code></blockquote>
-
-<p>
-<b>Note:</b> the old names <code>cDeskJet</code>,
-<code>cdjcolor</code> and <code>cdjmono</code> drivers have been
-retained; however, their functionality duplicates that available using the
-drivers above (and <code>cDeskJet</code> is identical to
-<code>cdj500</code>). That is, we can use</p>
-
-<blockquote>
-<table>
-<tr>
- <td><code>gs -sDEVICE=cdj500 -dBitsPerPixel=24</code></td>
- <td>for <code>cdjcolor</code>, and</td>
-</tr>
-<tr>
- <td><code>gs -sDEVICE=cdj500 -dBitsPerPixel=1</code></td>
- <td>for <code>cdjmono</code></td>
-</tr>
-</table>
-</blockquote>
-
-<h3><a name="HP_paper_size"></a>Default paper size</h3>
-
-<p>
-If the preprocessor symbol <code>A4</code> is defined, the default paper
-size is ISO A4; otherwise it is U.S. letter size (see about
-<a href="Use.htm#Known_paper_sizes">paper sizes</a> in the usage
-documentation). You can <a href="Use.htm#Paper_size">specify other paper
-sizes</a> on the command line, including A3 for the PaintJet XL and
-PaintJet XL300, as also explained in the usage documentation.</p>
-
-<h3><a name="HP_limits"></a>DeskJet physical limits</h3>
-
-<p>
-The DeskJet's maximum printing width is 2400 dots, or 8 inches
-(20.32cm). The printer manuals say that the maximum recommended printing
-height on the page is 10.3 inches (26.16cm), but since this is obviously
-not true for A4 paper, and I have been unable to detect any problems in
-printing longer page lengths, this would seem to be a rather artificial
-restriction.</p>
-
-<p>
-All DeskJets have 0.5 inches (1.27cm) of unprintable bottom margin, due to the mechanical
-arrangement used to grab the paper. Side margins are approximately 0.25 inches (0.64cm)
-for U.S. letter paper, and 0.15 inches (0.38cm) for A4.</p>
-
-<h4><a name="HP_command_line"></a>Printer properties (command-line parameters)</h4>
-
-<p>
-Several printer "properties" have been implemented for these printers.
-Those available so far are all integer quantities, and thus may be
-specified, for instance, like</p>
-
-<blockquote>
-<code>gs -dBitsPerPixel=32 -dShingling=1</code> ...
-</blockquote>
-
-<p>
-which sets the <code>BitsPerPixel</code> parameter to 32 and the
-<code>Shingling</code> parameter to 1.</p>
-
-<h4><a name="HP_bpp"></a>Bits per pixel</h4>
-
-<p>
-If the preprocessor symbol <code>BITSPERPIXEL</code> is defined as an
-integer (see below for the range of allowable values), that number defines
-the default bits per pixel (bit depth) for the generic drivers. If the
-symbol is undefined, the default is 24 bits per pixel. It is, of course,
-still possible to specify the value from the command line as described
-below. Note also that the <code>cDeskJet</code>,
-<code>cdjcolor</code> and <code>cdjmono</code> drivers are unaffected
-by setting this symbol, as their default settings are predefined to be 1, 3
-and 24 respectively.</p>
-
-<p>
-All of the drivers in <code>gdevcdj.c</code> accept a command line
-option to set the <code>BitsPerPixel</code> property. This gives
-considerable flexibility in choosing various tradeoffs among speed,
-quality, colour, etc. The valid numbers are:</p>
-
-<blockquote>
-<table>
- <tr>
- <th width="15%">BITSPERPIXEL</th>
- <th width="85%">Comments</th>
- </tr>
-<tr>
- <td><strong>1</strong></td>
- <td>A standard Ghostscript monochrome driver, using black ink (by
- installing the separate mono cartridge in the case of the DeskJet 500C, or
- automatically for the other printers).</td>
-</tr>
-<tr>
- <td><b>3</b></td>
- <td>A standard Ghostscript colour driver, using internal dithering. This
- is fast to compute and to print, but the clustered dithering can lose some
- detail and colour fidelity.</td>
-</tr>
-<tr>
- <td><b>8</b></td>
- <td>An "error-diffusion" monochrome driver which uses Floyd-Steinberg
- dithering to print greyscale images. The patterns are much more randomised
- than with the normal clustered dithering, but the data files can be much
- larger and somewhat slower to print.</td>
-</tr>
-<tr>
- <td><b>16</b></td>
- <td>A "cheaper" version of the 24-bit driver, which generates
- Floyd-Steinberg colour dithered output using the minimum memory (this may
- be helpful when using Ghostscript has not been compiled using a 16-bit
- build environment). The quality can be almost as good as the 24-bit
- version.</td>
-</tr>
-<tr>
- <td><b>24</b></td>
- <td>A high-quality colour driver using Floyd-Steinberg dithering for
- maximum detail and colour range. However, it is very memory-intensive, and
- thus can be slow to compute. It tends to produce rather larger raw data
- files, so they can also take longer to print.</td>
-</tr>
-<tr>
- <td><b>32</b></td>
- <td>Only for the DeskJet 550C, which uses the black cartridge and the
- colour cartridge simultaneously (that is, CMYK printing). This printer can
- both be faster and give higher quality than the DeskJet 500C, because of
- the true black ink. (Note that the 24-bit mode also permits CMYK printing
- on this printer, and uses less memory). Any differences between 24-bit and
- 32-bit should be small.</td>
-</tr>
-</table>
-</blockquote>
-
-<h4><a name="HP_DeskJet_properties"></a>DeskJet properties</h4>
-
-<blockquote>
-<table>
-<tr>
- <th width="20%">Name</th>
- <th width="20%">Type</th>
- <th width="60%">Comments</th>
-</tr>
-<tr>
- <td><code>BlackCorrect</code></td>
-
- <td><code>int</code></td>
-
- <td>Colour correction to give better blacks when using the DJ500C in colour mode. For example, the default of 4 reduces the cyan component to 4/5. Range accepted: 0 - 9 (0 = none).</td>
-</tr>
-<tr>
- <td><code>Shingling</code></td>
-
- <td><code>int</code></td>
-
- <td>Interlaced, multi-pass printing: 0 = none, 1 = 50%, 2 = 25%, 2 is best and slowest.</td>
-</tr>
-<tr>
- <td><code>Depletion</code></td>
-
- <td><code>int</code></td>
-
- <td>"Intelligent" dot-removal: 0 = none, 1 = 25%, 2 = 50%, 1 best for graphics? Use 0 for transparencies.</td>
-</tr>
-</table>
-</blockquote>
-
-<h4><a name="HP_PaintJet_properties"></a>PaintJet XL300 / PaintJet XL properties</h4>
-
-<blockquote>
-<table>
-<tr>
- <th width="20%">Name</th>
- <th width="20%">Type</th>
- <th width="60%">Comments</th>
-</tr>
-<tr>
- <td><code>PrintQuality</code></td>
-
- <td><code>int</code></td>
-
- <td>Mechanical print quality: -1 = fast, 0 = normal, 1 = presentation. Fast mode reduces ink usage and uses single-pass operation for some media types. Presentation uses more ink and the maximum number of passes, giving slowest printing for highest quality</td>
-</tr>
-<tr>
- <td><code>RenderType</code></td>
-
- <td><code>int</code></td>
-
- <td><dl>
- <dt><dd><code>0&nbsp;</code>driver does dithering</dd></dt>
- <dt><dd><code>1&nbsp;</code>snap to primaries</dd></dt>
- <dt><dd><code>2&nbsp;</code>snap black to white, others to black</dd></dt>
- <dt><dd><code>3&nbsp;</code>ordered dither</dd></dt>
- <dt><dd><code>4&nbsp;</code>error diffusion</dd></dt>
- <dt><dd><code>5&nbsp;</code>monochrome ordered dither</dd></dt>
- <dt><dd><code>6&nbsp;</code>monochrome error diffusion</dd></dt>
- <dt><dd><code>7&nbsp;</code>cluster ordered dither</dd></dt>
- <dt><dd><code>8&nbsp;</code>monochrome cluster ordered dither</dd></dt>
- <dt><dd><code>9&nbsp;</code>user-defined dither (not supported)</dd></dt>
- <dt><dd><code>10&nbsp;</code>monochrome user-defined dither ns.</dd></dt>
- </dl></td>
-</tr>
-</table>
-
-<p>
-The PaintJet (non-XL) has no additional properties.</p>
-
-</blockquote>
-
-<h3><a name="HP_gamma"></a>Gamma correction</h3>
-
-<p>
-One consequence of using Floyd-Steinberg dithering rather than Ghostscript's
-default clustered ordered dither is that it is much more obvious that the
-ink dots are rather larger on the page than their nominal 1/180-inch or 1/300-inch
-size (clustering the dots tends to minimise this effect). Thus it is often
-the case that the printed result is rather too dark. A simple empirical
-correction for this may be achieved by preceding the actual PostScript
-file to be printed by a short file which effectively sets the gamma for
-the device, such as</p>
-
-<blockquote><code>
-gs ... gamma.ps colorpic.ps -c quit
-</code></blockquote>
-
-<p>
-where <code>gamma.ps</code> is</p>
-
-<blockquote>
-<pre>%!
-/.fixtransfer {
- currentcolortransfer 4 {
- mark exch
- dup type dup /arraytype eq exch /packedarraytype eq or
- 1 index xcheck and { /exec load } if
- 0.333 /exp load
- ] cvx 4 1 roll
- } repeat setcolortransfer
-} bind odef
-.fixtransfer
-/setpagedevice { setpagedevice .fixtransfer } bind odef</pre>
-</blockquote>
-
-<p>
-This does the gamma correction <b><em>after</em></b> whatever correction
-the device might be doing already. To do the correction
-<b><em>before</em></b> the current correction,</p>
-
-<blockquote>
-<pre>%!
-/.fixtransfer {
- currentcolortransfer 4 {
- mark 0.333 /exp load 4 -1 roll
- dup type dup /arraytype eq exch /packedarraytype eq or
- 1 index xcheck and { /exec load } if
- ] cvx 4 1 roll
- } repeat setcolortransfer
-} bind odef
-.fixtransfer
-/setpagedevice { setpagedevice .fixtransfer } bind odef</pre>
-</blockquote>
-
-<p>
-This example sets the gamma for R, G, and B to 3, which seems to work
-reasonably well in practice.</p>
-
-<h3><a name="HP_resolution_enhance"></a>HP's resolution-enhanced mode for Inkjet printers</h3>
-
-<p>
-This feature is available on HP's more recent inkjet printers, including
-the DeskJet 520 (mono), 540 (mono or colour) and 560C (mono and colour).
-The colour and monochrome drivers for the HP DeskJet 550c are (probably)
-the best you will get for use with Ghostscript, for the following reasons.</p>
-
-<p>
-These printers do not offer true 600&times;300dpi resolution. Those that
-print in colour are strictly 300&times;300dpi in colour mode, while in mono
-mode there is a pseudo 600&times;300dpi mode with the restriction that you
-can't print two adjacent dots. In effect what you have is 600dpi dot
-positioning, but on average you don't get more dots per line. This
-provides the possibility, for instance, to have sharper character outlines,
-because you can place dots on the edges nearer to their ideal positions.
-This is why it is worth doing.</p>
-
-<p>
-However, HP will not support user-level programming of this
-resolution-enhanced mode, one reason being that (I understand) all the dot
-spacing has to be done by the driver, and if you get it wrong, you can
-actually damage the print head.</p>
-
-<p>
-To summarise, you may lose a smidgin of (potential) text clarity using the
-550c drivers (<code>cdj550</code>, <code>cdjcolor</code>,
-<code>cdjmono</code> etc.), but other than that, they are the ones for
-the job.</p>
-
-<h3><a name="HP_tips"></a>General tips</h3>
-
-<p>
-For all the printers above, the choice of paper is critically important to
-the final results. The printer manuals suggest type of paper, but in
-general, smoother, less fibrous types give better results. In particular,
-the special ink-jet paper can make a big difference: colours are brighter,
-but most importantly, there is almost no colour bleed, even with adjacent
-areas of very heavy inking. Similarly the special coated transparencies
-also work well (and ordinary transparencies do not work at all!).</p>
-
-<p>
-The Unix procedure <a href="Unix-lpr.htm"><code>unix-lpr.sh</code></a>
-provides one example of setting up a multi-option colour PostScript
-<code>lpr</code> queue on Unix systems, and includes the ability to
-choose a range of different colour options and printer accounting and error
-logging.</p>
-
-<p>
-<b>Caveat emptor!</b> It is not always easy for me to test all of these
-drivers, as the only colour printer I have here is the DeskJet 500C. I rely
-on others to test drivers for the additional machines and report their
-findings back to me.</p>
-
-<hr>
-
-<h2><a name="BJC_8200"></a>Canon BJC-8200 printer</h2>
-
-<p>
-This section was contributed by the author of the <code>uniprint</code>
-configuration files for the Canon BJC-8200, Stephan C. Buchert &lt;<a
-href="mailto:scb@stelab.nagoya-u.ac.jp">scb@stelab.nagoya-u.ac.jp</a>&gt;.
-These files also handle the Japanese Canon F850 printer.</p>
-<p>
-Warning: Usage of this program is neither supported nor endorsed by
-the Canon corporation. Please see the Ghostscript <a
-href="Public.htm">license</a> regarding warranty.</p>
-
-<h3>Introduction</h3>
-
-<p>
-The Canon Bubble Jet printer BJC-8200 is designed for printing digital
-photos and halftone images. Software drivers for Windows 95-2000 and Mac are
-usually included and can be downloaded from the Canon web sites like
-<a href="http://consumer.usa.canon.com/bjc/bjc8200/">http://consumer.usa.canon.com/bjc/bjc8200/</a>
-for the US market. If these drivers cannot be used for some reason, then at
-present Ghostscript is probably the alternative giving the best results.</p>
-
-<p>
-The BJC-8200 has features not found among the specs of earlier bubble jet
-models (except the even more advanced BJC-8500) and is advertised to offer:</p>
-
-<ol>
-
-<li>microfine droplet technology;</li>
-
-<li>support for printing on a new type of paper, Photo Paper Pro;</li>
-
-<li>a printhead capable of printing up to 1200 DpI;</li>
-
-<li>individual ink tanks for 6 colors;</li>
-
-<li>an internal status monitor reporting low ink back to a driver;</li>
-
-<li>an optional color scanner cartridge for up to 600 DpI resolution.</li>
-
-</ol>
-
-<p>
-Access to features 5 and 6 requires use of the original Canon drivers for
-the foreseeable future. This README is about getting the printer features
-1-3 working with Ghostscript. No (re)compilation of Ghostscript is normally
-required.</p>
-
-<p>
-Ghostscript comes with a relatively highly configurable driver, called
-<a href="#Uniprint">uniprint</a>, for printers which understand raster
-images in various propriety formats. Most options for this driver are
-usually organized into files having the suffix ".upp." Ghostscript
-versions &gt;= 5.10 (or even earlier) include such uniprint control files
-for the Canon BJC-610. They work also well for some other Canon Bubble
-Jet models, for example for my BJC-35vII. But when using them for a
-BJC-8200 the result is unsatisfactory.</p>
-
-<h3>The uniprint control files for the BJC-8200</h3>
-
-<p>
-After some experimenting with the options for uniprint I have obtained quite
-satisfactory prints with my printer(*). This distribution includes six new
-uniprint control files:</p>
-
-<ul>
-<li>bj8pp12f.upp</li>
-<li>bj8hg12f.upp</li>
-<li>bj8gc12f.upp</li>
-<li>bj8oh06n.upp</li>
-<li>bj8ts06n.upp</li>
-<li>bj8pa06n.upp</li>
-</ul>
-
-<p>
-They are included in Ghostscript &gt;=6.21. For older versions you can put
-them anywhere in the Ghostscript search path (type "gs -h" to see the
-path), but should perhaps add the files to the directory with the
-other *.upp files. This is "/usr/share/ghostscript/gs6.01/lib" in my
-RedHat 6.1 Linux box with Aladdin Ghostscript 6.01.
-
-<p>
-Here is an explanation of my file name convention: the prefix "bj8" should
-perhaps be used for the Canon BJC-8200 and compatible (like the Japanese
-F850 and perhaps the non-Japanese BJC-8500) models. The next two letters
-indicate the print media:</p>
-
-<ul>
-<li>pp "Photo Paper Pro"</li>
-<li>hg "High Gloss Photo Film"</li>
-<li>gc "Glossy Photo Cards"</li>
-<li>oh "OHP transparencies"</li>
-<li>ts "T-shirt transfer"</li>
-<li>pa "Plain Paper"</li>
-</ul>
-
-<p>
-The numbers at positions 6 and 7 indicate the resolution</p>
-
-<ul>
-<li>12 1200x1200 DpIxDpI</li>
-<li>06 600x600 DpIxDpI</li>
-</ul>
-
-<p>
-The last letter stands for a quality factor that effects also the print
-speed (presumably related to the number of passes that the printhead makes).
-</p>
-<ul>
-<li>f highest quality</li>
-<li>n normal quality</li>
-</ul>
-
-<p>
-Printing a postcard size (~10x15 cm^2) image at 1200x1200 DpI^2 takes about
-3 minutes. The output of Ghostscript is then typically 4-5 MByte. The
-bootleneck seems to be the transfer of the raster image in run-length
-encoded Canon format to the printer (via the parallel port on my system) or
-the printer's speed, not Ghostscript or the uniprint renderer.</p>
-
-<h3>Further Optimization for the Canon BJC-8200</h3>
-
-<p>So far I have only experimented with the printer initialization code at the
-beginning of each page (-dupBeginPageCommand) and the resolution (-r). Other
-options, particularly the transfer arrays (-dupBlackTransfer,
--dupCyanTransfer, -dupMagentaTransfer, -dupYellowTransfer) and the margins
-(-dupMargins) were simply copied from the files for the BJC-610, but they
-may need to be changed for optimized performance.</p>
-
-<p>
-Here is information useful for changing or adding uniprint control files for
-the BJC-8200:</p>
-
-<p>
-In "-dupBeginPageCommand=..." use the line</p>
-
-<blockquote>
- 1b28 64 0400 04b0 04b0
-</blockquote>
-
-<p>
-for 1200x1200 resolution, and</p>
-
-<blockquote>
- 1b28 64 0400 0258 0258
-</blockquote>
-
-<p>
-for 600x600. The "-r" option in the control file must of course match this
-line. Other resolutions might work as well, but I didn't try.</p>
-
-<p>
-Crucial are the numbers in the lines like</p>
-
-<blockquote><pre>
- 1b28 63 0300 3005 04
- ^ ^
- Plain Paper 0 4 Highest quality
- OHP transparency 2 .
- T-shirt transfer 3 .
- Glossy Photo Film 5 .
- High Gloss Paper 6 0 Lowest quality
- Photo Paper Pro 9
-</pre></blockquote>
-
-<h3>Outlook</h3>
-
-<p>
-Presently uniprint can use the black (K), cyan (C), magenta (M), and
-yellow (Y) colors in the BJC-8200. The unused colors are photo (or
-light) cyan (c) and magenta (m). Also the Canon driver seems to use
-only CMYK, for example when printing on Photo Paper Pro in "Camera" or
-"SuperPhoto" mode. These modes supposedly produce prints of the best
-quality that the Canon driver can offer. Other modes of Canon driver
-do use up to all six color cartridges (CMYKcm). Therefore expanding
-uniprint's capabilities for six colors would be interesting, but it may
-not increase the output quality of 6-color printers such as the
-BJC-8200 drastically.</p>
-
-<p>
-More control files for uniprint could be added in order to offer more
-versatility for controlling the BJC-8200 within a Ghostscript
-installation. The number of possible combinations for media type, resolution
-and print quality factor is very large, many combinations would not make
-much sense, many might be used here and there, but relatively rarely. The
-user would have to remember a name for each combination that is used.</p>
-
-<p>
-A better way would be to let the user patch optionally a user owned or
-system wide uniprint control file before each print via some print
-tool. This is similar to the approach taken by Canon with their driver for
-Windows. Similarly a uniprint tool could also incorporate other functions
-such as printing test and demo pages and the low ink warning once the
-protocol for this is known. Clearly it would be difficult to code such a
-uniprint tool for all the platforms where Ghostscript is running.</p>
-
-<h3>Usage on RedHat Linux</h3>
-
-<p>
-In order to install a BJC-8200 printer on a RedHat Linux system with
-RedHat's printtool, you need also to insert with a text editor the contents
-of the file <code>bj8.rpd</code> into the RedHat printer database
-<code>/usr/lib/rhs/rhs-printfilters/printerdb</code>. Insert it most
-appropriately after the section</p>
-
-<blockquote><pre>
-StartEntry: U_CanonBJC610
-.
-.
-.
-EndEntry
-
-&lt; --- insert here "bj8.rpd" from this distribution:
-&lt; --- StartEntry: U_CanonBJC8200
- .
- .
- .
-</pre></blockquote>
-
-<h3>Contacting the Author</h3>
-
-<p>
-E-mail address: &lt;<a
-href="mailto:scb@stelab.nagoya-u.ac.jp">scb@stelab.nagoya-u.ac.jp</a>&gt;</p>
-
-<p>
-Footnotes:</p>
-
-<p>
-(*) Actually I have a F850, not a BJC-8200. That model is sold for the
-Japanese market only. The specs and also the external look are the
-same as those of the BJC-8200 models for the American and European
-markets. I expect that the raster image mode which is used exclusively
-by Ghostscript is entirely compatible for both models.</p>
-
-<p>
-Stephan C. Buchert</p>
-
-<hr>
-
-<h2><a name="BJC"></a>Other Canon BubbleJet (BJC) printers</h2>
-
-<p>
-This section was contributed by the author of the drivers, Yves Arrouye
-(&lt;<a href="mailto:yves.arrouye@usa.net">yves.arrouye@usa.net</a>&gt;, but
-please do not send questions to him: he no longer maintains these drivers.)
-The drivers handle Canon BJC-600, BJC-4xxx, BJC-70, Stylewriter 2x00, and
-BJC-800 printers.</p>
-
-<h3><a name="BJC_history"></a>History</h3>
-
-<p>
-The BJC-600 driver was written in the first place by Yoshio Kuniyoshi and
-later modified by Yves Arrouye. We tried to make it evolve synchronously,
-though Yoshio cannot be reached since a long time ago. The drivers are
-based on code for the HP printers by George Cameron (in fact, they are in
-the same file!), so he's the first person to thank.</p>
-
-<p>
-The 2.00 version of the drivers was a complete rewrite of the driver
-(arguments, optimization, colour handling, in short: everything!) by Yves
-Arrouye. That release was also the first one to be able to use the full
-width of an A3 paper size. PostScript Printer Description (PPD) files for
-the drivers were released with version 2.15. They are incomplete,
-but they can be used to drive the printers' main features.</p>
-
-<h3><a name="BJC_build"></a>Configuring and building the BJC drivers</h3>
-
-<h4><a name="BJC_defaults"></a>Modify values in
-<code>gdevbjc.h</code></h4>
-
-<p>
-Configure the drivers by modifying the default values in the file
-<code>gdevbjc.h</code> or on the compilation line. If you don't do
-that, the drivers use reasonable defaults that make them work "as
-expected". All default values shown here are defined in that file.</p>
-
-<h4><a name="BJC_CMYK_RGB"></a>CMYK-to-RGB color conversion</h4>
-
-<p>
-By default, the drivers use the same algorithm as Ghostscript to convert
-CMYK colors to RGB. If you prefer to use Adobe formulas, define
-<code>USE_ADOBE_CMYK_RGB</code> when compiling. (See the top of the
-file <code>gdevcdj.c</code> to see the difference between the two.)</p>
-
-<h4><a name="BJC_vertical_centering"></a>Vertical centering of the
-printable area</h4>
-
-<p>
-The drivers center the imageable area horizontally but not vertically, so
-that what can be printed does use the most of the output media. If you
-define <code>BJC_DEFAULT_CENTEREDAREA</code> when compiling, then the
-top and bottom margins will be the same, resulting in a (smaller)
-vertically centered imageable area also.</p>
-
-<h4><a name="BJC_margins"></a>Page margins</h4>
-
-<p>
-If you define <code>USE_RECOMMENDED_MARGINS</code>, then the top and
-bottom margins will be the same (that is,
-<code>BJC_DEFAULT_CENTEREDAREA</code> will be defined for you) and the
-margins will be the 12.4mm recommended by Canon. Since margins are
-complicated (because one must rely on the mechanical precision of the
-printer), the drivers do something about the bottom margin: by default the
-bottom margin is 9.54mm for the BJC-600 driver and 7mm for the BJC-800. If
-you define <code>USE_TIGHT_MARGINS</code>, then the bottom margin is 7mm
-for both drivers (but I never managed to get my own BJC-600 to print a line
-on this low bound, hence the larger default). Regardless of the presence
-of this definition, <code>USE_FIXED_MARGINS</code> will not allow the
-BJC-800 to use the lower 7mm bottom margin, so if you have a problem with
-the bottom margin on a BJC-800, just define that (without defining
-<code>USE_TIGHT_MARGINS</code>, of course).</p>
-
-<p>
-A quick way to be sure the margins you selected is to print a file whose
-contents are:</p>
-
-<blockquote><code>
-%!<br>
-clippath stroke showpage
-</code></blockquote>
-
-<p>
-If the margins are okay, you will get a rectangle visibly surrounding
-the printable area. If they're not correct, one or more of the sides will
-be either incomplete or completely unprinted.</p>
-
-<h4><a name="BJC_compile"></a>Makefile and compilation</h4>
-
-<p>
-Make sure the <code>bjc600</code> or <code>bjc800</code> devices are
-in <a href="Make.htm#Features_and_devices"><code>DEVICE_DEVS</code> in
-the makefile</a>; that is, look in the makefile for your platform and add
-them if necessary -- they may already be there. As of Ghostscript 5.10,
-for instance, one makefile has</p>
-
-<blockquote><code>
-DEVICE_DEVS6=bj10e.dev&nbsp;bj200.dev&nbsp;bjc600.dev&nbsp;bjc800.dev
-</code></blockquote>
-
-<h3><a name="BJC_usage"></a>Use of the drivers</h3>
-
-<p>
-There are two drivers here. The "<code>bjc600</code>" one supports the BJC-600 and
-BJC-4xxx (maybe the BJC-70 as well) and the "<code>bjc800</code>" one supports the
-BJC-800 series. Remarks here that apply to both drivers use the name
-"bjc".</p>
-
-<h4><a name="BJC_options"></a>Supported Options and Defaults</h4>
-
-<p>
-Note: "options", "properties", and "parameters" designate the same thing:
-device parameters that you can change.</p>
-
-<p>
-Giving an option an incorrect value causes an error. Unless stated
-otherwise, this error will be a rangecheckerror. Options may be set from
-the Ghostscript command line (using the <code>-d</code> and
-<code>-s</code> switches or other predetermined switches if they have an
-effect on the driver) or using the PostScript Level 2
-<code>setpagedevice</code> operator if Ghostscript has been compiled
-with the <code>level2</code> or <code>level3</code> device (which it should
-<code>;-)</code>). There are <b>no</b> special-purpose operators such as
-one was able to find in Level 1 printers.</p>
-
-<p>
-The bjc uses 24 bits per pixel by default (unless you change the value of
-<code>BJC_BITSPERPIXEL</code>), corresponding to CMYK printing.
-Supported modes are 1 bpp and 4 bpp (gray levels), 8 bpp, 16 bpp, 24 bpp
-and 32 bpp (colours). Colours are preferably stored in the CMYK model
-(which means, for example, that with 16 bpp there are only 16 different
-shades of each color) but it is possible to store them as RGB color for
-some depths. Some modes do Floyd-Steinberg dithering and some don't, but
-use the default Ghostscript halftoning (in fact, when halftoning is used,
-dithering takes also place but because of the low point density it is
-usually not efficient, and thus invisible).</p>
-
-<blockquote>
-
-
-<h4>Descriptions of printing modes by bpp and Colors</h4>
-
-
-<table>
-
-<tr>
- <th width="15%">bpp</th>
-
- <th width="15%">Colors</th>
-
- <th align="left" width="70%">Mode</th>
- </tr>
-<tr>
- <td>32</td>
-
- <td align="center">4</td>
-
- <td>CMYK colour printing, Floyd-Steinberg dithering</td>
-</tr>
-<tr>
- <td>24</td>
-
- <td align="center">4</td>
-
- <td>The same. (But each primary colour is stored on 6 bits instead of 8.)</td>
-</tr>
-<tr>
- <td>24</td>
-
- <td align="center">3</td>
-
- <td>RGB colour printing, Floyd-Steinberg dithering. This mode does
- <code>not</code> use the black cartridge (that's why it
- exists, for when you don't want to use it <code>;-)</code>).
- Each primary colour is stored in 8 bits as in the 32/4 mode,
- but black generation and under-color removal are done on the
- driver side and not by Ghostscript, so you have no control over
- it. (This mode is no longer supported in this driver.)</td>
-</tr>
-<tr>
- <td>16</td>
-
- <td align="center">4</td>
-
- <td>CMYK colour printing, halftoned by Ghostscript. F-S dithering
- is still visible here (but the halftone patterns are visible
- too!).</td>
-</tr>
-<tr>
- <td>8</td>
-
- <td align="center">4</td>
-
- <td>The same.(But each primary colour is stored in 2 bits instead of 4.)</td>
-</tr>
-<tr>
- <td>8</td>
-
- <td align="center">3</td>
-
- <td>RGB colour printing. This mode is not intended for use. What I
- mean is that it should be used only if you want to use custom
- halftone screens <b>and</b> the halftoning is broken using the
- 8/4 mode (some versions of Ghostscript have this problem).</td>
-</tr>
-<tr>
- <td>8</td>
-
- <td align="center">1</td>
-
- <td>Gray-level printing, Floyd-Steinberg dithering</td>
-</tr>
-<tr>
- <td>1</td>
-
- <td align="center">1</td>
-
- <td>Gray-level printing halftoned by Ghostscript</td>
- </tr>
-</table>
-</blockquote>
-
-<p>
-These modes are selected using the <code>BitsPerPixel</code> <b>and</b>
-<code>Colors</code> integer options (either from the command line or in
-a PostScript program using <code>setpagedevice</code>). See below.</p>
-
-<p>
-A note about darkness of what is printed: Canon printers do print dark,
-really. And the Floyd-Steinberg dithering may eventually darken your image
-too. So you may need to apply gamma correction by calling Ghostscript as in</p>
-
-<blockquote><code>
-gs -sDEVICE=bjc600 gamma.ps myfile.ps
-</code></blockquote>
-
-<p>
-where <code>gamma.ps</code> changes the gamma correction (here to 3 for
-all colors); 0.45 gives me good results, but your mileage may vary. The
-bigger the value the lighter the output:</p>
-
-<blockquote><code>
-{ 0.45 exp } dup dup currenttransfer setcolortransfer
-</code></blockquote>
-
-<p>
-The drivers support printing at 90dpi, 180dpi and 360dpi. Horizontal and
-vertical resolutions must be the same or a limitcheck error will happen. A
-rangecheck will happen too if the resolution is not
-90&nbsp;&times;2^<small><sup><b>N</b></sup></small>. If the driver
-is compiled with <code>-DBJC_STRICT</code> a rangecheck also happens if
-the resolution is not one of those supported. This is not the case, as we
-expect that there may be a 720dpi bjc some day.</p>
-
-<p>
-Here are the various options supported by the bjc drivers, along with
-their types, supported values, effects, and usage:</p>
-
-<dl>
- <dt><code>BitsPerPixel</code> (int)
- <dd>Choose the depth of the page. Valid values are 1, 8, 16, 24 (the
- default) and 32.
-
-<p>
-Note that when this is set for the first time, the <code>Colors</code>
-property is automatically adjusted unless it is also specified. The table
-here shows the corresponding color models and the rendering method visible:
-"GS" for Ghostscript halftoning and "F-S" for Floyd-Steinberg dithering.
-When both are present it means that the dithering of halftones is visible.
-Default choices are indicated by asterisk "*".</p>
-
-<blockquote>
- <h4>Valid colors values for allowed BitsPerPixel values</h4>
-<table>
-
-<tr>
- <th>bpp</th>
- <th>Colors</th>
- <th>Default</th>
- <th>Color model</th>
- <th>Dithering</th>
-</tr>
-<tr>
- <td align="center">32</td>
- <td align="center">4</td>
- <td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
- <td>CMYK</td>
- <td>F-S</td>
-</tr>
-<tr>
- <td align="center">24</td>
- <td align="center">4</td>
- <td><b>*</b></td>
- <td>CMYK</td>
- <td>F-S</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="center">3</td>
- <td>&nbsp;</td>
- <td>RGB</td>
- <td>F-S</td>
-</tr>
-<tr>
- <td align="center">16</td>
- <td align="center">4</td>
- <td>&nbsp;</td>
- <td>CMYK</td>
- <td>GS, F-S</td>
- </tr>
-<tr>
- <td align="center">8</td>
- <td align="center">4</td>
- <td><b>*</b></td>
- <td>CMYK</td>
- <td>GS</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="center">3</td>
- <td>&nbsp;</td>
- <td>RGB</td>
- <td>GS</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="center">1</td>
- <td>&nbsp;</td>
- <td>K (CMYK</td>
- <td>F-S</td>
-</tr>
-<tr>
- <td align="center">1</td>
- <td align="center">1</td>
- <td><b>*</b></td>
- <td>K (CMYK)</td>
- <td>GS</td>
-</tr>
-</table>
-</blockquote>
-
-<p>Also note that automagical change of one parameter depending on the
-other one does not work in a <code>setpagedevice</code> call. This
-means that if you want to change <code>BitsPerPixel</code> to a value
-whose valid <code>Colors</code> values do not include the actual
-<code>Colors</code> value, you must change <code>Colors</code> too.</p>
-</dl>
-
-<dl>
-<dt><code>Colors</code> (int)
-<dd>Choose the number of color components from among 1, 3 and 4 (the
-default). This setting cannot be used in a PostScript program, only on
-Ghostscript's command line. See <code>ProcessColorModel</code> below
-for what to use to change the number of colors with PostScript code.
-
-<p>
-Note that setting this property does limit the choices of
-<code>BitsPerPixel</code>. As for the previous property, its first
-setting may induce a setting of the "other value"
-(<code>BitsPerPixel</code> here). The table here indicates valid
-combinations with "V", default values with asterisk "*".</p>
-
-<blockquote><table>
-<tr>
- <th colspan="7">Valid BitsPerPixel values for allowed Colors values</th>
-</tr>
-<tr>
- <td colspan="7" align="right">BitsPerPixel OK values</td>
-</tr>
-<tr>
- <td>Colors</td>
- <td>Type</td>
- <td>32</td>
- <td>24</td>
- <td>16</td>
- <td>8</td>
- <td>1</td>
-</tr>
-<tr>
- <td>4</td>
- <td>CMYK</td>
- <td><b>V</b></td>
- <td><b>*</b></td>
- <td><b>V</b></td>
- <td><b>V</b></td>
- <td></td>
-</tr>
-<tr>
- <td>3</td>
- <td>RGB</td>
- <td>&nbsp;</td>
- <td><b>*</b></td>
- <td>&nbsp;</td>
- <td><b>V</b></td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td>1</td>
- <td>K</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td><b>V</b></td>
- <td><b>*</b></td>
-</tr>
-</table>
-</blockquote>
-
-<p>Also note that automagical change of one parameter depending on the
-other one does not work in a <code>setpagedevice</code> call. This
-means that if you want to change <code>Colors</code> to a value whose
-valid <code>BitsPerPixel</code> values don't include the actual
-<code>BitsPerPixel</code> value, you must change
-<code>BitsPerPixel</code> too.</p>
-</dl>
-
-<dl>
-<dt><code>ProcessColorModel</code> (symbol)</dt>
-<dd>A symbol taken from <code>/DeviceGray</code>,
-<code>/DeviceRGB</code> or <code>/DeviceCMYK</code> which can be used
-to select 1, 3 or 4 colors respectively. Note that this parameter takes
-precedence over <code>Colors</code>, and that both affect the same
-variable of the driver. (See <code>Colors</code> above for values
-combined with <code>BitsPerPixel</code>.)</dd>
-</dl>
-
-<dl>
-<dt><code>HWResolution</code> (floats array)</dt>
-<dd>An array of two floats giving the horizontal and vertical resolution in
-dots per inch from among 90, 180 and 360 (the default). Both values must
-be the same. On the Ghostscript command line, the resolution may be
-changed with the <a href="Use.htm#Resolution_switch"><code>-r</code>
-switch</a>.</dd>
-</dl>
-
-<dl>
-<dt><code>ManualFeed</code> (bool)</dt>
-<dd>Indicate that the sheets won't be fed automatically by the printer,
-<code>false</code> by default. (Not meaningful on the BJC-600, I fear.)</dd>
-</dl>
-
-<dl>
-<dt><code>MediaType</code> (string)</dt>
-<dd>The media to print on, chosen from among "<code>PlainPaper</code>",
-"<code>CoatedPaper</code>", "<code>TransparencyFilm</code>",
-"<code>Envelope</code>", "<code>Card</code>" and
-"<code>Other</code>". Default is "<code>PlainPaper</code>". For
-"<code>Envelope</code>", "<code>Card</code>" or
-"<code>Other</code>" the driver puts the printer into thick mode
-automatically regardless of the actual media weight.</dd>
-</dl>
-
-<dl>
-<dt><code>MediaWeight</code> (int or null)</dt>
-<dd>The weight of the media in grams per square meter. Null (the default)
-indicates that the weight is of no importance. If the specified media
-weight is greater than 105 (that is, the value of the compilation default
-<code>BJC</code>???<code>_MEDIAWEIGHT_THICKLIMIT</code>) then the
-printer will be set to use thick paper.</dd>
-</dl>
-
-<dl>
-<dt><code>PrintQuality</code> (string)</dt>
-<dd>The quality of printing.</p>
-<table>
-<tr colspan="4">
- <th>Value</th>
- <th>bjc600</th>
- <th>bjc800</th>
- <th>Comments</th>
-</tr>
-<tr>
- <td><code>Low</code></td>
- <td>&nbsp;</td>
- <td align="center"><b>X</b></td>
- <td>Has the effect of making only two printing passes instead of four, so should be twice the speed; known as "CN" (Color Normal) mode</td>
-</tr>
-<tr>
- <td><code>Draft</code></td>
- <td align="center"><b>X</b></td>
- <td align="center"><b>X</b></td>
- <td>Unlights the "HQ" light on a BJC-600</td>
-</tr>
-<tr>
- <td><code>Normal</code></td>
- <td align="center"><b>X</b></td>
- <td align="center"><b>X</b></td>
- <td>Default for both drivers; lights the "HQ" light on a BJC-600</td>
-</tr>
-<tr>
- <td><code>High</code></td>
- <td align="center"><b>X</b></td>
- <td align="center"><b>X</b></td>
- <td>Means 200% black and 100% CMY; lights the "Bk+" light on a BJC-600</td>
-</tr>
-</table>
-</dd>
-
-</dl>
-
-<dl>
-<dt><code>DitheringType</code> (string)
-<dd>Dithering algorithm from between "<code>Floyd-Steinberg</code>" and
-"<code>None</code>". "<code>None</code>" is the default for 1/1 print
-mode, "<code>Floyd-Steinberg</code>" for other modes. At the moment
-this parameter is read-only, though no error is generated if one tries to
-change it. This parameter is not of much value at the moment and is here
-mainly to reserve the name for future addition of dithering algorithms.
-</dl>
-
-<dl>
-<dt><code>PrintColors</code> (int)
-<dd>Mask for printing color. If 0, use black for any color; otherwise the
-value must be the sum of any of 1 (cyan), 2 (magenta), 4 (yellow) and 8
-(black), indicating which colors will be used for printing. When printing
-colour, only colours specified will be printed (this means that some planes
-will be missing if a color's value above is omitted). When printing grays,
-black is used if it is present in the <code>PrintColors</code>;
-otherwise, the image is printed by superimposing each requested color.
-</dl>
-
-<dl>
-<dt><code>MonochromePrint</code> (bool)
-<dd><b>For <tt>bjc600</tt> only</b>, <code>false</code> by default.
-Substitute black for Cyan, Magenta and Yellow when printing -- useful, for
-example, to get some monochrome output of a dithered printing This is a
-hardware mechanism as opposed to the previous software one. I think that
-using this or setting <code>PrintColors</code> to 0 will give the same
-results.
-</dl>
-
-<p>
-Note that the <code>MediaType</code> and <code>ThickMedia</code>
-options will be replaced by the use of the device
-<code>InputAttributes</code> and <code>OutputAttributes</code> as
-soon as possible. Please note too that the print mode may be reset at the
-start of printing, not at the end. This is the expected behaviour. If you
-need to reset the printer to its default state, simply print a file that
-does just a <code>showpage</code>.</p>
-
-<h4><a name="BJC_device_info"></a>Device information</h4>
-
-<p>
-Here is other information published by the driver that you will find
-in the <code>deviceinfo</code> dictionary.</p>
-
-<dl>
-<dt><code>OutputFaceUp</code> (bool)
-<dd>This has the boolean value <code>true</code>, indicating that the
-sheets are stacked face up.
-</dl>
-
-<dl>
-<dt><code>Version</code> (float)
-<dd>In the form <b>M.</b><em>mm</em>pp, where <b>M</b> is the major
-version, <em>mm</em> the bjc driver's minor version, and pp the specific
-driver minor version (that is, <code>M.</code><em>mm</em> will always be
-the same for the <code>bjc600</code> and <code>bjc800</code>
-drivers).
-</dl>
-
-<dl>
-<dt><code>VersionString</code> (string)
-<dd> A string showing the driver version and other indications. At the
-moment, things like "a" or "b" may follow the version to indicate alpha or
-beta versions. The date of the last change to this version is given in the
-form MM/DD/YY (no, it won't adapt to your locale).
-</dl>
-
-<h4><a name="BJC_HW_margins"></a>Hardware margins</h4>
-
-<p>
-The BJC printers have top and bottom hardware margins of 3mm and 7.1mm
-respectively (Canon says 7mm, but this is unusable because of the rounding
-of paper sizes to PostScript points). The left margin is 3.4mm for A4 and
-smaller paper sizes, 6.4mm for U.S. paper sizes, envelopes and cards. It
-is 4.0mm for A3 paper on the BJC-800.</p>
-
-<p>
-The maximum printing width of a BJC-600 printer is 203mm. The maximum
-printing width of a BJC-800 printer is 289mm on A3 paper, 203mm on
-U.S. letter and ISO A4 paper.</p>
-
-<h4><a name="BJC_PPD"></a>PostScript printer description (PPD) files</h4>
-
-<p>
-The files <code>CBJC600.PPD</code> and <code>CBJC800.PPD</code> (whose
-long names are, respectively, <code>Canon_BubbleJetColor_600.ppd</code>
-and <code>Canon_BubbleJetColor_800.ppd</code>) are PPD files to drive the
-features of the <code>bjc600</code> and <code>bjc800</code> drivers.
-They can be used, for example, on NextStep systems (presumably on OpenStep
-systems too) and on Unix systems with Adobe's TranScript and
-<code>pslpr</code> (not tested). The files are not complete at the
-moment. Please note that NextStep's printing interface does not
-correctly enforce constraints specified in these files (in UIConstraints
-descriptions): you must force yourself to use valid combinations of
-options.</p>
-
-<h4><a name="BJC_PPD_custom"></a>Customizing the PPD files</h4>
-
-<p>
-By default the PPD files are set for U.S. letter size paper, and they use a
-normalized transfer function. If you choose to use A4 printing by default,
-you must replace "<code>Letter</code>" with "<code>A4</code>" in
-these (noncontiguous) lines:</p>
-
-<blockquote>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[...]<br>
-<code>*DefaultPageSize: Letter<br></code>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[...]<br>
-<code>*DefaultRegion: Letter<br></code>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[...]<br>
-<code>*DefaultImageableArea: Letter</code><br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[...]<br>
-</blockquote>
-
-<p>
-Some versions of Ghostscript have problems with normalized colors, which
-makes them add magenta in gray levels. If you experience this problem,
-in the PPD file replace the line</p>
-
-<blockquote><code>
-*DefaultTransfer: Normalized
-</code></blockquote>
-
-<p>
-with the alternate line</p>
-
-<blockquote><code>
-*DefaultTransfer: Null
-</code></blockquote>
-
-<p>
-The "thick media" option is implemented by choosing a value of 120 or 80
-(for thick and thin media respectively) for the <code>MediaWeight</code>
-feature of the drivers. If you ever change the threshold for thick media
-in the driver code, you may need to change the values in the PPD files too.</p>
-
-<p>
-All customization should be done using the "<code>*Include:</code>"
-feature of PPD files so that your local changes will be retained if you
-update the PPD files.</p>
-
-<h3><a name="BJC_bugs"></a>How to report problems</h3>
-
-<p>
-Yves Arrouye no longer maintains this driver, and will not answer questions
-about it. If you are posting a question about it in a public form, please
-be as descriptive as possible, and please send information that can be used
-to reproduce the problem. Don't forget to say which driver you use, and in
-what version. Version information can be found in the source code of the
-driver or by issuing the following command in a shell:</p>
-
-<blockquote><code>
-echo&nbsp;"currentpagedevice&nbsp;/VersionString&nbsp;get&nbsp;=="&nbsp;|&nbsp;gs&nbsp;-q&nbsp;-sDEVICE=bjc600&nbsp;-
-</code></blockquote>
-
-<h3><a name="BJC_acks"></a>Acknowledgements</h3>
-
-<p>
-I am particularly grateful to Yoshio Kuniyoshi &lt;<a
-href="mailto:yoshio@nak.math.keio.ac.jp">yoshio@nak.math.keio.ac.jp</a>&gt;
-without whom I'd never make these drivers, and also to L. Peter Deutsch,
-who answered all my (often silly) questions about Ghostscript's driver
-interface.</p>
-
-<p>
-Thanks also to the people who volunteered to beta-test the v2.x BJC
-drivers: David Gaudine
-&lt;<a href="mailto:david@donald.concordia.ca">david@donald.concordia.ca</a>&gt;,
-Robert M. Kenney &lt;<a href="mailto:rmk@unh.edu">rmk@unh.edu</a>&gt;,
-James McPherson
-&lt;<a href="mailto:someone@erols.com">someone@erols.com</a>&gt;
-and Ian Thurlbeck
-&lt;<a href="mailto:ian@stams.strath.ac.uk">ian@stams.strath.ac.uk</a>&gt;
-(listed alphabetically) were particularly helpful by discovering bugs and
-helping find out exact paper margins on printers I don't have access to.</p>
-
-<p>
-And many thanks to Klaus-Gunther Hess
-&lt;<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>&gt; for looking
-at the dithering code and devising a good CMYK dithering algorithm for the
-Epson Stylus Color, which I then adapted to the code of these drivers.</p>
-
-<hr>
-
-<h2><a name="STC_epson_stylus"></a>Epson Stylus color printer (see also <code>uniprint</code>)</h2>
-
-<p>
-This section was contributed by Gunther Hess
-&lt;<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>&gt;, who also wrote
-<code>uniprint</code>, a later set of drivers. You should probably see
-the section on <a href="#Uniprint"><code>uniprint</code></a> for whether
-it might be better for your uses than this driver.</p>
-
-<h3><a name="STC_usage"></a>Usage</h3>
-
-<p>
-
-This driver is selected with "<code>-sDEVICE=stcolor</code>", producing
-output for an Epson Stylus Color at 360dpi resolution by default. But it
-can do much more with this printer, and with significantly better quality,
-than with the default mode; and it can also produce code for monochrome
-versions of the printer. This can be achieved via either command-line
-options or Ghostscript input. For convenience a PostScript file is
-supplied for use as an initial input file. Try the following command:</p>
-
-<blockquote>
-<code>gs -sDEVICE=stcolor -r</code><b>{Xdpi}</b><code>x</code><b>{Ydpi}</b><code> stcolor.ps</code> <b>{YourFile.ps}</b>
-</blockquote>
-
-<p>
-where <b>{Xdpi}</b> is one of 180, 360, or 720 and <b>{Ydpi}</b> is one of
-90, 180, 360, or 720. The result should be significantly better. You may
-use <code>stcolor.ps</code> with other devices too, but I do not
-recommend this, since it does nothing then. <code>stcolor.ps</code>
-should be available with binary distributions and should reside in the same
-directory as other Ghostscript initialization files or in the same
-directory as the files to be printed. Thus if Ghostscript is part of your
-printer-spooler, you can insert</p>
-
-<blockquote><code>
-(stcolor.ps) findlibfile { pop run } if pop
-</code></blockquote>
-
-<p>
-in files you want to use the improved algorithms. You may want to adapt
-<code>stcolor.ps</code> file to your specific needs. The methods and
-options for this are described here, but this description is restricted to
-Ghostscript options, while their manipulation at the PostScript level is
-documented in the material on <a href="Language.htm">the relationship of
-Ghostscript and PostScript</a> and in <code>stcolor.ps</code>.</p>
-
-<h3><a name="STC_options"></a>Options</h3>
-
-<p>
-Now to explain the options (as written on my UNIX system). The order is
-somehow related to their use during the printing process:</p>
-
-<dl>
-<dt><code>-dUnidirectional</code>
-<dd>Force unidirectional printing, recommended for transparencies
-</dl>
-
-<dl>
-<dt><code>-dMicroweave</code>
-<dd>Enable the printer's "microweave" feature; see
-"<a href="#What_is_weaving">What is weaving?</a>" below.
-</dl>
-
-<dl>
-<dt><code>-dnoWeave</code>
-<dd>Disable any Weaving (overrides <code>-dMicroweave</code>)
-</dl>
-
-<dl>
-<dt><code>-dSoftweave</code>
-<dd>Enable the driver's internal weaving. Note that <code>Softweave</code> works <b>only</b> with the original Stylus Color and the PRO-Series.
-</dl>
-
-<dl>
-<dt><code>-sDithering=</code><em>{name}</em>
-<dd>Select another dithering algorithm (name) from among:
-<blockquote>
-<table>
-
- <tr>
- <th width="25%">Dithering name</th>
- <th width="75%">Comments</th>
- </tr>
-<tr>
- <td><code>gscmyk</code></td>
-
- <td>fast color output, CMYK process color model (default)</td>
-</tr>
-<tr>
- <td><code>gsmono</code></td>
-
- <td>fast monochrome output</td>
-</tr>
-<tr>
- <td><code>gsrgb</code></td>
-
- <td>fast color output, RGB process color model</td>
-</tr>
-<tr>
- <td><code>fsmono</code></td>
-
- <td>Floyd-Steinberg, monochrome</td>
-</tr>
-<tr>
- <td><code>fsrgb</code></td>
-
- <td>Floyd-Steinberg, RGB process color model (almost identical to the <code>cdj550</code>/<code>bjc</code> algorithm)</td>
-</tr>
-<tr>
- <td><code>fsx4</code></td>
-
- <td>Floyd-Steinberg, CMYK process color model (shares code with <code>fsmono</code> and <code>fsrgb</code>, but is algorithmically really bad)</td>
-</tr>
-<tr>
- <td><code>fscmyk</code></td>
-
- <td>Floyd-Steinberg, CMYK process color model and proper modifications for CMYK</td>
-</tr>
-<tr>
- <td><code>hscmyk</code></td>
-
- <td>modified Floyd-Steinberg with CMYK model ("hs" stands for "hess" not for "high speed", but the major difference from <code>fscmyk</code> is speed)</td>
-</tr>
-<tr>
- <td><code>fs2</code></td>
-
- <td>algorithm by Steven Singer (RGB) should be identical to <code>escp2cfs2</code>.</td>
-</tr>
-</table>
-</blockquote>
-</dl>
-
-<dl>
-<dt><code>-dBitsPerPixel=</code><em>{1...32}</em>
-<dd>number of bits used for pixel storage; the larger the value, the better
-the quality -- at least in theory. In <code>fsrgb</code> one can gain
-some speed by restricting to 24 bits rather than the default 30.
-</dl>
-
-<dl>
-<dt><code>-dFlag0</code>
-<dd>causes some algorithms to select a uniform initialisation rather than a
-set of random values. May yield a sharper image impression at the cost of
-dithering artifacts. (Applies to <code>hscmyk</code> and all fs modes,
-except for fs2, which always uses a constant initialization.)
-</dl>
-
-<dl>
-<dt><code>-dFlag1</code> ... <code>-dFlag4</code>
-<dd>Available for future algorithms.
-</dl>
-
-<dl>
-<dt><code>-dColorAdjustMatrix='{</code><em>three, nine, or sixteen
-floating-point values</em><code>}'</code>
-<dd>This is a matrix to adjust the colors. Values should be between -1.0
-and 1.0, and the number of values depends on the color model the selected
-algorithm uses. In RGB and CMYK modes a matrix with 1.0 on the diagonal
-produces no transformation. This feature is really required, but I could
-not identify a similar feature at the language level, so I implemented it,
-but I don't know reasonable values yet.
-</dl>
-
-<dl>
-<dt><code>-dCtransfer='{</code><em>float float ...</em><code>}'</code> or
-<dt><code>-dMtransfer=</code>..., <code>-dY</code>..., <code>-dK</code>... or
-<dt><code>-dRtransfer='{</code><em>float float ...</em><code>}'</code> or
-<dt><code>-dG</code>..., <code>-dB</code>... or
-<dt><code>-dKtransfer='{</code><em>float float ...</em><code>}'</code>
-<dd>Which you use depends on the algorithm, which may be either either
-CMYK, RGB or monochrome. The values are arrays of floats in the range from
-0 to 1.0, representing the visible color intensity for the device. One may
-achieve similar effects with <code>setcolortransfer</code> at the
-language level, but this takes more time and the underlying code for the
-driver-specific parameters is still required. The size of the arrays is
-arbitrary and the defaults are "<code>{0.0&nbsp;1.0}</code>", which is a
-linear characteristic. Most of the code in <code>stcolor.ps</code> are
-better transfer arrays.
-</dl>
-
-<dl>
-<dt><code>-dKcoding='{</code><em>float...</em><code>}'</code>
-<dt><code>-dC</code>..., <code>-dM</code>... etc.
-<dd>Arrays between 0.0 and 1.0, controlling the internal coding of the
-color values. Clever use of these arrays may yield further enhancements,
-but I have no experience yet. (To be discontinued with version 2.x.)
-</dl>
-
-<dl>
-<dt><code>-sModel=st800</code>
-<dd>Causes output to be suitable for the monochrome Stylus 800 (no weaving,
-no color).
-</dl>
-
-<dl>
-<dt><code>-sOutputCode=</code><em>{name}</em>
-<dd>Can be either "<code>plain</code>", "<code>runlength</code>" or
-"<code>deltarow</code>" and changes the ESC/P2 coding technique
-used by the driver. The default is to use runlength encoding.
-"<code>plain</code>" selects uncompressed encoding and generates
-enormous amounts of data.
-</dl>
-
-<dl>
-<dt><code>-descp_Band=</code><em>1/8/15/24</em>
-<dd>Number of nozzles of scanlines used in printing, Useful only with
-<code>-dnoWeave</code>. Larger Values yield smaller code, but this
-doesn't increase the printing speed.
-</dl>
-
-<dl>
-<dt><code>-descp_Width=</code><em>N</em>
-<dd>Number of pixels Printed in each scan Line. (Useful only when tuning
-margins; see below)
-</dl>
-
-<dl>
-<dt><code>-descp_Height=</code><em>pixels</em>
-<dd>Length of the entire page in pixels. (Parameter of
-"<code>ESC(C</code>" in default initialization.)
-</dl>
-
-<dl>
-<dt><code>-descp_Top=</code><em>scan lines</em>
-<dd>Top margin in scan lines. (First parameter of "<code>ESC(c</code>"
-in default initialization.)
-</dl>
-
-<dl>
-<dt><code>-descp_Bottom=</code><em>scan lines</em>
-<dd>Bottom margin in scan lines. (Second parameter of
-"<code>ESC(c</code>" in default initialization.)
-</dl>
-
-<dl>
-<dt><code>-sescp_Init=</code>"<em>string</em>"
-<dd>Override for the initialization sequence. (Must set graphics mode 1
-and units.)
-</dl>
-
-<dl>
-<dt><code>-sescp_Release=</code>"<em>string</em>"
-<dd>Overrides the release sequence, "<code>ESC&nbsp;@&nbsp;FF</code>" by
-default.
-</dl>
-
-<p>
-ESC/P2 allows any resolutions to be valid in theory, but only
-<code>-r360x360</code> (the default) and <code>-r720x720</code> (not
-on STC-IIs ? and st800) are known to work with most printers.</p>
-
-<blockquote>
-<table>
-<tr>
- <th colspan="4">Valid option combinations – Stylus I &amp; Pro-Series only</th>
- </tr>
-<tr>
- <td>Resolution</td>
- <td><code>escp_Band</code></td>
- <td>Weave usable</td>
- <td><code>escp_Band</code> &amp;<br>number of passes</td>
-</tr>
-<tr>
- <td>180x90</td>
- <td>15</td>
- <td><code>noWeave</code></td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td>180x180</td>
- <td>1, 8, 24</td>
- <td><code>noWeave</code>, <code>Microweave</code></td>
- <td>15/2 <code>SoftWeave</code></td>
-</tr>
-<tr>
- <td>180x360</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>15/4 <code>SoftWeave</code></td>
-</tr>
-<tr>
- <td>180x720</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>15/8 <code>SoftWeave</code></td>
-</tr>
-<tr>
- <td>360x90</td>
- <td>15</td>
- <td><code>noWeave</code></td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td>360x180</td>
- <td>1, 8, 24</td>
- <td><code>noWeave</code>, <code>Microweave</code></td>
- <td>15/2 <code>SoftWeave</code></td>
-</tr>
-<tr>
- <td>360x360</td>
- <td>1, 8, 24</td>
- <td><code>noWeave</code>, <code>Microweave</code></td>
- <td>15/4 <code>SoftWeave</code></td>
-</tr>
-<tr>
- <td>360x720</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>15/8 <code>SoftWeave</code></td>
-</tr>
-<tr>
- <td>720x90</td>
- <td>15</td>
- <td><code>noWeave</code></td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td>720x180</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>15/2 <code>SoftWeave</code></td>
-</tr>
-<tr>
- <td>720x360</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>15/4 <code>SoftWeave</code></td>
-</tr>
-<tr>
- <td>720x720</td>
- <td>1</td>
- <td><code>noWeave</code>, <code>Microweave</code></td>
- <td>15/8 <code>SoftWeave</code></td>
-</tr>
-</table>
-</blockquote>
-
-<blockquote>
-<b>Beware:</b> there are only few validity checks for parameters. A good
-example is <code>escp_Band</code>: if you set this, the driver uses your
-value even if the value is not supported by the printer. <b>You asked for
-it and you got it!</b>
-</blockquote>
-
-<h3><a name="STC_FAQ"></a>Application note and FAQ</h3>
-
-<p>
-Quite a bunch of parameters. Hopefully you never need any of them, besides
-feeding <code>stcolor.ps</code> to Ghostscript in front of your input.</p>
-
-<p>
-After answering some questions over fifty times I prepared a FAQ. Here is
-version 1.3 of the FAQ, as of <code>stcolor</code> version 1.20 (for
-Ghostscript 3.50).</p>
-
-<h4><a name="STC_FAQ_A3"></a>Support for A3 paper</h4>
-
-<p>
-Yes, this driver supports the A3-size printer: merely set the required
-pagesize and margins. A simple way to do this is to specify the
-command-line switch "<code>-sPAPERSIZE=a3</code>" or include the
-procedure call "<code>a3</code>" in the PostScript prolog section. To
-optimize the printable area or set the proper margins, see the next
-paragraph.</p>
-
-<h4><a name="STC_FAQ_margins"></a>Margins, PageSize</h4>
-
-<p>
-I refuse to add code to <code>stcolor</code> that tries to guess the
-proper margins or page size, because I found that such guessing is usually
-wrong and needs correction in either the source or the parameters. You can
-modify <code>stcolor.ps</code> to do that, however. After the line</p>
-
-<blockquote><code>
-mark % prepare stack for "putdeviceprops"
-</code></blockquote>
-
-<p>
-insert these lines, which define page size and margins in points:</p>
-
-<blockquote>
-<pre>/.HWMargins [9.0 39.96 12.6 9.0] % Left, bottom, right, top (1/72")
-/PageSize [597.6 842.4] % Paper, including margins (1/72")
-/Margins [ % neg. Offset to Left/Top in Pixels
- 4 index 0 get STCold /HWResolution get 0 get mul 72 div neg
- 5 index 3 get STCold /HWResolution get 1 get mul 72 div neg
-]</pre></blockquote>
-
-<p>
-Feel free to change the values of <code>.HWMargins</code> and
-<code>PageSize</code> to match your needs; the values given are the
-defaults when the driver is compiled with "<code>-DA4</code>". This
-option or its omission may cause trouble: the Stylus Color can print up to
-exactly 8 inches (2880 pixels) at 360dpi. The remaining paper is the
-margin, where the left margin varies only slightly with the paper size,
-while the right margin is significantly increased for wider paper, such as
-U.S. letter size.</p>
-
-<p>
-<b>Note</b> that if you are using an ISO paper size with a version of
-<code>stcolor</code> after 1.20 and compiled without
-"<code>-DA4</code>", then the default margin is too large, and you need
-to add the proper "<code>.HWMargins</code>" to the command line or to
-<code>stcolor.ps</code>.</p>
-
-<h4><a name="STC_FAQ_II_IIS_1500"></a>Stylus Color II / IIs and 1500</h4>
-
-<p>
-First the good news: the driver can print on the Stylus Color II.
-Now the bad news:</p>
-<ul>
-<li>According to Epson support the driver "abuses" the color
-capabilities. (See "Future Plans" for details.)</li>
-<li>You need some parameters on the command line (or in
-<code>stcolor.ps</code>).</li>
-<li>I doubted that it would be usable with the Stylus Color IIs, but
-it <b>is</b> usable and suffers from mixing problems!</li>
-</ul>
-
-<p>
-
-To make things work, you <b>MUST</b> disable the driver's internal
-weaving (<code>Softweave</code>), in one of these two ways:</p>
-
-<blockquote>
-<code>gs -dMicroweave</code> ...<br>
-<code>gs -dnoWeave -descp_Band=1</code> ...
-</blockquote>
-
-<p>
-Version 1.90, current as of Ghostscript 5.10, fixes this bug by new default
-behaviour. I experienced significantly increased printing speed with the
-second variant on the old Stylus Color, when printing mostly monochrome
-data.</p>
-
-<h3><a name="STC_recommendations"></a>Recommendations</h3>
-
-<p>
-The next section is a contribution from Jason Patterson &lt;jason@reflections.com.au&gt;
-who evaluated a previous version (1.17). Ghostscript was invoked as follows:</p>
-
-<blockquote><dl compact>
-<dt><code>gs</code>
-<dd><code>-sDEVICE=stcolor -r720x720
--sDithering=</code>... <code>-sOutputFile=escp.out stcolor.ps
-whatsoever.ps</code>
-
-</dl></blockquote>
-
-<p>
-where "..." is the name of the desired algorithm.
-<code>stcolor.ps</code> was omitted for the gs-algorithms
-(<code>gsmono</code>, <code>gsrgb</code> and <code>gscmyk</code>),
-for which it is useless and would not allow the selection of
-"<code>gscmyk</code>".</p>
-
-<h4><a name="STC_dither_experiment"></a>Color dithering experiments with
-<code>gdevstc</code> 1.21</h4>
-
-<p>
-Here are data about the EPSON Stylus Color driver's different dithering
-methods, based on a little experiment using four good quality scanned
-images of quite varied nature, to begin with, a summary of the results of
-the four experiments. <b>Sanity note:</b> the results here are from only
-four images and a total of 24 printouts (eight on 720dpi paper, sixteen on
-plain paper). Your results will almost certainly vary, and your standards
-might not be the same as mine, so use these results only as a guide, not as
-a formal evaluation.</p>
-
-<blockquote>
-<table>
-<tr>
- <th colspan="2">Quality of output by method</th>
-</tr>
-<tr>
- <td><code>gsmono</code></td>
- <td>Pretty much what you'd expect from a mono ordered pattern.
- Looks like what a lot of mono laser printers produce.</td>
-</tr>
-<tr>
- <td><code>fsmono</code></td>
- <td>Excellent for monochrome.</td>
-</tr>
-<tr>
- <td><code>gscmyk</code></td>
- <td>Not very good, but expected from an ordered pattern.</td>
- </tr>
-<tr>
- <td><code>gsrgb</code></td>
- <td>A little better than <code>gscmyk</code>. More consistent
- looking.</td>
-</tr>
-<tr>
- <td><code>fs2</code></td>
- <td>Good, but not quite as good as <code>fsrgb</code>. Gets the
- brightness wrong: too light at 720dpi, too dark at 360dpi.</td>
-</tr>
-<tr>
- <td><code>fsrgb</code></td>
- <td>Very good, but a little too dark and has a slight blue tint.</td>
-</tr>
-<tr>
- <td><code>hscmyk</code></td>
- <td>Excellent. Slightly better than <code>fsrgb</code> and
- <code>fs2</code>. Better than <code>fscmyk</code> on
- some images, almost the same on most.</td>
-</tr>
-<tr>
- <td><code>fscmyk</code></td>
- <td>Best. Very, very slightly better than <code>hscmyk</code>.
- On some images nearly as good as the EPSON demos done with
- the MS Windows driver.</td>
- </tr>
-</table>
-</blockquote>
-
-<blockquote>
-<table>
-<tr>
- <th colspan="2">Overall visual quality (1-10), best to worst</th>
-</tr>
-<tr>
- <td><b>Monochrome</b></td>
- <td></td>
-</tr>
-<tr>
- <td><code>fsmono</code></td>
- <td><code>******************</code></td>
-</tr>
-<tr>
- <td><code>gsmono</code></td>
- <td><code>**********</code></td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td><code>0&nbsp;1&nbsp;2&nbsp;3&nbsp;4&nbsp;5&nbsp;6&nbsp;7&nbsp;8&nbsp;9&nbsp;10</code></td>
-</tr>
-<tr>
- <td><b>Colour</b></td>
- <td></td>
- </tr>
-<tr>
- <td><code>fscmyk</code></td>
- <td><code>*******************</code></td>
-</tr>
-<tr>
- <td><code>hscmyk</code></td>
- <td><code>*******************</code></td>
-</tr>
-<tr>
- <td><code>fsrgb</code></td>
- <td><code>******************</code></td>
-</tr>
-<tr>
- <td><code>fs2</code></td>
- <td><code>*****************</code></td>
-</tr>
-<tr>
- <td><code>gsrgb</code></td>
- <td><code>**********</code></td>
-</tr>
-<tr>
- <td><code>gscmyk</code></td>
- <td><code>*********</code></td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td><code>0&nbsp;1&nbsp;2&nbsp;3&nbsp;4&nbsp;5&nbsp;6&nbsp;7&nbsp;8&nbsp;9&nbsp;10</code></td>
-</tr>
-</table>
-</blockquote>
-
-<h3><a name="STC_color_transform"></a>Color transformation</h3>
-
-<p>
-In the initial version of the driver distributed with Ghostscript 3.33, the
-parameter "<code>SpotSize</code>" was the only way to manipulate the
-colors at the driver level. According to the parameters enumerated above,
-this has changed significantly with version 1.16 and above as a result an
-ongoing discussion about dithering algorithms and "false color" on the
-Epson Stylus Color. This initiated the transformation of the
-<code>stcolor</code> driver into a framework for different dithering
-algorithms, providing a generalized interface to the internal Ghostscript
-color models and the other data structures related to Ghostscript drivers.</p>
-
-<p>
-The main thing such a framework should be able to do is to deliver the
-values the dithering algorithm needs; and since this directly influences
-the optical image impression, this transformation should be adjustable
-without the need for recompilation and relinking. In general the process
-can be described as follows:</p>
-
-<blockquote><table>
-<tr>
- <td colspan="3"><code>ColorAdjustMatrix</code></td>
- <td align="center">Coding</td>
- <td colspan="3">&nbsp;</td>
- <td align="center">Transfer</td>
- <td colspan="3">&nbsp;</td>
-</tr>
-<tr>
- <td>|</td>
- <td align="center">Ghostscript color</td>
- <td>|</td>
- <td align="center">=&gt;</td>
- <td>|</td>
- <td align="center">Ghostscript raster</td>
- <td>|</td>
- <td align="center">=&gt;</td>
- <td>|</td>
- <td align="center">Dithering data</td>
- <td>|</td>
-</tr>
-<tr>
- <td>|</td>
- <td>&nbsp;</td>
- <td>|</td>
- <td>&nbsp;</td>
- <td>|</td>
- <td align="center">1/2/4/8/16/32-bit</td>
- <td>|</td>
- <td>&nbsp;</td>
- <td>|</td>
- <td>&nbsp;</td>
- <td>|</td>
-</tr>
-<tr>
- <td>|</td>
- <td align="center">1/3/4 16-bit values</td>
- <td>|</td>
- <td>&nbsp;</td>
- <td>|</td>
- <td align="center">1/3/4 values</td>
- <td>|</td>
- <td>&nbsp;</td>
- <td>|</td>
- <td align="center">(arbitrary type)</td>
- <td>|</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-Due to the limitations on raster storage, information is lost in the first
-transformation step, except for the 16-bit monochrome mode. So any color
-adjustment should take place before this step and this is where the optional
-<code>ColorAdjustMatrix</code> works.</p>
-
-<p>
-The first transformation step, called "coding", is controlled by the
-<code>?coding</code> arrays. The decoding process expands the range of
-values expontentially to a larger range than that provided by the initial
-Ghostscript color model, and is therefore a reasonable place to make
-device- or algorithm-specific adjustments. This is where the
-<code>?transfer</code> arrays are used. Array access might be not the
-fastest method, but its generality is superior, so this step is always
-based upon internally algorithm-specific array access. If 8 bits are stored
-per color component and if the algorithm uses bytes too, the second
-transformation is included within the first, which saves significant
-computation time when printing the data.</p>
-
-<h3><a name="STC_CAM"></a><code>ColorAdjustMatrix</code></h3>
-
-<p>
-The driver supports different values for <code>ProcessColorModel</code>,
-which raises the need for different color adjustments. Here
-"<code>CAM</code>" stands for "<code>ColorAdjustMatrix</code>".</p>
-
-<dl>
-<dt><code>DeviceGray</code> (three floats)
-<dd><pre>if ((r == g) &amp;&amp; (g == b))
- K' = 1.0 - R;
-else
- K' = 1.0 - CAM[0] * R + CAM[1] * G + CAM[2] * B;</pre>
-
-<p>
-According to the <a href="Drivers.htm">documentation on drivers</a>, the
-latter (the "else" clause) should never happen.</p>
-</dl>
-
-<dl>
-<dt><code>DeviceRGB</code> (nine floats)
-<dd><pre>if((r == g) &amp;&amp; (g == b))
- R' = B' = G' = R;
-else
- R' = CAM[0]*R + CAM[1]*G + CAM[2]*B;
- G' = CAM[3]*R + CAM[4]*G + CAM[5]*B;
- B' = CAM[6]*R + CAM[7]*G + CAM[8]*B;</pre>
-
-<p>
-The printer always uses four inks, so a special treatment of black is
-provided. Algorithms may take special action if R, G, and B are all
-equal.</p>
-</dl>
-
-<dl>
-<dt><code>DeviceCMYK</code> (sixteen floats)
-<dd>
-<pre>if((c == m) &amp;&amp; (m == y))
- K' = max(C,K);
- C' = M' = Y' = 0;
-else
- K = min(C,M,Y);
- if((K &gt; 0) &amp;&amp; ColorAdjustMatrix_present) { =&gt; UCR
- C -= K;
- M -= K;
- Y -= K;
- }
-
- C' = CAM[ 0]*C + CAM[ 1]*M + CAM[ 2]*Y + CAM[ 3]*K;
- M' = CAM[ 4]*C + CAM[ 5]*M + CAM[ 6]*Y + CAM[ 7]*K;
- Y' = CAM[ 8]*C + CAM[ 9]*M + CAM[10]*Y + CAM[11]*K;
- K' = CAM[12]*C + CAM[13]*M + CAM[14]*Y + CAM[15]*K;</pre>
-
-<p>
-Again we have a special black treatment. "<code>max(C,K)</code>" was introduced
-because of a slight misbehaviour of Ghostscript, which delivers
-black under certain circumstances as (1,1,1,0). Normally, when
-no special black separation and undercolor removal procedures
-are defined at the PostScript level, either (C,M,Y,0) or (0,0,0,K)
-values are mapped. This would make the extended <code>ColorAdjustMatrix</code>
-quite tedious, and so during mapping, black separation is done for
-(C,M,Y,0) requests; and if there is a <code>ColorAdjustMatrix</code>, undercolor
-removal is used too. In other words the default matrix is:</p>
-
-<blockquote><table>
-<tr> <td>1</td><td>0</td><td>0</td><td>1</td></tr>
-<tr> <td>0</td><td>1</td><td>0</td><td>1</td></tr>
-<tr> <td>0</td><td>0</td><td>1</td><td>1</td></tr>
-<tr> <td>0</td><td>0</td><td>0</td><td>1</td></tr>
-</table></blockquote>
-
-<p>
-and it is applied to CMYK values with separated and removed black. Raising
-the CMY coefficients while lowering the K coefficients reduces black and
-intensifies color. But be careful, because even small deviations from the
-default cause drastic changes.</p>
-</dl>
-
-<p>
-If no <code>ColorAdjustMatrix</code> is set, the matrix computations are
-skipped. Thus the transformation reduces to range inversion in monochrome
-mode and black separation in CMYK mode.</p>
-
-<h3><a name="STC_RGBCMYK_coding"></a>RGB / CMYK coding and transfer, and <code>BitsPerPixel</code></h3>
-
-<p>
-These two (groups of) parameters are arrays of floating-point numbers in
-the range 0.0 to 1.0. They control the truncation to the desired number of
-bits stored in raster memory (<code>BitsPerPixel</code>) and the ink
-density. The "truncation" may become a nonlinear function if any of the
-<code>?coding</code> arrays is set. Assume the following Ghostscript
-invocation:</p>
-
-<blockquote><pre>gs -sDEVICE=stcolor -sDithering=fscmyk -dBitsPerPixel=16 \
- -dKcoding='{ 0.0 0.09 0.9 1.0 }' \
- -dMcoding='{ 0.0 0.09 0.9 1.0 }' \
- -dKtransfer='{ 0.0 0.09 0.9 1.0 }' \
- -dYtransfer='{ 0.0 0.09 0.9 1.0 }'</pre>
-</blockquote>
-
-<p>
-We may have either or both of <code>?coding</code> and
-<code>?transfer</code>, giving four possible combinations. (These four
-combinations appear in the given example.) The resulting mapping appears
-in the following tables, where except for the internal Indices (4
-components &times; 4 bits = 16 <code>BitsPerPixel</code>), all values
-are normalized to the range 0 to 1. The actual range is 0 to 65535 for the
-Ghostscript color and 0 to 16777215 for the ink values delivered to the
-<code>fscmyk</code> algorithm. Sorry for the bunch of numbers
-following, but you may try this example in conjunction with
-<code>stcinfo.ps</code>, which should give you a graphical printout of
-the following numbers when you issue a <code>showpage</code> command.</p>
-
-<blockquote>
-<table>
-<tr>
- <th></th>
- <th colspan="3">Cyan</th>
- <th colspan="3">Magenta</th>
-</tr>
-<tr>
- <th>CI/15</th>
- <th>gs_color_values</th>
- <th>CI</th>
- <th>Ink</th>
- <th>gs_color_values</th>
- <th>CI</th>
- <th>Ink</th>
-</tr>
-<tr>
- <td align="center">0.000</td>
- <td align="center">0.000 - 0.062</td>
- <td align="center">0</td>
- <td align="center">0.000</td>
- <td align="center">-0.123 - 0.123</td>
- <td align="center">0</td>
- <td align="center">0.000</td>
-</tr>
-<tr>
- <td align="center">0.067</td>
- <td align="center">0.063 - 0.125</td>
- <td align="center">1</td>
- <td align="center">0.067</td>
- <td align="center">0.123 - 0.299</td>
- <td align="center">1</td>
- <td align="center">0.247</td>
-</tr>
-<tr>
- <td align="center">0.133</td>
- <td align="center">0.125 - 0.187</td>
- <td align="center">2</td>
- <td align="center">0.133</td>
- <td align="center">0.299 - 0.365</td>
- <td align="center">2</td>
- <td align="center">0.351</td>
-</tr>
-<tr>
- <td align="center">0.200</td>
- <td align="center">0.188 - 0.250</td>
- <td align="center">3</td>
- <td align="center">0.200</td>
- <td align="center">0.365 - 0.392</td>
- <td align="center">3</td>
- <td align="center">0.379</td>
-</tr>
-<tr>
- <td align="center">0.267</td>
- <td align="center">0.250 - 0.312</td>
- <td align="center">4</td>
- <td align="center">0.267</td>
- <td align="center">0.392 - 0.420</td>
- <td align="center">4</td>
- <td align="center">0.406</td>
-</tr>
-<tr>
- <td align="center">0.333</td>
- <td align="center">0.313 - 0.375</td>
- <td align="center">5</td>
- <td align="center">0.333</td>
- <td align="center">0.420 - 0.447</td>
- <td align="center">5</td>
- <td align="center">0.433</td>
-</tr>
-<tr>
- <td align="center">0.400</td>
- <td align="center">0.375 - 0.437</td>
- <td align="center">6</td>
- <td align="center">0.400</td>
- <td align="center">0.447 - 0.475</td>
- <td align="center">6</td>
- <td align="center">0.461</td>
-</tr>
-<tr>
- <td align="center">0.467</td>
- <td align="center">0.438 - 0.500</td>
- <td align="center">7</td>
- <td align="center">0.467</td>
- <td align="center">0.475 - 0.502</td>
- <td align="center">7</td>
- <td align="center">0.488</td>
-</tr>
-<tr>
- <td align="center">0.533</td>
- <td align="center">0.500 - 0.562</td>
- <td align="center">8</td>
- <td align="center">0.533</td>
- <td align="center">0.502 - 0.529</td>
- <td align="center">8</td>
- <td align="center">0.516</td>
-</tr>
-<tr>
- <td align="center">0.600</td>
- <td align="center">0.563 - 0.625</td>
- <td align="center">9</td>
- <td align="center">0.600</td>
- <td align="center">0.529 - 0.557</td>
- <td align="center">9</td>
- <td align="center">0.543</td>
-</tr>
-<tr>
- <td align="center">0.667</td>
- <td align="center">0.625 - 0.687</td>
- <td align="center">10</td>
- <td align="center">0.667</td>
- <td align="center">0.557 - 0.584</td>
- <td align="center">10</td>
- <td align="center">0.571</td>
-</tr>
-<tr>
- <td align="center">0.733</td>
- <td align="center">0.688 - 0.750</td>
- <td align="center">11</td>
- <td align="center">0.733</td>
- <td align="center">0.584 - 0.612</td>
- <td align="center">11</td>
- <td align="center">0.598</td>
-</tr>
-<tr>
- <td align="center">0.800</td>
- <td align="center">0.750 - 0.812</td>
- <td align="center">12</td>
- <td align="center">0.800</td>
- <td align="center">0.612 - 0.639</td>
- <td align="center">12</td>
- <td align="center">0.626</td>
-</tr>
-<tr>
- <td align="center">0.867</td>
- <td align="center">0.813 - 0.875</td>
- <td align="center">13</td>
- <td align="center">0.867</td>
- <td align="center">0.639 - 0.715</td>
- <td align="center">13</td>
- <td align="center">0.653</td>
-</tr>
-<tr>
- <td align="center">0.933</td>
- <td align="center">0.875 - 0.937</td>
- <td align="center">14</td>
- <td align="center">0.933</td>
- <td align="center">0.715 - 0.889</td>
- <td align="center">14</td>
- <td align="center">0.778</td>
-</tr>
-<tr>
- <td align="center">1.000</td>
- <td align="center">0.938 - 1.000</td>
- <td align="center">15</td>
- <td align="center">1.000</td>
- <td align="center">0.889 - 1.111</td>
- <td align="center">15</td>
- <td align="center">1.000</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-The difference between cyan and magenta is the presence of a coding array.
-The coding process must map a range of color values to each of the sixteen
-component indices. If no coding array is given, this is accomplished
-by dividing by 4096, equivalent to a right shift by 12 bits. The
-final ink density resides in the given interval and moves from the left to
-the right side from 0 to 15. For magenta there is a coding array
-and the ink value matches the center of the intervals. But the distribution
-of the mapped intervals follows the given coding array and is nonlinear in
-the linear color space of Ghostscript.</p>
-
-<p>
-Now let us take a look at the case with transfer arrays:</p>
-
-<blockquote>
-<table>
-<tr>
- <th></th>
- <th colspan="3">Yellow</th>
- <th colspan="3">Black</th>
-</tr>
-<tr>
- <th>CI/15</th>
- <th>gs_color_values</th>
- <th>CI</th>
- <th>Ink</th>
- <th>gs_color_values</th>
- <th>CI</th>
- <th>Ink</th>
-</tr>
-<tr>
- <td align="center">0.000</td>
- <td align="center">0.000 - 0.062</td>
- <td align="center">0</td>
- <td align="center">0.000</td>
- <td align="center">-0.123 - 0.123</td>
- <td align="center">0</td>
- <td align="center">0.000</td>
-</tr>
-<tr>
- <td align="center">0.067</td>
- <td align="center">0.063 - 0.125</td>
- <td align="center">1</td>
- <td align="center">0.018</td>
- <td align="center">0.123 - 0.299</td>
- <td align="center">1</td>
- <td align="center">0.067</td>
-</tr>
-<tr>
- <td align="center">0.13</td>
- <td align="center">0.125 - 0.187</td>
- <td align="center">2</td>
- <td align="center">0.036</td>
- <td align="center">0.299 - 0.365</td>
- <td align="center">2</td>
- <td align="center">0.133</td>
-</tr>
-<tr>
- <td align="center">0.200</td>
- <td align="center">0.188 - 0.250</td>
- <td align="center">3</td>
- <td align="center">0.054</td>
- <td align="center">0.365 - 0.392</td>
- <td align="center">3</td>
- <td align="center">0.200</td>
-</tr>
-<tr>
- <td align="center">0.267</td>
- <td align="center">0.250 - 0.312</td>
- <td align="center">4</td>
- <td align="center">0.072</td>
- <td align="center">0.392 - 0.420</td>
- <td align="center">4</td>
- <td align="center">0.267</td>
-</tr>
-<tr>
- <td align="center">0.333</td>
- <td align="center">0.313 - 0.375</td>
- <td align="center">5</td>
- <td align="center">0.090</td>
- <td align="center">0.420 - 0.447</td>
- <td align="center">5</td>
- <td align="center">0.333</td>
-</tr>
-<tr>
- <td align="center">0.400</td>
- <td align="center">0.375 - 0.437</td>
- <td align="center">6</td>
- <td align="center">0.252</td>
- <td align="center">0.447 - 0.475</td>
- <td align="center">6</td>
- <td align="center">0.400</td>
-</tr>
-<tr>
- <td align="center">0.467</td>
- <td align="center">0.438 - 0.500</td>
- <td align="center">7</td>
- <td align="center">0.414</td>
- <td align="center">0.475 - 0.502</td>
- <td align="center">7</td>
- <td align="center">0.467</td>
-</tr>
-<tr>
- <td align="center">0.533</td>
- <td align="center">0.500 - 0.562</td>
- <td align="center">8</td>
- <td align="center">0.576</td>
- <td align="center">0.502 - 0.529</td>
- <td align="center">8</td>
- <td align="center">0.533</td>
-</tr>
-<tr>
- <td align="center">0.600</td>
- <td align="center">0.563 - 0.625</td>
- <td align="center">9</td>
- <td align="center">0.738</td>
- <td align="center">0.529 - 0.557</td>
- <td align="center">9</td>
- <td align="center">0.600</td>
-</tr>
-<tr>
- <td align="center">0.667</td>
- <td align="center">0.625 - 0.687</td>
- <td align="center">10</td>
- <td align="center">0.900</td>
- <td align="center">0.557 - 0.584</td>
- <td align="center">10</td>
- <td align="center">0.667</td>
-</tr>
-<tr>
- <td align="center">0.733</td>
- <td align="center">0.688 - 0.750</td>
- <td align="center">11</td>
- <td align="center">0.920</td>
- <td align="center">0.584 - 0.612</td>
- <td align="center">11</td>
- <td align="center">0.733</td>
-</tr>
-<tr>
- <td align="center">0.800</td>
- <td align="center">0.750 - 0.812</td>
- <td align="center">12</td>
- <td align="center">0.940</td>
- <td align="center">0.612 - 0.639</td>
- <td align="center">12</td>
- <td align="center">0.800</td>
-</tr>
-<tr>
- <td align="center">0.867</td>
- <td align="center">0.813 - 0.875</td>
- <td align="center">13</td>
- <td align="center">0.960</td>
- <td align="center">0.639 - 0.715</td>
- <td align="center">13</td>
- <td align="center">0.867</td>
-</tr>
-<tr>
- <td align="center">0.933</td>
- <td align="center">0.875 - 0.937</td>
- <td align="center">14</td>
- <td align="center">0.980</td>
- <td align="center">0.715 - 0.889</td>
- <td align="center">14</td>
- <td align="center">0.933</td>
-</tr>
-<tr>
- <td align="center">1.000</td>
- <td align="center">0.938 - 1.000</td>
- <td align="center">15</td>
- <td align="center">1.000</td>
- <td align="center">0.889 - 1.111</td>
- <td align="center">15</td>
- <td align="center">1.000</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-Yellow uses a transfer array. There is no linear correspondence between
-the color and the ink values: this correspondence is defined through the
-given array. In other words, the transfer arrays define a nonlinear ink
-characteristic, which is exactly the same functionality that PostScript's
-"(color)transfer" function provides.</p>
-
-<p>
-While for yellow the intervals match the intervals used with cyan, for
-black the intervals match the magenta intervals. But watch the
-correspondence between the CI/15 values and the ink density for black: this
-is a linear distribution in the ink domain.</p>
-
-<p>
-Not a bad idea, I think. Consider the <code>fs2</code> algorithm: it
-uses values in the range 0 to 255. If any transfer array were alone, some
-of the 256 possible values would never be used and others would be used for
-adjacent intervals several times. Establishing an identical coding array
-solves this problem, so the full potential of the algorithm is used.</p>
-
-<p>
-Another useful feature of the coding arrays is that they are internally
-normalized to the range 0-1. In 720x720dpi mode the transfer arrays in
-<code>stcolor.ps</code> limit the dot density to about 50%, so these
-arrays end at 0.5 (and begin at 0.5 for RGB). Because of automatic
-normalization, these arrays can also be used as coding arrays. But of
-course in the <code>fs2</code> case mentioned above, values from 0 to
-127 will never be delivered to the algorithm, while values 128-255 are
-delivered for adjacent intervals.</p>
-
-<p>
-To clarify the intended use of the three parameters (parameter groups), keep this in mind:</p>
-
-<blockquote><ul>
-<li><code>ColorAdjustMatrix</code> is never used when transferring gray
-values. This restricts it to what the name says: adjustment of colors,
-that is, correction for miscolored ink. Do not use it for saturation or
-brightness control.</li>
-
-<li><code>?transfer</code> arrays control the values delivered to the
-driver, which in turn controls the ink quantity. Use these arrays to
-control saturation and brightness. In general these arrays are identical
-for all inks. If they differ they provide a simpler scheme for color
-correction, which is not necessarily faster than the
-<code>ColorAdjustMatrix</code>.</li>
-
-<li><code>?coding</code> arrays control the color value intervals mapped
-to the internal color indices.</li>
-</ul></blockquote>
-
-<h3><a name="What_is_weaving"></a>What is weaving?</h3>
-
-<p>
-The Epson Stylus Color has a head assembly that contains two physically
-identifiable heads, one for black and one for cyan, magenta, and yellow
-(CMY). This makes four "logical" heads, one for each color component.
-Each of these four heads has several jets at some vertical (Y) distance
-from one another, so several horizontal lines can be printed of a given
-color during one pass of the heads. From experience I think there are
-fifteen jets per color, spaced at 1/90in.</p>
-
-<p>
-So the question arises of how to print at a Y resolution of 360dpi with
-90dpi jets. Simply by division one gets 360dpi/90dpi = 4, which tells us
-that 4 passes of the head assembly are needed to achieve a Y resolution of
-360dpi.</p>
-
-<p>
-Weaving is the method of how the fifteen jets are used to print adjacent
-horizontal rows separated here by 1/360 inch:</p>
-
-<blockquote>
-<table>
-<tr>
- <th colspan="10">Print-head jets used with and without weaving</th>
-</tr>
-<tr>
- <th></th>
- <th></th>
- <th colspan="4">Weaving</th>
- <th colspan="4">noWeave</th>
-</tr>
-<tr>
- <td></td>
- <td>Pass</td>
- <td>1</td>
- <td>2</td>
- <td>3</td>
- <td>4</td>
- <td>1</td>
- <td>2</td>
- <td>3</td>
- <td>4</td>
-</tr>
-<tr>
- <td colspan="10">Row</td>
-</tr>
-<tr>
- <td align="center">0</td>
- <td></td>
- <td align="center">jet 0</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 0</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
-</tr>
-<tr>
- <td align="center">1</td>
- <td></td>
- <td align="center">--</td>
- <td align="center">jet 1</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 0</td>
- <td align="center">--</td>
- <td align="center">--</td>
-</tr>
-<tr>
- <td align="center">2</td>
- <td></td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 2</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 0</td>
- <td align="center">--</td>
-</tr>
-<tr>
- <td align="center">3</td>
- <td></td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 3</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 0</td>
-</tr>
-<tr>
- <td align="center">4</td>
- <td></td>
- <td align="center">jet 1</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 1</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
-</tr>
-<tr>
- <td align="center">5</td>
- <td></td>
- <td align="center">--</td>
- <td align="center">jet 2</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 1</td>
- <td align="center">--</td>
- <td align="center">--</td>
-</tr>
-<tr>
- <td align="center">6</td>
- <td></td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 3</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">--</td>
- <td align="center">jet 1</td>
- <td align="center">--</td>
-</tr>
-<tr>
- <td colspan="10">...</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-Now let's assume that the dot diameter is different for each individual
-jet, but the average among the jets matches the desired resolution. With
-weaving, adjacent rows are printed by different jets, thus some averaging
-takes place. Without weaving, adjacent rows are printed by the same jet
-and this makes the dot diameter deviations visible as 1/90in stripes on
-the paper.</p>
-
-<h3><a name="STC_print_modes"></a>Print mode parameters</h3>
-
-<p>
-The parameters "<code>Unidirectional</code>",
-"<code>Microweave</code>", "<code>noWeave</code>",
-"<code>OutputCode</code>", "<code>Model</code>" and the given
-resolution control the data generated for the printer.</p>
-
-<h4><a name="STC_unidirectional"></a><code>Unidirectional</code></h4>
-
-<p>
-Simply toggles the unidirectional mode of the printer. Setting
-"<code>Unidirectional</code>" definitely slows printing speed, but may
-improve the quality. I use this for printing transparencies, where fast
-head movement could smear the ink.</p>
-
-<h4><a name="STC_noweave"></a><code>Microweave</code>,
-<code>noWeave</code> and <code>OutputCode=deltarow</code></h4>
-
-<p>
-The first are two booleans, which implies that four combinations are
-possible. Actually only three exist (if you don't count for
-<code>deltarow</code>): <code>Softweave</code>,
-<code>Microweave</code>, and <code>noWeave</code>. The first and
-second are functionally identical, the difference being whether the driver
-or the printer does the job.</p>
-
-<p>
-In the default <code>Softweave</code> mode the driver sends the data
-properly arranged to the printer, while in <code>Microweave</code> mode,
-it is the printer that arranges the data. But in general the host processor
-is much faster than the printer's processor, and thus it is faster for the
-host do the job. In addition to that, for 720dpi eight passes are
-required, and the amount of buffer space needed to buffer the data for the
-passes is far beyond the printer's memory. <code>Softweave</code>
-requires an odd value of "<code>escp_Band</code>"; the Stylus Color
-provides fifteen for that.</p>
-
-<p>
-"<code>OutputCode</code>" controls the encoding used. In the basic
-modes, the choice consists of "plain" and "runlength". The computation of
-runlength-encoded data does not take much time, less than the data tranfer
-to the printer; thus this is the recommended mode, and of course the
-default. With the Stylus Color, Epson introduced some new encoding
-principles, namely "tiff" and "deltarow". While the first was omitted from
-this driver for lack of apparent advantages, "<code>deltarow</code>" is
-available as an option. "<code>Softweave</code>" cannot be used with
-this encoding, so if <code>OutputCode=deltarow</code> is set,
-<code>Microweave</code> becomes the default. Maybe that the size of the
-ESC/P2 code becomes smaller, but I have never observed faster printing
-speed. Things tend to become slower with <code>deltarow</code> compared
-to <code>Softweave</code>.</p>
-
-<h4><a name="STC_model"></a><code>Model</code></h4>
-
-<p>
-Some ESC/P2 printers such as the Stylus 800 do not offer
-<code>Microweave</code> or the commands required to do
-<code>Softweave</code>. Setting <code>Model</code> just changes the
-defaults and omits some parts of the initialization sequence which are not
-compatible with the given printer model. Currently only
-"<code>st800</code>" is supported besides the default
-<code>stcolor</code>.</p>
-
-<h3><a name="STC_Pitfalls"></a>Bugs and pitfalls</h3>
-
-<ul>
-<li>The given <code>?coding</code> and <code>?transfer</code> arrays
-should be strictly monotonic.</li>
-
-<li>It is impossible to change <code>WHITE</code>: that's your paper.
-Thus RGB transfer should end at 1.0 and CMYK transfer should start at 0.0.</li>
-
-<li>Usually 8 bits per component yields fastest operation.</li>
-
-<li>The <code>ColorAdjustMatrix</code> is not used in the reverse
-transformation used when Ghostscript does the dithering
-(<code>gs</code>* modes). Expect funny results.</li>
-
-<li>If <code>BitsPerPixel</code> is less than 6, the entire coding and
-transfer process does not work. This is always true for the
-<code>gs</code>* modes and becomes true for the other modes if
-<code>BitsPerPixel</code> is forced to low values.</li>
-
-<li>720&times;720dpi printing should never select the <code>gs</code>*
-modes and should always use <code>stcolor.ps</code>. (I prefer
-360&times;720.)</li>
-</ul>
-
-<h3><a name="STC_Tests"></a>Tests</h3>
-
-<p>
-This section gives an overview of performance in terms of processing and
-printing times, from tests run after version 1.13. Printing was done
-offline (simply copying a processed file to the printer) to measure real
-printing speed without regard to speed of processing on the host, since at
-high resolutions, processing time is the same order of magnitude and thus
-may become the limiting factor.</p>
-
-<h4><a name="STC_OutputCodes"></a>The various OutputCodes</h4>
-
-<p>
-I ran several files though Ghostscript and recorded the size of the
-resulting print code, the processing time, and the printing time, at least
-for some of the files, always using these options:</p>
-
-<blockquote><code>
-gs -sDEVICE=stcolor -sPAPERSIZE=a4 stcolor.ps - &lt; file.ps
-</code></blockquote>
-
-<p>
-(Actually "<code>-sPAPERSIZE=a4</code>" is in my
-<code>gs_init.ps</code> since I'm a germ.)</p>
-
-<p>"<code>deltarow</code>" is the new encoding principle
-("<code>ESC&nbsp;.&nbsp;3&nbsp;10&nbsp;10&nbsp;1</code>") with
-<code>Microweave</code> on. It is activated with
-"<code>-sOutputCode=deltarow</code>".</p>
-
-<p>"<code>Softweave</code>" actually means that nothing else was used:
-it is the default, and implies that odd v=40/h=10/m=15 mode
-("<code>ESC&nbsp;.&nbsp;1&nbsp;40&nbsp;10&nbsp;15</code>").</p>
-
-<p>"<code>Microweave</code>" means "<code>-dMicroweave</code>",
-equivalent to "<code>ESC&nbsp;.&nbsp;1&nbsp;10&nbsp;10&nbsp;1</code>",
-with full skip optimization and microweave activated.</p>
-<p> Finally I wanted to see the plain Kathy Ireland, and used
- "<code>-sOutputCode=plain</code>", which just replaces runlength
- encoding (RLE) by no encoding, thus using
- "<code>ESC&nbsp;.&nbsp;0&nbsp;40&nbsp;10&nbsp;15</code>". [So sorry <code>;-)</code> Kathy was still dressed in blue in front of the blue
- sea on a blue air cushion – nice to see but hard to dither.]</p>
-<p>
-So here are the results.</p>
-
-<blockquote>
-<table>
-<tr>
- <th colspan="5">File sizes and printing speeds with various weaving methods</th>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td><code>golfer.ps</code></td>
- <td><code>colorcir.ps</code></td>
- <td><code>drawing.ps</code></td>
- <td><code>brief.ps</code></td>
-</tr>
-<tr>
- <td><code>deltarow</code></td>
- <td>572751/48.180u</td>
- <td>643374/41.690u</td>
- <td>90142/46.180u/1:50</td>
- <td>178563/49.350u/2:22</td>
-</tr>
-<tr>
- <td><code>Softweave</code></td>
- <td>559593/46.810u</td>
- <td>669966/44.960u</td>
- <td>296168/48.160u/1:30</td>
- <td>269808/43.320u/1:55</td>
-</tr>
-<tr>
- <td><code>Microweave</code></td>
- <td>590999/56.060u</td>
- <td>754276/42.890u</td>
- <td>338885/47.060u/1:50</td>
- <td>282314/44.690u/2:22</td>
-</tr>
-</table>
-</blockquote>
-
-<blockquote>
-<table>
-<tr>
- <th colspan="2">Kathy Ireland</th>
-</tr>
-<tr>
- <td></td>
- <td><code>kathy.ps</code></td>
-</tr>
-<tr>
- <td><code>deltarow</code></td>
- <td>3975334/111.940u/5:35</td>
-</tr>
-<tr>
- <td><code>Softweave</code></td>
- <td>3897112/101.940u/3:10</td>
-</tr>
-<tr>
- <td><code>Microweave</code></td>
- <td>4062829/100.990u/3:15</td>
-</tr>
-<tr>
- <td><code>plain/soft</code></td>
- <td>5072255/104.390u/3:05</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-It may be that I've not chosen the optimal <code>deltarow</code> code,
-but even if it saves at lot of bytes, printing-speed is not increased.</p>
-
-<p>
-At least the printer prefers plain Kathy. In other words, sending 1
-Megabyte or 20% more data has no impact on printing speed.
-<code>drawing.ps</code> is an exception to this rule: plain prints
-slower than RLE.</p>
-
-<p>
-"Unclever" coding -- especially with <code>deltarow</code> -- can
-significantly slow down printing. But even if very significant advantages
-in the size of the code are achieved, "<code>deltarow</code>" is not
-competitive. <code>colorcir.ps</code> shows savings with
-<code>deltarow</code>, but printing is a mess.</p>
-
-<h4><a name="STC_printing_time"></a>Printing time related to other options</h4>
-
-<p>
-Full page halftone images printed, unless otherwise noted.</p>
-
-<blockquote>
-<table>
-<tr>
- <th colspan="6">Printing time related to other options</th>
-</tr>
-<tr>
- <th align="right">dpi</th>
- <th align="right">Print mode</th>
- <th align="right">Size KB</th>
- <th align="right">Time</th>
- <th colspan="2" align="left">Comments</th>
-</tr>
-<tr>
- <td align="right">180x180 mono</td>
- <td align="right">-/uni</td>
- <td align="right">358</td>
- <td align="right">1:15</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">-/bi</td>
- <td align="right">358</td>
- <td align="right">0:45</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">micro/bi</td>
- <td align="right">205</td>
- <td align="right">0:45</td>
- <td colspan="2">Not Weaving</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">soft/bi</td>
- <td align="right">179</td>
- <td align="right">1:25</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-<tr>
- <td align="right">color</td>
- <td align="right">-/bi</td>
- <td align="right">641</td>
- <td align="right">2:45</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">soft/bi</td>
- <td align="right">556</td>
- <td align="right">1:32</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-<tr>
- <td align="right">360x360 mono</td>
- <td align="right">-/uni</td>
- <td align="right">269</td>
- <td align="right">0:50</td>
- <td colspan="2">Monochrome text</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">-/bi</td>
- <td align="right">269</td>
- <td align="right">0:35</td>
- <td colspan="2">Monochrome text</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">micro/bi</td>
- <td align="right">269</td>
- <td align="right">2:25</td>
- <td colspan="2">Monochrome text</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">soft/uni</td>
- <td align="right">250</td>
- <td align="right">3:15</td>
- <td colspan="2">Monochrome text</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">soft/bi</td>
- <td align="right">250</td>
- <td align="right">1:55</td>
- <td colspan="2">Monochrome text</td>
-</tr>
-<tr>
- <td align="right">color</td>
- <td align="right">-/bi</td>
- <td align="right">346</td>
- <td align="right">1:00</td>
- <td colspan="2">Sparse-color page, visible displacements</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">micro/bi</td>
- <td align="right">346</td>
- <td align="right">1:50</td>
- <td colspan="2">Sparse-color page, looks buggy – printer?</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">soft/bi</td>
- <td align="right">294</td>
- <td align="right">1:30</td>
- <td colspan="2">Sparse-color page, O.K.</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">-/bi</td>
- <td align="right">2218</td>
- <td align="right">2:45</td>
- <td colspan="2">Visible stripes</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">micro/bi</td>
- <td align="right">5171</td>
- <td align="right">3:17</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">soft/bi</td>
- <td align="right">3675</td>
- <td align="right">3:05</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-<tr>
- <td align="right">360x720 mono</td>
- <td align="right">soft/bi</td>
- <td align="right">2761</td>
- <td align="right">5:40</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-<tr>
- <td align="right">color</td>
- <td align="right">soft/bi</td>
- <td align="right">7789</td>
- <td align="right">6:15</td>
- <td colspan="2">Just a small difference!</td>
-</tr>
-<tr>
- <td align="right">720x360 color</td>
- <td align="right">soft/bi</td>
- <td align="right">7182</td>
- <td align="right">5:40</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-<tr>
- <td align="right">720x720 color</td>
- <td align="right">micro/bi</td>
- <td align="right">14748</td>
- <td align="right">30:26</td>
- <td colspan="2">Actually beyond printer's capabilities</td>
-</tr>
-<tr>
- <td>&nbsp;</td>
- <td align="right">soft/bi</td>
- <td align="right">14407</td>
- <td align="right">11:08</td>
- <td colspan="2">&nbsp;</td>
-</tr>
-</table>
-</blockquote>
-
-<h3><a name="STC_acks"></a>Acknowledgments</h3>
-
-<p>
-This driver was copied from <code>gdevcdj.c</code> (Ghostscript 3.12),
-which was contributed by George Cameron, Koert Zeilstra, and Eckhard
-Rueggeberg. Some of the ESC/P2 code was drawn from Richard Brown's
-<code>gdevescp.c</code>. The POSIX interrupt code (compilation option
-<code>-DSTC_SIGNAL</code>) is from Frederic Loyer. Several improvements
-are based on discussions with Brian Converse, Bill Davidson, Gero Guenther,
-Jason Patterson, ? Rueschstroer, and Steven Singer.</p>
-
-<p>
-While I wish to thank everyone mentioned above, they are by no means
-responsible for bugs in the stcolor driver -- just for the features.</p>
-
-<address>
-Gunther Hess<br>
-Richard Wagner Strasse 112<br>
-D-47057 Duisburg<br>
-Germany<br>
-+49 203 376273 telephone (MET evening hours)<br>
-&lt;<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>&gt;
-</address>
-
-<hr>
-
-<h2><a name="Uniprint"></a>uniprint, a flexible unified printer driver</h2>
-
-<p>
-<code>uniprint</code> is a unified parametric driver by Gunther Hess
-&lt;<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>&gt; for several
-kinds of printers and devices, including</p>
-
-<blockquote>
-<ul>
-<li>any Epson Stylus Color, Stylus, or Stylus Pro</li>
-<li>HP PCL/RTL</li>
-<li>Canon BubbleJet Color 610</li>
-<li>NEC P2X</li>
-<li>Sun raster file format</li>
-</ul></blockquote>
-
-<p>
-This driver is intended to <em>become</em> a unified printer driver. If you
-consider it ugly, please send me your suggestions for improvements. The
-driver will be updated with them. Thus the full explanation of the driver's
-name is:</p>
-
-<blockquote>
-Ugly- -&gt; Updated- -&gt; Unified Printer Driver
-</blockquote>
-
-<p>
-But you probably want to know something about the functionality.
-At the time of this writing uniprint drives:</p>
-
-<ul>
-<li>NEC Pinwriter P2X (24-pin monochrome impact printer, ESC/P style)</li>
-<li>Several Epson Stylus Color models (ESC/P2 style)</li>
-<li>HP-DeskJet 550c (basic HP-RTL)</li>
-<li>Canon BJC 610</li>
-</ul>
-
-<p>
-It can be configured for various other printers without recompilation
-and offers uncompressed (ugly) Sun rasterfiles as another format, but
-this format is intended for testing purposes rather than real use.
-The usage of this driver is quite simple. The typical command line looks
-like this:</p>
-
-<blockquote>
-<code>gs @</code>{MODEL}<code>.upp -sOutputFile=</code>{printable file}<code> MyFile.ps -c quit</code>
-</blockquote>
-
-<p>
-For example, from my Linux box:</p>
-
-<blockquote><code>
-gs @stc.upp -sOutputFile=/dev/lp1 tiger.eps -c quit
-</code></blockquote>
-
-<blockquote>
-<table>
-<tr>
- <th colspan="3">Unified Printer Parameter files distributed with Ghostscript</th>
-</tr>
-<tr>
- <th align="left" colspan="3">Canon BJC 610 (color, rendered)</th>
-</tr>
-<tr>
-
- <td><code>bjc610a0.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>plain paper, high speed</td>
-</tr>
-<tr>
-
- <td><code>bjc610a1.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>plain paper</td>
-</tr>
-<tr>
-
- <td><code>bjc610a2.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>coated paper</td>
-</tr>
-<tr>
-
- <td><code>bjc610a3.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>transparency film</td>
-</tr>
-<tr>
-
- <td><code>bjc610a4.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>back print film</td>
-</tr>
-<tr>
-
- <td><code>bjc610a5.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>fabric sheet</td>
-</tr>
-<tr>
-
- <td><code>bjc610a6.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>glossy paper</td>
-</tr>
-<tr>
-
- <td><code>bjc610a7.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>high gloss film</td>
-</tr>
-<tr>
-
- <td><code>bjc610a8.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>high resolution paper</td>
-</tr>
-<tr>
- <th colspan="3"></th>
-</tr>
-<tr>
-
- <td><code>bjc610b1.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>plain paper</td>
-</tr>
-<tr>
-
- <td><code>bjc610b2.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>coated paper</td>
-</tr>
-<tr>
-
- <td><code>bjc610b3.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>transparency film</td>
-</tr>
-<tr>
-
- <td><code>bjc610b4.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>back print film</td>
-</tr>
-<tr>
-
- <td><code>bjc610b6.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>glossy paper</td>
-</tr>
-<tr>
-
- <td><code>bjc610b7.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>high-gloss paper</td>
-</tr>
-<tr>
-
- <td><code>bjc610b8.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>high resolution paper</td>
-</tr>
-<tr>
- <th align="left" colspan="3">HP Ink-Printers</th>
-</tr>
-<tr>
-
- <td><code>cdj550.upp</code></td>
-
- <td>300&times;300dpi</td>
-
- <td>32-bit CMYK</td>
-</tr>
-<tr>
-
- <td><code>cdj690.upp</code></td>
-
- <td>300&times;300dpi</td>
-
- <td>Normal mode</td>
-</tr>
-<tr>
-
- <td><code>cdj690ec.upp</code></td>
-
- <td>300&times;300dpi</td>
-
- <td>Economy mode</td>
-</tr>
-<tr>
-
- <td><code>dnj750c.upp</code></td>
-
- <td>300&times;300dpi</td>
-
- <td>Color – also good for 450C</td>
-</tr>
-<tr>
-
- <td><code>dnj750m.upp</code></td>
-
- <td>600&times;600dpi</td>
-
- <td>Monochrome</td>
-</tr>
-<tr>
- <th align="left" colspan="3">NEC P2X</th>
-</tr>
-<tr>
-
- <td><code>necp2x.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>8-bit (Floyd-Steinberg)</td>
-</tr>
-<tr>
- <th align="left" colspan="3">Any Epson Stylus Color</th>
-</tr>
-<tr>
-
- <td><code>stcany.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>4-bit, PostScript halftoning</td>
-</tr>
-<tr>
-
- <td><code>stcany_h.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>4-bit, PostScript halftoning</td>
- </tr>
-<tr>
- <th align="left" colspan="3">Original Epson Stylus and Stylus Pro Color</th>
- </tr>
-<tr>
-
- <td><code>stc.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>32-bit CMYK, 15-pin</td>
- </tr>
-<tr>
-
- <td><code>stc_l.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>4-bit, PostScript halftoning, weaved noWeave</td>
- </tr>
-<tr>
-
- <td><code>stc_h.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>32-bit CMYK, 15-pin Weave</td>
- </tr>
-<tr>
- <th align="left" colspan="3">Epson Stylus Color II</th>
- </tr>
-<tr>
-
- <td><code>stc2.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>32-bit CMYK, 20-pin, Epson Stylus Color II(s)</td>
- </tr>
-<tr>
-
- <td><code>stc2_h.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>32-bit CMYK, 20-pin, Epson Stylus Color II</td>
- </tr>
-<tr>
-
- <td><code>stc2s_h.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>32-bit CMYK, 20-pin, Epson Stylus Color IIs</td>
- </tr>
-<tr>
- <th align="left" colspan="3">Epson Stylus Color 200</th>
- </tr>
-<tr>
-
- <td><code>stc200.upp</code></td>
-
- <td>360&times;720dpi</td>
-
- <td>Plain Paper</td>
- </tr>
-<tr>
- <th align="left" colspan="3">Epson Stylus Color 300</th>
- </tr>
-<tr>
-
- <td><code>stc300.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>32-bit CMYK, plain paper</td>
- </tr>
-<tr>
-
- <td><code>stc300bl.upp</code></td>
-
- <td>180&times;180dpi</td>
-
- <td>black only, plain paper</td>
- </tr>
-<tr>
-
- <td><code>stc300bm.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>black only, plain paper</td>
- </tr>
-<tr>
- <th align="left" colspan="3">Epson Stylus Color 500 (good transfer curves for plain paper)</th>
- </tr>
-<tr>
-
- <td><code>stc500p.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>32-bit CMYK, noWeave, plain paper</td>
- </tr>
-<tr>
-
- <td><code>stc500ph.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>32-bit CMYK, noWeave, plain paper</td>
- </tr>
-<tr>
- <th align="left" colspan="3">Epson Stylus Color 600, 32/90-inch weaving</th>
- </tr>
-<tr>
-
- <td><code>stc600pl.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>32-bit CMYK, 32-pin, plain paper</td>
- </tr>
-<tr>
-
- <td><code>stc600p.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>32-bit CMYK, 32-pin, plain paper</td>
- </tr>
-<tr>
-
- <td><code>stc600ih.upp</code></td>
-
- <td>1440&times;720dpi</td>
-
- <td>32-bit CMYK, 30-pin, inkjet paper</td>
- </tr>
-<tr>
- <th align="left" colspan="3">Epson Stylus Color 640</th>
- </tr>
-<tr>
-
- <td><code>stc640p.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>plain paper?</td>
- </tr>
-<tr>
-
- <td><code>st640p.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>CMYK, plain paper</td>
- </tr>
-<tr>
-
- <td><code>st640pg.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>grayscale, plain paper</td>
- </tr>
-<tr>
-
- <td><code>st640pl.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>CMYK, plain paper</td>
- </tr>
-<tr>
-
- <td><code>st640plg.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>grayscale, plain paper</td>
- </tr>
-<tr>
-
- <td><code>st640ih.upp</code></td>
-
- <td>1440&times;720dpi</td>
-
- <td>CMYK, inkjet paper</td>
- </tr>
-<tr>
-
- <td><code>st640ihg.upp</code></td>
-
- <td>1440&times;720dpi</td>
-
- <td>grayscale, inkjet paper</td>
- </tr>
-<tr>
- <th align="left" colspan="3">Epson Stylus Color 800, 64/180-inch weaving</th>
- </tr>
-<tr>
-
- <td><code>stc800pl.upp</code></td>
-
- <td>360&times;360dpi</td>
-
- <td>32-bit CMYK, 64-pin, plain paper</td>
- </tr>
-<tr>
-
- <td><code>stc800p.upp</code></td>
-
- <td>720&times;720dpi</td>
-
- <td>32-bit CMYK, 64-pin, plain paper</td>
- </tr>
-<tr>
-
- <td><code>stc800ih.upp</code></td>
-
- <td>1440&times;720dpi</td>
-
- <td>32-bit CMYK, 62-pin, inkjet paper</td>
- </tr>
-<tr>
-
- <td><code>stc1520.upp</code></td>
-
- <td>1440&times;720dpi</td>
-
- <td>32-bit CMYK, 62-pin, inkjet paper</td>
- </tr>
-<tr>
- <th align="left" colspan="3">Sun raster file</th>
- </tr>
-<tr>
-
- <td><code>ras1.upp</code></td>
-
- <td>1-bit</td>
-
- <td>monochrome (Ghostscript)</td>
- </tr>
-<tr>
-
- <td><code>ras3.upp</code></td>
-
- <td>3-bit</td>
-
- <td>RGB (Ghostscript)</td>
- </tr>
-<tr>
-
- <td><code>ras4.upp</code></td>
-
- <td>4-bit</td>
-
- <td>CMYK (Ghostscript)</td>
- </tr>
-<tr>
-
- <td><code>ras8m.upp</code></td>
-
- <td>8-bit</td>
-
- <td>grayscale (Floyd-Steinberg)</td>
- </tr>
-<tr>
-
- <td><code>ras24.upp</code></td>
-
- <td>24-bit</td>
-
- <td>RGB (Floyd-Steinberg)</td>
- </tr>
-<tr>
-
- <td><code>ras32.upp</code></td>
-
- <td>32-bit</td>
-
- <td>CMYK (CMYK-Floyd-Steinberg)</td>
-</tr>
-</table>
-</blockquote>
-
-<p>
-Thanks to Danilo Beuche, Guido Classen, Mark Goldberg and Hans-Heinrich
-Viehmann for providing the files for the stc200, hp690, stc500 and the
-stc640. Thanks to Michael Lossin &lt;losse@germanymail.com&gt; for the
-newer st640 parameter sets.</p>
-
-<p>
-Please note the following:</p>
-
-<blockquote><ul>
-<li>Changing the resolution with Ghostscript's
-<a href="Use.htm#Resolution_switch"><code>-r</code> switch</a> is
-usually not possible.</li>
-<li>For Epson Stylus Color models not listed above, the two
-<code>stc500</code> variants are likely to work in addition to
-<code>stcany</code>, but their gamma correction might be wrong.</li>
-</ul></blockquote>
-
-<h3><a name="Uni_state"></a>The state of this driver</h3>
-
-<p>
-The coding of <code>uniprint</code> was triggered by the requirements of
-the various Stylus Color models and some personal needs for HP and NEC
-drivers. Thus the Epson models are well represented among the distributed
-parameter files. When this driver entered the beta test phase, three other
-drivers appreared on the scene that could be at least partially integrated
-into <code>uniprint</code>: <code>cdj850</code> by Uli Wortmann
-(available at <a href="http://www.erdw.ethz.ch/~bonk/hp850/hp850.html">http://www.erdw.ethz.ch/~bonk/hp850/hp850.html</a>),
-<code>hpdj</code> by Martin Lottermoser, and <code>bjc610</code> by
-Helmut Riegler.</p>
-
-<p>
-Uli addresses features of the more recent DeskJet models that will not be
-available in <code>uniprint</code> soon. Martin taught me a lesson on
-HP-PCL3 headers that will be available in <code>uniprint</code>
-soon. Helmut in turn followed an almost similar idea, but targetted
-primarily for printing on Canon printers from the pbmplus library. Starting
-with version 1.68 of uniprint, BJC support is available. Work on the
-<code>hpdj</code> integration will start after the update of my website.</p>
-
-<h3><a name="Uni_background"></a>Notes on <code>uniprint</code>'s background</h3>
-
-<p>
-<code>uniprint</code> is actually an update of <code>stcolor</code>,
-but much more versatile than its predecessor; <code>stcolor</code>, in
-its turn, started as a clone of the color DeskJet family of drivers
-(<code>cdj</code>*). Finally, <code>cdj</code>* can be considered an
-addition of features to the simpler monochrome drivers of Ghostscript. This
-addition of features is useful to get an idea of the functionality of
-<code>uniprint</code>:</p>
-
-<blockquote>
-<dl>
-<dt>Monochrome to advanced color (<code>cdj</code>*):
-<dd>This adds color mapping and rendering functions to the driver.
-Error diffusion is especially important for the quality of printing.
-</dl>
-
-<dl>
-<dt>HP color to Epson Color (<code>stcolor</code>)
-<dd>The Epson Stylus Color offered two features simultaneously: it could
-produce 720&times;720dpi output and it could soak the paper. In other
-words, it required more color management features inside the driver. This
-is still the major conceptual difference in the data generation for HP and
-Epson printers.
-</dl>
-
-<dl>
-<dt>Weaving techniques (<code>stcolor</code>)
-<dd>Besides the internal color management, the Stylus Color did not provide
-enough buffer space to operate the printer fast at 720&times;720dpi. The
-use of weaving could yield triple the print speed. Weaving, also called
-interleaving, is present in some monochrome drivers too. The new thing in
-<code>stcolor</code> was the combination with error diffusion.
-Unfortunately the weaving was somehow hard-coded, as the problems with the
-newer members of the Stylus Color family of printers demonstrated.
-</dl>
-
-<dl>
-<dt>Generalized output format and weaving (<code>uniprint</code>)
-<dd>The features mentioned above yield about 90% of
-<code>stcolor</code>'s source code; only 10% is related to the
-formatting of the output. The idea to make the output format switchable
-came up soon after completing <code>stcolor</code>, but its final design
-was triggered by the (personal) necessity to drive a NEC P2X and a
-Designjet 750c.
-</dl></blockquote>
-
-<p>
-Thus <code>uniprint</code> accumulates almost any features that can be
-found among the other printer drivers, which clearly has some disadvantage
-in processing speed -- true in particular of version 1.75, since it was
-targetted for functionality, and several speed-gaining features were
-(knowingly) omitted.</p>
-
-<p>
-To summarize and to introduce the terms used in the description of the
-parameters, the features of <code>uniprint</code> that can be
-parameterized are:</p>
-
-<blockquote><ul>
-<li>color mapping,</li>
-<li>color rendering (error diffusion or Floyd-Steinberg),</li>
-<li>output format, including</li>
-<li>weaving.</li>
-</ul></blockquote>
-
-<h3><a name="Uni_make_pfile"></a>Godzilla's guide to the creation of Unified Printer Parameter (<code>.upp</code>) files</h3>
-
-<p>
-Here is one of the distributed parameter files (<code>stc_l.upp</code>)
-with some added comments. Also see the section that describes
-<a href="#Uni_all_parameters">all <code>uniprint</code>'s parameters in
-brief</a>.</p>
-
-<pre>
--supModel="Epson Stylus Color I (and PRO Series), 360x360DpI, noWeave"
--sDEVICE=uniprint -- Select the driver
--dNOPAUSE -- Useful with printers
--dSAFER -- Provides some security
--dupColorModel=/DeviceCMYK -- Selects the color mapping
--dupRendering=/ErrorDiffusion -- Selects the color rendering
--dupOutputFormat=/EscP2 -- Selects the output format
--r360x360 -- Adjusts the resolution
--dupMargins="{ 9.0 39.96 9.0 9.0}" -- Establishes (L/B/R/T margins in points)
--dupComponentBits="{1 1 1 1}" -- Map: bits per component (default: 8)
--dupWeaveYPasses=4 -- Weave: Y-passes (default: 1)
--dupOutputPins=15 -- Format/weave: scans per Command
--dupBeginPageCommand="&lt; -- Goes to the printer
- 1b40 1b40 -- ESC '@' ESC '@' -&gt; dual reset
- 1b2847 0100 01 -- ESC '(' 'G' 1 0 1 -&gt; graphics
- 1b2869 0100 00 -- ESC '(' 'i' 1 0 1 -&gt; no HW weave
- 1b2855 0100 0A -- ESC '(' 'U' 1 0 10 -&gt; 360dpi
- 1b5500 -- ESC 'U' 0 -&gt; bidir print
- 1b2843 0200 0000 -- ESC '(' 'C' 2 0 xx -&gt; page length
- 1b2863 0400 0000 0000 -- ESC '(' 'c' 4 0 xxxx -&gt; margins
-&gt;" -- as it is, unless:
--dupAdjustPageLengthCommand -- Adjust page length in BOP requested
--dupAdjustTopMarginCommand -- Adjust top margin in BOP
--dupAdjustBottomMarginCommand -- Adjust bottom margin in BOP
--dupEndPageCommand="(\033@\014)" -- Last (but one) data to the printer
--dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
-</pre>
-
-<p>
-That's short, and if one removes <code>upWeaveYPasses</code> and
-<code>upOutputPins</code> it becomes shorter, almost
-<code>stcany.upp</code>. This miniature size is because I am most
-familiar with ESC/P2, and was able to add defaults for the omitted
-parameters. Now a few notes about the parameters used in this example:</p>
-
-<ul>
-<li><code>upModel</code> is a string serving as a comment (and nothing else).</li>
-
-<li><a href="Use.htm#Output_device"><code>DEVICE</code></a>,
-<a href="Use.htm#NoPause"><code>NOPAUSE</code></a>, <a
-href="Use.htm#Safer"><code>SAFER</code></a> are well-known Ghostscript
-parameters described in the <a href="Use.htm">usage documentation</a>.</li>
-
-<li><code>upColorModel</code> is one of major <code>uniprint</code>
-parameters: it selects the color mapping and in turn the PostScript color
-model. It supports the devices <code>/DeviceGray</code>, <code>/DeviceRGBW</code>, <code>/DeviceRGB</code>, <code>/DeviceCMYK</code>, and <code>/DeviceCMYKgenerate</code>.</li>
-
-<li><code>upRendering</code> selects the (color) rendering, supporting
-the values <code>/ErrorDiffusion</code> and <code>/FSCMYK32</code>.
-<code>/ErrorDiffusion</code> is similar to <code>fsmono</code>,
-<code>fsrgb</code> and <code>fsx4</code> of <code>stcolor</code>,
-while <code>/FSCMYK32</code> is (almost) identical to
-<code>fscmyk</code> and <code>hscmyk</code>, but is restricted to
-32-bit data and should be used in conjunction with
-<code>/DeviceCMYKgenerate</code>.</li>
-
-<li><code>upOutputFormat</code> selects the output method, supporting the values
-<code>/SunRaster</code>, <code>/Epson</code>, <code>/EscP2</code>, <code>/EscP2XY</code>, and<code>/Pcl</code>.
-
-<blockquote>
-<table>
-<tr>
- <td><code>/SunRaster</code></td>
-
- <td>creates Sun raster files and requires no other parameters</td>
- </tr>
-<tr>
- <td><code>/Epson</code></td>
-
- <td>is used for the elderly ESC/P format (used by many printers)</td>
- </tr>
-<tr>
- <td><code>/EscP2</code></td>
-
- <td>is used by more recent Epson printers (no X weaving supported)</td>
- </tr>
-<tr>
- <td><code>/EscP2XY</code></td>
-
- <td>supports X-Weaving, used with 1440dpi printers and in <code>stc2s_h</code></td>
- </tr>
-<tr>
- <td><code>/Pcl</code></td>
-
- <td>HP PCL/RTL-style output formatter without weaving</td>
- </tr>
-</table>
-</blockquote>
-</li>
-<li><code>-r360x360</code> is Ghostscript's standard
-<a href="Use.htm#Resolution_switch">resolution switch</a>.</li>
-
-<li><code>upMargins="{&nbsp;9.0&nbsp;39.96&nbsp;9.0&nbsp;9.0}"</code>
-has function similar to the Ghostscript parameter
-<code>.HWMargins</code>: it sets the left, bottom, right, and top
-margins in points. <code>uniprint</code> provides this parameter to
-enable automatic left-right exchange if <code>upYFlip</code> is active.</li>
-
-<li><code>upComponentBits</code> is an array of integers that selects
-the bits stored in raster memory, by default 8 bits per component. In this
-example, 1 bit is selected for each component, thus turning down the
-Floyd-Steinberg algorithm (but still carrying out the time-consuming
-computation). The related parameter "<code>upComponentShift</code>"
-controls positioning the components within raster memory. Each of the
-numbers given corresponds to a component which depends on the selected
-"<code>upColorModel</code>":
-<blockquote>
-<table>
-<tr>
- <td align="center">&nbsp;</td>
-
- <td align="center"><code>/DeviceGray</code></td>
-
- <td align="center"><code>/DeviceRGBW</code></td>
-
- <td align="center"><code>/DeviceRGB</code></td>
-
- <td align="center"><code>/DeviceCMYK</code></td>
-
- <td align="center"><code>/DeviceCMYKgenerate</code></td>
- </tr>
-<tr>
- <td colspan="6"></td>
- </tr>
-<tr>
- <td align="center">0</td>
-
- <td align="center">White</td>
-
- <td align="center">White</td>
-
- <td align="center">Red</td>
-
- <td align="center">Black</td>
-
- <td align="center">Black</td>
- </tr>
-<tr>
- <td align="center">1</td>
-
- <td align="center">--</td>
-
- <td align="center">Red</td>
-
- <td align="center">Green</td>
-
- <td align="center">Cyan</td>
-
- <td align="center">Cyan</td>
- </tr>
-<tr>
- <td align="center">2</td>
-
- <td align="center">--</td>
-
- <td align="center">Green</td>
-
- <td align="center">Blue</td>
-
- <td align="center">Magenta</td>
-
- <td align="center">Magenta</td>
- </tr>
-<tr>
- <td align="center">3</td>
-
- <td align="center">--</td>
-
- <td align="center">Blue</td>
-
- <td align="center">--</td>
-
- <td align="center">Yellow</td>
-
- <td align="center">Yellow</td>
- </tr>
-</table>
-
-<p>
-This order may not be suitable for some printers, so another parameter
-"<code>upOutputComponentOrder</code>", also an array of integers,
-selects the output order using the numbers on the left.</p>
-</blockquote>
-
-<p>
-One group of very important parameters not used in the example above
-deserves to be mentioned here: the transfer arrays, named
-"<code>up<em>{color}</em>Transfer</code>", where
-<code><em>{color}</em></code> is one of the names in the table above.
-These are
-arrays of floats in the range 0.0 - 1.0 representing the color transfer
-functions. They are used during mapping and rendering. In the simplest
-case, these arrays ensure an equidistant distribution of the stored values
-within the device space (which means a nonlinear mapping from Ghostscript's
-point of view). If the given array does not cover the entire range from 0
-to 1, which applies for the Stylus Color family at high resolution for some
-media, only the relevant part gets mapped to raster memory (meaning that
-is's fully utilized) and the rendering takes care of the "overhang" (in
-this case the post-diffusion of 1-bit components makes sense).</p>
-
-<p>
-Finally an important note on the transfer arrays: for monochrome devices
-the stored component is <code>White</code>, which is the way PostScript
-defines these devices, but most printers require <code>Black</code>.
-Thus one has to provide a falling "<code>upWhiteTransfer</code>" for
-such printers.</p>
-</li>
-
-<li><code>upWeaveYPasses</code> is an integer that gives the number of
-print head passes required to achieve the requested Ydpi. This makes sense
-only if</li>
-
-<li><code>upOutputPins</code> is set to something greater than 1. Thus
-multiple pins or nozzles are transferred with a single command, and of
-course such a command must be supported by the device.</li>
-
-</ul>
-
-<p>
-If no other weave parameters are given, <code>uniprint</code> computes
-several defaults which together do no weaving. The <code>/Epson</code>
-and <code>/EscP2XY</code> formats take care of
-"<code>upWeaveXPasses</code>" too.</p>
-
-<ul>
-
-<li><code>upBeginPageCommand</code> represents the data transferred to
-the printer whenever a new page begins. Before that,
-"<code>upBeginJobCommand</code>" is written to the device only once per
-output file. (Intended for the HP PJL sequences).</li>
-
-<li><code>upAdjustBottomMarginCommand</code>,
-<code>upAdjustMediaSize</code>,
-<code>upAdjustPageLengthCommand</code>,
-<code>upAdjustPageWidthCommand</code>,
-<code>upAdjustResolutionCommand</code>, and
-<code>upAdjustTopMarginCommand</code>
-
-<p>
-Normally <code>uniprint</code> does not change the
-"<code>upBeginPageCommand</code>", nor does it provide a default.
-However, if the above boolean values are set, the corresponding values are
-changed (provided that the code of the formatters supports this change and
-the commands to be adjusted are included in the BOP string).</p>
-</li>
-
-<li><code>upEndPageCommand</code> is the fixed termination sequence for
-each page, and of course there is an "<code>upEndJobCommand</code>" too.</li>
-
-<li><code>upAbortCommand</code> is written if <code>uniprint</code>'s
-interrupt detection is enabled and a signal is caught. It replaces
-"<code>upEndPageCommand</code>" and "<code>upEndJobCommand</code>",
-thus allowing the indication of an aborted job. (Ghostscript gets an error
-return from <code>uniprint</code> in this case, and abandons further
-processing.)</li>
-
-</ul>
-
-<p>
-For the ESC/P(2) formats all commands represent binary data, while for
-the PCL/RTL formatter some of them are formats for <code>fprintf</code>. These strings
-<b><em>must</em></b> explicitly have a trailing "\0'.</p>
-
-<p>
-I should write more, but the only recommendation is to
-take a look at the various parameter files. Here are a few more hints.</p>
-
-<ul>
-<li>If the Driver rejects a configuration, nothing happens until
-<code>showpage</code>; then an error is raised and a message with
-"CALL-REJECTED upd_print_page..." is printed on stderr.</li>
-
-<li><code>uniprint</code> has lots of messages that can be activated by
-setting bits in the preprocessor macro <code>UPD_MESSAGES</code>. I
-usually use the compile-time option <code>-DUPD_MESSAGES=0x17</code> for
-configuration development. (For the semantics, check the
-<code>UPD_M_</code> macros in the source.)</li>
-
-<li>A program "<code>uninfo.ps</code>" distributed with Ghostscript
-displays interactively in alphabetical order the contents of the current
-pagedevice dictionary. This includes any parameters generated or changed by
-<code>uniprint</code>.</li>
-</ul>
-
-<h3><a name="Uni_all_parameters"></a>All parameters in brief</h3>
-
-<p>
-This table gives a brief explanation of every parameter known to
-<code>uniprint</code>, listing them in alphabetical order. "[&nbsp;]"
-denotes that a parameter is an array, and "(RO)" that it is read-only.</p>
-
-<blockquote>
-<table>
-<tr>
- <th colspan="3">All uniprint parameters</th>
- </tr>
-<tr>
- <th align="left">Parameter</th>
-
- <th align="left">Type</th>
-
- <th align="left">Use</th>
- </tr>
-<tr>
- <td><code>upAbortCommand</code></td>
-
- <td>String</td>
-
- <td>End of page and file on interrupt</td>
- </tr>
-<tr>
- <td><code>upAdjustBottomMarginCommand</code></td>
-
- <td>Bool</td>
-
- <td>Manipulate bottom margin in <code>upBeginPageCommand</code></td>
- </tr>
-<tr>
- <td><code>upAdjustMediaSizeCommand</code></td>
-
- <td>Bool</td>
-
- <td>Manipulate <code>Mediasize</code> [intended]</td>
- </tr>
-<tr>
- <td><code>upAdjustPageLengthCommand</code></td>
-
- <td>Bool</td>
-
- <td>Manipulate page length in <code>upBeginPageCommand</code></td>
- </tr>
-<tr>
- <td><code>upAdjustPageWidthCommand</code></td>
-
- <td>Bool</td>
-
- <td>Manipulate page width in <code>upBeginPageCommand</code></td>
- </tr>
-<tr>
- <td><code>upAdjustResolutionCommand</code></td>
-
- <td>Bool</td>
-
- <td>Manipulate resolution</td>
- </tr>
-<tr>
- <td><code>upAdjustTopMarginCommand</code></td>
-
- <td>Bool</td>
-
- <td>Manipulate top margin in <code>upBeginPageCommand</code></td>
- </tr>
-<tr>
- <td><code>upBeginJobCommand</code></td>
-
- <td>String</td>
-
- <td>Begin each output file</td>
- </tr>
-<tr>
- <td><code>upBeginPageCommand</code></td>
-
- <td>String</td>
-
- <td>Begin each page</td>
- </tr>
-<tr>
- <td><code>upBlackTransfer</code></td>
-
- <td>Float[&nbsp;]</td>
-
- <td>Black transfer (CMYK only!)</td>
- </tr>
-<tr>
- <td><code>upBlueTransfer</code></td>
-
- <td>Float[&nbsp;]</td>
-
- <td>Blue transfer</td>
- </tr>
-<tr>
- <td><code>upColorInfo</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>struct <code>gx_device_color_info</code></td>
- </tr>
-<tr>
- <td><code>upColorModel</code></td>
-
- <td>Name</td>
-
- <td>Select color mapping</td>
- </tr>
-<tr>
- <td><code>upColorModelInitialized</code></td>
-
- <td>Bool (RO)</td>
-
- <td>Color mapping OK</td>
- </tr>
-<tr>
- <td><code>upComponentBits</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>Bits stored per component</td>
- </tr>
-<tr>
- <td><code>upComponentShift</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>Positioning within <code>gx_color_index</code></td>
- </tr>
-<tr>
- <td><code>upCyanTransfer</code></td>
-
- <td>Float[&nbsp;]</td>
-
- <td>Cyan transfer</td>
- </tr>
-<tr>
- <td><code>upEndJobCommand</code></td>
-
- <td>String</td>
-
- <td>End each file unless <code>upAbortCommand</code></td>
- </tr>
-<tr>
- <td><code>upEndPageCommand</code></td>
-
- <td>String</td>
-
- <td>End each page unless <code>upAbortCommand</code></td>
- </tr>
-<tr>
- <td><code>upErrorDetected</code></td>
-
- <td>Bool (RO)</td>
-
- <td>Severe (VM) error, not fully operational</td>
- </tr>
-<tr>
- <td><code>upFSFixedDirection</code></td>
-
- <td>Bool</td>
-
- <td>Inhbits direction toggling in rendering</td>
- </tr>
-<tr>
- <td><code>upFSProcessWhiteSpace</code></td>
-
- <td>Bool</td>
-
- <td>Causes white-space rendering</td>
- </tr>
-<tr>
- <td><code>upFSReverseDirection</code></td>
-
- <td>Bool</td>
-
- <td>Run rendering in reverse (if fixed)</td>
- </tr>
-<tr>
- <td><code>upFSZeroInit</code></td>
-
- <td>Bool</td>
-
- <td>Non-random rendering initialization</td>
- </tr>
-<tr>
- <td><code>upFormatXabsolute</code></td>
-
- <td>Bool</td>
-
- <td>Write absolute X coordinates</td>
- </tr>
-<tr>
- <td><code>upFormatYabsolute</code></td>
-
- <td>Bool</td>
-
- <td>Write absolute Y coordinates</td>
- </tr>
-<tr>
- <td><code>upGreenTransfer</code></td>
-
- <td>Float[&nbsp;]</td>
-
- <td>Green transfer</td>
- </tr>
-<tr>
- <td><code>upMagentaTransfer</code></td>
-
- <td>Float[&nbsp;]</td>
-
- <td>Magenta transfer</td>
- </tr>
-<tr>
- <td><code>upMargins</code></td>
-
- <td>Float[&nbsp;]</td>
-
- <td>L/B/R/T margins in points</td>
- </tr>
-<tr>
- <td><code>upModel</code></td>
-
- <td>String</td>
-
- <td>Comment string, holds some info</td>
- </tr>
-<tr>
- <td><code>upOutputAborted</code></td>
-
- <td>Bool (RO)</td>
-
- <td>Caught an interrupt</td>
- </tr>
-<tr>
- <td><code>upOutputBuffers</code></td>
-
- <td>Int</td>
-
- <td>Number of rendering buffers (2^<small><sup><b>N</b></sup></small>)</td>
- </tr>
-<tr>
- <td><code>upOutputComponentOrder</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>Order of components when printing</td>
- </tr>
-<tr>
- <td><code>upOutputComponents</code></td>
-
- <td>Int</td>
-
- <td>Number of written components, not fully operational</td>
-<tr>
- <td><code>upOutputFormat</code></td>
-
- <td>Name</td>
-
- <td>Select output format</td>
- </tr>
-<tr>
- <td><code>upOutputFormatInitialized</code></td>
-
- <td>Bool (RO)</td>
-
- <td>Format data OK</td>
- </tr>
-<tr>
- <td><code>upOutputHeight</code></td>
-
- <td>Int</td>
-
- <td>Output height in pixels</td>
- </tr>
-<tr>
- <td><code>upOutputPins</code></td>
-
- <td>Int</td>
-
- <td>Number of pins / nozzles per command</td>
- </tr>
-<tr>
- <td><code>upOutputWidth</code></td>
-
- <td>Int</td>
-
- <td>Output width in pixels</td>
- </tr>
-<tr>
- <td><code>upOutputXOffset</code></td>
-
- <td>Int</td>
-
- <td>Offset in pixels, if <code>upFormatXabsolute</code></td>
-</tr>
-<tr>
- <td><code>upOutputXStep</code></td>
-
- <td>Int</td>
-
- <td>Divisor or multiplier for X coords</td>
- </tr>
-<tr>
- <td><code>upOutputYOffset</code></td>
-
- <td>Int</td>
-
- <td>Offset in pixels, if <code>upFormatYabsolute</code></td>
- </tr>
-<tr>
- <td><code>upOutputYStep</code></td>
-
- <td>Int</td>
-
- <td>Divisor or multiplier for Y coords</td>
- </tr>
-<tr>
- <td><code>upRasterBufferInitialized</code></td>
-
- <td>Bool (RO)</td>
-
- <td>GS buffer OK</td>
- </tr>
-<tr>
- <td><code>upRedTransfer</code></td>
-
- <td>Float[&nbsp;]</td>
-
- <td>Red transfer</td>
-</tr>
-<tr>
- <td><code>upRendering</code></td>
-
- <td>Name</td>
-
- <td>Select rendering algorithm</td>
- </tr>
-<tr>
- <td><code>upRenderingInitialized</code></td>
-
- <td>Bool (RO)</td>
-
- <td>Rendering parameters OK</td>
- </tr>
-<tr>
- <td><code>upSelectComponentCommands</code></td>
-
- <td>String[&nbsp;]</td>
-
- <td>Establish color (output order!)</td>
- </tr>
-<tr>
- <td><code>upSetLineFeedCommand</code></td>
-
- <td>String</td>
-
- <td>Adjust linefeed (Epson only)</td>
- </tr>
-<tr>
- <td><code>upVersion</code></td>
-
- <td>String (RO)</td>
-
- <td>Source code version</td>
- </tr>
-<tr>
- <td><code>upWeaveFinalPins</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>Number of bottom pins on EOP passes</td>
- </tr>
-<tr>
- <td><code>upWeaveFinalScan</code></td>
-
- <td>Int</td>
-
- <td>Begin EOP passes (Y-coord)</td>
- </tr>
-<tr>
- <td><code>upWeaveFinalXStarts</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>X-pass indices for EOP passes</td>
- </tr>
-<tr>
- <td><code>upWeaveFinalYFeeds</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>Y increments for EOP passes</td>
- </tr>
-<tr>
- <td><code>upWeaveInitialPins</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>Number of top pins on BOP passes</td>
- </tr>
-<tr>
- <td><code>upWeaveInitialScan</code></td>
-
- <td>Int</td>
-
- <td>End BOP passes (Y coord)</td>
- </tr>
-<tr>
- <td><code>upWeaveInitialXStarts</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>X-pass indices for BOP passes</td>
- </tr>
-<tr>
- <td><code>upWeaveInitialYFeeds</code></td>
-
- <td>int[&nbsp;]</td>
-
- <td>Y increments for BOP passes</td>
- </tr>
-<tr>
- <td><code>upWeavePasses</code></td>
-
- <td>Int</td>
-
- <td>XPasses &times; YPasses</td>
- </tr>
-<tr>
- <td><code>upWeaveXPasses</code></td>
-
- <td>Int</td>
-
- <td>Number of X passes</td>
-</tr>
-<tr>
- <td><code>upWeaveXStarts</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>X-pass indices for normal passes</td>
- </tr>
-<tr>
- <td><code>upWeaveYFeeds</code></td>
-
- <td>Int[&nbsp;]</td>
-
- <td>Y increments for normal passes</td>
- </tr>
-<tr>
- <td><code>upWeaveYOffset</code></td>
-
- <td>Int</td>
-
- <td>Number of blank or incomplete scans at BOP</td>
- </tr>
-<tr>
- <td><code>upWeaveYPasses</code></td>
-
- <td>Int</td>
-
- <td>Number of X passes</td>
- </tr>
-<tr>
- <td><code>upWhiteTransfer</code></td>
-
- <td>Float[&nbsp;]</td>
-
- <td>White transfer (monochrome devices!)</td>
- </tr>
-<tr>
- <td><code>upWriteComponentCommands</code></td>
-
- <td>String[&nbsp;]</td>
-
- <td>Commands to write each component</td>
- </tr>
-<tr>
- <td><code>upWroteData</code></td>
-
- <td>Bool (RO)</td>
-
- <td>Something (<code>BeginJob</code>) written to output</td>
- </tr>
-<tr>
- <td><code>upXMoveCommand</code></td>
-
- <td>String</td>
-
- <td>X positioning command</td>
- </tr>
-<tr>
- <td><code>upXStepCommand</code></td>
-
- <td>String</td>
-
- <td>Single step to the right</td>
- </tr>
-<tr>
- <td><code>upYFlip</code></td>
-
- <td>Bool</td>
-
- <td>Flips output along the Y axis</td>
- </tr>
-<tr>
- <td><code>upYMoveCommand</code></td>
-
- <td>String</td>
-
- <td>Y positioning command</td>
- </tr>
-<tr>
- <td><code>upYStepCommand</code></td>
-
- <td>String</td>
-
- <td>Single step down</td>
- </tr>
-<tr>
- <td><code>upYellowTransfer</code></td>
-
- <td>Float[&nbsp;]</td>
-
- <td>Yellow transfer</td>
- </tr>
-</table>
-</blockquote>
-
-<h3><a name="Uni_honors"></a><code>uniprint</code>'s Roll of Honor</h3>
-
-<p>
-I should mention all of the people who were involved in
-<code>stcolor</code>'s evolution, but I've decided to start from scratch
-here for <code>uniprint</code>:</p>
-
-<blockquote>
-<dl>
-<dt>John P. Beale
-<dd>for testing the <code>stc600</code> modes
-<dt>Bill Davidson
-<dd>who triggered some weaving research and tested <code>stc2s_h</code>
-<dt>L. Peter Deutsch
-<dd>who triggered ease of configuration
-<dt>Mark Goldberg
-<dd>who prepared the <code>stc500</code> transfers
-<dt>Scott F. Johnston and Scott J. Kramer
-<dd>for testing the <code>stc800</code> modes
-<dt>Martin Lottermoser
-<dd>for his great commented H-P DeskJet driver
-<dt>Helmut Riegler
-<dd>for the BJC extension
-<dt>Hans-Gerd Straeter
-<dd>for some measured transfer curves and more
-<dt>Uli Wortmann
-<dd>for discussions and his <code>cdj850</code> driver
-<dt>My family
-<dd>for tolerating my printer-driver hacking
-</dl>
-</blockquote>
-
-<address>
-Gunther Hess<br>
-Duesseldorfer Landstr. 16b<br>
-D-47249 Duisburg<br>
-Germany<br>
-+49 203 376273 telephone (MET evening hours)<br>
-&lt;<a href="mailto:ghess@elmos.de">ghess@elmos.de</a>&gt;
-</address>
-
-<h3><a name="Uni_weaving_howto"></a><tt>Uniprint</tt> weaving parameters howto</h3>
-<p>This section was contributed by Glenn Ramsey.</p>
-<p>I wrote this because the documentation was very brief and I really struggled
-with it for a while, but it is very simple once you understand what is going
-on.</p>
-<p>This only describes how to work out the Y parameters, I haven't looked
-at the X parameters yet.</p>
-<ol>
-<li>
-<b>Determine the nozzle geometry (upOutputPins)</b>
-<p>
-You need to know how many nozzles the printer has and the spacing between
-them. Usually you can find this out from the printer manual, or the printer
-supplier, but you may have to dissect a couple of printer output files
-produced with the driver supplied with the printer. There is a utility
-called escp2ras<a href="#escp2ras"><sup>*</sup></a> that will help with that.
-Sometimes the term pin is used instead of nozzle but they mean the same thing. </p>
-<p>The number of nozzles will be the value assigned to the upOutputPins
-parameter.</p>
-<p>Actually you don't have to print with all the pins available but for
-the purpose of demonstration I'll assume that we are using them all.</p>
-<p>
-<a name="escp2ras"></a>* escp2ras is available from Gunther Hess' page at <a href="http://www-md.e-technik.uni-rostock.de/ma/gunther/gs/index.html">http://www-md.e-technik.uni-rostock.de/ma/gunther/gs/index.html</a></p>
-</li>
-<li><b>Determine how many passes are required (upWeaveYPasses)</b></li>
-<li>The number of passes required is going to depend on the required resolution
-and the nozzle spacing.
-<blockquote>
-<tt>passes = resolution * nozzle spacing
-</tt>
-</blockquote>
-This will be the value assigned to the upWeaveYPasses parameter.
-<p>For example if the desired resolution is 360 dpi and the nozzles are
-spaced at 1/90in then 360 * 1/90 = 4 passes are required. For 720 dpi 8
-passes would be required. The printer would, of course, have to be capable
-of moving the paper in increments of either 360 or 720 dpi too.</p>
-
- </li>
-<li>
-<b>Determine the normal Y feed increment (upWeaveYFeeds)</b></p>
-<p>
-You need to work out how much to feed the paper so that when the paper
-has moved by one head length in however many passes you have then each
-row space on the paper has been passed over by at least one nozzle. There
-will be one feed value for each pass and the feed values must comply with
-the following rules:</p>
-<blockquote>
-<p><tt>sum of feeds = passes * nozzles
-<br>feed%passes != 0 (feed is not exactly divisible by passes)
-<br>sum of (nozzles - feed) = 0</tt></p>
-
-</blockquote>
-<p>For example if passes=4 and nozzles=15, then sum of feeds=60. The feed
-values could be 1,1,1,57 or 15,15,15,15 or 14,15,18,13.</p>
-<p>These values will be assigned to the upWeaveYFeeds parameter.</p>
-<p>You would need to experiment to see what combination looks best on the
-printer.</p>
-<p>I found it convenient to draw several lines of nozzles and then move
-them around to see how the different combinations would fill the paper.
-A computer drawing tool makes this easier than pencil and paper (I used
-Dia, a GNOME app). The number of nozzles would probably be be a good place
-to start.</p>
-<p>Remember that if the number of passes is more than 1 then the feed increment
-will be less than the nozzle spacing and <tt>passes &times; feed increment size</tt>
-must equal the physical distance between each nozzle.</p>
-<p>
-</li>
-<li>
-<b>Determine the beginning of page pins (upWeaveInitialPins)</b></p>
-<p>
-These values will be assigned to the upWeaveInitialPins parameter and are
-the numbers of nozzles to operate in each of the initial passes at the top
-of a page. The nozzles that the values refer to are the topmost nozzles
-on the head, nearest the top margin. If the image doesn't start at the
-top margin then uniprint doesn't use these feeds.</p>
-<p>I don't know a mathematical relation for this except that at least one
-of the values must be the number of nozzles, but I'm sure that there must
-be one. I used a graphical method, the description that follows refers
-to the ascii diagram in below.</p>
-<p>Draw a line of nozzles for each pass arranged as they would be using
-the normal Y feed increment determined in step 3. In the diagram below
-this would be passes 5-8.</p>
-<p>Draw a line of nozzles that would print just before the first normal
-pass. The feed increment for this pass will be close to and most likely
-1 or 2 units less than the feed increment of the last normal pass. In the
-example below this line is pass 4 and the feed increment is 13 whereas
-the normal feed increment is 15.</p>
-<p>Draw each pass before that with a small feed increment so that if all
-of the nozzles appearing above the first nozzle of the first normal pass
-operate then all of the spaces will be filled. This feed increment is usually
-1 except in cases where some jiggery pokery is going on to make the printer
-print at an apparent higher resolution than the nozzle diameter.</p>
-<p>Now select the nozzles that will operate in each of theses initial passes
-so that the paper is filled. In each pass the nozzles must be adjacent
-to each other and at least one of the passes will have all the nozzles
-operating. I suspect that for each combination of normal Y feed increments
-there will only be one set of valid beginning of page increments.</p>
-</li>
-</ol>
-<h4>Example: stc.upp from Aladdin Ghostscript 6.01</h4>
-15 nozzles spaced at 1/90 in, 360 dpi requires 4 passes.
-<blockquote><pre><tt>
--dupWeaveYPasses=4
--dupOutputPins=15
--dupWeaveYFeeds="{15 15 15 15}"
--dupWeaveInitialYFeeds="{1 1 1 13}"
--dupWeaveInitialPins="{ 4 15 11 7}"
-</tt></pre></blockquote>
-The following diagram shows which nozzles operate during each pass.
-<br>Passes 1-4 are beginning of page passes and passes 5-8 are normal passes.
-<blockquote>
-<p>x=nozzle operates, o=nozzle not used in this pass<tt></tt></p>
-<p><tt>&nbsp; 1 2 3 4 5 6 7 8 - pass no</tt></p>
-<br><tt>0 x</tt>
-<br><tt>1&nbsp;&nbsp; x</tt>
-<br><tt>2&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>4 x</tt>
-<br><tt>5&nbsp;&nbsp; x</tt>
-<br><tt>6&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>8 x</tt>
-<br><tt>9&nbsp;&nbsp; x</tt>
-<br><tt>0&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>2 x</tt>
-<br><tt>3&nbsp;&nbsp; x</tt>
-<br><tt>4&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>6 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>7&nbsp;&nbsp; x</tt>
-<br><tt>8&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>0 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>1&nbsp;&nbsp; x</tt>
-<br><tt>2&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>4 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>5&nbsp;&nbsp; x</tt>
-<br><tt>6&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>8 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>9&nbsp;&nbsp; x</tt>
-<br><tt>0&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
-<br><tt>2 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>3&nbsp;&nbsp; x</tt>
-<br><tt>4&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
-<br><tt>6 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>7&nbsp;&nbsp; x</tt>
-<br><tt>8&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
-<br><tt>0 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>1&nbsp;&nbsp; x</tt>
-<br><tt>2&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
-<br><tt>4 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>5&nbsp;&nbsp; x</tt>
-<br><tt>6&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
-<br><tt>8 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>9&nbsp;&nbsp; x</tt>
-<br><tt>0&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
-<br><tt>2 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>3&nbsp;&nbsp; x</tt>
-<br><tt>4&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
-<br><tt>6 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>7&nbsp;&nbsp; x</tt>
-<br><tt>8&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
-<br><tt>0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>6</tt>
-<br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>0</tt>
-<br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>4</tt>
-<br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
-<br><tt>8</tt>
-<br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>1</tt>
-<br><tt>2</tt>
-<br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>5</tt>
-<br><tt>6</tt>
-<br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>9</tt>
-<br><tt>0</tt>
-<br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>3</tt>
-<br><tt>4</tt>
-<br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>6</tt>
-<br><tt>7</tt>
-<br><tt>8</tt>
-<br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>0</tt>
-<br><tt>1</tt>
-<br><tt>2</tt>
-<br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-<br><tt>4</tt>
-<br><tt>5</tt>
-<br><tt>6</tt>
-<br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-x</tt>
-</blockquote>
-<p>These parameters would also work:</p>
-<blockquote><pre><tt>
--dupWeaveYPasses=4
--dupOutputPins=15
--dupWeaveYFeeds="{14 15 18 13}"
--dupWeaveInitialYFeeds="{1 1 1 13}"
--dupWeaveInitialPins="{ 4 11 7 15}"
-</tt></pre></blockquote>
-
-<h3><a name="Uni_esc300"></a>Extension to <tt>uniprint</tt> for the Epson Stylus Color 300</h3>
-<p>This section was contributed by Glenn Ramsey.
-The Epson Stylus Color 300 uses a different command set to other Epson
-Stylus Color printers that use the ESC/P2 language. As far as I can
-tell its commands are a subset of ESC/P2. In ESC/P2 the colour to be
-printed is selected by a 'set colour' command and then the data sent
-is only printed in that colour until the colour is changed with another
-'set colour' command. The Stylus Color 300 lacks this functionality.
-The data sent to the printer maps directly to the ink nozzles and colour
-of an output scan line in the printed output is determined by the position
-of the scan line within the data. This means that the driver must know
-how the nozzles are arranged and must format the output accordingly.
-The extension adds a format that I have called EscNozzleMap and adds some
- additional parameters to uniprint.</p><br>
-<ul>
- <li><code>upOutputFormat</code>selects the output method, and should be set to the value
-<code>/EscNozzleMap</code> to select this format.
- <blockquote>
- <table cellpadding="0" cellspacing="0">
- <tbody>
- <tr valign="Top">
- <td><code>/EscNozzleMap</code></td>
-
- <td>produces output for the Epson Stylus Color 300
- </td>
- </tr>
- </tbody>
- </table>
- </blockquote>
- </li>
-</ul>
-
-<blockquote>
-<table>
- <tr>
- <th colspan="3">uniprint parameters for the EscNozzleMap format</th>
- </tr>
- <tr>
- <th align="Left">Parameter</th>
-
- <th align="Left">Type</th>
-
- <th align="Left">Use</th>
- </tr>
- <tr>
- <td colspan="3"></td>
- </tr>
- <tr>
- <td><code>upNozzleMapRowsPerPass</code></td>
-
- <td>Int
- </td>
-
-
- <td>output rows to generate for each pass of the head
- </td>
- </tr>
- <tr>
- <td><code>upNozzleMapPatternRepeat</code></td>
-
- <td>Int
- </td>
-
- <td>no. of rows that correspond to the repeat pattern of the
- nozzles
- </td>
- </tr>
- <tr>
- <td><code>upNozzleMapRowMask</code></td>
- <td>Int[]
- </td>
- <td>mask indicating the colour of the nozzles
- </td>
- </tr>
- <tr>
- <td><code>upNozzleMapMaskScanOffset</code></td>
-
- <td>Int[]
- </td>
- <td>mask indicating the physical position of the nozzles
- </td>
- </tr>
- </table>
-</blockquote>
-
-<h4>A more detailed description of the new parameters</h4>
-<ul>
- <li><code>upNozzleMapRowsPerPass</code><br>
- The number of rows of data that are required to address all nozzles for a
- single pass of the head. There will always be this number of rows of output
- data generated. I'd expect it to be the same as the total number of nozzles but
- it wouldn't break the formatter if it wasn't. So if you wanted to print with
- only the 10th nozzle then row 10 would contain data corresponding to the bit
- pattern and all of the others would be padded with zeros.
- </li>
- <li><code>upNozzleMapPatternRepeat</code><br>
- The number of nozzles in each repeated group on the printing head.
- This parameter must correspond with the length of the upNozzleMapRowMask array.
- </li>
- <li><code>upNozzleMapRowMask</code><br>
- An array of integers that defines the colour of the nozzles on the
- head and whether the nozzles will be used to print. The array index
- defines the row index for the nozzle in the output data
- and the value defines the colour of the nozzle. The mapping
- of colours to values is defined in the table below.
- <blockquote>
- <table>
- <tr>
- <th align="center">colour
- </th>
-
- <th align="center">mask value
- </th>
- </tr>
- <tr valign="Top" align="center">
- <td><code>K</code></td>
-
- <td>1
- </td>
- </tr>
- <tr valign="Top" align="center">
- <td><code>C</code></td>
-
- <td>2
- </tr>
- <tr valign="Top" align="center">
- <td><code>M</code></td>
-
- <td>3
- </td>
- </tr>
- <tr valign="Top" align="center">
- <td><code>Y</code></td>
-
- <td>4
- </td>
- </tr>
- <tr valign="Top" align="center">
- <td><code>no data</code></td>
-
- <td>0
- </td>
- </tr>
- </tbody>
- </table>
- </blockquote>
- A value of 0 means that the nozzle is not used and the row in the output data will be
- padded with zeros.<br>
- </li>
-
- <li><code>upNozzleMapMaskScanOffset</code><br>
- An array of integers that defines the physical position of the nozzles relative
- to the first nozzle in the repeated group. The relative distance is measured in
- printed line widths and will be different for different printing resolutions.
- This parameter is used because the physical spacing of the nozzles may not
- correspond to their mapping in the output data. For example the ESC300 has nozzles
- physically arranged something like this:
-<p></p>
- <table>
- <tr>
- <td bgcolor="#00ffff">&nbsp;
- </td>
- <td bgcolor="#ffff00">&nbsp;
- </td>
- <td bgcolor="#000000">&nbsp;
- </td>
- <td bgcolor="#ff00ff">&nbsp;
- </td>
- <td bgcolor="#000000">&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td bgcolor="#000000">&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td bgcolor="#00ffff">&nbsp;
- </td>
- <td bgcolor="#ffff00">&nbsp;
- </td>
- <td bgcolor="#000000">&nbsp;
- </td>
- <td bgcolor="#ff00ff">&nbsp;
- </td>
- <td bgcolor="#000000">&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td bgcolor="#000000">&nbsp;
- </td>
- <td bgcolor="#ffffff">&nbsp;
- </td>
- </tr>
- <tr>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td bgcolor="#00ffff">&nbsp;
- </td>
- <td bgcolor="#ffff00">&nbsp;
- </td>
- <td bgcolor="#000000">&nbsp;
- </td>
- <td bgcolor="#ff00ff">&nbsp;
- </td>
- <td bgcolor="#000000">&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td bgcolor="#000000">&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td>&nbsp;
- </td>
- <td bgcolor="#00ffff">&nbsp;
- </td>
- <td bgcolor="#ffff00">&nbsp;
- </td>
- <td>etc ...
- </td>
- </tr>
- </table>
-
-<p>There is a one nozzle width space between the last two nozzles in each group.
- In the output data the data for the last nozzle in the group would be in row 5
- (numbering starts at 0) but the nozzle is physically positioned at 6 spaces from
- the first nozzle. </p>
-
- </li>
-</ul>
-<h4>Example 1 - Epson Stylus Color 300 - 360 dpi colour</h4>
-<blockquote><pre>
--dupWeaveYPasses=6
--dupOutputPins=11
--dupWeaveYFeeds="{ 11 11 11 11 11 11 }"
--dupWeaveInitialYFeeds="{ 1 1 1 1 1 7 }"
--dupWeaveInitialPins="{ 2 11 9 7 5 3 }"
--dupNozzleMapRowsPerPass=64
--dupNozzleMapPatternRepeat=6
--dupNozzleMapRowMask="{ 2 4 1 3 0 0 }"
--dupNozzleMapMaskScanOffset="{ 0 1 2 3 0 0 }"
-</pre></blockquote>
-The weaving parameters are the same as for any other uniprint driver
-but they must be consistent with the nozzle map parameters. In this printer
-the coloured nozzles are spaced at 1/60" so 6 passes are required for 360
-dpi resolution.
-<p>
-In the example there are 64 rows of data required for each head pass. Each
-row must be completely filled with data for each pass so if certain nozzles
-do not print in the pass then the rows for those nozzles will be padded
-with zeroes.</p>
-<P>
-The row mask translates to "C Y K M 0 0" so in the output data rows 0,7,13,...
-will contain data for cyan, rows 1,8,14,... will contain data for yellow, etc. Rows 4,10,16,...
-and 5, 11,15,... will always be padded with zeroes. The <i>upNozzleMapPatternRepeat</i>
-parameter defines the length of the mask.</p>
-<p>
-The row mask is repeated for each group of <i>upNozzleMapPatternRepeat</i> rows
-in the output data. In this case there are 64 rows so there will be 10 groups
-of "C Y K M 0 0" followed by "C Y K M" which is equivalent to 11 output
-pins.</p>
-<P>
-The <i>upNozzleMaskScanOffset</i> array indicates how the data from the scan
-buffer is mapped to the output data. The data is presented to the formatter
-as a buffer of four colour scanlines. The index of the scanline being printed,
-lets call it y, always corresponds, in this example, to the physical position of
-the cyan nozzle but since the nozzles are not on the same horizontal
-line then the other colours for the current pass must come from other
-scanlines in the scan buffer. The example is { 0 1 2 3 0 0 }, this means that
-when printing a 4 colour image the magenta data would come from scanline y+3,
-the black from scanline y+2, etc. It would have been possible in this case
-to use the array index instead of the <i>upNozzleMaskScanOffset</i> parameter
-however the parameter is necessary to be able to use the full capability of the
-printer in black only mode.</p>
-
-<h4>Example 2 - Epson Stylus Color 300 - 180 dpi black only</h4>
-<blockquote>
-<pre>
--dupMargins="{ 9.0 39.96 9.0 9.0}"
--dupWeaveYPasses=1
--dupOutputPins=31
--dupNozzleMapRowsPerPass=64
--dupNozzleMapPatternRepeat=6
--dupNozzleMapRowMask="{ 0 0 1 0 1 1}"
--dupNozzleMapMaskScanOffset="{ 0 0 0 0 1 2 }"
-</pre>
-</blockquote>
-In this example there is no weaving.
-<p>
-The ESC300 has black nozzles evenly physically arranged as K K K but the data must
-be sent to the printer as 00K0KK. This is handled by the <i>upNozzleMapRowMask</i>
-and <i>upNozzleMaskScanOffset</i> arrays. The <i>upNozzleMapRowMask</i> array is
-{ 0 0 1 0 1 1} which translates to { 0 0 K 0 K K } so rows 0, 1 and 3 will always
-contain zeros and the other rows will contain data.</p>
-<p>
-The <i>upNozzleMaskScanOffset</i> array
-in this case is { 0 0 0 0 1 2 } so if the data for the 1st nozzle comes from row
-y in the scan buffer then the data for the 2nd and 3rd nozzles will come from rows
-y+1 and y+2.</p>
-
-<h4>Example 3 - Epson Stylus Color 300 - 360 dpi black only</h4>
-<blockquote>
-<pre>
--dupWeaveYPasses=2
--dupOutputPins=31
--dupWeaveYFeeds="{31 31}"
--dupWeaveInitialYFeeds="{1 31}"
--dupWeaveInitialPins="{16 31}"
--dupNozzleMapRowsPerPass=64
--dupNozzleMapPatternRepeat=6
--dupNozzleMapRowMask="{ 0 0 1 0 1 1}"
--dupNozzleMapMaskScanOffset="{ 0 0 0 0 2 4 }"
-</pre>
-</blockquote>
-In this example 2 weave passes are required to achieve the desired resolution.
-<p>
-The <i>upNozzleMaskScanOffset</i> array in this case is { 0 0 0 0 2 4 } because
-there are two weave passes so if the data for the first nozzle comes from row y
-in the scan buffer then the data for the 2nd and 3rd nozzles must come from rows
-y+(1*2) and y+(2*2).</p>
-<p>
-<address>
-Glenn Ramsey<br>
-glennr at users.sourceforge.net<br>
-February 2001
-</address></p>
-<br>
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Develop.htm b/doc/Develop.htm
deleted file mode 100644
index b74edfbd..00000000
--- a/doc/Develop.htm
+++ /dev/null
@@ -1,4823 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Information for Ghostscript Developers</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Information for Ghostscript Developers</h1>
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Introduction">Introduction</a></li>
- <li><a href="#Architecture">Architecture</a></li>
- <li>
- <ul>
- <li><a href="#Design_goals">Design goals</a></li>
- <li><a href="#Design_principles">Design principles</a></li>
- <li><a href="#Large_scale_structure">Large-scale structure</a></li>
- <li><a href="#Object_oriented_constructs">Object-oriented constructs</a></li>
- </ul>
- </li>
- <li><a href="#File_roadmap">File roadmap</a></li>
- <li>
- <ul>
- <li><a href="#Substrate">Substrate</a></li>
- <li><a href="#Graphics_library">Graphics library</a></li>
- <li>
- <ul>
- <li><a href="#Library_support">Support</a>,
- <a href="#Paths">Paths</a>,
- <a href="#Text">Text</a>,
- <a href="#Images">Images</a>,
- <a href="#Paint">Paint</a>,
- <a href="#Clipping">Clipping</a>,
- <a href="#Other_graphics">Other graphics</a>,
- <a href="#Driver_support">Driver support</a>,
- <a href="#FAPI_support_gx">Font API support</a>
- <a href="#Visual_trace">Visual Trace</a>
- </li>
- </ul>
- </li>
- <li><a href="#Device_drivers">Device drivers</a></li>
- <li>
- <ul>
- <li><a href="#Internal_devices">Internal devices</a>,
- <a href="#PS_and_PDF_writers">PostScript and PDF writers</a>,
- <a href="#High_level_devices">Other high-level devices</a>,
- <a href="#Other_maintained_drivers">Other maintained drivers</a>,
- <a href="#Contributed_drivers">Contributed drivers</a></li>
- </ul>
- </li>
- <li><a href="#PostScript_interpreter">PostScript interpreter</a></li>
- <li>
- <ul>
- <li><a href="#Main_program">Main program</a>,
- <a href="#Data_structures">Data structures</a>,
- <a href="#Stacks">Stacks</a>,
- <a href="#Interpreter_loop">Interpreter loop</a>,
- <a href="#Scanning_parsing">Scanning/parsing</a>,
- <a href="#Standard_operators">Standard operators</a>,
- <a href="#Non_standard_operators">Non-standard operators</a>,
- <a href="#Interpreter_support">Interpreter support</a>,
- <a href="#PostScript_code">PostScript code</a></li>
- </ul>
- </li>
- <li><a href="#PDF_interpreter">PDF interpreter</a></li>
- <li><a href="#PPD">PostScript Printer Description</a></li>
- <li><a href="#Build_process">Build process</a></li>
- <li>
- <ul>
- <li><a href="#Makefile_structure">Makefile structure</a>,
- <a href="#dev_files">.dev files</a>,
- <a href="#Generators">Generators</a>,
- <a href="#Build_support">Support</a></li>
- </ul>
- </li>
- <li><a href="#Utilities">Utilities</a></li>
- <li>
- <ul>
- <li><a href="#Utilities_in_PostScript">Utilities in PostScript</a></li>
- <li><a href="#Utility_scripts">Utility scripts</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li><a href="#Memory_management">Memory management</a></li>
- <li>
- <ul>
- <li><a href="#Memory_manager_architecture">Memory manager architecture</a></li>
- <li>
- <ul>
- <li><a href="#Objects_vs_strings">Objects vs strings</a>,
- <a href="#Structure_descriptors">Structure descriptors</a>,
- <a href="#Garbage_collection">Garbage collection</a>,
- <a href="#Movability">Movability</a>,
- <a href="#Parent_hierarchy">Parent hierarchy</a>,
- <a href="#Allocator_API">Allocator API</a>
- </li>
- </ul>
- </li>
- <li><a href="#Freeing_storage">Freeing storage</a></li>
- <li>
- <ul>
- <li><a href="#Explicit_freeing">Explicit freeing</a>,
- <a href="#Reference_counting">Reference counting</a>,
- <a href="#Real_garbage_collection">(Real) garbage collection</a>
- </li>
- </ul>
- </li>
- <li><a href="#Special_implementations">Special implementations</a></li>
- <li>
- <ul>
- <li><a href="#malloc">malloc</a>,
- <a href="#Locking">Locking</a>,
- <a href="#Retrying">Retrying</a>,
- <a href="#Chunk">Chunk</a>
- </li>
- </ul>
- </li>
- <li><a href="#Standard_implementation">Standard implementation</a></li>
- <li><a href="#PostScript_interpreter_extensions">PostScript interpreter extensions</a></li>
- <li>
- <ul>
- <li><a href="#Refs">Refs (PostScript "objects")</a>,
- <a href="#save_forgetsave_restore">save/.forgetsave/restore</a>,
- <a href="#Stable_allocators">Stable allocators</a>,
- <a href="#Interpreter_GC">Garbage collection</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li><a href="#Portability">Portability</a></li>
- <li>
- <ul>
- <li><a href="#Structural">Structural</a></li>
- <li>
- <ul>
- <li><a href="#CPU_and_compiler">CPU and compiler</a>,
- <a href="#Library_headers">Library headers</a>,
- <a href="#Cross_platform_APIs">Cross-platform APIs</a>,
- <a href="#Makefiles">Makefiles</a>
- </li>
- </ul>
- </li>
- <li><a href="#Coding">Coding</a></li>
- <li>
- <ul>
- <li><a href="#Explicit_dependencies">Explicit dependencies</a>,
- <a href="#Implicit_dependencies">Implicit dependencies</a></li>
- </ul>
- </li>
- <li><a href="#Platform_specific_code">Platform-specific code</a></li>
- </ul>
- </li>
-
- <li><a href="#Troubleshooting">Troubleshooting and debugging</a></li>
- <li><a href="#Profiling">Profiling</a></li>
- <li>
- <ul>
- <li><a href="#ProfilingMSVC6">Profiling with Microsoft Developer Studio 6</a></li>
- </ul>
- </li>
-</ul>
-
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Introduction"></a>Introduction</h2>
-
-<p>
-This document provides a wealth of information about Ghostscript's
-internals, primarily for developers actively working on Ghostscript. It is
-primarily <strong>descriptive</strong>, documenting the way things are; the
-companion <a href="C-style.htm">C style guide</a> is primarily
-<strong>prescriptive</strong>, documenting what developers should do when
-writing new code.
-
-<p>
-THIS FILE IS A WORK IN PROGRESS. MANY SECTIONS ARE PLACE-HOLDERS.
-<hr>
-<h2><a name="Architecture"></a>Architecture</h2>
-
-<h3><a name="Design_goals"></a>Design goals</h3>
-
-<p>
-Ghostscript has the following high-level design goals (not listed in order
-of importance):
-
-<ul>
-<li>Functionality
-<ul>
-<li>Ability to interpret the current PostScript and PDF languages, as
-defined (and occasionally, in the case of conflict, as implemented) by
-Adobe.
-<li>Ability to convert PostScript to and from PDF, comparable to
-Adobe products.
-<li>Ability to produce output for a wide range of resolutions (from
-TV-resolution displays to imagesetters) and color models (black and white,
-multilevel gray, bilevel or multi-level RGB and CMYK, 6- or 8-color
-inkjet printers, spot color).
-</ul>
-<li>Performance
-<ul>
-<li>Ability to render PostScript and PDF with commercial-quality performance
-(memory usage, speed, and output quality) on all platforms.
-<li>Specifically, ability to render PostScript effectively in embedded
-environments with constrained RAM, including the ability to put the code and
-supporting data in ROM.
-</ul>
-<li>Licensing
-<ul>
-<li>Licensing that supports both the Open Source / Free software communities
-and a commercial licensing business.
-<li>Freedom from licensing restrictions or fees imposed by third parties.
-</ul>
-<li>Other
-<ul>
-<li>Easy source portability to any platform (CPU, operating system, and
-development tools) that has an ANSI C compiler.
-<li>Support for writing new interpreters and new drivers with no change to
-any existing code; specifically, ability to support PCL 5e, PCL 5c, and PCL
-XL interpreters, and the ever-changing roster of inkjet printers.
-</ul>
-</ul>
-
-<p>
-These goals often conflict: part of Ghostscript's claim to quality is that
-the conflicts have been resolved well.
-
-<h3><a name="Design_principles"></a>Design principles</h3>
-
-<p>
-Part of what has kept Ghostscript healthy through many years of major code
-revisions and functional expansion is consistent and conscientious adherence
-to a set of design principles. We hope the following list captures the most
-important ones.
-
-<h4>Non-preemption</h4>
-
-<p>
-Ghostscript is designed to be used as a component. As such, it must share
-its environment with other components. Therefore, it must not require
-ownership of, or make decisions about, inherently shared resources.
-Specifically, it must not assume that it can "own" either the locus of
-control or the management of the address space.
-
-<p>
-Not owning control means that whenever Ghostscript passes control to its
-caller, it must do so in a way that doesn't constrain what the caller can do
-next. The caller must be able to call any other piece of software, wait for
-an external event, execute another task, etc., without having to worry about
-Ghostscript being in an unknown state. While this is easy to arrange in a
-multi-threaded environment (by running Ghostscript in a separate thread),
-multi-threading APIs are not well standardized at this time (December 2000),
-and may not be implemented efficiently, or at all, on some platforms.
-Therefore, Ghostscript must choose between only two options for interacting
-with its caller: to <em>return</em>, preserving its own state in data
-structures, or to <em>call back</em> through a caller-supplied procedure.
-Calling back constrains the client program unacceptably: the callback
-procedure only has the options of either returning, or aborting Ghostscript.
-In particular, if it wants (for whatever reason) to multi-task Ghostscript
-with another program, it cannot do so in general, especially if the other
-program also uses callback rather than suspension. Therefore, Ghostscript
-tries extremely hard to return, rather than calling back, for all caller
-interaction. In particular:
-
-<ul>
-
-<li>For callers that want to pass input to Ghostscript piece by piece,
-Ghostscript returns with an <code>gs_error_NeedInput</code> code rather than
-using a callback. This allows the caller complete flexibility in its
-control structure for managing the source of input. (It might, for example,
-be generating the input dynamically.)
-
-<li>In the future, the same arrangement should be used for input from
-<code>stdin</code> and output to <code>stdout</code> and
-<code>stderr</code>.
-
-<li>Likewise, scheduling of Ghostscript's own threads (contexts), currently
-done with a callback, should be done with suspension. The Display
-Ghostscript project (GNU DGS) is working on this.
-
-</ul>
-
-<p>
-The one area where suspension is not feasible with Ghostscript's current
-architecture is device output. Device drivers are called from deep within
-the graphics library. (If Ghostscript were being redesigned from scratch,
-we might try to do this with suspension as well, or at least optional
-suspension.)
-
-<p>
-Not owning management of the address space means that even though
-Ghostscript supports garbage collection for its own data, it must not do any
-of the things that garbage collection schemes for C often require: it must
-not replace 'malloc' and 'free', must not require its clients to use its own
-allocator, must not rely on manipulating the read/write status of memory
-pages, must not require special compiler or run-time support (e.g., APIs for
-scanning the C stack), must not depend on the availability of
-multi-threading, and must not take possession of one of a limited number of
-timer interrupts. However, in order not to constrain its own code unduly,
-it must also not require using special macros or calls to enter or leave
-procedures or assign pointers, and must not constrain the variety of C data
-structures any more than absolutely necessary. It achieves all of these
-goals, at the expense of some complexity, some performance cost (mostly for
-garbage collection), and some extra manual work required for each structure
-type allocated by its allocator. The details appear in the <a
-href="#Memory_management">Memory management</a> section below.
-
-<h4>Multi-instantiability</h4>
-
-<p>
-From many years of experience with the benefits of object-oriented design,
-we have learned that when the word "the" appears in a software design --
-"the" process scheduler, "the" memory manager, "the" output device, "the"
-interpreter, "the" stack -- it often flags an area in which the software
-will have difficulty adapting to future needs. For this reason, Ghostscript
-attempts to make every internal structure capable of existing in multiple
-instances. For example, Ghostscript's memory manager is not a one-of-a-kind
-entity with global state and procedures: it is (or rather they are, since
-Ghostscript has multiple memory managers, some of which have multiple
-instances) objects with their own state and (virtual) procedures.
-Ghostscript's PostScript interpreter has no writable non-local data
-(necessary, but not sufficient, to allow multiple instances), and in the
-future will be extended to be completely reentrant and instantiable. The
-device driver API is designed to make this easy for drivers as well. The
-graphics library is currently not completely reentrant or instantiable: we
-hope this will occur in the future.
-
-<h4>Late configuration binding</h4>
-
-<p>
-Ghostscript is designed to make configuration choices as late as possible,
-subject to simplicity and performance considerations. The major binding
-times for such choices are compilation, linking, startup, and dynamic.
-
-<ul>
-
-<li>Compilation binds only CPU and compiler characteristics (including data
-type size, presence of floating point hardware, and data alignment), and
-whether the code will be used for production, debugging, or profiling.
-
-<li>Linking binds the choice of what features and device drivers will be
-included in the executable. (Work is underway to make the choice of drivers
-dynamic.)
-
-<li>Startup binds essentially nothing. Almost every option and parameter
-that can appear on the command line can also be changed dynamically.
-
-<li>The selection of output device, all parameters associated with the
-device, the selection of debugging printout and self-checking (in debugging
-configurations), the macro-allocation of memory, and almost all other
-operational parameters are dynamic.
-
-</ul>
-
-<p>
-In addition, a number of major implementation decisions are made dynamically
-depending on the availability of resources. For example, Ghostscript
-chooses between banded and non-banded rendering depending on memory
-availability.
-
-<h3><a name="Large_scale_structure"></a>Large-scale structure</h3>
-
-<p>
-At the largest design scale, Ghostscript consists of 4 layers. Layer N
-is allowed to use the facilities of all layers M &lt;= N.
-
-<ol>
-
-<li>The bottom layer is called the <a href="#Substrate">substrate</a>. It
-includes facilities like memory management, streams, fixed-point arithmetic,
-and low-level interfaces to the operating system. The substrate is written
-in C, with a little C++ and/or assembler code for some platforms.
-
-<li>The layer above the substrate is the graphics layer. It consists of two
-separate sub-parts. The graphics layer is written in C.
-
-<ul>
-
-<li>The <a href="#Graphics_library">graphics library</a> manages graphics
-state information for, and decomposes and renders 2-D images described
-using, a graphics model that is approximately the union of those of
-PostScript, PDF, and PCL 5e/5c/XL.
-
-<li>The <a href="#Device_drivers">device drivers</a> are called by the
-graphics library to produce actual output. The graphics library, and all
-higher layers, call device driver procedures only through virtual functions.
-
-</ul>
-
-<li>The principal clients of the graphics layer are language interpreters.
-Ghostscript as distributed includes the <a
-href="#PostScript_interpreter">PostScript interpreter</a>; there are also
-interpreters for PCL 5e, PCL 5c, and PCL XL, which are not currently freely
-redistributable and are not included in the standard Ghostscript package.
-The PostScript interpreter is written partly in C and partly in PostScript.
-
-<li>The <a href="#PDF_interpreter">PDF interpreter</a> is actually a client
-of the PostScript interpreter: it is written entirely in PostScript.
-
-</ol>
-
-<p>
-The most important interface in Ghostscript is the API between the graphics
-library and the device drivers: new printers (and, to a lesser extent,
-window systems, displays, plotters, film recorders, and graphics file
-formats) come on the scene frequently, and it must be possible to produce
-output for them with a minimum of effort and distruption. This API is the
-only one that is extensively documented (see <a
-href="Drivers.htm">Drivers.htm</a>) and kept stringently backward-compatible
-through successive releases.
-
-<h3><a name="Object_oriented_constructs"></a>Object-oriented constructs</h3>
-
-<p>
-Ghostscript makes heavy use of object-oriented constructs, including
-analogues of classes, instances, subclassing, and class-associated
-procedures. Since Ghostscript is written in C, not C++, implementing these
-constructs requires following coding conventions. The <a
-href="C-style.htm#Objects">"Objects"</a> section of the C style guide
-explains these.
-
-<p>
-The memory manager API provides run-time type information about each class,
-but this information does not include anything about subclassing. See under
-<a href="#Structure_descriptors">Structure descriptors</a> below.
-
-<hr>
-
-<h2><a name="File_roadmap"></a>File roadmap</h2>
-
-<p>
-This section of the document provides a roadmap to all of the Ghostscript
-source files.
-
-<h3><a name="Substrate"></a>Substrate</h3>
-
-<h4>Runtime Context</h4>
-
-<dl>
-<dt>
-The libctx provides pointers to memory, stdio, and various other runtime
-portablility services.
-<dd>
-<a href="../base/gslibctx.h">base/gslibctx.h</a>,
-<a href="../base/gslibctx.c">base/gslibctx.c</a>.
-</dl>
-
-<h4>Memory manager</h4>
-
-<p>
-See <a href="#Memory_management">below</a>.
-
-<h4>Streams</h4>
-
-<dl>
-
-<dt>
-Framework, file and string streams:
-<dd>
-<a href="../base/gsdsrc.c">base/gsdsrc.c</a>,
-<a href="../base/gsdsrc.h">base/gsdsrc.h</a>,
-<a href="../base/scommon.h">base/scommon.h</a>,
-<a href="../base/strmio.c">base/strmio.c</a>,
-<a href="../base/strmio.h">base/strmio.h</a>,
-<a href="../base/sfxboth.c">base/sfxboth.c</a>,
-<a href="../base/sfxfd.c">base/sfxfd.c</a>,
-<a href="../base/sfxstdio.c">base/sfxstdio.c</a>,
-<a href="../base/sfxcommon.c">base/sfxcommon.c</a>,
-<a href="../base/stream.h">base/stream.h</a>,
-<a href="../base/stream.c">base/stream.c</a>,
-<a href="../base/strimpl.h">base/strimpl.h</a>.
-
-<dt>
-Standard filters:
-<dd>
-
-<dl>
-
-<dt>
-CCITTFax:
-<dd>
-<a href="../base/scf.h">base/scf.h</a>,
-<a href="../base/scfd.c">base/scfd.c</a>,
-<a href="../base/scfdgen.c">base/scfdgen.c</a>,
-<a href="../base/scfdtab.c">base/scfdtab.c</a>,
-<a href="../base/scfe.c">base/scfe.c</a>,
-<a href="../base/scfetab.c">base/scfetab.c</a>,
-<a href="../base/scfparam.c">base/scfparam.c</a>,
-<a href="../base/scfx.h">base/scfx.h</a>.
-
-<dt>
-DCT (JPEG):
-<dd>
-<a href="../base/gsjconf.h">base/gsjconf.h</a>,
-<a href="../base/gsjmorec.h">base/gsjmorec.h</a>,
-<a href="../base/sdcparam.c">base/sdcparam.c</a>,
-<a href="../base/sdcparam.h">base/sdcparam.h</a>,
-<a href="../base/sdct.h">base/sdct.h</a>,
-<a href="../base/sdctc.c">base/sdctc.c</a>,
-<a href="../base/sdctd.c">base/sdctd.c</a>,
-<a href="../base/sdcte.c">base/sdcte.c</a>,
-<a href="../base/sddparam.c">base/sddparam.c</a>,
-<a href="../base/sdeparam.c">base/sdeparam.c</a>,
-<a href="../base/sjpeg.h">base/sjpeg.h</a>,
-<a href="../base/sjpegc.c">base/sjpegc.c</a>,
-<a href="../base/sjpegd.c">base/sjpegd.c</a>,
-<a href="../base/sjpege.c">base/sjpege.c</a>.
-
-<dt>
-JBIG2:
-<a href="../base/sjbig2.h">base/sjbig2.h</a>,
-<a href="../base/sjbig2.c">base/sjbig2.c</a>
-<dt>
-JPX (JPEG 2000):
-<a href="../base/sjpx_openjpeg.h">base/sjpx_openjpeg.h</a>,
-<a href="../base/sjpx_openjpeg.c">base/sjpx_openjpeg.c</a>
-<dt>
-Other compression/decompression:
-<dd>
-<a href="../base/slzwc.c">base/slzwc.c</a>,
-<a href="../base/slzwd.c">base/slzwd.c</a>,
-<a href="../base/slzwe.c">base/slzwe.c</a>,
-<a href="../base/slzwx.h">base/slzwx.h</a>,
-<a href="../base/srld.c">base/srld.c</a>,
-<a href="../base/srle.c">base/srle.c</a>,
-<a href="../base/srlx.h">base/srlx.h</a>.
-
-<dt>
-Other:
-<dd>
-<a href="../base/sa85d.c">base/sa85d.c</a>,
-<a href="../base/sa85d.h">base/sa85d.h</a>,
-<a href="../base/sa85x.h">base/sa85x.h</a>,
-<a href="../psi/sfilter1.c">psi/sfilter1.c</a>,
-<a href="../base/sfilter2.c">base/sfilter2.c</a>,
-<a href="../base/sstring.c">base/sstring.c</a>,
-<a href="../base/sstring.h">base/sstring.h</a>.
-
-</dl>
-
-<dt>
-Non-standard filters used to implement standard filters:
-<dd>
-<a href="../base/seexec.c">base/seexec.c</a>,
-<a href="../base/sfilter.h">base/sfilter.h</a>,
-<a href="../base/shc.c">base/shc.c</a>,
-<a href="../base/shc.h">base/shc.h</a>,
-<a href="../base/spdiff.c">base/spdiff.c</a>,
-<a href="../base/spdiffx.h">base/spdiffx.h</a>,
-<a href="../base/spngp.c">base/spngp.c</a>,
-<a href="../base/spngpx.h">base/spngpx.h</a>,
-<a href="../base/szlibc.c">base/szlibc.c</a>,
-<a href="../base/szlibd.c">base/szlibd.c</a>,
-<a href="../base/szlibe.c">base/szlibe.c</a>,
-<a href="../base/szlibx.h">base/szlibx.h</a>,
-<a href="../base/szlibxx.h">base/szlibxx.h</a>.
-
-<dt>
-Non-standard filters:
-<dd>
-<a href="../base/sbcp.c">base/sbcp.c</a>,
-<a href="../base/sbcp.h">base/sbcp.h</a>,
-<a href="../base/sbtx.h">base/sbtx.h</a>,
-<a href="../base/smd5.c">base/smd5.c</a>,
-<a href="../base/smd5.h">base/smd5.h</a>,
-<a href="../base/saes.c">base/saes.c</a>,
-<a href="../base/saes.h">base/saes.h</a>,
-<a href="../base/sarc4.c">base/sarc4.c</a>,
-<a href="../base/sarc4.h">base/sarc4.h</a>,
-
-<dt>
-Internal filters:
-<dd>
-<a href="../base/siinterp.c">base/siinterp.c</a>,
-<a href="../base/siinterp.h">base/siinterp.h</a>,
-<a href="../base/siscale.c">base/siscale.c</a>,
-<a href="../base/siscale.h">base/siscale.h</a>,
-<a href="../base/sidscale.c">base/sidscale.c</a>,
-<a href="../base/sidscale.h">base/sidscale.h</a>,
-<a href="../base/sisparam.h">base/sisparam.h</a>.
-
-<dt>
-Higher-level stream support:
-<dd>
-<a href="../base/spprint.c">base/spprint.c</a>,
-<a href="../base/spprint.h">base/spprint.h</a>,
-<a href="../base/spsdf.c">base/spsdf.c</a>,
-<a href="../base/spsdf.h">base/spsdf.h</a>,
-<a href="../base/srdline.h">base/srdline.h</a>.
-
-</dl>
-
-<h4>Platform-specific code</h4>
-
-See <a href="#Cross_platform_APIs">below</a>.
-
-<h4>Miscellaneous</h4>
-
-<dl>
-
-<dt>
-Library top level:
-<dd>
-<a href="../base/gsinit.c">base/gsinit.c</a>,
-<a href="../base/gslib.h">base/gslib.h</a>.
-
-<dt>
-Configuration-related:
-<dd>
-<a href="../base/gconf.c">base/gconf.c</a>,
-<a href="../base/gconf.h">base/gconf.h</a>,
-<a href="../base/gscdef.c">base/gscdef.c</a>,
-<a href="../base/gscdefs.h">base/gscdefs.h</a>,
-<a href="../base/gsromfs0.c">base/gsromfs0.c</a>.
-
-<dt>
-Arithmetic:
-<dd>
-<a href="../base/gxarith.h">base/gxarith.h</a>,
-<a href="../base/gxdda.h">base/gxdda.h</a>,
-<a href="../base/gxfarith.h">base/gxfarith.h</a>,
-<a href="../base/gxfixed.h">base/gxfixed.h</a>,
-<a href="../base/gxfrac.h">base/gxfrac.h</a>.
-
-<dt>
-Operating system interface:
-<dd>
-<a href="../base/gserrors.h">base/gserrors.h</a>,
-<a href="../base/gsexit.h">base/gsexit.h</a>,
-<a href="../base/gxstdio.h">base/gxstdio.h</a>,
-<a href="../base/gxsync.c">base/gxsync.c</a>,
-<a href="../base/gxsync.h">base/gxsync.h</a>.
-
-<dt>
-Other:
-<dd>
-<a href="../base/gsargs.c">base/gsargs.c</a>,
-<a href="../base/gsargs.h">base/gsargs.h</a>,
-<a href="../base/gserrors.h">base/gserrors.h</a>,
-<a href="../base/gsnotify.c">base/gsnotify.c</a>,
-<a href="../base/gsnotify.h">base/gsnotify.h</a>,
-<a href="../base/gsrect.h">base/gsrect.h</a>,
-<a href="../base/gstypes.h">base/gstypes.h</a>,
-<a href="../base/gsuid.h">base/gsuid.h</a>,
-<a href="../base/gsutil.h">base/gsutil.h</a>,
-<a href="../base/gsutil.c">base/gsutil.c</a>,
-<a href="../base/gx.h">base/gx.h</a>,
-<a href="../base/gsmd5.c">base/gsmd5.c</a>,
-<a href="../base/gsmd5.h">base/gsmd5.h</a>,
-<a href="../base/aes.c">base/aes.c</a>,
-<a href="../base/aes.h">base/aes.h</a>.
-
-</dl>
-
-<h3><a name="Graphics_library"></a>Graphics library</h3>
-
-<h4><a name="Library_support"></a>Support</h4>
-
-<dl>
-
-<dt>
-Bitmap processing:
-<dd>
-<a href="../base/gsbitcom.c">base/gsbitcom.c</a>,
-<a href="../base/gsbitmap.h">base/gsbitmap.h</a>,
-<a href="../base/gsbitops.c">base/gsbitops.c</a>,
-<a href="../base/gsbitops.h">base/gsbitops.h</a>,
-<a href="../base/gsbittab.c">base/gsbittab.c</a>,
-<a href="../base/gsbittab.h">base/gsbittab.h</a>,
-<a href="../base/gsflip.c">base/gsflip.c</a>,
-<a href="../base/gsflip.h">base/gsflip.h</a>,
-<a href="../base/gxbitmap.h">base/gxbitmap.h</a>,
-<a href="../base/gxbitops.h">base/gxbitops.h</a>,
-<a href="../base/gxsample.c">base/gxsample.c</a>,
-<a href="../base/gxsample.h">base/gxsample.h</a>.
-<a href="../base/gxsamplp.h">base/gxsamplp.h</a>.
-
-<dt>
-Functions:
-<dd>
-<a href="../base/gsfunc.c">base/gsfunc.c</a>,
-<a href="../base/gsfunc.h">base/gsfunc.h</a>,
-<a href="../base/gsfunc0.c">base/gsfunc0.c</a>,
-<a href="../base/gsfunc0.h">base/gsfunc0.h</a>,
-<a href="../base/gsfunc3.c">base/gsfunc3.c</a>,
-<a href="../base/gsfunc3.h">base/gsfunc3.h</a>,
-<a href="../base/gsfunc4.c">base/gsfunc4.c</a>,
-<a href="../base/gsfunc4.h">base/gsfunc4.h</a>,
-<a href="../base/gxfunc.h">base/gxfunc.h</a>.
-
-<dt>
-Parameter lists:
-<dd>
-<a href="../base/gscparam.c">base/gscparam.c</a>,
-<a href="../base/gsparam.c">base/gsparam.c</a>,
-<a href="../base/gsparam.h">base/gsparam.h</a>,
-<a href="../base/gsparam2.c">base/gsparam2.c</a> (not used),
-<a href="../base/gsparams.c">base/gsparams.c</a>,
-<a href="../base/gsparams.h">base/gsparams.h</a>,
-<a href="../base/gsparamx.c">base/gsparamx.c</a>,
-<a href="../base/gsparamx.h">base/gsparamx.h</a>.
-
-<dt>
-I/O-related:
-<dd>
-<a href="../base/gdevpipe.c">base/gdevpipe.c</a>,
-<a href="../base/gsfname.c">base/gsfname.c</a>,
-<a href="../base/gsfname.h">base/gsfname.h</a>,
-<a href="../base/gsio.h">base/gsio.h</a>,
-<a href="../base/gsiodev.c">base/gsiodev.c</a>,
-<a href="../base/gsiodevs.c">base/gsiodevs.c</a>,
-<a href="../base/gsiodisk.c">base/gsiodisk.c</a>,
-<a href="../base/gsiorom.c">base/gsiorom.c</a>.
-<a href="../base/gsiorom.h">base/gsiorom.h</a>.
-<a href="../base/gxiodev.h">base/gxiodev.h</a>.
-
-</dl>
-
-<h4><a name="Paths"></a>Paths</h4>
-
-<dl>
-
-<dt>
-Coordinate transformation:
-<dd>
-<a href="../base/gscoord.c">base/gscoord.c</a>,
-<a href="../base/gscoord.h">base/gscoord.h</a>,
-<a href="../base/gsmatrix.c">base/gsmatrix.c</a>,
-<a href="../base/gsmatrix.h">base/gsmatrix.h</a>,
-<a href="../base/gxcoord.h">base/gxcoord.h</a>,
-<a href="../base/gxmatrix.h">base/gxmatrix.h</a>.
-
-<dt>
-Path building:
-<dd>
-<a href="../base/gsdps1.c">base/gsdps1.c</a>,
-<a href="../base/gspath.c">base/gspath.c</a>,
-<a href="../base/gspath.h">base/gspath.h</a>,
-<a href="../base/gspath1.c">base/gspath1.c</a>,
-<a href="../base/gspath2.h">base/gspath2.h</a>,
-<a href="../base/gxpath.c">base/gxpath.c</a>,
-<a href="../base/gxpath.h">base/gxpath.h</a>,
-<a href="../base/gxpath2.c">base/gxpath2.c</a>,
-<a href="../base/gxpcopy.c">base/gxpcopy.c</a>,
-<a href="../base/gxpdash.c">base/gxpdash.c</a>,
-<a href="../base/gxpflat.c">base/gxpflat.c</a>,
-<a href="../base/gzpath.h">base/gzpath.h</a>.
-
-<dt>
-Path rendering:
-<dd>
-<a href="../base/gdevddrw.c">base/gdevddrw.c</a>,
-<a href="../base/gdevddrw.h">base/gdevddrw.h</a>,
-<a href="../base/gxdtfill.h">base/gxdtfill.h</a>,
-<a href="../base/gsdps1.c">base/gsdps1.c</a>,
-<a href="../base/gspaint.c">base/gspaint.c</a>,
-<a href="../base/gspaint.h">base/gspaint.h</a>,
-<a href="../base/gspenum.h">base/gspenum.h</a>,
-<a href="../base/gxfill.c">base/gxfill.c</a>,
-<a href="../base/gxfill.h">base/gxfill.h</a>,
-<a href="../base/gxfillsl.h">base/gxfillsl.h</a>,
-<a href="../base/gxfilltr.h">base/gxfilltr.h</a>,
-<a href="../base/gxfillts.h">base/gxfillts.h</a>,
-<a href="../base/gximask.c">base/gximask.c</a>,
-<a href="../base/gximask.h">base/gximask.h</a>,
-<a href="../base/gxfdrop.c">base/gxfdrop.c</a>,
-<a href="../base/gxfdrop.h">base/gxfdrop.h</a>,
-<a href="../base/gxpaint.c">base/gxpaint.c</a>,
-<a href="../base/gxpaint.h">base/gxpaint.h</a>,
-<a href="../base/gxstroke.c">base/gxstroke.c</a>,
-<a href="../base/gzspotan.c">base/gzspotan.c</a>,
-<a href="../base/gzspotan.h">base/gzspotan.h</a>.
-
-<dt>
-Clipping:
-<dd>
-See under <a href="#Clipping">Clipping</a> below.
-
-</dl>
-
-<h4><a name="Text"></a>Text</h4>
-
-<dl>
-
-<dt>
-Fonts, generic:
-<dd>
-<a href="../base/gsfont.c">base/gsfont.c</a>,
-<a href="../base/gsfont.h">base/gsfont.h</a>,
-<a href="../devices/gxfcopy.c">devices/gxfcopy.c</a>,
-<a href="../devices/gxfcopy.h">devices/gxfcopy.h</a>,
-<a href="../base/gxfont.h">base/gxfont.h</a>.
-
-<dt>
-Fonts, specific FontTypes:
-<dd>
-<a href="../base/gsfcid.c">base/gsfcid.c</a>,
-<a href="../base/gsfcid2.c">base/gsfcid.c</a>,
-<a href="../base/gsfcmap.c">base/gsfcmap.c</a>,
-<a href="../base/gsfcmap1.c">base/gsfcmap1.c</a>,
-<a href="../base/gsfcmap.h">base/gsfcmap.h</a>,
-<a href="../base/gsfont0.c">base/gsfont0.c</a>,
-<a href="../base/gsfont0c.c">base/gsfont0c.c</a>,
-<a href="../base/gxcid.h">base/gxcid.h</a>,
-<a href="../base/gxfcid.h">base/gxfcid.h</a>,
-<a href="../base/gxfcmap.h">base/gxfcmap.h</a>,
-<a href="../base/gxfcmap1.h">base/gxfcmap1.h</a>,
-<a href="../base/gxfont0.h">base/gxfont0.h</a>,
-<a href="../base/gxfont0c.h">base/gxfont0c.h</a>,
-<a href="../base/gxfont1.h">base/gxfont1.h</a>,
-<a href="../base/gxfont42.h">base/gxfont42.h</a>,
-<a href="../base/gxftype.h">base/gxftype.h</a>,
-<a href="../base/gxttf.h">base/gxttf.h</a>.
-
-<dt>
-Character rendering + font cache, generic:
-<dd>
-<a href="../base/gsccode.h">base/gsccode.h</a>,
-<a href="../base/gschar.c">base/gschar.c</a>,
-<a href="../base/gschar.h">base/gschar.h</a>,
-<a href="../base/gscpm.h">base/gscpm.h</a>,
-<a href="../base/gsgdata.c">base/gsgdata.c</a>,
-<a href="../base/gsgdata.h">base/gsgdata.h</a>,
-<a href="../base/gsgcache.c">base/gsgcache.c</a>,
-<a href="../base/gsgcache.h">base/gsgcache.h</a>,
-<a href="../base/gstext.c">base/gstext.c</a>,
-<a href="../base/gstext.h">base/gstext.h</a>,
-<a href="../base/gxbcache.c">base/gxbcache.c</a>,
-<a href="../base/gxbcache.h">base/gxbcache.h</a>,
-<a href="../base/gxccache.c">base/gxccache.c</a>,
-<a href="../base/gxccman.c">base/gxccman.c</a>,
-<a href="../base/gxchar.c">base/gxchar.c</a>,
-<a href="../base/gxchar.h">base/gxchar.h</a>,
-<a href="../base/gxfcache.h">base/gxfcache.h</a>,
-<a href="../base/gxtext.h">base/gxtext.h</a>.
-
-<dt>
-Character rendering, specific FontTypes:
-<dd>
-<a href="../base/gschar0.c">base/gschar0.c</a>,
-<a href="../base/gscrypt1.c">base/gscrypt1.c</a>,
-<a href="../base/gscrypt1.h">base/gscrypt1.h</a>,
-<a href="../base/gstype1.c">base/gstype1.c</a>,
-<a href="../base/gstype1.h">base/gstype1.h</a>,
-<a href="../base/gstype2.c">base/gstype2.c</a>,
-<a href="../base/gstype42.c">base/gstype42.c</a>,
-<a href="../base/gxchrout.c">base/gxchrout.c</a>,
-<a href="../base/gxchrout.h">base/gxchrout.h</a>,
-<a href="../base/gxhintn.h">base/gxhintn.h</a>,
-<a href="../base/gxhintn.c">base/gxhintn.c</a>,
-<a href="../base/gxhintn1.c">base/gxhintn1.c</a>,
-<a href="../base/gxtype1.c">base/gxtype1.c</a>,
-<a href="../base/gxtype1.h">base/gxtype1.h</a>.
-
-</dl>
-
-<h4><a name="Images"></a>Images</h4>
-
-<dl>
-
-<dt>
-Buffered API (mostly for PostScript interpreter):
-<dd>
-<a href="../base/gsimage.c">base/gsimage.c</a>,
-<a href="../base/gsimage.h">base/gsimage.h</a>.
-
-<dt>
-Generic support:
-<dd>
-<a href="../base/gsiparam.h">base/gsiparam.h</a>,
-<a href="../base/gxiclass.h">base/gxiclass.h</a>,
-<a href="../base/gximage.c">base/gximage.c</a>,
-<a href="../base/gximage.h">base/gximage.h</a>,
-<a href="../base/gxiparam.h">base/gxiparam.h</a>.
-
-<dt>
-Type 1 and 4 images:
-<dd>
-
-<dl>
-
-<dt>
-Setup:
-<dd>
-<a href="../base/gsiparm4.h">base/gsiparm4.h</a>,
-<a href="../base/gximage1.c">base/gximage1.c</a>,
-<a href="../base/gximage4.c">base/gximage4.c</a>.
-
-<dt>
-Rendering:
-<dd>
-<a href="../base/gxi12bit.c">base/gxi12bit.c</a>,
-<a href="../base/gxi16bit.c">base/gxi16bit.c</a>,
-<a href="../base/gxicolor.c">base/gxicolor.c</a>,
-<a href="../base/gxidata.c">base/gxidata.c</a>,
-<a href="../base/gxifast.c">base/gxifast.c</a>,
-<a href="../base/gximono.c">base/gximono.c</a>,
-<a href="../base/gxino12b.c">base/gxino12b.c</a>,
-<a href="../base/gxino16b.c">base/gxino16b.c</a>,
-<a href="../base/gxipixel.c">base/gxipixel.c</a>,
-<a href="../base/gxiscale.c">base/gxiscale.c</a>.
-
-</dl>
-
-<dt>
-Type 2 images (Display PostScript):
-<dd>
-<a href="../base/gsiparm2.h">base/gsiparm2.h</a>,
-<a href="../base/gximage2.c">base/gximage2.c</a>.
-
-<dt>
-Type 3 images:
-<dd>
-<a href="../base/gsipar3x.h">base/gsipar3x.h</a>,
-<a href="../base/gsiparm3.h">base/gsiparm3.h</a>,
-<a href="../base/gximag3x.c">base/gximag3x.c</a>,
-<a href="../base/gximag3x.h">base/gximag3x.h</a>,
-<a href="../base/gximage3.c">base/gximage3.c</a>,
-<a href="../base/gximage3.h">base/gximage3.h</a>.
-
-<dt>
-Other:
-<dd>
-<a href="../base/gsimpath.c">base/gsimpath.c</a>,
-<a href="../base/simscale.c">base/simscale.c</a>,
-<a href="../base/simscale.h">base/simscale.h</a>.
-.
-
-</dl>
-
-<h4><a name="Paint"></a>Paint</h4>
-
-<p>
-Ghostscript uses 4 internal representations of color. We list them here in
-the order in which they occur in the rendering pipeline.
-
-<ol>
-
-<li>Clients of the graphics library normally specify colors using the
-<em>client color</em> structure (<code>gs_client_color</code>, defined in
-<a href="../psi/gs.color.h">psi/gs.color.h</a>), consisting of one or more
-numeric values and/or a pointer to a Pattern instance. This corresponds
-directly to the values that would be passed to the PostScript
-<code>setcolor</code> operator: one or more (floating-point) numeric
-components and/or a Pattern. Client colors are interpreted relative to a
-color space (<code>gs_color_space</code>, defined in <a
-href="../base/gscspace.h">base/gscspace.h</a> and <a
-href="../base/gxcspace.h">base/gxcspace.h</a>, with specific color spaces
-defined in other files). Client colors do not explicitly reference the
-color space in which they are are interpreted: <code>setcolor</code> uses
-the color space in the graphics state, while images and shadings explicitly
-specify the color space to be used.
-
-<li>For ordinary non-Pattern colors, the first step in color rendering
-reduces a client color to a <em>concrete</em> color -- a set of values in a
-color space that corresponds to the device's color model (except for
-possible conversions between DeviceGray, DeviceRGB, and DeviceCMYK),
-together with an identification of the associated color space. (The
-confusion here between color spaces and color models will have to be cleaned
-up when we implement native Separation/DeviceN colors.) Concrete colors are
-like the numeric values in a client color, except that they are represented
-by arrays of <code>frac</code> values (defined in <a
-href="../base/gxfrac.h">base/gxfrac.h</a>) rather than floats. The procedure
-for this step is the virtual <code>concretize_color</code> and
-<code>concrete_space</code> procedures in the (original) color space.
-This step reduces Indexed colors, CIEBased colors, and Separation and
-DeviceN colors that use the alternate space.
-
-<li>The final step requires mapping a concrete color to the device's color
-model, done by procedures in <a href="../base/gxcmap.c">base/gxcmap.c</a>.
-These procedures combine the following three conceptual sub-steps:
-
-<ul>
-
-<li>A possible mapping between Device color spaces, possibly involving black
-generation and undercolor removal. The non-trivial cases are implemented in
-<a href="../base/gxdcconv.c">base/gxdcconv.c</a>.
-
-<li>Application of the transfer function(s) (done in-line).
-
-<li>Halftoning if necessary: see below.
-
-</ul>
-
-The result is called (inappropriately) a <em>device color</em>
-(<code>gx_device_color</code>, defined in <a
-href="../psi/gs.color.h">psi/gs.color.h</a> and <a
-href="../base/gxdcolor.h">base/gxdcolor.h</a>). For ordinary non-Pattern
-colors, a device color is either a pure color, or a halftone. The device
-and color model associated with a device color are implicit. The procedure
-for this step is the virtual <code>remap_concrete_color</code> procedure
-in the color space.
-
-<li>The pure colors that underlie a device color are opaque <em>pixel
-values</em> defined by the device (misnamed <code>gx_color_index</code>,
-defined in <a href="../base/gscindex.h">base/gscindex.h</a>). The device with
-which they are associated is implicit. Although the format and
-interpretation of a pixel value are known only to the device, the device's
-color model and color representation capabilities are public, defined by a
-<code>gx_color_info</code> structure stored in the device (defined in <a
-href="../base/gxdevcli.h">base/gxdevcli.h</a>). Virtual procedures of the
-device driver map between pixel values and RGB or CMYK. (This area is
-untidy and will need to be cleaned up when we implement native
-Separation/DeviceN colors.)
-
-</ol>
-
-<p>
-Steps 2 and 3 are normally combined into a single step for efficiency, as
-the <code>remap_color</code> virtual procedure in a color space.
-
-<p>
-Using a device color to actually paint pixels requires a further step called
-<em>color loading</em>, implemented by the <code>load</code> virtual
-procedure in the device color. This does nothing for pure colors, but loads
-the caches for halftones and Patterns.
-
-<p>
-All of the above steps -- concretizing, mapping to a device color, and color
-loading -- are done as late as possible, normally not until the color is
-actually needed for painting.
-
-<p>
-All painting operations (fill, stroke, imagemask/show) eventually call a
-virtual procedure in the device color, either <code>fill_rectangle</code>
-or <code>fill_mask</code> to actually paint pixels. For rectangle fills,
-pure colors call the device's <code>fill_rectangle</code> procedure;
-halftones and tiled Patterns call the device's
-<code>strip_tile_rectangle</code>; shaded Patterns, and painting operations
-that involve a RasterOp, do something more complicated.
-
-<dl>
-
-<dt>
-Color specification:
-<dd>
-<a href="../base/gsdcolor.h">base/gsdcolor.h</a>,
-<a href="../base/gscolor.c">base/gscolor.c</a>,
-<a href="../base/gscolor.h">base/gscolor.h</a>,
-<a href="../base/gscolor1.c">base/gscolor1.c</a>,
-<a href="../base/gscolor1.h">base/gscolor1.h</a>,
-<a href="../base/gscolor2.c">base/gscolor2.c</a>,
-<a href="../base/gscolor2.h">base/gscolor2.h</a>,
-<a href="../base/gscolor3.c">base/gscolor3.c</a>,
-<a href="../base/gscolor3.h">base/gscolor3.h</a>,
-<a href="../base/gshsb.c">base/gshsb.c</a>,
-<a href="../base/gshsb.h">base/gshsb.h</a>,
-<a href="../base/gxcolor2.h">base/gxcolor2.h</a>,
-<a href="../base/gxcvalue.h">base/gxcvalue.h</a>.
-
-<dt>
-Color spaces:
-<dd>
-<a href="../base/gscdevn.c">base/gscdevn.c</a>,
-<a href="../base/gscdevn.h">base/gscdevn.h</a>,
-<a href="../base/gscie.c">base/gscie.c</a>,
-<a href="../base/gscie.h">base/gscie.h</a>,
-<a href="../base/gscpixel.c">base/gscpixel.c</a>,
-<a href="../base/gscpixel.h">base/gscpixel.h</a>,
-<a href="../base/gscscie.c">base/gscscie.c</a>,
-<a href="../base/gscsepr.c">base/gscsepr.c</a>,
-<a href="../base/gscsepr.h">base/gscsepr.h</a>,
-<a href="../base/gscspace.c">base/gscspace.c</a>,
-<a href="../base/gscspace.h">base/gscspace.h</a>,
-<a href="../base/gscssub.c">base/gscssub.c</a>,
-<a href="../base/gscssub.h">base/gscssub.h</a>,
-<a href="../base/gxcdevn.h">base/gxcdevn.h</a>,
-<a href="../base/gxcie.h">base/gxcie.h</a>,
-<a href="../base/gxcspace.h">base/gxcspace.h</a>.
-
-<dt>
-Color mapping:
-<dd>
-<a href="../base/gsciemap.c">base/gsciemap.c</a>,
-<a href="../base/gscindex.h">base/gscindex.h</a>,
-<a href="../base/gscrd.c">base/gscrd.c</a>,
-<a href="../base/gscrd.h">base/gscrd.h</a>,
-<a href="../base/gscrdp.c">base/gscrdp.c</a>,
-<a href="../base/gscrdp.h">base/gscrdp.h</a>,
-<a href="../base/gscsel.h">base/gscsel.h</a>,
-<a href="../base/gxcindex.h">base/gxcindex.h</a>,
-<a href="../base/gxcmap.c">base/gxcmap.c</a>,
-<a href="../base/gxcmap.h">base/gxcmap.h</a>,
-<a href="../base/gxctable.c">base/gxctable.c</a>,
-<a href="../base/gxctable.h">base/gxctable.h</a>,
-<a href="../base/gxdcconv.c">base/gxdcconv.c</a>,
-<a href="../base/gxdcconv.h">base/gxdcconv.h</a>,
-<a href="../base/gxdcolor.c">base/gxdcolor.c</a>,
-<a href="../base/gxdcolor.h">base/gxdcolor.h</a>,
-<a href="../base/gxdevndi.c">base/gxdevndi.c</a>,
-<a href="../base/gxdevndi.h">base/gxdevndi.h</a>,
-<a href="../base/gxdither.h">base/gxdither.h</a>,
-<a href="../base/gxfmap.h">base/gxfmap.h</a>,
-<a href="../base/gxlum.h">base/gxlum.h</a>,
-<a href="../base/gxtmap.h">base/gxtmap.h</a>.
-
-<p>
-ICC profiles are in some ways a special case of color mapping, but are
-not standard in PostScript.
-
-<dt>
-<dd>
-<a href="../base/gsicc.c">base/gsicc.c</a>,
-<a href="../base/gsicc.h">base/gsicc.h</a>,
-
-<p>
-The following files provide a callback mechanism to allow a client program
-to specify a special case alternate tint transforms for Separation and DeviceN
-color spaces. Among other uses this can be used to provide special handling for
-PANTONE colors.
-<dt>
-<dd>
-<a href="../base/gsnamecl.c">base/gsnamecl.c</a>,
-<a href="../base/gsnamecl.h">base/gsnamecl.h</a>,
-<a href="../base/gsncdummy.c">base/gsncdummy.c</a>,
-<a href="../base/gsncdummy.h">base/gsncdummy.h</a>,
-<a href="../psi/zncdummy.c">psi/zncdummy.c</a>,
-
-</dl>
-
-<p>
-Ghostscript represents halftones internally by "whitening orders" --
-essentially, arrays of arrays of bit coordinates within a halftone cell,
-specifying which bits are inverted to get from halftone level K to level
-K+1. The code does support all of the PostScript halftone types, but they
-are all ultimately reduced to whitening orders.
-
-<p>
-Threshold arrays, the more conventional representation of halftones, can be
-mapped to whitening orders straightforwardly; however, whitening orders can
-represent non-monotonic halftones (halftones where the bits turned on for
-level K+1 don't necessarily include all the bits turned on for level K),
-while threshold arrays cannot. On the other hand, threshold arrays allow
-rapid conversion of images (using a threshold comparison for each pixel)
-with no additional space, while whitening orders do not: they require
-storing the rendered halftone cell for each possible level as a bitmap.
-
-<p>
-Ghostscript uses two distinct types of rendered halftones -- that is, the
-bitmap(s) that represent a particular level.
-
-<ul>
-
-<li>Binary halftones. The rendered halftone is a single bit plane; each bit
-selects one of two pure colors. These are fast but limited: they are used
-for monochrome output devices, or for color devices in those cases where
-only two distinct colors are involved in a halftone (e.g., a pure cyan shade
-on a CMYK device). The device color for a binary halftone stores a pointer
-to the halftone bitmap, and the two pure colors.
-
-<li>Multi-plane halftones. Internally, each plane is rendered individually.
-Since there isn't enough room to store all 2^N pure colors, multi-plane
-halftones only store the scaled values for the individual components; the
-halftone renderer maps these to the pure colors on the fly, then combines
-the planes to assemble an N-bit index into the list of colors for each
-pixel, and stores the color into the fully rendered halftone.
-
-</ul>
-
-<p>
-The halftone level for rendering a color is computed in <a
-href="../base/gxdevndi.c">base/gxdevndi.c</a>; the actual halftone mask or
-tile is computed either in <a href="../base/gxcht.c">base/gxcht.c</a> (for
-multi-plane halftones), or in <a href="../base/gxht.c">base/gxht.c</a> and <a
-href="../base/gxhtbit.c">base/gxhtbit.c</a> (for binary halftones).
-
-<dl>
-
-<dt>
-Halftoning:
-<dd>
-<a href="../base/gsht.c">base/gsht.c</a>,
-<a href="../base/gsht.h">base/gsht.h</a>,
-<a href="../base/gsht1.c">base/gsht1.c</a>,
-<a href="../base/gsht1.h">base/gsht1.h</a>,
-<a href="../base/gshtscr.c">base/gshtscr.c</a>,
-<a href="../base/gshtx.c">base/gshtx.c</a>,
-<a href="../base/gshtx.h">base/gshtx.h</a>,
-<a href="../base/gxcht.c">base/gxcht.c</a>,
-<a href="../base/gxdht.h">base/gxdht.h</a>,
-<a href="../base/gxdhtres.h">base/gxdhtres.h</a>,
-<a href="../base/gxht.c">base/gxht.c</a>,
-<a href="../base/gxht.h">base/gxht.h</a>,
-<a href="../base/gxhtbit.c">base/gxhtbit.c</a>,
-<a href="../base/gxhttile.h">base/gxhttile.h</a>,
-<a href="../base/gxhttype.h">base/gxhttype.h</a>,
-<a href="../base/gzht.h">base/gzht.h</a>.
-
-</dl>
-
-<p>
-Pattern colors (tiled patterns and shadings) each use a slightly different
-approach from solid colors.
-
-<p>
-The device color for a tiled (PatternType 1) pattern contains a pointer to a
-pattern instance, plus (for uncolored patterns) the device color to be
-masked. The pattern instance includes a procedure that actually paints the
-pattern if the pattern is not in the cache. For the PostScript interpreter,
-this procedure returns an <code>gs_error_RemapColor</code> exception code: this
-eventually causes the interpreter to run the pattern's PaintProc, loading
-the rendering into the cache, and then re-execute the original drawing
-operator.
-
-<dl>
-
-<dt>
-Patterns:
-<dd>
-<a href="../base/gspcolor.c">base/gs.color.c</a>,
-<a href="../base/gspcolor.h">base/gs.color.h</a>,
-<a href="../base/gsptype1.c">base/gsptype1.c</a>,
-<a href="../base/gsptype1.h">base/gsptype1.h</a>,
-<a href="../base/gxp1fill.c">base/gxp1fill.c</a>,
-<a href="../base/gxp1impl.h">base/gxp1impl.h</a>,
-<a href="../base/gxpcache.h">base/gxpcache.h</a>,
-<a href="../base/gxpcmap.c">base/gxpcmap.c</a>,
-<a href="../base/gxpcolor.h">base/gxpcolor.h</a>.
-
-</dl>
-
-<p>
-The device color for a shading (PatternType 2) pattern also contains a
-pointer to a pattern instance. Shadings are not cached: painting with a
-shading runs the shading algorithm every time.
-
-<dl>
-
-<dt>
-Shading:
-<dd>
-<a href="../base/gsptype2.c">base/gsptype2.c</a>,
-<a href="../base/gsptype2.h">base/gsptype2.h</a>,
-<a href="../base/gsshade.c">base/gsshade.c</a>,
-<a href="../base/gsshade.h">base/gsshade.h</a>,
-<a href="../base/gxshade.c">base/gxshade.c</a>,
-<a href="../base/gxshade.h">base/gxshade.h</a>,
-<a href="../base/gxshade1.c">base/gxshade1.c</a>,
-<a href="../base/gxshade4.c">base/gxshade4.c</a>,
-<a href="../base/gxshade4.h">base/gxshade4.h</a>,
-<a href="../base/gxshade6.c">base/gxshade6.c</a>,
-<a href="../base/gscicach.h">base/gscicach.h</a>,
-<a href="../base/gscicach.c">base/gscicach.c</a>.
-
-</dl>
-
-<p> In addition to the PostScript graphics model, Ghostscript supports RasterOp,
- a weak form of alpha channel, and eventually the full PDF 1.4 transparency model.
- The implemention of these facilities is quite slipshod and scattered: only RasterOp
- is really implemented fully. There is a general compositing architecture, but
- it is hardly used at all, and in particular is not used for RasterOp. It is
- used for implementation of the general support for overprint and overprint mode.
-<dl>
-
-<dt>
-Compositing architecture:
-<dd>
-<a href="../base/gscompt.h">base/gscompt.h</a>,
-<a href="../base/gxcomp.h">base/gxcomp.h</a>.
-
-<dt>
-RasterOp:
-<dd>
-<a href="../base/gdevdrop.c">base/gdevdrop.c</a>,
-<a href="../base/gdevrops.c">base/gdevrops.c</a>,
-<a href="../base/gsrop.c">base/gsrop.c</a>,
-<a href="../base/gsrop.h">base/gsrop.h</a>,
-<a href="../base/gsropt.h">base/gsropt.h</a>,
-<a href="../base/gsroptab.c">base/gsroptab.c</a>,
-<a href="../base/gxdevrop.h">base/gxdevrop.h</a>.
-
-<dt>
-Alpha channel and compositing:
-<dd>
-<a href="../base/gsalpha.c">base/gsalpha.c</a>,
-<a href="../base/gsalpha.h">base/gsalpha.h</a>,
-<a href="../base/gsdpnext.h">base/gsdpnext.h</a>,
-<a href="../base/gxalpha.h">base/gxalpha.h</a>.
-
-<dt>
-Advanced transparency:
-<dd>
-<a href="../base/gstparam.h">base/gstparam.h</a>,
-<a href="../base/gstrans.c">base/gstrans.c</a>,
-<a href="../base/gstrans.h">base/gstrans.h</a>,
-<a href="../base/gxblend.c">base/gxblend.c</a>,
-<a href="../base/gxblend.h">base/gxblend.h</a>,
-<a href="../base/gdevp14.c">base/gdevp14.c</a>,
-<a href="../base/gdevp14.h">base/gdevp14.h</a>.
-
-<dt>
-Overprint and Overprint mode:
-<dd>
-<a href="../base/gsovrc.c">base/gsovrc.c</a>,
-<a href="../base/gsovrc.h">base/gsovrc.h</a>,
-<a href="../base/gxoprect.c">base/gxoprect.c</a>,
-<a href="../base/gxoprect.h">base/gxoprect.h</a>.
-There is support for both overprint and overprint mode. There is a general
-compositor based implementation of these features for all devices. In addition,
-the memory devices implement a higher speed set of special fill routines to
-improve performance for printer based devices.
-
-</dl>
-
-<h4><a name="Clipping"></a>Clipping</h4>
-
-<p>
-The Ghostscript graphics library implements clipping by inserting a clipping
-device in the device pipeline. The clipping device modifies all drawing
-operations to confine them to the clipping region.
-
-<p>
-The library supports three different kinds of clipping:
-
-<dl>
-
-<dt>
-Region/path clipping
-<dd>
-This corresponds to the PostScript concept of a clipping path. The clipping
-region is specified either by a list of rectangles (subject to the
-constraints documented in <a href="../base/gxcpath.h">base/gxcpath.h</a>), or
-by a path that is converted to such a list of rectangles.
-
-<dt>
-Stationary mask clipping
-<dd>
-This corresponds to the mask operand of a PostScript ImageType 3 image. The
-clipping region is specified by a bitmap and an (X,Y) offset in the
-coordinate space.
-
-<dt>
-Tiled mask clipping
-<dd>
-This corresponds to the region painted by a PostScript Pattern, for the case
-where the Pattern does not completely cover its bounding box but the
-combined transformation matrix has no skew or non-orthogonal rotation (i.e.,
-XStep and YStep map respectively to (X,0) and (0,Y) or vice versa). The
-clipping region is specified by a bitmap and an (X,Y) offset in the
-coordinate space, and is replicated indefinitely in both X and Y.
-
-</dl>
-
-<p>
-Note that simply scan-converting a clipping path in the usual way does not
-produce a succession of rectangles that can simply be stored as the list for
-region-based clipping: in general, the rectangles do not satisfy the
-constraint for rectangle lists specified in <a
-href="../base/gxcpath.h">base/gxcpath.h</a>, since they may overlap in X, Y,
-or both. A non-trivial "clipping list accumulator" device is needed to
-produce a rectangle list that does satisfy the constraint.
-
-<dl>
-
-<dt>
-Clipping support:
-<dd>
-<a href="../base/gxclip.c">base/gxclip.c</a>,
-<a href="../base/gxclip.h">base/gxclip.h</a>.
-
-<dt>
-Region/path clipping:
-<dd>
-<a href="../base/gxcpath.c">base/gxcpath.c</a>,
-<a href="../base/gxcpath.h">base/gxcpath.h</a>,
-<a href="../base/gzcpath.h">base/gzcpath.h</a>.
-
-<dt>
-Clipping list accumulator:
-<dd>
-<a href="../base/gxacpath.c">base/gxacpath.c</a>,
-<a href="../base/gzacpath.h">base/gzacpath.h</a>.
-
-<dt>
-Mask clipping support:
-<dd>
-<a href="../base/gxmclip.c">base/gxmclip.c</a>,
-<a href="../base/gxmclip.h">base/gxmclip.h</a>.
-
-<dt>
-Stationary mask clipping:
-<dd>
-<a href="../base/gxclipm.c">base/gxclipm.c</a>,
-<a href="../base/gxclipm.h">base/gxclipm.h</a>.
-
-<dt>
-Tiled mask clipping:
-<dd>
-<a href="../base/gxclip2.c">base/gxclip2.c</a>,
-<a href="../base/gxclip2.h">base/gxclip2.h</a>.
-
-</dl>
-
-<h4><a name="Other_graphics"></a>Other graphics</h4>
-
-<dl>
-
-<dt>
-Miscellaneous graphics state:
-<dd>
-<a href="../base/gsclipsr.c">base/gsclipsr.c</a>,
-<a href="../base/gsclipsr.h">base/gsclipsr.h</a>,
-<a href="../base/gsdps.c">base/gsdps.c</a>,
-<a href="../base/gsdps.h">base/gsdps.h</a>,
-<a href="../base/gsdps1.c">base/gsdps1.c</a>,
-<a href="../base/gsistate.c">base/gsistate.c</a>,
-<a href="../base/gsline.c">base/gsline.c</a>,
-<a href="../base/gsline.h">base/gsline.h</a>,
-<a href="../base/gslparam.h">base/gslparam.h</a>,
-<a href="../base/gsstate.c">base/gsstate.c</a>,
-<a href="../base/gsstate.h">base/gsstate.h</a>,
-<a href="../base/gstrap.c">base/gstrap.c</a>,
-<a href="../base/gstrap.h">base/gstrap.h</a>,
-<a href="../base/gxclipsr.h">base/gxclipsr.h</a>,
-<a href="../base/gxistate.h">base/gxistate.h</a>,
-<a href="../base/gxline.h">base/gxline.h</a>,
-<a href="../base/gxstate.h">base/gxstate.h</a>,
-<a href="../base/gzline.h">base/gzline.h</a>,
-<a href="../base/gzstate.h">base/gzstate.h</a>.
-
-</dl>
-
-<h4><a name="FAPI_support_gx"></a>Font API support</h4>
-
-<dl>
-
-<dt>
-UFST bridge:
-<dd>
-<a href="../base/gxfapiu.c">base/gxfapiu.c</a>,
-<a href="../base/gxfapiu.h">base/gxfapiu.h</a>.
-</dl>
-
-
-<h4><a name="Driver_support"></a>Driver support</h4>
-
-<dl>
-
-<dt>
-Generic driver support:
-<dd>
-<a href="../base/gdevdcrd.c">base/gdevdcrd.c</a>,
-<a href="../base/gdevdcrd.h">base/gdevdcrd.h</a>,
-<a href="../base/gdevdsha.c">base/gdevdsha.c</a>,
-<a href="../base/gdevemap.c">base/gdevemap.c</a>,
-<a href="../base/gsdevice.c">base/gsdevice.c</a>,
-<a href="../base/gsdevice.h">base/gsdevice.h</a>,
-<a href="../base/gsdparam.c">base/gsdparam.c</a>,
-<a href="../base/gsxfont.h">base/gsxfont.h</a>,
-<a href="../base/gxdevbuf.h">base/gxdevbuf.h</a>,
-<a href="../base/gxdevcli.h">base/gxdevcli.h</a>,
-<a href="../base/gxdevice.h">base/gxdevice.h</a>,
-<a href="../base/gxrplane.h">base/gxrplane.h</a>,
-<a href="../base/gxxfont.h">base/gxxfont.h</a>.
-
-<dt>
-Accessing rendered bits:
-<dd>
-<a href="../base/gdevdbit.c">base/gdevdbit.c</a>,
-<a href="../base/gdevdgbr.c">base/gdevdgbr.c</a>,
-<a href="../base/gxbitfmt.h">base/gxbitfmt.h</a>,
-<a href="../base/gxgetbit.h">base/gxgetbit.h</a>.
-
-<dt>
-"Printer" driver support:
-<dd>
-<a href="../devices/gdevmeds.c">devices/gdevmeds.c</a>,
-<a href="../devices/gdevmeds.h">devices/gdevmeds.h</a>,
-<a href="../base/gdevppla.c">base/gdevppla.c</a>,
-<a href="../base/gdevppla.h">base/gdevppla.h</a>,
-<a href="../base/gdevprn.c">base/gdevprn.c</a>,
-<a href="../base/gdevprn.h">base/gdevprn.h</a>,
-<a href="../base/gdevprna.c">base/gdevprna.c</a>,
-<a href="../base/gdevprna.h">base/gdevprna.h</a>,
-<a href="../base/gxband.h">base/gxband.h</a>,
-<a href="../base/gxpageq.c">base/gxpageq.c</a>,
-<a href="../base/gxpageq.h">base/gxpageq.h</a>.
-
-<dt>
-High-level device support:
-<dd>
-<a href="../base/gdevvec.c">base/gdevvec.c</a>,
-<a href="../base/gdevvec.h">base/gdevvec.h</a>,
-<a href="../base/gxhldevc.c">base/gxhldevc.c</a>,
-<a href="../base/gxhldevc.h">base/gxhldevc.h</a>.
-
-<dt>
-Banding:
-<dd>
-<a href="../base/gxclbits.c">base/gxclbits.c</a>,
-<a href="../base/gxcldev.h">base/gxcldev.h</a>,
-<a href="../base/gxclfile.c">base/gxclfile.c</a>,
-<a href="../base/gxclimag.c">base/gxclimag.c</a>,
-<a href="../base/gxclio.h">base/gxclio.h</a>,
-<a href="../base/gxclist.c">base/gxclist.c</a>,
-<a href="../base/gxclist.h">base/gxclist.h</a>,
-<a href="../base/gxcllzw.c">base/gxcllzw.c</a>,
-<a href="../base/gxclmem.c">base/gxclmem.c</a>,
-<a href="../base/gxclmem.h">base/gxclmem.h</a>,
-<a href="../base/gxclpage.c">base/gxclpage.c</a>,
-<a href="../base/gxclpage.h">base/gxclpage.h</a>,
-<a href="../base/gxclpath.c">base/gxclpath.c</a>,
-<a href="../base/gxclpath.h">base/gxclpath.h</a>,
-<a href="../base/gxclrast.c">base/gxclrast.c</a>,
-<a href="../base/gxclread.c">base/gxclread.c</a>,
-<a href="../base/gxclrect.c">base/gxclrect.c</a>,
-<a href="../base/gxclthrd.c">base/gxclthrd.c</a>,
-<a href="../base/gxclthrd.h">base/gxclthrd.h</a>,
-<a href="../base/gxclutil.c">base/gxclutil.c</a>,
-<a href="../base/gxclzlib.c">base/gxclzlib.c</a>,
-<a href="../base/gxdhtserial.c">base/gxdhtserial.c</a>,
-<a href="../base/gxdhtserial.h">base/gxdhtserial.h</a>,
-<a href="../base/gsserial.c">base/gsserial.c</a>,
-<a href="../base/gsserial.h">base/gsserial.h</a>.
-
-</dl>
-
-<h4><a name="Visual_trace"></a>Visual Trace</h4>
-
-<dl>
-
-<dt>
-Visual Trace support :
-<dd>
-<a href="../base/vdtrace.h">base/vdtrace.h</a>,
-<a href="../base/vdtrace.c">base/vdtrace.c</a>.
-</dl>
-
-See <a href="Lib.htm">doc/Lib.htm</a> for extensive documentation on
-Visual Trace instructions.
-
-
-<h3><a name="Device_drivers"></a>Device drivers</h3>
-
-<p>
-See <a href="Drivers.htm">doc/Drivers.htm</a> for extensive documentation on
-the interface between the core code and drivers.
-
-<p>
-The driver API includes high-level (path / image / text), mid-level
-(polygon), and low-level (rectangle / raster) operations. Most devices
-implement only the low-level operations, and let generic code break down the
-high-level operations. However, some devices produce high-level output, and
-therefore must implement the high-level operations.
-
-<h4><a name="Internal_devices"></a>Internal devices</h4>
-
-<p>
-There are a number of "devices" that serve internal purposes. Some of these
-are meant to be real rendering targets; others are intended for use in
-device pipelines. The rendering targets are:
-
-<dl>
-
-<dt>
-Memory devices, depth-independent:
-<dd>
-<a href="../base/gdevmem.c">base/gdevmem.c</a>,
-<a href="../base/gdevmem.h">base/gdevmem.h</a>,
-<a href="../base/gdevmpla.c">base/gdevmpla.c</a>,
-<a href="../base/gdevmpla.h">base/gdevmpla.h</a>,
-<a href="../base/gdevmrop.h">base/gdevmrop.h</a>,
-<a href="../base/gsdevmem.c">base/gsdevmem.c</a>,
-<a href="../base/gxdevmem.h">base/gxdevmem.h</a>.
-
-<dt>
-Memory devices, specific depths:
-<dd>
-<a href="../base/gdevm1.c">base/gdevm1.c</a>,
-<a href="../base/gdevm2.c">base/gdevm2.c</a>,
-<a href="../base/gdevm4.c">base/gdevm4.c</a>,
-<a href="../base/gdevm8.c">base/gdevm8.c</a>,
-<a href="../base/gdevm16.c">base/gdevm16.c</a>,
-<a href="../base/gdevm24.c">base/gdevm24.c</a>,
-<a href="../base/gdevm32.c">base/gdevm32.c</a>,
-<a href="../base/gdevm40.c">base/gdevm40.c</a>,
-<a href="../base/gdevm48.c">base/gdevm48.c</a>,
-<a href="../base/gdevm56.c">base/gdevm56.c</a>,
-<a href="../base/gdevm64.c">base/gdevm64.c</a>,
-<a href="../base/gdevmr1.c">base/gdevmr1.c</a>,
-<a href="../base/gdevmr2n.c">base/gdevmr2n.c</a>,
-<a href="../base/gdevmr8n.c">base/gdevmr8n.c</a>.
-
-<dt>
-Alpha-related devices:
-<dd>
-<a href="../base/gdevabuf.c">base/gdevabuf.c</a>.
-
-<dt>
-Other devices:
-<dd>
-<a href="../base/gdevdflt.c">base/gdevdflt.c</a>,
-<a href="../base/gdevhit.c">base/gdevhit.c</a>,
-<a href="../base/gdevmrun.c">base/gdevmrun.c</a>,
-<a href="../base/gdevmrun.h">base/gdevmrun.h</a>,
-<a href="../base/gdevplnx.c">base/gdevplnx.c</a>,
-<a href="../base/gdevplnx.h">base/gdevplnx.h</a>.
-</dl>
-
-<p>
-The forwarding devices meant for use in pipelines are:
-
-<dl>
-
-<dt>
-The bounding box device:
-<dd>
-<a href="../base/gdevbbox.h">base/gdevbbox.h</a>,
-<a href="../base/gdevbbox.c">base/gdevbbox.c</a>.
-
-<dt>
-Clipping devices:
-<dd>
-See under <a href="#Clipping">Clipping</a> above.
-
-<dt>
-Other devices:
-<dd>
-<a href="../base/gdevnfwd.c">base/gdevnfwd.c</a>.
-
-</dl>
-
-<h4><a name="PS_and_PDF_writers"></a>PostScript and PDF writers</h4>
-
-<p>
-Because PostScript and PDF have the same graphics model, lexical syntax, and
-stack-based execution model, the drivers that produce PostScript and PDF
-output share a significant amount of support code. In the future, the
-PostScript output driver should be replaced with a slightly modified version
-of the PDF driver, since the latter is far more sophisticated (in
-particular, it has extensive facilities for image compression and for
-handling text and fonts).
-
-<p>
-The PDF code for handling text and fonts is complex and fragile. A major
-rewrite in June 2002 was intended to make it more robust and somewhat easier
-to understand, but also increased its size by about 40%, contrary to the
-expectation that it would shrink. Currently both sets of code are in the
-code base, with compatible APIs, selected by a line in <a
-href="../devices/devs.mak">devices/devs.mak</a>.
-
-<dl>
-
-<dt>
-Shared support:
-<dd>
-
-<dl>
- <dt>
- Writing fonts:</dt>
- <dd>
- <a href="../devices/vector/gdevpsf.h">devices/vector/gdevpsf.h</a>,
- <a href="../devices/vector/gdevpsf1.c">devices/vector/gdevpsf1.c</a>,
- <a href="../devices/vector/gdevpsf2.c">devices/vector/gdevpsf2.c</a>,
- <a href="../devices/vector/gdevpsfm.c">devices/vector/gdevpsfm.c</a>,
- <a href="../devices/vector/gdevpsft.c">devices/vector/gdevpsft.c</a>,
- <a href="../devices/vector/gdevpsfu.c">devices/vector/gdevpsfu.c</a>,
- <a href="../devices/vector/gdevpsfx.c">devices/vector/gdevpsfx.c</a>,
- <a href="../base/gscedata.c">base/gscedata.c</a>,
- <a href="../base/gscedata.h">base/gscedata.h</a>,
- <a href="../base/gscencs.c">base/gscencs.c</a>,
- <a href="../base/gscencs.h">base/gscencs.h</a>.
-
- <dt>
- Other:</dt>
- <dd>
- <a href="../devices/vector/gdevpsdf.h">devices/vector/gdevpsdf.h</a>,
- <a href="../devices/vector/gdevpsdi.c">devices/vector/gdevpsdi.c</a>,
- <a href="../devices/vector/gdevpsdp.c">devices/vector/gdevpsdp.c</a>,
- <a href="../devices/vector/gdevpsds.c">devices/vector/gdevpsds.c</a>,
- <a href="../devices/vector/gdevpsds.h">devices/vector/gdevpsds.h</a>,
- <a href="../devices/vector/gdevpsdu.c">devices/vector/gdevpsdu.c</a>.
-
-</dl>
-
-<dl>
-<dt>
-Encapsulated PostScript output driver (epswrite):</dt>
-<dd>
-<a href="../devices/vector/gdevpsu.c">devices/vector/gdevpsu.c</a>,
-<a href="../devices/vector/gdevpsu.h">devices/vector/gdevpsu.h</a>.
-</dd>
-</dl>
-
-<dl>
-<dt>
-PDF output driver (pdfwrite):</dt>
-<dd></dd>
-</dl>
-
-<dl>
-
-<dt>
-Substrate:</dt>
-<dd>
-<a href="../devices/vector/gdevpdfo.c">devices/vector/gdevpdfo.c</a>,
-<a href="../devices/vector/gdevpdfo.h">devices/vector/gdevpdfo.h</a>,
-<a href="../devices/vector/gdevpdfr.c">devices/vector/gdevpdfr.c</a>,
-<a href="../devices/vector/gdevpdfu.c">devices/vector/gdevpdfu.c</a>.
-</dd>
-</dl>
-
-<dl>
-<dt>
-Old text and fonts:</dt>
-<dd>
-<a href="../devices/vector/gdevpdfe.c">devices/vector/gdevpdfe.c</a>,
-<a href="../devices/vector/gdevpdft.c">devices/vector/gdevpdft.c</a>.
-</dd>
-</dl>
-
-
-<dl>
-<dt>
-New text and fonts:</dt>
-<dd>
-<a href="../devices/vector/gdevpdt.c">devices/vector/gdevpdt.c</a>,
-<a href="../devices/vector/gdevpdt.h">devices/vector/gdevpdt.h</a>,
-<a href="../devices/vector/gdevpdtb.c">devices/vector/gdevpdtb.c</a>,
-<a href="../devices/vector/gdevpdtb.h">devices/vector/gdevpdtb.h</a>,
-<a href="../devices/vector/gdevpdtc.c">devices/vector/gdevpdtc.c</a>,
-<a href="../devices/vector/gdevpdtd.c">devices/vector/gdevpdtd.c</a>,
-<a href="../devices/vector/gdevpdtd.h">devices/vector/gdevpdtd.h</a>,
-<a href="../devices/vector/gdevpdte.c">devices/vector/gdevpdte.c</a>,
-<a href="../devices/vector/gdevpdtf.c">devices/vector/gdevpdtf.c</a>,
-<a href="../devices/vector/gdevpdtf.h">devices/vector/gdevpdtf.h</a>,
-<a href="../devices/vector/gdevpdti.c">devices/vector/gdevpdti.c</a>,
-<a href="../devices/vector/gdevpdti.h">devices/vector/gdevpdti.h</a>,
-<a href="../devices/vector/gdevpdts.c">devices/vector/gdevpdts.c</a>,
-<a href="../devices/vector/gdevpdts.h">devices/vector/gdevpdts.h</a>,
-<a href="../devices/vector/gdevpdtt.c">devices/vector/gdevpdtt.c</a>,
-<a href="../devices/vector/gdevpdtt.h">devices/vector/gdevpdtt.h</a>,
-<a href="../devices/vector/gdevpdtv.c">devices/vector/gdevpdtv.c</a>,
-<a href="../devices/vector/gdevpdtv.h">devices/vector/gdevpdtv.h</a>,
-<a href="../devices/vector/gdevpdtw.c">devices/vector/gdevpdtw.c</a>,
-<a href="../devices/vector/gdevpdtw.h">devices/vector/gdevpdtw.h</a>,
-<a href="../devices/vector/gdevpdtx.h">devices/vector/gdevpdtx.h</a>.
-<a href="../base/ConvertUTF.h">base/ConvertUTF.h</a>,
-<a href="../base/ConvertUTF.c">base/ConvertUTF.c</a>,
-</dd>
-</dl>
-
-<dl>
-<dt>
-Graphics:</dt>
-<dd>
-<a href="../devices/vector/gdevpdfc.c">devices/vector/gdevpdfc.c</a>,
-<a href="../devices/vector/gdevpdfc.h">devices/vector/gdevpdfc.h</a>,
-<a href="../devices/vector/gdevpdfd.c">devices/vector/gdevpdfd.c</a>,
-<a href="../devices/vector/gdevpdfg.c">devices/vector/gdevpdfg.c</a>,
-<a href="../devices/vector/gdevpdfg.h">devices/vector/gdevpdfg.h</a>,
-<a href="../devices/vector/gdevpdfk.c">devices/vector/gdevpdfk.c</a>,
-<a href="../devices/vector/gdevpdft.c">devices/vector/gdevpdft.c</a>.
-<a href="../devices/vector/gdevpdfv.c">devices/vector/gdevpdfv.c</a>.
-</dd>
-</dl>
-
-<dl>
-<dt>
-Images:</dt>
-<dd>
-<a href="../devices/vector/gdevpdfb.c">devices/vector/gdevpdfb.c</a>,
-<a href="../devices/vector/gdevpdfi.c">devices/vector/gdevpdfi.c</a>,
-<a href="../devices/vector/gdevpdfj.c">devices/vector/gdevpdfj.c</a>.
-</dd>
-</dl>
-
-<dl>
-<dt>
-Other:</dt>
-<dd>
-<a href="../devices/vector/gdevpdf.c">devices/vector/gdevpdf.c</a>,
-<a href="../devices/vector/gdevpdfm.c">devices/vector/gdevpdfm.c</a>,
-<a href="../devices/vector/gdevpdfp.c">devices/vector/gdevpdfp.c</a>,
-<a href="../devices/vector/gdevpdfx.h">devices/vector/gdevpdfx.h</a>.
-<a href="../devices/vector/gdevpdfb.h">devices/vector/gdevpdfb.h</a>.
-</dd>
-
-</dl>
-
-
-
-<h4><a name="High_level_devices"></a>Other high-level devices</h4>
-
-<dl>
- <dt>
-PCL XL output device (pxlmono, pxlcolor):</dt>
-<dd>
-<a href="../devices/vector/gdevpx.c">devices/vector/gdevpx.c</a>,
-<a href="../base/gdevpxat.h">base/gdevpxat.h</a>,
-<a href="../base/gdevpxen.h">base/gdevpxen.h</a>,
-<a href="../base/gdevpxop.h">base/gdevpxop.h</a>,
-<a href="../devices/gdevpxut.c">devices/gdevpxut.c</a>,
-<a href="../devices/gdevpxut.h">devices/gdevpxut.h</a>.
-</dd>
-</dl>
-
-<dl>
-
-<dt>
-Text extraction:</dt>
-<dd>
-<a href="../devices/vector/gdevtxtw.c">devices/vector/gdevtxtw.c</a>.
-</dd>
-</dl>
-<dl>
-<dt>
-Other high-level devices:</dt>
-<dd>
-<a href="../devices/gdevtrac.c">devices/gdevtrac.c</a>.
-</dd>
-</dl>
-
-
-<h4><a name="Other_maintained_drivers"></a>Other maintained drivers</h4>
-
-<p>
-The standard Ghostscript distribution includes a collection of drivers,
-mostly written by Aladdin Enterprises, that are "maintained" in the same
-sense as the Ghostscript core code.
-
-<dl>
-
-<dt>
-Display drivers:</dt>
-<dd>
-<a href="../devices/gdev8bcm.c">devices/gdev8bcm.c</a>,
-<a href="../devices/gdev8bcm.h">devices/gdev8bcm.h</a>,
-<a href="../devices/gdevevga.c">devices/gdevevga.c</a>,
-<a href="../devices/gdevl256.c">devices/gdevl256.c</a>,
-<a href="../base/gdevpccm.c">base/gdevpccm.c</a>,
-<a href="../base/gdevpccm.h">base/gdevpccm.h</a>,
-<a href="../devices/gdevpcfb.c">devices/gdevpcfb.c</a>,
-<a href="../devices/gdevpcfb.h">devices/gdevpcfb.h</a>,
-<a href="../devices/gdevs3ga.c">devices/gdevs3ga.c</a>,
-<a href="../devices/gdevsco.c">devices/gdevsco.c</a>,
-<a href="../devices/gdevsvga.c">devices/gdevsvga.c</a>,
-<a href="../devices/gdevsvga.h">devices/gdevsvga.h</a>,
-<a href="../devices/gdevvglb.c">devices/gdevvglb.c</a>.
-</dd>
-</dl>
-
-<dl>
-<dt>
-Window system drivers:</dt>
-<dd></dd>
-</dl>
-
-<dl>
-
-<dt>
-X Windows:</dt>
-<dd>
-<a href="../devices/gdevx.c">devices/gdevx.c</a>,
-<a href="../devices/gdevx.h">devices/gdevx.h</a>,
-<a href="../devices/gdevxalt.c">devices/gdevxalt.c</a>,
-<a href="../devices/gdevxcmp.c">devices/gdevxcmp.c</a>,
-<a href="../devices/gdevxcmp.h">devices/gdevxcmp.h</a>,
-<a href="../devices/gdevxini.c">devices/gdevxini.c</a>,
-<a href="../devices/gdevxres.c">devices/gdevxres.c</a>.
-</dd>
-</dl>
-
-<dl>
-<dt>
-Microsoft Windows:</dt>
-<dd>
-<a href="../devices/gdevmswn.c">devices/gdevmswn.c</a>,
-<a href="../devices/gdevmswn.h">devices/gdevmswn.h</a>,
-<a href="../devices/gdevmsxf.c">devices/gdevmsxf.c</a>,
-<a href="../devices/gdevwddb.c">devices/gdevwddb.c</a>,
-<a href="../devices/gdevwdib.c">devices/gdevwdib.c</a>.</dd>
-
-<dt>
-OS/2 Presentation Manager:</dt>
-<dd>
-<a href="../devices/gdevpm.h">devices/gdevpm.h</a>,
-<a href="../base/gspmdrv.c">base/gspmdrv.c</a>,
-<a href="../base/gspmdrv.h">base/gspmdrv.h</a>.</dd>
-
-</dl>
-
-<dl>
-<dt>
-Raster file output drivers:</dt>
-<dd></dd>
-</dl>
-
-<dl>
-
-<dt>
-Fax and TIFF:</dt>
-<dd>
-<a href="../devices/gdevfax.c">devices/gdevfax.c</a>,
-<a href="../devices/gdevfax.h">devices/gdevfax.h</a>,
-<a href="../devices/gdevtfax.c">devices/gdevtfax.c</a>,
-<a href="../devices/gdevtfax.h">devices/gdevtfax.h</a>,
-<a href="../devices/gdevtifs.c">devices/gdevtifs.c</a>,
-<a href="../devices/gdevtifs.h">devices/gdevtifs.h</a>,
-<a href="../devices/gdevtfnx.c">devices/gdevtfnx.c</a>.
-<a href="../devices/gdevtsep.c">devices/gdevtsep.c</a>.
-
-</dd>
-
-<dt>
-Example DeviceN devices:
-<dd>
-<a href="../base/gdevdevn.c">base/gdevdevn.c</a>,
-<a href="../base/gdevdevn.h">base/gdevdevn.h</a>,
-<a href="../devices/gdevxcf.c">devices/gdevxcf.c</a>,
-<a href="../devices/gdevpsd.c">devices/gdevpsd.c</a>,
-<a href="../devices/gdevperm.c">devices/gdevperm.c</a>.
-
-</dd>
-
-<dt>
-Other raster file formats:
-<dd>
-<a href="../devices/gdevbit.c">devices/gdevbit.c</a>,
-<a href="../devices/gdevbmp.c">devices/gdevbmp.c</a>,
-<a href="../devices/gdevbmp.h">devices/gdevbmp.h</a>,
-<a href="../devices/gdevbmpa.c">devices/gdevbmpa.c</a>,
-<a href="../devices/gdevbmpc.c">devices/gdevbmpc.c</a>,
-<a href="../devices/gdevjpeg.c">devices/gdevjpeg.c</a>,
-<a href="../devices/gdevmiff.c">devices/gdevmiff.c</a>,
-<a href="../devices/gdevp2up.c">devices/gdevp2up.c</a>,
-<a href="../devices/gdevpcx.c">devices/gdevpcx.c</a>,
-<a href="../devices/gdevpbm.c">devices/gdevpbm.c</a>,
-<a href="../devices/gdevpng.c">devices/gdevpng.c</a>,
-<a href="../devices/gdevpsim.c">devices/gdevpsim.c</a>.
-
-</dd>
-
-</dl>
-
-<dl>
-<dt>
-Printer drivers:
-<dd>
-
-<dl>
-
-<dt>
-Operating system printer services:
-<dd>
-<a href="../devices/gdevos2p.c">devices/gdevos2p.c</a>,
-<a href="../devices/gdevwpr2.c">devices/gdevwpr2.c</a>,
-<a href="../devices/gdevwprn.c">devices/gdevwprn.c</a>.
-
-<dt>
-H-P monochrome printers:
-<dd>
-<a href="../devices/gdevdljm.c">devices/gdevdljm.c</a>,
-<a href="../devices/gdevdljm.h">devices/gdevdljm.h</a>,
-<a href="../devices/gdevdjet.c">devices/gdevdjet.c</a>,
-<a href="../devices/gdevlj56.c">devices/gdevlj56.c</a>.
-
-<dt>
-Other printers:
-<dd>
-<a href="../devices/gdevatx.c">devices/gdevatx.c</a>.
-
-</dl>
-
-</dl>
-
-<h4><a name="Contributed_drivers"></a>Contributed drivers</h4>
-
-<p>
-This list is likely to be incomplete and inaccurate: see
-<a href="../devices/contrib.mak">devices/contrib.mak</a> and
-<a href="../contrib/contrib.mak">contrib/contrib.mak</a>.
-
-<dl>
-
-<dt>
-Display and window system drivers:
-<dd>
-<a href="../devices/gdev3b1.c">devices/gdev3b1.c</a>,
-<a href="../devices/gdevherc.c">devices/gdevherc.c</a>,
-<a href="../devices/gdevpe.c">devices/gdevpe.c</a>,
-<a href="../devices/gdevsnfb.c">devices/gdevsnfb.c</a>,
-<a href="../devices/gdevsun.c">devices/gdevsun.c</a>.
-
-<dt>
-Raster file output drivers:
-<dd>
-<a href="../devices/gdevcfax.c">devices/gdevcfax.c</a>,
-<a href="../devices/gdevcif.c">devices/gdevcif.c</a>,
-<a href="../devices/gdevdfax.c">devices/gdevdfax.c</a>,
-<a href="../devices/gdevifno.c">devices/gdevifno.c</a>,
-<a href="../devices/gdevmgr.c">devices/gdevmgr.c</a>,
-<a href="../devices/gdevmgr.h">devices/gdevmgr.h</a>,
-<a href="../devices/gdevsgi.c">devices/gdevsgi.c</a>,
-<a href="../devices/gdevsgi.h">devices/gdevsgi.h</a>,
-<a href="../devices/gdevsunr.c">devices/gdevsunr.c</a>,
-<a href="../devices/gdevjbig2.c">devices/gdevjbig2.c</a>,
-<a href="../devices/gdevjpx.c">devices/gdevjpx.c</a>.
-
-<dt>
-Printer drivers:
-<dd>
-<a href="../lib/bj8.rpd">lib/bj8.rpd</a>,
-<a href="../lib/cbjc600.ppd">lib/cbjc600.ppd</a>,
-<a href="../lib/cbjc800.ppd">lib/cbjc800.ppd</a>,
-<a href="../devices/gdev3852.c">devices/gdev3852.c</a>,
-<a href="../devices/gdev4081.c">devices/gdev4081.c</a>,
-<a href="../devices/gdev4693.c">devices/gdev4693.c</a>,
-<a href="../devices/gdev8510.c">devices/gdev8510.c</a>,
-<a href="../devices/gdevadmp.c">devices/gdevadmp.c</a>,
-<a href="../devices/gdevbj10.c">devices/gdevbj10.c</a>,
-<a href="../devices/gdevbjc.h">devices/gdevbjc.h</a>,
-<a href="../devices/gdevbjcl.c">devices/gdevbjcl.c</a>,
-<a href="../devices/gdevbjcl.h">devices/gdevbjcl.h</a>,
-<a href="../devices/gdevccr.c">devices/gdevccr.c</a>,
-<a href="../devices/gdevcdj.c">devices/gdevcdj.c</a>,
-<a href="../devices/gdevclj.c">devices/gdevclj.c</a>,
-<a href="../devices/gdevcljc.c">devices/gdevcljc.c</a>,
-<a href="../devices/gdevcslw.c">devices/gdevcslw.c</a>,
-<a href="../devices/gdevdjtc.c">devices/gdevdjtc.c</a>,
-<a href="../devices/gdevdm24.c">devices/gdevdm24.c</a>,
-<a href="../devices/gdevepsc.c">devices/gdevepsc.c</a>,
-<a href="../devices/gdevepsn.c">devices/gdevepsn.c</a>,
-<a href="../devices/gdevescp.c">devices/gdevescp.c</a>,
-<a href="../devices/gdevhl7x.c">devices/gdevhl7x.c</a>,
-<a href="../devices/gdevijs.c">devices/gdevijs.c</a>,
-<a href="../devices/gdevimgn.c">devices/gdevimgn.c</a>,
-<a href="../devices/gdevl31s.c">devices/gdevl31s.c</a>,
-<a href="../devices/gdevlbp8.c">devices/gdevlbp8.c</a>,
-<a href="../devices/gdevlp8k.c">devices/gdevlp8k.c</a>,
-<a href="../devices/gdevlxm.c">devices/gdevlxm.c</a>,
-<a href="../devices/gdevn533.c">devices/gdevn533.c</a>,
-<a href="../devices/gdevo182.c">devices/gdevo182.c</a>,
-<a href="../devices/gdevokii.c">devices/gdevokii.c</a>,
-<a href="../devices/gdevpcl.c">devices/gdevpcl.c</a>,
-<a href="../devices/gdevpcl.h">devices/gdevpcl.h</a>,
-<a href="../devices/gdevphex.c">devices/gdevphex.c</a>,
-<a href="../devices/gdevpjet.c">devices/gdevpjet.c</a>,
-<a href="../devices/gdevsj48.c">devices/gdevsj48.c</a>,
-<a href="../devices/gdevsppr.c">devices/gdevsppr.c</a>,
-<a href="../devices/gdevstc.c">devices/gdevstc.c</a>,
-<a href="../devices/gdevstc.h">devices/gdevstc.h</a>,
-<a href="../devices/gdevstc1.c">devices/gdevstc1.c</a>,
-<a href="../devices/gdevstc2.c">devices/gdevstc2.c</a>,
-<a href="../devices/gdevstc3.c">devices/gdevstc3.c</a>,
-<a href="../devices/gdevstc4.c">devices/gdevstc4.c</a>,
-<a href="../devices/gdevtknk.c">devices/gdevtknk.c</a>,
-<a href="../devices/gdevupd.c">devices/gdevupd.c</a>.
-
-<dt>
-The special <code>rinkj</code> high-quality inkjet driver:
-<dd>
-<a href="../devices/gdevrinkj.c">devices/gdevrinkj.c</a>,
-<a href="../base/gsequivc.c">base/gsequivc.c</a>,
-<a href="../base/gsequivc.h">base/gsequivc.h</a>,
-<a href="../devices/rinkj/evenbetter-rll.c">devices/rinkj/evenbetter-rll.c</a>,
-<a href="../devices/rinkj/evenbetter-rll.h">devices/rinkj/evenbetter-rll.h</a>,
-<a href="../devices/rinkj/rinkj-byte-stream.c">devices/rinkj/rinkj-byte-stream.c</a>,
-<a href="../devices/rinkj/rinkj-byte-stream.h">devices/rinkj/rinkj-byte-stream.h</a>,
-<a href="../devices/rinkj/rinkj-config.c">devices/rinkj/rinkj-config.c</a>,
-<a href="../devices/rinkj/rinkj-config.h">devices/rinkj/rinkj-config.h</a>,
-<a href="../devices/rinkj/rinkj-device.c">devices/rinkj/rinkj-device.c</a>,
-<a href="../devices/rinkj/rinkj-device.h">devices/rinkj/rinkj-device.h</a>,
-<a href="../devices/rinkj/rinkj-dither.c">devices/rinkj/rinkj-dither.c</a>,
-<a href="../devices/rinkj/rinkj-dither.h">devices/rinkj/rinkj-dither.h</a>,
-<a href="../devices/rinkj/rinkj-epson870.c">devices/rinkj/rinkj-epson870.c</a>,
-<a href="../devices/rinkj/rinkj-epson870.h">devices/rinkj/rinkj-epson870.h</a>,
-<a href="../devices/rinkj/rinkj-screen-eb.c">devices/rinkj/rinkj-screen-eb.c</a>,
-<a href="../devices/rinkj/rinkj-screen-eb.h">devices/rinkj/rinkj-screen-eb.h</a>,
-<a href="../lib/rinkj-2200-setup">lib/rinkj-2200-setup</a>.
-
-</dl>
-
-<h3><a name="PostScript_interpreter"></a>PostScript interpreter</h3>
-
-<p>
-The PostScript interpreter is conceptually simple: in fact, an interpreter
-that could execute "3 4 add =" and print "7" was running 3 weeks after the
-first line of Ghostscript code was written. However, a number of
-considerations make the code large and complex.
-
-<p>
-The interpreter is designed to run in environments with very limited memory.
-The main consequence of this is that it cannot allocate its stacks
-(dictionary, execution, operand) as ordinary arrays, since the
-user-specified stack size limit may be very large. Instead, it allocates
-them as a linked list of blocks. See below for more details.
-
-<p>
-The interpreter must never cause a C runtime error that it cannot trap.
-Unfortunately, C implementations almost never provide the ability to trap
-stack overflow. In order to put a fixed bound on the C stack size, the
-interpreter never implements PostScript recursion by C recursion. This
-means that any C code that logically needs to call the interpreter must
-instead push a continuation (including all necessary state information) on
-the PostScript execution stack, followed by the PostScript object to be
-executed, and then <em>return</em> to the interpreter. (See <a
-href="../psi/estack.h">psi/estack.h</a> for more details about
-continuations.) Unfortunately, since PostScript Level 2 introduces streams
-whose data source can be a PostScript procedure, any code that reads or
-writes stream data must be prepared to suspend itself, storing all necessary
-state in a continuation. There are some places where this is extremely
-awkward, such as the scanner/parser.
-
-<p>
-The use of continuations affects many places in the interpreter, and even
-some places in the graphics library. For example, when processing an image,
-one may need to call a PostScript procedure as part of mapping a CIE color
-to a device color. Ghostscript uses a variety of dodges to handle this: for
-example, in the case of CIE color mapping, all of the PostScript procedures
-are pre-sampled and the results cached. The Adobe implementation limits
-this kind of recursion to a fixed number of levels (5?): this would be
-another acceptable approach, but at this point it would require far more
-code restructuring than it would be worth.
-
-<p>
-A significant amount of the PostScript language implementation is in fact
-written in PostScript. Writing in PostScript leverages the C code for
-multi-threading, garbage collection, error handling, continuations for
-streams, etc., etc.; also, we have found PostScript in general more concise
-and easier to debug than C, mostly because of memory management issues. So
-given the choice, we tended to implement a feature in PostScript if it
-worked primarily with PostScript data structures, wasn't heavily used
-(example: font loading), or if it interacted with the stream or other
-callback machinery (examples: ReusableFileDecode streams, resourceforall).
-Often we would add non-standard PostScript operators for functions that had
-to run faster or that did more C-like things, such as the media matching
-algorithm for setpagedevice.
-
-
-
-<h4><a name="Main_program"></a>Main program</h4>
-
-<p>
-The main program of the interpreter is normally invoked from the command
-line, but it has an API as well. In fact, it has two APIs: one that
-recognizes the existence of multiple "interpreter instances" (although it
-currently provides a default instance, which almost all clients use), and a
-completely different one designed for Windows DLLs. These should be unified
-as soon as possible, since there are two steadily growing incompatible
-bodies of client code.
-
-<dl>
-
-<dt>
-Files:
-<dd>
-<a href="../psi/gs.c">psi/gs.c</a>,
-<a href="../psi/gserver.c">psi/gserver.c</a>,
-<a href="../psi/iinit.c">psi/iinit.c</a>,
-<a href="../psi/iinit.h">psi/iinit.h</a>,
-<a href="../psi/imain.c">psi/imain.c</a>,
-<a href="../psi/imain.h">psi/imain.h</a>,
-<a href="../psi/imainarg.c">psi/imainarg.c</a>,
-<a href="../psi/imainarg.h">psi/imainarg.h</a>,
-<a href="../psi/iminst.h">psi/iminst.h</a>,
-<a href="../psi/main.h">psi/main.h</a>.
-
-</dl>
-
-<h4><a name="Data_structures"></a>Data structures</h4>
-
-<p>
-The main data structures visible to the PostScript programmers are arrays,
-contexts, dictionaries, names, and stacks.
-
-<p>
-Arrays have no unusual properties. See under <a href="#Refs">Refs</a> below
-for more information about how array elements are stored.
-
-<p>
-Contexts are used to hold the interpreter state even in configurations that
-don't include the Display PostScript multiple context extension. Context
-switching is implemented by a complex cooperation of C and PostScript code.
-
-<p>
-Dictionaries have two special properties worth noting:
-
-<ul>
-
-<li>They use an optimized storage representation if all the keys are names,
-which is almost always the case.
-
-<li>They interact with a caching scheme used to accelerate name lookup in
-the interpreter.
-
-</ul>
-
-<p>
-Names are allocated in blocks. The characters and hash chains are stored
-separately from the lookup cache information, so that in the future, most of
-the former can be compiled into the executable and shared or put in ROM.
-(This is not actually done yet.)
-
-<dl>
-
-<dt>
-Contexts:
-<dd>
-<a href="../psi/icontext.c">psi/icontext.c</a>,
-<a href="../psi/icontext.h">psi/icontext.h</a>,
-<a href="../psi/icstate.h">psi/icstate.h</a>.
-
-<dt>
-Dictionaries:
-<dd>
-<a href="../psi/iddict.h">psi/iddict.h</a>,
-<a href="../psi/idict.h">psi/idict.h</a>,
-<a href="../psi/idict.c">psi/idict.c</a>,
-<a href="../psi/idictdef.h">psi/idictdef.h</a>,
-<a href="../psi/idicttpl.h">psi/idicttpl.h</a>.
-
-<dt>
-Names:
-<dd>
-<a href="../psi/iname.c">psi/iname.c</a>,
-<a href="../psi/iname.h">psi/iname.h</a>,
-<a href="../psi/inamedef.h">psi/inamedef.h</a>,
-<a href="../psi/inameidx.h">psi/inameidx.h</a>,
-<a href="../psi/inames.h">psi/inames.h</a>,
-<a href="../psi/inamestr.h">psi/inamestr.h</a>.
-
-</dl>
-
-<h4><a name="Stacks"></a>Stacks</h4>
-
-<p>
-As mentioned above, each stack is allocated as a linked list of blocks.
-However, for reasonable performance, operators must normally be able to
-access their operands and produce their results using indexing rather than
-an access procedure. This is implemented by ensuring that all the operands
-of an operator are in the topmost block of the stack, using guard entries
-that cause an internal error if the condition isn't met. See <a
-href="../psi/iostack.h">psi/iostack.h</a> for more details.
-
-<dl>
-
-<dt>
-Generic stacks:
-<dd>
-<a href="../psi/isdata.h">psi/isdata.h</a>,
-<a href="../psi/istack.c">psi/istack.c</a>,
-<a href="../psi/istack.h">psi/istack.h</a>,
-<a href="../psi/istkparm.h">psi/istkparm.h</a>.
-
-<dt>
-Specific stacks:
-<dd>
-
-<dl>
-
-<dt>
-Dictionary stack:
-<dd>
-<a href="../psi/dstack.h">psi/dstack.h</a>,
-<a href="../psi/iddstack.h">psi/iddstack.h</a>,
-<a href="../psi/idsdata.h">psi/idsdata.h</a>,
-<a href="../psi/idstack.c">psi/idstack.c</a>,
-<a href="../psi/idstack.h">psi/idstack.h</a>.
-
-<dt>
-Execution stack:
-<dd>
-<a href="../psi/estack.h">psi/estack.h</a>,
-<a href="../psi/iesdata.h">psi/iesdata.h</a>,
-<a href="../psi/iestack.h">psi/iestack.h</a>.
-
-<dt>
-Operand stack:
-<dd>
-<a href="../psi/iosdata.h">psi/iosdata.h</a>,
-<a href="../psi/iostack.h">psi/iostack.h</a>,
-<a href="../psi/ostack.h">psi/ostack.h</a>.
-
-</dl>
-
-</dl>
-
-<h4><a name="Interpreter_loop"></a>Interpreter loop</h4>
-
-<dl>
-
-<dt>
-Files:
-<dd>
-<a href="../psi/interp.c">psi/interp.c</a>,
-<a href="../psi/interp.h">psi/interp.h</a>.
-
-</dl>
-
-<h4><a name="Scanning_parsing"></a>Scanning/parsing</h4>
-
-<p>
-PostScript parsing consists essentially of token scanning, and is simple in
-principle. The scanner is complex because it must be able to suspend its
-operation at any time (i.e., between any two input characters) to allow an
-interpreter callout, if its input is coming from a procedure-based stream
-and the procedure must be called to provide more input data.
-
-<dl>
-
-<dt>
-Main scanner:
-<dd>
-<a href="../psi/iscan.c">psi/iscan.c</a>,
-<a href="../psi/iscan.h">psi/iscan.h</a>,
-<a href="../psi/iscannum.c">psi/iscannum.c</a>,
-<a href="../psi/iscannum.h">psi/iscannum.h</a>,
-<a href="../base/scanchar.h">base/scanchar.h</a>,
-<a href="../base/scantab.c">base/scantab.c</a>.
-
-<dt>
-Binary tokens:
-<dd>
-<a href="../psi/btoken.h">psi/btoken.h</a>,
-<a href="../psi/ibnum.c">psi/ibnum.c</a>,
-<a href="../psi/ibnum.h">psi/ibnum.h</a>,
-<a href="../psi/inobtokn.c">psi/inobtokn.c</a>,
-<a href="../psi/iscanbin.c">psi/iscanbin.c</a>,
-<a href="../psi/iscanbin.h">psi/iscanbin.h</a>.
-
-<dt>
-DSC parsing:
-<dd>
-<a href="../psi/dscparse.c">psi/dscparse.c</a>,
-<a href="../psi/dscparse.h">psi/dscparse.h</a>.
-
-</dl>
-
-<h4><a name="Standard_operators"></a>Standard operators</h4>
-
-<dl>
-
-<dt>
-Non-output-related:
-<dd>
-
-<dl>
-
-<dt>
-Filters:
-<dd>
-<a href="../psi/ifilter.h">psi/ifilter.h</a>,
-<a href="../psi/ifilter2.h">psi/ifilter2.h</a>,
-<a href="../psi/ifrpred.h">psi/ifrpred.h</a>,
-<a href="../psi/ifwpred.h">psi/ifwpred.h</a>,
-<a href="../psi/istream.h">psi/istream.h</a>,
-<a href="../psi/zfbcp.c">psi/zfbcp.c</a>,
-<a href="../psi/zfdctd.c">psi/zfdctd.c</a>,
-<a href="../psi/zfdcte.c">psi/zfdcte.c</a>,
-<a href="../psi/zfdecode.c">psi/zfdecode.c</a>,
-<a href="../psi/zfilter.c">psi/zfilter.c</a>,
-<a href="../psi/zfilter2.c">psi/zfilter2.c</a>,
-<a href="../psi/zfjbig2.c">psi/zfjbig2.c</a>,
-<a href="../psi/zfjpx.c">psi/zfjpx.c</a>,
-<a href="../psi/zfmd5.c">psi/zfmd5.c</a>,
-<a href="../psi/zfarc4.c">psi/zfarc4.c</a>,
-<a href="../psi/zfproc.c">psi/zfproc.c</a>,
-<a href="../psi/zfrsd.c">psi/zfrsd.c</a>,
-<a href="../psi/zfzlib.c">psi/zfzlib.c</a>.
-
-<dt>
-File and stream I/O:
-<dd>
-<a href="../psi/files.h">psi/files.h</a>,
-<a href="../psi/itoken.h">psi/itoken.h</a>,
-<a href="../psi/zbseq.c">psi/zbseq.c</a>,
-<a href="../psi/zdscpars.c">psi/zdscpars.c</a>,
-<a href="../psi/zfile.h">psi/zfile.h</a>,
-<a href="../psi/zfile.c">psi/zfile.c</a>,
-<a href="../psi/zfile1.c">psi/zfile1.c</a>,
-<a href="../psi/zfileio.c">psi/zfileio.c</a>,
-<a href="../psi/ztoken.c">psi/ztoken.c</a>.
-
-<dt>
-Data structures:
-<dd>
-<a href="../psi/zarray.c">psi/zarray.c</a>,
-<a href="../psi/zdict.c">psi/zdict.c</a>,
-<a href="../psi/zgeneric.c">psi/zgeneric.c</a>,
-<a href="../psi/zpacked.c">psi/zpacked.c</a>,
-<a href="../psi/zstring.c">psi/zstring.c</a>.
-
-<dt>
-Functions:
-<dd>
-<a href="../psi/ifunc.h">psi/ifunc.h</a>,
-<a href="../psi/zfunc.c">psi/zfunc.c</a>,
-<a href="../psi/zfunc0.c">psi/zfunc0.c</a>,
-<a href="../psi/zfunc3.c">psi/zfunc3.c</a>,
-<a href="../psi/zfunc4.c">psi/zfunc4.c</a>,
-
-<dt>
-Other:
-<dd>
-<a href="../psi/ivmem2.h">psi/ivmem2.h</a>,
-<a href="../psi/zalg.c">psi/zalg.c</a>,
-<a href="../psi/zarith.c">psi/zarith.c</a>,
-<a href="../psi/zcontext.c">psi/zcontext.c</a>,
-<a href="../psi/zcontrol.c">psi/zcontrol.c</a>,
-<a href="../psi/zmath.c">psi/zmath.c</a>,
-<a href="../psi/zmatrix.c">psi/zmatrix.c</a>,
-<a href="../psi/zmisc.c">psi/zmisc.c</a>,
-<a href="../psi/zmisc1.c">psi/zmisc1.c</a>,
-<a href="../psi/zmisc2.c">psi/zmisc2.c</a>,
-<a href="../psi/zmisc3.c">psi/zmisc3.c</a>,
-<a href="../psi/zrelbit.c">psi/zrelbit.c</a>,
-<a href="../psi/zstack.c">psi/zstack.c</a>,
-<a href="../psi/ztype.c">psi/ztype.c</a>,
-<a href="../psi/zusparam.c">psi/zusparam.c</a>,
-<a href="../psi/zvmem.c">psi/zvmem.c</a>,
-<a href="../psi/zvmem2.c">psi/zvmem2.c</a>.
-
-</dl>
-
-<dt>
-Output-related:
-<dd>
-
-<dl>
-
-<dt>
-Device management:
-<dd>
-<a href="../psi/zdevcal.c">psi/zdevcal.c</a>,
-<a href="../psi/zdevice.c">psi/zdevice.c</a>,
-<a href="../psi/zdevice2.c">psi/zdevice2.c</a>,
-<a href="../psi/ziodev.c">psi/ziodev.c</a>,
-<a href="../psi/ziodev2.c">psi/ziodev2.c</a>,
-<a href="../psi/ziodevs.c">psi/ziodevs.c</a>,
-<a href="../psi/zmedia2.c">psi/zmedia2.c</a>,
-
-<dt>
-Fonts and text:
-<dd>
-<a href="../psi/bfont.h">psi/bfont.h</a>,
-<a href="../psi/ichar.h">psi/ichar.h</a>,
-<a href="../psi/ichar1.h">psi/ichar1.h</a>,
-<a href="../psi/icharout.h">psi/icharout.h</a>,
-<a href="../psi/icid.h">psi/icid.h</a>,
-<a href="../psi/ifcid.h">psi/ifcid.h</a>,
-<a href="../psi/ifont.h">psi/ifont.h</a>,
-<a href="../psi/ifont1.h">psi/ifont1.h</a>,
-<a href="../psi/ifont2.h">psi/ifont2.h</a>,
-<a href="../psi/ifont42.h">psi/ifont42.h</a>,
-<a href="../psi/zbfont.c">psi/zbfont.c</a>,
-<a href="../psi/zcfont.c">psi/zcfont.c</a>,
-<a href="../psi/zchar.c">psi/zchar.c</a>,
-<a href="../psi/zchar1.c">psi/zchar1.c</a>,
-<a href="../psi/zchar2.c">psi/zchar2.c</a>,
-<a href="../psi/zchar32.c">psi/zchar32.c</a>,
-<a href="../psi/zchar42.c">psi/zchar42.c</a>,
-<a href="../psi/zchar42.h">psi/zchar42.h</a>,
-<a href="../psi/zcharout.c">psi/zcharout.c</a>,
-<a href="../psi/zcharx.c">psi/zcharx.c</a>,
-<a href="../psi/zcid.c">psi/zcid.c</a>,
-<a href="../psi/zfcid.c">psi/zfcid.c</a>,
-<a href="../psi/zfcid0.c">psi/zfcid0.c</a>,
-<a href="../psi/zfcid1.c">psi/zfcid1.c</a>,
-<a href="../psi/zfcmap.c">psi/zfcmap.c</a>,
-<a href="../psi/zfont.c">psi/zfont.c</a>,
-<a href="../psi/zfont0.c">psi/zfont0.c</a>,
-<a href="../psi/zfont1.c">psi/zfont1.c</a>,
-<a href="../psi/zfont2.c">psi/zfont2.c</a>,
-<a href="../psi/zfont32.c">psi/zfont32.c</a>,
-<a href="../psi/zfont42.c">psi/zfont42.c</a>,
-<a href="../psi/zfontenum.c">psi/zfontenum.c</a>.
-
-<dt>
-A bridge to the True Type bytecode interpreter:
-<dd>
-<a href="../base/gxttfb.c">base/gxttfb.c</a>,
-<a href="../base/gxttfb.h">base/gxttfb.h</a>,
-<a href="../base/ttfoutl.h">base/ttfoutl.h</a>,
-<a href="../base/ttfmain.c">base/ttfmain.c</a>,
-<a href="../base/ttfmemd.c">base/ttfmemd.c</a>,
-<a href="../base/ttfmemd.h">base/ttfmemd.h</a>,
-<a href="../base/ttfinp.c">base/ttfinp.c</a>,
-<a href="../base/ttfinp.h">base/ttfinp.h</a>.
-
-<dt>
-A reduced True Type bytecode interpreter:
-<br><em>(this is based in part on the work of the Freetype Team and incorporates some code from
-the
-FreeType 1 project)</em>
-<dd>
-<a href="../base/ttfsfnt.h">base/ttfsfnt.h</a>,
-<a href="../base/ttcalc.c">base/ttcalc.c</a>,
-<a href="../base/ttcalc.h">base/ttcalc.h</a>,
-<a href="../base/ttcommon.h">base/ttcommon.h</a>,
-<a href="../base/ttconf.h">base/ttconf.h</a>,
-<a href="../base/ttconfig.h">base/ttconfig.h</a>,
-<a href="../base/ttinterp.c">base/ttinterp.c</a>,
-<a href="../base/ttinterp.h">base/ttinterp.h</a>,
-<a href="../base/ttload.c">base/ttload.c</a>,
-<a href="../base/ttload.h">base/ttload.h</a>,
-<a href="../base/ttmisc.h">base/ttmisc.h</a>,
-<a href="../base/ttobjs.c">base/ttobjs.c</a>,
-<a href="../base/ttobjs.h">base/ttobjs.h</a>,
-<a href="../base/tttables.h">base/tttables.h</a>,
-<a href="../base/tttype.h">base/tttype.h</a>,
-<a href="../base/tttypes.h">base/tttypes.h</a>.
-
-<dt>
-Color, pattern, and halftone:
-<dd>
-<a href="../psi/icie.h">psi/icie.h</a>,
-<a href="../psi/icolor.h">psi/icolor.h</a>,
-<a href="../psi/icremap.h">psi/icremap.h</a>,
-<a href="../psi/icsmap.h">psi/icsmap.h</a>,
-<a href="../psi/iht.h">psi/iht.h</a>,
-<a href="../psi/ipcolor.h">psi/ipcolor.h</a>,
-<a href="../psi/zcie.c">psi/zcie.c</a>,
-<a href="../psi/zcolor.c">psi/zcolor.c</a>,
-<a href="../psi/zcolor1.c">psi/zcolor1.c</a>,
-<a href="../psi/zcolor2.c">psi/zcolor2.c</a>,
-<a href="../psi/zcolor3.c">psi/zcolor3.c</a>,
-<a href="../psi/zcrd.c">psi/zcrd.c</a>,
-<a href="../psi/zcsindex.c">psi/zcsindex.c</a>,
-<a href="../psi/zcspixel.c">psi/zcspixel.c</a>,
-<a href="../psi/zcssepr.c">psi/zcssepr.c</a>,
-<a href="../psi/zicc.c">psi/zicc.c</a>,
-<a href="../psi/zht.c">psi/zht.c</a>,
-<a href="../psi/zht1.c">psi/zht1.c</a>,
-<a href="../psi/zht2.h">psi/zht2.h</a>,
-<a href="../psi/zht2.c">psi/zht2.c</a>,
-<a href="../psi/zpcolor.c">psi/zpcolor.c</a>,
-<a href="../psi/zshade.c">psi/zshade.c</a>,
-<a href="../psi/ztrans.c">psi/ztrans.c</a>.
-
-<dt>
-Images:
-<dd>
-<a href="../psi/iimage.h">psi/iimage.h</a>,
-<a href="../psi/zimage.c">psi/zimage.c</a>,
-<a href="../psi/zimage3.c">psi/zimage3.c</a>,
-<a href="../psi/zfimscale.c">psi/zfimscale.c</a>.
-
-<dt>
-Other graphics:
-<dd>
-<a href="../psi/igstate.h">psi/igstate.h</a>,
-<a href="../psi/zdpnext.c">psi/zdpnext.c</a>,
-<a href="../psi/zdps.c">psi/zdps.c</a>,
-<a href="../psi/zdps1.c">psi/zdps1.c</a>,
-<a href="../psi/zgstate.c">psi/zgstate.c</a>,
-<a href="../psi/zpaint.c">psi/zpaint.c</a>,
-<a href="../psi/zpath.c">psi/zpath.c</a>,
-<a href="../psi/zpath1.c">psi/zpath1.c</a>,
-<a href="../psi/ztrap.c">psi/ztrap.c</a>,
-<a href="../psi/zupath.c">psi/zupath.c</a>.
-
-</dl>
-
-<dt>
-Operator support:
-<dd>
-<a href="../psi/oparc.h">psi/oparc.h</a>,
-<a href="../psi/opcheck.h">psi/opcheck.h</a>,
-<a href="../psi/opdef.h">psi/opdef.h</a>,
-<a href="../psi/oper.h">psi/oper.h</a>,
-<a href="../psi/opextern.h">psi/opextern.h</a>.
-
-</dl>
-
-<h4><a name="Non_standard_operators"></a>Non-standard operators</h4>
-
-<p>
-The interpreter includes many non-standard operators. Most of these provide
-some part of the function of a standard operator, so that the standard
-operator itself can be implemented in PostScript: these are not of interest
-to users, and their function is usually obvious from the way they are used.
-However, some non-standard operators provide access to additional,
-non-standard facilities that users might want to know about, such as
-transparency, RasterOp, and in-memory rendering. These are documented at <a
-href="Language.htm#Additional_operators">Language.htm#Additional_operators</a>.
-
-<p>
-We don't document the complete set of non-standard operators here, because
-the set changes frequently. However, all non-standard operators are
-supposed to have names that begin with '.', so you can find them all by
-executing the following (Unix) command:
-
-<blockquote><pre>
-grep '{".[.]' psi/[zi]*.c
-</pre></blockquote>
-
-<p>
-In addition to individual non-standard operators implemented in the same
-files as standard ones, there are several independent optional packages of
-non-standard operators. As with other non-standard operators, the names of
-all the operators in these packages begin with '.'. We list those packages
-here.
-
-<dl>
-
-<dt>
-<a href="../psi/zdouble.c">psi/zdouble.c</a>
-<dd>
-Provides "double" floating point arithmetic, using 8-byte strings to hold
-values. Developed under a contract; probably used only by the group that
-funded the development.
-
-<dt>
-<a href="../psi/zfsample.c">psi/zfsample.c</a>,
-<dd>
-Provides a special operator to sample a given function and create a new type 0 function.
-
-<dt>
-<a href="../psi/zsysvm.c">psi/zsysvm.c</a>
-<dd>
-Provides operators for allocating objects in specific VM spaces,
-disregarding the current VM mode.
-
-</dl>
-
-<h4><a name="Interpreter_support"></a>Interpreter support</h4>
-
-<p>
-Memory management (refs, GC, save/restore) -- see <a
-href="#PostScript_interpreter_extensions">below</a>.
-
-<dl>
-<dt>
-Font API :
-<dd>
-<a href="../psi/ifapi.h">psi/ifapi.h</a>,
-<a href="../psi/zfapi.c">psi/zfapi.c</a>,
-<a href="../base/fapiufst.c">base/fapiufst.c</a>,
-<a href="../base/fapi_ft.c">base/fapi_ft.c</a>,
-<a href="../base/wrfont.h">base/wrfont.h</a>,
-<a href="../base/wrfont.c">base/wrfont.c</a>,
-<a href="../base/write_t1.h">base/write_t1.h</a>,
-<a href="../base/write_t1.c">base/write_t1.c</a>,
-<a href="../base/write_t2.h">base/write_t2.h</a>,
-<a href="../base/write_t2.c">base/write_t2.c</a>,
-
-<dt>
-Miscellaneous support:
-<dd>
-<a href="../psi/ierrors.h">psi/ierrors.h</a>,
-<a href="../base/gserrors.h">base/gserrors.h</a>,
-<a href="../psi/ghost.h">psi/ghost.h</a>,
-<a href="../psi/iconf.c">psi/iconf.c</a>,
-<a href="../psi/iconf.h">psi/iconf.h</a>,
-<a href="../psi/idparam.c">psi/idparam.c</a>,
-<a href="../psi/idparam.h">psi/idparam.h</a>,
-<a href="../psi/ilevel.h">psi/ilevel.h</a>,
-<a href="../psi/inouparm.c">psi/inouparm.c</a>,
-<a href="../psi/iparam.c">psi/iparam.c</a>,
-<a href="../psi/iparam.h">psi/iparam.h</a>,
-<a href="../psi/iparray.h">psi/iparray.h</a>,
-<a href="../psi/iutil.c">psi/iutil.c</a>,
-<a href="../psi/iutil.h">psi/iutil.h</a>,
-<a href="../psi/iutil2.c">psi/iutil2.c</a>,
-<a href="../psi/iutil2.h">psi/iutil2.h</a>,
-<a href="../psi/iplugin.c">psi/iplugin.c</a>,
-<a href="../psi/iplugin.h">psi/iplugin.h</a>.
-
-</dl>
-
-<h4><a name="PostScript_code"></a>PostScript code</h4>
-
-<dl>
-
-<dt>
-Initialization and language support:
-<dd>
-
-<dl>
-
-<dt>
-All configurations:
-<dd>
-<a href="../Resource/Init/gs_init.ps">Resource/Init/gs_init.ps</a>,
-<a href="../Resource/Init/gs_statd.ps">Resource/Init/gs_statd.ps</a>.
-
-<dt>
-Level 2:
-<dd>
-<a href="../Resource/Init/gs_btokn.ps">Resource/Init/gs_btokn.ps</a>,
-<a href="../Resource/Init/gs_dps1.ps">Resource/Init/gs_dps1.ps</a>,
-<a href="../Resource/Init/gs_dps2.ps">Resource/Init/gs_dps2.ps</a>,
-<a href="../Resource/Init/gs_lev2.ps">Resource/Init/gs_lev2.ps</a>,
-<a href="../Resource/Init/gs_res.ps">Resource/Init/gs_res.ps</a>,
-<a href="../Resource/Init/gs_resmp.ps">Resource/Init/gs_resmp.ps</a>,
-<a href="../Resource/Init/gs_setpd.ps">Resource/Init/gs_setpd.ps</a>.
-
-<dt>
-LanguageLevel 3:
-<dd>
-<a href="../Resource/Init/gs_frsd.ps">Resource/Init/gs_frsd.ps</a>,
-<a href="../Resource/Init/gs_ll3.ps">Resource/Init/gs_ll3.ps</a>,
-<a href="../Resource/Init/gs_trap.ps">Resource/Init/gs_trap.ps</a>.
-
-<dt>
-Display PostScript:
-<dd>
-<a href="../Resource/Init/gs_dpnxt.ps">Resource/Init/gs_dpnxt.ps</a>,
-<a href="../Resource/Init/gs_dps.ps">Resource/Init/gs_dps.ps</a>.
-
-<dt>
-Emulation of other interpreters:
-<dd>
-<a href="../Resource/Init/gs_cet.ps">Resource/Init/gs_cet.ps</a> (Adobe CPSI).
-
-</dl>
-
-<dt>
-Color Spaces and support:
-<dd>
-
-<dl>
-
-<dt>
-Color Space Loading:
-<dd>
-<a href="../Resource/Init/gs_cspace.ps">Resource/Init/gs_cspace.ps</a>,
-
-<dt>
-ICC color profiles:
-<dd>
-<a href="../Resource/Init/gs_icc.ps">Resource/Init/gs_icc.ps</a>.
-
-</dl>
-
-<dt>
-Font loading and support:
-<dd>
-
-<dl>
-
-<dt>
-Font name mapping:
-<dd>
-<a href="../Resource/Init/Fontmap">Resource/Init/Fontmap</a>,
-<a href="../lib/Fontmap.ATB">lib/Fontmap.ATB</a>,
-<a href="../lib/Fontmap.ATM">lib/Fontmap.ATM</a>,
-<a href="../Resource/Init/Fontmap.GS">Resource/Init/Fontmap.GS</a>,
-<a href="../lib/Fontmap.OS2">lib/Fontmap.OS2</a>,
-<a href="../lib/Fontmap.OSF">lib/Fontmap.OSF</a>,
-<a href="../lib/Fontmap.SGI">lib/Fontmap.SGI</a>,
-<a href="../lib/Fontmap.Sol">lib/Fontmap.Sol</a>,
-<a href="../lib/Fontmap.Ult">lib/Fontmap.Ult</a>,
-<a href="../lib/Fontmap.VMS">lib/Fontmap.VMS</a>,
-<a href="../lib/Fontmap.URW-136.T1">lib/Fontmap.URW-136.T1</a>,
-<a href="../lib/Fontmap.URW-136.TT">lib/Fontmap.URW-136.TT</a>,
-<a href="../Resource/Init/cidfmap">Resource/Init/cidfmap</a>,
-<a href="../Resource/Init/FAPIcidfmap">Resource/Init/FAPIcidfmap</a>,
-<a href="../Resource/Init/FAPIfontmap">Resource/Init/FAPIfontmap</a>,
-<a href="../Resource/Init/FCOfontmap-PCLPS2">Resource/Init/FCOfontmap-PCLPS2</a>.
-
-<dt>
-Generic:
-<dd>
-<a href="../Resource/Init/gs_fonts.ps">Resource/Init/gs_fonts.ps</a>,
-<a href="../Resource/Init/gs_fntem.ps">Resource/Init/gs_fntem.ps</a>.
-
-<dt>
-Type 1 and CFF:
-<dd>
-<a href="../Resource/Init/gs_cff.ps">Resource/Init/gs_cff.ps</a>,
-<a href="../Resource/Init/gs_diskf.ps">Resource/Init/gs_diskf.ps</a>,
-<a href="../Resource/Init/gs_type1.ps">Resource/Init/gs_type1.ps</a>.
-
-<dt>
-TrueType:
-<dd>
-<a href="../Resource/Init/gs_ttf.ps">Resource/Init/gs_ttf.ps</a>,
-<a href="../Resource/Init/gs_typ42.ps">Resource/Init/gs_typ42.ps</a>.
-
-<dt>
-CID-keyed:
-<dd>
-<a href="../Resource/Init/gs_cidcm.ps">Resource/Init/gs_cidcm.ps</a>,
-<a href="../Resource/Init/gs_cidfn.ps">Resource/Init/gs_cidfn.ps</a>,
-<a href="../Resource/Init/gs_cmap.ps">Resource/Init/gs_cmap.ps</a>,
-<a href="../Resource/Init/gs_ciddc.ps">Resource/Init/gs_ciddc.ps</a>,
-<a href="../Resource/Init/gs_cidfm.ps">Resource/Init/gs_cidfm.ps</a>,
-<a href="../Resource/Init/gs_cidtt.ps">Resource/Init/gs_cidtt.ps</a>.
-
-<dt>
-Font API:
-<dd>
-<a href="../Resource/Init/gs_fapi.ps">Resource/Init/gs_fapi.ps</a>,
-<a href="../Resource/Init/FAPIconfig">Resource/Init/FAPIconfig</a>,
-<a href="../lib/FAPIconfig-FCO">lib/FAPIconfig-FCO</a>,
-<a href="../Resource/Init/xlatmap">Resource/Init/xlatmap</a>.
-<a href="../Resource/Init/FCOfontmap-PCLPS2">Resource/Init/FCOfontmap-PCLPS2</a>.
-<a href="../lib/FCOfontmap-PCLPS3">lib/FCOfontmap-PCLPS3</a>.
-<a href="../lib/FCOfontmap-PS3">lib/FCOfontmap-PS3</a>.
-
-<dt>
-Other:
-<dd>
-<a href="../lib/gs_kanji.ps">lib/gs_kanji.ps</a>,
-<a href="../lib/gs_pfile.ps">lib/gs_pfile.ps</a>,
-<a href="../Resource/Init/gs_typ32.ps">Resource/Init/gs_typ32.ps</a>.
-
-</dl>
-
-<dt>
-Encodings:
-<dd>
-
-<dl>
-
-<dt>
-Adobe-specified:
-<dd>
-<a href="../lib/gs_ce_e.ps">lib/gs_ce_e.ps</a>,
-<a href="../Resource/Init/gs_dbt_e.ps">Resource/Init/gs_dbt_e.ps</a>,
-<a href="../Resource/Init/gs_il1_e.ps">Resource/Init/gs_il1_e.ps</a>,
-<a href="../Resource/Init/gs_mex_e.ps">Resource/Init/gs_mex_e.ps</a>,
-<a href="../Resource/Init/gs_mro_e.ps">Resource/Init/gs_mro_e.ps</a>,
-<a href="../Resource/Init/gs_pdf_e.ps">Resource/Init/gs_pdf_e.ps</a>,
-<a href="../Resource/Init/gs_std_e.ps">Resource/Init/gs_std_e.ps</a>,
-<a href="../Resource/Init/gs_sym_e.ps">Resource/Init/gs_sym_e.ps</a>,
-<a href="../Resource/Init/gs_wan_e.ps">Resource/Init/gs_wan_e.ps</a>.
-
-<dt>
-Additional:
-<dd>
-<a href="../lib/gs_il2_e.ps">lib/gs_il2_e.ps</a>,
-<a href="../lib/gs_ksb_e.ps">lib/gs_ksb_e.ps</a>,
-<a href="../lib/gs_wl1_e.ps">lib/gs_wl1_e.ps</a>,
-<a href="../lib/gs_wl2_e.ps">lib/gs_wl2_e.ps</a>,
-<a href="../lib/gs_wl5_e.ps">lib/gs_wl5_e.ps</a>.
-
-<dt>
-Pseudo-encodings for internal use:
-<dd>
-<a href="../lib/gs_lgo_e.ps">lib/gs_lgo_e.ps</a>,
-<a href="../lib/gs_lgx_e.ps">lib/gs_lgx_e.ps</a>,
-<a href="../Resource/Init/gs_mgl_e.ps">Resource/Init/gs_mgl_e.ps</a>.
-
-</dl>
-
-<dt>
-Miscellaneous:
-<dd>
-
-<dl>
-
-<dt>
-Image support:
-<dd>
-<a href="../Resource/Init/gs_img.ps">Resource/Init/gs_img.ps</a>,
-
-<dt>
-Emulation of %disk IODevice:
-<dd>
-<a href="../Resource/Init/gs_diskn.ps">Resource/Init/gs_diskn.ps</a>,
-
-<dt>
-Other support:
-<dd>
-<a href="../Resource/Init/gs_agl.ps">Resource/Init/gs_agl.ps</a>,
-<a href="../Resource/Init/gs_dscp.ps">Resource/Init/gs_dscp.ps</a>,
-<a href="../Resource/Init/gs_epsf.ps">Resource/Init/gs_epsf.ps</a>,
-<a href="../Resource/Init/gs_pdfwr.ps">Resource/Init/gs_pdfwr.ps</a>,
-<a href="../lib/gs_rdlin.ps">lib/gs_rdlin.ps</a>.
-
-<dt>
-X Windows icon bitmaps:
-<dd>
-<a href="../lib/gs_l.xbm">lib/gs_l.xbm</a>,
-<a href="../lib/gs_l.xpm">lib/gs_l.xpm</a>,
-<a href="../lib/gs_l_m.xbm">lib/gs_l_m.xbm</a>,
-<a href="../lib/gs_m.xbm">lib/gs_m.xbm</a>,
-<a href="../lib/gs_m.xpm">lib/gs_m.xpm</a>,
-<a href="../lib/gs_m_m.xbm">lib/gs_m_m.xbm</a>,
-<a href="../lib/gs_s.xbm">lib/gs_s.xbm</a>,
-<a href="../lib/gs_s.xpm">lib/gs_s.xpm</a>,
-<a href="../lib/gs_s_m.xbm">lib/gs_s_m.xbm</a>,
-<a href="../lib/gs_t.xbm">lib/gs_t.xbm</a>,
-<a href="../lib/gs_t.xpm">lib/gs_t.xpm</a>,
-<a href="../lib/gs_t_m.xbm">lib/gs_t_m.xbm</a>.
-
-<dt>
-PDF/X-3 definition file sample :
-<dd>
-<a href="../lib/PDFX_def.ps">lib/PDFX_def.ps</a>,
-
-</dl>
-
-</dl>
-
-<h3><a name="PDF_interpreter"></a>PDF interpreter</h3>
-
-<p>
-Ghostscript's PDF interpreter is written entirely in PostScript, because its
-data structures are the same as PostScript's, and it is much more convenient
-to manipulate PostScript-like data structures in PostScript than in C.
-There is definitely a performance cost, but apparently not a substantial
-one: we considered moving the main interpreter loop (read a token using
-slightly different syntax than PostScript, push it on the stack if literal,
-look it up in a special dictionary for execution if not) into C, but we did
-some profiling and discovered that this wasn't accounting for enough of the
-time to be worthwhile.
-
-<p>
-Until recently, there was essentially no C code specifically for the purpose
-of supporting PDF interpretation. The one major exception is the PDF 1.4
-transparency features, which we (but not Adobe) have made available to
-PostScript code.
-
-<p>
-In addition to patching the <code>run</code> operator to detect PDF
-files, the interpreter provides some procedures in <a
-href="../Resource/Init/pdf_main.ps">Resource/Init/pdf_main.ps</a> that are meant to be called
-from applications such as previewers.
-
-<dl>
-
-<dt>
-Files:
-<dd>
-<a href="../Resource/Init/pdf_base.ps">Resource/Init/pdf_base.ps</a>,
-<a href="../Resource/Init/pdf_draw.ps">Resource/Init/pdf_draw.ps</a>,
-<a href="../Resource/Init/pdf_font.ps">Resource/Init/pdf_font.ps</a>,
-<a href="../Resource/Init/pdf_main.ps">Resource/Init/pdf_main.ps</a>,
-<a href="../Resource/Init/pdf_rbld.ps">Resource/Init/pdf_rbld.ps</a>,
-<a href="../Resource/Init/pdf_ops.ps">Resource/Init/pdf_ops.ps</a>,
-<a href="../Resource/Init/pdf_sec.ps">Resource/Init/pdf_sec.ps</a>.
-</dl>
-
-<h3><a name="PPD"></a>PostScript Printer Description</h3>
-<p>
-A PostScript Printer Description tells a generic PostScript printer
-driver how to generate PostScript for a particular printer.
-Ghostscript includes a PPD file for generating PostScript
-intended to be converted to PDF. A Windows INF file for
-installing the PPD on Windows 2000 and XP is included.
-
-<dl>
-
-<dt>
-Files:
-<dd>
-<a href="../lib/ghostpdf.ppd">lib/ghostpdf.ppd</a>,
-<a href="../lib/ghostpdf.inf">lib/ghostpdf.inf</a>,
-<a href="../lib/ghostpdf.cat">lib/ghostpdf.cat</a>,
-<a href="../lib/ghostpdf.README">lib/ghostpdf.README</a>.
-
-</dl>
-
-<h3><a name="Build_process"></a>Build process</h3>
-
-<h4><a name="Makefile_structure"></a>Makefile structure</h4>
-
-<p>
-Ghostscript's makefiles embody a number of design decisions and assumptions
-that may not be obvious from a casual reading of the code.
-
-<ul>
-
-<li>All files are stored in subdirectories. The names of all subdirectories
-used in the build process are defined in the top-level makefiles for the
-various platforms: there are no "hard wired" directory names in any makefile
-rule. Subdirectory names in the makefiles are relative to the directory
-that is current at build time: normally this directory is the parent of the
-various subdirectories, and holds only a <code>makefile</code>, which in
-turn simply references the real top-level makefile in the source
-subdirectory.
-
-<li>All compiler and linker switches are likewise defined by macros, again
-preferably in the top-level platform makefile.
-
-<li>There is an absolute distinction between "source-like" subdirectories,
-which are read-only during the build process, and "object-like"
-subdirectories, all of whose contents are generated by the build process and
-which can be emptied (<code>rm&nbsp;*</code>) at any time with no bad
-effects. The source subdirectories are defined by macros named
-<code>xxxSRCDIR</code>.
-
-<li>Object subdirectories may distinguish further between those that hold
-the results of the build process that are needed at run time (i.e., that
-should be included in a run-time distribution), defined by
-<code>BINDIR</code>, and those that are not needed at run time, defined
-by <code>xxxGENDIR</code> and <code>xxxOBJDIR</code>. (The
-distinction between these is historical and probably no longer relevant.)
-
-<li>There may be multiple object subdirectories for different build
-configurations. On Unix, the <code>obj</code> and <code>bin</code>
-directories are used for normal production builds, the
-<code>debugobj</code> directory for debugging builds, and the
-<code>pgobj</code> directory for profiling builds; other platforms may
-use different conventions. The Unix makefiles support targets named
-<code>debug</code> and <code>pg</code> for debugging and profiling
-builds respectively; other platforms generally do not.
-
-<li>Makefiles will be maintained by hand. This requires editing the
-following makefile elements whenever the relevant source files changes:
-
-<ul>
-
-<li>Every header (.h) file must have a corresponding macro definition in a
-makefile. If <code>abc.h</code> #includes <code>def.h</code> and
-<code>xyz.h</code>, the definition must have the form
-
-<blockquote><pre>
-xyz_h=&#36;(xxxSRCD)xyz.h &#36;(def_h) &#36;(xyz_h)
-</pre></blockquote>
-
-where <code>xxxSRCD</code> is the macro defining the relevant source
-directory (including a trailing '/'). Note that the '.' in the file name
-has been replaced by an underscore. Note also that the definition must
-follow all definitions it references, since some <code>make</code>
-programs expand macros in definitions at the time of definition rather than
-at the time of use.
-
-<li>Every .c file must have a corresponding rule in a makefile. If
-<code>abc.c</code> #includes <code>def.h</code> and
-<code>lmn.h</code>, the rule must have approximately the form
-
-<blockquote><pre>
-&#36;(xxxOBJD)abc.&#36;(OBJ) : &#36;(xxxSRCD)abc.c &#36;(def_h) &#36;(lmn_h)
- &#36;(xxCC) &#36;(xxO_)abc.&#36;(OBJ) &#36;(C_) &#36;(xxxSRCD)abc.c
-</pre></blockquote>
-
-where <code>xxxSRCD</code> is as before; <code>xxxOBJD</code> is the
-relevant object directory; <code>xxCC</code> defines the name of the C
-compiler plus the relevant compilation switches; and <code>xxO_</code>
-and <code>C_</code> are macros used to bridge syntactic differences
-between different <code>make</code> programs.
-
-</ul>
-
-</ul>
-
-<p>
-The requirement to keep makefiles up to date by hand has been controversial.
-Two alternatives are generally proposed.
-
-<ul>
-
-<li>Programs like <code>makedeps</code>, which generate build rules
-automatically from the #include lists in C files. We have found such
-programs useless: they "wire in" specific, concrete directory names, not
-only for our own code but even for the system header files; they have to be
-run manually whenever code files are added, renamed, or deleted, or whenever
-the list of #includes in any file changes; and they cannot deal with
-different source files requiring different compilation switches.
-
-<li>MSVC-style "project" files. These are equally useless: they are not
-portable across different vendors' tools -- in fact, there may not even be a
-usable import/export facility to convert their data to or from text form --
-and they cannot combine configuration-independent data with
-configuration-specific data.
-
-</ul>
-
-<p>
-We have seriously considered writing our own build program in Tcl or Python
-that would eliminate these problems, or perhaps porting the tools developed
-by Digital's Vesta research project (if we can get access to them); however,
-either of these approaches would create potential portability problems of
-its own, not to mention difficulties in integrating with others' build
-systems.
-
-<p>
-For more information about makefiles:
-
-<ul>
-
-<li>For a detailed list of makefiles, and a discussion of makefile issues
-related to portability, see the <a href="#Makefiles">Makefiles</a> section
-below.
-
-<li>For more detailed information about editing configuration information in
-makefiles, see <a
-href="Make.htm#Makefile_overview">doc/Make.htm#Makefile_overview</a>.
-
-<li>For a complete example of adding a new driver to a makefile, see <a
-href="Drivers.htm#Adding_drivers">doc/Drivers.htm#Adding_drivers</a>.
-
-<li>For a few more notes on makefile coding conventions, see <a
-href="C-style.htm#Makefiles">doc/C-style.htm#Makefiles</a>.
-
-</ul>
-
-<h4><a name="dev_files"></a>.dev files</h4>
-
-<p>
-On top of the general conventions just described, Ghostscript's makefiles
-add a further layer of structure in order to support an open-ended set of
-fine-grained, flexible configuration options. Selecting an option (usually
-called a "module") for inclusion in the build may affect the build in many
-ways:
-
-<ul>
-
-<li>Almost always, it requires linking in some compiled code files.
-
-<li>It may require running some additional initialization procedures at
-startup.
-
-<li>It may require reading in some additional PostScript files at startup.
-For example, a Level 2 PostScript build requires support for PostScript
-resources and for setpagedevice, which are implemented in PostScript code.
-
-<li>It may require adding entries to a variety of internal tables that
-catalogue such things as drivers, IODevices, Function types, etc.
-
-<li>It may require that other particular modules be included. For example,
-the "PostScript Level 2" module requires the modules for various filters,
-color spaces, etc.
-
-<li>It may require <em>removing</em> some other (default) module from the
-build. For example, the core (Level 1) PostScript build has a "stub" for
-binary tokens, which are a Level 2 feature but are referenced by the core
-scanner: a Level 2 build must remove the stub. For more information about
-this, look for the string <code>-replace</code> in the makefiles and in
-<a href="../base/genconf.c">base/genconf.c</a>.
-
-</ul>
-
-<p>
-Each module is defined in the makefiles by rules that create a file named
-<code><em>xxx</em>.dev</code>. The dependencies of the rule include all
-the files that make up the module (compiled code files, PostScript files,
-etc.); the body of the rule creates the .dev file by writing the description
-of the module into it. A program called <code>genconf</code>, described
-in the next section, merges all the relevant .dev files together. For
-examples of .dev rules, see any of the Ghostscript makefiles.
-
-<p>
-Ultimately, a person must specify the root set of modules to include in a
-build (which of course may require other modules, recursively).
-Ghostscript's makefiles do this with a set of macros called
-<code>FEATURE_DEVS</code> and <code>DEVICE_DEVS</code><em>n</em>,
-defined in each top-level makefile, but nothing in the module machinery
-depends on this.
-
-<h4><a name="Generators"></a>Generators</h4>
-
-<p>
-Ghostscript's build procedure is somewhat unusual in that it compiles and
-then executes some support programs during the build process. These
-programs then generate data or source code that is used later on in the
-build.
-
-<p>
-The most important and complex of the generator programs is
-<code>genconf</code>. <code>genconf</code> merges all the .dev files
-that make up the build, and creates three or more output files used in later
-stages:
-
-<ul>
-
-<li><code>gconfig.h</code>, consisting mainly of macro calls, one call
-per "resource" making up the build, other than "resources" listed in the
-other output files.
-
-<li><code>gconfigf.h</code>, produced only for PostScript builds with
-compiled-in fonts, consisting of one macro call per font.
-
-<li>A linker control file whose name varies from one platform to another,
-containing the list of compiled code files to be linked.
-
-<li>If necessary, another linker control file, also varying between
-platforms, that contains other information for the linker such as the list
-of system libraries to be searched. (On Unix platforms, the two linker
-control functions are combined in a single file.)
-
-</ul>
-
-<dl>
-
-<dt>
-Source generators:
-<dd>
-
-<dl>
-
-<dt>
-<a href="../base/genarch.c">base/genarch.c</a>
-<dd>
-Creates a header file containing a variety of information about the hardware
-and compiler that isn't provided in any standard system header file. Always
-used.
-
-<dt>
-<a href="../base/genconf.c">base/genconf.c</a> (also generates non-source)
-<dd>
-Constructs header files and linker control files from the collection of
-options and modules that make up the build. See above. Always used.
-
-<dt>
-<a href="../base/genht.c">base/genht.c</a>
-<dd>
-Converts a PostScript halftone (in a particular constrained format) to a C
-data structure that can be compiled into an executable. Only used if any
-such halftones are included in the build.
-
-<dt>
-<a href="../base/mkromfs.c">base/mkromfs.c</a>
-<dd>
-Takes a set of directories, and creates a compressed filesystem
-image that can be compiled into the executable as static data and accessed
-through the %rom% iodevice prefix. This is used to implement the
-<code>COMPILE_INITS=1</code> feature (a compressed init fileset is more
-efficient than the current 'gsinit.c' produced by 'geninit.c'). This IODevice
-is more versatile since other files can be encapsulated such as fonts, helper
-PostScript files and Resources. The list of files is defined in part in
-<a href="../psi/psromfs.mak">psi/psromfs.mak</a>.
-
-</dl>
-
-<dt>
-Other generators:
-<dd>
-
-<dl>
-
-<dt>
-<a href="../base/echogs.c">base/echogs.c</a>
-<dd>
-Implements a variety of shell-like functions to get around quirks,
-limitations, and omissions in the shells on various platforms. Always used.
-
-<dt>
-<a href="../base/genconf.c">base/genconf.c</a> (also generates source)
-<dd>
-See above.
-
-<dt>
-<a href="../base/gendev.c">base/gendev.c</a> (not used)
-<dd>
-Was intended as a replacement for <code>genconf</code>, but was never
-completed.
-
-</dl>
-
-</dl>
-
-<h4><a name="Build_support"></a>Support</h4>
-
-<p>
-There are a number of programs, scripts, and configuration files that exist
-only for the sake of the build process.
-
-<dl>
-
-<dt>
-Files for PC environments:
-<dd>
-<a href="../base/gswin.icx">base/gswin.icx</a>,
-<a href="../base/gswin16.icx">base/gswin16.icx</a>,
-<a href="../base/bcc32.cfg">base/bcc32.cfg</a>,
-<a href="../base/cp.bat">base/cp.bat</a>,
-<a href="../base/cp.cmd">base/cp.cmd</a>,
-<a href="../psi/dw32c.def">psi/dw32c.def</a>,
-<a href="../psi/dwmain.rc">psi/dwmain.rc</a>,
-<a href="../psi/dwmain32.def">psi/dwmain32.def</a>,
-<a href="../psi/dwsetup.def">psi/dwsetup.def</a>,
-<a href="../psi/dwsetup_x86.manifest">psi/dwsetup_x86.manifest</a>,
-<a href="../psi/dwsetup_x64.manifest">psi/dwsetup_x64.manifest</a>,
-<a href="../psi/dwuninst.def">psi/dwuninst.def</a>,
-<a href="../psi/dwuninst_x86.manifest">psi/dwuninst_x86.manifest</a>,
-<a href="../psi/dwuninst_x64.manifest">psi/dwuninst_x64.manifest</a>,
-<a href="../psi/gsdll2.def">psi/gsdll2.def</a>,
-<a href="../psi/gsdll2.rc">psi/gsdll2.rc</a>,
-<a href="../psi/gsdll32.def">psi/gsdll32.def</a>,
-<a href="../psi/gsdll32.rc">psi/gsdll32.rc</a>,
-<a href="../psi/gsdll32w.lnk">psi/gsdll32w.lnk</a>,
-<a href="../psi/gsos2.def">psi/gsos2.def</a>,
-<a href="../psi/gsos2.icx">psi/gsos2.icx</a>,
-<a href="../psi/gsos2.rc">psi/gsos2.rc</a>,
-<a href="../base/gspmdrv.def">base/gspmdrv.def</a>,
-<a href="../base/gspmdrv.icx">base/gspmdrv.icx</a>,
-<a href="../base/gspmdrv.rc">base/gspmdrv.rc</a>,
-<a href="../base/gswin.rc">base/gswin.rc</a>,
-<a href="../base/gswin32.rc">base/gswin32.rc</a>,
-<a href="../base/mv.bat">base/mv.bat</a>,
-<a href="../base/mv.cmd">base/mv.cmd</a>,
-<a href="../base/rm.bat">base/rm.bat</a>,
-<a href="../base/rm.cmd">base/rm.cmd</a>,
-
-<dt>
-Files for MacOS:
-<dd>
-<a href="../lib/Info-macos.plist">lib/Info-macos.plist</a>.
-
-<dt>
-Files for OpenVMS:
-<dd>
-<a href="../base/append_l.com">base/append_l.com</a>,
-<a href="../base/copy_one.com">base/copy_one.com</a>,
-<a href="../base/rm_all.com">base/rm_all.com</a>,
-<a href="../base/rm_one.com">base/rm_one.com</a>.
-
-<dt>
-Other files:
-<dd>
-<a href="../base/bench.c">base/bench.c</a>,
-<a href="../base/catmake">base/catmake</a>,
-<a href="../base/instcopy">base/instcopy</a>.
-
-</dl>
-
-<h3><a name="Utilities"></a>Utilities</h3>
-
-<p>
-Ghostscript comes with many utilities for doing things like viewing bitmap
-files and converting between file formats. Some of these are written in
-PostScript, some as scripts, and some as scripts that invoke special
-PostScript code.
-
-<h4><a name="Utilities_in_PostScript"></a>Utilities in PostScript</h4>
-
-<p>
-These are all documented in <a href="Psfiles.htm">doc/Psfiles.htm</a>, q.v.
-
-<h4><a name="Utility_scripts"></a>Utility scripts</h4>
-
-<p>
-Many of these scripts come in both Unix and MS-DOS (<code>.bat</code>
-versions; some also have an OS/2 (<code>.cmd</code>) version. The choice
-of which versions are provided is historical and irregular. These scripts
-should all be documented somewhere, but currently, many of them have man
-pages, a few have their own documentation in the doc directory, and some
-aren't documented at all.
-
-<dl>
-
-<dt>
-Script files without PC versions:
-<dd>
-<a href="../lib/afmdiff.awk">lib/afmdiff.awk</a>,
-<a href="../lib/dvipdf">lib/dvipdf</a>,
-<a href="../lib/lprsetup.sh">lib/lprsetup.sh</a>,
-<a href="../lib/pphs">lib/pphs</a>,
-<a href="../lib/printafm">lib/printafm</a>,
-<a href="../lib/unix-lpr.sh">lib/unix-lpr.sh</a>,
-<a href="../lib/wftopfa">lib/wftopfa</a>.
-
-<dt>
-Script files with PC versions:
-<dd>
-<a href="../lib/eps2eps">lib/eps2eps</a>,
-<a href="../lib/eps2eps.bat">lib/eps2eps.bat</a>,
-<a href="../lib/eps2eps.cmd">lib/eps2eps.cmd</a>,
-<a href="../lib/ps2ps2">lib/ps2ps2</a>,
-<a href="../lib/ps2ps2.bat">lib/ps2ps2.bat</a>,
-<a href="../lib/ps2ps2.cmd">lib/ps2ps2.cmd</a>,
-<a href="../lib/font2c">lib/font2c</a>,
-<a href="../lib/font2c.bat">lib/font2c.bat</a>,
-<a href="../lib/font2c.cmd">lib/font2c.cmd</a>,
-<a href="../lib/gsbj">lib/gsbj</a>,
-<a href="../lib/gsbj.bat">lib/gsbj.bat</a>,
-<a href="../lib/gsdj">lib/gsdj</a>,
-<a href="../lib/gsdj.bat">lib/gsdj.bat</a>,
-<a href="../lib/gsdj500">lib/gsdj500</a>,
-<a href="../lib/gsdj500.bat">lib/gsdj500.bat</a>,
-<a href="../lib/gslj">lib/gslj</a>,
-<a href="../lib/gslj.bat">lib/gslj.bat</a>,
-<a href="../lib/gslp">lib/gslp</a>,
-<a href="../lib/gslp.bat">lib/gslp.bat</a>,
-<a href="../lib/gsnd">lib/gsnd</a>,
-<a href="../lib/gsnd.bat">lib/gsnd.bat</a>,
-<a href="../lib/pdf2dsc">lib/pdf2dsc</a>,
-<a href="../lib/pdf2dsc.bat">lib/pdf2dsc.bat</a>,
-<a href="../lib/pdf2ps">lib/pdf2ps</a>,
-<a href="../lib/pdf2ps.bat">lib/pdf2ps.bat</a>,
-<a href="../lib/pdf2ps.cmd">lib/pdf2ps.cmd</a>,
-<a href="../lib/pf2afm">lib/pf2afm</a>,
-<a href="../lib/pf2afm.bat">lib/pf2afm.bat</a>,
-<a href="../lib/pf2afm.cmd">lib/pf2afm.cmd</a>,
-<a href="../lib/pfbtopfa">lib/pfbtopfa</a>,
-<a href="../lib/pfbtopfa.bat">lib/pfbtopfa.bat</a>,
-<a href="../lib/ps2ascii">lib/ps2ascii</a>,
-<a href="../lib/ps2ascii.bat">lib/ps2ascii.bat</a>,
-<a href="../lib/ps2ascii.cmd">lib/ps2ascii.cmd</a>,
-<a href="../lib/ps2epsi">lib/ps2epsi</a>,
-<a href="../lib/ps2epsi.bat">lib/ps2epsi.bat</a>,
-<a href="../lib/ps2epsi.cmd">lib/ps2epsi.cmd</a>,
-<a href="../lib/ps2pdf">lib/ps2pdf</a>,
-<a href="../lib/ps2pdf.bat">lib/ps2pdf.bat</a>,
-<a href="../lib/ps2pdf.cmd">lib/ps2pdf.cmd</a>,
-<a href="../lib/ps2pdf12">lib/ps2pdf12</a>,
-<a href="../lib/ps2pdf12.bat">lib/ps2pdf12.bat</a>,
-<a href="../lib/ps2pdf12.cmd">lib/ps2pdf12.cmd</a>,
-<a href="../lib/ps2pdf13">lib/ps2pdf13</a>,
-<a href="../lib/ps2pdf13.bat">lib/ps2pdf13.bat</a>,
-<a href="../lib/ps2pdf13.cmd">lib/ps2pdf13.cmd</a>,
-<a href="../lib/ps2pdf14">lib/ps2pdf14</a>,
-<a href="../lib/ps2pdf14.bat">lib/ps2pdf14.bat</a>,
-<a href="../lib/ps2pdf14.cmd">lib/ps2pdf14.cmd</a>,
-<a href="../lib/ps2pdfwr">lib/ps2pdfwr</a>,
-<a href="../lib/ps2pdfxx.bat">lib/ps2pdfxx.bat</a>,
-<a href="../lib/ps2ps">lib/ps2ps</a>,
-<a href="../lib/ps2ps.bat">lib/ps2ps.bat</a>,
-<a href="../lib/ps2ps.cmd">lib/ps2ps.cmd</a>.
-
-<dt>
-Script files with only PC versions:
-<dd>
-<a href="../lib/gsndt.bat">lib/gsndt.bat</a>,
-<a href="../lib/gssetgs.bat">lib/gssetgs.bat</a>,
-<a href="../lib/gssetgs32.bat">lib/gssetgs32.bat</a>,
-<a href="../lib/gssetgs64.bat">lib/gssetgs64.bat</a>,
-<a href="../lib/gst.bat">lib/gst.bat</a>,
-<a href="../lib/gstt.bat">lib/gstt.bat</a>,
-<a href="../lib/lp386.bat">lib/lp386.bat</a>,
-<a href="../lib/lp386r2.bat">lib/lp386r2.bat</a>,
-<a href="../lib/lpgs.bat">lib/lpgs.bat</a>,
-<a href="../lib/lpr2.bat">lib/lpr2.bat</a>,
-<a href="../lib/pftogsf.bat">lib/pftogsf.bat</a>,
-<a href="../lib/wmakebat.bat">lib/wmakebat.bat</a>.
-
-</dl>
-
-<hr>
-
-<h2><a name="Memory_management"></a>Memory management</h2>
-
-<h3><a name="Memory_manager_architecture"></a>Memory manager architecture</h3>
-
-<p>
-In many environments, the memory manager is a set of library facilities that
-implicitly manage the entire address space in a homogenous manner.
-Ghostscript's memory manager architecture has none of these properties:
-
-<ul>
-
-<li>Rather than a single library accessed as procedures, Ghostscript
-includes multiple allocator types, each of which in turn may have multiple
-instances (allocators). Allocators are 'objects' with a substantial set of
-virtual functions.
-
-<li>Rather than managing the entire address space, each allocator manages a
-storage pool, which it may or may not be able to expand or reduce by calling
-on a 'parent' allocator.
-
-<li>Rather than a single genus of untyped storage blocks, Ghostscript's
-allocators provide two genera -- type-tagged 'objects', and 'strings' --
-with substantially different properties.
-
-</ul>
-
-<h4><a name="Objects_vs_strings"></a>Objects vs strings</h4>
-
-<p>
-As noted above, allocators provide two different storage genera.
-
-<p>
-Objects:
-
-<ul>
-<li>Are aligned in storage to satisfy the most stringent alignment
-requirement imposed by the CPU or compiler;
-<li>Can be referenced only by pointers to their start, not to any internal
-location, unless special arrangements are made;
-<li>May contain pointers to other objects, or to strings;
-<li>Have an associated <em>structure descriptor</em> that specifies their
-size (usually) and the location of any pointers contained within them.
-</ul>
-
-<p>
-Given a pointer to an object, the allocator that allocated it must be able
-to return the object's size and the pointer to its structure descriptor.
-(It is up to the client to know what allocator allocated an object.)
-
-<p>
-Strings:
-
-<ul>
-<li>Are not aligned in storage;
-<li>Can be referenced by pointers (consisting of a starting address and a
-length) to any substring, starting anywhere within the string;
-<li>May not contain pointers;
-<li>Do not have a structure descriptor.
-</ul>
-
-<p>
-The object/string distinction reflects a space/capability tradeoff. The
-per-object space overhead of the standard type of allocator is typically 12
-bytes; this is too much to impose on every string of a few bytes. On the
-other hand, restricting object pointers to reference the start of the object
-currently makes object garbage collection and compaction more
-space-efficient. If we were to redesign the standard allocator, we would
-probably opt for a different design in which strings were allocated within
-container objects of a few hundred bytes, and pointers into the middle of
-all objects were allowed.
-
-<h4><a name="Structure_descriptors"></a>Structure descriptors</h4>
-
-<p>
-Every object allocated by a Ghostscript allocator has an associated
-structure descriptor, which the caller provides when allocating the object.
-The structure descriptor serves several purposes:
-
-<ul>
-<li>Specifying the size of the object for allocation;
-<li>Providing pointer-enumeration and pointer-relocation procedures for
-the garbage collector;
-<li>Providing an optional finalization procedure to be called when the
-object is freed (either explicitly or automatically).
-</ul>
-
-<p>
-Structure descriptors are read-only, and are normally defined statically
-using one of the large set of <code>gs_private_st_</code> or
-<code>gs_public_st_</code> macros in <a
-href="../base/gsstruct.h">base/gsstruct.h</a>.
-
-<p>
-While the structure descriptor normally specifies the size of the object,
-one can also allocate an array of bytes or objects, whose size is a multiple
-of the size in the descriptor. For this reason, every object stores its
-size as well as a reference to its descriptor.
-
-<p>
-Because the standard Ghostscript garbage collector is non-conservative and
-can move objects, every object allocated by a Ghostscript allocator must
-have an accurate structure descriptor. If you define a new type of object
-(structure) that will be allocated in storage managed by Ghostscript, you
-<em>must</em> create an accurate descriptor for it, and use that descriptor
-to allocate it. The process of creating accurate descriptors for all
-structures was long and painful, and accounted for many hard-to-diagnose
-bugs.
-
-<p>
-By convention, the structure descriptor for structure type
-<code>xxx_t</code> is named <code>st_xxx</code> (this is preferred),
-or occasionally <code>st_xxx_t</code>.
-
-<p>
-Note that a structure descriptor is only required for objects allocated by
-the Ghostscript allocator. A structure type <code>xxx_t</code> does not
-require a structure descriptor if instances of that type are used
-<em>only</em> in the following ways:
-
-<ul>
-
-<li>Instances are allocated only on the C stack, e.g., as
-<code>xxx_t&nbsp;xxx1,&nbsp;xxx2;</code>, or on the C heap, with
-<code>malloc</code> or through the Ghostscript "wrapper" defined in <a
-href="../base/gsmalloc.h">base/gsmalloc.h</a>.
-
-<li>Pointers to instances are not stored in places where the garbage
-collector will try to trace the pointer.
-
-<li>Code never attempts to get the structure type or size of an instance
-through the allocator API.
-
-</ul>
-
-<p>
-In general, structures without descriptors are problem-prone, and are
-deprecated; in new code, they should only be used if the structure is
-confined to a single .c file and its instances are only allocated on the C
-stack.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/gsstruct.h">base/gsstruct.h</a>,
-<a href="../base/gsstype.h">base/gsstype.h</a>.
-</dl>
-
-<h4><a name="Garbage_collection"></a>Garbage collection</h4>
-
-<p>
-The allocator architecture is designed to support compacting garbage
-collection. Every object must be able to enumerate all the pointers it
-contains, both for tracing and for relocation. As noted just above, the
-structure descriptor provides procedures that do this.
-
-<p>
-Whether or not a particular allocator type actually provides a garbage
-collector is up to the allocator: garbage collection is invoked through a
-virtual procedure. In practice, however, there are only two useful garbage
-collectors for Ghostscript's own allocator:
-
-<ul>
-<li>The "real" garbage collector associated with the PostScript interpreter,
-described <a href="#Interpreter_GC">below</a>;
-<li>A "non" garbage collector that only merges adjacent free blocks.
-</ul>
-
-<p>
-As noted above, because the architecture supports compacting garbage
-collection, a "real" garbage collector cannot be run at arbitrary times,
-because it cannot reliably find and relocate pointers that are on the C
-stack. In general, it is only safe to run a "real" garbage collector when
-control is at the top level of the program, when there are no pointers to
-garbage collectable objects from the stack (other than designated roots).
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/gsgc.h">base/gsgc.h</a>,
-<a href="../base/gsnogc.c">base/gsnogc.c</a>,
-<a href="../base/gsnogc.h">base/gsnogc.h</a>.
-</dl>
-
-<h4><a name="Movability"></a>Movability</h4>
-
-<p>
-As just noted, objects are normally movable by the garbage collector.
-However, some objects must be immovable, usually because some other piece of
-software must retain pointers to them. The allocator API includes
-procedures for allocating both movable (default) and immovable objects.
-Note, however, that even immovable objects must be traceable (have a
-structure descriptor), and may be freed, by the garbage collector.
-
-<h4><a name="Parent_hierarchy"></a>Parent hierarchy</h4>
-
-<p>
-When an allocator needs to add memory to the pool that it manages, it
-requests the memory from its <em>parent</em> allocator. Every allocator has
-a pointer to its parent; multiple allocators may share a single parent. The
-ultimate ancestor of all allocators that can expand their pool dynamically
-is an allocator that calls <code>malloc</code>, described <a
-href="#malloc">below</a>. However, especially in embedded environments, an
-allocator may be limited to a fixed-size pool assigned to it when it is
-created.
-
-<h4><a name="Allocator_API"></a>Allocator API</h4>
-
-In summary, the allocator API provides the following principal operations:
-
-<ul>
-<li>Allocate and free movable (default) or immovable objects and strings.
-<li>Return the structure type and size of an object.
-<li>Resize (shrink or grow) movable objects and strings, preserving
-the contents insofar as possible.
-<li>Report the size of the managed pool, and how much of it is in use.
-<li>Register and unregister root pointers for the garbage collector.
-<li>Free the allocator itself.
-<li>Consolidate adjacent free blocks to reduce fragmentation.
-</ul>
-
-<p>
-For details, see <a href="../base/gsmemory.h">base/gsmemory.h</a>.
-
-<p>
-The allocator API also includes one special hook for the PostScript
-interpreter: the concept of stable allocators. See the section on <a
-href="#save_forgetsave_restore"><code>save</code> and
-<code>restore</code></a> below for details.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/gsmemraw.h">base/gsmemraw.h</a>,
-<a href="../base/gsmemory.c">base/gsmemory.c</a>,
-<a href="../base/gsmemory.h">base/gsmemory.h</a>,
-<a href="../base/gsstruct.h">base/gsstruct.h</a>,
-<a href="../base/gsstype.h">base/gsstype.h</a>.
-</dl>
-
-<h3><a name="Freeing_storage"></a>Freeing storage</h3>
-
-<p>
-Ghostscript's memory management architecture provides three different ways
-to free objects: explicitly, by reference counting, or by garbage
-collection. They provide different safety / performance / convenience
-tradeoffs; we believe that all three are necessary.
-
-<p>
-Objects are always freed as a whole; strings may be freed piecemeal.
-
-<p>
-An object may have an associated finalization procedure, defined in the
-structure descriptor. This procedure is called just before the object is
-freed, independent of which method is being used to free the object. A few
-types of objects have a virtual finalization procedure as well: the
-finalization procedure defined in the descriptor simply calls the one in the
-object.
-
-<h4><a name="Explicit_freeing"></a>Explicit freeing</h4>
-
-<p>
-Objects and strings may be freed explicitly, using the
-<code>gs_free_</code> virtual procedures in the allocator API. It is up
-to the client to ensure that all allocated objects are freed at most once,
-and that there are no dangling pointers.
-
-<p>
-Explicit freeing is the fastest method, but is the least convenient and
-least safe. It is most appropriate when storage is freed in the same
-procedure where it is allocated, or for storage that is known to be
-referenced by only one pointer.
-
-<h4><a name="Reference_counting"></a>Reference counting</h4>
-
-<p>
-Objects may be managed by reference counting. When an object is allocated,
-its reference count may be set to 0 or 1. Subsequently, when the reference
-count is decremented to 0, the object is freed.
-
-<p>
-The reference counting machinery provides its own virtual finalization
-procedure for all reference-counted objects. The machinery calls this
-procedure when it is about to free the object (but not when the object is
-freed in any other way, which is probably a design bug). This is in
-addition to (and called before) any finalization procedure associated with
-the object type.
-
-<p>
-Reference counting is as fast as explicit freeing, but takes more space in
-the object. It is most appropriate for relatively large objects which are
-referenced only from a small set of pointers. Note that reference counting
-cannot free objects that are involved in a pointer cycle (e.g., A -&gt; B -&gt; C
--&gt; A).
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/gsrefct.h">base/gsrefct.h</a>.
-</dl>
-
-<h4><a name="Real_garbage_collection"></a>(Real) garbage collection</h4>
-
-<p>
-Objects and strings may be freed automatically by a garbage collector. See
-<a href="#Interpreter_GC">below</a>.
-
-<h3><a name="Special_implementations"></a>Special implementations</h3>
-
-<h4><a name="malloc"></a>malloc</h4>
-
-<p>
-As mentioned <a href="#Parent_hierarchy">above</a>, the ultimate ancestor of
-all allocators with an expandable pool is one that calls
-<code>malloc</code>.
-
-<p>Note that the default gsmalloc.c allocator for malloc/free now uses
-a mutex so that allocators that use this can be assured of thread safe
-behavior.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/gsmalloc.h">base/gsmalloc.h</a>,
-<a href="../base/gsmalloc.c">base/gsmalloc.c</a>.
-</dl>
-
-<h4><a name="Locking"></a>Locking</h4>
-
-<p>
-In a multi-threaded environment, if an allocator must be callable from
-multiple threads (for example, if it is used to allocate structures in one
-thread that are passed to, and freed by, another thread), the allocator must
-provide mutex protection. Ghostscript provides this capability in the form
-of a <em>wrapper</em> allocator, that simply forwards all calls to a
-<em>target</em> allocator under protection of a mutex. Using the wrapper
-technique, any allocator can be made thread-safe.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/gsmemlok.h">base/gsmemlok.h</a>,
-<a href="../base/gsmemlok.c">base/gsmemlok.c</a>.
-</dl>
-
-<h4><a name="Retrying"></a>Retrying</h4>
-
-<p>
-In an embedded environment, job failure due to memory exhaustion is very
-undesirable. Ghostscript provides a wrapper allocator that, when an
-allocation attempt fails, calls a client-provided procedure that can attempt
-to free memory, then ask for the original allocation to be retried. For
-example, such a procedure can wait for a queue to empty, or can free memory
-occupied by caches.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/gsmemret.h">base/gsmemret.h</a>,
-<a href="../base/gsmemret.c">base/gsmemret.c</a>.
-</dl>
-
-<h4><a name="Chunk"></a>Chunk</h4>
-
-<p>When multiple threads are used and there may be frequent memory allocator
-requests, mutex contention is a problem and can cause severe performance
-degradation. The chunk memory wrapper can provide each thread with its own
-instance of an allocator that only makes requests on the underlying (non-GC)
-alloctor when large blocks are needed. Small object allocations are managed
-within chunks.
-
-<p>This allocator is intended to be used on top of the basic 'gsmalloc'
-allocator (malloc/free) which is NOT garbage collected or relocated and
-which MUST be mutex protected.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/gsmchunk.h">base/gsmchunk.h</a>,
-<a href="../base/gsmchunk.c">base/gsmchunk.c</a>.
-</dl>
-
-<h3><a name="Standard_implementation"></a>Standard implementation</h3>
-
-<p>
-The standard Ghostscript allocator gets storage from its parent (normally
-the <code>malloc</code> allocator) in large blocks called
-<em>clumps</em>, and then allocates objects up from the low end and strings
-down from the high end. Large objects or strings are allocated in their own
-clump.
-
-<p>
-The standard allocator maintains a set of free-block lists for small object
-sizes, one list per size (rounded up to the word size), plus a free-block
-list for large objects (but not for objects so large that they get their own
-clump: when such an object is freed, its chunk is returned to the parent).
-The lists are not sorted; adjacent blocks are only merged if needed.
-
-<p>
-While the standard allocator implements the generic allocator API, and is
-usable with the library alone, it includes a special hook for the PostScript
-interpreter to aid in the efficient allocation of PostScript composite
-objects (arrays and dictionaries). See the section on <a
-href="#Refs">Refs</a> below for details.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/gsalloc.c">base/gsalloc.c</a>,
-<a href="../base/gsalloc.h">base/gsalloc.h</a>,
-<a href="../base/gxalloc.h">base/gxalloc.h</a>,
-<a href="../base/gxobj.h">base/gxobj.h</a>.
-</dl>
-
-<h3><a name="PostScript_interpreter_extensions"></a>PostScript interpreter extensions</h3>
-
-<p>
-The PostScript interpreter uses an allocator that extends the graphic
-library's standard allocator to handle PostScript objects,
-<code>save</code> and <code>restore</code>, and real garbage
-collection.
-
-<h4><a name="Refs"></a>Refs (PostScript "objects")</h4>
-
-<p>
-Ghostscript represents what the PLRM calls PostScript "objects" using a
-structure called a <code>ref</code>, defined in <a
-href="../psi/iref.h">psi/iref.h</a>; packed refs, used for the elements of
-packed arrays, are defined in <a href="../psi/ipacked.h">psi/ipacked.h</a>.
-See those files for detailed information.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../psi/ipacked.h">psi/ipacked.h</a>,
-<a href="../psi/iref.h">psi/iref.h</a>.
-</dl>
-
-<p>
-The PLRM calls for two types of "virtual memory" (VM) space: global and
-local. Ghostscript adds a third space, <em>system</em> VM, whose lifetime
-is an entire session -- i.e., it is effectively "permanent". All three
-spaces are subject to garbage collection. There is a separate allocator
-instance for each VM space (actually, two instances each for global and
-local spaces; see <a href="#save_forgetsave_restore">below</a>). In a
-system with multiple contexts and multiple global or local VMs, each global
-or local VM has its own allocator instance(s).
-
-<p>
-Refs that represent PostScript composite objects, and therefore include
-pointers to stored data, include a 2-bit VM space tag to indicate in which
-VM the object data are stored. In addition to system, global, and local VM,
-there is a tag for "foreign" VM, which means that the memory is not managed
-by a Ghostscript allocator at all. Every store into a composite object must
-check for <code>invalidaccess</code>: the VM space tag values are chosen
-to help make this check efficient. See <a
-href="../psi/ivmspace.h">psi/ivmspace.h</a>, <a
-href="../psi/iref.h">psi/iref.h</a>, and <a
-href="../psi/store.h">psi/store.h</a> for details.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../psi/ivmspace.h">psi/ivmspace.h</a>.
-</dl>
-
-<p>
-PostScript composite objects (arrays and dictionaries) are usually small.
-Using a separate memory manager object for each composite object would waste
-a lot of space for object headers. Therefore, the interpreter's memory
-manager packs multiple composite objects (also called "ref-containing
-objects") into a single memory manager object, similar to the way the memory
-manager packs multiple objects into a clump (see <a
-href="#Standard_implementation">above</a>). See <a
-href="../base/gxalloc.h">base/gxalloc.h</a> for details. This memory manager
-object has a structure descriptor, like all other memory manager objects.
-
-<p>
-Note that the <code>value.pdict</code>, <code>value.refs</code>, or
-<code>value.packed</code> member of a ref must point to a PostScript
-composite object, and therefore can point into the middle of a memory
-manager object. This requires special handling by the garbage collector (<a
-href="#Interpreter_GC">q.v.</a>).
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../psi/ialloc.c">psi/ialloc.c</a>,
-<a href="../psi/ialloc.h">psi/ialloc.h</a>,
-<a href="../psi/iastate.h">psi/iastate.h</a>,
-<a href="../psi/iastruct.h">psi/iastruct.h</a>,
-<a href="../psi/ilocate.c">psi/ilocate.c</a>,
-<a href="../psi/imemory.h">psi/imemory.h</a>,
-<a href="../psi/istruct.h">psi/istruct.h</a>.
-</dl>
-
-<h4><a name="save_forgetsave_restore"></a>save/.forgetsave/restore</h4>
-
-<p>
-In addition to <code>save</code> and <code>restore</code>, Ghostscript
-provides a <code>.forgetsave</code> operator that makes things as though
-a given <code>save</code> had never happened. (In data base terminology,
-<code>save</code> is "begin transaction", <code>restore</code> is
-"abort transaction", and <code>.forgetsave</code> is "end/commit
-transaction"). <code>.forgetsave</code> was implemented for a specific
-commercial customer (who may no longer even be using it): it was a pain to
-make work, but it's in the code now, and should be maintained. See the
-extensive comments in <a href="../psi/isave.c">psi/isave.c</a> for more
-information about how these operations work.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../psi/idosave.h">psi/idosave.h</a>,
-<a href="../psi/isave.c">psi/isave.c</a>,
-<a href="../psi/isave.h">psi/isave.h</a>,
-<a href="../psi/isstate.h">psi/isstate.h</a>,
-<a href="../psi/store.h">psi/store.h</a>.
-</dl>
-
-<h4><a name="Stable_allocators"></a>Stable allocators</h4>
-
-<p>
-Even though <code>save</code> and <code>restore</code> are concepts
-from the PostScript interpreter, the generic allocator architecture and API
-include a feature to support them, called <em>stable</em> allocators. Every
-allocator has an associated stable allocator, which tags pointers with the
-same VM space number but which is not subject to <code>save</code> and
-<code>restore</code>. System VM is intrinsically stable (its associated
-stable allocator is the same allocator), so there are only 5 allocators in
-ordinary single-context usage: system VM, stable global VM, ordinary global
-VM, stable local VM, ordinary local VM.
-
-<p>
-The reason that we cannot simply allocate all stable objects in system VM is
-that their refs must still be tagged with the correct VM space number, so
-that the check against storing pointers from global VM to local VM can be
-enforced properly.
-
-<p>
-All PostScript objects are normally allocated with the non-stable
-allocators. The stable allocators should be used with care, since using
-them can easily create dangling pointers: if storage allocated with a stable
-allocator contains any references to PostScript objects, the client is
-responsible for ensuring that the references don't outlive the referenced
-objects, normally by ensuring that any such referenced objects are allocated
-at the outermost <code>save</code> level.
-
-<p>
-The original reason for wanting stable allocators was the PostScript stacks,
-which are essentially PostScript arrays but are not subject to
-<code>save</code> and <code>restore</code>. Some other uses of stable
-allocators are:
-
-<ul>
-
-<li>Several per-context structures for DPS.
-
-<li>Paths (see <code>gstate_path_memory</code> in
-<a href="../base/gsstate.c">base/gsstate.c</a>.
-
-<li>Row buffers for images (see <code>gs_image_row_memory</code> in <a
-href="../base/gsimage.c">base/gsimage.c</a>), because the data-reading
-procedure for an image can invoke <code>save</code> and
-<code>restore</code>.
-
-<li>Notification lists for fonts, to handle the sequence allocate .. save
-.. register .. restore.
-
-<li>The parameter lists for pdfwrite and epswrite devices (in <a
-href="../devices/vector/gdevpsdp.c">devices/vector/gdevpsdp.c</a>), because the whole issue of
-local vs. global VM for setpagedevice is, in the words of Ed Taft of Adobe,
-"a mess".
-
-<li>Many places in the pdfwrite driver, because many of its bookkeeping
-structures must not be restorable.
-
-</ul>
-
-<p>
-For more specific examples, search the sources for references to
-<code>gs_memory_stable</code>.
-
-<h4><a name="Interpreter_GC"></a>Garbage collection</h4>
-
-<p>
-The interpreter's garbage collector is a compacting, non-conservative,
-mark-and-sweep collector.
-
-<ul>
-<li>It compacts storage because that is the only way to avoid permanent
-sandbars, which is essential in limited-memory environments.
-<li>It is non-conservative because conservative collectors (which attempt
-to determine whether arbitrary bit patterns are pointers) cannot compact.
-<li>It uses mark-and-sweep, rather than a more modern copying approach,
-because it cannot afford the extra memory required for copying.
-</ul>
-
-<p>
-Because the garbage collector is non-conservative, it cannot be run if there
-are any pointers to movable storage from the C stack. Thus it cannot be run
-automatically when the allocator is unable to allocate requested space.
-Instead, when the allocator has allocated a given amount of storage (the
-<code>vm_threshold</code> amount, corresponding to the PostScript
-<code>VMThreshold</code> parameter), it sets a flag that the interpreter
-checks in the main loop. When the interpreter sees that this flag is set,
-it calls the garbage collector: at that point, there are no problematic
-pointers from the stack.
-
-<p>
-Roots for tracing must be registered with the allocator. Most roots are
-registered during initialization.
-
-<p>
-"Mark-and-sweep" is a bit of a misnomer. The garbage collector actually has
-5 main phases:
-
-<ul>
-<li>Sweep to clear marks;
-<li>Trace and mark;
-<li>Sweep to compute relocation;
-<li>Sweep to relocate pointers;
-<li>Sweep and compact.
-</ul>
-
-<p>
-There is some extra complexity to handle collecting local VM only. In this
-case, all pointers in global VM are treated as roots, and global VM is not
-compacted.
-
-<p>
-As noted above, PostScript arrays and strings can have refs that point
-within them (because of <code>getinterval</code>). Thus the garbage
-collector must mark each element of an array, and even each byte of a
-string, individually. Specifically, it marks objects, refs, and strings
-using 3 different mechanisms:
-
-<ul>
-
-<li>Objects have a mark bit in their header: see
-<a href="../base/gxobj.h">base/gxobj.h</a>,
-
-<li>Refs and packed refs have a reserved mark bit: see <a
-href="../psi/iref.h">psi/iref.h</a> and <a
-href="../psi/ipacked.h">psi/ipacked.h</a>.
-
-<li>Strings use a separate bit table, with one bit per string byte: see
-<a href="../base/gxalloc.h">base/gxalloc.h</a>,
-
-</ul>
-
-<p>
-Similarly, it records the relocation information for objects, refs, and
-strings differently:
-
-<ul>
-
-<li>Objects record relocation in the object header.
-
-<li>Refs record relocation in unused fields of refs such as nulls that
-don't use their <code>value</code> field. Every memory manager object
-that stores ref-containing objects as described above has an extra, unused
-ref at the end for this purpose.
-
-<li>Strings use a separate relocation table.
-
-</ul>
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../psi/igc.c">psi/igc.c</a>,
-<a href="../psi/igc.h">psi/igc.h</a>,
-<a href="../psi/igcref.c">psi/igcref.c</a>,
-<a href="../psi/igcstr.c">psi/igcstr.c</a>,
-<a href="../psi/igcstr.h">psi/igcstr.h</a>,
-<a href="../psi/ireclaim.c">psi/ireclaim.c</a>.
-</dl>
-
-<hr>
-
-<h2><a name="Portability"></a>Portability</h2>
-
-<p>
-One of Ghostscript's most important features is its great portability across
-platforms (CPUs, operating systems, compilers, and build tools). The code
-supports portability through two mechanisms:
-
-<ul>
-
-<li><a href="#Structural">Structural mechanisms</a> -- segregating
-platform-dependent information into files in a particular way.
-
-<li><a href="#Coding">Coding standards</a> -- avoiding relying on byte
-order, scalar size, and platform-specific compiler or library features.
-
-</ul>
-
-<h3><a name="Structural"></a>Structural</h3>
-
-<h4><a name="CPU_and_compiler"></a>CPU and compiler</h4>
-
-<p>
-Ghostscript attempts to discover characteristics of the CPU and compiler
-automatically during the build process, by compiling and then executing a
-program called <code>genarch</code>. <code>genarch</code> generates a
-file <code>obj/arch.h</code>, which almost all Ghostscript files then
-include. This works well for things like word size, byte order, and
-floating point representation, but it can't determine whether or not a
-compiler supports a particular feature, because if a feature is absent, the
-compilation may fail.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/genarch.c">base/genarch.c</a>,
-<a href="../obj/arch.h">obj/arch.h</a>.
-</dl>
-
-<h4><a name="Library_headers"></a>Library headers</h4>
-
-<p>
-Despite the supposed standardization of ANSI C, platforms vary considerably
-in where (and whether) they provide various standard library facilities.
-Currently, Ghostscript's build process doesn't attempt to sort this out
-automatically. Instead, for each library header file
-<code>&lt;</code><em>xxx</em><code>.h&gt;</code> there is a
-corresponding Ghostscript source file
-<code>base/</code><em>xxx</em><code>_.h</code>, containing a set of
-compile-time conditionals that attempt to select the correct platform header
-file, or in some cases substitute Ghostscript's own code for a missing
-facility. You may need to edit these files when moving to platforms with
-unusually non-standard libraries.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/ctype_.h">base/ctype_.h</a>,
-<a href="../base/dirent_.h">base/dirent_.h</a>,
-<a href="../base/dos_.h">base/dos_.h</a>,
-<a href="../base/errno_.h">base/errno_.h</a>,
-<a href="../base/fcntl_.h">base/fcntl_.h</a>,
-<a href="../base/jerror_.h">base/jerror_.h</a>,
-<a href="../base/malloc_.h">base/malloc_.h</a>,
-<a href="../base/math_.h">base/math_.h</a>,
-<a href="../base/memory_.h">base/memory_.h</a>,
-<a href="../base/pipe_.h">base/pipe_.h</a>,
-<a href="../base/png_.h">base/png_.h</a>,
-<a href="../base/setjmp_.h">base/setjmp_.h</a>,
-<a href="../base/stat_.h">base/stat_.h</a>,
-<a href="../base/stdint_.h">base/stdint_.h</a>,
-<a href="../base/stdio_.h">base/stdio_.h</a>,
-<a href="../base/string_.h">base/string_.h</a>,
-<a href="../base/time_.h">base/time_.h</a>,
-<a href="../base/unistd_.h">base/unistd_.h</a>,
-<a href="../base/vmsmath.h">base/vmsmath.h</a>,
-<a href="../base/windows_.h">base/windows_.h</a>,
-<a href="../base/x_.h">base/x_.h</a>.
-</dl>
-
-<p>
-It has been suggested that the GNU <code>configure</code> scripts do the
-above better, for Unix systems, than Ghostscript's current methods. While
-this may be true, we have found <code>configure</code> scripts difficult
-to write, understand, and maintain; and the <code>autoconf</code> tool
-for generating <code>configure</code> scripts, which we found easy to
-use, doesn't cover much of the ground that Ghostscript requires.
-
-<h4><a name="Cross_platform_APIs"></a>Cross-platform APIs</h4>
-
-<p>
-For a few library facilities that are available on all platforms but are not
-well standardized, or that may need to be changed for special environments,
-Ghostscript defines its own APIs. It is an architectural property of
-Ghostscript that the implementations of these APIs are the only .c files for
-which the choice of platform (as opposed to choices of drivers or optional
-features) determines whether they are compiled and linked into an
-executable.
-
-<dl>
-
-<dt>
-API:
-<dd>
-<a href="../base/gp.h">base/gp.h</a>,
-<a href="../base/gpcheck.h">base/gpcheck.h</a>,
-<a href="../base/gpgetenv.h">base/gpgetenv.h</a>,
-<a href="../base/gpmisc.h">base/gpmisc.h</a>,
-<a href="../base/gpsync.h">base/gpsync.h</a>.
-
-<dt>
-Implementation files shared among multiple platforms:
-<dd>
-<a href="../base/gp_getnv.c">base/gp_getnv.c</a>,
-<a href="../base/gp_mktmp.c">base/gp_mktmp.c</a>,
-<a href="../base/gp_nsync.c">base/gp_nsync.c</a>,
-<a href="../base/gp_paper.c">base/gp_paper.c</a>,
-<a href="../base/gp_psync.c">base/gp_psync.c</a>,
-<a href="../base/gp_strdl.c">base/gp_strdl.c</a>,
-<a href="../base/gpmisc.c">base/gpmisc.c</a>.
-
-<dt>
-Platform-specific implementation files:
-<dd>
-<a href="../base/gp_dosfe.c">base/gp_dosfe.c</a>,
-<a href="../base/gp_dosfs.c">base/gp_dosfs.c</a>,
-<a href="../base/gp_dvx.c">base/gp_dvx.c</a>,
-<a href="../base/gp_msdos.c">base/gp_msdos.c</a>,
-<a href="../base/gp_mshdl.c">base/gp_mshdl.c</a>,
-<a href="../base/gp_mslib.c">base/gp_mslib.c</a>,
-<a href="../base/gp_mswin.c">base/gp_mswin.c</a>,
-<a href="../base/gp_mswin.h">base/gp_mswin.h</a>,
-<a href="../base/gp_ntfs.c">base/gp_ntfs.c</a>,
-<a href="../base/gp_os2.c">base/gp_os2.c</a>,
-<a href="../base/gp_os2.h">base/gp_os2.h</a>,
-<a href="../base/gp_os2fs.c">base/gp_os2fs.c</a>,
-<a href="../base/gp_os9.c">base/gp_os9.c</a>,
-<a href="../base/gp_stdia.c">base/gp_stdia.c</a>,
-<a href="../base/gp_stdin.c">base/gp_stdin.c</a>,
-<a href="../base/gp_unifn.c">base/gp_unifn.c</a>,
-<a href="../base/gp_unifs.c">base/gp_unifs.c</a>,
-<a href="../base/gp_unix.c">base/gp_unix.c</a>,
-<a href="../base/gp_unix_cache.c">base/gp_unix_cache.c</a>,
-<a href="../base/gp_upapr.c">base/gp_upapr.c</a>,
-<a href="../base/gp_vms.c">base/gp_vms.c</a>,
-<a href="../base/gp_wgetv.c">base/gp_wgetv.c</a>,
-<a href="../base/gp_win32.c">base/gp_win32.c</a>,
-<a href="../base/gp_wpapr.c">base/gp_wpapr.c</a>,
-<a href="../base/gp_wsync.c">base/gp_wsync.c</a>,
-<a href="../base/gs_dll_call.h">base/gs_dll_call.h</a>.
-
-</dl>
-
-<h4><a name="Makefiles"></a>Makefiles</h4>
-
-<p>
-For information on the structure and conventions used within makefiles, see
-the <a href="#Makefile_structure">Makefile structure</a> section above.
-
-<p>
-Ghostscript's makefiles are structured very similarly to the cross-platform
-library files. The great majority of the makefiles are portable across all
-platforms and all versions of <code>make</code>. To achieve this, the
-platform-independent makefiles must obey two constraints beyond those of the
-POSIX <code>make</code> program:
-
-<ul>
-
-<li>No conditionals or <code>include</code>s are allowed. While most
-<code>make</code> programs now provide some form of conditional execution
-and some form of inclusion, there is no agreement on the syntax.
-(Conditionals and includes are allowed in platform-dependent makefiles; in
-fact, an inclusion facility is required.)
-
-<li>There must be a space on both sides of the : that separates the target
-of a rule from its dependencies. This is required for compatibility with
-the OpenVMS <code>MMS</code> and <code>MMK</code> programs.
-
-</ul>
-
-<p>
-The top-level makefile for each platform (where "platform" includes the OS,
-the compiler, and the flavor of <code>make</code>) contains all the build
-options, plus <code>include</code>s for the generic makefiles and any
-platform-dependent makefiles that are shared among multiple platforms.
-
-<p>
-While most of the top-level makefiles build a PostScript and/or PDF
-interpreter configuration, there are also a few makefiles that build a test
-program that only uses the graphics library without any language
-interpreter. Among other things, this can be helpful in verifying that no
-accidental dependencies on the interpreter have crept into the library or
-drivers.
-
-<p>
-For families of similar platforms, the question arises whether to use
-multiple top-level makefiles, or whether to use a single top-level makefile
-that may require minor editing for some (or all) platforms. Ghostscript
-currently uses the following top-level makefiles for building interpreter
-configurations:
-
-<ul>
-
-<li>POSIX systems (inluding Linux and Unix):
-<ul>
-<li><a href="../configure.ac"configure.ac</a>,
-GNU Autoconf source script for automatic build configuration.
-<li><a href="../Makefile.in">Makefile.in</a>,
-source for the top-level makefile used in the Autoconf build.
-<li><a href="../base/unix-gcc.mak">base/unix-gcc.mak</a>,
-for Unix with gcc.
-<li><a href="../base/unixansi.mak">base/unixansi.mak</a>,
-for Unix with an ANSI C compiler other than gcc.
-</ul>
-
-<li>PC:
-<ul>
-<li><a href="../ghostscript.vcproj">ghostscript.vcproj</a>,
-Visual Studio project file used to build Ghostscript.
-<li><a href="../psi/msvc32.mak">psi/msvc32.mak</a>,
-for MS Windows with Microsoft Visual C (MSVC).
-<li><a href="../psi/os2.mak">psi/os2.mak</a>,
-for MS-DOS or OS/2 GCC/EMX environment.
-</ul>
-
-<li>Macintosh:
-<ul>
-<li><a href="../base/macosx.mak">base/macosx.mak</a>,
-commandline makefile for MacOS X.
-<li><a href="../base/macos-mcp.mak">base/macos-mcp.mak</a>,
-dummy makefile to generate an xml project file for Metrowerks Codewarrior.
-</ul>
-
-
-<li>Other:
-<ul>
-<li><a href="../base/all-arch.mak">base/all-arch.mak</a>,
-for building on many Unix systems in a networked test environment.
-<li><a href="../base/openvms.mak">base/openvms.mak</a>,
-for OpenVMS with Digital's CC compiler and the MMS build program.
-<li><a href="../base/openvms.mmk">base/openvms.mmk</a>,
-for OpenVMS with Digital's CC compiler and the MMK build program.
-</ul>
-
-</ul>
-
-<p>
-The following top-level makefiles build the library test program:
-
-<ul>
-<li><a href="../base/ugcclib.mak">base/ugcclib.mak</a>,
-on Unix with gcc.
-<li><a href="../base/msvclib.mak">base/msvclib.mak</a>,
-on MS Windows with MSVC.
-</ul>
-
-<p>
-The MSVC makefiles may require editing to select between different versions
-of MSVC, since different versions may have slightly incompatible command
-line switches or customary installation path names. The Unix makefiles
-often require editing to deal with differing library path names and/or
-library names. For details, see <a href="Make.htm#Unix_build">the Unix
-section</a> of the documentation for building Ghostscript.
-
-<dl>
-
-<dt>
-Library test program:
-<dd>
-<a href="../base/gslib.c">base/gslib.c</a>.
-
-<dt>
-Platform-independent makefiles:
-<dd>
-
-<dl>
-
-<dt>
-Graphics library and support:
-<dd>
-<a href="../devices/contrib.mak">devices/contrib.mak</a>,
-<a href="../devices/devs.mak">devices/devs.mak</a>,
-<a href="../base/gs.mak">base/gs.mak</a>,
-<a href="../base/lib.mak">base/lib.mak</a>,
-<a href="../base/version.mak">base/version.mak</a>.
-
-<dt>
-PostScript interpreter and fonts:
-<dd>
-<a href="../psi/int.mak">psi/int.mak</a>.
-
-<dt>
-Third-party libraries:
-<dd>
-<a href="../base/expat.mak">base/expat.mak</a>,
-<a href="../base/ijs.mak">base/ijs.mak</a>,
-<a href="../base/jbig2.mak">base/jbig2.mak</a>,
-<a href="../base/ldf_jb2.mak">base/ldf_jb2.mak</a>,
-<a href="../base/lwf_jp2.mak">base/lwf_jp2.mak</a>,
-<a href="../base/jpeg.mak">base/jpeg.mak</a>,
-<a href="../base/png.mak">base/png.mak</a>,
-<a href="../base/zlib.mak">base/zlib.mak</a>.
-</dl>
-
-<dt>
-Shared platform-dependent makefiles:
-<dd>
-
-<dl>
-
-<dt>
-Unix:
-<dd>
-<a href="../base/unix-aux.mak">base/unix-aux.mak</a>,
-<a href="../base/unix-dll.mak">base/unix-dll.mak</a>,
-<a href="../base/unix-end.mak">base/unix-end.mak</a>,
-<a href="../base/unixhead.mak">base/unixhead.mak</a>,
-<a href="../base/unixinst.mak">base/unixinst.mak</a>,
-<a href="../base/unixlink.mak">base/unixlink.mak</a>.
-
-<dt>
-Microsoft Windows and MS-DOS:
-<dd>
-<a href="../base/msvccmd.mak">base/msvccmd.mak</a>,
-<a href="../base/msvctail.mak">base/msvctail.mak</a>,
-<a href="../base/pcwin.mak">base/pcwin.mak</a>,
-<a href="../psi/winint.mak">psi/winint.mak</a>,
-<a href="../base/winlib.mak">base/winlib.mak</a>,
-<a href="../base/winplat.mak">base/winplat.mak</a>.
-
-</dl>
-
-</dl>
-
-<h3><a name="Coding"></a>Coding</h3>
-
-<p>
-Coding for portability requires avoiding both <em>explicit</em>
-dependencies, such as platform-dependent <code>#ifdef</code>s, and
-<em>implicit</em> dependencies, such as dependencies on byte order or the
-size of the integral types.
-
-<h4><a name="Explicit_dependencies"></a>Explicit dependencies</h4>
-
-<p>
-The platform-independent .c files never, ever, use <code>#ifdef</code> or
-<code>#if</code> to select code for specific platforms. Instead, we
-always try to characterize some abstract property that is being tested. For
-example, rather than checking for macros that are defined on those specific
-platforms that have 64-bit <code>long</code> values, we define a macro
-<code>ARCH_SIZEOF_LONG</code> that can then be tested. Such macros are
-always defined in a .h file, either automatically in <code>arch.h</code>,
-or explicitly in a <em>xxx</em><code>_.h</code> file, as described in
-earlier sections.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="../base/std.h">base/std.h</a>,
-<a href="../base/stdpn.h">base/stdpn.h</a>,
-<a href="../base/stdpre.h">base/stdpre.h</a>.
-</dl>
-
-<h4><a name="Implicit_dependencies"></a>Implicit dependencies</h4>
-
-<p>
-The most common source of byte ordering dependencies is casting between
-types (T1 *) and (T2 *) where T1 and T2 are numeric types that aren't merely
-signed/unsigned variants of each other. To avoid this, the only casts
-allowed in the code are between numeric types, from a pointer type to a long
-integral type, and between pointer types.
-
-<p>
-Ghostscript's code assumes the following about the sizes of various types:
-
-<dl>
-<dt>char<dd>8 bits
-<dt>short<dd>16 bits
-<dt>int<dd>32 or 64 bits
-<dt>long<dd>32 or 64 bits
-<dt>float<dd>32 bits (may work with 64 bits)
-<dt>double<dd>64 bits (may work with 128 bits)
-</dl>
-
-<p>
-The code does not assume that the <code>char</code> type is signed (or
-unsigned); except for places where the value is always a literal string, or
-for interfacing to library procedures, the code uses <code>byte</code> (a
-Ghostscript synonym for <code>unsigned char</code>) almost everywhere.
-
-<p>
-Pointers are signed on some platforms and unsigned on others. In the few
-places in the memory manager where it's necessary to reliably order-compare
-(as opposed to equality-compare) pointers that aren't known to point to the
-same allocated block of memory, the code uses the
-<code>PTR_</code><em>relation</em> macros rather than direct comparisons.
-
-<p>
-See the files listed above for other situations where a macro provides
-platform-independence or a workaround for bugs in specific compilers or
-libraries (of which there are a distressing number).
-
-<h4><a name="Platform_specific_code"></a>Platform-specific code</h4>
-
-<p>
-There are some features that are inherently platform-specific:
-
-<ul>
-
-<li>Microsoft Windows requires a lot of special top-level code, and also has
-an installer and uninstaller.
-
-<li>OS/2 requires a little special code.
-
-<li>MacOS also requires special top-level code (now distributed with the
-standard Ghostscript package).
-
-<li>All platforms supporting DLLs (currently all three of the above) share
-some special top-level code.
-
-</ul>
-
-<dl>
-
-<dt>
-MS Windows files:
-<dd>
-<a href="../psi/dpmain.c">psi/dpmain.c</a>,
-<a href="../psi/dwdll.c">psi/dwdll.c</a>,
-<a href="../psi/dwdll.h">psi/dwdll.h</a>,
-<a href="../psi/dwimg.c">psi/dwimg.c</a>,
-<a href="../psi/dwimg.h">psi/dwimg.h</a>,
-<a href="../psi/dwmain.c">psi/dwmain.c</a>,
-<a href="../psi/dwmainc.c">psi/dwmainc.c</a>,
-<a href="../psi/dwnodll.c">psi/dwnodll.c</a>,
-<a href="../psi/dwreg.c">psi/dwreg.c</a>,
-<a href="../psi/dwreg.h">psi/dwreg.h</a>,
-<a href="../psi/dwres.h">psi/dwres.h</a>,
-<a href="../psi/dwtext.c">psi/dwtext.c</a>,
-<a href="../psi/dwtext.h">psi/dwtext.h</a>,
-<a href="../psi/dwtrace.c">psi/dwtrace.c</a>,
-<a href="../psi/dwtrace.h">psi/dwtrace.h</a>,
-<a href="../base/gp_msdll.c">base/gp_msdll.c</a>,
-<a href="../base/gp_mspol.c">base/gp_mspol.c</a>,
-<a href="../base/gp_msprn.c">base/gp_msprn.c</a>,
-<a href="../base/gsdllwin.h">base/gsdllwin.h</a>.
-
-<dt>
-OS/2 files:
-<dd>
-<a href="../base/gp_os2pr.c">base/gp_os2pr.c</a>,
-
-<dt>
-Unix files:
-<dd>
-<a href="../psi/dxmain.c">psi/dxmain.c</a>,
-<a href="../psi/dxmainc.c">psi/dxmainc.c</a>.
-
-<dt>
-Macintosh files:
-<dd>
-<a href="../devices/gdevmac.c">devices/gdevmac.c</a>,
-<a href="../devices/gdevmac.h">devices/gdevmac.h</a>,
-<a href="../devices/gdevmacpictop.h">devices/gdevmacpictop.h</a>,
-<a href="../devices/gdevmacttf.h">devices/gdevmacttf.h</a>,
-<a href="../base/gp_mac.c">base/gp_mac.c</a>,
-<a href="../base/gp_mac.h">base/gp_mac.h</a>,
-<a href="../base/gp_macio.c">base/gp_macio.c</a>,
-<a href="../base/gp_macpoll.c">base/gp_macpoll.c</a>,
-<a href="../base/gsiomacres.c">base/gsiomacres.c</a>,
-<a href="../base/macgenmcpxml.sh">base/macgenmcpxml.sh</a>,
-<a href="../base/macsystypes.h">base/macsystypes.h</a>,
-<a href="../base/macos_carbon_pre.h">base/macos_carbon_pre.h</a>,
-<a href="../base/macos_carbon_d_pre.h">base/macos_carbon_d_pre.h</a>,
-<a href="../base/macos_classic_d_pre.h">base/macos_classic_d_pre.h</a>,
-
-<a href="../psi/dmmain.c">psi/dmmain.c</a>,
-<a href="../psi/dmmain.r">psi/dmmain.r</a>.
-
-<dt>
-VMS files:
-<dd>
-<a href="../base/vms_x_fix.h">base/vms_x_fix.h</a>.
-
-<dt>
-DLL files:
-<dd>
-<a href="../psi/gsdll.c">psi/gsdll.c</a>,
-<a href="../base/gsdll.h">base/gsdll.h</a>,
-<a href="../devices/gdevdsp.c">devices/gdevdsp.c</a>,
-<a href="../devices/gdevdsp.h">devices/gdevdsp.h</a>,
-<a href="../devices/gdevdsp2.h">devices/gdevdsp2.h</a>,
-<a href="../psi/iapi.c">psi/iapi.c</a>,
-<a href="../psi/iapi.h">psi/iapi.h</a>,
-<a href="../psi/idisp.c">psi/idisp.c</a>,
-<a href="../psi/idisp.h">psi/idisp.h</a>.
-<p>
-The new DLL interface (new as of 7.0) is especially useful with the
-new display device, so it is included here. Both are due to Russell
-Lang.
-
-</dl>
-
-
-<hr>
-
-<h2><a name="Troubleshooting"></a>Troubleshooting</h2>
-
-<p>
-The Ghostscript code has many tracing and debugging features that can be
-enabled at run time using the <code>-Z</code> command line switch, if the
-executable was compiled with <code>DEBUG</code> defined. One
-particularly useful combination is <code>-Z@\?</code>, which fills free
-memory blocks with a pattern and also turns on run-time memory consistency
-checking. For more information, see <a
-href="Use.htm#Debugging">doc/Use.htm#Debugging</a>; you can also search for
-occurrences of <code>if_debug</code> or <code>gs_debug_c</code> in the
-source code. Note that many of these features are in the graphics library
-and do not require a PostScript interpreter.
-
-<p>
-The code also contains many run-time procedures whose only purpose is to be
-called from the debugger to print out various data structures, including all
-the procedures in <a href="../psi/idebug.c">psi/idebug.c</a> (for the
-PostScript interpreter) and the <code>debug_dump_</code> procedures in <a
-href="../base/gsmisc.c">base/gsmisc.c</a>.
-
-<dl>
-<dt>
-Files:
-<dd>
-<a href="Use.htm#Debugging">doc/Use.htm#Debugging</a>,
-<a href="../base/gdebug.h">base/gdebug.h</a>,
-<a href="../base/gsmdebug.h">base/gsmdebug.h</a>,
-<a href="../psi/idebug.h">psi/idebug.h</a>,
-<a href="../psi/idebug.c">psi/idebug.c</a>.
-</dl>
-
-<hr>
-
-<h2><a name="Profiling"></a>Profiling</h2>
-<h3><a name="ProfilingMSVC6"></a>Profiling with Microsoft Developer Studio 6</h3>
-
-<p>
-The Microsoft profiling tool is included into Microsoft Developer Studio 6
-Enterprise Edition only. Standard Edition and Professional Edition do not include it.
-
-<p>
-Microsoft profiler tool requires the application to be linked with
-a special linker option. To provide it you need the following change to
-<code>gs/base/msvccmd.mak</code> :
-
-<blockquote><pre><code>
-
-*** SVN-GS\HEAD\gs\src\msvccmd.mak Tue Jan 9 21:41:07 2007
---- gs\src\msvccmd.mak Mon May 7 11:29:35 2007
-***************
-*** 159,163 ****
- # Note that it must be followed by a space.
- CT=/Od /Fd&#36;(GLOBJDIR) &#36;(NULL) &#36;(CDCC) &#36;(CPCH)
-! LCT=/DEBUG /INCREMENTAL:YES
- COMPILE_FULL_OPTIMIZED= # no optimization when debugging
- COMPILE_WITH_FRAMES= # no optimization when debugging
---- 159,164 ----
- # Note that it must be followed by a space.
- CT=/Od /Fd&#36;(GLOBJDIR) &#36;(NULL) &#36;(CDCC) &#36;(CPCH)
-! # LCT=/DEBUG /INCREMENTAL:YES
-! LCT=/DEBUG /PROFILE
- COMPILE_FULL_OPTIMIZED= # no optimization when debugging
- COMPILE_WITH_FRAMES= # no optimization when debugging
-***************
-*** 167,175 ****
- !if &#36;(DEBUGSYM)==0
- CT=
-! LCT=
- CMT=/MT
- !else
- CT=/Zi /Fd&#36;(GLOBJDIR) &#36;(NULL)
-! LCT=/DEBUG
- CMT=/MTd
- !endif
---- 168,178 ----
- !if &#36;(DEBUGSYM)==0
- CT=
-! # LCT=
-! LCT=/PROFILE
- CMT=/MT
- !else
- CT=/Zi /Fd&#36;(GLOBJDIR) &#36;(NULL)
-! # LCT=/DEBUG
-! LCT=/DEBUG /PROFILE
- CMT=/MTd
- !endif
-
-</code></pre></blockquote>
-
-Note that any of debug and release build may be profiled.
-
-<p>
-Mictosoft Profiler tool can't profile a dynamically loaded DLLs.
-When building Ghostscript with makefiles you need to specify
-<code>MAKEDLL=0</code> to <code>nmake</code> command line.
-
-<p>
-The Integrated Development Environment of Microsoft Developer Studio 6
-cannot profile a makefile-based project. Therefore the profiling tool
-to be started from command line.
-
-<p>
-The profiling from command line is a 4 step procedure.
-The following batch file provides a sample for it :
-
-<blockquote><pre><code>
-
-set DEVSTUDIO=G:\Program Files\Microsoft Visual Studio
-set GS_HOME=..\..\gs-hdp
-set GS_COMMAND_LINE=%GS_HOME%\bin\gswin32c.exe -I%GS_HOME%\lib;f:\afpl\fonts -r144 -dBATCH -dNOPAUSE -d/DEBUG attachment.pdf
-set START_FUNCTION=_main
-set Path=%DEVSTUDIO%\Common\MSDev98\Bin;%DEVSTUDIO%\VC98\Bin
-PREP.EXE /OM /SF %START_FUNCTION% /FT %GS_HOME%\bin\gswin32c.exe
-If ERRORLEVEL 1 echo step 1 fails&amp;exit
-PROFILE /I %GS_HOME%\bin\gswin32c.pbi %GS_COMMAND_LINE%
-If ERRORLEVEL 1 echo step 2 fails&amp;exit
-PREP /M %GS_HOME%\bin\gswin32c /OT xxx.pbt
-If ERRORLEVEL 1 echo step 3 fails&amp;exit
-PLIST /ST xxx.pbt &gt;profile.txt
-If ERRORLEVEL 1 echo step 4 fails&amp;exit
-
-</code></pre></blockquote>
-
-<p>
-This batch file to be adopted to your configuration :
-
-<ul>
-<li>
-Edit the path to developer studio in the line 1.
-<li>
-Edit the Ghostscript home directory in the line 2.
-<li>
-Edit Ghostscript command line in line 3. Note that profiling without /NOPAUSE is a bad idea.
-<li>
-In the line 4 edit the function name to start the profiling from.
-The sample code specifies _main as the starting function.
-Note it is the linker's function name, which starts with underscore.
-<li>
-Edit the output file name in the line 5.
-</ul>
-
-
-
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2001-2022 Artifex Software, Inc. All rights
-reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Devices.htm b/doc/Devices.htm
deleted file mode 100644
index 4787ebd7..00000000
--- a/doc/Devices.htm
+++ /dev/null
@@ -1,2175 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Details of Ghostscript Output Devices</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Details of Ghostscript Output Devices</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Measurements">Notes on measurements</a></li>
- <li><a href="#File_formats">Image file formats</a></li>
- <li>
- <ul>
- <li><a href="#PNG">PNG file format</a></li>
- <li><a href="#JFIF">JPEG file format (JFIF)</a></li>
- <li><a href="#PNM">PNM file format</a></li>
- <li><a href="#TIFF">TIFF file formats</a></li>
- <li><a href="#fax">fax file formats</a></li>
- <li><a href="#BMP">BMP file format</a></li>
- <li><a href="#PCX">PCX file format</a></li>
- <li><a href="#PSD">PSD file format (DeviceN color model)</a></li>
- <li><a href="#PDFimage">Bitmap PDF output, PCLm output</a></li>
- </ul>
- </li>
- <li><a href="#OCR-Devices">OCR Devices</a></li>
- <li>
- <ul>
- <li><a href="#OCR">OCR text output</a></li>
- <li><a href="#PDFocr">Bitmap PDF output (with OCR text)</a></li>
- <li><a href="#PDFwriteocr">Vector PDF output (with OCR Unicode CMaps)</a></li>
- </ul>
- </li>
- <li><a href="#High-level">High level formats</a></li>
- <li>
- <ul>
- <li><a href="#PDF">PDF file output</a></li>
- <li><a href="#OCR">OCR devices</a></li>
- <li><a href="#PS">PostScript file output</a></li>
- <li><a href="#EPS">EPS file output</a></li>
- <li><a href="#PXL">PCL-XL file output</a></li>
- <li><a href="#TXT">Text output</a></li>
- </ul>
- </li>
- <li><a href="#Display_devices">Display devices</a></li>
- <li>
- <ul>
- <li><a href="#x11_devices">X Window System</a></li>
- <li><a href="#display_device">display device (MS Windows, OS/2, gtk+)</a></li>
- </ul>
- </li>
- <li><a href="#IJS">IJS - Inkjet and other raster devices</a></li>
- <li><a href="#Rinkj">Rinkj - Resplendent inkjet driver</a></li>
- <li><a href="#HP_ijs">HP Deskjet official drivers</a></li>
- <li><a href="#gimp-print">Gimp-Print driver collection</a></li>
- <li><a href="#Win">MS Windows printers</a></li>
- <li><a href="#SPARCprinter">Sun SPARCprinter</a></li>
- <li>
- <ul>
- <li><a href="#SPARC_install">Installation</a></li>
- <li><a href="#SPARC_problems">Problems</a></li>
- </ul>
- </li>
- <li><a href="#Apple">Apple dot matrix printer</a></li>
- <li><a href="#Test">Special and Test devices</a></li>
- <li>
- <ul>
- <li><a href="#Bit">Raw 'bit' output.</a></li>
- <li><a href="#Bounding_box_output">Bounding Box output.</a></li>
- <li><a href="#Ink_coverage_output">Ink coverage output.</a></li>
- <li><a href="#Permute">Permutation (DeviceN color model)</a></li>
- <li><a href="#SPOT">spotcmyk (DeviceN color model)</a></li>
- <li><a href="#XCF">XCF (DeviceN color model)</a></li>
- <li><a href="#bitraw">Raw 'bit' devices</a></li>
- </ul>
- </li>
-</ul>
-
-
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>. You may also be interested in <a href="Make.htm">how to
-build Ghostscript</a> and <a href="Install.htm">install it</a>, as well as
-the description of the <a href="Drivers.htm">driver interface</a>.</p>
-
-<p>Documentation for some older, superceded devices has been moved to
-<a href="Deprecated.htm">another document</a>. In general such devices are deprecated
-and will be removed in future versions of Ghostscript. In general all older printer
-drivers can be replaced by the ijs interface and one of the available 3rd party raster
-driver collections. We recommend moving to the ijs device for all such printing.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Measurements"></a>Notes on measurements</h2>
-
-<p>
-Several different important kinds of measures appear throughout this
-document: inches, centimeters and millimeters, points, and bits per pixel.</p>
-
-<dl>
-
-<dt>Centimeters and millimeters</dt>
-<dd>ISO standard paper sizes such as A4 and A3 are commonly represented in
-the SI units of centimeters and millimeters. Centimeters are abbreviated
-<dfn><abbr>cm</abbr></dfn>, millimeters <dfn><abbr>mm</abbr></dfn>. ISO A4 paper is
-quite close to 210&times;297 millimeters (approximately 8.3&times;11.7
-inches).</dd>
-
-<dt>Inches</dt>
-<dd>1 inch equals 2.54 centimeters. The inch measure is sometimes
-represented by <dfn><abbr>in</abbr></dfn> or a quotation mark
-(<abbr>&quot;</abbr>) to the right
-of a measure, like 8.5in or 8.5&quot;.
-U.S. "letter" paper is exactly
-8.5in&times;11in, approximately 21.6cm&times;27.9cm. (See in the usage
-documentation all the <a href="Use.htm#Known_paper_sizes">paper sizes
-predefined in Ghostscript</a>.)</dd>
-
-<dt>Points</dt>
-<dd>Points are a measure traditionally used in the printing trade and now
-in PostScript, which specifies exactly 72 points per inch (approximately
-28.35 per centimeter). The <a href="Use.htm#Known_paper_sizes">paper sizes
-known to Ghostscript</a> are defined in the initialization file
-<code>gs_statd.ps</code> in terms of points.</dd>
-
-<dt>Dots per inch</dt>
-<dd>Dots per inch or <dfn><abbr>dpi</abbr></dfn> is the common measure of
-printing resolution in the US.</dd>
-
-<dt>Bits per pixel</dt>
-<dd>Commonly abbreviated <dfn><abbr>bpp</abbr></dfn> this is the number of
-digital bits used to represent the color of each pixel. This is also referred
-to as 'bit depth' or 'pixel depth'.</dd>
-
-</dl>
-
-<hr>
-
-<h2><a name="File_formats"></a>Image file formats</h2>
-
-<p>
-Ghostscript supports output to a variety of image file formats
-and is widely used for rasterizing postscript and pdf files.
-A collection of such formats ('output devices' in Ghostscript terminology)
-are described in this section.
-</p>
-
-<p>
-Here are some commonly useful driver options that apply to all raster drivers.
-Options specific to particular file formats are described in their respective
-sections below.</p>
-
-<blockquote><dl>
-
-<dt>-sOutputFile=<em>filename</em></dt>
-<dd><p>This is a general option telling Ghostscript what to name the output.
-It can either be a single filename '<code>tiger.png</code>' or a template
- '<code>figure-%03d.jpg</code>' where the <code>%03d</code> is replaced by the page number.</p></dd>
-
-
-<dt>-r<em>res</em></dt>
-<dt>-r<em>xres</em>x<em>yres</em></dt>
-<dd><p>This option sets the resolution of the output file in dots per inch.
-The default value if you don't specify this options is usually 72 <abbr>dpi</abbr>.</p></dd>
-
-<dt>-dTextAlphaBits=<em>n</em></dt>
-<dt>-dGraphicsAlphaBits=<em>n</em></dt>
-<dd><p>These options control the use of subsample antialiasing. Their use is highly recommended
-for producing high quality rasterizations of the input files. The size of the subsampling
-box <em>n</em> should be 4 for optimum output, but smaller values can be used for faster
-rendering. Antialiasing is enabled separately for text and graphics content.</p>
-<p>Because this feature relies upon rendering the input it is incompatible, and will generate
-an error on attempted use, with any of the vector output devices.</p>
-</dd>
-</dl>
-</blockquote>
-
-<p>
-It is also conventional to call Ghostscript with the '<code>-dSAFER -dBATCH -dNOPAUSE</code>' trio
-of options when rasterizing to a file. These suppress interactive prompts and enable some
-security checks on the file to be run. Please see the <a href="Use.htm">Use documentation</a>
-for a complete description.
-</p>
-
-<h3><a name="PNG"></a>PNG file format</h3>
-
-<p><acronym>PNG</acronym> (pronounced 'ping') stands for Portable Network Graphics,
-and is the recommended format for high-quality images. It supports full quality
-color and transparency, offers excellent lossless compression of the image data,
-and is widely supported. Please see the
-<a href="http://www.libpng.org/pub/png/pngintro.html" class="offsite">PNG website</a>
-for a complete description of the format.</p>
-
-<p>Ghostscript provides a variety of devices for <acronym>PNG</acronym> output
-varying by bit depth. For normal use we recommend <code>png16m</code> for 24-bit RGB color,
-or <code>pnggray</code> for grayscale. The <code>png256</code>, <code>png16</code> and
-<code>pngmono</code> devices respectively provide 8-bit color, 4-bit color and
-black-and-white for special needs. The <code>pngmonod</code> device is also a
-black-and-white device, but the output is formed from an internal 8 bit grayscale
-rendering which is then error diffused and converted down to 1bpp.</p>
-
-<p>The <code>png16malpha</code> and <code>pngalpha</code> devices are 32-bit RGBA color with transparency
-indicating pixel coverage. The background is transparent unless
-it has been explicitly filled. PDF 1.4 transparent files do not
-give a transparent background with this device. The devices differ, in that the <code>pngalpha</code> device
-enables Text and graphics anti-aliasing by default. We now recommend that people use the <code>png16malpha</code>
-device in preference, and achieve any required antialiasing via the <code>DownScaleFactor</code> parameter,
-as this gives better results in many cases.</p>
-
-<h4>Options</h4>
-
-<p>The <code>pngmonod</code>, <code>png16m</code>, <code>pnggray</code>, <code>png16malpha</code> and
-<code>pngalpha</code> devices all respond to the following:</p>
-
-<blockquote>
-<dl>
-<dt><code>-dDownScaleFactor=</code><b><em>integer</em></b></dt>
-<dd>This causes the internal rendering to be scaled down by the given (integer <= 8) factor before being output. For example, the following will produce
-a 200dpi output png from a 600dpi internal rendering:
-<blockquote>
-<pre>
- <kbd>gs -sDEVICE=png16m -r600 -dDownScaleFactor=3 -o tiger.png\
- examples/tiger.eps</kbd>
-</pre>
-</blockquote>
-</dd>
-</dl>
-</blockquote>
-
-<p>The <code>pngmonod</code> device responds to the following option:</p>
-
-<blockquote>
-<dl>
-<dt><code>-dMinFeatureSize=</code><em>state</em> (0 to 4; default = 1)</dt>
-<dd>This option allows a minimum feature size to be set; if any output pixel
-appears on its own, or as part of a group of pixels smaller than
-<code>MinFeatureSize</code> x <code>MinFeatureSize</code>, it will be expanded to
-ensure that it does. This is useful for output devices that are high
- resolution, but that have trouble rendering isolated pixels.</dd>
-
-<dd>While this parameter will accept values from 0 to 4, not all are fully
-implemented. 0 and 1 cause no change to the output (as expected). 2 works
-as specified. Values of 3 and 4 are accepted for compatibility, but
-behave as for 2.</dd>
-</dl>
-</blockquote>
-
-<p>The <code>png16malpha</code> and <code>pngalpha</code> devices respond to the following option:</p>
-
-<blockquote>
-<dl>
-<dt><code>-dBackgroundColor=</code><b><em>16#RRGGBB</em></b> (RGB color, default white = 16#ffffff)</dt>
-<dd>For the <code>png16malpha</code> and <code>pngalpha</code> devices only,
-set the suggested background color in the PNG bKGD chunk.
-When a program reading a PNG file does not support alpha
-transparency, the PNG library converts the image using
-either a background color if supplied by the program
-or the bKGD chunk.
-One common web browser has this problem, so when using
-<code>&lt;body bgcolor="CCCC00"&gt;</code> on a web page
-you would need to use <code>-dBackgroundColor=16#CCCC00</code>
-when creating alpha transparent PNG images for use on the
-page.</dd>
-</dl>
-</blockquote>
-
-<h4>Examples</h4>
-
-<p>Examples of how to use Ghostscript to convert postscript to PNG image files:</p>
-
-<blockquote>
-<pre>
- <kbd>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 \
- -sOutputFile=tiger.png examples/tiger.png</kbd>
-
- <kbd>gs -dSAFER -dBATCH -dNOPAUSE -r150 -sDEVICE=pnggray -dTextAlphaBits=4 \
- -sOutputFile=doc-%02d.png doc.pdf</kbd>
-</pre>
-</blockquote>
-
-<p>In commercial builds, the <code>png16m</code> device will accept a <code>-dDeskew</code> option to automatically detect/correct skew when generating output bitmaps.</p>
-
-<h3><a name="JFIF"></a>JPEG file format (JFIF)</h3>
-
-<p>
-Ghostscript includes output drivers that can produce jpeg files
-from postscript or pdf images. These are the <code>jpeg</code> and
- <code>jpeggray</code> devices.</p>
-
-<p>Technically these produce <a href="http://www.ijg.org/">Independent JPEG Group</a>
-JFIF (JPEG File Interchange Format) files, the common sort found on the web.</p>
-
-<p><strong>Please note</strong> that
-JPEG is a compression method specifically intended for continuous-tone
-images such as photographs, not for graphics, and it is therefore quite
-unsuitable for the vast majority of page images produced with PostScript.
-For anything other than pages containing simple images the lossy compression
-of the jpeg format will result in poor quality output regardless of the input.
-To learn more about the distinction, consult a reference about uses and abuses of JPEG,
-such as the JPEG FAQ</p>
-
-<blockquote>
-<a href="http://www.faqs.org/faqs/jpeg-faq/" class="offsite">http://www.faqs.org/faqs/jpeg-faq/</a>
-</blockquote>
-
-<h4>Examples</h4>
-
-<p>
-You can use the JPEG output drivers -- <code>jpeg</code> to produce
-color JPEG files and <code>jpeggray</code> for grayscale JPEGs -- the
-same as other file-format drivers: by specifying the device name and an
-output file name, for example</p>
-
-<blockquote>
-<pre><kbd>gs -sDEVICE=jpeg -sOutputFile=foo.jpg foo.ps</kbd></pre>
-</blockquote>
-
-<h4>Options</h4>
-
-<p>
-The JPEG devices support several special parameters to control the JPEG
-"quality setting" (DCT quantization level).</p>
-
-<blockquote>
-<dl>
-<dt><code>-dJPEGQ=</code><b><em>N</em></b> (integer from 0 to 100, default 75)</dt>
-<dd>Set the quality level <b><em>N</em></b> according to the widely used
-IJG quality scale, which balances the extent of compression against the
-fidelity of the image when reconstituted. Lower values drop more
-information from the image to achieve higher compression, and therefore
-have lower quality when reconstituted.</dd>
-
-<dt><code>-dQFactor=</code><b><em>M</em></b> (float from 0.0 to 1.0)</dt>
-<dd>Adobe's QFactor quality scale, which you may use in place of
-<code>JPEGQ</code> above. The QFactor scale is used by PostScript's
-DCTEncode filter but is nearly unheard-of elsewhere.</dd>
-</dl>
-</blockquote>
-
-<p>
-At this writing the default JPEG quality level of 75 is equivalent to
-<code>-dQFactor=0.5</code>, but the JPEG default might change in the
-future. There is currently no support for any additional JPEG
-compression options, such as the other DCTEncode filter parameters.
-</p>
-
-
-<h3><a name="PNM"></a>PNM</h3>
-
-<p>The PNM (portable network map) family of formats are very simple
-uncompressed image formats commonly used on unix-like systems. They
-are particularly useful for testing or as input to an external conversion
-utility.</p>
-
-<p>A wide variety of data formats and depths is supported. Devices include
-<code>pbm
- pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw pkm pkmraw pksm
- pksmraw</code>.
-</p>
-
-<h3><a name="TIFF"></a>TIFF file formats</h3>
-
-<p><acronym>TIFF</acronym> is a loose collection of formats, now largely
-superceded by <acronym>PNG</acronym> except in applications where backward
-compatibility or special compression is required. The <acronym>TIFF</acronym>
-file format is described in the
-<a href="http://partners.adobe.com/asn/developer/pdfs/tn/TIFF6.pdf" class="offsite">TIFF 6.0 Specification</a>
-published by Adobe Systems Incorporated.</p>
-<p>Note that, due to the structure of the TIFF format, writing TIFF output
-requires that the target file be seekable. Writing to stdout, pipes or other
-similar stream is not supported. Attempting to do so will generate an error.
-</p>
-<p>
-There are two unrelated sets of TIFF drivers. There are five color TIFF
-drivers that produce uncompressed output:</p>
-
-<blockquote>
-<dl>
-<dt><code>tiffgray</code></dt>
-<dd>Produces 8-bit gray output.</dd>
-<dt><code>tiff12nc</code></dt>
-<dd>Produces 12-bit RGB output (4 bits per component).</dd>
-<dt><code>tiff24nc</code></dt>
-<dd>Produces 24-bit RGB output (8 bits per component).</dd>
-<dt><code>tiff48nc</code></dt>
-<dd>Produces 48-bit RGB output (16 bits per component).</dd>
-<dt><code>tiff32nc</code></dt>
-<dd>Produces 32-bit CMYK output (8 bits per component).</dd>
-<dt><code>tiff64nc</code></dt>
-<dd>Produces 64-bit CMYK output (16 bits per component).</dd>
-<dt><a name="tiffsep"></a><code>tiffsep</code></dt>
-<dd>
-The <code>tiffsep</code> device creates multiple output files: a single 32 bit
-composite CMYK file and multiple tiffgray files, one for each
-separation (unless <code>-dNoSeparationFiles</code> is specified). If separation
-files are being produced and more than one page is being generated, the output file
-specification <b>must</b> include a format specifier (e.g <code>-o outfile-%d.tif</code>)
-so that each page can have a uniquely named set of separation files.
-
-<p>The default compression is <code>lzw</code> but this may be overridden by
-the <code>-sCompression=</code> option.</p>
-
-<p>
-The file specified via the OutputFile command line parameter will contain
-CMYK data. This data is based upon the CMYK data within the file plus
-an equivalent CMYK color for each spot color. The equivalent
-CMYK color for each spot color is determined using the alternate tint transform
-function specified in the Separation and DeviceN color spaces. Since
-this file is created based upon having color planes for each colorant, the
-file will correctly represent the appearance of overprinting with spot colors.</p>
-
-<p>
-File names for the separations for the CMYK colorants are created by appending
-'.Cyan.tif', '.Magenta.tif' '.Yellow.tif' or '.Black.tif' to the
-end of the file name specified via the OutputFile parameter.
-File names for the spot color separation files are created by appending the
-Spot color name in '(' and ').tif' to the filename.</p>
-<p>Note that, while the name of the ink is case-sensitive, the filename may not be
-(depending on the Operating System), so if a spot name matches one of the process
-ink names, it will have the spot number included as part of the name (eg YELLOW0).
-</p>
-
-<p>
-If desired the file names for the spot color separation files can be created
-by appending '.sn.tif' (where n is the spot color number, see below) to the end
-of the file name specified via the OutputFile parameter. This change is a
-compile time edit. To obtain this type of output the function
-create_separation_file_name in gdevtsep.c should be called with a true value
-for its use_sep_name parameter.</p>
-
-<p>
-The <code>tiffsep</code> device will automatically recognize spot colors. In this
-case their order is determined by when they are found in the input file.
-The names of spot colors may be specified via the SeparationColorNames
-device parameters.</p>
-
-<p>
-Internally each spot color is assigned a spot color number. These
-numbers start with 0 for the first spot color. The spot color
-numbers are assigned in the same order as the names are printed to
-stderr (see below). This order also matches the ordering in the
-SeparationColorNames list, if this parameter is specified. The
-spot color numbers are not affected by the SeparationOrder parameter.</p>
-
-<p>
-If only a subset of the colorants for a file is desired, then the separations
-to be output can be selected via the SeparationOrder
-device parameter. When colorants are selected via the
-SeparationOrder parameter, the composite CMYK output contains
-the equivalent CMYK data only for the selected colorants.</p>
-
-<p>
-NOTE: the composite CMYK output, because it uses the tint transformed
-colour equivalents for any spot colours (see Postscript Language
-Reference "Separation Color Spaces" and "DeviceN Color Spaces"), may
-not produce an accurate preview, if the job uses overprinting.</p>
-
-<p>
-The <code>tiffsep</code> device also prints the names of any spot colors
-detected within a document to stderr. (stderr is also used for the
-output from the bbox device.) For each spot color, the name of
-the color is printed preceded by '%%SeparationName: '. This
-provides a simple mechanism for users and external applications to be informed about
-the names of spot colors within a document.</p>
-
-<p>
-Generally Ghostscript will support a maximum of 64 process and spot
-colors. The <code>tiffsep</code> device the <code>psdcmyk</code> device
-and the <code>psdcmyk16</code> devices maintain rendered data
-in a planar form with a maximum of 64 planes set by the definition of
-GS_CLIENT_COLOR_MAX_COMPONENTS in the code. That is there can be up to
-64 colorants accurately handled with overprint on a single page. If more
-than 64 colorants are encountered, those beyond 64 will be mapped to CMYK using the
-alternate tint transform.</p>
-
-<p>
-When rendering a PDF document, Ghostscript can deteremine prior to rendering how
-many colorants occur on a particular page. With Postscript, this is not possible
-in general. To optimize for this, when rendering Postscript, it is possible to specify
-at run-time the number of spot colorants you wish to have the device capable
-of handling using the -dMaxSpots=N command option, where N is the number of spot
-colorants that you wish to be able to handle and must be no more than the 64 minus the
-number of process colors. For example, 60 or less for a CMYK device such as tiffsep.
-If you specify more than
-is needed, the document will render more slowly. The ideal case is to use
-the same number as the maximum number of spot colorants that occur on a single page
-of the document. If more spot colorants are encountered than is specified by
--dMaxSpots, then a warning will be printed indicating that some spot colorants will
-be mapped to CMYK using the alternate tint transform.</p>
-
-<p>The <code>tiffsep</code> device accepts a <code>-dBitsPerComponent=</code>
-option, which may be set to 8 (the default) or 1. In 1bpp mode, the
-device renders each component internally in 8 bits, but then converts
-down to 1bpp with error diffusion before output as described below in
-the <code>tiffscaled</code> device. No composite file is produced in
-1bpp mode, only individual separations.</p>
-
-<p>The device also accepts the <code>-dDownScaleFactor= -dTrapX= -dTrapy=</code> and
-<code>-sPostRenderProfile=</code> parameters as described below in the tiffscaled device,
-and <code>-dMinFeatureSize=</code> in 1bpp mode.</p>
-
-<p>When <code>-dDownScaleFactor=</code> is used in 8 bit mode with the <code>tiffsep</code>
-(and <code>psdcmyk</code>/<code>psdrgb</code>/<code>psdcmyk16</code>/<code>psdrgb16</code>)
-device(s) 2 additional &quot;special&quot; ratios
-are available, 32 and 34. 32 provides a 3:2 downscale (so from 300 to
-200 dpi, say). 34 produces a 3:4 upscale (so from 300 to 400 dpi, say).</p>
-
-<p>In commercial builds, with 8 bit per component output, the <code>-dDeskew</code> option
-can be used to automatically detect/correct skew when generating output bitmaps.</p>
-
-<p>The <code>tiffscaled</code> and <code>tiffscaled4</code> devices
-can optionally use Even Toned Screening, rather than simple Floyd Steinberg
-error diffusion. This patented technique gives better quality at the
-expense of some speed. While the code used has many quality tuning
-options, none of these are currently exposed. Any device author
-interested in trying these options should contact Artifex for more
-information. Currently ETS can be enabled using -dDownScaleETS=1.</p>
-
-</dd>
-<dt><a name="tiffsep1"></a><code>tiffsep1</code></dt>
-<dd>
-The <code>tiffsep1</code> device creates multiple output files, one for each component
-or separation color. The device creates multiple tiffg4 files (the compression
-can be set using -sCompression= described below). The 1 bit per component
-output is halftoned using the current screening set by 'setcolorscreen'
-or 'sethalftone' which allows for ordered dither or stochastic threshold
- array dither to be used. This is faster than error diffusion.
-
-<p>
-The file specified via the OutputFile command line parameter will not be
-created (it is opened, but deleted prior to finishing each page).</p>
-
-<p>
-File names for the separations for the CMYK colorants are created by appending
-'(Cyan).tif', '(Magenta).tif' '(Yellow).tif' or '(Black).tif' to the to the
-end of the file name specified via the OutputFile parameter. File names
-for the spot color separation files are created by appending the Spot color
-name in '(' and ').tif' to the filename.
-If the file name specified via the OutputFile parameter ends with the suffix
-'.tif', then the suffix is removed prior to adding the component name in
-'(' and ').tif'.</p>
-</dd>
-
-<dt><a name="tiffscaled"></a><code>tiffscaled</code></dt>
-<dd>
-The <code>tiffscaled</code> device renders internally at the specified resolution to an
-8 bit greyscale image. This is then scaled down by an integer scale factor
-(set by <code>-dDownScaleFactor=</code> described below) and then error diffused to give
-1bpp output. The compression can be set using -sCompression= as described
-below.</dd>
-
-
-<dt><a name="tiffscaled4"></a><code>tiffscaled4</code></dt>
-<dd>
-The <code>tiffscaled4</code> device renders internally at the specified resolution to an
-8 bit cmyk image. This is then scaled down by an integer scale factor
-(set by <code>-dDownScaleFactor</code>= described below) and then error diffused to give
-4bpp cmyk output. The compression can be set using -sCompression= as described
-below.</dd>
-
-<dt><a name="tiffscaled8"></a><code>tiffscaled8</code></dt>
-<dd>
-The <code>tiffscaled8</code> device renders internally at the specified resolution to an
-8 bit greyscale image. This is then scaled down by an integer scale factor
-(set by <code>-dDownScaleFactor</code>= described below). The compression can be set using
--sCompression= as described below.</dd>
-
-<dt><a name="tiffscaled24"></a><code>tiffscaled24</code></dt>
-<dd>
-The <code>tiffscaled24</code> device renders internally at the specified resolution to a
-24 bit rgb image. This is then scaled down by an integer scale factor
-(set by <code>-dDownScaleFactor</code>= described below). The compression can be set using
--sCompression= as described below.
-
-<p>In commercial builds, the <code>-dDeskew</code> option can be used to automatically detect/correct skew when generating output bitmaps.</p>
-</dd>
-<dt><a name="tiffscaled32"></a><code>tiffscaled32</code></dt>
-<dd>
-The <code>tiffscaled32</code> device renders internally at the specified resolution to a
-32 bit cmyk image. This is then scaled down by an integer scale factor
-(set by <code>-dDownScaleFactor</code>= described below). The compression can be set using
--sCompression= as described below.
-
-<p>In commercial builds, the <code>-dDeskew</code> option can be used to automatically detect/correct skew when generating output bitmaps.</p>
-</dd>
-</dl>
-</blockquote>
-
-<p>
-The remaining TIFF drivers all produce black-and-white output with different
-compression modes:</p>
-
-<blockquote>
-<dl>
-<dt><code>tiffcrle</code></dt>
-<dd>G3 fax encoding with no EOLs</dd>
-<dt><code>tiffg3</code></dt>
-<dd>G3 fax encoding with EOLs</dd>
-<dt><code>tiffg32d</code></dt>
-<dd>2-D G3 fax encoding</dd>
-<dt><code>tiffg4</code></dt>
-<dd>G4 fax encoding</dd>
-<dt><code>tifflzw</code></dt>
-<dd>LZW-compatible (tag = 5) compression</dd>
-<dt><code>tiffpack</code></dt>
-<dd>PackBits (tag = 32773) compression</dd>
-</dl>
-</blockquote>
-
-<p>See the <code>AdjustWidth</code> option documentation below for important
-information about these devices.</p>
-
-<h4>Options</h4>
-
-<p>
-All TIFF drivers support creation of files that are comprised of more than a
-single strip. Multi-strip files reduce the memory requirement on the reader,
-since readers need only store and process one strip at a time. The
-<code>MaxStripSize</code> parameter controls the strip size:</p>
-
-<blockquote>
-<dl>
-<dt><code>-dMaxStripSize=<em>N</em></code> (non-negative integer; default = 8192)</dt>
-<dd>Set the maximum (uncompressed) size of a strip.</dd>
-</dl>
-</blockquote>
-
-<p>
-The TIFF 6.0 specification, Section 7, page 27, recommends that the size of
-each strip be about 8 Kbytes.</p>
-
-<p>
-If the value of the <code>MaxStripSize</code> parameter is smaller than a
-single image row, then no error will be generated, and the TIFF file will be
-generated correctly using one row per strip. Note that smaller strip sizes
-increase the size of the file by increasing the size of the StripOffsets and
-StripByteCounts tables, and by reducing the effectiveness of the compression
-which must start over for each strip.</p>
-
-<p>
-If the value of MaxStripSize is 0, then the entire image will be a single strip.</p>
-
-
-<p>
-Since v. 8.51 the logical order of bits within a byte, FillOrder, tag = 266 is
-controlled by a parameter:</p>
-
-<blockquote>
-<dl>
-<dt><code>-dFillOrder=<em>1 | 2 </em></code> (default = 1)</dt>
-<dd>If this option set to 2 then pixels are arranged within a byte such that pixels
-with lower column values are stored in the lower-order bits of the byte; otherwise
-pixels are arranged in reverse order.</dd>
-</dl></blockquote>
-
-<p>Earlier versions of Ghostscript always generated TIFF files with FillOrder = 2.
-According to the TIFF 6.0 specification, Section 8, page 32, support of
-FillOrder = 2 is not required in a Baseline TIFF compliant reader</p>
-
-<p>
-The writing of BigTIFF format output files is controlled with the
-<code>-dUseBigTIFF</code> parameter.</p>
-<p>
-Unfortunately, due the unpredictable size of compressed output, we cannot
-automate the selection of BigTIFF, using it only when the output file
-grows large enough to warrant it.</p>
-
-<blockquote>
-<dl>
-<dt><code>-dUseBigTIFF(=<em>false/true</em>)</code> (boolean, default: false)</dt>
-<dd>Force use (or not) of BigTIFF format in output from TIFF devices</dd>
-</dl>
-</blockquote>
-
-<p>
-The writing of the DateTime TAG can be controlled using the
-<code>-dTIFFDateTime</code> parameter.</p>
-
-<blockquote>
-<dl>
-<dt><code>-dTIFFDateTime(=<em>true/false</em>)</code> (boolean, default: true)</dt>
-<dd>Write or otherwise the DateTime TAG to the TIFF output file. Thus to disable
-writing the TAG, use: <code>-dTIFFDateTime=false</code></dd>
-</dl>
-</blockquote>
-
-<p>
-The compression scheme that is used for the image data can be set for all tiff
-devices with:</p>
-
-<blockquote>
- <dl>
- <dt><code>-sCompression=<em>none | crle | g3 | g4 | lzw | pack</em></code></dt>
- <dd>Change the compression scheme of the tiff device.
- <code>crle</code>, <code>g3</code>, and <code>g4</code> may only be
- used with 1 bit devices (including <code>tiffsep1</code>).</dd>
- </dl>
-</blockquote>
-
-<p>
-For the <code>tiffsep</code> device, it changes the compression scheme
-of the separation files and composite cmyk file (which is
-<code>lzw</code> by default). It defaults to <code>g4</code> for the
-<code>tiffsep1</code> device.</p>
-
-<p>
-The black-and-white TIFF devices also provide the following parameters:</p>
-
-<blockquote><dl>
-<dt><code>-dAdjustWidth=<em>state</em></code> (0, 1, or value; default = 1)</dt>
-<dd>If this option is 1 then if the requested page width is in the range
-of either 1680..1736 or 2000..2056 columns, set the page width to A4
-(1728 columns) or B4 (2048 columns) respectively. If this option is set
-to a value &gt;1 then the width is unconditionally adjusted to this value.</dd>
-
-<dd>This behavior is the default for all the fax based devices (i.e. all the black
-and white devices except <code>tifflzw</code>, <code>tiffpack</code> and
-<code>tiffscaled</code>). Pass <code>-dAdjustWidth=0</code> to force this behaviour
-off.</dd>
-
-<dd>When using this option with <code>tiffscaled</code> it is the downsampled size
-that triggers the adjustment.</dd>
-
-<dt><code>-dMinFeatureSize=<em>state</em></code> (0 to 4; default = 1)</dt>
-<dd>This option allows a minimum feature size to be set; if any output pixel
-appears on its own, or as part of a group of pixels smaller than
-<code>MinFeatureSize</code> x <code>MinFeatureSize</code>, it will be expanded to
-ensure that it does. This is useful for output devices that are high
-resolution, but that have trouble rendering isolated pixels.</dd>
-
-<dd>While this parameter will accept values from 0 to 4, not all are fully
-implemented. 0 and 1 cause no change to the output (as expected). 2 works
-as specified. 3 and 4 currently expand pixels correctly horizontally, but
-only expand vertically to the 2 pixel size.</dd>
-
-<dd>The mechanism by which <code>MinFeatureSize</code> is implemented for
-<code>tiffscaled</code> is different, in that it is done as part of the error
-diffusion. Values of 0 to 2 work as expected, but values 3 and 4 (while
-accepted for compatibility) will behave as for 2.</dd>
-
-</dl></blockquote>
-
-<p>
-The <code>tiffscaled</code>, <code>tiffscaled4</code>, <code>tiffscaled8</code>,
-<code>tiffscaled24</code> and <code>tiffscaled32</code> TIFF
-drivers also provide the following two parameters:</p>
-
-<blockquote><dl>
-<dt><code>-dDownScaleFactor=<em>factor</em></code> (integer <= 8; default = 1)</dt>
-<dd>If this option set then the page is downscaled by the given factor on both
-axes before error diffusion takes place. For example rendering with
-<code>-r600</code> and then specifying <code>-dDownScaleFactor=3</code> will produce
-a 200dpi image.</dd>
-</dl></blockquote>
-
-<blockquote><dl>
-<dt><code>-sPostRenderProfile=<em>path</em></code> (path to an ICC profile)</dt>
-<dd>If this option set then the page will be color transformed using that
-profile <b>after</b> downscaling.
-<p>
-This is useful when the file uses overprint to separately paint to some
-subset of the C, M, Y, and K colorants, but the final CMYK is to be color
-corrected for printing or display.</p>
-</dd>
-</dl></blockquote>
-
-<p>
-The <code>tiffsep</code> TIFF device also provide this parameter:</p>
-
-<blockquote><dl>
-<dt><code>-dPrintSpotCMYK=<em>boolean</em></code> defaults to false. When set to true
-the device will print (to stdout) the name of each ink used on the page, and the CMYK
-values which are equivalent to 100% of that ink. The values are 16-bits ranging from 0
-to 32760.</dt><dd></dd>
-</dl></blockquote>
-
-<a name="TIFF_trapping"></a>
-<p>The <code>tiffsep</code> device (along with the <code>tiffscaled32</code> and
-<code>psdcmyk</code> devices) can perform rudimentary automatic bitmap
-'trapping' on the final rendered bitmap. This code is disabled by default; see
-the <a href="#trapping_patent_note">note</a> below as to why.</p>
-
-<p>Trapping is a process whereby the output is adjusted to minimise the
-visual impact of offsets between each printed plane. Typically this involves
-slightly extending abutting regions that are rendered in different inks. The
-intent of this is to avoid the unsightly gaps that might be otherwise be
-revealed in the final printout if the different color plates do not exactly
-line up.</p>
-
-<p>This trapping is controlled by 3 device parameters. Firstly the maximum
-X and Y offsets are specified using <code>-dTrapX=N</code> and <code>-dTrapY=N</code>
-(where <code>N</code> is a figure in pixels, before the downscaler is applied).</p>
-
-<p>The final control is to inform the trapping process in what order inks
-should be processed, from darkest to lightest. For a typical CMYK device
-this order would be [ 3 1 0 2 ] (K darker than M darker than C darker than Y).
-This is the default. In the case where CMYK + spots are used, the code
-defaults to assuming that the spots are lighter than the standard colours
-and are sent darkest first (thus [ 3 1 0 2 4 5 6 ... ]).</p>
-
-<p>To override these defaults, the <code>TrapOrder</code> parameter can be used, for
-example:</p>
-
-<blockquote><code>
- gs -sDEVICE=psdcmyk -dTrapX=2 -dTrapY=2 -o out.psd -c "&lt;&lt; /TrapOrder [ 4 5 3 1 0 2 ] &gt;&gt; setpagedevice" -f examples\tiger.eps
-</code></blockquote>
-
-<h4><a name="trapping_patent_note"></a>Trapping patents</h4>
-
-<p>Trapping is an technology area encumbered by many patents. We
-believe that the last of these has now lapsed, and so have enabled
-the code by default.</p>
-
-<h3><a name="fax"></a>FAX</h3>
-
-<p>
-Ghostscript supports a variety of fax encodings, both encapsulated in
-<acronym>TIFF</acronym> (see above) and as raw files. The later case is
-described here.
-</p>
-
-<p>
-The fax devices are <code>faxg3</code>, <code>faxg32d</code> and <code>faxg4</code>.
-</p>
-
-<p>
-The fax devices support the <code>MinFeatureSize</code> parameter as defined in
-the TIFF device section.
-</p>
-
-<h3><a name="BMP"></a>BMP</h3>
-
-<p>
-BMP is a simple uncompressed image format commonly used on MS Windows.
-It is supported by the devices <code>bmpmono bmpgray bmpsep1
- bmpsep8 bmp16 bmp256 bmp16m bmp32b</code>.
-</p>
-
-<h3><a name="PCX"></a>PCX</h3>
-
-<p>
-PCX is an image format sometimes used on MS Windows. It has some support
-for image compression and alternate color spaces, and so can be a useful
-way to output CMYK.
-It is supported by the <code>pcxmono pcxgray pcx16 pcx256 pcx24b pcxcmyk</code>
-series of devices.
-</p>
-
-<h3><a name="PSD"></a>PSD</h3>
-
-<p>
-PSD is the image format used by Adobe Photoshop.
-It is supported by the <code>psdcmyk</code>, <code>psdrgb</code>
-<code>psdcmyk16</code> and <code>psdrgb16</code> devices.
-Of special interest with the <code>psdcmyk</code> and <code>psdcmyk16</code> devices is that they support spot
-colors. <a href="#tiffsep">See the comments under the <code>tiffsep</code> and <code>tiffsep1</code>
-device about the maximum number of spot colors supported by Ghostscript</a></p>
-<p>
-The <code>psdcmyk16</code> and <code>psdrgb16</code> devices are essentially the same
-as the <code>psdcmyk</code> and <code>psdrgb</code> devices except they provide 16 bit output.
-</p>
-<p>
-The <code>psdcmykog</code> device produces PSD files with 6 components:
-Cyan, Magenta, Yellow, blacK, Orange, and Green. This device does not support the -dDownScaleFactor=
-option (see below), instead it always scales down by a factor of two.</p>
-
-<p>
-These devices support the same -dDownScaleFactor= ratios as <code>tiffsep</code>.
-The <code>psdcmyk</code> device supports the same trapping options as <code>tiffsep</code>
-(but see <a href="#trapping_patent_note">this note</a>).</p>
-
-<p>
-NOTE: The PSD format is a single image per file format, so you must use the &quot%d&quot
-format for the &quotOutputFile&quot (or &quot-o&quot) file name parameter (see
-<a href="Use.htm#One_page_per_file">One_page_per_file</a> for details). An attempt
-to output multiple pages to a single PSD file (i.e. without the &quot%d&quot format) will
-result in an <code>ioerror</code> Postscript error.</p>
-
-<p>In commercial builds, for the <code>psdcmyk</code> and <code>psdrgb</code> devices, the <code>-dDeskew</code> option can be used to automatically detect/correct skew when generating output bitmaps.</p>
-
-<h3><a name="PDFimage"></a>PDF image output</h3>
-
-<p>
-These devices render input to a bitmap (or in the case of PCLm multiple bitmaps) then wraps
-the bitmap(s) up as the content of a PDF file. For PCLm there are some additional rules regarding
-headers, extra content and the order in which the content is written in the PDF file.
-</p>
-<p>
-The aim is to support the PCLm mobile printing standard, and
-to permit production of PDF files from input where the graphics
-model differs significantly from PDF (eg PCL and RasterOPs).
-</p>
-<p>
-There are five devices named pdfimage8, pdfimage24, pdfimage32, pclm and pclm8. These produce valid
-PDF files with a colour depth of 8 (Gray), 24 (RGB) or 32 (CMYK), the pclm device only supports 24-bit RGB
-and the pclm8 device only supports 8-bit gray.
-These are all implemented as 'downscale' devices, which means they can implement page level
-anti-aliasing using the <code>-dDownScaleFactor</code> switch.
-</p>
-
-<blockquote>
-<dl>
-<dt><code>-dDownScaleFactor=</code><b><em>integer</em></b></dt>
-<dd>This causes the internal rendering to be scaled down by the given (integer <= 8) factor before being output. For example, the following will produce
- a PDF containing a 200dpi output from a 600dpi internal rendering:</dd></dl>
-<blockquote>
-<pre>
- <kbd>gs -sDEVICE=pdfimage8 -r600 -dDownScaleFactor=3 -o tiger.pdf\
- examples/tiger.eps</kbd>
-</pre>
-</blockquote>
-</blockquote>
-
-<p>In commercial builds, the <code>-dDeskew</code> option can be used to automatically detect/correct skew when generating the output file.</p>
-
-<p>
-The type of compression used for the image data can also be selected using the <code>-sCompression</code> switch.
-Valid compression types are <code>None</code>, <code>LZW</code>, <code>Flate</code>, <code>JPEG</code>
-and <code>RLE</code>.Note that LZW is not supported on PCLm (not valid) and None is only supported
-on PCLm for debugging purposes.
-</p>
-<p>
-For JPEG compression the devices support both the JPEGQ and QFactor switches as documented for the <a href="#JFIF">JPEG</a> file format device.
-</p>
-<p>
-In addition, the PCLm device supports some other parameters. Firstly, the
-<code>-dStripHeight</code> switch to set the vertical height
-of the strips of image content, as required by the specification.
-</p>
-<p>Secondly, the standard postscript <code>-dDuplex</code> and
-<code>-dTumble</code>switches are supported, in that if both are
-set to true, every verso page (i.e. all even pages) will be
-rotated by 180 degrees.</p>
-
-<p>As an extension to this, a <code>-dTumble2</code> parameter is
-also supported that will add an additional X-axis flip for every
-verso page. Thus <code>-dDuplex=true -dTumble=false -dTumble2=true</code>
-will result in verso pages being flipped horizontally, and
-<code>-dDuplex=true -dTumble=true -dTumble2=true</code> will result
-in verso pages being flipped vertically.</p>
-
-<hr>
-
-<p>
-In addition to raster image files, Ghostscript supports output in a number
-of 'high-level' formats. These allow Ghostscript to preserve (as much as
-possible) the drawing elements of the input file maintaining flexibility,
-resolution independence, and editability.</p>
-
-<hr>
-
-<h2><a name="OCR-Devices"></a>Optical Character Recognition (OCR) devices</h2>
-
-<h3><a name="OCR"></a>OCR text output</h3>
-
-<p>
- These devices render internally in 8 bit greyscale, and then
- feed the resultant image into an OCR engine. Currently, we
- are using the Tesseract engine. Not only is this both free
- and open source, it gives very good results, and supports
- a huge number of languages/scripts.
-</p>
-<p>
- The Tesseract engine relies on files to encapsulate each
- language and/or script. These &quot;traineddata&quot; files
- are available in different forms, including <a href="http://github.com/tesseract-ocr/tessdata_fast">fast</a>
- and <a href="http://github.com/tesseract-ocr/tessdata_best">best</a> variants.
- Alternatively, people can train their own data using the
- standard Tesseract tools.
-</p>
-<p>
- These files are looked for from a variety of places.
-</p>
-<ul>
- <li>Firstly, files will be searched for in the directory given by the
- environment variable TESSDATA_PREFIX.
- <li>Next, they will be searched for within the ROM filing system. Any
- files placed in &quot;tessdata&quot; will be included within the ROM
- filing system in the binary for any standard (COMPILE_INITS=1) build.
- <li>Next, files will be searched for in the configured 'tessdata' path. On
- Unix, this can be specified at the configure stage using
- '--with-tessdata=&lt;path&gt;' (where &lt;path&gt; is a list of
- directories to search, separated by ':' (on Unix) or ';' (on Windows)).
- <li>Finally, we resort to searching the current directory.
-</ul>
-<p>
- Please note, this pattern of directory searching differs from the original
- release of the OCR devices.
-</p>
-<p>
- By default, the OCR process defaults to looking for English text,
- using &quot;eng.traineddata&quot;. This can be changed by using the
- <code>-sOCRLanguage=</code> switch;
-</p>
-<blockquote>
-<dl>
-<dt><code>-sOCRLanguage=</code><b><em>language</em></b></dt>
-<dd>This sets the trained data sets to use within the Tesseract
- OCR engine. For example, the following will use English and
- Arabic:</dd></dl>
-<blockquote>
-<pre>
- <kbd>gs -sDEVICE=ocr -r200 -sOCRLanguage="eng+ara" -o out.txt\
- zlib/zlib.3.pdf</kbd>
-</pre>
-</blockquote>
-</blockquote>
-<p>
- The first device is named ocr. It extracts data as unicode codepoints
- and outputs them to the device as a stream of UTF-8 bytes.
-</p>
-<p>
- The second device is named hocr. This extracts the data in
- <a href="wikipedia.org/wiki/HOCR">hOCR</a> format.
-</p>
-<p>
- These devices are implemented as downscaling devices, so the
- standard parameters can be used to control this process. It
- may seem strange to use downscaling on an image that is not
- actually going to be output, but there are actually good reasons
- for this. Firstly, the higher the resolution, the slower the
- OCR process. Secondly, the way the Tesseract OCR engine works
- means that anti-aliased images perform broadly as well as the
- super-sampled image from which it came.
-</p>
-
-<h3><a name="PDFocr"></a>PDF image output (with OCR text)</h3>
-
-<p>
- These devices do the same render to bitmap and wrap as a PDF process as
- the <a name="PDFimage">PDFimage</a> devices above, but with the addition
- of an OCR step at the end. The OCR'd text is overlaid &quot;invisibly&quot;
- over the images, so searching and cut/paste should still work.
-</p>
-<p>
- The OCR engine being used is Tesseract. For information on this
- including how to control what language data is used, see the <a href="OCR">
- OCR devices</a> section above.
-</p>
-<p>
- There are three devices named pdfocr8, pdfocr24 and pdfocr32. These
- produce valid PDF files with a colour depth of 8 (Gray), 24 (RGB) or
- 32 (CMYK).
-</p>
-<p>
- These devices accept all the same flags as the <a name="PDFimage">PDFimage</a>
- devices described above.
-</p>
-<p>
-
-<h3><a name="PDFwriteocr"></a>Vector PDF output (with OCR Unicode CMaps)</h3>
-<p>
-The pdfwrite device has been augmented to use the OCR engine to analyse text
-(not images!) in the input stream, and derive Unicode code points for it.
-That information can then be used to create ToUnicode CMaps which are attached
-to the Font (or CIDFont) objects embedded in the PDF file.
-</p>
-<p>
-Fonts which have ToUnicode CMaps can be reliably (limited by the accuracy of
-the CMap) used in search and copy/paste functions, as well as text extraction
-from PDF files. Note that OCR is not a 100% perfect process; it is possible
-that some text might be misidentified.
-</p>
-<p>
-OCR is a slow operation! In addition it can (for Latin text at least) sometimes
-be preferable not to add ToUnicode information which may be incorrect, but instead
-to use the existing font Encoding. For English text this may give better results.
-</p>
-<p>For these reasons the OCR functionality of pdfwrite can be controlled by using a new
-parameter <code>-sUseOCR</code>. This has three possible values;
-</p>
-<dl>
-<dt><code>-sUseOCR=</code><b><em>string</em></b></dt>
-
- <dt>Never</dt><dd>Default - don't use OCR at all even if support is built-in.</dd>
- <dt>AsNeeded</dt><dd>If there is no existing ToUnicode information, use OCR.</dd>
- <dt>Always</dt><dd>Ignore any existing information and always use OCR.</dd>
-
-</dl>
-</p>
-
-<hr>
-
-<h2><a name="High-level"></a>High-level devices</h2>
-
-<h3><a name="PDF"></a>PDF writer</h3>
-
-<p>The <code>pdfwrite</code> device outputs PDF.</p>
-
-<h3><a name="PS"></a>PS2 writer</h3>
-
-<p>The <code>ps2write</code> device outputs postscript language level 2.
-It is recommnded that this device is used for PostScript output.
-There is no longer any support for creating PostScript level 1 output.</p>
-
-<h3><a name="EPS"></a>EPS writer</h3>
-
-<p>The <code>eps2write</code> device outputs encapsulated postscript.</p>
-<h3><a name="PXL"></a>PXL</h3>
-
-<p>The <code>pxlmono</code> and <code>pxlcolor</code> devices output HP PCL-XL,
-a graphic language understood by many recent laser printers.</p>
-
-
-<h3><a name="TXT"></a>Text output</h3>
-
-<p> The txtwrite device will output the text contained in the original
-document as Unicode.</p>
-
-<p> Please refer to
-<a href="VectorDevices.htm">VectorDevices.htm</a> for documentation on the
-device options for these devices.
-</p>
-
-<hr>
-
-<h2><a name="Display_devices"></a>Display Devices</h2>
-
-<p>
-Ghostscript is often used for screen display of postscript and pdf documents.
-In many cases, a client or 'viewer' application calls the Ghostscript engine
-to do the rasterization and handles the display of the resulting image itself,
-but it is also possible to invoke Ghostscript directly and select an output
-device which directly handles displaying the image on screen.</p>
-
-<p>
-This section describes the various display-oriented devices that are available
-in Ghostscript.</p>
-
-<h3><a name="x11_devices"></a>X Window System</h3>
-
-<p>
-Perhaps the most common use of of a display device is with the X Window System
-on unix-like systems. It is the default device on the command line client on
-such systems, and is used more creatively by the gv client application.</p>
-
-<p>
-The available devices are:</p>
-
-<dl>
-<dt><b>x11</b></dt>
-<dd>This is the default device, handling display on X11R6.</dd>
-
-<dt><b>x11alpha</b></dt>
-<dd>This is the <code>x11</code> device, but with antialiasing. It is equivalent to
-invoking the <code>x11</code> device with the options <code>-dGraphicsAlphaBits=4
--dTextAlphaBits=4 -dMaxBitmap=50000000</code>.</dd>
-
-<dt><b>x11cmyk</b></dt>
-<dd>This device rasterizes the image in the CMYK color space, then flattens
-it to RGB for display. It's intended for testing only.</dd>
-
-<dt><b>x11mono</b></dt>
-<dd>This is a strict black-and-white device for 1-bit monochrome displays.</dd>
-
-<dt><b>x11gray2</b></dt>
-<dd>This is a device for 2 bpp (4-level) monochrome displays.</dd>
-
-<dt><b>x11gray4</b></dt>
-<dd>This is a device for 4 bpp (16-level) monochrome displays.</dd>
-</dl>
-
-<p>On Mac OS X as of 10.6, the X server (XQuartz) only supports color depth
-15 and 24. Depth 15 isn't well-tested, and it may be desirable, for serious
-use, to switch to depth 24 with:</p>
-
-<blockquote><code>
-defaults write org.x.X11 depth 24
-</code></blockquote>
-
-<h3><a name="display_device"></a>display device (MS Windows, OS/2, gtk+)</h3>
-<p>
-The <code>display</code> device is used by the MS Windows,
-OS/2 and the gtk+ versions of ghostscript.
-</p>
-
-<h4>Options</h4>
-
-<p>The display device has several user settable options.</p>
-
-<blockquote>
-<dl>
-<dt><code>-dDisplayFormat=</code><b><em>N</em></b> (integer bit-field)</dt>
-<dd>Some common values are 16#30804 for Windows RGB, 16#804 for gtk+ RGB,
-16#20101 for Windows monochrome, 16#102 for gtk+ monochrome,
-16#20802 grayscale, 16#20808 for CMYK, 16#a0800 for separations.
-<p>
-The bit fields are:
-</p>
-<ul>
-<li> native (1), gray (2), RGB (4), CMYK (8), or separation (80000)
-color spaces.</li>
-<li> unused first byte (40) or last byte (80).</li>
-<li> 1 (100), 4 (400), or 8 (800) bits/component.</li>
-<li> bigendian (00000 = RGB) or littleendian (10000 = BGR) order.</li>
-<li> top first (20000) or bottom first (00000) raster.</li>
-<li> 16 bits/pixel with 555 (00000) or 565 (40000) bitfields.</li>
-</ul>
-<p>For more details, see the <a href="API.htm#display">Ghostscript
-Interpreter API.</a></p>
-</dd>
-<dt><code>-dDisplayResolution=</code><b><em>DPI</em></b></dt>
-<dd>Set the initial resolution resolution for the display device.
-This is used by the Windows clients to set the display device
-resolution to the Windows display logical resolution.
-This can be overriden by the command line option
-<code>-r<em>DPI</em></code>.</dd>
-</dl>
-
-</blockquote>
-
-<p>When using the separation color space, the following options may be set
-using setpagedevice, as described in the PostScript Language Reference:</p>
-
-<blockquote>
-<dl>
-<dt><code>SeparationColorNames</code></dt>
-<dd>An array giving the names of the spot colors</dd>
-
-<dt><code>SeparationOrder</code></dt>
-<dd>An array giving the names and order of the colorants
- to be output.</dd>
-</dl>
-</blockquote>
-
-
-<hr>
-
-<h2><a name="IJS"></a>IJS - Inkjet and other raster devices</h2>
-
-<p>
-IJS is a relatively new initiative to improve the quality and ease of
-use of inkjet printing with Ghostscript. Using IJS, you can add new
-drivers, or upgrade existing ones, without recompiling Ghostscript.
-All driver authors are encouraged to adapt their drivers for IJS, and
-if there is an IJS driver available for your printer, it should be
-your first choice.
-</p>
-
-<p>Please see the <a href="http://www.linuxprinting.org/ijs/">IJS web
-page</a> for more information about IJS, including a listing of
-IJS-compatible drivers.
-</p>
-
-<p>
-A typical command line for IJS is:
-</p>
-
-<blockquote>
-<code>
-gs -dSAFER -sDEVICE=ijs -sIjsServer=hpijs
- -sDeviceManufacturer=HEWLETT-PACKARD -sDeviceModel='DESKJET 990'
- -dIjsUseOutputFD -sOutputFile=/dev/usb/lp1 -dNOPAUSE --
- examples/tiger.eps
-</code>
-</blockquote>
-
-
-<p>
-Individual IJS command line parameters are as follows:
-</p>
-
-<dl>
-<dt><code>-sIjsServer=</code><em>{path}</em></dt>
-<dd>Sets the pathname for the IJS server (ie printer driver).
-Ghostscript will spawn a new process for this driver, and communicate
-with it using the IJS protocol. The pathname need not be absolute,
-as the PATH environment variable is searched, but it's probably a good
-idea for robustness and security. Note also that if -dSAFER is not
-specified, it's possible for PostScript code to set this parameter,
-so it can cause arbitrary code to be executed. See the section on <a
-href="Use.htm#Security">Security</a> for more information.</dd>
-</dl>
-
-<dl>
-<dt><code>-sDeviceManufacturer=</code><em>{name}</em></dt>
-<dt><code>-sDeviceModel=</code><em>{name}</em></dt>
-<dd>These parameters select the device according to IEEE-1284 standard
-device ID strings. In general, consult the documentation for the
-driver to find the appropriate settings. Note that, if the value
-contains a space, you'll want to quote the value in your shell, as
-in the example above.</dd>
-</dl>
-
-<dl>
-<dt><code>-sIjsParams=</code><em>{params}</em></dt>
-<dd>This parameter allows you to set arbitrary IJS parameters on
-the IJS driver. The format is a comma-separated list of
-<code>key=value</code> pairs. If it is necessary to send a
-value containing a comma or backslash, it can be escaped with
-a backslash. Thus, <code>'-sIjsParams=Foo=bar,Baz=a\,b'</code> sets
-the parameter Foo to "bar", and Baz to "a,b".</dd>
-</dl>
-
-<dl>
-<dt><code>-dIjsUseOutputFD</code></dt>
-<dd>This flag indicates that Ghostscript should open the output file
-and pass a file descriptor to the server. If not set, Ghostscript
-simply passes the filename set in OutputFile to the server. In most
-cases, this flag won't matter, but if you have a driver which works
-only with OutputFD (such as hpijs 1.0.2), or if you're using the
--sOutputFile="|cmd" syntax, you'll need to set it.</dd>
-</dl>
-
-<dl>
-<dt><code>-dBitsPerSample=</code><em>N</em></dt>
-<dd>This parameter controls the number of bits per sample. The
-default value of 8 should be appropriate for most work. For monochrome
-images, use -dBitsPerSample=1.</dd>
-</dl>
-
-<p>Generic Ghostscript options that are particularly relevant for IJS
-are summarized below:
-</p>
-
-<dl>
-<dt><code>-r</code><em>number</em></dt>
-<dt><code>-r</code><em>number1</em><code>x</code><em>number2</em></dt>
-<dd>Sets the resolution, in dpi. If the resolution is not specified,
-Ghostscript queries the IJS server to determine the preferred resolution.
-When the resolution is specified, it overrides the value (if any)
-preferred by the IJS server.</dd>
-</dl>
-
-<dl>
-<dt><code>-dDuplex</code></dt>
-<dt><code>-dTumble</code></dt>
-<dd>These flags enable duplex (two-sided) printing. Tumble controls
-the orientation. When Tumble is false, the pages
-are oriented suitably at the left or right. When Tumble is true,
-the pages are oriented suitably for binding at the top or
-bottom.</dd>
-</dl>
-
-<dl>
-<dt><code>-sProcessColorModel=</code><em>{name}</em></dt>
-<dd>Use this flag to select the process color model. Suitable values
-include DeviceGray, DeviceRGB, and DeviceCMYK.</dd>
-</dl>
-
-<h3>Building IJS</h3>
-
-<p> IJS is included by default on Unix gcc builds, and also in
-autoconf'ed builds. Others may need some makefile tweaking. First,
-make sure the IJS device is selected:</p>
-
-<blockquote>
-DEVICE_DEVS2=&#36;(DD)ijs.dev
-</blockquote>
-
-<p> Next, make sure that the path and execution type are set in
-the top level makefile. The values for Unix are as follows:</p>
-
-<blockquote>
-IJSSRCDIR=ijs
-IJSEXECTYPE=unix
-</blockquote>
-
-<p> At present, "unix" and "win" are the only supported values for
-IJSEXECTYPE. If neither sounds appropriate for your system, it's
-possible that more porting work is needed.</p>
-
-<p> Last, make sure that ijs.mak is included in the top level makefile.
-It should be present right after the include of icclib.mak.</p>
-
-<p> IJS is not inherently platform-specific. We're very much interested
-in taking patches from people who have ported it to non-mainstream
-platforms. And once it's built, you won't have to recompile Ghostscript
-to support new drivers!</p>
-<hr>
-<h2><a name="Rinkj"></a>Rinkj - Resplendent inkjet driver</h2>
-
-<p>The Rinkj driver is an experimental new driver, capable of driving
-some Epson printers at a very high level of quality. It is not
-currently recommended for the faint of heart.</p>
-
-<p>You will need to add the following line to your makefile:</p>
-
-<blockquote>
-DEVICE_DEVS2=&#36;(DD)rinkj.dev
-</blockquote>
-
-<p>Most of the configuration parameters, including resolution, choice
-of printer model, and linearization curves, are in a separate setup
-file. In addition, we rely heavily on an ICC profile for mapping
-document colors to actual device colors.</p>
-
-<p>A typical command line invocation is:</p>
-
-<blockquote><code>
-gs -r1440x720 -sDEVICE=rinkj -sOutputFile=/dev/usb/lp0
- -sSetupFile=lib/rinkj-2200-setup -sProfileOut=2200-cmyk.icm
- -dNOPAUSE -dBATCH file.ps
-</code></blockquote>
-
-<p>
-Individual Rinkj command line parameters are as follows:
-</p>
-
-<dl>
-<dt><code>-sSetupFile=</code><em>{path}</em></dt>
-<dd>Specifies the path for the setup file.</dd>
-
-<dt><code>-sProfileOut=</code><em>{path}</em></dt>
-<dd>Specifies the path for the output ICC profile. This profile should
-be a <i>link</i> profile, mapping the ProcessColorModel (DeviceCMYK by
-default) to the device color space.</dd>
-</dl>
-
-<p>For 6- and 7-color devices, the target color space for the output
-profile is currently a 4-component space. The conversion from this
-into the 6- or 7-color space (the "ink split") is done by lookup
-tables in the setup file.</p>
-
-<p>Setup files are in a simple "Key: value" text format. Relevant keys
-are:</p>
-
-<dl>
-<dt><code>Manufacturer:</code><em>{name}</em></dt>
-<dt><code>Model:</code><em>{name}</em></dt>
-<dd>The manufacturer and model of the individual device, using the
-same syntax as IEEE printer identification strings. Currently, the
-only supported manufacturer string is "EPSON", and the only supported
-model strings are "Stylus Photo 2200" and "Stylus Photo 7600".</dd>
-
-<dt><code>Resolution:</code><em>{x-dpi}</em>x<em>{y-dpi}</em></dt>
-<dd>The resolution in dpi. Usually, this should match the
-Ghostscript resolution set with the <code>-r</code> switch. Otherwise,
-the page image will be scaled.</dd>
-
-<dt><code>Dither:</code><em>{int}</em></dt>
-<dd>Selects among variant dither options. Currently, the choices are
-<code>1</code> for one-bit dither, and <code>2</code>, for a 2-bit variable
-dot dither.</dd>
-
-<dt><code>Aspect:</code><em>{int}</em></dt>
-<dd>Controls the aspect ratio for highlight dot placement. Valid
-values are <code>1</code>, <code>2</code>, and <code>4</code>. For best results,
-choose a value near the x resolution divided by the y resolution. For
-example, if resolution is 1440x720, aspect should be 2.</dd>
-
-<dt><code>Microdot:</code><em>{int}</em></dt>
-<dd>Chooses a microdot size. On EPSON devices, this value is passed
-directly through to the "ESC ( e" command. See EPSON documentation
-for further details (see, I <em>told</em> you this wasn't for the
-faint of heart).</dd>
-
-<dt><code>Unidirectional:</code><em>{int}</em></dt>
-<dd>Enables (1) or disables (0) unidirectional printing, which is
-slower but possibly higher quality.</dd>
-
-<dt><code>AddLut:</code><em>{plane}</em></dt>
-<dd>Adds a linearization look-up table. The plane is one of
-"CcMmYKk". The lookup table data follows. The line immediately
-following AddLut is the number of data points. Then, for each data
-point is a line consisting of two space-separated floats - the output
-value and the input value. If more than one LUT is specified for a
-single plane, they are applied in sequence.</dd>
-</dl>
-
-<p>A typical setup file is supplied in <code>lib/rinkj-2200-setup</code>.
-It is configured for the 2200, but can be adapted to the 7600 just by
-changing the "Model" line.</p>
-
-<p>A known issue with this driver is poor support for margins and
-page size. In some cases, this will cause an additional page to be
-ejected at the end of a job. You may be able to work around this by
-supplying a cut-down value for <code>-dDEVICEHEIGHTPOINTS</code>, for
-example 755 for an 8.5x11 inch page on the EPSON 2200.</p>
-<hr>
-<h2><a name="HP_ijs"></a>HP Deskjet official drivers</h2>
-
-<p>
-HP provides official drivers for many of their Deskjet printer models.
-In order to use these drivers, you will need the HP Inkjet Server as
-well as Ghostscript, available from <a
-href="http://hpinkjet.sourceforge.net">http://hpinkjet.sourceforge.net</a>.
-This version of Ghostscript includes the patch from version 0.97 of
-the hpijs software. If you are installing hpijs from an RPM, you will
-only need the hpijs RPM, not the Ghostscript-hpijs one, as the code
-needed to work with hpijs is already included.</p>
-
-<p>
-Note that newer version of the hpijs drivers support the IJS protocol.
-If you can, you should consider using the ijs driver instead. Among
-other things, the hpijs Ghostscript driver is Unix-only, and is untested
-on older Unix platforms.</p>
-
-<p>
-As of the 0.97 version, hpijs supports the following printer models:</p>
-
-<dl><dt><b>e-Series:</b></dt>
-<dd>e-20</dd>
-<dt><b>DeskJet 350C Series:</b></dt>
-<dd>350C</dd>
-<dt><b>DeskJet 600C Series:</b></dt>
-<dd>600C, 660C, 670/672C, 670TV, 680/682C</dd>
-<dt><b>DeskJet 600C Series Photo:</b></dt>
-<dd>610/612C, 640/648C, 690/692/693/694/695/697C</dd>
-<dt><b>DeskJet 630C Series:</b></dt>
-<dd>630/632C</dd>
-<dt><b>DeskJet 800C Series:</b></dt>
-<dd>810/812C, 830/832C, 840/842/843C, 880/882C, 895C</dd>
-<dt><b>DeskJet 900C Series, PhotoSmart::</b></dt>
-<dd>930/932C, 950/952C, 970C, PhotoSmart 1000/1100</dd>
-<dt><b>DeskJet 990C, PhotoSmart:</b></dt>
-<dd>960C, 980C, 990C, PhotoSmart 1215/1218</dd>
-
-</dl>
-
- <p>You will need to add the following line to your makefile:</p>
-
-<blockquote>
-DEVICE_DEVS2=&#36;(DD)DJ630.dev &#36;(DD)DJ6xx.dev &#36;(DD)DJ6xxP.dev &#36;(DD)DJ8xx.dev &#36;(DD)DJ9xx.dev &#36;(DD)DJ9xxVIP.dev &#36;(DD)AP21xx.dev
-</blockquote>
-
-<p>
-Please see <a
-href="http://hpinkjet.sourceforge.net">http://hpinkjet.sourceforge.net</a>
-for more information about this driver. Thanks to the folks at HP,
-especially David Suffield for making this driver available and working to
-integrate it with Ghostscript.
-</p>
-<hr>
-<h2><a name="gimp-print"></a>Gimp-Print driver collection</h2>
-
-<p>
-The Gimp-Print project provides a large collection of printer drivers
-with an IJS interface. Please see their
-<a href="http://gimp-print.sourceforge.net/" class="offsite">website</a>
-for details.
-</p>
-
-<hr>
-<h2><a name="Win"></a>MS Windows printers</h2>
-
-<p>
-This section was written by Russell Lang, the author of Ghostscript's
-MS&nbsp;Windows-specific printer driver, and updated by
-<a href="mailto:Pierre.Arnaud@opac.ch">Pierre Arnaud</a>,
-the current maintainer.
-</p>
-
-<p>
-The <code>mswinpr2</code> device uses MS&nbsp;Windows printer drivers, and
-thus should work with any printer with device-independent bitmap (DIB)
-raster capabilities. The printer resolution cannot be selected directly
-using PostScript commands from Ghostscript: use the printer setup in the
-Control Panel instead. It is however possible to specify a maximum resolution
-for the printed document (see below).
-</p>
-
-<p>
-If no Windows printer name is specified in <code>-sOutputFile</code>,
-Ghostscript prompts for a Windows printer using the standard Print Setup
-dialog box. You must set the orientation to Portrait and the page size to
-that expected by Ghostscript; otherwise the image will be clipped.
-Ghostscript sets the physical device size to that of the Windows printer
-driver, but it does not update the PostScript clipping path.
-</p>
-
-<p>
-If a Windows printer name is specified in <code>-sOutputFile</code> using
-the format <code>"%printer%printer_name"</code>, for instance
-</p>
-
-<blockquote><code>
-gs ... -sOutputFile="%printer%Apple LaserWriter II NT"
-</code></blockquote>
-
-<p>
-then Ghostscript attempts to open the Windows printer without prompting
-(except, of course, if the printer is connected to <code>FILE:</code>).
-Ghostscript attempts to set the Windows printer page size and orientation
-to match that expected by Ghostscript, but doesn't always succeed. It uses
-this algorithm:
-</p>
-
-<ol>
-<li>If the requested page size matches one of the Windows standard page
-sizes +/- 2mm, request that standard size.</li>
-
-<li>Otherwise if the requested page size matches one of the Windows
-standard page sizes in landscape mode, ask for that standard size in
-landscape.</li>
-
-<li>Otherwise ask for the page size by specifying only its dimensions.</li>
-
-<li>Merge the requests above with the defaults. If the printer driver
-ignores the requested paper size, no error is generated: it will print on
-the wrong paper size.</li>
-
-<li>Open the Windows printer with the merged orientation and size.</li>
-</ol>
-
-<p>
-The Ghostscript physical device size is updated to match the Windows
-printer physical device.
-</p>
-
-<h3><a name="Win_properties"></a>Supported command-line parameters</h3>
-
-<p>
-The <code>mswinpr2</code> device supports a limited number of command-line
-parameters (e.g. it does not support setting the printer resolution). The
-recognized parameters are the following:
-</p>
-
-<blockquote>
-<dl>
-<dt><code>-sDEVICE=mswinpr2</code></dt>
-<dd>Selects the MS&nbsp;Windows printer device. If Ghostscript was not
-compiled with this device as the default output device, you have to specify
-it on the command line.</dd>
-
-<dt><code>-dNoCancel</code></dt>
-<dd>Hides the progress dialog, which shows the percent of the document page
-already processed and also provides a <em>cancel</em> button. This option
-is useful if GS is intended to print pages in the background, without any
-user intervention.</dd>
-
-<dt><code>-sOutputFile=</code><b>"%printer%<em>printer_name</em>"</b></dt>
-<dd>Specifies which printer should be used. The <em>printer_name</em> should be
-typed exactly as it appears in the Printers control panel, including spaces.</dd>
-
-</dl>
-</blockquote>
-
-<h3><a name="Win_options"></a>Supported options (device properties)</h3>
-
-<p>
-Several extra options exist which cannot be set through the command-line,
-but only by executing the appropriate PostScript setup code. These options
-can be set through the inclusion of a setup file on the command-line:
-</p>
-
-<blockquote><code>
-gs ... setup.ps ...
-</code></blockquote>
-
-<p>
-The <code>setup.ps</code> file is responsible for the device selection, therefore
-you should not specify the <code>-sDEVICE=mswinpr2</code> option on the
-command-line if you are using such a setup file. Here is an example of such
-a setup file:
-</p>
-
-<blockquote><pre>
-mark
- /NoCancel true % don't show the cancel dialog
- /BitsPerPixel 4 % force 4 bits/pixel
- /UserSettings
- &lt;&lt;
- /DocumentName (Ghostscript document) % name for the Windows spooler
- /MaxResolution 360 % maximum document resolution
- &gt;&gt;
- (mswinpr2) finddevice % select the Windows device driver
- putdeviceprops
-setdevice
-</pre></blockquote>
-
-<p>
-This example disables the progress dialog (same as the <code>-dNoCancel</code>
-option), forces a 4 bits/pixel output resolution and specifies additional user
-settings, such as the document name (which will be displayed by the Windows
-spooler for the queued document) and the maximum resolution (here 360&nbsp;dpi).
-It then finds and selects an instance of the MS&nbsp;Windows device printer
-and activates it. This will show the standard printer dialog, since no
-<code>/OutputFile</code> property was specified.
-</p>
-
-<p>
-The following options are available:
-</p>
-
-<blockquote>
-<dl>
-<dt><code>/NoCancel <em>boolean</em></code></dt>
-<dd>Disables (hides) the progress dialog when set to <em><code>true</code></em> or
-show the progress dialog if not set or set to <em><code>false</code></em>.</dd>
-
-<dt><code>/OutputFile <em>string</em></code></dt>
-<dd>Specifies which printer should be used. The string should be of the form
-<code>%printer%<em>printer_name</em></code>, where the <em>printer_name</em> should be
-typed exactly as it appears in the Printers control panel, including spaces.</dd>
-
-<dt><code>/QueryUser <em>integer</em></code></dt>
-<dd>Shows the standard printer dialog (<code>1</code> or any other value),
-shows the <em>printer setup dialog</em> (<code>2</code>) or selects the
-<em>default Windows printer</em> without any user interaction (<code>3</code>).</dd>
-
-<dt><code>/BitsPerPixel <em>integer</em></code></dt>
-<dd>Sets the device depth to the specified bits per pixel. Currently supported
-values are <code>1</code> (monochrome), <code>4</code> (CMYK with screening
-handled by Ghostscript) and <code>24</code> (True Color, dithering handled by
-the Windows printer driver; this option can produce huge print jobs).</dd>
-
-<dt><code>/UserSettings <em>dict</em></code></dt>
-<dd>Sets additional options, defined in a dictionary. The following properties can
-be set:</dd>
-
-
-<dt><code>/DocumentName <em>string</em></code></dt>
-<dd>Defines the user friendly document name which will be displayed by the
-Windows spooler.</dd>
-
-<dt><code>/DocumentRange <em>[n1 n2]</em></code></dt>
-<dd>Defines the range of pages contained in the document. This information can
-be used by the printer dialog, in conjunction with the following property.</dd>
-
-<dt><code>/SelectedRange <em>[n1 n2]</em></code></dt>
-<dd>Defines the selected range of pages. This information will be displayed in
-the printer dialog and will be updated after the user interaction. A PostScript
-program could check these values and print only the selected page range.</dd>
-
-<dt><code>/MaxResolution <em>dpi</em></code></dt>
-<dd>Specifies the maximum tolerated output resolution. If the selected printer has
-a higher resolution than <code>dpi</code>, then Ghostscript will render the
-document with a submultiple of the printer resolution. For example, if
-<code>MaxResolution</code> is set to 360 and the output printer supports
-up to 1200 dpi, then Ghostscript renders the document with an internal
-resolution of 1200/4=300 dpi. This can be very useful to reduce the memory
-requirements when printing in True Color on some high resolution ink-jet color
-printers.</dd>
-
-
-</dl>
-</blockquote>
-
-<p>
-These properties can be queried through the <code>currentpagedevice</code>
-operator. The following PostScript code snippet shows how to do it for some
-of the properties:
-</p>
-
-<blockquote><pre>
-currentpagedevice /BitsPerPixel get == % displays the selected depth
-
-currentpagedevice /UserSettings get % get the additional options..
-/us exch def % ..and assign them to a variable
-
-us /DocumentName get == % displays the document name
-us /SelectedRange get == % displays the selected page range
-
-% other misc. information (don't rely on them)
-
-us /Color get == % 1 =&gt; monochrome output, 2 =&gt; color output
-us /PrintCopies get == % displays the number of copies requested
-</pre></blockquote>
-
-<p>
-There are a few undocumented parameters stored in the <code>UserSettings</code>
-dictionary. You should not rely on them. Their use is still experimental and
-they could be removed in a future version.
-</p>
-
-<h3><a name="Win_duplex"></a>Duplex printing</h3>
-
-<p>
-If the Windows printer supports the duplex printing feature, then it will
-also be available through the <code>mswinpr2</code> device. You can query
-for this support through the <code>/Duplex</code> property of the
-<code>currentpagedevice</code>. If it returns <code>null</code>, then
-the feature is not supported by the selected printer. Otherwise, <code>true</code>
-means that the printer is currently set up to print on both faces of the paper
-and <code>false</code> that it is not, but that it can.
-</p>
-
-<p>
-The following example shows how to print on both faces of the paper (using
-the long side of the paper as the reference):
-</p>
-
-<blockquote><pre>
-&lt;&lt; /Duplex true /Tumble false &gt;&gt; setpagedevice
-</pre></blockquote>
-
-<hr>
-
-<h2><a name="SPARCprinter"></a>Sun SPARCprinter</h2>
-
-<p>
-This section was contributed by Martin Schulte.</p>
-
-<p>
-With a SPARCprinter you always buy software that enables you to do
-PostScript printing on it. A page image is composed on the host, which
-sends a bitmap to the SPARCprinter through a special SBUS video interface.
-So the need for a Ghostscript interface to the SPARCPrinter seems low, but
-on the other hand, Sun's software prints some PostScript drawings
-incorrectly: some pages contain a thin vertical line of rubbish, and on
-some Mathematica drawings the text at the axes isn't rotated. Ghostscript,
-however, gives the correct results. Moreover, replacing proprietary
-software should never be a bad idea.</p>
-
-<p>
-The problem is that there has yet been no effort to make the SPARCPrinter
-driver behave like a BSD output filter. I made my tests using the script
-shown here.</p>
-
-<h3><a name="SPARC_install"></a>Installation</h3>
-
-<p>
-Add <code>sparc.dev</code> to <code>DEVICE_DEVS</code> and compile
-Ghostscript as described in the documentation on <a href="Make.htm">how to
-build Ghostscript</a>. Afterwards you can use the following script as an
-example for printing after modifying it with the right pathnames --
-including for <b>{GSPATH}</b> the full pathname of the Ghostscript
-executable:</p>
-
-<blockquote>
-<pre>outcmd1='/vol/local/lib/troff2/psxlate -r'
-outcmd2='<b><em>{GSPATH}</em></b> -sDEVICE=sparc -sOUTPUTFILE=/dev/lpvi0 -'
-
-if [ &#36;# -eq 0 ]
-then
- &#36;outcmd1 | &#36;outcmd2
-else
- cat &#36;* | &#36;outcmd1 | &#36;outcmd2
-fi
-</pre></blockquote>
-
-<h3><a name="SPARC_problems"></a>Problems</h3>
-
-<p>
-Since <code>/dev/lpi</code> can be opened only for exclusive use, if
-another job has it open (engine_ctl_sparc or another Ghostscript are the
-most likely candidates), Ghostscript stops with "Error: /invalidfileaccess
-in --.outputpage--"</p>
-
-<p>
-In case of common printer problems like being out of paper, a warning
-describing the reason is printed to stdout. The driver tries access again
-each five seconds. Due to a problem with the device driver (in the kernel)
-the reason for printer failure isn't always reported correctly to the
-program. This is the case, for instance, if you open the top cover (error
-E5 on the printer's display). Look at the display on the printer itself if
-a "Printer problem with unknown reason" is reported. Fatal errors cause
-the print job to be terminated.</p>
-
-<p>
-Note: there is some confusion whether the resolution setting should be
-the integers 300 and 400, or the symbolic constants DPI300 and DPI400
-(defined in lpviio.h). Ghostscript releases have had it both ways. It
-is currently the latter. However, INOUE Namihiko reports (in bug
-<a href="http://bugs.ghostscript.com/show_bug.cgi?id=215256"
-class="offsite">#215256</a>)
-that the former works better for him. If anyone
-has a definitive answer, please let us know.</p>
-
-<hr>
-
-<h2><a name="Apple"></a>Apple dot matrix printer</h2>
-
-<p>
-This section was contributed by Mark Wedel
-&lt;<a href="mailto:master@cats.ucsc.edu">master@cats.ucsc.edu</a>&gt;.</p>
-
-<p>
-The Apple Dot Matrix Printer (DMP) was a parallel predecessor to the
-Imagewriter printer. As far as I know, Imagewriter commands are a superset
-of the Dot Matrix printer's, so the driver should generate output that can
-be printed on Imagewriters.</p>
-
-<p>
-To print images, the driver sets the printer for unidirectional printing
-and 15 characters per inch (cpi), or 120dpi. It sets the line feed to 1/9
-inch. When finished, it sets the printer to bidirectional printing,
-1/8-inch line feeds, and 12 cpi. There appears to be no way to reset the
-printer to initial values.</p>
-
-<p>
-This code does not set for 8-bit characters (which is required). It also
-assumes that carriage return-newline is needed, and not just carriage
-return. These are all switch settings on the DMP, and I have configured
-them for 8-bit data and carriage return exclusively. Ensure that the Unix
-printer daemon handles 8-bit (binary) data properly; in my SunOS 4.1.1
-<code>printcap</code> file the string "<code>ms=pass8,-opost</code>"
-works fine for this.</p>
-
-<p>
-Finally, you can search <code>devdemp.c</code> for
-"<code>Init</code>" and "<code>Reset</code>" to find the strings that
-initialize the printer and reset things when finished, and change them to
-meet your needs.</p>
-
-<hr>
-
-<h2><a name="Test"></a>Special and Test devices</h2>
-
-<p>
-The devices in this section are intended primarily for testing. They may
-be interesting as code examples, as well.</p>
-
-<h3><a name="Bit"></a>Raw 'bit' devices</h3>
-
-<p>There are a collection of 'bit' devices that don't do any special formatting
-but output 'raw' binary data for the page images. These are used for benchmarking
-but can also be useful when you want to directly access the raster data.</p>
-
-<p>
-The raw devices are <code>bit bitrgb bitcmyk</code>.</p>
-
-<h3><a name="Bounding_box_output"></a>Bounding box output</h3>
-
-<p>
-There is a special <code>bbox</code> "device" that just prints the
-bounding box of each page. You select it in the usual way:</p>
-
-<blockquote><code>
-gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox
-</code></blockquote>
-
-<p>
-It prints the output in a format like this:</p>
-
-<blockquote>
-<pre><code>%%BoundingBox: 14 37 570 719
-%%HiResBoundingBox: 14.3ep08066 37.547999 569.495061 718.319158
-</code></pre></blockquote>
-
-<p>
-Currently, it always prints the bounding box on <code>stderr</code>;
-eventually, it should also recognize <code>-sOutputFile=</code>.</p>
-
-<p>
-By default, white objects don't contribute to the bounding box because
-many files fill the whole page with white before drawing other objects.
-This can be changed by:</p>
-
-<blockquote><code>
-&lt;&lt; /WhiteIsOpaque true &gt;&gt; setpagedevice
-</code></blockquote>
-
-<p>
-Note that this device, like other devices, has a resolution and a (maximum)
-page size. As for other devices, the product (resolution x page size) is
-limited to approximately 500K pixels. By default, the resolution is 4000
-DPI and the maximum page size is approximately 125", or approximately 9000
-default (1/72") user coordinate units. If you need to measure larger pages
-than this, you must reset <em>both</em> the resolution and the page size in
-pixels, e.g.,</p>
-
-<blockquote><code>
-gs -dNOPAUSE -dBATCH -sDEVICE=bbox -r100 -g500000x500000
-</code></blockquote>
-
-<h3><a name="Ink_coverage_output"></a>Ink coverage output</h3>
-
-<p>
-There are two special <code>inkcov</code> devices that print the
-ink coverage of each page; the inkcov device and the ink_cov device.
-They are selected like this:</p>
-
-<blockquote><pre><code>
-gs -dSAFER -dNOPAUSE -dBATCH -o- -sDEVICE=inkcov Y.pdf
-gs -dSAFER -dNOPAUSE -dBATCH -o- -sDEVICE=ink_cov Y.pdf
-</code></pre></blockquote>
-
-<p>These commands also work as expected:</p>
-
-<blockquote><pre><code>
-gs -o X_inkcov.txt -sDEVICE=inkcov Y.pdf
-gs -o X_inkcov_page%03d.txt -sDEVICE=inkcov Y.pdf
-</code></pre></blockquote>
-
-<p>
-The devices print their output in a format like this:</p>
-
-<blockquote>
-<pre><code>Page 1
- 0.10022 0.09563 0.10071 0.06259 CMYK OK
-Page 2
- 0.06108 0.05000 0.05834 0.04727 CMYK OK
-</code></pre></blockquote>
-
-<p>
-The difference between the two devices is that the inkcov device considers each rendered pixel and whether
-it marks the C, M, Y or K channels. So the percentages are a measure of how many device pixels
-contain that ink. The ink_cov device gives the more traditional use of ink coverage, it
-also considers the amount of each colourant at each rendered pixel, so the percentages in this
-case are what percentage of the ink is used on the page.
-</p>
-<p>
-As an example, If we take a page which is covered by a pure 100% cyan fill both devices would give
-the same result 1.00 0.00 0.00 0.00; each pixel is marked by the cyan ink and each pixel contains 100% cyan.
-If however we use a 50% cyan fill the inkcov device will still give 1.00 0.00 0.00 0.00 as 100% of the pixels contain cyan. The
-ink_cov device, however, would give a result of 0.50 0.00 0.00 0.00.
-</p>
-
-<h3><a name="Permute"></a>Permutation (DeviceN color model)</h3>
-
-<p>
-With no additional parameters, the device named "permute" looks
-to Ghostscript like a standard CMYK contone device, and outputs a
-PPM file, using a simple CMYK-&gt;RGB transform. This should be the
-baseline for regression testing.</p>
-
-<p>
-With the addition of <code>-dPermute=1</code>, the internal behavior changes
-somewhat, but in most cases the resulting rendered file should be the
-same. In this mode, the color model becomes "DeviceN" rather than
-"DeviceCMYK", the number of components goes to six, and the color
-model is considered to be the (yellow, cyan, cyan, magenta, 0, black)
-tuple. This is what's rendered into the memory buffer. Finally, on
-conversion to RGB for output, the colors are permuted back.</p>
-
-<p>
-As such, this code should check that all imaging code paths are
-64-bit clean. Additionally, it should find incorrect code that assumes
-that the color model is one of DeviceGray, DeviceRGB, or DeviceCMYK.</p>
-
-<p>
-Currently, the code has the limitation of 8-bit continuous tone
-rendering only. An enhancement to do halftones is planned as well. Note,
-however, that when testing permuted halftones for consistency, it is
-important to permute the planes of the default halftone accordingly, and
-that any file which sets halftones explicitly will fail a consistency
-check.</p>
-
-<h3><a name="SPOT"></a>spotcmyk (DeviceN color model)</h3>
-
-<p>
-The <code>spotcmyk</code> device was created for debugging and testing of the DeviceN
-extensions to Ghostscript that were released in version 8.0.
-There are also another device (<code>devicen</code>) in the same
-source file. It were created for testing however it are not actually useful
-except as example code.</p>
-
-<p>The <code>spotcmyk</code> device was also designed to provide example code for a
-device which supports spot colors.
-Spot colors need to be specified prior to opening the
-first page.
-This can be done via adding the
-following to the command line: <code>-c "&lt;&lt; /SeparationColorNames [ /Name1 /Name2 ]
-&gt;&gt; setpagedevice" -f</code>.</p>
-
-<p>
-The <code>spotcmyk</code> device produces a binary data file (similar to the bitcmyk
-device) for the CMYK data. This data file has the name specified by the "OutputFile"
-parameter.
-The device also produces a binary data file (similar to the bitmono device)
-for each spot color plane.
-These data files have the name specified by the "OutputFile"
-parameter with "sn" appended to the end (where "n" is the spot color number 0 to 12)".</p>
-
-<p>
-After the <code>spotcmyk</code> device produces the binary data files, the files are read
-and PCX format versions of these files are created with ".pcx" appended to the binary
-source file name.</p>
-
-<p> If the the <code>spotcmyk</code> is being used with three spot colors and the
-"OutputFile" parameter is <code>xxx</code> then the following files would be created
-by the device:</p>
-
-<blockquote>
-<pre>xxx - binary CMYK data
-xxxs0 - binary data for first spot color
-xxxs1 - binary data for second spot color
-xxxs2 - binary data for third spot color
-xxx.pcx - CMYK data in PCX format
-xxxs0.pcx - first spot color in PCX format
-xxxs1.pcx - second spot color in PCX format
-xxxs2.pcx - third spot color in PCX format
-</pre>
-</blockquote>
-
-<p>
-The <code>spotcmyk</code> device has the creation of the binary data files separated
-from the creation of the PCX files since the source file is intended as example
-code and many people may not be interested in the PCX format. The PCX format was
-chosen because it was simple to implement from preexisting code and viewers are
-available. The PCX format does have the disadvantage that most of those viewers
-are on Windows.</p>
-
-
-<h3><a name="XCF"></a>XCF (DeviceN color model)</h3>
-
-<p>
-The XCF file format is the native image format for the GIMP program. This format
-is currently supported by two devices: <code> xcfrgb</code> and <code>xcfcmyk</code>.</p>
-
-<blockquote><em>
-We have been warned by the people supporting the GIMP program that they reserve
-the right to change the
-XCF format at anytime and thus these devices may become invalid. They are being
-included in the documentation because we have received some questions about
-these devices do.
-</em></blockquote>
-
-<p>
-The XCF devices were created for testing of the DeviceN extensions to Ghostscript
-which were released in version 8.0.</p>
-
-<p>
-The <code>xcfrgb</code> device uses a DeviceRGB process color model and creates
-a normal XCF file.</p>
-
-<p>
-The <code>xcfcmyk</code> device was created as a means of viewing spot colors for
-those users that do not have access to either Photoshop <a href="#PSD">(see the PSD
-devices)</a> or a PCX viewer <a href="#SPOT">(see the <code>spotcmyk</code>
-device)</a>.</p>
-
-<p>
-The <code>xcfcmyk</code> device starts by using a DeviceCMYK process color model. The
-DeviceCMYK process color model allows the <code>xcfcmyk</code> device to also
-support spot colors. Spot colors need to be specified prior to opening the
-first page.
-This can be done via adding the
-following to the command line: <code>-c "&lt;&lt; /SeparationColorNames [ /Name1 /Name2 ]
-&gt;&gt; setpagedevice" -f</code>.</p>
-
-<p>
-After a page is complete, the <code>xcfcmyk</code> converts the CMYK image data into
-RGB for storing in the XCF output file. The XCF format does not currently
-support CMYK data directly. The spot color planes are converted into alpha
-channel planes. This is done because the XCF format does not currently support
-spot colors.</p>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Drivers.htm b/doc/Drivers.htm
deleted file mode 100644
index f08e0b15..00000000
--- a/doc/Drivers.htm
+++ /dev/null
@@ -1,3407 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>The Interface between Ghostscript and Device Drivers</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>The Interface between Ghostscript and Device Drivers</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-
-<ul class="toc">
- <li><a href="#Adding_drivers">Adding a driver</a></li>
- <li><a href="#KISS">Keeping things simple</a></li>
- <li><a href="#Structure">Driver structure</a></li>
- <li>
- <ul>
- <li><a href="#Structure_definition">Structure definition</a></li>
- <li><a href="#Sophisticated">For sophisticated developers only</a></li>
- </ul>
- </li>
- <li><a href="#coordinates_and_types">Coordinates and types</a></li>
- <li>
- <ul>
- <li><a href="#Coordinate_system">Coordinate system</a></li>
- <li><a href="#Color_definition">Color definition</a></li>
- <li>
- <ul>
- <li><a href="#sep_and_linear_fields">Separable and linear fields</a></li>
- <li><a href="#Changing_color_info_data">Changing color_info data</a></li>
- </ul>
- </li>
- <li><a href="#Types">Types</a></li>
- </ul>
- </li>
- <li><a href="#Coding_conventions">Coding conventions</a></li>
- <li>
- <ul>
- <li><a href="#Allocating_storage">Allocating storage</a></li>
- <li><a href="#Driver_instance_allocation">Driver instance allocation</a></li>
- </ul>
- </li>
- <li><a href="#Printer_drivers">Printer drivers</a></li>
- <li><a href="#Printer_drivers_mt">Printer drivers (Multi-threaded)</a></li>
- <li><a href="#Driver_procedures">Driver procedures</a></li>
- <li>
- <ul>
- <li><a href="#Life_cycle">Life cycle</a></li>
- <li><a href="#Open_close">Open, close, sync, copy</a></li>
- <li><a href="#Color_mapping">Color and alpha mapping</a></li>
- <li><a href="#Pixel_level_drawing">Pixel-level drawing</a></li>
- <li>
- <ul>
- <li><a href="#Bitmap_imaging">Bitmap imaging</a></li>
- <li><a href="#Pixmap_imaging">Pixmap imaging</a></li>
- <li><a href="#Compositing">Compositing</a></li>
- <li>
- <ul>
- <li>[<a href="#S_spec">S</a>, <a href="#T_spec">T</a>, <a href="#F_spec">f</a>,
- <a href="#Compositing_notes">Notes</a>]</li>
- </ul>
- </li>
- </ul>
- </li>
- <li><a href="#Polygon_level_drawing">Polygon-level drawing</a></li>
- <li><a href="#Linear_color_drawing">Linear color drawing</a></li>
- <li><a href="#High_level_drawing">High-level drawing</a></li>
- <li>
- <ul>
- <li><a href="#Paths">Paths</a></li>
- <li><a href="#Images">Images</a> [<a href="#Images_notes">Notes</a>]</li>
- <li><a href="#Text">Text</a> [<a href="#Text_notes">Notes</a>]</li>
- <li><a href="#Unicode">Unicode support for high level (vector) devices</a></li>
- </ul>
- </li>
- <li><a href="#Reading_bits_back">Reading bits back</a></li>
- <li><a href="#Parameters">Parameters</a></li>
- <li>
- <ul>
- <li><a href="#Default_CRD_parameters">Default color rendering dictionary (CRD) parameters</a></li>
- </ul>
- </li>
- <li><a href="#External_fonts">External fonts</a></li>
- <li><a href="#Page_devices">Page devices</a></li>
- <li><a href="#Miscellaneous">Miscellaneous</a></li>
- </ul>
- </li>
- <li><a href="#Tray">Tray selection</a></li>
- <li>
- <ul>
- <li><a href="#LeadingEdge">Tray rotation and the LeadingEdge parameter</a></li>
- <li><a href="#LeadingPage">Interaction between LeadingEdge and PageSize</a></li>
- </ul>
- </li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a> and the documentation on <a href="Make.htm">how to build
-Ghostscript</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Adding_drivers"></a>Adding a driver</h2>
-
-<p>
-To add a driver to Ghostscript, first pick a name for your device, say
-"<code>smurf</code>". (Device names must be 1 to 8 characters, begin
-with a letter, and consist only of letters, digits, and underscores. Case
-is significant: all current device names are lower case.) Then all you
-need do is edit <code>contrib.mak</code> in two places.</p>
-
-<ol>
-<li>The list of devices, in the section headed "Catalog". Add
-<code>smurf</code> to the list.</li>
-
-<li>The section headed "Device drivers".
-
-<p>
-Suppose the files containing the smurf driver are called
-"<code>joe</code>" and "<code>fred</code>". Then you should add the
-following lines:</p>
-
-<blockquote>
-<pre># ------ The SMURF device ------ #
-
-smurf_=&#36;(GLOBJ)joe.&#36;(OBJ) &#36;(GLOBJ)fred.&#36;(OBJ)
-&#36;(DD)smurf.dev: &#36;(smurf_)
- &#36;(SETDEV) &#36;(DD)smurf &#36;(smurf_)
-
-&#36;(GLOBJ)joe.&#36;(OBJ) : &#36;(GLSRC)joe.c
- &#36;(GLCC) &#36;(GLO_)joe.&#36;(OBJ) &#36;(C_) &#36;(GLSRC)joe.c
-
-&#36;(GLOBJ)fred.&#36;(OBJ) : &#36;(GLSRC)fred.c
- &#36;(GLCC) &#36;(GLO_)fred.&#36;(OBJ) &#36;(C_) &#36;(GLSRC)fred.c</pre>
-</blockquote>
-
-<p>
-and whatever <code>joe.c</code> and <code>fred.c</code> depend on.
-If the smurf driver also needs special libraries, for instance a library
-named "<code>gorf</code>", then the entry should look like this:</p>
-
-<blockquote>
-<pre>&#36;(DD)smurf.dev : &#36;(smurf_)
- &#36;(SETDEV) &#36;(DD)smurf &#36;(smurf_)
- &#36;(ADDMOD) &#36;(DD)smurf -lib gorf</pre>
-</blockquote>
-
-<p>
-If, as will usually be the case, your driver is a printer driver (as
-<a href="#Printer_drivers">discussed below</a>), the device entry should
-look like this:</p>
-
-<blockquote>
-<pre>&#36;(DD)smurf.dev : &#36;(smurf_) &#36;(GLD)page.dev
- &#36;(SETPDEV) &#36;(DD)smurf &#36;(smurf_)</pre>
-</blockquote>
-
-<p>
-or</p>
-
-<blockquote>
-<pre>&#36;(DD)smurf.dev : &#36;(smurf_) &#36;(GLD)page.dev
- &#36;(SETPDEV) &#36;(DD)smurf &#36;(smurf_)
- &#36;(ADDMOD) &#36;(DD)smurf -lib gorf</pre>
-</blockquote>
-
-<p>
-Note that the space before the :, and the explicit compilation rules for the
-.c files, are required for portability,</p>
-</li>
-</ol>
-
-<hr>
-
-<h2><a name="KISS"></a>Keeping things simple</h2>
-
-<p>
-If you want to add a simple device (specifically, a monochrome printer), you
-probably don't need to read the rest of this document; just use the code in
-an existing driver as a guide. The Epson and Canon BubbleJet drivers <a
-href="../devices/gdevepsn.c">gdevepsn.c</a> and <a
-href="../devices/gdevbj10.c">gdevbj10.c</a> are good models for dot-matrix
-printers, which require presenting the data for many scan lines at once; the
-DeskJet/LaserJet drivers in <a href="../devices/gdevdjet.c">gdevdjet.c</a> are
-good models for laser printers, which take a single scan line at a time but
-support data compression. For color printers, there are unfortunately no
-good models: the two major color inkjet printer drivers, <a
-href="../devices/gdevcdj.c">gdevcdj.c</a> and <a
-href="../devices/gdevstc.c">gdevstc.c</a>, are far too complex to read.</p>
-
-<p>
-On the other hand, if you're writing a driver for some more esoteric
-device, you probably do need at least some of the information in the rest
-of this document. It might be a good idea for you to read it in
-conjunction with one of the existing drivers.</p>
-
-<p>
-Duplication of code, and sheer volume of code, is a serious maintenance and
-distribution problem for Ghostscript. If your device is similar to an
-existing one, try to implement your driver by adding some parameterization
-to an existing driver rather than by copying code to create an entirely new
-source module. <a href="../devices/gdevepsn.c">gdevepsn.c</a> and <a
-href="../devices/gdevdjet.c">gdevdjet.c</a> are good examples of this approach.</p>
-
-<hr>
-
-<h2><a name="Structure"></a>Driver structure</h2>
-
-<p>
-A device is represented by a structure divided into three parts:</p>
-
-<ul>
-<li>parameters that are present in all devices but may be different for
-each device or instance;</li>
-
-<li>an initialize_device_procs procedure; and</li>
-
-<li>device-specific parameters that may be different for each instance.</li>
-</ul>
-
-<p>
-A prototype of the parameter structure (including both generic and
-device-specific parameters) is defined and initialized at compile time, but
-is copied and filled in when an instance of the device is created. This
-structure should be declared as <code>const</code>, but for backward
-compatibility reasons it is not.</p>
-
-<p>
-The <code>gx_device_common</code> macro defines the common structure
-elements, with the intent that devices define and export a structure along
-the following lines. Do not fill in the individual generic parameter values
-in the usual way for C structures: use the macros defined for this purpose
-in <a href="../base/gxdevice.h">gxdevice.h</a> or, if applicable, <a
-href="../base/gdevprn.h">gdevprn.h</a>.</p>
-
-<blockquote>
-<pre>typedef struct smurf_device_s {
- gx_device_common;
- <b><em>... device-specific parameters ...</em></b>
-} smurf_device;
-smurf_device gs_smurf_device = {
- <b><em>... macro for generic parameter values ...,</em></b>
- <b><em>initialize_device_procs,</em></b>
- <b><em>... device-specific parameter values if any ...</em></b>
-};</pre>
-</blockquote>
-<p>
-The device structure instance <b>must</b> have the name
-<code>gs_smurf_device</code>, where <code>smurf</code> is the device
-name used in <code>contrib.mak</code>. <code>gx_device_common</code>
-is a macro consisting only of the element definitions. </p>
-<p>
-The <code>initialize_device_procs</code> function pointer is called when
-the device is created. Its sole job is to initialize the entries in
-the device procedure table. On entry, the device procedure table will
-be full of NULL pointers. On exit, any NULLs left in the table will be
-filled in with pointers to the default routines. Therefore, the routine
-should set any non-default entries itself.
-<p>
-Devices that are (in object-oriented terms) derived from 'base' classes
-(for instance a new printer device that derives from the <code>prn</code>
-device) can call provided helper functions for setting the standard
-functions for that base class.
-<p>
-For example, if the smurf device was a printer device, its
-<code>initialize_device_procs</code> procedure might look like:</p>
-<blockquote>
-<pre>static void smurf_initialize_device_procs(gx_device *dev) {
- /* We are derived from a prn device, and can print in the background */
- gdev_prn_initialize_bg(dev);
-
- /* Override functions for our specifics */
- set_dev_proc(dev, map_color_rgb, smurf_map_color_rgb);
- set_dev_proc(dev, map_rgb_color, smurf_map_rgb_color);
- ...
-}</pre>
-</blockquote>
-<p>
-The initialize procedure function pointer does not live in the in the
-device procedure table (and as such is statically initialized at compile
-time). Nonetheless, we refer to this as being a device procedure in the
-rest of the discussion here.
-<p>
-Note that the <code>initialize_device_procs</code> function may be called
-with a pointer to a <code>gx_device</code> rather than to the derived
-device class. This happens frequently when one device wants to obtain
-the prototype of another to copy device procedures around. Initialization
-of items in the device other than device procs should therefore be
-reserved for the <code>initialize_device</code> device procedure.
-<p>
-The use of the initialize procedure is new to Ghostscript 9.55. Previous
-versions used a statically initialized table of device procedures. We
-changed to a dynamically initialized system to more easily cope with
-future changes to the device procedures.
-<p>
-All the device procedures are called with the device as the first argument.
-Since each device type is actually a different structure type, the device
-procedures must be declared as taking a <code>gx_device&nbsp;*</code> as
-their first argument, and must cast it to
-<code>smurf_device&nbsp;*</code> internally. For example, in the code
-for the "memory" device, the first argument to all routines is called
-<code>dev</code>, but the routines actually use <code>mdev</code> to
-refer to elements of the full structure, using the following standard
-initialization statement at the beginning of each procedure:</p>
-
-<blockquote>
-<pre>gx_memory_device *const mdev = (gx_device_memory *)dev;</pre>
-</blockquote>
-
-<p>
-(This is a cheap version of "object-oriented" programming: in C++, for
-example, the cast would be unnecessary, and in fact the procedure table
-would be constructed by the compiler.)</p>
-
-<h3><a name="Structure_definition"></a>Structure definition</h3>
-
-<p>
-You should consult the definition of struct <code>gx_device_s</code> in
-<a href="../base/gxdevice.h">gxdevice.h</a> for the complete details of the
-generic device structure. Some of the most important members of this
-structure for ordinary drivers are:</p>
-
-<blockquote><table>
- <tr valign="top"> <td><code>const char *dname;</code></td>
-
- <td>The device name</td></tr>
-
- <tr valign="top"> <td><code>bool is_open;</code></td>
-
- <td>True if device has been opened</td></tr>
-<tr valign="top"> <td><code>gx_device_color_info color_info;</code></td>
-
- <td>Color information</td></tr>
-<tr valign="top"> <td><code>int width;</code></td>
-
- <td>Width in pixels</td></tr>
-<tr valign="top"> <td><code>int height;</code></td>
-
- <td>Height in pixels</td></tr>
-</table></blockquote>
-
-<p>
-The name in the structure (<code>dname</code>) should be the same as the
-name in <a href="../devices/contrib.mak">contrib.mak</a>.</p>
-
-<h3><a name="Sophisticated"></a>For sophisticated developers only</h3>
-
-<p>
-If for any reason you need to change the definition of the basic device
-structure, or to add procedures, you must change the following places:</p>
-
-<blockquote><ul>
-<li>This document and the <a href="News.htm">news document</a> (if you want
- to keep the documentation up to date).</li>
-<li>The definition of <code>gx_device_common</code> and the procedures
- in <a href="../base/gxdevcli.h">gxdevcli.h</a>.</li>
-<li>Possibly, the default forwarding procedures declared in
- <a href="../base/gxdevice.h">gxdevice.h</a> and implemented in
- <a href="../base/gdevnfwd.c">gdevnfwd.c</a>.</li>
-<li>The device procedure record completion routines in
- <a href="../base/gdevdflt.c">gdevdflt.c</a>.</li>
-<li>Possibly, the default device implementation in
- <a href="../base/gdevdflt.c">gdevdflt.c</a>,
- <a href="../base/gdevddrw.c">gdevddrw.c</a>, and
- <a href="../base/gxcmap.c">gxcmap.c</a>.</li>
-<li>The bounding box device in <a href="../base/gdevbbox.c">gdevbbox.c</a>
- (probably just adding <code>NULL</code> procedure entries if the
- new procedures don't produce output).</li>
-<li>These devices that must have complete (non-defaulted) procedure vectors:</li>
-<li>
-<ul>
-<li>The null device in <a href="../base/gdevnfwd.c">gdevnfwd.c</a>.</li>
-<li>The command list "device" in <a href="../base/gxclist.c">gxclist.c</a>.
- This is not an actual device; it only defines procedures.</li>
-<li>The "memory" devices in <a href="../base/gdevmem.h">gdevmem.h</a> and
- <code>gdevm*.c</code>.</li>
-</ul>
-</li>
-<li>The clip list accumulation "device" in
- <a href="../base/gxacpath.c">gxacpath.c</a>.</li>
-<li>The clipping "devices" <a href="../base/gxclip.c">gxclip.c</a>,
- <a href="../base/gxclip2.c">gxclip2.c</a>,
- and <a href="../base/gxclipm.c">gxclipm.c</a>.</li>
-<li>The pattern accumulation "device" in
- <a href="../base/gxpcmap.c">gxpcmap.c</a>.</li>
-<li>The hit detection "device" in <a href="../base/gdevhit.c">gdevhit.c</a>.</li>
-<li>The generic printer device macros in
- <a href="../base/gdevprn.h">gdevprn.h</a>.</li>
-<li>The generic printer device code in
- <a href="../base/gdevprn.c">gdevprn.c</a>.</li>
-<li>The RasterOp source device in
- <a href="../base/gdevrops.c">gdevrops.c</a>.</li>
-</ul></blockquote>
-
-<p>
-You may also have to change the code for
-<code>gx_default_get_params</code> or
-<code>gx_default_put_params</code> in <a
-href="../base/gsdparam.c">gsdparam.c</a>.</p>
-
-<p>
-You should not have to change any of the real devices in the standard
-Ghostscript distribution (listed in <a href="../base/devs.mak">devs.mak</a>
-and <a href="../devices/contrib.mak">contrib.mak</a>) or any of your own
-devices, because all of them are supposed to use the macros in <a
-href="../base/gxdevice.h">gxdevice.h</a> or <a
-href="../base/gdevprn.h">gdevprn.h</a> to define and initialize their state.</p>
-
-<hr>
-
-<h2><a name="coordinates_and_types"></a>Coordinates and types</h2>
-
-<h3><a name="Coordinate_system"></a>Coordinate system</h3>
-
-<p>
-Since each driver specifies the initial transformation from user
-coordinates to device coordinates, the driver can use any coordinate system
-it wants, as long as a device coordinate will fit in an
-<code>int</code>. (This is only an issue on DOS systems, where ints are
-only 16 bits. User coordinates are represented as floats.) Most current
-drivers use a coordinate system with (0,0) in the upper left corner, with
-<b><em>X</em></b> increasing to the right and <b><em>Y</em></b> increasing
-toward the bottom. However, there is supposed to be nothing in the rest of
-Ghostscript that assumes this, and indeed some drivers use a coordinate
-system with (0,0) in the lower left corner.</p>
-
-<p>
-Drivers must check (and, if necessary, clip) the coordinate parameters given
-to them: they should not assume the coordinates will be in bounds. The
-<code>fit_fill</code> and <code>fit_copy</code> macros in <a
-href="../base/gxdevice.h">gxdevice.h</a> are very helpful in doing this.</p>
-
-<h3><a name="Color_definition"></a>Color definition</h3>
-
-<p>
-Between the Ghostscript graphics library and the device, colors are
-represented in three forms. Color components in a color space (Gray, RGB,
-DeviceN, etc.) represented as <code>frac</code> values. Device colorants
-are represented as <code>gx_color_value</code> values. For many
-procedures, colors are represented in a type called
-<code>gx_color_index</code>.
-All three types are described in more detail in <a href="#Types">Types</a></p>
-
-<p>
-The <code>color_info</code> member of the device structure defines the
-color and gray-scale capabilities of the device. Its type is defined as
-follows:</p>
-
-<blockquote>
-<pre>
-/*
- * The enlarged color model information structure: Some of the
- * information that was implicit in the component number in
- * the earlier conventions (component names, polarity, mapping
- * functions) are now explicitly provided.
- *
- * Also included is some information regarding the encoding of
- * color information into gx_color_index. Some of this information
- * was previously gathered indirectly from the mapping
- * functions in the existing code, specifically to speed up the
- * halftoned color rendering operator (see
- * gx_dc_ht_colored_fill_rectangle in gxcht.c). The information
- * is now provided explicitly because such optimizations are
- * more critical when the number of color components is large.
- *
- * Note: no pointers have been added to this structure, so there
- * is no requirement for a structure descriptor.
- */
-typedef struct gx_device_color_info_s {
-
- /*
- * max_components is the maximum number of components for all
- * color models supported by this device. This does not include
- * any alpha components.
- */
- int max_components;
-
- /*
- * The number of color components. This does not include any
- * alpha-channel information, which may be integrated into
- * the gx_color_index but is otherwise passed as a separate
- * component.
- */
- int num_components;
-
- /*
- * Polarity of the components of the color space, either
- * additive or subtractive. This is used to interpret transfer
- * functions and halftone threshold arrays. Possible values
- * are GX_CM_POLARITY_ADDITIVE or GX_CM_POLARITY_SUBTRACTIVE
- */
- gx_color_polarity_t polarity;
-
- /*
- * The number of bits of gx_color_index actually used.
- * This must be &lt;= sizeof(gx_color_index), which is usually 64.
- */
- byte depth;
-
- /*
- * Index of the gray color component, if any. The max_gray and
- * dither_gray values apply to this component only; all other
- * components use the max_color and dither_color values.
- *
- * This will be GX_CINFO_COMP_NO_INDEX if there is no gray
- * component.
- */
- byte gray_index;
-
- /*
- * max_gray and max_color are the number of distinct native
- * intensity levels, less 1, for the gray and all other color
- * components, respectively. For nearly all current devices
- * that support both gray and non-gray components, the two
- * parameters have the same value.
- *
- * dither_grays and dither_colors are the number of intensity
- * levels between which halftoning can occur, for the gray and
- * all other color components, respectively. This is
- * essentially redundant information: in all reasonable cases,
- * dither_grays = max_gray + 1 and dither_colors = max_color + 1.
- * These parameters are, however, extensively used in the
- * current code, and thus have been retained.
- *
- * Note that the non-gray values may now be relevant even if
- * num_components == 1. This simplifies the handling of devices
- * with configurable color models which may be set for a single
- * non-gray color model.
- */
- gx_color_value max_gray; /* # of distinct color levels -1 */
- gx_color_value max_color;
-
- gx_color_value dither_grays;
- gx_color_value dither_colors;
-
- /*
- * Information to control super-sampling of objects to support
- * anti-aliasing.
- */
- gx_device_anti_alias_info anti_alias;
-
- /*
- * Flag to indicate if gx_color_index for this device may be divided
- * into individual fields for each component. This is almost always
- * the case for printers, and is the case for most modern displays
- * as well. When this is the case, halftoning may be performed
- * separately for each component, which greatly simplifies processing
- * when the number of color components is large.
- *
- * If the gx_color_index is separable in this manner, the comp_shift
- * array provides the location of the low-order bit for each
- * component. This may be filled in by the client, but need not be.
- * If it is not provided, it will be calculated based on the values
- * in the max_gray and max_color fields as follows:
- *
- * comp_shift[num_components - 1] = 0,
- * comp_shift[i] = comp_shift[i + 1]
- * + ( i == gray_index ? ceil(log2(max_gray + 1))
- * : ceil(log2(max_color + 1)) )
- *
- * The comp_mask and comp_bits fields should be left empty by the client.
- * They will be filled in during initialization using the following
- * mechanism:
- *
- * comp_bits[i] = ( i == gray_index ? ceil(log2(max_gray + 1))
- * : ceil(log2(max_color + 1)) )
- *
- * comp_mask[i] = (((gx_color_index)1 &lt;&lt; comp_bits[i]) - 1)
- * &lt;&lt; comp_shift[i]
- *
- * (For current devices, it is almost always the case that
- * max_gray == max_color, if the color model contains both gray and
- * non-gray components.)
- *
- * If separable_and_linear is not set, the data in the other fields
- * is unpredictable and should be ignored.
- */
- gx_color_enc_sep_lin_t separable_and_linear;
- byte comp_shift[GX_DEVICE_COLOR_MAX_COMPONENTS];
- byte comp_bits[GX_DEVICE_COLOR_MAX_COMPONENTS];
- gx_color_index comp_mask[GX_DEVICE_COLOR_MAX_COMPONENTS];
- /*
- * Pointer to name for the process color model.
- */
- const char * cm_name;
-
-} gx_device_color_info;
-</pre>
-</blockquote>
-
-<p>
-Note: See <a href="#Changing_color_info_data">Changing color_info data</a> before changing
-any information in the <code>color_info structure</code> for a device. </p>
-
-<p>
-It is recommended that the values for this structure be defined using one
-of the standard macros provided for this purpose. This allows for future
-changes to be made to the structure without changes being required in the
-actual device code.</p>
-
-<p>
-The following macros (in <a href="../base/gxdevcli.h">gxdevcli.h</a>) provide
-convenient shorthands for initializing this structure for ordinary
-black-and-white or color devices:</p>
-
-<blockquote>
-<code>#define dci_black_and_white</code> ...<br>
-<code>#define dci_color(depth,maxv,dither)</code> ...
-</blockquote>
-
-<p>
-The <code>#define dci_black_and_white</code> macro defines a
-single bit monochrome device (For example: a typical monochrome printer device.)</p>
-
-<p>
-The <code>#define dci_color(depth,maxv,dither)</code> macro can be used
-to define a 24 bit RGB device or a 4 or 32 bit CMYK device.</p>
-
-<p>
-The <code>#define dci_extended_alpha_values</code> macro (in
-<a href="../base/gxdevcli.h">gxdevcli.h</a>)
-specifies most of the current fields in the structure. However this macro allows
-only the default setting for the comp_shift, comp_bits, and comp_mask fields
-to be set. Any device which requires a non-default setting for these fields
-has to correctly these fields during the device open procedure.
-See
-<a href="#sep_and_linear_fields">Separable and linear fields></a> and
-<a href="#Changing_color_info_data">Changing color_info data</a>.</p>
-
-<p>
-The idea is that a device has a certain number of gray levels
-(<code>max_gray</code>+1) and a certain number of colors
-(<code>max_rgb</code>+1) that it can produce directly. When Ghostscript
-wants to render a given color space color value as a device color, it first tests
-whether the color is a gray level and if so:</p>
-
-<blockquote>
-If <code>max_gray</code> is large (&gt;= 31), Ghostscript asks the
-device to approximate the gray level directly. If the device returns a
-valid <code>gx_color_index</code>, Ghostscript uses it. Otherwise,
-Ghostscript assumes that the device can represent
-<code>dither_gray</code> distinct gray levels, equally spaced along the
-diagonal of the color cube, and uses the two nearest ones to the desired
-color for halftoning.
-</blockquote>
-
-<p>
-If the color is not a gray level:</p>
-
-<blockquote>
-If <code>max_rgb</code> is large (&gt;= 31), Ghostscript asks the device
-to approximate the color directly. If the device returns a valid
-<code>gx_color_index</code>, Ghostscript uses it. Otherwise,
- Ghostscript assumes that the device can represent</blockquote>
-
-<blockquote>
-<code>dither_rgb</code> &times; <code>dither_rgb</code> &times; <code>dither_rgb</code>
-</blockquote>
-
-<p>
-distinct colors, equally spaced throughout the color cube, and uses two of
-the nearest ones to the desired color for halftoning.</p>
-
-<h4><a name="sep_and_linear_fields"></a>Separable and linear fields</h4>
-<p>
-The three fields <code>comp_shift</code>, <code>comp_bits</code>, and
-<code>comp_mask</code> are only used if the <code>separable_and_linear</code>
-field is set to <code>GX_CINFO_SEP_LIN</code>. In this situation a <code>gx_color_index</code>
-value must represent a combination created by or'ing bits for each of the devices's
-output colorants. The <code>comp_shift</code> array defines the location
-(shift count) of each colorants bits in the output gx_color_index value. The
-<code>comp_bits</code> array defines the number of bits for each colorant.
-The <code>comp_mask</code> array contains a mask which can be used to isolate
-the bits for each colorant. These fields must be set if the device supports
-more than four colorants.</p>
-
-<h4><a name="Changing_color_info_data"></a>Changing color_info data</h4>
-
-<p> For most devices, the information in the device's <code>color_info</code>
-structure is defined by the various device definition macros and the data remains
-constant during the entire existence of the device. In general the Ghostscript
-graphics assumes that the information is constant. However some devices want
-to modify the data in this structure.</p>
-
-<p>
-The device's <code>put_params</code> procedure may change
-<code>color_info</code> field values.
-After the data has been modified then the
-device should be closed (via a call to <code>gs_closedevice</code>). Closing
-the device will erase the current page so these changes should only be made
-before anything has been drawn on a page.</p>
-
-<p> The device's <code>open_device</code> procedure may change
-<code>color_info</code> field values. These changes should be done before
-any other procedures are called.</p>
-
-<p>
-The Ghostscript graphics library
-uses some of the data in <code>color_info</code> to set the default
-procedures for the
-<code>get_color_mapping_procs</code>,
-<code>get_color_comp_index</code>,
-<code>encode_color</code>, and
-<code>decode_color</code> procedures.
-These default procedures are set when the
-device is originally created. If any changes are made to the
-<code>color_info</code> fields then the device's <code>open_device</code>
-procedure
-has responsibility for insuring that the correct procedures are contained
-in the device structure. (For an example, see the display device open procedure
-<code>display_open</code> and its subroutine
-<code>display_set_color_format</code>
-(in <a href="../devices/gdevdsp.c">gdevdsp.c</a>).</p>
-
-
-<h3><a name="Types"></a>Types</h3>
-
-<p>
-Here is a brief explanation of the various types that appear as parameters
-or results of the drivers.</p>
-
-<dl>
-<dt><code>frac</code> (defined in <a href="../base/gxfrac.h">gxfrac.h</a>)</dt>
-<dd>This is the type used to represent color values for the input to the
-color model mapping procedures. It is currently defined as a short. It has a
-range of <code>frac_0</code> to <code>frac_1</code>.</dd>
-</dl>
-
-<dl>
-<dt><code>gx_color_value</code> (defined in
-<a href="../base/gxdevice.h">gxdevice.h</a>)</dt>
-<dd>This is the type used to represent RGB or CMYK color values. It is
-currently equivalent to unsigned short. However, Ghostscript may use less
-than the full range of the type to represent color values:
-<code>gx_color_value_bits</code> is the number of bits actually used,
-and <code>gx_max_color_value</code> is the maximum value, equal to
-(2^<small><sup><code>gx_max_color_value_bits</code></sup></small>)-1.</dd>
-</dl>
-
-<dl>
-<dt><code>gx_device</code> (defined in
-<a href="../base/gxdevice.h">gxdevice.h</a>)</dt>
-<dd>This is the device structure, as explained above.</dd>
-</dl>
-
-<dl>
-<dt><code>gs_matrix</code> (defined in
-<a href="../base/gsmatrix.h">gsmatrix.h</a>)</dt>
-<dd>This is a 2-D homogeneous coordinate transformation matrix, used by
-many Ghostscript operators.</dd>
-</dl>
-
-<dl>
-<dt><code>gx_color_index</code> (defined in
-<a href="../base/gxcindex.h">gxcindex.h</a>)</dt>
-<dd>This is meant to be whatever the driver uses to represent a device
-color. For example, it might be an index in a color map, or it might be R,
-G, and B values packed into a single integer. The Ghostscript graphics library
-gets <code>gx_color_index</code> values from the device's
-<code>encode_color</code> and hands them back as arguments to several other
-procedures. If the <code>separable_and_linear</code> field in the device's
-<code>color_info</code> structure is not set to
-<code>GX_CINFO_SEP_LIN</code> then Ghostscript does not do
-any computations with <code>gx_color_index</code> values.
-
-<p>
-The special
-value <code>gx_no_color_index</code> (defined as
-<code>(~(gx_color_index)(0))</code>&nbsp;) means "transparent" for some of
-the procedures.</p>
-
-<p>
-The size of <code>gx_color_index</code> can be either 32 or 64 bits. The
-choice depends upon the architecture of the CPU and the compiler. The default
-type definition is simply: </p>
-
-<blockquote><code>
-typedef unsigned long gx_color_index;
-</code></blockquote>
-
-<p>However if <code>GX_COLOR_INDEX_TYPE</code> is defined, then it is used
-as the type for <code>gx_color_index</code>.</p>
-
-<blockquote><code>
-typedef GX_COLOR_INDEX_TYPE gx_color_index;
-</code></blockquote>
-
-<p>The smaller size (32 bits) may produce more efficient or faster executing
-code. The larger size (64 bits) is needed for representing either more
-bits per component or more components. An example of the later case is
-a device that supports 8 bit contone colorants using a DeviceCMYK process
-color model with its four colorants and also supports additional spot
-colorants.</p>
-
-<p>
-Currently autoconf attempts to find a 64 bit type definition for the
-compiler being used, and if a 64 bit type is found then
-<code>GX_COLOR_INDEX_TYPE</code> is set to the type.</p>
-
-<p>
-For Microsoft and the MSVC compiler, <code>GX_COLOR_INDEX_TYPE</code> will
-be set to <code>unsigned _int64</code> if <code>USE_LARGE_COLOR_INDEX</code>
-is set to 1 either on the make command line or by editing the definition
- in <a href="../psi/msvc32.mak">msvc32.mak</a> </p>
-
- </dd>
-
-</dl>
-
-<dl>
-<dt><code>gs_param_list</code> (defined in <a
-href="../base/gsparam.h">gsparam.h</a>) </dt>
- <dd>This is a parameter list, which is used to read and set attributes in a
-device. See the comments in <a href="../base/gsparam.h">gsparam.h</a>, and
-the <a href="#Parameters">description of the <code>get_params</code> and
-<code>put_params</code> procedures</a> below, for more detail.</dd>
-</dl>
-
-<dl>
-<dt><code>gx_tile_bitmap</code> (defined in
-<a href="../base/gxbitmap.h">gxbitmap.h</a>)
-<br><code>gx_strip_bitmap</code> (defined in
-<a href="../base/gxbitmap.h">gxbitmap.h</a>)</dt>
-<dd>These structure types represent bitmaps to be used as a tile for
-filling a region (rectangle). <code>gx_tile_bitmap</code> is an
-older, deprecated type lacking <code>shift</code> and
-<code>rep_shift</code>;
-<code>gx_strip_bitmap</code> has superseded it, and should be
-used in new code. Here is a copy of the relevant part of the file:
-
-<blockquote>
-<pre>
-/*
- * Structure for describing stored bitmaps.
- * Bitmaps are stored bit-big-endian (i.e., the 2^7 bit of the first
- * byte corresponds to x=0), as a sequence of bytes (i.e., you can't
- * do word-oriented operations on them if you're on a little-endian
- * platform like the Intel 80x86 or VAX). Each scan line must start on
- * a (32-bit) word boundary, and hence is padded to a word boundary,
- * although this should rarely be of concern, since the raster and width
- * are specified individually. The first scan line corresponds to y=0
- * in whatever coordinate system is relevant.
- *
- * For bitmaps used as halftone tiles, we may replicate the tile in
- * X and/or Y, but it is still valuable to know the true tile dimensions
- * (i.e., the dimensions prior to replication). Requirements:
- * width % rep_width = 0
- * height % rep_height = 0
- *
- * For halftones at arbitrary angles, we provide for storing the halftone
- * data as a strip that must be shifted in X for different values of Y.
- * For an ordinary (non-shifted) halftone that has a repetition width of
- * W and a repetition height of H, the pixel at coordinate (X,Y)
- * corresponds to halftone pixel (X mod W, Y mod H), ignoring phase;
- * for a shifted halftone with shift S, the pixel at (X,Y) corresponds
- * to halftone pixel ((X + S * floor(Y/H)) mod W, Y mod H). In other words,
- * each Y increment of H shifts the strip left by S pixels.
- *
- * As for non-shifted tiles, a strip bitmap may include multiple copies
- * in X or Y to reduce loop overhead. In this case, we must distinguish:
- * - The height of an individual strip, which is the same as
- * the height of the bitmap being replicated (rep_height, H);
- * - The height of the entire bitmap (size.y).
- * Similarly, we must distinguish:
- * - The shift per strip (rep_shift, S);
- * - The shift for the entire bitmap (shift).
- * Note that shift = (rep_shift * size.y / rep_height) mod rep_width,
- * so the shift member of the structure is only an accelerator. It is,
- * however, an important one, since it indicates whether the overall
- * bitmap requires shifting or not.
- *
- * Note that for shifted tiles, size.y is the size of the stored bitmap
- * (1 or more strips), and NOT the height of the actual tile. The latter
- * is not stored in the structure at all: it can be computed as H * W /
- * gcd(S, W).
- *
- * If the bitmap consists of a multiple of W / gcd(S, W) copies in Y, the
- * effective shift is zero, reducing it to a tile. For simplicity, we
- * require that if shift is non-zero, the bitmap height be less than H * W /
- * gcd(S, W). I.e., we don't allow strip bitmaps that are large enough to
- * include a complete tile but that don't include an integral number of
- * tiles. Requirements:
- * rep_shift &lt; rep_width
- * shift = (rep_shift * (size.y / rep_height)) % rep_width
- *
- * For the benefit of the planar device, we now have a num_planes field.
- * For chunky data this should be set to 1. For planar data, the data pointer
- * points to the first plane of data; subsequent planes of data follow
- * immediately after this as if there were num_planes * height lines of data.
- */
-typedef struct gx_strip_bitmap_s {
- byte *data;
- int raster; /* bytes per scan line */
- gs_int_point size; /* width, height */
- gx_bitmap_id id;
- ushort rep_width, rep_height; /* true size of tile */
- ushort rep_shift;
- ushort shift;
- int num_planes;
-} gx_strip_bitmap;</pre>
-</blockquote>
-
-</dd>
-
-</dl>
-
-<hr>
-
-<h2><a name="Coding_conventions"></a>Coding conventions</h2>
-
-<p>
-All the driver procedures defined below that return <code>int</code>
-results return 0 on success, or an appropriate negative error code in the
-case of error conditions. The error codes are defined in <a
-href="../base/gserrors.h">gserrors.h</a>; they correspond directly to the
-errors defined in the PostScript language reference manuals. The most
-common ones for drivers are:</p>
-
-<blockquote><dl>
-<dt><code>gs_error_invalidfileaccess</code> </dt>
-<dd>An attempt to open a file failed.</dd>
-
-<dt><code>gs_error_ioerror</code> </dt>
-<dd>An error occurred in reading or writing a file.</dd>
-
-<dt><code>gs_error_limitcheck</code> </dt>
-<dd>An otherwise valid parameter value was too large for the
-implementation.</dd>
-
-<dt><code>gs_error_rangecheck</code> </dt>
-<dd>A parameter was outside the valid range.</dd>
-
-<dt><code>gs_error_VMerror</code> </dt>
-<dd>An attempt to allocate memory failed. (If this happens, the procedure
-should release all memory it allocated before it returns.)</dd>
-</dl></blockquote>
-
-<p>
-If a driver does return an error, rather than a simple return statement it
-should use the <code>return_error</code> macro defined in <a
-href="../base/gx.h">gx.h</a>, which is automatically included by <a
-href="../base/gdevprn.h">gdevprn.h</a> but not by <a
-href="../base/gserrors.h">gserrors.h</a>. For example</p>
-
-<blockquote>
-<code> return_error(gs_error_VMerror);
-</code></blockquote>
-
-<h3><a name="Allocating_storage"></a>Allocating storage</h3>
-
-<p>
-While most drivers (especially printer drivers) follow a very similar
-template, there is one important coding convention that is not obvious from
-reading the code for existing drivers: driver procedures must not use
-<code>malloc</code> to allocate any storage that stays around after the
-procedure returns. Instead, they must use <code>gs_malloc</code> and
-<code>gs_free</code>, which have slightly different calling conventions.
-(The prototypes for these are in <a href="../base/gsmemory.h">gsmemory.h</a>,
-which is included in <a href="../base/gx.h">gx.h</a>, which is included in <a
-href="../base/gdevprn.h">gdevprn.h</a>.) This is necessary so that
-Ghostscript can clean up all allocated memory before exiting, which is
-essential in environments that provide only single-address-space
-multi-tasking (some versions of Microsoft Windows). </p>
-
-<blockquote>
-<pre>char *gs_malloc(uint num_elements, uint element_size,
- const char *client_name);</pre>
-</blockquote>
-
-<p>
-Like <code>calloc</code>, but unlike <code>malloc</code>,
-<code>gs_malloc</code> takes an element count and an element size. For
-structures, <code>num_elements</code> is 1 andi
-<code>element_size</code> is <code>sizeof</code> the structure; for
-byte arrays, <code>num_elements</code> is the number of bytes and
-<code>element_size</code> is 1. Unlike <code>calloc</code>,
-<code>gs_malloc</code> does <b>not</b> clear the block of storage. </p>
-
-<p>
-The <code>client_name</code> is used for tracing and debugging. It must
-be a real string, not <code>NULL</code>. Normally it is the name of the
-procedure in which the call occurs.</p>
-
-<blockquote>
-<pre>void gs_free(char *data, uint num_elements, uint element_size,
- const char *client_name);</pre>
-</blockquote>
-
-<p>
-Unlike <code>free</code>, <code>gs_free</code> demands that
-<code>num_elements</code> and element_size be supplied. It also
-requires a client name, like <code>gs_malloc</code>. </p>
-
-<h3><a name="Driver_instance_allocation"></a>Driver instance allocation</h3>
-
-<p>
-All driver instances allocated by Ghostscript's standard allocator must
-point to a "structure descriptor" that tells the garbage collector how to
-trace pointers in the structure. For drivers registered in the normal way
-(using the makefile approach described above), no special care is needed as
-long as instances are created only by calling the
-<code>gs_copydevice</code> procedure defined in <a
-href="../base/gsdevice.h">gsdevice.h</a>. If you have a need to define
-devices that are not registered in this way, you must fill in the stype
-member in any dynamically allocated instances with a pointer to the same
-structure descriptor used to allocate the instance. For more information
-about structure descriptors, see <a href="../base/gsmemory.h">gsmemory.h</a>
-and <a href="../base/gsstruct.h">gsstruct.h</a>. </p>
-
-<hr>
-
-<h2><a name="Printer_drivers"></a>Printer drivers</h2>
-
-<p>
-Printer drivers (which include drivers that write some kind of raster file)
-are especially simple to implement.
-The printer driver must implement a <code>print_page</code> or
-<code>print_page_copies</code> procedure. There are macros in <a
-href="../base/gdevprn.h">gdevprn.h</a> that generate the device structure for
-such devices, of which the simplest is <code>prn_device</code>; for an
-example, see <a href="../devices/gdevbj10.c">gdevbj10.c</a>. If you are writing
-a printer driver, we suggest you start by reading <a
-href="../base/gdevprn.h">gdevprn.h</a> and the <a
-href="#Color_mapping">subsection on "Color mapping"</a> below; you may be
-able to ignore all the rest of the driver procedures.</p>
-
-<p>
-The <code>print_page</code> procedures are defined as follows:</p>
-
-<blockquote>
-<pre>int (*print_page)(gx_device_printer *, FILE *)
-int (*print_page_copies)(gx_device_printer *, FILE *, int)</pre>
-</blockquote>
-
-<p>
-This procedure must read out the rendered image from the device and write
-whatever is appropriate to the file. To read back one or more scan lines
-of the image, the <code>print_page</code> procedure must call one of
-several procedures. Traditionally devices have called
-<tt>gdev_prn_copy_scan_lines</tt>, <tt>gdev_prn_get_bits</tt>, or
-the generic <tt>get_bits_rectangle</tt> device entry point. Alternatively
-devices may now call the new <tt>process_page</tt> entrypoint, which can
-have significant performance advantages in <a href="#Printer_drivers_mt">multi-threaded</a> situations.</p>
-
-<blockquote>
-<pre>int gdev_prn_copy_scan_lines(gx_device_printer *pdev, int y, byte *str,
- uint size)</pre>
-</blockquote>
-
-<p>
-For this procedure, <code>str</code> is where the data should be copied to, and <code>size</code> is
-the size of the buffer starting at <code>str</code>. This procedure returns the number
-of scan lines copied, or &lt;0 for an error. <code>str</code> need not be aligned.</p>
-
-<blockquote>
-<pre>int gdev_prn_get_bits(gx_device_printer *pdev, int y, byte *str,
- byte **actual_data)</pre>
-</blockquote>
-
-<p>
-This procedure reads out exactly one scan line. If the scan line is
-available in the correct format already, <code>*actual_data</code> is
-set to point to it; otherwise, the scan line is copied to the buffer
-starting at <code>str</code>, and <code>*actual_data</code> is set to
-<code>str</code>. This saves a copying step most of the time.
-<code>str</code> need not be aligned; however, if
-<code>*actual_data</code> is set to point to an existing scan line, it
-will be aligned. (See the description of the <code>get_bits</code>
-procedure below for more details.)</p>
-
-<p>
-In either of these two cases, each row of the image is stored in the
-form described in the comment under <code>gx_tile_bitmap</code> above;
-each pixel takes the number of bits specified as <code>color_info.depth</code>
-in the device structure, and holds values returned by the device's
-<code>encode_color</code> procedure.</p>
-
-<p>
-The <code>print_page</code> procedure can determine the number of bytes
-required to hold a scan line by calling:</p>
-
-<blockquote>
-<pre>uint gdev_prn_raster(gx_device_printer *)</pre>
-</blockquote>
-
-<p>
-For a very simple concrete example of this pattern of use, we suggest
-reading the code in <code>bit_print_page</code> in
-<a href="../devices/gdevbit.c">gdevbit.c</a>.</p>
-
-<p>
-If the device provides <code>print_page</code>, Ghostscript will call
-<code>print_page</code> the requisite number of times to print the
-desired number of copies; if the device provides
-<code>print_page_copies</code>, Ghostscript will call
-<code>print_page_copies</code> once per page, passing it the desired
-number of copies.</p>
-<hr>
-<h2><a name="Printer_drivers_mt"></a>Printer drivers (Multi-threaded)</h2>
-
-<p><strong>This interface is new, and subject to change without notice.</strong></p>
-
-<p>Ghostscript has supported multi-threaded rendering (controlled by the
-<a href="Language.htm#Banding_parameters"><tt>-dNumRenderingThreads</tt></a>
-command line option) since version 8.64. This uses multiple threads
-of execution to accelerate the rendering phase of operations, but driver
-specific operations (such as compression) have not been able to benefit in
-the same way.</p>
-
-<p>As from Ghostscript 9.11 onwards, a new device function, <tt>process_page</tt>
-has been introduced to solve this. A printer driver will be called via the
-<tt>print_page</tt> or <tt>print_page_copies</tt> entry point as before, but
-rather than requesting a rectangle of pixels at a time (by
-calling <tt>get_bits_rectangle</tt>), the
-driver can now invite Ghostscript to "process the page" in whatever sized
-chunks it chooses.</p>
-
-<p>While the benefits of <tt>process_page</tt> come from its use with
-multiple rendering threads, it will work perfectly well in single threaded
-mode too. Devices do not need to implement both schemes.</p>
-
-<blockquote>
-<pre>int (*process_page)(gx_device *dev, gx_process_page_options_t *options)</pre>
-</blockquote>
-
-<p>The device should fill out a <tt>gx_process_page_options_t</tt>
-structure and pass the address of this to the <tt>process_page</tt>
-function. The entries within this structure will control exactly how
-Ghostscript will process the page. For forwards compatibility devices
-should ensure that any unknown fields/option bits within the structure
-are initialised to 0.</p>
-
-<blockquote>
-<pre>typedef struct gx_process_page_options_s gx_process_page_options_t;
-
-struct gx_process_page_options_s
-{
- int (*init_buffer_fn)(void *arg, gx_device *dev, gs_memory_t *memory, int w, int h, void **buffer);
- void (*free_buffer_fn)(void *arg, gx_device *dev, gs_memory_t *memory, void *buffer);
- int (*process_fn)(void *arg, gx_device *dev, gx_device *bdev, const gs_int_rect *rect, void *buffer);
- int (*output_fn)(void *arg, gx_device *dev, void *buffer);
- void *arg;
- int options; /* A mask of GX_PROCPAGE_... options bits */
-};</pre>
-</blockquote>
-
-<p>Ghostscript is free to process the page in 1 or more sections. The potential
-benefits of <tt>process_page</tt> come when Ghostscript chooses to use more than
-1 section (or "band") and shares the job of rendering these bands between a set
-of rendering threads. The overall scheme of operation is as follows:</p>
-
-<ul>
-<li>Ghostscript will call <tt>init_buffer_fn</tt> in turn, once for each rendering
-thread in use. This function should (as far as possible) allocate any buffering
-that may be required to cope with a band of the given size.</li>
-
-<li>For each band rendered, Ghostscript will call <tt>process_fn</tt> to
-process the given rectangle of the page into the buffer. To achieve this
-<tt>process_fn</tt> is passed a buffer device that contains the rendered
-version of that rectangle (with the y range adjusted to start from 0).
-<tt>process_fn</tt> should call <tt>get_bits_rectangle</tt> as usual to
-extract the rendered area. If the options to this call are set correctly
-(using <tt>GB_RETURN_POINTER</tt>) no copying or additional storage will
-be required. All the calls to <tt>process_fn</tt> will be for
-non-overlapping rectangles that cover the page, hence <tt>process_fn</tt>
-may overwrite the storage used in the returned buffer device as part
-of the processing. Several calls to <tt>process_fn</tt> may take place
-simultaneously in different threads, and there is no guarantee that they
-will happen 'in order'.</li>
-
-<li>Ghostscript will call <tt>output_fn</tt> for each band in turn,
-passing in the processed buffer containing the output of the
-<tt>process_fn</tt> stage. These calls are guaranteed to happen 'in order',
-and will be interleaved arbitrarily with the <tt>process_fn</tt> calls.
-Once an <tt>output_fn</tt> returns, the buffer may instantly be reused
-for another <tt>process_fn</tt> calls.</li>
-
-<li>Once the page has been processed, Ghostscript will call
-<tt>free_buffer_fn</tt> for each allocated buffer to allow the device to
-clean up.</li>
-</ul>
-
-<p>At the time of writing the only defined bit in the options word is
-<tt>GX_PROCPAGE_BOTTOM_UP</tt> which signifies that Ghostscript should
-render bands from the bottom of the page to the top, rather than the
-default top to bottom.</p>
-
-<p>The height of the bands used by Ghostscript when rendering the page
-can either be specified by the device itself (using the <tt>band_params</tt>
-structure), or can be calculated by Ghostscript based upon the space
-available to it. It can sometimes be much easier/more efficient to code
-a device if the band height can be relied upon to take only particular
-values - for instance, a device that downscales its output will prefer
-the height to be a multiple of the downscale used, or a device that uses
-DCT based compression may prefer a multiple of 8.</p>
-
-<p>To accommodate such needs, before Ghostscript sets up its buffers,
-it will perform a <tt>gxdso_adjust_bandheight</tt> call. A device can
-catch this call to adjust the calculated band height to a value it would
-prefer. To avoid invalidating the calculated memory bounds this should
-generally be a 'fine' adjustment, and always downwards.</p>
-
-<p>A simple example of how to use process_page may be found as the
-<tt>fpng</tt> device. Within this device:</p>
-
-<ul>
-<li>The <tt>init_buffer_fn</tt> allocates a buffer large enough to
-hold the compressed version of each band.</li>
-
-<li>The <tt>process_fn</tt> applies the sub/paeth filters to the
-buffered image, then compresses each band with zlib.</li>
-
-<li>The <tt>output_fn</tt> simply writes each compressed buffer to
-the file.</li>
-
-<li>The <tt>free_buffer_fn</tt> frees the buffers.</li>
-
-<li>In addition, the downscaler is called to demonstrate that it is
-possible to 'chain' process_page functions.</li>
-</ul>
-
-<p>The <tt>fpng</tt> device is broadly equivalent to the <tt>png16m</tt>
-device, but performs much better when multiple threads are in use.
-Compression is potentially worse than with <tt>png16m</tt> due to
-each band being compressed separately.</p>
-
-<p>While the <tt>print_page</tt> entry point is specific to printer
-devices, the <tt>process_page</tt> device entry point is not. It will,
-however, only be useful for devices that involve rendering the page.
-As such, neither -dNumRenderingThreads or <tt>process_page</tt> will
-help accelerate devices such as <tt>pdfwrite</tt> or <tt>ps2write</tt>.</p>
-
-<hr>
-
-<h2><a name="Driver_procedures"></a>Driver procedures</h2>
-
-<p>
-Most of the procedures that a driver may implement are optional. If a
-device doesn't supply an optional procedure <code>WXYZ</code>, the entry
-in the procedure structure may be either <code>gx_default_WXYZ</code>,
-for instance <code>gx_default_strip_tile_rectangle</code>, or
-<code>NULL</code> or 0. (The device procedure must also call the
-<code>gx_default_</code> procedure if it doesn't implement the function
-for particular values of the arguments.) Since, by construction,
-device procedure entries are set to 0 at creation time, ones that are
-not explicitly initialised will continue to work even if new (optional)
-members are added.</p>
-
-<h3><a name="Life_cycle"></a>Life cycle</h3>
-
-<p>
-When a device is first created, it will have an empty device procs
-table. The system will call the device's <code>initialize_device_procs</code>
-function pointer to fill out this table. This operation can never fail.</p>
-
-<p>NOTE: This operation is also used for creating temporary 'prototype'
-devices for copying device procedures from.</p>
-
-<p>
-A device instance begins life in a closed state. In this state, no output
-operations will occur. Only the following procedures may be called:</p>
-
-<blockquote><code>
-initialize_device<br>
-open_device<br>
-get_initial_matrix<br>
-get_params<br>
-put_params<br>
-get_hardware_params
-</code></blockquote>
-
-<p>
-When <code>setdevice</code> installs a device instance in the graphics
-state, it checks whether the instance is closed or open. If the instance
-is closed, <code>setdevice</code> calls the open routine, and then sets
-the state to open.</p>
-
-<p>
-There is no user-accessible operation to close a device instance. This is
-not an oversight – it is required in order to enforce the following
-invariant:</p>
-
-<blockquote>
-If a device instance is the current device in <em>any</em> graphics state,
-it must be open (have <code>is_open</code> set to true).
-</blockquote>
-
-<p>
-Device instances are only closed when they are about to
-be freed, which occurs in three situations:</p>
-
-<ul>
-<li>When a <code>restore</code> occurs, if the instance was created since
-the corresponding <code>save</code> and is in a VM being restored. I.e.,
-if the instance was created in local VM since a <code>save</code>, it
-will always be closed and freed by the corresponding
-<code>restore</code>; if it was created in global VM, it will only be
-closed by the outermost <code>restore</code>, regardless of the save
-level at the time the instance was created.</li>
-
-<li>By the garbage collector, if the instance is no longer accessible.</li>
-
-<li>When Ghostscript exits (terminates).</li>
-</ul>
-
-<h3><a name="Open_close"></a>Open, close, sync, copy</h3>
-
-<dl>
-<dt><code>void (*initialize_device_procs)(gx_device *dev)</code></dt> <dd>Called
-once a new device instance has been created. The function should initialize
-the device procedure tables. This cannot fail.
-<b>NOTE</b>: Clients should rarely need to call a device's
-<code>initialize_device_procs</code> procedure: this procedure is mostly used
-by the internal device creation code. The sole exception here is when
-a device implementation wishes to copy device function pointers from another
-device; then a blank <code>gx_device</code> can be created, and
-<code>initialize_device_procs</code> can be used to fill out the device procs
-table so it can be copied from.</dd>
-</dl>
-
-<dl>
-<dt><code>int (*initialize_device)(gx_device *dev)</code> <b><em>[OPTIONAL</em></b></dt>
-<dd>Called once a new device instance has been created and the device procs
-table has been initialized. This function should perform the minimum
-initialization to any internal device state required. If the initial setup
-fails, this procedure should return an error; the new instance will be freed.
-<b>NOTE</b>: Clients should never call a device's <code>initialize_device</code>
-procedure: this procedure is only intended for use by the internal device
-creation code.</dd>
-</dl>
-
-<dl>
-<dt><code>int (*open_device)(gx_device *)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Open the device: do any initialization associated with making the device
-instance valid. This must be done before any output to the device. The
-default implementation does nothing. <b>NOTE</b>: Clients should never call
-a device's <code>open_device</code> procedure directly: they should
-always call <code>gs_opendevice</code> instead.</dd>
-</dl>
-
-<dl>
-<dt><code>void (*get_initial_matrix)(gx_device *, gs_matrix *)</code> <b><em>[OPTIONAL]</em></b> </dt>
-<dd>Construct the initial transformation matrix mapping user coordinates
-(nominally 1/72 inch per unit) to device coordinates. The default
-procedure computes this from width, height, and
-[<code>xy</code>]<code>_pixels_per_inch</code> on the assumption that
-the origin is in the upper left corner, that is
-<blockquote>
-<code>xx</code> = <code>x_pixels_per_inch</code>/72, <code>xy</code> = 0,<br>
-<code>yx = 0, yy = -y_pixels_per_inch</code>/72,<br>
-<code>tx = 0, ty = height</code>.
-</blockquote>
-</dd>
-</dl>
-
-<dl>
-<dt><code>int (*sync_output)(gx_device *)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Synchronize the device. If any output to the device has been
-buffered, send or write it now. Note that this may be called several times
-in the process of constructing a page, so printer drivers should <b>not</b>
-implement this by printing the page. The default implementation does
-nothing.</dd>
-</dl>
-
-<dl>
-<dt><code>int (*output_page)(gx_device *, int num_copies, int flush)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Output a fully composed page to the device. The
-<code>num_copies</code> argument is the number of copies that should be
-produced for a hardcopy device. (This may be ignored if the driver has
-some other way to specify the number of copies.) The <code>flush</code>
-argument is true for <code>showpage</code>, false for
-<code>copypage</code>. The default definition just calls
-<code>sync_output</code>. Printer drivers should implement this by
-printing and ejecting the page.</dd>
-</dl>
-
-<dl>
-<dt><code>int (*close_device)(gx_device *)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Close the device: release any associated resources. After this, output
-to the device is no longer allowed. The default implementation does
-nothing. <b>NOTE</b>: Clients should never call a device's
-<code>close_device</code> procedure directly: they should always call
-<code>gs_closedevice</code> instead. </dd>
-</dl>
-<h3><a name="Color_mapping"></a>Color and alpha mapping</h3>
-
-<p>
-Note that code in the Ghostscript library may cache the results of calling
-one or more of the color mapping procedures. If the result returned by any
-of these procedures would change (other than as a result of a change made by
-the driver's <code>put_params</code> procedure), the driver must call
-<code>gx_device_decache_colors(dev)</code>.</p>
-
-<p>
-The <code>map_rgb_color</code>, <code>map_color_rgb</code>, and
-<code>map_cmyk_color</code> are obsolete. They have been left
-in the device procedure list for backward compatibility. See the
-<code>encode_color</code> and <code>decode_color</code> procedures
-below. To insure that older device drivers are changed to use the new
-<code>encode_color</code> and <code>decode_color</code>
-procedures,
-the parameters for the older procedures have been changed to
-match the new procedures. To minimize changes in devices that have
-already been written, the map_rgb_color and map_cmyk_color routines
-are used as the default value for the encode_color routine. The
-map_cmyk_color routine is used if the number of components is four.
-The map_rgb_color routine is used if the number of components is one
-or three. This works okay for RGB and CMYK process color model devices.
-However this does not work properly for gray devices. The encode_color
-routine for a gray device is only passed one component. Thus the
-map_rgb_color routine must be modified to only use a single input (instead
-of three). (See the encode_color and decode_color routines below.)</p>
-
-
-<p>
-Colors can be specified to the Ghostscript graphics library in a variety
-of forms. For example, there are a wide variety of color spaces that can
-be used such as Gray, RGB, CMYK, DeviceN, Separation, Indexed, CIEbasedABC,
-etc. The graphics library converts the various input color space
-values into four base color spaces: Gray, RGB, CMYK, and DeviceN. The
-DeviceN color space allows for specifying values for individual device
-colorants or spot colors.</p>
-
-<p>
-Colors are converted by the device in a two step process. The first step
-is to convert a color in one of the base color spaces (Gray, RGB, CMYK,
-or DeviceN) into values for each device colorant. This transformation is
-done via a set of procedures provided by the device. These procedures are
-provided by the <code>get_color_mapping_procs</code> device procedure.</p>
-
-<p>
-Between the first and second steps, the graphics library applies transfer
-functions to the device colorants. Where needed, the output of the results
-after the transfer functions is used by the graphics library for halftoning.</p>
-
-<p>
-In the second step, the device procedure <code>encode_color</code> is
-used to convert the transfer function results into a
-<code>gx_color_index</code> value.
-The <code>gx_color_index</code> values are passed to specify colors
-to various routines.
-The choice of the encoding for a <code>gx_color_index</code> is
-up to the device. Common choices are indexes into a color palette or
-several integers packed together into a single value. The manner of this
-encoding is usually opaque to the graphics library. The only exception to this
-statement occurs when halftoning 5 or more colorants. In this case the
-graphics library assumes that if a colorant values is zero then the
-bits associated with the colorant in the <code>gx_color_index</code>
-value are zero.</p>
-
-<dl>
-<dt><code>int get_color_comp_index(const gx_device&nbsp;* dev, const char * pname,
-int name_size, int src_index)</code> <b><em>[OPTIONAL]</em></b> </dt>
-<dd>This procedure returns the device colorant number of the given name.
-The possible return values are -1, 0 to
-<code>GX_DEVICE_COLOR_MAX_COMPONENTS - 1</code>, or
-<code>GX_DEVICE_COLOR_MAX_COMPONENTS</code>. A value of -1 indicates that
-the specified name is not a colorant for the device. A value of 0 to
-<code>GX_DEVICE_COLOR_MAX_COMPONENTS - 1</code> indicates the colorant number
-of the given name. A value of <code>GX_DEVICE_COLOR_MAX_COMPONENTS</code>
-indicates that the given name is a valid colorant name for the device but the
-colorant is not currently being used. This is used for implementing names
-which are in SeparationColorNames but not in SeparationOrder.
-
-<p>
-The default procedure returns results based upon process color model
-of DeviceGray, DeviceRGB, or DeviceCMYK selected by
-<code>color_info.num_components</code>. This procedure must be
-defined if another process color model is used by the device or spot colors are
-supported by the device.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>const gx_cm_color_map_procs&nbsp;* get_color_mapping_procs(const
-gx_device&nbsp;* dev, const gx_device&nbsp;** tdev)</code> <b><em>[OPTIONAL]</em></b> </dt>
-<dd>This procedure returns a list of three procedures, together with the
-device to pass to them. These procedures are used to translate values in
-either Gray, RGB, or CMYK color spaces into device colorant values. A
-separate procedure is not required for the DeviceN and Separation color
-spaces since these already represent device colorants.
-
-<p>In many cases, the device returned in <code>tdev</code> will be the
-same as <code>dev</code>, but the caller should not rely on this. For
-cases where we have a chain of devices (perhaps because of a subclass
-or compositor device having been introduced internally as part of the
-rendering process), the actual device that needs to do the color mapping
-may be a child device of the original one. In such cases <code>tdev</code>
-will be returned as a different value to <code>dev</code>.
-</p>
-
-<p>
-The default procedure returns a list of procedures based upon
-<code>color_info.num_components</code>. These procedures are appropriate
-for DeviceGray, DeviceRGB, or DeviceCMYK process color model devices. A
-procedure must be defined if another process color model is used by the
-device or spot colors are to be supported. All these procedures take a
-<code>gx_device</code> pointer; these should be called with the value
-returned in <code>tdev</code> NOT the initial value of <code>dev</code>.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>gx_color_index (*encode_color)(gx_device&nbsp;* dev,
-gx_color_value&nbsp;* cv)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Map a set of device color values into a <code>gx_color_index</code>
-value. The range of legal values of the
-arguments is 0 to <code>gx_max_color_value</code>. The default procedure
-packs bits into a <code>gx_color_index</code> value based upon the
-values in <code>color_info.depth</code> and
-<code>color_info.num_components</code>.
-
-<p>
-Note that the <code>encode_color</code> procedure
-must not return <code>gx_no_color_index</code> (all 1s).</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>int (*decode_color)(gx_device&nbsp;*, gx_color_index&nbsp;color,
-gx_color_value&nbsp;*&nbsp;CV)</code> <b><em>[OPTIONAL]</em></b> </dt>
-<dd>This is the inverse of the <code>encode_color</code> procedure.
-Map a <code>gx_color_index</code> value to color values. The default
-procedure unpacks bits from the <code>gx_color_index</code> value based upon
-the values in <code>color_info.depth</code> and
-<code>color_info.num_components</code>.</dd>
-</dl>
-
-<dl>
-<dt><code>typedef&nbsp;enum&nbsp;{&nbsp;go_text,
-go_graphics&nbsp;}&nbsp;graphic_object_type;&nbsp;int
-(*get_alpha_bits)(gx_device&nbsp;*dev,
-graphic_object_type&nbsp;type)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>This procedure returns the number of bits to use for anti-aliasing.
-The default implementation simply returns the color_info.anti_alias
-member of the driver structure.</dd>
-</dl>
-
-<dl>
-<dt><code>void (*update_spot_equivalent_colors)(gx_device&nbsp;*,
-const gs_state *)</code>
-<b><em>[OPTIONAL]</em></b></dt>
-<dd>This routine provides a method for the device to gather an equivalent
-color for spot colorants. This routine is called when a Separation or DeviceN
-color space is installed. See comments at the start of
-<a href="../base/gsequivc.c">gsequivc.c</a>. Note: This procedure is only needed
-for devices that support spot colorants and also need to have an equivalent
-color for simulating the appearance of the spot colorants.</dd>
-</dl>
-
-<h3><a name="Pixel_level_drawing"></a>Pixel-level drawing</h3>
-
-<p>
-This group of drawing operations specifies data at the pixel level. All
-drawing operations use device coordinates and device color values.</p>
-
-<dl>
-<dt><code>int (*fill_rectangle)(gx_device&nbsp;*, int&nbsp;x,
-int&nbsp;y, int&nbsp;width, int&nbsp;height,
-gx_color_index&nbsp;color)</code></dt>
-<dd>Fill a rectangle with a color. The set of pixels filled is {(px,py) |
-x &lt;= px &lt; x + width and y &lt;= py &lt; y + height}. In other words,
-the point <em>(x,y)</em> is included in the rectangle, as are
-<em>(x+w-1,y)</em>, <em>(x,y+h-1)</em>, and <em>(x+w-1,y+h-1)</em>, but
-<b><em>not</em></b> <em>(x+w,y)</em>, <em>(x,y+h)</em>, or
-<em>(x+w,y+h)</em>. If <code>width</code>&nbsp;&lt;=&nbsp;0 or
-height&nbsp;&lt;=&nbsp;0, <code>fill_rectangle</code> should return 0
-without drawing anything.
-
-<p>
-Note that <code>fill_rectangle</code> is the only non-optional procedure
-in the driver interface.</p>
-</dd>
-</dl>
-
-<h4><a name="Bitmap_imaging"></a>Bitmap imaging</h4>
-
-<p>
-Bitmap (or pixmap) images are stored in memory in a nearly standard way.
-The first byte corresponds to <em>(0,0)</em> in the image coordinate
-system: bits (or polybit color values) are packed into it left to right.
-There may be padding at the end of each scan line: the distance from one
-scan line to the next is always passed as an explicit argument.</p>
-
-<dl>
-<dt><code>int (*copy_mono)(gx_device&nbsp;*,
-const&nbsp;unsigned&nbsp;char&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
-gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
-int&nbsp;height, gx_color_index&nbsp;color0,
-gx_color_index&nbsp;color1)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Copy a monochrome image (similar to the PostScript image operator).
-Each scan line is raster bytes wide. Copying begins at
-(<code>data_x</code>,0) and transfers a rectangle of the given width and
-height to the device at device coordinate <em>(x,y)</em>. (If the transfer
-should start at some non-zero y value in the data, the caller can adjust
-the data address by the appropriate multiple of the raster.) The copying
-operation writes device color <code>color0</code> at each 0-bit, and
-<code>color1</code> at each 1-bit: if <code>color0</code> or
-<code>color1</code> is <code>gx_no_color_index</code>, the device
-pixel is unaffected if the image bit is 0 or 1 respectively. If
-<code>id</code> is different from <code>gx_no_bitmap_id</code>, it
-identifies the bitmap contents unambiguously; a call with the same
-<code>id</code> will always have the same <code>data</code>,
-<code>raster</code>, and data contents.
-
-<p>
-This operation, with
-<code>color0</code>&nbsp;=&nbsp;<code>gx_no_color_index</code>, is
-the workhorse for text display in Ghostscript, so implementing it
-efficiently is very important.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>int (*strip_tile_rectangle)(gx_device&nbsp;*,
-const&nbsp;gx_strip_bitmap&nbsp;*tile, int&nbsp;x, int&nbsp;y,
-int&nbsp;width, int&nbsp;height, gx_color_index&nbsp;color0,
-gx_color_index&nbsp;color1, int&nbsp;phase_x, int&nbsp;phase_y)</code>
-<b><em>[OPTIONAL]</em></b></dt>
-<dd>Tile a rectangle. Tiling consists of doing multiple
-<code>copy_mono</code> operations to fill the rectangle with copies of
-the tile. The tiles are aligned with the device coordinate system, to
-avoid "seams". Specifically, the (<code>phase_x</code>,
-<code>phase_y</code>) point of the tile is aligned with the origin of
-the device coordinate system. (Note that this is backwards from the
-PostScript definition of halftone phase.) <code>phase_x</code> and
-<code>phase_y</code> are guaranteed to be in the range
-<em>[0..</em><code>tile-&gt;width</code><em>)</em> and
-<em>[0..</em><code>tile-&gt;height</code><em>)</em> respectively.
-
-<p>
-If <code>color0</code> and <code>color1</code> are both
-<code>gx_no_color_index</code>, then the tile is a color pixmap, not a
-bitmap: see the next section.</p>
-
-<p>
-This operation is the workhorse for halftone filling in Ghostscript, so
-implementing it efficiently for solid tiles (that is, where either
-<code>color0</code> and <code>color1</code> are both
-<code>gx_no_color_index</code>, for colored halftones, or neither one is
-<code>gx_no_color_index</code>, for monochrome halftones) is very
-important.</p>
-</dd>
-</dl>
-
-<h4><a name="Pixmap_imaging"></a>Pixmap imaging</h4>
-
-<p>
-Pixmaps are just like bitmaps, except that each pixel may occupy more than
-one bit. In "chunky" or "Z format", all the bits for each pixel are grouped
-together. For <code>copy_color</code>, the number of bits per pixel is given
-by the <code>color_info.depth</code> parameter in the device structure. The
-legal values are 1, 2, 4, 8, 16, 24, 32, 40, 48, 56, or 64. The pixel values
-are device color codes (that is, whatever it is that <code>encode_color</code> returns).
-<br><br>
-If the data is planar, then each plane is contiguous, and the number
-of planes is given by <code>color_info.num_components</code>. The bits per
-component is <code>depth/num_components</code>.</p>
-
-<dl>
-<dt><code>int (*copy_color)(gx_device&nbsp;*,
-const&nbsp;unsigned&nbsp;char&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
-gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
-int&nbsp;height)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Copy a color image with multiple bits per pixel. The raster is in
-bytes, but <code>x</code> and <code>width</code> are in pixels, not
-bits. If <code>id</code> is different from
-<code>gx_no_bitmap_id</code>, it identifies the bitmap contents
-unambiguously; a call with the same <code>id</code> will always have the
-same <code>data</code>, <code>raster</code>, and data contents.</dd>
-</dl>
-
-<dl>
-<dt><code>int (*copy_planes)(gx_device&nbsp;*,
-const&nbsp;unsigned&nbsp;char&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
-gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
-int&nbsp;height, int&nbsp;plane_height)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Copy an image with data stored in planar format. The raster is in
-bytes, but <code>x</code> and <code>width</code> are in pixels, not
-bits. If <code>id</code> is different from <code>gx_no_bitmap_id</code>,
-it identifies the bitmap contents unambiguously; a call with the same
-<code>id</code> will always have the same <code>data</code>, <code>raster</code>,
-and data contents.<br><br>
-Each plane is <code>depth/num_components</code> number of bits and the distance between
-planes is <code>plane_height</code> number of rows. The height is always less
-than or equal to the plane_height.</dd>
-</dl>
-
-<p>
-We do not provide a separate procedure for tiling with a pixmap; instead,
-<code>strip_tile_rectangle</code> can also take colored tiles. This is
-indicated by the <code>color0</code> and <code>color1</code>
-arguments' both being <code>gx_no_color_index</code>. In this case, as
-for <code>copy_color</code>, the <code>raster</code> and
-<code>height</code> in the "bitmap" are interpreted as for real bitmaps,
-but the <code>x</code> and <code>width</code> are in pixels, not
-bits.</p>
-
-<dl>
-<dt>
-<code>
-<pre>
-typedef enum {
- transform_pixel_region_begin = 0,
- transform_pixel_region_data_needed = 1,
- transform_pixel_region_process_data = 2,
- transform_pixel_region_end = 3
- } transform_pixel_region_reason;
-typedef struct {
- void *state;
- union {
- struct {
- const gs_int_rect *clip;
- int w; /* source width */
- int h; /* source height */
- int spp;
- const gx_dda_fixed_point *pixels; /* DDA to enumerate the destination positions of pixels across a row */
- const gx_dda_fixed_point *rows; /* DDA to enumerate the starting position of each row */
- gs_logical_operation_t lop;
- } init;
- struct {
- const unsigned char *buffer[GX_DEVICE_COLOR_MAX_COMPONENTS];
- int data_x;
- gx_cmapper_t *cmapper;
- const gs_gstate *pgs;
- } process_data;
- } u;
-} transform_pixel_region_data;
-</pre>
-int (*transform_pixel_region)(gx_device&nbsp;*,
-transform_pixel_reason, transform_pixel_reason_data *data)</code> <b><em>[OPTIONAL]</em></b>
-<dd>Transform a 2-dimensional region of pixels into the destination.
-Given a 2d source block of pixels (supplied as scanline data), this
-function transforms that data, maps it through the supplied colour
-lookup function, clips it, and plots it into the device.
-
-<p>In all calls to this function a negative return value indicates an error.</p>
-
-<p>Called first with the <code>transform_pixel_region_init</code> reason code,
-this prepares for subsequent calls to scale a region as described in the
-<code>data.u.init</code> structure. A pointer to any state required for
-this should be written into <code>data.state</code>, and the caller must
-pass that in to subsequent calls.</p>
-
-<p>Subsequently this will be called with <code>transform_pixel_region_data_needed</code>.
-The function will then check to see if the next scanline of data will be trivially
-clipped away. If so, then it will return zero to indicate that it is not needed.
-This can help the caller to avoid unnecessary processing. A positive return value
-indicates that the line is required.</p>
-
-<p>For every line where the data is required, the function will be called with
-<code>transform_pixel_region_process_data</code>. The function will then read
-and process the line from <code>data.u.process_data</code>.
-The data in the buffer is packed 8 bit values, which will be fed into the supplied
-<code>cmapper</code> to set the device color as required. This is then written
-into the device.</p>
-
-<p>Once all the scanlines have been fed through calls to <code>transform_pixel_region_data_needed</code>
-and <code>transform_pixel_region_process_data</code>, a final call with <code>transform_pixel_region_end</code>
-is made that frees the state.</p>
-
-<p>The default implementation of this device function will generally break the pixel
-data down into calls to <code>fill_rectangle</code>, though in some cases (notably
-the portrait 8 bit per component output case), a faster route through <code>copy_color</code>
-can be used.</p>
-
-<p>Memory devices offer a version of this device function that can accelerate direct
-plotting to the memory array.</p>
-
-<p>NOTE: Currently the clipping rectangle is not honoured for skewed (not portrait or landscape)
-transformations. This is allowed for in the callers.
-</p>
-</dd>
-
-</dl>
-
-<h4><a name="Compositing"></a>Compositing</h4>
-
-<p>
-In addition to direct writing of opaque pixels, devices must also support
-compositing. Currently two kinds of compositing are defined
-(<code>RasterOp</code> and alpha-based), but more may be added in the
-future.</p>
-
-<dl>
-<dt><code>int (*copy_alpha)(gx_device&nbsp;*dev,
-const&nbsp;unsigned&nbsp;char&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
-gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
-int&nbsp;height, gx_color_index&nbsp;color, int&nbsp;depth)</code>
-<b><em>[OPTIONAL]</em></b></dt>
-<dd>This procedure is somewhat misnamed: it was added to the interface
-before we really understood alpha channel and compositing.
-
-<p>
-Fill a given region with a given color modified by an individual alpha
-value for each pixel. For each pixel, this is equivalent to
-alpha-compositing with a source pixel whose alpha value is obtained from
-the pixmap (<code>data</code>, <code>data_x</code>, and
-<code>raster</code>) and whose color is the given color (which has
-<b><em>not</em></b> been premultiplied by the alpha value), using the Sover
-rule.</p>
-
-<p><code>depth</code>, the number of bits per alpha value, is either
-2, 4 or 8. Any <code>copy_alpha</code> routine must accept being called
-with an 8 bit depth. In addition they should accept either 2 or 4 if
-the corresponding <code>get_alpha_bits</code> procedure returns either
-of those values.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>int (*copy_alpha_hl_color)(gx_device&nbsp;*dev,
-const&nbsp;byte&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
-gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
-int&nbsp;height, const&nbsp;gx_drawing_color&nbsp;*pdcolor, int&nbsp;depth)</code>
-<b><em>[OPTIONAL]</em></b></dt>
-<dd>Equivalent function to copy_alpha, using high level color rather
-than a gx_color_index.</dd>
-</dl>
-
-<dl>
-<dt><code>int (*composite)(dev_t&nbsp;*dev,
-gx_device_t&nbsp;**pcdev, const&nbsp;gs_composite_t&nbsp;*pcte,
-const&nbsp;gs_imager_state&nbsp;*pis, gs_memory_t&nbsp;*memory)</code>
-<b><em>[OPTIONAL]</em></b> </dt>
-<dd>Requests that a device perform a compositing operation; the device
-should composite data written to it with the device's existing data,
-according to the compositing function defined by <code>*pcte</code>.
-If a device cannot perform such an operation itself, it will create a
-compositor device to wrap itself that will perform such operations for
-it. Accordingly, the caller must watch the return values from this
-function to understand if a new device has been created to which future
-calls should be made.
-<p>
-Devices will normally implement this in one of the following standard ways:
-
-<ul>
-<li>Devices that don't do any imaging and don't forward any imaging
-operations (for example, the null device, the hit detection device, and the
-clipping list accumulation device) simply set *pcdev to themselves, and
-return 0, which effectively ignores the compositing function.</li>
-
-<li>"Leaf" devices that do imaging and have no special optimizations for
-compositing (for example, some memory devices) ask the
-<code>gs_composite_t</code> to create a default compositor device that
-'wraps' the current device. They put this in <code>*pcdev</code> and
-return 1.</li>
-
-<li>Leaf devices that can implement some kinds of compositing operation
-efficiently (for example, monobit memory devices and RasterOp) inspect the
-type and values of <code>*pcte</code> to determine whether it specifies
-such an operation: if so, they create a specialized compositor, and if not,
-they ask the <code>gs_composite_t</code> to create a default compositor. They
-place this in <code>*pcdev</code> and return 1.</li>
-</ul>
-
-<p>In short, on every non-error return, <code>*pcdev</code> will be set
-either to the leaf device (in the case where no special compositing is
-required), or to the device that does the compositing. If the return
-code is 1, then <code>*pcdev</code> is a new device that was created
-to wrap <code>dev</code> to perform the compositing for it. Callers
-may need to spot this case so as to update which device future
-operations are sent to.</p>
-
-<p>For forwarding devices, for example, if the call returns 1, then
-they should update their target device to be the new device. For the
-graphics library, if the call returns 1, then it should update the
-current device to be the new one.</p>
-
-<p>
-Other kinds of forwarding devices, which don't fall into any of these
-categories, require special treatment. In principle, what they do is ask
-their target to create a compositor, and then create and return a copy of
-themselves with the target's new compositor as the target of the copy.
-There is a possible default implementation of this approach: if the
-original device was <b>D</b> with target <b>T</b>, and <b>T</b> creates a
-compositor <b>C</b>, then the default implementation creates a device
-<b>F</b> that for each operation temporarily changes <b>D</b>'s target to
-<b>C</b>, forwards the operation to <b>D</b>, and then changes <b>D</b>'s
-target back to <b>T</b>. However, the Ghostscript library currently only
-creates a compositor with an imaging forwarding device as target in a few
-specialized situations (banding, and bounding box computation), and these
-are handled as special cases.</p>
-
-<p>
-Note that the compositor may have a different color space, color
-representation, or bit depth from the device to which it is compositing.
-For example, alpha-compositing devices use standard-format chunky color
-even if the underlying device doesn't.</p>
-
-<p>
-Closing a compositor frees all of its storage, including the compositor
-itself. However, since the <code>composite</code> call may
-return the same device, clients must check for this case, and only call the
-close procedure if a separate device was created.</p>
-</dd>
-</dl>
-
-<h3><a name="Polygon_level_drawing"></a>Polygon-level drawing</h3>
-
-<p>
-In addition to the pixel-level drawing operations that take integer device
-coordinates and pure device colors, the driver interface includes
-higher-level operations that draw polygons using fixed-point coordinates,
-possibly halftoned colors, and possibly a non-default logical operation.</p>
-
-<p>
-The <code>fill_</code>* drawing operations all use the center-of-pixel
-rule: a pixel is colored iff its center falls within the polygonal region
-being filled. If a pixel center <em>(X+0.5,Y+0.5)</em> falls exactly on
-the boundary, the pixel is filled iff the boundary is horizontal and the
-filled region is above it, or the boundary is not horizontal and the filled
-region is to the right of it.</p>
-
-<dl>
-<dt><code>int (*fill_trapezoid)(gx_device&nbsp;*dev, const&nbsp;
-gs_fixed_edge&nbsp;*left, const&nbsp;gs_fixed_edge&nbsp;*right,
-fixed&nbsp;ybot, fixed&nbsp;ytop, bool&nbsp;swap_axes,
-const&nbsp;gx_drawing_color&nbsp;*pdcolor,
-gs_logical_operation_t&nbsp;lop)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Fill a trapezoid. The bottom and top edges are parallel to the x
-axis, and are defined by <code>ybot</code> and <code>ytop</code>,
-respectively. The left and right edges are defined by <code>left</code>
-and <code>right</code>. Both of these represent lines (<code>gs_fixed_edge</code>
-is defined in <a href="../base/gxdevcli.h">gxdevcli.h</a> and consists
-of <code>gs_fixed_point</code> <code>start</code> and <code>end</code> points).
-The y coordinates of these lines need not have any specific relation to
-<code>ybot</code> and <code>ytop</code>. The routine is defined this way so
-that the filling algorithm can subdivide edges and still guarantee
-that the exact same pixels will be filled. If
-<code>swap_axes</code> is set, the meanings of X and Y are
-interchanged.
-</dd>
-
-<dt><code>int (*fill_parallelogram)(gx_device&nbsp;*dev,
-fixed&nbsp;px, fixed&nbsp;py, fixed&nbsp;ax, fixed&nbsp;ay, fixed&nbsp;bx,
-fixed&nbsp;by, const&nbsp;gx_drawing_color&nbsp;*pdcolor,
-gs_logical_operation_t&nbsp;lop)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Fill a parallelogram whose corners are <em>(px,py)</em>,
-<em>(px+ax,py+ay)</em>, <em>(px+bx,py+by)</em>, and
-<em>(px+ax+bx,py+ay+by)</em>. There are no constraints on the values of
-any of the parameters, so the parallelogram may have any orientation
-relative to the coordinate axes.</dd>
-
-<dt><code>int (*fill_triangle)(gx_device&nbsp;*dev, fixed&nbsp;px,
-fixed&nbsp;py, fixed&nbsp;ax, fixed&nbsp;ay, fixed&nbsp;bx, fixed&nbsp;by,
-const&nbsp;gx_drawing_color&nbsp;*pdcolor,
-gs_logical_operation_t&nbsp;lop)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Fill a triangle whose corners are <em>(px,py)</em>,
-<em>(px+ax,py+ay)</em>, and <em>(px+bx,py+by)</em>.</dd>
-
-<dt><code>int (*draw_thin_line)(gx_device&nbsp;*dev,
-fixed&nbsp;fx0, fixed&nbsp;fy0, fixed&nbsp;fx1, fixed&nbsp;fy1,
-const&nbsp;gx_drawing_color&nbsp;*pdcolor,
-gs_logical_operation_t&nbsp;lop)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Draw a one-pixel-wide line from <em>(fx0,fy0)</em> to
-<em>(fx1,fy1)</em>.</dd></dl>
-
-<dl><dt></dt><dd>
-
-<h3><a name="Linear_color_drawing"></a>Linear color drawing</h3>
-
-<p>
-Linear color functions allow fast high quality rendering of
-shadings on continuous tone devices. They implement filling simple areas
-with a lineary varying color. These functions are not called if the device applies halftones,
-or uses a non-separable or a non-linear color model.</p>
-
-<dl>
-<dt><code> int (*fill_linear_color_triangle)
- (dev_t *dev, const gs_fill_attributes *fa,
- const gs_fixed_point *p0, const gs_fixed_point *p1,
- const gs_fixed_point *p2,
- const frac31 *c0, const frac31 *c1, const frac31 *c2)
-</code>
-<b><em>[OPTIONAL]</em></b></dt>
-
-<dd>This function is the highest level one within the linear color function group.
-It fills a triangle with a linearly varying color.
-Arguments specify 3 points in the device space - vertices of a triangle, and their colors.
-The colors are represented as vectors of positive fractional numbers, each of which
-represents a color component value in the interval <code>[0,1]</code>.
-The number of components in a vector in the number of color
-components in the device (process) color model.</dd>
-<dd>
-The implementation fills entire triangle.
-The filling rule is same as for <a href="#Polygon_level_drawing">Polygon-level drawing</a>.
-The color of each pixel within the triangle is computed as a linear interpolation
-of vertex colors.</dd>
-<dd>
-The implementation may reject the request if the area or the color appears too complex
-for filling in a single action. For doing that the implementation returns 0 and must not
-paint any pixel. In this case the graphics library will perform a subdivision of the area
-into smaller triangles and call the function again with smaller areas.</dd>
-<dd>
-<b><em>Important note :</em></b> Do not try to decompose the area within
-the implementation of <code> fill_linear_color_triangle</code>, because
-it can break the plane coverage contiguity and cause a dropout.
-Instead request that the graphics library should perform the decomposition.
-The graphics libary is smart enough to do that properly.</dd>
-<dd>
-<b><em>Important note :</em></b>
-The implementation must handle a special case, when only 2 colors are specified.
-It happens if <code>p2</code> is <code>NULL</code>.
-This means that the color does not depend on the X coordinate,
-i.e. it forms a linear gradient along the Y axis.
-The implementation must not reject (return 0) such cases.</dd>
-<dd>
-<b><em>Important note :</em></b>The device color component
-value 1 may be represented with several hexadecimal values :
-<code>0x7FFF0000</code>, <code>0x7FFFF000</code>, <code>0x7FFFFF00</code>, etc.,
-because the precision here exceeds the color precision of the device.
-To convert a <code>frac31</code> value into a device color component value,
-fist drop (ignore) the sign bit, then drop least significant bits -
-so many ones as you need to fit the device color precision.</dd>
-<dd>
-<b><em>Important note :</em></b> The <code>fa</code> argument may contain
-the <code>swap_axes</code> bit set. In this case the implementation must swap (transpose)
-<code>X</code> and <code>Y</code> axes.</dd>
-<dd>
-<b><em>Important note :</em></b> The implementation must not paint outside the
-clipping rectangle specified in the <code>fa</code> argument.
-If <code>fa-&gt;swap_axes</code> is true, the clipping rectangle is transposed.</dd>
-<dd>
-See <code> gx_default_fill_linear_color_triangle </code>
-in <code>gdevddrw.c</code> for sample code.</dd>
-</dl>
-
-
-<dl>
-<dt><code> int (*fill_linear_color_trapezoid)
- (dev_t *dev, const gs_fill_attributes *fa,
- const gs_fixed_point *p0, const gs_fixed_point *p1,
- const gs_fixed_point *p2, const gs_fixed_point *p3,
- const frac31 *c0, const frac31 *c1,
- const frac31 *c2, const frac31 *c2)
-</code><b><em>[OPTIONAL]</em></b></dt>
-
-<dd>This function is a lower level one within the linear color function group.
-The default implementation of <code> fill_linear_color_triangle </code>
-calls this function 1-2 times per triangle. Besides that,
-this function may be called by the graphics library for other special cases,
-when a decomposition into triangles appears undesirable.</dd>
-<dd>
-While the prototype can specify a bilinear color,
-we assume that the implementation handles linear colors only.
-This means that the implementation can ignore any of <code> c0, c1, c2, c3 </code>.
-The graphics library takes a special care of the color linearity
-when calling this function. The reason for passing all 4 color arguments
-is to avoid color precision problems.</dd>
-<dd>
-Similarly to <code> fill_linear_color_triangle </code>,
-this function may be called with only 2 colors, and may reject areas as being too complex.
-All those important notes are applicable here.</dd>
-<dd>
-Sample code may be found in in <code>gxdtfill.h</code>; be aware it's rather complicated.
-A linear color function is generated from it as <code> gx_fill_trapezoid_ns_lc </code>
-with the following template parameters :
-
-<pre>
-#define LINEAR_COLOR 1
-#define EDGE_TYPE gs_linear_color_edge
-#define FILL_ATTRS const gs_fill_attributes *
-#define CONTIGUOUS_FILL 0
-#define SWAP_AXES 0
-#define FILL_DIRECT 1
-</pre>
-<p>See the helplers <code>init_gradient</code>,
-<code>step_gradient</code> (defined in in <code>gdevddrw.c</code>), how to manage colors.</p>
-<p>See <code>check_gradient_overflow</code>
-(defined in in <code>gdevddrw.c</code>), as an example of an area
-that can't be painted in a single action due to 64-bits fixed overflows.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code> int (*fill_linear_color_scanline)
- (dev_t *dev, const gs_fill_attributes *fa,
- int i, int j, int w,
- const frac31 *c0,
- const int32_t *c0_f,
- const int32_t *cg_num,
- int32_t cg_den)
-</code>
-<b><em>[OPTIONAL]</em></b></dt>
-<dd>This function is the lowest level one within the linear color function group.
-It implements filling a scanline with a linearly varying color.
-The default implementation for <code> fill_linear_color_trapezoid </code>
-calls this function, and there are no other calls to it from the graphics libary.
-Thus if the device implements <code> fill_linear_color_triangle </code> and
-<code> fill_linear_color_trapezoid </code> by own means,
-this function may be left unimplemented.</dd>
-<dd>
-<code>i</code> and <code>j</code> specify device coordinates (indices)
-of the starting pixel of the scanline, <code>w</code> specifies the
-width of the scanline, i.e. the number of pixels to be painted to the right from
-the starting pixel, including the starting pixel.</dd>
-<dd>
-<code>c0</code> specifies the color for the starting pixel
-as a vector of fraction values, each of which represents
-a color value in the interval <code>[0,1]</code>.</dd>
-<dd>
-<code>c0_f</code> specify a fraction part of the color for the starting pixel.
-See the formula below about using it.</dd>
-<dd>
-<code>cg_num</code> specify a numerator for the color gradient -
-a vector of values in <code>[-1,1]</code>, each of which correspond to a color component.</dd>
-<dd>
-<code>cg_den</code> specify the denominator for the color gradient -
-a value in <code>[-1,1]</code>.</dd>
-<dd>
-The color for the pixel <code>[i + k, j]</code> to be computed like this :
-<pre><code>
- (double)(c0[n] + (c0_f[n] + cg_num[n] * k) / cg_den) / (1 ^ 31 - 1)
-</code></pre></dd>
-<dd>where <code>0 &lt;= k &lt;= w </code>, and <code>n</code> is a device color component index.</dd>
-
-<dd>
-<b><em>Important note :</em></b> The <code>fa</code> argument may contain
-the <code>swap_axes</code> bit set. In this case the implementation must swap (transpose)
-<code>X</code> and <code>Y</code> axes.</dd>
-<dd>
-<b><em>Important note :</em></b> The implementation must not paint outside the
-clipping rectangle specified in the <code>fa</code> argument.
-If <code>fa-&gt;swap_axes</code> is true, the clipping rectangle is transposed.</dd>
-<dd>
-See <code> gx_default_fill_linear_color_scanline</code>
-in <code>gdevdsha.c</code> as a sample code.</dd>
-</dl>
-
-
-<h3><a name="High_level_drawing"></a>High-level drawing</h3>
-
-<p>
-In addition to the lower-level drawing operations described above, the
-driver interface provides a set of high-level operations. Normally these
-will have their default implementation, which converts the high-level
-operation to the low-level ones just described; however, drivers that
-generate high-level (vector) output formats such as pdfwrite, or communicate with devices
-that have firmware for higher-level operations such as polygon fills, may
-implement these high-level operations directly. For more details, please
-consult the source code, specifically:</p>
-
-<blockquote><table>
-<tr valign="top"> <th align="left">Header</th>
-
- <th align="left">Defines</th></tr>
-<tr valign="top"> <td><a href="../base/gxpaint.h">gxpaint.h</a></td>
-
- <td><code>gx_fill_params</code>, <code>gx_stroke_params</code></td></tr>
-<tr valign="top"> <td><a href="../base/gxfixed.h">gxfixed.h</a></td>
-
- <td><code>fixed</code>, <code>gs_fixed_point</code> (used by
- <code>gx_*_params</code>)</td></tr>
-<tr valign="top"> <td><a href="../base/gxgstate.h">gxgstate.h</a></td>
-
- <td><code>gs_imager_state</code> (used by <code>gx_*_params</code>)</td></tr>
-<tr valign="top"> <td><a href="../base/gxline.h">gxline.h</a></td>
-
- <td><code>gx_line_params</code> (used by <code>gs_imager_state</code>)</td></tr>
-<tr valign="top"> <td><a href="../base/gslparam.h">gslparam.h</a></td>
-
- <td>line cap/join values (used by <code>gx_line_params</code>)</td></tr>
-<tr valign="top"> <td><a href="../base/gxmatrix.h">gxmatrix.h</a></td>
-
- <td><code>gs_matrix_fixed</code> (used by <code>gs_imager_state</code>)</td></tr>
-<tr valign="top"> <td><a href="../base/gspath.h">gspath.h</a>, <a href="../base/gxpath.h">gxpath.h</a>, <a href="../base/gzpath.h">gzpath.h</a></td>
-
- <td><code>gx_path</code></td></tr>
-<tr valign="top"> <td><a href="../base/gxcpath.h">gxcpath.h</a>, <a href="../base/gzcpath.h">gzcpath.h</a></td>
-
- <td><code>gx_clip_path</code></td></tr>
-</table></blockquote>
-
-<p>
-For a minimal example of how to implement the high-level drawing operations,
-see <a href="../devices/gdevtrac.c">gdevtrac.c</a>.</p>
-
-<h4><a name="Paths"></a>Paths</h4>
-
-<dl>
-<dt><code>int (*fill_path)(gx_device&nbsp;*dev,
-const&nbsp;gs_imager_state&nbsp;*pis, gx_path&nbsp;*ppath,
-const&nbsp;gx_fill_params&nbsp;*params,
-const&nbsp;gx_drawing_color&nbsp;*pdcolor,
-const&nbsp;gx_clip_path&nbsp;*pcpath)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Fill the given path, clipped by the given clip path, according to the
-given parameters, with the given color. The clip path pointer may be
-<code>NULL</code>, meaning do not clip.</dd>
-<dd>
-The implementation must paint the path with the specified device color,
-which may be either a pure color, or a pattern. If the device can't
-handle non-pure colors, it should check the color type and
-call the default implementation gx_default_fill_path for cases
-which it can't handle. The default implementation will perform
-a subdivision of the area to be painted, and will
-call other device virtual functions (such as fill_linear_color_triangle)
-with simpler areas.</dd>
-
-</dl>
-
-<dl>
-<dt><code>int (*stroke_path)(gx_device&nbsp;*dev,
-const&nbsp;gs_imager_state&nbsp;*pis, gx_path&nbsp;*ppath,
-const&nbsp;gx_stroke_params&nbsp;*params,
-const&nbsp;gx_drawing_color&nbsp;*pdcolor,
-const&nbsp;gx_clip_path&nbsp;*pcpath)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Stroke the given path, clipped by the given clip path, according to the
-given parameters, with the given color. The clip path pointer may be
-<code>NULL</code>, meaning not to clip.</dd>
-</dl>
-
-<dl>
-<dt><code>int (*fill_mask)(gx_device&nbsp;*dev,
-const&nbsp;byte&nbsp;*data, int&nbsp;data_x, int&nbsp;raster,
-gx_bitmap_id&nbsp;id, int&nbsp;x, int&nbsp;y, int&nbsp;width,
-int&nbsp;height, const&nbsp;gx_drawing_color&nbsp;*pdcolor, int&nbsp;depth,
-int&nbsp;command, const&nbsp;gx_clip_path&nbsp;*pcpath)</code>
-<b><em>[OPTIONAL]</em></b></dt>
-<dd>Color the 1-bits in the given mask (or according to the alpha values,
-if <code>depth</code>&nbsp;&gt;&nbsp;1), clipped by the given clip path,
-with the given color and logical operation. The clip path pointer may be
-<code>NULL</code>, meaning do not clip. The parameters
-<code>data</code>, ..., <code>height</code> are as for
-<code>copy_mono</code>; depth is as for <code>copy_alpha</code>;
-command is as below.</dd>
-</dl>
-
-<h4><a name="F_spec"></a>The function specification f</h4>
-
-<p>
-"Command" indicates the raster operation and transparency as follows:</p>
-
-<blockquote><table>
-<tr valign="bottom">
- <th colspan ="2">Bits</th>
-</tr>
-<tr valign="top"> <td>7-0</td>
-
- <td>raster op</td></tr>
-<tr valign="top"> <td>8</td>
-
- <td>0 if source opaque, 1 if source transparent</td></tr>
-<tr valign="top"> <td>9</td>
-
- <td>0 if texture opaque, 1 if texture transparent</td></tr>
-<tr valign="top"> <td>10</td>
-
- <td>1 if pdf transparency is in use, 0 otherwise. This makes no
-difference to the rendering, but forces the raster operation to be considered
- non-idempotent by internal routines.</td></tr>
-<tr valign="top"> <td>11</td>
-
- <td>1 if the target of this operation is a specific plane, rather
-than all planes. The plane in question is given by bits 13 upwards. This
-is only used by the planar device.</td></tr>
-<tr valign="top"> <td>12-</td>
-
- <td>If bit 11 = 1, then bits 12 upwards give the plane number to
- operate on. Otherwise, should be set to 0.</td></tr>
-</table></blockquote>
-
-<p>In general most devices should just check to see that bits they do not
-handle (11 and above typically) are zero, and should jump to the default
- implementation, or return an error otherwise.</p>
-
-<p>
-The raster operation follows the Microsoft and H-P specification. It is an
-8-element truth table that specifies the output value for each of the
-possible 2&times;2&times;2 input values as follows:</p>
-
-<blockquote><table>
-<tr valign="bottom">
- <th>Bit</th>
-
- <th>Texture</th>
-
- <th>Source</th>
-
- <th>Destination</th></tr>
-<tr valign="top"> <td align="center">7</td>
-
- <td align="center">1</td>
-
- <td align="center">1</td>
-
- <td align="center">1</td></tr>
-<tr valign="top"> <td align="center">6</td>
-
- <td align="center">1</td>
-
- <td align="center">1</td>
-
- <td align="center">0</td></tr>
-<tr valign="top"> <td align="center">5</td>
-
- <td align="center">1</td>
-
- <td align="center">0</td>
-
- <td align="center">1</td></tr>
-<tr valign="top"> <td align="center">4</td>
-
- <td align="center">1</td>
-
- <td align="center">0</td>
-
- <td align="center">0</td></tr>
-<tr valign="top"> <td align="center">3</td>
-
- <td align="center">0</td>
-
- <td align="center">1</td>
-
- <td align="center">1</td></tr>
-<tr valign="top"> <td align="center">2</td>
-
- <td align="center">0</td>
-
- <td align="center">1</td>
-
- <td align="center">0</td></tr>
-<tr valign="top"> <td align="center">1</td>
-
- <td align="center">0</td>
-
- <td align="center">0</td>
-
- <td align="center">1</td></tr>
-<tr valign="top"> <td align="center">0</td>
-
- <td align="center">0</td>
-
- <td align="center">0</td>
-
- <td align="center">0</td></tr>
-</table></blockquote>
-
-<p>
-Transparency affects the output in the following way. A source or texture
-pixel is considered transparent if its value is all 1s (for instance, 1 for
-bitmaps, <tt>0xffffff</tt> for 24-bit RGB pixmaps) <b><em>and</em></b> the
-corresponding transparency bit is set in the command. For each pixel, the
-result of the Boolean operation is written into the destination iff neither
-the source nor the texture pixel is transparent. (Note that the HP
-RasterOp specification, on which this is based, specifies that if the
-source and texture are both all 1s and the command specifies transparent
-source and opaque texture, the result <b><em>should</em></b> be written in
- the output. We think this is an error in the documentation.) </p>
-
-<h4><a name="Images"></a>Images</h4>
-
-<p>
-Similar to the high-level interface for fill and stroke graphics, a high-level
-interface exists for bitmap images. The procedures in this part of the
-interface are optional.</p>
-
-<p>
-Bitmap images come in a variety of types, corresponding closely (but not
-precisely) to the PostScript ImageTypes. The generic or common part of all
-bitmap images is defined by:</p>
-
-<blockquote>
-<pre>typedef struct {
- const gx_image_type_t *type;
- gs_matrix ImageMatrix;
-} gs_image_common_t;</pre>
-</blockquote>
-
-<p>
-Bitmap images that supply data (all image types except
-<code>image_type_from_device</code> (2)) are defined by:</p>
-
-<blockquote>
-<pre>#define gs_image_max_components 5
-typedef struct {
- &lt;&lt; gs_image_common_t &gt;&gt;
- int Width;
- int Height;
- int BitsPerComponent;
- float Decode[gs_image_max_components * 2];
- bool Interpolate;
-} gs_data_image_t;</pre>
-</blockquote>
-
-<p>
-Images that supply pixel (as opposed to mask) data are defined by:</p>
-
-<blockquote>
-<pre>typedef enum {
- /* Single plane, chunky pixels. */
- gs_image_format_chunky = 0,
- /* num_components planes, chunky components. */
- gs_image_format_component_planar = 1,
- /* BitsPerComponent * num_components planes, 1 bit per plane */
- gs_image_format_bit_planar = 2
-} gs_image_format_t;
-typedef struct {
- &lt;&lt; gs_data_image_t &gt;&gt;
- const gs_color_space *ColorSpace;
- bool CombineWithColor;
-} gs_pixel_image_t;</pre>
-</blockquote>
-
-<p>
-Ordinary PostScript Level 1 or Level 2 (<code>ImageType</code> 1) images
-are defined by:</p>
-
-<blockquote>
-<pre>typedef enum {
- /* No alpha. */
- gs_image_alpha_none = 0,
- /* Alpha precedes color components. */
- gs_image_alpha_first,
- /* Alpha follows color components. */
- gs_image_alpha_last
-} gs_image_alpha_t;
-typedef struct {
- &lt;&lt; gs_pixel_image_t &gt;&gt;
- bool ImageMask;
- bool adjust;
- gs_image_alpha_t Alpha;
-} gs_image1_t;
-typedef gs_image1_t gs_image_t;</pre>
-</blockquote>
-
-<p>
-Of course, standard PostScript images don't have an alpha component. For
-more details, consult the source code in <a
-href="../base/gsiparam.h">gsiparam.h</a> and <code>gsiparm*.h</code>,
-which define parameters for an image.</p>
-
-<p>
-The <code>begin[_typed_]image</code> driver procedures create image
-enumeration structures. The common part of these structures consists of:</p>
-
-<blockquote>
-<pre>typedef struct gx_image_enum_common_s {
- const gx_image_type_t *image_type;
- const gx_image_enum_procs_t *procs;
- gx_device *dev;
- gs_id id;
- int num_planes;
- int plane_depths[gs_image_max_planes]; /* [num_planes] */
- int plane_widths[gs_image_max_planes] /* [num_planes] */
-} gx_image_enum_common_t;</pre>
-</blockquote>
-
-<p>
-where <code>procs</code> consists of:</p>
-
-<blockquote>
-<pre>typedef struct gx_image_enum_procs_s {
-
- /*
- * Pass the next batch of data for processing.
- */
-#define image_enum_proc_plane_data(proc)\
- int proc(gx_device *dev,\
- gx_image_enum_common_t *info, const gx_image_plane_t *planes,\
- int height)
-
- image_enum_proc_plane_data((*plane_data));
-
- /*
- * End processing an image, freeing the enumerator.
- */
-#define image_enum_proc_end_image(proc)\
- int proc(gx_device *dev,\
- gx_image_enum_common_t *info, bool draw_last)
-
- image_enum_proc_end_image((*end_image));
-
- /*
- * Flush any intermediate buffers to the target device.
- * We need this for situations where two images interact
- * (currently, only the mask and the data of ImageType 3).
- * This procedure is optional (may be 0).
- */
-#define image_enum_proc_flush(proc)\
- int proc(gx_image_enum_common_t *info)
-
- image_enum_proc_flush((*flush));
-
-} gx_image_enum_procs_t;</pre>
-</blockquote>
-
-<p> In other words, <code>begin[_typed]_image</code> sets up an
-enumeration structure that contains the procedures that will process the
-image data, together with all variables needed to maintain the state of the
-process. Since this is somewhat tricky to get right, if you plan to create
-one of your own you should probably read an existing implementation of
-<code>begin[_typed]_image</code>, such as the one in <a
-href="../base/gdevbbox.c">gdevbbox.c</a>.</p>
-
-<p>
-The data passed at each call of <code>image_plane_data</code> consists of
-one or more planes, as appropriate for the type of image.
-<code>begin[_typed]_image</code> must initialize the
-<code>plane_depths</code> array in the enumeration structure with the
-depths (bits per element) of the planes. The array of
-<code>gx_image_plane_t</code> structures passed to each call of
-<code>image_plane_data</code> then defines where the data are stored, as
-follows:</p>
-
-<blockquote>
-<pre>typedef struct gx_image_plane_s {
- const byte *data;
- int data_x;
- uint raster;
-} gx_image_plane_t;</pre>
-</blockquote>
-
-<dl>
-<dt><code>int (*begin_typed_image)(gx_device&nbsp;*dev,
-const&nbsp;gs_imager_state&nbsp;*pis, const&nbsp;gs_matrix&nbsp;*pmat,
-const&nbsp;gs_image_common_t&nbsp;*pim, gs_int_rect&nbsp;*prect,
-const&nbsp;gx_drawing_color&nbsp;*pdcolor,
-const&nbsp;gx_clip_path&nbsp;*pcpath, gs_memory_t&nbsp;*memory,
-gx_image_enum_common_t&nbsp;**pinfo)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Begin the transmission of an image. Zero or more calls of the
- <code>image_plane_data</code> function supplied in the returned image
- enumerator will follow, and then a call of
-<code>end_image</code>. The parameters of <code>begin_typed_image</code>
-are as follows:
-
-<blockquote><table>
-<tr valign="top"><td><code>pis</code></td>
-
- <td>pointer to an imager state. The only relevant elements of the
- imager state are the CTM (coordinate transformation matrix),
- the logical operation (<code>RasterOp</code> or
- transparency), and the color rendering information. For
- mask images, if <code>pmat</code> is not NULL and the color is pure,
- <code>pis</code> may be NULL.</td></tr>
-<tr valign="top"> <td><code>pmat</code></td>
-
- <td>pointer to a <code>gs_matrix</code> structure that
- defines the image transformation matrix. If <code>pis</code> is non-NULL,
- and <code>pmat</code> is NULL, then the <code>ctm</code> from <code>pis</code>
- should be used.</td></tr>
-<tr valign="top"> <td><code>pim</code></td>
-
- <td>pointer to the <code>gs_image_t</code> structure that
- defines the image parameters</td></tr>
-<tr valign="top"> <td><code>prect</code></td>
-
- <td>if not <code>NULL</code>, defines a subrectangle of the
- image; only the data for this subrectangle will be passed to
- <code>image_plane_data</code>, and only this subrectangle should
- be drawn</td></tr>
-<tr valign="top"> <td><code>pdcolor</code></td>
-
- <td>defines a drawing color, only needed for masks or if
- <code>CombineWithColor</code> is true</td></tr>
-<tr valign="top"> <td><code>pcpath</code></td>
-
- <td>if not <code>NULL</code>, defines an optional clipping path</td></tr>
-<tr valign="top"> <td><code>memory</code></td>
-
- <td>defines the allocator to be used for allocating bookkeeping
- information</td></tr>
-<tr valign="top"> <td><code>pinfo</code></td>
-
- <td>the implementation should return a pointer to its state
- structure here</td></tr>
-</table></blockquote>
-
-<p>
-<code>begin_typed_image</code> is expected to allocate a structure for its
-bookkeeping needs, using the allocator defined by the memory parameter, and
-return it in <code>*pinfo</code>. <code>begin_typed_image</code> should not assume that
-the structures in <code>*pim</code>, <code>*prect</code>, or
-<code>*pdcolor</code> will survive the call on
-<code>begin_typed_image</code> (except for the color space in
-<code>*pim-&gt;ColorSpace</code>): it should copy any necessary parts of
-them into its own bookkeeping structure. It may, however, assume that
-<code>*pis</code>, <code>*pcpath</code>, and of course
-<code>*memory</code> will live at least until <code>end_image</code>
-is called.</p>
-
-<p>
-<code>begin_typed_image</code> returns 0 normally, or 1 if the image does not
-need any data. In the latter case, <code>begin_typed_image</code> does not
-allocate an enumeration structure.</p>
-</dd>
-</dl>
-
-<p>
-The format of the image (how pixels are represented) is given by
-<code>pim-&gt;format</code>.</p>
-
-<p>
-The actual transmission of data uses the procedures in the enumeration
-structure, not driver procedures, since the handling of the data usually
-depends on the image type and parameters rather than the device. These
-procedures are specified as follows.</p>
-
-<dl>
-<dt><code>int (*image_plane_data)(gx_device&nbsp;*dev,
-gx_image_enum_common_t&nbsp;*info,
-const&nbsp;gx_image_plane_t&nbsp;*planes, int&nbsp;height)</code></dt>
-<dd>This call provides more of the image source data: specifically,
-<code>height</code> rows, with <code>Width</code> pixels supplied for
-each row.
-
-<p>
-The data for each row are packed big-endian within each byte, as for
-<code>copy_color</code>. The <code>data_x</code> (starting X position
-within the row) and <code>raster</code> (number of bytes per row) are
-specified separately for each plane, and may include some padding at the
-beginning or end of each row. Note that for non-mask images, the input data
-may be in any color space and may have any number of bits per component (1,
-2, 4, 8, 12); currently mask images always have 1 bit per component, but in
-the future, they might allow multiple bits of alpha. Note also that each
-call of <code>image_plane_data</code> passes complete pixels: for example, for
-a chunky image with 24 bits per pixel, each call of
-<code>image_plane_data</code> passes 3N bytes of data (specifically,
-3&nbsp;&times;&nbsp;Width&nbsp;&times;&nbsp;height).</p>
-
-<p>
-The interpretation of planes depends on the <code>format</code> member of
-the <code>gs_image[_common]_t</code> structure:</p>
-
-<ul>
-<li>If the format is <code>gs_image_format_chunky</code>,
-<code>planes[0].data</code> points to data in "chunky" format, in which
-the components follow each other (for instance, RGBRGBRGB....)</li>
-
-<li>If the format is <code>gs_image_format_component_planar</code>,
-<code>planes[0&nbsp;..&nbsp;N-1].data</code> point to data for the
-<b><em>N</em></b> components (for example, <b><em>N</em></b>=3 for RGB
-data); each plane contains samples for a single component, for instance,
-RR..., GG..., BB.... Note that the planes are divided by component, not by
-bit: for example, for 24-bit RGB data, <b><em>N</em></b>=3, with 8-bit
-values in each plane of data.</li>
-
-<li>If the format is <code>gs_image_format_bit_planar</code>,
-<code>planes[0&nbsp;..&nbsp;N*B-1].data</code> point to data for the
-<b><em>N</em></b> components of <b><em>B</em></b> bits each (for example,
-<b><em>N</em></b>=3 and <b><em>B</em></b>=4 for RGB data with 4 bits per
-component); each plane contains samples for a single bit, for instance, R0
-R1 R2 R3 G0 G1 G2 G3 B0 B1 B2 B3. Note that the most significant bit of
-each plane comes first.</li>
-</ul>
-
-<p>
-If, as a result of this call, <code>image_plane_data</code> has been called with all
-the data for the (sub-)image, it returns 1; otherwise, it returns 0 or an
-error code as usual.</p>
-
-<p>
-<code>image_plane_data</code>, unlike most other procedures that take bitmaps as
-arguments, does not require the data to be aligned in any way.</p>
-
-<p>
-Note that for some image types, different planes may have different
-numbers of bits per pixel, as defined in the <code>plane_depths</code> array.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>int (*end_image)(gx_device&nbsp;*dev, void&nbsp;*info,
-bool&nbsp;draw_last)</code></dt>
-<dd>Finish processing an image, either because all data have been supplied
-or because the caller has decided to abandon this image.
-<code>end_image</code> may be called at any time after
-<code>begin_typed_image</code>. It should free the info structure and any
-subsidiary structures. If <code>draw_last</code> is true, it should
-finish drawing any buffered lines of the image.</dd>
-</dl>
-
-<h5><a name="Images_notes"></a>Notes</h5>
-
-<p>
-While there will almost never be more than one image enumeration in
-progress -- that is, after a <code>begin_typed_image</code>,
-<code>end_image</code> will almost always be called before the next
-<code>begin_typed_image</code> -- driver code should not rely on this
-property; in particular, it should store all information regarding the
-image in the info structure, not in the driver structure.</p>
-
-<p>
-Note that if <code>begin_typed_image</code> saves its parameters in
-the info structure, it can decide on each call whether to use its own
-algorithms or to use the default implementation. (It may need to call
-<code>gx_default_begin</code>/<code>end_image</code> partway
-through.) [A later revision of this document may include an example here.]</p>
-
-<h4><a name="Text"></a>Text</h4>
-
-<p>
-The third high-level interface handles text. As for images, the interface
-is based on creating an enumerator which then may execute the operation in
-multiple steps. As for the other high-level interfaces, the procedures are
-optional.</p>
-
-<dl>
-<dt><code>int (*text_begin)(gx_device&nbsp;*dev,
-gs_imager_state&nbsp;*pis, const&nbsp;gs_text_params_t&nbsp;*text,
-gs_font&nbsp;*font,
-const&nbsp;gx_clip_path&nbsp;*pcpath,
-gs_text_enum_t&nbsp;**ppte)</code> <b><em>[OPTIONAL]</em></b></dt>
-
-<dd><p></p>
-Begin processing text, by creating a state structure and storing it in
-<code>*ppte</code>. The parameters of <code>text_begin</code> are as
-follows:</dd>
-</dl>
-
-<blockquote><table>
-<tr valign="top"> <td><code>dev</code></td>
-
- <td>The usual pointer to the device.</td></tr>
-<tr valign="top"> <td><code>pis</code></td>
-
- <td>A pointer to an imager state. All elements may be relevant,
- depending on how the text is rendered. </td></tr>
-<tr valign="top"> <td><code>text</code></td>
-
- <td>A pointer to the structure that defines the text operation
- and parameters. See <a href="../base/gstext.h">gstext.h</a> for details.</td></tr>
-<tr valign="top"> <td><code>font</code></td>
-
- <td>Defines the font for drawing.</td></tr>
-<tr valign="top"> <td><code>pcpath</code></td>
-
- <td>If not <code>NULL</code>, defines an optional clipping path.
- Only relevant if the text operation includes
- <code>TEXT_DO_DRAW</code>.</td></tr>
-<tr valign="top"> <td><code>ppte</code></td>
-
- <td>The implementation should return a pointer to its state
- structure here.</td></tr>
-</table></blockquote>
-
-<p>
-<code>text_begin</code> must allocate a structure for its bookkeeping
-needs, using the allocator used by the graphics state,
-and return it in <code>*ppte</code>. <code>text_begin</code> may
-assume that the structures passed as parameters will survive until text
-processing is complete.</p>
-
-<p>
-If the text operation includes <code>TEXT_DO...PATH</code> then the
-character outline will be appended to the current path in the
-<code>pgs</code>. The current point of that path indicates where
-drawing should occur and will be updated by the string width
-(unless the text operation includes <code>TEXT_DO_NONE</code>).</p>
-
-<p>If the text operation includes <code>TEXT_DO_DRAW</code> then
-the text color will be taken from the current colour in the graphics
-state. (Otherwise no colour is required).</p>
-
-<p>The bookkeeping information will be allocated using the memory
-allocator from the graphics state.</p>
-
-<p>
-Clients should not call the driver <code>text_begin</code> procedure
-directly. Instead, they should call <code>gx_device_text_begin</code>,
-which takes the same parameters and also initializes certain common elements
-of the text enumeration structure, or <code>gs_text_begin</code>, which
-takes many of the parameters from a graphics state structure. For details,
-see <a href="../base/gstext.h">gstext.h</a>.</p>
-
-<p>
-The actual processing of text uses the procedures in the enumeration
-structure, not driver procedures, since the handling of the text may depend
-on the font and parameters rather than the device. Text processing may also
-require the client to take action between characters, either because the
-client requested it (<code>TEXT_INTERVENE</code> in the operation) or
-because rendering a character requires suspending text processing to call an
-external package such as the PostScript interpreter. (It is a deliberate
-design decision to handle this by returning to the client, rather than
-calling out of the text renderer, in order to avoid potentially unknown
-stack requirements.) Specifically, the client must call the following
-procedures, which in turn call the procedures in the text enumerator.</p>
-
-<dl>
-<dt><code>int gs_text_process(gs_text_enum_t&nbsp;*pte)</code></dt>
-<dd><p></p>Continue processing text. This procedure may return 0 or a negative
-error code as usual, or one of the following values (see
-<a href="../base/gstext.h">gstext.h</a> for details).
-
-<blockquote><table>
-<tr valign="top"> <td><code>TEXT_PROCESS_RENDER</code></td>
- <td>The client must cause the current character to be rendered.
- This currently only is used for PostScript Type 0-4 fonts
- and their CID-keyed relatives.</td></tr>
-<tr valign="top"> <td><code>TEXT_PROCESS_INTERVENE</code></td>
- <td>The client has asked to intervene between characters.
- This is used for <code>cshow</code> and <code>kshow</code>.</td></tr>
-</table></blockquote>
-</dd>
-</dl>
-
-<dl>
-<dt><code>int gs_text_release(gs_gstate * pgs, gs_text_enum_t&nbsp;*pte,
-client_name_t&nbsp;cname)</code></dt><dd><p></p>Finish processing text and release
-all associated structures. Clients must call this procedure after
-<code>gs_text_process</code> returns 0 or an error, and may call it at
-any time.</dd>
-</dl>
-
-<p>
-There are numerous other procedures that clients may call during text
-processing. See <a href="../base/gstext.h">gstext.h</a> for details.</p>
-
-<h5><a name="Text_notes"></a>Notes</h5>
-
-<p>
-Note that unlike many other optional procedures, the default implementation
-of <code>text_begin</code> cannot simply return: like the default
-implementation of <code>begin[_typed]_image</code>, it must create and
-return an enumerator. Furthermore, the implementation of the
-<code>process</code> procedure (in the enumerator structure, called by
-<code>gs_text_process</code>) cannot simply return without doing
-anything, even if it doesn't want to draw anything on the output. See the
-comments in <a href="../base/gxtext.h">gxtext.h</a> for details.</p>
-
-<h4><a name="Unicode"></a>Unicode support for high level (vector) devices</h4>
-
-<p>Implementing a new high level (also known as vector) device, one may need to translate <code>Postscript</code>
-character codes into <code>Unicode</code>. This can be done pretty simply.</p>
-
-<p>For translating a <code>Postscript</code> text you need to inplement the device
-virtual function <code>text_begin</code>. It should create a new instance of
-<code>gs_text_enum_t</code> in the heap (let its pointer be <code>pte</code>),
-and assign a special function to <code>gs_text_enum_t::procs.process</code>.
-The function will receive <code>pte</code>. It should take the top level font from
-<code>pte-&gt;orig_font</code>,
-and iterate with <code>font-&gt;procs.next_char_glyph(pte, ..., &amp;glyph)</code>.
-The last argument receives a <code>gs_glyph</code> value, which encodes a
-<code>Postscript</code> character name or CID (and also stores it into
-<code>pte-&gt;returned.current_glyph</code>).
-Then obtain the current subfont with <code>gs_text_current_font(pte)</code>
-(it can differ from the font)
-and call <code>subfont-&gt;procs.decode_glyph(subfont, glyph)</code>.
-The return value will be an <code>Unicode</code> code, or <code>GS_NO_CHAR</code>
-if the glyph can't be translated to Unicode.</p>
-
-<h3><a name="Reading_bits_back"></a>Reading bits back</h3>
-
-<dl>
-<dt><code>int (*get_bits_rectangle)(gx_device&nbsp;*dev,
-const&nbsp;gs_int_rect&nbsp;*prect, gs_get_bits_params_t&nbsp;*params)</code> <b><em>[OPTIONAL]</em></b></dt>
-
-<dd>
-Read a rectangle of bits back from the device. The <code>params</code>
-structure consists of:<p></p>
-
-<table>
-<tr valign="top"> <td><code>options</code></td>
-
- <td>the allowable formats for returning the data</td></tr>
-<tr valign="top"> <td><code>data[32]</code></td>
-
- <td>pointers to the returned data</td></tr>
-<tr valign="top"> <td><code>x_offset</code></td>
-
- <td>the X offset of the first returned pixel in data</td></tr>
-<tr valign="top"> <td><code>raster</code></td>
-
- <td>the distance between scan lines in the returned data</td></tr>
-</table>
-
-<p>
-<code>options</code> is a bit mask specifying what formats the client is
-willing to accept. (If the client has more flexibility, the implementation
-may be able to return the data more efficiently, by avoiding representation
-conversions.) The options are divided into groups.</p>
-
-</dd>
-</dl>
-
-<blockquote>
-<dl>
-<dt><b><em>alignment</em></b></dt>
-<dd>Specifies whether the returned data must be aligned in the normal
-manner for bitmaps, or whether unaligned data are acceptable.</dd>
-
-<dt><b><em>pointer or copy</em></b></dt>
-<dd>Specifies whether the data may be copied into storage provided by the
-client and/or returned as pointers to existing storage. (Note that if
-copying is not allowed, it is much more likely that the implementation will
-return an error, since this requires that the client accept the data in the
-implementation's internal format.)</dd>
-
-<dt><b><em>X offset</em></b></dt>
-<dd>Specifies whether the returned data must have a specific X offset
-(usually zero, but possibly other values to avoid skew at some later stage
-of processing) or whether it may have any X offset (which may avoid skew in
-the <code>get_bits_rectangle</code> operation itself).</dd>
-
-<dt><b><em>raster</em></b></dt>
-<dd>Specifies whether the raster (distance between returned scan lines)
-must have its standard value, must have some other specific value, or may
-have any value. The standard value for the raster is the device width
-padded out to the alignment modulus when using pointers, or the minimum
-raster to accommodate the X offset + width when copying (padded out to the
-alignment modulus if standard alignment is required).</dd>
-
-<dt><b><em>format</em></b></dt>
-<dd>Specifies whether the data are returned in chunky (all components of a
-single pixel together), component-planar (each component has its own scan
-lines), or bit-planar (each bit has its own scan lines) format.</dd>
-
-<dt><b><em>color space</em></b></dt>
-<dd>Specifies whether the data are returned as native device pixels, or in
-a standard color space. Currently the only supported standard space is
-RGB.</dd>
-
-<dt><b><em>standard component depth</em></b></dt>
-<dd>Specifies the number of bits per component if the data are returned in
-the standard color space. (Native device pixels use
-<code>dev</code>-&gt;<code>color_info.depth</code> bits per pixel.)</dd>
-
-<dt><b><em>alpha</em></b></dt>
-<dd>Specifies whether alpha channel information should be returned as the
-first component, the last component, or not at all. Note that for devices
-that have no alpha capability, the returned alpha values will be all 1s.
-</dd></dl>
-
-</blockquote>
-
-<p>
-The client may set more than one option in each of the above groups; the
-implementation will choose one of the selected options in each group to
-determine the actual form of the returned data, and will update
-<code>params[].options</code> to indicate the form. The returned
-<code>params[].options</code> will normally have only one option set per
-group.</p>
-
-<p>
-For further details on <code>params</code>, see <a
-href="../base/gxgetbit.h">gxgetbit.h</a>. For further details on
-<code>options</code>, see <a href="../base/gxbitfmt.h">gxbitfmt.h</a>.</p>
-
-<p>
-Define w = <code>prect</code>-&gt;q.x - <code>prect</code>-&gt;p.x, h
-= <code>prect</code>-&gt;q.y - <code>prect</code>-&gt;p.y. If the
-bits cannot be read back (for example, from a printer), return
-<code>gs_error_unknownerror</code>; if raster bytes is not enough space
-to hold <code>offset_x</code> + w pixels, or if the source rectangle
-goes outside the device dimensions (p.x &lt; 0 || p.y &lt; 0 || q.x &gt;
-<code>dev</code>-&gt;width || q.y &gt; <code>dev</code>-&gt;height),
-return <code>gs_error_rangecheck</code>; if any regions could not be
-read, return <code>gs_error_ioerror</code> if unpainted is
-<code>NULL</code>, otherwise the number of rectangles (see below);
-otherwise return 0.</p>
-
-<p>
-The caller supplies a buffer of <code>raster</code>&nbsp;&times;&nbsp;h
-bytes starting at <code>data[0]</code> for the returned data in chunky
-format, or <b><em>N</em></b> buffers of
-<code>raster</code>&nbsp;&times;&nbsp;h bytes starting at
-<code>data[0]</code> through
-<code>data[</code><b><em>N-1</em></b><code>]</code> in planar format
-where <b><em>N</em></b> is the number of components or bits. The contents
-of the bits beyond the last valid bit in each scan line (as defined by w)
-are unpredictable. data need not be aligned in any way. If
-<code>x_offset</code> is non-zero, the bits before the first valid bit
-in each scan line are undefined. If the implementation returns pointers to
-the data, it stores them into <code>data[0]</code> or
-<code>data[</code><b><em>0..N-1</em></b><code>]</code>.</p>
-
-<h3><a name="Parameters"></a>Parameters</h3>
-
-<p>
-Devices may have an open-ended set of parameters, which are simply pairs
-consisting of a name and a value. The value may be of various types:
-integer (int or long), boolean, float, string, name, <code>NULL</code>,
-array of integer, array of float, or arrays or dictionaries of mixed types.
-For example, the <code>Name</code> of a device is a string; the
-<code>Margins</code> of a device is an array of two floats. See
-<a href="../base/gsparam.h">gsparam.h</a> for more details.</p>
-
-<p>
-If a device has parameters other than the ones applicable to all devices
-(or, in the case of printer devices, all printer devices), it must provide
-<code>get_params</code> and <code>put_params</code> procedures. If
-your device has parameters beyond those of a straightforward display or
-printer, we strongly advise using the <code>_get_params</code> and
-<code>_put_params</code> procedures in an existing device (for example,
-<a href="../devices/gdevcdj.c">gdevcdj.c</a> or <a
-href="../devices/gdevbit.c">gdevbit.c</a>) as a model for your own code.</p>
-
-<dl>
-<dt><code>int (*get_params)(gx_device&nbsp;*dev,
-gs_param_list&nbsp;*plist)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Read the parameters of the device into the parameter list at
-<code>plist</code>, using the <code>param_write_*</code>
-macros or procedures defined in <a href="../base/gsparam.h">gsparam.h</a>.</dd>
-</dl>
-
-<dl>
-<dt><code>int (*get_hardware_params)(gx_device&nbsp;*dev,
-gs_param_list&nbsp;*plist)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Read the hardware-related parameters of the device into the parameter
-list at plist. These are any parameters whose values are under control of
-external forces rather than the program -- for example, front panel
-switches, paper jam or tray empty sensors, etc. If a parameter involves
-significant delay or hardware action, the driver should only determine the
-value of the parameter if it is "requested" by the
-<code>gs_param_list</code> [<code>param_requested</code>(plist,
-<code>key_name</code>)]. This function may cause the asynchronous
-rendering pipeline (if enabled) to be drained, so it should be used
-sparingly.</dd>
-</dl>
-
-<dl>
-<dt><code>int (*put_params)(gx_device&nbsp;*dev,
-gs_param_list&nbsp;*plist)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Set the parameters of the device from the parameter list at
-<code>plist</code>, using the <code>param_read_</code>*
-macros/procedures defined in <a href="../base/gsparam.h">gsparam.h</a>. All
-<code>put_params</code> procedures must use a "two-phase commit"
-algorithm; see <a href="../base/gsparam.h">gsparam.h</a> for details.</dd>
-</dl>
-
-<h4><a name="Default_CRD_parameters"></a>Default color rendering
-dictionary (CRD) parameters</h4>
-
-<p>
-Drivers that want to provide one or more default CIE color rendering
-dictionaries (CRDs) can do so through <code>get_params</code>. To do
-this, they create the CRD in the usual way (normally using the
-<code>gs_cie_render1_build</code> and <code>_initialize</code>
-procedures defined in <a href="../base/gscrd.h">gscrd.h</a>), and then write
-it as a parameter using <code>param_write_cie_render1</code> defined in
-<a href="../base/gscrdp.h">gscrdp.h</a>. However, the TransformPQR procedure
-requires special handling. If the CRD uses a TransformPQR procedure
-different from the default (identity), the driver must do the following:</p>
-
-<ul>
-<li>The TransformPQR element of the CRD must include a
-<code>proc_name</code>, and optionally <code>proc_data</code>. The
-<code>proc_name</code> is an arbitrary name chosen by the driver to
-designate the particular TransformPQR function. It must not be the same as
-any device parameter name; we strongly suggest it include the device name,
-for instance, "<code>bitTPQRDefault</code>".</li>
-
-<li>For each such named TransformPQR procedure, the driver's
-<code>get_param</code> procedure must provide a parameter of the same
-name. The parameter value must be a string whose bytes are the actual
-procedure address.</li>
-</ul>
-
-<p>
-For a complete example, see the <code>bit_get_params</code> procedure in
-<a href="../devices/gdevbit.c">gdevbit.c</a>. Note that it is essential that
-the driver return the CRD or the procedure address only if specifically
-requested (<code>param_requested(...)</code> &gt; 0); otherwise, errors
-will occur.</p>
-
-<h4><a name="Device parameters affecting interpretation"></a>Device parameters affecting interpretation</h4>
-
-<p>
-Some parameters have been defined for high level (vector) device drivers which affect
-the operation of the interpreter. These are documented here so that other devices
-requiring the same behaviour can use these parameters.</p>
-
-<blockquote><dl>
-<dt><b><em>/HighLevelDevice</em></b></dt>
-<dd>True if the device is a high level (vector) device. Currently this controls haltone emission
-during setpagedevice. Normally setpagdevice resets the halftone to a default value, which is
-unfortunate for high-level devices such as ps2write and pdfwrite, as they are unable to tell
-that this is caused by setpagdevice rather than a halftone set by the input file. In order to prevent
-spurious default halftones being embedded in the output, if /HighLevelDevice is present and
-true in the device paramters, then the default halftone will not be set during setpagedevice.
-Also prevents interpolation of imagemasks during PDF interpretation.
-</dd>
-
-<dt><b><em>/AllowIncrementalCFF</em></b></dt>
-<dd>Pdfwrite relies on font processing occuring in a particular order, which
-may not happen if CFF fonts are downloaded incrementally. Defining this
-parameter to true will prevent incremental CFF downloading (may raise an error
-during processing).
-</dd>
-
-<dt><b><em>/AllowPSRepeatFuncs</em></b></dt>
-<dd>Pdfwrite emits functions as type 4, and as a result can't convert PostScript
-functions using the repeat operator into PDF functions. Defining this parameter
-as true will cause such functions to raise an error during processing.
-</dd>
-
-<dt><b><em>/IsDistiller</em></b></dt>
-<dd>Defining this parameter as true will result in the operators relating to
-'distillerparams' being defined (setdistillerparams/currentdistillerparams).
-Some PostScript files behave differently if these operators are present (e.g.
-rotating the page) so this parameter may be true even if the device is not
-strictly a Distiller. For example ps2write defines this parameter to be
-true.
-</dd>
-
-<dt><b><em>/PreserveSMask</em></b></dt>
-<dd>If this parameter is true then the PDF interpreter will not convert SMask
-(soft mask, ie transparent) images into opaque images. This should be set to true
-for devices which can handle transparency (e.g. pdfwrite)
-</dd>
-
-<dt><b><em>/PreserveTrMode</em></b></dt>
-<dd>If this parameter is true then the PDF interpreter will not handle Text
-Rendering modes by degenerating into a sequence of text operations, but will
-instead set the Tr mode, and emit the text once. This value should be true
-for devices which can handle PDF text rendering modes directly.
-</dd>
-
-<dt><b><em>/WantsToUnicode</em></b></dt>
-<dd>In general, Unicode values are not of interest to rendering devices, but
-for high level (aka vector) devices, they can be extremely valuable. If this parameter is
-defined as true then ToUnicode CMaps and GlyphName2Unicode tables will be
-processed and stored.
-</dd>
-</dl></blockquote>
-
-<h3><a name="Page_devices"></a>Page devices</h3>
-
-<dl>
-<dt><code>gx_device&nbsp;*(*get_page_device)(gx_device&nbsp;*dev)</code>
-<b><em>[OPTIONAL]</em></b></dt>
-<dd>According to the Adobe specifications, some devices are "page devices"
-and some are not. This procedure returns <code>NULL</code> if the
-device is not a page device, or the device itself if it is a page device.
-In the case of forwarding devices, <code>get_page_device</code> returns
-the underlying page device (or <code>NULL</code> if the underlying
-device is not a page device).</dd>
-</dl>
-
-<h3><a name="Miscellaneous"></a>Miscellaneous</h3>
-
-<dl>
-<dt><code>int (*get_band)(gx_device&nbsp;*dev, int&nbsp;y,
-int&nbsp;*band_start)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>If the device is a band device, this procedure stores in
-<code>*band_start</code> the scan line (device Y coordinate) of the band
-that includes the given Y coordinate, and returns the number of scan lines
-in the band. If the device is not a band device, this procedure returns 0.
-The latter is the default implementation.</dd>
-</dl>
-
-<dl>
-<dt><code>void (*get_clipping_box)(gx_device&nbsp;*dev,
-gs_fixed_rect&nbsp;*pbox)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Stores in <code>*pbox</code> a rectangle that defines the device's
-clipping region. For all but a few specialized devices, this is
-<em>((0,0),(width,height))</em>.</dd>
-</dl>
-
-<h3><a name="DevSpecOp"></a>Device Specific Operations</h3>
-
-<p>In order to enable the provision of operations that make sense only
-to a small range of devices/callers, we provide an extensible function. The
-operation to perform is specified by an integer, taken from an enumeration
-in <a href="../base/gxdevsop.h">gxdevsop.h</a>.</p>
-
-<p>A typical user of this function might make a call to detect whether
-a device works in a particular way (such as whether it has a particular
-color mapping) to enable an optimisation elsewhere. Sometimes it may be used
-to detect a particular piece of functionality (such as whether
-<code>copy_plane</code> is supported); in other cases it may be used both
-to detect the presence of other functionality and to perform functions as
-well (such as with the pdf specific pattern management calls - moved
-here from their own dedicated device function).</p>
-
-<p>This function is designed to be easy to chain through multiple levels of
-device without each intermediate device needing to know about the full
-range of operations it may be asked to perform.</p>
-
-<dl>
-<dt><code>int (*dev_spec_op)(gx_device&nbsp;*dev, int&nbsp;dso,
-void&nbsp;*data, int&nbsp;size)</code> <b><em>[OPTIONAL]</em></b></dt>
-<dd>Perform device specific operation <code>dso</code>. Returns
-<code>gs_error_undefined</code> for an unknown (or unsupported operation),
-other negative values for errors, and (<code>dso</code> specific)
-non-negative values to indicate success. For details of the meanings of
-<code>dso</code>, <code>data</code> and <code>size</code>, see
-<a href="../base/gxdevsop.h">gxdevsop.h</a>.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Tray"></a>Tray selection</h2>
-
-<!-- Note for documentation maintainers: tray selection overlaps -->
-<!-- significantly across the device interface and the PostScript -->
-<!-- language implementation of setpagedevice, while the rest of -->
-<!-- Drivers.htm focusses on lanugage-independent interfaces. Likely -->
-<!-- the documentation should be refactored a bit so that this section -->
-<!-- has a comfortable home. -->
-
-<p>The logic for selecting input trays, and modifying other parameters
-based on tray selection, can be complex and subtle, largely thanks to
-the requirement to be compatible with the PostScript language
-setpagedevice mechanism. This section will describe recipes for
-several common scenarios for tray selection, with special attention to
-the how the overall task factors into configuration options, generic
-logic provided by the PostScript language (or not, if the device is
-used with other PDL's), and implementation of the put_param /
-get_param device functions within the device.</p>
-
-<p>In general, tray selection is determined primarily through the
-setpagedevice operator, which is part of the PostScript runtime.
-Ghostscript attempts to be as compatible as is reasonable with the
-PostScript standard, so for more details, see the description in the
-<a
-href="http://partners.adobe.com/public/developer/ps/index_specs.html">PostScript
-language specifications</a>, including the "supplements", which tend
-to have more detail about setpagedevice behavior than the PLRM book itself.</p>
-
-<p>The first step is to set up an /InputAttributes dictionary matching
-the trays and so on available in the device. The standard Ghostscript
-initialization files set up a large InputAttributes dictionary with
-many "known" page sizes (the full list is in
-<code>gs_statd.ps</code>, under .setpagesize). It's possible to
-edit this list in the Ghostscript source, of course, but most of the
-time it is better to execute a snippet of PostScript code after the
-default initialization but before sending any actual jobs.</p>
-
-<p>Simply setting a new /InputAttributes dictionary with setpagedevice
-will not work, because the the language specification for
-setpagedevice demands a "merging" behavior - paper tray keys present
-in the old dictionary will be preserved even if the key is not present
-in the new /InputAttributes dictionary. Here is a sample invocation
-that clears out all existing keys, and installs three new ones: a US letter
-page size for trays 0 and 1, and 11x17 for tray 1. Note that you must add at
-least one valid entry into the /InputAttributes dictionary; if all are
-<code>null</code>, then the setpagedevice will fail with a
-/configurationerror.</p>
-
-<blockquote><code>
-&lt;&lt; /InputAttributes<br>
-&nbsp;&nbsp;currentpagedevice /InputAttributes get<br>
-&nbsp;&nbsp;dup { pop 1 index exch null put } forall<br>
-<br>
-&nbsp;&nbsp;dup 0 &lt;&lt; /PageSize [612 792] &gt;&gt; put<br>
-&nbsp;&nbsp;dup 1 &lt;&lt; /PageSize [612 792] &gt;&gt; put<br>
-&nbsp;&nbsp;dup 2 &lt;&lt; /PageSize [792 1224] &gt;&gt; put<br>
-&gt;&gt; setpagedevice<br>
-</code></blockquote>
-
-<p>After this code runs, then requesting a letter page size (612x792
-points) from setpagedevice will select tray 0, and requesting an 11x17
-size will select tray 2. To explicitly request tray 1, run:</p>
-
-<blockquote><code>
-&lt;&lt; /PageSize [612 792] /MediaPosition 1 &gt;&gt; setpagedevice
-</code></blockquote>
-
-<p>At this point, the chosen tray is sent to the device as the
-(nonstandard) %MediaSource device parameter. Devices with switchable
-trays should implement this device parameter in the
-<code>put_params</code> procedure. Unlike the usual protocol for
-device parameters, it is not necessary for devices to also implement
-<code>get_params</code> querying of this paramter; it is
-effectively a write-only communication from the language to the
-device. Currently, among the devices that ship with Ghostscript, only
-PCL (gdevdjet.c) and PCL/XL (gdevpx.c) implement this parameter, but
-that list may well grow over time.</p>
-
-<p>If the device has dynamic configuration of trays, etc., then the
-easiest way to get that information into the tray selection logic is
-to send a setpagedevice request (if using the standard API, then using
-gsapi_run_string_continue) to update the /InputAttributes dictionary
-immediately before beginning a job.</p>
-
-<h3><a name="LeadingEdge"></a>Tray rotation and the LeadingEdge parameter</h3>
-
-<p>Large, sophisticated printers often have multiple trays supporting
-both short-edge and long-edge feed. For example, if the paper path is
-11 inches wide, then 11x17 pages must always print short-edge, but
-letter size pages print with higher throughput if fed from long-edge
-trays. Generally, the device will expect the rasterized bitmap image
-to be rotated with respect to the page, so that it's always the same
-orientation with respect to the paper feed direction.</p>
-
-<p>The simplest way to achieve this behavior is to call
-<code>gx_device_request_leadingedge</code> to request a LeadingEdge
-value
-<code>LeadingEdge</code> field in the device structure based on the
-%MediaSource tray selection index and knowledge of the device's
-trays. The default put_params implementation will then handle this
-request (it's done this way to preserve the transactional semantics of
-put_params; it needs the new value, but the changes can't actually be
-made until all params succeed). For example, if tray 0 is long-edge,
-while trays 1 and 2 are short-edge, the following code outline should
-select the appropriate rotation:</p>
-
-<blockquote><code>
-my_put_params(gx_device *pdev, gs_param_list *plist) {<br>
-&nbsp;&nbsp;&nbsp;&nbsp;my_device *dev = (my_device *)pdev;<br>
-&nbsp;&nbsp;&nbsp;&nbsp;int MediaSource = dev-&gt;myMediaSource;<br>
-<br>
-&nbsp;&nbsp;&nbsp;&nbsp;code = param_read_int(plist, "%MediaSource", &amp;MediaSource);<br>
-<br>
-&nbsp;&nbsp;&nbsp;&nbsp;switch (MediaSource) {<br>
-&nbsp;&nbsp;&nbsp;&nbsp;case 0:<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gx_device_req_leadingedge(dev, 1);<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br>
-&nbsp;&nbsp;&nbsp;&nbsp;case 1:<br>
-&nbsp;&nbsp;&nbsp;&nbsp;case 2:<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gx_device_req_leadingedge(dev, 0);<br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br>
-&nbsp;&nbsp;&nbsp;&nbsp;}<br>
-&nbsp;&nbsp;&nbsp;&nbsp;...call default put_params, which makes the change...<br>
-<br>
-&nbsp;&nbsp;&nbsp;&nbsp;dev-&gt;myMediaSource = MediaSource;<br>
-&nbsp;&nbsp;&nbsp;&nbsp;return 0;<br>
-}
-</code></blockquote>
-
-<p>Ghostscript also supports explicit rotation of the page through
-setting the /LeadingEdge parameter with setpagedevice. The above code
-snippet will simply override this request. To give manual setting
-through setpagedevice priority, don't change the LeadingEdge field in
-the device if its LEADINGEDGE_SET_MASK bit is set. In other words,
-simply enclose the above <tt>switch</tt> statement inside an <code>if
-(!(dev-&gt;LeadingEdge &amp; LEADINGEDGE_SET_MASK) { ... }</code> statement.</p>
-
-<!-- Note for doc maintainers: the following is much more of a -->
-<!-- discussion of the PS language than a device interface issue, but -->
-<!-- it is essential info for people implementing this stuff. -->
-
-<h3><a name="LeadingPage"></a>Interaction between LeadingEdge and PageSize</h3>
-
-<p>As of LanguageLevel 3, PostScript now has two mechanisms for rotating
-the imaging of the page: the LeadingEdge parameter described in detail
-above, and the automatic rotation as enabled by the /PageSize page
-device parameter (described in detail in Table 6.2 of the PLRM3).
-Briefly, the PageSize autorotation handles the case where the page
-size requested in setpagedevice matches the <i>swapped</i> size of the
-paper source (as set in the InputAttributesDictionary). This mechanism
-can be, and has been, used to implement long-edge feed, but has
-several disadvantages. Among other things, it's overly tied to the PostScript
-language, while the device code above will work with other
-languages. Also, it only specifies one direction of rotation (90
-degrees counterclockwise). Thus, given the choice, LeadingEdge is to
-be preferred.</p>
-
-<p>If PageSize is used, the following things are different:</p>
-
-<ul>
-<li>The PageSize array in InputAttributes is swapped, so it is [long
-short].</li>
-<li>The .MediaSize device parameter is similarly swapped.</li>
-<li>The initial matrix established by the device through the
-<code>get_initial_matrix</code> procedure is the same as for the
-non-rotated case.</li>
-<li>The CTM rotation is done in the setpagedevice implementation.</li>
-</ul>
-
-<!-- Why oh why does it all have to be so complicated? -->
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Fonts.htm b/doc/Fonts.htm
deleted file mode 100644
index ea32a808..00000000
--- a/doc/Fonts.htm
+++ /dev/null
@@ -1,348 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Fonts and Font Facilities Supplied with Ghostscript</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Fonts and Font Facilities Supplied with Ghostscript</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#About">About Ghostscript fonts</a></li>
- <li><a href="#Free_fonts">Ghostscript's free fonts</a></li>
- <li><a href="#Get_fonts">How Ghostscript gets fonts when it runs</a></li>
- <li><a href="#Platform_fonts">Platform fonts</a></li>
- <li><a href="#Add_fonts">Adding your own fonts</a></li>
- <li>
- <ul>
- <li><a href="#Convert_BDF">Converting BDF fonts</a></li>
- </ul>
- </li>
- <li><a href="#For_developers">For developers only</a></li>
- <li><a href="#Use_gs_fonts_with_X">Using Ghostscript fonts on X Windows displays</a></li>
- <li>
- <ul>
- <li><a href="#Using_xset">Using <code>xset</code></a></li>
- <li><a href="#Font_permanent_installation">Permanent installation</a></li>
- <li>
- <ul>
- <li><a href="#Configure_xfs">Configuring the <code>xfs</code> font server</a></li>
- <li><a href="#Configure_Xfree86">Xfree86 display servers</a></li>
- </ul>
- </li>
- </ul>
- </li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="About"></a>About Ghostscript fonts</h2>
-
-<p>
-Ghostscript is distributed with two kinds of files related to fonts:</p>
-
-<ul>
-<li>the fonts themselves in individual files, and</li>
-<li>a file &quot;<code>Fontmap</code>&quot; that defines for
-Ghostscript which file represents which font.</li>
-</ul>
-
-<p>
-Additionally, the file <code>cidfmap</code> can be used
-to create substitutes for CIDFonts referenced by name in Postscript and PDF jobs.
-See the section on <a href="Use.htm#CIDFontSubstitution">CID Font Substitution</a>
-for details. NOTE: care must be exercised since poor or incorrect output may result
-from inappropriate CIDFont substitution. We therefore <strong>strongly</strong> recommend
-embedding CIDFonts in your Postscript and PDF files if at all possible.</p>
-
-<p>
-The &quot;base 35&quot; fonts required for Postscript (and "base 14" required for PDF)
-are Postscript Type 1 font files.</p>
-<p><a name="Fontmap"></a>
-When Ghostscript needs a font, it must have some way to know where to look
-for it: that's the purpose of the <code>Fontmap</code> file, which
-associates the names of <em>fonts</em> such as <code>/Times-Roman</code>
-with the names of font <em>files</em>, such as
-<code>n021003l.pfb</code>. <code>Fontmap</code> can also create
-aliases for font names, so that for instance,
-<code>/NimbusNo9L-Regu</code> means the same font as
-<code>/Times-Roman</code>.</p>
-<p>Where a mapping in <code>Fontmap</code> maps a font name to a path/file,
-the directory containing the font file is automatically added to the <code>permit
-file read</code> list. For example:
-<br>
-<code>/Arial (/usr/share/fonts/truetype/msttcorefonts/arial.ttf) ;</code>
-<br>
-will result in the path <code>/usr/share/fonts/truetype/msttcorefonts/</code> being
-added to the <code>permit file read</code> list. This is done on the basis that font files
-are often grouped in common directories, and rather than risk the file permissions lists
-being swamped with (potentially) hundreds of individual files, it makes sense to add the
-directories.
-<p><b>NOTE:</b> Fontmap is processed (and the paths added to the file permissions list) during
-initialisation of the Postscript interpreter, so any attempt by a Postscript job to change the
-font map cannot influence the file permissions list.
-<hr>
-
-<h2><a name="Free_fonts"></a>Ghostscript's free fonts</h2>
-<ul>
-<li>35 commercial-quality Type 1 basic PostScript fonts -- Times,
-Helvetica, Courier, Symbol, etc. -- contributed by URW++ Design and
-Development Incorporated, of Hamburg, Germany
-(<a href="http://www.urwpp.de/">http://www.urwpp.de/</a>). Fontmap names
-them all.</li>
-</ul>
-<hr>
-<h2><a name="Get_fonts"></a>How Ghostscript gets fonts when it runs</h2>
-
-<p>
-Fonts occupy about 50KB each, so Ghostscript doesn't load them all
-automatically when it runs. Instead, as part of normal initialization
-Ghostscript runs a file <code>gs_fonts.ps</code>, which arranges to load
-fonts on demand using information from the font map. To preload all of the
-known fonts, invoke the procedure</p>
-
-<blockquote><code>
-loadallfonts
-</code></blockquote>
-
-<p>
-The file <code>lib/prfont.ps</code> contains code to print a sample page of
-a font. Load this program by including it in the <code>gs</code>
-command line or by invoking</p>
-
-<blockquote><code>
-(prfont.ps) run
-</code></blockquote>
-
-<p>
-Then to produce a sampler of a particular font XYZ, invoke</p>
-
-<blockquote><code>
-/XYZ DoFont
-</code></blockquote>
-
-<p>For example,</p>
-
-<blockquote><code>
-/Times-Roman DoFont
-</code></blockquote>
-
-<p>
-For more information about how Ghostscript loads fonts during execution,
-see <a href="Use.htm#Font_lookup">here</a>.</p>
-
-<hr>
-
-<h2><a name="Add_fonts"></a>Adding your own fonts</h2>
-
-<p>
-Ghostscript can use any Type 0, 1, 3, 4, or 42 font acceptable to
-other PostScript language interpreters or to ATM, including MultiMaster
-fonts. Ghostscript can also use TrueType font files.</p>
-
-<p>
-To add fonts of your own, you must edit Fontmap to include at the end an
-entry for your new font; the format for entries is documented
-in Fontmap itself. Since later entries in Fontmap override earlier
-entries, a font you add at the end supersedes any corresponding fonts supplied
-with Ghostscript and defined earlier in the file. To ensure correct output,
-it is vital that entries for the &quot;base 35&quot; fonts remain intact
-in the Fontmap file.</p>
-
-<p>
-In the PC world, Type 1 fonts are customarily given names ending in
-<code>.PFA</code> or <code>.PFB</code>. Ghostscript can use these
-directly: you just need to make the entry in Fontmap. If you want to use
-with Ghostscript a commercial Type 1 font (such as fonts obtained in
-conjunction with Adobe Type Manager), please read carefully the license that
-accompanies the font to satisfy yourself that you may do so legally; we take
-no responsibility for any possible violations of such licenses. The same
-applies to TrueType fonts.</p>
-
-<h3><a name="Convert_BDF"></a>Converting BDF fonts (- deprecated!)</h3>
-
-<p>
-Ghostscript provides a way to construct a (low-quality) Type 1 font from a
-bitmap font in the BDF format popular in the Unix world. The shell script
-<code>bdftops</code> (Unix) or the command file
-<code>bdftops.bat</code> (DOS) converts a BDF file to a
-scalable outline using <code>bdftops.ps</code> . Run the
-shell command</p>
-
-<blockquote><code>
-bdftops&nbsp;BDF_filename&nbsp;[AFM_file1_name&nbsp;...]&nbsp;gsf_filename&nbsp;fontname<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;UniqueID&nbsp;[XUID]&nbsp;[encodingname]
-</code></blockquote>
-
-<p>
-The arguments have these meanings:</p>
-<blockquote><table>
-<tr valign="top"> <td><code>BDF_filename</code></td>
-
- <td>Input bitmap file in BDF format</td>
-
- <td>&nbsp;</td></tr>
-<tr valign="top"> <td><code>AFM_file1_name</code></td>
-
- <td>AFM files giving metrics</td>
-
- <td>(Optional)</td></tr>
-<tr valign="top"> <td><code>gsf_filename</code></td>
-
- <td>Output file</td>
-
- <td>&nbsp;</td></tr>
-<tr valign="top"> <td><code>fontname</code></td>
-
- <td>Name of the font</td>
-
- <td>&nbsp;</td></tr>
-<tr valign="top"> <td><code>UniqueID</code></td>
-
- <td>UniqueID (<a href="#Unique_IDs">as described below</a>)</td>
-
- <td>&nbsp;</td></tr>
-<tr valign="top"> <td><code>XUID</code></td>
-
- <td>XUID, in the form <code>n1.n2.n3...</code> (<a href="#Unique_IDs">as described below</a>)</td>
-
- <td>(Optional)</td></tr>
-<tr valign="top"> <td><code>encodingname</code></td>
-
- <td>"StandardEncoding" (the default), "ISOLatin1Encoding",<br>"SymbolEncoding", "DingbatsEncoding"</td>
-
- <td>(Optional)</td></tr>
-</table></blockquote>
-
-<p>
-For instance</p>
-
-<blockquote><code>
-bdftops&nbsp;pzdr.bdf&nbsp;ZapfDingbats.afm&nbsp;pzdr.gsf&nbsp;ZapfDingbats&nbsp;4100000&nbsp;1000000.1.41
-</code></blockquote>
-
-<p>
-Then make an entry in Fontmap for the <code>.gsf</code>
-file (<code>pzdr.gsf</code> in the example) as
-<a href="#Add_fonts">described above</a>.</p>
-
-<hr>
-
-<h2><a name="For_developers"></a>For developers only</h2>
-
-<p>
-The rest of this document is very unlikely to be of value to ordinary
-users.</p>
-
-<h3><a name="Font_contents"></a>Contents of fonts</h3>
-
-<p>
-As noted above, Ghostscript accepts fonts in the same formats as PostScript
-interpreters. Type 0, 1, and 3 fonts are documented in the PostScript
-Language Reference Manual (Second Edition); detailed documentation for Type
-1 fonts appears in a separate Adobe book. Type 2 (compressed format) fonts
-are documented in separate Adobe publications. Type 4 fonts are not
-documented anywhere; they are essentially Type 1 fonts with a BuildChar or
-BuildGlyph procedure. Types 9, 10, and 11 (CIDFontType 0, 1, and 2) and
-Type 32 (downloaded bitmap) fonts are documented in Adobe supplements.
-Type 42 (encapsulated TrueType) fonts are documented in an Adobe
-supplement; the TrueType format is documented in publications available
-from Apple and Microsoft. Ghostscript does not support Type 14 (Chameleon)
-fonts, which use a proprietary Adobe format.</p>
-
-<h3><a name="Unique_IDs"></a>Font names and unique IDs</h3>
-
-<p>
-If you create your own fonts and will use them only within your own
-organization, you should use <code>UniqueID</code> values between
-4000000 and 4999999.</p>
-
-<p>
-If you plan to distribute fonts, ask Adobe to assign you some UniqueIDs and
-also an <code>XUID</code> for your organization. Contact</p>
-
-<blockquote><address>
-Unique ID Coordinator<br>
-Adobe Developers Association<br>
-Adobe Systems, Inc.<br>
-345 Park Avenue<br>
-San Jose, CA 95110-2704<br>
-+1-408-536-9000 telephone (ADA)<br>
-+1-408-536-6883 fax<br>
-<a href="mailto:fontdev-person@adobe.com">fontdev-person@adobe.com</a><br>
-</address></blockquote>
-
-<p>
-The XUID is a Level 2 PostScript feature that serves the same function as
-the UniqueID, but is not limited to a single 24-bit integer. The
-<code>bdftops</code> program creates XUIDs of the form
-"<code>[-X-&nbsp;0&nbsp;-U-]</code>" where "<code>-X-</code>" is the
-organization XUID and "<code>-U-</code>" is the UniqueID. (Aladdin
-Enterprises' organization XUID, which appears in a few places in various
-font-related files distributed with Ghostscript, is 107; do not use this for
-your own fonts that you distribute.)</p>
-
-<hr>
-
-<h2><a name="Use_gs_fonts_with_X"></a>Using Ghostscript fonts on X Windows displays</h2>
-
-<p> The &quot;Xfonts&quot; feature is no longer supported.</p>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/GPDL.htm b/doc/GPDL.htm
deleted file mode 100644
index 42dae96a..00000000
--- a/doc/GPDL.htm
+++ /dev/null
@@ -1,566 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>The GhostPDL Interpreter Framework</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>The GhostPDL Interpreter Framework</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#What_Is_This">What is the GhostPDL Interpreter Framework?</a></li>
- <li><a href="#API">The API</a></li>
- <li>
- <ul>
- <li><a href="#run">The run_string functions</a></li>
- <li><a href="#string_vs_file">String vs File functions</a></li>
- </ul>
- </li>
- <li><a href="#executable">The GPDL executable</a></li>
- <li><a href="#different_switches">Differences in switches from Ghostscript</a></li>
- <li><a href="#languages">Supported languages</a></li>
- <li>
- <ul>
- <li><a href="#PJL">PJL</a></li>
- <li><a href="#PCL">PCL</a></li>
- <li><a href="#PCLXL">PCLXL</a></li>
- <li><a href="#XPS">XPS</a></li>
- <li><a href="#POSTSCRIPT">POSTSCRIPT</a></li>
- <li><a href="#URF">URF</a></li>
- <li><a href="#JPG">JPG</a></li>
- <li><a href="#PWG">PWG</a></li>
- <li><a href="#TIFF">TIFF</a></li>
- <li><a href="#JBIG2">JBIG2</a></li>
- <li><a href="#JP2K">JP2K</a></li>
- <li><a href="#PNG">PNG</a></li>
- </ul>
- </li>
- <li><a href="#new_language">Adding a new language</a></li>
- <li>
- <ul>
- <li><a href="proc_characteristics">proc_characteristics</a></li>
- <li><a href="proc_allocate_interp_instance">proc_allocate_interp_instance</a></li>
- <li><a href="proc_get_device_memory">proc_get_device_memory</a></li>
- <li><a href="proc_set_param">proc_set_param</a></li>
- <li><a href="proc_add_path">proc_add_path</a></li>
- <li><a href="proc_post_args_init">proc_post_args_init</a></li>
- <li><a href="proc_init_job">proc_init_job</a></li>
- <li><a href="proc_run_prefix_commands">proc_run_prefix_commands</a></li>
- <li><a href="proc_process_file">proc_process_file</a></li>
- <li><a href="proc_process_begin">proc_process_begin</a></li>
- <li><a href="proc_process">proc_process</a></li>
- <li><a href="proc_process_end">proc_process_end</a></li>
- <li><a href="proc_flush_to_eoj">proc_flush_to_eoj</a></li>
- <li><a href="proc_process_eof">proc_process_eof</a></li>
- <li><a href="proc_report_errors">proc_report_errors</a></li>
- <li><a href="proc_dnit_job">proc_dnit_job</a></li>
- <li><a href="proc_deallocate_interp_instance">proc_deallocate_interp_instance</a></li>
- </ul>
- </li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript overview</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-
-<h2><a name="What_Is_This"></a>What is the GhostPDL Interpreter Framework?</h2>
-
-<p>
-The GhostPDL interpreter framework (henceforth, just GhostPDL) is
-a framework into which multiple interpreters can be fitted, together
-with a set of interpreters for different input &quot;languages&quot;.</p>
-<p>The intent is that a build of GPDL will behave as much as possible
-like a build of Ghostscript, but should be able to transparently
-cope with as many different input formats as it has interpreters built
-into it.</p>
-<p>It can be built as a dynamic link library
-(DLL) on Microsoft Windows, as a shared object on the
-Linux, Unix and MacOS X platforms. With some changes, it could be built
-as a static library.</p>
-<p>The reason we dub it a &quot;Framework&quot; is that it is
-designed to be modular, and to readily allow new interpreters to be
-swapped in and out to extend and customise its capabilities.</p>
-
-<p>Jobs must be separated by <code>UEL</code> (Universal End of Language)
-code sequences (or PJL fragments, which implicitly start with a
-<code>UEL</code> marker).</p>
-
-<h2><a name="API"></a>The API</h2>
-
-<p>The API for GPDL (found in <a href="../pcl/pl/plapi.h">plapi.h</a>)
-is deliberately designed to be nearly identical
-to that for Ghostscript itself (found in <a href="../psi/iapi.h">iapi.h</a>).
-Details of Ghostscript's API can be
-found <a href="API.htm">here</a>, and we refer you to that. Only
-differences from that API will be documented here. In particular
-the differences in the handling of switches within the
-<code>gsapi_init_with_args</code> are documented
-<a href="#different_switches">here</a>.</p>
-<p>Our intent is that existing users of the Ghostscript API should be
-able to drop a GPDL DLL in as a replacement with little to no code
-changes.</p>
-
-<h3><a name="run"></a>The run_string APIs</h3>
-
-<p>The <code>run_string</code> APIs have parameters for
-<code>int user_errors</code> and <code>int *error_code</code>.
-Within Ghostscript, these allow a caller to bypass the language's
-standard error handling, and to trap errors externally.
-This makes no sense within a printer implementation (and, in
-particular, no sense for a postscript interpreter running
-jobs within a JobServer loop as GPDL does). Thus these
-parameters are kept for ABI compatibility, but are largely
-ignored within the GPDL implementation of gsapi.
-For sanity, pass 0 for <code>user_errors</code>, and expect
-<code>*error_code</code> to be set to 0 on exit.</p>
-
-<h3><a name="string_vs_file"></a>String vs File functions</h3>
-
-<p>Some file types, such as Postscript and PCL, are designed to be
-'streamable'; that is to say that the files can be fed in and
-consumed as they are interpreted. Other file types, such as PDF or
-XPS require the whole file to be available so that the interpreters
-can seek back and forth within it to extract the data they require.</p>
-
-<p>Traditionally, Ghostscript has relied upon the caller knowing
-which type of data is which; streamable data can be fed in to the
-system using the <code>gsapi_run_string</code> APIs, and complete files
-of data can be fed in using <code>gsapi_run_file</code> or
-<code>gsapi_init_with_args</code> APIs. Streamable data contained
-with a file is simple to deal with, as it's trivial for an interpreter
-to read bytes from a file, but doing random access on a stream is
-much harder.</p>
-
-<p>In systems where data is being streamed in, but it is required
-to be available for random access, the entire stream must be buffered
-for presentation to the language interpreters. With Ghostscript,
-the responsibility for doing this fell to the caller. Unfortunately,
-this means that the caller also has to be responsible for scanning
-the incoming data to spot when it is in a format that requires
-buffering. With the explosion of formats that GPDL supports this
-quickly becomes unpalatable.</p>
-
-<p>While the caller is still free to do such buffering of data
-itself, GPDL will do it automatically if required. If a language
-spots that data being fed to it via the <code>gsapi_run_string</code>
-APIs is in a format that requires buffering, the entire string of
-data will be automatically collected together, and then be
-represented internally to the <code>gsapi_run_file</code> API.</p>
-
-<p>The current implementation buffers the data in memory. Alternative
-implementations could use a backing store if such a thing were
-available. For server based applications the use of memory is not
-likely to be a problem (assuming reasonably sized input files at least).
-For printer integrations, it's entirely possible that no backing
-store will be available, so RAM may be the only option. Integrators
-may wish to place a limit on the size of files that can be buffered
-in this way.</p>
-
-<h2><a name="executable"></a>The GPDL executable</h2>
-
-<p>
-The GPDL executable is a small executable that loads the DLL/shared object,
-and implements, pretty much, the interface described in the
-<a href="Use.htm">usage documentation</a> for Ghostscript, but capable of
-reading any of the configured languages. This executable provides all
-the interaction with the windowing system, including image windows.</p>
-
-<p>Areas where the GPDL executable differs from the Ghostscript
-executable are described <a href="#different_switches">below</a>. These
-are primarily to do with (slightly) esoteric requirements when
-running Postscript in an interactive environment. Whereas Ghostscript
-is a generic Postscript interpreter, GPDL is unashamedly targeted
-as a print processor.</p>
-
-<p>
-The GPDL framework's library name and characteristics differ
-for each platform:</p>
-
-<ul>
-<li>The Win32 DLL <code>gpdldll32.dll</code>
-can be used by multiple programs simultaneously, but only once
-within each process.</li>
-
-<li>The Linux shared object <code>libgs.so</code>
-can be used by multiple programs simultaneously.</li>
-</ul>
-<p>
-The source for the executable is in <code>plw</code>*.* (Windows)
-and <code>plx</code>*.* (Linux/Unix).
-See these source files for examples of how to use the DLL.</p>
-
-<p>
-At this stage, GhostPDL does not support multiple instances
-of the interpreter within a single process.</p>
-
-<h2><a name="different_switches"></a>Differences in switches from Ghostscript</h3>
-
-<p>The <code>gsapi_init_with_args</code> API entrypoint takes a
-set of arguments, which can include various switches. We document
-the differences between Ghostscript's handling of switches and
-GhostPDLs here. The GhostPDL executable directly maps parameters
-given on the command-line into this list, so this list of differences
-applies both to API calls and uses of the executable.</p>
-
-<p>GhostPDL does not support the <code>-_</code>, <code>-+</code>,
-<code>-@</code>, <code>-B</code>, <code>-F</code>, <code>-M</code>,
-<code>-N</code>, <code>-P</code>, <code>-u</code>, and <code>-X</code>
-switches that Ghostscript does.
-
-<p>GhostPDL supports a few switches that the Ghostscript executable
-does not.</p>
-
-<ul>
- <li><b><code>-E #</code>:</b> Sets the &quot;error reporting mode&quot;
-for PCL/PXL.</li>
- <li><b><code>-H #x#x#x#</code>:</b> Sets the hardware margins to the
-given left/bottom/right/top values (in points).</li>
- <li><b><code>-j &lt;string&gt;</code>:</b> Passes the string to the
- PJL level. The string is split on ';'.</li>
- <li><b><code>-J</code>:</b> Same as <code>-j</code>.</li>
- <li><b><code>-l {RTL,PCL5E,PCL5C}</code>:</b> Sets the
- &quot;personality&quot; of the PCL/PXL interpreter.</li>
- <li><b><code>-L &lt;language&gt;</code>:</b> Sets the language
- to be used. Run with <code>-L</code> and no string to see a list
- of languages supported in your build.</li>
- <li><b><code>-m #x#</code>:</b> Sets the margin values to the
- left/bottom values (in points).</li>
-</ul>
-
-<h2><a name="languages"></a>Supported languages</h2>
-
-<p>The following is a (possibly non-exhaustive) list of languages
-for which implementations exist for GhostPDL. We use the term
-&quot;language&quot; to include both full page description languages
-(such as PCL, Postscript and XPS), and handlers for simpler formats
-(such as JPEG, PNG and TIFF).</p>
-<p>It is inherent in the design that new handlers can be included,
-and unwanted formats can be dropped from any given build/integration.</p>
-
-<h3><a name="PJL"></a>PJL</h3>
-<p>PJL is special, in that it is the central language implementation
-to which we return between all jobs. As such it always appears first
-in the list, and must be present in all builds.</p>
-<h3><a name="PCL"></a>PCL</h3>
-<p>The PCL language implementation supports PCL5C/PXL5E and HPGL/2
-with RTL.</p>
-<h3><a name="PCLXL"></a>PCLXL</h3>
-<p>The PCLXL language implementation supports PCLXL.</p>
-<h3><a name="XPS"></a>XPS</h3>
-<p>The XPS language implementation supports the XML Paper Specification
-format, as used in modern Windows systems printing pipelines.</p>
-<h3><a name="POSTSCRIPT"></a>POSTSCRIPT</h3>
-<p>The POSTSCRIPT language implementation is the Ghostscript
- Postscript interpreter, as described in the accompanying
- documentation.</p>
-<h3><a name="URF"></a>URF</h3>
-<p>Currently available to commercial customers only, the URF language
-implementation implements support for the URF file format, as used
-by Apple Airprint.</p>
-<h3><a name="JPG"></a>JPG</h3>
-<p>The JPG language implementation supports JPEG files
-(in both JFIF and EXIF formats).</p>
-<h3><a name="PWG"></a>PWG</h3>
-<p>The PWG language implementation supports PWG
-(Printer Working Group) format files.</p>
-<h3><a name="TIFF"></a>TIFF</h3>
-<p>The TIFF language implementation supports TIFF format files in
-a variety of compression formats, depending on the exact configuration
-of libtiff used in the build.</p>
-<h3><a name="JBIG2"></a>JBIG2</h3>
-<p>The JBIG2 language implementation supports JBIG2 format images.</p>
-<h3><a name="JP2K"></a>JP2K</h3>
-<p>The JP2K language implementation supports JPEG2000 and JPX format
-images.</p>
-<h3><a name="PNG"></a>PNG</h3>
-<p>The PNG language implementation supports PNG format images.</p>
-
-<h2><a name="new_language"></a>Adding a new language</h2>
-
-<p>Each language implementation in the system appears as an instance
-of a <code>pl_interp_implementation_t</code> structure.
-
-<pre>
-typedef struct pl_interp_implementation_s
-{
- /* Procedure vector */
- pl_interp_proc_characteristics_t proc_characteristics;
- pl_interp_proc_allocate_interp_instance_t proc_allocate_interp_instance;
- pl_interp_proc_get_device_memory_t proc_get_device_memory;
- pl_interp_proc_set_param_t proc_set_param;
- pl_interp_proc_add_path_t proc_add_path;
- pl_interp_proc_post_args_init_t proc_post_args_init;
- pl_interp_proc_init_job_t proc_init_job;
- pl_interp_proc_run_prefix_commands_t proc_run_prefix_commands;
- pl_interp_proc_process_file_t proc_process_file;
- pl_interp_proc_process_begin_t proc_process_begin;
- pl_interp_proc_process_t proc_process;
- pl_interp_proc_process_end_t proc_process_end;
- pl_interp_proc_flush_to_eoj_t proc_flush_to_eoj;
- pl_interp_proc_process_eof_t proc_process_eof;
- pl_interp_proc_report_errors_t proc_report_errors;
- pl_interp_proc_dnit_job_t proc_dnit_job;
- pl_interp_proc_deallocate_interp_instance_t
- proc_deallocate_interp_instance;
- void *interp_client_data;
-} pl_interp_implementation_t;
-</pre>
-
-<p>This structure consists of series of function pointers, each
-of which performs some portion of the processing required to handle
-detection of language type and processing of data. These function
-pointers are described in detail below.</p>
-<p>In addition, the <code>interp_client_data</code> field is
-used to hold the running state of a given interpreter.</p>
-
-<p>All the languages to be supported in the build are listed
-in the <code>pdl_implementations</code> array in
-<a href="../pcl/pl/plimpl.c">plimpl.c</a>. To add a new implementation
-the name of the appropriate <code>pl_interp_implementation_t</code>
-should be added here.</a>
-
-<p>The existing range of language implementations may prove useful
-as references when implementing new ones. They can be found as
-<code>gpdl/*top.c</code>. In particular,
-<code><a href="../gpdl/pngtop.c">pngtop.c</a></code> is a simple
-implementation of a well-defined, relatively simple file format
-(PNG), based upon a well-known and well-documented library (libpng),
-so is probably a good place to start.</p>
-
-<h3><a name="proc_characteristics"></a>proc_characteristics</h3>
-<pre>
-typedef const pl_interp_characteristics_t
- *(*pl_interp_proc_characteristics_t) (const pl_interp_implementation_t *);
-</pre>
-<p>This entrypoint is called to request details of the characteristics
-of the language. This must be implemented in all instances.</p>
-<p>This returns a pointer to a <code>pl_interp_characteristics_t</code>
- structure:</p>
-<pre>
-typedef struct pl_interp_characteristics_s
-{
- const char *language; /* generic language should correspond with
- HP documented PJL name */
- int (*auto_sense)(const char *string, int length); /* routine used to detect language - returns a score: 0 is definitely not, 100 is definitely yes. */
- const char *manufacturer; /* manuf str */
- const char *version; /* version str */
- const char *build_date; /* build date str */
-} pl_interp_characteristics_t;
-</pre>
-<p>The <code>language</code> entry contains a simple NULL terminated
- string that names the interpreter. Similarly, the <code>manufacturer</code>,
- <code>version</code>, and <code>build_date</code> fields are for
- informational purposes only.</p>
-<p>The <code>auto_sense</code> function is called with a prefix of data
- from each new source. Each language is passed the data in turn, and
- &quot;scores;&quot; according to how sure it is the file is that format.</p>
-<p>For many file formats this means looking for known in the first
-few bytes (such as PNG or TIFF looking for their signature bytes). For
-others, such as XPS, the best that can be done is to spot that it's a
- zip file. For still others, such as PCL, heuristics have to be used.</p>
-<p>A 'definite' match is returned as 100, a definite rejection as 0, with
-intermediate values used appropriately.</p>
-<h3><a name="proc_allocate_interp_instance"></a>proc_allocate_interp_instance</h3>
-<pre>
-typedef int (*pl_interp_proc_allocate_interp_instance_t)
- (pl_interp_implementation_t *,
- gs_memory_t *);
-</pre>
-<p>On startup, the GPDL library calls around all the languages
-via this function, getting them to allocate themselves an instance.
- What this means will vary between languages, but typically it involves
- allocating a state structure, and storing the pointer to that in the
- <code>interp_client_data</code> pointer of the
- <code>pl_interp_implementation_t *</code>. Part of this state structure
- will typically be a <code>gstate</code> to use to drive the graphics
- library.</p>
-<h3><a name="proc_get_device_memory"></a>proc_get_device_memory</h3>
-<pre>
-typedef gs_memory_t *(*pl_interp_proc_get_device_memory_t)
- (pl_interp_implementation_t *);
-</pre>
-<p>On shutdown, the GPDL library calls around all the languages
-via this function, getting them to release their resources and
-deallocate any memory.</p>
-<h3><a name="proc_set_param"></a>proc_set_param</h3>
-<pre>
-typedef int (*pl_interp_proc_set_param_t) (pl_interp_implementation_t *,
- pl_set_param_type,
- const char *,
- const void *);
-</pre>
-<p>Some languages (particularly Postscript) can have their behaviour
-changed by the use of parameters. This function provides a generic
-method for the GPDL library to pass parameters into a language. Each
-language is free to ignore the parameters that do not apply to it. For
-most languages, this can safely be passed as <code>NULL</code>.</p>
-<h3><a name="proc_add_path"></a>proc_add_path</h3>
-<pre>
-typedef int (*pl_interp_proc_add_path_t) (pl_interp_implementation_t *,
- const char *);
-</pre>
-<p>Some languages (particularly Postscript) have the ability to
- open files from the local storage. These files can be found
- in a variety of different locations within the local storage.
- As such this call allows the GPDL library to add paths to
- the current list of locations that will be searched. For
- most languages, this can safely be passed as <code>NULL</code>.</p>
-<h3><a name="proc_post_args_init"></a>proc_post_args_init</h3>
-<pre>
-typedef int (*pl_interp_proc_post_args_init_t) (pl_interp_implementation_t *);
-</pre>
-<p></p>
-<h3><a name="proc_init_job"></a>proc_init_job</h3>
-<pre>
-typedef int (*pl_interp_proc_init_job_t) (pl_interp_implementation_t *,
- gx_device *);
-</pre>
-<p>Once the GPDL library has identified which language should be used
-for an incoming job, it will call this entrypoint to initialise the
-language for the job. What this means will vary between languages,
-but at the very minimum the job will need to take note of the device
-to be used.</p>
-<h3><a name="proc_run_prefix_commands"></a>proc_run_prefix_commands</h3>
-<pre>
-typedef int (*pl_interp_proc_run_prefix_commands_t)
- (pl_interp_implementation_t *,
- const char *prefix);
-</pre>
-<p>The GPDL library (and executable) allow language commands to be
-sent in the argument parameters using the <code>-c</code> switch. These
-are collected into a buffer, and forwarded to a language to be run
-as part of the same job as any following file.</p>
-<p>Currently, only the Postscript language handler implements this
-function, all others should pass <code>NULL</code>.</p>
-<h3><a name="proc_process_file"></a>proc_process_file</h3>
-<pre>
-typedef int (*pl_interp_proc_process_file_t) (pl_interp_implementation_t *,
- const char *);
-</pre>
-<p>If the GPDL library is given a filename to process, and this function
-is non-NULL, it will call this to run the file. For file formats such as
-PDF (which need to be buffered so they can be read out of order), this
-can avoid the need to feed in all the data via <code>proc_process</code>,
-buffer it somewhere, and then process it at the end.</p>
-<p>For many languages this can be <code>NULL</code>.</p>
-<h3><a name="proc_process_begin"></a>proc_process_begin</h3>
-<pre>
-typedef int (*pl_interp_proc_process_begin_t) (pl_interp_implementation_t *);
-</pre>
-<p>Once the GPDL library has data to process (that it cannot process
-with <code>proc_process_file</code>, it will call this function to
-setup the transfer of data.</p>
-<h3><a name="proc_process"></a>proc_process</h3>
-<pre>
-typedef int (*pl_interp_proc_process_t) (pl_interp_implementation_t *,
- stream_cursor_read *);
-</pre>
-<p>After the GPDL library has called <code>proc_process_begin</code>
-this function may be called multiple times to actually transfer
-the data in. The implementation is expected to consume as many bytes
-as it can (but not necessarily all of them) before returning with
-an updated read pointer. If this function cannot advance without more
-data, it should return with <code>gs_error_NeedInput</code>.</p>
-<h3><a name="proc_process_end"></a>proc_process_end</h3>
-<pre>
-typedef int (*pl_interp_proc_process_end_t) (pl_interp_implementation_t *);
-</pre>
-<p>After the GPDL library has called <code>proc_process_begin</code>
-(and possibly made a number of calls to <code>proc_process</code>) it
-will call <code>proc_process_end</code> to signify the end of the
-data. This does not necessarily signal the end of the job.</p>
-<h3><a name="proc_flush_to_eoj"></a>proc_flush_to_eoj</h3>
-<pre>
-typedef int (*pl_interp_proc_flush_to_eoj_t) (pl_interp_implementation_t *,
- stream_cursor_read *);
-</pre>
-<p>In the event of a problem while processing data, GPDL may seek to
-abandon processing of a transfer in progress by calling
-<code>proc_flush_to_eoj</code>. If possible, the language should
-continue to process data until a reasonable stopping point, or until
-<code>UEL</code> is reached.</p>
-<h3><a name="proc_process_eof"></a>proc_process_eof</h3>
-<pre>
-typedef int (*pl_interp_proc_process_eof_t) (pl_interp_implementation_t *);
-</pre>
-<p>Called when GPDL reaches EOF in processing a job. A language
-implementation should assume no more data is forthcoming.</p>
-<h3><a name="proc_report_errors"></a>proc_report_errors</h3>
-<pre>
-typedef int (*pl_interp_proc_report_errors_t) (pl_interp_implementation_t *,
- int,
- long,
- bool);
-</pre>
-<p>Called after running a job to give the language implementation the
-chance to report any errors it may have detected as it ran.</p>
-<h3><a name="proc_dnit_job"></a>proc_dnit_job</h3>
-<pre>
-typedef int (*pl_interp_proc_dnit_job_t) (pl_interp_implementation_t *);
-</pre>
-<p>Called after a job is complete so that the language implementation
-may clean up. The interpreter is kept open so that more jobs can be
-fed to it, but no state should be kept from this job to the next.</p>
-<h3><a name="proc_deallocate_interp_instance"></a>proc_deallocate_interp_instance</h3>
-<pre>
-typedef int (*pl_interp_proc_deallocate_interp_instance_t)
- (pl_interp_implementation_t *);
-</pre>
-<p>Called on shutdown of the GPDL library to close down the language
-instance and free all the resources.</p>
-
-<!-- [2.0 end contents] ==================================================== -->
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small></p>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.</p>
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.</p>
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Ghostscript.pdf b/doc/Ghostscript.pdf
new file mode 100644
index 00000000..037031ad
--- /dev/null
+++ b/doc/Ghostscript.pdf
@@ -0,0 +1,1882 @@
+%PDF-1.4
+% ReportLab Generated PDF document http://www.reportlab.com
+1 0 obj
+<<
+/F1 2 0 R /F2 3 0 R /F3 30 0 R /F4 47 0 R /F5 50 0 R /F6 68 0 R
+>>
+endobj
+2 0 obj
+<<
+/BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font
+>>
+endobj
+3 0 obj
+<<
+/BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding /Name /F2 /Subtype /Type1 /Type /Font
+>>
+endobj
+4 0 obj
+<<
+/Contents 108 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+5 0 obj
+<<
+/Contents 109 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+6 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 48 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 40.01575 754.0394 98.34575 766.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+7 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 48 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 549.6998 754.7894 555.2598 766.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+8 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 60.01575 736.0394 152.2657 748.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+9 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 549.6998 736.7894 555.2598 748.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+10 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 721.8394 0 ] /Rect [ 80.01575 718.0394 130.5857 730.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+11 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 721.8394 0 ] /Rect [ 549.6998 718.7894 555.2598 730.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+12 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 587.0394 0 ] /Rect [ 80.01575 700.0394 126.6957 712.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+13 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 587.0394 0 ] /Rect [ 549.6998 700.7894 555.2598 712.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+14 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 410.2394 0 ] /Rect [ 80.01575 682.0394 126.1457 694.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+15 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 410.2394 0 ] /Rect [ 549.6998 682.7894 555.2598 694.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+16 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 197.4394 0 ] /Rect [ 80.01575 664.0394 126.1457 676.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+17 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 197.4394 0 ] /Rect [ 549.6998 664.7894 555.2598 676.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+18 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 67 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 80.01575 646.0394 126.7057 658.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+19 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 67 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 549.6998 646.7894 555.2598 658.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+20 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 67 0 R /XYZ 40.01575 676.2394 0 ] /Rect [ 80.01575 628.0394 179.4857 640.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+21 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 67 0 R /XYZ 40.01575 676.2394 0 ] /Rect [ 549.6998 628.7894 555.2598 640.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+22 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 60.01575 610.0394 191.7357 622.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+23 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 549.6998 610.7894 555.2598 622.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+24 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 751.8394 0 ] /Rect [ 80.01575 592.0394 245.0857 604.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+25 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 751.8394 0 ] /Rect [ 549.6998 592.7894 555.2598 604.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+26 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 617.0394 0 ] /Rect [ 80.01575 574.0394 226.7257 586.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+27 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 617.0394 0 ] /Rect [ 549.6998 574.7894 555.2598 586.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+28 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 464.2394 0 ] /Rect [ 80.01575 556.0394 200.0657 568.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+29 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 464.2394 0 ] /Rect [ 549.6998 556.7894 555.2598 568.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+30 0 obj
+<<
+/BaseFont /Helvetica-Oblique /Encoding /WinAnsiEncoding /Name /F3 /Subtype /Type1 /Type /Font
+>>
+endobj
+31 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 383.4394 0 ] /Rect [ 80.01575 538.0394 261.7657 550.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+32 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 383.4394 0 ] /Rect [ 549.6998 538.7894 555.2598 550.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+33 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 314.6394 0 ] /Rect [ 80.01575 520.0394 187.8357 532.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+34 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 314.6394 0 ] /Rect [ 549.6998 520.7894 555.2598 532.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+35 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 75 0 R /XYZ 40.01575 723.0394 0 ] /Rect [ 80.01575 502.0394 232.8457 514.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+36 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 75 0 R /XYZ 40.01575 723.0394 0 ] /Rect [ 549.6998 502.7894 555.2598 514.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+37 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 60.01575 484.0394 210.6257 496.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+38 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 549.6998 484.7894 555.2598 496.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+39 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 751.8394 0 ] /Rect [ 80.01575 466.0394 190.6157 478.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+40 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 751.8394 0 ] /Rect [ 549.6998 466.7894 555.2598 478.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+41 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 671.0394 0 ] /Rect [ 80.01575 448.0394 430.1857 460.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+42 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 671.0394 0 ] /Rect [ 549.6998 448.7894 555.2598 460.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+43 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 567.4394 0 ] /Rect [ 80.01575 430.0394 205.0457 442.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+44 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 567.4394 0 ] /Rect [ 549.6998 430.7894 555.2598 442.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+45 0 obj
+<<
+/Annots [ 6 0 R 7 0 R 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R 15 0 R
+ 16 0 R 17 0 R 18 0 R 19 0 R 20 0 R 21 0 R 22 0 R 23 0 R 24 0 R 25 0 R
+ 26 0 R 27 0 R 28 0 R 29 0 R 31 0 R 32 0 R 33 0 R 34 0 R 35 0 R 36 0 R
+ 37 0 R 38 0 R 39 0 R 40 0 R 41 0 R 42 0 R 43 0 R 44 0 R ] /Contents 110 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+46 0 obj
+<<
+/Contents 111 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+47 0 obj
+<<
+/BaseFont /Courier-Bold /Encoding /WinAnsiEncoding /Name /F4 /Subtype /Type1 /Type /Font
+>>
+endobj
+48 0 obj
+<<
+/Contents 112 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+49 0 obj
+<<
+/Contents 113 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+50 0 obj
+<<
+/BaseFont /Helvetica-BoldOblique /Encoding /WinAnsiEncoding /Name /F5 /Subtype /Type1 /Type /Font
+>>
+endobj
+51 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/download)
+>> /Border [ 0 0 0 ] /Rect [ 119.4957 615.0394 140.8121 627.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+52 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.gnu.org/licenses/agpl-3.0.html)
+>> /Border [ 0 0 0 ] /Rect [ 208.4357 231.4394 316.8057 243.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+53 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com/licensing/commercial/)
+>> /Border [ 0 0 0 ] /Rect [ 353.4957 231.4394 446.2857 243.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+54 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 471.8457 231.4394 500.1857 243.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+55 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/download)
+>> /Border [ 0 0 0 ] /Rect [ 241.2357 213.4394 261.2457 225.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+56 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.gnu.org/licenses/agpl-3.0.html)
+>> /Border [ 0 0 0 ] /Rect [ 208.4357 132.6394 316.8057 144.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+57 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com/licensing/commercial/)
+>> /Border [ 0 0 0 ] /Rect [ 353.4957 132.6394 446.2857 144.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+58 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 471.8457 132.6394 500.1857 144.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+59 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/download)
+>> /Border [ 0 0 0 ] /Rect [ 343.4657 114.6394 391.9252 126.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+60 0 obj
+<<
+/Annots [ 51 0 R 52 0 R 53 0 R 54 0 R 55 0 R 56 0 R 57 0 R 58 0 R 59 0 R ] /Contents 114 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+61 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.gnu.org/licenses/agpl-3.0.html)
+>> /Border [ 0 0 0 ] /Rect [ 208.9957 722.2394 317.3657 734.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+62 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com/licensing/commercial/)
+>> /Border [ 0 0 0 ] /Rect [ 354.0557 722.2394 446.8457 734.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+63 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 472.4057 722.2394 500.7457 734.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+64 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/download)
+>> /Border [ 0 0 0 ] /Rect [ 344.0257 704.2394 392.1558 716.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+65 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://en.wikipedia.org/wiki/Aladdin_Free_Public_License)
+>> /Border [ 0 0 0 ] /Rect [ 142.8457 617.4394 167.8557 629.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+66 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 182.2957 575.4394 210.6357 587.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+67 0 obj
+<<
+/Annots [ 61 0 R 62 0 R 63 0 R 64 0 R 65 0 R 66 0 R ] /Contents 115 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+68 0 obj
+<<
+/BaseFont /Courier /Encoding /WinAnsiEncoding /Name /F6 /Subtype /Type1 /Type /Font
+>>
+endobj
+69 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://bugs.ghostscript.com)
+>> /Border [ 0 0 0 ] /Rect [ 388.7157 642.0394 489.3006 654.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+70 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (file:///home/cliddell/artifex/ghostpdl-release/doc/COPYING)
+>> /Border [ 0 0 0 ] /Rect [ 188.6357 561.2394 302.5657 573.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+71 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://ghostscript.com/doc/current/News.htm)
+>> /Border [ 0 0 0 ] /Rect [ 63.01575 327.6394 88.01575 339.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+72 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (file:///home/cliddell/artifex/ghostpdl-release/doc/COPYING)
+>> /Border [ 0 0 0 ] /Rect [ 40.01575 177.8394 71.13575 189.8394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+73 0 obj
+<<
+/Annots [ 69 0 R 70 0 R 71 0 R 72 0 R ] /Contents 116 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+74 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/)
+>> /Border [ 0 0 0 ] /Rect [ 302.3557 676.2394 396.8157 688.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+75 0 obj
+<<
+/Annots [ 74 0 R ] /Contents 117 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+76 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/)
+>> /Border [ 0 0 0 ] /Rect [ 40.01575 687.7894 134.4757 699.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+77 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/en/ps/PLRM.pdf)
+>> /Border [ 0 0 0 ] /Rect [ 431.8757 619.4394 553.0774 631.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+78 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/en/ps/PLRM.pdf)
+>> /Border [ 0 0 0 ] /Rect [ 40.01575 607.4394 192.4259 619.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+79 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf)
+>> /Border [ 0 0 0 ] /Rect [ 212.3057 607.4394 333.2395 619.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+80 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/pdf/index_reference.html)
+>> /Border [ 0 0 0 ] /Rect [ 335.6057 595.4394 464.5796 607.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+81 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/acrobat/sdk/index.html)
+>> /Border [ 0 0 0 ] /Rect [ 470.6557 595.4394 555.2598 607.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+82 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/acrobat/sdk/index_doc.html)
+>> /Border [ 0 0 0 ] /Rect [ 80.03575 583.4394 330.1257 595.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+83 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://www.artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 156.1757 478.6394 261.6142 490.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+84 0 obj
+<<
+/Annots [ 76 0 R 77 0 R 78 0 R 79 0 R 80 0 R 81 0 R 82 0 R 83 0 R ] /Contents 118 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+85 0 obj
+<<
+/Outlines 87 0 R /PageLabels 119 0 R /PageMode /UseNone /Pages 107 0 R /Type /Catalog
+>>
+endobj
+86 0 obj
+<<
+/Author () /CreationDate (D:20000101000000+00'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20000101000000+00'00') /Producer (ReportLab PDF Library - www.reportlab.com)
+ /Subject (\(unspecified\)) /Title () /Trapped /False
+>>
+endobj
+87 0 obj
+<<
+/Count 23 /First 88 0 R /Last 88 0 R /Type /Outlines
+>>
+endobj
+88 0 obj
+<<
+/Count 18 /Dest [ 48 0 R /XYZ 40.01575 787.0394 0 ] /First 89 0 R /Last 103 0 R /Parent 87 0 R /Title (Introduction)
+>>
+endobj
+89 0 obj
+<<
+/Count 6 /Dest [ 60 0 R /XYZ 40.01575 787.0394 0 ] /First 90 0 R /Last 95 0 R /Next 96 0 R /Parent 88 0 R
+ /Title (What is Ghostscript?)
+>>
+endobj
+90 0 obj
+<<
+/Dest [ 60 0 R /XYZ 40.01575 721.8394 0 ] /Next 91 0 R /Parent 89 0 R /Title (Ghostscript)
+>>
+endobj
+91 0 obj
+<<
+/Dest [ 60 0 R /XYZ 40.01575 587.0394 0 ] /Next 92 0 R /Parent 89 0 R /Prev 90 0 R /Title (GhostPDF)
+>>
+endobj
+92 0 obj
+<<
+/Dest [ 60 0 R /XYZ 40.01575 410.2394 0 ] /Next 93 0 R /Parent 89 0 R /Prev 91 0 R /Title (GhostPDL)
+>>
+endobj
+93 0 obj
+<<
+/Dest [ 60 0 R /XYZ 40.01575 197.4394 0 ] /Next 94 0 R /Parent 89 0 R /Prev 92 0 R /Title (GhostPCL)
+>>
+endobj
+94 0 obj
+<<
+/Dest [ 67 0 R /XYZ 40.01575 787.0394 0 ] /Next 95 0 R /Parent 89 0 R /Prev 93 0 R /Title (GhostXPS)
+>>
+endobj
+95 0 obj
+<<
+/Dest [ 67 0 R /XYZ 40.01575 676.2394 0 ] /Parent 89 0 R /Prev 94 0 R /Title (URW Font Information)
+>>
+endobj
+96 0 obj
+<<
+/Count 6 /Dest [ 73 0 R /XYZ 40.01575 787.0394 0 ] /First 97 0 R /Last 102 0 R /Next 103 0 R /Parent 88 0 R
+ /Prev 89 0 R /Title (Document roadmap by theme)
+>>
+endobj
+97 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 751.8394 0 ] /Next 98 0 R /Parent 96 0 R /Title (What should I read if I\220m a new user?)
+>>
+endobj
+98 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 617.0394 0 ] /Next 99 0 R /Parent 96 0 R /Prev 97 0 R /Title (GPL and commercial Ghostscript)
+>>
+endobj
+99 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 464.2394 0 ] /Next 100 0 R /Parent 96 0 R /Prev 98 0 R /Title (Before building Ghostscript)
+>>
+endobj
+100 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 383.4394 0 ] /Next 101 0 R /Parent 96 0 R /Prev 99 0 R /Title (What should I read if I\220m not a new user?)
+>>
+endobj
+101 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 314.6394 0 ] /Next 102 0 R /Parent 96 0 R /Prev 100 0 R /Title (What if I\220m a developer?)
+>>
+endobj
+102 0 obj
+<<
+/Dest [ 75 0 R /XYZ 40.01575 723.0394 0 ] /Parent 96 0 R /Prev 101 0 R /Title (What if I\220m writing documentation?)
+>>
+endobj
+103 0 obj
+<<
+/Count 3 /Dest [ 84 0 R /XYZ 40.01575 787.0394 0 ] /First 104 0 R /Last 106 0 R /Parent 88 0 R /Prev 96 0 R
+ /Title (Presence on the World Wide Web)
+>>
+endobj
+104 0 obj
+<<
+/Dest [ 84 0 R /XYZ 40.01575 751.8394 0 ] /Next 105 0 R /Parent 103 0 R /Title (Ghostscript\220s home page)
+>>
+endobj
+105 0 obj
+<<
+/Dest [ 84 0 R /XYZ 40.01575 671.0394 0 ] /Next 106 0 R /Parent 103 0 R /Prev 104 0 R /Title (Adobe PostScript, Encapsulated PostScript, and PDF reference documentation)
+>>
+endobj
+106 0 obj
+<<
+/Dest [ 84 0 R /XYZ 40.01575 567.4394 0 ] /Parent 103 0 R /Prev 105 0 R /Title (Other material on the WWW)
+>>
+endobj
+107 0 obj
+<<
+/Count 11 /Kids [ 4 0 R 5 0 R 45 0 R 46 0 R 48 0 R 49 0 R 60 0 R 67 0 R 73 0 R 75 0 R
+ 84 0 R ] /Type /Pages
+>>
+endobj
+108 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 404
+>>
+stream
+Gatn!b>,r/&4Q?mMHN7L_p!Al,YKUQ2m=_*#MP>-&Ufaqa62KYBh=6"6UHWm`P&P&ad@Y=`V":-#NuCP]4><#0EkKV#ZksWbd69*WJ&2BEKDFUa^uI+M_V*5\ShZV/\DtF1a@SM=)i-oE6?^':)o-@K-_pdkkE<*>)("1"t3djFb&%AP%sYq,i]n]`0s1m!MKj"C/">YP":PL*?5M0QKrQS.;#UnY"+D:dF0h'7gQf<J%HQZL@s,)"nd?J,Mesqm8f<S4c-NY'M=K9F,f-o?E@e_"`OT6g=bl&](N_:7c'8!L48/WF`thR\/W9`=V7-thp1/m-th$,r=c:JG(VeTFImk-SJ+G0$9nS5*bHRRid=+<S$0t^50aNI5)G[ulT_h8hpAf>ISg+:!BZOU>l~>endstream
+endobj
+109 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 92
+>>
+stream
+GapQh0E=F,0U\H3T\pNYT^QKk?tc>IP,;W#U1^23ihPEM_H"Zg#ZYSJTP%YGC2U%ZDJ?(_?u0NYeAi<FV8*670]3GC~>endstream
+endobj
+110 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 920
+>>
+stream
+GauI7?Z2Df'ZJu*'_a>_<e?;?j_7ouUl&,cC!2`(m"Ku=0EmsaZ>/9G"p/Ya]%djO&g\+oTC]D6\L%G1r?C?9QiLCf0V/gu'`96gAhrlEi5R^))J"%=ZV69rQ\4UEe$;-6YLCbY"]XrG>Jmi,fe>SO=VUSEe<?$33@T:6Padml!k&8)^u^u(YIi3YUp6`7';21UnUptO$<&:FS9\L?LUrFsBfhW-_0"!W\rpb[dQIC,rX\ME$K(ShY:]4%\rCp7Ct-aFp/7b)JN)X*f[R$:pMA9pAp&Q2Zb!ka1q?%;LQpYmBs)!R%J*]!n,$VgDG4f=rGMV/qk@1QE#b&rh<7?_,.5enX.q7DNFdAe/Gb*Z]YcU6"ZaL=gob1RB;(2Aq'Q;PXbbm[n+,.&53e7G+%,V4i]<%K#RuFJg8AB(XsXLP>%JNtc;/#_6SR%?__Bd2e2WKQ$H$E7,GPJjdZ09]R(gfd&PT!]Qsa#CX*[NfI@.o?QQMTl9<"'S(\<XG+FN7ESJTqG^R!h:dBs^R%&,$"^u@<6/!5Y*OH&TuO;nYmF:XJ=Q=VSW>t6U!S!"nGGR;jfPgT[98B!B$1SGBQX`6'(1HQafAp4f^&VMo2KF6aI%7c\r7XGtMg-'U3Kt]>H/@P(0MUSIJ0kh_$KZ5:nPN\Ws\C;Trm+o(E<9Ce[Fa'T*(HUe*_6DtZFl2[fqp\\kF!Q3k[G7E']ce'54Ya`Y+J2Z((FqZ&Km-[b&@cU"iT22%GrrXB7;8Ve-IP_@9T*?_F/ef+T?!)n.2I\!GotGq@NVmNgb;`"<D735/"$[q"Aaj=C\Nrq=@V"-[Q[3%+^h05+%stAE0H$m-JP\U>XWoJ7Cgj-/iqaQ6C%/W\%j`Qas#r]o8n@ICKc;G9+"[`ja*'8kD3:@msp3Y<Y-X/nHV`k$Pr~>endstream
+endobj
+111 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 92
+>>
+stream
+GapQh0E=F,0U\H3T\pNYT^QKk?tc>IP,;W#U1^23ihPEM_H"Zg#ZYSJTP%YGC2U%ZDJ?(_?u0NYeAi<FV8*670]3GC~>endstream
+endobj
+112 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 636
+>>
+stream
+Gat$tbAs(+']&?qB1Y4B/.%0RZC.]@cD6B*UoS;[#X`Bh$Y$(7^67hBG1pPC`.0ZaS]B97J_Is<Zg<4s*6T'!j2c!i5m6b*][)5&!BVD--'ZM>,)IO2UJ0<gp+o:F^H^TZ,f1O_9OsCJr&(R.*]M:t8M1;cJg$j*'Q+`'K;GjLltFLuGMq>pElGko1IW.I+p6dY:P8k-@[a+01*c_LRmC+SBj0>"+odRMiOhC"k!/fcG3V;MggpLEK=ArK,8"Rf.gD3#8=iC3[q=sF?go7K7*6cpQo$"d?)MW"SXh`h6(CC,Z-Q/Jb@2>4TDao-mgmIjJbn>7k=n%4dcJuXhS@DE%(`CK@LJr>)MPdmO(KquG&*,R_GuHN?#A)ANRg>JIVloRT%4?SF,dWJ:/@5b958b+IPf#Uo3>A^4P`iNA=VADFqL=G'Rb[A)sDaW__`jh3%GrUe=Dl.4SPM+$D)7J&r0`N#<e^CSU*LCT.:IZH^TBM[lW8eUX&dlDigY6FGE^h6`KG79&V4hS$m-<7=/%7E@chb^8Y;jo/aC&2/?Ji4SJ.qDs-Ga0,So.;;M"h74rAnMZAl!!)f6sc>:Pr7Xjc`=8h46kp>`2RJuZ13U1QYiZqsSjZ;`C3J-/Uq]I0~>endstream
+endobj
+113 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 92
+>>
+stream
+GapQh0E=F,0U\H3T\pNYT^QKk?tc>IP,;W#U1^23ihPEM_H"Zg#ZYSJTP%YGC2U%ZDJ?(_?u0NYeAi<FV8*670]3GC~>endstream
+endobj
+114 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 2476
+>>
+stream
+Gb!ku9lJcW'#"0Do[,J!)1GN$*YoD:p=^&ZcUNiRi(JuE8\IKs[G=P-rqH#a8LgMeO6L$g#dB+0_'HY)WnsdX<HQ$(r!V:m?8;/&akg;./-spLc%=T+flFnm0$jN<(3E?l^?5_mQEVpb]NI(PYn"7V)/Fa$H#r+:Ck(Tlj1-8;nX&+&ea,&aSWY\s_Di#BI5<J-qd7Zua%!9U3#EChf!8c$SA#dn/S%.>VKkIp`,k'pBpcjGo:ja\Ahj!lk?k[Q125Cc<Z,[n/U-pW^Tch7g%&58jEGgjF)ReH2nlm5CIcqY0cB$2j1G(GUB3*.dNFM$EmN$t>6.ebr]bET<FaZVX.m_<@BsKg.u%Z@26UQdoJ^$1]nOUu9%9.AJo7cF@=*"uMk4V&$c_LaD:SW)V>&,V7r(tB.gg3HYC>L,rse$UXEjn-\ja]:oM*CQ/pr/*g`SGW4-@goJJ4p^$W#_=4GJ*tCHuB`hJ%O:[T8jQj+5PEJVPpN?/4n6[X;'^p7[9+>3QC`4Ik;Y\:44,X^rs*K]&bJo"*ZA.Dri%(rS`&^`N?6X4g,B`mgIIJaF\k9)^)X9-MS=Rd[[?2lr5oc1R:@^tWL'.6(oISeZ&pm?[:J*&5a^6@TcrSNXo-Kb$=tmha1rg5PC;'1OZ+nnkL$[?2Rp-'(ogYd2,a>-*E)'.h^nP5=0ornJN4\%Fl5;V3?u=I\&gg&6]F'R]glJBnO(4?nau=[7`HSLX:lok:Z&pTd9f_g\?/0E_No_mpA2X[K/^+AQS(2(m'50:N$gSqu4&gQAFh4aVH/:WA:7YT.Pa`er]N8JKB8(S*n[lV_`VH`^;egk0.=Qh\BZ%@khA?&'B$+"]:-C32)>1N7_?3tk[\r0a,:?ls:;+)BS/kukp),N1E+M@%'DRI>hoX(h[M#p+c+JHp*bIFo8SErR3%CWZl1^>MPS\X,Q[^(Y5,:T>=%T5O,m7W_(2B;MW%%J?TlMlT=5QJm^$4(RNA:%L25rUa3?>"RC_Bs"=\h@;@JEWBCE.Tp["kBQ?^f[-%gl93a,LioPX"I[eLc]5osE^b?hH/jPp.O'$U=YErr*HQ1-dM3^Y_ft,fO=m-$57!\?V]hGU2?iT-Hl=37-'1_IiC\nAWsq'VM$7Q_29Hh7XtRj0V$l7Ta!O:>7r\NOh:+H9a\-??>%Qf='Y@b/i4otd.N,;;rk`NLb$kpVb7t:`N""=4ij*`PJOOA2PT[fBEK/*s0B'DceYT@f5k7h')^>_54pd!d6L()Bp7u&+;=1;7N=3s%>PAaf8W-lrF)_J>Wkl&*b2TkC&,i84=D5FPVq<$h.";:/eMTp(SN4H-S]X\F,H1nK!DrEj<b5pt;90^*f5,Kfe&O,[OBbd#''$9^2,kE:o<$'ICdm0gTD2QANrikuMah)[_OEB7GWK(""uXr=W=F:)UIhiWbbAM)aNc,a6T6XOo`:8WkGuYYl*d#lrb*?un]tDq()&f$LE=*>/g8`]H'YfHg-<q-.P5`6?"h%IiZS^taG49JTj5'LUT%:m/1!ejVCUYpW55#F2s;q7bp\be$:c?)9],;i9Dta7'"65gfkg%qd[+7[=%LespRts$C*T6@3s"EdTO`T=4.cJ'RW60bFQ*hg@ED8;/2!Q&%@qS1Q4>PTK3(G:;GO+g/</@=lr$>4F\S\Ad_at#UF\/+K'ME"J+)hA/hFZ?$<'<M"&]DqYAL,c54)T;$Z7t(L,N>HD6J$bm7>FL.-S&YiQ-^-BK#+s*'J4+U$K:9=VpX+((DpP$"[?D^+5[I+)[>@b>LH[&tO*kON<MYU0nb(CYDhX@/Lkl6i56A6SdsSVCid2C;gte,FFeb('mO%i=N9%gbdpi(/7%HSA1*>l"';G@?SkF1HH3,35u"E/;8Hc(KXaT)P5Y(b#h'S);+\u[]*^4lH-ln(N+BZYp?R2M-R2phNRgWdVKo0*<&a%(;kCrK3\*I,ROFX!P*n;73S38!8D)T2[BJIN0r9BD?ufZ(Xu4<j(a.+YD]j(qg/8[T^;pXd,d4[6P)ekqo.3tA]qT#%&,.c'8E7kX#H("</[[n=2]s')l-%j\r(&e+*Ym%6iOUlgE+3!mQ]Qi]oJG'f=0AWb`?+L0oEm:0/r$,4C$`L?Q7erKKJPgrU!<m>1[Gcd.dK1BLG5e4`<MjSd,d$:k/A`Aa/%t39r:mM7,E/3L&?IqA9$GN?K-5iV`h`Ru>u?O(llQinqj0.,%#N&e`PD#O]VO]K?r.VQF*]Do[LhKP1P:%n:=oF/hQS+/139UFC<U*;d=X_9@\7riEfMeV%6P8;81unK$cictrC\^@ZI4C@QgBBJoeTU3lFLglO=<'ii_Xn*#n]gnW@@:l]-XJoTR[No"P7HV64>!`:q5^tTOplMi>""96>R[57nij*2VXDgg5+EI@R.(&OW9N&jZZ@c2$?UY&qgJ;W>=>VeV9_>r-[bqnRQrZlJC%mlFk=cg>q]]a$MG4m:r+#3i~>endstream
+endobj
+115 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 1196
+>>
+stream
+Gb!#Y9lo;R&A@ZcqO![['[,,G:0St_W)U#.':_\'C+dAhA*k2V/'5$nqe_1N_(<g7\#go&=R+K'p\M9G"Sb@_1Ksq9V/SMn5XS'MTFm#'S\dbJq5Zl,4/7</1eqLNP(85!@>&X19Eqa"I@51J&(VaVN.sV(m190COmn(99Q:o50T%93+\$/UGFps(0bGV&#>f:e>lsE*cRD2=&X7o;BGa6,+CRK.U)6G)+!cIEo>AhK<5uYuk+<dp"4GL*rE#Weh\AQ"'a/t'&[i7\j-EnE!maI%J<40kMu+4:p%S&C(gmu0Zs;4OitDcr_6&*sH2h^g1KNPJH-NZ^ABYB,^O:]#<88$U98q/\1r<>sWc4ARcD,3P;Le6WRMr9](Dh<%[cH@TQqWFl_M;`G.5D!j=D4Qjj9dM9L@8BS7IUqC>64F[m+FG!J&Ogp();UYZ6_=_8)+TF#N-ds*7,iak9HU*@8mqG/""PX#WC_knAEgoH=S5o7%R,8WTB</9X&7J0'(&eJjQO"q<3sLU>UNn"C/cDIs@*XD8TcAdP(t':7fYYh$M31i5XAmi6csUiHs)l0H4Nt&mGJ8@DO*gCKW*P@iJ[UWoX#@7+YfdN,!ISpULWbnmI)1IG4(q7rmqqRJf00S85RR3^jK^i^6gs%:/Lc7/t/%nbVe\@jN]h8gJiL4aBIR1c_S5%AN;FOFB%=9o$pGHU5/a?FRN)G#LIo,eAIU#rHtArLODA1TU-P(tL<b`f38_q`]!=BD9m0pM"DB=9V,<1KP+:>2e892R$k29BVB>ECbFu5=.7^H?k%=k7koh%hC@D*iErENAI4hfra<pT<uC-D@diDm>Qu6^)c1M\(\h\R?6(6/B;@<pQt%*e"$0rGW%^-oPRRB)M_Q($`;bH4:Hh]>gno3pCe:ZTJueRL5uLScr516]l?@[r$#ZP2)uQob;).b]5B9h;DhGa-!PBUjG]!3;SWb[*"A[#jZ,68=E>1c=^\Wkh,`<J&W-;I!%W#Y2PsmtMMuQ!?Ri!><FP=mkLo<b:D;`4,_1]IZ<aCZc4CiL30n+kG(U@gWj$9g\r2Ti#gclh_aH;&aCrP(_r2!I)tZ8NChmOkGu?/)<>Y'nJ-JK<^!9,RE2-+bPkb(P]iqMt%D?Ga@1X\0UaY"/Y4D);9n)\71@)*GU\jYLMgu<#i?[\9#u1ErH-o3(kkkP8F+p1~>endstream
+endobj
+116 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 2694
+>>
+stream
+Gb!;f>B?:T&q9SYkXR!H'4sL7p>qN;H]iN:2t86K8o9i#&.I"*#da\9f"^,1!FZ,:5q8KiG+=_+dgX_(p"-Yb!u$0OILT?Y+(t*%'*H6_('ClP)eR^khq?]?B<7E+9uCL?G7(M5)P6'FGTU6M4K/7/qg<!XYW4LegG_.Z^T#1T$5\Y%Re!GoD4:R>K+d\DrRi:&&FP'+S$MP3C^&%\pM8P&#NjCa%*#3R%gI6fCJVdN*7ORs>T_7@c,+KIdK3A`7&s])o.:YLYnHM5p(M',8Y&*<U\ZHC;o<thPrRXnKM$?C<-%2n<19PP#?:Q)$jt(B=d_ZsKaS+ta;D't3Thmu+;GhDF.rRh6:5WJ)P/;6pjOGqlAK>,S_KOcD0XB@*:PJJ[dRn_KIkPWJ=4CkYK\7N^LaR[e*Z/bml`P="W(2KSo<"@r$+Kn(n%``6\HK+p?4:6'YiP_#U+cO(n>s.[:$GBp[[:,?12X.!1a(TD4ntknF1^kj[C4?\M!M4+&t<[@():[a>?T58E;JNMBtU_G:CGA]EhJfQO9!HAQ[#)V$57J+j<uf+H7M+WIT>hEk7!TfGVN$XduXN<'`V\,0f5_5^d+86lHD7"bfc.8;s--4Q.'95D6Vg:-j;``r?Wo`\:*>.-EZfJ6mqs)J@X=3>+b''7lB@j%Q.\2&>eb/>*2ok8WU[>(eYs+[k<rL*H(I"(I0VDKuVC6)m'R<sDoL>o)HTF/K,-3S#.gbX*=$#N_Hh1"4?k#.Wb\mR!=26G]:nI"72ET%<Zs48b8Ll9X.sJKRI/a"fpbp1+Kk[6haRF>4j"WB5X:FV<""G!nM*BFW_d*Re`Cffk^4Zp'(cBspU\R+XS6WuOq?nPitg@774Q@[;lXX:l0gaS.HV2-jp!@qmdV@=%`p\]BcLUD"I]HQ0e9#;F1'.]aano,?+*"D^?E8i0B`[hA-c4BmZbS+OmjYOLTCgUG?ZZbIo]e*l2o]Xdk7D)U5oXJ'$=RKe7qA^'>,CTTC(2k`Q3:qb*KD"0:RGY>4b**5A8or&1%W^=_b@1Og@g?#5\8I-`+aB3(UEWYW(Gos*dAmM=fm"ke(h$C[UpjGhD%\cK,M\5e5dV5&?*U"CI\fB6o`(DQ).[g/6n\U[?EjcuW7l.9,^gR8e*q[N'e9+K'32X`E*CHu=fOcG.18S/.6U0@8I40-A9Ko/s-7]Dn`C5NlKCkT?9OIG&D4II?9XYU_9AMFtBuk&A7,5o7UgH\k*"D&P(;rAIGo7n&OkPb$7ef"<#&H+E^mm@BkP[H\`Wk+kLRIjMF\:ci<:P1ULcA%c*$\6c.#I0nWu.BkT'8'YFd#*T;:dbJ2KBm5Mb+IXObmk6GCF-fO.5N`D\P,Hn+/Co:W3d$b6eE1?C:8pn.DI5@O=CP."d6;K19!6C8g1(IESmgaB%"FU3`,VnDE/5htIp+%AiI`!@U,&NC);pco#1!K'Pr%YauZOYn:m"Z.$a2!qT;n1%4hlGegs8mb+aO^VUWPUPPoBR[5dd3lu(qQ.W1?e1oYK!giC]2RV6FFY@$0)6cRApIM8tQ=m$$Yu=K8,@!H+9U4*Iib.d(_Qpu<..j6lXLW6q2L(#(M7,4-$+@(;l]70Be7Pf0rA4PupD\[m`F6(lM@WC#*39`cMW9Yiq308gm?l5jQJumC'$)m_YU74Hh&GgBATSl^_ZHd1o*QB6m-L-tmA&giQL2)e4Jmh58\GQ#Od6=@@nR>lpA6m]A6N!^+qujJX`dc)%IK='/f$4=ZN46%#76jJ;P9XY2Fp>Wf!9Rrb_ZCefa,6&cAkPrmC)D?fQ:?)#umZ>$H:Zk;+(jJg+G(c''T\"=9M'l"O5,j3I%OWIJ7up[Hr39JGV!AGkJgZ>Pi4a_N$1het^=*?,*5c$09g`Qr2Cjef2s`C/jN!?Kji5,t>qm%;1i8GPKnu2K@>`G(66:_]"*Xbbdblc#BV=Ac0JtpS%G+GQ,-g,4qhqi(U]c-M^qR(I`K"9B6L\\<M[QM4LDEfZ)sUJ8Mum_ep1VYR^Gj_VhW/b3cb'aMNm?mXPq&!Z3KF[TdeGJo8+IAL)F(SaA+/4'e4B]f(/Kb;"JH%+BX*@(=G=.-@'[ZQO>4Zk+^a=jUCf)hGCpG6$JgX#eA(q:%LQ*06"<5SCG#.hiscPW)=o*',Wc`J$!=F7_:Xd@og[F\g_Z-tBB1Z9QO>3eGuJ/SNIif@B\E07&]bmkoRM+t,b+V7GfMW^GQJ>UD;&-'PgeAs/5C(s*j(9KFG,T>ZG5qr$t25ldh:b1042l_kt#!_);C_/<MUCJ1W\04JFh7rHl)mq+#dAab.u0)D?8[Y+3al/XFkWR42oYQ/_LZfDdT%-EfOCi:^g&HI7I^u9KCEmp]jR0ZI3D&TKd87+]o_j@n@e.urJJ%`S1I951hlh:p[9#BIsW3SOD$htmo.,3qffkS?Oj6TgmQcO^`ZM@:t.I+mTAQh8k7_:l(o'RY%?`+7SI=%rDc9Y_KF81ULBk`oe<7Z92IbQT[-u#cJ^fS%Y\N2_U[-dh1[u_X7Nh??>VX%%4Y.gC@FWEWd@81+A+t$0e+Y@_XT`R7mUMk((fZiW2hgq2BPsR!:<8h'-5k)417n8jV#P<>Q8E("N0h!3`FSaQV0j(WC3\4!s)bu@MK4>?npB^lDXp$r3d@<7ZUT<qF^N/!i'H:`+FkO*g++EF\ZT+KR""2]263~>endstream
+endobj
+117 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 822
+>>
+stream
+Gb!;`bAQ&g&A7ljp?2\e,>o%U\J,M$"9EOV$N[s%6;*Q]ee/XYWggclP*TW?G*Dc)bE.895%]SV9-M*+qKLcr>\A#$97\k>8tZcQ+FAXbg$EuR#L=e@!KD@5SAul\dg4uGJNrM$fbbh+G]jXh^d[GgT(bS8KE<BeK+'RZ0qMq[bTA:s+!CF]fbn%2m9&C!52/+LS-g;!hdkPD)54k$ee3r0]3I\%<YBeZbM-QHS?#,XQILP4N1Z_p$S6DV2mTisJ59P?U!t+<e_4,hGO!::X"=SZ!cB&#aOnB5Hlr>bP)h]CHu_3'e2bBE-+rF_6mn\VWia'Ok`#`$Y$QKK]D/F%4Oko?YYrY>F>$]#4WFJmha@F86^[ih+sUgcIV9u7=0Dd"6]reAO%-8TEa53,,Y#&g^%KubCtIjY`tZ,WL-^@;.)=Yc)Qr827R=Bb-u2)A6G$.Vdep]aGAcBL6]_j;W=UN2r4h(48-j!A-V=IFq]F,sdYjN&()%HPa=)-%8[ptUFnXM*,KEmF^5fH8(R/]p:_lPM&=,!k`B_9ci/>ZTpq7HoWVlaX1"O.O;qB'<S5`p^DEkk=j+Qm0[ti*lBFr$)ArK*cIcEW\\'l[^%1o$q;&$q/m9HB<CI%l"jq+^l@VX`&$HP(CF,NDD1CL_&i's,>GBd#D[ZrAE0X_cWFFM,-k+[sPn.<(^b2lu=*P\eX?593ZjZ/d`T>mS1Le<!?]"Qf'cS\,MJ>NYGNNLfJ;Jj76>W7l(VY*<Q]uffI6Pp7BMguI1=`XA9],Bgb:5bhY:U'KGXc\*%2&/PG-Ce"`HI:eREgZe+h7h,/~>endstream
+endobj
+118 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 1470
+>>
+stream
+Gb!#Z9lo;R&A@ZcqFIob=Rm9PSsW5C9l4K$)48R#Mm6ipNGWql)j:$igQI-?"S/fTLCL686rJ6Df<;eT_86^?J&;]Qo,KB['I\TZ%+HF1b\uEShYY]qgRX?n/F*'apmt8Np=R3&\4fB=r-l9G&K<Vk13UYQKC5L>ol:mID96?A@?*]@5G@0-q7Lp,L+i\?&'DngGm8AlT/RT*"7#-t#\C.p#/WLb4"_*!Zi#r<p7Zt?ElIX3K?U#]38D\4NSn,2pr\q90`MC?k8Mg?nb3Z_m1S_di*prr">7B`EI%D[EOeX6)n<$aW@AXKU8Sid0a3EX3#'2d^B9\M`akKKN4BUc%NoPmDjfr2b),HL5j"P2!0@<jK'*E"Et''c-'7W'M!GaC*m6;H.Y2qH*@?:`oU4t)%Mo"Waa_f&YL4ecW!=C20NlEg?-SWuW"s$<hF?gjqua=E[HQ8<0/0_BOSbNlL9-u_P#,cZE,,9gq$"(/a2C%c)lhLRWgcR*QQ0lTcHO'A^f;E[KrWUpi_a>3aRT/h']$gBe2=Uch2c)KB:'a(^:24'7s:A\Z)rLpK<>K>g!WhUln9Tb2Z8Ydj7@oW2^Q<H*APSm$DcE'YY3SCa#f5_nA)F_2`sW.GVY#2LIj,8+GC:*#hFPtK4TqW?1Y@a/mf)bUL@=r,%$af)4Y".@!gSu"ZJ`]Wa#./Zq?0ND0sKcDSPRpKWd[J@i1.'4:u--=-:j\/C*rQ)BePHC!S0TG%b=3^Ufsfc<tCe%;#bS7>r3'i.tFuVqo5D$(kY_4Q#l)qo.(<14@;(I*!mFL'\L?Yje0QD'31>P,@YS6)HO69N>]';?s];bYK7OKV_pgW0`!W%m;k5:h&]YY)XGLU,WP'#G_<iYtKWg-V[GY78O1+8"9omQ9d%:GEdes&at3/>5lOcPfPpq'I_C81V^\S#:.lToT@6^$*udr'U,/mH6C:H(r9,$'ssm!;!lCg2KB#+6n<SjCiKC;dA0H:osd>ZMY5q=q2TY&?C<qo>1TOB@cegH.]eo<'h&*]).+>SVSe0oDK(2ID%Cm*&iofe,fBb$R)-3un.%lHT%B_*8H0Xg:,]t<qK`7^Y+e2'\Cq(a$[aU"\OK=jca2Ss=YknU$+O4EH1`uo/e$M4Z,$7"!a1,rMH'(9(YXEp,blj.ZI[!%k7Jb.7EBQ#m<jSuNor?\YMo'Z>ulKH3Ks\N*^D%slpYRkh6i75a,je[0h^8Gn/;kf<?b*+F73%?!/\sbl0J`-kV`dr1llN./loGmg/oG\e*PT;D-oZW`6j$q<)oVU?!QTO5YtK*k)]C45c`?X#h)kl$7="MQu,tF?tTni!2sbFE31REadVBMLEXlV;/p!02<[[&0=_QB3Ij=@J>M_E"8GW'A:dj2UPliRh8Pd<B#F/[UBB=N+g+J%_\T$Y9!5kDG.&>ZQ;8?/hJ4Ecr8R>jYMOWPf[i7CVuF_"qZk-7pFj*8DA`~>endstream
+endobj
+119 0 obj
+<<
+/Nums [ 0 120 0 R 1 121 0 R 2 122 0 R 3 123 0 R 4 124 0 R
+ 5 125 0 R 6 126 0 R 7 127 0 R 8 128 0 R 9 129 0 R
+ 10 130 0 R ]
+>>
+endobj
+120 0 obj
+<<
+/S /D /St 1
+>>
+endobj
+121 0 obj
+<<
+/S /D /St 2
+>>
+endobj
+122 0 obj
+<<
+/S /r /St 1
+>>
+endobj
+123 0 obj
+<<
+/S /r /St 2
+>>
+endobj
+124 0 obj
+<<
+/S /D /St 1
+>>
+endobj
+125 0 obj
+<<
+/S /D /St 2
+>>
+endobj
+126 0 obj
+<<
+/S /D /St 3
+>>
+endobj
+127 0 obj
+<<
+/S /D /St 4
+>>
+endobj
+128 0 obj
+<<
+/S /D /St 5
+>>
+endobj
+129 0 obj
+<<
+/S /D /St 6
+>>
+endobj
+130 0 obj
+<<
+/S /D /St 7
+>>
+endobj
+xref
+0 131
+0000000000 65535 f
+0000000073 00000 n
+0000000158 00000 n
+0000000265 00000 n
+0000000377 00000 n
+0000000584 00000 n
+0000000791 00000 n
+0000000959 00000 n
+0000001127 00000 n
+0000001295 00000 n
+0000001463 00000 n
+0000001632 00000 n
+0000001801 00000 n
+0000001970 00000 n
+0000002139 00000 n
+0000002308 00000 n
+0000002477 00000 n
+0000002646 00000 n
+0000002815 00000 n
+0000002984 00000 n
+0000003153 00000 n
+0000003322 00000 n
+0000003491 00000 n
+0000003660 00000 n
+0000003829 00000 n
+0000003998 00000 n
+0000004167 00000 n
+0000004336 00000 n
+0000004505 00000 n
+0000004674 00000 n
+0000004843 00000 n
+0000004959 00000 n
+0000005128 00000 n
+0000005297 00000 n
+0000005466 00000 n
+0000005635 00000 n
+0000005804 00000 n
+0000005973 00000 n
+0000006142 00000 n
+0000006311 00000 n
+0000006480 00000 n
+0000006649 00000 n
+0000006818 00000 n
+0000006987 00000 n
+0000007156 00000 n
+0000007325 00000 n
+0000007816 00000 n
+0000008024 00000 n
+0000008135 00000 n
+0000008343 00000 n
+0000008551 00000 n
+0000008671 00000 n
+0000008859 00000 n
+0000009053 00000 n
+0000009247 00000 n
+0000009419 00000 n
+0000009607 00000 n
+0000009801 00000 n
+0000009995 00000 n
+0000010167 00000 n
+0000010355 00000 n
+0000010638 00000 n
+0000010832 00000 n
+0000011026 00000 n
+0000011198 00000 n
+0000011386 00000 n
+0000011596 00000 n
+0000011768 00000 n
+0000012030 00000 n
+0000012136 00000 n
+0000012317 00000 n
+0000012528 00000 n
+0000012725 00000 n
+0000012936 00000 n
+0000013184 00000 n
+0000013364 00000 n
+0000013591 00000 n
+0000013771 00000 n
+0000013981 00000 n
+0000014191 00000 n
+0000014411 00000 n
+0000014631 00000 n
+0000014849 00000 n
+0000015071 00000 n
+0000015247 00000 n
+0000015523 00000 n
+0000015631 00000 n
+0000015889 00000 n
+0000015964 00000 n
+0000016103 00000 n
+0000016264 00000 n
+0000016377 00000 n
+0000016500 00000 n
+0000016623 00000 n
+0000016746 00000 n
+0000016869 00000 n
+0000016991 00000 n
+0000017172 00000 n
+0000017314 00000 n
+0000017459 00000 n
+0000017602 00000 n
+0000017763 00000 n
+0000017908 00000 n
+0000018049 00000 n
+0000018223 00000 n
+0000018354 00000 n
+0000018547 00000 n
+0000018677 00000 n
+0000018811 00000 n
+0000019307 00000 n
+0000019490 00000 n
+0000020502 00000 n
+0000020685 00000 n
+0000021413 00000 n
+0000021596 00000 n
+0000024165 00000 n
+0000025454 00000 n
+0000028241 00000 n
+0000029155 00000 n
+0000030718 00000 n
+0000030868 00000 n
+0000030903 00000 n
+0000030938 00000 n
+0000030973 00000 n
+0000031008 00000 n
+0000031043 00000 n
+0000031078 00000 n
+0000031113 00000 n
+0000031148 00000 n
+0000031183 00000 n
+0000031218 00000 n
+trailer
+<<
+/ID
+[<2db82f8d13fc9aad0f6ac8c1445975f3><2db82f8d13fc9aad0f6ac8c1445975f3>]
+% ReportLab generated PDF document -- digest (http://www.reportlab.com)
+
+/Info 86 0 R
+/Root 85 0 R
+/Size 131
+>>
+startxref
+31253
+%%EOF
+%PDF-1.4
+% ReportLab Generated PDF document http://www.reportlab.com
+1 0 obj
+<<
+/F1 2 0 R /F2 3 0 R /F3 30 0 R /F4 47 0 R /F5 50 0 R /F6 68 0 R
+>>
+endobj
+2 0 obj
+<<
+/BaseFont /Helvetica /Encoding /WinAnsiEncoding /Name /F1 /Subtype /Type1 /Type /Font
+>>
+endobj
+3 0 obj
+<<
+/BaseFont /Helvetica-Bold /Encoding /WinAnsiEncoding /Name /F2 /Subtype /Type1 /Type /Font
+>>
+endobj
+4 0 obj
+<<
+/Contents 108 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+5 0 obj
+<<
+/Contents 109 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+6 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 48 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 40.01575 754.0394 98.34575 766.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+7 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 48 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 549.6998 754.7894 555.2598 766.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+8 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 60.01575 736.0394 152.2657 748.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+9 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 549.6998 736.7894 555.2598 748.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+10 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 721.8394 0 ] /Rect [ 80.01575 718.0394 130.5857 730.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+11 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 721.8394 0 ] /Rect [ 549.6998 718.7894 555.2598 730.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+12 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 587.0394 0 ] /Rect [ 80.01575 700.0394 126.6957 712.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+13 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 587.0394 0 ] /Rect [ 549.6998 700.7894 555.2598 712.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+14 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 410.2394 0 ] /Rect [ 80.01575 682.0394 126.1457 694.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+15 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 410.2394 0 ] /Rect [ 549.6998 682.7894 555.2598 694.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+16 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 197.4394 0 ] /Rect [ 80.01575 664.0394 126.1457 676.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+17 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 197.4394 0 ] /Rect [ 549.6998 664.7894 555.2598 676.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+18 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 86.63937 0 ] /Rect [ 80.01575 646.0394 126.7057 658.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+19 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 60 0 R /XYZ 40.01575 86.63937 0 ] /Rect [ 549.6998 646.7894 555.2598 658.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+20 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 67 0 R /XYZ 40.01575 699.0394 0 ] /Rect [ 80.01575 628.0394 179.4857 640.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+21 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 67 0 R /XYZ 40.01575 699.0394 0 ] /Rect [ 549.6998 628.7894 555.2598 640.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+22 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 60.01575 610.0394 191.7357 622.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+23 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 549.6998 610.7894 555.2598 622.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+24 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 751.8394 0 ] /Rect [ 80.01575 592.0394 245.0857 604.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+25 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 751.8394 0 ] /Rect [ 549.6998 592.7894 555.2598 604.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+26 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 617.0394 0 ] /Rect [ 80.01575 574.0394 226.7257 586.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+27 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 617.0394 0 ] /Rect [ 549.6998 574.7894 555.2598 586.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+28 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 464.2394 0 ] /Rect [ 80.01575 556.0394 200.0657 568.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+29 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 464.2394 0 ] /Rect [ 549.6998 556.7894 555.2598 568.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+30 0 obj
+<<
+/BaseFont /Helvetica-Oblique /Encoding /WinAnsiEncoding /Name /F3 /Subtype /Type1 /Type /Font
+>>
+endobj
+31 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 383.4394 0 ] /Rect [ 80.01575 538.0394 261.7657 550.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+32 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 383.4394 0 ] /Rect [ 549.6998 538.7894 555.2598 550.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+33 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 314.6394 0 ] /Rect [ 80.01575 520.0394 187.8357 532.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+34 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 73 0 R /XYZ 40.01575 314.6394 0 ] /Rect [ 549.6998 520.7894 555.2598 532.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+35 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 75 0 R /XYZ 40.01575 723.0394 0 ] /Rect [ 80.01575 502.0394 232.8457 514.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+36 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 75 0 R /XYZ 40.01575 723.0394 0 ] /Rect [ 549.6998 502.7894 555.2598 514.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+37 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 60.01575 484.0394 210.6257 496.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+38 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 787.0394 0 ] /Rect [ 549.6998 484.7894 555.2598 496.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+39 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 751.8394 0 ] /Rect [ 80.01575 466.0394 190.6157 478.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+40 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 751.8394 0 ] /Rect [ 549.6998 466.7894 555.2598 478.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+41 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 671.0394 0 ] /Rect [ 80.01575 448.0394 430.1857 460.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+42 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 671.0394 0 ] /Rect [ 549.6998 448.7894 555.2598 460.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+43 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 567.4394 0 ] /Rect [ 80.01575 430.0394 205.0457 442.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+44 0 obj
+<<
+/Border [ 0 0 0 ] /Contents () /Dest [ 84 0 R /XYZ 40.01575 567.4394 0 ] /Rect [ 549.6998 430.7894 555.2598 442.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+45 0 obj
+<<
+/Annots [ 6 0 R 7 0 R 8 0 R 9 0 R 10 0 R 11 0 R 12 0 R 13 0 R 14 0 R 15 0 R
+ 16 0 R 17 0 R 18 0 R 19 0 R 20 0 R 21 0 R 22 0 R 23 0 R 24 0 R 25 0 R
+ 26 0 R 27 0 R 28 0 R 29 0 R 31 0 R 32 0 R 33 0 R 34 0 R 35 0 R 36 0 R
+ 37 0 R 38 0 R 39 0 R 40 0 R 41 0 R 42 0 R 43 0 R 44 0 R ] /Contents 110 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+46 0 obj
+<<
+/Contents 111 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+47 0 obj
+<<
+/BaseFont /Courier-Bold /Encoding /WinAnsiEncoding /Name /F4 /Subtype /Type1 /Type /Font
+>>
+endobj
+48 0 obj
+<<
+/Contents 112 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+49 0 obj
+<<
+/Contents 113 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0 /Trans <<
+
+>>
+ /Type /Page
+>>
+endobj
+50 0 obj
+<<
+/BaseFont /Helvetica-BoldOblique /Encoding /WinAnsiEncoding /Name /F5 /Subtype /Type1 /Type /Font
+>>
+endobj
+51 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/download)
+>> /Border [ 0 0 0 ] /Rect [ 119.4957 615.0394 140.8121 627.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+52 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.gnu.org/licenses/agpl-3.0.html)
+>> /Border [ 0 0 0 ] /Rect [ 208.4357 231.4394 316.8057 243.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+53 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com/licensing/commercial/)
+>> /Border [ 0 0 0 ] /Rect [ 353.4957 231.4394 446.2857 243.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+54 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 471.8457 231.4394 500.1857 243.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+55 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/download)
+>> /Border [ 0 0 0 ] /Rect [ 241.2357 213.4394 261.2457 225.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+56 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.gnu.org/licenses/agpl-3.0.html)
+>> /Border [ 0 0 0 ] /Rect [ 208.4357 132.6394 316.8057 144.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+57 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com/licensing/commercial/)
+>> /Border [ 0 0 0 ] /Rect [ 353.4957 132.6394 446.2857 144.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+58 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 471.8457 132.6394 500.1857 144.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+59 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/download)
+>> /Border [ 0 0 0 ] /Rect [ 343.4657 114.6394 391.9252 126.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+60 0 obj
+<<
+/Annots [ 51 0 R 52 0 R 53 0 R 54 0 R 55 0 R 56 0 R 57 0 R 58 0 R 59 0 R ] /Contents 114 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+61 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.gnu.org/licenses/agpl-3.0.html)
+>> /Border [ 0 0 0 ] /Rect [ 208.9957 745.0394 317.3657 757.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+62 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com/licensing/commercial/)
+>> /Border [ 0 0 0 ] /Rect [ 354.0557 745.0394 446.8457 757.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+63 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 472.4057 745.0394 500.7457 757.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+64 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/download)
+>> /Border [ 0 0 0 ] /Rect [ 344.0257 727.0394 392.1558 739.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+65 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://en.wikipedia.org/wiki/Aladdin_Free_Public_License)
+>> /Border [ 0 0 0 ] /Rect [ 142.8457 640.2394 167.8557 652.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+66 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 182.2957 598.2394 210.6357 610.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+67 0 obj
+<<
+/Annots [ 61 0 R 62 0 R 63 0 R 64 0 R 65 0 R 66 0 R ] /Contents 115 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+68 0 obj
+<<
+/BaseFont /Courier /Encoding /WinAnsiEncoding /Name /F6 /Subtype /Type1 /Type /Font
+>>
+endobj
+69 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://bugs.ghostscript.com)
+>> /Border [ 0 0 0 ] /Rect [ 388.7157 642.0394 489.3006 654.0394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+70 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (file:///home/cliddell/artifex/ghostpdl-release/doc/COPYING)
+>> /Border [ 0 0 0 ] /Rect [ 188.6357 561.2394 302.5657 573.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+71 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://ghostscript.com/doc/current/News.htm)
+>> /Border [ 0 0 0 ] /Rect [ 63.01575 327.6394 88.01575 339.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+72 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (file:///home/cliddell/artifex/ghostpdl-release/doc/COPYING)
+>> /Border [ 0 0 0 ] /Rect [ 40.01575 177.8394 71.13575 189.8394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+73 0 obj
+<<
+/Annots [ 69 0 R 70 0 R 71 0 R 72 0 R ] /Contents 116 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+74 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/)
+>> /Border [ 0 0 0 ] /Rect [ 302.3557 676.2394 396.8157 688.2394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+75 0 obj
+<<
+/Annots [ 74 0 R ] /Contents 117 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+76 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://www.ghostscript.com/)
+>> /Border [ 0 0 0 ] /Rect [ 40.01575 687.7894 134.4757 699.7894 ] /Subtype /Link /Type /Annot
+>>
+endobj
+77 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/en/ps/PLRM.pdf)
+>> /Border [ 0 0 0 ] /Rect [ 431.8757 619.4394 553.0774 631.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+78 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/en/ps/PLRM.pdf)
+>> /Border [ 0 0 0 ] /Rect [ 40.01575 607.4394 192.4259 619.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+79 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf)
+>> /Border [ 0 0 0 ] /Rect [ 212.3057 607.4394 333.2395 619.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+80 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/pdf/index_reference.html)
+>> /Border [ 0 0 0 ] /Rect [ 335.6057 595.4394 464.5796 607.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+81 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/acrobat/sdk/index.html)
+>> /Border [ 0 0 0 ] /Rect [ 470.6557 595.4394 555.2598 607.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+82 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (http://partners.adobe.com/public/developer/acrobat/sdk/index_doc.html)
+>> /Border [ 0 0 0 ] /Rect [ 80.03575 583.4394 330.1257 595.4394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+83 0 obj
+<<
+/A <<
+/S /URI /Type /Action /URI (https://www.artifex.com)
+>> /Border [ 0 0 0 ] /Rect [ 156.1757 478.6394 261.6142 490.6394 ] /Subtype /Link /Type /Annot
+>>
+endobj
+84 0 obj
+<<
+/Annots [ 76 0 R 77 0 R 78 0 R 79 0 R 80 0 R 81 0 R 82 0 R 83 0 R ] /Contents 118 0 R /MediaBox [ 0 0 595.2756 841.8898 ] /Parent 107 0 R /Resources <<
+/Font 1 0 R /ProcSet [ /PDF /Text /ImageB /ImageC /ImageI ]
+>> /Rotate 0
+ /Trans <<
+
+>> /Type /Page
+>>
+endobj
+85 0 obj
+<<
+/Outlines 87 0 R /PageLabels 119 0 R /PageMode /UseNone /Pages 107 0 R /Type /Catalog
+>>
+endobj
+86 0 obj
+<<
+/Author () /CreationDate (D:20000101000000+00'00') /Creator (\(unspecified\)) /Keywords () /ModDate (D:20000101000000+00'00') /Producer (ReportLab PDF Library - www.reportlab.com)
+ /Subject (\(unspecified\)) /Title () /Trapped /False
+>>
+endobj
+87 0 obj
+<<
+/Count 23 /First 88 0 R /Last 88 0 R /Type /Outlines
+>>
+endobj
+88 0 obj
+<<
+/Count 18 /Dest [ 48 0 R /XYZ 40.01575 787.0394 0 ] /First 89 0 R /Last 103 0 R /Parent 87 0 R /Title (Introduction)
+>>
+endobj
+89 0 obj
+<<
+/Count 6 /Dest [ 60 0 R /XYZ 40.01575 787.0394 0 ] /First 90 0 R /Last 95 0 R /Next 96 0 R /Parent 88 0 R
+ /Title (What is Ghostscript?)
+>>
+endobj
+90 0 obj
+<<
+/Dest [ 60 0 R /XYZ 40.01575 721.8394 0 ] /Next 91 0 R /Parent 89 0 R /Title (Ghostscript)
+>>
+endobj
+91 0 obj
+<<
+/Dest [ 60 0 R /XYZ 40.01575 587.0394 0 ] /Next 92 0 R /Parent 89 0 R /Prev 90 0 R /Title (GhostPDF)
+>>
+endobj
+92 0 obj
+<<
+/Dest [ 60 0 R /XYZ 40.01575 410.2394 0 ] /Next 93 0 R /Parent 89 0 R /Prev 91 0 R /Title (GhostPDL)
+>>
+endobj
+93 0 obj
+<<
+/Dest [ 60 0 R /XYZ 40.01575 197.4394 0 ] /Next 94 0 R /Parent 89 0 R /Prev 92 0 R /Title (GhostPCL)
+>>
+endobj
+94 0 obj
+<<
+/Dest [ 60 0 R /XYZ 40.01575 86.63937 0 ] /Next 95 0 R /Parent 89 0 R /Prev 93 0 R /Title (GhostXPS)
+>>
+endobj
+95 0 obj
+<<
+/Dest [ 67 0 R /XYZ 40.01575 699.0394 0 ] /Parent 89 0 R /Prev 94 0 R /Title (URW Font Information)
+>>
+endobj
+96 0 obj
+<<
+/Count 6 /Dest [ 73 0 R /XYZ 40.01575 787.0394 0 ] /First 97 0 R /Last 102 0 R /Next 103 0 R /Parent 88 0 R
+ /Prev 89 0 R /Title (Document roadmap by theme)
+>>
+endobj
+97 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 751.8394 0 ] /Next 98 0 R /Parent 96 0 R /Title (What should I read if I\220m a new user?)
+>>
+endobj
+98 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 617.0394 0 ] /Next 99 0 R /Parent 96 0 R /Prev 97 0 R /Title (GPL and commercial Ghostscript)
+>>
+endobj
+99 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 464.2394 0 ] /Next 100 0 R /Parent 96 0 R /Prev 98 0 R /Title (Before building Ghostscript)
+>>
+endobj
+100 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 383.4394 0 ] /Next 101 0 R /Parent 96 0 R /Prev 99 0 R /Title (What should I read if I\220m not a new user?)
+>>
+endobj
+101 0 obj
+<<
+/Dest [ 73 0 R /XYZ 40.01575 314.6394 0 ] /Next 102 0 R /Parent 96 0 R /Prev 100 0 R /Title (What if I\220m a developer?)
+>>
+endobj
+102 0 obj
+<<
+/Dest [ 75 0 R /XYZ 40.01575 723.0394 0 ] /Parent 96 0 R /Prev 101 0 R /Title (What if I\220m writing documentation?)
+>>
+endobj
+103 0 obj
+<<
+/Count 3 /Dest [ 84 0 R /XYZ 40.01575 787.0394 0 ] /First 104 0 R /Last 106 0 R /Parent 88 0 R /Prev 96 0 R
+ /Title (Presence on the World Wide Web)
+>>
+endobj
+104 0 obj
+<<
+/Dest [ 84 0 R /XYZ 40.01575 751.8394 0 ] /Next 105 0 R /Parent 103 0 R /Title (Ghostscript\220s home page)
+>>
+endobj
+105 0 obj
+<<
+/Dest [ 84 0 R /XYZ 40.01575 671.0394 0 ] /Next 106 0 R /Parent 103 0 R /Prev 104 0 R /Title (Adobe PostScript, Encapsulated PostScript, and PDF reference documentation)
+>>
+endobj
+106 0 obj
+<<
+/Dest [ 84 0 R /XYZ 40.01575 567.4394 0 ] /Parent 103 0 R /Prev 105 0 R /Title (Other material on the WWW)
+>>
+endobj
+107 0 obj
+<<
+/Count 11 /Kids [ 4 0 R 5 0 R 45 0 R 46 0 R 48 0 R 49 0 R 60 0 R 67 0 R 73 0 R 75 0 R
+ 84 0 R ] /Type /Pages
+>>
+endobj
+108 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 404
+>>
+stream
+Gatn!b>,r/&4Q?mMHN7L_p!Al,YKUQ2m=_*#MP>-&Ufaqa62KYBh=6"6UHWm`P&P&ad@Y=`V":-#NuCP]4><#0EkKV#ZksWbd69*WJ&2BEKDFUa^uI+M_V*5\ShZV/\DtF1a@SM=)i-oE6?^':)o-@K-_pdkkE<*>)("1"t3djFb&%AP%sYq,i]n]`0s1m!MKj"C/">YP":PL*?5M0QKrQS.;#UnY"+D:dF0h'7gQf<J%HQZL@s,)"nd?J,Mesqm8f<S4c-NY'M=K9F,f-o?E@e_"`OT6g=bl&](N_:7c'8!L48/WF`thR\/W9`=V7-thp1/m-th$,r=c:JG(VeTFImk-SJ+G0$9nS5*bHRRid=+<S$0t^50aNI5)G[ulT_h8hpAf>ISg+:!BZOU>l~>endstream
+endobj
+109 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 92
+>>
+stream
+GapQh0E=F,0U\H3T\pNYT^QKk?tc>IP,;W#U1^23ihPEM_H"Zg#ZYSJTP%YGC2U%ZDJ?(_?u0NYeAi<FV8*670]3GC~>endstream
+endobj
+110 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 920
+>>
+stream
+GauI7?Z2Df'ZJu*'_a>_<e?;?j_7ouUl&,cC!2`(m"Ku=0EmsaZ>/9G"p/Ya]%fQ*&g\+oTC]D6\L%G1r?C?9QiLCf0V/gu'`96gAhrlEi5R^))J"%=ZV69rQ\4UEe$;-6YLCbY"]XrG>Jmi,fe>SO=VUSEe<?$33@T:6Padml!k&8)^u^u(YIi3YUp6`7';21UnUptO$<&:FS9\L?LUrFsBfhW-_0"!W\rpb[dQIC,rX\ME$K(ShY:]4%\rCp7Ct-aFp/7b)JN)X*f[R$:pMA9pAp&Q2Zb!ka1q?%;LQpYmBs)!R%J*]!n,$VgDG4f=rGMV/qk@1QE#b&rh<7?_,.5enX.q7DNFdAe/Gb*Z]YcU6"ZaL=gob1RB;(2Aq'Q;PXbbm[n+,.&53e7G+%,V4i]<%K#RuFJgAS6ff+S9cXYL:ukC&cd&59LS0MHXO23)1X_D'[<a>a26Bh-0?9]'HC#UV<?9N^+\ip4K%-G',j1gN_="Lsh;'RT@),TjR1k63d+Y@Y4<FDV1-K.%$aYkS\'8gNCMA0]h:P%,Z+mK$5:Z>:hrlNjA6;\DJ004F^J;OTiNWHa/7-5<2g2(jVlAj$3-FpC;O5q%pbW%\_4E)aqp["fg$h.,VGkW;_Y@N2MG3.3h#PF`tTd$UVU')ck`Qhoa!]t8HPb'\E3mV[.-678[%0^Q;oh)@IH55!I^*/S$3/N5(MDo`'&HNr+1jKja8@\lT,n1LaS!nTS(GWA<"hTd`i;48qrM)5nhe"R\q>UmGNkAd;IMT'"!IZ!?0Yn'u#2b[4L'bd(Q8gXTt_%WR>g8E"D/0jO'>G!.N&2;S+O!X![\4OSGPASo;/u$%6U0QqQ(S,D9U!!2g>MtlcjcK)jGt>[526B.4-&!hkEkTQWF2Y0[G<j(g.u4kSp]Edp$Pi~>endstream
+endobj
+111 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 92
+>>
+stream
+GapQh0E=F,0U\H3T\pNYT^QKk?tc>IP,;W#U1^23ihPEM_H"Zg#ZYSJTP%YGC2U%ZDJ?(_?u0NYeAi<FV8*670]3GC~>endstream
+endobj
+112 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 636
+>>
+stream
+Gat$tbAs(+']&?qB1Y4B/.%0RZC.]@cD6B*UoS;[#X`Bh$Y$(7^67hBG1pPC`.0ZaS]B97J_Is<Zg<4s*6T'!j2c!i5m6b*][)5&!BVD--'ZM>,)IO2UJ0<gp+o:F^H^TZ,f1O_9OsCJr&(R.*]M:t8M1;cJg$j*'Q+`'K;GjLltFLuGMq>pElGko1IW.I+p6dY:P8k-@[a+01*c_LRmC+SBj0>"+odRMiOhC"k!/fcG3V;MggpLEK=ArK,8"Rf.gD3#8=iC3[q=sF?go7K7*6cpQo$"d?)MW"SXh`h6(CC,Z-Q/Jb@2>4TDao-mgmIjJbn>7k=n%4dcJuXhS@DE%(`CK@LJr>)MPdmO(KquG&*,R_GuHN?#A)ANRg>JIVloRT%4?SF,dWJ:/@5b958b+IPf#Uo3>A^4P`iNA=VADFqL=G'Rb[A)sDaW__`jh3%GrUe=Dl.4SPM+$D)7J&r0`N#<e^CSU*LCT.:IZH^TBM[lW8eUX&dlDigY6FGE^h6`KG79&V4hS$m-<7=/%7E@chb^8Y;jo/aC&2/?Ji4SJ.qDs-Ga0,So.;;M"h74rAnMZAl!!)f6sc>:Pr7Xjc`=8h46kp>`2RJuZ13U1QYiZqsSjZ;`C3J-/Uq]I0~>endstream
+endobj
+113 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 92
+>>
+stream
+GapQh0E=F,0U\H3T\pNYT^QKk?tc>IP,;W#U1^23ihPEM_H"Zg#ZYSJTP%YGC2U%ZDJ?(_?u0NYeAi<FV8*670]3GC~>endstream
+endobj
+114 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 2494
+>>
+stream
+Gb!ku9lJcW'#"0Do[,J!)1GN$*!R'(p=^&ZcUNiRi(JuE8\IKs[G=P-rqH;i8LgMeYN]F2#dB+0_'HY)WnsdX<HQ$(r!V:m?8;/&akg;./-spLc%=T+flFnm0$jN>(3E?l^?5_mQEVpb]NI(PYn"7V)/Fa$IWOX?Ck(Tlj1-8;nX&+&ea,&aSWY\s_Di#BI5<J-qd7\K`($sR3#EChf!8c$SA#dn/S%.>VKkIp`,k'pBpcjGo:ja\Ahj!lk?k[Q125Cc<Z,[n/U-p_?eFqAD##T,nu"S2\Mqp_)rKJ+[3KI=R#H%TnQgO4;1Y''Bb3aM\S(*KXahoAru\e;W\J=f<RKmY0Ng3D'go=[RTHeBq@2%bDkZa!'");)T\Cu*fUc?aU*n[bK(6E[>I?\#l+QZDd9;diMSbk@X.OY9Ifm4mX'S&OD@pn<I1pXX$f?G%D@i8gSOdDH^kpNjKr=DY*^`'K25%3@n$KkX>:[tdn\Af3^dFKb0(/I+>J;Qjqp<6&X`O_k*mX4=>X//'f!6!%6L`G`H/7o\Pi:IM%,rCN?k7\,<Ga"1@qs9`_"Nmp-%?Q=V%@8Yc$*B[)ck+Hk5*20i9dkO'HFF_cO.+IG0>,5NYpqjTg&qJc5pH'_M=_upBtRID+=6Y#pYfPq6j>#g.7<sP/jLn=BXTA/_37P#o7;G8UYSHJ*r?+>MbrU.I<6KXNbUom/Fn3$9inq^ukhOStAI!/>,@_:6g-qH8O=NHW_Tn@6`.R(]jcsiS4^T<h`Q?&>ul%)OG$+QV@Kn:W./$m7:3oT"Ve(-Y#SV=:VfA@n#n8,RS.WMb]u>Ff@@f^"02mmQiVZ9Di1h#0po1Y/?7MO-UYQ2*)Q0)*#@0SV\j>rle,XYR`\YO#?=(oW7$%O`21P`<9S3bkJuH<OIA7":rB&^k9+l53rUd\UP.N2<=oS?Z;gege4:hhhe`'-WQ/#:UbOq,J#)*ZVo?#L3h=q`Dn-UbAbG#*O9b1VKnW+IX8(ZXeb<kZrY[>D[.0`3In83Q)lp"F$+V?D!9)Doq#qQ`4FAgK$7u7B?+Ft\K\bE]Q$7H'bNNfX;<ItN]B'Ql&#qhiOa(C8/KV#+,%l0dh#2eRf[h'4q/+W&kF=5E$[o1eV9Tf_ud<@)J+mVf,*M)dY2Ye@hU*ZUH!e8DX*b-jJB4ZXg2t/MHqo(E+"MmQ&O7.J)N:aAMFJ<jU),@7YY\UEEPB9^nN])8s!H2\45SJQZ1`Bl;H2C+F0sONKFAUT7fQm+a$O\HdXRQW-2.,`WbM#Xa>nnUrBLt\N#7/eR7)PAT?J]L]1.*/2Z89;sY!DPWs_SlC+NOcCEe':1^>^Ojo#6!%@\EX0OPK.--BPCGr`nl/NRh8?Ss"M/c\@)Cg]Xq:9%_[\@Zo:].<17tEFK73f#hiD#b,4In'LK:;)Z</3X%d3RFfAl17%A7lRlTc4g8qLH]<o@7@=FB_HFIl*5!pueasM[:H#6P&$/QOmoj4A4B4m;M2"Q'OH,/i6s_nIUEujMN_6:p/Qad8VVqQBJ!pdhQjseDSW4)g%I,As>jmKqf6%VXO8pV1)?V$!V,oCps$sl-$6i/#;FJqp7!"[1Q01SH*\B:boiZ*RFaPc+%.l3q8!oY[jXX(7.h$L<d>S98==;_5e`-.48&DQ:>^/G,_7+\u*m[C#O$M;&1#P6$;b"^\;p[(Dbk0KrLcb!@`]If="RlT6;iY"h,I$6^t75[TC%lG,456'_GRhE9+kQ1n4,JNh3_QcuiX-X:+hPMh[S9KJK\2hj)H`%l[,[ALSZhM9`YF87Y7=;(rC%2/TC<0ReuGTm^V1+dmHd;\tET[:5'n&PPiA$O!<NE/<.MDAr!EM^BP_c<j*0F>A+40Zdp^)4cV&*+OO3Q9mcmMlWp:%8UgOALo%e%.*jugXNHUp#KNH$b&1h=;'9T6n[(Hn&bM<Bf:uS%f`G#Md\aJ6*>N_P(\;=JDA#.U6*Y,JF0Z;)[(^_7a,Z\2h]K>$Yh'YEOEU&f1"HOID,Xhd.RNgkjf\i+UB@FrF0TuZ=VfL##UVm$,b/FeJh#!W^TmH/)nM$%FQLE?,\RnO#uJ#+b*bqD3&(KpE+=p?H:7$le?2fk/X[7(r]qXQQ(!&*\MB7Y79oI_B!gorq7ZqX_Y:Bkkk?)1nl/nSi7`Ec[uHMW5!cAZ?5OJSFm_r7,+6(*6N._rIb'R`Xn*+n9tDkbscK0a#)rcnaGNS'Q'Ob#mk:3"8Cgb?ChN(crR<g\)Y;D6F;@.#GX/H3E76:&()*-d1eWeNd]a=@-0gVJ(@rbC-o*8,XW+!p^V@oBK#_i?[=_U[<Oq\Zl8sedCo<aDTE^/MQ5pgGP&simSW7&-qCTg_)Uj>8+3jW]qq//JLDL+i9^hsom`7"JcB2d>+0uEEBK;g\%_1&355<RMZ$=W7\-Ch1%;T[;/G5"W,tda+[Ger1C=77oSXbYETb0^cb(qs^[UA7qFuH=3Lg=Mdjtm4\"=HWD9gH+%F\E_G5~>endstream
+endobj
+115 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 1176
+>>
+stream
+Gat%!?ZY3b&:`kAlsoI<;_2>rGj:AI0U\U@%F-5i\JJ\tZ!(YJOpq#mmn/*L(q?>N`\s-igAUtQ;$cZcrgp7nmLm%#;P4G]*,%l08ETE'o`":+rQHr<!KDgG%-%?p#3-9HiGd_1og]N;cn6`cp$5o%^dhof*XTi=.&N)BiFZ+=A)A(qO9Tq5ZEcgK>2UEAV88.=^Noir%LZV'[q./>>c-:K<IOlK\L`FXO;,2c<L&]d)Gmu&jC<Xr<[dX-aIoNKW\9J3$-?7Bd%t+X!BpsVC0=d9d(CuAC7peAc#lYhdh.AmnN)Fo(k'9\#Qj-"f[]pB%L9@9lJHP`nl7,HV/-0,Q!rN%4.h%-6)&mi&NRVsknPOj0!p5`@ZJR-U,&I4\dOQiA0/gu+]>^S$_9mrm[),^j"s$(eb]4/M7,/Us-tXM"tb-5Xdri:),V.PZ(pJ;FEb%M=pj<UlYprq2Y^Q8##&g6=JI]L%k@[Kg/b'0)9UlX<JAet+?G&[0WNO"35irSdXqUBr#EoEONFVS=o:>Lp,0I!*M\@mnKtBJ!j6dd#j^Cm,M;s$Aj%o"D3'XnEPUN-JOZa!)g.8e((h=:'H"[o>/8rq^X'/WEQIB$G#&?ejJg4O:_nap+=q+QEZfuo(lgonbNm=j9N>Z_YsQghhNM#?K5^+.<FV9sM8R`T4'^q)'-aOL]%)eED=&aNd/?$uT[DNMs%I0i>,>H]=F2>l@18UYlblM&gs9ork=;Yk.`e)/FnJ#%(&"3(KiMWDG\/4W(`gsj$Ya&?nc2J3#u"\I*ane+:#=YAB0`r4)p,<KBo.sW,O4(ON/S7\S`%acXn<m%'oJ>j.(3W6BlQ>\H&k]:o2A0J3sBH*aVD&>g@`ao&N&Vg9h+0j:KV/kn/l`HQpZe'_ThDt&_ZtK<b^5tBP]6Cm!8!1\R5cpPSk0_,>cL]O;ik'G7bf'PEKPrMI<FfP2!(B>+"b.mN2I$_>tZc"V0#$1qZ5>E?4e/$8PGD)#O;Xn]0\=N&Vd`@)eJ;IAffT0eke1/5Ika)^-b4DR[]0+!$IVTS"A=RHE^pa[T6hJ8_Z.d.;e$m5UH%-aho6p#1?$BOE[NlZ1DYf?,@^M4aP"X3(3#@1_iSN.N3]'T)_';9mIXj>Uu\\*iJVFFO400qiJLlpUA_8;I4p^[NL.o_o"<IU+T~>endstream
+endobj
+116 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 2694
+>>
+stream
+Gb!;f>B?:T&q9SYkXR!H'4sL7p>qN;H]iN:2t86K8o9i#&.I"*#da\9f"^,1!FZ,:5q8KiG+=_+dgX_(p"-Yb!u$0OILT?Y+(t*%'*H6_('ClP)eR^khq?]?B<7E+9uCL?G7(M5)P6'FGTU6M4K/7/qg<!XYW4LegG_.Z^T#1T$5\Y%Re!GoD4:R>K+d\DrRi:&&FP'+S$MP3C^&%\pM8P&#NjCa%*#3R%gI6fCJVdN*7ORs>T_7@c,+KIdK3A`7&s])o.:YLYnHM5p(M',8Y&*<U\ZHC;o<thPrRXnKM$?C<-%2n<19PP#?:Q)$jt(B=d_ZsKaS+ta;D't3Thmu+;GhDF.rRh6:5WJ)P/;6pjOGqlAK>,S_KOcD0XB@*:PJJ[dRn_KIkPWJ=4CkYK\7N^LaR[e*Z/bml`P="W(2KSo<"@r$+Kn(n%``6\HK+p?4:6'YiP_#U+cO(n>s.[:$GBp[[:,?12X.!1a(TD4ntknF1^kj[C4?\M!M4+&t<[@():[a>?T58E;JNMBtU_G:CGA]EhJfQO9!HAQ[#)V$57J+j<uf+H7M+WIT>hEk7!TfGVN$XduXN<'`V\,0f5_5^d+86lHD7"bfc.8;s--4Q.'95D6Vg:-j;``r?Wo`\:*>.-EZfJ6mqs)J@X=3>+b''7lB@j%Q.\2&>eb/>*2ok8WU[>(eYs+[k<rL*H(I"(I0VDKuVC6)m'R<sDoL>o)HTF/K,-3S#.gbX*=$#N_Hh1"4?k#.Wb\mR!=26G]:nI"72ET%<Zs48b8Ll9X.sJKRI/a"fpbp1+Kk[6haRF>4j"WB5X:FV<""G!nM*BFW_d*Re`Cffk^4Zp'(cBspU\R+XS6WuOq?nPitg@774Q@[;lXX:l0gaS.HV2-jp!@qmdV@=%`p\]BcLUD"I]HQ0e9#;F1'.]aano,?+*"D^?E8i0B`[hA-c4BmZbS+OmjYOLTCgUG?ZZbIo]e*l2o]Xdk7D)U5oXJ'$=RKe7qA^'>,CTTC(2k`Q3:qb*KD"0:RGY>4b**5A8or&1%W^=_b@1Og@g?#5\8I-`+aB3(UEWYW(Gos*dAmM=fm"ke(h$C[UpjGhD%\cK,M\5e5dV5&?*U"CI\fB6o`(DQ).[g/6n\U[?EjcuW7l.9,^gR8e*q[N'e9+K'32X`E*CHu=fOcG.18S/.6U0@8I40-A9Ko/s-7]Dn`C5NlKCkT?9OIG&D4II?9XYU_9AMFtBuk&A7,5o7UgH\k*"D&P(;rAIGo7n&OkPb$7ef"<#&H+E^mm@BkP[H\`Wk+kLRIjMF\:ci<:P1ULcA%c*$\6c.#I0nWu.BkT'8'YFd#*T;:dbJ2KBm5Mb+IXObmk6GCF-fO.5N`D\P,Hn+/Co:W3d$b6eE1?C:8pn.DI5@O=CP."d6;K19!6C8g1(IESmgaB%"FU3`,VnDE/5htIp+%AiI`!@U,&NC);pco#1!K'Pr%YauZOYn:m"Z.$a2!qT;n1%4hlGegs8mb+aO^VUWPUPPoBR[5dd3lu(qQ.W1?e1oYK!giC]2RV6FFY@$0)6cRApIM8tQ=m$$Yu=K8,@!H+9U4*Iib.d(_Qpu<..j6lXLW6q2L(#(M7,4-$+@(;l]70Be7Pf0rA4PupD\[m`F6(lM@WC#*39`cMW9Yiq308gm?l5jQJumC'$)m_YU74Hh&GgBATSl^_ZHd1o*QB6m-L-tmA&giQL2)e4Jmh58\GQ#Od6=@@nR>lpA6m]A6N!^+qujJX`dc)%IK='/f$4=ZN46%#76jJ;P9XY2Fp>Wf!9Rrb_ZCefa,6&cAkPrmC)D?fQ:?)#umZ>$H:Zk;+(jJg+G(c''T\"=9M'l"O5,j3I%OWIJ7up[Hr39JGV!AGkJgZ>Pi4a_N$1het^=*?,*5c$09g`Qr2Cjef2s`C/jN!?Kji5,t>qm%;1i8GPKnu2K@>`G(66:_]"*Xbbdblc#BV=Ac0JtpS%G+GQ,-g,4qhqi(U]c-M^qR(I`K"9B6L\\<M[QM4LDEfZ)sUJ8Mum_ep1VYR^Gj_VhW/b3cb'aMNm?mXPq&!Z3KF[TdeGJo8+IAL)F(SaA+/4'e4B]f(/Kb;"JH%+BX*@(=G=.-@'[ZQO>4Zk+^a=jUCf)hGCpG6$JgX#eA(q:%LQ*06"<5SCG#.hiscPW)=o*',Wc`J$!=F7_:Xd@og[F\g_Z-tBB1Z9QO>3eGuJ/SNIif@B\E07&]bmkoRM+t,b+V7GfMW^GQJ>UD;&-'PgeAs/5C(s*j(9KFG,T>ZG5qr$t25ldh:b1042l_kt#!_);C_/<MUCJ1W\04JFh7rHl)mq+#dAab.u0)D?8[Y+3al/XFkWR42oYQ/_LZfDdT%-EfOCi:^g&HI7I^u9KCEmp]jR0ZI3D&TKd87+]o_j@n@e.urJJ%`S1I951hlh:p[9#BIsW3SOD$htmo.,3qffkS?Oj6TgmQcO^`ZM@:t.I+mTAQh8k7_:l(o'RY%?`+7SI=%rDc9Y_KF81ULBk`oe<7Z92IbQT[-u#cJ^fS%Y\N2_U[-dh1[u_X7Nh??>VX%%4Y.gC@FWEWd@81+A+t$0e+Y@_XT`R7mUMk((fZiW2hgq2BPsR!:<8h'-5k)417n8jV#P<>Q8E("N0h!3`FSaQV0j(WC3\4!s)bu@MK4>?npB^lDXp$r3d@<7ZUT<qF^N/!i'H:`+FkO*g++EF\ZT+KR""2]263~>endstream
+endobj
+117 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 822
+>>
+stream
+Gb!;`bAQ&g&A7ljp?2\e,>o%U\J,M$"9EOV$N[s%6;*Q]ee/XYWggclP*TW?G*Dc)bE.895%]SV9-M*+qKLcr>\A#$97\k>8tZcQ+FAXbg$EuR#L=e@!KD@5SAul\dg4uGJNrM$fbbh+G]jXh^d[GgT(bS8KE<BeK+'RZ0qMq[bTA:s+!CF]fbn%2m9&C!52/+LS-g;!hdkPD)54k$ee3r0]3I\%<YBeZbM-QHS?#,XQILP4N1Z_p$S6DV2mTisJ59P?U!t+<e_4,hGO!::X"=SZ!cB&#aOnB5Hlr>bP)h]CHu_3'e2bBE-+rF_6mn\VWia'Ok`#`$Y$QKK]D/F%4Oko?YYrY>F>$]#4WFJmha@F86^[ih+sUgcIV9u7=0Dd"6]reAO%-8TEa53,,Y#&g^%KubCtIjY`tZ,WL-^@;.)=Yc)Qr827R=Bb-u2)A6G$.Vdep]aGAcBL6]_j;W=UN2r4h(48-j!A-V=IFq]F,sdYjN&()%HPa=)-%8[ptUFnXM*,KEmF^5fH8(R/]p:_lPM&=,!k`B_9ci/>ZTpq7HoWVlaX1"O.O;qB'<S5`p^DEkk=j+Qm0[ti*lBFr$)ArK*cIcEW\\'l[^%1o$q;&$q/m9HB<CI%l"jq+^l@VX`&$HP(CF,NDD1CL_&i's,>GBd#D[ZrAE0X_cWFFM,-k+[sPn.<(^b2lu=*P\eX?593ZjZ/d`T>mS1Le<!?]"Qf'cS\,MJ>NYGNNLfJ;Jj76>W7l(VY*<Q]uffI6Pp7BMguI1=`XA9],Bgb:5bhY:U'KGXc\*%2&/PG-Ce"`HI:eREgZe+h7h,/~>endstream
+endobj
+118 0 obj
+<<
+/Filter [ /ASCII85Decode /FlateDecode ] /Length 1470
+>>
+stream
+Gb!#Z9lo;R&A@ZcqFIob=Rm9PSsW5C9l4K$)48R#Mm6ipNGWql)j:$igQI-?"S/fTLCL686rJ6Df<;eT_86^?J&;]Qo,KB['I\TZ%+HF1b\uEShYY]qgRX?n/F*'apmt8Np=R3&\4fB=r-l9G&K<Vk13UYQKC5L>ol:mID96?A@?*]@5G@0-q7Lp,L+i\?&'DngGm8AlT/RT*"7#-t#\C.p#/WLb4"_*!Zi#r<p7Zt?ElIX3K?U#]38D\4NSn,2pr\q90`MC?k8Mg?nb3Z_m1S_di*prr">7B`EI%D[EOeX6)n<$aW@AXKU8Sid0a3EX3#'2d^B9\M`akKKN4BUc%NoPmDjfr2b),HL5j"P2!0@<jK'*E"Et''c-'7W'M!GaC*m6;H.Y2qH*@?:`oU4t)%Mo"Waa_f&YL4ecW!=C20NlEg?-SWuW"s$<hF?gjqua=E[HQ8<0/0_BOSbNlL9-u_P#,cZE,,9gq$"(/a2C%c)lhLRWgcR*QQ0lTcHO'A^f;E[KrWUpi_a>3aRT/h']$gBe2=Uch2c)KB:'a(^:24'7s:A\Z)rLpK<>K>g!WhUln9Tb2Z8Ydj7@oW2^Q<H*APSm$DcE'YY3SCa#f5_nA)F_2`sW.GVY#2LIj,8+GC:*#hFPtK4TqW?1Y@a/mf)bUL@=r,%$af)4Y".@!gSu"ZJ`]Wa#./Zq?0ND0sKcDSPRpKWd[J@i1.'4:u--=-:j\/C*rQ)BePHC!S0TG%b=3^Ufsfc<tCe%;#bS7>r3'i.tFuVqo5D$(kY_4Q#l)qo.(<14@;(I*!mFL'\L?Yje0QD'31>P,@YS6)HO69N>]';?s];bYK7OKV_pgW0`!W%m;k5:h&]YY)XGLU,WP'#G_<iYtKWg-V[GY78O1+8"9omQ9d%:GEdes&at3/>5lOcPfPpq'I_C81V^\S#:.lToT@6^$*udr'U,/mH6C:H(r9,$'ssm!;!lCg2KB#+6n<SjCiKC;dA0H:osd>ZMY5q=q2TY&?C<qo>1TOB@cegH.]eo<'h&*]).+>SVSe0oDK(2ID%Cm*&iofe,fBb$R)-3un.%lHT%B_*8H0Xg:,]t<qK`7^Y+e2'\Cq(a$[aU"\OK=jca2Ss=YknU$+O4EH1`uo/e$M4Z,$7"!a1,rMH'(9(YXEp,blj.ZI[!%k7Jb.7EBQ#m<jSuNor?\YMo'Z>ulKH3Ks\N*^D%slpYRkh6i75a,je[0h^8Gn/;kf<?b*+F73%?!/\sbl0J`-kV`dr1llN./loGmg/oG\e*PT;D-oZW`6j$q<)oVU?!QTO5YtK*k)]C45c`?X#h)kl$7="MQu,tF?tTni!2sbFE31REadVBMLEXlV;/p!02<[[&0=_QB3Ij=@J>M_E"8GW'A:dj2UPliRh8Pd<B#F/[UBB=N+g+J%_\T$Y9!5kDG.&>ZQ;8?/hJ4Ecr8R>jYMOWPf[i7CVuF_"qZk-7pFj*8DA`~>endstream
+endobj
+119 0 obj
+<<
+/Nums [ 0 120 0 R 1 121 0 R 2 122 0 R 3 123 0 R 4 124 0 R
+ 5 125 0 R 6 126 0 R 7 127 0 R 8 128 0 R 9 129 0 R
+ 10 130 0 R ]
+>>
+endobj
+120 0 obj
+<<
+/S /D /St 1
+>>
+endobj
+121 0 obj
+<<
+/S /D /St 2
+>>
+endobj
+122 0 obj
+<<
+/S /r /St 1
+>>
+endobj
+123 0 obj
+<<
+/S /r /St 2
+>>
+endobj
+124 0 obj
+<<
+/S /D /St 1
+>>
+endobj
+125 0 obj
+<<
+/S /D /St 2
+>>
+endobj
+126 0 obj
+<<
+/S /D /St 3
+>>
+endobj
+127 0 obj
+<<
+/S /D /St 4
+>>
+endobj
+128 0 obj
+<<
+/S /D /St 5
+>>
+endobj
+129 0 obj
+<<
+/S /D /St 6
+>>
+endobj
+130 0 obj
+<<
+/S /D /St 7
+>>
+endobj
+xref
+0 131
+0000000000 65535 f
+0000000073 00000 n
+0000000158 00000 n
+0000000265 00000 n
+0000000377 00000 n
+0000000584 00000 n
+0000000791 00000 n
+0000000959 00000 n
+0000001127 00000 n
+0000001295 00000 n
+0000001463 00000 n
+0000001632 00000 n
+0000001801 00000 n
+0000001970 00000 n
+0000002139 00000 n
+0000002308 00000 n
+0000002477 00000 n
+0000002646 00000 n
+0000002815 00000 n
+0000002984 00000 n
+0000003153 00000 n
+0000003322 00000 n
+0000003491 00000 n
+0000003660 00000 n
+0000003829 00000 n
+0000003998 00000 n
+0000004167 00000 n
+0000004336 00000 n
+0000004505 00000 n
+0000004674 00000 n
+0000004843 00000 n
+0000004959 00000 n
+0000005128 00000 n
+0000005297 00000 n
+0000005466 00000 n
+0000005635 00000 n
+0000005804 00000 n
+0000005973 00000 n
+0000006142 00000 n
+0000006311 00000 n
+0000006480 00000 n
+0000006649 00000 n
+0000006818 00000 n
+0000006987 00000 n
+0000007156 00000 n
+0000007325 00000 n
+0000007816 00000 n
+0000008024 00000 n
+0000008135 00000 n
+0000008343 00000 n
+0000008551 00000 n
+0000008671 00000 n
+0000008859 00000 n
+0000009053 00000 n
+0000009247 00000 n
+0000009419 00000 n
+0000009607 00000 n
+0000009801 00000 n
+0000009995 00000 n
+0000010167 00000 n
+0000010355 00000 n
+0000010638 00000 n
+0000010832 00000 n
+0000011026 00000 n
+0000011198 00000 n
+0000011386 00000 n
+0000011596 00000 n
+0000011768 00000 n
+0000012030 00000 n
+0000012136 00000 n
+0000012317 00000 n
+0000012528 00000 n
+0000012725 00000 n
+0000012936 00000 n
+0000013184 00000 n
+0000013364 00000 n
+0000013591 00000 n
+0000013771 00000 n
+0000013981 00000 n
+0000014191 00000 n
+0000014411 00000 n
+0000014631 00000 n
+0000014849 00000 n
+0000015071 00000 n
+0000015247 00000 n
+0000015523 00000 n
+0000015631 00000 n
+0000015889 00000 n
+0000015964 00000 n
+0000016103 00000 n
+0000016264 00000 n
+0000016377 00000 n
+0000016500 00000 n
+0000016623 00000 n
+0000016746 00000 n
+0000016869 00000 n
+0000016991 00000 n
+0000017172 00000 n
+0000017314 00000 n
+0000017459 00000 n
+0000017602 00000 n
+0000017763 00000 n
+0000017908 00000 n
+0000018049 00000 n
+0000018223 00000 n
+0000018354 00000 n
+0000018547 00000 n
+0000018677 00000 n
+0000018811 00000 n
+0000019307 00000 n
+0000019490 00000 n
+0000020502 00000 n
+0000020685 00000 n
+0000021413 00000 n
+0000021596 00000 n
+0000024183 00000 n
+0000025452 00000 n
+0000028239 00000 n
+0000029153 00000 n
+0000030716 00000 n
+0000030866 00000 n
+0000030901 00000 n
+0000030936 00000 n
+0000030971 00000 n
+0000031006 00000 n
+0000031041 00000 n
+0000031076 00000 n
+0000031111 00000 n
+0000031146 00000 n
+0000031181 00000 n
+0000031216 00000 n
+trailer
+<<
+/ID
+[<2db82f8d13fc9aad0f6ac8c1445975f3><2db82f8d13fc9aad0f6ac8c1445975f3>]
+% ReportLab generated PDF document -- digest (http://www.reportlab.com)
+
+/Info 86 0 R
+/Root 85 0 R
+/Size 131
+>>
+startxref
+31251
+%%EOF
diff --git a/doc/History9.htm b/doc/History9.htm
deleted file mode 100644
index 4ebca7b4..00000000
--- a/doc/History9.htm
+++ /dev/null
@@ -1,201 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>History of Ghostscript versions 9.n</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<!--
-WARNING: do not use Pete Kaiser's emacs function "gs-toc" alone to
-re-create the table of contents here, because it will replace the
-hand-edited TOC subheads with a separate subhead for each H2 in
-the body of the file. Or if you do, first look at the original
-TOC to see how to edit it for visual conciseness.
--->
-
-<h2><a name="toc"></a>Table of contents</h2>
-
-<blockquote><ul class="toc">
-<li><a href="#Version9.56.0">Version 9.56.0 (2022-02-22)</a></li>
-</ul></blockquote>
-
-<h1>History of Ghostscript versions 9.n</h1>
-
-
-<ul>
- <li>Version 9.56.0 (2022-03-14)</li>
-</ul>
-
-
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-
-<p>
-This document is a record of changes in Ghostscript releases numbered 9.xx.
-<p><u>Important</u>: see <a href="#9.56.0_changelog">Version 9.56.0 Changelog</a>
-
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-<h2><a name="Version9.56.0"></a>Version 9.56.0 (2022-02-22)</h2>
-<p> Highlights in this release include:
-<ul>
-<li>
-<p><b>New PDF Interpreter:</b> This is an entirely new implementation written in C (rather than
-PostScript, as before). For a full discussion of this change and reasons for it see:
-<a href="https://ghostscript.com/pdfi.html">Changes Coming to the PDF Interpreter</a>.
-<p>In this (9.56.0) release, the new PDF interpreter is now <em><u>ENABLED</u></em> by default
-in Ghostscript, but the old PDF interpreter can be used as a fallback by specifying
-<code>-dNEWPDF=false</code>. We've provided this so users that encounter issues with the new
-interpreter can keep working while we iron out those issues, the option will not be available in
-the long term.
-<p>This also allows us to offer a new executable (<code>gpdf</code>, or <code>gpdfwin??.exe</code>
-on Windows) which is <i>purely</i> for PDF input. For this release, those new binaries are not included
-in the "install" make targets, nor in the Windows installers.
-</li>
-<li>
-<p>Calling Ghostscript via the GS API is now thread safe. The one limitation is that the X11 devices for
-Unix-like systems (x11, x11alpha, x11cmyk, x11cmyk2, x11cmyk4, x11cmyk8, x11gray2, x11gray4 and x11mono)
-cannot be made thread safe, due to their interaction with the X11 server, those devices have been modified
-to only allow one instance in an executable.
-</li>
-<li>
-<p>The <code>PSD</code> output device now writes ICC profiles to their output files, for improved
-color fidelity.
-</li>
-<li>
-<p>Our efforts in code hygiene and maintainability continue.
-</li>
-<li>
-<p>The usual round of bug fixes, compatibility changes, and incremental improvements.
-</li>
-<li>
-<p>(9.53.0) We have added the capability to build with the Tesseract OCR engine. In such
-a build, new devices are available (pdfocr8/pdfocr24/pdfocr32) which render the
-output file to an image, OCR that image, and output the image "wrapped" up as a
-PDF file, with the OCR generated text information included as "invisible" text
-(in PDF terms, text rendering mode 3).
-<p>Mainly due to time constraints, we only support including Tesseract from
-source included in our release packages, and not linking to Tesseract/Leptonica
-shared libraries. Whether we add this capability will be largely dependent on
-community demand for the feature.
-<p>See <a href="https://www.ghostscript.com/ocr.html">Enabling OCR</a> for more details.
-</li>
-</ul>
-<p>For a list of open issues, or to report problems,
-please visit <a href="http://bugs.ghostscript.com/">bugs.ghostscript.com</a>.
-<h3><a name="9.55.0_Incompatible_changes"></a>Incompatible changes</h3>
-<h4>Included below are incompatible changes from recent releases (the
-specific release in question is listed in parentheses). We include these,
-for now, as we are aware that not everyone upgrades with every release.</h4>
-<ul>
-<li>
-<p>(9.55.0) Changes to the <code>device API</code>. This will affect developers and maintainers of
-Ghostscript devices. Firstly, and most importantly, the way device-specific "procs" are specified has
-been rewritten to make it (we think!) clearer and less confusing. See
-<a href="Drivers.htm">The Interface between Ghostscript and Device Drivers</a> and
-<a href="https://www.notion.so/artifexsoftware/The-Great-Device-Rework-Of-2021-94092fe1395d4a088b91462f0ca5038a">The Great Device Rework Of 2021</a>
-for more details.
-</li>
-<li>
-<p>(9.55.0) The command line options <code>-sGraphicsICCProfile=___</code>, <code>-dGraphicsIntent=#</code>, <code>-dGraphicsBlackPt=#</code>,
-<code>-dGraphicsKPreserve=#</code> have been changed to <code>-sVectorICCProfile=___</code>, <code>-dVectorIntent=#</code>, <code>-dVectorBlackPt=#</code>,
-<code>-dVectorKPreserve=#</code>.
-</li>
-<li>
-<p>(9.53.0) As of 9.53.0, we have (re-)introduced the patch level to the version number,
-this helps facilitate a revised policy on handling security-related issues.
-<p><strong>Note for GSView Users: </strong>The patch level addition breaks GSView 5 (it is
-hardcoded to check for versions <code>704-999</code>. It is possible, but not guaranteed that
-a GSView update might be forthcoming to resolve this.
-</li>
-<li>
-<p>(9.52) <code>-dALLOWPSTRANSPARENCY</code>: The transparency compositor (and related
-features), whilst we are improving it, remains sensitive to being driven correctly, and
-incorrect use can have unexpected/undefined results. Hence, as part of improving security,
-we limited access to these operators, originally using the <code>-dSAFER</code> feature.
-As we made "SAFER" the default mode, that became unacceptable, hence the new option
-<code>-dALLOWPSTRANSPARENCY</code> which enables access to the operators.
-</li>
-<li>
-<p>(9.50) There are a couple of subtle incompatibilities between the old and new SAFER
-implementations. Firstly, as mentioned in the 9.50 release notes, SAFER now leaves
-standard PostScript functionality unchanged (except for the file access limitations).
-Secondly, the interaction with <code>save</code>&sol;<code>restore</code> operations
-has changed. See <a href="Use.htm#Safer">SAFER</a>.
-<p><strong>Important Note for Windows Users</strong>:
-<br>
-The file/path pattern matching is case-sensitive, even on Windows. This is a
-change in behaviour compared to the old code which, on Windows, was case
-<i>in</i>sensitive. This is in recognition of changes in Windows behaviour,
-in that it now supports (although does not enforce) case sensitivity.
-</li>
-<li>
-<p>(9.27) The process of &quot;tidying&quot; the PostScript namespace should have removed
-only non-standard and undocumented operators. Nevertheless, it is possible that
-any integrations or utilities that rely on those non-standard and undocumented
-operators may stop working or may change behaviour.
-<p>If you encounter such a case, please contact us (<a href="https://discord.gg/H9GXKwyPvY">Discord<a>,
-<a href="https://web.libera.chat/#ghostscript">#ghostscript IRC channel</a>,
-or the gs-devel mailing list would be best), and we'll work with you to either find an
-alternative solution or return the previous functionality, if there is genuinely no other
-option.
-</li>
-</ul>
-<h3><a name="9.56.0_changelog"></a>Changelog</h3>
-<p>From 9.55.0 onwards, in recognition of how unwieldy very large HTML files can become
-(History9.html had reached 8.1Mb!), we intend to only include the summary highlights (above).
-<p>For anyone wanting the full details of the changes in
-a release, we ask them to look at the history in our public git repository:
-<a href="https://git.ghostscript.com/?p=ghostpdl.git;a=shortlog;h=refs/tags/ghostpdl-9.56.0">ghostpdl-9.56.0</a> log.
-<p>If this change does not draw negative feedback, History?.htm file(s) will be removed from the release archives.
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/HowToBuildTheDocs.txt b/doc/HowToBuildTheDocs.txt
new file mode 100644
index 00000000..26c89d23
--- /dev/null
+++ b/doc/HowToBuildTheDocs.txt
@@ -0,0 +1,100 @@
+How to build the Ghostscript documentation
+==========================================
+
+
+Welcome to the Ghostscript documentation. This documentation relies on Sphinx (https://www.sphinx-doc.org/en/master/) to publish HTML & PDF docs from markdown files written with restructured text / RST (https://en.wikipedia.org/wiki/ReStructuredText).
+
+
+Installing Sphinx & dependencies
+--------------------------------
+
+1. You should follow the instructions on the Sphinx website to install Sphinx on your system.
+
+2. Ensure you have rst2pdf (https://pypi.org/project/rst2pdf/) installed:
+
+ pip install rst2pdf
+
+ This ensures that you can build a PDF of the documentation.
+
+3. The Sphinx documentation files also rely on the "readthedocs" theme to be installed, follow the instructions here: https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html
+
+4. Once you have installed the "readthedocs" theme, depending on your OS, it will also have installed a `docutils` (http://docutils.sourceforge.net/) Python package.
+
+ This should be okay, however if you have issues with building docs for PDF ensure that the `docutils` version works for you.
+
+ To see what version you have do:
+
+ python3 -m pip show docutils
+
+ On Windows the required version was 0.18.1 to build PDF docs (pip install docutils=0.18.1), however on other systems lower versions were fine.
+
+
+
+Editing the documentation
+-------------------------
+
+Within this `src` folder update the associated `.rst` files which are in restructured text format. These files represent the corresponding document pages.
+
+
+Some notes on syntax
+~~~~~~~~~~~~~~~~~~~~
+
+- Use ``for inline code`` or ``computer/technical terminology``
+
+- Use tab indented code for code blocks with, e.g. .. code-block:: bash
+
+- For device names use :title:`deviceName` , e.g. :title:`pdfwrite`
+
+- For headers underline text with ==== for h1 level, ---- for h2, ~~~~ for h3 & """" for h4
+
+
+For full details on RST syntax, see: https://www.sphinx-doc.org/en/master/usage/restructuredtext/
+
+
+
+Building HTML documentation
+---------------------------
+
+From the `doc` location run:
+
+
+sphinx-build -b html src build
+
+
+This then creates the HTML documentation within `doc/build` for your review, you can then run `build/index.html` to check out the results.
+
+
+Building PDF documentation
+--------------------------
+
+From the `doc` location run:
+
+
+sphinx-build -b pdf src .
+
+
+This will then generate a single PDF for all of the documentation within `doc`.
+
+
+
+Updating the documentation
+--------------------------
+
+- Make your edits as required in the relevant RST files ( see above: Editing the documentation )
+
+- Test locally by building and running in local browser ( see above "Building HTML documentation" )
+
+- Ensure to update the version of Ghostscript cited in `conf.py` line 52 ( e.g. release = "10.0.0" )
+
+- Ensure that News.htm reflects the latest release and had any further "news"
+
+- Once changes are pushed to golden master then readthedocs.io should pick up the changes, build & deploy the docs!
+
+- Visit ghostscript.readthedocs.io once built and deployed to check
+
+
+
+---
+
+
+For more see: Using Sphinx (https://www.sphinx-doc.org/en/master/usage/index.html)
diff --git a/doc/Install.htm b/doc/Install.htm
deleted file mode 100644
index 8a63c019..00000000
--- a/doc/Install.htm
+++ /dev/null
@@ -1,419 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>How to Install Ghostscript</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>How to Install Ghostscript</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
-
- <li><a href="#Overview">Overview of how to install Ghostscript</a></li>
- <li><a href="#Install_Unix">Installing Ghostscript on Unix</a></li>
- <li>
- <ul>
- <li><a href="#Shared_object">Ghostscript as a shared object</a></li>
- <li><a href="#Install_Linux">Additional notes on Linux</a></li>
- </ul>
- </li>
- <li><a href="#Install_Windows">Installing Ghostscript on MS Windows</a></li>
- <li><a href="#Install_VMS">Installing Ghostscript on OpenVMS</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a> and "<a href="Make.htm">How to build Ghostscript from source
- code</a>".</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Overview"></a>Overview of how to install Ghostscript</h2>
-
-<p>
- You must have three things to run Ghostscript:</p>
-<ol>
-<li>The Ghostscript executable file; on some operating
-systems, more than one file is required. These are entirely
-platform-specific. See below for details.</li>
-
-<li>Initialization files that Ghostscript reads in when it
-starts up; these are the same on all platforms.</li>
-
-<li>
-<ul>
-<li><code>gs_</code>*<code>.ps</code> unless Ghostscript was compiled
-using the "compiled initialization files" option. See the documentation of
-<a href="Psfiles.htm">PostScript files distributed with Ghostscript</a>.</li>
-
-<li><code>pdf_</code>*<code>.ps</code> if Ghostscript was compiled
-with the ability to interpret Adobe Portable Document Format (PDF) files,
-that is, <code>pdf.dev</code> was included in
-<code>FEATURE_DEVS</code> when Ghostscript was built.</li>
-
-<li><code>Fontmap</code> and <code>Fontmap.GS</code> (or the
-appropriate <code>Fontmap.</code><em>xxx</em> for your platform), unless
-you plan always to invoke Ghostscript with the <a
-href="Use.htm#FONTMAP_switch"><code>-dNOFONTMAP</code> switch</a>.</li>
-</ul>
-</li>
-
-<li>Fonts, for rendering text. These are platform-independent,
-but if you already have fonts of the right kind on your platform,
-you may be able to use those. See below for details. Also see the
-<a href="Fonts.htm">documentation on fonts</a>.</li>
-</ol>
-
-<p>
-The <a href="Use.htm">usage documentation</a> describes the search
-algorithms used to find initialization files and font files. The
-per-platform descriptions that follow tell you where to install these
-files.</p>
-
-<hr>
-
-<h2><a name="Install_Unix"></a>Installing Ghostscript on Unix</h2>
-
-<p>
-Ghostscript uses the common configure, build and install method common
-to many modern software packages. In general the following with suffice
- to build ghostscript:</p>
-<blockquote><code>
- ./configure<br>
- make
-</code></blockquote>
-and then it may be installed in the default location with:
-<blockquote><b>
- <code>make install</code>
-</b></blockquote>
-<p>This last command may need to be performed with super user privileges.</p>
-
-<p>
-You can set the installation directory by adding <code>--prefix=<em>path</em></code>
-to the configure invocation in the first step. The default prefix is <code>/usr/local</code>,
-which is to say the <tt>gs</tt> executable is installed as <code>/usr/local/bin/gs</code>.</p>
-
-<p>A list of similar configuration options is available via <code>./configure --help</code></p>
-
-<p>
-For more detailed information on building Ghostscript see
-<a href="Make.htm#Unix_build">how to build Ghostscript on Unix</a> in
-the documentation on building Ghostscript, especially regarding information
-on using the older <a href="Make.htm#UNIX_makefile">hand edited makefile</a>
-approach. Whatever configuration method you use, execute "<code>make
-install</code>" to install the executable and all the required and
- ancillary files after the build is complete.</p>
-
-<h3><a name="Use_Acrobat_fonts_Unix"></a>Fonts</h3>
-
-<p>
-The makefile installs all the files except fonts under the directory
-defined in the makefile as <code>prefix</code>. Fonts need to be
-installed separately. The fonts should be installed in
-<code><em>{prefix}</em>/share/ghostscript/fonts</code>.
-(That is, <code>/usr/local/share/ghostscript/fonts/</code> if you used the default
-configuration above.)</p>
-
-<p>
-If you have Adobe Acrobat installed, you can use the Acrobat fonts
-in place of the ones distributed with with Ghostscript by adding the
-Acrobat fonts directory to
-<code>GS_FONTPATH</code> and removing these fonts from
- <code>Fontmap.GS</code>:</p>
-
-<blockquote>
-Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica,
-Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Symbol, Times-Bold,
-Times-BoldItalic, Times-Italic, Times-Roman, ZapfDingbats
-</blockquote>
-
-<p>
-Similarly, you can have ghostscript use other fonts on your system by adding
-entries to the fontmap or adding the directories to the GS_FONTMAP environment
-variable. See the <a href="Use.htm#Font_lookup">usage documentation</a> for more
-information.</p>
-<p>For example, many linux distributions place fonts under <code>/usr/share/fonts</code>.</p>
-
-<h3><a name="Shared_object"></a>Ghostscript as a shared object</h3>
-<p>If you've built Ghostscript as a shared object, instead of '<code>make install</code>',
-you must use '<code>make soinstall</code>'.
-See <a href="Make.htm#Shared_object">how to build Ghostscript
-as a shared object</a> for more details.</p>
-
-<h3><a name="Install_Linux"></a>Additional notes on Linux</h3>
-
-<p>
-For Linux, you may be able to install or upgrade Ghostscript from
- precompiled <a href="http://www.rpm.org">RPM</a> files using:</p>
-
-<blockquote><code>
-rpm -U ghostscript-N.NN-1.i386.rpm<br>
-rpm -U ghostscript-fonts-N.NN-1.noarch.rpm
-</code></blockquote>
-
-<p>
-However, please note that we do not create RPMs for Ghostscript, and we take
-no responsibility for RPMs created by others.</p>
-
-<hr>
-
-<h2><a name="Install_Windows"></a>Installing Ghostscript on MS Windows</h2>
-
-<p>
-We usually distribute Ghostscript releases for Windows as a binary installer,
- for the convenience of most users.</p>
-
-<h3><a name="Windows16"></a>Windows 3.1 (16-bit)</h3>
-<p>
- The last version to run on 16-bit Windows 3.1 was Ghostscript 4.03.</p>
-
-<h3><a name="Windows32"></a>Windows 95, 98, Me</h3>
-<p>
-The last version to be available as a binary for Windows 95/98/Me was 8.60. Although
-building from source with Visual Studio 2003 should produce a working binary for those
-versions.</p>
-
-<h3><a name="Windows32"></a>Windows NT4, 2000, XP, 2003 or Vista (32-bit)</h3>
-<p>
-The installer is normally named
-<code>gs###w32.exe</code>,
-where ### is the release number (e.g., 871 for Ghostscript 8.71,
- 910 for Ghostscript 9.10).</p>
-
-<h3><a name="Windows64"></a>Windows XP x64 edition, 2003 or Vista (64-bit)</h3>
-<p>
-The x64 installer is normally named
-<code>gs###w64.exe</code>
-This is for 64-bit Windows operating systems based on the x64 instruction set.
-Do not use this on 64-bit processors running 32-bit Windows.</p>
-
-<h3><a name="Windows4"></a>Installing</h3>
-<p>
- To install Ghostscript on Windows, you should run the installer executable.</p>
-
-<p>The installer is NSIS-based (see also <a href="Release.htm">Release.htm</a>) and
-supports a few standard NSIS options: <code>/NCRC</code> disables the CRC check,
-<code>/S</code> runs the installer or uninstaller silently, <code>/D</code>
-sets the default installation directory (It must be the last parameter
-used in the command line and must not contain any quotes, even if the path
-contains spaces. Only absolute paths are supported).</p>
-
-<h3><a name="General_Windows"></a>General Windows configuration</h3>
-
-<p>
-The installer includes files in these subdirectories:</p>
-
-<blockquote><code>
-gs<em>#.##</em>\bin
-<br>gs<em>#.##</em>\examples
-<br>gs<em>#.##</em>\lib
-<br>gs<em>#.##</em>\doc
-<br>gs<em>#.##</em>\Resource
-<br>fonts
-</code></blockquote>
-
-<p>
-The actual executable files for the 32-bit Windows install, in the <code>gs<em>#.##</em>\bin</code>
-subdirectory, are:</p>
-
-<blockquote><table>
-<tr><td><code>GSWIN32C.EXE</code></td>
-
- <td>Ghostscript as a 32-bit Windows command line program.
- This is usually the preferred executable.</td></tr>
-<tr><td><code>GSWIN32.EXE</code></td>
-
- <td>32-bit Ghostscript using its own window for commands</td></tr>
-<tr><td><code>GSDLL32.DLL</code></td>
-
- <td>32-bit dynamic link library containing most of Ghostscript's functionality</td></tr>
-</table></blockquote>
-
-<p>
-For the 64-bit Windows install, also in the <code>gs<em>#.##</em>\bin</code>
- subdirectory, they are:</p>
-
-<blockquote><table>
-<tr><td><code>GSWIN64C.EXE</code></td>
-
- <td>Ghostscript as a 64-bit Windows command line program.
- This is usually the preferred executable.</td></tr>
-<tr><td><code>GSWIN64.EXE</code></td>
-
- <td>64-bit Ghostscript using its own window for commands</td></tr>
-<tr><td><code>GSDLL64.DLL</code></td>
-
- <td>64-bit dynamic link library containing most of Ghostscript's functionality</td></tr>
-</table></blockquote>
-
-<p>
-For printer devices, the default output is the default printer. This can be modified as follows:</p>
-
-<blockquote>
-<dl>
-<dt><code>-sOutputFile="%printer%printer name"</code>
-<dd>Output to the named printer. If your printer is named "HP DeskJet 500"
- then you would use <code>-sOutputFile="%printer%HP DeskJet 500"</code>.</dd></dt>
-
-</dl>
-</blockquote>
-
-<p>
-If Ghostscript fails to find an environment variable, it looks for a
-registry value of the same name under the key</p>
-
-<blockquote><code>
-HKEY_CURRENT_USER\Software\GPL Ghostscript\#.##
-</code></blockquote>
-
-<p>
- or if that fails, under the key</p>
-
-<blockquote><code>
-HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\#.##
-</code></blockquote>
-
-<p>
-where #.## is the Ghostscript version number.</p>
-
-<p>
-Ghostscript will attempt to load the Ghostscript dynamic link library <code>GSDLL32.DLL</code> in the following order:</p>
-<ul>
-<li> In the same directory as the Ghostscript executable.</li>
-<li> If the environment variable <code>GS_DLL</code> is defined,
-Ghostscript tries to load the Ghostscript dynamic link library (DLL)
-with the name given.</li>
-<li> Using the standard Windows library search method: the directory
-from which the application loaded, the current directory, the Windows
-system directory, the Windows directory and the directories listed in
-the PATH environment variable.</li>
-</ul>
-
-<p>
-The Ghostscript installer will create registry values
-for the environment variables <code>GS_LIB</code>
- and <code>GS_DLL</code>.</p>
-
-<h3><a name="Uninstall_Windows"></a>Uninstalling Ghostscript on Windows</h3>
-
-<p>
-To uninstall Ghostscript, use the Control Panel, Add/Remove Programs and
-remove "Ghostscript #.##" and "Ghostscript Fonts". (The entries may be
-called "GPL Ghostscript" or "AFPL Ghostscript", rather than just
-"Ghostscript", depending on what version of Ghostscript was installed).
-Alternatively, an uninstall shortcut is also available in the Start Menu
-group.</p>
-<hr>
-
-<h2><a name="Install_VMS"></a>Installing Ghostscript on OpenVMS</h2>
-
-<p>
-Support for OpenVMS has stagnated (and almost certainly bit-rotted), and
-as the core development team has no access to an OpenVMS environment, we
-are unable to bring it up to date. We will consider patches from contributors
-if any wish to take on the task of getting it working again. Given the
-very limited appeal of OpenVMS these days, however, we are unlikely to consider
-patches with invasive code changes.</p>
-
-<p>
-You need the file <code>GS.EXE</code> to run Ghostscript on OpenVMS, and
-installing Ghostscript on an OpenVMS system requires building it first:
-please read <a href="Make.htm#VMS_build">how to build Ghostscript on VMS</a>
-in the documentation on building Ghostscript.</p>
-
-<p>
-The following installation steps assume that the Ghostscript directory is
-<code>DISK1:[DIR.GHOSTSCRIPT]</code>. Yours will almost certainly be in
-a different location so adjust the following commands accordingly.</p>
-
-<ul>
-
-<li>Download the fonts and unpack them into
-<code>DISK1:[DIR.GHOSTSCRIPT.LIB]</code>.</li>
-
-<li>Enable access to the program and support files for all users with:
-
-<blockquote><pre>
-&#36; set file/prot=w:re DISK1:[DIR]GHOSTSCRIPT.dir
-&#36; set file/prot=w:re DISK1:[DIR.GHOSTSCRIPT...]*.*
-</pre></blockquote>
-</li>
-<li>Optionally, add the Ghostscript help instructions to your system wide
-help file:
-
-<blockquote><pre>
-&#36; lib/help sys&#36;help:HELPLIB.HLB DISK1:[DIR.GHOSTSCRIPT.DOC]GS-VMS.HLP
-</pre></blockquote>
-</li>
-
-<li>Lastly, add the following lines to the appropriate system wide or user
-specific login script.
-
-<blockquote><pre>
-&#36; define gs_exe DISK1:[DIR.GHOSTSCRIPT.BIN]
-&#36; define gs_lib DISK1:[DIR.GHOSTSCRIPT.EXE]
-&#36; gs :== &#36;gs_exe:gs.exe
-</pre></blockquote>
-</li>
-
-</ul>
-
-<p>
-If you have DECWindows/Motif installed, you may wish to replace the
-<code>FONTMAP.GS</code> file with <code>FONTMAP.VMS</code>. Read the
-comment at the beginning of the latter file for more information.</p>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Internal.htm b/doc/Internal.htm
deleted file mode 100644
index 29aea7bf..00000000
--- a/doc/Internal.htm
+++ /dev/null
@@ -1,95 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Ghostscript Internal Operators</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Ghostscript Internal Operators</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Internal Operators">Internal Operators</a></li>
-</ul>
-
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Internal Operators"></a>Internal Operators</h2>
-
-<p>
- The following operators are defined for internal use by developers.
- In general these will be undefined after initialization is complete.
-</p>
-
-<dl>
-<dt><code>&lt;name&gt; &lt;array&gt; .makeoperator &lt;operator&gt;</code></dt>
-<dd>Constructs and returns a new operator that is actually the given
-procedure in disguise. The name is only used for printing. The operator
-has the executable attribute.
-
-<p>
-Operators defined in this way do one other thing besides running the
-procedure: if an error occurs during the execution of the procedure, and
-there has been no net reduction in operand or dictionary stack depth, the
-operand or dictionary stack pointer respectively is reset to its position
-at the beginning of the procedure.</p>
-
-</dd>
-
-</dl>
-
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Language.htm b/doc/Language.htm
deleted file mode 100644
index 5f7f1077..00000000
--- a/doc/Language.htm
+++ /dev/null
@@ -1,2293 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Ghostscript and the PostScript Language</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Ghostscript and the PostScript Language</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
-
- <li><a href="#Capabilities">Ghostscript's capabilities in relation to PostScript</a></li>
- <li><a href="#Implementation_limits">Implementation limits</a></li>
- <li>
- <ul>
- <li><a href="#Architectural_limits">Architectural limits</a></li>
- <li><a href="#Typical_memory_limits">Typical memory limits in LanguageLevel 1</a></li>
- <li><a href="#VM_consumption">Other differences in VM consumption</a></li>
- </ul>
- </li>
- <li><a href="#Additional_operators">Additional operators in Ghostscript</a></li>
- <li>
- <ul>
- <li><a href="#Graphics_and_text">Graphics and text operators</a></li>
- <li>
- <ul>
- <li><a href="#Transparency">Transparency</a></li>
- <li>
- <ul>
- <li><a href="#Transparency_graphics_state_operators">Graphics state operators</a></li>
- <li><a href="#Transparency_rendering_stack_operators">Rendering stack operators</a></li>
- <li><a href="#Transparency_ImageType">New ImageType</a></li>
- </ul>
- </li>
- <li><a href="#Graphics_state">Other graphics state operators</a></li>
- <li><a href="#Character">Character operators</a></li>
- </ul>
- </li>
-
- <li><a href="#Other">Other operators</a></li>
- <li>
- <ul>
- <li><a href="#Mathematical">Mathematical operators</a></li>
- <li><a href="#Dictionary">Dictionary operators</a></li>
- <li><a href="#Relational">Relational operators</a></li>
- <li><a href="#File">File operators</a></li>
- <li><a href="#Miscellaneous">Miscellaneous operators</a></li>
- <li><a href="#Device">Device operators</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li><a href="#Filters">Filters</a></li>
- <li>
- <ul>
- <li><a href="#Standard_filters">Standard filters</a></li>
- <li><a href="#Non_standard_filters">Non-standard filters</a></li>
- <li><a href="#Unstable_filters">Unstable filters</a></li>
- </ul>
- </li>
- <li><a href="#Device_parameters">Device parameters</a></li>
- <li><a href="#Banding_parameters">Banding parameters</a></li>
- <li><a href="#User_parameters">User parameters</a></li>
- <li><a href="#Miscellaneous_additions">Miscellaneous additions</a></li>
- <li>
- <ul>
- <li><a href="#Extended_semantics_of_run">Extended semantics of 'run'</a></li>
- <li><a href="#DecodingResources">Decoding resources</a></li>
- <li><a href="#CIDDecodingResources">CIDDecoding resources</a></li>
- <li><a href="#GlyphNames2Unicode">GlyphNames2Unicode</a></li>
- <li><a href="#MultipleResourceDirectories">Multiple Resource directories</a></li>
- </ul>
- </li>
- <li><a href="#PDF_scripting">Scripting the PDF interpreter</a></li>
- <li>
- <ul>
- <li><a href="#PS_functions">PostScript functions</a></li>
- <li><a href="#PDF_PS_operators">PostScript operators</a></li>
- </ul>
- </li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Capabilities"></a>Ghostscript's capabilities in relation to PostScript</h2>
-
-<p>
-The Ghostscript interpreter, except as noted below, is intended to execute
-properly any source program written in the (LanguageLevel 3)
-<b>PostScript</b> language as defined in the <cite>PostScript
-Language Reference, Third Edition</cite> (ISBN 0-201-37922-8) published by
-Addison-Wesley in mid-1999. However, the interpreter is configurable in
-ways that can restrict it to various subsets of this language.
-Specifically, the base interpreter accepts the Level 1 subset of the
-PostScript language, as defined in the first edition of the <cite>PostScript
-Language Reference Manual</cite> (ISBN 0-201-10174-2) Addison-Wesley 1985,
-plus the file system, version 25.0 language, and miscellaneous additions
-listed in sections A.1.6, A.1.7, and A.1.8 of the Second Edition
-respectively, including allowing a string operand for the
-"<code>status</code>" operator. The base interpreter may be configured
-(see the <a href="Make.htm">documentation on building Ghostscript</a> for
-how to configure it) by adding any combination of the following:</p>
-
-<ul>
-<li>The ability to process PostScript Type 1 fonts. This facility is
-normally included in the interpreter.</li>
-
-<li>The CMYK color extensions listed in section A.1.4 of the Second Edition
-(including <code>colorimage</code>). These facilities are available
-only if the <code>color</code>, <code>dps</code>, or
-<code>level2</code> feature was selected when Ghostscript was built.</li>
-
-<li>The Display PostScript extensions listed in section A.1.3 of the Second
-Edition, but excluding the operators listed in section A.1.2. These
-facilities are available only if the <code>dps</code> feature or the
-<code>level2</code> feature was selected when Ghostscript was built.</li>
-
-<li>The composite font extensions listed in section A.1.5 of the Second
-Edition, and the ability to handle Type 0 fonts. These facilities are
-available only if the <code>compfont</code> feature or the
-<code>level2</code> feature was selected when Ghostscript was built.</li>
-
-<li>The ability to load TrueType fonts and to handle PostScript Type 42
-(encapsulated TrueType) fonts. These facilities are available only if the
-<code>ttfont</code> feature was selected when Ghostscript was built.</li>
-
-<li>The PostScript Level 2 "filter" facilities except the
-<code>DCTEncode</code> and <code>DCTDecode</code> filters. These
-facilities are available only if the <code>filter</code>,
-<code>dps</code>, or <code>level2</code> feature was selected when
-Ghostscript was built.</li>
-
-<li>The PostScript Level 2 <code>DCTEncode</code> and
-<code>DCTDecode</code> filters. These facilities are available only if
-the <code>dct</code> or <code>level2</code> feature was selected when
-Ghostscript was built.</li>
-
-<li>All the other PostScript Level 2 operators and facilities listed in
-section A.1.1 of the Second Edition and not listed in any of the other
-A.1.n sections. These facilities are available only if the
-<code>level2</code> feature was selected when Ghostscript was built.</li>
-
-<li>All PostScript LanguageLevel 3 operators and facilities listed in the
-Third Edition, except as noted below. These facilities are available only
-if the <code>psl3</code> feature was selected when Ghostscript was built.</li>
-
-<li>The ability to recognize DOS EPSF files and process only the PostScript
-part, ignoring bitmap previews or other information. This facility is
-available only if the <code>epsf</code> feature was selected when
-Ghostscript was built.</li>
-</ul>
-
-<p>
-Ghostscript currently does not implement the following PostScript
-LanguageLevel 3 facilities:</p>
-
-<ul>
-<li>Settable <code>ProcessColorModel</code> for page devices, except for
-a very few special devices.</li>
-
-<li><code>IODevice</code>s other than <code>%stdin</code>,
-<code>%stdout</code>, <code>%stderr</code>, <code>%lineedit</code>,
-<code>%statementedit</code>, <code>%os%</code>, and (if configured)
-<code>%pipe%</code> and <code>%disk0%</code> through <code>%disk0%</code>.</li>
-</ul>
-
-<p>
-Ghostscript can also interpret files in the Portable Document Format (PDF)
-1.7 format defined in the
-<a href="http://www.adobe.com/devnet/pdf/pdf_reference.html"><em>PDF
-Reference</em> Version 1.7</a>,
-distributed by <a href="http://www.adobe.com/">Adobe Systems
-Incorporated</a>, except as noted below. This facility can be
-disabled by deselecting the <code>pdf</code> feature
-when Ghostscript is built.</p>
-
-<p>
-Ghostscript currently implements the majority of non-interactive
-features defined in the PDF reference.</p>
-
-<p>
-Ghostscript also includes a number of
-<a href="#Additional_operators">additional operators</a> defined below that
-are not in the PostScript language defined by Adobe.</p>
-
-<hr>
-
-<h2><a name="Implementation_limits"></a>Implementation limits</h2>
-
-<p>
-The implementation limits show here correspond to those in Tables B.1 and
-B.2 of the Second and Third Editions, which describe the quantities fully.
-Where Ghostscript's limits are different from those of Adobe's
-implementations (as shown in the Third Edition), Adobe's limits are also
-shown.</p>
-
-<h3><a name="Architectural_limits"></a>Architectural limits</h3>
-
-<blockquote><table>
-<tr><th colspan="4">Architectural limits (corresponds to Adobe table B.1)</th></tr>
-<tr valign="bottom">
- <th align="left">Quantity</th>
-
- <th align="left">Limit</th>
-
- <th align="left">Type</th>
-
- <th align="left">Adobe</th></tr>
-<tr valign="top"> <td>integer</td>
-
- <td>32-bit</td>
-
- <td>twos complement integer</td>
-
- <td>&nbsp;</td></tr>
-<tr valign="top"> <td>real</td>
-
- <td>single-precision</td>
-
- <td>IEEE float</td>
-
- <td>&nbsp;</td></tr>
-<tr valign="top"> <td>array</td>
-
- <td>16777216</td>
-
- <td>elements</td>
-
- <td>65535</td></tr>
-<tr valign="top"> <td>dictionary</td>
-
- <td>16777215</td>
-
- <td>elements</td>
-
- <td>65535</td></tr>
-<tr valign="top"> <td>string</td>
-
- <td>16777216</td>
-
- <td>characters</td>
-
- <td>65535</td></tr>
-<tr valign="top"> <td>name</td>
-
- <td>16383</td>
-
- <td>characters</td>
-
- <td>127</td></tr>
-<tr valign="top"> <td>filename</td>
-
- <td>128*</td>
-
- <td>characters</td>
-
- <td>&nbsp;</td></tr>
-<tr valign="top"> <td><code>save</code> level</td>
-
- <td>none</td>
-
- <td>(capacity of memory)</td>
-
- <td>15</td></tr>
-<tr valign="top"> <td><code>gsave</code> level</td>
-
- <td>none</td>
-
- <td>(capacity of memory)</td>
-
- <td>13</td></tr>
-</table></blockquote>
-
-<p>
-* The limit on the length of a file name is 128 characters if the name
-starts with a %...% IODevice designation, or 124 characters if it does not.</p>
-
-<h3><a name="Typical_memory_limits"></a>Typical memory limits in LanguageLevel 1</h3>
-
-<blockquote><table>
-
-<tr><th colspan="4">Memory limits (corresponds to Adobe table B.2)</th></tr>
-<tr valign="bottom">
- <th align="left">Quantity</th>
-
- <th align="left">Limit</th>
-
- <th align="left">Type</th>
-
- <th align="left">Adobe</th></tr>
-<tr valign="top"> <td><code>userdict</code></td>
-
- <td>200</td>
-
- <td>&nbsp;</td>
-
- <td>&nbsp;</td></tr>
-<tr valign="top"> <td><code>FontDirectory</code></td>
-
- <td>100</td>
- <td>&nbsp;</td>
-
- <td>&nbsp;</td>
- </tr>
-<tr valign="top"> <td>operand stack</td>
-
- <td>800</td>
-
- <td>&nbsp;</td>
-
- <td>500</td></tr>
-<tr valign="top"> <td>dictionary stack</td>
-
- <td>20</td>
- <td>&nbsp;</td>
-
- <td>&nbsp;</td>
- </tr>
-<tr valign="top"> <td>execution stack</td>
-
- <td>250</td>
-
- <td>&nbsp;</td><td>&nbsp;</td></tr>
-<tr valign="top"> <td>interpreter level</td>
-
- <td>none</td>
-
- <td>(capacity of memory)</td>
-
- <td>10</td></tr>
-<tr valign="top"> <td>path</td>
-
- <td>none</td>
-
- <td>(capacity of memory)</td>
-
- <td>1500</td></tr>
-<tr valign="top"> <td>dash</td>
-
- <td>11</td>
- <td>&nbsp;</td>
-
-
- <td>&nbsp;</td></tr>
-<tr valign="top"> <td>VM</td>
-
- <td>none</td>
-
- <td>(capacity of memory)</td>
-
- <td>240000</td></tr>
-<tr valign="top"> <td>file</td>
-
- <td>none</td>
-
- <td>(determined by operating system)</td>
-
- <td>6</td></tr>
-<tr valign="top"> <td>image</td>
-
- <td>65535</td>
-
- <td>values (samples &times; components)<br>for 1-, 2-, 4-, or 8-bit samples</td>
-
- <td>3300</td></tr>
-<tr valign="top"> <td>&nbsp;</td>
-
- <td>32767</td>
-
- <td>values for 12-bit samples</td>
-
- <td>3300</td></tr>
-</table></blockquote>
-
-<h3><a name="VM_consumption"></a>Other differences in VM consumption</h3>
-
-<p>
-In 32-bit builds packed array elements occupy either 2 bytes or 12 bytes.
-The average element size is probably about 7 bytes. Names occupy 16 bytes plus the
-space for the string.</p>
-<p>
-In 64-bit builds packed array elements occupy either 2 bytes or 16 bytes.
-The average element size is probably about 9 bytes.
-Names occupy 24 bytes plus the space for the string.</p>
-<p>
-The garbage collector doesn't reclaim portions of arrays obtained with
-<tt>getinterval</tt>, rather it collects entire arrays.</p>
-<hr>
-
-<h2><a name="Additional_operators"></a>Additional operators in Ghostscript</h2>
-
-<h3><a name="Graphics_and_text"></a>Graphics and text operators</h3>
-
-<h4><u><a name="Transparency"></a>Transparency</u></h4>
-<p><b><u>NOTE:</u></b> The following paragraphs describe non-standard operators
-for accessing the PDF 1.4 and later transparent imaging model through Postscript.
-If used incorrectly, they can have unexpected side effects and result in undefined
-behavior. As a result, these operators are disabled when <a href="Use.htm#Safer"><b>SAFER</b></a>
-is in force (as it is by default from version 9.50 onwards). To utilise these operators
-you will either have to disable <code>SAFER</code> (<code>-dNOSAFER</code>) or use
-the command line parameter <code>-dALLOWPSTRANSPARENCY</code>. The latter will make
-the custom operators available, but leave the file access controls active.
-<p>
-Ghostscript provides a set of operators for implementing the transparency
-and compositing facilities of PDF 1.4. These are defined only if the
-<code>transpar</code> option was selected when Ghostscript was built. We
-do not attempt to explain the underlying graphics model here: for details,
-see <a
-href="http://partners.adobe.com/asn/developer/technotes.html#acrobat-pdf"
-class="offsite">Adobe
-Technical Note</a> #5407, "<a
-href="http://partners.adobe.com/asn/developer/acrosdk/DOCS/PDF_Transparency.pdf"
-class="offsite">Transparency
-in PDF</a>". Previously (in 9.52 and earlier), Ghostscript's model
-maintained separate alpha and mask values for opacity and shape. This
-model has been changed (as of 9.53) and instead Ghostscript maintains separate
-float values for stroke and fill alpha values with a boolean that indicates
-if these should be interpreted as shape or alpha values to be more in line with the
-PDF specification.
-</p>
-<p>
-What follows is a subset of all the custom operators related to transparency, but
-covers the most useful, most common requirements.
-</p>
-
-<h5><a name="Transparency_graphics_state_operators"></a>Graphics state
-operators</h5>
-
-<p>Pushing the compositor device must be done before any other marking
-operations are made on the current page, and must be done per page.
-Popping the compositor should be done after the last marking operation
-of the page, and before the call to <code>showpage</code>. Any marking
-operations made after the compositor is popped will bypass the transparent
-imaging model, and may produce unexpected output.
-
-<dl>
-<dt><code>&lt;depth&gt; .pushpdf14devicefilter -</code></dt>
-<dd>Installs the transparency compositor device into the graphics state. At
-present the <code>depth</code> parameter should always be zero (<b>Subject
-To Change.</b>)
-</dl>
-<dl>
-<dt><code>- .popdf14devicefilter -</code></dt>
-<dd>Removes (or, more accuracately, disables) the transparency compositor in
-graphics state.
-</dl>
-
-
-<dl>
-<dt><code>&lt;modename&gt; .setblendmode -</code></dt>
-<dd>Sets the blending mode in the graphics state. If the mode name is not
-recognized, causes a <code>rangecheck</code> error. The initial value of
-the blending mode is <code>/Compatible</code>.</dd>
-</dl>
-
-<dl>
-<dt><code>- .currentblendmode &lt;modename&gt;</code></dt>
-<dd>Returns the graphics state blend mode on the stack.
-</dl>
-
-<dl>
-<dt><code>[Deprecated as of 9.53] &lt;0..1&gt; .setopacityalpha -</code></dt>
-<dd>Sets the opacity alpha value in the graphics state.
-The initial opacity alpha value is 1. Note, it is strongly
-suggested that this method not be used as it currently may
-give inconsistent results when mixed with methods that
-set stroke and fill alpha values. </dd>
-</dl>
-
-<dl>
-<dt><code>[Deprecated as of 9.53] - .currentopacityalpha &lt;0..1&gt;</code></dt>
-<dd>Returns the graphics state opacity alpha on the stack. Note, it is strongly
-suggested that this method not be used as it currently may
-give inconsistent results when mixed with methods that
-set stroke and fill alpha values.</dd>
-</dl>
-
-<dl>
-<dt><code>[Deprecated as of 9.53] &lt;0..1&gt; .setshapealpha -</code></dt>
-<dd>Sets the shape alpha value in the graphics state.
-The initial shape alpha value is 1. Note, it is strongly
-suggested that this method not be used as it currently may
-give inconsistent results when mixed with methods that
-set stroke and fill alpha values.</dd>
-</dl>
-
-<dl>
-<dt><code>[Deprecated as of 9.53] - .currentshapealpha &lt;0..1&gt;</code></dt>
-<dd>Returns the graphics state shape alpha on the stack. Note, it is strongly
-suggested that this method not be used as it currently may
-give inconsistent results when mixed with methods that
-set stroke and fill alpha values.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;0..1&gt; .setstrokeconstantalpha -</code></dt>
-<dd>Sets the stroke alpha value in the graphics state.
-The initial stroke alpha value is 1.</dd>
-</dl>
-
-<dl>
-<dt><code> - .currentstrokeconstantalpha &lt;0..1&gt;</code></dt>
-<dd>Returns the graphics state stroke alpha value on the stack.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;0..1&gt; .setfillconstantalpha -</code></dt>
-<dd>Sets the fill alpha value in the graphics state.
-The initial fill alpha value is 1.</dd>
-</dl>
-
-<dl>
-<dt><code> - .currentfillconstantalpha &lt;0..1&gt;</code></dt>
-<dd>Returns the graphics state fill alpha value on the stack.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;bool&gt; .setalphaisshape -</code></dt>
-<dd>If true, the values set by setstrokeconstantalpha and setfillconstantalpha are interpreted as shape values.
-The initial value of the AIS flag is <code>false</code>.</dd>
-</dl>
-
-<dl>
-<dt><code> - .currentalphaisshape &lt;0..1&gt;</code></dt>
-<dd>Returns the graphics state alpha is shape (AIS) on the stack.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;bool&gt; .settextknockout -</code></dt>
-<dd>Sets the text knockout flag in the graphics state.
-The initial value of the text knockout flag is <code>true</code>.</dd>
-</dl>
-
-<dl>
-<dt><code>- .currenttextknockout &lt;bool&gt;</code></dt>
-<dd>Returns the graphics state text knockout on the stack..</dd>
-</dl>
-
-<h5><a name="Transparency_rendering_stack_operators"></a>Rendering stack
-operators</h5>
-
-<p>
-The interpreter state is extended to include a (per-context) rendering stack
-for handling transparency groups and masks (generically, "layers"). Groups
-accumulate a full value for each pixel (paint plus transparency); masks
-accumulate only a coverage value. Layers must be properly nested, i.e., the
-'end' or 'discard' operator must match the corresponding 'begin' operator.</p>
-
-<p>
-Beginning and ending groups must nest properly with respect to
-<code>save</code> and <code>restore</code>: <code>save</code> and
-<code>restore</code> do not save and restore the layer stack. Currently,
-layers are not required to nest with respect to <code>gsave</code> and
-<code>grestore</code>, except that the device that is current in the
-graphics state when ending a layer must be the same as the device that was
-current when beginning the layer. THIS AREA IS SUBJECT TO CHANGE.</p>
-
-<dl>
-<dt><code>&lt;paramdict&gt; &lt;llx&gt; &lt;lly&gt; &lt;urx&gt; &lt;ury&gt;
-.begintransparencygroup -</code></dt>
-<dd>Begins a new transparency group. The <code>ll/ur</code> coordinates
-are the bounding box of the group in the current user coordinate system.
-<code>paramdict</code> has the following keys:</dd>
-
-<dt><code>/Isolated</code></dt>
-<dd>(optional) Boolean; default value = <code>false</code>.</dd>
-<dt><code>/Knockout</code></dt>
-<dd>(optional) Boolean; default value = <code>false</code>.</dd>
-
-</dl>
-
-<dl>
-<dt><code>- .endtransparencygroup -</code></dt>
-<dd>Ends the current transparency group, compositing the group being ended
-onto the group that now becomes current.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;cs_set?&gt; &lt;paramdict&gt; &lt;llx&gt; &lt;lly&gt; &lt;urx&gt; &lt;ury&gt;
-.begintransparencymaskgroup -</code></dt>
-<dd>Begins a new transparency mask, which is represented as a group.
-The <code>ll/ur</code> coordinates
-are the bounding box of the mask in the current user coordinate system.
-<code>paramdict</code> has the following keys:</dd>
-
-<dt><code>/Subtype</code></dt>
-<dd>(required) Name, either <code>/Alpha</code> or
-<code>/Luminosity</code>.</dd>
-<dt><code>/Background</code></dt>
-<dd>(optional) Array of number.</dd>
-<dt><code>/TransferFunction</code></dt>
-<dd>(optional) Function object (produced by applying
-<code>.buildfunction</code> to a Function dictionary).
-<p>
-The <code>cs_set</code> parameter is a boolean indicating whether the color
-space for the mask group is the current color space in the graphics state, or
-whether mask group color space should be inherited from the previous group
-in the transparency group stack. In general, for the most consistent results,
-it is recommended that this be set to <code>true</code>, and the intended
-color space set in the graphics state prior to the <code>.begintransparencymaskgroup</code>
-call.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;mask#&gt; .endtransparencymask -</code></dt>
-<dd>Ends the current transparency mask group, compositing the mask group being ended
-and setting it as the current soft mask in the graphics state.
-<p>
-The <code>mask#</code> parameter indicates whether the mask should be treated as
-as opacity mask (<code>0</code>) or shape (<code>1</code>).
-</dd>
-</dl>
-
-<h5><a name="Transparency_ImageType"></a>New ImageType</h5>
-
-<p>
-The transparency extension defines a new ImageType 103, similar to ImageType
-3 with the following differences:</p>
-
-<ul>
-
-<li>The required <code>MaskDict</code> is replaced by two optional
-dictionaries, <code>OpacityMaskDict</code> and
-<code>ShapeMaskDict</code>. If present, these dictionaries must have a
-<code>BitsPerComponent</code> entry, whose value may be greater than 1.
-Note that in contrast to ImageType 3, where any non-zero chunky mask value
-is equivalent to 1, ImageType 103 simply takes the low-order bits of chunky
-mask values.</li>
-
-<li>A <code>Matte</code> entry may be present in one or both mask
-dictionaries, indicating premultiplication of the data values. If both
-<code>MaskDict</code>s have a <code>Matte</code> entry and the values
-of the two <code>Matte</code> entries are different, a
-<code>rangecheck</code> error occurs.</li>
-
-<li><code>InterleaveType</code> appears in the <code>MaskDict</code>s,
-not the <code>DataDict</code>, because each mask has its own
-<code>InterleaveType</code>. <code>InterleaveType</code> 2
-(interlaced scan lines) is not supported.</li>
-
-</ul>
-
-<h4><a name="Graphics_state"></a>Other graphics state operators</h4>
-
- <dl>
-<dt><code>&lt;int&gt; .setoverprintmode -</code></dt>
-<dd>Sets the overprint mode in the graphics state. Legal values are 0 or 1.
-Per the PDF 1.3 specification, if the overprint mode is 1, then when the
-current color space is <code>DeviceCMYK</code>, color components whose
-value is 0 do not write into the target, rather than writing a 0 value.
-THIS BEHAVIOR IS NOT IMPLEMENTED YET. The initial value of the overprint
-mode is 0.</dd>
-</dl>
-
-<dl>
-<dt><code>- .currentoverprintmode &lt;int&gt;</code></dt>
-<dd>Returns the current overprint mode.</dd>
-</dl>
-
-<h4><a name="Character"></a>Character operators</h4>
-
-<dl>
-<dt><code>&lt;font&gt; &lt;charcode&gt; %Type1BuildChar -</code></dt>
-<dd>This is not a new operator: rather, it is a name known specially to the
-interpreter. Whenever the interpreter needs to render a character (during
-a ...<code>show</code>, <code>stringwidth</code>, or
-<code>charpath</code>), it looks up the name <code>BuildChar</code>
-in the font dictionary to find a procedure to run. If it does not find
-this name, and if the <code>FontType</code> is 1, the interpreter
-instead uses the value (looked up on the dictionary stack in the usual way)
-of the name <code>%Type1BuildChar</code>.
-
-<p>
-The standard definition of <code>%Type1BuildChar</code> is in the
-initialization file <code>gs_type1.ps</code>. Users should not need to
-redefine <code>%Type1BuildChar</code>, except perhaps for tracing or
-debugging.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;font&gt; &lt;charname&gt; %Type1BuildGlyph -</code></dt>
-<dd>Provides the Type 1 implementation of <code>BuildGlyph</code>.</dd>
-</dl>
-
-<h3><a name="Other"></a>Other operators</h3>
-
-<h4><a name="Mathematical"></a>Mathematical operators</h4>
-
-<dl>
-<dt><code>&lt;number&gt; arccos &lt;number&gt;</code></dt>
-<dd>Computes the arc cosine of a number between -1 and 1.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;number&gt; arcsin &lt;number&gt;</code></dt>
-<dd>Computes the arc sine of a number between -1 and 1.</dd>
-</dl>
-
-<h4><a name="Dictionary"></a>Dictionary operators</h4>
-
-<dl>
-<dt><code>mark &lt;key1&gt; &lt;value1&gt; &lt;key2&gt; &lt;value2&gt; ... .dicttomark &lt;dict&gt;</code></dt>
-<dd>Creates and returns a dictionary with the given keys and values. This
-is the same as the PostScript Level 2 <code>&gt;&gt;</code> operator,
-but is available even in Level 1 configurations.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;dict&gt; &lt;key&gt; .knownget &lt;value&gt; true</code></dt>
-<dt><code>&lt;dict&gt; &lt;key&gt; .knownget false</code></dt>
-<dd>Combines <code>known</code> and <code>get</code> in the
-obvious way.</dd>
-</dl>
-
-
-<h4><a name="Relational"></a>Relational operators</h4>
-
-<dl>
-<dt><code>&lt;number|string&gt; &lt;number|string&gt; max &lt;number|string&gt;</code></dt>
-<dd>Returns the larger of two numbers or strings.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;number|string&gt; &lt;number|string&gt; min &lt;number|string&gt;</code></dt>
-<dd>Returns the smaller of two numbers or strings.</dd>
-</dl>
-
-<h4><a name="File"></a>File operators</h4>
-
-<dl>
-<dt><code>&lt;file&gt; .fileposition &lt;integer&gt; true</code></dt>
-<dd>Returns the position of <code>file</code>. Unlike the standard
-<code>fileposition</code> operator, which causes an error if the file is
-not positionable, <code>.fileposition</code> works on all files,
-including filters: for non-positionable files, it returns the total number
-of bytes read or written since the file was opened.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;string&gt; findlibfile &lt;foundstring&gt; &lt;file&gt; true</code></dt>
-<dt><code>&lt;string&gt; findlibfile &lt;string&gt; false</code></dt>
-<dd>Opens the file of the given name for reading, searching through
-directories <a href="Use.htm#Finding_files">as described in the usage
-documentation</a>. If the search fails, <code>findlibfile</code> simply
-pushes false on the stack and returns, rather than causing an error.</dd>
-</dl>
-
-<a name="Tempfile"></a>
-<dl>
-<dt><code>&lt;prefix_string|null&gt; &lt;access_string&gt; .tempfile
-&lt;string&gt; &lt;file&gt;</code></dt>
-<dd>Creates and opens a temporary file
-like the <code>file</code> operator, also returning the file name. There
-are three cases for the <code>&lt;prefix_string|null&gt;</code> operand:
-
-<ul>
-<li><code>null</code>: create the file in the same directory and with the
-same name conventions as other temporary files created by the Ghostscript
-implementation on this platform. E.g., the temporary file might be named
-<code>/tmp/gs_a1234</code>.</li>
-<li>A string that contains only alphanumeric characters, underline,
-and dash: create the file in the standard temporary directory, but use
-the
-<code>&lt;prefix_string&gt;</code> as the first part of the file name.
-E.g., if <code>&lt;prefix_string&gt;</code> is <code>xx</code>, the
-temporary file might be named <code>/tmp/xxa1234</code>.</li>
-<li>A string that is the beginning of an absolute file name: use the
-<code>&lt;prefix_string&gt;</code> as the first part of the file name.
-E.g., if <code>&lt;prefix_string&gt;</code> is
-<code>/my/tmpdir/zz</code>, the temporary file might be named
-<code>/my/tmpdir/zza1234</code>.
-<p>
-
-When running in <code>SAFER</code> mode, the absolute path must
-be one of the strings on the permit file writing list
-(see <a href="Use.htm#Safer"><b>-dSAFER</b></a>) .</p></li>
-</ul>
-</dd>
-</dl>
-
-<p>
-Ghostscript also supports the following <code>IODevice</code> in
-addition to a subset of those defined in the Adobe documentation:</p>
-<ul>
- <li>
- <code>%pipe%command</code>, which opens a pipe on the given command.
- This is supported only on operating systems that provide
- <code>popen</code> (primarily Unix systems, and not all of those).</li>
- <li>
- <code>%disk#%</code>, which emulates the %disk0
- through %disk9 devices on some Adobe PostScript printers. This pseudo
- device provides a flat filenaming system with a user definable location
- for the files (/Root). These devices will only be present if the
- diskn.dev feature is specified during the build.
-
- <p>This feature is intended to allow compatibility with font downloaders
- that expect to store fonts on the %disk device of the printer.</p>
- <p>
- Use of the %disk#% devices requires that the location of files be given
- by the user setting the /Root device parameter. The syntax for setting
- the /Root parameter is:<pre>
- mark /Root (directory_specification) (%disk#) .putdevparams
- </pre>
- For example, to store the files of the %disk0 device on the directory
- /tmp/disk0, use:<pre>
- mark /Root (/tmp/disk0/) (%disk0) .putdevparams
- </pre></p>
- <p>The files will be stored in the specified directory with arbitrary names.
- A mapping file is used to store the association between the file
- names given for the file operations on the %diskn# device and the file
- that resides in the /Root directory.</p>
- </li>
-</ul>
-
-<h4><a name="Miscellaneous"></a>Miscellaneous operators</h4>
-
-<dl>
-<dt><code>&lt;array&gt; bind &lt;array&gt;</code></dt>
-<dd>Depending on the command line parameters <code>bind</code> is redefined as:</dd>
-</dl>
-
-<blockquote><table>
-<tr valign="bottom">
- <th valign="bottom" align="left">Flag</th>
-
- <th valign="bottom" align="left">Definition</th></tr>
-<tr valign="top"> <td>DELAYBIND</td>
-
- <td>returns the argument, stores the argument for later use by <code>.bindnow</code></td></tr>
-</table></blockquote>
-
-
-<dl>
-<dt><code>&lt;array&gt; .bind &lt;array&gt;</code></dt>
-<dd>Performs standard <code>bind</code> operation as defined in PLRM regardless of
-the DELAYBIND flag.</dd>
-</dl>
-
-<a name="bindnow"></a>
-<dl>
-<dt><code>- .bindnow -</code></dt>
-<dd>Applies <code>bind</code> operator to all saved procedures after binding has been
-deferred through -dDELAYBIND. Note that idiom recognition has no effect for the deferred
-binding because the value returned from <code>bind</code> is discarded.
-<p>
-Since v. 8.12 <code>.bindnow</code> undefines itself and restores standard definition of
-<code>bind</code> operator. In earlier versions after calling <code>.bindnow</code>,
-the postscript <code>bind</code> operator needs to be rebound to the internal implementation
-<code>.bind</code>, as in this fragment from the ps2ascii script:
-<blockquote><pre><tt>DELAYBIND {
- .bindnow
- /bind /.bind load def
-} if
-</tt></pre></blockquote>
-This is necessary for correct behavior with later code that uses the <code>bind</code> operator.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;string&gt; getenv &lt;string&gt; true</code></dt>
-<dt><code>&lt;string&gt; getenv false</code></dt>
-<dd>Looks up a name in the shell environment. If the name is found,
-returns the corresponding value and true; if the name is not found, returns
-false.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;string&gt; &lt;boolean&gt; .setdebug -</code></dt>
-<dd>Sets or clears any subset of the debugging flags included in
-<code>&lt;string&gt;</code> based on the value of
-<code>&lt;boolean&gt;</code>. These correspond to the debug
-flags set by <code>-Z</code> on the command line and enable
-debug and tracing output from various internal modules.
-
-<p>Note that most tracing output is only produced if the Ghostscript
-interpreter was built with the <code>DEBUG</code> preprocessor
-symbol defined.</p>
-
-<p>The <code>zsetdebug()</code> C function, which implements this
-operator, is a useful breakpoint for debuggers.
-Inserting '<code>() true .setdebug</code>' in the interpreted code will
-trigger a breakpoint at that location without side effects. The
-current flag state is available in C as the <code>gs_debug[]</code>
-array, indexed by character value. The <code>zsetdebug</code> function will
-be entered, and <code>gs_debug[]</code> updated, whether or not Ghostscript
-is built with the <code>DEBUG</code> preprocessor symbol defined, so this
-is useful even with release builds.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>- .setsafe -</code></dt>
-<dd>If Ghostscript is started with <code>-dNOSAFER</code> or
-<code>-dDELAYSAFER</code>, this operator can be used to enter <b>SAFER</b>
-mode (see <a href="Use.htm#Safer"><b>-dSAFER</b></a>)
-<p>
-<strong>The following is deprecated, see <a href="Use.htm#Safer"><b>-dSAFER</b></a></strong>
-<p>
-Since <b>SAFER</b> mode is implemented with userparameters and device parameters,
-it is possible to use <code>save</code> and <code>restore</code> before
-and after <code>.setsafe</code> to return to <b>NOSAFER</b> mode, but note
-that such a save object is accessible to any procedures or file run in <b>SAFER</b> mode.
-A malicious file with an unbalanced restore could potentially restore back to a point where
-SAFER was not in operation.</p>
-<p>
-<b>Note: This uses setpagedevice to change .LockSafetyParams, so the page
-will be erased as a side effect of this operator</b></p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>- .locksafe -</code></dt>
-<dd>
-<p>
-<strong>The following is deprecated, see <a href="Use.htm#Safer"><b>-dSAFER</b></a></strong>
-<p>
-This operator sets the current device's <code>.LockSafetyParams</code>
-and the <code>LockFilePermissions</code> userparameter true as well as
-adding the paths on LIBPATH and FONTPATH and the paths given by the
-system params /GenericResourceDir and /FontResourceDir to the current
-PermitFileReading list of paths.
-<p>
-If Ghostscript is started with <code>-dNOSAFER</code> or
-<code>-dDELAYSAFER</code>, this operator can be used to enter <b>SAFER</b>
-mode with the current set of <code>PermitFile...</code> user parameters
-in effect. Since <code>.setsafe</code> sets the <code>PermitFile...</code>
-user parameters to empty arrays, a script or job server that needs to
-enable certain paths for file Reading, Writing and/or Control can use this
-operator to perform the locking needed to enter <b>SAFER</b> mode.</p>
-<p>
-For example, to enable reading everywhere, but disallow writing and file
-control (deleting and renaming files), the following can be used:</p>
-<pre>
- { &lt;&lt; /PermitFileReading [ (*) ]
- /PermitFileWriting [ ]
- /PermitFileControl [ ]
- &gt;&gt; setuserparams
- .locksafe
- } stopped pop
-</pre>
-<p>In the above example, use of stopped will allow the use of this sequence on
-older versions of Ghostscript where <code>.locksafe</code> was not an operator.</p>
-<p>
-<b>Note: This uses setpagedevice to change .LockSafetyParams, so the page
-will be erased as a side effect of this operator</b></p>
-<p>
-See also <a href="#LockSafetyParams">.LockSafetyParams</a> and
-<a href="#User_parameters">User Parameters</a>.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><a name=".addcontrolpath"></a>
-<code>&lt;name&gt; &lt;string&gt; .addcontrolpath</code></dt>
-<dd>
-Adds a single path to the file access control lists.
-<p>The &lt;name&gt; parameter can be one of:
-<ul>
-<li>
-<p><code>/PermitFileReading</code>
-</li>
-<li>
-<p><code>/PermitFileWriting</code>
-</li>
-<li>
-<p><code>/PermitFileControl</code>
-</li>
-</ul>
-<p>Whilst the string parameter is the path to be added to the requested list.
-<p><strong>NOTE: Any attempt to call this operator after <a href="#activatepathcontrol">.activatepathcontrol</a>
-has been called will result in a <code>Fatal</code> error, and the interpreter
-will immediately exit.</strong>
-</dd>
-</dl>
-
-<dl>
-<dt><a name=".activatepathcontrol"></a>
-<code>.activatepathcontrol</code></dt>
-<dd>
-Activates file access controls. Once activated, these access controls remain
-in place until the interpreter shuts down.
-</dd>
-</dl>
-
-<dl>
-<dt><a name=".currentpathcontrolstate"></a>
-<code>.currentpathcontrolstate</code></dt>
-<dd>
-Returns <code>true</code> on the operand stack if file access control has been
-activated, <code>false</code> if not.
-</dd>
-</dl>
-
-<dl>
-<dt><a name=".genordered"></a>
-<code>&lt;dict&gt; .genordered &lt;dict&gt;</code> (default: /OutputType /Type3).</dt>
-<dt><code>&lt;dict&gt; .genordered &lt;string&gt;</code> (/OutputType /ThreshString).</dt>
-<dt><code>&lt;dict&gt; .genordered &lt;array&gt;</code> (/OutputType /TOSArray).</dt>
-<dd>This operator creates an ordered dither screening pattern with the parameters from the dictionary, returning (by default) a PostScript HalftoneType 3 (threshold array based) dictionary suitable for use with <code>sethalftone</code> or as a component Halftone of a <code>HalftoneType 5</code> Halftone dictionary. The /OutputType parameter can also select other than Halftone Type 3 as the return paramter,
-<code>&lt;dict&gt;</code> has the following keys (all are optional):</dd>
-<dt><code>/Frequency</code></dt>
-<dd>Integer; default value = 75</dd>
-<dt><code>/Angle</code></dt>
-<dd>Integer; default value = 0</dd>
-<dt><code>/HResolution</code></dt>
-<dd>Real or Integer; default value is device X resolution.</dd>
-<dt><code>/VResolution</code></dt>
-<dd>Real or Integer; default value is device Y resolution.</dd>
-<dt><code>/DotShape</code></dt>
-<dd>Integer; default value = 0 (CIRCLE). Other shapes available are:</dd>
-<dd> 1=REDBOOK, 2=INVERTED, 3=RHOMBOID, 4=LINE_X, 5=LINE_Y, 6=DIAMOND1, 7=DIAMOND2, 8=ROUNDSPOT,</dd>
-<dt><code>/SuperCellSize</code></dt>
-<dd>Integer; default value = 1 -- actual cell size determined by Frequency, Angle, H/V Resolution.</dd>
-<dd>A larger value will allow more levels to be attained.</dd>
-<dt><code>/Levels</code></dt>
-<dd>Integer; default value = 1 -- actual number of gray levels is determined by Frequency and H/V Resolution.</dd>
-<dd>SuperCellSize may need to be specified large enough to achieve the requested number of gray levels.</dd>
-<dt><code>/OutputType</code></dt>
-<dd>Name; default value = /Type3 (HalftoneType 3 dictionary). Other shapes available are:</dd>
-<dt><code>/ThreshString</code></dt>
-<dd>
-First two bytes are width (high byte first), next two bytes are height, followed by the
-threshold array bytes (same as /Thresholds of the Type3 dictionary).
-</dd>
-<dt><code>/TOSArray</code></dt>
-<dd>
-First element is the width, next is the height, followed by pairs X, then Y, of the turn-on-sequence of the threshold array. This information can be used to construct a threshold array with a transfer function "pickled into" the threshold array, which is useful if the turn-on-sequence has more than 256 pairs. Refer to toolbin/halftone/thresh_remap for more information.</dt>
-</dd>
-</dl>
-
-<dl>
-<dt><a name=".shellarguments"></a>
-<code>.shellarguments</code></dt>
-<dd>
-<p>This operator is used to access the ARGUMENTS command line option.
-<p>Relies on Ghostscript being called with the &quot;--&quot; command
-line option - see <a href="Use.htm#Input_control">Input Control</a>
-<p>See examples in lib for more information.
-</dd>
-</dl>
-
-
-<h4><a name="Device"></a>Device operators</h4>
-
-<dl>
-<dt><code>&lt;device&gt; copydevice &lt;device&gt;</code></dt>
-<dd>Copies a device. The copy is writable and installable. The copy is
-created in the current VM (local or global), usually local VM for executing
-ordinary PostScript files.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;devicename&gt; finddevice &lt;device&gt;</code></dt>
-<dd>Creates a default instance of a device specified by name. The instance
-is created in global VM. If <code>finddevice</code> is called more than
-once with the same device name, it creates the default instance the first
-time, and returns the same instance thereafter.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;devicename&gt; findprotodevice &lt;device&gt;</code></dt>
-<dd>Finds the prototype of a device specified by name. A prototype can be
-used with <code>getdeviceprops</code> or other parameter-reading
-operators, but it is read-only and cannot be set with
-<code>setdevice</code>: it must be copied first.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;matrix&gt; &lt;width&gt; &lt;height&gt; &lt;palette&gt; makeimagedevice &lt;device&gt;</code></dt>
-<dd>Makes a new device that accumulates an image in memory. <code>
-matrix</code> is the initial transformation matrix: it must be orthogonal
-(that is, [a&nbsp;0&nbsp;0&nbsp;b&nbsp;x&nbsp;y] or
-[0&nbsp;a&nbsp;b&nbsp;0&nbsp;x&nbsp;y]). <code>palette</code> is a
-string of 2^<small><sup><b>N</b></sup></small> or
-3&nbsp;&times;&nbsp;2^<small><sup><b>N</b></sup></small> elements,
-specifying how the 2^<small><sup><b>N</b></sup></small> possible pixel
-values will be interpreted. Each element is interpreted as a gray value,
-or as RGB values, multiplied by 255. For example, if you want a monochrome
-image for which 0=white and 1=black, the palette should be
-<code>&lt;ff&nbsp;00&gt;</code>; if you want a 3-bit deep image with
-just the primary colors and their complements (ignoring the fact that 3-bit
-images are not supported), the palette might be <code>&lt;000000 0000ff
-00ff00 00ffff ff0000 ff00ff ffff00 ffffff&gt;</code>. At present, the
-palette must contain exactly 2, 4, 16, or 256 entries, and must contain an
-entry for black and an entry for white; if it contains any entries that
-aren't black, white, or gray, it must contain at least the six primary
-colors (red, green, blue, and their complements cyan, magenta, and yellow);
-aside from this, its contents are arbitrary.
-
-<p>
-Alternatively, palette can be 16, 24, 32, or null (equivalent to 24).
-These are interpreted as:</p>
-
-<blockquote><table>
-<tr valign="bottom">
- <th valign="bottom" align="left">Palette</th>
-
- <th valign="bottom" align="left">Bits allocated per color</th></tr>
-<tr valign="top"> <td>16</td>
-
- <td>5 red, 6 green, 5 blue</td></tr>
-<tr valign="top"> <td>24</td>
-
- <td>8 red, 8 green, 8 blue</td></tr>
-<tr valign="top"> <td>32</td>
-
- <td>8C, 8M, 8Y, 8K</td></tr>
-</table></blockquote>
-
-<p>
-Note that one can also make an image device (with the same palette as an
-existing image device) by copying a device using the
-<code>copydevice</code> operator.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;device&gt; &lt;index&gt; &lt;string&gt; copyscanlines &lt;substring&gt;</code></dt>
-<dd>Copies one or more scan lines from an image device into a string,
-starting at a given scan line in the image. The data is in the same format
-as for the <code>image</code> operator. It is an error if the device is
-not an image device or if the string is too small to hold at least one
-complete scan line. Always copies an integral number of scan lines.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;device&gt; setdevice -</code></dt>
-<dd>
-<p>
-Sets the current device to the specified device. Also resets the
-transformation and clipping path to the initial values for the device.
-Signals an <code>invalidaccess</code> error if the device is a
-prototype or if <a href="Language.htm#LockSafetyParams">.LockSafetyParams</a>
-is true for the current device.</p>
-<p>
-Some device properties may need to be set with <tt>putdeviceprops</tt> before
-<code>setdevice</code> is called. For example, the pdfwrite device will try
-to open its output file, causing an <tt>undefinedfilename</tt> error if
-<code>OutputFile</code> hasn't been set to a valid filename. Another
-method in such cases is to use the level 2 operator instead:
-
- <code>&lt;&lt;&nbsp;/OutputDevice /pdfwrite /OutputFile
-(MyPDF.pdf)&nbsp;&gt;&gt; setpagedevice</code>.</p></dd>
-
-</dl>
-
-<dl>
-<dt><code>- currentdevice &lt;device&gt;</code></dt>
-<dd>Gets the current device from the graphics state.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;device&gt; getdeviceprops &lt;mark&gt; &lt;name1&gt; &lt;value1&gt; ... &lt;namen&gt; &lt;valuen&gt;</code></dt>
-<dd>Gets the properties of a device. See the section on
-<a href="#Device_parameters">device parameters</a> below for details.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;mark&gt; &lt;name1&gt; &lt;value1&gt; ... &lt;namen&gt; &lt;valuen&gt; &lt;device&gt; putdeviceprops &lt;device&gt;</code></dt>
-<dd>Sets properties of a device. May cause <code>undefined</code>,
-<code>invalidaccess</code>, <code>typecheck</code>, <code>rangecheck</code>, or
-<code>limitcheck</code> errors.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Filters"></a>Filters</h2>
-
-<h3><a name="Standard_filters"></a>Standard filters</h3>
-
-<p>
-In its usual configuration, Ghostscript supports all the standard PostScript
-LanguageLevel 3 filters, both encoding and decoding, except that it does not
-currently support:</p>
-
-<ul>
-
-<li>the <code>EarlyChange</code> key in the <code>LZWEncode</code>
-filter.</li>
-
-</ul>
-
-<p>
-Ghostscript also supports additional keys in the optional dictionary
-operands for some filters. For the <code>LZWDecode</code> filter:</p>
-
-<dl>
-<dt><code>InitialCodeLength &lt;integer&gt;</code> (default 8)</dt>
-<dd>An integer between 2 and 11 specifying the initial number of data bits
-per code. Note that the actual initial code length is 1 greater than this,
-to allow for the reset and end-of-data code values.</dd>
-</dl>
-
-<dl>
-<dt><code>FirstBitLowOrder &lt;boolean&gt;</code> (default false)</dt>
-<dd>If true, codes appear with their low-order bit first.</dd>
-</dl>
-
-<dl>
-<dt><code>BlockData &lt;boolean&gt;</code> (default false)</dt>
-<dd>If true, the data is broken into blocks in the manner specified for the
-GIF file format.</dd>
-</dl>
-
-<p>
-For the <code>CCITTFaxEncode</code> and <code>CCITTFaxDecode</code>
-filters:</p>
-
-<dl>
-<dt><code>DecodedByteAlign &lt;integer&gt;</code> (default 1)</dt>
-<dd>An integer <b>N</b> with the value 1, 2, 4, 8, or 16, specifying that
-decoded data scan lines are always a multiple of <b>N</b> bytes. The
-encoding filter skips data in each scan line from Columns to the next
-multiple of <b>N</b> bytes; the decoding filter pads each scan line to a
-multiple of <b>N</b> bytes.</dd>
-</dl>
-
-<h3><a name="Non_standard_filters"></a>Non-standard filters</h3>
-
-<p>
-In addition to the standard PostScript LanguageLevel 3 filters, Ghostscript
-supports the following non-standard filters. Many of these filters are used
-internally to implement standard filters or facilities; they are almost
-certain to remain, in their present form or a backward-compatible one, in
-future Ghostscript releases.</p>
-
-<dl>
-<dt><code>&lt;target&gt; /BCPEncode filter &lt;file&gt;</code></dt>
-<dt><code>&lt;source&gt; /BCPDecode filter &lt;file&gt;</code></dt>
-<dd>Create filters that implement the Adobe Binary Communications Protocol.
-See Adobe documentation for details.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;target&gt; &lt;seed_integer&gt; /eexecEncode filter &lt;file&gt;</code></dt>
-<dd>Creates a filter for encrypting data into the encrypted format described
-in the Adobe Type 1 Font Format documentation. The
-<code>seed_integer</code> must be 55665 for the <code>eexec</code>
-section of a font, or 4330 for a <code>CharString</code>. Note that for
-the <code>eexec</code> section of a font, this filter produces binary
-output and does not include the initial 4 (or <code>lenIV</code>) garbage
-bytes.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;source&gt; &lt;seed_integer&gt; /eexecDecode filter &lt;file&gt;</code></dt>
-<dt><code>&lt;source&gt; &lt;dict&gt; /eexecDecode filter &lt;file&gt;</code></dt>
-<dd>Creates a filter for decrypting data encrypted as described in the Adobe
-Type 1 Font Format documentation. The <code>seed_integer</code> must be
-55665 or 4330 as described just above. PDF interpreters don't skip space characters
-after operator <code>eexec</code>. Use <code>keep_spaces = true</code> for
-decoding embedded PDF fonts. Recognized dictionary keys are:
-
-<blockquote>
-<code>seed &lt;16-bit integer&gt;</code> (required)<br>
-<code>lenIV &lt;non-negative integer&gt;</code> (default=4)<br>
-<code>eexec &lt;bool&gt;</code> (default=<code>false</code>)<br>
-<code>keep_spaces &lt;bool&gt;</code> (default=<code>false</code>)
-</blockquote>
-</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;target&gt; /MD5Encode filter &lt;file&gt;</code></dt>
-<dd>Creates a filter that produces the 16-byte MD5 digest of the input.
-Note that no output is produced until the filter is closed.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;source&gt; &lt;hex_boolean&gt; /PFBDecode filter &lt;file&gt;</code></dt>
-<dd>Creates a filter that decodes data in <code>.PFB</code> format, the
-usual semi-binary representation for Type 1 font files on IBM PC and
-compatible systems. If <code>hex_boolean</code> is true, binary packets
-are converted to hex; if false, binary packets are not converted.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;target&gt; &lt;dict&gt; /PixelDifferenceEncode filter &lt;file&gt;</code></dt>
-<dt><code>&lt;source&gt; &lt;dict&gt; /PixelDifferenceDecode filter &lt;file&gt;</code></dt>
-<dd>Implements the Predictor=2 pixel-differencing option of the LZW
-filters. Recognized keys are:
-
-<blockquote>
-<code>Colors &lt;integer&gt;</code> (1 to 4, default=1)<br>
-<code>BitsPerComponent &lt;integer&gt;</code> (1, 2, 4, or 8, default=8)<br>
-<code>Columns &lt;integer&gt;</code> (&gt;= 0, required)
-</blockquote>
-
-<p>
-See the Adobe <a href="http://partners.adobe.com/public/developer/pdf/index_reference.html"><em>PDF Reference Manual</em></a> for details.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;target&gt; &lt;dict&gt; /PNGPredictorEncode filter &lt;file&gt;</code></dt>
-<dt><code>&lt;source&gt; &lt;dict&gt; /PNGPredictorDecode filter &lt;file&gt;</code></dt>
-<dd><p>Implements the "filter" algorithms of the
-<a href="http://www.libpng.org/pub/png/">Portable Network Graphics (PNG)
-graphics format</a>. Recognized keys are:</p>
-
-<blockquote><table>
-<tr><th colspan="3">Keys recognized in PNG filter algorithms</th></tr>
-<tr valign="bottom">
- <th align="left">Key</th>
-
- <th align="left">Range</th>
-
- <th align="left">Default</th></tr>
-<tr valign="top"> <td><code>Colors &lt;integer&gt;</code></td>
-
- <td>1 to 16</td>
-
- <td>16</td></tr>
-<tr valign="top"> <td><code>BitsPerComponent &lt;integer&gt;</code></td>
-
- <td>1, 2, 4, 8, or 16</td>
-
- <td>8</td></tr>
-<tr valign="top"> <td><code>Columns &lt;integer&gt;</code></td>
-
- <td>&gt;= 0</td>
-
- <td>1</td></tr>
-<tr valign="top"> <td><code>Predictor &lt;integer&gt;</code></td>
-
- <td>10 to 15</td>
-
- <td>15</td></tr>
-</table></blockquote>
-
-<p>
-The <code>Predictor</code> is the PNG algorithm number + 10 for the
-<code>Encoding</code> filter; the <code>Decoding</code> filter
-ignores <code>Predictor</code>. 15 means the encoder attempts to
-optimize the choice of algorithm. For more details see the PNG
-specification</p>
-
-<blockquote>
-<a href="http://www.w3.org/TR/WD-png-960128.html">http://www.w3.org/TR/WD-png-960128.html</a>
-</blockquote>
-</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;target&gt; /TBCPEncode filter &lt;file&gt;</code></dt>
-<dt><code>&lt;source&gt; /TBCPDecode filter &lt;file&gt;</code></dt>
-<dd>Create filters that implement the Adobe Tagged Binary Communications
-Protocol. See Adobe documentation for details.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;target&gt; /zlibEncode filter &lt;file&gt;</code></dt>
-<dt><code>&lt;source&gt; /zlibDecode filter &lt;file&gt;</code></dt>
-<dd>Creates filters that use the data compression method variously known as
-'zlib' (the name of a popular library that implements it), 'Deflate' (as in
-<a href="http://www.ietf.org/rfc/rfc1951.txt">RFC 1951</a>, which is a
-detailed specification for the method), 'gzip' (the name of a popular
-compression application that uses it), or 'Flate' (Adobe's name). Note that
-the PostScript <code>Flate</code> filters are actually a combination of
-this filter with an optional predictor filter.</dd>
-</dl>
-
-<h3><a name="Unstable_filters"></a>Unstable filters</h3>
-
-<p>
-Some versions of Ghostscript may also support other non-standard filters for
-experimental purposes. The current version includes the following such
-filters, which are not documented further. No code should assume that these
-filters will exist in compatible form, or at all, in future versions.</p>
-
-<dl>
-<dt><code>&lt;target/source&gt; &lt;string&gt; ByteTranslateEncode/Decode filter &lt;file&gt;</code></dt>
-<dd><code>string</code> must be a string of exactly 256 bytes. Creates a
-filter that converts each input byte <em>b</em> to
-<code>string</code>[<em>b</em>]. Note that the <code>Encode</code>
-and <code>Decode</code> filters operate identically: the client must
-provide a <code>string</code> for the <code>Decode</code> filter that
-is the inverse mapping of the <code>string</code> for the
-<code>Encode</code> filter.</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;target/source&gt; &lt;dict&gt; BoundedHuffmanEncode/Decode filter &lt;file&gt;</code></dt>
-<dd>These filters encode and decode data using Huffman codes. Since these
-filters aren't used anywhere, we don't document them further, except to note
-the recognized dictionary keys, which must be set identically for encoding
-and decoding:
-
-<blockquote>
-<code>FirstBitLowOrder &lt;bool&gt;</code> (default=false)<br>
-<code>MaxCodeLength &lt;int&gt;</code> (default=16)<br>
-<code>EndOfData &lt;bool&gt;</code> (default=true)<br>
-<code>EncodeZeroRuns &lt;int&gt;</code> (default=256)<br>
-<code>Tables &lt;int_array&gt;</code>
-</blockquote>
-</dd>
-</dl>
-
-<dl>
-<dt><code>&lt;target/source&gt; &lt;dict&gt; BWBlockSortEncode/Decode filter &lt;file&gt;</code></dt>
-<dd>This filter implements the Burroughs-Wheeler block sorting compression
-method, which we've heard is also used in the popular <code>bzip2</code>
-compression application. See <a
-href="http://sources.redhat.com/bzip2/">http://sources.redhat.com/bzip2/</a>
-for more information. The only recognized dictionary key is:
-
-<blockquote>
-<code>BlockSize &lt;integer&gt;</code> (default=16384)
-</blockquote>
-</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Device_parameters"></a>Device parameters</h2>
-
-Ghostscript supports the concept of device parameters for all devices, not
-just page devices. (For non-page devices, these are accessible through
-<code>getdeviceprops</code> and <code>putdeviceprops</code>, as
-indicated above.) Here are the currently defined parameters for all
-devices:
-
-<dl>
-<dt><a name="LockSafetyParams"></a>
-<code>.LockSafetyParams &lt;boolean&gt;</code></dt>
-<dd>This parameter allows for improved system security by preventing
-PostScript programs from being able to change potentially dangerous
-device paramters such as OutputFile. This parameter cannot be set false
-if it is already true.
-<p>
-If this parameter is true for the current device, attempt to set a new
-device that has <code>.LockSafetyParams</code> false will signal an
-<code> invalidaccess</code> error.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>BitsPerPixel &lt;integer&gt; (usually read-only)</code></dt>
-<dd>Number of bits per pixel.</dd>
-</dl>
-
-<dl>
-<dt><code>.HWMargins [&lt;four floats&gt;]</code></dt>
-<dd>Size of non-imageable regions around the edges of the page, in points
-(units of 1/72in; see the <a href="Devices.htm#Measurements">notes on
-measurements</a> in the documentation on devices).</dd>
-</dl>
-
-<dl>
-<dt><code>HWSize [&lt;integer&gt; &lt;integer&gt;]</code></dt>
-<dd>X and Y size in pixels.</dd>
-</dl>
-
-<dl>
-<dt><code>%MediaSource &lt;integer&gt;</code></dt>
-<dd>The input tray key as determined by setpagedevice. PostScript
-language programs don't set this parameter directly; they can
-<em>request</em> a particular tray through the MediaPosition
-setpagedevice parameter, but the setpagedevice logic need not
-necessarily honor the request. Devices which support switchable trays
-should implement %MediaSource in their put_params device procedure,
-but (unlike most other such parameters) need not implement
-corresponding reading logic in get_params.</dd>
-</dl>
-
-<dl>
-<dt><code>%MediaDestination &lt;integer&gt;</code></dt>
-<dd>The output tray key as determined by setpagedevice. Handling by
-devices should be parallel to %MediaSource.</dd>
-</dl>
-
-<dl>
-<dt><code>.IgnoreNumCopies &lt;boolean&gt;</code></dt>
-<dd>Some page description languages support a NumCopies parameter.
-This parameter instructs the device to ignore this, producing only
-one copy of the document on output. Note that some devices ignore
-NumCopies regardless because of limitation of the output format
-or the implementation.</dd>
-</dl>
-
-<dl>
-<dt><code>Name &lt;string&gt; (read-only)</code></dt>
-<dd>The device name. Currently the same as <code>OutputDevice</code>.</dd>
-</dl>
-
-<dl>
-<dt><code>Colors, GrayValues, RedValues, GreenValues, BlueValues, ColorValues (usually read-only)</code></dt>
-<dd>As for the <code>deviceinfo</code> operator of Display PostScript.
-<code>Red</code>, <code>Green</code>, <code>Blue</code>, and
-<code>ColorValues</code> are only defined if
-<code>Colors</code>&nbsp;&gt;&nbsp;1.</dd>
-</dl>
-
-<dl>
-<dt><code>TextAlphaBits, GraphicsAlphaBits (usually read-only)</code></dt>
-<dd>The number of bits of anti-aliasing information for text or graphics
-respectively. Legal values are 1 (no anti-aliasing, the default for most
-devices), 2, or 4.
-<p>Because this feature relies upon rendering the input it is incompatible, and will generate
-an error on attempted use, with any of the vector output devices.</p>
-</dd>
-</dl>
-
-<p>
-Ghostscript also supports the following read-only parameter that is not a
-true device parameter:</p>
-
-<dl>
-<dt><code>.EmbedFontObjects &lt;integer&gt;</code></dt>
-<dd>If non-zero, indicates that the device may embed font objects (as
-opposed to bitmaps for individual characters) in the output. The purpose of
-this parameter is to disable third-party font renderers for such devices.
-(This is zero for almost all devices.)</dd>
-</dl>
-
-<p>
-In addition, the following are defined per Adobe's documentation for the
-<code>setpagedevice</code> operator:</p>
-
-<blockquote>
-<code>Duplex</code> (if supported)<br>
-<code>HWResolution</code><br>
-<code>ImagingBBox</code><br>
-<code>Margins</code><br>
-<code>LeadingEdge</code><br>
-<code>MediaPosition</code><br>
-<code>NumCopies</code> (for printers only)<br>
-<code>Orientation</code> (if supported)<br>
-<code>OutputDevice</code><br>
-<code>PageOffset</code> (write-only)<br>
-<code>PageSize</code><br>
-<code>ProcessColorModel</code> (usually read-only)<br>
-</blockquote>
-
-<p>
-Some devices may only allow certain values for <code>HWResolution</code>
-and <code>PageSize</code>. The null device ignores attempts to set
-<code>PageSize</code>; its size is always <code>[0&nbsp;0]</code>.</p>
-
-<p>
-It should be noted that calling <tt>setpagedevice</tt> with one of the above keys may reset the effects of any <code>pdfmark</code> commands up to that point. In particular this is true of HWResolution, a behavior that differs from Adobe Distiller.</p>
-
-<a name="Banding_parameters"></a>
-<p><b>
-For raster printers and image format (jpeg*, tiff*, png* ...) devices these
-page device parameters are also defined:</b></p>
-<dl>
-<dt><code>MaxBitmap &lt;integer&gt;</code></dt>
-<dd>Maximum space for a full page raster image (bitmap) in memory.
-<p>This value includes the space for padding raster lines and for an array of
-pointers for each raster line, thus the <code>MaxBitmap</code> value to allow
-a given PageSize of a specific number of bits per pixel to be rendered in a
-full page buffer may be somewhat larger than the bitmap size alone.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>BandListStorage &lt;file|memory&gt;</code></dt>
-<dd>The default is determined by the make file macro <code>BAND_LIST_STORAGE</code>.
-Since <code>memory</code> is always included, specifying <code>-sBandListStorage=memory</code>
-when the default is <code>file</code> will use memory based storage for the
-band list of the page. This is primarily intended for testing, but if the disk I/O is
-slow, band list storage in memory may be faster.
-</dd>
-</dl>
-
-<dl>
-<dt><code>BufferSpace &lt;integer&gt;</code></dt>
-<dd>Size of the buffer space for band lists, if the full page raster image
-(bitmap) is larger than <code>MaxBitmap</code> (see above.)
-
-<p>The buffer space is used to collect display list (clist) commands for the
-bands and then to consolidate those commands when writing the clist to the
-selected BAND_LIST_STORAGE device (memory or file) set when Ghostscript is compiled.</p>
-<p>If <code>MaxBitmap</code> (above) forces banding mode, and if <code>BufferSpace</code>
-is large enough, the display list (clist) will consist of a single band.</p>
-<p>The <code>BufferSpace</code> will determine the size of the 'consolidation'
-buffer (above) even if the <code>MaxBitmap</code> value is low enough to force
-banding/clist mode.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>BGPrint &lt;boolean&gt;</code></dt>
-<dd>With many printer devices, when the display list (clist) banding mode is being used,
-the page rendering and output can be performed in a background thread.
-The default value, <code>false</code>, causes the rendering and printing to be
-done in the same thread as the parser. When <code>-dBGPrint=true</code>, the
-page output will be overlapped with parsing and writing the clist for the next page.
-<p>If the device does not support background printing, rendering and printing will
-be performed as if <code>-dBGPrint=false</code>.</p>
-<p>Note that the background printing thread will allocate a band buffer (size determined
-by the <code>BufferSpace</code> or <code>BandBufferSpace</code> values) in addition to
-the band buffer in the 'main' parsing thread.</p>
-<p>If <code>NumRenderingThreads</code> is &gt; 0, then the background printing thread
-will use the specified number of rendering threads as children of the background printing
-thread. The background printing thread will perform any processing of the raster data
-delivered by the rendering threads. Note that BGPrint is disabled for vector devices such as pdfwrite
-and NumRenderingThreads has no effect on these devices eitehr.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>GrayDetection &lt;boolean&gt;</code></dt>
-<dd>When <code>true</code>, and when the display list (clist) banding mode is being used,
-during writing of the clist, the color processing logic collects information about the
-colors used <b>before</b> the device color profile is applied. This allows special devices
-that examine <code>dev-&gt;icc_struct-&gt;pageneutralcolor</code> with the information that all
-colors on the page are near <i>neutral</i>, i.e. monochrome, and converting the rendered
-raster to gray may be used to reduce the use of color toners/inks.
-<p>
-Since the determination of whether or not the page uses colors is determined before the
-conversion to device colors, this information is independent of the device output profile.
-The determination has a small delta (<tt>DEV_NEUTRAL</tt> and <tt>AB_NEUTRAL</tt> in
-<tt>base/gscms.h</tt>) to allow colors close to neutral to be detected as neutral.
-Changing this value requires rebuilding.</p>
-<p>
-Among the devices distributed with the source, currently only the <code>pnmcmyk</code>
-device supports this parameter and will produce either a <code>P7 PAM</code> CMYK output
-or a <code>P5 PGM</code> Gray output depending on the use of color on the page.</p>
-<p>
-Also, the 'pageneutralcolor' status can be interrogated as a device parameter of the
-same name. Using PostScript there are several methods:</p>
-<pre>
- currentpagedevice /pageneutralcolor get
-
- mark currentdevice getdeviceprops .dicttomark /pageneutralcolor get
-
- /pageneutralcolor /GetDeviceParam .special_op { exch pop }{ //false } ifelse
-</pre>
-<p>
-Note that the <tt>pageneutralcolor</tt> state is reset to <tt>false</tt> after the
-page is output, so this parameter is only valid immediately <b>before</b> <tt>showpage</tt>
-is executed, although the <tt>setpagedevice EndPage</tt> procedure can be used to check
-the state just prior to the actual output of the page that resets <tt>pagenuetralcolor</tt>.
-For example:</p>
-<pre>
- &lt;&lt; /EndPage {
- exch pop 2 ne dup {
- currentpagedevice /pageneutralcolor get (pageneutralcolor: ) print = flush
- } if
- }
- &gt;&gt; setpagedevice
-</pre>
-<b>Notes:</b>
-<p>
-Since <code>-dGrayDetection=true</code> requires extra checking during
-writing of the clist, this option should <b>only</b> be used for devices that
-support the optimization of pages to monochrome, otherwise performance may be degraded
-for no benefit.</p>
-<p>
-Since GrayDetection=true is only effective when in clist (banding) mode, it is recommended
-to also force banding. For example: <b><tt>-dGrayDetection=true -dMaxBitmap=0</tt></b></p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>NumRenderingThreads &lt;integer&gt;</code></dt>
-<dd>When the display list (clist) banding mode is being used, bands can be rendered
-in separate threads. The default value, 0, causes the rendering of bands to be
-done in the same thread as the parser and device driver. <code>NumRenderingThreads</code>
-of 1 or higher results in bands rendering in the specified number of 'background'
-threads.
-<p>The number of threads should generally be set to the number of available
-processor cores for best throughput.</p>
-<p>Note that each thread will allocate a band buffer (size determined by the
-<code>BufferSpace</code> or <code>BandBufferSpace</code> values) in addition to
-the band buffer in the 'main' thread.</p>
-<p>Additoinally note that ths parameter has no effect with devices which do not generally
-render to a bitmap output, such as the vector devices (eg pdfwrite) and has no effect
-when rendering, but not using a clist. See <a href="Use.htm#Improving_performance">Improving_performance</a>
-</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>OutputFile &lt;string&gt;</code></dt>
-<dd>An empty string means "send to printer directly", otherwise specifies
-the file name for output; <code>%d</code> is replaced by the page number
-for page-oriented output devices;
-on Unix systems <code>%pipe%</code><em>command</em> writes to a pipe.
-(<code>|</code><em>command</em> also writes to a pipe, but is now
-deprecated). Also see the <code>-o</code> parameter.
-<p>
-Attempts to set this parameter if <code>.LockSafetyParams</code> is true
-will signal an <code>invalidaccess</code> error.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>OpenOutputFile &lt;boolean&gt;</code></dt>
-<dd>If true, open the device's output file when the device is opened,
-rather than waiting until the first page is ready to print.</dd>
-</dl>
-
-<dl>
-<dt><code>PageCount &lt;integer&gt; (read-only)</code></dt>
-<dd>Counts the number of pages printed on the device.</dd>
-</dl>
-
-<p>
-The following parameters are for use only by very specialized applications
-that separate band construction from band rasterization. <b>Improper use may
-cause unpredictable errors.</b> In particular, if you only want to allocate
-more memory for banding, to increase band size and improve performance, use
-the <code>BufferSpace</code> parameter, not <code>BandBufferSpace</code>.</p>
-
-<dl>
-<dt><code>BandHeight &lt;integer&gt;</code></dt>
-<dd>The height of bands when banding. 0 means use the largest band height
-that will fit within the <code>BandBufferSpace</code> (or <code>BufferSpace</code>,
-if <code>BandBufferSpace</code> is not specified). If <code>BandHeight</code>
-is larger than the number of lines that will fit in the buffer, opening the device will fail.
-If the value is -1, the BandHeight will automatically be set to the page height
-(1 band for the entire page). This is primarily for developers debugging clist issues.
-</dd>
-</dl>
-
-<dl>
-<dt><code>BandWidth &lt;integer&gt;</code></dt>
-<dd>The width of bands in the rasterizing pass, in pixels. 0 means use the
-actual page width. A BandWidth value smaller than the width of the page
-will be ignored, and the actual page width will be used instead.</dd>
-</dl>
-
-<dl>
-<dt><code>BandBufferSpace &lt;integer&gt;</code></dt>
-<dd>The size of the band buffer in the rasterizing pass, in bytes. 0 means
-use the same buffer size as for the interpretation pass.</dd>
-</dl>
-
-<p>
-Ghostscript supports the following parameter for
-<code>setpagedevice</code> and <code>currentpagedevice</code> that is
-not a device parameter per se:</p>
-
-<dl>
-<dt><code>ViewerPreProcess &lt;procedure&gt;</code></dt>
-<dd>Specifies a procedure to be applied to the page device dictionary
-before any other processing is done. The procedure may not alter the
-dictionary, but it may return a modified copy. This "hook" is provided for
-use by viewing programs such as GSview.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="User_parameters"></a>User parameters</h2>
-
-Ghostscript supports the following non-standard user parameters:
-
-<dl>
-<dt><code>ProcessDSCComment &lt;procedure|null&gt;</code></dt>
-<dd>If not null, this procedure is called whenever the scanner detects a DSC
-comment (comment beginning with <code>%%</code> or <code>%!</code>).
-There are two operands, the file and the comment (minus any terminating
-EOL), which the procedure must consume.</dd>
-</dl>
-
-<dl>
-<dt><code>ProcessComment &lt;procedure|null&gt;</code></dt>
-<dd>If not null, this procedure is called whenever the scanner detects a
-comment (or, if <code>ProcessDSCComment</code> is also not null, a
-comment other than a DSC comment). The operands are the same as for
-<code>ProcessDSCComment</code>.</dd>
-</dl>
-
-<dl>
-<dt><code>LockFilePermissions &lt;boolean&gt;</code></dt>
-<dd>If <tt>true</tt>, this parameter and the three <tt>PermitFile...</tt>
-parameters cannot be changed. Attempts to change any of the values
-when LockFilePermissions is <tt>true</tt> will signal <code>invalidaccess</code>.
-Also, when this value is <tt>true</tt>, the <code>file</code> operator
-will give <code>invalidaccess</code> when attempting to open files
-(processes) using the <code>%pipe</code> device.
-<p>
-Also when <code>LockFilePermissions</code> is <tt>true</tt>, strings
-cannot reference the parent directory (platform specific). For example
-<code>(../../xyz)</code> is illegal on unix, Windows
-and Macintosh, and <code>([.#.#.XYZ])</code> is illegal on VMS.</p>
-<p>
-This parameter is set <tt>true</tt> by the <code>.setsafe</code> and
-<code>.locksafe</code> operators.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>PermitFileReading &lt;array of strings&gt;</code></dt>
-<dt><code>PermitFileWriting &lt;array of strings&gt;</code></dt>
-<dt><code>PermitFileControl &lt;array of strings&gt;</code></dt>
-<dd>These parameters specify paths where file reading, writing and the
-'control' operations are permitted, respectively. File control
-operations are <code>deletefile</code> and <code>renamefile</code>.
-For <code>renamefile</code>, the filename for the current filename
-must match one of the paths on the PermitFileControl list, and the
-new filename must be on <b>both</b> the PermitFileControl and the
-PermitFileWriting lists of paths.
-<p>
-The strings can contain wildcard characters as for the <code>filenameforall</code>
-operator and unless specifying a single file, will end with a <b>*</b>
-for directories (folders) to allow access to all files and sub-directories
-in that directory.</p>
-<p>
-<b>Note:</b> The strings are used for stringmatch operations similar
-to <code>filenameforall</code>, thus on MS Windows platforms, use the '/'
-character to separate directories and filenames or use '\\\\' to
-have the string contain '\\' which will match a single '\' in the
-target filename (use of '/' is strongly recommended).</p>
-<p>
-The <a href="Use.htm#Safer"><b>SAFER</b></a> mode and the
-<code>.setsafe</code> operator set all three lists to empty arrays,
-thus the only files that can be read are the <code>%stdin</code> device and
-on LIBPATH or FONTPATH or the Resource paths specified by the /FontResourceDir
-or /GenericResourceDir system params. Files cannot be opened for writing
-anywhere and cannot be deleted or renamed except for files created with the
-<a href="#Tempfile"><b>.tempfile</b></a> operator).</p>
-<p>
-<b>Note: </b>Limiting file reading as above is <b>NOT</b> compatible with
-SAFER mode in release versions before 7.11 and corresponds to the use of
-<code>-dPARANOIDSAFER</code> in version 7.04 (up to and not including
-version 7.10) and GPL versions 6.53 (up to and not including 6.60).</p>
-</dd>
-</dl>
-
-<dl>
-<dt><code>AlignToPixels &lt;integer&gt;</code></dt>
-<dd>Control sub-pixel positioning of character glyphs (where
-applicable). A value of 1 specifies alignment of text characters to
-pixels boundaries. A value of 0 to subpixels where the division factor
-is set by the device parameter <code>TextAlphaBits</code>. If the
-latter is 1, the same rendering results regardless of the value of
-<code>AlignToPixels</code>. The initial value defaults to 1, but this
-may be overridden by the command line argument
-<code>-dAlignToPixels</code>.</dd>
-</dl>
-
-
-<dl>
-<dt><a name="GridFitTT"></a>
-<code>GridFitTT &lt;integer&gt;</code></dt>
-<dd>Control the use of True Type grid fitting.
-Ghostscript, by default, uses Freetype for rendering Truetype (and most other) glyphs
-(but other scaler/renderer libraries can be used), thus has access to a complete Truetype
-bytecode interpreter.
-<p>
-This parameter controls the hinting of Truetype glyphs.</p>
-<ul>
-<li>
-A value of 0 disables grid fitting for all True Type fonts (not generally recommended).
-</li>
-
-<li>
-A value of 1 enables the grid fitting using the native Truetype hinting bytecode
-program(s). Fonts or glyphs with faulty bytecode program(s) will be rendered unhinted.
-</li>
-
-<li>
-A value 2 is scaler/renderer dependent (generally, if no alternative hinting engine is available
-this will be equivalent to 1). With the Freetype (our default) this enables Freetype's built-in
-autohinter.
-</li>
-
-<li>
-With Freetype, a value of 3 is effectively equivalent to 1.
-</li>
-</ul>
-<p>
-This parameter defaults to 1, but this
-may be overridden on the command line with
-<code>-dGridFitTT=n</code>.</p>
-</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Miscellaneous_additions"></a>Miscellaneous additions</h2>
-
-<h3><a name="Extended_semantics_of_run"></a>Extended semantics of 'run'</h3>
-
-<p>
-The operator <code>run</code> can take either a string or a file as its argument. In
-the latter case, it just runs the file, closing it at the end, and trapping
-errors just as for the string case.</p>
-
-<h3><a name="DecodingResources"></a>Decoding resources</h3>
-
-<p>
-<code>Decoding</code> is a Ghostscript-specific resource category. It contains
-various resources for emulating PostScript fonts with other font technologies.
-Instances of the <tt>Decoding</tt> category are tables which map PostScript glyph
-names to character codes used with TrueType, Intellifont, Microtype and other font formats.</p>
-
-<p>
-Currently Ghostscript is capable of PostScript font emulation in 2 ways :</p>
-<ul>
-<li>
-1. Through <a href="./Use.htm#FAPI_run">FAPI</a> plugins, and
-</li>
-<li>
-2. With TrueType font files, using the native font renderer, by
-specifying TrueType font names or files in <a href="../Resource/Init/Fontmap.GS">Resource/Init/Fontmap.GS</a>.
-</li>
-</ul>
-<p>
-<code>Decoding</code> resources are not currently used by the native font renderer.</p>
-
-<p>
-An instance of the <code>Decoding</code> resource category is
-a dictionary. The dictionary keys are PostScript glyph names and the
-values are either character codes, or arrays of character codes.
-Arrays are used when a single name may be mapped to various character codes -
-in this case Ghostscript tries all alternatives until a success.
-The name of the resource instance should
-reflect the character set for which it maps. For example,
-<code>/Unicode</code> <code>/Decoding</code> resource maps to
-Unicode UTF-16.</p>
-
-<p>
-The rules for using <code>Decoding</code> resources in particular
-cases are specified in the configuration file
-<a href="../Resource/Init/xlatmap">Resource/Init/xlatmap</a>. See the file itself for more
-information.</p>
-
-<p>
-The file format for <code>Decoding</code> resource files is
-generic PostScript.
-Users may want to define custom <code>Decoding</code> resources.
-The <code>ParseDecoding</code> procset defined in
-<a href="../Resource/Init/gs_ciddc.ps">Resource/Init/gs_ciddc.ps</a> allows representation
-of the table in a comfortable form.</p>
-
-
-<h3><a name="CIDDecodingResources"></a>CIDDecoding resources</h3>
-
-<p>
-<code>CIDDecoding</code> resources are similar to <code>Decoding</code>
-resources, except they map Character Identifiers (CIDs) rather than glyph names.
-Another difference is that the native Ghostscript font renderer uses
-<code>CIDDecoding</code> resources while emulate CID fonts with TrueType or OpenType fonts.</p>
-
-<p>
-An instance of the <code>CIDDecoding</code> resource category is
-a dictionary of arrays. Keys in the dictionary are integers,
-which correspond to high order byte of a CID.
-Values are 256-element arrays, and their indices correspond to the low order byte of a CID.
-Each elemet of an array is either null, or character code (integer), or an array
-of character codes (integers). The zero code represents mapping to the default character.</p>
-
-<p>
-The dictionary includes the additional key <code>CIDCount</code>.
-Its value is the maximal CID defined, plus one.</p>
-
-<p>
-The Ghostscript library is capable of generating some <code>CIDDecoding</code>
-instances automatically, using the appropriate <code>CMap</code> (character map)
-resources. This covers most of practical cases if the neccessary <code>CMap</code>
-resources are provided. See the table <code>.CMapChooser</code> in
-<a href="../Resource/Init/gs_ciddc.ps">Resource/Init/gs_ciddc.ps</a>
-for the names of automatically gerenated resources and associated <code>CMap</code>s.
-They allow to mapping CNS1, GB1, Japan1, Japan2 and Korea1 CID sets to TrueType
-character sets known as Unicode (exactly UTF-16), Big5,
-GB1213, ShiftJIS, Johab and Wansung.</p>
-
-<p>
-The file format for <code>CIDDecoding</code> resource file is
-generic PostScript.
-Users may want to define custom resources to <code>CIDDecoding</code>
-resource category.</p>
-
-<h3><a name="GlyphNames2Unicode"></a>GlyphNames2Unicode</h3>
-<p>
-<code>GlyphNames2Unicode</code> is an undocumented dictionary which Adobe
-PostScript printer driver uses to communicate with Adobe Distiller.
-In this dictionary the keys are glyph names, the values are Unicode UTF-16 codes for them.
-The dictionaly is stored in the <code>FontInfo</code> dictionary under
-the key <code>GlyphNames2Unicode</code>. Ghostscript recognises it and uses
-to generate <code>ToUnicode</code> CMaps with pdfwrite.</p>
-
-<h3><a name="MultipleResourceDirectories"></a>Multiple Resource directories</h3>
-
-<p>
-Since 8.10 release Ghostscript maintains multiple resource directories.</p>
-
-<p>
-Ghostscript does not distinguish <code>lib</code> and
-<code>Resource</code> directories.
-There is no file name conflicts because <code>lib</code> does not
-contain subdirectories, but <code>Resource</code>
-always store files in subdirectories.</p>
-
-<p>
-The search method with multiple resource directories
-appears not fully conforming to PLRM. We cannot unconditionally call
-<code>ResourceFileName</code> while executing <code>findresource</code>
-or <code>resourcestatus</code>, <code>resourceforall</code>, because
-per PLRM it always returns a single path. Therefore Ghostscript
-implements an extended search method in <code>findresource</code>,
-<code>resourcestatus</code> and <code>resourceforall</code>, which
-first calls <code>ResourceFileName</code> and checks whether the
-returned path points to an existing file. If yes, the file is used,
-othervise Ghostscript searches all directories specified in
-<code>LIB_PATH</code>. With a single resource directory
-it appears conforming to PLRM and equivalent to Adobe implementations.</p>
-
-<p>
-<code>ResourceFileName</code> may be used for obtaining a path
-where a resource file to be installed. In this case
-Ghostscript to be invoked with <code>-sGenericResourceDir=path</code>,
-specifying an absolute path. The default value for
-<code>GenericResourceDir</code> is a relative path. Therefore
-a default invocation with a PostScript installer
-will install resource files into <code>/gs/Resource</code>.</p>
-
-<h2><a name="PDF_scripting"></a>Scripting the PDF interpreter</h2>
-
-<h3><a name="PS_functions"></a>PostScript functions</h3>
-
-<p>We have not previously documented the internals of the Ghostscript PDF interpreter, but we have, on
-occasion, provided solutions that rely upon scripting the interpreter from PostScript. This was
-possible because the interpreter was written in PostScript.</p>
-
-<p>From release 9.55.0 Ghostscript comes supplied with two PDF interpreters, the original written in PostScript
-and a brand-new interpreter written in C. While the new interpreter can be run as part of the GhostPDL family
-it has also been integrated into Ghostscript, and can be run from the PostScript environment in a similar fashion
-to the old interpreter. We plan to deprecate, and eventually remove, the old interpreter and carry on with the new one.</p>
-
-<p>Because we have supplied solutions in the past based on the old interpreter, we have had to implement
-the same capabilities in the integration of the new interpreter. Since this has meant discovering which internal
-portions were being used, working out how those function, and duplicating them anew, it seemed a good time to
-document these officially, so that in future the functionality would be available to all.</p>
-
-<p>The following functions existed in the original PDF interpreter and have been replicated for the new
-interpreter. It should be possible to use these for the forseeable future.</p>
-<dl>
-<dt><code>&ltfile&gt runpdf - </code></dt>
-<dd> Called from the modified PostScript run operator (which copies stdin to a temp
- file if required). Checks for PDF collections, processes all requested pages.</dd>
-
-<dt><code>&ltfile&gt runpdfbegin -</code></dt>
-<dd> This must be called before performing any further operations. Its exact action depends on which
-interpreter is being used, but it essentially sets up the environment to process the file as a PDF</dd>
-<dt><code>&ltint&gt pdfgetpage &ltpagedict&gt | &ltnull&gt</code></dt>
-<dd> int is a number from 1 to N indicating the desired page number from
- the PDF file. Returns the a dictionary containing various informational key/value pairs.
- If this fails, returns a null object.</dd>
- <dt><code> - pdfshowpage_init -</code></dt>
-<dd> In the PostScript PDF interpreter this simply adds 1 to the /DSCPageCount value in a dictionary.
-It has no effect in the new PDF interpreter but is maintained for backwards compatibility.</dd>
-
-<dt><code>&ltpagedict&gt pdfshowpage_setpage &ltpagedict&gt</code></dt>
-<dd> Takes a dictionary as returned from pdfgetpage, extracts various
- parameters from it, and sets the media size for the page, taking into
- account the boxes, and requested Box, Rotate value and PDFFitPage.</dd>
- <dt><code>&ltpagedict&gt pdfshowpage_finish -</code></dt>
-<dd> Takes a dictionary as returned from pdfgetpage, renders the page content
- executes showpage to transfer the rendered content to the device.</dd>
- <dt><code>- runpdfend -</code></dt>
-<dd> Terminates the PDF processing, executes restore and various cleanup activities.</dd>
-<dt><code>&ltfile&gt pdfopen &ltdict&gt</code></dt>
-<dd> Open a PDF file and read the header, trailer
- and cross-reference.</dd>
- <dt><code>&ltdict&gt pdfclose -</code></dt>
-<dd> Terminates processing the original PDF file object. The dictionary parameter
- should be the one returned from pdfopen</dd>
- <dt><code>&ltpagedict&gt pdfshowpage -</code></dt>
-<dd> Takes a dictionary returned from pdfgetpage and calls the pdfshowpage_init
- pdfshowpage_setpage, pdfshowpage_finish trio to start the page, set up the
- media and render the page.</dd>
- <dt><code>&ltint&gt &ltint&gt dopdfpages -</code></dt>
-<dd> The integers are the first and last pages to be run from the file. Runs a loop from
- the fist integer to the last. NOTE! If the current dictionary contains a PDFPageList
- array then we 'get' the entry from the array corresponding to the current loop
- index, and use that to determine whether we should draw the page. Otherwise we
- simply draw the page. Uses pdfshowpage to actually render the page.</dd>
- <dt><code>- runpdfpagerange &ltint&gt &ltint&gt</code></dt>
-<dd> Processes the PostScript /FirstPage, /LastPage and /PageList parameters. These are used together to build an internal array
- of page numbers to run, which is used by dopdfpages to actually process the pages if PageList is present,
- and a FirstPage and LastPage value. Despite the name this function does not actually 'run' any pages at all.
-
-<p>Normal operation simply calls runpdf with an opened-for-read PostScript file object. The table below shows the normal
-calling sequence</p>
-
-<blockquote><table>
-<tr valign="bottom">
- <th align="left">Function</th>
-
- <th align="left">Calls</th>
-
- <th align="left">Calls</th>
-
- <th align="left">Calls</th></tr>
-<tr valign="top">
- <td>runpdf</td>
-
- <td>runpdfbegin</td>
-
- <td>pdfopen</td>
-
- <td>&nbsp;</td></tr>
-<tr valign="top">
-
- <td>&nbsp;</td>
- <td>process_trailer_attrs</td>
-
- <td>&nbsp;</td>
- <td>&nbsp;</td>
-</tr>
-<tr valign="top">
-
- <td>&nbsp;</td>
- <td>runpdfpagerange</td>
-
-
- <td>&nbsp;</td>
- <td>&nbsp;</td></tr>
-<tr valign="top">
-
- <td>&nbsp;</td>
- <td>dopdfpages</td>
-
- <td>pdfgetpage</td>
- <td>&nbsp;</td></tr>
-<tr valign="top">
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>pdfshowpage</td>
-
- <td>pdfshowpage_init</td></tr>
-<tr valign="top">
-
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>pdfshowpage_setpage</td></tr>
-<tr valign="top">
-
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>pdfshowpage_finish</td></tr>
-<tr valign="top">
-
- <td>&nbsp;</td>
- <td>runpdfend</td>
-
- <td>pdfclose</td>
- <td>&nbsp;</td></tr>
-</table></blockquote>
-
-<p>It is important to get the number of spots and the presence of transparency correct when
-rendering. Failure to do so will lead to odd output, and potentially crahses. This can be important in situations
-such as N-up ordering.</p>
-<p>As an example, if we have 2 A4 pages and want to render them side-by-side on A3 media, we might set up
-the media size to A3, draw the first page contents, translate the origin, draw the second page contents
-and then render the final content. If the first PDF page did not contain transparency, but the second did, it
-would be necessary to set /PageHasTransparency before drawing the first PDF page.</p>
-
-<h3><a name="PDF_PS_operators"></a>PostScript operators interfacing to the PDF interpreter</h3>
-<p>The PostScript functions documented above must somehow interface with the actual PDF interpreter, and this is done
-using a small number of custom PostScript operators. These operators do not exist in standard PostScript; they
-are specific to the Ghostscript implementation. These operators are documented here for the benefit of any
-developers wishing to use them directly.</p>
-</dd>
-
-<dt><code>dict .PDFInit &ltPDFContext&gt</code></dt>
-<dd> Initialises an instance of the PDF interpreter. dict is an optional dictionary that contains any interpreter-level
-switches, such as PDFDEBUG, this is used to set the initial state of the PDF interpreter.
-The return value is a PDFcontext object which is an opaque object to be used with the other PDF operators.</dd>
-<dt><code>filename PDFcontext .PDFFile -</code></dt>
-<dd> Opens a named file and associates it with the instance of the PDF interpreter.
-Filename is a string containing a fully qualified path to the PDF file to open, this file must have been made accesible
-by setting --permit-file-read.
-</dd><dt><code>file PDFcontext .PDFStream -</code></dt>
-<dd> Takes an already open (disk-based) file and associates it with the instance of the PDF interpreter.
-</dd><dt><code>PDFcontext .PDFClose -</code></dt>
-<dd> If the context contains an open PDF file which was opened via the .PDFfile operator, this closes the file.
-Files associated with the context by the .PDFStream operator are unaffected. Regardless of the source it then shuts down the PDF interpreter and frees the associated memory.
-</dd><dt><code>PDFcontext .PDFInfo dict</code></dt>
-<dd> PDFcontext is a PDFcontext object returned from a previous call to .PDFInit.
-The returned dictionary contains various key/value pairs with useful file level information:
-<blockquote>
- <code>/NumPages</code> int<br>
- <code>/Creator</code> string<br>
- <code>/Producer</code> string<br>
- <code>/IsEncrypted</code> boolean<br>
-</blockquote>
-</dd><dt><code>PDFcontext .PDFMetadata -</code></dt>
-<dd> PDFcontext is a PDFcontext object returned from a previous call to .PDFInit.
-For the benefit of high level devices, this is a replacement for 'process_trailer_attrs' which is a seriously misnamed function now.
-This function needs to write any required output intents, load and send Outlines to the device, copy the Author, Creator, Title, Subject
-and Keywords from the Info dict to the output device, copy Optional Content Properties (OCProperties) to the output device.
-If an AcroForm is present send all its fields and link widget annotations to fields, and finally copy the PageLabels. If we add support for anything else, it will be here too..
-</dd><dt><code>PDFcontext int .PDFPageInfo -</code></dt>
-<dd> The integer argument is the page number to retrieve information for.
-Returns a dictionary with the following key/value pairs:
-<blockquote>
- <code>/UsesTransparency</code> true|false<br>
- <code>/SpotColours</code> array of names, may be empty|<br>
- <code>/MediaBox</code> [llx lly urx ury]<br>
- <code>/HasAnnots</code> true|false<br>
- <code>/FontsUsed</code> array of names, may be empty.<br>
-</blockquote>
-May also contain (if they are present in the Page dictionary)
-<blockquote>
- <code>/ArtBox</code> [llx lly urx ury]<br>
- <code>/CropBox</code> [llx lly urx ury]<br>
- <code>/BleedBox</code> [llx lly urx ury]<br>
- <code>/TrimBox</code> [llx lly urx ury]<br>
- <code>/UserUnit</code> int<br>
-</blockquote>
-</dd>
-<dt><code>PDFcontext int .PDFDrawPage -</code></dt>
-<dd> PDFcontext is a PDFcontext object returned from a previous call to .PDFInit.
-The integer argument is the page number to be processed.
-Interprets the page content stream(s) of the specified page using the current graphics state.
-</dd>
-
-<dt><code>PDFcontext int .PDFDrawAnnots -</code></dt>
-<dd> PDFcontext is a PDFcontext object returned from a previous call to .PDFInit.
-The integer argument is the page number to be processed.
-Renders the Annotations (if any) of the specified page using the current graphics state
-For correct results, the graphics state when this operator is run should be the same as when
-PDFDrawPage is executed.
-
-
-<p>Note: The PDFcontext object created by PDFInit must (clearly) have a PDF file associated
-with it before you can usefully use it. Attempting to use a PDFcontext with
-any of the processing operators (eg .PDFDrawPage) before using either .PDFStream of .PDFFile
-to associate a file with the context will result in an error.
-</p>
-</dd>
-</dl>
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Lib.htm b/doc/Lib.htm
deleted file mode 100644
index 340b53f1..00000000
--- a/doc/Lib.htm
+++ /dev/null
@@ -1,1023 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>The Ghostscript Library</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>The Ghostscript Library</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#GS_library">The Ghostscript library</a>
- <li><a href="#PS_operator_API">PostScript operator API</a>
- <li>
- <ul>
- <li><a href="#Patterns">Patterns</a>
- <li><a href="#Lower_level_API">Lower-level API</a>
- </ul>
- </li>
- <li><a href="#Visual_trace">Visual Trace instructions</a>
- <li><a href="#Full_example">A full example</a>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="GS_library"></a>The Ghostscript library</h2>
-
-<p>
-This document describes the Ghostscript library, a set of procedures
-to implement the graphics and filtering capabilities that are primitive
-operations in the PostScript language and in Adobe Portable Document Format
-(PDF).
-
-<p>
-Ghostscript is actually two programs: a language interpreter, and a
-graphics library. The library provides, in the form of C procedures, all
-the graphics functions of the language, that is, approximately those
-facilities listed in section 8.1 of the <cite>PostScript
-Language Reference Manual</cite>, starting with the
-graphics state operators. In addition, the library provides some
-lower-level graphics facilities that offer higher performance in exchange
-for less generality.
-
-<hr>
-
-<h2><a name="PS_operator_API"></a>PostScript operator API</h2>
-
-<p>
-The highest level of the library, which is the one that most clients will
-use, directly implements the PostScript graphics operators with procedures
-named <code>gs_XXX</code>, for instance <code>gs_moveto</code> and
-<code>gs_fill</code>. Nearly all of these procedures take graphics
-state objects as their first arguments, such as
-
-<blockquote><code>
-int gs_moveto(gs_state *, double, double);
-</code></blockquote>
-
-<p>
-Nearly every procedure returns an integer code which is &gt;= 0 for a
-successful return or &lt;0 for a failure. The failure codes correspond
-directly to PostScript errors, and are defined in
-<code>gserrors.h</code>.
-
-<p>
-The library implements all the operators in the following sections of the
-<cite>PostScript Language Reference Manual</cite>, with the indicated
-omissions and with the APIs defined in the indicated <code>.h</code>
-files. A header of the form <b><em>A.h(B.h)</em></b> indicates that
-<b><em>A.h</em></b> is included in <b><em>B.h</em></b>, so
-<b><em>A.h</em></b> need not be included explicitly if <b><em>B.h</em></b>
-is included. Operators marked with * in the "omissions" column are not
-implemented directly; the library provides lower-level procedures that can
-be used to implement the operator.
-
-<p>
-There are slight differences in the operators that return multiple values,
-since C's provisions for this are awkward. Also, the control structure for
-the operators involving callback procedures (<code>pathforall</code>,
-<code>image</code>, <code>colorimage</code>,
-<code>imagemask</code>) is partly inverted: the client calls a procedure
-to set up an enumerator object, and then calls another procedure for each
-iteration. The <code>...show</code> operators,
-<code>charpath</code>, and <code>stringwidth</code> also use an
-inverted control structure.
-
-<blockquote><table>
-<tr>
- <th align="left">Section<br>(operators)</th>
-
- <th align="left">Headers</th>
-
- <th align="left">Omissions</th>
- </tr>
-<tr>
- <td>Graphics state – device-independent</td>
-
- <td><code>gscolor.h</code>(<code>gsstate.h</code>)<br><code>gscolor1.h</code><br><code>gscolor2.h</code><br><code>gscspace.h</code><br><code>gshsb.h</code><br><code>gsline.h</code>(<code>gsstate.h</code>)<br><code>gsstate.h</code></td>
-
- <td>&nbsp;</td>
- </tr>
-<tr>
- <td>Graphics state – device-dependent</td>
-
- <td><code>gscolor.h</code>(<code>gsstate.h</code>)<br><code>gscolor1.h</code><br><code>gscolor2.h</code><br><code>gsht.h</code>(<code>gsht1.h</code>,<code>gsstate.h</code>)<br><code>gsht1.h</code><br><code>gsline.h</code>(<code>gsstate.h</code>)</td>
-
- <td>&nbsp;</td>
- </tr>
-<tr>
- <td>Coordinate system and matrix</td>
-
- <td><code>gscoord.h</code><br><code>gsmatrix.h</code></td>
-
- <td><code>*matrix</code>, <code>*identmatrix</code>, <code>*concatmatrix</code>, <code>*invertmatrix</code></td>
- </tr>
-<tr>
- <td>Path construction</td>
-
- <td><code>gspath.h</code><br><code>gspath2.h</code></td>
-
- <td><code>*arct</code>, <code>*pathforall</code>, <code>ustrokepath</code>, <code>uappend</code>, <code>upath</code>, <code>ucache</code></td>
- </tr>
-<tr>
- <td>Painting</td>
-
- <td><code>gsimage.h</code><br><code>gspaint.h</code><br><code>gspath2.h</code></td>
-
- <td><code>*image</code>, <code>*colorimage</code>, <code>*imagemask</code>, <code>ufill</code>, <code>ueofill</code>, <code>ustroke</code></td>
- </tr>
-<tr>
- <td>Form and pattern</td>
-
- <td><code>gscolor2.h</code></td>
-
- <td><code>execform</code></td>
- </tr>
-<tr>
- <td>Device setup and output</td>
-
- <td><code>gsdevice.h</code></td>
-
- <td><code>*showpage</code>, <code>*set</code>/<code>currentpagedevice</code></td>
- </tr>
-<tr>
- <td>Character and font</td>
-
- <td><code>gschar.h</code><br><code>gsfont.h</code></td>
-
- <td>*(all the <code>show</code> operators), <code>definefont</code>, <code>undefinefont</code>, <code>findfont</code>, <code>*scalefont</code>, <code>*makefont</code>, <code>selectfont</code>, <code>[Global]FontDirectory</code>, <code>Standard</code>/<code>ISOLatin1Encoding</code>, <code>findencoding</code></td>
- </tr>
-</table></blockquote>
-
-<p>
-The following procedures from the list above operate differently from their
-PostScript operator counterparts, as explained here:
-
-<dl>
-<dt><code>gs_makepattern(gscolor2.h)</code>
-<dd>Takes an explicit current color, rather than using the current color in
-the graphics state. Takes an explicit allocator for allocating the pattern
-implementation. See below for more details on
-<code>gs_makepattern</code>.
-</dl>
-
-<dl>
-<dt><code>gs_setpattern(gscolor2.h)</code>
-<dt><code>gs_setcolor(gscolor2.h)</code>
-<dt><code>gs_currentcolor(gscolor2.h)</code>
-<dd>Use <code>gs_client_color</code> rather than a set of color
-parameter values. See below for more details on
-<code>gs_setpattern</code>.
-</dl>
-
-<dl>
-<dt><code>gs_currentdash_length/pattern/offset(gsline.h)</code>
-<dd>Splits up <code>currentdash</code> into three separate procedures.
-</dl>
-
-<dl>
-<dt><code>gs_screen_init/currentpoint/next/install(gsht.h)</code>
-<dd>Provide an "enumeration style" interface to <code>setscreen</code>.
-(<code>gs_setscreen</code> is also implemented.)
-</dl>
-
-<dl>
-<dt><code>gs_rotate/scale/translate(gscoord.h)</code>
-<dt><code>gs_[i][d]transform(gscoord.h)</code>
-<dd>These always operate on the graphics state CTM. The corresponding
-operations on free-standing matrices are in <code>gsmatrix.h</code> and
-have different names.
-</dl>
-
-<dl>
-<dt><code>gs_path_enum_alloc/init/next/cleanup(gspath.h)</code>
-<dd>Provide an "enumeration style" implementation of
-<code>pathforall</code>.
-</dl>
-
-<dl>
-<dt><code>gs_image_enum_alloc(gsimage.h)</code>
-<dt><code>gs_image_init/next/cleanup(gsimage.h)</code>
-<dd>Provide an "enumeration style" interface to the equivalent of
-<code>image</code>, <code>imagemask</code>, and
-<code>colorimage</code>. In the <code>gs_image_t</code>,
-<code>ColorSpace</code> provides an explicit color space, rather than
-using the current color space in the graphics state;
-<code>ImageMask</code> distinguishes <code>imagemask</code> from
-<code>[color]image</code>.
-</dl>
-
-<dl>
-<dt><code>gs_get/putdeviceparams(gsdevice.h)</code>
-<dd>Take a <code>gs_param_list</code> for specifying or receiving the
-parameter values. See <code>gsparam.h</code> for more details.
-</dl>
-
-<dl>
-<dt><code>gs_show_enum_alloc/release(gschar.h)</code>
-<dt><code>gs_xxxshow_[n_]init(gschar.h)</code>
-<dt><code>gs_show_next(gschar.h)</code>
-<dd>Provide an "enumeration style" interface to writing text. Note that
-control returns to the caller if the character must be rasterized.
-</dl>
-
-<p>
-This level of the library also implements the following operators from other
-sections of the Manual:
-
-<blockquote><table>
-<tr>
- <th align="left">Section<br>(operators)</th>
-
- <th align="left">Headers</th>
-
- <th align="left">Operators</th>
- </tr>
-<tr>
- <td>Interpreter parameter</td>
-
- <td><code>gsfont.h</code></td>
-
- <td><code>cachestatus</code>, <code>setcachelimit</code>, <code>*set/currentcacheparams</code></td>
- </tr>
-<tr>
- <td>Display PostScript</td>
-
- <td><code>gsstate.h</code></td>
-
- <td><code>set/currenthalftonephase</code></td>
- </tr>
-</table></blockquote>
-
-<p>
-In order to obtain the full PostScript Level 2 functionality listed above,
-<code>FEATURE_DEVS</code> must be set in the makefile to include at least the following:
-
-<blockquote><code>
-FEATURE_DEVS=patcore.dev cmykcore.dev psl2core.dev dps2core.dev ciecore.dev path1core.dev hsbcore.dev
-</code></blockquote>
-
-<p>
-The <code>*lib.mak</code> makefiles mentioned below do not always
-include all of these features.
-
-<p>
-Files named <code>gs*.c</code> implement the higher level of the
-graphics library. As might be expected, all procedures, variables, and
-structures available at this level begin with "<code>gs_</code>".
-Structures that appear in these interfaces, but whose definitions may be
-hidden from clients, also have names beginning with "<code>gs_</code>",
-that is, the prefix, not the implementation, reflects at what level the
-abstraction is made available.
-
-<h3><a name="Patterns"></a>Patterns</h3>
-
-<p>
-Patterns are the most complicated PostScript language objects that the
-library API deals with. As in PostScript, defining a pattern color and
-using the color are two separate operations.
-
-<p>
-<code>gs_makepattern</code> defines a pattern color. Its arguments are as follows:
-
-<blockquote><table>
-<tr>
- <td><code>gs_client_color *</code></td>
-
- <td>The resulting <code>Pattern</code> color is stored here. This is different from PostScript, which has no color objects <em>per se</em>, and hence returns a modified copy of the dictionary.</td>
- </tr>
-<tr>
- <td><code>const gs_client_pattern *</code></td>
-
- <td>The analogue of the original <code>Pattern</code> dictionary, described in detail just below.</td>
- </tr>
-<tr>
- <td><code>const gs_matrix *</code></td>
-
- <td>Corresponds to the matrix argument of the <code>makepattern</code> operator.</td>
- </tr>
-<tr>
- <td><code>gs_state *</code></td>
-
- <td>The current graphics state.</td>
- </tr>
-<tr>
- <td><code>gs_memory_t *</code></td>
-
- <td>The allocator to use for allocating the saved data for the
- <code>Pattern</code> color. If this is
- <code>NULL</code>, <code>gs_makepattern</code> uses the
- same allocator that allocated the graphics state. Library
- clients should probably always use <code>NULL</code>.</td>
-</tr>
-</table></blockquote>
-
-<p>
-The <code>gs_client_pattern</code> structure defined in
-<code>gscolor2.h</code> corresponds to the <code>Pattern</code>
-dictionary that is the argument to the PostScript language
-<code>makepattern</code> operator. This structure has one extra member,
-<code>void&nbsp;*client_data</code>, which is a place for clients to
-store a pointer to additional data for the <code>PaintProc</code>; this
-provides the same functionality as putting additional keys in the
-<code>Pattern</code> dictionary at the PostScript language level. The
-<code>PaintProc</code> is an ordinary C procedure that takes as
-parameters a <code>gs_client_color&nbsp;*</code>, which is the
-<code>Pattern</code> color that is being used for painting, and a
-<code>gs_state&nbsp;*</code>, which is the same graphics state that
-would be presented to the <code>PaintProc</code> in PostScript.
-Currently the <code>gs_client_color&nbsp;*</code> is always the current
-color in the graphics state, but the <code>PaintProc</code> should not
-rely on this. The <code>PaintProc</code> can retrieve the
-<code>gs_client_pattern&nbsp;*</code> from the
-<code>gs_client_color&nbsp;*</code> with the
-<code>gs_getpattern</code> procedure, also defined in
-<code>gscolor2.h</code>, and from there, it can retrieve the
-<code>client_data</code> pointer.
-
-<p>
-The normal way to set a <code>Pattern</code> color is to call
-<code>gs_setpattern</code> with the graphics state and with the
-<code>gs_client_color</code> returned by <code>gs_makepattern</code>.
-After that, one can use <code>gs_setcolor</code> to set further
-<code>Pattern</code> colors (colored, or uncolored with the same
-underlying color space); the rules are the same as those in PostScript.
-Note that for <code>gs_setpattern</code>, the
-<code>paint.values</code> in the <code>gs_client_color</code> must be
-filled in for uncolored patterns; this corresponds to the additional
-arguments for the PostScript <code>setpattern</code> operator in the
-uncolored case.
-
-<p>
-There is a special procedure <code>gs_makebitmappattern</code> for creating bitmap-based
-patterns. Its API is documented in <code>gscolor2.h</code>; its implementation, in
-<code>gspcolor.c</code>, may be useful as an example of a pattern using a particularly
-simple <code>PaintProc.</code>
-
-<h3><a name="Lower_level_API"></a>Lower-level API</h3>
-
-<p>
-Files named <code>gx*.c</code> implement the lower level of the graphics
-library. The interfaces at the <code>gx</code> level are less stable,
-and expose more of the implementation detail, than those at the
-<code>gs</code> level: in particular, the <code>gx</code> interfaces
-generally use device coordinates in an internal fixed-point representation,
-as opposed to the <code>gs</code> interfaces that use floating point
-user coordinates. Named entities at this level begin with
-<code>gx_</code>.
-
-<p>
-Files named <code>gz*.c</code> and <code>gz*.h</code> are internal to
-the Ghostscript implementation, and are not designed to be called by
-clients.
-
-<hr>
-
-<h2><a name="Visual_trace"></a>Visual Trace instructions</h2>
-
-<p>
-Visual Trace instructions may be inserted in code to provide debug output in
-a graphical form. Graphics Library doesn't provide a rasterisation of the
-output, because it is platform dependent. Instead this, client application
-shpuld set <code>vd_trace0</code> external variable to Graphics Library,
-passing a set of callbacks which provide the rasterization.
-
-<p>
-Visual Trace instructions are defined in <code>vdtrace.h</code>.
-Debug output must be opened with <code>vd_get_dc</code> instruction,
-which obtains a drawing context for the debug output, and must be closed
-with <code>vd_release_dc</code> instruction. After opening the output,
-scale, origin and shift to be set for mapping the debugee coordinate space
-to window coordinate space. Than painting instructions to be used.
-Painting may be either immediate or indirect.
-
-<p>
-Indirect painting uses <code>vd_beg_path</code> before
-line output and <code>vd_end_path</code> after line output,
-to store a path into a temporary storage. After this
-<code>vd_stroke</code> may be used for stroking the path,
-or <code>vd_fill</code> may be used for filling the region inside the path.
-
-<p>
-Immediate painting happens when path construction instructions are
-involved without <code>vd_beg_path</code> and <code>vd_end_path</code>.
-In this case lines and curves are being drawed immediately, when a path construction
-instruction is executed.
-
-<p>
-The following table explains the semantics of Visual Trace instructions.
-<p>
-
-<table>
- <tr>
- <th colspan="3">Visual Trace instructions</th>
- </tr>
-<tr>
- <th align="left">Instruction</th>
-
- <th align="left">Function</th>
-
- <th align="left">Parameters</th>
- </tr>
-<tr>
- <td><code>vd_get_dc</code></td>
-
- <td>Obtain drawing context</td>
-
- <td><code>-T</code> option flag value, for which the subsequent output is enabled.</td>
- </tr>
-<tr>
- <td><code>vd_release_dc</code></td>
-
- <td>Release drawing context</td>
-
- <td>&nbsp;&nbsp;</td>
-</tr>
-<tr>
- <td><code>vd_enabled</code></td>
-
- <td>Is trace currently enabled ?</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_get_size_unscaled_x</code></td>
-
- <td>Get the horizontal size of the output window in pixels.</td>
-
- <td></td>
- </tr>
- <tr><td><code>vd_get_size_unscaled_y</code></td>
-
- <td>Get the vertical size of the output window in pixels.</td>
-
- <td></td></tr>
-<tr>
- <td><code>vd_get_size_caled_x</code></td>
-
- <td>Get the horizontal size of the output window in debuggee coordinate units.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_get_size_caled_y</code></td>
-
- <td>Get the vertical size of the output window in debuggee coordinate units.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_get_scale_x</code></td>
-
- <td>Get the horizontal scale.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_get_scale_y</code></td>
-
- <td>Get the vertical scale.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_get_origin_x</code></td>
-
- <td>Get the horizontal position of the draft origin in debuggee coordinate space.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_get_origin_y</code></td>
-
- <td>Get the vertical position of the draft origin in debuggee coordinate space.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_set_scale(s)</code></td>
-
- <td>Set isotripic scale.</td>
-
- <td>Debugee space to window space mapping scale, same for both dimentions.</td>
- </tr>
-<tr>
- <td><code>vd_set_scaleXY(sx,sy)</code></td>
-
- <td>Set anisotripic scale.</td>
-
- <td>Debugee space to window space mapping scale, one for each dimention.</td>
- </tr>
-<tr>
- <td><code>vd_set_origin(x,y)</code></td>
-
- <td>Set the draft origin.</td>
-
- <td>Origin of the draft in debugee space.</td>
- </tr>
-<tr>
- <td><code>vd_set_shift(x,y)</code></td>
-
- <td>Set the draft position.</td>
-
- <td>Position of the draft origin in window space (in pixels).</td>
- </tr>
-<tr><td><code>vd_set_central_shift</code></td>
-
- <td>Set the draft position to window center.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_erase(c)</code></td>
-
- <td>Fill entire window.</td>
-
- <td>Color to fill.</td>
- </tr>
-<tr>
- <td><code>vd_beg_path</code></td>
-
- <td>Begin path construction.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_end_path</code></td>
-
- <td>End path construction.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_moveto(x,y)</code></td>
-
- <td>Path construction : Set the draft current point.</td>
-
- <td>Debugee coordinates.</td>
- </tr>
-<tr>
- <td><code>vd_lineto(x,y)</code></td>
-
- <td>Path construction : Line from current point to specified point.</td>
-
- <td>Debugee coordinates.</td>
- </tr>
-<tr>
- <td><code>vd_lineto_mupti(p,n)</code></td>
-
- <td>Path construction : Poliline from current point to specified points.</td>
-
- <td>Array of points and its size, debugee coordinates.</td>
- </tr>
-<tr>
- <td><code>vd_curveto(x0,y0,x1,y1,x2,y2)</code></td>
-
- <td>Path construction : Curve (3rd-order Bezier) from current
- point to specified point, with specified poles.</td>
-
- <td>2 poles and the curve ending point, debuggee coordinates.</td>
- </tr>
-<tr>
- <td><code>vd_closepath</code></td>
-
- <td>Path construction : Close the path (is necessary for filling an area).</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_bar(x0,y0,x1,y1,w,c)</code></td>
-
- <td>Bar from point to point.</td>
-
- <td>2 points (debugee coordinates), width (in pixels) and color.</td>
- </tr>
-<tr>
- <td><code>vd_square(x0,y0,w,c)</code></td>
-
- <td>Square with specified center and size.</td>
-
- <td>The center (debugee coordinates), size (in pixels) and color.</td>
- </tr>
-<tr>
- <td><code>vd_rect(x0,y0,x1,y1,w,c)</code></td>
-
- <td>Canonic rectangle with specified coordinites.</td>
-
- <td>Coordinates of boundaries (debugee coordinates), line width (in pixels) and color.</td>
- </tr>
-<tr>
- <td><code>vd_quad(x0,y0,x1,y1,x2,y2,x3,y3,w,c)</code></td>
-
- <td>Quadrangle with specified coordinites.</td>
-
- <td>Coordinates of vertices (debugee coordinates), line width (in pixels) and color.</td>
- </tr>
-<tr>
- <td><code>vd_curve(x0,y0,x1,y1,x2,y2,x3,y3,c,w)</code></td>
-
- <td>Curve with width.</td>
-
- <td>4 curve poles (debugee coordinates), color, and width (in pixels).</td>
- </tr>
-<tr>
- <td><code>vd_circle(x,y,r,c)</code></td>
-
- <td>Circle.</td>
-
- <td>Center (debugee coordinates), radius (in pixels) and color.</td>
- </tr>
-<tr>
- <td><code>vd_round(x,y,r,c)</code></td>
-
- <td>Filled circle.</td>
-
- <td>Center (debugee coordinates), radius (in pixels) and color.</td>
- </tr>
-<tr>
- <td><code>vd_stroke</code></td>
-
- <td>Stroke a path constructed with vd_beg_path, vd_moveto, vd_lineto,
- vd_curveto, vd_closepath, vd_end_path.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_fill</code></td>
-
- <td>Fill a path constructed with vd_beg_path, vd_moveto, vd_lineto,
- vd_curveto, vd_closepath, vd_end_path.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>vd_setcolor(c)</code></td>
-
- <td>Set a color.</td>
-
- <td>Color (an integer consisting of red, green, blue bytes).</td>
- </tr>
-<tr>
- <td><code>vd_setlinewidth(w)</code></td>
-
- <td>Set line width.</td>
-
- <td>Width (in pixels).</td>
- </tr>
-<tr>
- <td><code>vd_text(x,y,s,c)</code></td>
-
- <td>Paint a text.</td>
-
- <td>Origin point (debugee coordinates), a string, and a color.</td>
- </tr>
-<tr>
- <td><code>vd_wait</code></td>
-
- <td>Delay execution until a resuming command is entered through user interface.</td>
-
- <td></td>
- </tr>
-</table>
-
-
-<p>
-Graphics Library doesn't provide a rasterization of the debug output.
-Instead it calls callbacks, which are specified by a client, and which may
-have a platform dependent implementation. The implementation must not
-use Graphics Library to exclude recursive calls to it from Visual Trace
-instructions. The callbacks and auxiliary data are collected in
-the structure <code>vd_trace_interface</code>, explained in the table below.
-</p>
-
-<table>
-<tr>
- <th colspan="3">vd_trace_interface structure</th>
- </tr>
-<tr>
- <th align="left">Field</th>
-
- <th align="left">Purpose</th>
-
- <th align="left">Parameters</th>
- </tr>
-<tr>
- <td><code>host</code></td>
-
- <td>A pointer to the rasterizer control block - to be provided by client application.
- The type of the fild is client dependent.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>scale_x, scale_y</code></td>
-
- <td>Scale of debugee coordinate to window coordinate mapping - internal work data, don't change.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>orig_x, orig_y</code></td>
-
- <td>Draft origin in debugee coordinates - internal work data, don't change.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>shift_x, shift_y</code></td>
-
- <td>Draft shift in window coordinates - internal work data, don't change.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>get_size_x(I)</code></td>
-
- <td>Get window width in pixels.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>get_size_y(I)</code></td>
-
- <td>Get window height in pixels.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>get_dc(I,I1)</code></td>
-
- <td>Obtain drawing context.</td>
-
- <td>Pointer to interface block, and pointer to copy of the pointer.
- Implementation must set *I1 if it succeeds to get a drawing context.</td>
- </tr>
-<tr>
- <td><code>release_dc(I,I1)</code></td>
-
- <td>Release drawing context.</td>
-
- <td>Pointer to interface block, and pointer to copy of the pointer.
- Implementation must reset *I1 if it succeeds to release the drawing context.</td>
- </tr>
-<tr>
- <td><code>erase(I,c)</code></td>
-
- <td>Erase entire window.</td>
-
- <td>Background color.</td>
- </tr>
-<tr>
- <td><code>beg_path(I)</code></td>
-
- <td>Begin path construction.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>end_path(I)</code></td>
-
- <td>End path construction.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>moveto(I,x,y)</code></td>
-
- <td>Set current point.</td>
-
- <td>A point in window coordinates.</td>
- </tr>
-<tr>
- <td><code>lineto(I,x,y)</code></td>
-
- <td>Line from current point to specified point.</td>
-
- <td>A point in window coordinates.</td>
- </tr>
-<tr>
- <td><code>curveto(I,x0,y0,x1,y1,x2,y2)</code></td>
-
- <td>Curve from current point with specified poles to specified point.</td>
-
- <td>3 points in window coordinates.</td>
- </tr>
-<tr>
- <td><code>closepath(I)</code></td>
-
- <td>Close the path.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>circle(I,x,y,r)</code></td>
-
- <td>Circle.</td>
-
- <td>Center and radius, window coordinates.</td>
- </tr>
-<tr>
- <td><code>round(I,x,y,r)</code></td>
-
- <td>Filled circle.</td>
-
- <td>Center and radius, window coordinates.</td>
- </tr>
-<tr>
- <td><code>fill(I)</code></td>
-
- <td>Fill the path.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>stroke(I)</code></td>
-
- <td>Stroke the path.</td>
-
- <td></td>
- </tr>
-<tr>
- <td><code>setcolor(I,c)</code></td>
-
- <td>Set color.</td>
-
- <td>An integer, consisting of red, green, blue bytes.</td>
- </tr>
-<tr>
- <td><code>setlinewidth(I,w)</code></td>
-
- <td>Set line width.</td>
-
- <td>Line width in pixels.</td>
- </tr>
-<tr>
- <td><code>text(I,x,y,s)</code></td>
-
- <td>Draw a text.</td>
-
- <td>Coodrinates in pixels, and a string.</td>
- </tr>
-<tr>
- <td><code>wait(I)</code></td>
-
- <td>Delay execution untill resume command is inputted from user.</td>
-
- <td></td>
- </tr>
-</table>
-
-<p>
-<hr>
-
-<h2><a name="Full_example"></a>A full example</h2>
-
-<p>
-The file <code>gslib.c</code> in the Ghostscript fileset is a complete
-example program that initializes the library and produces output using it;
-files named <code>*lib.mak</code> (such as <code>ugcclib.mak</code>
-and <code>bclib.mak</code>) are makefiles using <code>gslib.c</code>
-as the main program. The following annotated excerpts from this file are
-intended to provide a roadmap for applications that call the library.
-
-<blockquote><pre>/* Capture stdin/out/err before gs.h redefines them. */
-#include &lt;stdio.h&gt;
-static FILE *real_stdin, *real_stdout, *real_stderr;
-static void
-get_real(void)
-{ real_stdin = stdin, real_stdout = stdout, real_stderr = stderr;
-}</pre></blockquote>
-
-<p>
-Any application using Ghostscript should include the fragment above at the
-very beginning of the main program.
-
-<blockquote><pre>#include "gx.h"</pre></blockquote>
-
-<p>
-The <code>gx.h</code> header includes a wealth of declarations related
-to the Ghostscript memory manager, portability machinery, debugging
-framework, and other substrate facilities. Any application file that calls
-any Ghostscript API functions should probably include <code>gx.h</code>.
-
-<blockquote><pre>/* Configuration information imported from gconfig.c. */
-extern gx_device *gx_device_list[];
-
-/* Other imported procedures */
- /* from gsinit.c */
-extern void gs_lib_init(P1(FILE *));
-extern void gs_lib_finit(P2(int, int));
- /* from gsalloc.c */
-extern gs_ref_memory_t *ialloc_alloc_state(P2(gs_memory_t *, uint));</pre></blockquote>
-
-<p>
-The externs above are needed for initializing the library.
-
-<blockquote><pre> gs_ref_memory_t *imem;
-#define mem ((gs_memory_t *)imem)
- gs_state *pgs;
- gx_device *dev = gx_device_list[0];
-
- gp_init();
- get_real();
- gs_stdin = real_stdin;
- gs_stdout = real_stdout;
- gs_stderr = real_stderr;
- gs_lib_init(stdout);
- ....
- imem = ialloc_alloc_state(&amp;gs_memory_default, 20000);
- imem-&gt;space = 0;
- ....
- pgs = gs_state_alloc(mem);</pre></blockquote>
-
-<p>
-The code above initializes the library and its memory manager. <code>pgs</code> now
-points to the graphics state that will be passed to the drawing routines in
-the library.
-
-<blockquote><pre> gs_setdevice_no_erase(pgs, dev); /* can't erase yet */
- { gs_point dpi;
- gs_screen_halftone ht;
- gs_dtransform(pgs, 72.0, 72.0, &amp;dpi);
- ht.frequency = min(fabs(dpi.x), fabs(dpi.y)) / 16.001;
- ht.angle = 0;
- ht.spot_function = odsf;
- gs_setscreen(pgs, &amp;ht);
- }</pre></blockquote>
-
-<p>
-The code above initializes the default device and sets a default halftone
-screen. (For brevity, we have omitted the definition of odsf, the spot
-function.)
-
-<blockquote><pre> /* gsave and grestore (among other places) assume that */
- /* there are at least 2 gstates on the graphics stack. */
- /* Ensure that now. */
- gs_gsave(pgs);</pre></blockquote>
-
-<p>
-The call above completes initializing the graphics state. When the program
-is finished, it should execute:
-
-<blockquote><pre> gs_lib_finit(0, 0);</pre></blockquote>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Make.htm b/doc/Make.htm
deleted file mode 100644
index 6ed776dd..00000000
--- a/doc/Make.htm
+++ /dev/null
@@ -1,1459 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>How to Build Ghostscript from Source Code</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>How to Build Ghostscript from Source Code</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#General_overview">General overview</a></li>
- <li><a href="#Acquiring">How to acquire the source code</a></li>
- <li>
- <ul>
- <li><a href="#Acquiring_git">How to acquire the development source code</a></li>
- </ul>
- </li>
- <li><a href="#Unpack">How to unpack the source code</a></li>
- <li>
- <ul>
- <li><a href="#Tarfiles">How to unpack compressed tar files generally</a></li>
- <li><a href="#Unpack_Ghostscript">How to unpack Ghostscript itself</a></li>
- </ul>
- </li>
- <li><a href="#Bug_check">How to check for post-release bug fixes</a></li>
- <li><a href="#Makefile_overview">How to prepare the makefiles</a></li>
- <li>
- <ul>
- <li><a href="#Preparing_makefiles">Changes for your environment</a></li>
- <li><a href="#Features_and_devices">Selecting features and devices</a></li>
- <li>
- <ul>
- <li><a href="#Precompiled_data">Precompiled run-time data</a></li>
- </ul>
- </li>
- <li><a href="#Makefile_setup">Setting up "makefile"</a></li>
- <li><a href="#MSys/Mingw">MSys/Mingw</a></li>
- <li><a href="#Invoke_make">Invoking "make"</a></li>
- <li><a href="#Cross-compiling">Cross-compiling</a></li>
- </ul>
- </li>
- <li><a href="#PC_build">How to build Ghostscript from source (PC version)</a></li>
- <li>
- <ul>
- <li><a href="#Microsoft_build">Microsoft environment</a></li>
- <li><a href="#Microsoft_build_64">Microsoft environment 64-bit</a></li>
- <li><a href="#Microsoft_build_winrt">Microsoft environment WinRT</a></li>
- <li><a href="#Self-extracting_executables">Making self-extracting Installers</a></li>
- <li><a href="#Cygwin32_build">Cygwin32 gcc</a></li>
- </ul>
- </li>
- <li><a href="#Mac_build">How to build Ghostscript from source (MacOS version)</a></li>
- <li>
- <ul>
- <li><a href="#MacOSX">MacOS X</a></li>
- </ul>
- </li>
- <li><a href="#Unix_build">How to build Ghostscript from source (Unix version)</a></li>
- <li>
- <ul>
- <li><a href="#GNU_make">make tools</a></li>
- <li><a href="#OS_specific_issues">OS-specific issues</a></li>
- <li>
- <ul>
- <li><a href="#HP_RISC">H-P RISC workstations</a></li>
- <li><a href="#IBMAIX">IBM AIX</a></li>
- <li><a href="#Silicon_Graphics">Silicon Graphics</a></li>
- <li><a href="#Sun">Oracle/Sun</a></li>
- <li><a href="#Solaris">Solaris</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li><a href="#Other_environments">Other environments</a></li>
- <li>
- <ul>
- <li><a href="#No_multi_thread">Environments lacking multi-threading</a></li>
- <li><a href="#Plan_9">Plan 9</a></li>
- </ul>
- </li>
- <li><a href="#UFST_build">How to build Ghostscript with UFST</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a> and the instructions on how to <a href="Install.htm">install
- Ghostscript</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="General_overview"></a>General overview</h2>
-
-<p>
-This document describes how to build a Ghostscript executable from source
-code. There are four major steps to building Ghostscript:</p>
-
-<ol>
-<li>Acquire the compressed archive files of source code for Ghostscript.</li>
-<li>Unpack the archive files into the Ghostscript directory.</li>
-<li>Configure the build to match your system and desired configuration options.</li>
-<li>Invoke "<code>make</code>" to build the software.</li>
-</ol>
-
-<p>
-The remainder of this document describes each of these steps in detail.
-Note that some of this process is platform-dependent. After building
-Ghostscript you must then install it; for that, see the
-<a href="Install.htm">installation instructions</a>.</p>
-<p>
-Long term users of Ghostscript may notice the instructions for a number of
-older systems have been removed from this document. There is no value judgment
-implied in this, but recognition that the build system has changed considerably
-in recent years, and several of these legacy systems are no longer easily
-available to the development team. We will always consider contributions to
-continue support for legacy systems.</p>
-<hr>
-
-<h2><a name="Acquiring"></a>How to acquire the source code</h2>
-
-<p>
-Building Ghostscript requires the Ghostscript source code itself, and in
-some cases the source code for the third-party libraries that
-Ghostscript uses.</p>
-
-<p><a name="Authoritative_distribution_site"></a>
-Official releases can be found under the AGPL license at</p>
-
-<blockquote>
-<a href="http://ghostscript.com/download/"
-class="offsite">http://ghostscript.com/download/</a>
-</blockquote>
-
-<p>
-Ghostscript source code is packaged in gzip-compressed tar archives (*<code>.tar.gz</code>).
-(Unlike earlier versions, Ghostscript packages are now one, complete archive, including font files
-and third party library dependency sources).</p>
-
-<blockquote>
-<code>ghostscript-</code>#.##<code>.tar.gz</code><br>
-</blockquote>
-
-<p>
-("#.##" are version numbers.)
-Software to decompress and extract both formats is available for almost
-every platform for which Ghostscript is available -- including Unix, Linux,
-MS Windows, and so on -- but it's up to you to locate that software.
-See the section on <a
-href="#Unpack">unpacking the source code</a>.</p>
-<hr>
-<h2><a name="Acquiring_git"></a>How to acquire the development source code</h2>
-<p>
-The Ghostscript team use <a href="http://git-scm.com/">git</a> for version
-control.</p>
-<p>
-If you require a snapshot of the development code, the easiest way to get it
-is to visit the web interface to our <code>git</code> repository:
-<a href="http://git.ghostscript.com/?p=ghostpdl.git;a=summary">ghostpdl.git</a>
-and click the &quot<code>snapshot</code>&quot link next to the specific commit
-in which you are interested. After a short delay, that will download a complete
-source tree for the given commit in a <code>gzipped</code> <code>tar</code>
-archive.</p>
-<p>
-If you require access to several commits, or wish to regularly access the
-latest development code, you are better to clone the entire <code>git</code>
-repository, using:</p>
-<blockquote>
-<code>git clone git://git.ghostscript.com/ghostpdl.git</code>
-</blockquote>
-<p>which will create a local, read-only repository.</p>
-<p>
-Both the &quot<code>snapshot</code>&quot and the <code>git clone</code> methods
-download the <code>Ghostscript</code> sources as part of the <code>GhostPDL</code>
-source tree, which includes the <code>PCL/PXL</code> and <code>XPS</code>
-interpreters also built on top of the <code>Ghostscript</code> graphics library.</p>
-<p>
-The <code>configure</code> script discussed later in the document is created as
-part of the <code>Ghostscript</code> release process, and as the source tree
-retrieved from <code>git</code> is &quotpre-release&quot code, it does not
-include a pre-made <code>configure</code> script. See <a href="#autogen_sh">autogen.sh</a></p>
-<hr>
-
-<h2><a name="Unpack"></a>How to unpack the source code</h2>
-
-<p>
-Unfortunately, there are no generally accepted standards for how to package
-source code into archives, so the instructions for unpacking Ghostscript are
-longer than they should be. We begin with a brief explanation of how to
-extract the two kinds of archive files.</p>
-
-<h3><a name="Tarfiles"></a>How to unpack compressed tar files generally</h3>
-
-<p>
-Tar (<code>.tar</code>) files are the <em>de facto</em> standard for
-archiving files on Unix (every Unix-like system has the <code>tar</code>
-program), and programs to extract their contents are also widely available
-for MS Windows, and most other environments. To economize on space and downloading
-time, Ghostscript's tar files are compressed with GNU <code>gzip</code>, which
-adds the suffix "<code>.gz</code>" to the file name, giving
-"<code>.tar.gz</code>".</p>
-
-<p>
-To unpack a compressed tar file <code>MyArchive.tar.gz</code> you
-must both decompress it and extract the contents. You can do this in two
-steps, one to decompress the file and another to unpack it:</p>
-
-<blockquote>
-<code>gzip -d MyArchive.tar.gz</code>
-<br><code>tar -xf MyArchive.tar</code>
-</blockquote>
-
-<p>
-or in a pipeline:</p>
-
-<blockquote>
-<code>gzip -d -c MyArchive.tar.gz | tar -xf -</code>
-</blockquote>
-
-<p>
-or, if you have a program like GNU <code>tar</code> that can handle
-compressed tar files, with a single command:</p>
-
-<blockquote>
-<code>tar -zxf MyArchive.tar.gz</code>
-</blockquote>
-
-<p>
-The <code>tar</code> program automatically preserves directory structure
-in extracting files. The Ghostscript source archive puts all files under a
-directory <code>ghostscript-</code>#.##, so using <code>tar</code> to unpack a
-compressed archive should always properly create that directory, which we
-will call the "ghostscript directory". Make sure you're positioned in the
-<b><em>parent</em></b> of the ghostscript directory <b><em>before</em></b> unpacking
-the files. If a subdirectory doesn't already exist, <code>tar</code>
-creates it.</p>
-<p>
-Some other programs – under MS Windows, for instance – can also unpack
-compressed tar files, but they may not automatically preserve directory
-structure nor even extract files into the current directory. If you use
-one of these, you must</p>
-
-<ul>
- <li>set the program's options to "Use folder names" or the equivalent, and</li>
- <li>check that it is extracting files into the right place.</li>
-</ul>
-
-<p>
-As both <code>tar</code> and <code>gzip</code> formats are now well supported
-by several applications on MS Windows, we only supply the <code>tar.gz</code> archive.</p>
-
-<blockquote>
-<p>
-<a href="http://www.winzip.com">
-WinZip</a></p>
-<p>
-<a href="http://www.7-zip.org/">
-7-zip</a></p>
-<p>
-<a href="http://www.info-zip.org/">
-Info-ZIP</a></p>
-</blockquote>
-
-<p>
-are respectively a commercial and two free applications which can decompress and extract
-<code>.tar.gz</code> archives on MS Windows.</p>
-
-<h3><a name="Unpack_Ghostscript"></a>How to unpack Ghostscript itself</h3>
-
-<p>
-At this point you have <a href="#Acquiring">acquired the source code</a>
-and are ready to unpack it according to the <a href="#Tarfiles">preceding guidelines</a>. To unpack the Ghostscript
-source, make the <b><em>parent</em></b> of the (new) gs directory the current directory.</p>
-
-<blockquote><table>
-<tr><th align="left" valign="top">2-step:</th>
-
- <td><code>gzip -d ghostscript-</code>#.##<code>.tar.gz</code><br><code>tar -xf ghostscript-</code>#.##<code>.tar</code></td></tr>
-<tr><th align="left" valign="top">Pipe:</th>
-
- <td><code>gzip -d -c ghostscript-</code>#.##<code>.tar.gz | tar -xf -</code></td></tr>
-
-<tr><th align="left" valign="top">GNU tar:</th>
-
- <td><code>tar -zxf ghostscript-</code>#.##<code>.tar.gz</code></td></tr>
-</table></blockquote>
-
-<p>
-All the Ghostscript source files are now in subdirectories of the gs
-directory.</p>
-
-<blockquote><table>
- <tr><th colspan="2">Ghostscript Core Source subdirectories</th></tr>
- <tr><th valign="bottom" align="left">Subdirectory</th>
- <th valign="bottom" align="left">Contents</th></tr>
- <tr><td><code>arch/</code></td>
-
- <td>Pre-defined architecture header files</td></tr>
- <tr><td><code>base/</code></td>
-
- <td>Graphics library C source code and makefiles</td></tr>
- <tr><td><code>contrib/</code></td>
-
- <td>Community contributed/supported output devices</td></tr>
- <tr><td><code>devices/</code></td>
-
- <td>The output devices supported by the Ghostscript team</td></tr>
- <tr><td><code>psi/</code></td>
-
- <td>PS interpreter C source code and makefiles</td></tr>
- <tr><td><code>Resource/</code></td>
-
- <td>Postscript initialization, resource and font files</td></tr>
- <tr><td><code>lib/</code></td>
-
- <td>PostScript utilities and scripts used with Ghostscript</td></tr>
- <tr><td><code>doc/</code></td>
-
- <td>Documentation</td></tr>
- <tr><td><code>man/</code></td>
-
- <td>Unix <code>man</code> pages</td></tr>
- <tr><td><code>examples/</code></td>
-
- <td>Sample PostScript files</td></tr>
- <tr><td><code>iccprofiles/</code></td>
-
- <td>Default set of ICC profiles</td></tr>
- <tr><td><code>windows/</code></td>
-
- <td>Visual Studio for Windows specific project and solution files</td></tr>
- <tr><td><code>toolbin/</code></td>
-
- <td>Useful (non-Postscript) tools, mostly for developer use only</td></tr>
-</table>
-</blockquote>
-
- <p>Optionally, if you downloaded the GhostPDL archive, you may also have:</p>
-
-<blockquote><table>
-<tr><th colspan=2>Additional GhostPDL source subdirectories</th></tr>
- <tr><th valign="bottom" align="left">Subdirectory</th>
-
- <th valign="bottom" align="left">Contents</th></tr>
- <tr><td><code>pcl/</code></td>
-
- <td>PCL/PXL interpreter C source code, makefiles, fonts etc</td></tr>
- <tr><td><code>xps/</code></td>
-
- <td>XPS interpreter C source code and makefiles</td></tr>
-</table>
-</blockquote>
-
-<p>Supporting third party libraries will also be in their own sub-directories (e.g. <code>jpeg</code>, <code>freetype</code> and so on).</p>
-
-<hr>
-
-<h2><a name="Bug_check"></a>How to check for post-release bug fixes</h2>
-
-<p>
-Bug information and fixes are tracked on Ghostscript Bugzilla.
-For more information, please visit</p>
-
-<blockquote>
-<a href="http://bugs.ghostscript.com">
-http://bugs.ghostscript.com</a>
-</blockquote>
-
-<hr>
-
-<h2><a name="Makefile_overview"></a>How to prepare the makefiles</h2>
-
-<p>
-The Ghostscript makefiles are very large and complex in order to deal with
-the diverse requirements of all the different systems where they may be
-used.</p>
-
-<p>
-Ghostscript has an automatic configuration script. If you're on unix or
-a system that supports unix shell scripts, this is the easiest option to use.
-Simply type:</p>
-
-<blockquote>
-<code>./configure</code>
-</blockquote>
-
-<p>from the top level of the ghostscript source directory. It should configure
-itself based on what's available on your system, warn you of any missing
-dependencies, and generate a Makefile. At this point you can skip to the
-section <a href="#Invoke_make">invoking make</a> below. Also, many common
-configuration options (like install location) can be set through options
-to the configure script.</p>
-
-<p>
-Type '<code>./configure --help</code>' for a complete
-listing. Note that the configuration option is only available with the
-unix .tar distributions of the source.</p>
-
-<p>
-Note that if you're building Ghostscript from development source out of
-a repository instead of from a released source package, you should run
-'<code>./autogen.sh</code>' instead of <code>./configure.</code> This script
-takes all the same options that configure does.</p>
-
-<p>
-If your system doesn't support the configure script or you don't wish to
-use it, you can use the traditional ghostscript makefile system, editing
-the options by hand to match your system as described below.
-Fortunately, the only makefiles you're likely to want to change are
-relatively small ones containing platform-specific information.</p>
-
-<blockquote><a name="Platform-specific_makefiles"></a><table>
- <tr><th colspan="2">Platform-specific makefiles</th></tr>
- <tr><th align="left">Makefile</th>
-
- <th align="left">Used for</th></tr>
- <tr><td><code>Makefile.in</code></td>
-
- <td>Template makefile for the autoconf build</td></tr>
- <tr><td><code>psi/msvc.mak</code></td>
-
- <td>MS Windows with Microsoft Visual Studio 2003 and later.</td></tr>
- <tr><td><code>base/unix-gcc.mak</code></td>
-
- <td>Unix with gcc</td></tr>
- <tr><td><code>base/unixansi.mak</code></td>
-
- <td>Unix with ANSI C compilers other than gcc</td></tr>
-</table>
-</blockquote>
-
-<p>
-A number of platform indepdent makefiles in each of the core Ghostscript source directories.
-Since these files can change from one Ghostscript version to another, sometimes
-substantially, and since they all include documentation for the various
-options, here we don't duplicate most of that documentation: we recommend
-strongly that you review the entire makefile specific for your operating
-system and compiler before building Ghostscript.</p>
-
-<h3><a name="Preparing_makefiles"></a>Changes for your environment</h3>
-
-<p>
-Assuming you have opted not to use the <code>configure</code> script or
-the default Microsoft Visual Studio bulid, you must
-edit the platform-specific makefile to change any of these:</p>
-
-<ul>
-<li>The name of the makefile itself (<code>MAKEFILE</code> macro)</li>
-<li>The locations to install Ghostscript files (<code>prefix</code> etc.)</li>
-<li>The default search paths for the initialization and font files
-(<code>GS_LIB_DEFAULT</code> macro)</li>
-<li>The debugging options (<code>DEBUG</code> and <code>TDEBUG</code>
-macros)</li>
-<li>Which optional features to include (<code>FEATURE_DEVS</code>)</li>
-<li>Which device drivers to include (<code>DEVICE_DEVS</code> and
-<code>DEVICE_DEVS</code>{<em>1--20</em>} macros)</li>
-<li>Default resolution parameters for some printer drivers
-(<code>devs.mak</code> or <code>contrib.mak</code>, whichever defines
-the driver)</li>
-</ul>
-<p> In general these will be set to commonly sensible values already, but
-may not be ideal for your specific case.</p>
-
-<p>
-The <a href="#Platform-specific_makefiles">platform-specific makefiles</a>
-include comments describing all these except the
-<code>DEVICE_DEVS</code> options. These are described in
-<code>devs.mak</code> and <code>contrib.mak</code>, even though the
-file that must be edited to select them is the <a
-href="#Platform-specific_makefiles">platform-specific makefile</a>.</p>
-
-<p>
-Some platform-specific options are described in the sections for individual
-platforms. See the "Options" section near the beginning of the relevant
-makefile for more information.</p>
-
-<h3><a name="Features_and_devices"></a>Selecting features and devices</h3>
-
-<p>
-You may build Ghostscript with any of a variety of features and with any
-subset of the available device drivers. The complete list of features is
-in a comment at the beginning of <code>gs.mak</code>, and the complete
-list of drivers in comments at the beginning of <code>devs.mak</code>
-and <code>contrib.mak</code>. To find what devices a platform-specific
-makefile selects to include in the executable, look in it for all lines of
-the form</p>
-
-<blockquote>
-<code>FEATURE_DEVS=</code><em>{list of features}</em><br>
-<code>DEVICE_DEVS</code>*<code>=</code><em>{list of devices}</em>
-</blockquote>
-
-<p>
-For example, if the makefile has</p>
-
-<blockquote><code>
-FEATURE_DEVS=&#36;(PSD)level2.dev
-</code></blockquote>
-
-<p>
-indicating that only the PostScript Level 2 facilities should be included,
-you might make it</p>
-
-<blockquote><code>
-FEATURE_DEVS=&#36;(PSD)level2.dev &#36;(PSD)pdf.dev
-</code></blockquote>
-
-<p>
-to add the ability to interpret PDF files. (In fact,
-<code>FEATURE_DEVS</code> in the current Unix makefiles already includes
-<code>&#36;(PSD)pdf.dev</code>.).</p>
-
-<p>
-It is extremely important that FEATURE_DEVS is set correctly. Currently,
-the default builds will include a complete feature set, and as such most
-of those building Ghostscript will have no need to change it. Only those
-working in heavily resource constrained environment will want to experiment,
-and it is vital that the implications of such changes be understood, otherwise
-Ghostscript may behave in unexpected or apparently incorrect ways, or may
-even fail to build.</p>
-
-<p>
-The Unix makefile also defines</p>
-
-<blockquote><code>
-DEVICE_DEVS=&#36;(DD)x11.dev
-</code></blockquote>
-
-<p>
-indicating that the X Windows driver should be included, but since
-platform-specific makefiles as distributed normally include many of the
-possible features and drivers, you will probably rather remove from the
-makefile the features and drivers you don't want. It does no harm to
-include unneeded features and devices, but the resulting executable will be
-larger than needed.</p>
-
-<p>
-You may edit the <code>FEATURE_DEVS</code> line to select or omit any of
-the features listed near the beginning of <code>gs.mak</code>, and the
-<code>DEVICE_DEVS</code>* lines to select or omit any of the device
-drivers listed near the beginning of <code>devs.mak</code> and
-<code>contrib.mak</code>. GS_DEV_DEFAULT is a string containing whitespace
-separate device names, and give the devices Ghostscript should attempt to use
-(and the order) if no device is specified on the command line;
-see the usage documentation for <a href="Use.htm#Output_device">how to
-select an output device</a> at run time using the
-<a href="Use.htm#DEVICE_switch"><code>-sDEVICE=</code></a> switch. If
-you can't fit all the devices on a single line, you may add lines defining</p>
-
-<blockquote>
-<code>DEVICE_DEVS1=&#36;(DD)</code><em>{dev11}</em><code>.dev</code> ... <code>&#36;(DD)</code><em>{dev1n}</em><code>.dev</code>
-<br><code>DEVICE_DEVS2=&#36;(DD)</code><em>{dev21}</em><code>.dev</code> ... <code>&#36;(DD)</code><em>{dev2n}</em><code>.dev</code>
-</blockquote>
-
-<p>
-etc., up to <code>DEVICE_DEVS15</code>. Don't use continuation lines --
-on some platforms they don't work.</p>
-
-<p>
-Note that if you want to include a driver named <em>xxx</em>, you must put
-<code>&#36;(DD)</code><em>xxx</em><code>.dev</code> in
-<code>DEVICE_DEVS</code>*. Similarly, if you want to include a feature
-related to the PostScript or PDF language interpreters (PostScript level
-1 .. 3, or other language features such as the ability to read EPSF files or
-TrueType font files), you must represent it as
-<code>&#36;(PSD)</code><em>xxx</em><code>.dev</code>.</p>
-
-<h4><a name="Precompiled_data"></a>Precompiled run-time data</h4>
-
-<p>
-Ghostscript normally reads a number of external data files at run time:
-initialization files containing PostScript code, fonts, and other resources
-such as halftones. By changing options in the top-level makefile for the
-platform, you can cause some of these files to be compiled into the
-executable: this simplifies installation, improves
-security, may reduce memory requirements, and may be essential if you are
-planning on putting Ghostscript into ROM. Compiling these files into the executable
-also means the executable is (largely) self-contained, meaning initialization
-files, font files, resource files and ICC profile files are certain to be available
-and accessible. In general, Ghostscript should initialize more quickly, and files
-(especially PDF) files making heavy use of the built-in fonts will interpret more
-quickly.</p>
-<p>
-For those distributing Ghostscript binaries, compiling those files into the executable
-has another implication, any site-specific customizations (such as font and CIDFont
-substitutions) are slightly more complex to implement - see:</p>
-<blockquote>
-<a href="Use.htm#Finding_files">How Ghostscript finds files</a>
-</blockquote>
-<p>for how to influence where Ghostscript searches for files. Furthermore, if the files
-Ghostscript uses are also required to be accessible by applications other than Ghostscript
-(the mostly case for this would be font files and ICC profile files), having those files
-compiled into Ghostscript maybe suboptimal, essentially require two copies of the file
-data to be distributed (one set built into Ghostscript, and the other as &quotnormal&quot files
-accessible outside of Ghostscript.</p>
-
-<p>
-Compiling the initialization files (<code>Resource/Init/gs_init.ps</code>, etc.)
-into the executable is the default. To disable this, change the <code>1</code> to
-a <code>0</code> in the line</p>
-
-<blockquote><code>
-COMPILE_INITS=1
-</code></blockquote>
-
-<p>
-Or, if you use the <code>configure</code> based Unix-style build, you can disable
-COMPILE_INITS by adding the option <code>--disable-compile-inits</code> to the invocation
-of <code>configure</code></p>
-<p>
-Files are now compiled into the executable as a %rom% file system that can
-be searched, opened, etc. as with the normal (%os%) file system. The data
-is (mostly) compressed. Several of the initialisation files (those in <code>Resource/Init</code>)
-are also converted to binary Postscript encoding, and &quot;merged&quot; into a single monolithic
-file - this is done for both size and speed optimization. Files that are often customized for
-individual installations (such as <code>Fontmap</code> and <code>cidfmap</code>) are not
-merged into the single file and thus installation specific versions can be used.</p>
-<p>
-The set of files built into the %rom% file system
-is specified in the <code>psi/psromfs.mak</code> file. By default the set
-of files built into the rom file system comprises all the resource files
-Ghostscript requires to run successfully (all the files under <code>Resource</code>
-directory, and those under the <code>iccprofiles</code> directory). Refer to the file
-<code>base/mkromfs.c</code> for a description of the parameters that
-control source and destination pathnames, file enumeration exclusion,
-compression, etc.</p>
-
-<p>
-Fonts normally are compiled into the executable using <code>mkromfs</code>
-(above) from the Resource/Font/ directory.</p>
-
-<p>
-Similarly, Halftone resources can be compiled into the executable using
-<code>mkromfs</code>, but also threshold-array halftones can be compiled
-into the executable. See the "Compiled halftone" section of <code>int.mak</code>
-for a sample makefile fragment, <code>genht.c</code> for the syntax of
-halftone data files, and <code>lib/ht_ccsto.ps</code> for a sample data file.
- Note that even though the data files use PostScript syntax, compiled halftones
-do not require the PostScript interpreter and may be used with the graphics
-library alone.</p>
-
-<h3><a name="Makefile_setup"></a>Setting up "makefile"</h3>
-
-<p>
-After going through the steps just described to <a href="#Unpack">unpack
-the sources</a>, configure the build and make any desired
-<a href="#Preparing_makefiles">changes to the makefiles</a>.
-As the final step in preparing to build Ghostscript you must usually
-associate the name "<code>makefile</code>" with the correct makefile
-for your environment so the <code>make</code> command can find it.
-See the section on your particular platform for how to do that if
-necessary.</p>
-
-<p>
-On unix systems, <code>./configure</code> (or if checked out of git,
-<code>./autogen.sh</code>) should create a <code>Makefile</code> which works
-in most scenarios. Manual tampering and editing should rarely be needed
-nor recommended.</p>
-
-<h3><a name="Invoke_make"></a>Invoking "make"</h3>
-
-<dl>
- <dt><code>make</code></dt>
- <dd>Builds Ghostscript without debugging options.</dd>
-</dl>
-
-<dl>
- <dt><a name="Debugging"></a><code>make debug</code></dt>
-<dd>Builds Ghostscript with debugging options and additional internal error
-checks. The program will be somewhat larger and slower, but it will behave
-no differently unless you actually turn on debugging options at execution
-time with the <code>-DDEBUG</code> or
-<a href="Use.htm#Debugging"><code>-Z</code> command line switches</a>
- described in the usage documentation.</dd>
-</dl>
-
-<dl>
- <dt><code>make pg</code></dt>
-<dd>On Unix platforms, builds with the <code>-pg</code> compiler
- switch, creating an executable for time profiling.</dd>
-</dl>
-
-<dl>
- <dt><code>make install</code></dt>
- <dd>After building, installs the Ghostscript executables, support files,
- and documentation, but does <b><em>not</em></b> install fonts. See the
- <a href="Install.htm">installation documentation</a>.</dd>
-</dl>
-
-<dl>
- <dt><code>make (debug)clean</code></dt>
- <dd>Deletes all the files created by the build process (relocatables,
- executables, and miscellaneous temporary files). If you've built an
- executable and want to save it, move it first to another place, because
- "<code>make clean</code>" deletes it.</dd>
-</dl>
-
-<dl>
- <dt><code>make so</code></dt>
- <dd>On some platforms (Linux, *BSD, Darwin/Mac OS X, SunOS),
- it is possible to build Ghostscript as a shared object library.
- There is a corresponding "<code>make soclean</code>" for cleaning up.</dd>
-</dl>
-
-<dl>
- <dt><code>make sanitize</code></dt>
- <dd>Builds Ghostscript with AddressSanitizer. Output is placed in ./sanbin .</dd>
-</dl>
-
-<p>
-<b><em>Note:</em></b> on most platforms some of these simple instructions don't
-quite work in one way or another. Read the section on your specific
-platform.</p>
-
-<p>
-<b><em>Note 2:</em></b> If you are attempting to build a statically linked
-executable, you will probably need to add libraries to the linker options
-(libraries that are normally pulled-in automatically by the dynamic linker).
-These can be added at the make command line using the "EXTRALIBS=" option.
-Unfortunately, the set of libraries that may be required varies greatly
-depending on platform and configuration, so it is not practical to offer
-a list here.</p>
-
-<h3><a name="Cross-compiling"></a>Cross-compiling</h3>
-<p>
-Cross-compiling is not fully supported by the <code>configure</code> script (such
-support is a work-in-progress).</p>
-<p>
-You can either use <code>base/unixansi.mak</code> or <code>unix-gcc.mak</code>
-as the basis for a cross-compile makefile, or use <code>configure</code> to
-create a basic <code>Makefile</code> as the basis. And modify to suit.</p>
-<p>
-You can set the compiler to your cross-compiler for <code>configure</code> by doing:</p>
-<blockquote>
-./configure CC=&ltcross-compiler executable&gt
-</blockquote>
-<p>
-and <code>configure</code> will then run its checks (as best it can) with the
-cross-compiler.</p>
-<p>
-If you do so, you should also give <code>configure</code> the option to set the
-target architecture endianness: <code>--enable-big-endian</code> or <code>--enable-little-endian</code>.</p>
-<p>
-It would also be wise to review the settings shown in the output of <code>./configure --help</code> for
-any that would be applicable to your target.</p>
-<br>
-<br>
-<p>
-The Ghostscript build system uses several interim executables, built and run on the <code>host</code>,
-as such, even when cross-compiling, a <code>host native</code> compiler is also required. You must edit
-your <code>makefile</code> to ensure that is available. Find the line that starts:</p>
-<blockquote>
-CCAUX=
-</blockquote>
-<p>
-and set that to your <code>host compiler</code>.</p>
-<p>
-If you did not use <code>configure</code> or did not set the <code>CC</code> variable for <code>configure</code>,
-you must also set the:</p>
-<blockquote>
-CC=
-</blockquote>
-<p>
-to your cross-compiler.</p>
-<p>
-The Ghostscript build system uses a utility called <code>genarch</code>
-(see <code>base/genarch.c</code> for details) to interrogate the environment and
-generate a header file describing the architecture for which Ghostscript is being
-built. As this is run on the <code>host</code> it will generate header for the
-<code>host architecture</code> rather than that of the <code>target</code>.</p>
-<p>
-For cross compiling, you must create (or modify) a header file (<code>arch.h</code>)
-which accurately describes the <code>target architecture</code>. Then you must
-edit your <code>makefile</code> by finding the line:</p>
-<blockquote>
-TARGET_ARCH_FILE=
-</blockquote>
-<p>
-and set it to the path to, and file name of your custom <code>arch.h</code> file. With that
-setting, <code>genarch</code> will still be run, but rather than interrogate the current environment,
-it will copy the contents of your custom <code>arch.h</code> to the build.</p>
-
-<hr>
-
-<h2><a name="PC_build"></a>How to build Ghostscript from source (PC version)</h2>
-
-<p>
-All Ghostscript builds in PC (DOS and MS Windows) environments are 32- or
-64-bit: 16-bit builds are not supported. The relevant makefiles are</p>
-
-<blockquote><table>
- <tr><th colspan="3">PC makefiles</th></tr>
- <tr><th align="left">Makefile</th>
-
- <th align="left">Construction tools</th>
-
- <th align="left">For environment</th></tr>
- <tr><td valign="top"><code>msvc.mak</code></td>
-
- <td valign="top"><a href="#Microsoft_build">Microsoft Visual Studio .NET 2003 (or later)</a></td>
-
- <td valign="top">MS Windows 32/64-bit</td></tr>
- <tr><td valign="top"><code>Makefile.in</code></td>
-
- <td valign="top"><a href="#Cygwin_build">Cygwin/gcc</a></td>
-
- <td valign="top"><a href="https://www.cygwin.com/">Cygwin</a> (Use Unix <code>configure</code>)</td></tr>
-</table></blockquote>
-
-<p>
-Ghostscript requires at least MS Windows 95 (although we no longer actively test nor
-support Win95, we have not deliverately done anything to break compatibility with it).
-We recommend at least MS Windows NT 4.0.</p>
-<p>
-For building, Ghostscript requires at least Visual Studio .NET 2003, and we recommend
-at least Visual Studio 2005 (required for 64 bit Windows support).</p>
-<p>
-Note that the <code>make</code> program supplied with Visual Studio (and earlier
-Visual C++ versions) is actually called <code>nmake</code>. We refer to this
-program generically as <code>make</code> everywhere else in this document.</p>
-
-<p>
-You must have <code>cmd.exe</code> in your path to build Ghostscript (using
-the Visual Studio command prompt is ideal). After making any changes required to choose
-features and devices to build into the executable, you can then invoke <code>make</code>
-to build the executable.</p>
-
-<p><a name="Make_windows"></a></p>
-
-<h3><a name="Microsoft_build"></a>Microsoft Visual Studio</h3>
-
-<h4><a name="Using_the_MS_Development_Environment"> </a><u>Using Microsoft Visual Studio</u></h4>
-<p>
-The Ghostscript source distribution ships with <code>project</code> and <code>solution</code>
-files for Visual Studio 2005 and later. These can be found in the <code>windows</code> directory.
-The <code>project(s)</code> are <code>nmake projects</code> which means that rather than Visual
-Studio controlling the build directly, it delegates the build process the the <code>nmake</code>.</p>
-<p>
-Beyond lacking support for parallel builds (<code>nmake</code> cannot support parallel builds),
-there should be little visible difference between a conventional VS project and an
-<code>nmake project</code> to the user of the VS graphical interface. The only exception to that
-is if you have to make changes to build options beyond those available in the defined build
-configurations. In that case, you need to find the <code>Nmake</code> tab in the project
-<code>Property Pages</code> and modify the appropriate entry: <code>Build Command Line</code>,
-<code>Rebuild All Command Line</code> and/or <code>Clean Command Line</code>.</p>
-<p>
-As mentioned above, <code>nmake</code> does not support parallel builds. If you
-have downloaded and are building the <code>GhostPDL</code> source archive (which contains
-Ghostscript, GhostPCL, GhostXPS, and GhostPDL "products"), the <code>GhostPDL.sln</code>
-contains individual projects for each product but, as a result of the limitations of <code>nmake</code>
-the products cannot be built in parallel, because <code>nmake's</code> lack of parallel build
-awareness means it cannot manage the dependencies shared between the products, and may fail as multiple
-builds attempt to access the same dependencies.
-<p> To build all the products in one action, use the <code>All</code> &quot;pseudo-project&quot;. The
-<code>All</code> project uses a single <code>nmake</code> invocation to build all the supported products.
-<p>
-NOTE: changing the <code>Output</code> property in the <code>Nmake</code> properties will not
-change the name of the executable - to do that requires editing of the <code>psi/msvc.mak</code>
-makefile, or you can add: <code>GS=myname.exe</code> to the <code>nmake</code> command line.</p>
-
-<h4><a name="Using_the_command_line"></a>Using the command line</h4>
-<p>Ghostscript can be made using the Windows command prompt or one of the various command
-line shells made for Windows, as long as the command line syntax is compatible with the
-Windows <code>CMD.exe</code>. The Visual Studio command prompt is ideal.</p>
-
-<p>In order for the makefiles to work properly, two items may have to be changed.
- An attempt is made to select the correct version of Microsoft Visual C++
- based on the version of nmake. If this doesn't work it will default
- to version 6.x.
- If the auto-detection does not work, and you are not using version 6.x then before building,
- in <code>psi\msvc.mak</code> find the line &quot;<code>#MSVC_VERSION=6</code>&quot; and change it to
- &quot;<code>MSVC_VERSION=4</code>&quot;, &quot;<code>MSVC_VERSION=5</code>&quot;, &quot;<code>MSVC_VERSION=7</code>&quot;
- or &quot;<code>MSVC_VERSION=8</code>&quot; and so on. </p>
-<p>In some cases the location of the Microsoft Developer Studio, needs to be changed.
- The location of Microsoft Developer Studio is defined by the value of <code>DEVSTUDIO</code>.
- There are several different definitions of <code>DEVSTUDIO</code> in psi\msvc.mak.
- There is one for each of the currently supported versions of Microsoft Visual
- C++ (4, 5, 6, 7, 7.1 and 8). </p>
-<p>The normal installation process for Microsoft Visual C++ includes setting the
- location of the Microsoft Visual C++ executables (cl.exe, link.exe, nmake.exe,
- rc.exe) in your PATH definition and the LIB and INCLUDE environment variables
- are set to point to the Microsoft Visual C++ directories. If this is true then
- the value for <code>DEVSTUDIO</code> can be changed to empty. I.e. <code>DEVSTUDIO=</code></p>
-<p> If PATH, LIB, and INCLUDE are not correctly set then the value for <code>DEVSTUDIO</code>
- needs to be defined. For example, for version 6.0, the default definition for
- the location for the Microsoft Developer Studio is: <code>DEVSTUDIO=C:\Program
- Files\Microsoft Visual Studio </code> If the path to Microsoft Developer Studio
- on your system differs from the default then change the appropriate definition
- of <code>DEVSTUDIO</code>. (Remember that there is a separate definition
- of <code>DEVSTUDIO</code> for each version of MSVC, so be sure to change
- the correct definition.) </p>
-<p>To run the <code>make</code> program, give the command </p>
-<blockquote><code>
-nmake -f psi\msvc.mak
-</code></blockquote>
-
-<p>
-Rather than changing psi/msvc.mak, these values can also be specified on
-the make command line, I.e.</p>
-
-<blockquote><code> nmake -f psi\msvc.mak MSVC_VERSION=6 DEVSTUDIO=&quot;C:\Program Files\Microsoft Visual Studio&quot; <br>
-nmake -f psi\msvc.mak MSVC_VERSION=7 DEVSTUDIO=&quot;C:\Program Files\Microsoft Visual Studio .NET&quot;
- </code></blockquote>
-
-<p> Note that double quotes have been added around the path for <code>DEVSTUDIO</code>
- due to the spaces in the path value.</p>
-<p>
-This command line can also be put into a batch file.</p>
-
-<p> You may get warning messages during compilation about various undefined
-and/or unsupported switches - this is because the compiler switches are set
-in the makefiles, and are applied when building with all versions of Visual
-Studio, but not all options are supported (or required) by all versions of
-Visual Studio. These warnings are benign and can be ignored.</p>
-
-<h3><a name="Microsoft_build_64"></a>Microsoft Environment for 64-bit</h3>
-
-<p>Building Ghostscript for 64-bit Windows (AMD64 processor) requires
-Microsoft Visual Studio .NET 2005 or Microsoft Visual Studio 2008 or later
-on 64-bit Windows. Cross compiling on 32-bit Windows is possible.</p>
-<p>
-Compiling for 64-bit is similar to the
-<a href="#Microsoft_build">Microsoft Environment</a> instructions above,
-but with the addition of a WIN64 define.</p>
-
-<p>To make ghostscript use</p>
-<blockquote><code>
- nmake -f psi/msvc.mak WIN64=
-</code></blockquote>
-
-<h4><a name="Self-extracting_executables"></a>Making self-extracting installers</h4>
-
-<p>
-You can build self-extracting Windows installers based on
-<code>NSIS (Nullsoft Scriptable Install System)</code>. To do so, use the <code>nsis</code>
-makefile taget as well as any other options, for example:</p>
-<blockquote><code>
- nmake -f psi/msvc.mak WIN64= nsis
-</code></blockquote>
-<p>
-will create an <code>nsis</code> based installer for Ghostscript built for 64 bit Windows
-systems.</p>
-
-<h3><a name="Microsoft_build_winrt"></a>Microsoft Environment for WinRT</h3>
-
-<p>
-Ghostscript can be built in the form of a win32 DLL for use within a Windows Runtime
-application or Windows Runtime component. Building for WinRT requires use of
-Microsoft Visual Studio 2012. There is a solution file that can be loaded into VS 2012,
-in the directory <code>winrt</code></p>
-
-<p>
-The WinRT application or component should include <code>iapi.h</code> from
-<code>gs/psi</code> and link with <code>gsdll32metro.lib</code> from
-<code>gs/debugbin</code> or <code>gs/releasebin</code>. Also any app using
-ghostscript either directly or via a component should add <code>gsdll32metro.dll</code>
-as &quot;content&quot;. This inclusion of the dll is necessary so that it
-will be packaged with the app. If one wishes to be able to run the debugger on
-ghostscript then <code>gsdll32metro.pdb</code> should also be added as content.</p>
-
-<h3><a name="Cygwin32_build"></a>Cygwin32 gcc</h3>
-
-<p>
-It is possible to compile Ghostscript for MS Windows using the Cygwin32 gcc compiler,
-GNU <code>make</code>, using the "configure" generated Makefile.</p>
-
-<p>
-Information about this compiler and environment is at the Cygwin site:</p>
-
-<blockquote>
-<a href="http://www.cygwin.com/">http://www.cygwin.com/</a>
-</blockquote>
-
-<h4><a name="MSys/Mingw"></a>MSys/Mingw</h4>
-<p>The configure build can be used to build Ghostscript on MSys/Mingw systems,
-but with a caveat. The msys-dvlpr adds header files into the compiler's header
-search paths which cause a clash, and the build will fail as a result. If you
-have the msys-dvlpr package installed, and until a better solution is available
-you can work around this by temporarily renaming the "\mingw\msys\1.0\include"
-directory so those headers are no longer found by the compiler.</p>
-
-<hr>
-
-<h2><a name="Mac_build"></a>How to build Ghostscript from source (MacOS version)</h2>
-
-<h3><a name="MacOSX"></a>MacOS X</h3>
-
-<p>
-The unix source distribution (.tar.gz) builds fine on Darwin/MacOS X,
-albeit without a display device. You can generally just use the <tt>Makefile</tt>
-generated by <tt>configure</tt> as your top-level makefile and get a reasonable default
-build. This will allow you to use Ghostscript from the command line as a BSD-layer
-tool to rasterize postscript and pdf to image files, and convert between the
-high-level formats supported by Ghostscript. See the instructions for the
-unix build below for details of how to customize this build.</p>
-<p>
-NOTE: If you have MacPorts (http://www.macports.org/) installed, it can
-"confuse" the configure script because it includes some librares which
-duplicate the "system" ones. This can cause missing symbol link errors.
-In order to resolve this, you can do:<code> LDFLAGS="-L/usr/lib" ./configure</code>.
-That will force the linker to search the default directory first, and thus pick
-up the system libraries first.</p>
-<p>
-It is also possible to build "universal binaries" for MacOS X, containing <code>i386</code>
-and <code>x86_64</code> binaries in one file, using the <code>Makefile</code>
-from <code>configure</code>. This can be achieved by using the following invokation of
-<code>configure</code></p>
-<blockquote>
-<code>
-./configure CC="gcc -arch i386 -arch x86_64 -arch ppc" CPP="gcc -E"
-</code>
-</blockquote>
-<p>
-You can choose the combination of valid architectures (i386/x86_64/ppc) that you
-require.</p>
-<p>
-The separate options for <tt>CC</tt> and <tt>CPP</tt> are required because some of
-the features used by <tt>configure</tt> to explore the capabilities of the preprocessor
-are not compatible with having multiple <tt>-arch</tt> options.</p>
-<p>
-Building a shared library on MacOS X is the same as for other Unix-like systems, the
-"configure" step is done normally, and the "so" target is given to the make invocation,
-thus:</p>
-<blockquote>
-<code>
-make so
-</code>
-</blockquote>
-<p>The only difference compared to other Unix-like systems is that on OS X the resulting
-shared library is created with the ".dylib" file name extension, instead of the more
-usual ".so".</p>
-
-<hr>
-
-<h2><a name="Unix_build"></a>How to build Ghostscript from source (Unix version)</h2>
-
-<p>
-Ghostscript now ships with a build system for unix-like operating systems
-based on GNU Autoconf. In general the following should work to configure
-and build Ghostscript:</p>
-
-<blockquote><pre>
-./configure
-make
-</pre></blockquote>
-
-<p>or</p>
-
-<blockquote><pre>
-./configure
-make so
-</pre></blockquote>
-
-<p>for building ghostscript as a shared library.</p>
-
-<p>Please report any problems with this method on your system as a bug.</p>
-
-<p>
-On modern unix systems, <code>./configure</code>
-should create a <code>Makefile</code> which works
-in most scenarios. Manual tempering and editing should rarely be needed
-nor recommended.</p>
-
-<p>
-<a name="autogen_sh"></a>
-Note that if you're building Ghostscript from development source out of
-a repository instead of from a released source package, you should run
-'<code>./autogen.sh</code>' instead of <code>./configure.</code> This script
-takes all the same options that configure does.</p>
-
-<p>
-(deprecated; see Autoconf-based method above)
-For the convenience of those already familiar with Ghostscript, the old method
-based on hand-edited makefiles is still possible but no longer supported
-(and in many cases, simply do not work without substantial
-expert manual-editing effort). It may also be helpful in
-getting Ghostscript to build on very old platforms. The rest of this section deals exclusively
-with that older method and includes numerous pointers regarding legacy systems.</p>
-
-<p>
-(deprecated; see Autoconf-based method above)
-Before issuing the <code>make</code> command to build Ghostscript, you
-have to make some choices, for instance</p>
-<ul>
- <li>which compiler to use;</li>
-<li>what features and devices to include;</li>
-<li>whether to use system libraries for PNG and zlib;</li>
-<li>and how to handle issues for your particular platform.</li>
-</ul>
-
-<p>
-Be sure to check the sections on <a
-href="#Tool_specific_issues">tool-</a>, <a
-href="#OS_specific_issues">OS-</a>, and <a
-href="#Hardware_specific_issues">hardware-</a>specific issues for notes
-on your particular platform and compiler. In fact, that is the
-<b><em>first</em></b> place to check if you build Ghostscript and it crashes
- or produces obviously incorrect results.</p>
-
-<h3><a name="GNU_make"></a>make tools</h3>
-
-<p>
-You require a make tool which supports separate directories for
-the derived objects (such as object files, executables and dynamically created
-header files) and the source files.</p>
-<p>
-In general, GNU make is the recommended choice, and some features (such as the
-building of the Linux/Unix shared library build ("make so") are only available
-with GNU make.</p>
-<p>
-Other <code>make</code> implementations are known to work, but are not guaranteed
-to do so.</p>
-<p>
-<u><a name="GNU_make"></a>GNU make</u></p>
-<p>
-Current versions of GNU <code>make</code> have no problems building
-Ghostscript.</p>
-
-<h3><a name="OS_specific_issues"></a>OS-specific issues</h3>
-
-
-<h4><a name="HP_RISC"></a>H-P RISC workstations</h4>
-
-
-
-<p>
-(see Autoconf-based method above)</p>
-<ul>
-<li>HP-UX versions before 11.0 do not support POSIX threads. Set
- <code>SYNC=nosync</code> in the makefile before building.</li>
-
-<li>Ghostscript builds on H-P machines with either GNU gcc or H-P's
-ANSI-capable <code>cc</code>. The minimal, non-ANSI-capable
-<code>cc</code> that shiped with some basic HPUX system does <em>not</em>
-work. If <code>cc</code> on your system doesn't accept the
-<code>-Aa</code> switch, then you need to get the full
-<code>cc</code> or gcc.</li>
-
-<li>If you use H-P's compiler, be sure you have upgraded to a recent
-release. Many bizarre symptoms have been reported trying to build
-Ghostscript with older, buggier compilers, for example:</li>
-
-<li>
-<ul>
-<li>The link step fails with a message about "<code>max</code>" not being defined.</li>
-<li>The build succeeds, but the resulting executable fails to start up,
-with an error message like "Initializing... Unrecoverable error: typecheck
-in .registerencoding".</li>
-<li>The build succeeds, but the resulting executable produces a black
-background on the first page of output.</li>
-</ul>
-</li>
-
-<li>It is reported that On HPUX 9.* you need at least compiler patch
-PHSS_5723 and dld.sl patch PHSS_5734 to build Ghostscript. (As of late
-1997, those patches are long obsolete; the current patches are compiler
-PHSS_10357 and dld.sl PHSS_11246. It is unknown whether current
-Ghostscript releases work with compiler/dld.sl versions older than these.)</li>
-
-<li>On HPUX 10.*, we don't know what combinations of compiler version and
-switches work. It is reported that On HPUX 10.20, setting
-"<code>CC=c89</code>" and "<code>CFLAGS=+O3&nbsp;&#36;(XCFLAGS)</code>"
-works, contradicting the information in the next paragraph, but this may be
-dependent on the specific compiler version.</li>
-
-<li>In either HPUX version, you need to set
-"<code>CC=cc&nbsp;-Aa</code>" (or use <code>-Ae</code> if you
-prefer), and set
-"<code>CFLAGS=-D_HPUX_SOURCE&nbsp;-O&nbsp;&#36;(XCFLAGS)</code>". Higher
-levels of optimization than <code>-O</code> may work depending on your
-compiler revision; some users have reported success with
-<code>+O3</code>, some have not.</li>
-
-<li>Some users have reported needing <code>-DNOSYSTIME</code> and
-<code>-D_POSIX_SOURCE</code> in <code>CFLAGS</code>, but recent tests
-do not show these to be necessary.</li>
-
-<li>If you use gcc, it's a good idea to have a recent release -- at the
-very least 2.7.2.1 or later.You may be able to get a working
-executable with an older gcc by removing <code>-O</code> from
-<code>CFLAGS</code>.</li>
-</ul>
-
-<h4><a name="IBMAIX"></a>IBM AIX</h4>
-<p>
- We recommend installing gcc and GNU make, and using the Autoconf-based method.</p>
-<p>
-Other combinations are known to work, but are less well supported.</p>
-<p>
-Recent veresions of Ghostscript can trigger a 'TOC overflow' error with some compilers
-on AIX. If this occurs, use the linker flag "-bbigtoc", which can either be added to
-your configure options:
-<p><code>configure LDFLAGS="-Wl,-bbigtoc"</code>
-<p>Or on the make command line:
-<p><code>make XLDFLAGS="-Wl,-bbigtoc"</code>
-<h4>
-<a NAME="Silicon_Graphics"></a>Silicon Graphics</h4>
-<p>
-(see Autoconf-based method above)</p>
-
-<p>
-Users have had a lot of problems with the MIPSpro compilers on SGI systems.
-We recommend using gcc. If you do choose to use the MIPSpro compiler,
-please read the following carefully.</p>
-
-<ul>
-<li>
- To make the optimizer allocate enough table space, set
-
-<p><code>CFLAGS="-Olimit 2500"</code> (for older compilers)
-<br><code>CFLAGS="-OPT:Olimit=2500"</code> (for newer compilers)</p>
-
-<p>
-MIPSpro compiler version 3.19 is "older", and 7.1 is "newer"; we aren't
-sure at what point in between the latter syntax was introduced.</p>
-</li>
-<li>
-With the compiler shipped with Irix 5.2, use the <code>-ansi</code>
- option.</li>
-
-<li>
-The SGI C compiler may produce warnings about "Undefined the ANSI standard
-library defined macro stdin/stdout/stderr". To suppress these warnings, add
-"<code>-woff 608</code>" to the definition of <code>CFLAGS</code>.</li>
-
-<li>
-The SGI C compiler shipped with Irix 6.1 and 6.2 will not compile
-<code>zlib/deflate.c</code> properly with optimization. Compile this file
-separately without <code>-O</code>.</li>
-
-<li>
-With IRIX 6.5.x and the MIPSpro 7.x compilers there have been reports about
-incorrect output and binaries that cause segmentation faults.&nbsp; Various
-solutions have been suggested and you may want to try them in this order,
-until you get a working binary:</li>
-
-<li>
- <ul>
- <li>
- Compile <code>idict.c</code> and <code>isave.c</code> separately
- without optimization after doing a normal compile; then relink.e.g.:
-
- <p>
- <code>cc -OPT:Olimit=2500 -I. -I./obj -o ./obj/idict.o -c ./idict.c</code><br>
- <code>cc -OPT:Olimit=2500 -I. -I./obj -o ./obj/isave.o -c ./isave.c</code></p>
- </li>
- <li>
- Set <code>CFLAGS=</code> (no optimization).</li>
-
- <li>
- Use only <code>-O2</code>.&nbsp;&nbsp; Compiler produces incorrect output
- with <code>-O3</code> or "<code>-Ofast=ip32 -show</code>".</li>
-
- <li>
- Irix 6.5.1m with MIPSpro compiler 7.2.1.1m, Irix 6.5.3m with MIPSpro
- compiler 7.2.1, and probably other 6.5x / 7.2x combinations require
- compiling with the <code>-o32</code> option. Compiling with the (default)
- <code>-n32</code> option produces non-working executables.
- <code>-O2</code> is OK (possibly except for <code>idict.c</code>), but
- not <code>-O3</code>.</li>
- </ul>
-</li>
-</ul>
-
-<h4><a name="Sun"></a>Oracle/Sun</h4>
-<p>
-see Autoconf-based method above)</p>
-
-<ul>
-<li>The Sun unbundled C compiler (SC1.0) doesn't compile Ghostscript
-properly with the <code>-fast</code> option: Ghostscript core-dumps in
-<code>build_gs_font</code>. With that compiler use <code>-g</code>,
-or use gcc instead.</li>
-
-<li>The Sun version of <code>dbx</code> often gives up with an error
-message when trying to load Ghostscript. If this happens, use GNU
-<code>gdb</code> instead. (<code>gdb</code> is more reliable than
-<code>dbx</code> in other ways as well.)</li>
-
-<li>A bug in some versions of <code>zlib</code> results in an undefined
-symbol <code>zmemcmp</code> when compiling with Sun cc. Use gcc
-instead.</li>
-
-</ul>
-
-<h4><a name="Solaris"></a>Solaris</h4>
-
-<ul>
-<li>Solaris 2.2 may require setting "<code>EXTRALIBS=-lsocket</code>".
-Solaris 2.3 and later seem to require "<code>EXTRALIBS=-lnsl&nbsp;-lsocket&nbsp;-lposix4</code>".</li>
-
-<li>For Solaris 2.6 (and possibly some other versions), if you set
-<code>SHARE_LIBPNG=1</code>, <code>SHARE_ZLIB=1</code>, or
-<code>SHARE_JPEG=1</code>, you may need to set
-
-<p>
- <code>XLDFLAGS=-R /usr/local/</code>xxx<code>/lib:/usr/local/lib</code></p>
-
-<p>
-using the full path names of the relevant directories.</p>
-</li>
-
-<li>Solaris 2.<em>n</em> uses <code>/usr/openwin/share/include</code>
-for the X11 libraries rather than <code>/usr/local/X/include</code>.</li>
-
-<li>Solaris 2.<em>n</em> typically has Type 1 fonts in
-<code>/usr/openwin/lib/X11/fonts/Type1/outline</code>.</li>
-
-<li>For Solaris 2.<code>n</code> in the makefile you must change
-the definition of <code>INSTALL</code> from "<code>install&nbsp;-c</code>" to
-"<code>/usr/ucb/install&nbsp;-c</code>".</li>
-
-<li>You may need to set <code>XLIBDIR</code> to the directory that holds
-the X11 libraries, as for other SVR4 systems. Set <code>-DSVR4</code>
-in <code>CFLAGS</code>.</li>
-
-<li>If you are using the SunPRO C compiler, don't use optimization level
-<code>-xO3</code>. On SPARC platforms the compiler hangs; on Intel
-platforms the generated code is incorrect. With this compiler on Intel, do
-not use the <code>-native</code> flag: floating point computations
-become unacceptably inaccurate. You can use <code>-xcg92</code> (SPARC
-V8) and <code>-dalign</code> for better performance.</li>
-
-<li>One user reported compiling from source on a Linux NFS mounted
-volume failed. Compiling from a local volume was the workaround.</li>
-
-</ul>
-
-<hr>
-<h2><a name="Other_environments"></a>Other environments</h2>
-
-<h3><a name="No_multi_thread"></a>Environments lacking multi-threading</h3>
-
-<p>
-All environments mentioned here by name have multi-threading capability.
-However, if your environment doesn't, you can remove all need for
-multi-threading by setting <code>SYNC=nosync</code> in the top-level
-makefile. Note that you will not be able to use any so-called "async"
-drivers (drivers that overlap interpretation and rasterization) if you do
-this. No such drivers are in the <code>DEVICE_DEVS*</code> lists of any
-makefile that we distribute.</p>
-
-<h3><a name="Plan_9"></a>Plan 9</h3>
-
-<p>
-Use <code>unix-gcc.mak</code>, editing it to define</p>
-
-<blockquote><code>
-CC=cc
-GCFLAGS=-D_BSD_EXTENSION -DPlan9
-</code></blockquote>
-
-<p>
-You will also probably have to edit many path names.</p>
-
-<hr>
-<h2><a name="UFST_build"></a>How to build Ghostscript with UFST</h2>
-
-<p>
-<em>Note: This section is only for customers who have a Monotype Imaging UFST license.
-Other users please skip this section.</em></p>
-
-
-<p>
-Ghostscript sources do not include UFST sources. You need to obtain them separately.
-The Ghostscript distributed source include only some source modules that provide a
-bridge to UFST. You will also need an additional, UFST specific makefile: contact
-Ghostscript support for more information</p>
-<p>
-If optioned in, the Ghostscript build system will build the UFST as part of the normal
-bulid process (previously, the UFST was required to be built separately).</p>
-<p>
-To build Ghostscript with UFST, specify additional options for "make":</p>
-
-<dl>
- <dt><code>UFST_BRIDGE=1</code></dt>
- <dd>forces the UFST bridge to build.</dd>
-
- <dt><code>UFST_ROOT=path</code></dt>
- <dd>specifies the path to UFST root directory or folder.</dd>
-
- <dt><code>UFST_CFLAGS=options</code></dt>
- <dd>specifies C compiler options for UFST library. Refer to UFST manual for information about them.</dd>
-
- <dt><code>UFST_LIB_EXT=extension</code></dt>
- <dd>sets the file name extension for object libraries. You must use the appropriate one for your platform and linker.</dd>
-</dl>
-
- <p>An example for Unix/GCC :</p>
-<blockquote>
-<tt>UFST_BRIDGE=1 UFST_ROOT=../ufst UFST_CFLAGS=-DGCCx86 UFST_LIB_EXT=.a</tt>
-</blockquote>
-
-<p>Starting with Ghostscript 9.x (Summer 2010), the above options are conveniently
-inserted in the <code>Makefile</code> with
-(this also automatically disable the freetype bridge):</p>
-<blockquote>
-<code>./configure --with-ufst=../ufst</code>
-</blockquote>
-
-<p>For Windows/MSVC you need only specify UFST_ROOT.
-msvc.mak sets the other options automatically.</p>
-
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/News.htm b/doc/News.htm
index 43de3817..d1268184 100644
--- a/doc/News.htm
+++ b/doc/News.htm
@@ -1,67 +1,26 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Recent Changes in Ghostscript</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
<!--START EDITING HERE-->
<h1>Recent Changes in Ghostscript</h1>
-<p>
-This document is news about the most recent Ghostscript release. For
-earlier versions, see the history documents:
-
-<blockquote>
-<a href="History9.htm">History of Ghostscript versions 9.n</a><br>
-</blockquote>
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
<!-- [1.0 end visible header] ============================================== -->
<!-- [2.0 begin contents] ================================================== -->
-<h2><a name="Version9.56.0"></a>Version 9.56.1 (2022-04-04)</h2>
+<h2><a name="Version10.00.0"></a>Version 10.00.0 (2022-09-21)</h2>
<p> Highlights in this release include:
<ul>
<li>
-<p><b>New PDF Interpreter:</b> This is an entirely new implementation written in C (rather than
-PostScript, as before). For a full discussion of this change and reasons for it see:
-<a href="https://ghostscript.com/pdfi.html">Changes Coming to the PDF Interpreter</a>.
-<p>In this (9.56.0) release, the new PDF interpreter is now <em><u>ENABLED</u></em> by default
-in Ghostscript, but the old PDF interpreter can be used as a fallback by specifying
-<code>-dNEWPDF=false</code>. We've provided this so users that encounter issues with the new
-interpreter can keep working while we iron out those issues, the option will not be available in
-the long term.
-<p>This also allows us to offer a new executable (<code>gpdf</code>, or <code>gpdfwin??.exe</code>
-on Windows) which is <i>purely</i> for PDF input. For this release, those new binaries are not included
-in the "install" make targets, nor in the Windows installers.
-</li>
-<li>
-<p>Calling Ghostscript via the GS API is now thread safe. The one limitation is that the X11 devices for
-Unix-like systems (x11, x11alpha, x11cmyk, x11cmyk2, x11cmyk4, x11cmyk8, x11gray2, x11gray4 and x11mono)
-cannot be made thread safe, due to their interaction with the X11 server, those devices have been modified
-to only allow one instance in an executable.
+<p>The big change in this release is that the old PDF interpreter (written in PostScript)
+is now fully deprecated. We will not be making any further changes to it. For this release,
+the <code>-dNEWPDF=false</code> option remains for &quot;emergency&quot; use, but the option
+to fall back to the old intepreter will also be removed in the next full release (10.01.0) in
+spring 2023.
+<p>So we once again encourage all users to test the new interpreter in their use cases, and
+report any problems.
</li>
<li>
-<p>The <code>PSD</code> output devices now write ICC profiles to their output files, for improved
-color fidelity.
+<p>The new PDF interpreter written in C has had several performance improvements. It was already
+quicker for the majority of cases than the PostScript implementation, but we found further improvements
+for common cases, and also several speed improvements in edge cases.
</li>
<li>
<p>Our efforts in code hygiene and maintainability continue.
@@ -93,7 +52,7 @@ for now, as we are aware that not everyone upgrades with every release.</h4>
<p>(9.55.0) Changes to the <code>device API</code>. This will affect developers and maintainers of
Ghostscript devices. Firstly, and most importantly, the way device-specific "procs" are specified has
been rewritten to make it (we think!) clearer and less confusing. See
-<a href="Drivers.htm">The Interface between Ghostscript and Device Drivers</a> and
+<a href="https://ghostscript.readthedocs.io/Drivers.htm">The Interface between Ghostscript and Device Drivers</a> and
<a href="https://www.notion.so/artifexsoftware/The-Great-Device-Rework-Of-2021-94092fe1395d4a088b91462f0ca5038a">The Great Device Rework Of 2021</a>
for more details.
</li>
@@ -122,7 +81,7 @@ As we made "SAFER" the default mode, that became unacceptable, hence the new opt
implementations. Firstly, as mentioned in the 9.50 release notes, SAFER now leaves
standard PostScript functionality unchanged (except for the file access limitations).
Secondly, the interaction with <code>save</code>&sol;<code>restore</code> operations
-has changed. See <a href="Use.htm#Safer">SAFER</a>.
+has changed. See <a href="https://ghostscript.readthedocs.io/Use.htm#Safer">SAFER</a>.
<p><strong>Important Note for Windows Users</strong>:
<br>
The file/path pattern matching is case-sensitive, even on Windows. This is a
@@ -142,12 +101,12 @@ alternative solution or return the previous functionality, if there is genuinely
option.
</li>
</ul>
-<h3><a name="9.56.0_changelog"></a>Changelog</h3>
+<h3><a name="10.00.0_changelog"></a>Changelog</h3>
<p>From 9.55.0 onwards, in recognition of how unwieldy very large HTML files can become
(History9.html had reached 8.1Mb!), we intend to only include the summary highlights (above).
<p>For anyone wanting the full details of the changes in
a release, we ask them to look at the history in our public git repository:
-<a href="https://git.ghostscript.com/?p=ghostpdl.git;a=shortlog;h=refs/tags/ghostpdl-9.56.0">ghostpdl-9.56.0</a> log.
+<a href="https://git.ghostscript.com/?p=ghostpdl.git;a=shortlog;h=refs/tags/ghostpdl-10.00.0">ghostpdl-10.00.0</a> log.
<p>If this change does not draw negative feedback, History?.htm file(s) will be removed from the release archives.
<!-- [2.0 end contents] ==================================================== -->
@@ -170,16 +129,9 @@ or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
+<small>Ghostscript version 10.00.0, 21 September 2022
<!-- [3.0 end visible trailer] ============================================= -->
<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Ps-style.htm b/doc/Ps-style.htm
deleted file mode 100644
index 5cfcc5ef..00000000
--- a/doc/Ps-style.htm
+++ /dev/null
@@ -1,530 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Ghostscript PostScript Coding Guidelines</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Ghostscript PostScript Coding Guidelines</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Summary">Summary of the coding guidelines</a></li>
- <li><a href="#Introduction">Introduction</a></li>
- <li><a href="#PS_features">Use of PostScript language features</a></li>
- <li>
- <ul>
- <li><a href="#Restrictions">Restrictions</a></li>
- <li><a href="#Protection">Protection</a></li>
- <li><a href="#Standard_constructions">Standard constructions</a></li>
- </ul>
- </li>
- <li><a href="#File_structuring">File structuring</a></li>
- <li><a href="#Commenting">Commenting</a></li>
- <li><a href="#Formatting">Formatting</a></li>
- <li>
- <ul>
- <li><a href="#Indentation">Indentation</a></li>
- <li><a href="#Spaces">Spaces</a></li>
- </ul>
- </li>
- <li><a href="#Naming">Naming</a></li>
- <li><a href="#Miscellany">Miscellany</a></li>
- <li>
- <ul>
- <li><a href="#Non_standard_operators">Some useful non-standard operators</a></li>
- <li><a href="#Useful_procedures">Some useful procedures</a></li>
- <li><a href="#Other">Other</a></li>
- </ul>
- </li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>
-For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Summary"></a>Summary of the coding guidelines</h2>
-
-<ul>
-
-<li>Don't store into literals.
-
-<li>Use <code>loop</code> to create a block with multiple exits.
-
-<li>Use a dictionary or an array for multi-way switches.
-
-<li>Start every file with a copyright notice, the file name, and a one-line
-summary.
-
-<li>Comment every procedure with the arguments and result, and with the
-function of the procedure unless it's obvious.
-
-<li>Comment the stack contents ad lib, and particularly at the beginning of
-every loop body.
-
-<li>Indent every 2 spaces.
-
-<li>Always put { at the end of a line, and } at the beginning of a line,
-unless the contents are very short.
-
-<li>Always put spaces between adjacent tokens.
-
-<li>Use only lower-case letters and digits for names, or <a href="#Naming">Vienna style names</a>,
-except for an initial "." for names only used within a single file.
-
-<li>Don't allocate objects in heavily used code.
-
-<li>Consider factoring out code into a procedure if it is used more than
-once.
-
-</ul>
-
-<hr>
-
-<h2><a name="Introduction"></a>Introduction</h2>
-
-<p>
-The many rules that Ghostscript's code follows almost everywhere are meant
-to produce code that is easy to read. It's important to observe them as
-much as possible in order to maintain a consistent style, but if you find a
-rule getting in your way or producing ugly-looking results once in a while,
-it's OK to break it.
-
-<hr>
-
-<h2><a name="PS_features"></a>Use of PostScript language features</h2>
-
-<h3><a name="Restrictions"></a>Restrictions</h3>
-
-<p>
-If you need to store a value temporarily, don't write into a literal in the
-code, as in this fragment to show a character given the character code:
-
-<blockquote><pre>
-( ) dup 0 4 -1 roll put show
-</pre></blockquote>
-
-<p>
-Instead, allocate storage for it:
-
-<blockquote><pre>
-1 string dup 0 4 -1 roll put show
-</pre></blockquote>
-
-<h3><a name="Protection"></a>Protection</h3>
-
-<p>
-If an object is never supposed to change, use <code>readonly</code> to
-make it read-only. This applies especially to permanently allocated objects
-such as constant strings or dictionaries.
-
-<p>
-During initialization, and occasionally afterwards, it may be necessary to
-store into a read-only dictionary, or to store a pointer to a dictionary in
-local VM into a dictionary in global VM. The operators
-<code>.forceput</code> and <code>.forceundef</code> are available for
-this purpose. To make these operators inaccessible to ordinary programs,
-they are removed from <code>systemdict</code> at the end of
-initialization: system code that uses them should always use
-<code>bind</code> and <code>odef</code> (or
-<code>executeonly</code>) to make uses of them inaccessible as well.
-
-<h3><a name="Standard_constructions"></a>Standard constructions</h3>
-
-<h4>Multi-way conditionals</h4>
-
-<p>
-If you write a block of code with more than about 3 exit points, the usual
-way to do it would be like this:
-
-<blockquote><pre>
-{
- ... {
- ...1
- } {
- ... {
- ...2
- } {
- ... {
- ...3
- } {
- ...4
- } ifelse
- } ifelse
- } ifelse
-}
-</pre></blockquote>
-
-<p>
-However, this causes the 4 logically somewhat parallel code blocks to be
-indented differently, and as the indentation increases, it becomes harder to
-see the structure visually. As an alternative, you can do it this way:
-
-<blockquote><pre>
-{ % The loop doesn't actually loop: it just provides a common exit.
- ... {
- ...1
- exit
- } if
- ... {
- ...2
- exit
- } if
- ... {
- ...3
- exit
- } if
- ...4
- exit
-} loop
-</pre></blockquote>
-
-<p>
-Don't forget the final exit, to prevent the loop from actually looping.
-
-<h4>Switches</h4>
-
-<p>
-Use a dictionary or an array of procedures to implement a 'switch', rather
-than a series of conditionals, if there are more than about 3 cases. For
-example, rather than:
-
-<blockquote><pre>
-dup /a eq {
- pop ...a
-} {
- dup /b eq {
- pop ...b
- } {
- dup /c eq {
- pop ...c
- } {
- ...x
- } ifelse
- } ifelse
-} ifelse
-</pre></blockquote>
-
-<p>
-(or using the loop/exit construct suggested above), consider:
-
-<blockquote><pre>
-/xyzdict mark
- /a {...a} bind
- /b {...b} bind
- /c {...c} bind
-.dicttomark readonly def
-...
-//xyzdict 1 index .knownget {
- exch pop exec
-} {
- ...x
-} ifelse
-</pre></blockquote>
-
-<hr>
-
-<h2><a name="File_structuring"></a>File structuring</h2>
-
-<p>
-Every code file should start with comments containing
-
-<ol>
-<li>a copyright notice;
-<li>the name of the file in the form of an RCS Id:
-
-<blockquote><pre>
-% &#36;Id: filename.ps &#36;
-</pre></blockquote>
-
-<li>a very brief summary (preferably only one line) of what the file
-contains.
-</ol>
-
-<p>
-If you create a file by copying the beginning of another file, be sure to
-update the copyright year and change the file name.
-
-<hr>
-
-<h2><a name="Commenting"></a>Commenting</h2>
-
-<p>
-If a file has well-defined functional sections, put a comment at the
-beginning of each section to describe its purpose or function.
-
-<p>
-Put a comment before every procedure to describe what the procedure does,
-unless it's obvious or the procedure's function is defined by the PLRM. In
-case of doubt, don't assume it's obvious. If the procedure may execute a
-deliberate 'stop' or 'exit' not enclosed in 'stopped' or a loop
-respectively, that should be mentioned. However, information about the
-arguments and results should go in the argument and result comment
-(described just below) if possible, not the functional comment.
-
-<p>
-Put a comment on every procedure to describe the arguments and results:
-
-<blockquote><pre>
-/hypot { % &lt;num1&gt; &lt;num2&gt; hypot &lt;real&gt;
- dup mul exch dup mul add sqrt
-} def
-</pre></blockquote>
-
-<p>
-There is another commenting style that some people prefer to the above:
-
-<blockquote><pre>
-/hypot { % num1 num2 --&gt; realnum
- dup mul exch dup mul add sqrt
-} def
-</pre></blockquote>
-
-<p>
-We have adopted the first style for consistency with Adobe's documentation,
-but we recognize that there are technical arguments for and against both
-styles, and might consider switching some time in the future. If you have
-strong feelings either way, please make your opinion known to
-<code>gs-devel@ghostscript.com</code>.
-
-<p>
-Put comments describing the stack contents wherever you think they will be
-helpful; put such a comment at the beginning of every loop body unless you
-have a good reason not to.
-
-<p>
-When you change a piece of code, do <em>not</em> include a comment with your
-name or initials. Also, do <em>not</em> retain the old code in a comment,
-unless you consider it essential to explain something about the new code; in
-that case, retain as little as possible. (CVS logs do both of these things
-better than manual editing.) However, if you make major changes in a
-procedure or a file, you may put your initials, the date, and a brief
-comment at the head of the procedure or file respectively.
-
-<hr>
-
-<h2><a name="Formatting"></a>Formatting</h2>
-
-<h3><a name="Indentation"></a>Indentation</h3>
-
-<p>
-Indent 2 spaces per indentation level. You may use tabs at the left margin
-for indentation, with 1 tab = 8 spaces, but you should not use tabs anywhere
-else, except to place comments.
-
-<p>
-Indent { } constructs like this:
-
-<blockquote><pre>
-... {
- ...
-} {
- ...
-} ...
-</pre></blockquote>
-
-<p>
-If the body of a conditional or loop is no more than about 20 characters,
-you can put the entire construct on a single line if you want:
-
-<blockquote><pre>
-... { ... } if
-</pre></blockquote>
-
-rather than
-
-<blockquote><pre>
-... {
- ...
-} if
-</pre></blockquote>
-
-<p>
-There is another indentation style that many people prefer to the above:
-
-<blockquote><pre>
-...
-{ ...
-}
-{ ...
-} ...
-</pre></blockquote>
-
-<p>
-We have adopted the first style for consistency with our C code, but we
-recognize that there are technical arguments for and against both styles,
-and might consider switching some time in the future. If you have strong
-feelings either way, please make your opinion known to
-<code>gs-devel@ghostscript.com</code>.
-
-<h3><a name="Spaces"></a>Spaces</h3>
-
-<p>
-Always put spaces between two adjacent tokens, even if this isn't strictly
-required. E.g.,
-
-<blockquote><pre>
-/Halftone /Category findresource
-</pre></blockquote>
-
-<p>
-not
-
-<blockquote><pre>
-/Halftone/Category findresource
-</pre></blockquote>
-
-<hr>
-
-<h2><a name="Naming"></a>Naming</h2>
-
-<p>
-All names should consist only of letters and digits, possibly with an
-initial ".", except for names drawn from the PostScript or PDF reference
-manual, which must be capitalized as in the manual. In general, an initial
-"." should be used for those and only those names that are not defined in a
-private dictionary but that are meant to be used only in the file where they
-are defined.
-
-<p>
-For edits to existing code, names made up of multiple words should not use
-any punctuation, or capitalization, to separate the words, again except for
-names that must match a specification. For new code, you may use this
-convention, or you may use the "Vienna" convention of capitalizing the first
-letter of words, e.g., <code>readSubrs</code> rather than
-<code>readsubrs</code>. If you use the Vienna convention, function names
-should start with an upper case letter, variable names with a lower case
-letter. Using the first letter of a variable name to indicate the
-variable's type is optional, but if you do it, you should follow existing
-codified usage (****** WE NEED A REFERENCE FOR THIS ******).
-
-<hr>
-
-<h2><a name="Miscellany"></a>Miscellany</h2>
-
-<h3><a name="Non_standard_operators"></a>Some useful non-standard
-operators</h3>
-
-<dl>
-
-<dt><code>&lt;obj1&gt; &lt;obj2&gt; ... &lt;objn&gt; &lt;n&gt; .execn ...</code>
-<dd>This executes <code>obj1</code> through <code>objn</code> in that
-order, essentially equivalent to
-
-<blockquote><pre>
-&lt;obj1&gt; &lt;obj2&gt; ... &lt;objn&gt; &lt;n&gt; array astore {exec} forall
-</pre></blockquote>
-
-<p>
-except that it doesn't actually create the array.
-
-<dt><code>&lt;dict&gt; &lt;key&gt; <b>.knownget</b> &lt;value&gt; true</code>
-<dt><code>&lt;dict&gt; &lt;key&gt; <b>.knownget</b> false</code>
-
-<dd>This combines <code>known</code> and <code>get</code> in the
-obvious way.
-
-<dt><code>&lt;name&gt; &lt;proc&gt; odef -</code>
-
-<dd>This defines <code>name</code> as a "pseudo-operator". The value of
-<code>name</code> will be executable, will have type
-<code>operatortype</code>, and will be executed if it appears directly in
-the body of a procedure (like an operator, unlike a procedure), but what
-will actually be executed will be <code>proc</code>. In addition, if the
-execution of <code>proc</code> is ended prematurely (by
-<code>stop</code>, including the <code>stop</code> that is normally
-executed when an error occurs, or <code>exit</code>) and the operand and
-dictionary stacks are at least as deep as they were when the "operator" was
-invoked, the stacks will be cut back to their original depths before the
-error is processed. Thus, if pseudo-operator procedures are careful not to
-remove any of their operands until they reach a point in execution beyond
-which they cannot possibly cause an error, they will behave just like
-operators in that the stacks will appear to be unchanged if an error occurs.
-
-</dl>
-
-<h3><a name="Useful_procedures"></a>Some useful procedures</h3>
-
-<dl>
-
-<dt><code>&lt;object&gt; &lt;errorname&gt; signalerror -</code>
-
-<dd>Signal an error with the given name and the given "current object".
-This does exactly what the interpreter does when an error occurs.
-
-</dl>
-
-<h3><a name="Other"></a>Other</h3>
-
-<p>
-If you can avoid it, don't allocate objects (strings, arrays, dictionaries,
-gstates, etc.) in commonly used operators or procedures: these will need to
-be garbage collected later, slowing down execution. Instead, keep values on
-the stack, if you can. The <code>.execn</code> operator discussed above
-may be helpful in doing this.
-
-<p>
-If you find yourself writing the same stretch of code (more than about half
-a dozen tokens) more than once, ask yourself whether it performs a function
-that could be made into a procedure.
-
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Ps2epsi.htm b/doc/Ps2epsi.htm
deleted file mode 100644
index b3a85b03..00000000
--- a/doc/Ps2epsi.htm
+++ /dev/null
@@ -1,204 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Convert PostScript to Encapsulated PostScript Interchange Format</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Convert PostScript to Encapsulated PostScript Interchange Format</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Overview">Overview</a>
- <li><a href="#Framemaker">Framemaker can use EPSI</a>
- <li><a href="#Usage">Usage</a>
- <li>
- <ul>
- <li><a href="#MSDOS_usage">MS-DOS</a>
- <li><a href="#Unix_usage">Unix</a>
- </ul>
- </li>
- <li><a href="#Limitations">Limitations</a>
- <li><a href="#Files">Files</a>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>
-The information in this document was contributed by George Cameron
-&lt;<a href="mailto:george@bio-medical-physics.aberdeen.ac.uk">george@bio-medical-physics.aberdeen.ac.uk</a>&gt;;
-please direct to him any questions about it. Because the software
-described here is no longer being maintained, this document may be
-obsolete, or inconsistent with <code>ps2epsi.1</code>.
-
-<p>
-For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Overview"></a>Overview</h2>
-
-<p>
-<code>ps2epsi</code> is a utility based on Ghostscript, which takes as
-input a PostScript file and generates as output a new file which conforms
-to Adobe's Encapsulated PostScript Interchange (EPSI) format, a special
-form of
-<a href="http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf"
-class="offsite">Encapsulated PostScript</a>
-(EPS) which adds to the beginning of the file, as PostScript comments, a
-low-resolution monochrome bitmap image of the final displayed page.
-Programs which understand EPSI can use this bitmap as a preview on screen
-of the full PostScript page. The displayed quality is often not very good,
-but the final printed version uses the "real" PostScript, and thus has the
-normal full PostScript quality.
-<hr?
-<h2><a name="Framemaker"></a>Framemaker can use EPSI</h2>
-
-<p>
-The <a href="http://www.adobe.com/products/framemaker/main.html"
-class="offsite">Adobe Framemaker</a> DTP system is one application which
-understands EPSI files, and <code>ps2epsi</code> has been tested using
-Framemaker 3.0 on a Sun workstation with a number of PostScript diagrams
-from a variety of sources. Framemaker on other platforms may also be able
-to use files made with <code>ps2epsi</code>, although this has not been
-tested.
-
-<hr>
-
-<h2><a name="Usage"></a>Usage</h2>
-
-<h3><a name="MSDOS_usage"></a>MS-DOS</h3>
-
-<p>
-Using the supplied batch file <code>ps2epsi.bat</code>, the command is
-
-<blockquote>
-<code>ps2epsi</code> <b><em>infile.ps</em></b> <b><em>outfile.epi</em></b>
-</blockquote>
-
-<p>
-where <b><em>infile.ps</em></b> is the original PostScript file, and
-<b><em>outfile.epi</em></b> is the output EPSI file to be created.
-
-<h3><a name="Unix_usage"></a>Unix</h3>
-
-<p>
-Using the supplied shell script <code>ps2epsi</code>, the command is
-
-<blockquote>
-<code>ps2epsi</code> <b><em>infile.ps</em></b> <b><em>[outfile.epsi]</em></b>
-</blockquote>
-
-<p>
-where <b><em>infile.ps</em></b> is the input file and
-<b><em>outfile.epsi</em></b> is the output EPSI file to be created. If the
-output filename is omitted, <code>ps2epsi</code> generates one from the
-input filename; and any standard extension (<code>.ps</code>,
-<code>.cps</code>, <code>.eps</code> or <code>.epsf</code>) of the
-input file is replaced in the output file with the extension
-<code>.epsi</code>.
-
-<hr>
-
-<h2><a name="Limitations"></a>Limitations</h2>
-
-<p>
-Not all PostScript files can be encapsulated, because there are
-restrictions in what is permitted in a PostScript file for it to be
-properly encapsulated. <code>ps2epsi</code> does a little extra work to
-try to help encapsulation, and it automatically calculates the bounding box
-required for all encapsulated PostScript files, so most of the time it does
-a pretty good job. There are certain to be cases, however, when
-encapsulation fails because of the nature of the original PostScript file.
-
-<hr>
-
-<h2><a name="Files"></a>Files</h2>
-
-<blockquote><table>
-<tr>
- <th colspan="2">ps2epsi files</th>
- </tr>
-<tr>
- <th align="left">File</th>
-
- <th align="left">Contents</th>
- </tr>
-<tr>
- <td><code>ps2epsi.htm</code></td>
-
- <td>This document</td>
- </tr>
-<tr>
- <td><code>ps2epsi.bat</code></td>
-
- <td>MS-DOS batch file</td>
- </tr>
-<tr>
- <td><code>ps2epsi</code></td>
-
- <td>Unix shell script</td>
- </tr>
-<tr>
- <td><code>ps2epsi.ps</code></td>
-
- <td>Ghostscript program which does the work</td>
- </tr>
-</table></blockquote>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Psfiles.htm b/doc/Psfiles.htm
deleted file mode 100644
index b68435a7..00000000
--- a/doc/Psfiles.htm
+++ /dev/null
@@ -1,865 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>PostScript Files Distributed with Ghostscript</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>PostScript Files Distributed with Ghostscript</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#General">Generally used system files</a></li>
- <li><a href="#Obscure">More obscure system files</a></li>
- <li><a href="#Config">Configuration files</a></li>
- <li><a href="#PDF_specific">PDF-specific system files</a></li>
- <li><a href="#DPS_specific">Display PostScript-specific system files</a></li>
- <li><a href="#Art">Art and examples</a></li>
- <li><a href="#Utilities">Utilities</a></li>
- <li><a href="#Development_tools">Development tools</a></li>
- <li><a href="#Miscellany">Odds and ends</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="General"></a>Generally used system files</h2>
-
-<dl>
-<dt><code>gs_*_e.ps</code></dt>
-<dd>
-These files define the Encodings known to Ghostscript. All of
-them except <code>gs_std_e.ps</code> and <code>gs_il1_e.ps</code>
-are loaded only if referred to. However some are additionally built into gscencs.c.</dd>
-
-
-<dt>
-PostScript Encodings:</dt>
-<dd>
-These files are found in the <code>lib</code> subdirectory of
-the Ghostscript source distribution.</dd>
-
-<dd>
-<a href="../lib/gs_ce_e.ps"><code>gs_ce_e.ps</code></a>
-</dd>
-
-<dd>These files are found in the <code>Resource/Init</code> subdirectory of
-the Ghostscript source distribution.</dd>
-
-<dd>
-<a href="../Resource/Init/gs_il1_e.ps"><code>gs_il1_e.ps</code></a>,
-<a href="../Resource/Init/gs_std_e.ps"><code>gs_std_e.ps</code></a>,
-<a href="../Resource/Init/gs_sym_e.ps"><code>gs_sym_e.ps</code></a>.
-</dd>
-
-<dt>
-PDF Encodings:</dt>
-<dd>
-These files are found in the <code>Resource/Init</code> subdirectory of
-the Ghostscript source distribution.</dd>
-
-<dd>
-<a href="../Resource/Init/gs_mex_e.ps"><code>gs_mex_e.ps</code></a>,
-<a href="../Resource/Init/gs_mro_e.ps"><code>gs_mro_e.ps</code></a>,
-<a href="../Resource/Init/gs_pdf_e.ps"><code>gs_pdf_e.ps</code></a>,
-<a href="../Resource/Init/gs_wan_e.ps"><code>gs_wan_e.ps</code></a>.
-</dd>
-
-<dt>
-Non-standard Encodings:</dt>
-<dd>
-These files are found in the <code>Resource/Init</code> subdirectory of
-the Ghostscript source distribution.</dd>
-
-<dd>
-<a href="../Resource/Init/gs_dbt_e.ps"><code>gs_dbt_e.ps</code></a>,
-</dd>
-
-<dd>
-These files are found in the <code>lib</code> subdirectory of
-the Ghostscript source distribution.</dd>
-
-<dd>
-<a href="../lib/gs_il2_e.ps"><code>gs_il2_e.ps</code></a>,
-<a href="../lib/gs_ksb_e.ps"><code>gs_ksb_e.ps</code></a>,
-<a href="../lib/gs_lgo_e.ps"><code>gs_lgo_e.ps</code></a>,
-<a href="../lib/gs_lgx_e.ps"><code>gs_lgx_e.ps</code></a>,
-<a href="../lib/gs_wl1_e.ps"><code>gs_wl1_e.ps</code></a>,
-<a href="../lib/gs_wl2_e.ps"><code>gs_wl2_e.ps</code></a>,
-<a href="../lib/gs_wl5_e.ps"><code>gs_wl5_e.ps</code></a>.
-</dd>
-
-<dt>
-Pseudo-encodings:</dt>
-<dd>
-These files are found in the <code>Resource/Init</code> subdirectory of
-the Ghostscript source distribution.</dd>
-<dd>
-<a href="../Resource/Init/gs_mgl_e.ps"><code>gs_mgl_e.ps</code></a>.
-</dd>
-
-<dd>
-These files are found in the <code>lib</code> subdirectory of
-the Ghostscript source distribution.</dd>
-<dd>
-<a href="../lib/gs_lgo_e.ps"><code>gs_lgo_e.ps</code></a>,
-<a href="../lib/gs_lgx_e.ps"><code>gs_lgx_e.ps</code></a>,
-</dd>
-
-</dl>
-
-
-<p>These files are found in the <code>Resource/Init</code> subdirectory of
-the Ghostscript source distribution.</p>
-
-<dl>
-<dt><a href="../Resource/Init/gs_btokn.ps"><code>gs_btokn.ps</code></a></dt>
-<dd><code>gs_init.ps</code> reads this in if the <code>btoken</code>
-feature is included in the configuration. It provides support for binary
-tokens.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_cff.ps"><code>gs_cff.ps</code></a></dt>
-<dd>Load CFF (compressed) fonts.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_fntem.ps"><code>gs_fntem.ps</code></a></dt>
-<dd>Code for emulating PostScript fonts with non-PostScript font technologies.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_cidtt.ps"><code>gs_cidtt.ps</code></a></dt>
-<dd>Code for emulating CID fonts with TrueType fonts.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_cidcm.ps"><code>gs_cidcm.ps</code></a></dt>
-<dd>Code for recognizing font names of the form CIDFont-CMap (or
-CIDFont--CMap) and creating the font automatically.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_ciddc.ps"><code>gs_ciddc.ps</code></a></dt>
-<dd>Defines Decoding and CIDDecoding resource categories and related procsets.
-Used for for emulating PostScript fonts with non-PostScript font technologies.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_cidfm.ps"><code>gs_cidfm.ps</code></a></dt>
-<dd>Provides resource mapping for CIDFont category.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_cidfn.ps"><code>gs_cidfn.ps</code></a></dt>
-<dd><code>ProcSet</code> for implementing <code>CIDFont</code> and
-<code>CIDMap</code> resources.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_cmap.ps"><code>gs_cmap.ps</code></a></dt>
-<dd><code>ProcSet</code> for implementing <code>CMap</code> resources.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_cspace.ps"><code>gs_cspace.ps</code></a></dt>
-<dd> PostScript portion of the basic color space handling;
-see the extensive comment at the head of the file
-for information.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_dscp.ps"><code>gs_dscp.ps</code></a></dt>
-<dd>Code to compensate for badly written PostScript files by setting
-Orientation according to the DSC comments.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_epsf.ps"><code>gs_epsf.ps</code></a></dt>
-<dd>Allow the interpreter to recognize DOS EPSF file headers, and skip to the
-PostScript section of the file.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_fapi.ps"><code>gs_fapi.ps</code></a></dt>
-<dd>Font API support.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_fonts.ps"><code>gs_fonts.ps</code></a></dt>
-<dd><code>gs_init.ps</code> reads this in. It initializes Ghostscript's
-font machinery and provides some utility procedures that work with fonts.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_frsd.ps"><code>gs_frsd.ps</code></a></dt>
-<dd>Support for the PostScript LanguageLevel 3
-<code>ReusableStreamDecode</code> filter.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_img.ps"><code>gs_img.ps</code></a></dt>
-<dd>Implementation of the traditional (non-dictionary)
-form of the image and imagemask operators, and the
-colorimage operator (including the Next alphaimage
-facility).</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_init.ps"><code>gs_init.ps</code></a></dt>
-<dd>Ghostscript reads this automatically when it starts up. It contains
-definitions of many standard procedures and initialization for a wide
-variety of things.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_lev2.ps"><code>gs_lev2.ps</code></a></dt>
-<dd><code>gs_init.ps</code> reads this in if the Ghostscript interpreter
-includes Level 2 PostScript functions. It contains definitions of
-procedures and miscellaneous initialization for the Level 2 functions.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_ll3.ps"><code>gs_ll3.ps</code></a></dt>
-<dd>Initialize PostScript LanguageLevel 3 functions.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_resmp.ps"><code>gs_resmp.ps</code></a></dt>
-<dd>A procset for redefining resource categories with a resource map.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_res.ps"><code>gs_res.ps</code></a></dt>
-<dd><code>gs_init.ps</code> reads this in if the Level 2 resource
-machinery is included. Currently, this is the case for all Level 2
-configurations.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_setpd.ps"><code>gs_setpd.ps</code></a></dt>
-<dd>Implementation of the <code>setpagedevice</code> operator.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_statd.ps"><code>gs_statd.ps</code></a></dt>
-<dd><code>gs_init.ps</code> reads this in. It creates a dummy
-<code>statusdict</code> and some other environmental odds and ends for
-the benefit of PostScript files that really want to be printed on a
-LaserWriter.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_trap.ps"><code>gs_trap.ps</code></a></dt>
-<dd>Stub support for the PostScript LanguageLevel 3 "In-RIP trapping"
-feature.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_ttf.ps"><code>gs_ttf.ps</code></a></dt>
-<dd>Support code for direct use of TrueType fonts.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_typ32.ps"><code>gs_typ32.ps</code></a></dt>
-<dd>Initialization file for Type 32 fonts.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_typ42.ps"><code>gs_typ42.ps</code></a></dt>
-<dd>Support code for Type 42 fonts (TrueType font in a PostScript "wrapper").</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_type1.ps"><code>gs_type1.ps</code></a></dt>
-<dd><code>gs_init.ps</code> reads this in if the Ghostscript interpreter
-includes Type 1 font capability (which it normally does).</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Config"></a>Configuration files</h2>
-
-<p>
-These files are found in the <code>Resource/Init</code> subdirectory of
-the Ghostscript source distribution. Users are allowed to modify them
-to configure Ghostscript.</p>
-
-<dl>
-<dt><a href="../Resource/Init/Fontmap"><code>Fontmap</code></a></dt>
-<dd>Font mapping table.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/cidfmap"><code>cidfmap</code></a></dt>
-<dd>CID font mapping table. Allows substitution of a CID font for another CID font or
-a TrueType font for a CID font.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/FAPIconfig"><code>FAPIconfig</code></a></dt>
-<dd>A configuration file for Font API client.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/FAPIfontmap"><code>FAPIfontmap</code></a></dt>
-<dd>Font mapping table for Font-API-handled fonts.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/FAPIcidfmap"><code>FAPIcidfmap</code></a></dt>
-<dd>Font mapping table for Font-API-handled CID fonts.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Obscure"></a>More obscure system files</h2>
-
-<p>
-Unless otherwise stated, these files are found in the <code>Resource/Init</code> subdirectory of
-the Ghostscript source distribution.</p>
-
-<dl>
-<dt><a href="../Resource/Init/gs_agl.ps"><code>gs_agl.ps</code></a></dt>
-<dd>Contains the mapping from Adobe glyph names to Unicode values, used to
-support TrueType fonts and disk-based Type 1 fonts.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_cet.ps"><code>gs_cet.ps</code></a></dt>
-<dd>Sets a number of alternate defaults to make Ghostscript
-behave more like Adobe CPSI. Useful for running the CET conformance
-test suite.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_diskn.ps"><code>gs_diskn.ps</code></a></dt>
-<dd>This file implements the <code>%disk</code> IODevice
-(<code>diskn.dev</code> feature). See the the language documentation
-for information on the use of the %disk# devices. These PostScript
-modifications primarily perform the searching of all Searchable file
-systems in a defined SearchOrder when a file reference does not contain
-an explicit %device% specifier (such as <code>%os%</code> or
-<code>%disk0</code>%). This is required to emulate undocumented
-behaviour of Adobe PostScript printers that have a disk and was
-experimentally determined.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/gs_kanji.ps"><code>gs_kanji.ps</code></a></dt>
-<dd>This file provides support for the Wadalab free Kanji font. It is not
-included automatically in any configuration. This file is stored in the <code>lib</code> subdirectory.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_pdfwr.ps"><code>gs_pdfwr.ps</code></a></dt>
-<dd>This file contains some patches for providing information to the
-<code>pdfwrite</code> driver. It is included only if the
-<code>pdfwrite</code> driver is included.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/ht_ccsto.ps"><code>ht_ccsto.ps</code></a></dt>
-<dd>A default stochastic CMYK halftone. This file is in the public domain. This file is stored in the <code>lib</code> subdirectory.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/stcolor.ps"><code>stcolor.ps</code></a></dt>
-<dd>Configure the (Epson) <code>stcolor</code> driver. This file is stored in the <code>lib</code> subdirectory.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="PDF_specific"></a>PDF-specific system files</h2>
-
-<p>
-These files are found in the <code>Resource/Init</code> subdirectory of
-the Ghostscript source distribution.</p>
-
-<dl>
-<dt><a href="../Resource/Init/pdf_base.ps"><code>pdf_base.ps</code></a></dt>
-<dd>Utilities for interpreting PDF objects and streams.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/pdf_draw.ps"><code>pdf_draw.ps</code></a></dt>
-<dd>The interpreter for drawing-related PDF operations.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/pdf_font.ps"><code>pdf_font.ps</code></a></dt>
-<dd>Code for handling fonts in PDF files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/pdf_main.ps"><code>pdf_main.ps</code></a></dt>
-<dd>Document- and page-level control for interpreting PDF files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/pdf_ops.ps"><code>pdf_ops.ps</code></a></dt>
-<dd>Definitions for most of the PDF operators.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/pdf_rbld.ps"><code>pdf_rbld.ps</code></a></dt>
-<dd>Contains procedures for bebuilding damaged PDF files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/pdf_sec.ps"><code>pdf_sec.ps</code></a></dt>
-<dd>PDF security (encryption) code.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_icc.ps"><code>gs_icc.ps</code></a></dt> <dd>Support for
-ICC color profiles. These are not a standard PostScript feature, but
-are used in the PDF interpreter, as ICC profiles may be embedded in
-PDF files.</dd>
-</dl>
-
-<p>
-These files are found in the <code>lib</code> subdirectory of
-the Ghostscript source distribution. These files are templates and should not be used
-without modification.</p>
-
-<dl>
-<dt><a href="../lib/PDFX_def.ps"><code>PDFX_def.ps</code></a></dt>
-<dd>This is a sample prefix file for creating a PDF/X-3 document
-with the <code>pdfwrite</code> device.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/PDFA_def.ps"><code>PDFA_def.ps</code></a></dt>
-<dd>This is a sample prefix file for creating a PDF/A document
-with the <code>pdfwrite</code> device.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="DPS_specific"></a>Display PostScript-specific system files</h2>
-
-<p>
-These files are found in the <code>Resource/Init</code> subdirectory of
-the Ghostscript source distribution.</p>
-
-<dl>
-<dt><a href="../Resource/Init/gs_dpnxt.ps"><code>gs_dpnxt.ps</code></a></dt>
-<dd>NeXT Display PostScript extensions.</dd>
-</dl>
-
-<dl>
-<dt><a href="../Resource/Init/gs_dps.ps"><code>gs_dps.ps</code></a>,
-<a href="../Resource/Init/gs_dps1.ps"><code>gs_dps1.ps</code></a>,
-<a href="../Resource/Init/gs_dps2.ps"><code>gs_dps2.ps</code></a></dt>
-<dd><code>gs_init.ps</code> reads these in if the <code>dps</code>
-feature is included in the configuration. They provide support for various
-Display PostScript and Level 2 features.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Art"></a>Art and examples</h2>
-
-<p>
-These files are found in the <code>examples</code> subdirectory of
-the Ghostscript source distribution.</p>
-
-<dl>
-<dt><a href="../examples/alphabet.ps"><code>alphabet.ps</code></a></dt>
-<dd>Prints a sample alphabet at several different sizes.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/annots.pdf"><code>annots.pdf</code></a></dt>
-<dd>A sample file with a wide variety of PDF "annotations".</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/colorcir.ps"><code>colorcir.ps</code></a></dt>
-<dd>A set of nested ellipses made up of colored bars.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/doretree.ps"><code>doretree.ps</code></a></dt>
-<dd>A 3-D image produced by a modeling program. This file is in the public
-domain.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/escher.ps"><code>escher.ps</code></a></dt>
-<dd>A colored version of a hexagonally symmetric Escher drawing of
-interlocking butterflies. Can be printed on monochrome devices, with
-somewhat less dramatic results.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/golfer.eps"><code>golfer.eps</code></a></dt>
-<dd>A gray-scale picture of a stylishly dressed woman swinging a golf club.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/grayalph.ps"><code>grayalph.ps</code></a></dt>
-<dd>Grayscaled text test pattern.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/ridt91.eps"><code>ridt91.eps</code></a></dt>
-<dd>The RIDT '91 logo. Note that since this is an EPS file, you will have
-to add "<code>-c&nbsp;showpage</code>" at the end of the command line to
-print it or convert it to a raster file.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/snowflak.ps"><code>snowflak.ps</code></a></dt>
-<dd>A rectangular grid of intricate colored snowflakes. (May render very
-slowly.)</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/text_graph_image_cmyk_rgb.pdf"><code>text_graph_image_cmyk_rgb.pdf</code></a></dt>
-<dd>A simple PDF containing text and graphics in both RGB and CMYK spaces.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/text_graphic_image.pdf"><code>text_graphic_image.pdf</code></a></dt>
-<dd>A simple PDF containing text and graphics in RGB space.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/tiger.eps"><code>tiger.eps</code></a></dt>
-<dd>A dramatic colored picture of a tiger's head.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/transparency_example.ps"><code>transparency_example.ps</code></a></dt>
-<dd>A simple example of transparency.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/vasarely.ps"><code>vasarely.ps</code></a></dt>
-<dd>Colored rectangles and ellipses inspired by Victor Vasarely's experiments
-with tilting circles and squares.</dd>
-</dl>
-
-<dl>
-<dt><a href="../examples/waterfal.ps"><code>waterfal.ps</code></a></dt>
-<dd>Prints text in a variety of different sizes, to help evaluate the
-quality of text rendering.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Utilities"></a>Utilities</h2>
-
-<p>
-For more information on these utility programs, see the comments at the
-start of each file . The ones marked (*) have batch files or shell
-scripts of the same name (like <code>bdftops</code> and
-<code>bdftops.bat</code>) to invoke them conveniently.</p>
-
-<p>
-These files are found in the <code>lib</code> subdirectory of
-the Ghostscript source distribution.</p>
-
-<dl>
-<dt><a href="../lib/align.ps"><code>align.ps</code></a></dt>
-<dd>A test page for determining the proper margin and offset parameters for
-your printer.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/caption.ps"><code>caption.ps</code></a></dt>
-<dd>A file for putting a caption in a box at the bottom of each page,
-useful for trade show demos.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/cat.ps"><code>cat.ps</code></a></dt>
-<dd>Appends one file to another. Primarily used to overcome the
-'copy' limitation of Windows command shell for ps2epsi</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/cid2code.ps"><code>cid2code.ps</code></a></dt>
-<dd>A utility for creating maps from CIDs to Unicode, useful when
-substituting a TrueType font for an Adobe font.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/docie.ps"><code>docie.ps</code></a></dt>
-<dd>An emulation of the CIE color mapping algorithms.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/font2pcl.ps"><code>font2pcl.ps</code></a></dt>
-<dd>A utility to write a font as a PCL bitmap font.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/gslp.ps"><code>gslp.ps</code></a> *</dt>
-<dd>A utility for doing "line printing" of plain text files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/gsnup.ps"><code>gsnup.ps</code></a></dt>
-<dd>A file that you can concatenate in front of (very well-behaved)
-PostScript files to do N-up printing. It is deliberately simple and naive:
-for more generality, use <code>psnup</code> (which, however, requires DSC
-comments).</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/jispaper.ps"><code>jispaper.ps</code></a></dt>
-<dd>A file that makes the <code>b0</code> through <code>b6</code>
-procedures refer to JIS B paper sizes rather than ISO B.</dd>
-</dl>
-
-
-<dl>
-<dt><a href="../lib/landscap.ps"><code>landscap.ps</code></a></dt>
-<dd>A file that you can put in front of your own files to get them rendered
-in landscape mode.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/mkcidfm.ps"><code>mkcidfm.ps</code></a></dt>
-<dd>A utility for creating a CID font mapping table <code>cidfmap</code>
-from fonts found in a specified directory.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/pdf2dsc.ps"><code>pdf2dsc.ps</code></a></dt>
-<dd>A utility to read a PDF file and produce a DSC "index" file.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/pf2afm.ps"><code>pf2afm.ps</code></a> *</dt>
-<dd>A utility for producing AFM files from PFA, PFB, and optionally PFM
-files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/pfbtopfa.ps"><code>pfbtopfa.ps</code></a> *</dt>
-<dd>A utility to convert PFB (binary) font files to PFA (text) format.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/prfont.ps"><code>prfont.ps</code></a></dt>
-<dd>A utility to print a font catalog.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/printafm.ps"><code>printafm.ps</code></a></dt>
-<dd>A utility to print an AFM file on standard output.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/ps2ai.ps"><code>ps2ai.ps</code></a></dt>
-<dd>A utility for converting an arbitrary PostScript file into a form
-compatible with Adobe Illustrator. NOTE: <code>ps2ai</code> doesn't
-work properly with Adobe's Helvetica-Oblique font, and other fonts whose
-original <code>FontMatrix</code> involves skewing or rotation.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/ps2epsi.ps"><code>ps2epsi.ps</code></a> *</dt>
-<dd>A utility for converting an arbitrary PostScript file into EPSI form.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/rollconv.ps"><code>rollconv.ps</code></a></dt>
-<dd>A utility for converting files produced by Macromedia's
-<code>Rollup</code> program to a Type 0 form directly usable by
-Ghostscript.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/stocht.ps"><code>stocht.ps</code></a></dt>
-<dd>A file that installs the StochasticDefault halftone as the default,
-which may improve output quality on inkjet printers. See the file for more
-information.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/viewcmyk.ps"><code>viewcmyk.ps</code></a></dt>
-<dd>A utility for displaying CMYK files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/viewgif.ps"><code>viewgif.ps</code></a></dt>
-<dd>A utility for displaying GIF files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/viewjpeg.ps"><code>viewjpeg.ps</code></a></dt>
-<dd>A utility for displaying JPEG files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/viewmiff.ps"><code>viewmiff.ps</code></a></dt>
-<dd>A utility for displaying MIFF files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/viewpbm.ps"><code>viewpbm.ps</code></a></dt>
-<dd>A utility for displaying PBM/PGM/PPM files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/viewpcx.ps"><code>viewpcx.ps</code></a></dt>
-<dd>A utility for displaying PCX files.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/viewrgb.ps"><code>viewrgb.ps</code></a></dt>
-<dd>A utility for displaying files created by -sDEVICE=bitrgb.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/viewraw.ps"><code>viewraw.ps</code></a></dt>
-<dd>An extended utility for displaying files created by -sDEVICE=bitrgb.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Development_tools"></a>Development tools</h2>
-
-<p>
-These files are found in the <code>lib</code> subdirectory of
-the Ghostscript source distribution.</p>
-
-<dl>
-<dt><a href="../lib/acctest.ps"><code>acctest.ps</code></a></dt>
-<dd>A utility that checks whether the interpreter enforces access
-restrictions.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/image-qa.ps"><code>image-qa.ps</code></a></dt>
-<dd>A comprehensive test of the image display operators.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/ppath.ps"><code>ppath.ps</code></a></dt>
-<dd>A couple of utilities for printing out the current path, for debugging.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/pphs.ps"><code>pphs.ps</code></a></dt>
-<dd>A utility to print the Primary Hint Stream of a linearized PDF file.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/traceimg.ps"><code>traceimg.ps</code></a></dt>
-<dd>Trace the data supplied to the <code>image</code> operator.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/traceop.ps"><code>traceop.ps</code></a></dt>
-<dd>A utility for tracing uses of any procedure or operator for debugging.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/uninfo.ps"><code>uninfo.ps</code></a></dt>
-<dd>Some utilities for printing out PostScript data structures.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/viewps2a.ps"><code>viewps2a.ps</code></a></dt>
-<dd>A utility for displaying the output of <code>ps2ascii.ps</code>.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/winmaps.ps"><code>winmaps.ps</code></a></dt>
-<dd>A utility for creating mappings between the Adobe encodings and the
-Microsoft Windows character sets.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/zeroline.ps"><code>zeroline.ps</code></a></dt>
-<dd>A utility for testing how interpreters handle zero-width lines.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Miscellany"></a>Odds and ends</h2>
-
-<p>
-These files are found in the <code>lib</code> subdirectory of
-the Ghostscript source distribution.</p>
-
-<dl>
-<dt><a href="../lib/jobseparator.ps"><code>jobseparator.ps</code></a></dt>
-<dd>Convience file containing a job separator sequence for use
-when passing files with -dJOBSERVER.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/lines.ps"><code>lines.ps</code></a></dt>
-<dd>A test program for line joins and caps.</dd>
-</dl>
-
-<dl>
-<dt><a href="../lib/stcinfo.ps"><code>stcinfo.ps</code></a></dt>
-<dd>Print and show parameters of the (Epson) <code>stcolor</code> driver.</dd>
-</dl>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Readme.htm b/doc/Readme.htm
deleted file mode 100644
index 781c6485..00000000
--- a/doc/Readme.htm
+++ /dev/null
@@ -1,560 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Overview of Ghostscript</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Introduction</h1>
-
-<p>
-This document is a roadmap to the Ghostscript documentation.
-After looking through it, if you want to install Ghostscript and not only
-use it, we recommend you read <a href="Install.htm">how to install
-Ghostscript</a>, and <a href="Make.htm">how to compile Ghostscript</a> from
-source code (which is necessary before installing it on Unix and VMS
- systems).</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-
-
-<!-- [1.2 begin table of contents] ========================================= -->
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="WhatIsGS.htm">What is Ghostscript?</a></li>
- <li>
- <ul>
- <li><a href="WhatIsGS.htm#GhostPDF">What is GhostPDF?</a></li>
- <li><a href="WhatIsGS.htm#GhostPCL">What is GhostPCL?</a></li>
- <li><a href="WhatIsGS.htm#GhostXPS">What is GhostXPS?</a></li>
- <li><a href="WhatIsGS.htm#GhostSVG">What is GhostSVG?</a></li>
- <li><a href="WhatIsGS.htm#GhostPDL">What is GhostPDL?</a></li>
- </ul>
- </li>
- <li><a href="#Theme_roadmap">Document roadmap by theme</a></li>
- <li>
- <ul>
- <li><a href="#New_users">What should I read if I'm a new user?</a></li>
- <li><a href="#Two_Ghostscripts">GPL Ghostscript and commercial Ghostscript</a></li>
- <li><a href="#Before_building">Before building Ghostscript</a></li>
- <li><a href="#Not_a_new_user">What should I read if I'm not a new user?</a></li>
- <li><a href="#Developer">What if I'm a developer?</a></li>
- <li><a href="#Writer">What if I'm writing documentation?</a></li>
- </ul>
- </li>
-
- <li><a href="#Web_presence">Presence on the World Wide Web</a></li>
- <li>
- <ul>
- <li><a href="#Web_home_page">Ghostscript's home pages</a></li>
- <li><a href="#Adobe_documentation">Adobe PostScript, Encapsulated
- PostScript, and PDF reference documentation</a></li>
- <li><a href="#Web_other">Other material on the WWW</a></li>
- </ul>
- </li>
-
- <li><a href="#Ordered_roadmap">Which document contains what?</a></li>
- <li>
- <ul>
- <li>Primarily for users:</li>
- <li>
- <table>
- <tr colspan="3">
- <td width="33%">
- <a href="Deprecated.htm">Deprecated.htm</a><br>
- <a href="Devices.htm">Devices.htm</a><br>
- <a href="Ps2epsi.htm">Ps2epsi.htm</a></td>
- <td width="33%">
- <a href="VectorDevices.htm">VectorDevices.htm</a><br>
- <a href="#Readme">Readme.htm</a></td>
- <td width="33%">
- <a href="Unix-lpr.htm">Unix-lpr.htm</a><br>
- <a href="Use.htm">Use.htm</a></td></tr>
- </table>
- </li>
- <li>
- <li>For both users and developers:</li>
- <li>
- <table>
- <tr colspan="3">
- <td width="33%">
- <a href="Fonts.htm">Fonts.htm</a><br>
- <a href="History9.htm">History*.htm</a><br>
- <a href="Install.htm">Install.htm</a><br></td>
- <td width="33%">
- <a href="Language.htm">Language.htm</a><br>
- <a href="Make.htm">Make.htm</a><br>
- <a href="News.htm">News.htm</a></td>
- <td width="33%">
- <a href="Psfiles.htm">Psfiles.htm</a><br>
- <a href="#COPYING">COPYING</a><br>
- <a href="thirdparty.htm">thirdparty.htm</a></td></tr>
- </table>
- </li>
- <li>
- <li>Primarily for developers:</li>
- </li>
- <li>
- <table>
- <tr colspan="3">
- <td width="33%">
- <a href="API.htm">API.htm</a><br>
- <a href="C-style.htm">C-style.htm</a><br>
- <a href="DLL.htm">DLL.htm</a><br>
- <a href="Internal.htm">Internal.htm</a><br></td>
- <td>
- <a href="Lib.htm">Lib.htm</a><br>
- <a href="Develop.htm">Develop.htm</a><br>
- <a href="Drivers.htm">Drivers.htm</a></td>
- <td>
- <a href="Ps-style.htm">Ps-style.htm</a><br>
- <a href="Release.htm">Release.htm</a><br>
- <a href="Source.htm">Source.htm</a><br></td></tr>
- </table>
- </li>
- </ul>
- </li>
-</ul>
-<br>
-<!-- [1.2 end table of contents] =========================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Theme_roadmap"></a>Document roadmap by theme</h2>
-
-<h3><a name="New_users"></a>What should I read if I'm a new user?</h3>
-
-<ul>
-
- <li>how to <a href="Use.htm">use Ghostscript</a>. This includes both
- a quickstart introduction to the commandline version and more extensive
- reference material.</li>
-
- <li>detailed information about <a href="Devices.htm">specific
- devices</a> that Ghostscript can use for output</li>
-
- <li>more detailed information about how to use Ghostscript under
- Unix with <code>lpr</code> <a href="Unix-lpr.htm">as a filter</a>
- for printing</li>
-
- <li>for information about known problems or to report a new one,
- please visit <a href="http://bugs.ghostscript.com/">bugs.ghostscript.com</a>
- but remember that free versions of Ghostscript come with with
- <strong>NO WARRANTY</strong> and <strong>NO SUPPORT</strong></li>
-</ul>
-
-<h3><a name="Two_Ghostscripts"></a>GPL and commercial Ghostscript</h3>
-<p>
-GPL Ghostscript, Artifex Ghostscript and AFPL Ghostscript are different releases.</p>
-
-<ul>
- <li>additional information about <a href="COPYING">GPL Ghostscript
- releases</a> that is not relevant to commercial versions.</li>
-</ul>
-
-<p>
-If you run into any questions, or if you are going to be using Ghostscript
- extensively, you should at least skim, and probably eventually read:</p>
-
-<ul>
- <li> about the <a href="Fonts.htm">fonts distributed with
- Ghostscript</a>, including how to add or replace fonts</li>
-
- <li> a description of <a href="Language.htm">the Ghostscript language</a>,
- and its differences from the documented PostScript language</li>
-
- <li> about the <a href="Psfiles.htm">postscript files distributed with
- Ghostscript</a> (other than fonts)</li>
-</ul>
-
-<h3><a name="Before_building"></a>Before building Ghostscript</h3>
-
-<p>
-If you are going to compile Ghostscript from source, rather than just use an executable
- you got from somewhere, you may want to read:</p>
-
-<ul>
- <li> <a href="Make.htm">how to build Ghostscript</a> and
- <a href="Install.htm">install it</a></li>
-</ul>
-
-<hr>
-
-<h2><a name="Not_a_new_user"></a>What should I read if I'm not a new user?</h2>
-
-<p>
-If you have already used Ghostscript, when you receive a new release you
- should begin by reading this file, then:</p>
-
-<ul>
- <li> <a href="News.htm">News</a>, for incompatible changes and new
- features in the current release;</li>
-
- <li> if you wish, History#.htm (currently <a
- href="History9.htm">History9.htm</a>), for changes in the current and earlier releases.</li>
-</ul>
-
-<hr>
-
-<h2><a name="Developer"></a>What if I'm a developer?</h2>
-
-<p>
-If you are going to do any development on or with Ghostscript at all, you
-should at least look at:</p>
-
-<ul>
- <li>the <a href="Develop.htm">roadmap documentation</a> for Ghostscript's
- source files and architecture</li>
-</ul>
-
-<p>
- If you are going to write a new driver for Ghostscript, you should read:</p>
-
-<ul>
- <li> the <a href="Source.htm">guide to the Ghostscript source code</a></li>
-
- <li> the interface between Ghostscript and <a href="Drivers.htm">device
- drivers</a></li>
-</ul>
-
-<p>
-If you are considering distributing GPL Ghostscript in conjunction
-with a commercial product, you should read the
- <a href="COPYING">license</a> carefully, and you should also read</p>
-
-<ul>
- <li> additional clarification of the circumstances under which Ghostscript
- can be distributed with a commercial product</li>
-</ul>
-
-<p>
-If you intend to use Ghostscript in the form of a dynamic link library
-(DLL) under OS/2 or Microsoft Windows or in the form of shared object
-under Linux, read</p>
-
-<ul>
- <li> documentation on <a href="API.htm">Ghostscript Interpreter API</a></li>
-</ul>
-
-<p>
-If you want to use Ghostscript as part of another program--as a callable
-PostScript language interpreter--and not as a DLL or as a self-contained
-executable application, you should begin by reading:</p>
-
-<ul>
- <li> the source file <code>imain.h</code>, the documented
- API for Ghostscript <em>not</em> as a DLL</li>
-</ul>
-
-<p>
-or if you are going to use only the Ghostscript graphics library:</p>
-
-<ul>
- <li> about the structure of the <a href="Lib.htm">Ghostscript library</a>
- and its interfaces</li>
-
-</ul>
-
-<hr>
-
-<h2><a name="Writer"></a>What if I'm writing documentation?</h2>
-
-<p>
-If you are editing or adding to Ghostscript's existing documentation in
- HTML format, or writing a new document, you should contact us on our
- IRC channel or the <code>gs-devel</code> mailing list for guidance,
- links to those are on: <a href="https://www.ghostscript.com">www.ghostscript.com</a>.
-</p>
-
-<hr>
-
-<h2><a name="Web_presence"></a>Presence on the World Wide Web</h2>
-
-<h3><a name="Web_home_page"></a>Ghostscript's home page</h3>
-
-<p>
-Ghostscript has a home page on the World Wide Web with helpful information
-such as the FAQ (Frequently Asked Questions):</p>
-
-<blockquote>
-<a href="http://www.ghostscript.com/" class="offsite">http://www.ghostscript.com/</a>
-</blockquote>
-
-<h3><a name="Adobe_documentation"></a>Adobe PostScript, Encapsulated
-PostScript, and PDF reference documentation</h3>
-
-<p>
-Adobe makes a wealth of technical documentation available over the Web,
- including the
-<a href="http://partners.adobe.com/public/developer/en/ps/PLRM.pdf"
-class="offsite">
-PostScript Language Reference Manual (Third Edition)</a>; the
-<a href="http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf"
-class="offsite">
-Encapsulated PostScript</a> (EPS) Format Specification version 3, including
-<a href="#Ps2epsi">Encapsulated PostScript Interchange (EPSI)</a>
- format; the
-<a href="http://partners.adobe.com/public/developer/pdf/index_reference.html"
-class="offsite">PDF Reference manuals</a>.
-The <a href="http://partners.adobe.com/public/developer/acrobat/sdk/index.html"
-class="offsite">Acrobat SDK</a> contains
-<a href="http://partners.adobe.com/public/developer/acrobat/sdk/index_doc.html" class="offset">
-pdfmark and Acrobat Distiller parameters</a> documentation.
-Some of these documents
-are also available at <a href="ftp://ftp.adobe.com/pub/adobe/"
-class="offsite">Adobe's ftp
- site</a>, but not necessarily under the same filenames.</p>
-
-<h3><a name="Web_other"></a>Other material on the WWW</h3>
-
-<p>
-Much other material about Ghostscript is available on the World Wide Web,
-both as web pages and as archived Usenet and mailing list discussions. Use
- the well-known search engines to find such material.</p>
-
-<hr>
-
-<h2><a name="Ordered_roadmap"></a>Which document contains what?</h2>
-
-<p> Here is the list in alphabetic order of Ghostscript documentation,
-with explanations of the contents.</p>
-
-<dl>
-<dt><a name="API"></a><a href="API.htm"><b>API.htm</b></a>
-<dd>On MS-Windows and OS/2, Ghostscript is compiled as a dynamic
-link library (DLL). On Linux, Ghostscript can be compiled as
-a shared object. This describes how to use it. For developers.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="C-style"></a><a href="C-style.htm"><b>C-style.htm</b></a>
-<dd> Guidelines and style for C coding, which you should follow
-if, for example, you <a href="#Drivers">write a new driver</a> or add or
-change something in Ghostscript. For developers.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="DLL"></a><a href="DLL.htm"><b>DLL.htm</b></a>
-<dd> On OS/2, MS Windows-16 and MS Windows-32 platforms, Ghostscript is
-compiled as a dynamic link library (DLL). This describes how to use it.
-For developers. <b>This DLL interface is obsolete.</b>
-Use <a href="#API"><b>API.htm</b></a> instead.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Develop"></a><a href="Develop.htm"><b>Develop.htm</b></a>
-<dd> Code orientation for developers. Contains a detailed breakdown of
-the source files by functional group, and overviews of the major
-architectural features and services.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Deprecated"></a><a href="Deprecated.htm"><b>Deprecated.htm</b></a></dt>
-<dd> Documention for deprecated devices and features. Features described here
-will be removed in future versions of Ghostscript.</dd>
-</dl>
-
-<dl>
-<dt><a name="Devices"></a><a href="Devices.htm"><b>Devices.htm</b></a>
-<dd> Detailed information about some specific devices for which Ghostscript
-can produce output. Run "<code>gs&nbsp;-h</code>" to see which
-devices a particular version of Ghostscript is built to use.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Drivers"></a><a href="Drivers.htm"><b>Drivers.htm</b></a>
-<dd> Describes the interface between Ghostscript and device drivers. If
-you do this, you should also read and use the <a href="#C-style">C style
-and coding guidelines</a>. Necessary to develop a new driver. For
-developers.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Fonts"></a><a href="Fonts.htm"><b>Fonts.htm</b></a> <dd> All
-about fonts freely available for Ghostscript, and how to add and use new
-fonts. Also describes how to use Ghostscript fonts as X Windows fonts. For
-both users and developers.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="History"></a><b>History*.htm</b>
-<dd> The history of changes in all Ghostscript releases:
-<blockquote>
-<a href="History9.htm">History9.htm</a> for Ghostscript versions 9.n<br>
-</blockquote></dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Install"></a><a href="Install.htm"><b>Install.htm</b></a>
-<dd> How to install Ghostscript. See also <a href="#Make">how to build
-it</a>.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Internal"></a><a href="Internal.htm"><b>Internal.htm</b></a>
-<dd> Description of operators that are for internal/developer use only.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Language"></a><a href="Language.htm"><b>Language.htm</b></a>
-<dd> The relationship between the Ghostscript interpreter and the
-PostScript language as defined by Adobe.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Lib"></a><a href="Lib.htm"><b>Lib.htm</b></a>
-<dd> A description of the Ghostscript library, a set of procedures to
-implement the graphics and filtering capabilities that are primitive
-operations in the PostScript language and in Adobe Portable Document Format
-(PDF). For developers.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Make"></a><a href="Make.htm"><b>Make.htm</b></a>
-<dd> How to build Ghostscript executables from the source code. See also
-<a href="#Install">how to install it</a>. It's not necessary to be a highly
-experienced developer to build or install Ghostscript, but some experience
-is needed.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="News"></a><a href="News.htm"><b>News.htm</b></a>
-<dd> A brief description of the latest release or pre-release of
-Ghostscript, and a list of any incompatible changes in it. Changes in older
-releases are described in the history files "<code>History*.htm</code>",
-which are usually installed in the documentation directory. Run
-"<code>gs&nbsp;-h</code>" to see where that is.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Ps-style"></a><a
-href="Ps-style.htm"><b>Ps-style.htm</b></a>
-<dd> The guidelines and style for postscript coding in Ghostscript. Some
-of Ghostscript is implemented in the postscript language itself, and
-various utilities and examples are distributed with it. You should
-follow these guidelines if you're extending or modifying those files.
-For developers.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Ps2epsi"></a><a href="Ps2epsi.htm"><b>Ps2epsi.htm</b></a>
-<dd> Detailed information on how to use Ghostscript through
-<code>ps2epsi</code> to convert PostScript to Adobe
-Encapsulated PostScript Interchange (EPSI) format.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Vector"></a><a href="VectorDevices.htm"><b>VectorDevices.htm</b></a>
-<dd> Detailed information on how to use Ghostscript, GhostPCL and GhostXPS to convert PostScript, PDF, XPS, PCL or PXL input to Adobe
-Portable Document Format (PDF), Adobe PostScript Level 2, Adobe Encapsulated PostScript Level 2, Open XML (XPS) or PCL-XL.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Psfiles"></a><a href="Psfiles.htm"><b>Psfiles.htm</b></a>
-<dd> A description of the PostScript files (other than font files)
-distributed with Ghostscript, including initialization routines, utility
-programs, and sample printable files.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="THIRDPARTY"></a><a href="thirdparty.htm"><b>thirdparty.htm</b></a>
-<dd>
-Contains a table of "third party libraries" (that is, code from outwith the
-Ghostscript/GhostPDL project) that we import to our project and supply in our
-releases. Including the purpose they serve, the version we QA and ship, the
-license under which the code distributed and the URL for the "upstream"
-project.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="COPYING"></a><a href="COPYING"><b>COPYING</b></a>
-<dd> The GNU Affero General Public License, which states the conditions for using
-and redistributing GPL Ghostscript.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Readme"></a><b>Readme.htm</b>
-<dd> This document.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Release"></a><a href="Release.htm"><b>Release.htm</b></a>
-<dd> A description of how to prepare and test a Ghostscript release. Of
-interest only to developers who want to create new Ghostscript versions for
-distribution.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Source"></a><a href="Source.htm"><b>Source.htm</b></a>
-<dd> A guide to the Ghostscript source code, for development and debugging.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Unix-lpr"></a><a href="Unix-lpr.htm"><b>Unix-lpr.htm</b></a>
-<dd> How to set up Ghostscript as a Unix <code>lpr</code>
-filter.</dd></dt>
-</dl>
-
-<dl>
-<dt><a name="Use"></a><a href="Use.htm"><b>Use.htm</b></a>
-<dd> Detailed instructions on how to use Ghostscript, including such
-matters as designating an output device; choosing a default paper size;
-how Ghostscript finds files, including font files; how it uses environment
-variables; notes on specific platforms, including the X Window System; and
-command-line options.</dd></dt>
-</dl>
-</ul>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Release.htm b/doc/Release.htm
deleted file mode 100644
index bb3c37dd..00000000
--- a/doc/Release.htm
+++ /dev/null
@@ -1,824 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>How to Prepare a Ghostscript Release</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>How to Prepare a Ghostscript Release</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Introduction">Introduction</a></li>
- <li><a href="#Servers">Servers</a></li>
- <li>
- <ul>
- <li><a href="#Development_files">Development sources and bug reports</a></li>
- <li><a href="#Distribution">Distribution</a></li>
- </ul>
- </li>
- <li><a href="#Release_numbering">Release numbering</a></li>
- <li><a href="#Making_distributions">Making distributions</a></li>
- <li>
- <ul>
- <li><a href="#Preparing_source">Preparing the source code</a></li>
- <li><a href="#Testing">Testing</a></li>
- <li><a href="#Changelog">Updating the Changelog</a></li>
- <li><a href="#Making_Tarballs">Making the source distribution</a></li>
- <li><a href="#Testing_on_Windows">Testing on Windows</a></li>
- <li><a href="#Windows_distribution">Building the Windows distribution</a></li>
- <li><a href="#Finishing_up">Finishing up</a></li>
- <li><a href="#Beta_distributions">Beta distributions</a></li>
- <li><a href="#Public_releases">Public releases</a></li>
- </ul>
- </li>
- <li><a href="#After_releasing">After releasing</a></li>
- <li><a href="#GPL_releases">GPL Ghostscript releases</a></li>
- <li>
- <ul>
- <li><a href="#GPL_code">AGPL code</a></li>
- <li><a href="#GPL_after_releasing">After releasing (AGPL)</a></li>
- </ul>
- </li>
- <li><a href="#Fonts">Fonts</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a> and the instructions on how to <a href="Make.htm">build
-Ghostscript</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Introduction"></a>Introduction</h2>
-
-<p>
-This document describes the process for making new Ghostscript releases.
-Please note
-that while the the license allows anyone to prepare and distribute
-releases in accordance with its terms and conditions, this document is
-really meant only to document the process used by Artifex Software, Inc.
-However, the eventual purpose of this document is to describe
-Ghostscript release procedures in enough detail that someone who knows
-little about Ghostscript but is generally familiar with the platform on
-which the procedure is being carried out can execute the procedures
-correctly. So if you add or changing anything to/in this document,
-be sure to specify all command lines, file names, etc. in explicit
-detail.
-
-<p>
-If you do plan to make your own distribution, please be aware of some items
-you will want to change.
-
-<ul>
-
-<li>If you make any significant changes, please edit
-<code>base/gscdef.c</code> to change <code>GS_PRODUCTFAMILY</code>
-and <code>GS_PRODUCT</code> from "GPL Ghostscript" to something else,
-in order to avoid confusion with Artifex releases.
-
-<li>In the same file, you may also want to edit <code>GS_COPYRIGHT</code>
-to add your own copyright notice (although you must not remove any
-notice that is there).
-
-<li>You will almost certainly want to edit <code>version.mak</code> to
-change the revision date, <code>GS_REVISIONDATE</code>.
-
-<li>If you want to change the release number, you must change it in all the
-places listed under <a href="#Release_numbering">"Release numbering"</a>
-below.
-
-</ul>
-<hr>
-<h2><a name="Servers"></a>Servers</h2>
-
-<p>
-The GPL Ghostscript files are maintained on sites accessible to
-the public. One specific site hosts the active SVN repository for code,
-data, and documentation, and the bug report data base; several sites
-offer distributions with release numbers, intended for wider
-distribution.
-
-<h3><a name="Development_files"></a>Development sources and bug reports</h3>
-
-<p>
-The primary repository for GPL Ghostscript is <a
-href="http://www.ghostscript.com/" class="offsite">ghostscript.com</a>.
-Please check there first for any news about releases or current work,
-and for information about where to download ghostscript and how to
-access the mailing lists.
-
-Development source access is through <a
-href="http://svn.ghostscript.com/"
-class="offsite">svn.ghostscript.com</a>.
-
-<p>
-It may also be helpful to
-read the SourceForge Ghostscript home page (<a
-href="http://sourceforge.net/projects/ghostscript/"
-class="offsite">http://sourceforge.net/projects/ghostscript/</a>).
-
-<h3><a name="Distribution"></a>Distribution</h3>
-
-<p>
-Stable, beta, and development releases are all available from
-<blockquote>
-<br>
-<a href="http://ghostscript.com/download/"
-class="offsite">http://ghostscript.com/download/</a>
-</blockquote>
-<hr>
-<h2><a name="Release_numbering"></a>Release numbering</h2>
-
-<p>
-Ghostscript uses a two-part (major.minor) release number. The second part
-of the release number is a 2-digit decimal fraction: it counts 00,
-01, 02, and so on through 99.
-
-<ul>
-
-<li>Release numbers N.0x and N.5x indicate stable versions.
-<li>Successive increments generally indicate bug fixes and minor enhancements.
-<li>Development, testing and beta releases generally begin with a minor release number that is
-a multiple of ten and increment from there.
-</ul>
-
-<p>
-Release numbers appear in the following places in the Ghostscript files:
-
-<ul>
-
-<li>In <code>Resource/Init/gs_init.ps</code>, as an integer (release
-number x100) at the beginning of the
-file just after the initial comment blocks.
-
-<li>In <code>base/version.mak</code>, split into 3 lines.
-
-<li>In <code>doc/News.htm</code>, in the two headers and their labels and at the very end in
-the copyright footer.
-
-<li>At the foot of most documenation files. However, these are updated mechanically from the value
-in <code>News.htm</code> as part of the release process and do not need to be maintained
-directly.
-</ul>
-
-<h3>Before a release</h3>
-
-<p>
-The current release number in the development code must be set to the desired value. The increment
-from just after the previous release (see below) is sufficient for minor updates. In the case of
-major changes or a new stable release, the number will need to be bumped; this is generally done
-as the first step of preparing a new release.
-
-<h3>After a release</h3>
-
-<p>
-After making a release the release number in the repository is
-incremented. Thus versions built from svn are always marked with a
-future (or unused) release number to avoid confusion.
-
-<p>
-Additionally, After an N.00 or N.50 stable release, a branch is made in svn so that development
-can continue independently of changes to the stable series. When this happens, the minor release
-number is incremented by 10 (or 20) on the development branch (and by 1 on the new stable branch,
-as above) to avoid collisions.
-
-<p>
-While incrementing the release number after making a release may seem
-counter-intuitive, it ensures that, at any given time, the version
-number alone is sufficient to distinguish between the current SVN
-state and a numbered release.
-<hr>
-<h2><a name="Making_distributions"></a>Making distributions</h2>
-
-<p>
-This document only discusses source distributions. Source distributions
-currently can only be made on Linux systems (but it probably wouldn't take
-much work to support other Unix systems). Ghostscript as distributed also
-often includes executables or other packages for the Windows and MacOS
-environments, but upstream does not always produce these, and this
-document does not discuss them.
-
-<p>
-To make a source distribution, you will need the scripts and data files in
-the <code>toolbin/</code> directory. The instructions below generally
-assume that you're invoking the relative to the top level of the source
-tree.
-
-To run the scripts, you will need reasonably current versions of Tcl,
-freely available from Scriptics
-(<a class="offsite" href="http://www.scriptics.com"><tt>http://www.scriptics.com</tt></a>), and
-Python, freely available from <a class="offsite"
-href="http://www.python.org"><tt>http://www.python.org</tt></a>.
-
-<p>
-The instructions below also refer to some files that are deliberately
-omitted from the public distribution, because they are not freely
-redistributable. You will need to provide similar files for your
-environment.
-
-<blockquote><pre>
-<code>data/*/*.ps</code> (PostScript files) - needed for smoke testing
-</pre></blockquote>
-
-<h3><a name="Preparing_source"></a>Preparing the source code</h3>
-
-<p>
-If necessary, update the release number by incrementing it as described in
-<a href="#Release_numbering">Release numbering</a> above.
-
-<p>
-Update references to the date for release:
-
-<ul>
-
-<li>In <code>version.mak</code>, the numeric date.
-
-<li>In <code>doc/News.htm</code>, in two places, skipping the Id:
-line. That is, in parentheses after the <tt>VERSION X.YY</tt> heading,
-and in the copyright footer both the year and the release date.
-
-<li>In <code>psi/dwsetup.rc</code> and <code>psi/winint.mak</code>,
-update the year in the embedded copyright notice.
-
-</ul>
-
-<p>
-We recommend using a UTC release date to avoid timezone skew.
-
-<p>
-Also in <code>doc/News.htm</code>, update the number of the highest
-closed bug and the list of open bugs.
-
-<p>
-Check in <code>gscdef.c</code> that the definition of
-<code>GS_PRODUCT</code> includes the appropriate one of "DEVELOPMENT
-RELEASE", "BETA RELEASE", or neither, and does not include "SVN PRE-RELEASE".
-
-<p>Run the source-consistency checks from the test suite:
-
-<blockquote><pre>
-toolbin/tests/check_all.py --gsroot=.
-</pre></blockquote>
-Where the argument of --gsroot is the path to the top level of the
-source tree. Fix any problems it indicates, and commit them to svn.
-
-<p>
-Check for patched configuration parameters, <code>#define TEST</code>s,
-version/date inconsistencies, and mismatches between the working directory
-and the SVN repository by running:
-
-<blockquote><pre>
-toolbin/pre.tcl
-</pre></blockquote>
-
-<p>
-This program compares the result of various greps against a check file,
-writing the results of grep on one output file and the differences from the
-check file on another. See the source code for the default file names. The
-important one is the check file,
-<code>toolbin/pre.chk</code>. <code>pre.tcl</code> also verifies
-that the
-right information is in the following places:
-<ul>
-<li>release number in <code>man/*.1</code>, <code>doc/*.htm</code>,
-<code>version.mak</code>, <code>doc/gs-vms.hlp</code>,
-<code>Resource/Init/gs_init.ps</code>
-<li>revision date in <code>man/*.1</code>, <code>doc/*.htm</code>,
-<code>version.mak</code>, <code>doc/gs-vms.hlp</code>
-<li>copyright year (if necessary) in <code>gscdef.c</code>
-<li>third-party library version number in <code>*.mak</code>
-</ul>
-
-<p>
-If necessary, run
-
-<blockquote><pre>
-toolbin/pre.tcl update
-</pre></blockquote>
-
-<p>
-to update the version and revision date in the doc files, and then run
-
-<blockquote><pre>
-toolbin/pre.tcl
-</pre></blockquote>
-
-<p>
-again. To confirm that everything is updated. You may have to commit to
-svn after the update to satify the script that all the dates are
-correct.
-
-<p>
-Check the consistency of the source code with the makefiles by
-running:
-
-<blockquote><pre>
-toolbin/gsmake.tcl check
-</pre></blockquote>
-
-This script assumes the top level makefile is named '<tt>makefile</tt>'.
-
-<p>
-Fix any problems and commit to svn.
-
-<h3><a name="Testing"></a>Testing</h3>
-
-<p>
-Edit your top-level the Makefile to set
-<blockquote><pre>
-FEATURE_DEVS=&#36;(FEATURE_DEVS_ALL)
-COMPILE_INITS=1
-</pre></blockquote>
-
-<p>
-This will help catch compilation problems.
-
-<p>
-Run
-
-<blockquote><pre>
-rm obj/*
-make -j2 &gt;&amp; make.log
-</pre></blockquote>
-
-<p>
-and look for warnings and errors in the log file.
-
-<p>
-Do a smoke test, updating the example paths as necessary:
-
-<blockquote><pre>
-unset GS_DEVICE GS_FONTPATH GS_LIB GS_OPTIONS
-./bin/gs -I./lib -I./fonts -dNOPAUSE -dBATCH toolbin/smoke.ps
-./bin/gs -I./lib -I./fonts -dNOPAUSE -dBATCH -sDEVICE=bitcmyk\
- -sOutputFile=/dev/null -r600 -dBufferSpace=200000 toolbin/smoke.ps
-</pre></blockquote>
-
-<p>
-This reads files named
-
-<blockquote><pre>
-<code>data/misc/*.ps</code>
-<code>data/ps/*.ps</code>
-<code>data/psl2/*.ps</code>
-<code>data/psl3/*.ps</code>
-</pre></blockquote>
-
-<p>
-(Edit <code>toolbin/smoke.ps</code> to use other test sets.)
-Watch for crashes, unusual error messages, or anomalous displayed output.
-If there are any problems, start over from the beginning of the process.
-
-<p>
-Undo the <code>FEATURE_DEVS</code> and <code>COMPILE_INITS</code>
-edits.
-
-<p>
-Run
-
-<blockquote><pre>
-svn commit
-</pre></blockquote>
-
-<p>
-to ensure the repository is up to date.
-
-<h3><a name="Changelog"></a>Updating the changelog</h3>
-
-<p>
-Create a new changelog by running
-
-<blockquote><pre>
-svn log -rHEAD:<i>rev</i> --xml --verbose &gt; doc/changelog.xml
-</pre></blockquote>
-
-where <i>rev</i> is the revision number of the branch point for the
-previous release.
-
-<p>
-This consolidates all the commit logs since the previous release in a
-readable format. You may also wish to remap user names in the
-&lt;author/&gt; tags of the output to the real names of the developers.
-
-<p>
-Create the html-format changes and details documents as follows:
-
-<blockquote><pre>
-cd doc
-../toolbin/split_changelog.py changelog.xml Changes.htm Details.htm
-cd ..
-</pre></blockquote>
-
-<p>
-The xml changelog file can now be deleted.
-
-<p>
-[Deprecated]<br>
-Copy the contents of News.htm and Changes.htm into a new section in
-History8.htm, and News.htm and Details.htm into Details8.htm. Then
-update the hyperlinks in History8.htm to point to Details8.htm instead
-of Details.htm so these remain valid after the next release.<br>
-[/Deprecated]<br>
-<br>
-As of Ghostscript 9.02, to reduce the pointless duplication of information,
-Changes.htm and Details#.htm have been deprecated.
-
-Copy the contents of Changes.htm into a new section in History9.htm, and ensure
-the links in News.htm are updated to reference the new section in History9.htm.
-
-<p>
-Then run
-
-<blockquote><pre>
-svn commit
-</pre></blockquote>
-
-<p>
-again to check in the Changes and history files.
-
-<h3><a name="Making_Tarballs"></a>Making the source distribution</h3>
-
-<p>
-First, tag the versions of the files in svn with the release version
-number.
-
-<blockquote>
-<pre><tt>svn cp svn+ssh://svn.ghostscript.com/svn/ghostscript/trunk/gs \
- svn+ssh://svn.ghostscript.com/svn/ghostscript/tags/ghostscript-#.##</tt></pre>
-</blockquote>
-
-If you've already tagged this release (e.g. in making an earlier
-release candidate) you'll need to svn rm the old tree first. We
-recommend just appending 'rc<i>n</i>' to the end of release candidate
-tag names, or a '.<i>n</i>' tiny release number to post-release fixes.
-
-<p>
-Pull a fresh copy for distribution from the repository:
-
-<blockquote><pre>
-<code>svn export http://svn.ghostscript.com/ghostscript/tags/ghostscript-#.##</code>
-</pre></blockquote>
-
-
-<p>
-Generate the text versions of the README document:
-
-<blockquote><pre>
-cd ghostscript-#.##
-lynx -dump -nolist doc/Readme.htm &gt; doc/README
-</pre></blockquote>
-
-<p>
-Add copies of needed third-party libraries for the release. Versions
-of the normally required ones are included in the repository so this
-is only needed when doing special feature releases.
-
-<p>
-For the unix source distributions only, generate the configure
-scripts. From the top level directory, run
-
-<blockquote><pre>
-./autogen.sh
-make distclean
-</pre></blockquote>
-
-This should create links to <tt>configure.ac</tt> and
-<tt>Makefile.in</tt> in the top level directory and
-invoke autoconf to create the <tt>configure</tt> script.
-
-<p>
-Also run <tt>make distclean</tt> in the <tt>jasper</tt> subdir to
-clean up any incidental config there. If you get a warning,
-for example if the build files think they need updating
-and not all the tools are available, be sure to run <tt>autoreconf &amp;&amp;
-make distclean</tt> to avoid version skew issues.
-You may also need to manually remove the <tt>autom4te.cache</tt> directory.
-
-<p>
-Move back to directory containing the distribution code and make the
-source archives with:
-
-<blockquote><pre>
-tar cvzf ghostscript-#.##.tar.gz ghostscript-#.##/*
-zcat ghostscript-#.##.tar.gz | bzip2 -c &gt; ghostscript-#.##.tar.bz2
-</pre></blockquote>
-
-<p>
-This creates the files
-
-<blockquote><pre>
-<code>ghostscript-#.##.tar.gz</code> (main archive)
-<code>ghostscript-#.##.tar.bz2</code> (main archive)
-</pre></blockquote>
-
-<p>
-The important issue is that the tarballs unpack into a directory
-of the same name, and that the code be a pristine copy without
-build or .svn housekeeping files.
-
-<p>
-It is also customary to make a <tt>gs###src.zip</tt> archive for the
-convenience of windows developers. See below.
-
-<h3><a name="Testing_on_Windows"></a>Testing on Windows</h3>
-
-<p>
-For Windows testing, you will need, in addition to the files listed
-under "<a href="#Preparing_source">Preparing the source</a>" above:
-<blockquote><pre>
-<code>toolbin/makewin.tcl</code>
-</pre></blockquote>
-
-<p>
-The following procedures rely on a large number of MS-DOS batch scripts that
-are not discussed here: they are unlikely to be generally useful.
-
-<p>
-Mount the Windows partition on <code>/c</code>, and create the
-<code>/c/work</code> directory if needed.
-
-<p>
-Make the zip archive of all files needed for a Windows build, and copy it to
-the Windows partition:
-
-<blockquote><pre>
-toolbin/makewin
-cp gs###.zip /c/work
-</pre></blockquote>
-
-<p>
-Boot into Windows. Unpack the archive:
-
-<blockquote><pre>
-cd \work
-unzip -oq gs###.zip
-gs###
-</pre></blockquote>
-
-<p>
-The <code>gs###.bat</code> script creates some necessary directories,
-sets up <code>PATH</code> and <code>GS_LIB</code> for testing, and
-makes the <code>gs#.##</code> directory current.
-
-<p>
-Build with the Borland compiler:
-
-<blockquote><pre>
-config bcwin32
-copy /y /b ..\gs\makefile
-erase obj\*.*
-make &gt; bc.log
-</pre></blockquote>
-
-<p>
-Smoke test the executables (both <code>gswin32</code> and
-<code>gswin32c</code>), as described above for source distributions.
-Then build with the Microsoft compiler:
-
-<blockquote><pre>
-config msvc32
-copy /y /b ..\gs\makefile
-erase obj\*.*
-nmake &gt; msvc.log
-</pre></blockquote>
-
-<p>
-Smoke test these executables too.
-
-<p>
-Building with the Watcom compiler doesn't work, because the
-<code>wmake</code> or <code>wmakel</code> program runs out of memory.
-However, if it did work, this is how to do it:
-
-<blockquote><pre>
-config watcw32
-copy /y /b ..\gs\makefile
-erase obj\*.*
-wmake -u &gt; watc.log
-</pre></blockquote>
-
-<p>
-Boot back into Linux. If testing in Windows revealed problems, edit the
-source files as necessary, and go back to <a
-href="#Preparing_source">"Preparing the source code."</a>
-
-<h3><a name="Windows_distribution"></a>Building the Windows distribution</h3>
-<p>
-Extract the sources from <code>ghostscript-N.NN.tar.gz</code>
-then repackage in a zip file as follows:
-<blockquote>
-<code>zip -r temp.zip gsN.NN/LICENSE gsN.NN/doc gsN.NN/examples
- gsN.NN/icclib gsN.NN/ijs gsN.NN/jasper gsN.NN/jbig2dec gsN.NN/jpeg
- gsN.NN/lib gsN.NN/libpng gsN.NN/base gsN.NN/psi gsN.NN/Resource
- gsN.NN/zlib</code>
-</blockquote>
-Unzip converting the line endings to CRLF:
-<blockquote>
-<code>unzip -a temp.zip<br>
-del temp.zip</code>
-</blockquote>
-Then finally zip up the sources to the distribution file:
-<blockquote>
-<code>zip -9 -r -X gsNNNsrc.zip gsN.NN</code>
-</blockquote>
-This method is reasonably portable, and does not convert binary
-files such as
-<code><a href="../examples/annots.pdf">examples/annots.pdf</a></code>.
-<p>
-Unzip <code>gsNNNsrc.zip</code>.
-The directory must be named <code>gsN.NN</code>.
-<p>
-Extract the fonts <code>ghostscript-fonts-std-#.##.tar.gz</code>
-into a directory <code>fonts</code> adjacent to the
-<code>gsN.NN</code> directory.
-The fonts are needed in this location for building
-the distribution archive later.
-<p>
-You will need the command line Info-Zip zip program available from
-<a href="http://www.info-zip.org/pub/infozip/">
-http://www.info-zip.org/pub/infozip/</a>
-Alternatively, the command line version of WinZip
-(<code>wzzip.exe</code>) can be used by replacing the
-Info-Zip command line options <code>-9 -r</code>
-with <code>-ex -P</code> in
-<code><a href="../psi/winint.mak">winint.mak</a></code>.
-<p>
-You will need WinZip Self-Extractor for building the
-self extracting archive. This is commercial software.
-You may need to update the path <code>WINZIPSE_XE</code> in
-<code><a href="../psi/winint.mak">winint.mak</a></code>.
-<p>
-Unzip the jpeg, libpng and zlib libraries, then make ghostscript
-as documented in <a href="Make.htm">Make.htm</a>.
-<p>
-Run the command <code>nmake archive</code>. This builds the distribution
-archive <code>gsNNNw32.exe</code> and an ordinary zip file
-<code>gsNNNw32.zip</code> in the parent directory.
-If you do not have WinZip Self-Extractor, you can use
-<code>nmake zip</code> to make <code>gsNNNw32.zip</code> only.
-
-<p>Starting with Ghostscript 9.x (Summer 2010), <code>nmake nsis</code> (msvc)
-or <code>make nsis</code> (Borland) builds an nsis-based installer
-<code>gsNNNw32.exe</code>. This requires
-<a href="http://nsis.sourceforge.net/">Nullsoft Scriptable Install System</a>.
-You may need to update the path <code>MAKENSIS_XE</code> in
-<code><a href="../psi/winint.mak">winint.mak</a></code>.
-
-<h3><a name="Finishing_up"></a>Finishing up</h3>
-
-<p>
-Upload <code>ghostscript-#.##.tar.*</code> to SourceForge (by anonymous
-FTP to <code>upload.sourceforge.net</code>, directory
-<code>/incoming</code>), and then post it using the "File Release"
-facility in the Ghostscript project. Put the release in the appropriate
-package, usually "GPL Ghostscript".
-If you are adding executable builds or source archives for other
-platforms to an existing source release, please use the same release
-date as the source release, not the current date.
-
-<h3><a name="Beta_distributions"></a>Beta distributions</h3>
-
-<p>
-Do the steps for distributions in general.
-
-<p>
-Upload <code>ghostscript-#.##.tar.*</code> to
-<code><a href="http://ghostscript.com/download/"
-class="offsite">http://ghostscript.com/download/</a>
-</code>.
-
-<h3><a name="Public_releases"></a>Public releases</h3>
-
-<p>
-Do the steps for distributions in general.
-
-<ul>
- <li>MS Windows source and executables:
-
-<blockquote><pre>
-<code>gs###w32.exe</code>
-<code>gs###w64.exe</code>
-</pre></blockquote>
-</li>
-<li>Third-party libraries, as links (upload these if not installed), where
-<code>&#36;&#36;&#36;</code> et al. refer to the version number of the library, which
-should be the latest compatible release of the library and should be
-consistent with the values of and version numbers specifically listed in
- the makefiles.</li>
-</ul>
-<blockquote><pre>
-<code>jpegsrc.v&#36;&#36;.tar.gz</code> -&gt; <code>../../3rdparty/jpegsrc.v&#36;&#36;.tar.gz</code>
-<code>libpng-&#36;.&#36;.&#36;.tar.gz</code> -&gt; <code>../../3rdparty/libpng-&#36;.&#36;.&#36;.tar.gz</code>
-<code>zlib-&#36;.&#36;.&#36;.tar.gz</code> -&gt; <code>../../3rdparty/zlib-&#36;.&#36;.&#36;.tar.gz</code>
-<code>jpegsr&#36;&#36;.zip</code> -&gt; <code>../../3rdparty/jpegsr&#36;&#36;.zip</code>
-<code>lpng&#36;&#36;&#36;.zip</code> -&gt; <code>../../3rdparty/lpng&#36;&#36;&#36;.zip</code>
-<code>zlib&#36;&#36;&#36;.zip</code> -&gt; <code>../../3rdparty/zlib&#36;&#36;&#36;.zip</code>
-</pre></blockquote>
-
-<p>In any case, the names of the links in the distribution directory should reflect
-the original name of the upstream file.</p>
-
-<ul>
-<li>Fonts, where <code>&#36;.&#36;&#36;</code> refers to the most recent version
-number of the fonts:
-
-<blockquote><pre>
-<code>ghostscript-fonts-other-&#36;.&#36;.tar.gz</code> -&gt; <code>../fonts/ghostscript-fonts-other-&#36;.&#36;.tar.gz</code>
-<code>ghostscript-fonts-std-&#36;.&#36;.tar.gz</code> -&gt; <code>../fonts/ghostscript-fonts-std-&#36;.&#36;.tar.gz</code>
-</pre></blockquote>
-</li>
-</ul>
-
-<p>
-(Note that the link names are somewhat inconsistent: some of them retain the
-version number of the file being referenced, and some of them use the
-Ghostscript release number. This is a historical artifact that might be
-changed someday.)
-
-<p>
-E-mail the release announcement using:
-<blockquote><pre>
-To: gs-announce
-</pre></blockquote>
-
-<p>
-Also update the documentation snapshots on the website.
-<hr>
-<h2><a name="After_releasing"></a>After releasing</h2>
-
-<p>
-Update the release number by incrementing it as described in <a
-href="#Release_numbering">Release numbering</a> above.
-
-<p>
-In <code>gscdef.c</code>, edit the definition of
-<code>GS_PRODUCT</code> to include "SVN PRE-RELEASE".
-
-<p>
-Edit <code>doc/News.htm</code> to remove all the content.
-
-<hr>
-<h2><a name="Fonts"></a>Fonts</h2>
-
-<p>
-Artifex Software, Inc. distributes a package of the base 35 PostScript
-fonts, and a package of other miscellaneous fonts.
-<p>
-These are included in the Ghostscript release archive.
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/SavedPages.htm b/doc/SavedPages.htm
deleted file mode 100644
index 23175b5f..00000000
--- a/doc/SavedPages.htm
+++ /dev/null
@@ -1,289 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Using Saved Pages ( --saved-pages=... )</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Using Saved Pages ( --saved-pages=... )</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Keywords">Saved Pages control keywords,</a></li>
- <li><a href="#Print_Keywords">Printing saved pages.</a></li>
- <li><a href="#Examples">Examples.</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-<p>
-Saved pages can be printed in any order, any number of times allowing for copy
-collation, manual 'duplex' printing or selecting a subset of pages.
-</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<p>
-Many raster printing devices and raster image format devices can use the command
-list (clist) to save the rendering information into files or memory based structures.
-Usually the clist data is rendered as soon as the page is complete, but it is`
-possible to defer rendering, then output (print) after the entire file has been
-converted to clist files.
-<p>
-Since each page is saved separately, the pages can be rendered from the clist
-files in any order, any number of times.
-<p>
-The saved pages are accumulated in clist form as files or in memory. The default
-clist storage is specified by the <code>BAND_LIST_STORAGE=</code> macro in the
-make file, but if <code>BAND_LIST_STORAGE=file</code>, the clist can be forced
-to be in memory using the <code>-sBandListStorage=memory</code> option.
-<hr>
-<h2><a name="Keywords"></a>Saved Pages control keywords</h2>
-<p>
-Deferring printing is controlled using the <code>--saved-page=...</code> option.
-<p>
-The string following the <code>--saved-page=</code> consists of keywords,
-separated by white-space, commas, or other non-alphanumeric characters
-such as ':', '=', ';'. If more than one keyword is given, the string should
-be enclosed in double-quotes (<code>"</code>).
-<p>
-The '<code>-</code>' (dash), and the '<code>*</code>' asterisk), are used in
-page range selections, and cannot be keyword separators.
-<p>
-Keywords are case independent, thus "<b><code>begin</code></b>",
-"<b><code>BEGIN</code></b>", and "<b><code>Begin</code></b>" are all equivalent.
-<p>
-<dl>
-<dt><code>begin</code>
-<dd>Begins accumulating pages to a list. The clist data for each page is
-saved in files or memory as discussed above, but no rendering is performed.
-<p>
-If the device was set for rendering into memory, is will be switched to
-accumulating the page as clist files, thus <code>-dMaxBitmap</code> and
-<code>-dBandingNever</code> will be ignored, as if <code>-dBandingAlways</code>
-was specified.
-</dl>
-
-<dl>
-<dt><code>flush</code>
-<dd>Delete all clist files for all pages on the list, and reset the
-list to empty, but remain in <code>saved-pages</code> mode. Subsequent
-pages will be added to the list.
-</dl>
-
- <dl>
-<dt><code>end</code>
-<dd>Flush any list, deleting all clist files for any accumulated pages
-and stop accumulating pages, returning to rendering/output as soon as
-the page is complete.
-<p>
-The device may render subsequent pages in memory (page buffer) as
-determined by </code>-dMaxBitmap</code> and </code>-dBandingNever</code>.
-</dl>
-
-<dl>
-<dt><code>copies </code><em>copy_count</em>
-<dd>Set the copy count for the <code>print</code> action. The requested number
-of copies will be generated for all subsequent print actions, thus
-producing <b>collated</b> copies, rather than multiple copies of
-each page as in normal (non-deferred) rendering and output.
-<p>
-A <code>--saved-pages="copies <em>#</em>"</code> option will be applied to all
-print actions until a new <code>copies <em>#</em></code> is encountered
-that sets the copy count to a different value. Since the
-<code>copies</code> can follow the <code>print</code> command, it is
-recommended that only a single <code>copies</code> be in a each
-<code>--saved-pages=</code><em>...</em> string.
-<p>
-Note, that unless <code>-d.IgnoreNumCopies=true</code> is specified
-prior to starting <code>saved-pages</code> mode, the copy count for
-each page will be saved with each page, and the job will contain the
-specified number of copies of each page, as well as producing the
-number of collated copies of the job set by the <code>copies</code>
-in a <code>--saved-pages=</code><em>...</em> string.
-</dl>
-
-<dl>
-<dt><code>print </code><em>print keywords</em>
-<dd>Print from the list of saved pages. The <em>print keywords</em>
-follwing the <code>print</code> action keyword determine what is
-printed, and in what order. The keywords are described in the next
-section.
-</dl>
-
-
-<h3><a name="Print_Keywords"></a>Printing Saved Pages</h3>
-
-<p>
-The string following the <code>print</code> action keyword determines which pages
-from the list are printed, in what order. Any sequence of keywords, page numbers
-or page ranges can follow the <code>print</code> keyword. The first control keyword
-(other than <code>copies</code>) ends the list of printing keywords.
-<p>
-As with control keywords, print keywords can be any mixture of upper or lower case,
-and print keyword, page numbers and page ranges can be seperated by any non-alphanumeric
-character other than '<code>-</code>' or '<code>*</code>'.
-<p>
-The following are all equivalent:
-<blockquote><dl>
-<dt><code>1 3 5 - *</code>
-<dt><code>1, 3, 5-*</code>
-<dt><code>1,3,5-*</code>
-</dl></blockquote>
-
-<dl>
-<dt><code>copies </code><em>copy_count</em>
-<dd>As mentioned above, the <code>copies</code> keyword and count can follow the <code>print</code>
-keyword. See the description of the <code>copies</code> keyword in the previous section.
-<p>
-The copy count will be applied to the entire sequence of print keywords, so it can
-appear anywhere in the sequence of page number, page ranges or print keywords.
-</dl>
-
-<dl>
-<dt><code>normal</code>
-<dd>Print all of the pages, from the first until the last page in the list. This
-keyword is used to print collated copies in the usual page order. This is the
-same as the page range: <code>"1 - *"</code>
-</dl>
-
-<dl>
-<dt><code>reverse</code>
-<dd>Print all of the pages, from the last backwards to the first page in the list. This
-keyword is used to print collated copies in the reverse page order. This is the
-same as the page range: <code>"* - 1"</code>
-</dl>
-
-<dl>
-<dt><code>odd</code>
-<dd>Print all odd number pages, from 1 to the last odd numbered page. This keyword,
-combined with the <code>even</code> keyword and user interaction to place pages that
-were printed into the input tray, can be used for manual duplexing.
-</dl>
-
-<dl>
-<dt><code>even</code>
-<dd>Print all even number pages, from 2 to the last even numbered page, then if the
-list has an odd number of pages print a blank 'pad' page to be the back of the last odd
-page. This keyword, combined with the <code>odd</code> keyword and user interaction to
-place pages that were printed into the input tray, can be used for manual duplexing.
-</dl>
-
-<dl>
-<dt><code>even0pad</code>
-<dd>Print all even number pages, from 2 to the last even numbered page, without any
-blank 'pad' page as with the <code>even</code> keyword.
-</dl>
-
- <dl>
-<dt><em>page_number</em>
-<dd>A number not followed by '<code>-</code>' specifies a single page from the
-list to be printed. <b> The '<code>*</code>' character represents the last page in
-the list, interpreted as a number, either as a single <em>page_number</em> or as the
-<em>start_page</em> or <em>end_page</em> in a page range.
-</b>
-</dl>
-
- <dl>
-<dt><em>start_page</em> <code>-</code> <em>end_page</em>
-<dd>A range of pages is two <em>page_number</em>s or <code>*</code> separated by a
-'<code>-</code>', optionally surrounded by non-alphanumeric characters other than
-'<code>-</code>' which is a special character in page range specifications. The
-pages from the <em>start_page</em> to the <em>end_page</em> are printed.
-<p>
-If the <em>start_page</em> is after the <em>end_page</em>, then the order of the
-pages is reversed, from the <em>start_page</em> back to the <em>end_page</em>.
-</dl>
-
-<hr>
-<h2><a name="Examples"></a>Examples</h2>
-The following examples each print 2 collated copies from the first page to the last page:
-<blockquote><dl><code>
-<dt>--saved-pages="print: normal, copies=2"
-<dt>--saved-pages="print copies=2, normal"
-<dt>--saved-pages="copies 2 print normal"
-<dt>--saved-pages="print 1-* 1-*"
-<dt>--saved-pages="print normal normal"
-</code></dl></blockquote>
-
-Print the last page, followed by all pages in reverse order, then the first page
-(print reverse with two copies of the last and first page):
-<blockquote><dl><code>
-<dt>--saved-pages="print * reverse 1"
-<dt> -or-
-<dt>--saved-pages="print * * - 1 1"
-</code></dl></blockquote>
-
-Using the command line arguments with a PostScript or PDF input file to print
-the odd pages, prompt the operator to reload the printer with the pages that
-were printed, then print the even pages:
-
-<blockquote><dl><code>
-<dt>gs -sDEVICE=pgmraw -o /dev/lp0 --saved-pages="begin" examples/annots.pdf \
-<dt>--saved-pages="print odd" \
-<dt>-c "(Move printed pages to the input tray, then press enter.) = flush \
-<dt> (%stdin) (r) file 256 string readline clear" \
-<dt>--saved-pages="print even"
-</code></dl></blockquote>
-
-Print two collated copies of the first file, followed by 5 copies of the second file:
-<blockquote><dl><code>
-<dt>gs -sDEVICE=pgmraw -o /dev/lp0 --saved-pages="begin" examples/annots.pdf \
-<dt>--saved-pages="copies=2 print normal flush" \
-<dt>examples/colorcir.ps \
-<dt>--saved-pages="copies=5 print normal"
-</code></dl></blockquote>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2013-2022 Artifex Software, Inc. All rights
-reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied,
-modified or distributed except as expressly authorized under the terms
-of the license contained in the file LICENSE in this distribution.
-
-For more information about licensing, please visit
-http://www.artifex.com/licensing/
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Search.htm b/doc/Search.htm
deleted file mode 100644
index b1644a1a..00000000
--- a/doc/Search.htm
+++ /dev/null
@@ -1,188 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Search Ghostscript.com</title>
- <!-- note: we can't use default.css as some of the CSS there conflicts with Google's injected CSS -->
- <style>
-
- * {
- -webkit-tap-highlight-color: rgba(0,0,0,0);
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- }
-
- html, body, div, span, applet, object, iframe,
- h1, h2, h3, h4, h5, h6, p, blockquote, pre,
- a, abbr, acronym, address, big, cite, code,
- del, dfn, em, img, ins, kbd, q, s, samp,
- small, strike, strong, sub, tt, var,
- b, u, i, center,
- dl, dt, dd, ol, ul, li,
- fieldset, form, label, legend,
- table, caption, tbody, tfoot, thead, tr, th, td,
- article, aside, canvas, details, embed,
- figure, figcaption, footer, header, hgroup,
- menu, nav, output, ruby, section, summary,
- time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
- }
-
- /* HTML5 display-role reset for older browsers */
- article, aside, details, figcaption, figure,
- footer, header, hgroup, menu, nav, section {
- display: block;
- }
-
- html, body {
- position: relative;
- height: 100%;
- }
-
- body {
- -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
- -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
- -webkit-user-select: text; /* prevent copy paste, to allow, change 'none' to 'text' */
- color:black;
- background:#ffffff;
- font-family:"Source Sans Pro", sans-serif; /* 200 = ExtraLight, 300 = Light, 400 = regular, 600 = semi-bold, 700 = bold, 900 = black */
- font-weight:400;
- font-size:16px;
- margin:0px;
- padding:0px;
- }
-
- main .outer {
- max-width: 1280px;
- margin: 0px auto 100px;
- padding-top: 50px;
- }
-
- main .inner {
- padding: 20px;
- }
-
- header {
- position: fixed;
- width: 100%;
- height:50px;
- background: #0075cf url(language-bindings/images/ghostscript.png) 10px center no-repeat;
- background-size: 30px 30px;
- color: #fff;
- line-height: 50px;
- text-indent: 50px;
- z-index: 1;
- display: flex;
- justify-content: space-between;
- }
-
- header .search {
- width: 50px;
- height:50px;
- background: #0075cf url(images/icon-search.png) center center no-repeat;
- background-size: 50px 50px;
- }
-
- a {
- text-decoration: none;
- color: #0075cf;
- }
-
- i {
- font-style: italic;
- }
-
- p {
- line-height: 24px;
- }
-
- header h1 {
- font-size:24px;
- font-weight:600;
- color: #fff;
- text-decoration: none;
- }
-
- header a h1 {
- color: #fff;
- }
-
- h1 {
- font-size:40px;
- font-weight:600;
- }
-
- /* Dark mode */
- @media (prefers-color-scheme: dark) {
-
- body {
- background-color: #000;
- color: white;
- }
-
- a {
- text-decoration: none;
- color: #289df6;
- }
-
- blockquote {
- border: 1px solid #efefef;
- }
-
- }
-
- </style>
-
- <script async src="https://cse.google.com/cse.js?cx=056ea92e7af6e50cc"></script>
-
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Search documentation</h1>
-
-
-<div class="gcse-search"></div>
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Source.htm b/doc/Source.htm
deleted file mode 100644
index 82b03bee..00000000
--- a/doc/Source.htm
+++ /dev/null
@@ -1,430 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Guide to Ghostscript Source Code</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Guide to Ghostscript Source Code</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Overview">Conceptual overview</a></li>
- <li><a href="#PostScript_interpreter">PostScript Interpreter</a></li>
- <li><a href="#PDF_interpreter">PDF interpreter</a></li>
- <li><a href="#Graphics_library">Graphics library</a></li>
- <li>
- <ul>
- <li><a href="#Drivers">Device drivers</a></li>
- <li><a href="#Platform_specific_code">Platform-specific code</a></li>
- </ul>
- </li>
- <li><a href="#Makefiles">Makefiles</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a> and the documents on <a href="Make.htm">how to build
-Ghostscript</a> from source, <a href="C-style.htm">Ghostscript C coding
-guidelines</a>, <a href="Drivers.htm">drivers</a>, the
-<a href="Lib.htm">Ghostscript library</a> and <a href="Install.htm">how to
-install Ghostscript</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Overview"></a>Conceptual overview</h2>
-
-<p>
-The Ghostscript source code is divided conceptually as follows:
-
-<blockquote><table>
-<tr>
- <th align="left" colspan="2">PostScript interpreter:</th>
- </tr>
-<tr>
-
- <td>PostScript operators</td>
-
- <td><code>z</code>*<code>.h</code> and <code>z</code>*<code>.c</code></td>
- </tr>
-<tr>
-
- <td>Other interpreter code</td>
-
- <td><code>i</code>*<code>.h</code> and <code>i</code>*<code>.c</code></td>
- </tr>
-<tr>
-
- <td>PostScript code</td>
-
- <td><code>gs_</code>*<code>.ps</code></td>
- </tr>
-<tr>
- <th align="left" colspan="2">PDF interpreter:</th>
- </tr>
-<tr>
-
- <td>PostScript code</td>
-
- <td><code>pdf_</code>*<code>.ps</code></td>
- </tr>
-<tr>
- <th align="left" colspan="2">Graphics library:</th>
- </tr>
-<tr>
-
- <td>Main library code</td>
-
- <td><code>g</code>*<code>.h</code> and <code>g</code>*<code>.c</code></td>
- </tr>
-<tr>
-
- <td>Streams</td>
-
- <td><code>s</code>*<code>.h</code> and <code>s</code>*<code>.c</code></td>
- </tr>
-<tr>
-
- <td><a href="#Drivers">Device drivers</a></td>
-
- <td><code>gdev</code>*<code>.h</code> and <code>gdev</code>*<code>.c</code></td>
- </tr>
-<tr>
-
- <td><a href="#Platform_specific_code">Platform-specific code</a></td>
-
- <td><code>gp</code>*<code>.h</code> and <code>gp</code>*<code>.c</code></td>
- </tr>
-</table></blockquote>
-
-<hr>
-
-<h2><a name="PostScript_interpreter"></a>PostScript Interpreter</h2>
-
-<p>
-<code>gs.c</code> is the main program for the interactive language
-interpreter; <code>gserver.c</code> is an alternative main program that
-is a rudimentary server. If you configure Ghostscript as a server rather
-than an interactive program, you will use <code>gserver.c</code> instead
-of <code>gs.c</code>.
-
-<p>
-Files named <code>z</code>*<code>.c</code> are Ghostscript operator
-files. The names of the files generally follow the section headings of the
-operator summary in section 6.2 (Second Edition) or 8.2 (Third Edition) of
-the PostScript Language Reference Manual. Each operator XXX is implemented
-by a procedure named <code>z</code>XXX, for example,
-<code>zfill</code> and <code>zarray</code>.
-
-<p>
-Files named <code>i</code>*<code>.c</code>, and *<code>.h</code>
-other than <code>g</code>*<code>.h</code>, are the rest of the
-interpreter. See the makefile for a little more information on how the
-files are divided functionally.
-
-<p>
-The main loop of the PostScript interpreter is the <code>interp</code>
-procedure in <code>interp.c</code>. When the interpreter is reading
-from an input file, it calls the token scanner in
-<code>iscan</code>*<code>.c</code>.
-
-<p>
-<code>idebug.c</code> contains a lot of debugger-callable routines
-useful for printing PostScript objects when debugging.
-
-<hr>
-
-<h2><a name="PDF_interpreter"></a>PDF interpreter</h2>
-
-<p>
-The PDF interpreter is written entirely in PostScript. Its main loop is
-the <code>.pdfrun</code> procedure in <code>pdf_base.ps</code>. When
-the PDF interpreter is configured into the build, it redefines the
-"<code>run</code>" operator to test whether the file is a PDF file.
-This redefinition is near the beginning of <code>pdf_main.ps</code>.
-
-<hr>
-
-<h2><a name="Graphics_library"></a>Graphics library</h2>
-
-<p>
-Files beginning with <code>gs</code>, <code>gx</code>, or
-<code>gz</code> (both <code>.c</code> and <code>.h</code>), other
-than <code>gs.c</code> and <code>gserver.c</code>, are the
-Ghostscript library. Files beginning with <code>gdev</code> are device
-drivers or related code, also part of the library. Other files beginning
-with <code>g</code> are library files that don't fall neatly into either
-the kernel or the driver category.
-
-<p>
-Files named <code>s</code>*<code>.c</code> and
-<code>s</code>*<code>.h</code> are a flexible stream package,
-including the Level 2 PostScript "filters" supported by Ghostscript. See
-<code>stream.h</code>, <code>scommon.h</code>, and
-<code>strimpl.h</code> for all the details.
-
-<h3><a name="Drivers"></a>Device drivers</h3>
-
-<p>
-The interface between the graphics library and device drivers is the only
-really well documented one in all of Ghostscript: see the
-<a href="Drivers.htm">documentation on drivers</a>.
-
-<p>
-In addition to many real device and file format drivers listed in
-<code>devs.mak</code> and <code>contrib.mak</code>, a number of
-drivers are used for internal purposes. You can search
-<code>lib.mak</code> for files named
-<code>gdev</code>*<code>.c</code> to find almost all of them.
-
-<p>
-Drivers are divided into "printer" drivers, which support banding, and
-non-printer drivers, which don't. The decision whether banding is
-required is made (by default on the basis of how much memory is available)
-in the procedure <code>gdev_prn_alloc</code> in
-<code>gdevprn.c</code>: it implements this decision by filling the
-virtual procedure table for the printer device in one of two different
-ways.
-
-<p>
-A good simple "printer" (bandable) driver to read is
-<code>gdevmiff.c</code>: it's less than 100 lines, of which much is
-boilerplate. There are no simple non-printer drivers that actually drive
-devices: probably the simplest non-printer driver for reading is
-<code>gdevm8.c</code>, which implements 8-bit-deep devices that only
-store the bits in memory.
-
-<h3><a name="Platform_specific_code"></a>Platform-specific code</h3>
-
-<p>
-There are very few platform dependencies in Ghostscript. Ghostscript deals
-with them in three ways:
-
-<ul>
-<li>Files named *<code>_.h</code> substitute for the corresponding
-<code>&lt;</code>*<code>.h&gt;</code> file by adding conditionals
-that provide a uniform set of system interfaces on all platforms.
-
-<li>The file <code>arch.h</code> contains a set of
-mechanically-discovered platform properties like byte order, size of
-<code>int</code>, etc. These properties, <b>not</b> the names of
-specific platforms, are used to select between different algorithms or
-parameters at compile time.
-
-<li>Files named <code>gp</code>*<code>.h</code> define interfaces
-that are intended to be implemented differently on each platform, but whose
-specification is common to all platforms.
-</ul>
-
-<p>
-The platform-specific implementations of the
-<code>gp</code>*<code>.h</code> interfaces have names of the form
-"<code>gp_</code><em>{platform}</em><code>.c</code>, specifically
-(this list may be out of date):
-
-<blockquote><table>
-<tr>
- <th colspan="2">Platform-specific interfaces</th>
- </tr>
-<tr>
- <th align="left">Routine</th>
- <th align="left">Platform</th>
- </tr>
-<tr>
- <td><code>gp_dosfb.c</code></td>
- <td>DOS</td>
- </tr>
-<tr>
- <td><code>gp_dosfs.c</code></td>
- <td>DOS and MS Windows</td>
- </tr>
-<tr>
- <td><code>gp_itbc.c</code></td>
- <td>DOS, Borland compilers</td>
- </tr>
-<tr>
- <td><code>gp_iwatc.c</code></td>
- <td>DOS, Watcom or Microsoft compiler</td>
- </tr>
-<tr>
- <td><code>gp_msdos.c</code></td>
- <td>DOS and MS Windows</td>
- </tr>
-<tr>
- <td><code>gp_ntfs.c</code></td>
- <td>MS Windows NT</td>
- </tr>
-<tr>
- <td><code>gp_os2.c</code></td>
- <td>OS/2</td>
- </tr>
-<tr>
- <td><code>gp_os9.c</code></td>
- <td>OS-9</td>
- </tr>
-<tr>
- <td><code>gp_unifs.c</code></td>
- <td>Unix, OS-9, and QNX</td>
- </tr>
-<tr>
- <td><code>gp_unix.c</code></td>
-
- <td>Unix and QNX</td>
- </tr>
-<tr>
- <td><code>gp_vms.c</code></td>
-
- <td>VMS</td>
- </tr>
-<tr>
- <td><code>gp_win32.c</code></td>
-
- <td>MS Windows NT</td>
- </tr>
-</table></blockquote>
-
-<p>
-If you are going to extend Ghostscript to new machines or operating
-systems, check the *<code>_.h</code> files for <code>ifdef</code> on
-things other than <code>DEBUG</code>. You should probably plan to make
-a new makefile and a new <code>gp_</code>XXX<code>.c</code> file.
-
-<hr>
-
-<h2><a name="Makefiles"></a>Makefiles</h2>
-
-<p>
-This section is only for advanced developers who need to integrate
-Ghostscript into a larger program at build time.
-
-<p>
-NOTE: THIS SECTION IS INCOMPLETE. IT WILL BE IMPROVED IN A LATER REVISION.
-
-<p>
-The Ghostscript makefiles are meant to be organized according to the
-following two principles:
-
-<ul>
-
-<li>All the parameters that vary from platform to platform appear in the
-top-level makefile for a given platform. ("Platform" = OS + compiler +
-choice of interpreter vs. library)
-
-<li>All the rules and definitions that can meaningfully be shared among more
-than 1 platform appear in a makefile that is "included" by a makefile
-(normally the top-level makefile) for those platforms.
-</ul>
-
-<p>
-Thus, for example:
-
-<ul>
-
-<li>Rules and definitions shared by all builds are in
-<code>gs.mak</code>.
-
-<li>Rules and definitions specific to the library (on all platforms) are in
-<code>lib.mak</code>. In principle this could be merged with
-<code>gs.mak</code>, but we wanted to leave open the possibility that
-<code>gs.mak</code> might be useful with hypothetical interpreter-only
-products.
-
-<li>Stuff specific to interpreters (on all platforms) is in
-<code>int.mak</code>.
-
-<li>Stuff specific to all Unix platforms should be in a single
-<code>unix.mak</code> file, but because <code>make</code> sometimes
-cares about the order of definitions, and because some of it is shared with
-DV/X, it got split between <code>unix-aux.mak</code>,
-<code>unix-end.mak</code>, <code>unixhead.mak</code>,
-<code>unixinst.mak</code>, and <code>unixlink.mak</code>.
-
-</ul>
-
-<p>
-For MS-DOS and MS Windows builds, there should be:
-
-<ul>
-
-<li>A makefile for all MS OS (DOS or Windows) builds, for all
- compilers and products.
-
-<li>Perhaps a makefile for all MS-DOS builds, for all compilers and
-products, although since Watcom is the only such compiler we're likely to
-support this may be overkill.
-
-<li>A makefile for all MS Windows builds, for all compilers and products.
-
-<li>A makefile for all Watcom builds (DOS or Windows), for all products.
-
-<li>A top-level makefile for the Watcom DOS interpreter product.
-
-<li>A top-level makefile for the Watcom Windows interpreter product.
-
-<li>A top-level makefile for the Watcom DOS library "product".
-
-<li>A top-level makefile for the Watcom Windows library "product".
-
-<li>A makefile for all Borland builds (DOS or Windows), for all
- products.
-
-</ul>
-
-<p>
-and so on.
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Unix-lpr.htm b/doc/Unix-lpr.htm
deleted file mode 100644
index 063ed25a..00000000
--- a/doc/Unix-lpr.htm
+++ /dev/null
@@ -1,279 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Setting Up a Unix 1pr Filter for Ghostscript</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Setting Up a Unix 1pr Filter for Ghostscript</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Overview">Overview</a></li>
- <li><a href="#What_it_can_do">What it can do</a></li>
- <li><a href="#Setting_up">Setting it up</a></li>
- <li>
- <ul>
- <li><a href="#Editing_device_list">Editing the device list <code>DEVICES</code></a></li>
- <li>
- <ul>
- <li><a href="#Field_bpp">Field 1: bits per pixel</a></li>
- <li><a href="#Field_colours">Field 2: colours</a></li>
- <li><a href="#Field_dq">Field 3: dual queues</a></li>
- <li><a href="#Device_example">Example definition of <code>DEVICES</code></a></li>
- </ul>
- </li>
- <li><a href="#Editing_filter_list">Editing the filter list</a></li>
- <li><a href="#Editing_printer_port">Editing the printer port and type</a></li>
- <li><a href="#Modifying_printcap_insert">Modifying <code>printcap.insert</code></a></li>
- <li><a href="#Multiple_queues">Single or dual queues</a></li>
- </ul>
- </li>
- <li><a href="#Bugs">Bugs</a></li>
- <li><a href="#Authors">Authors</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a> and the <a href="Use.htm">usage documentation</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Overview"></a>Overview</h2>
-
-<p>
-"How do I set up Ghostscript to provide PostScript queues in a standard lpr
-environment on Unix systems?" is a Frequently Asked Question amongst
-Ghostscript users. The two shell scripts described by this document are
-designed to make this task a little easier. They are</p>
-
-<blockquote><dl>
-<dt><code>unix-lpr.sh</code></dt>
-<dd>a flexible, multi-option print filter</dd>
-
-<dt><code>lprsetup.sh</code></dt>
-<dd>A shell script which sets up soft links and creates a template insert
-for the <code>printcap</code> file</dd>
-</dl></blockquote>
-
-<hr>
-
-<h2><a name="What_it_can_do"></a>What it can do</h2>
-
-<p>
-The print filter resides in the Ghostscript installation directory (often
-<code>/usr/local/share/ghostscript</code>, but may be something else at
-your installation), together with a dummy filter directory containing
-various soft links which point to the filter. It offers the following
-features:</p>
-
-<ul>
-<li>Multiple devices supported by a single filter</li>
-<li>Multiple bit-depths for the same device</li>
-<li>Multiple number of colours for the same device</li>
-<li>Direct (single-queue) and indirect (two-queue) setup</li>
-<li>Support for the standard preprocessing filters if you have the
-corresponding (whatever)-to-PostScript translators</li>
-<li>Redirection of diagnostic and programmed output to a logfile in
-the spooling directory</li>
-<li>Maintaining of printer accounting records of the numbers of pages
-printed by each user (compatible with the <code>pac</code> command)</li>
-<li>Straightforward editing for further customisation</li>
-</ul>
-
-<hr>
-
-<h2><a name="Setting_up"></a>Setting it up</h2>
-
-<p>
-The <code>lprsetup.sh</code> script needs to have two lines edited
-before running, to set the printer devices to use and the list of filters
-available. With this information, it</p>
-
-<ul>
-<li>creates a "<code>filt</code>" subdirectory under the
-Ghostscript installation directory</li>
-<li>creates the links in this directory which enable the filter to
-determine the parameters for running Ghostscript</li>
-<li>automatically generates <code>printcap</code> entries which should
-need only a little editing before adding to your system
-<code>printcap</code> file</li>
-</ul>
-
-<h3><a name="Editing_device_list"></a>Editing the device list <tt>DEVICES</tt></h3>
-
-<p>
-At the top of <code>lprsetup.sh</code> is a line of the form
-<code>DEVICES=</code><em>{list}</em>. Replace the example list with
-your own list of devices. Each entry is the name of a device, followed by
-three more optional fields, separated by dots "<code>.</code>".</p>
-
-<h4><a name="Field_bpp"></a>Field 1: bits per pixel</h4>
-
-<p>
-The first field is required only if the printer device understands the <a
-href="Devices.htm#deskjet_parameters"><code>-dBitsPerPixel=</code>
-switch</a>, which applies only to colour devices. For a particular number
-<b><em>N</em></b> of bits per pixel, add the suffix <b><em>.N</em></b> to
-the device name, for instance <code>cdj500.3</code>,
-<code>cdj500.24</code>, etc.</p>
-
-<h4><a name="Field_colours"></a>Field 2: colours</h4>
-
-<p>
-The second field is required only if the printer device understands the
-setting of the <code>Colors</code> device parameter (as in
-<code>-dColors=</code>), which applies only to colour devices (and at
-present is only supported by the <code>bjc</code>* family of drivers).
-For a particular number <b><em>N</em></b> of colours, suffix
-<b><em>.N</em></b> to the device name, such as <code>bjc600.24.3</code>,
-<code>bjc600.8.1</code> etc.</p>
-
-<h4><a name="Field_dq"></a>Field 3: dual queues</h4>
-
-<p>
-The third field is required in order to use two separate queues for the
-device, a "raw" queue and a PostScript queue (see
-"<a href="#Multiple_queues">Single or dual queues</a>" below). If you want
-dual queues, add the suffix <code>.dq</code> ("dual queue") to the name,
-whether or not a <a href="#Field_bpp">bits-per-pixel suffix</a> has already
-been added.</p>
-
-<h4><a name="Device_example"></a>Example definition of
-<tt>DEVICES</tt></h4>
-
-<p>
-Thus the following list supports a <code>cdj550</code> device at three
-different bit depths (24 bpp, 3 bpp and 1 bpp), with a dual queue (that is,
-a separate queue for the raw data); a monochrome <code>deskjet</code>
-device with a single queue; and a <code>djet500</code> device using a
-separate queue:</p>
-
-<blockquote><code>
-DEVICES="cdj550.24.dq&nbsp;cdj550.3.dq&nbsp;cdj550.1.dq&nbsp;deskjet&nbsp;djet500.dq"
-</code></blockquote>
-
-<h3><a name="Editing_filter_list"></a>Editing the filter list</h3>
-
-<p>
-The standard list contains only the generic "<code>if</code>" filter,
-but a commented-out list shows other filters which may be available. If
-you wish to use the support for these filters, you may need to edit the
-<code>bsd-if</code> file to add to the <code>PATH</code> the
-directories where the translators are stored, or to change the names of the
-filters if yours are different. The <code>bsd-if</code> script is
-supplied with an example setup using Transcript (a commercial package from
-Adobe), and PBMPLUS, a freeware package by Jef Poskanzer and others.</p>
-
-<h3><a name="Editing_printer_port"></a>Editing the printer port and
-type</h3>
-
-<p>
-You can set the port and port type (parallel or printer) for an attached
-printer, but for remote printers you'll have to modify the
-<tt>printcap.insert</tt> file yourself.</p>
-
-<h3><a name="Modifying_printcap_insert"></a>Modifying
-<tt>printcap.insert</tt></h3>
-
-<p>
-Running <code>lprsetup.sh</code> generates a file
-<code>printcap.insert</code> which has a template setup for your
-printer queues. It cannot guarantee to do the whole job, and you will
-probably need to consult your system documentation and edit this file
-before you add it to your <code>printcap</code> file. The file has good
-defaults for serial printers, as these often cause problems in getting
-binary data to the printer. However, you may need to change the baud rate,
-or the handshaking method. Only a small change is required in the
-<code>printcap</code> file to use a networked remote printer instead of
-an attached printer, and an example is given in
-<code>printcap.insert</code>.</p>
-
-<h3><a name="Multiple_queues"></a>Single or dual queues</h3>
-
-<p>
-If you wish to provide a PostScript-only queue (for example, so that all
-pages printed go through accounting), and the printer port is local to the
-host machine, a single queue is appropriate -- Ghostscript simply converts
-PostScript into the printer's native data format and sends it to the
-port. But if the printer is on a remote networked machine, or if you need to
-send raw printer data to the printer, you must use two queues. Simply
-specify the <a href="#Field_dq">"<code>.dq</code>" option</a> above.</p>
-
-<hr>
-
-<h2><a name="Bugs"></a>Bugs</h2>
-
-<p>
-You must have write access to the Ghostscript installation directory for
-<code>lprsetup.sh</code> to create the filter directory and soft links.</p>
-
-<p>
-If you have several different values of bits per pixel for the same device,
-you must list all instances of that device as adjacent items in the
-<a href="#Editing_device_list"><code>DEVICES</code></a> device
-list. If you do not, <code>printcap.insert</code> will contain multiple
-entries for the same device, which is not supported.</p>
-
-<hr>
-
-<h2><a name="Authors"></a>Authors</h2>
-
-<p>
-This material was contributed by George Cameron. Yves Arrouye
-&lt;<a href="mailto:yves.arrouye@usa.net">yves.arrouye@usa.net</a>&gt;
-is responsible for the number-of-colours part of the script.</p>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/Use.htm b/doc/Use.htm
deleted file mode 100644
index 42857c3e..00000000
--- a/doc/Use.htm
+++ /dev/null
@@ -1,5437 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>How to Use Ghostscript</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>How to Use Ghostscript</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Invoking">Invoking Ghostscript</a></li>
- <li>
- <ul>
- <li><a href="#Help_command">Help at the command line: <code>gs -h</code></a></li>
- </ul>
- </li>
- <li><a href="#Output_device">Selecting an output device</a></li>
- <li>
- <ul>
- <li><a href="#Output_resolution">Output resolution</a></li>
- <li><a href="#File_output">Output to files</a></li>
- <li>
- <ul>
- <li><a href="#One_page_per_file">One page per file</a></li>
- </ul>
- </li>
- <li><a href="#Paper_size">Choosing paper size</a></li>
- <li><a href="#Change_default_size">Changing the installed default paper size</a></li>
- </ul>
- </li>
- <li><a href="#Pipes">Interacting with pipes</a></li>
- <li><a href="#PDF">Using Ghostscript with PDF files</a></li>
- <li>
- <ul>
- <li><a href="#PDF_switches">Switches for PDF files</a></li>
- <li><a href="#PDF_problems">Problems interpreting a PDF file</a></li>
- <li><a href="#PDF_stdin">PDF files from standard input</a></li>
- </ul>
- </li>
- <li><a href="#EPS">Using Ghostscript with EPS files</a></li>
- <li><a href="#SPOT">Using Ghostscript with overprinting and spot colors</a></li>
- <li><a href="#Finding_files">How Ghostscript finds files</a></li>
- <li>
- <ul>
- <li><a href="#PS_resources">Finding PostScript Level 2 resources</a></li>
- <li><a href="#Font_lookup">Font lookup</a></li>
- <li><a href="#CIDFonts">CID fonts</a></li>
- <li><a href="#CIDFontSubstitution">CID font substitution</a></li>
- <li><a href="#UnicodeTT">Using Unicode True Type fonts</a></li>
- <li><a href="#Temp_files">Temporary files</a></li>
- </ul>
- </li>
- <li><a href="#Platforms">Notes on specific platforms</a></li>
- <li>
- <ul>
- <li><a href="#Word size">Word size (32 or 64 bits)</a></li>
- <li><a href="#Unix">Unix</a></li>
- <li><a href="#VMS">VMS</a></li>
- <li>
- <ul>
- <li><a href="#VMS_X_Windows">Using X Windows on VMS</a></li>
- </ul>
- </li>
- <li><a href="#MS_Windows">MS Windows</a></li>
- <li><a href="#X_Windows">X Windows</a></li>
- <li>
- <ul>
- <li><a href="#X_resources">X resources</a></li>
- <li><a href="#X_server_bugs">Working around bugs in X servers</a></li>
- <li><a href="#X_device_parameters">X device parameters</a></li>
- </ul>
- </li>
- <li><a href="#SCO_Unix">SCO Unix</a></li>
- </ul>
- </li>
-
- <li><a href="#Options">Command line options</a></li>
- <li>
- <ul>
- <li><a href="#General_switches">General switches</a></li>
- <li>
- <ul>
- <li><a href="#Input_control">Input control</a></li>
- <li><a href="#File_searching">File searching</a></li>
- <li><a href="#Parameters">Setting parameters</a></li>
- <li><a href="#Quiet">Suppress messages</a></li>
- </ul>
- </li>
- <li><a href="#Parameter_switches">Parameter switches (<code>-d</code> and <code>-s</code>)</a></li>
- <li>
- <ul>
- <li><a href="#Rendering_parameters">Rendering parameters</a></li>
- <li><a href="#Page_parameters">Page parameters</a></li>
- <li><a href="#Font_related_parameters">Font-related parameters</a></li>
- <li><a href="#Resource_related_parameters">Resource-related parameters</a></li>
- <li><a href="#Interaction_related_parameters">Interaction-related parameters</a></li>
- <li><a href="#Output_selection_parameters">Device and output selection parameters</a></li>
- <li><a href="#EPS_parameters">EPS parameters</a></li>
- <li><a href="#Deferred_Page_Rendering">Deferred Page Rendering</a></li>
- <li><a href="#ICC_color_parameters">ICC color parameters</a></li>
- <li><a href="#Other_parameters">Other parameters</a></li>
- </ul>
- </li>
- </ul>
- </li>
- <li><a href="#Improving_performance">Improving performance</a></li>
- <li><a href="#Environment_variables">Summary of environment variables</a></li>
-
- <li><a href="#Debugging">Debugging</a></li>
- <li>
- <ul>
- <li><a href="#Debug_switches">Debug Switches</a></li>
- <li><a href="#Visual_trace">Visual Trace</a></li>
- </ul>
- </li>
- <li><a href="#Known_paper_sizes">Appendix: Paper sizes known to Ghostscript</a></li>
- <li><a href="#X_font_mappings">Appendix: X default font mappings</a></li>
- <li>
- <ul>
- <li><a href="#Standard_X_server_fonts">Standard X servers</a></li>
- <li>
- <ul>
- <li><a href="#X_regular_fonts">Regular fonts</a></li>
- <li><a href="#X_symbol_fonts">Symbol fonts</a></li>
- <li><a href="#X_dingbat_fonts">Dingbat fonts</a></li>
- </ul>
- </li>
- <li><a href="#OpenWindows_fonts">Sun OpenWindows</a></li>
- </ul>
- </li>
- <li><a href="#FAPI_run">Appendix: Running Ghostscript with third-party
- font renderers</a></li>
-
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript
-overview</a> and, if necessary, how to
- <a href="Install.htm">install Ghostscript</a>.</p>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Invoking"></a>Invoking Ghostscript</h2>
-
-<p>This document describes how to use the command line Ghostscript client.
-Ghostscript is also used as a general engine inside other applications (for viewing files for example).
-Please refer to the documentation for those applications for using Ghostscript in other contexts.</p>
-
-<p><a name="Command_line"></a> The command line to invoke Ghostscript is
-essentially the same on all systems, although the name of the executable
-program itself may differ among systems. For instance, to invoke
-Ghostscript on unix-like systems type:</p>
-
-<blockquote>
- <pre><code>gs</code> [options] {filename 1} ... [options] {filename <em>N</em>} ...
-</pre></blockquote>
-
-<p>Here are some basic examples. The details of how these work are described below.</p>
-
-<p>To view a file:</p>
-<blockquote><pre>gs -dSAFER -dBATCH document.pdf</pre></blockquote>
-<p>You'll be prompted to press <em>return</em> between pages.</p>
-
-<p>To convert a figure to an image file:</p>
-<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 \
- -sOutputFile=tiger.png tiger.eps</pre></blockquote>
-
-<p>To render the same image at 300 dpi:</p>
-<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 \
- -sOutputFile=tiger_300.png tiger.eps
-</pre></blockquote>
-
-<p>To render a figure in grayscale:</p>
-<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pnggray -sOutputFile=figure.png figure.pdf
-</pre></blockquote>
-
-<p>To rasterize a whole document:</p>
-<blockquote><pre>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pgmraw -r150 \
- -dTextAlphaBits=4 -sOutputFile='paper-%00d.pgm' paper.ps</pre></blockquote>
-
-<p>There are also a number of utility scripts for common to convert a PostScript document to PDF:</p>
-<blockquote><pre>ps2pdf file.ps</pre></blockquote>
-<p>The output is saved as file.pdf.</p>
-
-<p>There are other utility scripts besides <code>ps2pdf</code>, including <code>pdf2ps</code>, <code>ps2epsi</code>, <code>pdf2dsc</code>, <code>ps2ascii</code>,
-<code>ps2ps</code> and <code>ps2ps2</code>. These just call Ghostscript with the appropriate
-(if complicated) set of options. You can use the 'ps2' set with eps files.</p>
-
-<p>
-Ghostscript is capable of interpreting PostScript, encapsulated PostScript
-(EPS), DOS EPS (EPSF), and Adobe Portable Document Format (PDF). The interpreter reads and executes the files in sequence, using the method described under "<a href="#File_searching">File searching</a>" to find them.</p>
-
-<p>The interpreter runs in interactive mode by default. After processing the files given on the command line (if any) it reads further lines of PostScript language commands from the primary input stream, normally the keyboard, interpreting each line separately. To quit the interpreter, type "<code>quit</code>". The <code>-dBATCH -dNOPAUSE</code> options in the examples above disable the interactive prompting. The interpreter also quits gracefully if it encounters end-of-file or control-C.</p>
-
-<p>
-The interpreter recognizes many options. An option may appear anywhere in the command line, and applies to all files named after it on the line. Many of them include "<code>=</code>"
-followed by a parameter. The most important are described in detail here. Please see the reference sections on <a href="#Options">options</a> and <a href="Devices.htm">devices</a> for a more complete listing.</p>
-
-<h3><a name="Help_command"></a>Help at the command line: <code>gs -h</code></h3>
-
-<p>
-You can get a brief help message by invoking Ghostscript with the
-<code>-h</code> or <code>-?</code> switch, like this:</p>
-
-<blockquote><pre>
-gs -h
-gs -?
-</pre></blockquote>
-
-<p>
-The message shows for that version of the Ghostscript executable:</p>
-
-<ul>
-<li>the version and release information</li>
-<li>the general format of the command line</li>
-<li>a few of the most useful options</li>
-<li>the formats it can interpret</li>
-<li>the available output devices</li>
-<li>the search path</li>
-<li>the bug report address</li>
-</ul>
-
-<p>
-On other systems the executable may have a different name:</p>
-
-<blockquote><table>
-<tr>
- <th align="left">System</th>
- <th align="left">Invocation Name</th></tr>
-<tr><td>Unix</td>
- <td><code>gs</code></td></tr>
-<tr><td>VMS</td>
- <td><code>gs</code></td></tr>
-<tr><td>MS Windows 95 and later</td>
- <td><code>gswin32.exe</code><br/>
- <code>gswin32c.exe</code><br/>
- <code>gswin64.exe</code><br/>
- <code>gswin64c.exe</code></td>
-</tr>
-<tr><td>OS/2</td>
- <td><code>gsos2</code></td></tr>
-</table></blockquote>
-<p>On Windows, the two digit number indicates the word length of the system for which the binary was built (so
-<code>gswin32.exe</code> is for x86 Windows systems, whilst <code>gswin64.exe</code> is for x86_64 Windows
-systems). And the <code>&quot;c&quot;</code> suffix indicates a Windows console based binary (note that the
-<code>&quot;display device&quot;</code> window will still appear).
-<hr>
-<h2><a name="Output_device"></a>Selecting an output device</h2>
-
-<p>
-Ghostscript has a notion of 'output devices' which handle saving or displaying the results in a particular format. Ghostscript comes with a diverse variety of such devices supporting vector and raster file output, screen display, driving various printers and communicating with other applications.</p>
-
-<p>
-The command line option '<code>-sDEVICE=</code><em>device</em>' selects which output device Ghostscript should use. If this option isn't given the default device (usually a display device) is used. Ghostscript's built-in help message (<code>gs&nbsp;-h</code>) lists the available output devices. For complete description of the devices distributed with Ghostscript and their options, please see the <a href="Devices.htm">devices section</a> of the documentation.</p>
-
-<p><a name="Device_output"></a>
-Note that this switch must precede the name of the first input file, and
-only its first use has any effect. For example, for printer output in a
-configuration that includes an Epson printer driver, instead of just
-<code>'gs&nbsp;myfile.ps'</code> you might use</p>
-
-<blockquote>
- <code>gs -sDEVICE=epson myfile.ps</code>
-</blockquote>
-
-<p><a name="GS_DEVICE"></a>
-The output device can also be set through the <code>GS_DEVICE</code> environment variable.</p>
-
-<p>
-Once you invoke Ghostscript you can also find out what devices are available by typing
-'<code>devicenames&nbsp;==</code>' at the interactive prompt.
-You can set the output device and process a file from the interactive prompt as well:</p>
-
-
-<blockquote><pre>
-(epson) selectdevice
-(myfile.ps) run
-</pre></blockquote>
-
-<p>All output then goes to the Epson printer instead of the display until you
-do something to change devices. You can switch devices at any time by
-using the <code>selectdevice</code> procedure, for
-instance like one of these:</p>
-
-<blockquote><pre>
-(x11alpha) selectdevice
-(epson) selectdevice
-</pre></blockquote>
-
-<h3><a name="Output_resolution"></a>Output resolution</h3>
-
-<p>
-Some printers can print at several different resolutions, letting you
-balance resolution against printing speed. To select the resolution on
-such a printer, use the <code>-r</code> switch:</p>
-
-<blockquote>
- <code>gs -sDEVICE=</code><em>printer</em><code> -r</code><em>XRES</em><code>x</code><em>YRES</em>
-</blockquote>
-
-<p>where <em>XRES</em> and <em>YRES</em> are the requested number of dots (or pixels) per inch. Where the two resolutions are same, as is the common case, you can simply use <code>-r</code><em>res</em>.</p>
-
-<p>
-The <code>-r</code> option is also useful for controlling the density of pixels when rasterizing to an image file. It is used this way in the examples at the beginning of this document.</p>
-
-<h3><a name="File_output"></a>Output to files</h3>
-
-<p>
-Ghostscript also allows you to control where it sends its output. With a display device this isn't necessary as the device handles presenting the output on screen internally. Some specialized printer drivers operate this way as well, but most devices are general and need to be directed to a particular file or printer.</p>
-
-<p>
-To send the output to a file, use the <code>-sOutputFile=</code> switch or the <a href="#o_option"><code>-o</code> switch</a> (below).
-For instance, to direct all output into the file <code>ABC.xyz</code>, use</p>
-
-<blockquote><code>
-gs -sOutputFile=ABC.xyz
-</code></blockquote>
-
-<p>
-When printing on MS Windows systems, output normally goes directly to the printer, <code>PRN</code>. On Unix and VMS systems it normally goes to a temporary file which is sent to the printer in a separate step. When using Ghostscript as a file rasterizer (converting PostScript or PDF to a raster image format) you will of course want to specify an appropriately named file for the output.</p>
-
-<p>
-Ghostscript also accepts the special filename '<code>-</code>' which indicates the output should be written to standard output (the command shell).</p>
-
-<p>
-Be aware that filenames beginning with the character <code>%</code> have a special meaning in PostScript. If you need to specify a file name that actually
-begins with <code>%</code>, you must prepend the <code>%os%</code> filedevice explicitly. For example to output to a file named <code>%abc</code>, you need to specify</p>
-
-<blockquote>
-<code>gs -sOutputFile=%os%%abc</code>
-</blockquote>
-
-<p>Please see <a href="Language.htm">Ghostscript and the PostScript Language</a> and the PostScript Language Reference Manual for more details on <code>%</code> and filedevices.</p>
-
-<p><b>
-Note that on MS Windows systems, the <code>%</code> character also has a special meaning for the command processor (shell), so you will have to double it.</b></p>
-
-<blockquote>
-<code>gs -sOutputFile=%%os%%%%abc</code> (on MS Windows)
-</blockquote>
-
-<p><b>
-Note, some devices (e.g. pdfwrite, ps2write, ...) only write the output file
-upon exit, but changing the OutputFile device parameter will cause these
-devices to emit the pages received up to that point and then open the new
-file name given by OutputFile.
-</b></p>
-<p>
-For example, in order to create two PDF files from a single invocation of
-ghostscript the following can be used:</p>
-<blockquote>
-<code>gs -sDEVICE=pdfwrite -o tiger.pdf examples/tiger.eps -c "<< /OutputFile (colorcir.pdf) >> setpagedevice" -f examples/colorcir.ps</code>
-</blockquote>
-
-<h4><a name="One_page_per_file"></a>One page per file</h4>
-
-<p>
-Specifying a single output file works fine for printing and rasterizing
-figures, but sometimes you want images of each page of a multi-page
-document. You can tell Ghostscript to put each page of output in a
-series of similarly named files. To do this place a template
-'<code>%d</code>' in the filename which Ghostscript will replace with the
-page number.</p>
-
-<p>
-<b>Note: Since the <code>%</code> character is used to precede the page number
-format specification, in order to represent a file name that contains a <code>%</code>,
-double <code>%</code> characters must be used. For example for the file <code>my%foo</code>
-the OutputFile string needs to be <code>my%%foo</code>.</b></p>
-
-<p>
-The format can in fact be more involved than a simple '<code>%d</code>'.
-The format specifier is of a form similar to the C <code>printf</code> format.
-The general form supported is:</p>
-<pre><code> %[flags][width][.precision][l]type
-
- where: flags is one of: #+-
- type is one of: diuoxX
-</code></pre>
-
-<p>For more information, please refer to documentation on the C printf format
-specifications. Some examples are:</p>
-
-<blockquote><dl>
- <dt><code>-sOutputFile=ABC-%d.png</code></dt>
- <dd>produces '<code>ABC-1.png</code>', ... , '<code>ABC-10.png</code>', ..</dd>
- <dt><code>-sOutputFile=ABC-%03d.pgm</code></dt>
- <dd>produces '<code>ABC-001.pgm</code>', ... , '<code>ABC-010.pgm</code>', ...</dd>
- <dt><code>-sOutputFile=ABC_p%04d.tiff</code></dt>
-<dd>produces '<code>ABC_p0001.tiff</code>', ... , '<code>ABC_p0510.tiff</code>', ... , '<code>ABC_p5238.tiff</code>'</dd>
-</dl></blockquote>
-
-
-<p><b>
-Note, however that the one page per file feature may not supported by all devices.
-Also, since some devices write output files when opened, there may be an extra
-blank page written (pdfwrite, ps2write, eps2write, pxlmono, pxlcolor, ...).
-</b></p>
-
-<p>
-As noted above, when using MS Windows console (command.com or cmd.exe), you
-will have to double the <code>%</code> character since the <code>%</code> is used by
-that shell to prefix variables for substitution, e.g.,</p>
-
-<blockquote><code>
-gswin32c -sOutputFile=ABC%%03d.xyz
-</code></blockquote>
-
-<h4><a name="o_option"></a>-o option:</h4>
-<p>
-As a convenient shorthand you can use the <code>-o</code> option followed by the output
-file specification as discussed above. The <code>-o</code> option also sets the
-<a href="#Interaction_related_parameters"><code>-dBATCH</code> and <code>-dNOPAUSE</code> options</a>.
-This is intended to be a quick way to invoke ghostscript to convert one or more
-input files.</p>
-
-<p>For instance, to convert somefile.ps to JPEG image files, one per page, use:</p>
-
-<blockquote><code>
-gs -sDEVICE=jpeg -o out-%d.jpg somefile.ps
-</code></blockquote>
-
-<p>is equivalent to:</p>
-
-<blockquote><code>
-gs -sDEVICE=jpeg -sOutputFile=out-%d.jpg -dBATCH -dNOPAUSE somefile.ps
-</code></blockquote>
-
-<h3><a name="Paper_size"></a>Choosing paper size</h3>
-
-<p>
-Ghostscript is distributed configured to use U.S. letter paper as its
-default page size. There are two ways to select other paper sizes from the
-command line:</p>
-
-<ul>
-
-<li>
-If the desired paper size is listed in the section on <a
-href="#Known_paper_sizes">paper sizes known to Ghostscript</a> below, you
-can select it as the default paper size for a single invocation of
-Ghostscript by using the <code>-sPAPERSIZE=</code> switch, for instance:<p>
-
-
-<blockquote><code>
--sPAPERSIZE=a4<br>
--sPAPERSIZE=legal
-</code></blockquote>
-</li>
-
-<li>
-Otherwise you can set the page size using the
-pair of switches:<p>
-
-
-<blockquote>
-<code>-dDEVICEWIDTHPOINTS=</code><em>w</em>
-<code>-dDEVICEHEIGHTPOINTS=</code><em>h</em>
-</blockquote>
-
-<p>Where <em>w</em> be the desired paper width and <em>h</em> be the
-desired paper height in <em>points</em> (units of 1/72 of an inch).</p>
-</li>
-</ul>
-
-<p>
-Individual documents can (and often do) specify a paper size, which takes
-precedence over the default size. To force a specific paper size and
-ignore the paper size specified in the document, select a paper size as
-just described, and also include the
-<a href="#FIXEDMEDIA"><code>-dFIXEDMEDIA</code> switch</a> on the
-command line.</p>
-
-<p>
-The default set of paper sizes will be included in the <code>currentpagedevice</code>
-in the <code>InputAttributes</code> dictionary with each paper size as
-one of the entries. The last entry in the dictionary (which has numeric keys)
-is a non-standard (Ghostscript extension) type of PageSize where the array
-has four elements rather than the standard two elements. This four element
-array represents a page size range where the first two elements are the lower
-bound of the range and the second two are the upper bound. By default these
-are [0, 0] for the lower bound and [16#fffff, 16#fffff] for the upper bound.</p>
-<p>
-The range type of PageSize is intended to allow flexible page size sepcification
-for non-printer file formats such as JPEG, PNG, TIFF, EPS, ...</p>
-<p>
-For actual printers, either the entire <code>InputAttributes</code> dictionary
-should be replaced or the range type entry should not be included. To simplify
-using the default page sizes in the <code>InputAttributes</code> dictionary,
-the command line option <code>-dNORANGEPAGESIZE</code> can be used. Using
-this option will result in automatic rotation of the document page if the requested
-page size matches one of the default page sizes.</p>
-
-<p>
-When the <a href="#FIXEDMEDIA"><code>-dFIXEDMEDIA</code> switch</a> is given on the
-command line, the <code>InputAttributes</code> dictionary will only be populated
-with the single page size. This allows the <code>-dPSFitPage</code> option to fit
-the page size requested in a PostScript file to be rotated, scaled and centered
-for the best fit on the specified page.</p>
-
-<h3><a name="Change_default_size"></a>Changing the installed default paper size</h3>
-
-<p>
-You can change the installed default paper size on an installed version of Ghostscript, by editing the initialization file <code>gs_init.ps</code>.
-This file is usually in the <code>Resource/Init</code> directory somewhere in the search path. See the section on <a href="#Finding_files">finding files</a> for details.</p>
-
-<p>
-Find the line</p>
-
-<blockquote><pre>
-% /DEFAULTPAPERSIZE (a4) def
-</pre></blockquote>
-
-<p>
-Then to make A4 the default paper size, uncomment the line to change
-this to</p>
-
-<blockquote><pre>
-/DEFAULTPAPERSIZE (a4) def
-</pre></blockquote>
-
-<p>
-For <code>a4</code> you can substitute any
-<a href="#Known_paper_sizes">paper size Ghostscript knows</a>.</p>
-
-<p>
-This supecedes the previous method of uncommenting the line
-<code>% (a4) ...</code>.</p>
-
-<p>
-Sometimes the initialization files are compiled into Ghostscript and cannot be changed.</p>
-
-<p>
-On Windows and some Linux builds, the default paper size will be
-selected to be a4 or letter depending
-on the locale.</p>
-<hr>
-<h2><a name="Pipes"></a>Interacting with pipes</h2>
-
-<p>
-As noted above, input files are normally specified on the command
-line. However, one can also "pipe" input into Ghostscript from another
-program by using the special file name '<code>-</code>' which is interpreted as standard input. Examples:</p>
-
-<blockquote>
-{<em>some program producing ps</em>} <code>| gs</code> [options] <code>-</code>
-<br>
-<code>zcat paper.ps.gz</code> <code>| gs</code> <code>-</code>
-</blockquote>
-
-<p>
-When Ghostscript finishes reading from the pipe, it quits rather than
-going into interactive mode. Because of this, options and files after the '<code>-</code>' in the command line will be ignored.</p>
-
-<p>
-On Unix and MS Windows systems you can send output to a pipe in the same way. For example, to pipe the output to <code>lpr</code>, use the command</p>
-
-<blockquote><code>
- <b>gs -q -sOutputFile=- |</b> lpr
-</code></blockquote>
-
-<p>
-In this case you must also use the <a href="#Quiet"><code>-q</code>
-switch</a> to prevent Ghostscript from writing messages to standard output
-which become mixed with the intended output stream.</p>
-<p>
-Also, using the <b>-sstdout=%stderr</b> option is useful, particularly with
-input from PostScript files that may print to stdout.</p>
-
-<p>
-Similar results can be obtained with the <code>%stdout</code> and <code>%pipe%</code> filedevices. The example above would become</p>
-
-<blockquote><code>
- <b>gs -sOutputFile=%stdout -q |</b> lpr
-</code></blockquote>
-or
-<blockquote><code>
- <b>gs -sOutputFile=%pipe%</b>lpr
-</code></blockquote>
-
-<p>(again, doubling the <code>%</code> character on MS Windows systems.)</p>
-
-<p>
-In the last case, <code>-q</code> isn't necessary since Ghostscript handles the pipe itself and messages sent to stdout will be printed as normal.</p>
-<hr>
-<h2><a name="PDF"></a>Using Ghostscript with PDF files</h2>
-
-<p>
-Ghostscript is normally built to interpret both PostScript and PDF files, examining each file to determine automatically whether its contents are PDF or PostScript. All the normal switches and procedures for interpreting PostScript files also apply to PDF files, with a few exceptions. In addition, the
-<code>pdf2ps</code> utility uses Ghostscript to convert PDF to (Level 2) PostScript.</p>
-
-<h3><a name="PDF_switches"></a>Switches for PDF files</h3>
-
-<p>Here are some command line options specific to PDF</p>
-
- <dl>
-<dt><code>-dNEWPDF</code></dt>
-<dd>From release 9.55.0 Ghostscript incorporates two complete PDF interpreters; the original
-long-standing interpreter is written in PostScript but there is now a new interpreter written
-in C.
-<p>At present the old PostScript-based interpreter remains the default, in future releases the
-new C-based interpreter will become the default, though we would encourage people to experiment
-with the new interpreter and send us feedback. While there are two interpreters the command-line
-switch NEWPDF will allow selection of the existing interpreter when false and the new interpreter
-when true.</p>
-
-</dd>
-</dl>
-
- <dl>
-<dt><code>-dPDFFitPage</code></dt>
-<dd>Rather than selecting a PageSize given by the PDF MediaBox, BleedBox (see -dUseBleedBox),
-TrimBox (see -dUseTrimBox), ArtBox (see -dUseArtBox), or CropBox (see -dUseCropBox),
-the PDF file will be scaled to fit the current device page size
-(usually the default page size).
-<p>
-This is useful for creating fixed size images of PDF files that may have
-a variety of page sizes, for example thumbnail images.</p>
-<p>
-This option is also set by the <code>-dFitPage</code> option.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dPrinted</code></dt>
- <dt><code>-dPrinted=false</code></dt>
- <dd>Determines whether the file should be displayed or printed using the
- "screen" or "printer" options for annotations and images. With
- <code>-dPrinted</code>, the output will use the file's "print"
- options; with <code>-dPrinted=false</code>, the output will use the
- file's "screen" options. If neither of these is specified, the output will
- use the screen options for any output device that doesn't have an
- <code>OutputFile</code> parameter, and the printer options for
- devices that do have this parameter.</dd>
-</dl>
-
-<dl>
- <dt><code>-dUseBleedBox</code></dt>
- <dd>Sets the page size to the BleedBox rather than the MediaBox.
- defines the region to which the contents of the page should be
- clipped when output in a production environment. This may include
- any extra bleed area needed to accommodate the physical limitations
- of cutting, folding, and trimming equipment. The actual printed page
- may include printing marks that fall outside the bleed box.</dd>
-</dl>
-
-<dl>
- <dt><code>-dUseTrimBox</code></dt>
- <dd>Sets the page size to the TrimBox rather than the MediaBox.
- The trim box defines the intended dimensions of the finished page
- after trimming. Some files have a TrimBox that is smaller than the
- MediaBox and may include white space, registration or cutting marks
- outside the CropBox. Using this option simulates appearance of the
- finished printed page.</dd>
-</dl>
-
-<dl>
- <dt><code>-dUseArtBox</code></dt>
- <dd>Sets the page size to the ArtBox rather than the MediaBox.
- The art box defines the extent of the page's meaningful content
- (including potential white space) as intended by the page's creator.
- The art box is likely to be the smallest box. It can be useful
- when one wants to crop the page as much as possible
- without losing the content.</dd>
-</dl>
-
-<dl>
- <dt><code>-dUseCropBox</code></dt>
- <dd>Sets the page size to the CropBox rather than the MediaBox.
- Unlike the other "page boundary" boxes, CropBox does not have a
- defined meaning, it simply provides a rectangle to which the
- page contents will be clipped (cropped). By convention, it is
- often, but not exclusively, used to aid the positioning of content
- on the (usually larger, in these cases) media.</dd>
-</dl>
-
-<dl>
- <dt><code>-sPDFPassword=</code><em>password</em></dt>
- <dd>Sets the user or owner password to be used in decoding encrypted
- PDF files. For files created with encryption method 4 or earlier, the
- password is an arbitrary string of bytes; with encryption method 5 or
- later, it should be text in either UTF-8 or your locale's character
- set (Ghostscript tries both).</dd>
-</dl>
-
-<dl>
- <dt><code>-dShowAnnots=false</code></dt>
- <dd>
- Don't enumerate annotations associated with the page
- <code>Annots</code> key. Annotations are shown by default.
-<p> In addition, finer control is available by defining an array
-<code>/ShowAnnotTypes</code>. Annotation types listed in this array will
-be drawn, whilst those not listed will not be drawn.</p>
-<p> To use this feature:
-<code>-c "/ShowAnnotTypes [....] def" -f &ltinput file&gt</code>
-<br> Where the array can contain one or more of the following names:
-<code>/Stamp</code>, <code>/Squiggly</code>, <code>/Underline</code>, <code>/Link</code>, <code>/Text</code>, <code>/Highlight</code>, <code>/Ink</code>, <code>/FreeText</code>, <code>/StrikeOut</code> and <code>/stamp_dict</code>.</p>
-<p> For example, adding the follow to the command line:
-<code>-c "/ShowAnnotTypes [/Text /UnderLine] def" -f &ltinput file&gt</code>
- <br> would draw only annotations with the subtypes &quotText&quot and &quotUnderLine&quot</p>
- </dd>
-</dl>
-
-<dl>
- <dt><code>-dShowAcroForm=false</code></dt>
- <dd>
- Don't show annotations from the Interactive Form Dictionary (AcroForm dictionary).
- By default, AcroForm processing is now enabled because Adobe Acrobat does this. This option
- is provided to restore the previous behavior which corresponded to older Acrobat.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNoUserUnit</code></dt>
-<dd>
- Ignore <code>UserUnit</code> parameter. This may be useful for backward
- compatibility with old versions of Ghostscript and Adobe Acrobat,
- or for processing files with large values of <code>UserUnit</code>
- that otherwise exceed implementation limits.</dd>
-</dl>
-
-<dl>
- <dt><code>-dRENDERTTNOTDEF</code></dt>
- <dd>
- If a glyph is not present in a font the normal behaviour is to use the /.notdef
- glyph instead. On TrueType fonts, this is often a hollow sqaure. Under some
- conditions Acrobat does not do this, instead leaving a gap equivalent to the
- width of the missing glyph, or the width of the /.notdef glyph if no /Widths
- array is present. Ghostscript now attempts to mimic this undocumented feature
- using a user parameter <code>RenderTTNotdef</code>. The PDF interpreter sets this
- user parameter to the value of <code>RENDERTTNOTDEF</code> in systemdict,
- when rendering PDF files. To restore rendering of /.notdef glyphs from TrueType fonts in PDF files, set this parameter to true.</dd>
-</dl>
-
-<p>These command line options are no longer specific to PDF, but have some specific differences with PDF files</p>
-
-<dl>
- <dt><code>-dFirstPage=</code><em>pagenumber</em></dt>
- <dd>Begin on the designated page of the document.
- Pages of all documents in PDF collections are numbered sequentionally.</dd>
-</dl>
-
-<dl>
- <dt><code>-dLastPage=</code><em>pagenumber</em></dt>
- <dd>Stop after the designated page of the document.
- Pages of all documents in PDF collections are numbered sequentionally.</dd>
-</dl>
-
-<dl>
- <dt><code>-sPageList=</code><em>pagenumber</em></dt>
-
-<dd>There are three possible values for this; even, odd or a list of pages to be processed.
-A list can include single pages or ranges of pages.
-Ranges of pages use the minus sign '-', individual pages and ranges of pages are separated
-by commas ','. A trailing minus '-' means process all remaining pages. For example;
-<p><blockquote><pre>
--sPageList=1,3,5 indicates that pages 1, 3 and 5 should be processed.
--sPageList=5-10 indicates that pages 5, 6, 7, 8, 9 and 10 should be processed.
--sPageList=1,5-10,12- indicates that pages 1, 5, 6, 7, 8, 9, 10 and 12 onwards should be processed.
-</pre></blockquote>
-Note: Use of PageList overrides FirstPage and/or LastPage, if you set these as well as PageList they will be ignored. The
- list of pages should be given in increasing order, you cannot process pages out of order and inserting higher numbered pages before lower numbered
- pages in the list will generate an error.
-</p>
-
-<p>The PDF interpreter and the other language interpreters handle these in slightly different ways. Because
-PDF files enable random access to pages in the document the PDF inerpreter only interprets and renders
-the required pages. PCL and PostScript cannot be handled in ths way, and so all the pages must be interpreted.
-However only the requested pages are rendered, which can still lead to savings in time. Be aware that
-using the '%d' syntax for OutputFile does not reflect the page number in the original document. If you
-chose (for example) to process even pages by using <code>-sPageList=even</code>, then the output of
-<code>-sOutputFile=out%d.png</code> would still be
-out0.png, out1.png, out2.png etc......
-</p>
-<p>
-Because the PostScript and PCL interpreters cannot determine when a document terminates, sending multple
-files as input on the command line does not reset the PageList between each document, each page in the second and
-subsequent documents is treated as following on directly from the last page in the first document. The PDF
-interpreter, however, does not work this way. Since it knows about individual PDF files the PageList
-is applied to each PDF file separately. So if you were to set <code>-sPageList=1,2</code> and
- then send two PDF files, the result would be pages 1 and 2 from the first file, and then pages 1 and 2 from the second
- file. The PostScript interpreter, by contrast, would only render pages 1 and 2 from the first file. This means you must
- exercise caution when using this switch, and probably should not use it at all when processing a mixture of PostScript
- and PDF files on the same command line.
-</p>
-<p>
-The XPS language like the PDF language allows random access to pages. The XPS interpreter handles all the PageList cases
-discussed above. It also handles cases such as:
-<blockquote><pre>
--sPageList=1,2,1,2 indicates repeated pages. Pages processed in order 1, 2, 1, 2.
--sPageList=10-5 indicates pages will be processed in the order 10, 9, 8, 7, 6, 5.
--sPageList=1-,-1 indicates first processing from page 1 to end and then from end to page 1.
-</pre></blockquote>
-In addition, the XPS interpreter allows the use of a -dLastPage < -dFirstPage. In this
-case the pages will be processed backwards from LastPage to FirstPage.
-</p>
-
-</dd>
-</dl>
-
-<h3><a name="PDF_problems"></a>Problems interpreting a PDF file</h3>
-
-<p>
-Occasionally you may try to read or print a 'PDF' file that
-Ghostscript doesn't recognize as PDF, even though the same file
-<b><em>can</em></b> be opened and interpreted by an Adobe Acrobat viewer.
-In many cases, this is because of incorrectly generated PDF. Acrobat
-tends to be very forgiving of invalid PDF files. Ghostscript tends to
-expect files to conform to the standard. For example, even though
-valid PDF files must begin with <code>%PDF</code>, Acrobat will
-scan the first 1000 bytes or so for this string, and ignore any preceding
-garbage.</p>
-
-<p>
-In the past, Ghostscript's policy has been to simply fail with an
-error message when confronted with these files. This policy has, no
-doubt, encouraged PDF generators to be more careful. However, we now
-recognize that this behavior is not very friendly for people who just
-want to use Ghostscript to view or print PDF files. Our new policy is
-to try to render broken PDF's, and also to print a warning, so that
-Ghostscript is still useful as a sanity-check for invalid files.</p>
-
-<h3><a name="PDF_stdin"></a>PDF files from standard input</h3>
-
-<p>
-The PDF language, unlike the PostScript language, inherently requires
-random access to the file.
-If you provide PDF to standard input using the
-special filename <a href="#Pipes">'<code>-</code>'</a>,
-Ghostscript will copy it to a temporary file before interpreting the PDF.</p>
-<hr>
-<h2><a name="EPS"></a>Using Ghostscript with EPS files</h2>
-<p>
-Encapsulated PostScript (EPS) files are intended to be incorporated
-in other PostScript documents and may not display or print on their
-own. An EPS file must conform to the Document Structuring Conventions,
-must include a <code>%%BoundingBox</code> line to indicate the
-rectangle in which it will draw, must not use PostScript commands
-which will interfere with the document importing the EPS,
-and can have either zero pages or one page.
-Ghostscript has support for handling EPS files, but requires
-that the <code>%%BoundingBox</code> be in the header,
-not the trailer.
-To customize EPS handling, see <a href="#EPS_parameters">EPS parameters</a>.</p>
-
-<p>
-For the official description of the EPS file format, please
-refer to the Adobe documentation in their tech note #5002. It
-is available from:
-<a href="http://partners.adobe.com/public/developer/ps/index_specs.html"
-class="offsite">
-http://partners.adobe.com/public/developer/ps/index_specs.html</a></p>
-<hr>
-<h2><a name="SPOT"></a>Using Ghostscript with overprinting and spot colors</h2>
-
-<p>
-In general with PostScript and PDF interpreters, the handling of
-<b>overprinting</b> and <b>spot colors</b> depends upon the
-process color model of the <a href="#Output_device">output device</a>. Devices
-that produce gray or RGB output have an <b>additive</b> process color model.
-Devices which produce CMYK output have a <b>subtractive</b> process color model.
-Devices may, or may not, have support for spot colors.</p>
-
-<blockquote><i>
-Note: The differences in appearance of files with overprinting and spot colors
-caused by the differences in the color model of the output device are part of the
-PostScript and PDF specifications. They are not due to a limitation in the
-implementation of Ghostscript or its output devices.
-</i></blockquote>
-
-<p>
-With devices which use a subtractive process color model, both PostScript
-and PDF allow the drawing of objects using colorants (inks) for one or more planes
-without affecting the data for the remaining colorants. Thus the inks for one
-object may <code>overprint</code> the inks for another object. In some cases
-this produces a transparency like effect. (The effects of overprinting should
-not be confused with the PDF 1.4 blending operations which are supported for
-all output devices.) Overprinting is not allowed for devices with an additive
-process color model. With files that use overprinting, the appearance of the
-resulting image can differ between devices which produce RGB output versus devices
-which produce CMYK output. Ghostscript automatically overprints (if needed)
-when the output device uses a subtractive process color model. For example,
-if the file is using overprinting, differences can be seen in the appearance
-of the output from the <a href="Devices.htm#TIFF">tiff24nc and tiff32nc devices</a>
-which use an RGB and a CMYK process color models.</p>
-
-<p>
-Most of the Ghostscript <a href="Devices.htm">output devices</a> do not have
-file formats which support spot colors. Instead spot colors are converted using
-the tint transform function contained within the color space definition.. However
-there are several devices which have support for spot colors. The PSD format
-(Adobe Photoshop) produced by the <a href="Devices.htm#PSD">psdcmyk device</a>
-contains both the raster data plus an equivalent CMYK color for each spot color.
-This allows Photoshop to simulate the appearance of the spot colors. The <a href="Devices.htm#display_device">display
-device (MS Windows, OS/2, gtk+)</a> can be used with different color models:
-Gray, RGB, CMYK only, or CMYK plus spot colors (separation). The display device,
-when using its CMYK plus spot color (separation) mode, also uses an equivalent
-CMYK color to simulate the appearance of the spot color. The
-<a href="Devices.htm#TIFF">tiffsep
-device</a> creates output files for each separation (CMYK and any spot colors
-present). It also creates a composite CMYK file using an equivalent CMYK color
-to simulate the appearance of spot colors. The
-<a href="Devices.htm#XCF">xcfcmyk device</a>
-creates output files with spot colors placed in separate alpha channels. (The
-XCF file format does not currently directly support spot colors.)</p>
-
-<p>
-Overprinting with spot colors is not allowed if the tint transform function
-is being used to convert spot colors. Thus if spot colors are used with overprinting,
-then the appearance of the result can differ between output devices. One result
-would be obtained with a CMYK only device and another would be obtained with
-a CMYK plus spot color device. In a worst case situation where a file has overprinting
-with both process (CMYK) and spot colors, it is possible to get three different
-appearances for the same input file using the
-<a href="Devices.htm#TIFF">tiff24nc</a> (RGB),
-<a href="Devices.htm#TIFF">tiff32nc</a> (CMYK), and
-<a href="Devices.htm#TIFF">tiffsep</a> (CMYK plus spot colors) devices.</p>
-
-<blockquote><i>
-In Adobe Acrobat, viewing of the effects of overprinting is enabled by the
-'Overprint Preview' item in the 'Advanced' menu. This feature is not available
-in the free Acrobat Reader. The free Acrobat Reader also uses the tint transform
-functions to convert spot colors to the appropriate alternate color space.
-</i></blockquote>
-
-
-<hr>
-
-<h2><a name="Finding_files"></a>How Ghostscript finds files</h2>
-
-<p>
-When looking for initialization files (<code>gs_*.ps</code>,
-<code>pdf_*.ps</code>), font files, the <code>Fontmap</code> file,
-files named on the command line, and resource files, Ghostscript first tests whether the
-file name specifies an absolute path.</p>
-
-<blockquote><table>
-<tr><th colspan="2">Testing a file name for an absolute path</th></tr>
-<tr><th align="left">System</th>
-
- <th align="left">Does the name ...</th></tr>
-<tr><td colspan="2"></td></tr>
-<tr><td valign="top">Unix</td>
-
- <td>Begin with <code><u>/</u></code> ?</td></tr>
-<tr><td valign="top">MS Windows</td>
-
- <td>Have <code><u>:</u></code> as its second character, or
- begin with <code><u>/</u></code>, <code><u>\</u></code>,
- or <code><u>//servername/share/</u></code> ?</td></tr>
-<tr><td valign="top">VMS</td>
-
- <td>Contain a node, device, or root specification?</td></tr>
-</table></blockquote>
-
-<p>If the test succeeds, Ghostscript tries to open the file
-using the name given. Otherwise it tries directories in this order:</p>
-
-<ol>
-<li>The current directory if enabled by the
-<a href="#P-_switch"><code>-P</code> switch</a>;</li>
-
-<li>The directories specified by <a href="#I_switch"><code>-I</code>
-switches</a> in the command line, if any;</li>
-
-<li>The directories specified by the <code>GS_LIB</code>
-environment variable, if any;</li>
-
-<li>If built with COMPILE_INITS=1 (currently the default build) the files in the
-<code>%rom%Resource/</code> and <code>%rom%iccprofiles/</code> directories are
-built into the executable.</li>
-
-<li>The directories specified by the <code>GS_LIB_DEFAULT</code> macro
-(if any) in the makefile when this executable was built.</li>
-</ol>
-
-<p>
-<code>GS_LIB_DEFAULT</code>,
-<code>GS_LIB</code>, and the
-<code>-I</code> parameter may specify either a single
-directory or a list of directories separated by a character appropriate for
-the operating system ("<code>:</code>" on Unix systems,
-"<code>,</code>" on VMS systems, and
-"<code>;</code>" on MS Windows systems).
-By default, Ghostscript no longer searches the current directory first
-but provides <a href="#P_switch"><code>-P</code> switch</a> for a degree
-of backward compatibility.</p>
-
-<p>
-Note that Ghostscript does not use this file searching algorithm for the
-<code>run</code> or <code>file</code> operators: for these operators, it
-simply opens the file with the name given. To run a file using the searching
-algorithm, use <code>runlibfile</code> instead of <code>run</code>.</p>
-
-<h3><a name="PS_resources"></a>Finding PostScript Level 2 resources</h3>
-
-<p>
-Adobe specifies that resources are installed in a single directory.
-Ghostscript instead maintains a list of resource directories,
-and uses an extended method for finding resource files.</p>
-
-<p>
-The search for a resource file depends on whether
-the value of the system parameter <code>GenericResourceDir</code>
-specifies an absolute path. The user may set it as explained in
-<a href="#Resource_related_parameters">Resource-related parameters</a>.</p>
-
-<p>
-If the user doesn't set the system parameter <code>GenericResourceDir</code>,
-or use the <code>-sGenericResourceDir=</code> command line option, Ghostscript
-creates a default value for it by looking on the directory paths explained in
-<a href="#Finding_files">How Ghostscript finds files</a>, excluding the current directory.
-The first path with <code>Resource</code> in it is used, including any prefix
-up to the path separator character following the string <code>Resource</code>.
-For example, when COMPILE_INITS=1 (the current default build), if the first path
-is <code>%rom%Resource/Init/</code>, then the <code>GenericResourceDir</code>
-systemparam will be set to <code>%rom%Resource/</code> by default.</p>
-
-<p>
-If the value of the system parameter <code>GenericResourceDir</code>
-is an absolute path (the default),
-Ghostscript assumes a single resource directory.
-It concatenates :</p>
-
-<ol>
-<li>The value of the system parameter <code>GenericResourceDir</code>;</li>
-<li>The name of the resource category (for instance, <code>CMap</code>);</li>
-<li>The name of the resource instance (for instance, <code>Identity-H</code>).</li>
-</ol>
-
-<p>If the value of the system parameter <code>GenericResourceDir</code>
-is not an absolute path,
-Ghostscript assumes multiple resource directories.
-In this case it concatenates :</p>
-
-<ol>
-<li>A directory listed in the section
-<a href="#Finding_files">How Ghostscript finds files</a>,
-except the current directory;</li>
-
-<li>The value of the system parameter <code>GenericResourceDir</code>;</li>
-
-<li>The name of the resource category (for instance, <code>CMap</code>);</li>
-
-<li>The name of the resource instance (for instance, <code>Identity-H</code>)</li>
-</ol>
-
-<p>Due to possible variety of the part 1, the first successful combination is used.
-For example, if the value of the system parameter <code>GenericResourceDir</code>
-is the string <code>../Resource/</code>
-(or its equivalent in the file path syntax of the underlying platform),
-Ghostscript searches for <code>../Resource/CMap/Identity-H</code>
-from all directories listed in
-<a href="#Finding_files">How Ghostscript finds files</a>.
-So in this example, if the user on a Windows platform specifies
-the command line option <code>-I.;../gs/lib;c:/gs8.50/lib</code>,
-Ghostscript searches for <code>../gs/Resource/CMap/Identity-H</code> and
-then for <code>c:/gs8.50/Resource/CMap/Identity-H</code>.</p>
-
-<p>
-To get a proper platform dependent syntax Ghostscript inserts
-the value of the system parameter
-<code>GenericResourcePathSep</code> (initially
-"<code>/</code>" on Unix and Windows, "<code>:</code>" on MacOS,
-"<code>.</code>" or "<code>]</code>" on OpenVMS).
-The string <code>../Resource</code> is replaced with a
-platform dependent equivalent.</p>
-
-<p>
-In the case of multiple resource directories,
-the default <code>ResourceFileName</code> procedure retrieves either a path
-to the first avaliable resource, or if the resource is not available it
-returns a path starting with <code>GenericResourceDir</code>.
-Consequently Postscript installers of Postscript resources
-will overwrite an existing resource or add a new one to the first resource directory.</p>
-
-<p>
-To look up fonts, after exhausting the search method described in <a href="#Font_lookup">the
-next section</a>, it concatenates together</p>
-
-<ol>
-<li>the value of the system parameter
-<code>FontResourceDir</code> (initially
-<code>/Resource/Font/</code>)</li>
-
-<li>the name of the resource font (for instance, <code>Times-Roman</code>)</li>
-</ol>
-
-<p>
-Note that even although the system parameters are named "somethingDir", they
-are not just plain directory names: they have "<code>/</code>" on the
-end, so that they can be concatenated with the category name or font name.</p>
-
-<h3><a name="Font_lookup"></a>Font lookup</h3>
-
-<p>
-Ghostscript has a slightly different way to find the file containing a font
-with a given name. This rule uses not only the search path defined by
-<code>-I</code>, <code>GS_LIB</code>, and
-<code>GS_LIB_DEFAULT</code> <a href="#Finding_files">as described
-above</a>, but also the directory that is the value of the
-<code>FontResourceDir</code> system parameter, and an additional list of
-directories that is the value of the <code>GS_FONTPATH</code> environment
-variable (or the value provided with the <code>-sFONTPATH=</code> switch,
-if present).</p>
-
-<p>
-At startup time, Ghostscript reads in the <code>Fontmap</code> files in
-every directory on the search path (or in the list provided with the
-<code>-sFONTMAP=</code> switch, if present): these files are catalogs of
-fonts and the files that contain them. (See <a href="Fonts.htm#Fontmap">the
-documentation of fonts</a> for details.) Then, when Ghostscript needs to
-find a font that isn't already loaded into memory, it goes through a series
-of steps.</p>
-
-<ul>
-
-<li>
-First, it looks up the font name in the combined Fontmaps. If there is an
-entry for the desired font name, and the file named in the entry can be
-found in some directory on the general search path (defined by
-<code>-I</code>, <code>GS_LIB</code>, and
-<code>GS_LIB_DEFAULT</code>), and the file is loaded successfully, and
-loading it defines a font of the desired name, that is the end of the
-process.</li>
-
-<li>
-If this process fails at any step, Ghostscript looks for a file whose name
-is the concatenation of the value of the <code>FontResourceDir</code>
-system parameter and the font name, with no extension. If such a file
-exists, can be loaded, and defines a font of the desired name, that again is
-the end. The value of <code>FontResourceDir</code> is normally the
-string <code>/Resource/Font/</code>, but it can be changed with the
-<code>setsystemparams</code> operator: see the PostScript Language
-Reference Manual for details.</li>
-
-<li>
-If that fails, Ghostscript then looks for a file on the general search path
-whose name is the desired font name, with no extension. If such a file
-exists, can be loaded, and defines a font of the desired name, that again is
-the end.</li>
-
-<li>
-If that too fails, Ghostscript looks at the <code>GS_FONTPATH</code>
-environment variable (or the value provided with the
-<code>-sFONTPATH=</code> switch, if present), which is also a list of
-directories. It goes to the first directory on the list, and it's descendants,
-looking for all files that appear to contain PostScript fonts (also Truetype
-fonts); it then adds all those files and fonts to the combined Fontmaps, and
-starts over.</li>
-
-<li>
-If scanning the first FONTPATH directory doesn't produce a file that
-provides the desired font, it adds the next directory on the FONTPATH list,
-and so on until either the font is defined successfully or the list is
-exhausted.</li>
-
-<li>
-Finally, if all else fails, it will try to find a substitute for the font
-from among the standard 35 fonts.</li>
-
-</ul>
-
-<p>
-<a href="#CIDFonts">CID fonts</a> (e.g. Chinese, Japanese and Korean)
-are found using a different method.</p>
-
-<blockquote><table>
-<tr><th colspan="2">Differences between search path and font path</th></tr>
-<tr><th>Search path</th>
-
- <th>Font path</th></tr>
-<tr><td><code>-I</code> switch</td>
-
- <td><code>-sFONTPATH=</code> switch</td></tr>
-<tr><td><code>GS_LIB</code> and <code>GS_LIB_DEFAULT</code>
- environment variables</td>
-
- <td><code>GS_FONTPATH</code> environment variable</td></tr>
-<tr><td valign="top">Consulted first</td>
-
- <td valign="top">Consulted only if search path and
- <code>FontResourceDir</code> don't provide the file.</td></tr>
-<tr><td valign="top">Font-name-to-file-name mapping given in Fontmap
- files; aliases are possible, and there need not be any relation
- between the font name in the Fontmap and the
- <code>FontName</code> in the file.</td>
- <td valign="top">Font-name-to-file-name mapping is
- implicit – the <code>FontName</code> in the file is
- used. Aliases are not possible.</td></tr>
-<tr><td valign="top">Only fonts and files named in Fontmap are used.</td>
-
- <td valign="top">Every Type 1 font file in each directory is
- available; if TrueType fonts are supported (the
- <code>ttfont.dev</code> feature was included when the
- executable was built), they are also available.</td></tr>
-</table></blockquote>
-
-<p>
-If you are using one of the following types of computer, you may wish to
-set the environment variable <code>GS_FONTPATH</code> to
-the value indicated so that Ghostscript will automatically acquire all the
-installed Type 1 (and, if supported, TrueType) fonts (but see below for
-notes on systems marked with "*"):</p>
-
-<blockquote><table>
-<tr><th colspan="3">Suggested GS_FONTPATH for different systems</th></tr>
-<tr><th>&nbsp;</th>
-
- <th align="left">System type</th>
-
- <th valign="bottom" align="left">GS_FONTPATH</th></tr>
-<tr><td>&nbsp;</td>
-
- <td valign="top">Digital Unix</td>
-
- <td><code>/usr/lib/X11/fonts/Type1Adobe</code></td></tr>
-<tr><td>&nbsp;</td>
-
- <td valign="top">Ultrix</td>
-
- <td><code>/usr/lib/DPS/outline/decwin</code></td></tr>
-<tr><td>&nbsp;</td>
-
- <td valign="top">HP-UX 9</td>
-
- <td><code>/usr/lib/X11/fonts/type1.st/typefaces</code></td></tr>
-<tr><td>&nbsp;</td>
-
- <td valign="top">IBM AIX</td>
-
- <td><code>/usr/lpp/DPS/fonts/outlines
- <br>/usr/lpp/X11/lib/X11/fonts/Type1
- <br>/usr/lpp/X11/lib/X11/fonts/Type1/DPS</code></td></tr>
-<tr><td>&nbsp;</td>
-
- <td valign="top">NeXT</td>
-
- <td><code>/NextLibrary/Fonts/outline</code></td></tr>
-<tr><td>*</td>
-
- <td valign="top">SGI IRIX</td>
-
- <td><code>/usr/lib/DPS/outline/base
- <br>/usr/lib/X11/fonts/Type1</code></td></tr>
-<tr><td>&nbsp;</td>
-
- <td valign="top">SunOS 4.x<br>(NeWSprint only)</td>
-
- <td valign="top"><code>newsprint_2.5/SUNWsteNP/reloc/&#36;BASEDIR/NeWSprint/<br>&nbsp;&nbsp;&nbsp;&nbsp;small_openwin/lib/fonts</code></td></tr>
-<tr><td>**</td>
-
- <td valign="top">SunOS 4.x</td>
-
- <td><code>/usr/openwin/lib/X11/fonts/Type1/outline</code></td></tr>
-<tr><td>**</td>
-
- <td valign="top">Solaris 2.x</td>
-
- <td><code>/usr/openwin/lib/X11/fonts/Type1/outline</code></td></tr>
-<tr><td>&nbsp;</td>
-
- <td valign="top">VMS</td>
-
- <td><code>SYS&#36;COMMON:[SYSFONT.XDPS.OUTLINE]</code></td></tr>
-</table>
-
-<p>
-<b>*</b> On SGI IRIX systems, you must use <code>Fontmap.SGI</code> in
-place of <code>Fontmap</code> or <code>Fontmap.GS</code>, because
-otherwise the entries in <code>Fontmap</code> will take precedence over
-the fonts in the FONTPATH directories.</p>
-
-<p>
-<b>**</b> On Solaris systems simply setting <code>GS_FONTPATH</code> or
-using <code>-sFONTPATH=</code> may not work, because for some reason some
-versions of Ghostscript can't seem to find any of the Type1 fonts in
-<code>/usr/openwin/lib/X11/fonts/Type1/outline</code>. (It says: "15
-files, 15 scanned, 0 new fonts". We think this problem has been fixed in
-Ghostscript version 6.0, but we aren't sure because we've never been able to
-reproduce it.) See <code>Fontmap.Sol</code> instead. Also, on Solaris
-2.x it's probably not worth your while to add Sun's fonts to your font path
-and Fontmap. The fonts Sun distributes on Solaris 2.x in the directories</p>
-
-<blockquote><code>
- /usr/openwin/lib/X11/fonts/Type1<br>
- /usr/openwin/lib/X11/fonts/Type1/outline
-</code></blockquote>
-
-<p>
-are already represented among the ones distributed as part of Ghostscript;
-and on some test files, Sun's fonts have been shown to cause incorrect
-displays with Ghostscript.</p>
-
-</blockquote>
-
-<p>
-These paths may not be exactly right for your installation; if the indicated
-directory doesn't contain files whose names are familiar font names like
-Courier and Helvetica, you may wish to ask your system administrator where
-to find these fonts.</p>
-
-<p>
-Adobe Acrobat comes with a set of fourteen Type 1 fonts, on Unix typically
-in a directory called ...<code>/Acrobat3/Fonts</code>. There is no
-particular reason to use these instead of the corresponding fonts in the
-Ghostscript distribution (which are of just as good quality), except to save
-about a megabyte of disk space, but the installation documentation explains
-how to do it <a href="Install.htm#Use_Acrobat_fonts_Unix">on Unix</a>.</p>
-
-<h3><a name="CIDFonts"></a>CID fonts</h3>
-
-<p>
-CID fonts are PostScript resources containing a
-large number of glyphs (e.g. glyphs for Far East languages,
-Chinese, Japanese and Korean).
-Please refer to the PostScript Language Reference,
-third edition, for details.</p>
-
-<p>
-CID font resources are a different kind of PostScript resource from fonts.
-In particular, they cannot be used as regular fonts.
-CID font resources must first be combined with a CMap resource, which
-defines specific codes for glyphs, before it can be used as a font. This
-allows the reuse of a collection of glyphs with different encodings.</p>
-
-<p>
-The simplest method to request a font composed of a CID font resource
-and a CMap resource in a PostScript document is
-<blockquote><code>
-/CIDFont-CMap findfont
-</code></blockquote>
-where <code>CIDFont</code> is a name of any
-CID font resource, and <code>CMap</code> is a name of a CMap resource
-designed for the same character collection. The interpreter will compose
-the font automatically from the specified CID font and CMap resources.
-Another method is possible using the <code>composefont</code> operator.</p>
-
-<p>
-CID fonts must be placed in the <code>/Resource/CIDFont/</code> directory.
-They are not found using <a href="#Font_lookup">Font lookup</a>
-on the search path or font path.</p>
-
-<h3><a name="CIDFontSubstitution"></a>CID font substitution</h3>
-<h4><a name="AutomaticCIDFontSubstitution"></a>Automatic CIDFont Substitution</h4>
-<p>
-In general, it is highly recommended that CIDFonts used in the creation of PDF
-jobs should be embedded or available to Ghostscript as CIDFont resources, this
-ensures that the character set, and typeface style are as intended by the
-author.</p>
-<p>
-In cases where the original CIDFont is not available, the next best option is
-to provide Ghostscript with a mapping to a suitable alternative CIDFont - see
-below for details on how this is achieved. However, Ghostscript does provide the
-ability to use a "fall back" CIDFont substitute. As shipped, this uses the
-DroidSansFallback.ttf font. This font contains a large number of glyphs covering
-several languages, but it is not comprehensive. There is, therefore, a chance
-that glyphs may be wrong, or missing in the output when this fallback is used.</p>
-<p>
-Internally, the font is referenced as CIDFont resource called <code>CIDFallBack</code>, thus
-a different fallback from DroidSansFallback.ttf can be specified adding a
-mapping to your cidfmap file (see below for details) to map the name "CIDFallBack"
-as you prefer. For <code>CIDFallBack</code> the mapping <bold>must</bold> be a TrueType
-font or TrueType collection, it cannot be a Postscript CIDFont file.</p>
-<p>
-As with any font containing large numbers of glyphs, DroidSansFallback.ttf is
-quite large (~3.5Mb at the of writing). If this is space you cannot afford in
-your use of Ghostscript, you can simply delete the file from:
-<code>Resource/CIDFSubst/DroidSansFallback.ttf</code>. The build system will cope with the
-file being removed, and the initialization code will avoid adding the internal
-fall back mapping if the file is missing.</p>
-<p>
-If DroidSansFallback.ttf is removed, and no other <code>CIDFallBack</code> mapping is supplied,
-the final "fall back" is to use a "dumb" bullet CIDFont, called <code>ArtifexBullet</code>. As
-the name suggests, this will result in all the glyphs from a missing CIDFont being replaced with
-a simple bullet point.</p>
-<p>
-This type of generic fall back CIDFont substitution can be very useful for
-viewing and proofing jobs, but may not be appropriate for a "production"
-workflow, where it is expected that <b>only</b> the original font should be
-used. For this situation, you can supply Ghostscript with the command line option:
-<code>-dPDFNOCIDFALLBACK</code>. By combining <code>-dPDFNOCIDFALLBACK</code> with <code>-dPDFSTOPONERROR</code>
-a production workflow can force a PDF with missing CIDFonts to error, and avoid
-realising a CIDFont was missing only after printing.</p>
-<p>
-The directory in which the fallback TrueType font or collection can be specified by the
-command line parameter <code>-sCIDFSubstPath="path/to/TTF"</code>, or with the environment
-variable <code>CIDFSUBSTPATH</code>. The file name of the substitute TrueType font can be
-specified using the command line parameter <code>-sCIDFSubstFont="TTF file name"</code> or
-the environment variable <code>CIDFSUBSTFONT</code>.</p>
-
-<h4><a name="ExplicitCIDFontSubstitution"></a>Explicit CIDFont Substitution</h4>
-<p>Substitution of CID font resources is controlled, by default, by the Ghostscript
-configuration file <code>Resource/Init/cidfmap</code>, which defines a CID font resource map.</p>
-<p>
-The file forms a table of records, each of which should use one of three formats,
-explained below. Users may modify <code>Resource/Init/cidfmap</code> to configure
-Ghostscript for a specific need. Note that the default Ghostscript build includes
-such configuration and resource files in a rom file system built into the executable.
-So, to ensure your changes have an effect, you should do one of the following: rebuild
-the executable; use the "-I" command line option to add the directory containing your
-modified file to Ghostscript's search path; or, finally, build Ghostscript to use disk
-based resources.</p>
-
-<h4>Format 1</h4>
-<p> To substitute a CID font resource with another CID font resource, add a record like this :</p>
-
-<blockquote><code>
-/Substituted /Original ;
-</code></blockquote>
-<p>where <code>Substituted</code> is a name of CID font resource being used
-by a document, and <code>Original</code> is a name of an available
-CID font resource. Please pay attention that both them must be
-designed for same character collection. In other words, you
-cannot substitute a Japanese CID font resource with a Korean CID font resource,
-etc. CMap resource names must not appear in
-<code>lib/cidfmap</code>. The trailing semicolon and the space before it
-are both required.</p>
-
-<h4>Format 2</h4>
-<p>To substitute (emulate) a CID font resource with a TrueType font file, add a record like this :</p>
-
-<blockquote><code>
-/Substituted &lt;&lt; keys&amp;values &gt;&gt; ;
-</code></blockquote>
-
-<p>Where <code>keys&amp;values</code> are explained in the table below.</p>
-
-<table>
-
-<tr valign="top"> <th>Key</th>
- <th>Type</th>
- <th>Description</th></tr>
-<tr valign="top"> <td><code>/Path</code></td>
- <td>string</td>
- <td>A path to a TrueType font file. This must be an absolute path.
- If using <code><a href="#Safer">-dSAFER</a></code>, the directory
- containing the font file must be on one of the permitted paths.</td></tr>
-<tr valign="top"> <td><code>/FileType</code></td>
- <td>name</td>
- <td>Must be <code>/TrueType</code>.</td></tr>
-<tr valign="top"> <td><code>/SubfontID</code></td>
- <td>integer</td>
- <td>(optional) Index of the font in font collection, such as TTC.
- This is ignored if <code>Path</code> doesn't specify a collection.
- The first font in a collection is 0.
- Default value is 0.</td></tr>
-<tr valign="top"> <td><code>/CSI</code>
- <td>array of 2 or 3 elements
- <td>(required) Information for building <code>CIDSystemInfo</code>.
- <p>
- If the array consists of 2 elements,
- the first element is a string, which specifies <code>Ordering</code>;
- the second element is a number, which specifies <code>Supplement</code>.
- <p>
- If the array consists of 3 elements,
- the first element is a string, which specifies <code>Registry</code>;
- the second element is a string, which specifies <code>Ordering</code>;
- the third element is a number, which specifies <code>Supplement</code>.
-</table>
-
-<p>
-Currently only CIDFontType 2 can be emulated with a TrueType font.
-The TrueType font must contain enough characters to cover an
-Adobe character collection, which is specified in <code>Ordering</code> and used in documents.</p>
-
-<h4>Format 3</h4>
-<p> To point Ghostscript at a specific CIDFont file outside it's "normal" resource search path :</p>
-
-<blockquote><code>
-/CIDName (path/to/cid/font/file) ;
-</code></blockquote>
-<p>where <code>CIDName</code> is a name of CID font resource being used
-by a document, and <code>"path/to/cid/font/file"</code> is the path to the
-Postscript CIDFont file, including the file name. NOTE: the CIDFont file, when
-executed by the Postscript interpreter, must result in a CIDFont resource being
-defined whose CIDFontName matches the "CIDName" key for the current record.
-I.E. an entry with the key /PingHei-Bold must reference a file which creates a
-CIDFont resource called "PingHei-Bold". To substitute a file based CIDFont for
-a differently named CIDFont, use formats 1 and 3 in combination (the order of the
-entries is not important).</p>
-
-<p>The trailing semicolon and the space before it are both required.</p>
-
-<p>
-Examples :</p>
-
-
-<blockquote><code>
-<h5>Format 1:</h5>
-/Ryumin-Medium /ShinGo-Bold ;<br>
-/Ryumin-Light /MS-Mincho ;<br>
-<h5>Format 2:</h5>
-/Batang &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/batang.ttc) /SubfontID 0 /CSI [(Korea1) 3] &gt;&gt; ;<br>
-/Gulim &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 0 /CSI [(Korea1) 3] &gt;&gt; ;<br>
-/Dotum &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 2 /CSI [(Korea1) 3] &gt;&gt; ;<br>
-<br>
-<h5>Format 1 & 2</h5>
-/SimSun &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/simsun.ttc) /SubfontID 0 /CSI [(GB1) 2] &gt;&gt; ;<br>
-/SimHei &lt;&lt; /FileType /TrueType /Path (C:/WINDOWS/fonts/simhei.ttf) /SubfontID 0 /CSI [(GB1) 2] &gt;&gt; ;<br>
-/STSong-Light /SimSun ;<br>
-/STHeiti-Regular /SimHei ;<br>
-<h5>Format 3:</h5>
-/PMingLiU (/usr/local/share/font/cidfont/PMingLiU.cid) ;<br>
-<h5>Format 1 & 3</h5>
-/Ryumin-Light /PMingLiU ;<br>
-/PMingLiU (/usr/local/share/font/cidfont/PMingLiU.cid) ;<br>
-</code></blockquote>
-
-<p>The win32 installer of recent version of ghostscript has a checkbox for
-"Use Windows TrueType fonts for Chinese, Japanese and Korean" to optionally update
-lib/cidfmap with the common CJK fonts provided by Microsoft products. The script
-can also be run separately (e.g. against a network drive with windows CJK fonts):</p>
-
-<blockquote><code>
-gswin32c -q -dBATCH -sFONTDIR=c:/windows/fonts -sCIDFMAP=lib/cidfmap lib/mkcidfm.ps
-</code></blockquote>
-
-<p>
-Note that the font file path uses Postscript syntax.
-Because of this, backslashes in the paths must be
-represented as a double backslash.</p>
-
-<p>
-This can complicate substitutions for fonts with non-Roman names.
-For example, if a PDF file asks for a font with the name
-<code>/#82l#82r#83S#83V#83b#83N</code>. This cannot be used directly
-in a cidfmap file because the #xx notation in names is a PDF-only
-encoding. Instead, try something like:</p>
-<blockquote>
-<code>&lt;82C68272835383568362834E&gt;cvn &lt;&lt; /Path
-(C:/WINDOWS/Fonts/msmincho.ttc) /FileType /TrueType /SubfontID 0 /CSI
-[(Japan1) 3] &gt;&gt; ;</code>
-</blockquote>
-<p>Where <code>&lt;82C68272835383568362834E&gt;</code> is the same byte
-sequence converted to a hex string. This lets you specify a name
-using any sequence of bytes through the encodings available for
-Postscript strings.</p>
-
-<p>
-Note that loading truetype fonts directly from
-<code>/Resources/CIDFont</code> is no longer supported.
-There is no reliable way to generate a character ordering for truetype
-fonts. The 7.0x versions of Ghostscript supported this by assuming a Japanese
-character ordering. This is replaced in the 8.0x and later releases with
-the more general <code>cidfmap</code> mechanism.</p>
-
-<p>
-The PDF specification requires CID font files to be embedded,
-however some documents omit them. As a workaround
-the PDF interpreter applies an additional substitution method when
-a requested CID font resource is not embedded and it is not available.
-It takes values of the keys <code>Registry</code> and <code>Ordering</code>
-from the <code>CIDFontSystem</code> dictionary,
-and concatenates them with a dash inserted.
-For example, if a PDF CID font resource specifies
-<blockquote><code>
-/CIDSystemInfo &lt;&lt; /Registry (Adobe) /Ordering (CNS1) /Supplement 1 &gt;&gt;
-</code></blockquote>
-the generated subsitituite name is <code>Adobe-CNS1</code>.
-The latter may look some confusing for a font name,
-but we keep it for compatibility with older Ghostscript versions,
-which do so due to a historical reason.
-Add a proper record to <code>lib/cidfmap</code> to provide it.</p>
-
-<p>
-Please note that when a PDF font resource specifies
-<blockquote><code>
-/Registry (Adobe) /Ordering (Identity)
-</code></blockquote>
-there is no way to determine the language properly.
-If the CID font file is not embedded, the <code>Adobe-Identity</code>
-record depends on the document and a correct record isn't possible when
-a document refers to multiple Far East languages.
-In the latter case add individual records for specific CID font names used in the document.</p>
-
-<p>
-Consequently, if you want to handle any PDF document with
-non-embedded CID fonts (which isn't a correct PDF),
-you need to create a suitable <code>lib/cidfmap</code> by hand,
-possibly a specific one for each document.</p>
-
-<h3><a name="UnicodeTT"></a>Using Unicode True Type fonts</h3>
-
-<p>Ghostscript can make use of Truetype fonts with a Unicode character set.
-To do so, you should generate a (<b>NOTE:</b> non-standard!) Postscript or PDF
-job where the relevant text is encoded as UTF-16. Ghostscript may be used for
-converting such jobs to other formats (Postscript, PDF, PXL etc).
-The resulting output will be compliant with the spec (unlike the input).</p>
-
-<p>
-To render an UTF-16 encoded text, one must do the following :</p>
-
-<ul>
-
-<li>
-Provide a True Type font with Unicode Encoding.
-It must have a <code>cmap</code> table with
-<code>platformID</code> equals to 3 (Windows),
-and <code>SpecificID</code> eqials to 1 (Unicode).</li>
-
-<li>
-Describe the font in <code>Resource/Init/cidfmap</code>
-with special values for the <code>CSI</code> key :
-<code>[(Artifex) (Unicode) 0]</code>.</li>
-
-<li>
-In the PS or PDF job combine the font
-with one of CMap <code>Identity-UTF16-H</code>
-(for the horizontal writing mode)
-or <code>Identity-UTF16-V</code>
-(for the vertical writing mode).
-Those CMaps are distributed with Ghostscript
-in <code>Resource/CMap</code>.</li>
-
-</ul>
-
-<p>Please note that <code>/Registry (Adobe) /Ordering (Identity)</code>
-won't properly work for Unicode documents,
-especially for the searchability feature
-(see <a href="#CIDFontSubstitution">CID font substitution</a>).</p>
-
-<h3><a name="Temp_files"></a>Temporary files</h3>
-
-<blockquote><table>
-<tr><th colspan="3">Where Ghostscript puts temporary files</th></tr>
-<tr>
- <th align="left">Platform</th>
-
- <th align="left">Filename</th>
-
- <th align="left">Location</th></tr>
-<tr valign="top"> <td>MS Windows and OpenVMS</td>
-
- <td><code>_temp_</code>XX.XXX</td>
-
- <td>Current directory</td></tr>
-<tr valign="top"> <td>OS/2</td>
-
- <td><code>gs</code>XXXXXX</td>
-
- <td>Current directory</td></tr>
-<tr valign="top"> <td>Unix</td>
-
- <td><code>gs_</code>XXXXX</td>
-
- <td><code>/tmp</code></td></tr>
-</table></blockquote>
-
-<p>
-You can change in which directory Ghostscript creates temporary files by
-setting the <code>TMPDIR</code> or <code>TEMP</code> environment
-variable to the name of the directory you want used. Ghostscript currently
-doesn't do a very good job of deleting temporary files if it exits because
-of an error; you may have to delete them manually from time to time.</p>
-
-
-<hr>
-
-<h2><a name="Platforms"></a>Notes on specific platforms</h2>
-
-<h3><a name="Word size"></a>Word size (32 or 64 bits)</h3>
-
-<p>
-The original PostScript language specification, while not stating a specific word sise,
-defines 'typical' limits which make it clear that it was intended to run as a 32-bit
-environment. Ghostscript was originally coded that way, and the heritage remains
-within the code base.
-</p>
-<p>
-Because the Ghostscript PDF interpreter is currently written in PostScript, it proved
-necessary to add support for 64-bit integers so that we could process PDF files which
-exceed 2GB in size. This is the only real purpose in adding support for large integers,
-however since that time, we have made some efforts to allow for the use of 64-bit words; in
-particular the use of integers, but also lifting the 64K limit on strings and arrays,
-among other areas.
-</p>
-However this is, obviously, dependent on the operating system and compiler support
-available. Not all builds of Ghostscript will support 64-bit integers, though some
-32-bit builds (eg Windows) will.
-<p>
-Even when the build supports 64-bit words, you should be aware that there are areas
-of Ghostscript which do not support 64-bit values. Sometimes these are dependent
-on the build and other times they are inherent in the architecture of Ghostscript (the graphics library does not
-support 64-bit co-ordinates in device space for example, and most likely never will).
-</p>
-<p>
-Note that the extended support for 64-bit word size can be disabled by executing 'true .setcpsimode',
-This is important for checking the output of the Quality Logic test suite (and possibly other
-test suites) as the tests make assumptions about the sizes of integers (amongst other things).
-You can run /ghostpdl/Resource/Init/gs_cet.ps to change Ghostscript's behaviour so
-that it matches the observed behaviour of Adobe CPSI interpreters.
-</p>
-
-<h3><a name="Unix"></a>Unix</h3>
-
-<p>
-The Ghostscript distribution includes some Unix shell scripts to use with
-Ghostscript in different environments. These are all user-contributed
-code, so if you have questions, please contact the user identified in the
-file, not Artifex Software.</p>
-
-<dl>
- <dt><code>pv.sh</code></dt>
- <dd>Preview a specified page of a <code>dvi</code> file in an X window</dd>
-</dl>
-
-<dl>
- <dt><code>sysvlp.sh</code></dt>
- <dd>System V 3.2 lp interface for parallel printer</dd>
-</dl>
-
-<dl>
- <dt><code>pj-gs.sh</code></dt>
- <dd>Printing on an H-P PaintJet under HP-UX</dd>
-</dl>
-
-<dl>
- <dt><code>unix-lpr.sh</code></dt>
- <dd>Queue filter for <code>lpr</code> under Unix;
- <a href="Unix-lpr.htm">its documentation</a> is intended for system
- administrators</dd>
-</dl>
-
-<dl>
- <dt><code>lprsetup.sh</code></dt>
- <dd>Setup for <code>unix-lpr.sh</code></dd>
-</dl>
-
-<h3><a name="VMS"></a>VMS</h3>
-
-<ul>
-<li>To be able to specify switches and file names when invoking the
- interpreter, define <code>gs</code> as a foreign command:</li>
-
-<li>
-<blockquote>
-<code>&#36; gs == "&#36;</code><em>disk</em><code>:[</code><em>directory</em><code>]gs.exe</code>"
-</blockquote>
-</li>
-
-<li>
-<p>
-where the "<em>disk</em>" and "<em>directory</em>" specify where
- the Ghostscript executable is located. For instance,</p>
-</li>
-<li>
-<blockquote><code>
-&#36; gs == "&#36;dua1:[ghostscript]gs.exe"
-</code></blockquote>
-</li>
-
-<li>On VMS systems, the last character of each "directory" name indicates
-what sort of entity the "directory" refers to. If the "directory" name
-ends with a colon "<code>:</code>", it is taken to refer to a logical
-device, for instance</li>
-
-<li>
-<blockquote><code>
-&#36; define ghostscript_device dua1:[ghostscript_510]<br>
-&#36; define gs_lib ghostscript_device:
-</code></blockquote>
-</li>
-
-<li>
-<p>
-If the "directory" name ends with a closing square bracket
-"<code>]</code>", it is taken to refer to a real directory, for instance</p>
-</li>
-<li>
-<blockquote><code>
-&#36; define gs_lib dua1:[ghostscript]
-</code></blockquote>
-</li>
-<li>Defining the logical <code>GS_LIB</code></li>
-<li>
-<blockquote>
-<code>&#36; define gs_lib</code> <em>disk</em><code>:[</code><em>directory</em><code>]</code>
-</blockquote>
-</li>
-<li>
-<p>
-allows Ghostscript to find its initialization files in the Ghostscript
-directory even if that's not where the executable resides.</p>
-</li>
-
-<li>Although VMS DCL itself converts unquoted parameters to upper case, C
-programs such as Ghostscript receive their parameters through the C runtime
-library, which forces all unquoted command-line parameters to lower case.
-That is, with the command</li>
-
-<li>
-<blockquote><code>
-&#36; gs -Isys&#36;login:
-</code></blockquote>
-</li>
-
-<li>
-<p>
-Ghostscript sees the switch as <code>-isys&#36;login</code>,
-which doesn't work. To preserve the case of switches, quote them like
-this:</p>
-</li>
-
-<li>
-<blockquote><code>
-&#36; gs "-Isys&#36;login:"
-</code></blockquote>
-</li>
-
-<li>If you write printer output to a file with
-<code>-sOutputFile=</code> and then want to print the file later, use
-"<code>PRINT/PASSALL</code>".</li>
-</ul>
-
-<ul>
-<li>PDF files (or PostScript files that use the
-<code>setfileposition</code> operator) must be "stream LF" type files to
-work properly on VMS systems. (<b><em>Note:</em></b> This definitely matters
-if Ghostscript was compiled with DEC C; we are not sure of the situation if
-you use <code>gcc</code>.) Because of this, if you transfer files by
-FTP, you probably need to do one of these two things after the transfer:</li>
-
-<li>
- <ol>
- <li>If the FTP transfer was in text (ASCII) mode:</li>
-
- <li>
- <blockquote>
- <code>&#36; convert/fdl=streamlf.fdl</code> input-file output-file
- </blockquote>
-
-
- <p>
- where the contents of the file <code>STREAMLF.FDL</code> are</p>
-
- <blockquote>
- <pre>FILE
- ORGANIZATION sequential
-
- RECORD
- BLOCK_SPAN yes
- CARRIAGE_CONTROL carriage_return
- FORMAT stream_lf
- </pre></blockquote>
- </li>
-
- <li>If the FTP transfer was in binary mode:</li>
-
- <li>
- <blockquote><code>
- &#36; set file/attribute=(rfm:stmlf)
- </code></blockquote>
- </li>
- </ol>
-</li>
-</ul>
-
-<h4><a name="VMS_X_Windows"></a>Using X Windows on VMS</h4>
-
-<p>
-If you are using on an X Windows display, you can set it up with the node
-name and network transport, for instance</p>
-
-<blockquote><code>
- &#36; set display/create/node="doof.city.com"/transport=tcpip
-</code></blockquote>
-
-<p>
-and then run Ghostscript by typing <code>gs</code> at the command line.</p>
-
-<h3><a name="MS_Windows"></a>MS Windows</h3>
-
-<p>
-The name of the Ghostscript command line executable on MS Windows is
-<code>gswin32c</code>/<code>gswin64c</code> so use this instead of the
-plain '<code>gs</code>' in the quickstart examples.</p>
-
-<p>
-To run the batch files in the ghostscript <code>lib</code> directory,
-you must add <em>gs\</em><code>bin</code> and
-<em>gs\</em><code>lib</code> to the <code>PATH</code>, where
-<em>gs</em> is the top-level Ghostscript directory.</p>
-
-<p>
-When passing options to ghostcript through a batch file wrapper such as
-<code>ps2pdf.bat</code> you need to substitute '#' for '=' as the separator
-between options and their arguments. For example:</p>
-<blockquote><pre>
-ps2pdf -sPAPERSIZE#a4 file.ps file.pdf
-</pre></blockquote>
-
-<p>Ghostscript treats '#' the same internally, and the '=' is mangled by
-the command shell.</p>
-
-<p>
-There is also an older version for MS Windows called just <code>gswin32</code>
-that provides its own window for the interactive postscript prompt.
-The executable <code>gswin32c</code>/<code>gswin64c</code> is usually the better
-option since it uses the native command prompt window.</p>
-
-<p>
-For printer devices, the default output is the default printer.
-This can be modified as follows.</p>
-
-<blockquote>
-<dl>
- <dt><code>-sOutputFile="%printer%printer name"</code></dt>
- <dd>Output to the named printer. If your printer is named "HP DeskJet 500"
- then you would use <code>-sOutputFile="%printer%HP DeskJet 500"</code>.</dd>
-
-</dl>
-</blockquote>
-
-<h3><a name="MS-DOS"></a>MS-DOS</h3>
-
-<p>
-<strong>Note:</strong> Ghostscript is no longer supported on MS-DOS.</p>
-
-<p>
-Invoking Ghostscript from the command prompt in Windows is supported by
-the Windows executable described above.</p>
-
-<h3><a name="X_Windows"></a>X Windows</h3>
-
-<p>
-Ghostscript looks for the following resources under the program name
-<code>ghostscript</code> and class name
-<code>Ghostscript</code>; the ones marked "**" are
-calculated from display metrics:</p>
-
-<blockquote><table>
-<tr><th colspan="3">X Windows resources</th></tr>
-<tr><th align="left">Name</th>
-
- <th align="left">Class</th>
-
- <th align="left">Default</th></tr>
-<tr><td><code>background</code></td>
-
- <td><code>Background</code></td>
-
- <td><code>white</code></td></tr>
-<tr><td><code>foreground</code></td>
-
- <td><code>Foreground</code></td>
-
- <td><code>black</code></td></tr>
-<tr><td><code>borderColor</code></td>
-
- <td><code>BorderColor</code></td>
-
- <td><code>black</code></td></tr>
-<tr><td><code>borderWidth</code></td>
-
- <td><code>BorderWidth</code></td>
-
- <td><code>1</code></td></tr>
-<tr><td><code>geometry</code></td>
-
- <td><code>Geometry</code></td>
-
- <td><code>NULL</code></td></tr>
-<tr><td><code>xResolution</code></td>
-
- <td><code>Resolution</code></td>
-
- <td>**</td></tr>
-<tr><td><code>yResolution</code></td>
-
- <td><code>Resolution</code></td>
-
- <td>**</td></tr>
-<tr><td><code>useExternalFonts</code></td>
-
- <td><code>UseExternalFonts</code></td>
-
- <td><code>true</code></td></tr>
-<tr><td><code>useScalableFonts</code></td>
-
- <td><code>UseScalableFonts</code></td>
-
- <td><code>true</code></td></tr>
-<tr><td><code>logExternalFonts</code></td>
-
- <td><code>LogExternalFonts</code></td>
-
- <td><code>false</code></td></tr>
-<tr><td><code>externalFontTolerance</code></td>
-
- <td><code>ExternalFontTolerance</code></td>
-
- <td><code>10.0</code></td></tr>
-<tr><td><code>palette</code></td>
-
- <td><code>Palette</code></td>
-
- <td><code>Color</code></td></tr>
-<tr><td><code>maxGrayRamp</code></td>
-
- <td><code>MaxGrayRamp</code></td>
-
- <td><code>128</code></td></tr>
-<tr><td><code>maxRGBRamp</code></td>
-
- <td><code>MaxRGBRamp</code></td>
-
- <td><code>5</code></td></tr>
-<tr> <td><code>maxDynamicColors</code></td>
-
- <td><code>MaxDynamicColors</code></td>
-
- <td><code>256</code></td></tr>
-<tr><td><code>useBackingPixmap</code></td>
-
- <td><code>UseBackingPixmap</code></td>
-
- <td><code>true</code></td></tr>
-<tr><td><code>useXPutImage</code></td>
-
- <td><code>UseXPutImage</code></td>
-
- <td><code>true</code></td></tr>
-<tr><td><code>useXSetTile</code></td>
-
- <td><code>UseXSetTile</code></td>
-
- <td><code>true</code></td></tr>
-</table></blockquote>
-
-<h4><a name="X_resources"></a>X resources</h4>
-
-<ul>
-<li>
-To set X resources, put them in a file (such as
-<code>~/.Xdefaults</code> on Unix) in a form like this:</li>
-
-<li>
-<blockquote><table>
- <tr><td><code>Ghostscript*geometry:</code></td><td><code>595x842-0+0</code></td></tr>
- <tr><td><code>Ghostscript*xResolution:</code></td><td><code>72</code></td></tr>
- <tr><td><code>Ghostscript*yResolution:</code></td><td><code>72</code></td></tr>
-</table></blockquote>
-
-<p>
- Then merge these resources into the X server's resource database:</p>
-
-<blockquote><code>
- xrdb -merge ~/.Xdefaults
-</code></blockquote>
-
-</li>
-
-<li>
-Ghostscript doesn't look at the default system background and foreground
-colors; if you want to change the background or foreground color, you must
-set them explicitly for Ghostscript. This is a deliberate choice, so that
-PostScript documents will display correctly by default -- with white as
-white and black as black -- even if text windows use other colors.</li>
-
-<li>
-The <code>geometry</code> resource affects only window placement.</li>
-
-<li>
-Resolution is expressed in pixels per inch (1 inch = 25.4mm).</li>
-
-<li>
-The font tolerance gives the largest acceptable difference in height of the
-screen font, expressed as a percentage of the height of the desired font.</li>
-
-<li>
-The <code>palette</code> resource can be used to restrict Ghostscript to
-using a grayscale or monochrome palette.</li>
-
-<li>
-<code>maxRGBRamp</code> and
-<code>maxGrayRamp</code> control the maximum number of
-colors that ghostscript allocates ahead of time for the dither cube (ramp).
-Ghostscript never preallocates more than half the cells in a colormap.
-<code>maxDynamicColors</code> controls the maximum
-number of colors that Ghostscript will allocate dynamically in the
-colormap.</li>
-</ul>
-
-<h4><a name="X_server_bugs"></a>Working around bugs in X servers</h4>
-
-<p>
-The "<code>use</code>..." resources exist primarily to work around bugs
- in X servers.</p>
-
-<ul>
-<li> Old versions of DEC's X server (DECwindows) have bugs that
- require setting <code>useXPutImage</code> or
- <code>useXSetTile</code> to
- <code>false</code>.</li>
-
-<li> Some servers do not implement backing pixmaps properly, or do not
- have enough memory for them. If you get strange behavior or "out
- of memory" messages, try setting
- <code>useBackingPixmap</code> to
- <code>false</code>.</li>
-
-<li> Some servers do not implement tiling properly. This appears
- as broad bands of color where dither patterns should appear. If
- this happens, try setting
- <code>useXSetTile</code> to
- <code>false</code>.</li>
-
-<li> Some servers do not implement bitmap or pixmap displaying properly.
- This may appear as white or black rectangles where characters
- should appear; or characters may appear in "inverse video" (for
- instance, white on a black rectangle rather than black on white).
- If this happens, try setting
- <code>useXPutImage</code> to
- <code>false</code>.</li>
-</ul>
-
-<h4><a name="X_device_parameters"></a>X device parameters</h4>
-
-<p>
-In addition to the device parameters recognized by <a
-href="Language.htm#Device_parameters">all devices</a>, Ghostscript's X
-driver provides parameters to adjust its performance. Users will rarely
-need to modify these. Note that these are parameters to be set with the
-<code>-d</code> switch in the command line (e.g.,
-<code>-dMaxBitmap=10000000</code>), not resources to be defined in the
-<code>~/.Xdefaults</code> file.</p>
-
-<dl>
- <dt><code>AlwaysUpdate &lt;boolean&gt;</code></dt>
-<dd>If <code>true</code>, the driver updates the screen after each
-primitive drawing operation; if <code>false</code> (the default), the
- driver uses an intelligent buffered updating algorithm.</dd>
-</dl>
-
-<dl>
- <dt><code>MaxBitmap &lt;integer&gt;</code></dt>
-<dd>If the amount of memory required to hold the pixmap for the window is no
-more than the value of <code>MaxBitmap</code>, the driver will draw to a
-pixmap in Ghostscript's address space (called a "client-side pixmap") and
-will copy it to the screen from time to time; if the amount of memory
-required for the pixmap exceeds the value of <code>MaxBitmap</code>, the
-driver will draw to a server pixmap. Using a client-side pixmap usually
-provides better performance -- for bitmap images, possibly much better
-performance -- but since it may require quite a lot of RAM (e.g., about 2.2
-Mb for a 24-bit 1024x768 window), the default value of
- <code>MaxBitmap</code> is 0.</dd>
-</dl>
-
-<dl>
- <dt><code>MaxTempPixmap, MaxTempImage &lt;integer&gt;</code></dt>
-<dd>These control various aspects of the driver's buffering behavior. For
- details, please consult the source file <code>gdevx.h</code>.</dd>
-</dl>
-
-<h3><a name="SCO_Unix"></a>SCO Unix</h3>
-
-<p>
-Because of bugs in the SCO Unix kernel, Ghostscript will not work if you
-select direct screen output and also allow it to write messages on the
-console. If you are using direct screen output, redirect Ghostscript's
- terminal output to a file.</p>
-
-<hr>
-
-<h2><a name="Options"></a>Command line options</h2>
-
-<p>
-Unless otherwise noted, these switches can be used on all platforms.</p>
-
-<h3><a name="General_switches"></a>General switches</h3>
-
-<h4><a name="Input_control"></a>Input control</h4>
-
-<dl>
- <dt><code>@</code><em>filename</em></dt>
-<dd>Causes Ghostscript to read <em>filename</em> and treat its contents the
-same as the command line. (This was intended primarily for getting around
-DOS's 128-character limit on the length of a command line.) Switches or
-file names in the file may be separated by any amount of white space
- (space, tab, line break); there is no limit on the size of the file.</dd>
-</dl>
-
-<dl>
- <dt><code>--</code> <em>filename arg1 ...</em>
-<br><code>-+</code> <em>filename arg1 ...</em></dt>
-<dd>Takes the next argument as a file name as usual, but takes all
-remaining arguments (even if they have the syntactic form of switches) and
-defines the name <code>ARGUMENTS</code> in userdict (not systemdict) as
-an array of those strings, <em>before</em> running the file. When
- Ghostscript finishes executing the file, it exits back to the shell.</dd>
-</dl>
-
-<dl>
- <dt><code>-@</code> <em>filename arg1 ...</em></dt>
-<dd>Does the same thing as <code>--</code> and <code>-+</code>, but
- expands <code>@</code><em>filename</em> arguments.</dd>
-</dl>
-
-<dl>
-<dt><code>-</code>
- <br><code>-_</code></dt>
-<dd>These are not really switches: they tell Ghostscript to read from
-standard input, which is coming from a file or a pipe,
-with or without buffering.
-On some systems, Ghostscript may read the input one character at a time,
-which is useful for programs such as ghostview that generate input for
-Ghostscript dynamically and watch for some response, but can slow processing.
-If performance is significantly slower than with a named file,
-try '<code>-_</code>' which always reads the input in blocks.
- However, '<code>-</code>' is equivalent on most systems.</dd>
-</dl>
-
-<dl>
-<dt><code>-c</code> <em>token ...</em>
- <br><code>-c</code> <em>string ...</em></dt>
-<dd>Interprets arguments as PostScript code up to the next argument that
-begins with "<code>-</code>" followed by a non-digit, or with
-"<code>@</code>". For example, if the file <code>quit.ps</code>
-contains just the word "<code>quit</code>", then
-<code>-c&nbsp;quit</code> on the command line is equivalent to
-<code>quit.ps</code> there. Each argument must be valid PostScript,
-either individual tokens as defined by the <code>token</code> operator,
- or a string containing valid PostScript.
-<p>
-Because Ghostscript must initialize the PostScript environment
-before executing the commands specified by this option it should
-be specified after other setup options. Specifically this option
-'bind's all operations and sets the systemdict to readonly.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-f</code></dt>
-<dd>Interprets following non-switch arguments as file names to be executed
-using the normal <code>run</code> command. Since this is the default
-behavior, <code>-f</code> is useful only for terminating the list of
- tokens for the <code>-c</code> switch.</dd>
-</dl>
-
-<dl>
- <dt><code>-f</code><em>filename</em></dt>
-<dd>Execute the given file, even if its name begins with a
- "<code>-</code>" or "<code>@</code>".</dd>
-</dl>
-
-<h4><a name="File_searching"></a>File searching</h4>
-
-<p>
-Note that by "library files" here we mean all the files identified using
-the search rule under "<a href="#Finding_files">How Ghostscript finds
-files</a>" above: Ghostscript's own initialization files, fonts, and files
- named on the command line.</p>
-
-<dl>
- <dt><a name="I_switch"></a><code>-I</code><em>directories</em>
-<br><code>-I </code><em>directories</em></dt>
-<dd>Adds the designated list of directories at the head of the search path
- for library files.</dd>
-</dl>
-
-<dl>
- <dt><a name="P_switch"></a><code>-P</code></dt>
-<dd>Makes Ghostscript look first in the current directory for library
- files.</dd>
-</dl>
-
-<dl>
- <dt><a name="P-_switch"></a><code>-P-</code></dt>
-<dd>Makes Ghostscript <b><em>not</em></b> look first in the current
-directory for library files (unless, of course, the first explicitly
- supplied directory is "<code>.</code>"). This is now the default.</dd>
-</dl>
-
-<h4><a name="Parameters"></a>Setting parameters</h4>
-
-<dl>
-<dt><code>-D</code><em>name</em>
- <br><code>-d</code><em>name</em></dt>
- <dd>Define a name in systemdict with value=true.</dd>
-</dl>
-
-<dl>
-<dt><code>-D</code><em>name</em><code>=</code><em>token</em>
- <br><code>-d</code><em>name</em><code>=</code><em>token</em></dt>
-<dd>Define a name in systemdict with the given value. The value must be
-a valid PostScript token (as defined by the <code>token</code> operator).
-If the token is a non-literal name, it must be true, false, or null.
-It is recommeded that this is used only for simple values -- use
-<code>-c</code> (above) for complex values such as procedures,
-arrays or dictionaries.
-<br>Note that these values are defined <b>before</b> other names in
-systemdict, so any name that that conflicts with one usually in
-systemdict will be replaced by the normal definition during the
- interpreter initialization.</dd>
-</dl>
-
-<dl>
-<dt><code>-S</code><em>name</em><code>=</code><em>string</em>
- <br><code>-s</code><em>name</em><code>=</code><em>string</em></dt>
-<dd>Define a name in systemdict with a given string as value. This is
-different from <code>-d</code>. For example, <code>-dXYZ=35</code>
- on the command line is equivalent to the program fragment
-
-<blockquote><code>
-/XYZ 35 def
-</code></blockquote>
-
-<p>
-whereas <code>-sXYZ=35</code> is equivalent to</p>
-
-<blockquote><code>
-/XYZ (35) def
-</code></blockquote>
-</dd>
-</dl>
-
-<dl>
-<dt><code>-p</code><em>name</em><code>=</code><em>string</em></dt>
-<dd>Define a name in systemdict with the parsed version of the given string as value. The string takes a parameter definition in (something very close to) postscript format.
-This allows more complex structures to be passed in than is possible with <code>-d</code> or <code>-s</code>. For example:
-
-<blockquote><code>
--pFoo=&quot;&lt;&lt; /Bar[1 2 3]/Baz 0.1 /Whizz (string) /Bang &lt;0123&gt; &gt;&gt;&quot;
-</code></blockquote>
-
-<p>This means that <code>-p</code> can do the job of both <code>-d</code> and <code>-s</code>. For example:</p>
-
-<blockquote><code>
--dDownScaleFactor=3
-</code></blockquote>
-
-<p>can be equivalently performed by</p>
-
-<blockquote><code>
--pDownScaleFactor=3
-</code></blockquote>
-
-and
-
-<blockquote><code>
--sPAPERSIZE=letter
-</code></blockquote>
-
-<p>can be equivalently performed by</p>
-
-<blockquote><code>
--pPAPERSIZE=&quot;(letter)&quot;
-</code></blockquote>
-
-<p>Note, that there are some 'special' values that should be set using <code>-s</code>, not <code>-p</code>, such as <code>DEVICE</code> and <code>DefaultGrayProfile</code>. Broadly, only use <code>-p</code> if you cannot set what you want using <code>-s</code> or <code>-d</code>.</p>
-
-<p>Also, internally, after setting an parameter with <code>-p</code> we perform an <code>initgraphics</code> operation. This is required to allow changes in parameters such as <code>HWResolution</code> to take effect. This means that attempting to use <code>-p</code> other than at the start of a page is liable to give unexpected results.</p>
-</dl>
-
-<dl>
- <dt><code>-u</code><em>name</em></dt>
- <dd>Un-define a name, cancelling <code>-d</code> or <code>-s</code>.
-
-<p>
-Note that the initialization file <code>gs_init.ps</code> makes
-<code>systemdict</code> read-only, so the values of names defined with
-<code>-D</code>, <code>-d</code>, <code>-S</code>, and
-<code>-s</code> cannot be changed -- although, of course, they can be
-superseded by definitions in <code>userdict</code> or other dictionaries.
-However, device parameters set this way (<code>PageSize</code>,
-<code>Margins</code>, etc.) are <em>not</em> read-only, and <em>can</em>
-be changed by code in PostScript files.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-g</code><em>number1</em><code>x</code><em>number2</em></dt>
-<dd>Equivalent to <code>-dDEVICEWIDTH=</code><em>number1</em> and
-<code>-dDEVICEHEIGHT=</code><em>number2</em>, specifying the device
-width and height in pixels for the benefit of devices such as X11 windows
-and VESA displays that require (or allow) you to specify width and height.
-Note that this causes documents of other sizes to be clipped, not scaled:
- see <code>-dFIXEDMEDIA</code> below.
-</dd>
-</dl>
-
-<dl>
-<dt><a name="Resolution_switch"></a><code>-r</code><em>number</em> (same
-as <code>-r</code><em>number</em><code>x</code><em>number</em>)
- <br><code>-r</code><em>number1</em><code>x</code><em>number2</em></dt>
-<dd>Equivalent to <code>-dDEVICEXRESOLUTION=</code><em>number1</em> and
-<code>-dDEVICEYRESOLUTION=</code><em>number2</em>, specifying the device
-horizontal and vertical resolution in pixels per inch for the benefit of
- devices such as printers that support multiple X and Y resolutions.</dd>
-</dl>
-
-<h4><a name="Quiet"></a>Suppress messages</h4>
-
-<dl>
- <dt><a name="Quiet"></a><code>-q</code></dt>
-<dd>Quiet startup: suppress normal startup messages, and also do the
- equivalent of <a href="#dQUIET"><code>-dQUIET</code></a>.</dd>
-</dl>
-
-<h3><a name="Parameter_switches"></a>Parameter switches (<code>-d</code> and <code>-s</code>)</h3>
-
-<p>
-As noted above, <code>-d</code> and <code>-s</code> define initial
-values for PostScript names. Some of these names are parameters that
-control the interpreter or the graphics engine. You can also use
-<code>-d</code> or <code>-s</code> to define a value for any device
-parameter of the initial device (the one defined with
-<code>-sDEVICE=</code>, or the default device if this switch is not
-used). For example, since the <code>ppmraw</code> device has a numeric
-<code>GrayValues</code> parameter that controls the number of bits per
-component, <code>-sDEVICE=ppmraw -dGrayValues=16</code> will make this
-the default device and set the number of bits per component to 4 (log2(16)).</p>
-
-<h4><a name="Rendering_parameters"></a>Rendering parameters</h4>
-
-<dl>
-<dt><code>-dCOLORSCREEN
-<br>-dCOLORSCREEN=0
- <br>-dCOLORSCREEN=false</code></dt>
-<dd>On high-resolution devices (at least 150 dpi resolution, or
-<code>-dDITHERPPI</code> specified), <code>-dCOLORSCREEN</code>
-forces the use of separate halftone screens with different angles for CMYK
-or RGB if halftones are needed (this produces the best-quality output);
-<code>-dCOLORSCREEN=0</code> uses separate screens with the same
-frequency and angle; <code>-dCOLORSCREEN=false</code> forces the use of
-a single binary screen. The default if <code>COLORSCREEN</code> is not
-specified is to use separate screens with different angles if the device
-has fewer than 5 bits per color, and a single binary screen (which is never
- actually used under normal circumstances) on all other devices.</dd>
-</dl>
-
-<dl>
- <dt><code>-dDITHERPPI=</code><em>lpi</em></dt>
-<dd>Forces all devices to be considered high-resolution, and forces use of
-a halftone screen or screens with <em>lpi</em> lines per inch, disregarding
-the actual device resolution. Reasonable values for <em>lpi</em> are
-<b><em>N</em></b>/5 to <b><em>N</em></b>/20, where <b><em>N</em></b> is the
- resolution in dots per inch.</dd>
-</dl>
-
-<dl>
- <dt><code>-dInterpolateControl=</code><em>control_value</em></dt>
- <dd>This allows control of the image interpolation.
-
-<p>
-By default <code>InterpolateControl</code> is 1 and the image rendering
-for images that have <code>/Interpolate true</code> are interpolated to
-the full device resolution. Otherwise, images are rendered using the nearest
-neighbour scaling (Bresenham's line algorithm through the image, plotting
-the closest texture coord at each pixel). When downscaling this results
-in some source pixels not appearing at all in the destination. When upscaling,
-each source pixels will cover at least one destination pixel.</p>
-
-<p>
-When the <em>control_value</em> is 0 no interpolation is performed, whether
-or not the file has images with <code>/Interpolate true</code>.</p>
-
-<p>
-When the <em>control_value</em> is greater than 1 interpolation is performed for
-images with <code>/Interpolate true</code> as long as the image scaling
-factor on either axis is larger than the <em>control_value</em>. Also, the
-interpolation only produces images that have <em>(device resolution / control_value)</em>
-maximum resolution rather than full device resolution. This allows for a performance
-vs. quality tradeoff since the number of pixels produced by the interpolation
-will be a fraction of the interpolated pixels at full device resolution. Every source
-pixel will contribute partially to the destination pixels.</p>
-
-<p>
-When the <code>InterpolateControl</code> <em>control_value</em> is less than 0
-interpolation is <b>forced</b> as if all images have <code>/Interpolate true</code>,
-and the interpolation is controlled by the absolute value of the <em>control_value</em>
-as described above. Thus, <code>-dInterpolateControl=-1</code> forces all images
-to be interpolated at full device resolution.</p>
-
-<p>
-Computationally, image interpolation is much more demanding than without
-interpolation (lots of floating point muliplies and adds for every output
-pixel vs simple integer additions, subtractions, and shifts).</p>
-
-<p>
-In all but special cases image interpolation uses a Mitchell filter function
-to scale the contributions for each output pixel. When upscaling, every output
-pixel ends up being the weighted sum of 16 input pixels, When downscaling more
-source pixels will contribute to the interpolated pixels. Every source pixel has
-some effect on the output pixels.</p>
-</dd>
-</dl>
-<dl>
-<dt><code>-dDOINTERPOLATE</code></dt>
-<dd>This option still works, but is deprecated, and is the equivalent of
- <code>-dInterpolateControl=-1</code>.</dd>
-</dl>
-<dl>
-<dt><code>-dNOINTERPOLATE</code></dt>
-<dd>
-This option still works, but is deprecated and is
-the equivalent of <code>-dInterpolateControl=0</code>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dTextAlphaBits=</code><em>n</em></dt>
- <dt><code>-dGraphicsAlphaBits=</code><em>n</em></dt>
-<dd>These options control the use of subsample antialiasing. Their use is highly recommended for producing high quality rasterizations. The subsampling box size <em>n</em> should be 4 for optimum output, but smaller values can be used for faster rendering. Antialiasing is enabled separately for text and graphics content.
- Allowed values are 1, 2 or 4.
-<p>
-Note that because of the way antialiasing blends the edges of shapes into the background when
-they are drawn some files that rely on joining separate filled polygons together to cover
-an area may not render as expected with <code>GraphicsAlphaBits</code> at 2 or 4. If you encounter
-strange lines within solid areas, try rendering that file again with
-<code>-dGraphicsAlphaBits=1</code>.</p>
-<p>Further note; because this feature relies upon rendering the input it is incompatible, and will generate
-an error on attempted use, with any of the vector output devices.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dAlignToPixels=</code><em>n</em></dt>
-<dd>Chooses glyph alignent to integral pixel boundaries (if set to the value 1)
-or to subpixels (value 0). Subpixels are a smaller raster grid
-which is used internally for text antialiasing.
-The number of subpixels in a pixel usually is <code>2^TextAlphaBits</code>,
-but this may be automatically reduced for big characters to save space
- in character cache.
-
-<p>
-The parameter has no effect if <code>-dTextAlphaBits=1</code>.
-Default value is 0.</p>
-
-<p>
-Setting <code>-dAlignToPixels=0</code> can improve rendering
-of poorly hinted fonts, but may impair the appearance of well-hinted fonts.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dGridFitTT=</code><em>n</em></dt>
-<dd> This specifies the initial value for the implementation specific
-user parameter <a href="Language.htm#GridFitTT">GridFitTT</a>.
-It controls grid fitting of True Type fonts
-(Sometimes referred to as "hinting", but strictly speaking
-the latter is a feature of Type 1 fonts).
-Setting this to 2 enables automatic grid fitting for True Type glyphs.
-The value 0 disables grid fitting. The default value is 2.
-For more information see the description of the user parameter
- <a href="Language.htm#GridFitTT">GridFitTT</a>.</dd>
-
-</dl>
-
-<dl>
- <dt><code>-dUseCIEColor</code></dt>
-<dd>Set UseCIEColor in the page device dictionary, remapping device-dependent
-color values through a Postscript defined CIE color space. Document DeviceGray,
-DeviceRGB and DeviceCMYK source colors will be substituted respectively by Postscript
-CIEA, CIEABC and CIEDEFG color spaces. See the document
-<a href="GS9_Color_Management.pdf">GS9 Color Management</a> for details on how
-this option will interact with Ghostscript's ICC-based color workflow. If accurate colors
- are desired, it is recommended that an ICC workflow be used.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOCIE</code></dt>
-<dd>Substitutes <code>DeviceGray</code> for CIEBasedA, <code>DeviceRGB</code> for CIEBasedABC and CIEBasedDEF spaces and <code>DeviceCMYK</code>
-fpr CIEBasedDEFG color spaces. Useful only on
- very slow systems where color accuracy is less important.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOSUBSTDEVICECOLORS</code></dt>
-<dd>This switch prevents the substitution of the <code>ColorSpace</code>
-resources (<code>DefaultGray</code>, <code>DefaultRGB</code>, and
-<code>DefaultCMYK</code>) for the <code>DeviceGray</code>,
-<code>DeviceRGB</code>, and <code>DeviceCMYK</code> color spaces.
-This switch is primarily useful for PDF creation using the <code>pdfwrite</code>
-device when retaining the color spaces from the original document is
- important.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOPSICC</code></dt>
-<dd>Disables the automatic loading and use of an input color space that is
-contained in a PostScript file as DSC comments starting with the %%BeginICCProfile:
-comment. ICC profiles are sometimes embedded by applications to convey the exact
-input color space allowing better color fidelity. Since the embedded ICC profiles
-often use multidimensional RenderTables, color conversion may be slower than using
-the Default color conversion invoked when the <code>-dUseCIEColor</code>
-option is specified, therefore the <code>-dNOPSICC</code> option may result
- in improved performance at slightly reduced color fidelity.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOINTERPOLATE</code></dt>
-<dd>Turns off image interpolation, improving performance on interpolated
-images at the expense of image quality. <code>-dNOINTERPOLATE</code>
- overrides <code>-dDOINTERPOLATE</code>.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOTRANSPARENCY</code></dt>
-<dd>Turns off PDF 1.4 transparency, resulting in faster (but possibly
-incorrect) rendering of pages containing PDF 1.4 transparency and
- blending.</dd>
-</dl>
-
-<a name="ALLOWPSTRANSPARENCY"></a>
-<dl>
- <dt><code>-dALLOWPSTRANSPARENCY</code></dt>
-<dd>
-Enables the use of the Ghostscript custom transparency operators
-(<a href="Language.htm#Transparency">Transparency</a>) from
-Postscript input. Normally, these operators are not accessible from Postscript
-jobs, being primarily intended to be called by the PDF interpreter. Using
-<code>-dALLOWPSTRANSPARENCY</code> leaves them available. It is important that
-these operators are used correctly, especially the order in which they are called,
-otherwise unintended, even undefined behavior may result.
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dNO_TN5044</code></dt>
-<dd>Turns off the TN 5044 psuedo operators. These psuedo operators are not a part
-of the official Postscript specification. However they are defined in <i>Technical
-Note #5044 Color Separation Conventions for PostScript Language Programs</i>.
-These psuedo operators are required for some files from QuarkXPress. However some
-files from Corel 9 and Illustrator 88 do not operate properly if these operators
- are present.</dd>
-</dl>
-
-<dl>
- <dt><code>-dDOPS</code></dt>
-<dd>Enables processing of Subtype /PS streams in PDF files and the DoPS operator.
-DoPS has in fact been deprecated for some time. Also the "PS" operator that was
-removed from the 1.3 2nd edition specification is also disabled by default, and
-enabled by <code>-dDOPS</code>. Use of this option is <b>NOT</b>
-recommended in security-conscious applications, as it increases the
-scope for malicious code. <code>-dDOPS</code> has no effect on
-processing of PostScript source files. Note: in releases 7.30 and
- earlier, processing of DoPS was always enabled.</dd>
-</dl>
-
-<a name="BlackText"></a>
-<dl>
- <dt><code>-dBlackText</code></dt>
-<dd>Forces text to be drawn with black. This occurs for text fill and
-text stroke operations. PDF output created with this setting will be
-updated to be drawn with gray values of 0. Type 3 fonts, which are
-sometimes used for graphics, are not affected by this parameter. </dd>
-</dl>
-
-<h4><a name="Page_parameters"></a>Page parameters</h4>
-
-<dl>
- <dt><code>-dFirstPage=</code><em>pagenumber</em></dt>
-<dd>Begin on the designated page of the document.
- Pages of all documents in PDF collections are numbered sequentionally.</dd>
-</dl>
-
-<dl>
- <dt><code>-dLastPage=</code><em>pagenumber</em></dt>
-<dd>Stop after the designated page of the document.
- Pages of all documents in PDF collections are numbered sequentionally.</dd>
-</dl>
-
-<dl>
-<dt><code>-sPageList=</code><em>pagenumber</em></dt>
-<dd>There are three possible values for this; even, odd or a list of pages to be processed.
-A list can include single pages or ranges of pages.
-Ranges of pages use the minus sign '-', individual pages and ranges of pages are separated
- by commas ','. A trailing minus '-' means process all remaining pages. For example;
-<p><blockquote><pre>
--sPageList=1,3,5 indicates that pages 1, 3 and 5 should be processed.
--sPageList=5-10 indicates that pages 5, 6, 7, 8, 9 and 10 should be processed.
--sPageList=1, 5-10, 12- indicates that pages 1, 5, 6, 7, 8, 9, 10 and 12 onwards should be processed.
-</pre></blockquote>
-</p>
-
-<p>The PDF interpreter and the other language interpreters handle these in slightly different ways. Because
-PDF files enable random access to pages in the document the PDF inerpreter only interprets and renders
-the required pages. PCL andPostScript cannot be handled in ths way, and so all the pages must be interpreted.
-However only the requested pages are rendered, which can still lead to savings in time. Be aware that
-using the '%d' syntax for OutputFile does not reflect the page number in the original document. If you
-chose (for example) to process even pages by using <code>-sPageList=even</code>, then the output of
-<code>-sOutputFile=out%d.png</code> would still be
-out0.png, out1.png, out2.png etc......
-</p>
-<p>
-Because the PostScript and PCL interpreters cannot determine when a document terminates, sending multple
-files as input on the command line does not reset the PageList between each document, each page in the second and
-subsequent documents is treated as following on directly from the last page in the first document. The PDF
-interpreter, however, does not work this way. Since it knows about individual PDF files the PageList
-is applied to each PDF file separately. So if you were to set <code>-sPageList=1,2</code> and
- then send two PDF files, the result would be pages 1 and 2 from the first file, and then pages 1 and 2 from the second
- file. The PostScript interpreter, by contrast, would only render pages 1 and 2 from the first file. This means you must
- exercise caution when using this switch, and probably should not use it at all when processing a mixture of PostScript
- and PDF files on the same command line.
-</p>
-</dd>
-</dl>
-
-<dl>
- <dt><a name="FIXEDMEDIA"></a><code>-dFIXEDMEDIA</code></dt>
-<dd>Causes the media size to be fixed after initialization, forcing pages
-of other sizes or orientations to be clipped. This may be useful when
-printing documents on a printer that can handle their requested paper size
-but whose default is some other size. Note that <code>-g</code>
-automatically sets <code>-dFIXEDMEDIA</code>, but
- <code>-sPAPERSIZE=</code> does not.</dd>
-</dl>
-
-<dl>
- <dt><code>-dFIXEDRESOLUTION</code></dt>
-<dd>Causes the media resolution to be fixed similarly. <code>-r</code>
- automatically sets <code>-dFIXEDRESOLUTION</code>.</dd>
-</dl>
-
-<dl>
- <dt><code>-dPSFitPage</code></dt>
-<dd>The page size from the PostScript file <code>setpagedevice</code> operator,
-or one of the older <code>statusdict</code> page size operators (such as
-<code>letter</code> or <code>a4</code>) will be rotated, scaled and centered on the
-"best fit" page size from those availiable in the InputAttributes list.
-The <code>-dPSFitPage</code> is most easily used to fit pages when used with the
- <code>-dFIXEDMEDIA</code> option.
-
-<p>
-This option is also set by the <code>-dFitPage</code> option.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dORIENT1=true
-<br>-dORIENT1=false</code></dt>
-<dd>Defines the meaning of the 0 and 1 orientation values for the
-setpage[params] compatibility operators. The default value of
-<code>ORIENT1</code> is true (set in <code>gs_init.ps</code>), which
-is the correct value for most files that use setpage[params] at all,
-namely, files produced by badly designed applications that "know" that the
-output will be printed on certain roll-media printers: these applications
-use 0 to mean landscape and 1 to mean portrait.
-<code>-dORIENT1=false</code> declares that 0 means portrait and 1 means
-landscape, which is the convention used by a smaller number of files
- produced by properly written applications.</dd>
-</dl>
-
-<dl>
-<dt><code>-dDEVICEWIDTHPOINTS=</code><em>w</em>
- <br><code>-dDEVICEHEIGHTPOINTS=</code><em>h</em></dt>
-<dd>Sets the initial page width to <em>w</em> or initial page height to
- <em>h</em> respectively, specified in 1/72" units.</dd>
-</dl>
-
-<dl>
- <dt><code>-sDEFAULTPAPERSIZE=</code><em>a4</em></dt>
-<dd>
-This value will be used to replace the device default papersize ONLY
-if the default papersize for the device is 'letter' or 'a4' serving
-to insulate users of A4 or 8.5x11 from particular device defaults
-(the collection of contributed drivers in Ghostscript vary as to
-the default size).
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dFitPage</code></dt>
-<dd>This is a "convenience" operator that sets the various options to perform
- page fitting for specific file types.
-<p>
-This option sets the <code>-dEPSFitPage</code>, <code>-dPDFFitPage</code>, and
-the <code>-dFitPage</code> options.</p>
-</dd>
-</dl>
-
-<dl>
-<dt><a name="NupControl"></a></dt>
- <dt><code>-sNupControl=</code><em>Nup_option_string</em></dt>
-<dd>This option specifies the N-up nesting to be performed. The pages are scaled
-and arranged on the current PageSize "master" page according the the option.
-<p>
-The only option strings are as follows:
- <ul>
- <li>
- <dl><dt></dt><dd><code>-sNupControl=</code><em>number1</em><code>x</code><em>number2</em></dd></dl>
- will fit <em>number1</em> nested pages across the master page, and <em>number2</em>
- down the master page, from the upper left, then to the right to fill the row, moving down
- to the leftmost place on the next row until the nest is complete.
- <p>
- A partially filled nest will be output when the <code>-sNupControl=</code> string is changed,
- when Ghostscript exits, or when the page size changes.
- <p>
- Pages are scaled to fit the requested number horizontally and vertically, maintaining the
- aspect ratio. If the scaling selected for fitting the nested pages leaves space horizontally
- on the master page, the blank area will be added to the left and right of the <b>entire</b>
- row of nested pages. If the fit results in vertical space, the blank area will be added
- above and below <b>all</b> of the rows.
- </li>
- <li>
- <dl><dt></dt><dd><code>-sNupControl=</code></dd></dl>
- An empty string will turn off nesting. If there are any nested pages on the master page,
- the partially filled master page will be output.
- </li>
- </ul>
-<p>Printer devices typically reallocate their memory whenever the transparency use
-of a page changes (from one page having transparency, to the next page not having
-transparency, or vice versa). This would cause problems with Nup, possibly leading
-to lost or corrupt pages in the output. To avoid this, the Nup device changes
-the parameters of the page to always set the PageUsesTransparency flag. While this
-should be entirely transparent for the user and not cause extra transparency blending
-operations during the standard rendering processes for most devices, it may cause
-devices to use the clist rather than PageMode.
-</dd>
-</dl>
-
-<h4><a name="Font_related_parameters"></a>Font-related parameters</h4>
-
-<dl>
- <dt><code>-dLOCALFONTS</code></dt>
-<dd>Causes Type 1 fonts to be loaded into the current VM -- normally local
-VM -- instead of always being loaded into global VM. Useful only for
- compatibility with Adobe printers for loading some obsolete fonts.</dd>
-</dl>
-
-<dl>
- <dt><a name="FONTMAP_switch"></a><code>-dNOFONTMAP</code></dt>
-<dd>Suppresses the normal loading of the Fontmap file. This may be useful
- in environments without a file system.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOFONTPATH</code></dt>
-<dd>Suppresses consultation of <code>GS_FONTPATH</code>. This may be
- useful for debugging.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOPLATFONTS</code></dt>
-<dd>Disables the use of fonts supplied by the underlying platform (X
-Windows or Microsoft Windows). This may be needed if the platform fonts
- look undesirably different from the scalable fonts.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNONATIVEFONTMAP</code></dt>
-<dd>Disables the use of font map and corresponding fonts supplied by the
-underlying platform. This may be needed to ensure consistent rendering on
- the platforms with different fonts, for instance, during regression testing.</dd>
-</dl>
-
-<dl>
-<dt><code>-sFONTMAP=</code><em>filename1</em><code>;</code><em>filename2</em><code>;</code><em>...</em></dt>
-<dd>Specifies alternate name or names for the Fontmap file. Note that the
-names are separated by "<code>:</code>" on Unix systems, by
-"<code>;</code>" on MS Windows systems, and by
-"<code>,</code>" on VMS systems, just as for search paths.</dd>
-</dl>
-
-<dl>
- <dt><code>-sFONTPATH=</code><em>dir1</em><code>;</code><em>dir2</em><code>;</code><em>...</em></dt>
-<dd>Specifies a list of directories that will be scanned when looking for
-fonts not found on the search path, overriding the environment variable
- <code>GS_FONTPATH</code>.
-<p>By implication, any paths specified by <code>FONTPATH</code> or <code>GS_FONTPATH</code> are automatically
-added to the <code>permit file read</code> list (see "<a href="#Safer">-dSAFER</a>").
-</dd>
-</dl>
-
-<dl>
- <dt><code>-sSUBSTFONT=</code><em>fontname</em></dt>
-<dd>Causes the given font to be substituted for all unknown fonts, instead
-of using the normal intelligent substitution algorithm. Also, in this
-case, the font returned by <code>findfont</code> is the actual font
-named <em>fontname</em>, not a copy of the font with its
-<code>FontName</code> changed to the requested one.
-THIS OPTION SHOULD NOT BE USED WITH HIGH LEVEL (VECTOR) DEVICES, such as
-<code>pdfwrite</code>, because it prevents such devices from
-providing the original font names in the output document. The
-font specified (<em>fontname</em>) will be embedded instead,
-limiting all future users of the document to the same approximate
- rendering.</dd>
-</dl>
-
-<h4><a name="Resource_related_parameters"></a>Resource-related parameters</h4>
-
-<dl>
- <dt><a name="GenericResourceDir"></a><code>-sGenericResourceDir=path</code></dt>
-<dd>Specifies a path to resource files.
- The value is platform dependent. It must end with a directory separator.
-<p>
-<b><font size="+1">
-A note for Windows users, Artifex recommends the use of the
-forward slash delimiter due to the special interpretation of \" by
-the Microsoft C startup code. See
-<a href="http://msdn.microsoft.com/en-us/library/a1y7w461.aspx">Parsing C Command-Line Arguments</a>
-for more information.
- </font></b></p>
-<p>
-Adobe specifies <code>GenericResourceDir</code> to be an absolute path
-to a single resource directory. Ghostscript instead maintains
-multiple resource directories and uses an extended method for finding
-resources, which is explained in
-<a href="#PS_resources">"Finding PostScript Level 2 resources"</a>.</p>
-<p>
-Due to the extended search method, Ghostscript uses <code>GenericResourceDir</code>
-only as a default directory for resources being not installed.
-Therefore <code>GenericResourceDir</code> may be considered as a place
-where new resources to be installed. The default implementation of the function
-<code>ResourceFileName</code> uses <code>GenericResourceDir</code> when
-(1) it is an absolute path, or (2) the resource file is absent.
-The extended search method does not call <code>ResourceFileName</code> .</p>
-<p>
-Default value is <code>(./Resource/)</code> for Unix, and an equivalent one on other
-platforms.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><a name="FontResourceDir"></a><code>-sFontResourceDir=path</code></dt>
-<dd>Specifies a path where font files are installed.
- It's meaning is similar to <code>GenericResourceDir</code>.
-
-<p>
-Default value is <code>(./Font/)</code> for Unix, and an equivalent one on other
-platforms.</p>
-</dd>
-</dl>
-
-
-
-<h4><a name="Interaction_related_parameters"></a>Interaction-related parameters</h4>
-
-<dl>
- <dt><code>-dBATCH</code></dt>
-<dd>Causes Ghostscript to exit after processing all files named on the
-command line, rather than going into an interactive loop reading PostScript
- commands. Equivalent to putting -c quit at the end of the command line.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOPAGEPROMPT</code></dt>
-<dd>Disables only the prompt, but not the pause, at the end of each page.
-This may be useful on PC displays that get confused if a program attempts
- to write text to the console while the display is in a graphics mode.</dd>
-</dl>
-
-<dl>
- <dt><a name="NoPause"></a><code>-dNOPAUSE</code></dt>
-<dd>Disables the prompt and pause at the end of each page. Normally one
-should use this (along with <code>-dBATCH</code>) when producing output
-on a printer or to a file; it also may be desirable for applications where
- another program is "driving" Ghostscript.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOPROMPT</code></dt>
-<dd>Disables the prompt printed by Ghostscript when it expects interactive
-input, as well as the end-of-page prompt (<code>-dNOPAGEPROMPT</code>).
-This allows piping input
-directly into Ghostscript, as long as the data doesn't refer to
- <code>currentfile</code>.</dd>
-</dl>
-
-<dl>
- <dt><a name="dQUIET"></a><code>-dQUIET</code></dt>
-<dd>Suppresses routine information comments on standard output. This is
- currently necessary when redirecting device output to standard output.</dd>
-</dl>
-
-<dl>
- <dt><code>-dSHORTERRORS</code></dt>
- <dd>Makes certain error and information messages more Adobe-compatible.</dd>
-</dl>
-
-<dl>
- <dt><code>-sstdout=</code><em>filename</em></dt>
-<dd>Redirect PostScript <code>%stdout</code> to a file or
-<code>stderr</code>, to avoid it being mixed with device stdout.
-To redirect stdout to stderr use <code>-sstdout=%stderr</code>.
-To cancel redirection of stdout use <code>-sstdout=%stdout</code>
- or <code>-sstdout=-</code>.
-<p>
-Note that this redirects PostScript output to %stdout but <b>does not</b>
-change the destination FILE of device output as with <code>-sOutputFile=-</code>
-or even <code>-sOutputFile=%stdout</code> since devices write directly using
-the stdout FILE * pointer with C function calls such as fwrite or fputs.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dTTYPAUSE</code></dt>
-<dd>
-Causes Ghostscript to read a character from <code>/dev/tty</code>,
-rather than standard input, at the end of each page. This may be useful if
-input is coming from a pipe. Note that <code>-dTTYPAUSE</code>
-overrides <code>-dNOPAUSE</code>.
-</dl>
-
-<h4><a name="Output_selection_parameters"></a>Device and output selection parameters</h4>
-
-<dl>
- <dt><code>-dNODISPLAY</code></dt>
-<dd>Initializes Ghostscript with a null device (a device that discards the
-output image) rather than the default device or the device selected with
-<code>-sDEVICE=</code>. This is usually useful only when running
-PostScript code whose purpose is to compute something rather than to
- produce an output image.</dd>
-</dl>
-
-<dl>
- <dt><a name="DEVICE_switch"></a><code>-sDEVICE=</code><em>device</em></dt>
-<dd>Selects an alternate <a href="#Output_device">initial output
- device</a>.</dd>
-</dl>
-
-<dl>
- <dt><code>-sOutputFile=</code><em>filename</em></dt>
-<dd>Selects an alternate output file (or pipe) for the initial output
- device, as described above.</dd>
-</dl>
-
-<dl>
- <dt><code>-d.IgnoreNumCopies=true</code></dt>
-<dd>Some devices implement support for "printing" multiple copies of the
-input document and some do not, usually based on whether it makes sense
-for a particular output format. This switch instructs all devices to
-ignore a request to print multiple copies, giving more consistent
- behaviour.</dd>
-</dl>
-
-<h4><a name="Deferred_Page_Rendering"></a>Deferred Page Rendering</h4>
-<dl>
- <dt></dt>
-<dd>Raster printers and image formats that can use the "command list" (clist)
-to store a representation of the page prior to rendering can use the
-<code>--saved-pages=</code><em>string</em> on the command line for
- deferred rendering of pages.
-<p>
-Pages that are <em>saved</em> instead of printed are retained until the
-list of saved pages is emptied by the <code>flush</code> command of the
-<code>saved-pages=</code> command string.</p>
-<p>
-Pages can be printed in reverse or normal order, or selected pages,
-including all even or all odd, and multiple collated copies can be produced.
-Since pages are saved until the <code>flush</code> command, pages can be
-printed multiple times, in any order.</p>
-<p>
-Refer to the <a href="SavedPages.htm">SavedPages</a> document for
-details.</p>
-</dd>
-</dl>
-
-<h4><a name="EPS_parameters"></a>EPS parameters</h4>
-
-<dl>
- <dt><code>-dEPSCrop</code></dt>
-<dd>Crop an EPS file to the bounding box.
- This is useful when converting an EPS file to a bitmap.</dd>
-</dl>
-
-<dl>
- <dt><code>-dEPSFitPage</code></dt>
-<dd>Resize an EPS file to fit the page.
- This is useful for shrinking or enlarging an EPS file to fit the paper size when printing.
-<p>
-This option is also set by the <code>-dFitPage</code> option.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOEPS</code></dt>
-<dd>Prevent special processing of EPS files.
-This is useful when EPS files have incorrect Document
- Structuring Convention comments.
-</dd>
-</dl>
-
-<h4><a name="ICC_color_parameters"></a>ICC color parameters</h4>
-
-<dl>
-<dt></dt>
-<dd>
-For details about the ICC controls see the document
-<a href="GS9_Color_Management.pdf">GS9 Color Management</a>.
-</dd>
-</dl>
-
-<dl>
- <dt><code>-sDefaultGrayProfile=</code><em>filename</em></dt>
-<dd>Set the ICC profile that will be associated with
-undefined device gray color spaces. If this is not set,
-the profile file name "default_gray.icc" will be used as
- the default.</dd>
-</dl>
-
-<dl>
- <dt><code>-sDefaultRGBProfile=</code><em>filename</em></dt>
-<dd>Set the ICC profile that will be associated with
-undefined device RGB color spaces. If this is not set,
-the profile file name "default_rgb.icc" will be used as
- the default.</dd>
-</dl>
-
-<dl>
- <dt><code>-sDefaultCMYKProfile=</code><em>filename</em></dt>
-<dd>Set the ICC profile that will be associated with
-undefined device CMYK color spaces. If this is not set,
-the profile file name "default_cmyk.icc" will be used as
- the default.</dd>
-</dl>
-
-<dl>
- <dt><code>-sDeviceNProfile=</code><em>filename</em></dt>
-<dd>Associate a DeviceN color space contained in a PS or PDF
-document with an ICC profile. Note that neither PS nor PDF provide
-in-document ICC profile definitions for DeviceN color spaces.
-With this interface it is possible to provide this definition.
-The colorants tag order in the ICC profile defines the lay-down
-order of the inks associated with the profile. A windows-based
-tool for creating these source profiles is contained in
- ./toolbin/color/icc_creator.</dd>
-</dl>
-
-<dl>
- <dt><code>-sOutputICCProfile=</code><em>filename</em></dt>
-<dd>Set the ICC profile that will be associated with
-the output device. Care should be taken to ensure that the
-number of colorants associated with the device is the same
-as the profile. If this is not set, an appropriate profile
-(i.e. one with the proper number of colorants) will be
-selected from those in the directory specified by ICCProfilesDir (see below).
- Note that if the output device is CMYK + spot colorants, a CMYK
-profile can be used to provide color management for the CMYK colorants only.
-In this case, spot colors will pass through unprocessed assuming the
-device supports those colorants. It is also possible for these devices to
- specify NCLR ICC profiles for output.</dd>
-</dl>
-
-<dl>
- <dt><code>-sICCOutputColors=</code><em>"Cyan, Magenta, Yellow, Black, Orange, Violet"</em></dt>
-<dd>For the psdcmyk and tiffsep separation devices, the device ICC profile can
-be an NCLR profile, which means something that includes non-traditional inks
-like Orange, Violet, etc. In this case, the list of the color names in the
-order that they exist in the profile must be provided with this command line
-option. Note that if a color name that is specified for the profile occurs also within
-the document (e.g. "Orange" above), then these color names will be associated with
-the same separation. Additional names beyond those of the ICC profile component count
-can be included. In this case, those components will be installed into the tiffsep
-or psdcmyk device list of colors, following the ICC profile colors.
-The number of spot colors (those that go beyond the standard CMYK colors)
-allowed by tiffsep or psdcmyk can be set using -dMaxSpots=#. The default
-value for this is currently set to 10 (GS_SOFT_MAX_SPOTS).
-As an example consider the case where we wish to use a 6CLR ICC profile that
-includes Orange and Violet, but
-need the device to include a specialty color component such as
-Varnish, which does not appear in the document and is not handled by the 6CLR ICC
-profile. In addition, we desire
-to allow one more spot color of the document to come through to our device. For
-this case using
- <code>-sICCOutputColors=</code><em>"Cyan, Magenta, Yellow, Black, Orange, Violet, Varnish"</em>
- <code>-dMaxSpots=</code><em>4</em>
- <code>-sOutputICCProfile=</code><em>My_6CLR_Profile.icc</em>
-would provide the desired outcome. Note that it is up to the device or
-through the use of -sNamedProfile (see below) to involve the setting
-of any values in the Varnish channel. However, if an All color value is encountered
-in the document, the Varnish component will have its value
-set as will the Orange and Violet values (Likewise if a spot color named Varnish is
-encountered in the document the Varnish component will be used for the values).
-The All value is typically used
-for placing registration targets on separations.
-Finally, note that if an NCLR ICC profile is specified
-and ICCOutputColors is not used, then a set of default names will be used for
-the extra colorants (non-CMYK) in the profile. These names are given as ICC_COLOR_N for
-the Nth non-CMYK channel.</dd>
-</dl>
-
-<dl>
- <dt><code>-sProofProfile=</code><em>filename</em></dt>
-<dd>
-Enable the specificiation of a proofing profile that will make the
-color management system link multiple profiles together to emulate the
-device defined by the proofing profile. See the document
- <a href="GS9_Color_Management.pdf">GS9 Color Management</a> for details about this option.</dd>
-</dl>
-
-<dl>
- <dt><code>-sDeviceLinkProfile=</code><em>filename</em></dt>
-<dd>Define a device link profile. This profile is used following
-the output device profile. Care should be taken to ensure that the
-output device process color model is the same as the output color
-space for the device link profile. In addition, the color space of
-the OutputICCProfile should match the input color space of the device
-link profile. For example, the following would be a valid specification
--sDEVICE=tiff32nc -sOutputICCProfile=srgb.icc -sDeviceLinkProfile=linkRGBtoCMYK.icc.
-In this case, the output device's color model is CMYK (tiff32nc) and the colors
-are mapped through sRGB and through a devicelink profile that maps sRGB to
-CMYK values. See the document
- <a href="GS9_Color_Management.pdf">GS9 Color Management</a> for details about this option.</dd>
-</dl>
-
-<dl>
- <dt><code>-sNamedProfile=</code><em>filename</em></dt>
-<dd>Define a structure that is to be used by the color management
-module (CMM) to provide color management of named colors. While
-the ICC does define a named color format, this structure can in
-practice be much more general. Many developers wish to use
-their own proprietary-based format for spot color management.
-This command option is for developer use when an implementation
-for named color management is designed for the function
-gsicc_transform_named_color located in gsicccache.c . An example
-implementation is currently contained in the code for the handling of both
-Separation and DeviceN colors. For the general user this command option
- should really not be used.</dd>
-</dl>
-
-<dl>
- <dt><code>-sBlendColorProfile=</code><em>filename</em></dt>
-<dd>With the PDF transparency imaging model, a color space can
-be specified within which the color blending operations are to
-take place. Some files lack this specification, in which case
-the blending occurs in the output device's native color space. This
-dependency of blending color space on the device color model
-can be avoided by using the above command to force a specific
-color space in which to perform the blending. </dd>
-</dl>
-
-<dl>
- <dt><code>-dColorAccuracy=</code><em>0/1/2</em></dt>
-<dd>Set the level of accuracy that should be used. A setting of 0 will result in less accurate
-color rendering compared to a setting of 2. However, the creation of a transformation
-will be faster at a setting of 0 compared to a setting of 2.
- Default setting is 2.</dd>
-</dl>
-
-<dl>
- <dt><code>-dRenderIntent=</code><em>0/1/2/3</em></dt>
-<dd>Set the rendering intent that should be used with the
-profile specified above by -sOutputICCProfile. The
-options 0, 1, 2, and 3 correspond to the ICC intents of Perceptual, Colorimetric,
- Saturation, and Absolute Colorimetric.</dd>
-</dl>
-
-<dl>
- <dt><code>-dBlackPtComp=</code><em>0/1</em></dt>
-<dd>Specify if black point compensation should be used with the
- profile specified above by -sOutputICCProfile.</dd>
-</dl>
-
-<dl>
- <dt><code>-dKPreserve=</code><em>0/1/2</em></dt>
-<dd>Specify if black preservation should be used when mapping
-from CMYK to CMYK. When using littleCMS as the CMM, the code 0
-corresponds to no preservation, 1 corresponds to the PRESERVE_K_ONLY approach
-described in the littleCMS documentation and 2 corresponds to the
-PRESERVE_K_PLANE approach. This is only valid when using littleCMS for
- color management.</dd>
-</dl>
-
-<dl>
- <dt><code>-sVectorICCProfile=</code><em>filename</em></dt>
-<dd>Set the ICC profile that will be associated with
-the output device for vector-based graphics (e.g. Fill,
-Stroke operations).
-Care should be taken to ensure that the
-number of colorants associated with the device is the same
-as the profile. This can be used to obtain more saturated
- colors for graphics.</dd>
-</dl>
-
-<dl>
- <dt><code>-dVectorIntent=</code><em>0/1/2/3</em></dt>
-<dd>Set the rendering intent that should be used with vector-based graphic objects. The
- options are the same as specified for -dRenderIntent.</dd>
-</dl>
-
-<dl>
- <dt><code>-dVectorBlackPt=</code><em>0/1</em></dt>
- <dd>Specify if black point compensation should be used for vector-based graphic objects.</dd>
-</dl>
-
-<dl>
- <dt><code>-dVectorKPreserve=</code><em>0/1/2</em></dt>
-<dd>Specify if black preservation should be used when mapping
-from CMYK to CMYK for vector-based graphic objects. The
- options are the same as specified for -dKPreserve.</dd>
-</dl>
-
-<dl>
- <dt><code>-sImageICCProfile=</code><em>filename</em></dt>
-<dd>Set the ICC profile that will be associated with
-the output device for images.
-Care should be taken to ensure that the
-number of colorants associated with the device is the same
-as the profile. This can be used to obtain perceptually
- pleasing images.</dd>
-</dl>
-
-<dl>
- <dt><code>-dImageIntent=</code><em>0/1/2/3</em></dt>
- <dd>Set the rendering intent that should be used for images.</dd>
-</dl>
-
-<dl>
- <dt><code>-dImageBlackPt=</code><em>0/1</em></dt>
- <dd>Specify if black point compensation should be used with images.</dd>
-</dl>
-
-<dl>
- <dt><code>-dImageKPreserve=</code><em>0/1/2</em></dt>
-<dd>Specify if black preservation should be used when mapping
-from CMYK to CMYK for image objects. The
- options are the same as specified for -dKPreserve.</dd>
-</dl>
-
-<dl>
- <dt><code>-sTextICCProfile=</code><em>filename</em></dt>
-<dd>Set the ICC profile that will be associated with
-the output device for text.
-Care should be taken to ensure that the
-number of colorants associated with the device is the same
- as the profile. This can be used ensure K only text.</dd>
-</dl>
-
-<dl>
- <dt><code>-dTextIntent=</code><em>0/1/2/3</em></dt>
-<dd>Set the rendering intent that should be used text objects. The
- options are the same as specified for -dRenderIntent.</dd>
-</dl>
-
-<dl>
-<dt><code>-dTextBlackPt=</code><em>0/1</em></dt>
- <dd>Specify if black point compensation should be used with text objects.</dd>
-</dl>
-
-<dl>
- <dt><code>-dTextKPreserve=</code><em>0/1/2</em></dt>
-<dd>Specify if black preservation should be used when mapping
-from CMYK to CMYK for text objects. The
- options are the same as specified for -dKPreserve.</dd>
-</dl>
-
-<dl>
- <dt><code>-dOverrideICC</code></dt>
-<dd>Override any ICC profiles contained in the source
-document with the profiles specified by
-sDefaultGrayProfile, sDefaultRGBProfile, sDefaultCMYKProfile.
-Note that if no profiles are specified for the default
-Device color spaces, then
-the system default profiles will be used. For detailed override
-control in the specification of source colors see
- <a href="#SourceObjectICC">SourceObjectICC</a>.</dd>
-</dl>
-
-<dl>
- <dt><a name="SourceObjectICC"></a><code>-sSourceObjectICC=</code><em>filename</em></dt>
-<dd>
-This option provides an extreme level of override control to
-specify the source color spaces and rendering intents to use
-with vector-based graphics, images and text for both RGB and CMYK source
-objects. The specification is made through a file that contains
-on a line a key name to specify the object type (e.g. Image_CMYK)
-followed by an ICC profile file name, a rendering intent
-number (0 for perceptual, 1 for colorimetric, 2 for saturation,
-3 for absolute colorimetric) and information for black point compensation,
-black preservation, and source ICC override. It is also possible to turn
-off color management for certain object types, use device link profiles for
-object types and do custom color replacements. An example file is given in
-./gs/toolbin/color/src_color/objsrc_profiles_example.txt.
-Profiles to demonstrate this method of specification are also
-included in this folder. Note that if objects are colorimetrically
-specified through this mechanism other operations like -dImageIntent,
--dOverrideICC, have no affect. See further details in the document
- <a href="GS9_Color_Management.pdf">GS9 Color Management</a>.</dd>
-</dl>
-
-<dl>
- <dt><code>-dDeviceGrayToK=</code><em>true/false</em></dt>
-<dd>
-By default, Ghostscript will map DeviceGray color spaces to
-pure K when the output device is CMYK based. This may not
-always be desired. In particular, it may be desired to map
-from the gray ICC profile specified by -sDefaultGrayProfile
-to the output device profile. To achieve this, one should
- specify -dDeviceGrayToK=false.</dd>
-</dl>
-
-<dl>
- <dt><code>-dUseFastColor=</code><em>true/false</em></dt>
-<dd>
-This is used to avoid the use of ICC profiles for source colors. This
-includes those that are defined by DeviceGray, DeviceRGB and DeviceCMYK definitions
-as well as ICC-based color spaces in the source document. With
-UseFastColor set to true, the traditional Postscript 255 minus operations
-are used to convert between RGB and CMYK with black generation and undercolor
- removal mappings.</dd>
-</dl>
-
-<dl>
- <dt><code>-dSimulateOverprint=</code><em>true/false</em></dt>
-<dd>
-This option has been replaced by <code><b>-dOverprint=</b></code>
-</dd>
-</dl>
-
-
-<dl>
-
- <dt><a name="Overprint"></a><code>-dOverprint=</code><em>/enable | /disable | /simulate</em></dt>
-<dd>
-This option provides control of overprinting. The default setting is <em><b>/enable</b></em>
-which allows devices such as CMYK that can support overprint to leave planes unchanged
-under control of PostScript and PDF overprint settings.
-<p>
-The <em><b>/disable</b></em> setting ignores all overprint (and overprint mode) from the input.
-<p>
-If <em><b>/simulate</b></em> is set, then pages with overprint (or overprint mode) set for
-CMYK or Separation colors will be internally maintained and output to RGB or Gray
-devices.
-<p>
-Note that not all spot color overprint cases can be accurately simulated with a CMYK
-only device. For example, a case where you have a spot color overprinted with CMYK
-colors will be indistiguishable from a case where you have spot color equivalent
-CMYK colorants overprinted with CMYK colors, even though they may need to show
-significantly different overprint simulations. To obtain a full overprint simulation,
-use the <em><b>/simulate</b></em> setting or the psdcmyk or tiffsep device, where the spot
-colors are kept in their own individual planes.</dd>
-</dl>
-
-<dl>
- <dt><code>-dUsePDFX3Profile=</code><em>int</em></dt>
-<dd>
-This option enables rendering with an output intent defined in
-the PDF source file. If this option is included in the command line,
-source device color values (e.g DeviceCMYK, DeviceRGB, or DeviceGray)
-that match the color model of the output intent will be interpreted to
-be in the output intent color space. In addition, if the output device
-color model matches the output intent color model, then the
-destination ICC profile will be the output intent ICC profile.
-
-If there is a mismatch between the device color model and the
-output intent, the output intent profile will be used as a
-proofing profile, since that is the intended rendering.
-
-Note that a PDF document can have multiple
-rendering intents per the PDF specification. As such, with
-the option -dUsePDFX3Profile the first output intent
-encountered will be used. It is possible to specify
-a particular output intent where <em>int</em> is an
-integer (a value of 0 is the same as not specifying a number).
-Probing of the output intents for a particular file
-is possible using extractICCprofiles.ps in ./gs/toolbin.
-
-Finally, note that the ICC profile member entry is an option in
-the output intent dictionary. In these cases, the output intent
-specifies a registry and a standard profile (e.g. Fogra39). Ghostscript will
-not make use of these output intents. Instead, if desired, these standard
- profiles should be used with the commands specified above (e.g. -sOutputICCProfile).</dd>
-</dl>
-
-<dl>
- <dt><code>-sUseOutputIntent=</code><em>string</em></dt>
-<dd>Like <code>UsePDFX3Profile</code> above, this option enables rendering with an output intent defined in the
- PDF source file.
-<p>
-This option behaves the same way as the <code>UsePDFX3Profile</code>, but the selection criteria are different.
-Because its possible (as of PDF 2.0) for each page to have a different array, its not sufficient just to supply
-an array index, as the same profile might potentially be at different indices in each array.</p>
-<p>
-Instead this option takes a string, which is first compared against the <code>OutputConditionIdentifier</code>
-in each OutputIntent in the array. If the <code>OutputConditionIdentifier</code> is not a standard identifier
-then it should be Custom and the <code>UseOutputIntent</code> string will be matched against the value of the
-<code>Info</code> key instead. If the <code>OutputConditionIdentifier</code> or <code>Info</code> matches the
-value of <code>UseOuttpuIntent</code>, then that OutputIntent is selected <b>if</b> the OutputIntent contains
-a <code>DestOutputProfile</code> key.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-sICCProfilesDir=</code><em>path</em></dt>
-<dd>Set a directory in which to search for the above profiles.
- The directory path must end with a file system delimiter.
-<p>
-If the user doesn't use the -sICCProfilesDir= command line option,
-Ghostscript creates a default value for it by looking on the
-directory paths explained in <a href="#Finding_files">How
-Ghostscript finds files</a>. If the current directory is the first
-path a test is made for the iccprofiles directory. Next, the remaining
-paths with the string Resource in it are tested. The prefix up to
-the path separator character preceding the string Resource, concatenated
-with the string iccprofiles is used and if this exists, then this
-path will be used for ICCProfilesDir.</p>
-<p>
-Note that if the build is performed with COMPILE_INITS=1,
-then the profiles contained in gs/iccprofiles will be placed in
-the ROM file system. If a directory is specified on the command
-line using -sICCProfilesDir=, that directory is searched before
-the iccprofiles/ directory of the ROM file system is searched.</p>
-<p>
-<b><font size="+1">
-A note for Windows users, Artifex recommends the use of the
-forward slash delimiter due to the special interpretation of \" by
-the Microsoft C startup code. See
-<a href="http://msdn.microsoft.com/en-us/library/a1y7w461.aspx">Parsing C Command-Line Arguments</a>
-for more information.
-</font></b></p>
-</dd>
-</dl>
-
-<h4><a name="Other_parameters"></a>Other parameters</h4>
-
-<dl>
-<dt><code>-dFILTERIMAGE</code></dt>
-<dd>If set, ths will ignore all images in the input (in this context image means a bitmap), these will
-therefore not be rendered.</dd>
-</dl>
-
-<dl>
-<dt><code>-dFILTERTEXT</code></dt>
-<dd>If set, ths will ignore all text in the input (just because it looks like text doesn't mean it is, it might be an image), text will
-therefore not be rendered.</dd>
-</dl>
-
-<dl>
-<dt><code>-dFILTERVECTOR</code></dt>
-<dd>If set, ths will ignore anything whch is neither text nor an image..</dd>
-</dl>
-
-<dl>
- <dt><code>-dDELAYBIND</code></dt>
-<dd>Causes <code>bind</code> to remember all its invocations, but not
-actually execute them until the <code>.bindnow</code> procedure is
-called. Useful only for certain specialized packages like
-<code>pstotext</code> that redefine operators. See the documentation
-for <a href="Language.htm#bindnow"><code>.bindnow</code></a> for more information
- on using this feature.</dd>
-</dl>
-
-<dl>
- <dt><code>-dDOPDFMARKS</code></dt>
-<dd>Causes <code>pdfmark</code> to be called for bookmarks,
-annotations, links and cropbox when processing PDF files.
-Normally, <code>pdfmark</code> is only called for these types
-for PostScript files or when the output device requests it
- (e.g. pdfwrite device).</dd>
-</dl>
-
-<dl>
- <dt><code>-dJOBSERVER</code></dt>
-<dd>Define <code>\004 (^D)</code> to start a new encapsulated job used for
-compatibility with Adobe PS Interpreters that ordinarily run under a job
-server. The <code>-dNOOUTERSAVE</code> switch is ignored if <code>-dJOBSERVER</code>
-is specified since job servers <b>always</b> execute the input PostScript
-under a save level, although the <code>exitserver</code> operator can
-be used to escape from the encapsulated job and execute as if the
- <code>-dNOOUTERSAVE</code> was specified.
-<p>
-This also requires that the input be from stdin, otherwise an error will
-result (<code>Error: /invalidrestore in --restore--</code>).</p>
-<p>Example usage is:
-<pre>
- gs ... -dJOBSERVER - &lt; inputfile.ps
- -or-
- cat inputfile.ps | gs ... -dJOBSERVER -
-</pre>
-<b>Note: </b>The <code>^D</code> does not result in an end-of-file action
-on stdin as it may on some PostScript printers that rely on TBCP (Tagged
-Binary Communication Protocol) to cause an out-of-band <code>^D</code> to
-signal EOF in a stream input data. This means that direct file actions
-on stdin such as <code>flushfile</code> and <code>closefile</code>
-will affect processing of data beyond the <code>^D</code> in the stream.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOCACHE</code></dt>
- <dd>Disables character caching. Useful only for debugging.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOGC</code></dt>
-<dd>Suppresses the initial automatic enabling of the garbage collector in
-Level 2 systems. (The <code>vmreclaim</code> operator is not disabled.)
- Useful only for debugging.</dd>
-</dl>
-
-<dl>
- <dt><code>-dNOOUTERSAVE</code></dt>
-<dd>Suppresses the initial save that is used for compatibility with Adobe
-PS Interpreters that ordinarily run under a job server. If a job server is
-going to be used to set up the outermost save level, then <code>-dNOOUTERSAVE</code>
-should be used so that the restore between jobs will restore global VM as
- expected.</dd>
-</dl>
-
-<a name="NoSafer"></a>
-<dl>
- <dt><code>-dNOSAFER</code> (equivalent to <code>-dDELAYSAFER</code>).</dt>
-<dd>This flag disables SAFER mode until the <code>.setsafe</code>
-procedure is run. This is intended for clients or scripts that cannot
-operate in SAFER mode. If Ghostscript is started with <code>-dNOSAFER</code>
-or <code>-dDELAYSAFER</code>, PostScript programs are allowed to read, write,
-rename or delete any files in the system that are not protected by operating
-system permissions.
-<p><b>This mode should be used with caution, and <code>.setsafe</code> should be
- run prior to running any PostScript file with unknown contents.</b></p>
-
- </dd>
-</dl>
-<a name="Safer"></a>
-<dl>
- <dt><code>-dSAFER</code></dt>
-<dd>
-<strong>IMPORTANT NOTE:</strong> Ghostscript now (as of 9.50) defaults to SAFER being active.
-<p>
-Enables access controls on files. Access controls fall into three categories,
-files from which Ghostscript is permitted to read, ones to which it is permitted
-to write, and ones over which it has &quot;control&quot; (i.e. delete/rename). These
-access controls apply to <strong>all</strong> files accessed via Ghostscript's internal
-interface to the C library file handling. Whilst we have taken considerable pains to
-ensure that all the code we maintain (as well as the so called &quot;contrib&quot; devices,
-that are devices included in our release packages, but not strictly maintained by the
-Ghostscript development team) uses this interface, we have no control over thirdparty
-code.
-<p>
-This is an entirely new implementation of <code>SAFER</code> for Ghostscript versions
-9.50 and later. Earlier versions (see "<a href="#OldSafer">-dOLDSAFER</a>") relied on
-storing the file permission lists in Postscript VM (Virtual Memory), and only applied
-file access permissions to the Postscript file related operators. It relied on restricting
-the function of <code>setpagedevice</code> to avoid the device code from being manipulated
-into opening arbitrary files. The application of the file permissions was done within the
-internal context of the Postscript interpreter, and some other aspects of the Postscript
-restrictions were applied in the Postscript environment. With so many of the feature's
-capabilities relying on the Postscript context and environment, by using other (Ghostscript
-specific) features maliciously, the restrictions could be overridden.
-<p>
-Whilst the path storage and application of the permissions is implemented entirely in C,
-it is still possible for Postscript to add and remove paths from the permissions lists
-(see <a href="Language.htm#.addcontrolpath">.addcontrolpath</a>) until such time as the
-access controls are enabled (see <a href="Language.htm#.activatepathcontrol">.activatepathcontrol</a>),
-any call to <code>.addcontrolpath</code> after <code>.activatepathcontrol</code> will result in a
-<code>Fatal</code> error causing the interpreter to immediately exit.
-<p>
-An incompatibility exists between the pre-9.50 and 9.50 and later <code>SAFER</code>.
-By removing storage and application entirely from the Postscript language
-environment and internal context, SAFER is no longer affected by Postscript
-<code>save</code>&sol;<code>restore</code> operations. Previously, it was possible
-to do the equivalent of:
-<blockquote>
-<br><code>save</code>
-<br><code>.setsafe</code>
-<br><code>Postscript ops</code>
-<br><code>restore</code>
-</blockquote>
-<p>
-In that sequence, the <code>Postscript ops</code> would run with <code>SAFER</code> protection
-but after the restore, <code>SAFER</code> would no longer be in force. This is no longer the case.
-After the call to <code>.setsafe</code> the file controls are in force until the
-interpreter exits. As the 9.50 and later implementation no longer restricts the
-operation of <code>setpagedevice</code>, and because this capability is <i>extremely</i>
-rarely used, we feel the improvement in security warrants the small reduction in
-flexibility.
-<p>
-Path matching is very simple: it is case sensitive, and we do not implement full featured
-&quot;globbing&quot; or regular expression matching (such complexity would significantly
-and negatively impact performance). Further, the string parameter(s) passed to the
-<code>--permit-file-*</code> option must exactly match the string(s) used to reference
-the file(s): for example, you cannot use a absolute path to grant permission, and
-then a relative path to reference the file (or vice versa) - the path match will fail.
-Similarly, you cannot grant permission through one symlink, and then reference a file
-directly, or through an alternative symlink - again, the matching will fail.
-<p>
-The following cases are handled:
-<ul>
-<li>
-<dl><dt></dt><dd><code>&quot;&sol;path&sol;to&sol;file&quot;</code></dd></dl>
-<p>Permits access only to the file: &quot;&sol;path&sol;to&sol;file&quot;
-</li>
-<li>
-<dl><dt></dt><dd><code>&quot;&sol;path&sol;to&sol;directory&sol;&quot;</code></dd></dl>
-<p>Permits access to any file in, and only in, the directory: &quot;&sol;path&sol;to&sol;directory&quot;
-</li>
-<li>
-<dl><dt></dt><dd><code>&quot;&sol;path&sol;to&sol;directory&sol;*&quot;</code></dd></dl>
-<p>Permits access to any file in the directory: &quot;&sol;path&sol;to&sol;directory&quot; and
-any child of that directory.
-</li>
-</ul>
-<p><strong>Important Note for Windows Users</strong>:
-<br>
-The file/path pattern matching is case sensitive, even on Windows. This is a
-change in behaviour compared to the old code which, on Windows, was case
-<i>in</i>sensitive. This is in recognition of changes in Windows behaviour,
-in that it now supports (although does not enforce) case sensitivity.
-<p>
-Four command line parameters permit explicit control of the paths included in
-the access control lists:
-<ul>
-<li><dl><dt></dt><dd><code>--permit-file-read=<em>pathlist</em></code></dd></dl>
-<p> Adds a path, or list of paths, to the "permit read" list. A list
-of paths is a series of paths separated by the appropriate path list separator
-for your platform (for example, on Unix-like systems it is &quot;&colon;&quot;
-and on MS Windows it is &quot;;&quot;).
-</li>
-<li><dl><dt></dt><dd><code>--permit-file-write=<em>pathlist</em></code></dd></dl>
-<p> Adds a path, or list of paths, to the "permit write" list. A list
-of paths is a series of paths separated by the appropriate path list separator
-for your platform (for example, on Unix-like systems it is &quot;&colon;&quot;
-and on MS Windows it is &quot;;&quot;).
-</li>
-<li><dl><dt></dt><dd><code>--permit-file-control=<em>pathlist</em></code></dd></dl>
-<p> Adds a path, or list of paths, to the "permit control" list. A list
-of paths is a series of paths separated by the appropriate path list separator
-for your platform (for example, on Unix-like systems it is &quot;&colon;&quot;
-and on MS Windows it is &quot;;&quot;).
-</li>
-<li><dl><dt></dt><dd><code>--permit-file-all=<em>pathlist</em></code></dd></dl>
-<p> Adds a path, or list of paths, to the all the above lists. A list
-of paths is a series of paths separated by the appropriate path list separator
-for your platform (for example, on Unix-like systems it is &quot;&colon;&quot;
-and on MS Windows it is &quot;;&quot;).
-</li>
-</ul>
-<p>
-'*' may be used as a wildcard in the above paths to mean "any
-character other than the directory separator. Do not use two
-or more *'s without intervening characters.
-<p>
-Finally, paths supplied on the command line (such as those in <code>-I</code>,
-<code>-sFONTPATH</code> parameters) are added to the permitted reading list.
-Similarly, paths read during initialisation from <code>Fontmap</code>, <code>cidfmap</code>,
-and the platform specific font file enumeration (e.g. <code>fontconfig</code> on Unix systems)
-are automatically added to the permit read lists.
-</dd>
-</dl>
-<br>
-<a name="OldSafer"></a>
-<dl>
- <dt><code>-dOLDSAFER</code></dt>
-<dd>
-<strong>NOTE: This enables deprecated code which will shortly be removed</strong>
-<p>Used in combination with <code>-dSAFER</code> (or <code>.setsafe</code>) enables
-the pre-9.50 SAFER implementation. It is included (for now) in case any users find
-a case where the 9.50 and later <code>SAFER</code> does not work for them. It means
-such users can keep working until we have assessed the issue, and distributed a solution.
-<p>
-Disables the <code>deletefile</code> and <code>renamefile</code>
-operators, and the ability to open piped commands (<code>%pipe%</code><em>cmd</em>)
-at all. Only <code>%stdout</code> and <code>%stderr</code> can be opened
-for writing. Disables reading of files other than <code>%stdin</code>,
-those given as a command line argument, or those contained on one of the paths
-given by LIBPATH and FONTPATH and specified by the system params /FontResourceDir
-and /GenericResourceDir.
-<p>
-This mode also sets the <a href="Language.htm#LockSafetyParams">.LockSafetyParams</a>
-parameter of the default device, or the device specified with the <code>-sDEVICE= </code>
-switch to protect against programs that attempt to write to files using the
-OutputFile device parameter. Note that since the device parameters specified
-on the command line (including OutputFile) are set prior to SAFER mode,
-the <code>-sOutputFile=...</code> on the command line is unrestricted.</p>
-<p>
-SAFER mode also prevents changing the /GenericResourceDir, /FontResourceDir
-and either the /SystemParamsPassword or the /StartJobPassword.</p>
-<p>
-When running -dNOSAFER it is possible to perform a <code>save</code>,
-followed by <code>.setsafe</code>, execute a file or procedure in SAFER mode,
-then use <code>restore</code> to return to NOSAFER mode. It is possible that the
-a crafted foreign file could restore back to a point when NOSAFER was in operation.</p>
-</dd>
-</dl>
-
-<dl>
- <dt><code>-dPreBandThreshold=true/false</code></dt>
-<dd>If the target device is a halftone device, then images that are
-normally stored in the command list during banded output will be halftoned during
-the command list writing phase, if the resulting image will result in a smaller
-command list. The decision to halftone depends upon the output and source resolution as well as
- the output and source color space.</dd>
-</dl>
-
-<dl>
- <dt><code>-dWRITESYSTEMDICT</code></dt>
-<dd>Leaves <code>systemdict</code> writable. This is necessary when
-running special utility programs such as <code>font2c</code> and
-<code>pcharstr</code>, which must bypass normal PostScript access
- protection.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Improving_performance"></a>Improving performance</h2>
-
-<p>
-Ghostscript attempts to find an optimum balance between speed and memory
-consumption, but there are some cases in which you may get a very large
-speedup by telling Ghostscript to use more memory.</p>
-
-<p>Please note that this discussion relates to devices which produce a bitmap format as the output.
-These parameters have no effect on the vector devices, such as pdfwrite.</p>
-
-<ul>
-<li>
-For raster printers and image format (jpeg*, tiff*, png* ...) devices,
-performance can be 'tuned' by adjusting some of the parameters related
-to banding (clist) options (refer to: <a href="Language.htm#Banding_parameters">
-Banding Parameters</a>).</li>
-<li>
-<p>
-All devices may use a display list ("clist") and use banding when rendering
-PDF 1.4 transparency. This prevents allocation of excessively large amounts of
-memory for the transparency buffer stack. The <code>-dMaxBitmap=</code> option
-is used to control when to use the display list, and the other banding parameters
-mentioned above control the band size.</p>
-
-<p>In general, page buffer mode is faster than banded/clist mode (a full page
-buffer is used when <code>-dMaxBitmap=#</code> is large enough for the entire
-raster image) since there is no need to write, then interpret the clist data.</p>
-
-<p>On a multi-core system where multiple threads can be dispatched to
-individual processors/cores, banding mode may provide higher performance
-since <code>-dNumRenderingThreads=#</code> can be used to take advantage of
-more than one CPU core when rendering the clist. The number of threads should
-generally be set to the number of available processor cores for best throughput.</p>
-
-<p>In general, larger <code>-dBufferSpace=#</code> values provide
-slightly higher performance since the per-band overhead is reduced.</p>
-</li>
-<li>
-If you are using X Windows, setting the <code>-dMaxBitmap=</code>
-parameter described <a href="#X_device_parameters">above</a> may
-dramatically improve performance on files that have a lot of bitmap images.</li>
-
-<li>
-With some PDF files, or if you are using Chinese, Japanese, or other fonts with
-very large character sets, adding the following sequence of switches before the
-first file name may dramatically improve performance at the cost of an additional
-memory. For example, to allow use of 30Mb of extra RAM use:
-
- <code>-c&nbsp;30000000&nbsp;setvmthreshold&nbsp;-f</code>.
-<p>This can also be useful in processing large documents when using a
-high-level (vector) output device (like pdfwrite) that maintains significant internal
-state.</p></li>
-
-<li>
-<p>
-For pattern tiles that are very large, Ghostscript uses an internal display
-list (memory based clist), but this can slow things down. The current default
-threshold is 8Mb -- pattern tiles larger than this will be cached as clist
-rather than bitmap tiles. The parameter <code>-dMaxPatternBitmap=#</code> can
-be used to adjust this threshold, smaller to reduce memory requirements and
- larger to avoid performance impacts due to clist based pattern handling.</p>
-<p>
-For example, <code>-dMaxPatternBitmap=200000</code> will use clist based
- patterns for pattern tiles larger than 200,000 bytes.</p></li>
-</ul>
-<hr>
-<h2><a name="Environment_variables"></a>Summary of environment variables</h2>
-
-<dl>
- <dt><code>GS</code>, <code>GSC</code> (MS Windows only)</dt>
-<dd>Specify the names of the Ghostscript executables. <code>GS</code>
-brings up a new typein window and possibly a graphics window;
-<code>GSC</code> uses the DOS console. If these are not set,
-<code>GS</code> defaults to <code>gswin32</code>, and
- <code>GSC</code> defaults to <code>gswin32c</code>.</dd>
-</dl>
-
-<dl>
- <dt><a href="#GS_DEVICE"><code>GS_DEVICE</code></a></dt>
-<dd>Defines the default output device. This overrides the compiled-in default, but is overridden by any commandline setting.</dd>
-</dl>
-
-<dl>
- <dt><a href="#Font_lookup"><code>GS_FONTPATH</code></a></dt>
-<dd>Specifies a list of directories to scan for fonts if a font requested
- can't be found anywhere on the search path.</dd>
-</dl>
-
-<dl>
- <dt><a href="#Finding_files"><code>GS_LIB</code></a></dt>
- <dd>Provides a search path for initialization files and fonts.</dd>
-</dl>
-
-<dl>
- <dt><code>GS_OPTIONS</code></dt>
-<dd>Defines a list of command-line arguments to be processed before the
-ones actually specified on the command line. For example, setting
-<code>GS_DEVICE</code> to XYZ is equivalent to setting
-<code>GS_OPTIONS</code> to <code>-sDEVICE=XYZ</code>. The contents
-of <code>GS_OPTIONS</code> are not limited to switches; they may include
- actual file names or even <a href="#Input_control">"@file" arguments</a>.</dd>
-
-</dl>
-
-<dl>
- <dt><a href="#Temp_files"><code>TEMP</code>, <code>TMPDIR</code></a></dt>
-<dd>Defines a directory name for temporary files. If both
-<code>TEMP</code> and <code>TMPDIR</code> are defined,
- <code>TMPDIR</code> takes precedence.</dd>
-</dl>
-
-<hr>
-
-<h2><a name="Debugging"></a>Debugging</h2>
-
-<p>
-The information here describing is probably interesting only to developers.</p>
-
-<h3><a name="Debug_switches"></a>Debug switches</h3>
-
-<p>There are several debugging switches that are detected by the interpreter.
-These switches are available whether or not Ghostscript was built with the
-DEBUG macro defined to the compiler (refer to <a href="Make.htm#Debugging">
-building a debugging configuration</a>).</p>
-
-<p>Previous to 8.10, there was a single DEBUG flag, enabled with <code>-dDEBUG
-</code> on the command line. Now there are several debugging flags to allow
-more selective debugging information to be printed containing only what is
-needed to investigate particular areas. For backward compatibilty, the
-<code>-dDEBUG</code> option will set all of the subset switches.</p>
-
-<table>
- <tr><td><code>-dCCFONTDEBUG</code></td><td>Compiled Fonts</td></tr>
- <tr><td><code>-dCFFDEBUG</code></td><td>CFF Fonts</td></tr>
- <tr><td><code>-dCMAPDEBUG</code></td><td>CMAP</td></tr>
- <tr><td><code>-dDOCIEDEBUG</code></td><td>CIE color</td></tr>
- <tr><td><code>-dEPSDEBUG</code></td><td>EPS handling</td></tr>
- <tr><td><code>-dFAPIDEBUG</code></td><td>Font API</td></tr>
- <tr><td><code>-dINITDEBUG</code></td><td>Initialization</td></tr>
- <tr><td><code>-dPDFDEBUG</code></td><td>PDF Interpreter</td></tr>
- <tr><td><code>-dPDFWRDEBUG</code></td><td>PDF Writer</td></tr>
- <tr><td><code>-dSETPDDEBUG</code></td><td>setpagedevice</td></tr>
- <tr><td><code>-dSTRESDEBUG</code></td><td>Static Resources</td></tr>
- <tr><td><code>-dTTFDEBUG</code></td><td>TTF Fonts</td></tr>
- <tr><td><code>-dVGIFDEBUG</code></td><td>ViewGIF</td></tr>
- <tr><td><code>-dVJPGDEBUG</code></td><td>ViewJPEG</td></tr>
-</table>
-
-<p>
-The PDF interpreter normally tries to repair, or ignore, all problems encountered in PDF files.
-Setting <code>-dPDFSTOPONERROR</code> instead causes the interpreter to signal an error and
-stop processing the PDF file, instead of printing a warning.
-</p><p>
-The <code>-dPDFSTOPONWARNING</code> switch behaves the same, but will stop if a condition
-which would normally merit a warning (instead of an error) is encountered. Note that
-setting <code>-dPDFSTOPONWARNING</code> also sets <code>-dPDFSTOPONERROR</code>.
-</p>
-
-<p>
-The <code>-Z</code> and <code>-T</code> switches apply only
-if the interpreter was <a href="Make.htm#Debugging">built for a debugging
-configuration</a>. In the table below, the first column is a debugging
-switch, the second is an equivalent switch (if any) and the third is its
-usage.</p>
-
-<blockquote>
-<table>
- <tr><th colspan="2">Switches used in debugging</th></tr>
- <tr> <th align="left">Switch</th>
-
-
-
- <th align="left">&nbsp;Description</th></tr>
- <tr> <td valign="top"><code>-B</code><em>size</em></td>
-
- <td>Run all subsequent files named on the command line (except for
- <code>-F</code>) through the run_string interface, using a
- buffer of <em>size</em> bytes</td></tr>
- <tr> <td valign="top"><code>-B-</code></td>
-
- <td>Turn off <code>-B</code>: run subsequent files (except for
- <code>-F</code>) directly in the normal way</td></tr>
- <tr> <td valign="top"><code>-F</code><em>file</em></td>
-
- <td>Execute the file with <code>-B1</code> temporarily in effect</td></tr>
- <tr> <td valign="top"><code>-K</code><em>n</em></td>
-
- <td>Limit the total amount of memory that the interpreter can have
- allocated at any one time to <b><em>n</em></b>K bytes.
- <b><em>n</em></b> is a positive decimal integer.</td></tr>
- <tr> <td valign="top"><code>-M</code><em>n</em></td>
-
- <td>Force the interpreter's allocator to acquire additional memory
- in units of <b><em>n</em></b>K bytes, rather than the default
- 20K. <b><em>n</em></b> is a positive decimal integer, on
- 16-bit systems no greater than 63.</td></tr>
-<tr> <td valign="top"><code>-N</code><em>n</em></td>
-
- <td>Allocate space for <b><em>n</em></b>K names, rather than the
- default (normally 64K). <b><em>n</em></b> may be greater than
- 64 only if <code>EXTEND_NAMES</code> was defined (in
- inameidx.h) when the interpreter was compiled .</td></tr>
-<tr> <td valign="top"><code>-Z</code><em>xxx</em><br><code>-Z-</code><em>xxx</em></td>
-
- <td>Turn debugging printout on (off). Each of the <em>xxx</em>
- characters selects an option. Case is significant: "a" and
- "A" have different meanings.</td></tr>
-</table>
-
-<dl compact>
-<dt><code>0</code><dd>garbage collector, minimal detail</dd></dt>
-<dt><code>1</code><dd>type 1 and type 42 font interpreter</dd></dt>
-<dt><code>2</code><dd>curve subdivider/rasterizer</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>3</code><dd>curve subdivider/rasterizer, detail</dd></dt>
-<dt><code>4</code><dd>garbage collector (strings)</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>5</code><dd>garbage collector (strings, detail)</dd></dt>
-<dt><code>6</code><dd>garbage collector (clumps, roots)</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>7</code><dd>garbage collector (objects)</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>8</code><dd>garbage collector (refs)</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>9</code><dd>garbage collector (pointers)</dd></dt>
-<dt><code>a</code><dd>allocator (large blocks only)</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>A</code><dd>allocator (all calls)</dd></dt>
-<dt><code>b</code><dd>bitmap image processor</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>B</code><dd>bitmap images, detail</dd></dt>
-<dt><code>c</code><dd>color/halftone mapper</dd></dt>
-<dt><code>d</code><dd>dictionary put/undef</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>D</code><dd>dictionary lookups</dd></dt>
-<dt><code>e</code><dd>external (OS-related) calls</dd></dt>
-<dt><code>f</code><dd>fill algorithm (summary)</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>F</code><dd>fill algorithm (detail)</dd></dt>
-<dt><code>g</code><dd>gsave/grestore[all]</dd></dt>
-<dt><code>h</code><dd>halftone renderer</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>H</code><dd>halftones, every pixel</dd></dt>
-<dt><code>i</code><dd>interpreter, just names</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>I</code><dd>interpreter, everything</dd></dt>
-<dt><code>j</code><dd>(Japanese) composite fonts</dd></dt>
-<dt><code>k</code><dd>character cache and xfonts</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>K</code><dd>character cache, every access</dd></dt>
-<dt><code>l</code><dd>command lists, bands</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>L</code><dd>command lists, everything</dd></dt>
-<dt><code>m</code><dd>makefont and font cache</dd></dt>
-<dt><code>n</code><dd>name lookup (new names only)</dd></dt>
-<dt><code>o</code><dd>outliner (stroke)</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>O</code><dd>stroke detail</dd></dt>
-<dt><code>p</code><dd>band list paths</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>P</code><dd>all paths</dd></dt>
-<dt><code>q</code><dd>clipping</dd></dt>
-<dt><code>r</code><dd>arc renderer</dd></dt>
-<dt><code>s</code><dd>streams</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>S</code><dd>scanner</dd></dt>
-<dt><code>t</code><dd>tiling algorithm</dd></dt>
-<dt><code>u</code><dd>undo saver (for save/restore), finalization</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>U</code><dd>undo saver, more detail</dd></dt>
-<dt><code>v</code><dd>compositors: alpha/transparency/overprint/rop</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>V</code><dd>compositors: alpha/transparency/overprint/rop, more detail</dd></dt>
-<dt><code>w</code><dd>compression encoder/decoder</dd></dt>
-<dt><code>x</code><dd>transformations</dd></dt>
-<dt><code>y</code><dd>Type 1 hints</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>Y</code><dd>Type 1 hints, every access</dd></dt>
-<dt><code>z</code><dd>trapezoid fill</dd></dt>
-<dt><code>#</code><dd>operator error returns</dd></dt>
-<dt><code>%</code><dd>externally processed comments</dd></dt>
-<dt><code>*</code><dd>image and RasterOp parameters</dd></dt>
-<dt><code>:</code><dd>command list and allocator/time summary</dd></dt>
-<dt><code>~</code><dd>math functions and Functions</dd></dt>
-<dt><code>'</code><dd>contexts, create/destroy</dd></dt>
-<dt>&nbsp;&nbsp;&nbsp;<code>"</code><dd>contexts, every operation</dd></dt>
-<dt><code>^</code><dd>reference counting</dd></dt>
-<dt><code>_</code><dd>high-level (vector) output</dd></dt>
-<dt><code>!</code><dd>Postscript operator names (this option is available only when Ghostscript is compiled with a predefined macro DEBUG_TRACE_PS_OPERATORS)</dd></dt>
-<dt><code>|</code><dd>(reserved for experimental code)</dd></dt>
-</dl>
-
-<p>
-The following switch affects what is printed, but does not select specific
- items for printing:</p>
-
-<dl compact>
- <dt><code>/</code><dd>include file name and line number on all trace output</dd></dt>
-</dl>
-
-<p>
- These switches select debugging options other than what should be printed:</p>
-
-<dl compact>
-<dt><code>&#36;</code><dd>set unused parts of object references to
-identifiable garbage values</dd></dt>
-<dt><code>+</code><dd>use minimum-size stack blocks</dd></dt>
-<dt><code>,</code><dd>don't use path-based banding</dd></dt>
-<dt><code>`</code><dd>don't use high-level banded images</dd></dt>
-<dt><code>?</code><dd>validate pointers before, during and after garbage
-collection, also before and after save and restore; also make other
-allocator validity checks</dd></dt>
-<dt><code>@</code><dd>fill newly allocated, garbage-collected, and freed
-storage with a marker (a1, c1, and f1 respectively)</dd></dt>
-</dl>
-
-<tr> <td valign="top"><code>-T</code><em>xxx</em><br><code>-T-</code><em>xxx</em></td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
- <td>Turn <a href="#Visual_trace">Visual Trace</a> on (off). Each of the <em>xxx</em>
- characters selects an option. Case is significant: "f" and
- "F" have different meanings.</td></tr>
-
-<dl compact>
-<dt><code>f</code><dd>the filling algorithm with characters</dd></dt>
-<dt><code>F</code><dd>the filling algorithm with non-character paths</dd></dt>
-<dt><code>h</code><dd>the Type 1 hinter</dd></dt>
-<dt><code>s</code><dd>the shading algorithm</dd></dt>
-<dt><code>S</code><dd>the stroking algorithm</dd></dt>
-</dl>
-</blockquote>
-
-<p>In addition, calling ghostscript with <code>--debug</code> will list all the currently
-defined (non visual trace) debugging flags, both in their short form (as listed
-above for use with <code>-Z</code>) and in a long form, which can be used as in:
-<code>--debug=tiling,alloc</code>. All the short form flags for <code>-Z</code>
-have an equivalent long form. Future flags may be added with a long form only
- (due to all the short form flags being used already).</p>
-
-<h4><a name="Visual_trace"></a>Visual Trace</h4>
-
-<p>
-Visual Trace allows to view internal Ghostscript data in a graphical form
-while execution of C code. Special
-<a href="Lib.htm#Visual_trace">instructions</a> to be inserted into
-C code for generating the output. Client application
-rasterizes it into a window.</p>
-
-<p>
-Currently the rasterization is implemented for Windows only, in clients
-gswin32.exe and gswin32c.exe. They open Visual Trace window when graphical
-debug output appears, <code>-T</code> <a href="#Debug_switches">switch</a> is set,
-and Ghostscript was <a href="Make.htm#Debugging">built</a> with DEBUG option.
-There are two important incompletenesses of the implementation :</p>
-
-<p>
-1. The graphical output uses a hardcoded scale. An advanced client
-would provide a scale option via user interface.</p>
-
-<p>
-2. Breaks are not implemented in the client. If you need a step-by-step
-view, you should use an interactive C debugger to delay execution at breakpoints.</p>
-
-<hr>
-
-<h2><a name="Known_paper_sizes"></a>Appendix: Paper sizes known to Ghostscript</h2>
-
-<p>
-The paper sizes known to Ghostscript are defined at the beginning of the
-initialization file <code>gs_statd.ps</code>; see the comments there for
-more details about the definitions. The table here lists them by name and
-size. <code>gs_statd.ps</code> defines their sizes exactly in points,
-and the dimensions in inches (at 72 points per inch) and centimeters shown
-in the table are derived from those, rounded to the nearest 0.1 unit. A
-guide to international paper sizes can be found at</p>
-
-<blockquote>
-<a href="http://www.edsebooks.com/paper/papersize.html">http://www.edsebooks.com/paper/papersize.html</a>
-</blockquote>
-
-<table>
-<tr><th colspan="14">Paper sizes known to Ghostscript</th></tr>
-<tr><td colspan="14" align="center">U.S. standard</td></tr>
-<tr>
- <td></td>
- <td></td>
- <td colspan="3" align="center">Inches</td>
- <td></td>
- <td colspan="3" align="center">mm</td>
- <td></td>
- <td colspan="3" align="center">Points</td>
- <td></td>
- </tr>
-<tr>
- <td align="left">Name</td>
- <td></td>
- <td align="center">W</td>
- <td align="center">&times;</td>
- <td align="center">H</td>
- <td></td>
- <td align="center">W</td>
- <td align="center">&times;</td>
- <td align="center">H</td>
- <td></td>
- <td align="center">W</td>
- <td align="center">&times;</td>
- <td align="center">H</td>
- <td></td>
- </tr>
-<tr>
- <td>11x17</td>
- <td></td>
- <td align="right">11.0</td>
- <td></td>
- <td align="right">17.0</td>
- <td></td>
- <td align="right">279</td>
- <td></td>
- <td align="right">432</td>
- <td></td>
- <td align="right">792</td>
- <td></td>
- <td align="right">1224</td>
- <td>11&times;17in portrait</td>
- </tr>
-<tr>
- <td>ledger</td>
- <td></td>
- <td align="right">17.0</td>
- <td></td>
- <td align="right">11.0</td>
- <td></td>
- <td align="right">432</td>
- <td></td>
- <td align="right">279</td>
- <td></td>
- <td align="right">1224</td>
- <td></td>
- <td align="right">792</td>
- <td>11&times;17in landscape</td>
- </tr>
-<tr>
- <td>legal</td>
- <td></td>
- <td align="right">8.5</td>
- <td></td>
- <td align="right">14.0</td>
- <td></td>
- <td align="right">216</td>
- <td></td>
- <td align="right">356</td>
- <td></td>
- <td align="right">612</td>
- <td></td>
- <td align="right">1008</td>
- <td></td>
- </tr>
-<tr>
- <td>letter</td>
- <td></td>
- <td align="right">8.5</td>
- <td></td>
- <td align="right">11.0</td>
- <td></td>
- <td align="right">216</td>
- <td></td>
- <td align="right">279</td>
- <td></td>
- <td align="right">612</td>
- <td></td>
- <td align="right">792</td>
- <td></td>
- </tr>
-<tr>
- <td>lettersmall</td>
- <td></td>
- <td align="right">8.5</td>
- <td></td>
- <td align="right">11.0</td>
- <td></td>
- <td align="right">216</td>
- <td></td>
- <td align="right">279</td>
- <td></td>
- <td align="right">612</td>
- <td></td>
- <td align="right">792</td>
- <td></td>
- </tr>
-<tr>
- <td>archE</td>
- <td></td>
- <td align="right">36.0</td>
- <td></td>
- <td align="right">48.0</td>
- <td></td>
- <td align="right">914</td>
- <td></td>
- <td align="right">1219</td>
- <td></td>
- <td align="right">2592</td>
- <td></td>
- <td align="right">3456</td>
- <td></td>
- </tr>
-<tr>
- <td>archD</td>
- <td></td>
- <td align="right">24.0</td>
- <td></td>
- <td align="right">36.0</td>
- <td></td>
- <td align="right">610</td>
- <td></td>
- <td align="right">914</td>
- <td></td>
- <td align="right">1728</td>
- <td></td>
- <td align="right">2592</td>
- <td></td>
- </tr>
-<tr>
- <td>archC</td>
- <td></td>
- <td align="right">18.0</td>
- <td></td>
- <td align="right">24.0</td>
- <td></td>
- <td align="right">457</td>
- <td></td>
- <td align="right">610</td>
- <td></td>
- <td align="right">1296</td>
- <td></td>
- <td align="right">1728</td>
- <td></td>
- </tr>
-<tr>
- <td>archB</td>
- <td></td>
- <td align="right">12.0</td>
- <td></td>
- <td align="right">18.0</td>
- <td></td>
- <td align="right">305</td>
- <td></td>
- <td align="right">457</td>
- <td></td>
- <td align="right">864</td>
- <td></td>
- <td align="right">1296</td>
- <td></td>
- </tr>
-<tr>
- <td>archA</td>
- <td></td>
- <td align="right">9.0</td>
- <td></td>
- <td align="right">12.0</td>
- <td></td>
- <td align="right">229</td>
- <td></td>
- <td align="right">305</td>
- <td></td>
- <td align="right">648</td>
- <td></td>
- <td align="right">864</td>
- <td></td>
- </tr>
-<tr> <td colspan="14"></td></tr>
-<tr> <th colspan="14">ISO standard</th></tr>
-<tr> <td colspan="14"></td></tr>
-<tr>
- <td>a0</td>
- <td></td>
- <td align="right">33.1</td>
- <td></td>
- <td align="right">46.8</td>
- <td></td>
- <td align="right">841</td>
- <td></td>
- <td align="right">1189</td>
- <td></td>
- <td align="right">2384</td>
- <td></td>
- <td align="right">3370</td>
- <td></td>
- </tr>
-<tr>
- <td>a1</td>
- <td></td>
- <td align="right">23.4</td>
- <td></td>
- <td align="right">33.1</td>
- <td></td>
- <td align="right">594</td>
- <td></td>
- <td align="right">841</td>
- <td></td>
- <td align="right">1684</td>
- <td></td>
- <td align="right">2384</td>
- <td></td>
- </tr>
-<tr>
- <td>2</td>
- <td></td>
- <td align="right">16.5</td>
- <td></td>
- <td align="right">23.4</td>
- <td></td>
- <td align="right">420</td>
- <td></td>
- <td align="right">594</td>
- <td></td>
- <td align="right">1191</td>
- <td></td>
- <td align="right">1684</td>
- <td></td>
- </tr>
-<tr>
- <td>a3</td>
- <td></td>
- <td align="right">11.7</td>
- <td></td>
- <td align="right">16.5</td>
- <td></td>
- <td align="right">297</td>
- <td></td>
- <td align="right">420</td>
- <td></td>
- <td align="right">842</td>
- <td></td>
- <td align="right">1191</td>
- <td></td>
- </tr>
-<tr>
- <td>a4</td>
- <td></td>
- <td align="right">8.3</td>
- <td></td>
- <td align="right">11.7</td>
- <td></td>
- <td align="right">210</td>
- <td></td>
- <td align="right">297</td>
- <td></td>
- <td align="right">595</td>
- <td></td>
- <td align="right">842</td>
- <td></td>
- </tr>
-<tr>
- <td>a4small</td>
- <td></td>
- <td align="right">8.3</td>
- <td></td>
- <td align="right">11.7</td>
- <td></td>
- <td align="right">210</td>
- <td></td>
- <td align="right">297</td>
- <td></td>
- <td align="right">595</td>
- <td></td>
- <td align="right">842</td>
- <td></td>
- </tr>
-<tr>
- <td>a5</td>
- <td></td>
- <td align="right">5.8</td>
- <td></td>
- <td align="right">8.3</td>
- <td></td>
- <td align="right">148</td>
- <td></td>
- <td align="right">210</td>
- <td></td>
- <td align="right">420</td>
- <td></td>
- <td align="right">595</td>
- <td></td>
- </tr>
-<tr>
- <td>a6</td>
- <td></td>
- <td align="right">4.1</td>
- <td></td>
- <td align="right">5.8</td>
- <td></td>
- <td align="right">105</td>
- <td></td>
- <td align="right">148</td>
- <td></td>
- <td align="right">297</td>
- <td></td>
- <td align="right">420</td>
- <td></td>
- </tr>
-<tr>
- <td>a7</td>
- <td></td>
- <td align="right">2.9</td>
- <td></td>
- <td align="right">4.1</td>
- <td></td>
- <td align="right">74</td>
- <td></td>
- <td align="right">105</td>
- <td></td>
- <td align="right">210</td>
- <td></td>
- <td align="right">297</td>
- <td></td>
- </tr>
-<tr>
- <td>a8</td>
- <td></td>
- <td align="right">2.1</td>
- <td></td>
- <td align="right">2.9</td>
- <td></td>
- <td align="right">52</td>
- <td></td>
- <td align="right">74</td>
- <td></td>
- <td align="right">148</td>
- <td></td>
- <td align="right">210</td>
- <td></td>
- </tr>
-<tr>
- <td>a9</td>
- <td></td>
- <td align="right">1.5</td>
- <td></td>
- <td align="right">2.1</td>
- <td></td>
- <td align="right">37</td>
- <td></td>
- <td align="right">52</td>
- <td></td>
- <td align="right">105</td>
- <td></td>
- <td align="right">148</td>
- <td></td>
- </tr>
-<tr>
- <td>a10</td>
- <td></td>
- <td align="right">1.0</td>
- <td></td>
- <td align="right">1.5</td>
- <td></td>
- <td align="right">26</td>
- <td></td>
- <td align="right">37</td>
- <td></td>
- <td align="right">73</td>
- <td></td>
- <td align="right">105</td>
- <td></td>
- </tr>
-<tr>
- <td>isob0</td>
- <td>&nbsp;</td>
- <td align="right">39.4</td>
- <td>&nbsp;</td>
- <td align="right">55.7</td>
- <td>&nbsp;</td>
- <td align="right">1000</td>
- <td>&nbsp;</td>
- <td align="right">1414</td>
- <td>&nbsp;</td>
- <td align="right">2835</td>
- <td>&nbsp;</td>
- <td align="right">4008</td>
- <td></td>
- </tr>
-<tr>
- <td>isob1</td>
- <td></td>
- <td align="right">27.8</td>
- <td></td>
- <td align="right">39.4</td>
- <td></td>
- <td align="right">707</td>
- <td></td>
- <td align="right">1000</td>
- <td></td>
- <td align="right">2004</td>
- <td></td>
- <td align="right">2835</td>
- <td></td>
- </tr>
-<tr>
- <td>isob2</td>
- <td></td>
- <td align="right">19.7</td>
- <td></td>
- <td align="right">27.8</td>
- <td></td>
- <td align="right">500</td>
- <td></td>
- <td align="right">707</td>
- <td></td>
- <td align="right">1417</td>
- <td></td>
- <td align="right">2004</td>
- <td></td>
- </tr>
-<tr>
- <td>isob3</td>
- <td></td>
- <td align="right">13.9</td>
- <td></td>
- <td align="right">19.7</td>
- <td></td>
- <td align="right">353</td>
- <td></td>
- <td align="right">500</td>
- <td></td>
- <td align="right">1001</td>
- <td></td>
- <td align="right">1417</td>
- <td></td>
- </tr>
-<tr>
- <td>isob4</td>
- <td></td>
- <td align="right">9.8</td>
- <td></td>
- <td align="right">13.9</td>
- <td></td>
- <td align="right">250</td>
- <td></td>
- <td align="right">353</td>
- <td></td>
- <td align="right">709</td>
- <td></td>
- <td align="right">1001</td>
- <td></td>
- </tr>
-<tr>
- <td>isob5</td>
- <td></td>
- <td align="right">6.9</td>
- <td></td>
- <td align="right">9.8</td>
- <td></td>
- <td align="right">176</td>
- <td></td>
- <td align="right">250</td>
- <td></td>
- <td align="right">499</td>
- <td></td>
- <td align="right">709</td>
- <td></td>
- </tr>
-<tr>
- <td>isob6</td>
- <td></td>
- <td align="right">4.9</td>
- <td></td>
- <td align="right">6.9</td>
- <td></td>
- <td align="right">125</td>
- <td></td>
- <td align="right">176</td>
- <td></td>
- <td align="right">354</td>
- <td></td>
- <td align="right">499</td>
- <td></td>
- </tr>
-<tr>
- <td>c0</td>
- <td></td>
- <td align="right">36.1</td>
- <td></td>
- <td align="right">51.1</td>
- <td></td>
- <td align="right">917</td>
- <td></td>
- <td align="right">1297</td>
- <td></td>
- <td align="right">2599</td>
- <td></td>
- <td align="right">3677</td>
- <td></td>
- </tr>
-<tr>
- <td>c1</td>
- <td></td>
- <td align="right">25.5</td>
- <td></td>
- <td align="right">36.1</td>
- <td></td>
- <td align="right">648</td>
- <td></td>
- <td align="right">917</td>
- <td></td>
- <td align="right">1837</td>
- <td></td>
- <td align="right">2599</td>
- <td></td>
- </tr>
-<tr>
- <td>c2</td>
- <td></td>
- <td align="right">18.0</td>
- <td></td>
- <td align="right">25.5</td>
- <td></td>
- <td align="right">458</td>
- <td></td>
- <td align="right">648</td>
- <td></td>
- <td align="right">1298</td>
- <td></td>
- <td align="right">1837</td>
- <td></td>
- </tr>
-<tr>
- <td>c3</td>
- <td></td>
- <td align="right">12.8</td>
- <td></td>
- <td align="right">18.0</td>
- <td></td>
- <td align="right">324</td>
- <td></td>
- <td align="right">458</td>
- <td></td>
- <td align="right">918</td>
- <td></td>
- <td align="right">1298</td>
- <td></td>
- </tr>
-<tr>
- <td>c4</td>
- <td>&nbsp;</td>
- <td align="right">9.0</td>
- <td>&nbsp;</td>
- <td align="right">12.8</td>
- <td>&nbsp;</td>
- <td align="right">229</td>
- <td>&nbsp;</td>
- <td align="right">324</td>
- <td>&nbsp;</td>
- <td align="right">649</td>
- <td>&nbsp;</td>
- <td align="right">918</td>
- <td>&nbsp;</td>
- <td>&nbsp;</td>
-</tr>
-<tr>
- <td>c5</td>
- <td></td>
- <td align="right">6.4</td>
- <td></td>
- <td align="right">9.0</td>
- <td></td>
- <td align="right">162</td>
- <td></td>
- <td align="right">229</td>
- <td></td>
- <td align="right">459</td>
- <td></td>
- <td align="right">649</td>
- <td></td>
-</tr>
-<tr>
- <td>c6</td>
- <td></td>
- <td align="right">4.5</td>
- <td></td>
- <td align="right">6.4</td>
- <td></td>
- <td align="right">114</td>
- <td></td>
- <td align="right">162</td>
- <td></td>
- <td align="right">323</td>
- <td></td>
- <td align="right">459</td>
- <td></td>
-</tr>
-<tr>
- <td colspan="14"></td>
-</tr>
-<tr>
- <th colspan="14">JIS standard</th>
-</tr>
-<tr>
- <td colspan="14"></td>
- </tr>
-<tr>
- <td>jisb0</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right">1030</td>
- <td></td>
- <td align="right">1456</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- </tr>
-<tr>
- <td>jisb1</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right">728</td>
- <td></td>
- <td align="right">1030</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- </tr>
-<tr>
- <td>jisb2</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right">515</td>
- <td></td>
- <td align="right">728</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- </tr>
-<tr>
- <td>jisb</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right">364</td>
- <td></td>
- <td align="right">515</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- </tr>
-<tr>
- <td>jisb4</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right">257</td>
- <td></td>
- <td align="right">364</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- </tr>
-<tr>
- <td>jisb5</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right">182</td>
- <td></td>
- <td align="right">257</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- </tr>
-<tr>
- <td>jisb6</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right">128</td>
- <td></td>
- <td align="right">182</td>
- <td></td>
- <td align="right"></td>
- <td></td>
- <td align="right"></td>
- <td></td>
- </tr>
-<tr>
- <td colspan="14"></td>
- </tr>
-<tr>
- <th colspan="14">ISO/JIS switchable</th>
- </tr>
-<tr>
- <td colspan="14"></td>
- </tr>
-<tr> <td colspan="14">b0 (see * below)</td></tr>
-<tr> <td colspan="14">b1 (see * below)</td></tr>
-<tr> <td colspan="14">b2 (see * below)</td></tr>
-<tr> <td colspan="14">b3 (see * below)</td></tr>
-<tr> <td colspan="14">b4 (see * below)</td></tr>
-<tr> <td colspan="14">b5 (see * below)</td></tr>
-
-<tr> <td colspan="14" ></td></tr>
-<tr> <th colspan="14">Other</th></tr>
-<tr> <td colspan="14"></td></tr>
-<tr>
- <td>flsa</td>
- <td></td>
- <td align="right">8.5</td>
- <td></td>
- <td align="right">13.0</td>
- <td></td>
- <td align="right">216</td>
- <td></td>
- <td align="right">330</td>
- <td></td>
- <td align="right">612</td>
- <td></td>
- <td align="right">936</td>
- <td>U.S. foolscap</td>
- </tr>
-<tr>
- <td>flse</td>
- <td></td>
- <td align="right">8.5</td>
- <td></td>
- <td align="right">13.0</td>
- <td></td>
- <td align="right">216</td>
- <td></td>
- <td align="right">330</td>
- <td></td>
- <td align="right">612</td>
- <td></td>
- <td align="right">936</td>
- <td>European foolscap</td>
- </tr>
-<tr>
- <td>halfletter</td>
- <td></td>
- <td align="right">5.5</td>
- <td></td>
- <td align="right">8.5</td>
- <td></td>
- <td align="right">140</td>
- <td></td>
- <td align="right">216</td>
- <td></td>
- <td align="right">396</td>
- <td></td>
- <td align="right">612</td>
- <td></td>
- </tr>
-<tr>
- <td>hagaki</td>
- <td></td>
- <td align="right">3.9</td>
- <td></td>
- <td align="right">5.8</td>
- <td></td>
- <td align="right">100</td>
- <td></td>
- <td align="right">148</td>
- <td></td>
- <td align="right">283</td>
- <td></td>
- <td align="right">420</td>
- <td>Japanese postcard</td>
- </tr>
-</table>
-
-<p>
-*<em>Note:</em> Initially the B paper sizes are the ISO sizes, e.g.,
-<code>b0</code> is the same as <code>isob0</code>. Running the file
-<code>lib/jispaper.ps</code> makes the B paper sizes be the JIS sizes,
-e.g., <code>b0</code> becomes the same as <code>jisb0</code>.</p>
-
-<hr>
-
-<h2><a name="X_font_mappings"></a>Appendix: X default font mappings</h2>
-
-<h3><a name="Standard_X_server_fonts"></a>Standard X servers</h3>
-
-<h4><a name="X_regular_fonts"></a>Regular fonts</h4>
-
-<pre>
- AvantGarde-Book: -Adobe-ITC Avant Garde Gothic-Book-R-Normal--\n\
- AvantGarde-BookOblique: -Adobe-ITC Avant Garde Gothic-Book-O-Normal--\n\
- AvantGarde-Demi: -Adobe-ITC Avant Garde Gothic-Demi-R-Normal--\n\
- AvantGarde-DemiOblique: -Adobe-ITC Avant Garde Gothic-Demi-O-Normal--\n\
- Bookman-Demi: -Adobe-ITC Bookman-Demi-R-Normal--\n\
- Bookman-DemiItalic: -Adobe-ITC Bookman-Demi-I-Normal--\n\
- Bookman-Light: -Adobe-ITC Bookman-Light-R-Normal--\n\
- Bookman-LightItalic: -Adobe-ITC Bookman-Light-I-Normal--\n\
- Courier: -Adobe-Courier-Medium-R-Normal--\n\
- Courier-Bold: -Adobe-Courier-Bold-R-Normal--\n\
- Courier-BoldOblique: -Adobe-Courier-Bold-O-Normal--\n\
- Courier-Oblique: -Adobe-Courier-Medium-O-Normal--\n\
- Helvetica: -Adobe-Helvetica-Medium-R-Normal--\n\
- Helvetica-Bold: -Adobe-Helvetica-Bold-R-Normal--\n\
- Helvetica-BoldOblique: -Adobe-Helvetica-Bold-O-Normal--\n\
- Helvetica-Narrow: -Adobe-Helvetica-Medium-R-Narrow--\n\
- Helvetica-Narrow-Bold: -Adobe-Helvetica-Bold-R-Narrow--\n\
- Helvetica-Narrow-BoldOblique: -Adobe-Helvetica-Bold-O-Narrow--\n\
- Helvetica-Narrow-Oblique: -Adobe-Helvetica-Medium-O-Narrow--\n\
- Helvetica-Oblique: -Adobe-Helvetica-Medium-O-Normal--\n\
- NewCenturySchlbk-Bold: -Adobe-New Century Schoolbook-Bold-R-Normal--\n\
- NewCenturySchlbk-BoldItalic: -Adobe-New Century Schoolbook-Bold-I-Normal--\n\
- NewCenturySchlbk-Italic: -Adobe-New Century Schoolbook-Medium-I-Normal--\n\
- NewCenturySchlbk-Roman: -Adobe-New Century Schoolbook-Medium-R-Normal--\n\
- Palatino-Bold: -Adobe-Palatino-Bold-R-Normal--\n\
- Palatino-BoldItalic: -Adobe-Palatino-Bold-I-Normal--\n\
- Palatino-Italic: -Adobe-Palatino-Medium-I-Normal--\n\
- Palatino-Roman: -Adobe-Palatino-Medium-R-Normal--\n\
- Times-Bold: -Adobe-Times-Bold-R-Normal--\n\
- Times-BoldItalic: -Adobe-Times-Bold-I-Normal--\n\
- Times-Italic: -Adobe-Times-Medium-I-Normal--\n\
- Times-Roman: -Adobe-Times-Medium-R-Normal--\n\
- ZapfChancery-MediumItalic: -Adobe-ITC Zapf Chancery-Medium-I-Normal--
-</pre>
-
-<h4><a name="X_symbol_fonts"></a>Symbol fonts</h4>
-
-<pre> Symbol: -Adobe-Symbol-Medium-R-Normal--
-</pre>
-
-<h4><a name="X_dingbat_fonts"></a>Dingbat fonts</h4>
-
-<pre> ZapfDingbats: -Adobe-ITC Zapf Dingbats-Medium-R-Normal--
-</pre>
-
-<h3><a name="OpenWindows_fonts"></a>Sun OpenWindows</h3>
-
-<p>
-For Sun's X11/NeWS one can use the OpenWindows scalable fonts instead,
-which gives good output for any point size. In this environment, the
-relevant section of the resource file should look like this:</p>
-
-<pre>Ghostscript.regularFonts: \
- AvantGarde-Book: -itc-avantgarde-book-r-normal-- \n\
- AvantGarde-BookOblique: -itc-avantgarde-book-o-normal-- \n\
- AvantGarde-Demi: -itc-avantgarde-demi-r-normal-- \n\
- AvantGarde-DemiOblique: -itc-avantgarde-demi-o-normal-- \n\
- Bembo: -monotype-bembo-medium-r-normal-- \n\
- Bembo-Bold: -monotype-bembo-bold-r-normal-- \n\
- Bembo-BoldItalic: -monotype-bembo-bold-i-normal-- \n\
- Bembo-Italic: -monotype-bembo-medium-i-normal-- \n\
- Bookman-Demi: -itc-bookman-demi-r-normal-- \n\
- Bookman-DemiItalic: -itc-bookman-demi-i-normal-- \n\
- Bookman-Light: -itc-bookman-light-r-normal-- \n\
- Bookman-LightItalic: -itc-bookman-light-i-normal-- \n\
- Courier: -itc-courier-medium-r-normal-- \n\
- Courier-Bold: -itc-courier-bold-r-normal-- \n\
- Courier-BoldOblique: -itc-courier-bold-o-normal-- \n\
- Courier-Oblique: -itc-courier-medium-o-normal-- \n\
- GillSans: -monotype-gill-medium-r-normal-sans- \n\
- GillSans-Bold: -monotype-gill-bold-r-normal-sans- \n\
- GillSans-BoldItalic: -monotype-gill-bold-i-normal-sans- \n\
- GillSans-Italic: -monotype-gill-normal-i-normal-sans- \n\
- Helvetica: -linotype-helvetica-medium-r-normal-- \n\
- Helvetica-Bold: -linotype-helvetica-bold-r-normal-- \n\
- Helvetica-BoldOblique: -linotype-helvetica-bold-o-normal-- \n\
- Helvetica-Narrow: -linotype-helvetica-medium-r-narrow-- \n\
- Helvetica-Narrow-Bold: -linotype-helvetica-bold-r-narrow-- \n\
- Helvetica-Narrow-BoldOblique: -linotype-helvetica-bold-o-narrow-- \n\
- Helvetica-Narrow-Oblique: -linotype-helvetica-medium-o-narrow-- \n\
- Helvetica-Oblique: -linotype-helvetica-medium-o-normal-- \n\
- LucidaBright: -b&amp;h-lucidabright-medium-r-normal-- \n\
- LucidaBright-Demi: -b&amp;h-lucidabright-demibold-r-normal-- \n\
- LucidaBright-DemiItalic: -b&amp;h-lucidabright-demibold-i-normal-- \n\
- LucidaBright-Italic: -b&amp;h-lucidabright-medium-i-normal-- \n\
- LucidaSans: -b&amp;h-lucida-medium-r-normal-sans- \n\
- LucidaSans-Bold: -b&amp;h-lucida-bold-r-normal-sans- \n\
- LucidaSans-BoldItalic: -b&amp;h-lucida-bold-i-normal-sans- \n\
- LucidaSans-Italic: -b&amp;h-lucida-medium-i-normal-sans- \n\
- LucidaSans-Typewriter: -b&amp;h-lucidatypewriter-medium-r-normal-sans- \n\
- LucidaSans-TypewriterBold: -b&amp;h-lucidatypewriter-bold-r-normal-sans- \n\
- NewCenturySchlbk-BoldItalic: -linotype-new century schoolbook-bold-i-normal-- \n\
- NewCenturySchlbk-Bold: -linotype-new century schoolbook-bold-r-normal-- \n\
- NewCenturySchlbk-Italic: -linotype-new century schoolbook-medium-i-normal-- \n\
- NewCenturySchlbk-Roman: -linotype-new century schoolbook-medium-r-normal-- \n\
- Palatino-Bold: -linotype-palatino-bold-r-normal-- \n\
- Palatino-BoldItalic: -linotype-palatino-bold-i-normal-- \n\
- Palatino-Italic: -linotype-palatino-medium-i-normal-- \n\
- Palatino-Roman: -linotype-palatino-medium-r-normal-- \n\
- Rockwell: -monotype-rockwell-medium-r-normal-- \n\
- Rockwell-Bold: -monotype-rockwell-bold-r-normal-- \n\
- Rockwell-BoldItalic: -monotype-rockwell-bold-i-normal-- \n\
- Rockwell-Italic: -monotype-rockwell-medium-i-normal-- \n\
- Times-Bold: -linotype-times-bold-r-normal-- \n\
- Times-BoldItalic: -linotype-times-bold-i-normal-- \n\
- Times-Italic: -linotype-times-medium-i-normal-- \n\
- Times-Roman: -linotype-times-medium-r-normal-- \n\
- Utopia-Bold: -adobe-utopia-bold-r-normal-- \n\
- Utopia-BoldItalic: -adobe-utopia-bold-i-normal-- \n\
- Utopia-Italic: -adobe-utopia-regular-i-normal-- \n\
- Utopia-Regular: -adobe-utopia-regular-r-normal-- \n\
- ZapfChancery-MediumItalic: -itc-zapfchancery-medium-i-normal-- \n
-Ghostscript.dingbatFonts: \
- ZapfDingbats: -itc-zapfdingbats-medium-r-normal--
-Ghostscript.symbolFonts: \
- Symbol: --symbol-medium-r-normal--
-</pre>
-
-<hr>
-<h2><a name="FAPI_run"></a>Running Ghostscript with third-party font renderers</h2>
-
-<p>
-Font API (FAPI) is a feature which allows to attach third-party font
-renderers to Ghostscript.
-This section explains how to run Ghostscript with third-party font
-renderers, such as UFST. NOTE: FreeType is now the default font renderer
-for Ghostscript.</p>
-
-<p>
-<em>Note: To run Ghostscript with UFST you need a license from Monotype Imaging.
-Please ignore issues about UFST if you haven't got it.
-</em></p>
-
-<p>
-<em>
-Important note: Third-party font renderers may be incompatible
-with devices that can embed fonts in their output (such as pdfwrite),
-because such renderers may store fonts in a form from which Ghostscript cannot
-get the necessary information for embedding, for example, the Microtype fonts supplied
-with the UFST. Ghostscript can be configured to disable such renderers when such a
-device is being used.
-</em></p>
-
-<p>
-As of Ghostscript version 9.0, Ghostscript uses Freetype 2.4.x as the default font
-scaler/renderer.</p>
-
-<p>With this change, we added a new switch:<code>-dDisableFAPI=true</code> to revert to the older
-behavior, just in case serious regression happens that cannot be resolved in a timely manner.
-It is intended that this switch will be removed once the FAPI/Freetype implementation has
-proven itself robust and reliable in the "real world".</p>
-
-<p>
-<em>
-NOTE: With version 9.18 recently released we have, for some time, regarded FAPI/Freetype as being
-the canonical glyph rendering solution for Ghostscript and associated products, and the non-FAPI
-rendering to be deprecated. As such, the <code>-dDisableFAPI=true</code> option is also considered
-deprecated, and should be expected to be removed shortly after the next release.
-</em>
-</p>
-
-<p>
-To run Ghostscript with UFST, you first need to build Ghostscript
-with the UFST bridge. Refer <a href="Make.htm#UFST_build">How to build Ghostscript with UFST</a>.
-Both bridges may run together.</p>
-
-<p>
-There are 2 ways to handle fonts with a third-party font renderer (FAPI).
-First, you can substitute
-any FAPI-handled font to a resident PostScript font, using special map files
-<code>FAPIfontmap</code> and <code>FAPIcidfmap</code>.
-Second, you can redirect PostScript fonts to FAPI, setting
-entries in <code>FAPIconfig</code> file.</p>
-
-<p>
-Names <code>FAPIfontmap</code>, <code>FAPIcidfmap</code>, <code>FAPIconfig</code>
-in this text actually are placeholders, which may be substituted with command line arguments :
-<code>-sFAPIfontmap=<em>name1</em></code> <code>-sFAPIcidfmap=<em>name2</em></code>
-<code>-sFAPIconfig=<em>name3</em></code>.
-Ghostscript searches the specified file names as explained in
-<a href="#Finding_files">How Ghostscript finds files</a>.
-Default values for these arguments are equal to argument names.
-When building Ghostscript with <code>COMPILE_INITS=1</code>, only default values are used.</p>
-
-<p>
-Font files, which are being handled with FAPI, may reside in any directory in your hard disk.
-Paths to them to be specified in <code>FAPIfontmap</code> and
-with special command line arguments, explained below.
-The path may be either absolute or relative. Relative ones are being resolved from the path,
-which is specified in <code>FAPIconfig</code> file.</p>
-<p>
-The file <code>FAPIfontmap</code> is actually special PostScript code.
-It may include records of 2 types : general records
-and FCO records (see below).</p>
-
-<p>
-A general record describes a font, which is being rendered with FAPI.
-They must end with semicolon. Each general record is a pair.
-The first element of the pair is the font name (the name that PostScript
-documents use to access the font, which may differ
-from real name of the font which the font file defines).
-The second element is a dictionary with entries :</p>
-
-<table>
- <tr><th>Key</th>
- <th>Type</th>
- <th>Description</th></tr>
-<tr> <td>Path</td>
- <td>string</td>
- <td>Absolute path to font file, or relative path to font file from the FontPath value,
- being specified in <code>FAPIconfig</code>.</td></tr>
-<tr> <td>FontType</td>
- <td>integer</td>
- <td>PostScript type for this font. Only 1 and 42 are currently allowed.
- Note that this is unrelated to the real type of the font file -
- the bridge will perform a format conversion.</td></tr>
-<tr> <td>FAPI</td>
- <td>name</td>
- <td>Name of the renderer to be used with the font.
- Only <code>/UFST</code> and <code>/FreeType</code> are now allowed.</td></tr>
-<tr> <td>SubfontId</td>
- <td>integer</td>
- <td>(optional) Index of the font in font collection, such as FCO or TTC.
- It is being ignored if Path doesn't specify a collection.
- Note that Free Type can't handle FCO.
- Default value is 0.</td></tr>
-<tr> <td>Decoding</td>
- <td>name</td>
- <td>(optional) The name of a Decoding resource to be used with the font.
- If specified, <code>lib/xlatmap</code> (see below) doesn't work for this font.</td></tr>
-</table>
-
-<p>
-Example of a general FAPI font map record :</p>
-<blockquote>
-<code>
-/FCO1 &lt;&lt; /Path (/AFPL/UFST/fontdata/MTFONTS/PCLPS3/MT1/PCLP3__F.fco) /FontType 1 /FAPI /UFST &gt;&gt; ;
-</code>
-</blockquote>
-
-<p>
-FCO records work for UFST only.
-A group of FCO records start with a line <code><em>name</em> ReadFCOfontmap:</code>,
-where <code><em>name</em></code> is a name of a command line argument,
-which specify a path to an FCO file. The group of FCO records
-must end with the line <code>EndFCOfontmap</code>.
-Each record of a group occupy a single line,
-and contains a number and 1, 2 or 3 names.
-The number is the font index in the FCO file, the first name
-is the Postscript font name, the secong is an Encoding resource name,
-and the third is a decoding resource name.</p>
-
-<p>
-Note that <code>FAPIfontmap</code> specifies only instances of
-Font category. CID fonts to be listed in another map file.</p>
-
-<p>
-Ghostscript distribution includes sample map files
-<code>gs/lib/FAPIfontmap</code>,
-<code>gs/lib/FCOfontmap-PCLPS2</code>,
-<code>gs/lib/FCOfontmap-PCLPS3</code>,
-<code>gs/lib/FCOfontmap-PS3</code>,
-which may be customized by the user.
-The last 3 ones include an information about UFST FCO files.</p>
-
-<p>
-The file <code>FAPIcidfmap</code> defines a mapping table for
-CIDFont resources. It contains records for each CID font being rendered with FAPI.
-The format is similar to <code>FAPIfontmap</code>,
- but dictionaries must contain few different entries :</p>
-
-<table>
- <tr><th>Key</th>
- <th>Type</th>
- <th>Description</th></tr>
-<tr> <td>Path</td>
- <td>string</td>
- <td>Absolute path to font file, or relative path to font file from the CIDFontPath value,
- being specified in <code>FAPIconfig</code>.</td></tr>
-<tr> <td>CIDFontType</td>
- <td>integer</td>
- <td>PostScript type for this CID font. Only 0, 1 and 2 are currently allowed.
- Note that this is unrelated to the real type of the font file -
- the bridge will perform format conversion.</td></tr>
-<tr> <td>FAPI</td>
- <td>name</td>
- <td>Name of the renderer to be used with the font.
- Only <code>/UFST</code> and <code>/FreeType</code> are now allowed.</td></tr>
-<tr> <td>SubfontId</td>
- <td>integer</td>
- <td>(optional) Index of the font in font collection, such as FCO or TTC.
- It is being ignored if Path doesn't specify a collection.
- Default value is 0.</td></tr>
-<tr> <td>CSI</td>
- <td>array of 2 elements</td>
- <td>(required) Information for building <code>CIDSystemInfo</code>.
- The first element is a string, which specifies <code>Ordering</code>.
- The second element is a number, which specifies <code>Supplement</code>.</td></tr>
-</table>
-
-<p>
- Example of FAPI CID font map record :</p>
-<blockquote>
-<code>
-/HeiseiKakuGo-W5 &lt;&lt; /Path (/WIN2000/Fonts/PMINGLIU.TTF) /CIDFontType 0 /FAPI /UFST /CSI [(Japan1) 2] &gt;&gt; ;
-</code>
-</blockquote>
-
-
-<p>
-The control file <code>FAPIconfig</code> defines 4 entries :</p>
-
-<table>
- <tr><th>Key</th>
- <th>Type</th>
- <th>Description</th></tr>
-<tr> <td>FontPath</td>
- <td>string</td>
- <td>Absolute path to a directory, which contains fonts. Used to resolve
- relative paths in <code>FAPIfontmap</code>.</td></tr>
-<tr> <td>CIDFontPath</td>
- <td>string</td>
- <td>Absolute path to a directory, which contains fonts to substitute to CID fonts.
- Used to resolve relative paths in <code>FAPIcidfmap</code>.
- It may be same or different than FontPath.</td></tr>
-<tr> <td>HookDiskFonts</td>
- <td>array of integers.</td>
- <td>List of PS font types to be handled with FAPI.
- This controls other fonts that ones listed in <code>FAPIfontmap</code>
- and <code>FAPIcidfmap</code> - such ones are PS fonts installed to
- Ghostscript with <code>lib/fontmap</code> or with <code>GS_FONTPATH</code>,
- or regular CID font resources. Unlisted font types will be
- rendered with the native Ghostscript font renderer.
- Only allowed values now are 1,9,11,42. Note that 9 and 11
- correspond to CIDFontType 0 and 2.</td></tr>
-<tr> <td>HookEmbeddedFonts</td>
- <td>array of integers.</td>
- <td>List of PS font types to be handled with FAPI.
- This controls fonts being embedded into a document -
- either fonts or CID font resources. Unlisted font types will be
- rendered with the native Ghostscript font renderer.
- Only allowed values now are 1,9,11,42. Note that 9 and 11
- correspond to CIDFontType 0 and 2.</td></tr>
-
-</table>
-
-<p>
-Ghostscript distribution includes sample config files
-<code>gs/lib/FAPIconfig</code>,
-<code>gs/lib/FAPIconfig-FCO</code>.
-which may be customized by the user.
-The last ones defines the configuration
-for handling resident UFST fonts only.</p>
-
-<p>
-In special cases you may need to customize the file <code>lib/xlatmap</code>. Follow instructions in it.</p>
-
-<p>
-Some UFST font collections need a path for finding an UFST plugin.
-If you run UFST with such font collection,
-you should run Ghostscript with a special command line argument
-<code>-sUFST_PlugIn=<em>path</em></code>, where <code><em>path</em></code> specifies
-a disk path to the UFST plugin file, which Monotype Imaging distributes
-in <em><code>ufst/fontdata/MTFONTS/PCL45/MT3/plug__xi.fco</code></em>.
-If UFST needs it and the
-command line argument is not specified, Ghostscript prints a warning and searches
-plugin file in the current directory.</p>
-
-<p>
-If you want to run UFST with resident UFST fonts only
-(and allow Ghostscript font renderer to handle fons, which may be downloaded or embedded into documents),
-you should run Ghostscript with these command line arguments :
-<code>-sFCOfontfile=<em>path1</em></code> <code>-sFCOfontfile2=<em>path2</em></code>
-<code>-sUFST_PlugIn=<em>path3</em></code>
-<code>-sFAPIfontmap=<em>map-name</em></code> <code>-sFAPIconfig=FAPIconfig-FCO</code>
-where <code><em>path1</em></code> specifies
-a disk path to the main FCO file, <code><em>path2</em></code> specifies
-a disk path to the Wingdings FCO file, <code><em>path3</em></code>
-a disk path the FCO plugin file, <code><em>path1</em></code> is either
-<code>gs/lib/FCOfontmap-PCLPS2</code>,
-<code>gs/lib/FCOfontmap-PCLPS3</code>, or
-<code>gs/lib/FCOfontmap-PS3</code>.
-<code>FAPIcidfmap</code> works as usual, but probably you want to leave it empty
-because FCO doesn't emulate CID fonts.</p>
-
-<p>
-Some configurations of UFST need a path for finding symbol set files.
-If you compiled UFST with such configuration,
-you should run Ghostscript with a special command line argument
-<code>-sUFST_SSdir=<em>path</em></code>, where <code><em>path</em></code> specifies
-a disk path to the UFST support directory, which Monotype Imagong distributes
-in <em><code>ufst/fontdata/SUPPORT</code></em>. If UFST needs it and the
-command line argument is not specified, Ghostscript prints a warning and searches
-symbol set files in the current directory.</p>
-
-
-<p>
-Note that UFST and Free Type cannot handle some Ghostscript fonts because
-they do not include a PostScript interpreter and therefore have stronger restrictions on
-font formats than Ghostscript itself does - in particular, Type 3 fonts.
-If their font types are listed in <code>HookDiskFonts</code> or in
-<code>HookEmbeddedFonts</code>, Ghostscript interprets them as PS files,
-then serializes font data into a RAM buffer and passes it to FAPI as
-PCLEOs. (see the FAPI-related source code for details).</p>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/VectorDevices.htm b/doc/VectorDevices.htm
deleted file mode 100644
index c05a7ccf..00000000
--- a/doc/VectorDevices.htm
+++ /dev/null
@@ -1,1503 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>High Level Output Devices</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>High Level Output Devices</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Overview">Overview</a></li>
- <li><a href="#PXL">PCL-XL file output</a></li>
- <li><a href="#TXT">Text output</a></li>
- <li><a href="#DOCX">DOCX file output</a></li>
- <li><a href="#XPS">XPS file output</a></li>
- <li><a href="#PDFWRITE">PDF file output</a></li>
- <li>
- <ul>
- <li><a href="#COMMON">Common controls and features</a>
- <li><a href="#PSPDF_IN">Controls and features specific to PostScript and PDF input</a>
- <li><a href="#PXL_IN">Controls and features specific to PCL and PXL input</a>
- <li><a href="#PDF">PDF file output</a>
- <li><a href="#PS">PostScript file output</a>
- <li><a href="#EPS">EPS file output</a>
- </ul>
- </li>
- <li><a href="#PDFX">PDF/X-3 file output</a></li>
- <li><a href="#PDFA">PDF/A file output</a></li>
- <li><a href="#PPD">Ghostscript PDF printer description</a></li>
- <li><a href="#Extensions">pdfmark extensions</a></li>
- <li><a href="#Limitations">Limitations</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Readme.htm">Ghostscript overview</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Overview"></a>Overview</h2>
-
-<p>
-High level devices are Ghostscript output devices which do not render to a raster,
-in general they produce 'vector' as opposed to bitmap output. Such devices currently
-include: pdfwrite, ps2write, eps2write, txtwrite, xpswrite, pxlmono, pxlcolor and
-docxwrite.
-</p>
-
-<p>
-Although these devices produce output which is not a raster, they still work in the
-same general fashion as all Ghostscript devices. The input (PostScript, PDF, XPS, PCL
-or PXL) is handled by an appropriate interpreter, the interpreter processes the input
-and produces from it a sequence of drawing 'primitives' which are handed to the device.
-The device decides whether to handle the primitive itself, or call upon the graphics
-library to render the primitive to the final raster.
-</p>
-
-<p>
-Primitives are quite low level graphics operations; as an example consider the PDF
-sequence '0 0 100 100 re f'. This constructs a rectangle with the bottom left
-corner at 0,0 which is 100 units wide by 100 units high, and fills it with the current
-color. A lower level implementation using only primitives would first move the current
-point to 0,0, then construct a line to 0,100, then a line to 100,100, a line to 100, 0
-and finally a line back to 0,0. It would then fill the result.
-</p>
-
-<p>
-Obviously that's a simple example but it serves to demonstrate the point.
-</p>
-
-<p>
-Now the raster devices all call the graphics library to process primitives (though they
-may choose to take some action first) and render the result to a bitmap. The high level
-devices instead reassemble the primitives back into high level page description and
-write the result to a file. This means that the output, while it should be visually the
-same as the input (because it makes the same marks), is <b>not</b> the same as the
-original input, even if the output Page Description Language is the same as the input
-one was (eg PDF to PDF).
-</p>
-
-<p>
-Why is this important ? Firstly because the description of the page won't be the same,
-if your workflow relies upon (for example) finding rectangles in the description then
-it might not work after it has been processed by a high level device, as the
-rectangles may all have turned into lengthy path descriptions.
-</p>
-<p>In addition, any part of the original input which does not actually make marks on the
-page (such as hyperlinks, bookmarks, comments etc) will normally <b>not</b> be
-present in the output, even if the output is the same format. In general the PDF
-interpreter and the PDF output device (pdfwrite) try to preserve the non-marking
-information from the input, but some kinds of content are not carried across, in
-particular comments are not preserved.
-</p>
-
-<p>
-We often hear from users that they are 'splitting' PDF files, or 'modifying' them, or converting
-them to PDF/A, and it's important to realize that this is not what's happening. Instead,
-a new PDF file is being created, which should <b>look</b> the same as the original, but
-the actual insides of the PDF file are not the same as the original. This may not be a
-problem, but if it's important to keep the original contents, then you need to use
-a different tool (we'd suggest MuPDF, also available from Artifex). Of course, if the
-<b>intention</b> is to produce a modified PDF file (for example, reducing the resolution
-of images, or changing the colour space), then clearly you cannot keep the original
-contents unchanged, and pdfwrite performs these tasks well.
-</p>
-
-
-<hr>
-<h2><a name="PXL"></a>PCL-XL (PXL)</h2>
-
-<p>The <tt>pxlmono</tt> and <tt>pxlcolor</tt> devices output HP PCL-XL,
-a graphic language understood by many recent laser printers.
-
-<h3>Options</h3>
-<blockquote>
-<dl>
-<dt><code>-dCompressMode=<em>1 | 2 | 3</em></code> (default is 1)
-<dd>Set the compression algorithm used for bitmap graphics. RLE=1, JPEG=2, DeltaRow=3.
-When JPEG=2 is on, it is applied only to full-color images; indexed-color graphics
-and masks continues to be compressed with RLE.
-</dl></blockquote>
-
-<hr>
-<h2><a name="TXT"></a>Text output</h2>
-
-<p> The txtwrite device will output the text contained in the original
-document as Unicode.
-
-<h3>Options</h3>
-<blockquote>
-<dl>
-<dt><code>-dTextFormat=<em>0 | 1 | 2 | 3 | 4 </em></code> (default is 3)</dt>
- <dd>Format 0 is intended for use by developers and outputs XML-escaped Unicode
-along with information regarding the format of the text (position, font name,
-point size, etc). The XML output is the same format as the MuPDF output, but
-no additional processing is performed on the content, so no block detection.<p></dd>
-<dd>Format 1 uses the same XML output format, but attempts similar processing to
-MuPDF, and will output blocks of text. Note the algorithm used is not the same
-as the MuPDF code, and so the results will not be identical.<p></dd>
-<dd>Format 2 outputs Unicode (UCS2) text (with a Byte Order Mark) which
-approximates the layout of the text in the original document.<p></dd>
-<dd>Format 3 is the same as format 2, but the text is encoded in UTF-8.<p></dd>
-<dd>Format 4 is internal format similar to Format 0 but with extra information.<p></dd>
-</dl></blockquote>
-
-<p>
-
-<hr>
-<h2><a name="DOCX"></a>DOCX output</h2>
-
-<p>The docxwrite device creates a DOCX file suitable for use with applications
-such as Word or LibreOffice, containing the text in the original document.
-</p>
-<p>Rotated text is placed into textboxes. Heuristics are used to group
-glyphs into words, lines and paragraphs; for some types of formatting, these
-heuristics may not be able to recover all of the original document structure.
-</p>
-<p>This device currently has no special configuration parameters.</p>
-
-<p>
-
-<hr>
-<h2><a name="XPS"></a>XPS file output</h2>
-
-<p>The xpswrite device writes its output according to the Microsoft XML Paper Specification. This
-specification was later amended to the Open XML Paper specification, submitted to ECMA International
-and adopted as ECMA-388.
-</p>
-<p>This device currently has no special configuration parameters.</p>
-</p>
-<p>
-
-<hr>
-<h2><a name="PDFWRITE"></a>The family of PDF and PostScript output devices</h2>
-
-<blockquote><ul>
-<li><a href="#COMMON">Common controls and features</a>
-<li><a href="#PSPDF_IN">Controls and features specific to PostScript and PDF input</a>
-<li><a href="#PXL_IN">Controls and features specific to PCL and PXL input</a>
-<li><a href="#PDF">PDF file output</a>
-<li><a href="#PS">PostScript file output</a>
-<li><a href="#EPS">EPS file output</a>
-</ul></blockquote>
-
-<h3><a name="COMMON"></a>Common controls and features</h3>
-<p>
-The PDF and PostScript (including Encapsulated PostScript, or EPS) devices have much of their code
-in common, and so many of the controlling parameters are also common amongst the devices.
-The pdfwrite, ps2write and eps2write devices create PDF or PostScript files whose visual appearance should match, as closely
-as possible, the appearance of the original input (PS, PDF, XPS, PCL, PXL). There are a number of caveats
-as mentioned in the <a href="#Overview">overview</a> above. In addition to the general comments there are some additional points that
-bear mentioning;
-</p>
-<p>
-PCL has a graphics model which differs significantly from the PostScript or PDF one, in particular it has
-a form of transparency called RasterOps, some aspects of which cannot be represented in PDF at a high
-level (or at all, in PostScript). The pdfwrite device makes no attempt to handle this, and the resulting PDF file will <b>not</b> match
-the original input. The only way to deal with these types of file is to render the whole page to a bitmap
-and then 'wrap' the bitmap as a PDF file. Currently we do not do this either, but it is possible that a
-future enhancement may do so.
-</p>
-<p>
-If the input contains PDF-compatible transparency, but the ps2write device is selected, or the pdfwrite device
-is selected, but has been told to limit the PDF feature set to a version less than 1.4, the transparency
-cannot be preserved. In this case the entire page is rendered to a bitmap and that bitmap is 'wrapped up'
-in appropriate PDF or PostScript content. The output should be visually the same as the input, but since
-it has been rendered it will not scale up or down well, unlike the original, vector, content of the input.
-</p>
-
-<p>
-The <em>options</em> in the command line may include any switches that may
-be used with the language interpreter appropriate for the input (see <a
-href="Use.htm#Options">here</a> for a complete list). In addition the
-following options are common to all the pdfwrite family of devices, and should
-work when specified on the command line with any of the language interpreters.
-
-<dl>
-
-<dt><code>-r</code><em>resolution</em>
-<dd>Sets the resolution for pattern fills, for fonts that must be
-converted to bitmaps and any other rendering required (eg rendering
-transparent pages for output to PDF versions < 14). The default internal
-resolution for pdfwrite is 720dpi.
-
-<dt><code>-dUNROLLFORMS</code><dd>When converting from PostScript,
-pdfwrite (and ps2write) preserve the use of Form resources as Form
-XObjects in the output. Some badly written PostScript can cause this
-to produce incorrect output (the Quality Logic CET tests for example).
-By setting this flag, forms will be unrolled and stored in the output
-each time they are used, which avoids the problems. Note that the output
-file will of course be larger this way.
-We do not attempt to preserve Form XObjects from PDF files, unless they
-are associated with transparency groups.
-
-<dt><code>-dNoOutputFonts</code></dt><dd>Ordinarily the pdfwrite device family
-goes to considerable lengths to preserve fonts from the input as fonts
-in the output. However in some highly specific cases it can be useful to
-have the text emitted as linework/bitmaps instead. Setting this switch
-will prevent these devices from emitting any fonts, all text
-will be stored as vectors (or bitmaps in the case of bitmapped fonts)
-in the page content stream. Note that this will produce larger output
-which will process more slowly, render differently and particularly
-at lower resolution produce less consistent text rendering. Use with
-caution.
-
-<dt><code>-dCompressFonts=</code><em>boolean</em>
-<dd>Defines whether <code>pdfwrite</code> will compress embedded fonts in
-the output. The default value is <code>true</code>; the
-<code>false</code> setting is intended only for debugging as it will result in larger output.
-
-<dt><code>-dCompressStreams=</code><em>boolean</em>
-<dd>Defines whether <code>pdfwrite</code> will compress streams other than those in fonts or pages in
-the output. The default value is <code>true</code>; the
-<code>false</code> setting is intended only for debugging as it will result in larger output.
-
-</dl>
-<h4><a name="distillerparams"></a>Distiller Parameters</h4>
-<p>
-<em>Options</em> may also include
-<code>-d</code><em>parameter</em>=<em>value</em> or
-<code>-s</code><em>parameter</em>=<em>string</em> switches for setting
-"distiller parameters", Adobe's documented parameters for controlling the
-conversion of PostScript into PDF. The PostScript <code>setdistillerparams</code> and
-<code>currentdistillerparams</code> operators are also recognized when
-the input is PostScript, and provide an equivalent way to set these
-parameters from within a PostScript input file.
-</p>
-<p>Although the name implies that these parameters are for controlling PDF output, in
-fact the whole family of devices use these same parameters to control the conversion into
-PostScript and EPS as well.
-</p>
-
-<p>
-The pdfwrite family of devices recognize all of the Acrobat Distiller 5 parameters
-defined in the DistillerParameters (version 5) document available from the Adobe web site.
-Cells in the table below containing '=' mean that the value of the parameter is the same as in the
-"default" column.
-
-<blockquote>
-<table>
-<tr>
-<th align="left" style="width:31%">Parameter name</th>
-
-<th align="left" style="width:11.5%">Notes</th>
-
-<th align="left" style="width:11.5%">default</th>
-
-<th align="left" style="width:11.5%">screen</th>
-
-<th align="left" style="width:11.5%">ebook</th>
-
-<th align="left" style="width:11.5%">printer</th>
-
-<th align="left" style="width:11.5%">prepress</th>
-</tr>
-<tr valign=top><td><code>AlwaysEmbed</code></td><td><a href="#note_13">(13)</a></td><td>[ ]</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>AntiAliasColorImages</code></td><td><a href="#note_0">(0)</a></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>AntiAliasGrayImages</code></td><td><a href="#note_0">(0)</a></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>AntiAliasMonoImages</code></td><td><a href="#note_0">(0)</a></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>ASCII85EncodePages</code></td><td></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>AutoFilterColorImages</code></td><td><a href="#note_1">(1)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>AutoFilterGrayImages</code></td><td><a href="#note_1">(1)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>AutoPositionEPSFiles</code></td><td><a href="#note_0">(0)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>AutoRotatePages</code></td><td></td><td>/PageByPage</td><td>/PageByPage</td><td>/All</td><td>/None</td><td>/None</td></tr>
-<tr valign=top><td><code>Binding</code></td><td><a href="#note_0">(0)</a></td><td>/Left</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>CalCMYKProfile</code></td><td><a href="#note_0">(0)</a></td><td>()</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>CalGrayProfile</code></td><td><a href="#note_0">(0)</a></td><td>()</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>CalRGBProfile</code></td><td><a href="#note_0">(0)</a></td><td>()</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>CannotEmbedFontPolicy</code></td><td><a href="#note_0">(0)</a></td><td>/Warning</td><td>/Warning</td><td>/Warning</td><td>/Warning</td><td>/Error</td></tr>
-<tr valign=top><td><code>ColorACSImageDict</code></td><td><a href="#note_13">(13)</a></td><td><a href="#note_7">(note 7)</a></td><td><a href="#note_10">(note 10)</a></td><td><a href="#note_10">(note 10)</a></td><td><a href="#note_8">(note 8)</a></td><td><a href="#note_9">(note 9)</a></td></tr>
-<tr valign=top><td><code>ColorConversionStrategy</code></td><td><a href="#note_6">(6)</a></td><td>LeaveColorUnchanged</td><td>RGB</td><td>RGB</td><td>UseDeviceIndependentColor</td><td>LeaveColorUnchanged</td></tr>
-<tr valign=top><td><code>ColorImageDepth</code></td><td></td><td>-1</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>ColorImageDict</code></td><td><a href="#note_13">(13)</a></td><td><a href="#note_7">(note 7)</a></td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>ColorImageFilter</code></td><td></td><td>/DCTEncode</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>ColorImageDownsampleThreshold</code></td><td></td><td>1.5</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>ColorImageDownsampleType</code></td><td><a href="#note_3">(3)</a></td><td>/Subsample</td><td>/Average</td><td>/Average</td><td>/Average</td><td>/Bicubic</td></tr>
-<tr valign=top><td><code>ColorImageResolution</code></td><td></td><td>72</td><td>72</td><td>150</td><td>300</td><td>300</td></tr>
-<tr valign=top><td><code>CompatibilityLevel</code></td><td></td><td>1.7</td><td>1.5</td><td>1.5</td><td>1.7</td><td>1.7</td></tr>
-<tr valign=top><td><code>CompressPages</code></td><td><a href="#note_14">(14)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>ConvertCMYKImagesToRGB</code></td><td></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>ConvertImagesToIndexed</code></td><td><a href="#note_0">(0)</a></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>CoreDistVersion</code></td><td></td><td>4000</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>CreateJobTicket</code></td><td><a href="#note_0">(0)</a></td><td>false</td><td>false</td><td>false</td><td>true</td><td>true</td></tr>
-<tr valign=top><td><code>DefaultRenderingIntent</code></td><td></td><td>/Default</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>DetectBlends</code></td><td><a href="#note_0">(0)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>DoThumbnails</code></td><td><a href="#note_0">(0)</a></td><td>false</td><td>false</td><td>false</td><td>false</td><td>true</td></tr>
-<tr valign=top><td><code>DownsampleColorImages</code></td><td></td><td>false</td><td>true</td><td>true</td><td>false</td><td>false</td></tr>
-<tr valign=top><td><code>DownsampleGrayImages</code></td><td></td><td>false</td><td>true</td><td>true</td><td>false</td><td>false</td></tr>
-<tr valign=top><td><code>DownsampleMonoImages</code></td><td></td><td>false</td><td>true</td><td>true</td><td>false</td><td>false</td></tr>
-<tr valign=top><td><code>EmbedAllFonts</code></td><td></td><td>true</td><td>false</td><td>true</td><td>true</td><td>true</td></tr>
-<tr valign=top><td><code>EmitDSCWarnings</code></td><td><a href="#note_0">(0)</a></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>EncodeColorImages</code></td><td></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>EncodeGrayImages</code></td><td></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>EncodeMonoImages</code></td><td></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>EndPage</code></td><td><a href="#note_0">(0)</a></td><td>-1</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>GrayACSImageDict</code></td><td><a href="#note_13">(13)</a></td><td><a href="#note_7">(note 7)</a></td><td><a href="#note_7">(note 7)</a></td><td><a href="#note_10">(note 10)</a></td><td><a href="#note_8">(note 8)</a></td><td><a href="#note_9">(note 9)</a></td></tr>
-<tr valign=top><td><code>GrayImageDepth</code></td><td></td><td>-1</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>GrayImageDict</code></td><td><a href="#note_13">(13)</a></td><td><a href="#note_7">(note 7)</a></td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>GrayImageDownsampleThreshold</code></td><td></td><td>1.5</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>GrayImageDownsampleType</code></td><td><a href="#note_3">(3)</a></td><td>/Subsample</td><td>/Average</td><td>/Bicubic</td><td>/Bicubic</td><td>/Bicubic</td></tr>
-<tr valign=top><td><code>GrayImageFilter</code></td><td></td><td>/DCTEncode</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>GrayImageResolution</code></td><td></td><td>72</td><td>72</td><td>150</td><td>300</td><td>300</td></tr>
-<tr valign=top><td><code>ImageMemory</code></td><td><a href="#note_0">(0)</a></td><td>524288</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>LockDistillerParams</code></td><td></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>LZWEncodePages</code></td><td><a href="#note_2">(2)</a></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>MaxSubsetPct</code></td><td></td><td>100</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>MonoImageDepth</code></td><td></td><td>-1</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>MonoImageDict</code></td><td><a href="#note_13">(13)</a></td><td>&lt;&lt;K -1&gt;&gt;</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>MonoImageDownsampleThreshold</code></td><td></td><td>1.5</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>MonoImageDownsampleType</code></td><td></td><td>/Subsample</td><td>/Subsample</td><td>/Subsample</td><td>/Subsample</td><td>/Subsample</td></tr>
-<tr valign=top><td><code>MonoImageFilter</code></td><td></td><td>/CCITTFaxEncode</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>MonoImageResolution</code></td><td></td><td>300</td><td>300</td><td>300</td><td>1200</td><td>1200</td></tr>
-<tr valign=top><td><code>NeverEmbed</code></td><td><a href="#note_13">(13)</a></td><td><a href="#note_11">(note 11)</a><a href="#note_12">(note 12)</a></td><td><a href="#note_11">(note 11)</a><a href="#note_12">(note 12)</a></td><td><a href="#note_11">(note 11)</a><a href="#note_12">(note 12)</a></td><td>[ ]<a href="#note_12">(note 12)</a></td><td>[ ]<a href="#note_12">(note 12)</a></td></tr>
-<tr valign=top><td><code>OffOptimizations</code></td><td></td><td>0</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>OPM</code></td><td></td><td>1</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>Optimize</code></td><td><a href="#note_0">(0</a>,<a href="#note_5">5)</a></td><td>false</td><td>true</td><td>true</td><td>true</td><td>true</td></tr>
-<tr valign=top><td><code>ParseDSCComments</code></td><td></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>ParseDSCCommentsForDocInfo</code></td><td></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>PreserveCopyPage</code></td><td><a href="#note_0">(0)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>PreserveEPSInfo</code></td><td><a href="#note_0">(0)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>PreserveHalftoneInfo</code></td><td></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>PreserveOPIComments</code></td><td><a href="#note_0">(0)</a></td><td>false</td><td>false</td><td>false</td><td>true</td><td>true</td></tr>
-<tr valign=top><td><code>PreserveOverprintSettings</code></td><td></td><td>false</td><td>false</td><td>false</td><td>true</td><td>true</td></tr>
-<tr valign=top><td><code>sRGBProfile</code></td><td><a href="#note_0">(0)</a></td><td>()</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>StartPage</code></td><td><a href="#note_0">(0)</a></td><td>1</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>SubsetFonts</code></td><td></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>TransferFunctionInfo</code></td><td><a href="#note_4">(4)</a></td><td>/Preserve</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>UCRandBGInfo</code></td><td></td><td>/Remove</td><td>/Remove</td><td>/Remove</td><td>/Preserve</td><td>/Preserve</td></tr>
-<tr valign=top><td><code>UseFlateCompression</code></td><td><a href="#note_2">(2)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>UsePrologue</code></td><td><a href="#note_0">(0)</a></td><td>false</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>PassThroughJPEGImages</code></td><td><a href="#note_15">(15)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-<tr valign=top><td><code>PassThroughJPXImages</code></td><td><a href="#note_16">(16)</a></td><td>true</td><td>=</td><td>=</td><td>=</td><td>=</td></tr>
-</table></blockquote>
-
-<p>
-<a name="note_0">(note 0)</a>
-This parameter can be set and queried, but currently has no effect.
-
-<p>
-<a name="note_1">(note 1)</a>
-<code>-dAutoFilterxxxImages=false</code> works since Ghostscript version 7.30.
-Older versions of Ghostscript don't examine the image to
-decide between JPEG and LZW or Flate compression: they always use
-Flate compression.
-
-<p>
-<a name="note_2">(note 2)</a>
-Because the LZW compression scheme was covered by patents at the time this
-device was created, <code>pdfwrite</code> does not actually use LZW compression:
-all requests for LZW compression are ignored.
-<tt>UseFlateCompression</tt> is treated as always on, but the switch <code>CompressPages</code>
-can be set to false to turn off page level stream compression.
-Now that the patent has expired, we could change this should it become worthwhile.
-
-<p>
-<a name="note_3">(note 3)</a>
-The <code>xxxDownsampleType</code> parameters can also have the value
-/Bicubic (a Distiller 4 feature), this will use a Mitchell filter. (older
-versions of pdfwrite simply used Average instead). Note; if a non-integer
-downsample factor is used the code will clamp to the nearest integer (if
-the difference is less than 0.1) or will silently switch to the old bicubic
-filter, NOT the Mitchell filter.
-
-<p>
-<a name="note_4">(note 4)</a>
-The default for transfer functions is to preserve them, this is because transfer functions are
-a device-dependent feature, a set of transfer functions designed for an RGB device will give
-incorrect output on a CMYK device for instance. The pdfwrite device does now support /Preserve,
-/Apply and /Remove (the previous documentation was incorrect, application of transfer functions
-was not supported). PDF 2.0 deprecates the use of transfer functions, and so when producing PDF 2.0
-compatible output if the TransferFunctionInfor is set to /Preserve it will be silently replaced with /Apply.
-You can instead specifically set TransferFunctionInfo to /Remove when producing PDF 2.0 in order to
-avoid the transfer function being applied.
-
-<p>
-
-<a name="note_5">(note 5)</a>
-Use the -dFastWebView command line switch to 'optimize' output.
-<p>
-
-<a name="note_6">(note 6)</a>
-
-The value <code>UseDeviceIndependentColorForImages</code> works the same as
-<code>UseDeviceIndependentColor</code>.
-The value <code>sRGB</code> actually converts to RGB with the default Ghostscript conversion.
-The new Ghostscript-specific value <code>Gray</code> converts all colors to DeviceGray.
-With the introduction of new color conversion code in version 9.11 it is no longer necessary to
-set <code>ProcessColorModel</code> when selecting <code>Gray</code>, <code>RGB</code> or <code>CMYK</code>. It is also no
-longer necessary to set <code>UseCIEColor</code> for <code>UseDeviceIndependentColor</code> to
-work properly, and the use of <code>UseCIEColor</code> is now strongly discouraged.
-<p>
-<a name="note_7">(note 7)</a>
- The default image parameter dictionary is
-<blockquote><code>
-&lt;&lt; /QFactor 0.9 /Blend 1 /HSamples [2 1 1 2] /VSamples [2 1 1 2] &gt;&gt;
-</code></blockquote>
-
-<p>
-<a name="note_8">(note 8)</a>
-The printer ACS image parameter dictionary is
-<blockquote><code>
-&lt;&lt; /QFactor 0.4 /Blend 1 /ColorTransform 1 /HSamples [1 1 1 1] /VSamples [1 1 1 1] &gt;&gt;
-</code></blockquote>
-
-<p>
-<a name="note_9">(note 9)</a>
-The prepress ACS image parameter dictionary is
-<blockquote><code>
-&lt;&lt; /QFactor 0.15 /Blend 1 /ColorTransform 1 /HSamples [1 1 1 1] /VSamples [1 1 1 1] &gt;&gt;
-</code></blockquote>
-
-<p>
-<a name="note_10">(note 10)</a>
-The screen and ebook ACS image parameter dictionary is
-<blockquote><code>
-&lt;&lt; /QFactor 0.76 /Blend 1 /ColorTransform 1 /HSamples [2 1 1 2] /VSamples [2 1 1 2] &gt;&gt;
-</code></blockquote>
-
-<p>
-<a name="note_11">(note 11)</a>
-The default, screen, and ebook settings never embed the 14 standard fonts
-(Courier, Helvetica, and Times families, Symbol, and ZapfDingbats).
-This behaviour is intentional but can be overridden by:
-<blockquote><code>
-&lt;&lt; /NeverEmbed [ ] &gt;&gt; setdistillerparams
-</code></blockquote>
-
-<p>
-<a name="note_12">(note 12)</a>
-<code>NeverEmbed</code> can include CID font names.
-If a CID font is substituted in <code>lib/cidfmap</code>,
-the substitute font name is used when the CID font is embedded,
-and the original CID font name is used when it is not embedded.
-<code>NeverEmbed</code> should always specify the original CID font
-name.
-
-<p>
-<a name="note_13">(note 13)</A>
-The arrays <code>AlwaysEmbed</code> and <code>NeverEmbed</code> and
-image parameter dictionaries <code>ColorACSImageDict</code>,
-<code>ColorACSImageDict</code>, <code>ColorImageDict</code>,
-
-<code>GrayACSImageDict</code>, <code>GrayImageDict</code>,
-<code>MonoImageDict</code> cannot be specified on the command line.
-To specify these, you must use PostScript, either by including it in the PostScript source
-or by passing the <code>-c</code> command-line parameter to ghostscript as described in <a href="#Limitations">Limitations</A> below.
-For example, including the PostScript string in your file <tt>in.ps</tt>:
-<blockquote><tt>&lt;&lt;/AlwaysEmbed [/Helvetica /Times-Roman]&gt;&gt; setdistillerparams</tt></blockquote>
-is equivalent to invoking:
-
-<blockquote><code>gs -dBATCH -dSAFER -DNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf -c
-'&lt;&lt;/AlwaysEmbed [/Helvetica /Times-Roman]&gt;&gt; setdistillerparams' -f
-in.ps</code></blockquote>
-
-or using the extra parameters in a file:
-
-<blockquote><code>@params.in</code></blockquote>
-
-where the file <b>params.in</b> contains:
-
-<blockquote><code>-c '&lt;&lt;/AlwaysEmbed [/Helvetica /Times-Roman]&gt;&gt; setdistillerparams' -f
-in.ps</code></blockquote>
-
-<p>
-<a name="note_14">(note 14)</a>
-The default value of <code>CompressPages</code> is <code>false</code> for ps2write and eps2write.
-
-<p>
-<a name="note_15">(note 15)</a>
-When <code>true</code> image data in the source which is encoded using the DCT (JPEG) filter will not be decompressed
-and then recompressed on output. This prevents the multiplication of JPEG artefacts caused by lossy compression.
-</code><code>PassThroughJPEGImages</code> currently only affects simple JPEG images. It has no effect on JPX (JPEG2000) encoded images (see below)
-or masked images. In addition this parameter will be ignored if the pdfwrite device needs to modify the source data. This can happen if the image
-is being downsampled, changing colour space or having transfer functions applied. Note that this parameter essentially overrides
-the 'EncodeColorImages' and 'EncodeGrayImages' parameters if they are false, the image will still be written with a DCTDecode filter. NB this
-feature currently only works with PostScript or PDF input, it does not work with PCL, PXL or XPS input.
-
-<p>
-<a name="note_16">(note 16)</a>
-When <code>true</code> image data in the source which is encoded using the JPX (JPEG 2000) filter will not be decompressed
-and then recompressed on output. This prevents the multiplication of JPEG artefacts caused by lossy compression.
-</code><code>PassThroughJPXImages</code> currently only affects simple JPX encoded images. It has no effect on JPEG encoded images (see above)
-or masked images. In addition this parameter will be ignored if the pdfwrite device needs to modify the source data. This can happen if the image
-is being downsampled, changing colour space or having transfer functions applied. Note that this parameter essentially overrides
-the 'EncodeColorImages' and 'EncodeGrayImages' parameters if they are false, the image will still be written with a JPXDecode filter. NB this
-feature currently only works with PostScript or PDF input, it does not work with PCL, PXL or XPS input.
-
-<h4><a name="Color_Conversion_and_Management"></a>Color Conversion and Management</h4>
-<p>
-As of the 9.11 pre-release, the color management in the pdfwrite family has been substantially
-altered so that it now uses the same Color Management System as rendering (the default
-is LCMS2). This considerably improves the color handling in both pdfwrite and ps2write,
-particularly in the areas of Separation and DeviceN color spaces, and Indexed color
-spaces with images.
-</p>
-
-<p>Note that while pdfwrite uses the same CMS as the rendering devices, this does not mean that the entire suite of options is available, as described
-in the GS9_Colour Management.pdf file. The colour management code has no effect at all unless either ColorConversionStrategy
-or ConvertCMYKImagesToRGB is set, or content has to be rendered to an image (this is rare and usually required only when
-converting a PDF file with transparency to a version < PDF 1.4).
-</p>
-<p>Options based on object type (image, text, linework) are not used, all objects are converted using the same scheme.
-<code>-dKPreserve</code> has no effect because we will not convert CMYK to CMYK. <code>-dDeviceGrayToK</code> also has no effect;
-when converting to CMYK DeviceGray objects are left in DeviceGray since that can be mapped directly to the K channel.</p>
-
-The <code>ColorConversionStrategy</code> switch can now be set to <code>LeaveColorUnchanged</code>, <code>Gray</code>, <code>RGB</code>, <code>CMYK</code> or
-<code>UseDeviceIndependentColor</code>. Note that, particularly for ps2write, <code>LeaveColorUnchanged</code> may still need to convert
-colors into a different space (ICCbased colors cannot be represented in PostScript for example). <code>ColorConversionStrategy</code> can be specified either as; a string
-by using the <code>-s</code> switch (<code>-sColorConversionStrategy=RGB</code>) or as a name using the <code>-d</code> switch (<code>-dColorConversionStrategy=/RGB</code>).
-</p>
-<p>ps2write cannot currently convert into device-independent color spaces, and so <code>UseDeviceIndependentColor</code>should not be used with ps2write (oe eps2write).
-</p>
-<p>All other color spaces are converted appropriately. Separation and DeviceN spaces will be preserved if possible (ps2write cannot preserve DeviceN or Lab)
-and if the alternate space is not appropriate a new alternate space will be created. Eg a [/Separation (MyColor) /DeviceRGB {...}]
-when the <code>ColorConversionStrategy</code> is set to <code>CMYK</code> would be converted to [/Separation (MyColor) /DeviceCMYK {...}]
-The new tint transform will be created by sampling the original tint transform, converting the RGB values into CMYK, and then creating
-a function to linearly interpolate between those values.</p>
-
-The <code>PreserveSeparation</code> switch now controls whether the pdfwrite family of devices will attempt to preserve Separation spaces. If this is set to false then
-all Separation colours will be converted into the current device space specified by ProcessColorModel.
-</p>
-
-<h4><a name="Orientation"></a>Setting page orientation</h4>
-
-<p>
-By default Ghostscript determines viewing page orientation based on the dominant
-text orientation on the page. Sometimes, when the page has text in several
-orientations or has no text at all, wrong orientation can be selected.
-
-<p>
-Acrobat Distiller parameter <code>AutoRotatePages</code> controls the
-automatic orientation selection algorithm. On Ghostscript, besides
-input stream, Distiller parameters can be given as command line arguments.
-For instance: <code>-dAutoRotatePages=/None</code> or
-<code>/All</code> or <code>/PageByPage</code>.
-
-<p>
-When there is no text on the page or automatic page rotation is set to
-<code>/None</code> an orientation value from setpagedevice is used.
-Valid values are: <code>0</code> (portrait),
-<code>3</code> (landscape), <code>2</code> (upside down),
-and <code>1</code> (seascape). The orientation can be set from the
-command line as <code>-c "&lt;&lt;/Orientation 3&gt;&gt; setpagedevice"</code>
-using Ghostscript directly but cannot be set in <code>ps2pdf</code>.
-See <a href="#Limitations">Limitations</a> below.
-
-<p>
-Ghostscript passes the orientation values from DSC comments to the
-<code>pdfwrite</code> driver, and these are compared with the
-auto-rotate heuristic. If they are different then the DSC value will be used preferentially.
-If the heuristic is to be preferred over the DSC comments then comment parsing
-can be disabled by setting <code>-dParseDSCComments=false</code>.
-<p>
-
-<h3><a name="PSPDF_IN"></a>Controls and features specific to PostScript and PDF input</h3>
-<dl><dt><code>-dPDFSETTINGS=</code><em>configuration</em></dt>
-<dd>Presets the "distiller parameters" to one of four predefined settings:</dd>
-</dl>
-<ul>
-
-<li><code>/screen</code> selects low-resolution output similar to the
-Acrobat Distiller (up to version X) "Screen Optimized" setting.</li>
-
-<li><code>/ebook</code> selects medium-resolution output similar to the
-Acrobat Distiller (up to version X) "eBook" setting.</li>
-
-<li><code>/printer</code> selects output similar to the Acrobat Distiller
-"Print Optimized" (up to version X) setting.</li>
-
-<li><code>/prepress</code> selects output similar to Acrobat Distiller
-"Prepress Optimized" (up to version X) setting.</li>
-
-<li><code>/default</code> selects output intended to be useful across a
-wide variety of uses, possibly at the expense of a larger output file.</li>
-
-</ul>
-<p>
-NB Adobe has recently changed the names of the presets it uses in Adobe Acrobat Distiller,
-in order to avoid confusion with earlier versions we do not plan to change the
-names of the PDFSETTINGS parameters. The precise value for each control is listed
-in the table <a href="#distillerparams">above</a>.
-</p>
-
-<dl><dt></dt>
-<dd>Please be aware that the <code>/prepress</code> setting does <b>not</b> indicate
-the highest quality conversion. Using any of these presets will involve altering the
-input, and as such may result in a PDF of poorer quality (compared to the input) than
-simply using the defaults. The 'best' quality (where best means closest to the original
-input) is obtained by not setting this parameter at all (or by using <code>/default</code>).
-</dd>
-
-<dd>The PDFSETTINGS presets should only be used if you are sure you understand that the
-output will be altered in a variety of ways from the input. It is usually better to
-adjust the controls individually (see the table below) if you have a genuine requirement to produce,
-for example, a PDF file where the images are reduced in resolution.
-</dd>
-</dl>
-
-<h3><a name="PXL_IN"></a>Controls and features specific to PCL and PXL input</h3>
-<p>
-Many of the controls used for <a href="#distillerparams">distiller parameters</a> can be used on the command line with the -d or -s
-switches, and these will work correctly with PCL or PXL input. However, some controls (eg /NeverEmbed) do
-not take simple numeric or string arguments, and these cannot be set from the command line. When
-the input is PostScript or PDF we can use the -c and -f switches to send PostScript through
-the interpreter to control these parameters, but clearly this is not possible when the interpreter
-does not understand PostScript. In addition some features are controlled using the PostScript
-<code>pdfmark</code> operator and again that clearly is not possible unless we are using a PostScript
-interpreter to read the input.
-</p>
-<p>
-To overcome this new, GhostPCL-specific, PJL parameters have been added. These parameters are defined
-as <code>PDFMARK</code> and <code>SETDISTILLERPARAMS</code>. In order to reduce confusion when using
-PostScript and PCL as inputs these PJL parameters take essentially the same PostScript constructs as
-the corresponding PostScript operators <code>pdfmark</code> and <code>setdistillerparams</code>. However
-it is important to realise that these are <b>not</b> processed by a full PostScript interpreter, and
-there are syntactic rules which must be followed carefully when using these parameters.
-</p>
-<p>
-You cannot use arbitrary PostScript operators, only boolean, number, name, string, array and dictionary
-objects are supported (but see <code>PUTFILE</code> later). All tokens <b>must</b> be separated by white space, so
-while this <code>[/Test(string)]</code> is perfectly valid in PostScript, you must instead write it
-as <code>[ /Test (string) ]</code> for PJL parsing. All <code>PDFMARK</code> and <code>SETDISTILLERPARAMS</code> must be set as
-DEFAULT, the values must be on a single line, and delimited by "".
-</p>
-<p>
-pdfmarks sometimes require the insertion of file objects (especially for production of PDF/A files) so
-we must find some way to handle these. This is done (for the pdfmark case only) by defining a special
-(non-standard) pdfmark name <code>PUTFILE</code>, this simply takes the preceding string, and uses
-it as a fully qualified path to a file. Any further pdfmark operations can then use the named object
-holding the file to access it.
-</p>
-<p>
-The easiest way to use these parameters is to create a 'settings' file, put all the commands in it,
-and then put it on the command line immediately before the real input file. For example:
-</p>
-<code>
-./gpcl6 -sDEVICE=pdfwrite -dPDFA=1 -dCompressPages=false -dCompressFonts=false -sOutputFile=./out.pdf ./pdfa.pjl ./input.pcl
-</code></p>
-<p>
-Where pdfa.pjl contains the PJL commands to create a PDF/A-1b file (see example below).</p>
-<p>
-<h4>Example creation of a PDF/A output file</h4>
-<p>For readability the line has been bisected, when used for real this must be a single line. The 'ESC' represents
-a single byte, value 0x1B, an escape character in ASCII. The line must end with an ASCII newline (\n, 0x0A) and this must be the only newline following the @PJL.
-The line breaks between "" below should be replaced with space characters, the double quote charcters (") are required.</p>
-<code>
-</p>
-<pre>
-ESC%-12345X
-@PJL DEFAULT PDFMARK = "
-[ /_objdef {icc_PDFA} /type /stream /OBJ pdfmark
-[ {icc_PDFA} << /N 3 >> /PUT pdfmark
-[ {icc_PDFA} (/ghostpdl/iccprofiles/default_rgb.icc) /PUTFILE pdfmark
-[ /_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark
-[ {OutputIntent_PDFA} << /S /GTS_PDFA1 /Type /OutputIntent /DestOutputProfile {icc_PDFA} /OutputConditionIdentifier (sRGB) >> /PUT pdfmark
-[ {Catalog} << /OutputIntents [{OutputIntent_PDFA}] >> /PUT pdfmark
-[ /Author (Ken) /Creator (also Ken) /Title (PDF/A-1b) /DOCINFO pdfmark
-"
-</pre>
-</code>
-<h4>Example using DISTILLERPARAMS to set the quality of JPEG compression.</h4>
-<p>
-<code>
-ESC%-12345X
-@PJL DEFAULT SETDISTILLERPARAMS = "<< /ColorImageDict << /QFactor 0.7 /Blend 1 /HSamples [ 2 1 1 2 ] /VSamples [ 2 1 1 2 ] >> >>"
-</code>
-</p>
-
-<h3><a name="PDF"></a>PDF file output</h3>
-<dl>
-<dt><code>-dMaxInlineImageSize=</code><em>integer</em>
-<dd>Specifies the maximum size of an inline image, in bytes. For images larger
-than this size, <code>pdfwrite</code> will create an XObject instead of embedding
-the image into the context stream.
-The default value is <code>4000</code>.
-Note that redundant inline images must be embedded each time they occur in the
-document, while multiple references can be made to a single XObject image. Therefore
-it may be advantageous to set a small or zero value if the source document is expected
-to contain multiple identical images, reducing the size of the generated PDF.<p></dd>
-
-<dt><code>-dDoNumCopies</code>
-<dd>When present, causes pdfwrite to use the #copies or /NumCopies entry in the page
-device dictionary to duplicate each page in the output PDF file as many times as
-the 'copies' value. This is intended for use by workflow applications like CUPS
-and should not be used for generating general purpose PDF files. In particular any
-pdfmark operations which rely on page numbers, such as Link or Outline annotations
-will not work correctly with this flag.<p></dd>
-
-<dt><code>-dDetectDuplicateImages</code>
-<dd> Takes a Boolean argument, when set to true (the default) pdfwrite will compare all new
- images with all the images encountered to date (NOT small images which are stored in-line) to see if the new image
- is a duplicate of an earlier one. If it is a duplicate then instead of writing a new image into the PDF file,
- the PDF will reuse the reference to the earlier image.
- This can considerably reduce the size of the output PDF file, but increases the
- time taken to process the file.
- This time grows exponentially as more images are added, and on large input files with
- numerous images can be prohibitively slow. Setting this to false will improve performance at the cost of final file size.<p></dd>
-
-<dt><code>-dFastWebView</code>
-<dd> Takes a Boolean argument, default is false. When set to true pdfwrite will
-reorder the output PDF file to conform to the Adobe 'linearised' PDF specification.
-The Acrobat user interface refers to this as 'Optimised for Fast Web Viewing'.
-Note that this will cause the conversion to PDF to be slightly slower and will
-usually result in a slightly larger PDF file.</dd>
-<dd>This option is incompatible with producing an encrypted (password protected) PDF file.<p></dd>
-</dt>
-</dl>
-
-<dl>
- <dt><code>-dPreserveAnnots=</code><em>boolean</em>
- <dd>We now attempt to preserve most annotations from input PDF files as annotations in the output PDF file (note, not in output PostScript!)
- There are a few annotation types which are not preserved, most notably Link and Widget annotations. However, should you wish to revert
- to the old behaviour, or find that the new behaviour leads to problems, you can set this switch to false which will cause all annotations to be
- inserted into the page content stream, instead of preserved as annotations.
- <p> In addition, finer control is available by defining an array
- <code>/PreserveAnnotTypes</code>. Annotation types listed in this array will
- be preserved, whilst those not listed will be drawn according to the setting os ShowAnnots and ShowAnnotTypes.
- By using the controls PreserveAnnots, PreserveAnnotTypes, ShowAnnots and ShowAnnotTypes it is possible to select
- by annotation type whether annotations are preserved as annotations, drawn into the page, or simply dropped.
- </p>
- <p> To use this feature:
- <code>-c "/PreserveAnnotTypes [....] def" -f &ltinput file&gt</code>
- <br> Where the array can contain one or more of the following names:
- <code>/Stamp</code>, <code>/Squiggly</code>, <code>/Underline</code>, <code>/Link</code>, <code>/Text</code>, <code>/Highlight</code>, <code>/Ink</code>, <code>/FreeText</code>, <code>/StrikeOut</code> and <code>/stamp_dict</code>.</p>
- <p> For example, adding the follow to the command line:
- <code>-c "/PreserveAnnotTypes [/Text /UnderLine] def" -f &ltinput file&gt</code>
- <br> would preserve only annotations with the subtypes &quotText&quot and &quotUnderLine&quot</p>
- </dd>
- </dt>
-</dl>
-
-<dl>
- <dt><code>-dPreserveMarkedContent=</code><em>boolean</em></dt>
- <dd>We now attempt to preserve marked content from input PDF files through to the output PDF file (note, not in output PostScript!)
- This does not include marked content relating to optional content, because currently we do not preserve optional content, it is
- instead applied by the interpreter.
- <p>
- This control also requires the PDF interpreter to pass the marked content to the pdfwrite device, this is only done with the
- new (C-based) PDF interpreter. THe old (PostScript-based) interpreter does not support this feature and will not pass marked
- content to the pdfwrite device.
- </p>
- </dd>
-</dl>
-
-The following options are useful for creating PDF 1.2 files:
-<p>
-
-<dl>
-
- <dt><code>-dPatternImagemask=<em>boolean</em></code></dt>
- <dd>With <code>CompatibilityLevel &lt; 1.3 </code> it specifies whether
- the target viewer handles <code>ImageMask</code> with a pattern color.
- Some old viewers, such as Ghostscript 3.30 fail with such constructs.
- Setting this option to false, one can get more compatibility,
- but the mask interpolation is lost.
- With <code>CompatibilityLevel &ge; 1.3 </code> this option is ignored.
- Default value is <code>false</code>.<p></dd>
-
- <dt><code>-dMaxClipPathSize=<em>integer</em></code></dt>
- <dd>Specifies the maximum number of elements in the clipping path
- that the target viewer can handle. This option is used only with
- <code>CompatibilityLevel &lt; 1.3</code> and
- <code>PatternImagemask=false</code>,
- and only when converting a mask into a clipping path.
- If the clipping path exceeds the specified size,
- the masked image and the clipping path is decomposed into smaller images.
- The value of the option counts straight path segments
- (curved segments are not used for representing a mask).
- Default value is <code>12000</code>.<p></dd>
-
- <dt><code>-dMaxShadingBitmapSize=<em>integer</em></code></dt>
- <dd>Specifies the maximum number of bytes allowed for representing a shading as a bitmap.
- If a shading exceeds this value, the resolution of the output bitmap
- is reduced to fit into the specified number of bytes.
- Note that the number of bytes depends on the number of color components
- in <code>ProcessColorModel</code> or <code>ColorConversionStrategy</code>, assumes 8 bits per sample,
- and doesn't consider image compression or downsampling. The image is rendered at the current resolution
- as specified by <code>-r</code> or the default of 720 dpi.
-
- Default value is <code>256000</code>.
- In general larger values will result in higher quality,
- but the output file size may increase dramatically, particularly with shadings which cover large areas.
-
- Shadings should generally only be rendered to images if <code>CompatibilityLevel</code> is 1.2 or less
- or if <code>ColorCoversionStrategy</code> specifies a color space different to that of the shading.<p></dd>
-
- <dt><code>-dHaveTrueTypes=<em>boolean</em></code></dt>
- <dd>With <code>CompatibilityLevel &lt; 1.3</code> it specifies
- whether the target viewer can handle TrueType fonts.
- If not, TrueType fonts are converted into raster fonts
- with resolution specified in <code>HWResolution</code>. Note that large text at higher resolutions
- results in very large bitmaps which are likely to defeat caching in many printers. As a result the
- text is emitted as simple images rather than as a (type 3) bitmap font. The PostScript user parameter
- MaxFontItem can be used to increase the maximum size of a cache entry which will increase the size/resolution
- of the text which can be stored in a font.
- With <code>CompatibilityLevel &ge; 1.3</code> this option is ignored. Default value is <code>true</code>.
- </dd>
-</dl>
-
-<p>
-The following options are useful for creating PDF 1.3 files:
-<p>
-
-<dl>
-
- <dt><code>-dHaveTransparency=<em>boolean</em></code></dt>
- <dd>With <code>CompatibilityLevel &ge; 1.4</code> it specifies
- whether the target viewer can handle PDF 1.4 transparency objects.
- If not, the page is converted into a single plain image with all
- transparency flattened.
- Default value is <code>true</code>.</dd>
-
-</dl>
-
-<h4>The following option specifies creation of a PDF/X-3 file</h4>
-
-<dl>
-<dt><code>-dPDFX=</code><em>boolean</em>
-<dd>Specifies the generated document is to follow the PDF/X-3 standard.
-When true, a <code>DefaultRGB</code> <code>ColorSpace</code> resource
-must be defined, and options <code>NOSUBSTDEVICECOLORS</code>,
-<code>NOCIE</code> must not be specified.
-Default value is <code>false</code>.
-<p>The pdfwrite device does not currently support PDF/X versions other than 3.</p>
-</dl>
-
-<p>
-
-When generating a PDF/X-3 document, Ghostscript performs the following
-special actions to satisfy the PDF/X-3 standard:
-<ul>
- <li> All fonts are embedded.</li>
- <li> <code>DeviceRGB</code> color space is substituted with
- <code>the DefaultRGB</code> color space,
- which must be defined in the <code>ColorSpace</code> category.
- The easiest way is to provide it in the <code>DefaultRGB</code> file in the resource directory.</li>
- <li> <code>DeviceRGB</code> color values are passed unchanged.
- If a user needs a non trivial color adjustment, a non trivial
- <code>DefaultRGB</code> color space must be defined.</li>
- <li> Transfer functions and halftone phases are skipped.</li>
- <li> <code>/PS pdfmark</code> interprets the <code>DataSource</code>
- stream or file.</li>
- <li><code>TrimBox</code> and <code>BleedBox</code> entries
- are generated in page descriptions.
- Their values can be changed using the
- <code>PDFXTrimBoxToMediaBoxOffset</code>,
- <code>PDFXSetBleedBoxToMediaBox</code>, and
- <code>PDFXBleedBoxToTrimBoxOffset</code>
- distiller parameters (see below).</li>
-</ul>
-
-
-<h4><a name="Encryption"></a>
-The following switches are used for creating encrypted documents :
-</h4>
-
-<dl>
-<dt><code>-sOwnerPassword=</code><em>string</em></dt>
-<dd>Defines that the document be encrypted with the specified
-owner password.</dd>
-</dl>
-
-<dl>
-<dt><code>-sUserPassword=</code><em>string</em></dt>
-<dd>Defines the user password for opening the document.
-If empty, the document can be opened with no password,
-but the owner password is required to edit it.</dd>
-</dl>
-
-<dl>
-<dt><code>-dPermissions=</code><em>number</em></dt>
-<dd>Defines the PDF permissions flag field. Negative values are allowed
-to represent unsigned integers with the highest bit set. See the PDF
-Reference manual for the meaning of the flag bits.</dd>
-</dl>
-
-<dl>
-<dt><code>-dEncryptionR=</code><em>number</em></dt>
-<dd>Defines the encryption method revision number - either 2 or 3.</dd>
-</dl>
-
-<dl>
-<dt><code>-dKeyLength=</code><em>number</em></dt>
-<dd>Defines the length (in bits) of the encryption key.
-Must be a multiple of 8 in the interval [40, 128].
-If the length isn't 40, <code>-dEncryptionR</code> must be 3.</dd>
-</dl>
-
-
-<h4><a name="Metadata"></a>
-The following switches are used for generating metadata according to the Adobe XMP specification :
-</h4>
-
-<dl>
-<dt><code>-sDocumentUUID=</code><em>string</em></dt>
-<dd>Defines a DocumentID to be included into the document Metadata.
-If not specified, Ghostscript generates an UUID automatically.
-Otherwise the specified string is copied into the document without
-checking its syntax or consistence.
-<p>
-Note that Adobe XMP specification requires DocumentID must be same
-for all versions of a document. Since Ghostscript does not provide
-a maintenance of document versions, users are responsible to provide
-a correct UUID through this parameter.
-<p>
-Note that Ghostscript has no assess to the host node ID
-due to a minimization of platform dependent modules.
-Therefore it uses an MD5 hash of the document contents for generating UUIDs.</p>
-</dl>
-
-<dl>
-<dt><code>-sInstanceUUID=</code><em>string</em>
-<dd>Defines a instance ID to be included into the document Metadata.
-If not specified, Ghostscript generates an UUID automatically.
-Otherwise the specified string is copied into the document without
-checking its syntax or consistence.
-<p>
-Note that the Adobe XMP specification requires the instance ID to be unique
-for all versions of the document. This parameter may be used to disable
-unique ID generation for debug purposes.
-
-<p>
-When none of <code>DocumentUUID</code>
-and <code>InstanceUUID</code> are specified,
-the generated DocumentID appears same as instance ID.
-</dl>
-
-<dl>
-<dt><code>-sDocumentTimeSeq=</code><em>integer</em>
-<dd>Defines an integer to be used as a deconflictor for generating
-UUIDs, when several invocations of Ghostscript create
-several PDF documents within same clock quantum (tick).
-Mainly reserved for very fast computers and/or multithreading applications,
-which may appear in future. If both <code>DocumentUUID</code>
-and <code>InstanceUUID</code> are specified, <code>DocumentTimeSeq</code> is ignored.
-</dl>
-
-<dl>
-<dt><code>-sDSCEncoding=</code><em>string</em>
-<dd>Defines the name of a Postscript encoding in which
-DSC comments in the source document are encoded.
-If specified, the comments are converted
-from that encoding into Unicode UTF-8 when writing <code>Metadata</code>.
-If not specified, the comments are copied to <code>Metadata</code>
-with no conversion. Note that Adobe Distiller for
-Windows uses the default locale's code page
-for this translation, so it's result may differ from Ghostscript.
-Adobe Acrobat appears to use <code>PDFDocEncoding</code> when
-displaying document's properties,
-so we recommend this value.
-</dl>
-
-<dl>
-
-<dt><a name="UseOCR"></a><code>-sUseOCR=</code><em>string</em>
-<dd>Controls the use of OCR in pdfwrite. If enabled this will use an OCR
-engine to analyse the glyph bitmaps used to draw text in a PDF file, and
-the resulting Unicode code points are then used to construct a ToUnicode
-CMap.
-<p>
-PDF files containing ToUnicode CMaps can be searched, use copy/paste and
-extract the text, subject to the accuracy of the ToUnicode CMap. Since not all
-PDF files contain these it can be beneficial to create them.
-</p>
-<p>
-Note that, for English text, it is possible that the existing standard character
-encoding (which most PDF consumers will fall back to in the absence of Unicode
-information) is better than using OCR, as OCR is not a 100% reliable process.
-OCR processing is also comparatively slow.
-</p>
-<p>
-For the reasons above it is useful to be able to exercise some control over the
-action of pdfwrite when OCR processing is available, and the <code>UseOCR</code>
-parameter provides that control. There are three possible values:
-</p>
-<ul>
-<li><code>Never</code> Default - don't use OCR at all even if support is built-in.</li>
-<li><code>AsNeeded</code> If there is no existing ToUnicode information, use OCR.</li>
-<li><code>Always</code> Ignore any existing information and always use OCR.</li>
-</ul>
-<p>
-Our experimentation with the Tesseract OCR engine has shown that the more text we
-can supply for the engine to look at, the better the result we get. We are, unfortunately,
-limited to the graphics library operations for text as follows.
-</p>
-<p>
-The code works on text 'fragments'; these are the text sequences sent to the text
-operators of the source language. Generally most input languages will try to send
-text in its simplest form, eg "Hello", but the requirements of justification, kerning
-and so on mean that sometimes each character is positioned independently on the page.
-</p>
-<p>
-So pdfwrite renders all the bitmaps for every charcter in the text document, when
-set up to use OCR. Later, if any character in the font does not have a Unicode
-value already we use the bitmaps to assemble a 'strip' of text which we then send
-to the OCR engine. If the engine returns a different number of recognised characters
-than we expected then we ignore that result. We've found that (for English text)
-constructions such as ". The" tend to ignore the full stop, presumably because the OCR
-engine thinks that it is simply noise. In contrast "text." does identify the full
-stop correctly. So by ignoring the failed result we can potentially get a better result
-later in the document.
-</p>
-<p>
-Obviously this is all heuristic and undoubtedly there is more we can do to improve the
-functionality here, but we need concrete examples to work from.
-</p>
-</dd>
-</dt>
-</dl>
-
-<h3><a name="PS"></a>PostScript file output</h3>
-<p>
-The <code>ps2write</code> device handles the same set of distiller
-parameters as
-are handled by the <code>pdfwrite</code> device (and 2 unique extensions, see below).
-<p>
-The option <code>-dMaxInlineImageSize=</code><em>integer</em>
-must not be used with <code>ps2write</code> as all images are inline in PostScript.
-</p>
-
-<a name="AdditionalDistillerParams"></a>
-<p>
-There are also two additional (not Adobe-standard) Distiller parameters, specific to ps2write:
-<dl>
-<dt>
-<code>/PSDocOptions</code><em> string</em>
-<dd>No default value. If defined, the contents of the string will be emitted in the output PostScript prolog
-enclosed within %%BeginSetup and %%EndSetup comments. This is intended as a means of introducing device-specific document wide
-setup or configuration options into the output. Default media selection, printer resolution etc might be included here.
-
-<code>/PSPageOptions</code><em> array of strings</em>
-</dd>
-<dd>No default value. If defined, the contents of the strings in the array will be emitted in the output PostScript at the start
-of each page, one string per page, enclosed within %%BeginPageSetup and %%EndPageSetup comments. This is intended as a means of introducing device-specific
-setup or configuration options into the output on a page by page basis. The strings are used from the array sequentially, if there are more
-pages than strings then we 'wrap round' and start again with the first string. This makes it convenient to do setup for even/odd pages
-by simply including 2 strings in the array.
-
-<p>
-Note: executing setpagedevice will reset distiller parameters to the default, if you use any of these options via setdistillerparams, and
- expect to execute setpagedevice, you should set /LockDistillerParams true. Ordinarily the PDF interpreter executes setpagedevice for
- every page in order to set the media size.
-</p>
-</dd>
-</dt>
-</dl>
-
-<p>
-NB the strings contained in PSDocOptions, and the PSPageOptions array, are written verbatim to the output. No error checking is (or can be) performed on these strings
-and it is the users responsibility to ensure they contain well formed PostScript which does not cause errors on the target device.
-</p>
-</p>
-<p>
-There are also the following ps2write specific options :
-<p>
-
-<dl>
-<dt>
-<code>-dProduceDSC=</code><em>boolean</em>
-<dd> Default value is true. When this value is true the output PostScript file will be constructed in a way which is compatible with the Adobe Document Structuring Convention, and will include a set of comments appropriate for use by document managers. This enables features such as page extraction, N-up printing and so on to be performed. When set to false, the output file will not be DSC-compliant. Older versions of Ghostscript cannot produce DSC-compliant output from ps2write, and the behaviour for these older versions matches the case when <code>ProduceDSC</code> is false.
-</dl>
-
-<dl>
-<dt>
-<code>-dCompressEntireFile=</code><em>boolean</em>
-<dd>When this parameter is true, the <code>LZWEncode</code>
-and <code>ASCII85Encode</code> filters will be applied to the entire output file.
-In this case <code>CompressPages</code> should be false to prevent a dual compression.
-When this parameter is false, these filters will be applied to the initial procset only,
-if <code>CompressPages</code> is true.
-Default value is <code>false</code>.
-</dl>
-<p>
-Note: It is not possible to set <code>CompressEntireFile</code> when <code>ProduceDSC</code> is true as a single compressed object cannot conform to the DSC. It is possible to set <code>CompressPages</code> which will also compress the ps2write ProcSet.
-</p>
-<h4><a name="printer_control"></a>Controlling device-specific behavior</h4>
-
-<p>
-A few options can be used to influence the behavior of a printer or
-PostScript interpreter that reads the result of ps2ps2. All of these options
-are incompatible with DSC-compliant PostScript, in order to use any of them
-<code>ProduceDSC</code> must be set to false.
-
-<dl>
-<dt><code>-dRotatePages=</code><em>boolean</em>.
-<dd>The printer will rotate pages
-for a better fit with the physical size. Default value : <em>false</em>.
-Must be <em>false</em> if <code>-dSetPageSize=true</code>.
-
-<dt><code>-dFitPages=</code><em>boolean</em>.
-<dd>The printer will scale pages down
-to better fit the physical page size. The rendering quality may be poor due to the scaling,
-especially for fonts which Ghostscript had converted into bitmaps
-(see the <em>ps2write</em> device parameter <code>HaveTrueTypes</code>;
-See <a href="#Options">Options</a> about the <code>PageSize</code> entry of the <code>Policies</code>
-dictionary while the conversion step).
-Default value : <em>false</em>.
-Must be <em>false</em> if <code>-dSetPageSize=true</code> or <code>-dCenterPages=true</code>.
-
-<dt><code>-dCenterPages=</code><em>boolean</em>.
-<dd>The printer will center the page image on the selected media. Compatible with <code>-dRotatePages=true</code>, which may rotate the image on the media if it fits better, and then center it.
-Default value : <em>false</em>.
-Must be <em>false</em> if <code>-dSetPageSize=true</code> or <code>-dFitPages=true</code>.
-
-<dt><code>-dSetPageSize=</code><em>boolean</em>.
-<dd>The printer will try to set page size from the job.
-Only use with printers which can handle random <em>PageSize</em>.
-Defaults to <em>true</em>, must be <em>false</em> if <code>-dRotatePages=true</code>, <code>-dCenterPages=true</code> or <code>-dFitPages=true</code>.
-
-<dt><code>-dDoNumCopies=</code><em>boolean</em>.
-<dd>The PostScript emitted by ps2write will try to use copypage to create the number of copies originally requested. Note that this relies on the level 2 semantics for copypage
-and will not reliably work on language level 3 devices (such as Ghostscript itself).
-Defaults to false. This flag is not compatible with the ProduceDSC flag which will take precedence if set.
-
-</dl>
-
-<p>
-These correspond to keys in the Postscript <em>userdict</em>
-of the target printer's virtual memory to control its behavior while
-executing a job generated with <code>ps2write</code>.
-
-<p>
-These keys can be set when executing using the ps2write device,
-this 'fixes' the resulting behaviour according to which key has been set.
-If these keys are not defined during conversion, the resulting PostScript
-will not attempt any form of media selection.
-
-In this case the behaviour can then be modified by setting the keys, either by modifying the resulting
-PostScript or setting the values in some other manner on the target device.
-
-<p>
-See also the distiller params PSDocOptions and PSPageOptions mentioned <a href="#AdditionalDistillerParams">above.</a></p>
-
-<h3><a name="EPS"></a>Encapsulated PostScript (EPS) file output</h3>
-
-<p>
-The eps2write device is the same as the ps2write device, except that it produces Encapsulated PostScript, which is intended
-to be imported into another document and treated as a 'black box'. There are certain restrictions which EPS
-files must follow, the primary one being that they must be DSC conformant. This means that you must not set <code>-dProduceDSC</code>
-to false.
-<p>In addition EPS files may only contain a single page and may not contain device-specific PostScript. You should therefore not
-use the <code>PSDocOptions</code> or <code>PSPageOptions</code> or any of the switches noted in the ps2write section
-above under <a href="#printer_control">Controlling device specific behaviour</a>
-</p>
-<hr>
-<h2><a name="PDFX"></a>Creating a PDF/X-3 document</h2>
-
-<p>
-
-To create a PDF/X-3 document from a Postscript or a PDF file, you should :
-
-<ul>
-<li> Specify the <code>pdfwrite</code> device or use the <code>ps2pdf</code> script.
-<li> Specify the <code>-dPDFX</code> option. It provides the document conformity
- and forces <code>-dCompatibilityLevel=1.3</code>.
-<li> Specify <code>-sColorConversionStrategy=Gray</code>, <code>-sColorConversionStrategy=CMYK</code>
- or <code>-sColorConversionStrategy=UseDeviceIndependentColor</code>(<code>RGB</code> is not allowed).
- If you plan to create a device-independent color PDF file then you should set the ProcessColorModel
- using <code>-sProcessColorModel=DeviceGray</code> or <code>-sProcessColorModel=DeviceCMYK</code>.
-<li> Specify a PDF/X definition file before running the input document.
- It provides additional information to be included into the output document.
- A sample PDF/X definition file may be found in <code>gs/lib/PDFX_def.ps</code>.
- You will need to modify the content of this file; in particular you must alter the
- /ICCProfile so that it points to a valid ICC profile for your OutputCondition. The
- string '(...)' defining the ICCProfile must be a fully qualified device and path
- specification appropriate for your Operating System.
-<li> If a registered printing condition is applicable, specify its identifier
- in the PDF/X definition file. Otherwise provide an ICC profile and
- specify it in the PDF/X definition file as explained below.
-<li> Provide a <code>DefaultRGB</code> resource file in the ColorSpace resource category.
- Either define it in the PDF/X definition file, or provide
- a definition of <code>gs/Resource/ColorSpace/DefaultRGB</code> .
- <code>gs/Resource/ColorSpace/DefaultRGB</code> is usually
- distributed with Ghostscript, its content may not necessarily satisfy your needs, see below.
-</ul>
-
-<p>
-NOTE: Unless <code>-dNOSAFER</code> is specified (NOT reccomended!)
-the ICC profile will be read using the <code>SAFER</code> file permissions; you must ensure that the profile is
-in a directory which is readable according to the <code>SAFER</code> permissions, or that the file itself
-is specifically made readable. See Use.htm for details of how to set file permissions for <code>SAFER</code>.
-</p>
-
-<p>
-As mentioned above, the PDF/X definition file provides special information,
-which the PDF/X-3 standard requires. You can find a sample file in
-<code>gs/lib/PDFX_def.ps</code>, and edit it according to your needs.
-The file follows Postscript syntax and uses the operator <code>pdfmark</code>
-to pass the special information. To ease customisation
-the lines likely to need editing in the sample file are marked with the comment <code>% Customize</code>.
-They are explained below.
-
-<dl>
-<dt><code>OutputCondition</code> <em>string</em>
-<dd>Defines an <code>OutputCondition</code> value for the output intent dictionary.
-</dl>
-
-
-<dl>
-<dt><code>OutputConditionIdentifier</code> <em>string</em>
-<dd>Defines an <code>OutputConditionIdentifier</code> value for the output intent dictionary.
-</dl>
-
-<dl>
-<dt><code>ICCProfile</code> <em>string</em>
-<dd> May be omitted if <code>OutputConditionIdentifier</code>
-specifies a registered identifier of characterized printing condition
-(see http://www.color.org/IPA_2003-11_PDFX.pdf).
-Defines a file name of an ICC profile file to be included into the output document.
-You may specify either an absolute file name, or a relative
-path from the working directory.
-</dl>
-
-<dl>
-<dt><code>Title</code> <em>string</em>
-<dd>Defines the document title. Only useful if the source Postscript file doesn't
-define a title with DSC comments. Otherwise remove entire line from definition file.
-</dl>
-
-<dl>
-<dt><code>Info</code> <em>string</em>
-<dd>Defines an <code>Info</code> value for the output intent dictionary.
-</dl>
-
-<p>The Ghostscript distribution does not contain an ICC profile to be used
-for creating a PDF/X-3 document. Users should either create an appropriate one themselves,
-or use one from a public domain, or create one with the PDF/X-3 inspector freeware.
-
-<p>The PDF/X-3 standard requires a <code>TrimBox</code> entry
-to be written for all page descriptions.
-This is an array of four offsets
-that specify how the page is to be trimmed
-after it has been printed.
-It is set to the same as <code>MediaBox</code> by default
-unless the <code>PDFXTrimBoxToMediaBoxOffset</code>
-distiller parameter is present.
-It accepts offsets to the <code>MediaBox</code> as an array
-[<i>left&nbsp;right&nbsp;top&nbsp;bottom</i>],
-e.g., the PostScript input code
-<code>&lt;&lt;&nbsp;/PDFXTrimBoxToMediaBoxOffset
-[10&nbsp;20&nbsp;30&nbsp;40]&nbsp;&gt;&gt;&nbsp;setdistillerparams</code>
-specifies that 10 points will be trimmed at the left,
-20 points at the right,
-30 points at the top,
-and 40 points at the bottom.
-
-<p>Another page entry is the <code>BleedBox</code>.
-It gives the area of the page
-to which actual output items may extend;
-cut marks, color bars etc.
-must be positioned in the area between the <code>BleedBox</code>
-and the <code>MediaBox</code>.
-The <code>TrimBox</code> is always contained within the
-<code>BleedBox</code>.
-By default,
-the <code>PDFXSetBleedBoxToMediaBox</code> distiller parameter
-is <code>true</code>,
-and the <code>BleedBox</code> is set to the same values
-as the <code>MediaBox</code>.
-If it is set to <code>false</code>,
-the <code>PDFXBleedBoxToTrimBoxOffset</code>
-parameter gives offset to the <code>TrimBox</code>.
-It accepts a four-value array in the same format as the
-<code>PDFXTrimBoxToMediaBoxOffset</code> parameter.
-
-<p>
-
-Here is a sample command line to invoke Ghostscript for generating a PDF/X-3 document :
-<blockquote><code>
-gs -dPDFX -dBATCH -dNOPAUSE -sColorConversionStrategy=CMYK -sDEVICE=pdfwrite -sOutputFile=out-x3.pdf PDFX_def.ps input.ps
-</code></blockquote>
-
-<p>
-Please also see the <code>PDFACompatibilityPolicy</code> control described under "Creating a PDF/A document" below. The same control is now used to specify the desired behaviour when an input file cannot be converted 'as is' into a PDF/X file.
-<p>
-
-<hr>
-<h2><a name="PDFA"></a>Creating a PDF/A document</h2>
-
-<p>
-To create a PDF/A document, please follow the instructions for <a href="#PDFX">creating a PDF/X-3 document</a>,
-with the following exceptions :
-
-<ul>
-<li> Specify the <code>pdfwrite</code> device or use the <code>ps2pdf</code> script.
-<li> Specify the <code>-dPDFA</code> option to specify PDF/A-1, <code>-dPDFA=2</code> for PDF/A-2 or <code>-dPDFA=3</code> for PDF/A-3
-<li> Specify <code>-sColorConversionStrategy=RGB</code>, <code>-sColorConversionStrategy=CMYK</code>
- or <code>-sColorConversionStrategy=UseDeviceIndependentColor</code>.
- If you plan to create a device-independent color PDF file then you should set the ProcessColorModel
- using <code>-sProcessColorModel=DeviceRGB</code> or <code>-sProcessColorModel=DeviceCMYK</code>.
-<li> Specify a PDF/A definition file before running the input document.
- It provides additional information to be included in the output document.
- A sample PDF/A definition file may be found in <code>gs/lib/PDFA_def.ps</code>.
- You will need to modify the content of this file; in particular you must alter the
- /ICCProfile so that it points to a valid ICC profile for your OutputIntent. The
- string '(...)' defining the ICCProfile must be a fully qualified device and path
- specification appropriate for your Operating System.
-</ul>
-
-There is one additional control for PDF/A output:
-
-<dl>
-<dt><code>PDFACompatibilityPolicy</code> <em>integer</em>
-<dd>When an operation (eg pdfmark) is encountered which cannot be emitted in a PDF/A compliant file, this policy is consulted, there are currently three possible values:
-
-<blockquote>0 - (default) Include the feature or operation in the output file, the file will not be PDF/A compliant. Because the document Catalog is emitted before this is encountered, the file will still contain PDF/A metadata but will not be compliant. A warning will be emitted in this case.
-</blockquote>
-<dd>
-<blockquote>1 - The feature or operation is ignored, the resulting PDF file will be PDF/A compliant. A warning will be emitted for every elided feature.
-</blockquote>
-<dd>
-<blockquote>2 - Processing of the file is aborted with an error, the exact error may vary
-depending on the nature of the PDF/A incompatibility.
-</blockquote>
-</dl>
-
-Here is a sample command line to invoke Ghostscript for generating a PDF/A document :
-<blockquote><code>
-gs -dPDFA=1 -dBATCH -dNOPAUSE -sColorConversionStrategy=RGB -sDEVICE=pdfwrite -sOutputFile=out-a.pdf PDFA_def.ps input.ps
-</code></blockquote>
-
-<p>
-
-<hr>
-<h2><a name="PPD"></a>Ghostscript PDF Printer Description</h2>
-<p>
-To assist with creating a PostScript file suitable for conversion
-to PDF, ghostscript includes <a href="../lib/ghostpdf.ppd">ghostpdf.ppd</a>,
-a PostScript Printer Description (PPD) file.
-This allows some <a href="#Options">distiller parameters</a>
-to be set when a PostScript file is generated.
-
-<h3>Windows XP or 2000</h3>
-<p>
-To install a "Ghostscript PDF" printer on Windows XP,
-select the Windows Control Panel,
-Printers and Faxes,
-Add a Printer,
-Local Printer,
-Use port FILE: (Print to File),
-Have Disk...,
-select the directory containing
-<a href="../lib/ghostpdf.ppd">ghostpdf.ppd</a>
-and
-<a href="../lib/ghostpdf.inf">ghostpdf.inf</a>,
-select "Ghostscript PDF",
-Replace existing driver (if asked),
-and answer the remaining questions appropriately.
-After installing, open the "Ghostscript PDF" properties,
-select the Device Settings tab,
-set "Minimum Font Size to Download as Outline" to 0 pixels.
-<p>
-To set distiller parameters, select the "Ghostscript PDF"
-Printing Preferences, then the Advanced button.
-The PDF settings are under "Printer Features".
-
-
-<hr>
-<h2><a name="Extensions"></a>pdfmark extensions</h2>
-<p>
-In order to better support the ZugFERD electronic invoice standard (http://www.ferd-net.de/front_content.php?idcat=231&changelang=4)
-and potentially other standards in the future, a new non-standard pdfmark has been defined for use by pdfwrite.
-</p>
-<p>
-This pdfmark allows additional Metadata to be defined which will be inserted into the Metadata generated by
-the pdfwrite device. This is necessary because the standard requires a PDF/A-3 file be produced, with an extension
-schema (and some additional XML data) contained within the Metadata referenced from the Catalog object.
-</p>
-<p>
-While it would be possible to use the existing Metadata pdfmark to write a completely new set of metadata
-into the Catalog, creating a conformant set of XML, with all the information synchronised with the /Info
-dictionary would be challenging, this pdfmark allows the pdfwrite device to generate all the normal information
-leaving the user with only the task of specifying the additional data.
-
-<code>[ /XML (string containing additional XMP data) /Ext_Metadata pdfmark</code>
-</p>
-
-<hr>
-<h2><a name="Limitations"></a>Limitations</h2>
-
-<p>
-<code>The pdfwrite family</code> will sometimes convert input constructs to
-lower-level ones, even if a higher-level construct is available. For
-example, if the PostScript file uses <code>charpath</code> to set a
-clipping path consisting of text, <code>pdfwrite</code> may write the
-clipping path as a path in the PDF file, rather than as text, even though
-PDF is able to express clipping with text. This is only a performance
-issue, and will be improved incrementally over time.
-
-<p>
-Some applications, such as HIGZ, produce PostScript files that use
-ridiculously large coordinates. On such files, <code>pdfwrite</code> may
-cause a <code>limitcheck</code> error. If this occurs, try reducing the
-default internal resolution of 720 dpi by using the <code>-r</code>
-switch, e.g., <code>-r300&nbsp;somefile.ps</code>.
-
-<p>
-<code>pdfwrite</code> ignores the PDF 1.3 (Acrobat 4.x) pdfmarks related to
-document content structure: <code>StRoleMap</code>,
-<code>StClassMap</code>, <code>StPNE</code>,
-<code>StBookmarkRoot</code>, <code>StPush</code>,
-<code>StPop</code>, <code>StPopAll</code>, <code>StBMC</code>,
-<code>StBDC</code>, <code>EMC</code>, <code>StOBJ</code>,
-<code>StAttr</code>, <code>StStore</code>, <code>StRetrieve</code>,
-<code>NamespacePush</code>, <code>NamespacePop</code>, and
-<code>NI</code>. While this causes some structural information to be
-omitted from the output file, the displayed and printed output are normally
-not affected.
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/WhatIsGS.htm b/doc/WhatIsGS.htm
deleted file mode 100644
index 512e6542..00000000
--- a/doc/WhatIsGS.htm
+++ /dev/null
@@ -1,161 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Ghostscript: What Is Ghostscript?</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>What Is Ghostscript?</h1>
-
-<h4>
-There are various products in the Ghostscript family; this document describes what they are, and how they are related.</h4>
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Ghostscript">Ghostscript</a></li>
- <li><a href="#GhostPDF">GhostPDF</a></li>
- <li><a href="#GhostPDL">GhostPDL</a></li>
- <li><a href="#GhostPCL">GhostPCL</a></li>
- <li><a href="#GhostXPS">GhostXPS</a></li>
- <li><a href="#URWFonts">URW Font Information</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Ghostscript"></a>Ghostscript</h2>
-
-<p>Ghostscript is an interpreter for PostScript<a href="#foot1">&#174;</a> and Portable Document Format (PDF) files.</p>
-
-<p>Ghostscript consists of a PostScript interpreter layer, and a graphics library. The graphics library is shared with all the other products in the Ghostscript family, so all of these technologies are sometimes referred to as Ghostscript, rather than the more correct GhostPDL.</p>
-
-<p>Binaries for Ghostscript and (seel below) GhostPDF (included in the Ghostscript binaries) for various systems can be downloaded from <a href="http://www.ghostscript.com/download">here</a>.
-The source can be found in both the Ghostscript and GhostPDL downloads from
-the same site.</p>
-<hr>
-
-<h2><a name="GhostPDF"></a>GhostPDF</h2>
-
-<p>Prior to release 9.55.0 GhostPDF was an interpreter for the PDF page description language
-built on top of Ghostscript, and written in the PostScript programming language. From 9.55.0
-onwards there is a new GhostPDF executable, separate from Ghostscript and written in C
-rather than PostScript.</p>
-
-<p>This new interpreter has also been integrated into Ghostscript itself, in order to
-preserve the PDF functionality of that interpreter. For now, the old PostScript-based
-interpreter remains the default, but the new interpreter is built-in alongside it.</p>
-
-<p>The intention is that the new interpreter will replace the old one, which will be withdrawn.</p>
-
-<p>It is possible to control which interpreter is used with the NEWPDF command-line switch. When
-this is false (the current default) the old PostScript-based interpreter is used, when NEWPDF
-is true then the new C-based interpreter is used.</p>
-
-<h2><a name="GhostPDL"></a>GhostPDL</h2>
-
-<p>Historically, we’ve used GhostPDL as an umbrella term to encompass our entire line of products. We've now brought all these disparate products together into a single package, called, appropriately enough, GhostPDL.</p>
-
-<p>When running on a printer (or server) GhostPDL now automatically detects the type of data being fed to it and processes it accordingly. The individual interpreters all plug into a top-level module that handles both automatic language detection and Printer Job Language (PJL) based configuration.</p>
-
-<p>The exact set of interpreters present in an installation can be tuned by the integrator for their specific product/use cases.</p>
-
-<p>In addition to our existing PDL modules (PS, PDF, PCL, PXL, and XPS) we have now added new modules to handle a range of common image formats. With these installed, GhostPDL will handle JPEGs (both JFIF and EXIF), PWGs, TIFFs, PNGs, JBIG2s, and JPEG2000s.</p>
-
-<p>GhostPDL is available both under the <a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU Affero GPL license</a>
-and for <a href="http://www.artifex.com/page/licesnsing-information.html">commercial licensing</a>
-from <a href="http://www.artifex.com">Artifex</a>.
-
-<p>The source code for GhostPDL can be found on
-<a href="http://www.ghostscript.com/download">here</a>.
-<hr>
-
-<h2><a name="GhostPCL"></a>GhostPCL</h2>
-
-<p>GhostPCL is an interpreter for PCL<a href="#foot2">&trade;</a> and PXL files. This consists of an
-PCL/PXL interpreter hooked up to the Ghostscript graphics library.</p>
-
-<p>GhostPCL is available both under the <a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU Affero GPL license</a> and for <a href="http://www.artifex.com/page/licesnsing-information.html">commercial licensing</a> from <a href="http://www.artifex.com">Artifex</a>.</p>
-
-
-<p>Binaries for GhostPCL for various systems can be downloaded from <a href="http://www.ghostscript.com/download">here</a>. The source can be found in the GhostPCL/GhostPDL downloads from the same site.</p>
-
-<hr>
-<h2><a name="GhostXPS"></a>GhostXPS</h2>
-
-<p>GhostXPS is an interpreter for XPS (XML Paper Specfication) files. This
-consists of an XPS interpreter hooked up to the Ghostscript graphics library.</p>
-
-<p>GhostXPS is available both under the <a href="http://www.gnu.org/licenses/agpl-3.0.html">GNU Affero GPL license</a>
-and for <a href="http://www.artifex.com/page/licesnsing-information.html">commercial licensing</a>
-from <a href="http://www.artifex.com">Artifex</a>.</p>
-
-<p>Binaries for GhostXPS for various systems can be downloaded from
-<a href="http://www.ghostscript.com/download">here</a>. The
-source can be found in the GhostXPS/GhostPDL downloads from the same site.</p>
-<hr>
-
-<h2><a name="URWFonts"></a>URW Font Information</h2>
-
-<p> The set of truetype fonts in the urwfonts directory are necessary for the PCL/XL interpreter to function properly but they ARE NOT FREE SOFTWARE and are NOT distributed under the GNU GPL/AGPL. They can instead be redistributed under the <a href="https://ghostscript.com/Aladdin_Free_Public_License.html">AFPL license</a> which bars commercial use.</p>
-
-<p> If your copy of GhostPDL includes these fonts, you should have received a copy of the the Aladdin Free Pubilc License, usually in a file called COPYING.AFPL. If not, please contact Artifex Software, Inc. 1305 Grant Avenue - Suite 200, Novato, CA 94945 USA, or visit http://www.artifex.com/</p>
-<hr>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<p><a name="foot1">PostScript</a> is a registered trademark of Adobe Systems Inc.</p>
-<p><a name="foot2">PCL</a> is a registered trademark of Hewlett-Packard Company.</p>
-
-<br/><br/>
-<p>
-<small>Copyright &copy; 2000-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/default.css b/doc/default.css
deleted file mode 100644
index b45a9d19..00000000
--- a/doc/default.css
+++ /dev/null
@@ -1,362 +0,0 @@
-* {
- -webkit-tap-highlight-color: rgba(0,0,0,0);
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
-}
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, tt, var,
-b, u, i, center,
- ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, embed,
-figure, figcaption, footer, header, hgroup,
-menu, nav, output, ruby, section, summary,
-time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
-}
-
-
-/* HTML5 display-role reset for older browsers */
-article, aside, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section {
- display: block;
-}
-
-html, body {
- position: relative;
- height: 100%;
-}
-
-body {
- -webkit-touch-callout: none; /* prevent callout to copy image, etc when tap to hold */
- -webkit-text-size-adjust: none; /* prevent webkit from resizing text to fit */
- -webkit-user-select: text; /* prevent copy paste, to allow, change 'none' to 'text' */
- color:black;
- background:#ffffff;
- font-family:"Source Sans Pro", sans-serif; /* 200 = ExtraLight, 300 = Light, 400 = regular, 600 = semi-bold, 700 = bold, 900 = black */
- font-weight:400;
- font-size:16px;
- margin:0px;
- padding:0px;
- display: grid;
-}
-
-header {
- width: 100%;
- height:50px;
- background: #0075cf url(language-bindings/images/ghostscript.png) 10px center no-repeat;
- background-size: 30px 30px;
- color: #fff;
- line-height: 50px;
- text-indent: 50px;
- z-index: 1;
- display: flex;
- justify-content: space-between;
- grid-row: 1;
-}
-
-header .title {
- display: flex;
- justify-content: start;
- flex-direction: column;
-}
-
-header h1 {
- line-height: 40px;
-}
-
-header h2::after {
- content:"Version 9.56.0";
-}
-
-header h2 {
- font-weight: bold;
- margin-top:-45px;
- font-size: 12px;
- color: #fff;
- margin-right:10px;
-}
-
-header .search {
- width: 50px;
- height:50px;
- background: #0075cf url(images/icon-search.png) center center no-repeat;
- background-size: 50px 50px;
-}
-
-main {
- grid-row: 2;
- overflow-y: scroll;
-}
-
-main .outer {
- max-width: 1280px;
- margin: 0px auto 100px;
-}
-
-main .inner {
- padding: 20px;
-}
-
-a {
- text-decoration: none;
- color: #0075cf;
-}
-
-i {
- font-style: italic;
-}
-
-p {
- line-height: 24px;
- margin-bottom: 20px;
-}
-
-hr {
- width: 100%;
- margin: 50px auto;
-}
-
-/* Number the h2/h3 -- doesn't work on v4/5 browsers */
-h2 {
- counter-increment: h2-count;
- counter-reset: h3-count;
-}
-
-h2 a:after {
- font-size:30px;
- content: counter(h2-count) "";
-}
-
-h3 {
- counter-increment: h3-count;
-}
-
-h3 a:after {
- font-size:22px;
- content: counter(h2-count) "." counter(h3-count) "";
-}
-
-h2 a:after, h3 a:after {
- background-color: black;
- padding: 0px 10px;
- margin-right: 5px;
- border-radius: 5px;
- color: white;
-}
-
-header h1 {
- font-size:24px;
- font-weight:600;
- color: #fff;
- text-decoration: none;
-}
-
-header a h1 {
- color: #fff;
-}
-
-h1 {
- font-size:40px;
- font-weight:600;
- margin-bottom: 20px;
-}
-
-h2 {
- font-weight:600;
- font-size:26px;
- margin-bottom: 20px;
-}
-
-h3 {
- font-weight:600;
- font-size:20px;
- margin-bottom: 10px;
-}
-
-h4 {
- font-weight:600;
- font-size:16px;
- margin-bottom: 10px;
-}
-
-code {
- border-radius: 3px;
- padding: 2px 6px;
- font-family: monospace;
-}
-
-pre {
- font-family: monospace;
-}
-
-pre>code {
- padding:0;
- margin:0;
- font-size:100%;
- word-break:normal;
- white-space:pre;
- background:transparent;
- border:0;
-}
-
-pre code, pre tt {
- display:inline;
- padding:0;
- margin:0;
- overflow:visible;
- line-height:inherit;
- word-wrap:normal;
- background-color:transparent;
- border:0
-}
-
-pre code::before,
-pre code::after,
-pre tt::before,
-pre tt::after {
- content:normal
-}
-
-ul {
- margin: 0 0 0 20px;
-}
-
-li {
- margin: 10px;
-}
-
-table {
- margin: 20px 0;
- border-collapse: collapse;
- table-layout:fixed;
- width: 100%;
- border: 1px solid #c0c0c0;
-}
-
-th {
- font-weight: bold;
- background-color:#666;
- color: #fff;
- border-bottom: 1px solid #c0c0c0;
- border-right: 1px solid #c0c0c0;
-}
-
-tr {
- text-overflow:clip;
-}
-
-th, td {
- text-align: left;
- padding:14px;
- word-wrap:break-word;
-}
-
-td {
- border-right: 1px solid #c0c0c0;
-}
-
-em {
- font-style: italic;
-}
-
-ul.toc {
- list-style-type:none;
-}
-
-ul.toc li ul {
- list-style-type:none;
- margin-left: 20px;
-}
-
-blockquote {
- background-color:transparent;
- width: 100%;
- height: auto;
- padding: 20px;
- border-radius: 10px;
- margin: 0 0 20px 0;
- border: 1px solid #666;
-}
-
-blockquote strong {
- font-size: 16px;
- font-weight: bold;
-}
-
-table {
- color: #000;
-}
-
-table code {
- color: #000;
-}
-
-table tr {
- background-color: #fff;
- border-bottom: 1px solid #c0c0c0;
-}
-
-table tr:nth-child(2n) {
- background-color: #ddd;
-}
-
-/* Dark mode */
-@media (prefers-color-scheme: dark) {
-
- body {
- background-color: #000;
- color: white;
- }
-
- a {
- text-decoration: none;
- color: #289df6;
- }
-
- h2 a:after, h3 a:after {
- background-color: white;
- color: black;
- }
-
- blockquote {
- border: 1px solid #efefef;
- }
-
- table {
- color: #fff;
- }
-
- table code {
- color: #fff;
- }
-
- table tr {
- background-color: #000;
- }
-
- table tr:nth-child(2n) {
- background-color: #222;
- }
-
-}
-
-/* < phone portrait */
-@media all and (max-width : 399px) {
-
- header h1 {
- font-size:18px;
- }
-
-}
diff --git a/doc/gdevds32.c b/doc/gdevds32.c
deleted file mode 100644
index a59ea7a6..00000000
--- a/doc/gdevds32.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied,
- modified or distributed except as expressly authorized under the terms
- of the license contained in the file LICENSE in this distribution.
-
- Refer to licensing information at http://www.artifex.com or contact
- Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
- CA 94945, U.S.A., +1(415)492-9861, for further information.
-*/
-
-/* ds32 device:32-bit CMYK TIFF device (downscaled output
- * from 32-bit CMYK internal rendering)
- * Supports downscaler options similar to the tiffscaled32 device such
- * as DownScaleFactor, PostRenderProfile, TrapX, TrapY,and TrapOrder.
- *
- * No file is written (except for a debug mode that writes a PAM32 file)
- * so that raster lines can be passed in memory to a user function.
- */
-
-#include "stdint_.h"
-#include "gdevprn.h"
-#include "gxiodev.h"
-#include "stdio_.h"
-#include "ctype_.h"
-#include "gxgetbit.h"
-#include "gsicc_cache.h"
-#include "gscms.h"
-#include "gxdownscale.h"
-#include "gp.h"
-
-/********************************************************************************
- The following section can be added to the end of device/devs.mak
-
-### -------- Example 32-bit CMYK downscaled device --------------------- ###
-# NB: downscale_ is standard in the lib (LIB1s)
-$(DD)ds32.dev : $(DEVOBJ)gdevds32.$(OBJ) $(GLD)page.dev $(GDEV) $(DEVS_MAK) $(MAKEDIRS)
- $(SETPDEV2) $(DD)ds32 $(DEVOBJ)gdevds32.$(OBJ)
- $(ADDMOD) $(DD)ds32 -include $(GLD)page
-
-$(DEVOBJ)gdevds32.$(OBJ) : $(DEVSRC)gdevds32.c $(gsicc_cache_h) $(gxdownscale_h) $(AK) \
- $(arch_h) $(gdevprn_h) $(stdio__h) $(stdint__h) $(DEVS_MAK) $(MAKEDIRS)
- $(DEVCC) $(DEVO_)gdevds32.$(OBJ) $(C_) $(DEVSRC)gdevds32.c
-
-***************** END OF devs.mak INSERTION *************************************/
-
-/*
- Once that is added, then rebuild Ghostscript, for example, on linux:
-
- make DEVICE_DEVS_EXTRA=obj/ds32.dev
-
- or, on Windows:
-
- nmake -f psi/msvc32.mak DEVICE_DEVS_EXTRA=obj\ds32.dev
-
-*/
-
-/* ------ The device descriptors ------ */
-
-/* Default X and Y resolution */
-#define X_DPI 72
-#define Y_DPI 72
-
-/* ------ The ds32 device ------ */
-
-static dev_proc_print_page(ds32_print_page);
-static dev_proc_get_params(ds32_get_params_downscale_cmyk);
-static dev_proc_put_params(ds32_put_params_downscale_cmyk);
-
-static const gx_device_procs ds32_procs = {
- gdev_prn_open, NULL, NULL, gdev_prn_bg_output_page, gdev_prn_close,
- NULL, cmyk_8bit_map_color_rgb,
- NULL, NULL, NULL, NULL, NULL, NULL,
- ds32_get_params_downscale_cmyk,
- ds32_put_params_downscale_cmyk,
- cmyk_8bit_map_cmyk_color,
- NULL, NULL, NULL, gx_page_device_get_page_device
-};
-
-typedef struct gx_device_ds32_s {
- gx_device_common;
- gx_prn_device_common;
- gx_downscaler_params downscale;
- gsicc_link_t *icclink;
-} gx_device_ds32;
-
-const gx_device_ds32 gs_ds32_device = {
- prn_device_body(gx_device_ds32,
- ds32_procs,
- "ds32",
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
- 600, 600, /* 600 dpi by default */
- 0, 0, 0, 0, /* Margins */
- 4, /* num components */
- 32, /* bits per sample */
- 255, 255, 256, 256,
- ds32_print_page),
- GX_DOWNSCALER_PARAMS_DEFAULTS,
- 0 /* icclink for PostRenderProfile */
-};
-
-static int
-ds32_get_params_downscale_cmyk(gx_device * dev, gs_param_list * plist)
-{
- gx_device_ds32 *const dsdev = (gx_device_ds32 *)dev;
- int code = gdev_prn_get_params(dev, plist);
- int ecode = code;
-
- code = gx_downscaler_write_params(plist, &dsdev->downscale,
- GX_DOWNSCALER_PARAMS_MFS |
- GX_DOWNSCALER_PARAMS_TRAP);
- if (code < 0) {
- ecode = code;
- }
- return ecode;
-}
-
-static int
-ds32_put_params_downscale_cmyk(gx_device * dev, gs_param_list * plist)
-{
- gx_device_ds32 *const dsdev = (gx_device_ds32 *)dev;
- int code, ecode;
-
- code = gx_downscaler_read_params(plist, &dsdev->downscale,
- (GX_DOWNSCALER_PARAMS_MFS |
- GX_DOWNSCALER_PARAMS_TRAP));
- if (code < 0)
- {
- ecode = code;
- }
- if (ecode < 0)
- return ecode;
- code = gdev_prn_put_params(dev, plist);
- return code;
-}
-
-/* below is copied (renamed) from tiff_chunky_post_cm */
-static int ds32_chunky_post_cm(void *arg, byte **dst, byte **src, int w, int h,
- int raster)
-{
- gsicc_bufferdesc_t input_buffer_desc, output_buffer_desc;
- gsicc_link_t *icclink = (gsicc_link_t*)arg;
-
- /*
- void gsicc_init_buffer(gsicc_bufferdesc_t *buffer_desc, unsigned char num_chan,
- unsigned char bytes_per_chan, bool has_alpha, bool alpha_first,
- bool is_planar, int plane_stride, int row_stride, int num_rows,
- int pixels_per_row);
- */
- gsicc_init_buffer(&input_buffer_desc, icclink->num_input, 1, false,
- false, false, 0, raster, h, w);
- gsicc_init_buffer(&output_buffer_desc, icclink->num_output, 1, false,
- false, false, 0, raster, h, w);
- icclink->procs.map_buffer(NULL, icclink, &input_buffer_desc, &output_buffer_desc,
- src[0], dst[0]);
- return 0;
-}
-
-#define WRITE_PAM32 /* for debugging */
-
-#ifdef WRITE_PAM32 /* debugging code to write a PAM 32 file. */
-static int
-debug_write_pam_32(gx_device_ds32 *dsdev, byte *data, int row, FILE *file)
-{
- int code = 0;
-
- if (row == 0) {
- /* PAM "magic" ID == 7 */
- code = fprintf(file, "P7\nWIDTH %d\nHEIGHT %d\nDEPTH 4\nMAXVAL 255\nTUPLTYPE CMYK\n"
- "# Image generated by GPL Ghostscript GIT PRERELEASE\nENDHDR\n",
- dsdev->width, dsdev->height);
- if (code < 0)
- code = gs_error_ioerror;
- }
- if (code < 0 || fwrite(data, 1, 4*dsdev->width, file) != 4*dsdev->width)
- code = gs_error_ioerror;
-
- return code;
-}
-#endif
-
-static int
-ds32_print_page(gx_device_printer * pdev, FILE * file)
-{
- gx_device_ds32 *const dsdev = (gx_device_ds32 *)pdev;
- int code = 0;
- byte *data = NULL;
- int size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
- int row;
- int factor = dsdev->downscale.downscale_factor;
- int height = pdev->height / factor;
- int bpc = 8;
- int num_comps = 4;
- int trap_w = dsdev->downscale.trap_w;
- int trap_h = dsdev->downscale.trap_h;
- int *trap_order = dsdev->downscale.trap_order;
- gx_downscaler_t ds;
-
- if (dsdev->icclink == NULL) {
- code = gx_downscaler_init(&ds, (gx_device *)pdev,
- 8, bpc, num_comps,
- &dsdev->downscale,
- &fax_adjusted_width, 0 /*aw*/);
- } else {
- code = gx_downscaler_init_cm(&ds, (gx_device *)pdev,
- 8, bpc, num_comps,
- &dsdev->downscale,
- &fax_adjusted_width, 0, /*aw*/
- ds32_chunky_post_cm, dsdev->icclink,
- dsdev->icclink->num_output);
- }
- if (code < 0)
- return code;
-
- data = gs_alloc_bytes(pdev->memory, size, "ds32_print_page(data)");
- if (data == NULL) {
- gx_downscaler_fin(&ds);
- return_error(gs_error_VMerror);
- }
-
- for (row = 0; row < height && code >= 0; row++) {
- code = gx_downscaler_getbits(&ds, data, row);
- if (code < 0)
- break;
-#ifdef WRITE_PAM32 /* debugging code to write a PAM 32 file. */
- if ((code = debug_write_pam_32(dsdev, data, row, file)) < 0)
- break;
-#endif
- /*************************************************************/
- /* User code to handle the row of data (dsdev->width bytes) */
- /* Set code to a negative value (e.g. gs_error_ioerror) if a */
- /* problem occurs. */
- /* Note that nothing needs to be written to 'file' and this */
- /* can be set to '-' (stdout) to avoid leaving an empty file */
- /* if (row == 0) can be used to perform any initialization */
- /* needed to process the user data */
- /*************************************************************/
-
- if (code < 0)
- break;
- }
-
- /**************************************************************/
- /* User code to finish writing and perform any cleanup needed */
- /**************************************************************/
-
- gx_downscaler_fin(&ds);
- gs_free_object(pdev->memory, data, "tiff_print_page(data)");
-
- return code;
-}
diff --git a/doc/gs-style.css b/doc/gs-style.css
deleted file mode 100644
index 02169581..00000000
--- a/doc/gs-style.css
+++ /dev/null
@@ -1,56 +0,0 @@
-@charset "UTF-8";
-/* CSS Document */
-
-/* Number the h2/h3 -- doesn't work on v4/5 browsers */
-h2
-{
- counter-increment: h2-count;
- counter-reset: h3-count;
-}
-
-h2:before
-{
- content: counter(h2-count) " ";
-}
-
-h3
-{
- counter-increment: h3-count;
-}
-
-h3:before
-{
- content: counter(h2-count) "." counter(h3-count) " ";
-
-}
-
-/* table formatting hints */
-
-table {
- border-collapse: collapse;
- border: 1px solid #F2F2F2;
- width: 100%;
-}
-
-th, td {
- padding: 8px;
-}
-
-tr:nth-child(even){background-color: #f2f2f2}
-
-th {
- background-color: #506B80;
- color: white;
- font-size: 17px;
- border-bottom: 1px solid #F2F2F2;
-}
-
-.table-alt {
- border-collapse: collapse;
- border: none;
- width: 100%;
-}
-
-th, td {
- padding: 8px;
-} \ No newline at end of file
diff --git a/doc/gs-vms.hlp b/doc/gs-vms.hlp
deleted file mode 100644
index 20e45d78..00000000
--- a/doc/gs-vms.hlp
+++ /dev/null
@@ -1,286 +0,0 @@
-1 gs
- gs - GPL Ghostscript interpreter/previewer
-! Ghostscript version 9.56.1, 4 April 2022
- Usage:
- $ gs [options] [file ...]
-
- Ghostscript is an implementation of Adobe Systems' PostScript (tm)
- and Portable Document Format (PDF) languages. Gs reads files in sequence
- and executes them as Ghostscript programs. After doing this, it reads
- further input from the standard input stream (normally the keyboard).
- Each line is interpreted separately. To exit from the interpreter,
- enter the `quit' command. The interpreter also exits gracefully if it
- encounters end-of-file. Typing the interrupt character (e.g. Control-C)
- is also safe.
-
-2 Description
- The interpreter recognizes several switches described below, which
- may appear anywhere in the command line and apply to all files
- thereafter.
-
- You can get a help message by invoking Ghostscript with the -h
- or -? option. This message also lists the available devices.
-
- Ghostscript may be built with multiple output devices. Ghostscript
- normally opens the first one and directs output to it. To use
- device xyz as the initial output device, include the switch
- "-sDEVICE=xyz"
- in the command line. Note that this switch must precede the first
- .ps file, and only its first invocation has any effect. For example,
- for printer output in a normal configuration that includes an Epson
- printer driver, you might use the command
- gs "-sDEVICE=epson" myfile.ps
- instead of just
- gs myfile.ps
- Alternatively, you can type
- (epson) selectdevice
- (myfile.ps) run
- All output then goes to the printer instead of the display until
- further notice. You can switch devices at any time by using the
- selectdevice procedure, e.g.,
- (vga) selectdevice
- or
- (epson) selectdevice
- As yet a third alternative, you can define a logical name GS_DEVICE
- as the desired default device name. The order of precedence for these
- alternatives, highest to lowest, is:
- selectdevice
- (command line)
- GS_DEVICE
- (first device in build list)
-
- To select the density on a printer, use
- gs "-sDEVICE=<device>" -r<xres>x<yres>
- For example, on a 9-pin Epson-compatible printer, you can get the
- lowest-density (fastest) mode with
- gs "-sDEVICE=epson" -r60x72
- and the highest-density mode with
- gs "-sDEVICE=epson" -r240x72.
-
- If you select a printer as the output device, Ghostscript also
- allows you to control where the device sends its output. Normally,
- output goes directly to a scratch file on Unix and VMS systems. To
- send the output to a series of files foo1.xyz, foo2.xyz, ..., use
- the switch
- "-sOutputFile=foo%d.xyz"
- The %d is a printf format specification; you can use other formats
- like %02d. Each file will receive one page of output. Alternatively,
- to send the output to a single file foo.xyz, with all the pages con-
- catenated, use the switch
- "-sOutputFile=foo.xyz"
-
- To find out what devices are available, type
- devicenames ==
- after starting up Ghostscript. Alternatively, you can use the -h or -?
- switch in the command line; the help message also lists the available
- devices.
-
- To select a different paper size, use the command line switch
- "-sPAPERSIZE=a_known_paper_size"
- e.g.,
- "-sPAPERSIZE=a4"
- or
- "-sPAPERSIZE=legal"
-
- As of this printing, the known paper sizes, defined in gs_statd.ps, are:
-
- PAPERSIZE X" Y" X cm Y cm
- ____________________________________________________
- 11x17 11" 17" 27.94 43.18
- a0 33.0556" 46.7778" 83.9611 118.816
- a10 1.02778" 1.45833" 2.61056 3.70417
- a1 23.3889" 33.0556" 59.4078 83.9611
- a2 16.5278" 23.3889" 41.9806 59.4078
- a3 11.6944" 16.5278" 29.7039 41.9806
- a4 8.26389" 11.6944" 20.9903 29.7039
- a5 5.84722" 8.26389" 14.8519 20.9903
- a6 4.125" 5.84722" 10.4775 14.8519
- a7 2.91667" 4.125" 7.40833 10.4775
- a8 2.05556" 2.91667" 5.22111 7.40833
- a9 1.45833" 2.05556" 3.70417 5.22111
- archA 9" 12" 22.86 30.48
- archB 12" 18" 30.48 45.72
- archC 18" 24" 45.72 60.96
- archD 24" 36" 60.96 91.44
- archE 36" 48" 91.44 121.92
- b0 39.3889" 55.6667" 100.048 141.393
- b1 27.8333" 39.3889" 70.6967 100.048
- b2 19.6944" 27.8333" 50.0239 70.6967
- b3 13.9167" 19.6944" 35.3483 50.0239
- b4 9.84722" 13.9167" 25.0119 35.3483
- b5 6.95833" 9.84722" 17.6742 25.0119
- flsa 8.5" 13" 21.59 33.02
- flse 8.5" 13" 21.59 33.02
- halfletter 5.5" 8.5" 13.97 21.59
- ledger 17" 11" 43.18 27.94
- legal 8.5" 14" 21.59 35.56
- letter 8.5" 11" 21.59 27.94
- note 7.5" 10" 19.05 25.4
-
- Note that the B paper sizes are ISO sizes: for information about using
- JIS B sizes, see `Use.htm'.
-
-2 Initialization_files
- When looking for the initialization files (gs_*.ps), the files related
- to fonts, or the file for the `run' operator, Ghostscript first tries
- opening the file with the name as given (i.e., using the current
- working directory if none is specified). If this fails, and the file
- name doesn't specify an explicit directory or drive, Ghostscript will
- try directories in the following order:
-
- 1. The directory/ies specified by the -I switch(es) in the command
- line (see below), if any;
- 2. The directory/ies specified by the GS_LIB logical, if any;
- 3. The directory/ies specified by the GS_LIB_DEFAULT macro in the
- Ghostscript makefile.
-
- Each of these (GS_LIB_DEFAULT, GS_LIB, and -I parameter) may be either
- a single directory, or a list of directories separated by a `:'.
-
-2 X_resources
- Ghostscript looks for the following resources under the program name
- `Ghostscript':
-
- borderWidth
- The border width in pixels (default = 1).
-
- borderColor
- The name of the border color (default = black).
-
- geometry
- The window size and placement, WxH+X+Y (default is NULL).
-
- xResolution
- The number of x pixels per inch (default is computed from
- WidthOfScreen and WidthMMOfScreen).
-
- yResolution
- The number of y pixels per inch (default is computed from
- HeightOfScreen and HeightMMOfScreen).
-
- useBackingPixmap
- Determines whether backing store is to be used for saving display
- window (default = true).
-
- See the file `Use.htm' for a more complete list of resources.
-
- To set these resources, put them in a file (such as
- SYS$Login:ghostscript.dat) in the following form:
-
- Ghostscript*geometry: 612x792-0+0
- Ghostscript*xResolution: 72
- Ghostscript*yResolution: 72
-
-2 Options
- Note that VMS will convert all command line arguments to lower case
- if they are not within quotes. Therefore, if a certain command does
- not work, try again but with quotes around it.
-
- -- filename arg1 ...
- Takes the next argument as a file name as usual, but takes all
- remaining arguments (even if they have the syntactic form of switches)
- and defines the name ARGUMENTS in userdict (not systemdict) as an
- array of those strings, before running the file. When Ghostscript
- finishes executing the file, it exits.
-
- -Dname=token
- -dname=token
- Define a name in systemdict with the given definition. The token must
- be exactly one token (as defined by the `token' operator) and must not
- contain any whitespace.
-
- -Dname
- -dname
- Define a name in systemdict with value=null.
-
- -Sname=string
- -sname=string
- Define a name in systemdict with a given string as value. This is
- different from -d. For example, -dname=35 is equivalent to the
- program fragment
- /name 35 def
- whereas -sname=35 is equivalent to
- /name (35) def
-
- -q
- Quiet startup - suppress normal startup messages, and also do the
- equivalent of -dQUIET.
-
- -gnumber1Xnumber2
- Equivalent to -dDEVICEWIDTH=number1 and -dDEVICEHEIGHT=number2. This is
- for the benefit of devices (such as X11 windows) that require (or allow)
- width and height to be specified.
-
- -rnumber
- -rnumber1Xnumber2
- Equivalent to -dDEVICEXRESOLUTION=number1 and -dDEVICEYRESOLUTION=number2
- This is for the benefit of devices (such as printers) that support
- multiple X and Y resolutions. (If only one number is given, it is used
- for both X and Y resolutions.)
-
- -Idirectories
- Adds the designated list of directories at the head of the search path
- for library files.
-
- Note that gs_init.ps makes systemdict read-only, so the values of names
- defined with -D/d/S/s cannot be changed (although, of course, they can
- be superseded by definitions in userdict or other dictionaries.)
-
-2 Special_names
-
- -dNOCACHE
- Disables character caching. Only useful for debugging.
-
- -dNOBIND
- Disables the `bind' operator. Only useful for debugging.
-
- -dNODISPLAY
- Suppresses the normal initialization of the output device. This may be
- useful when debugging.
-
- -dNOPAUSE
- Disables the prompt and pause at the end of each page. This may be
- desirable for applications where another program is `driving'
- Ghostscript.
-
- -dNOPLATFONTS
- Disables the use of fonts supplied by the underlying platform (e.g.
- X Windows). This may be needed if the platform fonts look undesirably
- different from the scalable fonts.
-
- -dSAFER
- Disables the deletefile and renamefile operators, and the ability to
- open files in any mode other than read-only. This may be desirable
- for spoolers or other sensitive environments.
-
- -dWRITESYSTEMDICT
- Leaves systemdict writable. This is necessary when running special
- utility programs, but is strongly discouraged as it bypasses normal Postscript
- security measures.
-
- -sDEVICE=device
- Selects an alternate initial output device, as described above.
-
- -sOutputFile=filename
- Selects an alternate output file for the initial output device, as
- described above.
-
-2 Files
-!!! Change
- GS_Root:[Ghostscript.gs4_0]
- Startup-files, utilities, and basic font definitions.
-
- GS_Root:[Ghostscript.Fonts4_0]
- Additional font definitions.
-
- GS_Root:[Ghostscript.gs4_0.Examples]
- Demo Ghostscript files.
-
- GS_Root:[Ghostscript.gs4_0.Doc]
- Assorted document files.
-!!! Change
-2 See_also
- The various Ghostscript document files (above).
-
-2 Bugs
- See the network news group comp.lang.postscript.
diff --git a/doc/gsdoc.el b/doc/gsdoc.el
deleted file mode 100644
index 4f52ae06..00000000
--- a/doc/gsdoc.el
+++ /dev/null
@@ -1,704 +0,0 @@
-;; gsdoc.el
-;;
-;; GNU emacs (19.34) functions to help working with the HTML form of
-;; Ghostscript documentation.
-;;
-;; Pete Kaiser 8 September 1998 V1.2
-;; 2 December 1999 V1.3 Correct improper "--" to "=="
-;; in HTML marker comments
-;;============================================================
-;; One global key setting, which runs the function to bind some keys
-;; locally -- presumably in a buffer containing HTML code. Plus that
-;; function itself.
-
-(global-set-key [?\C-\S-k] 'gskeys)
-
-(defun gskeys ()
-
-"Set the keys in this buffer to use with Ghostscript HTML docs."
-
-(interactive)
-(local-set-key [?\C-\S-b] 'gs-bold)
-(local-set-key [?\C-\S-c] 'gs-code)
-(local-set-key [?\C-\S-e] 'gs-emphatic)
-(local-set-key [?\C-\S-g] 'gs-get-anchor)
-(local-set-key [?\C-\S-h] 'gs-href)
-(local-set-key [?\C-\S-i] 'gs-italic)
-(local-set-key [?\C-\S-m] 'gs-mailto)
-(local-set-key [?\C-\S-n] 'gs-name)
-(local-set-key [?\C-\S-p] 'gs-put-anchor)
-(local-set-key [?\C-\S-q] 'gs-quote)
-(local-set-key [?\C-\S-r] 'gs-row-of-table)
-(local-set-key [?\C-\S-s] 'gs-selfref)
-(local-set-key [?\C-\S-t] 'gs-table)
-(local-set-key [?\C-\S-u] 'gs-tag)
-(local-set-key [?\C-\S-x] 'gs-example)
-)
-
-;;============================================================
-;; Each of these next few functions just wraps a region in a
-;; <TAG>...</TAG>, or two nested tags. Where there are two, the first one
-;; is inner. See the inner function ~gsregion.
-
-(defun gs-bold () "Make text strong (bold)."
-(interactive)
-(~gsregion "b"))
-
-(defun gs-code () "Make text strong code (bold TT)."
-(interactive)
-(~gsregion "tt")
-(~gsregion "b"))
-
-(defun gs-emphatic () "Make text emphatic (bold italic)."
-(interactive)
-(~gsregion "em")
-(~gsregion "b"))
-
-(defun gs-italic () "Make text italic."
-(interactive)
-(~gsregion "em"))
-
-;;============================================================
-
-(defun gs-quote ()
-
-"Indent a region with BLOCKQUOTE and separate it with empty lines from
-surrounding text."
-
-(interactive)
-
-(save-restriction (narrow-to-region (region-beginning) (region-end))
- (goto-char (point-min)) (insert "\n\n")
- (push-mark (1+ (point-min)) t)
- (goto-char (point-max))
- (~gsregion "blockquote")
- (insert "\n\n")
- )
-)
-
-;;============================================================
-
-(defun gs-example ()
-
-"Make an indented literatim example BLOCKQUOTE PRE and separate it with
-empty lines from surrounding text."
-
-(interactive)
-
-(save-restriction (narrow-to-region (region-beginning) (region-end))
- (goto-char (point-min)) (insert "\n")
- (push-mark (point-min) t)
- (goto-char (point-max))
- (~gsregion "pre")
- (~gsregion "blockquote")
- (insert "\n")
- )
-)
-
-;;============================================================
-
-(defun gs-get-anchor ()
-
-"Beginning at the head of this line, pick up the next anchor name for later
-use along with its HTML file name. This is useful when picking up an
-anchor name from a file in one buffer and using it in another buffer
-containing a different file."
-
-(interactive)
-
-;; From the beginning of this line find and pick up the next non-empty
-;; anchor, which might, of course not be right here -- though that's how it
-;; ought to be used, to pick up an anchor for immediate use. The regular
-;; expression picks up only the name itself.
-
-(beginning-of-line)
-(re-search-forward "<a name=\"?\\([^\">]+\\)\"?></a>" nil t)
-(setq gs-anchor (buffer-substring (match-beginning 1) (match-end 1)))
-
-;; Get the name of this buffer, treating it as the filename.
-
-(setq gs-anchor-file (buffer-name))
-)
-
-;;============================================================
-
-(defun gs-href ()
-
-"Wrap a region in an empty link and leave point in the middle of the
-emptiness to write the link. Maybe some day read the URL and put it
-there."
-
-(interactive)
-
-(save-restriction
- (narrow-to-region (region-beginning) (region-end))
- (goto-char (point-min)) (insert "<a href=\"#\">")
- (setq HREF (- (point) 2))
- (goto-char (point-max)) (insert "</a>")
- (goto-char HREF)
- )
-)
-
-;;============================================================
-
-(defun gs-mailto ()
-
-"Turn an address into a proper \"mailto:\" visually bracketed with <>."
-
-(interactive)
-
-(save-restriction
- (narrow-to-region (region-beginning) (region-end))
- (setq gs-address (buffer-substring (point-min) (point-max)))
- (goto-char (point-min)) (insert "&lt;<a href=\"mailto:")
- (goto-char (point-max)) (insert "\">" gs-address "</a>&gt;")
- )
-)
-
-;;============================================================
-
-(defun gs-tag (Tag)
-
-"Bracket a region with some arbitrary tag read from the minibuffer, leaving
-point right after the opening word of the opening tag, and the end of the
-region at the end of the closing tag. Leaving point there makes it
-possible, for instance, to enter additional matter in a <FONT> tag. Get to
-the end of a region with ^x-^x."
-
-(interactive "*sTag: ")
-
- (~gsregion Tag)
- (exchange-point-and-mark) (forward-word 1)
-)
-
-;;============================================================
-
-(defun gs-toc ()
-
-"[Re]build the table of contents by picking up all the <Hn> lines and
-converting them to properly indented <UL> entries, placing the TOC within
-the standard TOC markers. Note that several of the original Ghostscript
-HTML files have hand-modified TOCs, so it's wise to check before running
-this function. It can be run from anywhere within the HTML file.
-
-This function relies on the specific format of the structure comments for
-the table of contents, which are set by the g~marker function used in
-defvars run when this package is loaded."
-
-(interactive)
-
-(setq g~html-buffer (buffer-name))
-
-(save-restriction (save-excursion
- (widen)
-
-;; Since we're building the TOC, delete any current TOC. Locate the place
-;; for the TOC using the standard markers, deleting everything between the
-;; TOC-beginning and TOC-end markers. The new TOC is built entirely in the
-;; work buffer before being copied into the HTML buffer at that point.
-
- (goto-char (point-min))
- (search-forward g~toc-begin nil t)
- (next-line 1) (beginning-of-line) (setq g~toc-insert (point))
- (search-forward g~toc-end nil t)
- (beginning-of-line) (delete-region g~toc-insert (point))
-
-;; Empty the work buffer by copying nothing into it.
-
- (copy-to-buffer gs-work-buffer 1 1)
-
-;; Now collect all the following header lines into a buffer to work on
-;; them. The later append-to-buffer needs point to be in the middle of the
-;; empty list, so go there before entering the work buffer.
-
- (save-excursion (while (re-search-forward "^<h[1-6][^>]*>" nil t)
- (beginning-of-line) (setq BOH (point))
- (re-search-forward "</h[1-6]>\n" nil t)
- (append-to-buffer gs-work-buffer BOH (point))
- ))
- (goto-char g~toc-insert)
-
-;; All the useful header lines should be in the work buffer now.
-
- (save-excursion
- (set-buffer gs-work-buffer)
-
-;; Formatting as list entries: insert <ul> when the level deepens and </ul>
-;; when it rises.
-
- (goto-char (point-min))
- (while (search-forward "</a>" nil t) (replace-match ""))
- (goto-char (point-min))
- (while (re-search-forward "</h[1-6]>" nil t) (replace-match "</a>"))
- (goto-char (point-min))
- (while (re-search-forward "<a name=\"" nil t) (replace-match "<a href=\"#"))
-
-;; Change <h[1-6]> to <li>, inserting <ul>...</ul> as needed. Pick up the
-;; upmost level from the first header, usually <h1>, and save a copy to
-;; use to insert any terminating </ul>.
-
- (goto-char (point-min))
- (re-search-forward "^<h\\([1-6]\\)[^>]*>" nil t)
- (setq First (string-to-number
- (buffer-substring (match-beginning 1) (match-end 1))))
- (setq Previous First)
- (replace-match "<li>" t t)
-
-;; Got the first one, now handle the rest.
-
- (while (re-search-forward "^<h\\([1-6]\\)[^>]*>" nil t)
- (setq This (string-to-number
- (buffer-substring (match-beginning 1) (match-end 1))))
- (setq Hold This)
- (replace-match "<li>" t t) (beginning-of-line)
-
-;; No point being too fancy with conditionals: the "while" statements here
-;; make at most one logically unnecessary test.
-
- (while (> This Previous) (insert "<ul>\n") (setq This (1- This)))
- (while (< This Previous) (insert "</ul>\n") (setq This (1+ This)))
- (setq Previous Hold)
- )
-
-;; Done with the loop. Clean up by inserting at the end any </ul> needed
-;; to get back to the top level.
-
- (goto-char (point-max))
- (while (> Previous First) (insert "</ul>\n") (setq Previous (1- Previous)))
-
-;; Finally add the trailing whitespace and leading whitespace and header line.
-
- (insert "</ul></blockquote>\n\n")
- (goto-char (point-min))
- (insert "\n<h2>Table of contents</h2>\n\n<blockquote><ul>\n")
-
-;; The TOC is now entirely built in the work buffer. Move it to where it's
-;; supposed to be in the original buffer.
-
- (append-to-buffer g~html-buffer (point-min) (point-max))
- )
- ))
-)
-
-;;============================================================
-
-(defun gs-name ()
-
-"Insert a name anchor at point and leave point ready to enter the anchor's
-name. Anchors are always empty (that is, <a name=...></a>)."
-
-(interactive)
-
-(insert "<a name=\"\"></a>")
-(backward-char 6)
-)
-
-;;============================================================
-
-(defun gs-put-anchor ()
-
-"Insert around the current region the last anchor picked up with
-gs-get-anchor. This includes the HTML file name if the href is put in a
-file other than the anchor."
-
-(interactive)
-
-(save-restriction
- (narrow-to-region (region-beginning) (region-end))
- (goto-char (point-min))
- (insert (concat
- "<a href=\""
-
-;; Insert the filename (buffer name) picked up by gs-get-anchor only if
-;; this is a different buffer.
-
- (if (string-equal gs-anchor-file (buffer-name)) "" gs-anchor-file)
-
-;; And finish unconditionally with the specific anchor name.
-
- "#" gs-anchor "\">"))
- (goto-char (point-max)) (insert "</a>"))
-)
-
-;;============================================================
-
-(defun gs-row-of-table ()
-
-"Set up a row of a table from the line containing point.
-
-Insert the right things at beginning and end, and in between convert tab
-and \"|\" into column breaks with a nonbreaking space in between -- which
-means that no entry can contain a tab or \"|\". Format the HTML nicely
-for readability.
-
-Between each two substantive columns this function puts a column containing
-a single nonbreaking space to provide a visual break. Generally in the
-first row of a table those columns should be given enough NBSPs to make
-the table look right on screen and when converted to text, but this has to
-be done by hand."
-
-(interactive)
-
-(save-restriction
- (end-of-line) (setq EOL (point))
- (beginning-of-line) (narrow-to-region (point) EOL)
- (insert "<tr valign=top>\t<td>")
- (while (re-search-forward "[|\t]" nil t)
- (replace-match "\n\t<td>&nbsp;\n\t<td>" t t))
- (goto-char (point-max))
- )
-(next-line 1) (beginning-of-line)
-)
-
-;;============================================================
-
-(defun gs-selfref ()
-
-"Wrap an URL to make it its own link. This is useful for links that should
-be visible when converted to text."
-
-(interactive)
-
-(save-restriction
- (narrow-to-region (region-beginning) (region-end))
- (goto-char (point-min))
- (if (not (looking-at "http:\\|ftp:")) (insert "http://"))
- (setq g~url (buffer-substring (point-min) (point-max)))
- (goto-char (point-min))
- (insert "<a href=\"")
- (goto-char (point-max)) (insert "\">" g~url "</a>")
- )
-)
-
-;;============================================================
-
-(defun gs-table ()
-
-"Set up an indented table around this region, leaving plenty of white space
-around the table within the HTML. The number of columns in the table is
-hardcoded here as 3, so that number must be changed by hand if the table
-has more than 3 columns. See gs-row-of-table for how rows are built: a
-table with N visible columns generally has 2N-1 HTML columns, including the
-columns that provide vertical white space."
-
-(interactive)
-
-(save-restriction
- (narrow-to-region (region-beginning) (region-end))
- (indent-rigidly (region-beginning) (region-end) -80)
- (goto-char (point-min))
- (insert (concat
- "\n\n<blockquote><table cellpadding=0 cellspacing=0>\n"
- "<tr><th colspan=3 bgcolor=\"#CCCC00\"><hr><font size=\"+1\">XXXXXXXXXX</font><hr>\n"
- "<tr valign=bottom>\n"
- "\t<th align=left>\n"
- "\t<td>&nbsp;&nbsp;\n"
- "\t<th align=left>\n"
- "<tr>\t<td colspan=3><hr>\n"
- ))
- (goto-char (point-max))
- (insert "</table></blockquote>\n")
- )
-)
-
-;;============================================================
-
-(defun gs-text-chars ()
-
-"Prepare text for inclusion in HTML by converting \"&\", \"<\", and \">\" into
-their HTML special forms. The function acts from point to end-of-region or
-end-of-buffer, whichever comes first.
-
-This function is NOT idempotent -- running it twice on the same text will
-certainly do the wrong thing, unless at first the text contained none of
-those characters."
-
-(interactive)
-(setq BEGIN (point))
-
-;; Replace significant characters: "&", "<", and ">".
-
-(while (search-forward "&" nil t) (replace-match "&amp;" t t))
-
-(goto-char BEGIN)
-(while (search-forward "<" nil t) (replace-match "&lt;" t t))
-
-(goto-char BEGIN)
-(while (search-forward ">" nil t) (replace-match "&gt;" t t))
-
-(goto-char BEGIN)
-(while (search-forward "$" nil t) (replace-match "&#36;" t t))
-
-(goto-char BEGIN)
-)
-
-;;============================================================
-
-(defun gs-wrap-textfile ()
-
-"Prepare a text file for inclusion between <pre> and </pre>, then put a
-header and footer around it. One would generally run this function on a
-buffer containing only an original text file; it is how the original
-history and news files were first prepared. At this point it's likely to
-be most useful in preparing new sections for the news document."
-
-(interactive)
-
-(widen)
-
-;; First prepare the entire text by replacing special characters.
-
-(goto-char (point-min))
-(gs-text-chars)
-
-;; At the end of the file, end as-is text and add the standard footer.
-
-(goto-char (point-max))
-(backward-word 1) (next-line 1) (beginning-of-line)
-(delete-region (point) (point-max))
-(insert "\n</pre>\n")
-(insert-file "Footer.htm")
-
-;; At the beginning of the file, begin as-is text and delete everything
-;; up to the identity string (if any), saving the identity string.
-
-(goto-char (point-min))
-(insert "<pre>\n") (setq g~pre-point (point))
-(setq g~ID " [No pre-existing ID] ")
-(if (re-search-forward (concat "^\\$" "Id:\\( [^ ]+ \\)\\$") nil t) (progn
- (setq g~ID (buffer-substring (match-beginning 1) (match-end 1)))
- (next-line 1) (beginning-of-line) (delete-region g~pre-point (point))
- ))
-
-;; Insert the standard header and fill in the identity string.
-
-(goto-char (point-min)) (insert-file "Header.htm")
-(goto-char (point-min)) (search-forward "<!--" nil t)
-(delete-horizontal-space) (insert g~ID)
-(search-forward "<pre>\n" nil t)
-)
-
-;;============================================================
-
-(defun ~gsregion (Tag)
-
-"Tag a region, leaving point at its end and the region around the whole
-thing including the new surrounding tags; thus invoking this function twice
-successively makes the first invocation the inner tags and the second the
-outer.
-
-Not intended for interactive use; for that use gs-tag, which gives a little
-bit of additional service."
-
-(interactive)
-
-(if (not (= 0 (length Tag))) (save-restriction
- (narrow-to-region (region-beginning) (region-end))
- (goto-char (point-min)) (insert "<" Tag ">")
- (goto-char (point-max)) (insert "</" Tag ">")
- (push-mark (point-min) t)
- (goto-char (point-max))
- )
- )
-)
-
-;;============================================================
-
-(defun gs-structure ()
-
-"For historical interest only: add structuring commentary to a Ghostscript
-HTML file. It's crude, but it did most of the work. Future files will
-acquire their structure through plagiarism, like any other code.
-
-Now they've all been structured, and this function was used to do it. The
-placement of table-of-contents lines never worked, because most of the
-files didn't yet have TOCS. Now all files that should have TOCs have
-properly placed markers, but that's history."
-
-(interactive)
-
-(setq g~thisfile (buffer-name))
-
-(widen)
-(goto-char (point-min))
-
-;; Replace the RCS $Id if one can be found in exactly the right format, and
-;; otherwise insert one just after the title, along with a warning message.
-
-(if (re-search-forward (concat "<!-- $" "Id: *\\([^ ]*\\) $ -->") nil t)
- (progn
- (setq Original (buffer-substring (match-beginning 1) (match-end 1)))
- (replace-match g~thisfile t t nil 1)
- )
- (progn
- (search-forward "</title>" nil t) (end-of-line)
- (insert (concat "\n<!-- $" "Id: " g~thisfile " $ -->"))
- (setq Original "(UNSET by gs-structure)")
- )
- )
-
-(end-of-line)
-(insert (concat "\n<!-- Originally: " Original " -->"))
-
-;; Place the visible header marker immediately after <BODY>.
-
-(re-search-forward "<body[^>]*>" nil t)
- (end-of-line) (forward-char 1)
- (insert (concat g~header-begin "\n\n"))
-
-;; Place the headline marker before the first <table> block.
-
-(search-forward "<table" nil t) (search-backward "\n\n" nil t)
- (forward-word 1) (beginning-of-line)
- (insert (concat g~headline-begin "\n\n"))
-
-;; After the first table block place the end-headline marker and both
-;; table-of-contents markers, without worrying where the table of contents
-;; really is. The TOC markers can easily be moved by hand later.
-
-(search-forward "\n\n" nil t)
- (backward-word 1) (end-of-line) (forward-char 1)
- (insert (concat
- "\n"
- g~headline-end "\n\n"
- g~toc-begin "\n\n"
- g~toc-end "\n\n"))
-
-;; The hints section begins with the first paragraph after where the TOC
-;; markers are placed, and ends with <HR>. This isn't precise, and in fact
-;; fails for several files, but once again only an approximation is needed
-;; because it'll be edited by hand later.
-
-(search-forward "<p>" nil t) (beginning-of-line)
- (insert (concat g~hint-begin "\n\n"))
-
-(search-forward "<hr>" nil t) (beginning-of-line)
- (insert (concat g~hint-end "\n\n"))
-
-;; The visible header ends with (and includes) the first <HR>, and the
-;; contents begin immediately thereafter.
-
-(search-forward "<hr>\n" nil t)
- (insert (concat "\n" g~header-end "\n\n"))
-
-(forward-word 1) (beginning-of-line)
- (insert (concat g~contents-begin "\n\n"))
-
-;; The contents end before the final <HR> and the trailer begins
-;; immediately thereafter.
-
-(goto-char (point-max)) (search-backward "<hr>" nil t)
- (backward-word 1) (end-of-line) (forward-char 1)
- (insert (concat
- "\n"
- g~contents-end "\n\n"
- g~trailer-begin "\n\n"))
-
-;; The trailer ends with </BODY>.
-
-(goto-char (point-max)) (search-backward "</body>" nil t)
- (insert (concat "\n" g~trailer-end "\n\n"))
-
-;; We may have introduced trailing whitespace and extra empty lines.
-;; Remove them.
-
-(goto-char (point-min))
-(while (re-search-forward "[ \t\240\r]+$" nil t) (replace-match "" t t))
-(goto-char (point-min))
-(while (re-search-forward "\n\n\n+" nil t) (replace-match "\n\n" t t))
-
-)
-
-;;============================================================
-;; When this file is loaded into emacs, define the structure markers for GS
-;; HTML files. These markers have two purposes: first, to make the HTML
-;; more readable, and second, to enable these functions to locate sections
-;; unambiguously (see gs-toc, the table of contents builder). Note that
-;; the markers do not include LF.
-
-(defun g~marker (basic)
-
-"Build a complete Ghostscript HTML file marker from its text-only part.
-gs-toc relies entirely on this function, so if it's ever changed, gs-toc
-and existing markers would also have to be changed to keep pace.
-
-Intended only for initialization, not interactive use.
-
-All the existing files are now marked up, and since any future ones are
-(properly) likely to be created by plagiarism, it's difficult to imagine
-why anyone would want to change this unless they want to go to the trouble
-of coming up with a much more useful marking scheme."
-
-(interactive)
-
-(setq HEAD (concat "<!-- [" basic "] "))
-(concat HEAD
- (substring
- "====================================================================== -->"
- (- (length HEAD) 80)
- ))
-)
-
-;;============================================================
-;; Initialization code that must run after functions are defined.
-;;
-;; Look in a Ghostscript HTML file to see how these markers are used,
-;; generally
-;;
-;; begin visible header
-;; begin headline
-;; end headline
-;; begin table of contents
-;; end table of contents
-;; begin hint
-;; end hint
-;; end visible header
-;; begin contents
-;; end contents
-;; begin visible trailer
-;; end visible trailer
-;;
-;; although the TOC is in slightly different positions in a few files.
-
-(defvar g~header-begin (g~marker "1.0 begin visible header")
- "Begin the HTML file's visible header material")
-
-(defvar g~header-end (g~marker "1.0 end visible header")
- "End the HTML file's visible header")
-
-(defvar g~headline-begin (g~marker "1.1 begin headline")
- "Begin the conspicuous headline")
-
-(defvar g~headline-end (g~marker "1.1 end headline")
- "End the conspicuous headline")
-
-(defvar g~toc-begin (g~marker "1.2 begin table of contents")
- "Begin the table of contents")
-
-(defvar g~toc-end (g~marker "1.2 end table of contents")
- "End the table of contents")
-
-(defvar g~hint-begin (g~marker "1.3 begin hint")
- "Begin the \"for other information\" section")
-
-(defvar g~hint-end (g~marker "1.3 end hint")
- "End the \"for other information\" section")
-
-(defvar g~contents-begin (g~marker "2.0 begin contents")
- "Begin the main contents")
-
-(defvar g~contents-end (g~marker "2.0 end contents")
- "End the main contents")
-
-(defvar g~trailer-begin (g~marker "3.0 begin visible trailer")
- "Begin the visible standard trailer material")
-
-(defvar g~trailer-end (g~marker "3.0 end visible trailer")
- "End the visible standard trailer material")
-
-;;============================================================
-;; Some working variables
-
-(defvar gs-anchor "JUNK" "*Anchor name to insert")
-(defvar gs-anchor-file "JUNKFILE" "*Anchor filename to insert")
-(defvar gs-work-buffer "*GS work*" "*Ghostscript working buffer")
diff --git a/doc/images/.DS_Store b/doc/images/.DS_Store
deleted file mode 100644
index 5008ddfc..00000000
--- a/doc/images/.DS_Store
+++ /dev/null
Binary files differ
diff --git a/doc/images/Artifex_logo.png b/doc/images/Artifex_logo.png
deleted file mode 100644
index ced5b8e6..00000000
--- a/doc/images/Artifex_logo.png
+++ /dev/null
Binary files differ
diff --git a/doc/images/favicon.png b/doc/images/favicon.png
deleted file mode 100644
index 09975d82..00000000
--- a/doc/images/favicon.png
+++ /dev/null
Binary files differ
diff --git a/doc/images/ghostscript_logo.png b/doc/images/ghostscript_logo.png
deleted file mode 100644
index b47f2f04..00000000
--- a/doc/images/ghostscript_logo.png
+++ /dev/null
Binary files differ
diff --git a/doc/images/hamburger-light.png b/doc/images/hamburger-light.png
deleted file mode 100644
index 79d22a15..00000000
--- a/doc/images/hamburger-light.png
+++ /dev/null
Binary files differ
diff --git a/doc/images/icon-search.png b/doc/images/icon-search.png
deleted file mode 100644
index efcadaf8..00000000
--- a/doc/images/icon-search.png
+++ /dev/null
Binary files differ
diff --git a/doc/images/x-light.png b/doc/images/x-light.png
deleted file mode 100644
index 2fab8ee5..00000000
--- a/doc/images/x-light.png
+++ /dev/null
Binary files differ
diff --git a/doc/index.htm b/doc/index.htm
new file mode 100644
index 00000000..61364372
--- /dev/null
+++ b/doc/index.htm
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="refresh" content="3; url='https://ghostscript.readthedocs.io'" />
+ </head>
+ <body>
+ <p>Please find the latest documentation on <a href="https://ghostscript.readthedocs.io">ghostscript.readthedocs.io</a>.</p>
+ </body>
+</html> \ No newline at end of file
diff --git a/doc/index.html b/doc/index.html
deleted file mode 100644
index c523e40a..00000000
--- a/doc/index.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<meta http-equiv="content-type" content="text/html; charset=us-ascii">
-<title>Ghostscript</title>
-<!-- Ghostscript auto-referral to the introductory document -->
-<meta http-equiv="REFRESH" content="0; url=Readme.htm">
-<link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-
-<body>
- <header><h1>Ghostscript documentation</h1></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-
-<!--START EDITING HERE-->
-Please see <a href="Readme.htm">Readme.htm</a> for an index of the
-Ghostscript documentation.
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
-</body>
-</html>
diff --git a/doc/index.js b/doc/index.js
deleted file mode 100644
index a2760ef2..00000000
--- a/doc/index.js
+++ /dev/null
@@ -1,10 +0,0 @@
-$( "#sidebar" ).before( "<div class='menuTrigger'></div>" );
-
-$(this).show;
-$('.menuTrigger').click(function() {
- $(this).toggleClass('selected');
- $('#sidebar').slideToggle( "slow", function() {
-
- });
-
-}); \ No newline at end of file
diff --git a/doc/language-bindings/c-sharp-ghost-api.html b/doc/language-bindings/c-sharp-ghost-api.html
index b67442d4..935f52ee 100644
--- a/doc/language-bindings/c-sharp-ghost-api.html
+++ b/doc/language-bindings/c-sharp-ghost-api.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
diff --git a/doc/language-bindings/c-sharp-ghost-mono.html b/doc/language-bindings/c-sharp-ghost-mono.html
index 0d4380d2..e71a94ef 100644
--- a/doc/language-bindings/c-sharp-ghost-mono.html
+++ b/doc/language-bindings/c-sharp-ghost-mono.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
diff --git a/doc/language-bindings/c-sharp-ghost-net.html b/doc/language-bindings/c-sharp-ghost-net.html
index 69af7316..d0da9454 100644
--- a/doc/language-bindings/c-sharp-ghost-net.html
+++ b/doc/language-bindings/c-sharp-ghost-net.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
diff --git a/doc/language-bindings/c-sharp-intro.html b/doc/language-bindings/c-sharp-intro.html
index a9f6e5ad..76309443 100644
--- a/doc/language-bindings/c-sharp-intro.html
+++ b/doc/language-bindings/c-sharp-intro.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
@@ -192,7 +192,7 @@
<p>Below is a screenshot of the sample application with a PDF open:</p>
<p><img src="images/ghostnet-wpf-example.png" alt="ghostnet wpf example UI"></p>
<h2 id="ghostmono">GhostMono</h2>
-<p><code>GhostMono</code> is the <a href="https://www.mono-project.com/">Mono</a> equivalent of <code>GhostNET</code> and as such has no dependancy on a Windows environment.</p>
+<p><code>GhostMono</code> is the <a href="https://www.mono-project.com/">Mono</a> equivalent of <code>GhostNET</code> and as such has no dependency on a Windows environment.</p>
</article>
</div>
diff --git a/doc/language-bindings/demo-code.html b/doc/language-bindings/demo-code.html
index 7b71c2db..4d3641fb 100644
--- a/doc/language-bindings/demo-code.html
+++ b/doc/language-bindings/demo-code.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
diff --git a/doc/images/favicon.svg b/doc/language-bindings/images/favicon.svg
index 86b60ff9..86b60ff9 100644
--- a/doc/images/favicon.svg
+++ b/doc/language-bindings/images/favicon.svg
diff --git a/doc/language-bindings/index.html b/doc/language-bindings/index.html
index 3a793b1e..36ffee8a 100644
--- a/doc/language-bindings/index.html
+++ b/doc/language-bindings/index.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
diff --git a/doc/language-bindings/java-gsjavajar.html b/doc/language-bindings/java-gsjavajar.html
index 68877f48..baeda74a 100644
--- a/doc/language-bindings/java-gsjavajar.html
+++ b/doc/language-bindings/java-gsjavajar.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
diff --git a/doc/language-bindings/java-intro.html b/doc/language-bindings/java-intro.html
index cb625833..e7344876 100644
--- a/doc/language-bindings/java-intro.html
+++ b/doc/language-bindings/java-intro.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
@@ -168,7 +168,7 @@ integer types. The build scripts expect an include folder relative to their loca
</tbody></table>
<blockquote>
<p><strong>NOTE</strong><br>
-<code>gsjava</code> has a dependancy on <a href="#jni-building-the-java-native-interface">jni</a>, please ensure that <code>gs_jni</code> is able to be built beforehand.</p>
+<code>gsjava</code> has a dependency on <a href="#jni-building-the-java-native-interface">jni</a>, please ensure that <code>gs_jni</code> is able to be built beforehand.</p>
</blockquote>
<h4 id="building-with-eclipse">Building with Eclipse</h4>
<p>Alternatively you can use <a href="https://www.eclipse.org/eclipseide/">Eclipse</a> to build the JAR file.</p>
diff --git a/doc/language-bindings/md/c-sharp-intro.md b/doc/language-bindings/md/c-sharp-intro.md
index 87722021..b6da28f0 100644
--- a/doc/language-bindings/md/c-sharp-intro.md
+++ b/doc/language-bindings/md/c-sharp-intro.md
@@ -79,7 +79,7 @@ Below is a screenshot of the sample application with a PDF open:
## GhostMono
-`GhostMono` is the [Mono] equivalent of `GhostNET` and as such has no dependancy on a Windows environment.
+`GhostMono` is the [Mono] equivalent of `GhostNET` and as such has no dependency on a Windows environment.
[Visual Studio]: https://visualstudio.microsoft.com
diff --git a/doc/language-bindings/md/java-intro.md b/doc/language-bindings/md/java-intro.md
index fe6422fa..a9d5f517 100644
--- a/doc/language-bindings/md/java-intro.md
+++ b/doc/language-bindings/md/java-intro.md
@@ -101,7 +101,7 @@ Navigate to `ghostpdl/demos/java/gsjava` and use the following:
|Linux| `build_linux.sh` |
> **NOTE**<br>
-> `gsjava` has a dependancy on [jni], please ensure that `gs_jni` is able to be built beforehand.
+> `gsjava` has a dependency on [jni], please ensure that `gs_jni` is able to be built beforehand.
#### Building with Eclipse
diff --git a/doc/language-bindings/python-gsapi.html b/doc/language-bindings/python-gsapi.html
index 0638ba56..337f769b 100644
--- a/doc/language-bindings/python-gsapi.html
+++ b/doc/language-bindings/python-gsapi.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
diff --git a/doc/language-bindings/python-intro.html b/doc/language-bindings/python-intro.html
index 338ff1e4..63cff74d 100644
--- a/doc/language-bindings/python-intro.html
+++ b/doc/language-bindings/python-intro.html
@@ -4,7 +4,7 @@
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="../images/favicon.svg">
+ <link rel="shortcut icon" href="images/favicon.svg">
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/default.js"></script>
</head>
diff --git a/doc/pscet_status.txt b/doc/pscet_status.txt
deleted file mode 100644
index e136d20a..00000000
--- a/doc/pscet_status.txt
+++ /dev/null
@@ -1,5415 +0,0 @@
-# Report of Ghostscript's conformance against the Quality Logic CET suite
-#
-Test Status Comments
-
-08-04- AOK This test is intentionally printer specific and is for information
- only. Ghostscript completes all pages properly.
-
-09-01-1 OK Fixed with gs_cet.ps initialization file
- Default initial condition differs for currentblackgeneration and the
- type and global of the default procedure differ.
-
-09-01-2 OK Verified visually against Tek hardcopy. RJJ
- matches CPSI.
-
-09-02-1 OK Fixed rev 7102. RJJ
-
-09-02-2 OK Colors corrected by rev 7172, fixed by rev. 7201
-
-09-02-3 OK Corrected by 7152 and 7162. ADC
-
-09-02-4 OK Corrected by 7152 and 7162. ADC
-
-09-02-5 OK
-
-09-03-1 OK Fixed rev 7102. RJJ
- cpsi/09-03-1 is bogus. Acrobat 7 output obtained.
-
-09-03-2 OK Fixed rev 7102. RJJ
- cpsi/09-03-2 missing. Acrobat 7 output obtained.
-
-09-03-3 OK Fixed by rev. 7202
-
-09-03-4 OK Fixed rev 7102. RJJ
- cpsi/09-03-4 missing. Acrobat 7 output obtained.
-
-09-03-5 OK Verified visually against Tek hardcopy. RJJ
- cpsi/09-03-5 missing. Acrobat 7 output obtained.
-
-09-03-6 OK Verified visually against Tek hardcopy. RJJ
- cpsi/09-03-6 missing. Acrobat 7 output obtained.
-
-09-03-7 OK Verified visually against Tek hardcopy. RJJ
- cpsi/09-03-7 missing. Acrobat 7 output obtained.
-
-09-03-8 OK Fixed rev 7159.
- cpsi/09-03-8 missing. Acrobat 7 output obtained.
-
-09-03-9 OK
- cpsi/09-03-9 missing. Acrobat 7 output obtained.
-
-09-04-1 OK
-
-09-04-2 OK
-
-09-05-1 DIFF Device Dependent: GS, CPSI and Tek hardcopy all different.
- probably can be made "closer" using gs_cet.ps assign Ray.
-
-09-05-2 OK Device Dependent: GS matches Tek hardcopy. RJJ
-
-09-05-3 OK Device Dependent: GS matches Tek hardcopy. RJJ
-
-09-05-4 OK Device Dependent: GS matches Tek hardcopy. RJJ
-
-09-05-5 OK Device Dependent: GS matches Tek hardcopy. RJJ
-
-09-05-6 OK Device Dependent: GS matches Tek hardcopy after fixed by rev. 7203
- (CPSI much different)
-
-09-05-7 OK Device Dependent: GS matches Tek hardcopy. RJJ
-
-09-05-8 OK
-
-09-06-1 OK Fixed in rev. 7162. - Alex and RJJ
-
-09-06-2 OK Fixed in rev. 7162. - Alex and RJJ
-
-09-06-3 OK Fixed rev. 7159 and 7162. - Alex and RJJ
-
-09-06-4 OK Fixed in rev. 7162. - Alex and RJJ
-
-09-06-5 OK Fixed in rev. 7162. - Alex and RJJ
-
-09-07-1 OK Rev. 7207 changes Ghostscript to match Tek.
- The attributes of the arrays returned by currentcolortransfer
- vary between PS interpreters. PLRM doesn't require any
- particular attributes. Initial graphic state is created by an OEM,
- not Adobe.
-
-09-07-2 OK
-
-09-07-3 OK
-
-09-07-4 OK
-
-09-08-1 OK Fixed in rev. 7207
-
-09-08-2 OK
-
-09-08-3 OK
-
-09-09-1 OK Device Dependent: GS matches Tek hardcopy. CPSI always uses setflat == 1.
- GS clamps setflat value minimum as 0.2 and maximum at 100.0 same as Tek.
-
-09-09-2 OK Device Dependent: GS matches Tek hardcopy. CPSI always uses setflat == 1.
- GS clamps setflat value minimum as 0.2 and maximum at 100.0 same as Tek.
-
-09-09-3 OK
-
-09-10-1 OK Fixed rev 7102. RJJ
-
-09-10-2 OK "0" vs. "0.0" is fixed in rev. 7186.
-
-09-10-3 OK Fixed rev 7102. RJJ
-
-09-10-4 OK Colors corrected by rev 7172.
-
-09-10-5 OK
-
-09-11-1 AOK GS has different small numbers near zero (e-5) than CPSI Tek has 0.0
-
-09-11-2 OK Corrected by revision 7162 (Alex). - ADC
-
-09-11-3 OK Minor differences visually reviewed by RJJ
-
-09-11-4 OK
-
-09-11-5 AOK Implementation dependent: Tek and CPSI and GS all different. GS does
- match 09-11-7 (Test B3) as the test comments state.
-
-09-11-6 OK
-
-09-11-7 AOK Implementation dependent: Tek and CPSI and GS all different. GS does
- match 09-11-5 (Test B1) as the test comments state.
-
-09-11-8 OK
-
-09-11-9 OK
-
-09-12-1 AOK Device Dependent. Every device has its own initial halftone.
- Rev. 7208 makes currenthalftone return a read-only dictionary.
- Adding a HalftoneType 9 as the Default entry to Resource/Halftone
- path allows us to match Tek. Halftone isn't used with contone anyway.
-
-09-12-2 AOK Device Dependent, Resolution dependent. Tek and CPSI differ
- GS matches Tek hardcopy for SYNTAX 1 at 300dpi, SYNTAX 2
- GS prints /Angle = 0, Tek shows /Angle = 0.0
-
-09-12-3 OK GS matches Tek hardcopy. CPSI much different.
-
-09-12-4 OK Resolution and Orientation dependent: GS matches Tek hardcopy at 300
- dpi landscape.
-
-09-12-5 OK GS at 300 dpi matches Tek hardcopy and checksum. Resolution dependent.
-
-09-12-6 OK Resolution and Orientation dependent: GS matches Tek hardcopy at 300
- dpi landscape.
-
-09-12-7 OK Resolution and Orientation dependent: GS matches Tek hardcopy at 300
- dpi landscape.
-
-09-12-8 OK GS matches Tek hardcopy. CPSI much different.
-
-09-12-9 OK
-
-09-13-1 OK Fixed rev 7102. RJJ
-
-09-13-2 OK Fixed again by rev 7215 after rev 7124 caused problem. Matches Tek
- harcopy.
-
-09-13-3 OK Fixed rev 7102. RJJ
-
-09-13-4 OK
-
-09-13-5 OK
-
-09-14-1 OK Minor differences visually reviewed by RJJ
-
-09-14-2 OK
-
-09-15-1 OK Minor differences visually reviewed by RJJ
-
-09-15-2 OK
-
-09-16-1 OK
-
-09-16-2 OK
-
-09-16-3 OK
-
-09-17-1 OK
-
-09-17-2 OK
-
-09-17-3 OK
-
-09-18-1 OK
-
-09-18-2 OK
-
-09-19-1 OK Fixed rev 7102. RJJ
-
-09-19-2 OK GS matches Tek hardcopy. CPSI gives 0.63 'B' value on first line of
- third group -- Tek is probably correct. "0" vs. "0.0" is fixed in rev. 7186.
-
-09-19-3 OK Fixed rev 7102. RJJ
-
-09-19-4 OK
-
-09-19-4 OK
-
-09-19-5 OK
-
-09-20-1 AOK Device Dependent: different default screen (OK)
- GS matches Tek on the rest.
-
-09-20-2 OK Device Dependent: Matches Tek hardcopy and checksum. RJJ
-
-09-20-3 OK Device Dependent: Matches Tek hardcopy and checksum. RJJ
-
-09-20-4 DIFF Device Dependent, Resolution dependent. Tek and CPSI differ
- GS almost matches Tek hardcopy except "Actual Angle" when
- AccurateScreens=true is 100.6 for GS (100.0 for Tek) and
- GS shows "100 27" instead of "100.0 27.0" Assign: Ray
-
-09-20-5 OK
-
-09-21-1 OK
-
-09-21-2 OK
-
-09-21-3 OK
-
-09-22-1 OK Rev. 7207 changes Ghostscript to match Tek.
- See 09-07-01 for details.
-
-09-22-2 OK
-
-09-22-3 OK
-
-09-22-4 OK
-
-09-23-1 OK Fixed by gs_cet.ps RJJ
-
-09-23-2 OK
-
-09-24-1 OK
-
-09-24-2 OK Fixed by rev 7617.
-
-09-24-3 OK Fixed by r7123.
-
-09-24-4 OK
-
-09-25-1 OK
-
-09-25-2 OK Fixed by rev 7617.
-
-09-25-3 OK Fixed by r7123.
-
-09-25-4 OK
-
-09-26-1 OK Minor differences visually reviewed by RJJ
-
-09-26-2 OK Fixed by rev 7617.
-
-09-26-3 OK Fixed by r7123. Color corrected by rev 7172.
-
-09-26-4 OK
-
-09-27-1 AOK GS has different small numbers near zero (e-5) than CPSI Tek has 0.0
- Device Dependent.
-
-09-27-2 OK Minor differences visually reviewed by RJJ
-
-09-27-3 OK Fixed by rev 7617.
-
-09-27-4 OK Fixed by r7123. Color corrected by rev 7172.
-
-09-27-5 OK
-
-09-28-1 AOK Ghostscript is different from both Tek and PhotoPrint but
- matches Distiller 5. Tek doesn't reset the dash array at
- initgraphics. PhotoPrint redefines halftone operators as no-op,
- which affects the test results. Fixed by rev. 7792. - Alex
-
-09-28-2 OK Fixed as of rev. 7211
-
-09-28-3 OK Fixed by rev 7617.
-
-09-28-4 OK Imagemask -- Fixed by r7123. Tek and AD7 output differ.
-
-09-28-5 OK Matches Tek hardcopy output. RJJ
-
-09-29-1 AOK Device Dependent: GS has ProcessColorModel /DeviceRGB, Tek has non-standard
- /DeviceCMY. GS matches Tek if BG, UCR set the same and ProcessColorModel is
- forced to /DeviceCMY. CPSI shows ProcessColorModel /DeviceN. DeviceRGB
- values fixed in rev. 7216
-
-09-29-2 OK Fixed by rev 7617.
-
-09-29-3 OK Imagemask -- Fixed by r7123. Tek and AD7 output differ.
-
-09-29-4 OK
-
-09-30-1 OK Colors corrected by rev 7172.
-
-09-30-2 OK Error reports are fixed in rev. 7138. - Alex
-
-09-30-3 OK Colors corrected by rev 7172. Fixed by rev 7617.
-
-09-30-4 OK Fixed by r7123. Color corrected by rev 7172.
-
-09-30-5 OK
-
-09-31-1 OK Matches Tek hardcopy output. RJJ
- cpsi/09-31-1 bogus. Acrobat 7 output obtained.
-
-09-31-10 OK Matches Tek hardcopy output. RJJ
- cpsi/09-31-10 missing. Acrobat 7 output obtained.
-
-09-31-2 OK Matches Tek hardcopy output. RJJ
- cpsi/09-31-2 missing. Acrobat 7 output obtained.
-
-09-31-3 OK Matches Tek hardcopy output. RJJ
- cpsi/09-31-3 missing. Acrobat 7 output obtained.
-
-09-31-4 AOK GS Matches Acrobat 7 output. Tek output has small dark rectangles
- that are not correct.
- cpsi/09-31-4 missing. Acrobat 7 output obtained.
-
-09-31-5 OK Matches Tek hardcopy output. RJJ
- cpsi/09-31-5 missing. Acrobat 7 output obtained.
-
-09-31-6 OK Fixed revs 7159 and 7187.
- NOTE: AD7 gets limitcheck as pre-7159 GS and matches that GS output.
- cpsi/09-31-6 missing. Acrobat 7 output obtained.
-
-09-31-7 OK Matches Tek hardcopy output. RJJ
- cpsi/09-31-7 missing. Acrobat 7 output obtained.
-
-09-31-8 OK Fixed by rev 7617.
- cpsi/09-31-8 missing. Acrobat 7 output obtained.
-
-09-31-9 OK Matches Tek hardcopy output. RJJ
- cpsi/09-31-9 missing. Acrobat 7 output obtained.
-
-09-32-1 OK Verified visually against Tek hardcopy by Sabrina / RJJ
- cpsi/09-32-1 missing. Acrobat 7 output obtained.
-
-09-32-2 OK Error codes are adjusted to match the checksum. rev. 7167 - Alex
- cpsi/09-32-2 missing. Acrobat 7 output obtained.
-
-09-32-3 OK Fixed by rev 7617.
- cpsi/09-32-3 missing. Acrobat 7 output obtained.
-
-09-32-4 OK Matches Tek hardcopy output. RJJ
- cpsi/09-32-4 missing. Acrobat 7 output obtained.
-
-09-32-5 OK Verified visually against Tek hardcopy by Sabrina / RJJ
- cpsi/09-32-5 missing. Acrobat 7 output obtained (but differs).
-
-09-33-1 OK
-
-09-33-2 OK Matches Tek hardcopy output. RJJ
-
-09-33-3 OK Fixed by rev 7617.
-
-09-33-4 OK Fixed by r7123. Color corrected by rev 7172.
-
-09-33-5 OK Fixed rev. 7217
-
-09-34-1 OK Matches Tek hardcopy output. RJJ
-
-09-34-10 OK Matches Tek hardcopy output. RJJ
- cpsi/09-34-10 missing
-
-09-34-11 OK Matches Tek hardcopy output. RJJ
- cpsi/09-34-11 missing
-
-09-34-12 AOK GS has smooth gradients, Tek hardcopy has dark gray stripe up
- middle of gradients. GS matches AD7
- I found that once I set embedded an sRGB colorrendering
- dictionary, which is what AD7 uses for RGB matching,
- GS and AD7 were nearly a perfect match. There was only
- one relatively small rectangle area pointed out by cmpi in a
- single ramp ( the CIEDefg [ffff] row). It appears that the TEK
- output is the one that is incorrect. TIM
- cpsi/09-34-12 missing
-
-09-34-13 OK Fixed revs 7159 and 7187.
- cpsi/09-34-13 missing
-
-09-34-14 OK Matches Tek hardcopy output. RJJ
- cpsi/09-34-14 missing
-
-09-34-15 AOK Mostly matches Tek hardcopy output. GS has smooth gradients, Tek
- has dark gray stripe in middle of 8th row. GS matched AD7
- --
- In my tests with GS, AD5 as well as the AD7 output, none show
- the dark gray stripe mentioned. It is my opinion that TEK is the
- one that is failing. TIM
- cpsi/09-34-15 missing
-
-09-34-16 AOK GS missing some graphics seen on Tek hardcopy.
- Probably RGB vs. CMYK device color - RJJ.
- I do not understand Ray's comment. Using the ppmraw device, I
- see all of the graphics at the right side of the page. Please
- note that the appearance of this page depends upon the process
- color model of the output device. The page uses spot colors.
- Thus the appearance of the page depends upon how the device
- treats spot colors. One of the spot color is called C1 and it
- is white. The C1 spot color is printed on top of the lower four
- graphics. Thus if the output device supports spot colors then
- this results in a white appearance for this section of the page.
- The GS tiffsep device (which supports spot colors) shows this
- section of the page as being white. The tiffsep device also
- produces a separation for the C1 spot color which shows the area
- covered by this ink. Devices which do not support spot colors
- use the tint transform function to convert the spot colors into
- process colors. Logically the tint tranform functions should
- produced the same appearance as the spot colors. However this is
- not the case with this page. Thus devices which do not support
- spot colors such as the ppmraw (process color model = DeviceRGB)
- or the tiff32nc (device process color = DeviceCMYK only) use the
- tint transform functions are producing different appearances.
- The same effect can be seen with Distiller/Acrobat 7.0. The
- presence of the spot colors can be examined with the 'Output
- Preview' feature. Disabling the 'Overprint Preview' changes
- the process color model of Acrobat to DeviceRGB. This forces
- the use of the tint transform functions by Acrobat. The
- 'missing' graphics then appear.
- cpsi/09-34-16 missing
-
-09-34-17 OK Fixed by rev 7617.
- cpsi/09-34-17 missing
-
-09-34-18 OK Fixed by r7123.
- cpsi/09-34-18 missing
-
-09-34-19 OK Matches Tek hardcopy output. RJJ
- cpsi/09-34-19 missing
-
-09-34-2 AOK GS has Yellow graphic, Tek shows Red for 'SeparateUnBlue setcolorspace'
- (right of "1.0" text). Probably RGB vs. CMYK device color
- NOTE: AD7 and Tek hardcopy output differ in same areas. - RJJ
- Distiller/Acrobat 7.0 differ on four graphics. These are the five below
- the text that says "( /HIVAL 4095 def )". Distiller/Acrobat shows the
- first four of these as a grayish shade. The fifth is a paler shade of
- gray. GS shows these as black, gray, burgandy, brown, and red respectively.
- - ADC.
- From what I can see the yellow graphic that GS creates is
- correct. The color space is aptly named "SeparateUnblue" (see
- further below), since "un-blue" is yellow, this lead me to
- believe yellow is what should be produced. Upon further digging
- into the color space and putting some debug messages in the
- tintTransform procedure, it also seems to be correct. From what
- I can see the tint tintTransform procedure takes the blue value
- and does some math on it to vary it in the range of 0.0 to 1.0.
- It also places two ones on the stack just ahead of this blue
- value so that all values passed to the /DeviceRGB are in the
- range 1,1,0 to 1,1,1, which are various shades of yellow.
- --
- When I first did this I didn't know about the AD7 output... This
- further verifies that the yellow is correct as AD7 matches GS
- for this part of the job.
- --
- There is a second unresolved issue below the section that says
- "/HIVAL 4095 def". I believe again that the four non-matching
- graphics produced by GS are correct. For example...
- --
- The burgandy and brown are produced by the following code, respectively:
- /HIVAL 4095 def
- ...
- (gs Indexed_RGB_Proc setcolorspace 2048 setcolor Q)
- (gs Indexed_RGB_Proc setcolorspace 3072 setcolor Q)
- With the following colorspace definition:
- /Indexed_RGB_Proc
- {
- [
- /Indexed
- /DeviceRGB
- HIVAL
- {
- dup
- HIVAL
- div
- exch
- HIVAL
- 2
- idiv
- dup
- 2
- index
- exch
- mod
- exch
- div
- exch
- HIVAL
- 3
- idiv
- dup
- 3
- -1
- roll
- exch
- mod
- exch
- div
- }
- ]
- }
- def
- --
- Basically this space produces as output RGB values where the B's
- that are split into 3 ranges by B_out= ( Value_in mod (HIVAL/3)
- ) / (HIVAL/3), G's that are split into 2 ranges by G_out =
- (Value_in mod (HIVAL/2) ) / (HIVAL/ 2) and the R's are in one
- range by R_out = Value_in / HIVAL. So a input value of 1/2 of
- the input range (determined by HIVAL) produces an output of
- roughly R=0.5, G=0, B=0.5. An input value of .75 of the input
- range produces and output of roughly R=.74,G=.5,B=.25
- --
- I modified the colorspace to dump the stack at the end of its
- number crunching tintTransform procedure. I printed out the
- values for the burgandy and brown graphic sections and here is
- what I got back.
- --
- 2048 setcolor
- 0.500366 // B
- 0.00048852 // G
- 0.500122 // R
- Which is the burgandy color mentioned.
- --
- 3072 setcolor
- 0.250549 // B
- 0.500733 // G
- 0.750183 // R
- Which is the brown color mentioned.
- This verified to me that GS is doing the right thing. TIM
- cps/09-34-2 missing
-
-09-34-3 AOK GS RGB has missing graphic, Tek shows Cyan for 'SeparateUncyan setcolorspace'
- (right of "1.0" text). GS matches Tek if Cyan, Magenta, Yellow and Black
- Separation colorspaces are known, as with the 'tiffsep' device. A printer
- that is CMYK will usually have the Separations available for overprint
- effects. RJJ
- -
- NOTE: AD7 and Tek hardcopy output differ in same areas. RJJ
- GS produces output matching Tektronix if 'tiffsep' device since this
- device does not use the tint transform on /Cyan separation used in the
- SeparationUncyan section.
- -
- The 'SeparateUncyan' issue is another example of a separation color space
- which (intentionally ?) has a tint transform function which produces different
- colors when it is used. Thus the output depends upon whether or not the tint
- transform function is used. This can be seen by disabling the 'Overprint
- Preview' feature in Acrobat 7.0. GS produces results which are consistent with
- Acrobat for both cases. (this is expected). ADC
- cpsi/09-34-3 missing
-
-09-34-4 OK Matches Tek hardcopy output. RJJ
- cpsi/09-34-4 missing
-
-09-34-5 OK Matches Tek hardcopy output. RJJ
- cpsi/09-34-5 missing
-
-09-34-6 AOK GS matches graphics colors, but the code equivalent to
- /Pattern setcolorspace 16 16 true matrix { (jihad) } imagemask
- leaves imagemask operands on the stack on Adobe interpreters.
- This is an obvious bug that we don't want in Ghostscript.
- cpsi/09-34-6 missing
-
-09-34-7 AOK GS has different 'currentcolor' results and different color graphics
- Probably RGB vs. CMYK device color
- NOTE: AD7 and Tek hardcopy output differ in same areas. - RJJ
- There are two issues with this page. The first issue is the colors of
- of the various graphics on the page. The page has spot colors. It
- also has tint transform functions which do not provide logically
- consistent results. Thus the appearance of the graphics depend upon
- if the tint transform functions are being used. The results with GS
- match the results from Acrobat 7.0 as expected.
- The second issue (which is a problem) is that the currentcolor value
- for the CIEBasedDEFG differs. The graphic for the same line is also
- missing (which is probably related.) - ADC
- --
- The differences were releated to the colorrendering dictionary
- in use. When I embedded an sRGB CRD the output matched AD5/AD7. TIM
- cpsi/09-34-7 missing
-
-09-34-8 OK Matches Tek hardcopy output. RJJ
- cpsi/09-34-8 missing
-
-09-34-9 OK Matches Tek hardcopy output. RJJ
- cpsi/09-34-9 missing
-
-09-35-1 OK Matches Tek hardcopy output. RJJ
-
-09-35-2 OK Color difference (cmpi -c25 is OK, -c24 detects all pixels differ),
- otherwise fixed by rev 7617.
- Presumed to match Tek (different inks, etc.) since this test uses
- 'setcolortransfer' which is ignored by CPSI. RJJ
-
-09-35-3 OK Fixed by r7123.
-
-09-35-4 OK Minor color difference.
-
-09-36-1 OK Minor differences visually reviewed by RJJ
-
-09-36-2 OK Minor differences visually reviewed by RJJ
-
-09-36-3 OK Fixed by rev. 7226
-
-09-36-4 NF Dash pattern differences with GS.
- Analyzed by Igor.
- -
- GS rounds coordinates to 1/256th of a pixel.
- Due to that, when a curve is converted into a polygon,
- its vertices are rounded, and therefore the length
- of the polygon becomes few bigger than the ideal polygon.
- Then applying the dash, it covers a smaller part
- of the polygon than with CPSI.
- -
- One possible solution is :
- Add floating coordinates to path segments.
- The floating coordinates duplicate fixed ones,
- and used only for computing the segment length.
- The old fixed coordinated are used for anything else
- as they do now.
-
-09-36-5 DIFF In "Technical Paths", Ghostscript differs a lot, combination
- of 09-24-2 linecap linejoin issues and dash issues. Defer
- this until after 09-24-2 is addressed.
- Need CPSI for investigations.
- Assign: Ray
-
-09-36-6 OK Fixed by r7123.
-
-09-36-7 OK Fixed as of r7500.
-
-09-37-1 AOK GS similar to Tek, but the value at which polygon edges changes from
- 16 to 8 differs (GS at 53, Tek at 19). Also Tek changes from 'smooth'
- to 16 at 5, GS at 13. CPSI fixed to implement setflat changes from
- smooth to 16 sides at 9 (GS at 13), CPSI never has less than 16 sides.
- Resolution dependent (spec is 'output device pixels') and PLRM 3rd ed
- states "If the flatness parameter is large enough to cause visible
- straight line segments to appear, the result is unpredictable."
- When GS is run at 300 dpi (same resolution as Tek), the transition
- from smooth to 16 sides is at 7 (vs. 5 on the Tek) and from 16 to 8
- sides at 27 (vs. 19 on the Tek).
- -
- Since Tek and CPSI differ, and GS generally uses more line segments,
- the GS output conforms and is superior to the Tek output.
-
-09-37-10 OK GS matches Tek and CPSI output now matches Tek (12/04/06).
- Imagemask turkey fixed by r7123.
-
-09-37-11 OK Matches Tek hardcopy output. RJJ
-
-09-37-2 OK Matches Tek hardcopy output. RJJ
-
-09-37-3 OK Matches Tek hardcopy output. RJJ
-
-09-37-4 AOK GS similar to Tek, but the value at which polygon edges changes to
- very coarse differs (GS at 73, Tek at 23). Also Tek changes from 'smooth'
- to bumpy at 5, GS at 19. When GS is run at 300 dpi, the transitions
- from smooth to bumpy is at 11, and from bumpy to very coarse at 39.
- Resolution dependent (spec is 'output device pixels'). CPSI fixed to
- implement setflat transitions to bumpy at 13 and to coarse at 33.
- -
- Since Tek and CPSI differ, and GS generally uses more line segments,
- the GS output conforms and is superior to the Tek output.
-
-09-37-5 OK Matches Tek hardcopy output. RJJ
-
-09-37-6 OK Very small fill differences. RJJ
-
-09-37-7 OK Very small fill differences. RJJ (CPSI ignores setflat, GS
- similar to Tek hardcopy)
-
-09-37-8 DIFF GS similar to Tek, but GS differs in the exact polygon shapes.
- Resolution dependent (spec is 'output device pixels'). GS at 300
- dpi has less edges on large outline in top two images. CPSI (at
- 600 dpi) also smoother than GS on top two outlines.
- assign: Ray
-
-09-37-9 DIFF "Stroked_Objects" and "Filled_Objects" differ slightly with
- number of polygonal edges. Tek shows strokepath of "Technical
- Paths" IS subject to setflat -- GS has smoother round cap/join.
- Resolution dependent (spec is 'output device pixels'). CPSI fixed
- to implement setflat matches Tek ouptut for "Technical paths".
- Assign: Ray
-
-09-38-1 OK Minor differences visually reviewed by RJJ
-
-09-38-2 OK Fixed by rev 7617.
-
-09-38-3 OK Fixed by r7123.
-
-09-38-4 OK
-
-09-39-1 OK Matches Tek hardcopy output. RJJ
-
-09-39-2 OK matches CPSI
-
-09-39-3 OK matches CPSI. Imagemask fixed by r7123.
-
-09-39-4 OK
-
-09-40-1 AOK Matches Tek hardcopy output. RJJ (CPSI ignores settransfer)
- GS is contone, Tek is dithered
-
-09-40-10 OK
-
-09-40-11 OK
-
-09-40-12 OK
-
-09-40-13 OK
-
-09-40-14 OK
-
-09-40-15 OK
-
-09-40-16 OK
-
-09-40-17 OK
-
-09-40-18 OK
-
-09-40-19 OK Matches Tek hardcopy output. RJJ (CPSI ignores settransfer)
-
-09-40-2 AOK GS is contone, Tek is dithered, otherwise GS matches Tek.
- CPSI ignores transfer function.
-
-09-40-20 OK Minor differences visually reviewed by RJJ
-
-09-40-21 AOK GS and Tek give 'rangecheck' for last three "Test I". GS
- matches Tek except GS is contone, Tek is dithered.
-
-09-40-22 OK
-
-09-40-23 OK Fixed by rev 7617.
-
-09-40-24 OK Fixed by r7123. Color corrected by rev 7172.
-
-09-40-25 OK
-
-09-40-3 OK
-
-09-40-4 OK
-
-09-40-5 OK
-
-09-40-6 OK
-
-09-40-7 OK
-
-09-40-8 OK GS matches Tek since rev. 7168 - Alex
-
-09-40-9 OK
-
-09-41-1 OK
-
-09-41-2 OK Fixed by rev 7617.
-
-09-41-3 OK Fixed by r7123.
-
-09-41-4 OK Fixed by r7124.
-
-09-42-1 OK
-
-09-42-2 OK
-
-09-42-3 OK Minor differences visually reviewed by RJJ
-
-09-42-4 OK
-
-09-42-5 OK Fixed by rev 7617.
-
-09-42-6 OK Fixed by r7123.
-
-09-42-7 OK
-
-09-43-1 OK
-
-09-43-2 OK
-
-09-43-3 OK Minor differences visually reviewed by RJJ
-
-09-43-4 OK
-
-09-43-5 OK Fixed by rev 7617.
-
-09-43-6 OK Fixed by r7123.
-
-09-43-7 OK
-
-09-44-1 OK Minor differences visually reviewed by RJJ
-
-09-44-2 OK
-
-09-44-3 OK Minor differences visually reviewed by RJJ
-
-09-44-4 OK
-
-09-44-5 OK Fixed by rev 7617.
-
-09-44-6 OK Fixed by r7123.
-
-09-44-7 OK
-
-09-45-1 OK
-
-09-45-2 OK
-
-09-45-3 OK
-
-09-45-4 OK
-
-09-45-5 DIFF Partly fixed by rev 7617. Remaining diff is width of miter
- extension in "Stroked Objects". Assign: Ray
-
-09-45-6 OK Fixed by r7123.
-
-09-45-7 OK
-
-09-46-1 OK Minor differences visually reviewed by RJJ
-
-09-46-2 OK
-
-09-47A-1 OK Matches Tek hardcopy output. RJJ
-
-09-47A-2 OK Matches Tek hardcopy output. Minor color differences. RJJ
-
-09-47A-3 OK Minor differences visually reviewed by RJJ
-
-09-47A-4 OK Matches Tek hardcopy output. RJJ
-
-09-47A-5 OK Matches Tek hardcopy output. RJJ
-
-09-47A-6 OK Matches Tek hardcopy output. RJJ
-
-09-47A-7 OK Matches Tek hardcopy output. RJJ
-
-09-47A-8 DIFF Resolution dependent: GS 'pattern' has double line joined, Tek
- and CPSI do not although Tek and CPSI differ with pattern phase.
- Assign: Ray
-
-09-47A-9 OK Fixed by rev 7169.
-
-09-47B-1 DIFF GS has different pattern phase. Tek and CPSI appear to be the same.
- Assign: Ray
-
-09-47B-10 DIFF Test01 : aok
- CPSI problem. The tensor patch has corner colors like this :
- 00 55
- ff aa
- Thus it must have a horizontal line of a constant color 80
- near the middle. The line is observable with GS and it is not with CPSI.
- Analyzed by Igor.
- -
- Test09 - a color mapping problem.
- Analyzed by Igor.
- CIEBasedDEF colors are given with a sampled
- (2 args, 2 results) function like this :
- 000000 ff0000
- 00ff00 ffffff
- With GS the brightness of magenta is asame as cyan.
- CPSI paints a lighter magenta.
- I guess something is wrong with WhitePoint in GS,
- because an assimmetry red|blue must come from it.
- The assymmetry is observing with CPSI and not with GS.
- Assign to Tim
- -
- Test10: AOK
- Match when using common CRD.
- -
- Test11: AOK
- Match when using common CRD.
-
-09-47B-11 DIFF Test02, Test03 : aok. Same as 09-47B-10 Test11.
- -
- Test04: aok
- Analyzed by Igor.
- Likely CPSI problem.
- The test is buggy - insufficient data for function.
- It needs 16 samples, but 12 are only provided.
- GS adds zeros at end.
- 000000ff 000000ff
- 00ffffff 00000000
- Thus the right end is Magenta+Yellow+Black =
- (1-green + 1-blue)*(1-black) =
- (1 + red)*(1-black).
- It is observing with GS.
- CPSI likely due to occasional data added at stream end.
- See also Test11.
- -
- Test05: AOK
- Analyzed by Igor.
- A bad color CMYK=[1 1 1 1] in the test.
- GPSI and GS differently convert [v v v v] CMYK colors to RGB.
- Matches fine in 7736 with CPSI_mode = true.
- Tim
- -
- Test06: AOK
- Analyzed by Igor.
- A bad color CMYK=[0.7 0.7 0.7 0.7] in the test.
- GPSI and GS differently convert [v v v v] CMYK colors to RGB.
- Matches fine in 7736 with CPSI_mode = true.
- Tim
- -
- Test11: AOK
- This is the same problem as Test04. Bug in test.
- Insufficient data for function.
- /CIEBasedDEFG as /DeviceCMYK in Test04 needs 16 samples,
- and only 12 are provided.
- Tim
- -
- Test12:
- CIEBasedDEFG shading does not match CPSI.
- Assign to Igor
-
-09-47B-12 AOK GS has wrong color Test06 GS not smooth Test07, Test08.
- NOTE: Tek gets rangecheck error on Test03 Test10, CPSI and GS do not.
- .
- According to my reading of the spec, test6 should rangecheck,
- but CPSI returns garbage data instead. r7130 improves match to
- Tek output, but ultimately rendering of this page will be
- device dependent, hence aok. - Raph
-
-09-47B-2 DIFF GS has different pattern phase. Tek and CPSI appear to be the same.
- Assign: Ray
-
-09-47B-3 DIFF GS has different pattern phase. Tek and CPSI appear to be the same.
- Assign: Ray
-
-09-47B-4 OK
-
-09-47B-5 OK Minor color difference, reviewed visually. RJJ
-
-09-47B-6 OK Fixed by rev 7169.
-
-09-47B-7 AOK Test01, Test02 :
- Briefly analyzed by Igor.
- Resolved by using common CRD. Tim
- -
- Test10: aok
- CPSI problem : a non-monotonic color space is rendered as monotonic.
-
-09-47B-8 AOK Test01, Test02, Test03, Test05, Test08, Test09, Test10 : aok
- Analized by Igor.
- CPSI problem : a non-monotonic color is rendered as monotonic.
- -
- Test04, Test11: aok
- Analized by Igor.
- CPSI problem same as 09-47B-10 Test01.
-
-09-47B-9 AOK Test03, Test04, test05, Test06, Test07, Test10, Test11: aok
- Analized by Igor.
- CPSI problem : a non-monotonic color is rendered as monotonic.
- -
- Test08 : aok
- Analized by Igor.
- CPSI has a worse smoothness.
- -
- Test12 : aok
- Analized by Igor.
- CPSI problem same as 09-47B-10 Test01.
-
-09-47C-1 OK Fixed by rev 7221.
-
-09-47C-2 DIFF Rev. 7740 adds 'null' to the message.
- Adobe shows: 'F --show-- rangecheck null'
- At 144 dpi GS shows 'F --.type1execchar-- rangecheck null'.
- At 72 dpi GS shows the same message as Adobe. assign: Peter
-
-09-47D-1 OK Fixed by rev 7169.
-
-09-47D-2 OK Fixed by rev. 7149.
-
-09-47D-3 OK Fixed by rev 7169.
-
-09-47D-4 OK Fixed by rev 7169.
-
-09-47D-5 OK Fixed by rev 7169.
-
-09-47D-6 OK Fixed by rev. 7149.
-
-09-47E-1 OK Fixed by rev 7169.
-
-09-47E-2 OK Fixed by rev 7149.
-
-09-47E-3 OK Fixed by rev 7169.
-
-09-47F-1 OK Fixed by rev 7169.
-
-09-47G-1 AOK Test06: ok.
- rev. 7176 now properly sets errorinfo.
- -
- Test07: aok
- Analyzed by Igor.
- The test is buggy : insufficient stream data,
- the effect does not correspond to the comment in the test.
- Due to insufficient data GS adds zeros at end,
- and the function becomes like this :
- 000000 ff000000 ff00ff ffff0000
- 000000 00000000 000000 00000000
- The DeviceN maps it to DeviceRGB with dropping the last 4 components,
- so we've got corner colors :
- black magenta
- black black
- That's what we observe with GS.
- There is a comment in gsdsrc.c ln 47 :
- /* Access data from a string or a byte object. */
- /* Does check bounds, and returns 0 data oob. Spec calls for rangecheck,
- but CPSI implementation silently gives (bogus) data. */
- Tek paints black magenta
- black red - likely an occasional data at stream end.
- -
- Test10: aok
- Analyzed by Igor.
- A bug in the test : excessive stream data,
- the effect does not correspond to the comment in the test.
- The real effect is a linear sampled function like this :
- Cyan: 00 00
- 00 ff
- Magenta: 00 00
- 00 ff
- Yellow: 00 00
- 00 ff
- Black: 00 00
- 00 ff
- Thus it paints bad CMYK colors [v v v v] for various v.
- Same as 09-47B-11 Test05.
- I believe that [1 1 1 1] is very black, right ?
- Thus CPSI looks wrong.
- GS looks close to Tek.
-
-09-47G-2 AOK Test01: ok
- Fixed with rev 7199.
- -
- Test10: aok
- Analyzed by Igor.
- The linear sampled function is :
- 000000 ff0000
- 00ff00 ffffff
- The function's domain by the 2nd argument
- is twice bigger than the shading domain.
- Therefore the function linear is cropped to this :
- 007700 ff7777
- 00ff00 ffffff
- With CPSI it looks like this (wrong) :
- 000000 ff0000
- 00ff00 ffff77
- With GS it looks like this (correct) :
- 007700 FF7777
- 00ff00 777777
- CPSI appears wrong, GS appears correct.
- -
- Test11: aok
- The function domain is cropped by both coordinates.
- First convert to 3x3 :
- 000000 770000 ff0000
- 007700 777733 ff7777
- 00ff00 77ff77 ffffff
- Then crop with the "positive" quadrant :
- 777733 ff7777
- 77ff77 ffffff
- It looks close to what GS paints.
- CPSI paints something like this :
- 770000 ff0000
- ffff77 7777ff
- CPSI appears wrong, GS appears correct.
-
-09-47G-3 AOK Test01: aok
- The function 000000 ff0000 black red
- 00ff00 ffffff green white
- It is truncated with BBox/Matrix = 0.909, 0.933
- So by theory we get:
- 000000 e70000
- e60000 d1d1d1
- It looks so with GS.
- Don't know why CPSI misses green.
- -
- Test02 : Same as 09-47G-2 Test11.
-
-09-47H-1 OK Fixed by rev 7149.
-
-09-47H-2 OK Fixed by rev 7149.
-
-09-47H-3 OK Partially fixed by rev. 7169, finished by rev. 7176.
-
-09-47H-4 OK Fixed by rev 7206
-
-09-47I-1 OK Fixed by rev 7149.
-
-09-47I-2 OK Fixed by rev 7175.
-
-09-47I-3 OK Test01, Test02, Test03, Test04, Test05, Test06, Test07: ok
- Fixed by rev 7175.
- -
- Test11: OK. Looks fine in rev 7718. Tim.
-
-09-47I-4 OK Fixed as of rev 7211.
-
-09-47I-5 OK Fixed by rev 7175.
-
-09-47I-6 OK Fixed by rev 7175.
-
-09-47I-7 OK Test02, Test03, Test04: ok Fixed by rev 7175.
- Test11: ok Fixed with rev 7179.
-
-09-47I-8 OK Test02, Test04: ok Fixed with rev 7179.
- -
- Test07, Test11: ok Fixed by rev 7175.
- -
- Test06, Test08: ok Fixed with rev 7218.
- - -
- Test12: ok Fixed by rev 7175.
-
-09-47J-1 DIFF Graphic differences in Test01 (partly drawn) and Test12
- (green line across the shading). Assign: Igor
-
-09-47J-10 OK
-
-09-47J-2 OK
-
-09-47J-3 AOK Test01 CPSI misses an imagemask with a shading color.
-
-09-47J-4 OK
-
-09-47J-5 OK
-
-09-47J-6 OK
-
-09-47J-7 OK
-
-09-47J-8 AOK Test01 CPSI misses an imagemask with a shading color.
-
-09-47J-9 OK
-
-09-47K-1 AOK Test01 CPSI yields a rangecheck while rendering
- an imagemask or a character with a shading color.
- and misses the rest of graphics.
- I don't see any legal reason for rangecheck.
-
-09-47K-2 OK
-
-09-47K-3 OK
-
-09-47K-4 OK
-
-09-47K-5 OK
-
-09-47K-6 OK
-
-09-47K-7 AOK Test01 CPSI yields a rangecheck while rendering
- an imagemask or a character with a shading color.
- I don't see any legal reason for rangecheck.
- Graphics appearance matches CPSI visually.
-
-09-47K-8 OK
-
-09-47L-1 AOK Test01 CPSI misses the character and imagemask with
- a shading color.
-
-09-47L-2 OK
-
-09-47L-3 OK
-
-09-47L-4 OK
-
-09-47L-5 DIFF Test01 CPSI misses the character and imagemask with
- a shading color.
- Test07, Test08 -- GS missing 'wedges' in center region
- of shading.
-
-09-47M-1 AOK Test01: The corner colors are : black red
- green white
- GS paints entire shading.
- CPSI misses for imagemask and character. AD7 paints character,
- but misses imagemask.
- Analyzed by Igor.
-
-09-47M-2 OK Fixed by rev 7149.
-
-09-47M-3 OK Fixed by rev 7169.
-
-09-47M-4 AOK Test01 : ok, similar to 09-47M-1. (CPSI misses imagemask and
- character, AD7 misses imagemask).
- -
- Test04: ok - Fixed with rev 7210.
- Note: AD7 gets "drawing error" on the PDF it creates from this
- as it is drawing Test04. GS is able to display entire Page and
- output matches GS rendering of 09-47M.PS. Bug in Acrobat 7
- Reader!
- -
- Test09: ok - Fixed with rev 7210.
- -
- Test10, Test11, Test12: ok - Fixed by rev 7206
-
-09-47M-5 AOK GS has smoother shadings (CPSI has triangle 'glitches'
- with self-intersectint tensor: Test05, 06
- Test10-12). NOTE: Tek shapes and colors differ greatly.
-
-09-47N-1 DIFF A different flattening. Assign: Ray
-
-09-47N-2 OK Fixed by r7123.
-
-09-47N-3 AOK Really minor phase difference in pattern. RJJ
-
-09-48-1 OK Fixed in rev. 7138 - Alex
-
-09-48-2 OK Fixed by rev 7617.
-
-09-48-3 OK Fixed by r7123.
-
-09-48-4 OK
-
-09-49A-1 OK
-
-09-49B-1 OK
-
-09-49B-2 AOK Wrong value of AccurateScreens is fixed by rev. 7741.
- CPSI-based PhotoPrint product ignores all attempts to change
- the halftone and cannot be used as a reference.
- GS is close to Tek Special Test B except for resolution
- dependent numbers for ActualFrequency. Test C ActualFrequency is
- also Device Dependent. - Alex
-
-09-49C-1 OK Matches Tek hardcopy and checksum. RJJ (CPSI differs because it
- ignores setscreen).
-
-09-49D-1 OK Fixed by rev 7617.
-
-09-49D-2 OK Fixed by r7123. Color corrected by rev 7172.
-
-09-49D-3 OK Fixed by r7450
-
-09-50-1 DIFF GS has different line spacing. CPSI and Tek agree. GS gets same
- results for "false setstrokeadjust" "true setstrokeadjust".
- Assign: Ray
-
-09-50-2 OK
-
-09-50-3 DIFF GS missing radial lines filling arcs. Tek and CPSI agree. May
- be related to 09-24-2. Assign: Ray
-
-09-50-4 OK Fixed by r7123.
-
-09-50-5 OK
-
-09-51-1 OK Matches Tek hardcopy. RJJ (CPSI ignores settransfer).
-
-09-51-2 OK Fiexd by rev 7617. GS matches colors of Tek hardcopy, CPSI
- shows MUCH different colors.
-
-09-51-3 OK Fixed by r7123. GS matches colors of Tek hardcopy, CPSI
- shows MUCH different colors.
-
-09-51-4 OK Minor color difference (looks black to me). USE_ADOBE_CMYK_RGB issue
- assign: Ray
-
-09-52-1 AOK Device Dependent: GS has default ProcessColorModel /DeviceRGB
- CPSI has /DeviceN, Tek has /DeviceCMY (not a standard one??)
-
-09-52-2 OK Fixed by rev 7617.
-
-09-52-3 OK Fixed by r7123.
-
-09-52-4 OK Fixed by gs_cet.ps RJJ
-
-09-53-1 OK Fixed by r7155 - Raph
-
-09-53-2 OK Fixed by r7155 - Raph
-
-09-53-3 OK Minor differences visually reviewed by RJJ
-
-09-53-4 OK GS has different numbers (off by 1.0 or 2.0 out of ~120.0). Related
- to cliprestore.
- Fixed by r7155 - Raph
-
-09-53-5 OK Fixed by rev 7617.
-
-09-53-6 OK Fixed by r7123. Color corrected by rev 7172.
-
-09-53-7 OK
-
-09-54-1 AOK GS has > 1000 limit on clipsave. Tek and CPSI limit at 34.
- Device Dependent.
-
-09-54-2 OK Fixed in r7155 - Raph
-
-09-54-3 OK Fixed in r7155 - Raph
-
-09-54-4 OK Fixed in r7155 - Raph
-
-09-54-5 OK Fixed in r7155 - Raph
-
-09-54-6 OK Fixed by rev 7617.
- assign: Ray
-
-09-54-7 OK Fixed by r7123. Color corrected by rev 7172.
-
-09-54-8 OK Matches Tek hardcopy and CPSI. RJJ
-
-09-55-1 AOK Implementation dependent: GS allows small smoothness values,
- Tek clamps lower value to 0.005, CPSI to 0.002.
-
-09-55-2 OK
-
-09-56-1 AOK Device Dependent: Tek and Adobe show '/findcolorrendering'
- instead of '--findcolorrendering--' with errors. I've checked
- in a fix for the setcolorrendering issue. /GenericImagesetter
- and /AppleMonitor are CRD's provided by Adobe to OEM as
- examples. They must be removed from the final product but
- Scanvec-Amiable forgot.
- -
- The checksum depends on the order of resource enumeration,
- which depends on the order of dictionary enumeration and
- directory enumeration for external halftones.
-
-09-56-2 OK revisin 7234 (peter)
-
-09-56-3 OK Ghostscript matches the checksum for Tek360 version of the test.
- PhotoPrint has extra '1' in GRAY33 that tests that whether the
- change in colorspace affects CRD. Surprisingly, it does.
- Tek scan and Distillier 5 have '1' in MEMO 03 and 04, i.e.
- have different default CRD and a CRD returned by /Saturation
- findcolorrendering. CRD selection is implementation dependent
- and is normally left to OEM.
-
-09-57-1 AOK Fixed by rev 7169.; GS has a better smoothing.
-
-09-57-10 OK Fixed by rev 7169.
- NOTE: Tek is MUCH different (wrong??)
-
-09-57-11 OK Fixed by rev 7169.
- NOTE: Tek is all blank graphics (wrong??)
-
-09-57-12 OK Matches Tek hardcopy. RJJ (CPSI differs)
-
-09-57-13 AOK Test 09-12: With bad smoothness CPSI shadings are worse.
- Analyzed by Igor.
-
-09-57-14 OK Fixed by rev 7617.
-
-09-57-15 OK Fixed by r7123.
-
-09-57-16 OK
-
-09-57-2 AOK Fixed by rev 7169.; GS has a better smoothing.
-
-09-57-3 AOK Fixed by rev 7169.; GS has a better smoothing.
-
-09-57-4 AOK Fixed by rev 7169.; GS has a better smoothing.
-
-09-57-5 AOK Fixed by rev 7169.; GS has a better smoothing.
-
-09-57-6 AOK Test04: With bad smoothness CPSI shadings are worse.
-
-09-57-7 OK
-
-09-57-8 OK Reviewed by RJJ. (something must have fixed this)
-
-09-57-9 OK Fixed by rev 7169.
-
-09-58-1 AOK Device Dependent: GS returns /none (4th line), Tek and CPSI return
- /DefaultHalftone. GS matches Tek for some lines, CPSI for others.
-
-09-59-1 AOK Device Dependent: CPSI and Tek hardcopy differ.
-
-09-60-1 OK
-
-10-01-1 OK
-
-10-01-2 OK
-
-10-01-3 OK
-
-10-01-4 OK Minor differences in positions and character shapes - ADC
-
-10-01-5 OK Minor differences visually reviewed by RJJ
-
-10-01-6 AOK GS matches Tek hardcopy. CPSI differs in gradient in section
- labeled 'Fountain_image' in the upper left.GS also
- matches the appearance of of Distiller/Acrobat 7.0 - ADC
-
-10-01-7 OK Color corrected by rev 7172.
-
-10-02-1 OK
-
-10-02-2 OK
-
-10-02-3 OK
-
-10-02-4 OK
-
-10-02-5 OK
-
-10-02-6 OK Minor differences in positions and character shapes - ADC
-
-10-02-7 OK Minor differences visually reviewed by RJJ
-
-10-02-8 AOK Differences between CPSI and GS in gradient in section
- labeled 'Fountain_image' in the upper right. However GS
- matches the appearance of of Distiller/Acrobat 7.0. See
- 10-01 page 6. - ADC
-
-10-02-9 OK
-
-10-03-1 AOK First section contains values dependent upon the initial CTM.
- Different initial matrices for all three interpreters.
- Notes: Acrobat and CPSI are rotated 180 degrees relative to
- each other. Ghostscript changes the initial CTM based upon
- the output device.
- Distiller 7.0 reports: [ 8.333 0.0 0.0 -8.333 -2550.0 3301.0 ]
- CPSI reports: [ -8.333 0.0 0.0 8.333 2550.0 -3301.0 ]
- Ghostscript reports: [ 8.333 0.0 0.0 -8.333 0.0 6600.0 ]
-
-10-03-2 OK
-
-10-03-3 OK
-
-10-04-1 OK
-
-10-04-2 OK
-
-10-05-1 OK
-
-10-05-2 OK
-
-10-06-1 OK
-
-10-06-2 OK
-
-10-07-1 OK
-
-10-07-2 OK
-
-10-08-1 OK Minor differences in positions and character shapes - ADC
-
-10-08-2 OK Minor differences in positions and character shapes - ADC
-
-10-09-1 OK
-
-10-09-2 OK
-
-10-09-3 OK
-
-10-09-4 OK
-
-10-10-1 OK
-
-10-10-2 AOK Checksum 63395 does not match CPSI or Distiller/Acrobat 7.0.
- The pages (and checksums) match Distiller 7.0 and CPSI except
- for the 'much22' test. This test is specified by:
- (/much22{ xy-t {0 -3 6 3 setbbox 3 0 1 0 360 arc 3 0 2 0 360 arc} ineofill not iff xyt })
- The operation {10 100 itransform} is run before and after
- running the test. The results should match. However Distiller
- 7.0 shows a -3.05176e-05 difference in the x value (307.2).
- This appears to be a minor math problem in Distiller 7.0. CPSI
- also shows an 'error' with this test. I do not have a copy of
- CPSI to verify its values. Ghostscript produces matching values
- (which is mathematically correct). - ADC
-
-10-11-1 OK
-
-10-11-2 OK
-
-10-12-1 OK
-
-10-12-2 OK
-
-10-12-3 OK Minor differences visually reviewed by RJJ
-
-10-12-4 AOK Differences between CPSI and GS in gradient in section
- labeled 'Fountain_image' in the upper right. However GS
- matches the appearance of of Distiller/Acrobat 7.0. See
- 10-01 page 6. - ADC
-
-10-12-5 AOK Checksum 0 matches Distiller/Acrobat 7.0, CPSI 18736 matches
- CET expected value. - ADC
-
-10-13-1 OK
-
-10-13-2 OK
-
-10-13-3 OK Minor differences in positions and character shapes - ADC
-
-10-13-4 OK Minor differences visually reviewed by RJJ
-
-10-13-5 AOK Differences between CPSI and GS in gradient in section
- labeled 'Fountain_image' in the upper right. However GS
- matches the appearance of of Distiller/Acrobat 7.0. See
- 10-01 page 6. - ADC
-
-10-13-6 OK Color corrected by rev 7172.
-
-10-14-1 OK
-
-10-14-2 OK
-
-10-14-3 OK
-
-10-14-4 AOK Difference between CPSI and GS with several objects:
- 1) The location of rectangles in items 13 and 14 in the
- column labeled 'LOOK'. 2) The shape/locations of hooked
- shape features in items 15, 16, and 18 in the same column.
- 3) The length of a diagonal line in item 19 in the same
- column. 4) The position of line and arc in items 22 and
- 23 in the same column. 5) The position of diamond shaped
- gradient at position 36 in the same column. 6) The position
- of triangles at items 3 and 4 of a column labeled 'MEMO'.
- 7) The positions of rectangles at items 22, 23, and 24, in
- the column labeled 'CASH'. 8) The position of a larger
- triangle at item 5 in the column labeled 'MUCH'. 9) The
- position of trangles at items 8, 9, and 27 in the same column.
- 10) The size of an 'angled' shaped objects at items 15 and
- 30 in the same column. 11) The position of the triangle
- at item 27 in the column labeled 'MORE'. 12) The location
- of shaded squares in item 27 of the column labeled 'GRAY'.
- 13) The location of rectangles in item 28 in the same column.
- 14) The location of a trangle in item 32 in the same column.
- For all of the above objects, the positions match between GS
- and Distiller/Acrobat 7.0.
- The one item that has some question, item 31 in the column
- labeled 'GRAY' This is a triangle outline apparently drawn
- with a pattern. All three intpreters differ. The GS output
- looks like CPSI except that the pattern is mirrored about a
- 45 degree diagonal. (Note: The pattern is only visible in
- the lines that make up the lines of the triangle. Thus there
- is very little information. The differences may be a minor
- position shift.) Distiller/Acrobat differs from both. - ADC
-
-10-15-1 OK
-
-10-15-2 AOK The diffs in items 'much22' and 'much24' (user paths / insideness testing)
- Analyzed by Igor.
- This is a CPSI problem : the insideness testing operators
- slightly disturb CTM.ty .
- A simplified test case is placed to
- peeves:/home/igor/pscet/mytests/10-15-2-Igor01.PS .
- .
- With this test CPSI prints :
- GlobInterProc1=2467.17
- GIFBoundProc1=false
- {749.8 1433.41 749.8 1433.41 setbbox 749.8 1433.41 moveto}
- false
- iff in : gif_assertion=true
- iff out : gif_assertion=true
- GifProcInstance=false
- 1
- GlobInterProc2=2467.17
- GlobInterProc2=false
- .
- Note the value 2467.17 looks same due to rounding,
- but the equality test fails (GlobInterProc2=false).
- The effect is resolution dependent and the page size dependent.
-
-10-16-1 OK
-
-10-16-2 OK
-
-10-16-3 OK
-
-10-16-4 OK Minor differences visually reviewed by RJJ
-
-10-16-5 OK GS matches Tek hardcopy. CPSI differs in gradient in section
- labeled 'Fountain_image' in the upper right. GS also
- matches the appearance of of Distiller/Acrobat 7.0. See
- 10-01 page 6. - ADC
-
-10-16-6 OK Minor differences in positions and character shapes - ADC
-
-11-01-1 AOK Matches Tek. CPSI slightly differs in few coordinates.
-
-11-01-2 OK
-
-11-01-3 OK
-
-11-01-4 OK
-
-11-01-5 OK
-
-11-01-6 AOK rev 7617 : look30, much34 look like a saw due to "strokepath stroke".
- CPSI and GS rev 7617 generate individual contours for line joins,
- which look like a quadrangle with a very acute corner.
- Then it's a subject of miter limit, which depends on the angle,
- which depends on the flattening factor of the original curve.
- With CPSI look30 has a smaller number of peaks.
-
-11-02-1 AOK Same as 11-01-1
-
-11-02-2 OK Minor differences visually reviewed by RJJ
-
-11-02-3 OK
-
-11-02-4 OK
-
-11-02-5 OK
-
-11-02-6 AOK Same as 11-01-6.
-
-11-03-1 OK Minor differences visually reviewed by RJJ
-
-11-03-2 OK
-
-11-03-3 OK Rev. 7171 works for me. - Alex
-
-11-03-4 OK Fixed in rev. 7171. - Alex
-
-11-03-5 OK Minor differences visually reviewed by RJJ
-
-11-03-6 OK Minor differences visually reviewed by RJJ
-
-11-03-7 OK Fixed as of rev 7618.
-
-11-04-1 OK Minor differences visually reviewed by RJJ
-
-11-04-2 OK
-
-11-04-3 OK Fixed iv rev. 7154. - Alex.
-
-11-04-4 OK
-
-11-04-5 OK Minor differences visually reviewed by RJJ
-
-11-04-6 OK Minor differences visually reviewed by RJJ
-
-11-04-7 OK Fixed as of rev 7618.
-
-11-05-1 OK Minor differences visually reviewed by RJJ
-
-11-05-2 OK Minor differences visually reviewed by RJJ
-
-11-05-3 OK Minor differences visually reviewed by RJJ
-
-11-05-4 OK
-
-11-05-5 OK Minor differences visually reviewed by RJJ
-
-11-05-6 OK fixed in r7228 - Raph
-
-11-05-7 AOK Same as 11-01-6. Color corrected by rev 7172.
-
-11-06-1 OK Minor differences visually reviewed by RJJ
-
-11-06-2 OK Fixed in r7155 - Raph
-
-11-06-3 OK Minor differences visually reviewed by RJJ
-
-11-06-4 OK Minor differences visually reviewed by RJJ
-
-11-06-5 AOK CPSI problem.
- GS has extra line: MUCH 15, 30, 31. Tek and CPSI do not.
- Analyzed by Igor.
- The following test discovers a problem in CPSI :
- .
- 72 72 moveto 72 72 rlineto clip
- 0 0 200 200 rectfill
- showpage
- 72 72 moveto 72 72 rlineto clip
- 0 0 200 200 rectclip
- clippath currentpoint
- showpage
- .
- The test installs aclipping path from a single line.
- The first page paints a line, so
- the clipping is not empty.
- The second page first installs same clipping,
- and then applies rectclip over it.
- The intersection isn't empty by theory,
- but with CPSI it appears empty and
- "clippath currentpoint" fails with nocurrentpoint.
-
-11-07-1 OK
-
-11-07-2 OK Minor differences visually reviewed by RJJ
-
-11-07-3 OK Minor differences visually reviewed by RJJ
-
-11-07-4 OK Minor differences visually reviewed by RJJ
-
-11-07-5 OK Fixed by rev 7617.
-
-11-08-1 OK Minor differences visually reviewed by RJJ
-
-11-08-2 OK Minor differences visually reviewed by RJJ
-
-11-08-3 OK Minor differences visually reviewed by RJJ
-
-11-08-4 OK Minor differences visually reviewed by RJJ
-
-11-08-5 OK Fixed as of rev. 7531.
-
-11-09-1 AOK a better stroke adjustment; not important. Analyzed by Igor.
-
-11-09-2 OK
-
-11-09-3 OK
-
-11-09-4 AOK linewidth different.
- Analyzed by Igor.
- GS paints a "thin line" whenever the line wdth is lesser than 1 pixel.
- The decision is taken in gxstroke.c ln 453, 468, 482
- with the threshold half width smaller than half pixel.
- Well I can set a smaller threshold for CPSI compatibility,
- but I need CPSI to measure its constant.
-
-11-09-5 OK Minor differences visually reviewed by RJJ
-
-11-09-6 OK
-
-11-09-7 OK
-
-11-09-8 AOK look30, much34 : AOK same as 11-01-6.
- -
- more21: aok - CPSI appears ignoring the bad flattening precision.
- May be related to 11-09-4 assign: Ray.
-
-11-10-1 AOK Test measures number of subdivisions with different values of
- setflat. Differences are expected (resolution dependent). -Raph
-
-11-10-2 OK Minor differences visually reviewed by RJJ
-
-11-10-3 OK Minor differences visually reviewed by RJJ
-
-11-10-4 DIFF setflat problem maybe - curves smooth in cpsi assign: Raph.
- We have very coarse flattenpath results. - Raph
-
-11-10-5 DIFF same as 11-10-4 assign: Raph.
- Same as 11-10-4
-
-11-10-6 OK Fixed as of rev 7618.
-
-11-11-1 OK Fixed with rev 7212.
-
-11-11-2 OK
-
-11-11-3 OK
-
-11-11-4 OK Minor differences visually reviewed by RJJ
-
-11-11-5 OK Minor differences visually reviewed by RJJ
-
-11-11-6 OK Fixed as of rev 7534.
-
-11-12-1 OK
-
-11-12-2 OK
-
-11-12-3 OK
-
-11-12-4 OK Minor differences visually reviewed by RJJ
-
-11-12-5 OK Minor differences visually reviewed by RJJ
-
-11-12-6 OK Minor differences visually reviewed by RJJ
-
-11-13-1 OK Minor differences visually reviewed by RJJ
-
-11-13-2 OK
-
-11-13-3 OK
-
-11-13-4 OK Works in rev. 7527.
-
-11-14-1 OK Fixed with rev 7213.
-
-11-14-2 OK
-
-11-14-3 OK Minor differences visually reviewed by RJJ
-
-11-14-4 OK Minor differences visually reviewed by RJJ
-
-11-14-5 OK fixed in r7228 - Raph
-
-11-14-6 OK Color corrected as of rev 7172.
-
-11-15-1 OK Fixed as of rev 7534.
-
-11-15-2 OK Minor differences visually reviewed by RJJ
-
-11-15-3 OK Minor differences visually reviewed by RJJ
-
-11-15-4 OK
-
-11-15-5 OK Minor differences visually reviewed by RJJ
-
-11-15-6 OK Minor differences visually reviewed by RJJ
-
-11-15-7 OK Minor differences visually reviewed by HAS
-
-11-16-1 OK Minor differences visually reviewed by HAS
-
-11-16-2 OK
-
-11-16-3 OK
-
-11-16-4 OK Minor differences visually reviewed by HAS
-
-11-16-5 OK
-
-11-16-6 OK
-
-11-16-7 OK
-
-11-16-8 AOK
-
-11-17-1 OK Fixed as of rev 7598.
-
-11-17-2 OK Fixed as of rev 7598.
-
-11-17-3 OK Minor differences visually reviewed by RJJ
-
-11-17-4 OK Minor differences visually reviewed by RJJ
-
-11-17-5 OK fixed in r7228 - Raph
-
-11-17-6 AOK GS has small square in upper right of border line, CPSI has
- similar square in lower right. Tek has small square in lower
- right. Device Dependent: Uses device coordinates, GS, Tek
- and CPSI all have different default CTM. RJJ
-
-11-18-1 OK Fixed with rev 7212.
-
-11-18-2 OK
-
-11-18-3 OK
-
-11-18-4 OK Minor differences visually reviewed by RJJ
-
-11-18-5 OK Minor differences visually reviewed by RJJ
-
-11-18-6 AOK Adobe interpreters (CPSI, Tek, Distiller 5) have obvious
- rendering problems, which are hard to simulate in GS.
- 1. The long diagonal line is caused by "clippath 0 0 rlineto
- stroke showpage". Different Adobe interpreters draw it
- fron the center of the page to different corners.
- 2. The line drawn by "10 0 rlineto" is not horizontal in
- LOOK 30 and MUCH 34 cases. This bug can be demonstrated
- by this short program "300 300 moveto 10 10 rlineto 8 8
- rlineto strokepath 10 0 rlineto stroke showpage". - Alex
-
-11-19-1 OK
-
-11-19-2 OK
-
-11-19-3 OK
-
-11-19-4 OK Minor differences visually reviewed by RJJ
-
-11-19-5 OK Minor differences visually reviewed by RJJ
-
-11-19-6 AOK cash21, look30 : ustrokepath ending point, Analyzed by Igor.
- I believe it is CPSI problem.
- I placed some tests to peeves:/home/igor/pscet/mytests/11-19-Igor01.zip .
- The ZIP contains 2 PS files, which are made from 11-19.PS
- with removing unrelated things and inserting a debug printing.
- The 2 files differ in a small thing : wheter it access
- currentpoint after ustrokepath, or not.
- The rasters (included into the ZIP) appear to be different !
- The log files (included into the ZIP) tell us that no error happen,
- because the currenpoint coordinates are successfully printed
- (in the order Y X).
- The position of the 2nd cross depends on the
- currentpoint after ustrokepath,
- but 'currentpoint' appears to cnahge it !
- I believe that CPSI actually didn't pass the "interference" test,
- which 1-19-6 is designed for.
- As we noticed from other 20 tests (unpublished), this behavior
- appears pretty occasional, so we're unable to analyze it completely
- and to reproduce it in Ghostscript.
- Tek matches CPSI though - I can't know why.
- Welcome anybody who can improve this analyzis.
-
-11-20-1 OK Minor differences visually reviewed by HAS
-
-11-20-2 OK Differences resolved as of rev 7531.
-
-11-20-3 OK Minor differences visually reviewed by RJJ
-
-11-20-4 OK
-
-11-20-5 DIFF Analyzed by Igor.
- I believe it is CPSI problem.
- A simplified test is stored into peeves/home/igor/pscet/mytests/11-20-5-Igor01.ps .
- It prints the pathbbox before and after "3 3 rlineto",
- as well as the current point before and after it :
- bbb0
- 711.0
- 289.037
- 691.0
- 80.3225
- xxx0
- 691.0
- 85.535
- bbb1
- 711.0
- 289.037
- 691.0
- 39.5
- xxx1
- 694.0
- 88.535
- 11-20 GSTATE = 31293 Graphic 0 ms
- .
- Note: pathbbox and currentpoint are printed in the reverse order.
- The starting and the ending point of the line appear
- within the initial pathbbox.
- In same time the lower X of pathbbox changes from 80.3225 to 39.5
- without a visible reason. With GS it doesn't change.
- Note: my copy of CPSI probably is some older,
- but it renders same 11-20-5.ppm as one on peeves.
- Passing to Ray for further processing.
- assign: Ray.
-
-11-20-6 DIFF In special test B, Adobe has rangechecks, we don't. In
- special test A, we have one rangecheck they don't.
- The test is about interaction of setbbox with save,
- gsave and other operators. - assign Raph
-
-11-20-7 OK
-
-11-20-8 OK Minor differences visually reviewed by RJJ
-
-11-20-9 DIFF '4's and '1's added in gs output.
- The problem (at least partly) is caused by a small bounding box
- set by setbbox operator that cannot accomodate long strings of text.
- Adobe appears to extend path bounding box on demand instead of
- enforcingwhen the limits when the current point comes from a
- different gstate, for instance:
- "0 0 moveto gsave 0 0 5 5 setbbox 10 10 lineto stroke showpage"
- assign Alex
-
-11-21-1 OK Fixed as of rev 7598.
-
-11-21-10 AOK Differences in look20, look30, look33 are caused by CPSI problem :
- rlineto, rcurveto count wrong coordinates after strokepath.
- It looks as the starting point for relative coordinate is not equal to
- the current point. CPSI paints a self-intersecting curve with
- "9 0 9 -9 0 -9 rcurveto stroke", which must not self-intersect.
- A simplified test is placed to
- peeves:/home/igor/pscet/mytests/11-21-10-Igor01.ps
-
-11-21-2 OK Minor differences visually reviewed by RJJ
-
-11-21-3 OK Fixed by rev 7617.
-
-11-21-4 DIFF Analyzed by Igor.
- There are several stroking problems.
- 1. linewidth - same as 11-09-4.
- 2. setflat - same as 09-09-1.
- 3. CPSI doesn't roll a dash pattern at some corners.
- An example is at the lower right corner of the page.
- The dash at one corner looks longer than the distance to the corner.
- IMO it's another CPSI bug.
- Passing to Ray do decide what to to with it.
- assign: Ray.
-
-11-21-5 OK Minor differences visually reviewed by HAS
-
-11-21-6 AOK Resolution dependent: GS gives pathbox exact (not enlarged
- slightly). Tek and CPSI differ.
- -
- curve saw : AOK - same as 11-01-6.
-
-11-21-7 OK Fixed by rev. 7701 - Alex
-
-11-21-8 AOK Device Dependent / Resolution Dependent. CPSI ignores setflat
- Tek and CPSI differ.
-
-11-21-9 AOK flattness differ. Tek and CPSI differ.
-
-11-22-1 OK
-
-11-22-2 OK Minor differences visually reviewed by RJJ
-
-11-22-3 AOK CPSI is wrong with the invalid test "User path must start with absolute point".
-
-11-22-4 OK
-
-11-22-5 DIFF GS has different number. Although this is resolution dependent,
- the test comment indicates what should happen. Tek has 0.12
- values, CPSI has 0.06 (approx.). Assign: alex
-
-11-22-6 OK shape has a small 'point' with CPSI, Ghostscript matches Tek
- hardcopy [2nd row down, right side, upper curve.]
-
-11-22-7 OK fixed in r7228 - Raph
-
-11-22-8 OK Fixed as of rev 7618.
-
-11-23-1 AOK GS (apparently) does not implement upath caching. Tek and CPSI
- do, but differ. Device Dependent (as comment says).
-
-11-23-2 OK Minor differences visually reviewed by RJJ
-
-11-23-3 OK ucache typecheck error in gs not seen in cpsi.
- fixed in r7229 - Raph
-
-11-23-4 OK
-
-11-24-1 OK
-
-11-24-2 OK
-
-11-24-3 AOK user path :
- CPSI doesn't follow PLRM page 199 about user paths :
- "the first operator after setbbox must be an absolute positioning operator
- (moveto, arc, or arcn)."
- "All coordinates specified as operands must fall within the bounds
- specified by setbbox".
- When an user path starts with rmoveto, CPSI looks using current point
- from the graphic state when it is set, and probably the setbbox lower coordinates
- when current point is not set. However arc, arcn in the user path
- do not paint a line from the graphic state current point.
- Also painting outside setbbox somethimes throws error, sometimes not -
- we could not figure out what does it depend on.
- Due to all that CPSI's algorithm isn't clear and we're unable to reproduce it.
- Will follow PLRM instead.
-
-11-24-4 OK
-
-11-24-5 OK
-
-11-24-6 OK
-
-11-24-7 OK Minor differences visually reviewed by RJJ
-
-11-24-8 OK
-
-11-25-1 OK
-
-11-25-2 OK
-
-11-25-3 AOK user paths : same as 11-24-3.
-
-11-25-4 OK
-
-11-25-5 OK
-
-11-25-6 OK
-
-11-25-7 OK Minor differences visually reviewed by RJJ
-
-11-25-8 OK
-
-11-26A-1 OK Minor differences visually reviewed by HAS
-
-11-26A-2 OK Minor differences visually reviewed by RJJ
-
-11-26A-3 OK Fixed as of rev 7598.
-
-11-26B-1 OK Minor differences visually reviewed by RJJ
-
-11-26B-2 DIFF precision discrepancies assign Alex
-
-11-26C-1 OK Minor differences visually reviewed by RJJ
-
-11-26C-2 OK Minor differences visually reviewed by RJJ
-
-11-26C-3 OK Minor differences visually reviewed by RJJ
-
-11-26D-1 OK Minor differences visually reviewed by RJJ
-
-11-26D-2 OK fixed in rev 7228 - Raph
-
-11-26D-3 OK Minor differences visually reviewed by HAS
-
-11-27-1 OK Minor differences visually reviewed by RJJ
-
-11-27-2 OK
-
-11-27-3 AOK user paths : same as 11-24-3.
-
-11-27-4 OK
-
-11-27-5 OK
-
-11-27-6 OK
-
-11-27-7 OK Minor differences visually reviewed by RJJ
-
-11-27-8 OK
-
-11-28-1 DIFF GS has much different stroke pattern in circles/wedges. Tek
- and CPSI agree. May be setflat issue. Assign: Ray
-
-11-28-10 AOK same as 11-21-8.
-
-11-28-11 AOK same as 11-21-9.
-
-11-28-12 AOK same as 11-21-10.
-
-11-28-2 OK Fixed by rev 7617.
-
-11-28-3 AOK curve saw : AOK - same as 11-01-6.
-
-11-28-4 AOK CPSI stroking problem. CPSI and Tek differ.
-
-11-28-5 OK Fixed as of r7231.
-
-11-28-6 OK Minor differences visually reviewed by RJJ
-
-11-28-7 OK Minor differences visually reviewed by HAS
-
-11-28-8 DIFF same as 11-21-4 assign: Ray.
-
-11-28-9 OK Fixed by rev. 7701 - Alex
-
-12-01-1 OK Minor text outline differences - ADC
-
-12-01-2 OK Minor differences visually reviewed by RJJ
-
-12-01-3 OK Minor differences versus CPSI- ADC. PDF produced by Distiller 7.0
- shows teal colored circles. (GS and CPSI render sea foam green.)
-
-12-01-4 OK Minor differences visually reviewed by RJJ.
-
-12-01-5 DIFF Magenta in pattern in lower right corner of GS output. Not seen in
- CPSI output. Strange result in Distiller 7.0 output. Acrobat 7.0
- reports incorrect number of values for setcolor operator. Page is
- blank.
- See also 18-02G-1.
- Partial analysis from Jan (11/29/2006)
- 1. An uncolored pattern is created, and used to draw the region on
- the left. The pattern consists of a 9 unit x 9 unit tile, in the
- center of which is a 7 unit x 7 unit colored square. The pattern
- receives its color at the time the setpattern operator is invoked.
- For this test, that color is black.
- --
- 2. Next, a colored pattern is created, and used to draw the figure
- on the right. This pattern also consists of a 9 unit x 9 unit tile,
- whose PaintProc operates as follows:
- - create a path consisting of a 5 unit x 5 unit square centered
- in the 9 unit x 9 unit tile
- - save graphic state
- - set an approximately magenta color and fill the square
- - restore the graphic state
- - outline the same square with an approximately 4 unit wide line;
- this line obscures all but a 1/2 unit x 1/2 unit square of the
- magenta region
- The key step is the last one, because the PaintProc does not set a
- color for drawing the line. In this case it inherits the color
- from the graphic state in effect when the makepattern operator was
- invoked, which is the uncolored pattern created in Step (1).
- --
- 3. Ghostscript renders the uncolored pattern into a gx_color_tile
- structure when drawing the left region, and caches that strcuture.
- When the second region is to be rendered, another gx_color_tile
- is created, and the cached tile of the uncolored pattern is used
- (in part) to render this new tile. The caching accumulator
- device is used for this purpose.
- --
- 4. The problem arises because the cached gx_color_tile for the
- uncolored pattern has its phase information set for the original
- device, not the accumulator device being used to create the tile
- for the colored pattern.
- --
- As we noted earlier, Ghostscript renders patterns to
- gx_color_tile structures of minimum size. Such a mechanism
- cannot handle the general case in which one pattern makes use of
- another pattern. Either the tile size must be increased to the
- least common multiple of the patterns' step sizes, or some more
- elaborate compositing technique must be used for final rendering.
- --
- However, in this case both patterns have the same step sizes (and
- the same tile size), so Ghostscript should be able to handle the
- situation correctly. We thought the problem was that the
- uncolored pattern was already cached, and so we modified the code
- to discard cached patterns just before executing a pattern
- PaintProc. That resolves the phase issue, but the "inner"
- pattern (the uncolored pattern in this case) is rendered using
- the wrong transformation matrix. We haven't yet had time to go
- back and determine why this is happening.
- Assign: Tim
-
-12-01-6 OK Minor differences in positions and character shapes - ADC
-
-12-02-1 OK Minor differences in positions and character shapes - ADC
-
-12-02-10 OK Minor differences in positions and character shapes - ADC
-
-12-02-11 OK Minor differences visually reviewed by RJJ
-
-12-02-12 OK Minor differences, colors more vibrant in shadings in GS.
-
-12-02-13 OK Minor differences in positions and character shapes - ADC
-
-12-02-14 OK Corrected by 7152 and 7162. ADC
-
-12-02-15 OK Minor differences in positions and character shapes - ADC
-
-12-02-16 OK Minor differences in positions and character shapes - ADC
-
-12-02-17 OK Minor differences in positions and character shapes - ADC
-
-12-02-18 AOK Squares in the top row are darker in GS vs CPSI.
- This is exactly the same issue as 12-07B-10. After embedding
- CPSI's default CRD into the job, the output matches. TIM
-
-12-02-19 OK Minor differences in positions and character shapes - ADC
-
-12-02-2 OK Minor differences in positions and character shapes - ADC
-
-12-02-3 OK Minor differences in positions and character shapes - ADC
-
-12-02-4 OK Minor differences in positions and character shapes - ADC
-
-12-02-5 OK Minor differences in positions and character shapes - ADC
-
-12-02-6 OK Corrected by 7152 and 7162. ADC
-
-12-02-7 OK Minor differences in positions and character shapes - ADC
-
-12-02-8 OK Minor differences in positions and character shapes - ADC
-
-12-02-9 OK Minor differences in positions and character shapes - ADC
-
-12-03-1 OK Corrected by 7152 and 7162. ADC
-
-12-03-2 OK Minor differences visually reviewed by RJJ
-
-12-03-3 OK Minor differences in positions and character shapes - ADC
-
-12-03-4 OK Minor differences visually reviewed by RJJ
-
-12-03-5 DIFF Magenta in pattern at lower right in GS. Not present in CPSI.
- See 12-01-5. Assign Tim
-
-12-03-6 OK Minor differences in positions and character shapes - ADC
-
-12-04-1 OK Verified by ADC
-
-12-04-2 OK Corrected by 7152 and 7162. ADC
-
-12-04-3 OK Minor differences visually reviewed by RJJ
-
-12-04-4 DIFF Magenta in pattern at lower right in GS. Not present in CPSI.
- See 12-01-5. Assign: Tim
-
-12-04-5 AOK GS has extra center line on symbols: LOOK 3, 12 , MUCH 9, MORE 19
- Analyzed by Igor :
- I believe it is a CPSI problem.
- eofill is applied to two overlapping horizontal lines.
- In most cases CPSI paints them, and sometimes doesn't.
- Tek paints always.
- GS matches Tek.
-
-12-05-1 OK Minor differences in positions and character shapes - ADC
-
-12-05-2 OK
-
-12-05-3 AOK Page is gray in GS. White in CPSI.
- This "{.75 mul} settransfer erasepage showpage" gives
- a gray page in GS.
- --
- I ran this job through Acrobat Distiller 5.0 as well as Apple's
- Preview, they match the GS output. The Red Book states that
- erasepage is influenced "if an atypical transfer function has
- been defined"... Since the transfer function is {.75 mul} a gray
- value of R=191,G=191,B=191 should be expected from all that I
- can see and reproduce here. I noticed it is noted several times
- that "CPSI ignores settransfer". I believe this is another case
- where whatever version of CPSI is used to generated these
- PPM's, settransfer looks to be ignored. TIM
-
-12-06-1 OK Minor differences in positions and character shapes - ADC
-
-12-06-2 OK Corrected by 7152 and 7162. ADC
-
-12-06-3 OK
-
-12-06-4 DIFF Magenta in pattern at lower right in GS. Not present in CPSI.
- See 12-01-5. Assign: Tim
-
-12-06-5 OK Minor differences in positions and character shapes - ADC
-
-12-07A-1 DIFF? Different blurring in squares in 7th column compared to CPSI.
- GS blurring matches appearance of Distiller/Acrobat 7.0
- assign: Tim
-
-12-07A-10 OK Minor differences visually reviewed by RJJ
-
-12-07A-11 OK Minor differences visually reviewed by RJJ
-
-12-07A-12 OK Adobe acceptts images in the pattern color space.
- Since rev. 7597 we do the same in the compatibility mode. - Alex
-
-12-07A-13 OK Minor differences in positions and character shapes - ADC
-
-12-07A-14 OK Minor differences in positions and character shapes - ADC
-
-12-07A-15 OK Minor differences in positions and character shapes - ADC
-
-12-07A-2 OK Minor differences in positions and character shapes - ADC
-
-12-07A-3 DIFF Squares are blurred in GS. No blurring in CPSI. Distiller/Acrobat
- 7.0 shows blurring similar to GS.
- assign: Tim
-
-12-07A-4 OK Minor differences in positions and character shapes - ADC
-
-12-07A-5 DIFF Page consists of blurred squares. GS position shifted down slight
- at the top of the page vs CPSI and Distiller/Acrobat 7.0. - ADC
- assign: Tim
-
-12-07A-6 OK Minor differences in positions and character shapes - ADC
-
-12-07A-7 OK Minor differences in positions and character shapes - ADC
-
-12-07A-8 OK Minor differences visually reviewed by RJJ
-
-12-07A-9 OK Minor differences visually reviewed by RJJ
-
-12-07B-1 OK Minor differences in positions and character shapes - ADC
-
-12-07B-10 AOK Some grays in the top row are lighter in GS versus CPSI
- (after 7152). - ADC
- This is exactly the same issue as 12-02-18. After embedding
- CPSI's default CRD into the job, the gray rectangles in the top
- row match. TIM
-
-12-07B-11 DIFF Some grays in the top row are lighter in GS versus CPSI
- (after 7152). - ADC Assign Tim
-
-12-07B-12 DIFF Blurred images render a slight position shift relative to CPSI and
- Distiller/Acrobat 7.0 - ADC assign: Tim
-
-12-07B-13 DIFF Several differences. Color squares are missing in GS. The
- Distiller/Acrobat 7.0 shows these squares blurred. They are not
- in both GS and CPSI. - ADC assign: Tim
-
-12-07B-14 DIFF Several differences. Color squares are missing in GS. The
- Distiller/Acrobat 7.0 shows these squares blurred. They are not
- in both GS and CPSI. - ADC assign: Tim
-
-12-07B-15 DIFF Several differences. Dark squares are missing in GS. There are
- dfferences in the blurring between Distiller/Acrobat 7.0 vs GS
- and CPSI. - ADC assign: Tim
-
-12-07B-2 OK Minor differences in positions and character shapes - ADC
-
-12-07B-3 OK Minor differences in positions and character shapes - ADC
-
-12-07B-4 OK Minor differences in positions and character shapes - ADC
-
-12-07B-5 OK Minor differences in positions and character shapes. Some
- minor differences in shades of gray. - ADC
-
-12-07B-6 OK Minor differences in positions and character shapes. Some
- minor differences in shades of gray. - ADC
-
-12-07B-7 OK Minor differences in positions and character shapes - ADC
-
-12-07B-8 OK Minor differences in positions and character shapes - ADC
-
-12-07B-9 OK Minor differences in positions and character shapes. Some
- minor differences in shades of gray. - ADC
-
-12-07C-1 OK Minor differences in positions and character shapes - ADC
-
-12-07C-10 DIFF White and black rectangles missing in GS. Differences between
- CPSi and Distiller/Acrobat 7.0 - ADC assign Tim
-
-12-07C-11 DIFF White and black rectangles missing in GS. Differences between
- CPSi and Distiller/Acrobat 7.0 - ADC assign Tim
-
-12-07C-12 DIFF White and black rectangles missing in GS. Differences between
- CPSi and Distiller/Acrobat 7.0 - ADC assign Tim
-
-12-07C-13 DIFF White, black, and cyan rectangles missing in GS. Differences
- between CPSi and Distiller/Acrobat 7.0 - ADC assign Tim
-
-12-07C-14 OK Minor differences in positions and character shapes - ADC
-
-12-07C-15 OK
-
-12-07C-16 OK
-
-12-07C-17 OK
-
-12-07C-2 OK Minor differences in positions and character shapes - ADC
-
-12-07C-3 OK Minor differences in positions and character shapes - ADC
-
-12-07C-4 OK Minor differences visually reviewed by RJJ
-
-12-07C-5 OK Minor differences visually reviewed by RJJ
-
-12-07C-6 OK Minor differences in positions and character shapes - ADC
-
-12-07C-7 OK GS matches Tek -- no thin vertical lines.
-
-12-07C-8 DIFF GS missing leftmost vertical column of shaded data in the
- test block at the lower right of the page - ADC. assign Tim
-
-12-07C-9 OK Color corrected by rev 7172. Something fixed the error message.
-
-12-07D-1 OK Minor differences in positions and character shapes - ADC
-
-12-07D-2 OK Minor differences in positions and character shapes - ADC
-
-12-07D-3 OK Minor differences visually reviewed by RJJ
-
-12-08A-1 DIFF Differences in the second and third test pattern in the rightmost
- column. GS pattern matches Distiller/Acrobat. CPSI is different.
- Adobe shows these a blurred. Both CPSI and GS are crisp. - ADC
- assign Tim
-
-12-08A-2 OK Minor differences in positions and character shapes - ADC
-
-12-08A-3 DIFF Different pattern between GS and CPSI. Distiller/Acrobat shows
- the same pattern as GS. Adobe shows the image blurred. Both
- CPSI and GS shows a crisp image. (The page says interpolate
- true in the upper left corner.) - ADC
- assign Tim
-
-12-08A-4 OK Color corrected by rev 7172.
-
-12-08A-5 AOK Minor differences in positions and character shapes.
-
-12-08A-6 AOK Minor differences in positions and character shapes.
-
-12-08A-7 OK Color corrected by rev 7172.
-
-12-08A-8 OK Color corrected by rev 7172.
-
-12-08B-1 OK Minor differences in positions and character shapes - ADC
-
-12-08B-2 OK Accept multiple data sources in imagemask by rev. 7181.
-
-12-08B-3 OK Minor differences in positions and character shapes - ADC
-
-12-08C-1 OK Minor differences in positions and character shapes - ADC
-
-12-08C-2 OK Color corrected by rev 7172.
-
-12-08C-3 OK Minor differences in positions and character shapes - ADC
-
-12-08C-4 OK Minor differences in positions and character shapes - ADC
- Color corrected by rev 7172.
-
-12-08D-1 OK Minor differences visually reviewed by RJJ
-
-12-08D-2 DIFF Magenta in pattern at lower right in GS. Not present in CPSI.
- See 12-01-5. Assign: Tim
-
-12-08D-3 OK Minor differences in positions and character shapes - ADC
-
-12-09-1 OK Minor differences in positions and character shapes - ADC
-
-12-09-2 OK Minor differences in positions and character shapes - ADC
-
-12-09-3 OK Minor differences in positions and character shapes - ADC
-
-12-09-4 OK Minor differences in positions and character shapes - ADC
-
-12-10-1 OK Minor differences in positions and character shapes - ADC
-
-12-10-2 OK Color corrected by rev 7172.
-
-12-10-3 OK Minor differences visually reviewed by RJJ
-
-12-10-4 OK Color corrected by rev 7172.
-
-12-10-5 OK Minor differences visually reviewed by RJJ
-
-12-10-6 OK Minor differences in positions and character shapes - ADC
-
-12-10-7 OK Minor differences in positions and character shapes - ADC
-
-12-10-8 DIFF Magenta in pattern at lower right in GS. Not present in CPSI.
- See 12-01-5. Assign: Tim
-
-12-10-9 OK Minor differences in positions and character shapes - ADC
-
-12-11-1 OK Minor differences in positions and character shapes - ADC
-
-12-11-2 OK Color corrected by rev 7172.
-
-12-11-3 OK Minor differences in positions and character shapes - ADC
-
-12-11-4 OK reviewed by RJJ.
-
-12-11-5 OK Minor differences in positions and character shapes - ADC
-
-12-11-6 OK Minor differences visually reviewed by RJJ
-
-12-11-7 DIFF Magenta in pattern at lower right in GS. Not present in CPSI.
- See 12-01-5. Assign: Tim
-
-12-11-8 OK Minor differences in positions and character shapes - ADC
-
-12-12-1 OK Minor differences in positions and character shapes - ADC
-
-12-12-10 OK
-
-12-12-2 OK Minor differences in positions and character shapes - ADC
-
-12-12-3 OK Minor differences in positions and character shapes - ADC
-
-12-12-4 OK Color corrected by rev 7172.
-
-12-12-5 OK Color corrected by rev 7172.
-
-12-12-6 OK Minor differences in positions and character shapes - ADC
-
-12-12-7 OK Color corrected by rev 7172.
-
-12-12-8 OK
-
-12-12-9 DIFF A pattern phase difference. assign: Tim
-
-12-13-1 OK Minor differences in positions and character shapes - ADC
-
-12-13-2 OK
-
-12-13-3 OK Minor differences visually reviewed by RJJ
-
-12-13-4 DIFF Magenta in pattern at lower right in GS. Not present in CPSI.
- See 12-01-5. Assign: Tim
-
-12-13-5 OK Works for me in rev. 7579. There's no differences around 30
- and 31 in left column. The checksum matches too. - Alex.
-
-12-14A-1 OK Test03: ok - fixed.
- rangecheck error is fixed - Alex.
-
-12-14A-10 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14A-11 DIFF Analyzed by Igor.
- Test03: diff - same as 09-47B-11 Test05. Assign: Tim
- -
- Test04: aok. Similar to 09-47B-10 test11.
- -
- Test05, Test12: aok
- A bug in the test : insufficient data.
- The stream interpretes like this :
- 000000ff 000000ff black black
- 00ffffff 00000000 black-red white
- CPSI renders :
- black green
- black black -- looks wrong.
- GS renders :
- black red white
- black black black --- looks correct.
- -
- Test08, Test09: ?
- same as 09-47B-11 Test05. Assign: Tim
- Please pay attention to the vertical diagonal of the rhombus.
- With CPSI it looks as a linear gradient, and does not with GS.
- Looks that CMYK colors [v v v v] differently convert to RGB.
- Not sure who is wrong, but CPSI looks more pleasant.
-
-12-14A-12 DIFF Test03, 04, 10,11 :
- same as 09-47B-11 Test05. Assign: Tim
- -
- Test07: aok - same as 12-14A-11 Test05.
-
-12-14A-13 DIFF Test02:aok - same as 12-14A-11 Test05.
- -
- Test03: aok. same as 09-47B-10 Test11.
- -
- Test04:
- GS problem with non-contigous function.
- A fix is possible but isn't simple.
- A suggestion was posted to 'teco' on November 8
- and then dismissed. Now it arises anew.
- .
- First we need gs_function_evaluate to return a new bit.
- which tells that the function has a discontinuty at
- the point. Fortunately poly-argument PS finctions are
- always contigous (otherwise the topology of discontinuty
- would be a hell).
- .
- There are 20 calls to patch_interpolate_color,
- which deal with it. It must return a bit,
- which tells whether the function
- isn't contiguous at the point.
- If so, it must be called at second
- time for computing another limit to this point.
- .
- The change should look like this :
- .
- + typedef enum {left, right} function_limit_direction;
- .
- {
- - patch_color_t c;
- + patch_color_t *C;
- + function_limit_direction discontinuty;
- - patch_interpolate_color(&c, c0, c1, pfs, 0.5);
- + discontinuty = patch_interpolate_color(&c, c0, c1, pfs, 0.5, left);
- + if (discontinuty)
- + patch_interpolate_color(&C, c0, c1, pfs, 0.5, right);
- + else
- + C = &c;
- // Then a half of occurances 'c' to be replaced with 'C'.
- }
- .
- Assign: igor.
- -
- Test05, 06, 07, 08, 12 : same as 09-47B-11 Test05. Assign: Tim
- -
- Test09: aok - same as 09-47B-11 Test04.
- Likely CPSI problem.
- The test is buggy - insufficient data for function.
- The data are interpreter like this :
- 000000ff000000 ff00ffffffxxxx
- xxxxxxxxxxxxxx xxxxxxxxxxxxxx
- where x is an insufficient data. GS pads it with zeros,
- CPSI is indeterministic.
- After tintTransform we get CMYK colors :
- 000000ff ff00ffff
- xxxxxxxx xxxxxxxx
- GS should paint : black black*green
- white white
- It's what we observe.
- CPSI appears wrong.
-
-12-14A-14 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14A-2 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14A-3 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14A-4 OK GS error reports are changed to match CPSI. - Alex
-
-12-14A-5 AOK GS error reports are changed to match CPSI. - Alex
- -
- Test07, 10, 11, 12 : aok
- CPSI problem : a non-monotonic color space is rendered as monotonic.
- Same as 09-47B-7 Test10.
-
-12-14A-6 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. GS gradients are smoother
- in tests 3 and 4. - ADC
-
-12-14A-7 AOK Test01, 02, 03, 04, 07, 08, 09, 10 : aok
- CPSI problem : a non-monotonic color space is rendered as monotonic.
- Same as 09-47B-7 Test10.
-
-12-14A-8 AOK CPSI reports 7 typechecks in shfill. GS reports none. There
- are 7 gradients missing in test 6 to 12 in CPSI. - ADC
- -
- Analyzed by Igor :
- CPSI misses the gradients due to the typecheck mentioned above.
- PLRM doesn't allow packedarray as 'names' element of the color space.
- GS appears tolerant to it.
- IMO it should be aok.
-
-12-14A-9 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14B-1 OK All test report errors now match CPSI and the test. - Alex
-
-12-14C-1 OK Fixed - Alex.
-
-12-14D-1 OK Fixed in rev. 7209. - Alex
-
-12-14E-1 OK All test report errors now match CPSI and the test. - Alex
-
-12-14F-1 OK All test report errors now match CPSI and the test. - Alex
-
-12-14G-1 OK All test report errors now match CPSI and the test. - Alex
-
-12-14H-1 OK Minor differences visually reviewed by RJJ
-
-12-14H-2 OK Minor differences in positions and character shapes - ADC
-
-12-14H-3 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14I-1 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14I-2 OK Minor differences in positions and character shapes - ADC
-
-12-14I-3 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14I-4 OK Minor differences visually reviewed by RJJ
-
-12-14J-1 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14J-2 OK Minor differences in positions and character shapes - ADC
-
-12-14J-3 OK Minor differences in positions and character shapes and minor
- differences in shading gradients. - ADC
-
-12-14K-1 AOK Test04: aok - CPSI is wrong, GS is correct.
- The test is buggy : it contains a wrong comment about colors
- and excessive data for the function.
- There is nothing special about diagonals in the function,
- so CPSI paints them inaccurately.
- -
- Test06: aok
- The test is buggy : it contains a wrong comment about colors
- and insufficient data for the function.
- As we know CPSI is indeterministic with insufficient function data.
- There is nothing special about diagonals in the function,
- so CPSI paints them inaccurately.
- The colors must be :
- 000000ff 000000ff
- 00ffffff xxxxxxxx (x = insufficient)
- black black
- blackred white
- GS appears correct.
- -
- test07: aok
- The test is buggy : it contains a wrong comment about colors
- and insufficient data for the function.
- As we know CPSI is indeterministic with insufficient function data.
- There is nothing special about diagonals in the function,
- so CPSI paints them inaccurately.
- The colors must be :
- 000000ff000000 ff00ffffffxxxx
- xxxxxxxxxxxxxx xxxxxxxxxxxxxx (x = insufficient)
- After tintTransfer :
- 000000 ff00ff
- xxxxxx xxxxxx (x = insufficient)
- white magenta
- black black
- GS appears correct.
- -
- Test08, Test09: Test10: test1: aok - same as test04.
-
-12-14K-2 OK Minor differences in positions and character shapes - ADC
-
-12-14K-3 AOK Test06 : aok. The function cropping, same as 09-47G-2 Test10.
- -
- Test07 : aok. The function cropping
- (a few different cropping than test06), same as 09-47G-2 Test10.
- -
- Test09 : aok. The function cropping
- (a few different cropping than previous), same as 09-47G-2 Test10.
- -
- Test10 : aok. The function cropping
- (a few different cropping than previous), same as 09-47G-2 Test10.
-
-12-14L-1 OK Minor differences in positions and character shapes - ADC
-
-12-14L-2 OK Minor differences in positions and character shapes - ADC
-
-12-14L-3 OK fixed.
-
-12-14L-4 OK Fixed by rev 7206
-
-12-14M-1 OK fixed.
-
-12-14M-2 OK fixed.
-
-12-14M-3 OK fixed.
-
-12-14M-4 DIFF Test05: Tek has top half of cone solid dark gray, GS has light
- gray (as in Test06). Assign: Igor
- -
- Test06: ok - fixed.
- -
- Test04, Test07: ok - Fixed by rev 7206
- Note: CPSI gets rangecheck errors on Test06, 07, 08.
-
-12-14M-5 OK fixed.
-
-12-14M-6 OK fixed.
-
-12-14M-7 OK fixed.
-
-12-14M-8 OK fixed.
-
-12-14N-1 OK Minor differences visually reviewed by RJJ
-
-12-14N-10 OK Minor differences in positions and character shapes - ADC
-
-12-14N-2 OK Minor differences in positions and character shapes - ADC
-
-12-14N-3 OK Minor differences in positions and character shapes - ADC
-
-12-14N-4 OK Minor differences in positions and character shapes - ADC
-
-12-14N-5 OK Fixed by rev 7206
-
-12-14N-6 OK Fixed by rev 7206
-
-12-14N-7 OK Minor differences visually reviewed by RJJ
-
-12-14N-8 OK Minor differences in positions and character shapes - ADC
-
-12-14N-9 OK fixed.
-
-12-14O-1 OK Minor differences in positions and character shapes - ADC
-
-12-14O-2 OK
-
-12-14O-3 OK Fixed with rev 7211.
-
-12-14O-4 OK Fixed as of rev. 7174
- Note: Tek tests 9-12 blank.
-
-12-14O-5 OK Fixed by rev 7206
-
-12-14O-6 OK Minor differences in positions and character shapes - ADC
-
-12-14O-7 OK Minor differences in positions and character shapes - ADC
-
-12-14O-8 OK Minor differences in positions and character shapes - ADC
-
-12-14P-1 OK Minor differences in positions and character shapes - ADC
-
-12-14P-2 OK Minor differences visually reviewed by RJJ
-
-12-14P-3 OK Minor differences in positions and character shapes - ADC
-
-12-14P-4 AOK Fixed by rev 7206
- CPSI has a worse shading precision with a non-contigous color.
-
-12-14P-5 AOK CPSI problem with self-intersecting tensor shadings - Analyzed by Igor.
- GS matches Distiller/Acrobat. - ADC
-
-12-14Q-1 OK Minor differences in positions and character shapes - ADC
-
-12-14Q-2 OK Minor differences in positions and character shapes - ADC
-
-12-14Q-3 OK Minor differences in positions and character shapes - ADC
-
-12-14Q-4 OK Fixed by rev 7206
-
-12-14Q-5 OK Minor differences in positions and character shapes - ADC
-
-
-12-14R-1 AOK Test02, 03, 06, 07, 08: aok. The function cropping, same as 09-47G-2 Test10.
- CPSI is wrong.
-
-12-14R-2 AOK Worse smoothing with CPSI.
-
-12-14R-3 DIFF Analyzed by Igor.
- -
- Test07:
- Analyzed by Igor.
- The test looks buggy : duplicate DataSource.
- CPSI uses the first DataSource (padded with zeros at end),
- and GS uses the second one while constructing the shading dictionary.
- GS interpretes the stream like this :
- 000000ff 000000ff
- 00ffffff 00000000
- so the shading is not completely black - it is 1/256 gray in one corner.
- Note : lib/gs_*.ps files assume the usage of the last definition.
- I recall that at least gs_ttf.ps depends on that.
- Passing to Ray to decide what to do with it.
- assign: Ray.
- -
- Test08: aok - CPSI ingores Encode.
- It maps a haff of shading Domain outside (to negative values)
- of the function domain, so that shading must look constant at
- the riht half. That's what we see with GS.
- -
- Test09, 10, 11, 12: aok, same as Test07 except a different Encode.
- Note : the vertical 'spike' in Test10 is a false human visual effect.
-
-12-14R-4 AOK Test1: aok - A worse smoothing with CPSI.
- -
- Test12: aok :
- The function itself :
- 000000 0000ff black blue
- ff0000 00ff00 red green
- ff00ff 00ff00 magenta green
- ffff00 ffffff yellow white
- It is linear, but the green component has Decode 0 3,
- so it maps outside the color domain and
- therefore it is cropped by the max color value 1.
- Due to the color croppig it has a plattue
- around the point where the green peak would apper.
- Then the function domain is cropped
- with 300/400 = 0.75 by X
- and 500/600 = 0.83 by Y.
- Therefore we don't see yellow and white.
- GS paint it fine.
- CPSI has a bad smoothing and a linear gradient instead the plattue.
-
-12-14S-1 OK Minor differences in positions and character shapes - ADC
-
-12-14S-2 OK Minor differences in positions and character shapes - ADC
-
-12-14S-3 OK Minor differences in positions and character shapes - ADC
-
-12-14T-1 OK fixed
-
-12-14T-2 OK fixed
-
-12-14U-1 OK
-
-12-14U-2 OK
-
-12-14U-3 OK Minor differences visually reviewed by RJJ
-
-13-01-1 OK Minor differences visually reviewed by RJJ
-
-13-01-2 OK
-
-13-01-3 OK Minor differences visually reviewed by RJJ
-
-13-01-4 OK Minor differences visually reviewed by RJJ
-
-13-01-5 OK
-
-13-01-6 OK Minor differences visually reviewed by HAS
-
-13-01-7 OK rev 7617.
-
-13-02-1 OK Minor differences visually reviewed by RJJ
-
-13-02-10 OK rev 7617.
-
-13-02-2 OK Minor differences visually reviewed by RJJ
-
-13-02-3 OK
-
-13-02-4 OK
-
-13-02-5 OK Fixed as of rev. 7583.
-
-13-02-6 OK Minor differences visually reviewed by RJJ
-
-13-02-7 OK Minor differences visually reviewed by RJJ
-
-13-02-8 OK
-
-13-02-9 OK Minor differences visually reviewed by HAS
-
-13-03-1 OK
-
-13-03-2 DIFF show error incomformity.
- {{/a /b add } (abc) cshow} stopped
- returns only true on the stack. assign: Peter
-
-13-03-3 OK Minor differences visually reviewed by RJJ
-
-13-03-4 OK Matches Tek hardcopy. PhotoPRINT appication we use for testing
- redefines halftone operations as no-op, which is wrong and
- cannot be considered a reference implementation. - Alex
-
-13-03-5 OK Minor differences visually reviewed by RJJ
-
-13-03-6 OK
-
-13-03-7 OK Color corrected by rev 7172.
-
-13-03-8 AOK Same as cash21, look30 : ustrokepath ending point.
-
-13-04-1 AOK Analyzed by Igor.
- CPSI prints an incomplete page.
- GS raster matches Tek except (1) different order
- of keys in a dictionary forall (implementation dependent),
- and (2) tek has an incorrect value FontType -1.
-
-13-04-2 OK
-
-13-04-3 OK
-
-13-05-1 OK
-
-13-05-2 OK
-
-13-05-3 AOK Adobe's interpreters accept a read-only font dictionary as a
- valid argument of definefont and modify it anyway. This is a
- bug that we will not emulate. (r7165 by Alex + comment by
- Peter)
-
-13-05-4 OK Minor differences visually reviewed by HAS
-
-13-06-1 OK Fixed in rev. 7163. - Alex
-
-13-06-2 OK
-
-13-07-1 OK
-
-13-07-2 OK Adjust error reporting from findfont procedure to match
- Distiller 5 and CET 13-06.PS.tek360 . The PhotoPrint product
- is clearly wrong here leaving a few objects on the stack
- besides the arguments when findfont fails. rev. 7164 - Alex
-
-13-07-3 OK
-
-13-08-1 OK Fixed by r7642.
-
-13-09-1 OK Fixed by r7642.
-
-13-10-1 OK
-
-13-10-2 OK
-
-13-10-3 OK
-
-13-10-4 OK
-
-13-10-5 OK Works for me in rev. 7543 - Alex.
-
-13-10-6 OK Minor differences visually reviewed by RJJ
-
-13-10-7 OK
-
-13-10-8 OK Minor differences visually reviewed by HAS. Color corrected by rev 7172.
-
-13-10-9 OK rev 7617.
-
-13-11-1 OK
-
-13-12-1 OK
-
-13-12-10 OK rev 7617.
-
-13-12-2 OK
-
-13-12-3 OK
-
-13-12-4 OK
-
-13-12-5 OK Minor differences visually reviewed by RJJ
-
-13-12-6 OK Matches Tek hardcopy, same as 13-03-4
-
-13-12-7 OK Minor differences visually reviewed by RJJ
-
-13-12-8 OK
-
-13-12-9 OK Color corrected by rev 7172.
-
-13-13-1 OK
-
-13-13-2 OK
-
-13-13-3 OK Minor differences visually reviewed by HAS
- (large diff count because of minor color diffs)
-
-13-13-4 OK Color corrected by rev 7172.
-
-13-13-5 OK Minor differences visually reviewed by HAS
-
-13-13-6 OK
-
-13-13-7 OK
-
-13-13-8 OK Color corrected by rev 7172. Fixed by rev 7617.
-
-13-14-1 AOK same as 13-04-1
-
-13-14-2 OK
-
-13-14-3 OK
-
-13-15-1 OK
-
-13-15-2 OK Color corrected by rev 7172.
-
-13-15-3 OK
-
-13-15-4 OK
-
-13-15-5 OK Minor differences visually reviewed by HAS
-
-13-16-1 OK
-
-13-16-2 OK
-
-13-16-3 OK Minor differences visually reviewed by RJJ
-
-13-16-4 OK
-
-13-16-5 OK Minor differences visually reviewed by RJJ
-
-13-16-6 OK
-
-13-16-7 OK Minor differences visually reviewed by RJJ
-
-13-16-8 OK
-
-13-16-9 OK rev 7617.
-
-13-17-1 OK Corrected by 7152 and 7162. ADC
-
-13-17-2 OK Corrected by 7152 and 7162. ADC
-
-13-17-3 OK Corrected by 7152 and 7162. ADC
-
-13-17-4 OK Corrected by 7152 and 7162. ADC
-
-13-17-5 OK Minor differences visually reviewed by RJJ
-
-13-17-6 OK Corrected by 7152 and 7162. ADC
-
-13-17-7 OK Minor differences in positions and character shapes - ADC
-
-13-17-8 OK rev 7617.
-
-13-18-1 OK
-
-13-18-10 OK Minor differences in positions and character shapes - ADC
-
-13-18-11 OK rev 7617.
-
-13-18-2 OK
-
-13-18-3 OK
-
-13-18-4 OK
-
-13-18-5 OK
-
-13-18-6 OK
-
-13-18-7 OK
-
-13-18-8 OK
-
-13-18-9 OK
-
-13-19-1 AOK GS has a better stroke adjustment. not impotant. Analyzed by Igor.
-
-13-19-2 AOK Same as 13-19-1. Analyzed by Igor.
-
-13-19-3 AOK Same as 13-19-1. Analyzed by Igor.
-
-13-19-4 AOK Same as 13-19-1. Analyzed by Igor.
-
-13-19-5 OK Minor differences visually reviewed by RJJ
-
-13-19-6 OK Minor differences in positions and character shapes - ADC
-
-13-19-7 OK rev 7617.
-
-13-20-1 OK Minor differences in positions and character shapes - ADC
-
-13-20-2 OK
-
-13-20-3 OK Minor differences visually reviewed by RJJ
-
-13-20-4 OK
-
-13-20-5 OK Corrected by 7152 and 7162. ADC
-
-13-20-6 OK rev 7617.
-
-13-21-1 OK Fixed by r7642.
-
-13-22-1 OK
-
-13-22-2 OK Minor differences visually reviewed by RJJ
-
-13-22-3 OK Minor differences visually reviewed by RJJ
-
-13-22-4 OK Minor differences visually reviewed by RJJ
-
-13-22-5 OK Color corrected by rev 7172.
-
-13-22-6 OK rev 7617.
-
-13-23-1 OK GS matches CPSI and Tek when Adobe fonts are used.
- With URW or UFST fonts, an extra line under /ordfeminine and
- /ordmasculine characters shows as well as slightly different
- appearance of other characters. This is a font issue and must
- be resolved by the font vendor chosen for the implementation.
-
-13-24-1 OK
-
-13-24-2 AOK An unimportant difference in the character cache logics. Analyzed by Igor.
-
-13-24-3 OK Minor differences visually reviewed by RJJ
-
-13-24-4 OK Minor differences in positions and character shapes - ADC
-
-13-24-5 OK Minor differences visually reviewed by Igor.
-
-13-24-6 AOK Same as cash21, look30 : ustrokepath ending point.
-
-13-25-1 OK
-
-13-25-2 OK Fixed as of r7610 (when run with -dLOCALFONTS).
-
-13-25-3 OK
-
-13-26-1 OK Minor differences visually reviewed by RJJ
-
-13-26-2 OK
-
-13-26-3 OK
-
-13-26-4 OK Fixed in rev. 7562. - Alex
-
-13-26-5 OK Minor differences visually reviewed by RJJ
-
-13-26-6 OK Minor differences visually reviewed by RJJ
-
-13-26-7 OK Minor differences visually reviewed by RJJ
-
-13-26-8 AOK Minor differences in colors - ADC
-
-13-26-9 OK rev 7617.
-
-13-27-1 OK Minor differences visually reviewed by RJJ
-
-13-27-2 OK
-
-13-27-3 OK rev 7542.
-
-13-27-4 OK Minor differences visually reviewed by RJJ
-
-13-27-5 OK Minor differences visually reviewed by RJJ
-
-13-27-6 OK
-
-13-27-7 AOK Minor differences in colors - ADC
-
-13-27-8 OK rev 7617.
-
-13-28-1 OK Minor differences visually reviewed by RJJ
-
-13-28-2 OK Minor differences visually reviewed by RJJ
-
-13-28-3 OK
-
-13-28-4 OK rev 7542.
-
-13-28-5 OK Minor differences visually reviewed by RJJ
-
-13-28-6 OK Minor differences visually reviewed by RJJ
-
-13-28-7 OK Minor differences visually reviewed by RJJ
-
-13-28-8 AOK Minor differences in colors - ADC
-
-13-28-9 OK rev 7617.
-
-13-29-1 OK Minor differences visually reviewed by RJJ
-
-13-29-2 OK
-
-13-29-3 OK rev 7542.
-
-13-29-4 OK Minor differences visually reviewed by RJJ
-
-13-29-5 OK Minor differences visually reviewed by RJJ
-
-13-29-6 OK Minor differences visually reviewed by RJJ
-
-13-29-7 OK Minor differences visually reviewed by Igor.
-
-13-29-8 OK rev 7617.
-
-14-01-1 OK Minor differences visually reviewed by RJJ
-
-14-01-10 OK Minor differences visually reviewed by RJJ
-
-14-01-11 OK Minor differences visually reviewed by RJJ
-
-14-01-12 OK Minor differences visually reviewed by RJJ
-
-14-01-13 OK Minor differences visually reviewed by RJJ
-
-14-01-14 OK Minor differences visually reviewed by RJJ
-
-14-01-15 OK Minor differences visually reviewed by RJJ
-
-14-01-2 OK Minor differences visually reviewed by RJJ
-
-14-01-3 OK Minor differences visually reviewed by RJJ
-
-14-01-4 OK Minor differences visually reviewed by RJJ
-
-14-01-5 OK Minor differences visually reviewed by RJJ
-
-14-01-6 OK Minor differences visually reviewed by RJJ
-
-14-01-7 OK Minor differences visually reviewed by RJJ
-
-14-01-8 OK Minor differences visually reviewed by RJJ
-
-14-01-9 OK Minor differences visually reviewed by RJJ
-
-14-02-1 OK Minor differences visually reviewed by RJJ
-
-14-02-2 OK
-
-14-03-1 OK Minor differences visually reviewed by RJJ
-
-14-03-2 OK
-
-14-03-3 OK Minor differences visually reviewed by RJJ
-
-14-04-1 OK Minor differences visually reviewed by RJJ
-
-14-04-2 OK Minor differences visually reviewed by RJJ
-
-14-05-1 OK
-
-14-05-2 OK
-
-14-06-1 OK
-
-14-07-1 OK Minor differences visually reviewed by RJJ
-
-14-08-1 OK Color corrected by rev 7172.
-
-14-08-10 OK Corrected by 7152 and 7162. ADC
-
-14-08-11 OK Corrected by 7152 and 7162. ADC
-
-14-08-12 OK Corrected by 7152 and 7162. ADC
-
-14-08-13 OK Corrected by 7152 and 7162. ADC
-
-14-08-14 OK Corrected by 7152 and 7162. ADC
-
-14-08-15 OK Corrected by 7152 and 7162. ADC
-
-14-08-16 OK Corrected by 7152 and 7162. ADC
-
-14-08-17 OK A minor difference in color. Analyzed by Igor.
-
-14-08-18 OK Color corrected by rev 7172.
-
-14-08-19 OK A minor difference in color. Analyzed by Igor.
-
-14-08-2 OK Color corrected by rev 7172.
-
-14-08-20 OK A minor difference in color. Analyzed by Igor.
-
-14-08-21 OK A minor difference in color. Analyzed by Igor.
-
-14-08-22 OK A minor difference in color. Analyzed by Igor.
-
-14-08-23 OK Color corrected by rev 7172.
-
-14-08-24 OK A minor difference in color. Analyzed by Igor.
-
-14-08-3 OK A minor difference in color. Analyzed by Igor.
-
-14-08-4 OK Color corrected by rev 7172.
-
-14-08-5 OK A minor difference in color. Analyzed by Igor.
-
-14-08-6 OK Color corrected by rev 7172.
-
-14-08-7 OK A minor difference in color. Analyzed by Igor.
-
-14-08-8 OK Colors corrected by rev 7172.
-
-14-08-9 OK Corrected by 7152 and 7162. ADC
-
-14-09-1 OK
-
-14-09-2 OK
-
-14-09-3 OK
-
-14-09-4 OK
-
-14-10-1 OK
-
-14-10-2 OK
-
-14-10-3 OK
-
-14-10-4 OK
-
-14-11-1 OK Minor differences visually reviewed by RJJ
-
-14-11-2 OK Minor differences visually reviewed by RJJ
-
-14-12-1 OK
-
-14-12-2 OK
-
-14-12-3 AOK A glyph positioning difference.
- Analyzed by Igor.
- I believe it is CPSI problem.
- A simplified test is placed to
- peeves:/home/igor/pscet/mytests/14-12-3-Igor01.PS
- With this test CPSI prints :
- .
- aaaa1:
- Helvetica
- has WMode
- def:/Helvetica-Oblique
- 1
- defined:1
- aaaa2:
- Helvetica
- nas no WMode
- .
- Thus the redefinition of the font Helvetica
- is dropped when Helvetica-Oblique is redefined.
- It is an incorrect behavior.
- Due to that the cshow procedure prints
- currentfont /WMode like this :
- [1 1 /U /U /U /U 1 1 0 0 0 0]
- The right result must be :
- [1 1 1 1 0 0 1 1 0 0 0 0]
- Using the wrong WMode, glyph placements
- are wrong with CPSI.
- Tek paints something different,
- which is closer to Ghostscript,
- but looks wrong again.
- .
- Some tips for those who wants to analyze it :
- 1. Font_Dict is a FMap 2 font with 8 descendents :
- 1.0. Times-Roman
- 1.1. Type3WMode0 (paints rectangles with size depending on char code);
- 1.2. Type3WMode1 (same as above but with WMode 1)
- 1.3. Type0Font1 2 scalefont - the test doesn't use it.
- 1.4. FMAP2 - a FMap 2 font [ Helvetica, Helvetica-Bold, Helvetica-Oblique, Helvetica-BoldOblique]
- 1.5. FMAP4 [Symbol, Symbol 2 scalefont] - the test doesn't use it.
- 1.6. FMAP5 [Courier, , , ] - the test doesn't use it.
- 1.7. FMap6 [Helvetica, ...] - the test doesn't use it.
- 2. All 1st level descendent fonts above has WMode = DescendentWMode = 1
- 3. Helvetica, Helvetica-Bold, Helvetica-Oblique, Helvetica-BoldOblique
- are built into the font above aftyer redefinition with find&mod,
- which changes WMode like this :
- Helvetica WMode 1
- Helvetica-Bold WMode 0
- Helvetica-Oblique WMode 1
- Helvetica-BoldOblique WMode 0
- 4. The text string is decomposed like this :
- 2A 2a 40A 40a 41A 41a 42A 42a 43A 43a 1A 1A
- The 1st byte selects the 1st level descendent,
- then it tripples the 2nd byte selects the 2nd level descendent.
- 5. We believe that WMode of the leaf font only have sence.
-
-14-12-4 OK
-
-14-12-5 AOK Same as 14-12-3.
-
-14-12-6 AOK Same as 14-12-3.
-
-14-13-1 OK Minor differences visually reviewed by RJJ
-
-14-13-2 OK Minor differences visually reviewed by RJJ
-
-14-14-1 OK
-
-15-01-1 OK Fixed as of Nov 4 2005
-
-15-01-2 OK Minor rasterizing differences. -Tor
-
-15-02-1 OK Fixed as of rev 7598.
-
-15-02-2 OK Minor differences visually reviewed by RJJ
-
-15-03-1 OK Fixed as of Nov 4 2005
-
-15-04-1 AOK GS has -12dict- and CPSI has -11dict- in debug text. Different checksum. The
- font dictionary debug for GS has one more key: /OrigFont.
- I think these differences are harmless, and are not particularly easy to fix. If we do decide it needs fixing, Peter is a good choice. - Raph
-
-15-04-2 AOK Different checksum. The font dictionary debug for GS has more keys: /OrigFont and /FontInfo.
- See 15-04-1 - Raph
-
-15-04-3 AOK Different checksum. The font dictionary debug for GS has one more key: /OrigFont.
- See 15-04-1 - Raph
-
-15-05-1 OK Fixed when tested with 7210
-
-15-05-2 OK Fixed when tested with 7210
-
-15-05-3 OK Color corrected by rev 7172.
-
-15-06-1 OK Corrected by rev 7172.
-
-15-07-1 OK Minor rasterizing differences. -Tor
-
-15-08-1 OK Fixed in r7156 - Raph
-
-15-09-1 OK Minor rasterizing differences. Stroke width difference. -Tor
-
-15-09-2 OK Minor rasterizing differences. -Tor
-
-15-09-3 OK Minor rasterizing differences. -Tor
-
-15-10-1 OK Minor differences visually reviewed by RJJ
-
-15-10-2 OK Minor differences visually reviewed by RJJ
-
-15-10-3 OK Minor rasterizing differences. -Tor
-
-15-10-4 OK Minor rasterizing differences. -Tor
-
-15-11-1 OK Fixed by rev. 7806. - Alex
-
-15-14-1 OK Minor differences visually reviewed by RJJ
-
-15-15-1 OK Minor rasterizing differences. -Tor
-
-16-01-1 AOK glyphs 19-22 : Tiny gaps between almost adjoining black rectangles;
- output will vary from device to device to device, and our rendering is valid.
- Glyphs 207, 208: reverse video in Adobe output, likely Adobe bug.
- Simplified tests are placed at
- peeves:/home/igor/pscet/mytests/16-01/
- A patch for emulating such behavior is placed at
- peeves:/home/igor/pscet/mypatches/16-01-Igor-01.txt
- We won't commit that patch.
- Suggesting to give the patch to the customer as a separate product.
-
-16-02-1 AOK Same as 16-01-1.
-
-16-03-1 OK Fixed by rev 7172.
-
-16-03-2 OK
-
-16-03-3 OK
-
-16-03-4 OK Now appears correct - Raph
-
-16-04-1 OK Fixed by rev. 7686 - Alex
-
-16-05-1 OK Color corrected by rev 7172
-
-16-05-2 DIFF Three smallest sizes are slanted squares in gs, same shape as larger ones in Adobe.
- Also USE_ADOBE_CMYK_RGB issue - Raph
- assign: Ray
-
-16-05-3 OK Color corrected by rev 7172.
-
-16-06-1 OK trivial font rendering diff - Raph
-
-16-07-1 OK Checked by Raph
-
-16-08-1 OK Fixed in r7156 - Raph
-
-16-09-1 OK
-
-16-10-1 AOK Same as 16-01-1.
-
-16-10-2 AOK Same as 16-01-1.
-
-16-10-3 AOK Same as 16-01-1.
-
-16-11-1 OK Fixed by rev 7172.
-
-16-14-1 OK
-
-16-15-1 OK
-
-16-16-1 OK
-
-17-01-1 OK
-
-17-01-2 OK Fixed as of rev 7598.
-
-17-01-3 OK Fixed in rev 7630 (Peter)
-
-17-01-4 OK Fixed as of rev 7598.
-
-17-01-5 OK
-
-17-01-6 AOK Matches Tek. CPSI different.
-
-17-01-7 AOK Matches Tek and Distiller 5. CPSI is different and wrong,
- The test exercises ineofill operator and can be easily checked
- visually by modifying the test to fill the current path.
-
-17-01-8 OK
-
-17-02-1 OK
-
-17-02-2 OK Fixed as of rev. 7598.
-
-17-02-3 OK Same as 17-01-3
-
-17-02-4 OK Fixed as of rev 7598.
-
-17-02-5 OK
-
-17-02-6 AOK Same as 17-01-6 but tests infill instead of ineofill.
- Matches Tek and Distiller 5. CPSI is different and wrong,
-
-17-02-7 AOK Same as 17-01-6 but tests infill instead of ineofill.
- Matches Tek and Distiller 5. CPSI is different and wrong,
-
-17-02-8 OK
-
-17-03-1 OK
-
-17-03-2 DIFF GS has curves where CPSI has straight lines. Also GS differs in marker symbols.
- Note Tek has _different_ straight line pattern and marker symbols.
- This is not identified as "Device Dependent" in the test.
- curve flatness used to draw lines. Assign: ray
-
-17-03-3 OK Same as 17-01-3
-
-17-03-4 OK Minor differences visually reviewed by RJJ
-
-17-03-5 DIFF Similar to 17-01-6 but tests instroke. The insideness testing is OK
- but the pattern phase is different from Tek and CPSI. assign: Ray
-
-17-03-6 OK
-
-17-04-1 OK
-
-17-04-2 AOK The test is unreasonable. The test checks whether a point is in
- the user path (using inueofill operator) but places many of
- the points on the boundary of the path where insideness is
- affected by rounding errors. When the point is inside the path,
- a small black circle is drawn around the point. The test is
- performed for different CTM.
- -
- Ghostscript skips some of the points at low resolution but
- draws all expected points at 300 dpi and above.
- -
- CPSI, Tek, and Distiller 5 are all different and skip different
- points depending on the current CTM. - Alex
-
-17-04-3 OK same as 17-02-3
-
-17-04-4 OK
-
-17-04-5 OK
-
-17-05-1 OK
-
-17-05-2 AOK Similar to 17-04-2 but testing inufill. - Alex
-
-17-05-3 OK Same as 17-01-3
-
-17-05-4 OK
-
-17-05-5 OK
-
-17-06-1 OK
-
-17-06-2 AOK Similar to 17-04-2 but testing inustroke. Placing the dots in
- middle of the stroke is reasonable but some of the dots are
- placed at the end of the line where their relative position
- depends on the rounding errors. Ghostscript generates
- correct results above 300 dpi. CPSI and Tek miss some
- points, - Alex
-
-17-06-3 OK Fixed as of rev 7636.
-
-17-06-4 OK
-
-18-01A-1 AOK Minor difference in the font size.
- Note: patterns are resolution dependent,
-
-18-01A-2 OK Minor differences visually reviewed by HAS.
-
-18-01A-3 OK Minor differences visually reviewed by RJJ
-
-18-01A-4 OK
-
-18-01A-5 OK Minor differences visually reviewed by RJJ
-
-18-01A-6 OK Minor differences visually reviewed by RJJ
-
-18-01A-7 OK Minor differences visually reviewed by RJJ
-
-18-01B-1 DIFF The word "FORM" in the magenta oval throughout the test
- is white with cpsi and gray with gs. (repeats). - color saturation problem.
- assign Tim
-
-18-01B-2 DIFF (18-01B-1) lower right graphic cpsi has red lines where gs has white. (assign Raph).
- The locations of squares are shifted in this pattern. Distiller/Acrobat
- 7.0 reports error 'incorrect number of values for setcolor operator'.
- This is probaly related to the problem for 12-01-5. See Jan's
- email analysis of that problem. (He reports a problem with pattern
- shifts with patterns.)
-
-18-01C-1 OK Minor differences visually reviewed by RJJ
-
-18-02A-1 DIFF pattern size differs first row of graphics. assign Tim
-
-18-02A-2 OK Minor differences visually reviewed by HAS. Color corrected by rev 7172.
-
-18-02A-3 OK Minor differences visually reviewed by HAS.
-
-18-02A-4 OK Reviewed by Raph. Probably fixed by r7114.
-
-18-02B-1 OK Minor differences visually reviewed by HAS.
-
-18-02B-10 AOK 18-02A-4 repeat
- Fill rule is ok, shadings sharper in GS than Adobe. - Raph
- Per conversation with Ray, we have decided that our rendering
- of these shadings (which have discontinuities) is more correct
- than Adobe. Also note that for test 9, Tek and GS match, but
- CPSI doesn't.
-
-18-02B-11 DIFF 18-02A-4 repeat
- Fill rule is ok. Test 1, 4 shadings sharper in GS than Adobe.
- Test 9-12 colors darker in Adobe than GS. - Assign Tim
-
-18-02B-12 DIFF 18-02A-4 repeat
- Fill rule is ok. Test 1-3, 11 colors darker in Adobe.
- Test 12 colors lighter in Adobe. - Raph
- assign Tim
-
-18-02B-13 DIFF 18-02A-4 repeat
- Fill rule is ok. Test 1-6 colors different as above. Raph
- assign Tim
-
-18-02B-2 OK
-
-18-02B-3 OK Minor differences visually reviewed by HAS.
-
-18-02B-4 OK Minor differences visually reviewed by HAS.
-
-18-02B-5 OK Minor differences visually reviewed by RJJ
-
-18-02B-6 OK Minor differences visually reviewed by RJJ
-
-18-02B-7 DIFF 18-02A-4 repeat
- Fill rule is ok.
- Test 8-12 colors darker in Adobe than GS. - Raph
- assign Tim
-
-18-02B-8 OK Probably fixed by r7114.
-
-18-02B-9 AOK 18-02A-4 repeat
- Fill rule is ok, shadings sharper in GS than Adobe. - Raph
-
-18-02C-1 DIFF Partialy fixed by rev. 7738.
- Adobe doesn't restore operands of rectfill operator when
- an error happen in the PaintProc function but
- Ghostscript does. assign: Alex
-
-18-02D-1 OK Fixed by rev. 7738. - Alex
-
-18-02E-1 DIFF much of postscript dump missing in gs. assign Ray
- Ghostscript doesn't detect color operators in uncolored
- pattern.
-
-18-02E-2 DIFF much of postscript dump missing in gs. assign Ray
- Ghostscript doesn't detect color operators in uncolored
- pattern.
-
-18-02F-1 OK Minor differences visually reviewed by HAS.
-
-18-02F-2 DIFF pattern in third row of graphics out of phase. assign Tim
-
-18-02F-3 DIFF 18-02A-4 repeat
- repeat of AOK problem assign Tim
-
-18-02F-4 OK Fixed before Nov 3 (after Oct 2).
-
-18-02F-5 DIFF 18-02A-4 repeat
- repeat of AOK problem assign Tim
-
-18-02G-1 DIFF strokepath different - assign: Igor.
- -
- pattern differs in 4th column of stars in the last box.
- Analyzed by Igor.
- See also 12-01-5.
- A simplified test case is placed to
- peeves:/home/igor/pscet/mytests/18-02G-1-Igor01.PS .
- This is a general pattern implementation problem.
- The test defines a pattern with TESTPROC,
- and then applyes this pattern for creating another pattern
- Inf71ColorPattern. Doing the 2nd step, Ghostscript
- instantiates the 1st pattern in the 2nd pattern's space.
- Contrary to that, CPSI instantiates the 1st pattern
- in the device space when instantiating the 2st pattern.
- Thus the overall pattern period with CPSI is a multiple
- of periods of the 1st and the 2nd patterns.
- This problem may be fixed for Ghostscript
- with implementing high level patterns for
- clist and raster devices.
- It would be a significant development,
- which we currently have no time for.
- Passing to Ray for schedulling.
- assign: Ray.
-
-18-02G-2 OK Fixed by r7123.
-
-18-02G-3 AOK Minor differences visually reviewed by HAS.
-
-19-01-1 OK
-
-19-01-2 OK
-
-19-02-1 OK
-
-19-02-2 OK
-
-19-02-3 OK
-
-19-03-1 OK
-
-19-03-2 OK
-
-19-03-3 OK
-
-19-04-1 OK
-
-19-04-2 OK
-
-19-05-1 OK Minor differences visually reviewed by RJJ
-
-19-05-2 OK Minor differences visually reviewed by RJJ
-
-19-05-3 OK
-
-19-06-1 OK
-
-19-06-2 OK
-
-19-07-1 OK
-
-19-07-2 OK
-
-19-08-1 OK
-
-19-08-2 OK
-
-19-09-1 OK
-
-19-09-2 OK
-
-19-09-3 OK
-
-19-10-1 OK
-
-19-10-2 OK
-
-19-11-1 OK Minor differences visually reviewed by RJJ
-
-19-11-2 OK
-
-19-12-1 OK Minor differences visually reviewed by RJJ
-
-19-12-2 OK
-
-19-13-1 OK Minor differences visually reviewed by RJJ
-
-19-13-2 OK Minor differences visually reviewed by RJJ
-
-19-13-3 OK
-
-19-14-1 OK Minor differences visually reviewed by RJJ
-
-19-14-2 OK
-
-20-01-1 OK Fixed in rev. 7712. - Alex
-
-20-01-2 AOK GS prints { 1 2 3 } [ 1 2 3 ] (1 2 3) where CPSI prints { 1 2 3 } [mark /1 -3array- ] and ( )
- i.e. CPSI modifies the content of the array arguments when operator >> fails.
- Ghostscript matches Tek and Distiller 5. This is a bug in CPSI we don't
- want to reproduce. - Alex
-
-20-01-3 OK
-
-20-02-1 OK Looks okay. -Tor
-
-20-02-2 OK Fixed by rev. 7829. - Alex
-
-20-02-3 OK Color corrected by rev 7172.
-
-20-03-1 OK
-
-20-03-2 OK
-
-20-04-1 OK Minor differences visually reviewed by RJJ
-
-20-04-2 OK Minor differences visually reviewed by RJJ
-
-20-04-3 OK Color corrected by rev 7172.
-
-20-05-1 OK
-
-20-05-2 OK
-
-20-06-1 OK
-
-20-06-2 OK
-
-20-07-1 OK
-
-20-07-2 OK
-
-20-08-1 OK
-
-20-08-2 OK
-
-20-08-3 OK
-
-20-09-1 OK
-
-20-09-2 OK
-
-20-09-3 OK
-
-20-10-1 OK
-
-20-10-2 OK
-
-20-11-1 OK fixed incidentally.
-
-20-11-2 OK fixed incidentally.
-
-20-11-3 OK
-
-20-12-1 OK Looks okay. -Tor
-
-20-12-2 OK
-
-20-13-1 OK Looks okay. -Tor
-
-20-13-2 OK Color corrected by rev 7172.
-
-20-14-1 OK GS matches Tek hardcopy. (Peter->Ray)
-
-20-14-2 OK Color corrected by rev 7172.
-
-20-15-1 OK Fixed by rev. 7713. - Alex
-
-20-15-2 OK
-
-20-16-1 OK Looks okay. -Tor
-
-20-16-2 OK Color corrected by rev 7172.
-
-20-17-1 OK
-
-20-17-2 OK
-
-20-18-1 OK Looks okay. -Tor
-
-20-18-2 OK Color corrected by rev 7172.
-
-20-19-1 OK Minor differences visually reviewed by RJJ
-
-20-19-2 OK Color corrected by rev 7172.
-
-20-20-1 OK GS matches Tek and CPSI as of rev. 7741.
-
-20-20-2 OK
-
-20-21-1 OK
-
-20-21-2 OK
-
-20-22-1 OK
-
-20-22-2 OK
-
-20-22-3 OK
-
-20-23-1 OK Tek and CPSI don't have /deviceinfo. Availability of this operator
- on Ghostscript deprnds on gs_dps device. Rev. 7723 undefines it in
- gs_cet.ps to pass the test regardless of the configuration. - Alex
-
-20-23-2 OK
-
-20-24-1 OK
-
-20-24-2 OK
-
-20-25-1 OK
-
-20-25-2 OK
-
-20-25-3 OK
-
-20-26-1 OK
-
-20-26-2 OK
-
-20-27-1 AOK This test check the content of the $error dictionary.
- The content varies depending on the code executed before.
- There's no error on CPSI, as it was stated before, The
- value of /errorname is an error name, which is always
- printed as white on black by the test program. - Alex
-
-20-27-2 OK
-
-21-01-1 OK
-
-21-01-2 OK
-
-21-02-1 OK Minor differences visually reviewed by RJJ
-
-21-02-2 OK Minor differences visually reviewed by RJJ
-
-21-02-3 OK Minor differences in positions and character shapes - ADC
-
-21-03-1 OK Minor differences in positions and character shapes - ADC
-
-21-03-2 OK Minor differences in positions and character shapes - ADC
-
-21-03-3 OK
-
-21-04-1 OK Minor differences in positions and character shapes - ADC
-
-21-04-2 OK Minor differences in positions and character shapes - ADC
-
-21-04-3 OK Minor differences in positions and character shapes - ADC
-
-21-05-1 OK Minor differences in positions and character shapes - ADC
-
-21-05-2 OK Minor differences in positions and character shapes - ADC
-
-21-05-3 OK Minor differences in positions and character shapes - ADC
-
-21-06-1 OK Minor differences in positions and character shapes - ADC
-
-21-06-2 OK Minor differences in positions and character shapes - ADC2
-
-21-06-3 OK Minor differences in positions and character shapes - ADC
-
-21-07-1 OK Minor differences visually reviewed by RJJ
-
-21-07-2 OK Minor differences in positions and character shapes - ADC
-
-21-07-3 OK Minor differences in positions and character shapes - ADC
-
-21-08-1 OK Minor differences visually reviewed by RJJ
-
-21-08-2 OK Minor differences visually reviewed by RJJ
-
-21-08-3 OK Minor differences in positions and character shapes - ADC
-
-21-09-1 OK
-
-21-09-2 OK
-
-21-10-1 OK Minor differences in positions and character shapes - ADC
-
-21-10-2 OK Minor differences in positions and character shapes - ADC
-
-21-11-1 OK
-
-21-11-2 OK Fixed as of rev 7598.
-
-21-11-3 OK Fixed as of rev 7616.
-
-21-11-4 OK
-
-21-11-5 OK
-
-21-11-6 DIFF Differences in error messages for operator token - ADC
- assign Peter
-
-21-11-7 OK Corrected by 7152 and 7162. ADC
-
-22-01-1 OK
-
-22-01-2 OK
-
-22-02-1 OK
-
-22-02-2 OK
-
-22-03-1 OK
-
-22-03-2 OK
-
-22-04-1 OK
-
-22-04-2 OK
-
-22-05-1 OK Minor differences visually reviewed by RJJ
-
-22-05-2 OK
-
-22-06-1 OK
-
-22-06-2 OK
-
-22-07-1 OK
-
-22-07-2 OK
-
-22-07-3 OK
-
-22-08-1 OK Minor differences visually reviewed by RJJ
-
-22-08-2 OK Minor differences visually reviewed by RJJ
-
-22-08-3 OK Visually OK SK small variations in tiny colour cube.
-
-22-09-1 OK
-
-22-09-2 OK
-
-22-10-1 OK Minor differences visually reviewed by HAS
-
-22-10-2 OK
-
-22-10-3 OK
-
-22-11-1 OK
-
-22-11-2 OK
-
-22-12-1 OK Minor differences visually reviewed by RJJ
-
-22-12-2 OK Minor differences visually reviewed by RJJ
-
-22-13-1 OK
-
-22-13-2 OK
-
-22-13-3 OK
-
-22-13-4 OK
-
-23-01-1 OK
-
-23-01-2 OK
-
-23-02-1 OK
-
-23-02-2 OK
-
-23-03-1 AOK Device Dependent: Test checks for 'bytesavailable' on 'currentfile'.
- This is generally not supported from %stdin.
-
-23-03-2 OK
-
-23-04-1 OK
-
-23-04-2 OK
-
-23-05-1 OK
-
-23-05-2 OK
-
-23-06-1 OK
-
-23-06-2 OK
-
-23-07-1 OK Fixed by rev. 7442
-
-23-07-2 AOK There is still a diff in 23-07-2 in that the contents of our resource
- category dictionaries (in this case, the Generic dictionary) are different
- from the Adobe interpreters: we and Adobe have different implementation-specific
- (non-PLRM) entries, and the PLRM-documented procedures (FindResource, etc.)
- are different. This is inherently implementation-dependent and does not
- affect any real program, so no further changes are needed. (Peter)
-
-23-07-3 OK Fixed by rev. 7442
-
-23-07-4 OK
-
-23-08-1 OK
-
-23-09-1 DIFF The first bytesavailable diff is identified as "highly device dependent".
- As such, I recommend discounting it. No real program will rely on the
- result.
- -
- The two invalidaccess diffs occur because the reference implementation does
- not allow PostScript programs to open files for writing. This is not a gs
- bug, but it does suggest that gs should provide some way to indicate/detect
- that it is running in an embedded environment with no (writable) filesystem.
- Does this exist already?
- -
- The remaining 3 diffs occur because gs implements %null as a special file
- name and the reference implementation apparently doesn't, per a previous
- e-mail.
- -
- assign: ray
-
-23-10-1 AOK Device Dependent: GS looks like it is working similar to CPSI ot
- Tek, but all three differ. RJJ
-
-23-10-2 OK
-
-23-11-1 OK Minor differences visually reviewed by RJJ
-
-23-12A-1 OK
-
-23-12A-2 OK
-
-23-12A-3 AOK The discrepancies are in the length of the encoded
- string produced by the ASCII85Encode and
- RunLengthEncode filter respectively. These filters
- have some discretion in their output -- ASCII85Encode
- must insert a \n at least every 80 characters, but may
- insert one more often, and RunLengthEncode is not
- required to produce maximum-length runs -- and it
- appears that gs's implementation of these filters
- produces output that is 1 byte shorter than Adobe's in
- some cases. gs's output is (also) correct -- the CET
- verifies it by decoding it and comparing against the
- original. (peter)
-
-23-12A-4 AOK same resolution as 23-12A-3.
-
-23-12B-1 DIFF GS gets "-file- ( ioerror --readstring--" on FAX_6 test. Last
- image of top row missing, others may be shifted. assign: Peter
-
-23-12C-1 OK
-
-23-12C-2 OK
-
-23-12C-3 OK
-
-23-12D-1 OK Fixed incidentally
-
-23-12D-2 OK Fixed incidentally
-
-23-12D-3 OK Fixed incidentally
-
-23-12D-4 OK Fixed incidentally
-
-23-12E-1 AOK Device Dependent: Test says "length can vary due to multiple valid
- methods". GS differs by 1 to 5 in results (hope that's close enough)
- RJJ
-
-23-12E-2 AOK (Peter) 7605 fixes ioerror and incorrect output problems.
- -
- "There are still discrepancies in the length of the
- compressed data, for the same reason as 23-12A-3 et
- al. In this case, gs's implementation is slightly
- inferior to Adobe's (about 6% larger compressed data
- in the worst case on the CET page), probably because
- in the mixed 1- and 2-D case, we don't bother to
- compress each line both ways and use whichever method
- produces the smaller output."
-
-23-12E-3 OK Device Dependent: minor position/stairstep differences, but visually
- equivalent to Tek. RJJ.
-
-23-12E-4 OK Device Dependent: minor position/stairstep differences, but visually
- equivalent to Tek. RJJ.
-
-23-12E-5 DIFF GS has lower three graphics 'squashed' horizontally. assign: Ray
-
-23-12E-6 DIFF GS has lower three graphics as .step-pyramids'. assign: Ray
-
-23-12E-7 OK
-
-23-12F-1 OK
-
-23-12G-1 AOK same as 23-12A-3 (peter)
-
-23-12G-2 AOK same as 23-12A-3 (peter)
-
-23-12G-3 OK
-
-23-12H-1 OK
-
-23-12I-1 OK. Fix from Peter
-
-23-12I-2 OK. Fix from Peter
-
-23-12J-1 OK
-
-23-12J-2 OK
-
-23-12J-3 OK
-
-23-12J-4 OK
-
-23-12K-1 OK Fixed as of r7500.
-
-23-12K-2 OK Fixed by rev 7808. - Alex
-
-23-12L-1 AOK same as 23-12A-3
-
-23-12M-1 AOK same as 23-12A-3
-
-23-12N-1 AOK same as 23-12A-3
-
-23-12O-1 AOK same as 23-12A-3
-
-23-12O-2 OK Fixed by rev 7489.
-
-23-12P-1 AOK same as 23-12A-3
-
-23-12P-2 OK Fixed by rev 7489.
-
-23-12Q-1 OK
-
-23-12R-1 OK
-
-23-12S-1 OK
-
-23-12T-1 OK
-
-23-12U-1 OK Fixed as of r7500.
-
-23-12V-1 OK Fixed as of r7500.
-
-23-12W-1 OK Fixed as of r7500.
-
-23-12W-2 OK Fixed as of rev 7636.
-
-23-12W-3 OK Minor differences visually reviewed by RJJ
-
-23-12W-4 OK Matches Tek hardcopy. CPSI-based PhotoPrint product ignores
- sethalftone and cannot be a reference implementation here.
-
-23-12W-5 OK Fixed by rev 7149.
-
-23-12W-6 OK Fixed as of r7500.
-
-23-13-1 OK Fixed as of r7610 (when run with -dLOCALFONTS).
-
-23-13-2 AOK Device Dependent: GS has more entries for Filter, ColorSpace
- page fills before ImageType and PatternType shown.
-
-23-13-3 DIFF Device Dependent: GS has different Resource Categories and also
- has different number of columns. Assign: Ray for further analysis
-
-23-13-4 AOK Ghostscript has extra keys in the font dictionary. PLRM says that
- implementations can add specific keys. Rev. 7724 - Alex
-
-23-13-5 OK Fixed by rev 7442.
-
-23-13-6 OK
-
-23-14-1 OK
-
-23-14-2 OK
-
-23-15-1 OK
-
-23-15-2 OK
-
-23-16-1 OK Minor differences visually reviewed by RJJ
-
-23-16-2 OK
-
-23-17-1 OK Minor differences visually reviewed by RJJ
-
-23-17-2 AOK Probably fixed with 23-17-3
-
-23-17-3 AOK Fixed see 23-29-2, 23-36-3 and 23-36-4
-
-23-18-1 OK Minor differences visually reviewed by RJJ
-
-23-18-2 OK
-
-23-19-1 OK
-
-23-19-2 OK
-
-23-20-1 OK Fixed by rev. 7809. - Alex
-
-23-20-2 OK
-
-23-21-1 OK Fixed in rev. 7140. - Alex.
-
-23-21-2 OK
-
-23-22-1 OK Fixed in rev. 7143. - Alex.
-
-23-22-2 OK
-
-23-23-1 OK Fixed in rev. 7144. - Alex.
-
-23-24-1 OK
-
-23-24-2 OK
-
-23-25-1 DIFF GS gets 'undefinedfilename' error. Tek and CPSI do not. Assign: Ray
-
-23-25-2 DIFF GS gets 'undefined' error during defineresource. (PLRM3 requires
- CIDSystemInfo). Device Dependent: CPSI doesn't define Localization
- category. Needs Tek hardcopy. Assign: Ray
-
-23-25-3 DIFF GS close to Tek, but stack contents when 'stackunderflow' reported
- differs. GS reports 'undefinedresource' vs. 'typecheck' of Tek.
- Different error and stack from ((FNT1) {cvn} () resourceforall).
- Needs Tek hardcopy. Assign: Ray
-
-23-25-4 OK
-
-23-25-5 OK
-
-23-25-6 OK
-
-23-25-7 OK
-
-23-26-1 OK
-
-23-26-2 OK Fixed before Oct 2.
-
-23-26-3 AOK Device Dependent: GS has more entries for Filter, ColorSpace
- page fills before ImageType and PatternType shown. Same as 23-13-2.
-
-23-26-4 OK Adobe interpreters have resoursestatus as an operator but report errors
- in the executable name. Since rev. 7619 we do the same. - Alex
-
-23-26-5 OK
-
-23-26-6 OK
-
-23-28-1 OK Fixed in rev. 7146. - Alex.
-
-23-29-1 OK
-
-23-29-2 OK fixed in rev. 7232 (Peter)
-
-23-29-3 OK
-
-23-30-1 OK
-
-23-30-2 OK
-
-23-31-1 OK Matches Tek hardcopy. RJJ (CPSI differs)
-
-23-31-2 OK
-
-23-32-1 OK
-
-23-32-2 DIFF 'token' error inconformity.
- Environment dependent (a virtual address in the printing).
- assign: Peter
-
-23-32-3 OK Fixed as of rev 7598.
-
-23-32-4 OK fixed in rev 7672 (Peter)
-
-23-32-5 OK
-
-23-32-6 OK
-
-23-33-1 AOK Device Dependent: status and number of Font, Encoding, and
- ColorSpaceFamily resources pre-loaded differs between CPSI and
- Tek and Ghostscript. (this is not a problem).
-
-23-33-2 OK GS matches Tek hardcopy. CPSI shows "0 -1 T" in last line.
-
-23-33-3 OK Fixed in rev. 7620 - Alex
-
-23-33-4 OK Fixed in rev. 7620 - Alex
-
-23-33-5 OK Fixed in rev. 7619; See 23-26-4 for details. - Alex.
-
-23-33-6 OK
-
-23-34-1 OK
-
-23-34-2 OK
-
-23-35-1 OK
-
-23-35-2 OK
-
-23-35-3 OK
-
-23-36-1 OK
-
-23-36-2 OK Fixed in r7631 Peter
-
-23-36-3 AOK fixed in rev. 7232 (Peter)
-
-23-36-4 OK fixed in rev. 7232 (Peter)
-
-23-37-1 OK
-
-23-37-2 OK
-
-23-37-3 OK
-
-24-01-1 OK
-
-24-01-2 OK
-
-24-02-1 OK
-
-24-02-2 OK
-
-24-02-3 OK
-
-24-03-1 OK
-
-24-03-2 OK
-
-24-04-1 OK
-
-24-04-2 OK
-
-24-05-1 OK Fixed by Alex, rev. 7131.
-
-24-05-2 AOK Fixed by Alex, rev. 7131. except that Adobe interpreters have
- a bug when "1234556789 10 ( ) cvrs" restores the stack as
- "123456789 ( ) ( )" Ghostscript doesn't have this bug.
- Since we don't want to put in a bug, this will be an anomaly.
-
-24-05-3 OK
-
-24-06-1 OK
-
-24-06-2 OK Fixed by Alex, rev. 7131.
-
-24-06-3 OK
-
-24-07-1 OK
-
-24-07-2 OK
-
-24-08-1 OK Minor differences visually reviewed by RJJ
-
-24-08-2 OK
-
-24-08-3 OK
-
-24-09-1 OK
-
-24-09-2 OK
-
-24-09-3 OK
-
-24-10-1 OK
-
-24-10-2 OK
-
-24-10-3 OK
-
-24-11-1 OK Minor differences visually reviewed by RJJ
-
-24-11-2 OK
-
-24-11-3 OK
-
-24-12-1 OK Minor differences visually reviewed by RJJ
-
-24-12-2 OK
-
-24-13-1 OK
-
-24-13-2 OK
-
-24-13-3 OK Fixed by r7642.
-
-24-14-1 OK
-
-24-14-2 OK
-
-25-01-1 OK
-
-25-01-2 OK
-
-25-02-1 OK
-
-25-02-2 OK
-
-25-03-1 OK Minor differences visually reviewed by RJJ
-
-25-03-2 OK
-
-25-04-1 OK Minor differences visually reviewed by RJJ
-
-25-04-2 OK
-
-25-05-1 OK GS matches Tek hardcopy. Fixed by rev 7140.
- GS has more accurate (and correct) sin/cos functions than CPSI
-
-25-05-2 OK
-
-25-06-1 OK
-
-25-06-2 OK
-
-25-07-1 OK Fixed by rev 7139.
-
-25-07-2 OK
-
-25-08-1 OK Minor differences visually reviewed by RJJ
-
-25-08-2 OK
-
-25-09-1 OK Fixed by rev 7225.
-
-25-09-2 OK Fixed by rev 7224.
-
-25-10-1 OK GS matches Tek hardcopy. Fixed by rev 7140.
-
-25-10-2 OK
-
-25-11-1 OK GS matches Tek hardcopy. Fixed by rev 7140.
- GS has more accurate (and correct) sin/cos functions than CPSI
-
-25-11-2 OK
-
-25-12-1 OK
-
-25-12-2 OK
-
-25-13-1 OK Fixed - Alex.
-
-25-13-2 OK
-
-25-14-1 OK
-
-25-14-2 OK
-
-25-15-1 OK
-
-25-15-2 OK
-
-25-16-1 OK
-
-25-16-2 OK
-
-25-16-3 OK
-
-25-17-1 OK
-
-25-17-2 OK
-
-25-18-1 OK GS matches Tek hardcopy. Fixed by rev 7140.
- GS has more accurate (and correct) sin/cos functions than CPSI
-
-25-18-2 OK
-
-25-19-1 OK Works for me in rev. 7149.
-
-25-19-2 OK
-
-25-20-1 OK
-
-25-20-2 OK
-
-25-21-1 OK
-
-25-21-2 OK
-
-25-22-1 OK
-
-25-22-2 OK
-
-26-01-1 OK
-
-26-01-2 OK
-
-26-01-3 OK
-
-26-02-1 OK
-
-26-02-2 OK
-
-26-03-1 OK
-
-26-03-2 OK Minor differences visually reviewed by RJJ
-
-26-03-3 OK
-
-26-04-1 OK
-
-26-04-2 OK
-
-26-05-1 OK
-
-26-05-2 OK
-
-26-05-3 OK
-
-26-06-1 OK
-
-26-06-2 OK
-
-26-06-3 OK
-
-26-07-1 OK
-
-26-07-2 OK
-
-26-07-3 OK
-
-26-08-1 OK
-
-26-08-2 OK
-
-26-09-1 OK
-
-26-09-2 OK
-
-26-10-1 OK
-
-26-10-2 OK
-
-26-11-1 OK
-
-26-11-2 OK
-
-26-11-3 OK
-
-26-12-1 OK
-
-26-12-2 OK
-
-26-13-1 OK
-
-26-13-2 OK
-
-26-13-3 OK
-
-27-01-1 OK Minor differences visually reviewed by RJJ
-
-27-01-2 OK
-
-27-02-1 OK Adobe has upper cache limit of 1e8 bytes.
- Rev. 7746 does the same in CPSI compatibility mode. - Alex
-
-27-02-2 OK
-
-27-03-1 OK Fixed as of rev 7598.
-
-27-03-2 AOK test unreasonable:
- This page enumerates all the IODevices, arbitrarily selects the last one,
- and then runs the GIF test, checking whether the currentdevparams values for
- that IODevice change as a result of running the test procedures. This is
- dependent both on the set of IODevices (which is implementation-dependent,
- although gs could be expected to include at least the non-hardware-dependent
- ones documented in the PLRM3, which I believe it does) and the order in
- which they are enumerated by /IODevice resourceforall (which is totally
- implementation-dependent).
- -
- It appears that in the reference output, the last-enumerated IODevice is one
- whose devparams values change somewhat unpredictably -- probably %Calendar%.
- In the gs output, it's one whose devparams values don't change -- i.e. any
- of the others! (peter)
-
-27-04-1 DIFF Installation dependent (FontResourceDir).
- Inconforming currentsystemparams. Analyzed by Igor.
- assign: Ray for further analyzis.
-
-27-04-2 OK
-
-27-05-1 DIFF Inconforming currentuserparams. Analyzed by Igor.
- assign: Ray for further analyzis.
-
-27-05-2 OK memo36 - setvmthreshold; cash18 ucachestatus;
- assign: Ray for further analyzis.
- more15 - same as currentstrokeadjust in 09-49D-3
- peter writes:
- These CET files will not run on my 64-bit build (they expect to be able to
- 'cvs' any integer into a 12-character string), and I don't seem to be able
- to get gcc to produce 32-bit output, even with Ralph's help. Please
- reassign these files.
-
-27-06-1 OK Fixed in rev. 7157 - Alex.
-
-27-06-2 OK
-
-27-07-1 AOK Fixed by rev. 7733 - Alex
- Alternate use of --setcacheparams-- and /setcacheparams in error
- messages is an obvious bug in Adobe interpreters that we won't
- reproduce.
-
-27-07-2 OK
-
-27-08-1 OK Fix error reporting for setdevparams operator, rev. 7161. - Alex
-
-27-08-2 OK
-
-27-09-1 DIFF Same as 27-04-1. Analyzed by Igor.
- assign: Ray for further analyzis.
-
-27-09-2 DIFF Same as 27-04-1. Analyzed by Igor.
- assign: Ray for further analyzis.
-
-27-09-3 OK Minor differences visually reviewed by RJJ
-
-27-09-4 OK
-
-27-10-1 OK Minor differences visually reviewed by RJJ
-
-27-10-2 OK
-
-27-11-1 DIFF Inconforming currentuserparams. See 27-05-1. Analyzed by Igor.
- assign: Ray for further analyzis.
-
-27-11-2 OK Minor differences visually reviewed by RJJ
-
-27-11-3 OK
-
-27-12-1 DIFF ucachestatus differs. Analyzed by Igor.
- assign: Raph.
-
-27-12-2 DIFF Same as 27-05-2. Analyzed by Igor. assign: Ray..
-
-28-01-1 OK
-
-28-01-2 OK
-
-28-02-1 OK
-
-28-02-2 OK Fixed before Nov 4 2005 (after Oct 2)
-
-28-02-3 OK
-
-28-03-1 AOK The following differences remain:
- 1. names of internal operators are different
- 2. execution stack od 49 elements doesn't fit into 40-element
- arrays provided by the test causing different errors.
- Rev. 7730 - Alex
-
-28-03-2 OK
-
-28-04-1 OK
-
-28-04-2 OK
-
-28-05-1 OK
-
-28-05-2 OK Fixed by rev. 7725
-
-28-05-3 OK
-
-28-06-1 AOK Implementation Dependent: Section 6.3 - SYNTAX 2. The PLRM says the
- the order of dict enumeration by 'forall' is "arbitrary".
-
-28-06-2 OK
-
-28-06-3 OK
-
-28-07-1 OK
-
-28-07-2 OK
-
-28-07-3 OK
-
-28-08-1 OK
-
-28-08-2 OK
-
-28-09-1 OK Minor differences visually reviewed by RJJ
-
-28-09-2 OK Visually reviewed by RJJ
- (previous report of '1' in more 15 is without gs_cet.ps).
-
-28-10-1 OK Fixed by rev. 7727. - Alex
-
-28-10-2 OK Minor differences in boxed black/white 'T' 'F' glyphs, font renderer ufst.
-
-28-11-1 OK Minor differences visually reviewed by RJJ
-
-28-11-2 OK Visually reviewed by RJJ
-
-28-12-1 OK
-
-28-13-1 OK Minor differences visually reviewed by RJJ
-
-28-13-2 OK Visually reviewed by RJJ
-
-28-14-1 OK Fixed by r7115.
-
-28-14-2 OK Minor differences visually reviewed by RJJ
-
-29-02-1 OK Minor differences visually reviewed by RJJ
-
-29-02-2 OK Fixed by rev. 7716. Ghostscript matches Tek and CPSI except
- that CPSI-based PhotoPrint doesn't implement copypage and skips
- pages 3 and 4. - Alex
-
-29-02-3 OK See 29-02-2.
-
-29-02-4 OK See 29-02-2.
-
-29-02-5 OK See 29-02-2.
-
-29-02-6 OK See 29-02-2.
-
-29-02-7 OK See 29-02-2.
-
-29-02-8 OK See 29-02-2.
-
-29-03-1 DIFF Device Dependent. Too many InputAttributed. Analyzed by Igor. assign: Ray.
-
-29-03-2 DIFF Device Dependent. OutputPage not known. Analyzed by Igor. assign: Ray
-
-29-03-3 DIFF Device Dependent. currentpagedevice different. Analyzed by Igor. assign: Ray
-
-29-03-4 DIFF Many conformity tests fail. Analyzed by Igor.
- The test expects currentpagedevice to return the same dictionaty each time.
- assign: Alex.
-
-29-05-1 OK Make the spot function in the high resolution halftone readable
- to accomodate the test logic. Ghostscript matches Tek and
- Distiller 5. CPSI-based PhotoPrint product redefines halftone
- operations as no-op and cannot serve as a reference
- implementation here. - Alex
-
-29-05-2 OK
-
-29-05-3 OK
-
-29-07A-1 OK
-
-29-07A-2 OK
-
-29-07A-3 OK Device Dependent. CPSI ignores setcolortransfer to perform
- image negation. Ghostscript matches Tektronix hardcopy.
-
-29-07A-4 OK corrected with gs_cet.ps that only has 'letter' PageSize
- in InputAttributes dictionary.
-
-29-07A-5 OK corrected with gs_cet.ps that only has 'letter' PageSize
- in InputAttributes dictionary.
-
-29-07A-6 AOK Device Dependent: Error message differs. Ghostscript gives
- "configurationerror in setpagedevice", CPSI gives bogus
- "undefinedfilename in file" on this "Page 10 experiment"
-
-29-07B-1 OK Verified visually by RJJ
-
-29-07B-10 OK Verified visually by RJJ. CPSI ignores NumCopies.
- cpsi/29-07B-10 missing
-
-29-07B-11 OK Verified visually by RJJ. CPSI ignores NumCopies.
- cpsi/29-07B-11 missing
-
-29-07B-12 OK Verified visually by RJJ. CPSI ignores NumCopies.
- cpsi/29-07B-12 missing
-
-29-07B-2 DIFF GS shifts output up and left, CPSI and Tek ignore Margins [ -9 9 ]
- assign ray.
-
-29-07B-3 DIFF GS shifts output down and right, CPSI and Tek ignore Margins [ 9 -9 ]
- assign ray.
-
-29-07B-4 OK Verified visually by RJJ
-
-29-07B-5 OK Verified visually by RJJ
-
-29-07B-6 OK Verified visually by RJJ
-
-29-07B-7 OK Verified visually by RJJ. CPSI ignores NumCopies.
-
-29-07B-8 OK Verified visually by RJJ. CPSI ignores NumCopies.
-
-29-07B-9 OK Verified visually by RJJ. CPSI ignores NumCopies.
-
-29-07C-1 OK
-
-29-07C-2 DIFF Device Dependent: CPSI shows offset page. GS shows 'undefined'
- error. Tektronix shows 'configurationerror'. May be a default
- Policy setting vs. CPSI. GS should issue 'configurationerror'
- Assign: Ray.
-
-29-07C-3 AOK Device Dependent: Ghostscript matches Tektronix hardcopy and
- gives 'configurationerror'. CPSI output is offset.
-
-29-07C-4 DIFF Device Dependent: CPSI shows offset page. GS shows 'undefined'
- error. Tektronix shows 'configurationerror'. May be a default
- Policy setting vs. CPSI. GS should issue 'configurationerror'
- Assign: Ray.
-
-29-07C-5 AOK Device Dependent: Ghostscript matches Tektronix hardcopy and
- gives 'configurationerror'. CPSI output is offset.
-
-29-07C-6 DIFF Device Dependent: CPSI shows offset page. GS shows several
- parameters with value '1'. Tektronix shows only "/PageSize 1"
- Assign: Ray.
-
-29-07C-7 AOK Device Dependent: Ghostscript matches Tektronix hardcopy and
- gives 'configurationerror'. CPSI output is offset.
-
-29-07C-8 DIFF Device Dependent: CPSI shows offset page. GS offset differs.
- Tektronix hardcopy shows << /PageSize 3 >> with offset that
- might be the same as CPSI (clipping right edge after 's' of
- 'setpagedevice' in the lower right banner block).
- assign ray
-
-29-07C-9 DIFF Device Dependent: CPSI shows offset page. GS offset differs.
- Tektronix hardcopy shows << /PageSize 3 >> with offset that
- might be the same as CPSI (clipping right edge after 's' of
- 'setpagedevice' in the lower right banner block).
- assign ray
-
-29-07C-10 DIFF Device Dependent: CPSI shows offset page. GS has no offset
- Tektronix hardcopy shows << /PageSize 3 >> with offset that
- might be the same as GS (no clipping).
- assign ray
-
-29-07C-11 DIFF Device Dependent: CPSI shows offset page. GS has no offset
- Tektronix hardcopy shows << /PageSize 3 >> with offset that
- might be the same as GS (no clipping).
- assign ray
-
-29-07D-1 OK
-
-29-07D-2 OK
-
-29-07D-3 OK corrected with gs_cet.ps that only has 'letter' PageSize
- in InputAttributes dictionary.
-
-29-07D-4 OK
-
-29-07D-5 DIFF Ghostscript is producing a page when OuputPage is 'false'.
- cpsi/missing output for 'Page 5 experiment'.
- assign ray
-
-29-07D-6 DIFF Device Dependent: Ghostscript is honoring 'PageOffset'
- Adobe ignores this. correct by modifying setpagedevice.
- Assign: Ray
-
-29-07D-7 DIFF Device Dependent: Ghostscript is honoring 'PageOffset'
- Adobe ignores this. correct by modifying setpagedevice.
- Assign: Ray
-
-29-07E-1 OK
-
-29-07E-2 AOK GS rotates the image to fit the page, same as CPSI when
- rotated. PageSize Policy==7 of the PLRM says: "Positioning
- of the page image on the medium is device-dependent and
- unpredictable. This policy exists solely for use in the
- emulations of certain LanguageLevel 1 compatibility operators
- that perform media selection and page device setup separately.
- ...
- Because its behavior violates the PostScript page device model,
- documents that use this policy are not portable; for this reason,
- it should never be used directly in a page description."
-
-29-07E-3 AOK See explanation under 29-07E-2.
-
-29-07E-4 DIFF GS does not generate a configuration error. Tek does. PLRM says
- > 5 units difference should generate configurationerror with
- Policy == 7. GS rotates the page and generates a larger raster.
- Assign: Ray (Peter can thank me that I didn't give this to him).
-
-29-07E-5 DIFF Same as 29-07E-4. Assign: Ray
-
-29-07E-6 DIFF Same as 29-07E-4. Assign: Ray
-
-29-07E-7 OK
-
-29-07F-1 OK
-
-29-07F-2 OK Matches Tek hardcopy. RJJ (CPSI differs / wrong)
-
-29-07F-3 OK
-
-29-07F-4 OK
-
-29-07F-5 OK
-
-29-07F-6 OK
-
-29-07F-7 OK Matches Tek hardcopy. RJJ (CPSI differs / wrong)
-
-29-07F-8 OK Matches Tek hardcopy. RJJ (CPSI differs / wrong)
-
-29-07G-1 OK
-
-29-07G-2 OK
-
-29-07G-3 OK
-
-29-07G-4 OK
-
-29-07G-5 OK
-
-29-07G-6 OK
-
-29-07G-7 OK
-
-29-07G-8 OK
-
-29-07H-1 OK
-
-29-07H-2 OK
-
-29-07H-3 OK
-
-29-07H-4 OK
-
-29-07H-5 OK
-
-29-07H-6 OK
-
-29-07H-7 OK
-
-29-07H-8 OK
-
-29-07I-1 OK
-
-29-07I-2 OK
-
-29-07I-3 OK
-
-29-07I-4 OK
-
-29-07I-5 OK
-
-29-07I-6 OK
-
-29-07I-7 OK
-
-29-07I-8 OK
-
-29-07I-9 OK
-
-29-07J-1 OK
-
-29-07J-2 OK
-
-29-07J-3 OK
-
-29-07J-4 OK
-
-29-07J-5 OK
-
-29-07J-6 OK
-
-29-07J-7 OK
-
-29-07J-8 OK
-
-29-07J-9 OK
-
-29-07K-1 OK
-
-29-07K-2 OK
-
-29-07K-3 OK
-
-29-07K-4 OK
-
-29-07K-5 OK
-
-29-07K-6 OK
-
-29-07K-7 OK
-
-29-08-1 OK
-
-29-08-2 OK
-
-29-08-3 OK Minor differences visually reviewed by RJJ
-
-29-08-4 OK Visually reviewd by RJJ. CPSI doesn't do #copies.
- Ghostscript matches Tektronix hardcopy.
-
-29-08-5 OK Visually reviewd by RJJ. CPSI doesn't do #copies.
- Ghostscript matches Tektronix hardcopy.
-
-29-08-6 OK Visually reviewd by RJJ. CPSI doesn't do #copies.
- Ghostscript matches Tektronix hardcopy.
- cpsi/29-08-6 missing
-
-29-08-7 OK Visually reviewd by RJJ. CPSI doesn't do #copies.
- Ghostscript matches Tektronix hardcopy.
- cpsi/29-08-7 missing
-
-30-01-1 OK
-
-30-01-2 OK
-
-30-02-1 OK
-
-30-02-2 OK
-
-30-03-1 AOK These discrepancies occur because
- /show load gcheck
- returns true in gs and false in the reference output. This is an unarguable
- bug in the reference interpreters: see the documentation for gcheck in the
- PLRM3. (peter)
-
-30-03-2 OK
-
-30-04-1 OK
-
-30-04-2 OK Fixed by rev 7439.
-
-30-04-3 OK
-
-30-04-4 OK fixed in packed array colorspace fix (ray) don't recall the rev.
-
-30-04-5 OK
-
-30-05-1 OK
-
-30-05-2 OK
-
-30-06-1 AOK These discrepancies occur because
- /show load gcheck
- returns true in gs and false in the reference output. This is an unarguable
- bug in the reference interpreters: see the documentation for gcheck in the
- PLRM3. (peter)
-
-30-06-2 OK
-
-30-07-1 OK Fixed by r7642.
-
-30-07-2 DIFF /GlobalFontDirectory /Type3Font1 known gs=true, cpsi=false. assign Peter.
-
-30-07-3 DIFF gs missing '1' for gray33. Assign Peter.
-
-30-08-1 OK Fixed by r7642.
-
-30-08-2 DIFF same as 30-07-2 assign Peter.
-
-30-08-3 DIFF same as 30-07-3 assign Peter
-
-30-09-1 OK fixed in Revision 7233
-
-30-09-2 OK
-
-30-10-1 OK fixed in Revision 7233
-
-30-10-2 OK
-
-30-11-1 OK
-
-30-11-2 AOK Environment dependent.
- GS prints different numbers for every test in GLOBINT.
- The number printed is the VM usage for the test.
-
-31-01-1 DIFF Attributes differ (bottom of page filetype).
- (%stdin)(r) file is global on GS and local on Adobe.
- Also see bug 687682, where a similar problem was reported earlier.
- Assign: Ray
-
-31-01-10 OK
-
-31-01-2 OK Works for me in rev. 7453. - Alex
-
-31-01-3 OK Minor differences visually reviewed by RJJ
-
-31-01-4 OK
-
-31-01-5 OK MAX_DEPTH parameter is adjusted to match Adobe. - Alex
-
-31-01-6 OK Fixed - Alex
-
-31-01-7 OK Minor differences visually reviewed by RJJ
-
-31-01-8 DIFF Test 03 and 07 wrong.
- The test defines 2 or more idioms that match the target and expects
- the last definition to be used. PLRM (p. 121) says that the order is
- undefined. assign Alex.
-
-31-01-9 DIFF same as 31-01-8 but in the global VM. assign Alex.
-
-31-02-1 OK Fixed in rev. 7473 - Alex
-
-31-02-2 OK
-
-31-03-1 OK Fixed in rev 7474. - Alex
-
-31-03-2 OK
-
-31-04-1 OK Minor differences in positions and character shapes - ADC
-
-31-04-2 OK Minor differences in positions and character shapes - ADC
-
-31-05-1 OK
-
-31-05-2 OK
-
-31-06-1 OK Fixed by gs_cet.ps
-
-31-06-2 OK Minor differences in positions and character shapes - ADC
-
-31-07-1 OK Minor differences visually reviewed by Igor.
- Note: This test draws different length line depending on timing
- (number of loops depends on 'realtime' resolution and results).
-
-31-07-2 OK
-
-31-08-1 OK Fixed by gs_cet.ps rev. 7180 (Device Dependent).
- Note: CPSI shows revision 0, Tek shows revision 5.
-
-31-08-2 OK
-
-31-09-1 OK Fixed by gs_cet.ps rev. 7180 (Device Dependent).
- Note: CPSI shows serialnumber 233460, Tek shows 1401788461
-
-31-09-2 OK
-
-31-10-1 OK Minor differences in positions and character shapes - ADC
-
-31-10-2 OK Fixed in rev. 7749. - Alex
-
-31-10-3 OK
-
-31-11-1 OK Fixed in rev 7474. - Alex
-
-31-11-2 OK
-
-31-12-1 OK Minor differences visually reviewed by RJJ
- Note: This test draws different length line depending on timing
- (number of loops depends on 'realtime' resolution and results).
-
-31-12-2 OK
-
-31-13-1 OK
-
-31-13-2 OK Fixed as of rev 7583.
-
-32_all-1 AOK CPSI inserts CDevProc while /CIDFont defineresource.
- That is not required by PLRM3.
- Inserting a CDevProc is unnecessary and would impackt performance.
-
-32_all-10 OK
-
-32_all-11 OK
-
-32_all-12 OK
-
-32_all-13 OK
-
-32_all-14 OK Fixed as of rev 7583.
-
-32_all-15 AOK Same as 34_all-6
-
-32_all-16 OK
-
-32_all-2 OK Fixed in rev. 7478. findfont, definefont, undefinefont also
- handle /CIDFont resource instances now. - Alex
-
-32_all-3 OK
-
-32_all-4 OK
-
-32_all-5 OK
-
-32_all-6 OK
-
-32_all-7 OK
-
-32_all-8 OK
-
-32_all-9 OK
-
-33_all-1 OK Fixed as of rev 7583.
-
-33_all-2 OK Fixed as of rev 7583.
-
-33_all-3 OK Minor differences visually reviewed by RJJ
-
-33_all-4 OK
-
-33_all-5 OK
-
-33_all-6 OK Fixed as of rev 7583.
-
-33_all-7 AOK CMAP names differ implementation dependent analyzed by Ray.
-
-33_all-8 OK Minor differences visually reviewed by RJJ
-
-34_all-1 OK Fixed as of rev 7583.
-
-34_all-2 OK Fixed as of rev 7583.
-
-34_all-3 OK Fixed as of rev 7583.
-
-34_all-4 DIFF Improved by rev 7583, but still has mismatch for glyph 222.
- Assign: Ray
-
-34_all-5 OK Fixed as of rev 7583.
-
-34_all-6 AOK GS has more CMap resources. Not important. Analyzed by Igor.
-
-34_all-7 OK Fixed as of rev 7583.
-
-35_all-1 DIFF Even as of rev 7583, CID Font has /CharStrings array. Tek
- and CPSI do not have this key. Tek has CDevProc that CPSI does
- not. Assign: Ray
-
-35_all-10 OK
-
-35_all-11 DIFF GS paints glyphs when CPSI and Tek paint hollow boxes. It appears that
- GS is not removing glyphs from previous page "currentfont removeall".
- Assign: Ray
-
-35_all-12 OK Fixed by rev. 7710 - Alex.
-
-35_all-2 OK Fixed as of rev 7583.
-
-35_all-3 OK Minor differences visually reviewed by RJJ
-
-35_all-4 OK
-
-35_all-5 OK
-
-35_all-6 OK Fixed as of rev 7711 (detected during regression testing. RJJ)
-
-35_all-7 AOK Same as 33_all-7. Analyzed by Igor.
-
-35_all-8 OK Minor differences visually reviewed by RJJ
-
-35_all-9 OK Minor differences visually reviewed by RJJ
-
-36-01-1 OK
-
-37-01-1 OK
-
-38-01-1 DIFF CPSI has more fonts, particularly more Type 42 fonts.
- Analyzed by Igor.
- This test prints some data about installed Type 42 fonts :
- Chicago, Geneva, HoeflerText-Black, HoeflerText-BlackItalic, HoeflerText-Italic.
- Neither URW nor UFST PCLPS2 provide them.
- UFST PCLPS3 does provide.
- Passing to Ray to decide what to do with it.
- Assign: Ray.
-
-38-01-2 OK
-
-99-01-1 AOK Implementation Dependent: Different default system parameters can be set
- if customer desires.
- Environment dependent (GenericResourceDir).
-
-99-01-2 AOK Implementation Dependent: Different default device parameters can be set
- if customer desires.
- Environment dependent (OutputFile).
-
-99-01-3 OK
-
-99-02-1 OK GS OK visually reviewed by RJJ
- cpsi/99-02-1 missing
- Environment dependent (GenericResourceDir).
-
-99-03-1 OK
-
diff --git a/doc/sample_downscale_device.htm b/doc/sample_downscale_device.htm
deleted file mode 100644
index eb28b9b5..00000000
--- a/doc/sample_downscale_device.htm
+++ /dev/null
@@ -1,235 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Ghostscript: Sample CMYK 32-bit Device that Supports Post Rendering Processing</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Ghostscript: Sample CMYK 32-bit Device that Supports Post Rendering Processing</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Description">Description</a>
- <li><a href="#Features">Features</a>
- <li><a href="#devs_mak">Changes to devices/devs.mak</a>
- <li><a href="#Building">Building Ghostscript with the driver</a>
- <li><a href="#Source">Source code</a>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.3 begin hint] ====================================================== -->
-
-<p>For other information, see the <a href="Drivers.htm">Ghostscript
-device drivers</a> and the documentation on <a href="Make.htm">how to build
-Ghostscript</a>.
-
-<!-- [1.3 end hint] ======================================================== -->
-
-<hr>
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-
-<h2><a name="Description"></a>Description</h2>
-
-<p>
-This device is a basic CMYK 32-bit (8-bits per component) device that uses the <code>downscaler</code>
-features to provide post-rendering operations on the raster data produced by Ghostscript.
-<p>
-It is designed to allow a developer to add code to handle the resulting raster data
-and perform any desired formatting and transmission to some destination, for example
-DMA to a printer or sending over a network link.
-<p>
-<hr>
-
-<h2><a name="Features"></a>Features</h2>
-
-<p>
-The <code>downscaler</code> modules provide for the following optional post-rendering
-manipulation:
-
-<blockquote><dl>
-<dt><code>-dDownScaleFactor=<em>factor</em></code> (small non-negative integer; default = 1)
-<dd>If this option set then the page is downscaled by the given factor on both
-axes. For example rendering with <tt>-r600</tt> and then specifying <tt>-dDownScaleFactor=3</tt> will produce
-a 200dpi image.
-<p>
-2 additional &quot;special&quot; ratios are available, 32 and 34. 32 provides a 3:2 downscale
-(so from 300 to 200 dpi, if the resolution is 300 dpi as with <code>-r300</code>). 34 produces a 3:4 upscale (so from 300 to 400 dpi, similarly).
-</dl></blockquote>
-
-<blockquote><dl>
-<dt><code>-sPostRenderProfile=<em>path</em></code> (path to an ICC profile)
-<dd>If this option set then the page will be color transformed using that
-profile <b>after</b> downscaling.
-<p>
-This is useful when the file uses overprint to separately paint to some
-subset of the C, M, Y, and K colorants, but the final CMYK is to be color
-corrected for printing or display.
-</dl></blockquote>
-
-<p>The <code>ds32</code> device can perform rudimentary automatic bitmap
-'trapping' on the final rendered bitmap. This code is disabled by default; see
-the <a href="#trapping_patent_note">note</a> below as to why.
-
-<p>Trapping is a process whereby the output is adjusted to minimise the
-visual impact of offsets between each printed plane. Typically this involves
-slightly extending abutting regions that are rendered in different inks. The
-intent of this is to avoid the unsightly gaps that might be otherwise be
-revealed in the final printout if the different color plates do not exactly
-line up.
-
-<p>This trapping is controlled by 3 device parameters. Firstly the maximum
-X and Y offsets are specified using:
-<blockquote><dl>
-<dt><code>-dTrapX=N</code>
-<dd>and
-<dt> <code>-dTrapY=N</code>
-<dd>(where <code>N</code> is a figure in pixels, <b>before</b> the downscaler is applied).
-</dl></blockquote>
-
-<p>The final control is to inform the trapping process in what order inks
-should be processed, from darkest to lightest. For a typical CMYK device
-this order would be [ 3 1 0 2 ] (K darker than M darker than C darker than Y).
-This is the default.
-
-<p>To override these defaults, the <code>TrapOrder</code> parameter can be used. Since
-this parameter requires an array, it must be specified using a different method. For
-example, if Cyan is darker than Magenta:
-
-<blockquote><code>
- gs -sDEVICE=ds32 -dTrapX=2 -dTrapY=2 -c "&lt;&lt; /TrapOrder [ 3 0 1 2 ] &gt;&gt; setpagedevice" -f examples\colorcir.ps
-</code></blockquote>
-
-<h4><a name="trapping_patent_note"></a>Trapping patents</h4>
-
-<p>Trapping is an technology area encumbered by many patents. Until
-we can convince ourselves that our trapping code is not covered by
-any of these patents, the functionality is disabled by default.</p>
-
-<p>It can be enabled by building with the <tt>ENABLE_TRAPPING</tt>
-define, but before you do so you should convince yourself that
-either:</p>
-
-<ul>
-<li>The trapping code is not covered by any existing patent.
-<li>Any patents that do cover the code are invalid in your
-jurisdiction.
-<li>That you have appropriate patent licenses for any patents
- that do apply.
-</ul>
-
-<p>You bear full responsibility for choosing to build with
-<tt>ENABLE_TRAPPING</tt>.
-
-<p>
-
-<p>
-<hr>
-
-<h2><a name="devs_mak"></a>Changes to devices/devs.mak</h2>
-
-<p>
-The make files used to build Ghostscript use the file devices/devs.mak to
-describe what is needed for devices that can be built into the executable,
-such as source code files, header files, libraries and dependencies on
-other parts of Ghostscript.
-<p>
-The section below can be added to the end of the devices/devs.mak file:
-
-<blockquote>
-<pre>
-### -------- Example 32-bit CMYK downscaled device --------------------- ###
-# NB: downscale_ is standard in the lib (LIB1s)
-&#36;(DD)ds32.dev : &#36;(DEVOBJ)gdevds32.&#36;(OBJ) &#36;(GLD)page.dev \
- &#36;(GDEV) &#36;(DEVS_MAK) &#36;(MAKEDIRS)
- &#36;(SETPDEV2) &#36;(DD)ds32 &#36;(DEVOBJ)gdevds32.&#36;(OBJ)
- &#36;(ADDMOD) &#36;(DD)ds32 -include &#36;(GLD)page
-
-&#36;(DEVOBJ)gdevds32.&#36;(OBJ) : &#36;(DEVSRC)gdevds32.c &#36;(gsicc_cache_h) &#36;(gxdownscale_h) &#36;(AK) \
- &#36;(arch_h) &#36;(gdevprn_h) &#36;(stdio__h) &#36;(stdint__h) &#36;(DEVS_MAK) &#36;(MAKEDIRS)
- &#36;(DEVCC) &#36;(DEVO_)gdevds32.&#36;(OBJ) &#36;(C_) &#36;(DEVSRC)gdevds32.c
-</blockquote>
-
-This snippet is also in a commented block at the top of the source code file.
-<p>
-<hr>
-
-<h2><a name="Building"></a>Building Ghostscript with the driver</h2>
-
-<p>
-The make system also needs to be told to include the <code>ds32</code> device. This can
-either be added to the top level make file on one of the <code>DEVICE_DEVS</code> lines,
-for example, in <code>psi/msvc.mak</code> for the Windows build:
-<blockquote>
-<pre>
-DEVICE_DEVS21=$(DD)ds32.dev $(DD)spotcmyk.dev $(DD)devicen.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16m.dev $(DD)bmp32b.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev $(DD)cp50.dev $(DD)gprf.dev
-</blockquote>
-
-Rather than editing a make file, there is a convenient macro that allows the extra device
-to be added to the build command line, <code>DEVICE_DEVS_EXTRA</code>. For example, on
-linux:
-<blockquote>
-<pre>
-make DEVICE_DEVS_EXTRA=obj/ds32.dev
-</blockquote>
-or, on Windows:
-<blockquote>
-<pre>
-nmake -f psi/msvc32.mak DEVICE_DEVS_EXTRA=obj\ds32.dev
-</blockquote>
-<hr>
-
-<h2><a name="Source"></a>Source code</h2>
-
-<p>
-The source for this device driver is in: <a href="gdevds32.c">doc/gdevds32.c</a>
-
-<p>
-<hr>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-
-<p>
- <small>Copyright &copy; 2016-2022 Artifex Software, Inc. All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/site.js b/doc/site.js
deleted file mode 100644
index e805969f..00000000
--- a/doc/site.js
+++ /dev/null
@@ -1,14 +0,0 @@
-switch(window.location.protocol) {
- case 'http:':
- case 'https:':
- // remote file
- document.getElementById("searchSite").style.display = "block";
- break;
- case 'file:':
- // local file
- document.getElementById("searchSite").style.display = "none";
- break;
- default:
-
- break;
-}
diff --git a/doc/src/API.rst b/doc/src/API.rst
new file mode 100644
index 00000000..d52338f5
--- /dev/null
+++ b/doc/src/API.rst
@@ -0,0 +1,1387 @@
+.. title:: API
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+
+.. _API.htm:
+
+
+API
+=================================
+
+
+
+
+
+
+What is the Ghostscript Interpreter API?
+------------------------------------------
+
+
+The Ghostscript interpreter can be built as a dynamic link library (DLL) on Microsoft Windows, as a shared object on the Linux, Unix and MacOS X platforms. With some changes, it could be built as a static library. This document describes the Application Programming Interface (API) for the Ghostscript interpreter library. This should not be confused with the :ref:`Ghostscript library<Lib.htm>` which provides a graphics library but not the interpreter.
+
+This supercedes the old DLL interface.
+
+To provide the interface described in the :ref:`usage documentation<Use.htm>`, a smaller independent executable loads the DLL/shared object. This executable must provide all the interaction with the windowing system, including image windows and, if necessary, a text window.
+
+The Ghostscript interpreter library's name and characteristics differ for each platform:
+
+- The Win32 DLL ``gsdll32.dll`` can be used by multiple programs simultaneously, but only once within each process.
+- The OS/2 DLL ``gsdll2.dll`` has MULTIPLE NONSHARED data segments and can be called by multiple programs simultaneously.
+- The Linux shared object ``libgs.so`` can be used by multiple programs simultaneously.
+
+The source for the executable is in ``dw*.*`` (Windows), ``dp*.*`` (OS/2) and ``dx*.*`` (Linux/Unix). See these source files for examples of how to use the DLL.
+
+The source file dxmainc.c can also serve as an example of how to use the shared library component on MacOS X, providing the same command-line tool it does on any linux, bsd or similar operating system.
+
+At this stage, Ghostscript does not support multiple instances of the interpreter within a single process.
+
+
+.. _API.htm exported functions:
+.. _gsapi_asterisk:
+
+Exported functions
+------------------------------------------
+
+The functions exported by the DLL/shared object are described in the header file ``iapi.h`` and are summarised below. Omitted from the summary are the calling convention (e.g. ``__stdcall``), details of return values and error handling.
+
+
+.. role:: c(code)
+ :language: c
+
+
+- :c:`int gsapi_revision (gsapi_revision_t *pr, int len);` :ref:`details<gsapi_revision>`
+- :c:`int gsapi_new_instance (void **pinstance, void *caller_handle);` :ref:`details<gsapi_new_instance>`
+- :c:`void gsapi_delete_instance (void *instance);` :ref:`details<gsapi_delete_instance>`
+- :c:`int gsapi_set_stdio_with_handle (void *instance, int(*stdin_fn)(void *caller_handle, char *buf, int len), int(*stdout_fn)(void *caller_handle, const char *str, int len), int(*stderr_fn)(void *caller_handle, const char *str, int len), void *caller_handle);` :ref:`details<gsapi_set_stdio_with_handle>`
+- :c:`int gsapi_set_stdio (void *instance, int(*stdin_fn)(void *caller_handle, char *buf, int len), int(*stdout_fn)(void *caller_handle, const char *str, int len), int(*stderr_fn)(void *caller_handle, const char *str, int len));` :ref:`details<gsapi_set_stdio>`
+- :c:`int gsapi_set_poll_with_handle (void *instance, int(*poll_fn)(void *caller_handle), void *caller_handle);` :ref:`details<gsapi_set_poll_with_handle>`
+- :c:`int gsapi_set_poll (void *instance, int(*poll_fn)(void *caller_handle));` :ref:`details<gsapi_set_poll>`
+- :c:`int gsapi_set_display_callback (void *instance, display_callback *callback);` :ref:`details<gsapi_set_display_callback>`
+- :c:`int gsapi_register_callout (void *instance, gs_callout callout, void *callout_handle);` :ref:`details<gsapi_register_callout>`
+- :c:`void gsapi_deregister_callout (void *instance, gs_callout callout, void *callout_handle);` :ref:`details<gsapi_deregister_callout>`
+- :c:`int gsapi_set_arg_encoding (void *instance, int encoding);` :ref:`details<gsapi_set_arg_encoding>`
+- :c:`int gsapi_get_default_device_list(void *instance, char **list, int *listlen);` :ref:`details<gsapi_get_default_device_list>`
+- :c:`int gsapi_set_default_device_list(void *instance, const char *list, int listlen);` :ref:`details<gsapi_set_default_device_list>`
+- :c:`int gsapi_run_string_begin (void *instance, int user_errors, int *pexit_code);` :ref:`details<gsapi_run_asterisk>`
+- :c:`int gsapi_run_string_continue (void *instance, const char *str, unsigned int length, int user_errors, int *pexit_code);` :ref:`details<gsapi_run_asterisk>`
+- :c:`int gsapi_run_string_end (void *instance, int user_errors, int *pexit_code);` :ref:`details<gsapi_run_asterisk>`
+- :c:`int gsapi_run_string_with_length (void *instance, const char *str, unsigned int length, int user_errors, int *pexit_code);` :ref:`details<gsapi_run_asterisk>`
+- :c:`int gsapi_run_string (void *instance, const char *str, int user_errors, int *pexit_code);` :ref:`details<gsapi_run_asterisk>`
+- :c:`int gsapi_run_file (void *instance, const char *file_name, int user_errors, int *pexit_code);` :ref:`details<gsapi_run_asterisk>`
+- :c:`int gsapi_init_with_args (void *instance, int argc, char **argv);` :ref:`details<gsapi_init_with_args>`
+- :c:`int gsapi_exit (void *instance);` :ref:`details<gsapi_exit>`
+- :c:`int gsapi_set_param(void *instance, const char *param, const void *value, gs_set_param_type type);` :ref:`details<gsapi_set_param>`
+- :c:`int gsapi_get_param(void *instance, const char *param, void *value, gs_set_param_type type);` :ref:`details<gsapi_get_param>`
+- :c:`int gsapi_enumerate_params(void *instance, void **iter, const char **key, gs_set_param_type *type);` :ref:`details<gsapi_enumerate_params>`
+- :c:`int gsapi_add_control_path(void *instance, int type, const char *path);` :ref:`details<gsapi_add_control_path>`
+- :c:`int gsapi_remove_control_path(void *instance, int type, const char *path);` :ref:`details<gsapi_remove_control_path>`
+- :c:`void gsapi_purge_control_paths(void *instance, int type);` :ref:`details<gsapi_purge_control_paths>`
+- :c:`void gsapi_activate_path_control(void *instance, int enable);` :ref:`details<gsapi_activate_path_control>`
+- :c:`int gsapi_is_path_control_active(void *instance);` :ref:`details<gsapi_is_path_control_active>`
+- :c:`int gsapi_add_fs (void *instance, gsapi_fs_t *fs, void *secret);` :ref:`details<gsapi_add_fs>`
+- :c:`void gsapi_remove_fs (void *instance, gsapi_fs_t *fs, void *secret);` :ref:`details<gsapi_remove_fs>`
+
+
+
+
+.. _API.htm gsapi_revision:
+.. _gsapi_revision:
+
+
+gsapi_revision()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This function returns the revision numbers and strings of the Ghostscript interpreter library; you should call it before any other interpreter library functions to make sure that the correct version of the Ghostscript interpreter has been loaded.
+
+
+.. code-block:: c
+
+ typedef struct gsapi_revision_s {
+ const char *product;
+ const char *copyright;
+ long revision;
+ long revisiondate;
+ } gsapi_revision_t;
+ gsapi_revision_t r;
+
+ if (gsapi_revision(&r, sizeof(r)) == 0) {
+ if (r.revision < 650)
+ printf("Need at least Ghostscript 6.50");
+ }
+ else {
+ printf("revision structure size is incorrect");
+ }
+
+
+.. _API.htm gsapi_new_instance:
+.. _gsapi_new_instance:
+
+gsapi_new_instance()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Create a new instance of Ghostscript. This instance is passed to most other gsapi functions. The caller_handle is the default value that will be provided to callback functions. On some platforms (those that do not support threading), only one instance of Ghostscript is supported at a time; any attempt to create more than one at a time would result in ``gsapi_new_instance`` returning an error.
+
+While the core Ghostscript devices are believed to be thread safe now, a handful of devices are known not to be (at least the :title:`x11` devices, :title:`uniprint`, and the open printing devices). A new mechanism has been implemented that allows devices to check for concurrent use and to refuse to start up. The devices shipped with Ghostscript known to use global variables have had these calls added to them. Any authors of non-standard Ghostscript devices that use global variables should consider adding the same calls to their own code.
+
+The first parameter, is a pointer to an opaque pointer (``void **``). The opaque pointer (``void *``) must be initialised to NULL before the call to ``gsapi_new_instance()``. See `Example 1`_.
+
+.. _API.htm gsapi_delete_instance:
+.. _gsapi_delete_instance:
+
+gsapi_delete_instance()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Destroy an instance of Ghostscript. Before you call this, Ghostscript must have finished. If Ghostscript has been initialised, you must call ``gsapi_exit`` before ``gsapi_delete_instance``.
+
+.. _API.htm gsapi_set_stdio_with_handle:
+.. _gsapi_set_stdio_with_handle:
+
+gsapi_set_stdio_with_handle()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback functions for stdio, together with the handle to use in the callback functions. The stdin callback function should return the number of characters read, 0 for EOF, or -1 for error. The stdout and stderr callback functions should return the number of characters written.
+
+NOTE: These callbacks do not affect output device I/O when using "%stdout" as the output file. In that case, device output will still be directed to the process "stdout" file descriptor, not to the stdio callback.
+
+.. _API.htm gsapi_set_stdio:
+.. _gsapi_set_stdio:
+
+gsapi_set_stdio()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback functions for stdio. The handle used in the callbacks will be taken from the value passed to `gsapi_new_instance`_. Otherwise the behaviour of this function matches `gsapi_set_stdio_with_handle`_.
+
+
+.. _API.htm gsapi_set_poll_with_handle:
+.. _gsapi_set_poll_with_handle:
+
+gsapi_set_poll_with_handle()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback function for polling, together with the handle to pass to the callback function. This function will only be called if the Ghostscript interpreter was compiled with CHECK_INTERRUPTS as described in gpcheck.h.
+
+The polling function should return zero if all is well, and return negative if it wants Ghostscript to abort. This is often used for checking for a user cancel. This can also be used for handling window events or cooperative multitasking.
+
+The polling function is called very frequently during interpretation and rendering so it must be fast. If the function is slow, then using a counter to return 0 immediately some number of times can be used to reduce the performance impact.
+
+
+.. _API.htm gsapi_set_poll:
+.. _gsapi_set_poll:
+
+gsapi_set_poll()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback function for polling. The handle passed to the callback function will be taken from the handle passed to `gsapi_new_instance`_. Otherwise the behaviour of this function matches `gsapi_set_poll_with_handle`_.
+
+
+.. _API.htm gsapi_set_display_callback:
+.. _gsapi_set_display_callback:
+
+gsapi_set_display_callback()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+This call is deprecated; please use `gsapi_register_callout`_ to register a `callout`_ handler for the `display`_ device in preference. Set the callback structure for the display device. The handle passed in the callback functions is taken from the ``DisplayHandle`` parameter (or ``NULL`` if there is no such parameter). If the `display`_ device is used, this must be called after ``gsapi_new_instance()`` and before ``gsapi_init_with_args()``. See ``gdevdsp.h`` for more details.
+
+
+.. _API.htm gsapi_register_callout:
+.. _gsapi_register_callout:
+
+gsapi_register_callout()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This call registers a `callout`_ handler.
+
+
+
+.. _API.htm gsapi_deregister_callout:
+.. _gsapi_deregister_callout:
+
+gsapi_deregister_callout()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This call deregisters a `callout`_ handler previously registered with `gsapi_register_callout`_. All three arguments must match exactly for the callout handler to be deregistered.
+
+
+.. _API.htm gsapi_set_arg_encoding:
+.. _gsapi_set_arg_encoding:
+
+gsapi_set_arg_encoding()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the encoding used for the interpretation of all subsequent args supplied via the gsapi interface on this instance. By default we expect args to be in encoding 0 (the 'local' encoding for this OS). On Windows this means "the currently selected codepage". On Linux this typically means utf8. This means that omitting to call this function will leave Ghostscript running exactly as it always has. Please note that use of the 'local' encoding is now deprecated and should be avoided in new code. This must be called after ``gsapi_new_instance()`` and before ``gsapi_init_with_args()``.
+
+
+.. _API.htm gsapi_set_default_device_list:
+.. _gsapi_set_default_device_list:
+
+gsapi_set_default_device_list()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the string containing the list of default device names, for example "display x11alpha x11 bbox". Allows the calling application to influence which device(s) gs will try, in order, in it's selection of the default device. This must be called after ``gsapi_new_instance()`` and before ``gsapi_init_with_args()``.
+
+
+.. _API.htm gsapi_get_default_device_list:
+.. _gsapi_get_default_device_list:
+
+
+gsapi_get_default_device_list()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Returns a pointer to the current default device string. This must be called after ``gsapi_new_instance()`` and before ``gsapi_init_with_args()``.
+
+.. _API.htm gsapi_init_with_args:
+.. _gsapi_init_with_args:
+
+
+gsapi_init_with_args()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Initialise the interpreter. This calls ``gs_main_init_with_args()`` in ``imainarg.c`` . See below for `return codes`_. The arguments are the same as the "C" main function: ``argv[0]`` is ignored and the user supplied arguments are ``argv[1]`` to ``argv[argc-1]``.
+
+
+.. _API.htm gsapi_run_asterisk:
+.. _gsapi_run_asterisk:
+
+
+gsapi_run_*()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``gsapi_run_*`` functions are like ``gs_main_run_*`` except that the error_object is omitted. If these functions return <= -100, either quit or a fatal error has occured. You must call ``gsapi_exit()`` next. The only exception is ``gsapi_run_string_continue()`` which will return ``gs_error_NeedInput`` if all is well. See below for `return codes`_.
+
+The address passed in ``pexit_code`` will be used to return the exit code for the interpreter in case of a quit or fatal error. The ``user_errors`` argument is normally set to zero to indicate that errors should be handled through the normal mechanisms within the interpreted code. If set to a negative value, the functions will return an error code directly to the caller, bypassing the interpreted language. The interpreted language's error handler is bypassed, regardless of ``user_errors`` parameter, for the ``gs_error_interrupt`` generated when the polling callback returns a negative value. A positive ``user_errors`` is treated the same as zero.
+
+There is a 64 KB length limit on any buffer submitted to a ``gsapi_run_*`` function for processing. If you have more than 65535 bytes of input then you must split it into smaller pieces and submit each in a separate ``gsapi_run_string_continue()`` call.
+
+
+.. _API.htm gsapi_exit:
+.. _gsapi_exit:
+
+
+gsapi_exit()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Exit the interpreter. This must be called on shutdown if ``gsapi_init_with_args()`` has been called, and just before ``gsapi_delete_instance()``.
+
+
+.. _API.htm gsapi_set_param:
+.. _gsapi_set_param:
+
+
+gsapi_set_param()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set a parameter. Broadly, this is equivalent to setting a parameter using ``-d``, ``-s`` or ``-p`` on the command line. This call cannot be made during a ``run_string`` operation.
+Parameters in this context are not the same as 'arguments' as processed by ``gsapi_init_with_args``, but often the same thing can be achieved. For example, with ``gsapi_init_with_args``, we can pass "-r200" to change the resolution. Broadly the same thing can be achieved by using ``gsapi_set_param`` to set a parsed value of "<</HWResolution [ 200.0 200.0 ]>>".
+
+Note, that internally, when we set a parameter, we perform an ``initgraphics`` operation. This means that using ``set_param`` other than at the start of a page is likely to give unexpected results.
+
+Further, note that attempting to set a parameter that the device does not recognise will be silently ignored, and that parameter will not be found in subsequent ``gsapi_get_param`` calls.
+
+The ``type`` argument dictates the kind of object that ``value`` points to:
+
+
+.. code-block:: c
+
+ typedef enum {
+ gs_spt_invalid = -1,
+ gs_spt_null = 0, /* void * is NULL */
+ gs_spt_bool = 1, /* void * is a pointer to an int (0 false,
+ * non-zero true). */
+ gs_spt_int = 2, /* void * is a pointer to an int */
+ gs_spt_float = 3, /* void * is a float * */
+ gs_spt_name = 4, /* void * is a char * */
+ gs_spt_string = 5, /* void * is a char * */
+ gs_spt_long = 6, /* void * is a long * */
+ gs_spt_i64 = 7, /* void * is an int64_t * */
+ gs_spt_size_t = 8, /* void * is a size_t * */
+ gs_spt_parsed = 9, /* void * is a pointer to a char * to be parsed */
+
+ /* Setting a typed param causes it to be instantly fed to to the
+ * device. This can cause the device to reinitialise itself. Hence,
+ * setting a sequence of typed params can cause the device to reset
+ * itself several times. Accordingly, if you OR the type with
+ * gs_spt_more_to_come, the param will held ready to be passed into
+ * the device, and will only actually be sent when the next typed
+ * param is set without this flag (or on device init). Not valid
+ * for get_typed_param. */
+ gs_spt_more_to_come = 1<<31
+ } gs_set_param_type;
+
+
+Combining a type value by ORRing it with the ``gs_spt_more_to_come`` flag will cause the set_param operation to be queued internally, but not actually be sent to the device. Thus a series of ``set_param`` operations can be queued, for example as below:
+
+
+.. code-block:: c
+
+ int code = gsapi_set_param(instance,
+ "HWResolution",
+ "[300 300]",
+ gs_spt_parsed | gs_spt_more_to_come);
+ if (code >= 0) {
+ int i = 1;
+ code = gsapi_set_param(instance,
+ "FirstPage",
+ &i,
+ gs_spt_int | gs_spt_more_to_come);
+ }
+ if (code >= 0) {
+ int i = 3;
+ code = gsapi_set_param(instance,
+ "DownScaleFactor",
+ &i,
+ gs_spt_int);
+ }
+
+
+This enables a series of set operations to be performed 'atomically'. This can be useful for performance, in that any reconfigurations to the device (such as page size changes or memory reallocations) will only happen when all the parameters are sent, rather than potentially each time each one is sent.
+
+
+.. _API.htm gsapi_get_param:
+.. _API_gsapi_get_param:
+.. _gsapi_get_param:
+
+
+gsapi_get_param()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Get a parameter. Retrieve the current value of a parameter.
+
+If an error occurs, the return value is negative. Otherwise the return value is the number of bytes required for storage of the value. Call once with ``value = NULL`` to get the number of bytes required, then call again with ``value`` pointing to at least the required number of bytes where the value will be copied out. Note that the caller is required to know the type of value in order to get it. For all types other than ``string``, ``name``, and ``parsed`` knowing the type means you already know the size required.
+
+This call retrieves parameters/values that have made it to the device. Thus, any values set using the ``gs_spt_more_to_come`` without a following call without that flag will not be retrieved. Similarly, attempting to get a parameter before ``gsapi_init_with_args`` has been called will not list any, even if ``gsapi_set_param`` has been used.
+
+Attempting to read a parameter that is not set will return ``gs_error_undefined (-21)``. Note that calling ``gsapi_set_param`` followed by ``gsapi_get_param`` may not find the value, if the device did not recognise the key as being one of its configuration keys.
+
+
+.. _API.htm gsapi_enumerate_params:
+.. _gsapi_enumerate_params:
+
+
+gsapi_enumerate_params()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enumerate the current parameters. Call repeatedly to list out the current parameters.
+
+The first call should have ``*iter = NULL``. Subsequent calls should pass the same pointer in so the iterator can be updated. Negative return codes indicate error, 0 success, and 1 indicates that there are no more keys to read. On success, key will be updated to point to a null terminated string with the key name that is guaranteed to be valid until the next call to ``gsapi_enumerate_params``. If ``type`` is non ``NULL`` then ``*type`` will be updated to have the type of the parameter.
+
+Note that only one enumeration can happen at a time. Starting a second enumeration will reset the first.
+
+The enumeration only returns parameters/values that have made it to the device. Thus, any values set using the ``gs_spt_more_to_come`` without a following call without that flag will not be retrieved. Similarly, attempting to enumerate parameters before ``gsapi_init_with_args`` has been called will not list any, even if ``gsapi_set_param`` has been used.
+
+
+.. _API.htm gsapi_add_control_path:
+.. _gsapi_add_control_path:
+
+gsapi_add_control_path()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add a (case sensitive) path to one of the lists of permitted paths for file access. See :ref:`dSAFER<Use Safer>` for more information about permitted paths.
+
+.. _API.htm gsapi_remove_control_path:
+.. _gsapi_remove_control_path:
+
+gsapi_remove_control_path()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Remove a (case sensitive) path from one of the lists of permitted paths for file access. See :ref:`dSAFER<Use Safer>` for more information about permitted paths.
+
+
+.. _API.htm gsapi_purge_control_paths:
+.. _gsapi_purge_control_paths:
+
+gsapi_purge_control_paths()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Clear all the paths from one of the lists of permitted paths for file access. See :ref:`dSAFER<Use Safer>` for more information about permitted paths.
+
+
+.. _API.htm gsapi_activate_path_control:
+.. _gsapi_activate_path_control:
+
+gsapi_activate_path_control()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Enable/Disable path control (i.e. whether paths are checked against permitted paths before access is granted). See :ref:`dSAFER<Use Safer>` for more information about permitted paths.
+
+
+.. _API.htm gsapi_is_path_control_active:
+.. _gsapi_is_path_control_active:
+
+gsapi_is_path_control_active()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Query whether path control is activated or not. See :ref:`dSAFER<Use Safer>` for more information about permitted paths.
+
+
+.. _API.htm gsapi_add_fs:
+
+gsapi_add_fs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Adds a new 'Filing System' to the interpreter. This enables callers to implement their own filing systems. The system starts with just the conventional 'file' handlers installed, to allow access to the local filing system. Whenever files are to be opened from the interpreter, the file paths are offered around each registered filing system in turn (from most recently registered to oldest), until either an error is given, or the file is opened successfully.
+
+Details of the ``gsapi_fs_t`` are given :ref:`below <gsapi_fs_t>`.
+
+
+.. _API.htm gsapi_remove_fs:
+
+gsapi_remove_fs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Remove a previously registered 'Filing System' from the interpreter. Both the function pointers within the ``gs_fs_t`` and the secret value must match exactly.
+
+
+
+.. _API.htm gsapi_fs_t:
+
+gsapi_fs_t
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Each 'filing system' within ``gs`` is a structure of function pointers; each function pointer gives a handler from taking a different named resource (a file, a pipe, a printer, a scratch file etc) and attempts to open it.
+
+
+.. code-block:: c
+
+ typedef struct
+ {
+ int (*open_file)(const gs_memory_t *mem,
+ void *secret,
+ const char *fname,
+ const char *mode,
+ gp_file **file);
+ int (*open_pipe)(const gs_memory_t *mem,
+ void *secret,
+ const char *fname,
+ char *rfname, /* 4096 bytes */
+ const char *mode,
+ gp_file **file);
+ int (*open_scratch)(const gs_memory_t *mem,
+ void *secret,
+ const char *prefix,
+ char *rfname, /* 4096 bytes */
+ const char *mode,
+ int rm,
+ gp_file **file);
+ int (*open_printer)(const gs_memory_t *mem,
+ void *secret,
+ char *fname, /* 4096 bytes */
+ int binary,
+ gp_file **file);
+ int (*open_handle)(const gs_memory_t *mem,
+ void *secret,
+ char *fname, /* 4096 bytes */
+ const char *mode,
+ gp_file **file);
+ } gsapi_fs_t;
+
+
+If the filename (always given in utf-8 format) is recognised as being one that the filing system handles (perhaps by the prefix used), then it should open the file, fill in the ``gp_file`` pointer and return 0.
+
+If the filename is not-recognised as being one that the filing system handles, then returning 0 will cause the filename to be offered to other registered filing systems.
+
+If an error is returned (perhaps ``gs_error_invalidfileaccess``), then no other filing system will be allowed to try to open the file. This provides a mechanism whereby a caller to gsapi can completely control access to all files accessed via ``gp_fopen`` at runtime.
+
+Note, that while most file access within Ghostscript will be redirected via these functions, stdio will not; see the existing mechanisms within Ghostscript for intercepting/replacing this.
+
+- The ``open_file`` function pointer will be called when something (most often a call to ``gp_fopen``) attempts to open a file.
+
+- The ``open_pipe`` function pointer will be called when something (most often a call to ``gp_popen``) attempts to open a pipe. ``rfname`` points to a 4K buffer in which the actual name of the opened pipe should be returned.
+
+- The ``open_scratch`` function pointer will be called when something (most often a call to ``gp_open_scratch_file`` or ``gp_open_scratch_file_rm``) attempts to open a temporary file. rfname points to a 4K buffer in which the actual name of the opened pipe should be returned. If ``rm`` is true, then the file should be set to delete itself when all handles to it are closed.
+
+- The ``open_printer`` function pointer will be called when something (most often a call to ``gp_open_printer``) attempts to open a stream to a printer. If ``binary`` is true, then the stream should be opened as binary; most streams will be binary by default - this has historical meaning on OS/2.
+
+- The ``open_handle`` function pointer will be called when something (most often a call via the postscript %handle% IO device) attempts to open a Windows handle. This entry point will never be called on non-Windows builds.
+
+Any of these which are left as ``NULL`` will never be called; a filing system with all of the entries left as ``NULL`` is therefore pointless.
+
+The most complex part of the implementation of these functions is the creation of a ``gp_file`` instance to return. There are some helper functions for this, best explained by example.
+
+Let us consider a hypothetical filing system that encrypts data as it is written, and decrypts it as it is read back. As each file is read and written the encryption/decryption routines will need to use some state, carried between calls to the filing system. We therefore might define a new type 'derived' from ``gp_file`` as follows:
+
+
+.. code-block:: c
+
+ typedef struct
+ {
+ gp_file base;
+ /* State private to the implementation of this file for encryption/decryption */
+ /* For example: */
+ int foo;
+ char *bar;
+ } gp_file_crypt;
+
+An implementation of ``gs_fs_t`` for our 'crypt' filing system might then look like this:
+
+
+.. code-block:: c
+
+ gsapi_fs_t gs_fs_crypt =
+ {
+ crypt_open_file,
+ NULL, /* open_pipe */
+ NULL, /* open_scratch */
+ NULL, /* open_printer */
+ NULL /* open_handle */
+ };
+
+
+In the above definition, we define a single handler, to cope with the opening of our input/output files. If we wanted to encrypt/decrypt other files too (perhaps the temporary files we produce) we'd need to define additional handlers (such as ``open_scratch``).
+
+Our handler might look as follows:
+
+
+.. code-block:: c
+
+ int crypt_open_file(const gs_memory_t *mem,
+ void *secret,
+ const char *filename,
+ const char *mode,
+ gp_file **file)
+ {
+ gp_file_crypt crypt;
+
+ /* Ignore any filename not starting with "crypt://" */
+ if (strncmp(filename, "crypt://", 8) != 0)
+ return 0;
+
+ /* Allocate us an instance (and fill in the non-crypt-specific
+ * internals) */
+ crypt = (gp_file_crypt *)gp_file_alloc(mem, &crypt_ops, sizeof(*crypt), "gp_file_crypt");
+ if (crypt == NULL)
+ return gs_error_VMerror; /* Allocation failed */
+
+ /* Setup the crypt-specific state */
+ crypt->foo = 1;
+ crypt->bar = gs_alloc_bytes(mem->non_gc_memory, 256, "bar");
+ /* If allocations fail, we need to clean up before exiting */
+ if (crypt->bar) {
+ gp_file_dealloc(crypt);
+ return gs_error_VMerror;
+ }
+
+ /* Return the new instance */
+ *file = &crypt.base;
+ return 0;
+ }
+
+
+The crucial part of this function is the definition of ``crypt_ops``, an instance of the ``gp_file_ops_t`` type; a table of function pointers that implement the actual operations required.
+
+.. code-block:: c
+
+ typedef struct {
+ int (*close)(gp_file *);
+ int (*getc)(gp_file *);
+ int (*putc)(gp_file *, int);
+ int (*read)(gp_file *, size_t size, unsigned int count, void *buf);
+ int (*write)(gp_file *, size_t size, unsigned int count, const void *buf);
+ int (*seek)(gp_file *, gs_offset_t offset, int whence);
+ gs_offset_t (*tell)(gp_file *);
+ int (*eof)(gp_file *);
+ gp_file *(*dup)(gp_file *, const char *mode);
+ int (*seekable)(gp_file *);
+ int (*pread)(gp_file *, size_t count, gs_offset_t offset, void *buf);
+ int (*pwrite)(gp_file *, size_t count, gs_offset_t offset, const void *buf);
+ int (*is_char_buffered)(gp_file *file);
+ void (*fflush)(gp_file *file);
+ int (*ferror)(gp_file *file);
+ FILE *(*get_file)(gp_file *file);
+ void (*clearerr)(gp_file *file);
+ gp_file *(*reopen)(gp_file *f, const char *fname, const char *mode);
+ } gp_file_ops_t;
+
+
+These functions generally follow the same patterns as the posix functions that match them, and so in many cases we will describe these with references to such. Whenever these routines are called, they will be passed a ``gp_file`` pointer. This pointer will have originated from the ``crypt_open_file`` call, and so can safely be cast back to a ``gp_file_crypt`` pointer to allow private data to be accessed.
+
+
+
+
+ :c:`close(gp_file *)`
+ - close the given file; free any storage in the crypt specific parts of ``gp_file_crypt``, but not the ``gp_file_crypt`` structure itself.
+
+ :c:`int getc(gp_file *)`
+ - Get a single character from the file, returning it as an int (or -1 for EOF). Behaves like ``fgetc(FILE *)``.
+
+ :c:`int putc(gp_file *, int)`
+ - Put a single character to the file, returning the character on success, or EOF (and setting the error indicator) on error. Behaves like ``fgetc(FILE *)``.
+
+ :c:`int read(gp_file *, size_t size, unsigned int count, void *buf)`
+ - Reads count entries of size bytes the file into ``buf``, returning the number of entries read. Behaves like ``fread(FILE *, size, count, buf)``.
+
+ :c:`int write(gp_file *, size_t size, unsigned int count, const void *buf)`
+ - Writes count entries of size bytes from ``buf`` into the file, returning the number of entries written. Behaves like ``fwrite(FILE *, size, count, buf)``.
+
+ :c:`int seek(gp_file *, gs_offset_t offset, int whence)`
+ - Seeks within the file. Behaves like ``fseek(FILE *, offset, whence)``.
+
+ :c:`gs_offset_t tell(gp_file *)`
+ - Returns the current offset within the file. Behaves like ``ftell(FILE *)``.
+
+ :c:`int eof(gp_file *)`
+ - Returns 1 if we are at the end of the file, 0 otherwise. Behaves like ``feof(FILE *)``.
+
+ :c:`gp_file * dup(gp_file *, const char *mode)`
+ - Optional function, only used if clist files are to be stored in this filing system. Behaves like ``fdup(FILE *)``. Leave ``NULL`` if not implemented.
+
+ :c:`int seekable(gp_file *)`
+ - Returns 1 if the file is seekable, 0 otherwise. Certain output devices will only work with seekable files.
+
+ :c:`int pread(gp_file *, size_t count, gs_offset_t offset, void *buf)`
+ - Optional function, only used if clist files are to be stored in this filing system. Behaves like an atomic ``fseek(FILE *, offset, 0)`` and ``fread(FILE *, 1, count, buf)``. Akin to ``pread``.
+
+ :c:`int pwrite(gp_file *, size_t count, gs_offset_t offset, const void *buf)`
+ - Optional function, only used if clist files are to be stored in this filing system. Behaves like an atomic ``fseek(FILE *, offset, 0)`` and ``fwrite(FILE *, 1, count, buf)``. Akin to ``pwrite``.
+
+ :c:`int is_char_buffered(gp_file *file)`
+ - Returns 1 if the file is character buffered, 0 otherwise. Used for handling reading from terminals. Very unlikely to be used, so returning 0 all the time should be safe. Leave ``NULL`` to indicate "always 0".
+
+ :c:`void fflush(gp_file *file)`
+ - Ensures that any buffered data is written to the file. Behaves like ``fflush(FILE *)``. Leave ``NULL`` to indicate that no flushing is ever required.
+
+ :c:`int ferror(gp_file *file)`
+ - Returns non-zero if there has been an error, or 0 otherwise. Behaves like ``ferror(FILE *)``.
+
+ :c:`FILE * get_file(gp_file *file)`
+ - Optional: Gets the ``FILE *`` pointer that backs this file. Required for a few devices that insist on working with ``FILE *``'s direct. Generally safe to leave this set to ``NULL``, and those devices will fail gracefully.
+
+ :c:`void clearerr(gp_file *file)`
+ - Clear the error and EOF values for a file. Behaves like ``clearerror(FILE *)``.
+
+ :c:`gp_file * reopen(gp_file *f, const char *fname, const char *mode)`
+ - Optional function, only used if the ``gp_file`` came from an ``open_scratch`` call; can be left as ``NULL`` if the ``open_scratch`` pointer is set to ``NULL``. Reopen a stream with a different mode. Behaves like ``freopen(fname, mode, FILE *)``.
+
+
+
+
+
+
+
+.. _callout:
+
+
+Callouts
+------------------------------------------
+
+Callouts are a mechanism for the core code (specifically devices) to communicate with the user of gsapi. This communication can take the form of passing information out vis-a-vis what devices are doing, or requesting configuration from the caller to affect exactly how the device itself works.
+
+This is deliberately an extensible system, so exact details of callouts should be documented with the device in question. In general however a callout handler will be of the form:
+
+
+.. code-block:: c
+
+ typedef int (*gs_callout)(void *callout_handle,
+ const char *device_name,
+ int id,
+ int size,
+ void *data);
+
+
+The ``callout_handle`` value passed to the callout will be the value passed in at registration. The device_name should be a null-terminated string giving the name of the device (though care should be taken to cope with the case where ``device_name`` is ``NULL`` for potential future uses). The id value will have a (device-specific) meaning; see the documentation for the device in question for more details. The same id value may be used to mean different things in different devices. Finally, size and data have callout specific meanings, but typically, data will be a pointer to data block (which may either be uninitialised or wholly/partially initialised on entry, and may be updated on exit), and size will be the size (in bytes) of the block pointed to by data.
+
+A return value of -1 (``gs_error_unknownerror``) means the callout was not recognised by the handler, and should be passed to more handlers. Other negative values are interpreted as standard Ghostscript error values, and stop the propagation of the callout. Non-negative return codes mean the callout was handled and should not be passed to any more registered callout handlers.
+
+
+
+.. _API_Return codes:
+
+
+Return codes
+--------------
+
+
+The gsapi_init_with_args_, :ref:`gsapi_run_*<gsapi_run_asterisk>` and gsapi_exit_ functions return an integer code.
+
+
+Return Codes from ``gsapi_*()``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - CODE
+ - STATUS
+ * - 0
+ - No errors
+ * - gs_error_Quit
+ - "quit" has been executed. This is not an error. ```gsapi_exit()`` must be called next.
+ * - gs_error_interrupt
+ - The polling callback function returned a negative value, requesting Ghostscript to abort.
+ * - gs_error_NeedInput
+ - More input is needed by ``gsapi_run_string_continue()``. This is not an error.
+ * - gs_error_Info
+ - "gs -h" has been executed. This is not an error. ``gsapi_exit()`` must be called next.
+ * - < 0
+ - Error
+ * - <= gs_error_Fatal
+ - Fatal error. ``gsapi_exit()`` must be called next.
+
+
+The ``gsapi_run_*()`` functions do not flush stdio. If you want to see output from Ghostscript you must do this explicitly as shown in the example below.
+
+When executing a string with ``gsapi_run_string_*()``, ``currentfile`` is the input from the string. Reading from ``%stdin`` uses the stdin callback.
+
+
+Example Usage
+--------------
+
+
+To try out the following examples in a development environment like Microsoft's developer tools or Metrowerks Codewarrior, create a new project, save the example source code as a ``.c`` file and add it, along with the Ghostscript dll or shared library. You will also need to make sure the Ghostscript headers are available, either by adding their location (the src directory in the Ghostscript source distribution) to the project's search path, or by copying ``ierrors.h`` and ``iapi.h`` into the same directory as the example source.
+
+
+
+Example 1
+~~~~~~~~~~~~~~~
+
+.. code-block:: c
+
+ /* Example of using GS DLL as a ps2pdf converter. */
+
+ #if defined(_WIN32) && !defined(_Windows)
+ # define _Windows
+ #endif
+ #ifdef _Windows
+ /* add this source to a project with gsdll32.dll, or compile it directly with:
+ * cl -D_Windows -Isrc -Febin\ps2pdf.exe ps2pdf.c bin\gsdll32.lib
+ */
+ # include <windows.h>
+ # define GSDLLEXPORT __declspec(dllimport)
+ #endif
+
+ #include "ierrors.h"
+ #include "iapi.h"
+
+ void *minst = NULL;
+
+ int main(int argc, char *argv[])
+ {
+ int code, code1;
+ const char * gsargv[7];
+ int gsargc;
+ gsargv[0] = "";
+ gsargv[1] = "-dNOPAUSE";
+ gsargv[2] = "-dBATCH";
+ gsargv[3] = "-dSAFER";
+ gsargv[4] = "-sDEVICE=pdfwrite";
+ gsargv[5] = "-sOutputFile=out.pdf";
+ gsargv[6] = "input.ps";
+ gsargc=7;
+
+ code = gsapi_new_instance(&minst, NULL);
+ if (code < 0)
+ return 1;
+ code = gsapi_set_arg_encoding(minst, GS_ARG_ENCODING_UTF8);
+ if (code == 0)
+ code = gsapi_init_with_args(minst, gsargc, gsargv);
+ code1 = gsapi_exit(minst);
+ if ((code == 0) || (code == gs_error_Quit))
+ code = code1;
+
+ gsapi_delete_instance(minst);
+
+ if ((code == 0) || (code == gs_error_Quit))
+ return 0;
+ return 1;
+ }
+
+
+Example 2
+~~~~~~~~~~~~~~~
+
+.. code-block:: c
+
+ /* Similar to command line gs */
+
+ #if defined(_WIN32) && !defined(_Windows)
+ # define _Windows
+ #endif
+ #ifdef _Windows
+ /* Compile directly with:
+ * cl -D_Windows -Isrc -Febin\gstest.exe gstest.c bin\gsdll32.lib
+ */
+ # include <windows.h>
+ # define GSDLLEXPORT __declspec(dllimport)
+ #endif
+ #include <stdio.h>
+ #include "ierrors.h"
+ #include "iapi.h"
+
+ /* stdio functions */
+ static int GSDLLCALL
+ gsdll_stdin(void *instance, char *buf, int len)
+ {
+ int ch;
+ int count = 0;
+ while (count < len) {
+ ch = fgetc(stdin);
+ if (ch == EOF)
+ return 0;
+ *buf++ = ch;
+ count++;
+ if (ch == '\n')
+ break;
+ }
+ return count;
+ }
+
+ static int GSDLLCALL
+ gsdll_stdout(void *instance, const char *str, int len)
+ {
+ fwrite(str, 1, len, stdout);
+ fflush(stdout);
+ return len;
+ }
+
+ static int GSDLLCALL
+ gsdll_stderr(void *instance, const char *str, int len)
+ {
+ fwrite(str, 1, len, stderr);
+ fflush(stderr);
+ return len;
+ }
+
+ void *minst = NULL;
+ const char start_string[] = "systemdict /start get exec\n";
+
+ int main(int argc, char *argv[])
+ {
+ int code, code1;
+ int exit_code;
+
+ code = gsapi_new_instance(&minst, NULL);
+ if (code < 0)
+ return 1;
+ gsapi_set_stdio(minst, gsdll_stdin, gsdll_stdout, gsdll_stderr);
+ code = gsapi_set_arg_encoding(minst, GS_ARG_ENCODING_UTF8);
+ if (code == 0)
+ code = gsapi_init_with_args(minst, argc, argv);
+ if (code == 0)
+ code = gsapi_run_string(minst, start_string, 0, &exit_code);
+ code1 = gsapi_exit(minst);
+ if ((code == 0) || (code == gs_error_Quit))
+ code = code1;
+
+ gsapi_delete_instance(minst);
+
+ if ((code == 0) || (code == gs_error_Quit))
+ return 0;
+ return 1;
+ }
+
+
+Example 3
+~~~~~~~~~~~~~~~
+
+
+Replace ``main()`` in either of the above with the following code, showing how you can feed Ghostscript piecemeal:
+
+
+.. code-block:: c
+
+ const char *command = "1 2 add == flush\n";
+
+ int main(int argc, char *argv[])
+ {
+ int code, code1;
+ int exit_code;
+
+ code = gsapi_new_instance(&minst, NULL);
+ if (code < 0)
+ return 1;
+ code = gsapi_set_arg_encoding(minst, GS_ARG_ENCODING_UTF8);
+ if (code == 0)
+ code = gsapi_init_with_args(minst, argc, argv);
+
+ if (code == 0) {
+ gsapi_run_string_begin(minst, 0, &exit_code);
+ gsapi_run_string_continue(minst, command, strlen(command), 0, &exit_code);
+ gsapi_run_string_continue(minst, "qu", 2, 0, &exit_code);
+ gsapi_run_string_continue(minst, "it", 2, 0, &exit_code);
+ gsapi_run_string_end(minst, 0, &exit_code);
+ }
+
+ code1 = gsapi_exit(minst);
+ if ((code == 0) || (code == gs_error_Quit))
+ code = code1;
+
+ gsapi_delete_instance(minst);
+
+ if ((code == 0) || (code == gs_error_Quit))
+ return 0;
+ return 1;
+ }
+
+
+Example 4
+~~~~~~~~~~~~~~~
+
+When feeding Ghostscript piecemeal buffers, one can use the normal operators to configure things and invoke library routines. For example, to parse a PDF file one could say:
+
+
+.. code-block:: c
+
+ code = gsapi_run_string(minst, "(example.pdf) .runlibfile", 0, &exit_code);
+
+and Ghostscript would open and process the file named "example.pdf" as if it had been passed as an argument to ``gsapi_init_with_args()``.
+
+
+
+
+Multiple Threads
+--------------------
+
+The Ghostscript library should have been compiled with a thread safe run time library. Synchronisation of threads is entirely up to the caller. The exported ``gsapi_*()`` functions must be called from one thread only.
+
+
+
+Standard Input and Output
+----------------------------------------
+
+When using the Ghostscript interpreter library interface, you have a choice of two standard input/output methods.
+
+- If you do nothing, the "C" stdio will be used.
+
+- If you use ``gsapi_set_stdio()``, all stdio will be redirected to the callback functions you provide. This would be used in a graphical user interface environment where stdio is not available, or where you wish to process Ghostscript input or output.
+
+The callback functions are described in ``iapi.h``.
+
+
+
+.. _display:
+
+Display Device
+-----------------
+
+The display device is available for use with the Ghostscript interpreter library. While originally designed for allowing screen display of rendered output from Ghostscript, this is now powerful enough to provide a simple mechanism for getting rendered output suitable for use in all manner of output scenarios, including printing.
+
+Details of the API and options are given in the file ``gdevdsp.h``. This device provides you with access to the raster output of Ghostscript. It is the callers responsibility to copy this raster to a display window or printer.
+
+In order for this device to operate, it needs access to a structure containing a set of callback functions, and a callback handle (an opaque ``void *`` that can be used by caller to locate its own state). There are 2 ways that the device can get this information, a legacy method, and a modern method.
+
+
+Legacy method
+~~~~~~~~~~~~~~~~
+
+The address of the callback structure, is provided using ``gsapi_set_display_callback()``. This must be called after ``gsapi_new_instance()`` and before ``gsapi_init_with_args()``.
+
+With this call, the callback handle is passed as ``NULL`` by default, but can be overridden by using a parameter. We actively dislike this way of working, as we consider passing addresses via the command line distasteful. The handle can be set using:
+
+
+.. code-block:: bash
+
+ -sDisplayHandle=1234
+
+Where "1234" is a string. The API was changed to use a string rather than an integer/long value when support for 64 bit systems arrived. A display "handle" is often a pointer, and since these command line options have to survive being processed by Postscript machinery, and Postscript only permits 32 bit number values, a different representation was required. Hence changing the value to a string, so that 64 bit values can be supported. The string formats allowed are:
+
+
+
+.. list-table::
+ :widths: 50 50
+
+ * - 1234
+ - implicit base 10
+ * - 10#1234
+ - explicit base 10
+ * - 16#04d2
+ - explicit base 16
+
+The "number string" is parsed by the display device to retrieve the number value, and is then assigned to the void pointer parameter "pHandle" in the display device structure. Thus, for a trivial example, passing ``-sDisplayHandle=0`` will result in the first parameter passed to your display device callbacks being: ``(void *)0``.
+
+The previous API, using a number value:
+
+.. code-block:: bash
+
+ -dDisplayHandle=1234
+
+is still supported on 32 bit systems, but will cause a "typecheck" error on 64 bit systems, and is considered deprecated. It should not be used in new code.
+
+
+
+Modern method
+~~~~~~~~~~~~~~~~
+
+
+The preferred method is to register a callout handler using gsapi_register_callout_. When this handler is called for the "display" device, with ``id = 0 (= DISPLAY_CALLOUT_GET_CALLBACK)``, then data should point to an empty ``gs_display_get_callback_t`` block, with ``size = sizeof(gs_display_get_callback_t)``.
+
+
+.. code-block:: c
+
+ typedef struct {
+ display_callback *callback;
+ void *caller_handle;
+ } gs_display_get_callback_t;
+
+
+The handler should fill in the structure before returning, with a return code of 0.
+
+Note, that the ``DisplayHandle`` value is only consulted for display device callbacks registered using the (legacy, now deprecated) ``gsapi_set_display_callback`` API, not the preferred ``gsapi_register_callout`` based mechanism.
+
+The device raster format can be configured using:
+
+
+.. code-block:: bash
+
+ -dDisplayFormat=NNNN
+
+
+Options include:
+
+- native, gray, RGB, CMYK or separation color spaces.
+- alpha byte (ignored).
+- 1 to 16 bits/component.
+- bigendian (RGB) or littleendian (BGR) order.
+- top first or bottom first raster.
+- 16 bits/pixel with 555 or 565 bitfields.
+- Chunky, Planar and Planar interleaved formats.
+- "Full screen" or "Rectangle Request" modes of operation.
+
+The operation of the device is best described with a walkthrough of some example code that uses it. For simplicity and clarity, we have omitted the error handling code in this example; in production code, every place where we get a code value returned we should check it for failure (a negative value) and clean up accordingly. First, we create an instance of Ghostscript:
+
+
+.. code-block:: c
+
+ void *minst = NULL;
+ code = gsapi_new_instance(&minst, NULL);
+ code = gsapi_set_stdio(minst, gsdll_stdin, gsdll_stdout, gsdll_stderr);
+
+Next, we have to give the display device the address of our callback structure. In old code, we would do so using something like this:
+
+.. code-block:: c
+
+ code = gsapi_set_display_callback(minst, &display_callback);
+
+We strongly recommend that you don't do that, but instead use the more modern :ref:`callout<Modern method>` mechanism:
+
+
+.. code-block:: c
+
+ code = gsapi_register_callout(minst, my_callout_handler, state);
+
+where ``state`` is any ``void *`` value you like, usually a pointer to help you reach any internal state you may need. Earlier in your code you would have the definition of ``my_callout_handler`` that might look like this:
+
+
+.. code-block:: c
+
+ static int
+ my_callout_handler(void *instance,
+ void *callout_handle,
+ const char *device_name,
+ int id,
+ int size,
+ void *data)
+ {
+ /* On entry, callout_handle == the value of state passed in
+ * to gsapi_register_callout. */
+ /* We are only interested in callouts from the display device. */
+ if (device_name == NULL || strcmp(device_name, "display"))
+ return -1;
+
+ if (id == DISPLAY_CALLOUT_GET_CALLBACK)
+ {
+ /* Fill in the supplied block with the details of our callback
+ * handler, and the handle to use. In this instance, the handle
+ * is the pointer to our test structure. */
+ gs_display_get_callback_t *cb = (gs_display_get_callback_t *)data;
+ cb->callback = &display_callback;
+ cb->caller_handle = callout_handle;
+ return 0;
+ }
+ return -1;
+ }
+
+
+As you can see, this callout handler only responds to callouts for the display device, and then only for one particular function (``id``). It returns the same ``display_callback`` structure as the deprecated, legacy mechanism passed in using ``gsapi_set_display_callback``, with the added benefit that the ``caller_handle`` value can be passed in too. In this example we pass in the same value as was used for ``callout_handle``, but implementations are free to use any value they want.
+
+Returning to our example, we now set up a set of arguments to setup Ghostscript:
+
+
+.. code-block:: c
+
+ int argc = 0;
+ /* Allow for up to 32 args of up to 64 chars each. */
+ char argv[32][64];
+ sprintf(argc[argc++], "gs");
+ sprintf(argv[argc++], "-sDEVICE=display");
+
+
+The zeroth arg is a dummy argument to match the standard C mechanism for passing arguments to a program. Traditionally this is the name of the program being invoked. Next, we tell Ghostscript to use the display device.
+
+.. code-block:: c
+
+ sprintf(argv[argc++], "-sDEVICE=display");
+
+Next we tell the display device what output format to use. The format is flexible enough to support common Windows, OS/2, Linux and Mac raster formats.
+
+The format values are described in ``gdevdsp.h``. To select the display device with a Windows 24-bit RGB raster:
+
+.. code-block:: c
+
+ sprintf(argv[argc++], "-dDisplayFormat=%d",
+ DISPLAY_COLORS_RGB | DISPLAY_ALPHA_NONE | DISPLAY_DEPTH_8 |
+ DISPLAY_LITTLEENDIAN | DISPLAY_BOTTOMFIRST);
+
+
+If (and only if) you used the legacy mechanism described above, you will need another argument to pass in the ``caller_handle`` value to be parroted back to the functions listed within ``display_callback``:
+
+
+.. code-block:: c
+
+ sprintf(arg2, "-dDisplayHandle=%d", callout_handle);
+
+
+Any other arguments that you want can be added to the end of the command line, typically including a file to run. Then we pass that all to Ghostscript:
+
+
+.. code-block:: c
+
+ code = gsapi_init_with_args(minst, argc, argv);
+
+
+At this point you should start to see your display callback functions being called. Exactly which callback functions are provided, and how they respond will determine exactly how the display device operates. The primary choice will be whether the device runs in "full page" or "rectangle request" mode. Details of these are given below.
+
+Once we have finished processing the file, we can process other files using ``gsapi_run_file``, or feed in data using ``gsapi_run_string``. Once you have finished, you can shut the interpreter down and exit, using:
+
+.. code-block:: c
+
+ code = gsapi_exit(minst);
+ gsapi_delete_instance(minst);
+
+A full list of the display callback functions can be found in ``gdevdsp.h``. There are several different versions of the callback, corresponding to different "generations" of the device. In general you should use the latest one. The size field of the structure should be initialised to the size of the structure in bytes.
+
+
+display_open()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: c
+
+ int (*display_open)(void *handle, void *device);
+
+This function will be called when the display device is opened. The device may be opened and closed many times, sometimes without any output being produced.
+
+
+display_preclose()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_preclose)(void *handle, void *device);
+
+
+This function will be called when the display device is about to be closed. The device will not actually be closed until this function returns.
+
+
+
+display_close()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_close)(void *handle, void *device);
+
+
+This function will be called once the display device has been closed. There will be no more events from the device unless/until it is reopened.
+
+
+
+display_presize()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_presize)(void *handle, void *device,
+ int width, int height, int raster, unsigned int format);
+
+
+This function will be called when the display device is about to be resized. The device will only be resized if this function returns 0.
+
+
+
+
+display_size()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_size)(void *handle, void *device, int width, int height,
+ int raster, unsigned int format, unsigned char *pimage);
+
+
+This function will be called when the display device is has been resized. The pointer to the raster image is pimage.
+
+
+
+display_sync()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_sync)(void *handle, void *device);
+
+
+This function may be called periodically during display to flush the page to the display.
+
+
+
+display_page()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_page)(void *handle, void *device, int copies, int flush);
+
+
+This function is called on a "showpage" operation (i.e. at the end of every page). Operation will continue as soon as this function returns.
+
+
+
+
+display_update()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_update)(void *handle, void *device,
+ int x, int y, int w, int h);
+
+
+This function may get called repeatedly during rendering to indicate that an area of the output has been updated. Certain types of rendering will not see this function called back at all (in particular files using transparency).
+
+
+
+
+display_memalloc()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_memalloc)(void *handle, void *device,
+ size_t long size);
+
+
+Note: In older versions of this API, size is an unsigned long rather than a ``size_t``.
+
+
+If this function pointer is sent as ``NULL``, then the display device will handle all the memory allocations internally, and will always work in full page rendering mode.
+
+Otherwise, this function will be called to allocate the storage for the page to be rendered into. If a non-NULL value is returned, then the device will proceed to render the full page into it. If ``NULL`` is returned, then the device will check a) whether we are using a V2 or greater display callback structure and b) whether that structure specifies a rectangle_request function pointer.
+
+If both of those conditions are true, then the device will continue in rectangle request mode. Otherwise it will fail with an out of memory error.
+
+
+
+
+display_memfree()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_memfree)(void *handle, void *device, void *ptr);
+
+
+This function should be ``NULL`` if and only if ``display_memalloc`` is ``NULL``. Any memory allocated using ``display_memalloc`` will be freed via this function.
+
+
+display_separation()
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_separation)(void *handle, void *device,
+ int component, const char *component_name,
+ unsigned short c, unsigned short m,
+ unsigned short y, unsigned short k);
+
+
+When using ``DISPLAY_COLORS_SEPARATION``, this function will be called once for every separation component - first "Cyan", "Magenta", "Yellow" and "Black", then any spot colors used. The supplied c, m, y and k values give the equivalent color for each spot. Each colorant value ranges from 0 (for none) to 65535 (full).
+
+In separation color mode you are expected to count the number of calls you get to this function after each ``display_size`` to know how many colors you are dealing with.
+
+
+
+display_adjust_band_height()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_adjust_band_height)(void *handle, void *device,
+ int bandheight);
+
+
+When running in "rectangle request mode" the device first renders the page to a display list internally. It can then be played back repeatedly so that different regions (rectangles) of the page can be extracted in sequence. A common use of this is to support "banded" operation, where the page is divided into multiple non-overlapping bands of a fixed height.
+
+The display device itself will pick an appropriate band height for it to use. If this function pointer is left as ``NULL`` then this value will be used unchanged. Otherwise, the proposed value will be offered to this function. This function can override the choice of bandheight, by returning the value that it would like to be used in preference.
+
+In general, this figure should (as much as possible) only be adjusted downwards. For example, a device targeting an inkjet printer with 200 nozzles in the print head might like to extract bands that are a multiple of 200 lines high. So the function might ``return max(200, 200*(bandheight/200))``. If the function returns 0, then the existing value will be used unchanged.
+
+
+Any size rectangle can be chosen with any size bandheight, so ultimately the value chosen here will not matter much. It may make some small difference in speed in some cases.
+
+
+
+display_rectangle_request()
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ int (*display_rectangle_request)(void *handle, void *device,
+ void **memory, int *ox, int *oy,
+ int *raster, int *plane_raster,
+ int *x, int *y, int *w, int *h);
+
+
+If the display device chooses to use rectangle request mode, this function will be called repeatedly to request a rectangle to render. Ghostscript will render the rectangle, and call this function again. The implementer is expected to handle the rectangle that has just been rendered, and to return the details of another rectangle to render. This will continue until a rectangle with zero height or width is returned, whereupon Ghostscript will continue operation.
+
+On entry, ``*raster`` and ``*plane_raster`` are set to the values expected by the format in use. All the other pointers point to uninitialised values.
+
+On exit, the values should be updated appropriately. The implementor is expected to store the values returned so that the rendered output given can be correctly interpreted when control returns to this function.
+
+``memory`` should be updated to point to a block of memory to use for the rendered output. Pixel (``*ox``, ``*oy``) is the first pixel represented in that block.
+
+``*raster`` is the number of bytes difference between the address of component 0 of Pixel(``*ox``, ``*oy``) and the address of component 0 of Pixel(``*ox``, 1+``*oy``).
+
+``*plane_raster`` is the number of bytes difference between the address of component 0 of Pixel(``*ox``, ``*oy``) and the address of component 1 of Pixel(``*ox``, ``*oy``), if in planar mode, 0 otherwise. ``*x``, ``*y``, ``*w`` and ``*h`` give the rectangle requested within that memory block.
+
+Any set of rectangles can be rendered with this method, so this can be used to drive Ghostscript in various ways. Firstly, it is simple to request a set of non-overlapping "bands" that cover the page, to drive a printer. Alternatively, rectangles can be chosen to fill a given block of memory to implement a window panning around a larger page. Either the whole image could be redrawn each time, or smaller rectangles around the edge of the panned area could be requested. The choice is down to the caller.
+
+Some examples of driving this code in full page mode are in ```dwmain.c``(Windows), ``dpmain.c`` (OS/2) and ``dxmain.c`` (X11/Linux), and ``dmmain.c`` (MacOS Classic or Carbon).
+
+Alternatively an example that drives this code in both full page and rectangle request mode can be found in ``api_test.c``.
+
+On some platforms, the calling convention for the display device callbacks in ``gdevdsp.h`` is not the same as the exported :ref:`gsapi_*() <gsapi_asterisk>` functions in ``iapi.h``.
+
+
+
+.. include:: footer.rst
+
+
+
+
+
+
+
+
+
diff --git a/doc/src/C-style.rst b/doc/src/C-style.rst
new file mode 100644
index 00000000..0837e89c
--- /dev/null
+++ b/doc/src/C-style.rst
@@ -0,0 +1,1060 @@
+.. title:: Ghostscript C Coding Guidelines
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _C-style.htm:
+
+
+Ghostscript C Coding Guidelines
+===================================
+
+
+This document describes Ghostscript's C coding conventions. It is primarily prescriptive, documenting what developers should do when writing new code; the companion :ref:`developer documentation<Develop.htm>` is primarily descriptive, documenting the way things are.
+
+We encourage following the general language usage and stylistic rules for any code that will be integrated with Ghostscript, even if the code doesn't use Ghostscript's run-time facilities or have anything to do with PostScript, PDF, or page description languages. Ghostscript itself follows some additional conventions; these are documented separately under :ref:`Ghostscript conventions<Conventions>` below.
+
+
+
+C language do's and don'ts
+------------------------------
+
+There are several different versions of the C language, and even of the ANSI C standard. Ghostscript versions through 7.0 were designed to compile on pre-ANSI compilers as well as on many compilers that implemented the ANSI standard with varying faithfulness. Ghostscript versions since 7.0 do not cater for pre-ANSI compilers: they must conform to the ANSI 1989 standard (ANS X3.159-1989), with certain restrictions and a few conventional additions.
+
+Preprocessor
+~~~~~~~~~~~~~~~~
+
+Conditionals
+"""""""""""""""
+
+Restrictions:
+
+- Don't assume that ``#if`` will treat undefined names as 0. While the ANSI standard requires this, it may produce a warning.
+
+- In ``.c`` files, don't use preprocessor conditionals that test for individual platforms or compilers. Use them only in header files named ``xxx_.h``.
+
+
+Macros
+"""""""""""
+
+Restrictions:
+
+- Don't redefine a macro, even with the same definition, without using ``#undef``.
+
+- ``CAPITALIZE`` macro names unless there is a good reason *not* to.
+
+- Even though the legacy code contains some macros which contain control flow statments, avoid the use of this in new code and do not create macros which contain hidden control flow, especially 'return'. The use of control flow in macros complicates debug significantly requiring tedious expansion of macros to build a module to be debugged or resorting to disassembly windows to set breakpoints or to trace flow.
+
+- Don't use a macro call within a macro argument if the call expands to a token sequence that includes any commas not within parentheses: this produces different results depending on whether the compiler expands the inner call before or after the argument is substituted into the macro body. (The ANSI standard says that calls must be expanded after substitution, but some compilers do it the other way.)
+
+- Don't use macro names, even inadvertently, in string constants. Some compilers erroneously try to expand them.
+
+- Don't use macros to define shorthands for casted pointers. For instance, avoid:
+
+
+ .. code-block:: c
+
+ #define fdev ((gx_device_fubar *)dev)
+
+ and instead use:
+
+
+ .. code-block:: c
+
+ gx_device_fubar * const fdev = (gx_device_fubar *)dev;
+
+
+ The use of ``const`` alerts the reader that this is effectively a synonym.
+
+- If a macro generates anything larger than a single expression (that is, one or more statements), surround it with ``BEGIN`` and ``END``. These work around the fact that simple statements and compound statements in C can't be substituted for each other syntactically.
+
+
+- If a macro introduces local variables, only use names that end with an underscore (``_``), such as ``code_``. This avoids clashes both with ordinary variable names (which should never end with an underscore) and with system-defined names (which may begin with an underscore).
+
+
+Other
+~~~~~~~~~~~~~~~~
+
+Restrictions:
+
+Only use ``#pragma`` in files that are explicitly identified as being platform-dependent. Many compilers complain if this is used at all, and some complain if they don't recognize the specific ``pragma`` being requested (both incorrect according to the ANSI standard).
+
+
+Lexical elements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Do not use:
+
+- ANSI trigraphs (``??x``).
+
+- Nested comments (``/* /* */ */``) (not ANSI compliant, but often accepted).
+
+- Multi-character character constants ('abc').
+
+- Wide-character character or string constants (``L'x'``, ``L"x"``).
+
+Restrictions:
+
+- Procedure and static variable names must be 31 characters or less.
+
+- Externally visible procedure and variable names must be unique in the first 23 characters.
+
+
+Scoping (extern, static, ...)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Do not use:
+
+- ``register``
+
+Restrictions:
+
+- Do not allow a global variable (constant) to have more than one non-``extern`` definition, even though some ANSI C compilers allow this. Every global constant should have exactly one definition, in a ``.c`` file, and preferably just one ``extern`` declaration, in a header file.
+
+
+- ``static`` or variables must be ``const`` and initialized: non-``const`` statically allocated variables are incompatible with reentrancy, and we're in the process of eliminating all of them.
+
+- Do not use ``extern`` in ``.c`` files, only in ``.h`` files, unless you have a very good reason for it (e.g., as in ``iconf.c``). There are too many such externs in the code now: we are eliminating them over time.
+
+- Do not declare the same name as both ``static`` and non-``static`` within the same compilation. (Some compilers complain, some do not.) This is especially a problem for procedures: it is easy to declare a procedure as ``static`` near the beginning of a file and accidentally not declare it ``static`` where it is defined later in the file.
+
+- Even though the ANSI standard allows initialized external declarations (``extern int x = 0``), don't use them.
+
+
+Scalars
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Restrictions:
+
+- Avoid using ``char``, except for ``char *`` for a pointer to a string. Don't assume that ``char`` is signed; also don't assume it is unsigned.
+
+- Never cast a ``float`` to a ``double`` explicitly. ANSI compilers in their default mode do all floating point computations in double precision, and handle such casts automatically.
+
+- Don't use ``long long``: even though it is in the ANSI standard, not all compilers support it. Use the ``(u)int64_t`` types from ``stdint_.h`` instead.
+
+- Don't assume anything about whether ``sizeof(long)`` is less than, equal to, or greater than ``sizeof(ptr)``. (However, you can make such comparisons in preprocessor conditionals using ``ARCH_SIZEOF_LONG`` and ``ARCH_SIZEOF_PTR``).
+
+
+Arrays
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Restrictions:
+
+- Don't declare arrays of size 0. (The newer ANSI standard allows this, but the older one doesn't).
+
+- Don't declare an array of size 1 at the end of a structure to indicate that a variable-size array follows.
+
+- Don't declare initialized ``auto`` arrays.
+
+
+Typedefs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Restrictions:
+
+- Don't use ``typedef`` for function types, such as:
+
+.. code-block:: c
+
+ typedef int proc_xyz_t(double, int *);
+
+
+Many compilers don't handle this correctly -- they will give errors, or do the wrong thing, when declaring variables of type ``proc_xyz_t`` and/or ``proc_xyz_t *``. Instead, do this:
+
+.. code-block:: c
+
+ #define PROC_XYZ(proc) int proc(double, int *)
+ PROC_XYZ(some_proc); /* declare a procedure of this type */
+ typedef PROC_XYZ((*proc_xyz_ptr_t)); /* define a type for procedure ptrs */
+
+ proc_xyz_ptr_t pp; /* pointer to procedure */
+
+
+Don't redefine ``typedef``'ed names, even with the same definition. Some compilers complain about this, and the standard doesn't allow it.
+
+
+Structures
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Restrictions:
+
+- Don't use anonymous structures if you can possibly avoid it, except occasionally as components of other structures. Ideally, use the ``struct`` keyword only for declaring named structure types, like this:
+
+.. code-block:: c
+
+ typedef struct xxx_s {
+ ... members ...
+ } xxx_t;
+
+- Use ``struct`` only when declaring structure types, never for referring to them (e.g., never declare a variable as type ``struct xxx_s *``).
+
+- Don't assume that the compiler will (or won't) insert padding in structures to align members for best performance. To preserve alignment, only declare structure members that are narrower than an ``int`` if there will be a lot of instances of that structure in memory. For such structures, insert ``byte`` and/or ``short`` padding members as necessary to re-establish ``int`` alignment.
+
+- Don't declare initialized ``auto`` structures.
+
+
+Unions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Restrictions:
+
+- Use unions only as components of structures, not as ``typedefs`` in their own right.
+
+- Don't attempt to initialize unions: not all compilers support this, even though it is in the 1989 ANSI standard.
+
+
+Expressions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Restrictions:
+
+- Don't assign a larger integer data type to a smaller one without a cast (``int_x = long_y``).
+
+- It's OK to use the address of a structure or array element (``&p->e, &a[i]``) locally, or pass it to a procedure that won't store it, but don't store such an address in allocated storage unless you're very sure of what you're doing.
+
+- Don't use conditional expressions with structure or union values. (Pointers to structures or unions are OK).
+
+- For calling a variable or parameter procedure, use ``ptr->func(...)``. Some old code uses explicit indirection, ``(*ptr->func)(...)``: don't use this in new code.
+
+- Don't write expressions that depend on order of evaluation, unless the order is created explicitly by use of ``||``, ``&&``, ``?:``, ``,``, or function nesting (the arguments of a function must be evaluated before the function is called). In particular, don't assume that the arguments of a function will be evaluated left-to-right, or that the left side of an assignment will be evaluated before the right.
+
+- Don't mix integer and enumerated types ad lib: treat enumerated types as distinct from integer types, and use casts to convert between the two. (- Some compilers generate warnings if you do not do this).
+
+
+Statements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Restrictions:
+
+- If you use an expression as a statement, other than an assignment or a function call with void return value, enclose it explicitly in ``DISCARD()``.
+
+- The type of the operand of a ``switch`` must match the type of the case labels, whether the labels are ``ints`` or the members of an ``enum`` type. (Use a cast if necessary).
+
+- It is OK for one case of a switch to "fall through" into another (i.e., for the statement just before a case label not to be a control transfer), but a comment ``/* falls through */`` is required.
+
+- If you are returning an error code specified explicitly (e.g., ``return gs_error_rangecheck``), use ``return_error()`` rather than plain ``return``. However, if the program is simply propagating an error code generated elsewhere, as opposed to generating the error, use return (e.g., ``if (code < 0) return code``).
+
+
+Procedures
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Restrictions:
+
+- Provide a prototype for every procedure, and make sure the prototype is available at every call site. If the procedure is local to a file (static), the prototype should precede the procedure, in the same file; if the procedure is global, the prototype should be in a header file.
+
+- If a procedure parameter is itself a procedure, do list its parameter types rather than just using ``()``. For example:
+
+ .. code-block:: c
+
+ int foo(int (*callback)(int, int));
+
+ rather than just:
+
+ .. code-block:: c
+
+ int foo(int (*callback)());
+
+- Don't use the ``P*`` macros in new code. (See the Procedures section of `Language extensions`_ below for more information.)
+
+- Always provide an explicit return type for procedures, in both the prototype and the definition: don't rely on the implicit declaration as ``int``.
+
+- Don't use ``float`` as the return type of a procedure, unless there's a special reason. Floating point hardware typically does everything in double precision internally and has to do extra work to convert between double and single precision.
+
+- Don't declare parameters as being of type ``float``, ``short``, or ``char``. If you do this and forget to include the prototype at a call site, ANSI compilers will generate incompatible calling sequences. Use ``double`` instead of ``float``, and use ``int`` or ``uint`` instead of ``short`` or ``char``.
+
+
+Standard library
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Restrictions:
+
+- Only use library features that are documented in the established ANSI standard (e.g., Harbison & Steele's book). Do not use procedures that are "standards" promulgated by Microsoft (e.g., ``stricmp``), or originate in BSD Unix (e.g., ``strcasecmp``), or were added in later versions of the standard such as C 9X.
+
+- Do not use any features from ``stdio.h`` that assume the existence of ``stdin``, ``stdout``, or ``stderr``. See ``gsio.h`` for the full list. Instead, use ``gs_stdin`` *et al*.
+
+
+
+Language extensions
+-----------------------
+
+
+Scoping
+~~~~~~~~~~
+
+``static``
+ Ghostscript assumes the compiler supports the ``static`` keyword for declaring variables and procedures as local to a particular source file.
+
+``inline``
+ ``inline`` is available even if the compiler does not support it. Be aware, however, that it may have no effect. In particular, do not use ``inline`` in header files. Instead, use the ``extern_inline`` facility described just below.
+
+``extern_inline``
+ Compilers that do support ``inline`` vary in how they decide whether to (also) compile a closed-code copy of the procedure. Because of this, putting an ``inline`` procedure in a header file may produce multiple closed copies, causing duplicate name errors at link time. ``extern_inline`` provides a safe way to put ``inline`` procedures in header files, regardless of compiler. Unfortunately, the only way we've found to make this fully portable involves a fair amount of boilerplate. For details, please see ``stdpre.h``.
+
+Scalar types
+~~~~~~~~~~~~~~~~~~
+
+``bool``, ``true``, ``false``
+ ``bool`` is intended as a ``Boolean`` type, with canonical values ``true`` and ``false``. In a more reasonable language, such as Java, ``bool`` is an enumerated type requiring an explicit cast to or from ``int``; however, because C's conditionals are defined as producing ``int`` values, we can't even define ``bool`` as a C ``enum`` without provoking compiler warnings.
+
+ Even though ``bool`` is a synonym for ``int``, treat them as conceptually different types:
+
+ - Initialize or set ``bool`` variables to ``true`` or ``false``, not ``0`` or ``1``.
+
+ - Use the ``Boolean`` operators ``!``, ``&&``, and ``||`` only with ``Booleans``. Don't use the idiom ``!!x`` to create a ``Boolean`` that is true ``iff x != 0``: use ``x != 0``.
+
+ - Use an explicit (``int``) cast to convert a ``Boolean`` to an ``integer``.
+
+``byte``, ``ushort``, ``uint``, ``ulong``
+ These types are simply shorthands for unsigned ``char``, ``short``, ``int``, ``long``.
+
+ In addition, the use of ``byte *`` indicates a Ghostscript-style string, with explicit length given separately, as opposed to a null terminated C-style string, which is ``char *``.
+
+``bits8``, ``bits16``, ``bits32``
+ These are unsigned ``integer`` types of the given width. Use them wherever the actual width matters: do *not*, for example, use short assuming that it is 16 bits wide. New code can use the C99 fixed-width types from ``stdint_.h``.
+
+
+
+.. _Conventions:
+
+
+Stylistic conventions
+--------------------------------
+
+Ghostscript's coding rules cover not only the use of the language, but also many stylistic issues like the choice of names and the use of whitespace. The stylistic rules are meant to produce code that is easy to read. It's important to observe them as much as possible in order to maintain a consistent style, but if you find these rules getting in your way or producing ugly-looking results once in a while, it's OK to break it.
+
+Formatting
+~~~~~~~~~~~~~
+
+Indentation
+"""""""""""""""
+
+We've formatted all of our code using the GNU ``indent`` program.
+
+.. code-block:: bash
+
+ indent -bad -nbap -nsob -br -ce -cli4 -npcs -ncs \
+ -i4 -di0 -psl -lp -lps -nut somefile.c
+
+does a 98% accurate job of producing our preferred style. Unfortunately, there are bugs in all versions of GNU ``indent``, requiring both pre- and post-processing of the code.
+
+Put indentation points every 4 spaces. Never use tab stops!
+
+Don't indent the initial ``#`` of preprocessor commands. However, for nested preprocessor commands, do use indentation between the ``#`` and the command itself. Use 2 spaces per level of nesting, e.g.:
+
+.. code-block:: c
+
+ #ifndef xyz
+ # define xyz 0
+ #endif
+
+For assignments (including chain assignments), put the entire statement on one line if it will fit; if not, break it after a ``=`` and indent all the following lines. I.e., format like this:
+
+.. code-block:: c
+
+ var1 = value;
+ var1 = var2 = value;
+ var1 =
+ value;
+ var1 =
+ var2 = value;
+ var1 = var2 =
+ value;
+
+
+But not like this:
+
+.. code-block:: c
+
+ var1 =
+ var2 = value;
+
+
+
+Indent in-line blocks thus:
+
+.. code-block:: c
+
+ {
+ ... declarations ...
+ {{ blank line if any declarations above }}
+ ... statements ...
+ }
+
+Similarly, indent procedures thus:
+
+.. code-block:: c
+
+ return_type
+ proc_name(... arguments ...)
+ {
+ ... declarations ...
+ {{ blank line if any declarations above }}
+ ... statements ...
+ }
+
+
+If a control construct (if, do, while, or for) has a one-line body, use this:
+
+.. code-block:: c
+
+ ... control construct ...
+ ... subordinate simple statement ...
+
+This is considered particularly important so that a breakpoint can be set inside the conditional easily.
+
+If it has a multi-line body, use this:
+
+.. code-block:: c
+
+ ... control construct ... {
+ ... subordinate code ...
+ }
+
+
+If the subordinate code has declarations, see blocks above.
+
+For if-else statements, do this:
+
+
+.. code-block:: c
+
+ if ( ... ) {
+ ... subordinate code ...
+ } else if ( ... ) {
+ ... subordinate code ...
+ } else {
+ ... subordinate code ...
+ }
+
+
+
+When there are more than two alternatives, as in the example above, use the above ("parallel") syntax rather than the following ("nested") syntax:
+
+
+.. code-block:: c
+
+ if ( ... ) {
+ ... subordinate code ...
+ } else {
+ if ( ... ) {
+ ... subordinate code ...
+ } else {
+ ... subordinate code ...
+ }
+ }
+
+Similarly, for do-while statements, do this:
+
+.. code-block:: c
+
+ do {
+ ... body ...
+ } while ( ... condition ... );
+
+
+
+
+Spaces
+"""""""""""""""
+
+Do put a space:
+
+- After every comma and semicolon, unless it ends a line.
+
+- Around every binary operator other than "``->``" and "``.``", although you can omit the spaces around the innermost operator in a nested expression if you like.
+
+- On both sides of the parentheses of an if, for, or while.
+
+
+Don't put a space:
+
+- At the end of a line.
+
+- Before a comma or semicolon.
+
+- After unary prefix operators.
+
+- Before the parenthesis of a macro or procedure call.
+
+
+
+Parentheses
+"""""""""""""""
+
+Parentheses are important in only a few places:
+
+- Around the inner subexpressions in expressions that mix ``&&`` and ``||``, even if they are not required by precedence, for example:
+ .. code-block:: c
+
+ (xx && yy) || zz
+
+- Similarly around inner subexpressions in expressions that mix ``&``, ``|``, or shifts, especially if mixing these with other operators, for instance:
+ .. code-block:: c
+
+ (x << 3) | (y >> 5)
+
+- In macro definitions around every use of an argument that logically could be an expression, for example:
+ .. code-block:: c
+
+ ((x) * (x) + (y) * (y))
+
+
+Anywhere else, given the choice, use fewer parentheses.
+
+
+
+
+For stylistic consistency with the existing Ghostscript code, put parentheses around conditional expressions even if they aren't syntactically required, unless you really dislike doing this. Note that the parentheses should go around the entire expression, not the condition. For instance, instead of:
+
+.. code-block:: c
+
+ hpgl_add_point_to_path(pgls, arccoord_x, arccoord_y,
+ (pgls->g.pen_down) ? gs_lineto : gs_moveto);
+
+use:
+
+.. code-block:: c
+
+ hpgl_add_point_to_path(pgls, arccoord_x, arccoord_y,
+ (pgls->g.pen_down ? gs_lineto : gs_moveto));
+
+
+
+
+
+
+Preprocessor
+~~~~~~~~~~~~~~
+
+Conditionals
+""""""""""""""
+
+Using preprocessor conditionals can easily lead to unreadable code, since the eye really wants to read linearly rather than having to parse the conditionals just to figure out what code is relevant. It's OK to use conditionals that have small scope and that don't change the structure or logic of the program (typically, they select between different sets of values depending on some configuration parameter), but where possible, break up source modules rather than use conditionals that affect the structure or logic.
+
+Macros
+"""""""""""""
+
+Ghostscript code uses macros heavily to effectively extend the rather weak abstraction capabilities of the C language, specifically in the area of memory management and garbage collection: in order to read Ghostscript code effectively, you simply have to learn some of these macros as though they were part of the language. The current code also uses macros heavily for other purposes, but we are trying to phase these out as rapidly as possible, because they make the code harder to read and debug, and to use the rules that follow consistently in new code.
+
+Define macros in the smallest scope you can manage (procedure, file, or ``.h`` file), and ``#undef`` them at the end of that scope: that way, someone reading the code can see the definitions easily when reading the uses. If that isn't appropriate, define them in as large a scope as possible, so that they effectively become part of the language. This places an additional burden on the reader, but it can be amortized over reading larger amounts of code.
+
+Try hard to use procedures instead of macros. Use "``inline``" if you really think the extra speed is needed, but only within a ``.c`` file: don't put inline procedures in ``.h`` files, because most compilers don't honor "``inline``" and you'll wind up with a copy of the procedure in every ``.c`` file that includes the ``.h`` file.
+
+If you define a macro that looks like a procedure, make sure it will work wherever a procedure will work. In particular, put parentheses around every use of an argument within the macro body, so that the macro will parse correctly if some of the arguments are expressions, and put parentheses around the entire macro body. (This is still subject to the problem that an argument may be evaluated more than once, but there is no way around this in C, since C doesn't provide for local variables within expressions.)
+
+If you define macros for special loop control structures, make their uses look somewhat like ordinary loops, for instance:
+
+
+.. code-block:: c
+
+ BEGIN_RECT(xx, yy) {
+ ... body indented one position ...
+ } END_RECT(xx, yy);
+
+
+
+If at all possible, don't use free variables in macros -- that is, variables that aren't apparent as arguments of the macro. If you must use free variables, list them all in a comment at the point where the macro is defined.
+
+If you define new macros or groups of macros, especially if they aren't simply inline procedures or named constant values, put some extra effort into documenting them, to compensate for the fact that macros are intrinsically harder to understand than procedures.
+
+
+Comments
+~~~~~~~~~~~~~~
+
+The most important descriptive comments are ones in header files that describe structures, including invariants; but every procedure or structure declaration, or group of other declarations, should have a comment. Don't spend a lot of time commenting executable code unless something unusual or subtle is going on.
+
+Naming
+~~~~~~~~~~~~~~
+
+Use fully spelled-out English words in names, rather than contractions. This is most important for procedure and macro names, global variables and constants, values of ``#define`` and ``enum``, ``struct`` and other ``typedef`` names, and structure member names, and for argument and variable names which have uninformative types like ``int``. It's not very important for arguments or local variables of distinctive types, or for local index or count variables.
+
+Avoid names that run English words together: "``hpgl_compute_arc_center``" is better than "``hpgl_compute_arccenter``". However, for terms drawn from some predefined source, like the names of PostScript operators, use a term in its well-known form (for instance, ``gs_setlinewidth`` rather than ``gs_set_line_width``).
+
+Procedures, variables, and structures visible outside a single ``.c`` file should generally have prefixes that indicate what subsystem they belong to (in the case of Ghostscript, ``gs_`` or ``gx_``). This rule isn't followed very consistently.
+
+
+Types
+~~~~~~~~~~~~~~
+
+Many older structure names don't have ``_t`` on the end, but this suffix should be used in all new code. (The ``_s`` structure name is needed only to satisfy some debuggers. No code other than the structure declaration should refer to it.)
+
+Declare structure types that contain pointers to other instances of themselves like this:
+
+.. code-block:: c
+
+ typedef struct xxx_s xxx_t;
+ struct xxx_s {
+ ... members ...
+ xxx_t *ptr_member_name;
+ ... members ...
+ };
+
+
+If, to maintain data abstraction and avoid including otherwise unnecessary header files, you find that you want the type ``xxx_t`` to be available in a header file that doesn't include the definition of the structure ``xxx_s``, use this approach:
+
+
+.. code-block:: c
+
+ #ifndef xxx_DEFINED
+ # define xxx_DEFINED
+ typedef struct xxx_s xxx_t;
+ #endif
+ struct xxx_s {
+ ... members ...
+ };
+
+
+You can then copy the first 4 lines in other header files. (Don't ever include them in an executable code file.)
+
+Don't bother using ``const`` for anything other than with pointers as described below. However, in those places where it is necessary to cast a pointer of type ``const T *`` to type ``T *``, always include a comment that explains why you are "breaking const".
+
+Pointers
+"""""""""""""""""""""
+
+Use ``const`` for pointer referents (that is, ``const T *``) wherever possible and appropriate.
+
+If you find yourself wanting to use ``void *``, try to find an alternative using unions or (in the case of super- and subclasses) casts, unless you're writing something like a memory manager that really treats memory as opaque.
+
+
+
+
+Procedures
+~~~~~~~~~~~~~~~~~~~~~~~
+
+In general, don't create procedures that are private and only called from one place. However, if a compound statement (especially an arm of a conditional) is too long for the eye easily to match its enclosing braces "``{...}``" -- that is, longer than 10 or 15 lines -- and it doesn't use or set a lot of state held in outer local variables, it may be more readable if you put it in a procedure.
+
+Miscellany
+""""""""""""""""
+
+Local variables
+^^^^^^^^^^^^^^^^^^^^^
+
+Don't assign new values to procedure parameters. It makes debugging very confusing when the parameter values printed for a procedure are not the ones actually supplied by the caller. Instead use a separate local variable initialized to the value of the parameter.
+
+If a local variable is only assigned a value once, assign it that value at its declaration, if possible. For example,
+
+.. code-block:: c
+
+ int x = some expression ;
+
+rather than:
+
+.. code-block:: c
+
+ int x;
+ ...
+ x = some expression ;
+
+Use a local pointer variable like this to "narrow" pointer types:
+
+.. code-block:: c
+
+ int
+ someproc(... gx_device *dev ...)
+ {
+ gx_device_printer *const pdev = (gx_device_printer *)dev;
+ ...
+ }
+
+Don't "shadow" a local variable or procedure parameter with an inner local variable of the same name. I.e., don't do this:
+
+.. code-block:: c
+
+ int
+ someproc(... int x ...)
+ {
+ ...
+ int x;
+ ...
+ }
+
+
+
+Compiler warnings
+~~~~~~~~~~~~~~~~~~~~~~~
+
+We want Ghostscript to compile with no warnings. This is a constant battle as compilers change and new code is added. Work hard to eliminate warnings by improving the code structure instead of patching over them. If the compiler can't figure out that a variable is always initialized, a future reader will probably have trouble as well.
+
+
+
+
+File structuring
+--------------------
+
+All files
+~~~~~~~~~~~~~~~~~~
+
+Keep file names within the "8.3" format for portability:
+
+- Use only letters, digits, dash, and underscore in file names.
+
+- Don't assume upper and lower case letters are distinct.
+
+- Put no more than 8 characters before the ".", if any.
+
+- If there is a ".", put between 1 and 3 characters after the ".".
+
+For files other than documentation files, use only lower case letters in the names; for HTML documentation files, capitalize the first letter.
+
+Every code file should start with comments containing:
+
+#. A copyright notice.
+
+#. The name of the file in the form of an RCS Id:
+
+.. code-block::
+
+ /* $Id: filename.ext $*/
+
+(using the comment convention appropriate to the language of the file), and
+
+3. A summary, no more than one line, of what the file contains.
+
+If you create a file by copying the beginning of another file, be sure to update the copyright year and change the file name.
+
+
+
+.. _CStyle_Makefiles:
+
+Makefiles
+~~~~~~~~~~~~~~~~~~
+
+
+Use the extension ``.mak`` for ``makefiles``.
+
+For each:
+
+.. code-block:: c
+
+ #include "xxx.h"
+
+make sure there is a dependency on ``$(xxx_h)`` in the makefile. If ``xxx`` ends with a "``_``", this rule still holds, so that if you code:
+
+.. code-block:: c
+
+ #include "math_.h"
+
+the ``makefile`` must contain a dependency on "``$(math__h)``" (note the two underscores "``__``").
+
+List the dependencies bottom-to-top, like the ``#include`` statements themselves; within each level, list them alphabetically. Do this also with ``#include`` statements themselves whenever possible (but sometimes there are inter-header dependencies that require bending this rule).
+
+For compatibility with the build utilities on OpenVMS, always put a space before the colon that separates the target(s) of a rule from the dependents.
+
+
+General C code
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+List ``#include`` statements from "bottom" to "top", that is, in the following order:
+
+#. System includes ("``xxx_.h``").
+
+#. ``gs*.h``
+
+#. ``gx*.h`` (yes, ``gs`` and ``gx`` are in the wrong order).
+
+#. ``s*.h``
+
+#. ``i*.h`` (or other interpreter headers that don't start with "``i``").
+
+
+Headers (.h files)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In header files, always use the following at the beginning of a header file to prevent double inclusion:
+
+.. code-block:: c
+
+ {{ Copyright notice etc. }}
+
+ #ifndef <filename>_INCLUDED
+ #define <filename>_INCLUDED
+
+ {{ The contents of the file }}
+
+ #endif /* <filename>_INCLUDED */
+
+
+The header file is the first place that a reader goes for information about procedures, structures, constants, etc., so ensure that every procedure and structure has a comment that says what it does. Divide procedures into meaningful groups set off by some distinguished form of comment.
+
+
+
+Source (.c files)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+After the initial comments, arrange C files in the following order:
+
+#. ``#include`` statements.
+
+#. Exported data declarations.
+
+#. Explicit externs (if necessary).
+
+#. Forward declarations of procedures.
+
+#. Private data declarations.
+
+#. Exported procedures.
+
+#. Private procedures.
+
+
+Be flexible about the order of the declarations if necessary to improve readability. Many older files don't follow this order, often without good reason.
+
+
+Ghostscript conventions
+-----------------------------
+
+Specific names
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The Ghostscript code uses certain names consistently for certain kinds of values. Some of the commonest and least obvious are these two:
+
+
+
+code
+"""""""
+
+A value to be returned from a procedure.
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 0
+
+ * - < 0
+ - An error code defined in ``gserrors.h`` (or ``ierrors.h``)
+ * - 0
+ - Normal return
+ * - > 0
+ - A non-standard but successful return (which must be documented, preferably with the procedure's prototype)
+
+
+
+status
+"""""""
+
+A value returned from a *stream* procedure.
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 0
+
+ * - < 0
+ - An exceptional condition as defined in ``scommon.h``
+ * - 0
+ - Normal return (or, from the "process" procedure, means that more input is needed)
+ * - 1
+ - More output space is needed (from the "process" procedure)
+
+
+
+
+Structure type descriptors
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The Ghostscript memory manager requires run-time type information for every structure. (We don't document this in detail here: see the :ref:`Structure descriptors<Develop_Structure_Descriptors>` section of the developer documentation for details.) Putting the descriptor for a structure next to the structure definition will help keep the two consistent, so immediately after the definition of a structure ``xxx_s``, define its structure descriptor:
+
+.. code-block:: c
+
+ struct xxx_s {
+ ... members ...
+ };
+ #define private_st_xxx() /* in <filename>.c */\
+ gs_private_st_<whatever>(st_xxx, xxx_t,\
+ "xxx_t", xxx_enum_ptrs, xxx_reloc_ptrs,\
+ ... additional parameters as needed ...)
+
+The file that implements operations on this structure (``<filename>.c``) should then include, near the beginning, the line:
+
+
+.. code-block:: c
+
+ private_st_xxx();
+
+
+In much existing code, structure descriptors are declared as public, which allows clients to allocate instances of the structure directly. We now consider this bad design. Instead, structure descriptors should always be static; the implementation file should provide one or more procedures for allocating instances, e.g.,
+
+.. code-block:: c
+
+ xxx_t *gs_xxx_alloc(P1(gs_memory_t *mem));
+
+
+If it is necessary to make a structure descriptor public, it should be declared in its clients as:
+
+.. code-block:: c
+
+ extern_st(st_xxx);
+
+
+.. _CStyle_Objects:
+
+
+"Objects"
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript makes heavy use of object-oriented constructs, including analogues of classes, instances, subclassing, and class-associated procedures. However, these constructs are implemented in C rather than C++, for two reasons:
+
+The first Ghostscript code was written in 1986, long before C++ was codified or was well supported by tools. Even today, C++ tools rarely support C++ as well as C tools support C.
+
+C++ imposes its own implementations for virtual procedures, inheritance, run-time type information, and (to some extent) memory management. Ghostscript requires use of its own memory manager, and also sometimes requires the ability to change the virtual procedures of an object dynamically.
+
+Classes
+"""""""""
+
+The source code representation of a class is simply a ``typedef`` for a C ``struct``. See Structures_, above, for details.
+
+Procedures
+"""""""""""
+
+Ghostscript has no special construct for non-virtual procedures associated with a class. In some cases, the ``typedef`` for the class is in a header file but the struct declaration is in the implementation code file: this provides an extra level of opaqueness, since clients then can't see the representation and must make all accesses through procedures. You should use this approach in new code, if it doesn't increase the size of the code too much or require procedure calls for very heavily used accesses.
+
+Ghostscript uses three different approaches for storing and accessing virtual procedures, plus a fourth one that is recommended but not currently used. For exposition, we assume the class (type) is named ``xxx_t``, it has a virtual procedure ``void (*virtu)(P1(xxx_t *))``, and we have a variable declared as ``xxx_t *pxx``.
+
+
+
+#. The procedures are stored in a separate, constant structure of type ``xxx_procs``, of which ``virtu`` is a member. The structure definition of ``xxx_t`` includes a member defined as ``const xxx_procs *procs`` (always named ``procs``). The construct for calling the virtual procedure is ``pxx->procs->virtu(pxx)``.
+
+#. The procedures are defined in a structure of type ``xxx_procs`` as above. The structure definition of ``xxx_t`` includes a member defined as ``xxx_procs procs`` (always named ``procs``). The construct for calling the virtual procedure is ``pxx->procs.virtu(pxx)``.
+
+#. The procedures are not defined in a separate structure: each procedure is a separate member of ``xxx_t``. The construct for calling the virtual procedure is ``pxx->virtu(pxx)``.
+
+#. The procedures are defined in a structure of type ``xxx_procs`` as above. The structure definition of ``xxx_t`` includes a member defined as ``xxx_procs procs[1]`` (always named ``procs``). The construct for calling the virtual procedure is again ``pxx->procs->virtu(pxx)``.
+
+Note that in approach 1, the procedures are in a shared constant structure; in approaches 2 - 4, they are in a per-instance structure that can be changed dynamically, which is sometimes important.
+
+In the present Ghostscript code, approach 1 is most common, followed by 2 and 3; 4 is not used at all. For new code, you should use 1 or 4: that way, all virtual procedure calls have the same form, regardless of whether the procedures are shared and constant or per-instance and mutable.
+
+Subclassing
+""""""""""""""""""
+
+Ghostscript's class mechanism allows for subclasses that can add data members, or can add procedure members if approach 1 or 3 (above) is used. Since C doesn't support subclassing, we use a convention to accomplish it. In the example below, ``gx_device`` is the root class; it has a subclass ``gx_device_forward``, which in turn has a subclass ``gx_device_null``. First we define a macro for all the members of the root class, and the root class type. (As for structures in general, classes need a structure descriptor, as discussed in Structures_ above: we include these in the examples below.)
+
+
+.. code-block:: c
+
+ #define gx_device_common\
+ type1 member1;\
+ ...
+ typeN memberN
+
+ typedef struct gx_device_s {
+ gx_device_common;
+ } gx_device;
+
+ #define private_st_gx_device() /* in gsdevice.c */\
+ gs_private_st_<whatever>(st_gx_device, gx_device,\
+ "gx_device", device_enum_ptrs, device_reloc_ptrs,\
+ ... additional parameters as needed ...)
+
+
+We then define a similar macro and type for the subclass.
+
+
+.. code-block:: c
+
+ #define gx_device_forward_common\
+ gx_device_common;\
+ gx_device *target
+
+ typedef struct gx_device_forward_s {
+ gx_device_forward_common;
+ } gx_device_forward;
+
+ #define private_st_device_forward() /* in gsdevice.c */\
+ gs_private_st_suffix_add1(st_device_forward, gx_device_forward,\
+ "gx_device_forward", device_forward_enum_ptrs, device_forward_reloc_ptrs,\
+ gx_device, target)
+
+
+Finally, we define a leaf class, which doesn't need a macro because we don't currently subclass it. (We can create the macro later if needed, with no changes anywhere else.) In this particular case, the leaf class has no additional data members, but it could have some.
+
+
+.. code-block:: c
+
+ typedef struct gx_device_null_s {
+ gx_device_forward_common;
+ };
+
+ #define private_st_device_null() /* in gsdevice.c */\
+ gs_private_st_suffix_add0_local(st_device_null, gx_device_null,\
+ "gx_device_null", device_null_enum_ptrs, device_null_reloc_ptrs,\
+ gx_device_forward)
+
+
+.. note::
+
+ The above example is not the actual definition of the ``gx_device`` structure type: the actual type has some additional complications because it has a finalization procedure. See ``base/gxdevcli.h`` for the details.
+
+If you add members to a root class (such as ``gx_device`` in this example), or change existing members, do this in the ``gx_device_common`` macro, not the ``gx_device`` structure definition. Similarly, to change the ``gx_device_forward`` class, modify the ``gx_device_forward_common`` macro, not the structure definition. Only change the structure definition if the class is a leaf class (one with no ``_common`` macro and no possibility of subclassing), like ``gx_device_null``.
+
+
+Error handling
+~~~~~~~~~~~~~~~~~~~~~~
+
+Every caller should check for error returns and, in general, propagate them to its callers. By convention, nearly every procedure returns an ``int`` to indicate the outcome of the call:
+
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 0
+
+ * - < 0
+ - Error return
+ * - 0
+ - Normal return
+ * - > 0
+ - Non-error return other than the normal case
+
+
+
+To make a procedure generate an error and return it, as opposed to propagating an error generated by a lower procedure, you should use:
+
+
+.. code-block:: c
+
+ return_error(error_number);
+
+
+Sometimes it is more convenient to generate the error in one place and return it in another. In this case, you should use:
+
+
+.. code-block:: c
+
+ code = gs_note_error(error_number);
+ ...
+ return code;
+
+In executables built for debugging, the ``-E`` (or ``-Z#``) command line switch causes ``return_error`` and ``gs_note_error`` to print the error number and the source file and line: this is often helpful for identifying the original cause of an error.
+
+See the file ``base/gserrors.h`` for the error return codes used by the graphics library, most of which correspond directly to PostScript error conditions.
+
+
+
+
+
+
+
+
+.. include:: footer.rst
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/src/Develop.rst b/doc/src/Develop.rst
new file mode 100644
index 00000000..97131f2e
--- /dev/null
+++ b/doc/src/Develop.rst
@@ -0,0 +1,1650 @@
+.. title:: Information for Ghostscript Developers
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Develop.htm:
+.. _Ghostscript Developers:
+
+
+Information for Ghostscript Developers
+======================================
+
+
+Introduction
+------------------------------------
+This document provides a wealth of information about Ghostscript's internals, primarily for developers actively working on Ghostscript. It is primarily **descriptive**, documenting the way things are; the companion :ref:`C style guide<C-style.htm>` is primarily **prescriptive**, documenting what developers should do when writing new code.
+
+
+Architecture
+------------------------------------
+
+
+
+Design Goals
+~~~~~~~~~~~~~~~
+Ghostscript has the following high-level design goals (not listed in order
+of importance):
+
+Functionality
+""""""""""""""""
+
+ - Ability to interpret the current PostScript and PDF languages, as defined (and occasionally, in the case of conflict, as implemented) by Adobe.
+
+ - Ability to convert PostScript to and from PDF, comparable to Adobe products.
+
+ - Ability to produce output for a wide range of resolutions (from TV-resolution displays to imagesetters) and color models (black and white, multilevel gray, bilevel or multi-level RGB and CMYK, 6- or 8-color inkjet printers, spot color).
+
+Performance
+""""""""""""""""
+
+ - Ability to render PostScript and PDF with commercial-quality performance (memory usage, speed, and output quality) on all platforms.
+
+ - Specifically, ability to render PostScript effectively in embedded environments with constrained RAM, including the ability to put the code and supporting data in ROM.
+
+Licensing
+""""""""""""""""
+
+ - Licensing that supports both the Open Source / Free software communities and a commercial licensing business.
+
+ - Freedom from licensing restrictions or fees imposed by third parties.
+
+Other
+""""""""""""""""
+
+ - Easy source portability to any platform (CPU, operating system, and development tools) that has an ANSI C compiler.
+
+ - Support for writing new interpreters and new drivers with no change to any existing code; specifically, ability to support PCL 5e, PCL 5c, and PCL XL interpreters, and the ever-changing roster of inkjet printers.
+
+
+These goals often conflict: part of Ghostscript's claim to quality is that the conflicts have been resolved well.
+
+
+
+Design principles
+------------------------
+
+Part of what has kept Ghostscript healthy through many years of major code revisions and functional expansion is consistent and conscientious adherence to a set of design principles. We hope the following list captures the most important ones.
+
+Non-preemption
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript is designed to be used as a component. As such, it must share its environment with other components. Therefore, it must not require ownership of, or make decisions about, inherently shared resources. Specifically, it must not assume that it can "own" either the locus of control or the management of the address space.
+
+Not owning control means that whenever Ghostscript passes control to its caller, it must do so in a way that doesn't constrain what the caller can do next. The caller must be able to call any other piece of software, wait for an external event, execute another task, etc., without having to worry about Ghostscript being in an unknown state. While this is easy to arrange in a multi-threaded environment (by running Ghostscript in a separate thread), multi-threading APIs are not well standardized at this time (December 2000), and may not be implemented efficiently, or at all, on some platforms. Therefore, Ghostscript must choose between only two options for interacting with its caller: to return, preserving its own state in data structures, or to call back through a caller-supplied procedure. Calling back constrains the client program unacceptably: the callback procedure only has the options of either returning, or aborting Ghostscript. In particular, if it wants (for whatever reason) to multi-task Ghostscript with another program, it cannot do so in general, especially if the other program also uses callback rather than suspension. Therefore, Ghostscript tries extremely hard to return, rather than calling back, for all caller interaction. In particular:
+
+- For callers that want to pass input to Ghostscript piece by piece, Ghostscript returns with an ``gs_error_NeedInput`` code rather than using a callback. This allows the caller complete flexibility in its control structure for managing the source of input. (It might, for example, be generating the input dynamically).
+
+- In the future, the same arrangement should be used for input from ``stdin`` and output to ``stdout`` and ``stderr``.
+
+- Likewise, scheduling of Ghostscript's own threads (contexts), currently done with a callback, should be done with suspension. The Display Ghostscript project (GNU DGS) is working on this.
+
+The one area where suspension is not feasible with Ghostscript's current architecture is device output. Device drivers are called from deep within the graphics library. (If Ghostscript were being redesigned from scratch, we might try to do this with suspension as well, or at least optional suspension.)
+
+
+Not owning management of the address space means that even though Ghostscript supports garbage collection for its own data, it must not do any of the things that garbage collection schemes for C often require: it must not replace 'malloc' and 'free', must not require its clients to use its own allocator, must not rely on manipulating the read/write status of memory pages, must not require special compiler or run-time support (e.g., APIs for scanning the C stack), must not depend on the availability of multi-threading, and must not take possession of one of a limited number of timer interrupts. However, in order not to constrain its own code unduly, it must also not require using special macros or calls to enter or leave procedures or assign pointers, and must not constrain the variety of C data structures any more than absolutely necessary. It achieves all of these goals, at the expense of some complexity, some performance cost (mostly for garbage collection), and some extra manual work required for each structure type allocated by its allocator. The details appear in the `Memory management`_ section below.
+
+Multi-instantiability
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+From many years of experience with the benefits of object-oriented design, we have learned that when the word "the" appears in a software design -- "the" process scheduler, "the" memory manager, "the" output device, "the" interpreter, "the" stack -- it often flags an area in which the software will have difficulty adapting to future needs. For this reason, Ghostscript attempts to make every internal structure capable of existing in multiple instances. For example, Ghostscript's memory manager is not a one-of-a-kind entity with global state and procedures: it is (or rather they are, since Ghostscript has multiple memory managers, some of which have multiple instances) objects with their own state and (virtual) procedures. Ghostscript's PostScript interpreter has no writable non-local data (necessary, but not sufficient, to allow multiple instances), and in the future will be extended to be completely reentrant and instantiable. The device driver API is designed to make this easy for drivers as well. The graphics library is currently not completely reentrant or instantiable: we hope this will occur in the future.
+
+Late configuration binding
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript is designed to make configuration choices as late as possible, subject to simplicity and performance considerations. The major binding times for such choices are compilation, linking, startup, and dynamic.
+
+- Compilation binds only CPU and compiler characteristics (including data type size, presence of floating point hardware, and data alignment), and whether the code will be used for production, debugging, or profiling.
+- Linking binds the choice of what features and device drivers will be included in the executable. (Work is underway to make the choice of drivers dynamic).
+- Startup binds essentially nothing. Almost every option and parameter that can appear on the command line can also be changed dynamically.
+- The selection of output device, all parameters associated with the device, the selection of debugging printout and self-checking (in debugging configurations), the macro-allocation of memory, and almost all other operational parameters are dynamic.
+
+
+In addition, a number of major implementation decisions are made dynamically depending on the availability of resources. For example, Ghostscript chooses between banded and non-banded rendering depending on memory availability.
+
+
+Large-scale structure
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+At the largest design scale, Ghostscript consists of 4 layers. Layer N is allowed to use the facilities of all layers M <= N.
+
+#. The bottom layer is called the substrate. It includes facilities like memory management, streams, fixed-point arithmetic, and low-level interfaces to the operating system. The substrate is written in C, with a little C++ and/or assembler code for some platforms.
+
+#. The layer above the substrate is the graphics layer. It consists of two separate sub-parts. The graphics layer is written in C.
+
+ - The graphics library manages graphics state information for, and decomposes and renders 2-D images described using, a graphics model that is approximately the union of those of PostScript, PDF, and PCL 5e/5c/XL.
+
+ - The device drivers are called by the graphics library to produce actual output. The graphics library, and all higher layers, call device driver procedures only through virtual functions.
+
+#. The principal clients of the graphics layer are language interpreters. Ghostscript as distributed includes the PostScript interpreter; there are also interpreters for PCL 5e, PCL 5c, and PCL XL, which are not currently freely redistributable and are not included in the standard Ghostscript package. The PostScript interpreter is written partly in C and partly in PostScript.
+
+#. The PDF interpreter is actually a client of the PostScript interpreter: it is written entirely in PostScript.
+
+The most important interface in Ghostscript is the API between the graphics library and the device drivers: new printers (and, to a lesser extent, window systems, displays, plotters, film recorders, and graphics file formats) come on the scene frequently, and it must be possible to produce output for them with a minimum of effort and distruption. This API is the only one that is extensively documented (see :ref:`Drivers<Drivers.htm>`) and kept stringently backward-compatible through successive releases.
+
+
+Object-oriented constructs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript makes heavy use of object-oriented constructs, including analogues of classes, instances, subclassing, and class-associated procedures. Since Ghostscript is written in C, not C++, implementing these constructs requires following coding conventions. The :ref:`"Objects"<CStyle_Objects>` section of the :ref:`C style guide<C-style.htm>` explains these.
+
+The memory manager API provides run-time type information about each class, but this information does not include anything about subclassing. See under :ref:`Structure descriptors<Develop_Structure_Descriptors>` below.
+
+
+
+
+
+
+File roadmap
+----------------------
+
+
+This section of the document provides a roadmap to all of the Ghostscript source files.
+
+Substrate
+~~~~~~~~~~~~~~
+
+Runtime Context
+""""""""""""""""""""
+
+The ``libctx`` provides pointers to memory, ``stdio``, and various other runtime portablility services:
+ base/gslibctx.h, base/gslibctx.c
+
+Memory manager
+""""""""""""""""""""
+
+See `Memory Management`_
+
+Streams
+""""""""""""""""""""
+
+Framework, file and string streams:
+ base/gsdsrc.c, base/gsdsrc.h, base/scommon.h, base/strmio.c, base/strmio.h, base/sfxboth.c, base/sfxfd.c, base/sfxstdio.c, base/sfxcommon.c, base/stream.h, base/stream.c, base/strimpl.h.
+
+
+Standard filters:
+
+ CCITTFax:
+ base/scf.h, base/scfd.c, base/scfdgen.c, base/scfdtab.c, base/scfe.c, base/scfetab.c, base/scfparam.c, base/scfx.h.
+
+ DCT (JPEG):
+ base/gsjconf.h, base/gsjmorec.h, base/sdcparam.c, base/sdcparam.h, base/sdct.h, base/sdctc.c, base/sdctd.c, base/sdcte.c, base/sddparam.c, base/sdeparam.c, base/sjpeg.h, base/sjpegc.c, base/sjpegd.c, base/sjpege.c.
+
+ JBIG2:
+ base/sjbig2.h, base/sjbig2.c
+
+ JPX (JPEG 2000):
+ base/sjpx_openjpeg.h, base/sjpx_openjpeg.c
+
+ Other compression/decompression:
+ base/slzwc.c, base/slzwd.c, base/slzwe.c, base/slzwx.h, base/srld.c, base/srle.c, base/srlx.h.
+
+ Other:
+ base/sa85d.c, base/sa85d.h, base/sa85x.h, psi/sfilter1.c, base/sfilter2.c, base/sstring.c, base/sstring.h.
+
+
+
+Non-standard filters used to implement standard filters:
+ base/seexec.c, base/sfilter.h, base/shc.c, base/shc.h, base/spdiff.c, base/spdiffx.h, base/spngp.c, base/spngpx.h, base/szlibc.c, base/szlibd.c, base/szlibe.c, base/szlibx.h, base/szlibxx.h.
+
+Non-standard filters:
+ base/sbcp.c, base/sbcp.h, base/sbtx.h, base/smd5.c, base/smd5.h, base/saes.c, base/saes.h, base/sarc4.c, base/sarc4.h,
+
+Internal filters:
+ base/siinterp.c, base/siinterp.h, base/siscale.c, base/siscale.h, base/sidscale.c, base/sidscale.h, base/sisparam.h.
+
+Higher-level stream support:
+ base/spprint.c, base/spprint.h, base/spsdf.c, base/spsdf.h, base/srdline.h.
+
+
+Platform-specific code
+""""""""""""""""""""""""""""""""""""""""
+
+See `Cross-platform APIs`_.
+
+Miscellaneous
+""""""""""""""""""""""""""""""""""""""""
+
+Library top level:
+ base/gsinit.c, base/gslib.h.
+
+Configuration-related:
+ base/gconf.c, base/gconf.h, base/gscdef.c, base/gscdefs.h, base/gsromfs0.c.
+
+Arithmetic:
+ base/gxarith.h, base/gxdda.h, base/gxfarith.h, base/gxfixed.h, base/gxfrac.h.
+
+Operating system interface:
+ base/gserrors.h, base/gsexit.h, base/gxstdio.h, base/gxsync.c, base/gxsync.h.
+
+Other:
+ base/gsargs.c, base/gsargs.h, base/gserrors.h, base/gsnotify.c, base/gsnotify.h, base/gsrect.h, base/gstypes.h, base/gsuid.h, base/gsutil.h, base/gsutil.c, base/gx.h, base/gsmd5.c, base/gsmd5.h, base/aes.c, base/aes.h.
+
+
+Graphics library
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. _Graphics library_Support:
+
+Support
+""""""""""
+
+Bitmap processing:
+ base/gsbitcom.c, base/gsbitmap.h, base/gsbitops.c, base/gsbitops.h, base/gsbittab.c, base/gsbittab.h, base/gsflip.c, base/gsflip.h, base/gxbitmap.h, base/gxbitops.h, base/gxsample.c, base/gxsample.h. base/gxsamplp.h.
+
+Functions:
+ base/gsfunc.c, base/gsfunc.h, base/gsfunc0.c, base/gsfunc0.h, base/gsfunc3.c, base/gsfunc3.h, base/gsfunc4.c, base/gsfunc4.h, base/gxfunc.h.
+
+Parameter lists:
+ base/gscparam.c, base/gsparam.c, base/gsparam.h, base/gsparam2.c (not used), base/gsparams.c, base/gsparams.h, base/gsparamx.c, base/gsparamx.h.
+
+I/O-related:
+ base/gdevpipe.c, base/gsfname.c, base/gsfname.h, base/gsio.h, base/gsiodev.c, base/gsiodevs.c, base/gsiodisk.c, base/gsiorom.c. base/gsiorom.h. base/gxiodev.h.
+
+
+Paths
+""""""""""
+
+Coordinate transformation:
+ base/gscoord.c, base/gscoord.h, base/gsmatrix.c, base/gsmatrix.h, base/gxcoord.h, base/gxmatrix.h.
+
+Path building:
+ base/gsdps1.c, base/gspath.c, base/gspath.h, base/gspath1.c, base/gspath2.h, base/gxpath.c, base/gxpath.h, base/gxpath2.c, base/gxpcopy.c, base/gxpdash.c, base/gxpflat.c, base/gzpath.h.
+
+Path rendering:
+ base/gdevddrw.c, base/gdevddrw.h, base/gxdtfill.h, base/gsdps1.c, base/gspaint.c, base/gspaint.h, base/gspenum.h, base/gxfill.c, base/gxfill.h, base/gxfillsl.h, base/gxfilltr.h, base/gxfillts.h, base/gximask.c, base/gximask.h, base/gxfdrop.c, base/gxfdrop.h, base/gxpaint.c, base/gxpaint.h, base/gxstroke.c, base/gzspotan.c, base/gzspotan.h.
+
+Clipping:
+ See under `Clipping`_ below.
+
+Text
+""""""""""
+
+Fonts, generic:
+ base/gsfont.c, base/gsfont.h, devices/gxfcopy.c, devices/gxfcopy.h, base/gxfont.h.
+
+Fonts, specific FontTypes:
+ base/gsfcid.c, base/gsfcid.c, base/gsfcmap.c, base/gsfcmap1.c, base/gsfcmap.h, base/gsfont0.c, base/gsfont0c.c, base/gxcid.h, base/gxfcid.h, base/gxfcmap.h, base/gxfcmap1.h, base/gxfont0.h, base/gxfont0c.h, base/gxfont1.h, base/gxfont42.h, base/gxftype.h, base/gxttf.h.
+
+Character rendering + font cache, generic:
+ base/gsccode.h, base/gschar.c, base/gschar.h, base/gscpm.h, base/gsgdata.c, base/gsgdata.h, base/gsgcache.c, base/gsgcache.h, base/gstext.c, base/gstext.h, base/gxbcache.c, base/gxbcache.h, base/gxccache.c, base/gxccman.c, base/gxchar.c, base/gxchar.h, base/gxfcache.h, base/gxtext.h.
+
+Character rendering, specific FontTypes:
+ base/gschar0.c, base/gscrypt1.c, base/gscrypt1.h, base/gstype1.c, base/gstype1.h, base/gstype2.c, base/gstype42.c, base/gxchrout.c, base/gxchrout.h, base/gxhintn.h, base/gxhintn.c, base/gxhintn1.c, base/gxtype1.c, base/gxtype1.h.
+
+
+Images
+""""""""""
+
+Buffered API (mostly for PostScript interpreter):
+ base/gsimage.c, base/gsimage.h.
+
+Generic support:
+ base/gsiparam.h, base/gxiclass.h, base/gximage.c, base/gximage.h, base/gxiparam.h.
+
+Type 1 and 4 images:
+
+ Setup:
+ base/gsiparm4.h, base/gximage1.c, base/gximage4.c.
+
+ Rendering:
+ base/gxi12bit.c, base/gxi16bit.c, base/gxicolor.c, base/gxidata.c, base/gxifast.c, base/gximono.c, base/gxino12b.c, base/gxino16b.c, base/gxipixel.c, base/gxiscale.c.
+
+Type 2 images (Display PostScript):
+ base/gsiparm2.h, base/gximage2.c.
+
+Type 3 images:
+ base/gsipar3x.h, base/gsiparm3.h, base/gximag3x.c, base/gximag3x.h, base/gximage3.c, base/gximage3.h.
+
+Other:
+ base/gsimpath.c, base/simscale.c, base/simscale.h.
+
+Paint
+""""""""""
+
+Ghostscript uses 4 internal representations of color. We list them here in the order in which they occur in the rendering pipeline.
+
+#. Clients of the graphics library normally specify colors using the client color structure (``gs_client_color``, defined in psi/gs.color.h), consisting of one or more numeric values and/or a pointer to a Pattern instance. This corresponds directly to the values that would be passed to the PostScript setcolor operator: one or more (floating-point) numeric components and/or a Pattern. Client colors are interpreted relative to a color space (``gs_color_space``, defined in base/gscspace.h and base/gxcspace.h, with specific color spaces defined in other files). Client colors do not explicitly reference the color space in which they are are interpreted: setcolor uses the color space in the graphics state, while images and shadings explicitly specify the color space to be used.
+
+#. For ordinary non-Pattern colors, the first step in color rendering reduces a client color to a concrete color -- a set of values in a color space that corresponds to the device's color model (except for possible conversions between DeviceGray, DeviceRGB, and DeviceCMYK), together with an identification of the associated color space. (The confusion here between color spaces and color models will have to be cleaned up when we implement native Separation/DeviceN colors.) Concrete colors are like the numeric values in a client color, except that they are represented by arrays of ``frac`` values (defined in base/gxfrac.h) rather than floats. The procedure for this step is the virtual ``concretize_color`` and ``concrete_space`` procedures in the (original) color space. This step reduces Indexed colors, CIEBased colors, and Separation and DeviceN colors that use the alternate space.
+
+#. The final step requires mapping a concrete color to the device's color model, done by procedures in base/gxcmap.c. These procedures combine the following three conceptual sub-steps:
+
+ - A possible mapping between Device color spaces, possibly involving black generation and undercolor removal. The non-trivial cases are implemented in base/gxdcconv.c.
+
+ - Application of the transfer function(s) (done in-line).
+
+ - Halftoning if necessary: see below.
+
+ The result is called (inappropriately) a device color (``gx_device_color``, defined in psi/gs.color.h and base/gxdcolor.h). For ordinary non-Pattern colors, a device color is either a pure color, or a halftone. The device and color model associated with a device color are implicit. The procedure for this step is the virtual ``remap_concrete_color`` procedure in the color space.
+
+#. The pure colors that underlie a device color are opaque pixel values defined by the device (misnamed ``gx_color_index``, defined in base/gscindex.h). The device with which they are associated is implicit. Although the format and interpretation of a pixel value are known only to the device, the device's color model and color representation capabilities are public, defined by a ``gx_color_info`` structure stored in the device (defined in base/gxdevcli.h). Virtual procedures of the device driver map between pixel values and RGB or CMYK. (This area is untidy and will need to be cleaned up when we implement native Separation/DeviceN colors).
+
+
+Steps 2 and 3 are normally combined into a single step for efficiency, as the ``remap_color`` virtual procedure in a color space.
+
+Using a device color to actually paint pixels requires a further step called color loading, implemented by the load virtual procedure in the device color. This does nothing for pure colors, but loads the caches for halftones and Patterns.
+
+All of the above steps -- concretizing, mapping to a device color, and color loading -- are done as late as possible, normally not until the color is actually needed for painting.
+
+All painting operations (fill, stroke, imagemask/show) eventually call a virtual procedure in the device color, either ``fill_rectangle`` or ``fill_mask`` to actually paint pixels. For rectangle fills, pure colors call the device's fill_rectangle procedure; halftones and tiled Patterns call the device's ``strip_tile_rectangle``; shaded Patterns, and painting operations that involve a RasterOp, do something more complicated.
+
+Color specification:
+ base/gsdcolor.h, base/gscolor.c, base/gscolor.h, base/gscolor1.c, base/gscolor1.h, base/gscolor2.c, base/gscolor2.h, base/gscolor3.c, base/gscolor3.h, base/gshsb.c, base/gshsb.h, base/gxcolor2.h, base/gxcvalue.h.
+
+Color spaces:
+ base/gscdevn.c, base/gscdevn.h, base/gscie.c, base/gscie.h, base/gscpixel.c, base/gscpixel.h, base/gscscie.c, base/gscsepr.c, base/gscsepr.h, base/gscspace.c, base/gscspace.h, base/gscssub.c, base/gscssub.h, base/gxcdevn.h, base/gxcie.h, base/gxcspace.h.
+
+Color mapping:
+ base/gsciemap.c, base/gscindex.h, base/gscrd.c, base/gscrd.h, base/gscrdp.c, base/gscrdp.h, base/gscsel.h, base/gxcindex.h, base/gxcmap.c, base/gxcmap.h, base/gxctable.c, base/gxctable.h, base/gxdcconv.c, base/gxdcconv.h, base/gxdcolor.c, base/gxdcolor.h, base/gxdevndi.c, base/gxdevndi.h, base/gxdither.h, base/gxfmap.h, base/gxlum.h, base/gxtmap.h.
+
+
+ ICC profiles are in some ways a special case of color mapping, but are not standard in PostScript.
+
+ base/gsicc.c, base/gsicc.h,
+
+ The following files provide a callback mechanism to allow a client program to specify a special case alternate tint transforms for Separation and DeviceN color spaces. Among other uses this can be used to provide special handling for PANTONE colors.
+
+ base/gsnamecl.c, base/gsnamecl.h, base/gsncdummy.c, base/gsncdummy.h, psi/zncdummy.c
+
+
+Ghostscript represents halftones internally by "whitening orders" -- essentially, arrays of arrays of bit coordinates within a halftone cell, specifying which bits are inverted to get from halftone level K to level K+1. The code does support all of the PostScript halftone types, but they are all ultimately reduced to whitening orders.
+
+Threshold arrays, the more conventional representation of halftones, can be mapped to whitening orders straightforwardly; however, whitening orders can represent non-monotonic halftones (halftones where the bits turned on for level K+1 don't necessarily include all the bits turned on for level K), while threshold arrays cannot. On the other hand, threshold arrays allow rapid conversion of images (using a threshold comparison for each pixel) with no additional space, while whitening orders do not: they require storing the rendered halftone cell for each possible level as a bitmap.
+
+Ghostscript uses two distinct types of rendered halftones -- that is, the bitmap(s) that represent a particular level.
+
+- Binary halftones. The rendered halftone is a single bit plane; each bit selects one of two pure colors. These are fast but limited: they are used for monochrome output devices, or for color devices in those cases where only two distinct colors are involved in a halftone (e.g., a pure cyan shade on a CMYK device). The device color for a binary halftone stores a pointer to the halftone bitmap, and the two pure colors.
+
+- Multi-plane halftones. Internally, each plane is rendered individually. Since there isn't enough room to store all 2^N pure colors, multi-plane halftones only store the scaled values for the individual components; the halftone renderer maps these to the pure colors on the fly, then combines the planes to assemble an N-bit index into the list of colors for each pixel, and stores the color into the fully rendered halftone.
+
+
+The halftone level for rendering a color is computed in base/gxdevndi.c; the actual halftone mask or tile is computed either in base/gxcht.c (for multi-plane halftones), or in base/gxht.c and base/gxhtbit.c (for binary halftones).
+
+Halftoning:
+ base/gsht.c, base/gsht.h, base/gsht1.c, base/gsht1.h, base/gshtscr.c, base/gshtx.c, base/gshtx.h, base/gxcht.c, base/gxdht.h, base/gxdhtres.h, base/gxht.c, base/gxht.h, base/gxhtbit.c, base/gxhttile.h, base/gxhttype.h, base/gzht.h.
+
+
+Pattern colors (tiled patterns and shadings) each use a slightly different approach from solid colors.
+
+The device color for a tiled (PatternType 1) pattern contains a pointer to a pattern instance, plus (for uncolored patterns) the device color to be masked. The pattern instance includes a procedure that actually paints the pattern if the pattern is not in the cache. For the PostScript interpreter, this procedure returns an ``gs_error_RemapColor`` exception code: this eventually causes the interpreter to run the pattern's PaintProc, loading the rendering into the cache, and then re-execute the original drawing operator.
+
+Patterns:
+ base/gs.color.c, base/gs.color.h, base/gsptype1.c, base/gsptype1.h, base/gxp1fill.c, base/gxp1impl.h, base/gxpcache.h, base/gxpcmap.c, base/gxpcolor.h.
+
+
+The device color for a shading (PatternType 2) pattern also contains a pointer to a pattern instance. Shadings are not cached: painting with a shading runs the shading algorithm every time.
+
+Shading:
+ base/gsptype2.c, base/gsptype2.h, base/gsshade.c, base/gsshade.h, base/gxshade.c, base/gxshade.h, base/gxshade1.c, base/gxshade4.c, base/gxshade4.h, base/gxshade6.c, base/gscicach.h, base/gscicach.c.
+
+
+In addition to the PostScript graphics model, Ghostscript supports RasterOp, a weak form of alpha channel, and eventually the full PDF 1.4 transparency model. The implemention of these facilities is quite slipshod and scattered: only RasterOp is really implemented fully. There is a general compositing architecture, but it is hardly used at all, and in particular is not used for RasterOp. It is used for implementation of the general support for overprint and overprint mode.
+
+Compositing architecture:
+ base/gscompt.h, base/gxcomp.h.
+
+RasterOp:
+ base/gdevdrop.c, base/gdevrops.c, base/gsrop.c, base/gsrop.h, base/gsropt.h, base/gsroptab.c, base/gxdevrop.h.
+
+Alpha channel and compositing:
+ base/gsalpha.c, base/gsalpha.h, base/gsdpnext.h, base/gxalpha.h.
+
+Advanced transparency:
+ base/gstparam.h, base/gstrans.c, base/gstrans.h, base/gxblend.c, base/gxblend.h, base/gdevp14.c, base/gdevp14.h.
+
+Overprint and Overprint mode:
+ base/gsovrc.c, base/gsovrc.h, base/gxoprect.c, base/gxoprect.h. There is support for both overprint and overprint mode. There is a general compositor based implementation of these features for all devices. In addition, the memory devices implement a higher speed set of special fill routines to improve performance for printer based devices.
+
+
+Clipping
+""""""""""
+
+The Ghostscript graphics library implements clipping by inserting a clipping device in the device pipeline. The clipping device modifies all drawing operations to confine them to the clipping region.
+
+The library supports three different kinds of clipping:
+
+- Region/path clipping
+ This corresponds to the PostScript concept of a clipping path. The clipping region is specified either by a list of rectangles (subject to the constraints documented in base/gxcpath.h), or by a path that is converted to such a list of rectangles.
+
+- Stationary mask clipping
+ This corresponds to the mask operand of a PostScript ImageType 3 image. The clipping region is specified by a bitmap and an (X,Y) offset in the coordinate space.
+
+- Tiled mask clipping
+ This corresponds to the region painted by a PostScript Pattern, for the case where the Pattern does not completely cover its bounding box but the combined transformation matrix has no skew or non-orthogonal rotation (i.e., XStep and YStep map respectively to (X,0) and (0,Y) or vice versa). The clipping region is specified by a bitmap and an (X,Y) offset in the coordinate space, and is replicated indefinitely in both X and Y.
+
+
+Note that simply scan-converting a clipping path in the usual way does not produce a succession of rectangles that can simply be stored as the list for region-based clipping: in general, the rectangles do not satisfy the constraint for rectangle lists specified in base/gxcpath.h, since they may overlap in X, Y, or both. A non-trivial "clipping list accumulator" device is needed to produce a rectangle list that does satisfy the constraint.
+
+Clipping support:
+ base/gxclip.c, base/gxclip.h.
+
+Region/path clipping:
+ base/gxcpath.c, base/gxcpath.h, base/gzcpath.h.
+
+Clipping list accumulator:
+ base/gxacpath.c, base/gzacpath.h.
+
+Mask clipping support:
+ base/gxmclip.c, base/gxmclip.h.
+
+Stationary mask clipping:
+ base/gxclipm.c, base/gxclipm.h.
+
+Tiled mask clipping:
+ base/gxclip2.c, base/gxclip2.h.
+
+
+Other graphics
+""""""""""""""""""""
+
+Miscellaneous graphics state:
+ base/gsclipsr.c, base/gsclipsr.h, base/gsdps.c, base/gsdps.h, base/gsdps1.c, base/gsistate.c, base/gsline.c, base/gsline.h, base/gslparam.h, base/gsstate.c, base/gsstate.h, base/gstrap.c, base/gstrap.h, base/gxclipsr.h, base/gxistate.h, base/gxline.h, base/gxstate.h, base/gzline.h, base/gzstate.h.
+
+
+Font API support
+""""""""""""""""""""
+
+UFST bridge:
+ base/gxfapiu.c, base/gxfapiu.h.
+
+
+Driver support
+""""""""""""""""""""
+
+Generic driver support:
+ base/gdevdcrd.c, base/gdevdcrd.h, base/gdevdsha.c, base/gdevemap.c, base/gsdevice.c, base/gsdevice.h, base/gsdparam.c, base/gsxfont.h, base/gxdevbuf.h, base/gxdevcli.h, base/gxdevice.h, base/gxrplane.h, base/gxxfont.h.
+
+Accessing rendered bits:
+ base/gdevdbit.c, base/gdevdgbr.c, base/gxbitfmt.h, base/gxgetbit.h.
+
+"Printer" driver support:
+ devices/gdevmeds.c, devices/gdevmeds.h, base/gdevppla.c, base/gdevppla.h, base/gdevprn.c, base/gdevprn.h, base/gdevprna.c, base/gdevprna.h, base/gxband.h, base/gxpageq.c, base/gxpageq.h.
+
+High-level device support:
+ base/gdevvec.c, base/gdevvec.h, base/gxhldevc.c, base/gxhldevc.h.
+
+Banding:
+ base/gxclbits.c, base/gxcldev.h, base/gxclfile.c, base/gxclimag.c, base/gxclio.h, base/gxclist.c, base/gxclist.h, base/gxcllzw.c, base/gxclmem.c, base/gxclmem.h, base/gxclpage.c, base/gxclpage.h, base/gxclpath.c, base/gxclpath.h, base/gxclrast.c, base/gxclread.c, base/gxclrect.c, base/gxclthrd.c, base/gxclthrd.h, base/gxclutil.c, base/gxclzlib.c, base/gxdhtserial.c, base/gxdhtserial.h, base/gsserial.c, base/gsserial.h.
+
+
+Visual Trace
+""""""""""""""""""""
+
+Visual Trace support :
+ base/vdtrace.h, base/vdtrace.c.
+
+
+See :ref:`Visual Trace instructions<Lib_VisualTrace>` for extensive documentation.
+
+
+Device drivers
+~~~~~~~~~~~~~~~~~~~~
+
+See :ref:`Drivers<Drivers.htm>` for extensive documentation on the interface between the core code and drivers.
+
+The driver API includes high-level (path / image / text), mid-level (polygon), and low-level (rectangle / raster) operations. Most devices implement only the low-level operations, and let generic code break down the high-level operations. However, some devices produce high-level output, and therefore must implement the high-level operations.
+
+Internal devices
+""""""""""""""""""""
+
+There are a number of "devices" that serve internal purposes. Some of these are meant to be real rendering targets; others are intended for use in device pipelines. The rendering targets are:
+
+Memory devices, depth-independent:
+ base/gdevmem.c, base/gdevmem.h, base/gdevmpla.c, base/gdevmpla.h, base/gdevmrop.h, base/gsdevmem.c, base/gxdevmem.h.
+
+Memory devices, specific depths:
+ base/gdevm1.c, base/gdevm2.c, base/gdevm4.c, base/gdevm8.c, base/gdevm16.c, base/gdevm24.c, base/gdevm32.c, base/gdevm40.c, base/gdevm48.c, base/gdevm56.c, base/gdevm64.c, base/gdevmr1.c, base/gdevmr2n.c, base/gdevmr8n.c.
+
+Alpha-related devices:
+ base/gdevabuf.c.
+
+Other devices:
+ base/gdevdflt.c, base/gdevhit.c, base/gdevmrun.c, base/gdevmrun.h, base/gdevplnx.c, base/gdevplnx.h.
+
+
+The forwarding devices meant for use in pipelines are:
+
+The bounding box device:
+ base/gdevbbox.h, base/gdevbbox.c.
+
+Clipping devices:
+ See under Clipping_ above.
+
+Other devices:
+ base/gdevnfwd.c.
+
+
+PostScript and PDF writers
+"""""""""""""""""""""""""""""""""""""
+
+Because PostScript and PDF have the same graphics model, lexical syntax, and stack-based execution model, the drivers that produce PostScript and PDF output share a significant amount of support code. In the future, the PostScript output driver should be replaced with a slightly modified version of the PDF driver, since the latter is far more sophisticated (in particular, it has extensive facilities for image compression and for handling text and fonts).
+
+The PDF code for handling text and fonts is complex and fragile. A major rewrite in June 2002 was intended to make it more robust and somewhat easier to understand, but also increased its size by about 40%, contrary to the expectation that it would shrink. Currently both sets of code are in the code base, with compatible APIs, selected by a line in ``devices/devs.mak``.
+
+
+Shared support
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+Writing fonts:
+ devices/vector/gdevpsf.h, devices/vector/gdevpsf1.c, devices/vector/gdevpsf2.c, devices/vector/gdevpsfm.c, devices/vector/gdevpsft.c, devices/vector/gdevpsfu.c, devices/vector/gdevpsfx.c, base/gscedata.c, base/gscedata.h, base/gscencs.c, base/gscencs.h.
+
+Other:
+ devices/vector/gdevpsdf.h, devices/vector/gdevpsdi.c, devices/vector/gdevpsdp.c, devices/vector/gdevpsds.c, devices/vector/gdevpsds.h, devices/vector/gdevpsdu.c.
+
+Encapsulated PostScript output driver (epswrite):
+ devices/vector/gdevpsu.c, devices/vector/gdevpsu.h.
+
+PDF output driver (pdfwrite)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Substrate:
+ devices/vector/gdevpdfo.c, devices/vector/gdevpdfo.h, devices/vector/gdevpdfr.c, devices/vector/gdevpdfu.c.
+
+Old text and fonts:
+ devices/vector/gdevpdfe.c, devices/vector/gdevpdft.c.
+
+New text and fonts:
+ devices/vector/gdevpdt.c, devices/vector/gdevpdt.h, devices/vector/gdevpdtb.c, devices/vector/gdevpdtb.h, devices/vector/gdevpdtc.c, devices/vector/gdevpdtd.c, devices/vector/gdevpdtd.h, devices/vector/gdevpdte.c, devices/vector/gdevpdtf.c, devices/vector/gdevpdtf.h, devices/vector/gdevpdti.c, devices/vector/gdevpdti.h, devices/vector/gdevpdts.c, devices/vector/gdevpdts.h, devices/vector/gdevpdtt.c, devices/vector/gdevpdtt.h, devices/vector/gdevpdtv.c, devices/vector/gdevpdtv.h, devices/vector/gdevpdtw.c, devices/vector/gdevpdtw.h, devices/vector/gdevpdtx.h. base/ConvertUTF.h, base/ConvertUTF.c,
+
+Graphics:
+ devices/vector/gdevpdfc.c, devices/vector/gdevpdfc.h, devices/vector/gdevpdfd.c, devices/vector/gdevpdfg.c, devices/vector/gdevpdfg.h, devices/vector/gdevpdfk.c, devices/vector/gdevpdft.c. devices/vector/gdevpdfv.c.
+
+Images:
+ devices/vector/gdevpdfb.c, devices/vector/gdevpdfi.c, devices/vector/gdevpdfj.c.
+
+Other:
+ devices/vector/gdevpdf.c, devices/vector/gdevpdfm.c, devices/vector/gdevpdfp.c, devices/vector/gdevpdfx.h. devices/vector/gdevpdfb.h.
+
+Other high-level devices
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+PCL XL output device (pxlmono, pxlcolor):
+ devices/vector/gdevpx.c, base/gdevpxat.h, base/gdevpxen.h, base/gdevpxop.h, devices/gdevpxut.c, devices/gdevpxut.h.
+
+Text extraction:
+ devices/vector/gdevtxtw.c.
+
+Other:
+ devices/gdevtrac.c.
+
+Other maintained drivers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The standard Ghostscript distribution includes a collection of drivers, mostly written by Aladdin Enterprises, that are "maintained" in the same sense as the Ghostscript core code.
+
+Display drivers:
+ devices/gdev8bcm.c, devices/gdev8bcm.h, devices/gdevevga.c, devices/gdevl256.c, base/gdevpccm.c, base/gdevpccm.h, devices/gdevpcfb.c, devices/gdevpcfb.h, devices/gdevs3ga.c, devices/gdevsco.c, devices/gdevsvga.c, devices/gdevsvga.h, devices/gdevvglb.c.
+
+Window system drivers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+X Windows:
+ devices/gdevx.c, devices/gdevx.h, devices/gdevxalt.c, devices/gdevxcmp.c, devices/gdevxcmp.h, devices/gdevxini.c, devices/gdevxres.c.
+
+Microsoft Windows:
+ devices/gdevmswn.c, devices/gdevmswn.h, devices/gdevmsxf.c, devices/gdevwddb.c, devices/gdevwdib.c.
+
+OS/2 Presentation Manager:
+ devices/gdevpm.h, base/gspmdrv.c, base/gspmdrv.h.
+
+
+
+Raster file output drivers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Fax and TIFF:
+ devices/gdevfax.c, devices/gdevfax.h, devices/gdevtfax.c, devices/gdevtfax.h, devices/gdevtifs.c, devices/gdevtifs.h, devices/gdevtfnx.c. devices/gdevtsep.c.
+
+Example DeviceN devices:
+ base/gdevdevn.c, base/gdevdevn.h, devices/gdevxcf.c, devices/gdevpsd.c, devices/gdevperm.c.
+
+Other raster file formats:
+ devices/gdevbit.c, devices/gdevbmp.c, devices/gdevbmp.h, devices/gdevbmpa.c, devices/gdevbmpc.c, devices/gdevjpeg.c, devices/gdevmiff.c, devices/gdevp2up.c, devices/gdevpcx.c, devices/gdevpbm.c, devices/gdevpng.c, devices/gdevpsim.c.
+
+
+Printer drivers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Operating system printer services:
+ devices/gdevos2p.c, devices/gdevwpr2.c, devices/gdevwprn.c.
+
+H-P monochrome printers:
+ devices/gdevdljm.c, devices/gdevdljm.h, devices/gdevdjet.c, devices/gdevlj56.c.
+
+Other printers:
+ devices/gdevatx.c.
+
+
+Contributed drivers
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This list is likely to be incomplete and inaccurate: see devices/contrib.mak and contrib/contrib.mak.
+
+Display and window system drivers:
+ devices/gdev3b1.c, devices/gdevherc.c, devices/gdevpe.c, devices/gdevsnfb.c, devices/gdevsun.c.
+
+Raster file output drivers:
+ devices/gdevcfax.c, devices/gdevcif.c, devices/gdevdfax.c, devices/gdevifno.c, devices/gdevmgr.c, devices/gdevmgr.h, devices/gdevsgi.c, devices/gdevsgi.h, devices/gdevsunr.c, devices/gdevjbig2.c, devices/gdevjpx.c.
+
+Printer drivers:
+ lib/bj8.rpd, lib/cbjc600.ppd, lib/cbjc800.ppd, devices/gdev3852.c, devices/gdev4081.c, devices/gdev4693.c, devices/gdev8510.c, devices/gdevadmp.c, devices/gdevbj10.c, devices/gdevbjc.h, devices/gdevbjcl.c, devices/gdevbjcl.h, devices/gdevccr.c, devices/gdevcdj.c, devices/gdevclj.c, devices/gdevcljc.c, devices/gdevcslw.c, devices/gdevdjtc.c, devices/gdevdm24.c, devices/gdevepsc.c, devices/gdevepsn.c, devices/gdevescp.c, devices/gdevhl7x.c, devices/gdevijs.c, devices/gdevimgn.c, devices/gdevl31s.c, devices/gdevlbp8.c, devices/gdevlp8k.c, devices/gdevlxm.c, devices/gdevn533.c, devices/gdevo182.c, devices/gdevokii.c, devices/gdevpcl.c, devices/gdevpcl.h, devices/gdevphex.c, devices/gdevpjet.c, devices/gdevsj48.c, devices/gdevsppr.c, devices/gdevstc.c, devices/gdevstc.h, devices/gdevstc1.c, devices/gdevstc2.c, devices/gdevstc3.c, devices/gdevstc4.c, devices/gdevtknk.c, devices/gdevupd.c.
+
+The special rinkj high-quality inkjet driver:
+ devices/gdevrinkj.c, base/gsequivc.c, base/gsequivc.h, devices/rinkj/evenbetter-rll.c, devices/rinkj/evenbetter-rll.h, devices/rinkj/rinkj-byte-stream.c, devices/rinkj/rinkj-byte-stream.h, devices/rinkj/rinkj-config.c, devices/rinkj/rinkj-config.h, devices/rinkj/rinkj-device.c, devices/rinkj/rinkj-device.h, devices/rinkj/rinkj-dither.c, devices/rinkj/rinkj-dither.h, devices/rinkj/rinkj-epson870.c, devices/rinkj/rinkj-epson870.h, devices/rinkj/rinkj-screen-eb.c, devices/rinkj/rinkj-screen-eb.h, lib/rinkj-2200-setup.
+
+
+PostScript interpreter
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The PostScript interpreter is conceptually simple: in fact, an interpreter that could execute "3 4 add =" and print "7" was running 3 weeks after the first line of Ghostscript code was written. However, a number of considerations make the code large and complex.
+
+The interpreter is designed to run in environments with very limited memory. The main consequence of this is that it cannot allocate its stacks (dictionary, execution, operand) as ordinary arrays, since the user-specified stack size limit may be very large. Instead, it allocates them as a linked list of blocks. See below for more details.
+
+The interpreter must never cause a C runtime error that it cannot trap. Unfortunately, C implementations almost never provide the ability to trap stack overflow. In order to put a fixed bound on the C stack size, the interpreter never implements PostScript recursion by C recursion. This means that any C code that logically needs to call the interpreter must instead push a continuation (including all necessary state information) on the PostScript execution stack, followed by the PostScript object to be executed, and then return to the interpreter. (See psi/estack.h for more details about continuations.) Unfortunately, since PostScript Level 2 introduces streams whose data source can be a PostScript procedure, any code that reads or writes stream data must be prepared to suspend itself, storing all necessary state in a continuation. There are some places where this is extremely awkward, such as the scanner/parser.
+
+The use of continuations affects many places in the interpreter, and even some places in the graphics library. For example, when processing an image, one may need to call a PostScript procedure as part of mapping a CIE color to a device color. Ghostscript uses a variety of dodges to handle this: for example, in the case of CIE color mapping, all of the PostScript procedures are pre-sampled and the results cached. The Adobe implementation limits this kind of recursion to a fixed number of levels (5?): this would be another acceptable approach, but at this point it would require far more code restructuring than it would be worth.
+
+A significant amount of the PostScript language implementation is in fact written in PostScript. Writing in PostScript leverages the C code for multi-threading, garbage collection, error handling, continuations for streams, etc., etc.; also, we have found PostScript in general more concise and easier to debug than C, mostly because of memory management issues. So given the choice, we tended to implement a feature in PostScript if it worked primarily with PostScript data structures, wasn't heavily used (example: font loading), or if it interacted with the stream or other callback machinery (examples: ReusableFileDecode streams, resourceforall). Often we would add non-standard PostScript operators for functions that had to run faster or that did more C-like things, such as the media matching algorithm for setpagedevice.
+
+Main program
+"""""""""""""""""""""""
+
+The main program of the interpreter is normally invoked from the command line, but it has an API as well. In fact, it has two APIs: one that recognizes the existence of multiple "interpreter instances" (although it currently provides a default instance, which almost all clients use), and a completely different one designed for Windows DLLs. These should be unified as soon as possible, since there are two steadily growing incompatible bodies of client code.
+
+Files:
+ psi/gs.c, psi/gserver.c, psi/iinit.c, psi/iinit.h, psi/imain.c, psi/imain.h, psi/imainarg.c, psi/imainarg.h, psi/iminst.h, psi/main.h.
+
+
+Data structures
+"""""""""""""""""""""""
+
+The main data structures visible to the PostScript programmers are arrays, contexts, dictionaries, names, and stacks.
+
+Arrays have no unusual properties. See under Refs below for more information about how array elements are stored.
+
+Contexts are used to hold the interpreter state even in configurations that don't include the Display PostScript multiple context extension. Context switching is implemented by a complex cooperation of C and PostScript code.
+
+Dictionaries have two special properties worth noting:
+
+They use an optimized storage representation if all the keys are names, which is almost always the case.
+
+They interact with a caching scheme used to accelerate name lookup in the interpreter.
+
+Names are allocated in blocks. The characters and hash chains are stored separately from the lookup cache information, so that in the future, most of the former can be compiled into the executable and shared or put in ROM. (This is not actually done yet.)
+
+Contexts:
+ psi/icontext.c, psi/icontext.h, psi/icstate.h.
+
+Dictionaries:
+ psi/iddict.h, psi/idict.h, psi/idict.c, psi/idictdef.h, psi/idicttpl.h.
+
+Names:
+ psi/iname.c, psi/iname.h, psi/inamedef.h, psi/inameidx.h, psi/inames.h, psi/inamestr.h.
+
+
+Stacks
+"""""""""""""""""""""""
+
+As mentioned above, each stack is allocated as a linked list of blocks. However, for reasonable performance, operators must normally be able to access their operands and produce their results using indexing rather than an access procedure. This is implemented by ensuring that all the operands of an operator are in the topmost block of the stack, using guard entries that cause an internal error if the condition isn't met. See psi/iostack.h for more details.
+
+Generic stacks:
+ psi/isdata.h, psi/istack.c, psi/istack.h, psi/istkparm.h.
+
+Specific stacks:
+ Dictionary stack:
+ psi/dstack.h, psi/iddstack.h, psi/idsdata.h, psi/idstack.c, psi/idstack.h.
+
+ Execution stack:
+ psi/estack.h, psi/iesdata.h, psi/iestack.h.
+
+ Operand stack:
+ psi/iosdata.h, psi/iostack.h, psi/ostack.h.
+
+
+Interpreter loop
+"""""""""""""""""""""""
+
+
+Files:
+ psi/interp.c, psi/interp.h.
+
+
+Scanning/parsing
+"""""""""""""""""""""""
+PostScript parsing consists essentially of token scanning, and is simple in principle. The scanner is complex because it must be able to suspend its operation at any time (i.e., between any two input characters) to allow an interpreter callout, if its input is coming from a procedure-based stream and the procedure must be called to provide more input data.
+
+Main scanner:
+ psi/iscan.c, psi/iscan.h, psi/iscannum.c, psi/iscannum.h, base/scanchar.h, base/scantab.c.
+
+Binary tokens:
+ psi/btoken.h, psi/ibnum.c, psi/ibnum.h, psi/inobtokn.c, psi/iscanbin.c, psi/iscanbin.h.
+
+DSC parsing:
+ psi/dscparse.c, psi/dscparse.h.
+
+
+Standard operators
+"""""""""""""""""""""""
+
+Non-output-related:
+ Filters:
+ psi/ifilter.h, psi/ifilter2.h, psi/ifrpred.h, psi/ifwpred.h, psi/istream.h, psi/zfbcp.c, psi/zfdctd.c, psi/zfdcte.c, psi/zfdecode.c, psi/zfilter.c, psi/zfilter2.c, psi/zfjbig2.c, psi/zfjpx.c, psi/zfmd5.c, psi/zfarc4.c, psi/zfproc.c, psi/zfrsd.c, psi/zfzlib.c.
+
+ File and stream I/O:
+ psi/files.h, psi/itoken.h, psi/zbseq.c, psi/zdscpars.c, psi/zfile.h, psi/zfile.c, psi/zfile1.c, psi/zfileio.c, psi/ztoken.c.
+
+ Data structures:
+ psi/zarray.c, psi/zdict.c, psi/zgeneric.c, psi/zpacked.c, psi/zstring.c.
+
+ Functions:
+ psi/ifunc.h, psi/zfunc.c, psi/zfunc0.c, psi/zfunc3.c, psi/zfunc4.c,
+
+ Other:
+ psi/ivmem2.h, psi/zalg.c, psi/zarith.c, psi/zcontext.c, psi/zcontrol.c, psi/zmath.c, psi/zmatrix.c, psi/zmisc.c, psi/zmisc1.c, psi/zmisc2.c, psi/zmisc3.c, psi/zrelbit.c, psi/zstack.c, psi/ztype.c, psi/zusparam.c, psi/zvmem.c, psi/zvmem2.c.
+
+
+
+Output-related:
+ Device management:
+ psi/zdevcal.c, psi/zdevice.c, psi/zdevice2.c, psi/ziodev.c, psi/ziodev2.c, psi/ziodevs.c, psi/zmedia2.c,
+
+ Fonts and text:
+ psi/bfont.h, psi/ichar.h, psi/ichar1.h, psi/icharout.h, psi/icid.h, psi/ifcid.h, psi/ifont.h, psi/ifont1.h, psi/ifont2.h, psi/ifont42.h, psi/zbfont.c, psi/zcfont.c, psi/zchar.c, psi/zchar1.c, psi/zchar2.c, psi/zchar32.c, psi/zchar42.c, psi/zchar42.h, psi/zcharout.c, psi/zcharx.c, psi/zcid.c, psi/zfcid.c, psi/zfcid0.c, psi/zfcid1.c, psi/zfcmap.c, psi/zfont.c, psi/zfont0.c, psi/zfont1.c, psi/zfont2.c, psi/zfont32.c, psi/zfont42.c, psi/zfontenum.c.
+
+ A bridge to the True Type bytecode interpreter:
+ base/gxttfb.c, base/gxttfb.h, base/ttfoutl.h, base/ttfmain.c, base/ttfmemd.c, base/ttfmemd.h, base/ttfinp.c, base/ttfinp.h.
+
+ A reduced True Type bytecode interpreter:
+ (this is based in part on the work of the Freetype Team and incorporates some code from the FreeType 1 project)
+ base/ttfsfnt.h, base/ttcalc.c, base/ttcalc.h, base/ttcommon.h, base/ttconf.h, base/ttconfig.h, base/ttinterp.c, base/ttinterp.h, base/ttload.c, base/ttload.h, base/ttmisc.h, base/ttobjs.c, base/ttobjs.h, base/tttables.h, base/tttype.h, base/tttypes.h.
+
+ Color, pattern, and halftone:
+ psi/icie.h, psi/icolor.h, psi/icremap.h, psi/icsmap.h, psi/iht.h, psi/ipcolor.h, psi/zcie.c, psi/zcolor.c, psi/zcolor1.c, psi/zcolor2.c, psi/zcolor3.c, psi/zcrd.c, psi/zcsindex.c, psi/zcspixel.c, psi/zcssepr.c, psi/zicc.c, psi/zht.c, psi/zht1.c, psi/zht2.h, psi/zht2.c, psi/zpcolor.c, psi/zshade.c, psi/ztrans.c.
+
+ Images:
+ psi/iimage.h, psi/zimage.c, psi/zimage3.c, psi/zfimscale.c.
+
+ Other graphics:
+ psi/igstate.h, psi/zdpnext.c, psi/zdps.c, psi/zdps1.c, psi/zgstate.c, psi/zpaint.c, psi/zpath.c, psi/zpath1.c, psi/ztrap.c, psi/zupath.c.
+
+
+Operator support:
+ psi/oparc.h, psi/opcheck.h, psi/opdef.h, psi/oper.h, psi/opextern.h.
+
+
+Non-standard operators
+""""""""""""""""""""""""""""""""""""""""""""""
+
+The interpreter includes many non-standard operators. Most of these provide some part of the function of a standard operator, so that the standard operator itself can be implemented in PostScript: these are not of interest to users, and their function is usually obvious from the way they are used. However, some non-standard operators provide access to additional, non-standard facilities that users might want to know about, such as transparency, RasterOp, and in-memory rendering. These are documented at :ref:`Additional Operators<Additional Operators>`.
+
+We don't document the complete set of non-standard operators here, because the set changes frequently. However, all non-standard operators are supposed to have names that begin with '.', so you can find them all by executing the following (Unix) command:
+
+``grep '{".[.]' psi/[zi]*.c``
+
+In addition to individual non-standard operators implemented in the same files as standard ones, there are several independent optional packages of non-standard operators. As with other non-standard operators, the names of all the operators in these packages begin with '.'. We list those packages here.
+
+psi/zdouble.c
+ Provides "double" floating point arithmetic, using 8-byte strings to hold values. Developed under a contract; probably used only by the group that funded the development.
+
+psi/zfsample.c,
+ Provides a special operator to sample a given function and create a new type 0 function.
+
+psi/zsysvm.c
+ Provides operators for allocating objects in specific VM spaces, disregarding the current VM mode.
+
+
+Interpreter support
+""""""""""""""""""""""""""""""""""""""""""""""
+
+Memory management (refs, GC, save/restore) -- see `Postscript Interpreter Extensions`_.
+
+Font API :
+ psi/ifapi.h, psi/zfapi.c, base/fapiufst.c, base/fapi_ft.c, base/wrfont.h, base/wrfont.c, base/write_t1.h, base/write_t1.c, base/write_t2.h, base/write_t2.c,
+
+Miscellaneous support:
+ psi/ierrors.h, base/gserrors.h, psi/ghost.h, psi/iconf.c, psi/iconf.h, psi/idparam.c, psi/idparam.h, psi/ilevel.h, psi/inouparm.c, psi/iparam.c, psi/iparam.h, psi/iparray.h, psi/iutil.c, psi/iutil.h, psi/iutil2.c, psi/iutil2.h, psi/iplugin.c, psi/iplugin.h.
+
+
+PostScript code
+""""""""""""""""""""""""""""""""""""""""""""""
+
+Initialization and language support:
+ All configurations:
+ Resource/Init/gs_init.ps, Resource/Init/gs_statd.ps.
+
+ Level 2:
+ Resource/Init/gs_btokn.ps, Resource/Init/gs_dps1.ps, Resource/Init/gs_dps2.ps, Resource/Init/gs_lev2.ps, Resource/Init/gs_res.ps, Resource/Init/gs_resmp.ps, Resource/Init/gs_setpd.ps.
+
+ LanguageLevel 3:
+ Resource/Init/gs_frsd.ps, Resource/Init/gs_ll3.ps, Resource/Init/gs_trap.ps.
+
+ Display PostScript:
+ Resource/Init/gs_dpnxt.ps, Resource/Init/gs_dps.ps.
+
+ Emulation of other interpreters:
+ Resource/Init/gs_cet.ps (Adobe CPSI).
+
+
+Color Spaces and support:
+ Color Space Loading:
+ Resource/Init/gs_cspace.ps,
+
+ ICC color profiles:
+ Resource/Init/gs_icc.ps.
+
+
+Font loading and support:
+ Font name mapping:
+ Resource/Init/Fontmap, lib/Fontmap.ATB, lib/Fontmap.ATM, Resource/Init/Fontmap.GS, lib/Fontmap.OS2, lib/Fontmap.OSF, lib/Fontmap.SGI, lib/Fontmap.Sol, lib/Fontmap.Ult, lib/Fontmap.VMS, lib/Fontmap.URW-136.T1, lib/Fontmap.URW-136.TT, Resource/Init/cidfmap, Resource/Init/FAPIcidfmap, Resource/Init/FAPIfontmap, Resource/Init/FCOfontmap-PCLPS2.
+
+ Generic:
+ Resource/Init/gs_fonts.ps, Resource/Init/gs_fntem.ps.
+
+ Type 1 and CFF:
+ Resource/Init/gs_cff.ps, Resource/Init/gs_diskf.ps, Resource/Init/gs_type1.ps.
+
+ TrueType:
+ Resource/Init/gs_ttf.ps, Resource/Init/gs_typ42.ps.
+
+ CID-keyed:
+ Resource/Init/gs_cidcm.ps, Resource/Init/gs_cidfn.ps, Resource/Init/gs_cmap.ps, Resource/Init/gs_ciddc.ps, Resource/Init/gs_cidfm.ps, Resource/Init/gs_cidtt.ps.
+
+ Font API:
+ Resource/Init/gs_fapi.ps, Resource/Init/FAPIconfig, lib/FAPIconfig-FCO, Resource/Init/xlatmap. Resource/Init/FCOfontmap-PCLPS2. lib/FCOfontmap-PCLPS3. lib/FCOfontmap-PS3.
+
+ Other:
+ lib/gs_kanji.ps, lib/gs_pfile.ps, Resource/Init/gs_typ32.ps.
+
+
+Encodings:
+ Adobe-specified:
+ lib/gs_ce_e.ps, Resource/Init/gs_dbt_e.ps, Resource/Init/gs_il1_e.ps, Resource/Init/gs_mex_e.ps, Resource/Init/gs_mro_e.ps, Resource/Init/gs_pdf_e.ps, Resource/Init/gs_std_e.ps, Resource/Init/gs_sym_e.ps, Resource/Init/gs_wan_e.ps.
+
+ Additional:
+ lib/gs_il2_e.ps, lib/gs_ksb_e.ps, lib/gs_wl1_e.ps, lib/gs_wl2_e.ps, lib/gs_wl5_e.ps.
+
+ Pseudo-encodings for internal use:
+ lib/gs_lgo_e.ps, lib/gs_lgx_e.ps, Resource/Init/gs_mgl_e.ps.
+
+
+Miscellaneous:
+ Image support:
+ Resource/Init/gs_img.ps,
+
+ Emulation of %disk IODevice:
+ Resource/Init/gs_diskn.ps,
+
+ Other support:
+ Resource/Init/gs_agl.ps, Resource/Init/gs_dscp.ps, Resource/Init/gs_epsf.ps, Resource/Init/gs_pdfwr.ps, lib/gs_rdlin.ps.
+
+ X Windows icon bitmaps:
+ lib/gs_l.xbm, lib/gs_l.xpm, lib/gs_l_m.xbm, lib/gs_m.xbm, lib/gs_m.xpm, lib/gs_m_m.xbm, lib/gs_s.xbm, lib/gs_s.xpm, lib/gs_s_m.xbm, lib/gs_t.xbm, lib/gs_t.xpm, lib/gs_t_m.xbm.
+
+ PDF/X-3 definition file sample:
+ lib/PDFX_def.ps
+
+
+PDF interpreter
+~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript's PDF interpreter is written entirely in PostScript, because its data structures are the same as PostScript's, and it is much more convenient to manipulate PostScript-like data structures in PostScript than in C. There is definitely a performance cost, but apparently not a substantial one: we considered moving the main interpreter loop (read a token using slightly different syntax than PostScript, push it on the stack if literal, look it up in a special dictionary for execution if not) into C, but we did some profiling and discovered that this wasn't accounting for enough of the time to be worthwhile.
+
+Until recently, there was essentially no C code specifically for the purpose of supporting PDF interpretation. The one major exception is the PDF 1.4 transparency features, which we (but not Adobe) have made available to PostScript code.
+
+In addition to patching the run operator to detect PDF files, the interpreter provides some procedures in Resource/Init/pdf_main.ps that are meant to be called from applications such as previewers.
+
+Files:
+ Resource/Init/pdf_base.ps, Resource/Init/pdf_draw.ps, Resource/Init/pdf_font.ps, Resource/Init/pdf_main.ps, Resource/Init/pdf_rbld.ps, Resource/Init/pdf_ops.ps, Resource/Init/pdf_sec.ps.
+
+
+PostScript Printer Description
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A PostScript Printer Description tells a generic PostScript printer driver how to generate PostScript for a particular printer. Ghostscript includes a PPD file for generating PostScript intended to be converted to PDF. A Windows INF file for installing the PPD on Windows 2000 and XP is included.
+
+Files:
+ lib/ghostpdf.ppd, lib/ghostpdf.inf, lib/ghostpdf.cat, lib/ghostpdf.README.
+
+Build process
+~~~~~~~~~~~~~~~~~~~~
+
+Makefile structure
+""""""""""""""""""""""""""
+
+Ghostscript's makefiles embody a number of design decisions and assumptions that may not be obvious from a casual reading of the code.
+
+- All files are stored in subdirectories. The names of all subdirectories used in the build process are defined in the top-level makefiles for the various platforms: there are no "hard wired" directory names in any makefile rule. Subdirectory names in the makefiles are relative to the directory that is current at build time: normally this directory is the parent of the various subdirectories, and holds only a makefile, which in turn simply references the real top-level makefile in the source subdirectory.
+
+- All compiler and linker switches are likewise defined by macros, again preferably in the top-level platform makefile.
+
+- There is an absolute distinction between "source-like" subdirectories, which are read-only during the build process, and "object-like" subdirectories, all of whose contents are generated by the build process and which can be emptied (``rm *``) at any time with no bad effects. The source subdirectories are defined by macros named ``xxxSRCDIR``.
+
+- Object subdirectories may distinguish further between those that hold the results of the build process that are needed at run time (i.e., that should be included in a run-time distribution), defined by BINDIR, and those that are not needed at run time, defined by xxxGENDIR and xxxOBJDIR. (The distinction between these is historical and probably no longer relevant).
+
+- There may be multiple object subdirectories for different build configurations. On Unix, the obj and bin directories are used for normal production builds, the debugobj directory for debugging builds, and the pgobj directory for profiling builds; other platforms may use different conventions. The Unix makefiles support targets named debug and pg for debugging and profiling builds respectively; other platforms generally do not.
+
+- Makefiles will be maintained by hand. This requires editing the following makefile elements whenever the relevant source files changes:
+
+ - Every header (.h) file must have a corresponding macro definition in a makefile. If abc.h #includes def.h and xyz.h, the definition must have the form:
+ ``xyz_h=$(xxxSRCD)xyz.h $(def_h) $(xyz_h)``
+
+ where ``xxxSRCD`` is the macro defining the relevant source directory (including a trailing '``/``'). Note that the '``.``' in the file name has been replaced by an underscore. Note also that the definition must follow all definitions it references, since some make programs expand macros in definitions at the time of definition rather than at the time of use.
+
+ - Every .c file must have a corresponding rule in a makefile. If abc.c #includes def.h and lmn.h, the rule must have approximately the form:
+
+ ``$(xxxOBJD)abc.$(OBJ) : $(xxxSRCD)abc.c $(def_h) $(lmn_h)``
+ ``$(xxCC) $(xxO_)abc.$(OBJ) $(C_) $(xxxSRCD)abc.c``
+
+ where ``xxxSRCD`` is as before; ``xxxOBJD`` is the relevant object directory; ``xxCC`` defines the name of the C compiler plus the relevant compilation switches; and ``xxO_`` and ``C_`` are macros used to bridge syntactic differences between different make programs.
+
+The requirement to keep makefiles up to date by hand has been controversial. Two alternatives are generally proposed.
+
+- Programs like ``makedeps``, which generate build rules automatically from the #include lists in C files. We have found such programs useless: they "wire in" specific, concrete directory names, not only for our own code but even for the system header files; they have to be run manually whenever code files are added, renamed, or deleted, or whenever the list of #includes in any file changes; and they cannot deal with different source files requiring different compilation switches.
+
+- MSVC-style "project" files. These are equally useless: they are not portable across different vendors' tools -- in fact, there may not even be a usable import/export facility to convert their data to or from text form -- and they cannot combine configuration-independent data with configuration-specific data.
+
+
+We have seriously considered writing our own build program in Tcl or Python that would eliminate these problems, or perhaps porting the tools developed by Digital's Vesta research project (if we can get access to them); however, either of these approaches would create potential portability problems of its own, not to mention difficulties in integrating with others' build systems.
+
+For more information about makefiles:
+
+- For a detailed list of makefiles, and a discussion of makefile issues related to portability, see the Makefiles_ section below.
+- For more detailed information about editing configuration information in makefiles, see :ref:`Makefiles Overview<Make_MakeFilesOverview>`.
+- For a complete example of adding a new driver to a makefile, see :ref:`Drivers<Drivers.htm>`.
+- For a few more notes on makefile coding conventions, see :ref:`C-Style Makefiles<CStyle_Makefiles>`.
+
+
+
+.dev files
+""""""""""""""""""""""""""
+
+On top of the general conventions just described, Ghostscript's makefiles add a further layer of structure in order to support an open-ended set of fine-grained, flexible configuration options. Selecting an option (usually called a "module") for inclusion in the build may affect the build in many ways:
+
+- Almost always, it requires linking in some compiled code files.
+- It may require running some additional initialization procedures at startup.
+- It may require reading in some additional PostScript files at startup. For example, a Level 2 PostScript build requires support for PostScript resources and for ``setpagedevice``, which are implemented in PostScript code.
+- It may require adding entries to a variety of internal tables that catalogue such things as drivers, IODevices, Function types, etc.
+- It may require that other particular modules be included. For example, the "PostScript Level 2" module requires the modules for various filters, color spaces, etc.
+- It may require removing some other (default) module from the build. For example, the core (Level 1) PostScript build has a "stub" for binary tokens, which are a Level 2 feature but are referenced by the core scanner: a Level 2 build must remove the stub. For more information about this, look for the string ``-replace`` in the makefiles and in ``base/genconf.c``.
+
+
+Each module is defined in the makefiles by rules that create a file named ``xxx.dev``. The dependencies of the rule include all the files that make up the module (compiled code files, PostScript files, etc.); the body of the rule creates the .dev file by writing the description of the module into it. A program called genconf, described in the next section, merges all the relevant .dev files together. For examples of .dev rules, see any of the Ghostscript makefiles.
+
+Ultimately, a person must specify the root set of modules to include in a build (which of course may require other modules, recursively). Ghostscript's makefiles do this with a set of macros called ``FEATURE_DEVS`` and ``DEVICE_DEVSn``, defined in each top-level makefile, but nothing in the module machinery depends on this.
+
+Generators
+""""""""""""""""""""""""""
+
+Ghostscript's build procedure is somewhat unusual in that it compiles and then executes some support programs during the build process. These programs then generate data or source code that is used later on in the build.
+
+The most important and complex of the generator programs is genconf. genconf merges all the .dev files that make up the build, and creates three or more output files used in later stages:
+
+- ``gconfig.h``, consisting mainly of macro calls, one call per "resource" making up the build, other than "resources" listed in the other output files.
+- ``gconfigf.h``, produced only for PostScript builds with compiled-in fonts, consisting of one macro call per font.
+- A linker control file whose name varies from one platform to another, containing the list of compiled code files to be linked.
+- If necessary, another linker control file, also varying between platforms, that contains other information for the linker such as the list of system libraries to be searched. (On Unix platforms, the two linker control functions are combined in a single file).
+
+
+Source generators:
+ base/genarch.c
+ Creates a header file containing a variety of information about the hardware and compiler that isn't provided in any standard system header file. Always used.
+
+ base/genconf.c (also generates non-source)
+ Constructs header files and linker control files from the collection of options and modules that make up the build. See above. Always used.
+
+ base/genht.c
+ Converts a PostScript halftone (in a particular constrained format) to a C data structure that can be compiled into an executable. Only used if any such halftones are included in the build.
+
+ base/mkromfs.c
+ Takes a set of directories, and creates a compressed filesystem image that can be compiled into the executable as static data and accessed through the %rom% iodevice prefix. This is used to implement the ``COMPILE_INITS=1`` feature (a compressed init fileset is more efficient than the current 'gsinit.c' produced by 'geninit.c'). This IODevice is more versatile since other files can be encapsulated such as fonts, helper PostScript files and Resources. The list of files is defined in part in psi/psromfs.mak.
+
+
+Other generators:
+ base/echogs.c
+ Implements a variety of shell-like functions to get around quirks, limitations, and omissions in the shells on various platforms. Always used.
+
+ base/genconf.c (also generates source)
+ See above.
+
+ base/gendev.c (not used)
+ Was intended as a replacement for genconf, but was never completed.
+
+
+Support
+""""""""""""""""""""""""""
+
+There are a number of programs, scripts, and configuration files that exist only for the sake of the build process.
+
+Files for PC environments:
+ base/gswin.icx, base/gswin16.icx, base/bcc32.cfg, base/cp.bat, base/cp.cmd, psi/dw32c.def, psi/dwmain.rc, psi/dwmain32.def, psi/dwsetup.def, psi/dwsetup_x86.manifest, psi/dwsetup_x64.manifest, psi/dwuninst.def, psi/dwuninst_x86.manifest, psi/dwuninst_x64.manifest, psi/gsdll2.def, psi/gsdll2.rc, psi/gsdll32.def, psi/gsdll32.rc, psi/gsdll32w.lnk, psi/gsos2.def, psi/gsos2.icx, psi/gsos2.rc, base/gspmdrv.def, base/gspmdrv.icx, base/gspmdrv.rc, base/gswin.rc, base/gswin32.rc, base/mv.bat, base/mv.cmd, base/rm.bat, base/rm.cmd,
+
+Files for MacOS:
+ lib/Info-macos.plist.
+
+Files for OpenVMS:
+ base/append_l.com, base/copy_one.com, base/rm_all.com, base/rm_one.com.
+
+Other files:
+ base/bench.c, base/catmake, base/instcopy.
+
+
+Utilities
+~~~~~~~~~~~~~
+
+Ghostscript comes with many utilities for doing things like viewing bitmap files and converting between file formats. Some of these are written in PostScript, some as scripts, and some as scripts that invoke special PostScript code.
+
+Utilities in PostScript
+""""""""""""""""""""""""""""""
+
+These are all documented in doc/Psfiles.htm, q.v.
+
+Utility scripts
+""""""""""""""""""""""""""""""
+
+Many of these scripts come in both Unix and MS-DOS (.bat versions; some also have an OS/2 (.cmd) version. The choice of which versions are provided is historical and irregular. These scripts should all be documented somewhere, but currently, many of them have man pages, a few have their own documentation in the doc directory, and some aren't documented at all.
+
+Script files without PC versions:
+ lib/afmdiff.awk, lib/dvipdf, lib/lprsetup.sh, lib/pphs, lib/printafm, lib/unix-lpr.sh, lib/wftopfa.
+
+Script files with PC versions:
+ lib/eps2eps, lib/eps2eps.bat, lib/eps2eps.cmd, lib/ps2ps2, lib/ps2ps2.bat, lib/ps2ps2.cmd, lib/font2c, lib/font2c.bat, lib/font2c.cmd, lib/gsbj, lib/gsbj.bat, lib/gsdj, lib/gsdj.bat, lib/gsdj500, lib/gsdj500.bat, lib/gslj, lib/gslj.bat, lib/gslp, lib/gslp.bat, lib/gsnd, lib/gsnd.bat, lib/pdf2dsc, lib/pdf2dsc.bat, lib/pdf2ps, lib/pdf2ps.bat, lib/pdf2ps.cmd, lib/pf2afm, lib/pf2afm.bat, lib/pf2afm.cmd, lib/pfbtopfa, lib/pfbtopfa.bat, lib/ps2ascii, lib/ps2ascii.bat, lib/ps2ascii.cmd, lib/ps2epsi, lib/ps2epsi.bat, lib/ps2epsi.cmd, lib/ps2pdf, lib/ps2pdf.bat, lib/ps2pdf.cmd, lib/ps2pdf12, lib/ps2pdf12.bat, lib/ps2pdf12.cmd, lib/ps2pdf13, lib/ps2pdf13.bat, lib/ps2pdf13.cmd, lib/ps2pdf14, lib/ps2pdf14.bat, lib/ps2pdf14.cmd, lib/ps2pdfwr, lib/ps2pdfxx.bat, lib/ps2ps, lib/ps2ps.bat, lib/ps2ps.cmd.
+
+Script files with only PC versions:
+ lib/gsndt.bat, lib/gssetgs.bat, lib/gssetgs32.bat, lib/gssetgs64.bat, lib/gst.bat, lib/gstt.bat, lib/lp386.bat, lib/lp386r2.bat, lib/lpgs.bat, lib/lpr2.bat, lib/pftogsf.bat, lib/wmakebat.bat.
+
+
+
+Memory management
+---------------------
+
+Memory manager architecture
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In many environments, the memory manager is a set of library facilities that implicitly manage the entire address space in a homogenous manner. Ghostscript's memory manager architecture has none of these properties:
+
+- Rather than a single library accessed as procedures, Ghostscript includes multiple allocator types, each of which in turn may have multiple instances (allocators). Allocators are 'objects' with a substantial set of virtual functions.
+- Rather than managing the entire address space, each allocator manages a storage pool, which it may or may not be able to expand or reduce by calling on a 'parent' allocator.
+- Rather than a single genus of untyped storage blocks, Ghostscript's allocators provide two genera -- type-tagged 'objects', and 'strings' -- with substantially different properties.
+
+Objects vs strings
+""""""""""""""""""""""
+
+As noted above, allocators provide two different storage genera.
+
+Objects:
+
+- Are aligned in storage to satisfy the most stringent alignment requirement imposed by the CPU or compiler;
+- Can be referenced only by pointers to their start, not to any internal location, unless special arrangements are made;
+- May contain pointers to other objects, or to strings;
+- Have an associated structure descriptor that specifies their size (usually) and the location of any pointers contained within them.
+
+
+Given a pointer to an object, the allocator that allocated it must be able to return the object's size and the pointer to its structure descriptor. (It is up to the client to know what allocator allocated an object.)
+
+Strings:
+
+- Are not aligned in storage;
+- Can be referenced by pointers (consisting of a starting address and a length) to any substring, starting anywhere within the string;
+- May not contain pointers;
+- Do not have a structure descriptor.
+
+The object/string distinction reflects a space/capability tradeoff. The per-object space overhead of the standard type of allocator is typically 12 bytes; this is too much to impose on every string of a few bytes. On the other hand, restricting object pointers to reference the start of the object currently makes object garbage collection and compaction more space-efficient. If we were to redesign the standard allocator, we would probably opt for a different design in which strings were allocated within container objects of a few hundred bytes, and pointers into the middle of all objects were allowed.
+
+
+.. _Develop_Structure_Descriptors:
+
+Structure descriptors
+""""""""""""""""""""""""""""""""""""""""""""
+
+Every object allocated by a Ghostscript allocator has an associated structure descriptor, which the caller provides when allocating the object. The structure descriptor serves several purposes:
+
+- Specifying the size of the object for allocation;
+- Providing pointer-enumeration and pointer-relocation procedures for the garbage collector;
+- Providing an optional finalization procedure to be called when the object is freed (either explicitly or automatically).
+
+Structure descriptors are read-only, and are normally defined statically using one of the large set of ``gs_private_st_`` or ``gs_public_st_`` macros in base/gsstruct.h.
+
+While the structure descriptor normally specifies the size of the object, one can also allocate an array of bytes or objects, whose size is a multiple of the size in the descriptor. For this reason, every object stores its size as well as a reference to its descriptor.
+
+Because the standard Ghostscript garbage collector is non-conservative and can move objects, every object allocated by a Ghostscript allocator must have an accurate structure descriptor. If you define a new type of object (structure) that will be allocated in storage managed by Ghostscript, you must create an accurate descriptor for it, and use that descriptor to allocate it. The process of creating accurate descriptors for all structures was long and painful, and accounted for many hard-to-diagnose bugs.
+
+By convention, the structure descriptor for structure type ``xxx_t`` is named ``st_xxx`` (this is preferred), or occasionally ``st_xxx_t``.
+
+Note that a structure descriptor is only required for objects allocated by the Ghostscript allocator. A structure type ``xxx_t`` does not require a structure descriptor if instances of that type are used only in the following ways:
+
+- Instances are allocated only on the C stack, e.g., as ``xxx_t``, ``xxx1``, ``xxx2``;, or on the C heap, with malloc or through the Ghostscript "wrapper" defined in base/gsmalloc.h.
+
+- Pointers to instances are not stored in places where the garbage collector will try to trace the pointer.
+- Code never attempts to get the structure type or size of an instance through the allocator API.
+
+In general, structures without descriptors are problem-prone, and are deprecated; in new code, they should only be used if the structure is confined to a single .c file and its instances are only allocated on the C stack.
+
+Files:
+ base/gsstruct.h, base/gsstype.h.
+
+Garbage collection
+""""""""""""""""""""""
+
+The allocator architecture is designed to support compacting garbage collection. Every object must be able to enumerate all the pointers it contains, both for tracing and for relocation. As noted just above, the structure descriptor provides procedures that do this.
+
+Whether or not a particular allocator type actually provides a garbage collector is up to the allocator: garbage collection is invoked through a virtual procedure. In practice, however, there are only two useful garbage collectors for Ghostscript's own allocator:
+
+- The "real" garbage collector associated with the PostScript interpreter, described :ref:`below<Interpreter_GC>`;
+- A "non" garbage collector that only merges adjacent free blocks.
+
+As noted above, because the architecture supports compacting garbage collection, a "real" garbage collector cannot be run at arbitrary times, because it cannot reliably find and relocate pointers that are on the C stack. In general, it is only safe to run a "real" garbage collector when control is at the top level of the program, when there are no pointers to garbage collectable objects from the stack (other than designated roots).
+
+Files:
+ base/gsgc.h, base/gsnogc.c, base/gsnogc.h.
+
+
+Movability
+""""""""""""""""""""""
+As just noted, objects are normally movable by the garbage collector. However, some objects must be immovable, usually because some other piece of software must retain pointers to them. The allocator API includes procedures for allocating both movable (default) and immovable objects. Note, however, that even immovable objects must be traceable (have a structure descriptor), and may be freed, by the garbage collector.
+
+
+
+Parent hierarchy
+""""""""""""""""""""""
+
+When an allocator needs to add memory to the pool that it manages, it requests the memory from its parent allocator. Every allocator has a pointer to its parent; multiple allocators may share a single parent. The ultimate ancestor of all allocators that can expand their pool dynamically is an allocator that calls malloc, described below. However, especially in embedded environments, an allocator may be limited to a fixed-size pool assigned to it when it is created.
+
+Allocator API
+""""""""""""""""""""""
+
+In summary, the allocator API provides the following principal operations:
+
+- Allocate and free movable (default) or immovable objects and strings.
+- Return the structure type and size of an object.
+- Resize (shrink or grow) movable objects and strings, preserving the contents insofar as possible.
+- Report the size of the managed pool, and how much of it is in use.
+- Register and unregister root pointers for the garbage collector.
+- Free the allocator itself.
+- Consolidate adjacent free blocks to reduce fragmentation.
+
+For details, see base/gsmemory.h.
+
+The allocator API also includes one special hook for the PostScript interpreter: the concept of stable allocators. See the section on "save and restore" below for details.
+
+Files:
+ base/gsmemraw.h, base/gsmemory.c, base/gsmemory.h, base/gsstruct.h, base/gsstype.h.
+
+Freeing storage
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript's memory management architecture provides three different ways to free objects: explicitly, by reference counting, or by garbage collection. They provide different safety / performance / convenience tradeoffs; we believe that all three are necessary.
+
+Objects are always freed as a whole; strings may be freed piecemeal.
+
+An object may have an associated finalization procedure, defined in the structure descriptor. This procedure is called just before the object is freed, independent of which method is being used to free the object. A few types of objects have a virtual finalization procedure as well: the finalization procedure defined in the descriptor simply calls the one in the object.
+
+Explicit freeing
+""""""""""""""""""""""
+
+Objects and strings may be freed explicitly, using the ``gs_free_`` virtual procedures in the allocator API. It is up to the client to ensure that all allocated objects are freed at most once, and that there are no dangling pointers.
+
+Explicit freeing is the fastest method, but is the least convenient and least safe. It is most appropriate when storage is freed in the same procedure where it is allocated, or for storage that is known to be referenced by only one pointer.
+
+Reference counting
+""""""""""""""""""""""
+
+Objects may be managed by reference counting. When an object is allocated, its reference count may be set to 0 or 1. Subsequently, when the reference count is decremented to 0, the object is freed.
+
+The reference counting machinery provides its own virtual finalization procedure for all reference-counted objects. The machinery calls this procedure when it is about to free the object (but not when the object is freed in any other way, which is probably a design bug). This is in addition to (and called before) any finalization procedure associated with the object type.
+
+Reference counting is as fast as explicit freeing, but takes more space in the object. It is most appropriate for relatively large objects which are referenced only from a small set of pointers. Note that reference counting cannot free objects that are involved in a pointer cycle (e.g., A -> B -> C -> A).
+
+Files:
+ base/gsrefct.h.
+
+
+(Real) garbage collection
+""""""""""""""""""""""""""""""""""""""""""""
+
+Objects and strings may be freed automatically by a garbage collector. See :ref:`below<Interpreter_GC>`.
+
+Special implementations
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+malloc
+""""""""""""""""""""""""""""""""""""""""""""
+
+As mentioned :ref:`above<Parent hierarchy>`, the ultimate ancestor of all allocators with an expandable pool is one that calls malloc.
+
+Note that the default gsmalloc.c allocator for malloc/free now uses a mutex so that allocators that use this can be assured of thread safe behavior.
+
+Files:
+ base/gsmalloc.h, base/gsmalloc.c.
+
+Locking
+""""""""""""""""""""""""""""""""""""""""""""
+
+In a multi-threaded environment, if an allocator must be callable from multiple threads (for example, if it is used to allocate structures in one thread that are passed to, and freed by, another thread), the allocator must provide mutex protection. Ghostscript provides this capability in the form of a wrapper allocator, that simply forwards all calls to a target allocator under protection of a mutex. Using the wrapper technique, any allocator can be made thread-safe.
+
+Files:
+ base/gsmemlok.h, base/gsmemlok.c.
+
+Retrying
+""""""""""""""""""""""""""""""""""""""""""""
+
+In an embedded environment, job failure due to memory exhaustion is very undesirable. Ghostscript provides a wrapper allocator that, when an allocation attempt fails, calls a client-provided procedure that can attempt to free memory, then ask for the original allocation to be retried. For example, such a procedure can wait for a queue to empty, or can free memory occupied by caches.
+
+Files:
+ base/gsmemret.h, base/gsmemret.c.
+
+Chunk
+""""""""""""""""""""""""""""""""""""""""""""
+
+When multiple threads are used and there may be frequent memory allocator requests, mutex contention is a problem and can cause severe performance degradation. The chunk memory wrapper can provide each thread with its own instance of an allocator that only makes requests on the underlying (non-GC) alloctor when large blocks are needed. Small object allocations are managed within chunks.
+
+This allocator is intended to be used on top of the basic 'gsmalloc' allocator (malloc/free) which is NOT garbage collected or relocated and which MUST be mutex protected.
+
+Files:
+ base/gsmchunk.h, base/gsmchunk.c.
+
+Standard implementation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The standard Ghostscript allocator gets storage from its parent (normally the malloc allocator) in large blocks called clumps, and then allocates objects up from the low end and strings down from the high end. Large objects or strings are allocated in their own clump.
+
+The standard allocator maintains a set of free-block lists for small object sizes, one list per size (rounded up to the word size), plus a free-block list for large objects (but not for objects so large that they get their own clump: when such an object is freed, its chunk is returned to the parent). The lists are not sorted; adjacent blocks are only merged if needed.
+
+While the standard allocator implements the generic allocator API, and is usable with the library alone, it includes a special hook for the PostScript interpreter to aid in the efficient allocation of PostScript composite objects (arrays and dictionaries). See the section on Refs below for details.
+
+Files:
+ base/gsalloc.c, base/gsalloc.h, base/gxalloc.h, base/gxobj.h.
+
+
+PostScript interpreter extensions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The PostScript interpreter uses an allocator that extends the graphic library's standard allocator to handle PostScript objects, save and restore, and real garbage collection.
+
+Refs (PostScript "objects")
+""""""""""""""""""""""""""""""""""""""""""""
+
+Ghostscript represents what the PLRM calls PostScript "objects" using a structure called a ref, defined in psi/iref.h; packed refs, used for the elements of packed arrays, are defined in psi/ipacked.h. See those files for detailed information.
+
+Files:
+ psi/ipacked.h, psi/iref.h.
+
+The PLRM calls for two types of "virtual memory" (VM) space: global and local. Ghostscript adds a third space, system VM, whose lifetime is an entire session -- i.e., it is effectively "permanent". All three spaces are subject to garbage collection. There is a separate allocator instance for each VM space (actually, two instances each for global and local spaces; see below). In a system with multiple contexts and multiple global or local VMs, each global or local VM has its own allocator instance(s).
+
+Refs that represent PostScript composite objects, and therefore include pointers to stored data, include a 2-bit VM space tag to indicate in which VM the object data are stored. In addition to system, global, and local VM, there is a tag for "foreign" VM, which means that the memory is not managed by a Ghostscript allocator at all. Every store into a composite object must check for invalidaccess: the VM space tag values are chosen to help make this check efficient. See psi/ivmspace.h, psi/iref.h, and psi/store.h for details.
+
+Files:
+ psi/ivmspace.h.
+
+PostScript composite objects (arrays and dictionaries) are usually small. Using a separate memory manager object for each composite object would waste a lot of space for object headers. Therefore, the interpreter's memory manager packs multiple composite objects (also called "ref-containing objects") into a single memory manager object, similar to the way the memory manager packs multiple objects into a clump (see above). See base/gxalloc.h for details. This memory manager object has a structure descriptor, like all other memory manager objects.
+
+Note that the value.pdict, value.refs, or value.packed member of a ref must point to a PostScript composite object, and therefore can point into the middle of a memory manager object. This requires special handling by the garbage collector (q.v.).
+
+Files:
+ psi/ialloc.c, psi/ialloc.h, psi/iastate.h, psi/iastruct.h, psi/ilocate.c, psi/imemory.h, psi/istruct.h.
+ save/.forgetsave/restore
+
+In addition to save and restore, Ghostscript provides a .forgetsave operator that makes things as though a given save had never happened. (In data base terminology, save is "begin transaction", restore is "abort transaction", and .forgetsave is "end/commit transaction"). .forgetsave was implemented for a specific commercial customer (who may no longer even be using it): it was a pain to make work, but it's in the code now, and should be maintained. See the extensive comments in psi/isave.c for more information about how these operations work.
+
+Files:
+ psi/idosave.h, psi/isave.c, psi/isave.h, psi/isstate.h, psi/store.h.
+
+
+Stable allocators
+""""""""""""""""""""
+
+Even though ``save`` and ``restore`` are concepts from the PostScript interpreter, the generic allocator architecture and API include a feature to support them, called stable allocators. Every allocator has an associated stable allocator, which tags pointers with the same VM space number but which is not subject to save and restore. System VM is intrinsically stable (its associated stable allocator is the same allocator), so there are only 5 allocators in ordinary single-context usage: system VM, stable global VM, ordinary global VM, stable local VM, ordinary local VM.
+
+The reason that we cannot simply allocate all stable objects in system VM is that their refs must still be tagged with the correct VM space number, so that the check against storing pointers from global VM to local VM can be enforced properly.
+
+All PostScript objects are normally allocated with the non-stable allocators. The stable allocators should be used with care, since using them can easily create dangling pointers: if storage allocated with a stable allocator contains any references to PostScript objects, the client is responsible for ensuring that the references don't outlive the referenced objects, normally by ensuring that any such referenced objects are allocated at the outermost save level.
+
+The original reason for wanting stable allocators was the PostScript stacks, which are essentially PostScript arrays but are not subject to save and restore. Some other uses of stable allocators are:
+
+- Several per-context structures for DPS.
+- Paths (see ``gstate_path_memory`` in base/gsstate.c.
+- Row buffers for images (see ``gs_image_row_memory`` in base/gsimage.c), because the data-reading procedure for an image can invoke save and restore.
+- Notification lists for fonts, to handle the sequence allocate .. save .. register .. restore.
+- The parameter lists for pdfwrite and epswrite devices (in devices/vector/gdevpsdp.c), because the whole issue of local vs. global VM for ``setpagedevice`` is, in the words of Ed Taft of Adobe, "a mess".
+- Many places in the pdfwrite driver, because many of its bookkeeping structures must not be restorable.
+
+
+For more specific examples, search the sources for references to ``gs_memory_stable``.
+
+
+.. _Interpreter_GC:
+
+Garbage collection
+"""""""""""""""""""""""
+
+The interpreter's garbage collector is a compacting, non-conservative, mark-and-sweep collector.
+
+- It compacts storage because that is the only way to avoid permanent sandbars, which is essential in limited-memory environments.
+- It is non-conservative because conservative collectors (which attempt to determine whether arbitrary bit patterns are pointers) cannot compact.
+- It uses mark-and-sweep, rather than a more modern copying approach, because it cannot afford the extra memory required for copying.
+
+
+Because the garbage collector is non-conservative, it cannot be run if there are any pointers to movable storage from the C stack. Thus it cannot be run automatically when the allocator is unable to allocate requested space. Instead, when the allocator has allocated a given amount of storage (the ``vm_threshold`` amount, corresponding to the PostScript ``VMThreshold`` parameter), it sets a flag that the interpreter checks in the main loop. When the interpreter sees that this flag is set, it calls the garbage collector: at that point, there are no problematic pointers from the stack.
+
+Roots for tracing must be registered with the allocator. Most roots are registered during initialization.
+
+"Mark-and-sweep" is a bit of a misnomer. The garbage collector actually has 5 main phases:
+
+- Sweep to clear marks;
+- Trace and mark;
+- Sweep to compute relocation;
+- Sweep to relocate pointers;
+- Sweep and compact.
+
+
+There is some extra complexity to handle collecting local VM only. In this case, all pointers in global VM are treated as roots, and global VM is not compacted.
+
+As noted above, PostScript arrays and strings can have refs that point within them (because of ``getinterval``). Thus the garbage collector must mark each element of an array, and even each byte of a string, individually. Specifically, it marks objects, refs, and strings using 3 different mechanisms:
+
+- Objects have a mark bit in their header: see base/gxobj.h,
+- Refs and packed refs have a reserved mark bit: see psi/iref.h and psi/ipacked.h.
+- Strings use a separate bit table, with one bit per string byte: see base/gxalloc.h,
+
+Similarly, it records the relocation information for objects, refs, and strings differently:
+
+- Objects record relocation in the object header.
+- Refs record relocation in unused fields of refs such as nulls that don't use their value field. Every memory manager object that stores ref-containing objects as described above has an extra, unused ref at the end for this purpose.
+- Strings use a separate relocation table.
+
+Files:
+ psi/igc.c, psi/igc.h, psi/igcref.c, psi/igcstr.c, psi/igcstr.h, psi/ireclaim.c.
+
+
+Portability
+~~~~~~~~~~~~~~~~~~~~~~~
+
+One of Ghostscript's most important features is its great portability across platforms (CPUs, operating systems, compilers, and build tools). The code supports portability through two mechanisms:
+
+- `Structural mechanisms`_ -- segregating platform-dependent information into files in a particular way.
+- `Coding standards`_ -- avoiding relying on byte order, scalar size, and platform-specific compiler or library features.
+
+
+
+
+Structural mechanisms
+"""""""""""""""""""""""""
+
+CPU and compiler
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Ghostscript attempts to discover characteristics of the CPU and compiler automatically during the build process, by compiling and then executing a program called genarch. genarch generates a file ``obj/arch.h``, which almost all Ghostscript files then include. This works well for things like word size, byte order, and floating point representation, but it can't determine whether or not a compiler supports a particular feature, because if a feature is absent, the compilation may fail.
+
+Files:
+ base/genarch.c, obj/arch.h.
+
+Library headers
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+Despite the supposed standardization of ANSI C, platforms vary considerably in where (and whether) they provide various standard library facilities. Currently, Ghostscript's build process doesn't attempt to sort this out automatically. Instead, for each library header file ``<xxx.h>`` there is a corresponding Ghostscript source file ``base/xxx_.h``, containing a set of compile-time conditionals that attempt to select the correct platform header file, or in some cases substitute Ghostscript's own code for a missing facility. You may need to edit these files when moving to platforms with unusually non-standard libraries.
+
+Files:
+ ``base/ctype_.h``, ``base/dirent_.h``, ``base/dos_.h``, ``base/errno_.h``, ``base/fcntl_.h``, ``base/jerror_.h``, ``base/malloc_.h``, ``base/math_.h``, ``base/memory_.h``, ``base/pipe_.h``, ``base/png_.h``, ``base/setjmp_.h``, ``base/stat_.h``, ``base/stdint_.h``, ``base/stdio_.h``, ``base/string_.h``, ``base/time_.h``, ``base/unistd_.h``, ``base/vmsmath.h``, ``base/windows_.h``, ``base/x_.h``
+
+It has been suggested that the GNU configure scripts do the above better, for Unix systems, than Ghostscript's current methods. While this may be true, we have found configure scripts difficult to write, understand, and maintain; and the autoconf tool for generating configure scripts, which we found easy to use, doesn't cover much of the ground that Ghostscript requires.
+
+Cross-platform APIs
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+For a few library facilities that are available on all platforms but are not well standardized, or that may need to be changed for special environments, Ghostscript defines its own APIs. It is an architectural property of Ghostscript that the implementations of these APIs are the only .c files for which the choice of platform (as opposed to choices of drivers or optional features) determines whether they are compiled and linked into an executable.
+
+API:
+ base/gp.h, base/gpcheck.h, base/gpgetenv.h, base/gpmisc.h, base/gpsync.h.
+
+
+Implementation files shared among multiple platforms:
+ base/gp_getnv.c, base/gp_mktmp.c, base/gp_nsync.c, base/gp_paper.c, base/gp_psync.c, base/gp_strdl.c, base/gpmisc.c.
+
+
+Platform-specific implementation files:
+ base/gp_dosfe.c, base/gp_dosfs.c, base/gp_dvx.c, base/gp_msdos.c, base/gp_mshdl.c, base/gp_mslib.c, base/gp_mswin.c, base/gp_mswin.h, base/gp_ntfs.c, base/gp_os2.c, base/gp_os2.h, base/gp_os2fs.c, base/gp_os9.c, base/gp_stdia.c, base/gp_stdin.c, base/gp_unifn.c, base/gp_unifs.c, base/gp_unix.c, base/gp_unix_cache.c, base/gp_upapr.c, base/gp_vms.c, base/gp_wgetv.c, base/gp_win32.c, base/gp_wpapr.c, base/gp_wsync.c, base/gs_dll_call.h.
+
+
+Makefiles
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+For information on the structure and conventions used within makefiles, see the `Makefile structure`_ section above.
+
+Ghostscript's makefiles are structured very similarly to the cross-platform library files. The great majority of the makefiles are portable across all platforms and all versions of make. To achieve this, the platform-independent makefiles must obey two constraints beyond those of the POSIX make program:
+
+- No conditionals or includes are allowed. While most make programs now provide some form of conditional execution and some form of inclusion, there is no agreement on the syntax. (Conditionals and includes are allowed in platform-dependent makefiles; in fact, an inclusion facility is required.)
+- There must be a space on both sides of the : that separates the target of a rule from its dependencies. This is required for compatibility with the OpenVMS MMS and MMK programs.
+
+
+The top-level makefile for each platform (where "platform" includes the OS, the compiler, and the flavor of make) contains all the build options, plus includes for the generic makefiles and any platform-dependent makefiles that are shared among multiple platforms.
+
+While most of the top-level makefiles build a PostScript and/or PDF interpreter configuration, there are also a few makefiles that build a test program that only uses the graphics library without any language interpreter. Among other things, this can be helpful in verifying that no accidental dependencies on the interpreter have crept into the library or drivers.
+
+For families of similar platforms, the question arises whether to use multiple top-level makefiles, or whether to use a single top-level makefile that may require minor editing for some (or all) platforms. Ghostscript currently uses the following top-level makefiles for building interpreter configurations:
+
+
+- POSIX systems (inluding Linux and Unix):
+ - GNU Autoconf source script for automatic build configuration.
+ - Makefile.in, source for the top-level makefile used in the Autoconf build.
+ - base/unix-gcc.mak, for Unix with gcc.
+ - base/unixansi.mak, for Unix with an ANSI C compiler other than gcc.
+- PC:
+ - ghostscript.vcproj, Visual Studio project file used to build Ghostscript.
+ - psi/msvc32.mak, for MS Windows with Microsoft Visual C (MSVC).
+ - psi/os2.mak, for MS-DOS or OS/2 GCC/EMX environment.
+- Macintosh:
+ - base/macosx.mak, commandline makefile for MacOS X.
+ - base/macos-mcp.mak, dummy makefile to generate an xml project file for Metrowerks Codewarrior.
+- Other:
+ - base/all-arch.mak, for building on many Unix systems in a networked test environment.
+ - base/openvms.mak, for OpenVMS with Digital's CC compiler and the MMS build program.
+ - base/openvms.mmk, for OpenVMS with Digital's CC compiler and the MMK build program.
+
+The following top-level makefiles build the library test program:
+
+- base/ugcclib.mak, on Unix with gcc.
+- base/msvclib.mak, on MS Windows with MSVC.
+
+The MSVC makefiles may require editing to select between different versions of MSVC, since different versions may have slightly incompatible command line switches or customary installation path names. The Unix makefiles often require editing to deal with differing library path names and/or library names. For details, see the :ref:`Unix section of the documentation<MakeHowToBuildForUnix>` for building Ghostscript.
+
+Library test program:
+ base/gslib.c.
+
+Platform-independent makefiles:
+ Graphics library and support:
+ devices/contrib.mak, devices/devs.mak, base/gs.mak, base/lib.mak, base/version.mak.
+
+ PostScript interpreter and fonts:
+ psi/int.mak.
+
+ Third-party libraries:
+ base/expat.mak, base/ijs.mak, base/jbig2.mak, base/ldf_jb2.mak, base/lwf_jp2.mak, base/jpeg.mak, base/png.mak, base/zlib.mak.
+
+
+Shared platform-dependent makefiles:
+ Unix:
+ base/unix-aux.mak, base/unix-dll.mak, base/unix-end.mak, base/unixhead.mak, base/unixinst.mak, base/unixlink.mak.
+
+ Microsoft Windows and MS-DOS:
+ base/msvccmd.mak, base/msvctail.mak, base/pcwin.mak, psi/winint.mak, base/winlib.mak, base/winplat.mak.
+
+
+Coding standards
+"""""""""""""""""""
+
+Coding for portability requires avoiding both explicit dependencies, such as platform-dependent ``#ifdefs``, and implicit dependencies, such as dependencies on byte order or the size of the integral types.
+
+Explicit dependencies
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The platform-independent .c files never, ever, use ``#ifdef`` or ``#if`` to select code for specific platforms. Instead, we always try to characterize some abstract property that is being tested. For example, rather than checking for macros that are defined on those specific platforms that have 64-bit long values, we define a macro ARCH_SIZEOF_LONG that can then be tested. Such macros are always defined in a .h file, either automatically in arch.h, or explicitly in a ``xxx_.h`` file, as described in earlier sections.
+
+Files:
+ base/std.h, base/stdpn.h, base/stdpre.h.
+
+Implicit dependencies
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The most common source of byte ordering dependencies is casting between types (``T1 *``) and (``T2 *``) where ``T1`` and ``T2`` are numeric types that aren't merely signed/unsigned variants of each other. To avoid this, the only casts allowed in the code are between numeric types, from a pointer type to a long integral type, and between pointer types.
+
+Ghostscript's code assumes the following about the sizes of various types:
+
+char
+ 8 bits
+
+short
+ 16 bits
+
+int
+ 32 or 64 bits
+
+long
+ 32 or 64 bits
+
+float
+ 32 bits (may work with 64 bits)
+
+double
+ 64 bits (may work with 128 bits)
+
+The code does not assume that the char type is signed (or unsigned); except for places where the value is always a literal string, or for interfacing to library procedures, the code uses ``byte`` (a Ghostscript synonym for ``unsigned char``) almost everywhere.
+
+Pointers are signed on some platforms and unsigned on others. In the few places in the memory manager where it's necessary to reliably order-compare (as opposed to equality-compare) pointers that aren't known to point to the same allocated block of memory, the code uses the PTR_relation macros rather than direct comparisons.
+
+See the files listed above for other situations where a macro provides platform-independence or a workaround for bugs in specific compilers or libraries (of which there are a distressing number).
+
+Platform-specific code
+""""""""""""""""""""""""""""""""
+
+There are some features that are inherently platform-specific:
+
+- Microsoft Windows requires a lot of special top-level code, and also has an installer and uninstaller.
+- OS/2 requires a little special code.
+- MacOS also requires special top-level code (now distributed with the standard Ghostscript package).
+- All platforms supporting DLLs (currently all three of the above) share some special top-level code.
+
+
+MS Windows files:
+ psi/dpmain.c, psi/dwdll.c, psi/dwdll.h, psi/dwimg.c, psi/dwimg.h, psi/dwmain.c, psi/dwmainc.c, psi/dwnodll.c, psi/dwreg.c, psi/dwreg.h, psi/dwres.h, psi/dwtext.c, psi/dwtext.h, psi/dwtrace.c, psi/dwtrace.h, base/gp_msdll.c, base/gp_mspol.c, base/gp_msprn.c, base/gsdllwin.h.
+
+OS/2 files:
+ base/gp_os2pr.c,
+
+Unix files:
+ psi/dxmain.c, psi/dxmainc.c.
+
+Macintosh files:
+ devices/gdevmac.c, devices/gdevmac.h, devices/gdevmacpictop.h, devices/gdevmacttf.h, base/gp_mac.c, base/gp_mac.h, base/gp_macio.c, base/gp_macpoll.c, base/gsiomacres.c, base/macgenmcpxml.sh, base/macsystypes.h, base/macos_carbon_pre.h, base/macos_carbon_d_pre.h, base/macos_classic_d_pre.h, psi/dmmain.c, psi/dmmain.r.
+
+VMS files:
+ base/vms_x_fix.h.
+
+DLL files:
+ psi/gsdll.c, base/gsdll.h, devices/gdevdsp.c, devices/gdevdsp.h, devices/gdevdsp2.h, psi/iapi.c, psi/iapi.h, psi/idisp.c, psi/idisp.h.
+ The new DLL interface (new as of 7.0) is especially useful with the new display device, so it is included here. Both are due to Russell Lang.
+
+Troubleshooting
+-------------------------
+
+The Ghostscript code has many tracing and debugging features that can be enabled at run time using the -Z command line switch, if the executable was compiled with ``DEBUG`` defined. One particularly useful combination is ``-Z@\?``, which fills free memory blocks with a pattern and also turns on run-time memory consistency checking. For more information, see doc/Use.htm#Debugging; you can also search for occurrences of ``if_debug`` or ``gs_debug_c`` in the source code. Note that many of these features are in the graphics library and do not require a PostScript interpreter.
+
+The code also contains many run-time procedures whose only purpose is to be called from the debugger to print out various data structures, including all the procedures in psi/idebug.c (for the PostScript interpreter) and the ``debug_dump_`` procedures in base/gsmisc.c.
+
+Files:
+ doc/Use.htm#Debugging, base/gdebug.h, base/gsmdebug.h, psi/idebug.h, psi/idebug.c.
+
+
+Profiling
+-------------------------
+
+
+Profiling with Microsoft Developer Studio 6
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The Microsoft profiling tool is included into Microsoft Developer Studio 6 Enterprise Edition only. Standard Edition and Professional Edition do not include it.
+
+Microsoft profiler tool requires the application to be linked with a special linker option. To provide it you need the following change to gs/base/msvccmd.mak:
+
+
+.. code-block:: bash
+
+ *** SVN-GS\HEAD\gs\src\msvccmd.mak Tue Jan 9 21:41:07 2007
+ --- gs\src\msvccmd.mak Mon May 7 11:29:35 2007
+ ***************
+ *** 159,163 ****
+ # Note that it must be followed by a space.
+ CT=/Od /Fd$(GLOBJDIR) $(NULL) $(CDCC) $(CPCH)
+ ! LCT=/DEBUG /INCREMENTAL:YES
+ COMPILE_FULL_OPTIMIZED= # no optimization when debugging
+ COMPILE_WITH_FRAMES= # no optimization when debugging
+ --- 159,164 ----
+ # Note that it must be followed by a space.
+ CT=/Od /Fd$(GLOBJDIR) $(NULL) $(CDCC) $(CPCH)
+ ! # LCT=/DEBUG /INCREMENTAL:YES
+ ! LCT=/DEBUG /PROFILE
+ COMPILE_FULL_OPTIMIZED= # no optimization when debugging
+ COMPILE_WITH_FRAMES= # no optimization when debugging
+ ***************
+ *** 167,175 ****
+ !if $(DEBUGSYM)==0
+ CT=
+ ! LCT=
+ CMT=/MT
+ !else
+ CT=/Zi /Fd$(GLOBJDIR) $(NULL)
+ ! LCT=/DEBUG
+ CMT=/MTd
+ !endif
+ --- 168,178 ----
+ !if $(DEBUGSYM)==0
+ CT=
+ ! # LCT=
+ ! LCT=/PROFILE
+ CMT=/MT
+ !else
+ CT=/Zi /Fd$(GLOBJDIR) $(NULL)
+ ! # LCT=/DEBUG
+ ! LCT=/DEBUG /PROFILE
+ CMT=/MTd
+ !endif
+
+
+.. note ::
+
+ Any of debug and release build may be profiled.
+
+Microsoft Profiler tool can't profile a dynamically loaded DLLs. When building Ghostscript with makefiles you need to specify ``MAKEDLL=0`` to nmake command line.
+
+The Integrated Development Environment of Microsoft Developer Studio 6 cannot profile a makefile-based project. Therefore the profiling tool to be started from command line.
+
+The profiling from command line is a 4 step procedure. The following batch file provides a sample for it :
+
+
+.. code-block:: bash
+
+ set DEVSTUDIO=G:\Program Files\Microsoft Visual Studio
+ set GS_HOME=..\..\gs-hdp
+ set GS_COMMAND_LINE=%GS_HOME%\bin\gswin32c.exe -I%GS_HOME%\lib;f:\afpl\fonts -r144 -dBATCH -dNOPAUSE -d/DEBUG attachment.pdf
+ set START_FUNCTION=_main
+ set Path=%DEVSTUDIO%\Common\MSDev98\Bin;%DEVSTUDIO%\VC98\Bin
+ PREP.EXE /OM /SF %START_FUNCTION% /FT %GS_HOME%\bin\gswin32c.exe
+ If ERRORLEVEL 1 echo step 1 fails&exit
+ PROFILE /I %GS_HOME%\bin\gswin32c.pbi %GS_COMMAND_LINE%
+ If ERRORLEVEL 1 echo step 2 fails&exit
+ PREP /M %GS_HOME%\bin\gswin32c /OT xxx.pbt
+ If ERRORLEVEL 1 echo step 3 fails&exit
+ PLIST /ST xxx.pbt >profile.txt
+ If ERRORLEVEL 1 echo step 4 fails&exit
+
+This batch file to be adopted to your configuration :
+
+- Edit the path to developer studio in the line 1.
+- Edit the Ghostscript home directory in the line 2.
+- Edit Ghostscript command line in line 3. Note that profiling without ``/NOPAUSE`` is a bad idea.
+- In the line 4 edit the function name to start the profiling from. The sample code specifies ``_main`` as the starting function. Note it is the linker's function name, which starts with underscore.
+- Edit the output file name in the line 5.
+
+
+
+
+.. include:: footer.rst \ No newline at end of file
diff --git a/doc/src/DeviceSubclassing.rst b/doc/src/DeviceSubclassing.rst
new file mode 100644
index 00000000..e53ef637
--- /dev/null
+++ b/doc/src/DeviceSubclassing.rst
@@ -0,0 +1,549 @@
+.. title:: Device Subclassing
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _DeviceSubclassing.htm:
+
+
+Device Subclassing
+==========================================
+
+
+
+
+
+
+Devices in the graphics state
+--------------------------------
+
+The 'device' is a member of the graphics state in PostScript, and is subject to gsave/grestore, like any other part of the graphics state. This is important for PostScript as it allows us to, for example, push the null device, perform some operations, and then grestore back to the original rendering device.
+
+In PostScript and PDF, the graphics state is itself a garbage collected object, as is the device. This means that we store a pointer to the device in the graphics state, which forces the other interpreters to do so as well. Now an important implication of this is that it is then only possible, currently, to change devices by altering the graphics state entry to point at a different device structure, which means that the graphics state must be available in order to do so. Clearly at the interpreter level this isn't a problem, but at lower levels the graphics state may not be available, not all our device methods pass on a graphics state pointer for example. Without that pointer we can't change the graphics state and therefore can't point at a different device.
+
+
+
+Chaining devices
+--------------------------------
+There are times when it is useful to be able to chain devices one after another, examples include the PDF transparency device, the pattern accumulator device and others. Some comments in early code indicate that the ability to chain devices was an original design goal, though its likely that originally this was only intended to work by installing devices from the interpreter level.
+
+Currently there are a number of different ways to install devices, and the sheer number, and the methods themselves, show why there is a problem. Lets consider them separately.
+
+- Forwarding devices. These devices generally intercept the usual graphics marking operations, and pass them on to the underlying device, or record some features of interest. Examples of these include the bbox device and the pattern accumulator. These work very well, but require the graphics state to be available when we need to insert them ahead of the 'underlying' device. This can be a problem, as we'll see later.
+
+- The device filter stack. This appears to be an early attempt at providing a way to chain devices together. From traces remaining in the code this seems to originally have been intended to implement the PDF 1.4 transparency rendering. Its clear, however, that it is no longer used for that purpose and appears to be completely redundant. In any event it also requires access to the graphics state and so would suffer the same limitation.
+
+- The clist. The clist code uses a very brute force approach to the problem, and only works for a single device. When a device is turned into a clist device, the code essentially guts the device and rewrites it (it replaces the overwritten entries later). This does work (though it seems rather horrendous to me) and doesn't require access to the graphics state because we simply reuse the existing memory of the original device. However this doesn't get us a 'chain', the clist simply morphs the existing device into something different.
+
+- The PDF transparency compositor. This works in several ways to install itself, but the one of most interest is the case where we return from the device 'create_compositor' method. The interpreter is required to treat the return value as a pointer to a device, and if its not the same as the device currently in the graphics state, then it alters the graphics state to point to the new device. I'm not sure why its done this way as we do actually have access to the graphics state in this method and could presumably install the device ourselves. However it is not useful as a general purpose method for installing devices as it requires the return value to be acted upon by the interpreter. Making this general would require us to modify all the existing device methods, and have the interpreters check the return value, it would almost certainly be simpler (and more useful) to alter the methods to always include a graphics state.
+
+- The 'spy' device. This is a somewhat non-standard device written by Robin, it works by copying the pointer to the device methods, and then replacing all the device methods, it is thus very similar to the clist device.
+
+
+
+Taken together we have a number of different routes to install devices, but none of them is totally satisfactory for the goal of creating a chain of devices without access to the graphics state. However I think the existence of these manifold routes do indicate that there has been a recognition in the past that this would be useful to have.
+
+
+Subclassing
+------------------
+
+From the above, its clear that we need to use some approach similar to the clist and spy devices. We must retain the original device memory, because that is what the graphics state points to, which means that we must reuse that memory in some fashion. By making a copy of the existing device elsewhere, we can then recycle the existing device.
+
+As a short summary, that's precisely what the device subclassing code does. It examines the existing device, makes a new device structure sufficiently large to take a copy of it, and copies the existing device and all its state to that new memory. It then uses the prototype supplied for the new class, and writes that into the original device memory.
+
+New device members
+~~~~~~~~~~~~~~~~~~~~
+
+In order to chain the devices together, I've added three new pointers to the device structure (so that all devices can be chained), a child, a parent and a 'data' pointer (see below). Whenever we subclass a device the copied device gets its parent member set to the original device pointer, and the new device points to the copied one using the child member.
+
+Now a subtle point here is that, because we cannot change the size of the memory allocated for the original device (as that might relocate it, invalidating the graphics state pointer) its absolutely vital that the new device must be no larger than the old device. This means we have to be careful about data which the new device needs, we can't simply store it in the device structure as we usually do. To resolve that I've also added a void pointer to hold private data, the new device should allocate as much data as it requires (eg a structure) and store a pointer to that data in the subclass_data pointer. I'd recommend that this is allocated from non-GC memory except in special cases. This should mean that subclassing devices are never larger than a gx_device structure and so never overflow.
+
+Subclassing made easy
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In order to minimise the number of methods that a subclassing device needs to define I've created 'default' methods for all the possible device methods. Subclassing devices should use these in their prototype for any methods they don't handle. Additionally these can be used to pass on any methods after processing by the subclassing device, if required.
+
+
+
+Example uses
+-----------------
+
+The original justification for this work was to create a device which would add 'first page' and 'last page' functionality to all the languages and all the devices. The gdevflp.c file incorporates exactly that, it has been added to gdevprn.c and gdevvec.c so that any device based on either of these two basic devices will simply work. Additionally other devices which are not based on either of these (eg the 'bit' device) have been appropriately modified.
+
+If ``-dFirstPage`` or ``-dLastPage`` is set the parameter is parsed out and the existing device is subclassed by the new First/Last page device. This device simply drops all marking operations, and 'output_page' operations until we reach the page defined by FirstPage, and then passes everything through to the real device until we pass the page defined by ``LastPage`` at which point it throws everything away again until the end of the input.
+
+Now, this is not as efficient as the PDF interpreter's usage, which only passes those pages required to be rendered. So the old functionality has been preserved in the PDF interpreter, exactly as before. In order to prevent the subclassing device addionally acting on the same parameters, there is a ``DisablePageHandler`` flag which is set by the PDF interpreter.
+
+In order to test the chaining of devices together, I also created an 'object filtering' device; as with the first/last page device this has been added to all devices and any device based off gdevprn or gdevvec should inherit the functionality directly. This device allows objects to be dropped based on their type (text, image or linework) using the parameters ``-dFILTERTEXT`` ``-dFILTERIMAGE`` and ``-dFILTERVECTOR``, if a parameter is set then objects of that type will not be rendered.
+
+Finally the PCL interpreter now uses a subclassing device to implement the 'monochrome palette' rendering. Previously this directly modified the ``color_procs`` in the current device, which I suspect was prone to potential failure (for example if a forwarding device had been pushed). This eliminated a somewhat ugly hack (in fairness its not obvious what would have been better), as well as allowing me to do away with some global variables in the PCL interpreter.
+
+
+
+Observations
+---------------
+
+The monochrome palette device illuminated an interesting problem in the graphics library. Normally the device calls the graphics library for rendering services, but the ``color_procs`` work in reverse, the graphics library calls the device directly in order to map the colours. In the case of chained devices this meant that only the final device was being called. This was unacceptable in a situation involving chained devices, it seemed obvious to me that the graphics library should pass the request to the head of the device chain for processing. There is no simple way to do this (no access to the graphics state!) so instead I used the linked list of child/parent pointers to walk up to the head of the list, and then submit the request to that device.
+
+The ICC profile code has a ``get_profile`` method in the device API to retrieve a profile, but it has no corresponding ``set_profile`` method, it simply sets the structure member in the current device. This caused some serious problems. Consider the case where the ICC code executes a ``get_profile`` and no profile is yet set (returning NULL). The code would then create a profile and attach it directly to the current device. It then executes ``get_profile`` again. If the current device was a subclassing device, or a forwarding device, then the 'set' would have set the profile in that device, but the 'get' would retrieve it from the underlying device, which would still be NULL. Since the ICC code didn't test the result on the second call this caused a segmentation fault. I've modified the ICC code to set the profile in the lowest device, but this probably ought to be improved to define a new ``set_profile`` method.
+
+The tag devices write an extra colour plane in the output, where the value of the sample encodes the type of graphic that was rendered at that point (text, image, path, untouched or unknown). This is done by encoding the type in the color, which is performed by the graphics library. Now, when the type of operation changes (eg from image to text) we need to tell the graphics library that there has been a change. We do this by calling the ``set_graphics_type_tag`` device method. However, when encoding a color, the graphics library does not, as one might expect call a matching ``get_graphics_type`` method, instead it directly inspects the devcie structure and reads the ``graphics_type_tag`` member. This means that all devices in the chain must maintain this member, the implication is that if a subclassing device should implement its own ``set_graphics_type_tag`` method, it must update the ``graphics_type_tag`` in its device structure appropriately, and pass the method on to the next device in the chain. The default method already does this.
+
+Its pretty clear from reading through the code that the original intention of the device methods is that all methods in a device should be filled in, they should never be NULL (exception; ``fill_rectangle`` is deliberately excluded from this) if a device does not implement a method then ``fill_in_procs`` should set a default method (which may legitimately simply throw an error). Over time this decision has not been enforced with the result that we now have some places where methods may be NULL. This has meant that there are places in the code which have to check for a method being NULL before using it, which is (I think) exactly what we were originally trying to avoid. Worse, since there is no list of which methods may be NULL a sensible developer would have to test all methods before use. Worst of all, it looks like some places may take a NULL method as having specific meaning (``gsdparam.c`` line 272). We should really tidy this up.
+
+General observations are recorded in comments in ``gdevsclass.c``.
+
+
+Worked example
+---------------
+
+To see how to use the device subclassing we'll take a concrete example and implement it in a real device. For the purposes of the example we'll do a 'force black text' device and add it to the TIFF device(s). The reason for choosing the TIFF devices is that these already have an ``open_device`` method which we are going to use to install the subclassing device. This isn't essential, you could install the device at any point, but its convenient.
+
+The first thing we need to do is add some control to turn this feature off and on, this is normally done by setting device parameters on the command line. To implement this we will need to modify the ``put_params`` and ``get_params`` methods. Note it is important to add new parameters to both the get and put methods, or an error will occur. We'll call our new parameter ``ForceBlackText``.
+
+First we add the new parameter to the TIFF device, defined in ``gdevtifs.h``:
+
+
+.. code-block:: c
+
+ typedef struct gx_device_tiff_s {
+ gx_device_common;
+ gx_prn_device_common;
+ bool ForceBlackText;
+ bool BlackTextHandlerPushed;
+ ....
+ }
+
+Note that we also have a boolean value ``BlackTextHandlerPushed`` to track whether the device is already pushed or not, we'll want to use this later.
+
+We also need to add default values to the device prototypes, which are defined in ``gdevtfnx.c``:
+
+
+.. code-block:: c
+
+ const gx_device_tiff gs_tiff12nc_device = {
+ prn_device_std_body(gx_device_tiff, tiff12_procs, "tiff12nc",
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
+ X_DPI, Y_DPI,
+ 0, 0, 0, 0,
+ 24, tiff12_print_page),
+ 0, /* ForceBlacktext */
+ 0, /* BlacktextHandlerPushed */
+ arch_is_big_endian /* default to native endian (i.e. use big endian iff the platform is so*/,
+
+
+Repeat for ``gs_tiff24nc_device`` and ``gs_tiff48nc_device``. For unknown reasons, the remaining TIFF devices are in ``gdevtsep.c``, we need to make the same changes to the prototypes there; ``gs_tiffgray_device`` ``gs_tiffscaled_device`` ``gs_tiffscaled8_device`` ``gs_tiffscaled24_device`` ``gs_tiffscaled32_device`` ``gs_tiffscaled4_device`` ``gs_tiff32nc_device`` ``gs_tiff64nc_device`` and finally ``tiffsep_devices_body``.
+
+Now we add code to ``put_params`` and ``get_params`` to set the parameter, and report its value back to the interpreter. In ``gdevtifs.c``:
+
+
+.. code-block:: c
+
+ static int tiff_get_some_params(gx_device * dev, gs_param_list * plist, int which)
+ {
+ gx_device_tiff *const tfdev = (gx_device_tiff *)dev;
+ int code = gdev_prn_get_params(dev, plist);
+ int ecode = code;
+ gs_param_string comprstr;
+
+ if ((code = param_write_bool(plist, "ForceBlackText", &tfdev->ForceBlackText)) < 0)
+ ecode = code;
+ ....
+ }
+
+ static int tiff_put_some_params(gx_device * dev, gs_param_list * plist, int which)
+ {
+ gx_device_tiff *const tfdev = (gx_device_tiff *)dev; int ecode = 0;
+ int code;
+ const char *param_name;
+ bool big_endian = tfdev->BigEndian;
+ bool usebigtiff = tfdev->UseBigTIFF;
+ uint16 compr = tfdev->Compression;
+ gs_param_string comprstr;
+ long downscale = tfdev->DownScaleFactor;
+ long mss = tfdev->MaxStripSize;
+ long aw = tfdev->AdjustWidth;
+ long mfs = tfdev->MinFeatureSize;
+ bool ForceBlackText = tfdev->ForceBlackText;
+
+ /* Read ForceBlackText option as bool */
+ switch (code = param_read_bool(plist, (param_name = "ForceBlackText"), &ForceBlackText)) {
+ default:
+ ecode = code;
+ param_signal_error(plist, param_name, ecode);
+ case 0:
+ case 1:
+ break;
+ }
+
+ /* Read BigEndian option as bool */
+ switch (code = param_read_bool(plist, (param_name = "BigEndian"), &big_endian)) {
+ ...
+ tfdev->MinFeatureSize = mfs;
+ tfdev->ForceBlackText = ForceBlackText;
+ return code;
+ }
+ }
+
+
+Checking the TIFF device's open method (tiff_open) we see that it already potentially has two subclassing devices, this is because it doesn't inherit from ``gdev_prn``, if it did this functionality would be inherited as well. We can just go ahead and add our new subclassing device in here.
+
+
+.. code-block:: c
+
+ int tiff_open(gx_device *pdev)
+ {
+ gx_device_printer * const ppdev = (gx_device_printer *)pdev;
+ gx_device_tiff *tfdev = (gx_device_tiff *)pdev;
+ int code;
+ bool update_procs = false;
+
+ /* Use our own warning and error message handlers in libtiff */
+ tiff_set_handlers();
+
+ if (!tfdev->BlackTextHandlerPushed && (tfdev->ForceBlackText != 0)) {
+ gx_device *dev;
+
+ gx_device_subclass(pdev, (gx_device *)&gs_black_text_device, sizeof(black_text_subclass_data));
+ tfdev = (gx_device_tiff *)pdev->child;
+ tfdev->BlackTextHandlerPushed = true;
+
+ while(pdev->child)
+ pdev = pdev->child;
+ pdev->is_open = true;
+ update_procs = true;
+ }
+
+
+You might notice that this is a little simpler than the other device installations, that's because the other devices can potentially be installed by any device, and we need to track them more carefully. Our new device can only be installed by the TIFF device, so we don't need to note that its been installed already, in all the parent and child devices. This is only done so that we don't accidentally install these more basic devices more than once.
+
+So the first thing we do is check to see if we've already installed the device to force black text (we can potentially call the open method more than once and we don't want to install the device multiple times). If we haven't installed the device yet, and the feature has been requested, then we call the code to subclass the current device using the ``black_text_device`` as the prototype for the new device, and pass in the amount of data it requires for its private usage.
+
+We will be defining this device as the next steps, for now just notice that after we call this, the 'current' device in the graphics state will be the ``black_text_device``, and its 'child' member will be pointing to the TIFF device. So we note in that child device that we have pushed the black text handling device. We also note that the TIFF device is 'open' (the calling code will do this for the device pointed to by the graphics state, i.e. the black text device). Finally we set a boolean to 'update procs'. This is needed because the ``tiff_open`` routine calls ``gdev_prn_allocate_memory`` which resets the device methods, we need to put them back to be correct for our device(s), which is done at the end of the ``tiff_open`` code:
+
+
+.. code-block:: c
+
+ if (update_procs) {
+ if (pdev->ObjectHandlerPushed) {
+ gx_copy_device_procs(&pdev->parent->procs, &pdev->procs, (gx_device_procs *)&gs_obj_filter_device.procs);
+ pdev = pdev->parent;
+ }
+ if (pdev->PageHandlerPushed) {
+ gx_copy_device_procs(&pdev->parent->procs, &pdev->procs, (gx_device_procs *)&gs_flp_device.procs);
+ pdev = pdev->parent;
+ }
+ /* set tfdev to the bottom device in the chain */
+ tfdev = (gx_device_tiff *)pdev;
+ while (tfdev->child)
+ tfdev = (gx_device_tiff *)tfdev->child;
+ if (tfdev->BlackTextHandlerPushed)
+ gx_copy_device_procs(&pdev->parent->procs, &pdev->procs, (gx_device_procs *)&gs_black_text_device.procs);
+ }
+
+In essence this simply works backwards through the chain of devices, restoring the correct methods as it goes. Note that because the ``BlackTextHandlerPushed`` variable isn't defined in the basic device structure, we have to cast the device pointer to a ``gx_device_tiff *`` so that we can set and check the variable which is defined there.
+
+That completes the changes we need to make to the TIFF device to add support for our new code. Now we need to create the ``black_text`` device which will do the actual work.
+
+We don't need any extras in the device structure, so we'll just define our subclassing device as being a ``gx_device``:
+
+
+.. code-block:: c
+
+ /* Black Text device */
+ typedef struct gx_device_s gx_device_black_text;
+
+We also don't need any extra storage, but we do need to carry round the basic storage required by a subclassing device, so we do need to define a structure for that:
+
+
+.. code-block:: c
+
+ typedef struct {
+ subclass_common;
+ } black_text_subclass_data;
+
+Now, we are going to deal with text (obviously) and text, like images, is handled rather awkwardly in the current device interface. Instead of the interpreter calling the various device methods, the ``text_begin`` method creates a text enumerator which it returns to the interpreter. The text enumerator contains its own set of methods for dealing with text, and the interpreter calls these, thus bypassing the device itself. Since our subclassing requires us to pass down a chain of devices, when dealing with text and images we must also implement a chain of enumerators. For subclassing devices which don't process text or images this is catered for in the ``default_subclass_*`` methods, but in this case we need to handle the situation.
+
+We start by creating our own text enumerator structure:
+
+.. code-block:: c
+
+ typedef struct black_text_text_enum_s {
+ gs_text_enum_common;
+ gs_text_enum_t *child;
+ } black_text_text_enum_t;
+
+
+Here we have a structure which contains the elements common to all enumerators, and a pointer to the next enumerator in the chain, we'll fill that in later.
+
+Ghostscript uses several memory managers, but for PostScript and PDF objects we use a garbage collector. Because we may want to store pointers to garbage collected objects in the text enumerator, and our device, we need to make the garbage collector aware of them. This is because the garbage collector can relocate objects in memory, in order to do so safely it needs to update any pointers referencing those objects with the new location and so it needs to be told about those pointers.
+
+So, we define a garbage collector structure for the text enumerator:
+
+.. code-block:: c
+
+ extern_st(st_gs_text_enum);
+ gs_private_st_suffix_add1(st_black_text_text_enum, black_text_text_enum_t, "black_text_text_enum_t", black_text_text_enum_enum_ptrs, black_text_text_enum_reloc_ptrs, st_gs_text_enum, child);
+
+
+The macro ``extern_st`` simply defines the structure (``st_gs_text_enum``) as being of type ``gs_memory_struct_type_t``. We need this structure for the 'superstructure' defined below.
+
+The next macro ``gs_private_st_suffix_add1`` is one of a family of macros used to define structures for the garbage collector. These all end up defining the named structure as being of type ``gc_struct_data_t`` and fill in various members of that structure. In this case we are declaring that the structure:
+
+ - Has one pointer to additional garbage collected objects (``add_1``)
+ - Its name is ``st_black_text_text_enum``
+ - It is of type ``black_text_text_enum_t``
+ - Has the readable name for error messages ``black_text_text_enum_t``
+ - The routine to be called to enumerate the garbage collected pointers in the structure is ``black_text_text_enum_enum_ptrs``
+ - The routine to be called when relocating garbage collcted objects pointed to by the structure is ``black_text_text_enum_reloc_ptrs``
+ - The 'superstructure' (i.e. the structure type this is based on) is ``st_gs_text_enum``. This means that all the enumeration and relocation methods for any pointers in the 'common' text enumerator structure get handled by this structure.
+ - The one additional pointer to a garbage collected object is the 'child' member.
+
+The macro takes care of creating all the code we need to deal with this object, essentially it will create ``black_text_text_enum_enum_ptrs`` and ``black_text_text_enum_reloc_ptrs`` for us.
+
+So now we have to do a similar job for the actual device itself. We start by defining the enumeration and relocation routines for the structure. There are extensive macros for doing this, and we make use of some of them here. Explaining these is out of the scope of this document, but they are defined and easy to locate in the Ghostscript source tree.
+
+.. code-block:: c
+
+ static
+ ENUM_PTRS_WITH(black_text_enum_ptrs, gx_device *dev);
+ return 0; /* default case */
+ case 0:ENUM_RETURN(gx_device_enum_ptr(dev->parent));
+ case 1:ENUM_RETURN(gx_device_enum_ptr(dev->child));
+ ENUM_PTRS_END
+
+ static RELOC_PTRS_WITH(black_text_reloc_ptrs, gx_device *dev)
+ {
+ dev->parent = gx_device_reloc_ptr(dev->parent, gcst);
+ dev->child = gx_device_reloc_ptr(dev->child, gcst);
+ }RELOC_PTRS_END
+
+
+Essentially these simply tell the garbage collector that we are maintaining two pointers to garbage collected objects, the parent and child devices. Now we use those in the garbage collector 'structure descriptor' for the device. Note this is not the actual device structure, its the structure used by the garbage collector when dealing with the device.
+
+
+
+.. code-block:: c
+
+ gs_public_st_complex_only(st_black_text_device, gx_device, "black_text", 0, black_text_enum_ptrs, black_text_reloc_ptrs, gx_device_finalize);
+
+
+Again ``gs_public_st_complex_only`` is a macro, and its one of a family, these end up defining structures of type ``gs_memory_struct_t``. In this case we are declaring:
+
+ - The structure type is named ``st_black_text_device``
+ - The structure is of size ``gx_device`` (this only works because we don't need any other storage, otherwise we would have to define the device structure and pass that here).
+ - The human readable name for error messages is ``black_text``
+ - We don't define a ``clear`` routine.
+ - The enumerator for GC objects is called ``black_text_enum_ptrs``
+ - The relocator for GC objects is called ``black_text_reloc_ptrs``
+ - We use the regular ``gx_device_finalize`` routine when freeing the object, we don't declare a special one of our own.
+
+Now we've got all the garbage collector machinery out of the way we can deal with the actual device itself. Because we're only interested in text, there's only one device method we want to handle, the ``text_begin`` method, so we start by prototyping that:
+
+
+.. code-block:: c
+
+ /* Device procedures */
+ static dev_proc_text_begin(black_text_text_begin);
+
+
+
+Then we define the procedure to initialize the device procs:
+
+.. code-block:: c
+
+ void black_text_init_dev_procs(gx_device *dev)
+ {
+ default_subclass_initialize_device_procs(dev);
+
+ set_dev_proc(dev, text_begin, black_text_text_begin);
+ }
+
+
+Then we define the actual device:
+
+
+.. code-block:: c
+
+ const gx_device_black_text gs_black_text_device =
+ {
+ std_device_dci_type_body(gx_device_black_text, 0, "black_text", &st_black_text_device,
+ MAX_COORD, MAX_COORD,
+ MAX_RESOLUTION, MAX_RESOLUTION,
+ 1, 8, 255, 0, 256, 1),
+ black_text_initialize_device_procs
+ };
+
+The call to ``default_subclass_initialize_device_procs`` assigns the default methods for a subclassing device. We then override the ``text_begin`` method to our specific one. The main body of the macro is:
+
+
+.. code-block:: c
+
+ const gx_device_black_text gs_black_text_device =
+ {
+ std_device_dci_type_body(gx_device_black_text, 0, "black_text", &st_black_text_device,
+ MAX_COORD, MAX_COORD,
+ MAX_RESOLUTION, MAX_RESOLUTION,
+ 1, 8, 255, 0, 256, 1),
+
+
+This simply defines an instance of the ``gx_device_black_text`` structure (which is simply a ``gx_device_s`` structure) initialised using a macro (yet another family of macros). Here we use the ``st_black_text_device`` structure descriptor we created above, and some dummy values for the resolution, colour depth etc. Since this device doesn't do rendering these values aren't useful and these defaults should be fine.
+
+Now, for text we need to fill in all the procedures in the text enumerator, we'll start by defining the ``resync`` method, and then use this as a template for most of the other methods in the text enumerator:
+
+
+.. code-block:: c
+
+ static int black_text_text_resync(gs_text_enum_t *pte, const gs_text_enum_t *pfrom) {
+ black_text_text_enum_t *penum;
+ gs_text_enum_t * child = penum->child;
+ int code;
+
+ code = child->procs->resync(child, pfrom);
+ gs_text_enum_copy_dynamic(pte, child, true);
+ return code;
+ }
+
+
+The routine starts by casting the generic text enumerator to our specific type of text enumerator. From that we can get the child enumerator, and we simply pass the operation on directly to the child (remembering to pass the child enumerator as an argument, not our own one!).
+
+Now, on return it may be that the child has modified the contents of the enumerator, so we must copy anything that might have changed from the child enumerator to our own. That's what the ``gs_text_enum_copy_dynamic`` routine does. After that we simply return the saved return value.
+
+All the other routines are basically the same as this, we don't really want to do anything in the text enumeration so we just hand off the processing to the child.
+
+
+.. code-block:: c
+
+ static int black_text_text_process(gs_text_enum_t *pte) {
+ black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;
+ gs_text_enum_t * child = penum->child;
+ int code;
+
+ code = child->procs->process(child);
+ gs_text_enum_copy_dynamic(pte, child, true);
+ return code;
+ }
+
+ static bool black_text_text_is_width_only(const gs_text_enum_t *pte) {
+ black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;
+ gs_text_enum_t * child = penum->child;
+ int code;
+
+ code = child->procs->is_width_only(child);
+ gs_text_enum_copy_dynamic((gs_text_enum_t *)pte, child, true);
+ return code;
+ }
+
+ static int black_text_text_current_width(const gs_text_enum_t *pte, gs_point *pwidth) {
+ black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;
+ gs_text_enum_t * child = penum->child;
+ int code;
+
+ code = child->procs->current_width(child, pwidth);
+ gs_text_enum_copy_dynamic((gs_text_enum_t *)pte, child, true);
+ return code;
+ }
+
+ static int black_text_text_set_cache(gs_text_enum_t *pte, const double *pw, gs_text_cache_control_t control) {
+ black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;
+ gs_text_enum_t * child = penum->child;
+ int code;
+
+ code = child->procs->set_cache(child, pw, control);
+ gs_text_enum_copy_dynamic(pte, child, true);
+ return code;
+ }
+
+ static int black_text_text_retry(gs_text_enum_t *pte) {
+ black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;
+ gs_text_enum_t * child = penum->child;
+ int code;
+
+ code = child->procs->retry(child);
+ gs_text_enum_copy_dynamic(pte, child, true);
+ return code;
+ }
+
+ static void black_text_text_release(gs_text_enum_t *pte, client_name_t cname) {
+ black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;
+ gs_text_enum_t * child = penum->child;
+
+ child->procs->release(child, cname);
+ gx_default_text_release(pte, cname);
+ }
+
+
+The 'release' method is very slightly different, because we need to free the enumerator, so we call ``gx_default_text_release``.
+
+Now, finally, we can define the ``text_begin`` device method, the first thing we do is a convenience, we define a ``gs_text_enum_procs`` instance which is initialised to point to all the text enumerator methods we defined above:
+
+
+.. code-block:: c
+
+ static const gs_text_enum_procs_t black_text_text_procs = {
+ black_text_text_resync, black_text_text_process, black_text_text_is_width_only, black_text_text_current_width, black_text_text_set_cache, black_text_text_retry, black_text_text_release
+ };
+
+So on to the ``text_begin`` method:
+
+.. code-block:: c
+
+ /* The device method which we do actually need to define. */
+ int black_text_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text,
+ gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath,
+ gs_memory_t *memory, gs_text_enum_t **ppte)
+ {
+ black_text_text_enum_t *penum;
+ int code;
+ gs_text_enum_t *p;
+
+ rc_alloc_struct_1(penum, black_text_text_enum_t, &st_black_text_text_enum, memory,
+ return_error(gs_error_VMerror), "black_text_text_begin");
+ penum->rc.free = rc_free_text_enum;
+ code = gs_text_enum_init((gs_text_enum_t *)penum, &black_text_text_procs,
+ dev, pis, text, font, path, pdcolor, pcpath, memory);
+ if (code < 0) {
+ gs_free_object(memory, penum, "black_text_text_begin");
+ return code;
+ }
+ *ppte = (gs_text_enum_t *)penum;
+
+ code = default_subclass_text_begin(dev, pis, text, font, path, pdcolor, pcpath, memory, &p);
+ if (code < 0) {
+ gs_free_object(memory, penum, "black_text_text_begin");
+ return code;
+ }
+ penum->child = p;
+
+ return 0;
+ }
+
+
+This uses library macros to create and initialise the text enumerator. Text enumerators are reference counted (and garbage collected.....) so we use the ``rc_alloc_struct`` family of macros, the '1' is the initial reference count that we want to have. We then call ``gs_text_enum_init`` to initialise the newly created structure, passing in the text procs we just created as one of the arguments.
+
+We then set the returned enumerator to point to the newly created text enumerator. Finally we pass the ``text_begin`` method on to the child device using the ``default_subclass_text_begin`` method and we store the returned text enumerator in the child pointer of our own enumerator.
+
+At this point the code should compile and run properly, but it won;t actually do anything yet. For that we need to modify the current colour before we run the text. Fortunately we don't need to deal with the graphics state, the ``text_begin`` method is given the colour index to be used so all we need to do is alter that. We do, however, have to cater for what the device thinks 'black' actually is, but there are graphics library calls to deal with both finding that information and setting a colour index from it:
+
+
+.. code-block:: c
+
+ int black_text_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text,
+ gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath,
+ gs_memory_t *memory, gs_text_enum_t **ppte)
+ {
+ black_text_text_enum_t *penum;
+ int code;
+ gs_text_enum_t *p;
+
+ /* Set the colour index in 'pdcolor' to be whatever the device thinks black shoudl be */
+ set_nonclient_dev_color((gx_device_color *)pdcolor, gx_device_black((gx_device *)dev));
+
+
+
+
+
+
+.. include:: footer.rst
diff --git a/doc/src/Devices.rst b/doc/src/Devices.rst
new file mode 100644
index 00000000..90b26362
--- /dev/null
+++ b/doc/src/Devices.rst
@@ -0,0 +1,1333 @@
+.. title:: Details of Ghostscript Output Devices
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Devices.htm:
+
+
+Details of Ghostscript Output Devices
+=============================================
+
+
+For other information, see the :ref:`Ghostscript overview<Ghostscript Introduction>`. You may also be interested in :ref:`how to build Ghostscript<Make.htm>` and :ref:`install<Install.htm>` it, as well as the description of the :ref:`driver interface<Drivers.htm>`.
+
+Documentation for some older, superceded devices has been moved to :ref:`unsupported devices<UnsupportedDevices.htm>`. In general such devices are deprecated and will be removed in future versions of Ghostscript. In general all older printer drivers can be replaced by the :title:`ijs` interface and one of the available 3rd party raster driver collections. We recommend moving to the :title:`ijs` device for all such printing.
+
+
+Documentation for device subclassing can be found on the :ref:`Device Subclassing<DeviceSubclassing.htm>` page.
+
+
+.. _Devices_Notes on measurements:
+
+Notes on measurements
+----------------------------------------------
+
+Several different important kinds of measures appear throughout this document: :ref:`inches<Inches>`, :ref:`centimeters and millimeters<Centimeters and millimeters>`, :ref:`points<Points>`, :ref:`dots per inch<Dots per inch>` and :ref:`bits per pixel<Bits per pixel>`.
+
+
+
+Inches
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ 1 inch equals 2.54 centimeters. The inch measure is sometimes represented by in or a quotation mark (") to the right of a measure, like 8.5in or 8.5". U.S. "letter" paper is exactly 8.5in×11in, approximately 21.6cm×27.9cm. (See in the usage documentation all the :ref:`paper sizes predefined in Ghostscript<Known Paper Sizes>`.)
+
+
+
+Centimeters and millimeters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ISO standard paper sizes such as A4 and A3 are commonly represented in the SI units of centimeters and millimeters. Centimeters are abbreviated cm, millimeters mm. ISO A4 paper is quite close to 210×297 millimeters (approximately 8.3×11.7 inches).
+
+
+
+Points
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Points are a measure traditionally used in the printing trade and now in PostScript, which specifies exactly 72 points per inch (approximately 28.35 per centimeter). The :ref:`paper sizes known to Ghostscript<Known Paper Sizes>` are defined in the initialization file ``gs_statd.ps`` in terms of points.
+
+
+
+Dots per inch
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Dots per inch or "dpi" is the common measure of printing resolution in the US.
+
+
+
+Bits per pixel
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Commonly abbreviated "bpp" this is the number of digital bits used to represent the color of each pixel. This is also referred to as 'bit depth' or 'pixel depth'.
+
+
+
+
+Image file formats
+----------------------------------------------
+
+Ghostscript supports output to a variety of image file formats and is widely used for rasterizing postscript and pdf files. A collection of such formats ('output devices' in Ghostscript terminology) are described in this section.
+
+Here are some commonly useful driver options that apply to all raster drivers. Options specific to particular file formats are described in their respective sections below.
+
+.. code-block:: bash
+
+ -sOutputFile=filename
+
+This is a general option telling Ghostscript what to name the output. It can either be a single filename 'tiger.png' or a template 'figure-%03d.jpg' where the %03d is replaced by the page number.
+
+.. code-block:: bash
+
+ -rres
+ -rxresxyres
+
+This option sets the resolution of the output file in dots per inch. The default value if you don't specify this options is usually 72 dpi.
+
+.. code-block:: bash
+
+ -dTextAlphaBits=n
+ -dGraphicsAlphaBits=n
+
+These options control the use of subsample antialiasing. Their use is highly recommended for producing high quality rasterizations of the input files. The size of the subsampling box n should be 4 for optimum output, but smaller values can be used for faster rendering. Antialiasing is enabled separately for text and graphics content.
+
+Because this feature relies upon rendering the input it is incompatible, and will generate an error on attempted use, with any of the vector output devices.
+
+
+It is also conventional to call Ghostscript with the ``-dSAFER -dBATCH -dNOPAUSE`` trio of options when rasterizing to a file. These suppress interactive prompts and enable some security checks on the file to be run. Please see the :ref:`Using Ghostscript<Use.htm>` section for further details.
+
+
+
+.. _Devices_PNG:
+
+PNG file format
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+PNG (pronounced 'ping') stands for Portable Network Graphics, and is the recommended format for high-quality images. It supports full quality color and transparency, offers excellent lossless compression of the image data, and is widely supported. Please see the `PNG website`_ for a complete description of the format.
+
+Ghostscript provides a variety of devices for PNG output varying by bit depth. For normal use we recommend :title:`png16m` for 24-bit RGB color, or :title:`pnggray` for grayscale. The :title:`png256`, :title:`png16` and :title:`pngmono` devices respectively provide 8-bit color, 4-bit color and black-and-white for special needs. The :title:`pngmonod` device is also a black-and-white device, but the output is formed from an internal 8 bit grayscale rendering which is then error diffused and converted down to 1bpp.
+
+The :title:`png16malpha` and :title:`pngalpha` devices are 32-bit RGBA color with transparency indicating pixel coverage. The background is transparent unless it has been explicitly filled. PDF 1.4 transparent files do not give a transparent background with this device. The devices differ, in that the :title:`pngalpha` device enables Text and graphics anti-aliasing by default. We now recommend that people use the :title:`png16malpha` device in preference, and achieve any required antialiasing via the ``DownScaleFactor`` parameter, as this gives better results in many cases.
+
+Options
+""""""""""
+
+The :title:`pngmonod`, :title:`png16m`, :title:`pnggray`, :title:`png16malpha` and :title:`pngalpha` devices all respond to the following:
+
+
+.. code-block:: bash
+
+ -dDownScaleFactor=integer
+
+This causes the internal rendering to be scaled down by the given (integer <= 8) factor before being output. For example, the following will produce a 200dpi output png from a 600dpi internal rendering:
+
+.. code-block:: bash
+
+ gs -sDEVICE=png16m -r600 -dDownScaleFactor=3 -o tiger.png\
+ examples/tiger.eps
+
+
+The :title:`pngmonod` device responds to the following option:
+
+.. code-block:: bash
+
+ -dMinFeatureSize=state (0 to 4; default = 1)
+
+This option allows a minimum feature size to be set; if any output pixel appears on its own, or as part of a group of pixels smaller than ``MinFeatureSize`` x ``MinFeatureSize``, it will be expanded to ensure that it does. This is useful for output devices that are high resolution, but that have trouble rendering isolated pixels.
+
+While this parameter will accept values from 0 to 4, not all are fully implemented. 0 and 1 cause no change to the output (as expected). 2 works as specified. Values of 3 and 4 are accepted for compatibility, but behave as for 2.
+
+The :title:`png16malpha` and :title:`pngalpha` devices respond to the following option:
+
+.. code-block:: bash
+
+ -dBackgroundColor=16#RRGGBB (RGB color, default white = 16#ffffff)
+
+For the :title:`png16malpha` and :title:`pngalpha` devices only, set the suggested background color in the PNG bKGD chunk. When a program reading a PNG file does not support alpha transparency, the PNG library converts the image using either a background color if supplied by the program or the bKGD chunk. One common web browser has this problem, so when using ``<body bgcolor="CCCC00">`` on a web page you would need to use ``-dBackgroundColor=16#CCCC00`` when creating alpha transparent PNG images for use on the page.
+
+
+Examples
+""""""""""
+
+Examples of how to use Ghostscript to convert postscript to PNG image files:
+
+
+.. code-block:: bash
+
+ gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 \
+ -sOutputFile=tiger.png examples/tiger.png
+ gs -dSAFER -dBATCH -dNOPAUSE -r150 -sDEVICE=pnggray -dTextAlphaBits=4 \
+ -sOutputFile=doc-%02d.png doc.pdf
+
+In commercial builds, the :title:`png16m` device will accept a ``-dDeskew`` option to automatically detect/correct skew when generating output bitmaps.
+
+
+
+.. _Devices_JPG:
+
+JPEG file format (JFIF)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript includes output drivers that can produce jpeg files from postscript or pdf images. These are the :title:`jpeg` and :title:`jpeggray` devices.
+
+Technically these produce Independent JPEG Group JFIF (JPEG File Interchange Format) files, the common sort found on the web.
+
+Please note that JPEG is a compression method specifically intended for continuous-tone images such as photographs, not for graphics, and it is therefore quite unsuitable for the vast majority of page images produced with PostScript. For anything other than pages containing simple images the lossy compression of the jpeg format will result in poor quality output regardless of the input. To learn more about the distinction, consult a reference about uses and abuses of JPEG, such as the `JPEG FAQ`_.
+
+
+Options
+""""""""""""
+
+The JPEG devices support several special parameters to control the JPEG "quality setting" (DCT quantization level).
+
+.. code-block:: bash
+
+ -dJPEGQ=N (integer from 0 to 100, default 75)
+
+Set the quality level N according to the widely used IJG quality scale, which balances the extent of compression against the fidelity of the image when reconstituted. Lower values drop more information from the image to achieve higher compression, and therefore have lower quality when reconstituted.
+
+.. code-block:: bash
+
+ -dQFactor=M (float from 0.0 to 1.0)
+
+
+Adobe's QFactor quality scale, which you may use in place of ``JPEGQ`` above. The QFactor scale is used by PostScript's ``DCTEncode`` filter but is nearly unheard-of elsewhere.
+
+At this writing the default JPEG quality level of 75 is equivalent to ``-dQFactor=0.5``, but the JPEG default might change in the future. There is currently no support for any additional JPEG compression options, such as the other DCTEncode filter parameters.
+
+
+
+
+Examples
+""""""""""
+
+You can use the JPEG output drivers -- :title:`jpeg` to produce color JPEG files and :title:`jpeggray` for grayscale JPEGs -- the same as other file-format drivers: by specifying the device name and an output file name, for example
+
+.. code-block:: bash
+
+ gs -sDEVICE=jpeg -sOutputFile=foo.jpg foo.ps
+
+
+
+.. _Devices_PNM:
+
+PNM
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The PNM (portable network map) family of formats are very simple uncompressed image formats commonly used on unix-like systems. They are particularly useful for testing or as input to an external conversion utility.
+
+A wide variety of data formats and depths is supported. Devices include :title:`pbm pbmraw pgm pgmraw pgnm pgnmraw pnm pnmraw ppm ppmraw pkm pkmraw pksm pksmraw`.
+
+
+
+.. _Devices_TIFF:
+
+TIFF file formats
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+TIFF is a loose collection of formats, now largely superceded by PNG except in applications where backward compatibility or special compression is required. The TIFF file format is described in the TIFF 6.0 Specification published by Adobe Systems Incorporated.
+
+
+.. note ::
+
+ Due to the structure of the TIFF format, writing TIFF output requires that the target file be seekable. Writing to stdout, pipes or other similar stream is not supported. Attempting to do so will generate an error.
+
+There are two unrelated sets of TIFF drivers. There are five color TIFF drivers that produce uncompressed output:
+
+
+
+:title:`tiffgray`
+ Produces 8-bit gray output.
+
+:title:`tiff12nc`
+ Produces 12-bit RGB output (4 bits per component).
+
+:title:`tiff24nc`
+ Produces 24-bit RGB output (8 bits per component).
+
+:title:`tiff48nc`
+ Produces 48-bit RGB output (16 bits per component).
+
+:title:`tiff32nc`
+ Produces 32-bit CMYK output (8 bits per component).
+
+:title:`tiff64nc`
+ Produces 64-bit CMYK output (16 bits per component).
+
+:title:`tiffsep`
+ The :title:`tiffsep` device creates multiple output files: a single 32 bit composite CMYK file and multiple :title:`tiffgray` files, one for each separation (unless ``-dNoSeparationFiles`` is specified). If separation files are being produced and more than one page is being generated, the output file specification must include a format specifier (e.g ``-o outfile-%d.tif``) so that each page can have a uniquely named set of separation files.
+
+ The default compression is ``lzw`` but this may be overridden by the ``-sCompression=`` option.
+
+ The file specified via the ``OutputFile`` command line parameter will contain CMYK data. This data is based upon the CMYK data within the file plus an equivalent CMYK color for each spot color. The equivalent CMYK color for each spot color is determined using the alternate tint transform function specified in the ``Separation`` and :title:`devicen` color spaces. Since this file is created based upon having color planes for each colorant, the file will correctly represent the appearance of overprinting with spot colors.
+
+ File names for the separations for the CMYK colorants are created by appending '.Cyan.tif', '.Magenta.tif' '.Yellow.tif' or '.Black.tif' to the end of the file name specified via the ``OutputFile`` parameter. File names for the spot color separation files are created by appending the Spot color name in '(' and ').tif' to the filename.
+
+ Note that, while the name of the ink is case-sensitive, the filename may not be (depending on the Operating System), so if a spot name matches one of the process ink names, it will have the spot number included as part of the name (e.g. ``YELLOW0``).
+
+ If desired the file names for the spot color separation files can be created by appending '.sn.tif' (where n is the spot color number, see below) to the end of the file name specified via the ``OutputFile`` parameter. This change is a compile time edit. To obtain this type of output the function ``create_separation_file_name`` in ``gdevtsep.c`` should be called with a true value for its ``use_sep_name`` parameter.
+
+ The :title:`tiffsep` device will automatically recognize spot colors. In this case their order is determined by when they are found in the input file. The names of spot colors may be specified via the ``SeparationColorNames`` device parameters.
+
+ Internally each spot color is assigned a spot color number. These numbers start with 0 for the first spot color. The spot color numbers are assigned in the same order as the names are printed to stderr (see below). This order also matches the ordering in the ``SeparationColorNames`` list, if this parameter is specified. The spot color numbers are not affected by the ``SeparationOrder`` parameter.
+
+ If only a subset of the colorants for a file is desired, then the separations to be output can be selected via the ``SeparationOrder`` device parameter. When colorants are selected via the ``SeparationOrder`` parameter, the composite CMYK output contains the equivalent CMYK data only for the selected colorants.
+
+ .. note::
+ The composite CMYK output, because it uses the tint transformed colour equivalents for any spot colours (see Postscript Language Reference "Separation Color Spaces" and "DeviceN Color Spaces"), may not produce an accurate preview, if the job uses overprinting.
+
+ The :title:`tiffsep` device also prints the names of any spot colors detected within a document to stderr, (stderr is also used for the output from the :title:`bbox` device). For each spot color, the name of the color is printed preceded by '%%SeparationName: '. This provides a simple mechanism for users and external applications to be informed about the names of spot colors within a document.
+
+ Generally Ghostscript will support a maximum of 64 process and spot colors. The :title:`tiffsep` device the :title:`psdcmyk` device and the :title:`psdcmyk16` devices maintain rendered data in a planar form with a maximum of 64 planes set by the definition of ``GS_CLIENT_COLOR_MAX_COMPONENTS`` in the code. That is there can be up to 64 colorants accurately handled with overprint on a single page. If more than 64 colorants are encountered, those beyond 64 will be mapped to CMYK using the alternate tint transform.
+
+ When rendering a PDF document, Ghostscript can deteremine prior to rendering how many colorants occur on a particular page. With Postscript, this is not possible in general. To optimize for this, when rendering Postscript, it is possible to specify at run-time the number of spot colorants you wish to have the device capable of handling using the ``-dMaxSpots=N`` command option, where N is the number of spot colorants that you wish to be able to handle and must be no more than the 64 minus the number of process colors. For example, 60 or less for a CMYK device such as tiffsep. If you specify more than is needed, the document will render more slowly. The ideal case is to use the same number as the maximum number of spot colorants that occur on a single page of the document. If more spot colorants are encountered than is specified by ``-dMaxSpots``, then a warning will be printed indicating that some spot colorants will be mapped to CMYK using the alternate tint transform.
+
+ The tiffsep device accepts a ``-dBitsPerComponent=`` option, which may be set to 8 (the default) or 1. In 1bpp mode, the device renders each component internally in 8 bits, but then converts down to 1bpp with error diffusion before output as described below in the tiffscaled device. No composite file is produced in 1bpp mode, only individual separations.
+
+ The device also accepts the ``-dDownScaleFactor= -dTrapX= -dTrapy=`` and ``-sPostRenderProfile=`` parameters as described below in the :title:`tiffscaled` device, and ``-dMinFeatureSize=`` in 1bpp mode.
+
+ When ``-dDownScaleFactor=`` is used in 8 bit mode with the tiffsep (and :title:`psdcmyk`/:title:`psdrgb`/:title:`psdcmyk16`/:title:`psdrgb16`) device(s) 2 additional "special" ratios are available, 32 and 34. 32 provides a 3:2 downscale (so from 300 to 200 dpi, say). 34 produces a 3:4 upscale (so from 300 to 400 dpi, say).
+
+ In commercial builds, with 8 bit per component output, the ``-dDeskew`` option can be used to automatically detect/correct skew when generating output bitmaps.
+
+ The :title:`tiffscaled` and :title:`tiffscaled4` devices can optionally use Even Toned Screening, rather than simple Floyd Steinberg error diffusion. This patented technique gives better quality at the expense of some speed. While the code used has many quality tuning options, none of these are currently exposed. Any device author interested in trying these options should contact Artifex for more information. Currently ETS can be enabled using ``-dDownScaleETS=1``.
+
+:title:`tiffsep1`
+ The :title:`tiffsep1` device creates multiple output files, one for each component or separation color. The device creates multiple :title:`tiffg4` files (the compression can be set using ``-sCompression=`` described below). The 1 bit per component output is halftoned using the current screening set by 'setcolorscreen' or 'sethalftone' which allows for ordered dither or stochastic threshold array dither to be used. This is faster than error diffusion.
+
+ The file specified via the ``OutputFile`` command line parameter will not be created (it is opened, but deleted prior to finishing each page).
+
+ File names for the separations for the CMYK colorants are created by appending '(Cyan).tif', '(Magenta).tif' '(Yellow).tif' or '(Black).tif' to the to the end of the file name specified via the ``OutputFile`` parameter. File names for the spot color separation files are created by appending the ``Spot`` color name in '(' and ').tif' to the filename. If the file name specified via the ``OutputFile`` parameter ends with the suffix '.tif', then the suffix is removed prior to adding the component name in '(' and ').tif'.
+
+:title:`tiffscaled`
+ The :title:`tiffscaled` device renders internally at the specified resolution to an 8 bit greyscale image. This is then scaled down by an integer scale factor (set by ``-dDownScaleFactor=`` described below) and then error diffused to give 1bpp output. The compression can be set using ``-sCompression=`` as described below.
+
+:title:`tiffscaled4`
+ The :title:`tiffscaled4` device renders internally at the specified resolution to an 8 bit cmyk image. This is then scaled down by an integer scale factor (set by ``-dDownScaleFactor=`` described below) and then error diffused to give 4bpp cmyk output. The compression can be set using ``-sCompression=`` as described below.
+
+:title:`tiffscaled8`
+ The :title:`tiffscaled8` device renders internally at the specified resolution to an 8 bit greyscale image. This is then scaled down by an integer scale factor (set by ``-dDownScaleFactor=`` described below). The compression can be set using ``-sCompression=`` as described below.
+
+:title:`tiffscaled24`
+ The :title:`tiffscaled24` device renders internally at the specified resolution to a 24 bit rgb image. This is then scaled down by an integer scale factor (set by ``-dDownScaleFactor=`` described below). The compression can be set using ``-sCompression=`` as described below.
+
+ In commercial builds, the ``-dDeskew`` option can be used to automatically detect/correct skew when generating output bitmaps.
+
+:title:`tiffscaled32`
+ The :title:`tiffscaled32` device renders internally at the specified resolution to a 32 bit cmyk image. This is then scaled down by an integer scale factor (set by ``-dDownScaleFactor=`` described below). The compression can be set using ``-sCompression=`` as described below.
+
+ In commercial builds, the ``-dDeskew`` option can be used to automatically detect/correct skew when generating output bitmaps.
+
+
+The remaining TIFF drivers all produce black-and-white output with different compression modes:
+
+:title:`tiffcrle`
+ G3 fax encoding with no EOLs.
+
+:title:`tiffg3`
+ G3 fax encoding with EOLs.
+
+:title:`tiffg32d`
+ 2-D G3 fax encoding.
+
+:title:`tiffg4`
+ G4 fax encoding.
+
+:title:`tifflzw`
+ LZW-compatible (tag = 5) compression.
+
+:title:`tiffpack`
+ PackBits (tag = 32773) compression.
+
+See the ``AdjustWidth`` option documentation below for important information about these devices.
+
+
+Options
+""""""""""""""""""""""""
+
+
+All TIFF drivers support creation of files that are comprised of more than a single strip. Multi-strip files reduce the memory requirement on the reader, since readers need only store and process one strip at a time. The ``MaxStripSize`` parameter controls the strip size:
+
+
+.. code-block:: bash
+
+ -dMaxStripSize=N
+
+Where **N** is a non-negative integer; default = 8192, 0 on Fax devices. Set the maximum (uncompressed) size of a strip.
+
+
+The TIFF 6.0 specification, Section 7, page 27, recommends that the size of each strip be about 8 Kbytes.
+
+If the value of the ``MaxStripSize`` parameter is smaller than a single image row, then no error will be generated, and the TIFF file will be generated correctly using one row per strip. Note that smaller strip sizes increase the size of the file by increasing the size of the ``StripOffsets`` and ``StripByteCounts`` tables, and by reducing the effectiveness of the compression which must start over for each strip.
+
+If the value of ``MaxStripSize`` is 0, then the entire image will be a single strip.
+
+Since v. 8.51 the logical order of bits within a byte, ``FillOrder``, tag = 266 is controlled by a parameter:
+
+
+.. code-block:: bash
+
+ -dFillOrder=1 | 2 (default = 1)
+
+If this option set to 2 then pixels are arranged within a byte such that pixels with lower column values are stored in the lower-order bits of the byte; otherwise pixels are arranged in reverse order.
+
+
+Earlier versions of Ghostscript always generated TIFF files with ``FillOrder = 2``. According to the TIFF 6.0 specification, Section 8, page 32, support of ``FillOrder = 2`` is not required in a Baseline TIFF compliant reader
+
+The writing of ``BigTIFF`` format output files is controlled with the ``-dUseBigTIFF`` parameter.
+
+Unfortunately, due the unpredictable size of compressed output, we cannot automate the selection of ``BigTIFF``, using it only when the output file grows large enough to warrant it.
+
+.. code-block:: bash
+
+ -dUseBigTIFF(=false/true) (boolean, default: false)
+
+
+Forces use (or not) of ``BigTIFF`` format in output from TIFF devices.
+
+The writing of the DateTime TAG can be controlled using the ``-dTIFFDateTime`` parameter.
+
+.. code-block:: bash
+
+ -dTIFFDateTime(=true/false) (boolean, default: true)
+
+Write or otherwise the ``DateTime TAG`` to the TIFF output file. Thus to disable writing the ``TAG``, use: ``-dTIFFDateTime=false``.
+
+The compression scheme that is used for the image data can be set for all tiff devices with:
+
+.. code-block:: bash
+
+ -sCompression=none | crle | g3 | g4 | lzw | pack
+
+Change the compression scheme of the tiff device. ``crle``, ``g3``, and ``g4`` may only be used with 1 bit devices (including :title:`tiffsep1`).
+
+
+
+For the :title:`tiffsep` device, it changes the compression scheme of the separation files and composite cmyk file (which is lzw by default). It defaults to ``g4`` for the :title:`tiffsep1` device.
+
+The black-and-white TIFF devices also provide the following parameters:
+
+
+.. code-block:: bash
+
+ -dAdjustWidth=state (0, 1, or value; default = 1)
+
+If this option is 1 then if the requested page width is in the range of either 1680..1736 or 2000..2056 columns, set the page width to A4 (1728 columns) or B4 (2048 columns) respectively. If this option is set to a value >1 then the width is unconditionally adjusted to this value.
+
+This behavior is the default for all the fax based devices (i.e. all the black and white devices except :title:`tifflzw`, :title:`tiffpack` and :title:`tiffscaled`). Pass ``-dAdjustWidth=0`` to force this behaviour off.
+
+When using this option with :title:`tiffscaled` it is the downsampled size that triggers the adjustment.
+
+.. code-block:: bash
+
+ -dMinFeatureSize=state (0 to 4; default = 1)
+
+This option allows a minimum feature size to be set; if any output pixel appears on its own, or as part of a group of pixels smaller than ``MinFeatureSize`` x ``MinFeatureSize``, it will be expanded to ensure that it does. This is useful for output devices that are high resolution, but that have trouble rendering isolated pixels.
+
+While this parameter will accept values from 0 to 4, not all are fully implemented. 0 and 1 cause no change to the output (as expected). 2 works as specified. 3 and 4 currently expand pixels correctly horizontally, but only expand vertically to the 2 pixel size.
+
+The mechanism by which ``MinFeatureSize`` is implemented for :title:`tiffscaled` is different, in that it is done as part of the error diffusion. Values of 0 to 2 work as expected, but values 3 and 4 (while accepted for compatibility) will behave as for 2.
+
+
+The :title:`tiffscaled`, :title:`tiffscaled4`, :title:`tiffscaled8`, :title:`tiffscaled24` and :title:`tiffscaled32` TIFF drivers also provide the following two parameters:
+
+
+.. code-block:: bash
+
+ -dDownScaleFactor=factor (integer <= 8; default = 1)
+
+If this option set then the page is downscaled by the given factor on both axes before error diffusion takes place. For example rendering with -r600 and then specifying ``-dDownScaleFactor=3`` will produce a 200dpi image.
+
+.. code-block:: bash
+
+ -sPostRenderProfile=path (path to an ICC profile)
+
+If this option set then the page will be color transformed using that profile after downscaling.
+
+This is useful when the file uses overprint to separately paint to some subset of the C, M, Y, and K colorants, but the final CMYK is to be color corrected for printing or display.
+
+
+The :title:`tiffsep` TIFF device also provide this parameter:
+
+.. code-block:: bash
+
+ -dPrintSpotCMYK=boolean defaults to false.
+
+When set to true the device will print (to stdout) the name of each ink used on the page, and the CMYK values which are equivalent to 100% of that ink. The values are 16-bits ranging from 0 to 32760.
+
+
+The :title:`tiffsep` device (along with the :title:`tiffscaled32` and :title:`psdcmyk` devices) can perform rudimentary automatic bitmap 'trapping' on the final rendered bitmap. This code is disabled by default; see the :ref:`note<TrappingPatentsNote>` below as to why.
+
+Trapping is a process whereby the output is adjusted to minimise the visual impact of offsets between each printed plane. Typically this involves slightly extending abutting regions that are rendered in different inks. The intent of this is to avoid the unsightly gaps that might be otherwise be revealed in the final printout if the different color plates do not exactly line up.
+
+This trapping is controlled by 3 device parameters. Firstly the maximum X and Y offsets are specified using ``-dTrapX=N`` and ``-dTrapY=N`` (where N is a figure in pixels, before the downscaler is applied).
+
+The final control is to inform the trapping process in what order inks should be processed, from darkest to lightest. For a typical CMYK device this order would be [ 3 1 0 2 ] (K darker than M darker than C darker than Y). This is the default. In the case where CMYK + spots are used, the code defaults to assuming that the spots are lighter than the standard colours and are sent darkest first (thus [ 3 1 0 2 4 5 6 ... ]).
+
+To override these defaults, the ``TrapOrder`` parameter can be used, for example:
+
+.. code-block:: bash
+
+ gs -sDEVICE=psdcmyk -dTrapX=2 -dTrapY=2 -o out.psd -c "<< /TrapOrder [ 4 5 3 1 0 2 ] >> setpagedevice" -f examples\tiger.eps
+
+
+.. _TrappingPatentsNote:
+
+.. note::
+
+ **Trapping patents**. Trapping is an technology area encumbered by many patents. We believe that the last of these has now lapsed, and so have enabled the code by default.
+
+
+.. _Devices_FAX:
+
+FAX
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript supports a variety of fax encodings, both encapsulated in TIFF (see above) and as raw files. The later case is described here.
+
+The fax devices are :title:`faxg3`, :title:`faxg32d` and :title:`faxg4`.
+
+The fax devices support the ``MinFeatureSize`` parameter as defined in the TIFF device section.
+
+It appears from this commit: ``0abc209b8460396cdece8fc824c053a2662c4cbf`` that some (many ?) fax readers cannot cope with multiple strip TIFF files. The commit noted above works around this by assuming no fax output will exceed 1MB. Unfrotunately it also altered all the TIFF devices' default strip size which we now think was inadvisable. The fax devices now use a ``MaxStripSize`` of 0 so that the file only contains a single strip. This can still be overridden by specifying ``MaxStripSize`` on the command line.
+
+
+.. _Devices_BMP:
+
+BMP
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+BMP is a simple uncompressed image format commonly used on MS Windows.
+
+It is supported by the :title:`bmpmono bmpgray bmpsep1 bmpsep8 bmp16 bmp256 bmp16m bmp32b` series of devices.
+
+
+.. _Devices_PCX:
+
+PCX
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+PCX is an image format sometimes used on MS Windows. It has some support for image compression and alternate color spaces, and so can be a useful way to output CMYK.
+
+It is supported by the :title:`pcxmono pcxgray pcx16 pcx256 pcx24b pcxcmyk` series of devices.
+
+
+
+.. _Devices_PSD:
+
+PSD
+~~~~~~~~~~~~~~~~~~~~
+
+PSD is the image format used by Adobe Photoshop.
+
+It is supported by the :title:`psdcmyk psdrgb psdcmyk16 psdrgb16` series of devices.
+
+Of special interest with the :title:`psdcmyk` and :title:`psdcmyk16` devices is that they support spot colors. See the comments under the :title:`tiffsep` and :title:`tiffsep1` device about the maximum number of spot colors supported by Ghostscript.
+
+The :title:`psdcmyk16` and :title:`psdrgb16` devices are essentially the same as the :title:`psdcmyk` and :title:`psdrgb` devices except they provide 16 bit output.
+
+The :title:`psdcmykog` device produces PSD files with 6 components: Cyan, Magenta, Yellow, blacK, Orange, and Green. This device does not support the ``-dDownScaleFactor=`` option (see below), instead it always scales down by a factor of two.
+
+These devices support the same ``-dDownScaleFactor=`` ratios as :title:`tiffsep`. The :title:`psdcmyk` device supports the same trapping options as :title:`tiffsep` (but see :ref:`this note<TrappingPatentsNote>`).
+
+
+.. note::
+
+ The PSD format is a single image per file format, so you must use the "%d" format for the ``OutputFile`` (or "-o") file name parameter (see :ref:`One page per file<Use_OnePagePerFile>` for details). An attempt to output multiple pages to a single PSD file (i.e. without the "%d" format) will result in an ``ioerror`` Postscript error.
+
+In commercial builds, for the :title:`psdcmyk` and :title:`psdrgb` devices, the ``-dDeskew`` option can be used to automatically detect/correct skew when generating output bitmaps.
+
+
+.. _Devices_PDF:
+
+PDF
+~~~~~~~~~~~~~~~~~~~~
+
+These devices render input to a bitmap (or in the case of PCLm multiple bitmaps) then wraps the bitmap(s) up as the content of a PDF file. For PCLm there are some additional rules regarding headers, extra content and the order in which the content is written in the PDF file.
+
+The aim is to support the PCLm mobile printing standard, and to permit production of PDF files from input where the graphics model differs significantly from PDF (eg PCL and RasterOPs).
+
+There are five devices named :title:`pdfimage8`, :title:`pdfimage24`, :title:`pdfimage32`, :title:`pclm` and :title:`pclm8`. These produce valid PDF files with a colour depth of 8 (Gray), 24 (RGB) or 32 (CMYK), the :title:`pclm` device only supports 24-bit RGB and the :title:`pclm8` device only supports 8-bit gray. These are all implemented as 'downscale' devices, which means they can implement page level anti-aliasing using the ``-dDownScaleFactor`` switch.
+
+
+.. code-block:: bash
+
+ -dDownScaleFactor=integer
+
+This causes the internal rendering to be scaled down by the given (integer <= 8) factor before being output. For example, the following will produce a PDF containing a 200dpi output from a 600dpi internal rendering:
+
+.. code-block:: bash
+
+ gs -sDEVICE=pdfimage8 -r600 -dDownScaleFactor=3 -o tiger.pdf\
+ examples/tiger.eps
+
+
+
+In commercial builds, the ``-dDeskew`` option can be used to automatically detect/correct skew when generating the output file.
+
+The type of compression used for the image data can also be selected using the ``-sCompression`` switch. Valid compression types are ``None``, ``LZW``, ``Flate``, :title:`jpeg` and ``RLE``.
+
+.. note::
+
+ ``LZW`` is not supported on :title:`pclm` (not valid) and ``None`` is only supported on :title:`pclm` for debugging purposes.
+
+For JPEG compression the devices support both the JPEGQ and QFactor switches as documented for the JPEG file format device.
+
+In addition, the PCLm device supports some other parameters. Firstly, the ``-dStripHeight`` switch to set the vertical height of the strips of image content, as required by the specification.
+
+Secondly, the standard postscript ``-dDuplex`` and ``-dTumbleswitches`` are supported, in that if both are set to true, every verso page (i.e. all even pages) will be rotated by 180 degrees.
+
+As an extension to this, a ``-dTumble2`` parameter is also supported that will add an additional X-axis flip for every verso page. Thus ``-dDuplex=true -dTumble=false -dTumble2=true`` will result in verso pages being flipped horizontally, and ``-dDuplex=true -dTumble=true -dTumble2=true`` will result in verso pages being flipped vertically.
+
+
+
+.. note::
+
+ In addition to raster image files, Ghostscript supports output in a number of 'high-level' formats. These allow Ghostscript to preserve (as much as possible) the drawing elements of the input file maintaining flexibility, resolution independence, and editability.
+
+
+
+.. _Devices_OCR:
+
+Optical Character Recognition (OCR) devices
+--------------------------------------------------------------------------------------------
+
+OCR text output
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These devices render internally in 8 bit greyscale, and then feed the resultant image into an OCR engine. Currently, we are using the Tesseract engine. Not only is this both free and open source, it gives very good results, and supports a huge number of languages/scripts.
+
+The Tesseract engine relies on files to encapsulate each language and/or script. These "traineddata" files are available in different forms, including fast and best variants. Alternatively, people can train their own data using the standard Tesseract tools.
+
+These files are looked for from a variety of places.
+
+#. Files will be searched for in the directory given by the environment variable ``TESSDATA_PREFIX``.
+
+#. Then they will be searched for within the ROM filing system. Any files placed in "tessdata" will be included within the ROM filing system in the binary for any standard (``COMPILE_INITS=1``) build.
+
+#. Then files will be searched for in the configured 'tessdata' path. On Unix, this can be specified at the configure stage using '--with-tessdata=<path>' (where <path> is a list of directories to search, separated by ':' (on Unix) or ';' (on Windows)).
+
+#. Finally, we resort to searching the current directory.
+
+Please note, this pattern of directory searching differs from the original release of the OCR devices.
+
+By default, the OCR process defaults to looking for English text, using "eng.traineddata". This can be changed by using the ``-sOCRLanguage=`` switch:
+
+.. code-block:: bash
+
+ -sOCRLanguage=language
+
+This sets the trained data sets to use within the Tesseract OCR engine.
+
+For example, the following will use English and Arabic:
+
+.. code-block:: bash
+
+ gs -sDEVICE=ocr -r200 -sOCRLanguage="eng+ara" -o out.txt\
+ zlib/zlib.3.pdf
+
+
+The first device is named :title:`ocr`. It extracts data as unicode codepoints and outputs them to the device as a stream of UTF-8 bytes.
+
+The second device is named :title:`hocr`. This extracts the data in `hOCR`_ format.
+
+These devices are implemented as downscaling devices, so the standard parameters can be used to control this process. It may seem strange to use downscaling on an image that is not actually going to be output, but there are actually good reasons for this. Firstly, the higher the resolution, the slower the OCR process. Secondly, the way the Tesseract OCR engine works means that anti-aliased images perform broadly as well as the super-sampled image from which it came.
+
+
+PDF image output (with OCR text)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These devices do the same render to bitmap and wrap as a PDF process as the ``PDFimage`` devices above, but with the addition of an OCR step at the end. The OCR'd text is overlaid "invisibly" over the images, so searching and cut/paste should still work.
+
+The OCR engine being used is Tesseract. For information on this including how to control what language data is used, see the OCR devices section above.
+
+There are three devices named :title:`pdfocr8`, :title:`pdfocr24` and :title:`pdfocr32`. These produce valid PDF files with a colour depth of 8 (Gray), 24 (RGB) or 32 (CMYK).
+
+These devices accept all the same flags as the PDFimage devices described above.
+
+
+
+Vector PDF output (with OCR Unicode CMaps)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The :title:`pdfwrite` device has been augmented to use the OCR engine to analyse text (not images!) in the input stream, and derive Unicode code points for it. That information can then be used to create ``ToUnicode CMaps`` which are attached to the ``Font`` (or ``CIDFont``) objects embedded in the PDF file.
+
+Fonts which have ``ToUnicode CMaps`` can be reliably (limited by the accuracy of the ``CMap``) used in search and copy/paste functions, as well as text extraction from PDF files. Note that OCR is not a 100% perfect process; it is possible that some text might be misidentified.
+
+OCR is a slow operation! In addition it can (for Latin text at least) sometimes be preferable not to add ``ToUnicode`` information which may be incorrect, but instead to use the existing font ``Encoding``. For English text this may give better results.
+
+For these reasons the OCR functionality of :title:`pdfwrite` can be controlled by using a new parameter ``-sUseOCR``. This has three possible values:
+
+.. code-block:: bash
+
+ -sUseOCR=string
+
+**string** values as follows:
+
+**Never**
+ Default - don't use OCR at all even if support is built-in.
+
+**AsNeeded**
+ If there is no existing ToUnicode information, use OCR.
+
+**Always**
+ Ignore any existing information and always use OCR.
+
+
+.. _Devices_HighLevel:
+
+
+High level devices
+---------------------------------------------------------------------------------
+
+
+Please refer to :ref:`High Level Devices<VectorDevices.htm>` for documentation on the device options for these devices.
+
+
+
+PDF writer
+~~~~~~~~~~~~~~~~~~~~
+
+The :title:`pdfwrite` device outputs PDF.
+
+PS2 writer
+~~~~~~~~~~~~~~~~~~~~
+
+The :title:`ps2write` device outputs postscript language level 2. It is recommnded that this device is used for PostScript output. There is no longer any support for creating PostScript level 1 output.
+
+
+EPS writer
+~~~~~~~~~~~~~~~~~~~~
+
+The :title:`eps2write` device outputs encapsulated postscript.
+
+PXL
+~~~~~~~~~~~~~~~~~~~~
+
+The :title:`pxlmono` and :title:`pxlcolor` devices output HP PCL-XL, a graphic language understood by many recent laser printers.
+
+Text output
+~~~~~~~~~~~~~~~~~~~~
+
+The :title:`txtwrite` device will output the text contained in the original document as Unicode.
+
+
+.. _Devices_Display_Device:
+.. _Devices_Display_Devices:
+
+Display devices
+---------------------------
+
+Ghostscript is often used for screen display of postscript and pdf documents. In many cases, a client or 'viewer' application calls the Ghostscript engine to do the rasterization and handles the display of the resulting image itself, but it is also possible to invoke Ghostscript directly and select an output device which directly handles displaying the image on screen.
+
+This section describes the various display-oriented devices that are available in Ghostscript.
+
+
+X Window System
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Perhaps the most common use of of a display device is with the X Window System on unix-like systems. It is the default device on the command line client on such systems, and is used more creatively by the gv client application.
+
+The available devices are:
+
+:title:`x11`
+ This is the default device, handling display on X11R6.
+
+:title:`x11alpha`
+ This is the :title:`x11` device, but with antialiasing. It is equivalent to invoking the x11 device with the options ``-dGraphicsAlphaBits=4 -dTextAlphaBits=4 -dMaxBitmap=50000000``.
+
+:title:`x11cmyk`
+ This device rasterizes the image in the CMYK color space, then flattens it to RGB for display. It's intended for testing only.
+
+:title:`x11mono`
+ This is a strict black-and-white device for 1-bit monochrome displays.
+
+:title:`x11gray2`
+ This is a device for 2 bpp (4-level) monochrome displays.
+
+:title:`x11gray4`
+ This is a device for 4 bpp (16-level) monochrome displays.
+
+On Mac OS X as of 10.6, the X server (XQuartz) only supports color depth 15 and 24. Depth 15 isn't well-tested, and it may be desirable, for serious use, to switch to depth 24 with:
+
+.. code-block:: bash
+
+ defaults write org.x.X11 depth 24
+
+
+
+Display device (MS Windows, OS/2, gtk+)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The display device is used by the MS Windows, OS/2 and the gtk+ versions of Ghostscript.
+
+
+Options
+"""""""""""""""
+
+The display device has several user settable options.
+
+
+``-dDisplayFormat=N (integer bit-field)``
+
+ Some common values are ``16#30804`` for Windows RGB, ``16#804`` for gtk+ RGB, ``16#20101`` for Windows monochrome, ``16#102`` for gtk+ monochrome, ``16#20802`` grayscale, ``16#20808`` for CMYK, ``16#a0800`` for separations.
+
+ The bit fields are:
+
+ - native (1), gray (2), RGB (4), CMYK (8), or separation (80000) color spaces.
+ - unused first byte (40) or last byte (80).
+ - 1 (100), 4 (400), or 8 (800) bits/component.
+ - bigendian (00000 = RGB) or littleendian (10000 = BGR) order.
+ - top first (20000) or bottom first (00000) raster.
+ - 16 bits/pixel with 555 (00000) or 565 (40000) bitfields.
+ - For more details, see the Ghostscript Interpreter API.
+
+``-dDisplayResolution=DPI``
+
+ Set the initial resolution resolution for the display device. This is used by the Windows clients to set the display device resolution to the Windows display logical resolution. This can be overriden by the command line option ``-rDPI``.
+
+
+
+When using the separation color space, the following options may be set using ``setpagedevice``, as described in the PostScript Language Reference:
+
+``SeparationColorNames``
+ An array giving the names of the spot colors.
+
+``SeparationOrder``
+ An array giving the names and order of the colorants to be output.
+
+
+
+IJS - Inkjet and other raster devices
+---------------------------------------------------------------------------------
+
+IJS is a relatively new initiative to improve the quality and ease of use of inkjet printing with Ghostscript. Using IJS, you can add new drivers, or upgrade existing ones, without recompiling Ghostscript. All driver authors are encouraged to adapt their drivers for IJS, and if there is an IJS driver available for your printer, it should be your first choice.
+
+Please see the IJS web page for more information about IJS, including a listing of IJS-compatible drivers.
+
+A typical command line for IJS is:
+
+.. code-block:: bash
+
+ gs -dSAFER -sDEVICE=ijs -sIjsServer=hpijs -sDeviceManufacturer=HEWLETT-PACKARD -sDeviceModel='DESKJET 990' -dIjsUseOutputFD -sOutputFile=/dev/usb/lp1 -dNOPAUSE -- examples/tiger.eps
+
+
+Individual IJS command line parameters are as follows:
+
+
+``-sIjsServer={path}``
+ Sets the pathname for the IJS server (ie printer driver). Ghostscript will spawn a new process for this driver, and communicate with it using the IJS protocol. The pathname need not be absolute, as the PATH environment variable is searched, but it's probably a good idea for robustness and security. Note also that if ``-dSAFER`` is not specified, it's possible for PostScript code to set this parameter, so it can cause arbitrary code to be executed. See the section on Security for more information.
+
+``-sDeviceManufacturer={name} -sDeviceModel={name}``
+ These parameters select the device according to IEEE-1284 standard device ID strings. In general, consult the documentation for the driver to find the appropriate settings. Note that, if the value contains a space, you'll want to quote the value in your shell, as in the example above.
+
+``-sIjsParams={params}``
+ This parameter allows you to set arbitrary IJS parameters on the IJS driver. The format is a comma-separated list of key=value pairs. If it is necessary to send a value containing a comma or backslash, it can be escaped with a backslash. Thus, ``-sIjsParams=Foo=bar,Baz=a\,b`` sets the parameter Foo to "bar", and Baz to "a,b".
+
+``-dIjsUseOutputFD``
+ This flag indicates that Ghostscript should open the output file and pass a file descriptor to the server. If not set, Ghostscript simply passes the filename set in OutputFile to the server. In most cases, this flag won't matter, but if you have a driver which works only with OutputFD (such as hpijs 1.0.2), or if you're using the ``-sOutputFile="|cmd"`` syntax, you'll need to set it.
+
+``-dBitsPerSample=N``
+ This parameter controls the number of bits per sample. The default value of 8 should be appropriate for most work. For monochrome images, use ``-dBitsPerSample=1``.
+
+
+Generic Ghostscript options that are particularly relevant for IJS are summarized below:
+
+``-rnumber -rnumber1xnumber2``
+ Sets the resolution, in dpi. If the resolution is not specified, Ghostscript queries the IJS server to determine the preferred resolution. When the resolution is specified, it overrides the value (if any) preferred by the IJS server.
+
+``-dDuplex -dTumble``
+ These flags enable duplex (two-sided) printing. ``Tumble`` controls the orientation. When ``Tumble`` is false, the pages are oriented suitably at the left or right. When ``Tumble`` is true, the pages are oriented suitably for binding at the top or bottom.
+
+``-sProcessColorModel={name}``
+ Use this flag to select the process color model. Suitable values include ``DeviceGray``, ``DeviceRGB``, and ``DeviceCMYK``.
+
+
+Building IJS
+~~~~~~~~~~~~~~~~~~~~~
+
+IJS is included by default on Unix gcc builds, and also in autoconf'ed builds. Others may need some ``makefile`` tweaking. Firstly, make sure the IJS device is selected:
+
+``DEVICE_DEVS2=$(DD)ijs.dev``
+ Next, make sure that the path and execution type are set in the top level makefile. The values for Unix are as follows:
+
+``IJSSRCDIR=ijs IJSEXECTYPE=unix``
+ At present, "unix" and "win" are the only supported values for ``IJSEXECTYPE``. If neither sounds appropriate for your system, it's possible that more porting work is needed.
+
+Lastly, make sure that ``ijs.mak`` is included in the top level ``makefile``. It should be present right after the include of ``icclib.mak``.
+
+IJS is not inherently platform-specific. We're very much interested in taking patches from people who have ported it to non-mainstream platforms. And once it's built, you won't have to recompile Ghostscript to support new drivers!
+
+
+
+Rinkj - Resplendent inkjet driver
+---------------------------------------------------
+
+The Rinkj driver is an experimental new driver, capable of driving some Epson printers at a very high level of quality. It is not currently recommended for the faint of heart.
+
+You will need to add the following line to your ``makefile``:
+
+``DEVICE_DEVS2=$(DD)rinkj.dev``
+ Most of the configuration parameters, including resolution, choice of printer model, and linearization curves, are in a separate setup file. In addition, we rely heavily on an ICC profile for mapping document colors to actual device colors.
+
+A typical command line invocation is:
+
+.. code-block:: bash
+
+ gs -r1440x720 -sDEVICE=rinkj -sOutputFile=/dev/usb/lp0 -sSetupFile=lib/rinkj-2200-setup -sProfileOut=2200-cmyk.icm -dNOPAUSE -dBATCH file.ps
+
+Individual Rinkj command line parameters are as follows:
+
+``-sSetupFile={path}``
+ Specifies the path for the setup file.
+
+``-sProfileOut={path}``
+ Specifies the path for the output ICC profile. This profile should be a link profile, mapping the ``ProcessColorModel`` (``DeviceCMYK`` by default) to the device color space.
+
+For 6- and 7-color devices, the target color space for the output profile is currently a 4-component space. The conversion from this into the 6- or 7-color space (the "ink split") is done by lookup tables in the setup file.
+
+
+Setup files are in a simple "Key: value" text format. Relevant keys are:
+
+``Manufacturer:{name} Model:{name}``
+ The manufacturer and model of the individual device, using the same syntax as IEEE printer identification strings. Currently, the only supported manufacturer string is "EPSON", and the only supported model strings are "Stylus Photo 2200" and "Stylus Photo 7600".
+
+``Resolution:{x-dpi}x{y-dpi}``
+ The resolution in dpi. Usually, this should match the Ghostscript resolution set with the ``-r`` switch. Otherwise, the page image will be scaled.
+
+``Dither:{int}``
+ Selects among variant dither options. Currently, the choices are 1 for one-bit dither, and 2, for a 2-bit variable dot dither.
+
+``Aspect:{int}``
+ Controls the aspect ratio for highlight dot placement. Valid values are 1, 2, and 4. For best results, choose a value near the x resolution divided by the y resolution. For example, if resolution is 1440x720, aspect should be 2.
+
+``Microdot:{int}``
+ Chooses a microdot size. On EPSON devices, this value is passed directly through to the "ESC ( e" command. See EPSON documentation for further details (see, I told you this wasn't for the faint of heart).
+
+``Unidirectional:{int}``
+ Enables (1) or disables (0) unidirectional printing, which is slower but possibly higher quality.
+
+``AddLut:{plane}``
+ Adds a linearization look-up table. The plane is one of "CcMmYKk". The lookup table data follows. The line immediately following AddLut is the number of data points. Then, for each data point is a line consisting of two space-separated floats - the output value and the input value. If more than one LUT is specified for a single plane, they are applied in sequence.
+
+A typical setup file is supplied in ``lib/rinkj-2200-setup``. It is configured for the 2200, but can be adapted to the 7600 just by changing the "Model" line.
+
+A known issue with this driver is poor support for margins and page size. In some cases, this will cause an additional page to be ejected at the end of a job. You may be able to work around this by supplying a cut-down value for ``-dDEVICEHEIGHTPOINTS``, for example 755 for an 8.5x11 inch page on the EPSON 2200.
+
+
+
+HP Deskjet official drivers
+-----------------------------------
+
+HP provides official drivers for many of their Deskjet printer models. In order to use these drivers, you will need the HP Inkjet Server as well as Ghostscript, available from `HP Linux Imaging and Printing`_. This version of Ghostscript includes the patch from version 0.97 of the ``hpijs`` software. If you are installing ``hpijs`` from an RPM, you will only need the hpijs RPM, not the Ghostscript-hpijs one, as the code needed to work with ``hpijs`` is already included.
+
+Note that newer version of the ``hpijs`` drivers support the IJS protocol. If you can, you should consider using the :title:`ijs` driver instead. Among other things, the ``hpijs`` Ghostscript driver is Unix-only, and is untested on older Unix platforms.
+
+As of the 0.97 version, ``hpijs`` supports the following printer models:
+
+**e-Series**: e-20
+
+**DeskJet 350C Series**: 350C
+
+**DeskJet 600C Series**: 600C, 660C, 670/672C, 670TV, 680/682C
+
+**DeskJet 600C Series Photo**: 610/612C, 640/648C, 690/692/693/694/695/697C
+
+**DeskJet 630C Series**: 630/632C
+
+**DeskJet 800C Series**: 810/812C, 830/832C, 840/842/843C, 880/882C, 895C
+
+**DeskJet 900C Series, PhotoSmart**: 930/932C, 950/952C, 970C, PhotoSmart 1000/1100
+
+**DeskJet 990C, PhotoSmart**: 960C, 980C, 990C, PhotoSmart 1215/1218
+
+
+You will need to add the following line to your ``makefile``:
+
+.. code-block:: bash
+
+ DEVICE_DEVS2=$(DD)DJ630.dev $(DD)DJ6xx.dev $(DD)DJ6xxP.dev $(DD)DJ8xx.dev $(DD)DJ9xx.dev $(DD)DJ9xxVIP.dev $(DD)AP21xx.dev
+
+
+Please see `HP Linux Imaging and Printing`_ for more information about this driver. Thanks to the folks at HP, especially David Suffield for making this driver available and working to integrate it with Ghostscript.
+
+
+Gimp-Print driver collection
+-----------------------------------
+
+The Gimp-Print project provides a large collection of printer drivers with an IJS interface. Please see `Gimp print`_ for details.
+
+
+
+
+MS Windows printers
+-----------------------------------
+
+This section was written by Russell Lang, the author of Ghostscript's MS Windows-specific printer driver, and updated by Pierre Arnaud.
+
+The :title:`mswinpr2` device uses MS Windows printer drivers, and thus should work with any printer with device-independent bitmap (DIB) raster capabilities. The printer resolution cannot be selected directly using PostScript commands from Ghostscript: use the printer setup in the Control Panel instead. It is however possible to specify a maximum resolution for the printed document (see below).
+
+If no Windows printer name is specified in ``-sOutputFile``, Ghostscript prompts for a Windows printer using the standard Print Setup dialog box. You must set the orientation to Portrait and the page size to that expected by Ghostscript; otherwise the image will be clipped. Ghostscript sets the physical device size to that of the Windows printer driver, but it does not update the PostScript clipping path.
+
+If a Windows printer name is specified in ``-sOutputFile`` using the format "``%printer%printer_name``", for instance:
+
+.. code-block:: bash
+
+ gs ... -sOutputFile="%printer%Apple LaserWriter II NT"
+
+
+Then Ghostscript attempts to open the Windows printer without prompting (except, of course, if the printer is connected to FILE:). Ghostscript attempts to set the Windows printer page size and orientation to match that expected by Ghostscript, but doesn't always succeed. It uses this algorithm:
+
+#. If the requested page size matches one of the Windows standard page sizes +/- 2mm, request that standard size.
+#. Otherwise if the requested page size matches one of the Windows standard page sizes in landscape mode, ask for that standard size in landscape.
+#. Otherwise ask for the page size by specifying only its dimensions.
+#. Merge the requests above with the defaults. If the printer driver ignores the requested paper size, no error is generated: it will print on the wrong paper size.
+#. Open the Windows printer with the merged orientation and size.
+
+
+The Ghostscript physical device size is updated to match the Windows printer physical device.
+
+
+
+Supported command-line parameters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The :title:`mswinpr2` device supports a limited number of command-line parameters (e.g. it does not support setting the printer resolution). The recognized parameters are the following:
+
+
+``-sDEVICE=mswinpr2``
+ Selects the MS Windows printer device. If Ghostscript was not compiled with this device as the default output device, you have to specify it on the command line.
+
+``-dNoCancel``
+ Hides the progress dialog, which shows the percent of the document page already processed and also provides a cancel button. This option is useful if GS is intended to print pages in the background, without any user intervention.
+
+``-sOutputFile="%printer%printer_name"``
+ Specifies which printer should be used. The ``printer_name`` should be typed exactly as it appears in the Printers control panel, including spaces.
+
+Supported options (device properties)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Several extra options exist which cannot be set through the command-line, but only by executing the appropriate PostScript setup code. These options can be set through the inclusion of a setup file on the command-line:
+
+.. code-block:: bash
+
+ gs ... setup.ps ...
+
+The ``setup.ps`` file is responsible for the device selection, therefore you should not specify the ``-sDEVICE=mswinpr2`` option on the command-line if you are using such a setup file. Here is an example of such a setup file:
+
+.. code-block:: postscript
+
+ mark
+ /NoCancel true % don't show the cancel dialog
+ /BitsPerPixel 4 % force 4 bits/pixel
+ /UserSettings
+ <<
+ /DocumentName (Ghostscript document) % name for the Windows spooler
+ /MaxResolution 360 % maximum document resolution
+ >>
+ (mswinpr2) finddevice % select the Windows device driver
+ putdeviceprops
+ setdevice
+
+
+This example disables the progress dialog (same as the ``-dNoCancel`` option), forces a 4 bits/pixel output resolution and specifies additional user settings, such as the document name (which will be displayed by the Windows spooler for the queued document) and the maximum resolution (here 360 dpi). It then finds and selects an instance of the MS Windows device printer and activates it. This will show the standard printer dialog, since no ``/OutputFile`` property was specified.
+
+The following options are available:
+
+
+``/NoCancel boolean``
+ Disables (hides) the progress dialog when set to true or show the progress dialog if not set or set to false.
+
+``/OutputFile string``
+ Specifies which printer should be used. The string should be of the form ``%printer%printer_name``, where the ``printer_name`` should be typed exactly as it appears in the Printers control panel, including spaces.
+
+``/QueryUser integer``
+ Shows the standard printer dialog (1 or any other value), shows the printer setup dialog (2) or selects the default Windows printer without any user interaction (3).
+
+``/BitsPerPixel integer``
+ Sets the device depth to the specified bits per pixel. Currently supported values are 1 (monochrome), 4 (CMYK with screening handled by Ghostscript) and 24 (True Color, dithering handled by the Windows printer driver; this option can produce huge print jobs).
+
+``/UserSettings dict``
+ Sets additional options, defined in a dictionary. The following properties can be set:
+
+ ``/DocumentName string``
+ Defines the user friendly document name which will be displayed by the Windows spooler.
+
+ ``/DocumentRange [n1 n2]``
+ Defines the range of pages contained in the document. This information can be used by the printer dialog, in conjunction with the following property.
+
+ ``/SelectedRange [n1 n2]``
+ Defines the selected range of pages. This information will be displayed in the printer dialog and will be updated after the user interaction. A PostScript program could check these values and print only the selected page range.
+
+ ``/MaxResolution dpi``
+ Specifies the maximum tolerated output resolution. If the selected printer has a higher resolution than dpi, then Ghostscript will render the document with a submultiple of the printer resolution. For example, if ``MaxResolution`` is set to 360 and the output printer supports up to 1200 dpi, then Ghostscript renders the document with an internal resolution of 1200/4=300 dpi. This can be very useful to reduce the memory requirements when printing in True Color on some high resolution ink-jet color printers.
+
+
+These properties can be queried through the `currentpagedevice` operator. The following PostScript code snippet shows how to do it for some of the properties:
+
+.. code-block:: postscript
+
+ currentpagedevice /BitsPerPixel get == % displays the selected depth
+
+ currentpagedevice /UserSettings get % get the additional options..
+ /us exch def % ..and assign them to a variable
+
+ us /DocumentName get == % displays the document name
+ us /SelectedRange get == % displays the selected page range
+
+ % other misc. information (don't rely on them)
+
+ us /Color get == % 1 => monochrome output, 2 => color output
+ us /PrintCopies get == % displays the number of copies requested
+
+
+There are a few undocumented parameters stored in the ``UserSettings`` dictionary. You should not rely on them. Their use is still experimental and they could be removed in a future version.
+
+Duplex printing
+~~~~~~~~~~~~~~~~~~~~~
+
+If the Windows printer supports the duplex printing feature, then it will also be available through the :title:`mswinpr2` device. You can query for this support through the ``/Duplex`` property of the ``currentpagedevice``. If it returns ``null``, then the feature is not supported by the selected printer. Otherwise, true means that the printer is currently set up to print on both faces of the paper and false that it is not, but that it can.
+
+The following example shows how to print on both faces of the paper (using the long side of the paper as the reference):
+
+.. code-block:: postscript
+
+ << /Duplex true /Tumble false >> setpagedevice
+
+
+
+Sun SPARCprinter
+----------------------------
+
+This section was contributed by Martin Schulte.
+
+With a SPARCprinter you always buy software that enables you to do PostScript printing on it. A page image is composed on the host, which sends a bitmap to the SPARCprinter through a special SBUS video interface. So the need for a Ghostscript interface to the SPARCprinter seems low, but on the other hand, Sun's software prints some PostScript drawings incorrectly: some pages contain a thin vertical line of rubbish, and on some Mathematica drawings the text at the axes isn't rotated. Ghostscript, however, gives the correct results. Moreover, replacing proprietary software should never be a bad idea.
+
+The problem is that there has yet been no effort to make the SPARCPrinter driver behave like a BSD output filter. I made my tests using the script shown here.
+
+Installation
+~~~~~~~~~~~~~~~~~~~~~
+
+Add ``sparc.dev`` to ``DEVICE_DEVS`` and compile Ghostscript as described in the documentation on how to build Ghostscript. Afterwards you can use the following script as an example for printing after modifying it with the right pathnames -- including for ``{GSPATH}`` the full ``pathname`` of the Ghostscript executable:
+
+.. code-block:: postscript
+
+ outcmd1='/vol/local/lib/troff2/psxlate -r'
+ outcmd2='{GSPATH} -sDEVICE=sparc -sOUTPUTFILE=/dev/lpvi0 -'
+
+ if [ $# -eq 0 ]
+ then
+ $outcmd1 | $outcmd2
+ else
+ cat $* | $outcmd1 | $outcmd2
+ fi
+
+
+
+Problems
+~~~~~~~~~~~~~~~~~~~~~
+
+Since ``/dev/lpi`` can be opened only for exclusive use, if another job has it open (``engine_ctl_sparc`` or another Ghostscript are the most likely candidates), Ghostscript stops with "Error: /invalidfileaccess in --.outputpage--"
+
+In case of common printer problems like being out of paper, a warning describing the reason is printed to stdout. The driver tries access again each five seconds. Due to a problem with the device driver (in the kernel) the reason for printer failure isn't always reported correctly to the program. This is the case, for instance, if you open the top cover (error E5 on the printer's display). Look at the display on the printer itself if a "Printer problem with unknown reason" is reported. Fatal errors cause the print job to be terminated.
+
+
+.. note::
+
+ There is some confusion whether the resolution setting should be the integers 300 and 400, or the symbolic constants DPI300 and DPI400 (defined in ``lpviio.h``). Ghostscript releases have had it both ways. It is currently the latter. However, INOUE Namihiko reports (in bug #215256) that the former works better for him. If anyone has a definitive answer, please let us know.
+
+
+
+
+Apple dot matrix printer
+------------------------------
+
+This section was contributed by `Mark Wedel`_.
+
+The Apple Dot Matrix Printer (DMP) was a parallel predecessor to the Imagewriter printer. As far as I know, Imagewriter commands are a superset of the Dot Matrix printer's, so the driver should generate output that can be printed on Imagewriters.
+
+To print images, the driver sets the printer for unidirectional printing and 15 characters per inch (cpi), or 120dpi. It sets the line feed to 1/9 inch. When finished, it sets the printer to bidirectional printing, 1/8-inch line feeds, and 12 cpi. There appears to be no way to reset the printer to initial values.
+
+This code does not set for 8-bit characters (which is required). It also assumes that carriage return-newline is needed, and not just carriage return. These are all switch settings on the DMP, and I have configured them for 8-bit data and carriage return exclusively. Ensure that the Unix printer daemon handles 8-bit (binary) data properly; in my ``SunOS 4.1.1 printcap`` file the string "``ms=pass8,-opost``" works fine for this.
+
+Finally, you can search ``devdemp.c`` for "Init" and "Reset" to find the strings that initialize the printer and reset things when finished, and change them to meet your needs.
+
+
+
+
+Special and Test devices
+------------------------------
+
+The devices in this section are intended primarily for testing. They may be interesting as code examples, as well.
+
+
+Raw 'bit' devices
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are a collection of 'bit' devices that don't do any special formatting but output 'raw' binary data for the page images. These are used for benchmarking but can also be useful when you want to directly access the raster data.
+
+The raw devices are :title:`bit bitrgb bitcmyk`.
+
+
+Bounding box output
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There is a special :title:`bbox` "device" that just prints the bounding box of each page. You select it in the usual way:
+
+.. code-block:: bash
+
+ gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox
+
+It prints the output in a format like this:
+
+.. code-block:: bash
+
+ %%BoundingBox: 14 37 570 719
+ %%HiResBoundingBox: 14.3ep08066 37.547999 569.495061 718.319158
+
+Currently, it always prints the bounding box on stderr; eventually, it should also recognize ``-sOutputFile=``.
+
+By default, white objects don't contribute to the bounding box because many files fill the whole page with white before drawing other objects. This can be changed by:
+
+.. code-block:: bash
+
+ << /WhiteIsOpaque true >> setpagedevice
+
+Note that this device, like other devices, has a resolution and a (maximum) page size. As for other devices, the product (resolution x page size) is limited to approximately 500K pixels. By default, the resolution is 4000 DPI and the maximum page size is approximately 125", or approximately 9000 default (1/72") user coordinate units. If you need to measure larger pages than this, you must reset both the resolution and the page size in pixels, e.g.,
+
+.. code-block:: bash
+
+ gs -dNOPAUSE -dBATCH -sDEVICE=bbox -r100 -g500000x500000
+
+
+.. note::
+
+ The box returned by the :title:`bbox` device is just sufficient to contain the pixels which would be rendered by Ghostscript at the selected resolution. The language rendering rules can mean this differs by up to two pixels from the 'theoretical' area covered, and the precise area covered by curves and line joins is also, to some extent, related to the resolution. Finally the actual pixel position needs to be converted back to PostScript points, and that can be affected by mathematical precision, which can cause rounding errors. As a result the bounding box returned may differ very slightly from that which was expected.
+
+
+Ink coverage output
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+There are two special :title:`inkcov` devices that print the ink coverage of each page; the :title:`inkcov` device and the :title:`ink_cov` device. They are selected like this:
+
+
+.. code-block:: bash
+
+ gs -dSAFER -dNOPAUSE -dBATCH -o- -sDEVICE=inkcov Y.pdf
+ gs -dSAFER -dNOPAUSE -dBATCH -o- -sDEVICE=ink_cov Y.pdf
+
+
+These commands also work as expected:
+
+.. code-block:: bash
+
+ gs -o X_inkcov.txt -sDEVICE=inkcov Y.pdf
+ gs -o X_inkcov_page%03d.txt -sDEVICE=inkcov Y.pdf
+
+
+The devices print their output in a format like this:
+
+.. code-block:: postscript
+
+ Page 1
+ 0.10022 0.09563 0.10071 0.06259 CMYK OK
+ Page 2
+ 0.06108 0.05000 0.05834 0.04727 CMYK OK
+
+The difference between the two devices is that the :title:`inkcov` device considers each rendered pixel and whether it marks the C, M, Y or K channels. So the percentages are a measure of how many device pixels contain that ink. The :title:`ink_cov` device gives the more traditional use of ink coverage, it also considers the amount of each colourant at each rendered pixel, so the percentages in this case are what percentage of the ink is used on the page.
+
+As an example, If we take a page which is covered by a pure 100% cyan fill both devices would give the same result 1.00 0.00 0.00 0.00; each pixel is marked by the cyan ink and each pixel contains 100% cyan. If however we use a 50% cyan fill the inkcov device will still give 1.00 0.00 0.00 0.00 as 100% of the pixels contain cyan. The ink_cov device, however, would give a result of 0.50 0.00 0.00 0.00.
+
+
+Permutation (DeviceN color model)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+With no additional parameters, the device named "permute" looks to Ghostscript like a standard CMYK contone device, and outputs a PPM file, using a simple CMYK->RGB transform. This should be the baseline for regression testing.
+
+With the addition of ``-dPermute=1``, the internal behavior changes somewhat, but in most cases the resulting rendered file should be the same. In this mode, the color model becomes "DeviceN" rather than "DeviceCMYK", the number of components goes to six, and the color model is considered to be the (yellow, cyan, cyan, magenta, 0, black) tuple. This is what's rendered into the memory buffer. Finally, on conversion to RGB for output, the colors are permuted back.
+
+As such, this code should check that all imaging code paths are 64-bit clean. Additionally, it should find incorrect code that assumes that the color model is one of ``DeviceGray``, ``DeviceRGB``, or ``DeviceCMYK``.
+
+Currently, the code has the limitation of 8-bit continuous tone rendering only. An enhancement to do halftones is planned as well. Note, however, that when testing permuted halftones for consistency, it is important to permute the planes of the default halftone accordingly, and that any file which sets halftones explicitly will fail a consistency check.
+
+spotcmyk (DeviceN color model)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The :title:`spotcmyk` device was created for debugging and testing of the :title:`devicen` extensions to Ghostscript that were released in version 8.0. There are also another device (:title:`devicen`) in the same source file. It were created for testing however it are not actually useful except as example code.
+
+
+The :title:`spotcmyk` device was also designed to provide example code for a device which supports spot colors. Spot colors need to be specified prior to opening the first page. This can be done via adding the following to the command line: ``-c "<< /SeparationColorNames [ /Name1 /Name2 ] >> setpagedevice" -f``.
+
+The :title:`spotcmyk` device produces a binary data file (similar to the :title:`bitcmyk` device) for the CMYK data. This data file has the name specified by the "OutputFile" parameter. The device also produces a binary data file (similar to the :title:`bitmono` device) for each spot color plane. These data files have the name specified by the "OutputFile" parameter with "sn" appended to the end (where "n" is the spot color number 0 to 12)".
+
+After the :title:`spotcmyk` device produces the binary data files, the files are read and PCX format versions of these files are created with ".pcx" appended to the binary source file name.
+
+If the :title:`spotcmyk` is being used with three spot colors and the "OutputFile" parameter is ``xxx`` then the following files would be created by the device:
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 0
+
+ * - ``xxx``
+ - binary CMYK data
+ * - ``xxxs0``
+ - binary data for first spot color
+ * - ``xxxs1``
+ - binary data for second spot color
+ * - ``xxxs2``
+ - binary data for third spot color
+ * - ``xxx.pcx``
+ - CMYK data in PCX format
+ * - ``xxxs0.pcx``
+ - first spot color in PCX format
+ * - ``xxxs1.pcx``
+ - second spot color in PCX format
+ * - ``xxxs2.pcx``
+ - third spot color in PCX format
+
+
+The :title:`spotcmyk` device has the creation of the binary data files separated from the creation of the PCX files since the source file is intended as example code and many people may not be interested in the PCX format. The PCX format was chosen because it was simple to implement from pre-existing code and viewers are available. The PCX format does have the dis-advantage that most of those viewers are on Windows.
+
+
+.. _Devices_XCF:
+
+XCF (DeviceN color model)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The XCF file format is the native image format for the GIMP program. This format is currently supported by two devices: :title:`xcfrgb` and :title:`xcfcmyk`.
+
+We have been warned by the people supporting the GIMP program that they reserve the right to change the XCF format at anytime and thus these devices may become invalid. They are being included in the documentation because we have received some questions about what these devices do.
+
+The XCF devices were created for testing of the :title:`devicen` extensions to Ghostscript which were released in version 8.0.
+
+The :title:`xcfrgb` device uses a ``DeviceRGB`` process color model and creates a normal XCF file.
+
+The :title:`xcfcmyk` device was created as a means of viewing spot colors for those users that do not have access to either Photoshop (see the PSD devices) or a PCX viewer (see the :title:`spotcmyk` device).
+
+The :title:`xcfcmyk` device starts by using a ``DeviceCMYK`` process color model. The ``DeviceCMYK`` process color model allows the :title:`xcfcmyk` device to also support spot colors. Spot colors need to be specified prior to opening the first page. This can be done via adding the following to the command line:
+
+.. code-block:: bash
+
+ -c "<< /SeparationColorNames [ /Name1 /Name2 ] >> setpagedevice" -f
+
+After a page is complete, the :title:`xcfcmyk` converts the CMYK image data into RGB for storing in the XCF output file. The XCF format does not currently support CMYK data directly. The spot color planes are converted into alpha channel planes. This is done because the XCF format does not currently support spot colors.
+
+
+
+
+
+
+
+
+
+
+
+.. External links
+
+.. _PNG website: http://www.libpng.org/pub/png/pngintro.html
+.. _JPEG FAQ: http://www.faqs.org/faqs/jpeg-faq/
+.. _hOCR: https://en.wikipedia.org/wiki/HOCR
+.. _HP Linux Imaging and Printing: https://developers.hp.com/hp-linux-imaging-and-printing/
+.. _Gimp print: gimp-print.sourceforge.net
+.. _Mark Wedel: master@cats.ucsc.edu
+
+
+.. include:: footer.rst
+
diff --git a/doc/src/Drivers.rst b/doc/src/Drivers.rst
new file mode 100644
index 00000000..3cccffab
--- /dev/null
+++ b/doc/src/Drivers.rst
@@ -0,0 +1,1732 @@
+.. title:: The Interface between Ghostscript and Device Drivers
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Drivers.htm:
+.. _Drivers:
+
+
+The Interface between Ghostscript and Device Drivers
+=======================================================
+
+
+
+
+
+Adding a driver
+----------------------
+
+To add a driver to Ghostscript, first pick a name for your device, say "smurf". (Device names must be 1 to 8 characters, begin with a letter, and consist only of letters, digits, and underscores. Case is significant: all current device names are lower case.) Then all you need do is edit ``contrib.mak`` in two places.
+
+#. The list of devices, in the section headed "Catalog". Add "smurf" to the list.
+
+#. The section headed "Device drivers".
+
+Suppose the files containing the "smurf" driver are called "joe" and "fred". Then you should add the following lines:
+
+
+.. code-block:: postscript
+
+ # ------ The SMURF device ------ #
+
+ smurf_=$(GLOBJ)joe.$(OBJ) $(GLOBJ)fred.$(OBJ)
+ $(DD)smurf.dev: $(smurf_)
+ $(SETDEV) $(DD)smurf $(smurf_)
+
+ $(GLOBJ)joe.$(OBJ) : $(GLSRC)joe.c
+ $(GLCC) $(GLO_)joe.$(OBJ) $(C_) $(GLSRC)joe.c
+
+ $(GLOBJ)fred.$(OBJ) : $(GLSRC)fred.c
+ $(GLCC) $(GLO_)fred.$(OBJ) $(C_) $(GLSRC)fred.c
+
+and whatever ``joe.c`` and ``fred.c`` depend on. If the "smurf" driver also needs special libraries, for instance a library named "gorf", then the entry should look like this:
+
+.. code-block:: postscript
+
+ $(DD)smurf.dev : $(smurf_)
+ $(SETDEV) $(DD)smurf $(smurf_)
+ $(ADDMOD) $(DD)smurf -lib gorf
+
+
+If, as will usually be the case, your driver is a printer driver (as :ref:`discussed below<Printer drivers>`), the device entry should look like this:
+
+
+.. code-block:: postscript
+
+ $(DD)smurf.dev : $(smurf_) $(GLD)page.dev
+ $(SETPDEV) $(DD)smurf $(smurf_)
+
+or:
+
+.. code-block:: postscript
+
+ $(DD)smurf.dev : $(smurf_) $(GLD)page.dev
+ $(SETPDEV) $(DD)smurf $(smurf_)
+ $(ADDMOD) $(DD)smurf -lib gorf
+
+.. note::
+
+ The space before the ``:``, and the explicit compilation rules for the ``.c`` files, are required for portability.
+
+
+Keeping things simple
+------------------------
+
+If you want to add a simple device (specifically, a monochrome printer), you probably don't need to read the rest of this document; just use the code in an existing driver as a guide. The Epson and Canon BubbleJet drivers ``gdevepsn.c`` and ``gdevbj10.c`` are good models for dot-matrix printers, which require presenting the data for many scan lines at once; the DeskJet/LaserJet drivers in ``gdevdjet.c`` are good models for laser printers, which take a single scan line at a time but support data compression. For color printers, there are unfortunately no good models: the two major color inkjet printer drivers, ``gdevcdj.c`` and ``gdevstc.c``, are far too complex to read.
+
+On the other hand, if you're writing a driver for some more esoteric device, you probably do need at least some of the information in the rest of this document. It might be a good idea for you to read it in conjunction with one of the existing drivers.
+
+Duplication of code, and sheer volume of code, is a serious maintenance and distribution problem for Ghostscript. If your device is similar to an existing one, try to implement your driver by adding some parameterization to an existing driver rather than by copying code to create an entirely new source module. ``gdevepsn.c`` and ``gdevdjet.c`` are good examples of this approach.
+
+
+Driver structure
+------------------------
+
+A device is represented by a structure divided into three parts:
+
+#. Parameters that are present in all devices but may be different for each device or instance.
+
+#. An ``initialize_device_procs`` procedure.
+
+#. Device-specific parameters that may be different for each instance.
+
+A prototype of the parameter structure (including both generic and device-specific parameters) is defined and initialized at compile time, but is copied and filled in when an instance of the device is created. This structure should be declared as const, but for backward compatibility reasons it is not.
+
+The ``gx_device_common`` macro defines the common structure elements, with the intent that devices define and export a structure along the following lines. Do not fill in the individual generic parameter values in the usual way for C structures: use the macros defined for this purpose in ``gxdevice.h`` or, if applicable, ``gdevprn.h``.
+
+
+.. code-block:: c
+
+ typedef struct smurf_device_s {
+ gx_device_common;
+ ... device-specific parameters ...
+ } smurf_device;
+ smurf_device gs_smurf_device = {
+ ... macro for generic parameter values ...,
+ initialize_device_procs,
+ ... device-specific parameter values if any ...
+ };
+
+The device structure instance must have the name ``gs_smurf_device``, where "smurf" is the device name used in ``contrib.mak``. ``gx_device_common`` is a macro consisting only of the element definitions.
+
+The ``initialize_device_procs`` function pointer is called when the device is created. Its sole job is to initialize the entries in the device procedure table. On entry, the device procedure table will be full of NULL pointers. On exit, any NULLs left in the table will be filled in with pointers to the default routines. Therefore, the routine should set any non-default entries itself.
+
+Devices that are (in object-oriented terms) derived from 'base' classes (for instance a new printer device that derives from the ``prn`` device) can call provided helper functions for setting the standard functions for that base class.
+
+For example, if the "smurf" device was a printer device, its ``initialize_device_procs`` procedure might look like:
+
+.. code-block:: c
+
+ static void smurf_initialize_device_procs(gx_device *dev) {
+ /* We are derived from a prn device, and can print in the background */
+ gdev_prn_initialize_bg(dev);
+
+ /* Override functions for our specifics */
+ set_dev_proc(dev, map_color_rgb, smurf_map_color_rgb);
+ set_dev_proc(dev, map_rgb_color, smurf_map_rgb_color);
+ ...
+ }
+
+The initialize procedure function pointer does not live in the in the device procedure table (and as such is statically initialized at compile time). Nonetheless, we refer to this as being a device procedure in the rest of the discussion here.
+
+Note that the ``initialize_device_procs`` function may be called with a pointer to a ``gx_device`` rather than to the derived device class. This happens frequently when one device wants to obtain the prototype of another to copy device procedures around. Initialization of items in the device other than device procs should therefore be reserved for the ``initialize_device`` device procedure.
+
+The use of the initialize procedure is new to Ghostscript 9.55. Previous versions used a statically initialized table of device procedures. We changed to a dynamically initialized system to more easily cope with future changes to the device procedures.
+
+All the device procedures are called with the device as the first argument. Since each device type is actually a different structure type, the device procedures must be declared as taking a ``gx_device *`` as their first argument, and must cast it to ``smurf_device *`` internally. For example, in the code for the "memory" device, the first argument to all routines is called dev, but the routines actually use mdev to refer to elements of the full structure, using the following standard initialization statement at the beginning of each procedure:
+
+.. code-block:: c
+
+ gx_memory_device *const mdev = (gx_device_memory *)dev;
+
+(This is a cheap version of "object-oriented" programming: in C++, for example, the cast would be unnecessary, and in fact the procedure table would be constructed by the compiler.)
+
+Structure definition
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You should consult the definition of struct ``gx_device_s`` in ``gxdevice.h`` for the complete details of the generic device structure. Some of the most important members of this structure for ordinary drivers are:
+
+.. list-table::
+ :widths: 50 50
+
+ * - ``const char *dname;``
+ - The device name
+ * - ``bool is_open;``
+ - True if device has been opened
+ * - ``gx_device_color_info color_info;``
+ - Color information
+ * - ``int width;``
+ - Width in pixels
+ * - ``int height;``
+ - Height in pixels
+
+The name in the structure (``dname``) should be the same as the name in ``contrib.mak``.
+
+
+For sophisticated developers only
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If for any reason you need to change the definition of the basic device structure, or to add procedures, you must change the following places:
+
+- This document and the :ref:`news document<News.htm>` (if you want to keep the documentation up to date).
+
+- The definition of ``gx_device_common`` and the procedures in ``gxdevcli.h``.
+
+- Possibly, the default forwarding procedures declared in ``gxdevice.h`` and implemented in ``gdevnfwd.c``.
+
+- The device procedure record completion routines in ``gdevdflt.c``.
+
+- Possibly, the default device implementation in ``gdevdflt.c``, ``gdevddrw.c``, and ``gxcmap.c``.
+
+- The bounding box device in ``gdevbbox.c`` (probably just adding NULL procedure entries if the new procedures don't produce output).
+
+- These devices that must have complete (non-defaulted) procedure vectors:
+
+ - The null device in ``gdevnfwd.c``.
+
+ - The command list "device" in ``gxclist.c``. This is not an actual device; it only defines procedures.
+
+ - The "memory" devices in ``gdevmem.h`` and ``gdevm*.c``.
+
+- The clip list accumulation "device" in ``gxacpath.c``.
+
+- The clipping "devices" ``gxclip.c``, ``gxclip2.c``, and ``gxclipm.c``.
+
+- The pattern accumulation "device" in ``gxpcmap.c``.
+
+- The hit detection "device" in ``gdevhit.c``.
+
+- The generic printer device macros in ``gdevprn.h``.
+
+- The generic printer device code in ``gdevprn.c``.
+
+- The ``RasterOp`` source device in ``gdevrops.c``.
+
+
+You may also have to change the code for ``gx_default_get_params`` or ``gx_default_put_params`` in ``gsdparam.c``.
+
+You should not have to change any of the real devices in the standard Ghostscript distribution (listed in ``devs.mak`` and ``contrib.mak``) or any of your own devices, because all of them are supposed to use the macros in ``gxdevice.h`` or ``gdevprn.h`` to define and initialize their state.
+
+
+Coordinates and types
+-----------------------
+
+Coordinate system
+~~~~~~~~~~~~~~~~~~
+
+Since each driver specifies the initial transformation from user coordinates to device coordinates, the driver can use any coordinate system it wants, as long as a device coordinate will fit in an int. (This is only an issue on DOS systems, where ints are only 16 bits. User coordinates are represented as floats.) Most current drivers use a coordinate system with (0,0) in the upper left corner, with X increasing to the right and Y increasing toward the bottom. However, there is supposed to be nothing in the rest of Ghostscript that assumes this, and indeed some drivers use a coordinate system with (0,0) in the lower left corner.
+
+Drivers must check (and, if necessary, clip) the coordinate parameters given to them: they should not assume the coordinates will be in bounds. The ``fit_fill`` and ``fit_copy`` macros in ``gxdevice.h`` are very helpful in doing this.
+
+Color definition
+~~~~~~~~~~~~~~~~~~
+
+Between the Ghostscript graphics library and the device, colors are represented in three forms. Color components in a color space (Gray, RGB, DeviceN, etc.) represented as frac values. Device colorants are represented as ``gx_color_value`` values. For many procedures, colors are represented in a type called ``gx_color_index``. All three types are described in more detail in `Types`_.
+
+The ``color_info`` member of the device structure defines the color and gray-scale capabilities of the device. Its type is defined as follows:
+
+
+.. code-block:: c
+
+ /*
+ * The enlarged color model information structure: Some of the
+ * information that was implicit in the component number in
+ * the earlier conventions (component names, polarity, mapping
+ * functions) are now explicitly provided.
+ *
+ * Also included is some information regarding the encoding of
+ * color information into gx_color_index. Some of this information
+ * was previously gathered indirectly from the mapping
+ * functions in the existing code, specifically to speed up the
+ * halftoned color rendering operator (see
+ * gx_dc_ht_colored_fill_rectangle in gxcht.c). The information
+ * is now provided explicitly because such optimizations are
+ * more critical when the number of color components is large.
+ *
+ * Note: no pointers have been added to this structure, so there
+ * is no requirement for a structure descriptor.
+ */
+ typedef struct gx_device_color_info_s {
+
+ /*
+ * max_components is the maximum number of components for all
+ * color models supported by this device. This does not include
+ * any alpha components.
+ */
+ int max_components;
+
+ /*
+ * The number of color components. This does not include any
+ * alpha-channel information, which may be integrated into
+ * the gx_color_index but is otherwise passed as a separate
+ * component.
+ */
+ int num_components;
+
+ /*
+ * Polarity of the components of the color space, either
+ * additive or subtractive. This is used to interpret transfer
+ * functions and halftone threshold arrays. Possible values
+ * are GX_CM_POLARITY_ADDITIVE or GX_CM_POLARITY_SUBTRACTIVE
+ */
+ gx_color_polarity_t polarity;
+
+ /*
+ * The number of bits of gx_color_index actually used.
+ * This must be <= sizeof(gx_color_index), which is usually 64.
+ */
+ byte depth;
+
+ /*
+ * Index of the gray color component, if any. The max_gray and
+ * dither_gray values apply to this component only; all other
+ * components use the max_color and dither_color values.
+ *
+ * This will be GX_CINFO_COMP_NO_INDEX if there is no gray
+ * component.
+ */
+ byte gray_index;
+
+ /*
+ * max_gray and max_color are the number of distinct native
+ * intensity levels, less 1, for the gray and all other color
+ * components, respectively. For nearly all current devices
+ * that support both gray and non-gray components, the two
+ * parameters have the same value.
+ *
+ * dither_grays and dither_colors are the number of intensity
+ * levels between which halftoning can occur, for the gray and
+ * all other color components, respectively. This is
+ * essentially redundant information: in all reasonable cases,
+ * dither_grays = max_gray + 1 and dither_colors = max_color + 1.
+ * These parameters are, however, extensively used in the
+ * current code, and thus have been retained.
+ *
+ * Note that the non-gray values may now be relevant even if
+ * num_components == 1. This simplifies the handling of devices
+ * with configurable color models which may be set for a single
+ * non-gray color model.
+ */
+ gx_color_value max_gray; /* # of distinct color levels -1 */
+ gx_color_value max_color;
+
+ gx_color_value dither_grays;
+ gx_color_value dither_colors;
+
+ /*
+ * Information to control super-sampling of objects to support
+ * anti-aliasing.
+ */
+ gx_device_anti_alias_info anti_alias;
+
+ /*
+ * Flag to indicate if gx_color_index for this device may be divided
+ * into individual fields for each component. This is almost always
+ * the case for printers, and is the case for most modern displays
+ * as well. When this is the case, halftoning may be performed
+ * separately for each component, which greatly simplifies processing
+ * when the number of color components is large.
+ *
+ * If the gx_color_index is separable in this manner, the comp_shift
+ * array provides the location of the low-order bit for each
+ * component. This may be filled in by the client, but need not be.
+ * If it is not provided, it will be calculated based on the values
+ * in the max_gray and max_color fields as follows:
+ *
+ * comp_shift[num_components - 1] = 0,
+ * comp_shift[i] = comp_shift[i + 1]
+ * + ( i == gray_index ? ceil(log2(max_gray + 1))
+ * : ceil(log2(max_color + 1)) )
+ *
+ * The comp_mask and comp_bits fields should be left empty by the client.
+ * They will be filled in during initialization using the following
+ * mechanism:
+ *
+ * comp_bits[i] = ( i == gray_index ? ceil(log2(max_gray + 1))
+ * : ceil(log2(max_color + 1)) )
+ *
+ * comp_mask[i] = (((gx_color_index)1 << comp_bits[i]) - 1)
+ * << comp_shift[i]
+ *
+ * (For current devices, it is almost always the case that
+ * max_gray == max_color, if the color model contains both gray and
+ * non-gray components.)
+ *
+ * If separable_and_linear is not set, the data in the other fields
+ * is unpredictable and should be ignored.
+ */
+ gx_color_enc_sep_lin_t separable_and_linear;
+ byte comp_shift[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ byte comp_bits[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ gx_color_index comp_mask[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ /*
+ * Pointer to name for the process color model.
+ */
+ const char * cm_name;
+
+ } gx_device_color_info;
+
+
+.. note ::
+
+ See `Changing color_info data`_ before changing any information in the ``color_info`` structure for a device.
+
+It is recommended that the values for this structure be defined using one of the standard macros provided for this purpose. This allows for future changes to be made to the structure without changes being required in the actual device code.
+
+The following macros (in ``gxdevcli.h``) provide convenient shorthands for initializing this structure for ordinary black-and-white or color devices:
+
+
+.. code-block:: c
+
+ #define dci_black_and_white ...
+ #define dci_color(depth,maxv,dither) ...
+
+
+The ``#define dci_black_and_white`` macro defines a single bit monochrome device (For example: a typical monochrome printer device.)
+
+The ``#define dci_color(depth,maxv,dither)`` macro can be used to define a 24 bit RGB device or a 4 or 32 bit CMYK device.
+
+The ``#define dci_extended_alpha_values`` macro (in ``gxdevcli.h``) specifies most of the current fields in the structure. However this macro allows only the default setting for the ``comp_shift``, ``comp_bits``, and ``comp_mask`` fields to be set. Any device which requires a non-default setting for these fields has to correctly these fields during the device open procedure. See `Separable and linear fields`_ and `Changing color_info data`_.
+
+The idea is that a device has a certain number of gray levels (``max_gray+1``) and a certain number of colors (``max_rgb+1``) that it can produce directly. When Ghostscript wants to render a given color space color value as a device color, it first tests whether the color is a gray level and if so:
+
+ If ``max_gray`` is large (``>= 31``), Ghostscript asks the device to approximate the gray level directly. If the device returns a valid ``gx_color_index``, Ghostscript uses it. Otherwise, Ghostscript assumes that the device can represent ``dither_gray`` distinct gray levels, equally spaced along the diagonal of the color cube, and uses the two nearest ones to the desired color for halftoning.
+
+If the color is not a gray level:
+
+ If ``max_rgb`` is large (``>= 31``), Ghostscript asks the device to approximate the color directly. If the device returns a valid ``gx_color_index``, Ghostscript uses it. Otherwise, Ghostscript assumes that the device can represent distinct colors, equally spaced throughout the color cube, and uses two of the nearest ones to the desired color for halftoning.
+
+
+Separable and linear fields
+""""""""""""""""""""""""""""""
+
+The three fields ``comp_shift``, ``comp_bits``, and ``comp_mask`` are only used if the ``separable_and_linear`` field is set to ``GX_CINFO_SEP_LIN``. In this situation a ``gx_color_index`` value must represent a combination created by or'ing bits for each of the devices's output colorants. The ``comp_shift`` array defines the location (shift count) of each colorants bits in the output ``gx_color_index`` value. The ``comp_bits`` array defines the number of bits for each colorant. The ``comp_mask`` array contains a mask which can be used to isolate the bits for each colorant. These fields must be set if the device supports more than four colorants.
+
+Changing color_info data
+""""""""""""""""""""""""""""""
+
+For most devices, the information in the device's ``color_info`` structure is defined by the various device definition macros and the data remains constant during the entire existence of the device. In general the Ghostscript graphics assumes that the information is constant. However some devices want to modify the data in this structure.
+
+The device's ``put_params`` procedure may change ``color_info`` field values. After the data has been modified then the device should be closed (via a call to ``gs_closedevice``). Closing the device will erase the current page so these changes should only be made before anything has been drawn on a page.
+
+The device's ``open_device`` procedure may change ``color_info`` field values. These changes should be done before any other procedures are called.
+
+The Ghostscript graphics library uses some of the data in ``color_info`` to set the default procedures for the ``get_color_mapping_procs``, ``get_color_comp_index``, ``encode_color``, and ``decode_color`` procedures. These default procedures are set when the device is originally created. If any changes are made to the ``color_info`` fields then the device's ``open_device`` procedure has responsibility for insuring that the correct procedures are contained in the device structure. (For an example, see the display device open procedure ``display_open`` and its subroutine ``display_set_color_format`` (in ``gdevdsp.c``).
+
+
+
+Types
+~~~~~~~~~
+
+
+Here is a brief explanation of the various types that appear as parameters or results of the drivers.
+
+``frac`` (defined in ``gxfrac.h``)
+ This is the type used to represent color values for the input to the color model mapping procedures. It is currently defined as a short. It has a range of ``frac_0`` to ``frac_1``.
+
+``gx_color_value`` (defined in ``gxdevice.h``)
+ This is the type used to represent RGB or CMYK color values. It is currently equivalent to unsigned short. However, Ghostscript may use less than the full range of the type to represent color values: ``gx_color_value_bits`` is the number of bits actually used, and ``gx_max_color_value`` is the maximum value, equal to ``(2^gx_max_color_value_bits)-1``.
+
+``gx_device`` (defined in ``gxdevice.h``)
+ This is the device structure, as explained above.
+
+``gs_matrix`` (defined in ``gsmatrix.h``)
+ This is a 2-D homogeneous coordinate transformation matrix, used by many Ghostscript operators.
+
+``gx_color_index`` (defined in ``gxcindex.h``)
+ This is meant to be whatever the driver uses to represent a device color. For example, it might be an index in a color map, or it might be R, G, and B values packed into a single integer. The Ghostscript graphics library gets ``gx_color_index`` values from the device's ``encode_color`` and hands them back as arguments to several other procedures. If the ``separable_and_linear`` field in the device's ``color_info`` structure is not set to ``GX_CINFO_SEP_LIN`` then Ghostscript does not do any computations with ``gx_color_index`` values.
+
+ The special value ``gx_no_color_index`` (defined as ``(~(gx_color_index)(0))`` ) means "transparent" for some of the procedures.
+
+ The size of ``gx_color_index`` can be either 32 or 64 bits. The choice depends upon the architecture of the CPU and the compiler. The default type definition is simply:
+
+ .. code-block:: c
+
+ typedef unsigned long gx_color_index;
+
+
+ However if ``GX_COLOR_INDEX_TYPE`` is defined, then it is used as the type for ``gx_color_index``.
+
+ .. code-block:: c
+
+ typedef GX_COLOR_INDEX_TYPE gx_color_index;
+
+ The smaller size (32 bits) may produce more efficient or faster executing code. The larger size (64 bits) is needed for representing either more bits per component or more components. An example of the later case is a device that supports 8 bit contone colorants using a ``DeviceCMYK`` process color model with its four colorants and also supports additional spot colorants.
+
+ Currently ``autoconf`` attempts to find a 64 bit type definition for the compiler being used, and if a 64 bit type is found then ``GX_COLOR_INDEX_TYPE`` is set to the type.
+
+ For Microsoft and the MSVC compiler, ``GX_COLOR_INDEX_TYPE`` will be set to unsigned ``_int64`` if ``USE_LARGE_COLOR_INDEX`` is set to 1 either on the make command line or by editing the definition in ``msvc32.mak``.
+
+
+``gs_param_list`` (defined in gsparam.h)
+ This is a parameter list, which is used to read and set attributes in a device. See the comments in ``gsparam.h``, and the description of the ``get_params`` and ``put_params`` procedures below, for more detail.
+
+``gx_tile_bitmap`` (defined in ``gxbitmap.h``)
+
+``gx_strip_bitmap`` (defined in ``gxbitmap.h``)
+ These structure types represent bitmaps to be used as a tile for filling a region (rectangle). ``gx_tile_bitmap`` is an older, deprecated type lacking shift and ``rep_shift``; ``gx_strip_bitmap`` has superseded it, and should be used in new code. Here is a copy of the relevant part of the file:
+
+.. code-block:: c
+
+ /*
+ * Structure for describing stored bitmaps.
+ * Bitmaps are stored bit-big-endian (i.e., the 2^7 bit of the first
+ * byte corresponds to x=0), as a sequence of bytes (i.e., you can't
+ * do word-oriented operations on them if you're on a little-endian
+ * platform like the Intel 80x86 or VAX). Each scan line must start on
+ * a (32-bit) word boundary, and hence is padded to a word boundary,
+ * although this should rarely be of concern, since the raster and width
+ * are specified individually. The first scan line corresponds to y=0
+ * in whatever coordinate system is relevant.
+ *
+ * For bitmaps used as halftone tiles, we may replicate the tile in
+ * X and/or Y, but it is still valuable to know the true tile dimensions
+ * (i.e., the dimensions prior to replication). Requirements:
+ * width % rep_width = 0
+ * height % rep_height = 0
+ *
+ * For halftones at arbitrary angles, we provide for storing the halftone
+ * data as a strip that must be shifted in X for different values of Y.
+ * For an ordinary (non-shifted) halftone that has a repetition width of
+ * W and a repetition height of H, the pixel at coordinate (X,Y)
+ * corresponds to halftone pixel (X mod W, Y mod H), ignoring phase;
+ * for a shifted halftone with shift S, the pixel at (X,Y) corresponds
+ * to halftone pixel ((X + S * floor(Y/H)) mod W, Y mod H). In other words,
+ * each Y increment of H shifts the strip left by S pixels.
+ *
+ * As for non-shifted tiles, a strip bitmap may include multiple copies
+ * in X or Y to reduce loop overhead. In this case, we must distinguish:
+ * - The height of an individual strip, which is the same as
+ * the height of the bitmap being replicated (rep_height, H);
+ * - The height of the entire bitmap (size.y).
+ * Similarly, we must distinguish:
+ * - The shift per strip (rep_shift, S);
+ * - The shift for the entire bitmap (shift).
+ * Note that shift = (rep_shift * size.y / rep_height) mod rep_width,
+ * so the shift member of the structure is only an accelerator. It is,
+ * however, an important one, since it indicates whether the overall
+ * bitmap requires shifting or not.
+ *
+ * Note that for shifted tiles, size.y is the size of the stored bitmap
+ * (1 or more strips), and NOT the height of the actual tile. The latter
+ * is not stored in the structure at all: it can be computed as H * W /
+ * gcd(S, W).
+ *
+ * If the bitmap consists of a multiple of W / gcd(S, W) copies in Y, the
+ * effective shift is zero, reducing it to a tile. For simplicity, we
+ * require that if shift is non-zero, the bitmap height be less than H * W /
+ * gcd(S, W). I.e., we don't allow strip bitmaps that are large enough to
+ * include a complete tile but that don't include an integral number of
+ * tiles. Requirements:
+ * rep_shift < rep_width
+ * shift = (rep_shift * (size.y / rep_height)) % rep_width
+ *
+ * For the benefit of the planar device, we now have a num_planes field.
+ * For chunky data this should be set to 1. For planar data, the data pointer
+ * points to the first plane of data; subsequent planes of data follow
+ * immediately after this as if there were num_planes * height lines of data.
+ */
+ typedef struct gx_strip_bitmap_s {
+ byte *data;
+ int raster; /* bytes per scan line */
+ gs_int_point size; /* width, height */
+ gx_bitmap_id id;
+ ushort rep_width, rep_height; /* true size of tile */
+ ushort rep_shift;
+ ushort shift;
+ int num_planes;
+ } gx_strip_bitmap;
+
+
+Coding conventions
+----------------------------
+
+All the driver procedures defined below that return ``int`` results return 0 on success, or an appropriate negative error code in the case of error conditions. The error codes are defined in ``gserrors.h``; they correspond directly to the errors defined in the PostScript language reference manuals. The most common ones for drivers are:
+
+``gs_error_invalidfileaccess``
+ An attempt to open a file failed.
+
+``gs_error_ioerror``
+ An error occurred in reading or writing a file.
+
+``gs_error_limitcheck``
+ An otherwise valid parameter value was too large for the implementation.
+
+``gs_error_rangecheck``
+ A parameter was outside the valid range.
+
+``gs_error_VMerror``
+ An attempt to allocate memory failed. (If this happens, the procedure should release all memory it allocated before it returns.)
+
+If a driver does return an error, rather than a simple return statement it should use the ``return_error`` macro defined in ``gx.h``, which is automatically included by ``gdevprn.h`` but not by ``gserrors.h``. For example:
+
+.. code-block:: c
+
+ return_error(gs_error_VMerror);
+
+
+Allocating storage
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+While most drivers (especially printer drivers) follow a very similar template, there is one important coding convention that is not obvious from reading the code for existing drivers: driver procedures must not use ``malloc`` to allocate any storage that stays around after the procedure returns. Instead, they must use ``gs_malloc`` and ``gs_free``, which have slightly different calling conventions. (The prototypes for these are in ``gsmemory.h``, which is included in ``gx.h``, which is included in ``gdevprn.h``.) This is necessary so that Ghostscript can clean up all allocated memory before exiting, which is essential in environments that provide only single-address-space multi-tasking (some versions of Microsoft Windows).
+
+.. code-block:: c
+
+ char *gs_malloc(uint num_elements, uint element_size, const char *client_name);
+
+Like ``calloc``, but unlike ``malloc``, ``gs_malloc`` takes an element count and an element size. For structures, ``num_elements`` is 1 and ``element_size`` is ``sizeof`` the structure; for byte arrays, ``num_elements`` is the number of bytes and ``element_size`` is 1. Unlike ``calloc``, ``gs_malloc`` does not clear the block of storage.
+
+The ``client_name`` is used for tracing and debugging. It must be a real string, not ``NULL``. Normally it is the name of the procedure in which the call occurs.
+
+.. code-block:: c
+
+ void gs_free(char *data, uint num_elements, uint element_size, const char *client_name);
+
+
+Unlike ``free``, ``gs_free`` demands that ``num_elements`` and ``element_size`` be supplied. It also requires a client name, like ``gs_malloc``.
+
+
+Driver instance allocation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+All driver instances allocated by Ghostscript's standard allocator must point to a "structure descriptor" that tells the garbage collector how to trace pointers in the structure. For drivers registered in the normal way (using the ``makefile`` approach described above), no special care is needed as long as instances are created only by calling the ``gs_copydevice`` procedure defined in ``gsdevice.h``. If you have a need to define devices that are not registered in this way, you must fill in the ``stype`` member in any dynamically allocated instances with a pointer to the same structure descriptor used to allocate the instance. For more information about structure descriptors, see ``gsmemory.h`` and ``gsstruct.h``.
+
+
+
+
+Printer drivers
+---------------------
+
+Printer drivers (which include drivers that write some kind of raster file) are especially simple to implement. The printer driver must implement a ``print_page`` or ``print_page_copies`` procedure. There are macros in ``gdevprn.h`` that generate the device structure for such devices, of which the simplest is ``prn_device``; for an example, see ``gdevbj10.c``. If you are writing a printer driver, we suggest you start by reading ``gdevprn.h`` and the subsection on `Color mapping`_ below; you may be able to ignore all the rest of the driver procedures.
+
+The ``print_page`` procedures are defined as follows:
+
+.. code-block:: c
+
+ int (*print_page)(gx_device_printer *, FILE *)
+ int (*print_page_copies)(gx_device_printer *, FILE *, int)
+
+This procedure must read out the rendered image from the device and write whatever is appropriate to the file. To read back one or more scan lines of the image, the ``print_page`` procedure must call one of several procedures. Traditionally devices have called ``gdev_prn_copy_scan_lines``, ``gdev_prn_get_bits``, or the generic ``get_bits_rectangle`` device entry point. Alternatively devices may now call the new ``process_page`` entrypoint, which can have significant performance advantages in :ref:`multi-threaded<Printer drivers mt>` situations.
+
+.. code-block:: c
+
+ int gdev_prn_copy_scan_lines(gx_device_printer *pdev, int y, byte *str, uint size)
+
+For this procedure, ``str`` is where the data should be copied to, and ``size`` is the size of the buffer starting at ``str``. This procedure returns the number of scan lines copied, or ``<0`` for an error. ``str`` need not be aligned.
+
+.. code-block:: c
+
+ int gdev_prn_get_bits(gx_device_printer *pdev, int y, byte *str, byte **actual_data)
+
+
+This procedure reads out exactly one scan line. If the scan line is available in the correct format already, ``*actual_data`` is set to point to it; otherwise, the scan line is copied to the buffer starting at str, and ``*actual_data`` is set to ``str``. This saves a copying step most of the time. ``str`` need not be aligned; however, if ``*actual_data`` is set to point to an existing scan line, it will be aligned. (See the description of the ``get_bits`` procedure below for more details.)
+
+In either of these two cases, each row of the image is stored in the form described in the comment under ``gx_tile_bitmap`` above; each pixel takes the number of bits specified as ``color_info.depth`` in the device structure, and holds values returned by the device's ``encode_color`` procedure.
+
+The ``print_page`` procedure can determine the number of bytes required to hold a scan line by calling:
+
+
+.. code-block:: c
+
+ uint gdev_prn_raster(gx_device_printer *)
+
+
+For a very simple concrete example of this pattern of use, we suggest reading the code in ``bit_print_page`` in ``gdevbit.c``.
+
+If the device provides ``print_page``, Ghostscript will call ``print_page`` the requisite number of times to print the desired number of copies; if the device provides ``print_page_copies``, Ghostscript will call ``print_page_copies`` once per page, passing it the desired number of copies.
+
+
+.. _Printer drivers mt:
+
+Printer drivers (Multi-threaded)
+----------------------------------------
+
+This interface is new, and subject to change without notice.
+
+Ghostscript has supported multi-threaded rendering (controlled by the ``-dNumRenderingThreads`` command line option) since version 8.64. This uses multiple threads of execution to accelerate the rendering phase of operations, but driver specific operations (such as compression) have not been able to benefit in the same way.
+
+As from Ghostscript 9.11 onwards, a new device function, ``process_page`` has been introduced to solve this. A printer driver will be called via the ``print_page`` or ``print_page_copies`` entry point as before, but rather than requesting a rectangle of pixels at a time (by calling ``get_bits_rectangle``), the driver can now invite Ghostscript to "process the page" in whatever sized chunks it chooses.
+
+While the benefits of ``process_page`` come from its use with multiple rendering threads, it will work perfectly well in single threaded mode too. Devices do not need to implement both schemes.
+
+.. code-block:: c
+
+ int (*process_page)(gx_device *dev, gx_process_page_options_t *options)
+
+The device should fill out a ``gx_process_page_options_t`` structure and pass the address of this to the ``process_page`` function. The entries within this structure will control exactly how Ghostscript will process the page. For forwards compatibility devices should ensure that any unknown fields/option bits within the structure are initialised to 0.
+
+.. code-block:: c
+
+ typedef struct gx_process_page_options_s gx_process_page_options_t;
+
+ struct gx_process_page_options_s
+ {
+ int (*init_buffer_fn)(void *arg, gx_device *dev, gs_memory_t *memory, int w, int h, void **buffer);
+ void (*free_buffer_fn)(void *arg, gx_device *dev, gs_memory_t *memory, void *buffer);
+ int (*process_fn)(void *arg, gx_device *dev, gx_device *bdev, const gs_int_rect *rect, void *buffer);
+ int (*output_fn)(void *arg, gx_device *dev, void *buffer);
+ void *arg;
+ int options; /* A mask of GX_PROCPAGE_... options bits */
+ };
+
+
+Ghostscript is free to process the page in 1 or more sections. The potential benefits of ``process_page`` come when Ghostscript chooses to use more than 1 section (or "band") and shares the job of rendering these bands between a set of rendering threads. The overall scheme of operation is as follows:
+
+- Ghostscript will call ``init_buffer_fn`` in turn, once for each rendering thread in use. This function should (as far as possible) allocate any buffering that may be required to cope with a band of the given size.
+
+- For each band rendered, Ghostscript will call process_fn to process the given rectangle of the page into the buffer. To achieve this ``process_fn`` is passed a buffer device that contains the rendered version of that rectangle (with the ``y`` range adjusted to start from 0). ``process_fn`` should call ``get_bits_rectangle`` as usual to extract the rendered area. If the options to this call are set correctly (using ``GB_RETURN_POINTER``) no copying or additional storage will be required. All the calls to ``process_fn`` will be for non-overlapping rectangles that cover the page, hence ``process_fn`` may overwrite the storage used in the returned buffer device as part of the processing. Several calls to ``process_fn`` may take place simultaneously in different threads, and there is no guarantee that they will happen 'in order'.
+
+- Ghostscript will call output_fn for each band in turn, passing in the processed buffer containing the output of the ``process_fn`` stage. These calls are guaranteed to happen 'in order', and will be interleaved arbitrarily with the ``process_fn`` calls. Once an ``output_fn`` returns, the buffer may instantly be reused for another ``process_fn`` calls.
+
+- Once the page has been processed, Ghostscript will call ``free_buffer_fn`` for each allocated buffer to allow the device to clean up.
+
+
+At the time of writing the only defined bit in the options word is ``GX_PROCPAGE_BOTTOM_UP`` which signifies that Ghostscript should render bands from the bottom of the page to the top, rather than the default top to bottom.
+
+The height of the bands used by Ghostscript when rendering the page can either be specified by the device itself (using the ``band_params`` structure), or can be calculated by Ghostscript based upon the space available to it. It can sometimes be much easier/more efficient to code a device if the band height can be relied upon to take only particular values - for instance, a device that downscales its output will prefer the height to be a multiple of the downscale used, or a device that uses DCT based compression may prefer a multiple of 8.
+
+To accommodate such needs, before Ghostscript sets up its buffers, it will perform a ``gxdso_adjust_bandheight`` call. A device can catch this call to adjust the calculated band height to a value it would prefer. To avoid invalidating the calculated memory bounds this should generally be a 'fine' adjustment, and always downwards.
+
+A simple example of how to use ``process_page`` may be found as the :title:`fpng` device. Within this device:
+
+- The ``init_buffer_fn`` allocates a buffer large enough to hold the compressed version of each band.
+
+- The ``process_fn`` applies the sub/paeth filters to the buffered image, then compresses each band with ``zlib``.
+
+- The ``output_fn`` simply writes each compressed buffer to the file.
+
+- The ``free_buffer_fn`` frees the buffers.
+
+- In addition, the downscaler is called to demonstrate that it is possible to 'chain' ``process_page`` functions.
+
+
+The :title:`fpng` device is broadly equivalent to the :title:`png16m` device, but performs much better when multiple threads are in use. Compression is potentially worse than with :title:`png16m` due to each band being compressed separately.
+
+While the ``print_page`` entry point is specific to printer devices, the process_page device entry point is not. It will, however, only be useful for devices that involve rendering the page. As such, neither ``-dNumRenderingThreads`` or ``process_page`` will help accelerate devices such as :title:`pdfwrite` or :title:`ps2write`.
+
+
+Driver procedures
+------------------------
+
+Most of the procedures that a driver may implement are optional. If a device doesn't supply an optional procedure ``WXYZ``, the entry in the procedure structure may be either ``gx_default_WXYZ``, for instance ``gx_default_strip_tile_rectangle``, or ``NULL`` or 0. (The device procedure must also call the ``gx_default_`` procedure if it doesn't implement the function for particular values of the arguments.) Since, by construction, device procedure entries are set to 0 at creation time, ones that are not explicitly initialised will continue to work even if new (optional) members are added.
+
+Life cycle
+~~~~~~~~~~~~~
+
+When a device is first created, it will have an empty device procs table. The system will call the device's ``initialize_device_procs`` function pointer to fill out this table. This operation can never fail.
+
+.. note::
+
+ This operation is also used for creating temporary 'prototype' devices for copying device procedures from.
+
+
+A device instance begins life in a closed state. In this state, no output operations will occur. Only the following procedures may be called:
+
+``initialize_device``
+
+``open_device``
+
+``get_initial_matrix``
+
+``get_params``
+
+``put_params``
+
+``get_hardware_params``
+
+
+When ``setdevice`` installs a device instance in the graphics state, it checks whether the instance is closed or open. If the instance is closed, ``setdevice`` calls the open routine, and then sets the state to open.
+
+There is no user-accessible operation to close a device instance. This is not an oversight – it is required in order to enforce the following invariant:
+
+If a device instance is the current device in any graphics state, it must be open (have ``is_open`` set to true).
+
+Device instances are only closed when they are about to be freed, which occurs in three situations:
+
+- When a ``restore`` occurs, if the instance was created since the corresponding save and is in a VM being restored. I.e., if the instance was created in local VM since a ``save``, it will always be closed and freed by the corresponding ``restore``; if it was created in global VM, it will only be closed by the outermost ``restore``, regardless of the ``save`` level at the time the instance was created.
+
+- By the garbage collector, if the instance is no longer accessible.
+
+- When Ghostscript exits (terminates).
+
+
+Open, close, sync, copy
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``void (*initialize_device_procs)(gx_device *dev)``
+ Called once a new device instance has been created. The function should initialize the device procedure tables. This cannot fail. NOTE: Clients should rarely need to call a device's ``initialize_device_procs`` procedure: this procedure is mostly used by the internal device creation code. The sole exception here is when a device implementation wishes to copy device function pointers from another device; then a blank ``gx_device`` can be created, and ``initialize_device_procs`` can be used to fill out the device procs table so it can be copied from.
+
+``int (*initialize_device)(gx_device *dev) [OPTIONAL]``
+ Called once a new device instance has been created and the device procs table has been initialized. This function should perform the minimum initialization to any internal device state required. If the initial setup fails, this procedure should return an error; the new instance will be freed.
+
+ .. note ::
+ Clients should never call a device's ``initialize_device`` procedure: this procedure is only intended for use by the internal device creation code.
+
+``int (*open_device)(gx_device *) [OPTIONAL]``
+ Open the device: do any initialization associated with making the device instance valid. This must be done before any output to the device. The default implementation does nothing.
+
+ .. note ::
+ Clients should never call a device's ``open_device`` procedure directly: they should always call ``gs_opendevice`` instead.
+
+``void (*get_initial_matrix)(gx_device *, gs_matrix *) [OPTIONAL]``
+ Construct the initial transformation matrix mapping user coordinates (nominally 1/72 inch per unit) to device coordinates. The default procedure computes this from width, height, and ``[xy]_pixels_per_inch`` on the assumption that the origin is in the upper left corner, that is:
+
+ .. code-block:: c
+
+ xx = x_pixels_per_inch/72, xy = 0,
+ yx = 0, yy = -y_pixels_per_inch/72,
+ tx = 0, ty = height.
+
+``int (*sync_output)(gx_device *) [OPTIONAL]``
+ Synchronize the device. If any output to the device has been buffered, send or write it now. Note that this may be called several times in the process of constructing a page, so printer drivers should not implement this by printing the page. The default implementation does nothing.
+
+``int (*output_page)(gx_device *, int num_copies, int flush) [OPTIONAL]``
+ Output a fully composed page to the device. The ``num_copies`` argument is the number of copies that should be produced for a hardcopy device. (This may be ignored if the driver has some other way to specify the number of copies.) The flush argument is true for ``showpage``, false for ``copypage``. The default definition just calls ``sync_output``. Printer drivers should implement this by printing and ejecting the page.
+
+``int (*close_device)(gx_device *) [OPTIONAL]``
+ Close the device: release any associated resources. After this, output to the device is no longer allowed. The default implementation does nothing.
+
+ .. note ::
+ Clients should never call a device's ``close_device`` procedure directly: they should always call ``gs_closedevice`` instead.
+
+
+.. _Color mapping:
+
+Color and alpha mapping
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Note that code in the Ghostscript library may cache the results of calling one or more of the color mapping procedures. If the result returned by any of these procedures would change (other than as a result of a change made by the driver's ``put_params`` procedure), the driver must call ``gx_device_decache_colors(dev)``.
+
+The ``map_rgb_color``, ``map_color_rgb``, and ``map_cmyk_color`` are obsolete. They have been left in the device procedure list for backward compatibility. See the ``encode_color`` and ``decode_color`` procedures below. To insure that older device drivers are changed to use the new ``encode_color`` and ``decode_color`` procedures, the parameters for the older procedures have been changed to match the new procedures. To minimize changes in devices that have already been written, the ``map_rgb_color`` and ``map_cmyk_color`` routines are used as the default value for the ``encode_color`` routine. The ``map_cmyk_color`` routine is used if the number of components is four. The ``map_rgb_color`` routine is used if the number of components is one or three. This works okay for RGB and CMYK process color model devices. However this does not work properly for gray devices. The ``encode_color`` routine for a gray device is only passed one component. Thus the ``map_rgb_color`` routine must be modified to only use a single input (instead of three). (See the ``encode_color`` and ``decode_color`` routines below.)
+
+Colors can be specified to the Ghostscript graphics library in a variety of forms. For example, there are a wide variety of color spaces that can be used such as Gray, RGB, CMYK, DeviceN, Separation, Indexed, CIEbasedABC, etc. The graphics library converts the various input color space values into four base color spaces: Gray, RGB, CMYK, and DeviceN. The DeviceN color space allows for specifying values for individual device colorants or spot colors.
+
+Colors are converted by the device in a two step process. The first step is to convert a color in one of the base color spaces (Gray, RGB, CMYK, or DeviceN) into values for each device colorant. This transformation is done via a set of procedures provided by the device. These procedures are provided by the ``get_color_mapping_procs`` device procedure.
+
+Between the first and second steps, the graphics library applies transfer functions to the device colorants. Where needed, the output of the results after the transfer functions is used by the graphics library for halftoning.
+
+In the second step, the device procedure ``encode_color`` is used to convert the transfer function results into a ``gx_color_index`` value. The ``gx_color_index`` values are passed to specify colors to various routines. The choice of the encoding for a ``gx_color_index`` is up to the device. Common choices are indexes into a color palette or several integers packed together into a single value. The manner of this encoding is usually opaque to the graphics library. The only exception to this statement occurs when halftoning 5 or more colorants. In this case the graphics library assumes that if a colorant values is zero then the bits associated with the colorant in the ``gx_color_index`` value are zero.
+
+
+``int get_color_comp_index(const gx_device * dev, const char * pname, int name_size, int src_index) [OPTIONAL]``
+ This procedure returns the device colorant number of the given name. The possible return values are -1, 0 to ``GX_DEVICE_COLOR_MAX_COMPONENTS - 1``, or ``GX_DEVICE_COLOR_MAX_COMPONENTS``. A value of -1 indicates that the specified name is not a colorant for the device. A value of 0 to ``GX_DEVICE_COLOR_MAX_COMPONENTS - 1`` indicates the colorant number of the given name. A value of ``GX_DEVICE_COLOR_MAX_COMPONENTS`` indicates that the given name is a valid colorant name for the device but the colorant is not currently being used. This is used for implementing names which are in ``SeparationColorNames`` but not in ``SeparationOrder``.
+
+ The default procedure returns results based upon process color model of DeviceGray, DeviceRGB, or DeviceCMYK selected by ``color_info.num_components``. This procedure must be defined if another process color model is used by the device or spot colors are supported by the device.
+
+``const gx_cm_color_map_procs * get_color_mapping_procs(const gx_device * dev, const gx_device ** tdev) [OPTIONAL]``
+ This procedure returns a list of three procedures, together with the device to pass to them. These procedures are used to translate values in either Gray, RGB, or CMYK color spaces into device colorant values. A separate procedure is not required for the :title:`devicen` and ``Separation`` color spaces since these already represent device colorants.
+
+ In many cases, the device returned in tdev will be the same as ``dev``, but the caller should not rely on this. For cases where we have a chain of devices (perhaps because of a subclass or compositor device having been introduced internally as part of the rendering process), the actual device that needs to do the color mapping may be a child device of the original one. In such cases ``tdev`` will be returned as a different value to ``dev``.
+
+ The default procedure returns a list of procedures based upon ``color_info.num_components``. These procedures are appropriate for DeviceGray, DeviceRGB, or DeviceCMYK process color model devices. A procedure must be defined if another process color model is used by the device or spot colors are to be supported. All these procedures take a ``gx_device`` pointer; these should be called with the value returned in ``tdev`` NOT the initial value of ``dev``.
+
+
+``gx_color_index (*encode_color)(gx_device * dev, gx_color_value * cv) [OPTIONAL]``
+ Map a set of device color values into a ``gx_color_index`` value. The range of legal values of the arguments is 0 to ``gx_max_color_value``. The default procedure packs bits into a ``gx_color_index`` value based upon the values in ``color_info.depth`` and ``color_info.num_components``.
+ Note that the ``encode_color`` procedure must not return ``gx_no_color_index`` (all 1s).
+
+``int (*decode_color)(gx_device *, gx_color_index color, gx_color_value * CV) [OPTIONAL]``
+ This is the inverse of the ``encode_color`` procedure. Map a ``gx_color_index`` value to color values. The default procedure unpacks bits from the ``gx_color_index`` value based upon the values in ``color_info.depth`` and ``color_info.num_components``.
+
+``typedef enum { go_text, go_graphics } graphic_object_type; int (*get_alpha_bits)(gx_device *dev, graphic_object_type type) [OPTIONAL]``
+ This procedure returns the number of bits to use for anti-aliasing. The default implementation simply returns the ``color_info.anti_alias`` member of the driver structure.
+
+``void (*update_spot_equivalent_colors)(gx_device *, const gs_state *) [OPTIONAL]``
+ This routine provides a method for the device to gather an equivalent color for spot colorants. This routine is called when a ``Separation`` or :title:`devicen` color space is installed. See comments at the start of ``gsequivc.c``.
+
+ .. note::
+ This procedure is only needed for devices that support spot colorants and also need to have an equivalent color for simulating the appearance of the spot colorants.
+
+
+Pixel-level drawing
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This group of drawing operations specifies data at the pixel level. All drawing operations use device coordinates and device color values.
+
+``int (*fill_rectangle)(gx_device *, int x, int y, int width, int height, gx_color_index color)``
+ Fill a rectangle with a color. The set of pixels filled is ``{(px,py) | x <= px < x + width and y <= py < y + height}``. In other words, the point (x,y) is included in the rectangle, as are (x+w-1,y), (x,y+h-1), and (x+w-1,y+h-1), but not (x+w,y), (x,y+h), or (x+w,y+h). If width <= 0 or height <= 0, ``fill_rectangle`` should return 0 without drawing anything.
+
+ Note that ``fill_rectangle`` is the only non-optional procedure in the driver interface.
+
+Bitmap imaging
+"""""""""""""""""""
+
+Bitmap (or pixmap) images are stored in memory in a nearly standard way. The first byte corresponds to (0,0) in the image coordinate system: bits (or polybit color values) are packed into it left to right. There may be padding at the end of each scan line: the distance from one scan line to the next is always passed as an explicit argument.
+
+``int (*copy_mono)(gx_device *, const unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1) [OPTIONAL]``
+ Copy a monochrome image (similar to the PostScript image operator). Each scan line is raster bytes wide. Copying begins at (``data_x``,0) and transfers a rectangle of the given width and height to the device at device coordinate (x,y). (If the transfer should start at some non-zero y value in the data, the caller can adjust the data address by the appropriate multiple of the raster.) The copying operation writes device color ``color0`` at each 0-bit, and ``color1`` at each 1-bit: if ``color0`` or ``color1`` is ``gx_no_color_index``, the device pixel is unaffected if the image bit is 0 or 1 respectively. If ``id`` is different from ``gx_no_bitmap_id``, it identifies the bitmap contents unambiguously; a call with the same ``id`` will always have the same data, raster, and data contents.
+
+ This operation, with ``color0 = gx_no_color_index``, is the workhorse for text display in Ghostscript, so implementing it efficiently is very important.
+
+``int (*strip_tile_rectangle)(gx_device *, const gx_strip_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y) [OPTIONAL]``
+ Tile a rectangle. Tiling consists of doing multiple ``copy_mono`` operations to fill the rectangle with copies of the tile. The tiles are aligned with the device coordinate system, to avoid "seams". Specifically, the (``phase_x``, ``phase_y``) point of the tile is aligned with the origin of the device coordinate system. (Note that this is backwards from the PostScript definition of halftone phase.) ``phase_x`` and ``phase_y`` are guaranteed to be in the range ``[0..tile->width]`` and ``[0..tile->height]`` respectively.
+
+ If ``color0`` and ``color1`` are both ``gx_no_color_index``, then the tile is a color pixmap, not a bitmap: see the next section.
+
+ This operation is the workhorse for halftone filling in Ghostscript, so implementing it efficiently for solid tiles (that is, where either ``color0`` and ``color1`` are both ``gx_no_color_index``, for colored halftones, or neither one is ``gx_no_color_index``, for monochrome halftones) is very important.
+
+
+Pixmap imaging
+"""""""""""""""""""
+
+Pixmaps are just like bitmaps, except that each pixel may occupy more than one bit. In "chunky" or "Z format", all the bits for each pixel are grouped together. For ``copy_color``, the number of bits per pixel is given by the ``color_info.depth`` parameter in the device structure. The legal values are 1, 2, 4, 8, 16, 24, 32, 40, 48, 56, or 64. The pixel values are device color codes (that is, whatever it is that ``encode_color`` returns).
+
+If the data is planar, then each plane is contiguous, and the number of planes is given by ``color_info.num_components``. The bits per component is ``depth/num_components``.
+
+``int (*copy_color)(gx_device *, const unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height) [OPTIONAL]``
+ Copy a color image with multiple bits per pixel. The ``raster`` is in bytes, but ``x`` and ``width`` are in pixels, not bits. If ``id`` is different from ``gx_no_bitmap_id``, it identifies the bitmap contents unambiguously; a call with the same ``id`` will always have the same data, raster, and data contents.
+
+``int (*copy_planes)(gx_device *, const unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, int plane_height) [OPTIONAL]``
+ Copy an image with data stored in planar format. The raster is in bytes, but ``x`` and ``width`` are in pixels, not bits. If ``id`` is different from ``gx_no_bitmap_id``, it identifies the bitmap contents unambiguously; a call with the same ``id`` will always have the same data, raster, and data contents.
+
+ Each plane is ``depth/num_components`` number of bits and the distance between planes is ``plane_height`` number of rows. The height is always less than or equal to the ``plane_height``.
+
+We do not provide a separate procedure for tiling with a pixmap; instead, ``strip_tile_rectangle`` can also take colored tiles. This is indicated by the ``color0`` and ``color1`` arguments' both being ``gx_no_color_index``. In this case, as for ``copy_color``, the raster and height in the "bitmap" are interpreted as for real bitmaps, but the ``x`` and ``width`` are in pixels, not bits.
+
+
+.. code-block:: c
+
+ typedef enum {
+ transform_pixel_region_begin = 0,
+ transform_pixel_region_data_needed = 1,
+ transform_pixel_region_process_data = 2,
+ transform_pixel_region_end = 3
+ } transform_pixel_region_reason;
+ typedef struct {
+ void *state;
+ union {
+ struct {
+ const gs_int_rect *clip;
+ int w; /* source width */
+ int h; /* source height */
+ int spp;
+ const gx_dda_fixed_point *pixels; /* DDA to enumerate the destination positions of pixels across a row */
+ const gx_dda_fixed_point *rows; /* DDA to enumerate the starting position of each row */
+ gs_logical_operation_t lop;
+ } init;
+ struct {
+ const unsigned char *buffer[GX_DEVICE_COLOR_MAX_COMPONENTS];
+ int data_x;
+ gx_cmapper_t *cmapper;
+ const gs_gstate *pgs;
+ } process_data;
+ } u;
+ } transform_pixel_region_data;
+
+
+``int (*transform_pixel_region)(gx_device *, transform_pixel_reason, transform_pixel_reason_data *data) [OPTIONAL]``
+ Transform a 2-dimensional region of pixels into the destination. Given a 2d source block of pixels (supplied as scanline data), this function transforms that data, maps it through the supplied colour lookup function, clips it, and plots it into the device.
+
+ In all calls to this function a negative return value indicates an error.
+
+ Called first with the ``transform_pixel_region_init`` reason code, this prepares for subsequent calls to scale a region as described in the ``data.u.init`` structure. A pointer to any state required for this should be written into ``data.state``, and the caller must pass that in to subsequent calls.
+
+ Subsequently this will be called with ``transform_pixel_region_data_needed``. The function will then check to see if the next scanline of data will be trivially clipped away. If so, then it will return zero to indicate that it is not needed. This can help the caller to avoid unnecessary processing. A positive return value indicates that the line is required.
+
+ For every line where the data is required, the function will be called with ``transform_pixel_region_process_data``. The function will then read and process the line from ``data.u.process_data``. The data in the buffer is packed 8 bit values, which will be fed into the supplied cmapper to set the device color as required. This is then written into the device.
+
+ Once all the scanlines have been fed through calls to ``transform_pixel_region_data_needed`` and ``transform_pixel_region_process_data``, a final call with ``transform_pixel_region_end`` is made that frees the state.
+
+ The default implementation of this device function will generally break the pixel data down into calls to ``fill_rectangle``, though in some cases (notably the portrait 8 bit per component output case), a faster route through ``copy_color`` can be used.
+
+ Memory devices offer a version of this device function that can accelerate direct plotting to the memory array.
+
+ .. note::
+ Currently the clipping rectangle is not honoured for skewed (not portrait or landscape) transformations. This is allowed for in the callers.
+
+
+Compositing
+""""""""""""""""
+
+In addition to direct writing of opaque pixels, devices must also support compositing. Currently two kinds of compositing are defined (``RasterOp`` and alpha-based), but more may be added in the future.
+
+``int (*copy_alpha)(gx_device *dev, const unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color, int depth) [OPTIONAL]``
+ This procedure is somewhat misnamed: it was added to the interface before we really understood alpha channel and compositing.
+ Fill a given region with a given color modified by an individual alpha value for each pixel. For each pixel, this is equivalent to alpha-compositing with a source pixel whose alpha value is obtained from the pixmap (``data``, ``data_x``, and ``raster``) and whose color is the given color (which has not been premultiplied by the alpha value), using the Sover rule.
+
+ ``depth``, the number of bits per alpha value, is either 2, 4 or 8. Any copy_alpha routine must accept being called with an 8 bit depth. In addition they should accept either 2 or 4 if the corresponding ``get_alpha_bits`` procedure returns either of those values.
+
+``int (*copy_alpha_hl_color)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth) [OPTIONAL]``
+ Equivalent function to ``copy_alpha``, using high level color rather than a ``gx_color_index``.
+
+``int (*composite)(dev_t *dev, gx_device_t **pcdev, const gs_composite_t *pcte, const gs_imager_state *pis, gs_memory_t *memory) [OPTIONAL]``
+ Requests that a device perform a compositing operation; the device should composite data written to it with the device's existing data, according to the compositing function defined by ``*pcte``. If a device cannot perform such an operation itself, it will create a compositor device to wrap itself that will perform such operations for it. Accordingly, the caller must watch the return values from this function to understand if a new device has been created to which future calls should be made.
+
+ Devices will normally implement this in one of the following standard ways:
+
+ - Devices that don't do any imaging and don't forward any imaging operations (for example, the null device, the hit detection device, and the clipping list accumulation device) simply set ``*pcdev`` to themselves, and return 0, which effectively ignores the compositing function.
+
+ - "Leaf" devices that do imaging and have no special optimizations for compositing (for example, some memory devices) ask the ``gs_composite_t`` to create a default compositor device that 'wraps' the current device. They put this in ``*pcdev`` and return 1.
+
+ - Leaf devices that can implement some kinds of compositing operation efficiently (for example, monobit memory devices and ``RasterOp``) inspect the type and values of ``*pcte`` to determine whether it specifies such an operation: if so, they create a specialized compositor, and if not, they ask the ``gs_composite_t`` to create a default compositor. They place this in ``*pcdev`` and return 1.
+
+ In short, on every non-error return, ``*pcdev`` will be set either to the leaf device (in the case where no special compositing is required), or to the device that does the compositing. If the return code is 1, then ``*pcdev`` is a new device that was created to wrap dev to perform the compositing for it. Callers may need to spot this case so as to update which device future operations are sent to.
+
+ For forwarding devices, for example, if the call returns 1, then they should update their target device to be the new device. For the graphics library, if the call returns 1, then it should update the current device to be the new one.
+
+ Other kinds of forwarding devices, which don't fall into any of these categories, require special treatment. In principle, what they do is ask their target to create a compositor, and then create and return a copy of themselves with the target's new compositor as the target of the copy. There is a possible default implementation of this approach: if the original device was D with target T, and T creates a compositor C, then the default implementation creates a device F that for each operation temporarily changes D's target to C, forwards the operation to D, and then changes D's target back to T. However, the Ghostscript library currently only creates a compositor with an imaging forwarding device as target in a few specialized situations (banding, and bounding box computation), and these are handled as special cases.
+
+ Note that the compositor may have a different color space, color representation, or bit depth from the device to which it is compositing. For example, alpha-compositing devices use standard-format chunky color even if the underlying device doesn't.
+
+ Closing a compositor frees all of its storage, including the compositor itself. However, since the composite call may return the same device, clients must check for this case, and only call the close procedure if a separate device was created.
+
+
+Polygon-level drawing
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+In addition to the pixel-level drawing operations that take integer device coordinates and pure device colors, the driver interface includes higher-level operations that draw polygons using fixed-point coordinates, possibly halftoned colors, and possibly a non-default logical operation.
+
+The ``fill_*`` drawing operations all use the center-of-pixel rule: a pixel is colored if, and only if, its center falls within the polygonal region being filled. If a pixel center (X+0.5,Y+0.5) falls exactly on the boundary, the pixel is filled if, and only if, the boundary is horizontal and the filled region is above it, or the boundary is not horizontal and the filled region is to the right of it.
+
+``int (*fill_trapezoid)(gx_device *dev, const gs_fixed_edge *left, const gs_fixed_edge *right, fixed ybot, fixed ytop, bool swap_axes, const gx_drawing_color *pdcolor, gs_logical_operation_t lop) [OPTIONAL]``
+ Fill a trapezoid. The bottom and top edges are parallel to the x axis, and are defined by ``ybot`` and ``ytop``, respectively. The left and right edges are defined by ``left`` and ``right``. Both of these represent lines (``gs_fixed_edge`` is defined in ``gxdevcli.h`` and consists of ``gs_fixed_point`` start and end points). The y coordinates of these lines need not have any specific relation to ``ybot`` and ``ytop``. The routine is defined this way so that the filling algorithm can subdivide edges and still guarantee that the exact same pixels will be filled. If ``swap_axes`` is set, the meanings of X and Y are interchanged.
+
+``int (*fill_parallelogram)(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop) [OPTIONAL]``
+ Fill a parallelogram whose corners are (``px``,``py``), (``px+ax``,``py+ay``), (``px+bx``,``py+by``), and (``px+ax+bx``,``py+ay+by``). There are no constraints on the values of any of the parameters, so the parallelogram may have any orientation relative to the coordinate axes.
+
+``int (*fill_triangle)(gx_device *dev, fixed px, fixed py, fixed ax, fixed ay, fixed bx, fixed by, const gx_drawing_color *pdcolor, gs_logical_operation_t lop) [OPTIONAL]``
+ Fill a triangle whose corners are (``px``,``py``), (``px+ax``,``py+ay``), and (``px+bx``,``py+by``).
+
+``int (*draw_thin_line)(gx_device *dev, fixed fx0, fixed fy0, fixed fx1, fixed fy1, const gx_drawing_color *pdcolor, gs_logical_operation_t lop) [OPTIONAL]``
+ Draw a one-pixel-wide line from (``fx0``,``fy0``) to (``fx1``,``fy1``).
+
+
+Linear color drawing
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Linear color functions allow fast high quality rendering of shadings on continuous tone devices. They implement filling simple areas with a lineary varying color. These functions are not called if the device applies halftones, or uses a non-separable or a non-linear color model.
+
+``int (*fill_linear_color_triangle) (dev_t *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const frac31 *c0, const frac31 *c1, const frac31 *c2) [OPTIONAL]``
+ This function is the highest level one within the linear color function group. It fills a triangle with a linearly varying color. Arguments specify 3 points in the device space - vertices of a triangle, and their colors. The colors are represented as vectors of positive fractional numbers, each of which represents a color component value in the interval [0,1]. The number of components in a vector in the number of color components in the device (process) color model.
+
+ The implementation fills entire triangle. The filling rule is same as for Polygon-level drawing. The color of each pixel within the triangle is computed as a linear interpolation of vertex colors.
+
+ The implementation may reject the request if the area or the color appears too complex for filling in a single action. For doing that the implementation returns 0 and must not paint any pixel. In this case the graphics library will perform a subdivision of the area into smaller triangles and call the function again with smaller areas.
+
+ .. important::
+
+ - Do not try to decompose the area within the implementation of ``fill_linear_color_triangle``, because it can break the plane coverage contiguity and cause a dropout. Instead request that the graphics library should perform the decomposition. The graphics library is smart enough to do that properly.
+
+ - The implementation must handle a special case, when only 2 colors are specified. It happens if ``p2`` is ``NULL``. This means that the color does not depend on the X coordinate, i.e. it forms a linear gradient along the Y axis. The implementation must not reject (return 0) such cases.
+
+ - The device color component value 1 may be represented with several hexadecimal values : ``0x7FFF0000``, ``0x7FFFF000``, ``0x7FFFFF00``, etc., because the precision here exceeds the color precision of the device. To convert a ``frac31`` value into a device color component value, first drop (ignore) the sign bit, then drop least significant bits - so many ones as you need to fit the device color precision.
+
+ - The ``fa`` argument may contain the ``swap_axes`` bit set. In this case the implementation must swap (transpose) X and Y axes.
+
+ - The implementation must not paint outside the clipping rectangle specified in the ``fa`` argument. If ``fa->swap_axes`` is true, the clipping rectangle is transposed.
+
+ See ``gx_default_fill_linear_color_triangle`` in ``gdevddrw.c`` for sample code.
+
+``int (*fill_linear_color_trapezoid) (dev_t *dev, const gs_fill_attributes *fa, const gs_fixed_point *p0, const gs_fixed_point *p1, const gs_fixed_point *p2, const gs_fixed_point *p3, const frac31 *c0, const frac31 *c1, const frac31 *c2, const frac31 *c2) [OPTIONAL]``
+ This function is a lower level one within the linear color function group. The default implementation of ``fill_linear_color_triangle`` calls this function 1-2 times per triangle. Besides that, this function may be called by the graphics library for other special cases, when a decomposition into triangles appears undesirable.
+
+ While the prototype can specify a bilinear color, we assume that the implementation handles linear colors only. This means that the implementation can ignore any of ``c0``, ``c1``, ``c2``, ``c3`` . The graphics library takes a special care of the color linearity when calling this function. The reason for passing all 4 color arguments is to avoid color precision problems.
+
+ Similarly to ``fill_linear_color_triangle`` , this function may be called with only 2 colors, and may reject areas as being too complex. All those important notes are applicable here.
+
+ Sample code may be found in in ``gxdtfill.h``; be aware it's rather complicated. A linear color function is generated from it as ``gx_fill_trapezoid_ns_lc`` with the following template parameters:
+
+ .. code-block:: c
+
+ #define LINEAR_COLOR 1
+ #define EDGE_TYPE gs_linear_color_edge
+ #define FILL_ATTRS const gs_fill_attributes *
+ #define CONTIGUOUS_FILL 0
+ #define SWAP_AXES 0
+ #define FILL_DIRECT 1
+
+ See the helplers ``init_gradient``, ``step_gradient`` (defined in ``gdevddrw.c``), how to manage colors.
+
+ See ``check_gradient_overflow`` (defined in in ``gdevddrw.c``), as an example of an area that can't be painted in a single action due to 64-bits fixed overflows.
+
+
+``int (*fill_linear_color_scanline) (dev_t *dev, const gs_fill_attributes *fa, int i, int j, int w, const frac31 *c0, const int32_t *c0_f, const int32_t *cg_num, int32_t cg_den) [OPTIONAL]``
+ This function is the lowest level one within the linear color function group. It implements filling a scanline with a linearly varying color. The default implementation for ``fill_linear_color_trapezoid`` calls this function, and there are no other calls to it from the graphics libary. Thus if the device implements ``fill_linear_color_triangle`` and ``fill_linear_color_trapezoid`` by own means, this function may be left unimplemented.
+
+ ``i`` and ``j`` specify device coordinates (indices) of the starting pixel of the scanline, ``w`` specifies the width of the scanline, i.e. the number of pixels to be painted to the right from the starting pixel, including the starting pixel.
+
+ ``c0`` specifies the color for the starting pixel as a vector of fraction values, each of which represents a color value in the interval [0,1].
+
+ ``c0_f`` specify a fraction part of the color for the starting pixel. See the formula below about using it.
+
+ ``cg_num`` specify a numerator for the color gradient - a vector of values in [-1,1], each of which correspond to a color component.
+
+ ``cg_den`` specify the denominator for the color gradient - a value in [-1,1].
+
+ The color for the pixel ``[i + k, j]`` to be computed like this :
+
+ ``(double)(c0[n] + (c0_f[n] + cg_num[n] * k) / cg_den) / (1 ^ 31 - 1)``
+
+ where ``0 <= k <= w`` , and ``n`` is a device color component index.
+
+ .. important::
+
+ - The ``fa`` argument may contain the ``swap_axes`` bit set. In this case the implementation must swap (transpose) X and Y axes.
+
+ - The implementation must not paint outside the clipping rectangle specified in the ``fa`` argument. If ``fa->swap_axes`` is true, the clipping rectangle is transposed.
+
+ See ``gx_default_fill_linear_color_scanline`` in ``gdevdsha.c`` for sample code.
+
+
+
+High-level drawing
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+In addition to the lower-level drawing operations described above, the driver interface provides a set of high-level operations. Normally these will have their default implementation, which converts the high-level operation to the low-level ones just described; however, drivers that generate high-level (vector) output formats such as :title:`pdfwrite`, or communicate with devices that have firmware for higher-level operations such as polygon fills, may implement these high-level operations directly. For more details, please consult the source code, specifically:
+
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - Header
+ - Defines
+ * - gxpaint.h
+ - ``gx_fill_params``, ``gx_stroke_params``
+ * - gxfixed.h
+ - fixed, ``gs_fixed_point`` (used by ``gx_*_params``)
+ * - gxgstate.h
+ - ``gs_imager_state`` (used by ``gx_*_params``)
+ * - gxline.h
+ - ``gx_line_params`` (used by ``gs_imager_state``)
+ * - gslparam.h
+ - line cap/join values (used by ``gx_line_params``)
+ * - gxmatrix.h
+ - ``gs_matrix_fixed`` (used by ``gs_imager_state``)
+ * - gspath.h, gxpath.h, gzpath.h
+ - ``gx_path``
+ * - gxcpath.h, gzcpath.h
+ - ``gx_clip_path``
+
+
+For a minimal example of how to implement the high-level drawing operations, see ``gdevtrac.c``.
+
+Paths
+"""""""""""
+
+``int (*fill_path)(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_fill_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath) [OPTIONAL]``
+ Fill the given path, clipped by the given clip path, according to the given parameters, with the given color. The clip path pointer may be ``NULL``, meaning do not clip.
+
+ The implementation must paint the path with the specified device color, which may be either a pure color, or a pattern. If the device can't handle non-pure colors, it should check the color type and call the default implementation ``gx_default_fill_path`` for cases which it can't handle. The default implementation will perform a subdivision of the area to be painted, and will call other device virtual functions (such as ``fill_linear_color_triangle``) with simpler areas.
+
+``int (*stroke_path)(gx_device *dev, const gs_imager_state *pis, gx_path *ppath, const gx_stroke_params *params, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath) [OPTIONAL]``
+ Stroke the given path, clipped by the given clip path, according to the given parameters, with the given color. The clip path pointer may be ``NULL``, meaning not to clip.
+
+``int (*fill_mask)(gx_device *dev, const byte *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, const gx_drawing_color *pdcolor, int depth, int command, const gx_clip_path *pcpath) [OPTIONAL]``
+ Color the 1-bits in the given mask (or according to the alpha values, if depth > 1), clipped by the given clip path, with the given color and logical operation. The clip path pointer may be ``NULL``, meaning do not clip. The parameters ``data``, ``...``, ``height`` are as for ``copy_mono``; ``depth`` is as for ``copy_alpha``; ``command`` is as below.
+
+The function specification f
+""""""""""""""""""""""""""""""""""""
+
+"Command" indicates the raster operation and transparency as follows:
+
+
+.. list-table::
+ :widths: 20 80
+ :header-rows: 1
+
+ * - Bits
+ - Notes
+ * - 7-0
+ - raster op
+ * - 8
+ - 0 if source opaque, 1 if source transparent
+ * - 9
+ - 0 if texture opaque, 1 if texture transparent
+ * - 10
+ - 1 if pdf transparency is in use, 0 otherwise.
+
+ This makes no difference to the rendering,
+
+ but forces the raster operation to be considered non-idempotent by internal routines.
+ * - 11
+ - 1 if the target of this operation is a specific plane, rather than all planes.
+
+ The plane in question is given by bits 13 upwards. This is only used by the planar device.
+ * - 12-
+ - If bit 11 = 1, then bits 1
+
+
+In general most devices should just check to see that bits they do not handle (11 and above typically) are zero, and should jump to the default implementation, or return an error otherwise.
+
+The raster operation follows the Microsoft and H-P specification. It is an 8-element truth table that specifies the output value for each of the possible 2×2×2 input values as follows:
+
+
+
+.. list-table::
+ :widths: 25 25 25 25
+ :header-rows: 1
+
+ * - Bit
+ - Texture
+ - Source
+ - Destination
+ * - 7
+ - 1
+ - 1
+ - 1
+ * - 6
+ - 1
+ - 1
+ - 0
+ * - 5
+ - 1
+ - 0
+ - 1
+ * - 4
+ - 1
+ - 0
+ - 0
+ * - 3
+ - 0
+ - 1
+ - 1
+ * - 2
+ - 0
+ - 1
+ - 0
+ * - 1
+ - 0
+ - 0
+ - 1
+ * - 0
+ - 0
+ - 0
+ - 0
+
+
+Transparency affects the output in the following way. A source or texture pixel is considered transparent if its value is all 1s (for instance, 1 for bitmaps, ``0xffffff`` for 24-bit RGB pixmaps) and the corresponding transparency bit is set in the command. For each pixel, the result of the Boolean operation is written into the destination if, and only if, neither the source nor the texture pixel is transparent. (Note that the HP ``RasterOp`` specification, on which this is based, specifies that if the source and texture are both all 1s and the command specifies transparent source and opaque texture, the result should be written in the output. We think this is an error in the documentation.)
+
+
+Images
+""""""""""""""""""""""""""""""""""""
+
+Similar to the high-level interface for fill and stroke graphics, a high-level interface exists for bitmap images. The procedures in this part of the interface are optional.
+
+Bitmap images come in a variety of types, corresponding closely (but not precisely) to the PostScript ImageTypes. The generic or common part of all bitmap images is defined by:
+
+.. code-block:: c
+
+ typedef struct {
+ const gx_image_type_t *type;
+ gs_matrix ImageMatrix;
+ } gs_image_common_t;
+
+Bitmap images that supply data (all image types except image_type_from_device (2)) are defined by:
+
+.. code-block:: c
+
+ #define gs_image_max_components 5
+ typedef struct {
+ << gs_image_common_t >>
+ int Width;
+ int Height;
+ int BitsPerComponent;
+ float Decode[gs_image_max_components * 2];
+ bool Interpolate;
+ } gs_data_image_t;
+
+Images that supply pixel (as opposed to mask) data are defined by:
+
+
+.. code-block:: c
+
+ typedef enum {
+ /* Single plane, chunky pixels. */
+ gs_image_format_chunky = 0,
+ /* num_components planes, chunky components. */
+ gs_image_format_component_planar = 1,
+ /* BitsPerComponent * num_components planes, 1 bit per plane */
+ gs_image_format_bit_planar = 2
+ } gs_image_format_t;
+ typedef struct {
+ << gs_data_image_t >>
+ const gs_color_space *ColorSpace;
+ bool CombineWithColor;
+ } gs_pixel_image_t;
+
+Ordinary PostScript Level 1 or Level 2 (ImageType 1) images are defined by:
+
+.. code-block:: c
+
+ typedef enum {
+ /* No alpha. */
+ gs_image_alpha_none = 0,
+ /* Alpha precedes color components. */
+ gs_image_alpha_first,
+ /* Alpha follows color components. */
+ gs_image_alpha_last
+ } gs_image_alpha_t;
+ typedef struct {
+ << gs_pixel_image_t >>
+ bool ImageMask;
+ bool adjust;
+ gs_image_alpha_t Alpha;
+ } gs_image1_t;
+ typedef gs_image1_t gs_image_t;
+
+
+Of course, standard PostScript images don't have an alpha component. For more details, consult the source code in ``gsiparam.h`` and ``gsiparm*.h``, which define parameters for an image.
+
+The ``begin[_typed_]image`` driver procedures create image enumeration structures. The common part of these structures consists of:
+
+
+.. code-block:: c
+
+ typedef struct gx_image_enum_common_s {
+ const gx_image_type_t *image_type;
+ const gx_image_enum_procs_t *procs;
+ gx_device *dev;
+ gs_id id;
+ int num_planes;
+ int plane_depths[gs_image_max_planes]; /* [num_planes] */
+ int plane_widths[gs_image_max_planes] /* [num_planes] */
+ } gx_image_enum_common_t;
+
+
+where ``procs`` consists of:
+
+.. code-block:: c
+
+ typedef struct gx_image_enum_procs_s {
+
+ /*
+ * Pass the next batch of data for processing.
+ */
+ #define image_enum_proc_plane_data(proc)\
+ int proc(gx_device *dev,\
+ gx_image_enum_common_t *info, const gx_image_plane_t *planes,\
+ int height)
+
+ image_enum_proc_plane_data((*plane_data));
+
+ /*
+ * End processing an image, freeing the enumerator.
+ */
+ #define image_enum_proc_end_image(proc)\
+ int proc(gx_device *dev,\
+ gx_image_enum_common_t *info, bool draw_last)
+
+ image_enum_proc_end_image((*end_image));
+
+ /*
+ * Flush any intermediate buffers to the target device.
+ * We need this for situations where two images interact
+ * (currently, only the mask and the data of ImageType 3).
+ * This procedure is optional (may be 0).
+ */
+ #define image_enum_proc_flush(proc)\
+ int proc(gx_image_enum_common_t *info)
+
+ image_enum_proc_flush((*flush));
+
+ } gx_image_enum_procs_t;
+
+
+In other words, ``begin[_typed]_image`` sets up an enumeration structure that contains the procedures that will process the image data, together with all variables needed to maintain the state of the process. Since this is somewhat tricky to get right, if you plan to create one of your own you should probably read an existing implementation of ``begin[_typed]_image``, such as the one in ``gdevbbox.c``.
+
+The data passed at each call of ``image_plane_data`` consists of one or more planes, as appropriate for the type of image. ``begin[_typed]_image`` must initialize the ``plane_depths`` array in the enumeration structure with the depths (bits per element) of the planes. The array of ``gx_image_plane_t`` structures passed to each call of ``image_plane_data`` then defines where the data are stored, as follows:
+
+
+.. code-block:: c
+
+ typedef struct gx_image_plane_s {
+ const byte *data;
+ int data_x;
+ uint raster;
+ } gx_image_plane_t;
+
+
+``int (*begin_typed_image)(gx_device *dev, const gs_imager_state *pis, const gs_matrix *pmat, const gs_image_common_t *pim, gs_int_rect *prect, const gx_drawing_color *pdcolor, const gx_clip_path *pcpath, gs_memory_t *memory, gx_image_enum_common_t **pinfo) [OPTIONAL]``
+ Begin the transmission of an image. Zero or more calls of the ``image_plane_data`` function supplied in the returned image enumerator will follow, and then a call of ``end_image``. The parameters of ``begin_typed_image`` are as follows:
+
+
+
+ .. list-table::
+ :widths: 15 85
+ :header-rows: 0
+
+ * - ``pis``
+ - pointer to an imager state.
+ The only relevant elements of the imager state are the CTM (coordinate transformation matrix),
+
+ the logical operation (``RasterOp`` or transparency), and the color rendering information.
+
+ For mask images, if ``pmat`` is not NULL and the color is pure, ``pis`` may be NULL.
+
+ * - ``pmat``
+ - pointer to a ``gs_matrix`` structure that defines the image transformation matrix.
+
+ If ``pis`` is non-NULL, and ``pmat`` is NULL, then the ``ctm`` from ``pis`` should be used.
+
+ * - ``pim``
+ - pointer to the ``gs_image_t`` structure that defines the image parameters.
+
+ * - ``prect``
+ - if not NULL, defines a subrectangle of the image;
+
+ only the data for this subrectangle will be passed to ``image_plane_data``,
+
+ and only this subrectangle should be drawn.
+
+ * - ``pdcolor``
+ - defines a drawing color, only needed for masks or if ``CombineWithColor`` is true.
+
+ * - ``pcpath``
+ - if not NULL, defines an optional clipping path.
+
+ * - ``memory``
+ - defines the allocator to be used for allocating bookkeeping information.
+
+ * - ``pinfo``
+ - the implementation should return a pointer to its state structure here.
+
+
+ ``begin_typed_image`` is expected to allocate a structure for its bookkeeping needs, using the allocator defined by the memory parameter, and return it in ``*pinfo``. ``begin_typed_image`` should not assume that the structures in ``*pim``, ``*prect``, or ``*pdcolor`` will survive the call on ``begin_typed_image`` (except for the color space in ``*pim->ColorSpace``): it should copy any necessary parts of them into its own bookkeeping structure. It may, however, assume that ``*pis``, ``*pcpath``, and of course ``*memory`` will live at least until ``end_image`` is called.
+
+ ``begin_typed_image`` returns 0 normally, or 1 if the image does not need any data. In the latter case, ``begin_typed_image`` does not allocate an enumeration structure.
+
+
+The format of the image (how pixels are represented) is given by ``pim->format``.
+
+The actual transmission of data uses the procedures in the enumeration structure, not driver procedures, since the handling of the data usually depends on the image type and parameters rather than the device. These procedures are specified as follows.
+
+
+``int (*image_plane_data)(gx_device *dev, gx_image_enum_common_t *info, const gx_image_plane_t *planes, int height)``
+ This call provides more of the image source data: specifically, height rows, with Width pixels supplied for each row.
+
+ The data for each row are packed big-endian within each byte, as for copy_color. The ``data_x`` (starting X position within the row) and raster (number of bytes per row) are specified separately for each plane, and may include some padding at the beginning or end of each row. Note that for non-mask images, the input data may be in any color space and may have any number of bits per component (1, 2, 4, 8, 12); currently mask images always have 1 bit per component, but in the future, they might allow multiple bits of alpha. Note also that each call of ``image_plane_data`` passes complete pixels: for example, for a chunky image with 24 bits per pixel, each call of ``image_plane_data`` passes 3N bytes of data (specifically, 3 × Width × height).
+
+ The interpretation of planes depends on the format member of the ``gs_image[_common]_t`` structure:
+
+ If the format is ``gs_image_format_chunky``, ``planes[0].data`` points to data in "chunky" format, in which the components follow each other (for instance, RGBRGBRGB....)
+
+ If the format is ``gs_image_format_component_planar``, ``planes[0 .. N-1].data`` point to data for the N components (for example, N=3 for RGB data); each plane contains samples for a single component, for instance, RR..., GG..., BB.... Note that the planes are divided by component, not by bit: for example, for 24-bit RGB data, N=3, with 8-bit values in each plane of data.
+
+ If the format is ``gs_image_format_bit_planar``, ``planes[0 .. N*B-1].data`` point to data for the N components of B bits each (for example, N=3 and B=4 for RGB data with 4 bits per component); each plane contains samples for a single bit, for instance, R0 R1 R2 R3 G0 G1 G2 G3 B0 B1 B2 B3.
+
+ Note that the most significant bit of each plane comes first.
+
+ If, as a result of this call, ``image_plane_data`` has been called with all the data for the (sub-)image, it returns 1; otherwise, it returns 0 or an error code as usual.
+
+ ``image_plane_data``, unlike most other procedures that take bitmaps as arguments, does not require the data to be aligned in any way.
+
+ Note that for some image types, different planes may have different numbers of bits per pixel, as defined in the ``plane_depths`` array.
+
+
+``int (*end_image)(gx_device *dev, void *info, bool draw_last)``
+ Finish processing an image, either because all data have been supplied or because the caller has decided to abandon this image. ``end_image`` may be called at any time after ``begin_typed_image``. It should free the info structure and any subsidiary structures. If ``draw_last`` is true, it should finish drawing any buffered lines of the image.
+
+
+.. note::
+
+ - While there will almost never be more than one image enumeration in progress -- that is, after a ``begin_typed_image``, ``end_image`` will almost always be called before the next ``begin_typed_image`` -- driver code should not rely on this property; in particular, it should store all information regarding the image in the info structure, not in the driver structure.
+
+ - If ``begin_typed_image`` saves its parameters in the info structure, it can decide on each call whether to use its own algorithms or to use the default implementation. (It may need to call ``gx_default_begin/end_image`` partway through.)
+
+
+Text
+""""""""""""""""""""""""""""""""""""
+
+The third high-level interface handles text. As for images, the interface is based on creating an enumerator which then may execute the operation in multiple steps. As for the other high-level interfaces, the procedures are optional.
+
+
+``int (*text_begin)(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text, gs_font *font, const gx_clip_path *pcpath, gs_text_enum_t **ppte) [OPTIONAL]``
+ Begin processing text, by creating a state structure and storing it in ``*ppte``. The parameters of ``text_begin`` are as follows:
+
+ .. list-table::
+ :widths: 15 85
+ :header-rows: 0
+
+ * - ``dev``
+ - The usual pointer to the device.
+ * - ``pis``
+ - A pointer to an imager state. All elements may be relevant, depending on how the text is rendered.
+ * - ``text``
+ - A pointer to the structure that defines the text operation and parameters. See ``gstext.h`` for details.
+ * - ``font``
+ - Defines the font for drawing.
+ * - ``pcpath``
+ - If not ``NULL``, defines an optional clipping path. Only relevant if the text operation includes ``TEXT_DO_DRAW``.
+ * - ``ppte``
+ - The implementation should return a pointer to its state structure here.
+
+
+ ``text_begin`` must allocate a structure for its bookkeeping needs, using the allocator used by the graphics state, and return it in ``*ppte``. ``text_begin`` may assume that the structures passed as parameters will survive until text processing is complete.
+
+ If the text operation includes ``TEXT_DO...PATH`` then the character outline will be appended to the current path in the ``pgs``. The current point of that path indicates where drawing should occur and will be updated by the string width (unless the text operation includes ``TEXT_DO_NONE``).
+
+ If the text operation includes ``TEXT_DO_DRAW`` then the text color will be taken from the current colour in the graphics state. (Otherwise no colour is required).
+
+ The bookkeeping information will be allocated using the memory allocator from the graphics state.
+
+ Clients should not call the driver text_begin procedure directly. Instead, they should call ``gx_device_text_begin``, which takes the same parameters and also initializes certain common elements of the text enumeration structure, or ``gs_text_begin``, which takes many of the parameters from a graphics state structure. For details, see ``gstext.h``.
+
+ The actual processing of text uses the procedures in the enumeration structure, not driver procedures, since the handling of the text may depend on the font and parameters rather than the device. Text processing may also require the client to take action between characters, either because the client requested it (``TEXT_INTERVENE`` in the operation) or because rendering a character requires suspending text processing to call an external package such as the PostScript interpreter. (It is a deliberate design decision to handle this by returning to the client, rather than calling out of the text renderer, in order to avoid potentially unknown stack requirements.) Specifically, the client must call the following procedures, which in turn call the procedures in the text enumerator.
+
+
+``int gs_text_process(gs_text_enum_t *pte)``
+ Continue processing text. This procedure may return 0 or a negative error code as usual, or one of the following values (see ``gstext.h`` for details).
+
+ .. list-table::
+ :widths: 30 70
+ :header-rows: 0
+
+ * - TEXT_PROCESS_RENDER
+ - The client must cause the current character to be rendered.
+
+ This currently only is used for PostScript Type 0-4 fonts and their CID-keyed relatives.
+
+ * - TEXT_PROCESS_INTERVENE
+ - The client has asked to intervene between characters. This is used for ``cshow`` and ``kshow``.
+
+
+
+``int gs_text_release(gs_gstate * pgs, gs_text_enum_t *pte, client_name_t cname)``
+ Finish processing text and release all associated structures. Clients must call this procedure after ``gs_text_process`` returns 0 or an error, and may call it at any time.
+
+ There are numerous other procedures that clients may call during text processing. See ``gstext.h`` for details.
+
+
+ .. note::
+
+ Unlike many other optional procedures, the default implementation of ``text_begin`` cannot simply return: like the default implementation of ``begin[_typed]_image``, it must create and return an enumerator. Furthermore, the implementation of the process procedure (in the enumerator structure, called by ``gs_text_process``) cannot simply return without doing anything, even if it doesn't want to draw anything on the output. See the comments in ``gxtext.h`` for details.
+
+
+Unicode support for high level (vector) devices
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Implementing a new high level (also known as vector) device, one may need to translate Postscript character codes into Unicode. This can be done pretty simply.
+
+For translating a Postscript text you need to implement the device virtual function ``text_begin``. It should create a new instance of ``gs_text_enum_t`` in the heap (let its pointer be ``pte``), and assign a special function to ``gs_text_enum_t::procs.process``. The function will receive ``pte``. It should take the top level font from ``pte->orig_font``, and iterate with ``font->procs.next_char_glyph(pte, ..., &glyph)``. The last argument receives a ``gs_glyph`` value, which encodes a Postscript character name or CID (and also stores it into ``pte->returned.current_glyph``). Then obtain the current subfont with ``gs_text_current_font(pte)`` (it can differ from the font) and call ``subfont->procs.decode_glyph(subfont, glyph)``. The return value will be an Unicode code, or ``GS_NO_CHAR`` if the glyph can't be translated to Unicode.
+
+
+Reading bits back
+~~~~~~~~~~~~~~~~~~~
+
+``int (*get_bits_rectangle)(gx_device *dev, const gs_int_rect *prect, gs_get_bits_params_t *params) [OPTIONAL]``
+ Read a rectangle of bits back from the device. The ``params`` structure consists of:
+
+ .. list-table::
+ :widths: 30 70
+ :header-rows: 0
+
+ * - ``options``
+ - the allowable formats for returning the data
+ * - ``data[32]``
+ - pointers to the returned data
+ * - ``x_offset``
+ - the X offset of the first returned pixel in data
+ * - ``raster``
+ - the distance between scan lines in the returned data
+
+ ``options`` is a bit mask specifying what formats the client is willing to accept. (If the client has more flexibility, the implementation may be able to return the data more efficiently, by avoiding representation conversions.) The options are divided into groups:
+
+ *alignment*
+ Specifies whether the returned data must be aligned in the normal manner for bitmaps, or whether unaligned data are acceptable.
+
+ *pointer or copy*
+ Specifies whether the data may be copied into storage provided by the client and/or returned as pointers to existing storage. (Note that if copying is not allowed, it is much more likely that the implementation will return an error, since this requires that the client accept the data in the implementation's internal format.)
+
+ *X offset*
+ Specifies whether the returned data must have a specific X offset (usually zero, but possibly other values to avoid skew at some later stage of processing) or whether it may have any X offset (which may avoid skew in the ``get_bits_rectangle`` operation itself).
+
+ *raster*
+ Specifies whether the raster (distance between returned scan lines) must have its standard value, must have some other specific value, or may have any value. The standard value for the raster is the device width padded out to the alignment modulus when using pointers, or the minimum raster to accommodate the X offset + width when copying (padded out to the alignment modulus if standard alignment is required).
+
+ *format*
+ Specifies whether the data are returned in chunky (all components of a single pixel together), component-planar (each component has its own scan lines), or bit-planar (each bit has its own scan lines) format.
+
+ *color space*
+ Specifies whether the data are returned as native device pixels, or in a standard color space. Currently the only supported standard space is RGB.
+
+ *standard component depth*
+ Specifies the number of bits per component if the data are returned in the standard color space. (Native device pixels use ``dev->color_info.depth`` bits per pixel.)
+
+ *alpha*
+ Specifies whether alpha channel information should be returned as the first component, the last component, or not at all. Note that for devices that have no alpha capability, the returned alpha values will be all 1s.
+
+
+The client may set more than one option in each of the above groups; the implementation will choose one of the selected options in each group to determine the actual form of the returned data, and will update ``params[].options`` to indicate the form. The returned ``params[].options`` will normally have only one option set per group.
+
+For further details on params, see ``gxgetbit.h``. For further details on options, see ``gxbitfmt.h``.
+
+Define ``w = prect->q.x - prect->p.x, h = prect->q.y - prect->p.y``. If the bits cannot be read back (for example, from a printer), return ``gs_error_unknownerror``; if raster bytes is not enough space to hold ``offset_x + w pixels``, or if the source rectangle goes outside the device dimensions (``p.x < 0 || p.y < 0 || q.x > dev->width || q.y > dev->height``), return ``gs_error_rangecheck``; if any regions could not be read, return ``gs_error_ioerror`` if unpainted is ``NULL``, otherwise the number of rectangles (see below); otherwise return 0.
+
+The caller supplies a buffer of ``raster × h`` bytes starting at ``data[0]`` for the returned data in chunky format, or ``N`` buffers of ``raster × h`` bytes starting at ``data[0]`` through ``data[N-1]`` in planar format where ``N`` is the number of components or bits. The contents of the bits beyond the last valid bit in each scan line (as defined by ``w``) are unpredictable. ``data`` need not be aligned in any way. If ``x_offset`` is non-zero, the bits before the first valid bit in each scan line are undefined. If the implementation returns pointers to the ``data``, it stores them into ``data[0]`` or ``data[0..N-1]``.
+
+
+Parameters
+~~~~~~~~~~~~~~~~~~~
+
+Devices may have an open-ended set of parameters, which are simply pairs consisting of a name and a value. The value may be of various types: integer (int or long), boolean, float, string, name, NULL, array of integer, array of float, or arrays or dictionaries of mixed types. For example, the ``Name`` of a device is a string; the ``Margins`` of a device is an array of two floats. See ``gsparam.h`` for more details.
+
+If a device has parameters other than the ones applicable to all devices (or, in the case of printer devices, all printer devices), it must provide ``get_params`` and ``put_params`` procedures. If your device has parameters beyond those of a straightforward display or printer, we strongly advise using the ``get_params`` and ``put_params`` procedures in an existing device (for example, ``gdevcdj.c`` or ``gdevbit.c``) as a model for your own code.
+
+
+``int (*get_params)(gx_device *dev, gs_param_list *plist) [OPTIONAL]``
+ Read the parameters of the device into the parameter list at plist, using the ``param_write_*`` macros or procedures defined in ``gsparam.h``.
+
+``int (*get_hardware_params)(gx_device *dev, gs_param_list *plist) [OPTIONAL]``
+ Read the hardware-related parameters of the device into the parameter list at plist. These are any parameters whose values are under control of external forces rather than the program -- for example, front panel switches, paper jam or tray empty sensors, etc. If a parameter involves significant delay or hardware action, the driver should only determine the value of the parameter if it is "requested" by the ``gs_param_list [param_requested(plist, key_name)]``. This function may cause the asynchronous rendering pipeline (if enabled) to be drained, so it should be used sparingly.
+
+``int (*put_params)(gx_device *dev, gs_param_list *plist) [OPTIONAL]``
+ Set the parameters of the device from the parameter list at plist, using the ``param_read_*`` macros/procedures defined in ``gsparam.h``. All ``put_params`` procedures must use a "two-phase commit" algorithm; see ``gsparam.h`` for details.
+
+Default color rendering dictionary (CRD) parameters
+""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Drivers that want to provide one or more default CIE color rendering dictionaries (CRDs) can do so through ``get_params``. To do this, they create the CRD in the usual way (normally using the ``gs_cie_render1_build`` and ``_initialize`` procedures defined in ``gscrd.h``), and then write it as a parameter using ``param_write_cie_render1`` defined in ``gscrdp.h``. However, the ``TransformPQR`` procedure requires special handling. If the CRD uses a ``TransformPQR`` procedure different from the default (identity), the driver must do the following:
+
+- The ``TransformPQR`` element of the CRD must include a ``proc_name``, and optionally ``proc_data``. The ``proc_name`` is an arbitrary name chosen by the driver to designate the particular ``TransformPQR`` function. It must not be the same as any device parameter name; we strongly suggest it include the device name, for instance, "bitTPQRDefault".
+
+- For each such named ``TransformPQR`` procedure, the driver's ``get_param`` procedure must provide a parameter of the same name. The parameter value must be a string whose bytes are the actual procedure address.
+
+
+For a complete example, see the ``bit_get_params`` procedure in ``gdevbit.c``. Note that it is essential that the driver return the CRD or the procedure address only if specifically requested (``param_requested(...) > 0``); otherwise, errors will occur.
+
+
+
+Device parameters affecting interpretation
+""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Some parameters have been defined for high level (vector) device drivers which affect the operation of the interpreter. These are documented here so that other devices requiring the same behaviour can use these parameters.
+
+``/HighLevelDevice``
+ True if the device is a high level (vector) device. Currently this controls haltone emission during setpagedevice. Normally ``setpagdevice`` resets the halftone to a default value, which is unfortunate for high-level devices such as :title:`ps2write` and :title:`pdfwrite`, as they are unable to tell that this is caused by ``setpagdevice`` rather than a halftone set by the input file. In order to prevent spurious default halftones being embedded in the output, if ``/HighLevelDevice`` is present and true in the device paramters, then the default halftone will not be set during ``setpagedevice``. Also prevents interpolation of imagemasks during PDF interpretation.
+
+``/AllowIncrementalCFF``
+ :title:`pdfwrite` relies on font processing occuring in a particular order, which may not happen if CFF fonts are downloaded incrementally. Defining this parameter to true will prevent incremental CFF downloading (may raise an error during processing).
+
+``/AllowPSRepeatFuncs``
+ :title:`pdfwrite` emits functions as type 4, and as a result can't convert PostScript functions using the repeat operator into PDF functions. Defining this parameter as true will cause such functions to raise an error during processing.
+
+``/IsDistiller``
+ Defining this parameter as true will result in the operators relating to 'distillerparams' being defined (``setdistillerparams``/``currentdistillerparams``). Some PostScript files behave differently if these operators are present (e.g. rotating the page) so this parameter may be true even if the device is not strictly a Distiller. For example :title:`ps2write` defines this parameter to be true.
+
+``/PreserveSMask``
+ If this parameter is true then the PDF interpreter will not convert ``SMask`` (soft mask, ie transparent) images into opaque images. This should be set to true for devices which can handle transparency (e.g. :title:`pdfwrite`).
+
+``/PreserveTrMode``
+ If this parameter is true then the PDF interpreter will not handle Text Rendering modes by degenerating into a sequence of text operations, but will instead set the ``Tr`` mode, and emit the text once. This value should be true for devices which can handle PDF text rendering modes directly.
+
+``/WantsToUnicode``
+ In general, Unicode values are not of interest to rendering devices, but for high level (aka vector) devices, they can be extremely valuable. If this parameter is defined as true then ``ToUnicode CMaps`` and ``GlyphName2Unicode`` tables will be processed and stored.
+
+
+Page devices
+~~~~~~~~~~~~~~
+
+``gx_device *(*get_page_device)(gx_device *dev) [OPTIONAL]``
+ According to the Adobe specifications, some devices are "page devices" and some are not. This procedure returns NULL if the device is not a page device, or the device itself if it is a page device. In the case of forwarding devices, ``get_page_device`` returns the underlying page device (or NULL if the underlying device is not a page device).
+
+Miscellaneous
+~~~~~~~~~~~~~~~
+
+``int (*get_band)(gx_device *dev, int y, int *band_start) [OPTIONAL]``
+ If the device is a band device, this procedure stores in ``*band_start`` the scan line (device Y coordinate) of the band that includes the given Y coordinate, and returns the number of scan lines in the band. If the device is not a band device, this procedure returns 0. The latter is the default implementation.
+
+``void (*get_clipping_box)(gx_device *dev, gs_fixed_rect *pbox) [OPTIONAL]``
+ Stores in ``*pbox`` a rectangle that defines the device's clipping region. For all but a few specialized devices, this is *((0,0),(width,height))*.
+
+
+Device Specific Operations
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In order to enable the provision of operations that make sense only to a small range of devices/callers, we provide an extensible function. The operation to perform is specified by an integer, taken from an enumeration in ``gxdevsop.h``.
+
+A typical user of this function might make a call to detect whether a device works in a particular way (such as whether it has a particular color mapping) to enable an optimisation elsewhere. Sometimes it may be used to detect a particular piece of functionality (such as whether ``copy_plane`` is supported); in other cases it may be used both to detect the presence of other functionality and to perform functions as well (such as with the pdf specific pattern management calls - moved here from their own dedicated device function).
+
+This function is designed to be easy to chain through multiple levels of device without each intermediate device needing to know about the full range of operations it may be asked to perform.
+
+``int (*dev_spec_op)(gx_device *dev, int dso, void *data, int size) [OPTIONAL]``
+ Perform device specific operation ``dso``. Returns ``gs_error_undefined`` for an unknown (or unsupported operation), other negative values for errors, and (``dso`` specific) non-negative values to indicate success. For details of the meanings of ``dso``, ``data`` and ``size``, see ``gxdevsop.h``.
+
+
+Tray selection
+----------------------
+
+The logic for selecting input trays, and modifying other parameters based on tray selection, can be complex and subtle, largely thanks to the requirement to be compatible with the PostScript language ``setpagedevice`` mechanism. This section will describe recipes for several common scenarios for tray selection, with special attention to the how the overall task factors into configuration options, generic logic provided by the PostScript language (or not, if the device is used with other PDL's), and implementation of the ``put_param`` / ``get_param`` device functions within the device.
+
+In general, tray selection is determined primarily through the ``setpagedevice`` operator, which is part of the PostScript runtime. Ghostscript attempts to be as compatible as is reasonable with the PostScript standard, so for more details, see the description in the PostScript language specifications, including the "supplements", which tend to have more detail about ``setpagedevice`` behavior than the PLRM book itself.
+
+The first step is to set up an ``/InputAttributes`` dictionary matching the trays and so on available in the device. The standard Ghostscript initialization files set up a large ``InputAttributes`` dictionary with many "known" page sizes (the full list is in ``gs_statd.ps``, under ``.setpagesize``). It's possible to edit this list in the Ghostscript source, of course, but most of the time it is better to execute a snippet of PostScript code after the default initialization but before sending any actual jobs.
+
+Simply setting a new ``/InputAttributes`` dictionary with ``setpagedevice`` will not work, because the the language specification for ``setpagedevice`` demands a "merging" behavior - paper tray keys present in the old dictionary will be preserved even if the key is not present in the new ``/InputAttributes`` dictionary. Here is a sample invocation that clears out all existing keys, and installs three new ones: a US letter page size for trays 0 and 1, and 11x17 for tray 1. Note that you must add at least one valid entry into the ``/InputAttributes`` dictionary; if all are null, then the ``setpagedevice`` will fail with a ``/configurationerror``.
+
+
+.. code-block:: postscript
+
+ << /InputAttributes
+ currentpagedevice /InputAttributes get
+ dup { pop 1 index exch null put } forall
+
+ dup 0 << /PageSize [612 792] >> put
+ dup 1 << /PageSize [612 792] >> put
+ dup 2 << /PageSize [792 1224] >> put
+ >> setpagedevice
+
+After this code runs, then requesting a letter page size (612x792 points) from ``setpagedevice`` will select tray 0, and requesting an 11x17 size will select tray 2. To explicitly request tray 1, run:
+
+.. code-block:: postscript
+
+ << /PageSize [612 792] /MediaPosition 1 >> setpagedevice
+
+
+At this point, the chosen tray is sent to the device as the (nonstandard) ``%MediaSource`` device parameter. Devices with switchable trays should implement this device parameter in the ``put_params`` procedure. Unlike the usual protocol for device parameters, it is not necessary for devices to also implement ``get_params`` querying of this paramter; it is effectively a write-only communication from the language to the device. Currently, among the devices that ship with Ghostscript, only PCL (``gdevdjet.c``) and PCL/XL (``gdevpx.c``) implement this parameter, but that list may well grow over time.
+
+If the device has dynamic configuration of trays, etc., then the easiest way to get that information into the tray selection logic is to send a ``setpagedevice`` request (if using the standard API, then using ``gsapi_run_string_continue``) to update the ``/InputAttributes`` dictionary immediately before beginning a job.
+
+
+Tray rotation and the LeadingEdge parameter
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Large, sophisticated printers often have multiple trays supporting both short-edge and long-edge feed. For example, if the paper path is 11 inches wide, then 11x17 pages must always print short-edge, but letter size pages print with higher throughput if fed from long-edge trays. Generally, the device will expect the rasterized bitmap image to be rotated with respect to the page, so that it's always the same orientation with respect to the paper feed direction.
+
+The simplest way to achieve this behavior is to call ``gx_device_request_leadingedge`` to request a ``LeadingEdge`` value ``LeadingEdge`` field in the device structure based on the ``%MediaSource`` tray selection index and knowledge of the device's trays. The default ``put_params`` implementation will then handle this request (it's done this way to preserve the transactional semantics of ``put_params``; it needs the new value, but the changes can't actually be made until all params succeed). For example, if tray 0 is long-edge, while trays 1 and 2 are short-edge, the following code outline should select the appropriate rotation:
+
+.. code-block:: c
+
+ my_put_params(gx_device *pdev, gs_param_list *plist) {
+ my_device *dev = (my_device *)pdev;
+ int MediaSource = dev->myMediaSource;
+
+ code = param_read_int(plist, "%MediaSource", &MediaSource);
+
+ switch (MediaSource) {
+ case 0:
+ gx_device_req_leadingedge(dev, 1);
+ break;
+ case 1:
+ case 2:
+ gx_device_req_leadingedge(dev, 0);
+ break;
+ }
+ ...call default put_params, which makes the change...
+
+ dev->myMediaSource = MediaSource;
+ return 0;
+ }
+
+Ghostscript also supports explicit rotation of the page through setting the ``/LeadingEdge`` parameter with ``setpagedevice``. The above code snippet will simply override this request. To give manual setting through ``setpagedevice`` priority, don't change the ``LeadingEdge`` field in the device if its ``LEADINGEDGE_SET_MASK`` bit is set. In other words, simply enclose the above switch statement inside an ``if (!(dev->LeadingEdge & LEADINGEDGE_SET_MASK) { ... }`` statement.
+
+Interaction between LeadingEdge and PageSize
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+As of LanguageLevel 3, PostScript now has two mechanisms for rotating the imaging of the page: the ``LeadingEdge`` parameter described in detail above, and the automatic rotation as enabled by the ``/PageSize`` page device parameter (described in detail in Table 6.2 of the PLRM3). Briefly, the ``PageSize`` autorotation handles the case where the page size requested in ``setpagedevice`` matches the swapped size of the paper source (as set in the ``InputAttributesDictionary``). This mechanism can be, and has been, used to implement long-edge feed, but has several disadvantages. Among other things, it's overly tied to the PostScript language, while the device code above will work with other languages. Also, it only specifies one direction of rotation (90 degrees counterclockwise). Thus, given the choice, ``LeadingEdge`` is to be preferred.
+
+If ``PageSize`` is used, the following things are different:
+
+- The ``PageSize`` array in ``InputAttributes`` is swapped, so it is ``[long short]``.
+
+- The ``.MediaSize`` device parameter is similarly swapped.
+
+- The initial matrix established by the device through the ``get_initial_matrix`` procedure is the same as for the non-rotated case.
+
+- The CTM rotation is done in the ``setpagedevice`` implementation.
+
+
+.. include:: footer.rst
diff --git a/doc/src/Fonts.rst b/doc/src/Fonts.rst
new file mode 100644
index 00000000..bcba4890
--- /dev/null
+++ b/doc/src/Fonts.rst
@@ -0,0 +1,419 @@
+.. title:: Fonts and Font Facilities Supplied with Ghostscript
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Fonts.htm:
+
+
+Fonts and Font Facilities Supplied with Ghostscript
+======================================================
+
+
+
+
+About Ghostscript fonts
+---------------------------
+
+Ghostscript is distributed with two kinds of files related to fonts:
+
+- The fonts themselves in individual files.
+
+- A file "Fontmap" that defines for Ghostscript which file represents which font.
+
+Additionally, the file ``cidfmap`` can be used to create substitutes for ``CIDFonts`` referenced by name in Postscript and PDF jobs. See the section on CID Font Substitution for details.
+
+.. note::
+
+ Care must be exercised since poor or incorrect output may result from inappropriate ``CIDFont`` substitution. We therefore strongly recommend embedding CIDFonts in your Postscript and PDF files if at all possible.
+
+The "base 35" fonts required for Postscript (and "base 14" required for PDF) are Postscript Type 1 font files.
+
+When Ghostscript needs a font, it must have some way to know where to look for it: that's the purpose of the ``Fontmap`` file, which associates the names of fonts such as ``/Times-Roman`` with the names of font files, such as ``n021003l.pfb``. ``Fontmap`` can also create aliases for font names, so that for instance, ``/NimbusNo9L-Regu`` means the same font as ``/Times-Roman``.
+
+Where a mapping in ``Fontmap`` maps a font name to a ``path/file``, the directory containing the font file is automatically added to the ``permit file read`` list. For example:
+
+.. code-block:: postscript
+
+ /Arial (/usr/share/fonts/truetype/msttcorefonts/arial.ttf) ;
+
+will result in the path ``/usr/share/fonts/truetype/msttcorefonts/`` being added to the permit file read list. This is done on the basis that font files are often grouped in common directories, and rather than risk the file permissions lists being swamped with (potentially) hundreds of individual files, it makes sense to add the directories.
+
+
+.. note::
+
+ ``Fontmap`` is processed (and the paths added to the file permissions list) during initialisation of the Postscript interpreter, so any attempt by a Postscript job to change the font map cannot influence the file permissions list.
+
+
+
+Ghostscript's free fonts
+------------------------------
+
+35 commercial-quality Type 1 basic PostScript fonts -- Times, Helvetica, Courier, Symbol, etc. -- contributed by `URW++ Design and Development Incorporated`_, of Hamburg, Germany. ``Fontmap`` names them all.
+
+
+
+How Ghostscript gets fonts when it runs
+---------------------------------------------------
+
+Fonts occupy about 50KB each, so Ghostscript doesn't load them all automatically when it runs. Instead, as part of normal initialization Ghostscript runs a file ``gs_fonts.ps``, which arranges to load fonts on demand using information from the font map. To preload all of the known fonts, invoke the procedure:
+
+
+.. code-block:: postscript
+
+ loadallfonts
+
+The file ``lib/prfont.ps`` contains code to print a sample page of a font. Load this program by including it in the ``gs`` command line or by invoking:
+
+.. code-block:: bash
+
+ (prfont.ps) run
+
+Then to produce a sampler of a particular font ``XYZ``, invoke:
+
+.. code-block:: postscript
+
+ /XYZ DoFont
+
+For example,
+
+.. code-block:: postscript
+
+ /Times-Roman DoFont
+
+For more information about how Ghostscript loads fonts during execution, see :ref:`Font lookup<Use_Font lookup>`.
+
+
+.. _Fonts_Add:
+
+Adding your own fonts
+---------------------------------------------------
+
+Ghostscript can use any Type 0, 1, 3, 4, or 42 font acceptable to other PostScript language interpreters or to ATM, including MultiMaster fonts. Ghostscript can also use TrueType font files.
+
+To add fonts of your own, you must edit ``Fontmap`` to include at the end an entry for your new font; the format for entries is documented in ``Fontmap`` itself. Since later entries in ``Fontmap`` override earlier entries, a font you add at the end supersedes any corresponding fonts supplied with Ghostscript and defined earlier in the file. To ensure correct output, it is vital that entries for the "base 35" fonts remain intact in the ``Fontmap`` file.
+
+In the PC world, Type 1 fonts are customarily given names ending in ``.PFA`` or ``.PFB``. Ghostscript can use these directly: you just need to make the entry in ``Fontmap``. If you want to use with Ghostscript a commercial Type 1 font (such as fonts obtained in conjunction with Adobe Type Manager), please read carefully the license that accompanies the font to satisfy yourself that you may do so legally; we take no responsibility for any possible violations of such licenses. The same applies to TrueType fonts.
+
+Converting BDF fonts
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. note::
+
+ This is deprecated.
+
+Ghostscript provides a way to construct a (low-quality) Type 1 font from a bitmap font in the BDF format popular in the Unix world. The shell script bdftops (Unix) or the command file ``bdftops.bat`` (DOS) converts a BDF file to a scalable outline using ``bdftops.ps`` . Run the shell command:
+
+.. code-block:: bash
+
+ bdftops BDF_filename [AFM_file1_name ...] gsf_filename fontname
+ UniqueID [XUID] [encodingname]
+
+
+The arguments have these meanings:
+
+
+.. list-table::
+ :header-rows: 0
+
+ * - ``BDF_filename``
+ - Input bitmap file in BDF format
+ -
+ * - ``AFM_file1_name``
+ - AFM files giving metrics
+ - (Optional)
+ * - ``gsf_filename``
+ - Output file
+ -
+ * - ``fontname``
+ - Name of the font
+ -
+ * - ``UniqueID``
+ - UniqueID (:ref:`as described below<Fonts_UniqueIDs>`)
+ -
+ * - ``XUID``
+ - XUID, in the form n1.n2.n3... (:ref:`as described below<Fonts_UniqueIDs>`)
+ - (Optional)
+ * - ``encodingname``
+ - "StandardEncoding" (the default), "ISOLatin1Encoding", "SymbolEncoding", "DingbatsEncoding"
+ - (Optional)
+
+For instance:
+
+.. code-block:: postscript
+
+ bdftops pzdr.bdf ZapfDingbats.afm pzdr.gsf ZapfDingbats 4100000 1000000.1.41
+
+Then make an entry in ``Fontmap`` for the ``.gsf`` file (``pzdr.gsf`` in the example) as :ref:`described above<Fonts_Add>`.
+
+
+
+For developers only
+---------------------
+
+The rest of this document is very unlikely to be of value to ordinary users.
+
+Contents of fonts
+~~~~~~~~~~~~~~~~~~~~
+
+As noted above, Ghostscript accepts fonts in the same formats as PostScript interpreters. Type 0, 1, and 3 fonts are documented in the PostScript Language Reference Manual (Second Edition); detailed documentation for Type 1 fonts appears in a separate Adobe book. Type 2 (compressed format) fonts are documented in separate Adobe publications. Type 4 fonts are not documented anywhere; they are essentially Type 1 fonts with a BuildChar or BuildGlyph procedure. Types 9, 10, and 11 (CIDFontType 0, 1, and 2) and Type 32 (downloaded bitmap) fonts are documented in Adobe supplements. Type 42 (encapsulated TrueType) fonts are documented in an Adobe supplement; the TrueType format is documented in publications available from Apple and Microsoft. Ghostscript does not support Type 14 (Chameleon) fonts, which use a proprietary Adobe format.
+
+
+
+.. _Fonts_UniqueIDs:
+
+Font names and unique IDs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you create your own fonts and will use them only within your own organization, you should use ``UniqueID`` values between ``4000000`` and ``4999999``.
+
+If you plan to distribute fonts, ask Adobe to assign you some ``UniqueIDs`` and also an ``XUID`` for your organization. Contact:
+
+::
+
+ Unique ID Coordinator
+ Adobe Developers Association
+ Adobe Systems, Inc.
+ 345 Park Avenue
+ San Jose, CA 95110-2704
+ +1-408-536-9000 telephone (ADA)
+ +1-408-536-6883 fax
+ fontdev-person@adobe.com
+
+
+The XUID is a Level 2 PostScript feature that serves the same function as the ``UniqueID``, but is not limited to a single 24-bit integer. The ``bdftops`` program creates ``XUIDs`` of the form "``[-X- 0 -U-]``" where "``-X-``" is the organization ``XUID`` and "``-U-``" is the ``UniqueID``. (Aladdin Enterprises' organization XUID, which appears in a few places in various font-related files distributed with Ghostscript, is 107; do not use this for your own fonts that you distribute.)
+
+
+
+
+
+
+
+
+.. Note this was originally on the Use.htm page
+
+.. _Fonts FAPI:
+
+
+
+
+Running Ghostscript with third-party font renderers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Font API (FAPI) is a feature which allows to attach third-party font renderers to Ghostscript. This section explains how to run Ghostscript with third-party font renderers, such as UFST.
+
+
+.. note:: FreeType is now the default font renderer for Ghostscript.
+
+
+.. note::
+
+ To run Ghostscript with UFST you need a license from Monotype Imaging. Please ignore issues about UFST if you haven't got it.
+
+.. important::
+
+ Third-party font renderers may be incompatible with devices that can embed fonts in their output (such as pdfwrite), because such renderers may store fonts in a form from which Ghostscript cannot get the necessary information for embedding, for example, the Microtype fonts supplied with the UFST. Ghostscript can be configured to disable such renderers when such a device is being used.
+
+As of Ghostscript version 9.0, Ghostscript uses Freetype 2.4.x as the default font scaler/renderer.
+
+With this change, we added a new switch:``-dDisableFAPI=true`` to revert to the older behavior, just in case serious regression happens that cannot be resolved in a timely manner. It is intended that this switch will be removed once the FAPI/Freetype implementation has proven itself robust and reliable in the "real world".
+
+With version 9.18 released we have, for some time, regarded FAPI/Freetype as being the canonical glyph rendering solution for Ghostscript and associated products, and the non-FAPI rendering to be deprecated. As such, the ``-dDisableFAPI=true`` option is also considered deprecated, and should be expected to be removed shortly after the next release.
+
+To run Ghostscript with UFST, you first need to :ref:`build Ghostscript with the UFST bridge<Make_USFTBuild>`. Both bridges may run together.
+
+There are 2 ways to handle fonts with a third-party font renderer (FAPI). First, you can substitute any FAPI-handled font to a resident PostScript font, using special map files ``FAPIfontmap`` and ``FAPIcidfmap``. Second, you can redirect PostScript fonts to FAPI, setting entries in ``FAPIconfig`` file.
+
+Names ``FAPIfontmap``, ``FAPIcidfmap``, ``FAPIconfig`` in this text actually are placeholders, which may be substituted with command line arguments : ``-sFAPIfontmap=name1 -sFAPIcidfmap=name2 -sFAPIconfig=name3``. Ghostscript searches the specified file names as explained in How Ghostscript finds files. Default values for these arguments are equal to argument names. When building Ghostscript with ``COMPILE_INITS=1``, only default values are used.
+
+Font files, which are being handled with FAPI, may reside in any directory in your hard disk. Paths to them to be specified in ``FAPIfontmap`` and with special command line arguments, explained below. The path may be either absolute or relative. Relative ones are being resolved from the path, which is specified in ``FAPIconfig`` file.
+
+The file ``FAPIfontmap`` is actually special PostScript code. It may include records of 2 types : general records and FCO records (see below).
+
+A general record describes a font, which is being rendered with FAPI. They must end with semicolon. Each general record is a pair. The first element of the pair is the font name (the name that PostScript documents use to access the font, which may differ from real name of the font which the font file defines). The second element is a dictionary with entries:
+
+
+
+.. list-table::
+ :widths: 20 20 60
+ :header-rows: 1
+
+ * - Key
+ - Type
+ - Description
+ * - Path
+ - string
+ - Absolute path to font file, or relative path to font file from the FontPath value, being specified in FAPIconfig.
+ * - FontType
+ - integer
+ - PostScript type for this font. Only 1 and 42 are currently allowed.
+
+ Note that this is unrelated to the real type of the font file - the bridge will perform a format conversion.
+
+ * - FAPI
+ - name
+ - Name of the renderer to be used with the font. Only /UFST and /FreeType are now allowed.
+ * - SubfontId
+ - integer
+ - (optional) Index of the font in font collection, such as FCO or TTC.
+
+ It is being ignored if Path doesn't specify a collection.
+
+ Note that Free Type can't handle FCO. Default value is 0.
+
+ * - Decoding
+ - name
+ - (optional) The name of a Decoding resource to be used with the font.
+
+ If specified, lib/xlatmap (see below) doesn't work for this font.
+
+
+Example of a general FAPI font map record :
+
+.. code-block:: bash
+
+ /FCO1 << /Path (/AFPL/UFST/fontdata/MTFONTS/PCLPS3/MT1/PCLP3__F.fco) /FontType 1 /FAPI /UFST >> ;
+
+
+FCO records work for UFST only. A group of FCO records start with a line *name* ``ReadFCOfontmap:``, where *name* is a name of a command line argument, which specify a path to an FCO file. The group of FCO records must end with the line ``EndFCOfontmap``. Each record of a group occupy a single line, and contains a number and 1, 2 or 3 names. The number is the font index in the FCO file, the first name is the Postscript font name, the secong is an Encoding resource name, and the third is a decoding resource name.
+
+
+.. note::
+
+ ``FAPIfontmap`` specifies only instances of Font category. CID fonts to be listed in another map file.
+
+Ghostscript distribution includes sample map files ``gs/lib/FAPIfontmap, gs/lib/FCOfontmap-PCLPS2, gs/lib/FCOfontmap-PCLPS3, gs/lib/FCOfontmap-PS3``, which may be customized by the user. The last 3 ones include an information about UFST FCO files.
+
+The file ``FAPIcidfmap`` defines a mapping table for CIDFont resources. It contains records for each CID font being rendered with FAPI. The format is similar to ``FAPIfontmap``, but dictionaries must contain few different entries:
+
+
+
+.. list-table::
+ :widths: 20 20 60
+ :header-rows: 1
+
+ * - Key
+ - Type
+ - Description
+ * - Path
+ - string
+ - Absolute path to font file, or relative path to font file from the ``CIDFontPath`` value, being specified in FAPIconfig.
+ * - CIDFontType
+ - integer
+ - PostScript type for this CID font.
+
+ Only 0, 1 and 2 are currently allowed.
+
+ Note that this is unrelated to the real type of the font file - the bridge will perform format conversion.
+
+ * - FAPI
+ - name
+ - Name of the renderer to be used with the font.
+
+ Only /UFST and /FreeType are now allowed.
+
+ * - SubfontId
+ - integer
+ - (optional) Index of the font in font collection, such as FCO or TTC.
+
+ It is being ignored if Path doesn't specify a collection.
+
+ Default value is 0.
+
+ * - CSI
+ - array of 2 elements
+ - (required) Information for building CIDSystemInfo.
+
+ The first element is a string, which specifies ``Ordering``.
+
+ The second element is a number, which specifies ``Supplement``.
+
+
+
+Example of FAPI CID font map record:
+
+.. code-block:: bash
+
+ /HeiseiKakuGo-W5 << /Path (/WIN2000/Fonts/PMINGLIU.TTF) /CIDFontType 0 /FAPI /UFST /CSI [(Japan1) 2] >> ;
+
+The control file FAPIconfig defines 4 entries:
+
+
+
+.. list-table::
+ :widths: 20 20 60
+ :header-rows: 1
+
+ * - Key
+ - Type
+ - Description
+
+ * - FontPath
+ - string
+ - Absolute path to a directory, which contains fonts.
+
+ Used to resolve relative paths in ``FAPIfontmap``.
+
+ * - CIDFontPath
+ - string
+ - Absolute path to a directory, which contains fonts to substitute to CID fonts.
+
+ Used to resolve relative paths in ``FAPIcidfmap``.
+
+ It may be same or different than ``FontPath``.
+
+ * - HookDiskFonts
+ - array of integers
+ - List of PS font types to be handled with FAPI.
+
+ This controls other fonts that ones listed in ``FAPIfontmap`` and ``FAPIcidfmap`` -
+
+ such ones are PS fonts installed to Ghostscript with ``lib/fontmap`` or
+
+ with ``GS_FONTPATH``, or regular CID font resources.
+
+ Unlisted font types will be rendered with the native Ghostscript font renderer.
+
+ Only allowed values now are 1,9,11,42.
+
+ Note that 9 and 11 correspond to ``CIDFontType`` 0 and 2.
+
+ * - HookEmbeddedFonts
+ - array of integers
+ - List of PS font types to be handled with FAPI.
+
+ This controls fonts being embedded into a document - either fonts or CID font resources.
+
+ Unlisted font types will be rendered with the native Ghostscript font renderer.
+
+ Only allowed values now are 1,9,11,42.
+
+ Note that 9 and 11 correspond to ``CIDFontType`` 0 and 2.
+
+
+Ghostscript distribution includes sample config files ``gs/lib/FAPIconfig``, ``gs/lib/FAPIconfig-FCO``. which may be customized by the user. The last ones defines the configuration for handling resident UFST fonts only.
+
+In special cases you may need to customize the file ``lib/xlatmap``. Follow instructions in it.
+
+Some UFST font collections need a path for finding an UFST plugin. If you run UFST with such font collection, you should run Ghostscript with a special command line argument ``-sUFST_PlugIn=path``, where path specifies a disk path to the UFST plugin file, which Monotype Imaging distributes in ``ufst/fontdata/MTFONTS/PCL45/MT3/plug__xi.fco``. If UFST needs it and the command line argument is not specified, Ghostscript prints a warning and searches plugin file in the current directory.
+
+If you want to run UFST with resident UFST fonts only (and allow Ghostscript font renderer to handle fonts, which may be downloaded or embedded into documents), you should run Ghostscript with these command line arguments : ``-sFCOfontfile=path1 -sFCOfontfile2=path2 -sUFST_PlugIn=path3 -sFAPIfontmap=map-name -sFAPIconfig=FAPIconfig-FCO`` where ``path1`` specifies a disk path to the main FCO file, ``path2`` specifies a disk path to the Wingdings FCO file, ``path3`` a disk path the FCO plugin file, ``path1`` is either ``gs/lib/FCOfontmap-PCLPS2``, ``gs/lib/FCOfontmap-PCLPS3``, or ``gs/lib/FCOfontmap-PS3``. ``FAPIcidfmap`` works as usual, but probably you want to leave it empty because FCO doesn't emulate CID fonts.
+
+Some configurations of UFST need a path for finding symbol set files. If you compiled UFST with such configuration, you should run Ghostscript with a special command line argument ``-sUFST_SSdir=path``, where path specifies a disk path to the UFST support directory, which Monotype Imaging distributes in ``ufst/fontdata/SUPPORT``. If UFST needs it and the command line argument is not specified, Ghostscript prints a warning and searches symbol set files in the current directory.
+
+.. note::
+
+ UFST and Free Type cannot handle some Ghostscript fonts because they do not include a PostScript interpreter and therefore have stronger restrictions on font formats than Ghostscript itself does - in particular, Type 3 fonts. If their font types are listed in ``HookDiskFonts`` or in ``HookEmbeddedFonts``, Ghostscript interprets them as PS files, then serializes font data into a RAM buffer and passes it to FAPI as PCLEOs. (see the FAPI-related source code for details).
+
+
+
+
+.. external links
+
+.. _URW++ Design and Development Incorporated: http://www.urwpp.de/
+
+.. include:: footer.rst
+
+
diff --git a/doc/src/GPDL.rst b/doc/src/GPDL.rst
new file mode 100644
index 00000000..991660ca
--- /dev/null
+++ b/doc/src/GPDL.rst
@@ -0,0 +1,448 @@
+.. title:: The GhostPDL Interpreter Framework
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _GPDL.htm:
+
+
+The GhostPDL Interpreter Framework
+=====================================================================
+
+
+
+
+
+What is the GhostPDL Interpreter Framework?
+---------------------------------------------
+
+The GhostPDL interpreter framework (henceforth, just GhostPDL) is a framework into which multiple interpreters can be fitted, together with a set of interpreters for different input "languages".
+
+The intent is that a build of GPDL will behave as much as possible like a build of Ghostscript, but should be able to transparently cope with as many different input formats as it has interpreters built into it.
+
+It can be built as a dynamic link library (DLL) on Microsoft Windows, as a shared object on the Linux, Unix and MacOS X platforms. With some changes, it could be built as a static library.
+
+The reason we dub it a "Framework" is that it is designed to be modular, and to readily allow new interpreters to be swapped in and out to extend and customise its capabilities.
+
+Jobs must be separated by UEL (Universal End of Language) code sequences (or PJL fragments, which implicitly start with a ``UEL`` marker).
+
+
+
+The API
+---------------------------------------------
+
+The API for GPDL (found in ``plapi.h``) is deliberately designed to be nearly identical to that for Ghostscript itself (found in ``iapi.h``). Details of Ghostscript's API can be found :ref:`here<API.htm>`, and we refer you to that. Only differences from that API will be documented here. In particular the differences in the handling of switches within the ``gsapi_init_with_args`` are documented here.
+
+Our intent is that existing users of the Ghostscript API should be able to drop a GPDL DLL in as a replacement with little to no code changes.
+
+
+
+The run_string APIs
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``run_string`` APIs have parameters for int ``user_errors`` and int ``*error_code``. Within Ghostscript, these allow a caller to bypass the language's standard error handling, and to trap errors externally. This makes no sense within a printer implementation (and, in particular, no sense for a postscript interpreter running jobs within a JobServer loop as GPDL does). Thus these parameters are kept for ABI compatibility, but are largely ignored within the GPDL implementation of gsapi. For sanity, pass 0 for ``user_errors``, and expect ``*error_code`` to be set to 0 on exit.
+
+String vs File functions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Some file types, such as Postscript and PCL, are designed to be 'streamable'; that is to say that the files can be fed in and consumed as they are interpreted. Other file types, such as PDF or XPS require the whole file to be available so that the interpreters can seek back and forth within it to extract the data they require.
+
+Traditionally, Ghostscript has relied upon the caller knowing which type of data is which; streamable data can be fed in to the system using the ``gsapi_run_string`` APIs, and complete files of data can be fed in using ``gsapi_run_file`` or ``gsapi_init_with_args`` APIs. Streamable data contained with a file is simple to deal with, as it's trivial for an interpreter to read bytes from a file, but doing random access on a stream is much harder.
+
+In systems where data is being streamed in, but it is required to be available for random access, the entire stream must be buffered for presentation to the language interpreters. With Ghostscript, the responsibility for doing this fell to the caller. Unfortunately, this means that the caller also has to be responsible for scanning the incoming data to spot when it is in a format that requires buffering. With the explosion of formats that GPDL supports this quickly becomes unpalatable.
+
+While the caller is still free to do such buffering of data itself, GPDL will do it automatically if required. If a language spots that data being fed to it via the ``gsapi_run_string`` APIs is in a format that requires buffering, the entire string of data will be automatically collected together, and then be represented internally to the ``gsapi_run_file`` API.
+
+The current implementation buffers the data in memory. Alternative implementations could use a backing store if such a thing were available. For server based applications the use of memory is not likely to be a problem (assuming reasonably sized input files at least). For printer integrations, it's entirely possible that no backing store will be available, so RAM may be the only option. Integrators may wish to place a limit on the size of files that can be buffered in this way.
+
+
+
+The GPDL executable
+------------------------------------
+
+The GPDL executable is a small executable that loads the DLL/shared object, and implements, pretty much, the interface described in the :ref:`usage documentation<Use.htm>` for Ghostscript, but capable of reading any of the configured languages. This executable provides all the interaction with the windowing system, including image windows.
+
+Areas where the GPDL executable differs from the Ghostscript executable are described :ref:`below<Differences in switches from Ghostscript>`. These are primarily to do with (slightly) esoteric requirements when running Postscript in an interactive environment. Whereas Ghostscript is a generic Postscript interpreter, GPDL is unashamedly targeted as a print processor.
+
+The GPDL framework's library name and characteristics differ for each platform:
+
+- The Win32 DLL ``gpdldll32.dll`` can be used by multiple programs simultaneously, but only once within each process.
+- The Linux shared object ``libgs.so`` can be used by multiple programs simultaneously.
+
+The source for the executable is in ``plw*.*`` (Windows) and ``plx*.*`` (Linux/Unix). See these source files for examples of how to use the DLL.
+
+At this stage, GhostPDL does not support multiple instances of the interpreter within a single process.
+
+
+
+Differences in switches from Ghostscript
+------------------------------------------------------------------------
+
+The ``gsapi_init_with_args`` API entrypoint takes a set of arguments, which can include various switches. We document the differences between Ghostscript's handling of switches and GhostPDL's here. The GhostPDL executable directly maps parameters given on the command-line into this list, so this list of differences applies both to API calls and uses of the executable.
+
+GhostPDL does not support the ``-_``, ``-+``, ``-@``, ``-B``, ``-F``, ``-M``, ``-N``, ``-P``, ``-u``, and ``-X`` switches that Ghostscript does.
+
+GhostPDL supports a few switches that the Ghostscript executable does not.
+
+- ``-E #``: Sets the "error reporting mode" for PCL/PXL.
+- ``-H #x#x#x#``: Sets the hardware margins to the given left/bottom/right/top values (in points).
+- ``-j <string>``: Passes the string to the PJL level. The string is split on '``;``'.
+- ``-J``: Same as ``-j``.
+- ``-l {RTL,PCL5E,PCL5C}``: Sets the "personality" of the PCL/PXL interpreter.
+- ``-L <language>``: Sets the language to be used. Run with -L and no string to see a list of languages supported in your build.
+- ``-m #x#``: Sets the margin values to the left/bottom values (in points).
+
+
+Supported languages
+------------------------------------------------------------------------
+
+The following is a (possibly non-exhaustive) list of languages for which implementations exist for GhostPDL. We use the term "language" to include both full page description languages (such as PCL, Postscript and XPS), and handlers for simpler formats (such as JPEG, PNG and TIFF).
+
+It is inherent in the design that new handlers can be included, and unwanted formats can be dropped from any given build/integration.
+
+PJL
+~~~~~~~~~~~~~~
+
+PJL is special, in that it is the central language implementation to which we return between all jobs. As such it always appears first in the list, and must be present in all builds.
+
+PCL
+~~~~~~~~~~~~~~
+
+The PCL language implementation supports PCL5C/PXL5E and HPGL/2 with RTL.
+
+PCLXL
+~~~~~~~~~~~~~~
+
+The PCLXL language implementation supports PCLXL.
+
+XPS
+~~~~~~~~~~~~~~
+
+The XPS language implementation supports the XML Paper Specification format, as used in modern Windows systems printing pipelines.
+
+POSTSCRIPT
+~~~~~~~~~~~~~~
+
+The POSTSCRIPT language implementation is the Ghostscript Postscript interpreter, as described in the accompanying documentation.
+
+URF
+~~~~~~~~~~~~~~
+
+Currently available to commercial customers only, the URF language implementation implements support for the URF file format, as used by Apple Airprint.
+
+JPG
+~~~~~~~~~~~~~~
+
+The JPG language implementation supports JPEG files (in both JFIF and EXIF formats).
+
+PWG
+~~~~~~~~~~~~~~
+
+The PWG language implementation supports PWG (Printer Working Group) format files.
+
+TIFF
+~~~~~~~~~~~~~~
+
+The TIFF language implementation supports TIFF format files in a variety of compression formats, depending on the exact configuration of libtiff used in the build.
+
+JBIG2
+~~~~~~~~~~~~~~
+
+The JBIG2 language implementation supports JBIG2 format images.
+
+JP2K
+~~~~~~~~~~~~~~
+
+The JP2K language implementation supports JPEG2000 and JPX format images.
+
+PNG
+~~~~~~~~~~~~~~
+
+The PNG language implementation supports PNG format images.
+
+
+
+Adding a new language
+--------------------------------
+
+Each language implementation in the system appears as an instance of a ``pl_interp_implementation_t`` structure.
+
+
+.. code-block:: c
+
+ typedef struct pl_interp_implementation_s
+ {
+ /* Procedure vector */
+ pl_interp_proc_characteristics_t proc_characteristics;
+ pl_interp_proc_allocate_interp_instance_t proc_allocate_interp_instance;
+ pl_interp_proc_get_device_memory_t proc_get_device_memory;
+ pl_interp_proc_set_param_t proc_set_param;
+ pl_interp_proc_add_path_t proc_add_path;
+ pl_interp_proc_post_args_init_t proc_post_args_init;
+ pl_interp_proc_init_job_t proc_init_job;
+ pl_interp_proc_run_prefix_commands_t proc_run_prefix_commands;
+ pl_interp_proc_process_file_t proc_process_file;
+ pl_interp_proc_process_begin_t proc_process_begin;
+ pl_interp_proc_process_t proc_process;
+ pl_interp_proc_process_end_t proc_process_end;
+ pl_interp_proc_flush_to_eoj_t proc_flush_to_eoj;
+ pl_interp_proc_process_eof_t proc_process_eof;
+ pl_interp_proc_report_errors_t proc_report_errors;
+ pl_interp_proc_dnit_job_t proc_dnit_job;
+ pl_interp_proc_deallocate_interp_instance_t
+ proc_deallocate_interp_instance;
+ void *interp_client_data;
+ } pl_interp_implementation_t;
+
+This structure consists of series of function pointers, each of which performs some portion of the processing required to handle detection of language type and processing of data. These function pointers are described in detail below.
+
+In addition, the ``interp_client_data`` field is used to hold the running state of a given interpreter.
+
+All the languages to be supported in the build are listed in the ``pdl_implementations`` array in ``plimpl.c``. To add a new implementation the name of the appropriate ``pl_interp_implementation_t`` should be added here.
+
+The existing range of language implementations may prove useful as references when implementing new ones. They can be found as ``gpdl/*top.c``. In particular, ``pngtop.c`` is a simple implementation of a well-defined, relatively simple file format (PNG), based upon a well-known and well-documented library (``libpng``), so is probably a good place to start.
+
+
+proc_characteristics
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef const pl_interp_characteristics_t
+ *(*pl_interp_proc_characteristics_t) (const pl_interp_implementation_t *);
+
+
+This entrypoint is called to request details of the characteristics of the language. This must be implemented in all instances.
+
+This returns a pointer to a ``pl_interp_characteristics_t`` structure:
+
+
+.. code-block:: c
+
+ typedef struct pl_interp_characteristics_s
+ {
+ const char *language; /* generic language should correspond with
+ HP documented PJL name */
+ int (*auto_sense)(const char *string, int length); /* routine used to detect language - returns a score: 0 is definitely not, 100 is definitely yes. */
+ const char *manufacturer; /* manuf str */
+ const char *version; /* version str */
+ const char *build_date; /* build date str */
+ } pl_interp_characteristics_t;
+
+
+The language entry contains a simple NULL terminated string that names the interpreter. Similarly, the manufacturer, version, and ``build_date`` fields are for informational purposes only.
+
+The ``auto_sense`` function is called with a prefix of data from each new source. Each language is passed the data in turn, and "scores;" according to how sure it is the file is that format.
+
+For many file formats this means looking for known in the first few bytes (such as PNG or TIFF looking for their signature bytes). For others, such as XPS, the best that can be done is to spot that it's a zip file. For still others, such as PCL, heuristics have to be used.
+
+A 'definite' match is returned as 100, a definite rejection as 0, with intermediate values used appropriately.
+
+
+proc_allocate_interp_instance
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_allocate_interp_instance_t)
+ (pl_interp_implementation_t *,
+ gs_memory_t *);
+
+On startup, the GPDL library calls around all the languages via this function, getting them to allocate themselves an instance. What this means will vary between languages, but typically it involves allocating a state structure, and storing the pointer to that in the ``interp_client_data`` pointer of the ``pl_interp_implementation_t *``. Part of this state structure will typically be a ``gstate`` to use to drive the graphics library.
+
+proc_get_device_memory
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef gs_memory_t *(*pl_interp_proc_get_device_memory_t)
+ (pl_interp_implementation_t *);
+
+
+On shutdown, the GPDL library calls around all the languages via this function, getting them to release their resources and deallocate any memory.
+
+
+proc_set_param
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_set_param_t) (pl_interp_implementation_t *,
+ pl_set_param_type,
+ const char *,
+ const void *);
+
+Some languages (particularly Postscript) can have their behaviour changed by the use of parameters. This function provides a generic method for the GPDL library to pass parameters into a language. Each language is free to ignore the parameters that do not apply to it. For most languages, this can safely be passed as NULL.
+
+proc_add_path
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_add_path_t) (pl_interp_implementation_t *,
+ const char *);
+
+Some languages (particularly Postscript) have the ability to open files from the local storage. These files can be found in a variety of different locations within the local storage. As such this call allows the GPDL library to add paths to the current list of locations that will be searched. For most languages, this can safely be passed as NULL.
+
+
+proc_post_args_init
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_post_args_init_t) (pl_interp_implementation_t *);
+
+
+
+proc_init_job
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_init_job_t) (pl_interp_implementation_t *,
+ gx_device *);
+
+Once the GPDL library has identified which language should be used for an incoming job, it will call this entrypoint to initialise the language for the job. What this means will vary between languages, but at the very minimum the job will need to take note of the device to be used.
+
+proc_run_prefix_commands
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_run_prefix_commands_t)
+ (pl_interp_implementation_t *,
+ const char *prefix);
+
+The GPDL library (and executable) allow language commands to be sent in the argument parameters using the ``-c`` switch. These are collected into a buffer, and forwarded to a language to be run as part of the same job as any following file.
+
+Currently, only the Postscript language handler implements this function, all others should pass NULL.
+
+
+proc_process_file
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_process_file_t) (pl_interp_implementation_t *,
+ const char *);
+
+If the GPDL library is given a filename to process, and this function is non-NULL, it will call this to run the file. For file formats such as PDF (which need to be buffered so they can be read out of order), this can avoid the need to feed in all the data via ``proc_process``, buffer it somewhere, and then process it at the end.
+
+For many languages this can be NULL.
+
+proc_process_begin
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_process_begin_t) (pl_interp_implementation_t *);
+
+Once the GPDL library has data to process (that it cannot process with ``proc_process_file``, it will call this function to setup the transfer of data.
+
+
+proc_process
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_process_t) (pl_interp_implementation_t *,
+ stream_cursor_read *);
+
+After the GPDL library has called ``proc_process_begin`` this function may be called multiple times to actually transfer the data in. The implementation is expected to consume as many bytes as it can (but not necessarily all of them) before returning with an updated read pointer. If this function cannot advance without more data, it should return with ``gs_error_NeedInput``.
+
+proc_process_end
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_process_end_t) (pl_interp_implementation_t *);
+
+After the GPDL library has called ``proc_process_begin`` (and possibly made a number of calls to ``proc_process``) it will call ``proc_process_end`` to signify the end of the data. This does not necessarily signal the end of the job.
+
+proc_flush_to_eoj
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_flush_to_eoj_t) (pl_interp_implementation_t *,
+ stream_cursor_read *);
+
+In the event of a problem while processing data, GPDL may seek to abandon processing of a transfer in progress by calling ``proc_flush_to_eoj``. If possible, the language should continue to process data until a reasonable stopping point, or until UEL is reached.
+
+
+proc_process_eof
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_process_eof_t) (pl_interp_implementation_t *);
+
+
+Called when GPDL reaches EOF in processing a job. A language implementation should assume no more data is forthcoming.
+
+proc_report_errors
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_report_errors_t) (pl_interp_implementation_t *,
+ int,
+ long,
+ bool);
+
+Called after running a job to give the language implementation the chance to report any errors it may have detected as it ran.
+
+proc_dnit_job
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_dnit_job_t) (pl_interp_implementation_t *);
+
+Called after a job is complete so that the language implementation may clean up. The interpreter is kept open so that more jobs can be fed to it, but no state should be kept from this job to the next.
+
+
+proc_deallocate_interp_instance
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: c
+
+ typedef int (*pl_interp_proc_deallocate_interp_instance_t)
+ (pl_interp_implementation_t *);
+
+Called on shutdown of the GPDL library to close down the language instance and free all the resources.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.. include:: footer.rst
diff --git a/doc/src/Install.rst b/doc/src/Install.rst
new file mode 100644
index 00000000..2141d703
--- /dev/null
+++ b/doc/src/Install.rst
@@ -0,0 +1,274 @@
+.. title:: How to Install Ghostscript
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Install.htm:
+.. _HowToInstallGhostscript:
+
+
+How to Install Ghostscript
+===================================
+
+
+
+
+Overview of how to install Ghostscript
+----------------------------------------
+
+You must have four things to run Ghostscript:
+
+#. The Ghostscript executable file; on some operating systems, more than one file is required. These are entirely platform-specific. See below for details.
+
+#. Initialization files that Ghostscript reads in when it starts up; these are the same on all platforms.
+
+#.
+
+ - ``gs_*.ps`` unless Ghostscript was compiled using the "compiled initialization files" option. See the documentation of :ref:`PostScript files distributed with Ghostscript<PsFiles.htm>`.
+
+ - ``pdf_*.ps`` if Ghostscript was compiled with the ability to interpret Adobe Portable Document Format (PDF) files, that is, ``pdf.dev`` was included in ``FEATURE_DEVS`` when Ghostscript was built.
+
+ - ``Fontmap`` and ``Fontmap.GS`` (or the appropriate ``Fontmap.xxx`` for your platform), unless you plan always to invoke Ghostscript with the :ref:`-dNOFONTMAP switch<UseDNoFontMap>`.
+
+#. Fonts, for rendering text. These are platform-independent, but if you already have fonts of the right kind on your platform, you may be able to use those. See below for details. Also see the :ref:`documentation on fonts<Fonts.htm>`.
+
+
+The :ref:`usage documentation<Use.htm>` describes the search algorithms used to find initialization files and font files. The per-platform descriptions that follow tell you where to install these files.
+
+
+
+Installing Ghostscript on Unix
+----------------------------------------
+
+Ghostscript uses the common ``configure``, ``build`` and ``install`` method common to many modern software packages. In general the following with suffice to build Ghostscript:
+
+
+.. code-block:: bash
+
+ ./configure
+ make
+
+
+and then it may be installed in the default location with:
+
+.. code-block:: bash
+
+ make install
+
+
+This last command may need to be performed with super user privileges.
+
+You can set the installation directory by adding ``--prefix=path`` to the configure invocation in the first step. The default prefix is ``/usr/local``, which is to say the ``gs`` executable is installed as ``/usr/local/bin/gs``.
+
+A list of similar configuration options is available via ``./configure --help``.
+
+For more detailed information on building Ghostscript see :ref:`how to build Ghostscript on Unix<MakeHowToBuildForUnix>` in the documentation on building Ghostscript, especially regarding information on using the older hand edited ``makefile`` approach. Whatever configuration method you use, execute ``make install`` to install the executable and all the required and ancillary files after the build is complete.
+
+
+
+Fonts
+~~~~~~~~~~~~~~~~~~~
+
+The ``makefile`` installs all the files except fonts under the directory defined in the ``makefile`` as prefix. Fonts need to be installed separately. The fonts should be installed in ``{prefix}/share/ghostscript/fonts``. (That is, ``/usr/local/share/ghostscript/fonts/`` if you used the default configuration above.)
+
+If you have Adobe Acrobat installed, you can use the Acrobat fonts in place of the ones distributed with with Ghostscript by adding the Acrobat fonts directory to ``GS_FONTPATH`` and removing these fonts from ``Fontmap.GS``:
+ ``Courier``, ``Courier-Bold``, ``Courier-BoldOblique``, ``Courier-Oblique``, ``Helvetica``, ``Helvetica-Bold``, ``Helvetica-BoldOblique``, ``Helvetica-Oblique``, ``Symbol``, ``Times-Bold``, ``Times-BoldItalic``, ``Times-Italic``, ``Times-Roman``, ``ZapfDingbats``
+
+
+
+Similarly, you can have Ghostscript use other fonts on your system by adding entries to the ``fontmap`` or adding the directories to the ``GS_FONTMAP`` environment variable. See the :ref:`usage documentation<Use.htm>` for more information.
+
+For example, many linux distributions place fonts under ``/usr/share/fonts``.
+
+
+Ghostscript as a shared object
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you've built Ghostscript as a shared object, instead of ``make install``, you must use ``make soinstall``. See :ref:`how to build Ghostscript as a shared object<Make_SharedObject>` for more details.
+
+
+Additional notes on Linux
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+For Linux, you may be able to install or upgrade Ghostscript from precompiled RPM_ files using:
+
+
+.. code-block:: bash
+
+ rpm -U ghostscript-N.NN-1.i386.rpm
+ rpm -U ghostscript-fonts-N.NN-1.noarch.rpm
+
+
+However, please note that we do not create RPMs for Ghostscript, and we take no responsibility for RPMs created by others.
+
+
+
+Installing Ghostscript on MS Windows
+----------------------------------------
+
+
+We usually distribute Ghostscript releases for Windows as a binary installer, for the convenience of most users.
+
+Windows 3.1 (16-bit)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The last version to run on 16-bit Windows 3.1 was Ghostscript 4.03.
+
+Windows 95, 98, Me
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The last version to be available as a binary for Windows 95/98/Me was 8.60. Although building from source with Visual Studio 2003 should produce a working binary for those versions.
+
+Windows NT4, 2000, XP, 2003 or Vista (32-bit)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The installer is normally named ``gs###w32.exe``, where ``###`` is the release number (e.g., 871 for Ghostscript 8.71, 910 for Ghostscript 9.10).
+
+Windows XP x64 edition, 2003 or Vista (64-bit)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The x64 installer is normally named ``gs###w64.exe`` This is for 64-bit Windows operating systems based on the x64 instruction set. Do not use this on 64-bit processors running 32-bit Windows.
+
+Installing
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To install Ghostscript on Windows, you should run the installer executable.
+
+The installer is NSIS-based and supports a few standard NSIS options: ``/NCRC`` disables the ``CRC`` check, ``/S`` runs the installer or uninstaller silently, ``/D`` sets the default installation directory (It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. Only absolute paths are supported).
+
+
+General Windows configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The installer includes files in these subdirectories:
+
+- ``gs#.##\bin``
+- ``gs#.##\examples``
+- ``gs#.##\lib``
+- ``gs#.##\doc``
+- ``gs#.##\Resource``
+- ``fonts``
+
+
+The actual executable files for the 32-bit Windows install, in the ``gs#.##\bin`` subdirectory, are:
+
+
+.. list-table::
+ :widths: 20 80
+ :header-rows: 0
+
+ * - GSWIN32C.EXE
+ - Ghostscript as a 32-bit Windows command line program. This is usually the preferred executable.
+ * - GSWIN32.EXE
+ - 32-bit Ghostscript using its own window for commands.
+ * - GSDLL32.DLL
+ - 32-bit dynamic link library containing most of Ghostscript's functionality.
+
+
+For the 64-bit Windows install, also in the ``gs#.##\bin`` subdirectory, they are:
+
+
+.. list-table::
+ :widths: 20 80
+ :header-rows: 0
+
+ * - GSWIN64C.EXE
+ - Ghostscript as a 64-bit Windows command line program. This is usually the preferred executable.
+ * - GSWIN64.EXE
+ - 64-bit Ghostscript using its own window for commands.
+ * - GSDLL64.DLL
+ - 64-bit dynamic link library containing most of Ghostscript's functionality.
+
+
+For printer devices, the default output is the default printer. This can be modified as follows:
+
+.. code-block:: bash
+
+ -sOutputFile="%printer%printer name"
+
+If your printer is named "HP DeskJet 500" then you would use ``-sOutputFile="%printer%HP DeskJet 500"``.
+
+
+
+If Ghostscript fails to find an environment variable, it looks for a registry value of the same name under the key
+
+.. code-block:: bash
+
+ HKEY_CURRENT_USER\Software\GPL Ghostscript\#.##
+
+or if that fails, under the key:
+
+.. code-block:: bash
+
+ HKEY_LOCAL_MACHINE\SOFTWARE\GPL Ghostscript\#.##
+
+where ``#.##`` is the Ghostscript version number.
+
+Ghostscript will attempt to load the Ghostscript dynamic link library ``GSDLL32.DLL`` in the following order:
+
+
+- In the same directory as the Ghostscript executable.
+
+- If the environment variable ``GS_DLL`` is defined, Ghostscript tries to load the Ghostscript dynamic link library (``DLL``) with the name given.
+
+- Using the standard Windows library search method: the directory from which the application loaded, the current directory, the Windows system directory, the Windows directory and the directories listed in the ``PATH`` environment variable.
+
+
+The Ghostscript installer will create registry values for the environment variables ``GS_LIB`` and ``GS_DLL``.
+
+
+Uninstalling Ghostscript on Windows
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To uninstall Ghostscript, use the Control Panel, Add/Remove Programs and remove "Ghostscript #.##" and "Ghostscript Fonts". (The entries may be called "GPL Ghostscript" or "AFPL Ghostscript", rather than just "Ghostscript", depending on what version of Ghostscript was installed).
+
+Alternatively, an uninstall shortcut is also available in the Start Menu group.
+
+
+
+
+Installing Ghostscript on OpenVMS
+-------------------------------------------
+
+Support for OpenVMS has stagnated (and almost certainly bit-rotted), and as the core development team has no access to an OpenVMS environment, we are unable to bring it up to date. We will consider patches from contributors if any wish to take on the task of getting it working again. Given the very limited appeal of OpenVMS these days, however, we are unlikely to consider patches with invasive code changes.
+
+You need the file ``GS.EXE`` to run Ghostscript on OpenVMS, and installing Ghostscript on an OpenVMS system requires building it first.
+
+The following installation steps assume that the Ghostscript directory is ``DISK1:[DIR.GHOSTSCRIPT]``. Yours will almost certainly be in a different location so adjust the following commands accordingly.
+
+- Download the fonts and unpack them into ``DISK1:[DIR.GHOSTSCRIPT.LIB]``.
+
+- Enable access to the program and support files for all users with:
+
+ .. code-block:: bash
+
+ $ set file/prot=w:re DISK1:[DIR]GHOSTSCRIPT.dir
+ $ set file/prot=w:re DISK1:[DIR.GHOSTSCRIPT...]*.*
+
+- Optionally, add the Ghostscript help instructions to your system wide help file:
+
+ .. code-block:: bash
+
+ $ lib/help sys$help:HELPLIB.HLB DISK1:[DIR.GHOSTSCRIPT.DOC]GS-VMS.HLP
+
+- Lastly, add the following lines to the appropriate system wide or user specific login script.
+
+ .. code-block:: bash
+
+ $ define gs_exe DISK1:[DIR.GHOSTSCRIPT.BIN]
+ $ define gs_lib DISK1:[DIR.GHOSTSCRIPT.EXE]
+ $ gs :== $gs_exe:gs.exe
+
+If you have ``DECWindows/Motif`` installed, you may wish to replace the ``FONTMAP.GS`` file with ``FONTMAP.VMS``. Read the comment at the beginning of the latter file for more information.
+
+
+
+.. External links
+
+.. _RPM: http://www.rpm.org/
+
+
+.. include:: footer.rst
+
diff --git a/doc/src/Language.rst b/doc/src/Language.rst
new file mode 100644
index 00000000..5a777849
--- /dev/null
+++ b/doc/src/Language.rst
@@ -0,0 +1,1284 @@
+.. title:: Ghostscript and the PostScript Language
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Language.htm:
+.. _Language:
+
+
+Ghostscript and the PostScript Language
+===========================================
+
+
+
+Ghostscript's capabilities in relation to PostScript
+---------------------------------------------------------
+
+The Ghostscript interpreter, except as noted below, is intended to execute properly any source program written in the (LanguageLevel 3) PostScript language as defined in the PostScript Language Reference, Third Edition (ISBN 0-201-37922-8) published by Addison-Wesley in mid-1999. However, the interpreter is configurable in ways that can restrict it to various subsets of this language. Specifically, the base interpreter accepts the Level 1 subset of the PostScript language, as defined in the first edition of the PostScript Language Reference Manual (ISBN 0-201-10174-2) Addison-Wesley 1985, plus the file system, version 25.0 language, and miscellaneous additions listed in sections A.1.6, A.1.7, and A.1.8 of the Second Edition respectively, including allowing a string operand for the "``status``" operator. The base interpreter may be configured (see the documentation on :ref:`building Ghostscript<Make.htm>` for how to configure it) by adding any combination of the following:
+
+- The ability to process PostScript Type 1 fonts. This facility is normally included in the interpreter.
+
+- The CMYK color extensions listed in section A.1.4 of the Second Edition (including ``colorimage``). These facilities are available only if the ``color``, ``dps``, or ``level2`` feature was selected when Ghostscript was built.
+
+- The Display PostScript extensions listed in section A.1.3 of the Second Edition, but excluding the operators listed in section A.1.2. These facilities are available only if the dps feature or the ``level2`` feature was selected when Ghostscript was built.
+
+- The composite font extensions listed in section A.1.5 of the Second Edition, and the ability to handle Type 0 fonts. These facilities are available only if the compfont feature or the ``level2`` feature was selected when Ghostscript was built.
+
+- The ability to load TrueType fonts and to handle PostScript Type 42 (encapsulated TrueType) fonts. These facilities are available only if the ``ttfont`` feature was selected when Ghostscript was built.
+
+- The PostScript Level 2 "filter" facilities except the ``DCTEncode`` and ``DCTDecode`` filters. These facilities are available only if the ``filter``, ``dps``, or ``level2`` feature was selected when Ghostscript was built.
+
+- The PostScript Level 2 ``DCTEncode`` and ``DCTDecode`` filters. These facilities are available only if the ``dct`` or ``level2`` feature was selected when Ghostscript was built.
+
+- All the other PostScript Level 2 operators and facilities listed in section A.1.1 of the Second Edition and not listed in any of the other A.1.n sections. These facilities are available only if the ``level2`` feature was selected when Ghostscript was built.
+
+- All PostScript LanguageLevel 3 operators and facilities listed in the Third Edition, except as noted below. These facilities are available only if the ``psl3`` feature was selected when Ghostscript was built.
+
+- The ability to recognize DOS EPSF files and process only the PostScript part, ignoring bitmap previews or other information. This facility is available only if the ``epsf`` feature was selected when Ghostscript was built.
+
+
+Ghostscript currently does not implement the following PostScript LanguageLevel 3 facilities:
+
+- Settable ``ProcessColorModel`` for page devices, except for a very few special devices.
+
+- ``IODevices`` other than ``%stdin``, ``%stdout``, ``%stderr``, ``%lineedit``, ``%statementedit``, ``%os%``, and (if configured) ``%pipe%`` and ``%disk0%`` through ``%disk0%``.
+
+
+Ghostscript can also interpret files in the Portable Document Format (PDF) 1.7 format defined in the PDF Reference Version 1.7, distributed by Adobe Systems Incorporated, except as noted below. This facility can be disabled by deselecting the pdf feature when Ghostscript is built.
+
+Ghostscript currently implements the majority of non-interactive features defined in the PDF reference.
+
+Ghostscript also includes a number of :ref:`additional operators<Additional Operators>` defined below that are not in the PostScript language defined by Adobe.
+
+
+Implementation limits
+---------------------------
+
+The implementation limits show here correspond to those in Tables B.1 and B.2 of the Second and Third Editions, which describe the quantities fully. Where Ghostscript's limits are different from those of Adobe's implementations (as shown in the Third Edition), Adobe's limits are also shown.
+
+
+Architectural limits
+~~~~~~~~~~~~~~~~~~~~
+
+*Architectural limits (corresponds to Adobe table B.1)*
+
+
+
+.. list-table::
+ :widths: 25 25 25 25
+ :header-rows: 1
+
+ * - Quantity
+ - Limit
+ - Type
+ - Adobe
+ * - integer
+ - 32-bit
+ - twos complement integer
+ -
+ * - real
+ - single-precision
+ - IEEE float
+ -
+ * - array
+ - 16777216
+ - elements
+ - 65535
+ * - dictionary
+ - 16777215
+ - elements
+ - 65535
+ * - string
+ - 16777216
+ - characters
+ - 65535
+ * - name
+ - 16383
+ - characters
+ - 127
+ * - filename
+ - 128 :ref:`*<AdobeTableNote1>`
+ - characters
+ -
+ * - ``save`` level
+ - none
+ - (capacity of memory)
+ - 15
+ * - ``gsave`` level
+ - none
+ - (capacity of memory)
+ - 13
+
+.. _AdobeTableNote1:
+
+\* The limit on the length of a file name is 128 characters if the name starts with a ``%...% IODevice`` designation, or 124 characters if it does not.
+
+
+Typical memory limits in LanguageLevel 1
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+*Memory limits (corresponds to Adobe table B.2)*
+
+
+.. list-table::
+ :widths: 25 25 25 25
+ :header-rows: 1
+
+ * - Quantity
+ - Limit
+ - Type
+ - Adobe
+ * - ``userdict``
+ - 200
+ -
+ -
+ * - ``FontDirectory``
+ - 100
+ -
+ -
+ * - operand stack
+ - 800
+ -
+ - 500
+ * - dictionary stack
+ - 20
+ -
+ -
+ * - execution stack
+ - 250
+ -
+ -
+ * - interpreter level
+ - none
+ - (capacity of memory)
+ - 10
+ * - path
+ - none
+ - (capacity of memory)
+ - 1500
+ * - dash
+ - 11
+ -
+ -
+ * - VM
+ - none
+ - (capacity of memory)
+ - 240000
+ * - file
+ - none
+ - (determined by operating system)
+ - 6
+ * - image
+ - 65535
+ - values (samples × components)
+
+ for 1-, 2-, 4-, or 8-bit samples
+ - 3300
+ * -
+ - 32767
+ - values for 12-bit samples
+ - 3300
+
+
+Other differences in VM consumption
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In 32-bit builds packed array elements occupy either 2 bytes or 12 bytes. The average element size is probably about 7 bytes. Names occupy 16 bytes plus the space for the string.
+
+In 64-bit builds packed array elements occupy either 2 bytes or 16 bytes. The average element size is probably about 9 bytes. Names occupy 24 bytes plus the space for the string.
+
+The garbage collector doesn't reclaim portions of arrays obtained with getinterval, rather it collects entire arrays.
+
+
+
+.. _Additional Operators:
+
+
+Additional operators in Ghostscript
+-------------------------------------
+
+Graphics and text operators
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. _Language_Transparency:
+
+Transparency
+"""""""""""""""
+
+.. note::
+
+ The following paragraphs describe non-standard operators for accessing the PDF 1.4 and later transparent imaging model through Postscript. If used incorrectly, they can have unexpected side effects and result in undefined behavior. As a result, these operators are disabled when :ref:`SAFER<dSAFER>` is in force (as it is by default from version 9.50 onwards). To utilise these operators you will either have to disable ``SAFER`` (``-dNOSAFER``) or use the command line parameter ``-dALLOWPSTRANSPARENCY``. The latter will make the custom operators available, but leave the file access controls active.
+
+Ghostscript provides a set of operators for implementing the transparency and compositing facilities of PDF 1.4. These are defined only if the ``transpar`` option was selected when Ghostscript was built. We do not attempt to explain the underlying graphics model here: for details, see Adobe Technical Note #5407, "Transparency in PDF". Previously (in 9.52 and earlier), Ghostscript's model maintained separate alpha and mask values for opacity and shape. This model has been changed (as of 9.53) and instead Ghostscript maintains separate float values for stroke and fill alpha values with a boolean that indicates if these should be interpreted as shape or alpha values to be more in line with the PDF specification.
+
+What follows is a subset of all the custom operators related to transparency, but covers the most useful, most common requirements.
+
+Graphics state operators
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Pushing the compositor device must be done before any other marking operations are made on the current page, and must be done per page. Popping the compositor should be done after the last marking operation of the page, and before the call to ``showpage``. Any marking operations made after the compositor is popped will bypass the transparent imaging model, and may produce unexpected output.
+
+
+``<depth> .pushpdf14devicefilter -``
+ Installs the transparency compositor device into the graphics state. At present the ``depth`` parameter should always be zero (Subject To Change.)
+
+``- .popdf14devicefilter -``
+ Removes (or, more accuracately, disables) the transparency compositor in graphics state.
+
+``<modename> .setblendmode -``
+ Sets the blending mode in the graphics state. If the mode name is not recognized, causes a ``rangecheck`` error. The initial value of the blending mode is ``/Compatible``.
+
+``- .currentblendmode <modename>``
+ Returns the graphics state blend mode on the stack.
+
+``[Deprecated as of 9.53] <0..1> .setopacityalpha -``
+ Sets the opacity alpha value in the graphics state. The initial opacity alpha value is 1. Note, it is strongly suggested that this method not be used as it currently may give inconsistent results when mixed with methods that set stroke and fill alpha values.
+
+``[Deprecated as of 9.53] - .currentopacityalpha <0..1>``
+ Returns the graphics state opacity alpha on the stack. Note, it is strongly suggested that this method not be used as it currently may give inconsistent results when mixed with methods that set stroke and fill alpha values.
+
+``[Deprecated as of 9.53] <0..1> .setshapealpha -``
+ Sets the shape alpha value in the graphics state. The initial shape alpha value is 1. Note, it is strongly suggested that this method not be used as it currently may give inconsistent results when mixed with methods that set stroke and fill alpha values.
+
+``[Deprecated as of 9.53] - .currentshapealpha <0..1>``
+ Returns the graphics state shape alpha on the stack. Note, it is strongly suggested that this method not be used as it currently may give inconsistent results when mixed with methods that set stroke and fill alpha values.
+
+``<0..1> .setstrokeconstantalpha -``
+ Sets the stroke alpha value in the graphics state. The initial stroke alpha value is 1.
+
+``- .currentstrokeconstantalpha <0..1>``
+ Returns the graphics state stroke alpha value on the stack.
+
+``<0..1> .setfillconstantalpha -``
+ Sets the fill alpha value in the graphics state. The initial fill alpha value is 1.
+
+``- .currentfillconstantalpha <0..1>``
+ Returns the graphics state fill alpha value on the stack.
+
+``<bool> .setalphaisshape -``
+ If true, the values set by ``setstrokeconstantalpha`` and ``setfillconstantalpha`` are interpreted as shape values. The initial value of the AIS flag is false.
+
+``- .currentalphaisshape <0..1>``
+ Returns the graphics state alpha is shape (AIS) on the stack.
+
+``<bool> .settextknockout -``
+ Sets the text knockout flag in the graphics state. The initial value of the text knockout flag is true.
+
+``- .currenttextknockout <bool>``
+ Returns the graphics state text knockout on the stack.
+
+
+Rendering stack operators
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The interpreter state is extended to include a (per-context) rendering stack for handling transparency groups and masks (generically, "layers"). Groups accumulate a full value for each pixel (paint plus transparency); masks accumulate only a coverage value. Layers must be properly nested, i.e., the 'end' or 'discard' operator must match the corresponding 'begin' operator.
+
+Beginning and ending groups must nest properly with respect to save and restore: save and restore do not save and restore the layer stack. Currently, layers are not required to nest with respect to gsave and grestore, except that the device that is current in the graphics state when ending a layer must be the same as the device that was current when beginning the layer.
+
+
+.. warning:: THIS AREA IS SUBJECT TO CHANGE.
+
+``<paramdict> <llx> <lly> <urx> <ury> .begintransparencygroup -``
+ Begins a new transparency group. The ``ll/ur`` coordinates are the bounding box of the group in the current user coordinate system. ``paramdict`` has the following keys:
+
+ ``/Isolated``
+ (optional) Boolean; default value = false.
+
+ ``/Knockout``
+ (optional) Boolean; default value = false.
+
+``- .endtransparencygroup -``
+ Ends the current transparency group, compositing the group being ended onto the group that now becomes current.
+
+``<cs_set?> <paramdict> <llx> <lly> <urx> <ury> .begintransparencymaskgroup -``
+ Begins a new transparency mask, which is represented as a group. The ``ll/ur`` coordinates are the bounding box of the mask in the current user coordinate system. ``paramdict`` has the following keys:
+
+ ``/Subtype``
+ (required) Name, either ``/Alpha`` or ``/Luminosity``.
+
+ ``/Background``
+ (optional) Array of number.
+
+ ``/TransferFunction``
+ (optional) Function object (produced by applying ``.buildfunction`` to a Function dictionary).
+
+ The ``cs_set`` parameter is a boolean indicating whether the color space for the mask group is the current color space in the graphics state, or whether mask group color space should be inherited from the previous group in the transparency group stack. In general, for the most consistent results, it is recommended that this be set to true, and the intended color space set in the graphics state prior to the ``.begintransparencymaskgroup`` call.
+
+``<mask#> .endtransparencymask -``
+ Ends the current transparency mask group, compositing the mask group being ended and setting it as the current soft mask in the graphics state.
+ The ``mask#`` parameter indicates whether the mask should be treated as as opacity mask (``0``) or shape (``1``).
+
+
+New ImageType
+^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The transparency extension defines a new ImageType 103, similar to ImageType 3 with the following differences:
+
+- The required ``MaskDict`` is replaced by two optional dictionaries, ``OpacityMaskDict`` and ``ShapeMaskDict``. If present, these dictionaries must have a ``BitsPerComponent`` entry, whose value may be greater than 1. Note that in contrast to ImageType 3, where any non-zero chunky mask value is equivalent to 1, ImageType 103 simply takes the low-order bits of chunky mask values.
+
+- A ``Matte`` entry may be present in one or both mask dictionaries, indicating premultiplication of the data values. If both ``MaskDicts`` have a ``Matte`` entry and the values of the two ``Matte`` entries are different, a ``rangecheck`` error occurs.
+
+- ``InterleaveType`` appears in the ``MaskDicts``, not the ``DataDict``, because each mask has its own ``InterleaveType``. ``InterleaveType`` 2 (interlaced scan lines) is not supported.
+
+
+
+Other graphics state operators
+"""""""""""""""""""""""""""""""
+
+``<int> .setoverprintmode -``
+ Sets the overprint mode in the graphics state. Legal values are 0 or 1. Per the PDF 1.3 specification, if the overprint mode is 1, then when the current color space is ``DeviceCMYK``, color components whose value is 0 do not write into the target, rather than writing a 0 value. THIS BEHAVIOR IS NOT IMPLEMENTED YET. The initial value of the overprint mode is 0.
+
+``- .currentoverprintmode <int>``
+ Returns the current overprint mode.
+
+Character operators
+"""""""""""""""""""""""""""""""
+
+``<font> <charcode> %Type1BuildChar -``
+ This is not a new operator: rather, it is a name known specially to the interpreter. Whenever the interpreter needs to render a character (during a ``...show``, ``stringwidth``, or ``charpath``), it looks up the name ``BuildChar`` in the font dictionary to find a procedure to run. If it does not find this name, and if the ``FontType`` is 1, the interpreter instead uses the value (looked up on the dictionary stack in the usual way) of the name ``%Type1BuildChar``.
+
+ The standard definition of ``%Type1BuildChar`` is in the initialization file ``gs_type1.ps``. Users should not need to redefine ``%Type1BuildChar``, except perhaps for tracing or debugging.
+
+``<font> <charname> %Type1BuildGlyph -``
+ Provides the Type 1 implementation of ``BuildGlyph``.
+
+
+Other operators
+~~~~~~~~~~~~~~~~~~~~~
+
+Mathematical operators
+""""""""""""""""""""""""""
+
+``<number> arccos <number>``
+ Computes the arc cosine of a number between -1 and 1.
+
+``<number> arcsin <number>``
+ Computes the arc sine of a number between -1 and 1.
+
+Dictionary operators
+""""""""""""""""""""""""""
+
+``mark <key1> <value1> <key2> <value2> ... .dicttomark <dict>``
+ Creates and returns a dictionary with the given keys and values. This is the same as the PostScript Level 2 >> operator, but is available even in Level 1 configurations.
+
+``<dict> <key> .knownget <value> true``, ``<dict> <key> .knownget false``
+ Combines ``known`` and ``get`` in the obvious way.
+
+
+File operators
+""""""""""""""""""""""""""
+
+``<file> .fileposition <integer> true``
+ Returns the position of file. Unlike the standard ``fileposition`` operator, which causes an error if the file is not positionable, ``.fileposition`` works on all files, including filters: for non-positionable files, it returns the total number of bytes read or written since the file was opened.
+
+``<string> findlibfile <foundstring> <file> true``, ``<string> findlibfile <string> false``
+ Opens the file of the given name for reading, searching through directories :ref:`as described in the usage documentation<Use_How Ghostscript finds files>`. If the search fails, ``findlibfile`` simply pushes false on the stack and returns, rather than causing an error.
+
+.. _Tempfile:
+
+``<prefix_string|null> <access_string> .tempfile <string> <file>``
+ Creates and opens a temporary file like the file operator, also returning the file name. There are three cases for the ``<prefix_string|null>`` operand:
+
+ - ``null``: create the file in the same directory and with the same name conventions as other temporary files created by the Ghostscript implementation on this platform. E.g., the temporary file might be named ``/tmp/gs_a1234``.
+
+ - A string that contains only alphanumeric characters, underline, and dash: create the file in the standard temporary directory, but use the ``<prefix_string>`` as the first part of the file name. E.g., if ``<prefix_string>`` is ``xx``, the temporary file might be named ``/tmp/xxa1234``.
+
+ - A string that is the beginning of an absolute file name: use the ``<prefix_string>`` as the first part of the file name. E.g., if ``<prefix_string>`` is ``/my/tmpdir/zz``, the temporary file might be named ``/my/tmpdir/zza1234``.
+
+ When running in ``SAFER`` mode, the absolute path must be one of the strings on the permit file writing list (see :ref:`-dSAFER<dSAFER>`) .
+
+
+Ghostscript also supports the following ``IODevice`` in addition to a subset of those defined in the Adobe documentation:
+
+- ``%pipe%command``, which opens a pipe on the given command. This is supported only on operating systems that provide popen (primarily Unix systems, and not all of those).
+
+- ``%disk#%``, which emulates the ``%disk0`` through ``%disk9`` devices on some Adobe PostScript printers. This pseudo device provides a flat filenaming system with a user definable location for the files (``/Root``). These devices will only be present if the ``diskn.dev`` feature is specified during the build.
+
+ This feature is intended to allow compatibility with font downloaders that expect to store fonts on the ``%disk`` device of the printer.
+
+ Use of the ``%disk#%`` devices requires that the location of files be given by the user setting the ``/Root`` device parameter. The syntax for setting the ``/Root`` parameter is:
+
+ .. code-block:: postscript
+
+ mark /Root (directory_specification) (%disk#) .putdevparams
+
+ For example, to store the files of the ``%disk0`` device on the directory ``/tmp/disk0``, use:
+
+ .. code-block:: postscript
+
+ mark /Root (/tmp/disk0/) (%disk0) .putdevparams
+
+ The files will be stored in the specified directory with arbitrary names. A mapping file is used to store the association between the file names given for the file operations on the ``%diskn#`` device and the file that resides in the ``/Root`` directory.
+
+
+Miscellaneous operators
+""""""""""""""""""""""""""
+
+``<array> bind <array>``
+
+ Depending on the command line parameters ``bind`` is redefined as:
+
+
+ .. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - Flag
+ - Definition
+ * - ``DELAYBIND``
+ - Returns the argument, stores the argument for later use by ``.bindnow``
+
+
+
+``<array> .bind <array>``
+ Performs standard bind operation as defined in PLRM regardless of the ``DELAYBIND`` flag.
+
+
+.. _Language_BindNow:
+
+``- .bindnow -``
+ Applies ``bind`` operator to all saved procedures after binding has been deferred through ``-dDELAYBIND``. Note that idiom recognition has no effect for the deferred binding because the value returned from ``bind`` is discarded.
+
+ Since v. 8.12 ``.bindnow`` undefines itself and restores standard definition of ``bind`` operator. In earlier versions after calling ``.bindnow``, the postscript ``bind`` operator needs to be rebound to the internal implementation ``.bind``, as in this fragment from the ``ps2ascii`` script:
+
+ .. code-block:: postscript
+
+ DELAYBIND {
+ .bindnow
+ /bind /.bind load def
+ } if
+
+
+ This is necessary for correct behavior with later code that uses the ``bind`` operator.
+
+
+``<string> getenv <string> true``, ``<string> getenv false``
+ Looks up a name in the shell environment. If the name is found, returns the corresponding value and true; if the name is not found, returns false.
+
+``<string> <boolean> .setdebug -``
+ Sets or clears any subset of the debugging flags included in ``<string>`` based on the value of ``<boolean>``. These correspond to the debug flags set by ``-Z`` on the command line and enable debug and tracing output from various internal modules.
+
+ .. note::
+
+ Most tracing output is only produced if the Ghostscript interpreter was built with the ``DEBUG`` preprocessor symbol defined.
+
+ The ``zsetdebug()`` C function, which implements this operator, is a useful breakpoint for debuggers. Inserting '``() true .setdebug``' in the interpreted code will trigger a breakpoint at that location without side effects. The current flag state is available in C as the ``gs_debug[]`` array, indexed by character value. The ``zsetdebug`` function will be entered, and ``gs_debug[]`` updated, whether or not Ghostscript is built with the ``DEBUG`` preprocessor symbol defined, so this is useful even with release builds.
+
+
+``- .setsafe -``
+ If Ghostscript is started with ``-dNOSAFER`` or ``-dDELAYSAFER``, this operator can be used to enter ``SAFER`` mode (see :ref:`-dSAFER<dSAFER>`)
+
+ The following is deprecated, see :ref:`-dSAFER<dSAFER>`.
+
+ Since ``SAFER`` mode is implemented with userparameters and device parameters, it is possible to use ``save`` and ``restore`` before and after ``.setsafe`` to return to ``NOSAFER`` mode, but note that such a save object is accessible to any procedures or file run in ``SAFER`` mode. A malicious file with an unbalanced restore could potentially restore back to a point where ``SAFER`` was not in operation.
+
+ .. note::
+
+ This uses ``setpagedevice`` to change ``.LockSafetyParams``, so the page will be erased as a side effect of this operator.
+
+
+
+``- .locksafe -``
+ The following is deprecated, see :ref:`-dSAFER<dSAFER>`.
+
+ This operator sets the current device's ``.LockSafetyParams`` and the ``LockFilePermissions`` user parameter true as well as adding the paths on ``LIBPATH`` and ``FONTPATH`` and the paths given by the system params ``/GenericResourceDir`` and ``/FontResourceDir`` to the current ``PermitFileReading`` list of paths.
+
+ If Ghostscript is started with ``-dNOSAFER`` or ``-dDELAYSAFER``, this operator can be used to enter ``SAFER`` mode with the current set of ``PermitFile...`` user parameters in effect. Since ``.setsafe`` sets the ``PermitFile...`` user parameters to empty arrays, a script or job server that needs to enable certain paths for file Reading, Writing and/or Control can use this operator to perform the locking needed to enter ``SAFER`` mode.
+
+ For example, to enable reading everywhere, but disallow writing and file control (deleting and renaming files), the following can be used:
+
+ .. code-block:: postscript
+
+ { << /PermitFileReading [ (*) ]
+ /PermitFileWriting [ ]
+ /PermitFileControl [ ]
+ >> setuserparams
+ .locksafe
+ } stopped pop
+
+
+ In the above example, use of stopped will allow the use of this sequence on older versions of Ghostscript where ``.locksafe`` was not an operator.
+
+
+ .. note::
+
+ This uses ``setpagedevice`` to change ``.LockSafetyParams``, so the page will be erased as a side effect of this operator.
+
+ See also :ref:`.LockSafetyParams<Language_LockSafetyParams>` and `User Parameters`_.
+
+
+.. _Language_AddControlPath:
+
+``<name> <string> .addcontrolpath``
+
+ Adds a single path to the file access control lists.
+
+ The ``<name>`` parameter can be one of:
+
+ - ``/PermitFileReading``
+
+ - ``/PermitFileWriting``
+
+ - ``/PermitFileControl``
+
+ Whilst the string parameter is the path to be added to the requested list.
+
+ .. note ::
+
+ Any attempt to call this operator after ``.activatepathcontrol`` has been called will result in a ``Fatal`` error, and the interpreter will immediately exit.
+
+
+.. _Language_ActivateControlPath:
+
+``.activatepathcontrol``
+ Activates file access controls. Once activated, these access controls remain in place until the interpreter shuts down.
+
+``.currentpathcontrolstate``
+ Returns true on the operand stack if file access control has been activated, false if not.
+
+``<dict> .genordered <dict> (default: /OutputType /Type3).``, ``<dict> .genordered <string> (/OutputType /ThreshString).``, ``<dict> .genordered <array> (/OutputType /TOSArray).``
+ This operator creates an ordered dither screening pattern with the parameters from the dictionary, returning (by default) a PostScript HalftoneType 3 (threshold array based) dictionary suitable for use with ``sethalftone`` or as a component Halftone of a ``HalftoneType 5`` Halftone dictionary. The ``/OutputType`` parameter can also select other than Halftone Type 3 as the return paramter, ``<dict>`` has the following keys (all are optional):
+
+ ``/Frequency``
+ Integer; default value = 75
+
+ ``/Angle``
+ Integer; default value = 0
+
+ ``/HResolution``
+ Real or Integer; default value is device X resolution.
+
+ ``/VResolution``
+ Real or Integer; default value is device Y resolution.
+
+ ``/DotShape``
+ Integer; default value = 0 (CIRCLE). Other shapes available are:
+
+ 1=REDBOOK, 2=INVERTED, 3=RHOMBOID, 4=LINE_X, 5=LINE_Y, 6=DIAMOND1, 7=DIAMOND2, 8=ROUNDSPOT
+
+ ``/SuperCellSize``
+ Integer; default value = 1 -- actual cell size determined by Frequency, Angle, H/V Resolution.
+
+ A larger value will allow more levels to be attained.
+
+ ``/Levels``
+ Integer; default value = 1 -- actual number of gray levels is determined by Frequency and H/V Resolution.
+
+ SuperCellSize may need to be specified large enough to achieve the requested number of gray levels.
+
+ ``/OutputType``
+ Name; default value = /Type3 (HalftoneType 3 dictionary).
+
+ ``/ThreshString``
+ First two bytes are width (high byte first), next two bytes are height, followed by the threshold array bytes (same as ``/Thresholds`` of the Type3 dictionary).
+
+ ``/TOSArray``
+ First element is the width, next is the height, followed by pairs X, then Y, of the turn-on-sequence of the threshold array. This information can be used to construct a threshold array with a transfer function "pickled into" the threshold array, which is useful if the turn-on-sequence has more than 256 pairs. Refer to ``toolbin``/``halftone``/``thresh_remap`` for more information.
+
+``.shellarguments``
+ This operator is used to access the ``ARGUMENTS`` command line option.
+
+ Relies on Ghostscript being called with the "``--``" command line option - see :ref:`Input Control<Use_Input Control>`.
+
+ See examples in ``lib`` for more information.
+
+
+
+Device operators
+""""""""""""""""""""""""""
+
+``<device> copydevice <device>``
+ Copies a device. The copy is writable and installable. The copy is created in the current VM (local or global), usually local VM for executing ordinary PostScript files.
+
+``<devicename> finddevice <device>``
+ Creates a default instance of a device specified by name. The instance is created in global VM. If ``finddevice`` is called more than once with the same device name, it creates the default instance the first time, and returns the same instance thereafter.
+
+``<devicename> findprotodevice <device>``
+ Finds the prototype of a device specified by name. A prototype can be used with ``getdeviceprops`` or other parameter-reading operators, but it is read-only and cannot be set with setdevice: it must be copied first.
+
+``<matrix> <width> <height> <palette> makeimagedevice <device>``
+ Makes a new device that accumulates an image in memory. ``matrix`` is the initial transformation matrix: it must be orthogonal (that is, [a 0 0 b x y] or [0 a b 0 x y]). palette is a string of 2^N or 3 × 2^N elements, specifying how the 2^N possible pixel values will be interpreted. Each element is interpreted as a gray value, or as RGB values, multiplied by 255. For example, if you want a monochrome image for which 0=white and 1=black, the palette should be <ff 00>; if you want a 3-bit deep image with just the primary colors and their complements (ignoring the fact that 3-bit images are not supported), the palette might be ``<000000 0000ff 00ff00 00ffff ff0000 ff00ff ffff00 ffffff>``. At present, the palette must contain exactly 2, 4, 16, or 256 entries, and must contain an entry for black and an entry for white; if it contains any entries that aren't black, white, or gray, it must contain at least the six primary colors (red, green, blue, and their complements cyan, magenta, and yellow); aside from this, its contents are arbitrary.
+
+ Alternatively, ``palette`` can be 16, 24, 32, or null (equivalent to 24). These are interpreted as:
+
+
+ .. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - Palette
+ - Bits allocated per color
+ * - 16
+ - 5 red, 6 green, 5 blue
+ * - 24
+ - 8 red, 8 green, 8 blue
+ * - 32
+ - 8C, 8M, 8Y, 8K
+
+
+ .. note::
+
+ One can also make an image device (with the same palette as an existing image device) by copying a device using the copydevice operator.
+
+
+``<device> <index> <string> copyscanlines <substring>``
+ Copies one or more scan lines from an image device into a string, starting at a given scan line in the image. The data is in the same format as for the image operator. It is an error if the device is not an image device or if the string is too small to hold at least one complete scan line. Always copies an integral number of scan lines.
+
+``<device> setdevice -``
+ Sets the current device to the specified device. Also resets the transformation and clipping path to the initial values for the device. Signals an ``invalidaccess`` error if the device is a prototype or if :ref:`.LockSafetyParams<Language_LockSafetyParams>` is true for the current device.
+
+ Some device properties may need to be set with ``putdeviceprops`` before ``setdevice`` is called. For example, the :title:`pdfwrite` device will try to open its output file, causing an ``undefinedfilename`` error if ``OutputFile`` hasn't been set to a valid filename. Another method in such cases is to use the level 2 operator instead: ``<< /OutputDevice /pdfwrite /OutputFile (MyPDF.pdf) >> setpagedevice``.
+
+``- currentdevice <device>``
+ Gets the current device from the graphics state.
+
+``<device> getdeviceprops <mark> <name1> <value1> ... <namen> <valuen>``
+ Gets the properties of a device. See the section on `device parameters`_ below for details.
+
+``<mark> <name1> <value1> ... <namen> <valuen> <device> putdeviceprops <device>``
+ Sets properties of a device. May cause ``undefined``, ``invalidaccess``, ``typecheck``, ``rangecheck``, or ``limitcheck`` errors.
+
+
+Filters
+--------
+
+
+Standard filters
+~~~~~~~~~~~~~~~~~~~~~~~
+
+In its usual configuration, Ghostscript supports all the standard PostScript LanguageLevel 3 filters, both encoding and decoding, except that it does not currently support:
+
+- the ``EarlyChange`` key in the ``LZWEncode`` filter.
+
+Ghostscript also supports additional keys in the optional dictionary operands for some filters. For the ``LZWDecode`` filter:
+
+``InitialCodeLength <integer> (default 8)``
+ An integer between 2 and 11 specifying the initial number of data bits per code. Note that the actual initial code length is 1 greater than this, to allow for the reset and end-of-data code values.
+
+``FirstBitLowOrder <boolean> (default false)``
+ If true, codes appear with their low-order bit first.
+
+``BlockData <boolean> (default false)``
+ If true, the data is broken into blocks in the manner specified for the GIF file format.
+
+
+For the ``CCITTFaxEncode`` and ``CCITTFaxDecode`` filters:
+
+``DecodedByteAlign <integer> (default 1)``
+ An integer N with the value 1, 2, 4, 8, or 16, specifying that decoded data scan lines are always a multiple of N bytes. The encoding filter skips data in each scan line from Columns to the next multiple of N bytes; the decoding filter pads each scan line to a multiple of N bytes.
+
+
+Non-standard filters
+~~~~~~~~~~~~~~~~~~~~~~~
+
+In addition to the standard PostScript LanguageLevel 3 filters, Ghostscript supports the following non-standard filters. Many of these filters are used internally to implement standard filters or facilities; they are almost certain to remain, in their present form or a backward-compatible one, in future Ghostscript releases.
+
+``<target> /BCPEncode filter <file>``, ``<source> /BCPDecode filter <file>``
+ Create filters that implement the Adobe Binary Communications Protocol. See Adobe documentation for details.
+
+``<target> <seed_integer> /eexecEncode filter <file>``
+ Creates a filter for encrypting data into the encrypted format described in the Adobe Type 1 Font Format documentation. The ``seed_integer`` must be 55665 for the ``eexec`` section of a font, or 4330 for a ``CharString``. Note that for the ``eexec`` section of a font, this filter produces binary output and does not include the initial 4 (or lenIV) garbage bytes.
+
+``<source> <seed_integer> /eexecDecode filter <file>``, ``<source> <dict> /eexecDecode filter <file>``
+ Creates a filter for decrypting data encrypted as described in the Adobe Type 1 Font Format documentation. The ``seed_integer`` must be 55665 or 4330 as described just above. PDF interpreters don't skip space characters after operator ``eexec``. Use ``keep_spaces = true`` for decoding embedded PDF fonts. Recognized dictionary keys are:
+
+ .. code-block:: postscript
+
+ seed <16-bit integer> (required)
+ lenIV <non-negative integer> (default=4)
+ eexec <bool> (default=false)
+ keep_spaces <bool> (default=false)
+
+``<target> /MD5Encode filter <file>``
+ Creates a filter that produces the 16-byte MD5 digest of the input. Note that no output is produced until the filter is closed.
+
+``<source> <hex_boolean> /PFBDecode filter <file>``
+ Creates a filter that decodes data in ``.PFB`` format, the usual semi-binary representation for Type 1 font files on IBM PC and compatible systems. If ``hex_boolean`` is true, binary packets are converted to hex; if false, binary packets are not converted.
+
+
+
+``<target> <dict> /PixelDifferenceEncode filter <file>``, ``<source> <dict> /PixelDifferenceDecode filter <file>``
+ Implements the Predictor=2 pixel-differencing option of the LZW filters. Recognized keys are:
+
+ .. code-block:: postscript
+
+ Colors <integer> (1 to 4, default=1)
+ BitsPerComponent <integer> (1, 2, 4, or 8, default=8)
+ Columns <integer> (>= 0, required)
+
+ See the Adobe PDF Reference Manual for details.
+
+``<target> <dict> /PNGPredictorEncode filter <file>``, ``<source> <dict> /PNGPredictorDecode filter <file>``
+ Implements the "filter" algorithms of the Portable Network Graphics (PNG) graphics format. Recognized keys are:
+
+
+ .. list-table::
+ :widths: 40 40 20
+ :header-rows: 1
+
+ * - Key
+ - Range
+ - Default
+ * - ``Colors <integer>``
+ - 1 to 16
+ - 16
+ * - ``BitsPerComponent <integer>``
+ - 1, 2, 4, 8, or 16
+ - 8
+ * - ``Columns <integer>``
+ - >= 0
+ - 1
+ * - ``Predictor <integer>``
+ - 10 to 15
+ - 15
+
+ The ``Predictor`` is the PNG algorithm number + 10 for the ``Encoding`` filter; the ``Decoding`` filter ignores ``Predictor``. 15 means the encoder attempts to optimize the choice of algorithm. For more details see the `PNG specification`_.
+
+
+
+``<target> /TBCPEncode filter <file>``, ``<source> /TBCPDecode filter <file>``
+ Create filters that implement the Adobe Tagged Binary Communications Protocol. See Adobe documentation for details.
+
+``<target> /zlibEncode filter <file>``, ``<source> /zlibDecode filter <file>``
+ Creates filters that use the data compression method variously known as 'zlib' (the name of a popular library that implements it), 'Deflate' (as in `RFC 1951`_, which is a detailed specification for the method), 'gzip' (the name of a popular compression application that uses it), or 'Flate' (Adobe's name). Note that the PostScript ``Flate`` filters are actually a combination of this filter with an optional predictor filter.
+
+
+
+Unstable filters
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Some versions of Ghostscript may also support other non-standard filters for experimental purposes. The current version includes the following such filters, which are not documented further. No code should assume that these filters will exist in compatible form, or at all, in future versions.
+
+``<target/source> <string> ByteTranslateEncode/Decode filter <file>``
+ ``string`` must be a string of exactly 256 bytes. Creates a filter that converts each input byte ``b`` to ``string[b]``. Note that the ``Encode`` and ``Decode`` filters operate identically: the client must provide a string for the ``Decode`` filter that is the inverse mapping of the ``string`` for the ``Encode`` filter.
+
+``<target/source> <dict> BoundedHuffmanEncode/Decode filter <file>``
+ These filters encode and decode data using Huffman codes. Since these filters aren't used anywhere, we don't document them further, except to note the recognized dictionary keys, which must be set identically for encoding and decoding:
+
+ .. code-block:: postscript
+
+ FirstBitLowOrder <bool> (default=false)
+ MaxCodeLength <int> (default=16)
+ EndOfData <bool> (default=true)
+ EncodeZeroRuns <int> (default=256)
+ Tables <int_array>
+
+
+``<target/source> <dict> BWBlockSortEncode/Decode filter <file>``
+ This filter implements the Burroughs-Wheeler block sorting compression method, which we've heard is also used in the popular ``bzip2`` compression application. The only recognized dictionary key is:
+
+ .. code-block:: postscript
+
+ BlockSize <integer> (default=16384)
+
+
+
+Device parameters
+---------------------
+
+
+Ghostscript supports the concept of device parameters for all devices, not just page devices. (For non-page devices, these are accessible through ``getdeviceprops`` and ``putdeviceprops``, as indicated above.) Here are the currently defined parameters for all devices:
+
+
+.. _Language_LockSafetyParams:
+
+``.LockSafetyParams <boolean>``
+ This parameter allows for improved system security by preventing PostScript programs from being able to change potentially dangerous device parameters such as ``OutputFile``. This parameter cannot be set false if it is already true.
+
+ If this parameter is true for the current device, attempt to set a new device that has ``.LockSafetyParams`` false will signal an ``invalidaccess`` error.
+
+
+``BitsPerPixel <integer> (usually read-only)``
+ Number of bits per pixel.
+
+``.HWMargins [<four floats>]``
+ Size of non-imageable regions around the edges of the page, in points (units of 1/72in; see the :ref:`notes on measurements<Devices_Notes on measurements>` in the documentation on :ref:`devices<Devices.htm>`).
+
+
+``HWSize [<integer> <integer>]``
+ X and Y size in pixels.
+
+``%MediaSource <integer>``
+ The input tray key as determined by ``setpagedevice``. PostScript language programs don't set this parameter directly; they can request a particular tray through the ``MediaPosition`` ``setpagedevice`` parameter, but the ``setpagedevice`` logic need not necessarily honor the request. Devices which support switchable trays should implement ``%MediaSource`` in their ``put_params`` device procedure, but (unlike most other such parameters) need not implement corresponding reading logic in ``get_params``.
+
+``%MediaDestination <integer>``
+ The output tray key as determined by ``setpagedevice``. Handling by devices should be parallel to ``%MediaSource``.
+
+``.IgnoreNumCopies <boolean>``
+ Some page description languages support a ``NumCopies`` parameter. This parameter instructs the device to ignore this, producing only one copy of the document on output. Note that some devices ignore ``NumCopies`` regardless because of limitation of the output format or the implementation.
+
+``Name <string> (read-only)``
+ The device name. Currently the same as ``OutputDevice``.
+
+``Colors, GrayValues, RedValues, GreenValues, BlueValues, ColorValues (usually read-only)``
+ As for the ``deviceinfo`` operator of Display PostScript. ``Red``, ``Green``, ``Blue``, and ``ColorValues`` are only defined if ``Colors > 1``.
+
+``TextAlphaBits, GraphicsAlphaBits (usually read-only)``
+ The number of bits of anti-aliasing information for text or graphics respectively. Legal values are 1 (no anti-aliasing, the default for most devices), 2, or 4.
+
+ Because this feature relies upon rendering the input it is incompatible, and will generate an error on attempted use, with any of the vector output devices.
+
+
+Ghostscript also supports the following read-only parameter that is not a true device parameter:
+
+``.EmbedFontObjects <integer>``
+ If non-zero, indicates that the device may embed font objects (as opposed to bitmaps for individual characters) in the output. The purpose of this parameter is to disable third-party font renderers for such devices. (This is zero for almost all devices.)
+
+In addition, the following are defined per Adobe's documentation for the ``setpagedevice`` operator:
+
+.. code-block:: postscript
+
+ Duplex (if supported)
+ HWResolution
+ ImagingBBox
+ Margins
+ LeadingEdge
+ MediaPosition
+ NumCopies (for printers only)
+ Orientation (if supported)
+ OutputDevice
+ PageOffset (write-only)
+ PageSize
+ ProcessColorModel (usually read-only)
+
+Some devices may only allow certain values for ``HWResolution`` and ``PageSize``. The null device ignores attempts to set ``PageSize``; its size is always ``[0 0]``.
+
+It should be noted that calling ``setpagedevice`` with one of the above keys may reset the effects of any ``pdfmark`` commands up to that point. In particular this is true of ``HWResolution``, a behavior that differs from Adobe Distiller.
+
+For raster printers and image format (jpeg*, tiff*, png* ...) devices these page device parameters are also defined:
+
+
+``MaxBitmap <integer>``
+ Maximum space for a full page raster image (bitmap) in memory.
+ This value includes the space for padding raster lines and for an array of pointers for each raster line, thus the ``MaxBitmap`` value to allow a given ``PageSize`` of a specific number of bits per pixel to be rendered in a full page buffer may be somewhat larger than the bitmap size alone.
+
+``BandListStorage <file|memory>``
+ The default is determined by the make file macro ``BAND_LIST_STORAGE``. Since memory is always included, specifying ``-sBandListStorage=memory`` when the default is file will use memory based storage for the band list of the page. This is primarily intended for testing, but if the disk I/O is slow, band list storage in memory may be faster.
+
+``BufferSpace <integer>``
+ Size of the buffer space for band lists, if the full page raster image (bitmap) is larger than ``MaxBitmap`` (see above.)
+
+ The buffer space is used to collect display list (clist) commands for the bands and then to consolidate those commands when writing the clist to the selected ``BAND_LIST_STORAGE`` device (memory or file) set when Ghostscript is compiled.
+
+ If ``MaxBitmap`` (above) forces banding mode, and if ``BufferSpace`` is large enough, the display list (``clist``) will consist of a single band.
+
+ The ``BufferSpace`` will determine the size of the 'consolidation' buffer (above) even if the MaxBitmap value is low enough to force banding/clist mode.
+
+
+``BGPrint <boolean>``
+ With many printer devices, when the display list (``clist``) banding mode is being used, the page rendering and output can be performed in a background thread. The default value, false, causes the rendering and printing to be done in the same thread as the parser. When ``-dBGPrint=true``, the page output will be overlapped with parsing and writing the ``clist`` for the next page.
+
+ If the device does not support background printing, rendering and printing will be performed as if ``-dBGPrint=false``.
+
+ .. note::
+
+ The background printing thread will allocate a band buffer (size determined by the ``BufferSpace`` or ``BandBufferSpace`` values) in addition to the band buffer in the 'main' parsing thread.
+
+ If ``NumRenderingThreads`` is ``> 0``, then the background printing thread will use the specified number of rendering threads as children of the background printing thread. The background printing thread will perform any processing of the raster data delivered by the rendering threads. Note that ``BGPrint`` is disabled for vector devices such as :title:`pdfwrite` and ``NumRenderingThreads`` has no effect on these devices either.
+
+``GrayDetection <boolean>``
+ When true, and when the display list (``clist``) banding mode is being used, during writing of the ``clist``, the color processing logic collects information about the colors used before the device color profile is applied. This allows special devices that examine ``dev->icc_struct->pageneutralcolor`` with the information that all colors on the page are near neutral, i.e. monochrome, and converting the rendered raster to gray may be used to reduce the use of color toners/inks.
+
+ Since the determination of whether or not the page uses colors is determined before the conversion to device colors, this information is independent of the device output profile. The determination has a small delta (``DEV_NEUTRAL`` and ``AB_NEUTRAL`` in ``base/gscms.h``) to allow colors close to neutral to be detected as neutral. Changing this value requires rebuilding.
+
+ Among the devices distributed with the source, currently only the ``pnmcmyk`` device supports this parameter and will produce either a ``P7 PAM CMYK`` output or a ``P5 PGM Gray`` output depending on the use of color on the page.
+
+ Also, the ``pageneutralcolor`` status can be interrogated as a device parameter of the same name. Using PostScript there are several methods:
+
+ ``currentpagedevice /pageneutralcolor get``
+
+ ``mark currentdevice getdeviceprops .dicttomark /pageneutralcolor get``
+
+ ``/pageneutralcolor /GetDeviceParam .special_op { exch pop }{ //false } ifelse``
+
+ Note that the ``pageneutralcolor`` state is reset to false after the page is output, so this parameter is only valid immediately before ``showpage`` is executed, although the ``setpagedevice`` ``EndPage`` procedure can be used to check the state just prior to the actual output of the page that resets ``pagenuetralcolor``. For example:
+
+ .. code-block:: postscript
+
+ << /EndPage {
+ exch pop 2 ne dup {
+ currentpagedevice /pageneutralcolor get (pageneutralcolor: ) print = flush
+ } if
+ }
+ >> setpagedevice
+
+ .. note::
+
+ Since ``-dGrayDetection=true`` requires extra checking during writing of the ``clist``, this option should only be used for devices that support the optimization of pages to monochrome, otherwise performance may be degraded for no benefit.
+
+ Since ``GrayDetection=true`` is only effective when in ``clist`` (banding) mode, it is recommended to also force banding. For example: ``-dGrayDetection=true -dMaxBitmap=0``.
+
+
+``NumRenderingThreads <integer>``
+ When the display list (``clist``) banding mode is being used, bands can be rendered in separate threads. The default value, 0, causes the rendering of bands to be done in the same thread as the parser and device driver. ``NumRenderingThreads`` of 1 or higher results in bands rendering in the specified number of 'background' threads.
+
+ The number of threads should generally be set to the number of available processor cores for best throughput.
+
+ Note that each thread will allocate a band buffer (size determined by the ``BufferSpace`` or ``BandBufferSpace`` values) in addition to the band buffer in the 'main' thread.
+
+ Additionally note that this parameter has no effect with devices which do not generally render to a bitmap output, such as the vector devices (e.g. :title:`pdfwrite`) and has no effect when rendering, but not using a ``clist``. See :ref:`Improving performance<Use_Improving Performance>`.
+
+
+
+``OutputFile <string>``
+ An empty string means "send to printer directly", otherwise specifies the file name for output; ``%d`` is replaced by the page number for page-oriented output devices; on Unix systems ``%pipe%`` *command* writes to a pipe. (``|`` *command* also writes to a pipe, but is now deprecated). Also see the ``-o`` parameter.
+
+ Attempts to set this parameter if ``.LockSafetyParams`` is true will signal an ``invalidaccess`` error.
+
+``OpenOutputFile <boolean>``
+ If true, open the device's output file when the device is opened, rather than waiting until the first page is ready to print.
+
+``PageCount <integer> (read-only)``
+ Counts the number of pages printed on the device.
+
+.. _Language_BandingParams:
+
+The following parameters are for use only by very specialized applications that separate band construction from band rasterization. Improper use may cause unpredictable errors. In particular, if you only want to allocate more memory for banding, to increase band size and improve performance, use the ``BufferSpace`` parameter, not ``BandBufferSpace``.
+
+
+
+``BandHeight <integer>``
+ The height of bands when banding. 0 means use the largest band height that will fit within the ``BandBufferSpace`` (or ``BufferSpace``, if ``BandBufferSpace`` is not specified). If ``BandHeight`` is larger than the number of lines that will fit in the buffer, opening the device will fail. If the value is -1, the ``BandHeight`` will automatically be set to the page height (1 band for the entire page). This is primarily for developers debugging ``clist`` issues.
+
+``BandWidth <integer>``
+ The width of bands in the rasterizing pass, in pixels. 0 means use the actual page width. A ``BandWidth`` value smaller than the width of the page will be ignored, and the actual page width will be used instead.
+
+``BandBufferSpace <integer>``
+ The size of the band buffer in the rasterizing pass, in bytes. 0 means use the same buffer size as for the interpretation pass.
+
+
+Ghostscript supports the following parameter for ``setpagedevice`` and ``currentpagedevice`` that is not a device parameter per se:
+
+``ViewerPreProcess <procedure>``
+ Specifies a procedure to be applied to the page device dictionary before any other processing is done. The procedure may not alter the dictionary, but it may return a modified copy. This "hook" is provided for use by viewing programs such as ``GSview``.
+
+
+
+
+User parameters
+---------------------
+
+
+
+Ghostscript supports the following non-standard user parameters:
+
+``ProcessDSCComment <procedure|null>``
+ If not null, this procedure is called whenever the scanner detects a DSC comment (comment beginning with ``%%`` or ``%!``). There are two operands, the file and the comment (minus any terminating ``EOL``), which the procedure must consume.
+
+``ProcessComment <procedure|null>``
+ If not null, this procedure is called whenever the scanner detects a comment (or, if ``ProcessDSCComment`` is also not null, a comment other than a ``DSC`` comment). The operands are the same as for ``ProcessDSCComment``.
+
+``LockFilePermissions <boolean>``
+ If true, this parameter and the three ``PermitFile...`` parameters cannot be changed. Attempts to change any of the values when ``LockFilePermissions`` is true will signal ``invalidaccess``. Also, when this value is true, the file operator will give ``invalidaccess`` when attempting to open files (processes) using the ``%pipe`` device.
+
+ Also when ``LockFilePermissions`` is true, strings cannot reference the parent directory (platform specific). For example (``../../xyz``) is illegal on unix, Windows and Macintosh, and (``[.#.#.XYZ]``) is illegal on VMS.
+
+ This parameter is set true by the ``.setsafe`` and ``.locksafe`` operators.
+
+
+``PermitFileReading <array of strings>``, ``PermitFileWriting <array of strings>``, ``PermitFileControl <array of strings>``
+ These parameters specify paths where file reading, writing and the 'control' operations are permitted, respectively. File control operations are ``deletefile`` and ``renamefile``. For ``renamefile``, the filename for the current filename must match one of the paths on the ``PermitFileControl`` list, and the new filename must be on both the ``PermitFileControl`` and the ``PermitFileWriting`` lists of paths.
+
+ The strings can contain wildcard characters as for the ``filenameforall`` operator and unless specifying a single file, will end with a ``*`` for directories (folders) to allow access to all files and sub-directories in that directory.
+
+ .. note::
+
+ The strings are used for ``stringmatch`` operations similar to ``filenameforall``, thus on MS Windows platforms, use the '``/``' character to separate directories and filenames or use '``\\\\``' to have the string contain '``\\``' which will match a single '``\``' in the target filename (use of '``/``' is strongly recommended).
+
+ The :ref:`SAFER<dSAFER>` mode and the ``.setsafe`` operator set all three lists to empty arrays, thus the only files that can be read are the ``%stdin`` device and on ``LIBPATH`` or ``FONTPATH`` or the ``Resource`` paths specified by the ``/FontResourceDir`` or ``/GenericResourceDir`` system params. Files cannot be opened for writing anywhere and cannot be deleted or renamed except for files created with the :ref:`.tempfile<Tempfile>` operator).
+
+
+``AlignToPixels <integer>``
+ Control sub-pixel positioning of character glyphs (where applicable). A value of 1 specifies alignment of text characters to pixels boundaries. A value of 0 to subpixels where the division factor is set by the device parameter ``TextAlphaBits``. If the latter is 1, the same rendering results regardless of the value of ``AlignToPixels``. The initial value defaults to 1, but this may be overridden by the command line argument ``-dAlignToPixels``.
+
+
+.. _Language_GridFitTT:
+
+``GridFitTT <integer>``
+ Control the use of True Type grid fitting. Ghostscript, by default, uses Freetype for rendering Truetype (and most other) glyphs (but other scaler/renderer libraries can be used), thus has access to a complete Truetype bytecode interpreter.
+
+ This parameter controls the hinting of Truetype glyphs.
+
+ - A value of 0 disables grid fitting for all True Type fonts (not generally recommended).
+
+ - A value of 1 enables the grid fitting using the native Truetype hinting bytecode program(s). Fonts or glyphs with faulty bytecode program(s) will be rendered unhinted.
+
+ - A value 2 is scaler/renderer dependent (generally, if no alternative hinting engine is available this will be equivalent to 1). With the Freetype (our default) this enables Freetype's built-in autohinter.
+
+ - With Freetype, a value of 3 is effectively equivalent to 1.
+
+ This parameter defaults to 1, but this may be overridden on the command line with ``-dGridFitTT=n``.
+
+
+
+Miscellaneous additions
+---------------------------
+
+Extended semantics of 'run'
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The operator run can take either a string or a file as its argument. In the latter case, it just runs the file, closing it at the end, and trapping errors just as for the string case.
+
+Decoding resources
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``Decoding`` is a Ghostscript-specific resource category. It contains various resources for emulating PostScript fonts with other font technologies. Instances of the ``Decoding`` category are tables which map PostScript glyph names to character codes used with TrueType, Intellifont, Microtype and other font formats.
+
+
+Currently Ghostscript is capable of PostScript font emulation in 2 ways :
+
+1. Through :ref:`FAPI<Fonts FAPI>` plugins.
+2. With TrueType font files, using the native font renderer, by specifying TrueType font names or files in ``Resource/Init/Fontmap.GS``.
+
+
+``Decoding`` resources are not currently used by the native font renderer.
+
+An instance of the ``Decoding`` resource category is a dictionary. The dictionary keys are PostScript glyph names and the values are either character codes, or arrays of character codes. Arrays are used when a single name may be mapped to various character codes - in this case Ghostscript tries all alternatives until a success. The name of the resource instance should reflect the character set for which it maps. For example, ``/Unicode`` ``/Decoding`` resource maps to Unicode UTF-16.
+
+The rules for using ``Decoding`` resources in particular cases are specified in the configuration file ``Resource/Init/xlatmap``. See the file itself for more information.
+
+The file format for ``Decoding`` resource files is generic PostScript. Users may want to define custom ``Decoding`` resources. The ``ParseDecoding`` ``procset`` defined in ``Resource/Init/gs_ciddc.ps`` allows representation of the table in a comfortable form.
+
+
+
+CIDDecoding resources
+~~~~~~~~~~~~~~~~~~~~~~~
+
+``CIDDecoding`` resources are similar to ``Decoding`` resources, except they map ``Character Identifiers (CIDs)`` rather than glyph names. Another difference is that the native Ghostscript font renderer uses ``CIDDecoding`` resources while emulate ``CID`` fonts with TrueType or OpenType fonts.
+
+An instance of the ``CIDDecoding`` resource category is a dictionary of arrays. Keys in the dictionary are integers, which correspond to high order byte of a ``CID``. Values are 256-element arrays, and their indices correspond to the low order byte of a ``CID``. Each elemet of an array is either null, or character code (integer), or an array of character codes (integers). The zero code represents mapping to the default character.
+
+The dictionary includes the additional key ``CIDCount``. Its value is the maximal ``CID`` defined, plus one.
+
+The Ghostscript library is capable of generating some ``CIDDecoding`` instances automatically, using the appropriate ``CMap`` (character map) resources. This covers most of practical cases if the neccessary ``CMap`` resources are provided. See the table ``.CMapChooser`` in ``Resource/Init/gs_ciddc.ps`` for the names of automatically generated resources and associated ``CMaps``. They allow to mapping CNS1, GB1, Japan1, Japan2 and Korea1 CID sets to TrueType character sets known as Unicode (exactly UTF-16), Big5, GB1213, ShiftJIS, Johab and Wansung.
+
+The file format for ``CIDDecoding`` resource file is generic PostScript. Users may want to define custom resources to ``CIDDecoding`` resource category.
+
+
+GlyphNames2Unicode
+~~~~~~~~~~~~~~~~~~~~~
+
+``GlyphNames2Unicode`` is an undocumented dictionary which Adobe PostScript printer driver uses to communicate with Adobe Distiller. In this dictionary the keys are glyph names, the values are Unicode UTF-16 codes for them. The dictionaly is stored in the ``FontInfo`` dictionary under the key ``GlyphNames2Unicode``. Ghostscript recognises it and uses to generate ``ToUnicode CMaps`` with :title:`pdfwrite`.
+
+Multiple Resource directories
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Since 8.10 release Ghostscript maintains multiple resource directories.
+
+Ghostscript does not distinguish ``lib`` and ``Resource`` directories. There is no file name conflicts because ``lib`` does not contain subdirectories, but ``Resource`` always store files in subdirectories.
+
+The search method with multiple resource directories appears not fully conforming to PLRM. We cannot unconditionally call ``ResourceFileName`` while executing ``findresource`` or ``resourcestatus``, ``resourceforall``, because per PLRM it always returns a single path. Therefore Ghostscript implements an extended search method in ``findresource``, ``resourcestatus`` and ``resourceforall``, which first calls ``ResourceFileName`` and checks whether the returned path points to an existing file. If yes, the file is used, otherwise Ghostscript searches all directories specified in ``LIB_PATH``. With a single resource directory it appears conforming to PLRM and equivalent to Adobe implementations.
+
+``ResourceFileName`` may be used for obtaining a path where a resource file to be installed. In this case Ghostscript to be invoked with ``-sGenericResourceDir=path``, specifying an absolute path. The default value for ``GenericResourceDir`` is a relative path. Therefore a default invocation with a PostScript installer will install resource files into ``/gs/Resource``.
+
+
+Scripting the PDF interpreter
+-------------------------------
+
+PostScript functions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We have not previously documented the internals of the Ghostscript PDF interpreter, but we have, on occasion, provided solutions that rely upon scripting the interpreter from PostScript. This was possible because the interpreter was written in PostScript.
+
+From release 9.55.0 Ghostscript comes supplied with two PDF interpreters, the original written in PostScript and a brand-new interpreter written in C. While the new interpreter can be run as part of the ``GhostPDL`` family it has also been integrated into Ghostscript, and can be run from the PostScript environment in a similar fashion to the old interpreter. We plan to deprecate, and eventually remove, the old interpreter and carry on with the new one.
+
+Because we have supplied solutions in the past based on the old interpreter, we have had to implement the same capabilities in the integration of the new interpreter. Since this has meant discovering which internal portions were being used, working out how those function, and duplicating them anew, it seemed a good time to document these officially, so that in future the functionality would be available to all.
+
+The following functions existed in the original PDF interpreter and have been replicated for the new interpreter. It should be possible to use these for the forseeable future.
+
+
+``<file> runpdf -``
+ Called from the modified PostScript run operator (which copies ``stdin`` to a temp file if required). Checks for PDF collections, processes all requested pages.
+
+``<file> runpdfbegin -``
+ This must be called before performing any further operations. Its exact action depends on which interpreter is being used, but it essentially sets up the environment to process the file as a PDF.
+
+``<int> pdfgetpage <pagedict> | <null>``
+ ``int`` is a number from 1 to N indicating the desired page number from the PDF file. Returns the a dictionary containing various informational key/value pairs. If this fails, returns a null object.
+
+``- pdfshowpage_init -``
+ In the PostScript PDF interpreter this simply adds 1 to the ``/DSCPageCount`` value in a dictionary. It has no effect in the new PDF interpreter but is maintained for backwards compatibility.
+
+``<pagedict> pdfshowpage_setpage <pagedict>``
+ Takes a dictionary as returned from ``pdfgetpage``, extracts various parameters from it, and sets the media size for the page, taking into account the boxes, and requested ``Box``, ``Rotate`` value and ``PDFFitPage``.
+
+``<pagedict> pdfshowpage_finish -``
+ Takes a dictionary as returned from ``pdfgetpage``, renders the page content executes ``showpage`` to transfer the rendered content to the device.
+
+``- runpdfend -``
+ Terminates the PDF processing, executes restore and various cleanup activities.
+
+``<file> pdfopen <dict>``
+ Open a PDF file and read the header, trailer and cross-reference.
+
+``<dict> pdfclose -``
+ Terminates processing the original PDF file object. The dictionary parameter should be the one returned from ``pdfopen``.
+
+``<pagedict> pdfshowpage -``
+ Takes a dictionary returned from ``pdfgetpage`` and calls the ``pdfshowpage_init``, ``pdfshowpage_setpage``, ``pdfshowpage_finish`` trio to start the page, set up the media and render the page.
+
+``<int> <int> dopdfpages -``
+ The integers are the first and last pages to be run from the file. Runs a loop from the fist integer to the last.
+
+ .. note::
+
+ If the current dictionary contains a ``PDFPageList`` array the two values on the stack are ignored and we use the range triples from that array (even/odd, start, end) to determine the pages to process. Page numbers for start and end are ``1..lastpage`` and even/odd is 1 for odd, 2 for even, otherwise 0. Uses ``pdfshowpage`` to actually render the page.
+
+``- runpdfpagerange <int> <int>``
+ Processes the PostScript ``/FirstPage``, ``/LastPage`` and ``/PageList`` parameters. These are used together to build an internal array of page numbers to run, which is used by ``dopdfpages`` to actually process the pages if ``PageList`` is present, and a ``FirstPage`` and ``LastPage`` value.
+
+ Despite the name this function does not actually 'run' any pages at all.
+
+ Normal operation simply calls ``runpdf`` with an opened-for-read PostScript file object. The table below shows the normal calling sequence:
+
+
+ .. list-table::
+ :widths: 25 25 25 25
+ :header-rows: 1
+
+ * - Function
+ - Calls
+ - Calls
+ - Calls
+ * - runpdf
+ - runpdfbegin
+ - pdfopen
+ -
+ * -
+ - process_trailer_attrs
+ -
+ -
+ * -
+ - runpdfpagerange
+ -
+ -
+ * -
+ - dopdfpages
+ - pdfgetpage
+ -
+ * -
+ -
+ - pdfshowpage
+ - pdfshowpage_init
+ * -
+ -
+ -
+ - pdfshowpage_setpage
+ * -
+ -
+ -
+ - pdfshowpage_finish
+ * -
+ - runpdfend
+ - pdfclose
+ -
+
+ It is important to get the number of spots and the presence of transparency correct when rendering. Failure to do so will lead to odd output, and potentially crahses. This can be important in situations such as N-up ordering.
+
+ As an example, if we have 2 A4 pages and want to render them side-by-side on A3 media, we might set up the media size to A3, draw the first page contents, translate the origin, draw the second page contents and then render the final content. If the first PDF page did not contain transparency, but the second did, it would be necessary to set ``/PageHasTransparency`` before drawing the first PDF page.
+
+
+PostScript operators interfacing to the PDF interpreter
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The PostScript functions documented above must somehow interface with the actual PDF interpreter, and this is done using a small number of custom PostScript operators. These operators do not exist in standard PostScript; they are specific to the Ghostscript implementation. These operators are documented here for the benefit of any developers wishing to use them directly.
+
+
+
+``dict .PDFInit <PDFContext>``
+ Initialises an instance of the PDF interpreter. ``dict`` is an optional dictionary that contains any interpreter-level switches, such as ``PDFDEBUG``, this is used to set the initial state of the PDF interpreter. The return value is a ``PDFContext`` object which is an opaque object to be used with the other PDF operators.
+
+``filename PDFContext .PDFFile -``
+ Opens a named file and associates it with the instance of the PDF interpreter. Filename is a string containing a fully qualified path to the PDF file to open, this file must have been made accesible by setting ``--permit-file-read``.
+
+``file PDFContext .PDFStream -``
+ Takes an already open (disk-based) file and associates it with the instance of the PDF interpreter.
+
+``PDFcontext .PDFClose -``
+ If the context contains an open PDF file which was opened via the ``.PDFfile`` operator, this closes the file. Files associated with the context by the ``.PDFStream`` operator are unaffected. Regardless of the source it then shuts down the PDF interpreter and frees the associated memory.
+
+``PDFContext .PDFInfo dict``
+ ``PDFContext`` is a ``PDFContext`` object returned from a previous call to ``.PDFInit``. The returned dictionary contains various key/value pairs with useful file level information:
+
+ .. code-block:: postscript
+
+ /NumPages int
+ /Creator string
+ /Producer string
+ /IsEncrypted boolean
+
+
+``PDFContext .PDFMetadata -``
+ ``PDFContext`` is a ``PDFContext`` object returned from a previous call to ``.PDFInit``. For the benefit of high level devices, this is a replacement for 'process_trailer_attrs' which is a seriously misnamed function now. This function needs to write any required output intents, load and send ``Outlines`` to the device, copy the Author, Creator, Title, Subject and Keywords from the Info dict to the output device, copy Optional Content Properties (``OCProperties``) to the output device. If an AcroForm is present send all its fields and link widget annotations to fields, and finally copy the ``PageLabels``. If we add support for anything else, it will be here too.
+
+``PDFContext int .PDFPageInfo -``
+ The integer argument is the page number to retrieve information for. This value starts from zero for the first page. Returns a dictionary with the following key/value pairs:
+
+ .. code-block:: postscript
+
+ /UsesTransparency true|false
+ /NumSpots integer containing the number of spot inks on this page
+ /MediaBox [llx lly urx ury]
+ /HasAnnots true|false
+
+ May also contain (if they are present in the Page dictionary):
+
+ .. code-block:: postscript
+
+ /ArtBox [llx lly urx ury]
+ /CropBox [llx lly urx ury]
+ /BleedBox [llx lly urx ury]
+ /TrimBox [llx lly urx ury]
+ /UserUnit int
+ /Rotate number
+
+``PDFcontext int .PDFPageInfoExt -``
+ As per ``.PDFPageInfo`` above but returns 'Extended' information. This consists of two additional arrays in the returned dictionary:
+
+ .. code-block:: postscript
+
+ /Spots array of names, may be empty
+ /Fonts array of dictionaries, one dictionary per font used on the page.
+
+
+ Each font dictionary contains:
+
+ .. code-block:: postscript
+
+ /BaseFont string containing the name of the font.
+ /Subtype string containing the type of the font, as per the PDF Reference.
+ /ObjectNum if present, the object number of the font in the file (fonts may be defined inline and have no object number).
+ /Embedded boolean indicating if the font's FontDescriptor includes a FontFile and is therefore embedded.
+
+ Type 0 fonts also contain:
+
+ .. code-block:: postscript
+
+ /Descendants an array containing a single font dictionary, contents as above.
+
+
+``PDFContext int .PDFDrawPage -``
+ ``PDFContext`` is a ``PDFContext`` object returned from a previous call to ``.PDFInit``. The integer argument is the page number to be processed. Interprets the page content stream(s) of the specified page using the current graphics state.
+
+``PDFContext int .PDFDrawAnnots -``
+ ``PDFContext`` is a ``PDFContext`` object returned from a previous call to ``.PDFInit``. The integer argument is the page number to be processed.
+
+ Renders the Annotations (if any) of the specified page using the current graphics state For correct results, the graphics state when this operator is run should be the same as when PDFDrawPage is executed.
+
+ .. note::
+
+ The ``PDFContext`` object created by ``PDFInit`` must (clearly) have a PDF file associated with it before you can usefully use it. Attempting to use a ``PDFContext`` with any of the processing operators (e.g. ``.PDFDrawPage``) before using either ``.PDFStream`` of ``.PDFFile`` to associate a file with the context will result in an error.
+
+
+
+
+.. External Links
+
+.. _PNG specification: http://www.w3.org/TR/WD-png-960128.html
+.. _RFC 1951: http://www.ietf.org/rfc/rfc1951.txt
+
+.. include:: footer.rst
diff --git a/doc/src/LanguageBindings.rst b/doc/src/LanguageBindings.rst
new file mode 100644
index 00000000..7a6df7ac
--- /dev/null
+++ b/doc/src/LanguageBindings.rst
@@ -0,0 +1,131 @@
+.. title:: Language Bindings
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+
+
+
+Language Bindings
+=======================
+
+The core of Ghostscript is written in C, but also supports language bindings for the following programming languages:
+
+- C#
+- Java
+- Python
+
+
+All of the above languages have equivalent methods as defined in the :ref:`C API<API.htm>`. Java and C# provide additional helper methods to make the use of the API easier for certain applications. These languages also provide example viewers that make use of these methods.
+
+This developer documentation is organized by programming language type and includes API reference and sample code.
+
+Before using the language bindings first ensure that Ghostscript is built for your platform before proceeding. See:
+
+- :ref:`Building with Visual Studio<Make Building with Visual Studio>`
+
+- :ref:`Building with MacOS<Make Building with MacOS>`
+
+- :ref:`Building with Unix<Make Building with Unix>`
+
+
+
+The C API
+--------------
+
+Ghostscript has been in development for over thirty years and is written in C. The API has evolved over time and is continually being developed. The language bindings into Ghostscript will attempt to mirror this evolution and match the current :ref:`C API<API.htm>` as much as possible.
+
+Licensing
+-----------------
+
+Before using Ghostscript, please make sure that you have a valid license to do so. There are two available licenses; make sure you pick the one whose terms you can comply with.
+
+
+Open Source license
+~~~~~~~~~~~~~~~~~~~~~~~
+
+If your software is open source, you may use Ghostscript under the terms of the GNU Affero General Public License.
+
+This means that all of the source code for your complete app must be released under a compatible open source license!
+
+It also means that you may not use any proprietary closed source libraries or components in your app.
+
+Please read the full text of the AGPL license agreement from the FSF web site
+
+If you cannot or do not want to comply with these restrictions, you must acquire a `commercial license`_ instead.
+
+.. raw:: html
+
+ <button class="cta orange" onclick="window.location='https://artifex.com/licensing/'">Find out more about Licensing</button>
+ <p></p>
+
+
+Commercial license
+~~~~~~~~~~~~~~~~~~~~~~
+
+If your project does not meet the requirements of the AGPL, please contact our sales team to discuss a commercial license. Each Artifex commercial license is crafted based on your individual use case.
+
+.. raw:: html
+
+ <button class="cta orange" onclick="window.location='https://artifex.com/contact/'">CONTACT US</button>
+ <p></p>
+
+
+
+
+
+Demo code
+-----------
+
+Please locate the ``demos`` folder in your ``ghostpdl`` source code download from the `GhostPDL repository`_ to find sample code demonstrating the language bindings in action.
+
+
+
+
+
+C#
+-----------
+
+.. toctree::
+
+ LanguageBindingsCSharp.rst
+
+
+Java
+-----------
+
+.. toctree::
+
+ LanguageBindingsJava.rst
+
+
+Python
+-----------
+
+.. toctree::
+
+ LanguageBindingsPython.rst
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.. External links
+
+.. _commercial license: https://artifex.com/licensing/commercial/
+.. _.NET: https://dotnet.microsoft.com/
+.. _Visual Studio: https://visualstudio.microsoft.com/
+.. _Mono: https://www.mono-project.com/
+.. _GhostPDL repository: https://ghostscript.com/releases/gpdldnld.html
diff --git a/doc/src/LanguageBindingsCSharp.rst b/doc/src/LanguageBindingsCSharp.rst
new file mode 100644
index 00000000..5b935a8e
--- /dev/null
+++ b/doc/src/LanguageBindingsCSharp.rst
@@ -0,0 +1,2148 @@
+.. title:: C#
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+
+Introduction
+=======================
+
+In the GhostPDL repository a sample C# project can be found in ``/demos/csharp``.
+
+Within this project the following namespaces and corresponding C# files are of relevance:
+
+- GhostAPI_ ``ghostapi.cs``
+- GhostNET_ ``ghostnet.cs``
+- GhostMono_ ``ghostmono.cs``
+
+
+
+Platform & setup
+=======================
+
+
+Ghostscript should be built as a shared library for your platform.
+
+See :ref:`Building Ghostscript<Building Ghostscript>`.
+
+
+GhostAPI
+=======================
+
+:title:`GhostAPI` is the main wrapper responsible for bridging over to the C library and ensuring that the correct DLLs are imported.
+
+:title:`GhostAPI` contains the ``ghostapi`` class which does not need to be instantiated as it provides public static methods. These methods, which mirror their C counterparts, are as follows:
+
+
+.. list-table::
+ :header-rows: 1
+ :widths: 25 75
+
+ * - Method
+ - Description
+ * - gsapi_revision_
+ - Returns the revision numbers and strings of the Ghostscript interpreter library.
+ * - gsapi_new_instance_
+ - Create a new instance of Ghostscript.
+ * - gsapi_delete_instance_
+ - Destroy an instance of Ghostscript.
+ * - gsapi_set_stdio_with_handle_
+ - Set the callback functions for ``stdio``, together with the handle to use in the callback functions.
+ * - gsapi_set_stdio_
+ - Set the callback functions for ``stdio``.
+ * - gsapi_set_poll_with_handle_
+ - Set the callback function for polling, together with the handle to pass to the callback function.
+ * - gsapi_set_poll_
+ - Set the callback function for polling.
+ * - gsapi_set_display_callback_
+ - *deprecated*
+ * - gsapi_register_callout_
+ - This call registers a callout handler.
+ * - gsapi_deregister_callout_
+ - This call deregisters a previously registered callout handler.
+ * - gsapi_set_arg_encoding_
+ - Set the encoding used for the interpretation of all subsequent args supplied via the gsapi interface on this instance.
+ * - gsapi_set_default_device_list_
+ - Set the string containing the list of default device names.
+ * - gsapi_get_default_device_list_
+ - Returns a pointer to the current default device string.
+ * - gsapi_init_with_args_
+ - Initialise the interpreter.
+ * - :ref:`gsapi_run_*<gsapi_run_asterisk>`
+ - (Wildcard for various "run" methods).
+ * - gsapi_exit_
+ - Exit the interpreter.
+ * - gsapi_set_param_
+ - Set a parameter.
+ * - gsapi_get_param_
+ - Get a parameter.
+ * - gsapi_enumerate_params_
+ - Enumerate the current parameters.
+ * - gsapi_add_control_path_
+ - Add a (case sensitive) path to one of the lists of permitted paths for file access.
+ * - gsapi_remove_control_path_
+ - Remove a (case sensitive) path from one of the lists of permitted paths for file access.
+ * - gsapi_purge_control_paths_
+ - Clear all the paths from one of the lists of permitted paths for file access.
+ * - gsapi_activate_path_control_
+ - Enable/Disable path control.
+ * - gsapi_is_path_control_active_
+ - Query whether path control is activated or not.
+
+
+:title:`GhostAPI` contains some essential structs & enums as well as a static class for some constants, finally it contains the main ``GSAPI`` class which holds the key methods which interface with the C library.
+
+
+
+
+
+Structs and Enums
+-------------------
+
+
+``gsapi_revision_t``
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This struct is used to contain information pertinent to the version of Ghostscript.
+
+
+.. code-block:: csharp
+
+ public struct gsapi_revision_t
+ {
+ public IntPtr product;
+ public IntPtr copyright;
+ public int revision;
+ public int revisiondate;
+ }
+
+
+``gs_set_param_type``
+~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: csharp
+
+ public enum gs_set_param_type
+ {
+ gs_spt_invalid = -1,
+ gs_spt_null = 0, /* void * is NULL */
+ gs_spt_bool = 1, /* void * is NULL (false) or non-NULL (true) */
+ gs_spt_int = 2, /* void * is a pointer to an int */
+ gs_spt_float = 3, /* void * is a float * */
+ gs_spt_name = 4, /* void * is a char * */
+ gs_spt_string = 5, /* void * is a char * */
+ gs_spt_long = 6, /* void * is a long * */
+ gs_spt_i64 = 7, /* void * is an int64_t * */
+ gs_spt_size_t = 8, /* void * is a size_t * */
+ gs_spt_parsed = 9, /* void * is a pointer to a char * to be parsed */
+ gs_spt_more_to_come = 1 << 31
+ };
+
+
+``gsEncoding``
+~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: csharp
+
+ public enum gsEncoding
+ {
+ GS_ARG_ENCODING_LOCAL = 0,
+ GS_ARG_ENCODING_UTF8 = 1,
+ GS_ARG_ENCODING_UTF16LE = 2
+ };
+
+
+
+Constants
+-------------------
+
+Constants are stored in the static class ``gsConstants`` for direct referencing.
+
+
+``gsConstants``
+~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: csharp
+
+ static class gsConstants
+ {
+ public const int E_QUIT = -101;
+ public const int GS_READ_BUFFER = 32768;
+ public const int DISPLAY_UNUSED_LAST = (1 << 7);
+ public const int DISPLAY_COLORS_RGB = (1 << 2);
+ public const int DISPLAY_DEPTH_8 = (1 << 11);
+ public const int DISPLAY_LITTLEENDIAN = (1 << 16);
+ public const int DISPLAY_BIGENDIAN = (0 << 16);
+ }
+
+
+
+
+GSAPI
+-------------------
+
+
+
+Methods contained within are explained below.
+
+:ref:`gsapi_run_*<csharp_gsapi_run_asterisk>` and gsapi_exit_ methods return an ``int`` code which can be interpreted as follows:
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - code
+ - status
+ * - ``0``
+ - no error
+ * - ``gsConstants.E_QUIT``
+ - "quit" has been executed. This is not an error. gsapi_exit_ must be called next
+ * - ``<0``
+ - error
+
+
+
+.. note::
+
+ For full details on these return codes please see :ref:`The C API return codes<API_Return codes>`.
+
+ All :title:`GSAPI` methods aside from ``gsapi_revision`` and ``gsapi_new_instance`` should pass an instance of Ghostscript as their first parameter with an ``IntPtr`` instance
+
+
+
+
+
+``gsapi_revision``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This method returns the revision numbers and strings of the Ghostscript interpreter library; you should call it before any other interpreter library functions to make sure that the correct version of the Ghostscript interpreter has been loaded.
+
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_revision(ref gsapi_revision_t vers, int size);
+
+
+.. note::
+
+ The method should write to a reference variable which conforms to the struct `gsapi_revision_t`_.
+
+
+
+
+``gsapi_new_instance``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Creates a new instance of Ghostscript. This instance is passed to most other :title:`GSAPI` methods. Unless Ghostscript has been compiled with the ``GS_THREADSAFE`` define, only one instance at a time is supported.
+
+.. code-block:: csharp
+
+ public static extern int gsapi_new_instance(out IntPtr pinstance,
+ IntPtr caller_handle);
+
+.. note::
+
+ The method returns a pointer which represents your instance of Ghostscript.
+
+
+
+
+
+``gsapi_delete_instance``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Destroy an instance of Ghostscript. Before you call this, Ghostscript must have finished. If Ghostscript has been initialised, you must call gsapi_exit_ beforehand.
+
+
+.. code-block:: csharp
+
+ public static extern void gsapi_delete_instance(IntPtr instance);
+
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ GSAPI.gsapi_delete_instance(gsInstance);
+ gsInstance = IntPtr.Zero;
+
+
+
+
+``gsapi_set_stdio_with_handle``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback functions for ``stdio``, together with the handle to use in the callback functions. The stdin callback function should return the number of characters read, ``0`` for ``EOF``, or ``-1`` for ``error``. The ``stdout`` and ``stderr`` callback functions should return the number of characters written.
+
+.. note::
+
+ These callbacks do not affect output device I/O when using "%stdout" as the output file. In that case, device output will still be directed to the process "stdout" file descriptor, not to the ``stdio`` callback.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_set_stdio_with_handle(IntPtr instance,
+ gs_stdio_handler stdin,
+ gs_stdio_handler stdout,
+ gs_stdio_handler stderr,
+ IntPtr caller_handle);
+
+
+
+
+``gsapi_set_stdio``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback functions for ``stdio``. The handle used in the callbacks will be taken from the value passed to gsapi_new_instance_. Otherwise the behaviour of this function matches gsapi_set_stdio_with_handle_.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_set_stdio_with_handle(IntPtr instance,
+ gs_stdio_handler stdin,
+ gs_stdio_handler stdout,
+ gs_stdio_handler stderr);
+
+
+
+
+``gsapi_set_poll_with_handle``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback function for polling, together with the handle to pass to the callback function. This function will only be called if the Ghostscript interpreter was compiled with ``CHECK_INTERRUPTS`` as described in ``gpcheck.h``.
+
+The polling function should return zero if all is well, and return negative if it wants Ghostscript to abort. This is often used for checking for a user cancel. This can also be used for handling window events or cooperative multitasking.
+
+The polling function is called very frequently during interpretation and rendering so it must be fast. If the function is slow, then using a counter to return 0 immediately some number of times can be used to reduce the performance impact.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_set_poll_with_handle(IntPtr instance,
+ gsPollHandler pollfn,
+ IntPtr caller_handle);
+
+
+
+``gsapi_set_poll``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback function for polling. The handle passed to the callback function will be taken from the handle passed to gsapi_new_instance_. Otherwise the behaviour of this function matches gsapi_set_poll_with_handle_.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_set_poll(IntPtr instance,
+ gsPollHandler pollfn);
+
+
+
+``gsapi_set_display_callback``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This call is deprecated; please use gsapi_register_callout_ to register a :ref:`callout handler<gs_callout>` for the display device in preference.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_set_display_callback(IntPtr pinstance,
+ IntPtr caller_handle);
+
+
+``gsapi_register_callout``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This call registers a :ref:`callout handler<gs_callout>`.
+
+.. code-block:: csharp
+
+ public static extern int gsapi_register_callout(IntPtr instance,
+ gsCallOut callout,
+ IntPtr callout_handle);
+
+
+
+``gsapi_deregister_callout``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This call deregisters a :ref:`callout handler<gs_callout>` previously registered with gsapi_register_callout_. All three arguments must match exactly for the :ref:`callout handler<gs_callout>` to be deregistered.
+
+.. code-block:: csharp
+
+ public static extern int gsapi_deregister_callout(IntPtr instance,
+ gsCallOut callout,
+ IntPtr callout_handle);
+
+
+
+
+``gsapi_set_arg_encoding``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the encoding used for the interpretation of all subsequent arguments supplied via the :title:`GhostAPI` interface on this instance. By default we expect args to be in encoding 0 (the 'local' encoding for this OS). On Windows this means "the currently selected codepage". On Linux this typically means ``utf8``. This means that omitting to call this function will leave Ghostscript running exactly as it always has. Please note that use of the 'local' encoding is now deprecated and should be avoided in new code. This must be called after gsapi_new_instance_ and before gsapi_init_with_args_.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_set_arg_encoding(IntPtr instance,
+ int encoding);
+
+
+
+``gsapi_set_default_device_list``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the string containing the list of default device names, for example "display x11alpha x11 bbox". Allows the calling application to influence which device(s) Ghostscript will try, in order, in its selection of the default device. This must be called after gsapi_new_instance_ and before gsapi_init_with_args_.
+
+.. code-block:: csharp
+
+ public static extern int gsapi_set_default_device_list(IntPtr instance,
+ IntPtr list,
+ ref int listlen);
+
+
+
+``gsapi_get_default_device_list``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Returns a pointer to the current default device string. This must be called after gsapi_new_instance_ and before gsapi_init_with_args_.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_get_default_device_list(IntPtr instance,
+ ref IntPtr list,
+ ref int listlen);
+
+``gsapi_init_with_args``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To initialise the interpreter, pass your ``instance`` of Ghostscript, your argument count, ``argc`` and your argument variables, ``argv``.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_init_with_args(IntPtr instance,
+ int argc,
+ IntPtr argv);
+
+
+
+
+.. _csharp_gsapi_run_asterisk:
+
+
+``gsapi_run_*``
+~~~~~~~~~~~~~~~~~~
+
+If these functions return ``<= -100``, either quit or a fatal error has occured. You must call gsapi_exit_ next. The only exception is gsapi_run_string_continue_ which will return ``gs_error_NeedInput`` if all is well.
+
+There is a 64 KB length limit on any buffer submitted to a ``gsapi_run_*`` function for processing. If you have more than 65535 bytes of input then you must split it into smaller pieces and submit each in a separate gsapi_run_string_continue_ call.
+
+
+``gsapi_run_string_begin``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: csharp
+
+ public static extern int gsapi_run_string_begin(IntPtr instance,
+ int usererr,
+ ref int exitcode);
+``gsapi_run_string_continue``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: csharp
+
+ public static extern int gsapi_run_string_continue(IntPtr instance,
+ IntPtr command,
+ int count,
+ int usererr,
+ ref int exitcode);
+
+
+
+``gsapi_run_string_with_length``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: csharp
+
+ public static extern int gsapi_run_string_with_length(IntPtr instance,
+ IntPtr command,
+ uint length,
+ int usererr,
+ ref int exitcode);
+``gsapi_run_string``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: csharp
+
+ public static extern int gsapi_run_string(IntPtr instance,
+ IntPtr command,
+ int usererr,
+ ref int exitcode);
+``gsapi_run_string_end``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: csharp
+
+ public static extern int gsapi_run_string_end(IntPtr instance,
+ int usererr,
+ ref int exitcode);
+
+
+``gsapi_run_file``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: csharp
+
+ public static extern int gsapi_run_file(IntPtr instance,
+ IntPtr filename,
+ int usererr,
+ ref int exitcode);
+
+
+
+
+``gsapi_exit``
+~~~~~~~~~~~~~~~~
+
+
+Exit the interpreter. This must be called on shutdown if gsapi_init_with_args_ has been called, and just before gsapi_delete_instance_.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_exit(IntPtr instance);
+
+
+
+``gsapi_set_param``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets a parameter.
+
+Broadly, this is equivalent to setting a parameter using ``-d``, ``-s`` or ``-p`` on the command line. This call cannot be made during a gsapi_run_string_ operation.
+
+Parameters in this context are not the same as 'arguments' as processed by gsapi_init_with_args_, but often the same thing can be achieved. For example, with gsapi_init_with_args_, we can pass "-r200" to change the resolution. Broadly the same thing can be achieved by using gsapi_set_param_ to set a parsed value of "<</HWResolution [ 200.0 200.0 ]>>".
+
+Internally, when we set a parameter, we perform an ``initgraphics`` operation. This means that using gsapi_set_param_ other than at the start of a page is likely to give unexpected results.
+
+Attempting to set a parameter that the device does not recognise will be silently ignored, and that parameter will not be found in subsequent gsapi_get_param_ calls.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_set_param(IntPtr instance,
+ IntPtr param,
+ IntPtr value,
+ gs_set_param_type type);
+
+
+
+.. note::
+
+ The type argument, as a ``gs_set_param_type``, dictates the kind of object that the value argument points to.
+
+ For more on the C implementation of parameters see: :ref:`Ghostscript parameters in C<Use_Setting Parameters>`.
+
+
+
+``gsapi_get_param``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Retrieve the current value of a parameter.
+
+If an error occurs, the return value is negative. Otherwise the return value is the number of bytes required for storage of the value. Call once with value ``NULL`` to get the number of bytes required, then call again with value pointing to at least the required number of bytes where the value will be copied out. Note that the caller is required to know the type of value in order to get it. For all types other than ``gs_spt_string``, ``gs_spt_name``, and ``gs_spt_parsed`` knowing the type means you already know the size required.
+
+This call retrieves parameters/values that have made it to the device. Thus, any values set using ``gs_spt_more_to_come`` without a following call omitting that flag will not be retrieved. Similarly, attempting to get a parameter before gsapi_init_with_args_ has been called will not list any, even if gsapi_set_param_ has been used.
+
+Attempting to read a parameter that is not set will return ``gs_error_undefined`` (-21). Note that calling gsapi_set_param_ followed by gsapi_get_param_ may not find the value, if the device did not recognise the key as being one of its configuration keys.
+
+For further documentation please refer to :ref:`the C API<API_gsapi_get_param>`.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_get_param(IntPtr instance,
+ IntPtr param,
+ IntPtr value,
+ gs_set_param_type type);
+
+
+
+``gsapi_enumerate_params``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enumerate the current parameters. Call repeatedly to list out the current parameters.
+
+The first call should have ``iter = NULL``. Subsequent calls should pass the same pointer in so the iterator can be updated. Negative return codes indicate error, 0 success, and 1 indicates that there are no more keys to read. On success, key will be updated to point to a null terminated string with the key name that is guaranteed to be valid until the next call to gsapi_enumerate_params_. If type is non ``NULL`` then the pointer type will be updated to have the type of the parameter.
+
+.. note::
+
+ Only one enumeration can happen at a time. Starting a second enumeration will reset the first.
+
+The enumeration only returns parameters/values that have made it to the device. Thus, any values set using the ``gs_spt_more_to_come`` without a following call omitting that flag will not be retrieved. Similarly, attempting to enumerate parameters before gsapi_init_with_args_ has been called will not list any, even if gsapi_set_param_ has been used.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_enumerate_params(IntPtr instance,
+ out IntPtr iter,
+ out IntPtr key,
+ IntPtr type);
+
+
+
+``gsapi_add_control_path``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add a (case sensitive) path to one of the lists of :ref:`permitted paths<Use Safer>` for file access.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_add_control_path(IntPtr instance,
+ int type,
+ IntPtr path);
+
+``gsapi_remove_control_path``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Remove a (case sensitive) path from one of the lists of :ref:`permitted paths<Use Safer>` for file access.
+
+
+.. code-block:: csharp
+
+ public static extern int gsapi_remove_control_path(IntPtr instance,
+ int type,
+ IntPtr path);
+
+``gsapi_purge_control_paths``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Clear all the paths from one of the lists of :ref:`permitted paths<Use Safer>` for file access.
+
+
+.. code-block:: csharp
+
+ public static extern void gsapi_purge_control_paths(IntPtr instance,
+ int type);
+
+
+
+``gsapi_activate_path_control``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enable/Disable path control (i.e. whether paths are checked against :ref:`permitted paths<Use Safer>` before access is granted).
+
+
+.. code-block:: csharp
+
+ public static extern void gsapi_activate_path_control(IntPtr instance,
+ int enable);
+
+
+``gsapi_is_path_control_active``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Query whether path control is activated or not.
+
+.. code-block:: csharp
+
+ public static extern int gsapi_is_path_control_active(IntPtr instance);
+
+
+
+Callback and Callout prototypes
+--------------------------------------
+
+:title:`GSAPI` also defines some prototype pointers which are defined as follows.
+
+``gs_stdio_handler``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: csharp
+
+ /* Callback proto for stdio */
+ public delegate int gs_stdio_handler(IntPtr caller_handle,
+ IntPtr buffer,
+ int len);
+``gsPollHandler``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: csharp
+
+ /* Callback proto for poll function */
+ public delegate int gsPollHandler(IntPtr caller_handle);
+
+
+.. _gs_callout:
+
+``gsCallOut``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: csharp
+
+ /* Callout proto */
+ public delegate int gsCallOut(IntPtr callout_handle,
+ IntPtr device_name,
+ int id,
+ int size,
+ IntPtr data);
+
+
+GhostNET
+=======================
+
+:title:`GhostNET` is the `.NET`_ interface into :title:`GhostAPI`. It exemplifies how to do more complex operations involving multiple API calls and sequences. See the table below for the main methods:
+
+
+.. list-table::
+ :header-rows: 1
+ :widths: 20 75 5
+
+ * - Method
+ - Description
+ - Notes
+ * - :ref:`GetVersion<GhostNET_GetVersion>`
+ - Returns the version of Ghostscript.
+ -
+ * - :ref:`DisplayDeviceOpen<GhostNET_DisplayDeviceOpen>`
+ - Sets up the display device ahead of time.
+ -
+ * - :ref:`DisplayDeviceClose<GhostNET_DisplayDeviceClose>`
+ - Closes the display device and deletes the instance.
+ -
+ * - :ref:`GetPageCount<GhostNET_GetPageCount>`
+ - Returns the page count for the document.
+ -
+ * - :ref:`CreateXPS<GhostNET_CreateXPS>`
+ - Launches a thread to create an XPS document for Windows printing.
+ - :ref:`asynchronous<Delegates>`
+ * - :ref:`DistillPS<GhostNET_DistillPS>`
+ - Launches a thread rendering all the pages of a supplied PostScript file to a PDF.
+ - :ref:`asynchronous<GhostNET_Delegates>`
+ * - :ref:`DisplayDeviceRunFile<GhostNET_DisplayDeviceRunFile>`
+ - Launches a thread to run a file with the display device.
+ - :ref:`asynchronous<GhostNET_Delegates>`
+ * - :ref:`DisplayDeviceRenderThumbs<GhostNET_DisplayDeviceRenderThumbs>`
+ - Launches a thread rendering all the pages with the display device to collect thumbnail images.
+ - :ref:`asynchronous<GhostNET_Delegates>`
+ * - :ref:`DisplayDeviceRenderPages<GhostNET_DisplayDeviceRenderPages>`
+ - Launches a thread rendering a set of pages with the display device.
+ - :ref:`asynchronous<GhostNET_Delegates>`
+ * - :ref:`GetStatus<GhostNET_GetStatus>`
+ - Returns the current status of Ghostscript.
+ -
+ * - :ref:`Cancel<GhostNET_Cancel>`
+ - Cancels asynchronous operations.
+ -
+ * - :ref:`GhostscriptException<GhostNET_GhostscriptException>`
+ - An application developer can log any exceptions in this public class.
+ -
+
+
+In ``demos/csharp/windows/ghostnet.sln`` there is a sample C# demo project.
+
+This project can be opened in `Visual Studio`_ and used to test the Ghostscript API alongside a UI which handles opening PostScript and PDF files. The sample application here allows for file browsing and Ghostscript file viewing.
+
+Below is a screenshot of the sample application with a PDF open:
+
+
+.. note we embedd the image with raw HTML because Sphinx is incapable of doing percentage style widths ... :(
+
+.. raw:: html
+
+ <img src="_static/ghostnet-wpf-example.png" width=100%/>
+
+
+
+
+Enums
+--------
+
+
+Tasks
+~~~~~~~~~~~~~~~~
+
+The Ghostscript task type ``enum`` is used to inform :title:`GhostAPI` of the type of operation which is being requested.
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Task
+ - Description
+ * - ``PS_DISTILL``
+ - Task associated with converting a PostScript stream to a PDF document.
+ * - ``CREATE_XPS``
+ - Task associated with outputting a copy of a document to XPS.
+ * - ``SAVE_RESULT``
+ - Task associated with saving documents.
+ * - ``GET_PAGE_COUNT``
+ - Task associated with getting the page count of a document.
+ * - ``GENERIC``
+ - Generic task identifier.
+ * - ``DISPLAY_DEV_THUMBS``
+ - Display Device task associated with rendering thumbnails.
+ * - ``DISPLAY_DEV_NON_PDF``
+ - Display Device task associated with non-PDF or non-XPS rendering (see: :ref:`Ghostscript & Page Description Languages<gs_and_PDL>`).
+ * - ``DISPLAY_DEV_PDF``
+ - Display Device task associated with PDF & XPS rendering (see: :ref:`Ghostscript & Page Description Languages<gs_and_PDL>`).
+ * - ``DISPLAY_DEV_RUN_FILE``
+ - Display Device task associated with running files.
+
+
+Task types are defined as ``GS_Task_t``.
+
+
+.. code-block:: csharp
+
+ public enum GS_Task_t
+ {
+ PS_DISTILL,
+ CREATE_XPS,
+ SAVE_RESULT,
+ GET_PAGE_COUNT,
+ GENERIC,
+ DISPLAY_DEV_THUMBS,
+ DISPLAY_DEV_NON_PDF,
+ DISPLAY_DEV_PDF,
+ DISPLAY_DEV_RUN_FILE
+ }
+
+
+
+
+
+
+
+Results
+~~~~~~~~~~~~~~~~
+
+Result types are defined as ``GS_Result_t``.
+
+
+.. code-block:: csharp
+
+ public enum GS_Result_t
+ {
+ gsOK,
+ gsFAILED,
+ gsCANCELLED
+ }
+
+
+.. _GhostNET_Status:
+
+Status
+~~~~~~~~~~~~~~~~
+
+Status types are defined as ``gsStatus``.
+
+
+.. code-block:: csharp
+
+ public enum gsStatus
+ {
+ GS_READY,
+ GS_BUSY,
+ GS_ERROR
+ }
+
+
+
+The Parameter Struct
+-------------------------
+
+The parameter struct ``gsParamState_t`` allows for bundles of information to be processed by Ghostscript to complete overall requests.
+
+
+.. code-block:: csharp
+
+ public struct gsParamState_t
+ {
+ public String outputfile;
+ public String inputfile;
+ public GS_Task_t task;
+ public GS_Result_t result;
+ public int num_pages;
+ public List<int> pages;
+ public int firstpage;
+ public int lastpage;
+ public int currpage;
+ public List<String> args;
+ public int return_code;
+ public double zoom;
+ public bool aa;
+ public bool is_valid;
+ };
+
+
+Parameters explained
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Setting up your parameters (with any dedicated bespoke method(s) which your application requires) is needed when communicating directly with :title:`GhostAPI`.
+
+When requesting Ghostscript to process an operation an application developer should send a parameter payload which defines the details for the operation.
+
+For example in :title:`GhostNET` we can see the public method as follows:
+
+
+.. code-block:: csharp
+
+ public gsStatus DistillPS(String fileName, int resolution)
+ {
+ gsParamState_t gsparams = new gsParamState_t();
+ gsparams.args = new List<string>();
+
+ gsparams.inputfile = fileName;
+ gsparams.args.Add("gs");
+ gsparams.args.Add("-sDEVICE=pdfwrite");
+ gsparams.outputfile = Path.GetTempFileName();
+ gsparams.args.Add("-o" + gsparams.outputfile);
+ gsparams.task = GS_Task_t.PS_DISTILL;
+
+ return RunGhostscriptAsync(gsparams);
+ }
+
+
+
+Here we can see a parameter payload being setup before being passed on to the asynchronous method ``RunGhostscriptAsync`` which sets up a worker thread to run according to the task type in the payload.
+
+:title:`GhostNET` handles many common operations on an application developer's behalf, however if you require to write your own methods to interface with :title:`GhostAPI` then referring to the public methods in :title:`GhostNET` is a good starting point.
+
+For full documentation on parameters refer to :ref:`Ghostscript parameters<Use_Setting Parameters>`.
+
+
+
+
+
+The Event class
+------------------
+
+:title:`GhostNET` contains a public class ``gsEventArgs`` which is an extension of the C# class ``EventArgs``. This class is used to set and get events as they occur. :title:`GhostNET` will create these payloads and deliver them back to the application layer's ``ProgressCallBack`` method asynchronously.
+
+
+.. code-block:: csharp
+
+ public class gsEventArgs : EventArgs
+ {
+ private bool m_completed;
+ private int m_progress;
+ private gsParamState_t m_param;
+ public bool Completed
+ {
+ get { return m_completed; }
+ }
+ public gsParamState_t Params
+ {
+ get { return m_param; }
+ }
+ public int Progress
+ {
+ get { return m_progress; }
+ }
+ public gsEventArgs(bool completed, int progress, gsParamState_t param)
+ {
+ m_completed = completed;
+ m_progress = progress;
+ m_param = param;
+ }
+ }
+
+
+GSNET
+-----------
+
+This class should be instantiated as a member variable in your application with callback definitions setup as required.
+
+Handlers for asynchronous operations can injected by providing your own bespoke callback methods to your instance's ``ProgressCallBack`` function.
+
+
+Sample code
+~~~~~~~~~~~~~~~~
+
+.. code-block:: csharp
+
+ /* Set up ghostscript with callbacks for system updates */
+ m_ghostscript = new GSNET();
+ m_ghostscript.ProgressCallBack += new GSNET.Progress(gsProgress);
+ m_ghostscript.StdIOCallBack += new GSNET.StdIO(gsIO);
+ m_ghostscript.DLLProblemCallBack += new GSNET.DLLProblem(gsDLL);
+ m_ghostscript.PageRenderedCallBack += new GSNET.PageRendered(gsPageRendered);
+ m_ghostscript.DisplayDeviceOpen();
+
+ /* example callback stubs for asynchronous operations */
+ private void gsProgress(gsEventArgs asyncInformation)
+ {
+ Console.WriteLine($"gsProgress().progress:{asyncInformation.Progress}");
+
+ if (asyncInformation.Completed) // task complete
+ {
+ // what was the task?
+ switch (asyncInformation.Params.task)
+ {
+ case GS_Task_t.CREATE_XPS:
+ Console.WriteLine($"CREATE_XPS.outputfile:");
+ Console.WriteLine($"{asyncInformation.Params.result.outputfile}");
+ break;
+
+ case GS_Task_t.PS_DISTILL:
+ Console.WriteLine($"PS_DISTILL.outputfile:");
+ Console.WriteLine($"{asyncInformation.Params.result.outputfile}");
+ break;
+
+ case GS_Task_t.SAVE_RESULT:
+
+ break;
+
+ case GS_Task_t.DISPLAY_DEV_THUMBS:
+
+ break;
+
+ case GS_Task_t.DISPLAY_DEV_RUN_FILE:
+
+ break;
+
+ case GS_Task_t.DISPLAY_DEV_PDF:
+
+ break;
+
+ case GS_Task_t.DISPLAY_DEV_NON_PDF:
+
+ break;
+
+ default:
+
+ break;
+ }
+
+ // task failed
+ if (asyncInformation.Params.result == GS_Result_t.gsFAILED)
+ {
+ switch (asyncInformation.Params.task)
+ {
+ case GS_Task_t.CREATE_XPS:
+
+ break;
+
+ case GS_Task_t.PS_DISTILL:
+
+ break;
+
+ case GS_Task_t.SAVE_RESULT:
+
+ break;
+
+ default:
+
+ break;
+ }
+ return;
+ }
+
+ // task cancelled
+ if (asyncInformation.Params.result == GS_Result_t.gsCANCELLED)
+ {
+
+ }
+ }
+ else // task is still running
+ {
+ switch (asyncInformation.Params.task)
+ {
+ case GS_Task_t.CREATE_XPS:
+
+ break;
+
+ case GS_Task_t.PS_DISTILL:
+
+ break;
+
+ case GS_Task_t.SAVE_RESULT:
+
+ break;
+ }
+ }
+ }
+
+ private void gsIO(String message, int len)
+ {
+ Console.WriteLine($"gsIO().message:{message}, length:{len}");
+ }
+
+ private void gsDLL(String message)
+ {
+ Console.WriteLine($"gsDLL().message:{message}");
+ }
+
+ private void gsPageRendered(int width,
+ int height,
+ int raster,
+ IntPtr data,
+ gsParamState_t state)
+ {
+
+ };
+
+
+.. note::
+
+ Once a Ghostscript operation is in progress any defined callback functions will be called as the operation runs up unto completion. These callback methods are essential for your application to interpret activity events and react accordingly.
+
+An explanation of callbacks and the available public methods within ``GSNET`` are explained below.
+
+
+
+.. _GhostNET_Delegates:
+
+Delegates
+~~~~~~~~~~~~~~~
+
+To handle *asynchronous* events :title:`GhostNET` has four delegates which define callback methods that an application can assign to.
+
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Callback
+ - Description
+ * - ``DLLProblemCallBack``
+ - Occurs if there is some issue with the Ghostscript DLL.
+ * - ``StdIOCallBack``
+ - Occurs if Ghostscript outputs something to ``stderr`` or ``stdout``.
+ * - ``ProgressCallBack``
+ - Occurs as Ghostscript makes its way through a file.
+ * - ``PageRenderedCallBack``
+ - Occurs when a page has been rendered and the data from the display device is ready.
+
+
+
+``DLLProblemCallBack``
+"""""""""""""""""""""""""
+
+.. code-block:: csharp
+
+ internal delegate void DLLProblem(String mess);
+ internal event DLLProblem DLLProblemCallBack;
+
+
+``StdIOCallBack``
+""""""""""""""""""""""
+
+.. code-block:: csharp
+
+ internal delegate void StdIO(String mess,
+ int len);
+ internal event StdIO StdIOCallBack;
+
+``ProgressCallBack``
+""""""""""""""""""""""
+
+
+.. code-block:: csharp
+
+ internal delegate void Progress(gsEventArgs info);
+ internal event Progress ProgressCallBack;
+
+
+``PageRenderedCallBack``
+""""""""""""""""""""""""""""
+
+.. code-block:: csharp
+
+ internal delegate void PageRendered(int width,
+ int height,
+ int raster,
+ IntPtr data,
+ gsParamState_t state);
+ internal event PageRendered PageRenderedCallBack;
+
+
+
+.. _GhostNET_GetVersion:
+
+
+``GetVersion``
+~~~~~~~~~~~~~~
+
+Use this method to get Ghostscript version info as a ``String``.
+
+
+.. code-block:: csharp
+
+ public String GetVersion()
+
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ String gs_vers = m_ghostscript.GetVersion();
+
+
+.. note::
+
+ An exception will be thrown if there is any issue with the Ghostscript DLL.
+
+
+
+
+.. _GhostNET_DisplayDeviceOpen:
+
+``DisplayDeviceOpen``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets up the :ref:`display device<Devices_Display_Devices>` ahead of time.
+
+.. code-block:: csharp
+
+ public gsParamState_t DisplayDeviceOpen()
+
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceOpen();
+
+
+.. note::
+
+ Calling this method instantiates Ghostscript and configures the encoding and the callbacks for the display device.
+
+
+
+.. _GhostNET_DisplayDeviceClose:
+
+
+``DisplayDeviceClose``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Closes the :ref:`display device<Devices_Display_Devices>` and deletes the instance.
+
+
+.. code-block:: csharp
+
+ public gsParamState_t DisplayDeviceClose()
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceClose();
+
+
+.. note::
+
+ Calling this method :ref:`deletes Ghostscript<gsapi_delete_instance>`.
+
+
+
+.. _GhostNET_GetPageCount:
+
+
+``GetPageCount``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Use this method to get the number of pages in a supplied document.
+
+
+.. code-block:: csharp
+
+ public int GetPageCount(String fileName)
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ int page_number = m_ghostscript.GetPageCount("my_document.pdf");
+
+.. note::
+
+ If Ghostscript is unable to determine the page count then this method will return ``-1``.
+
+
+.. _GhostNET_CreateXPS:
+
+``CreateXPS``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launches a thread to create an XPS document for Windows printing. This method is :ref:`asynchronous<GhostNET_Delegates>` and logic should be hooked into your application upon :ref:`GSNET instantiation<GSNET>` to interpret progress.
+
+
+.. code-block:: csharp
+
+ public gsStatus CreateXPS(String fileName,
+ int resolution,
+ int num_pages,
+ double width,
+ double height,
+ bool fit_page,
+ int firstpage,
+ int lastpage)
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.CreateXPS("my_document.pdf",
+ 300,
+ 10,
+ 1000,
+ 1000,
+ true,
+ 0,
+ 9);
+
+
+.. _GhostNET_DistillPS:
+
+
+``DistillPS``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launches a thread rendering all the pages of a supplied PostScript file to a PDF.
+
+
+.. code-block:: csharp
+
+ public gsStatus DistillPS(String fileName, int resolution)
+
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DistillPS("my_postscript_document.ps", 300);
+
+
+
+.. _GhostNET_DisplayDeviceRunFile:
+
+
+``DisplayDeviceRunFile``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launches a thread to run a file with the :ref:`display device<Devices_Display_Devices>`.
+
+
+.. code-block:: csharp
+
+ public gsStatus DisplayDeviceRunFile(String fileName,
+ double zoom,
+ bool aa, // anti-aliasing value
+ int firstpage,
+ int lastpage)
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceRunFile("my_document.pdf",
+ 1.0,
+ true,
+ 0,
+ 9);
+
+
+.. _GhostNET_DisplayDeviceRenderThumbs:
+
+``DisplayDeviceRenderThumbs``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launches a thread rendering all the pages with the :ref:`display device<Devices_Display_Devices>` to collect thumbnail images.
+
+Recommended zoom level for thumbnails is between 0.05 and 0.2, additionally anti-aliasing is probably not required.
+
+
+.. code-block:: csharp
+
+ public gsStatus DisplayDeviceRenderThumbs(String fileName,
+ double zoom,
+ bool aa)
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceRenderThumbs("my_document.pdf",
+ 0.1,
+ false);
+
+
+
+.. _GhostNET_DisplayDeviceRenderPages:
+
+
+``DisplayDeviceRenderPages``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launches a thread rendering a set of pages with the :ref:`display device<Devices_Display_Devices>`. For use with languages that can be indexed via pages which include PDF and XPS. (see: :ref:`Ghostscript & Page Description Languages<gs_and_PDL>`)
+
+
+.. code-block:: csharp
+
+ public gsStatus DisplayDeviceRenderPages(String fileName,
+ int first_page,
+ int last_page,
+ double zoom)
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceRenderPages("my_document.pdf",
+ 0,
+ 9,
+ 1.0);
+
+
+.. _GhostNET_GetStatus:
+
+``GetStatus``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Returns the current :ref:`status<_GhostNET_Status>` of Ghostscript.
+
+
+.. code-block:: csharp
+
+ public gsStatus GetStatus()
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ gsStatus status = m_ghostscript.GetStatus();
+
+
+
+.. _GhostNET_Cancel:
+
+
+``Cancel``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Cancels :ref:`asynchronous<GhostNET_Delegates>` operations.
+
+
+.. code-block:: csharp
+
+ public void Cancel()
+
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.Cancel();
+
+
+
+.. _GhostNET_GhostscriptException:
+
+
+``GhostscriptException``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+An application developer can log any exceptions in this public class as required by editing the constructor.
+
+
+.. code-block:: csharp
+
+ public class GhostscriptException : Exception
+ {
+ public GhostscriptException(string message) : base(message)
+ {
+ // Report exceptions as required
+ }
+ }
+
+
+
+
+
+
+
+
+
+
+GhostMono
+=======================
+
+:title:`GhostMono` is the C# interface into the :title:`GhostAPI` library and is developed for Linux systems.
+
+As such :title:`GhostMono` is the Mono_ equivalent of :title:`GhostNET` with no dependency on a Windows environment.
+
+
+
+
+
+
+Enums
+--------
+
+
+Tasks
+~~~~~~~~~~~~~~~~
+
+The Ghostscript task type ``enum`` is used to inform :title:`GhostAPI` of the type of operation which is being requested.
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Task
+ - Description
+ * - ``PS_DISTILL``
+ - Task associated with converting a PostScript stream to a PDF document.
+ * - ``CREATE_XPS``
+ - Task associated with outputting a copy of a document to XPS.
+ * - ``SAVE_RESULT``
+ - Task associated with saving documents.
+ * - ``GET_PAGE_COUNT``
+ - Task associated with getting the page count of a document.
+ * - ``GENERIC``
+ - Generic task identifier.
+ * - ``DISPLAY_DEV_THUMBS``
+ - Display Device task associated with rendering thumbnails.
+ * - ``DISPLAY_DEV_NON_PDF``
+ - Display Device task associated with non-PDF or non-XPS rendering (see: :ref:`Ghostscript & Page Description Languages<gs_and_PDL>`).
+ * - ``DISPLAY_DEV_PDF``
+ - Display Device task associated with PDF & XPS rendering (see: :ref:`Ghostscript & Page Description Languages<gs_and_PDL>`).
+ * - ``DISPLAY_DEV_RUN_FILE``
+ - Display Device task associated with running files.
+
+
+Task types are defined as ``GS_Task_t``.
+
+
+.. code-block:: csharp
+
+ public enum GS_Task_t
+ {
+ PS_DISTILL,
+ CREATE_XPS,
+ SAVE_RESULT,
+ GET_PAGE_COUNT,
+ GENERIC,
+ DISPLAY_DEV_THUMBS,
+ DISPLAY_DEV_NON_PDF,
+ DISPLAY_DEV_PDF,
+ DISPLAY_DEV_RUN_FILE
+ }
+
+
+
+
+
+
+
+Results
+~~~~~~~~~~~~~~~~
+
+Result types are defined as ``GS_Result_t``.
+
+
+.. code-block:: csharp
+
+ public enum GS_Result_t
+ {
+ gsOK,
+ gsFAILED,
+ gsCANCELLED
+ }
+
+
+Status
+~~~~~~~~~~~~~~~~
+
+Status types are defined as ``gsStatus``.
+
+
+.. code-block:: csharp
+
+ public enum gsStatus
+ {
+ GS_READY,
+ GS_BUSY,
+ GS_ERROR
+ }
+
+
+
+The Parameter Struct
+-------------------------
+
+The parameter struct ``gsParamState_t`` allows for bundles of information to be processed by Ghostscript to complete overall requests.
+
+
+.. code-block:: csharp
+
+ public struct gsParamState_t
+ {
+ public String outputfile;
+ public String inputfile;
+ public GS_Task_t task;
+ public GS_Result_t result;
+ public int num_pages;
+ public List<int> pages;
+ public int firstpage;
+ public int lastpage;
+ public int currpage;
+ public List<String> args;
+ public int return_code;
+ public double zoom;
+ };
+
+
+Parameters explained
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Setting up your parameters (with any dedicated bespoke method(s) which your application requires) is needed when communicating directly with :title:`GhostAPI`.
+
+When requesting Ghostscript to process an operation an application developer should send a parameter payload which defines the details for the operation.
+
+For example in :title:`GhostMono` we can see the public method as follows:
+
+.. code-block:: csharp
+
+ public gsStatus DistillPS(String fileName, int resolution)
+ {
+ gsParamState_t gsparams = new gsParamState_t();
+ gsparams.args = new List<string>();
+
+ gsparams.inputfile = fileName;
+ gsparams.args.Add("gs");
+ gsparams.args.Add("-dNOPAUSE");
+ gsparams.args.Add("-dBATCH");
+ gsparams.args.Add("-I%rom%Resource/Init/");
+ gsparams.args.Add("-dSAFER");
+ gsparams.args.Add("-sDEVICE=pdfwrite");
+ gsparams.outputfile = Path.GetTempFileName();
+ gsparams.args.Add("-o" + gsparams.outputfile);
+ gsparams.task = GS_Task_t.PS_DISTILL;
+
+ return RunGhostscriptAsync(gsparams);
+ }
+
+
+Here we can see a parameter payload being setup before being passed on to the asynchronous method ``RunGhostscriptAsync`` which sets up a worker thread to run according to the task type in the payload.
+
+:title:`GhostMono` handles many common operations on an application developer's behalf, however if you require to write your own methods to interface with :title:`GhostAPI` then referring to the public methods in :title:`GhostMono` is a good starting point.
+
+For full documentation on parameters refer to :ref:`Ghostscript parameters in C<Use_Setting Parameters>`.
+
+
+
+
+The Event class
+--------------------
+
+:title:`GhostMono` contains a public class ``gsThreadCallBack``. This class is used to set and get callback information as they occur. :title:`GhostMono` will create these payloads and deliver them back to the application layer's ``ProgressCallBack`` method asynchronously.
+
+
+.. code-block:: csharp
+
+ public class gsThreadCallBack
+ {
+ private bool m_completed;
+ private int m_progress;
+ private gsParamState_t m_param;
+ public bool Completed
+ {
+ get { return m_completed; }
+ }
+ public gsParamState_t Params
+ {
+ get { return m_param; }
+ }
+ public int Progress
+ {
+ get { return m_progress; }
+ }
+ public gsThreadCallBack(bool completed, int progress, gsParamState_t param)
+ {
+ m_completed = completed;
+ m_progress = progress;
+ m_param = param;
+ }
+ }
+
+
+GSMONO
+----------
+
+This class should be instantiated as a member variable in your application with callback definitions setup as required.
+
+Handlers for asynchronous operations can injected by providing your own bespoke callback methods to your instance's ``ProgressCallBack`` function.
+
+
+.. code-block:: csharp
+
+ /* Set up Ghostscript with callbacks for system updates */
+ m_ghostscript = new GSMONO();
+ m_ghostscript.ProgressCallBack += new GSMONO.Progress(gsProgress);
+ m_ghostscript.StdIOCallBack += new GSMONO.StdIO(gsIO);
+ m_ghostscript.DLLProblemCallBack += new GSMONO.DLLProblem(gsDLL);
+ m_ghostscript.PageRenderedCallBack += new GSMONO.PageRendered(gsPageRendered);
+ m_ghostscript.DisplayDeviceOpen();
+
+ /* example callback stubs for asynchronous operations */
+ private void gsProgress(gsThreadCallBack asyncInformation)
+ {
+ Console.WriteLine($"gsProgress().progress:{asyncInformation.Progress}");
+
+ if (asyncInformation.Completed) // task complete
+ {
+ // what was the task?
+ switch (asyncInformation.Params.task)
+ {
+ case GS_Task_t.CREATE_XPS:
+ Console.WriteLine($"CREATE_XPS.outputfile:");
+ Console.WriteLine($"{asyncInformation.Params.result.outputfile}");
+ break;
+
+ case GS_Task_t.PS_DISTILL:
+ Console.WriteLine($"PS_DISTILL.outputfile:");
+ Console.WriteLine($"{asyncInformation.Params.result.outputfile}");
+ break;
+
+ case GS_Task_t.SAVE_RESULT:
+
+ break;
+
+ case GS_Task_t.DISPLAY_DEV_THUMBS:
+
+ break;
+
+ case GS_Task_t.DISPLAY_DEV_RUN_FILE:
+
+ break;
+
+ case GS_Task_t.DISPLAY_DEV_PDF:
+
+ break;
+
+ case GS_Task_t.DISPLAY_DEV_NON_PDF:
+
+ break;
+
+ default:
+
+ break;
+ }
+
+ // task failed
+ if (asyncInformation.Params.result == GS_Result_t.gsFAILED)
+ {
+ switch (asyncInformation.Params.task)
+ {
+ case GS_Task_t.CREATE_XPS:
+
+ break;
+
+ case GS_Task_t.PS_DISTILL:
+
+ break;
+
+ case GS_Task_t.SAVE_RESULT:
+
+ break;
+
+ default:
+
+ break;
+ }
+ return;
+ }
+
+ // task cancelled
+ if (asyncInformation.Params.result == GS_Result_t.gsCANCELLED)
+ {
+
+ }
+ }
+ else // task is still running
+ {
+ switch (asyncInformation.Params.task)
+ {
+ case GS_Task_t.CREATE_XPS:
+
+ break;
+
+ case GS_Task_t.PS_DISTILL:
+
+ break;
+
+ case GS_Task_t.SAVE_RESULT:
+
+ break;
+ }
+ }
+ }
+
+ private void gsIO(String message, int len)
+ {
+ Console.WriteLine($"gsIO().message:{message}, length:{len}");
+ }
+
+ private void gsDLL(String message)
+ {
+ Console.WriteLine($"gsDLL().message:{message}");
+ }
+
+ private void gsPageRendered(int width,
+ int height,
+ int raster,
+ IntPtr data,
+ gsParamState_t state)
+ {
+
+ };
+
+
+
+.. note::
+
+ Once a Ghostscript operation is in progress any defined callback functions will be called as the operation runs up unto completion. These callback methods are essential for your application to interpret activity events and react accordingly.
+
+
+An explanation of callbacks and the available public methods within :title:`GSMONO` are explained below.
+
+
+
+
+Delegates
+~~~~~~~~~~~~~~
+
+To handle *asynchronous events* :title:`GhostMONO` has four delegates which define callback methods that an application can assign to.
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Callback
+ - Description
+ * - ``DLLProblemCallBack``
+ - Occurs if there is some issue with the Ghostscript Shared Object (libgpdl.so)
+ * - ``StdIOCallBack``
+ - Occurs if Ghostscript outputs something to ``stderr`` or ``stdout``.
+ * - ``ProgressCallBack``
+ - Occurs as Ghostscript makes its way through a file.
+ * - ``PageRenderedCallBack``
+ - Occurs when a page has been rendered and the data from the display device is ready.
+
+
+
+``DLLProblemCallBack``
+"""""""""""""""""""""""""
+
+.. code-block:: csharp
+
+ internal delegate void DLLProblem(String mess);
+ internal event DLLProblem DLLProblemCallBack;
+
+
+``StdIOCallBack``
+""""""""""""""""""""""
+
+.. code-block:: csharp
+
+ internal delegate void StdIO(String mess,
+ int len);
+ internal event StdIO StdIOCallBack;
+
+``ProgressCallBack``
+""""""""""""""""""""""
+
+
+.. code-block:: csharp
+
+ internal delegate void Progress(gsEventArgs info);
+ internal event Progress ProgressCallBack;
+
+
+``PageRenderedCallBack``
+""""""""""""""""""""""""""""
+
+.. code-block:: csharp
+
+ internal delegate void PageRendered(int width,
+ int height,
+ int raster,
+ IntPtr data,
+ gsParamState_t state);
+ internal event PageRendered PageRenderedCallBack;
+
+
+
+
+
+``GetVersion``
+~~~~~~~~~~~~~~
+
+Use this method to get Ghostscript version info as a ``String``.
+
+
+.. code-block:: csharp
+
+ public String GetVersion()
+
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ String gs_vers = m_ghostscript.GetVersion();
+
+
+.. note::
+
+ An exception will be thrown if there is any issue with the Ghostscript DLL.
+
+
+
+
+
+
+``DisplayDeviceOpen``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets up the :ref:`display device<Devices_Display_Devices>` ahead of time.
+
+.. code-block:: csharp
+
+ public gsParamState_t DisplayDeviceOpen()
+
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceOpen();
+
+
+.. note::
+
+ Calling this method instantiates Ghostscript and configures the encoding and the callbacks for the display device.
+
+
+
+
+``DisplayDeviceClose``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Closes the :ref:`display device<Devices_Display_Devices>` and deletes the instance.
+
+
+.. code-block:: csharp
+
+ public gsParamState_t DisplayDeviceClose()
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceClose();
+
+
+.. note::
+
+ Calling this method :ref:`deletes Ghostscript<gsapi_delete_instance>`.
+
+
+
+
+``GetPageCount``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Use this method to get the number of pages in a supplied document.
+
+
+.. code-block:: csharp
+
+ public int GetPageCount(String fileName)
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ int page_number = m_ghostscript.GetPageCount("my_document.pdf");
+
+.. note::
+
+ If Ghostscript is unable to determine the page count then this method will return ``-1``.
+
+
+
+``DistillPS``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launches a thread rendering all the pages of a supplied PostScript file to a PDF.
+
+
+.. code-block:: csharp
+
+ public gsStatus DistillPS(String fileName, int resolution)
+
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DistillPS("my_postscript_document.ps", 300);
+
+
+
+``DisplayDeviceRenderAll``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launches a thread rendering all the document pages with the :ref:`display device<Devices_Display_Devices>`. For use with languages that can be indexed via pages which include PDF and XPS. (see: :ref:`Ghostscript & Page Description Languages<gs_and_PDL>`)
+
+
+.. code-block:: csharp
+
+ public gsStatus DisplayDeviceRenderAll(String fileName, double zoom, bool aa, GS_Task_t task)
+
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceRenderAll("my_document.pdf",
+ 0.1,
+ false,
+ GS_Task_t.DISPLAY_DEV_THUMBS_NON_PDF);
+
+
+
+``DisplayDeviceRenderThumbs``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launches a thread rendering all the pages with the :ref:`display device<Devices_Display_Devices>` to collect thumbnail images.
+
+Recommended zoom level for thumbnails is between 0.05 and 0.2, additionally anti-aliasing is probably not required.
+
+
+.. code-block:: csharp
+
+ public gsStatus DisplayDeviceRenderThumbs(String fileName,
+ double zoom,
+ bool aa)
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceRenderThumbs("my_document.pdf",
+ 0.1,
+ false);
+
+
+
+``DisplayDeviceRenderPages``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Launches a thread rendering a set of pages with the :ref:`display device<Devices_Display_Devices>`. For use with languages that can be indexed via pages which include PDF and XPS. (see: :ref:`Ghostscript & Page Description Languages<gs_and_PDL>`)
+
+
+.. code-block:: csharp
+
+ public gsStatus DisplayDeviceRenderPages(String fileName,
+ int first_page,
+ int last_page,
+ double zoom)
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ m_ghostscript.DisplayDeviceRenderPages("my_document.pdf",
+ 0,
+ 9,
+ 1.0);
+
+
+
+``GetStatus``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Returns the current :ref:`status<_GhostNET_Status>` of Ghostscript.
+
+
+.. code-block:: csharp
+
+ public gsStatus GetStatus()
+
+**Sample code:**
+
+.. code-block:: csharp
+
+ gsStatus status = m_ghostscript.GetStatus();
+
+
+
+``GhostscriptException``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+An application developer can log any exceptions in this public class as required by editing the constructor.
+
+
+.. code-block:: csharp
+
+ public class GhostscriptException : Exception
+ {
+ public GhostscriptException(string message) : base(message)
+ {
+ // Report exceptions as required
+ }
+ }
+
+
+
+
+.. _gs_and_PDL:
+
+
+.. note::
+
+ Ghostscript & Page Description Languages
+
+ Ghostscript handles the following `PDLs`_: PCL PDF PS XPS.
+
+ PCL and PS do not allow random access, meaning that, to print page 2 in a 100 page document, Ghostscript has to read the entire document stream of 100 pages.
+
+ On the other hand, PDF and XPS allow for going directly to page 2 and then only dealing with that content. The tasks ``DISPLAY_DEV_NON_PDF`` and ``DISPLAY_DEV_PDF`` keep track of what sort of input Ghostscript is dealing with and enables the application to direct progress or completion callbacks accordingly.
+
+
+
+
+
+
+
+
+
+
+.. External links
+
+.. _commercial license: https://artifex.com/licensing/commercial/
+.. _.NET: https://dotnet.microsoft.com/
+.. _Visual Studio: https://visualstudio.microsoft.com/
+.. _Mono: https://www.mono-project.com/
+.. _GhostPDL repository: https://ghostscript.com/releases/gpdldnld.html
+
+
+.. _PDLs: https://en.wikipedia.org/wiki/Page_description_language
+
diff --git a/doc/src/LanguageBindingsJava.rst b/doc/src/LanguageBindingsJava.rst
new file mode 100644
index 00000000..a17d52d2
--- /dev/null
+++ b/doc/src/LanguageBindingsJava.rst
@@ -0,0 +1,1415 @@
+.. title:: Java
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+
+Introduction
+==============
+
+In the ``GhostPDL`` repository sample Java projects can be found in ``/demos/java``.
+
+Within this location the following folders are of relevance:
+
+- :ref:`jni<jni: Building the Java Native Interface>` ``jni``
+- :ref:`gsjava<java gsjava>` ``gsjava``
+- :ref:`gstest<java gstest>` ``gstest``
+- :ref:`gsviewer<java gsviewer>` ``gsviewer``
+
+
+
+Platform & setup
+=======================
+
+
+Ghostscript should be built as a shared library for your platform.
+
+See :ref:`Building Ghostscript<Building Ghostscript>`.
+
+
+
+jni: Building the Java Native Interface
+--------------------------------------------------
+
+Before building the JNI ensure that Ghostscript has already been built for your platform and that you have JDK installed.
+
+The JNI is for use in the Java interface, this object must be placed somewhere on your Java ``PATH``. On Windows, the DLL can be placed in the working directory, next to ``gsjava.jar``.
+
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Platform
+ - JNI file
+ * - Windows
+ - ``gs_jni.dll``
+ * - MacOS
+ - ``gs_jni.dylib``
+ * - Linux / OpenBSD
+ - ``gs_jni.so``
+
+
+Preparing your include folder
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The build scripts require the header ``jni.h``, which defines all JNI functions, and ``jni_md.h``, which defines all system-specific integer types. The build scripts expect an include folder relative to their location which contain these header files from your system.
+
+These headers are typically found in the following directories:
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Platform
+ - jni.h
+ - jni_md.h
+ * - Windows
+ - C:\Program Files\Java\<JDK Install>\include\jni.h
+ - C:\Program Files\Java\<JDK Install>\include\win32\jni_md.h
+ * - MacOS
+ - /Library/Java/JavaVirtualMachines/<JDK Install>/Contents/Home/include/jni.h
+ - /Library/Java/JavaVirtualMachines/<JDK Install>/Contents/Home/include/darwin/jni_md.h
+ * - Linux
+ - /lib/jvm/<JDK Install>/include/jni.h
+ - /lib/jvm/<JDK Install>/include/linux/jni_md.h
+
+
+
+Once your ``include`` folder has been located folder you can copy it and place it in your ``ghostpdl/demos/java/jni/gs_jni`` folder.
+
+Your build scripts should now be ready to run as they will be able to find the required JNI header files in their own relative include folder.
+
+Building on Windows
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The ``jni`` folder contains a Visual Studio Solution file ``/jni/gs_jni/gs_jni.sln`` which you should use to build the required JNI ``gs_jni.dll`` library file.
+
+With the project open in Visual Studio, select the required architecture from the drop down - then right click on 'gs_jni' in the solution explorer and choose "Build".
+
+
+Building on MacOS
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+On your command line, navigate to ``ghostpdl/demos/java/jni/gs_jni`` and ensure that the build script is executable and then run it, with:
+
+.. code-block:: bash
+
+ chmod +x build_darwin.sh
+ ./build_darwin.sh
+
+
+Building on Linux
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+On your command line, navigate to ``ghostpdl/demos/java/jni/gs_jni`` and ensure that the build script is executable and then run it, with:
+
+.. code-block:: bash
+
+ chmod +x build_linux.sh
+ ./build_linux.sh
+
+
+
+gsjava: Building the JAR
+---------------------------------
+
+``gsjava.jar`` is the Java library which contains classes and interfaces which enable API calls required to use Ghostscript.
+
+Assuming that the JAR for your project has been built and properly linked with your own project then the Ghostscript API should be available by importing the required classes within your project's ``.java`` files.
+
+
+
+Building with the command line
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Navigate to ``ghostpdl/demos/java/gsjava`` and use the following:
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Platform
+ - Run file
+ * - Windows
+ - build_win32.bat
+ * - MacOS
+ - build_darwin.sh
+ * - Linux
+ - build_linux.sh
+
+.. note::
+
+ ``gsjava`` has a dependency on ``jni``, please ensure that :ref:`gs_jni<jni: Building the Java Native Interface>` is able to be built beforehand.
+
+
+
+Building with Eclipse
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Alternatively you can use Eclipse_ to build the JAR file.
+
+Using Eclipse_ import the source folder ``gsjava`` as a project and select ``Export > Java > JAR File`` as shown in the screenshot example below:
+
+
+.. note we embedd the image with raw HTML because Sphinx is incapable of doing percentage style widths ... :(
+
+.. raw:: html
+
+ <img src="_static/export-jar.png" width=70%/>
+
+
+
+
+Linking the JAR
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The built JAR should be properly linked within your project Java Build Path as follows:
+
+
+.. raw:: html
+
+ <img src="_static/linking-jar.png" width=80%/>
+
+
+
+Demo projects
+==================
+
+.. _java gstest:
+
+gstest
+----------------------------------------
+
+Use this to quickly test Ghostscript methods.
+
+This project can be opened in Eclipse and used to test the Ghostscript API. The sample here simply sets up an instance of Ghostscript and then sets and gets some parameters accordingly.
+
+
+
+.. _java gsviewer:
+
+gsviewer
+------------------------------------
+
+A handy file viewer.
+
+This project can be used to test the Ghostscript API alongside a UI which handles opening PostScript and PDF files. The sample application here allows for file browsing and Ghostscript file viewing.
+
+Below is a screenshot of the sample application with a PDF open:
+
+
+.. raw:: html
+
+ <img src="_static/gsviewer.png" width=100%/>
+
+
+
+To run the project navigate to the ``demos/java/gsviewer`` location and ensure that the required libraries are in the directory:
+
+
+.. list-table::
+ :header-rows: 1
+ :widths: 15 70 15
+
+ * - Platform
+ - Ghostscript library file
+ - JNI library file
+ * - Windows
+ - ``gpdldll64.dll``
+ - ``gs_jni.dll``
+ * - MacOS
+ - ``libgpdl.dylib``
+ - ``gs_jni.dylib``
+ * - Linux / OpenBSD
+ - ``libgpdl.so`` (this may have been built as ``libgs.so``,
+
+ so it should be copied into this directory and
+
+ renamed to ``libgpdl.so``)
+ - ``gs_jni.so``
+
+
+Building on Windows
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Run the ``build_win32.bat`` script.
+
+Running on Windows
+~~~~~~~~~~~~~~~~~~~~~~~
+
+To run, open ``gsviewer.jar`` either through File Explorer or in the command line through the following command:
+
+
+.. code-block:: bash
+
+ java -jar gsviewer.jar
+
+
+Building on MacOS
+~~~~~~~~~~~~~~~~~~~~~~~
+
+On your command line, navigate to ``ghostpdl/demos/java/gsviewer`` and ensure that the build script is executable and then run it, with:
+
+.. code-block:: bash
+
+ chmod +x build_darwin.sh
+ ./build_darwin.sh
+
+This will automatically ``build gs_jni.dylib`` (in the ``ghostpdl/demos/java/jni/gs_jni/`` location) and ``gsjava.jar`` ``gsviewer.jar`` in the ``gsviewer`` directory.
+
+
+Running on MacOS
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Ensure that the Ghostscript library exists in the ``gsviewer`` directory. (Copy and move the built library from ``ghostpdl/sobin`` as required).
+
+Ensure that the run script is executable and then run it, with:
+
+.. code-block:: bash
+
+ chmod +x start_darwin.sh
+ ./start_darwin.sh
+
+
+Building on Linux
+~~~~~~~~~~~~~~~~~~~~~~~
+
+On your command line, navigate to ``ghostpdl/demos/java/gsviewer`` and ensure that the build script is executable and then run it, with:
+
+.. code-block:: bash
+
+ chmod +x build_linux.sh
+ ./build_linux.sh
+
+This will automatically build ``gs_jni.so`` (in the ``ghostpdl/demos/java/jni/gs_jni/`` location) and ``gsjava.jar`` ``gsviewer.jar`` in the ``gsviewer`` directory.
+
+
+.. note::
+
+ On Linux, when using OpenJDK, the property "assistive_technologies" may need to be modified for the Java code to build. It can be modified by editing the "accessibility.properties" file. This is located at:
+
+ ``/etc/java-8-openjdk/accessibility.properties``
+
+
+Running on Linux
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Ensure that the Ghostscript library exists in the ``gsviewer`` directory. (Copy and move the built library from ``ghostpdl/sobin`` as required).
+
+Ensure that the run script is executable and then run it, with:
+
+.. code-block:: bash
+
+ chmod +x start_linux.sh
+ ./start_linux.sh
+
+
+
+.. _java gsjava:
+
+Using the Java library
+==================================
+
+
+gsjava
+----------
+
+There are two main classes within the ``gsjava.jar`` library to consider:
+
+
+GSAPI & GSInstance
+---------------------
+
+:title:`GSAPI` is the main Ghostscript API class which bridges into the :ref:`Ghostscript C library<API.htm exported functions>`.
+
+:title:`GSInstance` is a wrapper class for :title:`GSAPI` which encapsulates an instance of Ghostscript and allows for simpler API calls.
+
+
+**Sample code:**
+
+
+.. code-block:: java
+
+ // to use GSAPI
+ import static com.artifex.gsjava.GSAPI.*;
+
+ // to use GSInstance
+ import com.artifex.gsjava.GSInstance;
+
+
+GSAPI
+--------
+
+
+.. _java gsapi_revision:
+
+``gsapi_revision``
+~~~~~~~~~~~~~~~~~~~~
+
+This method returns the revision numbers and strings of the Ghostscript interpreter library; you should call it before any other interpreter library functions to make sure that the correct version of the Ghostscript interpreter has been loaded.
+
+
+.. code-block:: java
+
+ public static native int gsapi_revision(GSAPI.Revision revision,
+ int len);
+
+.. note::
+
+ The method should write to a reference variable which conforms to the class ``GSAPI.Revision``.
+
+``GSAPI.Revision``
+""""""""""""""""""""""
+
+This class is used to store information about Ghostscript and provides handy getters for the product and the copyright information.
+
+
+
+.. code-block:: java
+
+ public static class Revision {
+ public volatile byte[] product;
+ public volatile byte[] copyright;
+ public volatile long revision;
+ public volatile long revisionDate;
+
+ public Revision() {
+ this.product = null;
+ this.copyright = null;
+ this.revision = 0L;
+ this.revisionDate = 0L;
+ }
+
+ /**
+ * Returns the product information as a String.
+ *
+ * @return The product information.
+ */
+ public String getProduct() {
+ return new String(product);
+ }
+
+ /**
+ * Returns the copyright information as a String.
+ *
+ * @return The copyright information.
+ */
+ public String getCopyright() {
+ return new String(copyright);
+ }
+ }
+
+
+.. _java gsapi_new_instance:
+
+``gsapi_new_instance``
+~~~~~~~~~~~~~~~~~~~~~~~
+
+Creates a new instance of Ghostscript. This instance is passed to most other :title:`GSAPI` methods. Unless Ghostscript has been compiled with the ``GS_THREADSAFE`` define, only one instance at a time is supported.
+
+.. code-block:: java
+
+ public static native int gsapi_new_instance(Reference<Long> instance,
+ long callerHandle);
+
+.. note::
+
+ The method returns a reference which represents your instance of Ghostscript.
+
+
+.. _java gsapi_delete_instance:
+
+
+``gsapi_delete_instance``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Destroy an instance of Ghostscript. Before you call this, Ghostscript must have finished. If Ghostscript has been initialised, you should call :ref:`gsapi_exit<java gsapi_exit>` beforehand.
+
+
+.. code-block:: java
+
+ public static native void gsapi_delete_instance(long instance);
+
+
+
+.. _java gsapi_set_stdio_with_handle:
+
+``gsapi_set_stdio_with_handle``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback functions for ``stdio``, together with the handle to use in the callback functions. The ``stdin`` callback function should return the number of characters read, ``0`` for ``EOF``, or ``-1`` for ``error``. The ``stdout`` and ``stderr`` callback functions should return the number of characters written.
+
+
+.. code-block:: java
+
+ public static native int gsapi_set_stdio_with_handle(long instance,
+ IStdInFunction stdin,
+ IStdOutFunction stdout,
+ IStdErrFunction stderr,
+ long callerHandle);
+
+
+.. _java gsapi_set_stdio:
+
+``gsapi_set_stdio``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback functions for ``stdio``. The handle used in the callbacks will be taken from the value passed to :ref:`gsapi_new_instance<java gsapi_new_instance>`. Otherwise the behaviour of this function matches :ref:`gsapi_set_stdio_with_handle<java gsapi_set_stdio_with_handle>`.
+
+
+.. code-block:: java
+
+ public static native int gsapi_set_stdio(long instance,
+ IStdInFunction stdin,
+ IStdOutFunction stdout,
+ IStdErrFunction stderr);
+
+
+
+
+.. _java gsapi_set_poll_with_handle:
+
+``gsapi_set_poll_with_handle``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback function for polling, together with the handle to pass to the callback function. This function will only be called if the Ghostscript interpreter was compiled with ``CHECK_INTERRUPTS`` as described in ``gpcheck.h``.
+
+The polling function should return zero if all is well, and return negative if it wants Ghostscript to abort. This is often used for checking for a user cancel. This can also be used for handling window events or cooperative multitasking.
+
+The polling function is called very frequently during interpretation and rendering so it must be fast. If the function is slow, then using a counter to ``return 0`` immediately some number of times can be used to reduce the performance impact.
+
+.. code-block:: java
+
+ public static native int gsapi_set_poll_with_handle(long instance,
+ IPollFunction pollfun,
+ long callerHandle);
+
+
+
+.. _java gsapi_set_poll:
+
+``gsapi_set_poll``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the callback function for polling. The handle passed to the callback function will be taken from the handle passed to :ref:`gsapi_new_instance<java gsapi_new_instance>`. Otherwise the behaviour of this function matches :ref:`gsapi_set_poll_with_handle<java gsapi_set_poll_with_handle>`.
+
+.. code-block:: java
+
+ public static native int gsapi_set_poll(long instance,
+ IPollFunction pollfun);
+
+
+.. _java gsapi_set_display_callback:
+
+``gsapi_set_display_callback``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This call is deprecated; please use :ref:`gsapi_register_callout<java gsapi_register_callout>` to register a callout handler for the display device in preference.
+
+
+.. code-block:: java
+
+ public static native int gsapi_set_display_callback(long instance,
+ DisplayCallback displayCallback);
+
+
+.. _java gsapi_register_callout:
+
+``gsapi_register_callout``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This call registers a callout handler.
+
+.. code-block:: java
+
+ public static native int gsapi_register_callout(long instance,
+ ICalloutFunction callout,
+ long calloutHandle);
+
+
+.. _java gsapi_deregister_callout:
+
+``gsapi_deregister_callout``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This call deregisters a callout handler previously registered with :ref:`gsapi_register_callout<java gsapi_register_callout>`. All three arguments must match exactly for the callout handler to be deregistered.
+
+.. code-block:: java
+
+ public static native void gsapi_deregister_callout(long instance,
+ ICalloutFunction callout,
+ long calloutHandle);
+
+
+.. _java gsapi_set_arg_encoding:
+
+``gsapi_set_arg_encoding``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the encoding used for the interpretation of all subsequent arguments supplied via the GSAPI_ interface on this instance. By default we expect args to be in encoding 0 (the 'local' encoding for this OS). On Windows this means "the currently selected codepage". This means that omitting to call this function will leave Ghostscript running exactly as it always has. Please note that use of the 'local' encoding is now deprecated and should be avoided in new code. This must be called after :ref:`gsapi_new_instance<java gsapi_new_instance>` and before :ref:`gsapi_init_with_args<java gsapi_init_with_args>`.
+
+
+.. code-block:: java
+
+ public static native int gsapi_set_arg_encoding(long instance,
+ int encoding);
+
+
+.. _java gsapi_set_default_device_list:
+
+``gsapi_set_default_device_list``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Set the string containing the list of default device names, for example "display x11alpha x11 bbox". Allows the calling application to influence which device(s) Ghostscript will try, in order, in its selection of the default device. This must be called after :ref:`gsapi_new_instance<java gsapi_new_instance>` and before :ref:`gsapi_init_with_args<java gsapi_init_with_args>`.
+
+
+.. code-block:: java
+
+ public static native int gsapi_set_default_device_list(long instance,
+ byte[] list,
+ int listlen);
+
+
+.. _java gsapi_get_default_device_list:
+
+``gsapi_get_default_device_list``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Returns a pointer to the current default device string. This must be called after :ref:`gsapi_new_instance<java gsapi_new_instance>` and before :ref:`gsapi_init_with_args<java gsapi_init_with_args>`.
+
+
+.. code-block:: java
+
+ public static native int gsapi_get_default_device_list(long instance,
+ Reference<byte[]> list,
+ Reference<Integer> listlen);
+
+
+.. _java gsapi_init_with_args:
+
+
+``gsapi_init_with_args``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To initialise the interpreter, pass your ``instance`` of Ghostscript, your argument count: ``argc``, and your argument variables: ``argv``.
+
+
+.. code-block:: java
+
+ public static native int gsapi_init_with_args(long instance,
+ int argc,
+ byte[][] argv);
+
+.. note::
+
+ There are also simpler utility methods which eliminates the need to send through your argument count and allows for simpler ``String`` passing for your argument array.
+
+ *Utility methods*:
+
+ .. code-block:: java
+
+ public static int gsapi_init_with_args(long instance,
+ String[] argv);
+
+ public static int gsapi_init_with_args(long instance,
+ List<String> argv);
+
+
+
+
+.. _java gsapi_run_asterisk:
+
+``gsapi_run_*``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If these functions return ``<= -100``, either quit or a fatal error has occured. You must call :ref:`java gsapi_exit<gsapi_exit>` next. The only exception is :ref:`gsapi_run_string_continue<java gsapi_run_string_continue>` which will return ``gs_error_NeedInput`` if all is well.
+
+There is a 64 KB length limit on any buffer submitted to a ``gsapi_run_*`` function for processing. If you have more than 65535 bytes of input then you must split it into smaller pieces and submit each in a separate :ref:`gsapi_run_string_continue<java gsapi_run_string_continue>` call.
+
+
+.. _java gsapi_run_string_begin:
+
+
+``gsapi_run_string_begin``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+.. code-block:: java
+
+ public static native int gsapi_run_string_begin(long instance,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+.. _java gsapi_run_string_continue:
+
+``gsapi_run_string_continue``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public static native int gsapi_run_string_continue(long instance,
+ byte[] str,
+ int length,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+.. note::
+
+ There is a simpler utility method which allows for simpler ``String`` passing for the ``str`` argument.
+
+ *Utility method*:
+
+ .. code-block:: java
+
+ public static int gsapi_run_string_continue(long instance,
+ String str,
+ int length,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+.. _java gsapi_run_string_with_length:
+
+``gsapi_run_string_with_length``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public static native int gsapi_run_string_with_length(long instance,
+ byte[] str,
+ int length,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+.. note::
+
+ There is a simpler utility method which allows for simpler ``String`` passing for the ``str`` argument.
+
+ *Utility method*:
+
+ .. code-block:: java
+
+ public static int gsapi_run_string_with_length(long instance,
+ String str,
+ int length,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+.. _java gsapi_run_string:
+
+
+``gsapi_run_string``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public static native int gsapi_run_string(long instance,
+ byte[] str,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+.. note::
+
+ There is a simpler utility method which allows for simpler ``String`` passing for the ``str`` argument.
+
+ *Utility method*:
+
+ .. code-block:: java
+
+ public static int gsapi_run_string(long instance,
+ String str,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+.. _java gsapi_run_string_end:
+
+
+``gsapi_run_string_end``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public static native int gsapi_run_string_end(long instance,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+.. _java gsapi_run_file:
+
+``gsapi_run_file``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public static native int gsapi_run_file(long instance,
+ byte[] fileName,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+.. note::
+
+ There is a simpler utility method which allows for simpler ``String`` passing for the ``fileName`` argument.
+
+ *Utility method*:
+
+ .. code-block:: java
+
+ public static int gsapi_run_file(long instance,
+ String fileName,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+.. _java gsapi_exit:
+
+
+``gsapi_exit``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Exit the interpreter. This must be called on shutdown if :ref:`gsapi_init_with_args<java gsapi_init_with_args>` has been called, and just before :ref:`gsapi_delete_instance<java gsapi_delete_instance>`.
+
+.. code-block:: java
+
+ public static native int gsapi_exit(long instance);
+
+
+
+.. _java gsapi_set_param:
+
+``gsapi_set_param``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Sets a parameter. Broadly, this is equivalent to setting a parameter using ``-d``, ``-s`` or ``-p`` on the command line. This call cannot be made during a :ref:`gsapi_run_string<java gsapi_run_string>` operation.
+
+Parameters in this context are not the same as 'arguments' as processed by :ref:`gsapi_init_with_args<java gsapi_init_with_args>`, but often the same thing can be achieved. For example, with :ref:`gsapi_init_with_args<java gsapi_init_with_args>`, we can pass "-r200" to change the resolution. Broadly the same thing can be achieved by using :ref:`gsapi_set_param<java gsapi_set_param>` to set a parsed value of "<</HWResolution [ 200.0 200.0 ]>>".
+
+Internally, when we set a parameter, we perform an ``initgraphics`` operation. This means that using :ref:`gsapi_set_param<java gsapi_set_param>` other than at the start of a page is likely to give unexpected results.
+
+Attempting to set a parameter that the device does not recognise will be silently ignored, and that parameter will not be found in subsequent :ref:`gsapi_get_param<java gsapi_get_param>` calls.
+
+
+.. code-block:: java
+
+ public static native int gsapi_set_param(long instance,
+ byte[] param,
+ Object value,
+ int paramType);
+
+.. note::
+
+ For more on the C implementation of parameters see: :ref:`Ghostscript parameters in C<Use_Setting Parameters>`.
+
+ There are also simpler utility methods which allows for simpler String passing for your arguments.
+
+ *Utility methods*:
+
+
+ .. code-block:: java
+
+ public static int gsapi_set_param(long instance,
+ String param,
+ String value,
+ int paramType);
+
+ public static int gsapi_set_param(long instance,
+ String param,
+ Object value,
+ int paramType);
+
+
+.. _java gsapi_get_param:
+
+``gsapi_get_param``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Retrieve the current value of a parameter.
+
+If an error occurs, the return value is negative. Otherwise the return value is the number of bytes required for storage of the value. Call once with value ``NULL`` to get the number of bytes required, then call again with value pointing to at least the required number of bytes where the value will be copied out. Note that the caller is required to know the type of value in order to get it. For all types other than ``gs_spt_string``, ``gs_spt_name``, and ``gs_spt_parsed`` knowing the type means you already know the size required.
+
+This call retrieves parameters/values that have made it to the device. Thus, any values set using ``gs_spt_more_to_come`` without a following call omitting that flag will not be retrieved. Similarly, attempting to get a parameter before :ref:`gsapi_init_with_args<java gsapi_init_with_args>` has been called will not list any, even if :ref:`gsapi_set_param<java gsapi_set_param>` has been used.
+
+Attempting to read a parameter that is not set will return ``gs_error_undefined`` (-21). Note that calling :ref:`gsapi_set_param<java gsapi_set_param>` followed by :ref:`gsapi_get_param<java gsapi_get_param>` may not find the value, if the device did not recognise the key as being one of its configuration keys.
+
+For further documentation please refer to :ref:`the C API<API_gsapi_get_param>`.
+
+
+.. code-block:: java
+
+ public static native int gsapi_get_param(long instance,
+ byte[] param,
+ long value,
+ int paramType);
+.. note::
+
+ There is a simpler utility method which allows for simpler ``String`` passing for the ``param`` argument.
+
+ *Utility method*:
+
+ .. code-block:: java
+
+ public static int gsapi_get_param(long instance,
+ String param,
+ long value,
+ int paramType);
+
+
+.. _java gsapi_enumerate_params:
+
+``gsapi_enumerate_params``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enumerate the current parameters. Call repeatedly to list out the current parameters.
+
+The first call should have ``iter = NULL``. Subsequent calls should pass the same pointer in so the iterator can be updated. Negative return codes indicate error, 0 success, and 1 indicates that there are no more keys to read. On success, key will be updated to point to a null terminated string with the key name that is guaranteed to be valid until the next call to :ref:`gsapi_enumerate_params<java gsapi_enumerate_params>`. If type is non ``NULL`` then the pointer type will be updated to have the type of the parameter.
+
+.. note::
+
+ Only one enumeration can happen at a time. Starting a second enumeration will reset the first.
+
+The enumeration only returns parameters/values that have made it to the device. Thus, any values set using the ``gs_spt_more_to_come`` without a following call omitting that flag will not be retrieved. Similarly, attempting to enumerate parameters before :ref:`gsapi_init_with_args<java gsapi_init_with_args>` has been called will not list any, even if :ref:`gsapi_set_param<java gsapi_set_param>` has been used.
+
+
+.. code-block:: java
+
+ public static native int gsapi_enumerate_params(long instance,
+ Reference<Long> iter,
+ Reference<byte[]> key,
+ Reference<Integer> paramType);
+
+
+.. _java gsapi_add_control_path:
+
+``gsapi_add_control_path``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Add a (case sensitive) path to one of the lists of :ref:`permitted paths<Use Safer>` for file access.
+
+
+.. code-block:: java
+
+ public static native int gsapi_add_control_path(long instance,
+ int type,
+ byte[] path);
+
+.. note::
+ There is a simpler utility method which allows for simpler ``String`` passing for the ``path`` argument.
+
+ *Utility method*:
+
+ .. code-block:: java
+
+ public static int gsapi_add_control_path(long instance,
+ int type,
+ String path);
+
+
+
+.. _java gsapi_remove_control_path:
+
+``gsapi_remove_control_path``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Remove a (case sensitive) path from one of the lists of :ref:`permitted paths<Use Safer>` for file access.
+
+
+.. code-block:: java
+
+ public static native int gsapi_remove_control_path(long instance,
+ int type,
+ byte[] path);
+.. note::
+
+ There is a simpler utility method which allows for simpler ``String`` passing for the ``path`` argument.
+
+ *Utility method*:
+
+ .. code-block:: java
+
+ public static int gsapi_remove_control_path(long instance,
+ int type,
+ String path);
+
+
+
+.. _java gsapi_purge_control_paths:
+
+``gsapi_purge_control_paths``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Clear all the paths from one of the lists of :ref:`permitted paths<Use Safer>` for file access.
+
+.. code-block:: java
+
+ public static native void gsapi_purge_control_paths(long instance,
+ int type);
+
+
+.. _java gsapi_activate_path_control:
+
+``gsapi_activate_path_control``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Enable/Disable path control (i.e. whether paths are checked against :ref:`permitted paths<Use Safer>` before access is granted).
+
+.. code-block:: java
+
+ public static native void gsapi_activate_path_control(long instance,
+ boolean enable);
+
+
+.. _java gsapi_is_path_control_active:
+
+
+``gsapi_is_path_control_active``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Query whether path control is activated or not.
+
+
+.. code-block:: java
+
+ public static native boolean gsapi_is_path_control_active(long instance);
+
+
+
+Callback & Callout interfaces
+--------------------------------------
+
+``gsjava.jar`` also defines some functional interfaces for callbacks & callouts with package ``com.artifex.gsjava.callback`` which are defined as follows.
+
+
+``IStdInFunction``
+~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public interface IStdInFunction {
+ /**
+ * @param callerHandle The caller handle.
+ * @param buf A string represented by a byte array.
+ * @param len The number of bytes to read.
+ * @return The number of bytes read, must be <code>len</code>/
+ */
+ public int onStdIn(long callerHandle,
+ byte[] buf,
+ int len);
+ }
+
+
+``IStdOutFunction``
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public interface IStdOutFunction {
+ /**
+ * Called when something should be written to the standard
+ * output stream.
+ *
+ * @param callerHandle The caller handle.
+ * @param str The string represented by a byte array to write.
+ * @param len The number of bytes to write.
+ * @return The number of bytes written, must be <code>len</code>.
+ */
+ public int onStdOut(long callerHandle,
+ byte[] str,
+ int len);
+ }
+
+
+``IStdErrFunction``
+~~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public interface IStdErrFunction {
+ /**
+ * Called when something should be written to the standard error stream.
+ *
+ * @param callerHandle The caller handle.
+ * @param str The string represented by a byte array to write.
+ * @param len The length of bytes to be written.
+ * @return The amount of bytes written, must be <code>len</code>.
+ */
+ public int onStdErr(long callerHandle,
+ byte[] str,
+ int len);
+ }
+
+
+``IPollFunction``
+~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public interface IPollFunction {
+ public int onPoll(long callerHandle);
+ }
+
+
+``ICalloutFunction``
+~~~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public interface ICalloutFunction {
+ public int onCallout(long instance,
+ long calloutHandle,
+ byte[] deviceName,
+ int id,
+ int size,
+ long data);
+ }
+
+
+
+GSInstance
+---------------
+
+This is a utility class which makes Ghostscript calls easier by storing a Ghostscript instance and, optionally, a caller handle. Essentially the class acts as a handy wrapper for the standard GSAPI_ methods.
+
+
+Constructors
+~~~~~~~~~~~~~~~~~~~~
+
+.. code-block:: java
+
+ public GSInstance() throws IllegalStateException;
+ public GSInstance(long callerHandle) throws IllegalStateException;
+
+
+``delete_instance``
+~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_delete_instance<java gsapi_delete_instance>`.
+
+.. code-block:: java
+
+ public void delete_instance();
+
+
+``set_stdio``
+~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_set_stdio<java gsapi_set_stdio>`.
+
+.. code-block:: java
+
+ public int set_stdio(IStdInFunction stdin,
+ IStdOutFunction stdout,
+ IStdErrFunction stderr);
+
+``set_poll``
+~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_set_poll<java gsapi_set_poll>`.
+
+.. code-block:: java
+
+ public int set_poll(IPollFunction pollfun);
+
+
+``set_display_callback``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_set_display_callback<java gsapi_set_display_callback>`.
+
+.. code-block:: java
+
+ public int set_display_callback(DisplayCallback displaycallback);
+
+
+``register_callout``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_register_callout<java gsapi_register_callout>`.
+
+.. code-block:: java
+
+ public int register_callout(ICalloutFunction callout);
+
+
+``deregister_callout``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_deregister_callout<java gsapi_deregister_callout>`.
+
+.. code-block:: java
+
+ public void deregister_callout(ICalloutFunction callout);
+
+
+``set_arg_encoding``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_set_arg_encoding<java gsapi_set_arg_encoding>`.
+
+.. code-block:: java
+
+ public int set_arg_encoding(int encoding);
+
+
+``set_default_device_list``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_set_default_device_list<java gsapi_set_default_device_list>`.
+
+.. code-block:: java
+
+ public int set_default_device_list(byte[] list,
+ int listlen);
+
+
+``get_default_device_list``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Wraps :ref:`gsapi_get_default_device_list<java gsapi_get_default_device_list>`.
+
+.. code-block:: java
+
+ public int get_default_device_list(Reference<byte[]> list,
+ Reference<Integer> listlen);
+
+``init_with_args``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_init_with_args<java gsapi_init_with_args>`.
+
+.. code-block:: java
+
+ public int init_with_args(int argc,
+ byte[][] argv);
+
+ public int init_with_args(String[] argv);
+
+ public int init_with_args(List<String> argv);
+
+
+
+``run_string_begin``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_run_string_begin<java gsapi_run_string_begin>`.
+
+.. code-block:: java
+
+ public int run_string_begin(int userErrors,
+ Reference<Integer> pExitCode);
+
+``run_string_continue``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_run_string_continue<java gsapi_run_string_continue>`.
+
+.. code-block:: java
+
+ public int run_string_continue(byte[] str,
+ int length,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+ public int run_string_continue(String str,
+ int length,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+``run_string``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_run_string<java gsapi_run_string>`.
+
+
+.. code-block:: java
+
+ public int run_string(byte[] str,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+ public int run_string(String str,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+``run_file``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_run_file<java gsapi_run_file>`.
+
+
+.. code-block:: java
+
+ public int run_file(byte[] fileName,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+ public int run_file(String filename,
+ int userErrors,
+ Reference<Integer> pExitCode);
+
+
+``exit``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_exit<java gsapi_exit>`.
+
+.. code-block:: java
+
+ public int exit();
+
+
+``set_param``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_set_param<java gsapi_set_param>`.
+
+.. code-block:: java
+
+ public int set_param(byte[] param,
+ Object value,
+ int paramType);
+
+ public int set_param(String param,
+ String value,
+ int paramType);
+
+ public int set_param(String param,
+ Object value,
+ int paramType);
+
+
+``get_param``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_get_param<java gsapi_get_param>`.
+
+
+.. code-block:: java
+
+ public int get_param(byte[] param,
+ long value,
+ int paramType);
+
+ public int get_param(String param,
+ long value,
+ int paramType);
+
+``enumerate_params``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_enumerate_params<java gsapi_enumerate_params>`.
+
+.. code-block:: java
+
+ public int enumerate_params(Reference<Long> iter,
+ Reference<byte[]> key,
+ Reference<Integer> paramType);
+
+
+
+``add_control_path``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_add_control_path<java gsapi_add_control_path>`.
+
+
+.. code-block:: java
+
+ public int add_control_path(int type,
+ byte[] path);
+
+ public int add_control_path(int type,
+ String path);
+
+
+``remove_control_path``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_remove_control_path<java gsapi_remove_control_path>`.
+
+
+.. code-block:: java
+
+ public int remove_control_path(int type,
+ byte[] path);
+
+ public int remove_control_path(int type,
+ String path);
+
+``purge_control_paths``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_purge_control_paths<java gsapi_purge_control_paths>`.
+
+
+.. code-block:: java
+
+ public void purge_control_paths(int type);
+
+
+``activate_path_control``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_activate_path_control<java gsapi_activate_path_control>`.
+
+.. code-block:: java
+
+ public void activate_path_control(boolean enable);
+
+
+``is_path_control_active``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Wraps :ref:`gsapi_is_path_control_active<java gsapi_is_path_control_active>`.
+
+.. code-block:: java
+
+ public boolean is_path_control_active();
+
+
+Utility classes
+------------------
+
+The ``com.artifex.gsjava.util`` package contains a set of classes and interfaces which are used throughout the API.
+
+``com.artifex.gsjava.util.Reference``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``Reference<T>`` is used in many of the Ghostscript calls, it stores a reference to a generic value of type ``T``. This class exists to emulate pointers being passed to a native function. Its value can be fetched with ``getValue()`` and set with ``setValue(T value)``.
+
+
+.. code-block:: java
+
+ public class Reference<T> {
+
+ private volatile T value;
+
+ public Reference() {
+ this(null);
+ }
+
+ public Reference(T value) {
+ this.value = value;
+ }
+
+ public void setValue(T value) {
+ this.value = value;
+ }
+
+ public T getValue() {
+ return value;
+ }
+ ...
+ }
+
+.. External links
+
+.. _Eclipse: https://www.eclipse.org/eclipseide/
diff --git a/doc/src/LanguageBindingsPython.rst b/doc/src/LanguageBindingsPython.rst
new file mode 100644
index 00000000..6330dc17
--- /dev/null
+++ b/doc/src/LanguageBindingsPython.rst
@@ -0,0 +1,969 @@
+.. title:: Python
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+
+Introduction
+=================
+
+The Python API is provided by the file :ref:`gsapi.py<python gsapi>` - this is the binding to the :ref:`Ghostscript C library<API.htm exported functions>`.
+
+In the :title:`GhostPDL` repository sample Python examples can be found in ``/demos/python/examples.py``.
+
+
+Platform & setup
+=======================
+
+
+Ghostscript should be built as a shared library for your platform.
+
+See :ref:`Building Ghostscript<Building Ghostscript>`.
+
+
+
+Specifying the Ghostscript shared library
+-------------------------------------------------
+
+Two environmental variables can be used to specify where to find the Ghostscript shared library.
+
+``GSAPI_LIB`` sets the exact path of the Ghostscript shared library, otherwise, ``GSAPI_LIBDIR`` sets the directory containing the Ghostscript shared library.
+
+If neither is defined we will use the OS's default location(s) for shared libraries.
+
+If ``GSAPI_LIB`` is not defined, the leafname of the shared library is inferred from the OS type:
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Platform
+ - Shared library file
+ * - Windows
+ - ``gsdll64.dll``
+ * - MacOS
+ - ``libgs.dylib``
+ * - Linux / OpenBSD
+ - ``libgs.so``
+
+
+API test
+------------
+
+The ``gsapi.py`` file that provides the Python bindings can also be used to test the bindings, by running it directly.
+
+Assuming that your Ghostscript library has successfully been created, then from the root of your ``ghostpdl`` repository checkout do the following:
+
+
+**Windows**
+
+
+ Run ``gsapi.py`` as a test script in a ``cmd.exe`` window:
+
+ .. code-block:: bash
+
+ set GSAPI_LIBDIR=debugbin&& python ./demos/python/gsapi.py
+
+
+ Run ``gsapi.py`` as a test script in a ``PowerShell`` window:
+
+ .. code-block:: bash
+
+ cmd /C "set GSAPI_LIBDIR=debugbin&& python ./demos/python/gsapi.py"
+
+
+**Linux/OpenBSD/MacOS**
+
+
+ Run ``gsapi.py`` as a test script:
+
+ .. code-block:: bash
+
+ GSAPI_LIBDIR=sodebugbin ./demos/python/gsapi.py
+
+
+.. note::
+
+ If there are no errors then this will have validated that the Ghostscript library is present & operational.
+
+
+.. _python gsapi:
+
+
+The gsapi Python module
+=====================================
+
+Assuming that the above platform & setup has been completed, then ``gsapi`` should be imported into your own Python scripts for API usage.
+
+
+- Implemented using Python's ``ctypes`` module.
+
+- All functions have the same name as the C function that they wrap.
+
+- Functions raise a ``GSError`` exception if the underlying function returned a negative error code.
+
+- Functions that don't have out-params return ``None``. Out-params are returned directly (using tuples if there are more than one).
+
+
+
+.. _python gsapi_revision:
+
+
+``gsapi_revision()``
+---------------------------------------------------------------
+
+Returns a ``gsapi_revision_t``.
+
+This method returns the revision numbers and strings of the Ghostscript interpreter library; you should call it before any other interpreter library functions to make sure that the correct version of the Ghostscript interpreter has been loaded.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ version_info = gsapi.gsapi_revision()
+ print(version_info)
+
+
+**C code reference**: :ref:`gsapi_revision<API.htm gsapi_revision>`
+
+
+
+.. _python gsapi_new_instance:
+
+
+``gsapi_new_instance(caller_handle)``
+---------------------------------------------------------------
+
+
+Returns a new instance of Ghostscript to be used with other :ref:`gsapi_*()<python gsapi_run_asterisk>` functions.
+
+
+**Parameters:**
+
+``caller_handle``
+ Typically unused, but is passed to callbacks e.g. via :ref:`gsapi_set_stdio()<python gsapi_set_stdio>`. Must be convertible to a ``C void*``, so ``None`` or an ``integer`` is ok but other types such as strings will fail.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ instance = gsapi.gsapi_new_instance(1)
+
+
+**C code reference**: :ref:`gsapi_new_instance<API.htm gsapi_new_instance>`
+
+
+.. _python gsapi_delete_instance:
+
+
+``gsapi_delete_instance(instance)``
+---------------------------------------------------------------
+
+Destroy an instance of Ghostscript. Before you call this, Ghostscript should ensure to have finished any processes.
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_delete_instance(instance)
+
+
+**C code reference**: :ref:`gsapi_delete_instance<API.htm gsapi_delete_instance>`
+
+.. _python gsapi_set_stdio:
+
+
+``gsapi_set_stdio(instance, stdin_fn, stdout_fn, stderr_fn)``
+---------------------------------------------------------------
+
+Set the callback functions for ``stdio``, together with the handle to use in the callback functions.
+
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``stdin_fn``
+ If not ``None``, will be called with:
+
+ - ``(caller_handle, text, len_)``:
+ - ``caller_handle``: As passed originally to ``gsapi_new_instance()``.
+ - ``text``: A ``ctypes.LP_c_char`` of length ``len_``.
+
+
+``stdout_fn`` , ``stderr_fn``
+ If not ``None``, called with:
+
+ - ``(caller_handle, text)``:
+ - ``caller_handle``: As passed originally to ``gsapi_new_instance()``.
+ - ``text``: A Python bytes object.
+
+
+Should return the number of bytes of text that they handled; for convenience ``None`` is converted to ``len(text)``.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ def stdout_fn(caller_handle, bytes_):
+ sys.stdout.write(bytes_.decode('latin-1'))
+
+ gsapi.gsapi_set_stdio(instance, None, stdout_fn, None)
+ print('gsapi_set_stdio() ok.')
+
+
+**C code reference**: :ref:`gsapi_set_stdio<API.htm gsapi_set_stdio>`
+
+.. _python gsapi_set_poll:
+
+``gsapi_set_poll(instance, poll_fn)``
+---------------------------------------------------------------
+
+Set the callback function for polling.
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``poll_fn``
+ Will be called with ``caller_handle`` as passed to :ref:`gsapi_new_instance(python gsapi_new_instance)<>`.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ def poll_fn(caller_handle, bytes_):
+ sys.stdout.write(bytes_.decode('latin-1'))
+
+ gsapi.gsapi_set_poll(instance, poll_fn)
+ print('gsapi_set_poll() ok.')
+
+
+**C code reference**: :ref:`gsapi_set_poll<API.htm gsapi_set_poll>`
+
+.. _python gsapi_set_display_callback:
+
+``gsapi_set_display_callback(instance, callback)``
+---------------------------------------------------------------
+
+Sets the display callback.
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``callback``
+ Must be a ``display_callback`` instance.
+
+**Sample code**:
+
+.. code-block:: python
+
+ d = display_callback()
+ gsapi.gsapi_set_display_callback(instance, d)
+ print('gsapi_set_display_callback() ok.')
+
+
+**C code reference**: :ref:`gsapi_set_display_callback<API.htm gsapi_set_display_callback>`
+
+.. _python gsapi_set_arg_encoding:
+
+``gsapi_set_arg_encoding(instance, encoding)``
+---------------------------------------------------------------
+
+Set the encoding used for the interpretation of all subsequent arguments supplied via the :title:`GhostAPI` interface on this instance. By default we expect args to be in encoding ``0`` (the 'local' encoding for this OS). On Windows this means "the currently selected codepage". On Linux this typically means utf8. This means that omitting to call this function will leave Ghostscript running exactly as it always has.
+
+This must be called after :ref:`gsapi_new_instance<python gsapi_new_instance>` and before :ref:`gsapi_init_with_args<python gsapi_init_with_args>`.
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``encoding``
+ Encoding must be one of:
+
+ .. list-table::
+ :header-rows: 1
+
+ * - Encoding enum
+ - Value
+ * - ``GS_ARG_ENCODING_LOCAL``
+ - 0
+ * - ``GS_ARG_ENCODING_UTF8``
+ - 1
+ * - ``GS_ARG_ENCODING_UTF16LE``
+ - 2
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_set_arg_encoding(instance, gsapi.GS_ARG_ENCODING_UTF8)
+
+
+.. note::
+
+ Please note that use of the 'local' encoding (``GS_ARG_ENCODING_LOCAL``) is now deprecated and should be avoided in new code.
+
+
+
+**C code reference**: :ref:`gsapi_set_arg_encoding<API.htm gsapi_set_arg_encoding>`
+
+
+.. _python gsapi_set_default_device_list:
+
+``gsapi_set_default_device_list(instance, list_)``
+---------------------------------------------------------------
+
+Set the string containing the list of default device names, for example "display x11alpha x11 bbox". Allows the calling application to influence which device(s) Ghostscript will try, in order, in its selection of the default device. This must be called after :ref:`gsapi_new_instance<python gsapi_new_instance>` and before :ref:`gsapi_init_with_args<python gsapi_init_with_args>`.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``list_``
+ A string of device names.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_set_default_device_list(instance, 'bmp256 bmp32b bmpgray cdeskjet cdj1600 cdj500')
+
+
+
+**C code reference**: :ref:`gsapi_set_default_device_list<API.htm gsapi_set_default_device_list>`
+
+
+.. _python gsapi_get_default_device_list:
+
+``gsapi_get_default_device_list(instance)``
+---------------------------------------------------------------
+
+Returns a string containing the list of default device names. This must be called after :ref:`gsapi_new_instance<python gsapi_new_instance>` and before :ref:`gsapi_init_with_args<python gsapi_init_with_args>`.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ device_list = gsapi.gsapi_get_default_device_list(instance)
+ print(device_list)
+
+
+**C code reference**: :ref:`gsapi_get_default_device_list<API.htm gsapi_get_default_device_list>`
+
+
+.. _python gsapi_init_with_args:
+
+``gsapi_init_with_args(instance, args)``
+---------------------------------------------------------------
+
+To initialise the interpreter, pass your ``instance`` of Ghostscript and your argument variables with ``args``.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``args``
+ A list/tuple of strings.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ in_filename = 'tiger.eps'
+ out_filename = 'tiger.pdf'
+ params = ['gs', '-dNOPAUSE', '-dBATCH', '-sDEVICE=pdfwrite',
+ '-o', out_filename, '-f', in_filename]
+ gsapi.gsapi_init_with_args(instance, params)
+
+**C code reference**: :ref:`gsapi_init_with_args<API.htm gsapi_init_with_args>`
+
+.. _python gsapi_run_asterisk:
+
+``gsapi_run_*``
+---------------------------------------------------------------
+
+There is a 64 KB length limit on any buffer submitted to a :ref:`gsapi_run_*<python gsapi_run_asterisk>` function for processing. If you have more than 65535 bytes of input then you must split it into smaller pieces and submit each in a separate :ref:`gsapi_run_string_continue<python gsapi_run_string_continue>` call.
+
+On success (underlying C function's return value is ``>=0``), these functions return the underlying C function's ``exit_code`` out-parameter (and the return value is discarded). Otherwise they raise a ``GSError`` in the usual way (and the underlying ``exit_code`` out-parameter is discarded).
+
+For full details on these return codes please see :ref:`The C API return codes<API_Return codes>`.
+
+
+.. _User errors parameter explained:
+
+
+.. note::
+
+ **User errors parameter explained**
+
+ The ``user_errors`` argument is normally set to zero to indicate that errors should be handled through the normal mechanisms within the interpreted code. If set to a negative value, the functions will return an error code directly to the caller, bypassing the interpreted language. The interpreted language's error handler is bypassed, regardless of ``user_errors`` parameter, for the ``gs_error_interrupt`` generated when the polling callback returns a negative value. A positive ``user_errors`` is treated the same as zero.
+
+
+**C code reference**: :ref:`gsapi_run_*<API.htm gsapi_run_asterisk>`
+
+.. _python gsapi_run_string_begin:
+
+``gsapi_run_string_begin(instance, user_errors)``
+---------------------------------------------------------------
+
+Starts a ``run_string_`` operation.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``user_errors``
+ An ``int``, for more see: `User errors parameter explained`_.
+
+**Sample code**:
+
+.. code-block:: python
+
+ exitcode = gsapi.gsapi_run_string_begin(instance, 0)
+
+**C code reference**: :ref:`gsapi_run_*<API.htm gsapi_run_asterisk>`
+
+
+.. _python gsapi_run_string_continue:
+
+
+``gsapi_run_string_continue(instance, str_, user_errors)``
+---------------------------------------------------------------
+
+Processes file byte data (``str_``) to feed as chunks into Ghostscript. This method should typically be called within a buffer context.
+
+.. note::
+
+ An exception is not raised for the ``gs_error_NeedInput`` return code.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``str_``
+ Should be either a Python string or a bytes object. If the former, it is converted into a bytes object using utf-8 encoding.
+
+``user_errors``
+ An ``int``, for more see: `User errors parameter explained`_.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ exitcode = gsapi.gsapi_run_string_continue(instance, data, 0)
+
+
+.. note::
+
+ For the return code, we don't raise an exception for ``gs_error_NeedInput``.
+
+
+**C code reference**: :ref:`gsapi_run_*<API.htm gsapi_run_asterisk>`
+
+
+.. _python gsapi_run_string_with_length:
+
+
+``gsapi_run_string_with_length(instance, str_, length, user_errors)``
+------------------------------------------------------------------------------------------------------------------------------
+
+Processes file byte data (``str_``) to feed into Ghostscript when the length is known and the file byte data is immediately available.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``str_``
+ Should be either a Python string or a bytes object. If the former, it is converted into a bytes object using utf-8 encoding.
+
+``length``
+ An ``int`` representing the length of ``str_``.
+
+``user_errors``
+ An ``int``, for more see: `User errors parameter explained`_.
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_run_string_with_length(instance,"hello",5,0)
+
+
+.. note::
+
+ If using this method then ensure that the file byte data will fit into a single (<64k) buffer.
+
+
+**C code reference**: :ref:`gsapi_run_*<API.htm gsapi_run_asterisk>`
+
+
+.. _python gsapi_run_string:
+
+
+``gsapi_run_string(instance, str_, user_errors)``
+---------------------------------------------------------------
+
+Processes file byte data (``str_``) to feed into Ghostscript.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``str_``
+ Should be either a Python string or a bytes object. If the former, it is converted into a bytes object using utf-8 encoding.
+
+``user_errors``
+ An ``int``, for more see: `User errors parameter explained`_.
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_run_string(instance,"hello",0)
+
+.. note::
+
+ This method can only work on a standard, null terminated C string.
+
+
+**C code reference**: :ref:`gsapi_run_*<API.htm gsapi_run_asterisk>`
+
+
+.. _python gsapi_run_string_end:
+
+
+``gsapi_run_string_end(instance, user_errors)``
+---------------------------------------------------------------
+
+Ends a ``run_string_`` operation.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``user_errors``
+ An ``int``, for more see: `User errors parameter explained`_.
+
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ exitcode = gsapi.gsapi_run_string_end(instance, 0)
+
+
+**C code reference**: :ref:`gsapi_run_*<API.htm gsapi_run_asterisk>`
+
+.. _python gsapi_run_file:
+
+
+``gsapi_run_file(instance, filename, user_errors)``
+---------------------------------------------------------------
+
+Runs a file through Ghostscript.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``filename``
+ String representing file name.
+
+``user_errors``
+ An ``int``, for more see: `User errors parameter explained`_.
+
+**Sample code**:
+
+.. code-block:: python
+
+ in_filename = 'tiger.eps'
+ gsapi.gsapi_run_file(instance, in_filename, 0)
+
+
+.. note::
+
+ This will process the supplied input file with any previously supplied argument parameters.
+
+
+**C code reference**: :ref:`gsapi_run_*<API.htm gsapi_run_asterisk>`
+
+
+.. _python gsapi_exit:
+
+``gsapi_exit(instance)``
+---------------------------------------------------------------
+
+Returns a successful exit code ``0``, or raises a ``GSError`` exception on error.
+
+
+Exit the interpreter. This must be called on shutdown if :ref:`gsapi_init_with_args<python gsapi_init_with_args>` has been called, and just before :ref:`gsapi_delete_instance<python gsapi_delete_instance>`.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_exit(instance)
+
+
+
+**C code reference**: :ref:`gsapi_exit<API.htm gsapi_exit>`
+
+
+.. _python gsapi_set_param:
+
+``gsapi_set_param(instance, param, value, type_=None)``
+---------------------------------------------------------------
+
+Sets a parameter.
+
+We behave much like the underlying ``gsapi_set_param()`` C function, except that we also support automatic inference of type ``type_`` arg by looking at the type of ``value``.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``param``
+ Name of parameter, either a ``bytes`` or a ``str``; if ``str`` it is encoded using ``latin-1``.
+
+``value``
+ A ``bool``, ``int``, ``float``, ``bytes`` or ``str``. If ``str``, it is encoded into a ``bytes`` using ``utf-8``.
+
+``type_``
+ If ``type_`` is not ``None``, ``value`` must be convertible to the Python type implied by ``type_``:
+
+
+ .. list-table::
+ :header-rows: 1
+
+ * - ``type_``
+ - Python type(s)
+ * - ``gs_spt_null``
+ - [Ignored]
+ * - ``gs_spt_bool``
+ - bool
+ * - ``gs_spt_int``
+ - int
+ * - ``gs_spt_float``
+ - float
+ * - ``gs_spt_name``
+ - [Error]
+ * - ``gs_spt_string``
+ - (bytes, str)
+ * - ``gs_spt_long``
+ - int
+ * - ``gs_spt_i64``
+ - int
+ * - ``gs_spt_size_t``
+ - int
+ * - ``gs_spt_parsed``
+ - (bytes, str)
+ * - ``gs_spt_more_to_come``
+ - (bytes, str)
+
+ An exception is raised if ``type_`` is an integer type and ``value`` is outside its range.
+
+ If ``type_`` is ``None``, we choose something suitable for type of ``value``:
+
+ .. list-table::
+ :header-rows: 1
+
+ * - Python type of ``value``
+ - ``type_``
+ * - bool
+ - ``gs_spt_bool``
+ * - int
+ - ``gs_spt_i64``
+ * - float
+ - ``gs_spt_float``
+ * - bytes
+ - ``gs_spt_parsed``
+ * - str
+ - ``gs_spt_parsed`` (encoded with utf-8)
+
+
+ If value is ``None``, we use ``gs_spt_null``.
+
+ Otherwise ``type_`` must be a ``gs_spt_*`` except for ``gs_spt_invalid`` and ``gs_spt_name`` (we don't allow ``psapi_spt_name`` because the underlying C does not copy the string, so cannot be safely used from Python).
+
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ set_margins = gsapi.gsapi_set_param(instance, "Margins", "[10 10]")
+
+
+
+**C code reference**: :ref:`gsapi_set_param<API.htm gsapi_set_param>`
+
+
+.. _python gsapi_get_param:
+
+``gsapi_get_param(instance, param, type_=None, encoding=None)``
+------------------------------------------------------------------------------------------------------------------------------
+
+Returns value of specified parameter, or ``None`` if parameter ``type`` is ``gs_spt_null``.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``param``
+ Name of parameter, either a ``bytes`` or ``str``; if a ``str`` it is encoded using ``latin-1``.
+
+``type_``
+ A ``gs_spt_*`` constant or ``None``. If ``None`` we try each ``gs_spt_*`` until one succeeds; if none succeeds we raise the last error.
+
+``encoding``
+ Only affects string values. If ``None`` we return a ``bytes`` object, otherwise it should be the encoding to use to decode into a string, e.g. 'utf-8'.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ get_margins = gsapi.gsapi_get_param(instance, "Margins")
+
+
+**C code reference**: :ref:`gsapi_get_param<API.htm gsapi_get_param>`
+
+.. _python gsapi_enumerate_params:
+
+
+``gsapi_enumerate_params(instance)``
+---------------------------------------------------------------
+
+Enumerate the current parameters on the instance of Ghostscript.
+
+Yields ``(key, value)`` for each ``param``. ``key`` is decoded as ``latin-1``.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ for param, type_ in gsapi.gsapi_enumerate_params(instance):
+ val = gsapi.gsapi_get_param(instance,param, encoding='utf-8')
+ print('%-24s : %s' % (param, val))
+
+
+**C code reference**: :ref:`gsapi_enumerate_params<API.htm gsapi_enumerate_params>`
+
+.. _python gsapi_add_control_path:
+
+``gsapi_add_control_path(instance, type_, path)``
+---------------------------------------------------------------
+
+Add a (case sensitive) path to one of the lists of :ref:`permitted paths<Use Safer>` for file access.
+
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``type_``
+ An ``int`` which must be one of:
+
+ .. list-table::
+ :header-rows: 1
+
+ * - Enum
+ - Value
+ * - ``GS_PERMIT_FILE_READING``
+ - 0
+ * - ``GS_PERMIT_FILE_WRITING``
+ - 1
+ * - ``GS_PERMIT_FILE_CONTROL``
+ - 2
+
+``path``
+ A string representing the file path.
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_add_control_path(instance, gsapi.GS_PERMIT_FILE_READING, "/docs/secure/")
+
+
+**C code reference**: :ref:`gsapi_add_control_path<API.htm gsapi_add_control_path>`
+
+
+.. _python gsapi_remove_control_path:
+
+
+``gsapi_remove_control_path(instance, type_, path)``
+---------------------------------------------------------------
+
+Remove a (case sensitive) path from one of the lists of :ref:`permitted paths<Use Safer>` for file access.
+
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``type_``
+ An int representing the permission type.
+
+``path``
+ A string representing the file path.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_remove_control_path(instance, gsapi.GS_PERMIT_FILE_READING, "/docs/secure/")
+
+
+**C code reference**: :ref:`gsapi_remove_control_path<API.htm gsapi_remove_control_path>`
+
+.. _python gsapi_purge_control_paths:
+
+``gsapi_purge_control_paths(instance, type_)``
+---------------------------------------------------------------
+
+
+Clear all the paths from one of the lists of :ref:`permitted paths<Use Safer>` for file access.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``type_``
+ An ``int`` representing the permission type.
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_purge_control_paths(instance, gsapi.GS_PERMIT_FILE_READING)
+
+
+**C code reference**: :ref:`gsapi_purge_control_paths<API.htm gsapi_purge_control_paths>`
+
+
+.. _python gsapi_activate_path_control:
+
+``gsapi_activate_path_control(instance, enable)``
+---------------------------------------------------------------
+
+Enable/Disable path control (i.e. whether paths are checked against :ref:`permitted paths<Use Safer>` before access is granted).
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+``enable``
+ ``bool`` to enable/disable path control.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ gsapi.gsapi_activate_path_control(instance, true)
+
+
+
+**C code reference**: :ref:`gsapi_activate_path_control<API.htm gsapi_activate_path_control>`
+
+.. _python gsapi_is_path_control_active:
+
+
+``gsapi_is_path_control_active(instance)``
+---------------------------------------------------------------
+
+Query whether path control is activated or not.
+
+
+**Parameters:**
+
+``instance``
+ Your instance of Ghostscript.
+
+
+**Sample code**:
+
+.. code-block:: python
+
+ isActive = gsapi.gsapi_is_path_control_active(instance)
+
+
+**C code reference**: :ref:`gsapi_is_path_control_active<API.htm gsapi_is_path_control_active>`
+
+
+
+
+
+
diff --git a/doc/src/Lib.rst b/doc/src/Lib.rst
new file mode 100644
index 00000000..9ad84080
--- /dev/null
+++ b/doc/src/Lib.rst
@@ -0,0 +1,607 @@
+.. title:: The Ghostscript Library
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Lib.htm:
+
+
+The Ghostscript Library
+===================================
+
+
+
+
+
+This document describes the Ghostscript library, a set of procedures to implement the graphics and filtering capabilities that are primitive operations in the PostScript language and in Adobe Portable Document Format (PDF).
+
+Ghostscript is actually two programs: a language interpreter, and a graphics library. The library provides, in the form of C procedures, all the graphics functions of the language, that is, approximately those facilities listed in section 8.1 of the PostScript Language Reference Manual, starting with the graphics state operators. In addition, the library provides some lower-level graphics facilities that offer higher performance in exchange for less generality.
+
+
+
+PostScript operator API
+--------------------------------------
+
+The highest level of the library, which is the one that most clients will use, directly implements the PostScript graphics operators with procedures named ``gs_XXX``, for instance ``gs_moveto`` and ``gs_fill``. Nearly all of these procedures take graphics state objects as their first arguments, such as:
+
+.. code-block:: bash
+
+ int gs_moveto(gs_state *, double, double);
+
+Nearly every procedure returns an integer code which is ``>= 0`` for a successful return or ``<0`` for a failure. The failure codes correspond directly to PostScript errors, and are defined in ``gserrors.h``.
+
+The library implements all the operators in the following sections of the PostScript Language Reference Manual, with the indicated omissions and with the APIs defined in the indicated ``.h`` files. A header of the form ``A.h``(``B.h``) indicates that ``A.h`` is included in ``B.h``, so ``A.h`` need not be included explicitly if ``B.h`` is included. Operators marked with * in the "omissions" column are not implemented directly; the library provides lower-level procedures that can be used to implement the operator.
+
+There are slight differences in the operators that return multiple values, since C's provisions for this are awkward. Also, the control structure for the operators involving callback procedures (``pathforall``, ``image``, ``colorimage``, ``imagemask``) is partly inverted: the client calls a procedure to set up an enumerator object, and then calls another procedure for each iteration. The ``...show`` operators, ``charpath``, and ``stringwidth`` also use an inverted control structure.
+
+
+
+
+.. list-table::
+ :widths: 30 30 40
+ :header-rows: 1
+
+ * - Section (operators)
+ - Headers
+ - Omissions
+ * - Graphics state – device-independent
+ - ``gscolor.h`` (``gsstate.h``)
+
+ ``gscolor1.h``
+
+ ``gscolor2.h``
+
+ ``gscspace.h``
+
+ ``gshsb.h``
+
+ ``gsline.h`` (``gsstate.h``)
+
+ ``gsstate.h``
+
+ -
+ * - Graphics state – device-dependent
+ - ``gscolor.h`` (``gsstate.h``)
+
+ ``gscolor1.h``
+
+ ``gscolor2.h``
+
+ ``gsht.h`` (``gsht1.h``, ``gsstate.h``)
+
+ ``gsht1.h``
+
+ ``gsline.h`` (``gsstate.h``)
+
+ -
+ * - Coordinate system and matrix
+
+ - ``gscoord.h``
+
+ ``gsmatrix.h``
+ - ``*matrix``, ``*identmatrix``, ``*concatmatrix``, ``*invertmatrix``
+
+ * - Path construction
+
+ - ``gspath.h``
+
+ ``gspath2.h``
+ - ``*arct``, ``*pathforall``, ``ustrokepath``, ``uappend``, ``upath``, ``ucache``
+
+ * - Painting
+
+ - ``gsimage.h``
+
+ ``gspaint.h``
+
+ ``gspath2.h``
+ - ``*image``, ``*colorimage``, ``*imagemask``, ``ufill``, ``ueofill``, ``ustroke``
+
+ * - Form and pattern
+ - ``gscolor2.h``
+ - ``execform``
+
+ * - Device setup and output
+ - ``gsdevice.h``
+ - ``*showpage``, ``*set/currentpagedevice``
+ * - Character and font
+
+
+ - ``gschar.h``
+
+ ``gsfont.h``
+ - ``*`` (all the ``show`` operators), ``definefont``, ``undefinefont``,
+
+ ``findfont``, ``*scalefont``, ``*makefont``, ``selectfont``,
+
+ ``[Global]FontDirectory``, ``Standard/ISOLatin1Encoding``, ``findencoding``
+
+
+
+The following procedures from the list above operate differently from their PostScript operator counterparts, as explained here:
+
+``gs_makepattern`` (``gscolor2.h``)
+ Takes an explicit current color, rather than using the current color in the graphics state. Takes an explicit allocator for allocating the pattern implementation. See below for more details on gs_makepattern.
+
+``gs_setpattern`` (``gscolor2.h``), ``gs_setcolor`` (``gscolor2.h``), ``gs_currentcolor`` (``gscolor2.h``)
+ Use ``gs_client_color`` rather than a set of color parameter values. See below for more details on ``gs_setpattern``.
+
+``gs_currentdash_length/pattern/offset`` (``gsline.h``)
+ Splits up ``currentdash`` into three separate procedures.
+
+``gs_screen_init/currentpoint/next/install`` (``gsht.h``)
+ Provide an "enumeration style" interface to ``setscreen``. (``gs_setscreen`` is also implemented.)
+
+``gs_rotate/scale/translate`` (``gscoord.h``), ``gs_[i][d]transform`` (``gscoord.h``)
+ These always operate on the graphics state CTM. The corresponding operations on free-standing matrices are in ``gsmatrix.h`` and have different names.
+
+``gs_path_enum_alloc/init/next/cleanup`` (``gspath.h``)
+ Provide an "enumeration style" implementation of ``pathforall``.
+
+``gs_image_enum_alloc`` (``gsimage.h``), ``gs_image_init/next/cleanup`` (``gsimage.h``)
+ Provide an "enumeration style" interface to the equivalent of ``image``, ``imagemask``, and ``colorimage``. In the ``gs_image_t``, ``ColorSpace`` provides an explicit color space, rather than using the current color space in the graphics state; ``ImageMask`` distinguishes ``imagemask`` from ``[color]image``.
+
+``gs_get/putdeviceparams`` (``gsdevice.h``)
+ Take a ``gs_param_list`` for specifying or receiving the parameter values. See ``gsparam.h`` for more details.
+
+``gs_show_enum_alloc/release`` (``gschar.h``), ``gs_xxxshow_[n_]init`` (``gschar.h``), ``gs_show_next`` (``gschar.h``)
+ Provide an "enumeration style" interface to writing text. Note that control returns to the caller if the character must be rasterized.
+
+
+This level of the library also implements the following operators from other sections of the Manual:
+
+
+
+.. list-table::
+ :widths: 30 20 50
+ :header-rows: 1
+
+ * - Section (operators)
+ - Headers
+ - Operators
+ * - Interpreter parameter
+ - ``gsfont.h``
+ - ``cachestatus``, ``setcachelimit``, ``*set/currentcacheparams``
+ * - Display PostScript
+ - ``gsstate.h``
+ - ``set/currenthalftonephase``
+
+
+
+In order to obtain the full PostScript Level 2 functionality listed above, ``FEATURE_DEVS`` must be set in the ``makefile`` to include at least the following:
+
+
+.. code-block::bash
+
+ FEATURE_DEVS=patcore.dev cmykcore.dev psl2core.dev dps2core.dev ciecore.dev path1core.dev hsbcore.dev
+
+The ``*lib.mak`` makefiles mentioned below do not always include all of these features.
+
+Files named ``gs*.c`` implement the higher level of the graphics library. As might be expected, all procedures, variables, and structures available at this level begin with "``gs_``". Structures that appear in these interfaces, but whose definitions may be hidden from clients, also have names beginning with "``gs_``", that is, the prefix, not the implementation, reflects at what level the abstraction is made available.
+
+
+Patterns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Patterns are the most complicated PostScript language objects that the library API deals with. As in PostScript, defining a pattern color and using the color are two separate operations.
+
+``gs_makepattern`` defines a pattern color. Its arguments are as follows:
+
+.. list-table::
+ :widths: 25 75
+ :header-rows: 0
+
+ * - ``gs_client_color *``
+ - The resulting ``Pattern`` color is stored here.
+
+ This is different from PostScript, which has no color objects per se,
+
+ and hence returns a modified copy of the dictionary.
+
+ * - ``const gs_client_pattern *``
+ - The analogue of the original Pattern dictionary, described in detail just below.
+
+ * - ``const gs_matrix *``
+ - Corresponds to the matrix argument of the ``makepattern`` operator.
+
+ * - ``gs_state *``
+ - The current graphics state.
+
+ * - ``gs_memory_t *``
+ - The allocator to use for allocating the saved data for the Pattern color.
+
+ If this is ``NULL``, ``gs_makepattern`` uses the same allocator that allocated
+
+ the graphics state. Library clients should probably always use ``NULL``.
+
+
+The ``gs_client_pattern`` structure defined in ``gscolor2.h`` corresponds to the ``Pattern`` dictionary that is the argument to the PostScript language ``makepattern`` operator. This structure has one extra member, ``void *client_data``, which is a place for clients to store a pointer to additional data for the ``PaintProc``; this provides the same functionality as putting additional keys in the ``Pattern`` dictionary at the PostScript language level. The ``PaintProc`` is an ordinary C procedure that takes as parameters a ``gs_client_color *``, which is the ``Pattern`` color that is being used for painting, and a ``gs_state *``, which is the same graphics state that would be presented to the ``PaintProc`` in PostScript. Currently the ``gs_client_color *`` is always the current color in the graphics state, but the ``PaintProc`` should not rely on this. The ``PaintProc`` can retrieve the ``gs_client_pattern *`` from the ``gs_client_color *`` with the ``gs_getpattern`` procedure, also defined in ``gscolor2.h``, and from there, it can retrieve the ``client_data`` pointer.
+
+
+The normal way to set a ``Pattern`` color is to call ``gs_setpattern`` with the graphics state and with the ``gs_client_color`` returned by ``gs_makepattern``. After that, one can use ``gs_setcolor`` to set further ``Pattern`` colors (colored, or uncolored with the same underlying color space); the rules are the same as those in PostScript. Note that for ``gs_setpattern``, the ``paint.values`` in the ``gs_client_color`` must be filled in for uncolored patterns; this corresponds to the additional arguments for the PostScript ``setpattern`` operator in the uncolored case.
+
+There is a special procedure ``gs_makebitmappattern`` for creating bitmap-based patterns. Its API is documented in ``gscolor2.h``; its implementation, in ``gspcolor.c``, may be useful as an example of a pattern using a particularly simple ``PaintProc``.
+
+
+Lower-level API
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+Files named ``gx*.c`` implement the lower level of the graphics library. The interfaces at the ``gx`` level are less stable, and expose more of the implementation detail, than those at the ``gs`` level: in particular, the ``gx`` interfaces generally use device coordinates in an internal fixed-point representation, as opposed to the ``gs`` interfaces that use floating point user coordinates. Named entities at this level begin with ``gx_``.
+
+Files named ``gz*.c`` and ``gz*.h`` are internal to the Ghostscript implementation, and are not designed to be called by clients.
+
+.. _Lib_VisualTrace:
+
+
+Visual Trace instructions
+-----------------------------
+
+Visual Trace instructions may be inserted in code to provide debug output in a graphical form. Graphics Library doesn't provide a rasterisation of the output, because it is platform dependent. Instead this, client application shpuld set ``vd_trace0`` external variable to Graphics Library, passing a set of callbacks which provide the rasterization.
+
+Visual Trace instructions are defined in ``vdtrace.h``. Debug output must be opened with ``vd_get_dc`` instruction, which obtains a drawing context for the debug output, and must be closed with ``vd_release_dc`` instruction. After opening the output, scale, origin and shift to be set for mapping the debugee coordinate space to window coordinate space. Than painting instructions to be used. Painting may be either immediate or indirect.
+
+Indirect painting uses ``vd_beg_path`` before line output and ``vd_end_path`` after line output, to store a path into a temporary storage. After this ``vd_stroke`` may be used for stroking the path, or ``vd_fill`` may be used for filling the region inside the path.
+
+Immediate painting happens when path construction instructions are involved without ``vd_beg_path`` and ``vd_end_path``. In this case lines and curves are being drawed immediately, when a path construction instruction is executed.
+
+The following table explains the semantics of Visual Trace instructions.
+
+
+Visual Trace instructions semantics
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. list-table::
+ :header-rows: 1
+
+ * - Instruction
+ - Function
+ - Parameters
+ * - ``vd_get_dc``
+ - Obtain drawing context
+ - ``-T`` option flag value, for which the subsequent output is enabled.
+ * - ``vd_release_dc``
+ - Release drawing context
+ -
+ * - ``vd_enabled``
+ - Is trace currently enabled ?
+ -
+ * - ``vd_get_size_unscaled_x``
+ - Get the horizontal size of the output window in pixels.
+ -
+ * - ``vd_get_size_unscaled_y``
+ - Get the vertical size of the output window in pixels.
+ -
+ * - ``vd_get_size_caled_x``
+ - Get the horizontal size of the output window in debuggee coordinate units.
+ -
+ * - ``vd_get_size_caled_y``
+ - Get the vertical size of the output window in debuggee coordinate units.
+ -
+ * - ``vd_get_scale_x``
+ - Get the horizontal scale.
+ -
+ * - ``vd_get_scale_y``
+ - Get the vertical scale.
+ -
+ * - ``vd_get_origin_x``
+ - Get the horizontal position of the draft origin in debuggee coordinate space.
+ -
+ * - ``vd_get_origin_y``
+ - Get the vertical position of the draft origin in debuggee coordinate space.
+ -
+ * - ``vd_set_scale(s)``
+ - Set isotripic scale.
+ - Debugee space to window space mapping scale, same for both dimentions.
+ * - ``vd_set_scaleXY(sx,sy)``
+ - Set anisotripic scale.
+ - Debugee space to window space mapping scale, one for each dimention.
+ * - ``vd_set_origin(x,y)``
+ - Set the draft origin.
+ - Origin of the draft in debugee space.
+ * - ``vd_set_shift(x,y)``
+ - Set the draft position.
+ - Position of the draft origin in window space (in pixels).
+ * - ``vd_set_central_shift``
+ - Set the draft position to window center.
+ -
+ * - ``vd_erase(c)``
+ - Fill entire window.
+ - Color to fill.
+ * - ``vd_beg_path``
+ - Begin path construction.
+ -
+ * - ``vd_end_path``
+ - End path construction.
+ -
+ * - ``vd_moveto(x,y)``
+ - Path construction : Set the draft current point.
+ - Debugee coordinates.
+ * - ``vd_lineto(x,y)``
+ - Path construction : Line from current point to specified point.
+ - Debugee coordinates.
+ * - ``vd_lineto_mupti(p,n)``
+ - Path construction : Polyline from current point to specified points.
+ - Array of points and its size, debugee coordinates.
+ * - ``vd_curveto(x0,y0,x1,y1,x2,y2)``
+ - Path construction : Curve (3rd-order Bezier) from current point to
+
+ specified point, with specified poles.
+ - 2 poles and the curve ending point, debuggee coordinates.
+ * - ``vd_closepath``
+ - Path construction : Close the path (is necessary for filling an area).
+ -
+ * - ``vd_bar(x0,y0,x1,y1,w,c)``
+ - Bar from point to point.
+ - 2 points (debugee coordinates), width (in pixels) and color.
+ * - ``vd_square(x0,y0,w,c)``
+ - Square with specified center and size.
+ - The center (debugee coordinates), size (in pixels) and color.
+ * - ``vd_rect(x0,y0,x1,y1,w,c)``
+ - Canonic rectangle with specified coordinites.
+ - Coordinates of boundaries (debugee coordinates),
+
+ line width (in pixels) and color.
+ * - ``vd_quad(x0,y0,x1,y1,x2,y2,x3,y3,w,c)``
+ - Quadrangle with specified coordinites.
+ - Coordinates of vertices (debugee coordinates),
+
+ line width (in pixels) and color.
+ * - ``vd_curve(x0,y0,x1,y1,x2,y2,x3,y3,c,w)``
+ - Curve with width.
+ - 4 curve poles (debugee coordinates), color, and width (in pixels).
+ * - ``vd_circle(x,y,r,c)``
+ - Circle.
+ - Center (debugee coordinates), radius (in pixels) and color.
+ * - ``vd_round(x,y,r,c)``
+ - Filled circle.
+ - Center (debugee coordinates), radius (in pixels) and color.
+ * - ``vd_stroke``
+ - Stroke a path constructed with:
+
+ ``vd_beg_path``, ``vd_moveto``, ``vd_lineto``,
+
+ ``vd_curveto``, ``vd_closepath``, ``vd_end_path``.
+ -
+ * - ``vd_fill``
+ - Fill a path constructed with:
+
+ ``vd_beg_path``, ``vd_moveto``, ``vd_lineto``,
+
+ ``vd_curveto``, ``vd_closepath``, ``vd_end_path``.
+ -
+ * - ``vd_setcolor(c)``
+ - Set a color.
+ - Color (an integer consisting of red, green, blue bytes).
+ * - ``vd_setlinewidth(w)``
+ - Set line width.
+ - Width (in pixels).
+ * - ``vd_text(x,y,s,c)``
+ - Paint a text.
+ - Origin point (debugee coordinates), a string, and a color.
+ * - ``vd_wait``
+ - Delay execution until a resuming command is entered through user interface.
+ -
+
+
+Graphics Library doesn't provide a rasterization of the debug output. Instead it calls callbacks, which are specified by a client, and which may have a platform dependent implementation. The implementation must not use Graphics Library to exclude recursive calls to it from Visual Trace instructions. The callbacks and auxiliary data are collected in the structure ``vd_trace_interface``, explained in the table below.
+
+
+
+
+vd_trace_interface structure
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. list-table::
+ :header-rows: 1
+
+ * - Field
+ - Purpose
+ - Parameters
+ * - ``host``
+ - A pointer to the rasterizer control block -
+
+ to be provided by client application.
+
+ The type of the field is client dependent.
+ -
+ * - ``scale_x``, ``scale_y``
+ - Scale of debugee coordinate to window coordinate mapping -
+
+ internal work data, don't change.
+ -
+ * - ``orig_x``, ``orig_y``
+ - Draft origin in debugee coordinates -
+
+ internal work data, don't change.
+ -
+ * - ``shift_x``, ``shift_y``
+ - Draft shift in window coordinates -
+
+ internal work data, don't change.
+ -
+ * - ``get_size_x(I)``
+ - Get window width in pixels.
+ -
+ * - ``get_size_y(I)``
+ - Get window height in pixels.
+ -
+ * - ``get_dc(I,I1)``
+ - Obtain drawing context.
+ - Pointer to interface block,
+
+ and pointer to copy of the pointer.
+
+ Implementation must set ``*I1`` if it succeeds
+
+ to get a drawing context.
+ * - ``release_dc(I,I1)``
+ - Release drawing context.
+ - Pointer to interface block,
+
+ and pointer to copy of the pointer.
+
+ Implementation must reset ``*I1`` if it succeeds
+
+ to release the drawing context.
+ * - ``erase(I,c)``
+ - Erase entire window.
+ - Background color.
+ * - ``beg_path(I)``
+ - Begin path construction.
+ -
+ * - ``end_path(I)``
+ - End path construction.
+ -
+ * - ``moveto(I,x,y)``
+ - Set current point.
+ - A point in window coordinates.
+ * - ``lineto(I,x,y)``
+ - Line from current point to specified point.
+ - A point in window coordinates.
+ * - ``curveto(I,x0,y0,x1,y1,x2,y2)``
+ - Curve from current point with specified
+
+ poles to specified point.
+ - 3 points in window coordinates.
+ * - ``closepath(I)``
+ - Close the path.
+ -
+ * - ``circle(I,x,y,r)``
+ - Circle.
+ - Center and radius, window coordinates.
+ * - ``round(I,x,y,r)``
+ - Filled circle.
+ - Center and radius, window coordinates.
+ * - ``fill(I)``
+ - Fill the path.
+ -
+ * - ``stroke(I)``
+ - Stroke the path.
+ -
+ * - ``setcolor(I,c)``
+ - Set color.
+ - An integer, consisting of red, green, blue bytes.
+ * - ``setlinewidth(I,w)``
+ - Set line width.
+ - Line width in pixels.
+ * - ``text(I,x,y,s)``
+ - Draw a text.
+ - Coordinates in pixels, and a string.
+ * - ``wait(I)``
+ - Delay execution until resume command is
+
+ inputted from user.
+ -
+
+
+
+A full example
+-----------------------
+
+The file ``gslib.c`` in the Ghostscript fileset is a complete example program that initializes the library and produces output using it; files named ``*lib.mak`` (such as ``ugcclib.mak`` and ``bclib.mak``) are ``makefiles`` using ``gslib.c`` as the main program. The following annotated excerpts from this file are intended to provide a roadmap for applications that call the library.
+
+
+.. code-block:: c
+
+ /* Capture stdin/out/err before gs.h redefines them. */
+ #include <stdio.h>
+ static FILE *real_stdin, *real_stdout, *real_stderr;
+ static void
+ get_real(void)
+ { real_stdin = stdin, real_stdout = stdout, real_stderr = stderr;
+ }
+
+Any application using Ghostscript should include the fragment above at the very beginning of the main program.
+
+.. code-block:: c
+
+ #include "gx.h"
+
+The ``gx.h`` header includes a wealth of declarations related to the Ghostscript memory manager, portability machinery, debugging framework, and other substrate facilities. Any application file that calls any Ghostscript API functions should probably include ``gx.h``.
+
+
+.. code-block:: c
+
+ /* Configuration information imported from gconfig.c. */
+ extern gx_device *gx_device_list[];
+
+ /* Other imported procedures */
+ /* from gsinit.c */
+ extern void gs_lib_init(P1(FILE *));
+ extern void gs_lib_finit(P2(int, int));
+ /* from gsalloc.c */
+ extern gs_ref_memory_t *ialloc_alloc_state(P2(gs_memory_t *, uint));
+
+
+The externs above are needed for initializing the library.
+
+.. code-block:: c
+
+ gs_ref_memory_t *imem;
+ #define mem ((gs_memory_t *)imem)
+ gs_state *pgs;
+ gx_device *dev = gx_device_list[0];
+
+ gp_init();
+ get_real();
+ gs_stdin = real_stdin;
+ gs_stdout = real_stdout;
+ gs_stderr = real_stderr;
+ gs_lib_init(stdout);
+ ....
+ imem = ialloc_alloc_state(&gs_memory_default, 20000);
+ imem->space = 0;
+ ....
+ pgs = gs_state_alloc(mem);
+
+
+The code above initializes the library and its memory manager. ``pgs`` now points to the graphics state that will be passed to the drawing routines in the library.
+
+.. code-block:: c
+
+ gs_setdevice_no_erase(pgs, dev); /* can't erase yet */
+ { gs_point dpi;
+ gs_screen_halftone ht;
+ gs_dtransform(pgs, 72.0, 72.0, &dpi);
+ ht.frequency = min(fabs(dpi.x), fabs(dpi.y)) / 16.001;
+ ht.angle = 0;
+ ht.spot_function = odsf;
+ gs_setscreen(pgs, &ht);
+ }
+
+The code above initializes the default device and sets a default halftone screen. (For brevity, we have omitted the definition of ``odsf``, the spot function.)
+
+.. code-block:: c
+
+ /* gsave and grestore (among other places) assume that */
+ /* there are at least 2 gstates on the graphics stack. */
+ /* Ensure that now. */
+ gs_gsave(pgs);
+
+
+The call above completes initializing the graphics state. When the program is finished, it should execute:
+
+.. code-block:: c
+
+ gs_lib_finit(0, 0);
+
+
+
+
+
+
+
+
+.. include:: footer.rst
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/src/Make.rst b/doc/src/Make.rst
new file mode 100644
index 00000000..db3386d7
--- /dev/null
+++ b/doc/src/Make.rst
@@ -0,0 +1,1031 @@
+.. title:: How to Build Ghostscript from Source Code
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+
+.. _Make.htm:
+
+How to Build Ghostscript from Source Code
+=========================================
+
+
+
+
+
+General overview
+------------------------
+
+This document describes how to build a Ghostscript executable from source code. There are four major steps to building Ghostscript:
+
+#. Acquire the compressed archive files of source code for Ghostscript.
+
+#. Unpack the archive files into the Ghostscript directory.
+
+#. Configure the build to match your system and desired configuration options.
+
+#. Invoke "make" to build the software.
+
+
+The remainder of this document describes each of these steps in detail. Note that some of this process is platform-dependent. After building Ghostscript you must then install it; for that, see the :ref:`installation instructions<Install.htm>`.
+
+Long term users of Ghostscript may notice the instructions for a number of older systems have been removed from this document. There is no value judgment implied in this, but recognition that the build system has changed considerably in recent years, and several of these legacy systems are no longer easily available to the development team. We will always consider contributions to continue support for legacy systems.
+
+
+
+Built libraries
+-------------------
+
+The following Ghostscript libraries will be built for these respective platforms:
+
+.. list-table::
+ :header-rows: 1
+
+ * - Platform
+ - Ghostscript library files
+ * - Windows 32-bit
+ - ``gpdldll32.dll`` ``gsdll32.dll``
+ * - Windows 64-bit
+ - ``gpdldll64.dll`` ``gsdll64.dll``
+ * - MacOS
+ - ``libgpdl.dylib`` ``libgs.dylib``
+ * - Linux / OpenBSD
+ - ``libgpdl.so`` ``libgs.so``
+
+
+.. note::
+
+ The actual filenames on MacOS will be appended with the version of Ghostscript with associated symlinks.
+
+
+
+How to acquire the source code
+------------------------------------------------
+
+Building Ghostscript requires the Ghostscript source code itself, and in some cases the source code for the third-party libraries that Ghostscript uses.
+
+Official releases can be found under the AGPL license at:
+
+https://ghostscript.com/download/
+
+Ghostscript source code is packaged in gzip-compressed tar archives (``*.tar.gz``), e.g.:
+
+``ghostscript-#.##.tar.gz``
+
+("#.##" are version numbers.)
+
+Software to decompress and extract both formats is available for almost every platform for which Ghostscript is available -- including Unix, Linux, MS Windows, and so on -- but it's up to you to locate that software. See the section on :ref:`unpacking the source code<Unpack>`.
+
+
+.. note::
+
+ Unlike earlier versions, Ghostscript packages are now one, complete archive, including font files and third party library dependency sources.
+
+
+.. _Acquiring:
+
+
+How to acquire the development source code
+------------------------------------------------------------------------------------------------
+
+The Ghostscript team use git_ for version control.
+
+If you require a snapshot of the development code, the easiest way to get it is to visit the web interface to our git repository: `ghostpdl.git`_ and click the "snapshot" link next to the specific commit in which you are interested. After a short delay, that will download a complete source tree for the given commit in a gzipped tar archive.
+
+If you require access to several commits, or wish to regularly access the latest development code, you are better to clone the entire git repository, using:
+
+.. code-block:: bash
+
+ git clone git://git.ghostscript.com/ghostpdl.git
+
+which will create a local, read-only repository.
+
+Both the "snapshot" and the git clone methods download the Ghostscript sources as part of the GhostPDL source tree, which includes the PCL/PXL and XPS interpreters also built on top of the Ghostscript graphics library.
+
+The configure script discussed later in the document is created as part of the Ghostscript release process, and as the source tree retrieved from git is "pre-release" code, it does not include a pre-made configure script. See :ref:`autogen.sh<autogen_sh>`.
+
+
+.. _Unpack:
+
+How to unpack the source code
+------------------------------------------------------------------------------------------------
+
+Unfortunately, there are no generally accepted standards for how to package source code into archives, so the instructions for unpacking Ghostscript are longer than they should be. We begin with a brief explanation of how to extract the two kinds of archive files.
+
+
+
+.. _TarFiles:
+
+How to unpack compressed tar files generally
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Tar (``.tar``) files are the *de facto* standard for archiving files on Unix (every Unix-like system has the ``tar`` program), and programs to extract their contents are also widely available for MS Windows, and most other environments. To economize on space and downloading time, Ghostscript's tar files are compressed with ``GNU gzip``, which adds the suffix "``.gz``" to the file name, giving "``.tar.gz``".
+
+To unpack a compressed tar file ``MyArchive.tar.gz`` you must both decompress it and extract the contents. You can do this in two steps, one to decompress the file and another to unpack it:
+
+
+.. code-block:: bash
+
+ gzip -d MyArchive.tar.gz
+ tar -xf MyArchive.tar
+
+or in a pipeline:
+
+.. code-block:: bash
+
+ gzip -d -c MyArchive.tar.gz | tar -xf -
+
+or, if you have a program like GNU tar that can handle compressed tar files, with a single command:
+
+
+.. code-block:: bash
+
+ tar -zxf MyArchive.tar.gz
+
+
+The ``tar`` program automatically preserves directory structure in extracting files. The Ghostscript source archive puts all files under a directory ``ghostscript-#.##``, so using tar to unpack a compressed archive should always properly create that directory, which we will call the "ghostscript directory".
+
+Some other programs – under MS Windows, for instance – can also unpack compressed tar files, but they may not automatically preserve directory structure nor even extract files into the current directory. If you use one of these, you must:
+
+- set the program's options to "Use folder names" (or the equivalent).
+
+, and:
+
+- check that it is extracting files into the right place.
+
+As both ``tar`` and ``gzip`` formats are now well supported by several applications on MS Windows, we only supply the ``tar.gz`` archive.
+
+
+WinZip_, `7-zip`_ & `Info-ZIP`_ are respectively a commercial and two free applications which can decompress and extract ``.tar.gz`` archives on MS Windows.
+
+
+
+How to unpack Ghostscript itself
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+At this point you have :ref:`acquired the source code<Acquiring>` and are ready to unpack it according to the :ref:`preceding guidelines<TarFiles>`.
+
+2-step:
+
+.. code-block:: bash
+
+ gzip -d ghostscript-#.##.tar.gz
+ tar -xf ghostscript-#.##.tar
+
+
+Pipe:
+
+.. code-block:: bash
+
+ gzip -d -c ghostscript-#.##.tar.gz | tar -xf -
+
+GNU tar:
+
+.. code-block:: bash
+
+ tar -zxf ghostscript-#.##.tar.gz
+
+
+All the Ghostscript source files are now in subdirectories of the ``ghostscript-#.##`` directory.
+
+
+
+Ghostscript Core Source subdirectories
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+ .. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - Subdirectory
+ - Contents
+ * - ``arch/``
+ - Pre-defined architecture header files
+ * - ``base/``
+ - Graphics library C source code and ``makefiles``
+ * - ``contrib/``
+ - Community contributed/supported output devices
+ * - ``devices/``
+ - The output devices supported by the Ghostscript team
+ * - ``psi/``
+ - PS interpreter C source code and makefiles
+ * - ``Resource/``
+ - Postscript initialization, resource and font files
+ * - ``lib/``
+ - PostScript utilities and scripts used with Ghostscript
+ * - ``doc/``
+ - Documentation
+ * - ``man/``
+ - Unix man pages
+ * - ``examples/``
+ - Sample PostScript files
+ * - ``iccprofiles/``
+ - Default set of ICC profiles
+ * - ``windows/``
+ - Visual Studio for Windows specific project and solution files
+ * - ``toolbin/``
+ - Useful (non-Postscript) tools, mostly for developer use only
+
+
+
+Optionally, if you downloaded the GhostPDL archive, you may also have:
+
+Additional GhostPDL source subdirectories
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+ .. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - Subdirectory
+ - Contents
+ * - ``pcl/``
+ - PCL/PXL interpreter C source code, makefiles, fonts etc.
+ * - ``xps/``
+ - XPS interpreter C source code and makefiles
+
+
+Supporting third party libraries will also be in their own sub-directories (e.g. jpeg, freetype and so on).
+
+
+
+
+How to check for post-release bug fixes
+---------------------------------------------
+
+Bug information and fixes are tracked on `Ghostscript Bugzilla`_.
+
+
+
+.. _Make_MakeFilesOverview:
+
+How to prepare the ``makefiles``
+---------------------------------------------
+
+The Ghostscript ``makefiles`` are very large and complex in order to deal with the diverse requirements of all the different systems where they may be used.
+
+Ghostscript has an automatic configuration script. If you're on unix or a system that supports unix shell scripts, this is the easiest option to use. Simply type:
+
+
+.. code-block:: bash
+
+ ./configure
+
+from the top level of the Ghostscript source directory. It should configure itself based on what's available on your system, warn you of any missing dependencies, and generate a ``Makefile``. At this point you can skip to the section :ref:`invoking make<invokingMake>` below. Also, many common configuration options (like install location) can be set through options to the ``configure`` script.
+
+Type ``./configure --help`` for a complete listing. Note that the configuration option is only available with the unix ``.tar`` distributions of the source.
+
+.. _autogen_sh:
+
+
+.. note::
+
+ If you're building Ghostscript from development source out of a repository instead of from a released source package, you should run ``./autogen.sh`` instead of ``./configure``. This script takes all the same options that ``configure`` does.
+
+If your system doesn't support the ``configure`` script or you don't wish to use it, you can use the traditional Ghostscript ``makefile`` system, editing the options by hand to match your system as described below. Fortunately, the only ``makefiles`` you're likely to want to change are relatively small ones containing platform-specific information.
+
+
+.. _platformSpecificMakefiles:
+
+Platform-specific makefiles
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - Makefile
+ - Used for
+ * - ``Makefile.in``
+ - Template ``makefile`` for the ``autoconf`` build.
+ * - ``psi/msvc.mak``
+ - MS Windows with Microsoft Visual Studio 2003 and later.
+ * - ``base/unix-gcc.mak``
+ - Unix with ``gcc``.
+ * - ``base/unixansi.mak``
+ - Unix with ANSI C compilers other than ``gcc``.
+
+
+A number of platform indepdent ``makefiles`` in each of the core Ghostscript source directories. Since these files can change from one Ghostscript version to another, sometimes substantially, and since they all include documentation for the various options, here we don't duplicate most of that documentation: we recommend strongly that you review the entire ``makefile`` specific for your operating system and compiler before building Ghostscript.
+
+
+.. _PreparingMakefiles:
+
+Changes for your environment
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Assuming you have opted not to use the ``configure`` script or the default Microsoft Visual Studio bulid, you must edit the platform-specific ``makefile`` to change any of these:
+
+- The name of the ``makefile`` itself (``MAKEFILE`` macro).
+
+- The locations to install Ghostscript files (prefix etc.).
+
+- The default search paths for the initialization and font files (``GS_LIB_DEFAULT`` macro).
+
+- The debugging options (``DEBUG`` and ``TDEBUG`` macros).
+
+- Which optional features to include (``FEATURE_DEVS``).
+
+- Which device drivers to include (``DEVICE_DEVS`` and ``DEVICE_DEVS{1--20}`` macros).
+
+- Default resolution parameters for some printer drivers (``devs.mak`` or ``contrib.mak``, whichever defines the driver).
+
+
+
+In general these will be set to commonly sensible values already, but may not be ideal for your specific case.
+
+
+
+The :ref:`platform-specific makefiles<platformSpecificMakefiles>` include comments describing all these except the ``DEVICE_DEVS`` options. These are described in ``devs.mak`` and ``contrib.mak``, even though the file that must be edited to select them is the :ref:`platform-specific makefile<platformSpecificMakefiles>`.
+
+Some platform-specific options are described in the sections for individual platforms. See the "Options" section near the beginning of the relevant ``makefile`` for more information.
+
+
+
+
+
+Selecting features and devices
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You may build Ghostscript with any of a variety of features and with any subset of the available device drivers. The complete list of features is in a comment at the beginning of ``gs.mak``, and the complete list of drivers in comments at the beginning of ``devs.mak`` and ``contrib.mak``. To find what devices a platform-specific ``makefile`` selects to include in the executable, look in it for all lines of the form:
+
+
+.. code-block:: bash
+
+ FEATURE_DEVS={list of features}
+ DEVICE_DEVS*={list of devices}
+
+
+For example, if the ``makefile`` has:
+
+
+.. code-block:: bash
+
+ FEATURE_DEVS=$(PSD)level2.dev
+
+
+indicating that only the PostScript Level 2 facilities should be included, you might make it:
+
+
+
+.. code-block:: bash
+
+ FEATURE_DEVS=$(PSD)level2.dev $(PSD)pdf.dev
+
+
+to add the ability to interpret PDF files. (In fact, ``FEATURE_DEVS`` in the current Unix ``makefiles`` already includes ``$(PSD)pdf.dev``.).
+
+It is extremely important that ``FEATURE_DEVS`` is set correctly. Currently, the default builds will include a complete feature set, and as such most of those building Ghostscript will have no need to change it. Only those working in heavily resource constrained environment will want to experiment, and it is vital that the implications of such changes be understood, otherwise Ghostscript may behave in unexpected or apparently incorrect ways, or may even fail to build.
+
+
+The Unix ``makefile`` also defines:
+
+
+.. code-block:: bash
+
+ DEVICE_DEVS=$(DD)x11.dev
+
+
+indicating that the X Windows driver should be included, but since platform-specific ``makefiles`` as distributed normally include many of the possible features and drivers, you will probably rather remove from the ``makefile`` the features and drivers you don't want. It does no harm to include unneeded features and devices, but the resulting executable will be larger than needed.
+
+You may edit the ``FEATURE_DEVS`` line to select or omit any of the features listed near the beginning of ``gs.mak``, and the ``DEVICE_DEVS*`` lines to select or omit any of the device drivers listed near the beginning of ``devs.mak`` and ``contrib.mak``. ``GS_DEV_DEFAULT`` is a string containing whitespace separate device names, and give the devices Ghostscript should attempt to use (and the order) if no device is specified on the command line; see the usage documentation for how to select an output device at run time using the ``-sDEVICE=`` switch. If you can't fit all the devices on a single line, you may add lines defining:
+
+.. code-block:: bash
+
+ DEVICE_DEVS1=$(DD){dev11}.dev ... $(DD){dev1n}.dev
+ DEVICE_DEVS2=$(DD){dev21}.dev ... $(DD){dev2n}.dev
+
+
+etc., up to ``DEVICE_DEVS15``. Don't use continuation lines -- on some platforms they don't work.
+
+
+.. note::
+
+ If you want to include a driver named ``xxx``, you must put ``$(DD)xxx.dev`` in ``DEVICE_DEVS*``. Similarly, if you want to include a feature related to the PostScript or PDF language interpreters (PostScript level 1 .. 3, or other language features such as the ability to read EPSF files or TrueType font files), you must represent it as ``$(PSD)xxx.dev``.
+
+
+Precompiled run-time data
+""""""""""""""""""""""""""""""""""
+
+Ghostscript normally reads a number of external data files at run time: initialization files containing PostScript code, fonts, and other resources such as halftones. By changing options in the top-level ``makefile`` for the platform, you can cause some of these files to be compiled into the executable: this simplifies installation, improves security, may reduce memory requirements, and may be essential if you are planning on putting Ghostscript into ROM. Compiling these files into the executable also means the executable is (largely) self-contained, meaning initialization files, font files, resource files and ICC profile files are certain to be available and accessible. In general, Ghostscript should initialize more quickly, and files (especially PDF) files making heavy use of the built-in fonts will interpret more quickly.
+
+For those distributing Ghostscript binaries, compiling those files into the executable has another implication, any site-specific customizations (such as font and ``CIDFont`` substitutions) are slightly more complex to implement - see: :ref:`How Ghostscript finds files<Use_How Ghostscript finds files>` for how to influence where Ghostscript searches for files. Furthermore, if the files Ghostscript uses are also required to be accessible by applications other than Ghostscript (the mostly case for this would be font files and ICC profile files), having those files compiled into Ghostscript maybe suboptimal, essentially require two copies of the file data to be distributed (one set built into Ghostscript, and the other as "normal" files accessible outside of Ghostscript.
+
+
+
+Compiling the initialization files (``Resource/Init/gs_init.ps``, etc.) into the executable is the default. To disable this, change the 1 to a 0 in the line:
+
+
+.. code-block:: postscript
+
+ COMPILE_INITS=1
+
+
+Or, if you use the configure based Unix-style build, you can disable ``COMPILE_INITS`` by adding the option ``--disable-compile-inits`` to the invocation of configure
+
+Files are now compiled into the executable as a ``%rom%`` file system that can be searched, opened, etc. as with the normal (``%os%``) file system. The data is (mostly) compressed. Several of the initialisation files (those in ``Resource/Init``) are also converted to binary Postscript encoding, and "merged" into a single monolithic file - this is done for both size and speed optimization. Files that are often customized for individual installations (such as ``Fontmap`` and ``cidfmap``) are not merged into the single file and thus installation specific versions can be used.
+
+The set of files built into the ``%rom%`` file system is specified in the ``psi/psromfs.mak`` file. By default the set of files built into the rom file system comprises all the resource files Ghostscript requires to run successfully (all the files under ``Resource`` directory, and those under the ``iccprofiles`` directory). Refer to the file ``base/mkromfs.c`` for a description of the parameters that control source and destination pathnames, file enumeration exclusion, compression, etc.
+
+Fonts normally are compiled into the executable using ``mkromfs`` (above) from the ``Resource/Font/`` directory.
+
+Similarly, Halftone resources can be compiled into the executable using ``mkromfs``, but also threshold-array halftones can be compiled into the executable. See the "Compiled halftone" section of ``int.mak`` for a sample ``makefile`` fragment, ``genht.c`` for the syntax of halftone data files, and ``lib/ht_ccsto.ps`` for a sample data file. Note that even though the data files use PostScript syntax, compiled halftones do not require the PostScript interpreter and may be used with the graphics library alone.
+
+
+Setting up "makefile"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+After going through the steps just described to :ref:`unpack the sources<Unpack>`, configure the build and make any desired :ref:`changes to the makefiles<PreparingMakefiles>`. As the final step in preparing to build Ghostscript you must usually associate the name "makefile" with the correct ``makefile`` for your environment so the make command can find it. See the section on your particular platform for how to do that if necessary.
+
+On unix systems, ``./configure`` (or if checked out of git, ``./autogen.sh``) should create a ``Makefile`` which works in most scenarios. Manual tampering and editing should rarely be needed nor recommended.
+
+
+
+
+.. _invokingMake:
+
+
+Invoking "make"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``make``
+ Builds Ghostscript without debugging options.
+
+
+.. _Make_Debugging:
+
+``make debug``
+ Builds Ghostscript with debugging options and additional internal error checks. The program will be somewhat larger and slower, but it will behave no differently unless you actually turn on debugging options at execution time with the ``-DDEBUG`` or :ref:`-Z command line switches<Use_Debugging>` described in the usage documentation.
+
+``make pg``
+ On Unix platforms, builds with the ``-pg`` compiler switch, creating an executable for time profiling.
+
+``make install``
+ After building, installs the Ghostscript executables, support files, and documentation, but does not install fonts. See the :ref:`installation documentation<Install.htm>`.
+
+``make (debug)clean``
+ Deletes all the files created by the build process (relocatables, executables, and miscellaneous temporary files). If you've built an executable and want to save it, move it first to another place, because "make clean" deletes it.
+
+
+.. _Make_SharedObject:
+
+``make so``
+ On some platforms (Linux, \*BSD, Darwin/Mac OS X, SunOS), it is possible to build Ghostscript as a shared object library. There is a corresponding ``make soclean`` for cleaning up.
+
+``make sanitize``
+ Builds Ghostscript with ``AddressSanitizer``. Output is placed in ``./sanbin``.
+
+
+
+.. note::
+
+ - On most platforms some of these simple instructions don't quite work in one way or another. Read the section on your specific platform.
+
+ - If you are attempting to build a statically linked executable, you will probably need to add libraries to the linker options (libraries that are normally pulled-in automatically by the dynamic linker). These can be added at the make command line using the ``EXTRALIBS=`` option. Unfortunately, the set of libraries that may be required varies greatly depending on platform and configuration, so it is not practical to offer a list here.
+
+
+
+Cross-compiling
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Cross-compiling is not fully supported by the configure script (such support is a work-in-progress).
+
+You can either use ``base/unixansi.mak`` or ``unix-gcc.mak`` as the basis for a cross-compile ``makefile``, or use configure to create a basic ``Makefile`` as the basis. And modify to suit.
+
+You can set the compiler to your cross-compiler for configure by doing:
+
+
+.. code-block:: bash
+
+ ./configure CC=<cross-compiler executable>
+
+
+and configure will then run its checks (as best it can) with the cross-compiler.
+
+If you do so, you should also give configure the option to set the target architecture endianness: ``--enable-big-endian`` or ``--enable-little-endian``.
+
+It would also be wise to review the settings shown in the output of ``./configure --help`` for any that would be applicable to your target.
+
+
+The Ghostscript build system uses several interim executables, built and run on the host, as such, even when cross-compiling, a host native compiler is also required. You must edit your ``makefile`` to ensure that is available. Find the line that starts:
+
+``CCAUX=``
+
+and set that to your host compiler.
+
+If you did not use configure or did not set the CC variable for configure, you must also set the:
+
+``CC=``
+
+to your cross-compiler.
+
+The Ghostscript build system uses a utility called ``genarch`` (see ``base/genarch.c`` for details) to interrogate the environment and generate a header file describing the architecture for which Ghostscript is being built. As this is run on the ``host`` it will generate header for the ``host architecture`` rather than that of the target.
+
+For cross compiling, you must create (or modify) a header file (``arch.h``) which accurately describes the ``target architecture``. Then you must edit your ``makefile`` by finding the line:
+
+``TARGET_ARCH_FILE=``
+
+and set it to the path to, and file name of your custom ``arch.h`` file. With that setting, ``genarch`` will still be run, but rather than interrogate the current environment, it will copy the contents of your custom ``arch.h`` to the build.
+
+
+
+
+How to build Ghostscript from source (PC version)
+-------------------------------------------------------------
+
+All Ghostscript builds in PC (DOS and MS Windows) environments are 32- or 64-bit: 16-bit builds are not supported. The relevant ``makefiles`` are:
+
+
+.. list-table::
+ :widths: 20 40 40
+ :header-rows: 1
+
+ * - Makefile
+ - Construction tools
+ - For environment
+ * - ``msvc.mak``
+ - :ref:`Microsoft Visual Studio .NET 2003 (or later)<Microsoft build>`
+ - MS Windows 32/64-bit
+ * - ``Makefile.in``
+ - :ref:`Cygwin/gcc<Cygwin build>`
+ - Cygwin (Use Unix configure)
+
+
+Ghostscript requires at least MS Windows 95 (although we no longer actively test nor support Win95, we have not deliberately done anything to break compatibility with it). We recommend at least MS Windows NT 4.0.
+
+For building, Ghostscript requires at least Visual Studio .NET 2003, and we recommend at least Visual Studio 2005 (required for 64 bit Windows support).
+
+
+.. note::
+
+ The ``make`` program supplied with Visual Studio (and earlier Visual C++ versions) is actually called ``nmake``. We refer to this program generically as make everywhere else in this document.
+
+You must have ``cmd.exe`` in your path to build Ghostscript (using the Visual Studio command prompt is ideal). After making any changes required to choose features and devices to build into the executable, you can then invoke ``make`` to build the executable.
+
+
+.. _Microsoft build:
+.. _Make Building with Visual Studio:
+
+Microsoft Visual Studio
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Using Microsoft Visual Studio
+""""""""""""""""""""""""""""""""
+
+To build the required DLLs, load ``/windows/ghostpdl.sln`` into Visual Studio, and select the required architecture from the drop down - then right click on 'ghostpdl' in the solution explorer and choose "Build".
+
+Further details
+""""""""""""""""""
+
+The Ghostscript source distribution ships with ``project`` and ``solution`` files for Visual Studio 2005 and later. These can be found in the ``windows`` directory. The ``project(s)`` are ``nmake projects`` which means that rather than Visual Studio controlling the build directly, it delegates the build process to the ``nmake``.
+
+Beyond lacking support for parallel builds (``nmake`` cannot support parallel builds), there should be little visible difference between a conventional VS project and an ``nmake project`` to the user of the VS graphical interface. The only exception to that is if you have to make changes to build options beyond those available in the defined build configurations. In that case, you need to find the ``Nmake`` tab in the project ``Property Pages`` and modify the appropriate entry: ``Build Command Line``, ``Rebuild All Command Line`` and/or ``Clean Command Line``.
+
+As mentioned above, ``nmake`` does not support parallel builds. If you have downloaded and are building the GhostPDL source archive (which contains Ghostscript, GhostPCL, GhostXPS, and GhostPDL "products"), the ``GhostPDL.sln`` contains individual projects for each product but, as a result of the limitations of ``nmake`` the products cannot be built in parallel, because ``nmake's`` lack of parallel build awareness means it cannot manage the dependencies shared between the products, and may fail as multiple builds attempt to access the same dependencies.
+
+To build all the products in one action, use the ``All`` "pseudo-project". The ``All`` project uses a single nmake invocation to build all the supported products.
+
+
+.. note::
+
+ Changing the ``Output`` property in the ``Nmake`` properties will not change the name of the executable - to do that requires editing of the ``psi/msvc.mak makefile``, or you can add: ``GS=myname.exe`` to the ``nmake`` command line.
+
+
+Using the command line
+""""""""""""""""""""""""""""""""
+
+Ghostscript can be made using the Windows command prompt or one of the various command line shells made for Windows, as long as the command line syntax is compatible with the Windows ``CMD.exe``. The Visual Studio command prompt is ideal.
+
+In order for the ``makefiles`` to work properly, two items may have to be changed. An attempt is made to select the correct version of Microsoft Visual C++ based on the version of ``nmake``. If this doesn't work it will default to version 6.x. If the auto-detection does not work, and you are not using version 6.x then before building, in ``psi\msvc.mak`` find the line ``#MSVC_VERSION=6`` and change it to ``MSVC_VERSION=4``, ``MSVC_VERSION=5``, ``MSVC_VERSION=7`` or ``MSVC_VERSION=8`` and so on.
+
+In some cases the location of the Microsoft Developer Studio, needs to be changed. The location of Microsoft Developer Studio is defined by the value of ``DEVSTUDIO``. There are several different definitions of ``DEVSTUDIO`` in ``psi\msvc.mak``. There is one for each of the currently supported versions of Microsoft Visual C++ (4, 5, 6, 7, 7.1 and 8).
+
+The normal installation process for Microsoft Visual C++ includes setting the location of the Microsoft Visual C++ executables (``cl.exe``, ``link.exe``, ``nmake.exe``, ``rc.exe``) in your ``PATH`` definition and the ``LIB`` and ``INCLUDE`` environment variables are set to point to the Microsoft Visual C++ directories. If this is true then the value for ``DEVSTUDIO`` can be changed to empty, i.e. ``DEVSTUDIO=``
+
+If ``PATH``, ``LIB``, and ``INCLUDE`` are not correctly set then the value for ``DEVSTUDIO`` needs to be defined. For example, for version 6.0, the default definition for the location for the Microsoft Developer Studio is: ``DEVSTUDIO=C:\Program Files\Microsoft Visual Studio`` If the path to Microsoft Developer Studio on your system differs from the default then change the appropriate definition of ``DEVSTUDIO``. (Remember that there is a separate definition of ``DEVSTUDIO`` for each version of ``MSVC``, so be sure to change the correct definition.)
+
+To run the make program, give the command:
+
+
+.. code-block:: bash
+
+ nmake -f psi\msvc.mak
+
+
+Rather than changing ``psi/msvc.mak``, these values can also be specified on the make command line, i.e.
+
+
+.. code-block:: bash
+
+ nmake -f psi\msvc.mak MSVC_VERSION=6 DEVSTUDIO="C:\Program Files\Microsoft Visual Studio"
+ nmake -f psi\msvc.mak MSVC_VERSION=7 DEVSTUDIO="C:\Program Files\Microsoft Visual Studio .NET"
+
+
+Note that double quotes have been added around the path for ``DEVSTUDIO`` due to the spaces in the path value.
+
+This command line can also be put into a ``batch`` file.
+
+You may get warning messages during compilation about various undefined and/or unsupported switches - this is because the compiler switches are set in the ``makefiles``, and are applied when building with all versions of Visual Studio, but not all options are supported (or required) by all versions of Visual Studio. These warnings are benign and can be ignored.
+
+
+
+Microsoft Environment for 64-bit
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Building Ghostscript for 64-bit Windows (AMD64 processor) requires Microsoft Visual Studio .NET 2005 or Microsoft Visual Studio 2008 or later on 64-bit Windows. Cross compiling on 32-bit Windows is possible.
+
+Compiling for 64-bit is similar to the Microsoft Environment instructions above, but with the addition of a ``WIN64`` define.
+
+To make Ghostscript use:
+
+
+.. code-block:: bash
+
+ nmake -f psi/msvc.mak WIN64=
+
+
+Making self-extracting installers
+""""""""""""""""""""""""""""""""""""""
+
+You can build self-extracting Windows installers based on NSIS (Nullsoft Scriptable Install System). To do so, use the ``nsis makefile`` target as well as any other options, for example:
+
+
+.. code-block:: bash
+
+ nmake -f psi/msvc.mak WIN64= nsis
+
+
+will create an ``nsis`` based installer for Ghostscript built for 64 bit Windows systems.
+
+
+Microsoft Environment for WinRT
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript can be built in the form of a ``win32 DLL`` for use within a Windows Runtime application or Windows Runtime component. Building for WinRT requires use of Microsoft Visual Studio 2012. There is a solution file that can be loaded into VS 2012, in the directory ``winrt``.
+
+The WinRT application or component should include ``iapi.h`` from ``gs/psi`` and link with ``gsdll32metro.lib`` from ``gs/debugbin`` or ``gs/releasebin``. Also any app using Ghostscript either directly or via a component should add ``gsdll32metro.dll`` as "content". This inclusion of the dll is necessary so that it will be packaged with the app. If one wishes to be able to run the debugger on Ghostscript then ``gsdll32metro.pdb`` should also be added as content.
+
+
+.. _Cygwin build:
+
+Cygwin32 gcc
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+It is possible to compile Ghostscript for MS Windows using the Cygwin32 gcc compiler, ``GNU make``, using the "configure" generated ``Makefile``.
+
+Information about this compiler and environment is at the `Cygwin site`_.
+
+
+MSys/Mingw
+""""""""""""""
+
+The configure build can be used to build Ghostscript on ``MSys/Mingw`` systems, but with a caveat. The ``msys-dvlpr`` adds header files into the compiler's header search paths which cause a clash, and the build will fail as a result. If you have the ``msys-dvlpr`` package installed, and until a better solution is available you can work around this by temporarily renaming the ``\mingw\msys\1.0\include`` directory so those headers are no longer found by the compiler.
+
+
+
+.. _Make Building with MacOS:
+
+How to build Ghostscript from source (MacOS version)
+---------------------------------------------------------
+
+MacOS X
+~~~~~~~~~~~~~
+
+The unix source distribution (``.tar.gz``) builds fine on Darwin/MacOS X, albeit without a display device. You can generally just use the ``Makefile`` generated by configure as your top-level ``makefile`` and get a reasonable default build. This will allow you to use Ghostscript from the command line as a BSD-layer tool to rasterize postscript and pdf to image files, and convert between the high-level formats supported by Ghostscript. See the :ref:`instructions for the unix build<MakeHowToBuildForUnix>` below for details of how to customize this build.
+
+
+.. note::
+
+ If you have MacPorts_ installed, it can "confuse" the configure script because it includes some librares which duplicate the "system" ones. This can cause missing symbol link errors. In order to resolve this, you can do: ``LDFLAGS="-L/usr/lib" ./configure``. That will force the linker to search the default directory first, and thus pick up the system libraries first.
+
+It is also possible to build "universal binaries" for MacOS X, containing i386 and x86_64 binaries in one file, using the ``Makefile`` from ``configure``. This can be achieved by using the following invocation of ``configure``:
+
+
+.. code-block:: bash
+
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc" CPP="gcc -E"
+
+
+
+You can choose the combination of valid architectures (i386/x86_64/ppc) that you require.
+
+The separate options for ``CC`` and ``CPP`` are required because some of the features used by configure to explore the capabilities of the preprocessor are not compatible with having multiple ``-arch`` options.
+
+Building a shared library on MacOS X is the same as for other Unix-like systems, the "configure" step is done normally, and the "so" target is given to the make invocation, thus:
+
+.. code-block:: bash
+
+ make so
+
+The only difference compared to other Unix-like systems is that on OS X the resulting shared library is created with the ".dylib" file name extension, instead of the more usual ".so".
+
+
+.. _Make Building with Unix:
+.. _MakeHowToBuildForUnix:
+
+How to build Ghostscript from source (Unix version)
+---------------------------------------------------------
+
+Ghostscript now ships with a build system for unix-like operating systems based on ``GNU Autoconf``. In general the following should work to configure and build Ghostscript:
+
+
+.. code-block:: bash
+
+ ./configure
+ make
+
+or
+
+.. code-block:: bash
+
+ ./configure
+ make so
+
+for building Ghostscript as a shared library.
+
+Please report any problems with this method on your system as a bug.
+
+On modern unix systems, ``./configure`` should create a ``Makefile`` which works in most scenarios. Manual tempering and editing should rarely be needed nor recommended.
+
+.. note::
+
+ If you're building Ghostscript from development source out of a repository instead of from a released source package, you should run ``./autogen.sh`` instead of ``./configure``. This script takes all the same options that ``configure`` does.
+
+(deprecated; see Autoconf-based method above) For the convenience of those already familiar with Ghostscript, the old method based on hand-edited makefiles is still possible but no longer supported (and in many cases, simply do not work without substantial expert manual-editing effort). It may also be helpful in getting Ghostscript to build on very old platforms. The rest of this section deals exclusively with that older method and includes numerous pointers regarding legacy systems.
+
+(deprecated; see Autoconf-based method above) Before issuing the make command to build Ghostscript, you have to make some choices, for instance:
+
+- Which compiler to use.
+
+- What features and devices to include.
+
+- Whether to use system libraries for PNG and zlib.
+
+- How to handle issues for your particular platform.
+
+Be sure to check the sections on tool-, OS-, and hardware-specific issues for notes on your particular platform and compiler. In fact, that is the first place to check if you build Ghostscript and it crashes or produces obviously incorrect results.
+
+
+
+
+make tools
+~~~~~~~~~~~~~~
+
+You require a make tool which supports separate directories for the derived objects (such as object files, executables and dynamically created header files) and the source files.
+
+In general, GNU make is the recommended choice, and some features (such as the building of the Linux/Unix shared library build ("make so") are only available with GNU make.
+
+Other make implementations are known to work, but are not guaranteed to do so.
+
+
+GNU make
+"""""""""""""
+
+Current versions of ``GNU make`` have no problems building Ghostscript.
+
+
+
+OS-specific issues
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+MacOS or Linux / OpenBSD
+""""""""""""""""""""""""""""""""""""""""
+
+Running the ``autogen.sh`` script from the command line depends on having both ``autoconf`` and ``automake`` installed on your system.
+
+If this software is not already on your system (usually this can be found in the following location: ``usr/local/bin``, but it could be located elsewhere depending on your setup) then it can be installed from your OS's package system.
+
+Alternatively, it can be installed from `GNU Software`_
+
+
+Or, it can be installed via Brew by running:
+
+.. code-block:: bash
+
+ brew install autoconf automake
+
+Once built, these libraries can be found in your ``ghostpdl/sobin/`` or ``ghostpdl/sodebugbin`` location depending on your build command.
+
+
+
+H-P RISC workstations
+""""""""""""""""""""""""""
+
+(see Autoconf-based method above)
+
+- HP-UX versions before 11.0 do not support ``POSIX`` threads. Set ``SYNC=nosync`` in the ``makefile`` before building.
+
+- Ghostscript builds on H-P machines with either ``GNU gcc`` or H-P's ANSI-capable ``cc``. The minimal, non-ANSI-capable ``cc`` that shiped with some basic HPUX system does not work. If ``cc`` on your system doesn't accept the ``-Aa`` switch, then you need to get the full ``cc`` or ``gcc``.
+
+- If you use H-P's compiler, be sure you have upgraded to a recent release. Many bizarre symptoms have been reported trying to build Ghostscript with older, buggier compilers, for example:
+
+ - The link step fails with a message about "max" not being defined.
+
+ - The build succeeds, but the resulting executable fails to start up, with an error message like "Initializing... Unrecoverable error: typecheck in .registerencoding".
+
+ - The build succeeds, but the resulting executable produces a black background on the first page of output.
+
+- It is reported that On HPUX 9.* you need at least compiler patch PHSS_5723 and ``dld.sl`` patch PHSS_5734 to build Ghostscript. (As of late 1997, those patches are long obsolete; the current patches are compiler PHSS_10357 and ``dld.sl`` PHSS_11246. It is unknown whether current Ghostscript releases work with ``compiler/dld.sl`` versions older than these).
+
+- On HPUX 10.*, we don't know what combinations of compiler version and switches work. It is reported that On HPUX 10.20, setting ``CC=c89`` and ``CFLAGS=+O3 $(XCFLAGS)`` works, contradicting the information in the next paragraph, but this may be dependent on the specific compiler version.
+
+- In either HPUX version, you need to set ``CC=cc -Aa`` (or use ``-Ae`` if you prefer), and set ``CFLAGS=-D_HPUX_SOURCE -O $(XCFLAGS)``. Higher levels of optimization than -O may work depending on your compiler revision; some users have reported success with +O3, some have not.
+
+- Some users have reported needing ``-DNOSYSTIME`` and ``-D_POSIX_SOURCE`` in ``CFLAGS``, but recent tests do not show these to be necessary.
+
+- If you use ``gcc``, it's a good idea to have a recent release -- at the very least 2.7.2.1 or later. You may be able to get a working executable with an older ``gcc`` by removing ``-O`` from ``CFLAGS``.
+
+
+IBM AIX
+""""""""""""""""""""""""""
+
+We recommend installing ``gcc`` and ``GNU make``, and using the Autoconf-based method.
+
+Other combinations are known to work, but are less well supported.
+
+Recent veresions of Ghostscript can trigger a 'TOC overflow' error with some compilers on AIX. If this occurs, use the linker flag ``-bbigtoc``, which can either be added to your configure options:
+
+
+.. code-block:: bash
+
+ configure LDFLAGS="-Wl,-bbigtoc"
+
+
+Or on the make command line:
+
+
+.. code-block:: bash
+
+ make XLDFLAGS="-Wl,-bbigtoc"
+
+
+
+Silicon Graphics
+""""""""""""""""""""""""""
+
+(see Autoconf-based method above)
+
+Users have had a lot of problems with the MIPSpro compilers on SGI systems. We recommend using ``gcc``. If you do choose to use the MIPSpro compiler, please read the following carefully.
+
+- To make the optimizer allocate enough table space, set:
+
+ ``CFLAGS="-Olimit 2500"`` (for older compilers)
+ ``CFLAGS="-OPT:Olimit=2500"`` (for newer compilers)
+
+- MIPSpro compiler version 3.19 is "older", and 7.1 is "newer"; we aren't sure at what point in between the latter syntax was introduced.
+
+- With the compiler shipped with Irix 5.2, use the ``-ansi`` option.
+
+- The SGI C compiler may produce warnings about "Undefined the ANSI standard library defined macro stdin/stdout/stderr". To suppress these warnings, add ``-woff 608`` to the definition of ``CFLAGS``.
+
+- The SGI C compiler shipped with Irix 6.1 and 6.2 will not compile ``zlib/deflate.c`` properly with optimization. Compile this file separately without ``-O``.
+
+- With IRIX 6.5.x and the MIPSpro 7.x compilers there have been reports about incorrect output and binaries that cause segmentation faults. Various solutions have been suggested and you may want to try them in this order, until you get a working binary:
+
+ - Compile ``idict.c`` and ``isave.c`` separately without optimization after doing a normal compile; then relink.e.g.:
+
+ .. code-block:: bash
+
+ cc -OPT:Olimit=2500 -I. -I./obj -o ./obj/idict.o -c ./idict.c
+ cc -OPT:Olimit=2500 -I. -I./obj -o ./obj/isave.o -c ./isave.c
+
+
+ - Set ``CFLAGS=`` (no optimization).
+
+ - Use only ``-O2``. Compiler produces incorrect output with ``-O3`` or ``-Ofast=ip32 -show``.
+
+ - Irix 6.5.1m with MIPSpro compiler 7.2.1.1m, Irix 6.5.3m with MIPSpro compiler 7.2.1, and probably other 6.5x / 7.2x combinations require compiling with the ``-o32`` option. Compiling with the (default) ``-n32`` option produces non-working executables. ``-O2`` is OK (possibly except for ``idict.c``), but not ``-O3``.
+
+
+Oracle/Sun
+~~~~~~~~~~~~~~~~
+(see Autoconf-based method above)
+
+- The Sun unbundled C compiler (SC1.0) doesn't compile Ghostscript properly with the ``-fast`` option: Ghostscript core-dumps in ``build_gs_font``. With that compiler use ``-g``, or use ``gcc`` instead.
+
+- The Sun version of ``dbx`` often gives up with an error message when trying to load Ghostscript. If this happens, use ``GNU gdb`` instead. (``gdb`` is more reliable than ``dbx`` in other ways as well).
+
+- A bug in some versions of ``zlib`` results in an undefined symbol ``zmemcmp`` when compiling with Sun ``cc``. Use ``gcc`` instead.
+
+
+
+Solaris
+~~~~~~~~~~~~~~~~
+
+- Solaris 2.2 may require setting ``EXTRALIBS=-lsocket``. Solaris 2.3 and later seem to require ``EXTRALIBS=-lnsl -lsocket -lposix4``.
+
+- For Solaris 2.6 (and possibly some other versions), if you set ``SHARE_LIBPNG=1``, ``SHARE_ZLIB=1``, or ``SHARE_JPEG=1``, you may need to set ``XLDFLAGS=-R /usr/local/xxx/lib:/usr/local/lib`` using the full path names of the relevant directories.
+
+- Solaris 2.n uses ``/usr/openwin/share/include`` for the X11 libraries rather than ``/usr/local/X/include``.
+
+- Solaris 2.n typically has Type 1 fonts in ``/usr/openwin/lib/X11/fonts/Type1/outline``.
+
+- For Solaris 2.n in the ``makefile`` you must change the definition of ``INSTALL`` from ``install -c`` to ``/usr/ucb/install -c``.
+
+- You may need to set ``XLIBDIR`` to the directory that holds the X11 libraries, as for other SVR4 systems. Set ``-DSVR4`` in ``CFLAGS``.
+
+- If you are using the SunPRO C compiler, don't use optimization level ``-xO3``. On ``SPARC`` platforms the compiler hangs; on Intel platforms the generated code is incorrect. With this compiler on Intel, do not use the ``-native`` flag: floating point computations become unacceptably inaccurate. You can use ``-xcg92`` (``SPARC V8``) and ``-dalign`` for better performance.
+
+- One user reported compiling from source on a Linux NFS mounted volume failed. Compiling from a local volume was the workaround.
+
+
+Other environments
+--------------------
+
+Environments lacking multi-threading
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+All environments mentioned here by name have multi-threading capability. However, if your environment doesn't, you can remove all need for multi-threading by setting ``SYNC=nosync`` in the top-level ``makefile``. Note that you will not be able to use any so-called "async" drivers (drivers that overlap interpretation and rasterization) if you do this. No such drivers are in the ``DEVICE_DEVS*`` lists of any ``makefile`` that we distribute.
+
+Plan 9
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Use ``unix-gcc.mak``, editing it to define:
+
+.. code-block:: bash
+
+ CC=cc GCFLAGS=-D_BSD_EXTENSION -DPlan9
+
+You will also probably have to edit many path names.
+
+
+
+.. _Make_USFTBuild:
+
+
+How to build Ghostscript with UFST
+-------------------------------------------
+
+
+.. note::
+
+ This section is only for customers who have a Monotype Imaging UFST license. Other users please skip this section.
+
+
+Ghostscript sources do not include UFST sources. You need to obtain them separately. The Ghostscript distributed source include only some source modules that provide a bridge to UFST. You will also need an additional, UFST specific makefile: contact Ghostscript support for more information.
+
+If optioned in, the Ghostscript build system will build the UFST as part of the normal bulid process (previously, the UFST was required to be built separately).
+
+To build Ghostscript with UFST, specify additional options for "make":
+
+``UFST_BRIDGE=1``
+ Forces the UFST bridge to build.
+
+``UFST_ROOT=path``
+ Specifies the path to UFST root directory or folder.
+
+``UFST_CFLAGS=options``
+ Specifies C compiler options for UFST library. Refer to UFST manual for information about them.
+
+``UFST_LIB_EXT=extension``
+ Sets the file name extension for object libraries. You must use the appropriate one for your platform and linker.
+
+
+An example for Unix/GCC :
+
+
+.. code-block:: bash
+
+ UFST_BRIDGE=1 UFST_ROOT=../ufst UFST_CFLAGS=-DGCCx86 UFST_LIB_EXT=.a
+
+
+Starting with Ghostscript 9.x (Summer 2010), the above options are conveniently inserted in the ``Makefile`` with (this also automatically disable the freetype bridge):
+
+.. code-block:: bash
+
+ ./configure --with-ufst=../ufst
+
+For Windows/MSVC you need only specify ``UFST_ROOT``. ``msvc.mak`` sets the other options automatically.
+
+
+
+
+
+
+
+
+
+.. External links:
+
+
+.. _git: http://git-scm.com/
+.. _ghostpdl.git: http://git.ghostscript.com/?p=ghostpdl.git;a=summary
+
+.. _WinZip: http://www.winzip.com/
+.. _7-zip: http://www.7-zip.org/
+.. _Info-ZIP: http://www.info-zip.org/
+
+.. _Ghostscript Bugzilla: http://bugs.ghostscript.com
+.. _Cygwin site: http://www.cygwin.com/
+.. _MacPorts: http://www.macports.org/
+
+.. _GNU Software: https://www.gnu.org/software/
+
+
+.. include:: footer.rst
+
+
diff --git a/doc/src/News.rst b/doc/src/News.rst
new file mode 100644
index 00000000..0395db28
--- /dev/null
+++ b/doc/src/News.rst
@@ -0,0 +1,17 @@
+.. title:: News
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _News.htm:
+
+News
+============================================
+
+.. raw:: html
+ :file: ../News.htm
+
+
+
diff --git a/doc/src/Ps-style.rst b/doc/src/Ps-style.rst
new file mode 100644
index 00000000..3ad6fe9b
--- /dev/null
+++ b/doc/src/Ps-style.rst
@@ -0,0 +1,330 @@
+.. title:: Ghostscript PostScript Coding Guidelines
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Ps-style.htm:
+
+
+Ghostscript PostScript Coding Guidelines
+============================================
+
+
+
+Summary of the coding guidelines
+-----------------------------------
+
+- Don't store into literals.
+
+- Use ``loop`` to create a block with multiple exits.
+
+- Use a dictionary or an array for multi-way switches.
+
+- Start every file with a copyright notice, the file name, and a one-line summary.
+
+- Comment every procedure with the arguments and result, and with the function of the procedure unless it's obvious.
+
+- Comment the stack contents ad lib, and particularly at the beginning of every loop body.
+
+- Indent every 2 spaces.
+
+- Always put { at the end of a line, and } at the beginning of a line, unless the contents are very short.
+
+- Always put spaces between adjacent tokens.
+
+- Use only lower-case letters and digits for names, or :ref:`Vienna style names<Naming>`, except for an initial "." for names only used within a single file.
+
+- Don't allocate objects in heavily used code.
+
+- Consider factoring out code into a procedure if it is used more than once.
+
+
+The many rules that Ghostscript's code follows almost everywhere are meant to produce code that is easy to read. It's important to observe them as much as possible in order to maintain a consistent style, but if you find a rule getting in your way or producing ugly-looking results once in a while, it's OK to break it.
+
+
+
+Use of PostScript language features
+----------------------------------------
+
+Restrictions
+~~~~~~~~~~~~~~~~~
+
+If you need to store a value temporarily, don't write into a literal in the code, as in this fragment to show a character given the character code:
+
+
+.. code-block:: postscript
+
+ ( ) dup 0 4 -1 roll put show
+
+Instead, allocate storage for it:
+
+
+.. code-block:: postscript
+
+ 1 string dup 0 4 -1 roll put show
+
+
+Protection
+~~~~~~~~~~~~~~~~~
+
+If an object is never supposed to change, use ``readonly`` to make it read-only. This applies especially to permanently allocated objects such as constant strings or dictionaries.
+
+During initialization, and occasionally afterwards, it may be necessary to store into a read-only dictionary, or to store a pointer to a dictionary in local VM into a dictionary in global VM. The operators ``.forceput`` and ``.forceundef`` are available for this purpose. To make these operators inaccessible to ordinary programs, they are removed from ``systemdict`` at the end of initialization: system code that uses them should always use ``bind`` and ``odef`` (or ``executeonly``) to make uses of them inaccessible as well.
+
+
+Standard constructions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Multi-way conditionals
+"""""""""""""""""""""""""""
+
+If you write a block of code with more than about 3 exit points, the usual way to do it would be like this:
+
+
+.. code-block:: postscript
+
+ {
+ ... {
+ ...1
+ } {
+ ... {
+ ...2
+ } {
+ ... {
+ ...3
+ } {
+ ...4
+ } ifelse
+ } ifelse
+ } ifelse
+ }
+
+
+However, this causes the 4 logically somewhat parallel code blocks to be indented differently, and as the indentation increases, it becomes harder to see the structure visually. As an alternative, you can do it this way:
+
+.. code-block:: postscript
+
+ { % The loop doesn't actually loop: it just provides a common exit.
+ ... {
+ ...1
+ exit
+ } if
+ ... {
+ ...2
+ exit
+ } if
+ ... {
+ ...3
+ exit
+ } if
+ ...4
+ exit
+ } loop
+
+
+Don't forget the final exit, to prevent the loop from actually looping.
+
+
+
+Switches
+"""""""""""""""""""""""""""
+
+Use a dictionary or an array of procedures to implement a 'switch', rather than a series of conditionals, if there are more than about 3 cases. For example, rather than:
+
+
+.. code-block:: postscript
+
+ dup /a eq {
+ pop ...a
+ } {
+ dup /b eq {
+ pop ...b
+ } {
+ dup /c eq {
+ pop ...c
+ } {
+ ...x
+ } ifelse
+ } ifelse
+ } ifelse
+
+(or using the loop/exit construct suggested above), consider:
+
+.. code-block:: postscript
+
+ /xyzdict mark
+ /a {...a} bind
+ /b {...b} bind
+ /c {...c} bind
+ .dicttomark readonly def
+ ...
+ //xyzdict 1 index .knownget {
+ exch pop exec
+ } {
+ ...x
+ } ifelse
+
+
+File structuring
+~~~~~~~~~~~~~~~~~~~
+
+Every code file should start with comments containing
+
+1. A copyright notice.
+
+2. The name of the file in the form of an RCS Id:
+
+.. code-block:: postscript
+
+ % $Id: filename.ps $
+
+3. A very brief summary (preferably only one line) of what the file contains.
+
+If you create a file by copying the beginning of another file, be sure to update the copyright year and change the file name.
+
+
+
+Commenting
+------------
+
+
+
+If a file has well-defined functional sections, put a comment at the beginning of each section to describe its purpose or function.
+
+Put a comment before every procedure to describe what the procedure does, unless it's obvious or the procedure's function is defined by the PLRM. In case of doubt, don't assume it's obvious. If the procedure may execute a deliberate 'stop' or 'exit' not enclosed in 'stopped' or a loop respectively, that should be mentioned. However, information about the arguments and results should go in the argument and result comment (described just below) if possible, not the functional comment.
+
+Put a comment on every procedure to describe the arguments and results:
+
+.. code-block:: postscript
+
+ /hypot { % <num1> <num2> hypot <real>
+ dup mul exch dup mul add sqrt
+ } def
+
+There is another commenting style that some people prefer to the above:
+
+.. code-block:: postscript
+
+ /hypot { % num1 num2 --> realnum
+ dup mul exch dup mul add sqrt
+ } def
+
+
+We have adopted the first style for consistency with Adobe's documentation, but we recognize that there are technical arguments for and against both styles, and might consider switching some time in the future. If you have strong feelings either way, please make your opinion known to us.
+
+Put comments describing the stack contents wherever you think they will be helpful; put such a comment at the beginning of every loop body unless you have a good reason not to.
+
+When you change a piece of code, do *not* include a comment with your name or initials. Also, do *not* retain the old code in a comment, unless you consider it essential to explain something about the new code; in that case, retain as little as possible. (CVS logs do both of these things better than manual editing.) However, if you make major changes in a procedure or a file, you may put your initials, the date, and a brief comment at the head of the procedure or file respectively.
+
+
+Formatting
+-------------
+
+Indentation
+~~~~~~~~~~~~~~~~~
+
+Indent 2 spaces per indentation level. You may use tabs at the left margin for indentation, with 1 tab = 8 spaces, but you should not use tabs anywhere else, except to place comments.
+
+Indent { } constructs like this:
+
+.. code-block:: postscript
+
+ ... {
+ ...
+ } {
+ ...
+ } ...
+
+
+If the body of a conditional or loop is no more than about 20 characters, you can put the entire construct on a single line if you want:
+
+.. code-block:: postscript
+
+ ... { ... } if
+
+rather than:
+
+
+.. code-block:: postscript
+
+ ... {
+ ...
+ } if
+
+
+There is another indentation style that many people prefer to the above:
+
+.. code-block:: postscript
+
+ ...
+ { ...
+ }
+ { ...
+ } ...
+
+We have adopted the first style for consistency with our C code, but we recognize that there are technical arguments for and against both styles, and might consider switching some time in the future. If you have strong feelings either way, please make your opinion known to us.
+
+
+
+Spaces
+~~~~~~~~~~~~~~~
+
+Always put spaces between two adjacent tokens, even if this isn't strictly required. E.g.,
+
+.. code-block:: postscript
+
+ /Halftone /Category findresource
+
+not:
+
+
+.. code-block:: postscript
+
+ /Halftone/Category findresource
+
+
+
+Naming
+--------
+
+All names should consist only of letters and digits, possibly with an initial ".", except for names drawn from the PostScript or PDF reference manual, which must be capitalized as in the manual. In general, an initial "." should be used for those and only those names that are not defined in a private dictionary but that are meant to be used only in the file where they are defined.
+
+For edits to existing code, names made up of multiple words should not use any punctuation, or capitalization, to separate the words, again except for names that must match a specification. For new code, you may use this convention, or you may use the "Vienna" convention of capitalizing the first letter of words, e.g., ``readSubrs`` rather than ``readsubrs``. If you use the Vienna convention, function names should start with an upper case letter, variable names with a lower case letter. Using the first letter of a variable name to indicate the variable's type is optional, but if you do it, you should follow existing codified usage.
+
+
+
+Miscellany
+--------------
+
+Some useful non-standard operators
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``<obj1> <obj2> ... <objn> <n> .execn ...``
+ This executes ``obj1`` through ``objn`` in that order, essentially equivalent to: ``<obj1> <obj2> ... <objn> <n> array astore {exec} forall`` except that it doesn't actually create the array.
+
+``<dict> <key> .knownget <value> true``, ``<dict> <key> .knownget false``
+ This combines known and get in the obvious way.
+
+``<name> <proc> odef -``
+ This defines name as a "pseudo-operator". The value of name will be executable, will have type ``operatortype``, and will be executed if it appears directly in the body of a procedure (like an operator, unlike a procedure), but what will actually be executed will be ``proc``. In addition, if the execution of ``proc`` is ended prematurely (by ``stop``, including the ``stop`` that is normally executed when an error occurs, or ``exit``) and the operand and dictionary stacks are at least as deep as they were when the "operator" was invoked, the stacks will be cut back to their original depths before the error is processed. Thus, if pseudo-operator procedures are careful not to remove any of their operands until they reach a point in execution beyond which they cannot possibly cause an error, they will behave just like operators in that the stacks will appear to be unchanged if an error occurs.
+
+Some useful procedures
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``<object> <errorname> signalerror -``
+ Signal an error with the given name and the given "current object". This does exactly what the interpreter does when an error occurs.
+
+
+Other
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you can avoid it, don't allocate objects (strings, arrays, dictionaries, gstates, etc.) in commonly used operators or procedures: these will need to be garbage collected later, slowing down execution. Instead, keep values on the stack, if you can. The ``.execn`` operator discussed above may be helpful in doing this.
+
+If you find yourself writing the same stretch of code (more than about half a dozen tokens) more than once, ask yourself whether it performs a function that could be made into a procedure.
+
+
+
+.. include:: footer.rst \ No newline at end of file
diff --git a/doc/src/Ps2epsi.rst b/doc/src/Ps2epsi.rst
new file mode 100644
index 00000000..053674f1
--- /dev/null
+++ b/doc/src/Ps2epsi.rst
@@ -0,0 +1,93 @@
+.. title:: Convert PostScript to Encapsulated PostScript Interchange Format
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Ps2epsi.htm:
+
+
+Convert PostScript to Encapsulated PostScript Interchange Format
+======================================================================
+
+
+
+
+The information in this document was contributed by `George Cameron`_; please direct any questions about it to him. Because the software described here is no longer being maintained, this document may be obsolete, or inconsistent with ``ps2epsi.1``.
+
+For other information, see the :ref:`Ghostscript overview<Ghostscript Introduction>`.
+
+
+
+Overview
+-----------
+
+``ps2epsi`` is a utility based on Ghostscript, which takes as input a PostScript file and generates as output a new file which conforms to Adobe's Encapsulated PostScript Interchange (EPSI) format, a special form of Encapsulated PostScript (EPS) which adds to the beginning of the file, as PostScript comments, a low-resolution monochrome bitmap image of the final displayed page. Programs which understand EPSI can use this bitmap as a preview on screen of the full PostScript page. The displayed quality is often not very good, but the final printed version uses the "real" PostScript, and thus has the normal full PostScript quality. Framemaker can use EPSI.
+
+The `Adobe Framemaker`_ DTP system is one application which understands EPSI files, and ``ps2epsi`` has been tested using Framemaker 3.0 on a Sun workstation with a number of PostScript diagrams from a variety of sources. Framemaker on other platforms may also be able to use files made with ``ps2epsi``, although this has not been tested.
+
+
+Usage
+-------
+
+MS-DOS
+~~~~~~~~~~
+
+Using the supplied batch file ``ps2epsi.bat``, the command is:
+
+.. code-block:: bash
+
+ ps2epsi infile.ps outfile.epi
+
+
+where ``infile.ps`` is the original PostScript file, and ``outfile.epi`` is the output EPSI file to be created.
+
+
+Unix
+~~~~~~~~
+
+Using the supplied shell script ``ps2epsi``, the command is:
+
+.. code-block:: bash
+
+ ps2epsi infile.ps [outfile.epsi]
+
+where ``infile.ps`` is the input file and ``outfile.epsi`` is the output EPSI file to be created. If the output filename is omitted, ``ps2epsi`` generates one from the input filename; and any standard extension (``.ps``, ``.cps``, ``.eps`` or ``.epsf``) of the input file is replaced in the output file with the extension ``.epsi``.
+
+
+Limitations
+------------------
+
+Not all PostScript files can be encapsulated, because there are restrictions in what is permitted in a PostScript file for it to be properly encapsulated. ``ps2epsi`` does a little extra work to try to help encapsulation, and it automatically calculates the bounding box required for all encapsulated PostScript files, so most of the time it does a pretty good job. There are certain to be cases, however, when encapsulation fails because of the nature of the original PostScript file.
+
+
+Files
+--------
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - File
+ - Contents
+ * - ``ps2epsi.bat``
+ - MS-DOS batch file
+ * - ``ps2epsi``
+ - Unix shell script
+ * - ``ps2epsi.ps``
+ - Ghostscript program which does the work
+
+
+
+
+
+
+
+
+.. External links
+
+.. _Adobe Framemaker: http://www.adobe.com/products/framemaker/main.html
+.. _George Cameron: george@bio-medical-physics.aberdeen.ac.uk
+
+.. include:: footer.rst \ No newline at end of file
diff --git a/doc/src/Psfiles.rst b/doc/src/Psfiles.rst
new file mode 100644
index 00000000..c81e20f5
--- /dev/null
+++ b/doc/src/Psfiles.rst
@@ -0,0 +1,460 @@
+.. title:: PostScript Files Distributed with Ghostscript
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Psfiles.htm:
+
+
+PostScript Files Distributed with Ghostscript
+================================================
+
+
+
+
+Generally used system files
+--------------------------------
+
+``gs_*_e.ps``
+~~~~~~~~~~~~~~~~~~~~~
+ These files define the Encodings known to Ghostscript. All of them except ``gs_std_e.ps`` and ``gs_il1_e.ps`` are loaded only if referred to. However some are additionally built into ``gscencs.c``.
+
+PostScript Encodings
+""""""""""""""""""""""""
+
+These files are found in the ``lib`` subdirectory of the Ghostscript source distribution.
+
+ ``gs_ce_e.ps``
+
+These files are found in the ``Resource/Init`` subdirectory of the Ghostscript source distribution.
+
+ ``gs_il1_e.ps``, ``gs_std_e.ps``, ``gs_sym_e.ps``
+
+PDF Encodings
+""""""""""""""""""""""""
+
+These files are found in the ``Resource/Init`` subdirectory of the Ghostscript source distribution.
+
+ ``gs_mex_e.ps``, ``gs_mro_e.ps``, ``gs_pdf_e.ps``, ``gs_wan_e.ps``
+
+Non-standard Encodings
+""""""""""""""""""""""""
+
+These files are found in the ``Resource/Init`` subdirectory of the Ghostscript source distribution.
+
+ ``gs_dbt_e.ps``
+
+These files are found in the ``lib`` subdirectory of the Ghostscript source distribution.
+
+ ``gs_il2_e.ps``, ``gs_ksb_e.ps``, ``gs_lgo_e.ps``, ``gs_lgx_e.ps``, ``gs_wl1_e.ps``, ``gs_wl2_e.ps``, ``gs_wl5_e.ps``
+
+
+Pseudo-encodings
+""""""""""""""""""""""""
+
+These files are found in the ``Resource/Init`` subdirectory of the Ghostscript source distribution.
+ ``gs_mgl_e.ps``
+
+These files are found in the ``lib`` subdirectory of the Ghostscript source distribution.
+
+ ``gs_lgo_e.ps``, ``gs_lgx_e.ps``
+
+
+Other files
+~~~~~~~~~~~~~~~~~~~~~
+
+These files are found in the ``Resource/Init`` subdirectory of the Ghostscript source distribution.
+
+``gs_btokn.ps``
+ ``gs_init.ps`` reads this in if the btoken feature is included in the configuration. It provides support for binary tokens.
+
+``gs_cff.ps``
+ Load CFF (compressed) fonts.
+
+``gs_fntem.ps``
+ Code for emulating PostScript fonts with non-PostScript font technologies.
+
+``gs_cidtt.ps``
+ Code for emulating ``CID`` fonts with TrueType fonts.
+
+``gs_cidcm.ps``
+ Code for recognizing font names of the form ``CIDFont-CMap`` (or ``CIDFont--CMap``) and creating the font automatically.
+
+``gs_ciddc.ps``
+ Defines Decoding and ``CIDDecoding`` resource categories and related procsets. Used for for emulating PostScript fonts with non-PostScript font technologies.
+
+``gs_cidfm.ps``
+ Provides resource mapping for ``CIDFont`` category.
+
+``gs_cidfn.ps``
+ ``ProcSet`` for implementing ``CIDFont`` and ``CIDMap`` resources.
+
+``gs_cmap.ps``
+ ``ProcSet`` for implementing ``CMap`` resources.
+
+``gs_cspace.ps``
+ PostScript portion of the basic color space handling; see the extensive comment at the head of the file for information.
+
+``gs_dscp.ps``
+ Code to compensate for badly written PostScript files by setting ``Orientation`` according to the DSC comments.
+
+``gs_epsf.ps``
+ Allow the interpreter to recognize DOS EPSF file headers, and skip to the PostScript section of the file.
+
+``gs_fapi.ps``
+ :ref:`Font API<Fonts FAPI>` support.
+
+``gs_fonts.ps``
+ ``gs_init.ps`` reads this in. It initializes Ghostscript's font machinery and provides some utility procedures that work with fonts.
+
+``gs_frsd.ps``
+ Support for the PostScript LanguageLevel 3 ``ReusableStreamDecode`` filter.
+
+``gs_img.ps``
+ Implementation of the traditional (non-dictionary) form of the image and imagemask operators, and the colorimage operator (including the Next alphaimage facility).
+
+``gs_init.ps``
+ Ghostscript reads this automatically when it starts up. It contains definitions of many standard procedures and initialization for a wide variety of things.
+
+``gs_lev2.ps``
+ ``gs_init.ps`` reads this in if the Ghostscript interpreter includes Level 2 PostScript functions. It contains definitions of procedures and miscellaneous initialization for the Level 2 functions.
+
+``gs_ll3.ps``
+ Initialize PostScript LanguageLevel 3 functions.
+
+``gs_resmp.ps``
+ A ``procset`` for redefining resource categories with a resource map.
+
+``gs_res.ps``
+ ``gs_init.ps`` reads this in if the Level 2 resource machinery is included. Currently, this is the case for all Level 2 configurations.
+
+``gs_setpd.ps``
+ Implementation of the ``setpagedevice`` operator.
+
+``gs_statd.ps``
+ ``gs_init.ps`` reads this in. It creates a dummy ``statusdict`` and some other environmental odds and ends for the benefit of PostScript files that really want to be printed on a LaserWriter.
+
+``gs_trap.ps``
+ Stub support for the PostScript LanguageLevel 3 "In-RIP trapping" feature.
+
+``gs_ttf.ps``
+ Support code for direct use of TrueType fonts.
+
+``gs_typ32.ps``
+ Initialization file for Type 32 fonts.
+
+``gs_typ42.ps``
+ Support code for Type 42 fonts (TrueType font in a PostScript "wrapper").
+
+``gs_type1.ps``
+ ``gs_init.ps`` reads this in if the Ghostscript interpreter includes Type 1 font capability (which it normally does).
+
+
+
+
+Configuration files
+------------------------
+
+These files are found in the ``Resource/Init`` subdirectory of the Ghostscript source distribution. Users are allowed to modify them to configure Ghostscript.
+
+``Fontmap``
+ Font mapping table.
+
+``cidfmap``
+ CID font mapping table. Allows substitution of a CID font for another CID font or a TrueType font for a CID font.
+
+``FAPIconfig``
+ A configuration file for Font API client.
+
+``FAPIfontmap``
+ Font mapping table for Font-API-handled fonts.
+
+``FAPIcidfmap``
+ Font mapping table for Font-API-handled CID fonts.
+
+
+
+More obscure system files
+------------------------------------------------
+
+Unless otherwise stated, these files are found in the ``Resource/Init`` subdirectory of the Ghostscript source distribution.
+
+``gs_agl.ps``
+ Contains the mapping from Adobe glyph names to Unicode values, used to support TrueType fonts and disk-based Type 1 fonts.
+
+``gs_cet.ps``
+ Sets a number of alternate defaults to make Ghostscript behave more like Adobe CPSI. Useful for running the CET conformance test suite.
+
+``gs_diskn.ps``
+ This file implements the ``%disk IODevice`` (``diskn.dev`` feature). See the :ref:`language documentation<Language.htm>` for information on the use of the ``%disk#`` devices. These PostScript modifications primarily perform the searching of all ``Searchable`` file systems in a defined ``SearchOrder`` when a file reference does not contain an explicit ``%device%`` specifier (such as ``%os%`` or ``%disk0%``). This is required to emulate undocumented behaviour of Adobe PostScript printers that have a disk and was experimentally determined.
+
+``gs_kanji.ps``
+ This file provides support for the Wadalab free Kanji font. It is not included automatically in any configuration. This file is stored in the ``lib`` subdirectory.
+
+``gs_pdfwr.ps``
+ This file contains some patches for providing information to the :title:`pdfwrite` driver. It is included only if the :title:`pdfwrite` driver is included.
+
+``ht_ccsto.ps``
+ A default stochastic CMYK halftone. This file is in the public domain. This file is stored in the ``lib`` subdirectory.
+
+``stcolor.ps``
+ Configure the (Epson) :title:`stcolor` driver. This file is stored in the ``lib`` subdirectory.
+
+
+PDF-specific system files
+------------------------------------------------
+
+These files are found in the ``Resource/Init`` subdirectory of the Ghostscript source distribution.
+
+``pdf_base.ps``
+ Utilities for interpreting PDF objects and streams.
+
+``pdf_draw.ps``
+ The interpreter for drawing-related PDF operations.
+
+``pdf_font.ps``
+ Code for handling fonts in PDF files.
+
+``pdf_main.ps``
+ Document- and page-level control for interpreting PDF files.
+
+``pdf_ops.ps``
+ Definitions for most of the PDF operators.
+
+``pdf_rbld.ps``
+ Contains procedures for bebuilding damaged PDF files.
+
+``pdf_sec.ps``
+ PDF security (encryption) code.
+
+``gs_icc.ps``
+ Support for ICC color profiles. These are not a standard PostScript feature, but are used in the PDF interpreter, as ICC profiles may be embedded in PDF files.
+
+
+These files are found in the lib subdirectory of the Ghostscript source distribution. These files are templates and should not be used without modification.
+
+``PDFX_def.ps``
+ This is a sample prefix file for creating a PDF/X-3 document with the :title:`pdfwrite` device.
+
+``PDFA_def.ps``
+ This is a sample prefix file for creating a PDF/A document with the :title:`pdfwrite` device.
+
+
+
+Display PostScript-specific system files
+------------------------------------------------
+
+These files are found in the ``Resource/Init`` subdirectory of the Ghostscript source distribution.
+
+``gs_dpnxt.ps``
+ NeXT Display PostScript extensions.
+
+``gs_dps.ps``, ``gs_dps1.ps``, ``gs_dps2.ps``
+ ``gs_init.ps`` reads these in if the dps feature is included in the configuration. They provide support for various Display PostScript and Level 2 features.
+
+
+
+Art and examples
+------------------------------------------------
+
+These files are found in the ``examples`` subdirectory of the Ghostscript source distribution.
+
+``alphabet.ps``
+ Prints a sample alphabet at several different sizes.
+
+``annots.pdf``
+ A sample file with a wide variety of PDF "annotations".
+
+``colorcir.ps``
+ A set of nested ellipses made up of colored bars.
+
+``doretree.ps``
+ A 3-D image produced by a modeling program. This file is in the public domain.
+
+``escher.ps``
+ A colored version of a hexagonally symmetric Escher drawing of interlocking butterflies. Can be printed on monochrome devices, with somewhat less dramatic results.
+
+``golfer.eps``
+ A gray-scale picture of a stylishly dressed woman swinging a golf club.
+
+``grayalph.ps``
+ Grayscaled text test pattern.
+
+``ridt91.eps``
+ The RIDT '91 logo. Note that since this is an EPS file, you will have to add ``-c showpage`` at the end of the command line to print it or convert it to a raster file.
+
+``snowflak.ps``
+ A rectangular grid of intricate colored snowflakes. (May render very slowly.)
+
+``text_graph_image_cmyk_rgb.pdf``
+ A simple PDF containing text and graphics in both RGB and CMYK spaces.
+
+``text_graphic_image.pdf``
+ A simple PDF containing text and graphics in RGB space.
+
+``tiger.eps``
+ A dramatic colored picture of a tiger's head.
+
+``transparency_example.ps``
+ A simple example of transparency.
+
+``vasarely.ps``
+ Colored rectangles and ellipses inspired by Victor Vasarely's experiments with tilting circles and squares.
+
+``waterfal.ps``
+ Prints text in a variety of different sizes, to help evaluate the quality of text rendering.
+
+
+
+Utilities
+----------------------------
+
+For more information on these utility programs, see the comments at the start of each file . The ones marked (``*``) have batch files or shell scripts of the same name (like ``bdftops`` and ``bdftops.bat``) to invoke them conveniently.
+
+These files are found in the ``lib`` subdirectory of the Ghostscript source distribution.
+
+``align.ps``
+ A test page for determining the proper margin and offset parameters for your printer.
+
+``caption.ps``
+ A file for putting a caption in a box at the bottom of each page, useful for trade show demos.
+
+``cat.ps```
+ Appends one file to another. Primarily used to overcome the 'copy' limitation of Windows command shell for ``ps2epsi``.
+
+``cid2code.ps``
+ A utility for creating maps from CIDs to Unicode, useful when substituting a TrueType font for an Adobe font.
+
+``docie.ps``
+ An emulation of the CIE color mapping algorithms.
+
+``font2pcl.ps``
+ A utility to write a font as a PCL bitmap font.
+
+``gslp.ps``
+ A utility for doing "line printing" of plain text files.
+
+``gsnup.ps``
+ A file that you can concatenate in front of (very well-behaved) PostScript files to do N-up printing. It is deliberately simple and naive: for more generality, use ``psnup`` (which, however, requires DSC comments).
+
+``jispaper.ps``
+ A file that makes the b0 through b6 procedures refer to JIS B paper sizes rather than ISO B.
+
+``landscap.ps``
+ A file that you can put in front of your own files to get them rendered in landscape mode.
+
+``mkcidfm.ps``
+ A utility for creating a CID font mapping table cidfmap from fonts found in a specified directory.
+
+``pdf2dsc.ps``
+ A utility to read a PDF file and produce a DSC "index" file.
+
+``pf2afm.ps``
+ A utility for producing AFM files from PFA, PFB, and optionally PFM files.
+
+``pfbtopfa.ps``
+ A utility to convert PFB (binary) font files to PFA (text) format.
+
+``prfont.ps``
+ A utility to print a font catalog.
+
+``printafm.ps``
+ A utility to print an AFM file on standard output.
+
+``ps2ai.ps``
+ A utility for converting an arbitrary PostScript file into a form compatible with Adobe Illustrator. NOTE: ``ps2ai`` doesn't work properly with Adobe's Helvetica-Oblique font, and other fonts whose original ``FontMatrix`` involves skewing or rotation.
+
+``ps2epsi.ps``
+ A utility for converting an arbitrary PostScript file into EPSI form.
+
+``rollconv.ps``
+ A utility for converting files produced by Macromedia's Rollup program to a Type 0 form directly usable by Ghostscript.
+
+``stocht.ps``
+ A file that installs the ``StochasticDefault`` halftone as the default, which may improve output quality on inkjet printers. See the file for more information.
+
+``viewcmyk.ps``
+ A utility for displaying CMYK files.
+
+``viewgif.ps``
+ A utility for displaying GIF files.
+
+``viewjpeg.ps``
+ A utility for displaying JPEG files.
+
+``viewmiff.ps``
+ A utility for displaying MIFF files.
+
+``viewpbm.ps``
+ A utility for displaying PBM/PGM/PPM files.
+
+``viewpcx.ps``
+ A utility for displaying PCX files.
+
+``viewrgb.ps``
+ A utility for displaying files created by ``-sDEVICE=bitrgb``.
+
+``viewraw.ps``
+ An extended utility for displaying files created by ``-sDEVICE=bitrgb``.
+
+
+Development tools
+----------------------------
+
+These files are found in the ``lib`` subdirectory of the Ghostscript source distribution.
+
+``acctest.ps``
+ A utility that checks whether the interpreter enforces access restrictions.
+
+``image-qa.ps``
+ A comprehensive test of the image display operators.
+
+``ppath.ps``
+ A couple of utilities for printing out the current path, for debugging.
+
+``pphs.ps``
+ A utility to print the Primary Hint Stream of a linearized PDF file.
+
+``traceimg.ps``
+ Trace the data supplied to the image operator.
+
+``traceop.ps``
+ A utility for tracing uses of any procedure or operator for debugging.
+
+``uninfo.ps``
+ Some utilities for printing out PostScript data structures.
+
+``viewps2a.ps``
+ A utility for displaying the output of ``ps2ascii.ps``.
+
+``winmaps.ps``
+ A utility for creating mappings between the Adobe encodings and the Microsoft Windows character sets.
+
+``zeroline.ps``
+ A utility for testing how interpreters handle zero-width lines.
+
+
+
+Odds and ends
+----------------------------
+
+These files are found in the ``lib`` subdirectory of the Ghostscript source distribution.
+
+``jobseparator.ps``
+ Convenience file containing a job separator sequence for use when passing files with ``-dJOBSERVER``.
+
+``lines.``
+ A test program for line joins and caps.
+
+``stcinfo.ps``
+ Print and show parameters of the (Epson) :title:`stcolor` driver.
+
+
+
+
+.. include:: footer.rst
+
+
+
diff --git a/doc/src/Readme.rst b/doc/src/Readme.rst
new file mode 100644
index 00000000..85b078e6
--- /dev/null
+++ b/doc/src/Readme.rst
@@ -0,0 +1,239 @@
+.. title:: Ghostscript Introduction
+
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Ghostscript Introduction:
+.. _Readme.htm:
+
+
+Introduction
+===================================
+
+
+This document is a roadmap to the Ghostscript documentation.
+After looking through it, if you want to install Ghostscript and not only use it, we recommend you read :ref:`How to install Ghostscript<Install.htm>`, and :ref:`How to compile Ghostscript<Make.htm>` from source code (which is necessary before installing it on Unix and VMS systems).
+
+
+.. _WhatIsGhostscript:
+
+What is Ghostscript?
+----------------------
+
+There are various products in the Ghostscript family; this document describes what they are, and how they are related.
+
+
+
+
+
+Ghostscript
+~~~~~~~~~~~~~~~~
+
+Ghostscript is an interpreter for PostScript® and Portable Document Format (PDF) files.
+
+Ghostscript consists of a PostScript interpreter layer, and a graphics library. The graphics library is shared with all the other products in the Ghostscript family, so all of these technologies are sometimes referred to as Ghostscript, rather than the more correct GhostPDL.
+
+Binaries for Ghostscript and (see below) GhostPDF (included in the Ghostscript binaries) for various systems can be downloaded from `here`_. The source can be found in both the Ghostscript and GhostPDL downloads from the same site.
+
+
+
+
+
+GhostPDF
+~~~~~~~~~~~~~~~~
+
+Prior to release 9.55.0 GhostPDF was an interpreter for the PDF page description language built on top of Ghostscript, and written in the PostScript programming language. From 9.55.0 onwards there is a new GhostPDF executable, separate from Ghostscript and written in C rather than PostScript.
+
+This new interpreter has also been integrated into Ghostscript itself, in order to preserve the PDF functionality of that interpreter. For now, the old PostScript-based interpreter remains the default, but the new interpreter is built-in alongside it.
+
+The intention is that the new interpreter will replace the old one, which will be withdrawn.
+
+It is possible to control which interpreter is used with the NEWPDF command-line switch. When this is false (the current default) the old PostScript-based interpreter is used, when NEWPDF is true then the new C-based interpreter is used.
+
+
+
+
+
+GhostPDL
+~~~~~~~~~~~~~~~~
+
+Historically, we’ve used GhostPDL as an umbrella term to encompass our entire line of products. We've now brought all these disparate products together into a single package, called, appropriately enough, GhostPDL.
+
+When running on a printer (or server) GhostPDL now automatically detects the type of data being fed to it and processes it accordingly. The individual interpreters all plug into a top-level module that handles both automatic language detection and Printer Job Language (PJL) based configuration.
+
+The exact set of interpreters present in an installation can be tuned by the integrator for their specific product/use cases.
+
+In addition to our existing PDL modules (PS, PDF, PCL, PXL, and XPS) we have now added new modules to handle a range of common image formats. With these installed, GhostPDL will handle JPEGs (both JFIF and EXIF), PWGs, TIFFs, PNGs, JBIG2s, and JPEG2000s.
+
+GhostPDL is available both under the `GNU Affero GPL license`_ and for `commercial licensing`_ from `Artifex`_.
+
+The source code for GhostPDL can be found `here`_.
+
+
+
+
+
+GhostPCL
+~~~~~~~~~~~~~~~~
+
+GhostPCL is an interpreter for PCL™ and PXL files. This consists of an PCL/PXL interpreter hooked up to the Ghostscript graphics library.
+
+GhostPCL is available both under the `GNU Affero GPL license`_ and for `commercial licensing`_ from `Artifex`_.
+
+Binaries for GhostPCL for various systems can be downloaded from `here`_. The source can be found in the GhostPCL/GhostPDL downloads from the same site.
+
+
+
+
+GhostXPS
+~~~~~~~~~~~~~~~~
+
+GhostXPS is an interpreter for XPS (XML Paper Specfication) files. This consists of an XPS interpreter hooked up to the Ghostscript graphics library.
+
+GhostXPS is available both under the `GNU Affero GPL license`_ and for `commercial licensing`_ from `Artifex`_.
+
+Binaries for GhostXPS for various systems can be downloaded from `here`_. The source can be found in the GhostXPS/GhostPDL downloads from the same site.
+
+
+.. _URWFontInformation:
+
+URW Font Information
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The set of truetype fonts in the urwfonts directory are necessary for the PCL/XL interpreter to function properly but they ARE NOT FREE SOFTWARE and are NOT distributed under the GNU GPL/AGPL. They can instead be redistributed under the `AFPL`_ license which bars commercial use.
+
+If your copy of GhostPDL includes these fonts, you should have received a copy of the Aladdin Free Public License, usually in a file called COPYING.AFPL. If not, please contact Artifex Software, Inc. 1305 Grant Avenue - Suite 200, Novato, CA 94945 USA, or visit `Artifex`_
+
+
+
+
+Document roadmap by theme
+-----------------------------
+
+What should I read if I'm a new user?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- :ref:`How to use Ghostscript<Use.htm>`. This includes both a quickstart introduction to the command line version and more extensive reference material.
+- detailed information about :ref:`specific devices<Devices.htm>` that Ghostscript can use for output.
+- more detailed information about how to use Ghostscript under Unix with ``lpr`` :ref:`as a filter<Unix-lpr.htm>` for printing.
+- for information about known problems or to report a new one, please visit `bugs.ghostscript.com`_ but remember that free versions of Ghostscript come with with NO WARRANTY and NO SUPPORT.
+
+
+GPL and commercial Ghostscript
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+GPL Ghostscript, Artifex Ghostscript and AFPL Ghostscript are different releases.
+
+- additional information about `GPL Ghostscript releases`_ that is not relevant to commercial versions.
+
+If you run into any questions, or if you are going to be using Ghostscript extensively, you should at least skim, and probably eventually read:
+
+- about the :ref:`fonts distributed with Ghostscript<Fonts.htm>`, including how to add or replace fonts.
+- a description of :ref:`the Ghostscript language<Language.htm>`, and its differences from the documented PostScript language.
+- about the :ref:`postscript files distributed with Ghostscript<Psfiles.htm>` (other than fonts).
+
+
+Before building Ghostscript
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you are going to compile Ghostscript from source, rather than just use an executable you got from somewhere, you may want to read:
+
+- :ref:`How to build Ghostscript<Make.htm>` and :ref:`install it<Install.htm>`.
+
+
+What should I read if I'm *not* a new user?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you have already used Ghostscript, when you receive a new release you should begin by reading this file, then:
+
+- `News`_, for incompatible changes and new features in the current release.
+
+
+What if I'm a developer?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you are going to do any development on or with Ghostscript at all, you should at least look at:
+
+- the :ref:`roadmap documentation<Develop.htm>` for Ghostscript's source files and architecture.
+
+If you are going to write a new driver for Ghostscript, you should read:
+
+- the :ref:`guide to the Ghostscript source code<Source.htm>`.
+- the interface between Ghostscript and :ref:`device drivers<Drivers.htm>`.
+
+If you are considering distributing GPL Ghostscript in conjunction with a commercial product, you should read the `license`_ carefully, and you should also read:
+
+- additional clarification of the circumstances under which Ghostscript can be distributed with a commercial product.
+
+If you intend to use Ghostscript in the form of a dynamic link library (DLL) under OS/2 or Microsoft Windows or in the form of shared object under Linux, read:
+
+- documentation on :ref:`Ghostscript Interpreter API<API.htm>`.
+
+If you want to use Ghostscript as part of another program, as a callable PostScript language interpreter, and not as a DLL or as a self-contained executable application, you should begin by reading:
+
+- the source file ``imain.h``, the documented API for Ghostscript not as a DLL.
+
+or if you are going to use only the Ghostscript graphics library:
+
+- about the structure of the :ref:`Ghostscript library<Lib.htm>` and its interfaces.
+
+What if I'm writing documentation?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you are editing or adding to Ghostscript's existing documentation you should contact us on our Discord channel or the gs-devel mailing list for guidance, links to those are on: `www.ghostscript.com`_.
+
+
+
+
+
+Presence on the World Wide Web
+------------------------------------
+
+
+Ghostscript's home page
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript has a home page on the World Wide Web with helpful information such as the FAQ (Frequently Asked Questions):
+
+`www.ghostscript.com`_
+
+Adobe PostScript, Encapsulated PostScript, and PDF reference documentation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Adobe makes a wealth of technical documentation available over the Web, including the `PostScript Language Reference Manual (Third Edition)`_ ; the `Encapsulated PostScript`_ (EPS) Format Specification version 3, including :ref:`Encapsulated PostScript Interchange<Ps2epsi.htm>` (EPSI) format; the `PDF Reference manuals`_. The `Acrobat SDK`_ contains `pdfmark and Acrobat Distiller parameters documentation`_.
+
+
+Other material on the WWW
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Much other material about Ghostscript is available on the World Wide Web, both as web pages and as archived Usenet and mailing list discussions. Use the well-known search engines to find such material.
+
+
+
+
+.. External links
+
+.. _www.ghostscript.com: http://www.ghostscript.com/
+.. _here: http://www.ghostscript.com/download
+.. _AGPL:
+.. _GNU Affero GPL license: http://www.gnu.org/licenses/agpl-3.0.html
+.. _AFPL: https://en.wikipedia.org/wiki/Aladdin_Free_Public_License
+.. _commercial licensing: https://artifex.com/licensing/commercial/
+.. _Artifex: https://artifex.com
+.. _News: https://ghostscript.com/doc/current/News.htm
+.. _bugs.ghostscript.com: https://bugs.ghostscript.com
+.. _History#.htm: https://ghostscript.com/doc/current/History9.htm
+.. _GPL Ghostscript releases: COPYING
+.. _license: COPYING
+.. _COPYING: COPYING
+
+.. _PostScript Language Reference Manual (Third Edition): http://partners.adobe.com/public/developer/en/ps/PLRM.pdf
+.. _Encapsulated Postscript: http://partners.adobe.com/public/developer/en/ps/5002.EPSF_Spec.pdf
+.. _PDF Reference manuals: http://partners.adobe.com/public/developer/pdf/index_reference.html
+.. _Acrobat SDK: http://partners.adobe.com/public/developer/acrobat/sdk/index.html
+.. _pdfmark and Acrobat Distiller parameters documentation: http://partners.adobe.com/public/developer/acrobat/sdk/index_doc.html
+
+.. include:: footer.rst \ No newline at end of file
diff --git a/doc/src/SampleDownscaleDevice.rst b/doc/src/SampleDownscaleDevice.rst
new file mode 100644
index 00000000..b0812939
--- /dev/null
+++ b/doc/src/SampleDownscaleDevice.rst
@@ -0,0 +1,142 @@
+.. title:: Sample CMYK 32-bit Device that Supports Post Rendering Processing
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _SampleDownscaleDevice.htm:
+
+
+Sample CMYK 32-bit Device that Supports Post Rendering Processing
+=====================================================================
+
+
+
+
+This device is a basic CMYK 32-bit (8-bits per component) device that uses the downscaler features to provide post-rendering operations on the raster data produced by Ghostscript.
+
+It is designed to allow a developer to add code to handle the resulting raster data and perform any desired formatting and transmission to some destination, for example DMA to a printer or sending over a network link.
+
+
+
+Features
+------------
+
+The ``downscaler`` modules provide for the following optional post-rendering manipulation:
+
+``-dDownScaleFactor=factor`` (small non-negative integer; default = 1)
+ If this option set then the page is downscaled by the given factor on both axes. For example rendering with -r600 and then specifying ``-dDownScaleFactor=3`` will produce a 200dpi image.
+
+ 2 additional "special" ratios are available, 32 and 34. 32 provides a 3:2 downscale (so from 300 to 200 dpi, if the resolution is 300 dpi as with -r300). 34 produces a 3:4 upscale (so from 300 to 400 dpi, similarly).
+
+``-sPostRenderProfile=path`` (path to an ICC profile)
+ If this option set then the page will be color transformed using that profile after downscaling.
+ This is useful when the file uses overprint to separately paint to some subset of the C, M, Y, and K colorants, but the final CMYK is to be color corrected for printing or display.
+
+
+The ``ds32`` device can perform rudimentary automatic bitmap 'trapping' on the final rendered bitmap. This code is disabled by default; see the `Trapping patents`_ below as to why.
+
+Trapping is a process whereby the output is adjusted to minimise the visual impact of offsets between each printed plane. Typically this involves slightly extending abutting regions that are rendered in different inks. The intent of this is to avoid the unsightly gaps that might be otherwise be revealed in the final printout if the different color plates do not exactly line up.
+
+This trapping is controlled by 3 device parameters. Firstly the maximum X and Y offsets are specified using:
+
+``-dTrapX=N``
+
+and:
+
+``-dTrapY=N``
+
+(where N is a figure in pixels, before the downscaler is applied).
+
+
+The final control is to inform the trapping process in what order inks should be processed, from darkest to lightest. For a typical CMYK device this order would be [ 3 1 0 2 ] (K darker than M darker than C darker than Y). This is the default.
+
+To override these defaults, the ``TrapOrder`` parameter can be used. Since this parameter requires an array, it must be specified using a different method. For example, if Cyan is darker than Magenta:
+
+
+.. code-block:: bash
+
+ gs -sDEVICE=ds32 -dTrapX=2 -dTrapY=2 -c "<< /TrapOrder [ 3 0 1 2 ] >> setpagedevice" -f examples\colorcir.ps
+
+
+Trapping patents
+~~~~~~~~~~~~~~~~~~~
+
+Trapping is an technology area encumbered by many patents. Until we can convince ourselves that our trapping code is not covered by any of these patents, the functionality is disabled by default.
+
+It can be enabled by building with the ``ENABLE_TRAPPING`` define, but before you do so you should convince yourself that either:
+
+- The trapping code is not covered by any existing patent.
+- Any patents that do cover the code are invalid in your jurisdiction.
+- That you have appropriate patent licenses for any patents that do apply.
+
+You bear full responsibility for choosing to build with ``ENABLE_TRAPPING``.
+
+
+
+
+
+
+Changes to devices/devs.mak
+--------------------------------
+
+The make files used to build Ghostscript use the file ``devices/devs.mak`` to describe what is needed for devices that can be built into the executable, such as source code files, header files, libraries and dependencies on other parts of Ghostscript.
+
+The section below can be added to the end of the ``devices/devs.mak`` file:
+
+.. code-block:: bash
+
+ ### -------- Example 32-bit CMYK downscaled device --------------------- ###
+ # NB: downscale_ is standard in the lib (LIB1s)
+ $(DD)ds32.dev : $(DEVOBJ)gdevds32.$(OBJ) $(GLD)page.dev \
+ $(GDEV) $(DEVS_MAK) $(MAKEDIRS)
+ $(SETPDEV2) $(DD)ds32 $(DEVOBJ)gdevds32.$(OBJ)
+ $(ADDMOD) $(DD)ds32 -include $(GLD)page
+
+ $(DEVOBJ)gdevds32.$(OBJ) : $(DEVSRC)gdevds32.c $(gsicc_cache_h) $(gxdownscale_h) $(AK) \
+ $(arch_h) $(gdevprn_h) $(stdio__h) $(stdint__h) $(DEVS_MAK) $(MAKEDIRS)
+ $(DEVCC) $(DEVO_)gdevds32.$(OBJ) $(C_) $(DEVSRC)gdevds32.c
+
+
+
+This snippet is also in a commented block at the top of the source code file.
+
+
+
+
+Building Ghostscript with the driver
+-----------------------------------------
+
+The make system also needs to be told to include the ``ds32`` device. This can either be added to the top level make file on one of the ``DEVICE_DEVS`` lines, for example, in ``psi/msvc.mak`` for the Windows build:
+
+.. code-block:: bash
+
+ DEVICE_DEVS21=$(DD)ds32.dev $(DD)spotcmyk.dev $(DD)devicen.dev $(DD)bmpsep1.dev $(DD)bmpsep8.dev $(DD)bmp16m.dev $(DD)bmp32b.dev $(DD)psdcmyk.dev $(DD)psdrgb.dev $(DD)cp50.dev $(DD)gprf.dev
+
+
+Rather than editing a make file, there is a convenient macro that allows the extra device to be added to the build command line, ``DEVICE_DEVS_EXTRA``.
+
+For example, on linux:
+
+.. code-block:: bash
+
+ make DEVICE_DEVS_EXTRA=obj/ds32.dev
+
+or, on Windows:
+
+.. code-block:: bash
+
+ nmake -f psi/msvc32.mak DEVICE_DEVS_EXTRA=obj\ds32.dev
+
+
+Source code
+-------------
+
+The source for this device driver is in: ``doc/gdevds32.c``
+
+
+
+
+
+.. include:: footer.rst
diff --git a/doc/src/SavedPages.rst b/doc/src/SavedPages.rst
new file mode 100644
index 00000000..8cdca4fa
--- /dev/null
+++ b/doc/src/SavedPages.rst
@@ -0,0 +1,171 @@
+.. title:: Using Saved Pages
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _SavedPages.htm:
+
+
+Using Saved Pages
+==========================================
+
+
+
+
+
+Saved pages can be printed in any order, any number of times allowing for copy collation, manual 'duplex' printing or selecting a subset of pages.
+
+Many raster printing devices and raster image format devices can use the command list (clist) to save the rendering information into files or memory based structures. Usually the clist data is rendered as soon as the page is complete, but it is` possible to defer rendering, then output (print) after the entire file has been converted to clist files.
+
+Since each page is saved separately, the pages can be rendered from the clist files in any order, any number of times.
+
+The saved pages are accumulated in clist form as files or in memory. The default clist storage is specified by the ``BAND_LIST_STORAGE=`` macro in the make file, but if ``BAND_LIST_STORAGE=file``, the clist can be forced to be in memory using the ``-sBandListStorage=memory`` option.
+
+
+
+
+
+
+
+Saved Pages control keywords
+---------------------------------
+
+Deferring printing is controlled using the ``--saved-page=...`` option.
+
+The string following the ``--saved-page=`` consists of keywords, separated by white-space, commas, or other non-alphanumeric characters such as '``:``', '``=``', '``;``'. If more than one keyword is given, the string should be enclosed in double-quotes (").
+
+The '``-``' (dash), and the '``*``' asterisk), are used in page range selections, and cannot be keyword separators.
+
+Keywords are case independent, thus ``begin``, ``BEGIN``, and ``Begin`` are all equivalent.
+
+``begin``
+ Begins accumulating pages to a list. The clist data for each page is saved in files or memory as discussed above, but no rendering is performed.
+ If the device was set for rendering into memory, is will be switched to accumulating the page as clist files, thus ``-dMaxBitmap`` and ``-dBandingNever`` will be ignored, as if ``-dBandingAlways`` was specified.
+
+``flush``
+ Delete all clist files for all pages on the list, and reset the list to empty, but remain in ``saved-pages`` mode. Subsequent pages will be added to the list.
+
+``end``
+ Flush any list, deleting all clist files for any accumulated pages and stop accumulating pages, returning to rendering/output as soon as the page is complete.
+
+ The device may render subsequent pages in memory (page buffer) as determined by ``-dMaxBitmap`` and ``-dBandingNever``.
+
+
+``copies`` *copy_count*
+ Set the copy count for the print action. The requested number of copies will be generated for all subsequent print actions, thus producing collated copies, rather than multiple copies of each page as in normal (non-deferred) rendering and output.
+
+ A ``--saved-pages="copies #"`` option will be applied to all print actions until a new copies # is encountered that sets the copy count to a different value. Since the copies can follow the print command, it is recommended that only a single copies be in a each ``--saved-pages=...`` string.
+
+ .. note::
+
+ Unless ``-d.IgnoreNumCopies=true`` is specified prior to starting ``saved-pages`` mode, the copy count for each page will be saved with each page, and the job will contain the specified number of copies of each page, as well as producing the number of collated copies of the job set by the copies in a ``--saved-pages=...`` string.
+
+``print`` *print keywords*
+ Print from the list of saved pages. The print keywords following the print action keyword determine what is printed, and in what order. The keywords are described in the next section.
+
+
+Printing Saved Pages
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+The string following the print action keyword determines which pages from the list are printed, in what order. Any sequence of keywords, page numbers or page ranges can follow the print keyword. The first control keyword (other than copies) ends the list of printing keywords.
+
+As with control keywords, print keywords can be any mixture of upper or lower case, and print keyword, page numbers and page ranges can be seperated by any non-alphanumeric character other than '``-``' or '``*``'.
+
+The following are all equivalent:
+
+
+.. code-block::
+
+ 1 3 5 - *
+ 1, 3, 5-*
+ 1,3,5-*
+
+
+``copies`` *copy_count*
+ As mentioned above, the copies keyword and count can follow the print keyword. See the description of the copies keyword in the previous section.
+ The copy count will be applied to the entire sequence of print keywords, so it can appear anywhere in the sequence of page number, page ranges or print keywords.
+
+``normal``
+ Print all of the pages, from the first until the last page in the list. This keyword is used to print collated copies in the usual page order. This is the same as the page range: "``1 - *``"
+
+``reverse``
+ Print all of the pages, from the last backwards to the first page in the list. This keyword is used to print collated copies in the reverse page order. This is the same as the page range: "``* - 1``"
+
+``odd``
+ Print all odd number pages, from 1 to the last odd numbered page. This keyword, combined with the even keyword and user interaction to place pages that were printed into the input tray, can be used for manual duplexing.
+
+``even``
+ Print all even number pages, from 2 to the last even numbered page, then if the list has an odd number of pages print a blank 'pad' page to be the back of the last odd page. This keyword, combined with the odd keyword and user interaction to place pages that were printed into the input tray, can be used for manual duplexing.
+
+``even0pad``
+ Print all even number pages, from 2 to the last even numbered page, without any blank 'pad' page as with the even keyword.
+
+*page_number*
+ A number not followed by '``-``' specifies a single page from the list to be printed. The '``*``' character represents the last page in the list, interpreted as a number, either as a single *page_number* or as the *start_page* or *end_page* in a page range.
+
+*start_page - end_page*
+ A range of pages is two *page_numbers* or ``*`` separated by a '``-``', optionally surrounded by non-alphanumeric characters other than '``-``' which is a special character in page range specifications. The pages from the *start_page* to the *end_page* are printed.
+
+ If the *start_page* is after the *end_page*, then the order of the pages is reversed, from the *start_page* back to the *end_page*.
+
+
+Examples
+----------------
+
+The following examples each print 2 collated copies from the first page to the last page:
+
+
+.. code-block:: bash
+
+ --saved-pages="print: normal, copies=2"
+ --saved-pages="print copies=2, normal"
+ --saved-pages="copies 2 print normal"
+ --saved-pages="print 1-* 1-*"
+ --saved-pages="print normal normal"
+
+
+Print the last page, followed by all pages in reverse order, then the first page (print reverse with two copies of the last and first page):
+
+.. code-block:: bash
+
+ --saved-pages="print * reverse 1"
+
+or:
+
+.. code-block:: bash
+
+ --saved-pages="print * * - 1 1"
+
+
+Using the command line arguments with a PostScript or PDF input file to print the odd pages, prompt the operator to reload the printer with the pages that were printed, then print the even pages:
+
+
+.. code-block:: bash
+
+ gs -sDEVICE=pgmraw -o /dev/lp0 --saved-pages="begin" examples/annots.pdf \
+ --saved-pages="print odd" \
+ -c "(Move printed pages to the input tray, then press enter.) = flush \
+ (%stdin) (r) file 256 string readline clear" \
+ --saved-pages="print even"
+
+
+Print two collated copies of the first file, followed by 5 copies of the second file:
+
+
+.. code-block:: bash
+
+ gs -sDEVICE=pgmraw -o /dev/lp0 --saved-pages="begin" examples/annots.pdf \
+ --saved-pages="copies=2 print normal flush" \
+ examples/colorcir.ps \
+ --saved-pages="copies=5 print normal"
+
+
+
+
+
+
+
+
+.. include:: footer.rst \ No newline at end of file
diff --git a/doc/src/Source.rst b/doc/src/Source.rst
new file mode 100644
index 00000000..ba3c9cc3
--- /dev/null
+++ b/doc/src/Source.rst
@@ -0,0 +1,222 @@
+.. title:: Guide to Ghostscript Source Code
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Source.htm:
+
+
+Guide to Ghostscript Source Code
+===================================
+
+
+Conceptual overview
+------------------------
+
+The Ghostscript source code is divided conceptually as follows:
+
+**PostScript interpreter**
+
+.. list-table::
+ :header-rows: 0
+ :widths: 50 50
+
+ * - PostScript operators
+ - ``z*.h`` and ``z*.c``
+ * - Other interpreter code
+ - ``i*.h`` and ``i*.c``
+ * - PostScript code
+ - ``gs_*.ps``
+
+
+**PDF interpreter**
+
+
+.. list-table::
+ :header-rows: 0
+ :widths: 50 50
+
+ * - PostScript code
+ - ``pdf_*.ps``
+
+
+
+**Graphics library**
+
+.. list-table::
+ :header-rows: 0
+ :widths: 50 50
+
+ * - Main library code
+ - ``g*.h`` and ``g*.c``
+ * - Streams
+ - ``s*.h`` and ``s*.c``
+ * - `Device drivers`_
+ - ``gdev*.h`` and ``gdev*.c``
+ * - `Platform-specific code`_
+ - ``gp*.h`` and ``gp*.c``
+
+
+
+PostScript interpreter
+------------------------
+
+``gs.c`` is the main program for the interactive language interpreter; ``gserver.c`` is an alternative main program that is a rudimentary server. If you configure Ghostscript as a server rather than an interactive program, you will use ``gserver.c`` instead of ``gs.c``.
+
+Files named ``z*.c`` are Ghostscript operator files. The names of the files generally follow the section headings of the operator summary in section 6.2 (Second Edition) or 8.2 (Third Edition) of the PostScript Language Reference Manual. Each operator ``XXX`` is implemented by a procedure named ``zXXX``, for example, ``zfill`` and ``zarray``.
+
+Files named ``i*.c``, and ``*.h`` other than ``g*.h``, are the rest of the interpreter. See the ``makefile`` for a little more information on how the files are divided functionally.
+
+The main loop of the PostScript interpreter is the interp procedure in ``interp.c``. When the interpreter is reading from an input file, it calls the token scanner in ``iscan*.c``.
+
+``idebug.c`` contains a lot of debugger-callable routines useful for printing PostScript objects when debugging.
+
+
+PDF interpreter
+--------------------
+
+The PDF interpreter is written entirely in PostScript. Its main loop is the ``.pdfrun`` procedure in ``pdf_base.ps``. When the PDF interpreter is configured into the build, it redefines the "run" operator to test whether the file is a PDF file. This redefinition is near the beginning of ``pdf_main.ps``.
+
+
+
+Graphics library
+------------------
+
+Files beginning with ``gs``, ``gx``, or ``gz`` (both ``.c`` and ``.h``), other than ``gs.c`` and ``gserver.c``, are the Ghostscript library. Files beginning with ``gdev`` are device drivers or related code, also part of the library. Other files beginning with ``g`` are library files that don't fall neatly into either the kernel or the driver category.
+
+Files named ``s*.c`` and ``s*.h`` are a flexible stream package, including the Level 2 PostScript "filters" supported by Ghostscript. See ``stream.h``, ``scommon.h``, and ``strimpl.h`` for all the details.
+
+
+Device drivers
+~~~~~~~~~~~~~~~~~~
+
+The interface between the graphics library and device drivers is the only really well documented one in all of Ghostscript: see the :ref:`documentation on drivers<Drivers.htm>`.
+
+In addition to many real device and file format drivers listed in ``devs.mak`` and ``contrib.mak``, a number of drivers are used for internal purposes. You can search ``lib.mak`` for files named ``gdev*.c`` to find almost all of them.
+
+Drivers are divided into "printer" drivers, which support banding, and non-printer drivers, which don't. The decision whether banding is required is made (by default on the basis of how much memory is available) in the procedure ``gdev_prn_alloc`` in ``gdevprn.c``: it implements this decision by filling the virtual procedure table for the printer device in one of two different ways.
+
+A good simple "printer" (bandable) driver to read is ``gdevmiff.c``: it's less than 100 lines, of which much is boilerplate. There are no simple non-printer drivers that actually drive devices: probably the simplest non-printer driver for reading is ``gdevm8.c``, which implements 8-bit-deep devices that only store the bits in memory.
+
+
+Platform-specific code
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are very few platform dependencies in Ghostscript. Ghostscript deals with them in three ways:
+
+Files named ``*_.h`` substitute for the corresponding ``<*.h>`` file by adding conditionals that provide a uniform set of system interfaces on all platforms.
+
+The file ``arch.h`` contains a set of mechanically-discovered platform properties like byte order, size of int, etc. These properties, not the names of specific platforms, are used to select between different algorithms or parameters at compile time.
+
+Files named ``gp*.h`` define interfaces that are intended to be implemented differently on each platform, but whose specification is common to all platforms.
+
+The platform-specific implementations of the ``gp*.h`` interfaces have names of the form ``gp_{platform}.c``, specifically (this list may be out of date):
+
+
+**Platform-specific interfaces**
+
+
+.. list-table::
+ :header-rows: 1
+ :widths: 50 50
+
+ * - Routine
+ - Platform
+ * - ``gp_dosfb.c``
+ - DOS
+ * - ``gp_dosfs.c``
+ - DOS and MS Windows
+ * - ``gp_itbc.c``
+ - DOS, Borland compilers
+ * - ``gp_iwatc.c``
+ - DOS, Watcom or Microsoft compiler
+ * - ``gp_msdos.c``
+ - DOS and MS Windows
+ * - ``gp_ntfs.c``
+ - MS Windows NT
+ * - ``gp_os2.c``
+ - OS/2
+ * - ``gp_os9.c``
+ - OS-9
+ * - ``gp_unifs.c``
+ - Unix, OS-9, and QNX
+ * - ``gp_unix.c``
+ - Unix and QNX
+ * - ``gp_vms.c``
+ - VMS
+ * - ``gp_win32.c``
+ - MS Windows NT
+
+If you are going to extend Ghostscript to new machines or operating systems, check the ``*_.h`` files for ``ifdef`` on things other than ``DEBUG``. You should probably plan to make a new ``makefile`` and a ``new gp_XXX.c`` file.
+
+
+
+
+Makefiles
+---------------------------------------
+
+This section is only for advanced developers who need to integrate Ghostscript into a larger program at build time.
+
+.. note ::
+
+ THIS SECTION IS INCOMPLETE. IT WILL BE IMPROVED IN A LATER REVISION.
+
+
+The Ghostscript ``makefiles`` are meant to be organized according to the following two principles:
+
+#. All the parameters that vary from platform to platform appear in the top-level ``makefile`` for a given platform. ("Platform" = OS + compiler + choice of interpreter vs. library).
+
+#. All the rules and definitions that can meaningfully be shared among more than 1 platform appear in a ``makefile`` that is "included" by a ``makefile`` (normally the top-level ``makefile``) for those platforms.
+
+Thus, for example:
+
+- Rules and definitions shared by all builds are in ``gs.mak``.
+
+- Rules and definitions specific to the library (on all platforms) are in ``lib.mak``. In principle this could be merged with ``gs.mak``, but we wanted to leave open the possibility that ``gs.mak`` might be useful with hypothetical interpreter-only products.
+
+- Stuff specific to interpreters (on all platforms) is in ``int.mak``.
+- Stuff specific to all Unix platforms should be in a single ``unix.mak`` file, but because make sometimes cares about the order of definitions, and because some of it is shared with DV/X, it got split between ``unix-aux.mak``, ``unix-end.mak``, ``unixhead.mak``, ``unixinst.mak``, and ``unixlink.mak``.
+
+For MS-DOS and MS Windows builds, there should be:
+
+
+- A ``makefile`` for all MS OS (DOS or Windows) builds, for all compilers and products.
+
+ Perhaps a ``makefile`` for all MS-DOS builds, for all compilers and products, although since Watcom is the only such compiler we're likely to support this may be overkill.
+
+- A ``makefile`` for all MS Windows builds, for all compilers and products.
+
+- A ``makefile`` for all Watcom builds (DOS or Windows), for all products.
+
+- A top-level ``makefile`` for the Watcom DOS interpreter product.
+
+- A top-level ``makefile`` for the Watcom Windows interpreter product.
+
+- A top-level ``makefile`` for the Watcom DOS library "product".
+
+- A top-level ``makefile`` for the Watcom Windows library "product".
+
+- A ``makefile`` for all Borland builds (DOS or Windows), for all products.
+
+
+and so on.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.. include:: footer.rst \ No newline at end of file
diff --git a/doc/src/Unix-lpr.rst b/doc/src/Unix-lpr.rst
new file mode 100644
index 00000000..7b58b726
--- /dev/null
+++ b/doc/src/Unix-lpr.rst
@@ -0,0 +1,121 @@
+.. title:: Setting Up a Unix lpr Filter for Ghostscript
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Unix-lpr.htm:
+
+
+
+Setting Up a Unix lpr Filter for Ghostscript
+==============================================
+
+
+
+*"How do I set up Ghostscript to provide PostScript queues in a standard lpr environment on Unix systems?"* is a Frequently Asked Question amongst Ghostscript users. The two shell scripts described by this document are designed to make this task a little easier. They are:
+
+
+``unix-lpr.sh``
+ a flexible, multi-option print filter.
+
+``lprsetup.sh``
+ A shell script which sets up soft links and creates a template insert for the ``printcap`` file.
+
+
+What it can do
+----------------------
+
+The print filter resides in the Ghostscript installation directory (often ``/usr/local/share/ghostscript``, but may be something else at your installation), together with a dummy filter directory containing various soft links which point to the filter. It offers the following features:
+
+- Multiple devices supported by a single filter.
+
+- Multiple bit-depths for the same device.
+
+- Multiple number of colours for the same device.
+
+- Direct (single-queue) and indirect (two-queue) setup.
+
+- Support for the standard preprocessing filters if you have the corresponding (whatever)-to-PostScript translators.
+
+- Redirection of diagnostic and programmed output to a ``logfile`` in the spooling directory.
+
+- Maintaining of printer accounting records of the numbers of pages printed by each user (compatible with the ``pac`` command).
+
+- Straightforward editing for further customisation.
+
+
+Setting it up
+---------------
+
+The ``lprsetup.sh`` script needs to have two lines edited before running, to set the printer devices to use and the list of filters available. With this information, it:
+
+- Creates a "filt" subdirectory under the Ghostscript installation directory.
+
+- Creates the links in this directory which enable the filter to determine the parameters for running Ghostscript.
+
+- Automatically generates ``printcap`` entries which should need only a little editing before adding to your system ``printcap`` file.
+
+
+Editing the device list DEVICES
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+At the top of ``lprsetup.sh`` is a line of the form ``DEVICES={list}``. Replace the example list with your own list of devices. Each entry is the name of a device, followed by three more optional fields, separated by dots "``.``".
+
+
+.. _field-bits-per-pixel:
+
+Field 1: bits per pixel
+""""""""""""""""""""""""
+
+The first field is required only if the printer device understands the ``-dBitsPerPixel=`` switch, which applies only to colour devices. For a particular number N of bits per pixel, add the suffix ``.N`` to the device name, for instance ``cdj500.3``, ``cdj500.24``, etc.
+
+Field 2: colours
+""""""""""""""""""""""""
+
+The second field is required only if the printer device understands the setting of the Colors device parameter (as in ``-dColors=``), which applies only to colour devices (and at present is only supported by the ``bjc*`` family of drivers). For a particular number N of colours, suffix ``.N`` to the device name, such as ``bjc600.24.3``, ``bjc600.8.1`` etc.
+
+
+.. _field_dq:
+
+Field 3: dual queues
+""""""""""""""""""""""""
+
+The third field is required in order to use two separate queues for the device, a "raw" queue and a PostScript queue (see `Single or dual queues`_ below). If you want dual queues, add the suffix ``.dq`` ("dual queue") to the name, whether or not a :ref:`bits-per-pixel<field-bits-per-pixel>` suffix has already been added.
+
+
+Example definition of DEVICES
+""""""""""""""""""""""""""""""""""""""""""""""""
+
+Thus the following list supports a :title:`cdj550` device at three different bit depths (24 bpp, 3 bpp and 1 bpp), with a dual queue (that is, a separate queue for the raw data); a monochrome deskjet device with a single queue; and a :title:`djet500` device using a separate queue:
+
+
+.. code-block:: postscript
+
+ DEVICES="cdj550.24.dq cdj550.3.dq cdj550.1.dq deskjet djet500.dq"
+
+Editing the filter list
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The standard list contains only the generic "``if``" filter, but a commented-out list shows other filters which may be available. If you wish to use the support for these filters, you may need to edit the ``bsd-if`` file to add to the ``PATH`` the directories where the translators are stored, or to change the names of the filters if yours are different. The ``bsd-if`` script is supplied with an example setup using Transcript (a commercial package from Adobe), and ``PBMPLUS``, a freeware package by Jef Poskanzer and others.
+
+Editing the printer port and type
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can set the port and port type (parallel or printer) for an attached printer, but for remote printers you'll have to modify the ``printcap.insert`` file yourself.
+
+Modifying printcap.insert
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Running ``lprsetup.sh`` generates a file ``printcap.insert`` which has a template setup for your printer queues. It cannot guarantee to do the whole job, and you will probably need to consult your system documentation and edit this file before you add it to your ``printcap`` file. The file has good defaults for serial printers, as these often cause problems in getting binary data to the printer. However, you may need to change the baud rate, or the handshaking method. Only a small change is required in the ``printcap`` file to use a networked remote printer instead of an attached printer, and an example is given in ``printcap.insert``.
+
+Single or dual queues
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you wish to provide a PostScript-only queue (for example, so that all pages printed go through accounting), and the printer port is local to the host machine, a single queue is appropriate -- Ghostscript simply converts PostScript into the printer's native data format and sends it to the port. But if the printer is on a remote networked machine, or if you need to send raw printer data to the printer, you must use two queues. Simply specify the :ref:`dq<field_dq>` option above.
+
+
+
+
+.. include:: footer.rst \ No newline at end of file
diff --git a/doc/src/UnsupportedDevices.rst b/doc/src/UnsupportedDevices.rst
new file mode 100644
index 00000000..b7b2c12f
--- /dev/null
+++ b/doc/src/UnsupportedDevices.rst
@@ -0,0 +1,4208 @@
+.. title:: Unsupported devices
+
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _UnsupportedDevices.htm:
+
+
+
+Unsupported devices
+===================================
+
+
+
+
+These devices are no longer supported and/or superceeded by newer methods. The documentation is kept here for reference. Be advised that these devices will be removed in future versions of Ghostscript.
+
+Supported devices are descripted in :ref:`Details of Ghostscript output devices<Devices.htm>`.
+
+For other information, see the :ref:`Ghostscript overview<Readme.htm>`. You may also be interested in :ref:`how to build Ghostscript<Make.htm>` and :ref:`install it<Install.htm>`, as well as the description of the :ref:`driver interface<Drivers.htm>`.
+
+
+
+
+
+
+
+H-P 8xx, 1100, and 1600 color inkjet printers
+----------------------------------------------------
+
+This section, written by `Uli Wortmann`_, deals with the DeskJet 670, 690, 850, 855, 870, 890, 1100, and 1600.
+
+
+
+Drivers contained in ``gdevcd8.c``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The source module ``gdevcd8.c`` contains four generic drivers:
+
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 0
+
+ * - :title:`cdj670`
+ - HP DeskJet 670 and 690
+ * - :title:`cdj850`
+ - HP DeskJet 850, 855, 870, and 1100
+ * - :title:`cdj890`
+ - HP DeskJet 890
+ * - :title:`cdj1600`
+ - HP DeskJet 1600
+
+
+Further documentation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Credits: Much of the driver is based on ideas derived from the :title:`cdj550` driver of George Cameron. The support for the hp670, hp690, hp890 and hp1600 was added by Martin Gerbershagen.
+
+
+.. list-table::
+ :widths: 10 20 70
+ :header-rows: 1
+
+ * - Date
+ - Version
+ - Comments
+ * - 11.11.96
+ - Version 1.0
+ -
+ * - 25.08.97
+ - Version 1.2
+ - Resolved all but one of the known bugs,
+
+ introduced a couple of perfomance improvements.
+
+ Complete new color-transfer-function handling (see gamma).
+
+ * - 01.06.98
+ - Version 1.3
+ - Due to the most welcome contribution of
+
+ `Martin Gerbershagen`_, support for the
+
+ hp670, hp690 and hp890
+
+ and hp1600 has been added.
+
+ Martin has also resolved all known bugs.
+
+ Problems: Dark colors are still pale.
+
+
+The hp690 is supported through the hp670 device, the hp855, hp870 and the hp1100 through the hp850 device. The driver needs no longer special switches to be invoked except ``-sDEVICE=cdj850``, ``-sDEVICE=CDJ890``, ``-sDEVICE=CDJ670``, or ``-sDevice=CDJ1600``. The following switches are supported:
+
+
+.. list-table::
+ :widths: 30 20 50
+ :header-rows: 0
+
+ * - ``-dPapertype=``
+ - 0
+ - plain paper [default]
+ * -
+ - 1
+ - bond paper
+ * -
+ - 2
+ - special paper
+ * -
+ - 3
+ - glossy film
+ * -
+ - 4
+ - transparency film
+ * -
+ -
+ - Currently the lookup tables are unsuited for printing on special
+
+ paper or transparencies. For these please revert to the gamma functions.
+
+ * - ``-dQuality=``
+ - -1
+ - draft
+ * -
+ - 0
+ - normal [default]
+ * -
+ - 1
+ - presentation
+ * - ``-dRetStatus=``
+ - 0
+ - C-RET off
+ * -
+ - 1
+ - C-RET on [default]
+ * - ``-dMasterGamma=``
+ - 3.0
+ - [default = 1.0]
+
+
+.. note::
+
+ To take advantage of the calibrated color-transfer functions, be sure not to have any gamma statements left! If you need to (i.e., for overhead transparencies), you still can use the gamma functions, but they will override the built-in calibration. To use gamma in the traditional way, set ``MasterGamma`` to any value greater than 1.0 and less than 10.0. To adjust individual gamma values, you have to additionally set ``MasterGamma`` to a value greater than 1.0 and less than 10.0. With the next release, gamma functions will be dropped.
+
+
+When using the driver, be aware that printing at 600dpi involves processing large amounts of data (> 188MB !). Therefore the driver is not what you would expect to be a fast driver ;-) This is no problem when printing a full-sized color page (because printing itself is slow), but it's really annoying if you print only text pages. Maybe I can optimize the code for text-only pages in a later release. Right now, it is recommended to use the highest possible optimisation level your compiler offers. For the time being, use the :title:`cdj550` device with ``-sBitsPerPixel=3`` for fast proof prints. If you simply want to print 600dpi BW data, use the cdj550 device with ``-sBitsPerPixel=8`` (or 1).
+
+Since the printer itself is slow, it may help to set the process priority of the gs process to "regular" or even less. On a 486/100MHz this is still sufficient to maintain a continuous data flow. Note to OS/2 users: simply put the gs window into the background or minimize it. Also make sure that ``print01.sys`` is invoked without the ``/irq`` switch (great speed improvement under Warp4).
+
+The printer default settings compensate for dot-gain by a calibrated color-transfer function. If this appears to be too light for your business graphs, or for overhead transparencies, feel free to set ``-dMasterGamma=1.7``. Furthermore, you may tweak the gamma values independently by setting ``-dGammaValC``, ``-dGammaValM``, ``-dGammaValY`` or ``-dGammaValK`` (if not set, the values default to ``MasterGamma``). This will only work when ``-dMasterGamma`` is set to a value greater than 1.0.
+
+Depending on how you transfer the files, under UNIX you may need to remove the CRs of the CR-LF sequence used for end-of-line on DOS-based (MS Windows-based) systems. You can do this in unpacking the files with ``unzip -a hp850.zip``.
+
+To compile with ``gs5.x`` or later, simply add to your ``makefile``:
+
+
+.. code-block:: bash
+
+ DEVICE_DEVS4=cdj850.dev cdj670.dev cdj890.dev cdj1600.dev
+
+
+
+
+
+H-P 812, 815, 832, 880, 882, 895, and 970 color inkjet printers
+-------------------------------------------------------------------------
+
+This section, written by `Matthew Gelhaus`_, deals with the DeskJet 812, 815, 832, 880, 882, 895, and 970.
+
+This is a modified version of the HP8xx driver written by `Uli Wortmann`_. More information and download are available at `gelhaus.net/hp880c`_.
+
+
+
+
+Drivers contained in ``gdevcd8.c``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The source module ``gdevcd8.c`` contains one generic driver:
+
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 0
+
+ * - :title:`cdj880`
+ - HP DeskJet 812, 815, 832, 880, 882, 895, and 970
+
+
+
+Further documentation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Credits: This driver is based on the :title:`cdj850` driver by Uli Wortmann, and shares the same internal structure, although the PCL3+ interpretation has changed.
+
+.. list-table::
+ :widths: 10 20 70
+ :header-rows: 1
+
+ * - Date
+ - Version
+ - Comments
+ * - 15.03.99
+ - Version 1.3
+ - Initial version, based on Version 1.3 of Uli Wortmann's driver.
+ * - 26.02.00
+ - Version 1.4beta
+ - Greatly improved color handling & dithering, but not yet complete enough to use for text.
+
+
+All printers are supported through the cdj880 device. Invoke with ``-sDEVICE=cdj880``. The following switches are supported:
+
+
+.. list-table::
+ :widths: 30 20 50
+ :header-rows: 0
+
+ * - ``-dPapertype=``
+ - 0
+ - plain paper [default]
+ * -
+ - 1
+ - bond paper
+ * -
+ - 2
+ - special paper
+ * -
+ - 3
+ - glossy film
+ * -
+ - 4
+ - transparency film
+ * -
+ -
+ - Currently the lookup tables are unsuited for printing on special
+
+ paper or transparencies. For these please revert to the gamma functions.
+
+ * - ``-dQuality=``
+ - -1
+ - draft
+ * -
+ - 0
+ - normal [default]
+ * -
+ - 1
+ - presentation
+ * - ``-dMasterGamma=``
+ - 3.0
+ - [default = 1.0]
+
+
+
+The printer default settings compensate for dot-gain by a pre-defined color-transfer function. If this appears to be too light for your business graphs, or for overhead transparencies, feel free to set ``-dMasterGamma=1.7``. Furthermore, you may tweak the gamma values independently by setting ``-dGammaValC``, ``-dGammaValM``, ``-dGammaValY`` or ``-dGammaValK`` (if not set, the values default to ``MasterGamma``). This will only work when ``-dMasterGamma`` is set to a value greater than 1.0.
+
+To compile with ``gs6.x`` or later, simply add to your ``makefile``:
+
+
+.. code-block:: bash
+
+ DEVICE_DEVS4=$(DD)cdj880.dev
+
+
+
+
+H-P color inkjet printers
+--------------------------------
+
+This section, written by George Cameron, deals with the DeskJet 500C, DeskJet 550C, PaintJet, PaintJet XL, PaintJet XL300, the DEC LJ250 operating in PaintJet-compatible mode.
+
+Drivers contained in ``gdevcdj.c``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The source module ``gdevcdj.c`` contains six generic drivers:
+
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 0
+
+ * - :title:`cdj500`
+ - HP DeskJet 500C and 540C
+ * - :title:`cdj550`
+ - HP DeskJet 550C, 560C, 660C, 660Cse
+ * - :title:`pjxl300`
+ - HP PaintJet XL300, DeskJet 1200C, and CopyJet
+ * - ``pjtest``
+ - HP PaintJet
+ * - ``pjxltest``
+ - HP PaintJet XL
+ * - :title:`declj250`
+ - DEC LJ250
+
+All these drivers have 8-bit (monochrome), 16-bit and 24-bit (colour) and for the DJ 550C, 32-bit (colour, CMYK mode) options in addition to standard colour and mono drivers. It is also possible to set various printer-specific parameters from the command line, for example:
+
+
+.. code-block:: bash
+
+ gs -sDEVICE=cDeskJet -dBitsPerPixel=16 -dDepletion=1 -dShingling=2 tiger.eps
+
+
+.. note ::
+
+ The old names :title:`cdeskjet`, :title:`cdjcolor` and :title:`cdjmono` drivers have been retained; however, their functionality duplicates that available using the drivers above (and :title:`cdeskjet` is identical to :title:`cdj500`). That is, we can use:
+
+ .. code-block:: bash
+
+ gs -sDEVICE=cdj500 -dBitsPerPixel=24 for cdjcolor, and
+ gs -sDEVICE=cdj500 -dBitsPerPixel=1 for cdjmono
+
+
+Default paper size
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If the preprocessor symbol A4 is defined, the default paper size is ISO A4; otherwise it is U.S. letter size (see about :ref:`paper sizes<Known paper sizes>` in the usage documentation). You can :ref:`specify other paper sizes<Use_PaperSize>` on the command line, including A3 for the PaintJet XL and PaintJet XL300, as also explained in the :ref:`usage documentation<Use.htm>`.
+
+DeskJet physical limits
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The DeskJet's maximum printing width is 2400 dots, or 8 inches (20.32cm). The printer manuals say that the maximum recommended printing height on the page is 10.3 inches (26.16cm), but since this is obviously not true for A4 paper, and I have been unable to detect any problems in printing longer page lengths, this would seem to be a rather artificial restriction.
+
+All DeskJets have 0.5 inches (1.27cm) of unprintable bottom margin, due to the mechanical arrangement used to grab the paper. Side margins are approximately 0.25 inches (0.64cm) for U.S. letter paper, and 0.15 inches (0.38cm) for A4.
+
+Printer properties (command-line parameters)
+"""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Several printer "properties" have been implemented for these printers. Those available so far are all integer quantities, and thus may be specified, for instance, like
+
+.. code-block:: bash
+
+ gs -dBitsPerPixel=32 -dShingling=1 ...
+
+which sets the ``BitsPerPixel`` parameter to 32 and the ``Shingling`` parameter to 1.
+
+
+Bits per pixel
+"""""""""""""""""""""""""""""""""""""""""""""""""""
+
+If the preprocessor symbol ``BITSPERPIXEL`` is defined as an integer (see below for the range of allowable values), that number defines the default bits per pixel (bit depth) for the generic drivers. If the symbol is undefined, the default is 24 bits per pixel. It is, of course, still possible to specify the value from the command line as described below. Note also that the cDeskJet, cdjcolor and cdjmono drivers are unaffected by setting this symbol, as their default settings are predefined to be 1, 3 and 24 respectively.
+
+All of the drivers in ``gdevcdj.c`` accept a command line option to set the ``BitsPerPixel`` property. This gives considerable flexibility in choosing various tradeoffs among speed, quality, colour, etc. The valid numbers are:
+
+
+.. list-table::
+ :widths: 30 70
+ :header-rows: 1
+
+ * - BITSPERPIXEL
+ - Comments
+ * - 1
+ - A standard Ghostscript monochrome driver, using black
+
+ ink (by installing the separate mono cartridge in the
+
+ case of the DeskJet 500C, or automatically for the other printers).
+ * - 3
+ - A standard Ghostscript colour driver, using internal dithering.
+
+ This is fast to compute and to print, but the clustered
+
+ dithering can lose some detail and colour fidelity.
+ * - 8
+ - An "error-diffusion" monochrome driver which uses Floyd-Steinberg
+
+ dithering to print greyscale images.
+
+ The patterns are much more randomised than with the normal
+
+ clustered dithering, but the data files can be much larger
+
+ and somewhat slower to print.
+ * - 16
+ - A "cheaper" version of the 24-bit driver, which generates
+
+ Floyd-Steinberg colour dithered output using the minimum
+
+ memory (this may be helpful when using Ghostscript has not
+
+ been compiled using a 16-bit build environment).
+
+ The quality can be almost as good as the 24-bit version.
+ * - 24
+ - A high-quality colour driver using Floyd-Steinberg
+
+ dithering for maximum detail and colour range.
+
+ However, it is very memory-intensive, and thus can
+
+ be slow to compute. It tends to produce rather
+
+ larger raw data files, so they can also take longer to print.
+ * - 32
+ - Only for the DeskJet 550C, which uses the black cartridge
+
+ and the colour cartridge simultaneously (that is, CMYK printing).
+
+ This printer can both be faster and give higher quality than
+
+ the DeskJet 500C, because of the true black ink.
+
+ (Note that the 24-bit mode also permits CMYK printing on
+
+ this printer, and uses less memory). Any differences
+
+ between 24-bit and 32-bit should be small.
+
+
+DeskJet properties
+"""""""""""""""""""""""""""""""""""""""""""""""""""
+
+.. list-table::
+ :widths: 30 10 60
+ :header-rows: 1
+
+ * - Name
+ - Type
+ - Comments
+ * - BlackCorrect
+ - `int`
+ - Colour correction to give better blacks when using
+
+ the DJ500C in colour mode. For example, the
+
+ default of 4 reduces the cyan component to 4/5.
+
+ Range accepted: 0 - 9 (0 = none).
+ * - Shingling
+ - `int`
+ - Interlaced, multi-pass printing:
+
+ 0 = none, 1 = 50%, 2 = 25%, 2 is best and slowest.
+ * - Depletion
+ - `int`
+ - "Intelligent" dot-removal:
+
+ 0 = none, 1 = 25%, 2 = 50%, 1 best for graphics?
+
+ Use 0 for transparencies.
+
+PaintJet XL300 / PaintJet XL properties
+"""""""""""""""""""""""""""""""""""""""""""""""""""
+
+
+.. list-table::
+ :widths: 30 10 60
+ :header-rows: 1
+
+ * - Name
+ - Type
+ - Comments
+ * - PrintQuality
+ - `int`
+ - Mechanical print quality: -1 = fast, 0 = normal, 1 = presentation.
+
+ Fast mode reduces ink usage and uses single-pass operation for
+
+ some media types. Presentation uses more ink and the maximum number
+
+ of passes, giving slowest printing for highest quality.
+ * - RenderType
+ - `int`
+ - 0 driver does dithering
+
+ 1 snap to primaries
+
+ 2 snap black to white, others to black
+
+ 3 ordered dither
+
+ 4 error diffusion
+
+ 5 monochrome ordered dither
+
+ 6 monochrome error diffusion
+
+ 7 cluster ordered dither
+
+ 8 monochrome cluster ordered dither
+
+ 9 user-defined dither (not supported)
+
+ 10 monochrome user-defined dither ns.
+
+
+The PaintJet (non-XL) has no additional properties.
+
+
+
+
+Gamma correction
+~~~~~~~~~~~~~~~~~~~~~
+
+One consequence of using Floyd-Steinberg dithering rather than Ghostscript's default clustered ordered dither is that it is much more obvious that the ink dots are rather larger on the page than their nominal 1/180-inch or 1/300-inch size (clustering the dots tends to minimise this effect). Thus it is often the case that the printed result is rather too dark. A simple empirical correction for this may be achieved by preceding the actual PostScript file to be printed by a short file which effectively sets the gamma for the device, such as:
+
+
+.. code-block:: bash
+
+ gs ... gamma.ps colorpic.ps -c quit
+
+where ``gamma.ps`` is:
+
+.. code-block:: postscript
+
+ %!
+ /.fixtransfer {
+ currentcolortransfer 4 {
+ mark exch
+ dup type dup /arraytype eq exch /packedarraytype eq or
+ 1 index xcheck and { /exec load } if
+ 0.333 /exp load
+ ] cvx 4 1 roll
+ } repeat setcolortransfer
+ } bind odef
+ .fixtransfer
+ /setpagedevice { setpagedevice .fixtransfer } bind odef
+
+
+This does the gamma correction after whatever correction the device might be doing already. To do the correction before the current correction:
+
+.. code-block:: postscript
+
+ %!
+ /.fixtransfer {
+ currentcolortransfer 4 {
+ mark 0.333 /exp load 4 -1 roll
+ dup type dup /arraytype eq exch /packedarraytype eq or
+ 1 index xcheck and { /exec load } if
+ ] cvx 4 1 roll
+ } repeat setcolortransfer
+ } bind odef
+ .fixtransfer
+ /setpagedevice { setpagedevice .fixtransfer } bind odef
+
+
+This example sets the gamma for R, G, and B to 3, which seems to work reasonably well in practice.
+
+
+
+HP's resolution-enhanced mode for Inkjet printers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This feature is available on HP's more recent inkjet printers, including the DeskJet 520 (mono), 540 (mono or colour) and 560C (mono and colour). The colour and monochrome drivers for the HP DeskJet 550c are (probably) the best you will get for use with Ghostscript, for the following reasons.
+
+These printers do not offer true 600×300dpi resolution. Those that print in colour are strictly 300×300dpi in colour mode, while in mono mode there is a pseudo 600×300dpi mode with the restriction that you can't print two adjacent dots. In effect what you have is 600dpi dot positioning, but on average you don't get more dots per line. This provides the possibility, for instance, to have sharper character outlines, because you can place dots on the edges nearer to their ideal positions. This is why it is worth doing.
+
+However, HP will not support user-level programming of this resolution-enhanced mode, one reason being that (I understand) all the dot spacing has to be done by the driver, and if you get it wrong, you can actually damage the print head.
+
+To summarise, you may lose a smidgin of (potential) text clarity using the 550c drivers (:title:`cdj550`, :title:`cdjcolor`, :title:`cdjmono` etc.), but other than that, they are the ones for the job.
+
+
+
+General tips
+~~~~~~~~~~~~~~~~~~~~~
+
+For all the printers above, the choice of paper is critically important to the final results. The printer manuals suggest type of paper, but in general, smoother, less fibrous types give better results. In particular, the special ink-jet paper can make a big difference: colours are brighter, but most importantly, there is almost no colour bleed, even with adjacent areas of very heavy inking. Similarly the special coated transparencies also work well (and ordinary transparencies do not work at all!).
+
+The Unix procedure :ref:`unix-lpr.sh<Unix-lpr.htm>` provides one example of setting up a multi-option colour PostScript lpr queue on Unix systems, and includes the ability to choose a range of different colour options and printer accounting and error logging.
+
+Caveat emptor! It is not always easy for me to test all of these drivers, as the only colour printer I have here is the DeskJet 500C. I rely on others to test drivers for the additional machines and report their findings back to me.
+
+
+
+Canon BJC-8200 printer
+-----------------------------
+
+This section was contributed by the author of the :title:`uniprint` configuration files for the Canon BJC-8200, `Stephan C. Buchert`_. These files also handle the Japanese Canon F850 printer.
+
+
+.. warning::
+
+ Usage of this program is neither supported nor endorsed by the Canon corporation. Please see the Ghostscript license regarding warranty.
+
+
+Introduction
+~~~~~~~~~~~~~~
+
+The Canon Bubble Jet printer BJC-8200 is designed for printing digital photos and halftone images. Software drivers for Windows 95-2000 and Mac are usually included and can be downloaded from the Canon web sites for the US market. If these drivers cannot be used for some reason, then at present Ghostscript is probably the alternative giving the best results.
+
+The BJC-8200 has features not found among the specs of earlier bubble jet models (except the even more advanced BJC-8500) and is advertised to offer:
+
+#. Microfine droplet technology.
+#. Support for printing on a new type of paper, Photo Paper Pro.
+#. A printhead capable of printing up to 1200 DpI.
+#. Individual ink tanks for 6 colors.
+#. An internal status monitor reporting low ink back to a driver.
+#. An optional color scanner cartridge for up to 600 DpI resolution.
+
+Access to features 5 and 6 requires use of the original Canon drivers for the foreseeable future. This README is about getting the printer features 1-3 working with Ghostscript. No (re)compilation of Ghostscript is normally required.
+
+Ghostscript comes with a relatively highly configurable driver, called uniprint_, for printers which understand raster images in various propriety formats. Most options for this driver are usually organized into files having the suffix ``.upp``. Ghostscript versions >= 5.10 (or even earlier) include such :title:`uniprint` control files for the Canon BJC-610. They work also well for some other Canon Bubble Jet models, for example for my BJC-35vII. But when using them for a BJC-8200 the result is unsatisfactory.
+
+The :title:`uniprint` control files for the BJC-8200
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+After some experimenting with the options for :title:`uniprint` I have obtained quite satisfactory prints with :ref:`my printer<myPrinter>`. This distribution includes six new :title:`uniprint` control files:
+
+- ``bj8pp12f.upp``
+- ``bj8hg12f.upp``
+- ``bj8gc12f.upp``
+- ``bj8oh06n.upp``
+- ``bj8ts06n.upp``
+- ``bj8pa06n.upp``
+
+They are included in Ghostscript ``>=6.21``. For older versions you can put them anywhere in the Ghostscript search path (type ``gs -h`` to see the path), but should perhaps add the files to the directory with the other ``*.upp`` files. This is ``/usr/share/ghostscript/gs6.01/lib`` in my RedHat 6.1 Linux box with Aladdin Ghostscript 6.01.
+
+Here is an explanation of my file name convention: the prefix "bj8" should perhaps be used for the Canon BJC-8200 and compatible (like the Japanese F850 and perhaps the non-Japanese BJC-8500) models. The next two letters indicate the print media:
+
+- **pp** - "Photo Paper Pro".
+- **hg** - "High Gloss Photo Film".
+- **gc** - "Glossy Photo Cards".
+- **oh** - "OHP transparencies".
+- **ts** - "T-shirt transfer".
+- **pa** - "Plain Paper".
+
+
+The numbers at positions 6 and 7 indicate the resolution
+
+- **12** - 1200x1200 DpIxDpI.
+- **06** - 600x600 DpIxDpI.
+
+The last letter stands for a quality factor that effects also the print speed (presumably related to the number of passes that the printhead makes).
+
+- **f** - highest quality.
+- **n** - normal quality.
+
+Printing a postcard size (~10x15 cm^2) image at 1200x1200 DpI^2 takes about 3 minutes. The output of Ghostscript is then typically 4-5 MByte. The bootleneck seems to be the transfer of the raster image in run-length encoded Canon format to the printer (via the parallel port on my system) or the printer's speed, not Ghostscript or the :title:`uniprint` renderer.
+
+
+Further Optimization for the Canon BJC-8200
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+So far I have only experimented with the printer initialization code at the beginning of each page (``-dupBeginPageCommand``) and the resolution (``-r``). Other options, particularly the transfer arrays (``-dupBlackTransfer``, ``-dupCyanTransfer``, ``-dupMagentaTransfer``, ``-dupYellowTransfer``) and the margins (``-dupMargins``) were simply copied from the files for the BJC-610, but they may need to be changed for optimized performance.
+
+Here is information useful for changing or adding :title:`uniprint` control files for the BJC-8200:
+
+In ``-dupBeginPageCommand=...`` use the line:
+
+.. code-block:: postscript
+
+ 1b28 64 0400 04b0 04b0
+
+
+for 1200x1200 resolution, and:
+
+.. code-block:: postscript
+
+1b28 64 0400 0258 0258
+
+for 600x600. The ``-r`` option in the control file must of course match this line. Other resolutions might work as well, but I didn't try.
+
+
+Crucial are the numbers in the lines like:
+
+
+.. code-block:: postscript
+
+ 1b28 63 0300 3005 04
+ ^ ^
+ Plain Paper 0 4 Highest quality
+ OHP transparency 2 .
+ T-shirt transfer 3 .
+ Glossy Photo Film 5 .
+ High Gloss Paper 6 0 Lowest quality
+ Photo Paper Pro 9
+
+
+Outlook
+~~~~~~~~~~~~
+
+Presently :title:`uniprint` can use the black (K), cyan (C), magenta (M), and yellow (Y) colors in the BJC-8200. The unused colors are photo (or light) cyan (c) and magenta (m). Also the Canon driver seems to use only CMYK, for example when printing on Photo Paper Pro in "Camera" or "SuperPhoto" mode. These modes supposedly produce prints of the best quality that the Canon driver can offer. Other modes of Canon driver do use up to all six color cartridges (CMYKcm). Therefore expanding :title:`uniprint`'s capabilities for six colors would be interesting, but it may not increase the output quality of 6-color printers such as the BJC-8200 drastically.
+
+More control files for :title:`uniprint` could be added in order to offer more versatility for controlling the BJC-8200 within a Ghostscript installation. The number of possible combinations for media type, resolution and print quality factor is very large, many combinations would not make much sense, many might be used here and there, but relatively rarely. The user would have to remember a name for each combination that is used.
+
+A better way would be to let the user patch optionally a user owned or system wide :title:`uniprint` control file before each print via some print tool. This is similar to the approach taken by Canon with their driver for Windows. Similarly a :title:`uniprint` tool could also incorporate other functions such as printing test and demo pages and the low ink warning once the protocol for this is known. Clearly it would be difficult to code such a :title:`uniprint` tool for all the platforms where Ghostscript is running.
+
+
+Usage on RedHat Linux
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+In order to install a BJC-8200 printer on a RedHat Linux system with RedHat's printtool, you need also to insert with a text editor the contents of the file ``bj8.rpd`` into the RedHat printer database ``/usr/lib/rhs/rhs-printfilters/printerdb``. Insert it most appropriately after the section:
+
+
+.. code-block::
+
+ StartEntry: U_CanonBJC610
+ .
+ .
+ .
+ EndEntry
+
+ < --- insert here "bj8.rpd" from this distribution:
+ < --- StartEntry: U_CanonBJC8200
+ .
+ .
+ .
+
+.. _myPrinter:
+
+.. note::
+
+ Actually I have a F850, not a BJC-8200. That model is sold for the Japanese market only. The specs and also the external look are the same as those of the BJC-8200 models for the American and European markets. I expect that the raster image mode which is used exclusively by Ghostscript is entirely compatible for both models.
+
+
+
+
+Other Canon BubbleJet (BJC) printers
+---------------------------------------
+
+This section was contributed by the author of the drivers, Yves Arrouye. The drivers handle Canon BJC-600, BJC-4xxx, BJC-70, Stylewriter 2x00, and BJC-800 printers.
+
+History
+~~~~~~~~~~
+
+The BJC-600 driver was written in the first place by Yoshio Kuniyoshi and later modified by Yves Arrouye. We tried to make it evolve synchronously, though Yoshio cannot be reached since a long time ago. The drivers are based on code for the HP printers by George Cameron (in fact, they are in the same file!), so he's the first person to thank.
+
+The 2.00 version of the drivers was a complete rewrite of the driver (arguments, optimization, colour handling, in short: everything!) by Yves Arrouye. That release was also the first one to be able to use the full width of an A3 paper size. PostScript Printer Description (PPD) files for the drivers were released with version 2.15. They are incomplete, but they can be used to drive the printers' main features.
+
+Configuring and building the BJC drivers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Modify values in ``gdevbjc.h``.
+
+Configure the drivers by modifying the default values in the file ``gdevbjc.h`` or on the compilation line. If you don't do that, the drivers use reasonable defaults that make them work "as expected". All default values shown here are defined in that file.
+
+
+CMYK-to-RGB color conversion
+""""""""""""""""""""""""""""""""""
+
+By default, the drivers use the same algorithm as Ghostscript to convert CMYK colors to RGB. If you prefer to use Adobe formulas, define ``USE_ADOBE_CMYK_RGB`` when compiling. (See the top of the file ``gdevcdj.c`` to see the difference between the two.)
+
+Vertical centering of the printable area
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The drivers center the imageable area horizontally but not vertically, so that what can be printed does use the most of the output media. If you define ``BJC_DEFAULT_CENTEREDAREA`` when compiling, then the top and bottom margins will be the same, resulting in a (smaller) vertically centered imageable area also.
+
+Page margins
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+If you define ``USE_RECOMMENDED_MARGINS``, then the top and bottom margins will be the same (that is, ``BJC_DEFAULT_CENTEREDAREA`` will be defined for you) and the margins will be the 12.4mm recommended by Canon. Since margins are complicated (because one must rely on the mechanical precision of the printer), the drivers do something about the bottom margin: by default the bottom margin is 9.54mm for the BJC-600 driver and 7mm for the BJC-800. If you define ``USE_TIGHT_MARGINS``, then the bottom margin is 7mm for both drivers (but I never managed to get my own BJC-600 to print a line on this low bound, hence the larger default). Regardless of the presence of this definition, ``USE_FIXED_MARGINS`` will not allow the BJC-800 to use the lower 7mm bottom margin, so if you have a problem with the bottom margin on a BJC-800, just define that (without defining ``USE_TIGHT_MARGINS``, of course).
+
+A quick way to be sure the margins you selected is to print a file whose contents are:
+
+.. code-block::
+
+ %!
+ clippath stroke showpage
+
+If the margins are okay, you will get a rectangle visibly surrounding the printable area. If they're not correct, one or more of the sides will be either incomplete or completely unprinted.
+
+
+Makefile and compilation
+""""""""""""""""""""""""""""""
+
+Make sure the :title:`bjc600` or :title:`bjc800` devices are in :ref:`DEVICE_DEVS in the makefile<Selecting features and devices>`; that is, look in the ``makefile`` for your platform and add them if necessary -- they may already be there. As of Ghostscript 5.10, for instance, one ``makefile`` has:
+
+.. code-block:: bash
+
+ DEVICE_DEVS6=bj10e.dev bj200.dev bjc600.dev bjc800.dev
+
+
+Use of the drivers
+~~~~~~~~~~~~~~~~~~~~~~
+
+There are two drivers here. The :title:`bjc600` one supports the BJC-600 and BJC-4xxx (maybe the BJC-70 as well) and the :title:`bjc800` one supports the BJC-800 series. Remarks here that apply to both drivers use the name ``bjc``.
+
+Supported Options and Defaults
+"""""""""""""""""""""""""""""""""""""""""
+
+.. note ::
+
+ "options", "properties", and "parameters" designate the same thing: device parameters that you can change.
+
+Giving an option an incorrect value causes an error. Unless stated otherwise, this error will be a ``rangecheckerror``. Options may be set from the Ghostscript command line (using the ``-d`` and ``-s`` switches or other predetermined switches if they have an effect on the driver) or using the PostScript Level 2 ``setpagedevice`` operator if Ghostscript has been compiled with the ``level2`` or ``level3`` device (which it should ;-)). There are no special-purpose operators such as one was able to find in Level 1 printers.
+
+The ``bjc`` uses 24 bits per pixel by default (unless you change the value of ``BJC_BITSPERPIXEL``), corresponding to CMYK printing. Supported modes are 1 bpp and 4 bpp (gray levels), 8 bpp, 16 bpp, 24 bpp and 32 bpp (colours). Colours are preferably stored in the CMYK model (which means, for example, that with 16 bpp there are only 16 different shades of each color) but it is possible to store them as RGB color for some depths. Some modes do Floyd-Steinberg dithering and some don't, but use the default Ghostscript halftoning (in fact, when halftoning is used, dithering takes also place but because of the low point density it is usually not efficient, and thus invisible).
+
+**Descriptions of printing modes by bpp and Colors**
+
+
+.. list-table::
+ :widths: 10 10 80
+ :header-rows: 1
+
+ * - bpp
+ - Colors
+ - Mode
+ * - 32
+ - 4
+ - CMYK colour printing, Floyd-Steinberg dithering
+ * - 24
+ - 4
+ - The same. (But each primary colour is stored on 6 bits instead of 8.)
+ * - 24
+ - 3
+ - RGB colour printing, Floyd-Steinberg dithering. This mode does not use the black
+
+ cartridge (that's why it exists, for when you don't want to use it ;-)).
+
+ Each primary colour is stored in 8 bits as in the 32/4 mode, but black generation
+
+ and under-color removal are done on the driver side and not by Ghostscript,
+
+ so you have no control over it. (This mode is no longer supported in this driver.)
+
+ * - 16
+ - 4
+ - CMYK colour printing, halftoned by Ghostscript. F-S dithering is still
+
+ visible here (but the halftone patterns are visible too!).
+
+ * - 8
+ - 4
+ - The same.(But each primary colour is stored in 2 bits instead of 4.)
+ * - 8
+ - 3
+ - RGB colour printing. This mode is not intended for use. What I mean is
+
+ that it should be used only if you want to use custom halftone screens
+
+ and the halftoning is broken using the 8/4 mode (some versions of
+
+ Ghostscript have this problem).
+ * - 8
+ - 1
+ - Gray-level printing, Floyd-Steinberg dithering
+ * - 1
+ - 1
+ - Gray-level printing halftoned by Ghostscript
+
+
+These modes are selected using the ``BitsPerPixel`` and ``Colors`` integer options (either from the command line or in a PostScript program using ``setpagedevice``). See below.
+
+A note about darkness of what is printed: Canon printers do print dark, really. And the Floyd-Steinberg dithering may eventually darken your image too. So you may need to apply gamma correction by calling Ghostscript as in:
+
+.. code-block:: bash
+
+ gs -sDEVICE=bjc600 gamma.ps myfile.ps
+
+where ``gamma.ps`` changes the gamma correction (here to 3 for all colors); 0.45 gives me good results, but your mileage may vary. The bigger the value the lighter the output:
+
+.. code-block:: bash
+
+ { 0.45 exp } dup dup currenttransfer setcolortransfer
+
+The drivers support printing at 90dpi, 180dpi and 360dpi. Horizontal and vertical resolutions must be the same or a limitcheck error will happen. A ``rangecheck`` will happen too if the resolution is not 90 ×2^N. If the driver is compiled with ``-DBJC_STRICT`` a ``rangecheck`` also happens if the resolution is not one of those supported. This is not the case, as we expect that there may be a 720dpi bjc some day.
+
+
+Here are the various options supported by the ``bjc`` drivers, along with their types, supported values, effects, and usage:
+
+``BitsPerPixel (int)``
+ Choose the depth of the page. Valid values are 1, 8, 16, 24 (the default) and 32.
+ Note that when this is set for the first time, the ``Colors`` property is automatically adjusted unless it is also specified. The table here shows the corresponding color models and the rendering method visible: "``GS``" for Ghostscript halftoning and "``F-S``" for Floyd-Steinberg dithering. When both are present it means that the dithering of halftones is visible. Default choices are indicated by asterisk "``*``".
+
+ **Valid colors values for allowed BitsPerPixel values**
+
+
+ .. list-table::
+ :header-rows: 1
+
+ * - bpp
+ - Colors
+ - Default
+ - Color model
+ - Dithering
+ * - 32
+ - 4
+ -
+ - CMYK
+ - F-S
+ * - 24
+ - 4
+ - ``*``
+ - CMYK
+ - F-S
+ * -
+ - 3
+ -
+ - RGB
+ - F-S
+ * - 16
+ - 4
+ -
+ - CMYK
+ - GS, F-S
+ * - 8
+ - 4
+ - ``*``
+ - CMYK
+ - GS
+ * -
+ - 3
+ -
+ - RGB
+ - GS
+ * -
+ - 1
+ -
+ - K (CMYK)
+ - F-S
+ * - 1
+ - 1
+ - ``*``
+ - K (CMYK)
+ - GS
+
+ Also note that automagical change of one parameter depending on the other one does not work in a ``setpagedevice`` call. This means that if you want to change ``BitsPerPixel`` to a value whose valid ``Colors`` values do not include the actual ``Colors`` value, you must change ``Colors`` too.
+
+
+``Colors (int)``
+ Choose the number of color components from among 1, 3 and 4 (the default). This setting cannot be used in a PostScript program, only on Ghostscript's command line. See ProcessColorModel below for what to use to change the number of colors with PostScript code.
+ Note that setting this property does limit the choices of BitsPerPixel. As for the previous property, its first setting may induce a setting of the "other value" (BitsPerPixel here). The table here indicates valid combinations with "V", default values with asterisk "*".
+
+ **Valid BitsPerPixel values for allowed Colors values**
+
+ *BitsPerPixel OK values*
+
+ .. list-table::
+ :header-rows: 1
+
+ * - Colors
+ - Type
+ - 32
+ - 24
+ - 16
+ - 8
+ - 1
+ * - 4
+ - CMYK
+ - V
+ -
+ - V
+ - V
+ -
+ * - 3
+ - RGB
+ -
+ - ``*``
+ -
+ - V
+ -
+ * - 1
+ - K
+ -
+ -
+ -
+ - V
+ - ``*``
+
+
+ Also note that automagical change of one parameter depending on the other one does not work in a ``setpagedevice`` call. This means that if you want to change ``Colors`` to a value whose valid ``BitsPerPixel`` values don't include the actual ``BitsPerPixel`` value, you must change ``BitsPerPixel`` too.
+
+
+
+``ProcessColorModel`` *(symbol)*
+ A symbol taken from ``/DeviceGray``, ``/DeviceRGB`` or ``/DeviceCMYK`` which can be used to select 1, 3 or 4 colors respectively. Note that this parameter takes precedence over ``Colors``, and that both affect the same variable of the driver. (See ``Colors`` above for values combined with ``BitsPerPixel``.)
+
+``HWResolution`` *(floats array)*
+ An array of two floats giving the horizontal and vertical resolution in dots per inch from among 90, 180 and 360 (the default). Both values must be the same. On the Ghostscript command line, the resolution may be changed with the ``-r`` switch.
+
+``ManualFeed`` *(bool)*
+ Indicate that the sheets won't be fed automatically by the printer, false by default. (Not meaningful on the BJC-600, I fear.)
+
+``MediaType`` *(string)*
+ The media to print on, chosen from among "PlainPaper", "CoatedPaper", "TransparencyFilm", "Envelope", "Card" and "Other". Default is "PlainPaper". For "Envelope", "Card" or "Other" the driver puts the printer into thick mode automatically regardless of the actual media weight.
+
+``MediaWeight`` *(int or null)*
+ The weight of the media in grams per square meter. Null (the default) indicates that the weight is of no importance. If the specified media weight is greater than 105 (that is, the value of the compilation default ``BJC???_MEDIAWEIGHT_THICKLIMIT``) then the printer will be set to use thick paper.
+
+``PrintQuality`` *(string)*
+ The quality of printing.
+
+ .. list-table::
+ :header-rows: 1
+
+ * - Value
+ - bjc600
+ - bjc800
+ - Comments
+ * - Low
+ -
+ - X
+ - Has the effect of making only two printing passes instead of four,
+
+ so should be twice the speed; known as "CN" (Color Normal) mode
+
+ * - Draft
+ - X
+ - X
+ - Unlights the "HQ" light on a BJC-600
+ * - Normal
+ - X
+ - X
+ - Default for both drivers; lights the "HQ" light on a BJC-600
+ * - High
+ - X
+ - X
+ - Means 200% black and 100% C
+
+
+``DitheringType`` *(string)*
+ Dithering algorithm from between "Floyd-Steinberg" and "None". "None" is the default for 1/1 print mode, "Floyd-Steinberg" for other modes. At the moment this parameter is read-only, though no error is generated if one tries to change it. This parameter is not of much value at the moment and is here mainly to reserve the name for future addition of dithering algorithms.
+
+``PrintColors`` *(int)*
+ Mask for printing color. If 0, use black for any color; otherwise the value must be the sum of any of 1 (cyan), 2 (magenta), 4 (yellow) and 8 (black), indicating which colors will be used for printing. When printing colour, only colours specified will be printed (this means that some planes will be missing if a color's value above is omitted). When printing grays, black is used if it is present in the PrintColors; otherwise, the image is printed by superimposing each requested color.
+
+``MonochromePrint`` *(bool)*
+ For :title:`bjc600` only, false by default. Substitute black for Cyan, Magenta and Yellow when printing -- useful, for example, to get some monochrome output of a dithered printing This is a hardware mechanism as opposed to the previous software one. I think that using this or setting ``PrintColors`` to 0 will give the same results.
+
+
+.. note::
+
+ The ``MediaType`` and ``ThickMedia`` options will be replaced by the use of the device ``InputAttributes`` and ``OutputAttributes`` as soon as possible. Please note too that the print mode may be reset at the start of printing, not at the end. This is the expected behaviour. If you need to reset the printer to its default state, simply print a file that does just a ``showpage``.
+
+
+Device information
+"""""""""""""""""""""""
+
+Here is other information published by the driver that you will find in the ``deviceinfo`` dictionary.
+
+``OutputFaceUp`` *(bool)*
+ This has the boolean value true, indicating that the sheets are stacked face up.
+
+``Version`` *(float)*
+ In the form ``M.mmpp``, where ``M`` is the major version, ``mm`` the bjc driver's minor version, and ``pp`` the specific driver minor version (that is, ``M.mm`` will always be the same for the :title:`bjc600` and :title:`bjc800` drivers).
+
+``VersionString`` *(string)*
+ A string showing the driver version and other indications. At the moment, things like "a" or "b" may follow the version to indicate alpha or beta versions. The date of the last change to this version is given in the form MM/DD/YY (no, it won't adapt to your locale).
+
+
+Hardware margins
+"""""""""""""""""""""""
+
+The BJC printers have top and bottom hardware margins of 3mm and 7.1mm respectively (Canon says 7mm, but this is unusable because of the rounding of paper sizes to PostScript points). The left margin is 3.4mm for A4 and smaller paper sizes, 6.4mm for U.S. paper sizes, envelopes and cards. It is 4.0mm for A3 paper on the BJC-800.
+
+The maximum printing width of a BJC-600 printer is 203mm. The maximum printing width of a BJC-800 printer is 289mm on A3 paper, 203mm on U.S. letter and ISO A4 paper.
+
+PostScript printer description (PPD) files
+""""""""""""""""""""""""""""""""""""""""""""""
+
+The files ``CBJC600.PPD`` and ``CBJC800.PPD`` (whose long names are, respectively, ``Canon_BubbleJetColor_600.ppd`` and ``Canon_BubbleJetColor_800.ppd``) are PPD files to drive the features of the :title:`bjc600` and :title:`bjc800` drivers. They can be used, for example, on NextStep systems (presumably on OpenStep systems too) and on Unix systems with Adobe's TranScript and ``pslpr`` (not tested). The files are not complete at the moment. Please note that NextStep's printing interface does not correctly enforce constraints specified in these files (in ``UIConstraints`` descriptions): you must force yourself to use valid combinations of options.
+
+Customizing the PPD files
+""""""""""""""""""""""""""""""""""""""""""""""
+
+By default the PPD files are set for U.S. letter size paper, and they use a normalized transfer function. If you choose to use A4 printing by default, you must replace "Letter" with "A4" in these (noncontiguous) lines:
+
+.. code-block::
+
+ [...]
+ *DefaultPageSize: Letter
+ [...]
+ *DefaultRegion: Letter
+ [...]
+ *DefaultImageableArea: Letter
+ [...]
+
+Some versions of Ghostscript have problems with normalized colors, which makes them add magenta in gray levels. If you experience this problem, in the PPD file replace the line:
+
+.. code-block::
+
+ *DefaultTransfer: Normalized
+
+with the alternate line:
+
+.. code-block::
+
+ *DefaultTransfer: Null
+
+The "thick media" option is implemented by choosing a value of 120 or 80 (for thick and thin media respectively) for the ``MediaWeight`` feature of the drivers. If you ever change the threshold for thick media in the driver code, you may need to change the values in the PPD files too.
+
+All customization should be done using the "``*Include:``" feature of PPD files so that your local changes will be retained if you update the PPD files.
+
+
+
+How to report problems
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Yves Arrouye no longer maintains this driver, and will not answer questions about it. If you are posting a question about it in a public form, please be as descriptive as possible, and please send information that can be used to reproduce the problem. Don't forget to say which driver you use, and in what version. Version information can be found in the source code of the driver or by issuing the following command in a shell:
+
+.. code-block:: bash
+
+ echo "currentpagedevice /VersionString get ==" | gs -q -sDEVICE=bjc600 -
+
+
+Acknowledgements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+I am particularly grateful to `Yoshio Kuniyoshi`_ without whom I'd never make these drivers, and also to L. Peter Deutsch, who answered all my (often silly) questions about Ghostscript's driver interface.
+
+Thanks also to the people who volunteered to beta-test the v2.x BJC drivers: `David Gaudine`_, `Robert M. Kenney`_, `James McPherson`_ and `Ian Thurlbeck`_ (listed alphabetically) were particularly helpful by discovering bugs and helping find out exact paper margins on printers I don't have access to.
+
+And many thanks to `Klaus-Gunther Hess`_ for looking at the dithering code and devising a good CMYK dithering algorithm for the Epson Stylus Color, which I then adapted to the code of these drivers.
+
+
+
+
+Epson Stylus color printer (see also :title:`uniprint`)
+----------------------------------------------------------
+
+This section was contributed by `Gunther Hess`_, who also wrote uniprint_, a later set of drivers. You should probably see the section on uniprint_ for whether it might be better for your uses than this driver.
+
+Usage
+~~~~~~~~~
+
+This driver is selected with ``-sDEVICE=stcolor``, producing output for an Epson Stylus Color at 360dpi resolution by default. But it can do much more with this printer, and with significantly better quality, than with the default mode; and it can also produce code for monochrome versions of the printer. This can be achieved via either command-line options or Ghostscript input. For convenience a PostScript file is supplied for use as an initial input file. Try the following command:
+
+.. code-block:: bash
+
+ gs -sDEVICE=stcolor -r{Xdpi}x{Ydpi} stcolor.ps {YourFile.ps}
+
+
+where {Xdpi} is one of 180, 360, or 720 and {Ydpi} is one of 90, 180, 360, or 720. The result should be significantly better. You may use stcolor.ps with other devices too, but I do not recommend this, since it does nothing then. stcolor.ps should be available with binary distributions and should reside in the same directory as other Ghostscript initialization files or in the same directory as the files to be printed. Thus if Ghostscript is part of your printer-spooler, you can insert:
+
+.. code-block:: postscript
+
+ (stcolor.ps) findlibfile { pop run } if pop
+
+in files you want to use the improved algorithms. You may want to adapt ``stcolor.ps`` file to your specific needs. The methods and options for this are described here, but this description is restricted to Ghostscript options, while their manipulation at the PostScript level is documented in the material on the relationship of Ghostscript and PostScript and in ``stcolor.ps``.
+
+
+Options
+~~~~~~~~~
+
+Now to explain the options (as written on my UNIX system). The order is somehow related to their use during the printing process:
+
+``-dUnidirectional``
+ Force unidirectional printing, recommended for transparencies
+
+``-dMicroweave``
+ Enable the printer's "microweave" feature; see "What is weaving?" below.
+
+``-dnoWeave``
+ Disable any Weaving (overrides ``-dMicroweave``)
+
+``-dSoftweave``
+ Enable the driver's internal weaving. Note that Softweave works only with the original Stylus Color and the PRO-Series.
+
+``-sDithering=`` *{name}*
+ Select another dithering algorithm (name) from among:
+
+ .. list-table::
+ :widths: 20 80
+ :header-rows: 1
+
+ * - Dithering name
+ - Comments
+ * - ``gscmyk``
+ - fast color output, CMYK process color model (default)
+ * - ``gsmono``
+ - fast monochrome output
+ * - ``gsrgb``
+ - fast color output, RGB process color model
+ * - ``fsmono``
+ - Floyd-Steinberg, monochrome
+ * - ``fsrgb``
+ - Floyd-Steinberg, RGB process color model (almost identical to
+
+ the ``cdj550/bjc`` algorithm)
+ * - ``fsx4``
+ - Floyd-Steinberg, CMYK process color model (shares code with ``fsmono`` and
+
+ ``fsrgb``, but is algorithmically really bad)
+ * - ``fscmyk``
+ - Floyd-Steinberg, CMYK process color model and proper modifications for CMYK
+ * - ``hscmyk``
+ - modified Floyd-Steinberg with CMYK model ("hs" stands for "hess" not
+
+ for "high speed", but the major difference from ``fscmyk`` is speed)
+ * - ``fs2``
+ - algorithm by Steven Singer (RGB) should be identical to ``escp2cfs2``.
+
+
+``-dBitsPerPixel={1...32}``
+ number of bits used for pixel storage; the larger the value, the better the quality -- at least in theory. In ``fsrgb`` one can gain some speed by restricting to 24 bits rather than the default 30.
+
+``-dFlag0``
+ causes some algorithms to select a uniform initialisation rather than a set of random values. May yield a sharper image impression at the cost of dithering artifacts. (Applies to ``hscmyk`` and all ``fs`` modes, except for ``fs2``, which always uses a constant initialization.)
+
+``-dFlag1 ... -dFlag4``
+ Available for future algorithms.
+
+``-dColorAdjustMatrix='{three, nine, or sixteen floating-point values}'``
+ This is a matrix to adjust the colors. Values should be between -1.0 and 1.0, and the number of values depends on the color model the selected algorithm uses. In RGB and CMYK modes a matrix with 1.0 on the diagonal produces no transformation. This feature is really required, but I could not identify a similar feature at the language level, so I implemented it, but I don't know reasonable values yet.
+
+``-dCtransfer='{float float ...}'`` or ``-dMtransfer=..., -dY..., -dK...`` or ``-dRtransfer='{float float ...}'`` or ``-dG..., -dB...`` or ``-dKtransfer='{float float ...}'``
+ Which you use depends on the algorithm, which may be either either CMYK, RGB or monochrome. The values are arrays of floats in the range from 0 to 1.0, representing the visible color intensity for the device. One may achieve similar effects with ``setcolortransfer`` at the language level, but this takes more time and the underlying code for the driver-specific parameters is still required. The size of the arrays is arbitrary and the defaults are "{0.0 1.0}", which is a linear characteristic. Most of the code in stcolor.ps are better transfer arrays.
+
+
+``-dKcoding='{float...}'`` , ``-dC..., -dM...`` etc.
+ Arrays between 0.0 and 1.0, controlling the internal coding of the color values. Clever use of these arrays may yield further enhancements, but I have no experience yet. (To be discontinued with version 2.x.)
+
+``-sModel=st800``
+ Causes output to be suitable for the monochrome Stylus 800 (no weaving, no color).
+
+``-sOutputCode=`` *{name}*
+ Can be either "``plain``", "``runlength``" or "``deltarow``" and changes the ESC/P2 coding technique used by the driver. The default is to use runlength encoding. "``plain``" selects uncompressed encoding and generates enormous amounts of data.
+
+``-descp_Band=`` *1/8/15/24*
+ Number of nozzles of scanlines used in printing, Useful only with -dnoWeave. Larger Values yield smaller code, but this doesn't increase the printing speed.
+
+``-descp_Width=`` *N*
+ Number of pixels Printed in each scan Line. (Useful only when tuning margins; see below)
+
+``-descp_Height=`` *pixels*
+ Length of the entire page in pixels. (Parameter of "``ESC(C``" in default initialization.)
+
+``-descp_Top=`` *scan lines*
+ Top margin in scan lines. (First parameter of "``ESC(c``" in default initialization.)
+
+``-descp_Bottom=`` *scan lines*
+ Bottom margin in scan lines. (Second parameter of "``ESC(c``" in default initialization.)
+
+``-sescp_Init=`` *"string"*
+ Override for the initialization sequence. (Must set graphics mode 1 and units.)
+
+``-sescp_Release=`` *"string"*
+ Overrides the release sequence, "``ESC @ FF``" by default.
+
+ESC/P2 allows any resolutions to be valid in theory, but only ``-r360x360`` (the default) and ``-r720x720`` (not on STC-IIs ? and :title:`st800`) are known to work with most printers.
+
+
+**Valid option combinations – Stylus I & Pro-Series only**
+
+.. list-table::
+ :widths: 25 25 25 25
+ :header-rows: 1
+
+ * - Resolution
+ - escp_Band
+ - Weave usable
+ - escp_Band & number of passes
+ * - 180x90
+ - 15
+ - noWeave
+ -
+ * - 180x180
+ - 1, 8, 24
+ - noWeave, Microweave
+ - 15/2 SoftWeave
+ * - 180x360
+ -
+ -
+ - 15/4 SoftWeave
+ * - 180x720
+ -
+ -
+ - 15/8 SoftWeave
+ * - 360x90
+ - 15
+ - noWeave
+ -
+ * - 360x180
+ - 1, 8, 24
+ - noWeave, Microweave
+ - 15/2 SoftWeave
+ * - 360x360
+ - 1, 8, 24
+ - noWeave, Microweave
+ - 15/4 SoftWeave
+ * - 360x720
+ -
+ -
+ - 15/8 SoftWeave
+ * - 720x90
+ - 15
+ - noWeave
+ -
+ * - 720x180
+ -
+ -
+ - 15/2 SoftWeave
+ * - 720x360
+ -
+ -
+ - 15/4 SoftWeave
+ * - 720x720 1 noWeave, Microweave
+ - 1
+ - noWeave, Microweave
+ - 15/8 SoftWeave
+
+
+.. warning ::
+
+ Beware: there are only few validity checks for parameters. A good example is ``escp_Band``: if you set this, the driver uses your value even if the value is not supported by the printer. You asked for it and you got it!
+
+
+
+Application note and FAQ
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Quite a bunch of parameters. Hopefully you never need any of them, besides feeding stcolor.ps to Ghostscript in front of your input.
+
+After answering some questions over fifty times I prepared a FAQ. Here is version 1.3 of the FAQ, as of stcolor version 1.20 (for Ghostscript 3.50).
+
+Support for A3 paper
+"""""""""""""""""""""""""""
+
+Yes, this driver supports the A3-size printer: merely set the required ``pagesize`` and margins. A simple way to do this is to specify the command-line switch ``-sPAPERSIZE=a3`` or include the procedure call ``a3`` in the PostScript prolog section. To optimize the printable area or set the proper margins, see the next paragraph.
+
+Margins, PageSize
+"""""""""""""""""""""
+
+I refuse to add code to :title:`stcolor` that tries to guess the proper margins or page size, because I found that such guessing is usually wrong and needs correction in either the source or the parameters. You can modify ``stcolor.ps`` to do that, however. After the line:
+
+.. code-block:: postscript
+
+ mark % prepare stack for "putdeviceprops"
+
+insert these lines, which define page size and margins in points:
+
+.. code-block:: postscript
+
+ /.HWMargins [9.0 39.96 12.6 9.0] % Left, bottom, right, top (1/72")
+ /PageSize [597.6 842.4] % Paper, including margins (1/72")
+ /Margins [ % neg. Offset to Left/Top in Pixels
+ 4 index 0 get STCold /HWResolution get 0 get mul 72 div neg
+ 5 index 3 get STCold /HWResolution get 1 get mul 72 div neg
+ ]
+
+
+Feel free to change the values of ``.HWMargins`` and ``PageSize`` to match your needs; the values given are the defaults when the driver is compiled with "``-DA4``". This option or its omission may cause trouble: the Stylus Color can print up to exactly 8 inches (2880 pixels) at 360dpi. The remaining paper is the margin, where the left margin varies only slightly with the paper size, while the right margin is significantly increased for wider paper, such as U.S. letter size.
+
+
+.. note ::
+
+ If you are using an ISO paper size with a version of stcolor after 1.20 and compiled without "``-DA4``", then the default margin is too large, and you need to add the proper "``.HWMargins``" to the command line or to ``stcolor.ps``.
+
+
+Stylus Color II / IIs and 1500
+""""""""""""""""""""""""""""""""""""""""""
+
+First the good news: the driver can print on the Stylus Color II. Now the bad news:
+
+- According to Epson support the driver "abuses" the color capabilities. (See "Future Plans" for details).
+- You need some parameters on the command line (or in ``stcolor.ps``).
+- I doubted that it would be usable with the Stylus Color IIs, but it is usable and suffers from mixing problems!
+
+To make things work, you MUST disable the driver's internal weaving (Softweave), in one of these two ways:
+
+
+.. code-block:: bash
+
+ gs -dMicroweave ...
+ gs -dnoWeave -descp_Band=1 ...
+
+
+Version 1.90, current as of Ghostscript 5.10, fixes this bug by new default behaviour. I experienced significantly increased printing speed with the second variant on the old Stylus Color, when printing mostly monochrome data.
+
+
+Recommendations
+~~~~~~~~~~~~~~~~~~~~~
+
+The next section is a contribution from `Jason Patterson`_ who evaluated a previous version (1.17). Ghostscript was invoked as follows:
+
+.. code-block:: bash
+
+ gs -sDEVICE=stcolor -r720x720 -sDithering=... -sOutputFile=escp.out stcolor.ps whatsoever.ps
+
+
+where "``...``" is the name of the desired algorithm. ``stcolor.ps`` was omitted for the gs-algorithms (``gsmono``, ``gsrgb`` and ``gscmyk``), for which it is useless and would not allow the selection of "``gscmyk``".
+
+Color dithering experiments with gdevstc 1.21
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Here are data about the EPSON Stylus Color driver's different dithering methods, based on a little experiment using four good quality scanned images of quite varied nature, to begin with, a summary of the results of the four experiments. Sanity note: the results here are from only four images and a total of 24 printouts (eight on 720dpi paper, sixteen on plain paper). Your results will almost certainly vary, and your standards might not be the same as mine, so use these results only as a guide, not as a formal evaluation.
+
+
+**Quality of output by method**
+
+
+.. list-table::
+ :widths: 15 85
+ :header-rows: 0
+
+ * - ``gsmono``
+ - Pretty much what you'd expect from a mono ordered pattern. Looks like what a lot of mono laser printers produce.
+ * - ``fsmono``
+ - Excellent for monochrome.
+ * - ``gscmyk``
+ - Not very good, but expected from an ordered pattern.
+ * - ``gsrgb``
+ - A little better than gscmyk. More consistent looking.
+ * - ``fs2``
+ - Good, but not quite as good as fsrgb. Gets the brightness wrong: too light at 720dpi, too dark at 360dpi.
+ * - ``fsrgb``
+ - Very good, but a little too dark and has a slight blue tint.
+ * - ``hscmyk``
+ - Excellent. Slightly better than fsrgb and fs2. Better than fscmyk on some images, almost the same on most.
+ * - ``fscmyk``
+ - Best. Very, very slightly better than hscmyk. On some images nearly as good as the EPSON demos done with the MS Windows driver.
+
+
+
+**Overall visual quality (1-10), best to worst**
+
+
+.. list-table::
+ :widths: 15 85
+ :header-rows: 1
+
+ * -
+ - 0 1 2 3 4 5 6 7 8 9 10
+ * - Monochrome
+ -
+ * - ``fsmono``
+ - ``******************``
+ * - ``gsmono``
+ - ``**********``
+ * - Colour
+ -
+ * - ``fscmyk``
+ - ``*******************``
+ * - ``hscmyk``
+ - ``*******************``
+ * - ``fsrgb``
+ - ``******************``
+ * - ``fs2``
+ - ``*****************``
+ * - ``gsrgb``
+ - ``**********``
+ * - ``gscmyk``
+ - ``*********``
+
+
+
+Color transformation
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In the initial version of the driver distributed with Ghostscript 3.33, the parameter ``SpotSize`` was the only way to manipulate the colors at the driver level. According to the parameters enumerated above, this has changed significantly with version 1.16 and above as a result an ongoing discussion about dithering algorithms and "false color" on the Epson Stylus Color. This initiated the transformation of the :title:`stcolor` driver into a framework for different dithering algorithms, providing a generalized interface to the internal Ghostscript color models and the other data structures related to Ghostscript drivers.
+
+The main thing such a framework should be able to do is to deliver the values the dithering algorithm needs; and since this directly influences the optical image impression, this transformation should be adjustable without the need for recompilation and relinking.
+
+
+Due to the limitations on raster storage, information is lost in the first transformation step, except for the 16-bit monochrome mode. So any color adjustment should take place before this step and this is where the optional ``ColorAdjustMatrix`` works.
+
+The first transformation step, called "coding", is controlled by the ``?coding`` arrays. The decoding process expands the range of values expontentially to a larger range than that provided by the initial Ghostscript color model, and is therefore a reasonable place to make device- or algorithm-specific adjustments. This is where the ``?transfer`` arrays are used. Array access might be not the fastest method, but its generality is superior, so this step is always based upon internally algorithm-specific array access. If 8 bits are stored per color component and if the algorithm uses bytes too, the second transformation is included within the first, which saves significant computation time when printing the data.
+
+
+ColorAdjustMatrix
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The driver supports different values for ``ProcessColorModel``, which raises the need for different color adjustments. Here "CAM" stands for "ColorAdjustMatrix".
+
+.. code-block::
+
+ DeviceGray (three floats)
+ if ((r == g) && (g == b))
+ K' = 1.0 - R;
+ else
+ K' = 1.0 - CAM[0] * R + CAM[1] * G + CAM[2] * B;
+
+
+According to the documentation on drivers, the latter (the "else" clause) should never happen.
+
+
+.. code-block::
+
+ DeviceRGB (nine floats)
+ if((r == g) && (g == b))
+ R' = B' = G' = R;
+ else
+ R' = CAM[0]*R + CAM[1]*G + CAM[2]*B;
+ G' = CAM[3]*R + CAM[4]*G + CAM[5]*B;
+ B' = CAM[6]*R + CAM[7]*G + CAM[8]*B;
+
+The printer always uses four inks, so a special treatment of black is provided. Algorithms may take special action if R, G, and B are all equal.
+
+
+.. code-block::
+
+ DeviceCMYK (sixteen floats)
+ if((c == m) && (m == y))
+ K' = max(C,K);
+ C' = M' = Y' = 0;
+ else
+ K = min(C,M,Y);
+ if((K > 0) && ColorAdjustMatrix_present) { => UCR
+ C -= K;
+ M -= K;
+ Y -= K;
+ }
+
+ C' = CAM[ 0]*C + CAM[ 1]*M + CAM[ 2]*Y + CAM[ 3]*K;
+ M' = CAM[ 4]*C + CAM[ 5]*M + CAM[ 6]*Y + CAM[ 7]*K;
+ Y' = CAM[ 8]*C + CAM[ 9]*M + CAM[10]*Y + CAM[11]*K;
+ K' = CAM[12]*C + CAM[13]*M + CAM[14]*Y + CAM[15]*K;
+
+
+Again we have a special black treatment. "``max(C,K)``" was introduced because of a slight misbehaviour of Ghostscript, which delivers black under certain circumstances as (1,1,1,0). Normally, when no special black separation and undercolor removal procedures are defined at the PostScript level, either (C,M,Y,0) or (0,0,0,K) values are mapped. This would make the extended ``ColorAdjustMatrix`` quite tedious, and so during mapping, black separation is done for (C,M,Y,0) requests; and if there is a ``ColorAdjustMatrix``, undercolor removal is used too. In other words the default matrix is:
+
+
+.. list-table::
+ :header-rows: 0
+
+ * - 1
+ - 0
+ - 0
+ - 1
+ * - 0
+ - 1
+ - 0
+ - 1
+ * - 0
+ - 0
+ - 1
+ - 1
+ * - 0
+ - 0
+ - 0
+ - 1
+
+and it is applied to CMYK values with separated and removed black. Raising the CMY coefficients while lowering the K coefficients reduces black and intensifies color. But be careful, because even small deviations from the default cause drastic changes.
+
+
+If no ``ColorAdjustMatrix`` is set, the matrix computations are skipped. Thus the transformation reduces to range inversion in monochrome mode and black separation in CMYK mode.
+
+
+
+RGB / CMYK coding and transfer, and ``BitsPerPixel``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+These two (groups of) parameters are arrays of floating-point numbers in the range 0.0 to 1.0. They control the truncation to the desired number of bits stored in raster memory (``BitsPerPixel``) and the ink density. The "truncation" may become a nonlinear function if any of the ``?coding`` arrays is set. Assume the following Ghostscript invocation:
+
+
+.. code-block:: bash
+
+ gs -sDEVICE=stcolor -sDithering=fscmyk -dBitsPerPixel=16 \
+ -dKcoding='{ 0.0 0.09 0.9 1.0 }' \
+ -dMcoding='{ 0.0 0.09 0.9 1.0 }' \
+ -dKtransfer='{ 0.0 0.09 0.9 1.0 }' \
+ -dYtransfer='{ 0.0 0.09 0.9 1.0 }'
+
+
+We may have either or both of ``?coding`` and ``?transfer``, giving four possible combinations. (These four combinations appear in the given example.) The resulting mapping appears in the following tables, where except for the internal Indices (4 components × 4 bits = 16 ``BitsPerPixel``), all values are normalized to the range 0 to 1. The actual range is 0 to 65535 for the Ghostscript color and 0 to 16777215 for the ink values delivered to the ``fscmyk`` algorithm. Sorry for the bunch of numbers following, but you may try this example in conjunction with ``stcinfo.ps``, which should give you a graphical printout of the following numbers when you issue a ``showpage`` command.
+
+
+
+.. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <th></th>
+ <th colspan="3">Cyan</th>
+ <th colspan="3">Magenta</th>
+ </tr>
+ <tr>
+ <th>CI/15</th>
+ <th>gs_color_values</th>
+ <th>CI</th>
+ <th>Ink</th>
+ <th>gs_color_values</th>
+ <th>CI</th>
+ <th>Ink</th>
+ </tr>
+ <tr>
+ <td align="center">0.000</td>
+ <td align="center">0.000 - 0.062</td>
+ <td align="center">0</td>
+ <td align="center">0.000</td>
+ <td align="center">-0.123 - 0.123</td>
+ <td align="center">0</td>
+ <td align="center">0.000</td>
+ </tr>
+ <tr>
+ <td align="center">0.067</td>
+ <td align="center">0.063 - 0.125</td>
+ <td align="center">1</td>
+ <td align="center">0.067</td>
+ <td align="center">0.123 - 0.299</td>
+ <td align="center">1</td>
+ <td align="center">0.247</td>
+ </tr>
+ <tr>
+ <td align="center">0.133</td>
+ <td align="center">0.125 - 0.187</td>
+ <td align="center">2</td>
+ <td align="center">0.133</td>
+ <td align="center">0.299 - 0.365</td>
+ <td align="center">2</td>
+ <td align="center">0.351</td>
+ </tr>
+ <tr>
+ <td align="center">0.200</td>
+ <td align="center">0.188 - 0.250</td>
+ <td align="center">3</td>
+ <td align="center">0.200</td>
+ <td align="center">0.365 - 0.392</td>
+ <td align="center">3</td>
+ <td align="center">0.379</td>
+ </tr>
+ <tr>
+ <td align="center">0.267</td>
+ <td align="center">0.250 - 0.312</td>
+ <td align="center">4</td>
+ <td align="center">0.267</td>
+ <td align="center">0.392 - 0.420</td>
+ <td align="center">4</td>
+ <td align="center">0.406</td>
+ </tr>
+ <tr>
+ <td align="center">0.333</td>
+ <td align="center">0.313 - 0.375</td>
+ <td align="center">5</td>
+ <td align="center">0.333</td>
+ <td align="center">0.420 - 0.447</td>
+ <td align="center">5</td>
+ <td align="center">0.433</td>
+ </tr>
+ <tr>
+ <td align="center">0.400</td>
+ <td align="center">0.375 - 0.437</td>
+ <td align="center">6</td>
+ <td align="center">0.400</td>
+ <td align="center">0.447 - 0.475</td>
+ <td align="center">6</td>
+ <td align="center">0.461</td>
+ </tr>
+ <tr>
+ <td align="center">0.467</td>
+ <td align="center">0.438 - 0.500</td>
+ <td align="center">7</td>
+ <td align="center">0.467</td>
+ <td align="center">0.475 - 0.502</td>
+ <td align="center">7</td>
+ <td align="center">0.488</td>
+ </tr>
+ <tr>
+ <td align="center">0.533</td>
+ <td align="center">0.500 - 0.562</td>
+ <td align="center">8</td>
+ <td align="center">0.533</td>
+ <td align="center">0.502 - 0.529</td>
+ <td align="center">8</td>
+ <td align="center">0.516</td>
+ </tr>
+ <tr>
+ <td align="center">0.600</td>
+ <td align="center">0.563 - 0.625</td>
+ <td align="center">9</td>
+ <td align="center">0.600</td>
+ <td align="center">0.529 - 0.557</td>
+ <td align="center">9</td>
+ <td align="center">0.543</td>
+ </tr>
+ <tr>
+ <td align="center">0.667</td>
+ <td align="center">0.625 - 0.687</td>
+ <td align="center">10</td>
+ <td align="center">0.667</td>
+ <td align="center">0.557 - 0.584</td>
+ <td align="center">10</td>
+ <td align="center">0.571</td>
+ </tr>
+ <tr>
+ <td align="center">0.733</td>
+ <td align="center">0.688 - 0.750</td>
+ <td align="center">11</td>
+ <td align="center">0.733</td>
+ <td align="center">0.584 - 0.612</td>
+ <td align="center">11</td>
+ <td align="center">0.598</td>
+ </tr>
+ <tr>
+ <td align="center">0.800</td>
+ <td align="center">0.750 - 0.812</td>
+ <td align="center">12</td>
+ <td align="center">0.800</td>
+ <td align="center">0.612 - 0.639</td>
+ <td align="center">12</td>
+ <td align="center">0.626</td>
+ </tr>
+ <tr>
+ <td align="center">0.867</td>
+ <td align="center">0.813 - 0.875</td>
+ <td align="center">13</td>
+ <td align="center">0.867</td>
+ <td align="center">0.639 - 0.715</td>
+ <td align="center">13</td>
+ <td align="center">0.653</td>
+ </tr>
+ <tr>
+ <td align="center">0.933</td>
+ <td align="center">0.875 - 0.937</td>
+ <td align="center">14</td>
+ <td align="center">0.933</td>
+ <td align="center">0.715 - 0.889</td>
+ <td align="center">14</td>
+ <td align="center">0.778</td>
+ </tr>
+ <tr>
+ <td align="center">1.000</td>
+ <td align="center">0.938 - 1.000</td>
+ <td align="center">15</td>
+ <td align="center">1.000</td>
+ <td align="center">0.889 - 1.111</td>
+ <td align="center">15</td>
+ <td align="center">1.000</td>
+ </tr>
+ </table>
+
+|
+
+The difference between cyan and magenta is the presence of a coding array. The coding process must map a range of color values to each of the sixteen component indices. If no coding array is given, this is accomplished by dividing by 4096, equivalent to a right shift by 12 bits. The final ink density resides in the given interval and moves from the left to the right side from 0 to 15. For magenta there is a coding array and the ink value matches the center of the intervals. But the distribution of the mapped intervals follows the given coding array and is nonlinear in the linear color space of Ghostscript.
+
+Now let us take a look at the case with transfer arrays:
+
+
+.. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <th></th>
+ <th colspan="3">Yellow</th>
+ <th colspan="3">Black</th>
+ </tr>
+ <tr>
+ <th>CI/15</th>
+ <th>gs_color_values</th>
+ <th>CI</th>
+ <th>Ink</th>
+ <th>gs_color_values</th>
+ <th>CI</th>
+ <th>Ink</th>
+ </tr>
+ <tr>
+ <td align="center">0.000</td>
+ <td align="center">0.000 - 0.062</td>
+ <td align="center">0</td>
+ <td align="center">0.000</td>
+ <td align="center">-0.123 - 0.123</td>
+ <td align="center">0</td>
+ <td align="center">0.000</td>
+ </tr>
+ <tr>
+ <td align="center">0.067</td>
+ <td align="center">0.063 - 0.125</td>
+ <td align="center">1</td>
+ <td align="center">0.018</td>
+ <td align="center">0.123 - 0.299</td>
+ <td align="center">1</td>
+ <td align="center">0.067</td>
+ </tr>
+ <tr>
+ <td align="center">0.13</td>
+ <td align="center">0.125 - 0.187</td>
+ <td align="center">2</td>
+ <td align="center">0.036</td>
+ <td align="center">0.299 - 0.365</td>
+ <td align="center">2</td>
+ <td align="center">0.133</td>
+ </tr>
+ <tr>
+ <td align="center">0.200</td>
+ <td align="center">0.188 - 0.250</td>
+ <td align="center">3</td>
+ <td align="center">0.054</td>
+ <td align="center">0.365 - 0.392</td>
+ <td align="center">3</td>
+ <td align="center">0.200</td>
+ </tr>
+ <tr>
+ <td align="center">0.267</td>
+ <td align="center">0.250 - 0.312</td>
+ <td align="center">4</td>
+ <td align="center">0.072</td>
+ <td align="center">0.392 - 0.420</td>
+ <td align="center">4</td>
+ <td align="center">0.267</td>
+ </tr>
+ <tr>
+ <td align="center">0.333</td>
+ <td align="center">0.313 - 0.375</td>
+ <td align="center">5</td>
+ <td align="center">0.090</td>
+ <td align="center">0.420 - 0.447</td>
+ <td align="center">5</td>
+ <td align="center">0.333</td>
+ </tr>
+ <tr>
+ <td align="center">0.400</td>
+ <td align="center">0.375 - 0.437</td>
+ <td align="center">6</td>
+ <td align="center">0.252</td>
+ <td align="center">0.447 - 0.475</td>
+ <td align="center">6</td>
+ <td align="center">0.400</td>
+ </tr>
+ <tr>
+ <td align="center">0.467</td>
+ <td align="center">0.438 - 0.500</td>
+ <td align="center">7</td>
+ <td align="center">0.414</td>
+ <td align="center">0.475 - 0.502</td>
+ <td align="center">7</td>
+ <td align="center">0.467</td>
+ </tr>
+ <tr>
+ <td align="center">0.533</td>
+ <td align="center">0.500 - 0.562</td>
+ <td align="center">8</td>
+ <td align="center">0.576</td>
+ <td align="center">0.502 - 0.529</td>
+ <td align="center">8</td>
+ <td align="center">0.533</td>
+ </tr>
+ <tr>
+ <td align="center">0.600</td>
+ <td align="center">0.563 - 0.625</td>
+ <td align="center">9</td>
+ <td align="center">0.738</td>
+ <td align="center">0.529 - 0.557</td>
+ <td align="center">9</td>
+ <td align="center">0.600</td>
+ </tr>
+ <tr>
+ <td align="center">0.667</td>
+ <td align="center">0.625 - 0.687</td>
+ <td align="center">10</td>
+ <td align="center">0.900</td>
+ <td align="center">0.557 - 0.584</td>
+ <td align="center">10</td>
+ <td align="center">0.667</td>
+ </tr>
+ <tr>
+ <td align="center">0.733</td>
+ <td align="center">0.688 - 0.750</td>
+ <td align="center">11</td>
+ <td align="center">0.920</td>
+ <td align="center">0.584 - 0.612</td>
+ <td align="center">11</td>
+ <td align="center">0.733</td>
+ </tr>
+ <tr>
+ <td align="center">0.800</td>
+ <td align="center">0.750 - 0.812</td>
+ <td align="center">12</td>
+ <td align="center">0.940</td>
+ <td align="center">0.612 - 0.639</td>
+ <td align="center">12</td>
+ <td align="center">0.800</td>
+ </tr>
+ <tr>
+ <td align="center">0.867</td>
+ <td align="center">0.813 - 0.875</td>
+ <td align="center">13</td>
+ <td align="center">0.960</td>
+ <td align="center">0.639 - 0.715</td>
+ <td align="center">13</td>
+ <td align="center">0.867</td>
+ </tr>
+ <tr>
+ <td align="center">0.933</td>
+ <td align="center">0.875 - 0.937</td>
+ <td align="center">14</td>
+ <td align="center">0.980</td>
+ <td align="center">0.715 - 0.889</td>
+ <td align="center">14</td>
+ <td align="center">0.933</td>
+ </tr>
+ <tr>
+ <td align="center">1.000</td>
+ <td align="center">0.938 - 1.000</td>
+ <td align="center">15</td>
+ <td align="center">1.000</td>
+ <td align="center">0.889 - 1.111</td>
+ <td align="center">15</td>
+ <td align="center">1.000</td>
+ </tr>
+ </table>
+
+|
+
+Yellow uses a transfer array. There is no linear correspondence between the color and the ink values: this correspondence is defined through the given array. In other words, the transfer arrays define a nonlinear ink characteristic, which is exactly the same functionality that PostScript's "(color)transfer" function provides.
+
+While for yellow the intervals match the intervals used with cyan, for black the intervals match the magenta intervals. But watch the correspondence between the CI/15 values and the ink density for black: this is a linear distribution in the ink domain.
+
+Not a bad idea, I think. Consider the ``fs2`` algorithm: it uses values in the range 0 to 255. If any transfer array were alone, some of the 256 possible values would never be used and others would be used for adjacent intervals several times. Establishing an identical coding array solves this problem, so the full potential of the algorithm is used.
+
+Another useful feature of the coding arrays is that they are internally normalized to the range 0-1. In 720x720dpi mode the transfer arrays in ``stcolor.ps`` limit the dot density to about 50%, so these arrays end at 0.5 (and begin at 0.5 for RGB). Because of automatic normalization, these arrays can also be used as coding arrays. But of course in the ``fs2`` case mentioned above, values from 0 to 127 will never be delivered to the algorithm, while values 128-255 are delivered for adjacent intervals.
+
+To clarify the intended use of the three parameters (parameter groups), keep this in mind:
+
+
+- ``ColorAdjustMatrix`` is never used when transferring gray values. This restricts it to what the name says: adjustment of colors, that is, correction for miscolored ink. Do not use it for saturation or brightness control.
+
+- ``?transfer`` arrays control the values delivered to the driver, which in turn controls the ink quantity. Use these arrays to control saturation and brightness. In general these arrays are identical for all inks. If they differ they provide a simpler scheme for color correction, which is not necessarily faster than the ``ColorAdjustMatrix``.
+
+- ``?coding`` arrays control the color value intervals mapped to the internal color indices.
+
+
+What is weaving?
+~~~~~~~~~~~~~~~~~~~~~
+
+The Epson Stylus Color has a head assembly that contains two physically identifiable heads, one for black and one for cyan, magenta, and yellow (CMY). This makes four "logical" heads, one for each color component. Each of these four heads has several jets at some vertical (Y) distance from one another, so several horizontal lines can be printed of a given color during one pass of the heads. From experience I think there are fifteen jets per color, spaced at 1/90in.
+
+So the question arises of how to print at a Y resolution of 360dpi with 90dpi jets. Simply by division one gets 360dpi/90dpi = 4, which tells us that 4 passes of the head assembly are needed to achieve a Y resolution of 360dpi.
+
+Weaving is the method of how the fifteen jets are used to print adjacent horizontal rows separated here by 1/360 inch:
+
+
+.. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <th colspan="10">Print-head jets used with and without weaving</th>
+ </tr>
+ <tr>
+ <th></th>
+ <th></th>
+ <th colspan="4">Weaving</th>
+ <th colspan="4">noWeave</th>
+ </tr>
+ <tr>
+ <td></td>
+ <td>Pass</td>
+ <td>1</td>
+ <td>2</td>
+ <td>3</td>
+ <td>4</td>
+ <td>1</td>
+ <td>2</td>
+ <td>3</td>
+ <td>4</td>
+ </tr>
+ <tr>
+ <td colspan="10">Row</td>
+ </tr>
+ <tr>
+ <td align="center">0</td>
+ <td></td>
+ <td align="center">jet 0</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 0</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ </tr>
+ <tr>
+ <td align="center">1</td>
+ <td></td>
+ <td align="center">--</td>
+ <td align="center">jet 1</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 0</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ </tr>
+ <tr>
+ <td align="center">2</td>
+ <td></td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 2</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 0</td>
+ <td align="center">--</td>
+ </tr>
+ <tr>
+ <td align="center">3</td>
+ <td></td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 3</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 0</td>
+ </tr>
+ <tr>
+ <td align="center">4</td>
+ <td></td>
+ <td align="center">jet 1</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 1</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ </tr>
+ <tr>
+ <td align="center">5</td>
+ <td></td>
+ <td align="center">--</td>
+ <td align="center">jet 2</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 1</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ </tr>
+ <tr>
+ <td align="center">6</td>
+ <td></td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 3</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">--</td>
+ <td align="center">jet 1</td>
+ <td align="center">--</td>
+ </tr>
+ <tr>
+ <td colspan="10">...</td>
+ </tr>
+ </table>
+
+
+Now let's assume that the dot diameter is different for each individual jet, but the average among the jets matches the desired resolution. With weaving, adjacent rows are printed by different jets, thus some averaging takes place. Without weaving, adjacent rows are printed by the same jet and this makes the dot diameter deviations visible as 1/90in stripes on the paper.
+
+
+Print mode parameters
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The parameters "``Unidirectional``", "``Microweave``", "``noWeave``", "``OutputCode``", "``Model``" and the given resolution control the data generated for the printer.
+
+Unidirectional
+"""""""""""""""""""
+
+Simply toggles the unidirectional mode of the printer. Setting "``Unidirectional``" definitely slows printing speed, but may improve the quality. I use this for printing transparencies, where fast head movement could smear the ink.
+
+Microweave, noWeave and OutputCode=deltarow
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+The first are two booleans, which implies that four combinations are possible. Actually only three exist (if you don't count for ``deltarow``): ``Softweave``, ``Microweave``, and ``noWeave``. The first and second are functionally identical, the difference being whether the driver or the printer does the job.
+
+In the default ``Softweave`` mode the driver sends the data properly arranged to the printer, while in ``Microweave`` mode, it is the printer that arranges the data. But in general the host processor is much faster than the printer's processor, and thus it is faster for the host do the job. In addition to that, for 720dpi eight passes are required, and the amount of buffer space needed to buffer the data for the passes is far beyond the printer's memory. ``Softweave`` requires an odd value of "``escp_Band``"; the Stylus Color provides fifteen for that.
+
+"OutputCode" controls the encoding used. In the basic modes, the choice consists of "plain" and "runlength". The computation of runlength-encoded data does not take much time, less than the data tranfer to the printer; thus this is the recommended mode, and of course the default. With the Stylus Color, Epson introduced some new encoding principles, namely "tiff" and "deltarow". While the first was omitted from this driver for lack of apparent advantages, ``deltarow`` is available as an option. ``Softweave`` cannot be used with this encoding, so if ``OutputCode=deltarow`` is set, ``Microweave`` becomes the default. Maybe that the size of the ESC/P2 code becomes smaller, but I have never observed faster printing speed. Things tend to become slower with ``deltarow`` compared to ``Softweave``.
+
+
+Model
+"""""""""""""""""""
+
+Some ESC/P2 printers such as the Stylus 800 do not offer ``Microweave`` or the commands required to do ``Softweave``. Setting ``Model`` just changes the defaults and omits some parts of the initialization sequence which are not compatible with the given printer model. Currently only ":title:`st800`" is supported besides the default :title:`stcolor`.
+
+
+Bugs and pitfalls
+~~~~~~~~~~~~~~~~~~~~~
+
+
+- The given ``?coding`` and ``?transfer`` arrays should be strictly monotonic.
+
+- It is impossible to change ``WHITE``: that's your paper. Thus RGB transfer should end at 1.0 and CMYK transfer should start at 0.0.
+
+- Usually 8 bits per component yields fastest operation.
+
+- The ``ColorAdjustMatrix`` is not used in the reverse transformation used when Ghostscript does the dithering (``gs*`` modes). Expect funny results.
+
+- If ``BitsPerPixel`` is less than 6, the entire coding and transfer process does not work. This is always true for the ``gs*`` modes and becomes true for the other modes if ``BitsPerPixel`` is forced to low values.
+
+- 720×720dpi printing should never select the ``gs*`` modes and should always use ``stcolor.ps``. (I prefer 360×720.)
+
+
+Tests
+~~~~~~~~~~~~~~~~~~~~~
+
+This section gives an overview of performance in terms of processing and printing times, from tests run after version 1.13. Printing was done offline (simply copying a processed file to the printer) to measure real printing speed without regard to speed of processing on the host, since at high resolutions, processing time is the same order of magnitude and thus may become the limiting factor.
+
+**The various OutputCodes**
+
+I ran several files though Ghostscript and recorded the size of the resulting print code, the processing time, and the printing time, at least for some of the files, always using these options:
+
+
+.. code-block:: bash
+
+ gs -sDEVICE=stcolor -sPAPERSIZE=a4 stcolor.ps - < file.ps
+
+(Actually "``-sPAPERSIZE=a4``" is in my ``gs_init.ps`` since I'm a germ.)
+
+
+"``deltarow``" is the new encoding principle ("``ESC . 3 10 10 1``") with ``Microweave`` on. It is activated with "``-sOutputCode=deltarow``".
+
+"``Softweave``" actually means that nothing else was used: it is the default, and implies that odd v=40/h=10/m=15 mode ("``ESC . 1 40 10 15``").
+
+"``Microweave``" means "``-dMicroweave``", equivalent to "``ESC . 1 10 10 1``", with full skip optimization and microweave activated.
+
+
+Finally I wanted to see the plain `Kathy Ireland`_, and used "``-sOutputCode=plain``", which just replaces runlength encoding (RLE) by no encoding, thus using "``ESC . 0 40 10 15``". [So sorry ;-) Kathy was still dressed in blue in front of the blue sea on a blue air cushion – nice to see but hard to dither.]
+
+
+So here are the results.
+
+
+.. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <th colspan="5">File sizes and printing speeds with various weaving methods</th>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td><code>golfer.ps</code></td>
+ <td><code>colorcir.ps</code></td>
+ <td><code>drawing.ps</code></td>
+ <td><code>brief.ps</code></td>
+ </tr>
+ <tr>
+ <td><code>deltarow</code></td>
+ <td>572751/48.180u</td>
+ <td>643374/41.690u</td>
+ <td>90142/46.180u/1:50</td>
+ <td>178563/49.350u/2:22</td>
+ </tr>
+ <tr>
+ <td><code>Softweave</code></td>
+ <td>559593/46.810u</td>
+ <td>669966/44.960u</td>
+ <td>296168/48.160u/1:30</td>
+ <td>269808/43.320u/1:55</td>
+ </tr>
+ <tr>
+ <td><code>Microweave</code></td>
+ <td>590999/56.060u</td>
+ <td>754276/42.890u</td>
+ <td>338885/47.060u/1:50</td>
+ <td>282314/44.690u/2:22</td>
+ </tr>
+ </table>
+
+
+|
+
+.. _Kathy Ireland:
+
+.. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <th colspan="2">Kathy Ireland</th>
+ </tr>
+ <tr>
+ <td></td>
+ <td><code>kathy.ps</code></td>
+ </tr>
+ <tr>
+ <td><code>deltarow</code></td>
+ <td>3975334/111.940u/5:35</td>
+ </tr>
+ <tr>
+ <td><code>Softweave</code></td>
+ <td>3897112/101.940u/3:10</td>
+ </tr>
+ <tr>
+ <td><code>Microweave</code></td>
+ <td>4062829/100.990u/3:15</td>
+ </tr>
+ <tr>
+ <td><code>plain/soft</code></td>
+ <td>5072255/104.390u/3:05</td>
+ </tr>
+ </table>
+
+
+|
+
+
+It may be that I've not chosen the optimal ``deltarow`` code, but even if it saves at lot of bytes, printing-speed is not increased.
+
+At least the printer prefers plain Kathy. In other words, sending 1 Megabyte or 20% more data has no impact on printing speed. ``drawing.ps`` is an exception to this rule: plain prints slower than RLE.
+
+"Unclever" coding -- especially with ``deltarow`` -- can significantly slow down printing. But even if very significant advantages in the size of the code are achieved, ``deltarow`` is not competitive. ``colorcir.ps`` shows savings with ``deltarow``, but printing is a mess.
+
+
+.. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <th colspan="6">Printing time related to other options <small>(*Full page halftone images printed, unless otherwise noted.)</small></th>
+ </tr>
+ <tr>
+ <th align="right">dpi</th>
+ <th align="right">Print mode</th>
+ <th align="right">Size KB</th>
+ <th align="right">Time</th>
+ <th colspan="2" align="left">Comments</th>
+ </tr>
+ <tr>
+ <td align="right">180x180 mono</td>
+ <td align="right">-/uni</td>
+ <td align="right">358</td>
+ <td align="right">1:15</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">-/bi</td>
+ <td align="right">358</td>
+ <td align="right">0:45</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">micro/bi</td>
+ <td align="right">205</td>
+ <td align="right">0:45</td>
+ <td colspan="2">Not Weaving</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">soft/bi</td>
+ <td align="right">179</td>
+ <td align="right">1:25</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td align="right">color</td>
+ <td align="right">-/bi</td>
+ <td align="right">641</td>
+ <td align="right">2:45</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">soft/bi</td>
+ <td align="right">556</td>
+ <td align="right">1:32</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td align="right">360x360 mono</td>
+ <td align="right">-/uni</td>
+ <td align="right">269</td>
+ <td align="right">0:50</td>
+ <td colspan="2">Monochrome text</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">-/bi</td>
+ <td align="right">269</td>
+ <td align="right">0:35</td>
+ <td colspan="2">Monochrome text</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">micro/bi</td>
+ <td align="right">269</td>
+ <td align="right">2:25</td>
+ <td colspan="2">Monochrome text</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">soft/uni</td>
+ <td align="right">250</td>
+ <td align="right">3:15</td>
+ <td colspan="2">Monochrome text</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">soft/bi</td>
+ <td align="right">250</td>
+ <td align="right">1:55</td>
+ <td colspan="2">Monochrome text</td>
+ </tr>
+ <tr>
+ <td align="right">color</td>
+ <td align="right">-/bi</td>
+ <td align="right">346</td>
+ <td align="right">1:00</td>
+ <td colspan="2">Sparse-color page, visible displacements</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">micro/bi</td>
+ <td align="right">346</td>
+ <td align="right">1:50</td>
+ <td colspan="2">Sparse-color page, looks buggy – printer?</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">soft/bi</td>
+ <td align="right">294</td>
+ <td align="right">1:30</td>
+ <td colspan="2">Sparse-color page, O.K.</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">-/bi</td>
+ <td align="right">2218</td>
+ <td align="right">2:45</td>
+ <td colspan="2">Visible stripes</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">micro/bi</td>
+ <td align="right">5171</td>
+ <td align="right">3:17</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">soft/bi</td>
+ <td align="right">3675</td>
+ <td align="right">3:05</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td align="right">360x720 mono</td>
+ <td align="right">soft/bi</td>
+ <td align="right">2761</td>
+ <td align="right">5:40</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td align="right">color</td>
+ <td align="right">soft/bi</td>
+ <td align="right">7789</td>
+ <td align="right">6:15</td>
+ <td colspan="2">Just a small difference!</td>
+ </tr>
+ <tr>
+ <td align="right">720x360 color</td>
+ <td align="right">soft/bi</td>
+ <td align="right">7182</td>
+ <td align="right">5:40</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td align="right">720x720 color</td>
+ <td align="right">micro/bi</td>
+ <td align="right">14748</td>
+ <td align="right">30:26</td>
+ <td colspan="2">Actually beyond printer's capabilities</td>
+ </tr>
+ <tr>
+ <td>&nbsp;</td>
+ <td align="right">soft/bi</td>
+ <td align="right">14407</td>
+ <td align="right">11:08</td>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ </table>
+
+
+
+Acknowledgments
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+This driver was copied from ``gdevcdj.c`` (Ghostscript 3.12), which was contributed by George Cameron, Koert Zeilstra, and Eckhard Rueggeberg. Some of the ESC/P2 code was drawn from Richard Brown's ``gdevescp.c``. The POSIX interrupt code (compilation option -DSTC_SIGNAL) is from Frederic Loyer. Several improvements are based on discussions with Brian Converse, Bill Davidson, Gero Guenther, Jason Patterson, ? Rueschstroer, and Steven Singer.
+
+While I wish to thank everyone mentioned above, they are by no means responsible for bugs in the :title:`stcolor` driver -- just for the features.
+
+
+.. _uniprint:
+
+
+uniprint, a flexible unified printer driver
+----------------------------------------------------
+
+:title:`uniprint` is a unified parametric driver by `Gunther Hess`_ for several kinds of printers and devices, including:
+
+- Any Epson Stylus Color, Stylus, or Stylus Pro.
+- HP PCL/RTL.
+- Canon BubbleJet Color 610.
+- NEC P2X.
+- Sun raster file format.
+
+This driver is intended to become a unified printer driver. If you consider it ugly, please send me your suggestions for improvements. The driver will be updated with them. Thus the full explanation of the driver's name is: Ugly- -> Updated- -> Unified Printer Driver
+
+
+But you probably want to know something about the functionality. At the time of this writing :title:`uniprint` drives:
+
+- NEC Pinwriter P2X (24-pin monochrome impact printer, ESC/P style).
+- Several Epson Stylus Color models (ESC/P2 style).
+- HP-DeskJet 550c (basic HP-RTL).
+- Canon BJC 610.
+
+It can be configured for various other printers without recompilation and offers uncompressed (ugly) Sun rasterfiles as another format, but this format is intended for testing purposes rather than real use. The usage of this driver is quite simple. The typical command line looks like this:
+
+
+.. code-block:: bash
+
+ gs @{MODEL}.upp -sOutputFile={printable file} MyFile.ps -c quit
+
+
+For example, from my Linux box:
+
+.. code-block:: bash
+
+ gs @stc.upp -sOutputFile=/dev/lp1 tiger.eps -c quit
+
+
+
+.. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <th colspan="3">Unified Printer Parameter files distributed with Ghostscript</th>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Canon BJC 610 (color, rendered)</th>
+ </tr>
+ <tr>
+
+ <td><code>bjc610a0.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>plain paper, high speed</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610a1.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610a2.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>coated paper</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610a3.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>transparency film</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610a4.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>back print film</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610a5.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>fabric sheet</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610a6.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>glossy paper</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610a7.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>high gloss film</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610a8.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>high resolution paper</td>
+ </tr>
+ <tr>
+ <th colspan="3"></th>
+ </tr>
+ <tr>
+
+ <td><code>bjc610b1.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610b2.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>coated paper</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610b3.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>transparency film</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610b4.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>back print film</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610b6.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>glossy paper</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610b7.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>high-gloss paper</td>
+ </tr>
+ <tr>
+
+ <td><code>bjc610b8.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>high resolution paper</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">HP Ink-Printers</th>
+ </tr>
+ <tr>
+
+ <td><code>cdj550.upp</code></td>
+
+ <td>300&times;300dpi</td>
+
+ <td>32-bit CMYK</td>
+ </tr>
+ <tr>
+
+ <td><code>cdj690.upp</code></td>
+
+ <td>300&times;300dpi</td>
+
+ <td>Normal mode</td>
+ </tr>
+ <tr>
+
+ <td><code>cdj690ec.upp</code></td>
+
+ <td>300&times;300dpi</td>
+
+ <td>Economy mode</td>
+ </tr>
+ <tr>
+
+ <td><code>dnj750c.upp</code></td>
+
+ <td>300&times;300dpi</td>
+
+ <td>Color – also good for 450C</td>
+ </tr>
+ <tr>
+
+ <td><code>dnj750m.upp</code></td>
+
+ <td>600&times;600dpi</td>
+
+ <td>Monochrome</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">NEC P2X</th>
+ </tr>
+ <tr>
+
+ <td><code>necp2x.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>8-bit (Floyd-Steinberg)</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Any Epson Stylus Color</th>
+ </tr>
+ <tr>
+
+ <td><code>stcany.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>4-bit, PostScript halftoning</td>
+ </tr>
+ <tr>
+
+ <td><code>stcany_h.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>4-bit, PostScript halftoning</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Original Epson Stylus and Stylus Pro Color</th>
+ </tr>
+ <tr>
+
+ <td><code>stc.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>32-bit CMYK, 15-pin</td>
+ </tr>
+ <tr>
+
+ <td><code>stc_l.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>4-bit, PostScript halftoning, weaved noWeave</td>
+ </tr>
+ <tr>
+
+ <td><code>stc_h.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>32-bit CMYK, 15-pin Weave</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Epson Stylus Color II</th>
+ </tr>
+ <tr>
+
+ <td><code>stc2.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>32-bit CMYK, 20-pin, Epson Stylus Color II(s)</td>
+ </tr>
+ <tr>
+
+ <td><code>stc2_h.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>32-bit CMYK, 20-pin, Epson Stylus Color II</td>
+ </tr>
+ <tr>
+
+ <td><code>stc2s_h.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>32-bit CMYK, 20-pin, Epson Stylus Color IIs</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Epson Stylus Color 200</th>
+ </tr>
+ <tr>
+
+ <td><code>stc200.upp</code></td>
+
+ <td>360&times;720dpi</td>
+
+ <td>Plain Paper</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Epson Stylus Color 300</th>
+ </tr>
+ <tr>
+
+ <td><code>stc300.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>32-bit CMYK, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>stc300bl.upp</code></td>
+
+ <td>180&times;180dpi</td>
+
+ <td>black only, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>stc300bm.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>black only, plain paper</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Epson Stylus Color 500 (good transfer curves for plain paper)</th>
+ </tr>
+ <tr>
+
+ <td><code>stc500p.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>32-bit CMYK, noWeave, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>stc500ph.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>32-bit CMYK, noWeave, plain paper</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Epson Stylus Color 600, 32/90-inch weaving</th>
+ </tr>
+ <tr>
+
+ <td><code>stc600pl.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>32-bit CMYK, 32-pin, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>stc600p.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>32-bit CMYK, 32-pin, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>stc600ih.upp</code></td>
+
+ <td>1440&times;720dpi</td>
+
+ <td>32-bit CMYK, 30-pin, inkjet paper</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Epson Stylus Color 640</th>
+ </tr>
+ <tr>
+
+ <td><code>stc640p.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>plain paper?</td>
+ </tr>
+ <tr>
+
+ <td><code>st640p.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>CMYK, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>st640pg.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>grayscale, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>st640pl.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>CMYK, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>st640plg.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>grayscale, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>st640ih.upp</code></td>
+
+ <td>1440&times;720dpi</td>
+
+ <td>CMYK, inkjet paper</td>
+ </tr>
+ <tr>
+
+ <td><code>st640ihg.upp</code></td>
+
+ <td>1440&times;720dpi</td>
+
+ <td>grayscale, inkjet paper</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Epson Stylus Color 800, 64/180-inch weaving</th>
+ </tr>
+ <tr>
+
+ <td><code>stc800pl.upp</code></td>
+
+ <td>360&times;360dpi</td>
+
+ <td>32-bit CMYK, 64-pin, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>stc800p.upp</code></td>
+
+ <td>720&times;720dpi</td>
+
+ <td>32-bit CMYK, 64-pin, plain paper</td>
+ </tr>
+ <tr>
+
+ <td><code>stc800ih.upp</code></td>
+
+ <td>1440&times;720dpi</td>
+
+ <td>32-bit CMYK, 62-pin, inkjet paper</td>
+ </tr>
+ <tr>
+
+ <td><code>stc1520.upp</code></td>
+
+ <td>1440&times;720dpi</td>
+
+ <td>32-bit CMYK, 62-pin, inkjet paper</td>
+ </tr>
+ <tr>
+ <th align="left" colspan="3">Sun raster file</th>
+ </tr>
+ <tr>
+
+ <td><code>ras1.upp</code></td>
+
+ <td>1-bit</td>
+
+ <td>monochrome (Ghostscript)</td>
+ </tr>
+ <tr>
+
+ <td><code>ras3.upp</code></td>
+
+ <td>3-bit</td>
+
+ <td>RGB (Ghostscript)</td>
+ </tr>
+ <tr>
+
+ <td><code>ras4.upp</code></td>
+
+ <td>4-bit</td>
+
+ <td>CMYK (Ghostscript)</td>
+ </tr>
+ <tr>
+
+ <td><code>ras8m.upp</code></td>
+
+ <td>8-bit</td>
+
+ <td>grayscale (Floyd-Steinberg)</td>
+ </tr>
+ <tr>
+
+ <td><code>ras24.upp</code></td>
+
+ <td>24-bit</td>
+
+ <td>RGB (Floyd-Steinberg)</td>
+ </tr>
+ <tr>
+
+ <td><code>ras32.upp</code></td>
+
+ <td>32-bit</td>
+
+ <td>CMYK (CMYK-Floyd-Steinberg)</td>
+ </tr>
+ </table>
+
+
+|
+
+
+Thanks to Danilo Beuche, Guido Classen, Mark Goldberg and Hans-Heinrich Viehmann for providing the files for the ``stc200``, ``hp690``, ``stc500`` and the ``stc640``. Thanks to `Michael Lossin`_ for the newer ``st640`` parameter sets.
+
+
+.. note::
+
+ - Changing the resolution with Ghostscript's ``-r`` switch is usually not possible.
+
+ - For Epson Stylus Color models not listed above, the two ``stc500`` variants are likely to work in addition to ``stcany``, but their gamma correction might be wrong.
+
+
+The state of this driver
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The coding of :title:`uniprint` was triggered by the requirements of the various Stylus Color models and some personal needs for HP and NEC drivers. Thus the Epson models are well represented among the distributed parameter files. When this driver entered the beta test phase, three other drivers appeared on the scene that could be at least partially integrated into :title:`uniprint`: :title:`cdj850` by Uli Wortmann, ``hpdj`` by Martin Lottermoser, and ``bjc610`` by Helmut Riegler.
+
+Uli addresses features of the more recent DeskJet models that will not be available in :title:`uniprint` soon. Martin taught me a lesson on HP-PCL3 headers that will be available in :title:`uniprint` soon. Helmut in turn followed an almost similar idea, but targetted primarily for printing on Canon printers from the ``pbmplus`` library. Starting with version 1.68 of :title:`uniprint`, BJC support is available. Work on the ``hpdj`` integration will start after the update of my website.
+
+
+Notes on :title:`uniprint`'s background
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+:title:`uniprint` is actually an update of :title:`stcolor`, but much more versatile than its predecessor; :title:`stcolor`, in its turn, started as a clone of the color DeskJet family of drivers (``cdj*``). Finally, ``cdj*`` can be considered an addition of features to the simpler monochrome drivers of Ghostscript. This addition of features is useful to get an idea of the functionality of :title:`uniprint`:
+
+Monochrome to advanced color (``cdj*``)
+ This adds color mapping and rendering functions to the driver. Error diffusion is especially important for the quality of printing.
+
+HP color to Epson Color (:title:`stcolor`)
+ The Epson Stylus Color offered two features simultaneously: it could produce 720×720dpi output and it could soak the paper. In other words, it required more color management features inside the driver. This is still the major conceptual difference in the data generation for HP and Epson printers.
+
+Weaving techniques (:title:`stcolor`)
+ Besides the internal color management, the Stylus Color did not provide enough buffer space to operate the printer fast at 720×720dpi. The use of weaving could yield triple the print speed. Weaving, also called interleaving, is present in some monochrome drivers too. The new thing in :title:`stcolor` was the combination with error diffusion. Unfortunately the weaving was somehow hard-coded, as the problems with the newer members of the Stylus Color family of printers demonstrated.
+
+Generalized output format and weaving (:title:`uniprint`)
+ The features mentioned above yield about 90% of :title:`stcolor`'s source code; only 10% is related to the formatting of the output. The idea to make the output format switchable came up soon after completing stcolor, but its final design was triggered by the (personal) necessity to drive a NEC P2X and a Designjet 750c.
+
+
+Thus :title:`uniprint` accumulates almost any features that can be found among the other printer drivers, which clearly has some disadvantage in processing speed -- true in particular of version 1.75, since it was targetted for functionality, and several speed-gaining features were (knowingly) omitted.
+
+To summarize and to introduce the terms used in the description of the parameters, the features of :title:`uniprint` that can be parameterized are:
+
+- Color mapping.
+- Color rendering (error diffusion or Floyd-Steinberg).
+- Output format, including weaving.
+
+
+Godzilla's guide to the creation of Unified Printer Parameter (``.upp``) files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Here is one of the distributed parameter files (``stc_l.upp``) with some added comments. Also see the section that describes all :title:`uniprint`'s parameters in brief.
+
+
+.. code-block::
+
+ -supModel="Epson Stylus Color I (and PRO Series), 360x360DpI, noWeave"
+ -sDEVICE=uniprint -- Select the driver
+ -dNOPAUSE -- Useful with printers
+ -dSAFER -- Provides some security
+ -dupColorModel=/DeviceCMYK -- Selects the color mapping
+ -dupRendering=/ErrorDiffusion -- Selects the color rendering
+ -dupOutputFormat=/EscP2 -- Selects the output format
+ -r360x360 -- Adjusts the resolution
+ -dupMargins="{ 9.0 39.96 9.0 9.0}" -- Establishes (L/B/R/T margins in points)
+ -dupComponentBits="{1 1 1 1}" -- Map: bits per component (default: 8)
+ -dupWeaveYPasses=4 -- Weave: Y-passes (default: 1)
+ -dupOutputPins=15 -- Format/weave: scans per Command
+ -dupBeginPageCommand="< -- Goes to the printer
+ 1b40 1b40 -- ESC '@' ESC '@' -> dual reset
+ 1b2847 0100 01 -- ESC '(' 'G' 1 0 1 -> graphics
+ 1b2869 0100 00 -- ESC '(' 'i' 1 0 1 -> no HW weave
+ 1b2855 0100 0A -- ESC '(' 'U' 1 0 10 -> 360dpi
+ 1b5500 -- ESC 'U' 0 -> bidir print
+ 1b2843 0200 0000 -- ESC '(' 'C' 2 0 xx -> page length
+ 1b2863 0400 0000 0000 -- ESC '(' 'c' 4 0 xxxx -> margins
+ >" -- as it is, unless:
+ -dupAdjustPageLengthCommand -- Adjust page length in BOP requested
+ -dupAdjustTopMarginCommand -- Adjust top margin in BOP
+ -dupAdjustBottomMarginCommand -- Adjust bottom margin in BOP
+ -dupEndPageCommand="(\033@\014)" -- Last (but one) data to the printer
+ -dupAbortCommand="(\033@\15\12\12\12\12 Printout-Aborted\15\014)"
+
+
+That's short, and if one removes ``upWeaveYPasses`` and ``upOutputPins`` it becomes shorter, almost ``stcany.upp``. This miniature size is because I am most familiar with ESC/P2, and was able to add defaults for the omitted parameters. Now a few notes about the parameters used in this example:
+
+
+- ``upModel`` is a string serving as a comment (and nothing else).
+- ``DEVICE``, ``NOPAUSE``, ``SAFER`` are well-known Ghostscript parameters described in the :ref:`usage documentation<Use.htm>`.
+- ``upColorModel`` is one of the major :title:`uniprint` parameters: it selects the color mapping and in turn the PostScript color model. It supports the devices ``/DeviceGray``, ``/DeviceRGBW``, ``/DeviceRGB``, ``/DeviceCMYK``, and ``/DeviceCMYKgenerate``.
+- ``upRendering`` selects the (color) rendering, supporting the values ``/ErrorDiffusion`` and ``/FSCMYK32``. ``/ErrorDiffusion`` is similar to ``fsmono``, ``fsrgb`` and ``fsx4`` of :title:`stcolor`, while ``/FSCMYK32`` is (almost) identical to ``fscmyk`` and ``hscmyk``, but is restricted to 32-bit data and should be used in conjunction with ``/DeviceCMYKgenerate``.
+- ``upOutputFormat`` selects the output method, supporting the values ``/SunRaster``, ``/Epson``, ``/EscP2``, ``/EscP2XY``, and ``/Pcl``.
+
+
+ .. list-table::
+ :widths: 50 50
+ :header-rows: 0
+
+ * - ``/SunRaster``
+ - creates Sun raster files and requires no other parameters
+ * - ``/Epson``
+ - is used for the elderly ESC/P format (used by many printers)
+ * - ``/EscP2``
+ - is used by more recent Epson printers (no X weaving supported)
+ * - ``/EscP2XY``
+ - supports X-Weaving, used with 1440dpi printers and in ``stc2s_h``
+ * - ``/Pcl``
+ - HP PCL/RTL-style output formatter without weaving
+
+
+
+- ``-r360x360`` is Ghostscript's standard resolution switch.
+- ``upMargins="{ 9.0 39.96 9.0 9.0}"`` has function similar to the Ghostscript parameter ``.HWMargins``: it sets the left, bottom, right, and top margins in points. :title:`uniprint` provides this parameter to enable automatic left-right exchange if ``upYFlip`` is active.
+- ``upComponentBits`` is an array of integers that selects the bits stored in raster memory, by default 8 bits per component. In this example, 1 bit is selected for each component, thus turning down the Floyd-Steinberg algorithm (but still carrying out the time-consuming computation). The related parameter ``upComponentShift`` controls positioning the components within raster memory. Each of the numbers given corresponds to a component which depends on the selected ``upColorModel``:
+
+
+ .. list-table::
+ :header-rows: 1
+
+ * -
+ - /DeviceGray
+ - /DeviceRGBW
+ - /DeviceRGB
+ - /DeviceCMYK
+ - /DeviceCMYKgenerate
+ * - 0
+ - White
+ - White
+ - Red
+ - Black
+ - Black
+ * - 1
+ - --
+ - Red
+ - Green
+ - Cyan
+ - Cyan
+ * - 2
+ - --
+ - Green
+ - Blue
+ - Magenta
+ - Magenta
+ * - 3
+ - --
+ - Blue
+ - --
+ - Yellow
+ - Yellow
+
+
+ This order may not be suitable for some printers, so another parameter ``upOutputComponentOrder``, also an array of integers, selects the output order using the numbers on the left.
+
+
+ One group of very important parameters not used in the example above deserves to be mentioned here: the transfer arrays, named ``up{color}Transfer``, where ``{color}`` is one of the names in the table above. These are arrays of floats in the range 0.0 - 1.0 representing the color transfer functions. They are used during mapping and rendering. In the simplest case, these arrays ensure an equidistant distribution of the stored values within the device space (which means a nonlinear mapping from Ghostscript's point of view). If the given array does not cover the entire range from 0 to 1, which applies for the Stylus Color family at high resolution for some media, only the relevant part gets mapped to raster memory (meaning that is's fully utilized) and the rendering takes care of the "overhang" (in this case the post-diffusion of 1-bit components makes sense).
+
+ Finally an important note on the transfer arrays: for monochrome devices the stored component is ``White``, which is the way PostScript defines these devices, but most printers require ``Black``. Thus one has to provide a falling ``upWhiteTransfer`` for such printers.
+
+
+- ``upWeaveYPasses`` is an integer that gives the number of print head passes required to achieve the requested ``Ydpi``. This makes sense only if ``upOutputPins`` is set to something greater than 1. Thus multiple pins or nozzles are transferred with a single command, and of course such a command must be supported by the device.
+
+
+If no other weave parameters are given, :title:`uniprint` computes several defaults which together do no weaving. The ``/Epson`` and ``/EscP2XY`` formats take care of ``upWeaveXPasses`` too.
+
+
+- ``upBeginPageCommand`` represents the data transferred to the printer whenever a new page begins. Before that, ``upBeginJobCommand`` is written to the device only once per output file. (Intended for the HP PJL sequences).
+
+- ``upAdjustBottomMarginCommand``, ``upAdjustMediaSize``, ``upAdjustPageLengthCommand``, ``upAdjustPageWidthCommand``, ``upAdjustResolutionCommand``, and ``upAdjustTopMarginCommand``.
+
+ Normally :title:`uniprint` does not change the ``upBeginPageCommand``, nor does it provide a default. However, if the above boolean values are set, the corresponding values are changed (provided that the code of the formatters supports this change and the commands to be adjusted are included in the BOP string).
+
+- ``upEndPageCommand`` is the fixed termination sequence for each page, and of course there is an ``upEndJobCommand`` too.
+
+- ``upAbortCommand`` is written if :title:`uniprint`'s interrupt detection is enabled and a signal is caught. It replaces ``upEndPageCommand`` and ``upEndJobCommand``, thus allowing the indication of an aborted job. (Ghostscript gets an error return from :title:`uniprint` in this case, and abandons further processing).
+
+
+For the ESC/P(2) formats all commands represent binary data, while for the PCL/RTL formatter some of them are formats for ``fprintf``. These strings must explicitly have a trailing ``"\0'``.
+
+I should write more, but the only recommendation is to take a look at the various parameter files. Here are a few more hints.
+
+- If the Driver rejects a configuration, nothing happens until showpage; then an error is raised and a message with ``CALL-REJECTED upd_print_page...`` is printed on ``stderr``.
+- :title:`uniprint` has lots of messages that can be activated by setting bits in the preprocessor macro ``UPD_MESSAGES``. I usually use the compile-time option ``-DUPD_MESSAGES=0x17`` for configuration development. (For the semantics, check the ``UPD_M_`` macros in the source).
+- A program ``"uninfo.ps"`` distributed with Ghostscript displays interactively in alphabetical order the contents of the current ``pagedevice`` dictionary. This includes any parameters generated or changed by :title:`uniprint`.
+
+
+
+All parameters in brief
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This table gives a brief explanation of every parameter known to :title:`uniprint`, listing them in alphabetical order. "``[ ]``" denotes that a parameter is an array, and "``(RO)``" that it is read-only.
+
+
+
+.. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <th colspan="3">All uniprint parameters</th>
+ </tr>
+ <tr>
+ <th align="left">Parameter</th>
+
+ <th align="left">Type</th>
+
+ <th align="left">Use</th>
+ </tr>
+ <tr>
+ <td><code>upAbortCommand</code></td>
+
+ <td>String</td>
+
+ <td>End of page and file on interrupt</td>
+ </tr>
+ <tr>
+ <td><code>upAdjustBottomMarginCommand</code></td>
+
+ <td>Bool</td>
+
+ <td>Manipulate bottom margin in <code>upBeginPageCommand</code></td>
+ </tr>
+ <tr>
+ <td><code>upAdjustMediaSizeCommand</code></td>
+
+ <td>Bool</td>
+
+ <td>Manipulate <code>Mediasize</code> [intended]</td>
+ </tr>
+ <tr>
+ <td><code>upAdjustPageLengthCommand</code></td>
+
+ <td>Bool</td>
+
+ <td>Manipulate page length in <code>upBeginPageCommand</code></td>
+ </tr>
+ <tr>
+ <td><code>upAdjustPageWidthCommand</code></td>
+
+ <td>Bool</td>
+
+ <td>Manipulate page width in <code>upBeginPageCommand</code></td>
+ </tr>
+ <tr>
+ <td><code>upAdjustResolutionCommand</code></td>
+
+ <td>Bool</td>
+
+ <td>Manipulate resolution</td>
+ </tr>
+ <tr>
+ <td><code>upAdjustTopMarginCommand</code></td>
+
+ <td>Bool</td>
+
+ <td>Manipulate top margin in <code>upBeginPageCommand</code></td>
+ </tr>
+ <tr>
+ <td><code>upBeginJobCommand</code></td>
+
+ <td>String</td>
+
+ <td>Begin each output file</td>
+ </tr>
+ <tr>
+ <td><code>upBeginPageCommand</code></td>
+
+ <td>String</td>
+
+ <td>Begin each page</td>
+ </tr>
+ <tr>
+ <td><code>upBlackTransfer</code></td>
+
+ <td>Float[&nbsp;]</td>
+
+ <td>Black transfer (CMYK only!)</td>
+ </tr>
+ <tr>
+ <td><code>upBlueTransfer</code></td>
+
+ <td>Float[&nbsp;]</td>
+
+ <td>Blue transfer</td>
+ </tr>
+ <tr>
+ <td><code>upColorInfo</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>struct <code>gx_device_color_info</code></td>
+ </tr>
+ <tr>
+ <td><code>upColorModel</code></td>
+
+ <td>Name</td>
+
+ <td>Select color mapping</td>
+ </tr>
+ <tr>
+ <td><code>upColorModelInitialized</code></td>
+
+ <td>Bool (RO)</td>
+
+ <td>Color mapping OK</td>
+ </tr>
+ <tr>
+ <td><code>upComponentBits</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>Bits stored per component</td>
+ </tr>
+ <tr>
+ <td><code>upComponentShift</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>Positioning within <code>gx_color_index</code></td>
+ </tr>
+ <tr>
+ <td><code>upCyanTransfer</code></td>
+
+ <td>Float[&nbsp;]</td>
+
+ <td>Cyan transfer</td>
+ </tr>
+ <tr>
+ <td><code>upEndJobCommand</code></td>
+
+ <td>String</td>
+
+ <td>End each file unless <code>upAbortCommand</code></td>
+ </tr>
+ <tr>
+ <td><code>upEndPageCommand</code></td>
+
+ <td>String</td>
+
+ <td>End each page unless <code>upAbortCommand</code></td>
+ </tr>
+ <tr>
+ <td><code>upErrorDetected</code></td>
+
+ <td>Bool (RO)</td>
+
+ <td>Severe (VM) error, not fully operational</td>
+ </tr>
+ <tr>
+ <td><code>upFSFixedDirection</code></td>
+
+ <td>Bool</td>
+
+ <td>Inhbits direction toggling in rendering</td>
+ </tr>
+ <tr>
+ <td><code>upFSProcessWhiteSpace</code></td>
+
+ <td>Bool</td>
+
+ <td>Causes white-space rendering</td>
+ </tr>
+ <tr>
+ <td><code>upFSReverseDirection</code></td>
+
+ <td>Bool</td>
+
+ <td>Run rendering in reverse (if fixed)</td>
+ </tr>
+ <tr>
+ <td><code>upFSZeroInit</code></td>
+
+ <td>Bool</td>
+
+ <td>Non-random rendering initialization</td>
+ </tr>
+ <tr>
+ <td><code>upFormatXabsolute</code></td>
+
+ <td>Bool</td>
+
+ <td>Write absolute X coordinates</td>
+ </tr>
+ <tr>
+ <td><code>upFormatYabsolute</code></td>
+
+ <td>Bool</td>
+
+ <td>Write absolute Y coordinates</td>
+ </tr>
+ <tr>
+ <td><code>upGreenTransfer</code></td>
+
+ <td>Float[&nbsp;]</td>
+
+ <td>Green transfer</td>
+ </tr>
+ <tr>
+ <td><code>upMagentaTransfer</code></td>
+
+ <td>Float[&nbsp;]</td>
+
+ <td>Magenta transfer</td>
+ </tr>
+ <tr>
+ <td><code>upMargins</code></td>
+
+ <td>Float[&nbsp;]</td>
+
+ <td>L/B/R/T margins in points</td>
+ </tr>
+ <tr>
+ <td><code>upModel</code></td>
+
+ <td>String</td>
+
+ <td>Comment string, holds some info</td>
+ </tr>
+ <tr>
+ <td><code>upOutputAborted</code></td>
+
+ <td>Bool (RO)</td>
+
+ <td>Caught an interrupt</td>
+ </tr>
+ <tr>
+ <td><code>upOutputBuffers</code></td>
+
+ <td>Int</td>
+
+ <td>Number of rendering buffers (2^<small><sup><b>N</b></sup></small>)</td>
+ </tr>
+ <tr>
+ <td><code>upOutputComponentOrder</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>Order of components when printing</td>
+ </tr>
+ <tr>
+ <td><code>upOutputComponents</code></td>
+
+ <td>Int</td>
+
+ <td>Number of written components, not fully operational</td>
+ <tr>
+ <td><code>upOutputFormat</code></td>
+
+ <td>Name</td>
+
+ <td>Select output format</td>
+ </tr>
+ <tr>
+ <td><code>upOutputFormatInitialized</code></td>
+
+ <td>Bool (RO)</td>
+
+ <td>Format data OK</td>
+ </tr>
+ <tr>
+ <td><code>upOutputHeight</code></td>
+
+ <td>Int</td>
+
+ <td>Output height in pixels</td>
+ </tr>
+ <tr>
+ <td><code>upOutputPins</code></td>
+
+ <td>Int</td>
+
+ <td>Number of pins / nozzles per command</td>
+ </tr>
+ <tr>
+ <td><code>upOutputWidth</code></td>
+
+ <td>Int</td>
+
+ <td>Output width in pixels</td>
+ </tr>
+ <tr>
+ <td><code>upOutputXOffset</code></td>
+
+ <td>Int</td>
+
+ <td>Offset in pixels, if <code>upFormatXabsolute</code></td>
+ </tr>
+ <tr>
+ <td><code>upOutputXStep</code></td>
+
+ <td>Int</td>
+
+ <td>Divisor or multiplier for X coords</td>
+ </tr>
+ <tr>
+ <td><code>upOutputYOffset</code></td>
+
+ <td>Int</td>
+
+ <td>Offset in pixels, if <code>upFormatYabsolute</code></td>
+ </tr>
+ <tr>
+ <td><code>upOutputYStep</code></td>
+
+ <td>Int</td>
+
+ <td>Divisor or multiplier for Y coords</td>
+ </tr>
+ <tr>
+ <td><code>upRasterBufferInitialized</code></td>
+
+ <td>Bool (RO)</td>
+
+ <td>GS buffer OK</td>
+ </tr>
+ <tr>
+ <td><code>upRedTransfer</code></td>
+
+ <td>Float[&nbsp;]</td>
+
+ <td>Red transfer</td>
+ </tr>
+ <tr>
+ <td><code>upRendering</code></td>
+
+ <td>Name</td>
+
+ <td>Select rendering algorithm</td>
+ </tr>
+ <tr>
+ <td><code>upRenderingInitialized</code></td>
+
+ <td>Bool (RO)</td>
+
+ <td>Rendering parameters OK</td>
+ </tr>
+ <tr>
+ <td><code>upSelectComponentCommands</code></td>
+
+ <td>String[&nbsp;]</td>
+
+ <td>Establish color (output order!)</td>
+ </tr>
+ <tr>
+ <td><code>upSetLineFeedCommand</code></td>
+
+ <td>String</td>
+
+ <td>Adjust linefeed (Epson only)</td>
+ </tr>
+ <tr>
+ <td><code>upVersion</code></td>
+
+ <td>String (RO)</td>
+
+ <td>Source code version</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveFinalPins</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>Number of bottom pins on EOP passes</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveFinalScan</code></td>
+
+ <td>Int</td>
+
+ <td>Begin EOP passes (Y-coord)</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveFinalXStarts</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>X-pass indices for EOP passes</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveFinalYFeeds</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>Y increments for EOP passes</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveInitialPins</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>Number of top pins on BOP passes</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveInitialScan</code></td>
+
+ <td>Int</td>
+
+ <td>End BOP passes (Y coord)</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveInitialXStarts</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>X-pass indices for BOP passes</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveInitialYFeeds</code></td>
+
+ <td>int[&nbsp;]</td>
+
+ <td>Y increments for BOP passes</td>
+ </tr>
+ <tr>
+ <td><code>upWeavePasses</code></td>
+
+ <td>Int</td>
+
+ <td>XPasses &times; YPasses</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveXPasses</code></td>
+
+ <td>Int</td>
+
+ <td>Number of X passes</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveXStarts</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>X-pass indices for normal passes</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveYFeeds</code></td>
+
+ <td>Int[&nbsp;]</td>
+
+ <td>Y increments for normal passes</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveYOffset</code></td>
+
+ <td>Int</td>
+
+ <td>Number of blank or incomplete scans at BOP</td>
+ </tr>
+ <tr>
+ <td><code>upWeaveYPasses</code></td>
+
+ <td>Int</td>
+
+ <td>Number of X passes</td>
+ </tr>
+ <tr>
+ <td><code>upWhiteTransfer</code></td>
+
+ <td>Float[&nbsp;]</td>
+
+ <td>White transfer (monochrome devices!)</td>
+ </tr>
+ <tr>
+ <td><code>upWriteComponentCommands</code></td>
+
+ <td>String[&nbsp;]</td>
+
+ <td>Commands to write each component</td>
+ </tr>
+ <tr>
+ <td><code>upWroteData</code></td>
+
+ <td>Bool (RO)</td>
+
+ <td>Something (<code>BeginJob</code>) written to output</td>
+ </tr>
+ <tr>
+ <td><code>upXMoveCommand</code></td>
+
+ <td>String</td>
+
+ <td>X positioning command</td>
+ </tr>
+ <tr>
+ <td><code>upXStepCommand</code></td>
+
+ <td>String</td>
+
+ <td>Single step to the right</td>
+ </tr>
+ <tr>
+ <td><code>upYFlip</code></td>
+
+ <td>Bool</td>
+
+ <td>Flips output along the Y axis</td>
+ </tr>
+ <tr>
+ <td><code>upYMoveCommand</code></td>
+
+ <td>String</td>
+
+ <td>Y positioning command</td>
+ </tr>
+ <tr>
+ <td><code>upYStepCommand</code></td>
+
+ <td>String</td>
+
+ <td>Single step down</td>
+ </tr>
+ <tr>
+ <td><code>upYellowTransfer</code></td>
+
+ <td>Float[&nbsp;]</td>
+
+ <td>Yellow transfer</td>
+ </tr>
+ </table>
+
+
+
+:title:`uniprint`'s Roll of Honor
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+I should mention all of the people who were involved in :title:`stcolor`'s evolution, but I've decided to start from scratch here for :title:`uniprint`:
+
+John P. Beale
+ for testing the ``stc600`` modes
+
+Bill Davidson
+ who triggered some weaving research and tested ``stc2s_h``
+
+`L. Peter Deutsch`_
+ who triggered ease of configuration
+
+Mark Goldberg
+ who prepared the ``stc500`` transfers
+
+Scott F. Johnston and Scott J. Kramer
+ for testing the ``stc800`` modes
+
+Martin Lottermoser
+ for his great commented H-P DeskJet driver
+
+Helmut Riegler
+ for the BJC extension
+
+Hans-Gerd Straeter
+ for some measured transfer curves and more
+
+Uli Wortmann
+ for discussions and his :title:`cdj850` driver
+
+My family
+ for tolerating my printer-driver hacking
+
+
+`Gunther Hess`_
+Duesseldorfer Landstr. 16b, D-47249 Duisburg ,Germany, +49 203 376273 telephone (MET evening hours)
+
+
+
+Uniprint weaving parameters HowTo
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This section was contributed by Glenn Ramsey.
+
+I wrote this because the documentation was very brief and I really struggled with it for a while, but it is very simple once you understand what is going on.
+
+This only describes how to work out the Y parameters, I haven't looked at the X parameters yet.
+
+
+
+1. Determine the nozzle geometry (``upOutputPins``)
+ You need to know how many nozzles the printer has and the spacing between them. Usually you can find this out from the printer manual, or the printer supplier, but you may have to dissect a couple of printer output files produced with the driver supplied with the printer. There is a utility called ``escp2ras*`` that will help with that. Sometimes the term pin is used instead of nozzle but they mean the same thing.
+
+ The number of nozzles will be the value assigned to the ``upOutputPins`` parameter.
+
+ Actually you don't have to print with all the pins available but for the purpose of demonstration I'll assume that we are using them all.
+
+2. Determine how many passes are required (``upWeaveYPasses``).
+
+3. The number of passes required is going to depend on the required resolution and the nozzle spacing.
+
+
+ .. code-block::
+
+ passes = resolution * nozzle spacing
+
+ This will be the value assigned to the ``upWeaveYPasses`` parameter.
+
+ For example if the desired resolution is 360 dpi and the nozzles are spaced at 1/90in then 360 * 1/90 = 4 passes are required. For 720 dpi 8 passes would be required. The printer would, of course, have to be capable of moving the paper in increments of either 360 or 720 dpi too.
+
+4. Determine the normal Y feed increment (``upWeaveYFeeds``)
+
+ You need to work out how much to feed the paper so that when the paper has moved by one head length in however many passes you have then each row space on the paper has been passed over by at least one nozzle. There will be one feed value for each pass and the feed values must comply with the following rules:
+
+ .. code-block::
+
+ sum of feeds = passes * nozzles
+ feed%passes != 0 (feed is not exactly divisible by passes)
+ sum of (nozzles - feed) = 0
+
+ For example if ``passes=4`` and ``nozzles=15``, then sum of ``feeds=60``. The feed values could be ``1,1,1,57`` or ``15,15,15,15`` or ``14,15,18,13``.
+
+ These values will be assigned to the ``upWeaveYFeeds`` parameter.
+
+ You would need to experiment to see what combination looks best on the printer.
+
+ I found it convenient to draw several lines of nozzles and then move them around to see how the different combinations would fill the paper. A computer drawing tool makes this easier than pencil and paper (I used Dia, a GNOME app). The number of nozzles would probably be be a good place to start.
+
+ Remember that if the number of passes is more than 1 then the feed increment will be less than the nozzle spacing and passes × feed increment size must equal the physical distance between each nozzle.
+
+5. Determine the beginning of page pins (``upWeaveInitialPins``).
+
+ These values will be assigned to the ``upWeaveInitialPins`` parameter and are the numbers of nozzles to operate in each of the initial passes at the top of a page. The nozzles that the values refer to are the topmost nozzles on the head, nearest the top margin. If the image doesn't start at the top margin then uniprint doesn't use these feeds.
+
+ I don't know a mathematical relation for this except that at least one of the values must be the number of nozzles, but I'm sure that there must be one. I used a graphical method, the description that follows refers to the ascii diagram in below.
+
+ Draw a line of nozzles for each pass arranged as they would be using the normal Y feed increment determined in step 3. In the diagram below this would be passes 5-8.
+
+ Draw a line of nozzles that would print just before the first normal pass. The feed increment for this pass will be close to and most likely 1 or 2 units less than the feed increment of the last normal pass. In the example below this line is pass 4 and the feed increment is 13 whereas the normal feed increment is 15.
+
+ Draw each pass before that with a small feed increment so that if all of the nozzles appearing above the first nozzle of the first normal pass operate then all of the spaces will be filled. This feed increment is usually 1 except in cases where some jiggery pokery is going on to make the printer print at an apparent higher resolution than the nozzle diameter.
+
+ Now select the nozzles that will operate in each of theses initial passes so that the paper is filled. In each pass the nozzles must be adjacent to each other and at least one of the passes will have all the nozzles operating. I suspect that for each combination of normal Y feed increments there will only be one set of valid beginning of page increments.
+
+
+Example: stc.upp from Aladdin Ghostscript 6.01
+""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+15 nozzles spaced at 1/90 in, 360 dpi requires 4 passes.
+
+
+.. code-block::
+
+ -dupWeaveYPasses=4
+ -dupOutputPins=15
+ -dupWeaveYFeeds="{15 15 15 15}"
+ -dupWeaveInitialYFeeds="{1 1 1 13}"
+ -dupWeaveInitialPins="{ 4 15 11 7}"
+
+The following diagram shows which nozzles operate during each pass.
+
+Passes 1-4 are beginning of page passes and passes 5-8 are normal passes.
+
+
+
+.. raw:: html
+
+ <blockquote>
+ <p>x=nozzle operates, o=nozzle not used in this pass<tt></tt></p>
+ <p><tt>&nbsp; 1 2 3 4 5 6 7 8 - pass no</tt></p>
+ <br><tt>0 x</tt>
+ <br><tt>1&nbsp;&nbsp; x</tt>
+ <br><tt>2&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>4 x</tt>
+ <br><tt>5&nbsp;&nbsp; x</tt>
+ <br><tt>6&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>8 x</tt>
+ <br><tt>9&nbsp;&nbsp; x</tt>
+ <br><tt>0&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>2 x</tt>
+ <br><tt>3&nbsp;&nbsp; x</tt>
+ <br><tt>4&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>6 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>7&nbsp;&nbsp; x</tt>
+ <br><tt>8&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>0 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>1&nbsp;&nbsp; x</tt>
+ <br><tt>2&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>4 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>5&nbsp;&nbsp; x</tt>
+ <br><tt>6&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>8 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>9&nbsp;&nbsp; x</tt>
+ <br><tt>0&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
+ <br><tt>2 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>3&nbsp;&nbsp; x</tt>
+ <br><tt>4&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
+ <br><tt>6 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>7&nbsp;&nbsp; x</tt>
+ <br><tt>8&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
+ <br><tt>0 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>1&nbsp;&nbsp; x</tt>
+ <br><tt>2&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
+ <br><tt>4 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>5&nbsp;&nbsp; x</tt>
+ <br><tt>6&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
+ <br><tt>8 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>9&nbsp;&nbsp; x</tt>
+ <br><tt>0&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
+ <br><tt>2 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>3&nbsp;&nbsp; x</tt>
+ <br><tt>4&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
+ <br><tt>6 o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>7&nbsp;&nbsp; x</tt>
+ <br><tt>8&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o&nbsp;&nbsp; x</tt>
+ <br><tt>0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>6</tt>
+ <br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>0</tt>
+ <br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>4</tt>
+ <br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>6&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x</tt>
+ <br><tt>8</tt>
+ <br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>1</tt>
+ <br><tt>2</tt>
+ <br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>5</tt>
+ <br><tt>6</tt>
+ <br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>9</tt>
+ <br><tt>0</tt>
+ <br><tt>1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>3</tt>
+ <br><tt>4</tt>
+ <br><tt>5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>6</tt>
+ <br><tt>7</tt>
+ <br><tt>8</tt>
+ <br><tt>9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>0</tt>
+ <br><tt>1</tt>
+ <br><tt>2</tt>
+ <br><tt>3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ <br><tt>4</tt>
+ <br><tt>5</tt>
+ <br><tt>6</tt>
+ <br><tt>7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+ x</tt>
+ </blockquote>
+
+
+These parameters would also work:
+
+
+.. code-block::
+
+ -dupWeaveYPasses=4
+ -dupOutputPins=15
+ -dupWeaveYFeeds="{14 15 18 13}"
+ -dupWeaveInitialYFeeds="{1 1 1 13}"
+ -dupWeaveInitialPins="{ 4 11 7 15}"
+
+
+Extension to :title:`uniprint` for the Epson Stylus Color 300
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This section was contributed by Glenn Ramsey.
+
+The Epson Stylus Color 300 uses a different command set to other Epson Stylus Color printers that use the ESC/P2 language. As far as I can tell its commands are a subset of ESC/P2. In ESC/P2 the colour to be printed is selected by a 'set colour' command and then the data sent is only printed in that colour until the colour is changed with another 'set colour' command. The Stylus Color 300 lacks this functionality. The data sent to the printer maps directly to the ink nozzles and colour of an output scan line in the printed output is determined by the position of the scan line within the data. This means that the driver must know how the nozzles are arranged and must format the output accordingly. The extension adds a format that I have called ``EscNozzleMap`` and adds some additional parameters to :title:`uniprint`.
+
+
+- upOutputFormatselects the output method, and should be set to the value ``/EscNozzleMap`` to select this format.
+
+ ``/EscNozzleMap``
+ produces output for the Epson Stylus Color 300
+
+
+ .. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <th colspan="3">uniprint parameters for the EscNozzleMap format</th>
+ </tr>
+ <tr>
+ <th align="Left">Parameter</th>
+
+ <th align="Left">Type</th>
+
+ <th align="Left">Use</th>
+ </tr>
+ <tr>
+ <td colspan="3"></td>
+ </tr>
+ <tr>
+ <td><code>upNozzleMapRowsPerPass</code></td>
+
+ <td>Int
+ </td>
+
+
+ <td>output rows to generate for each pass of the head
+ </td>
+ </tr>
+ <tr>
+ <td><code>upNozzleMapPatternRepeat</code></td>
+
+ <td>Int
+ </td>
+
+ <td>no. of rows that correspond to the repeat pattern of the
+ nozzles
+ </td>
+ </tr>
+ <tr>
+ <td><code>upNozzleMapRowMask</code></td>
+ <td>Int[]
+ </td>
+ <td>mask indicating the colour of the nozzles
+ </td>
+ </tr>
+ <tr>
+ <td><code>upNozzleMapMaskScanOffset</code></td>
+
+ <td>Int[]
+ </td>
+ <td>mask indicating the physical position of the nozzles
+ </td>
+ </tr>
+ </table>
+
+
+**A more detailed description of the new parameters**
+
+``upNozzleMapRowsPerPass``
+ The number of rows of data that are required to address all nozzles for a single pass of the head. There will always be this number of rows of output data generated. I'd expect it to be the same as the total number of nozzles but it wouldn't break the formatter if it wasn't. So if you wanted to print with only the 10th nozzle then row 10 would contain data corresponding to the bit pattern and all of the others would be padded with zeros.
+
+``upNozzleMapPatternRepeat``
+ The number of nozzles in each repeated group on the printing head. This parameter must correspond with the length of the ``upNozzleMapRowMask`` array.
+
+``upNozzleMapRowMask``
+ An array of integers that defines the colour of the nozzles on the head and whether the nozzles will be used to print. The array index defines the row index for the nozzle in the output data and the value defines the colour of the nozzle. The mapping of colours to values is defined in the table below.
+
+
+ .. list-table::
+ header-rows: 1
+
+
+ * - colour mask value
+ -
+ * - ``K``
+ - 1
+ * - ``C``
+ - 2
+ * - ``M``
+ - 3
+ * - ``Y``
+ - 4
+ * - ``no data``
+ - 0
+
+
+A value of 0 means that the nozzle is not used and the row in the output data will be padded with zeros.
+
+``upNozzleMapMaskScanOffset``
+ An array of integers that defines the physical position of the nozzles relative to the first nozzle in the repeated group. The relative distance is measured in printed line widths and will be different for different printing resolutions. This parameter is used because the physical spacing of the nozzles may not correspond to their mapping in the output data. For example the ESC300 has nozzles physically arranged something like this:
+
+
+
+.. raw:: html
+
+ <table width=100% border=1>
+ <tr>
+ <td style="background-color: #00ffff !important;">&nbsp;
+ </td>
+ <td style="background-color: #ffff00 !important;">&nbsp;
+ </td>
+ <td style="background-color: #000000 !important;">&nbsp;
+ </td>
+ <td style="background-color: #ff00ff !important;">&nbsp;
+ </td>
+ <td style="background-color: #000000 !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: #000000 !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: #00ffff !important;">&nbsp;
+ </td>
+ <td style="background-color: #ffff00 !important;">&nbsp;
+ </td>
+ <td style="background-color: #000000 !important;">&nbsp;
+ </td>
+ <td style="background-color: #ff00ff !important;">&nbsp;
+ </td>
+ <td style="background-color: #000000 !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: #000000 !important;">&nbsp;
+ </td>
+ <td style="background-color: #ffffff !important;">&nbsp;
+ </td>
+ </tr>
+ <tr>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: #00ffff !important;">&nbsp;
+ </td>
+ <td style="background-color: #ffff00 !important;">&nbsp;
+ </td>
+ <td style="background-color: #000000 !important;">&nbsp;
+ </td>
+ <td style="background-color: #ff00ff !important;">&nbsp;
+ </td>
+ <td style="background-color: #000000 !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: #000000 !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">&nbsp;
+ </td>
+ <td style="background-color: #00ffff !important;">&nbsp;
+ </td>
+ <td style="background-color: #ffff00 !important;">&nbsp;
+ </td>
+ <td style="background-color: rgba(0,0,0,0) !important;">etc ...
+ </td>
+ </tr>
+ </table>
+
+
+There is a one nozzle width space between the last two nozzles in each group. In the output data the data for the last nozzle in the group would be in row 5 (numbering starts at 0) but the nozzle is physically positioned at 6 spaces from the first nozzle.
+
+
+Example 1 - Epson Stylus Color 300 - 360 dpi colour
+""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+
+.. code-block::
+
+ -dupWeaveYPasses=6
+ -dupOutputPins=11
+ -dupWeaveYFeeds="{ 11 11 11 11 11 11 }"
+ -dupWeaveInitialYFeeds="{ 1 1 1 1 1 7 }"
+ -dupWeaveInitialPins="{ 2 11 9 7 5 3 }"
+ -dupNozzleMapRowsPerPass=64
+ -dupNozzleMapPatternRepeat=6
+ -dupNozzleMapRowMask="{ 2 4 1 3 0 0 }"
+ -dupNozzleMapMaskScanOffset="{ 0 1 2 3 0 0 }"
+
+
+The weaving parameters are the same as for any other :title:`uniprint` driver but they must be consistent with the nozzle map parameters. In this printer the coloured nozzles are spaced at 1/60" so 6 passes are required for 360 dpi resolution.
+
+In the example there are 64 rows of data required for each head pass. Each row must be completely filled with data for each pass so if certain nozzles do not print in the pass then the rows for those nozzles will be padded with zeroes.
+
+The row mask translates to "C Y K M 0 0" so in the output data rows 0,7,13,... will contain data for cyan, rows 1,8,14,... will contain data for yellow, etc. Rows 4,10,16,... and 5, 11,15,... will always be padded with zeroes. The ``upNozzleMapPatternRepeat`` parameter defines the length of the mask.
+
+The row mask is repeated for each group of ``upNozzleMapPatternRepeat`` rows in the output data. In this case there are 64 rows so there will be 10 groups of "C Y K M 0 0" followed by "C Y K M" which is equivalent to 11 output pins.
+
+The ``upNozzleMaskScanOffset`` array indicates how the data from the scan buffer is mapped to the output data. The data is presented to the formatter as a buffer of four colour scanlines. The index of the scanline being printed, lets call it y, always corresponds, in this example, to the physical position of the cyan nozzle but since the nozzles are not on the same horizontal line then the other colours for the current pass must come from other scanlines in the scan buffer. The example is { 0 1 2 3 0 0 }, this means that when printing a 4 colour image the magenta data would come from scanline y+3, the black from scanline y+2, etc. It would have been possible in this case to use the array index instead of the ``upNozzleMaskScanOffset`` parameter however the parameter is necessary to be able to use the full capability of the printer in black only mode.
+
+
+
+Example 2 - Epson Stylus Color 300 - 180 dpi black only
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+.. code-block::
+
+ -dupMargins="{ 9.0 39.96 9.0 9.0}"
+ -dupWeaveYPasses=1
+ -dupOutputPins=31
+ -dupNozzleMapRowsPerPass=64
+ -dupNozzleMapPatternRepeat=6
+ -dupNozzleMapRowMask="{ 0 0 1 0 1 1}"
+ -dupNozzleMapMaskScanOffset="{ 0 0 0 0 1 2 }"
+
+
+In this example there is no weaving.
+
+The ESC300 has black nozzles evenly physically arranged as ``K K K`` but the data must be sent to the printer as ``00K0KK``. This is handled by the ``upNozzleMapRowMask`` and ``upNozzleMaskScanOffset`` arrays. The ``upNozzleMapRowMask`` array is ``{ 0 0 1 0 1 1}`` which translates to ``{ 0 0 K 0 K K }`` so rows 0, 1 and 3 will always contain zeros and the other rows will contain data.
+
+The ``upNozzleMaskScanOffset`` array in this case is ``{ 0 0 0 0 1 2 }`` so if the data for the 1st nozzle comes from row y in the scan buffer then the data for the 2nd and 3rd nozzles will come from rows y+1 and y+2.
+
+
+Example 3 - Epson Stylus Color 300 - 360 dpi black only
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+.. code-block::
+
+ -dupWeaveYPasses=2
+ -dupOutputPins=31
+ -dupWeaveYFeeds="{31 31}"
+ -dupWeaveInitialYFeeds="{1 31}"
+ -dupWeaveInitialPins="{16 31}"
+ -dupNozzleMapRowsPerPass=64
+ -dupNozzleMapPatternRepeat=6
+ -dupNozzleMapRowMask="{ 0 0 1 0 1 1}"
+ -dupNozzleMapMaskScanOffset="{ 0 0 0 0 2 4 }"
+
+In this example 2 weave passes are required to achieve the desired resolution.
+
+The ``upNozzleMaskScanOffset`` array in this case is ``{ 0 0 0 0 2 4 }`` because there are two weave passes so if the data for the first nozzle comes from row y in the scan buffer then the data for the 2nd and 3rd nozzles must come from rows ``y+(1*2)`` and ``y+(2*2)``.
+
+
+Glenn Ramsey
+
+glennr at users.sourceforge.net
+
+February 2001
+
+
+.. External links
+
+.. _Uli Wortmann: uliw@erdw.ethz.ch
+.. _Martin Gerbershagen: ger@ulm.temic.de
+.. _Matthew Gelhaus: hp880@gelhaus.net
+.. _gelhaus.net/hp880c: http://www.gelhaus.net/hp880c/
+.. _Stephan C. Buchert: scb@stelab.nagoya-u.ac.jp
+.. _Yoshio Kuniyoshi: yoshio@nak.math.keio.ac.jp
+
+.. _David Gaudine: david@donald.concordia.ca
+.. _Robert M. Kenney: rmk@unh.edu
+.. _James McPherson: someone@erols.com
+.. _Ian Thurlbeck: ian@stams.strath.ac.uk
+.. _Klaus-Gunther Hess: ghess@elmos.de
+.. _Gunther Hess: ghess@elmos.de
+
+.. _Jason Patterson: jason@reflections.com.au
+.. _Michael Lossin: losse@germanymail.com
+
+.. _L. Peter Deutsch: https://en.wikipedia.org/wiki/L._Peter_Deutsch
+
+.. include:: footer.rst \ No newline at end of file
diff --git a/doc/src/Use.rst b/doc/src/Use.rst
new file mode 100644
index 00000000..e8aaf5e4
--- /dev/null
+++ b/doc/src/Use.rst
@@ -0,0 +1,3163 @@
+.. title:: Using Ghostscript
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _Use.htm:
+
+
+Using Ghostscript
+===================================
+
+
+This document describes how to use the command line Ghostscript client. Ghostscript is also used as a general engine inside other applications (for viewing files for example). Please refer to the documentation for those applications for using Ghostscript in other contexts.
+
+
+Invoking Ghostscript
+------------------------------------------
+
+
+The command line to invoke Ghostscript is essentially the same on all systems, although the name of the executable program itself may differ among systems. For instance, to invoke Ghostscript on unix-like systems type:
+
+.. code-block:: bash
+
+ gs [options] {filename 1} ... [options] {filename N} ...
+
+Here are some basic examples. The details of how these work are described below.
+
+To view a file:
+
+.. code-block:: bash
+
+ gs -dSAFER -dBATCH document.pdf
+
+
+You'll be prompted to press return between pages.
+
+To convert a figure to an image file:
+
+.. code-block:: bash
+
+ gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 \
+ -sOutputFile=tiger.png tiger.eps
+
+To render the same image at 300 dpi:
+
+.. code-block:: bash
+
+ gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r300 \
+ -sOutputFile=tiger_300.png tiger.eps
+
+
+To render a figure in grayscale:
+
+
+.. code-block:: bash
+
+
+ gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pnggray -sOutputFile=figure.png figure.pdf
+
+
+To rasterize a whole document:
+
+.. code-block:: bash
+
+ gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pgmraw -r150 \
+ -dTextAlphaBits=4 -sOutputFile='paper-%00d.pgm' paper.ps
+
+
+There are also a number of utility scripts for common to convert a PostScript document to PDF:
+
+
+.. code-block:: bash
+
+ ps2pdf file.ps
+
+
+The output is saved as ``file.pdf``.
+
+
+There are other utility scripts besides ``ps2pdf``, including ``pdf2ps``, ``ps2epsi``, ``pdf2dsc``, ``ps2ascii``, ``ps2ps`` and ``ps2ps2``. These just call Ghostscript with the appropriate (if complicated) set of options. You can use the 'ps2' set with eps files.
+
+Ghostscript is capable of interpreting PostScript, encapsulated PostScript (EPS), DOS EPS (EPSF), and Adobe Portable Document Format (PDF). The interpreter reads and executes the files in sequence, using the method described under "`File searching`_" to find them.
+
+The interpreter runs in interactive mode by default. After processing the files given on the command line (if any) it reads further lines of PostScript language commands from the primary input stream, normally the keyboard, interpreting each line separately. To quit the interpreter, type "``quit``". The ``-dBATCH -dNOPAUSE`` options in the examples above disable the interactive prompting. The interpreter also quits gracefully if it encounters end-of-file or control-C.
+
+The interpreter recognizes many options. An option may appear anywhere in the command line, and applies to all files named after it on the line. Many of them include "=" followed by a parameter. The most important are described in detail here. Please see the reference sections on `Command line options`_ and `Devices <Devices.htm>`_ for a more complete listing.
+
+
+
+Help at the command line: gs -h
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can get a brief help message by invoking Ghostscript with the ``-h`` or ``-?`` switch, like this:
+
+
+.. code-block:: bash
+
+ gs -h
+ gs -?
+
+
+The message shows for that version of the Ghostscript executable:
+
+- the version and release information.
+- the general format of the command line.
+- a few of the most useful options.
+- the formats it can interpret.
+- the available output devices.
+- the search path.
+- the bug report address.
+
+
+On other systems the executable may have a different name:
+
+
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - System
+ - Invocation Name
+ * - Unix
+ - gs
+ * - VMS
+ - gs
+ * - MS Windows 95 and later
+ - gswin32.exe
+
+ gswin32c.exe
+
+ gswin64.exe
+
+ gswin64c.exe
+
+ * - OS/2
+ - gsos2
+
+
+On Windows, the two digit number indicates the word length of the system for which the binary was built (so ``gswin32.exe`` is for x86 Windows systems, whilst ``gswin64.exe`` is for x86_64 Windows systems). And the "c" suffix indicates a Windows console based binary (note that the "display device" window will still appear).
+
+
+
+
+Selecting an output device
+------------------------------------------
+
+
+
+Ghostscript has a notion of 'output devices' which handle saving or displaying the results in a particular format. Ghostscript comes with a diverse variety of such devices supporting vector and raster file output, screen display, driving various printers and communicating with other applications.
+
+The command line option ``'-sDEVICE=device'`` selects which output device Ghostscript should use. If this option isn't given the default device (usually a display device) is used. Ghostscript's built-in help message (``gs -h``) lists the available output devices. For complete description of the devices distributed with Ghostscript and their options, please see the `Devices <Devices.htm>`_ section of the documentation.
+
+Note that this switch must precede the name of the first input file, and only its first use has any effect. For example, for printer output in a configuration that includes an Epson printer driver, instead of just ``'gs myfile.ps'`` you might use:
+
+
+.. code-block:: bash
+
+ gs -sDEVICE=epson myfile.ps
+
+
+
+
+
+The output device can also be set through the ``GS_DEVICE`` environment variable.
+
+Once you invoke Ghostscript you can also find out what devices are available by typing ``'devicenames =='`` at the interactive prompt. You can set the output device and process a file from the interactive prompt as well:
+
+.. code-block:: bash
+
+ (epson) selectdevice
+ (myfile.ps) run
+
+All output then goes to the Epson printer instead of the display until you do something to change devices. You can switch devices at any time by using the ``selectdevice`` procedure, for instance like one of these:
+
+.. code-block:: bash
+
+ (x11alpha) selectdevice
+ (epson) selectdevice
+
+
+
+Output resolution
+~~~~~~~~~~~~~~~~~~~
+
+Some printers can print at several different resolutions, letting you balance resolution against printing speed. To select the resolution on such a printer, use the ``-r`` switch:
+
+
+.. code-block:: bash
+
+ gs -sDEVICE=printer -rXRESxYRES
+
+
+where ``XRES`` and ``YRES`` are the requested number of dots (or pixels) per inch. Where the two resolutions are same, as is the common case, you can simply use ``-rres``.
+
+The ``-r`` option is also useful for controlling the density of pixels when rasterizing to an image file. It is used this way in the examples at the beginning of this document.
+
+
+Output to files
+~~~~~~~~~~~~~~~~
+
+Ghostscript also allows you to control where it sends its output. With a display device this isn't necessary as the device handles presenting the output on screen internally. Some specialized printer drivers operate this way as well, but most devices are general and need to be directed to a particular file or printer.
+
+To send the output to a file, use the ``-sOutputFile=`` switch or the :ref:`-o switch <O switch>` (below). For instance, to direct all output into the file ``ABC.xyz``, use:
+
+.. code-block:: bash
+
+ gs -sOutputFile=ABC.xyz
+
+
+When printing on MS Windows systems, output normally goes directly to the printer, ``PRN``. On Unix and VMS systems it normally goes to a temporary file which is sent to the printer in a separate step. When using Ghostscript as a file rasterizer (converting PostScript or PDF to a raster image format) you will of course want to specify an appropriately named file for the output.
+
+Ghostscript also accepts the special filename '``-``' which indicates the output should be written to standard output (the command shell).
+
+Be aware that filenames beginning with the character % have a special meaning in PostScript. If you need to specify a file name that actually begins with %, you must prepend the ``%os%`` filedevice explicitly. For example to output to a file named ``%abc``, you need to specify:
+
+
+.. code-block:: bash
+
+ gs -sOutputFile=%os%%abc
+
+
+Please see `Ghostscript and the PostScript Language <Language.htm>`_ and the PostScript Language Reference Manual for more details on ``%`` and filedevices.
+
+
+.. note::
+
+ On MS Windows systems, the ``%`` character also has a special meaning for the command processor (shell), so you will have to double it, e.g.:
+
+ .. code-block:: bash
+
+ gs -sOutputFile=%%os%%%%abc
+
+
+Note, some devices (e.g. :title:`pdfwrite`, :title:`ps2write`) only write the output file upon exit, but changing the OutputFile device parameter will cause these devices to emit the pages received up to that point and then open the new file name given by OutputFile.
+
+For example, in order to create two PDF files from a single invocation of Ghostscript the following can be used:
+
+.. code-block:: bash
+
+ gs -sDEVICE=pdfwrite -o tiger.pdf examples/tiger.eps -c "<< /OutputFile (colorcir.pdf) >> setpagedevice" -f examples/colorcir.ps
+
+
+
+.. _Use_OnePagePerFile:
+
+
+One page per file
+""""""""""""""""""""
+
+
+Specifying a single output file works fine for printing and rasterizing figures, but sometimes you want images of each page of a multi-page document. You can tell Ghostscript to put each page of output in a series of similarly named files. To do this place a template ``'%d'`` in the filename which Ghostscript will replace with the page number.
+
+Note: Since the % character is used to precede the page number format specification, in order to represent a file name that contains a %, double % characters must be used. For example for the file ``my%foo`` the OutputFile string needs to be ``my%%foo``.
+
+The format can in fact be more involved than a simple ``'%d'``. The format specifier is of a form similar to the C ``printf`` format. The general form supported is:
+
+.. code-block:: bash
+
+ %[flags][width][.precision][l]type
+
+ where: flags is one of: #+-
+ type is one of: diuoxX
+
+
+For more information, please refer to documentation on the C printf format specifications. Some examples are:
+
+.. code-block:: bash
+
+ -sOutputFile=ABC-%d.png
+ produces 'ABC-1.png', ... , 'ABC-10.png', ..
+ -sOutputFile=ABC-%03d.pgm
+ produces 'ABC-001.pgm', ... , 'ABC-010.pgm', ...
+ -sOutputFile=ABC_p%04d.tiff
+ produces 'ABC_p0001.tiff', ... , 'ABC_p0510.tiff', ... , 'ABC_p5238.tiff'
+
+
+Note, however that the one page per file feature may not supported by all devices. Also, since some devices write output files when opened, there may be an extra blank page written (:title:`pdfwrite`, :title:`ps2write`, :title:`eps2write`, :title:`pxlmono`, :title:`pxlcolor`).
+
+As noted above, when using MS Windows console (command.com or cmd.exe), you will have to double the ``%`` character since the ``%`` is used by that shell to prefix variables for substitution, e.g.,
+
+
+.. code-block:: bash
+
+ gswin32c -sOutputFile=ABC%%03d.xyz
+
+
+
+.. _O switch:
+
+-o option
+""""""""""""""""""
+
+As a convenient shorthand you can use the ``-o`` option followed by the output file specification as discussed above. The ``-o`` option also sets the :ref:`-dBATCH and -dNOPAUSE options<Interaction related parameters>`. This is intended to be a quick way to invoke Ghostscript to convert one or more input files.
+
+For instance, to convert somefile.ps to JPEG image files, one per page, use:
+
+
+.. code-block:: bash
+
+ gs -sDEVICE=jpeg -o out-%d.jpg somefile.ps
+
+is equivalent to:
+
+.. code-block:: bash
+
+ gs -sDEVICE=jpeg -sOutputFile=out-%d.jpg -dBATCH -dNOPAUSE somefile.ps
+
+
+.. _Use_PaperSize:
+
+
+Choosing paper size
+~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Ghostscript is distributed configured to use U.S. letter paper as its default page size. There are two ways to select other paper sizes from the command line:
+
+If the desired paper size is listed in the section on paper sizes known to Ghostscript below, you can select it as the default paper size for a single invocation of Ghostscript by using the ``-sPAPERSIZE=`` switch, for instance:
+
+.. code-block:: bash
+
+ -sPAPERSIZE=a4
+ -sPAPERSIZE=legal
+
+Otherwise you can set the page size using the pair of switches:
+
+.. code-block:: bash
+
+ -dDEVICEWIDTHPOINTS=w -dDEVICEHEIGHTPOINTS=h
+
+
+Where ``w`` be the desired paper width and ``h`` be the desired paper height in points (units of 1/72 of an inch).
+
+
+Individual documents can (and often do) specify a paper size, which takes precedence over the default size. To force a specific paper size and ignore the paper size specified in the document, select a paper size as just described, and also include the :ref:`-dFIXEDMEDIA switch<FIXEDMEDIA>` on the command line.
+
+The default set of paper sizes will be included in the ``currentpagedevice`` in the ``InputAttributes`` dictionary with each paper size as one of the entries. The last entry in the dictionary (which has numeric keys) is a non-standard (Ghostscript extension) type of PageSize where the array has four elements rather than the standard two elements. This four element array represents a page size range where the first two elements are the lower bound of the range and the second two are the upper bound. By default these are [0, 0] for the lower bound and [16#fffff, 16#fffff] for the upper bound.
+
+The range type of PageSize is intended to allow flexible page size sepcification for non-printer file formats such as JPEG, PNG, TIFF, EPS, ...
+
+For actual printers, either the entire ``InputAttributes`` dictionary should be replaced or the range type entry should not be included. To simplify using the default page sizes in the ``InputAttributes`` dictionary, the command line option ``-dNORANGEPAGESIZE`` can be used. Using this option will result in automatic rotation of the document page if the requested page size matches one of the default page sizes.
+
+When the :ref:`-dFIXEDMEDIA switch<FIXEDMEDIA>` is given on the command line, the ``InputAttributes`` dictionary will only be populated with the single page size. This allows the ``-dPSFitPage`` option to fit the page size requested in a PostScript file to be rotated, scaled and centered for the best fit on the specified page.
+
+
+
+Changing the installed default paper size
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+You can change the installed default paper size on an installed version of Ghostscript, by editing the initialization file ``gs_init.ps``. This file is usually in the ``Resource/Init`` directory somewhere in the search path. See the section on :ref:`finding files<Use_How Ghostscript finds files>` for details.
+
+Find the line:
+
+.. code-block:: bash
+
+ % /DEFAULTPAPERSIZE (a4) def
+
+Then to make A4 the default paper size, uncomment the line to change this to:
+
+.. code-block:: bash
+
+ /DEFAULTPAPERSIZE (a4) def
+
+For a4 you can substitute any :ref:`paper size Ghostscript knows<Known Paper Sizes>`.
+
+This supecedes the previous method of uncommenting the line ``% (a4) ...``.
+
+Sometimes the initialization files are compiled into Ghostscript and cannot be changed.
+
+On Windows and some Linux builds, the default paper size will be selected to be a4 or letter depending on the locale.
+
+
+
+
+.. _Pipes:
+
+Interacting with pipes
+-----------------------------
+
+
+
+As noted above, input files are normally specified on the command line. However, one can also "pipe" input into Ghostscript from another program by using the special file name '``-``' which is interpreted as standard input. Examples:
+
+
+.. code-block:: bash
+
+ {some program producing ps} | gs [options] -
+ zcat paper.ps.gz | gs -
+
+
+When Ghostscript finishes reading from the pipe, it quits rather than going into interactive mode. Because of this, options and files after the '``-``' in the command line will be ignored.
+
+On Unix and MS Windows systems you can send output to a pipe in the same way. For example, to pipe the output to ``lpr``, use the command:
+
+
+.. code-block:: bash
+
+ gs -q -sOutputFile=- | lpr
+
+In this case you must also use the ``-q`` switch to prevent Ghostscript from writing messages to standard output which become mixed with the intended output stream.
+
+Also, using the ``-sstdout=%stderr`` option is useful, particularly with input from PostScript files that may print to stdout.
+
+Similar results can be obtained with the ``%stdout`` and ``%pipe%`` filedevices. The example above would become:
+
+
+.. code-block:: bash
+
+ gs -sOutputFile=%stdout -q | lpr
+
+or:
+
+.. code-block:: bash
+
+ gs -sOutputFile=%pipe%lpr
+
+
+(again, doubling the ``%`` character on MS Windows systems.)
+
+In the last case, ``-q`` isn't necessary since Ghostscript handles the pipe itself and messages sent to stdout will be printed as normal.
+
+
+
+Using Ghostscript with PDF files
+----------------------------------------------------------
+
+
+Ghostscript is normally built to interpret both PostScript and PDF files, examining each file to determine automatically whether its contents are PDF or PostScript. All the normal switches and procedures for interpreting PostScript files also apply to PDF files, with a few exceptions. In addition, the ``pdf2ps`` utility uses Ghostscript to convert PDF to (Level 2) PostScript.
+
+
+Switches for PDF files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Here are some command line options specific to PDF:
+
+``-dNEWPDF``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+From release 9.55.0 Ghostscript incorporates two complete PDF interpreters; the original long-standing interpreter is written in PostScript but there is now a new interpreter written in C.
+At present the old PostScript-based interpreter remains the default, in future releases the new C-based interpreter will become the default, though we would encourage people to experiment with the new interpreter and send us feedback. While there are two interpreters the command-line switch NEWPDF will allow selection of the existing interpreter when false and the new interpreter when true.
+
+``-dPDFINFO``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Starting with release 9.56.0 this new switch will work with the PDF interpreter (GhostPDF) and with the PDF interpreter integrated into Ghostscript. When this switch is set the interpreter will emit information regarding the file, similar to that produced by the old pdf_info.ps program in the 'lib' folder.
+The format is not entirely the same, and the search for fonts and spot colours is 'deeper' than the old program; pdf_info.ps stops at the page level whereas the PDFINFO switch will descend into objects such as Forms, Images, type 3 fonts and Patterns. In addition different instances of fonts with the same name are now enumerated.
+
+Unlike the pdf_info.ps program there is no need to add the input file to the list of permitted files for reading (using --permit-file-read).
+
+``-dPDFFitPage``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Rather than selecting a PageSize given by the PDF MediaBox, BleedBox (see -``dUseBleedBox``), TrimBox (see ``-dUseTrimBox``), ArtBox (see ``-dUseArtBox``), or CropBox (see ``-dUseCropBox``), the PDF file will be scaled to fit the current device page size (usually the default page size).
+This is useful for creating fixed size images of PDF files that may have a variety of page sizes, for example thumbnail images.
+
+This option is also set by the ``-dFitPage`` option.
+
+
+``-dPrinted`` & ``-dPrinted=false``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Determines whether the file should be displayed or printed using the "screen" or "printer" options for annotations and images. With ``-dPrinted``, the output will use the file's "print" options; with ``-dPrinted=false``, the output will use the file's "screen" options. If neither of these is specified, the output will use the screen options for any output device that doesn't have an ``OutputFile`` parameter, and the printer options for devices that do have this parameter.
+
+``-dUseBleedBox``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Sets the page size to the BleedBox rather than the MediaBox. defines the region to which the contents of the page should be clipped when output in a production environment. This may include any extra bleed area needed to accommodate the physical limitations of cutting, folding, and trimming equipment. The actual printed page may include printing marks that fall outside the bleed box.
+
+``-dUseTrimBox``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Sets the page size to the TrimBox rather than the MediaBox. The trim box defines the intended dimensions of the finished page after trimming. Some files have a TrimBox that is smaller than the MediaBox and may include white space, registration or cutting marks outside the CropBox. Using this option simulates appearance of the finished printed page.
+
+``-dUseArtBox``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Sets the page size to the ArtBox rather than the MediaBox. The art box defines the extent of the page's meaningful content (including potential white space) as intended by the page's creator. The art box is likely to be the smallest box. It can be useful when one wants to crop the page as much as possible without losing the content.
+
+``-dUseCropBox``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Sets the page size to the CropBox rather than the MediaBox. Unlike the other "page boundary" boxes, CropBox does not have a defined meaning, it simply provides a rectangle to which the page contents will be clipped (cropped). By convention, it is often, but not exclusively, used to aid the positioning of content on the (usually larger, in these cases) media.
+
+``-sPDFPassword=password``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Sets the user or owner password to be used in decoding encrypted PDF files. For files created with encryption method 4 or earlier, the password is an arbitrary string of bytes; with encryption method 5 or later, it should be text in either UTF-8 or your locale's character set (Ghostscript tries both).
+
+
+``-dShowAnnots=false``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Don't enumerate annotations associated with the page ``Annots`` key. Annotations are shown by default.
+
+In addition, finer control is available by defining an array ``/ShowAnnotTypes``. Annotation types listed in this array will be drawn, whilst those not listed will not be drawn.
+
+To use this feature: ``-c "/ShowAnnotTypes [....] def" -f <input file>``
+
+Where the array can contain one or more of the following names: ``/Stamp``, ``/Squiggly``, ``/Underline``, ``/Link``, ``/Text``, ``/Highlight``, ``/Ink``, ``/FreeText``, ``/StrikeOut`` and ``/stamp_dict``.
+
+For example, adding the follow to the command line: ``-c "/ShowAnnotTypes [/Text /UnderLine] def" -f <input file>`` would draw only annotations with the subtypes "Text" and "UnderLine".
+
+``-dShowAcroForm=false``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Don't show annotations from the Interactive Form Dictionary (AcroForm dictionary). By default, AcroForm processing is now enabled because Adobe Acrobat does this. This option is provided to restore the previous behavior which corresponded to older Acrobat.
+
+``-dNoUserUnit``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Ignore ``UserUnit`` parameter. This may be useful for backward compatibility with old versions of Ghostscript and Adobe Acrobat, or for processing files with large values of ``UserUnit`` that otherwise exceed implementation limits.
+
+``-dRENDERTTNOTDEF``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+If a glyph is not present in a font the normal behaviour is to use the /.notdef glyph instead. On TrueType fonts, this is often a hollow sqaure. Under some conditions Acrobat does not do this, instead leaving a gap equivalent to the width of the missing glyph, or the width of the /.notdef glyph if no /Widths array is present. Ghostscript now attempts to mimic this undocumented feature using a user parameter ``RenderTTNotdef``. The PDF interpreter sets this user parameter to the value of ``RENDERTTNOTDEF`` in systemdict, when rendering PDF files. To restore rendering of /.notdef glyphs from TrueType fonts in PDF files, set this parameter to true.
+
+
+These command line options are no longer specific to PDF, but have some specific differences with PDF files:
+
+
+``-dFirstPage=pagenumber``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+Begin on the designated page of the document. Pages of all documents in PDF collections are numbered sequentionally.
+
+
+``-dLastPage=pagenumber``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+Stop after the designated page of the document. Pages of all documents in PDF collections are numbered sequentionally.
+
+
+.. note::
+
+ The PDF and XPS interpreters allow the use of a ``-dLastPage`` less than ``-dFirstPage``. In this case the pages will be processed backwards from LastPage to FirstPage.
+
+
+
+``-sPageList=pageranges``
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+Page ranges are separated by a comma '`,`'. Each range of pages can consist of:
+
+- (a) a single page number.
+- (b) a range with a starting page number, followed by a dash '`-`' followed by an ending page number.
+- (c) a range with a starting page number, followed by a dash '`-`' which ends at the last page.
+- (d) the keyword "even" or "odd", which optionally can be followed by a colon ':' and a page range. If there is no page range then all even or odd pages are processed in forward order.
+- (e) a range with an initial dash '`-`' followed by and ending page number which starts at the last page and ends at the specified page (PDF and XPS only).
+
+For example:
+
+
+.. code-block:: bash
+
+ -sPageList=1,3,5 indicates that pages 1, 3 and 5 should be processed.
+ -sPageList=5-10 indicates that pages 5, 6, 7, 8, 9 and 10 should be processed.
+ -sPageList=1,5-10,12- indicates that pages 1, 5, 6, 7, 8, 9, 10 and 12 onwards should be processed.
+ -sPageList=odd:3-7,9-,-1,8 processes pages 3, 5, 7, 9, 10, 11, ..., last, last, last-1, ..., 1, 8
+
+
+.. note::
+
+ Use of ``PageList`` overrides ``FirstPage`` and/or ``LastPage``, if you set these as well as ``PageList`` they will be ignored.
+
+
+Be aware that using the ``%d`` syntax for ``-sOutputFile=...`` does not reflect the page number in the original document. If you chose (for example) to process even pages by using ``-sPageList=even``, then the output of ``-sOutputFile=out%d.png`` would still be ``out1.png``, ``out2.png``, ``out3.png`` etc.
+
+For PostScript or PCL input files, the list of pages must be given in increasing order, you cannot process pages out of order or repeat pages and this will generate an error. PCL and PostScript require that all the pages must be interpreted, however since only the requested pages are rendered, this can still lead to savings in time.
+
+The PDF and XPS interpreters handle this in a slightly different way. Because these file types provide for random access to individual pages in the document these inerpreters only need to process the required pages, and can do so in any order.
+
+Because the PostScript and PCL interpreters cannot determine when a document terminates, sending multple files as input on the command line does not reset the ``PageList`` between each document, each page in the second and subsequent documents is treated as following on directly from the last page in the first document. The PDF interpreter, however, does not work this way. Since it knows about individual PDF files the ``PageList`` is applied to each PDF file separately. So if you were to set ``-sPageList=1,2`` and then send two PDF files, the result would be pages 1 and 2 from the first file, and then pages 1 and 2 from the second file. The PostScript interpreter, by contrast, would only render pages 1 and 2 from the first file. This means you must exercise caution when using this switch, and probably should not use it at all when processing a mixture of PostScript and PDF files on the same command line.
+
+
+
+Problems interpreting a PDF file
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Occasionally you may try to read or print a 'PDF' file that Ghostscript doesn't recognize as PDF, even though the same file can be opened and interpreted by an Adobe Acrobat viewer. In many cases, this is because of incorrectly generated PDF. Acrobat tends to be very forgiving of invalid PDF files. Ghostscript tends to expect files to conform to the standard. For example, even though valid PDF files must begin with %PDF, Acrobat will scan the first 1000 bytes or so for this string, and ignore any preceding garbage.
+
+In the past, Ghostscript's policy has been to simply fail with an error message when confronted with these files. This policy has, no doubt, encouraged PDF generators to be more careful. However, we now recognize that this behavior is not very friendly for people who just want to use Ghostscript to view or print PDF files. Our new policy is to try to render broken PDF's, and also to print a warning, so that Ghostscript is still useful as a sanity-check for invalid files.
+
+
+
+PDF files from standard input
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The PDF language, unlike the PostScript language, inherently requires random access to the file. If you provide PDF to standard input using the special filename :ref:`'-'<Pipes>`, Ghostscript will copy it to a temporary file before interpreting the PDF.
+
+
+
+
+
+Using Ghostscript with EPS files
+----------------------------------------------------------
+
+Encapsulated PostScript (EPS) files are intended to be incorporated in other PostScript documents and may not display or print on their own. An EPS file must conform to the Document Structuring Conventions, must include a ``%%BoundingBox`` line to indicate the rectangle in which it will draw, must not use PostScript commands which will interfere with the document importing the EPS, and can have either zero pages or one page. Ghostscript has support for handling EPS files, but requires that the ``%%BoundingBox`` be in the header, not the trailer. To customize EPS handling, see :ref:`EPS parameters<EPS parameters>`.
+
+For the official description of the EPS file format, please refer to the Adobe documentation.
+
+
+Using Ghostscript with overprinting and spot colors
+----------------------------------------------------------
+
+In general with PostScript and PDF interpreters, the handling of overprinting and spot colors depends upon the process color model of the :ref:`output device<Selecting an output device>`. Devices that produce gray or RGB output have an additive process color model. Devices which produce CMYK output have a subtractive process color model. Devices may, or may not, have support for spot colors.
+
+.. note::
+
+ The differences in appearance of files with overprinting and spot colors caused by the differences in the color model of the output device are part of the PostScript and PDF specifications. They are not due to a limitation in the implementation of Ghostscript or its output devices.
+
+
+With devices which use a subtractive process color model, both PostScript and PDF allow the drawing of objects using colorants (inks) for one or more planes without affecting the data for the remaining colorants. Thus the inks for one object may overprint the inks for another object. In some cases this produces a transparency like effect. (The effects of overprinting should not be confused with the PDF 1.4 blending operations which are supported for all output devices.) Overprinting is not allowed for devices with an additive process color model. With files that use overprinting, the appearance of the resulting image can differ between devices which produce RGB output versus devices which produce CMYK output. Ghostscript automatically overprints (if needed) when the output device uses a subtractive process color model. For example, if the file is using overprinting, differences can be seen in the appearance of the output from the :ref:`tiff24nc and tiff32nc devices<Devices_TIFF>` which use an RGB and a CMYK process color models.
+
+Most of the Ghostscript :ref:`output devices<Devices.htm>` do not have file formats which support spot colors. Instead spot colors are converted using the tint transform function contained within the color space definition.. However there are several devices which have support for spot colors. The PSD format (Adobe Photoshop) produced by the :ref:`psdcmyk device<Devices_PSD>` contains both the raster data plus an equivalent CMYK color for each spot color. This allows Photoshop to simulate the appearance of the spot colors. The :ref:`display device (MS Windows, OS/2, gtk+)<Devices_Display_Device>` can be used with different color models: Gray, RGB, CMYK only, or CMYK plus spot colors (separation). The display device, when using its CMYK plus spot color (separation) mode, also uses an equivalent CMYK color to simulate the appearance of the spot color. The :ref:`tiffsep device<Devices_TIFF>` creates output files for each separation (CMYK and any spot colors present). It also creates a composite CMYK file using an equivalent CMYK color to simulate the appearance of spot colors. The :ref:`xcfcmyk device<Devices_XCF>` creates output files with spot colors placed in separate alpha channels. (The XCF file format does not currently directly support spot colors.)
+
+Overprinting with spot colors is not allowed if the tint transform function is being used to convert spot colors. Thus if spot colors are used with overprinting, then the appearance of the result can differ between output devices. One result would be obtained with a CMYK only device and another would be obtained with a CMYK plus spot color device. In a worst case situation where a file has overprinting with both process (CMYK) and spot colors, it is possible to get three different appearances for the same input file using the :ref:`tiff24nc<Devices_TIFF>` (RGB), :ref:`tiff32nc<Devices_TIFF>` (CMYK), and :ref:`tiffsep<Devices_TIFF>` (CMYK plus spot colors) devices.
+
+
+.. note::
+ In Adobe Acrobat, viewing of the effects of overprinting is enabled by the 'Overprint Preview' item in the 'Advanced' menu. This feature is not available in the free Acrobat Reader. The free Acrobat Reader also uses the tint transform functions to convert spot colors to the appropriate alternate color space.
+
+
+
+.. _Use_How Ghostscript finds files:
+
+How Ghostscript finds files
+----------------------------------------------------------
+
+
+When looking for initialization files (``gs_*.ps``, ``pdf_*.ps``), font files, the ``Fontmap`` file, files named on the command line, and resource files, Ghostscript first tests whether the file name specifies an absolute path.
+
+
+
+Testing a file name for an absolute path
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - System
+ - Does the name ...
+ * - Unix
+ - Begin with ``/`` ?
+ * - MS Windows
+ - Have ``:`` as its second character, or begin with ``/``, ``\``, or ``//servername/share/`` ?
+ * - VMS
+ - Contain a node, device, or root specification?
+
+
+If the test succeeds, Ghostscript tries to open the file using the name given. Otherwise it tries directories in this order:
+
+#. The current directory if enabled by the :ref:`-P switch<P switch>`.
+#. The directories specified by :ref:`-I switches<I switch>` in the command line, if any.
+#. The directories specified by the ``GS_LIB`` environment variable, if any.
+#. If built with ``COMPILE_INITS=1`` (currently the default build) the files in the ``%rom%Resource/`` and ``%rom%iccprofiles/`` directories are built into the executable.
+#. The directories specified by the ``GS_LIB_DEFAULT`` macro (if any) in the makefile when this executable was built.
+
+
+``GS_LIB_DEFAULT``, ``GS_LIB``, and the ``-I`` parameter may specify either a single directory or a list of directories separated by a character appropriate for the operating system ("``:``" on Unix systems, "``,``" on VMS systems, and "``;``" on MS Windows systems). By default, Ghostscript no longer searches the current directory first but provides ``-P`` switch for a degree of backward compatibility.
+
+Note that Ghostscript does not use this file searching algorithm for the ``run`` or ``file`` operators: for these operators, it simply opens the file with the name given. To run a file using the searching algorithm, use ``runlibfile`` instead of ``run``.
+
+
+
+.. _PS resources:
+
+Finding PostScript Level 2 resources
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Adobe specifies that resources are installed in a single directory. Ghostscript instead maintains a list of resource directories, and uses an extended method for finding resource files.
+
+The search for a resource file depends on whether the value of the system parameter ``GenericResourceDir`` specifies an absolute path. The user may set it as explained in :ref:`resource related parameters<resource related parameters>`.
+
+If the user doesn't set the system parameter ``GenericResourceDir``, or use the ``-sGenericResourceDir=`` command line option, Ghostscript creates a default value for it by looking on the directory paths explained in `How Ghostscript finds files`_, excluding the current directory. The first path with Resource in it is used, including any prefix up to the path separator character following the string Resource. For example, when ``COMPILE_INITS=1`` (the current default build), if the first path is ``%rom%Resource/Init/``, then the ``GenericResourceDir`` systemparam will be set to ``%rom%Resource/`` by default.
+
+If the value of the system parameter ``GenericResourceDir`` is an absolute path (the default), Ghostscript assumes a single resource directory. It concatenates:
+
+
+#. The value of the system parameter ``GenericResourceDir``.
+#. The name of the resource category (for instance, ``CMap``).
+#. The name of the resource instance (for instance, ``Identity-H``).
+
+If the value of the system parameter GenericResourceDir is not an absolute path, Ghostscript assumes multiple resource directories. In this case it concatenates:
+
+#. A directory listed in the section `How Ghostscript finds files`_, except the current directory.
+#. The value of the system parameter ``GenericResourceDir``.
+#. The name of the resource category (for instance, ``CMap``).
+#. The name of the resource instance (for instance, ``Identity-H``).
+
+
+Due to possible variety of the part 1, the first successful combination is used. For example, if the value of the system parameter ``GenericResourceDir`` is the string ``../Resource/`` (or its equivalent in the file path syntax of the underlying platform), Ghostscript searches for ``../Resource/CMap/Identity-H`` from all directories listed in `How Ghostscript finds files`_. So in this example, if the user on a Windows platform specifies the command line option ``-I.;../gs/lib;c:/gs8.50/lib``, Ghostscript searches for ``../gs/Resource/CMap/Identity-H`` and then for ``c:/gs8.50/Resource/CMap/Identity-H``.
+
+To get a proper platform dependent syntax Ghostscript inserts the value of the system parameter ``GenericResourcePathSep`` (initially "``/``" on Unix and Windows, "``:``" on MacOS, "``.``" or "``]``" on OpenVMS). The string ``../Resource`` is replaced with a platform dependent equivalent.
+
+In the case of multiple resource directories, the default ``ResourceFileName`` procedure retrieves either a path to the first avaliable resource, or if the resource is not available it returns a path starting with ``GenericResourceDir``. Consequently Postscript installers of Postscript resources will overwrite an existing resource or add a new one to the first resource directory.
+
+
+
+To look up fonts, after exhausting the search method described in the :ref:`next section<Font lookup>`, it concatenates together:
+
+#. the value of the system parameter FontResourceDir (initially ``/Resource/Font/``).
+#. the name of the resource font (for instance, *Times-Roman*).
+
+.. note::
+
+ Even although the system parameters are named "somethingDir", they are not just plain directory names: they have "``/``" on the end, so that they can be concatenated with the category name or font name.
+
+
+.. _Use_Font lookup:
+
+Font lookup
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript has a slightly different way to find the file containing a font with a given name. This rule uses not only the search path defined by ``-I``, ``GS_LIB``, and ``GS_LIB_DEFAULT`` as :ref:`described above<How Ghostscript finds files>`, but also the directory that is the value of the ``FontResourceDir`` system parameter, and an additional list of directories that is the value of the ``GS_FONTPATH`` environment variable (or the value provided with the ``-sFONTPATH= switch``, if present).
+
+
+At startup time, Ghostscript reads in the ``Fontmap`` files in every directory on the search path (or in the list provided with the ``-sFONTMAP=`` switch, if present): these files are catalogs of fonts and the files that contain them. (See the :ref:`documentation of fonts<Fonts.htm>` for details.) Then, when Ghostscript needs to find a font that isn't already loaded into memory, it goes through a series of steps.
+
+#. First, it looks up the font name in the combined Fontmaps. If there is an entry for the desired font name, and the file named in the entry can be found in some directory on the general search path (defined by ``-I``, ``GS_LIB``, and ``GS_LIB_DEFAULT``), and the file is loaded successfully, and loading it defines a font of the desired name, that is the end of the process.
+
+#. If this process fails at any step, Ghostscript looks for a file whose name is the concatenation of the value of the ``FontResourceDir`` system parameter and the font name, with no extension. If such a file exists, can be loaded, and defines a font of the desired name, that again is the end. The value of ``FontResourceDir`` is normally the string ``/Resource/Font/``, but it can be changed with the ``setsystemparams`` operator: see the PostScript Language Reference Manual for details.
+
+#. If that fails, Ghostscript then looks for a file on the general search path whose name is the desired font name, with no extension. If such a file exists, can be loaded, and defines a font of the desired name, that again is the end.
+
+#. If that too fails, Ghostscript looks at the ``GS_FONTPATH`` environment variable (or the value provided with the ``-sFONTPATH=`` switch, if present), which is also a list of directories. It goes to the first directory on the list, and it's descendants, looking for all files that appear to contain PostScript fonts (also Truetype fonts); it then adds all those files and fonts to the combined Fontmaps, and starts over.
+
+#. If scanning the first ``FONTPATH`` directory doesn't produce a file that provides the desired font, it adds the next directory on the ``FONTPATH`` list, and so on until either the font is defined successfully or the list is exhausted.
+
+#. Finally, if all else fails, it will try to find a substitute for the font from among the standard 35 fonts.
+
+.. note::
+ :ref:`CID fonts<CID Fonts>` (e.g. Chinese, Japanese and Korean) are found using a different method.
+
+
+
+
+Differences between search path and font path
+""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+.. list-table::
+ :header-rows: 1
+ :widths: 50 50
+
+ * - Search path
+ - Font path
+
+ * - ``-I switch``
+ - ``-sFONTPATH= switch``
+
+ * - ``GS_LIB`` and ``GS_LIB_DEFAULT`` environment variables
+ - ``GS_FONTPATH`` environment variable
+
+ * - Consulted first
+ - Consulted only if search path and ``FontResourceDir`` don't provide the file.
+
+ * - Font-name-to-file-name mapping given in Fontmap files;
+
+ aliases are possible, and there need not be any relation
+
+ between the font name in the Fontmap and the ``FontName`` in the file.
+
+ - Font-name-to-file-name mapping is implicit – the ``FontName`` in the file is used.
+
+ Aliases are not possible.
+
+ * - Only fonts and files named in Fontmap are used.
+ - Every Type 1 font file in each directory is available;
+
+ if TrueType fonts are supported (the ``ttfont.dev`` feature was included
+
+ when the executable was built), they are also available.
+
+
+
+If you are using one of the following types of computer, you may wish to set the environment variable ``GS_FONTPATH`` to the value indicated so that Ghostscript will automatically acquire all the installed Type 1 (and, if supported, TrueType) fonts (but see below for notes on systems marked with "*"):
+
+
+Suggested GS_FONTPATH for different systems
+""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+.. list-table::
+ :header-rows: 1
+ :widths: 50 50
+
+
+ * - System type
+ - GS_FONTPATH
+
+ * - Digital Unix
+ - /usr/lib/X11/fonts/Type1Adobe
+
+ * - Ultrix
+ - /usr/lib/DPS/outline/decwin
+
+ * - HP-UX 9
+ - /usr/lib/X11/fonts/type1.st/typefaces
+
+ * - IBM AIX
+ - /usr/lpp/DPS/fonts/outlines
+
+ /usr/lpp/X11/lib/X11/fonts/Type1
+
+ /usr/lpp/X11/lib/X11/fonts/Type1/DPS
+
+ * - NeXT
+ - /NextLibrary/Fonts/outline
+
+ * - SGI IRIX :ref:`*<GS_FONTPATH footnote 1>`
+ - /usr/lib/DPS/outline/base
+
+ /usr/lib/X11/fonts/Type1
+
+ * - SunOS 4.x (NeWSprint only)
+ - newsprint_2.5/SUNWsteNP/reloc/$BASEDIR/NeWSprint/
+
+ small_openwin/lib/fonts
+
+ * - SunOS 4.x :ref:`**<GS_FONTPATH footnote 2>`
+ - /usr/openwin/lib/X11/fonts/Type1/outline
+
+ * - Solaris 2.x :ref:`**<GS_FONTPATH footnote 2>`
+ - /usr/openwin/lib/X11/fonts/Type1/outline
+
+ * - VMS
+ - SYS$COMMON:[SYSFONT.XDPS.OUTLINE]
+
+
+
+.. _GS_FONTPATH footnote 1:
+
+:ref:`**<GS_FONTPATH footnote 1>` On SGI IRIX systems, you must use ``Fontmap.SGI`` in place of ``Fontmap`` or ``Fontmap.GS``, because otherwise the entries in Fontmap will take precedence over the fonts in the FONTPATH directories.
+
+.. _GS_FONTPATH footnote 2:
+
+:ref:`**<GS_FONTPATH footnote 2>` On Solaris systems simply setting ``GS_FONTPATH`` or using ``-sFONTPATH=`` may not work, because for some reason some versions of Ghostscript can't seem to find any of the Type1 fonts in ``/usr/openwin/lib/X11/fonts/Type1/outline``. (It says: "15 files, 15 scanned, 0 new fonts". We think this problem has been fixed in Ghostscript version 6.0, but we aren't sure because we've never been able to reproduce it.) See ``Fontmap.Sol`` instead. Also, on Solaris 2.x it's probably not worth your while to add Sun's fonts to your font path and Fontmap. The fonts Sun distributes on Solaris 2.x in the directories: ``/usr/openwin/lib/X11/fonts/Type1`` & ``/usr/openwin/lib/X11/fonts/Type1/outline`` are already represented among the ones distributed as part of Ghostscript; and on some test files, Sun's fonts have been shown to cause incorrect displays with Ghostscript.
+
+
+These paths may not be exactly right for your installation; if the indicated directory doesn't contain files whose names are familiar font names like Courier and Helvetica, you may wish to ask your system administrator where to find these fonts.
+
+Adobe Acrobat comes with a set of fourteen Type 1 fonts, on Unix typically in a directory called ``/Acrobat3/Fonts``. There is no particular reason to use these instead of the corresponding fonts in the Ghostscript distribution (which are of just as good quality), except to save about a megabyte of disk space, but the installation documentation explains how to do it on Unix.
+
+
+
+CID fonts
+~~~~~~~~~~~~~~
+
+CID fonts are PostScript resources containing a large number of glyphs (e.g. glyphs for Far East languages, Chinese, Japanese and Korean). Please refer to the PostScript Language Reference, third edition, for details.
+
+CID font resources are a different kind of PostScript resource from fonts. In particular, they cannot be used as regular fonts. CID font resources must first be combined with a CMap resource, which defines specific codes for glyphs, before it can be used as a font. This allows the reuse of a collection of glyphs with different encodings.
+
+The simplest method to request a font composed of a CID font resource and a CMap resource in a PostScript document is:
+
+
+.. code-block:: bash
+
+ /CIDFont-CMap findfont
+
+
+where ``CIDFont`` is a name of any CID font resource, and ``CMap`` is a name of a CMap resource designed for the same character collection. The interpreter will compose the font automatically from the specified CID font and CMap resources. Another method is possible using the ``composefont`` operator.
+
+CID fonts must be placed in the ``/Resource/CIDFont/`` directory. They are not found using `Font lookup`_ on the search path or font path.
+
+
+
+
+
+
+CID font substitution
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Automatic CIDFont Substitution
+""""""""""""""""""""""""""""""""""
+
+In general, it is highly recommended that CIDFonts used in the creation of PDF jobs should be embedded or available to Ghostscript as CIDFont resources, this ensures that the character set, and typeface style are as intended by the author.
+
+In cases where the original CIDFont is not available, the next best option is to provide Ghostscript with a mapping to a suitable alternative CIDFont - see below for details on how this is achieved. However, Ghostscript does provide the ability to use a "fall back" CIDFont substitute. As shipped, this uses the DroidSansFallback.ttf font. This font contains a large number of glyphs covering several languages, but it is not comprehensive. There is, therefore, a chance that glyphs may be wrong, or missing in the output when this fallback is used.
+
+Internally, the font is referenced as CIDFont resource called ``CIDFallBack``, thus a different fallback from ``DroidSansFallback.ttf`` can be specified adding a mapping to your cidfmap file (see below for details) to map the name "CIDFallBack" as you prefer. For ``CIDFallBack`` the mapping must be a TrueType font or TrueType collection, it cannot be a Postscript CIDFont file.
+
+As with any font containing large numbers of glyphs, ``DroidSansFallback.ttf`` is quite large (~3.5Mb at the of writing). If this is space you cannot afford in your use of Ghostscript, you can simply delete the file from: ``Resource/CIDFSubst/DroidSansFallback.ttf``. The build system will cope with the file being removed, and the initialization code will avoid adding the internal fall back mapping if the file is missing.
+
+If ``DroidSansFallback.ttf`` is removed, and no other ``CIDFallBack`` mapping is supplied, the final "fall back" is to use a "dumb" bullet CIDFont, called ``ArtifexBullet``. As the name suggests, this will result in all the glyphs from a missing CIDFont being replaced with a simple bullet point.
+
+This type of generic fall back CIDFont substitution can be very useful for viewing and proofing jobs, but may not be appropriate for a "production" workflow, where it is expected that only the original font should be used. For this situation, you can supply Ghostscript with the command line option: ``-dPDFNOCIDFALLBACK``. By combining ``-dPDFNOCIDFALLBACK`` with ``-dPDFSTOPONERROR`` a production workflow can force a PDF with missing CIDFonts to error, and avoid realising a CIDFont was missing only after printing.
+
+The directory in which the fallback TrueType font or collection can be specified by the command line parameter ``-sCIDFSubstPath="path/to/TTF"``, or with the environment variable ``CIDFSUBSTPATH``. The file name of the substitute TrueType font can be specified using the command line parameter ``-sCIDFSubstFont="TTF file name"`` or the environment variable ``CIDFSUBSTFONT``.
+
+
+
+Explicit CIDFont Substitution
+""""""""""""""""""""""""""""""""""
+
+Substitution of CID font resources is controlled, by default, by the Ghostscript configuration file ``Resource/Init/cidfmap``, which defines a CID font resource map.
+
+The file forms a table of records, each of which should use one of three formats, explained below. Users may modify ``Resource/Init/cidfmap`` to configure Ghostscript for a specific need. Note that the default Ghostscript build includes such configuration and resource files in a rom file system built into the executable. So, to ensure your changes have an effect, you should do one of the following: rebuild the executable; use the "``-I``" command line option to add the directory containing your modified file to Ghostscript's search path; or, finally, build Ghostscript to use disk based resources.
+
+
+Format 1
+""""""""""""""""""""""""""""""""""
+
+To substitute a CID font resource with another CID font resource, add a record like this:
+
+
+.. code-block:: bash
+
+ /Substituted /Original ;
+
+
+where ``Substituted`` is a name of CID font resource being used by a document, and ``Original`` is a name of an available CID font resource. Please pay attention that both them must be designed for same character collection. In other words, you cannot substitute a Japanese CID font resource with a Korean CID font resource, etc. CMap resource names must not appear in ``lib/cidfmap``. The trailing semicolon and the space before it are both required.
+
+
+Format 2
+""""""""""""""""""""""""""""""""""
+
+To substitute (emulate) a CID font resource with a TrueType font file, add a record like this:
+
+.. code-block:: bash
+
+ /Substituted << keys&values >> ;
+
+Where ``keys&values`` are explained in the table below.
+
+
+.. list-table::
+ :header-rows: 1
+ :widths: 15 15 70
+
+
+ * - Key
+ - Type
+ - Description
+
+ * - ``/Path``
+ - string
+ - A path to a TrueType font file.
+
+ This must be an absolute path. If using -dSAFER, the directory containing the font file must be on one of the permitted paths.
+
+ * - ``/FileType``
+ - name
+ - Must be ``/TrueType``.
+
+ * - ``/SubfontID``
+ - integer
+ - (optional) Index of the font in font collection, such as TTC.
+
+ This is ignored if Path doesn't specify a collection. The first font in a collection is 0. Default value is 0.
+
+ * - ``/CSI``
+ - array of 2 or 3 elements
+ - (required) Information for building ``CIDSystemInfo``.
+
+ If the array consists of 2 elements, the first element is a string,
+
+ which specifies ``Ordering``; the second element is a number, which specifies ``Supplement``.
+
+ |
+
+ If the array consists of 3 elements, the first element is a string,
+
+ which specifies ``Registry``; the second element is a string,
+
+ which specifies ``Ordering``; the third element is a number,
+
+ which specifies ``Supplement``.
+
+
+Currently only CIDFontType 2 can be emulated with a TrueType font. The TrueType font must contain enough characters to cover an Adobe character collection, which is specified in ``Ordering`` and used in documents.
+
+
+Format 3
+""""""""""""""
+
+To point Ghostscript at a specific CIDFont file outside it's "normal" resource search path :
+
+
+
+.. code-block:: bash
+
+ /CIDName (path/to/cid/font/file) ;
+
+
+where ``CIDName`` is a name of CID font resource being used by a document, and ``path/to/cid/font/file`` is the path to the Postscript CIDFont file, including the file name. NOTE: the CIDFont file, when executed by the Postscript interpreter, must result in a CIDFont resource being defined whose CIDFontName matches the "CIDName" key for the current record. I.E. an entry with the key /PingHei-Bold must reference a file which creates a CIDFont resource called "PingHei-Bold". To substitute a file based CIDFont for a differently named CIDFont, use formats 1 and 3 in combination (the order of the entries is not important).
+
+The trailing semicolon and the space before it are both required.
+
+
+
+Examples
+""""""""""
+
+Format 1
+
+.. code-block:: bash
+
+ /Ryumin-Medium /ShinGo-Bold ;
+ /Ryumin-Light /MS-Mincho ;
+ Format 2:
+ /Batang << /FileType /TrueType /Path (C:/WINDOWS/fonts/batang.ttc) /SubfontID 0 /CSI [(Korea1) 3] >> ;
+ /Gulim << /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 0 /CSI [(Korea1) 3] >> ;
+ /Dotum << /FileType /TrueType /Path (C:/WINDOWS/fonts/gulim.ttc) /SubfontID 2 /CSI [(Korea1) 3] >> ;
+
+Format 1 & 2
+
+.. code-block:: bash
+
+ /SimSun << /FileType /TrueType /Path (C:/WINDOWS/fonts/simsun.ttc) /SubfontID 0 /CSI [(GB1) 2] >> ;
+ /SimHei << /FileType /TrueType /Path (C:/WINDOWS/fonts/simhei.ttf) /SubfontID 0 /CSI [(GB1) 2] >> ;
+ /STSong-Light /SimSun ;
+ /STHeiti-Regular /SimHei ;
+ Format 3:
+ /PMingLiU (/usr/local/share/font/cidfont/PMingLiU.cid) ;
+
+Format 1 & 3
+
+.. code-block:: bash
+
+ /Ryumin-Light /PMingLiU ;
+ /PMingLiU (/usr/local/share/font/cidfont/PMingLiU.cid) ;
+
+
+
+The win32 installer of recent version of Ghostscript has a checkbox for "Use Windows TrueType fonts for Chinese, Japanese and Korean" to optionally update ``lib/cidfmap`` with the common CJK fonts provided by Microsoft products. The script can also be run separately (e.g. against a network drive with windows CJK fonts):
+
+.. code-block:: bash
+
+ gswin32c -q -dBATCH -sFONTDIR=c:/windows/fonts -sCIDFMAP=lib/cidfmap lib/mkcidfm.ps
+
+Note that the font file path uses Postscript syntax. Because of this, backslashes in the paths must be represented as a double backslash.
+
+This can complicate substitutions for fonts with non-Roman names. For example, if a PDF file asks for a font with the name ``/#82l#82r#83S#83V#83b#83N``. This cannot be used directly in a cidfmap file because the #xx notation in names is a PDF-only encoding. Instead, try something like:
+
+.. code-block:: bash
+
+ <82C68272835383568362834E>cvn << /Path (C:/WINDOWS/Fonts/msmincho.ttc) /FileType /TrueType /SubfontID 0 /CSI [(Japan1) 3] >> ;
+
+
+Where ``<82C68272835383568362834E>`` is the same byte sequence converted to a hex string. This lets you specify a name using any sequence of bytes through the encodings available for Postscript strings.
+
+Note that loading truetype fonts directly from ``/Resources/CIDFont`` is no longer supported. There is no reliable way to generate a character ordering for truetype fonts. The 7.0x versions of Ghostscript supported this by assuming a Japanese character ordering. This is replaced in the 8.0x and later releases with the more general ``cidfmap`` mechanism.
+
+The PDF specification requires CID font files to be embedded, however some documents omit them. As a workaround the PDF interpreter applies an additional substitution method when a requested CID font resource is not embedded and it is not available. It takes values of the keys ``Registry`` and ``Ordering`` from the ``CIDFontSystem`` dictionary, and concatenates them with a dash inserted. For example, if a PDF CID font resource specifies:
+
+
+.. code-block:: bash
+
+ /CIDSystemInfo << /Registry (Adobe) /Ordering (CNS1) /Supplement 1 >>
+
+
+the generated subsitituite name is ``Adobe-CNS1``. The latter may look some confusing for a font name, but we keep it for compatibility with older Ghostscript versions, which do so due to a historical reason. Add a proper record to ``lib/cidfmap`` to provide it.
+
+Please note that when a PDF font resource specifies:
+
+.. code-block:: bash
+
+ /Registry (Adobe) /Ordering (Identity)
+
+
+there is no way to determine the language properly. If the CID font file is not embedded, the ``Adobe-Identity`` record depends on the document and a correct record isn't possible when a document refers to multiple Far East languages. In the latter case add individual records for specific CID font names used in the document.
+
+Consequently, if you want to handle any PDF document with non-embedded CID fonts (which isn't a correct PDF), you need to create a suitable ``lib/cidfmap`` by hand, possibly a specific one for each document.
+
+
+
+
+Using Unicode True Type fonts
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Ghostscript can make use of Truetype fonts with a Unicode character set. To do so, you should generate a (NOTE: non-standard!) Postscript or PDF job where the relevant text is encoded as UTF-16. Ghostscript may be used for converting such jobs to other formats (Postscript, PDF, PXL etc). The resulting output will be compliant with the spec (unlike the input).
+
+To render an UTF-16 encoded text, one must do the following:
+
+- Provide a True Type font with Unicode Encoding. It must have a ``cmap`` table with ``platformID`` equals to 3 (Windows), and ``SpecificID`` eqials to 1 (Unicode).
+- Describe the font in ``Resource/Init/cidfmap`` with special values for the ``CSI`` key : ``[(Artifex) (Unicode) 0]``.
+- In the PS or PDF job combine the font with one of CMap ``Identity-UTF16-H`` (for the horizontal writing mode) or ``Identity-UTF16-V`` (for the vertical writing mode). Those CMaps are distributed with Ghostscript in ``Resource/CMap``.
+
+
+Please note that ``/Registry (Adobe) /Ordering (Identity)`` won't properly work for Unicode documents, especially for the searchability feature (see `CID font substitution`_).
+
+
+Temporary files
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+Where Ghostscript puts temporary files
+"""""""""""""""""""""""""""""""""""""""""""
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Platform
+ - Filename
+ - Location
+ * - MS Windows and OpenVMS
+ - _temp_XX.XXX
+ - Current directory
+ * - OS/2
+ - gsXXXXXX
+ - Current directory
+ * - Unix
+ - gs_XXXXX
+ - /tmp
+
+
+You can change in which directory Ghostscript creates temporary files by setting the ``TMPDIR`` or ``TEMP`` environment variable to the name of the directory you want used. Ghostscript currently doesn't do a very good job of deleting temporary files if it exits because of an error; you may have to delete them manually from time to time.
+
+
+
+
+Notes on specific platforms
+----------------------------------
+
+Word size (32 or 64 bits)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The original PostScript language specification, while not stating a specific word size, defines 'typical' limits which make it clear that it was intended to run as a 32-bit environment. Ghostscript was originally coded that way, and the heritage remains within the code base.
+
+Because the Ghostscript PDF interpreter is currently written in PostScript, it proved necessary to add support for 64-bit integers so that we could process PDF files which exceed 2GB in size. This is the only real purpose in adding support for large integers, however since that time, we have made some efforts to allow for the use of 64-bit words; in particular the use of integers, but also lifting the 64K limit on strings and arrays, among other areas.
+
+However this is, obviously, dependent on the operating system and compiler support available. Not all builds of Ghostscript will support 64-bit integers, though some 32-bit builds (eg Windows) will.
+
+Even when the build supports 64-bit words, you should be aware that there are areas of Ghostscript which do not support 64-bit values. Sometimes these are dependent on the build and other times they are inherent in the architecture of Ghostscript (the graphics library does not support 64-bit co-ordinates in device space for example, and most likely never will).
+
+
+.. note ::
+
+ The extended support for 64-bit word size can be disabled by executing 'true .setcpsimode', This is important for checking the output of the Quality Logic test suite (and possibly other test suites) as the tests make assumptions about the sizes of integers (amongst other things). You can run ``/ghostpdl/Resource/Init/gs_cet.ps`` to change Ghostscript's behaviour so that it matches the observed behaviour of Adobe CPSI interpreters.
+
+
+Unix
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The Ghostscript distribution includes some Unix shell scripts to use with Ghostscript in different environments. These are all user-contributed code, so if you have questions, please contact the user identified in the file, not Artifex Software.
+
+``pv.sh``
+""""""""""""""""""""
+ Preview a specified page of a ``dvi`` file in an X window
+
+
+``sysvlp.sh``
+""""""""""""""""""""
+ System V 3.2 lp interface for parallel printer
+
+
+``pj-gs.sh``
+""""""""""""""""""""
+ Printing on an H-P PaintJet under HP-UX
+
+
+``unix-lpr.sh``
+""""""""""""""""""""
+ Queue filter for ``lpr`` under Unix; its documentation is intended for system administrators
+
+
+``lprsetup.sh``
+""""""""""""""""""""
+ Setup for ``unix-lpr.sh``
+
+
+
+VMS
+~~~~~~~~~
+
+To be able to specify switches and file names when invoking the interpreter, define ``gs`` as a foreign command:
+
+
+.. code-block:: bash
+
+ $ gs == "$disk:[directory]gs.exe"
+
+
+where the "disk" and "directory" specify where the Ghostscript executable is located. For instance:
+
+.. code-block:: bash
+
+ $ gs == "$dua1:[ghostscript]gs.exe"
+
+
+On VMS systems, the last character of each "directory" name indicates what sort of entity the "directory" refers to. If the "directory" name ends with a colon "``:``", it is taken to refer to a logical device, for instance:
+
+.. code-block:: bash
+
+ $ define ghostscript_device dua1:[ghostscript_510]
+
+.. code-block:: bash
+
+ $ define gs_lib ghostscript_device:
+
+If the "directory" name ends with a closing square bracket "``]``", it is taken to refer to a real directory, for instance
+
+.. code-block:: bash
+
+ $ define gs_lib dua1:[ghostscript]
+
+Defining the logical ``GS_LIB``:
+
+
+.. code-block:: bash
+
+ $ define gs_lib disk:[directory]
+
+allows Ghostscript to find its initialization files in the Ghostscript directory even if that's not where the executable resides.
+
+
+Although VMS DCL itself converts unquoted parameters to upper case, C programs such as Ghostscript receive their parameters through the C runtime library, which forces all unquoted command-line parameters to lower case. That is, with the command:
+
+.. code-block:: bash
+
+ $ gs -Isys$login:
+
+
+Ghostscript sees the switch as ``-isys$login``, which doesn't work. To preserve the case of switches, quote them like this:
+
+.. code-block:: bash
+
+ $ gs "-Isys$login:"
+
+
+If you write printer output to a file with ``-sOutputFile=`` and then want to print the file later, use ``"PRINT/PASSALL"``.
+
+PDF files (or PostScript files that use the ``setfileposition`` operator) must be "stream LF" type files to work properly on VMS systems. (Note: This definitely matters if Ghostscript was compiled with ``DEC C``; we are not sure of the situation if you use ``gcc``.) Because of this, if you transfer files by FTP, you probably need to do one of these two things after the transfer:
+
+
+- If the FTP transfer was in text (ASCII) mode:
+
+.. code-block:: bash
+
+ $ convert/fdl=streamlf.fdl input-file output-file
+
+
+where the contents of the file ``STREAMLF.FDL`` are:
+
+
+.. blockquote
+
+
+FILE
+
+ ORGANIZATION sequential
+
+ RECORD
+
+ BLOCK_SPAN yes
+
+ CARRIAGE_CONTROL carriage_return
+
+ FORMAT stream_lf
+
+
+
+- If the FTP transfer was in binary mode:
+
+.. code-block:: bash
+
+ $ set file/attribute=(rfm:stmlf)
+
+
+
+Using X Windows on VMS
+"""""""""""""""""""""""""""
+
+If you are using on an X Windows display, you can set it up with the node name and network transport, for instance:
+
+.. code-block:: bash
+
+ $ set display/create/node="doof.city.com"/transport=tcpip
+
+and then run Ghostscript by typing ``gs`` at the command line.
+
+
+
+
+MS Windows
+~~~~~~~~~~~~~~
+
+The name of the Ghostscript command line executable on MS Windows is ``gswin32c/gswin64c`` so use this instead of the plain '``gs``' in the quickstart examples.
+
+To run the batch files in the Ghostscript lib directory, you must add ``gs\bin`` and ``gs\lib`` to the ``PATH``, where ``gs`` is the top-level Ghostscript directory.
+
+When passing options to Ghostscript through a batch file wrapper such as ``ps2pdf.bat`` you need to substitute '#' for '=' as the separator between options and their arguments. For example:
+
+
+.. code-block:: bash
+
+ ps2pdf -sPAPERSIZE#a4 file.ps file.pdf
+
+
+Ghostscript treats '#' the same internally, and the '=' is mangled by the command shell.
+
+There is also an older version for MS Windows called just ``gswin32`` that provides its own window for the interactive postscript prompt. The executable ``gswin32c/gswin64c`` is usually the better option since it uses the native command prompt window.
+
+For printer devices, the default output is the default printer. This can be modified as follows:
+
+
+.. code-block:: bash
+
+ -sOutputFile="%printer%printer name"
+
+
+Output to the named printer. If your printer is named "HP DeskJet 500" then you would use ``-sOutputFile="%printer%HP DeskJet 500"``.
+
+
+MS-DOS
+~~~~~~~~~~~~~~
+
+
+.. note::
+
+ Ghostscript is no longer supported on MS-DOS.
+
+Invoking Ghostscript from the command prompt in Windows is supported by the Windows executable described above.
+
+
+
+
+X Windows
+~~~~~~~~~~~~~~
+
+Ghostscript looks for the following resources under the program name ``ghostscript`` and class name ``Ghostscript``; the ones marked "**" are calculated from display metrics:
+
+X Windows resources
+"""""""""""""""""""""
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Name
+ - Class
+ - Default
+ * - background
+ - Background
+ - white
+ * - foreground
+ - Foreground
+ - black
+ * - borderColor
+ - BorderColor
+ - black
+ * - borderWidth
+ - BorderWidth
+ - 1
+ * - geometry
+ - Geometry
+ - NULL
+ * - xResolution
+ - Resolution
+ - :sub:`**`
+ * - yResolution
+ - Resolution
+ - :sub:`**`
+ * - useExternalFonts
+ - UseExternalFonts
+ - true
+ * - useScalableFonts
+ - UseScalableFonts
+ - true
+ * - logExternalFonts
+ - LogExternalFonts
+ - false
+ * - externalFontTolerance
+ - ExternalFontTolerance
+ - 10.0
+ * - palette
+ - Palette
+ - Color
+ * - maxGrayRamp
+ - MaxGrayRamp
+ - 128
+ * - maxRGBRamp
+ - MaxRGBRamp
+ - 5
+ * - maxDynamicColors
+ - MaxDynamicColors
+ - 256
+ * - useBackingPixmap
+ - UseBackingPixmap
+ - true
+ * - useXPutImage
+ - UseXPutImage
+ - true
+ * - useXSetTile
+ - UseXSetTile
+ - true
+
+
+X resources
+"""""""""""""""
+
+To set X resources, put them in a file (such as ``~/.Xdefaults`` on Unix) in a form like this:
+
+.. list-table::
+
+ * - Ghostscript*geometry:
+ - 595x842-0+0
+ * - Ghostscript*xResolution:
+ - 72
+ * - Ghostscript*yResolution:
+ - 72
+
+
+Then merge these resources into the X server's resource database:
+
+
+.. code-block:: bash
+
+ xrdb -merge ~/.Xdefaults
+
+
+- Ghostscript doesn't look at the default system background and foreground colors; if you want to change the background or foreground color, you must set them explicitly for Ghostscript. This is a deliberate choice, so that PostScript documents will display correctly by default -- with white as white and black as black -- even if text windows use other colors.
+- The ``geometry`` resource affects only window placement.
+- Resolution is expressed in pixels per inch (1 inch = 25.4mm).
+- The font tolerance gives the largest acceptable difference in height of the screen font, expressed as a percentage of the height of the desired font.
+- The ``palette`` resource can be used to restrict Ghostscript to using a grayscale or monochrome palette.
+
+``maxRGBRamp`` and ``maxGrayRamp`` control the maximum number of colors that Ghostscript allocates ahead of time for the dither cube (ramp). Ghostscript never preallocates more than half the cells in a colormap. ``maxDynamicColors`` controls the maximum number of colors that Ghostscript will allocate dynamically in the colormap.
+
+Working around bugs in X servers
+""""""""""""""""""""""""""""""""""""
+
+The "``use...``" resources exist primarily to work around bugs in X servers.
+
+- Old versions of DEC's X server (DECwindows) have bugs that require setting ``useXPutImage`` or ``useXSetTile`` to false.
+- Some servers do not implement backing pixmaps properly, or do not have enough memory for them. If you get strange behavior or "out of memory" messages, try setting ``useBackingPixmap`` to ``false``.
+- Some servers do not implement tiling properly. This appears as broad bands of color where dither patterns should appear. If this happens, try setting ``useXSetTile`` to ``false``.
+- Some servers do not implement bitmap or pixmap displaying properly. This may appear as white or black rectangles where characters should appear; or characters may appear in "inverse video" (for instance, white on a black rectangle rather than black on white). If this happens, try setting ``useXPutImage`` to ``false``.
+
+
+X device parameters
+"""""""""""""""""""""""""""""
+ In addition to the device parameters recognized by all devices, Ghostscript's X driver provides parameters to adjust its performance. Users will rarely need to modify these. Note that these are parameters to be set with the ``-d`` switch in the command line (e.g., ``-dMaxBitmap=10000000``), not resources to be defined in the ``~/.Xdefaults`` file.
+
+``AlwaysUpdate <boolean>``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ If ``true``, the driver updates the screen after each primitive drawing operation; if ``false`` (the default), the driver uses an intelligent buffered updating algorithm.
+
+``MaxBitmap <integer>``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ If the amount of memory required to hold the pixmap for the window is no more than the value of ``MaxBitmap``, the driver will draw to a pixmap in Ghostscript's address space (called a "client-side pixmap") and will copy it to the screen from time to time; if the amount of memory required for the pixmap exceeds the value of ``MaxBitmap``, the driver will draw to a server pixmap. Using a client-side pixmap usually provides better performance -- for bitmap images, possibly much better performance -- but since it may require quite a lot of RAM (e.g., about 2.2 Mb for a 24-bit 1024x768 window), the default value of ``MaxBitmap`` is 0.
+
+
+``MaxTempPixmap, MaxTempImage <integer>``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ These control various aspects of the driver's buffering behavior. For details, please consult the source file ``gdevx.h``.
+
+
+SCO Unix
+"""""""""""""
+
+Because of bugs in the SCO Unix kernel, Ghostscript will not work if you select direct screen output and also allow it to write messages on the console. If you are using direct screen output, redirect Ghostscript's terminal output to a file.
+
+
+
+
+.. _Use_Command line options:
+
+
+Command line options
+-----------------------
+
+Unless otherwise noted, these switches can be used on all platforms.
+
+
+General switches
+~~~~~~~~~~~~~~~~~~~
+
+.. _Use_Input Control:
+
+Input control
+""""""""""""""""""
+
+**@filename**
+^^^^^^^^^^^^^^^^^
+ Causes Ghostscript to read filename and treat its contents the same as the command line. (This was intended primarily for getting around DOS's 128-character limit on the length of a command line.) Switches or file names in the file may be separated by any amount of white space (space, tab, line break); there is no limit on the size of the file.
+
+**--** *filename arg1 ...*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**-+** *filename arg1 ...*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Takes the next argument as a file name as usual, but takes all remaining arguments (even if they have the syntactic form of switches) and defines the name ``ARGUMENTS`` in userdict (not systemdict) as an array of those strings, before running the file. When Ghostscript finishes executing the file, it exits back to the shell.
+
+**-@** *filename arg1 ...*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Does the same thing as -- and -+, but expands @filename arguments.
+
+**-**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**-_**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ These are not really switches: they tell Ghostscript to read from standard input, which is coming from a file or a pipe, with or without buffering. On some systems, Ghostscript may read the input one character at a time, which is useful for programs such as ghostview that generate input for Ghostscript dynamically and watch for some response, but can slow processing. If performance is significantly slower than with a named file, try '-_' which always reads the input in blocks. However, '-' is equivalent on most systems.
+
+**-c** *token ...*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**-c** *string ...*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Interprets arguments as PostScript code up to the next argument that begins with "-" followed by a non-digit, or with "@". For example, if the file ``quit.ps`` contains just the word "``quit``", then ``-c quit`` on the command line is equivalent to ``quit.ps`` there. Each argument must be valid PostScript, either individual tokens as defined by the token operator, or a string containing valid PostScript.
+
+ Because Ghostscript must initialize the PostScript environment before executing the commands specified by this option it should be specified after other setup options. Specifically this option 'bind's all operations and sets the systemdict to readonly.
+
+**-f**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Interprets following non-switch arguments as file names to be executed using the normal run command. Since this is the default behavior, ``-f`` is useful only for terminating the list of tokens for the ``-c`` switch.
+
+**-f** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Execute the given file, even if its name begins with a "-" or "@".
+
+
+File searching
+""""""""""""""""""""""""""""""""""
+
+Note that by "library files" here we mean all the files identified using the search rule under "`How Ghostscript finds files`_" above: Ghostscript's own initialization files, fonts, and files named on the command line.
+
+.. _I switch:
+
+**-I** *directories*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Adds the designated list of directories at the head of the search path for library files.
+
+.. _P switch:
+
+**-P**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Makes Ghostscript look first in the current directory for library files.
+
+**-P-**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Makes Ghostscript not look first in the current directory for library files (unless, of course, the first explicitly supplied directory is "."). This is now the default.
+
+
+.. _Use_Setting Parameters:
+
+Setting parameters
+"""""""""""""""""""""""""""""""""""
+
+**-D** *name*, **-d** *name*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ Define a name in systemdict with value=true.
+
+**-D** *name=token*, **-d** *name=token*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ Define a name in systemdict with the given value. The value must be a valid PostScript token (as defined by the ``token`` operator). If the token is a non-literal name, it must be true, false, or null. It is recommeded that this is used only for simple values -- use ``-c`` (above) for complex values such as procedures, arrays or dictionaries.
+
+ Note that these values are defined before other names in systemdict, so any name that that conflicts with one usually in systemdict will be replaced by the normal definition during the interpreter initialization.
+
+**-S** *name=string*, **-s** *name=string*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+ Define a name in systemdict with a given string as value. This is different from ``-d``. For example, ``-dXYZ=35`` on the command line is equivalent to the program fragment:
+
+.. code-block:: bash
+
+ /XYZ 35 def
+
+whereas ``-sXYZ=35`` is equivalent to:
+
+.. code-block:: bash
+
+ /XYZ (35) def
+
+
+
+**-p** *name=string*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Define a name in systemdict with the parsed version of the given string as value. The string takes a parameter definition in (something very close to) postscript format. This allows more complex structures to be passed in than is possible with ``-d`` or ``-s``. For example:
+
+.. code-block:: bash
+
+ -pFoo="<< /Bar[1 2 3]/Baz 0.1 /Whizz (string) /Bang <0123> >>"
+
+ This means that ``-p`` can do the job of both ``-d`` and ``-s``. For example:
+
+.. code-block:: bash
+
+ -dDownScaleFactor=3
+
+ can be equivalently performed by:
+
+.. code-block:: bash
+
+ -pDownScaleFactor=3
+
+ and:
+
+.. code-block:: bash
+
+ -sPAPERSIZE=letter
+
+ can be equivalently performed by:
+
+.. code-block:: bash
+
+ -pPAPERSIZE="(letter)"
+
+
+ .. note ::
+
+ There are some 'special' values that should be set using ``-s``, not ``-p``, such as ``DEVICE`` and ``DefaultGrayProfile``. Broadly, only use ``-p`` if you cannot set what you want using ``-s`` or ``-d``.
+
+ Also, internally, after setting an parameter with ``-p`` we perform an ``initgraphics`` operation. This is required to allow changes in parameters such as ``HWResolution`` to take effect. This means that attempting to use ``-p`` other than at the start of a page is liable to give unexpected results.
+
+
+**-u** *name*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Un-define a name, cancelling ``-d`` or ``-s``.
+
+ Note that the initialization file gs_init.ps makes systemdict read-only, so the values of names defined with ``-D``, ``-d``, ``-S``, and ``-s`` cannot be changed -- although, of course, they can be superseded by definitions in userdict or other dictionaries. However, device parameters set this way (PageSize, Margins, etc.) are not read-only, and can be changed by code in PostScript files.
+
+**-g** *number1 x number2*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Equivalent to ``-dDEVICEWIDTH=number1`` and ``-dDEVICEHEIGHT=number2``, specifying the device width and height in pixels for the benefit of devices such as X11 windows and VESA displays that require (or allow) you to specify width and height. Note that this causes documents of other sizes to be clipped, not scaled: see ``-dFIXEDMEDIA`` below.
+
+**-r** *number* (same as *-r number x number*)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**-r** *number1 x number2*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Equivalent to ``-dDEVICEXRESOLUTION=number1`` and ``-dDEVICEYRESOLUTION=number2``, specifying the device horizontal and vertical resolution in pixels per inch for the benefit of devices such as printers that support multiple X and Y resolutions.
+
+
+
+Suppress messages
+""""""""""""""""""""""""""""""""""""""
+
+**-q**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Quiet startup: suppress normal startup messages, and also do the equivalent of :ref:`-dQUIET<DQUIET>`.
+
+
+Parameter switches (-d and -s)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ As noted above, ``-d`` and ``-s`` define initial values for PostScript names. Some of these names are parameters that control the interpreter or the graphics engine. You can also use ``-d`` or ``-s`` to define a value for any device parameter of the initial device (the one defined with ``-sDEVICE=``, or the default device if this switch is not used). For example, since the :title:`ppmraw` device has a numeric ``GrayValues`` parameter that controls the number of bits per component, ``-sDEVICE=ppmraw -dGrayValues=16`` will make this the default device and set the number of bits per component to 4 (log2(16)).
+
+
+Rendering parameters
+"""""""""""""""""""""""""""""""
+
+**-dCOLORSCREEN**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**-dCOLORSCREEN=0**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**-dCOLORSCREEN=false**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ On high-resolution devices (at least 150 dpi resolution, or ``-dDITHERPPI`` specified), ``-dCOLORSCREEN`` forces the use of separate halftone screens with different angles for CMYK or RGB if halftones are needed (this produces the best-quality output); ``-dCOLORSCREEN=0`` uses separate screens with the same frequency and angle; ``-dCOLORSCREEN=false`` forces the use of a single binary screen. The default if ``COLORSCREEN`` is not specified is to use separate screens with different angles if the device has fewer than 5 bits per color, and a single binary screen (which is never actually used under normal circumstances) on all other devices.
+
+
+**-dDITHERPPI=** *lpi*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Forces all devices to be considered high-resolution, and forces use of a halftone screen or screens with *lpi* lines per inch, disregarding the actual device resolution. Reasonable values for lpi are N/5 to N/20, where N is the resolution in dots per inch.
+
+**-dInterpolateControl=** *control_value*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This allows control of the image interpolation.
+
+ By default ``InterpolateControl`` is 1 and the image rendering for images that have ``/Interpolate true`` are interpolated to the full device resolution. Otherwise, images are rendered using the nearest neighbour scaling (Bresenham's line algorithm through the image, plotting the closest texture coord at each pixel). When downscaling this results in some source pixels not appearing at all in the destination. When upscaling, each source pixels will cover at least one destination pixel.
+
+ When the *control_value* is 0 no interpolation is performed, whether or not the file has images with ``/Interpolate true``.
+
+ When the *control_value* is greater than 1 interpolation is performed for images with ``/Interpolate true`` as long as the image scaling factor on either axis is larger than the *control_value*. Also, the interpolation only produces images that have (device resolution / *control_value*) maximum resolution rather than full device resolution. This allows for a performance vs. quality tradeoff since the number of pixels produced by the interpolation will be a fraction of the interpolated pixels at full device resolution. Every source pixel will contribute partially to the destination pixels.
+
+ When the ``InterpolateControl`` *control_value* is less than 0 interpolation is forced as if all images have ``/Interpolate true``, and the interpolation is controlled by the absolute value of the *control_value* as described above. Thus, ``-dInterpolateControl=-1`` forces all images to be interpolated at full device resolution.
+
+ Computationally, image interpolation is much more demanding than without interpolation (lots of floating point muliplies and adds for every output pixel vs simple integer additions, subtractions, and shifts).
+
+ In all but special cases image interpolation uses a Mitchell filter function to scale the contributions for each output pixel. When upscaling, every output pixel ends up being the weighted sum of 16 input pixels, When downscaling more source pixels will contribute to the interpolated pixels. Every source pixel has some effect on the output pixels.
+
+
+**-dDOINTERPOLATE**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This option still works, but is deprecated, and is the equivalent of ``-dInterpolateControl=-1``.
+
+
+**-dNOINTERPOLATE**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This option still works, but is deprecated and is the equivalent of ``-dInterpolateControl=0``.
+
+ Turns off image interpolation, improving performance on interpolated images at the expense of image quality. ``-dNOINTERPOLATE`` overrides ``-dDOINTERPOLATE``.
+
+
+**-dTextAlphaBits=** *n*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**-dGraphicsAlphaBits=** *n*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ These options control the use of subsample antialiasing. Their use is highly recommended for producing high quality rasterizations. The subsampling box size n should be 4 for optimum output, but smaller values can be used for faster rendering. Antialiasing is enabled separately for text and graphics content. Allowed values are 1, 2 or 4.
+
+
+.. note ::
+ Because of the way antialiasing blends the edges of shapes into the background when they are drawn some files that rely on joining separate filled polygons together to cover an area may not render as expected with ``GraphicsAlphaBits`` at 2 or 4. If you encounter strange lines within solid areas, try rendering that file again with ``-dGraphicsAlphaBits=1``.
+
+ Further note: because this feature relies upon rendering the input it is incompatible, and will generate an error on attempted use, with any of the vector output devices.
+
+
+
+**-dAlignToPixels=** *n*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Chooses glyph alignent to integral pixel boundaries (if set to the value 1) or to subpixels (value 0). Subpixels are a smaller raster grid which is used internally for text antialiasing. The number of subpixels in a pixel usually is ``2^TextAlphaBits``, but this may be automatically reduced for big characters to save space in character cache.
+
+ The parameter has no effect if ``-dTextAlphaBits=1``. Default value is 0.
+
+ Setting ``-dAlignToPixels=0`` can improve rendering of poorly hinted fonts, but may impair the appearance of well-hinted fonts.
+
+**-dGridFitTT=** *n*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This specifies the initial value for the implementation specific user parameter :ref:`GridFitTT<Language_GridFitTT>`. It controls grid fitting of True Type fonts (Sometimes referred to as "hinting", but strictly speaking the latter is a feature of Type 1 fonts). Setting this to 2 enables automatic grid fitting for True Type glyphs. The value 0 disables grid fitting. The default value is 2. For more information see the description of the user parameter :ref:`GridFitTT<Language_GridFitTT>`.
+
+
+**-dUseCIEColor**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set ``UseCIEColor`` in the page device dictionary, remapping device-dependent color values through a Postscript defined CIE color space. Document ``DeviceGray``, ``DeviceRGB`` and ``DeviceCMYK`` source colors will be substituted respectively by Postscript CIEA, CIEABC and CIEDEFG color spaces. See the document `GS9 Color Management`_ for details on how this option will interact with Ghostscript's ICC-based color workflow. If accurate colors are desired, it is recommended that an ICC workflow be used.
+
+**-dNOCIE**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Substitutes ``DeviceGray`` for CIEBasedA, DeviceRGB for CIEBasedABC and CIEBasedDEF spaces and ``DeviceCMYK`` for CIEBasedDEFG color spaces. Useful only on very slow systems where color accuracy is less important.
+
+
+**-dNOSUBSTDEVICECOLORS**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This switch prevents the substitution of the ``ColorSpace`` resources (``DefaultGray``, ``DefaultRGB``, and ``DefaultCMYK``) for the ``DeviceGray``, ``DeviceRGB``, and ``DeviceCMYK`` color spaces. This switch is primarily useful for PDF creation using the :title:`pdfwrite` device when retaining the color spaces from the original document is important.
+
+**-dNOPSICC**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Disables the automatic loading and use of an input color space that is contained in a PostScript file as DSC comments starting with the %%BeginICCProfile: comment. ICC profiles are sometimes embedded by applications to convey the exact input color space allowing better color fidelity. Since the embedded ICC profiles often use multidimensional RenderTables, color conversion may be slower than using the Default color conversion invoked when the ``-dUseCIEColor`` option is specified, therefore the ``-dNOPSICC`` option may result in improved performance at slightly reduced color fidelity.
+
+
+**-dNOTRANSPARENCY**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Turns off PDF 1.4 transparency, resulting in faster (but possibly incorrect) rendering of pages containing PDF 1.4 transparency and blending.
+
+**-dALLOWPSTRANSPARENCY**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Enables the use of the Ghostscript custom transparency operators (:ref:`Transparency<Language_Transparency>`) from Postscript input. Normally, these operators are not accessible from Postscript jobs, being primarily intended to be called by the PDF interpreter. Using ``-dALLOWPSTRANSPARENCY`` leaves them available. It is important that these operators are used correctly, especially the order in which they are called, otherwise unintended, even undefined behavior may result.
+
+**-dNO_TN5044**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Turns off the TN 5044 psuedo operators. These psuedo operators are not a part of the official Postscript specification. However they are defined in Technical Note #5044 Color Separation Conventions for PostScript Language Programs. These psuedo operators are required for some files from QuarkXPress. However some files from Corel 9 and Illustrator 88 do not operate properly if these operators are present.
+
+**-dDOPS**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Enables processing of Subtype /PS streams in PDF files and the DoPS operator. DoPS has in fact been deprecated for some time. Also the "PS" operator that was removed from the 1.3 2nd edition specification is also disabled by default, and enabled by ``-dDOPS``. Use of this option is NOT recommended in security-conscious applications, as it increases the scope for malicious code. ``-dDOPS`` has no effect on processing of PostScript source files. Note: in releases 7.30 and earlier, processing of DoPS was always enabled.
+
+**-dBlackText**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Forces text to be drawn with black. This occurs for text fill and text stroke operations. PDF output created with this setting will be updated to be drawn with gray values of 0. Type 3 fonts, which are sometimes used for graphics, are not affected by this parameter. Note, works only for fills with gray, rgb, and cmyk. Pattern, separation, and deviceN fills will not be affected.
+
+
+**-dBlackVector**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Forces vector stroke and fills to be drawn with black. PDF output created with this setting will be updated to be drawn with gray values of 0. Note, works only for fills with gray, rgb, and cmyk. Pattern, separation, and deviceN fills will not be affected.
+
+
+**-dBlackThresholdL=** *float*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Sets the threshold for the luminance value (L*) at which that value and above will be mapped to white when using the ``BlackText`` and ``BlackVector`` option. Default is 90. Pure white has a value of 100. Pure black has a value of 0. This means that if you set ``BlackThresholdL=101``, all colors will be mapped to black. If you set ``BlackThresholdL=75``, colors that are below an L* value of 75 will be mapped to black. Colors at or above an L* of 75 will be mapped to white, depending upon the setting of ``BlackThresholdC`` (see below).
+
+
+**-dBlackThresholdC=** *float*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ For colors that are at or above the value set by ``BlackThresholdL`` (or the default setting of 90), map colors to white that are within a distance of ``BlackThresholdC`` from the CIELAB neutral axis in terms of the L1 norm on the a* and b* value. All others are mapped to black. This has the effect of forcing colors with high luminance and high chrominance to black (e.g. pure yellow) while those with a lower luminance and less chrominance to white (e.g. a light gray). Default value is 3. You can visualize the region that is mapped to white as a cuboid that is centered on the CIELAB neutral axis with one end tied to the L*=100 value. The cuboid cross sections across the neutral axis are squares whose size is set by ``BlackThresholdC``. The cuboid length is set by ``BlackThresholdL`` and is effectively ``100-BlackThresholdL``.
+
+
+
+Page parameters
+"""""""""""""""""""""""""""""""
+
+
+**-dFirstPage=** *pagenumber*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Begin on the designated page of the document. Pages of all documents in PDF collections are numbered sequentionally.
+
+
+**-dLastPage=** *pagenumber*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Stop after the designated page of the document. Pages of all documents in PDF collections are numbered sequentionally.
+
+**-sPageList=** *pagenumber*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ There are three possible values for this; even, odd or a list of pages to be processed. A list can include single pages or ranges of pages. Ranges of pages use the minus sign '-', individual pages and ranges of pages are separated by commas ','. A trailing minus '-' means process all remaining pages. For example:
+
+.. code-block:: bash
+
+ -sPageList=1,3,5 indicates that pages 1, 3 and 5 should be processed.
+ -sPageList=5-10 indicates that pages 5, 6, 7, 8, 9 and 10 should be processed.
+ -sPageList=1, 5-10, 12- indicates that pages 1, 5, 6, 7, 8, 9, 10 and 12 onwards should be processed.
+
+
+ The PDF interpreter and the other language interpreters handle these in slightly different ways. Because PDF files enable random access to pages in the document the PDF inerpreter only interprets and renders the required pages. PCL and PostScript cannot be handled in ths way, and so all the pages must be interpreted. However only the requested pages are rendered, which can still lead to savings in time. Be aware that using the '``%d``' syntax for ``OutputFile`` does not reflect the page number in the original document. If you chose (for example) to process even pages by using ``-sPageList=even``, then the output of ``-sOutputFile=out%d.png`` would still be ``out0.png``, ``out1.png``, ``out2.png`` etc.
+
+ Because the PostScript and PCL interpreters cannot determine when a document terminates, sending multple files as input on the command line does not reset the ``PageList`` between each document, each page in the second and subsequent documents is treated as following on directly from the last page in the first document. The PDF interpreter, however, does not work this way. Since it knows about individual PDF files the ``PageList`` is applied to each PDF file separately. So if you were to set ``-sPageList=1,2`` and then send two PDF files, the result would be pages 1 and 2 from the first file, and then pages 1 and 2 from the second file. The PostScript interpreter, by contrast, would only render pages 1 and 2 from the first file. This means you must exercise caution when using this switch, and probably should not use it at all when processing a mixture of PostScript and PDF files on the same command line.
+
+.. _FIXEDMEDIA:
+
+**-dFIXEDMEDIA**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Causes the media size to be fixed after initialization, forcing pages of other sizes or orientations to be clipped. This may be useful when printing documents on a printer that can handle their requested paper size but whose default is some other size. Note that ``-g`` automatically sets ``-dFIXEDMEDIA``, but ``-sPAPERSIZE=`` does not.
+
+**-dFIXEDRESOLUTION**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Causes the media resolution to be fixed similarly. ``-r`` automatically sets ``-dFIXEDRESOLUTION``.
+
+**-dPSFitPage**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ The page size from the PostScript file ``setpagedevice`` operator, or one of the older ``statusdict`` page size operators (such as ``letter`` or ``a4``) will be rotated, scaled and centered on the "best fit" page size from those availiable in the ``InputAttributes`` list. The ``-dPSFitPage`` is most easily used to fit pages when used with the ``-dFIXEDMEDIA`` option.
+
+ This option is also set by the ``-dFitPage`` option.
+
+**-dORIENT1=true**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**-dORIENT1=false**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Defines the meaning of the 0 and 1 orientation values for the ``setpage[params]`` compatibility operators. The default value of ``ORIENT1`` is true (set in ``gs_init.ps``), which is the correct value for most files that use ``setpage[params]`` at all, namely, files produced by badly designed applications that "know" that the output will be printed on certain roll-media printers: these applications use 0 to mean landscape and 1 to mean portrait. ``-dORIENT1=false`` declares that 0 means portrait and 1 means landscape, which is the convention used by a smaller number of files produced by properly written applications.
+
+**-dDEVICEWIDTHPOINTS=** *w*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+**-dDEVICEHEIGHTPOINTS=** *h*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Sets the initial page width to w or initial page height to h respectively, specified in 1/72" units.
+
+**-sDEFAULTPAPERSIZE=** *a4*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This value will be used to replace the device default papersize ONLY if the default papersize for the device is 'letter' or 'a4' serving to insulate users of A4 or 8.5x11 from particular device defaults (the collection of contributed drivers in Ghostscript vary as to the default size).
+
+**-dFitPage**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This is a "convenience" operator that sets the various options to perform page fitting for specific file types.
+ This option sets the ``-dEPSFitPage``, ``-dPDFFitPage``, and the ``-dFitPage`` options.
+
+
+**-sNupControl=** *Nup_option_string*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This option specifies the N-up nesting to be performed. The pages are scaled and arranged on the current ``PageSize`` "master" page according the the option.
+
+ The only option strings are as follows:
+
+ ``-sNupControl=number1xnumber2``
+ Will fit *number1* nested pages across the master page, and *number2* down the master page, from the upper left, then to the right to fill the row, moving down to the leftmost place on the next row until the nest is complete.
+ A partially filled nest will be output when the ``-sNupControl=`` *string* is changed, when Ghostscript exits, or when the page size changes.
+
+ Pages are scaled to fit the requested number horizontally and vertically, maintaining the aspect ratio. If the scaling selected for fitting the nested pages leaves space horizontally on the master page, the blank area will be added to the left and right of the entire row of nested pages. If the fit results in vertical space, the blank area will be added above and below all of the rows.
+
+ ``-sNupControl=``
+ An empty string will turn off nesting. If there are any nested pages on the master page, the partially filled master page will be output.
+ Printer devices typically reallocate their memory whenever the transparency use of a page changes (from one page having transparency, to the next page not having transparency, or vice versa). This would cause problems with Nup, possibly leading to lost or corrupt pages in the output. To avoid this, the Nup device changes the parameters of the page to always set the ``PageUsesTransparency`` flag. While this should be entirely transparent for the user and not cause extra transparency blending operations during the standard rendering processes for most devices, it may cause devices to use the clist rather than PageMode.
+
+
+Font-related parameters
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+**-dLOCALFONTS**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Causes Type 1 fonts to be loaded into the current VM -- normally local VM -- instead of always being loaded into global VM. Useful only for compatibility with Adobe printers for loading some obsolete fonts.
+
+.. _UseDNoFontMap:
+
+**-dNOFONTMAP**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Suppresses the normal loading of the ``Fontmap`` file. This may be useful in environments without a file system.
+
+**-dNOFONTPATH**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Suppresses consultation of ``GS_FONTPATH``. This may be useful for debugging.
+
+**-dNOPLATFONTS**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Disables the use of fonts supplied by the underlying platform (X Windows or Microsoft Windows). This may be needed if the platform fonts look undesirably different from the scalable fonts.
+
+**-dNONATIVEFONTMAP**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Disables the use of font map and corresponding fonts supplied by the underlying platform. This may be needed to ensure consistent rendering on the platforms with different fonts, for instance, during regression testing.
+
+**-sFONTMAP=** *filename1;filename2;...*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specifies alternate name or names for the ``Fontmap`` file. Note that the names are separated by ":" on Unix systems, by ";" on MS Windows systems, and by "," on VMS systems, just as for search paths.
+
+**-sFONTPATH=** *dir1;dir2;...*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specifies a list of directories that will be scanned when looking for fonts not found on the search path, overriding the environment variable ``GS_FONTPATH``.
+
+ By implication, any paths specified by ``FONTPATH`` or ``GS_FONTPATH`` are automatically added to the permit file read list (see ":ref:`-dSAFER<dSAFER>`").
+
+**-sSUBSTFONT=** *fontname*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Causes the given font to be substituted for all unknown fonts, instead of using the normal intelligent substitution algorithm. Also, in this case, the font returned by findfont is the actual font named fontname, not a copy of the font with its ``FontName`` changed to the requested one.
+
+
+.. note ::
+
+ THIS OPTION SHOULD NOT BE USED WITH HIGH LEVEL (VECTOR) DEVICES, such as :title:`pdfwrite`, because it prevents such devices from providing the original font names in the output document. The font specified (fontname) will be embedded instead, limiting all future users of the document to the same approximate rendering.
+
+
+
+.. _resource related parameters:
+
+
+Resource-related parameters
+""""""""""""""""""""""""""""""
+
+**-sGenericResourceDir=** *path*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specifies a path to resource files. The value is platform dependent. It must end with a directory separator.
+ A note for Windows users, Artifex recommends the use of the forward slash delimiter due to the special interpretation of ``\"`` by the Microsoft C startup code. See `Parsing C Command-Line Arguments`_ for more information.
+
+ Adobe specifies ``GenericResourceDir`` to be an absolute path to a single resource directory. Ghostscript instead maintains multiple resource directories and uses an extended method for finding resources, which is explained in :ref:`"Finding PostScript Level 2 resources"<PS resources>`.
+
+ Due to the extended search method, Ghostscript uses ``GenericResourceDir`` only as a default directory for resources being not installed. Therefore ``GenericResourceDir`` may be considered as a place where new resources to be installed. The default implementation of the function ``ResourceFileName`` uses ``GenericResourceDir`` when it is an absolute path, or when the resource file is absent.
+
+ The extended search method does not call ``ResourceFileName``.
+
+ Default value is (``./Resource/``) for Unix, and an equivalent one on other platforms.
+
+**-sFontResourceDir=** *path*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specifies a path where font files are installed. It's meaning is similar to ``GenericResourceDir``.
+
+ Default value is (``./Font/``) for Unix, and an equivalent one on other platforms.
+
+
+
+.. _Interaction related parameters:
+
+Interaction-related parameters
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+
+**-dBATCH**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Causes Ghostscript to exit after processing all files named on the command line, rather than going into an interactive loop reading PostScript commands. Equivalent to putting ``-c`` quit at the end of the command line.
+
+**-dNOPAGEPROMPT**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Disables only the prompt, but not the pause, at the end of each page. This may be useful on PC displays that get confused if a program attempts to write text to the console while the display is in a graphics mode.
+
+**-dNOPAUSE**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Disables the prompt and pause at the end of each page. Normally one should use this (along with ``-dBATCH``) when producing output on a printer or to a file; it also may be desirable for applications where another program is "driving" Ghostscript.
+
+**-dNOPROMPT**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Disables the prompt printed by Ghostscript when it expects interactive input, as well as the end-of-page prompt (``-dNOPAGEPROMPT``). This allows piping input directly into Ghostscript, as long as the data doesn't refer to ``currentfile``.
+
+
+.. _DQUIET:
+
+**-dQUIET**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Suppresses routine information comments on standard output. This is currently necessary when redirecting device output to standard output.
+
+**-dSHORTERRORS**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Makes certain error and information messages more Adobe-compatible.
+
+**-sstdout=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Redirect PostScript ``%stdout`` to a file or ``stderr``, to avoid it being mixed with device ``stdout``. To redirect ``stdout`` to ``stderr`` use ``-sstdout=%stderr``. To cancel redirection of stdout use ``-sstdout=%stdout`` or ``-sstdout=-``.
+
+.. note::
+
+ This redirects PostScript output to ``%stdout`` but does not change the destination FILE of device output as with ``-sOutputFile=-`` or even ``-sOutputFile=%stdout`` since devices write directly using the stdout ``FILE *`` pointer with C function calls such as ``fwrite`` or ``fputs``.
+
+**-dTTYPAUSE**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Causes Ghostscript to read a character from ``/dev/tty``, rather than standard input, at the end of each page. This may be useful if input is coming from a pipe.
+
+.. note::
+
+ ``-dTTYPAUSE`` overrides ``-dNOPAUSE``.
+
+
+
+Device and output selection parameters
+""""""""""""""""""""""""""""""""""""""""""""""
+
+**-dNODISPLAY**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Initializes Ghostscript with a null device (a device that discards the output image) rather than the default device or the device selected with -sDEVICE=. This is usually useful only when running PostScript code whose purpose is to compute something rather than to produce an output image.
+
+**-sDEVICE=** *device*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Selects an alternate initial :ref:`output device<Selecting an output device>`.
+
+**-sOutputFile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Selects an alternate output file (or pipe) for the initial output device, as described above.
+
+**-d.IgnoreNumCopies=** *true*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Some devices implement support for "printing" multiple copies of the input document and some do not, usually based on whether it makes sense for a particular output format. This switch instructs all devices to ignore a request to print multiple copies, giving more consistent behaviour.
+
+
+Deferred Page Rendering
+""""""""""""""""""""""""""""""""""""""""""""""
+
+Raster printers and image formats that can use the "command list" (clist) to store a representation of the page prior to rendering can use the ``--saved-pages=`` *string* on the command line for deferred rendering of pages.
+
+Pages that are saved instead of printed are retained until the list of saved pages is emptied by the flush command of the ``saved-pages=`` command string.
+
+Pages can be printed in reverse or normal order, or selected pages, including all even or all odd, and multiple collated copies can be produced. Since pages are saved until the flush command, pages can be printed multiple times, in any order.
+
+Refer to the :ref:`Using Saved Pages<SavedPages.htm>` document for details.
+
+
+
+
+EPS parameters
+""""""""""""""""""""""""""""""""""""""""""""""
+
+**-dEPSCrop**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Crop an EPS file to the bounding box. This is useful when converting an EPS file to a bitmap.
+
+
+**-dEPSFitPage**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Resize an EPS file to fit the page. This is useful for shrinking or enlarging an EPS file to fit the paper size when printing.
+ This option is also set by the ``-dFitPage`` option.
+
+**-dNOEPS**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Prevent special processing of EPS files. This is useful when EPS files have incorrect Document Structuring Convention comments.
+
+
+
+
+ICC color parameters
+""""""""""""""""""""""""""""""""""""""""""""""
+
+For details about the ICC controls see the document `GS9 Color Management`_.
+
+
+**-sDefaultGrayProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the ICC profile that will be associated with undefined device gray color spaces. If this is not set, the profile file name "default_gray.icc" will be used as the default.
+
+**-sDefaultRGBProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the ICC profile that will be associated with undefined device RGB color spaces. If this is not set, the profile file name "default_rgb.icc" will be used as the default.
+
+**-sDefaultCMYKProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the ICC profile that will be associated with undefined device CMYK color spaces. If this is not set, the profile file name "default_cmyk.icc" will be used as the default.
+
+**-sDeviceNProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Associate a :title:`devicen` color space contained in a PS or PDF document with an ICC profile. Note that neither PS nor PDF provide in-document ICC profile definitions for DeviceN color spaces. With this interface it is possible to provide this definition. The colorants tag order in the ICC profile defines the lay-down order of the inks associated with the profile. A windows-based tool for creating these source profiles is contained in ``./toolbin/color/icc_creator``.
+
+**-sOutputICCProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the ICC profile that will be associated with the output device. Care should be taken to ensure that the number of colorants associated with the device is the same as the profile. If this is not set, an appropriate profile (i.e. one with the proper number of colorants) will be selected from those in the directory specified by ``ICCProfilesDir`` (see below). Note that if the output device is CMYK + spot colorants, a CMYK profile can be used to provide color management for the CMYK colorants only. In this case, spot colors will pass through unprocessed assuming the device supports those colorants. It is also possible for these devices to specify NCLR ICC profiles for output.
+
+
+**-sICCOutputColors=** *"Cyan, Magenta, Yellow, Black, Orange, Violet"*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ For the psdcmyk and tiffsep separation devices, the device ICC profile can be an NCLR profile, which means something that includes non-traditional inks like Orange, Violet, etc. In this case, the list of the color names in the order that they exist in the profile must be provided with this command line option. Note that if a color name that is specified for the profile occurs also within the document (e.g. "Orange" above), then these color names will be associated with the same separation. Additional names beyond those of the ICC profile component count can be included. In this case, those components will be installed into the tiffsep or psdcmyk device list of colors, following the ICC profile colors. The number of spot colors (those that go beyond the standard CMYK colors) allowed by tiffsep or psdcmyk can be set using ``-dMaxSpots=#``. The default value for this is currently set to 10 (``GS_SOFT_MAX_SPOTS``). As an example consider the case where we wish to use a 6CLR ICC profile that includes Orange and Violet, but need the device to include a specialty color component such as Varnish, which does not appear in the document and is not handled by the 6CLR ICC profile.
+
+ In addition, we desire to allow one more spot color of the document to come through to our device. For this case using ``-sICCOutputColors="Cyan, Magenta, Yellow, Black, Orange, Violet, Varnish" -dMaxSpots=4 -sOutputICCProfile=My_6CLR_Profile.icc`` would provide the desired outcome. Note that it is up to the device or through the use of ``-sNamedProfile`` (see below) to involve the setting of any values in the Varnish channel. However, if an All color value is encountered in the document, the Varnish component will have its value set as will the Orange and Violet values (Likewise if a spot color named Varnish is encountered in the document the Varnish component will be used for the values). The All value is typically used for placing registration targets on separations. Finally, note that if an NCLR ICC profile is specified and ``ICCOutputColors`` is not used, then a set of default names will be used for the extra colorants (non-CMYK) in the profile. These names are given as ``ICC_COLOR_N`` for the Nth non-CMYK channel.
+
+**-sProofProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Enable the specificiation of a proofing profile that will make the color management system link multiple profiles together to emulate the device defined by the proofing profile. See the document `GS9 Color Management`_ for details about this option.
+
+**-sDeviceLinkProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Define a device link profile. This profile is used following the output device profile. Care should be taken to ensure that the output device process color model is the same as the output color space for the device link profile. In addition, the color space of the ``OutputICCProfile`` should match the input color space of the device link profile. For example, the following would be a valid specification ``-sDEVICE=tiff32nc -sOutputICCProfile=srgb.icc -sDeviceLinkProfile=linkRGBtoCMYK.icc``. In this case, the output device's color model is CMYK (tiff32nc) and the colors are mapped through sRGB and through a devicelink profile that maps sRGB to CMYK values. See the document `GS9 Color Management`_ for details about this option.
+
+
+**-sNamedProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Define a structure that is to be used by the color management module (CMM) to provide color management of named colors. While the ICC does define a named color format, this structure can in practice be much more general. Many developers wish to use their own proprietary-based format for spot color management. This command option is for developer use when an implementation for named color management is designed for the function gsicc_transform_named_color located in gsicccache.c . An example implementation is currently contained in the code for the handling of both Separation and DeviceN colors. For the general user this command option should really not be used.
+
+
+**-sBlendColorProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ With the PDF transparency imaging model, a color space can be specified within which the color blending operations are to take place. Some files lack this specification, in which case the blending occurs in the output device's native color space. This dependency of blending color space on the device color model can be avoided by using the above command to force a specific color space in which to perform the blending.
+
+**-dColorAccuracy=** *0/1/2*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the level of accuracy that should be used. A setting of 0 will result in less accurate color rendering compared to a setting of 2. However, the creation of a transformation will be faster at a setting of 0 compared to a setting of 2. Default setting is 2.
+
+**-dRenderIntent=** *0/1/2/3*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the rendering intent that should be used with the profile specified above by ``-sOutputICCProfile``. The options 0, 1, 2, and 3 correspond to the ICC intents of Perceptual, Colorimetric, Saturation, and Absolute Colorimetric.
+
+**-dBlackPtComp=** *0/1*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specify if black point compensation should be used with the profile specified above by ``-sOutputICCProfile``.
+
+**-dKPreserve=** *0/1/2*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specify if black preservation should be used when mapping from CMYK to CMYK. When using littleCMS as the CMM, the code 0 corresponds to no preservation, 1 corresponds to the ``PRESERVE_K_ONLY`` approach described in the littleCMS documentation and 2 corresponds to the ``PRESERVE_K_PLANE`` approach. This is only valid when using littleCMS for color management.
+
+**-sVectorICCProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the ICC profile that will be associated with the output device for vector-based graphics (e.g. Fill, Stroke operations). Care should be taken to ensure that the number of colorants associated with the device is the same as the profile. This can be used to obtain more saturated colors for graphics.
+
+**-dVectorIntent=** *0/1/2/3*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the rendering intent that should be used with vector-based graphic objects. The options are the same as specified for ``-dRenderIntent``.
+
+**-dVectorBlackPt=** *0/1*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specify if black point compensation should be used for vector-based graphic objects.
+
+**-dVectorKPreserve=** *0/1/2*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specify if black preservation should be used when mapping from CMYK to CMYK for vector-based graphic objects. The options are the same as specified for ``-dKPreserve``.
+
+**-sImageICCProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the ICC profile that will be associated with the output device for images. Care should be taken to ensure that the number of colorants associated with the device is the same as the profile. This can be used to obtain perceptually pleasing images.
+
+**-dImageIntent=** *0/1/2/3*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the rendering intent that should be used for images.
+
+**-dImageBlackPt=** *0/1*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specify if black point compensation should be used with images.
+
+
+**-dImageKPreserve=** *0/1/2*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specify if black preservation should be used when mapping from CMYK to CMYK for image objects. The options are the same as specified for ``-dKPreserve``.
+
+**-sTextICCProfile=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the ICC profile that will be associated with the output device for text. Care should be taken to ensure that the number of colorants associated with the device is the same as the profile. This can be used ensure K only text.
+
+**-dTextIntent=** *0/1/2/3*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set the rendering intent that should be used text objects. The options are the same as specified for ``-dRenderIntent``.
+
+**-dTextBlackPt=** *0/1*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specify if black point compensation should be used with text objects.
+
+**-dTextKPreserve=** *0/1/2*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Specify if black preservation should be used when mapping from CMYK to CMYK for text objects. The options are the same as specified for ``-dKPreserve``.
+
+**-dOverrideICC**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Override any ICC profiles contained in the source document with the profiles specified by ``sDefaultGrayProfile``, ``sDefaultRGBProfile``, ``sDefaultCMYKProfile``. Note that if no profiles are specified for the default ``Device`` color spaces, then the system default profiles will be used. For detailed override control in the specification of source colors see ``-sSourceObjectICC``.
+
+**-sSourceObjectICC=** *filename*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This option provides an extreme level of override control to specify the source color spaces and rendering intents to use with vector-based graphics, images and text for both RGB and CMYK source objects. The specification is made through a file that contains on a line a key name to specify the object type (e.g. ``Image_CMYK``) followed by an ICC profile file name, a rendering intent number (0 for perceptual, 1 for colorimetric, 2 for saturation, 3 for absolute colorimetric) and information for black point compensation, black preservation, and source ICC override. It is also possible to turn off color management for certain object types, use device link profiles for object types and do custom color replacements. An example file is given in ``./gs/toolbin/color/src_color/objsrc_profiles_example.txt``. Profiles to demonstrate this method of specification are also included in this folder. Note that if objects are colorimetrically specified through this mechanism other operations like ``-dImageIntent``, ``-dOverrideICC``, have no affect. Also see below the interaction with the ``-dDeviceGrayToK`` option. See further details in the document `GS9 Color Management`_.
+
+
+
+**-dDeviceGrayToK=** *true/false*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ By default, Ghostscript will map ``DeviceGray`` color spaces to pure K when the output device is CMYK based. This may not always be desired. In particular, it may be desired to map from the gray ICC profile specified by ``-sDefaultGrayProfile`` to the output device profile. To achieve this, one should specify ``-dDeviceGrayToK=false``. Note that this option may not have any effect in cases where ``SourceObjectICC`` settings are made for gray objects. In particular, if the gray objects in ``SourceObjectICC`` are set to None, which implies that ICC color management is not to be applied to these objects, then they are treated as ``DeviceGray`` and always mapped to K values in a CMYK target device, regardless of the settings of ``-dDeviceGrayToK`` (i.e. there is no color management). If instead, the gray objects in ``SourceObjectICC`` are set to a specific ICC profile, then they are no longer ``DeviceGray`` but are ICC colors. They will be color managed, regardless of the setting of ``-dDeviceGrayToK``.
+
+**-dUseFastColor=** *true/false*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This is used to avoid the use of ICC profiles for source colors. This includes those that are defined by ``DeviceGray``, ``DeviceRGB`` and ``DeviceCMYK`` definitions as well as ICC-based color spaces in the source document. With UseFastColor set to true, the traditional Postscript 255 minus operations are used to convert between RGB and CMYK with black generation and undercolor removal mappings.
+
+**-dSimulateOverprint=** *true/false*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This option has been replaced by ``-dOverprint=``
+
+**-dOverprint=** */enable | /disable | /simulate*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This option provides control of overprinting. The default setting is */enable* which allows devices such as CMYK that can support overprint to leave planes unchanged under control of PostScript and PDF overprint settings.
+
+ The */disable* setting ignores all overprint (and overprint mode) from the input.
+
+ If */simulate* is set, then pages with overprint (or overprint mode) set for CMYK or Separation colors will be internally maintained and output to RGB or Gray devices.
+
+.. note::
+
+ Not all spot color overprint cases can be accurately simulated with a CMYK only device. For example, a case where you have a spot color overprinted with CMYK colors will be indistiguishable from a case where you have spot color equivalent CMYK colorants overprinted with CMYK colors, even though they may need to show significantly different overprint simulations. To obtain a full overprint simulation, use the */simulate* setting or the psdcmyk or tiffsep device, where the spot colors are kept in their own individual planes.
+
+
+**-dUsePDFX3Profile=** *int*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ This option enables rendering with an output intent defined in the PDF source file. If this option is included in the command line, source device color values (e.g ``DeviceCMYK``, ``DeviceRGB``, or ``DeviceGray``) that match the color model of the output intent will be interpreted to be in the output intent color space. In addition, if the output device color model matches the output intent color model, then the destination ICC profile will be the output intent ICC profile. If there is a mismatch between the device color model and the output intent, the output intent profile will be used as a proofing profile, since that is the intended rendering. Note that a PDF document can have multiple rendering intents per the PDF specification. As such, with the option ``-dUsePDFX3Profile`` the first output intent encountered will be used. It is possible to specify a particular output intent where int is an integer (a value of 0 is the same as not specifying a number). Probing of the output intents for a particular file is possible using extractICCprofiles.ps in ``./gs/toolbin``. Finally, note that the ICC profile member entry is an option in the output intent dictionary. In these cases, the output intent specifies a registry and a standard profile (e.g. Fogra39). Ghostscript will not make use of these output intents. Instead, if desired, these standard profiles should be used with the commands specified above (e.g. ``-sOutputICCProfile``).
+
+**-sUseOutputIntent=** *string*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Like ``-dUsePDFX3Profile`` above, this option enables rendering with an output intent defined in the PDF source file.
+ This option behaves the same way as the ``-dUsePDFX3Profile``, but the selection criteria are different. Because its possible (as of PDF 2.0) for each page to have a different array, its not sufficient just to supply an array index, as the same profile might potentially be at different indices in each array.
+
+ Instead this option takes a string, which is first compared against the ``OutputConditionIdentifier`` in each ``OutputIntent`` in the array. If the ``OutputConditionIdentifier`` is not a standard identifier then it should be ``Custom`` and the ``UseOutputIntent`` string will be matched against the value of the ``Info`` key instead. If the ``OutputConditionIdentifier`` or ``Info`` matches the value of ``UseOuttpuIntent``, then that ``OutputIntent`` is selected if the ``OutputIntent`` contains a ``DestOutputProfile`` key.
+
+
+**-sICCProfilesDir=** *path*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Set a directory in which to search for the above profiles. The directory path must end with a file system delimiter.
+ If the user doesn't use the ``-sICCProfilesDir=`` command line option, Ghostscript creates a default value for it by looking on the directory paths explained in `How Ghostscript finds files`_. If the current directory is the first path a test is made for the ``iccprofiles`` directory. Next, the remaining paths with the string Resource in it are tested. The prefix up to the path separator character preceding the string Resource, concatenated with the string ``iccprofiles`` is used and if this exists, then this path will be used for ``ICCProfilesDir``.
+
+ Note that if the build is performed with ``COMPILE_INITS=1``, then the profiles contained in ``gs/iccprofiles`` will be placed in the ROM file system. If a directory is specified on the command line using ``-sICCProfilesDir=``, that directory is searched before the ``iccprofiles/`` directory of the ROM file system is searched.
+
+.. note ::
+
+ A note for Windows users, Artifex recommends the use of the forward slash delimiter due to the special interpretation of ``\"`` by the Microsoft C startup code. See `Parsing C Command-Line Arguments`_ for more information.
+
+
+
+Other parameters
+"""""""""""""""""""""""
+
+**-dFILTERIMAGE**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ If set, this will ignore all images in the input (in this context image means a bitmap), these will therefore not be rendered.
+
+**-dFILTERTEXT**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ If set, this will ignore all text in the input (just because it looks like text doesn't mean it is, it might be an image), text will therefore not be rendered.
+
+**-dFILTERVECTOR**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ If set, this will ignore anything which is neither text nor an image.
+
+**-dDELAYBIND**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Causes bind to remember all its invocations, but not actually execute them until the :ref:`.bindnow<Language_BindNow>` procedure is called. Useful only for certain specialized packages like pstotext that redefine operators. See the documentation for :ref:`.bindnow<Language_BindNow>` for more information on using this feature.
+
+**-dDOPDFMARKS**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Causes pdfmark to be called for bookmarks, annotations, links and cropbox when processing PDF files. Normally, ``pdfmark`` is only called for these types for PostScript files or when the output device requests it (e.g. :title:`pdfwrite` device).
+
+
+**-dJOBSERVER**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Define ``\004 (^D)`` to start a new encapsulated job used for compatibility with Adobe PS Interpreters that ordinarily run under a job server. The ``-dNOOUTERSAVE`` switch is ignored if ``-dJOBSERVER`` is specified since job servers always execute the input PostScript under a save level, although the ``exitserver`` operator can be used to escape from the encapsulated job and execute as if the ``-dNOOUTERSAVE`` was specified.
+ This also requires that the input be from stdin, otherwise an error will result (Error: ``/invalidrestore in --restore--``).
+
+ Example usage is:
+
+.. code-block :: bash
+
+ gs ... -dJOBSERVER - < inputfile.ps
+
+ Or:
+
+.. code-block :: bash
+
+ cat inputfile.ps | gs ... -dJOBSERVER -
+
+.. note::
+
+ The ``^D`` does not result in an end-of-file action on stdin as it may on some PostScript printers that rely on TBCP (Tagged Binary Communication Protocol) to cause an out-of-band ``^D`` to signal EOF in a stream input data. This means that direct file actions on ``stdin`` such as ``flushfile`` and ``closefile`` will affect processing of data beyond the ``^D`` in the stream.
+
+**-dNOCACHE**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Disables character caching. Useful only for debugging.
+
+**-dNOGC**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Suppresses the initial automatic enabling of the garbage collector in Level 2 systems. (The ``vmreclaim`` operator is not disabled.) Useful only for debugging.
+
+**-dNOOUTERSAVE**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Suppresses the initial save that is used for compatibility with Adobe PS Interpreters that ordinarily run under a job server. If a job server is going to be used to set up the outermost save level, then ``-dNOOUTERSAVE`` should be used so that the restore between jobs will restore global VM as expected.
+
+**-dNOSAFER**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Equivalent to ``-dDELAYSAFER``.
+
+ This flag disables ``SAFER`` mode until the ``.setsafe`` procedure is run. This is intended for clients or scripts that cannot operate in ``SAFER`` mode. If Ghostscript is started with ``-dNOSAFER`` or ``-dDELAYSAFER``, PostScript programs are allowed to read, write, rename or delete any files in the system that are not protected by operating system permissions.
+
+ This mode should be used with caution, and ``.setsafe`` should be run prior to running any PostScript file with unknown contents.
+
+
+
+
+.. _Use Safer:
+.. _dSAFER:
+
+
+**-dSAFER**
+^^^^^^^^^^^^
+
+ .. important ::
+
+ Ghostscript now (as of 9.50) defaults to ``SAFER`` being active.
+
+ Enables access controls on files. Access controls fall into three categories, files from which Ghostscript is permitted to read, ones to which it is permitted to write, and ones over which it has "control" (i.e. delete/rename). These access controls apply to all files accessed via Ghostscript's internal interface to the C library file handling. Whilst we have taken considerable pains to ensure that all the code we maintain (as well as the so called "contrib" devices, that are devices included in our release packages, but not strictly maintained by the Ghostscript development team) uses this interface, we have no control over thirdparty code.
+
+
+ This is an entirely new implementation of ``SAFER`` for Ghostscript versions 9.50 and later. Earlier versions (see :ref:`-dOLDSAFER<dOLDSAFER>`) relied on storing the file permission lists in Postscript VM (Virtual Memory), and only applied file access permissions to the Postscript file related operators. It relied on restricting the function of setpagedevice to avoid the device code from being manipulated into opening arbitrary files. The application of the file permissions was done within the internal context of the Postscript interpreter, and some other aspects of the Postscript restrictions were applied in the Postscript environment. With so many of the feature's capabilities relying on the Postscript context and environment, by using other (Ghostscript specific) features maliciously, the restrictions could be overridden.
+
+ Whilst the path storage and application of the permissions is implemented entirely in C, it is still possible for Postscript to add and remove paths from the permissions lists (see .addcontrolpath) until such time as the access controls are enabled (see :ref:`.activatepathcontrol<Language_ActivateControlPath>`), any call to :ref:`.addcontrolpath<Language_AddControlPath>` after :ref:`.activatepathcontrol<Language_ActivateControlPath>` will result in a ``Fatal`` error causing the interpreter to immediately exit.
+
+ An incompatibility exists between the pre-9.50 and 9.50 and later ``SAFER``. By removing storage and application entirely from the Postscript language environment and internal context, ``SAFER`` is no longer affected by Postscript save/restore operations. Previously, it was possible to do the equivalent of:
+
+
+ .. code-block :: bash
+
+ save
+ .setsafe
+ Postscript ops
+ restore
+
+ In that sequence, the Postscript ops would run with ``SAFER`` protection but after the restore, ``SAFER`` would no longer be in force. This is no longer the case. After the call to ``.setsafe`` the file controls are in force until the interpreter exits. As the 9.50 and later implementation no longer restricts the operation of ``setpagedevice``, and because this capability is extremely rarely used, we feel the improvement in security warrants the small reduction in flexibility.
+
+ Path matching is very simple: it is case sensitive, and we do not implement full featured "globbing" or regular expression matching (such complexity would significantly and negatively impact performance). Further, the string parameter(s) passed to the ``--permit-file-*`` option must exactly match the string(s) used to reference the file(s): for example, you cannot use an absolute path to grant permission, and then a relative path to reference the file (or vice versa) - the path match will fail. Similarly, you cannot grant permission through one symlink, and then reference a file directly, or through an alternative symlink - again, the matching will fail.
+
+
+ The following cases are handled:
+
+ .. code-block :: bash
+
+ "/path/to/file"
+
+ Permits access only to the file: "/path/to/file"
+
+ .. code-block :: bash
+
+ "/path/to/directory/"
+
+ Permits access to any file in, and only in, the directory: "/path/to/directory"
+
+ .. code-block :: bash
+
+ "/path/to/directory/*"
+
+ Permits access to any file in the directory: "/path/to/directory" and any child of that directory.
+
+
+ .. important :: Note for Windows Users
+
+ The file/path pattern matching is case sensitive, even on Windows. This is a change in behaviour compared to the old code which, on Windows, was case insensitive. This is in recognition of changes in Windows behaviour, in that it now supports (although does not enforce) case sensitivity.
+
+
+ Four command line parameters permit explicit control of the paths included in the access control lists:
+
+ .. code-block :: bash
+
+ --permit-file-read=pathlist
+
+ Adds a path, or list of paths, to the "permit read" list. A list of paths is a series of paths separated by the appropriate path list separator for your platform (for example, on Unix-like systems it is ":" and on MS Windows it is ";").
+
+ .. code-block :: bash
+
+ --permit-file-write=pathlist
+
+ Adds a path, or list of paths, to the "permit write" list. A list of paths is a series of paths separated by the appropriate path list separator for your platform (for example, on Unix-like systems it is ":" and on MS Windows it is ";").
+
+ .. code-block :: bash
+
+ --permit-file-control=pathlist
+
+ Adds a path, or list of paths, to the "permit control" list. A list of paths is a series of paths separated by the appropriate path list separator for your platform (for example, on Unix-like systems it is ":" and on MS Windows it is ";").
+
+ .. code-block :: bash
+
+ --permit-file-all=pathlist
+
+ Adds a path, or list of paths, to the all the above lists. A list of paths is a series of paths separated by the appropriate path list separator for your platform (for example, on Unix-like systems it is ":" and on MS Windows it is ";").
+
+ '``*``' may be used as a wildcard in the above paths to mean "any character other than the directory separator. Do not use two or more ``*``'s without intervening characters.
+
+ Finally, paths supplied on the command line (such as those in ``-I``, ``-sFONTPATH`` parameters) are added to the permitted reading list. Similarly, paths read during initialisation from ``Fontmap``, ``cidfmap``, and the platform specific font file enumeration (e.g. ``fontconfig`` on Unix systems) are automatically added to the permit read lists.
+
+
+
+
+.. _dOLDSAFER:
+
+**-dOLDSAFER**
+^^^^^^^^^^^^^^^^^^
+
+ .. important :: This enables deprecated code which will shortly be removed.
+
+ Used in combination with ``-dSAFER`` (or ``.setsafe``) enables the pre-9.50 ``SAFER`` implementation. It is included (for now) in case any users find a case where the 9.50 and later ``SAFER`` does not work for them. It means such users can keep working until we have assessed the issue, and distributed a solution.
+
+ Disables the ``deletefile`` and ``renamefile`` operators, and the ability to open piped commands (``%pipe%cmd``) at all. Only ``%stdout`` and ``%stderr`` can be opened for writing. Disables reading of files other than ``%stdin``, those given as a command line argument, or those contained on one of the paths given by ``LIBPATH`` and ``FONTPATH`` and specified by the system params ``/FontResourceDir`` and ``/GenericResourceDir``.
+
+ This mode also sets the :ref:`.LockSafetyParams<Language_LockSafetyParams>` parameter of the default device, or the device specified with the ``-sDEVICE=`` switch to protect against programs that attempt to write to files using the ``OutputFile`` device parameter. Note that since the device parameters specified on the command line (including ``OutputFile``) are set prior to ``SAFER`` mode, the ``-sOutputFile=...`` on the command line is unrestricted.
+
+ ``SAFER`` mode also prevents changing the ``/GenericResourceDir``, ``/FontResourceDir`` and either the ``/SystemParamsPassword`` or the ``/StartJobPassword``.
+
+ When running ``-dNOSAFER`` it is possible to perform a save, followed by ``.setsafe``, execute a file or procedure in ``SAFER`` mode, then use restore to return to ``NOSAFER`` mode. It is possible that a crafted foreign file could restore back to a point when ``NOSAFER`` was in operation.
+
+**-dPreBandThreshold=** *true/false*
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ If the target device is a halftone device, then images that are normally stored in the command list during banded output will be halftoned during the command list writing phase, if the resulting image will result in a smaller command list. The decision to halftone depends upon the output and source resolution as well as the output and source color space.
+
+**-dWRITESYSTEMDICT**
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ Leaves systemdict writable. This is necessary when running special utility programs such as ``font2c`` and ``pcharstr``, which must bypass normal PostScript access protection.
+
+
+.. _Use_Improving Performance:
+
+Improving performance
+----------------------------------------------
+
+Ghostscript attempts to find an optimum balance between speed and memory consumption, but there are some cases in which you may get a very large speedup by telling Ghostscript to use more memory.
+
+Please note that this discussion relates to devices which produce a bitmap format as the output. These parameters have no effect on the vector devices, such as :title:`pdfwrite`.
+
+- For raster printers and image format (jpeg*, tiff*, png* ...) devices, performance can be 'tuned' by adjusting some of the parameters related to banding (clist) options (refer to: :ref:`Banding Parameters<Language_BandingParams>`).
+
+- All devices may use a display list ("clist") and use banding when rendering PDF 1.4 transparency. This prevents allocation of excessively large amounts of memory for the transparency buffer stack. The ``-dMaxBitmap=`` option is used to control when to use the display list, and the other banding parameters mentioned above control the band size.
+
+ In general, page buffer mode is faster than banded/clist mode (a full page buffer is used when ``-dMaxBitmap=#`` is large enough for the entire raster image) since there is no need to write, then interpret the clist data.
+
+ On a multi-core system where multiple threads can be dispatched to individual processors/cores, banding mode may provide higher performance since ``-dNumRenderingThreads=#`` can be used to take advantage of more than one CPU core when rendering the clist. The number of threads should generally be set to the number of available processor cores for best throughput.
+
+ In general, larger ``-dBufferSpace=#`` values provide slightly higher performance since the per-band overhead is reduced.
+
+- If you are using X Windows, setting the ``-dMaxBitmap=`` parameter described in `X device parameters`_ may dramatically improve performance on files that have a lot of bitmap images.
+
+- With some PDF files, or if you are using Chinese, Japanese, or other fonts with very large character sets, adding the following sequence of switches before the first file name may dramatically improve performance at the cost of an additional memory. For example, to allow use of 30Mb of extra RAM use: ``-c 30000000 setvmthreshold -f``.
+
+ This can also be useful in processing large documents when using a high-level (vector) output device (like :title:`pdfwrite`) that maintains significant internal state.
+
+- For pattern tiles that are very large, Ghostscript uses an internal display list (memory based clist), but this can slow things down. The current default threshold is 8Mb -- pattern tiles larger than this will be cached as clist rather than bitmap tiles. The parameter ``-dMaxPatternBitmap=#`` can be used to adjust this threshold, smaller to reduce memory requirements and larger to avoid performance impacts due to clist based pattern handling.
+
+ For example, ``-dMaxPatternBitmap=200000`` will use clist based patterns for pattern tiles larger than 200,000 bytes.
+
+
+
+Summary of environment variables
+----------------------------------------------
+
+GS, GSC (MS Windows only)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Specify the names of the Ghostscript executables. ``GS`` brings up a new typein window and possibly a graphics window; GSC uses the DOS console. If these are not set, ``GS`` defaults to ``gswin32``, and ``GSC`` defaults to ``gswin32c``.
+
+GS_DEVICE
+~~~~~~~~~~~~~~
+ Defines the default output device. This overrides the compiled-in default, but is overridden by any command line setting.
+
+GS_FONTPATH
+~~~~~~~~~~~~~~
+ Specifies a list of directories to scan for fonts if a font requested can't be found anywhere on the search path.
+
+GS_LIB
+~~~~~~~~~~
+ Provides a search path for initialization files and fonts.
+
+GS_OPTIONS
+~~~~~~~~~~~~~
+ Defines a list of command-line arguments to be processed before the ones actually specified on the command line. For example, setting ``GS_DEVICE`` to ``XYZ`` is equivalent to setting ``GS_OPTIONS`` to ``-sDEVICE=XYZ``. The contents of ``GS_OPTIONS`` are not limited to switches; they may include actual file names or even "@file" arguments.
+
+TEMP, TMPDIR
+~~~~~~~~~~~~~~~~
+ Defines a directory name for temporary files. If both ``TEMP`` and ``TMPDIR`` are defined, ``TMPDIR`` takes precedence.
+
+
+.. _Use_Debugging:
+
+
+Debugging
+----------------------------------------------
+
+The information here describing is probably interesting only to developers.
+
+Debug switches
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are several debugging switches that are detected by the interpreter. These switches are available whether or not Ghostscript was built with the ``DEBUG`` macro defined to the compiler (refer to building a debugging configuration).
+
+Previous to 8.10, there was a single ``DEBUG`` flag, enabled with ``-dDEBUG`` on the command line. Now there are several debugging flags to allow more selective debugging information to be printed containing only what is needed to investigate particular areas. For backward compatibilty, the ``-dDEBUG`` option will set all of the subset switches.
+
+
+.. list-table::
+ :widths: 50 50
+
+ * - -dCCFONTDEBUG
+ - Compiled Fonts
+ * - -dCFFDEBUG
+ - CFF Fonts
+ * - -dCMAPDEBUG
+ - CMAP
+ * - -dDOCIEDEBUG
+ - CIE color
+ * - -dEPSDEBUG
+ - EPS handling
+ * - -dFAPIDEBUG
+ - Font API
+ * - -dINITDEBUG
+ - Initialization
+ * - -dPDFDEBUG
+ - PDF Interpreter
+ * - -dPDFWRDEBUG
+ - PDF Writer
+ * - -dSETPDDEBUG
+ - setpagedevice
+ * - -dSTRESDEBUG
+ - Static Resources
+ * - -dTTFDEBUG
+ - TTF Fonts
+ * - -dVGIFDEBUG
+ - ViewGIF
+ * - -dVJPGDEBUG
+ - ViewJPEG
+
+The PDF interpreter normally tries to repair, or ignore, all problems encountered in PDF files. Setting ``-dPDFSTOPONERROR`` instead causes the interpreter to signal an error and stop processing the PDF file, instead of printing a warning.
+
+The ``-dPDFSTOPONWARNING`` switch behaves the same, but will stop if a condition which would normally merit a warning (instead of an error) is encountered. Note that setting ``-dPDFSTOPONWARNING`` also sets ``-dPDFSTOPONERROR``.
+
+The ``-Z`` and ``-T`` switches apply only if the interpreter was :ref:`built for a debugging configuration<Make_Debugging>`. In the table below, the first column is a debugging switch, the second is an equivalent switch (if any) and the third is its usage.
+
+
+
+.. list-table::
+ :widths: 20 20 60
+ :header-rows: 1
+
+ * - Switch
+ - Equivalent switch
+ - Usage
+ * - ``0``
+ -
+ - garbage collector, minimal detail
+ * - ``1``
+ -
+ - type 1 and type 42 font interpreter
+ * - ``2``
+ -
+ - curve subdivider/rasterizer
+ * -
+ - ``3``
+ - curve subdivider/rasterizer, detail
+ * - ``4``
+ -
+ - garbage collector (strings)
+ * -
+ - ``5``
+ - garbage collector (strings, detail)
+ * - ``6``
+ -
+ - garbage collector (clumps, roots)
+ * -
+ - ``7``
+ - garbage collector (objects)
+ * -
+ - ``8``
+ - garbage collector (refs)
+ * -
+ - ``9``
+ - garbage collector (pointers)
+ * - ``a``
+ -
+ - allocator (large blocks only)
+ * -
+ - ``A``
+ - allocator (all calls)
+ * - ``b``
+ -
+ - bitmap image processor
+ * -
+ - ``B``
+ - bitmap images, detail
+ * - ``c``
+ -
+ - color/halftone mapper
+ * - ``d``
+ -
+ - dictionary put/undef
+ * -
+ - ``D``
+ - dictionary lookups
+ * - ``e``
+ -
+ - external (OS-related) calls
+ * - ``f``
+ -
+ - fill algorithm (summary)
+ * -
+ - ``F``
+ - fill algorithm (detail)
+ * - ``g``
+ -
+ - gsave/grestore[all]
+ * - ``h``
+ -
+ - halftone renderer
+ * -
+ - ``H``
+ - halftones, every pixel
+ * - ``i``
+ -
+ - interpreter, just names
+ * -
+ - ``I``
+ - interpreter, everything
+ * - ``j``
+ -
+ - (Japanese) composite fonts
+ * - ``k``
+ -
+ - character cache and xfonts
+ * -
+ - ``K``
+ - character cache, every access
+ * - ``l``
+ -
+ - command lists, bands
+ * -
+ - ``L``
+ - command lists, everything
+ * - ``m``
+ -
+ - makefont and font cache
+ * - ``n``
+ -
+ - name lookup (new names only)
+ * - ``o``
+ -
+ - outliner (stroke)
+ * -
+ - ``O``
+ - stroke detail
+ * - ``p``
+ -
+ - band list paths
+ * -
+ - ``P``
+ - all paths
+ * - ``q``
+ -
+ - clipping
+ * - ``r``
+ -
+ - arc renderer
+ * - ``s``
+ -
+ - streams
+ * -
+ - ``S``
+ - scanner
+ * - ``t``
+ -
+ - tiling algorithm
+ * - ``u``
+ -
+ - undo saver (for save/restore), finalization
+ * -
+ - ``U``
+ - undo saver, more detail
+ * - ``v``
+ -
+ - compositors: alpha/transparency/overprint/rop
+ * -
+ - ``V``
+ - compositors: alpha/transparency/overprint/rop, more detail
+ * - ``w``
+ -
+ - compression encoder/decoder
+ * - ``x``
+ -
+ - transformations
+ * - ``y``
+ -
+ - Type 1 hints
+ * -
+ - ``Y``
+ - Type 1 hints, every access
+ * - ``z``
+ -
+ - trapezoid fill
+ * - ``#``
+ -
+ - operator error returns
+ * - ``%``
+ -
+ - externally processed comments
+ * - ``*``
+ -
+ - image and RasterOp parameters
+ * - ``:``
+ -
+ - command list and allocator/time summary
+ * - ``~``
+ -
+ - math functions and Functions
+ * - ``'``
+ -
+ - contexts, create/destroy
+ * -
+ - ``"``
+ - contexts, every operation
+ * - ``^``
+ -
+ - reference counting
+ * - ``_``
+ -
+ - high-level (vector) output
+ * - ``!``
+ -
+ - Postscript operator names (this option is available only when Ghostscript is compiled with a predefined macro DEBUG_TRACE_PS_OPERATORS)
+ * - ``|``
+ -
+ - (reserved for experimental code)
+
+
+The following switch affects what is printed, but does not select specific items for printing:
+
+
+.. list-table::
+ :widths: 20 20 60
+ :header-rows: 1
+
+ * - Switch
+ - Equivalent switch
+ - Usage
+ * - ``/``
+ -
+ - include file name and line number on all trace output
+
+
+These switches select debugging options other than what should be printed:
+
+.. We need to add a special piece of raw HTML to print a dingle backtick character in RST
+
+.. |bt| raw:: html
+
+ <code class="code docutils literal notranslate">`</code>
+
+
+.. list-table::
+ :widths: 20 20 60
+ :header-rows: 1
+
+ * - Switch
+ - Equivalent switch
+ - Usage
+ * - ``$``
+ -
+ - set unused parts of object references to identifiable garbage values
+ * - ``+``
+ -
+ - use minimum-size stack blocks
+ * - ``,``
+ -
+ - don't use path-based banding
+ * - |bt|
+ -
+ - don't use high-level banded images
+ * - ``?``
+ -
+ - validate pointers before, during and after garbage collection, also before and after save and restore; also make other allocator validity checks
+ * - ``@``
+ -
+ - fill newly allocated, garbage-collected, and freed storage with a marker (a1, c1, and f1 respectively)
+ * - ``f``
+ -
+ - the filling algorithm with characters
+ * -
+ - ``F``
+ - the filling algorithm with non-character paths
+ * - ``h``
+ -
+ - the Type 1 hinter
+ * - ``s``
+ -
+ - the shading algorithm
+ * -
+ - ``S``
+ - the stroking algorithm
+
+
+Switches used in debugging
+"""""""""""""""""""""""""""
+
+
+.. list-table::
+ :widths: 50 50
+ :header-rows: 1
+
+ * - Switch
+ - Description
+ * - ``-Bsize``
+ - Run all subsequent files named on the command line (except for ``-F``) through the ``run_string`` interface, using a buffer of size bytes.
+ * - ``-B-``
+ - Turn off ``-B``: run subsequent files (except for ``-F``) directly in the normal way.
+ * - ``-Ffile``
+ - Execute the file with ``-B1`` temporarily in effect
+ * - ``-Kn``
+ - Limit the total amount of memory that the interpreter can have allocated at any one time to nK bytes. n is a positive decimal integer.
+ * - ``-Mn``
+ - Force the interpreter's allocator to acquire additional memory in units of nK bytes, rather than the default 20K.
+
+ n is a positive decimal integer, on 16-bit systems no greater than 63.
+ * - ``-Nn``
+ - Allocate space for nK names, rather than the default (normally 64K).
+
+ n may be greater than 64 only if ``EXTEND_NAMES`` was defined (in ``inameidx.h``) when the interpreter was compiled.
+ * - ``-Zxxx``
+
+ ``-Z-xxx``
+ - Turn debugging printout on (off). Each of the xxx characters selects an option.
+
+ Case is significant: "a" and "A" have different meanings.
+ * - ``-Txxx``
+
+ ``-T-xxx``
+ - Turn Visual Trace on (off). Each of the xxx characters selects an option.
+
+ Case is significant: "f" and "F" have different meanings.
+
+
+
+In addition, calling Ghostscript with ``--debug`` will list all the currently defined (non visual trace) debugging flags, both in their short form (as listed above for use with ``-Z``) and in a long form, which can be used as in: ``--debug=tiling,alloc``. All the short form flags for ``-Z`` have an equivalent long form. Future flags may be added with a long form only (due to all the short form flags being used already).
+
+
+
+
+Visual Trace
+~~~~~~~~~~~~~~~~~~
+
+Visual Trace allows to view internal Ghostscript data in a graphical form while execution of C code. Special :ref:`instructions<Lib_VisualTrace>` to be inserted into C code for generating the output. Client application rasterizes it into a window.
+
+Currently the rasterization is implemented for Windows only, in clients ``gswin32.exe`` and ``gswin32c.exe``. They open Visual Trace window when graphical debug output appears, ``-T`` :ref:`switch<Debug switches>` is set, and Ghostscript was :ref:`built<Make_Debugging>` with ``DEBUG`` option.
+
+There are two important incompletenesses of the implementation :
+
+#. The graphical output uses a hardcoded scale. An advanced client would provide a scale option via user interface.
+
+#. Breaks are not implemented in the client. If you need a step-by-step view, you should use an interactive C debugger to delay execution at breakpoints.
+
+
+.. _Known Paper Sizes:
+
+
+Appendix: Paper sizes known to Ghostscript
+----------------------------------------------
+
+The paper sizes known to Ghostscript are defined at the beginning of the initialization file ``gs_statd.ps``; see the comments there for more details about the definitions. The table here lists them by name and size. ``gs_statd.ps`` defines their sizes exactly in points, and the dimensions in inches (at 72 points per inch) and centimeters shown in the table are derived from those, rounded to the nearest 0.1 unit. A guide to international paper sizes can be found at `papersizes.org`_.
+
+
+U.S. standard
+~~~~~~~~~~~~~~~~
+
+.. list-table::
+ :widths: 20 20 20 20 20
+ :header-rows: 2
+
+ * - Name
+ - Inches
+ - mm
+ - Points
+ - Notes
+ * -
+ - W x H
+ - W x H
+ - W x H
+ -
+ * - 11 x 17
+ - 11.0 x 17.0
+ - 279 x 432
+ - 792 x 1224
+ - 11×17in portrait
+ * - ledger
+ - 17.0 x 11.0
+ - 432 x 279
+ - 1224 x 792
+ - 11×17in landscape
+ * - legal
+ - 8.5 x 14.0
+ - 216 x 356
+ - 612 x 1008
+ -
+ * - letter
+ - 8.5 x 11.0
+ - 216 x 279
+ - 612 x 792
+ -
+ * - letter small
+ - 8.5 x 11.0
+ - 216 x 279
+ - 612 x 792
+ -
+ * - archA
+ - 9.0 x 12.0
+ - 229 x 305
+ - 648 x 864
+ -
+ * - archB
+ - 12.0 x 18.0
+ - 305 x 457
+ - 864 x 1296
+ -
+ * - archC
+ - 18.0 x 24.0
+ - 457 x 610
+ - 1296 x 1728
+ -
+ * - archD
+ - 24.0 x 36.0
+ - 610 x 914
+ - 1728 x 2592
+ -
+ * - archE
+ - 36.0 x 48.0
+ - 914 x 1219
+ - 2592 x 3456
+ -
+
+ISO standard
+~~~~~~~~~~~~~~~~
+
+
+.. list-table::
+ :widths: 20 20 20 20 20
+ :header-rows: 2
+
+ * - Name
+ - Inches
+ - mm
+ - Points
+ - Notes
+ * -
+ - W x H
+ - W x H
+ - W x H
+ -
+ * - a0
+ - 33.1 x 46.8
+ - 841 x 1189
+ - 2384 x 3370
+ -
+ * - a1
+ - 23.4 x 33.1
+ - 594 x 841
+ - 1684 x 2384
+ -
+ * - a2
+ - 16.5 x 23.4
+ - 420 x 594
+ - 1191 x 1684
+ -
+ * - a3
+ - 11.7 x 16.5
+ - 297 x 420
+ - 842 x 1191
+ -
+ * - a4
+ - 8.3 x 11.7
+ - 210 x 297
+ - 595 x 842
+ -
+ * - a4small
+ - 8.3 x 11.7
+ - 210 x 297
+ - 595 x 842
+ -
+ * - a5
+ - 5.8 x 8.3
+ - 148 x 210
+ - 420 x 595
+ -
+ * - a6
+ - 4.1 x 5.8
+ - 105 x 148
+ - 297 x 420
+ -
+ * - a7
+ - 2.9 x 4.1
+ - 74 x 105
+ - 210 x 297
+ -
+ * - a8
+ - 2.1 x 2.9
+ - 52 x 74
+ - 148 x 210
+ -
+ * - a9
+ - 1.5 x 2.1
+ - 37 x 52
+ - 105 x 148
+ -
+ * - a10
+ - 1.0 x 1.5
+ - 26 x 37
+ - 73 x 105
+ -
+ * - isob0
+ - 39.4 x 55.7
+ - 1000 x 1414
+ - 2835 x 4008
+ -
+ * - isob1
+ - 27.8 x 39.4
+ - 707 x 1000
+ - 2004 x 2835
+ -
+ * - isob2
+ - 19.7 x 27.8
+ - 500 x 707
+ - 1417 x 2004
+ -
+ * - isob3
+ - 13.9 x 19.7
+ - 353 x 500
+ - 1001 x 1417
+ -
+ * - isob4
+ - 9.8 x 13.9
+ - 250 x 353
+ - 709 x 1001
+ -
+ * - isob5
+ - 6.9 x 9.8
+ - 176 x 250
+ - 499 x 709
+ -
+ * - isob6
+ - 4.9 x 6.9
+ - 125 x 176
+ - 354 x 499
+ -
+ * - c0
+ - 36.1 x 51.1
+ - 917 x 1297
+ - 2599 x 3677
+ -
+ * - c1
+ - 25.5 x 36.1
+ - 648 x 917
+ - 1837 x 2599
+ -
+ * - c2
+ - 18.0 x 25.5
+ - 458 x 648
+ - 1298 x 1837
+ -
+ * - c3
+ - 12.8 x 18.0
+ - 324 x 458
+ - 918 x 1298
+ -
+ * - c4
+ - 9.0 x 12.8
+ - 229 x 324
+ - 649 x 918
+ -
+ * - c5
+ - 6.4 x 9.0
+ - 162 x 229
+ - 459 x 649
+ -
+ * - c6
+ - 4.5 x 6.4
+ - 114 x 162
+ - 323 x 459
+ -
+
+
+
+JIS standard
+~~~~~~~~~~~~~~~~
+
+.. list-table::
+ :widths: 20 20 20
+ :header-rows: 2
+
+ * - Name
+ - mm
+ - Notes
+ * -
+ - W x H
+ -
+ * - jisb0
+ - 1030 x 1456
+ -
+ * - jisb1
+ - 728 x 1030
+ -
+ * - jisb2
+ - 515 x 728
+ -
+ * - jisb
+ - 364 x 515
+ -
+ * - jisb4
+ - 257 x 364
+ -
+ * - jisb5
+ - 182 x 257
+ -
+ * - jisb6
+ - 128 x 182
+ -
+
+
+
+ISO/JIS switchable
+~~~~~~~~~~~~~~~~~~~~
+
+.. list-table::
+ :widths: 20
+ :header-rows: 1
+
+ * - Name
+ * - b0
+ * - b1
+ * - b2
+ * - b3
+ * - b4
+ * - b5
+
+.. note::
+
+ Initially the B paper sizes are the ISO sizes, e.g., **b0** is the same as **isob0**. Running the file ``lib/jispaper.ps`` makes the B paper sizes be the JIS sizes, e.g., **b0** becomes the same as **jisb0**.
+
+
+
+Other
+~~~~~~~~~~~
+
+.. list-table::
+ :widths: 20 20 20 20 20
+ :header-rows: 2
+
+ * - Name
+ - Inches
+ - mm
+ - Points
+ - Notes
+ * -
+ - W x H
+ - W x H
+ - W x H
+ -
+ * - flsa
+ - 8.5 x 13.0
+ - 216 x 330
+ - 612 x 936
+ - U.S. foolscap
+ * - flse
+ - 8.5 x 13.0
+ - 216 x 330
+ - 612 x 936
+ - European foolscap
+ * - halfletter
+ - 5.5 x 8.5
+ - 140 x 216
+ - 396 x 612
+ -
+ * - hagaki
+ - 3.9 x 5.8
+ - 100 x 148
+ - 283 x 420
+ - Japanese postcard
+
+
+.. External links
+
+
+
+.. _GS9 Color Management: https://ghostscript.com/doc/current/GS9_Color_Management.pdf
+.. _Parsing C Command-Line Arguments: http://msdn.microsoft.com/en-us/library/a1y7w461.aspx
+.. _papersizes.org: https://www.papersizes.org/
+
+
+
+.. include:: footer.rst
+
diff --git a/doc/src/VectorDevices.rst b/doc/src/VectorDevices.rst
new file mode 100644
index 00000000..aa082d5c
--- /dev/null
+++ b/doc/src/VectorDevices.rst
@@ -0,0 +1,1303 @@
+.. title:: High Level Devices
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _VectorDevices.htm:
+
+
+High Level Devices
+===================================
+
+
+High level devices are Ghostscript output devices which do not render to a raster, in general they produce 'vector' as opposed to bitmap output. Such devices currently include: :title:`pdfwrite`, :title:`ps2write`, :title:`eps2write`, :title:`txtwrite`, :title:`xpswrite`, :title:`pxlmono`, :title:`pxlcolor` and :title:`docxwrite`.
+
+Although these devices produce output which is not a raster, they still work in the same general fashion as all Ghostscript devices. The input (PostScript, PDF, XPS, PCL or PXL) is handled by an appropriate interpreter, the interpreter processes the input and produces from it a sequence of drawing 'primitives' which are handed to the device. The device decides whether to handle the primitive itself, or call upon the graphics library to render the primitive to the final raster.
+
+Primitives are quite low level graphics operations; as an example consider the PDF sequence ``'0 0 100 100 re f'``. This constructs a rectangle with the bottom left corner at 0,0 which is 100 units wide by 100 units high, and fills it with the current color. A lower level implementation using only primitives would first move the current point to 0,0, then construct a line to 0,100, then a line to 100,100, a line to 100, 0 and finally a line back to 0,0. It would then fill the result.
+
+Obviously that's a simple example but it serves to demonstrate the point.
+
+Now the raster devices all call the graphics library to process primitives (though they may choose to take some action first) and render the result to a bitmap. The high level devices instead reassemble the primitives back into high level page description and write the result to a file. This means that the output, while it should be visually the same as the input (because it makes the same marks), is not the same as the original input, even if the output Page Description Language is the same as the input one was (eg PDF to PDF).
+
+Why is this important? Firstly because the description of the page won't be the same, if your workflow relies upon (for example) finding rectangles in the description then it might not work after it has been processed by a high level device, as the rectangles may all have turned into lengthy path descriptions.
+
+In addition, any part of the original input which does not actually make marks on the page (such as hyperlinks, bookmarks, comments etc) will normally not be present in the output, even if the output is the same format. In general the PDF interpreter and the PDF output device (:title:`pdfwrite`) try to preserve the non-marking information from the input, but some kinds of content are not carried across, in particular comments are not preserved.
+
+We often hear from users that they are 'splitting' PDF files, or 'modifying' them, or converting them to PDF/A, and it's important to realize that this is not what's happening. Instead, a new PDF file is being created, which should look the same as the original, but the actual insides of the PDF file are not the same as the original. This may not be a problem, but if it's important to keep the original contents, then you need to use a different tool (we'd suggest MuPDF_, also available from Artifex). Of course, if the intention is to produce a modified PDF file (for example, reducing the resolution of images, or changing the colour space), then clearly you cannot keep the original contents unchanged, and :title:`pdfwrite` performs these tasks well.
+
+
+
+PCL-XL (PXL)
+--------------
+
+The :title:`pxlmono` and :title:`pxlcolor` devices output HP PCL-XL, a graphic language understood by many recent laser printers.
+
+Options
+~~~~~~~~~~~~
+
+
+``-dCompressMode=1 | 2 | 3 (default is 1)``
+ Set the compression algorithm used for bitmap graphics. RLE=1, JPEG=2, DeltaRow=3. When JPEG=2 is on, it is applied only to full-color images; indexed-color graphics and masks continues to be compressed with RLE.
+
+
+
+Text output
+--------------
+
+The :title:`txtwrite` device will output the text contained in the original document as Unicode.
+
+Options
+~~~~~~~~~~~~
+
+``-dTextFormat=0 | 1 | 2 | 3 | 4 (default is 3)``
+ Format 0 is intended for use by developers and outputs XML-escaped Unicode along with information regarding the format of the text (position, font name, point size, etc). The XML output is the same format as the MuPDF output, but no additional processing is performed on the content, so no block detection.
+
+ Format 1 uses the same XML output format, but attempts similar processing to MuPDF, and will output blocks of text. Note the algorithm used is not the same as the MuPDF code, and so the results will not be identical.
+
+ Format 2 outputs Unicode (UCS2) text (with a Byte Order Mark) which approximates the layout of the text in the original document.
+
+ Format 3 is the same as format 2, but the text is encoded in UTF-8.
+
+ Format 4 is internal format similar to Format 0 but with extra information.
+
+
+DOCX output
+--------------
+
+The :title:`docxwrite` device creates a DOCX file suitable for use with applications such as Word or LibreOffice, containing the text in the original document.
+
+Rotated text is placed into textboxes. Heuristics are used to group glyphs into words, lines and paragraphs; for some types of formatting, these heuristics may not be able to recover all of the original document structure.
+
+This device currently has no special configuration parameters.
+
+
+XPS file output
+----------------------------
+
+The :title:`xpswrite` device writes its output according to the Microsoft XML Paper Specification. This specification was later amended to the Open XML Paper specification, submitted to ECMA International and adopted as ECMA-388.
+
+This device currently has no special configuration parameters.
+
+
+The family of PDF and PostScript output devices
+---------------------------------------------------
+
+
+
+Common controls and features
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The PDF and PostScript (including Encapsulated PostScript, or EPS) devices have much of their code in common, and so many of the controlling parameters are also common amongst the devices. The pdfwrite, ps2write and eps2write devices create PDF or PostScript files whose visual appearance should match, as closely as possible, the appearance of the original input (PS, PDF, XPS, PCL, PXL). There are a number of caveats as mentioned in the overview above. In addition to the general comments there are some additional points that bear mentioning.
+
+PCL has a graphics model which differs significantly from the PostScript or PDF one, in particular it has a form of transparency called ``RasterOps``, some aspects of which cannot be represented in PDF at a high level (or at all, in PostScript). The :title:`pdfwrite` device makes no attempt to handle this, and the resulting PDF file will not match the original input. The only way to deal with these types of file is to render the whole page to a bitmap and then 'wrap' the bitmap as a PDF file. Currently we do not do this either, but it is possible that a future enhancement may do so.
+
+If the input contains PDF-compatible transparency, but the :title:`ps2write` device is selected, or the :title:`pdfwrite` device is selected, but has been told to limit the PDF feature set to a version less than 1.4, the transparency cannot be preserved. In this case the entire page is rendered to a bitmap and that bitmap is 'wrapped up' in appropriate PDF or PostScript content. The output should be visually the same as the input, but since it has been rendered it will not scale up or down well, unlike the original, vector, content of the input.
+
+The options in the command line may include any switches that may be used with the language interpreter appropriate for the input (see :ref:`here<Use_Command line options>` for a complete list). In addition the following options are common to all the :title:`pdfwrite` family of devices, and should work when specified on the command line with any of the language interpreters.
+
+``-rresolution``
+ Sets the resolution for pattern fills, for fonts that must be converted to bitmaps and any other rendering required (eg rendering transparent pages for output to PDF versions < 14). The default internal resolution for :title:`pdfwrite` is 720dpi.
+
+``-dUNROLLFORMS``
+ When converting from PostScript, :title:`pdfwrite` (and :title:`ps2write`) preserve the use of Form resources as Form XObjects in the output. Some badly written PostScript can cause this to produce incorrect output (the Quality Logic CET tests for example). By setting this flag, forms will be unrolled and stored in the output each time they are used, which avoids the problems. Note that the output file will of course be larger this way. We do not attempt to preserve Form XObjects from PDF files, unless they are associated with transparency groups.
+
+``-dNoOutputFonts``
+ Ordinarily the :title:`pdfwrite` device family goes to considerable lengths to preserve fonts from the input as fonts in the output. However in some highly specific cases it can be useful to have the text emitted as linework/bitmaps instead. Setting this switch will prevent these devices from emitting any fonts, all text will be stored as vectors (or bitmaps in the case of bitmapped fonts) in the page content stream. Note that this will produce larger output which will process more slowly, render differently and particularly at lower resolution produce less consistent text rendering. Use with caution.
+
+``-dCompressFonts=boolean``
+ Defines whether :title:`pdfwrite` will compress embedded fonts in the output. The default value is true; the false setting is intended only for debugging as it will result in larger output.
+
+``-dCompressStreams=boolean``
+ Defines whether :title:`pdfwrite` will compress streams other than those in fonts or pages in the output. The default value is true; the false setting is intended only for debugging as it will result in larger output.
+
+
+
+
+Distiller Parameters
+""""""""""""""""""""""
+
+Options may also include ``-dparameter=value`` or ``-sparameter=string`` switches for setting "distiller parameters", Adobe's documented parameters for controlling the conversion of PostScript into PDF. The PostScript ``setdistillerparams`` and ``currentdistillerparams`` operators are also recognized when the input is PostScript, and provide an equivalent way to set these parameters from within a PostScript input file.
+
+Although the name implies that these parameters are for controlling PDF output, in fact the whole family of devices use these same parameters to control the conversion into PostScript and EPS as well.
+
+The :title:`pdfwrite` family of devices recognize all of the Acrobat Distiller 5 parameters defined in the DistillerParameters (version 5) document available from the Adobe web site. Cells in the table below containing '=' mean that the value of the parameter is the same as in the "default" column.
+
+
+
+
+.. list-table::
+ :header-rows: 1
+
+ * - Parameter name
+ - Notes
+ - default
+ - screen
+ - ebook
+ - printer
+ - prepress
+ * - AlwaysEmbed
+ - :ref:`(13)<DistillerParameters_note_13>`
+ - [ ]
+ - =
+ - =
+ - =
+ - =
+ * - AntiAliasColorImages
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - AntiAliasGrayImages
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - AntiAliasMonoImages
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - ASCII85EncodePages
+ -
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - AutoFilterColorImages
+ - :ref:`(1)<DistillerParameters_note_1>`
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - AutoFilterGrayImages
+ - :ref:`(1)<DistillerParameters_note_1>`
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - AutoPositionEPSFiles
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - AutoRotatePages
+ -
+ - /PageByPage
+ - /PageByPage
+ - /All
+ - /None
+ - /None
+ * - Binding
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - /Left
+ - =
+ - =
+ - =
+ - =
+ * - CalCMYKProfile
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - ()
+ - =
+ - =
+ - =
+ - =
+ * - CalGrayProfile
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - ()
+ - =
+ - =
+ - =
+ - =
+ * - CalRGBProfile
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - ()
+ - =
+ - =
+ - =
+ - =
+ * - CannotEmbedFontPolicy
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - /Warning
+ - /Warning
+ - /Warning
+ - /Warning
+ - /Error
+ * - ColorACSImageDict
+ - :ref:`(13)<DistillerParameters_note_13>`
+ - :ref:`(7)<DistillerParameters_note_7>`
+ - :ref:`(10)<DistillerParameters_note_10>`
+ - :ref:`(10)<DistillerParameters_note_10>`
+ - :ref:`(8)<DistillerParameters_note_8>`
+ - :ref:`(9)<DistillerParameters_note_9>`
+ * - ColorConversionStrategy
+ - :ref:`(6)<DistillerParameters_note_6>`
+ - LeaveColorUnchanged
+ - RGB
+ - RGB
+ - UseDeviceIndependentColor
+ - LeaveColorUnchanged
+ * - ColorImageDepth
+ -
+ - -1
+ - =
+ - =
+ - =
+ - =
+ * - ColorImageDict
+ - :ref:`(13)<DistillerParameters_note_13>`
+ - :ref:`(7)<DistillerParameters_note_7>`
+ - =
+ - =
+ - =
+ - =
+ * - ColorImageFilter
+ -
+ - /DCTEncode
+ - =
+ - =
+ - =
+ - =
+ * - ColorImageDownsampleThreshold
+ -
+ - 1.5
+ - =
+ - =
+ - =
+ - =
+ * - ColorImageDownsampleType
+ - :ref:`(3)<DistillerParameters_note_3>`
+ - /Subsample
+ - /Average
+ - /Average
+ - /Average
+ - /Bicubic
+ * - ColorImageResolution
+ -
+ - 72
+ - 72
+ - 150
+ - 300
+ - 300
+ * - CompatibilityLevel
+ -
+ - 1.7
+ - 1.5
+ - 1.5
+ - 1.7
+ - 1.7
+ * - CompressPages
+ - :ref:`(14)<DistillerParameters_note_14>`
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - ConvertCMYKImagesToRGB
+ -
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - ConvertImagesToIndexed
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - CoreDistVersion
+ -
+ - 4000
+ - =
+ - =
+ - =
+ - =
+ * - CreateJobTicket
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - false
+ - false
+ - false
+ - true
+ - true
+ * - DefaultRenderingIntent
+ -
+ - /Default
+ - =
+ - =
+ - =
+ - =
+ * - DetectBlends
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - DoThumbnails
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - false
+ - false
+ - false
+ - false
+ - true
+ * - DownsampleColorImages
+ -
+ - false
+ - true
+ - true
+ - false
+ - false
+ * - DownsampleGrayImages
+ -
+ - false
+ - true
+ - true
+ - false
+ - false
+ * - DownsampleMonoImages
+ -
+ - false
+ - true
+ - true
+ - false
+ - false
+ * - EmbedAllFonts
+ -
+ - true
+ - false
+ - true
+ - true
+ - true
+ * - EmitDSCWarnings
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - EncodeColorImages
+ -
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - EncodeGrayImages
+ -
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - EncodeMonoImages
+ -
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - EndPage
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - -1
+ - =
+ - =
+ - =
+ - =
+ * - GrayACSImageDict
+ - :ref:`(13)<DistillerParameters_note_13>`
+ - :ref:`(7)<DistillerParameters_note_7>`
+ - :ref:`(7)<DistillerParameters_note_7>`
+ - :ref:`(10)<DistillerParameters_note_10>`
+ - :ref:`(8)<DistillerParameters_note_8>`
+ - :ref:`(9)<DistillerParameters_note_9>`
+ * - GrayImageDepth
+ -
+ - -1
+ - =
+ - =
+ - =
+ - =
+ * - GrayImageDict
+ - :ref:`(13)<DistillerParameters_note_13>`
+ - :ref:`(7)<DistillerParameters_note_7>`
+ - =
+ - =
+ - =
+ - =
+ * - GrayImageDownsampleThreshold
+ -
+ - 1.5
+ - =
+ - =
+ - =
+ - =
+ * - GrayImageDownsampleType
+ - :ref:`(3)<DistillerParameters_note_3>`
+ - /Subsample
+ - /Average
+ - /Bicubic
+ - /Bicubic
+ - /Bicubic
+ * - GrayImageFilter
+ -
+ - /DCTEncode
+ - =
+ - =
+ - =
+ - =
+ * - GrayImageResolution
+ -
+ - 72
+ - 72
+ - 150
+ - 300
+ - 300
+ * - ImageMemory
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - 524288
+ - =
+ - =
+ - =
+ - =
+ * - LockDistillerParams
+ -
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - LZWEncodePages
+ - :ref:`(2)<DistillerParameters_note_2>`
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - MaxSubsetPct
+ -
+ - 100
+ - =
+ - =
+ - =
+ - =
+ * - MonoImageDepth
+ -
+ - -1
+ - =
+ - =
+ - =
+ - =
+ * - MonoImageDict
+ - :ref:`(13)<DistillerParameters_note_13>`
+ - <<K -1>>
+ - =
+ - =
+ - =
+ - =
+ * - MonoImageDownsampleThreshold
+ -
+ - 1.5
+ - =
+ - =
+ - =
+ - =
+ * - MonoImageDownsampleType
+ -
+ - /Subsample
+ - /Subsample
+ - /Subsample
+ - /Subsample
+ - /Subsample
+ * - MonoImageFilter
+ -
+ - /CCITTFaxEncode
+ - =
+ - =
+ - =
+ - =
+ * - MonoImageResolution
+ -
+ - 300
+ - 300
+ - 300
+ - 1200
+ - 1200
+ * - NeverEmbed
+ - :ref:`(13)<DistillerParameters_note_13>`
+ - :ref:`(11)<DistillerParameters_note_11>` :ref:`(12)<DistillerParameters_note_12>`
+ - :ref:`(11)<DistillerParameters_note_11>` :ref:`(12)<DistillerParameters_note_12>`
+ - :ref:`(11)<DistillerParameters_note_11>` :ref:`(12)<DistillerParameters_note_12>`
+ - [] :ref:`(12)<DistillerParameters_note_12>`
+ - [] :ref:`(12)<DistillerParameters_note_12>`
+ * - OffOptimizations
+ -
+ - 0
+ - =
+ - =
+ - =
+ - =
+ * - OPM
+ -
+ - 1
+ - =
+ - =
+ - =
+ - =
+ * - Optimize
+ - :ref:`(0)<DistillerParameters_note_0>` :ref:`(5)<DistillerParameters_note_5>`
+ - false
+ - true
+ - true
+ - true
+ - true
+ * - ParseDSCComments
+ -
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - ParseDSCCommentsForDocInfo
+ -
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - PreserveCopyPage
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - PreserveEPSInfo
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - PreserveHalftoneInfo
+ -
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - PreserveOPIComments
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - false
+ - false
+ - false
+ - true
+ - true
+ * - PreserveOverprintSettings
+ -
+ - false
+ - false
+ - false
+ - true
+ - true
+ * - sRGBProfile
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - ()
+ - =
+ - =
+ - =
+ - =
+ * - StartPage
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - 1
+ - =
+ - =
+ - =
+ - =
+ * - SubsetFonts
+ -
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - TransferFunctionInfo
+ - :ref:`(4)<DistillerParameters_note_4>`
+ - /Preserve
+ - =
+ - =
+ - =
+ - =
+ * - UCRandBGInfo
+ -
+ - /Remove
+ - /Remove
+ - /Remove
+ - /Preserve
+ - /Preserve
+ * - UseFlateCompression
+ - :ref:`(2)<DistillerParameters_note_2>`
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - UsePrologue
+ - :ref:`(0)<DistillerParameters_note_0>`
+ - false
+ - =
+ - =
+ - =
+ - =
+ * - PassThroughJPEGImages
+ - :ref:`(15)<DistillerParameters_note_15>`
+ - true
+ - =
+ - =
+ - =
+ - =
+ * - PassThroughJPXImages
+ - :ref:`(16)<DistillerParameters_note_16>`
+ - true
+ - =
+ - =
+ - =
+ - =
+
+.. _DistillerParameters_note_0:
+
+Note 0
+^^^^^^^^^
+ This parameter can be set and queried, but currently has no effect.
+
+.. _DistillerParameters_note_1:
+
+Note 1
+^^^^^^^^^
+ ``-dAutoFilterxxxImages=false`` works since Ghostscript version 7.30. Older versions of Ghostscript don't examine the image to decide between JPEG and LZW or Flate compression: they always use Flate compression.
+
+.. _DistillerParameters_note_2:
+
+Note 2
+^^^^^^^^^
+ Because the LZW compression scheme was covered by patents at the time this device was created, :title:`pdfwrite` does not actually use LZW compression: all requests for LZW compression are ignored. ``UseFlateCompression`` is treated as always on, but the switch ``CompressPages`` can be set to false to turn off page level stream compression. Now that the patent has expired, we could change this should it become worthwhile.
+
+.. _DistillerParameters_note_3:
+
+Note 3
+^^^^^^^^^
+ The ``xxxDownsampleType`` parameters can also have the value ``/Bicubic`` (a Distiller 4 feature), this will use a Mitchell filter. (older versions of :title:`pdfwrite` simply used Average instead). If a non-integer downsample factor is used the code will clamp to the nearest integer (if the difference is less than 0.1) or will silently switch to the old bicubic filter, NOT the Mitchell filter.
+
+.. _DistillerParameters_note_4:
+
+Note 4
+^^^^^^^^^
+ The default for transfer functions is to preserve them, this is because transfer functions are a device-dependent feature, a set of transfer functions designed for an RGB device will give incorrect output on a CMYK device for instance. The :title:`pdfwrite` device does now support ``/Preserve``, ``/Apply`` and ``/Remove`` (the previous documentation was incorrect, application of transfer functions was not supported). PDF 2.0 deprecates the use of transfer functions, and so when producing PDF 2.0 compatible output if the ``TransferFunctionInfor`` is set to ``/Preserve`` it will be silently replaced with ``/Apply``. You can instead specifically set ``TransferFunctionInfo`` to ``/Remove`` when producing PDF 2.0 in order to avoid the transfer function being applied.
+
+.. _DistillerParameters_note_5:
+
+Note 5
+^^^^^^^^^
+ Use the ``-dFastWebView`` command line switch to 'optimize' output.
+
+.. _DistillerParameters_note_6:
+
+Note 6
+^^^^^^^^^
+ The value ``UseDeviceIndependentColorForImages`` works the same as ``UseDeviceIndependentColor``. The value sRGB actually converts to RGB with the default Ghostscript conversion. The new Ghostscript-specific value Gray converts all colors to ``DeviceGray``. With the introduction of new color conversion code in version 9.11 it is no longer necessary to set ``ProcessColorModel`` when selecting Gray, RGB or CMYK. It is also no longer necessary to set ``UseCIEColor`` for ``UseDeviceIndependentColor`` to work properly, and the use of ``UseCIEColor`` is now strongly discouraged.
+
+.. _DistillerParameters_note_7:
+
+Note 7
+^^^^^^^^^
+The default image parameter dictionary is:
+
+.. code-block:: bash
+
+ << /QFactor 0.9 /Blend 1 /HSamples [2 1 1 2] /VSamples [2 1 1 2] >>
+
+.. _DistillerParameters_note_8:
+
+Note 8
+^^^^^^^^^
+The printer ACS image parameter dictionary is:
+
+ .. code-block:: bash
+
+ << /QFactor 0.4 /Blend 1 /ColorTransform 1 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >>
+
+.. _DistillerParameters_note_9:
+
+Note 9
+^^^^^^^^^
+The prepress ACS image parameter dictionary is:
+
+ .. code-block:: bash
+
+ << /QFactor 0.15 /Blend 1 /ColorTransform 1 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >>
+
+.. _DistillerParameters_note_10:
+
+Note 10
+^^^^^^^^^
+ The screen and ebook ACS image parameter dictionary is:
+
+ .. code-block:: bash
+
+ << /QFactor 0.76 /Blend 1 /ColorTransform 1 /HSamples [2 1 1 2] /VSamples [2 1 1 2] >>
+
+.. _DistillerParameters_note_11:
+
+Note 11
+^^^^^^^^^
+ The default, screen, and ebook settings never embed the 14 standard fonts (Courier, Helvetica, and Times families, Symbol, and ZapfDingbats). This behaviour is intentional but can be overridden by:
+
+ .. code-block:: bash
+
+ << /NeverEmbed [ ] >> setdistillerparams
+
+.. _DistillerParameters_note_12:
+
+Note 12
+^^^^^^^^^
+ ``NeverEmbed`` can include CID font names. If a CID font is substituted in ``lib/cidfmap``, the substitute font name is used when the CID font is embedded, and the original CID font name is used when it is not embedded. ``NeverEmbed`` should always specify the original CID font name.
+
+.. _DistillerParameters_note_13:
+
+Note 13
+^^^^^^^^^
+ The arrays ``AlwaysEmbed`` and ``NeverEmbed`` and image parameter dictionaries ``ColorACSImageDict``, ``ColorACSImageDict``, ``ColorImageDict``, ``GrayACSImageDict``, ``GrayImageDict``, ``MonoImageDict`` cannot be specified on the command line. To specify these, you must use PostScript, either by including it in the PostScript source or by passing the ``-c`` command-line parameter to Ghostscript as described in Limitations_ below. For example, including the PostScript string in your file ``in.ps``:
+
+ .. code-block:: bash
+
+ <</AlwaysEmbed [/Helvetica /Times-Roman]>> setdistillerparams
+
+ is equivalent to invoking:
+
+ .. code-block:: bash
+
+ gs -dBATCH -dSAFER -DNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=out.pdf -c '<</AlwaysEmbed [/Helvetica /Times-Roman]>> setdistillerparams' -f in.ps
+
+ or using the extra parameters in a file:
+
+ .. code-block:: bash
+
+ @params.in
+
+ where the file ``params.in`` contains:
+
+ .. code-block:: bash
+
+ -c '<</AlwaysEmbed [/Helvetica /Times-Roman]>> setdistillerparams' -f in.ps
+
+
+.. _DistillerParameters_note_14:
+
+Note 14
+^^^^^^^^^
+ The default value of ``CompressPages`` is false for :title:`ps2write` and :title:`eps2write`.
+
+.. _DistillerParameters_note_15:
+
+Note 15
+^^^^^^^^^
+ When true image data in the source which is encoded using the DCT (JPEG) filter will not be decompressed and then recompressed on output. This prevents the multiplication of JPEG artefacts caused by lossy compression. ``PassThroughJPEGImages`` currently only affects simple JPEG images. It has no effect on JPX (JPEG2000) encoded images (see below) or masked images. In addition this parameter will be ignored if the :title:`pdfwrite` device needs to modify the source data. This can happen if the image is being downsampled, changing colour space or having transfer functions applied. Note that this parameter essentially overrides the ``EncodeColorImages`` and ``EncodeGrayImages`` parameters if they are false, the image will still be written with a ``DCTDecode`` filter. NB this feature currently only works with PostScript or PDF input, it does not work with PCL, PXL or XPS input.
+
+.. _DistillerParameters_note_16:
+
+Note 16
+^^^^^^^^^
+ When true image data in the source which is encoded using the JPX (JPEG 2000) filter will not be decompressed and then recompressed on output. This prevents the multiplication of JPEG artefacts caused by lossy compression. ``PassThroughJPXImages`` currently only affects simple JPX encoded images. It has no effect on JPEG encoded images (see above) or masked images. In addition this parameter will be ignored if the :title:`pdfwrite` device needs to modify the source data. This can happen if the image is being downsampled, changing colour space or having transfer functions applied. Note that this parameter essentially overrides the ``EncodeColorImages`` and ``EncodeGrayImages`` parameters if they are false, the image will still be written with a ``JPXDecode`` filter. NB this feature currently only works with PostScript or PDF input, it does not work with PCL, PXL or XPS input.
+
+
+
+Color Conversion and Management
+""""""""""""""""""""""""""""""""""""""""""""
+
+As of the 9.11 pre-release, the color management in the :title:`pdfwrite` family has been substantially altered so that it now uses the same Color Management System as rendering (the default is LCMS2). This considerably improves the color handling in both :title:`pdfwrite` and :title:`ps2write`, particularly in the areas of ``Separation`` and :title:`devicen` color spaces, and ``Indexed`` color spaces with images.
+
+Note that while :title:`pdfwrite` uses the same CMS as the rendering devices, this does not mean that the entire suite of options is available, as described in the ``GS9_Colour Management.pdf`` file. The colour management code has no effect at all unless either ``ColorConversionStrategy`` or ``ConvertCMYKImagesToRGB`` is set, or content has to be rendered to an image (this is rare and usually required only when converting a PDF file with transparency to a version < PDF 1.4).
+
+Options based on object type (image, text, linework) are not used, all objects are converted using the same scheme. ``-dKPreserve`` has no effect because we will not convert CMYK to CMYK. ``-dDeviceGrayToK`` also has no effect; when converting to CMYK ``DeviceGray`` objects are left in ``DeviceGray`` since that can be mapped directly to the K channel.
+
+The ``ColorConversionStrategy`` switch can now be set to ``LeaveColorUnchanged``, ``Gray``, ``RGB``, ``CMYK`` or ``UseDeviceIndependentColor``. Note that, particularly for :title:`ps2write`, ``LeaveColorUnchanged`` may still need to convert colors into a different space (ICCbased colors cannot be represented in PostScript for example). ``ColorConversionStrategy`` can be specified either as; a string by using the ``-s`` switch (``-sColorConversionStrategy=RGB``) or as a name using the ``-d`` switch (``-dColorConversionStrategy=/RGB``).
+:title:`ps2write` cannot currently convert into device-independent color spaces, and so ``UseDeviceIndependentColor`` should not be used with :title:`ps2write` (or :title:`eps2write`).
+
+All other color spaces are converted appropriately. ``Separation`` and :title:`devicen` spaces will be preserved if possible (:title:`ps2write` cannot preserve :title:`devicen` or ``Lab``) and if the alternate space is not appropriate a new alternate space will be created, e.g. a ``[/Separation (MyColor) /DeviceRGB {...}]`` when the ``ColorConversionStrategy`` is set to CMYK would be converted to ``[/Separation (MyColor) /DeviceCMYK {...}]`` The new tint transform will be created by sampling the original tint transform, converting the RGB values into CMYK, and then creating a function to linearly interpolate between those values.
+
+The ``PreserveSeparation`` switch now controls whether the :title:`pdfwrite` family of devices will attempt to preserve ``Separation`` spaces. If this is set to false then all ``Separation`` colours will be converted into the current device space specified by ``ProcessColorModel``.
+
+
+
+Setting page orientation
+""""""""""""""""""""""""""""""""""""""""""""
+
+By default Ghostscript determines viewing page orientation based on the dominant text orientation on the page. Sometimes, when the page has text in several orientations or has no text at all, wrong orientation can be selected.
+
+Acrobat Distiller parameter ``AutoRotatePages`` controls the automatic orientation selection algorithm. On Ghostscript, besides input stream, Distiller parameters can be given as command line arguments. For instance: ``-dAutoRotatePages=/None`` or ``/All`` or ``/PageByPage``.
+
+When there is no text on the page or automatic page rotation is set to ``/None`` an orientation value from ``setpagedevice`` is used. Valid values are: 0 (portrait), 3 (landscape), 2 (upside down), and 1 (seascape). The orientation can be set from the command line as ``-c "<</Orientation 3>> setpagedevice"`` using Ghostscript directly but cannot be set in ``ps2pdf``. See Limitations_ below.
+
+Ghostscript passes the orientation values from DSC comments to the :title:`pdfwrite` driver, and these are compared with the auto-rotate heuristic. If they are different then the DSC value will be used preferentially. If the heuristic is to be preferred over the DSC comments then comment parsing can be disabled by setting ``-dParseDSCComments=false``.
+
+
+Controls and features specific to PostScript and PDF input
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``-dPDFSETTINGS=configuration``
+ Presets the "distiller parameters" to one of the following predefined settings:
+
+- ``/screen`` selects low-resolution output similar to the Acrobat Distiller (up to version X) "Screen Optimized" setting.
+
+- ``/ebook`` selects medium-resolution output similar to the Acrobat Distiller (up to version X) "eBook" setting.
+
+- ``/printer`` selects output similar to the Acrobat Distiller "Print Optimized" (up to version X) setting.
+
+- ``/prepress`` selects output similar to Acrobat Distiller "Prepress Optimized" (up to version X) setting.
+
+- ``/default`` selects output intended to be useful across a wide variety of uses, possibly at the expense of a larger output file.
+
+
+.. note ::
+
+ Adobe has recently changed the names of the presets it uses in Adobe Acrobat Distiller, in order to avoid confusion with earlier versions we do not plan to change the names of the ``PDFSETTINGS`` parameters. The precise value for each control is listed in the table above.
+
+Please be aware that the ``/prepress`` setting does not indicate the highest quality conversion. Using any of these presets will involve altering the input, and as such may result in a PDF of poorer quality (compared to the input) than simply using the defaults. The 'best' quality (where best means closest to the original input) is obtained by not setting this parameter at all (or by using /default).
+
+The ``PDFSETTINGS`` presets should only be used if you are sure you understand that the output will be altered in a variety of ways from the input. It is usually better to adjust the controls individually (see the table below) if you have a genuine requirement to produce, for example, a PDF file where the images are reduced in resolution.
+
+
+
+Controls and features specific to PCL and PXL input
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Many of the controls used for distiller parameters can be used on the command line with the ``-d`` or ``-s`` switches, and these will work correctly with PCL or PXL input. However, some controls (e.g. ``/NeverEmbed``) do not take simple numeric or string arguments, and these cannot be set from the command line. When the input is PostScript or PDF we can use the ``-c`` and ``-f`` switches to send PostScript through the interpreter to control these parameters, but clearly this is not possible when the interpreter does not understand PostScript. In addition some features are controlled using the PostScript ``pdfmark`` operator and again that clearly is not possible unless we are using a PostScript interpreter to read the input.
+
+To overcome this new, GhostPCL-specific, PJL parameters have been added. These parameters are defined as ``PDFMARK`` and ``SETDISTILLERPARAMS``. In order to reduce confusion when using PostScript and PCL as inputs these PJL parameters take essentially the same PostScript constructs as the corresponding PostScript operators ``pdfmark`` and ``setdistillerparams``. However it is important to realise that these are not processed by a full PostScript interpreter, and there are syntactic rules which must be followed carefully when using these parameters.
+
+You cannot use arbitrary PostScript operators, only boolean, number, name, string, array and dictionary objects are supported (but see ``PUTFILE`` later). All tokens must be separated by white space, so while this ``[/Test(string)]`` is perfectly valid in PostScript, you must instead write it as ``[ /Test (string) ]`` for PJL parsing. All ``PDFMARK`` and ``SETDISTILLERPARAMS`` must be set as ``DEFAULT``, the values must be on a single line, and delimited by ``""``.
+
+``pdfmarks`` sometimes require the insertion of file objects (especially for production of PDF/A files) so we must find some way to handle these. This is done (for the ``pdfmark`` case only) by defining a special (non-standard) pdfmark name ``PUTFILE``, this simply takes the preceding string, and uses it as a fully qualified path to a file. Any further ``pdfmark`` operations can then use the named object holding the file to access it.
+
+The easiest way to use these parameters is to create a 'settings' file, put all the commands in it, and then put it on the command line immediately before the real input file. For example:
+
+.. code-block:: bash
+
+ ./gpcl6 -sDEVICE=pdfwrite -dPDFA=1 -dCompressPages=false -dCompressFonts=false -sOutputFile=./out.pdf ./pdfa.pjl ./input.pcl
+
+Where ``pdfa.pjl`` contains the PJL commands to create a PDF/A-1b file (see example below).
+
+Example creation of a PDF/A output file
+""""""""""""""""""""""""""""""""""""""""""""""
+
+For readability the line has been bisected, when used for real this must be a single line. The 'ESC' represents a single byte, value ``0x1B``, an escape character in ASCII. The line must end with an ASCII newline ``(\n, 0x0A)`` and this must be the only newline following the ``@PJL``. The line breaks between ``""`` below should be replaced with space characters, the double quote characters (``"``) are required.
+
+.. code-block:: postscript
+
+ ESC%-12345X
+ @PJL DEFAULT PDFMARK = "
+ [ /_objdef {icc_PDFA} /type /stream /OBJ pdfmark
+ [ {icc_PDFA} << /N 3 >> /PUT pdfmark
+ [ {icc_PDFA} (/ghostpdl/iccprofiles/default_rgb.icc) /PUTFILE pdfmark
+ [ /_objdef {OutputIntent_PDFA} /type /dict /OBJ pdfmark
+ [ {OutputIntent_PDFA} << /S /GTS_PDFA1 /Type /OutputIntent /DestOutputProfile {icc_PDFA} /OutputConditionIdentifier (sRGB) >> /PUT pdfmark
+ [ {Catalog} << /OutputIntents [{OutputIntent_PDFA}] >> /PUT pdfmark
+ [ /Author (Ken) /Creator (also Ken) /Title (PDF/A-1b) /DOCINFO pdfmark
+ "
+
+
+Example using DISTILLERPARAMS to set the quality of JPEG compression
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+.. code-block:: postscript
+
+ ESC%-12345X @PJL DEFAULT SETDISTILLERPARAMS = "<< /ColorImageDict << /QFactor 0.7 /Blend 1 /HSamples [ 2 1 1 2 ] /VSamples [ 2 1 1 2 ] >> >>"
+
+
+
+
+PDF file output
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+``-dMaxInlineImageSize=integer``
+ Specifies the maximum size of an inline image, in bytes. For images larger than this size, :title:`pdfwrite` will create an XObject instead of embedding the image into the context stream. The default value is 4000. Note that redundant inline images must be embedded each time they occur in the document, while multiple references can be made to a single XObject image. Therefore it may be advantageous to set a small or zero value if the source document is expected to contain multiple identical images, reducing the size of the generated PDF.
+
+``-dDoNumCopies``
+ When present, causes :title:`pdfwrite` to use the ``#copies`` or ``/NumCopies`` entry in the page device dictionary to duplicate each page in the output PDF file as many times as the 'copies' value. This is intended for use by workflow applications like :title:`cups` and should not be used for generating general purpose PDF files. In particular any ``pdfmark`` operations which rely on page numbers, such as ``Link`` or ``Outline`` annotations will not work correctly with this flag.
+
+``-dDetectDuplicateImages``
+ Takes a Boolean argument, when set to true (the default) :title:`pdfwrite` will compare all new images with all the images encountered to date (NOT small images which are stored in-line) to see if the new image is a duplicate of an earlier one. If it is a duplicate then instead of writing a new image into the PDF file, the PDF will reuse the reference to the earlier image. This can considerably reduce the size of the output PDF file, but increases the time taken to process the file. This time grows exponentially as more images are added, and on large input files with numerous images can be prohibitively slow. Setting this to false will improve performance at the cost of final file size.
+
+``-dFastWebView``
+ Takes a Boolean argument, default is false. When set to true :title:`pdfwrite` will reorder the output PDF file to conform to the Adobe 'linearised' PDF specification. The Acrobat user interface refers to this as 'Optimised for Fast Web Viewing'. Note that this will cause the conversion to PDF to be slightly slower and will usually result in a slightly larger PDF file.
+ This option is incompatible with producing an encrypted (password protected) PDF file.
+
+``-dPreserveAnnots=boolean``
+ We now attempt to preserve most annotations from input PDF files as annotations in the output PDF file (note, not in output PostScript!). There are a few annotation types which are not preserved, most notably ``Link`` and ``Widget`` annotations. However, should you wish to revert to the old behaviour, or find that the new behaviour leads to problems, you can set this switch to false which will cause all annotations to be inserted into the page content stream, instead of preserved as annotations.
+
+ In addition, finer control is available by defining an array ``/PreserveAnnotTypes``. Annotation types listed in this array will be preserved, whilst those not listed will be drawn according to the setting of ``ShowAnnots`` and ``ShowAnnotTypes``. By using the controls ``PreserveAnnots``, ``PreserveAnnotTypes``, ``ShowAnnots`` and ``ShowAnnotTypes`` it is possible to select by annotation type whether annotations are preserved as annotations, drawn into the page, or simply dropped.
+
+ To use this feature: ``-c "/PreserveAnnotTypes [....] def" -f <input file>``
+
+ Where the array can contain one or more of the following names: ``/Stamp``, ``/Squiggly``, ``/Underline``, ``/Link``, ``/Text``, ``/Highlight``, ``/Ink``, ``/FreeText``, ``/StrikeOut`` and ``/stamp_dict``.
+
+ For example, adding the follow to the command line: ``-c "/PreserveAnnotTypes [/Text /UnderLine] def" -f <input file>`` would preserve only annotations with the subtypes "Text" and "UnderLine".
+
+``-dPreserveMarkedContent=boolean``
+ We now attempt to preserve marked content from input PDF files through to the output PDF file (note, not in output PostScript!) This does not include marked content relating to optional content, because currently we do not preserve optional content, it is instead applied by the interpreter.
+
+ This control also requires the PDF interpreter to pass the marked content to the :title:`pdfwrite` device, this is only done with the new (C-based) PDF interpreter. The old (PostScript-based) interpreter does not support this feature and will not pass marked content to the :title:`pdfwrite` device.
+
+``-dOmitInfoDateboolean``
+ Under some conditions the ``CreationDate`` and ``ModDate`` in the ``/Info`` dictionary are optional and can be omitted. They are required when producing PDF/X output however. This control will allow the user to omit the ``/CreationDate`` and ``/ModDate`` entries in the ``Info`` dictionary (and the corresponding information in the XMP metadata, if present). If you try to set this control when writing PDF/X output, the device will give a warning and ignore this control.
+
+``-dOmitIDboolean``
+ Under some conditions the ``/ID`` array trailer dictionary is optional and can be omitted. It is required when producing PDF 2.0, or encrypted PDFs however. This control will allow the user to omit the ``/ID`` entry in the trailer dictionary. If you try to set this control when writing PDF 2.0 or encrypted PDF output, the device will give a warning and ignore this control.
+
+``-dOmitXMPboolean``
+ Under some conditions the XMP ``/Metadata`` entry in the ``Catalog`` dictionary is optional and can be omitted. It is required when producing PDF/A output however. This control will allow the user to omit the ``/Metadata`` entry in the ``Catalog`` dictionary. If you try to set this control when writing PDF/A output, the device will give a warning and ignore this control.
+
+
+
+The following options are useful for creating PDF 1.2 files:
+
+``-dPatternImagemask=boolean``
+ With CompatibilityLevel < 1.3 it specifies whether the target viewer handles ``ImageMask`` with a pattern color. Some old viewers, such as Ghostscript 3.30 fail with such constructs. Setting this option to false, one can get more compatibility, but the mask interpolation is lost. With CompatibilityLevel ≥ 1.3 this option is ignored. Default value is false.
+
+``-dMaxClipPathSize=integer``
+ Specifies the maximum number of elements in the clipping path that the target viewer can handle. This option is used only with ``CompatibilityLevel < 1.3`` and ``PatternImagemask=false``, and only when converting a mask into a clipping path. If the clipping path exceeds the specified size, the masked image and the clipping path is decomposed into smaller images. The value of the option counts straight path segments (curved segments are not used for representing a mask). Default value is 12000.
+
+``-dMaxShadingBitmapSize=integer``
+ Specifies the maximum number of bytes allowed for representing a shading as a bitmap. If a shading exceeds this value, the resolution of the output bitmap is reduced to fit into the specified number of bytes. Note that the number of bytes depends on the number of color components in ``ProcessColorModel`` or ``ColorConversionStrategy``, assumes 8 bits per sample, and doesn't consider image compression or downsampling. The image is rendered at the current resolution as specified by ``-r`` or the default of 720 dpi. Default value is 256000. In general larger values will result in higher quality, but the output file size may increase dramatically, particularly with shadings which cover large areas. Shadings should generally only be rendered to images if ``CompatibilityLevel`` is 1.2 or less or if ``ColorCoversionStrategy`` specifies a color space different to that of the shading.
+
+``-dHaveTrueTypes=boolean``
+ With ``CompatibilityLevel < 1.3`` it specifies whether the target viewer can handle TrueType fonts. If not, TrueType fonts are converted into raster fonts with resolution specified in ``HWResolution``. Note that large text at higher resolutions results in very large bitmaps which are likely to defeat caching in many printers. As a result the text is emitted as simple images rather than as a (type 3) bitmap font. The PostScript user parameter ``MaxFontItem`` can be used to increase the maximum size of a cache entry which will increase the size/resolution of the text which can be stored in a font. With ``CompatibilityLevel ≥ 1.3`` this option is ignored. Default value is true.
+
+The following options are useful for creating PDF 1.3 files:
+
+``-dHaveTransparency=boolean``
+ With ``CompatibilityLevel ≥ 1.4`` it specifies whether the target viewer can handle PDF 1.4 transparency objects. If not, the page is converted into a single plain image with all transparency flattened. Default value is true.
+
+The following option specifies creation of a PDF/X-3 file:
+
+``-dPDFX=boolean``
+ Specifies the generated document is to follow the PDF/X-3 standard. When true, a DefaultRGB ColorSpace resource must be defined, and options ``NOSUBSTDEVICECOLORS``, ``NOCIE`` must not be specified. Default value is false.
+
+ The :title:`pdfwrite` device does not currently support PDF/X versions other than 3.
+
+
+When generating a PDF/X-3 document, Ghostscript performs the following special actions to satisfy the PDF/X-3 standard:
+
+- All fonts are embedded.
+
+- ``DeviceRGB`` color space is substituted with the ``DefaultRGB`` color space, which must be defined in the ``ColorSpace`` category. The easiest way is to provide it in the ``DefaultRGB`` file in the resource directory.
+
+- ``DeviceRGB`` color values are passed unchanged. If a user needs a non trivial color adjustment, a non trivial ``DefaultRGB`` color space must be defined.
+
+- Transfer functions and halftone phases are skipped.
+
+- ``/PS pdfmark`` interprets the DataSource stream or file.
+
+- ``TrimBox`` and ``BleedBox`` entries are generated in page descriptions. Their values can be changed using the ``PDFXTrimBoxToMediaBoxOffset``, ``PDFXSetBleedBoxToMediaBox``, and ``PDFXBleedBoxToTrimBoxOffset`` distiller parameters (see below).
+
+
+The following switches are used for creating encrypted documents:
+
+``-sOwnerPassword=string``
+ Defines that the document be encrypted with the specified owner password.
+
+``-sUserPassword=string``
+ Defines the user password for opening the document. If empty, the document can be opened with no password, but the owner password is required to edit it.
+
+``-dPermissions=number``
+ Defines the PDF permissions flag field. Negative values are allowed to represent unsigned integers with the highest bit set. See the PDF Reference manual for the meaning of the flag bits.
+
+``-dEncryptionR=number``
+ Defines the encryption method revision number - either 2 or 3.
+
+``-dKeyLength=number``
+ Defines the length (in bits) of the encryption key. Must be a multiple of 8 in the interval [40, 128]. If the length isn't 40, ``-dEncryptionR`` must be 3.
+
+
+The following switches are used for generating metadata according to the Adobe XMP specification :
+
+
+``-sDocumentUUID=string``
+ Defines a ``DocumentID`` to be included into the document Metadata. If not specified, Ghostscript generates an UUID automatically. Otherwise the specified string is copied into the document without checking its syntax or consistence.
+
+ Note that Adobe XMP specification requires ``DocumentID`` must be same for all versions of a document. Since Ghostscript does not provide a maintenance of document versions, users are responsible to provide a correct UUID through this parameter.
+
+ Note that Ghostscript has no access to the host node ID due to a minimization of platform dependent modules. Therefore it uses an MD5 hash of the document contents for generating UUIDs.
+
+``-sInstanceUUID=string``
+ Defines a instance ID to be included into the document ``Metadata``. If not specified, Ghostscript generates an UUID automatically. Otherwise the specified string is copied into the document without checking its syntax or consistence.
+
+ Note that the Adobe XMP specification requires the instance ID to be unique for all versions of the document. This parameter may be used to disable unique ID generation for debug purposes.
+
+ When none of ``DocumentUUID`` and ``InstanceUUID`` are specified, the generated ``DocumentID`` appears same as instance ID.
+
+``-sDocumentTimeSeq=integer``
+ Defines an integer to be used as a deconflictor for generating UUIDs, when several invocations of Ghostscript create several PDF documents within same clock quantum (tick). Mainly reserved for very fast computers and/or multithreading applications, which may appear in future. If both ``DocumentUUID`` and ``InstanceUUID`` are specified, ``DocumentTimeSeq`` is ignored.
+
+
+``-sDSCEncoding=string``
+ Defines the name of a Postscript encoding in which DSC comments in the source document are encoded. If specified, the comments are converted from that encoding into Unicode UTF-8 when writing ``Metadata``. If not specified, the comments are copied to ``Metadata`` with no conversion. Note that Adobe Distiller for Windows uses the default locale's code page for this translation, so it's result may differ from Ghostscript. Adobe Acrobat appears to use ``PDFDocEncoding`` when displaying document's properties, so we recommend this value.
+
+``-sUseOCR=string``
+ Controls the use of OCR in :title:`pdfwrite`. If enabled this will use an OCR engine to analyse the glyph bitmaps used to draw text in a PDF file, and the resulting Unicode code points are then used to construct a ``ToUnicode CMap``.
+
+ PDF files containing ``ToUnicode CMaps`` can be searched, use copy/paste and extract the text, subject to the accuracy of the ``ToUnicode CMap``. Since not all PDF files contain these it can be beneficial to create them.
+
+ Note that, for English text, it is possible that the existing standard character encoding (which most PDF consumers will fall back to in the absence of Unicode information) is better than using OCR, as OCR is not a 100% reliable process. OCR processing is also comparatively slow.
+
+ For the reasons above it is useful to be able to exercise some control over the action of :title:`pdfwrite` when OCR processing is available, and the UseOCR parameter provides that control. There are three possible values:
+
+ - Never Default - don't use OCR at all even if support is built-in.
+
+ - AsNeeded If there is no existing ToUnicode information, use OCR.
+
+ - Always Ignore any existing information and always use OCR.
+
+ Our experimentation with the Tesseract OCR engine has shown that the more text we can supply for the engine to look at, the better the result we get. We are, unfortunately, limited to the graphics library operations for text as follows.
+
+ The code works on text 'fragments'; these are the text sequences sent to the text operators of the source language. Generally most input languages will try to send text in its simplest form, eg "Hello", but the requirements of justification, kerning and so on mean that sometimes each character is positioned independently on the page.
+
+ So :title:`pdfwrite` renders all the bitmaps for every character in the text document, when set up to use OCR. Later, if any character in the font does not have a Unicode value already we use the bitmaps to assemble a 'strip' of text which we then send to the OCR engine. If the engine returns a different number of recognised characters than we expected then we ignore that result. We've found that (for English text) constructions such as ". The" tend to ignore the full stop, presumably because the OCR engine thinks that it is simply noise. In contrast "text." does identify the full stop correctly. So by ignoring the failed result we can potentially get a better result later in the document.
+
+ Obviously this is all heuristic and undoubtedly there is more we can do to improve the functionality here, but we need concrete examples to work from.
+
+
+
+PostScript file output
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The :title:`ps2write` device handles the same set of distiller parameters as are handled by the :title:`pdfwrite` device (and 2 unique extensions, see below).
+
+The option ``-dMaxInlineImageSize=integer`` must not be used with :title:`ps2write` as all images are inline in PostScript.
+
+There are also two additional (not Adobe-standard) Distiller parameters, specific to :title:`ps2write`:
+
+``/PSDocOptions string``
+ No default value. If defined, the contents of the string will be emitted in the output PostScript prolog enclosed within ``%%BeginSetup`` and ``%%EndSetup`` comments. This is intended as a means of introducing device-specific document wide setup or configuration options into the output. Default media selection, printer resolution etc might be included here.
+
+``/PSPageOptions array of strings``
+ No default value. If defined, the contents of the strings in the array will be emitted in the output PostScript at the start of each page, one string per page, enclosed within ``%%BeginPageSetup`` and ``%%EndPageSetup`` comments. This is intended as a means of introducing device-specific setup or configuration options into the output on a page by page basis. The strings are used from the array sequentially, if there are more pages than strings then we 'wrap round' and start again with the first string. This makes it convenient to do setup for even/odd pages by simply including 2 strings in the array.
+
+.. note::
+
+ Executing ``setpagedevice`` will reset distiller parameters to the default, if you use any of these options via ``setdistillerparams``, and expect to execute ``setpagedevice``, you should set ``/LockDistillerParams`` true. Ordinarily the PDF interpreter executes ``setpagedevice`` for every page in order to set the media size.
+
+.. note::
+
+ The strings contained in ``PSDocOptions``, and the ``PSPageOptions`` array, are written verbatim to the output. No error checking is (or can be) performed on these strings and it is the users responsibility to ensure they contain well formed PostScript which does not cause errors on the target device.
+
+
+There are also the following ps2write specific options :
+
+``-dProduceDSC=boolean``
+ Default value is true. When this value is true the output PostScript file will be constructed in a way which is compatible with the Adobe Document Structuring Convention, and will include a set of comments appropriate for use by document managers. This enables features such as page extraction, N-up printing and so on to be performed. When set to false, the output file will not be DSC-compliant. Older versions of Ghostscript cannot produce DSC-compliant output from ps2write, and the behaviour for these older versions matches the case when ``ProduceDSC`` is false.
+
+``-dCompressEntireFile=boolean``
+ When this parameter is true, the ``LZWEncode`` and ``ASCII85Encode`` filters will be applied to the entire output file. In this case ``CompressPages`` should be false to prevent a dual compression. When this parameter is false, these filters will be applied to the initial procset only, if ``CompressPages`` is true. Default value is false.
+
+.. note::
+
+ It is not possible to set ``CompressEntireFile`` when ``ProduceDSC`` is true as a single compressed object cannot conform to the DSC. It is possible to set ``CompressPages`` which will also compress the ``ps2write ProcSet``.
+
+
+Controlling device specific behaviour
+""""""""""""""""""""""""""""""""""""""""""
+
+A few options can be used to influence the behavior of a printer or PostScript interpreter that reads the result of ``ps2ps2``. All of these options are incompatible with DSC-compliant PostScript, in order to use any of them ``ProduceDSC`` must be set to false.
+
+``-dRotatePages=boolean``
+ The printer will rotate pages for a better fit with the physical size. Default value : false. Must be false if ``-dSetPageSize=true``.
+
+``-dFitPages=boolean``
+ The printer will scale pages down to better fit the physical page size. The rendering quality may be poor due to the scaling, especially for fonts which Ghostscript had converted into bitmaps (see the :title:`ps2write` device parameter ``HaveTrueTypes``; See options about the ``PageSize`` entry of the ``Policies`` dictionary while the conversion step). Default value : false. Must be false if ``-dSetPageSize=true`` or ``-dCenterPages=true``.
+
+``-dCenterPages=boolean``
+ The printer will center the page image on the selected media. Compatible with ``-dRotatePages=true``, which may rotate the image on the media if it fits better, and then center it. Default value : false. Must be false if ``-dSetPageSize=true`` or ``-dFitPages=true``.
+
+``-dSetPageSize=boolean``
+ The printer will try to set page size from the job. Only use with printers which can handle random ``PageSize``. Defaults to true, must be false if ``-dRotatePages=true``, ``-dCenterPages=true`` or ``-dFitPages=true``.
+
+``-dDoNumCopies=boolean``
+ The PostScript emitted by :title:`ps2write` will try to use ``copypage`` to create the number of copies originally requested. Note that this relies on the level 2 semantics for ``copypage`` and will not reliably work on language level 3 devices (such as Ghostscript itself). Defaults to false.
+
+ This flag is not compatible with the ``ProduceDSC`` flag which will take precedence if set.
+
+
+These correspond to keys in the Postscript userdict of the target printer's virtual memory to control its behavior while executing a job generated with :title:`ps2write`.
+
+These keys can be set when executing using the :title:`ps2write` device, this 'fixes' the resulting behaviour according to which key has been set. If these keys are not defined during conversion, the resulting PostScript will not attempt any form of media selection. In this case the behaviour can then be modified by setting the keys, either by modifying the resulting PostScript or setting the values in some other manner on the target device.
+
+See also the distiller params ``PSDocOptions`` and ``PSPageOptions`` mentioned :ref:`above<Distiller Parameters>`.
+
+
+
+Encapsulated PostScript (EPS) file output
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The :title:`eps2write` device is the same as the :title:`ps2write` device, except that it produces Encapsulated PostScript, which is intended to be imported into another document and treated as a 'black box'. There are certain restrictions which EPS files must follow, the primary one being that they must be DSC conformant. This means that you must not set ``-dProduceDSC`` to false.
+
+In addition EPS files may only contain a single page and may not contain device-specific PostScript. You should therefore not use the ``PSDocOptions`` or ``PSPageOptions`` or any of the switches noted in the :title:`ps2write` section above under `Controlling device specific behaviour`_.
+
+
+
+
+Creating a PDF/X-3 document
+----------------------------------
+
+To create a PDF/X-3 document from a Postscript or a PDF file, you should :
+
+- Specify the :title:`pdfwrite` device or use the ``ps2pdf`` script.
+
+- Specify the ``-dPDFX`` option. It provides the document conformity and forces ``-dCompatibilityLevel=1.3``.
+
+- Specify ``-sColorConversionStrategy=Gray``, ``-sColorConversionStrategy=CMYK`` or ``-sColorConversionStrategy=UseDeviceIndependentColor`` (RGB is not allowed). If you plan to create a device-independent color PDF file then you should set the ``ProcessColorModel`` using ``-sProcessColorModel=DeviceGray`` or ``-sProcessColorModel=DeviceCMYK``.
+
+- Specify a PDF/X definition file before running the input document. It provides additional information to be included into the output document. A sample PDF/X definition file may be found in ``gs/lib/PDFX_def.ps``. You will need to modify the content of this file; in particular you must alter the ``/ICCProfile`` so that it points to a valid ICC profile for your ``OutputCondition``. The string '(...)' defining the ICCProfile must be a fully qualified device and path specification appropriate for your Operating System.
+
+- If a registered printing condition is applicable, specify its identifier in the PDF/X definition file. Otherwise provide an ICC profile and specify it in the PDF/X definition file as explained below.
+
+- Provide a ``DefaultRGB`` resource file in the ``ColorSpace`` resource category. Either define it in the PDF/X definition file, or provide a definition of ``gs/Resource/ColorSpace/DefaultRGB``. ``gs/Resource/ColorSpace/DefaultRGB`` is usually distributed with Ghostscript, its content may not necessarily satisfy your needs, see below.
+
+
+.. note::
+
+ Unless ``-dNOSAFER`` is specified (NOT reccomended!) the ICC profile will be read using the ``SAFER`` file permissions; you must ensure that the profile is in a directory which is readable according to the ``SAFER`` permissions, or that the file itself is specifically made readable. See :ref:`-dSAFER<Use Safer>` for details of how to set file permissions for ``SAFER``.
+
+As mentioned above, the PDF/X definition file provides special information, which the PDF/X-3 standard requires. You can find a sample file in ``gs/lib/PDFX_def.ps``, and edit it according to your needs. The file follows Postscript syntax and uses the operator ``pdfmark`` to pass the special information. To ease customisation the lines likely to need editing in the sample file are marked with the comment ``% Customize``. They are explained below.
+
+
+``OutputCondition string``
+ Defines an ``OutputCondition`` value for the output intent dictionary.
+
+``OutputConditionIdentifier string``
+ Defines an ``OutputConditionIdentifier`` value for the output intent dictionary.
+
+``ICCProfile string``
+ May be omitted if ``OutputConditionIdentifier`` specifies a registered identifier of characterized printing condition (see `IPA_2003-11_PDFX.pdf`_). Defines a file name of an ICC profile file to be included into the output document. You may specify either an absolute file name, or a relative path from the working directory.
+
+``Title string``
+ Defines the document title. Only useful if the source Postscript file doesn't define a title with DSC comments. Otherwise remove entire line from definition file.
+
+``Info string``
+ Defines an ``Info`` value for the output intent dictionary.
+
+
+
+The Ghostscript distribution does not contain an ICC profile to be used for creating a PDF/X-3 document. Users should either create an appropriate one themselves, or use one from a public domain, or create one with the PDF/X-3 inspector freeware.
+
+The PDF/X-3 standard requires a ``TrimBox`` entry to be written for all page descriptions. This is an array of four offsets that specify how the page is to be trimmed after it has been printed. It is set to the same as ``MediaBox`` by default unless the ``PDFXTrimBoxToMediaBoxOffset`` distiller parameter is present. It accepts offsets to the ``MediaBox`` as an array [left right top bottom], e.g., the PostScript input code ``<< /PDFXTrimBoxToMediaBoxOffset [10 20 30 40] >> setdistillerparams`` specifies that 10 points will be trimmed at the left, 20 points at the right, 30 points at the top, and 40 points at the bottom.
+
+Another page entry is the ``BleedBox``. It gives the area of the page to which actual output items may extend; cut marks, color bars etc. must be positioned in the area between the ``BleedBox`` and the ``MediaBox``. The ``TrimBox`` is always contained within the ``BleedBox``. By default, the ``PDFXSetBleedBoxToMediaBox`` distiller parameter is true, and the ``BleedBox`` is set to the same values as the ``MediaBox``. If it is set to false, the ``PDFXBleedBoxToTrimBoxOffset`` parameter gives offset to the ``TrimBox``. It accepts a four-value array in the same format as the ``PDFXTrimBoxToMediaBoxOffset`` parameter.
+
+
+Here is a sample command line to invoke Ghostscript for generating a PDF/X-3 document :
+
+
+.. code-block:: bash
+
+ gs -dPDFX -dBATCH -dNOPAUSE -sColorConversionStrategy=CMYK -sDEVICE=pdfwrite -sOutputFile=out-x3.pdf PDFX_def.ps input.ps
+
+
+Please also see the ``PDFACompatibilityPolicy`` control described under `Creating a PDF/A document`_. The same control is now used to specify the desired behaviour when an input file cannot be converted 'as is' into a PDF/X file.
+
+
+
+Creating a PDF/A document
+------------------------------
+
+To create a PDF/A document, please follow the instructions for `Creating a PDF/X-3 document`_, with the following exceptions :
+
+- Specify the :title:`pdfwrite` device or use the ``ps2pdf`` script.
+
+- Specify the ``-dPDFA`` option to specify ``PDF/A-1``, ``-dPDFA=2`` for ``PDF/A-2`` or ``-dPDFA=3`` for ``PDF/A-3``.
+
+- Specify ``-sColorConversionStrategy=RGB``, ``-sColorConversionStrategy=CMYK`` or ``-sColorConversionStrategy=UseDeviceIndependentColor``. If you plan to create a device-independent color PDF file then you should set the ``ProcessColorModel`` using ``-sProcessColorModel=DeviceRGB`` or ``-sProcessColorModel=DeviceCMYK``.
+
+- Specify a PDF/A definition file before running the input document. It provides additional information to be included in the output document. A sample PDF/A definition file may be found in ``gs/lib/PDFA_def.ps``. You will need to modify the content of this file; in particular you must alter the ``/ICCProfile`` so that it points to a valid ICC profile for your ``OutputIntent``. The string '(...)' defining the ICCProfile must be a fully qualified device and path specification appropriate for your Operating System.
+
+
+There is one additional control for PDF/A output:
+
+
+``PDFACompatibilityPolicy integer``
+ When an operation (e.g. ``pdfmark``) is encountered which cannot be emitted in a PDF/A compliant file, this policy is consulted, there are currently three possible values:
+
+ ``0`` - (default) Include the feature or operation in the output file, the file will not be PDF/A compliant. Because the document ``Catalog`` is emitted before this is encountered, the file will still contain PDF/A metadata but will not be compliant. A warning will be emitted in this case.
+
+ ``1`` - The feature or operation is ignored, the resulting PDF file will be PDF/A compliant. A warning will be emitted for every elided feature.
+
+ ``2`` - Processing of the file is aborted with an error, the exact error may vary depending on the nature of the PDF/A incompatibility.
+
+
+Here is a sample command line to invoke Ghostscript for generating a PDF/A document:
+
+.. code-block:: bash
+
+ gs -dPDFA=1 -dBATCH -dNOPAUSE -sColorConversionStrategy=RGB -sDEVICE=pdfwrite -sOutputFile=out-a.pdf PDFA_def.ps input.ps
+
+
+
+Ghostscript PDF Printer Description
+-----------------------------------------
+
+To assist with creating a PostScript file suitable for conversion to PDF, Ghostscript includes ``ghostpdf.ppd``, a PostScript Printer Description (PPD) file. This allows some `distiller parameters`_ to be set when a PostScript file is generated.
+
+Windows XP or 2000
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To install a "Ghostscript PDF" printer on Windows XP, select the Windows Control Panel, Printers and Faxes, Add a Printer, Local Printer, Use port FILE: (Print to File), Have Disk..., select the directory containing ghostpdf.ppd and ghostpdf.inf, select "Ghostscript PDF", Replace existing driver (if asked), and answer the remaining questions appropriately. After installing, open the "Ghostscript PDF" properties, select the Device Settings tab, set "Minimum Font Size to Download as Outline" to 0 pixels.
+
+To set distiller parameters, select the "Ghostscript PDF" Printing Preferences, then the Advanced button. The PDF settings are under "Printer Features".
+
+
+
+``pdfmark`` extensions
+-----------------------------------------
+
+In order to better support the `ZugFERD electronic invoice standard`_ and potentially other standards in the future, a new non-standard ``pdfmark`` has been defined for use by pdfwrite.
+
+This ``pdfmark`` allows additional ``Metadata`` to be defined which will be inserted into the ``Metadata`` generated by the :title:`pdfwrite` device. This is necessary because the standard requires a PDF/A-3 file be produced, with an extension schema (and some additional XML data) contained within the ``Metadata`` referenced from the ``Catalog`` object.
+
+While it would be possible to use the existing ``Metadata`` ``pdfmark`` to write a completely new set of metadata into the ``Catalog``, creating a conformant set of XML, with all the information synchronised with the ``/Info`` dictionary would be challenging, this ``pdfmark`` allows the :title:`pdfwrite` device to generate all the normal information leaving the user with only the task of specifying the additional data. ``[ /XML (string containing additional XMP data) /Ext_Metadata pdfmark``
+
+
+Limitations
+--------------------
+
+The :title:`pdfwrite` family will sometimes convert input constructs to lower-level ones, even if a higher-level construct is available. For example, if the PostScript file uses ``charpath`` to set a clipping path consisting of text, :title:`pdfwrite` may write the clipping path as a path in the PDF file, rather than as text, even though PDF is able to express clipping with text. This is only a performance issue, and will be improved incrementally over time.
+
+Some applications, such as HIGZ, produce PostScript files that use ridiculously large coordinates. On such files, pdfwrite may cause a limitcheck error. If this occurs, try reducing the default internal resolution of 720 dpi by using the ``-r`` switch, e.g., ``-r300 somefile.ps``.
+
+:title:`pdfwrite` ignores the PDF 1.3 (Acrobat 4.x) ``pdfmarks`` related to document content structure: ``StRoleMap``, ``StClassMap``, ``StPNE``, ``StBookmarkRoot``, ``StPush``, ``StPop``, ``StPopAll``, ``StBMC``, ``StBDC``, ``EMC``, ``StOBJ``, ``StAttr``, ``StStore``, ``StRetrieve``, ``NamespacePush``, ``NamespacePop``, and ``NI``. While this causes some structural information to be omitted from the output file, the displayed and printed output are normally not affected.
+
+
+
+.. External links
+
+.. _MuPDF: https://mupdf.com
+.. _IPA_2003-11_PDFX.pdf: http://www.color.org/IPA_2003-11_PDFX.pdf
+.. _ZugFERD electronic invoice standard: http://www.ferd-net.de/front_content.php?idcat=231&changelang=4
+
+
+
+.. include:: footer.rst
+
diff --git a/doc/src/_static/custom.css b/doc/src/_static/custom.css
new file mode 100644
index 00000000..1d33520c
--- /dev/null
+++ b/doc/src/_static/custom.css
@@ -0,0 +1,105 @@
+/* icon sizing in the left menu */
+.icon-home {
+ width: 100px;
+ height: auto;
+}
+
+/* main document page: ensures pages fit to the available width and height */
+.wy-nav-content {
+ min-width: 100%;
+ min-height: 100vh;
+}
+
+/* Accessibility: Artifex color for main document links */
+.wy-nav-content a {
+ color: #007aff;
+}
+
+/* Artifex blue color for background elements */
+.wy-side-nav-search, .wy-nav-top {
+ background-color: #007aff;
+}
+
+/* Accessibility: ensures that the version number is readable against the background color */
+.wy-side-nav-search>div.version {
+ color:hsla(0,0%,100%,1);
+}
+
+h1, h2, h3, h4 {
+ padding: 10px;
+ border: 1px solid #007aff;
+ background-color: #007aff;
+ color: #fff;
+ border-radius: 5px;
+}
+
+h1 a, h2 a, h3 a, h4 a {
+ color: #fff;
+}
+
+cite {
+ font-family: monospace;
+ font-weight: bold;
+}
+
+
+button.cta {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ border:0;
+ text-transform:uppercase;
+ border-radius:5px;
+ font-size:16px;
+ font-weight:500;
+ min-height:40px;
+ line-height:40px;
+ padding: 0 15px;
+ color:#fff;
+ cursor:pointer;
+}
+
+button.cta.orange {
+ width:auto;
+ background-image: linear-gradient(to right, #ea5842, #ec6343, #ed6d45, #ef7747, #f0804a) !important;
+}
+
+button.cta.orange:hover {
+ background:#ea5842 !important;
+}
+
+button.cta a {
+ color:#fff !important;
+}
+
+
+/* Dark mode colors */
+@media (prefers-color-scheme: dark) {
+
+
+ /* main document page */
+ .wy-nav-content {
+ background-color: #000;
+ color: #fff;
+ }
+
+ th {
+ color: #fff;
+ }
+
+ td {
+ background-color: #000 !important;
+ }
+
+ tr:nth-child(2n-1) td{
+ background-color: #333 !important;
+ }
+
+ pre {
+ color: #000;
+ }
+
+ .admonition {
+ color: #000;
+ }
+
+}
diff --git a/doc/src/_static/export-jar.png b/doc/src/_static/export-jar.png
new file mode 100644
index 00000000..55550496
--- /dev/null
+++ b/doc/src/_static/export-jar.png
Binary files differ
diff --git a/doc/src/_static/favicon.svg b/doc/src/_static/favicon.svg
new file mode 100644
index 00000000..86b60ff9
--- /dev/null
+++ b/doc/src/_static/favicon.svg
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 174.5 203" enable-background="new 0 0 174.5 203" xml:space="preserve">
+
+ <style>path{fill:#333}@media (prefers-color-scheme:dark){path{fill:#eee}}</style>
+
+ <path d="M88.914,62.379c2.305-1.166-1.965-4.208-1.717-9.555c0.275-6.038,2.834-9.767-0.775-9.663
+ c-2.843,0.078-7.028,5.283-6.347,10.597C80.771,59.059,85.951,63.869,88.914,62.379z"/>
+ <path d="M82.704,70.756c-2.901,1.852,4.552,3.786,6.338,9.383c2.024,6.331-0.215,10.913,5.012,9.777
+ c4.119-0.888,8.132-7.467,5.004-12.756C95.923,71.864,86.422,68.364,82.704,70.756z"/>
+ <path d="M77.635,65.538c2.012-1.627-2.801-3.695-3.686-8.962c-1.002-5.985,0.72-10.149-2.799-9.292
+ c-2.752,0.663-5.759,6.648-3.971,11.687C68.97,64.008,75.064,67.635,77.635,65.538z"/>
+ <g>
+ <path d="M8.34,182.553c8.033,8.36,27.344,18.325,73.727,18.325c77.712,0,86.343-34.936,86.672-36.423l0.074-0.335
+ l-2.615-0.673l-0.103,0.317c-0.084,0.262-9.182,26.392-76.57,26.392c-2.336,0-4.77-0.032-7.237-0.095
+ c-16.732-0.429-30.657-3.138-40.269-7.831c-8.394-4.1-13.017-9.442-13.017-15.044c0-11.862,13.986-12.627,14.581-12.655
+ l0.316-0.015l0.177-2.639l-0.312-0.057c-0.233-0.042-5.807-1.036-12.745-1.036c-18.07,0-28.293,6.655-28.786,18.739
+ C2.206,170.181,2.159,176.119,8.34,182.553z"/>
+ <path d="M152.435,59.232c1.118-13.45-11.403-23.37-15.267-26.09l-0.155-0.109l0.021-0.188
+ c0.952-8.478-0.737-15.52-5.021-20.929c-6.977-8.81-18.449-10.085-18.934-10.135l-0.328-0.033l-0.437,2.648l0.32,0.077
+ c0.518,0.124,12.73,3.157,14.018,14.733c1.131,10.18-6.367,14.962-13.618,19.586c-5.594,3.572-10.871,6.942-10.871,12.57
+ c0,6.214,5.439,10.593,10.7,14.827c5.32,4.281,10.341,8.321,9.969,13.87c-0.687,10.304-20.492,15.748-20.692,15.802l-0.331,0.088
+ l0.568,2.639l0.333-0.054C143.685,91.88,151.452,71.054,152.435,59.232z"/>
+ <path d="M80.146,181.454c4.818,0.771,10.645,1.179,16.85,1.179c16.754,0,39.861-3.118,54.467-11.867
+ c14.401-8.616,16.364-22.548,10.86-31.856v-0.001c-4.971-8.418-20.259-22.757-66.8-24.202
+ c-32.475-0.997-48.941-3.565-48.941-7.633c0-3.392,5.788-4.433,11.916-5.535c7.688-1.384,16.401-2.954,16.174-10.354
+ c-0.145-4.691-4.298-7.432-9.107-10.607c-7.262-4.8-16.297-10.773-14.116-26.241c1.864-13.148,21.14-18.701,29.341-20.478
+ c11.723-2.537,31.451-8.128,31.858-17.067c0.368-8.21-8.415-10.998-8.503-11.025l-0.304-0.095l-0.915,2.059l-0.194,0.336
+ l0.304,0.179c0.152,0.092,3.643,2.253,2.214,6.375c-1.521,4.398-7.704,4.754-25.358,5.137
+ c-17.544,0.386-39.579,2.793-54.373,18.103c-8.041,8.324-11.314,19.207-8.754,29.112c2.713,10.485,11.718,19.235,25.356,24.64
+ l0.913,0.362l-0.951,0.245c-3.259,0.838-8.195,2.305-13.196,4.529c-12.741,5.665-19.313,13.407-19.004,22.39
+ c0.797,22.879,35.182,26.661,68.713,27.343c35.983,0.731,51.335,4.303,51.335,11.942c0,6.147-11.885,11.023-28.26,11.596
+ c-1.88,0.065-3.719,0.097-5.466,0.097c-10.907,0-17.937-1.091-21.914-2.007c-4.734-1.088-7.577-2.501-7.606-3.777
+ c-0.015-0.593,0.165-1.072,0.55-1.467c1.375-1.41,4.781-1.706,7.397-1.706c3.296,0,6.365,0.481,6.704,0.535l0.315,0.052
+ l0.748-2.53l-0.29-0.125c-0.064-0.027-6.083-2.606-14.252-2.606c-0.505,0-1.018,0.01-1.539,0.031
+ c-6.817,0.301-11.677,3.807-11.819,8.526C54.379,168.728,56.635,177.698,80.146,181.454z"/>
+ </g>
+
+</svg>
diff --git a/doc/src/_static/ghostnet-wpf-example.png b/doc/src/_static/ghostnet-wpf-example.png
new file mode 100644
index 00000000..b5b1eaa1
--- /dev/null
+++ b/doc/src/_static/ghostnet-wpf-example.png
Binary files differ
diff --git a/doc/src/_static/ghostscript-white-plus-text.png b/doc/src/_static/ghostscript-white-plus-text.png
new file mode 100644
index 00000000..436fd6f3
--- /dev/null
+++ b/doc/src/_static/ghostscript-white-plus-text.png
Binary files differ
diff --git a/doc/src/_static/gsviewer.png b/doc/src/_static/gsviewer.png
new file mode 100644
index 00000000..75c9d5af
--- /dev/null
+++ b/doc/src/_static/gsviewer.png
Binary files differ
diff --git a/doc/src/_static/linking-jar.png b/doc/src/_static/linking-jar.png
new file mode 100644
index 00000000..ce64e587
--- /dev/null
+++ b/doc/src/_static/linking-jar.png
Binary files differ
diff --git a/doc/src/conf.py b/doc/src/conf.py
new file mode 100644
index 00000000..d4c6487e
--- /dev/null
+++ b/doc/src/conf.py
@@ -0,0 +1,249 @@
+# -*- coding: utf-8 -*-
+#
+import sys
+import os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.insert(0, os.path.abspath("."))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+# needs_sphinx = "4.2.0"
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+# extensions = ["sphinx.ext.autodoc", "sphinx.ext.coverage", "sphinx.ext.ifconfig"]
+#
+# Note on :sphinx.ext.autosectionlabel
+# this is handy as it adds link ids to your labels and easy referencing
+# However the downside is the build will report many warnings for "duplicate labels",
+# not a problem as the benefits outweigh the hassle of adding unique section
+# links everywhere
+#
+extensions = [
+ 'rst2pdf.pdfbuilder',
+ 'sphinx.ext.autosectionlabel'
+]
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ["_templates"]
+
+# The suffix of source filenames.
+source_suffix = ".rst"
+
+# The encoding of source files.
+# source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = "toc"
+
+# General information about the project.
+project = "Ghostscript"
+copyright = "1988-2022, Artifex"
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The full version, including alpha/beta/rc tags.
+release = "10.0.0"
+
+# The short X.Y version
+version = release
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+# language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+# today = ''
+# Else, today_fmt is used as the format for a strftime call.
+# today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ["_build"]
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = "sphinx"
+
+# A list of ignored prefixes for module index sorting.
+modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+keep_warnings = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = "sphinx_rtd_theme"
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+html_theme_options = {
+
+}
+
+# Add any paths that contain custom themes here, relative to this directory.
+# html_theme_path = []
+# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+# html_title = None
+
+# A shorter title for the navigation bar. Default is the same as html_title.
+# html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+html_logo = "_static/ghostscript-white-plus-text.png"
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+html_favicon = "_static/favicon.svg"
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ["_static"]
+
+# A list of CSS files. The entry must be a filename string or a tuple containing
+# the filename string and the attributes dictionary. The filename must be
+# relative to the html_static_path, or a full URI
+html_css_files = ['custom.css']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+# html_extra_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+html_last_updated_fmt = "%d. %b %Y"
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+# html_use_smartypants = False
+
+# Custom sidebar templates, maps document names to template names.
+# html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+html_additional_pages = {}
+
+# If false, no module index is generated.
+html_domain_indices = True
+
+# If false, no index is generated.
+html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+html_split_index = True
+
+# If true, links to the reST sources are added to the pages.
+html_show_sourcelink = False
+html_sourcelink_suffix = ".rst"
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+html_show_sphinx = False
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it. The value of this option must be the
+# base URL from which the finished HTML is served.
+html_use_opensearch = ""
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+html_file_suffix = ".html"
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = "Ghostscript"
+
+
+# -- Options for LaTeX output ---------------------------------------------
+latex_elements = {
+ # "fontpkg": r"\usepackage[sfdefault]{ClearSans} \usepackage[T1]{fontenc}"
+}
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ ("index", "Ghostscript.tex", u"Ghostscript Documentation", u"Artifex", "manual")
+]
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+latex_logo = "_static/ghostscript-white-plus-text.png"
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+# latex_use_parts = False
+
+# If true, show page references after internal links.
+latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+# latex_show_urls = True
+# latex_use_xindy = True
+# Documents to append as an appendix to all manuals.
+# latex_appendices = []
+
+# If false, no module index is generated.
+latex_domain_indices = True
+
+# -- Options for PDF output --------------------------------------------------
+# Grouping the document tree into PDF files. List of tuples
+# (source start file, target name, title, author).
+
+pdf_documents = [("index", "Ghostscript", "Ghostscript Manual", "Artifex")]
+
+# A comma-separated list of custom stylesheets. Example:
+#pdf_stylesheets = ["sphinx", "bahnschrift", "a4"]
+
+# Create a compressed PDF
+pdf_compressed = True
+
+# A colon-separated list of folders to search for fonts. Example:
+# pdf_font_path=['/usr/share/fonts', '/usr/share/texmf-dist/fonts/']
+
+# Language to be used for hyphenation support
+pdf_language = "en_US"
+
+# If false, no index is generated.
+pdf_use_index = True
+
+# If false, no modindex is generated.
+pdf_use_modindex = True
+
+# If false, no coverpage is generated.
+pdf_use_coverpage = True
+
+pdf_break_level = 2
+
+pdf_verbosity = 0
+pdf_invariant = True
diff --git a/doc/src/footer.rst b/doc/src/footer.rst
new file mode 100644
index 00000000..de227efd
--- /dev/null
+++ b/doc/src/footer.rst
@@ -0,0 +1,7 @@
+
+.. raw:: html
+
+ <hr>
+
+This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at https://www.artifex.com or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
+
diff --git a/doc/src/index.rst b/doc/src/index.rst
new file mode 100644
index 00000000..7f001d40
--- /dev/null
+++ b/doc/src/index.rst
@@ -0,0 +1 @@
+.. include:: Readme.rst \ No newline at end of file
diff --git a/doc/src/requirements.txt b/doc/src/requirements.txt
new file mode 100644
index 00000000..fb3c028e
--- /dev/null
+++ b/doc/src/requirements.txt
@@ -0,0 +1 @@
+rst2pdf
diff --git a/doc/src/thirdparty.rst b/doc/src/thirdparty.rst
new file mode 100644
index 00000000..855ed485
--- /dev/null
+++ b/doc/src/thirdparty.rst
@@ -0,0 +1,212 @@
+.. title:: Third Party Libraries Used by Ghostscript and GhostPDL
+
+.. meta::
+ :description: The Ghostscript documentation
+ :keywords: Ghostscript, documentation, ghostpdl
+
+
+.. _thirdparty.htm:
+
+
+Third Party Libraries Used by Ghostscript and GhostPDL
+=========================================================
+
+
+The table below details the third party libraries that Ghostscript and/or GhostPDL include, the versions QA tested and shipped with our releases, the relevant license, and the "upstream" URL.
+
+
+.. list-table::
+ :header-rows: 1
+ :widths: 20 10 25 25 20
+
+ * - Library Name
+ - Version
+ - Function
+ - License
+ - URL
+ * - CUPS
+
+ (AGPL Release Only)
+
+ - 2.8.0
+ - CUPS raster format output
+ - GPL Version 3
+ - http://www.cups.org/
+ * - eXpat
+ - 2.4.1
+ - XML parsing for XPS interpreter
+ - MIT/eXpat License
+ - http://expat.sourceforge.net/
+ * - FreeType
+ - 2.12.1
+ - Font scaling and rendering
+
+ for Ghostscript
+ - FreeType License
+
+ (BSD-style license
+
+ with a credit clause)
+
+ - http://www.freetype.org/
+ * - jbig2dec
+ - 0.19
+ - JBIG2 decoding for the
+
+ PDF interpreter
+ - Licensed with Ghostscript/GhostPDL
+
+ (copyright owned by Artifex)
+
+ - http://www.ghostscript.com/
+ * - libjpeg
+ - 9e with patches
+ - JPEG/DCT decoding/encoding
+ - "Free" Can be used in
+
+ commercial applications
+
+ without royalty,
+
+ with acknowledgement.
+ - http://www.ijg.org/
+ * - LittleCMS2 mt
+
+ (lcms2mt - thread
+
+ safe fork of lcms2)
+
+ - 2.10mt
+ - ICC profile based color conversion
+
+ and management
+
+ - MIT LICENSE
+ - http://www.ghostscript.com/
+ * - libpng
+ - 1.6.37
+ - PNG image encoding/decoding
+ - libpng license - classified as
+
+ "a permissive free software license"
+ - http://www.libpng.org/
+ * - OpenJPEG
+ - 2.4.0
+ - JPEG2000 image decoding for the
+
+ PDF interpreter
+
+ - BSD-style
+ - http://www.openjpeg.org/
+ * - zlib
+ - 1.2.12
+ - (De)Flate compression
+ - zlib license - classified as
+
+ "a permissive free software license"
+ - http://www.zlib.net/
+ * - libtiff
+ - 4.3.0
+ - TIFF image encoding/decoding
+ - BSD-style
+ - http://www.remotesensing.org/libtiff
+
+
+The following are optional.
+
+
+
+.. list-table::
+ :header-rows: 1
+ :widths: 20 10 25 25 20
+
+ * - Library Name
+ - Version
+ - Function
+ - License
+ - URL
+ * - tesseract
+ - 4.1.0
+ with patches
+ - Optical Character Recognition (OCR) library
+ - Apache License 2.0
+ - https://github.com/tesseract-ocr/tesseract
+ * - leptonica
+ - 1.80.0 with patches
+ - Image processing toolkit - support
+
+ library for tesseract OCR
+
+ - Leptonica License
+
+ "a permissive free software license"
+
+ - http://www.leptonica.org/
+
+
+
+
+The following are no-cost, open source licensed, but not GPL compatible.
+
+
+
+.. list-table::
+ :header-rows: 1
+ :widths: 20 10 25 25 20
+
+ * - Library Name
+ - Version
+ - Function
+ - License
+ - URL
+ * - jpegxr (JPEG XR reference software)
+ - 1.8
+ - HDPhoto/JPEG-XR image
+
+ decoding for the XPS interpreter
+ - ITU/ISO/IEC "Free" License
+
+ Reference implementation
+ - http://www.itu.int/rec/T-REC-T.835
+
+
+
+
+The following is optional & relevant to Artifex Software commercial releases only.
+
+
+.. list-table::
+ :header-rows: 1
+ :widths: 20 10 25 25 20
+
+ * - Library Name
+ - Version
+ - Function
+ - License
+ - URL
+ * - Monotype UFST
+ - 5.x/6.x with patches
+ - Access, scale and render
+
+ Monotype MicroType fonts
+ - Commercial
+ - https://www.monotype.com/
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+.. include:: footer.rst
diff --git a/doc/src/toc.rst b/doc/src/toc.rst
new file mode 100644
index 00000000..e02c9656
--- /dev/null
+++ b/doc/src/toc.rst
@@ -0,0 +1,38 @@
+Table of Contents
+========================================
+
+.. toctree::
+
+ Readme.rst
+ Make.rst
+ Install.rst
+ Use.rst
+ API.rst
+ LanguageBindings.rst
+ Devices.rst
+ VectorDevices.rst
+ Drivers.rst
+ Language.rst
+ Lib.rst
+ Develop.rst
+ C-style.rst
+ Ps-style.rst
+ Ps2epsi.rst
+ Psfiles.rst
+ Fonts.rst
+ Unix-lpr.rst
+ News.rst
+ Source.rst
+ thirdparty.rst
+ UnsupportedDevices.rst
+
+
+
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
diff --git a/doc/style.css b/doc/style.css
deleted file mode 100644
index 8978b867..00000000
--- a/doc/style.css
+++ /dev/null
@@ -1,433 +0,0 @@
-@charset "UTF-8";
-/* CSS Document */
-
-* {
- box-sizing: border-box;
- }
-
-.row::after {
- content: "";
- clear: both;
- display: table;
- }
-
-[class*="col-"] {
- float: left;
- }
-
-.col-1 {width: 10%;}
-.col-2 {width: 16.66%;}
-.col-3 {width: 25%;}
-.col-4 {width: 33.33%;}
-.col-ft-3 {width: 20%;}
-.col-5 {width: 41.66%;}
-.col-6 {width: 50%;}
-.col-lt-6 {width: 50%;}
-.col-7 {width: 58.33%;}
-.col-8 {width: 55%;}
-.col-9 {width: 55%;}
-.col-10 {width: 83.33%;}
-.col-11 {width: 91.66%;}
-.col-12 {width: 100%;}
-
-body {
- font-family: "Source Sans Pro", sans-serif;
- margin-left: auto;
- margin-right: auto;
- margin-top: 0px;
- margin-bottom: 0px;
- max-width: 1200px;
- }
-p {
- color: #333333;
- font-size: 14px;
-}
-
-dt {
- font-weight: 600;
- }
-
-h1 {
- margin-top: 0px;
- margin-bottom: 14px;
- font-size: 24px;
- font-weight: 600;
- color: #565656;
- }
-
-h2 {
- font-size: 22px;
- font-weight: 600;
- color: #565656;
- }
-
-h3 {
- font-size: 18px;
- font-weight: 600;
- color: #565656;
- }
-
-h4 {
- font-size: 16px;
- font-weight: 400;
- color: #565656;
- }
-
-h5 {
- font-size: 16px;
- font-weight: 400;
- color: #565656;
- }
-
-pre {
- font-family: "Source Code Pro", Consolas, "Andale Mono", Monaco, monospace;
- color: #565656;
- font-size: 14px;
- }
-
-code {
- font-family: "Source Code Pro", Consolas, "Andale Mono", Monaco, monospace;
- color: #565656;
- font-size: 14px;
- }
-
-a {
- color: #0068BD;
- text-decoration: none;
- font-size: 14px;
- }
-
-a:visited {
- color: #007FE7;
- text-decoration: none;
- }
-
-a:hover {
- text-decoration: underline;
- }
-
-ul li {
- list-style-type: disc;
- font-size: 14px;
- padding-right: 12px;
- color: #666;
- }
-
-hr {
- color: #e6e6e6;
- background-color: #e6e6e6;
- height: 2px;
- border: none;
- }
-
-.header {
- width: 100%;
- padding: 10px 20px 10px 15px;
- }
-
-.artifexlogo {
- padding: 25px 8px 10px 0px;
- float: right;
- }
-
-.button {
- float: right;
- border: none;
- border-radius: 4px;
- color: #fff;
- text-align: center;
- width: 100px;
- -webkit-transition-duration: 0.4s; /* Safari */
- transition-duration: 0.4s;
- cursor: pointer;
- padding: 8px 10px;
- display: inline;
- }
-
-.button a {
- color: #fff;
- font-size: 16px;
- text-decoration: none;
- }
-
-.button2 {
- background-color: #00b3e3;
- margin-right: 5px;
- }
-
-.button2:hover {
- background-color: #0075cf;
- text-decoration: none;
- }
-
-.button2:visited {
- background-color: #00b3e3;
- }
-
-.button1 {
- background-color: #77c11f;
- float: right;
- }
-
-.button1:hover {
- background-color: #009818;
- text-decoration: none;
- }
-
-.button1:visited {
- background-color: #77c11f;
- }
-
-.banner {
- background-color: #506B80;
- font-size: 20px;
- font-weight: 400;
- color: #fff;
- padding: 20px 0px 20px 15px;
- }
-
-.main {
- width: 100%;
- }
-
-.page {
- font-size: 14px;
- padding: 15px 10px 15px 25px;
- }
-
-.leftnav {
- background-color: #f0f0f0;
- list-style-type: none;
- padding-left: 8px;
- }
-
-.leftnav ul {
- list-style-type: none;
- margin: 0;
- padding: 0;
- background-color: #f0f0f0;
- }
-
-.leftnav li {
- font-size: 14px;
- list-style-type: none;
- }
-
-.leftnav li a {
- list-style-type: none;
- display: block;
- color: #000;
- padding: 11px 11px;
- }
-
-.leftnav li a:hover {
- background-color: #555;
- text-decoration: none;
- color: #fff;
- }
-
-.footer {
- background-color: #f1f1f1;
- padding: 10px 0px;
- font-size: 9px;
- color: #333;
- margin: 0px;
- }
-
-.footer li {
- color: #333;
- list-style-type: none;
- padding-bottom: 5px;
- }
-
-.footer li a {
- font-size: 11px;
- list-style-type: none;
- color: #333;
- }
-
-.footer li a:hover {
- color: #666;
- text-decoration: none;
- }
-
-.footleft {
- text-align: right;
- }
-
-.footcenter {
- text-align: left;
-}
-
-.footright {
- padding: 10px 0px 0px 0px;
- margin: 0px 20px 0px 40px;
-}
-
-.col-ft-3 img {
- max-width: 150px;
- max-height: 31px;
- }
-
-.accordion {
- background-color: #f0f0f0;
- color: #444;
- cursor: pointer;
- padding: 18px;
- width: 75%;
- border: none;
- text-align: left;
- outline: none;
- font-size: 15px;
- transition: 0.4s;
- margin-bottom: 10px;
-}
-
-.active, .accordion:hover {
- background-color: #ccc;
-}
-
-.accordion:after {
- content: '\002B';
- color: #777;
- font-weight: bold;
- float: right;
- margin-left: 5px;
-}
-
-.active:after {
- content: "\2212";
-}
-
-.panel {
- padding: 0 18px;
- background-color: white;
- max-height: 0;
- width: 75%;
- overflow: hidden;
- transition: max-height 0.2s ease-out;
-}
-
-.menuTrigger {display:none;}
-@media screen and (min-width: 480px){
-#sidebar {display:block!important}
-}
-@media screen and (max-width: 480px){
-
-#sidebar{display:none;}
-
-.menuTrigger {display:block; background-color: #506b80;}
-.menuTrigger:before{content: url(images/hamburger-light.png); padding: 9px 0px 6px 18px; background: #506b80; display: inline-block; }
-.menuTrigger.selected:before{content:url(images/x-light.png); }
-
-}
-
-/*TABLET*/
-@media (max-width:768px){
-
-.col-1 {width: 25%;}
-.col-2 {width: 25%;}
-.col-ft-3 {width: 30%;}
-.col-7 {width: 30%;}
-.col-10 {width: 75%;}
-
-.col button button1 button2 {
- display: inline;
- }
-
-.footright {
- padding: 10px 0px 10px 0px;
- margin-right: 10px; }
-
-.col-ft-3 img {
- max-width: 130px;
- max-height: 27px;
- }
-
-.hidden-lg {
- display: none;
- }
-}
-
-/*MOBILE*/
-@media (max-width:480px){
-
-.col-1 {width: 50%;}
-.col-2 {width: 100%;}
-.col-ft-3 {width: 50%;}
-.col-6 {width: 50%;}
-.col-7 {width: 50%;}
-.col-10 {width: 100%;}
-
-.col-6 img {
- max-width: 150px;
- max-height: 31px;
- }
-
-.col-lt-6 img {
- max-width: 79px;
- max-height: 85px;
- }
-
-.col-ft-3 img {
- max-width: 125px;
- max-height: 25px;
- }
-
-h1 {
- font-size: 22px;
- }
-
-h2 {
- font-size: 16px;
- }
-
-h3 {
- font-size: 14px;
- }
-
-.header {
- margin: 0px;
- }
-
-.hidden-xs {
- display: none;
- }
-
-.hidden-lg {
- display: inline;
- }
-
-.logo {
- padding: 0px 0px 0px 0px;
- }
-
-.artifexlogo {
- padding: 15px 0px 5px 10px;
- }
-
-.footright {
- padding: 10px 0px 0px 0px;
- }
-
-.button {
- padding: 4px 10px 5px;
- font-size: 13px;
- margin-right: 6px;
- }
-
-.banner {
- background-color: #506B80;
- font-size: 18px;
- font-weight: 400;
- color: #fff;
- padding: 5px 0px 0px 18px;
- }
-}
-
-/*DESKTOP*/
-@media (min-width:769px){
- .hidden-lg {
- display: none;
- }
-}
diff --git a/doc/subclass.htm b/doc/subclass.htm
deleted file mode 100644
index 0c8dd527..00000000
--- a/doc/subclass.htm
+++ /dev/null
@@ -1,722 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Ghostscript: Device Subclassing</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Ghostscript: Device Subclassing</h1>
-
-<h2><a name="toc"></a>Table of contents</h2>
-<ul class="toc">
- <li><a href="#Gstate">Devices in the graphcis state</a></li>
- <li><a href="#Chaining">Chaining devices</a></li>
- <li><a href="#Subclassing">Subclassing</a></li>
- <li><a href="#Example_uses">Example uses</a></li>
- <li><a href="#Observations">Observations</a></li>
- <li><a href="#Example">Worked example</a></li>
-</ul>
-
-<!-- [1.2 end table of contents] =========================================== -->
-
-<!-- [1.0 end visible header] ============================================== -->
-
-<!-- [2.0 begin contents] ================================================== -->
-<hr>
-<h2><a name="Gstate"></a>Devices in the graphics state</h2>
-<p>
-The 'device' is a member of the graphics state in PostScript, and is subject to gsave/grestore, like
- any other part of the graphics state. This is important for PostScript as it allows us to, for
- example, push the null device, perform some operations, and then grestore back to the original rendering
- device.
-</p><p>
-In PostScript and PDF, the graphics state is itself a garbage collected object, as is the device. This
- means that we store a pointer to the device in the graphics state, which forces the other interpreters
- to do so as well. Now an important implication of this is that it is then only possible, currently, to
- change devices by altering the graphics state entry to point at a different device structure, which
- means that the graphics state must be available in order to do so. Clearly at the interpreter level this
- isn't a problem, but at lower levels the graphics state may not be available, not all our device methods
- pass on a graphics state pointer for example. Without that pointer we can't change the graphics state and
- therefore can't point at a different device.
-</p>
-<hr>
-<h2><a name="Chaining"></a>Chaining devices</h2>
-<p>
-There are times when it is useful to be able to chain devices one after another, examples include the PDF
- transparency device, the pattern accumulator device and others. Some comments in early code indicate that
- the ability to chain devices was an original design goal, though its likely that originally this was only
- intended to work by installing devices from the interpreter level.
-</p><p>
-Currently there are a number of different ways to install devices, and the sheer number, and the methods
- themselves, show why there is a problem. Lets consider them separately.
-</p>
-<p>
-<dd>
-Forwarding devices. These devices generally intercept the usual graphics marking operations, and pass them
- on to the underlying device, or record some features of interest. Examples of these include the bbox device
- and the pattern accumulator. These work very well, but require the graphics state to be available when we
- need to insert them ahead of the 'underlying' device. This can be a problem, as we'll see later.
-</dd>
-</p><p>
-<dd>
-The device filter stack. This appears to be an early attempt at providing a way to chain devices together.
- From traces remaining in the code this seems to originally have been intended to implement the PDF 1.4
- transparency rendering. Its clear, however, that it is no longer used for that purpose and appears to be
- completely redundant. In any event it also requires access to the graphics state and so would suffer the
- same limitation.
-</dd></p>
-<p><dd>
-The clist. The clist code uses a very brute force approach to the problem, and only works for a single device.
- When a device is turned into a clist device, the code essentially guts the device and rewrites it (it replaces
- the overwritten entries later). This does work (though it seems rather horrendous to me) and doesn't require
- access to the graphics state because we simply reuse the existing memory of the original device. However this
- doesn't get us a 'chain', the clist simply morphs the existing device into something different.
-</dd></p>
-<p><dd>
-The PDF transparency compositor. This works in several ways to install itself, but the one of most interest is
- the case where we return from the device 'create_compositor' method. The interpreter is required to treat the
- return value as a pointer to a device, and if its not the same as the device currently in the graphics state,
- then it alters the graphics state to point to the new device. I'm not sure why its done this way as we do
- actually have access to the graphics state in this method and could presumably install the device ourselves.
- However it is not useful as a general purpose method for installing devices as it requires the return value
- to be acted upon by the interpreter. Making this general would require us to modify all the existing device
- methods, and have the interpreters check the return value, it would almost certainly be simpler (and more useful)
- to alter the methods to always include a graphics state.
-</dd></p>
-<p><dd>
-The 'spy' device. This is a somewhat non-standard device written by Robin, it works by copying the pointer to the
- device methods, and then replacing all the device methods, it is thus very similar to the clist device.
-</dd></p>
-<p>
-Taken together we have a number of different routes to install devices, but none of them is totally satisfactory
- for the goal of creating a chain of devices without access to the graphics state. However I think the existence of
- these manifold routes do indicate that there has been a recognition in the past that this would be useful to have.
-</p>
-<hr>
-<h2><a name="Subclassing"></a>Subclassing</h2>
-<p>
-From the above, its clear that we need to use some approach similar to the clist and spy devices. We must retain
- the original device memory, because that is what the graphics state points to, which means that we must reuse that
- memory in some fashion. By making a copy of the existing device elsewhere, we can then recycle the existing device.
-</p><p>
-As a short summary, that's precisely what the device subclassing code does. It examines the existing device, makes
- a new device structure sufficiently large to take a copy of it, and copies the existing device and all its state to
- that new memory. It then uses the prototype supplied for the new class, and writes that into the original device memory.
-</p>
-<h4>New device members</h4>
-<p>
-In order to chain the devices together, I've added three new pointers to the device structure (so that all devices
- can be chained), a child, a parent and a 'data' pointer (see below). Whenever we subclass a device the copied device
- gets its parent member set to the original device pointer, and the new device points to the copied one using the child
- member.</p>
-<p>
-Now a subtle point here is that, because we cannot change the size of the memory allocated for the original device
- (as that might relocate it, invalidating the graphics state pointer) its absolutely vital that the new device must be no
- larger than the old device. This means we have to be careful about data which the new device needs, we can't simply store
- it in the device structure as we usually do. To resolve that I've also added a void pointer to hold private data, the new
- device should allocate as much data as it requires (eg a structure) and store a pointer to that data in the subclass_data
- pointer. I'd recommend that this is allocated from non-GC memory except in special cases. This should mean that subclassing
- devices are never larger than a gx_device structure and so never overflow.
-</p>
-<h4>Subclassing made easy</h4>
-<p>
-In order to minimise the number of methods that a subclassing device needs to define I've created 'default' methods for all
- the possible device methods. Subclassing devices should use these in their prototype for any methods they don't handle.
- Additionally these can be used to pass on any methods after processing by the subclassing device, if required.
-</p>
-<hr>
-<h2><a name="Example_uses"></a>Example uses</h2>
-<p>
-The original justification for this work was to create a device which would add 'first page' and 'last page' functionality
- to all the languages and all the devices. The gdevflp.c file incorporates exactly that, it has been added to gdevprn.c and
- gdevvec.c so that any device based on either of these two basic devices will simply work. Additionally other devices which
- are not based on either of these (eg the 'bit' device) have been appropriately modified.
-</p>
-<p>
-If <code>-dFirstPage</code> or <code>-dLastPage</code> is set the parameter is parsed out and the existing device is
- subclassed by the new First/Last page device. This device simply drops all marking operations, and 'output_page' operations
- until we reach the page defined by FirstPage, and then passes everything through to the real device until we pass the page
- defined by LastPage at which point it throws everything away again until the end of the input.
-</p>
-<p>
-Now, this is not as efficient as the PDF interpreter's usage, which only passes those pages required to be rendered. So the
- old functionality has been preserved in the PDF interpreter, exactly as before. In order to prevent the subclassing device
- addionally acting on the same parameters, there is a <code>DisablePageHandler</code> flag which is set by the PDF interpreter.
-</p>
-<p>
-In order to test the chaining of devices together, I also created an 'object filtering' device; as with the first/last page
- device this has been added to all devices and any device based off gdevprn or gdevvec should inherit the functionality
- directly. This device allows objects to be dropped based on their type (text, image or linework) using the parameters
- <code>-dFILTERTEXT -dFILTERIMAGE</code> and <code>-dFILTERVECTOR</code>, if a parameter is set then objects of that type
- will not be rendered.
-</p>
-<p>
-Finally the PCL interpreter now uses a subclassing device to implement the 'monochrome palette' rendering. Previously this
- directly modified the color_procs in the current device, which I suspect was prone to potential failure (for example if a
- forwarding device had been pushed). This eliminated a somewhat ugly hack (in fairness its not obvious what would have been
- better), as well as allowing me to do away with some global variables in the PCL interpreter.
-</p>
-<hr>
-<h2><a name="Observations"></a>Observations</h2>
-<p>
-The monochrome palette device illuminated an interesting problem in the graphics library. Normally the device calls the graphics
- library for rendering services, but the color_procs work in reverse, the graphics library calls the device directly in order to
- map the colours. In the case of chained devices this meant that only the final device was being called. This was unacceptable in
- a situation involving chained devices, it seemed obvious to me that the graphics library should pass the request to the head of
- the device chain for processing. There is no simple way to do this (no access to the graphics state!) so instead I used the linked
- list of child/parent pointers to walk up to the head of the list, and then submit the request to that device.
-</p>
-<p>
-The ICC profile code has a 'get_profile' method in the device API to retrieve a profile, but it has no corresponding 'set_profile'
- method, it simply sets the structure member in the current device. This caused some serious problems. Consider the case where the
- ICC code executes a get_profile and no profile is yet set (returning NULL). The code would then create a profile and attach it
- directly to the current device. It then executes 'get_profile' again. If the current device was a subclassing device, or a forwarding
- device, then the 'set' would have set the profile in that device, but the 'get' would retrieve it from the underlying device, which
- would still be NULL. Since the ICC code didn't test the result on the second call this caused a segmentation fault. I've modified
- the ICC code to set the profile in the lowest device, but this probably ought to be improved to define a new 'set_profile' method.
-</p>
-<p>The tag devices write an extra colour plane in the output, where the value of the sample encodes the type of graphic that was
- rendered at that point (text, image, path, untouched or unknown). This is done by encoding the type in the color, which is performed
- by the graphics library. Now, when the type of operation changes (eg from image to text) we need to tell the graphics library that
- there has been a change. We do this by calling the set_graphics_type_tag device method. However, when encoding a color, the graphics
- library does not, as one might expect call a matching get_graphics_type method, instead it directly inspects the devcie structure and
- reads the graphics_type_tag member. This means that all devices in the chain must maintain this member, the implication is that if
- a subclassing device should implement its own set_graphics_type_tag method, it must update the graphics_type_tag in its device
- structure appropriately, and pass the method on to the next device in the chain. The default method already does this.</p>
-<p>
-Its pretty clear from reading through the code that the original intention of the device methods is that all methods in a device
- should be filled in, they should never be NULL (exception; fill_rectangle is deliberately excluded from this) if a device does not
- implement a method then 'fill_in_procs' should set a default method (which may legitimately simply throw an error). Over time this
- decision has not been enforced with the result that we now have some places where methods may be NULL. This has meant that there
- are places in the code which have to check for a method being NULL before using it, which is (I think) exactly what we were
- originally trying to avoid. Worse, since there is no list of which methods may be NULL a sensible developer would have to test all
- methods before use. Worst of all, it looks like some places may take a NULL method as having specific meaning (gsdparam.c line 272).
- We should really tidy this up.
- </p>
-<p>
-General observations are recorded in comments in gdevsclass.c
-</p>
-<hr>
-<h2><a name="Example"></a>Worked example</h2>
-<p>
-To see how to use the device subclassing we'll take a concrete example and implement it in a real device. For the purposes of the
- example we'll do a 'force black text' device and add it to the TIFF device(s). The reason for choosing the TIFF devices is that
- these already have an 'open_device' method which we are going to use to install the subclassing device. This isn't essential,
- you could install the device at any point, but its convenient.
-</p>
-<p>
-The first thing we need to do is add some control to turn this feature off and on, this is normally done by setting device
- parameters on the command line. To implement this we will need to modify the put_params and get_params methods. Note it is
- important to add new parameters to both the get and put methods, or an error will occur. We'll call our new parameter
- <code>ForceBlackText</code>.
-</p>
-<p>
-First we add the new parameter to the TIFF device, defined in gdevtifs.h:
-</p>
-<code>
-typedef struct gx_device_tiff_s {
-<dd> gx_device_common;<br />
- gx_prn_device_common;<br />
- bool ForceBlackText;<br />
- bool BlackTextHandlerPushed;<br />
-....
-</dd>
-}<br />
-</code><p>
-Note that we also have a boolean value 'BlackTextHandlerPushed' to track whether the device is already pushed or not, we'll want to use this later.
-</p>
-<p>
-We also need to add default values to the device prototypes, which are defined in gdevtfnx.c:
-</p>
-<code>const gx_device_tiff gs_tiff12nc_device = {
-<dd> prn_device_std_body(gx_device_tiff, tiff12_procs, "tiff12nc",<br />
- DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,<br />
- X_DPI, Y_DPI,<br />
- 0, 0, 0, 0,<br />
- 24, tiff12_print_page),<br />
- 0, /* ForceBlacktext */<br />
- 0, /* BlacktextHandlerPushed */<br />
- arch_is_big_endian /* default to native endian (i.e. use big endian iff the platform is so*/,
-</dd>
-</code><p>
-Repeat for gs_tiff24nc_device and gs_tiff48nc_device. For unknown reasons, the remaining TIFF devices are in gdevtsep.c, we need to make the
- same changes to the prototypes there; gs_tiffgray_device gs_tiffscaled_device gs_tiffscaled8_device gs_tiffscaled24_device
- gs_tiffscaled32_device gs_tiffscaled4_device gs_tiff32nc_device gs_tiff64nc_device and finally tiffsep_devices_body.
-</p>
-<p>Now we add code to put_params and get_params to set the parameter, and report its value back to the interpreter. In gdevtifs.c:</p>
-<code>static int
-tiff_get_some_params(gx_device * dev, gs_param_list * plist, int which)<br />
-{
-<dd> gx_device_tiff *const tfdev = (gx_device_tiff *)dev;<br />
- int code = gdev_prn_get_params(dev, plist);<br />
- int ecode = code;<br />
- gs_param_string comprstr;<br />
-<br />
- if ((code = param_write_bool(plist, "ForceBlackText", &tfdev->ForceBlackText)) < 0)<br />
- ecode = code;<br />
-....
-</dd>
-}
-</code>
-<code>
-<br />static int
-tiff_put_some_params(gx_device * dev, gs_param_list * plist, int which)<br />
-{
-<dd>gx_device_tiff *const tfdev = (gx_device_tiff *)dev;
- int ecode = 0;<br />
- int code;<br />
- const char *param_name;<br />
- bool big_endian = tfdev->BigEndian;<br />
- bool usebigtiff = tfdev->UseBigTIFF;<br />
- uint16 compr = tfdev->Compression;<br />
- gs_param_string comprstr;<br />
- long downscale = tfdev->DownScaleFactor;<br />
- long mss = tfdev->MaxStripSize;<br />
- long aw = tfdev->AdjustWidth;<br />
- long mfs = tfdev->MinFeatureSize;<br />
- bool ForceBlackText = tfdev->ForceBlackText;<br />
-<br />
- /* Read ForceBlackText option as bool */<br />
- switch (code = param_read_bool(plist, (param_name = "ForceBlackText"), &ForceBlackText)) {<br />
- default:<br />
- ecode = code;<br />
- param_signal_error(plist, param_name, ecode);<br />
- case 0:<br />
- case 1:<br />
- break;<br />
- }<br />
-<br />
- /* Read BigEndian option as bool */<br />
- switch (code = param_read_bool(plist, (param_name = "BigEndian"), &big_endian)) {<br />
-</dd>...
-<dd> tfdev->MinFeatureSize = mfs;<br />
- tfdev->ForceBlackText = ForceBlackText;<br />
- return code;<br />
-</dd>}
-</code>
-<p>
-Checking the TIFF device's open method (tiff_open) we see that it already potentially has two subclassing devices,
- this is because it doesn't inherit from gdev_prn, if it did this functionality would be inherited as well. We can
- just go ahead and add our new subclassing device in here.
-</p>
-<br />
-<code>int
-tiff_open(gx_device *pdev)<br />
-{
-<dd> gx_device_printer * const ppdev = (gx_device_printer *)pdev;<br />
- gx_device_tiff *tfdev = (gx_device_tiff *)pdev;<br />
- int code;<br />
- bool update_procs = false;<br />
-<br />
- /* Use our own warning and error message handlers in libtiff */<br />
- tiff_set_handlers();<br />
-<br />
- if (!tfdev->BlackTextHandlerPushed && (tfdev->ForceBlackText != 0)) {<br />
- gx_device *dev;<br />
-<br />
- gx_device_subclass(pdev, (gx_device *)&gs_black_text_device, sizeof(black_text_subclass_data));<br />
- tfdev = (gx_device_tiff *)pdev->child;<br />
- tfdev->BlackTextHandlerPushed = true;<br />
-<br />
- while(pdev->child)<br />
- pdev = pdev->child;<br />
- pdev->is_open = true;<br />
- update_procs = true;<br />
- }<br />
-</dd>
-</code><p>
-You might notice that this is a little simpler than the other device installations, that's because the other devices can potentially
- be installed by any device, and we need to track them more carefully. Our new device can only be installed by the TIFF device, so we
- don't need to note that its been installed already, in all the parent and child devices. This is only done so that we don't
- accidentally install these more basic devices more than once.
-</p>
-<p>
-So the first thing we do is check to see if we've already installed the device to force black text (we can potentially call the open
- method more than once and we don't want to install the device multiple times). If we haven't installed the device yet, and the feature
- has been requested, then we call the code to subclass the current device using the 'black_text_device' as the prototype for the new
- device, and pass in the amount of data it requires for its private usage.
-</p>
-<p>
-We will be defining this device as the next steps, for now just notice that after we call this, the 'current' device in the graphics
- state will be the black_text_device, and its 'child' member will be pointing to the TIFF device. So we note in that child device that
- we have pushed the black text handling device. We also note that the TIFF device is 'open' (the calling code will do this for the
- device pointed to by the graphics state, ie the black text device). Finally we set a boolean to 'update procs'. This is needed because
- the tiff_open routine calls gdev_prn_allocate_memory which resets the device methods, we need to put them back to be correct for our
- device(s), which is done at the end of the tiff_open code:
-</p>
-<br />
-<code>if (update_procs) {
-<dd> if (pdev->ObjectHandlerPushed) {<br />
- gx_copy_device_procs(&pdev->parent->procs, &pdev->procs, (gx_device_procs *)&gs_obj_filter_device.procs);<br />
- pdev = pdev->parent;<br />
- }<br />
- if (pdev->PageHandlerPushed) {<br />
- gx_copy_device_procs(&pdev->parent->procs, &pdev->procs, (gx_device_procs *)&gs_flp_device.procs);<br />
- pdev = pdev->parent;<br />
- }<br />
- /* set tfdev to the bottom device in the chain */<br />
- tfdev = (gx_device_tiff *)pdev;<br />
- while (tfdev->child)<br />
- tfdev = (gx_device_tiff *)tfdev->child;<br />
- if (tfdev->BlackTextHandlerPushed)<br />
- gx_copy_device_procs(&pdev->parent->procs, &pdev->procs, (gx_device_procs *)&gs_black_text_device.procs);<br />
- }<br />
-</dd>
-</code><p>
-In essence this simply works backwards through the chain of devices, restoring the correct methods as it goes. Note that because the
- BlackTextHandlerPushed variable isn't defined in the basic device structure, we have to cast the device pointer to a gx_device_tiff *
- so that we can set and check the variable which is defined there.
-</p>
-<p>
-That completes the changes we need to make to the TIFF device to add support for our new code. Now we need to create the black_text device which will do the actual work.
-</p>
-<p>We don't need any extras in the device structure, so we'll just define our subclassing device as being a gx_device:</p>
-<code>/* Black Text device */<br />
-typedef struct gx_device_s gx_device_black_text;<br />
-</code>
-<p>
-We also don't need any extra storage, but we do need to carry round the basic storage required by a subclassing device, so we do need to define a structure for that:
-</p>
-<code>typedef struct {
-<dd> subclass_common;
-</dd>} black_text_subclass_data;
-</code>
-<p>
-Now, we are going to deal with text (obviously) and text, like images, is handled rather awkwardly in the current device interface.
- Instead of the interpreter calling the various device methods, the 'text_begin' method creates a text enumerator which it returns
- to the interpreter. The text enumerator contains its own set of methods for dealing with text, and the interpreter calls these,
- thus bypassing the device itself. Since our subclassing requires us to pass down a chain of devices, when dealing with text and
- images we must also implement a chain of enumerators. For subclassing devices which don't process text or images this is catered
- for in the default_subclass_* methods, but in this case we need to handle the situation.
-</p>
-<p>We start by creating our own text enumerator structure:
-</p>
-<code>
-typedef struct black_text_text_enum_s {
-<dd> gs_text_enum_common;<br />
- gs_text_enum_t *child;
-</dd>} black_text_text_enum_t;
-</code>
-<p>Here we have a structure which contains the elements common to all enumerators, and a pointer to the next enumerator in the chain, we'll fill that in later.</p>
-<p>Ghostscript uses several memory managers, but for PostScript and PDF objects we use a garbage collector. Because we may want to
- store pointers to garbage collected objects in the text enumerator, and our device, we need to make the garbage collector aware of
- them. This is because the garbage collector can relocate objects in memory, in order to do so safely it needs to update any pointers
- referencing those objects with the new location and so it needs to be told about those pointers.</p>
-<p>So, we define a garbage collector structure for the text enumerator:</p>
-<code>extern_st(st_gs_text_enum);<br />
- gs_private_st_suffix_add1(st_black_text_text_enum, black_text_text_enum_t,
- "black_text_text_enum_t", black_text_text_enum_enum_ptrs, black_text_text_enum_reloc_ptrs,
- st_gs_text_enum, child);
-</code>
-<p>The macro 'extern_st' simply defines the structure (st_gs_text_enum) as being of type gs_memory_struct_type_t. We need this structure for the 'superstructure' defined below.</p>
-<p>The next macro 'gs_private_st_suffix_add1' is one of a family of macros used to define structures for the garbage collector. These
- all end up defining the named structure as being of type 'gc_struct_data_t' and fill in various members of that structure. In this case
- we are declaring that the structure:
-<dd>Has one pointer to additional garbage collected objects (add_1)</dd>
-<dd>Its name is 'st_black_text_text_enum'</dd>
-<dd>It is of type 'black_text_text_enum_t'</dd>
-<dd>Has the readable name for error messages 'black_text_text_enum_t</dd>
-<dd>The routine to be called to enumerate the garbage collected pointers in the structure is 'black_text_text_enum_enum_ptrs'</dd>
-<dd>The routine to be called when relocating garbage collcted objects pointed to by ths structure is 'black_text_text_enum_reloc_ptrs</dd>
-<dd>The 'superstructure' (ie the structure type this is based on) is 'st_gs_text_enum'. Ths means that all the enumeration and relocation methods for any pointers in the 'common' text enumerator structure get handled by this structure.</dd>
-<dd>The one additional pointer to a garbage collected object is the 'child' member.</dd>
-<br />The macro takes care of creating all the code we need to deal with this object, essentially it will create 'black_text_text_enum_enum_ptrs' and 'black_text_text_enum_reloc_ptrs' for us.
-</p>
-<p>
-So now we have to do a similar job for the actual device itself. We start by defining the enumeration and relocation routines
- for the structure. There are extensive macros for doing this, and we make use of some of them here. Explaining these is out of
- the scope of this document, but they are defined and easy to locate in the Ghostscript source tree.
-</p>
-<code>
-static<br />
-ENUM_PTRS_WITH(black_text_enum_ptrs, gx_device *dev);<br />
-return 0; /* default case */<br />
-case 0:ENUM_RETURN(gx_device_enum_ptr(dev->parent));<br />
-case 1:ENUM_RETURN(gx_device_enum_ptr(dev->child));<br />
-ENUM_PTRS_END<br />
-<br />
-static RELOC_PTRS_WITH(black_text_reloc_ptrs, gx_device *dev)<br />
-{
-<dd> dev->parent = gx_device_reloc_ptr(dev->parent, gcst);<br />
- dev->child = gx_device_reloc_ptr(dev->child, gcst);
-</dd>}RELOC_PTRS_END
-</code>
-<p>Essentially these simply tell the garbage collector that we are maintaining two pointers to garbage collected objects, the
- parent and child devices. Now we use those in the garbage collector 'structure descriptor' for the device. Note this is not
- the actual device structure, its the structure used by the garbage collector when dealing with the device.
-</p>
-<code>
-gs_public_st_complex_only(st_black_text_device, gx_device, "black_text",
- 0, black_text_enum_ptrs, black_text_reloc_ptrs, gx_device_finalize);
-</code>
-<p>
-Again 'gs_public_st_complex_only' is a macro, and its one of a family, these end up defining structures of type 'gs_memory_struct_t'.
-In this case we are declaring:
-<dd>The structure type is named 'st_black_text_device'</dd>
-<dd>The structure is of size 'gx_device' (ths only works because we don;t need any other storage, otherwise we would have to define the device structure and pass that here).</dd>
-<dd>The human readable name for error messages is 'black_text'</dd>
-<dd>We don't define a 'clear' routine.</dd>
-<dd>The enumerator for GC objects is called 'black_text_enum_ptrs'</dd>
-<dd>The relocator for GC objects is called 'black_text_reloc_ptrs'</dd>
-<dd>We use the regular 'gx_device_finalize' routine when freeing the object, we don't declare a special one of our own.</dd><br />
-Now we've got all the garbage collector machinery out of the way we can deal with the actual device itself. Because we're only interested in
- text, there's only one device method we want to handle, the text_begin method, so we start by prototyping that:
-</p>
-<code>
-/* Device procedures */<br />
-static dev_proc_text_begin(black_text_text_begin);
-</code>
-<p>Then we define the procedure to initialize the device procs:
-</p>
-<code>
-void black_text_init_dev_procs(gx_device *dev)<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;default_subclass_initialize_device_procs(dev);<br />
-<br />
-&nbsp;&nbsp;&nbsp;&nbsp;set_dev_proc(dev, text_begin, black_text_text_begin);<br />
-}
-</code>
-<p>Then we define the actual device:
-</p>
-<code>
-const
-gx_device_black_text gs_black_text_device =<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;std_device_dci_type_body(gx_device_black_text, 0, "black_text", &st_black_text_device,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAX_COORD, MAX_COORD,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAX_RESOLUTION, MAX_RESOLUTION,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1, 8, 255, 0, 256, 1),<br />
-&nbsp;&nbsp;&nbsp;&nbsp;black_text_initialize_device_procs<br />
-};
-</code>
-<p>The call to default_subclass_initialize_device_procs assigns the
-default methods for a subclassing device. We then override the
-text_begin method to our specific one. The main body of the macro is:</p>
-<code>
-const
-gx_device_black_text gs_black_text_device =<br />
-{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;std_device_dci_type_body(gx_device_black_text, 0, "black_text", &st_black_text_device,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAX_COORD, MAX_COORD,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MAX_RESOLUTION, MAX_RESOLUTION,<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1, 8, 255, 0, 256, 1),
-</code>
-<p>This simply defines an instance of the 'gx_device_black_text' structure (which is simply a gx_device_s structure) initialised
- using a macro (yet another family of macros). Here we use the 'st_black_text_device' structure descriptor we created above,
- and some dummy values for the resolution, colour depth etc. Since this device doesn't do rendering these values aren't useful
- and these defaults should be fine.
-</p>
-<p>Now, for text we need to fill in all the procedures in the text enumerator, we'll start by defining the 'resync' method, and
- then use this as a template for most of the other methods in the text enumerator:
-</p>
-<code>
-static int
-black_text_text_resync(gs_text_enum_t *pte, const gs_text_enum_t *pfrom)
-{
-<dd> black_text_text_enum_t *penum;<br />
- gs_text_enum_t * child = penum->child;<br />
- int code;<br />
-<br />
- code = child->procs->resync(child, pfrom);<br />
- gs_text_enum_copy_dynamic(pte, child, true);<br />
- return code;<br />
-</dd>}
-</code>
-<p>The routine starts by casting the generic text enumerator to our specific type of text enumerator. From that we can get the child
- enumerator, and we simply pass the operation on directly to the child (remembering to pass the child enumerator as an argument, not our own one!).
-</p>
-<p>
-Now, on return it may be that the child has modified the contents of the enumerator, so we must copy anything that might have changed
- from the child enumerator to our own. That's what the 'gs_text_enum_copy_dynamic' routine does. After that we simply return the saved return value.
-</p>
-<p>
-All the other routines are basically the same as this, we don't really want to do anything in the text enumeration so we just hand off the processing to the child.
-</p>
-<code>
-static int
-black_text_text_process(gs_text_enum_t *pte)
-{
-<dd> black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;<br />
- gs_text_enum_t * child = penum->child;<br />
- int code;<br />
-<br />
- code = child->procs->process(child);<br />
- gs_text_enum_copy_dynamic(pte, child, true);<br />
- return code;<br />
-</dd>}<br />
-static bool
-black_text_text_is_width_only(const gs_text_enum_t *pte)
-{
-<dd> black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;<br />
- gs_text_enum_t * child = penum->child;<br />
- int code;<br />
-<br />
- code = child->procs->is_width_only(child);<br />
- gs_text_enum_copy_dynamic((gs_text_enum_t *)pte, child, true);<br />
- return code;<br />
-</dd>}<br />
-static int
-black_text_text_current_width(const gs_text_enum_t *pte, gs_point *pwidth)
-{
-<dd> black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;<br />
- gs_text_enum_t * child = penum->child;<br />
- int code;<br />
-<br />
- code = child->procs->current_width(child, pwidth);<br />
- gs_text_enum_copy_dynamic((gs_text_enum_t *)pte, child, true);<br />
- return code;<br />
-</dd>}<br />
-static int
-black_text_text_set_cache(gs_text_enum_t *pte, const double *pw,
- gs_text_cache_control_t control)
-{
-<dd> black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;<br />
- gs_text_enum_t * child = penum->child;<br />
- int code;<br />
-<br />
- code = child->procs->set_cache(child, pw, control);<br />
- gs_text_enum_copy_dynamic(pte, child, true);<br />
- return code;<br />
-</dd>}<br />
-static int
-black_text_text_retry(gs_text_enum_t *pte)
-{
-<dd> black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;<br />
- gs_text_enum_t * child = penum->child;<br />
- int code;<br />
-<br />
- code = child->procs->retry(child);<br />
- gs_text_enum_copy_dynamic(pte, child, true);<br />
- return code;<br />
-</dd>}<br />
-static void
-black_text_text_release(gs_text_enum_t *pte, client_name_t cname)
-{
-<dd> black_text_text_enum_t *penum = (black_text_text_enum_t *)pte;<br />
- gs_text_enum_t * child = penum->child;<br />
-<br />
- child->procs->release(child, cname);<br />
- gx_default_text_release(pte, cname);<br />
-</dd>}
-</code>
-<p>The 'release' method is very slightly different, because we need to free the numerator, so we call 'gx_default_text_release'</p>
-<p>Now, finally, we can define the 'text_begin' device method, the first thing we do is a convenience, we define a
- 'gs_text_enum_procs' instance which is initialised to point to all the text enumerator methods we defined above:
-</p>
-<code>
-static const gs_text_enum_procs_t black_text_text_procs = {
-<dd> black_text_text_resync, black_text_text_process,
- black_text_text_is_width_only, black_text_text_current_width,
- black_text_text_set_cache, black_text_text_retry,
- black_text_text_release
-</dd>};</code>
-<p>So on to the text_begin method:
-</p>
-<code>
-/* The device method which we do actually need to define.
- */<br />
-int black_text_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text,<br />
- gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath,<br />
- gs_memory_t *memory, gs_text_enum_t **ppte)<br />
-{<br />
-<dd> black_text_text_enum_t *penum;<br />
- int code;<br />
- gs_text_enum_t *p;<br />
-<br />
- rc_alloc_struct_1(penum, black_text_text_enum_t, &st_black_text_text_enum, memory,<br />
- return_error(gs_error_VMerror), "black_text_text_begin");<br />
- penum->rc.free = rc_free_text_enum;<br />
- code = gs_text_enum_init((gs_text_enum_t *)penum, &black_text_text_procs,<br />
- dev, pis, text, font, path, pdcolor, pcpath, memory);<br />
- if (code < 0) {<br />
- gs_free_object(memory, penum, "black_text_text_begin");<br />
- return code;<br />
- }<br />
- *ppte = (gs_text_enum_t *)penum;<br />
-<br />
- code = default_subclass_text_begin(dev, pis, text, font, path, pdcolor, pcpath, memory, &p);<br />
- if (code < 0) {<br />
- gs_free_object(memory, penum, "black_text_text_begin");<br />
- return code;<br />
- }<br />
- penum->child = p;<br />
-<br />
- return 0;<br />
-</dd>}
-</code>
-<p>This uses library macros to create and initialise the text enumerator. Text enumerators are reference counted
- (and garbage collected.....) so we use the rc_alloc_struct family of macros, the '1' is the initial reference
- count that we want to have. We then call 'gs_text_enum_init' to initialise the newly created structure, passing
- in the text procs we just created as one of the arguments.
-</p>
-<p>We then set the returned enumerator to point to the newly created text enumerator. Finally we pass the 'text_begin'
- method on to the child device using the 'default_subclass_text_begin' method and we store the returned text enumerator
- in the child pointer of our own enumerator.
-</p>
-<p>At this point the code should compile and run properly, but it won;t actually do anything yet. For that we need to
- modify the current colour before we run the text. Fortunately we don't need to deal with the graphics state, the text_begin
- method is given the colour index to be used so all we need to do is alter that. We do, however, have to cater for what the
- device thinks 'black' actually is, but there are graphics library calls to deal with both finding that information and
- setting a colour index from it:
-</p>
-<code>
-int black_text_text_begin(gx_device *dev, gs_imager_state *pis, const gs_text_params_t *text,<br />
- gs_font *font, gx_path *path, const gx_device_color *pdcolor, const gx_clip_path *pcpath,<br />
- gs_memory_t *memory, gs_text_enum_t **ppte)<br />
-{
-<dd> black_text_text_enum_t *penum;<br />
- int code;<br />
- gs_text_enum_t *p;<br />
-<br />
- /* Set the colour index in 'pdcolor' to be whatever the device thinks black shoudl be */<br />
- set_nonclient_dev_color((gx_device_color *)pdcolor, gx_device_black((gx_device *)dev));<br />
-</dd>
-</code>
-<p>That concludes the worked example and the documentation on device subclassing.
-</p>
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2013-2022 Artifex Software, Inc. All rights
-reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied,
-modified or distributed except as expressly authorized under the terms
-of the license contained in the file LICENSE in this distribution.
-
-For more information about licensing, please visit
-http://www.artifex.com/licensing/
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/doc/thirdparty.htm b/doc/thirdparty.htm
deleted file mode 100644
index 8d3f8634..00000000
--- a/doc/thirdparty.htm
+++ /dev/null
@@ -1,215 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <meta name="viewport" content="user-scalable=yes, initial-scale=1, width=device-width">
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i" rel="stylesheet">
- <link rel="shortcut icon" href="images/favicon.svg">
- <title>Third Party Libraries Used by Ghostscript and GhostPDL</title>
- <link href="default.css" rel="stylesheet" type="text/css">
-</head>
-
-<body>
- <header><div class="title"><a href="index.html"><h1 aria-label="title">Ghostscript documentation</h1><h2 aria-label="version"></h2></a></div><a href="Search.htm" aria-label="Search" id="searchSite"><div class="search"></div></a></header>
- <main>
- <article>
- <div class="outer">
-
- <div class="inner">
-<!--START EDITING HERE-->
-
-<h1>Third Party Libraries Used by Ghostscript and GhostPDL</h1>
-
-<p>
-The table below details the third party libraries that Ghostscript and/or
-GhostPDL include, the versions QA tested and shipped with our releases,
-the relevant license, and the "upstream" URL.
-<p>
-
-<table>
-<tr height="60">
-<th align="center">Library Name</th>
-<th align="center">Version</th>
-<th align="center">Function</th>
-<th align="center">License</th>
-<th align="center">URL</th>
-</tr>
-
-<tr height="60">
-<td align="center">CUPS<br>
-<font size="1">(AGPL Release Only)</font></td>
-<td align="center">2.8.0</td>
-<td align="center">CUPS raster format output</td>
-<td align="center">GPL Version 3</td>
-<td align="center"><a href="http://www.cups.org">http://www.cups.org/</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">eXpat</td>
-<td align="center">2.4.1</td>
-<td align="center">XML parsing for XPS interpreter</td>
-<td align="center">MIT/eXpat License</td>
-<td align="center"><a href="http://expat.sourceforge.net/">http://expat.sourceforge.net/</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">FreeType</td>
-<td align="center">2.11.1</td>
-<td align="center">Font scaling and rendering for Ghostscript</td>
-<td align="center">FreeType License<br>
-<font size="1">(BSD-style license with a credit clause)</font></td>
-<td align="center"><a href="http://www.freetype.org/">http://www.freetype.org/</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">jbig2dec</td>
-<td align="center">0.19</td>
-<td align="center">JBIG2 decoding for the PDF interpreter</td>
-<td align="center">Licensed with Ghostscript/GhostPDL<br>
-<font size="1">(copyright owned by Artifex)</font></td>
-<td align="center"><a href="http://www.ghostscript.com/">http://www.ghostscript.com/</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">libjpeg</td>
-<td align="center">9d<br>
-<font size="1">with patches</font></td>
-<td align="center">JPEG/DCT decoding/encoding</td>
-<td align="center">"Free"<br>
-<font size="1">Can be used in commercial applications without royalty, with acknowledgement.</font></td>
-<td align="center"><a href="http://www.ijg.org/">http://www.ijg.org/</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">LittleCMS 2 mt<br>
-<font size="1">(lcms2mt - thread save fork of lcms2)</font></td>
-<td align="center">2.10mt</td>
-<td align="center">ICC profile based color conversion and management</td>
-<td align="center">MIT LICENSE</td>
-<td align="center"><a href="http://www.ghostscript.com/">http://www.ghostscript.com/</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">libpng</td>
-<td align="center">1.6.37</td>
-<td align="center">PNG image encoding/decoding.</td>
-<td align="center">libpng license<br>
-<font size="1">classified as "a permissive free software license"</font></td>
-<td align="center"><a href="http://www.libpng.org/">http://www.libpng.org/</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">OpenJPEG</td>
-<td align="center">2.4.0</td>
-<td align="center">JPEG2000 image decoding for the PDF interpreter</td>
-<td align="center">BSD-style</td>
-<td align="center"><a href="http://www.openjpeg.org/">http://www.openjpeg.org/</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">libtiff</td>
-<td align="center">4.2.0</td>
-<td align="center">TIFF image encoding/decoding</td>
-<td align="center">BSD-style</td>
-<td align="center"><a href="http://www.remotesensing.org/libtiff/">http://www.remotesensing.org/libtiff/</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">zlib</td>
-<td align="center">1.2.11</td>
-<td align="center">(De)Flate compression</td>
-<td align="center">zlib License<br>
-<font size="1">classified as "a permissive free software license"</font></td>
-<td align="center"><a href="http://www.zlib.net/">http://www.zlib.net/</a></td>
-</tr>
-
-<tr>
-
-<td colspan="5" align="left"><hr>The following are optional.<hr></td>
-</tr>
-
-<tr height="60">
-<td align="center">tesseract</td>
-<td align="center">4.1.0<br>
-<font size="1">with patches</font></td>
-<td align="center">Optical Character Recognition (OCR) library</td>
-<td align="center">Apache License 2.0<br>
-<font size="1"></font></td>
-<td align="center"><a href="https://github.com/tesseract-ocr/tesseract">https://github.com/tesseract-ocr/tesseract</a></td>
-</tr>
-
-<tr height="60">
-<td align="center">leptonica</td>
-<td align="center">1.80.0<br>
-<font size="1">with patches</font></td>
-<td align="center">Image processing toolkit - support library for tesseract OCR</td>
-<td align="center">Leptonica License<br>
-<font size="1">"a permissive free software license"</font></td>
-<td align="center"><a href="http://www.leptonica.org/">http://www.leptonica.org/</a></td>
-</tr>
-
-<tr>
-
-<td colspan="5" align="left"><hr>The following are no-cost, open source licensed, but not GPL compatible.<hr></td>
-</tr>
-
-<tr height="60">
-<td align="center">jpegxr<br>
-<font size="1">(JPEG XR reference software)</font></td>
-<td align="center">1.8</td>
-<td align="center">HDPhoto/JPEG-XR image decoding for the XPS interpreter</td>
-<td align="center">ITU/ISO/IEC "Free" License<br>
-<font size="1">Reference implementation</font></td>
-<td align="center"><a href="http://www.itu.int/rec/T-REC-T.835">http://www.itu.int/rec/T-REC-T.835</a></td>
-</tr>
-
-<tr>
-<td colspan="5" align="left"><hr>The following are relevant to Artifex Software commercial releases only.<hr></td>
-</tr>
-
-<tr height="60">
-<td align="center">AGFA UFST<br>
-<font size="1">Optional</font></td>
-<td align="center">5.x/6.x<br>
-<font size="1">with patches</font></td>
-<td align="center">Access, scale and render AGFA MicroType fonts</td>
-<td align="center">Commercial</td>
-<td align="center"><a href="http://www.monotypeimaging.com/">http://www.monotypeimaging.com/</a></td>
-</tr>
-
-</table>
-
-<!-- [2.0 end contents] ==================================================== -->
-
-<!-- [3.0 begin visible trailer] =========================================== -->
-<hr>
-
-<p>
-<small>Copyright &copy; 2005-2022 Artifex Software, Inc.
-All rights reserved.</small>
-
-<p>
-This software is provided AS-IS with no warranty, either express or
-implied.
-
-This software is distributed under license and may not be copied, modified
-or distributed except as expressly authorized under the terms of that
-license. Refer to licensing information at <a href="https://www.artifex.com">https://www.artifex.com</a>
-or contact Artifex Software, Inc., 1305 Grant Avenue - Suite 200,
-Novato, CA 94945, U.S.A., +1(415)492-9861, for further information.
-
-<p>
-<small>Ghostscript version 9.56.1, 4 April 2022
-
-<!-- [3.0 end visible trailer] ============================================= -->
-
-
-
-<!--FINISH EDITING HERE-->
- </div><!-- close inner -->
- </div><!-- close outer -->
- </article>
- </main>
- <script src="site.js"></script>
-</body>
-</html>
diff --git a/extract/Makefile b/extract/Makefile
index 31b099c3..c6ab881b 100644
--- a/extract/Makefile
+++ b/extract/Makefile
@@ -29,6 +29,15 @@
#
# make build=memento msqueeze
# Run memento squeeze test.
+#
+# Assuming we are in mupdf/thirdparty/extract, and there is a ghostpdl at
+# the same level as mupdf, with a softlink from ghostpdl to extract:
+#
+# make test-rebuild-dependent-binaries
+# Clean/Configure/Rebuild the required mupdf and gs binaries.
+#
+# make test-build-dependent-binaries
+# Build the required mupdf and gs binaries.
# Build flags.
@@ -173,7 +182,7 @@ ifneq ($(gs),)
tests_gs := \
$(patsubst %, %.gs.docx.diff, $(pdfs_generated)) \
test_gs_fpp
-
+
# We don't yet do clipping with gs so exclude Python2clipped.pdf.*:
tests_gs := $(filter-out test/generated/Python2clipped.pdf.%, $(tests_gs))
@@ -228,6 +237,17 @@ test_gs_fpp: $(gs)
test-html: $(tests_html)
+test-rebuild-dependent-binaries:
+ @echo == Rebuilding gs and mupdf binaries
+ cd ../../../ghostpdl && ./autogen.sh --with-extract-dir=extract && make -j 8 debugclean DEBUGDIRPREFIX=debug-extract- && make -j 8 debug DEBUGDIRPREFIX=debug-extract-
+ cd ../.. && make -j 8 build=debug clean && make -j 8 build=debug
+
+test-build-dependent-binaries:
+ @echo == Building gs and mupdf binaries
+ cd ../../../ghostpdl && make -j 8 debug DEBUGDIRPREFIX=debug-extract-
+ cd ../.. && make -j 8 build=debug
+
+
ifneq ($(mutool),)
test_tables_pdfs = \
test/agstat.pdf \
@@ -284,6 +304,7 @@ exe = src/build/extract-$(build).exe
exe_src = \
src/alloc.c \
src/astring.c \
+ src/boxer.c \
src/buffer.c \
src/document.c \
src/docx.c \
@@ -296,6 +317,7 @@ exe_src = \
src/odt.c \
src/odt_template.c \
src/outf.c \
+ src/rect.c \
src/sys.c \
src/text.c \
src/xml.c \
@@ -491,7 +513,7 @@ test/generated/%.pdf.gs.docx: test/%.pdf $(gs)
@echo == Converting .pdf directly to .docx using gs.
@mkdir -p test/generated
$(gs) -sDEVICE=docxwrite -o $@ $<
-
+
# Converts .pdf directly to .odt using mutool.
test/generated/%.pdf.mutool.odt: test/%.pdf $(mutool)
@echo
diff --git a/extract/README b/extract/README
index aadd1062..f1bacd01 100644
--- a/extract/README
+++ b/extract/README
@@ -7,6 +7,25 @@ Directory tree:
test/ Test files.
generated/ Files generated by tests.
+Suggested setup for testing:
+ Checkout ghostpdl and mupdf into the same directory.
+ Inside ghostpdl:
+ ln -s ../mupdf/thirdparty/extract extract
+
+ Then either:
+ Inside ghostpdl:
+ ./autogen.sh --with-extract-dir=extract
+ make -j 8 debug DEBUGDIRPREFIX=debug-extract-
+ Inside mupdf:
+ make -j 8 debug
+ or:
+ make test-rebuild-dependent-binaries (for the first time)
+ make test-build-dependent-binaries (for incremental builds)
+
+
+ Then build and run tests from inside mupdf/thirdparty/extract
+ as below.
+
Build and run tests with:
make
diff --git a/extract/include/extract.h b/extract/include/extract.h
index b01ba6f3..5e0b09fc 100644
--- a/extract/include/extract.h
+++ b/extract/include/extract.h
@@ -10,13 +10,13 @@ set.
#include "extract_alloc.h"
#include "extract_buffer.h"
+#include <float.h>
typedef struct extract_t extract_t;
/* Abstract state for processing a document. */
-
typedef enum
{
extract_format_ODT,
@@ -50,7 +50,7 @@ allocation will be done with <alloc> (which can be NULL in which case we use
malloc/free, or from extract_alloc_create()). */
-int extract_page_begin(extract_t* extract);
+int extract_page_begin(extract_t* extract, double minx, double miny, double maxx, double maxy);
/* Must be called before extract_span_begin(). */
@@ -73,7 +73,7 @@ int extract_span_begin(
double trm_e,
double trm_f
);
-/* Starts a new span.
+/* Starts a new span.
extract
As passed to earlier call to extract_begin().
font_name
@@ -92,12 +92,16 @@ trm_*
int extract_add_char(
- extract_t* extract,
- double x,
- double y,
- unsigned ucs,
- double adv,
- int autosplit
+ extract_t* extract,
+ double x,
+ double y,
+ unsigned ucs,
+ double adv,
+ int autosplit,
+ double minx,
+ double miny,
+ double maxx,
+ double maxy
);
/* Appends specified character to current span.
extract
@@ -112,6 +116,8 @@ adv
Advance of this character.
autosplit
Ignored as of 2021-07-02.
+minx, miny, maxx, maxy
+ Glyph bbox
*/
@@ -262,7 +268,7 @@ archive by extract_write()). */
int extract_write_template(
- extract_t* extract,
+ extract_t* extract,
const char* path_template,
const char* path_out,
int preserve_dir
@@ -290,6 +296,10 @@ void extract_end( extract_t** pextract);
/* Frees all data associated with *pextract and sets *pextract to NULL. */
+int extract_set_layout_analysis(extract_t* extract, int enable);
+/* Enables/Disables the layout analysis phase. */
+
+
/* Things below are not generally used. */
int extract_tables_csv_format(extract_t* extract, const char* path_format);
@@ -318,4 +328,7 @@ allocate in powers of two times this size. This is an attempt to improve speed
with memento squeeze. Default is 0 (every call to extract_realloc() calls
realloc(). */
+void extract_analyse(extract_t *extract);
+/* Analyse the structure of the current page. */
+
#endif
diff --git a/extract/src/astring.c b/extract/src/astring.c
index e5d40217..07c22d55 100644
--- a/extract/src/astring.c
+++ b/extract/src/astring.c
@@ -87,7 +87,7 @@ int extract_astring_catc_unicode(
)
{
int ret = -1;
-
+
if (0) {}
/* Escape XML special characters. */
@@ -118,7 +118,7 @@ int extract_astring_catc_unicode(
{
if (extract_astring_cat(alloc, string, "ffl")) goto end;
}
-
+
/* Convert some special characters to ascii. */
else if (ascii_dash && c == 0x2212)
{
@@ -162,7 +162,7 @@ int extract_astring_catc_unicode(
}
else if (c < 0x0800)
{
- char cc[2] =
+ char cc[2] =
{
(char) (((c >> 6) & 0x1f) | 0xc0),
(char) (((c >> 0) & 0x3f) | 0x80)
@@ -171,7 +171,7 @@ int extract_astring_catc_unicode(
}
else if (c < 0x10000)
{
- char cc[3] =
+ char cc[3] =
{
(char) (((c >> 12) & 0x0f) | 0xe0),
(char) (((c >> 6) & 0x3f) | 0x80),
@@ -181,7 +181,7 @@ int extract_astring_catc_unicode(
}
else if (c < 0x110000)
{
- char cc[4] =
+ char cc[4] =
{
(char) (((c >> 18) & 0x07) | 0xf0),
(char) (((c >> 12) & 0x3f) | 0x80),
@@ -198,9 +198,9 @@ int extract_astring_catc_unicode(
}
}
}
-
+
ret = 0;
-
+
end:
return ret;
}
diff --git a/extract/src/boxer.c b/extract/src/boxer.c
new file mode 100644
index 00000000..21cde1b6
--- /dev/null
+++ b/extract/src/boxer.c
@@ -0,0 +1,621 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <memory.h>
+#include <assert.h>
+
+#include "document.h"
+#include "outf.h"
+
+#define DEBUG_WRITE_AS_PS
+/* #define DEBUG_PRINT */
+
+typedef struct boxer_s boxer_t;
+
+typedef struct {
+ int len;
+ int max;
+ rect_t list[1];
+} rectlist_t;
+
+struct boxer_s {
+ extract_alloc_t *alloc;
+ rect_t mediabox;
+ rectlist_t *list;
+};
+
+static rectlist_t *
+rectlist_create(extract_alloc_t *alloc, int max)
+{
+ rectlist_t *list;
+
+ if (extract_malloc(alloc, &list, sizeof(rectlist_t) + sizeof(rect_t)*(max-1)))
+ return NULL;
+
+ list->len = 0;
+ list->max = max;
+
+ return list;
+}
+
+/* Push box onto rectlist, unless it is completely enclosed by
+ * another box, or completely encloses others (in which case they
+ * are replaced by it). */
+static void
+rectlist_append(rectlist_t *list, rect_t *box)
+{
+ int i;
+
+ for (i = 0; i < list->len; i++)
+ {
+ rect_t *r = &list->list[i];
+ rect_t smaller, larger;
+ /* We allow ourselves a fudge factor of 4 points when checking for inclusion. */
+ double r_fudge = 4;
+
+ smaller.min.x = r->min.x + r_fudge;
+ larger. min.x = r->min.x - r_fudge;
+ smaller.min.y = r->min.y + r_fudge;
+ larger. min.y = r->min.y - r_fudge;
+ smaller.max.x = r->max.x - r_fudge;
+ larger. max.x = r->max.x + r_fudge;
+ smaller.max.y = r->max.y - r_fudge;
+ larger. max.y = r->max.y + r_fudge;
+
+ if (extract_rect_contains_rect(larger, *box))
+ return; /* box is enclosed! Nothing to do. */
+ if (extract_rect_contains_rect(*box, smaller)) {
+ /* box encloses r. Ditch r. */
+ /* Shorten the list */
+ --list->len;
+ /* If the one that just got chopped off wasn't r, move it down. */
+ if (i < list->len) {
+ memcpy(r, &list->list[list->len], sizeof(*r));
+ i--; /* Reconsider this entry next time. */
+ }
+ }
+ }
+
+ assert(list->len < list->max);
+ memcpy(&list->list[list->len], box, sizeof(*box));
+ list->len++;
+}
+
+static boxer_t *
+boxer_create_length(extract_alloc_t *alloc, rect_t *mediabox, int len)
+{
+ boxer_t *boxer;
+
+ if (extract_malloc(alloc, &boxer, sizeof(*boxer)))
+ return NULL;
+
+ boxer->alloc = alloc;
+ memcpy(&boxer->mediabox, mediabox, sizeof(*mediabox));
+ boxer->list = rectlist_create(alloc, len);
+
+ return boxer;
+}
+
+/* Create a boxer structure for a page of size mediabox. */
+static boxer_t *
+boxer_create(extract_alloc_t *alloc, rect_t *mediabox)
+{
+ boxer_t *boxer = boxer_create_length(alloc, mediabox, 1);
+
+ if (boxer == NULL)
+ return NULL;
+ rectlist_append(boxer->list, mediabox);
+
+ return boxer;
+}
+
+static void
+push_if_intersect_suitable(rectlist_t *dst, const rect_t *a, const rect_t *b)
+{
+ rect_t c;
+
+ /* Intersect a and b. */
+ c = extract_rect_intersect(*a, *b);
+ /* If no intersection, nothing to push. */
+ if (!extract_rect_valid(c))
+ return;
+
+ /* If the intersect is too narrow or too tall, ignore it.
+ * We don't care about inter character spaces, for example.
+ * Arbitrary 4 point threshold. */
+#define THRESHOLD 4
+ if (c.min.x + THRESHOLD >= c.max.x || c.min.y+THRESHOLD >= c.max.y)
+ return;
+
+ rectlist_append(dst, &c);
+}
+
+static void
+boxlist_feed_intersect(rectlist_t *dst, const rectlist_t *src, const rect_t *box)
+{
+ int i;
+
+ for (i = 0; i < src->len; i++)
+ push_if_intersect_suitable(dst, &src->list[i], box);
+}
+
+/* Mark a given box as being occupied (typically by a glyph) */
+static int boxer_feed(boxer_t *boxer, rect_t *bbox)
+{
+ rect_t box;
+ /* When we feed a box into a the boxer, we can never make
+ * the list more than 4 times as long. */
+ rectlist_t *newlist = rectlist_create(boxer->alloc, boxer->list->len * 4);
+ if (newlist == NULL)
+ return -1;
+
+#ifdef DEBUG_WRITE_AS_PS
+ printf("0 0 1 setrgbcolor\n");
+ printf("%g %g moveto %g %g lineto %g %g lineto %g %g lineto closepath fill\n",
+ bbox->min.x, bbox->min.y,
+ bbox->min.x, bbox->max.y,
+ bbox->max.x, bbox->max.y,
+ bbox->max.x, bbox->min.y
+ );
+#endif
+
+ /* Left (0,0) (min.x,H) */
+ box.min.x = boxer->mediabox.min.x;
+ box.min.y = boxer->mediabox.min.y;
+ box.max.x = bbox->min.x;
+ box.max.y = boxer->mediabox.max.y;
+ boxlist_feed_intersect(newlist, boxer->list, &box);
+
+ /* Right (max.x,0) (W,H) */
+ box.min.x = bbox->max.x;
+ box.min.y = boxer->mediabox.min.y;
+ box.max.x = boxer->mediabox.max.x;
+ box.max.y = boxer->mediabox.max.y;
+ boxlist_feed_intersect(newlist, boxer->list, &box);
+
+ /* Bottom (0,0) (W,min.y) */
+ box.min.x = boxer->mediabox.min.x;
+ box.min.y = boxer->mediabox.min.y;
+ box.max.x = boxer->mediabox.max.x;
+ box.max.y = bbox->min.y;
+ boxlist_feed_intersect(newlist, boxer->list, &box);
+
+ /* Top (0,max.y) (W,H) */
+ box.min.x = boxer->mediabox.min.x;
+ box.min.y = bbox->max.y;
+ box.max.x = boxer->mediabox.max.x;
+ box.max.y = boxer->mediabox.max.y;
+ boxlist_feed_intersect(newlist, boxer->list, &box);
+
+ extract_free(boxer->alloc, &boxer->list);
+ boxer->list = newlist;
+
+ return 0;
+}
+
+static int
+compare_areas(const void *a_, const void *b_)
+{
+ const rect_t *a = (const rect_t *)a_;
+ const rect_t *b = (const rect_t *)b_;
+ double area_a = (a->max.x-a->min.x) * (a->max.y-a->min.y);
+ double area_b = (b->max.x-b->min.x) * (b->max.y-b->min.y);
+
+ if (area_a < area_b)
+ return 1;
+ else if (area_a > area_b)
+ return -1;
+ else
+ return 0;
+}
+
+/* Sort the rectangle list to be largest area first. For ease of humans
+ * reading debug output. */
+static void boxer_sort(boxer_t *boxer)
+{
+ qsort(boxer->list->list, boxer->list->len, sizeof(rect_t), compare_areas);
+}
+
+/* Get the rectangle list for a given boxer. Return value is the length of
+ * the list. Lifespan is until the boxer is modified or freed. */
+static int boxer_results(boxer_t *boxer, rect_t **list)
+{
+ *list = boxer->list->list;
+ return boxer->list->len;
+}
+
+/* Destroy a boxer. */
+static void boxer_destroy(boxer_t *boxer)
+{
+ if (!boxer)
+ return;
+
+ extract_free(boxer->alloc, &boxer->list);
+ extract_free(boxer->alloc, &boxer);
+}
+
+/* Find the margins for a given boxer. */
+static rect_t boxer_margins(boxer_t *boxer)
+{
+ rectlist_t *list = boxer->list;
+ int i;
+ rect_t margins = boxer->mediabox;
+
+ for (i = 0; i < list->len; i++)
+ {
+ rect_t *r = &list->list[i];
+ if (r->min.x <= margins.min.x && r->min.y <= margins.min.y && r->max.y >= margins.max.y) {
+ margins.min.x = r->max.x; /* Left Margin */
+ } else if (r->max.x >= margins.max.x && r->min.y <= margins.min.y && r->max.y >= margins.max.y) {
+ margins.max.x = r->min.x; /* Right Margin */
+ } else if (r->min.x <= margins.min.x && r->max.x >= margins.max.x && r->min.y <= margins.min.y) {
+ margins.min.y = r->max.y; /* Top Margin */
+ } else if (r->min.x <= margins.min.x && r->max.x >= margins.max.x && r->max.y >= margins.max.y) {
+ margins.max.y = r->min.y; /* Bottom Margin */
+ }
+ }
+
+ return margins;
+}
+
+/* Create a new boxer from a subset of an old one. */
+static boxer_t *boxer_subset(boxer_t *boxer, rect_t rect)
+{
+ boxer_t *new_boxer = boxer_create_length(boxer->alloc, &rect, boxer->list->len);
+ int i;
+
+ if (new_boxer == NULL)
+ return NULL;
+
+ for (i = 0; i < boxer->list->len; i++) {
+ rect_t r = extract_rect_intersect(boxer->list->list[i], rect);
+
+ if (!extract_rect_valid(r))
+ continue;
+ rectlist_append(new_boxer->list, &r);
+ }
+
+ return new_boxer;
+}
+
+/* Consider a boxer for subdivision.
+ * Returns 0 if no suitable subdivision point found.
+ * Returns 1, and sets *boxer1 and *boxer2 to new boxer structures for the the subdivisions
+ * if a subdivision point is found.*/
+static split_type_t
+boxer_subdivide(boxer_t *boxer, boxer_t **boxer1, boxer_t **boxer2)
+{
+ rectlist_t *list = boxer->list;
+ int num_h = 0, num_v = 0;
+ double max_h = 0, max_v = 0;
+ rect_t best_h = {0}, best_v = {0};
+ int i;
+
+ *boxer1 = NULL;
+ *boxer2 = NULL;
+
+ for (i = 0; i < list->len; i++) {
+ rect_t r = boxer->list->list[i];
+
+ if (r.min.x <= boxer->mediabox.min.x && r.max.x >= boxer->mediabox.max.x) {
+ /* Horizontal divider */
+ double size = r.max.y - r.min.y;
+ if (size > max_h) {
+ max_h = size;
+ best_h = r;
+ }
+ num_h++;
+ }
+ if (r.min.y <= boxer->mediabox.min.y && r.max.y >= boxer->mediabox.max.y) {
+ /* Vertical divider */
+ double size = r.max.x - r.min.x;
+ if (size > max_v) {
+ max_v = size;
+ best_v = r;
+ }
+ num_v++;
+ }
+ }
+
+ outf("num_h=%d num_v=%d\n", num_h, num_v);
+ outf("max_h=%g max_v=%g\n", max_h, max_v);
+
+ if (max_h > max_v) {
+ rect_t r;
+ /* Divider runs horizontally. */
+ r = boxer->mediabox;
+ r.max.y = best_h.min.y;
+ *boxer1 = boxer_subset(boxer, r);
+ r = boxer->mediabox;
+ r.min.y = best_h.max.y;
+ *boxer2 = boxer_subset(boxer, r);
+ return SPLIT_VERTICAL;
+ } else if (max_v > 0) {
+ rect_t r;
+ /* Divider runs vertically. */
+ r = boxer->mediabox;
+ r.max.x = best_v.min.x;
+ *boxer1 = boxer_subset(boxer, r);
+ r = boxer->mediabox;
+ r.min.x = best_v.max.x;
+ *boxer2 = boxer_subset(boxer, r);
+ return SPLIT_HORIZONTAL;
+ }
+
+ return SPLIT_NONE;
+}
+
+
+/* Extract specifics */
+static rect_t
+extract_span_bbox(span_t *span)
+{
+ int j;
+ rect_t bbox = extract_rect_empty;
+
+ for (j = 0; j < span->chars_num; j++)
+ {
+ char_t *char_ = &span->chars[j];
+ bbox = extract_rect_union(bbox, char_->bbox);
+ }
+ return bbox;
+}
+
+
+static int
+extract_subpage_subset(extract_alloc_t *alloc, extract_page_t *page, subpage_t *subpage, rect_t mediabox)
+{
+ subpage_t *target;
+ int s;
+
+ if (extract_subpage_alloc(alloc, mediabox, page, &target))
+ {
+ return -1;
+ }
+
+ for (s = 0; s < subpage->spans_num; s++)
+ {
+ rect_t bbox;
+ span_t *span = subpage->spans[s];
+ if (!span)
+ continue;
+
+ bbox = extract_span_bbox(span);
+
+ if (bbox.min.x >= mediabox.min.x && bbox.min.y >= mediabox.min.y && bbox.max.x <= mediabox.max.x && bbox.max.y <= mediabox.max.y) {
+ if (subpage_span_append(alloc, target, span))
+ {
+ return -1;
+ }
+ subpage->spans[s] = NULL;
+ }
+ }
+
+ return 0;
+}
+
+enum {
+ MAX_ANALYSIS_DEPTH = 6
+};
+
+static int
+analyse_sub(extract_page_t *page, subpage_t *subpage, boxer_t *big_boxer, split_t **psplit, int depth)
+{
+ rect_t margins;
+ boxer_t *boxer;
+ boxer_t *boxer1;
+ boxer_t *boxer2;
+ int ret;
+ split_type_t split_type;
+ split_t *split;
+
+ margins = boxer_margins(big_boxer);
+#ifdef DEBUG_WRITE_AS_PS
+ printf("\n\n%% MARGINS %g %g %g %g\n", margins.min.x, margins.min.y, margins.max.x, margins.max.y);
+#endif
+
+ boxer = boxer_subset(big_boxer, margins);
+
+ if (depth < MAX_ANALYSIS_DEPTH &&
+ (split_type = boxer_subdivide(boxer, &boxer1, &boxer2)) != SPLIT_NONE) {
+ if (boxer1 == NULL || boxer2 == NULL ||
+ extract_split_alloc(boxer->alloc, split_type, 2, psplit))
+ {
+ ret = -1;
+ goto fail_mid_split;
+ }
+ split = *psplit;
+ outf("depth=%d %s\n", depth, split_type == SPLIT_HORIZONTAL ? "H" : "V");
+ ret = analyse_sub(page, subpage, boxer1, &split->split[0], depth+1);
+ if (!ret) ret = analyse_sub(page, subpage, boxer2, &split->split[1], depth+1);
+ if (!ret)
+ {
+ if (split_type == SPLIT_HORIZONTAL)
+ {
+ split->split[0]->weight = boxer1->mediabox.max.x - boxer1->mediabox.min.x;
+ split->split[1]->weight = boxer2->mediabox.max.x - boxer2->mediabox.min.x;
+ }
+ else
+ {
+ split->split[0]->weight = boxer1->mediabox.max.y - boxer1->mediabox.min.y;
+ split->split[1]->weight = boxer2->mediabox.max.y - boxer2->mediabox.min.y;
+ }
+ }
+fail_mid_split:
+ boxer_destroy(boxer1);
+ boxer_destroy(boxer2);
+ boxer_destroy(boxer);
+ return ret;
+ }
+
+ outf("depth=%d LEAF\n", depth);
+
+ if (extract_split_alloc(boxer->alloc, SPLIT_NONE, 0, psplit))
+ {
+ boxer_destroy(boxer);
+ return -1;
+ }
+ split = *psplit;
+
+ ret = extract_subpage_subset(boxer->alloc, page, subpage, boxer->mediabox);
+
+#ifdef DEBUG_WRITE_AS_PS
+ {
+ int i, n;
+ rect_t *list;
+ boxer_sort(boxer);
+ n = boxer_results(boxer, &list);
+
+ printf("%% SUBDIVISION\n");
+ for (i = 0; i < n; i++) {
+ printf("%% %g %g %g %g\n",
+ list[i].min.x, list[i].min.y, list[i].max.x, list[i].max.y);
+ }
+
+ printf("0 0 0 setrgbcolor\n");
+ for (i = 0; i < n; i++) {
+ printf("%g %g moveto\n%g %g lineto\n%g %g lineto\n%g %g lineto\nclosepath\nstroke\n\n",
+ list[i].min.x, list[i].min.y,
+ list[i].min.x, list[i].max.y,
+ list[i].max.x, list[i].max.y,
+ list[i].max.x, list[i].min.y);
+ }
+
+ printf("1 0 0 setrgbcolor\n");
+ printf("%g %g moveto\n%g %g lineto\n%g %g lineto\n%g %g lineto\nclosepath\nstroke\n\n",
+ margins.min.x, margins.min.y,
+ margins.min.x, margins.max.y,
+ margins.max.x, margins.max.y,
+ margins.max.x, margins.min.y);
+ }
+#endif
+ boxer_destroy(boxer);
+
+ return ret;
+}
+
+
+static int
+collate_splits(extract_alloc_t *alloc, split_t **psplit)
+{
+ split_t *split = *psplit;
+ int s;
+ int n = 0;
+ int i;
+ int j;
+ split_t *newsplit;
+
+ /* Recurse into all our children to ensure they are collated.
+ * Count how many children we'll have once we pull all the
+ * children of children that match our type up into us. */
+ for (s = 0; s < split->count; s++)
+ {
+ if (collate_splits(alloc, &split->split[s]))
+ {
+ return -1;
+ }
+ if (split->split[s]->type == split->type)
+ {
+ n += split->split[s]->count;
+ }
+ else
+ {
+ n++;
+ }
+ }
+
+ /* No change in the number of children? Just exit. */
+ if (n == split->count)
+ return 0;
+
+ if (extract_split_alloc(alloc, split->type, n, &newsplit))
+ {
+ return -1;
+ }
+
+ newsplit->weight = split->weight;
+
+ /* Now, run across our children. */
+ i = 0;
+ for (s = 0; s < split->count; s++)
+ {
+ split_t *sub = split->split[s];
+ if (sub->type == split->type)
+ {
+ /* If the type matches, pull the grandchildren into newsplit. */
+ for (j = 0; j < sub->count; j++)
+ {
+ newsplit->split[i++] = sub->split[j];
+ sub->split[j] = NULL;
+ }
+ }
+ else
+ {
+ /* Otherwise just move the child into newsplit. */
+ newsplit->split[i++] = sub;
+ split->split[s] = NULL;
+ }
+ }
+
+ extract_split_free(alloc, psplit);
+ *psplit = newsplit;
+
+ return 0;
+}
+
+int extract_page_analyse(extract_alloc_t *alloc, extract_page_t *page)
+{
+ boxer_t *boxer;
+ int i;
+ subpage_t *subpage = page->subpages[0];
+
+ /* This code will only work if the page contains a single subpage.
+ * This should always be the case if we're called from a page
+ * generated via extract_page_begin. */
+ if (page->subpages_num != 1) return 0;
+
+ /* Take the old subpages out from the page. */
+ page->subpages_num = 0;
+ extract_free(alloc, &page->subpages);
+
+#ifdef DEBUG_WRITE_AS_PS
+ printf("1 -1 scale 0 -%g translate\n", page->mediabox.max.y-page->mediabox.min.y);
+#endif
+
+ boxer = boxer_create(alloc, (rect_t *)&subpage->mediabox);
+
+ for (i = 0; i < subpage->spans_num; i++)
+ {
+ span_t *span = subpage->spans[i];
+ rect_t bbox = extract_span_bbox(span);
+ if (boxer_feed(boxer, &bbox))
+ {
+ goto fail;
+ }
+ }
+
+ if (analyse_sub(page, subpage, boxer, &page->split, 0))
+ {
+ goto fail;
+ }
+
+ if (collate_splits(boxer->alloc, &page->split))
+ {
+ goto fail;
+ }
+
+#ifdef DEBUG_WRITE_AS_PS
+ printf("showpage\n");
+#endif
+
+ boxer_destroy(boxer);
+ extract_subpage_free(alloc, &subpage);
+
+ return 0;
+
+fail:
+ outf("Analysis failed!\n");
+ boxer_destroy(boxer);
+ extract_subpage_free(alloc, &subpage);
+
+ return -1;
+}
diff --git a/extract/src/buffer-test.c b/extract/src/buffer-test.c
index a8464c2a..19d693aa 100644
--- a/extract/src/buffer-test.c
+++ b/extract/src/buffer-test.c
@@ -104,7 +104,7 @@ static void test_read(void)
int e;
extract_buffer_t* buffer;
s_create_read_buffer(NULL /*alloc*/, len, &r, &buffer);
-
+
/* Repeatedly read from read-buffer until we get EOF, and check we read the
original content. */
if (extract_malloc(r.alloc, &out_buffer, len)) abort();
@@ -127,7 +127,7 @@ static void test_read(void)
out_buffer = NULL;
e = extract_buffer_close(&buffer);
assert(!e);
-
+
outf("Read test passed.\n");
}
@@ -202,9 +202,9 @@ static void test_write(void)
size_t out_pos = 0;
int its;
int e;
-
+
s_create_write_buffer(NULL /*alloc*/, len, &r, &buffer);
-
+
/* Write to read-buffer, and check it contains the original content. */
if (extract_malloc(r.alloc, &out_buffer, len)) abort();
for (i=0; i<len; ++i) {
@@ -234,7 +234,7 @@ static void test_file(void)
/* Check we can write 3 bytes to file. */
extract_buffer_t* file_buffer;
if (extract_buffer_open_file(NULL /*alloc*/, "test/generated/buffer-file", 1 /*writable*/, &file_buffer)) abort();
-
+
{
size_t n;
int e;
@@ -247,11 +247,11 @@ static void test_file(void)
}
}
if (extract_buffer_close(&file_buffer)) abort();
-
+
/* Check we get back expected short reads and EOF when reading from 3-byte
file created above. */
if (extract_buffer_open_file(NULL /*alloc*/, "test/generated/buffer-file", 0 /*writable*/, &file_buffer)) abort();
-
+
{
size_t n;
char buffer[10];
@@ -277,7 +277,7 @@ static void test_file(void)
}
}
if (extract_buffer_close(&file_buffer)) abort();
-
+
/* Check writing to read-only file buffer fails. */
{
int e;
@@ -286,13 +286,13 @@ static void test_file(void)
if (extract_buffer_open_file(NULL /*alloc*/, "test/generated/buffer-file", 0 /*writable*/, &file_buffer)) {
abort();
}
-
+
e = extract_buffer_write(file_buffer, text, sizeof(text)-1, &actual);
outf("extract_buffer_write() on read buffer returned e=%i actual=%zi", e, actual);
if (e != -1 || errno != EINVAL) abort();
if (extract_buffer_close(&file_buffer)) abort();
}
-
+
outf("file buffer tests passed.\n");
}
diff --git a/extract/src/buffer.c b/extract/src/buffer.c
index b25dee73..0cc6f749 100644
--- a/extract/src/buffer.c
+++ b/extract/src/buffer.c
@@ -33,7 +33,7 @@ extract_alloc_t* extract_buffer_alloc(extract_buffer_t* buffer)
int extract_buffer_open(
- extract_alloc_t* alloc,
+ extract_alloc_t* alloc,
void* handle,
extract_buffer_fn_read fn_read,
extract_buffer_fn_write fn_write,
@@ -45,7 +45,7 @@ int extract_buffer_open(
int e = -1;
extract_buffer_t* buffer;
if (extract_malloc(alloc, &buffer, sizeof(*buffer))) goto end;
-
+
buffer->alloc = alloc;
buffer->handle = handle;
buffer->fn_read = fn_read;
@@ -57,7 +57,7 @@ int extract_buffer_open(
buffer->cache.pos = 0;
buffer->pos = 0;
e = 0;
-
+
end:
if (e) {
extract_free(alloc, &buffer);
@@ -119,7 +119,7 @@ then fn_write returned EOF. */
buffer->cache.pos = 0;
e = 0;
end:
-
+
*o_actual = p;
return e;
}
@@ -128,11 +128,11 @@ int extract_buffer_close(extract_buffer_t** p_buffer)
{
extract_buffer_t* buffer = *p_buffer;
int e = -1;
-
+
if (!buffer) {
return 0;
}
-
+
if (buffer->cache.cache && buffer->fn_write) {
/* Flush cache. */
size_t cache_bytes = buffer->cache.pos;
@@ -171,7 +171,7 @@ int extract_buffer_open_simple(
{
extract_buffer_t* buffer;
if (extract_malloc(alloc, &buffer, sizeof(*buffer))) return -1;
-
+
/* We need cast away the const here. data[] will be written-to if caller
uses us as a write buffer. */
buffer->alloc = alloc;
@@ -233,7 +233,7 @@ int extract_buffer_open_file(extract_alloc_t* alloc, const char* path, int writa
outf("failed to open '%s': %s", path, strerror(errno));
goto end;
}
-
+
if (extract_buffer_open(
alloc,
file /*handle*/,
@@ -244,7 +244,7 @@ int extract_buffer_open_file(extract_alloc_t* alloc, const char* path, int writa
o_buffer
)) goto end;
e = 0;
-
+
end:
if (e) {
if (file) fclose(file);
@@ -266,7 +266,7 @@ int extract_buffer_read_internal(
{
int e = -1;
size_t pos = 0; /* Number of bytes read so far. */
-
+
/* In each iteration we either read from cache, or use buffer->fn_read()
directly or repopulate the cache. */
for(;;) {
@@ -315,7 +315,7 @@ int extract_buffer_read_internal(
}
}
e = 0;
-
+
end:
if (o_actual) *o_actual = pos;
if (e == 0 && pos != numbytes) return +1; /* EOF. */
@@ -332,12 +332,12 @@ int extract_buffer_write_internal(
{
int e = -1;
size_t pos = 0; /* Number of bytes written so far. */
-
+
if (!buffer->fn_write) {
errno = EINVAL;
return -1;
}
-
+
/* In each iteration we either write to cache, or use buffer->fn_write()
directly or flush the cache. */
for(;;) {
@@ -381,7 +381,7 @@ int extract_buffer_write_internal(
}
if (ee) goto end;
}
-
+
if (!buffer->fn_cache) {
use_write = 1;
}
@@ -412,7 +412,7 @@ int extract_buffer_write_internal(
}
}
e = 0;
-
+
end:
if (o_actual) *o_actual = pos;
if (e == 0 && pos != numbytes) e = +1; /* EOF. */
diff --git a/extract/src/document.c b/extract/src/document.c
index d501f259..1999c009 100644
--- a/extract/src/document.c
+++ b/extract/src/document.c
@@ -66,11 +66,11 @@ void extract_cell_free(extract_alloc_t* alloc, cell_t** pcell)
int p;
cell_t* cell = *pcell;
if (!cell) return;
-
+
outf("cell->lines_num=%i", cell->lines_num);
outf("cell->paragraphs_num=%i", cell->paragraphs_num);
extract_lines_free(alloc, &cell->lines, cell->lines_num);
-
+
outf("cell=%p cell->paragraphs_num=%i", cell, cell->paragraphs_num);
for (p=0; p<cell->paragraphs_num; ++p)
{
@@ -85,4 +85,34 @@ void extract_cell_free(extract_alloc_t* alloc, cell_t** pcell)
extract_free(alloc, pcell);
}
+int
+extract_split_alloc(extract_alloc_t* alloc, split_type_t type, int count, split_t** psplit)
+{
+ split_t *split;
+
+ if (extract_malloc(alloc, psplit, sizeof(*split) + (count-1) * sizeof(split_t *)))
+ {
+ return -1;
+ }
+
+ split = *psplit;
+ split->type = type;
+ split->weight = 0;
+ split->count = count;
+ memset(&split->split[0], 0, sizeof(split_t *) * count);
+ return 0;
+}
+
+void extract_split_free(extract_alloc_t *alloc, split_t **psplit)
+{
+ int i;
+ split_t *split = *psplit;
+
+ if (!split)
+ return;
+
+ for (i = 0; i < split->count; i++)
+ extract_split_free(alloc, &split->split[i]);
+ extract_free(alloc, psplit);
+}
diff --git a/extract/src/document.h b/extract/src/document.h
index 2dc4f1ee..69c4232c 100644
--- a/extract/src/document.h
+++ b/extract/src/document.h
@@ -26,6 +26,17 @@ typedef struct
point_t max;
} rect_t;
+extern const rect_t extract_rect_infinite;
+extern const rect_t extract_rect_empty;
+
+rect_t extract_rect_intersect(rect_t a, rect_t b);
+
+rect_t extract_rect_union(rect_t a, rect_t b);
+
+int extract_rect_contains_rect(rect_t a, rect_t b);
+
+int extract_rect_valid(rect_t a);
+
const char* extract_rect_string(const rect_t* rect);
typedef struct
@@ -56,13 +67,15 @@ typedef struct
/* (x,y) before transformation by ctm and trm. */
double pre_x;
double pre_y;
-
+
/* (x,y) after transformation by ctm and trm. */
double x;
double y;
-
+
unsigned ucs;
double adv;
+
+ rect_t bbox;
} char_t;
/* A single char in a span.
*/
@@ -72,15 +85,15 @@ typedef struct
matrix_t ctm;
matrix_t trm;
char* font_name;
-
+
/* font size is extract_matrix_cmp4(trm). */
-
+
struct {
unsigned font_bold : 1;
unsigned font_italic : 1;
unsigned wmode : 1;
} flags;
-
+
char_t* chars;
int chars_num;
} span_t;
@@ -138,10 +151,10 @@ typedef struct
double h;
void* data;
size_t data_size;
-
+
extract_image_data_free data_free;
void* data_free_handle;
-
+
} image_t;
/* Information about an image. <type> is as passed to extract_add_image();
<name> and <id> are created to be unique identifiers for use in generated docx
@@ -166,18 +179,18 @@ typedef struct
typedef struct
{
rect_t rect;
-
+
/* If left/above is true, this cell is not obscured by cell to its
left/above. */
uint8_t left;
uint8_t above;
-
+
/* extend_right and extend_down are 1 for normal cells, 2 for cells which
extend right/down to cover an additional column/row, 3 to cover two
additional columns/rows etc. */
int extend_right;
int extend_down;
-
+
/* Contents of this cell. */
line_t** lines;
int lines_num;
@@ -192,7 +205,7 @@ void extract_cell_free(extract_alloc_t* alloc, cell_t** pcell);
typedef struct
{
point_t pos; /* top-left. */
-
+
/* Array of cells_num_x*cells_num_y cells; cell (x, y) is:
cells_num_x * y + x.
*/
@@ -202,11 +215,30 @@ typedef struct
} table_t;
+typedef enum
+{
+ SPLIT_NONE = 0,
+ SPLIT_HORIZONTAL,
+ SPLIT_VERTICAL
+} split_type_t;
+
+
+typedef struct split_t
+{
+ split_type_t type;
+ double weight;
+ int count;
+ struct split_t *split[1];
+} split_t;
+
+
typedef struct
{
+ rect_t mediabox;
+
span_t** spans;
int spans_num;
-
+
image_t* images;
int images_num;
@@ -219,16 +251,27 @@ typedef struct
int paragraphs_num;
/* These refer to items in .lines. Initially empty, then set
by extract_join(). */
-
+
tablelines_t tablelines_horizontal;
tablelines_t tablelines_vertical;
-
+
table_t** tables;
int tables_num;
+} subpage_t;
+/* A subpage. Contains different representations of the list of spans. */
+
+typedef struct
+{
+ rect_t mediabox;
+
+ subpage_t** subpages;
+ int subpages_num;
+
+ split_t* split;
} extract_page_t;
-/* A page. Contains different representations of the list of spans. NB not
-+called page_t because this clashes with a system type on hpux. */
+/* A page. Contains a list of subpages. NB not
+called page_t because this clashes with a system type on hpux. */
typedef struct
@@ -248,7 +291,7 @@ typedef struct
} images_t;
-int extract_document_join(extract_alloc_t* alloc, document_t* document);
+int extract_document_join(extract_alloc_t* alloc, document_t* document, int layout_analysis);
/* This does all the work of finding paragraphs and tables. */
double extract_matrices_to_font_size(matrix_t* ctm, matrix_t* trm);
@@ -273,5 +316,21 @@ typedef struct
content, e.g. so we know whether a font has changed so need to start a new odt
span. */
+int extract_page_analyse(extract_alloc_t* alloc, extract_page_t* page);
+/* Analyse page content for layouts. */
+
+int extract_subpage_alloc(extract_alloc_t* extract, rect_t mediabox, extract_page_t* page, subpage_t** psubpage);
+/* content_t constructor. */
+
+void extract_subpage_free(extract_alloc_t* alloc, subpage_t** psubpage);
+/* subpage_t destructor. */
+
+int subpage_span_append(extract_alloc_t* alloc, subpage_t* subpage, span_t* span);
+/* Push span onto the end of subpage. */
+
+int extract_split_alloc(extract_alloc_t* alloc, split_type_t type, int count, split_t** psplit);
+/* Allocate a split_t. */
+
+void extract_split_free(extract_alloc_t* alloc, split_t** psplit);
#endif
diff --git a/extract/src/docx.c b/extract/src/docx.c
index 761de176..ca6c5d78 100644
--- a/extract/src/docx.c
+++ b/extract/src/docx.c
@@ -95,7 +95,7 @@ static int s_docx_paragraph_empty(extract_alloc_t* alloc, extract_astring_t* con
content_state.font.size = 10;
content_state.font.bold = 0;
content_state.font.italic = 0;
-
+
if (s_docx_run_start(alloc, content, &content_state)) goto end;
//docx_char_append_string(content, "&#160;"); /* &#160; is non-break space. */
if (s_docx_run_finish(alloc, NULL /*state*/, content)) goto end;
@@ -168,9 +168,9 @@ font. */
if (s_docx_run_finish(alloc, content_state, content)) goto end;
}
if (s_docx_paragraph_finish(alloc, content)) goto end;
-
+
e = 0;
-
+
end:
return e;
}
@@ -245,7 +245,7 @@ static int s_docx_append_image(
static int s_docx_output_rotated_paragraphs(
extract_alloc_t* alloc,
- extract_page_t* page,
+ subpage_t* subpage,
int paragraph_begin,
int paragraph_end,
int rot,
@@ -330,7 +330,7 @@ static int s_docx_output_rotated_paragraphs(
/* Output paragraphs p0..p2-1. */
for (p=paragraph_begin; p<paragraph_end; ++p) {
- paragraph_t* paragraph = page->paragraphs[p];
+ paragraph_t* paragraph = subpage->paragraphs[p];
if (s_document_to_docx_content_paragraph(alloc, state, paragraph, content)) goto end;
}
@@ -364,7 +364,7 @@ static int s_docx_output_rotated_paragraphs(
extract_astring_cat(alloc, content, " <w:txbxContent>");
for (p=paragraph_begin; p<paragraph_end; ++p) {
- paragraph_t* paragraph = page->paragraphs[p];
+ paragraph_t* paragraph = subpage->paragraphs[p];
if (s_document_to_docx_content_paragraph(alloc, state, paragraph, content)) goto end;
}
@@ -392,7 +392,7 @@ to the application. */
{
int e = -1;
int y;
-
+
if (extract_astring_cat(alloc, content,
"\n"
" <w:tbl>\n"
@@ -406,14 +406,14 @@ to the application. */
" <w:tr>\n"
" <w:trPr/>\n"
)) goto end;
-
+
for (x=0; x<table->cells_num_x; ++x)
{
cell_t* cell = table->cells[y*table->cells_num_x + x];
if (!cell->left) continue;
-
+
if (extract_astring_cat(alloc, content, " <w:tc>\n")) goto end;
-
+
/* Write cell properties. */
{
if (extract_astring_cat(alloc, content,
@@ -442,7 +442,7 @@ to the application. */
}
if (extract_astring_cat(alloc, content, " </w:tcPr>\n")) goto end;
}
-
+
/* Write contents of this cell. */
{
size_t chars_num_old = content->chars_num;
@@ -476,20 +476,20 @@ to the application. */
}
if (extract_astring_cat(alloc, content, " </w:tbl>\n")) goto end;
e = 0;
-
+
end:
return e;
}
static int s_docx_append_rotated_paragraphs(
extract_alloc_t* alloc,
- extract_page_t* page,
+ subpage_t* subpage,
content_state_t* state,
int* p,
int* text_box_id,
const matrix_t* ctm,
double rotate,
- extract_astring_t* content
+ extract_astring_t* output
)
/* Appends paragraphs with same rotation, starting with page->paragraphs[*p]
and updates *p. */
@@ -501,8 +501,8 @@ and updates *p. */
point_t extent = {0, 0};
int p0 = *p;
int p1;
- paragraph_t* paragraph = page->paragraphs[*p];
-
+ paragraph_t* paragraph = subpage->paragraphs[*p];
+
outf("rotate=%.2frad=%.1fdeg ctm: ef=(%f %f) abcd=(%f %f %f %f)",
rotate, rotate * 180 / pi,
ctm->e,
@@ -535,8 +535,8 @@ and updates *p. */
ctm->a, ctm->b, ctm->c, ctm->d);
}
- for (*p=p0; *p<page->paragraphs_num; ++(*p)) {
- paragraph = page->paragraphs[*p];
+ for (*p=p0; *p<subpage->paragraphs_num; ++(*p)) {
+ paragraph = subpage->paragraphs[*p];
ctm = &paragraph->lines[0]->spans[0]->ctm;
rotate = atan2(ctm->b, ctm->a);
if (rotate != rotate0) {
@@ -625,13 +625,13 @@ and updates *p. */
x -= dx;
y -= -dy;
- if (s_docx_output_rotated_paragraphs(alloc, page, p0, p1, rot, x, y, w, h, *text_box_id, content, state)) goto end;
+ if (s_docx_output_rotated_paragraphs(alloc, subpage, p0, p1, rot, x, y, w, h, *text_box_id, output, state)) goto end;
}
*p = p1 - 1;
e = 0;
-
+
end:
-
+
return e;
}
@@ -647,38 +647,40 @@ int extract_document_to_docx_content(
int ret = -1;
int text_box_id = 0;
int p;
-
+
/* Write paragraphs into <content>. */
for (p=0; p<document->pages_num; ++p) {
extract_page_t* page = document->pages[p];
-
- int p = 0;
- int t = 0;
-
- content_state_t content_state;
- content_state.font.name = NULL;
- content_state.font.size = 0;
- content_state.font.bold = 0;
- content_state.font.italic = 0;
- content_state.ctm_prev = NULL;
-
- /* Output paragraphs and tables in order of y coordinate. */
- for(;;)
- {
- paragraph_t* paragraph = (p == page->paragraphs_num) ? NULL : page->paragraphs[p];
- table_t* table = (t == page->tables_num) ? NULL : page->tables[t];
- double y_paragraph;
- double y_table;
- if (!paragraph && !table) break;
- y_paragraph = (paragraph) ? paragraph->lines[0]->spans[0]->chars[0].y : DBL_MAX;
- y_table = (table) ? table->pos.y : DBL_MAX;
-
- if (paragraph && y_paragraph < y_table)
- {
- const matrix_t* ctm = &paragraph->lines[0]->spans[0]->ctm;
- double rotate = atan2(ctm->b, ctm->a);
-
- if (spacing
+ int c;
+
+ for (c=0; c<page->subpages_num; ++c) {
+ subpage_t* subpage = page->subpages[c];
+
+ int p = 0;
+ int t = 0;
+
+ content_state_t content_state;
+ content_state.font.name = NULL;
+ content_state.font.size = 0;
+ content_state.font.bold = 0;
+ content_state.font.italic = 0;
+ content_state.ctm_prev = NULL;
+
+ /* Output paragraphs and tables in order of y coordinate. */
+ for(;;) {
+ paragraph_t* paragraph = (p == subpage->paragraphs_num) ? NULL : subpage->paragraphs[p];
+ table_t* table = (t == subpage->tables_num) ? NULL : subpage->tables[t];
+ double y_paragraph;
+ double y_table;
+ if (!paragraph && !table) break;
+ y_paragraph = (paragraph) ? paragraph->lines[0]->spans[0]->chars[0].y : DBL_MAX;
+ y_table = (table) ? table->pos.y : DBL_MAX;
+
+ if (paragraph && y_paragraph < y_table) {
+ const matrix_t* ctm = &paragraph->lines[0]->spans[0]->ctm;
+ double rotate = atan2(ctm->b, ctm->a);
+
+ if (spacing
&& content_state.ctm_prev
&& paragraph->lines_num
&& paragraph->lines[0]->spans_num
@@ -687,37 +689,38 @@ int extract_document_to_docx_content(
&paragraph->lines[0]->spans[0]->ctm
)
) {
- /* Extra vertical space between paragraphs that were at
- different angles in the original document. */
- if (s_docx_paragraph_empty(alloc, content)) goto end;
- }
+ /* Extra vertical space between paragraphs that were at
+ different angles in the original document. */
+ if (s_docx_paragraph_empty(alloc, content)) goto end;
+ }
- if (spacing) {
- /* Extra vertical space between paragraphs. */
- if (s_docx_paragraph_empty(alloc, content)) goto end;
- }
+ if (spacing) {
+ /* Extra vertical space between paragraphs. */
+ if (s_docx_paragraph_empty(alloc, content)) goto end;
+ }
- if (rotation && rotate != 0)
- {
- if (s_docx_append_rotated_paragraphs(alloc, page, &content_state, &p, &text_box_id, ctm, rotate, content)) goto end;
+ if (rotation && rotate != 0)
+ {
+ if (s_docx_append_rotated_paragraphs(alloc, subpage, &content_state, &p, &text_box_id, ctm, rotate, content)) goto end;
+ }
+ else
+ {
+ if (s_document_to_docx_content_paragraph(alloc, &content_state, paragraph, content)) goto end;
+ }
+ p += 1;
}
- else
+ else if (table)
{
- if (s_document_to_docx_content_paragraph(alloc, &content_state, paragraph, content)) goto end;
+ if (s_docx_append_table(alloc, table, content)) goto end;
+ t += 1;
}
- p += 1;
- }
- else if (table)
- {
- if (s_docx_append_table(alloc, table, content)) goto end;
- t += 1;
}
- }
-
- if (images) {
- int i;
- for (i=0; i<page->images_num; ++i) {
- s_docx_append_image(alloc, content, &page->images[i]);
+
+ if (images) {
+ int i;
+ for (i=0; i<subpage->images_num; ++i) {
+ s_docx_append_image(alloc, content, &subpage->images[i]);
+ }
}
}
}
@@ -759,7 +762,7 @@ int extract_docx_content_item(
extract_astring_t temp;
extract_astring_init(&temp);
*text2 = NULL;
-
+
if (0)
{}
else if (!strcmp(name, "[Content_Types].xml")) {
@@ -841,7 +844,7 @@ int extract_docx_content_item(
return e;
}
-
+
int extract_docx_write_template(
extract_alloc_t* alloc,
@@ -862,7 +865,7 @@ int extract_docx_write_template(
assert(path_out);
assert(path_template);
-
+
if (extract_check_path_shell_safe(path_out)) {
outf("path_out is unsafe: %s", path_out);
goto end;
@@ -889,7 +892,7 @@ int extract_docx_write_template(
/* Might be nice to iterate through all items in path_tempdir, but for now
we look at just the items that we know extract_docx_content_item() will
modify. */
-
+
{
const char* names[] = {
"word/document.xml",
@@ -904,7 +907,7 @@ int extract_docx_write_template(
extract_free(alloc, &text2);
if (extract_asprintf(alloc, &path, "%s/%s", path_tempdir, name) < 0) goto end;
if (extract_read_all_path(alloc, path, &text)) goto end;
-
+
if (extract_docx_content_item(
alloc,
contentss,
@@ -926,14 +929,14 @@ int extract_docx_write_template(
extract_free(alloc, &path);
if (extract_asprintf(alloc, &path, "%s/word/media", path_tempdir) < 0) goto end;
if (extract_mkdir(path, 0777)) goto end;
-
+
for (i=0; i<images->images_num; ++i) {
image_t* image = &images->images[i];
extract_free(alloc, &path);
if (extract_asprintf(alloc, &path, "%s/word/media/%s", path_tempdir, image->name) < 0) goto end;
if (extract_write_all(image->data, image->data_size, path)) goto end;
}
-
+
outf("Zipping tempdir to create %s", path_out);
{
const char* path_out_leaf = strrchr(path_out, '/');
diff --git a/extract/src/docx.h b/extract/src/docx.h
index 976272a6..ffce019c 100644
--- a/extract/src/docx.h
+++ b/extract/src/docx.h
@@ -22,7 +22,7 @@ word/document.xml. */
int extract_docx_write_template(
- extract_alloc_t* alloc,
+ extract_alloc_t* alloc,
extract_astring_t* contentss,
int contentss_num,
images_t* images,
@@ -34,7 +34,7 @@ int extract_docx_write_template(
Uses the 'zip' and 'unzip' commands internally.
-contents
+contentss
contentss_num
Content to be inserted into word/document.xml.
document
diff --git a/extract/src/docx_template.c b/extract/src/docx_template.c
index 73ab5b71..06a2e8c5 100644
--- a/extract/src/docx_template.c
+++ b/extract/src/docx_template.c
@@ -21,7 +21,7 @@ const docx_template_item_t docx_template_items[] =
"<Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\"/>"
"<Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\"/></Types>"
},
-
+
{
"_rels/.rels",
""
@@ -32,7 +32,7 @@ const docx_template_item_t docx_template_items[] =
"<Relationship Id=\"rId2\" Type=\"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties\" Target=\"docProps/core.xml\"/>"
"<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"word/document.xml\"/></Relationships>"
},
-
+
{
"docProps/app.xml",
""
@@ -56,7 +56,7 @@ const docx_template_item_t docx_template_items[] =
"<HyperlinksChanged>false</HyperlinksChanged>"
"<AppVersion>16.0000</AppVersion></Properties>"
},
-
+
{
"docProps/core.xml",
""
@@ -73,7 +73,7 @@ const docx_template_item_t docx_template_items[] =
"<dcterms:created xsi:type=\"dcterms:W3CDTF\">2020-09-25T17:04:00Z</dcterms:created>"
"<dcterms:modified xsi:type=\"dcterms:W3CDTF\">2020-09-25T17:07:00Z</dcterms:modified></cp:coreProperties>"
},
-
+
{
"word/document.xml",
""
@@ -155,7 +155,7 @@ const docx_template_item_t docx_template_items[] =
"<w:cols w:space=\"708\"/>"
"<w:docGrid w:linePitch=\"360\"/></w:sectPr></w:body></w:document>"
},
-
+
{
"word/fontTable.xml",
""
@@ -181,7 +181,7 @@ const docx_template_item_t docx_template_items[] =
"<w:pitch w:val=\"variable\"/>"
"<w:sig w:usb0=\"E4002EFF\" w:usb1=\"C000247B\" w:usb2=\"00000009\" w:usb3=\"00000000\" w:csb0=\"000001FF\" w:csb1=\"00000000\"/></w:font></w:fonts>"
},
-
+
{
"word/settings.xml",
""
@@ -227,7 +227,7 @@ const docx_template_item_t docx_template_items[] =
"<w15:chartTrackingRefBased/>"
"<w15:docId w15:val=\"{A10F59F7-497D-44D4-A338-47719734E7A0}\"/></w:settings>"
},
-
+
{
"word/styles.xml",
""
@@ -647,7 +647,7 @@ const docx_template_item_t docx_template_items[] =
"<w:semiHidden/>"
"<w:unhideWhenUsed/></w:style></w:styles>"
},
-
+
{
"word/webSettings.xml",
""
@@ -657,7 +657,7 @@ const docx_template_item_t docx_template_items[] =
"<w:optimizeForBrowser/>"
"<w:allowPNG/></w:webSettings>"
},
-
+
{
"word/_rels/document.xml.rels",
""
@@ -670,7 +670,7 @@ const docx_template_item_t docx_template_items[] =
"<Relationship Id=\"rId5\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"theme/theme1.xml\"/>"
"<Relationship Id=\"rId4\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable\" Target=\"fontTable.xml\"/></Relationships>"
},
-
+
{
"word/theme/theme1.xml",
""
@@ -708,10 +708,10 @@ const docx_template_item_t docx_template_items[] =
"<a:latin typeface=\"Calibri Light\" panose=\"020F0302020204030204\"/>"
"<a:ea typeface=\"\"/>"
"<a:cs typeface=\"\"/>"
- "<a:font script=\"Jpan\" typeface=\"游ゴシック Light\"/>"
- "<a:font script=\"Hang\" typeface=\"맑은 고딕\"/>"
- "<a:font script=\"Hans\" typeface=\"等线 Light\"/>"
- "<a:font script=\"Hant\" typeface=\"新細明體\"/>"
+ "<a:font script=\"Jpan\" typeface=\"\xe6\xb8\xb8\xe3\x82\xb4\xe3\x82\xb7\xe3\x83\x83\xe3\x82\xaf Light\"/>"
+ "<a:font script=\"Hang\" typeface=\"\xeb\xa7\x91\xec\x9d\x80 \xea\xb3\xa0\xeb\x94\x95\"/>"
+ "<a:font script=\"Hans\" typeface=\"\xe7\xad\x89\xe7\xba\xbf Light\"/>"
+ "<a:font script=\"Hant\" typeface=\"\xe6\x96\xb0\xe7\xb4\xb0\xe6\x98\x8e\xe9\xab\x94\"/>"
"<a:font script=\"Arab\" typeface=\"Times New Roman\"/>"
"<a:font script=\"Hebr\" typeface=\"Times New Roman\"/>"
"<a:font script=\"Thai\" typeface=\"Angsana New\"/>"
@@ -759,10 +759,10 @@ const docx_template_item_t docx_template_items[] =
"<a:latin typeface=\"Calibri\" panose=\"020F0502020204030204\"/>"
"<a:ea typeface=\"\"/>"
"<a:cs typeface=\"\"/>"
- "<a:font script=\"Jpan\" typeface=\"游明朝\"/>"
- "<a:font script=\"Hang\" typeface=\"맑은 고딕\"/>"
- "<a:font script=\"Hans\" typeface=\"等线\"/>"
- "<a:font script=\"Hant\" typeface=\"新細明體\"/>"
+ "<a:font script=\"Jpan\" typeface=\"\xe6\xb8\xb8\xe6\x98\x8e\xe6\x9c\x9d\"/>"
+ "<a:font script=\"Hang\" typeface=\"\xeb\xa7\x91\xec\x9d\x80 \xea\xb3\xa0\xeb\x94\x95\"/>"
+ "<a:font script=\"Hans\" typeface=\"\xe7\xad\x89\xe7\xba\xbf\"/>"
+ "<a:font script=\"Hant\" typeface=\"\xe6\x96\xb0\xe7\xb4\xb0\xe6\x98\x8e\xe9\xab\x94\"/>"
"<a:font script=\"Arab\" typeface=\"Arial\"/>"
"<a:font script=\"Hebr\" typeface=\"Arial\"/>"
"<a:font script=\"Thai\" typeface=\"Cordia New\"/>"
@@ -904,7 +904,7 @@ const docx_template_item_t docx_template_items[] =
"<a:ext uri=\"{05A4C25C-085E-4340-85A3-A5531E510DB2}\">"
"<thm15:themeFamily xmlns:thm15=\"http://schemas.microsoft.com/office/thememl/2012/main\" name=\"Office Theme\" id=\"{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}\" vid=\"{4A3C46E8-61CC-4603-A589-7422A47A8E4A}\"/></a:ext></a:extLst></a:theme>"
},
-
+
};
int docx_template_items_num = 11;
diff --git a/extract/src/docx_template_build.py b/extract/src/docx_template_build.py
index 8b836300..e04137d5 100755
--- a/extract/src/docx_template_build.py
+++ b/extract/src/docx_template_build.py
@@ -14,13 +14,13 @@ Args:
-i <in-path>
Set template docx/odt file to extract from.
-
+
-n docx | odt
Infix to use in generated identifier names.
-o <out-path>
Set name of output files.
-
+
We write to <out-path>.c and <out-path>.h.
'''
@@ -82,7 +82,7 @@ def check_path_safe(path):
raise Exception(f'Path is unsafe because contains "..": {path!r}')
for c in path:
if not c.isalnum() and c not in '/._-':
- #print(f'unsafe character {c} in: {path}')
+ #print(f'unsafe character {c} in: {path}')
raise Exception(f'Path is unsafe because contains "{c}": {path!r}')
def path_safe(path):
@@ -134,37 +134,37 @@ def main():
path_out = next(args)
else:
assert 0, f'unrecognised arg: {arg}'
-
+
if not path_in:
return
-
+
if not path_in:
raise Exception('Need to specify -i <in-path>')
if not infix:
raise Exception('Need to specify -n <name>')
if not path_out:
raise Exception('Need to specify -o <out-path>')
-
+
check_path_safe(path_in)
check_path_safe(path_out)
path_temp = f'{path_in}.dir'
os.system(f'rm -r "{path_temp}" 2>/dev/null')
system(f'unzip -q -d {path_temp} {path_in}')
-
+
out_c = io.StringIO()
out_c.write(f'/* THIS IS AUTO-GENERATED CODE, DO NOT EDIT. */\n')
out_c.write(f'\n')
out_c.write(f'#include "{os.path.basename(path_out)}.h"\n')
out_c.write(f'\n')
-
-
+
+
out_c.write(f'const {infix}_template_item_t {infix}_template_items[] =\n')
out_c.write(f'{{\n')
-
+
num_items = 0
for dirpath, dirnames, filenames in os.walk(path_temp):
dirnames.sort()
-
+
if 0:
# Write code to create directory item in zip. This isn't recognised by zipinfo, and doesn't
# make Word like the file.
@@ -174,7 +174,7 @@ def main():
if not name.endswith('/'):
name += '/'
out_c3.write(f' if (extract_zip_write_file(zip, NULL, 0, "{infix}")) goto end;\n')
-
+
for filename in sorted(filenames):
num_items += 1
path = os.path.join(dirpath, filename)
@@ -205,7 +205,15 @@ def main():
for tag in 'dc:creator', 'cp:lastModifiedBy':
text = re.sub(f'[<]{tag}[>][^<]*[<]/{tag}[>]', f'<{tag}></{tag}>', text)
- out_c.write(f' "{text}"\n')
+ out_c.write(f' "')
+ # Represent non-ascii utf-8 bytes as C escape sequences.
+ for c in text:
+ if ord( c) <= 127:
+ out_c.write( c)
+ else:
+ for cc in c.encode( 'utf-8'):
+ out_c.write( f'\\x{cc:02x}')
+ out_c.write(f'"\n')
else:
data = read(os.path.join(dirpath, filename), encoding=None)
out_c.write(f' "')
@@ -216,17 +224,17 @@ def main():
out_c.write(f'"\n "')
out_c.write(f'\\x{byte:02x}')
out_c.write(f'"\n')
-
+
out_c.write(f' }},\n')
- out_c.write(f' \n')
-
+ out_c.write(f'\n')
+
out_c.write(f'}};\n')
out_c.write(f'\n')
out_c.write(f'int {infix}_template_items_num = {num_items};\n')
-
+
out_c = out_c.getvalue()
write_if_diff(out_c, f'{path_out}.c', 'utf-8', force)
-
+
out_h = io.StringIO()
out_h.write(f'#ifndef EXTRACT_{infix.upper()}_TEMPLATE_H\n')
out_h.write(f'#define EXTRACT_{infix.upper()}_TEMPLATE_H\n')
@@ -247,6 +255,6 @@ def main():
out_h.write(f'#endif\n')
write_if_diff(out_h.getvalue(), f'{path_out}.h', 'utf-8', force)
#os.system(f'rm -r "{path_temp}"')
-
+
if __name__ == '__main__':
main()
diff --git a/extract/src/extract-exe.c b/extract/src/extract-exe.c
index ee34023a..808d2cd1 100644
--- a/extract/src/extract-exe.c
+++ b/extract/src/extract-exe.c
@@ -1,5 +1,9 @@
/* Command-line programme for extract_ API. */
+#ifdef _WIN32
+#define _CRT_SECURE_NO_WARNINGS
+#endif
+
#include "../include/extract.h"
#include "../include/extract_alloc.h"
@@ -67,13 +71,13 @@ int main(int argc, char** argv)
extract_buffer_t* out_buffer = NULL;
extract_buffer_t* intermediate = NULL;
extract_t* extract = NULL;
-
+
/* Create an allocator so we test the allocation code. */
if (extract_alloc_create(s_realloc, (void*) 123, &alloc))
{
assert(0);
}
-
+
for (i=1; i<argc; ++i) {
const char* arg = argv[i];
if (!strcmp(arg, "-h") || !strcmp(arg, "--help")) {
@@ -185,7 +189,7 @@ int main(int argc, char** argv)
assert(i < argc);
}
-
+
if (format == -1)
{
printf("'-f odt | docx' must be specified\n");
@@ -198,17 +202,17 @@ int main(int argc, char** argv)
errno = EINVAL;
goto end;
}
-
+
if (extract_buffer_open_file(alloc, input_path, 0 /*writable*/, &intermediate)) {
printf("Failed to open intermediate file: %s\n", input_path);
goto end;
}
-
+
if (extract_begin(alloc, format, &extract)) goto end;
if (extract_read_intermediate(extract, intermediate, autosplit)) goto end;
-
+
if (extract_process(extract, spacing, rotation, images)) goto end;
-
+
if (content_path) {
if (extract_buffer_open_file(alloc, content_path, 1 /*writable*/, &out_buffer)) goto end;
if (extract_write_content(extract, out_buffer)) goto end;
@@ -247,9 +251,9 @@ int main(int argc, char** argv)
printf("Failed (errno=%i): %s\n", errno, strerror(errno));
return 1;
}
-
+
extract_internal_end();
-
+
if (alloc_stats) {
extract_alloc_stats_t* stats = extract_alloc_stats(alloc);
printf("Alloc stats: num_malloc=%i num_realloc=%i num_free=%i num_libc_realloc=%i\n",
@@ -259,9 +263,9 @@ int main(int argc, char** argv)
stats->num_libc_realloc
);
}
-
+
extract_alloc_destroy(&alloc);
- assert(alloc == NULL);
+ assert(alloc == NULL);
printf("Finished.\n");
return 0;
diff --git a/extract/src/extract.c b/extract/src/extract.c
index 2c375571..42f888f3 100644
--- a/extract/src/extract.c
+++ b/extract/src/extract.c
@@ -25,6 +25,9 @@
+const rect_t extract_rect_infinite = { { DBL_MIN, DBL_MIN }, { DBL_MAX, DBL_MAX } };
+const rect_t extract_rect_empty = { { DBL_MAX, DBL_MAX }, { DBL_MIN, DBL_MIN } };
+
double extract_matrix_expansion(matrix_t m)
{
@@ -200,74 +203,97 @@ static void table_free(extract_alloc_t* alloc, table_t** ptable)
extract_free(alloc, ptable);
}
-static void page_free(extract_alloc_t* alloc, extract_page_t** ppage)
+void extract_subpage_free(extract_alloc_t* alloc, subpage_t** psubpage)
{
- extract_page_t* page = *ppage;
- if (!page) return;
+ subpage_t* subpage = *psubpage;
+ if (!subpage) return;
- outf0("page=%p page->spans_num=%i page->lines_num=%i",
- page, page->spans_num, page->lines_num);
- extract_spans_free(alloc, &page->spans, page->spans_num);
+ outf0("subpage=%p subpage->spans_num=%i subpage->lines_num=%i",
+ subpage, subpage->spans_num, subpage->lines_num);
+ extract_spans_free(alloc, &subpage->spans, subpage->spans_num);
- extract_lines_free(alloc, &page->lines, page->lines_num);
+ extract_lines_free(alloc, &subpage->lines, subpage->lines_num);
{
int p;
- for (p=0; p<page->paragraphs_num; ++p) {
- paragraph_t* paragraph = page->paragraphs[p];
+ for (p=0; p<subpage->paragraphs_num; ++p) {
+ paragraph_t* paragraph = subpage->paragraphs[p];
/* We don't call extract_lines_free(&paragraph->lines) because
- these point into the same data as page->lines, which we have
+ these point into the same data as subpage->lines, which we have
already freed above. */
if (paragraph) extract_free(alloc, &paragraph->lines);
- extract_free(alloc, &page->paragraphs[p]);
+ extract_free(alloc, &subpage->paragraphs[p]);
}
}
- extract_free(alloc, &page->paragraphs);
-
+ extract_free(alloc, &subpage->paragraphs);
+
{
int i;
- for (i=0; i<page->images_num; ++i) {
- extract_image_clear(alloc, &page->images[i]);
+ for (i=0; i<subpage->images_num; ++i) {
+ extract_image_clear(alloc, &subpage->images[i]);
}
- extract_free(alloc, &page->images);
+ extract_free(alloc, &subpage->images);
}
- extract_free(alloc, &page->images);
+ extract_free(alloc, &subpage->images);
+
+ extract_free(alloc, &subpage->tablelines_horizontal.tablelines);
+ extract_free(alloc, &subpage->tablelines_vertical.tablelines);
- extract_free(alloc, &page->tablelines_horizontal.tablelines);
- extract_free(alloc, &page->tablelines_vertical.tablelines);
-
{
int t;
- outf("page=%p page->tables_num=%i", page, page->tables_num);
- for (t=0; t<page->tables_num; ++t)
+ outf("subpage=%p subpage->tables_num=%i", subpage, subpage->tables_num);
+ for (t=0; t<subpage->tables_num; ++t)
{
- table_free(alloc, &page->tables[t]);
+ table_free(alloc, &subpage->tables[t]);
}
- extract_free(alloc, &page->tables);
+ extract_free(alloc, &subpage->tables);
+ }
+
+ extract_free(alloc, psubpage);
+}
+
+static void page_free(extract_alloc_t* alloc, extract_page_t** ppage)
+{
+ int c;
+ extract_page_t* page = *ppage;
+ if (!page) return;
+
+ for (c=0; c<page->subpages_num; ++c)
+ {
+ subpage_t *subpage = page->subpages[c];
+ extract_subpage_free(alloc, &subpage);
}
-
+ extract_free(alloc, &page->subpages);
extract_free(alloc, ppage);
}
-static span_t* page_span_append(extract_alloc_t* alloc, extract_page_t* page)
-/* Appends new empty span_ to an extract_page_t; returns NULL with errno set on
-error. */
+int subpage_span_append(extract_alloc_t *alloc, subpage_t *subpage, span_t *span)
{
- span_t* span;
- if (extract_malloc(alloc, &span, sizeof(*span))) return NULL;
- extract_span_init(span);
if (extract_realloc2(
alloc,
- &page->spans,
- sizeof(*page->spans) * page->spans_num,
- sizeof(*page->spans) * (page->spans_num + 1)
+ &subpage->spans,
+ sizeof(*subpage->spans) * subpage->spans_num,
+ sizeof(*subpage->spans) * (subpage->spans_num + 1)
)) {
- extract_free(alloc, &span);
- return NULL;
+ return -1;
}
- page->spans[page->spans_num] = span;
- page->spans_num += 1;
- return span;
+ subpage->spans[subpage->spans_num] = span;
+ subpage->spans_num += 1;
+
+ return 0;
+}
+
+
+static int subpage_span_append_new(extract_alloc_t* alloc, subpage_t *subpage, span_t** pspan)
+/* Appends new empty span_ to a subpage_t; returns -1 with errno set on error. */
+{
+ if (extract_malloc(alloc, pspan, sizeof(**pspan))) return -1;
+ extract_span_init(*pspan);
+ if (subpage_span_append(alloc, subpage, *pspan)) {
+ extract_free(alloc, pspan);
+ return -1;
+ }
+ return 0;
}
@@ -285,9 +311,9 @@ static void extract_images_free(extract_alloc_t* alloc, images_t* images)
static int extract_document_images(extract_alloc_t* alloc, document_t* document, images_t* o_images)
-/* Moves image_t's from document->page[] to *o_images.
+/* Moves image_t's from document->subpage[] to *o_images.
-On return document->page[].images* will be NULL etc.
+On return document->subpage[].images* will be NULL etc.
*/
{
int e = -1;
@@ -297,59 +323,65 @@ On return document->page[].images* will be NULL etc.
for (p=0; p<document->pages_num; ++p)
{
extract_page_t* page = document->pages[p];
- int i;
- for (i=0; i<page->images_num; ++i)
+ int c;
+ for (c=0; c<page->subpages_num; ++c)
{
- image_t* image;
- if (extract_realloc2(
- alloc,
- &images.images,
- sizeof(image_t) * images.images_num,
- sizeof(image_t) * (images.images_num + 1)
- )) goto end;
- image = &page->images[i];
- outf("p=%i i=%i image->name=%s image->id=%s", p, i, image->name, image->id);
- assert(image->name);
- images.images[images.images_num] = *image;
- images.images_num += 1;
-
- /* Add image type if we haven't seen it before. */
+ subpage_t* subpage = page->subpages[c];
+ int i;
+ for (i=0; i<subpage->images_num; ++i)
{
- int it;
- for (it=0; it<images.imagetypes_num; ++it)
+ image_t* image;
+ if (extract_realloc2(
+ alloc,
+ &images.images,
+ sizeof(image_t) * images.images_num,
+ sizeof(image_t) * (images.images_num + 1)
+ )) goto end;
+ image = &subpage->images[i];
+ outf("p=%i i=%i image->name=%s image->id=%s", p, i, image->name, image->id);
+ assert(image->name);
+ images.images[images.images_num] = *image;
+ images.images_num += 1;
+
+ /* Add image type if we haven't seen it before. */
{
- outf("it=%i images.imagetypes[it]=%s image->type=%s",
- it, images.imagetypes[it], image->type);
- if (!strcmp(images.imagetypes[it], image->type)) {
- break;
+ int it;
+ for (it=0; it<images.imagetypes_num; ++it)
+ {
+ outf("it=%i images.imagetypes[it]=%s image->type=%s",
+ it, images.imagetypes[it], image->type);
+ if (!strcmp(images.imagetypes[it], image->type))
+ {
+ break;
+ }
}
- }
- if (it == images.imagetypes_num)
- {
- /* We haven't seen this image type before. */
- if (extract_realloc2(
- alloc,
- &images.imagetypes,
- sizeof(char*) * images.imagetypes_num,
- sizeof(char*) * (images.imagetypes_num + 1)
+ if (it == images.imagetypes_num)
+ {
+ /* We haven't seen this image type before. */
+ if (extract_realloc2(
+ alloc,
+ &images.imagetypes,
+ sizeof(char*) * images.imagetypes_num,
+ sizeof(char*) * (images.imagetypes_num + 1)
)) goto end;
- assert(image->type);
- images.imagetypes[images.imagetypes_num] = image->type;
- images.imagetypes_num += 1;
- outf("have added images.imagetypes_num=%i", images.imagetypes_num);
+ assert(image->type);
+ images.imagetypes[images.imagetypes_num] = image->type;
+ images.imagetypes_num += 1;
+ outf("have added images.imagetypes_num=%i", images.imagetypes_num);
+ }
}
+
+ /* We've taken ownership of image->* so NULL the original values
+ here to ensure we can't use things after free. */
+ image->type = NULL;
+ image->name = NULL;
+ image->id = NULL;
+ image->data = NULL;
+ image->data_size = 0;
}
-
- /* We've taken ownership of image->* so NULL the original values
- here to ensure we can't use things after free. */
- image->type = NULL;
- image->name = NULL;
- image->id = NULL;
- image->data = NULL;
- image->data_size = 0;
+ extract_free(alloc, &subpage->images);
+ subpage->images_num = 0;
}
- extract_free(alloc, &page->images);
- page->images_num = 0;
}
e = 0;
end:
@@ -367,12 +399,11 @@ On return document->page[].images* will be NULL etc.
static void extract_document_free(extract_alloc_t* alloc, document_t* document)
{
int p;
- if (!document) {
- return;
- }
- for (p=0; p<document->pages_num; ++p) {
- extract_page_t* page = document->pages[p];
- page_free(alloc, &page);
+ if (!document) return;
+
+ for (p=0; p<document->pages_num; ++p)
+ {
+ page_free(alloc, &document->pages[p]);
}
extract_free(alloc, &document->pages);
document->pages = NULL;
@@ -451,11 +482,11 @@ static void s_document_init(document_t* document)
}
-static int page_span_end_clean(extract_alloc_t* alloc, extract_page_t* page)
-/* Does preliminary processing of the end of the last span in a page; intended
+static int subpage_span_end_clean(extract_alloc_t* alloc, subpage_t* subpage)
+/* Does preliminary processing of the end of the last span in a subpage; intended
to be called as we load span information.
-Looks at last two char_t's in last span_t of <page>, and either
+Looks at last two char_t's in last span_t of <subpage>, and either
leaves unchanged, or removes space in last-but-one position, or moves last
char_t into a new span_t. */
{
@@ -468,9 +499,9 @@ char_t into a new span_t. */
double err_x;
double err_y;
point_t dir;
-
- assert(page->spans_num);
- span = page->spans[page->spans_num-1];
+
+ assert(subpage->spans_num);
+ span = subpage->spans[subpage->spans_num-1];
assert(span->chars_num);
/* Last two char_t's are char_[-2] and char_[-1]. */
@@ -547,8 +578,8 @@ char_t into a new span_t. */
span_string2(span)
);
{
- span_t* span2 = page_span_append(alloc, page);
- if (!span2) goto end;
+ span_t* span2;
+ if (subpage_span_append_new(alloc, subpage, &span2)) goto end;
*span2 = *span;
if (extract_strdup(alloc, span->font_name, &span2->font_name)) goto end;
span2->chars_num = 1;
@@ -567,42 +598,44 @@ char_t into a new span_t. */
struct extract_t
{
extract_alloc_t* alloc;
-
+
+ int layout_analysis;
+
document_t document;
-
+
int num_spans_split;
- /* Number of extra spans from page_span_end_clean(). */
-
+ /* Number of extra spans from subpage_span_end_clean(). */
+
int num_spans_autosplit;
/* Number of extra spans from autosplit=1. */
-
+
double span_offset_x;
double span_offset_y;
/* Only used if autosplit is non-zero. */
-
+
int image_n;
/* Used to generate unique ids for images. */
-
+
/* List of strings that are the generated docx content for each page. When
zip_* can handle appending of data, we will be able to remove this list. */
extract_astring_t* contentss;
int contentss_num;
-
+
images_t images;
-
+
extract_format_t format;
extract_odt_styles_t odt_styles;
-
+
char* tables_csv_format;
int tables_csv_i;
-
+
enum
{
path_type_NONE,
path_type_FILL,
path_type_STROKE,
} path_type;
-
+
union
{
struct
@@ -612,7 +645,7 @@ struct extract_t
point_t points[4];
int n;
} fill;
-
+
struct
{
matrix_t ctm;
@@ -623,7 +656,7 @@ struct extract_t
point_t point;
int point_set;
} stroke;
-
+
} path;
};
@@ -636,7 +669,7 @@ int extract_begin(
{
int e = -1;
extract_t* extract;
-
+
if (1
&& format != extract_format_ODT
&& format != extract_format_DOCX
@@ -648,29 +681,35 @@ int extract_begin(
errno = EINVAL;
return -1;
}
-
+
/* Use a temporary extract_alloc_t to allocate space for the extract_t. */
if (extract_malloc(alloc, &extract, sizeof(*extract))) goto end;
-
+
extract_bzero(extract, sizeof(*extract));
extract->alloc = alloc;
s_document_init(&extract->document);
-
+
/* Start at 10 because template document might use some low-numbered IDs.
*/
extract->image_n = 10;
-
+
extract->format = format;
extract->tables_csv_format = NULL;
extract->tables_csv_i = 0;
-
+
e = 0;
-
+
end:
*pextract = (e) ? NULL : extract;
return e;
}
+int extract_set_layout_analysis(extract_t *extract, int enable)
+{
+ extract->layout_analysis = enable;
+ return 0;
+}
+
int extract_tables_csv_format(extract_t* extract, const char* path_format)
{
return extract_strdup(extract->alloc, path_format, &extract->tables_csv_format);
@@ -686,7 +725,7 @@ static void image_free_fn(void* handle, void* image_data)
int extract_read_intermediate(extract_t* extract, extract_buffer_t* buffer, int autosplit)
{
int ret = -1;
-
+
document_t* document = &extract->document;
char* image_data = NULL;
int num_spans = 0;
@@ -716,16 +755,18 @@ int extract_read_intermediate(extract_t* extract, extract_buffer_t* buffer, int
</page>
...
- We convert this into a list of extract_page_t's, each containing a list of
+ We convert this into a list of subpage_t's, each containing a list of
span_t's, each containing a list of char_t's.
While doing this, we do some within-span processing by calling
- page_span_end_clean():
+ subpage_span_end_clean():
Remove spurious spaces.
Split spans in two where there seem to be large gaps between glyphs.
*/
for(;;) {
extract_page_t* page;
+ subpage_t* subpage;
+ rect_t mediabox = extract_rect_infinite; /* Fake mediabox */
int e = extract_xml_pparse_next(buffer, &tag);
if (e == 1) break; /* EOF. */
if (e) goto end;
@@ -741,14 +782,16 @@ int extract_read_intermediate(extract_t* extract, extract_buffer_t* buffer, int
goto end;
}
outfx("loading spans for page %i...", document->pages_num);
- if (extract_page_begin(extract)) goto end;
+ if (extract_page_begin(extract, mediabox.min.x, mediabox.min.y, mediabox.max.x, mediabox.max.y)) goto end;
page = extract->document.pages[extract->document.pages_num-1];
if (!page) goto end;
+ subpage = page->subpages[page->subpages_num-1];
+ if (!subpage) goto end;
for(;;) {
if (extract_xml_pparse_next(buffer, &tag)) goto end;
if (!strcmp(tag.name, "/page")) {
- num_spans += page->spans_num;
+ num_spans += subpage->spans_num;
break;
}
if (!strcmp(tag.name, "image")) {
@@ -804,20 +847,20 @@ int extract_read_intermediate(extract_t* extract, extract_buffer_t* buffer, int
else if (cc >= 'a' && cc <= 'f') byte += 10 + cc - 'a';
else goto compressed_error;
byte *= 16;
-
+
cc = *c;
c += 1;
if (cc >= '0' && cc <= '9') byte += cc-'0';
else if (cc >= 'a' && cc <= 'f') byte += 10 + cc - 'a';
else goto compressed_error;
-
+
image_data[i] = (char) byte;
i += 1;
if (i == image_data_size) {
break;
}
continue;
-
+
compressed_error:
outf("Unrecognised hex character '%x' at offset %lli in image data", cc, (long long) (c-tag.text.chars));
errno = EINVAL;
@@ -893,12 +936,12 @@ int extract_read_intermediate(extract_t* extract, extract_buffer_t* buffer, int
trm.e,
trm.f
)) goto end;
-
+
for(;;) {
- double x;
- double y;
- double adv;
- unsigned ucs;
+ double x;
+ double y;
+ double adv;
+ unsigned ucs;
if (extract_xml_pparse_next(buffer, &tag)) {
outf("Failed to find <char or </span");
@@ -917,16 +960,17 @@ int extract_read_intermediate(extract_t* extract, extract_buffer_t* buffer, int
if (extract_xml_tag_attributes_find_double(&tag, "y", &y)) goto end;
if (extract_xml_tag_attributes_find_double(&tag, "adv", &adv)) goto end;
if (extract_xml_tag_attributes_find_uint(&tag, "ucs", &ucs)) goto end;
-
- if (extract_add_char(extract, x, y, ucs, adv, autosplit)) goto end;
+
+ /* BBox is bogus here. Analysis will fail. */
+ if (extract_add_char(extract, x, y, ucs, adv, autosplit, x, y, x + adv, y + adv)) goto end;
}
extract_xml_tag_free(extract->alloc, &tag);
}
}
if (extract_page_end(extract)) goto end;
- outf("page=%i page->num_spans=%i",
- document->pages_num, page->spans_num);
+ outf("page=%i subpage->num_spans=%i",
+ document->pages_num, subpage->spans_num);
}
outf("num_spans=%i num_spans_split=%i num_spans_autosplit=%i",
@@ -940,7 +984,7 @@ int extract_read_intermediate(extract_t* extract, extract_buffer_t* buffer, int
end:
extract_xml_tag_free(extract->alloc, &tag);
extract_free(extract->alloc, &image_data);
-
+
return ret;
}
@@ -967,9 +1011,11 @@ int extract_span_begin(
{
int e = -1;
extract_page_t* page;
+ subpage_t* subpage;
span_t* span;
assert(extract->document.pages_num > 0);
page = extract->document.pages[extract->document.pages_num-1];
+ subpage = page->subpages[page->subpages_num-1];
outf("extract_span_begin(): ctm=(%f %f %f %f %f %f) trm=(%f %f %f %f %f %f) font_name=%s, wmode=%i",
ctm_a,
ctm_b,
@@ -986,22 +1032,21 @@ int extract_span_begin(
font_name,
wmode
);
- span = page_span_append(extract->alloc, page);
- if (!span) goto end;
+ if (subpage_span_append_new(extract->alloc, subpage, &span)) goto end;
span->ctm.a = ctm_a;
span->ctm.b = ctm_b;
span->ctm.c = ctm_c;
span->ctm.d = ctm_d;
span->ctm.e = ctm_e;
span->ctm.f = ctm_f;
-
+
span->trm.a = trm_a;
span->trm.b = trm_b;
span->trm.c = trm_c;
span->trm.d = trm_d;
span->trm.e = trm_e;
span->trm.f = trm_f;
-
+
{
const char* ff = strchr(font_name, '+');
const char* f = (ff) ? ff+1 : font_name;
@@ -1019,25 +1064,30 @@ int extract_span_begin(
int extract_add_char(
- extract_t* extract,
- double x,
- double y,
- unsigned ucs,
- double adv,
- int autosplit
+ extract_t* extract,
+ double x,
+ double y,
+ unsigned ucs,
+ double adv,
+ int autosplit,
+ double x0,
+ double y0,
+ double x1,
+ double y1
)
{
int e = -1;
char_t* char_;
extract_page_t* page = extract->document.pages[extract->document.pages_num-1];
- span_t* span = page->spans[page->spans_num - 1];
-
+ subpage_t* subpage = page->subpages[page->subpages_num-1];
+ span_t* span = subpage->spans[subpage->spans_num - 1];
+
outf("(%f %f) ucs=% 5i=%c adv=%f", x, y, ucs, (ucs >=32 && ucs< 127) ? ucs : ' ', adv);
/* Ignore the specified <autosplit> - there seems no advantage to not
splitting spans on multiple lines, and not doing so causes problems with
missing spaces in the output. */
autosplit = 1;
-
+
if (span->chars_num)
{
char_t* char_prev = &span->chars[span->chars_num - 1];
@@ -1065,17 +1115,16 @@ int extract_add_char(
dir.x, dir.y, span_a
);
extract->num_spans_autosplit += 1;
- span = page_span_append(extract->alloc, page);
- if (!span) goto end;
+ if (subpage_span_append_new(extract->alloc, subpage, &span)) goto end;
*span = *span0;
span->chars = NULL;
span->chars_num = 0;
if (extract_strdup(extract->alloc, span0->font_name, &span->font_name)) goto end;
}
}
-
+
if (0 && autosplit && y - extract->span_offset_y != 0) {
-
+
double e = span->ctm.e + span->ctm.a * (x - extract->span_offset_x)
+ span->ctm.b * (y - extract->span_offset_y);
double f = span->ctm.f + span->ctm.c * (x - extract->span_offset_x)
@@ -1094,8 +1143,7 @@ int extract_add_char(
/* Create new span. */
span_t* span0 = span;
extract->num_spans_autosplit += 1;
- span = page_span_append(extract->alloc, page);
- if (!span) goto end;
+ if (subpage_span_append_new(extract->alloc, subpage, &span)) goto end;
*span = *span0;
span->chars = NULL;
span->chars_num = 0;
@@ -1106,31 +1154,35 @@ int extract_add_char(
outfx("autosplit: char_pre_y=%f offset_y=%f",
char_pre_y, offset_y);
}
-
+
if (extract_span_append_c(extract->alloc, span, 0 /*c*/)) goto end;
/* Coverity warns, but extract_span_append_c() will have appended an item. */
/* coverity[var_deref_op] */
char_ = &span->chars[ span->chars_num-1];
-
+
char_->pre_x = x;
char_->pre_y = y;
char_->x = span->ctm.a * char_->pre_x + span->ctm.c * char_->pre_y + span->ctm.e;
char_->y = span->ctm.b * char_->pre_x + span->ctm.d * char_->pre_y + span->ctm.f;
-
+
char_->adv = adv;
char_->ucs = ucs;
+ char_->bbox.min.x = x0;
+ char_->bbox.min.y = y0;
+ char_->bbox.max.x = x1;
+ char_->bbox.max.y = y1;
{
- int page_spans_num_old = page->spans_num;
- if (page_span_end_clean(extract->alloc, page)) goto end;
- span = page->spans[page->spans_num-1]; /* fixme: unnecessary. */
- if (page->spans_num != page_spans_num_old) {
+ int subpage_spans_num_old = subpage->spans_num;
+ if (subpage_span_end_clean(extract->alloc, subpage)) goto end;
+ span = subpage->spans[subpage->spans_num-1]; /* fixme: unnecessary. */
+ if (subpage->spans_num != subpage_spans_num_old) {
extract->num_spans_split += 1;
}
}
e = 0;
-
+
end:
return e;
}
@@ -1139,13 +1191,14 @@ int extract_add_char(
int extract_span_end(extract_t* extract)
{
extract_page_t* page = extract->document.pages[extract->document.pages_num-1];
- span_t* span = page->spans[page->spans_num - 1];
+ subpage_t* subpage = page->subpages[page->subpages_num-1];
+ span_t* span = subpage->spans[subpage->spans_num - 1];
if (span->chars_num == 0) {
/* Calling code called extract_span_begin() then extract_span_end()
without any call to extract_add_char(). Our joining code assumes that
all spans are non-empty, so we need to delete this span. */
- extract_free(extract->alloc, &page->spans[page->spans_num - 1]);
- page->spans_num -= 1;
+ extract_free(extract->alloc, &subpage->spans[subpage->spans_num - 1]);
+ subpage->spans_num -= 1;
}
return 0;
}
@@ -1166,8 +1219,9 @@ int extract_add_image(
{
int e = -1;
extract_page_t* page = extract->document.pages[extract->document.pages_num-1];
+ subpage_t* subpage = page->subpages[page->subpages_num-1];
image_t image_temp = {0};
-
+
extract->image_n += 1;
image_temp.x = x;
image_temp.y = y;
@@ -1180,29 +1234,29 @@ int extract_add_image(
if (extract_strdup(extract->alloc, type, &image_temp.type)) goto end;
if (extract_asprintf(extract->alloc, &image_temp.id, "rId%i", extract->image_n) < 0) goto end;
if (extract_asprintf(extract->alloc, &image_temp.name, "image%i.%s", extract->image_n, image_temp.type) < 0) goto end;
-
+
if (extract_realloc2(
extract->alloc,
- &page->images,
- sizeof(image_t) * page->images_num,
- sizeof(image_t) * (page->images_num + 1)
+ &subpage->images,
+ sizeof(image_t) * subpage->images_num,
+ sizeof(image_t) * (subpage->images_num + 1)
)) goto end;
-
- page->images[page->images_num] = image_temp;
- page->images_num += 1;
- outf("page->images_num=%i", page->images_num);
-
+
+ subpage->images[subpage->images_num] = image_temp;
+ subpage->images_num += 1;
+ outf("subpage->images_num=%i", subpage->images_num);
+
e = 0;
-
+
end:
-
+
if (e) {
extract_free(extract->alloc, &image_temp.type);
extract_free(extract->alloc, &image_temp.data);
extract_free(extract->alloc, &image_temp.id);
extract_free(extract->alloc, &image_temp.name);
}
-
+
return e;
}
@@ -1220,7 +1274,7 @@ static int tablelines_append(extract_alloc_t* alloc, tablelines_t* tablelines, r
return 0;
}
-static point_t transform(double x, double y,
+static point_t transform(double x, double y,
double ctm_a,
double ctm_b,
double ctm_c,
@@ -1265,6 +1319,7 @@ int extract_add_path4(
)
{
extract_page_t* page = extract->document.pages[extract->document.pages_num-1];
+ subpage_t* subpage = page->subpages[page->subpages_num-1];
point_t points[4] = {
transform(x0, y0, ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f),
transform(x1, y1, ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f),
@@ -1303,20 +1358,20 @@ int extract_add_path4(
if (points[(i+4) % 4].y != y0) return 0;
rect.min.y = (y1 > y0) ? y0 : y1;
rect.max.y = (y1 > y0) ? y1 : y0;
-
+
dx = rect.max.x - rect.min.x;
dy = rect.max.y - rect.min.y;
if (dx / dy > 5)
{
/* Horizontal line. */
outf("have found horizontal line: %s", extract_rect_string(&rect));
- if (tablelines_append(extract->alloc, &page->tablelines_horizontal, &rect, color)) return -1;
+ if (tablelines_append(extract->alloc, &subpage->tablelines_horizontal, &rect, color)) return -1;
}
else if (dy / dx > 5)
{
/* Vertical line. */
outf("have found vertical line: %s", extract_rect_string(&rect));
- if (tablelines_append(extract->alloc, &page->tablelines_vertical, &rect, color)) return -1;
+ if (tablelines_append(extract->alloc, &subpage->tablelines_vertical, &rect, color)) return -1;
}
return 0;
}
@@ -1339,6 +1394,7 @@ int extract_add_line(
)
{
extract_page_t* page = extract->document.pages[extract->document.pages_num-1];
+ subpage_t* subpage = page->subpages[page->subpages_num-1];
point_t p0 = transform(x0, y0, ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f);
point_t p1 = transform(x1, y1, ctm_a, ctm_b, ctm_c, ctm_d, ctm_e, ctm_f);
double width2 = width * sqrt( fabs( ctm_a * ctm_d - ctm_b * ctm_c));
@@ -1348,7 +1404,7 @@ int extract_add_line(
rect.min.y = s_min(p0.y, p1.y);
rect.max.x = s_max(p0.x, p1.x);
rect.max.y = s_max(p0.y, p1.y);
-
+
outf("%s: width=%f ((%f %f)(%f %f)) rect=%s",
extract_FUNCTION,
width,
@@ -1362,49 +1418,98 @@ int extract_add_line(
{
rect.min.x -= width2 / 2;
rect.max.x += width2 / 2;
- return tablelines_append(extract->alloc, &page->tablelines_vertical, &rect, color);
+ return tablelines_append(extract->alloc, &subpage->tablelines_vertical, &rect, color);
}
else if (rect.min.y == rect.max.y)
{
rect.min.y -= width2 / 2;
rect.max.y += width2 / 2;
- return tablelines_append(extract->alloc, &page->tablelines_horizontal, &rect, color);
+ return tablelines_append(extract->alloc, &subpage->tablelines_horizontal, &rect, color);
}
return 0;
}
+int extract_subpage_alloc(extract_alloc_t* alloc, rect_t mediabox, extract_page_t* page, subpage_t** psubpage)
+{
+ subpage_t* subpage;
+ if (extract_malloc(alloc, psubpage, sizeof(subpage_t)))
+ {
+ return -1;
+ }
+ subpage = *psubpage;
+ subpage->mediabox = mediabox;
+ subpage->spans = NULL;
+ subpage->spans_num = 0;
+ subpage->lines = NULL;
+ subpage->lines_num = 0;
+ subpage->paragraphs = NULL;
+ subpage->paragraphs_num = 0;
+ subpage->images = NULL;
+ subpage->images_num = 0;
+ subpage->tablelines_horizontal.tablelines = NULL;
+ subpage->tablelines_horizontal.tablelines_num = 0;
+ subpage->tablelines_vertical.tablelines = NULL;
+ subpage->tablelines_vertical.tablelines_num = 0;
+ subpage->tables = NULL;
+ subpage->tables_num = 0;
+
+ if (extract_realloc2(
+ alloc,
+ &page->subpages,
+ sizeof(subpage_t*) * page->subpages_num,
+ sizeof(subpage_t*) * (page->subpages_num + 1)
+ )) {
+ extract_free(alloc, psubpage);
+ return -1;
+ }
+ page->subpages[page->subpages_num] = subpage;
+ page->subpages_num += 1;
+ return 0;
+}
+
+static int extract_subpage_begin(extract_t* extract, double x0, double y0, double x1, double y1)
+/* Appends new empty subpage_t to the last page of an extract->document. */
+{
+ extract_page_t* page = extract->document.pages[extract->document.pages_num - 1];
+ subpage_t* subpage;
+ rect_t mediabox = { { x0, y0 }, { x1, y1 } };
+
+ return extract_subpage_alloc(extract->alloc, mediabox, page, &subpage);
+}
-int extract_page_begin(extract_t* extract)
+int extract_page_begin(extract_t *extract, double x0, double y0, double x1, double y1)
{
- /* Appends new empty extract_page_t to an extract->document. */
+ /* Appends new empty page_t to an extract->document. */
extract_page_t* page;
- if (extract_malloc(extract->alloc, &page, sizeof(extract_page_t))) return -1;
- page->spans = NULL;
- page->spans_num = 0;
- page->lines = NULL;
- page->lines_num = 0;
- page->paragraphs = NULL;
- page->paragraphs_num = 0;
- page->images = NULL;
- page->images_num = 0;
- page->tablelines_horizontal.tablelines = NULL;
- page->tablelines_horizontal.tablelines_num = 0;
- page->tablelines_vertical.tablelines = NULL;
- page->tablelines_vertical.tablelines_num = 0;
- page->tables = NULL;
- page->tables_num = 0;
-
+
+ if (extract_malloc(extract->alloc, &page, sizeof(*page))) return -1;
+ page->mediabox.min.x = x0;
+ page->mediabox.min.y = y0;
+ page->mediabox.max.x = x1;
+ page->mediabox.max.y = y1;
+ page->subpages = NULL;
+ page->subpages_num = 0;
+ page->split = NULL;
+
if (extract_realloc2(
extract->alloc,
&extract->document.pages,
- sizeof(extract_page_t*) * extract->document.pages_num + 1,
- sizeof(extract_page_t*) * (extract->document.pages_num + 1)
+ sizeof(subpage_t*) * extract->document.pages_num,
+ sizeof(subpage_t*) * (extract->document.pages_num + 1)
)) {
extract_free(extract->alloc, &page);
return -1;
}
+
extract->document.pages[extract->document.pages_num] = page;
extract->document.pages_num += 1;
+
+ if (extract_subpage_begin(extract, x0, y0, x1, y1)) {
+ extract->document.pages_num--;
+ page_free(extract->alloc, &extract->document.pages[extract->document.pages_num]);
+ return -1;
+ }
+
return 0;
}
@@ -1634,13 +1739,22 @@ int extract_stroke_end(extract_t* extract)
-int extract_page_end(extract_t* extract)
+static int extract_subpage_end(extract_t* extract)
{
(void) extract;
return 0;
}
+int extract_page_end(extract_t* extract)
+{
+ if (extract_subpage_end(extract))
+ return -1;
+
+ return 0;
+}
+
+
static int paragraphs_to_text_content(
extract_alloc_t* alloc,
paragraph_t** paragraphs,
@@ -1692,54 +1806,59 @@ static int extract_write_tables_csv(extract_t* extract)
FILE* f = NULL;
extract_astring_t text = {NULL, 0};
if (!extract->tables_csv_format) return 0;
-
+
outf("extract_write_tables_csv(): path_format=%s", extract->tables_csv_format);
outf("extract->document.pages_num=%i", extract->document.pages_num);
for (p=0; p<extract->document.pages_num; ++p)
{
+ int c;
extract_page_t* page = extract->document.pages[p];
- int t;
- outf("p=%i page->tables_num=%i", p, page->tables_num);
- for (t=0; t<page->tables_num; ++t)
+ for (c=0; c<page->subpages_num; ++c)
{
- table_t* table = page->tables[t];
- int y;
- extract_free(extract->alloc, &path);
- if (extract_asprintf(extract->alloc, &path, extract->tables_csv_format, extract->tables_csv_i) < 0) goto end;
- extract->tables_csv_i += 1;
- outf("Writing table %i to: %s", t, path);
- outf("table->cells_num_x=%i", table->cells_num_x);
- outf("table->cells_num_y=%i", table->cells_num_y);
- f = fopen(path, "w");
- if (!f) goto end;
- for (y=0; y<table->cells_num_y; ++y)
+ subpage_t* subpage = page->subpages[c];
+ int t;
+ outf("p=%i subpage->tables_num=%i", p, subpage->tables_num);
+ for (t=0; t<subpage->tables_num; ++t)
{
- int x;
- int have_output = 0;
- for (x=0; x<table->cells_num_x; ++x)
+ table_t* table = subpage->tables[t];
+ int y;
+ extract_free(extract->alloc, &path);
+ if (extract_asprintf(extract->alloc, &path, extract->tables_csv_format, extract->tables_csv_i) < 0) goto end;
+ extract->tables_csv_i += 1;
+ outf("Writing table %i to: %s", t, path);
+ outf("table->cells_num_x=%i", table->cells_num_x);
+ outf("table->cells_num_y=%i", table->cells_num_y);
+ f = fopen(path, "w");
+ if (!f) goto end;
+ for (y=0; y<table->cells_num_y; ++y)
{
- cell_t* cell = table->cells[table->cells_num_x * y + x];
- extract_astring_free(extract->alloc, &text);
- if (y==0)
+ int x;
+ int have_output = 0;
+ for (x=0; x<table->cells_num_x; ++x)
{
- outf("y=0 x=%i cell->rect=%s", x, extract_rect_string(&cell->rect));
+ cell_t* cell = table->cells[table->cells_num_x * y + x];
+ extract_astring_free(extract->alloc, &text);
+ if (y==0)
+ {
+ outf("y=0 x=%i cell->rect=%s", x, extract_rect_string(&cell->rect));
+ }
+ if (have_output) fprintf(f, ",");
+ have_output = 1;
+ if (paragraphs_to_text_content(
+ extract->alloc,
+ cell->paragraphs,
+ cell->paragraphs_num,
+ &text
+ )) goto end;
+ /* Reference cvs output trims trailing spaces. */
+ extract_astring_char_truncate_if(&text, ' ');
+ fprintf(f, "\"%s\"", text.chars ? text.chars : "");
}
- if (have_output) fprintf(f, ",");
- have_output = 1;
- if (paragraphs_to_text_content(
- extract->alloc,
- cell->paragraphs,
- cell->paragraphs_num,
- &text
- )) goto end;
- /* Reference cvs output trims trailing spaces. */
- extract_astring_char_truncate_if(&text, ' ');
- fprintf(f, "\"%s\"", text.chars ? text.chars : "");
+ fprintf(f, "\n");
}
- fprintf(f, "\n");
+ fclose(f);
+ f = NULL;
}
- fclose(f);
- f = NULL;
}
}
ret = 0;
@@ -1760,7 +1879,7 @@ int extract_process(
)
{
int e = -1;
-
+
if (extract_realloc2(
extract->alloc,
&extract->contentss,
@@ -1769,9 +1888,9 @@ int extract_process(
)) goto end;
extract_astring_init(&extract->contentss[extract->contentss_num]);
extract->contentss_num += 1;
-
- if (extract_document_join(extract->alloc, &extract->document)) goto end;
-
+
+ if (extract_document_join(extract->alloc, &extract->document, extract->layout_analysis)) goto end;
+
if (extract->format == extract_format_ODT)
{
if (extract_document_to_odt_content(
@@ -1811,12 +1930,17 @@ int extract_process(
for (p=0; p<extract->document.pages_num; ++p)
{
extract_page_t* page = extract->document.pages[p];
- if (paragraphs_to_text_content(
- extract->alloc,
- page->paragraphs,
- page->paragraphs_num,
- &extract->contentss[extract->contentss_num - 1]
+ int c;
+ for (c=0; c<page->subpages_num; ++c)
+ {
+ subpage_t* subpage = page->subpages[c];
+ if (paragraphs_to_text_content(
+ extract->alloc,
+ subpage->paragraphs,
+ subpage->paragraphs_num,
+ &extract->contentss[extract->contentss_num - 1]
)) goto end;
+ }
}
}
else
@@ -1828,23 +1952,23 @@ int extract_process(
}
if (extract_document_images(extract->alloc, &extract->document, &extract->images)) goto end;
-
+
if (extract->tables_csv_format)
{
extract_write_tables_csv(extract);
}
-
+
{
- int i;
- for (i=0; i<extract->document.pages_num; ++i) {
- page_free(extract->alloc, &extract->document.pages[i]);
+ int p;
+ for (p=0; p<extract->document.pages_num; ++p) {
+ page_free(extract->alloc, &extract->document.pages[p]);
}
extract_free(extract->alloc, &extract->document.pages);
extract->document.pages_num = 0;
}
-
+
e = 0;
-
+
end:
return e;
}
@@ -1855,7 +1979,7 @@ int extract_write(extract_t* extract, extract_buffer_t* buffer)
extract_zip_t* zip = NULL;
char* text2 = NULL;
int i;
-
+
if (extract->format == extract_format_ODT)
{
if (extract_zip_open(buffer, &zip)) goto end;
@@ -1922,7 +2046,7 @@ int extract_write(extract_t* extract, extract_buffer_t* buffer)
if (extract_zip_write_file(zip, image->data, image->data_size, text2)) goto end;
}
if (extract_zip_close(&zip)) goto end;
-
+
}
else if (extract->format == extract_format_HTML)
{
@@ -1945,9 +2069,9 @@ int extract_write(extract_t* extract, extract_buffer_t* buffer)
errno = EINVAL;
return 1;
}
-
+
e = 0;
-
+
end:
if (e)
{
@@ -1955,7 +2079,7 @@ int extract_write(extract_t* extract, extract_buffer_t* buffer)
extract_zip_close(&zip);
}
extract_free(extract->alloc, &text2);
-
+
return e;
}
@@ -1982,7 +2106,7 @@ static int string_ends_with(const char* string, const char* end)
}
int extract_write_template(
- extract_t* extract,
+ extract_t* extract,
const char* path_template,
const char* path_out,
int preserve_dir
@@ -2021,7 +2145,7 @@ void extract_end(extract_t** pextract)
extract_t* extract = *pextract;
if (!extract) return;
extract_document_free(extract->alloc, &extract->document);
-
+
{
int i;
for (i=0; i<extract->contentss_num; ++i) {
diff --git a/extract/src/html.c b/extract/src/html.c
index d12a3101..de204881 100644
--- a/extract/src/html.c
+++ b/extract/src/html.c
@@ -51,7 +51,7 @@ static int content_state_reset(extract_alloc_t* alloc, content_state_t* content_
content_state->font.italic = 0;
}
e = 0;
-
+
end:
return e;
}
@@ -110,9 +110,9 @@ static int paragraph_to_html_content(
}
}
if (extract_astring_catf(alloc, content, "%s</p>", endl)) goto end;
-
+
e = 0;
-
+
end:
return e;
}
@@ -136,10 +136,10 @@ etc. */
paragraph_t* paragraph = paragraphs[p];
if (paragraph_to_html_content(alloc, state, paragraph, single_line, content)) goto end;
}
-
+
if (content_state_reset(alloc, state, content)) goto end;
e = 0;
-
+
end:
return e;
}
@@ -148,19 +148,14 @@ static int append_table(extract_alloc_t* alloc, content_state_t* state, table_t*
{
int e = -1;
int y;
-
+
if (extract_astring_cat(alloc, content, "\n\n<table border=\"1\" style=\"border-collapse:collapse\">\n")) goto end;
-
+
for (y=0; y<table->cells_num_y; ++y)
{
/* If 1, we put each <td>...</td> on a separate line. */
- int multiline = 0;
int x;
if (extract_astring_cat(alloc, content, " <tr>\n")) goto end;
- if (!multiline)
- {
- if (extract_astring_cat(alloc, content, " ")) goto end;
- }
for (x=0; x<table->cells_num_x; ++x)
{
cell_t* cell = table->cells[y*table->cells_num_x + x];
@@ -172,7 +167,7 @@ static int append_table(extract_alloc_t* alloc, content_state_t* state, table_t*
}
if (extract_astring_cat(alloc, content, " ")) goto end;
if (extract_astring_cat(alloc, content, "<td")) goto end;
-
+
if (cell->extend_right > 1)
{
if (extract_astring_catf(alloc, content, " colspan=\"%i\"", cell->extend_right)) goto end;
@@ -181,7 +176,7 @@ static int append_table(extract_alloc_t* alloc, content_state_t* state, table_t*
{
if (extract_astring_catf(alloc, content, " rowspan=\"%i\"", cell->extend_down)) goto end;
}
-
+
if (extract_astring_cat(alloc, content, ">")) goto end;
if (paragraphs_to_html_content(alloc, state, cell->paragraphs, cell->paragraphs_num, 1 /* single_line*/, content)) goto end;
@@ -190,15 +185,11 @@ static int append_table(extract_alloc_t* alloc, content_state_t* state, table_t*
if (content_state_reset(alloc, state, content)) goto end;
}
- if (!multiline)
- {
- if (extract_astring_cat(alloc, content, "\n")) goto end;
- }
if (extract_astring_cat(alloc, content, " </tr>\n")) goto end;
}
if (extract_astring_cat(alloc, content, "</table>\n\n")) goto end;
e = 0;
-
+
end:
return e;
}
@@ -222,6 +213,126 @@ static int compare_paragraph_y(const void* a, const void* b)
return 0;
}
+/*
+*/
+static int
+split_to_html(extract_alloc_t *alloc, split_t* split, subpage_t*** ppsubpage, extract_astring_t *output)
+{
+ int p;
+ int s;
+ int t;
+ subpage_t* subpage;
+ paragraph_t** paragraphs = NULL;
+ content_state_t state;
+ content_state_init(&state);
+
+ if (split == NULL) {
+ /* fall through to below - SPLIT_NONE */
+ } else if (split->type == SPLIT_HORIZONTAL) {
+ int ret = 0;
+ double total = 0;
+ for (s = 0; s < split->count; s++) {
+ total += split->split[s]->weight;
+ }
+ if (split->count > 1)
+ extract_astring_cat(alloc, output, "<div style=\"display:flex;\">\n");
+ for (s = 0; s < split->count; s++) {
+ if (split->count > 1)
+ {
+ if (total == 0)
+ {
+ extract_astring_catf(alloc, output, "<div>\n");
+ }
+ else
+ {
+ extract_astring_catf(alloc, output, "<div style=\"width:%g%%;\">\n", 100.0*split->split[s]->weight/total);
+ }
+ }
+ ret = split_to_html(alloc, split->split[s], ppsubpage, output);
+ if (ret)
+ break;
+ if (split->count > 1)
+ extract_astring_cat(alloc, output, "</div>\n");
+ }
+ if (split->count > 1)
+ extract_astring_cat(alloc, output, "</div>\n");
+ return ret;
+ } else if (split->type == SPLIT_VERTICAL) {
+ int ret = 0;
+ for (s = 0; s < split->count; s++) {
+ ret = split_to_html(alloc, split->split[s], ppsubpage, output);
+ if (ret)
+ break;
+ }
+ return ret;
+ }
+
+ /* We'll deal with the next subpage entry. Increment the pointer for the
+ * next caller. */
+ subpage = **ppsubpage;
+ *ppsubpage = (*ppsubpage)+1;
+
+ /* Output paragraphs and tables in order of increasing <y> coordinate.
+
+ Unfortunately the paragraph ordering we do in page->paragraphs[]
+ isn't quite right and results in bad ordering if ctm/trm matrices are
+ inconsistent. So we create our own list of paragraphs sorted strictly
+ by y coordinate of the first char of each paragraph. */
+ if (extract_malloc(alloc, &paragraphs, sizeof(*paragraphs) * subpage->paragraphs_num)) goto end;
+ for (p = 0; p < subpage->paragraphs_num; ++p)
+ {
+ paragraphs[p] = subpage->paragraphs[p];
+ }
+ qsort(paragraphs, subpage->paragraphs_num, sizeof(*paragraphs), compare_paragraph_y);
+
+ if (0)
+ {
+ int p;
+ outf0("paragraphs are:");
+ for (p=0; p<subpage->paragraphs_num; ++p)
+ {
+ paragraph_t* paragraph = subpage->paragraphs[p];
+ line_t* line = paragraph->lines[0];
+ span_t* span = line->spans[0];
+ outf0(" p=%i: %s", p, extract_span_string(NULL, span));
+ }
+ }
+
+ p = 0;
+ t = 0;
+ for(;;)
+ {
+ double y_paragraph;
+ double y_table;
+ paragraph_t* paragraph = (p == subpage->paragraphs_num) ? NULL : paragraphs[p];
+ table_t* table = (t == subpage->tables_num) ? NULL : subpage->tables[t];
+ if (!paragraph && !table) break;
+ y_paragraph = (paragraph) ? paragraph->lines[0]->spans[0]->chars[0].y : DBL_MAX;
+ y_table = (table) ? table->pos.y : DBL_MAX;
+ outf("p=%i y_paragraph=%f", p, y_paragraph);
+ outf("t=%i y_table=%f", t, y_table);
+ if (paragraph && y_paragraph < y_table)
+ {
+ //extract_astring_catf(alloc, output, "<p>@@@ paragraph %i y=%f @@@)</p>\n", p, y_paragraph);
+ if (paragraph_to_html_content(alloc, &state, paragraph, 0 /*single_line*/, output)) goto end;
+ if (content_state_reset(alloc, &state, output)) goto end;
+ p += 1;
+ }
+ else if (table)
+ {
+ //extract_astring_catf(alloc, output, "<p>@@@ table %t y=%f @@@)</p>\n", p, y_table);
+ if (append_table(alloc, &state, table, output)) goto end;
+ t += 1;
+ }
+ }
+ extract_free(alloc, &paragraphs);
+ return 0;
+
+end:
+ extract_free(alloc, &paragraphs);
+ return -1;
+}
+
int extract_document_to_html_content(
extract_alloc_t* alloc,
document_t* document,
@@ -231,84 +342,35 @@ int extract_document_to_html_content(
)
{
int ret = -1;
- int p;
+ int n;
paragraph_t** paragraphs = NULL;
-
+
(void) rotation;
(void) images;
-
+
extract_astring_cat(alloc, content, "<html>\n");
extract_astring_cat(alloc, content, "<body>\n");
-
+
/* Write paragraphs into <content>. */
- for (p=0; p<document->pages_num; ++p)
+ for (n=0; n<document->pages_num; ++n)
{
- extract_page_t* page = document->pages[p];
- int p;
- int t;
- content_state_t state;
- content_state_init(&state);
- extract_free(alloc, &paragraphs);
-
- /* Output paragraphs and tables in order of increasing <y> coordinate.
+ extract_page_t* page = document->pages[n];
+ subpage_t **psubpage = page->subpages;
- Unfortunately the paragraph ordering we do in page->paragraphs[]
- isn't quite right and results in bad ordering if ctm/trm matrices are
- inconsistent. So we create our own list of paragraphs sorted strictly
- by y coordinate of the first char of each paragraph. */
- if (extract_malloc(alloc, &paragraphs, sizeof(*paragraphs) * page->paragraphs_num)) goto end;
- for (p = 0; p < page->paragraphs_num; ++p)
- {
- paragraphs[p] = page->paragraphs[p];
- }
- qsort(paragraphs, page->paragraphs_num, sizeof(*paragraphs), compare_paragraph_y);
-
- if (0)
- {
- int p;
- outf0("paragraphs are:");
- for (p=0; p<page->paragraphs_num; ++p)
- {
- paragraph_t* paragraph = page->paragraphs[p];
- line_t* line = paragraph->lines[0];
- span_t* span = line->spans[0];
- outf0(" p=%i: %s", p, extract_span_string(NULL, span));
- }
- }
+ /* Every page gets its own div. */
+ extract_astring_cat(alloc, content, "<div>\n");
- p = 0;
- t = 0;
- for(;;)
- {
- double y_paragraph;
- double y_table;
- paragraph_t* paragraph = (p == page->paragraphs_num) ? NULL : paragraphs[p];
- table_t* table = (t == page->tables_num) ? NULL : page->tables[t];
- if (!paragraph && !table) break;
- y_paragraph = (paragraph) ? paragraph->lines[0]->spans[0]->chars[0].y : DBL_MAX;
- y_table = (table) ? table->pos.y : DBL_MAX;
- outf("p=%i y_paragraph=%f", p, y_paragraph);
- outf("t=%i y_table=%f", t, y_table);
- if (paragraph && y_paragraph < y_table)
- {
- //extract_astring_catf(alloc, content, "<p>@@@ paragraph %i y=%f @@@)</p>\n", p, y_paragraph);
- if (paragraph_to_html_content(alloc, &state, paragraph, 0 /*single_line*/, content)) goto end;
- if (content_state_reset(alloc, &state, content)) goto end;
- p += 1;
- }
- else if (table)
- {
- //extract_astring_catf(alloc, content, "<p>@@@ table %t y=%f @@@)</p>\n", p, y_table);
- if (append_table(alloc, &state, table, content)) goto end;
- t += 1;
- }
- }
+ ret = split_to_html(alloc, page->split, &psubpage, content);
+ if (ret)
+ goto end;
+
+ extract_astring_cat(alloc, content, "</div>\n");
}
extract_astring_cat(alloc, content, "</body>\n");
extract_astring_cat(alloc, content, "</html>\n");
ret = 0;
- end:
+end:
extract_free(alloc, &paragraphs);
return ret;
}
diff --git a/extract/src/join.c b/extract/src/join.c
index 4425de3d..110d3901 100644
--- a/extract/src/join.c
+++ b/extract/src/join.c
@@ -356,7 +356,7 @@ On entry:
On exit:
If we succeed, we return 0, with *o_lines pointing to array of *o_lines_num
line_t*'s, each pointing to a line_t.
-
+
If <rects_num> is zero, each of these line_t's will contain pointers to
items in <spans>; otherwise each of the line_t's will contain new spans
which should be freed by the caller (spans are not necessarily wholy inside
@@ -385,7 +385,7 @@ static int make_lines(
int num_compatible;
int num_joins;
span_t* span = NULL;
-
+
if (rects_num)
{
/* Make <lines> contain new span_t's and char_t's that are inside rects[]. */
@@ -412,7 +412,7 @@ static int make_lines(
{
extract_span_free(alloc, &span);
}
-
+
if (!spans[a]->chars_num)
{
/* All characters in this span are inside table, so remove
@@ -446,7 +446,7 @@ static int make_lines(
outfx("initial line a=%i: %s", a, line_string(lines[a]));
}
}
-
+
num_compatible = 0;
/* For each line, look for nearest aligned line, and append if found. */
@@ -459,7 +459,7 @@ static int make_lines(
line_t* nearest_line = NULL;
span_t* span_a;
double angle_a;
-
+
line_t* line_a = lines[a];
if (!line_a) {
continue;
@@ -580,7 +580,7 @@ static int make_lines(
{
continue;
}
-
+
if (1
&& extract_span_char_last(span_a)->ucs != ' '
&& span_char_first(span_b)->ucs != ' '
@@ -903,7 +903,7 @@ On exit:
are undefined.
*/
static int make_paragraphs(
- extract_alloc_t* alloc,
+ extract_alloc_t* alloc,
line_t** lines,
int lines_num,
paragraph_t*** o_paragraphs,
@@ -941,7 +941,7 @@ static int make_paragraphs(
double angle_a;
int verbose;
int b;
-
+
paragraph_t* paragraph_a = paragraphs[a];
if (!paragraph_a) {
/* This paragraph is empty - already been appended to a different
@@ -1183,9 +1183,9 @@ static int make_paragraphs(
return ret;
}
-static int s_join_page_rects(
+static int s_join_subpage_rects(
extract_alloc_t* alloc,
- extract_page_t* page,
+ subpage_t* subpage,
rect_t* rects,
int rects_num,
line_t*** lines,
@@ -1198,8 +1198,8 @@ rects_num is zero. */
{
if (make_lines(
alloc,
- page->spans,
- &page->spans_num,
+ subpage->spans,
+ &subpage->spans_num,
rects,
rects_num,
lines,
@@ -1212,7 +1212,7 @@ rects_num is zero. */
paragraphs,
paragraphs_num
)) return -1;
-
+
return 0;
}
@@ -1304,17 +1304,17 @@ void extract_cell_init(cell_t* cell)
static int table_find_extend(cell_t** cells, int cells_num_x, int cells_num_y)
-{
+{
/* Find cell extensions to right and down by looking at cells' .left and
.above flags.
-
+
For example for adjacent cells ABC..., we extend A to include cells BC..
until we reach a cell with .left set to one.
-
+
ABCDE
FGHIJ
KLMNO
-
+
When looking to extend cell A, we only look at cells in the same column or
same row, (i.e. in the above example we look at BCDE and FK, and not at
GHIJ and LMNO).
@@ -1349,7 +1349,7 @@ static int table_find_extend(cell_t** cells, int cells_num_x, int cells_num_y)
}
cell->extend_down = yy - y;
cell->rect.max.y = cells[(yy-1) * cells_num_x + x]->rect.max.y;
-
+
/* Clear .above and .left in enclosed cells. */
for (xx = x; xx < x + cell->extend_right; ++xx)
{
@@ -1384,7 +1384,7 @@ static int table_find_extend(cell_t** cells, int cells_num_x, int cells_num_y)
}
-static int table_find_cells_text(extract_alloc_t* alloc, extract_page_t* page,
+static int table_find_cells_text(extract_alloc_t* alloc, subpage_t* subpage,
cell_t** cells, int cells_num_x, int cells_num_y)
/* Sets each cell to contain the text that is within the cell's boundary. We
remove any found text from the page. */
@@ -1398,9 +1398,9 @@ remove any found text from the page. */
{
cell_t* cell = cells[i];
if (!cell->above || !cell->left) continue;
- if (s_join_page_rects(
+ if (s_join_subpage_rects(
alloc,
- page,
+ subpage,
&cell->rect,
1 /*rects_num*/,
&cell->lines,
@@ -1409,17 +1409,17 @@ remove any found text from the page. */
&cell->paragraphs_num
)) return -1;
}
-
+
/* Append the table we have found to page->tables[]. */
- if (extract_realloc(alloc, &page->tables, sizeof(*page->tables) * (page->tables_num + 1))) goto end;
- if (extract_malloc(alloc, &page->tables[page->tables_num], sizeof(*page->tables[page->tables_num]))) goto end;
- page->tables[page->tables_num]->pos.x = cells[0]->rect.min.x;
- page->tables[page->tables_num]->pos.y = cells[0]->rect.min.y;
- page->tables[page->tables_num]->cells = cells;
- page->tables[page->tables_num]->cells_num_x = cells_num_x;
- page->tables[page->tables_num]->cells_num_y = cells_num_y;
- page->tables_num += 1;
-
+ if (extract_realloc(alloc, &subpage->tables, sizeof(*subpage->tables) * (subpage->tables_num + 1))) goto end;
+ if (extract_malloc(alloc, &subpage->tables[subpage->tables_num], sizeof(*subpage->tables[subpage->tables_num]))) goto end;
+ subpage->tables[subpage->tables_num]->pos.x = cells[0]->rect.min.x;
+ subpage->tables[subpage->tables_num]->pos.y = cells[0]->rect.min.y;
+ subpage->tables[subpage->tables_num]->cells = cells;
+ subpage->tables[subpage->tables_num]->cells_num_x = cells_num_x;
+ subpage->tables[subpage->tables_num]->cells_num_y = cells_num_y;
+ subpage->tables_num += 1;
+
if (0)
{
/* For debugging. */
@@ -1442,24 +1442,24 @@ remove any found text from the page. */
}
fprintf(stderr, "\n");
}
-
+
}
-
+
e = 0;
end:
return e;
}
-static int table_find(extract_alloc_t* alloc, extract_page_t* page, double y_min, double y_max)
+static int table_find(extract_alloc_t* alloc, subpage_t* subpage, double y_min, double y_max)
/* Finds single table made from lines whose y coordinates are in the range
y_min..y_max. */
{
- tablelines_t* all_h = &page->tablelines_horizontal;
- tablelines_t* all_v = &page->tablelines_vertical;
+ tablelines_t* all_h = &subpage->tablelines_horizontal;
+ tablelines_t* all_v = &subpage->tablelines_vertical;
int e = -1;
int i;
-
+
/* Find subset of vertical and horizontal lines that are within range
y_min..y_max, and sort by y coordinate. */
tablelines_t tl_h = {NULL, 0};
@@ -1472,14 +1472,14 @@ y_min..y_max. */
int y;
outf("y=(%f %f)", y_min, y_max);
-
+
if (table_find_y_range(alloc, all_h, y_min, y_max, &tl_h)) goto end;
if (table_find_y_range(alloc, all_v, y_min, y_max, &tl_v)) goto end;
/* Suppress false coverity warning - qsort() does not dereference null
pointer if nmemb is zero. */
/* coverity[var_deref_model] */
qsort(tl_v.tablelines, tl_v.tablelines_num, sizeof(*tl_v.tablelines), tablelines_compare_x);
-
+
if (0)
{
/* Show raw lines info. */
@@ -1519,28 +1519,28 @@ y_min..y_max. */
break;
}
cells_num_y += 1;
-
+
for (j=0; j<tl_v.tablelines_num; )
{
int j_next;
int ii;
int jj;
cell_t* cell;
-
+
for (j_next = j+1; j_next<tl_v.tablelines_num; ++j_next)
{
if (tl_v.tablelines[j_next].rect.min.x - tl_v.tablelines[j].rect.min.x > 0.5) break;
}
outf("i=%i j=%i tl_v.tablelines[j].rect=%s", i, j, extract_rect_string(&tl_v.tablelines[j].rect));
-
+
if (j_next == tl_v.tablelines_num) break;
-
+
if (extract_realloc(alloc, &cells, sizeof(*cells) * (cells_num+1))) goto end;
if (extract_malloc(alloc, &cells[cells_num], sizeof(*cells[cells_num]))) goto end;
cell = cells[cells_num];
cells_num += 1;
if (i==0) cells_num_x += 1;
-
+
cell->rect.min.x = tl_v.tablelines[j].rect.min.x;
cell->rect.min.y = tl_h.tablelines[i].rect.min.y;
cell->rect.max.x = (j_next < tl_v.tablelines_num) ? tl_v.tablelines[j_next].rect.min.x : cell->rect.min.x;
@@ -1553,7 +1553,7 @@ y_min..y_max. */
cell->lines_num = 0;
cell->paragraphs = NULL;
cell->paragraphs_num = 0;
-
+
/* Set cell->above if there is a horizontal line above the cell. */
outf("Looking to set above for i=%i j=%i rect=%s", i, j, extract_rect_string(&cell->rect));
for (ii = i; ii < i_next; ++ii)
@@ -1570,7 +1570,7 @@ y_min..y_max. */
break;
}
}
-
+
/* Set cell->left if there is a vertical line to the left of the cell. */
for (jj = j; jj < j_next; ++jj)
{
@@ -1586,15 +1586,15 @@ y_min..y_max. */
break;
}
}
-
+
j = j_next;
}
-
+
i = i_next;
}
-
+
assert(cells_num == cells_num_x * cells_num_y);
-
+
/* Remove cols and rows where no cells have .above and .left - these
will not appear. It also avoids spurious empty columns when table uses
closely-spaced double lines as separators. */
@@ -1629,7 +1629,7 @@ y_min..y_max. */
cells_num_x -= 1;
}
}
-
+
if (cells_num == 0)
{
e = 0;
@@ -1637,9 +1637,9 @@ y_min..y_max. */
}
if (table_find_extend(cells, cells_num_x, cells_num_y)) goto end;
-
- if (table_find_cells_text(alloc, page, cells, cells_num_x, cells_num_y)) goto end;
-
+
+ if (table_find_cells_text(alloc, subpage, cells, cells_num_x, cells_num_y)) goto end;
+
e = 0;
end:
extract_free(alloc, &tl_h.tablelines);
@@ -1656,9 +1656,9 @@ y_min..y_max. */
}
-static int extract_page_tables_find_lines(
+static int extract_subpage_tables_find_lines(
extract_alloc_t* alloc,
- extract_page_t* page
+ subpage_t* subpage
)
/* Finds tables in <page> by looking for lines in page->tablelines_horizontal
and page->tablelines_vertical that look like table dividers.
@@ -1671,45 +1671,45 @@ Any text found inside tables is removed from page->spans[].
double margin = 1;
int iv;
int ih;
- outf("page->tablelines_horizontal.tablelines_num=%i", page->tablelines_horizontal.tablelines_num);
- outf("page->tablelines_vertical.tablelines_num=%i", page->tablelines_vertical.tablelines_num);
-
+ outf("page->tablelines_horizontal.tablelines_num=%i", subpage->tablelines_horizontal.tablelines_num);
+ outf("page->tablelines_vertical.tablelines_num=%i", subpage->tablelines_vertical.tablelines_num);
+
/* Sort all lines by y coordinate. */
qsort(
- page->tablelines_horizontal.tablelines,
- page->tablelines_horizontal.tablelines_num,
- sizeof(*page->tablelines_horizontal.tablelines),
+ subpage->tablelines_horizontal.tablelines,
+ subpage->tablelines_horizontal.tablelines_num,
+ sizeof(*subpage->tablelines_horizontal.tablelines),
tablelines_compare_y
);
qsort(
- page->tablelines_vertical.tablelines,
- page->tablelines_vertical.tablelines_num,
- sizeof(*page->tablelines_vertical.tablelines),
+ subpage->tablelines_vertical.tablelines,
+ subpage->tablelines_vertical.tablelines_num,
+ sizeof(*subpage->tablelines_vertical.tablelines),
tablelines_compare_y
);
-
+
if (0)
{
/* Show info about lines. */
int i;
outf0("tablelines_horizontal:");
- for (i=0; i<page->tablelines_horizontal.tablelines_num; ++i)
+ for (i=0; i<subpage->tablelines_horizontal.tablelines_num; ++i)
{
outf0(" color=%f: %s",
- page->tablelines_horizontal.tablelines[i].color,
- extract_rect_string(&page->tablelines_horizontal.tablelines[i].rect)
+ subpage->tablelines_horizontal.tablelines[i].color,
+ extract_rect_string(&subpage->tablelines_horizontal.tablelines[i].rect)
);
}
outf0("tablelines_vertical:");
- for (i=0; i<page->tablelines_vertical.tablelines_num; ++i)
+ for (i=0; i<subpage->tablelines_vertical.tablelines_num; ++i)
{
outf0(" color=%f: %s",
- page->tablelines_vertical.tablelines[i].color,
- extract_rect_string(&page->tablelines_vertical.tablelines[i].rect)
+ subpage->tablelines_vertical.tablelines[i].color,
+ extract_rect_string(&subpage->tablelines_vertical.tablelines[i].rect)
);
}
}
-
+
/* Look for completely separate vertical regions that define different
tables, by looking for vertical gaps between the rects of each
horizontal/vertical line. */
@@ -1722,22 +1722,22 @@ Any text found inside tables is removed from page->spans[].
tableline_t* tlv = NULL;
tableline_t* tlh = NULL;
tableline_t* tl;
- if (iv < page->tablelines_vertical.tablelines_num)
+ if (iv < subpage->tablelines_vertical.tablelines_num)
{
- tlv = &page->tablelines_vertical.tablelines[iv];
+ tlv = &subpage->tablelines_vertical.tablelines[iv];
}
/* We only consider horizontal lines that are not white. This is a bit
of a cheat to get the right behaviour with twotables_2.pdf. */
- while (ih < page->tablelines_horizontal.tablelines_num)
+ while (ih < subpage->tablelines_horizontal.tablelines_num)
{
- if (page->tablelines_horizontal.tablelines[ih].color == 1)
+ if (subpage->tablelines_horizontal.tablelines[ih].color == 1)
{
/* Ignore white horizontal lines. */
++ih;
}
else
{
- tlh = &page->tablelines_horizontal.tablelines[ih];
+ tlh = &subpage->tablelines_horizontal.tablelines[ih];
break;
}
}
@@ -1756,16 +1756,16 @@ Any text found inside tables is removed from page->spans[].
{
outf("New table. maxy=%f miny=%f", maxy, miny);
/* Find table. */
- table_find(alloc, page, miny - margin, maxy + margin);
+ table_find(alloc, subpage, miny - margin, maxy + margin);
}
miny = tl->rect.min.y;
}
if (tl->rect.max.y > maxy) maxy = tl->rect.max.y;
}
-
+
/* Find last table. */
- table_find(alloc, page, miny - margin, maxy + margin);
-
+ table_find(alloc, subpage, miny - margin, maxy + margin);
+
return 0;
}
@@ -1793,9 +1793,9 @@ static void show_tables(table_t** tables, int tables_num)
}
}
-static int extract_page_tables_find(
+static int extract_subpage_tables_find(
extract_alloc_t* alloc,
- extract_page_t* page
+ subpage_t* subpage
)
/* Find tables in <page>.
@@ -1804,53 +1804,53 @@ will call other functions that find tables in different ways, e.g. by analysing
an image of a page, or looking for blocks of whitespace in between chunks of
text. */
{
- if (extract_page_tables_find_lines(alloc, page)) return -1;
+ if (extract_subpage_tables_find_lines(alloc, subpage)) return -1;
if (0)
{
outf0("=== tables from extract_page_tables_find_lines():");
- show_tables(page->tables, page->tables_num);
+ show_tables(subpage->tables, subpage->tables_num);
}
return 0;
}
-static int extract_document_join_page(
+static int extract_join_subpage(
extract_alloc_t* alloc,
- extract_page_t* page
+ subpage_t* subpage
)
/* Finds tables and paragraphs on <page>. */
{
/* Find tables on this page first. This will remove text that is within
tables from page->spans, so that text doesn't appearing more than once in
the final output. */
- if (extract_page_tables_find(alloc, page)) return -1;
+ if (extract_subpage_tables_find(alloc, subpage)) return -1;
/* Now join remaining spans into lines and paragraphs. */
- if (s_join_page_rects(
+ if (s_join_subpage_rects(
alloc,
- page,
+ subpage,
NULL /*rects*/,
0 /*rects_num*/,
- &page->lines,
- &page->lines_num,
- &page->paragraphs,
- &page->paragraphs_num
+ &subpage->lines,
+ &subpage->lines_num,
+ &subpage->paragraphs,
+ &subpage->paragraphs_num
))
{
- outf0("s_join_page_rects failed. page->spans_num=%i page->lines_num=%i page->paragraphs_num=%i",
- page->spans_num,
- page->lines_num,
- page->paragraphs_num
+ outf0("s_join_subpage_rects failed. subpage->spans_num=%i subpage->lines_num=%i subpage->paragraphs_num=%i",
+ subpage->spans_num,
+ subpage->lines_num,
+ subpage->paragraphs_num
);
return -1;
}
-
+
return 0;
}
-int extract_document_join(extract_alloc_t* alloc, document_t* document)
+int extract_document_join(extract_alloc_t* alloc, document_t* document, int layout_analysis)
{
/* For each page in <document> we find tables and join spans into lines and paragraphs.
@@ -1861,9 +1861,16 @@ int extract_document_join(extract_alloc_t* alloc, document_t* document)
int p;
for (p=0; p<document->pages_num; ++p) {
extract_page_t* page = document->pages[p];
-
- outf("processing page %i: num_spans=%i", p, page->spans_num);
- if (extract_document_join_page(alloc, page)) return -1;
+ int c;
+
+ if (layout_analysis && extract_page_analyse(alloc, page)) return -1;
+
+ for (c=0; c<page->subpages_num; ++c) {
+ subpage_t* subpage = page->subpages[c];
+
+ outf("processing page %i, subpage %i: num_spans=%i", p, c, subpage->spans_num);
+ if (extract_join_subpage(alloc, subpage)) return -1;
+ }
}
return 0;
diff --git a/extract/src/mem.c b/extract/src/mem.c
index 1c3c96e6..788080f4 100644
--- a/extract/src/mem.c
+++ b/extract/src/mem.c
@@ -35,7 +35,7 @@ int extract_vasprintf(extract_alloc_t* alloc, char** out, const char* format, va
}
vsnprintf(*out, n + 1, format, va2);
ret = 0;
-
+
end:
va_end(va2);
return ret;
diff --git a/extract/src/memento.c b/extract/src/memento.c
index e62744be..e991b29b 100644
--- a/extract/src/memento.c
+++ b/extract/src/memento.c
@@ -1448,7 +1448,10 @@ int Memento_listBlocksNested(void)
size_t end = (b->rawsize < MEMENTO_PTRSEARCH ? b->rawsize : MEMENTO_PTRSEARCH);
size_t z;
VALGRIND_MAKE_MEM_DEFINED(p, end);
- end -= sizeof(void *)-1;
+ if (end > sizeof(void *)-1)
+ end -= sizeof(void *)-1;
+ else
+ end = 0;
for (z = MEMENTO_SEARCH_SKIP; z < end; z += sizeof(void *)) {
void *q = *(void **)(&p[z]);
void **r;
diff --git a/extract/src/memento.py b/extract/src/memento.py
index 55171e39..6924736c 100755
--- a/extract/src/memento.py
+++ b/extract/src/memento.py
@@ -57,7 +57,7 @@ def main():
stdin = child.stdout
else:
stdin = sys.stdin
-
+
openbsd = os.uname()[0] == 'OpenBSD'
n = None
segv = 0
@@ -70,14 +70,14 @@ def main():
if m:
if not m.group(2):
# Start of squeeze.
-
+
if 0 and not openbsd:
# Looks like memento's forked processes might terminate
# before they get to output the 'Memory squeezing @ <N>
# complete' line.
#
assert n is None, f'n={n} line={line!r}'
-
+
n = int(m.group(1))
if n >= quiet_next:
sys.stdout.write(f'quiet_next={quiet_next!r} n={n!r}: {line}')
diff --git a/extract/src/misc-test.c b/extract/src/misc-test.c
index 5e658e8f..ec10079d 100644
--- a/extract/src/misc-test.c
+++ b/extract/src/misc-test.c
@@ -24,7 +24,7 @@ static void s_check(
else {
ok = (ret == 0 && values_equal);
}
-
+
if (ok) printf(" ok: ");
else printf(" fail:");
printf(" text=%16s", text);
@@ -81,9 +81,9 @@ static void s_check_xml_parse()
"< bar=>",
"< =>",
};
-
+
extract_xml_tag_init( &tag);
-
+
for (i=0; i<sizeof(texts) / sizeof(texts[0]); ++i)
{
const char* text = texts[i];
@@ -103,7 +103,7 @@ static void s_check_xml_parse()
e = extract_xml_pparse_next( buffer, &tag);
s_check_e( e, "extract_xml_pparse_next()");
s_check_e( tag.name ? 0 : 1, "tag.name is not null");
-
+
{
int j;
for (j=0; j<tag.attributes_num; ++j)
@@ -122,17 +122,17 @@ int main(void)
s_check_int("-20", -20, 0);
s_check_int("-20b", 0, EINVAL);
s_check_int("123456789123", 0, ERANGE);
-
+
printf("testing extract_xml_str_to_uint():\n");
s_check_uint("2", 2, 0);
s_check_uint("-20", 0, ERANGE);
s_check_uint("-20b", 0, EINVAL);
s_check_uint("123456789123", 0, ERANGE);
-
+
s_check_xml_parse();
-
+
printf("s_num_fails=%i\n", s_num_fails);
-
+
if (s_num_fails) {
printf("Failed\n");
return 1;
diff --git a/extract/src/odt.c b/extract/src/odt.c
index 9e369078..e2e45e2d 100644
--- a/extract/src/odt.c
+++ b/extract/src/odt.c
@@ -128,7 +128,7 @@ static int s_odt_styles_definitions(
);
extract_astring_cat(alloc, out, "<style:paragraph-properties style:writing-mode=\"lr-tb\"/>\n");
extract_astring_cat(alloc, out, "</style:style>\n");
-
+
/* Style for images. */
extract_astring_cat(alloc, out, "<style:style style:name=\"fr1\" style:family=\"graphic\" style:parent-style-name=\"Graphics\">\n");
extract_astring_cat(alloc, out, "<style:graphic-properties"
@@ -156,8 +156,8 @@ static int s_odt_styles_definitions(
" draw:color-mode=\"standard\""
"/>\n");
extract_astring_cat(alloc, out, "</style:style>\n");
-
-
+
+
if (extract_astring_cat(alloc, out, "</office:automatic-styles>")) return -1;
return 0;
}
@@ -308,9 +308,9 @@ change font. */
if (s_odt_run_finish(alloc, content_state, content)) goto end;
}
if (s_odt_paragraph_finish(alloc, content)) goto end;
-
+
e = 0;
-
+
end:
return e;
}
@@ -335,14 +335,14 @@ static int s_odt_append_image(
);
extract_astring_cat(alloc, content, "</draw:frame>\n");
extract_astring_cat(alloc, content, "</text:p>\n");
-
+
return 0;
}
static int s_odt_output_rotated_paragraphs(
extract_alloc_t* alloc,
- extract_page_t* page,
+ subpage_t* subpage,
int paragraph_begin,
int paragraph_end,
double rotation_rad,
@@ -361,13 +361,13 @@ static int s_odt_output_rotated_paragraphs(
int p;
double pt_to_inch = 1/72.0;
outf("rotated paragraphs: rotation_rad=%f (x y)=(%f %f) (w h)=(%f %f)", rotation_rad, x_pt, y_pt, w_pt, h_pt);
-
+
// https://docs.oasis-open.org/office/OpenDocument/v1.3/cs02/part3-schema/OpenDocument-v1.3-cs02-part3-schema.html#attribute-draw_transform
// says rotation is in degrees, but we seem to require -radians.
//
-
+
if (!e) e = extract_astring_cat(alloc, content, "\n");
-
+
if (!e) e = extract_astring_cat(alloc, content, "<text:p text:style-name=\"Standard\">\n");
if (!e) e = extract_astring_catf(alloc, content, "<draw:frame"
" text:anchor-type=\"paragraph\""
@@ -388,19 +388,19 @@ static int s_odt_output_rotated_paragraphs(
y_pt * pt_to_inch
);
if (!e) e = extract_astring_cat(alloc, content, "<draw:text-box>\n");
-
+
for (p=paragraph_begin; p<paragraph_end; ++p)
{
- paragraph_t* paragraph = page->paragraphs[p];
+ paragraph_t* paragraph = subpage->paragraphs[p];
if (!e) e = s_document_to_odt_content_paragraph(alloc, content_state, paragraph, content, styles);
}
-
+
if (!e) e = extract_astring_cat(alloc, content, "\n");
if (!e) e = extract_astring_cat(alloc, content, "</draw:text-box>\n");
if (!e) e = extract_astring_cat(alloc, content, "</draw:frame>\n");
-
+
if (!e) e = extract_astring_cat(alloc, content, "</text:p>\n");
-
+
return e;
}
@@ -409,7 +409,7 @@ static int s_odt_append_table(extract_alloc_t* alloc, table_t* table, extract_as
{
int e = -1;
int y;
-
+
{
int x;
static int table_number = 0;
@@ -438,7 +438,7 @@ static int s_odt_append_table(extract_alloc_t* alloc, table_t* table, extract_as
if (extract_astring_cat(alloc, content,
" <table:table-row>\n"
)) goto end;
-
+
for (x=0; x<table->cells_num_x; ++x)
{
cell_t* cell = table->cells[y*table->cells_num_x + x];
@@ -447,7 +447,7 @@ static int s_odt_append_table(extract_alloc_t* alloc, table_t* table, extract_as
if (extract_astring_cat(alloc, content, " <table:covered-table-cell/>\n")) goto end;
continue;
}
-
+
if (extract_astring_cat(alloc, content, " <table:table-cell")) goto end;
if (cell->extend_right > 1)
{
@@ -458,7 +458,7 @@ static int s_odt_append_table(extract_alloc_t* alloc, table_t* table, extract_as
if (extract_astring_catf(alloc, content, " table:number-rows-spanned=\"%i\"", cell->extend_down)) goto end;
}
if (extract_astring_catf(alloc, content, ">\n")) goto end;
-
+
/* Write contents of this cell. */
{
int p;
@@ -482,7 +482,7 @@ static int s_odt_append_table(extract_alloc_t* alloc, table_t* table, extract_as
}
if (extract_astring_cat(alloc, content, " </table:table>\n")) goto end;
e = 0;
-
+
end:
return e;
}
@@ -490,7 +490,7 @@ static int s_odt_append_table(extract_alloc_t* alloc, table_t* table, extract_as
static int s_odt_append_rotated_paragraphs(
extract_alloc_t* alloc,
- extract_page_t* page,
+ subpage_t* subpage,
content_state_t* content_state,
int* p,
int* text_box_id,
@@ -499,7 +499,7 @@ static int s_odt_append_rotated_paragraphs(
extract_astring_t* content,
extract_odt_styles_t* styles
)
-/* Appends paragraphs with same rotation, starting with page->paragraphs[*p]
+/* Appends paragraphs with same rotation, starting with subpage->paragraphs[*p]
and updates *p. */
{
/* Find extent of paragraphs with this same rotation. extent
@@ -509,7 +509,7 @@ and updates *p. */
point_t extent = {0, 0};
int p0 = *p;
int p1;
- paragraph_t* paragraph = page->paragraphs[*p];
+ paragraph_t* paragraph = subpage->paragraphs[*p];
outf("rotate=%.2frad=%.1fdeg ctm: ef=(%f %f) abcd=(%f %f %f %f)",
rotate, rotate * 180 / pi,
@@ -546,9 +546,9 @@ and updates *p. */
ctm->a, ctm->b, ctm->c, ctm->d);
}
- for (*p=p0; *p<page->paragraphs_num; ++*p)
+ for (*p=p0; *p<subpage->paragraphs_num; ++*p)
{
- paragraph = page->paragraphs[*p];
+ paragraph = subpage->paragraphs[*p];
ctm = &paragraph->lines[0]->spans[0]->ctm;
rotate = atan2(ctm->b, ctm->a);
if (rotate != rotate0)
@@ -597,7 +597,7 @@ and updates *p. */
if (s_odt_output_rotated_paragraphs(
alloc,
- page,
+ subpage,
p0,
p1,
rotate,
@@ -612,15 +612,15 @@ and updates *p. */
)) goto end;
*p = p1 - 1;
e = 0;
-
+
end:
return e;
}
-int extract_document_to_odt_content(
+static int extract_page_to_odt_content(
extract_alloc_t* alloc,
- document_t* document,
+ extract_page_t* page,
int spacing,
int rotation,
int images,
@@ -630,12 +630,12 @@ int extract_document_to_odt_content(
{
int ret = -1;
int text_box_id = 0;
- int p;
+ int c;
/* Write paragraphs into <content>. */
- for (p=0; p<document->pages_num; ++p)
+ for (c=0; c<page->subpages_num; ++c)
{
- extract_page_t* page = document->pages[p];
+ subpage_t* subpage = page->subpages[c];
int p = 0;
int t = 0;
content_state_t content_state;
@@ -644,17 +644,17 @@ int extract_document_to_odt_content(
content_state.font.bold = 0;
content_state.font.italic = 0;
content_state.ctm_prev = NULL;
-
+
for(;;)
{
- paragraph_t* paragraph = (p == page->paragraphs_num) ? NULL : page->paragraphs[p];
- table_t* table = (t == page->tables_num) ? NULL : page->tables[t];
+ paragraph_t* paragraph = (p == subpage->paragraphs_num) ? NULL : subpage->paragraphs[p];
+ table_t* table = (t == subpage->tables_num) ? NULL : subpage->tables[t];
double y_paragraph;
double y_table;
if (!paragraph && !table) break;
y_paragraph = (paragraph) ? paragraph->lines[0]->spans[0]->chars[0].y : DBL_MAX;
y_table = (table) ? table->pos.y : DBL_MAX;
-
+
if (paragraph && y_paragraph < y_table)
{
const matrix_t* ctm = &paragraph->lines[0]->spans[0]->ctm;
@@ -683,7 +683,7 @@ int extract_document_to_odt_content(
if (rotation && rotate != 0)
{
- if (s_odt_append_rotated_paragraphs(alloc, page, &content_state, &p, &text_box_id, ctm, rotate, content, styles)) goto end;
+ if (s_odt_append_rotated_paragraphs(alloc, subpage, &content_state, &p, &text_box_id, ctm, rotate, content, styles)) goto end;
}
else
{
@@ -697,15 +697,15 @@ int extract_document_to_odt_content(
t += 1;
}
}
-
+
outf("images=%i", images);
if (images)
{
int i;
- outf("page->images_num=%i", page->images_num);
- for (i=0; i<page->images_num; ++i)
+ outf("subpage->images_num=%i", subpage->images_num);
+ for (i=0; i<subpage->images_num; ++i)
{
- s_odt_append_image(alloc, content, &page->images[i]);
+ s_odt_append_image(alloc, content, &subpage->images[i]);
}
}
}
@@ -716,6 +716,38 @@ int extract_document_to_odt_content(
return ret;
}
+int extract_document_to_odt_content(
+ extract_alloc_t* alloc,
+ document_t* document,
+ int spacing,
+ int rotation,
+ int images,
+ extract_astring_t* content,
+ extract_odt_styles_t* styles
+ )
+{
+ int p;
+ int ret = 0;
+
+ /* Write paragraphs into <content>. */
+ for (p=0; p<document->pages_num; ++p)
+ {
+ extract_page_t* page = document->pages[p];
+
+ ret = extract_page_to_odt_content(
+ alloc,
+ page,
+ spacing,
+ rotation,
+ images,
+ content,
+ styles
+ );
+ if (ret) break;
+ };
+
+ return ret;
+}
#if 0
static int s_find_mid(const char* text, const char* begin, const char* end, const char** o_begin, const char** o_end)
@@ -749,7 +781,7 @@ int extract_odt_content_item(
extract_astring_t temp;
extract_astring_init(&temp);
*text2 = NULL;
-
+
(void) images;
if (0)
{}
@@ -771,10 +803,10 @@ int extract_odt_content_item(
&text_intermediate
)) goto end;
outf("text_intermediate: %s", text_intermediate);
-
+
/* Convert <styles> to text. */
if (s_odt_styles_definitions(alloc, styles, &styles_definitions)) goto end;
-
+
/* To make tables work, we seem to need to specify table and column
styles, and these can be empty. todo: maybe specify exact sizes based
on the pdf table and cell dimensions. */
@@ -783,7 +815,7 @@ int extract_odt_content_item(
"<style:style style:name=\"extract.table\" style:family=\"table\"/>\n"
"<style:style style:name=\"extract.table.column\" style:family=\"table-column\"/>\n"
)) goto end;
-
+
/* Replace '<office:automatic-styles/>' with text from
<styles_definitions>. */
e = extract_content_insert(
@@ -845,7 +877,7 @@ int extract_odt_content_item(
return e;
}
-
+
int extract_odt_write_template(
extract_alloc_t* alloc,
@@ -867,7 +899,7 @@ int extract_odt_write_template(
assert(path_out);
assert(path_template);
-
+
if (extract_check_path_shell_safe(path_out))
{
outf("path_out is unsafe: %s", path_out);
@@ -896,7 +928,7 @@ int extract_odt_write_template(
/* Might be nice to iterate through all items in path_tempdir, but for now
we look at just the items that we know extract_odt_content_item() will
modify. */
-
+
{
const char* names[] =
{
@@ -912,7 +944,7 @@ int extract_odt_write_template(
extract_free(alloc, &text2);
if (extract_asprintf(alloc, &path, "%s/%s", path_tempdir, name) < 0) goto end;
if (extract_read_all_path(alloc, path, &text)) goto end;
-
+
outf("before extract_odt_content_item() styles->styles_num=%i", styles->styles_num);
if (extract_odt_content_item(
alloc,
@@ -928,7 +960,7 @@ int extract_odt_write_template(
outf("extract_odt_content_item() failed");
goto end;
}
-
+
outf("after extract_odt_content_item styles->styles_num=%i", styles->styles_num);
{
@@ -954,7 +986,7 @@ int extract_odt_write_template(
if (extract_asprintf(alloc, &path, "%s/Pictures/%s", path_tempdir, image->name) < 0) goto end;
if (extract_write_all(image->data, image->data_size, path)) goto end;
}
-
+
outf("Zipping tempdir to create %s", path_out);
{
const char* path_out_leaf = strrchr(path_out, '/');
diff --git a/extract/src/odt.h b/extract/src/odt.h
index 68fa0262..cf523a68 100644
--- a/extract/src/odt.h
+++ b/extract/src/odt.h
@@ -34,7 +34,7 @@ extract_odt_write_template() to be inserted into an odt archive. */
int extract_odt_write_template(
- extract_alloc_t* alloc,
+ extract_alloc_t* alloc,
extract_astring_t* contentss,
int contentss_num,
extract_odt_styles_t* styles,
diff --git a/extract/src/odt_template.c b/extract/src/odt_template.c
index 5bc66b81..98e4f2dd 100644
--- a/extract/src/odt_template.c
+++ b/extract/src/odt_template.c
@@ -26,7 +26,7 @@ const odt_template_item_t odt_template_items[] =
"<text:sequence-decl text:display-outline-level=\"0\" text:name=\"Figure\"/></text:sequence-decls>"
"<text:p text:style-name=\"Standard\"/></office:text></office:body></office:document-content>"
},
-
+
{
"manifest.rdf",
"\x3c\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22"
@@ -87,7 +87,7 @@ const odt_template_item_t odt_template_items[] =
"\x72\x69\x70\x74\x69\x6f\x6e\x3e\x0a\x3c\x2f\x72\x64\x66\x3a\x52"
"\x44\x46\x3e\x0a"
},
-
+
{
"meta.xml",
""
@@ -102,14 +102,14 @@ const odt_template_item_t odt_template_items[] =
"<meta:editing-cycles>1</meta:editing-cycles>"
"<meta:document-statistic meta:table-count=\"0\" meta:image-count=\"0\" meta:object-count=\"0\" meta:page-count=\"1\" meta:paragraph-count=\"0\" meta:word-count=\"0\" meta:character-count=\"0\" meta:non-whitespace-character-count=\"0\"/></office:meta></office:document-meta>"
},
-
+
{
"mimetype",
"\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x76\x6e\x64"
"\x2e\x6f\x61\x73\x69\x73\x2e\x6f\x70\x65\x6e\x64\x6f\x63\x75\x6d"
"\x65\x6e\x74\x2e\x74\x65\x78\x74"
},
-
+
{
"settings.xml",
""
@@ -238,7 +238,7 @@ const odt_template_item_t odt_template_items[] =
"<config:config-item config:name=\"ChartAutoUpdate\" config:type=\"boolean\">true</config:config-item>"
"<config:config-item config:name=\"AddParaTableSpacing\" config:type=\"boolean\">true</config:config-item></config:config-item-set></office:settings></office:document-settings>"
},
-
+
{
"styles.xml",
""
@@ -320,7 +320,7 @@ const odt_template_item_t odt_template_items[] =
"<office:master-styles>"
"<style:master-page style:name=\"Standard\" style:page-layout-name=\"Mpm1\"/></office:master-styles></office:document-styles>"
},
-
+
{
"META-INF/manifest.xml",
""
@@ -345,7 +345,7 @@ const odt_template_item_t odt_template_items[] =
"<manifest:file-entry manifest:full-path=\"Thumbnails/thumbnail.png\" manifest:media-type=\"image/png\"/>\n"
"</manifest:manifest>"
},
-
+
{
"Thumbnails/thumbnail.png",
"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44"
@@ -359,7 +359,7 @@ const odt_template_item_t odt_template_items[] =
"\x00\x78\x18\xc7\x00\x00\x01\xf9\xd2\xb5\x9a\x00\x00\x00\x00\x49"
"\x45\x4e\x44\xae\x42\x60\x82"
},
-
+
};
int odt_template_items_num = 8;
diff --git a/extract/src/outf.c b/extract/src/outf.c
index de7662f6..9e955f83 100644
--- a/extract/src/outf.c
+++ b/extract/src/outf.c
@@ -26,7 +26,7 @@ void (extract_outf)(
if (level > extract_outf_verbose) {
return;
}
-
+
if (ln) {
fprintf(stderr, "%s:%i:%s: ", file, line, fn);
}
diff --git a/extract/src/rect.c b/extract/src/rect.c
new file mode 100644
index 00000000..2ea70962
--- /dev/null
+++ b/extract/src/rect.c
@@ -0,0 +1,57 @@
+#include "../include/extract.h"
+#include "document.h"
+
+static inline double
+mind(double a, double b)
+{
+ return (a < b) ? a : b;
+}
+
+static inline double
+maxd(double a, double b)
+{
+ return (a > b) ? a : b;
+}
+
+rect_t extract_rect_intersect(rect_t a, rect_t b)
+{
+ rect_t r;
+
+ r.min.x = maxd(a.min.x, b.min.x);
+ r.min.y = maxd(a.min.y, b.min.y);
+ r.max.x = mind(a.max.x, b.max.x);
+ r.max.y = mind(a.max.y, b.max.y);
+
+ return r;
+}
+
+rect_t extract_rect_union(rect_t a, rect_t b)
+{
+ rect_t r;
+
+ r.min.x = mind(a.min.x, b.min.x);
+ r.min.y = mind(a.min.y, b.min.y);
+ r.max.x = maxd(a.max.x, b.max.x);
+ r.max.y = maxd(a.max.y, b.max.y);
+
+ return r;
+}
+
+int extract_rect_contains_rect(rect_t a, rect_t b)
+{
+ if (a.min.x > b.min.x)
+ return 0;
+ if (a.min.y > b.min.y)
+ return 0;
+ if (a.max.x < b.max.x)
+ return 0;
+ if (a.max.y < b.max.y)
+ return 0;
+
+ return 1;
+}
+
+int extract_rect_valid(rect_t a)
+{
+ return (a.min.x <= a.max.x && a.min.y <= a.max.y);
+}
diff --git a/extract/src/text.c b/extract/src/text.c
index e75e3e69..c035edeb 100644
--- a/extract/src/text.c
+++ b/extract/src/text.c
@@ -25,11 +25,11 @@ int extract_content_insert(
const char* single = NULL;
extract_astring_t out;
extract_astring_init(&out);
-
+
assert(single_name || mid_begin_name || mid_end_name);
-
+
if (single_name) single = strstr(original, single_name);
-
+
if (single)
{
outf("Have found single_name='%s', using in preference to mid_begin_name=%s mid_end_name=%s",
@@ -81,11 +81,11 @@ int extract_content_insert(
*/
/* coverity[var_deref_model] */
if (extract_astring_cat(alloc, &out, mid_end)) goto end;
-
+
*o_out = out.chars;
out.chars = NULL;
e = 0;
-
+
end:
if (e) {
extract_astring_free(alloc, &out);
@@ -93,4 +93,3 @@ int extract_content_insert(
}
return e;
}
-
diff --git a/extract/src/xml.c b/extract/src/xml.c
index 24116f6d..87ba5d0c 100644
--- a/extract/src/xml.c
+++ b/extract/src/xml.c
@@ -408,7 +408,7 @@ int extract_xml_pparse_next(extract_buffer_t* buffer, extract_xml_tag_t* out)
char c;
int i;
extract_alloc_t* alloc = extract_buffer_alloc(buffer);
-
+
if (0) outf("out is: %s", extract_xml_tag_string(extract_buffer_alloc(buffer), out));
assert(buffer);
extract_xml_tag_free(alloc, out);
@@ -512,4 +512,3 @@ int extract_xml_pparse_next(extract_buffer_t* buffer, extract_xml_tag_t* out)
}
return ret;
}
-
diff --git a/extract/src/zip-test.c b/extract/src/zip-test.c
index 67082342..0e2d07aa 100644
--- a/extract/src/zip-test.c
+++ b/extract/src/zip-test.c
@@ -39,7 +39,7 @@ static int s_show(const char* filename)
datasize = n;
outf("datasize=%zi", datasize);
fclose(f);
-
+
/* look for End of central directory (EOCD) record. */
uint32_t magic = 0x06054b50;
char* pos = data + datasize - 22;
@@ -70,7 +70,7 @@ static int s_show(const char* filename)
outf(" offset_cd=%i", offset_cd);
outf(" comment_length=%i", comment_length);
outf(" comment=%s", comment);
-
+
if (pos != data + datasize - 22 - comment_length) {
outf("file does not end with EOCD. datasize=%zi pos-data=%li datasize-22-comment_length=%zi",
datasize,
@@ -83,7 +83,7 @@ static int s_show(const char* filename)
the file. */
assert(0);
}
-
+
pos = data + offset_cd;
int i;
for (i=0; i<num_records_on_disk; ++i) {
@@ -110,7 +110,7 @@ static int s_show(const char* filename)
assert(filename);
memcpy(filename, pos+46, filename_length);
filename[filename_length] = 0;
-
+
char* comment = extract_malloc(filecomment_length + 1);
assert(comment);
memcpy(comment, pos+46+filename_length+extrafield_length, filecomment_length);
@@ -133,7 +133,7 @@ static int s_show(const char* filename)
outf(" external_attributes=0x%x", external_attributes);
outf(" offset=%i", offset);
outf(" filename=%s", filename);
-
+
if (extrafield_length) {
outf( " extra:");
fprintf(stderr, " ");
@@ -146,14 +146,14 @@ static int s_show(const char* filename)
}
fputc('\n', stderr);
}
-
+
/* show local file header. */
{
char* local_pos = data + offset;
outf(" local header offset=%i", i, local_pos - data);
magic = 0x04034b50;
assert(!memcmp(local_pos, &magic, sizeof(magic)));
-
+
uint16_t version_needed = *(uint16_t*)(local_pos+4);
uint16_t general_bit_flag = *(uint16_t*)(local_pos+6);
uint16_t compression_method = *(uint16_t*)(local_pos+8);
@@ -164,7 +164,7 @@ static int s_show(const char* filename)
uint32_t size_uncompressed = *(uint32_t*)(local_pos+22);
uint16_t filename_length = *(uint16_t*)(local_pos+26);
uint16_t extrafield_length = *(uint16_t*)(local_pos+28);
-
+
char* filename = extract_malloc(filename_length + 1);
assert(filename);
memcpy(filename, local_pos+30, filename_length);
@@ -201,15 +201,15 @@ static int s_show(const char* filename)
}
}
-
+
outf(" comment=%s", comment);
-
+
pos += 46 + filename_length + extrafield_length + filecomment_length;
}
-
+
outf("finished");
extract_free(&data);
-
+
return 0;
}
diff --git a/extract/src/zip.c b/extract/src/zip.c
index 691b743b..baf7bb1b 100644
--- a/extract/src/zip.c
+++ b/extract/src/zip.c
@@ -30,7 +30,7 @@ typedef struct
uint32_t offset;
uint16_t attr_internal;
uint32_t attr_external;
-
+
} extract_zip_cd_file_t;
struct extract_zip_t
@@ -38,14 +38,14 @@ struct extract_zip_t
extract_buffer_t* buffer;
extract_zip_cd_file_t* cd_files;
int cd_files_num;
-
+
/* errno_ is set to non-zero if any operation fails; avoids need to check
after every small output operation. */
int errno_;
int eof;
uint16_t compression_method;
int compress_level;
-
+
/* Defaults for various values in zip file headers etc. */
uint16_t mtime;
uint16_t mdate;
@@ -62,9 +62,9 @@ int extract_zip_open(extract_buffer_t* buffer, extract_zip_t** o_zip)
int e = -1;
extract_zip_t* zip;
extract_alloc_t* alloc = extract_buffer_alloc(buffer);
-
+
if (extract_malloc(alloc, &zip, sizeof(*zip))) goto end;
-
+
zip->cd_files = NULL;
zip->cd_files_num = 0;
zip->buffer = buffer;
@@ -72,10 +72,10 @@ int extract_zip_open(extract_buffer_t* buffer, extract_zip_t** o_zip)
zip->eof = 0;
zip->compression_method = Z_DEFLATED;
zip->compress_level = Z_DEFAULT_COMPRESSION;
-
+
/* We could maybe convert current date/time to the ms-dos format required
here, but using zeros doesn't seem to make a difference to Word etc. */
-
+
{
time_t t = time(NULL);
struct tm* tm;
@@ -107,21 +107,21 @@ int extract_zip_open(extract_buffer_t* buffer, extract_zip_t** o_zip)
zip->mdate = 0;
}
}
-
+
/* These are all copied from command-line zip on unix. */
zip->version_creator = (0x3 << 8) + 30; /* 0x3 is unix, 30 means 3.0. */
zip->version_extract = 10; /* 10 means 1.0. */
zip->general_purpose_bit_flag = 0;
zip->file_attr_internal = 0;
-
+
/* We follow command-line zip which uses 0x81a40000 which is octal
0100644:0. (0100644 is S_IFREG (regular file) plus rw-r-r. See stat(2) for
details.) */
zip->file_attr_external = (0100644 << 16) + 0;
if (extract_strdup(alloc, "Artifex", &zip->archive_comment)) goto end;
-
+
e = 0;
-
+
end:
if (e) {
if (zip) extract_free(alloc, &zip->archive_comment);
@@ -184,11 +184,11 @@ static int s_write_compressed(
z_stream zstream = {0}; /* Initialise to keep Coverity quiet. */
if (zip->errno_) return -1;
if (zip->eof) return +1;
-
+
zstream.zalloc = s_zalloc;
zstream.zfree = s_zfree;
zstream.opaque = zip;
-
+
/* We need to write raw deflate data, so we use deflateInit2() with -ve
windowBits. The values we use are deflateInit()'s defaults. */
ze = deflateInit2(
@@ -206,11 +206,11 @@ static int s_write_compressed(
outf("deflateInit2() failed ze=%i", ze);
return -1;
}
-
+
/* Set zstream to read from specified data. */
zstream.next_in = (void*) data;
zstream.avail_in = (unsigned) data_length;
-
+
/* We increment *o_compressed_length gradually so that if we return an
error, we still indicate how many butes of compressed data have been
written. */
@@ -218,7 +218,7 @@ static int s_write_compressed(
{
*o_compressed_length = 0;
}
-
+
for(;;)
{
/* todo: write an extract_buffer_cache() function so we can write
@@ -329,7 +329,7 @@ int extract_zip_write_file(
int e = -1;
extract_zip_cd_file_t* cd_file = NULL;
extract_alloc_t* alloc = extract_buffer_alloc(zip->buffer);
-
+
if (data_length > INT_MAX) {
assert(0);
errno = EINVAL;
@@ -344,7 +344,7 @@ int extract_zip_write_file(
)) goto end;
cd_file = &zip->cd_files[zip->cd_files_num];
cd_file->name = NULL;
-
+
cd_file->mtime = zip->mtime;
cd_file->mdate = zip->mdate;
cd_file->crc_sum = (int32_t) crc32(crc32(0, NULL, 0), data, (int) data_length);
@@ -358,7 +358,7 @@ int extract_zip_write_file(
cd_file->attr_internal = zip->file_attr_internal;
cd_file->attr_external = zip->file_attr_external;
if (!cd_file->name) goto end;
-
+
/* Write local file header. If we are using compression, we set bit 3 of
General purpose bit flag and write zeros for crc-32, compressed size and
uncompressed size; then we write the actual values in data descriptor after
@@ -390,14 +390,14 @@ int extract_zip_write_file(
s_write_string(zip, cd_file->name); /* File name */
s_write(zip, extra_local, sizeof(extra_local)-1); /* Extra field */
}
-
+
if (zip->compression_method)
{
/* Write compressed data. */
size_t data_length_compressed;
s_write_compressed(zip, data, data_length, &data_length_compressed);
cd_file->size_compressed = (int) data_length_compressed;
-
+
/* Write data descriptor. */
s_write_uint32(zip, 0x08074b50); /* Data descriptor signature */
s_write_uint32(zip, cd_file->crc_sum); /* CRC-32 of uncompressed data */
@@ -408,14 +408,14 @@ int extract_zip_write_file(
{
s_write(zip, data, data_length);
}
-
+
if (zip->errno_) e = -1;
else if (zip->eof) e = +1;
else e = 0;
-
-
+
+
end:
-
+
if (e) {
/* Leave zip->cd_files_num unchanged, so calling extract_zip_close()
will write out any earlier files. Free cd_file->name to avoid leak. */
@@ -425,7 +425,7 @@ int extract_zip_write_file(
/* cd_files[zip->cd_files_num] is valid. */
zip->cd_files_num += 1;
}
-
+
return e;
}
@@ -443,7 +443,7 @@ int extract_zip_close(extract_zip_t** pzip)
alloc = extract_buffer_alloc(zip->buffer);
pos = extract_buffer_pos(zip->buffer);
len = 0;
-
+
/* Write Central directory file headers, freeing data as we go. */
for (i=0; i<zip->cd_files_num; ++i) {
const char extra[] = "";
@@ -472,7 +472,7 @@ int extract_zip_close(extract_zip_t** pzip)
extract_free(alloc, &cd_file->name);
}
extract_free(alloc, &zip->cd_files);
-
+
/* Write End of central directory record. */
s_write_uint32(zip, 0x06054b50);
s_write_uint16(zip, 0); /* Number of this disk */
@@ -481,16 +481,16 @@ int extract_zip_close(extract_zip_t** pzip)
s_write_uint16(zip, (uint16_t) zip->cd_files_num); /* Total number of central directory records */
s_write_uint32(zip, (int) len); /* Size of central directory (bytes) */
s_write_uint32(zip, (int) pos); /* Offset of start of central directory, relative to start of archive */
-
+
s_write_uint16(zip, (uint16_t) strlen(zip->archive_comment)); /* Comment length (n) */
s_write_string(zip, zip->archive_comment);
extract_free(alloc, &zip->archive_comment);
-
+
if (zip->errno_) e = -1;
else if (zip->eof) e = +1;
else e = 0;
-
+
extract_free(alloc, pzip);
-
+
return e;
}
diff --git a/extract/test/Python2clipped.pdf.mutool-norotate.docx.dir.ref/word/document.xml b/extract/test/Python2clipped.pdf.mutool-norotate.docx.dir.ref/word/document.xml
index d1615e1e..a5dad12e 100644
--- a/extract/test/Python2clipped.pdf.mutool-norotate.docx.dir.ref/word/document.xml
+++ b/extract/test/Python2clipped.pdf.mutool-norotate.docx.dir.ref/word/document.xml
@@ -108,19 +108,19 @@
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve"> a young man of </w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">young man of </w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans-BoldItalic" w:hAnsi="OpenSans-BoldItalic"/><w:b/><w:i/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">Madras</w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">,</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">e balls were </w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">balls were </w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans-Italic" w:hAnsi="OpenSans-Italic"/><w:i/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">constructed </w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">of brass,</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">When jangled together,</w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">hen jangled together,</w:t></w:r>
</w:p>
<w:p>
@@ -137,15 +137,15 @@
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">A Python, I sho</w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">A Python, I sh</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">For it needs a doctor </w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">For it needs a docto</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">And has the Measles yearly.</w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">And has the Measles yearly</w:t></w:r>
</w:p>
<w:p>
diff --git a/extract/test/Python2clipped.pdf.mutool.docx.dir.ref/word/document.xml b/extract/test/Python2clipped.pdf.mutool.docx.dir.ref/word/document.xml
index e4a4bc0f..4d404a8b 100644
--- a/extract/test/Python2clipped.pdf.mutool.docx.dir.ref/word/document.xml
+++ b/extract/test/Python2clipped.pdf.mutool.docx.dir.ref/word/document.xml
@@ -419,12 +419,12 @@
<wp:anchor distT="0" distB="0" distL="0" distR="0" simplePos="0" relativeHeight="0" behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1" wp14:anchorId="53A210D1" wp14:editId="2B7E8016">
<wp:simplePos x="0" y="0"/>
<wp:positionH relativeFrom="page">
- <wp:posOffset>4254598</wp:posOffset>
+ <wp:posOffset>4265751</wp:posOffset>
</wp:positionH>
<wp:positionV relativeFrom="page">
- <wp:posOffset>-113601</wp:posOffset>
+ <wp:posOffset>-151012</wp:posOffset>
</wp:positionV>
- <wp:extent cx="1706041" cy="1989200"/>
+ <wp:extent cx="1569389" cy="1989200"/>
<wp:effectExtent l="381000" t="723900" r="371475" b="723900"/>
<wp:wrapNone/>
<wp:docPr id="4" name="Text Box 4"/>
@@ -446,19 +446,19 @@
<w:txbxContent>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve"> a young man of </w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">young man of </w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans-BoldItalic" w:hAnsi="OpenSans-BoldItalic"/><w:b/><w:i/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">Madras</w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">,</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">e balls were </w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">balls were </w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans-Italic" w:hAnsi="OpenSans-Italic"/><w:i/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">constructed </w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">of brass,</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">When jangled together,</w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">hen jangled together,</w:t></w:r>
</w:p>
<w:p>
@@ -498,19 +498,19 @@
<w:txbxContent>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve"> a young man of </w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">young man of </w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans-BoldItalic" w:hAnsi="OpenSans-BoldItalic"/><w:b/><w:i/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">Madras</w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">,</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">e balls were </w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">balls were </w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans-Italic" w:hAnsi="OpenSans-Italic"/><w:i/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">constructed </w:t></w:r>
<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">of brass,</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">When jangled together,</w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">hen jangled together,</w:t></w:r>
</w:p>
<w:p>
@@ -570,15 +570,15 @@
<w:txbxContent>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">A Python, I sho</w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">A Python, I sh</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">For it needs a doctor </w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">For it needs a docto</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">And has the Measles yearly.</w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">And has the Measles yearly</w:t></w:r>
</w:p>
<w:p>
@@ -661,15 +661,15 @@
<w:txbxContent>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">A Python, I sho</w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">A Python, I sh</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">For it needs a doctor </w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">For it needs a docto</w:t></w:r>
</w:p>
<w:p>
-<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">And has the Measles yearly.</w:t></w:r>
+<w:r><w:rPr><w:rFonts w:ascii="OpenSans" w:hAnsi="OpenSans"/><w:sz w:val="20.000000"/><w:szCs w:val="15.000000"/></w:rPr><w:t xml:space="preserve">And has the Measles yearly</w:t></w:r>
</w:p>
<w:p>
diff --git a/extract/test/Python2clipped.pdf.mutool.text.ref b/extract/test/Python2clipped.pdf.mutool.text.ref
index d797070c..7a2fd582 100644
--- a/extract/test/Python2clipped.pdf.mutool.text.ref
+++ b/extract/test/Python2clipped.pdf.mutool.text.ref
@@ -17,14 +17,14 @@ Supporting each man on the top of the tide
That alone should encourage the crew.
Just the place for a Snark! I have said it thrice:
What I tell you three times is true."
- a young man of Madras,
-e balls were constructed of brass,
-When jangled together,
+young man of Madras,
+balls were constructed of brass,
+hen jangled together,
They played “Stormy Weather”,
And lightning shot out of his ass.
-A Python, I sho
-For it needs a doctor
-And has the Measles yearly.
+A Python, I sh
+For it needs a docto
+And has the Measles yearly
However, if you feel inclined
To get one (to improve your mind,
And not from fashion merely),
diff --git a/extract/test/agstat.pdf.mutool.html.ref b/extract/test/agstat.pdf.mutool.html.ref
index 9ca78a94..eb747eb6 100644
--- a/extract/test/agstat.pdf.mutool.html.ref
+++ b/extract/test/agstat.pdf.mutool.html.ref
@@ -1,5 +1,6 @@
<html>
<body>
+<div>
<p><b> DISTRICT WISE ESTIMATES OF MARKETABLE SURPLUS / DEFICIT OF RICE DURING 2012-13
@@ -7,103 +8,423 @@
<table border="1" style="border-collapse:collapse">
<tr>
- <td rowspan="2"><p><b>Sl. No.</p></b></td><td rowspan="2"><p><b>District</p></b></td><td rowspan="2"><p><b>(Inlakhs)</p><p>for2012-13</p><p>ProjectedPopulation </p></b></td><td rowspan="2"><p><b>Adult </p><p>(Inlakhs)</p><p>Equivalentto88%</p></b></td><td rowspan="2"><p><b>requirement</p><p>(InLakhtonnes)</p><p>otalConsumption</p><p>T (@400gms/adult/day)</p></b></td><td rowspan="2"><p><b>otalRequirement</p><p>(InLakhtonnes)</p><p>(Includingseeds, </p><p>feeds&amp;wastage)</p><p>T</p></b></td><td colspan="3"><p><b>Production (Rice) (In Lakh tonnes)</p></b></td><td colspan="2"><p><b>Surplus/Defi cit (In Lakh tonnes)</p></b></td>
- </tr>
- <tr>
- <td><p><b>Kharif</p></b></td><td><p><b>Rabi</p></b></td><td><p><b>otal</p><p>T</p></b></td><td><p><b>Rice</p></b></td><td><p><b>Paddy</p></b></td>
- </tr>
- <tr>
- <td><p>1</p></td><td><p>Balasore</p></td><td><p>23.65</p></td><td><p>20.81</p></td><td><p>3.04</p></td><td><p>3.47</p></td><td><p>2.78</p></td><td><p>0.86</p></td><td><p>3.64</p></td><td><p>0.17</p></td><td><p>0.25</p></td>
- </tr>
- <tr>
- <td><p>2</p></td><td><p>Bhadrak</p></td><td><p>15.34</p></td><td><p>13.50</p></td><td><p>1.97</p></td><td><p>2.25</p></td><td><p>3.50</p></td><td><p>0.05</p></td><td><p>3.55</p></td><td><p>1.30</p></td><td><p>1.94</p></td>
- </tr>
- <tr>
- <td><p>3</p></td><td><p>Balangir</p></td><td><p>17.01</p></td><td><p>14.97</p></td><td><p>2.19</p></td><td><p>2.50</p></td><td><p>6.23</p></td><td><p>0.10</p></td><td><p>6.33</p></td><td><p>3.83</p></td><td><p>5.72</p></td>
- </tr>
- <tr>
- <td><p>4</p></td><td><p>Subarnapur</p></td><td><p>6.70</p></td><td><p>5.90</p></td><td><p>0.86</p></td><td><p>0.98</p></td><td><p>4.48</p></td><td><p>1.13</p></td><td><p>5.61</p></td><td><p>4.63</p></td><td><p>6.91</p></td>
- </tr>
- <tr>
- <td><p>5</p></td><td><p>Cuttack</p></td><td><p>26.63</p></td><td><p>23.43</p></td><td><p>3.42</p></td><td><p>3.91</p></td><td><p>3.75</p></td><td><p>0.06</p></td><td><p>3.81</p></td><td><p>-0.10</p></td><td><p>-0.15</p></td>
- </tr>
- <tr>
- <td><p>6</p></td><td><p>Jagatsingpur</p></td><td><p>11.49</p></td><td><p>10.11</p></td><td><p>1.48</p></td><td><p>1.69</p></td><td><p>2.10</p></td><td><p>0.02</p></td><td><p>2.12</p></td><td><p>0.43</p></td><td><p>0.64</p></td>
- </tr>
- <tr>
- <td><p>7</p></td><td><p>Jajpur</p></td><td><p>18.59</p></td><td><p>16.36</p></td><td><p>2.39</p></td><td><p>2.73</p></td><td><p>2.13</p></td><td><p>0.04</p></td><td><p>2.17</p></td><td><p>-0.56</p></td><td><p>-0.84</p></td>
- </tr>
- <tr>
- <td><p>8</p></td><td><p>Kendrapara</p></td><td><p>14.62</p></td><td><p>12.87</p></td><td><p>1.88</p></td><td><p>2.15</p></td><td><p>2.60</p></td><td><p>0.07</p></td><td><p>2.67</p></td><td><p>0.52</p></td><td><p>0.78</p></td>
- </tr>
- <tr>
- <td><p>9</p></td><td><p>Dhenkanal</p></td><td><p>12.13</p></td><td><p>10.67</p></td><td><p>1.56</p></td><td><p>1.78</p></td><td><p>2.26</p></td><td><p>0.02</p></td><td><p>2.28</p></td><td><p>0.50</p></td><td><p>0.75</p></td>
- </tr>
- <tr>
- <td><p>10</p></td><td><p>Angul</p></td><td><p>12.93</p></td><td><p>11.38</p></td><td><p>1.66</p></td><td><p>1.90</p></td><td><p>1.73</p></td><td><p>0.02</p></td><td><p>1.75</p></td><td><p>-0.15</p></td><td><p>-0.22</p></td>
- </tr>
- <tr>
- <td><p>11</p></td><td><p>Ganjam</p></td><td><p>35.77</p></td><td><p>31.48</p></td><td><p>4.60</p></td><td><p>5.26</p></td><td><p>4.57</p></td><td><p>0.00</p></td><td><p>4.57</p></td><td><p>-0.69</p></td><td><p>-1.03</p></td>
- </tr>
- <tr>
- <td><p>12</p></td><td><p>Gajapati</p></td><td><p>5.85</p></td><td><p>5.15</p></td><td><p>0.75</p></td><td><p>0.86</p></td><td><p>0.68</p></td><td><p>0.01</p></td><td><p>0.69</p></td><td><p>-0.17</p></td><td><p>-0.25</p></td>
- </tr>
- <tr>
- <td><p>13</p></td><td><p>Kalahandi</p></td><td><p>16.12</p></td><td><p>14.19</p></td><td><p>2.07</p></td><td><p>2.37</p></td><td><p>5.42</p></td><td><p>1.13</p></td><td><p>6.55</p></td><td><p>4.18</p></td><td><p>6.24</p></td>
- </tr>
- <tr>
- <td><p>14</p></td><td><p>Nuapada</p></td><td><p>6.18</p></td><td><p>5.44</p></td><td><p>0.79</p></td><td><p>0.90</p></td><td><p>1.98</p></td><td><p>0.08</p></td><td><p>2.06</p></td><td><p>1.16</p></td><td><p>1.73</p></td>
- </tr>
- <tr>
- <td><p>15</p></td><td><p>Keonjhar</p></td><td><p>18.42</p></td><td><p>16.21</p></td><td><p>2.37</p></td><td><p>2.71</p></td><td><p>2.76</p></td><td><p>0.08</p></td><td><p>2.84</p></td><td><p>0.13</p></td><td><p>0.19</p></td>
- </tr>
- <tr>
- <td><p>16</p></td><td><p>Koraput</p></td><td><p>14.09</p></td><td><p>12.40</p></td><td><p>1.81</p></td><td><p>2.07</p></td><td><p>2.08</p></td><td><p>0.34</p></td><td><p>2.42</p></td><td><p>0.35</p></td><td><p>0.52</p></td>
- </tr>
- <tr>
- <td><p>17</p></td><td><p>Malkangiri</p></td><td><p>6.31</p></td><td><p>5.55</p></td><td><p>0.81</p></td><td><p>0.93</p></td><td><p>1.78</p></td><td><p>0.04</p></td><td><p>1.82</p></td><td><p>0.89</p></td><td><p>1.33</p></td>
- </tr>
- <tr>
- <td><p>18</p></td><td><p>Nabarangpur</p></td><td><p>12.50</p></td><td><p>11.00</p></td><td><p>1.61</p></td><td><p>1.84</p></td><td><p>3.26</p></td><td><p>0.02</p></td><td><p>3.28</p></td><td><p>1.44</p></td><td><p>2.15</p></td>
- </tr>
- <tr>
- <td><p>19</p></td><td><p>Rayagada</p></td><td><p>9.83</p></td><td><p>8.65</p></td><td><p>1.26</p></td><td><p>1.44</p></td><td><p>1.15</p></td><td><p>0.03</p></td><td><p>1.18</p></td><td><p>-0.26</p></td><td><p>-0.39</p></td>
- </tr>
- <tr>
- <td><p>20</p></td><td><p>Mayurbhanj</p></td><td><p>25.61</p></td><td><p>22.54</p></td><td><p>3.29</p></td><td><p>3.76</p></td><td><p>4.90</p></td><td><p>0.06</p></td><td><p>4.96</p></td><td><p>1.20</p></td><td><p>1.79</p></td>
- </tr>
- <tr>
- <td><p>21</p></td><td><p>Kandhamal</p></td><td><p>7.45</p></td><td><p>6.56</p></td><td><p>0.96</p></td><td><p>1.10</p></td><td><p>0.70</p></td><td><p>0.01</p></td><td><p>0.71</p></td><td><p>-0.39</p></td><td><p>-0.58</p></td>
- </tr>
- <tr>
- <td><p>22</p></td><td><p>Boudh</p></td><td><p>4.51</p></td><td><p>3.97</p></td><td><p>0.58</p></td><td><p>0.66</p></td><td><p>1.73</p></td><td><p>0.03</p></td><td><p>1.76</p></td><td><p>1.10</p></td><td><p>1.64</p></td>
- </tr>
- <tr>
- <td><p>23</p></td><td><p>Puri</p></td><td><p>17.29</p></td><td><p>15.22</p></td><td><p>2.22</p></td><td><p>2.54</p></td><td><p>2.45</p></td><td><p>0.99</p></td><td><p>3.44</p></td><td><p>0.90</p></td><td><p>1.34</p></td>
- </tr>
- <tr>
- <td><p>24</p></td><td><p>Khordha</p></td><td><p>23.08</p></td><td><p>20.31</p></td><td><p>2.97</p></td><td><p>3.39</p></td><td><p>2.02</p></td><td><p>0.03</p></td><td><p>2.05</p></td><td><p>-1.34</p></td><td><p>-2.00</p></td>
- </tr>
- <tr>
- <td><p>25</p></td><td><p>Nayagarh</p></td><td><p>9.78</p></td><td><p>8.61</p></td><td><p>1.26</p></td><td><p>1.44</p></td><td><p>2.10</p></td><td><p>0.00</p></td><td><p>2.10</p></td><td><p>0.66</p></td><td><p>0.99</p></td>
- </tr>
- <tr>
- <td><p>26</p></td><td><p>Sambalpur</p></td><td><p>10.62</p></td><td><p>9.35</p></td><td><p>1.37</p></td><td><p>1.57</p></td><td><p>3.45</p></td><td><p>0.71</p></td><td><p>4.16</p></td><td><p>2.59</p></td><td><p>3.87</p></td>
- </tr>
- <tr>
- <td><p>27</p></td><td><p>Bargarh</p></td><td><p>15.00</p></td><td><p>13.20</p></td><td><p>1.93</p></td><td><p>2.21</p></td><td><p>6.87</p></td><td><p>2.65</p></td><td><p>9.52</p></td><td><p>7.31</p></td><td><p>10.91</p></td>
- </tr>
- <tr>
- <td><p>28</p></td><td><p>Deogarh</p></td><td><p>3.18</p></td><td><p>2.80</p></td><td><p>0.41</p></td><td><p>0.47</p></td><td><p>1.12</p></td><td><p>0.07</p></td><td><p>1.19</p></td><td><p>0.72</p></td><td><p>1.07</p></td>
- </tr>
- <tr>
- <td><p>29</p></td><td><p>Jharsuguda</p></td><td><p>5.91</p></td><td><p>5.20</p></td><td><p>0.76</p></td><td><p>0.87</p></td><td><p>0.99</p></td><td><p>0.01</p></td><td><p>1.00</p></td><td><p>0.13</p></td><td><p>0.19</p></td>
- </tr>
- <tr>
- <td><p>30</p></td><td><p>Sundargarh</p></td><td><p>21.21</p></td><td><p>18.66</p></td><td><p>2.72</p></td><td><p>3.11</p></td><td><p>4.72</p></td><td><p>0.02</p></td><td><p>4.74</p></td><td><p>1.63</p></td><td><p>2.43</p></td>
- </tr>
- <tr>
- <td colspan="2"><p><b>ODISHA</p></b></td><td><p><b>427.80</p></b></td><td><p><b>376.49</p></b></td><td><p><b>54.99</p></b></td><td><p><b>62.86</p></b></td><td><p><b>86.29</p></b></td><td><p><b>8.68</p></b></td><td><p><b>94.97</p></b></td><td><p><b>32.11</p></b></td><td><p><b>47.92</p></b></td>
+ <td rowspan="2"><p><b>Sl. No.</p></b></td>
+ <td rowspan="2"><p><b>District</p></b></td>
+ <td rowspan="2"><p><b>(Inlakhs)</p><p>for2012-13</p><p>ProjectedPopulation </p></b></td>
+ <td rowspan="2"><p><b>Adult </p><p>(Inlakhs)</p><p>Equivalentto88%</p></b></td>
+ <td rowspan="2"><p><b>requirement</p><p>(InLakhtonnes)</p><p>otalConsumption</p><p>T (@400gms/adult/day)</p></b></td>
+ <td rowspan="2"><p><b>otalRequirement</p><p>(InLakhtonnes)</p><p>(Includingseeds, </p><p>feeds&amp;wastage)</p><p>T</p></b></td>
+ <td colspan="3"><p><b>Production (Rice) (In Lakh tonnes)</p></b></td>
+ <td colspan="2"><p><b>Surplus/Defi cit (In Lakh tonnes)</p></b></td>
+ </tr>
+ <tr>
+ <td><p><b>Kharif</p></b></td>
+ <td><p><b>Rabi</p></b></td>
+ <td><p><b>otal</p><p>T</p></b></td>
+ <td><p><b>Rice</p></b></td>
+ <td><p><b>Paddy</p></b></td>
+ </tr>
+ <tr>
+ <td><p>1</p></td>
+ <td><p>Balasore</p></td>
+ <td><p>23.65</p></td>
+ <td><p>20.81</p></td>
+ <td><p>3.04</p></td>
+ <td><p>3.47</p></td>
+ <td><p>2.78</p></td>
+ <td><p>0.86</p></td>
+ <td><p>3.64</p></td>
+ <td><p>0.17</p></td>
+ <td><p>0.25</p></td>
+ </tr>
+ <tr>
+ <td><p>2</p></td>
+ <td><p>Bhadrak</p></td>
+ <td><p>15.34</p></td>
+ <td><p>13.50</p></td>
+ <td><p>1.97</p></td>
+ <td><p>2.25</p></td>
+ <td><p>3.50</p></td>
+ <td><p>0.05</p></td>
+ <td><p>3.55</p></td>
+ <td><p>1.30</p></td>
+ <td><p>1.94</p></td>
+ </tr>
+ <tr>
+ <td><p>3</p></td>
+ <td><p>Balangir</p></td>
+ <td><p>17.01</p></td>
+ <td><p>14.97</p></td>
+ <td><p>2.19</p></td>
+ <td><p>2.50</p></td>
+ <td><p>6.23</p></td>
+ <td><p>0.10</p></td>
+ <td><p>6.33</p></td>
+ <td><p>3.83</p></td>
+ <td><p>5.72</p></td>
+ </tr>
+ <tr>
+ <td><p>4</p></td>
+ <td><p>Subarnapur</p></td>
+ <td><p>6.70</p></td>
+ <td><p>5.90</p></td>
+ <td><p>0.86</p></td>
+ <td><p>0.98</p></td>
+ <td><p>4.48</p></td>
+ <td><p>1.13</p></td>
+ <td><p>5.61</p></td>
+ <td><p>4.63</p></td>
+ <td><p>6.91</p></td>
+ </tr>
+ <tr>
+ <td><p>5</p></td>
+ <td><p>Cuttack</p></td>
+ <td><p>26.63</p></td>
+ <td><p>23.43</p></td>
+ <td><p>3.42</p></td>
+ <td><p>3.91</p></td>
+ <td><p>3.75</p></td>
+ <td><p>0.06</p></td>
+ <td><p>3.81</p></td>
+ <td><p>-0.10</p></td>
+ <td><p>-0.15</p></td>
+ </tr>
+ <tr>
+ <td><p>6</p></td>
+ <td><p>Jagatsingpur</p></td>
+ <td><p>11.49</p></td>
+ <td><p>10.11</p></td>
+ <td><p>1.48</p></td>
+ <td><p>1.69</p></td>
+ <td><p>2.10</p></td>
+ <td><p>0.02</p></td>
+ <td><p>2.12</p></td>
+ <td><p>0.43</p></td>
+ <td><p>0.64</p></td>
+ </tr>
+ <tr>
+ <td><p>7</p></td>
+ <td><p>Jajpur</p></td>
+ <td><p>18.59</p></td>
+ <td><p>16.36</p></td>
+ <td><p>2.39</p></td>
+ <td><p>2.73</p></td>
+ <td><p>2.13</p></td>
+ <td><p>0.04</p></td>
+ <td><p>2.17</p></td>
+ <td><p>-0.56</p></td>
+ <td><p>-0.84</p></td>
+ </tr>
+ <tr>
+ <td><p>8</p></td>
+ <td><p>Kendrapara</p></td>
+ <td><p>14.62</p></td>
+ <td><p>12.87</p></td>
+ <td><p>1.88</p></td>
+ <td><p>2.15</p></td>
+ <td><p>2.60</p></td>
+ <td><p>0.07</p></td>
+ <td><p>2.67</p></td>
+ <td><p>0.52</p></td>
+ <td><p>0.78</p></td>
+ </tr>
+ <tr>
+ <td><p>9</p></td>
+ <td><p>Dhenkanal</p></td>
+ <td><p>12.13</p></td>
+ <td><p>10.67</p></td>
+ <td><p>1.56</p></td>
+ <td><p>1.78</p></td>
+ <td><p>2.26</p></td>
+ <td><p>0.02</p></td>
+ <td><p>2.28</p></td>
+ <td><p>0.50</p></td>
+ <td><p>0.75</p></td>
+ </tr>
+ <tr>
+ <td><p>10</p></td>
+ <td><p>Angul</p></td>
+ <td><p>12.93</p></td>
+ <td><p>11.38</p></td>
+ <td><p>1.66</p></td>
+ <td><p>1.90</p></td>
+ <td><p>1.73</p></td>
+ <td><p>0.02</p></td>
+ <td><p>1.75</p></td>
+ <td><p>-0.15</p></td>
+ <td><p>-0.22</p></td>
+ </tr>
+ <tr>
+ <td><p>11</p></td>
+ <td><p>Ganjam</p></td>
+ <td><p>35.77</p></td>
+ <td><p>31.48</p></td>
+ <td><p>4.60</p></td>
+ <td><p>5.26</p></td>
+ <td><p>4.57</p></td>
+ <td><p>0.00</p></td>
+ <td><p>4.57</p></td>
+ <td><p>-0.69</p></td>
+ <td><p>-1.03</p></td>
+ </tr>
+ <tr>
+ <td><p>12</p></td>
+ <td><p>Gajapati</p></td>
+ <td><p>5.85</p></td>
+ <td><p>5.15</p></td>
+ <td><p>0.75</p></td>
+ <td><p>0.86</p></td>
+ <td><p>0.68</p></td>
+ <td><p>0.01</p></td>
+ <td><p>0.69</p></td>
+ <td><p>-0.17</p></td>
+ <td><p>-0.25</p></td>
+ </tr>
+ <tr>
+ <td><p>13</p></td>
+ <td><p>Kalahandi</p></td>
+ <td><p>16.12</p></td>
+ <td><p>14.19</p></td>
+ <td><p>2.07</p></td>
+ <td><p>2.37</p></td>
+ <td><p>5.42</p></td>
+ <td><p>1.13</p></td>
+ <td><p>6.55</p></td>
+ <td><p>4.18</p></td>
+ <td><p>6.24</p></td>
+ </tr>
+ <tr>
+ <td><p>14</p></td>
+ <td><p>Nuapada</p></td>
+ <td><p>6.18</p></td>
+ <td><p>5.44</p></td>
+ <td><p>0.79</p></td>
+ <td><p>0.90</p></td>
+ <td><p>1.98</p></td>
+ <td><p>0.08</p></td>
+ <td><p>2.06</p></td>
+ <td><p>1.16</p></td>
+ <td><p>1.73</p></td>
+ </tr>
+ <tr>
+ <td><p>15</p></td>
+ <td><p>Keonjhar</p></td>
+ <td><p>18.42</p></td>
+ <td><p>16.21</p></td>
+ <td><p>2.37</p></td>
+ <td><p>2.71</p></td>
+ <td><p>2.76</p></td>
+ <td><p>0.08</p></td>
+ <td><p>2.84</p></td>
+ <td><p>0.13</p></td>
+ <td><p>0.19</p></td>
+ </tr>
+ <tr>
+ <td><p>16</p></td>
+ <td><p>Koraput</p></td>
+ <td><p>14.09</p></td>
+ <td><p>12.40</p></td>
+ <td><p>1.81</p></td>
+ <td><p>2.07</p></td>
+ <td><p>2.08</p></td>
+ <td><p>0.34</p></td>
+ <td><p>2.42</p></td>
+ <td><p>0.35</p></td>
+ <td><p>0.52</p></td>
+ </tr>
+ <tr>
+ <td><p>17</p></td>
+ <td><p>Malkangiri</p></td>
+ <td><p>6.31</p></td>
+ <td><p>5.55</p></td>
+ <td><p>0.81</p></td>
+ <td><p>0.93</p></td>
+ <td><p>1.78</p></td>
+ <td><p>0.04</p></td>
+ <td><p>1.82</p></td>
+ <td><p>0.89</p></td>
+ <td><p>1.33</p></td>
+ </tr>
+ <tr>
+ <td><p>18</p></td>
+ <td><p>Nabarangpur</p></td>
+ <td><p>12.50</p></td>
+ <td><p>11.00</p></td>
+ <td><p>1.61</p></td>
+ <td><p>1.84</p></td>
+ <td><p>3.26</p></td>
+ <td><p>0.02</p></td>
+ <td><p>3.28</p></td>
+ <td><p>1.44</p></td>
+ <td><p>2.15</p></td>
+ </tr>
+ <tr>
+ <td><p>19</p></td>
+ <td><p>Rayagada</p></td>
+ <td><p>9.83</p></td>
+ <td><p>8.65</p></td>
+ <td><p>1.26</p></td>
+ <td><p>1.44</p></td>
+ <td><p>1.15</p></td>
+ <td><p>0.03</p></td>
+ <td><p>1.18</p></td>
+ <td><p>-0.26</p></td>
+ <td><p>-0.39</p></td>
+ </tr>
+ <tr>
+ <td><p>20</p></td>
+ <td><p>Mayurbhanj</p></td>
+ <td><p>25.61</p></td>
+ <td><p>22.54</p></td>
+ <td><p>3.29</p></td>
+ <td><p>3.76</p></td>
+ <td><p>4.90</p></td>
+ <td><p>0.06</p></td>
+ <td><p>4.96</p></td>
+ <td><p>1.20</p></td>
+ <td><p>1.79</p></td>
+ </tr>
+ <tr>
+ <td><p>21</p></td>
+ <td><p>Kandhamal</p></td>
+ <td><p>7.45</p></td>
+ <td><p>6.56</p></td>
+ <td><p>0.96</p></td>
+ <td><p>1.10</p></td>
+ <td><p>0.70</p></td>
+ <td><p>0.01</p></td>
+ <td><p>0.71</p></td>
+ <td><p>-0.39</p></td>
+ <td><p>-0.58</p></td>
+ </tr>
+ <tr>
+ <td><p>22</p></td>
+ <td><p>Boudh</p></td>
+ <td><p>4.51</p></td>
+ <td><p>3.97</p></td>
+ <td><p>0.58</p></td>
+ <td><p>0.66</p></td>
+ <td><p>1.73</p></td>
+ <td><p>0.03</p></td>
+ <td><p>1.76</p></td>
+ <td><p>1.10</p></td>
+ <td><p>1.64</p></td>
+ </tr>
+ <tr>
+ <td><p>23</p></td>
+ <td><p>Puri</p></td>
+ <td><p>17.29</p></td>
+ <td><p>15.22</p></td>
+ <td><p>2.22</p></td>
+ <td><p>2.54</p></td>
+ <td><p>2.45</p></td>
+ <td><p>0.99</p></td>
+ <td><p>3.44</p></td>
+ <td><p>0.90</p></td>
+ <td><p>1.34</p></td>
+ </tr>
+ <tr>
+ <td><p>24</p></td>
+ <td><p>Khordha</p></td>
+ <td><p>23.08</p></td>
+ <td><p>20.31</p></td>
+ <td><p>2.97</p></td>
+ <td><p>3.39</p></td>
+ <td><p>2.02</p></td>
+ <td><p>0.03</p></td>
+ <td><p>2.05</p></td>
+ <td><p>-1.34</p></td>
+ <td><p>-2.00</p></td>
+ </tr>
+ <tr>
+ <td><p>25</p></td>
+ <td><p>Nayagarh</p></td>
+ <td><p>9.78</p></td>
+ <td><p>8.61</p></td>
+ <td><p>1.26</p></td>
+ <td><p>1.44</p></td>
+ <td><p>2.10</p></td>
+ <td><p>0.00</p></td>
+ <td><p>2.10</p></td>
+ <td><p>0.66</p></td>
+ <td><p>0.99</p></td>
+ </tr>
+ <tr>
+ <td><p>26</p></td>
+ <td><p>Sambalpur</p></td>
+ <td><p>10.62</p></td>
+ <td><p>9.35</p></td>
+ <td><p>1.37</p></td>
+ <td><p>1.57</p></td>
+ <td><p>3.45</p></td>
+ <td><p>0.71</p></td>
+ <td><p>4.16</p></td>
+ <td><p>2.59</p></td>
+ <td><p>3.87</p></td>
+ </tr>
+ <tr>
+ <td><p>27</p></td>
+ <td><p>Bargarh</p></td>
+ <td><p>15.00</p></td>
+ <td><p>13.20</p></td>
+ <td><p>1.93</p></td>
+ <td><p>2.21</p></td>
+ <td><p>6.87</p></td>
+ <td><p>2.65</p></td>
+ <td><p>9.52</p></td>
+ <td><p>7.31</p></td>
+ <td><p>10.91</p></td>
+ </tr>
+ <tr>
+ <td><p>28</p></td>
+ <td><p>Deogarh</p></td>
+ <td><p>3.18</p></td>
+ <td><p>2.80</p></td>
+ <td><p>0.41</p></td>
+ <td><p>0.47</p></td>
+ <td><p>1.12</p></td>
+ <td><p>0.07</p></td>
+ <td><p>1.19</p></td>
+ <td><p>0.72</p></td>
+ <td><p>1.07</p></td>
+ </tr>
+ <tr>
+ <td><p>29</p></td>
+ <td><p>Jharsuguda</p></td>
+ <td><p>5.91</p></td>
+ <td><p>5.20</p></td>
+ <td><p>0.76</p></td>
+ <td><p>0.87</p></td>
+ <td><p>0.99</p></td>
+ <td><p>0.01</p></td>
+ <td><p>1.00</p></td>
+ <td><p>0.13</p></td>
+ <td><p>0.19</p></td>
+ </tr>
+ <tr>
+ <td><p>30</p></td>
+ <td><p>Sundargarh</p></td>
+ <td><p>21.21</p></td>
+ <td><p>18.66</p></td>
+ <td><p>2.72</p></td>
+ <td><p>3.11</p></td>
+ <td><p>4.72</p></td>
+ <td><p>0.02</p></td>
+ <td><p>4.74</p></td>
+ <td><p>1.63</p></td>
+ <td><p>2.43</p></td>
+ </tr>
+ <tr>
+ <td colspan="2"><p><b>ODISHA</p></b></td>
+ <td><p><b>427.80</p></b></td>
+ <td><p><b>376.49</p></b></td>
+ <td><p><b>54.99</p></b></td>
+ <td><p><b>62.86</p></b></td>
+ <td><p><b>86.29</p></b></td>
+ <td><p><b>8.68</p></b></td>
+ <td><p><b>94.97</p></b></td>
+ <td><p><b>32.11</p></b></td>
+ <td><p><b>47.92</p></b></td>
</tr>
</table>
@@ -118,5 +439,6 @@
</tr>
</table>
+</div>
</body>
</html>
diff --git a/extract/test/background_lines_1.pdf.mutool.html.ref b/extract/test/background_lines_1.pdf.mutool.html.ref
index 74c4f28f..ffacb552 100644
--- a/extract/test/background_lines_1.pdf.mutool.html.ref
+++ b/extract/test/background_lines_1.pdf.mutool.html.ref
@@ -1,5 +1,6 @@
<html>
<body>
+<div>
<p>Annual Report 2009-10
@@ -13,28 +14,77 @@
<table border="1" style="border-collapse:collapse">
<tr>
- <td><p><b>State </p></b></td><td><p><b>Date </p></b></td><td><p><b>Halt stations </p></b></td><td><p><b>Halt days</p></b></td><td><p><b>Persons directly reached (in lakh)</p></b></td><td><p><b>Persons trained</p></b></td><td><p><b>Persons counseled</p></b></td><td><p><b>Persons tested for HIV</p></b></td>
+ <td><p><b>State </p></b></td>
+ <td><p><b>Date </p></b></td>
+ <td><p><b>Halt stations </p></b></td>
+ <td><p><b>Halt days</p></b></td>
+ <td><p><b>Persons directly reached (in lakh)</p></b></td>
+ <td><p><b>Persons trained</p></b></td>
+ <td><p><b>Persons counseled</p></b></td>
+ <td><p><b>Persons tested for HIV</p></b></td>
</tr>
<tr>
- <td><p>Delhi</p></td><td><p>1.12.2009</p></td><td rowspan="2"><p>8</p></td><td rowspan="2"><p>17</p></td><td rowspan="2"><p>1.29</p></td><td rowspan="2"><p>3,665</p></td><td rowspan="2"><p>2,409</p></td><td rowspan="2"><p>1,000</p></td>
+ <td><p>Delhi</p></td>
+ <td><p>1.12.2009</p></td>
+ <td rowspan="2"><p>8</p></td>
+ <td rowspan="2"><p>17</p></td>
+ <td rowspan="2"><p>1.29</p></td>
+ <td rowspan="2"><p>3,665</p></td>
+ <td rowspan="2"><p>2,409</p></td>
+ <td rowspan="2"><p>1,000</p></td>
</tr>
<tr>
- <td><p>Rajasthan</p></td><td><p>2.12.2009 to 19.12.2009</p></td>
+ <td><p>Rajasthan</p></td>
+ <td><p>2.12.2009 to 19.12.2009</p></td>
</tr>
<tr>
- <td><p>Gujarat</p></td><td><p>20.12.2009 to 3.1.2010</p></td><td><p>6</p></td><td><p>13</p></td><td><p>6.03</p></td><td><p>3,810</p></td><td><p>2,317</p></td><td><p>1,453</p></td>
+ <td><p>Gujarat</p></td>
+ <td><p>20.12.2009 to 3.1.2010</p></td>
+ <td><p>6</p></td>
+ <td><p>13</p></td>
+ <td><p>6.03</p></td>
+ <td><p>3,810</p></td>
+ <td><p>2,317</p></td>
+ <td><p>1,453</p></td>
</tr>
<tr>
- <td><p>Maharashtra</p></td><td><p>4.01.2010 to 1.2.2010</p></td><td><p>13</p></td><td><p>26</p></td><td><p>1.27</p></td><td><p>5,680</p></td><td><p>9,027</p></td><td><p>4,153</p></td>
+ <td><p>Maharashtra</p></td>
+ <td><p>4.01.2010 to 1.2.2010</p></td>
+ <td><p>13</p></td>
+ <td><p>26</p></td>
+ <td><p>1.27</p></td>
+ <td><p>5,680</p></td>
+ <td><p>9,027</p></td>
+ <td><p>4,153</p></td>
</tr>
<tr>
- <td><p>Karnataka </p></td><td><p>2.2.2010 to 22.2.2010</p></td><td><p>11</p></td><td><p>19</p></td><td><p>1.80</p></td><td><p>5,741</p></td><td><p>3,658</p></td><td><p>3,183</p></td>
+ <td><p>Karnataka </p></td>
+ <td><p>2.2.2010 to 22.2.2010</p></td>
+ <td><p>11</p></td>
+ <td><p>19</p></td>
+ <td><p>1.80</p></td>
+ <td><p>5,741</p></td>
+ <td><p>3,658</p></td>
+ <td><p>3,183</p></td>
</tr>
<tr>
- <td><p>Kerala</p></td><td><p>23.2.2010 to 11.3.2010</p></td><td><p>9</p></td><td><p>17</p></td><td><p>1.42</p></td><td><p>3,559</p></td><td><p>2,173</p></td><td><p>855</p></td>
+ <td><p>Kerala</p></td>
+ <td><p>23.2.2010 to 11.3.2010</p></td>
+ <td><p>9</p></td>
+ <td><p>17</p></td>
+ <td><p>1.42</p></td>
+ <td><p>3,559</p></td>
+ <td><p>2,173</p></td>
+ <td><p>855</p></td>
</tr>
<tr>
- <td colspan="2"><p><b>Total</p></b></td><td><p><b>47</p></b></td><td><p><b>92</p></b></td><td><p><b>11.81</p></b></td><td><p><b>22,455</p></b></td><td><p><b>19,584</p></b></td><td><p><b>10,644</p></b></td>
+ <td colspan="2"><p><b>Total</p></b></td>
+ <td><p><b>47</p></b></td>
+ <td><p><b>92</p></b></td>
+ <td><p><b>11.81</p></b></td>
+ <td><p><b>22,455</p></b></td>
+ <td><p><b>19,584</p></b></td>
+ <td><p><b>10,644</p></b></td>
</tr>
</table>
@@ -47,5 +97,6 @@
</p>
<p>29
-</p></body>
+</p></div>
+</body>
</html>
diff --git a/extract/test/background_lines_2.pdf.mutool.html.ref b/extract/test/background_lines_2.pdf.mutool.html.ref
index 03ee5855..e0207bf0 100644
--- a/extract/test/background_lines_2.pdf.mutool.html.ref
+++ b/extract/test/background_lines_2.pdf.mutool.html.ref
@@ -1,5 +1,6 @@
<html>
<body>
+<div>
<p><b>INPUT SURVEY, 1996-1997
@@ -16,72 +17,87 @@
<table border="1" style="border-collapse:collapse">
<tr>
- <td colspan="2" rowspan="2"><p><b>Sl.No</p></b></td><td colspan="2" rowspan="2"><p><b>SIZE GROUP (HA) </p></b></td><td colspan="2"><p><b>NO. OF HOLDINGS GROWING THE CROP </p></b></td><td colspan="3"><p><b>AREA UNDER THE CROP</p></b></td><td colspan="6"><p><b>AREA UNDER THE CROP TREATED WITH THE MANURE</p></b></td>
+ <td colspan="2" rowspan="2"><p><b>Sl.No</p></b></td>
+ <td colspan="2" rowspan="2"><p><b>SIZE GROUP (HA) </p></b></td>
+ <td colspan="2"><p><b>NO. OF HOLDINGS GROWING THE CROP </p></b></td>
+ <td colspan="3"><p><b>AREA UNDER THE CROP</p></b></td>
+ <td colspan="6"><p><b>AREA UNDER THE CROP TREATED WITH THE MANURE</p></b></td>
</tr>
<tr>
- <td><p><b>TOTAL NO.</p></b></td><td><p><b>NO. TREATED WITH THE MANURE</p></b></td><td><p><b>HYV</p></b></td><td><p><b>OTHERS</p></b></td><td><p><b>TOTAL</p></b></td><td colspan="2"><p><b>HYV</p></b></td><td colspan="2"><p><b>OTHERS</p></b></td><td colspan="2"><p><b>TOTAL</p></b></td>
+ <td><p><b>TOTAL NO.</p></b></td>
+ <td><p><b>NO. TREATED WITH THE MANURE</p></b></td>
+ <td><p><b>HYV</p></b></td>
+ <td><p><b>OTHERS</p></b></td>
+ <td><p><b>TOTAL</p></b></td>
+ <td colspan="2"><p><b>HYV</p></b></td>
+ <td colspan="2"><p><b>OTHERS</p></b></td>
+ <td colspan="2"><p><b>TOTAL</p></b></td>
</tr>
<tr>
- <td colspan="2"><p><b>(1)</p></b></td><td colspan="2"><p><b>(2)</p></b></td><td><p><b>(3)</p></b></td><td><p><b>(4)</p></b></td><td><p><b>(5)</p></b></td><td><p><b>(6)</p></b></td><td><p><b>(7)</p></b></td><td colspan="2"><p><b>(8)</p></b></td><td colspan="2"><p><b>(9)</p></b></td><td colspan="2"><p><b>(10)</p></b></td>
+ <td colspan="2"><p><b>(1)</p></b></td>
+ <td colspan="2"><p><b>(2)</p></b></td>
+ <td><p><b>(3)</p></b></td>
+ <td><p><b>(4)</p></b></td>
+ <td><p><b>(5)</p></b></td>
+ <td><p><b>(6)</p></b></td>
+ <td><p><b>(7)</p></b></td>
+ <td colspan="2"><p><b>(8)</p></b></td>
+ <td colspan="2"><p><b>(9)</p></b></td>
+ <td colspan="2"><p><b>(10)</p></b></td>
</tr>
<tr>
- <td rowspan="3"><p>1</p></td><td colspan="14" rowspan="3"><p>MARGINAL (BELOW 1.0)</p><p><b>I</b> 39053 0 12142 3322 15464 0 0 0</p><p><b>UI</b> 7429 0 2088 1560 3648 0 0 0</p><p><b>T</b> 46484 0 14230 4882 19112 0 0 0</p></td>
+ <td rowspan="3"><p>1</p></td>
+ <td colspan="14" rowspan="3"><p>MARGINAL (BELOW 1.0)</p><p><b>I</b> 39053 0 12142 3322 15464 0 0 0</p><p><b>UI</b> 7429 0 2088 1560 3648 0 0 0</p><p><b>T</b> 46484 0 14230 4882 19112 0 0 0</p></td>
</tr>
<tr>
-
</tr>
<tr>
-
</tr>
<tr>
- <td rowspan="3"><p>2</p></td><td colspan="14" rowspan="3"><p>SMALL (1.0 - 1.99)</p><p><b>I</b> 20341 0 16685 1631 18316 0 0 0</p><p><b>UI</b> 6854 0 4594 1885 6479 0 0 0</p><p><b>T</b> 27197 0 21279 3516 24795 0 0 0</p></td>
+ <td rowspan="3"><p>2</p></td>
+ <td colspan="14" rowspan="3"><p>SMALL (1.0 - 1.99)</p><p><b>I</b> 20341 0 16685 1631 18316 0 0 0</p><p><b>UI</b> 6854 0 4594 1885 6479 0 0 0</p><p><b>T</b> 27197 0 21279 3516 24795 0 0 0</p></td>
</tr>
<tr>
-
</tr>
<tr>
-
</tr>
<tr>
- <td rowspan="3"><p>3</p></td><td colspan="14" rowspan="3"><p>SEMI-MEDIUM (2.0 - 3.99)</p><p><b>I</b> 20800 0 16991 7643 24634 0 0 0</p><p><b>UI</b> 5856 0 1017 4819 5836 0 0 0</p><p><b>T</b> 26555 0 18008 12462 30470 0 0 0</p></td>
+ <td rowspan="3"><p>3</p></td>
+ <td colspan="14" rowspan="3"><p>SEMI-MEDIUM (2.0 - 3.99)</p><p><b>I</b> 20800 0 16991 7643 24634 0 0 0</p><p><b>UI</b> 5856 0 1017 4819 5836 0 0 0</p><p><b>T</b> 26555 0 18008 12462 30470 0 0 0</p></td>
</tr>
<tr>
-
</tr>
<tr>
-
</tr>
<tr>
- <td rowspan="3"><p>4</p></td><td colspan="14" rowspan="3"><p>MEDIUM (4.0 - 9.99)</p><p><b>I</b> 11986 0 17576 4120 21696 0 0 0</p><p><b>UI</b> 4615 0 1446 6227 7673 0 0 0</p><p><b>T</b> 16312 0 19022 10347 29369 0 0 0</p></td>
+ <td rowspan="3"><p>4</p></td>
+ <td colspan="14" rowspan="3"><p>MEDIUM (4.0 - 9.99)</p><p><b>I</b> 11986 0 17576 4120 21696 0 0 0</p><p><b>UI</b> 4615 0 1446 6227 7673 0 0 0</p><p><b>T</b> 16312 0 19022 10347 29369 0 0 0</p></td>
</tr>
<tr>
-
</tr>
<tr>
-
</tr>
<tr>
- <td rowspan="3"><p>5</p></td><td colspan="14" rowspan="3"><p>LARGE (10 AND ABOVE)</p><p><b>I</b> 2005 0 3671 639 4310 0 0 0</p><p><b>UI</b> 521 0 611 831 1442 0 0 0</p><p><b>T</b> 2485 0 4282 1470 5752 0 0 0</p></td>
+ <td rowspan="3"><p>5</p></td>
+ <td colspan="14" rowspan="3"><p>LARGE (10 AND ABOVE)</p><p><b>I</b> 2005 0 3671 639 4310 0 0 0</p><p><b>UI</b> 521 0 611 831 1442 0 0 0</p><p><b>T</b> 2485 0 4282 1470 5752 0 0 0</p></td>
</tr>
<tr>
-
</tr>
<tr>
-
</tr>
<tr>
- <td rowspan="3"><p>6</p></td><td colspan="14" rowspan="3"><p>ALL GROUPS</p><p><b>I</b> 94185 0 67065 17355 84420 0 0 0</p><p><b>UI</b> 25275 0 9756 15322 25078 0 0 0</p><p><b>T</b> 119033 0 76821 32677 109498 0 0 0</p></td>
+ <td rowspan="3"><p>6</p></td>
+ <td colspan="14" rowspan="3"><p>ALL GROUPS</p><p><b>I</b> 94185 0 67065 17355 84420 0 0 0</p><p><b>UI</b> 25275 0 9756 15322 25078 0 0 0</p><p><b>T</b> 119033 0 76821 32677 109498 0 0 0</p></td>
</tr>
<tr>
-
</tr>
<tr>
-
</tr>
</table>
<p><b>NOTE: I-IRRIGATED UI-UNIRRIGATED T = TOTAL OF I &amp; UI IN CASE OF COLUMNS 3 AND 4
-</p></b></body>
+</p></b></div>
+</body>
</html>
diff --git a/extract/test/column_span_1.pdf.mutool.html.ref b/extract/test/column_span_1.pdf.mutool.html.ref
index aebd9b96..79090e9d 100644
--- a/extract/test/column_span_1.pdf.mutool.html.ref
+++ b/extract/test/column_span_1.pdf.mutool.html.ref
@@ -1,5 +1,6 @@
<html>
<body>
+<div>
<p> <b>Rate of Accidental Deaths &amp; Suicides and Population Growth During 1967 to 2013 </b>
@@ -7,159 +8,506 @@
<table border="1" style="border-collapse:collapse">
<tr>
- <td rowspan="50"></td><td rowspan="2"><p><b>Sl. No. </p></b></td><td rowspan="2"><p><b>Year </p></b></td><td rowspan="2"><p><b>Population (in Lakh) </p></b></td><td colspan="2"><p><b>Accidental Deaths </p></b></td><td colspan="2"><p><b>Suicides </p></b></td><td rowspan="2"><p><b>Percentage Population growth </p></b></td><td rowspan="50"></td>
- </tr>
- <tr>
- <td><p><b>Incidence </p></b></td><td><p><b>Rate </p></b></td><td><p><b>Incidence </p></b></td><td><p><b>Rate </p></b></td>
- </tr>
- <tr>
- <td><p><b>(1) </p></b></td><td><p><b>(2) </p></b></td><td><p><b>(3) </p></b></td><td><p><b>(4) </p></b></td><td><p><b>(5) </p></b></td><td><p><b>(6) </p></b></td><td><p><b>(7) </p></b></td><td><p><b>(8) </p></b></td>
- </tr>
- <tr>
- <td><p>1. </p></td><td><p>1967 </p></td><td><p>4999 </p></td><td><p>126762 </p></td><td><p>25.4 </p></td><td><p>38829 </p></td><td><p>7.8 </p></td><td><p>2.2 </p></td>
- </tr>
- <tr>
- <td><p>2. </p></td><td><p>1968 </p></td><td><p>5111 </p></td><td><p>126232 </p></td><td><p>24.7 </p></td><td><p>40688 </p></td><td><p>8.0 </p></td><td><p>2.2 </p></td>
- </tr>
- <tr>
- <td><p>3. </p></td><td><p>1969 </p></td><td><p>5225 </p></td><td><p>130755 </p></td><td><p>25.0 </p></td><td><p>43633 </p></td><td><p>8.4 </p></td><td><p>2.2 </p></td>
- </tr>
- <tr>
- <td><p>4. </p></td><td><p>1970 </p></td><td><p>5343 </p></td><td><p>139752 </p></td><td><p>26.2 </p></td><td><p>48428 </p></td><td><p>9.1 </p></td><td><p>2.3 </p></td>
- </tr>
- <tr>
- <td><p>5. </p></td><td><p>1971 </p></td><td><p>5512 </p></td><td><p>105601 </p></td><td><p>19.2 </p></td><td><p>43675 </p></td><td><p>7.9 </p></td><td><p>3.2 </p></td>
- </tr>
- <tr>
- <td><p>6. </p></td><td><p>1972 </p></td><td><p>5635 </p></td><td><p>106184 </p></td><td><p>18.8 </p></td><td><p>43601 </p></td><td><p>7.7 </p></td><td><p>2.2 </p></td>
- </tr>
- <tr>
- <td><p>7. </p></td><td><p>1973 </p></td><td><p>5759 </p></td><td><p>130654 </p></td><td><p>22.7 </p></td><td><p>40807 </p></td><td><p>7.1 </p></td><td><p>2.2 </p></td>
- </tr>
- <tr>
- <td><p>8. </p></td><td><p>1974 </p></td><td><p>5883 </p></td><td><p>110624 </p></td><td><p>18.8 </p></td><td><p>46008 </p></td><td><p>7.8 </p></td><td><p>2.2 </p></td>
- </tr>
- <tr>
- <td><p>9. </p></td><td><p>1975 </p></td><td><p>6008 </p></td><td><p>113016 </p></td><td><p>18.8 </p></td><td><p>42890 </p></td><td><p>7.1 </p></td><td><p>2.1 </p></td>
- </tr>
- <tr>
- <td><p>10. </p></td><td><p>1976 </p></td><td><p>6136 </p></td><td><p>111611 </p></td><td><p>18.2 </p></td><td><p>41415 </p></td><td><p>6.7 </p></td><td><p>2.1 </p></td>
- </tr>
- <tr>
- <td><p>11. </p></td><td><p>1977 </p></td><td><p>6258 </p></td><td><p>117338 </p></td><td><p>18.8 </p></td><td><p>39718 </p></td><td><p>6.3 </p></td><td><p>2.0 </p></td>
- </tr>
- <tr>
- <td><p>12. </p></td><td><p>1978 </p></td><td><p>6384 </p></td><td><p>118594 </p></td><td><p>18.6 </p></td><td><p>40207 </p></td><td><p>6.3 </p></td><td><p>2.0 </p></td>
- </tr>
- <tr>
- <td><p>13. </p></td><td><p>1979 </p></td><td><p>6510 </p></td><td><p>108987 </p></td><td><p>16.7 </p></td><td><p>38217 </p></td><td><p>5.9 </p></td><td><p>2.0 </p></td>
- </tr>
- <tr>
- <td><p>14. </p></td><td><p>1980 </p></td><td><p>6636 </p></td><td><p>116912 </p></td><td><p>17.6 </p></td><td><p>41663 </p></td><td><p>6.3 </p></td><td><p>1.9 </p></td>
- </tr>
- <tr>
- <td><p>15. </p></td><td><p>1981 </p></td><td><p>6840 </p></td><td><p>122221 </p></td><td><p>17.9 </p></td><td><p>40245 </p></td><td><p>5.9 </p></td><td><p>3.1 </p></td>
- </tr>
- <tr>
- <td><p>16. </p></td><td><p>1982 </p></td><td><p>7052 </p></td><td><p>125993 </p></td><td><p>17.9 </p></td><td><p>44732 </p></td><td><p>6.3 </p></td><td><p>3.1 </p></td>
- </tr>
- <tr>
- <td><p>17. </p></td><td><p>1983 </p></td><td><p>7204 </p></td><td><p>128576 </p></td><td><p>17.8 </p></td><td><p>46579 </p></td><td><p>6.5 </p></td><td><p>2.2 </p></td>
- </tr>
- <tr>
- <td><p>18. </p></td><td><p>1984 </p></td><td><p>7356 </p></td><td><p>134628 </p></td><td><p>18.3 </p></td><td><p>50571 </p></td><td><p>6.9 </p></td><td><p>2.1 </p></td>
- </tr>
- <tr>
- <td><p>19. </p></td><td><p>1985 </p></td><td><p>7509 </p></td><td><p>139657 </p></td><td><p>18.6 </p></td><td><p>52811 </p></td><td><p>7.0 </p></td><td><p>2.1 </p></td>
- </tr>
- <tr>
- <td><p>20. </p></td><td><p>1986 </p></td><td><p>7661 </p></td><td><p>147023 </p></td><td><p>19.2 </p></td><td><p>54357 </p></td><td><p>7.1 </p></td><td><p>2.0 </p></td>
- </tr>
- <tr>
- <td><p>21. </p></td><td><p>1987 </p></td><td><p>7814 </p></td><td><p>152314 </p></td><td><p>19.5 </p></td><td><p>58568 </p></td><td><p>7.5 </p></td><td><p>2.0 </p></td>
- </tr>
- <tr>
- <td><p>22. </p></td><td><p>1988 </p></td><td><p>7966 </p></td><td><p>163522 </p></td><td><p>20.5 </p></td><td><p>64270 </p></td><td><p>8.1 </p></td><td><p>1.9 </p></td>
- </tr>
- <tr>
- <td><p>23. </p></td><td><p>1989 </p></td><td><p>8118 </p></td><td><p>169066 </p></td><td><p>20.8 </p></td><td><p>68744 </p></td><td><p>8.5 </p></td><td><p>1.9 </p></td>
- </tr>
- <tr>
- <td><p>24. </p></td><td><p>1990 </p></td><td><p>8270 </p></td><td><p>174401 </p></td><td><p>21.1 </p></td><td><p>73911 </p></td><td><p>8.9 </p></td><td><p>1.9 </p></td>
- </tr>
- <tr>
- <td><p>25. </p></td><td><p>1991 </p></td><td><p>8496 </p></td><td><p>188003 </p></td><td><p>22.1 </p></td><td><p>78450 </p></td><td><p>9.2 </p></td><td><p>2.7 </p></td>
- </tr>
- <tr>
- <td><p>26. </p></td><td><p>1992 </p></td><td><p>8677 </p></td><td><p>194910 </p></td><td><p>22.5 </p></td><td><p>80149 </p></td><td><p>9.2 </p></td><td><p>2.1 </p></td>
- </tr>
- <tr>
- <td><p>27. </p></td><td><p>1993 </p></td><td><p>8838 </p></td><td><p>192357 </p></td><td><p>21.8 </p></td><td><p>84244 </p></td><td><p>9.5 </p></td><td><p>1.9 </p></td>
- </tr>
- <tr>
- <td><p>28. </p></td><td><p>1994 </p></td><td><p>8997 </p></td><td><p>190435 </p></td><td><p>21.2 </p></td><td><p>89195 </p></td><td><p>9.9 </p></td><td><p>1.8 </p></td>
- </tr>
- <tr>
- <td><p>29. </p></td><td><p>1995 </p></td><td><p>9160 </p></td><td><p>222487 </p></td><td><p>24.3 </p></td><td><p>89178 </p></td><td><p>9.7 </p></td><td><p>1.8 </p></td>
- </tr>
- <tr>
- <td><p>30. </p></td><td><p>1996 </p></td><td><p>9319 </p></td><td><p>220094 </p></td><td><p>23.6 </p></td><td><p>88241 </p></td><td><p>9.5 </p></td><td><p>1.7 </p></td>
- </tr>
- <tr>
- <td><p>31. </p></td><td><p>1997 </p></td><td><p>9552 </p></td><td><p>233903 </p></td><td><p>24.5 </p></td><td><p>95829 </p></td><td><p>10.0 </p></td><td><p>2.5 </p></td>
- </tr>
- <tr>
- <td><p>32. </p></td><td><p>1998 </p></td><td><p>9709 </p></td><td><p>258409 </p></td><td><p>26.6 </p></td><td><p>104713 </p></td><td><p>10.8 </p></td><td><p>1.6 </p></td>
- </tr>
- <tr>
- <td><p>33. </p></td><td><p>1999 </p></td><td><p>9866 </p></td><td><p>271918 </p></td><td><p>27.6 </p></td><td><p>110587 </p></td><td><p>11.2 </p></td><td><p>1.6 </p></td>
- </tr>
- <tr>
- <td><p>34. </p></td><td><p>2000 </p></td><td><p>10021 </p></td><td><p>255883 </p></td><td><p>25.5 </p></td><td><p>108593 </p></td><td><p>10.8 </p></td><td><p>1.6 </p></td>
- </tr>
- <tr>
- <td><p>35. </p></td><td><p>2001 </p></td><td><p>10270 </p></td><td><p>271019 </p></td><td><p>26.4 </p></td><td><p>108506 </p></td><td><p>10.6 </p></td><td><p>2.5 </p></td>
- </tr>
- <tr>
- <td><p>36. </p></td><td><p>2002 </p></td><td><p>10506 </p></td><td><p>260122 </p></td><td><p>24.8 </p></td><td><p>110417 </p></td><td><p>10.5 </p></td><td><p>2.3 </p></td>
- </tr>
- <tr>
- <td><p>37. </p></td><td><p>2003 </p></td><td><p>10682 </p></td><td><p>259625 </p></td><td><p>24.3 </p></td><td><p>110851 </p></td><td><p>10.4 </p></td><td><p>1.7 </p></td>
- </tr>
- <tr>
- <td><p>38. </p></td><td><p>2004 </p></td><td><p>10856 </p></td><td><p>277263 </p></td><td><p>25.5 </p></td><td><p>113697 </p></td><td><p>10.5 </p></td><td><p>1.6 </p></td>
- </tr>
- <tr>
- <td><p>39. </p></td><td><p>2005 </p></td><td><p>11028 </p></td><td><p>294175 </p></td><td><p>26.7 </p></td><td><p>113914 </p></td><td><p>10.3 </p></td><td><p>1.6 </p></td>
- </tr>
- <tr>
- <td><p>40. </p></td><td><p>2006 </p></td><td><p>11198 </p></td><td><p>314704 </p></td><td><p>28.1 </p></td><td><p>118112 </p></td><td><p>10.5 </p></td><td><p>1.5 </p></td>
- </tr>
- <tr>
- <td><p>41. </p></td><td><p>2007 </p></td><td><p>11366 </p></td><td><p>340794 </p></td><td><p>30.0 </p></td><td><p>122637 </p></td><td><p>10.8 </p></td><td><p>1.5 </p></td>
- </tr>
- <tr>
- <td><p>42. </p></td><td><p>2008 </p></td><td><p>11531 </p></td><td><p>342309 </p></td><td><p>29.7 </p></td><td><p>125017 </p></td><td><p>10.8 </p></td><td><p>1.4 </p></td>
- </tr>
- <tr>
- <td><p>43. </p></td><td><p>2009 </p></td><td><p>11694 </p></td><td><p>357021 </p></td><td><p>30.5 </p></td><td><p>127151 </p></td><td><p>10.9 </p></td><td><p>1.4 </p></td>
- </tr>
- <tr>
- <td><p>44. </p></td><td><p>2010 </p></td><td><p>11858 </p></td><td><p>384649 </p></td><td><p>32.4 </p></td><td><p>134599 </p></td><td><p>11.4 </p></td><td><p>1.4 </p></td>
- </tr>
- <tr>
- <td><p>45. </p></td><td><p>2011 </p></td><td><p>12102 </p></td><td><p>390884 </p></td><td><p>32.3 </p></td><td><p>135585 </p></td><td><p>11.2 </p></td><td><p>2.1 </p></td>
- </tr>
- <tr>
- <td><p>46. </p></td><td><p>2012 </p></td><td><p>12134 </p></td><td><p>394982 </p></td><td><p>32.6 </p></td><td><p>135445 </p></td><td><p>11.2 </p></td><td><p>1.0 </p></td>
- </tr>
- <tr>
- <td><p>47. </p></td><td><p>2013 </p></td><td><p>12288 </p></td><td><p>400517 </p></td><td><p>32.6 </p></td><td><p>134799 </p></td><td><p>11.0 </p></td><td><p>1.0 </p></td>
+ <td rowspan="50"></td>
+ <td rowspan="2"><p><b>Sl. No. </p></b></td>
+ <td rowspan="2"><p><b>Year </p></b></td>
+ <td rowspan="2"><p><b>Population (in Lakh) </p></b></td>
+ <td colspan="2"><p><b>Accidental Deaths </p></b></td>
+ <td colspan="2"><p><b>Suicides </p></b></td>
+ <td rowspan="2"><p><b>Percentage Population growth </p></b></td>
+ <td rowspan="50"></td>
+ </tr>
+ <tr>
+ <td><p><b>Incidence </p></b></td>
+ <td><p><b>Rate </p></b></td>
+ <td><p><b>Incidence </p></b></td>
+ <td><p><b>Rate </p></b></td>
+ </tr>
+ <tr>
+ <td><p><b>(1) </p></b></td>
+ <td><p><b>(2) </p></b></td>
+ <td><p><b>(3) </p></b></td>
+ <td><p><b>(4) </p></b></td>
+ <td><p><b>(5) </p></b></td>
+ <td><p><b>(6) </p></b></td>
+ <td><p><b>(7) </p></b></td>
+ <td><p><b>(8) </p></b></td>
+ </tr>
+ <tr>
+ <td><p>1. </p></td>
+ <td><p>1967 </p></td>
+ <td><p>4999 </p></td>
+ <td><p>126762 </p></td>
+ <td><p>25.4 </p></td>
+ <td><p>38829 </p></td>
+ <td><p>7.8 </p></td>
+ <td><p>2.2 </p></td>
+ </tr>
+ <tr>
+ <td><p>2. </p></td>
+ <td><p>1968 </p></td>
+ <td><p>5111 </p></td>
+ <td><p>126232 </p></td>
+ <td><p>24.7 </p></td>
+ <td><p>40688 </p></td>
+ <td><p>8.0 </p></td>
+ <td><p>2.2 </p></td>
+ </tr>
+ <tr>
+ <td><p>3. </p></td>
+ <td><p>1969 </p></td>
+ <td><p>5225 </p></td>
+ <td><p>130755 </p></td>
+ <td><p>25.0 </p></td>
+ <td><p>43633 </p></td>
+ <td><p>8.4 </p></td>
+ <td><p>2.2 </p></td>
+ </tr>
+ <tr>
+ <td><p>4. </p></td>
+ <td><p>1970 </p></td>
+ <td><p>5343 </p></td>
+ <td><p>139752 </p></td>
+ <td><p>26.2 </p></td>
+ <td><p>48428 </p></td>
+ <td><p>9.1 </p></td>
+ <td><p>2.3 </p></td>
+ </tr>
+ <tr>
+ <td><p>5. </p></td>
+ <td><p>1971 </p></td>
+ <td><p>5512 </p></td>
+ <td><p>105601 </p></td>
+ <td><p>19.2 </p></td>
+ <td><p>43675 </p></td>
+ <td><p>7.9 </p></td>
+ <td><p>3.2 </p></td>
+ </tr>
+ <tr>
+ <td><p>6. </p></td>
+ <td><p>1972 </p></td>
+ <td><p>5635 </p></td>
+ <td><p>106184 </p></td>
+ <td><p>18.8 </p></td>
+ <td><p>43601 </p></td>
+ <td><p>7.7 </p></td>
+ <td><p>2.2 </p></td>
+ </tr>
+ <tr>
+ <td><p>7. </p></td>
+ <td><p>1973 </p></td>
+ <td><p>5759 </p></td>
+ <td><p>130654 </p></td>
+ <td><p>22.7 </p></td>
+ <td><p>40807 </p></td>
+ <td><p>7.1 </p></td>
+ <td><p>2.2 </p></td>
+ </tr>
+ <tr>
+ <td><p>8. </p></td>
+ <td><p>1974 </p></td>
+ <td><p>5883 </p></td>
+ <td><p>110624 </p></td>
+ <td><p>18.8 </p></td>
+ <td><p>46008 </p></td>
+ <td><p>7.8 </p></td>
+ <td><p>2.2 </p></td>
+ </tr>
+ <tr>
+ <td><p>9. </p></td>
+ <td><p>1975 </p></td>
+ <td><p>6008 </p></td>
+ <td><p>113016 </p></td>
+ <td><p>18.8 </p></td>
+ <td><p>42890 </p></td>
+ <td><p>7.1 </p></td>
+ <td><p>2.1 </p></td>
+ </tr>
+ <tr>
+ <td><p>10. </p></td>
+ <td><p>1976 </p></td>
+ <td><p>6136 </p></td>
+ <td><p>111611 </p></td>
+ <td><p>18.2 </p></td>
+ <td><p>41415 </p></td>
+ <td><p>6.7 </p></td>
+ <td><p>2.1 </p></td>
+ </tr>
+ <tr>
+ <td><p>11. </p></td>
+ <td><p>1977 </p></td>
+ <td><p>6258 </p></td>
+ <td><p>117338 </p></td>
+ <td><p>18.8 </p></td>
+ <td><p>39718 </p></td>
+ <td><p>6.3 </p></td>
+ <td><p>2.0 </p></td>
+ </tr>
+ <tr>
+ <td><p>12. </p></td>
+ <td><p>1978 </p></td>
+ <td><p>6384 </p></td>
+ <td><p>118594 </p></td>
+ <td><p>18.6 </p></td>
+ <td><p>40207 </p></td>
+ <td><p>6.3 </p></td>
+ <td><p>2.0 </p></td>
+ </tr>
+ <tr>
+ <td><p>13. </p></td>
+ <td><p>1979 </p></td>
+ <td><p>6510 </p></td>
+ <td><p>108987 </p></td>
+ <td><p>16.7 </p></td>
+ <td><p>38217 </p></td>
+ <td><p>5.9 </p></td>
+ <td><p>2.0 </p></td>
+ </tr>
+ <tr>
+ <td><p>14. </p></td>
+ <td><p>1980 </p></td>
+ <td><p>6636 </p></td>
+ <td><p>116912 </p></td>
+ <td><p>17.6 </p></td>
+ <td><p>41663 </p></td>
+ <td><p>6.3 </p></td>
+ <td><p>1.9 </p></td>
+ </tr>
+ <tr>
+ <td><p>15. </p></td>
+ <td><p>1981 </p></td>
+ <td><p>6840 </p></td>
+ <td><p>122221 </p></td>
+ <td><p>17.9 </p></td>
+ <td><p>40245 </p></td>
+ <td><p>5.9 </p></td>
+ <td><p>3.1 </p></td>
+ </tr>
+ <tr>
+ <td><p>16. </p></td>
+ <td><p>1982 </p></td>
+ <td><p>7052 </p></td>
+ <td><p>125993 </p></td>
+ <td><p>17.9 </p></td>
+ <td><p>44732 </p></td>
+ <td><p>6.3 </p></td>
+ <td><p>3.1 </p></td>
+ </tr>
+ <tr>
+ <td><p>17. </p></td>
+ <td><p>1983 </p></td>
+ <td><p>7204 </p></td>
+ <td><p>128576 </p></td>
+ <td><p>17.8 </p></td>
+ <td><p>46579 </p></td>
+ <td><p>6.5 </p></td>
+ <td><p>2.2 </p></td>
+ </tr>
+ <tr>
+ <td><p>18. </p></td>
+ <td><p>1984 </p></td>
+ <td><p>7356 </p></td>
+ <td><p>134628 </p></td>
+ <td><p>18.3 </p></td>
+ <td><p>50571 </p></td>
+ <td><p>6.9 </p></td>
+ <td><p>2.1 </p></td>
+ </tr>
+ <tr>
+ <td><p>19. </p></td>
+ <td><p>1985 </p></td>
+ <td><p>7509 </p></td>
+ <td><p>139657 </p></td>
+ <td><p>18.6 </p></td>
+ <td><p>52811 </p></td>
+ <td><p>7.0 </p></td>
+ <td><p>2.1 </p></td>
+ </tr>
+ <tr>
+ <td><p>20. </p></td>
+ <td><p>1986 </p></td>
+ <td><p>7661 </p></td>
+ <td><p>147023 </p></td>
+ <td><p>19.2 </p></td>
+ <td><p>54357 </p></td>
+ <td><p>7.1 </p></td>
+ <td><p>2.0 </p></td>
+ </tr>
+ <tr>
+ <td><p>21. </p></td>
+ <td><p>1987 </p></td>
+ <td><p>7814 </p></td>
+ <td><p>152314 </p></td>
+ <td><p>19.5 </p></td>
+ <td><p>58568 </p></td>
+ <td><p>7.5 </p></td>
+ <td><p>2.0 </p></td>
+ </tr>
+ <tr>
+ <td><p>22. </p></td>
+ <td><p>1988 </p></td>
+ <td><p>7966 </p></td>
+ <td><p>163522 </p></td>
+ <td><p>20.5 </p></td>
+ <td><p>64270 </p></td>
+ <td><p>8.1 </p></td>
+ <td><p>1.9 </p></td>
+ </tr>
+ <tr>
+ <td><p>23. </p></td>
+ <td><p>1989 </p></td>
+ <td><p>8118 </p></td>
+ <td><p>169066 </p></td>
+ <td><p>20.8 </p></td>
+ <td><p>68744 </p></td>
+ <td><p>8.5 </p></td>
+ <td><p>1.9 </p></td>
+ </tr>
+ <tr>
+ <td><p>24. </p></td>
+ <td><p>1990 </p></td>
+ <td><p>8270 </p></td>
+ <td><p>174401 </p></td>
+ <td><p>21.1 </p></td>
+ <td><p>73911 </p></td>
+ <td><p>8.9 </p></td>
+ <td><p>1.9 </p></td>
+ </tr>
+ <tr>
+ <td><p>25. </p></td>
+ <td><p>1991 </p></td>
+ <td><p>8496 </p></td>
+ <td><p>188003 </p></td>
+ <td><p>22.1 </p></td>
+ <td><p>78450 </p></td>
+ <td><p>9.2 </p></td>
+ <td><p>2.7 </p></td>
+ </tr>
+ <tr>
+ <td><p>26. </p></td>
+ <td><p>1992 </p></td>
+ <td><p>8677 </p></td>
+ <td><p>194910 </p></td>
+ <td><p>22.5 </p></td>
+ <td><p>80149 </p></td>
+ <td><p>9.2 </p></td>
+ <td><p>2.1 </p></td>
+ </tr>
+ <tr>
+ <td><p>27. </p></td>
+ <td><p>1993 </p></td>
+ <td><p>8838 </p></td>
+ <td><p>192357 </p></td>
+ <td><p>21.8 </p></td>
+ <td><p>84244 </p></td>
+ <td><p>9.5 </p></td>
+ <td><p>1.9 </p></td>
+ </tr>
+ <tr>
+ <td><p>28. </p></td>
+ <td><p>1994 </p></td>
+ <td><p>8997 </p></td>
+ <td><p>190435 </p></td>
+ <td><p>21.2 </p></td>
+ <td><p>89195 </p></td>
+ <td><p>9.9 </p></td>
+ <td><p>1.8 </p></td>
+ </tr>
+ <tr>
+ <td><p>29. </p></td>
+ <td><p>1995 </p></td>
+ <td><p>9160 </p></td>
+ <td><p>222487 </p></td>
+ <td><p>24.3 </p></td>
+ <td><p>89178 </p></td>
+ <td><p>9.7 </p></td>
+ <td><p>1.8 </p></td>
+ </tr>
+ <tr>
+ <td><p>30. </p></td>
+ <td><p>1996 </p></td>
+ <td><p>9319 </p></td>
+ <td><p>220094 </p></td>
+ <td><p>23.6 </p></td>
+ <td><p>88241 </p></td>
+ <td><p>9.5 </p></td>
+ <td><p>1.7 </p></td>
+ </tr>
+ <tr>
+ <td><p>31. </p></td>
+ <td><p>1997 </p></td>
+ <td><p>9552 </p></td>
+ <td><p>233903 </p></td>
+ <td><p>24.5 </p></td>
+ <td><p>95829 </p></td>
+ <td><p>10.0 </p></td>
+ <td><p>2.5 </p></td>
+ </tr>
+ <tr>
+ <td><p>32. </p></td>
+ <td><p>1998 </p></td>
+ <td><p>9709 </p></td>
+ <td><p>258409 </p></td>
+ <td><p>26.6 </p></td>
+ <td><p>104713 </p></td>
+ <td><p>10.8 </p></td>
+ <td><p>1.6 </p></td>
+ </tr>
+ <tr>
+ <td><p>33. </p></td>
+ <td><p>1999 </p></td>
+ <td><p>9866 </p></td>
+ <td><p>271918 </p></td>
+ <td><p>27.6 </p></td>
+ <td><p>110587 </p></td>
+ <td><p>11.2 </p></td>
+ <td><p>1.6 </p></td>
+ </tr>
+ <tr>
+ <td><p>34. </p></td>
+ <td><p>2000 </p></td>
+ <td><p>10021 </p></td>
+ <td><p>255883 </p></td>
+ <td><p>25.5 </p></td>
+ <td><p>108593 </p></td>
+ <td><p>10.8 </p></td>
+ <td><p>1.6 </p></td>
+ </tr>
+ <tr>
+ <td><p>35. </p></td>
+ <td><p>2001 </p></td>
+ <td><p>10270 </p></td>
+ <td><p>271019 </p></td>
+ <td><p>26.4 </p></td>
+ <td><p>108506 </p></td>
+ <td><p>10.6 </p></td>
+ <td><p>2.5 </p></td>
+ </tr>
+ <tr>
+ <td><p>36. </p></td>
+ <td><p>2002 </p></td>
+ <td><p>10506 </p></td>
+ <td><p>260122 </p></td>
+ <td><p>24.8 </p></td>
+ <td><p>110417 </p></td>
+ <td><p>10.5 </p></td>
+ <td><p>2.3 </p></td>
+ </tr>
+ <tr>
+ <td><p>37. </p></td>
+ <td><p>2003 </p></td>
+ <td><p>10682 </p></td>
+ <td><p>259625 </p></td>
+ <td><p>24.3 </p></td>
+ <td><p>110851 </p></td>
+ <td><p>10.4 </p></td>
+ <td><p>1.7 </p></td>
+ </tr>
+ <tr>
+ <td><p>38. </p></td>
+ <td><p>2004 </p></td>
+ <td><p>10856 </p></td>
+ <td><p>277263 </p></td>
+ <td><p>25.5 </p></td>
+ <td><p>113697 </p></td>
+ <td><p>10.5 </p></td>
+ <td><p>1.6 </p></td>
+ </tr>
+ <tr>
+ <td><p>39. </p></td>
+ <td><p>2005 </p></td>
+ <td><p>11028 </p></td>
+ <td><p>294175 </p></td>
+ <td><p>26.7 </p></td>
+ <td><p>113914 </p></td>
+ <td><p>10.3 </p></td>
+ <td><p>1.6 </p></td>
+ </tr>
+ <tr>
+ <td><p>40. </p></td>
+ <td><p>2006 </p></td>
+ <td><p>11198 </p></td>
+ <td><p>314704 </p></td>
+ <td><p>28.1 </p></td>
+ <td><p>118112 </p></td>
+ <td><p>10.5 </p></td>
+ <td><p>1.5 </p></td>
+ </tr>
+ <tr>
+ <td><p>41. </p></td>
+ <td><p>2007 </p></td>
+ <td><p>11366 </p></td>
+ <td><p>340794 </p></td>
+ <td><p>30.0 </p></td>
+ <td><p>122637 </p></td>
+ <td><p>10.8 </p></td>
+ <td><p>1.5 </p></td>
+ </tr>
+ <tr>
+ <td><p>42. </p></td>
+ <td><p>2008 </p></td>
+ <td><p>11531 </p></td>
+ <td><p>342309 </p></td>
+ <td><p>29.7 </p></td>
+ <td><p>125017 </p></td>
+ <td><p>10.8 </p></td>
+ <td><p>1.4 </p></td>
+ </tr>
+ <tr>
+ <td><p>43. </p></td>
+ <td><p>2009 </p></td>
+ <td><p>11694 </p></td>
+ <td><p>357021 </p></td>
+ <td><p>30.5 </p></td>
+ <td><p>127151 </p></td>
+ <td><p>10.9 </p></td>
+ <td><p>1.4 </p></td>
+ </tr>
+ <tr>
+ <td><p>44. </p></td>
+ <td><p>2010 </p></td>
+ <td><p>11858 </p></td>
+ <td><p>384649 </p></td>
+ <td><p>32.4 </p></td>
+ <td><p>134599 </p></td>
+ <td><p>11.4 </p></td>
+ <td><p>1.4 </p></td>
+ </tr>
+ <tr>
+ <td><p>45. </p></td>
+ <td><p>2011 </p></td>
+ <td><p>12102 </p></td>
+ <td><p>390884 </p></td>
+ <td><p>32.3 </p></td>
+ <td><p>135585 </p></td>
+ <td><p>11.2 </p></td>
+ <td><p>2.1 </p></td>
+ </tr>
+ <tr>
+ <td><p>46. </p></td>
+ <td><p>2012 </p></td>
+ <td><p>12134 </p></td>
+ <td><p>394982 </p></td>
+ <td><p>32.6 </p></td>
+ <td><p>135445 </p></td>
+ <td><p>11.2 </p></td>
+ <td><p>1.0 </p></td>
+ </tr>
+ <tr>
+ <td><p>47. </p></td>
+ <td><p>2013 </p></td>
+ <td><p>12288 </p></td>
+ <td><p>400517 </p></td>
+ <td><p>32.6 </p></td>
+ <td><p>134799 </p></td>
+ <td><p>11.0 </p></td>
+ <td><p>1.0 </p></td>
</tr>
</table>
<p> (xx)
-</p></body>
+</p></div>
+</body>
</html>
diff --git a/extract/test/column_span_2.pdf.mutool.html.ref b/extract/test/column_span_2.pdf.mutool.html.ref
index 7d5a89c3..c00988d5 100644
--- a/extract/test/column_span_2.pdf.mutool.html.ref
+++ b/extract/test/column_span_2.pdf.mutool.html.ref
@@ -1,5 +1,6 @@
<html>
<body>
+<div>
<p><i>The sample size required for each State for various investigations among different target groups of individuals are given below:
@@ -7,10 +8,18 @@
<table border="1" style="border-collapse:collapse">
<tr>
- <td><p><b>Investigations</p></b></td><td><p><b>No. of HHs</p></b></td><td><p><b>Age/Sex/ Physiological Group</p></b></td><td><p><b>Preva lence</p></b></td><td><p><b>C.I*</p></b></td><td><p><b>Relative Precision</p></b></td><td><p><b>Sample size per State</p></b></td>
+ <td><p><b>Investigations</p></b></td>
+ <td><p><b>No. of HHs</p></b></td>
+ <td><p><b>Age/Sex/ Physiological Group</p></b></td>
+ <td><p><b>Preva lence</p></b></td>
+ <td><p><b>C.I*</p></b></td>
+ <td><p><b>Relative Precision</p></b></td>
+ <td><p><b>Sample size per State</p></b></td>
</tr>
<tr>
- <td><p><i>Anthropometry</p></i></td><td rowspan="3"><p><i>2400</p></i></td><td colspan="5" rowspan="3"><p><i> All the available individuals</p></i></td>
+ <td><p><i>Anthropometry</p></i></td>
+ <td rowspan="3"><p><i>2400</p></i></td>
+ <td colspan="5" rowspan="3"><p><i> All the available individuals</p></i></td>
</tr>
<tr>
<td><p><i>Clinical Examination</p></i></td>
@@ -19,25 +28,52 @@
<td><p><i>History of morbidity</p></i></td>
</tr>
<tr>
- <td><p><i>Diet survey</p></i></td><td><p><i>1200</p></i></td><td colspan="5"><p><i>All the individuals partaking meals in the HH</p></i></td>
+ <td><p><i>Diet survey</p></i></td>
+ <td><p><i>1200</p></i></td>
+ <td colspan="5"><p><i>All the individuals partaking meals in the HH</p></i></td>
</tr>
<tr>
- <td rowspan="2"><p><i>Blood Pressure #</p></i></td><td rowspan="2"><p><i>2400</p></i></td><td><p><i>Men (</i>&#x2265;<i> 18yrs)</p></i></td><td rowspan="2"><p><i>10%</p></i></td><td rowspan="2"><p><i>95%</p></i></td><td rowspan="2"><p><i>20%</p></i></td><td><p><i>1728</p></i></td>
+ <td rowspan="2"><p><i>Blood Pressure #</p></i></td>
+ <td rowspan="2"><p><i>2400</p></i></td>
+ <td><p><i>Men (</i>&#x2265;<i> 18yrs)</p></i></td>
+ <td rowspan="2"><p><i>10%</p></i></td>
+ <td rowspan="2"><p><i>95%</p></i></td>
+ <td rowspan="2"><p><i>20%</p></i></td>
+ <td><p><i>1728</p></i></td>
</tr>
<tr>
- <td><p><i>Women (</i>&#x2265;<i> 18 yrs)</p></i></td><td><p><i>1728</p></i></td>
+ <td><p><i>Women (</i>&#x2265;<i> 18 yrs)</p></i></td>
+ <td><p><i>1728</p></i></td>
</tr>
<tr>
- <td rowspan="2"><p><i>Fasting blood glucose</p></i></td><td rowspan="2"><p><i>2400</p></i></td><td><p><i>Men (</i>&#x2265;<i> 18 yrs)</p></i></td><td rowspan="2"><p><i>5%</p></i></td><td rowspan="2"><p><i>95%</p></i></td><td rowspan="2"><p><i>20%</p></i></td><td><p><i>1825</p></i></td>
+ <td rowspan="2"><p><i>Fasting blood glucose</p></i></td>
+ <td rowspan="2"><p><i>2400</p></i></td>
+ <td><p><i>Men (</i>&#x2265;<i> 18 yrs)</p></i></td>
+ <td rowspan="2"><p><i>5%</p></i></td>
+ <td rowspan="2"><p><i>95%</p></i></td>
+ <td rowspan="2"><p><i>20%</p></i></td>
+ <td><p><i>1825</p></i></td>
</tr>
<tr>
- <td><p><i>Women (</i>&#x2265;<i> 18 yrs)</p></i></td><td><p><i>1825</p></i></td>
+ <td><p><i>Women (</i>&#x2265;<i> 18 yrs)</p></i></td>
+ <td><p><i>1825</p></i></td>
</tr>
<tr>
- <td rowspan="2"><p><i>Knowledge &amp; Practices on HTN &amp; DM</p></i></td><td><p><i>2400</p></i></td><td><p><i>Men (</i>&#x2265;<i> 18 yrs)</p></i></td><td><p><i>-</p></i></td><td><p><i>-</p></i></td><td><p><i>-</p></i></td><td><p><i>1728</p></i></td>
+ <td rowspan="2"><p><i>Knowledge &amp; Practices on HTN &amp; DM</p></i></td>
+ <td><p><i>2400</p></i></td>
+ <td><p><i>Men (</i>&#x2265;<i> 18 yrs)</p></i></td>
+ <td><p><i>-</p></i></td>
+ <td><p><i>-</p></i></td>
+ <td><p><i>-</p></i></td>
+ <td><p><i>1728</p></i></td>
</tr>
<tr>
- <td><p><i>2400</p></i></td><td><p><i>Women (</i>&#x2265;<i> 18 yrs)</p></i></td><td><p><i>-</p></i></td><td><p><i>-</p></i></td><td><p><i>-</p></i></td><td><p><i>1728</p></i></td>
+ <td><p><i>2400</p></i></td>
+ <td><p><i>Women (</i>&#x2265;<i> 18 yrs)</p></i></td>
+ <td><p><i>-</p></i></td>
+ <td><p><i>-</p></i></td>
+ <td><p><i>-</p></i></td>
+ <td><p><i>1728</p></i></td>
</tr>
</table>
@@ -77,5 +113,6 @@
</p></i>
<p><i>NNMB 3 Rural-Third Repeat Survey 2011-12
-</p></i></body>
+</p></i></div>
+</body>
</html>
diff --git a/extract/test/electoral_roll.pdf.mutool.html.ref b/extract/test/electoral_roll.pdf.mutool.html.ref
index 4d14bf3d..86a12be3 100644
--- a/extract/test/electoral_roll.pdf.mutool.html.ref
+++ b/extract/test/electoral_roll.pdf.mutool.html.ref
@@ -1,5 +1,6 @@
<html>
<body>
+<div>
<p>Electoral Roll, 2016 of Assembly Constituency - VIKASPURI, (GEN) NCT of Delhi <b>Part No - xxx
@@ -13,69 +14,142 @@
<table border="1" style="border-collapse:collapse">
<tr>
- <td><p> 1 </p></td><td colspan="2" rowspan="2"><p><i>Sex : Male</p><p></i>NEL0000001</p><p>n Doe</p></td><td rowspan="20"></td><td><p> 2 </p></td><td colspan="2" rowspan="2"><p>5 <i>Sex : Male</p><p></i>NEL0000002</p><p> Doe</p></td><td rowspan="20"></td><td><p> 3 </p></td><td colspan="2" rowspan="2"><p>5 <i>Sex : Male</p><p></i>NEL0000003</p><p> Doe</p></td>
+ <td><p> 1 </p></td>
+ <td colspan="2" rowspan="2"><p><i>Sex : Male</p><p></i>NEL0000001</p><p>n Doe</p></td>
+ <td rowspan="20"></td>
+ <td><p> 2 </p></td>
+ <td colspan="2" rowspan="2"><p>5 <i>Sex : Male</p><p></i>NEL0000002</p><p> Doe</p></td>
+ <td rowspan="20"></td>
+ <td><p> 3 </p></td>
+ <td colspan="2" rowspan="2"><p>5 <i>Sex : Male</p><p></i>NEL0000003</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Father&apos;s </i>: <i>Name </i>0</p><p>Joh</p><p>House No : Age : 55</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No :</p><p></i>John</p><p>Age : 63</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No :</p><p></i>John</p><p>Age : 33</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>0</p><p>Joh</p><p>House No : Age : 55</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No :</p><p></i>John</p><p>Age : 63</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No :</p><p></i>John</p><p>Age : 33</p></td>
</tr>
<tr>
- <td><p> 4 </p></td><td colspan="2" rowspan="2"><p>1</p><p>NEL0000004</p><p> Doe</p><p>Sex : Female</p></td><td><p> 5 </p></td><td colspan="2" rowspan="2"><p>8 <i>Sex : Male</p><p></i>NEL0000005</p><p> Doe</p></td><td><p> 6 </p></td><td colspan="2" rowspan="2"><p>5 <i>Sex : Female</p><p></i>NEL0000006</p><p> Doe</p></td>
+ <td><p> 4 </p></td>
+ <td colspan="2" rowspan="2"><p>1</p><p>NEL0000004</p><p> Doe</p><p>Sex : Female</p></td>
+ <td><p> 5 </p></td>
+ <td colspan="2" rowspan="2"><p>8 <i>Sex : Male</p><p></i>NEL0000005</p><p> Doe</p></td>
+ <td><p> 6 </p></td>
+ <td colspan="2" rowspan="2"><p>5 <i>Sex : Female</p><p></i>NEL0000006</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Father&apos;s </i>: <i>Name </i>3 <i>House No : Age : 23</p><p></i>Jane</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>4 <i>Age : 22</p><p></i>John</p><p>House No :</p></td><td><p><i>Name : Husband&apos;s </i>: <i>Name </i>5 <i>House No : Age : 62</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>3 <i>House No : Age : 23</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>4 <i>Age : 22</p><p></i>John</p><p>House No :</p></td>
+ <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>5 <i>House No : Age : 62</p><p></i>Jane</p></td>
</tr>
<tr>
- <td><p> 7 </p></td><td colspan="2" rowspan="2"><p>2 <i>Sex : Female</p><p></i>NEL0000007</p><p> Doe</p></td><td><p> 8 </p></td><td colspan="2" rowspan="2"><p>3 <i>Sex : Male</p><p></i>NEL0000008</p><p> Doe</p></td><td><p> 9 </p></td><td colspan="2" rowspan="2"><p>3 <i>Sex : Female</p><p></i>NEL0000009</p><p> Doe</p></td>
+ <td><p> 7 </p></td>
+ <td colspan="2" rowspan="2"><p>2 <i>Sex : Female</p><p></i>NEL0000007</p><p> Doe</p></td>
+ <td><p> 8 </p></td>
+ <td colspan="2" rowspan="2"><p>3 <i>Sex : Male</p><p></i>NEL0000008</p><p> Doe</p></td>
+ <td><p> 9 </p></td>
+ <td colspan="2" rowspan="2"><p>3 <i>Sex : Female</p><p></i>NEL0000009</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>6 <i>House No : Age : 80</p><p></i>Jane</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>6 <i>House No : Age : 61</p><p></i>John</p></td><td><p><i>Name : Husband&apos;s </i>: <i>Name </i>6 <i>House No : Age : 54</p><p></i>Jane</p></td>
+ <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>6 <i>House No : Age : 80</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>6 <i>House No : Age : 61</p><p></i>John</p></td>
+ <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>6 <i>House No : Age : 54</p><p></i>Jane</p></td>
</tr>
<tr>
- <td><p> 10 </p></td><td colspan="2" rowspan="2"><p>3 <i>Sex : Female</p><p></i>NEL0000010</p><p> Doe</p></td><td><p> 11 </p></td><td colspan="2" rowspan="2"><p>5 <i>Sex : Male</p><p></i>NEL0000011</p><p> Doe</p></td><td><p> 12 </p></td><td colspan="2" rowspan="2"><p>8 <i>Sex : Female</p><p></i>LQK0000012</p><p> Doe</p></td>
+ <td><p> 10 </p></td>
+ <td colspan="2" rowspan="2"><p>3 <i>Sex : Female</p><p></i>NEL0000010</p><p> Doe</p></td>
+ <td><p> 11 </p></td>
+ <td colspan="2" rowspan="2"><p>5 <i>Sex : Male</p><p></i>NEL0000011</p><p> Doe</p></td>
+ <td><p> 12 </p></td>
+ <td colspan="2" rowspan="2"><p>8 <i>Sex : Female</p><p></i>LQK0000012</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Father&apos;s </i>: <i>Name </i>7 <i>House No : Age : 20</p><p></i>Jane</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>7 <i>House No : Age : 49</p><p></i>John</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>8 <i>House No : Age : 41</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>7 <i>House No : Age : 20</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>7 <i>House No : Age : 49</p><p></i>John</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>8 <i>House No : Age : 41</p><p></i>Jane</p></td>
</tr>
<tr>
- <td><p> 13 </p></td><td colspan="2" rowspan="2"><p>2 <i>Sex : Female</p><p></i>NEL0000013</p><p> Doe</p></td><td><p> 14 </p></td><td colspan="2" rowspan="2"><p>04 <i>Sex : Female</p><p></i>NEL0000014</p><p> Doe</p></td><td><p> 15 </p></td><td colspan="2" rowspan="2"><p>04 <i>Sex : Male</p><p></i>NEL0000015</p><p> Doe</p></td>
+ <td><p> 13 </p></td>
+ <td colspan="2" rowspan="2"><p>2 <i>Sex : Female</p><p></i>NEL0000013</p><p> Doe</p></td>
+ <td><p> 14 </p></td>
+ <td colspan="2" rowspan="2"><p>04 <i>Sex : Female</p><p></i>NEL0000014</p><p> Doe</p></td>
+ <td><p> 15 </p></td>
+ <td colspan="2" rowspan="2"><p>04 <i>Sex : Male</p><p></i>NEL0000015</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>9 <i>House No : Age : 28</p><p></i>Jane</p></td><td><p><i>Name : Husband&apos;s </i>: <i>Name </i>1 <i>House No : Age : 45</p><p></i>Jane</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 43</p><p></i>John</p></td>
+ <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>9 <i>House No : Age : 28</p><p></i>Jane</p></td>
+ <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>1 <i>House No : Age : 45</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 43</p><p></i>John</p></td>
</tr>
<tr>
- <td><p> 16 </p></td><td colspan="2" rowspan="2"><p>04 <i>Sex : Female</p><p></i>NEL0000016</p><p> Doe</p></td><td><p> 17 </p></td><td colspan="2" rowspan="2"><p>19-B <i>Sex : Female</p><p></i>NEL0000017</p><p> Doe</p></td><td><p> 18 </p></td><td colspan="2" rowspan="2"><p>26 <i>Sex : Female</p><p></i>NEL0000018</p><p> Doe</p></td>
+ <td><p> 16 </p></td>
+ <td colspan="2" rowspan="2"><p>04 <i>Sex : Female</p><p></i>NEL0000016</p><p> Doe</p></td>
+ <td><p> 17 </p></td>
+ <td colspan="2" rowspan="2"><p>19-B <i>Sex : Female</p><p></i>NEL0000017</p><p> Doe</p></td>
+ <td><p> 18 </p></td>
+ <td colspan="2" rowspan="2"><p>26 <i>Sex : Female</p><p></i>NEL0000018</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 23</p><p></i>Jane</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 46</p><p></i>Jane</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 22</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 23</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 46</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 22</p><p></i>Jane</p></td>
</tr>
<tr>
- <td><p> 19 </p></td><td colspan="2" rowspan="2"><p>33 <i>Sex : Male</p><p></i>NEL0000019</p><p>n Doe</p></td><td><p> 20 </p></td><td colspan="2" rowspan="2"><p>43 <i>Sex : Male</p><p></i>NEL0000020</p><p> Doe</p></td><td><p> 21 </p></td><td colspan="2" rowspan="2"><p>45 <i>Sex : Male</p><p></i>NEL0000021</p><p> Doe</p></td>
+ <td><p> 19 </p></td>
+ <td colspan="2" rowspan="2"><p>33 <i>Sex : Male</p><p></i>NEL0000019</p><p>n Doe</p></td>
+ <td><p> 20 </p></td>
+ <td colspan="2" rowspan="2"><p>43 <i>Sex : Male</p><p></i>NEL0000020</p><p> Doe</p></td>
+ <td><p> 21 </p></td>
+ <td colspan="2" rowspan="2"><p>45 <i>Sex : Male</p><p></i>NEL0000021</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 29</p><p></i>Joh</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 25</p><p></i>John</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 47</p><p></i>John</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 29</p><p></i>Joh</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 25</p><p></i>John</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 47</p><p></i>John</p></td>
</tr>
<tr>
- <td><p> 22 </p></td><td colspan="2" rowspan="2"><p>47 <i>Sex : Female</p><p></i>NEL0000022</p><p> Doe</p></td><td><p> 23 </p></td><td colspan="2" rowspan="2"><p>51 <i>Sex : Male</p><p></i>NEL0000023</p><p> Doe</p></td><td><p> 24 </p></td><td colspan="2" rowspan="2"><p>55 <i>Sex : Female</p><p></i>NEL0000024</p><p> Doe</p></td>
+ <td><p> 22 </p></td>
+ <td colspan="2" rowspan="2"><p>47 <i>Sex : Female</p><p></i>NEL0000022</p><p> Doe</p></td>
+ <td><p> 23 </p></td>
+ <td colspan="2" rowspan="2"><p>51 <i>Sex : Male</p><p></i>NEL0000023</p><p> Doe</p></td>
+ <td><p> 24 </p></td>
+ <td colspan="2" rowspan="2"><p>55 <i>Sex : Female</p><p></i>NEL0000024</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 20</p><p></i>Jane</p></td><td><p><i>Name : Mother&apos;s </i>: <i>Name </i>1 <i>House No : Age : 24</p><p></i>John</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 21</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 20</p><p></i>Jane</p></td>
+ <td><p><i>Name : Mother&apos;s </i>: <i>Name </i>1 <i>House No : Age : 24</p><p></i>John</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 21</p><p></i>Jane</p></td>
</tr>
<tr>
- <td><p> 25 </p></td><td colspan="2" rowspan="2"><p>78 <i>Sex : Male</p><p></i>NEL0000025</p><p>n Doe</p></td><td><p> 26 </p></td><td colspan="2" rowspan="2"><p>78 <i>Sex : Female</p><p></i>NEL0000026</p><p> Doe</p></td><td><p> 27 </p></td><td colspan="2" rowspan="2"><p>94 <i>Sex : Male</p><p></i>NEL0000027</p><p> Doe</p></td>
+ <td><p> 25 </p></td>
+ <td colspan="2" rowspan="2"><p>78 <i>Sex : Male</p><p></i>NEL0000025</p><p>n Doe</p></td>
+ <td><p> 26 </p></td>
+ <td colspan="2" rowspan="2"><p>78 <i>Sex : Female</p><p></i>NEL0000026</p><p> Doe</p></td>
+ <td><p> 27 </p></td>
+ <td colspan="2" rowspan="2"><p>94 <i>Sex : Male</p><p></i>NEL0000027</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 41</p><p></i>Joh</p></td><td><p><i>Name : Husband&apos;s </i>: <i>Name </i>1 <i>House No : Age : 35</p><p></i>Jane</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 59</p><p></i>John</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 41</p><p></i>Joh</p></td>
+ <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>1 <i>House No : Age : 35</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>1 <i>House No : Age : 59</p><p></i>John</p></td>
</tr>
<tr>
- <td><p> 28 </p></td><td colspan="2" rowspan="2"><p>95 <i>Sex : Female</p><p></i>NEL0000028</p><p> Doe</p></td><td><p> 29 </p></td><td colspan="2" rowspan="2"><p>95 <i>Sex : Female</p><p></i>NEL0000029</p><p> Doe</p></td><td><p> 30 </p></td><td colspan="2" rowspan="2"><p>01 <i>Sex : Male</p><p></i>NEL0000030</p><p> Doe</p></td>
+ <td><p> 28 </p></td>
+ <td colspan="2" rowspan="2"><p>95 <i>Sex : Female</p><p></i>NEL0000028</p><p> Doe</p></td>
+ <td><p> 29 </p></td>
+ <td colspan="2" rowspan="2"><p>95 <i>Sex : Female</p><p></i>NEL0000029</p><p> Doe</p></td>
+ <td><p> 30 </p></td>
+ <td colspan="2" rowspan="2"><p>01 <i>Sex : Male</p><p></i>NEL0000030</p><p> Doe</p></td>
</tr>
<tr>
- <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>1 <i>House No : Age : 33</p><p></i>Jane</p></td><td><p><i>Name : Husband&apos;s </i>: <i>Name </i>1 <i>House No : Age : 28</p><p></i>Jane</p></td><td><p><i>Name : Father&apos;s </i>: <i>Name </i>2 <i>House No : Age : 45</p><p></i>John</p></td>
+ <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>1 <i>House No : Age : 33</p><p></i>Jane</p></td>
+ <td><p><i>Name : Husband&apos;s </i>: <i>Name </i>1 <i>House No : Age : 28</p><p></i>Jane</p></td>
+ <td><p><i>Name : Father&apos;s </i>: <i>Name </i>2 <i>House No : Age : 45</p><p></i>John</p></td>
</tr>
</table>
<p>S-Shifted, E-Expired, M-Missing, Q- Disqualification, R-Duplicate Page 3 of 33 Age as on 01-01-2016 Issued By Electoral Registration Officer
-</p></body>
+</p></div>
+</body>
</html>
diff --git a/extract/test/rotated.pdf.mutool.html.ref b/extract/test/rotated.pdf.mutool.html.ref
index e98ffed6..9d468509 100644
--- a/extract/test/rotated.pdf.mutool.html.ref
+++ b/extract/test/rotated.pdf.mutool.html.ref
@@ -1,37 +1,163 @@
<html>
<body>
+<div>
<table border="1" style="border-collapse:collapse">
<tr>
- <td rowspan="2"><p><b>2011-12)</p><p>(No.ofadults:</p><p>FastingBloodSugar </p></b></td><td><p><b>Women</p></b></td><td><p>2391</p></td><td><p>1739</p></td><td><p>2028</p></td><td><p>1529</p></td><td><p>1599</p></td><td><p>2503</p></td><td><p>1709</p></td><td><p>1628</p></td><td><p>2027</p></td><td><p>1366</p></td><td><p><b>18519</p></b></td><td></td><td rowspan="10"></td><td rowspan="10"><p>*Datanotavailable </p></td>
+ <td rowspan="2"><p><b>2011-12)</p><p>(No.ofadults:</p><p>FastingBloodSugar </p></b></td>
+ <td><p><b>Women</p></b></td>
+ <td><p>2391</p></td>
+ <td><p>1739</p></td>
+ <td><p>2028</p></td>
+ <td><p>1529</p></td>
+ <td><p>1599</p></td>
+ <td><p>2503</p></td>
+ <td><p>1709</p></td>
+ <td><p>1628</p></td>
+ <td><p>2027</p></td>
+ <td><p>1366</p></td>
+ <td><p><b>18519</p></b></td>
+ <td></td>
+ <td rowspan="10"></td>
+ <td rowspan="10"><p>*Datanotavailable </p></td>
</tr>
<tr>
- <td><p><b>Men</p></b></td><td><p>1645</p></td><td><p>1119</p></td><td><p>1628</p></td><td><p>1111</p></td><td><p>1417</p></td><td><p>2122</p></td><td><p>1579</p></td><td><p>1093</p></td><td><p>1413</p></td><td><p>1185</p></td><td><p><b>14312</p></b></td><td></td>
+ <td><p><b>Men</p></b></td>
+ <td><p>1645</p></td>
+ <td><p>1119</p></td>
+ <td><p>1628</p></td>
+ <td><p>1111</p></td>
+ <td><p>1417</p></td>
+ <td><p>2122</p></td>
+ <td><p>1579</p></td>
+ <td><p>1093</p></td>
+ <td><p>1413</p></td>
+ <td><p>1185</p></td>
+ <td><p><b>14312</p></b></td>
+ <td></td>
</tr>
<tr>
- <td rowspan="2"><p><b>2011-12)</p><p>(No.ofadults: </p><p>BloodPressure </p></b></td><td><p><b>Women</p></b></td><td><p>3195</p></td><td><p>2858</p></td><td><p>2894</p></td><td><p>2493</p></td><td><p>2648</p></td><td><p>3021</p></td><td><p>2150</p></td><td><p>2624</p></td><td><p>2743</p></td><td><p>2415</p></td><td><p><b>27041</p></b></td><td></td>
+ <td rowspan="2"><p><b>2011-12)</p><p>(No.ofadults: </p><p>BloodPressure </p></b></td>
+ <td><p><b>Women</p></b></td>
+ <td><p>3195</p></td>
+ <td><p>2858</p></td>
+ <td><p>2894</p></td>
+ <td><p>2493</p></td>
+ <td><p>2648</p></td>
+ <td><p>3021</p></td>
+ <td><p>2150</p></td>
+ <td><p>2624</p></td>
+ <td><p>2743</p></td>
+ <td><p>2415</p></td>
+ <td><p><b>27041</p></b></td>
+ <td></td>
</tr>
<tr>
- <td><p><b>Men</p></b></td><td><p>2161</p></td><td><p>2134</p></td><td><p>2467</p></td><td><p>1899</p></td><td><p>2368</p></td><td><p>2687</p></td><td><p>1965</p></td><td><p>2040</p></td><td><p>2058</p></td><td><p>2139</p></td><td><p><b>21918</p></b></td><td></td>
+ <td><p><b>Men</p></b></td>
+ <td><p>2161</p></td>
+ <td><p>2134</p></td>
+ <td><p>2467</p></td>
+ <td><p>1899</p></td>
+ <td><p>2368</p></td>
+ <td><p>2687</p></td>
+ <td><p>1965</p></td>
+ <td><p>2040</p></td>
+ <td><p>2058</p></td>
+ <td><p>2139</p></td>
+ <td><p><b>21918</p></b></td>
+ <td></td>
</tr>
<tr>
- <td colspan="2"><p><b>2011-12)</p><p>IYCFPractices </p><p>(No.ofmothers: </p></b></td><td><p>245</p></td><td><p>413</p></td><td><p>428</p></td><td><p>557</p></td><td><p>467</p></td><td><p>477</p></td><td><p>470</p></td><td><p>398</p></td><td><p>423</p></td><td><p>581</p></td><td><p><b>4459</p></b></td><td></td>
+ <td colspan="2"><p><b>2011-12)</p><p>IYCFPractices </p><p>(No.ofmothers: </p></b></td>
+ <td><p>245</p></td>
+ <td><p>413</p></td>
+ <td><p>428</p></td>
+ <td><p>557</p></td>
+ <td><p>467</p></td>
+ <td><p>477</p></td>
+ <td><p>470</p></td>
+ <td><p>398</p></td>
+ <td><p>423</p></td>
+ <td><p>581</p></td>
+ <td><p><b>4459</p></b></td>
+ <td></td>
</tr>
<tr>
- <td rowspan="4"><p><b>(No.ofindividuals) </p><p>NutritionalAssessment </p></b></td><td><p><b>2011-12 </p></b></td><td><p>8297</p></td><td><p>7851</p></td><td><p>8958</p></td><td><p>8300</p></td><td><p>9525</p></td><td><p>9645</p></td><td><p>7942</p></td><td><p>8473</p></td><td><p>8047</p></td><td><p>9860</p></td><td><p><b>86898</p></b></td><td></td>
+ <td rowspan="4"><p><b>(No.ofindividuals) </p><p>NutritionalAssessment </p></b></td>
+ <td><p><b>2011-12 </p></b></td>
+ <td><p>8297</p></td>
+ <td><p>7851</p></td>
+ <td><p>8958</p></td>
+ <td><p>8300</p></td>
+ <td><p>9525</p></td>
+ <td><p>9645</p></td>
+ <td><p>7942</p></td>
+ <td><p>8473</p></td>
+ <td><p>8047</p></td>
+ <td><p>9860</p></td>
+ <td><p><b>86898</p></b></td>
+ <td></td>
</tr>
<tr>
- <td><p><b>1996-97</p></b></td><td><p>8864</p></td><td><p>5813</p></td><td><p>12606</p></td><td><p>9545</p></td><td><p>6883</p></td><td><p>4866</p></td><td><p>*</p></td><td><p>12024</p></td><td><p>*</p></td><td><p>*</p></td><td><p><b>60601</p></b></td><td></td>
+ <td><p><b>1996-97</p></b></td>
+ <td><p>8864</p></td>
+ <td><p>5813</p></td>
+ <td><p>12606</p></td>
+ <td><p>9545</p></td>
+ <td><p>6883</p></td>
+ <td><p>4866</p></td>
+ <td><p>*</p></td>
+ <td><p>12024</p></td>
+ <td><p>*</p></td>
+ <td><p>*</p></td>
+ <td><p><b>60601</p></b></td>
+ <td></td>
</tr>
<tr>
- <td><p><b>1988-90</p></b></td><td><p>6633</p></td><td><p>10217</p></td><td><p>8138</p></td><td><p>9920</p></td><td><p>7796</p></td><td><p>5374</p></td><td><p>*</p></td><td><p>5540</p></td><td><p>*</p></td><td><p>*</p></td><td><p><b>53618</p></b></td><td></td>
+ <td><p><b>1988-90</p></b></td>
+ <td><p>6633</p></td>
+ <td><p>10217</p></td>
+ <td><p>8138</p></td>
+ <td><p>9920</p></td>
+ <td><p>7796</p></td>
+ <td><p>5374</p></td>
+ <td><p>*</p></td>
+ <td><p>5540</p></td>
+ <td><p>*</p></td>
+ <td><p>*</p></td>
+ <td><p><b>53618</p></b></td>
+ <td></td>
</tr>
<tr>
- <td><p><b>1975-79</p></b></td><td><p>5738</p></td><td><p>7387</p></td><td><p>6453</p></td><td><p>5844</p></td><td><p>5161</p></td><td><p>4403</p></td><td><p>*</p></td><td><p>3756</p></td><td><p>*</p></td><td><p>*</p></td><td><p><b>38742</p></b></td><td></td>
+ <td><p><b>1975-79</p></b></td>
+ <td><p>5738</p></td>
+ <td><p>7387</p></td>
+ <td><p>6453</p></td>
+ <td><p>5844</p></td>
+ <td><p>5161</p></td>
+ <td><p>4403</p></td>
+ <td><p>*</p></td>
+ <td><p>3756</p></td>
+ <td><p>*</p></td>
+ <td><p>*</p></td>
+ <td><p><b>38742</p></b></td>
+ <td></td>
</tr>
<tr>
- <td colspan="2"><p><b>State</p></b></td><td><p>Kerala</p></td><td><p>TamilNadu</p></td><td><p>Karnataka</p></td><td><p>AndhraPradesh</p></td><td><p>Maharashtra</p></td><td><p>Gujarat</p></td><td><p>MadhyaPradesh</p></td><td><p>Orissa</p></td><td><p>WestBengal</p></td><td><p>UttarPradesh</p></td><td><p><b>Pooled</p></b></td><td></td>
+ <td colspan="2"><p><b>State</p></b></td>
+ <td><p>Kerala</p></td>
+ <td><p>TamilNadu</p></td>
+ <td><p>Karnataka</p></td>
+ <td><p>AndhraPradesh</p></td>
+ <td><p>Maharashtra</p></td>
+ <td><p>Gujarat</p></td>
+ <td><p>MadhyaPradesh</p></td>
+ <td><p>Orissa</p></td>
+ <td><p>WestBengal</p></td>
+ <td><p>UttarPradesh</p></td>
+ <td><p><b>Pooled</p></b></td>
+ <td></td>
</tr>
</table>
@@ -44,5 +170,6 @@
</p></b>
<p>NNMB72Rural-ThirdRepeatSurvey2011-12
-</p></body>
+</p></div>
+</body>
</html>
diff --git a/extract/test/row_span.pdf.mutool.html.ref b/extract/test/row_span.pdf.mutool.html.ref
index 744fc08d..4ec2273b 100644
--- a/extract/test/row_span.pdf.mutool.html.ref
+++ b/extract/test/row_span.pdf.mutool.html.ref
@@ -1,124 +1,179 @@
<html>
<body>
+<div>
<table border="1" style="border-collapse:collapse">
<tr>
- <td><p><b>Plan Type </p></b></td><td><p><b>County </p></b></td><td><p><b>Plan Name </p></b></td><td><p><b>Totals </p></b></td>
+ <td><p><b>Plan Type </p></b></td>
+ <td><p><b>County </p></b></td>
+ <td><p><b>Plan Name </p></b></td>
+ <td><p><b>Totals </p></b></td>
</tr>
<tr>
- <td rowspan="10"><p><b>GMC </p></b></td><td rowspan="4"><p>Sacramento </p></td><td><p>Anthem Blue Cross </p></td><td><p>164,380 </p></td>
+ <td rowspan="10"><p><b>GMC </p></b></td>
+ <td rowspan="4"><p>Sacramento </p></td>
+ <td><p>Anthem Blue Cross </p></td>
+ <td><p>164,380 </p></td>
</tr>
<tr>
- <td><p>Health Net </p></td><td><p>126,547 </p></td>
+ <td><p>Health Net </p></td>
+ <td><p>126,547 </p></td>
</tr>
<tr>
- <td><p>Kaiser Foundation </p></td><td><p>74,620 </p></td>
+ <td><p>Kaiser Foundation </p></td>
+ <td><p>74,620 </p></td>
</tr>
<tr>
- <td><p>Molina Healthcare </p></td><td><p>59,989 </p></td>
+ <td><p>Molina Healthcare </p></td>
+ <td><p>59,989 </p></td>
</tr>
<tr>
- <td rowspan="5"><p>San Diego </p></td><td><p>Care 1st Health Plan </p></td><td><p>71,831 </p></td>
+ <td rowspan="5"><p>San Diego </p></td>
+ <td><p>Care 1st Health Plan </p></td>
+ <td><p>71,831 </p></td>
</tr>
<tr>
- <td><p>Community Health Group </p></td><td><p>264,639 </p></td>
+ <td><p>Community Health Group </p></td>
+ <td><p>264,639 </p></td>
</tr>
<tr>
- <td><p>Health Net </p></td><td><p>72,404 </p></td>
+ <td><p>Health Net </p></td>
+ <td><p>72,404 </p></td>
</tr>
<tr>
- <td><p>Kaiser </p></td><td><p>50,415 </p></td>
+ <td><p>Kaiser </p></td>
+ <td><p>50,415 </p></td>
</tr>
<tr>
- <td><p>Molina Healthcare </p></td><td><p>206,430 </p></td>
+ <td><p>Molina Healthcare </p></td>
+ <td><p>206,430 </p></td>
</tr>
<tr>
- <td colspan="2"><p><b>Total GMC Enrollment </p></b></td><td><p><b>1,091,255 </p></b></td>
+ <td colspan="2"><p><b>Total GMC Enrollment </p></b></td>
+ <td><p><b>1,091,255 </p></b></td>
</tr>
<tr>
- <td rowspan="23"><p><b>COHS </p></b></td><td><p>Marin </p></td><td rowspan="14"><p>Partnership Health Plan of CA </p></td><td><p>36,006 </p></td>
+ <td rowspan="23"><p><b>COHS </p></b></td>
+ <td><p>Marin </p></td>
+ <td rowspan="14"><p>Partnership Health Plan of CA </p></td>
+ <td><p>36,006 </p></td>
</tr>
<tr>
- <td><p>Mendocino</p></td><td><p> 37,243 </p></td>
+ <td><p>Mendocino</p></td>
+ <td><p> 37,243 </p></td>
</tr>
<tr>
- <td><p>Napa </p></td><td><p>28,398 </p></td>
+ <td><p>Napa </p></td>
+ <td><p>28,398 </p></td>
</tr>
<tr>
- <td><p>Solano </p></td><td><p>113,220 </p></td>
+ <td><p>Solano </p></td>
+ <td><p>113,220 </p></td>
</tr>
<tr>
- <td><p>Sonoma </p></td><td><p>112,271 </p></td>
+ <td><p>Sonoma </p></td>
+ <td><p>112,271 </p></td>
</tr>
<tr>
- <td><p>Yolo </p></td><td><p>52,674 </p></td>
+ <td><p>Yolo </p></td>
+ <td><p>52,674 </p></td>
</tr>
<tr>
- <td><p>Del Norte </p></td><td><p>11,242 </p></td>
+ <td><p>Del Norte </p></td>
+ <td><p>11,242 </p></td>
</tr>
<tr>
- <td><p>Humboldt </p></td><td><p>49,911 </p></td>
+ <td><p>Humboldt </p></td>
+ <td><p>49,911 </p></td>
</tr>
<tr>
- <td><p>Lake </p></td><td><p>29,149 </p></td>
+ <td><p>Lake </p></td>
+ <td><p>29,149 </p></td>
</tr>
<tr>
- <td><p>Lassen </p></td><td><p>7,360 </p></td>
+ <td><p>Lassen </p></td>
+ <td><p>7,360 </p></td>
</tr>
<tr>
- <td><p>Modoc </p></td><td><p>2,940 </p></td>
+ <td><p>Modoc </p></td>
+ <td><p>2,940 </p></td>
</tr>
<tr>
- <td><p>Shasta </p></td><td><p>61,763 </p></td>
+ <td><p>Shasta </p></td>
+ <td><p>61,763 </p></td>
</tr>
<tr>
- <td><p>Siskiyou </p></td><td><p>16,715 </p></td>
+ <td><p>Siskiyou </p></td>
+ <td><p>16,715 </p></td>
</tr>
<tr>
- <td><p>Trinity </p></td><td><p>4,542 </p></td>
+ <td><p>Trinity </p></td>
+ <td><p>4,542 </p></td>
</tr>
<tr>
- <td><p>Merced</p></td><td rowspan="3"><p>Central California Alliance for Health</p></td><td><p> 123,907 </p></td>
+ <td><p>Merced</p></td>
+ <td rowspan="3"><p>Central California Alliance for Health</p></td>
+ <td><p> 123,907 </p></td>
</tr>
<tr>
- <td><p>Monterey </p></td><td><p> 147,397 </p></td>
+ <td><p>Monterey </p></td>
+ <td><p> 147,397 </p></td>
</tr>
<tr>
- <td><p>Santa Cruz</p></td><td><p> 69,458 </p></td>
+ <td><p>Santa Cruz</p></td>
+ <td><p> 69,458 </p></td>
</tr>
<tr>
- <td><p>Santa Barbara </p></td><td rowspan="2"><p>CenCal </p></td><td><p>117,609 </p></td>
+ <td><p>Santa Barbara </p></td>
+ <td rowspan="2"><p>CenCal </p></td>
+ <td><p>117,609 </p></td>
</tr>
<tr>
- <td><p>San Luis Obispo </p></td><td><p>55,761 </p></td>
+ <td><p>San Luis Obispo </p></td>
+ <td><p>55,761 </p></td>
</tr>
<tr>
- <td><p>Orange </p></td><td><p>CalOptima </p></td><td><p>783,079 </p></td>
+ <td><p>Orange </p></td>
+ <td><p>CalOptima </p></td>
+ <td><p>783,079 </p></td>
</tr>
<tr>
- <td><p>San Mateo </p></td><td><p>Health Plan of San Mateo </p></td><td><p>113,202 </p></td>
+ <td><p>San Mateo </p></td>
+ <td><p>Health Plan of San Mateo </p></td>
+ <td><p>113,202 </p></td>
</tr>
<tr>
- <td><p>Ventura </p></td><td><p>Gold Coast Health Plan </p></td><td><p>202,217 </p></td>
+ <td><p>Ventura </p></td>
+ <td><p>Gold Coast Health Plan </p></td>
+ <td><p>202,217 </p></td>
</tr>
<tr>
- <td colspan="2"><p><b>Total COHS Enrollment </p></b></td><td><p><b>2,176,064 </p></b></td>
+ <td colspan="2"><p><b>Total COHS Enrollment </p></b></td>
+ <td><p><b>2,176,064 </p></b></td>
</tr>
<tr>
- <td colspan="3"><p><b>Subtotal for Two-Plan, Regional Model, GMC and COHS </p></b></td><td><p><b>10,132,022 </p></b></td>
+ <td colspan="3"><p><b>Subtotal for Two-Plan, Regional Model, GMC and COHS </p></b></td>
+ <td><p><b>10,132,022 </p></b></td>
</tr>
<tr>
- <td rowspan="3"><p><b>PCCM </p></b></td><td><p>Los Angeles </p></td><td><p>AIDS Healthcare Foundation </p></td><td><p>828 </p></td>
+ <td rowspan="3"><p><b>PCCM </p></b></td>
+ <td><p>Los Angeles </p></td>
+ <td><p>AIDS Healthcare Foundation </p></td>
+ <td><p>828 </p></td>
</tr>
<tr>
- <td><p>San Francisco </p></td><td><p>Family Mosaic </p></td><td><p>25 </p></td>
+ <td><p>San Francisco </p></td>
+ <td><p>Family Mosaic </p></td>
+ <td><p>25 </p></td>
</tr>
<tr>
- <td colspan="2"><p><b>Total PHP Enrollment </p></b></td><td><p><b>853 </p></b></td>
+ <td colspan="2"><p><b>Total PHP Enrollment </p></b></td>
+ <td><p><b>853 </p></b></td>
</tr>
<tr>
- <td colspan="3"><p><b>All Models Total Enrollments </p></b></td><td><p><b>10,132,875 </p></b></td>
+ <td colspan="3"><p><b>All Models Total Enrollments </p></b></td>
+ <td><p><b>10,132,875 </p></b></td>
</tr>
<tr>
<td colspan="4"><p>Source: Data Warehouse 12/14/15 </p></td>
@@ -128,5 +183,6 @@
<p>.
-</p></body>
+</p></div>
+</body>
</html>
diff --git a/extract/test/table.pdf.mutool.html.ref b/extract/test/table.pdf.mutool.html.ref
index a1945c06..4e34d3b6 100644
--- a/extract/test/table.pdf.mutool.html.ref
+++ b/extract/test/table.pdf.mutool.html.ref
@@ -1,5 +1,6 @@
<html>
<body>
+<div>
<p><b>2 Quantifying Fuel-Saving Opportunities from Specific Driving Behavior Changes
@@ -40,25 +41,61 @@
<table border="1" style="border-collapse:collapse">
<tr>
- <td rowspan="2"><p><b>Cycle Name </p></b></td><td rowspan="2"><p><b>KI (1/km) </p></b></td><td rowspan="2"><p><b>Distance (mi) </p></b></td><td colspan="4"><p><b>Percent Fuel Savings </p></b></td>
+ <td rowspan="2"><p><b>Cycle Name </p></b></td>
+ <td rowspan="2"><p><b>KI (1/km) </p></b></td>
+ <td rowspan="2"><p><b>Distance (mi) </p></b></td>
+ <td colspan="4"><p><b>Percent Fuel Savings </p></b></td>
</tr>
<tr>
- <td><p><b>Improved Speed </p></b></td><td><p><b>Decreased Accel </p></b></td><td><p><b>Eliminate Stops </p></b></td><td><p><b>Decreased Idle </p></b></td>
+ <td><p><b>Improved Speed </p></b></td>
+ <td><p><b>Decreased Accel </p></b></td>
+ <td><p><b>Eliminate Stops </p></b></td>
+ <td><p><b>Decreased Idle </p></b></td>
</tr>
<tr>
- <td><p>2012_2 </p></td><td><p>3.30 </p></td><td><p>1.3 </p></td><td><p>5.9% </p></td><td><p>9.5% </p></td><td><p>29.2% </p></td><td><p>17.4% </p></td>
+ <td><p>2012_2 </p></td>
+ <td><p>3.30 </p></td>
+ <td><p>1.3 </p></td>
+ <td><p>5.9% </p></td>
+ <td><p>9.5% </p></td>
+ <td><p>29.2% </p></td>
+ <td><p>17.4% </p></td>
</tr>
<tr>
- <td><p>2145_1 </p></td><td><p>0.68 </p></td><td><p>11.2 </p></td><td><p>2.4% </p></td><td><p>0.1% </p></td><td><p>9.5% </p></td><td><p>2.7% </p></td>
+ <td><p>2145_1 </p></td>
+ <td><p>0.68 </p></td>
+ <td><p>11.2 </p></td>
+ <td><p>2.4% </p></td>
+ <td><p>0.1% </p></td>
+ <td><p>9.5% </p></td>
+ <td><p>2.7% </p></td>
</tr>
<tr>
- <td><p>4234_1 </p></td><td><p>0.59 </p></td><td><p>58.7 </p></td><td><p>8.5% </p></td><td><p>1.3% </p></td><td><p>8.5% </p></td><td><p>3.3% </p></td>
+ <td><p>4234_1 </p></td>
+ <td><p>0.59 </p></td>
+ <td><p>58.7 </p></td>
+ <td><p>8.5% </p></td>
+ <td><p>1.3% </p></td>
+ <td><p>8.5% </p></td>
+ <td><p>3.3% </p></td>
</tr>
<tr>
- <td><p>2032_2 </p></td><td><p>0.17 </p></td><td><p>57.8 </p></td><td><p>21.7% </p></td><td><p>0.3% </p></td><td><p>2.7% </p></td><td><p>1.2% </p></td>
+ <td><p>2032_2 </p></td>
+ <td><p>0.17 </p></td>
+ <td><p>57.8 </p></td>
+ <td><p>21.7% </p></td>
+ <td><p>0.3% </p></td>
+ <td><p>2.7% </p></td>
+ <td><p>1.2% </p></td>
</tr>
<tr>
- <td><p>4171_1 </p></td><td><p>0.07 </p></td><td><p>173.9 </p></td><td><p>58.1% </p></td><td><p>1.6% </p></td><td><p>2.1% </p></td><td><p>0.5% </p></td>
+ <td><p>4171_1 </p></td>
+ <td><p>0.07 </p></td>
+ <td><p>173.9 </p></td>
+ <td><p>58.1% </p></td>
+ <td><p>1.6% </p></td>
+ <td><p>2.1% </p></td>
+ <td><p>0.5% </p></td>
</tr>
</table>
@@ -68,5 +105,6 @@
</p>
<p>3
-</p></body>
+</p></div>
+</body>
</html>
diff --git a/extract/test/twotables_1.pdf.mutool.html.ref b/extract/test/twotables_1.pdf.mutool.html.ref
index 1b66afc5..f13a82e0 100644
--- a/extract/test/twotables_1.pdf.mutool.html.ref
+++ b/extract/test/twotables_1.pdf.mutool.html.ref
@@ -1,25 +1,51 @@
<html>
<body>
+<div>
<table border="1" style="border-collapse:collapse">
<tr>
- <td rowspan="3"><p><b>Sl. No. </p></b></td><td><p><b>Name of </p></b></td><td rowspan="3"><p><b>Name of District </p></b></td><td rowspan="3"><p><b>Disease/ Illness </p></b></td><td rowspan="3"><p><b>No. of Cases </p></b></td><td rowspan="3"><p><b>No. of Deaths </p></b></td><td rowspan="3"><p><b>Date of start of outbreak </p></b></td><td rowspan="3"><p><b>Date of reporting </p></b></td><td rowspan="3"><p><b>Current Status </p></b></td><td><p><b>Comments/ Action taken </p></b></td>
+ <td rowspan="3"><p><b>Sl. No. </p></b></td>
+ <td><p><b>Name of </p></b></td>
+ <td rowspan="3"><p><b>Name of District </p></b></td>
+ <td rowspan="3"><p><b>Disease/ Illness </p></b></td>
+ <td rowspan="3"><p><b>No. of Cases </p></b></td>
+ <td rowspan="3"><p><b>No. of Deaths </p></b></td>
+ <td rowspan="3"><p><b>Date of start of outbreak </p></b></td>
+ <td rowspan="3"><p><b>Date of reporting </p></b></td>
+ <td rowspan="3"><p><b>Current Status </p></b></td>
+ <td><p><b>Comments/ Action taken </p></b></td>
</tr>
<tr>
- <td rowspan="2"><p><b>State/UT </p></b></td><td><p><b> </p></b></td>
+ <td rowspan="2"><p><b>State/UT </p></b></td>
+ <td><p><b> </p></b></td>
</tr>
<tr>
<td><p><b> </p></b></td>
</tr>
<tr>
- <td rowspan="4"><p><b> </p></b></td><td rowspan="4"><p><b> </p><p> </p><p> </p><p>West Bengal </p><p> </p></b></td><td rowspan="4"><p><b>Bankura </p><p> </p></b></td><td><p><b>xix. Acute </p></b></td><td rowspan="2"><p>46 </p></td><td rowspan="2"><p>0 </p></td><td rowspan="2"><p>10/11/13 </p></td><td rowspan="2"><p>15/11/13 </p></td><td rowspan="2"><p>Under Control </p></td><td rowspan="2"><p>Cases of loose motion and vomiting reported from Village Daldali, SC Binodnagar, Block Onda, District Bankura. District RRT and Block health team investigated the outbreak. Active search for cases done. Cases treated at local health centre. 2 stool samples collected were negative for cholera culture. Out of 3 water samples collected 1 sample was non potable. Chlorination of water sources done. Health education given regarding safe drinking water and sanitation. </p></td>
+ <td rowspan="4"><p><b> </p></b></td>
+ <td rowspan="4"><p><b> </p><p> </p><p> </p><p>West Bengal </p><p> </p></b></td>
+ <td rowspan="4"><p><b>Bankura </p><p> </p></b></td>
+ <td><p><b>xix. Acute </p></b></td>
+ <td rowspan="2"><p>46 </p></td>
+ <td rowspan="2"><p>0 </p></td>
+ <td rowspan="2"><p>10/11/13 </p></td>
+ <td rowspan="2"><p>15/11/13 </p></td>
+ <td rowspan="2"><p>Under Control </p></td>
+ <td rowspan="2"><p>Cases of loose motion and vomiting reported from Village Daldali, SC Binodnagar, Block Onda, District Bankura. District RRT and Block health team investigated the outbreak. Active search for cases done. Cases treated at local health centre. 2 stool samples collected were negative for cholera culture. Out of 3 water samples collected 1 sample was non potable. Chlorination of water sources done. Health education given regarding safe drinking water and sanitation. </p></td>
</tr>
<tr>
<td><p><b>Diarrhoeal Disease </p></b></td>
</tr>
<tr>
- <td><p><b>xx. Acute </p></b></td><td rowspan="2"><p>34 </p></td><td rowspan="2"><p>0 </p></td><td rowspan="2"><p>10/11/13 </p></td><td rowspan="2"><p>14/11/13 </p></td><td rowspan="2"><p>Under Control </p></td><td rowspan="2"><p>Cases of loose motion and vomiting reported from Village Icharia, SC Mankhamar, Block Onda, District Bankura. District RRT and Block health team investigated the outbreak. House to house survey done. All cases treated locally. 4 stool samples collected were negative for cholera culture. Out of 34 water samples collected, 8 samples were non potable. Chlorination of water sources done. Health education given regarding safe drinking water and sanitation. </p></td>
+ <td><p><b>xx. Acute </p></b></td>
+ <td rowspan="2"><p>34 </p></td>
+ <td rowspan="2"><p>0 </p></td>
+ <td rowspan="2"><p>10/11/13 </p></td>
+ <td rowspan="2"><p>14/11/13 </p></td>
+ <td rowspan="2"><p>Under Control </p></td>
+ <td rowspan="2"><p>Cases of loose motion and vomiting reported from Village Icharia, SC Mankhamar, Block Onda, District Bankura. District RRT and Block health team investigated the outbreak. House to house survey done. All cases treated locally. 4 stool samples collected were negative for cholera culture. Out of 34 water samples collected, 8 samples were non potable. Chlorination of water sources done. Health education given regarding safe drinking water and sanitation. </p></td>
</tr>
<tr>
<td><p><b>Diarrhoeal Disease </p></b></td>
@@ -36,13 +62,29 @@
<td colspan="9"><p> <b>DISEASE OUTBREAKS OF PREVIOUS WEEKS REPORTED LATE </p></b></td>
</tr>
<tr>
- <td rowspan="2"><p><b>Sl. No </p></b></td><td><p><b>Name of </p></b></td><td rowspan="2"><p><b>Name of District </p></b></td><td rowspan="2"><p><b>Disease/ Illness </p></b></td><td rowspan="2"><p><b>Cases </p></b></td><td rowspan="2"><p><b>Deaths </p></b></td><td rowspan="2"><p><b>Date of start of outbreak </p></b></td><td rowspan="2"><p><b>Current Status </p></b></td><td rowspan="2"><p><b>Comments/ Action taken </p></b></td>
+ <td rowspan="2"><p><b>Sl. No </p></b></td>
+ <td><p><b>Name of </p></b></td>
+ <td rowspan="2"><p><b>Name of District </p></b></td>
+ <td rowspan="2"><p><b>Disease/ Illness </p></b></td>
+ <td rowspan="2"><p><b>Cases </p></b></td>
+ <td rowspan="2"><p><b>Deaths </p></b></td>
+ <td rowspan="2"><p><b>Date of start of outbreak </p></b></td>
+ <td rowspan="2"><p><b>Current Status </p></b></td>
+ <td rowspan="2"><p><b>Comments/ Action taken </p></b></td>
</tr>
<tr>
<td><p><b>State/UT </p></b></td>
</tr>
<tr>
- <td rowspan="10"><p><b>1 </p></b></td><td rowspan="10"><p><b> </p><p>Bihar </p><p> </p></b></td><td rowspan="4"><p><b>Madhubani </p></b></td><td></td><td rowspan="4"><p>69 </p></td><td rowspan="4"><p>0 </p></td><td rowspan="4"><p>30/09/13 </p></td><td rowspan="4"><p>Under Control </p></td><td rowspan="4"><p>Cases of diarrhoea and vomiting reported from Village Indra Mandal tola, SC Sugapatti, PHC Phulparas, District Madhubani. District RRT investigated the outbreak. House to house survey done. Medical camp organized. Symptomatic treatement given to cases. ORS packets and halogen tablets distributed in the community. Chlorination of water sources done. IEC done regarding safe drinking water and sanitation. </p></td>
+ <td rowspan="10"><p><b>1 </p></b></td>
+ <td rowspan="10"><p><b> </p><p>Bihar </p><p> </p></b></td>
+ <td rowspan="4"><p><b>Madhubani </p></b></td>
+ <td></td>
+ <td rowspan="4"><p>69 </p></td>
+ <td rowspan="4"><p>0 </p></td>
+ <td rowspan="4"><p>30/09/13 </p></td>
+ <td rowspan="4"><p>Under Control </p></td>
+ <td rowspan="4"><p>Cases of diarrhoea and vomiting reported from Village Indra Mandal tola, SC Sugapatti, PHC Phulparas, District Madhubani. District RRT investigated the outbreak. House to house survey done. Medical camp organized. Symptomatic treatement given to cases. ORS packets and halogen tablets distributed in the community. Chlorination of water sources done. IEC done regarding safe drinking water and sanitation. </p></td>
</tr>
<tr>
<td><p><b>xxi. Acute </p></b></td>
@@ -54,7 +96,13 @@
<td><p><b>Disease </p></b></td>
</tr>
<tr>
- <td rowspan="4"><p><b>Madhubani </p></b></td><td></td><td rowspan="4"><p>30 </p></td><td rowspan="4"><p>1 </p></td><td rowspan="4"><p>28/10/13 </p></td><td rowspan="4"><p>Under Control </p></td><td rowspan="4"><p>Cases of diarrhoea and vomiting reported from Village/SC Rupauli, PHC Jhanjharpur, District Madhubani. District RRT and Block health team investigated the outbreak. Active search for cases done. Medical camp organized. All cases treated. One death occurred in 14yr old female child. ORS packets and halogen tablets distributed. Chlorination of water sources done. IEC activity regarding safe drinking water done. </p></td>
+ <td rowspan="4"><p><b>Madhubani </p></b></td>
+ <td></td>
+ <td rowspan="4"><p>30 </p></td>
+ <td rowspan="4"><p>1 </p></td>
+ <td rowspan="4"><p>28/10/13 </p></td>
+ <td rowspan="4"><p>Under Control </p></td>
+ <td rowspan="4"><p>Cases of diarrhoea and vomiting reported from Village/SC Rupauli, PHC Jhanjharpur, District Madhubani. District RRT and Block health team investigated the outbreak. Active search for cases done. Medical camp organized. All cases treated. One death occurred in 14yr old female child. ORS packets and halogen tablets distributed. Chlorination of water sources done. IEC activity regarding safe drinking water done. </p></td>
</tr>
<tr>
<td><p><b>xxii. Acute </p></b></td>
@@ -66,7 +114,13 @@
<td><p><b>Disease </p></b></td>
</tr>
<tr>
- <td rowspan="2"><p><b>Katihar </p></b></td><td><p><b>xxiii. Acute </p></b></td><td rowspan="2"><p>13 </p></td><td rowspan="2"><p>3 </p></td><td rowspan="2"><p>24/10/13 </p></td><td rowspan="2"><p>Under control </p></td><td rowspan="2"><p>Cases of diarrhoea reported from Village Ahuta, Alipur, SC Lachhor, PHC/Block Balrampur, District Katihar. District RRT investigated the outbreak. House to house survey done. Cases occurred in a Adiwasi community. 3 deaths occurred in 45yr, 35yr and 5yr old male. Temporary medical camps organized. All cases treated symptomatically. Chlorination of water sources done. Health education given. </p></td>
+ <td rowspan="2"><p><b>Katihar </p></b></td>
+ <td><p><b>xxiii. Acute </p></b></td>
+ <td rowspan="2"><p>13 </p></td>
+ <td rowspan="2"><p>3 </p></td>
+ <td rowspan="2"><p>24/10/13 </p></td>
+ <td rowspan="2"><p>Under control </p></td>
+ <td rowspan="2"><p>Cases of diarrhoea reported from Village Ahuta, Alipur, SC Lachhor, PHC/Block Balrampur, District Katihar. District RRT investigated the outbreak. House to house survey done. Cases occurred in a Adiwasi community. 3 deaths occurred in 45yr, 35yr and 5yr old male. Temporary medical camps organized. All cases treated symptomatically. Chlorination of water sources done. Health education given. </p></td>
</tr>
<tr>
<td><p><b>Diarrhoeal Disease </p></b></td>
@@ -79,5 +133,6 @@
</p>
<p>
-</p></body>
+</p></div>
+</body>
</html>
diff --git a/extract/test/twotables_2.pdf.mutool.html.ref b/extract/test/twotables_2.pdf.mutool.html.ref
index 84d1e69d..d51cba7e 100644
--- a/extract/test/twotables_2.pdf.mutool.html.ref
+++ b/extract/test/twotables_2.pdf.mutool.html.ref
@@ -1,5 +1,6 @@
<html>
<body>
+<div>
<p><b>Table 6 : DISTRIBUTION (%) OF HOUSEHOLDS BY LITERACY STATUS OF MALE HEAD OF THE HOUSEHOLD
@@ -7,43 +8,128 @@
<table border="1" style="border-collapse:collapse">
<tr>
- <td></td><td rowspan="2"><p><b>n </p></b></td><td colspan="6"><p><b>Literacy Status </p></b></td>
+ <td></td>
+ <td rowspan="2"><p><b>n </p></b></td>
+ <td colspan="6"><p><b>Literacy Status </p></b></td>
</tr>
<tr>
- <td><p><b>State</p></b></td><td><p><b>Illiterate</p></b></td><td><p><b>Read &amp; Write</p></b></td><td><p><b>1-4 std.</p></b></td><td><p><b>5-8 std.</p></b></td><td><p><b>9-12 std.</p></b></td><td><p><b>College</p></b></td>
+ <td><p><b>State</p></b></td>
+ <td><p><b>Illiterate</p></b></td>
+ <td><p><b>Read &amp; Write</p></b></td>
+ <td><p><b>1-4 std.</p></b></td>
+ <td><p><b>5-8 std.</p></b></td>
+ <td><p><b>9-12 std.</p></b></td>
+ <td><p><b>College</p></b></td>
</tr>
<tr>
- <td><p>Kerala</p></td><td><p>2400</p></td><td><p>7.2</p></td><td><p>0.5</p></td><td><p>25.3</p></td><td><p>20.1</p></td><td><p>41.5</p></td><td><p>5.5</p></td>
+ <td><p>Kerala</p></td>
+ <td><p>2400</p></td>
+ <td><p>7.2</p></td>
+ <td><p>0.5</p></td>
+ <td><p>25.3</p></td>
+ <td><p>20.1</p></td>
+ <td><p>41.5</p></td>
+ <td><p>5.5</p></td>
</tr>
<tr>
- <td><p>Tamil Nadu</p></td><td><p>2400</p></td><td><p>21.4</p></td><td><p>2.3</p></td><td><p>8.8</p></td><td><p>35.5</p></td><td><p>25.8</p></td><td><p>6.2</p></td>
+ <td><p>Tamil Nadu</p></td>
+ <td><p>2400</p></td>
+ <td><p>21.4</p></td>
+ <td><p>2.3</p></td>
+ <td><p>8.8</p></td>
+ <td><p>35.5</p></td>
+ <td><p>25.8</p></td>
+ <td><p>6.2</p></td>
</tr>
<tr>
- <td><p>Karnataka</p></td><td><p>2399</p></td><td><p>37.4</p></td><td><p>2.8</p></td><td><p>12.5</p></td><td><p>18.3</p></td><td><p>23.1</p></td><td><p>5.8</p></td>
+ <td><p>Karnataka</p></td>
+ <td><p>2399</p></td>
+ <td><p>37.4</p></td>
+ <td><p>2.8</p></td>
+ <td><p>12.5</p></td>
+ <td><p>18.3</p></td>
+ <td><p>23.1</p></td>
+ <td><p>5.8</p></td>
</tr>
<tr>
- <td><p>Andhra Pradesh</p></td><td><p>2400</p></td><td><p>54.0</p></td><td><p>1.7</p></td><td><p>8.4</p></td><td><p>13.2</p></td><td><p>18.8</p></td><td><p>3.9</p></td>
+ <td><p>Andhra Pradesh</p></td>
+ <td><p>2400</p></td>
+ <td><p>54.0</p></td>
+ <td><p>1.7</p></td>
+ <td><p>8.4</p></td>
+ <td><p>13.2</p></td>
+ <td><p>18.8</p></td>
+ <td><p>3.9</p></td>
</tr>
<tr>
- <td><p>Maharashtra</p></td><td><p>2400</p></td><td><p>22.0</p></td><td><p>0.9</p></td><td><p>17.3</p></td><td><p>20.3</p></td><td><p>32.6</p></td><td><p>7.0</p></td>
+ <td><p>Maharashtra</p></td>
+ <td><p>2400</p></td>
+ <td><p>22.0</p></td>
+ <td><p>0.9</p></td>
+ <td><p>17.3</p></td>
+ <td><p>20.3</p></td>
+ <td><p>32.6</p></td>
+ <td><p>7.0</p></td>
</tr>
<tr>
- <td><p>Gujarat</p></td><td><p>2390</p></td><td><p>28.6</p></td><td><p>0.1</p></td><td><p>14.4</p></td><td><p>23.1</p></td><td><p>26.9</p></td><td><p>6.8</p></td>
+ <td><p>Gujarat</p></td>
+ <td><p>2390</p></td>
+ <td><p>28.6</p></td>
+ <td><p>0.1</p></td>
+ <td><p>14.4</p></td>
+ <td><p>23.1</p></td>
+ <td><p>26.9</p></td>
+ <td><p>6.8</p></td>
</tr>
<tr>
- <td><p>Madhya Pradesh</p></td><td><p>2402</p></td><td><p>29.1</p></td><td><p>3.4</p></td><td><p>8.5</p></td><td><p>35.1</p></td><td><p>13.3</p></td><td><p>10.6</p></td>
+ <td><p>Madhya Pradesh</p></td>
+ <td><p>2402</p></td>
+ <td><p>29.1</p></td>
+ <td><p>3.4</p></td>
+ <td><p>8.5</p></td>
+ <td><p>35.1</p></td>
+ <td><p>13.3</p></td>
+ <td><p>10.6</p></td>
</tr>
<tr>
- <td><p>Orissa</p></td><td><p>2405</p></td><td><p>33.2</p></td><td><p>1.0</p></td><td><p>10.4</p></td><td><p>25.7</p></td><td><p>21.2</p></td><td><p>8.5</p></td>
+ <td><p>Orissa</p></td>
+ <td><p>2405</p></td>
+ <td><p>33.2</p></td>
+ <td><p>1.0</p></td>
+ <td><p>10.4</p></td>
+ <td><p>25.7</p></td>
+ <td><p>21.2</p></td>
+ <td><p>8.5</p></td>
</tr>
<tr>
- <td><p>West Bengal</p></td><td><p>2293</p></td><td><p>41.7</p></td><td><p>4.4</p></td><td><p>13.2</p></td><td><p>17.1</p></td><td><p>21.2</p></td><td><p>2.4</p></td>
+ <td><p>West Bengal</p></td>
+ <td><p>2293</p></td>
+ <td><p>41.7</p></td>
+ <td><p>4.4</p></td>
+ <td><p>13.2</p></td>
+ <td><p>17.1</p></td>
+ <td><p>21.2</p></td>
+ <td><p>2.4</p></td>
</tr>
<tr>
- <td><p>Uttar Pradesh</p></td><td><p>2400</p></td><td><p>35.3</p></td><td><p>2.1</p></td><td><p>4.5</p></td><td><p>23.3</p></td><td><p>27.1</p></td><td><p>7.6</p></td>
+ <td><p>Uttar Pradesh</p></td>
+ <td><p>2400</p></td>
+ <td><p>35.3</p></td>
+ <td><p>2.1</p></td>
+ <td><p>4.5</p></td>
+ <td><p>23.3</p></td>
+ <td><p>27.1</p></td>
+ <td><p>7.6</p></td>
</tr>
<tr>
- <td><p><b>Pooled</p></b></td><td><p><b>23889</p></b></td><td><p><b>30.9</p></b></td><td><p><b>1.9</p></b></td><td><p><b>12.3</p></b></td><td><p><b>23.2</p></b></td><td><p><b>25.2</p></b></td><td><p><b>6.4</p></b></td>
+ <td><p><b>Pooled</p></b></td>
+ <td><p><b>23889</p></b></td>
+ <td><p><b>30.9</p></b></td>
+ <td><p><b>1.9</p></b></td>
+ <td><p><b>12.3</p></b></td>
+ <td><p><b>23.2</p></b></td>
+ <td><p><b>25.2</p></b></td>
+ <td><p><b>6.4</p></b></td>
</tr>
</table>
@@ -54,48 +140,134 @@
<table border="1" style="border-collapse:collapse">
<tr>
- <td></td><td rowspan="2"><p><b>n</p></b></td><td colspan="6"><p><b>Literacy Status</p></b></td>
+ <td></td>
+ <td rowspan="2"><p><b>n</p></b></td>
+ <td colspan="6"><p><b>Literacy Status</p></b></td>
</tr>
<tr>
- <td><p><b>State</p></b></td><td><p><b>Illiterate</p></b></td><td><p><b>Read &amp; Write</p></b></td><td><p><b>1-4 std.</p></b></td><td><p><b>5-8 std.</p></b></td><td><p><b>9-12 std.</p></b></td><td><p><b>College</p></b></td>
+ <td><p><b>State</p></b></td>
+ <td><p><b>Illiterate</p></b></td>
+ <td><p><b>Read &amp; Write</p></b></td>
+ <td><p><b>1-4 std.</p></b></td>
+ <td><p><b>5-8 std.</p></b></td>
+ <td><p><b>9-12 std.</p></b></td>
+ <td><p><b>College</p></b></td>
</tr>
<tr>
- <td><p>Kerala</p></td><td><p>2400</p></td><td><p>8.8</p></td><td><p>0.3</p></td><td><p>20.1</p></td><td><p>17.0</p></td><td><p>45.6</p></td><td><p>8.2</p></td>
+ <td><p>Kerala</p></td>
+ <td><p>2400</p></td>
+ <td><p>8.8</p></td>
+ <td><p>0.3</p></td>
+ <td><p>20.1</p></td>
+ <td><p>17.0</p></td>
+ <td><p>45.6</p></td>
+ <td><p>8.2</p></td>
</tr>
<tr>
- <td><p>Tamil Nadu</p></td><td><p>2400</p></td><td><p>29.9</p></td><td><p>1.5</p></td><td><p>8.5</p></td><td><p>33.1</p></td><td><p>22.3</p></td><td><p>4.8</p></td>
+ <td><p>Tamil Nadu</p></td>
+ <td><p>2400</p></td>
+ <td><p>29.9</p></td>
+ <td><p>1.5</p></td>
+ <td><p>8.5</p></td>
+ <td><p>33.1</p></td>
+ <td><p>22.3</p></td>
+ <td><p>4.8</p></td>
</tr>
<tr>
- <td><p>Karnataka</p></td><td><p>2399</p></td><td><p>47.9</p></td><td><p>2.5</p></td><td><p>10.2</p></td><td><p>18.8</p></td><td><p>18.4</p></td><td><p>2.3</p></td>
+ <td><p>Karnataka</p></td>
+ <td><p>2399</p></td>
+ <td><p>47.9</p></td>
+ <td><p>2.5</p></td>
+ <td><p>10.2</p></td>
+ <td><p>18.8</p></td>
+ <td><p>18.4</p></td>
+ <td><p>2.3</p></td>
</tr>
<tr>
- <td><p>Andhra Pradesh</p></td><td><p>2400</p></td><td><p>66.4</p></td><td><p>0.7</p></td><td><p>6.8</p></td><td><p>12.9</p></td><td><p>11.4</p></td><td><p>1.8</p></td>
+ <td><p>Andhra Pradesh</p></td>
+ <td><p>2400</p></td>
+ <td><p>66.4</p></td>
+ <td><p>0.7</p></td>
+ <td><p>6.8</p></td>
+ <td><p>12.9</p></td>
+ <td><p>11.4</p></td>
+ <td><p>1.8</p></td>
</tr>
<tr>
- <td><p>Maharashtra</p></td><td><p>2400</p></td><td><p>41.3</p></td><td><p>0.6</p></td><td><p>14.1</p></td><td><p>20.1</p></td><td><p>21.6</p></td><td><p>2.2</p></td>
+ <td><p>Maharashtra</p></td>
+ <td><p>2400</p></td>
+ <td><p>41.3</p></td>
+ <td><p>0.6</p></td>
+ <td><p>14.1</p></td>
+ <td><p>20.1</p></td>
+ <td><p>21.6</p></td>
+ <td><p>2.2</p></td>
</tr>
<tr>
- <td><p>Gujarat</p></td><td><p>2390</p></td><td><p>57.6</p></td><td><p>0.1</p></td><td><p>10.3</p></td><td><p>16.5</p></td><td><p>12.9</p></td><td><p>2.7</p></td>
+ <td><p>Gujarat</p></td>
+ <td><p>2390</p></td>
+ <td><p>57.6</p></td>
+ <td><p>0.1</p></td>
+ <td><p>10.3</p></td>
+ <td><p>16.5</p></td>
+ <td><p>12.9</p></td>
+ <td><p>2.7</p></td>
</tr>
<tr>
- <td><p>Madhya Pradesh</p></td><td><p>2402</p></td><td><p>58.7</p></td><td><p>2.2</p></td><td><p>6.6</p></td><td><p>24.1</p></td><td><p>5.3</p></td><td><p>3.0</p></td>
+ <td><p>Madhya Pradesh</p></td>
+ <td><p>2402</p></td>
+ <td><p>58.7</p></td>
+ <td><p>2.2</p></td>
+ <td><p>6.6</p></td>
+ <td><p>24.1</p></td>
+ <td><p>5.3</p></td>
+ <td><p>3.0</p></td>
</tr>
<tr>
- <td><p>Orissa</p></td><td><p>2405</p></td><td><p>50.0</p></td><td><p>0.9</p></td><td><p>8.1</p></td><td><p>21.9</p></td><td><p>15.1</p></td><td><p>4.0</p></td>
+ <td><p>Orissa</p></td>
+ <td><p>2405</p></td>
+ <td><p>50.0</p></td>
+ <td><p>0.9</p></td>
+ <td><p>8.1</p></td>
+ <td><p>21.9</p></td>
+ <td><p>15.1</p></td>
+ <td><p>4.0</p></td>
</tr>
<tr>
- <td><p>West Bengal</p></td><td><p>2293</p></td><td><p>49.1</p></td><td><p>4.8</p></td><td><p>11.2</p></td><td><p>16.8</p></td><td><p>17.1</p></td><td><p>1.1</p></td>
+ <td><p>West Bengal</p></td>
+ <td><p>2293</p></td>
+ <td><p>49.1</p></td>
+ <td><p>4.8</p></td>
+ <td><p>11.2</p></td>
+ <td><p>16.8</p></td>
+ <td><p>17.1</p></td>
+ <td><p>1.1</p></td>
</tr>
<tr>
- <td><p>Uttar Pradesh</p></td><td><p>2400</p></td><td><p>67.3</p></td><td><p>2.0</p></td><td><p>3.1</p></td><td><p>17.2</p></td><td><p>7.7</p></td><td><p>2.7</p></td>
+ <td><p>Uttar Pradesh</p></td>
+ <td><p>2400</p></td>
+ <td><p>67.3</p></td>
+ <td><p>2.0</p></td>
+ <td><p>3.1</p></td>
+ <td><p>17.2</p></td>
+ <td><p>7.7</p></td>
+ <td><p>2.7</p></td>
</tr>
<tr>
- <td><p><b>Pooled</p></b></td><td><p><b>23889</p></b></td><td><p><b>47.7</p></b></td><td><p><b>1.5</p></b></td><td><p><b>9.9</p></b></td><td><p><b>19.9</p></b></td><td><p><b>17.8</p></b></td><td><p><b>3.3</p></b></td>
+ <td><p><b>Pooled</p></b></td>
+ <td><p><b>23889</p></b></td>
+ <td><p><b>47.7</p></b></td>
+ <td><p><b>1.5</p></b></td>
+ <td><p><b>9.9</p></b></td>
+ <td><p><b>19.9</p></b></td>
+ <td><p><b>17.8</p></b></td>
+ <td><p><b>3.3</p></b></td>
</tr>
</table>
<p>NNMB 75 Rural-Third Repeat Survey 2011-12
-</p></body>
+</p></div>
+</body>
</html>
diff --git a/freetype/CMakeLists.txt b/freetype/CMakeLists.txt
index 4335d66d..cd04b974 100644
--- a/freetype/CMakeLists.txt
+++ b/freetype/CMakeLists.txt
@@ -1,6 +1,6 @@
# CMakeLists.txt
#
-# Copyright (C) 2013-2021 by
+# Copyright (C) 2013-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# Written originally by John Cary <cary@txcorp.com>
@@ -106,10 +106,9 @@
# (this is compatible with the same CMake variables in zlib's CMake
# support).
-# FreeType explicitly marks the API to be exported and relies on the compiler
-# to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
-# starting with 2.8.12.
-cmake_minimum_required(VERSION 2.8.12)
+# To minimize the number of cmake_policy() workarounds,
+# CMake >= 3 is requested.
+cmake_minimum_required(VERSION 3.0)
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
# Allow symbol visibility settings also on static libraries. CMake < 3.3
@@ -122,6 +121,7 @@ endif ()
include(CheckIncludeFile)
include(CMakeDependentOption)
+include(FindPkgConfig)
# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
# configures the base build environment and references the toolchain file
@@ -162,7 +162,7 @@ endif ()
project(freetype C)
set(VERSION_MAJOR "2")
-set(VERSION_MINOR "11")
+set(VERSION_MINOR "12")
set(VERSION_PATCH "1")
# Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
@@ -239,7 +239,7 @@ if (BUILD_FRAMEWORK)
message(FATAL_ERROR
"You should use Xcode generator with BUILD_FRAMEWORK enabled")
endif ()
- set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
+ set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
set(BUILD_SHARED_LIBS ON)
endif ()
@@ -271,11 +271,16 @@ if (NOT FT_DISABLE_ZLIB)
endif ()
if (NOT FT_DISABLE_BZIP2)
+ # Genuine BZip2 does not provide bzip2.pc, but some platforms have it.
+ # For better dependency in freetype2.pc, bzip2.pc is searched
+ # regardless of the availability of libbz2. If bzip2.pc is found,
+ # Requires.private is used instead of Libs.private.
if (FT_REQUIRE_BZIP2)
find_package(BZip2 REQUIRED)
else ()
find_package(BZip2)
endif ()
+ pkg_check_modules(PC_BZIP2 bzip2)
endif ()
if (NOT FT_DISABLE_BROTLI)
@@ -400,6 +405,7 @@ set(BASE_SRCS
src/sdf/sdf.c
src/sfnt/sfnt.c
src/smooth/smooth.c
+ src/svg/svg.c
src/truetype/truetype.c
src/type1/type1.c
src/type42/type42.c
@@ -485,42 +491,48 @@ if (BUILD_FRAMEWORK)
)
set_target_properties(freetype PROPERTIES
FRAMEWORK TRUE
- MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist
+ MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/builds/mac/freetype-Info.plist
PUBLIC_HEADER "${PUBLIC_HEADERS}"
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
)
endif ()
-set(PKG_CONFIG_REQUIRED_PRIVATE "")
-set(PKG_CONFIG_LIBS_PRIVATE "")
+set(PKGCONFIG_REQUIRES "")
+set(PKGCONFIG_REQUIRES_PRIVATE "")
+set(PKGCONFIG_LIBS "-L\${libdir} -lfreetype")
+set(PKGCONFIG_LIBS_PRIVATE "")
if (ZLIB_FOUND)
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
- list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "zlib")
+ list(APPEND PKGCONFIG_REQUIRES_PRIVATE "zlib")
endif ()
if (BZIP2_FOUND)
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
- list(APPEND PKG_CONFIG_LIBS_PRIVATE "-lbz2")
+ if (PC_BZIP2_FOUND)
+ list(APPEND PKGCONFIG_REQUIRES_PRIVATE "bzip2")
+ else ()
+ list(APPEND PKGCONFIG_LIBS_PRIVATE "-lbz2")
+ endif ()
endif ()
if (PNG_FOUND)
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
- list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libpng")
+ list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libpng")
endif ()
if (HarfBuzz_FOUND)
target_link_libraries(freetype PRIVATE ${HarfBuzz_LIBRARY})
target_include_directories(freetype PRIVATE ${HarfBuzz_INCLUDE_DIRS})
- list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
+ list(APPEND PKGCONFIG_REQUIRES_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
endif ()
if (BROTLIDEC_FOUND)
target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES})
target_compile_definitions(freetype PRIVATE ${BROTLIDEC_DEFINITIONS})
target_include_directories(freetype PRIVATE ${BROTLIDEC_INCLUDE_DIRS})
- list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libbrotlidec")
+ list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libbrotlidec")
endif ()
@@ -547,7 +559,7 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
# Generate the pkg-config file
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN)
- string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}")
+ string(REPLACE ";" ", " PKGCONFIG_REQUIRES_PRIVATE "${PKGCONFIG_REQUIRES_PRIVATE}")
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
@@ -559,10 +571,26 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
- string(REPLACE "%REQUIRES_PRIVATE%" "${PKG_CONFIG_REQUIRED_PRIVATE}"
- FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
- string(REPLACE "%LIBS_PRIVATE%" "${PKG_CONFIG_LIBS_PRIVATE}"
- FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+
+ if (BUILD_SHARED_LIBS)
+ string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" "${PKGCONFIG_REQUIRES_PRIVATE}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" "${PKGCONFIG_LIBS_PRIVATE}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ else ()
+ string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES} ${PKGCONFIG_REQUIRES_PRIVATE}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" ""
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS} ${PKGCONFIG_LIBS_PRIVATE}"
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" ""
+ FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
+ endif ()
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
if (EXISTS "${FREETYPE2_PC_IN_NAME}")
diff --git a/freetype/ChangeLog b/freetype/ChangeLog
index e419b471..5de13a6a 100644
--- a/freetype/ChangeLog
+++ b/freetype/ChangeLog
@@ -1,3 +1,1529 @@
+2022-05-01 Werner Lemberg <wl@gnu.org>
+
+ * Version 2.12.1 released.
+ ==========================
+
+ Tag sources with `VER-2-12-1'.
+
+ * docs/VERSION.TXT: Add entry for version 2.12.1.
+ * docs/CHANGES, docs/release: Updated.
+
+ * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
+ builds/windows/visualc/index.html, builds/windows/visualce/index.html,
+ builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
+ docs/freetype-config.1: s/2.12.0/2.12.1/, s/2120/2121/.
+
+ * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
+
+ * builds/unix/configure.raw (version_info): Set to 24:3:18.
+ * CMakeLists.txt (VERSION_PATCH): Set to 1.
+
+2022-04-30 Anuj Verma <anuj@posteo.net>
+
+ [sdf] Do not throw errors for invisible glyphs.
+
+ * src/sdf/ftsdfrend.c (ft_sdf_render, ft_bsdf_render): Return `FT_Err_Ok` if
+ width or height is zero, since some glyphs do not generate visible bitmaps.
+
+ Fixes #1150.
+
+2022-04-30 Werner Lemberg <wl@gnu.org>
+
+ * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_COLOR` for SVG fonts.
+
+ Fixes #1151.
+
+2022-04-27 Brendan Shanks <bshanks@codeweavers.com>
+
+ autogen.sh: Fix building when freetype is itself a git submodule.
+
+ There are situations where .git is not a directory, like when
+ freetype is a submodule in another repository.
+
+2022-04-26 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [builds/windows] Simplify non-desktop UWP check.
+
+ Fixes mingw compilation described in !159.
+
+ * builds/windows/ftsystem.c: Do not use WINAPI_FAMILY_PARTITION macro.
+
+2022-04-25 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [truetype] Reset IUP flags in `TT_RunIns`.
+
+ Fixes #1148 by moving the flag initialization back, partly reverting
+ 7809007a and fd03dcc1. Initializing these flags elsewhere skips 'cvt'.
+
+ * src/truetype/ttinterp.c (TT_RunIns): Initialize the IUP flag here...
+ (TT_Run_Context): ... instead of here.
+
+2022-04-24 Xavier Claessens <xavier.claessens@collabora.com>
+
+ [meson] Remove `default_library=both` from `default_options`.
+
+ It is inconsistent with what all other Meson projects do.
+
+ It also prevents static linking to FreeType when it is a subproject because
+ `default_options` in a subproject takes precedence on values set on the main
+ project. For example, building 'GStreamer' with `-Ddefault_library=static`
+ would still dynamically link on FreeType unless the user also sets
+ `-Dfreetype2:default_library=static`.
+
+ * meson.build: Updated.
+
+ * .gitlab-ci.yml: Retain `both` option for testing.
+
+2022-04-19 Werner Lemberg <wl@gnu.org>
+
+ * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Integer overflow.
+
+ Reported as
+
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=46792
+
+2022-04-16 Georg Brandl <georg@python.org>
+
+ * src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_SVG]: Fix segfault.
+
+ This can happen if the function is called with `size` being `NULL`.
+
+ Fixes #1147.
+
+2022-04-14 Steve Lhomme <robux4@ycbcr.xyz>
+
+ .gitlab-ci.yml: Add a Universal Windows build target
+
+ It's compiled for Windows 10 and up, ensuring UNICODE is set (default for UWP)
+ and selecting the proper WINAPI_FAMILY (WINAPI_FAMILY_APP).
+
+ Do not try to run the UWP exe in the Docker as it doesn't work.
+
+2022-04-04 Ben Wagner <bungeman@chromium.org>
+
+ [sfnt] Correct FT_ColorStopIterator documentation.
+
+ * include/freetype/ftcolor.h (FT_ColorStopIterator): the user should not
+ set `p` to NULL before calling `FT_Get_Colorline_Stops`. `p` and
+ `num_color_stops` are set by `FT_Get_Paint`. `p` and
+ `current_color_stop` are updated by `FT_Get_Colorline_Stops`.
+
+2022-04-01 Werner Lemberg <wl@gnu.org>
+
+ * builds/unix/configure.raw: Add option `--with-librsvg`.
+
+ Since 'librsvg' is written in Rust, this option allows distributions to
+ avoid a dependency on the entire Rust toolchain to provide the FreeType demo
+ programs.
+
+ Suggested by Lars Wendler in !156.
+
+2022-04-01 Werner Lemberg <wl@gnu.org>
+
+ * src/sfnt/sfwoff.c (reconstruct_glyf): Fix gcc 10 warning.
+
+2022-04-01 Werner Lemberg <wl@gnu.org>
+
+ [gzip] Update sources to zlib 1.2.12.
+
+2022-04-01 Eric Jing <@CPUcontrol>
+
+ CMakeLists.txt: Fix `Info.plist` path.
+
+ When building a framework using CMake with `add_subdirectory`, CMake must be
+ able to find `freetype-Info.plist` when configuring the framework
+ properties.
+
+ Fixes #1145.
+
+2022-04-01 Werner Lemberg <wl@gnu.org>
+
+ Whitespace.
+
+2022-04-01 Ben Wagner <bungeman@chromium.org>
+
+ [truetype] Use SUB_LONG for component offset.
+
+ * src/truetype/ttgload.c (TT_Process_Composite_Component): do it.
+
+ Bug: https://crbug.com/1309429
+
+2022-03-31 Werner Lemberg <wl@gnu.org>
+
+ CMakeList.txt: Update code to handle recent changes for `freetype.pc`.
+
+ Fixes #1144.
+
+2022-03-31 Werner Lemberg <wl@gnu.org>
+
+ CMakeLists.txt: s/PKG_CONFIG/PKGCONFIG/, s/REQUIRED_/REQUIRES_/.
+
+2022-03-31 Werner Lemberg <wl@gnu.org>
+
+ * Version 2.12.0 released.
+ ==========================
+
+ Tag sources with `VER-2-12-0'.
+
+ * docs/VERSION.TXT: Add entry for version 2.12.0.
+ * docs/CHANGES, docs/release: Updated.
+
+ * README, src/base/ftver.rc, builds/windows/vc2010/index.html,
+ builds/windows/visualc/index.html, builds/windows/visualce/index.html,
+ builds/wince/vc2005-ce/index.html, builds/wince/vc2008-ce/index.html,
+ docs/freetype-config.1: s/2.11.1/2.12.0/, s/2111/2120/.
+
+ * include/freetype/freetype.h (FREETYPE_MINOR): Set to 12.
+ (FREETYPE_PATCH): Set to 0.
+
+ * builds/unix/configure.raw (version_info): Set to 24:2:18.
+ * CMakeLists.txt (VERSION_MINOR): Set to 12.
+ (VERSION_PATCH): Set to 0.
+
+ * builds/toplevel.mk (do-dist): Generate `ChangeLog` entries for all commits
+ since version 2.11.0 (when we stopped creating this file manually).
+
+2022-03-31 Werner Lemberg <wl@gnu.org>
+
+ Fix clang++ warnings.
+
+ * src/base/ftglyph.c (ft_svg_glyph_prepare), src/base/ftobj.c
+ (ft_glyphslot_init), src/cache/ftccmap.c (ftc_cmap_node_new),
+ src/cache/ftcimage.c (FTC_INode_New), src/lzw/ftlzw.c (FT_Stream_OpenLZW),
+ src/psaux/psobjs.c (ps_parser_load_field), src/pshinter/pshglob.c
+ (psh_globals_new), src/sfnt/ttsvg.c (tt_face_load_svg_doc): Initialize
+ variables used for allocation.
+
+ * src/sdf/ftsdf.c (split_sdf_conic, split_sdf_cubic): Change type of
+ `max_splits` to FT_UInt.
+ (sdf_generate_bounding_box): Add cast.
+
+2022-03-30 Werner Lemberg <wl@gnu.org>
+
+ Whitespace.
+
+2022-03-30 Werner Lemberg <wl@gnu.org>
+
+ [builds] Fix creation of `freetype2.pc` for static-only builds.
+
+ We have to help `pkg-config` since it can't recognize that there is no
+ shared library installed.
+
+ Note that meson already does exactly the same.
+
+ * builds/unix/configure.raw (REQUIRES_PRIVATE, LIBS_PRIVATE): Rename to...
+ (PKGCONFIG_REQUIRES_PRIVATE, PKGCONFIG_LIBS_PRIVATE): This. Adjust them
+ depending on `$enable_shared`.
+ (PKGCONFIG_REQUIRES, PKGCONFIG_LIBS): New variables.
+
+ * builds/unix/freetype2.in, builds/unix/unix-def.in: Use new and updated
+ variables.
+
+2022-03-25 Werner Lemberg <wl@gnu.org>
+
+ Add `FT_FACE_FLAG_SBIX_OVERLAY` and `FT_HAS_SBIX_OVERLAY`.
+
+ * include/freetype/freetype.h (FT_FACE_FLAG_SBIX_OVERLAY,
+ FT_HAS_SBIX_OVERLAY): New macro.
+
+ * src/sfnt/ttsbit.c (tt_face_load_sbit): Handle `FT_FACE_FLAG_SBIX_OVERLAY`.
+ Remove obsolete tracing message.
+
+2022-03-25 Werner Lemberg <wl@gnu.org>
+
+ Add `FT_PARAM_TAG_IGNORE_SBIX`.
+
+ This is another bit to handle 'sbix' tables as described in the OpenType
+ specification.
+
+ * include/freetype/ftparams.h (FT_PARAM_TAG_IGNORE_SBIX): New macro.
+
+ * src/sfnt/sfobjc.c (is_apple_sbix): Rename to...
+ (has_sbix): ... this.
+ Check for more sbit tables.
+ Handle `FT_PARAM_TAG_IGNORE_SBIX` to eventually control `has_sbix`.
+ Only call sbit table loader if an sbit table is present.
+
+2022-03-25 Werner Lemberg <wl@gnu.org>
+
+ [truetype] Fix 'sbix' table handling.
+
+ * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Correct calculation of
+ 'metrics->horiBearingY'.
+ Set vertical metrics.
+
+ * src/sfnt/sfobjs.c (sfnt_load_face): Adjust setting of `FT_FACE_FLAG_SBIX`.
+ Handle metrics of fonts with 'sbix' table.
+
+ * src/truetype/ttgload.c (TT_Load_Glyph): For 'sbix' embedded bitmaps, apply
+ bbox offset and bearing values of the corresponding glyph in the 'glyf'
+ table if it exists and has a contour.
+
+ * src/truetype/ttobjs.c (tt_face_init): Handle font with 'sbix' table.
+
+ Fixes issue #998.
+
+2022-03-25 Werner Lemberg <wl@gnu.org>
+
+ Add `FT_FACE_FLAG_SBIX` and `FT_HAS_SBIX`.
+
+ Fonts with 'sbix' tables need special handling by the application.
+
+ * include/freetype/freetype.h (FT_FACE_FLAG_SBIX, FT_HAS_SBIX): New macros.
+
+ * src/sfnt/sfobjs.c (sfnt_load_face): Set `FT_FACE_FLAG_SBIX` if 'sbix'
+ table is present.
+
+2022-03-25 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/freetype.h (FT_LOAD_SBITS_ONLY): Tag macro as public.
+
+2022-03-24 Carlo Bramini <carlo.bramix@libero.it>
+
+ [builds/windows] Fix WCE support.
+
+ * builds/windows/ftsystem.c [_WIN32_WCE]: Include <malloc.h> needed by
+ _alloca.
+
+2022-03-24 Steve Lhomme <robux4@ycbcr.xyz>
+
+ [build/windows] Improve UWP support.
+
+ * builds/windows/ftsystem.c [UWP]: Wrap CreateFile2 into CreateFileA.
+
+2022-03-21 Werner Lemberg <wl@gnu.org>
+
+ * src/sfnt/ttkern.c (tt_face_get_kerning): Exit early if no table.
+
+ Fixes #1141.
+
+2022-03-20 Ben Wagner <bungeman@chromium.org>
+
+ [woff2] Support overlap flag for simple glyphs.
+
+ In the woff2 spec it has been proposed to allow the OVERLAP_SIMPLE flag
+ to be retained through the woff2 format [0].
+
+ [0] https://www.w3.org/TR/WOFF2/#glyf_table_format
+
+ * src/sfnt/sfwoff2.h (GLYF_OVERLAP_SIMPLE): add glyf flag.
+
+ * src/sfnt/sfwoff2.c (reconstruct_glyf): parse optionFlags and
+ overlapSimpleBitmap[]. (store_points): set OVERLAP_SIMPLE on first point's
+ flag if the overlap bit is set.
+
+2022-03-19 Werner Lemberg <wl@gnu.org>
+
+ [cff] Synchronize `cff_slot_load` with `TT_Load_Glyph`.
+
+ * src/cff/cffgload.c (IS_DEFAULT_INSTANCE): New macro.
+ (cff_slot_load): Use it.
+
+2022-03-19 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftobjs.c (FT_Request_Size): Guard `face->size`.
+
+ Fixes #1140.
+
+2022-03-19 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftobjs.c (ft_open_face_internal): Thinko.
+
+2022-03-19 Ben Wagner <bungeman@chromium.org>
+
+ [doc] FT_OUTLINE_OVERLAP was introduced in 2.10.3.
+
+ * include/freetype/ftimage.h (FT_OUTLINE_OVERLAP): Document when added.
+
+2022-03-19 Werner Lemberg <wl@gnu.org>
+
+ * src/base/ftobjs.c (ft_open_face_internal): Properly guard `face_index`.
+
+ We must ensure that the cast to `FT_Int` doesn't change the sign.
+
+ Fixes #1139.
+
+2022-03-17 Werner Lemberg <wl@gnu.org>
+
+ [sfnt] Avoid invalid face index.
+
+ Fixes #1138.
+
+ * src/sfnt/sfobjs.c (sfnt_init_face), src/sfnt/sfwoff2.c (woff2_open_font):
+ Check `face_index` before decrementing.
+
+2022-03-07 Werner Lemberg <wl@gnu.org>
+
+ Documentation, whitespace.
+
+2022-03-05 Anuj Verma <anuj@womp.xyz>
+
+ [sdf] Fix corner checks and improve performance.
+
+ * src/sdf/ftsdf.c (sdf_generate_bounding_box): Always check for a corner if
+ two distances (for different curves) are very close.
+
+ (sdf_conic_to): Check whether the conic curve can be treated as a line
+ (which happens if the control point coincides with any end point).
+
+2022-03-05 Anuj Verma <anuj@womp.xyz>
+
+ [sdf] Implement deviation-based splitting for Bezier curves.
+
+ * src/sdf/ftsdf.c (split_sdf_cubic, split_sdf_shape): Add checks to figure
+ out the deviation of Bezier curves and stop splitting if the curve is flat
+ enough.
+
+ * src/sdf/ftsdfcommon.h (ONE_PIXEL): New macro.
+
+2022-03-05 Anuj Verma <anuj@womp.xyz>
+
+ * include/freetype/freetype.h: Improve SDF documentation.
+
+2022-03-03 Ben Wagner <bungeman@chromium.org>
+
+ [sfnt] Fix bounds check in SVG.
+
+ The `SVG_DOCUMENT_LIST_MINIMUM_SIZE` macro is non trivial and not
+ protected by parentheses. As a result, the expression
+ `table_size - SVG_DOCUMENT_LIST_MINIMUM_SIZE` expands to
+ `table_size - 2U + SVG_DOCUMENT_RECORD_SIZE` instead of the expected
+ `table_size - (2U + SVG_DOCUMENT_RECORD_SIZE)`. This causes an incorrect
+ bounds check which may lead to reading past the end of the `SVG ` table.
+
+ * src/sfnt/ttsvg.c (tt_face_load_svg): wrap macro definitions in
+ parentheses.
+
+ Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=45179
+
+2022-02-23 Ben Wagner <bungeman@chromium.org>
+
+ [psaux] Full bounds check for OtherSubr 19.
+
+ It is possible for OtherSubr 19 to be invoked when `decoder->buildchar` is
+ NULL (so that `decoder->len_buildchar` is 0), the `blend` is non-NULL with
+ `blend->num_designs` set to 2, and the user supplied `idx` to be large (for
+ example 0xFFFFFFFE). Since these are all `FT_UInt32` the existing bounds
+ check overflows in a well defined manner, allowing for an invalid call to
+ `memcpy`.
+
+ In addition, it is possible to call OtherSubr 19 with
+ `decoder->len_buildchar`, `blend->num_designs`, and `idx` all zero (implying
+ that `blend->weight_vector` and `decoder->buildchar` are NULL). This passes
+ the bounds check (it is logically always fine to copy nothing starting at
+ index zero) but may invoke undefined behavior in `ft_memcpy` if it is backed
+ by `memcpy`. Calling `memcpy` with either the `src` or `dst` NULL is
+ undefined behavior (even if `count` is zero).
+
+ * src/psaux/psintrp.c (cf2_interpT2CharString): Correctly check that
+ `blend->num_designs` can be copied to `decoder->buildchar[idx]`.
+ Also avoid passing NULL to `ft_memcpy`.
+
+ Bug: https://crbug.com/1299259
+
+2022-02-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+ [cmake] Drop the support of CMake 2.x.
+
+ * CMakeLists.txt: Require CMake 3.0 (released on 2014) or newer.
+
+ The issue #1059 reports the difficulty to support both of
+ CMake 2.x and newer one by single CMakeLists.txt without
+ the inflation of cmake_policy() workarounds.
+
+ For better maintainability, the support of CMake 2.x is
+ dropped.
+
+2022-02-19 Werner Lemberg <wl@gnu.org>
+
+ * src/bdf/README: Updated.
+
+2022-02-19 Werner Lemberg <wl@gnu.org>
+
+ * builds/mac/ftmac.c, src/base/ftmac.c: s|FT_MAC_H|<freetype/ftmac.h>|.
+
+2022-02-19 Werner Lemberg <wl@gnu.org>
+
+ src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize.
+
+ A kerning table can be handled by binary search if it has equal entries.
+
+ Fixes #1132.
+
+2022-02-17 Steve Lhomme <robux4@ycbcr.xyz>
+ Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [builds/windows] Add support for legacy UWP builds.
+
+ * builds/windows/ftsystem.c: Add neccessary macro substitutions to
+ enable strict UWP builds.
+
+ See !141.
+
+2022-02-16 Werner Lemberg <wl@gnu.org>
+
+ ftmm.h: Minor documentation improvement.
+
+2022-02-13 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [pshinter] Tune PSH_STRONG_THRESHOLD_MAXIMUM value.
+
+ Before the change, the hinting engine frequently confused horizontal
+ stem and serif hints making some stems too thin and some serifs too
+ thick. The value was tuned using serif fonts from the URW+ base 35
+ collection.
+
+ * src/pshinter/pshalgo.c [PSH_STRONG_THRESHOLD_MAXIMUM]: s/30/12/.
+
+2022-02-12 Werner Lemberg <wl@gnu.org>
+
+ t1tables.h: Documentation improvements.
+
+2022-02-12 Werner Lemberg <wl@gnu.org>
+
+ t1tables.h: Whitespace.
+
+2022-02-11 Werner Lemberg <wl@gnu.org>
+
+ [type42] Fix `FT_Get_PS_Font_Private` for this format.
+
+ Since Type42 fonts don't have a 'Private' dictionary, the return value
+ should be `FT_Err_Invalid_Argument`.
+
+ * src/type42/t42drivr.c (t42_ps_get_font_private): Removed.
+ (t42_service_ps_info): Updated.
+
+2022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [pshinter] Clear reused mask.
+
+ In PS hinter, memory allocations persist until the module is done.
+ Therefore, we have to clear reused masks.
+
+ * src/pshinter/pshrec.c (ps_mask_table_alloc): Clear reused mask.
+
+2022-02-09 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [pshinter] Use unsigned indices.
+
+ This reduces casting and eliminates some checks.
+
+ * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_table_merge,
+ ps_dimension_add_t1stem, ps_hints_t1stem3): Updated.
+ (ps_dimension_add_counter): Updated, unnecessary checks removed.
+
+2022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [pshinter] Fix mask merging.
+
+ We forgot to update the number of bits when merging a larger mask
+ into a smaller one. This fix might have rendering effects.
+
+ * src/pshinter/pshrec.c (ps_mask_table_merge): Inherit the number
+ of bits from a larger mask. There is no need to zero unused bits,
+ already zeroed during allocation.
+ (ps_mask_clear_bit): Removed.
+ (ps_mask_ensure): Minor.
+
+2022-02-08 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [pshinter] Revise the hint table handling.
+
+ * src/pshinter/pshrec.c (ps_hint_table_ensure): Remove redundant size
+ check; avoid array zeroing because it is fully initialized when used.
+ (ps_hint_table_alloc): Fix off-by-one comparison and remove another
+ zeroing of the array elements.
+
+2022-02-06 Werner Lemberg <wl@gnu.org>
+
+ Various minor doc fixes.
+
+2022-02-06 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [builds/windows] Add SVG to to project files.
+
+ * builds/windows/vc2010/freetype.vcxproj: Updated.
+ * builds/windows/vc2010/freetype.vcxproj.filters: Updated.
+ * builds/windows/visualc/freetype.vcproj: Updated.
+
+2022-02-03 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/winfonts/winfnt.c (fnt_face_get_dll_font): Trace font resources.
+
+2022-02-02 Eric Jing <@CPUcontrol>
+
+ [cmake] Fix build on MacOS.
+
+ * CMakeLists.txt (CMAKE_OSX_ARCHITECTURES): Update value to fix the building
+ of a framework on MacOS.
+
+ * builds/mac/freetype-Info.plist (CFBundleExecutable): Make identifier
+ lowercase only.
+
+ Fixes #1127.
+
+2022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [psaux] Revise `PS_Table` handling.
+
+ The old impleemntation was not using `FT_REALLOC`, buing too careful
+ with the offset rebasing. It shoudl be safe to rely on the base
+ movements.
+
+ * src/psaux/psobjs.c (reallocate_t1_table, shift_elements): Combine
+ into...
+ (ps_table_realloc): ... this function based on `FT_REALLOC`.
+ (ps_table_done): Simplified.
+ (ps_table_add): Updated.
+
+2022-02-02 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/cache/ftcmru.c (FTC_MruList_New): Explain zeroing.
+
+2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [cache] Partially revert 9870b6c07e2c.
+
+ Fix crashes reported by Werner.
+
+ * src/cache/ftcmru.c (FTC_MruList_New): Use `FT_ALLOC` again.
+
+2022-01-31 Werner Lemberg <wl@gnu.org>
+
+ freetype.h: Minor documentation improvement.
+
+2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [cache] Fix fallouts from edd4fedc5427.
+
+ Reported by Werner.
+
+ * src/cache/ftcimage.c (FTC_INode_New): Always initialize FT_Glyph.
+ * src/cache/ftcsbits.c (FTC_SNode_New): Always initialize FT_SBit.
+
+2022-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ Clean-up - do not doubt FT_FREE.
+
+ * src/base/ftobjs.c (memory_stream_close): Do not reassign zero
+ after `FT_FREE`.
+ * src/sfnt/sfwoff.c (sfnt_stream_close): Ditto.
+ * src/sfnt/sfwoff2.c (stream_close): Ditto.
+ * src/psaux/psobjs.c (ps_parser_load_field): Ditto.
+ * src/truetype/ttgxvar.c (ft_var_load_avar, tt_set_mm_blend,
+ tt_set_mm_blend): Ditto.
+
+2022-01-30 Werner Lemberg <wl@gnu.org>
+
+ * CMakeLists.txt: Include 'FindPkgConfig' module.
+
+ Older cmake versions don't provide `pkg_check_modules` by default.
+
+ Fixes #1126.
+
+2022-01-30 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/psaux/psobjs.c (ps_parser_load_field): Reduce `string` scope.
+
+2022-01-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+ [cmake] Check the availability of `bzip2.pc'.
+
+ (CMakeLists.txt): Check the availability of `bzip2.pc'.
+
+ * If `bzip2.pc' is available, Requires.private should include
+ bzip2, but Libs.private should not include -lbz2.
+
+ * If `bzip2.pc' is unavailable, Requires.private cannot include
+ bzip2, but Libs.private should include -lbz2.
+
+ Fix #897.
+
+2022-01-28 Werner Lemberg <wl@gnu.org>
+
+ * unix/configure.raw: We need 'librsvg' version 2.46.0 or newer.
+
+ Older versions don't have function `rsvg_handle_get_intrinsic_dimensions`.
+
+2022-01-28 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ Minor clean-ups.
+
+ * src/base/ftrfork.c (raccess_make_file_name): Do not set error.
+ * src/sfnt/sfdriver.c (get_win_string, get_apple_string): Ditto.
+ * src/cff/cffobjs.c (cff_strcpy): Do not confuse about error.
+ * src/psaux/psobjs.c (ps_table_done): Ditto.
+ * src/truetype/ttgxvar.c (ft_var_readpacked*, ft_var_load_avar): Ditto.
+
+2022-01-27 Ben Wagner <bungeman@chromium.org>
+
+ Document `FT_Outline_Decompose` degenerate segments.
+
+ `FT_Outline_Decompose` does not filter out and can return degenerate
+ segments in an outline. This can be surprising when attemping to
+ stroke such an outline. Clarify the existing documentation on this
+ matter to cover all forms of degeneracy (without specifying exactly
+ how they will be reported), why they might arise, and better explain in
+ what cases they may be an issue.
+
+ * include/freetype/ftoutlin.h (FT_Outline_Decompose): update
+ documentation.
+
+ Fixes #952.
+
+2022-01-27 Anuj Verma <anujv@posteo.net>
+
+ Fix sdf computation while `USE_SQUARED_DISTANCES`.
+
+ Function `map_fixed_to_sdf` expects spread to be absolute
+ and not squared.
+
+ * src/sdf/ftbsdf.c (finalize_sdf): Pass absolute spread
+ while `map_fixed_to_sdf`.
+
+ * src/sdf/ftsdf.c (sdf_generate_bounding_box): Ditto.
+
+2022-01-27 Tapish Ojha <tapishojha2000@gmail.com>
+
+ [sfnt] Improve sRGB constants.
+
+ * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use slightly
+ more precise values.
+
+ Fixes #1018.
+
+2022-01-27 Werner Lemberg <wl@gnu.org>
+
+ docs/release: Updated.
+
+2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/pfr/pfrload.c (pfr_phy_font_load): Use FT_QNEW_ARRAY.
+
+2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/sdf/ftsdf.c (sdf_*_new): Use standard macro.
+
+2022-01-26 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [pcf] Delay encoding allocation and avoid its zeroing.
+
+ * src/pcf/pcfread.c (pcf_get_encodings): Refactor and use FT_QNEW_ARRAY.
+
+2022-01-25 Werner Lemberg <wl@gnu.org>
+
+ Aarg, typo.
+
+2022-01-25 Werner Lemberg <wl@gnu.org>
+
+ freetype.h: More updates to `FT_LOAD_COLOR` description.
+
+2022-01-25 Werner Lemberg <wl@gnu.org>
+
+ * builds/unix/configure.raw (FT_DEMO_CFLAGS): Pass `-DHAVE-LIBRSVG`.
+
+ This helps in decoupling library support from `pkg-config` for other
+ platforms.
+
+2022-01-25 Werner Lemberg <wl@gnu.org>
+
+ Update documentation for `FT_LOAD_COLOR`.
+
+2022-01-24 Ben Wagner <bungeman@chromium.org>
+
+ [pshinter] Ensure all point flags are initialized.
+
+ Only off curve point flags were fully initialized.
+
+ * src/pshinter/pshalgo.c (psh_glyph_init): always initialize flags.
+
+ Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43930
+
+2022-01-24 Werner Lemberg <wl@gnu.org>
+
+ .mailmap: Typo.
+
+2022-01-23 Werner Lemberg <wl@gnu.org>
+
+ * src/svg/ftsvg.c (ft_svg_property_set): Disallow NULL pointers.
+
+2022-01-23 Werner Lemberg <wl@gnu.org>
+
+ .mailmap: Updated.
+
+2022-01-23 Werner Lemberg <wl@gnu.org>
+
+ More documentation on handling OT-SVG.
+
+2022-01-23 Werner Lemberg <wl@gnu.org>
+
+ * src/svg/ftsvg.c: Rename `svg_hooks` to `svg-hooks` for consistency.
+
+2022-01-22 Werner Lemberg <wl@gnu.org>
+
+ [sfnt] Reject malformed SVG tables.
+
+ * src/sfnt/ttsvg.c (SVG_TABLE_HEADER_SIZE, SVG_DOCUMENT_RECORD_SIZE,
+ SVG_DOCUMENT_LIST_MINIMUM_SIZE, SVG_MINIMUM_SIZE): New macros.
+ (tt_face_load_svg): Check offsets.
+ Check table and record sizes.
+
+ Reported as
+
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43918
+
+2022-01-22 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/psaux/psobjs.c (ps_table_new): Revert to zeroing.
+
+2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [psaux, type1, type42] Avoid annecessary zeroing.
+
+ * src/psaux/psobjs.c (ps_table_new): Use FT_QNEW_ARRAY.
+ * src/type1/t1load.c (parse_encoding): Ditto.
+ * src/type42/t42parse.c (t42_parse_encoding): Ditto.
+
+2022-01-20 Werner Lemberg <wl@gnu.org>
+
+ [builds/unix] Handle 'librsvg' for demo programs.
+
+ * builds/unix/configure.raw: Check for 'librsvg'.
+ (LIB_CLOCK_GETTIME): Don't call `AC_SUBST` on this but on...
+ (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables.
+
+ * builds/unix/unix-cc.in (LIB_CLOCK_GETTIME): Replaced by...
+ (FT_DEMO_CFLAGS, FT_DEMO_LDFLAGS): ... these two new variables.
+
+2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
+
+ Add 'svg' module for OT-SVG rendering.
+
+ * CMakeLists.txt (BASE_SRCS): Add svg module file.
+ * meson.build (ft2_public_headers): Add `otsvg.h`.
+
+ * modules.cfg (RASTER_MODULES): Add `svg` module.
+
+ * builds/meson/parse_modules_cfg.py: Add svg module.
+
+ * include/freetype/config/ftmodule.h: Add `ft_svg_renderer_class`.
+ * include/freetype/fterrdef.h: Add `Invalid_SVG_Document` and
+ `Missing_SVG_Hooks` error codes.
+ * include/freetype/internal/fttrace.h: Add tracing for `otsvg`.
+ * include/freetype/internal/svginterface.h: New file. It adds an interface
+ to enable the presetting hook from the `base` module.
+ * include/freetype/otsvg.h (SVG_Lib_Init_Func, SVG_Lib_Free_Func,
+ SVG_Lib_Render_Func, SVG_Lib_Preset_Slot_Func): New hooks for SVG rendering.
+ (SVG_RendererHooks): New structure to access them.
+
+ * src/base/ftobjs.c: Include `svginterface.h`.
+ (ft_glyphslot_preset_bitmap): Add code for presetting the slot for SVG
+ glyphs.
+ (ft_add_renderer): Updated.
+
+ * src/svg/*: New files.
+
+2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
+
+ Add `FT_Glyph` support for OT-SVG glyphs.
+
+ * include/freetype/ftglyph.h (FT_SvgGlyphRec, FT_SvgGlyph): New structure.
+
+ * src/base/ftglyph.c: Include `otsvg.h`.
+ (ft_svg_glyph_init, ft_svg_glyph_done, ft_svg_glyph_copy,
+ ft_svg_glyph_transform, ft_svg_glyph_prepare): New function.
+ (ft_svg_glyph_class): New class.
+ (FT_New_Glyph, FT_Glyph_To_Bitmap): Updated to handle OT-SVG glyphs.
+ * src/base/ftglyph.h: Updated.
+
+2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
+
+ [truetype, cff] Add code to load SVG document.
+
+ * src/cff/cffgload.c (cff_slot_load): Add code to load SVG doc.
+ * src/truetype/ttgload.c (TT_Load_Glyph): Add code to load SVG doc.
+
+2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
+
+ Add code to load OT-SVG glyph documents.
+
+ * include/freetype/config/ftheader.h (FT_OTSVG_H): New macro.
+ * include/freetype/freetype.h (FT_FACE_FLAG_SVG, FT_HAS_SVG): New macros.
+ (FT_LOAD_SVG_ONLY): New internal macro.
+ * include/freetype/ftimage.h (FT_Glyph_Format): New enumeration value
+ `FT_GLYPH_FORMAT_SVG`.
+ * include/freetype/internal/ftobjs.h (FT_GLYPH_OWN_GZIP_SVG): New macro.
+ * include/freetype/internal/fttrace.h: Add `ttsvg` for `ttsvg.c`.
+ * include/freetype/internal/sfnt.h(load_svg, free_svg, load_svg_doc): New
+ functions.
+ * include/freetype/internal/tttypes.h (TT_FaceRec): Add `svg` for
+ the SVG table.
+ * include/freetype/otsvg.h (FT_SVG_DocumentRec): New structure to hold the
+ SVG document and other necessary information of an OT-SVG glyph in a glyph
+ slot.
+ * include/freetype/tttags.h (TTAG_SVG): New macro.
+
+ * src/base/ftobjs.c: Include `otsvg.h`.
+ (ft_glyphslot_init): Allocate `FT_SVG_DocumentRec` in `slot->other`
+ if the SVG table exists.
+ (ft_glyphslot_clear): Free it upon clean-up if it is a GZIP compressed
+ glyph.
+ (ft_glyphslot_done): Free the document data if it is a GZIP compressed
+ glyph.
+ (FT_Load_Glyph): Don't auto-hint SVG documents.
+
+ * src/cache/ftcbasic.c (ftc_basic_family_load_glyph): Add support for
+ FT_GLYPH_FORMAT_SVG.
+
+ * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttsvg.c`.
+ * src/sfnt/sfdriver.c: Include `ttsvg.h`.
+ (sfnt_interface): Add `tt_face_load_svg`, `tt_face_free_svg` and
+ `tt_face_load_svg_doc`.
+ * src/sfnt/sfnt.c: Include `ttsvg.c`.
+ * src/sfnt/sfobjs.c (sfnt_load_face, sfnt_done_face): Add code to load and
+ free data of the the SVG table.
+ * src/sfnt/ttsvg.c: New file, implementing `tt_face_load_svg`,
+ `tt_face_free_svg` and `tt_face_load_svg_doc`.
+ * src/sfnt/ttsvg.h: Declarations of the SVG functions in
+ `ttsvg.c`.
+
+2022-01-20 Moazin Khatti <moazinkhatri@gmail.com>
+
+ Add flag `FT_CONFIG_OPTION_SVG`.
+
+ This flag is going to be used to conditionally compile support for OT-SVG
+ glyphs. FreeType will do the parsing and rely on external hooks for
+ rendering of OT-SVG glyphs.
+
+ * devel/ftoption.h, include/freetype/config/ftoption.h
+ (FT_CONFIG_OPTION_SVG): New flag.
+
+2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [pshinter] Avoid unnecessary zeroing.
+
+ * src/pshinter/pshalgo.c (psh_hint_table_init,psh_glyph_init,
+ psh_glyph_interpolate_normal_points): Use FT_QNEW_ARRAY.
+
+2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * include/freetype/freetype.h: Clarify `FT_Size` life cycle.
+
+2022-01-20 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [base] Undefined scale means no scale.
+
+ It might be surprising that FreeType does not have default ppem and
+ the size has to be set explicitly or face undefined behavior with
+ undefined variables and errors. This offers an alternative to
+ missing or zero scale by simply setting FT_LOAD_NO_SCALE. Defined
+ behavior is bettr than undefined one.
+
+ This is alternative to !132 and discussed in
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43708
+
+ * src/base/ftobjs.c (FT_Load_Glyph): Deal with zero scale.
+ * include/freetype/freetype.h: Document it.
+
+2022-01-18 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/autofit/afglobal.c (af_face_globals_new): Reduce zeroing.
+
+ Everything in AF_FaceGlobals is initialized except metrics. Those
+ are zeroed here and initialized on demand later.
+
+2022-01-16 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [bdf,type1] Avoid unnecessary hash zeroing.
+
+ * src/bdf/bdflib.c (_bdf_parse_start): Use `FT_QALLOC`.
+ * src/type1/t1load.c (parse_subrs): Use `FT_QNEW`.
+
+2022-01-16 Ozkan Sezer <sezeroz@gmail.com>
+
+ Add Watcom C/C++ calling.
+
+ In the unlikely case the source is built with OpenWatcom's -ec?
+ switches to enforce a calling convention, the qsort() compare
+ function must still be set to __watcall.
+
+ * include/freetype/internal/compiler-macros.h (FT_COMPARE_DEF):
+ Updated.
+
+2022-01-15 Ben Wagner <bungeman@chromium.org>
+
+ [pshinter] Avoid accessing uninitialized zone.
+
+ The `normal_top.count` may be 0, implying no `normal_top.zones` exist.
+ The code must not access these (non-existent) `normal_top.zones`.
+
+ * src/pshinter/pshalgo.c (ps_hints_apply): Do not assume that
+ `normal_top.zones[0]` is initialized. Test `normal_top.count`
+ before using `normal_top.zones[0]`. Do not rescale if there are no
+ `zones`.
+
+ Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43675
+
+2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [cache] Avoid unnecessary zeroing.
+
+ * src/cache/ftccmap.c (ftc_cmap_node_new): Use `FT_QNEW`.
+ * src/cache/ftcimage.c (FTC_INode_New): Ditto.
+ * src/cache/ftcsbits.c (FTC_SNode_New): Ditto.
+
+2022-01-15 Ozkan Sezer <sezeroz@gmail.com>
+
+ Add Watcom C/C++ support.
+
+ * include/freetype/config/integer-types.h: Make sure `long long` is
+ used then available.
+ * include/freetype/internal/ftcalc.h (FT_MSB): Add Watcom C/C++ pragma.
+
+2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/sdf/ftbsdf.c (ED): s/near/prox/.
+
+ This works around the Watcom C definition of `near` as restricted
+ __near.
+
+2022-01-15 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * include/freetype/internal/compiler-macros.h [FT_COMPARE_DEF]: Tighten.
+
+ This works around Watcom C library using __watcall.
+
+2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/pshinter/pshglob.c (psh_globals_new): Avoid zeroing.
+
+ This large allocation is followed by careful initialization. Whatever
+ is missed should be initialized manually.
+
+2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/base/fthash.c (hash_insert): Avoid unnecessary zeroing.
+
+2022-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/bdf/bdflib.c (_bdf_parse_glyphs): Remove redundant assignment.
+
+2022-01-13 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Avoid unnecessary zeroing.
+
+2022-01-13 Ben Wagner <bungeman@chromium.org>
+
+ [bzip2] Reset bzip stream on any error.
+
+ According to the bzip documentation it is undefined what will happen if
+ `BZ2_bzDecompress` is called on a `bz_stream` it has previously returned an
+ error against. If `BZ2_bzDecompress` returns anything other than `BZ_OK`
+ the only valid next action is `BZ2_bzDecompressEnd`.
+
+ Reported as
+
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43564
+
+ * src/bzip2/ftbzip2.c (FT_BZip2FileRec_): Add `reset` to track the need to
+ reset the stream.
+ (ft_bzip2_file_init): Initialize `reset` to 0.
+ (ft_bzip2_file_reset): Set `reset` to 0 after resetting.
+ (ft_bzip2_file_fill_output): Set `reset` to 1 when `BZ2_bzDecompress`
+ returns anything other than `BZ_OK`.
+
+2022-01-12 Werner Lemberg <wl@gnu.org>
+
+ .gitlab-ci.yml: Minor comment cleanups.
+
+2022-01-12 Azamat H. Hackimov <azamat.hackimov@gmail.com>
+
+ .gitlab-ci.yml: Add steps to `before_script` to ensure recent CA.
+
+ Fetch current list of valid CAs from Windows Update and manually import them
+ to trusted datastore. This action is required to make downloads work from
+ sites that need recent Let's Encrypt ISRG Root X1 certificate.
+
+2022-01-11 Ben Wagner <bungeman@chromium.org>
+
+ Revert "[bzip2] Avoid use of uninitialized memory."
+
+ This reverts commit d276bcb7f0c02c20d3585b2e5626702df6d140a6.
+
+ The original commit did avoid the use of uninitialized memory. However,
+ it appears that the original commit is no longer required. The
+ underlying issue was resolved by a change in freetype2-testing "Build
+ bzip2 correctly." [0]. Prior to [0] bzip2 was built without msan, so
+ bzip2 writes were not tracked or considered initialized. Clearing
+ `buffer` in the original commit allowed msan to see the `buffer` content
+ initialized once in FreeType code, but msan saw no writes into buffer
+ from bzip2. With bzip2 now built with msan, the bzip2 writes are
+ properly instrumented and msan sees the bzip2 writes into the buffer. As
+ a result the original commit can be safely reverted to allow for better
+ detection of other uninitialized data scenarios.
+
+ * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Revert to using `FT_QNEW`.
+
+ [0] https://github.com/freetype/freetype2-testing/commit/3c052a837a3c960709227a0d6ddd256e87b88853
+
+2022-01-11 Ben Wagner <bungeman@chromium.org>
+
+ [type42] Track how much type42 ttf data is available.
+
+ Currently `T42_Open_Face` eagerly allocates 12 bytes for the ttf header
+ data which it expects `t42_parse_sfnts` to fill out from /sfnts data.
+ However, there is no guarantee that `t42_parse_sfnts` will actually be
+ called while parsing the type42 data as the /sfnts array may be missing
+ or very short. This is also confusing behavior as it means
+ `T42_Open_Face` is tightly coupled to the implementation of the very
+ distant `t42_parse_sfnts` code which requires at least 12 bytes to
+ already be reserved in `face->ttf_data`.
+
+ `t42_parse_sfnts` itself eagerly updates `face->ttf_size` to track how
+ much space is reserved for ttf data instead of traking how much data has
+ actually been written into `face->ttf_data`. It will also act strangely
+ in the presense of multiple /sfnts arrays.
+
+ * src/type42/t42objs.c (T42_Open_Face): ensure `ttf_data` is initialized
+ to NULL. Free `ttf_data` on error.
+
+ * src/type42/t42parse.c (t42_parse_sfnts): delay setting `ttf_size` and
+ set it to the actual number of bytes read. Ensure `ttf_data` is freed
+ if there are multiple /sfnts arrays or there are any errors.
+
+2022-01-11 Dominik Röttsches <drott@chromium.org>
+
+ [sfnt] Fix limit checks for `COLR` v1 ClipBoxes
+
+ * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Fix off-by-one in
+ limit checks.
+
+2022-01-11 Werner Lemberg <wl@gnu.org>
+
+ Update all copyright notices.
+
+2022-01-11 Werner Lemberg <wl@gnu.org>
+
+ * src/sfnt/ttcolr.c (read_paint): Fix undefined left-shift operation.
+
+ Reported as
+
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43151
+
+2022-01-11 Werner Lemberg <wl@gnu.org>
+
+ * src/type42/t42objs.c (T42_Open_Face): Avoid use of uninitialized memory.
+
+ Reported as
+
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43508
+
+2022-01-11 Werner Lemberg <wl@gnu.org>
+
+ .gitlab-ci.yml: Fix typo in previous commit.
+
+2022-01-11 Werner Lemberg <wl@gnu.org>
+
+ .gitlab-ci.yml: Update Windows image.
+
+ The old image produced errors like
+
+ ```
+ Downloading zlib patch from
+ https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch
+ A fallback URL could be specified using patch_fallback_url key in the wrap file
+ WrapDB connection failed to
+ https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch
+ with error
+ <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify
+ failed: certificate has expired (_ssl.c:1122)>
+ ```
+
+2022-01-11 Werner Lemberg <wl@gnu.org>
+
+ * subprojects/zlib.wrap: Update from upstream.
+
+2022-01-10 Werner Lemberg <wl@gnu.org>
+
+ * src/sfnt/ttcolr.c (tt_face_get_color_glyph_clipbox): Add limit checks.
+
+ Reported as
+
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40716
+
+2022-01-10 Werner Lemberg <wl@gnu.org>
+
+ [zlib] Don't typedef `ptrdiff_t`.
+
+ While using zlib in 'solo' mode (via the `Z_SOLO` macro), we actually
+ include some standard header files, making the typedef fail on systems where
+ the native `ptrdiff_t` type differs.
+
+ Fixes #1124.
+
+ * src/zlib/zutil.h: Comment out definition; it doesn't work on Windows.
+
+ * src/zlib/patches/freetype-zlib.diff: Updated.
+
+2022-01-10 Werner Lemberg <wl@gnu.org>
+
+ [zlib] Some organizational changes.
+
+ We now first apply zlib's `zlib2ansi` script, then FreeType's patch file.
+
+ * src/gzip/README.freetype: Updated.
+
+ * patches/0001-zlib-Fix-zlib-sources-to-compile-for-FreeType.patch: Renamed
+ to...
+ * patches/freetype-zlib.diff: This.
+ Clean up description, then regenerate it as follows:
+
+ - Copy unmodified files from `zlib` repository.
+ - Run `zlib2ansi` script.
+ - Run `git diff -R > patches/freetype-zlib.diff.new`.
+ - Insert patch description of old diff file, then replace old diff with
+ new diff file.
+
+2022-01-09 David Turner <david@freetype.org>
+
+ [gzip] Update sources to zlib 1.2.11
+
+ This can be tested by building with the Unix development build
+
+ make setup devel
+ make
+
+ or by building the freetype-demos programs with
+
+ meson setup build -Dfreetype2:zlib=internal
+ meson compile -C out
+
+ and trying to run `ftview` with a `.pcf.gz` font file.
+
+ * src/gzip/ftgzip.c, src/gzip/rules.mk: Update for new zlib sources. Also
+ remove the temporary fix introduced in commit 6a431038 to work around the
+ fact that the internal sources were too old.
+
+ * src/gzip/README.freetype: New file describing the origin of the sources
+ and how they were modified.
+
+ * src/gzip/patches/*: Patch files applied to original sources.
+
+ * src/gzip/*: Updated zlib sources with the patch file(s) from
+ `src/gzip/patches/` applied, followed by a conversion with zlib's
+ `zlib2ansi` script.
+
+2022-01-09 David Turner <david@freetype.org>
+
+ [meson] Change Zlib configuration option.
+
+ * meson_options.txt, meson.build: Change the format of the 'zlib' meson
+ build configuration option to be a combo with the following choices:
+
+ - none: Do not support gzip-compressed streams at all.
+
+ - internal: Support gzip-compressed streams using the copy of the gzip
+ sources under `src/gzip/`; this should only be used during development
+ to ensure these work properly.
+
+ - external: Support gzip-compressed streams using the 'zlib' Meson
+ subproject, linked as a static library.
+
+ - system: Support gzip-compressed streams using a system-installed version
+ of zlib.
+
+ - auto: Support gzip-compressed streams using a system-installed version
+ of zlib, if available, or using the 'zlib' subproject otherwise. This
+ is the default.
+
+ - disabled: Backward-compatible alias for 'none'.
+
+ - enabled: Backward-compatible alias for 'auto'.
+
+2022-01-09 Werner Lemberg <wl@gnu.org>
+
+ [bzip2] Avoid use of uninitialized memory.
+
+ * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Don't use `FT_QNEW` but
+ `FT_NEW` for setting up `zip` to avoid uninitialized memory access while
+ handling malformed PCF fonts later on.
+
+ Fixes
+
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42800
+
+2022-01-09 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [sfnt] Fix off-by-one error.
+
+ The 0-base index is equal to the number of previosly parsed entries.
+ It is an error to adjust it by one to get the number truncated by
+ a stream error. This is probably inconsequential because valid
+ entries are correctly accounted for.
+
+ * src/sfnt/ttload.c (check_table_dir): Do not adjust the truncated
+ number of tables.
+
+2022-01-08 Werner Lemberg <wl@gnu.org>
+
+ [sfnt, type42] Correct previous commit.
+
+ Really fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773.
+
+ * src/sfnt/ttload.c (check_table_dir): Revert change.
+
+ * src/type42/t42.parse.c (t42_parse_sfnts): Don't use `FT_QREALLOC` but
+ `FT_REALLOC` for setting up `ttf_data` to avoid uninitialized memory access
+ while handling malformed TrueType fonts later on.
+
+2022-01-07 Werner Lemberg <wl@gnu.org>
+
+ * src/sfnt/ttload.c (check_table_dir): Initialize `table`.
+
+ Reported as
+
+ https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=42773
+
+2022-01-07 Werner Lemberg <wl@gnu.org>
+
+ [sfnt] Avoid 'runtime error: applying zero offset to null pointer'.
+
+ * src/sfnt/ttsbit.c (tt_sbit_decoder_load_byte_aligned): Exit early if
+ `line` is NULL.
+
+2022-01-07 Werner Lemberg <wl@gnu.org>
+
+ [autofit, pshinter] Use `FT_OFFSET`.
+
+ This avoids
+
+ ```
+ runtime error: applying zero offset to null pointer
+ ```
+
+ warnings of clang's undefined behaviour sanitizer.
+
+ * src/autofit/afcjk.c (af_cjk_hints_link_segments,
+ af_cjk_hints_compute_edges, af_cjk_hints_compute_blue_edges,
+ af_cjk_hint_edges, af_cjk_align_edge_points): Do it.
+
+ * src/autofit/afhints.c (af_glyph_hints_align_edge_points,
+ af_glyph_hints_align_strong_points): Ditto.
+
+ * src/autofit/aflatin.c (af_latin_metrics_init_widths,
+ af_latin_hints_link_segments, af_latin_hints_compute_edges,
+ af_latin_hints_compute_blue_edges, af_latin_hint_edges): Ditto.
+
+ * src/pshinter/pshalgo.c (psh_hint_table_init): Ditto.
+
+2022-01-06 Ben Wagner <bungeman@chromium.org>
+
+ [truetype] Reset localpoints when varying cvt.
+
+ When iterating over the cvt tuples and reading in the points it is necessary
+ to set all of `localpoints`, `points`, and `point_count` in all cases. The
+ existing code did not reset `localpoints` to `NULL` when there were no
+ private point numbers. If the previous tuple did have private point numbers
+ and set `localpoints` to `ALL_POINTS` this would not be cleared and the
+ wrong branch would be taken later, leading to possible heap buffer overflow.
+
+ * src/truetype/ttgxvar.c (tt_face_vary_cvt): Reset `localpoints` to `NULL`
+ when it isn't valid.
+
+ Fixes: https://crbug.com/1284742
+
+2022-01-02 Werner Lemberg <wl@gnu.org>
+
+ * builds/unix/configure.raw: Restore `SYSTEM_ZLIB` variable.
+
+ This was accidentally removed with commit 93ebcbd0 almost eight years ago.
+
+2021-12-27 Alexander Borsuk <me@alex.bio>
+
+ Fix warnings for CMake Unity builds.
+
+ * src/cache/ftcbasic.c (FT_COMPONENT): Undefine macro before redefinition.
+ * src/smooth/ftgrays.c (TRUNC, FRACT): Ditto.
+
+2021-12-18 Alexander Borsuk <alexander.borsuk@qnective.com>
+
+ Clang-Tidy warning fixes.
+
+ * src/base/ftobjs.c (FT_Get_Paint): Operator has equivalent nested operands.
+ * src/bdf/bdflib.c (_bdf_add_property): Value stored to `fp` is never read.
+ * src/sdf/ftbsdf.c (bsdf_init_distance_map): Value stored to `pixel` is
+ never read.
+ * src/sdf/ftsdf.c (split_sdf_shape): Value stored to `error` is never read.
+
+2021-12-17 Eli Schwartz <eschwartz@archlinux.org>
+
+ * meson.build: Optimize lookup for `python3` program.
+
+ The python module's `find_installation` method is intended to provide
+ routines for compiling and installing python modules into the
+ `site-packages` directory. It does a couple of slow things, including run
+ an introspection command to scrape sysconfig info from the detected
+ interpreter, which are not needed for the sole use case of invoking the
+ found installation as an executable.
+
+ Furthermore, when invoked without the name or path of a python binary, it is
+ hardcoded to always look for `python3` corresponding to the interpreter
+ meson itself uses to run. So using `find_installation` did not even allow
+ detecting `python2` as a fallback.
+
+ Instead, switch to a simple `find_program` lookup that finishes as soon as
+ the program is found.
+
+2021-12-17 Eli Schwartz <eschwartz@archlinux.org>
+
+ * builds/meson/*.py: Fix name of python executable for auxiliary scripts.
+
+ The previous change to check the return code of `run_command` invocations
+ caused the CI to fail. Although most scripts used `python_exe` as the
+ program command, the script to determine the project version did not.
+
+ But, all scripts used `python` as the shebang, and this is not available on
+ all systems. Particularly Debian does not provide a `python` command,
+ though `python3` does exist. This meant that formerly the version number
+ was lacking, and now the build simply fails.
+
+ Instead, rely on `python3` since it is guaranteed to exist when running
+ meson, and `python2` is end of life anyway.
+
+2021-12-17 Eli Schwartz <eschwartz@archlinux.org>
+
+ * meson.build: Check the return value of `run_command`.
+
+ By default, errors are not checked and a command that is somehow broken will
+ just capture incorrect output (likely an empty string). Current development
+ versions of meson now raise a warning for this implicit behavior, and advise
+ explicitly setting the `check:` keyword argumend to determine whether a
+ failing return code should be considered an error.
+
+ Since none of the commands in this project are expected to fail, mark them
+ as required to succeed.
+
+2021-12-13 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [truetype] Upstream the hdmx binary search.
+
+ * src/truetype/ttobjs.h (TT_SizeRec): Add `widthp` for the hdmx
+ widths.
+ * src/truetype/ttobjs.c (tt_size_reset): Initialize `widthp` even
+ though it might never be used by the interpreter.
+ * src/truetype/ttgload.c (tt_loader_init): Avoid repeated searches
+ in the hdmx table.
+
+2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [truetype] Reset the IUP-called flags for each subglyph.
+
+ This fixes fall-out from 7809007a5b88b15, where the composite
+ accents were no longer hinted.
+
+ * src/truetype/ttgload.c (ttloader_init): Move the IUP-called flag
+ initialization from here...
+ * src/truetype/ttinterp.c (TT_Run_Context): ... to here.
+
+2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [truetype] Binary search through the `hdmx` records.
+
+ The `hdmx` table is supposed to be sorted by ppem size, which
+ enables binary search. We also drop the check for the sufficient
+ length of the record because it is now enforced when the table
+ is loaded.
+
+ * include/freetype/internal/tttypes.h (TT_FaceRec): Store the `hdmx`
+ record pointers sorted by ppem instead of ppem's themselves.
+ * src/truetype/ttpload.c (tt_face_load_hdmx): Prudently sort records.
+ (tt_face_get_device_metrics): Implement binary search to retrieve
+ advances.
+
+2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [truetype] Honor FT_LOAD_ADVANCE_ONLY if `hdmx` is usable.
+
+ This simply shortcuts the glyph loading if FT_LOAD_ADVANCE_ONLY
+ is specified by FT_Get_Advances and the `hdmx` data are located.
+ Particularly, the classic v35 interpreter or "verified" ClearType
+ fonts might see 100x speed up in retrieving the hdmx cache.
+
+ * src/truetype/ttgload.c (TT_Load_Glyph): Insert the shortcut.
+
+2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [truetype] Initialize the loader with `hdmx` data.
+
+ The `hdmx` matching can be done before the glyph is loaded.
+
+ * include/freetype/internal/tttypes.h (TT_LoaderRec): Add a field.
+ * src/truetype/ttgload.c (compute_glyph_metrics): Relocate the `hdmx`
+ code from here...
+ (tt_loader_init): ... to here, before the glyph is loaded.
+
+2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [truetype] Relocate subpixel flag setting.
+
+ `TT_RunIns` is too busy to deal with subpixel flags. It is better
+ to set them in `tt_loader_init`, which is executed before each
+ glyph program.
+
+ * src/truetype/ttinterp.c (TT_RunIns): Move the flag setting from
+ here...
+ * src/truetype/ttgload.c (tt_loader_init): ... to here.
+
+2021-12-12 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [truetype] Limit INSTCTRL appication within specs.
+
+ * src/truetype/ttinterp.c (Ins_INSTCTRL): Limit its global effects
+ to the CVT program and local effects to the glyph program.
+
+ This also fixes an Infinality buglet. The `ignore_x_mode` should be
+ locally unset by the glyph program.
+
+2021-12-09 Ben Wagner <bungeman@chromium.org>
+
+ [bdf] Fix use of uninitialized value.
+
+ In _bdf_readstream if the data contained no newline then the buffer
+ would continue to grow and uninitialized data read until either the
+ uninitialized data contained a newline or the buffer reached its
+ maxiumum size. The assumption was that the line was always too long and
+ the buffer had been filled, however this case can also happen when there
+ is not enough data to fill the buffer.
+
+ Correct this by properly setting the cursor to the end of the available
+ data, which may be different from the end of the buffer. This may still
+ result in one extra allocation, but only on malformed fonts.
+
+ * src/bdf/bdflib.c (_bfd_readstream): Correctly update cursor. Remove
+ unread set of `avail`.
+
+ Bug: https://lists.nongnu.org/archive/html/freetype-devel/2021-12/msg00001.html
+
+2021-12-07 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [truetype] Reduce Infinality footprint again.
+
+ * src/truetype/ttgload.c (compute_glyph_metrics): Streamline and
+ prioritize the Infinality checks to use `hdmx`.
+
+2021-12-07 Cameron Cawley <ccawley2011@gmail.com>
+
+ [builds/windows] Guard some non-ancient API.
+
+ We can support Windows 98 and NT 4.0 in principle...
+
+ * builds/windows/ftdebug.c, builds/windows/ftsystem.c: Check for the
+ ancient SDK using _WIN32_WINDOWS, _WIN32_WCE, or _WIN32_WINNT.
+
+2021-12-07 Cameron Cawley <ccawley2011@gmail.com>
+
+ * builds/windows/visualc/freetype.vcproj: Add missing file.
+
2021-12-02 Werner Lemberg <wl@gnu.org>
* Version 2.11.1 released.
diff --git a/freetype/ChangeLog.20 b/freetype/ChangeLog.20
deleted file mode 100644
index 9f81914e..00000000
--- a/freetype/ChangeLog.20
+++ /dev/null
@@ -1,2613 +0,0 @@
-2002-02-09 Werner Lemberg <wl@gnu.org>
-
- * README: Fix typo.
- * docs/CHANGES: Minor fixes.
-
-
- * Version 2.0.8 released.
- =========================
-
-
-2002-02-08 David Turner <david@freetype.org>
-
- * docs/CHANGES: Updating for 2.0.8.
-
- * include/freetype/freetype.h: Setting `PATCH_LEVEL' to 8 and
- removing `FT_Get_Next_Char' from the API (temporarily).
-
- * include/freetype/freetype.h: Adding comments to FT_Get_Next_Char;
- note that this function might temporarily be removed for the 2.0.8
- release.
-
-2002-02-07 David Turner <david@freetype.org>
-
- * src/pcf/pcfread.c (pcf_load_font): Removed immature support of
- the AVERAGE_WIDTH property.
-
-2002-02-06 David Turner <david@freetype.org>
-
- * src/sfnt/sfobjs.c (SFNT_Load_Face): Since many fonts embedded in
- PDF documents do not include 'cmap', 'post' and 'name' tables, the
- SFNT face loader has been changed to not immediately report an
- error if these are not present.
-
- Note that the specification _requires_ these tables, but Adobe
- seems to ignore it completely.
-
- * src/sfnt/ttcmap.c: Removing compiler warnings.
-
- * src/pcf/pcfread.c (pcf_read_TOC): Use FT_UInt.
- (pcf_parse_metric, pcf_parse_compressed_metric): Removed. Code
- is now in ...
- (pcf_get_metric): Here.
- (pcfSeekToType): Renamed to ...
- (pcf_seek_to_table_type): This.
- Use FT_Int.
- (pcfHasType): Renamed to ...
- (pcf_has_table_type): This.
- Use FT_Int.
- (find_property): Renamed to ...
- (pcf_find_property): This.
- Use FT_Int.
- (pcf_get_bitmaps, pcf_get_encodings): Handle invalid PCF fonts
- better (delaying format checks out of FT_Access_Frame ..
- FT_Forget_Frame blocks to avoid leaving the stream in an incorrect
- state when encountering an invalid PCF font).
-
- * src/pcf/pcfdriver.c (PCF_Done_Face): Renamed to ...
- (PCF_Face_Done): This.
- (PCF_Init_Face): Renamed to ...
- (PCF_Face_Init): This.
- (PCF_Get_Char_Index): Renamed to ...
- (PCF_Char_Get_Index): This.
- (PCF_Get_Next_Char): Renamed to ...
- (PCF_Char_Get_Next): This.
- (pcf_driver_class): Updated.
-
- * src/pcf/pcf.h (PCF_Done_Face): Removed.
-
-2002-02-06 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/pcf/pcfdriver.c (FT_Done_Face): Fixed small memory leak.
-
- * src/pcf/pcfread.c (pcf_load_font): Now handles the `AVERAGE_WIDTH'
- property to return correct character pixel (width/height) pairs for
- embedded bitmaps.
-
-2002-02-04 Keith Packard <keithp@keithp.com>
-
- Adding the function `FT_Get_Next_Char', doing the obvious thing
- w.r.t. the selected charmap.
-
- * include/freetype/freetype.h: Add prototype.
- * include/freetype/internal/ftdriver.h: Add `FTDriver_getNextChar'
- typedef.
- (FT_Driver_Class): Use it.
- * include/freetype/internal/psnames.h: Add `PS_Next_Unicode_Func'
- typedef.
- (PSNames_Interface): Use it.
- * include/freetype/internal/tttypes.h: Add `TT_CharNext_Func'
- typedef.
- (TT_CMapTable): Use it.
-
- * src/base/ftobjs.c (FT_Get_Next_Char): New function, implementing
- high-level API.
- * src/cff/cffdrivr.c (cff_get_next_char): New function.
- (cff_driver_class): Add it.
- * src/cid/cidriver.c (Cid_Get_Next_Char): New function.
- (t1cid_driver_class): Add it.
- * src/pcf/pcfdriver.c (PCF_Get_Next_Char): New function.
- (pcf_driver_class): Add it.
- * src/psnames/psmodule.c (PS_Next_Unicode): New function.
- (psnames_interface): Add it.
- * src/sfnt/ttcmap.c (code_to_next0, code_to_next2, code_to_next4,
- code_to_next6, code_to_next_8_12, code_to_next_10): New auxiliary
- functions.
- (TT_CharMap_Load): Use them.
- * src/truetype/ttdriver.c (Get_Next_Char): New function.
- (tt_driver_class): Add it.
- * src/type1/t1driver.c (Get_Next_Char): New function.
- (t1_driver_class): Add it.
- * src/winfonts/winfnt.c (FNT_Get_Next_Char): New function.
- (winfnt_driver_class): Add it.
-
- * src/pcf/pcfread.c (pcf_load_font): For now, report Unicode for
- Unicode and Latin 1 encodings.
-
-2002-02-02 Keith Packard <keithp@keithp.com>
-
- * builds/unix/freetype-config.in: Add missing `fi'.
-
-
- * Version 2.0.7 released.
- =========================
-
-
-2002-02-01 David Turner <david@freetype.org>
-
- * include/freetype/freetype.h: Increasing FREETYPE_PATCH to 7
- for the new release.
-
-2002-01-31 David Turner <david@freetype.org>
-
- * README, README.UNX, docs/CHANGES: Updating documentation for the
- 2.0.7 release.
-
-2002-01-30 David Turner <david@freetype.org>
-
- * INSTALL: Moved to ...
- * docs/INSTALL: Here to avoid conflicts with the `install' script on
- Windows, where the filesystem doesn't preserve case.
-
-2002-01-29 David Turner <david@freetype.org>
-
- * configure: Fixed the script. It previously didn't accept more
- than one argument correctly. For example, when typing:
-
- ./configure --disable-shared --disable-nls
-
- the `--disable-nls' was incorrectly sent to the `make' program.
-
-2002-01-29 Werner Lemberg <wl@gnu.org>
-
- * README.UNX: Fix typo.
- * builds/unix/install.mk (uninstall): Fix library name for libtool.
-
-2002-01-28 Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>
-
- * src/pcf/pcfdriver.c (PCF_Done_Face): Fix incorrect destruction of
- the face object (face->toc.tables, face->root.family_name,
- face->root.available_size, face->charset_encoding,
- face->charset_registry are now freed). Thanks to Niels Moseley.
-
-2002-01-28 Roberto Alameda <ojancano@geekmail.de>
-
- * src/type1/t1load.c (parse_encoding): Set `loader->num_chars'.
-
-2002-01-28 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_subrs, parse_charstrings): Use copy
- of `base' string for decrypting to not modify the original data.
- Based on a patch by Jakub Bogusz <qboosh@pld.org.pl>.
-
-2002-01-27 Giuliano Pochini <pochini@shiny.it>
-
- * src/smooth/ftgrays.c (gray_render_scanline): Fix bug which caused
- bad rendering of thin lines (less than one pixel thick).
-
-2002-01-25 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffdrivr.c (cff_get_name_index): Make last patch work
- actually.
-
-2002-01-25 Martin Zinser <zinser@decus.de>
-
- * src/cache/ftccache.c (ftc_node_done, ftc_node_destroy): Fix
- compilation warnings.
- * src/base/descrip.mms (OBJS): Add `ftmm.obj'.
- * src/cache/descrip.mms (ftcache.obj): Dependencies added.
-
-2002-01-25 WANG Yi <wangyi@founder.com.cn>
-
- * src/cff/cffdrivr.c (cff_get_name_index): Fix deallocation bug.
-
-2002-01-21 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
-
- * docs/PATENTS: Typo fixed (thanks to Detlef `Hawkeye' Würkner) in
- the URL for the online resource.
-
-2002-01-18 Ian Brown <ian.brown@printsoft.de>
-
- * builds/win32/ftdebug.c: New file.
- * builds/win32/visualc/freetype.dsp: Updated.
-
-2002-01-18 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/src/base/ftsystem.c: Updated for AmigaOS 3.9.
- * builds/amiga/README: Updated.
-
-2002-01-18 Ian Brown <ian.brown@printsoft.de>
-
- * builds/win32/visualc/freetype.dsp: Updated.
-
-2002-01-13 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype2.a4: The script was still buggy.
- * builds/unix/freetype-config.in: Make it really work for any install
- prefix.
-
-2002-01-10 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype2.a4: Fix some serious bugs.
-
-2002-01-09 David Turner <david@freetype.org>
-
- * builds/unix/configure.ac: Build top-level Jamfile.
-
-2002-01-09 Maxim Shemanarev <mcseemagg@yahoo.com>
-
- * src/smooth/ftgrays.c (gray_render_line): Small optimization to
- the smooth anti-aliased renderer that deals with vertical segments.
- This results in a 5-7% speedup in rendering speed.
-
-2002-01-08 David Turner <david@freetype.org>
-
- Added some wrapper scripts to make the installation more
- Unix-friendly.
-
- * configure, install: New files.
-
- * INSTALL, README.UNX: Updated installation documentation to use the
- new 'configure' and 'install' scripts.
-
-2002-01-07 David Turner <david@freetype.org>
-
-
- * Version 2.0.6 released.
- =========================
-
-
- * docs/BUGS, docs/CHANGES: Updating documentation for 2.0.6 release.
-
- * src/tools/docmaker.py: Fixed HTML quoting in sources.
- (html_format): Replaced with ...
- (html_quote): New function.
- (html_quote0): New function.
- (DocCode::dump_html): Small improvement.
- (DocParagraph::dump, DocBlock::html): Use html_quote0 and html_quote.
-
- * include/freetype/config/ftoption.h: Setting default options for
- a release build (debugging off, bytecode interpreter off).
-
- * src/base/ftobjs.c, src/base/ftoutln.c, src/cache/ftccmap.c,
- src/cff/cffload.c, src/cff/cffobjs.c, src/pshinter/pshalgo2.c,
- src/sfnt/ttload.c, src/sfnt/ttsbit.c: Removing small compiler
- warnings (in pedantic compilation modes).
-
-2002-01-05 David Turner <david@freetype.org>
-
- * src/autohint/ahhint.c (ah_align_linked_edge): Modified computation
- of auto-hinted stem widths; this avoids color fringes in
- `ClearType-like' rendering.
-
- * src/truetype/ttgload.c (TT_Load_Glyph_Header,
- TT_Load_Simple_Glyph, TT_Load_Composite_Glyph, load_truetype_glyph):
- Modified the TrueType loader to make it more paranoid; this avoids
- nasty buffer overflows in the case of invalid glyph data (as
- encountered in the output of some buggy font converters).
-
-2002-01-04 David Turner <david@freetype.org>
-
- * README.UNX: Added special README file for Unix users.
-
- * builds/unix/ftsystem.c (FT_New_Stream): Fixed typo.
-
- * src/base/ftobjs.c: Added #include FT_OUTLINE_H to get rid
- of compiler warnings.
-
- * src/base/ftoutln.c (FT_Outline_Check): Remove compiler warning.
-
-2002-01-03 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1objs.c (T1_Face_Init): Add cast to avoid compiler
- warning.
-
-2002-01-03 Keith Packard <keithp@keithp.com>
-
- * builds/unix/ftsystem.c (FT_New_Stream): Added a fix to ensure that
- all FreeType input streams are closed in child processes of a `fork'
- on Unix systems. This is important to avoid (potential) access
- control issues.
-
-2002-01-03 David Turner <david@freetype.org>
-
- * src/type1/t1objs.c (T1_Face_Init): Fixed a bug that crashed the
- library when dealing with certain weird fonts like `Stalingrad', in
- `sadn.pfb' (this font has no full font name entry).
-
- * src/base/ftoutln.c, include/freetype/ftoutln.h (FT_Outline_Check):
- New function to check the consistency of outline data.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Use `FT_Outline_Check' to
- ensure that loaded glyphs are valid. This allows certain fonts like
- `tt1095m_.ttf' to be loaded even though it appears they contain
- really funky glyphs.
-
- There still is a bug there, though.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fix error condition.
-
-2001-12-30 David Turner <david@freetype.org>
-
- * src/autohint/ahhint.c (ah_hinter_load): Fix advance width
- computation of auto-hinted glyphs. This noticeably improves the
- spacing of letters in KDE and Gnome.
-
-2001-12-25 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
-
- * builds/dos/detect.mk: Correcting the order for Borland compilers:
- 16-bit bcc was never selected, always overridden by 32-bit bcc32.
-
-2001-12-22 Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>
-
- * src/pcf/pcfread.c (pcf_load_font): Handle property `POINT_SIZE'
- and fix incorrect computation of `available_sizes'.
-
-2001-12-22 David Turner <david@freetype.org>
-
- * src/autohint/ahhint.c (ah_hinter_load): Auto-hinted glyphs had an
- incorrect glyph advance in the case of mono-width fonts (like
- Courier, Andale Mono, and others).
-
-2001-12-22 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/*: Adaptations to latest changes.
- Support added for MorphOS.
-
-2001-12-22 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshrec.c (FT_COMPONENT): Redefine to `trace_pshrec'.
- (ps_mask_table_merge, ps_hints_open, ps_hints_stem,
- ps_hints_t1stem3, ps_hints_t2mask, ps_hints_t2counter): Fix
- FT_ERROR messages.
- * src/pshinter/pshalgo1.c (FT_COMPONENT): Define as
- `trace_pshalgo1'.
- * src/pshinter/pshalgo2.c (FT_COMPONENT): Define as
- `trace_pshalgo2'.
- * include/freetype/internal/ftdebug.h (FT_Trace): Updated.
-
- * docs/modules.txt: New file.
-
-2001-12-21 David Turner <david@freetype.org>
-
- * src/pshinter/pshrec.c (ps_hints_t2mask, ps_hints_t2counter):
- Ignore invalid `hintmask' and `cntrmask' operators (instead of
- returning an error). Glyph 2028 of the CFF font `MSung-Light-Acro'
- couldn't be rendered otherwise (it seems its charstring is buggy,
- though this requires more analysis).
- (FT_COMPONENT): Define.
-
- * src/cff/cffgload.c (CFF_Parse_CharStrings), src/psaux/t1decode.c
- (T1_Decoder_Parse_Charstrings), src/pshinter/pshalgo2.c (*), Fixed a
- bug where the X and Y axis where inverted in the postscript hinter.
- This caused problem when displaying on non-square surfaces.
-
- * src/pshinter/pshalgo2.c: s/vertical/dimension/.
-
- * src/pshinter/pshglob.c (psh_globals_new): Replaced a floating
- point constant with a fixed-float equivalent. For some reasons not
- all compilers are capable of directly computing a floating pointer
- constant casted to FT_Fixed, and will link a math library instead.
-
-2001-12-20 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftccache.c (ftc_node_destroy, ftc_cache_lookup): Fix
- tracing strings.
- * src/cache/ftccmap.c (ftc_cmap_family_init): Ditto.
- * src/cache/ftcmanag.c (ftc_family_table_alloc,
- ftc_family_table_free, FTC_Manager_Check): Ditto.
- * src/cache/ftcsbits.c (ftc_sbit_node_load): Ditto.
-
- * src/base/ftobjs.c (FT_Done_Library): Remove compiler warning.
-
-2001-12-20 David Turner <david@freetype.org>
-
- Added PostScript hinter support to the CFF and CID drivers.
-
- * include/freetype/internal/cfftypes.h (CFF_Font): New member
- `pshinter'.
- * src/cff/cffload.c (CFF_Get_Standard_Encoding): New function.
- * src/cff/cffload.h: Updated.
- * src/cff/cffgload.c (CFF_Init_Builder): Renamed to ...
- (CFF_Builder_Init): This.
- Added new argument `hinting'.
- (CFF_Done_Builder): Renamed to ...
- (CFF_Builder_Done): This.
- (CFF_Init_Decoder): Added new argument `hinting'.
- (CFF_Parse_CharStrings): Implement vstem support.
- (CFF_Load_Glyph): Updated.
- Add hinting support.
- (cff_lookup_glyph_by_stdcharcode): Use CFF_Get_Standard_Encoding().
- (cff_argument_counts): Updated.
- * src/cff/cffgload.h: Updated.
- * src/cff/cffobjs.c: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
- (CFF_Size_Get_Globals_Funcs, CFF_Size_Done, CFF_Size_Init,
- CFF_Size_Reset, CFF_GlyphSlot_Done, CFF_GlyphSlot_Init): New
- functions.
- (CFF_Init_Face): Renamed to ...
- (CFF_Face_Init): This.
- Add hinter support.
- (CFF_Done_Face): Renamed to ...
- (CFF_Face_Done): This.
- (CFF_Init_Driver): Renamed to ...
- (CFF_Driver_Init): This.
- (CFF_Done_Driver): Renamed to ...
- (CFF_Driver_Done): This.
- * src/cff/cffobjs.h: Updated.
- * src/cff/cffdrivr.c (cff_driver_class): Updated.
-
- * include/freetype/internal/t1types.h (CID_FaceRec): New member
- `pshinter'.
- * src/cid/cidgload.c (CID_Load_Glyph): Add hinter support.
- * src/cid/cidobjs.c: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
- (CID_GlyphSlot_Done, CID_GlyphSlot_Init, CID_Size_Get_Globals_Funcs,
- CID_Size_Done, CID_Size_Init, CID_Size_Reset): New functions.
- (CID_Done_Face): Renamed to ...
- (CID_Face_Done): This.
- (CID_Init_Face): Renamed to ...
- (CID_Face_Init): This.
- Add hinting support.
- (CID_Init_Driver): Renamed to ...
- (CID_Driver_Init): This.
- (CID_Done_Driver): Renamed to ...
- (CID_Driver_Done): This.
- * src/cid/cidobjs.h: Updated.
- * src/cidriver.c: Updated.
-
- * src/pshinter/pshrec.c (t2_hint_stems): Fixed.
-
- * src/base/ftobjs.c (FT_Done_Library): Fixed a stupid bug that
- crashed the library on exit.
-
- * src/type1/t1gload.c (T1_Load_Glyph): Enable font matrix
- transformation of hinted glyphs.
-
- * src/cid/cidload.c (cid_read_subrs): Fix error condition.
-
- * src/cid/cidobjs.c (CID_Face_Done): Fixed a memory leak; the subrs
- routines were never released when CID faces were destroyed.
-
- * src/cff/cffload.h, src/cff/cffload.c, src/cff/cffgload.c: Updated
- to move the definition of encoding tables back within `cffload.c'
- instead of making them part of a shared header (causing problems in
- `multi' builds). This reverts change 2001-08-08.
-
- * docs/CHANGES: Updated for 2.0.6 release.
- * docs/TODO: Added `stem3 and counter hints support' to the TODO
- list for the Postscript hinter.
- * docs/BUGS: Closed the AUTOHINT-NO-SBITS bug.
-
-2001-12-19 David Turner <david@freetype.org>
-
- * include/freetype/cache/ftcache.h: Added comments to indicate that
- some of the exported functions should only be used by applications
- that need to implement custom cache types.
-
- * src/truetype/ttgload.c (cur_to_org, org_to_cur): Fixed a nasty bug
- that prevented composites from loading correctly, due to missing
- parentheses around macro parameters.
-
- * src/sfnt/sfobjs.c (SFNT_Load_Face): Make the `post' and `name'
- tables optional to load PCL fonts properly.
-
- * src/truetype/ttgload.c (TT_Load_Glyph), src/base/ftobjs.c
- (FT_Load_Glyph), include/freetype/freetype.h (FT_LOAD_SBITS_ONLY):
- `Fixed' the bug that prevented embedded bitmaps to be loaded when
- the auto-hinter is used. This actually is a hack but will be enough
- until the internal re-design scheduled for FreeType 2.1.
-
- * src/raster/ftrend1.c (ft_raster1_render): Fixed a nasty outline
- shifting bug in the monochrome renderer.
-
- * README: Updated version numbers to 2.0.6.
-
-2001-12-17 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fix test for invalid
- glyph header.
-
-2001-12-15 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Remove compiler warning.
- * include/freetype/ftcache.h (FTC_Node_Unref): Removed. It is
- already in ftcmanag.h.
- * src/cache/ftcsbits.c (ftc_sbit_node_load): Remove unused variable
- `gfam'.
- * src/cache/ftcmanag.c (ftc_family_table_alloc,
- * ftc_family_table_free): Use FT_EXPORT_DEF.
- * include/freetype/cache/ftcmanag.h: Updated.
- * src/cache/ftccache.c (ftc_node_destroy): Use FT_EXPORT_DEF.
- * src/cache/ftccmap.c (ftc_cmap_node_init): Remove unused variable
- `cfam'.
- Remove compiler warning.
- (FTC_CMapCache_Lookup): Remove compiler warnings.
- (ftc_cmap_family_init): Ditto.
- (FTC_CMapCache_Lookup): Ditto.
-
- * builds/unix/configure.ac: Increase `version_info' to 8:0:2.
- * builds/unix/configure: Regenerated.
-
-2001-12-14 Werner Lemberg <wl@gnu.org>
-
- * builds/mac/README: Updated.
-
-2001-12-14 Scott Long <scott@swiftview.com>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fixing crash when
- dealing with invalid fonts (i.e. glyph size < 10 bytes).
-
-2001-12-14 Sam Latinga <slouken@devolution.com>
-
- * builds/mac/freetype.make: A new Makefile to build with MPW on
- MacOS classic.
-
-2001-12-14 David Turner <david@freetype.org>
-
- * src/truetype/ttgload.c (TT_Load_Glyph), src/type1/t1gload.c
- (T1_Load_Glyph), src/cid/cidgload.c (CID_Load_Glyph),
- src/cff/cffgload.c (CFF_Load_Glyph): Fixed a serious bug common to
- all font drivers (the advance width was never hinted when it
- should).
-
- * include/freetype/freetype.h (FREETYPE_PATCH): New macro.
- * src/base/ftdbgmem.c (debug_mem_dummy) [!FT_DEBUG_MEMORY]: Don't
- use `extern' keyword.
-
-2001-12-12 David Turner <david@freetype.org>
-
- * src/pshinter/pshglob.c (psh_blues_scale_zones, psh_blues_snap_stem
- psh_globals_new): Adding correct BlueScale/BlueShift support, plus
- family blues processing.
- * src/pshinter/pshglob.h (PSH_BluesRec): Updated.
-
- Started adding support for the Postscript hinter in the CFF module.
-
- * src/cff/cffgload.c: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
- (CFF_Parse_CharStrings): Implement it.
- * src/cff/cffgload.h: Updated.
-
-2001-12-12 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype2.m4: Some portability fixes.
-
-2001-12-11 Jouk Jansen <joukj@hrem.stm.tudelft.nl>
-
- * src/base/descrip.mms (OBJS): Add ftdebug.obj.
-
-2001-12-11 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (TT_Load_Generic_Header): Typos.
-
-2001-12-11 David Turner <david@freetype.org>
-
- * builds/unix/freetype-config.in: Modified the script to prevent
- passing `-L/usr/lib' to gcc.
-
- * docs/FTL.TXT: Simple fix (change `LICENSE.TXT' to `FTL.TXT').
-
- * builds/unix/freetype2.m4: New file for checking configure paths.
- We need to install it in $(prefix)/share/aclocal/freetype2.m4 but I
- didn't modify builds/unix/install.mk yet.
-
- * INSTALL: Updated the instructions to build shared libraries with
- Jam. They were simply wrong.
-
- * src/base/fttrigon.c (FT_Cos): Fixed a small bug that caused
- slightly improper results for `FT_Cos' and `FT_Sin' (example:
- FT_Sin(0) == -1!).
-
-2001-12-11 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * include/freetype/internal/ftstream.h (GET_LongLE, GET_ULongLE):
- Fixed incorrect argument types.
-
-2001-12-10 Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>
-
- * src/pcf/pcfdriver.c (PCF_Init_Face): Allow Xft to use PCF fonts
- by setting the `face->metrics.max_advance' correctly.
-
-2001-12-07 David Turner <david@freetype.org>
-
- * include/freetype/cache/ftccmap.h, src/cache/ftccmap.c: Added new
- charmap cache.
- * src/cache/ftcache.c: Updated.
-
- * src/autohint/ahhint.c (ah_hinter_hint_edges): s/UNUSED/FT_UNUSED/.
-
-2001-12-06 Leonard Rosenthol <leonardr@lazerware.com>
-
- Added support for reading .dfont files on Mac OS X. Also added a
- new routine which looks up a given font by name in the Mac OS and
- returns the disk file where it resides.
-
- * src/base/ftmac.c: Include <Files.h> and <TextUtils.h>.
- (is_dfont): New auxiliary function.
- (FT_New_Face_From_dfont): New function.
- (FT_GetFile_From_Mac_Name): New exported function.
- (FT_New_Face): Updated.
- * include/freetype/ftmac.h: Updated.
-
-2001-12-06 David Turner <david@freetype.org>
-
- * src/cache/Jamfile, src/cache/rules.mk: Updated.
-
-2001-12-06 Werner Lemberg <wl@gnu.org>
-
- * INSTALL: Small update.
-
-2001-12-05 David Turner <david@freetype.org>
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Re-ordered code for
- debugging purposes.
- Comment out use of `origin'.
-
- * src/smooth/ftsmooth.c (ft_smooth_render): Fixed a nasty hidden bug
- where outline shifting wasn't correctly undone after bitmap
- rasterization. This created problems with certain glyphs (like '"'
- of certain fonts) and the cache system.
-
- * src/pshinter/pshalgo1.c (psh1_hint_table_init): Fix typo.
- * src/pshinter/pshalgo2.c (psh2_hint_table_init): Fix typo.
- (ps2_hints_apply): Small fix.
-
-2001-12-05 David Turner <david@freetype.org>
-
- * src/pshinter/pshalgo2.c (psh2_hint_table_init),
- src/pshinter/pshalgo1.c (psh1_hint_table_init): Removed compiler
- warnings.
-
- * include/freetype/ftcache.h, include/freetype/cache/*, src/cache/*:
- Yet another massive rewrite of the caching sub-system in order to
- both increase performance and allow simpler cache sub-classing. As
- an example, the code for the image and sbit caches is now much
- simpler.
-
- I still need to update the documentation in
- www/freetype2/docs/cache.html to reflect the new design though.
-
- * include/freetype/config/ftheader.h (FT_CACHE_CHARMAP_H): New
- macro.
- (FT_CACHE_INTERNAL_CACHE_H): Updated.
-
-2001-12-05 David Krause <freetype@davidkrause.com>
-
- * docs/license.txt: s/X Windows/X Window System/.
-
-2001-12-04 Werner Lemberg <wl@gnu.org>
-
- * src/raster/ftraster.c: Fix definition condition of MEM_Set().
- * src/smooth/ftgrays.c (M_Y): Change value to 192.
- * src/base/ftdbgmem.c (ft_mem_table_destroy): Fix printf() parameter.
- Remove unused variable.
- * src/cache/ftcimage.c (ftc_image_node_init,
- ftc_image_node_compare): Remove unused variables.
- * src/cache/ftcsbits.c (ftc_sbit_node_weight): Remove unused
- variable.
- * src/raster/ftraster.c (MEM_Set): Move definition down to avoid
- compiler warning.
- * src/autohint/ahhint.c (ah_hinter_hint_edges): Use UNUSED() to
- avoid compiler warnings.
- * src/pcf/pcfread.c (tableNames): Use `const'.
- (pcf_read_TOC): Change counter name to avoid compiler warning.
- Use `const'.
- * src/pshinter/pshrec.c (ps_hints_close): Remove redundant
- declaration.
- * src/pshinter/pshalgo1.c (psh1_hint_table_init): Rename variables
- to avoid shadowing.
- * src/pshinter/pshalgo2.c (psh2_hint_table_activate_mask): Ditto.
- * src/type1/t1objs.h: Remove double declarations of `T1_Size_Init()'
- and `T1_Size_Done()'.
-
-2001-11-20 Antoine Leca <antoineleca@multimania.com>
-
- * include/freetype/ttnameid.h: Added some new Microsoft language
- codes and LCIDs as found in MSDN (Passport SDK). Also added
- comments about the meaning of bit 57 of the `OS/2' table
- (TT_UCR_SURROGATES) which (with OpenType v.1.3) now means `there is
- a character beyond 0xFFFF in this font'. Thanks to Detlef Würkner
- <TetiSoft@apg.lahn.de> for noticing this.
-
-2001-11-20 David Turner <david@freetype.org>
-
- * src/pshinter/{pshalgo2.c, pshalgo1.c}: Fixed stupid bug in sorting
- routine that created nasty alignment artefacts.
-
- * src/pshinter/pshrec.c, tests/gview.c: Debugging updates.
-
- * src/smooth/ftgrays.c: De-activated experimental gamma support.
- Apparently, `optimal' gamma tables depend on the monitor type,
- resolution and general karma, so it's better to compute them outside
- of the rasterizer itself.
- (gray_convert_glyph): Use `volatile' keyword.
-
-2001-10-29 David Turner <david@freetype.org>
-
- Adding experimental `gamma' support. This produces smoother glyphs
- at small sizes for very little cost.
-
- * src/smooth/ftgrays.c (grays_init_gamma): New function.
- (gray_raster_new): Use it.
-
- Various fixes to the auto-hinter. They merely improve the output of
- sans-serif fonts. Note that there are still problems with serifed
- fonts and composites (accented characters).
-
- * src/autohint/ahglyph.c (ah_outline_load,
- ah_outline_link_segments): Implement it.
- Fix typos.
- (ah_outline_save, ah_outline_compute_segments): Fix typos.
- * src/autohint/ahhint.c (ah_align_serif_edge): New argument
- `vertical'. Implement improvement.
- (ah_hint_edges_3, ah_hinter_hint_edges): Implement it.
- Fix typos.
- (ah_hinter_align_strong_points, ah_hinter_align_weak_points): Fix
- typos.
- (ah_hinter_load): Set `ah_debug_hinter' if DEBUG_HINTER is defined.
- * src/autohint/ahmodule.c: Implement support for DEBUG_HINTER macro.
- * src/autohint/ahtypes.h: Ditto.
- (AH_Hinter): Remove `disable_horz_edges' and `disable_vert_edges'
- (making them global as `ah_debug_disable_horz' and
- `ah_debug_disable_vert').
- Fix typos.
-
- * tests/gview.c: Updated the debugging glyph viewer to show the
- hints generated by the `autohint' module.
-
-2001-10-27 David Turner <david@freetype.org>
-
- * src/cache/ftcchunk.c (ftc_chunk_cache_lookup): Fixed a bug that
- considerably lowered the performance of the abstract chunk cache.
-
-2001-10-26 David Turner <david@freetype.org>
-
- * include/freetype/ftcache.h, include/freetype/cache/*.h,
- src/cache/*.c: Major re-design of the cache sub-system to provide
- better performance as well as an `Acquire'/`Release' API. Seems to
- work well here, but probably needs a bit more testing.
-
-2001-10-26 Leonard Rosenthol <leonardr@lazerware.com>
-
- * builds/mac/README: Updated to reflect my taking over the project
- and that is now being actively maintained.
-
- * src/base/ftmac.c (parse_fond): Applied patches from Paul Miller
- <paulm@profoundeffects.com> to support loading a face other than the
- first from a FOND resource.
- (FT_New_Face_From_FOND): Updated.
-
-2001-10-25 Leonard Rosenthol <leonardr@lazerware.com>
-
- * builds/mac/ftlib.prj: Update of CodeWarrior project file for Mac
- OS for latest version (7) of CWPro and for recent changes to the FT
- source tree.
-
-2001-10-25 David Turner <david@freetype.org>
-
- * include/freetype/config/ftoption.h: Updated comments to explain
- precisely how to use project-specific macro definitions without
- modifying this file manually.
-
- (FT_CONFIG_FORCE_INT64): Define.
-
- (FT_DEBUG_MEMORY): New macro.
-
-2001-10-24 Tom Kacvinsky <tkacvins@freetype.org>
-
- * builds/unix/ftsystem.c (FT_New_Memory): Added a missing `{'.
-
-2001-10-23 David Turner <david@freetype.org>
-
- * include/freetype/internal/ftmemory.h, src/base/ftdbgmem.c:
- Improvements to the memory debugger to report more information in
- case of errors. Also, some allocations that occurred through REALLOC
- couldn't be previously caught correctly.
-
- * src/autohint/ahglyph.c (ah_outline_compute_segments,
- ah_outline_compute_edges), src/raster/ftraster.c (ft_black_new),
- src/smooth/ftgrays.c (gray_render_span, gray_raster_new): Replaced
- liberal uses of memset() by the MEM_Set() macro.
-
-2001-10-23 David Turner <david@freetype.org>
-
- * src/raster/ftraster.c (Update): Removed to be inlined in ...
- (Sort): Updated.
-
-2001-10-22 David Turner <david@freetype.org>
-
- * builds/unix/ftsystem.c (FT_New_Memory, FT_Done_Memory),
- builds/vms/ftsystem.c (FT_New_Memory, FT_Done_Memory),
- builds/amiga/ftsystem.c (FT_New_Memory, FT_Done_Memory),
- src/base/ftdbgmem.c: Updated the memory debugger and
- platform-specific implementations of `ftsystem' in order to be able
- to debug memory allocations on Unix, VMS and Amiga too!
-
- * src/pshinter/pshalgo2.c (psh2_hint_table_record_mask): Removed
- some bogus warnings.
-
- * include/freetype/internal/ftmemory.h, src/base/ftdbgmem.c:
- Modified the debugging memory manager to report the location (source
- file name + line number) where leaked memory blocks are allocated in
- the source file.
-
- * src/base/ftdbgmem.c: New debugging memory manager. You must
- define the FT_DEBUG_MEMORY macro in `ftoption.h' to enable it. It
- will record every memory block allocated and report simple errors
- like memory leaks and double deletes.
-
- * src/base/Jamfile: Include ftdbgmem.
- * src/base/rules.mk: Ditto.
- * src/base/ftbase.c: Include ftdbgmem.c.
-
- * include/freetype/config/ftoption.h: Added the FT_DEBUG_MEMORY
- macro definition.
-
- * src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory): Modified the
- base component to use the debugging memory manager when the macro
- FT_DEBUG_MEMORY is defined.
-
-2001-10-21 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/cffload.c (CFF_Done_Font): Free subfonts array only if
- we are working with a CID keyed CFF font. Otherwise, a variable
- that was never allocated memory might freed. This is a correction
- to the previous patch for freeing subfonts.
-
-2001-10-21 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/cffload.c (CFF_Done_Font): Free the subfonts array to
- avoid a memory leak.
-
-2001-10-21 David Turner <david@freetype.org>
-
- * src/pshinter/pshalgo2.c, src/pshinter/pshalgo1.c,
- src/pshinter/pshglob.c: Removing compiler warnings in pedantic modes
- (in multi-object compilation mode, mainly).
-
-2001-10-20 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/type1/t1load.c (parse_encoding): Add a test to make sure
- that custom encodings (i.e., neither StandardEncoding nor
- ExpertEncoding) are not loaded twice when the Type 1 font is
- synthetic.
-
- * src/type1/t1load.c (parse_font_name, parse_subrs): Added a test
- for when loading synthetic fonts to make sure that the font name
- and subroutines are not loaded twice. This is to remove a memory
- leak that occurred because the original memory blocks for these
- objects were not deallocated when the objects were parsed the
- second time.
-
-2001-10-19 David Turner <david@freetype.org>
-
- * src/smooth/ftgrays.c, src/pshinter/pshglob.h,
- src/pshinter/pshrec.c, src/pshinter/pshalgo2.c: Getting rid of
- compiler warnings.
-
- * src/pshinter/module.mk, src/pshinter/rules.mk: Adding control
- files to build the PostScript hinter with the `old' build system.
-
-2001-10-19 Jacob Jansen <joukj@hrem.stm.tudelft.nl>
-
- * descrip.mms, src/pshinter/descrip.mms: Updates to the VMS build
- files.
-
-2001-10-18 David Turner <david@freetype.org>
-
- * src/psnames/pstables.h, src/tools/glnames.py: Rewrote the
- `glnames.py' script used to generate the `pstables.h' header file.
- The old one contained a serious bug that made FreeType return
- incorrect glyph names for certain glyphs.
-
- * src/truetype/ttdriver.c (Set_Char_Sizes): Changing computation of
- pixel size from character size to use rounding. This is an
- experiment to see whether this gives values similar to Windows for
- scaled ascent/descent/etc.
-
- * src/base/ftcalc.c (FT_Div64by32): Changed the implementation
- slightly since the original code was mis-compiled on Mac machines
- using the MPW C compiler.
-
- * src/base/ftobjs.c (FT_Realloc): When a memory block was grown
- through FT_Realloc(), the new bytes were not set to 0, which created
- some strange bugs in the PostScript hinter.
- (destroy_face): Don't deallocate unconditionally.
-
- * src/cid/cidgload.c (CID_Compute_Max_Advance, CID_Load_Glyph):
- Adding support to new PostScript hinter.
-
- * include/freetype/internal/psglobal.h,
- include/freetype/internal/pshints.h,
- include/freetype/config/ftmodule.h, src/pshinter/Jamfile,
- src/pshinter/pshalgo.h, src/pshinter/pshalgo1.h,
- src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.h,
- src/pshinter/pshalgo2.c, src/pshinter/pshglob.h,
- src/pshinter/pshglob.c, src/pshinter/pshinter.c,
- src/pshinter/pshmod.c, src/pshinter/pshmod.h, src/pshinter/pshrec.c,
- src/pshinter/pshrec.h: Adding new PostScript hinter module.
-
- * include/freetype/internal/ftobjs.h,
- include/freetype/internal/internal.h,
- include/freetype/internal/psaux.h,
- include/freetype/internal/t1types.h, src/psaux/psobjs.c,
- src/psaux/psobjs.h, src/psaux/t1decode.h, src/psaux/t1decode.c,
- src/type1/t1driver.c, src/type1/t1gload.c, src/type1/t1objs.c,
- src/type1/t1objs.h: Updates to use the new PostScript hinter.
-
- * tests/Jamfile, tests/gview.c: Adding a new glyph hinting
- viewer/debugger to the source tree. Note that you will _not_ be
- able to compile it since it depends on an unavailable graphics
- library named `Nirvana' to render vector images.
-
-2001-10-17 David Turner <david@freetype.org>
-
-
- * Version 2.0.5 released.
- =========================
-
-
- * include/freetype/freetype.h, include/internal/ftobjs.h,
- src/base/ftobjs.c, src/type1/t1driver.c: Adding a new function named
- 'FT_Get_Postscript_Name' to retrieve the PostScript name of a given
- font. Should work with all formats except pure CFF/CEF fonts (this
- will be added soon).
-
- * src/cid/cidriver (cid_get_postscript_name): New function.
- (CID_Get_Interface): Handle `postscript_name' interface.
-
- * src/sfnt/sfdriver.c (get_sfnt_postscript_name): New function.
- (SFNT_Get_Interface): Handle `postscript_name' interface.
-
- * src/type1/t1driver.c (t1_get_ps_name): New function.
- (Get_Interface): Handle `postscript_name' interface.
-
- * README, docs/CHANGES: Updated for 2.0.5 release.
-
-2001-10-08 David Turner <david@freetype.org>
-
- Fixed a bug in `glnames.py' that prevented it from generating
- correct glyph names tables. This resulted in the unavailability of
- certain glyphs like `Cacute', `cacute' and `lslash' in Unicode
- charmaps, even if these were present in the font (causing problems
- for Polish users).
-
- * src/tools/glnames.py (mac_standard_names): Fixed.
- (t1_standard_strings): Some fixes and renamed to ...
- (sid_standard_names): This.
- (t1_expert_encoding): Fixed.
- (the_adobe_glyph_list): Renamed to ...
- (adobe_glyph_names): This.
- (the_adobe_glyphs): Renamed to ...
- (adobe_glyph_values): This.
- (dump_mac_indices, dump_glyph_list, dump_unicode_values, main):
- Updated.
- * src/psnames/pstables.h: Regenerated.
- * src/psnames/psmodule.c (PS_Unicode_Value): Fix offset.
- Fix return value.
- Use `sid_standard_table' and `ps_names_to_unicode' instead of
- `t1_standard_glyphs' and `names_to_unicode'.
- (PS_Macintosh_Name): Use `ps_glyph_names' instead of
- `standard_glyph_names'.
- (PS_Standard_Strings): Use `sid_standard_names' instead of
- `t1_standard_glyphs'.
-
- * doc/BUGS, doc/TODO: New documents.
-
-2001-10-07 Richard Barber <rich@solutionuk.com>
-
- * src/cache/ftlru.c (FT_Lru_Lookup_Node): Fixed a bug that prevented
- correct LRU behaviour.
-
-2001-10-07 David Turner <david@freetype.org>
-
- setjmp() and longjmp() are now used for rollback (i.e. when memory
- pool overflow occurs).
-
- Function names are now all uniformly prefixed with `gray_'.
-
- * src/smooth/ftgrays.c: Include <setjmp.h>.
- (ErrRaster_MemoryOverflow): New macro.
- (TArea): New type to store area values in each cell (using `int' was
- too small on 16-bit systems). <limits.h> is included to properly
- get the needed data type.
- (TCell, TRaster): Use it.
- (TRaster): New element `jump_buffer'.
- (gray_compute_cbox): Use `RAS_ARG' as the only parameter and get
- `outline' from it.
- (gray_record_cell): Use longjmp().
- (gray_set_cell): Use gray_record_cell() for error handling.
- (gray_render_line, gray_render_conic, gray_render_cubic): Simplify.
- (gray_convert_glyph_inner): New function, using setjmp().
- (gray_convert_glyph): Use it.
-
-2001-10-07 David Turner <david@freetype.org>
-
- Provide a public API to manage multiple size objects for a given
- FT_Face in the new header file `ftsizes.h'.
-
- * include/freetype/ftsizes.h: New header file,
- * include/freetype/internal/ftobjs.h: Use it.
- Remove declarations of FT_New_Size and FT_Done_Size (moved to
- ftsizes.h).
- * include/freetype/config/ftheader.h (FT_SIZES_H): New macro.
- * src/base/ftobjs.c (FT_Activate_Size): New function.
- * src/cache/ftcmanag.c: Include ftsizes.h.
- (ftc_manager_init_size, ftc_manager_flush_size): Use
- FT_Activate_Size.
-
-2001-09-20 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/*: Added port to Amiga with the SAS/C compiler.
-
-2001-09-15 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/type1/t1afm.c (T1_Done_AFM): Free `afm'.
-
-2001-09-10 Yao Zhang <yzhang@sharemedia.com>
-
- * src/sfnt/ttcmap.c (code_to_index2): Handle code values with
- hi-byte == 0 correctly.
-
-2001-09-10 Werner Lemberg <wl@gnu.org>
-
- * builds/link-std.mk ($(PROJECT_LIBRARY)): Fix typo.
-
-2001-08-30 Martin Muskens <mmuskens@aurelon.com>
-
- * src/type1/t1load.c (parse_font_matrix): A new way to compute the
- units per EM with greater accuracy (important for embedded T1 fonts
- in PDF documents that were automatically generated from TrueType
- ones).
-
- * src/type1/t1load.c (is_alpha): Now supports `+' in font names;
- this is used in embedded fonts.
-
- * src/psaux/psobjs.c (PS_Table_Add): Fixed a reallocation bug that
- generated a dangling pointer reference.
-
-2001-08-30 Anthony Feik <afeick@hotmail.com>
-
- * src/type1/t1afm.c (T1_Read_AFM): Now correctly sets the flag
- FT_FACE_FLAG_KERNING when appropriate for Type1 + AFM files.
-
-2001-08-25 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (TT_Load_CMap): Fix frame length of
- `cmap_rec_fields'.
-
- * include/freetype/fterrors.h [!FT_CONFIG_OPTION_USE_MODULE_ERRORS]:
- Undefine FT_ERR_BASE before defining again.
-
-2001-08-22 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.h: Fix prototype of TT_Move_Func.
-
-2001-08-21 Werner Lemberg <wl@gnu.org>
-
- * builds/dos/dos-def.mk (NO_OUTPUT): Don't use `&>' but `>'.
-
-2001-08-21 David Turner <david@freetype.org>
-
- * include/freetype/config/ftoption.h: Changed the default setting
- for FT_CONFIG_OPTION_USE_MODULE_ERRORS to undefined, since it breaks
- source compatibility in a few cases. Updated the comment to explain
- that too.
-
-2001-08-17 Martin Muskens <mmuskens@aurelon.com>
-
- * src/base/ftcalc.c (FT_MulDiv): Fixed serious typo.
-
-2001-08-12 Werner Lemberg <wl@gnu.org>
-
- Updating to OpenType 1.3.
-
- * include/freetype/internal/tttypes.h (TT_CMap0, TT_CMap2, TT_CMap4,
- TT_CMap6): Adding field `language'.
- (TT_CMapTable): Removing field `language'.
- Type of `length' field changed to FT_ULong.
- Adding fields for cmaps format 8, 10, and 12.
- (TT_CMapGroup): New auxiliary structure.
- (TT_CMap8_12, TT_CMap10): New structures.
- * include/freetype/tttables.h (TT_HoriHeader, TT_VertHeader):
- Removed last element of `Reserved' array.
- * include/freetype/ttnameid.h (TT_PLATFORM_CUSTOM, TT_MS_ID_UCS_4,
- TT_NAME_ID_CID_FINDFONT_NAME): New macros.
-
- * src/sfnt/ttcmap.c (TT_CharMap_Load): Updated loading of `language'
- field to the new structures.
- Fixed freeing of arrays in case of unsuccessful loads.
- Added support for loading format 8, 10, and 12 cmaps.
- (TT_CharMap_Free): Added support for freeing format 8, 10, and 12
- cmaps.
- (code_to_index4): Small improvement.
- (code_to_index6): Ditto.
- (code_to_index8_12, code_to_index10): New functions.
- * src/sfnt/ttload.c (TT_Load_Metrics_Header): Updated to new
- structure.
- (TT_Load_CMap): Ditto.
-
- * src/sfnt/sfobjs.c (tt_encodings): Add MS UCS4 table (before MS
- Unicode).
-
-2001-08-11 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1driver.c (t1_get_name_index): Fix compiler warning.
-
-2001-08-09 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/cffdrivr.c (get_cff_glyph_name): Renamed to
- cff_get_glyph_name for consistency.
-
- (cff_get_glyph_index): Minor documentation change.
-
- * src/type1/t1driver.c (t1_get_name_index): New function used in
- Get_Interface as the function returned when the `name_index'
- function is requested.
-
- (get_t1_glyph_name): Renamed to t1_get_glyph_name for consistency.
-
-2001-08-08 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/cffload.c: Removed definitions of cff_isoadobe_charset,
- cff_expert_charset, cff_expertsubset_charset, cff_standard_encoding,
- and cff_expert_encoding arrays to cffload.h.
-
- * src/cff/cffload.h: Added definitions of cff_isoadobe_charset,
- cff_expert_charset, cff_expertsubset_charset, cff_standard_encoding,
- and cff_expert_encoding arrays.
-
- * src/cff/cffdrivr.c (cff_get_name_index): New function, returned
- when `cff_get_interface' is called with a request for the
- `name_index' function.
-
- (cff_get_interface): Modified so that it returns the function
- `cff_get_name_index' when the `name_index' function is requested.
-
- * src/base/ftobjs.c (FT_Get_Name_Index): New function, used to
- return a glyph index for a given glyph name only if the driver
- supports glyph names.
-
- * include/freetype/internal/ftobjs.h (FT_Name_Index_Requester):
- New function pointer type definition used in the function
- FT_Get_Name_Index.
-
- * include/freetype/freetype.h (FT_Get_Name_Index): Added
- documentation and prototype.
-
-2001-07-26 Werner Lemberg <wl@gnu.org>
-
- * builds/cygwin/*: Removed. Use the unix stuff instead.
-
-2001-07-26 Jouk Jansen <joukj@hrem.stm.tudelft.nl>
-
- * builds/vms/ftconfig.h (FT_CALLBACK_DEF): Updated to change dated
- 2001-06-27.
-
-2001-07-17 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/psaux.h (PS_Table): Use FT_Offset for
- `cursor' and `capacity'.
- * src/psaux/psobjs.c (reallocate_t1_table): Use FT_Long for second
- parameter.
- (PS_Table_Add): Use FT_Offset for `new_size'.
-
- Add support for version 0.5 maxp tables.
-
- * src/sfnt/ttload.c (TT_Load_MaxProfile): Implement it.
- (TT_Load_OS2): Initialize some values.
-
-2001-07-13 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftsynth.c: Include ftcalc.h unconditionally.
-
-2001-07-07 David Turner <david@freetype.org>
-
- * src/truetype/ttgload.c, src/truetype/ttinterp.c, src/pcf/pcfread:
- Removed pedantic compiler warnings when the bytecode interpreter is
- compiled in.
-
-2001-07-03 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahhint.c (ah_hinter_align_weak_points): Remove
- unused variable `edges'.
- (ah_hinter_load): Remove unused variables `old_width' and
- `new_width'.
- * src/cid/cidload.c (cid_decrypt): Use `U' for constant (again).
- * src/psaux/psobjs.c (T1_Decrypt): Ditto.
- * src/type1/t1parse.c (T1_Get_Private_Dict): Ditto.
-
-2001-06-28 David Turner <david@freetype.org>
-
- * include/internal/ftstream.h: Modified the definitions
- of the FT_GET_XXXX and NEXT_XXXX macros for 16-bit correctness.
-
-2001-06-26 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidload.c, src/cid/cidload.h (cid_decrypt): Use FT_Offset
- instead of FT_Int as type for `length' parameter.
- * include/freetype/internal/psaux.h (PSAux_Interface): Updated.
-
-2001-06-27 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * src/psaux/psobjs.c, src/psaux/psobjs.h (T1_Decrypt): Use FT_Offset
- instead of FT_Int as type for `length' parameter.
-
-
- * Version 2.0.4 released.
- =========================
-
-
-2001-06-27 David Turner <david@freetype.org>
-
- * builds/unix/ftconfig.in: Changed the definition of the
- FT_CALLBACK_DEF macro.
-
- * include/freetype/ftconfig.h, src/*/*.c: Changed the definition and
- use of the FT_CALLBACK_DEF macro in order to support 16-bit
- compilers.
-
- * builds/unix/ftconfig.in: Changed the definition of the
- FT_CALLBACK_DEF macro.
-
- * src/sfnt/ttload.c (TT_Load_Kern): The kern table loader now ensures
- that the kerning table is correctly sorted (some problem fonts don't
- have a correct kern table).
-
-2001-06-26 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * include/freetype/internal/ftstream.h (FT_GET_OFF3_LE): Fix typo.
-
-2001-06-24 David Turner <david@freetype.org>
-
- * src/base/ftcalc.c (ft_div64by32): Fixed the source to work
- correctly on 16-bit systems.
-
-2001-06-23 Anthony Fok <fok@debian.org>
-
- * debian/*: Added Debian package build directory for 2.0.4.
-
-2001-06-22 David Turner <david@freetype.org>
-
- * docs/PATENTS: Added patents disclaimer. This one was missing!
-
- * docs/CHANGES, docs/todo: Updated for the upcoming 2.0.4 release.
-
-2001-06-20 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftconfig.h: Add two more `L's to
- constants.
- Add missing semicolons.
-
- * builds/toplevel.mk: Do similar change as for
- builds/unix/detect.mk.
-
- * include/freetype/freetype.h (FT_ENC_TAG): New version to make it
- easier to redefine.
- * include/freetype/ftimage.h (FT_IMAGE_TAG): Ditto.
-
- * src/pcf/pcfread.c (pcf_get_encodings): Add cast.
-
-2001-06-19 David Turner <david@freetype.org>
-
- * builds/win32/visualc/freetype.dsp, builds/win32/visualc/index.html:
- Updated the Visual C++ project (for the 2.0.4 release).
-
- * builds/unix/detect.mk: Added rule for AIX detection (which uses
- /usr/sbin/init instead of /sbin/init).
-
- * include/freetype/fterrors.h, src/*/*err*.h: Updated some of the
- error macros to simplify handling of new error scheme.
-
-2001-06-19 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/fttypes.h (FT_ERROR_MODULE): New macro.
-
-2001-06-19 David Turner <david@freetype.org>
-
- Removing _lots_ of compiler warnings when the most pedantic warning
- levels of Visual C++ and Borland C++ are used. Too many files to be
- listed here, but FT2 now compiles without warnings with VC++ and the
- `/W4' warning level (lint-style).
-
- * include/freetype/freetype.h (FT_New_Memory_Face): Updated
- documentation.
- * include/freetype/fttypes.h (FT_BOOL): New macro.
- * include/freetype/internal/ftdebug.h: Add #pragma for Visual C++
- to suppress warning.
- * include/freetype/internal/ftstream.h (FT_GET_SHORT_{BE,LE},
- FT_GET_OFF3_{BE,LE}, FT_GET_LONG_{BE,LE}): New macros.
- (NEXT_*): Use them.
- * src/autohint/ahglobal.c: Include FT_INTERNAL_DEBUG_H.
- (FT_New_Memory_Face): Add `const' to function declaration.
-
-2001-06-18 Werner Lemberg <wl@gnu.org>
-
- Minor cleanups to remove compiler warnings.
-
- * include/freetype/cache/ftcmanag.h (FTC_MAX_BYTES_DEFAULT): Use
- `L' for constant.
- * include/freetype/config/ftoption.h (FT_RENDER_POOL_SIZE): Ditto.
- * src/base/ftcalc.c (FT_MulDiv): Use `L' for constant.
- * src/base/ftglyph.c (FT_Glyph_Get_CBox): Remove `error' variable.
- * src/base/fttrigon.c (ft_trig_arctan_table): Use `L' for constants.
- * src/base/ftobjs.c (FT_Done_Size): Fix return value.
- (FT_Set_Char_Size, FT_Set_Pixel_Sizes, FT_Get_Kerning): Remove
- unused `memory' variable.
- * src/autohint/ahglyph.c (ah_get_orientation): Use `L' for constant.
- * src/autohint/ahhint.c (ah_hint_edges_3,
- ah_hinter_align_edge_points): Remove unused `before' and `after'
- variables.
- (ah_hinter_align_weak_points): Remove unused `edge_limit' variable.
- (ah_hinter_load): Remove unused `new_advance', `start_contour',
- and `metrics' variables.
- * src/cff/cffload.c (CFF_Load_Encoding): Remove dead code to avoid
- compiler warning.
- * src/cff/cffobjs.c (CFF_Init_Face): Remove unused `base_offset'
- variable.
- * src/cff/cffgload.c (CFF_Parse_CharStrings): Remove unused
- `outline' variable.
- (cff_compute_bias): Use `U' for constant.
- * src/cid/cidload.c (cid_decrypt): Ditto.
- * src/psaux/psobjs.c (T1_Decrypt): Ditto.
- * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
- * src/sfnt/ttload.c (TT_Load_Kern): Remove unused `version'
- variable.
- * src/sfnt/ttsbit.c (TT_Load_SBit_Image): Remove unused `top'
- variable.
- * src/truetype/ttgload.c (load_truetype_glyph): Remove unused
- `num_contours' and `ins_offset' variables.
- (compute_glyph_metrics): Remove unused `Top' and `x_scale'
- variables.
- (TT_Load_Glyph): Remove unused `memory' variable.
- * src/smooth/ftgrays.c (grays_raster_render): Use `L' for constants.
-
-2001-06-18 Werner Lemberg <wl@gnu.org>
-
- Make the new error scheme source compatible with older FT versions
- by introducing another layer.
-
- * include/freetype/fterrors.h (FT_ERRORDEF_, FT_NOERRORDEF_): New
- macros.
- (FT_NOERRORDEF): Removed.
- * include/*/*err*.h: Use FT_ERRORDEF_ and FT_NOERRORDEF_.
-
-2001-06-16 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FT_ENC_TAG): New macro.
- (FT_Encoding_): Use it.
- * include/freetype/ftimage.h (FT_IMAGE_TAG): Define it
- conditionally.
-
-2001-06-14 David Turner <david@freetype.org>
-
- Modified the TrueType interpreter to let it use the new
- trigonometric functions provided in `fttrigon.h'. This gets rid of
- some old 64-bit computation routines, as well as many warnings when
- compiling the library with the `long long' 64-bit integer type.
-
- * include/freetype/config/ftoption.h: Undefine
- FT_CONFIG_OPTION_OLD_CALCS.
- * include/freetype/internal/ftcalc.h: Rearrange use of
- FT_CONFIG_OPTION_OLD_CALCS.
- * src/base/ftcalc.c: Add declaration of FT_Int64 if
- FT_CONFIG_OPTION_OLD_CALCS isn't defined.
- * src/truetype/ttinterp.c: Use FT_TRIGONOMETRY_H.
- (Norm): Add a special version if FT_CONFIG_OPTION_OLD_CALCS isn't
- defined.
- (Current_Ratio, Normalize): Simplify code.
-
-2001-06-11 Mike Owens <MOwens@amtdatasouth.com>
-
- * src/base/ftcalc.c (FT_MulDiv, FT_DivFix, FT_Sqrt64): Remove
- compiler warnings.
-
-2001-06-08 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.in: Renamed to ...
- * builds/unix/configure.ac: This to make sure that autoconf 2.50 is
- needed.
- Run `autoupdate' on it.
- Increase `version_info' to 7:0:1.
- * builds/unix/configure: Regenerated.
-
-2001-06-08 David Turner <david@freetype.org>
-
- * src/autohint/ahhint.c (ah_hinter_load_glyph): Fixed a bug that
- corrupted transformed glyphs that were auto-hinted (the transform
- was applied twice).
-
- Fixed a bug that returned an invalid linear width for composite
- TrueType glyphs.
-
- * include/internal/tttypes.h (TT_Loader_): Two new elements `linear'
- and `linear_def'.
- * src/truetype/ttgload.c (load_truetype_glyph,
- compute_glyph_metrics): Use it.
-
- * include/fttypes.h (FT_ERROR_BASE): New macro.
- * src/base/ftobjs.c (FT_Open_Face, FT_Render_Glyph_Internal): Use it
- to make source code work with the new error scheme implemented by
- Werner.
- * src/base/ftoutln.c (FT_Outline_Render): Ditto.
-
-2001-06-07 Werner Lemberg <wl@gnu.org>
-
- Updating to libtool 1.4.0 and autoconf 2.50.
-
- * builds/unix/ltconfig: Removed.
- * builds/unix/ltmain.sh, builds/unix/configure.in,
- builds/unix/aclocal.m4: Updated.
- * builds/unix/configure: Regenerated.
-
-2001-06-06 Werner Lemberg <wl@gnu.org>
-
- Complete redesign of error codes. Please check ftmoderr.h for more
- details.
-
- * include/freetype/internal/cfferrs.h,
- include/freetype/internal/tterrors.h,
- include/freetype/internal/t1errors.h: Removed. Replaced with files
- local to the module. All extra error codes have been moved to
- `fterrors.h'.
-
- * src/sfnt/ttpost.h: Move error codes to `fterrors.h'.
-
- * src/autohint/aherrors.h, src/cache/ftcerror.h, src/cff/cfferrs.h,
- src/cid/ciderrs.h, src/pcf/pcferror.h, src/psaux/psauxerr.h,
- src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h,
- src/smooth/ftsmerrs.h, src/truetype/tterrors.h,
- src/type1/t1errors.h, src/winfonts/fnterrs.h: New files defining the
- error names for the module it belongs to.
-
- * include/freetype/ftmoderr.h: New file, defining the module error
- offsets. Its structure is similar to `fterrors.h'.
-
- * include/freetype/fterrors.h (FT_NOERRORDEF): New macro.
- (FT_ERRORDEF): Redefined to use module error offsets.
- All internal error codes are now public; unused error codes have
- been removed, some are new.
-
- * include/freetype/config/ftheader.h (FT_MODULE_ERRORS_H): New
- macro.
- * include/freetype/config/ftoption.h
- (FT_CONFIG_OPTION_USE_MODULE_ERRORS): New macro.
-
- All other source files have been updated to use the new error codes;
- some already existing (internal) error codes local to a module have
- been renamed to give them the same name as in the base module.
-
- All make files have been updated to include the local error files.
-
-2001-06-06 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidtokens.h: Replaced with...
- * src/cid/cidtoken.h: This file for 8+3 consistency.
-
- * src/raster/ftraster.c: Use macros for header file names.
-
- * src/include/freetype/tttables.h (TT_HoriHeader_, TT_VertHeader_):
- Fix length of `Reserved' array. Note that this isn't the real fix
- since recent OpenType specs have introduced a `CaretOffset' field
- instead of the first reserved byte.
-
-2001-05-29 Werner Lemberg <wl@gnu.org>
-
- * INSTALL: Minor fixes.
-
-
- * Version 2.0.3 released.
- =========================
-
-
-2001-05-29 David Turner <david@freetype.org>
-
- * INSTALL, docs/CHANGES: Updated.
-
-2001-05-25 David Turner <david@freetype.org>
-
- Moved several documents from the top-level to the `docs' directory.
-
- * src/base/ftcalc.c (FT_DivFix): Small fix to return value.
-
-2001-05-16 David Turner <david@freetype.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fixed a bug in the
- composite loader. Spotted by Keith Packard.
- * src/base/ftobjs.c (FT_GlyphLoader_Check_Points,
- FT_GlyphLoader_Check_Subglyphs): Ditto.
-
-2001-05-14 David Turner <david@freetype.org>
-
- Fixed the incorrect blue zone computations, and improved the
- composite support. Note that these changes result in improved
- rendering, while sometimes introducing their own artefacts. This is
- probably the last big change to the autohinter before the
- introduction of a complete replacement.
-
- * src/autohint/ahglobal.c (sort_values): Fix loop.
- * src/autohint/ahglyph.c: Removed some obsolete code.
- (ah_outline_compute_edges): Modify code to set the ah_edge_round
- flag.
- (ah_outline_compute_blue_edges): Add code to compute active blue
- zones.
- * src/autohint/ahhint.c (ah_hinter_glyph_load): Change load_flags
- value.
-
- * src/base/ftcalc.c (FT_DivFix): Fixed a bug in the 64-bit code that
- created incorrect scale factors!
- (FT_RoundFix, FT_CeilFix, FT_FloorFix): Minor improvements.
-
-2001-05-12 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftbbox.h: FTBBOX_H -> __FTBBOX_H__.
- * include/freetype/fttrigon.h: __FT_TRIGONOMETRY_H__ ->
- __FTTRIGON_H__.
- Include FT_FREETYPE_H.
- Beautified; added copyright.
- * src/base/fttrigon.c: Beautified; added copyright.
-
-2001-05-11 David Turner <david@freetype.org>
-
- * src/cff/cffparse.c (cff_parse_font_matrix), src/cid/cidload.c
- (parse_font_matrix), src/type1/t1load.c (parse_font_matrix): Fixed
- the incorrect EM size computation.
-
- * include/freetype/fttrigon.h, src/base/fttrigon.c: New files,
- adding trigonometric functions to the core API (using Cordic
- algorithms).
- * src/base/ftbase.c, src/base/Jamfile, src/base/rules.mk: Use them.
-
- * builds/newline: New file.
- * builds/top_level.mk, builds/detect.mk: Use it. This fixes
- problems with Make on Windows 2000, as well as problems when `make
- distclean' is invoked on a non-Unix platform when there is no
- `config.mk' in the current directory.
-
- * builds/freetype.mk: Fixed a problem with object deletions under
- Dos/Windows/OS/2 systems.
-
- Added new directory to hold tools and test programs.
-
- * docs/docmaker.py, docs/glnames.py: Moved to...
- * src/tools/docmaker.py, src/tools/glnames.py: This place.
- * src/tools/cordic.py: New file used to compute arctangent table
- needed by fttrigon.c.
- * src/tools/test_bbox.c, src/tools/test_trig.c: New test files.
-
- * src/tools/docmaker.py: Improved the script to add the current date
- at the footer of each web page (useful to distinguish between
- versions).
-
- * Jamfile: Fixed incorrect HDRMACRO argument.
-
- * TODO: Removed the cubic arc bbox computation note, since it has been
- fixed recently.
- * src/base/ftbbox.c (test_cubic_zero): Renamed to...
- (test_cubic_extrema): This function. Use `UL' for unsigned long
- constants.
-
- * include/freetype/t1tables.h, include/freetype/config/ftoption.h:
- Formatting.
-
-2001-05-10 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c (FT_Open_Face): Fixed a small memory leak
- which happened when trying to open 0-size font files!
-
-2001-05-09 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftcalc.h: Move declaration of
- FT_SqrtFixed() out of `#ifdef FT_LONG64'.
-
-2001-05-08 Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>
-
- * src/pcfdriver.c (PCF_Load_Glyph): Fixed incorrect bitmap width
- computation.
-
-2001-05-08 David Turner <david@freetype.org>
-
- * docs/docmaker.py: Updated the DocMaker script in order to add
- command line options (--output,--prefix,--title), fix the erroneous
- line numbers reported during errors and warnings, and other
- formatting issues.
-
- * src/base/ftcalc.c (FT_MulDiv, FT_MulFix, FT_DivFix): Various tiny
- fixes related to rounding in 64-bits routines and
- pseudo-`optimizations'.
-
-2001-04-27 David Turner <david@freetype.org>
-
- * src/base/ftbbox.c (BBox_Cubic_Check): Fixed the coefficient
- normalization algorithm (invalid final bit position, and invalid
- shift computation).
-
-2001-04-26 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/config.guess, builds/unix/config.sub: Updated to
- latest versions from gnu.org.
-
- * builds/compiler/gcc-dev.mk: Add `-Wno-long-long' flag.
-
- * include/freetype/internal/ftcalc.h: Define FT_SqrtFixed()
- unconditionally.
- * src/base/ftbbox.c: Include FT_INTERNAL_CALC_H.
- Fix compiler warnings.
- * src/base/ftcalc.c: Fix (potential) compiler warnings.
-
-2001-04-26 David Turner <david@freetype.org>
-
- * src/base/ftcalc.c (FT_SqrtFixed): Corrected/optimized the 32-bit
- fixed-point square root computation. It is now used even with
- 64-bits integers, as it is _much_ faster than calling FT_Sqrt64 :-)
-
- * src/base/ftbbox.c: Removed invalid `#include FT_BEZIER_H' line.
-
-2001-04-25 David Turner <david@freetype.org>
-
- * src/base/ftbbox.c (BBox_Cubic_Check): Rewrote function to use
- direct computations with 16.16 values instead of sub-divisions. It
- is now slower, but proves a point :-)
-
- * src/raster/ftraster.c, src/smooth/ftgrays.c, src/base/ftbbox.c:
- Fixed the Bézier stack depths.
-
- * src/base/ftcalc.c (FT_MulFix): Minor rounding fix.
-
- * builds/beos: Added BeOS-specific files to the old build system
- (no changes were necessary to support BeOS in the Jamfile though).
-
-2001-04-20 David Turner <david@freetype.org>
-
- * ftconfig.h, ftoption.h: Updated `ftconfig.h' to detect 64-bit int
- types on platforms where Autoconf is not available). Also removed
- FTCALC_USE_LONG_LONG and replaced it with
- FT_CONFIG_OPTION_FORCE_INT64.
-
- * builds/win32/freetype.dsp: Updated the Visual C++ project file.
- Doesn't create a DLL yet.
-
- * cffgload.c: Removed a compilation warning.
-
-2001-04-10 Tom Kacvinsky <tkacvins@freetype.org>
-
- * t1load.c (parse_charstrings): Changed code for placing .notdef
- glyph into slot 0 so that we no longer have a memory access
- violation.
-
- * t1load.h: In structure T1_Loader, added swap_table (of type
- PS_Table) to facilitate placing the .notdef glyph into slot 0.
-
-2001-04-10 Francesco Zappa Nardelli <francesco.zappa.nardelli@ens.fr>
-
- * src/pcf/pcfdriver.c (PCF_Get_Char_Index): Fix return value.
-
-2001-04-09 Laurence Withers <lwithers@lwithers.demon.co.uk>
-
- * builds/dos/detect.mk: Add support for bash.
-
-2001-04-05 Werner Lemberg <wl@gnu.org>
-
- * builds/os2/*.mk: These files have been forgotten to update to
- the structure of similar makefiles.
- * builds/dos/*.mk: Ditto.
- * builds/ansi/*.mk: Ditto.
-
- * builds/win32/win32-def.mk (BUILD): Fix typo.
-
- * builds/compiler/*.mk (CLEAN_LIBRARY): Don't use NO_OUTPUT.
- This is already used in the link_*.mk files.
-
-2001-04-03 Werner Lemberg <wl@gnu.org>
-
- * src/*/Jamfile: Slight changes to make files more cryptic.
-
-2001-04-03 Werner Lemberg <wl@gnu.org>
-
- * Jamfile, src/Jamfile, src/*/Jamfile: Formatted. Slight changes
- to give files identical structure.
-
-2001-04-02 Werner Lemberg <wl@gnu.org>
-
- * CHANGES: Reformatted, minor fixes.
- * TODO: Updated.
- * README: Formatting.
- * include/freetype/freetype.h: Formatting.
-
- * Jamfile: Fix typo.
-
- * src/cff/cffparse.c: Move error code #defines to...
- * include/freetype/internal/cfferrs.h: This file.
- * src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffload.c: Replaced
- `FT_Err_*' with `CFF_Err_*'.
- * src/cid/cidparse.c: Replaced `FT_Err_*' with `T1_Err_*'.
- * src/psaux/psobjs.c, src/psaux/t1decode.c: Ditto.
- * src/sfnt/sfobjs.c, src/sfnt/ttload.c: Replaced `FT_Err_*' with
- `TT_Err_*'.
- * src/truetype/ttgload.c, src/truetype/ttobjs.c: Ditto.
- * src/type1/t1gload.c, src/type1/t1load.c, src/type1/t1objs.c,
- src/type1/t1parse.c: Replaced `FT_Err_*' with `T1_Err_*'.
-
- * include/freetype/internal/cfferrs.h: Add
- `CFF_Err_Unknown_File_Format'.
- * include/freetype/internal/t1errors.h: Add
- `T1_Err_Unknown_File_Format'.
- * include/freetype/internal/tterrors.h: Add
- `TT_Err_Unknown_File_Format'.
-
- * src/cff/cffload.h: Add `cff_*_encoding' and `cff_*_charset'
- references.
- * src/psaux/psobjs.c: Include `FT_INTERNAL_TYPE1_ERRORS_H'.
-
- * src/cff/cffobjs.c (CFF_Init_Face, CFF_Done_Face): Use
- FT_LOCAL_DEF.
- * src/cid/cidobjs.c (CID_Done_Driver): Ditto.
- * src/truetype/ttobjs.c (TT_Init_Face, TT_Done_Face, TT_Init_Size):
- Ditto.
- * src/type1/t1objs.c (T1_Done_Driver): Ditto.
- * src/pcf/pcfdriver.c (PCF_Done_Face): Ditto.
- * src/pcf/pcf.h: Use FT_LOCAL for `PCF_Done_Face'.
-
-2001-04-02 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/sfnt/ttload.c (TT_Load_Metrics): Fix an improper pointer
- dereference. Submitted by Herbert Duerr <duerr@sun.com>.
-
-2001-03-26 Tom Kacvinsky <tkacvins@freetype.org>
-
- * include/freetype/config/ftconfig.h: Changed hexadecimal
- constants to use suffix U to avoid problems with HP-UX's c89
- compiler. Submitted by G.W. Lucas <glucas@sonalysts.com>.
-
-2001-03-24 David Turner <david.turner@freetype.org>
-
- * Jamrules, Jamfile, src/Jamfile, src/*/Jamfile: Adding jamfiles to
- the source tree. See www.freetype.org/jam/index.html for details.
-
-
- * Version 2.0.2 released.
- =========================
-
-
-2001-03-20 Werner Lemberg <wl@gnu.org>
-
- * builds/win32/detect.mk: Fix .PHONY target for Intel compiler.
-
-2001-03-20 David Turner <david.turner@freetype.org>
-
- * include/freetype/config/ftheader.h, include/freetype/ftsnames.h:
- Renamed `ftnames.h' to `ftsnames.h', and FT_NAMES_H to
- FT_SFNT_NAMES_H.
-
- * docs/docmaker.py: Added generation of INDEX link in table of
- contents.
-
- * INSTALL, docs/BUILD: Updated documentation to indicate that the
- compilation process has changed slightly (no more `src' required in
- the include path).
-
- * builds/*/*-def.mk: Changed the objects directory from `obj' to
- `objs'.
-
- * include/freetype/config/ftheader.h: Removed obsolete macros like
- FT_SOURCE_FILE, etc. and added cache-specific macro definitions that
- were previously defined in <freetype/ftcache.h>. Added comments to
- be included in a new API Reference section.
-
- * src/*/*: Removed the use of FT_SOURCE_FILE, etc. Now, each
- component needs to add its own directory to the include path at
- compile time. Modified all `rules.mk' and `descrip.mms'
- accordingly.
-
-2001-03-20 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.in: Add $ft_version.
- * builds/unix/freetype-config.in: Use it.
- * builds/unix/configure: Updated.
-
-2001-03-19 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/type1/t1load.c (parse_font_matrix): Assign the units per em
- value an unsigned short value, first by shifting right 16 bits,
- then by casting the results to FT_UShort.
-
- * src/cff/cffparse.c (cff_parse_font_bbox): Assign the units per em
- value an unsigned short value, first by shifting right 16 bits,
- then by casting the results to FT_UShort.
-
-2001-03-17 David Turner <david.turner@freetype.org>
-
- * src/cid/cidobjs.c, src/cid/cidload.c, src/pcf/pcfread.c,
- src/type1/t1load.c, src/type1/t1objs.c: Added a few casts to remove
- compiler warnings in pedantic modes.
-
- * include/config/ft2build.h, include/config/ftheader.h: The file
- `ft2build.h' was renamed to `ftheader.h' to avoid conflicts with the
- top-level <ft2build.h>.
-
- * include/config/ftheader.h: Added new section describing the #include
- macros.
-
-2001-03-17 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/cffparse.c (cff_parse_font_bbox): Obtain rounded FT_Fixed
- values for the bounding box numbers.
-
- * src/cff/cffobjs.c (CFF_Init_Face): When processing a CFF/CEF font,
- set `root->ascender' (`root->descender') to the integer part of
- `root->bbox.yMax' (`root->bbox.yMin', respectively).
-
-2001-03-16 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/cffdrivr.c (get_cff_glyph_name): New function. Used in
- cff_get_interface to facilitate getting a glyph name for glyph index
- via FT_Get_Glyph_Name().
-
- (cff_get_interface): Added support for getting a glyph name via the
- `glyph_name' module interface. Uses the new function
- get_cff_glyph_name().
- Submitted by Sander van der Wal <svdwal@xs4all.nl>.
-
- * src/cff/cffobjs.c (CFF_Init_Face): Logical or the face flags with
- FT_FACE_FLAG_GLYPH_NAMES only if FT_CONFIG_OPTION_NO_GLYPH_NAMES is
- not defined. This is to add support for getting a glyph name from a
- glyph index via FT_Get_Glyph_Name().
- Submitted by Sander van der Wal <svdwal@xs4all.nl>.
-
- * src/cff/cffgload.c (CFF_Parse_CharStrings): Added support for
- deprecated operator `dotsection'.
- Submitted by Sander van der Wal <svdwal@xs4all.nl>.
-
-2001-03-12 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix error
- messages.
-
- * INSTALL, docs/BUILD: We need GNU make 3.78.1 or newer.
-
-2001-03-12 Tom Kacvinsky <tkacvins@freetype.org>
-
- * include/freetype/internal/psaux.h: Changed the lenIV member of
- the T1_Decoder_ struct to be an FT_Int instead of an FT_UInt.
-
- * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Adjust
- for lenIV seed bytes at the start of a decrypted subroutine.
-
- * src/cid/cidload.c (cid_read_subrs): Decrypt subroutines only
- if lenIV >= 0.
-
- * src/cid/cidgload.c (cid_load_glyph): Decrypt charstrings only
- if lenIV >= 0.
-
-2001-03-11 Werner Lemberg <wl@gnu.org>
-
- * TODO: Updated.
-
- * src/pcf/pcfread.c: Put READ_Fields() always in a conditional to
- avoid compiler warnings.
-
-2001-03-10 Tom Kacvinsky <tkacvins@freetype.org>
-
- * TODO: New file.
-
- * include/freetype/freetype.h: Added prototypes and notes for
- three new functions: FT_RoundFix, FT_CeilFix, and FT_FloorFix.
- * src/base/ftcalc.c (FT_RoundFix, FT_CeilFix, FT_FloorFix): Added
- implementation code.
-
- * src/cid/cidobjs.c (CID_Init_Face): Use calculated units_per_EM,
- and if that is not available, default to 1000 units per EM. Changed
- assignment code for ascender and descender values.
- * src/cid/cidload.c (parse_font_matrix): Added units_per_EM
- processing.
- (parse_font_bbox): Changed to use FT_Fixed number handling.
-
- * src/type1/t1objs.c (T1_Init_Face): Changed the assignment code
- for ascender, descender, and max_advance_width.
- * src/type1/t1load.c (parse_font_bbox): Changed to use FT_Fixed
- number handling.
-
-2001-03-10 Henrik Grubbström <grubba@roxen.com>
-
- * src/*/*.c: Added many casts to make code more 64bit-safe.
-
-2001-03-07 Werner Lemberg <wl@gnu.org>
-
- * INSTALL, docs/BUILD: We need GNU make 3.78 or newer.
-
-2001-03-07 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/type1/t1objs.c (T1_Init_Face): Minor correction: We must wait
- until parse_font_bbox is changed before we use logical shift rights
- in the assignments of `root->ascender', `root->descender', and
- `root->max_advance_width'.
-
- (T1_Done_Face): Free `char_name' table to avoid a memory leak.
- Submitted by Sander van der Wal <svdwal@xs4all.nl>.
-
-2001-03-05 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/cffgload.c (CFF_Load_Glyph): Set glyph control data to the
- the Type 2 glyph charstring (used by conversion programs).
- Submitted by Ha Shao <hashao@chinese.com>.
-
-2001-03-04 Antoine Leca <Antoine.Leca@renault.fr>
-
- * include/freetype/ttnameid.h: Correct a stupid typo which prevented
- correct compilation (TT_MS_LANGID_TIGRIGNA_ETHIOPIA appeared twice).
-
-2001-03-04 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahtypes.h (AH_Hinter): Add elements
- `disable_horz_edges', `disable_vert_edges'.
- * src/autohint/ahhint.c (ah_hint_edges_3, ah_hinter_hint_edges): Use
- them (and remove static variables with the same names).
- * src/pcf/pcfutil.c (BitOrderInvert): Add `const'.
- * docs/glnames.py: Updated to latest pstables.h changes.
-
- * builds/unix/detect.mk: Add test for Hurd.
- * builds/hurd/detect.mk: Removed.
-
-2001-03-04 Sander van der Wal <svdwal@xs4all.nl>
-
- * src/psnames/pstables.h: Add more `const'.
- * src/pcf/pcfutil.c: Ditto.
-
-2001-03-04 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Fixing typo
- (FT_Glyph_Done -> FT_Done_Glyph).
-
-2001-03-01 Antoine Leca <Antoine.Leca@renault.fr>
-
- * include/freetype/ttnameid.h: Added some new Microsoft language
- codes and LCIDs as found in Office Xp.
-
-2001-02-28 David Turner <david.turner@freetype.org>
-
- * builds/hurd/detect.mk: New file. Added support to detect the GNU
- Hurd operating system as Unix-like. Fix submitted by Anthony Fok
- <foka@debian.org>.
-
- * src/type1/t1gload.c (T1_Load_Glyph): Set glyph control data to the
- the Type 1 glyph charstring (used by conversion programs).
- Submitted by Ha Shao <hashao@chinese.com>.
-
-2001-02-22 David Turner <david.turner@freetype.org>
-
- * src/base/ftgrays.c (grays_sweep): The function didn't exit
- immediately if `num_cells' was 0 as it should. Thanks to Boris for
- finding this out.
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Fixed memory leak when
- bitmap rendering fails (thanks to Graham Asher).
-
-2001-02-13 Werner Lemberg <wl@gnu.org>
-
- * docs/docmaker.py (DocSection::add_element): Use
- `self.print_error()'.
-
- * builds/unix/config.{guess,sub}: Updated (from ftp.gnu.org).
-
-2001-02-13 David Turner <david.turner@freetype.org>
-
- * docs/docmaker.py, include/freetype/*.h: Updated the DocMaker
- script to support chapters and section block ordering. Updated the
- public header files accordingly.
-
- * src/base/ftglyph.c (FT_Glyph_Copy): Advance width and glyph format
- were not correctly copied.
-
-2001-02-08 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/cffparse.c (cff_parse_font_matrix): Removed an
- unnecessary fprintf( stderr, ... ).
-
-2001-02-07 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/type1/t1objs.c (T1_Init_Face): Added code to get the
- units_per_EM from the value assigned in parse_font_matrix, if
- available. Default to 1000 if not available.
-
- * src/cff/cffparse.c (cff_parse_font_matrix): Added logic to get
- the units_per_EM from the FontMatrix.
-
- (cff_parse_fixed_thousand): New function. Gets a real number from
- the CFF font, but multiplies by 1000 (this is to avoid rounding
- errors when placing this real number into a 16.16 fixed number).
-
- (cff_parse_real): Added code so that the integer part is moved
- into the high sixteen bits of the 16.16 fixed number.
-
- * src/cff/cffobjs.c (CFF_Init_Face): Added logic to get the units
- per EM from the CFF dictionary, if available.
-
- * include/freetype/internal/cfftypes.h: In struct CFF_Font_Dict_,
- added a units_per_em member to facilitate passing of units_per_em
- from function cff_parse_font_matrix.
-
- * src/type1/t1load.c (is_alpha): Make `-' a legal alphanumeric
- character. This is so that font names with `-' are fully parsed,
- etc...
-
-2001-02-02 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/psobjs.c (shift_elements): Remove if clause (which is
- obsolete now).
-
- (reallocate_t1_table, PS_Table_Done): Replace REALLOC() with ALLOC()
- + MEM_Copy() to avoid a memory bug.
-
-2001-02-01 David Turner <david.turner@freetype.org>
-
- * docs/docmaker.py: Improved the index sorting routine to place
- capital letters before small ones. Added the `<order>' marker to
- section blocks in order to give the order of blocks.
-
-2001-01-30 Antoine Leca <Antoine.Leca@renault.fr>
-
- * include/freetype/ttnameid.h: Latest updates to Microsoft language
- ID codes.
-
-2001-01-24 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/t1load.c (parse_font_matrix): Added heuristic to get
- units_per_EM from the font matrix.
-
- (parse_dict): Deleted test to see whether the FontInfo keyword has
- been seen. Deletion of this test allows fonts without FontInfo
- dictionaries to be parsed by the Type 1 driver.
-
- (T1_Open_Face): Deleted empty subroutines array test to make sure
- fonts with no subroutines still are parsed.
-
-2001-01-17 Francesco Zappa Nardelli <francesco.zappa.nardelli@ens.fr>
-
- * src/pcfread.c (pcf_get_properties, pcf_get_metrics,
- pcf_get_bitmaps): Fix compiler errors.
-
-2001-01-11 David Turner <david.turner@freetype.org>
-
- * src/pcf/pcfread.c: Removed some compilation warnings related
- to comparison of signed vs. unsigned integers.
-
- * include/freetype/internal/ftdebug.h: Changed the debug trace
- constants from trace_t2xxxx to trace_cffxxxx to be able to compile
- the CFF driver in debug mode.
-
-2001-01-11 Matthew Crosby <mcrosby@marthon.org>
-
- * builds/unix/freetype-config.in: Fix problems with separate
- --prefix and --exec-prefix.
-
-2001-01-11 David Turner <david.turner@freetype.org>
-
- * docs/docmaker.py: Added cross-references generation as well as
- more robust handling of pathname wildcard matching.
-
-2001-01-10 Werner Lemberg <wl@gnu.org>
-
- * docs/docmaker.py: Minor improvements to reduce unwanted spaces
- and empty lines in output.
-
-2001-01-09 David Turner <david.turner@freetype.org>
-
- * docs/docmaker.py: Improved script to generate table of contents
- and index pages. It also supports wildcards on non Unix systems.
-
- * include/freetype/*.h, include/freetype/cache/*.h: Updated comments
- to include section definitions/delimitations for the API Reference
- generator.
-
- * include/freetype/freetype.h: Moved declaration of
- `FT_Generic_Finalizer' and the `FT_Generic' structure to...
- * include/freetype/fttypes.h: here.
-
-2001-01-04 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ttnameid.h: Updated Unicode code range comments.
-
-2001-01-03 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/rules.mk: Use cffgload.{c,h} instead of t2gload.{c,h}.
-
- * include/freetype/internal/internal.h: Changed to use cfftypes.h
- (cfferrs.h) instead of t2types.h (t2errors.h, respectively).
-
- * include/freetype/internal/cfftypes.h: Merged in changes from
- t2types.h and made this the canonical `types' header for the CFF
- driver.
-
- * include/freetype/internal/t2types.h: This file was merged with
- cfftypes.h and is no longer necessary.
-
- * include/freetype/internal/t2errors.h: Renamed to cfferrs.h.
-
- * src/cff/cffobjs.c, src/cff/cffobjs.h, src/cff/cffparse.c,
- src/cff/cffdrivr.c, src/cff/cff.c, src/cff/cffload.c,
- src/cff/cffgload.c, src/cff/cffgload.h: Changed to use
- cffgload.{c,h} instead of t2gload.{c,h}. All occurrences of t2_
- (T2_) were replaced with cff_ (CFF_, respectively).
-
- * src/cff/t2gload.h: Renamed cffgload.h.
-
- * src/cff/t2gload.c: Renamed cffgload.c
-
-2000-01-02 Jouk Jansen <joukj@hrem.stm.tudelft.nl>
-
- * builds/vms: Support files for VMS architecture added.
- * descrip.mms, src/*/descrip.mms: VMS makefiles added.
- * README.VMS: New file.
-
-2000-01-01 Werner Lemberg <wl@gnu.org>
-
- * LICENSE.TXT: Added info about PCF driver license.
-
-2001-01-01 Francesco Zappa Nardelli <francesco.zappa.nardelli@ens.fr>
-
- * src/pcf/*: New driver module for PCF font format (used in
- X Window System).
- * include/freetype/internal/ftdebug.h (FT_Trace): Added values for
- PCF driver.
- * include/freetype/internal/pcftypes.h: New file.
- * include/freetype/config/ftmodule.h: Added PCF driver module.
-
-2001-01-01 Werner Lemberg <wl@gnu.org>
-
- * src/winfonts/winfnt.c (FNT_Get_Char_Index): Fix parameter type.
-
-2000-12-31 Werner Lemberg <wl@gnu.org>
-
- * builds/modules.mk (clean_module_list): Fixed deletion of module
- file in case `make make_module_list' is called before `make setup'.
-
-2000-12-30 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (CFF_Load_Charset): Improved error messages.
- (CFF_Load_Charset, CFF_Load_Encoding): Remove unnecessary variable
- definition.
-
-2000-12-30 Tom Kacvinsky <tkacvins@freetype.org>
-
- * include/freetype/internal/t2types.h,
- include/freetype/internal/cfftypes.h: Changed the structures for
- CFF_Charset and CFF_Encoding for the new implementations of the
- charset and encoding parsers in the CFF driver.
-
- * src/cff/t2gload.c (t2_lookup_glyph_by_stdcharcode,
- t2_operator_seac): Added these functions for use in implementing the
- seac emulation provided by the Type 2 endchar operator.
- (T2_Parse_CharStrings): Added seac emulation for the endchar
- operator.
-
- * src/cff/cffload.c (CFF_Load_Encoding, CFF_Load_Charset,
- CFF_Done_Encoding, CFF_Done_Charset): Extended to load and parse the
- charset/encoding tables, and free the memory used by them when the
- CFF driver is finished with them. Added tables
-
- cff_isoadobe_charset
- cff_expert_charset
- cff_expertsubset_charset
- cff_standard_encoding
- cff_expert_encoding
-
- so that the encoding/charset parser can handle predefined encodings and
- charsets.
-
-2000-12-24 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/t2gload.c (T2_Load_Glyph): Added code so that the font
- transform is applied.
-
- * src/cff/cffparse.c (cff_parse_font_matrix): Added code so that
- the font matrix numbers are scaled by 1/(matrix->yy). Also, the
- offset vector now contains integer values instead of 16.16 fixed
- numbers.
-
-2000-12-22 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/autohint/ahhint.c (ah_hinter_load_glyph):
- Removed unnecessary comments and commented-out code.
-
-2000-12-21 David Turner <david.turner@freetype.org>
-
- * src/cid/cidafm.c, src/cid/cidafm.h: removed un-needed files,
- we'll work on supporting CID AFM files later I guess :-)
-
-2000-12-21 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/autohint/ahhint.c (ah_hinter_load, ah_hinter_load_glyph):
- Changed so that fonts with a non-standard FontMatrix render
- correctly. Previously, the first glyph rendered from such a
- font did not have the transformation matrix applied.
-
-2000-12-17 Werner Lemberg <wl@gnu.org>
-
- * *.mk: Added lots of `.PHONY' targets.
-
-2000-12-17 Karsten Fleischer <kfleisc1@ford.com>
-
- * *.mk: Implemented `platform' target to disable auto-detection.
-
-2000-12-14 Werner Lemberg <wl@gnu.org>
-
- * docs/design/modules.html: Removed. Covered by design-*.html.
-
- * INSTALL: Added info about makepp.
-
-2000-12-14 David Turner <david.turner@freetype.org>
-
- Added support for clipped direct rendering in the smooth renderer.
- This should not break binary compatibility of existing applications.
-
- * include/freetype/fttypes.h, include/freetype/ftimage.h: Move
- definition of the FT_BBox structure from the former to the latter.
- * include/freetype/ftimage.h: Add `ft_raster_flag_clip' value to
- FT_Raster_Flag enumeration.
- Add `clip_box' element to FT_Raster_Params structure.
- * src/smooth/ftgrays.c (grays_convert_glyph): Implement it.
-
- * INSTALL: Updated installation instructions on Win32, listing the
- new `make setup list' target used to list supported
- compilers/targets.
-
- * src/raster/ftraster.c (ft_black_render): Test for unsupported
- direct rendering before testing arguments.
-
-2000-12-13 David Turner <david.turner@freetype.org>
-
- * include/freetype/config/ft2build.h,
- include/freetype/internal/internal.h: Fixed header inclusion macros
- to use direct definitions. This is the only way to do these things
- in a portable way :-( The rest of the code should follow shortly
- though everything compiles now.
-
- * builds/compiler/intelc.mk, builds/compiler/watcom.mk: New files.
-
- * builds/win32/detect.mk: Added support for the Intel C/C++
- compiler, as well as _preliminary_ (read: doesn't work!) support for
- Watcom. Also added a new setup target. Type `make setup list' for
- a list of supported command-line compilers on Win32.
-
- * src/base/ftdebug.c: Added dummy symbol to avoid empty file if
- conditionals are off.
-
-2000-12-13 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ftsystem.c: Fixed typos. Fixed inclusion of wrong
- ftconfig.h file.
-
-2000-12-12 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ft2build.h (FT2_ROOT, FT2_CONFIG_ROOT):
- Removed. ANSI C doesn't (explicitly) allow macro expansion in
- arguments using `##'.
- (FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE): Use directory
- names directly. Make them configurable. Use `##' to strip leading
- and trailing spaces from arguments.
-
- * builds/unix/ft2unix.h: Adapted.
-
- * src/base/ftsystem.c (ft_alloc, ft_realloc, ft_free, ft_io_stream,
- ft_close_stream): Use FT_CALLBACK_DEF.
-
- * builds/unix/ftsystem.c: Use new header scheme.
- (FT_Done_Memory): Use free() from FT_Memory structure.
-
- * src/base/ftinit.c, src/base/ftmac.c: Header scheme fixes.
-
-2000-12-11 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ft2build.h (FT2_CONFIG_ROOT,
- FT2_PUBLIC_FILE, FT2_CONFIG_FILE, FT2_INTERNAL_FILE,
- FT_SOURCE_FILE): Use `##' operator to be really ANSI C compliant.
-
-2000-12-09 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/detect.mk: Remove unused USE_CFLAGS variable.
-
-2000-12-08 Werner Lemberg <wl@gnu.org>
-
- * */*.h: Changed body inclusion macro names to start and end with
- `__' (those which haven't converted yet). Fixed minor conversion
- issues.
-
- * src/winfonts/winfnt.c: Updated to new header inclusion scheme.
-
- * src/truetype/ttinterp.c: Remove unused CALC_Length() macro.
-
-2000-12-07 David Turner <david.turner@freetype.org>
-
- * */*.[ch]: Changed source files to adhere to the new
- header inclusion scheme. Not completely tested but works for now
- here.
-
- * src/cff/t2driver.c: Renamed and updated to...
- * src/cff/cffdrivr.c: New file.
- * src/cff/t2driver.h: Renamed and updated to...
- * src/cff/cffdrivr.h: New file.
- * src/cff/t2load.c: Renamed and updated to...
- * src/cff/cffload.c: New file.
- * src/cff/t2load.h: Renamed and updated to...
- * src/cff/cffload.h: New file.
- * src/cff/t2objs.c: Renamed and updated to...
- * src/cff/cffobjs.c: New file.
- * src/cff/t2objs.h: Renamed and updated to...
- * src/cff/cffobjs.h: New file.
- * src/cff/t2parse.c: Renamed and updated to...
- * src/cff/cffparse.c: New file.
- * src/cff/t2parse.h: Renamed and updated to...
- * src/cff/cffparse.h: New file.
- * src/cff/t2tokens.h: Renamed and updated to...
- * src/cff/cfftoken.h: New file.
-
- * src/cff/cff.c, src/cff/rules.mk: Updated.
-
-2000-12-06 David Turner <david.turner@freetype.org>
-
- * src/cache/ftlru.c (FT_Lru_Done): Fixed memory leak.
-
-2000-12-06 Werner Lemberg <wl@gnu.org>
-
- * builds/module.mk: Replaced `xxx #' with `xxx$(space).
- * builds/os2/detect.mk, builds/win32/detect.mk: Moved comment to
- avoid trailing spaces in variable.
- * builds/freetype.mk: Use $(D) instead of $D to make statement more
- readable.
-
- * docs/docmaker.py: Formatting.
-
-2000-12-05 David Turner <david.turner@freetype.org>
-
- * src/psaux/psauxmod.c: Fixed a broken inclusion of component
- header files (an FT_FLAT_COMPILE test was missing).
-
- * src/cache/ftcmanag.c (FTC_Manager_Done): Fixed a bug that caused
- an occasional crash when the function was called (due to a dangling
- pointer).
-
- * src/base/ftsystem.c (FT_Done_Memory): Fixed an obvious bug:
- The ANSI `free()' function was called instead of `memory->free()'.
-
- * docs/docmaker.py: Added section filtering, multi-page generation
- (index page generation is still missing though).
-
-2000-12-04 David Turner <david.turner@freetype.org>
-
- * builds/unix/install.mk, builds/unix/ft2unix.h: The file `ft2unix.h'
- is now installed as <ft2build.h> for Unix systems. Note that we
- still use the `freetype2/freetype' installation path for now.
-
- * */*.[ch]: Now using <ft2build.h> as the default build and setup
- configuration file in all public headers. Internal source files
- still need some changes though.
-
- * builds/devel/ft2build.h, builds/devel/ftoption.h: Created a new
- directory to hold all development options for both the Unix and
- Win32 developer builds.
-
- * builds/win32/detect.mk, builds/win32/w32-bccd.mk,
- builds/win32/w32-dev.mk: Changed the developer build targets to
- `devel-gcc' and `devel-bcc' in order to be able to develop with the
- Borland C++ compiler.
-
-2000-12-01 David Turner <david.turner@freetype.org>
-
-
- * Version 2.0.1 released.
- =========================
-
-
- * builds/unix/configure.in, builds/unix/configure,
- builds/cygwin/configure.in, builds/cygwin/configure: Setting
- `version_info' to 6:1:0 for the 2.0.1 release.
-
- * CHANGES: Added a summary of changes between 2.0.1 and 2.0.
-
- * builds/unix/ftconfig.in, builds/cygwin/ftconfig.in: Changes
- to allow compilation under Unix with the Unix-specific config
- files.
-
-2000-12-01 Werner Lemberg <wl@gnu.org>
-
- * INSTALL: Revised.
- * builds/compiler/bcc-dev.mk, builds/compiler/visualage.mk,
- builds/compiler/bcc.mk, builds/win32/w32-bcc.mk,
- builds/win32/w32-bccd.mk: Revised.
- * include/freetype/config/ftbuild.h,
- include/freetype/internal/internal.h: Revised.
- * include/freetype/ftimage.h: Updated to new header inclusion scheme.
-
-2000-11-30 Werner Lemberg <wl@gnu.org>
-
- * builds/toplevel.mk (.PHONY): Adding `distclean'.
- * builds/unix/detect.mk (.PHONY): Adding `devel', `unix', `lcc',
- `setup'.
-
-2000-11-30 David Turner <david.turner@freetype.org>
-
- * INSTALL: Slightly updated the quick starter documentation to
- include IDE compilation, prevent against BSD Make, and specify `make
- setup' instead of a single `make' for build configuration.
-
- * include/config/ftbuild.h, include/internal/internal.h: Added new
- configuration files used to determine the location of all public,
- configuration, and internal header files for FreeType 2. Modified
- all headers under `include/freetype' to reflect this change. Note
- that we still need to change the library source files themselves
- though.
-
- * builds/compiler/bcc.mk, builds/compiler/bcc-dev.mk,
- builds/win32/w32-bcc.mk, builds/win32/w32-bccd.mk,
- builds/win32/detect.mk: Added new files to support compilation with
- the free Borland C++ command-line compiler. Modified the detection
- rules to recognize the new `bcc32' target in `make setup bcc32'.
-
- * src/sfnt/ttcmap.c, src/sfnt/ttpost.c, src/sfnt/ttsbit.c,
- src/truetype/ttobjs.c, src/truetype/ttgload.c,
- src/truetype/ttinterp.c: Fixed a few comparisons that Borland C++
- didn't really like. Basically, this compiler complains when FT_UInt
- is compared to FT_UShort (apparently, it promotes `UShort' to `Int'
- in these cases).
-
-2000-11-30 Tom Kacvinsky <tkacvins@freetype.org>
-
- * t2objs.c (T2_Init_Face): Added calculation of `face->height' for
- pure CFF fonts.
-
- * t1objs.c (T1_Init_Face): Fixed computation of `face->height'.
-
-2000-11-29 David Turner <david.turner@freetype.org>
-
- * src/base/ftbbox.c (BBox_Conic_Check): Fixed a really stupid
- bug in the formula used to compute the conic Bézier extrema
- of non-monotonous arcs.
-
-2000-11-29 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftcalc.c (FT_SqrtFixed), src/base/ftobjs.c
- (FT_Set_Renderer): Use FT_EXPORT_DEF.
- * src/cache/ftcimage.c (FTC_Image_Cache_Lookup),
- src/cache/ftcmanag.c (FTC_Manager_Done, FTC_Manager_Reset,
- FTC_Manager_Lookup_Face, FTC_Manager_Lookup_Size,
- FTC_Manager_Register_Cache), src/cache/ftcsbits.c
- (FTC_SBit_Cache_Lookup): Ditto.
-
- * src/include/freetype/cache/ftcglyph.h (FTC_GlyphNode_Init),
- src/include/freetype/ftmac.h (FT_New_Face_From_FOND): Use FT_EXPORT.
-
-2000-11-29 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfdriver.c: Include ttsbit.h and ttpost.h only
- conditionally.
-
- * src/truetype/ttdriver.c (Set_Char_Sizes, Set_Pixel_Sizes): Set
- `size->strike_index' only conditionally.
-
- * src/type1/t1driver.c, src/type1/t1objs.c: Include t1afm.h only
- conditionally.
-
- * src/winfonts/winfnt.h: Move all type definitions to...
- * src/include/freetype/internal/fnttypes.h: New file.
- * src/winfonts/winfnt.c: Use it.
-
-2000-11-29 ??? ??? <darin@eazel.com>
-
- * include/freetype/internal/ftdebug.h: Replaced FT_CAT and FT_XCAT
- with a direct solution (which also satisfies picky compilers).
-
-2000-11-28 YAMANO-UCHI Hidetoshi <mer@din.or.jp>
-
- * src/truetype/ttobjs.c (TT_Init_Size): Fix #ifdef's to work with
- disabled interpreter also.
-
- * src/base/ftnames.c (FT_Get_Sfnt_Name_Count): Fix incorrect
- parentheses.
-
-2000-11-26 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/t2gload.c (T2_Parse_CharStrings): Added logic to glyph
- width setting code to take into account even/odd argument counts
- and glyph width operand before endchar/hmoveto/vmoveto.
-
-2000-11-26 Werner Lemberg <wl@gnu.org>
-
- * builds/ansi/ansi.mk: Fix inclusion order of files.
-
-2000-11-26 Keith Packard <keithp@keithp.com>
-
- * src/type1/t1objs.c (T1_Init_Face): Compute style flags.
-
-2000-11-26 Werner Lemberg <wl@gnu.org>
-
- * builds/compiler/ansi-cc.mk (CLEAN_LIBRARY): Fix rule and
- conditional.
-
-2000-11-23 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_subrs, parse_charstrings): Use decrypt
- function from PSAux module.
-
- * src/type1/t1parse.c (T1_Done_Parse): Renamed to...
- (T1_Finalize_Parser): New function (to avoid name clash with a
- function in the PSAux module).
- (T1_Decrypt): Removed since it is duplicated in the PSAux module.
- (T1_Get_Private_Dict): Added `psaux' as new parameter; use decrypt
- function from PSAux module.
-
- * src/type1/t1parse.h: Adapted.
-
-2000-11-22 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/cff/t2objs.c (T2_Init_Face): For pure CFF fonts, set
- `root->num_faces' to `cff->num_faces' and set `units_per_EM'
- to 1000.
-
- * src/cff/t2parse.c (parse_t2_real): Fixed real number parsing
- loop.
-
- * src/cff/t2load.c (T2_Get_String): Called T2_Get_Name with a
- sid that was off by one.
-
-2000-11-16 David Turner <david@freetype.org>
-
- * src/autohint/ahtypes.h (AH_Hinter): Added new fields to control
- auto-hinting of synthetic Type 1 fonts.
-
- * src/autohint/ahhint.c (ah_hinter_load, ah_hinter_load_glyph):
- Added auto-hinting support of synthetic Type 1 fonts.
-
-2000-11-12 Tom Kacvinsky <tkacvins@freetype.org>
-
- * src/sfnt/ttload.c (TT_LookUp_Table, TT_Load_Generic_Table): Change
- tracing output.
-
- * src/sfnt/sfobjs.c (SFNT_Load_Face): Set boolean variable
- `has-outline' to true only if the font has a `glyf' or `CFF ' table.
-
-2000-11-11 Werner Lemberg <wl@gnu.org>
-
- * builds/win32/visualc/freetype.dsp: Fix raster1->raster and
- type1z->type1.
-
-2000-11-11 Tom Kacvinsky <tkacvins@freetype.org>
-
- * builds/unix/freetype-config.in, builds/cygwin/freetype-config.in:
- Added a --libtool option. When freetype-config --libtool is
- invoked, the absolute path to the libtool convenience library
- is returned.
-
-2000-11-11 Werner Lemberg <wl@gnu.org>
-
- * builds/cygwin/cygwin-def.in: Same fix as previous.
-
-2000-11-10 Tom Kacvinsky <tkacvins@freetype.org>
-
- * builds/unix/unix-def.in: Add
-
- INSTALL_PROGRAM := @INSTALL_PROGRAM@
- INSTALL_SCRIPT := @INSTALL_SCRIPT@
-
- so that installation of freetype-config does not fail.
-
-2000-11-10 Werner Lemberg <wl@gnu.org>
-
- * builds/cygwin/freetype-config.in, builds/unix/freetype-config.in:
- Move test down for empty --exec-prefix.
- Fix --version.
-
- * builds/cygwin/install.mk, builds/unix/install.mk: Use
- $(INSTALL_SCRIPT) for installation of freetype-config.
-
- * builds/cygwin/install.mk: Fix clean target names.
-
-2000-11-09 David Turner <david@freetype.org>
-
-
- * Version 2.0 released.
- =======================
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2000-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/ChangeLog.21 b/freetype/ChangeLog.21
deleted file mode 100644
index f36f5b7f..00000000
--- a/freetype/ChangeLog.21
+++ /dev/null
@@ -1,9438 +0,0 @@
-2005-06-08 Werner Lemberg <wl@gnu.org>
-
-
- * Version 2.1.10 released.
- ==========================
-
-
- * src/pcf/readme: Renamed to...
- * src/pcf/README: This.
-
-2005-06-07 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/*: Added copyright notes, reworked some comments.
-
-2005-06-05 Werner Lemberg <wl@gnu.org>
-
- * Add copyright notices to all files which don't have one.
-
- * docs/license.txt: Renamed to...
- * docs/LICENSE.TXT: This.
- * docs/FTL.txt: Renamed to...
- * docs/FTL.TXT: This.
- * docs/GPL.txt: Renamed to...
- * docs/GPL.TXT: This.
-
- * docs/PATENTS: Slightly reworded. Suggested by Sylvain Beucler
- <beuc@gnu.org>.
-
-2005-06-04 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftimage.h (FT_Outline_MoveToFunc,
- FT_Outline_LineToFunc, FT_Outline_ConicToFunc,
- FT_Outline_CubicToFunc, FT_Raster_RenderFunc),
- include/freetype/ftrender.h (FT_Glyph_TransformFunc,
- FT_Renderer_RenderFunc, FT_Renderer_TransformFunc): Don't use
- `const' to stay compatible with FreeType 2.1.9.
-
-2005-06-01 Adam D. Moss <adam@gimp.org>
-
- * src/base/ftstroke.c (ft_stroker_inside): Revert `sigma' patch from
- 2004-07-11; this gives much better results under normal
- circumstances.
-
-2005-05-30 Chia I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Minor
- documentation improvements.
-
- * include/freetype/ftoutln.h (FT_Outline_Embolden): Fix typos.
-
- * src/base/ftbitmap.c (FT_Bitmap_Embolden): Add support for bitmap
- of pixel_mode FT_PIXEL_MODE_GRAY2 or FT_PIXEL_MODE_GRAY4.
- If xstr is larger than 8 and bitmap is of pixel_mode
- FT_PIXEL_MODE_MONO, set xstr to 8 instead of returning error.
-
-2005-05-29 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftbitmap.c (FT_Bitmap_Embolden): Fix emboldening bitmap
- of mode FT_PIXEL_MODE_GRAY. Also add support for mode
- FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V.
- (ft_bitmap_assure_buffer): FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V
- should have ppb (pixel per byte) 1.
- Zero the padding when there's no need to allocate memory.
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle slot->advance
- too.
- More suited emboldening strength.
-
-2005-05-28 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftbitmap.c (FT_Bitmap_Embolden): Handle negative pitch.
- Handle FT_PIXEL_MODE_GRAY with num_gray != 256.
- Improve speed for FT_PIXEL_MODE_GRAY.
- (ft_bitmap_assure_buffer): Accept FT_PIXEL_MODE_LCD and
- FT_PIXEL_MODE_LCD_V.
-
-2005-05-27 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Initialize `error'.
-
- * src/base/ftobjs.c (ft_cmap_done_internal): New function.
- (FT_CMap_Done): Remove cmap from cmap list.
- (destroy_charmaps, FT_CMap_New): Don't call FT_CMap_Done but
- ft_cmap_done_internal.
-
-2005-05-26 Werner Lemberg <wl@gnu.org>
-
- * docs/GPL.txt: Update postal address of FSF.
-
-2005-05-26 Chia I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Improve
- documentation.
-
- * src/base/ftsynth.c (FT_BOLD_THRESHOLD): Removed.
- (FT_GlyphSlot_Embolden): Check whether slot is bitmap owner.
- Always modify the metrics.
-
-2005-05-24 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2005-05-24 Chia I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): New declaration.
-
- * include/freetype/ftoutln.h (FT_Outline_Embolden): New declaration.
-
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer): New auxiliary
- function.
- (FT_Bitmap_Embolden): New function.
-
- * src/base/ftoutln.c (FT_Outline_Embolden): New function.
-
- * src/base/ftsynth.c: Don't include FT_INTERNAL_CALC_H and
- FT_TRIGONOMETRY_H but FT_BITMAP_H.
- (FT_GlyphSlot_Embolden): Use FT_Outline_Embolden or
- FT_Bitmap_Embolden.
-
-2005-05-24 Werner Lemberg <wl@gnu.org>
-
- * configure: Always remove config.mk, builds/unix/unix-def.mk, and
- builds/unix/unix-cc.mk. This fixes repeated calls of the script.
- Reported by Nelson Beebe and Behdad Esfahbod.
-
- * README.CVS: Mention file permissions.
-
-2005-05-23 Werner Lemberg <wl@gnu.org>
-
- * builds/amiga/makefile.os4 (WARNINGS), builds/compiler/gcc-dev.mk
- (CFLAGS), builds/compiler/gcc.mk (CFLAGS): Remove
- -fno-strict-aliasing.
-
- * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttsbit0.c --
- it is currently loaded from ttsbit.c.
-
-2005-05-23 Behdad Esfahbod <behdad@cs.toronto.edu>
-
- Say you have `(Foo*)x' and want to assign, pass, or return it as
- `(Bar*)'. If you simply say `x' or `(Bar*)x', then the C compiler
- would warn you that type casting incompatible pointer types breaks
- strict-aliasing. The solution is to cast to `(void*)' instead which
- is the generic pointer type, so the compiler knows that it should
- make no strict-aliasing assumption on `x'. But the problem with
- `(void*)x' is that seems like in C++, unlike C, `void*' is not a
- generic pointer type and assigning `void*' to `Bar*' without a cast
- causes an error. The solution is to cast to `Bar*' too, with
- `(Bar*)(void*)x' as the result -- this is what the patch does.
-
- * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP),
- include/freetype/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): Remove
- cast on lvalue, use a temporary pointer instead.
- Cast temporarily to (void*) to not break strict aliasing.
-
- * include/freetype/internal/ftmemory.h (FT_MEM_ALLOC,
- FT_MEM_REALLOC, FT_MEM_QALLOC, FT_MEM_QREALLOC, FT_MEM_FREE),
- src/base/ftglyph.c (FT_Glyph_To_Bitmap): Cast temporarily to (void*)
- to not break strict aliasing.
-
- * src/base/ftinit.c (FT_USE_MODULE): Fix wrong type information.
-
- * builds/unix/configure.ac (XX_CFLAGS): Remove -fno-strict-aliasing.
-
-2005-05-23 David Turner <dturner@freetype.org>
-
- Fix Savannah bug #12213 (incorrect behaviour of the cache sub-system
- in low-memory conditions).
-
- * include/freetype/cache/ftccache.h (FTC_CACHE_TRYLOOP,
- FTC_CACHE_TRYLOOP_END): New macros.
-
- * src/cache/ftccache.c (FTC_Cache_NewNode), src/cache/ftcsbits.c
- (ftc_snode_compare): Use FT_CACHE_TRYLOOP and FTC_CACHE_TRYLOOP_END.
-
-2005-05-23 Werner Lemberg <wl@gnu.org>
-
- * src/base/rules.mk (BASE_SRC): Don't add ftsynth.c here but...
- (BASE_EXT_SRC): Here.
-
-2005-05-22 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftrfork.c (raccess_guess_apple_generic): Mark
- `version_number' and `entry_length' as unused.
- (raccess_guess_linux_double_from_file_name): Remove `memory'.
- (raccess_make_file_name): Mark `error' as unused.
-
- * src/bdf/bdflib.c (_bdf_parse_properties): Remove `memory'.
-
- * src/cid/cidobjs.c (cid_face_init): Remove `psnames'.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Remove `memory'.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints,
- ft_var_readpackeddeltas, ft_var_load_avar): Mark `error' as unused.
-
- * src/base/rules.mk (BASE_SRC): Add ftsynth.c.
-
-2005-05-21 David Turner <david@freetype.org>
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Fix a bug that
- produced unpleasant artefacts when trying to embolden very sharp
- corners.
-
-2005-05-20 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2005-05-20 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftbitmap.c: Don't include FT_FREETYPE_H and FT_IMAGE_H
- but FT_BITMAP_H.
- (FT_Bitmap_Copy): New function (from ftglyph.c).
-
- * include/freetype/ftbitmap.h (FT_Bitmap_Copy): New public
- definition.
-
- * src/base/ftglyph.c: Include FT_BITMAP_H.
- (ft_bitmap_copy): Move to ftbitmap.c.
- (ft_bitmap_glyph_init): Remove `memory' variable.
- Create new bitmap object if FT_GLYPH_OWN_BITMAP isn't set.
- (ft_bitmap_glyph_copy): Use FT_Bitmap_Copy.
- (ft_bitmap_glyph_done): Use FT_Bitmap_Done.
- (ft_outline_glyph_init): Use FT_Outline_Copy.
-
- * src/base/ftoutln.c (FT_Outline_Copy): Handle source == target.
- (FT_Outline_Done_Internal): Check for valid `memory' pointer.
- (FT_Outline_Translate, FT_Outline_Reverse, FT_Outline_Render,
- FT_Outline_Transform): Check for valid `outline' pointer.
-
- * src/base/ftobjs.c (FT_New_GlyphSlot): Prepend glyph slot to
- face->glyph, otherwise a new second glyph slot cannot be created.
- (FT_Done_GlyphSlot): Fix memory leak.
- (FT_Open_Face): Updated -- face->glyph is already managed by
- FT_New_GlyphSlot.
-
- * src/type42/t42objs.c (T42_GlyphSlot_Done): Updated.
-
-2005-05-20 Kirill Smelkov <kirr@mns.spb.ru>
-
- * include/freetype/ftimage.h (FT_Raster_Params),
- include/freetype/ftoutln.h (FT_Outline_Translate,
- FT_Outline_Transform), src/base/ftoutln.c (FT_Outline_Translate,
- FT_Outline_Transform): Decorate parameters with `const' where
- appropriate.
- Update all callers.
-
- * src/raster/ftraster.c (ft_black_reset), src/smooth/ftgrays.c
- (gray_raster_reset): Remove `const' from `pool_base' argument.
-
-2005-05-18 Kirill Smelkov <kirr@mns.spb.ru>
-
- * src/raster/ftmisc.h: New file. Only needed if ftraster.c is
- compiled as stand-alone.
-
- * src/raster/ftraster.c: Add comment how to compile as stand-alone.
- s/FT_CONFIG_OPTION_STATIC_RASTER/FT_STATIC_RASTER/.
- s/TT_STATIC_RASTER/FT_STATIC_RASTER/.
- [_STANDALONE_]: Include ftimage.h and ftmisc.h.
- (FT_TRACE1, FT_TRACE6, ft_memset, FT_MEM_ZERO): Define
- conditionally.
- (Render_Glyph, Render_Gray_Glyph): Return Raster_Err_None (or
- Raster_Err_Unsupported).
- (ft_black_new) [_STANDALONE_]: Fix type of `the_raster'.
- (ft_black_init, ft_black_reset, ft_black_set_mode, ft_black_render):
- Use `ras', not `raster'.
- (ft_black_done): Use FT_UNUSED_RASTER.
- (Horizontal_Sweep_Init, Horizontal_Sweep_Step,
- Horizontal_Gray_Sweep_Span): Use FT_UNUSED_RASTER.
-
-2005-05-18 Werner Lemberg <wl@gnu.org>
-
- * docs/announce: Start updating.
-
- * docs/CHANGES: Updated.
-
-2005-05-16 Vitaliy Pasternak <v_a_pasternak@mail.ru>
-
- * builds/win32/visualc/freetype.vcproj: Updated.
- Exclude debug info for `Release' versions to reduce library size.
-
-2005-05-16 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Open_Face): Make it work as documented, this
- is, ignore `aface' completely if face_index < 0. Reported by David
- Osborn <spam@habitualhiatus.com>.
-
-2005-05-16 Kirill Smelkov <kirr@mns.spb.ru>
-
- * include/freetype/ftimage.h (FT_Outline_MoveToFunc,
- FT_Outline_LineTo_Func, FT_Outline_ConicToFunc,
- FT_Outline_CubicToFunc), src/smooth/ftgrays.c (gray_render_conic,
- gray_render_cubic, gray_move_to, gray_line_to, gray_conic_to,
- gray_cubic_to, gray_render_span, gray_sweep): Decorate parameters
- with `const' where appropriate.
-
-2005-05-11 Kirill Smelkov <kirr@mns.spb.ru>
-
- * include/freetype/ftimage.h (FT_Raster_RenderFunc),
- include/freetype/ftrender.h (FT_Glyph_TransformFunc,
- FT_Renderer_Render_Func, FT_Renderer_TransformFunc),
- src/base/ftglyph.c (ft_outline_glyph_transform),
- src/raster/ftrend1.c (ft_raster1_transform, ft_raster1_render),
- src/smooth/ftgrays.c (FT_Outline_Decompose, gray_raster_render),
- src/smooth/ftsmooth.c (ft_smooth_transform,
- ft_smooth_render_generic, ft_smooth_render, ft_smooth_render_lcd,
- ft_smooth_render_lcd_v): Decorate parameters with `const' where
- appropriate.
-
- * src/raster/ftraster.c (RASTER_RENDER_POOL): Removed. Obsolete.
- (ft_black_render): Decorate parameters with `const' where
- appropriate.
-
-2005-05-11 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttcmap.c (tt_cmap4_set_range): Fix typo (FT_PEEK_SHORT ->
- FT_PEEK_USHORT) which caused crashes. Reported by Ismail Donmez
- <ismail@kde.org.tr>.
-
-2005-05-08 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftserv.h (FT_FACE_FIND_GLOBAL_SERVICE)
- [__cplusplus]: Fix typo.
-
-2005-05-07 Werner Lemberg <wl@gnu.org>
-
- Handle unsorted SFNT type 4 cmaps correctly (reported by Dirck
- Blaskey <listtarget@danbala.com>).
-
- * src/sfnt/ttcmap.h (TT_CMap): Add member `unsorted'.
- * src/sfnt/ttcmap.c: Use SFNT_Err_Ok where appropriate.
-
- (tt_cmap0_validate, tt_cmap2_validate, tt_cmap6_validate,
- tt_cmap8_validate, tt_cmap10_validate, tt_cmap12_validate): Use
- `FT_Error' as return type.
- (tt_cmap4_validate): Use `FT_Error' as return type.
- Return error code for unsorted cmap.
- (tt_cmap4_char_index, tt_cmap4_char_next): Use old code for unsorted
- cmaps.
- (tt_face_build_cmaps): Set `unsorted' variable in cmap.
-
-2005-05-07 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttpload.c (tt_face_get_location): Fix typo.
-
-2005-05-06 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): Set ppem value in top
- dictionary for SFNT-based CFF.
-
-2005-05-05 Werner Lemberg <wl@gnu.org>
-
- Handle malformed `loca' table entries.
-
- * docs/TODO: Add some bugs which should be fixed.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Add `glyf_len'
- element.
-
- * src/truetype/ttpload.c (tt_face_load_loca): Get length of `glyf'
- table.
- (tt_face_get_location): Fix computation of `asize' for malformed
- `loca' entries.
-
-2005-05-01 David Turner <david@freetype.org>
-
- * Jamfile: Remove `otvalid' from the list of compiled modules.
-
- * include/freetype/internal/ftserv.h: Add compiler pragmas to get
- rid of annoying warnings with Visual C++ compiler in maximum warning
- mode.
-
- * src/autofit/afhints.c, src/autofit/aflatin.c, src/base/ftstroke.c,
- src/bdf/bdfdrivr.c, src/cache/ftcbasic.c, src/cache/ftccmap.c,
- src/cache/ftcmanag.c, src/cff/cffload.c, src/cid/cidload.c,
- src/lzw/zopen.c, src/otvalid/otvgdef.c, src/pcf/pcfread.c,
- src/sfnt/sfobjs.c, src/truetype/ttgxvar.c: Remove compiler warnings.
-
-2005-04-28 Werner Lemberg <wl@gnu.org>
-
- * docs/TODO: Updated.
-
-2005-04-24 Werner Lemberg <wl@gnu.org>
-
- * src/otvalid/otvcommn.c
- (otv_GSUBGPOS_have_MarkAttachmentType_flag): Handle table == 0.
-
-2005-04-16 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): Set default upem value in top
- font dict also.
- Handle font matrix settings in subfonts.
-
- * src/cff/cffgload.c (cff_slot_load): Use the correct font matrix
- for CID-keyed fonts with subfonts.
-
- * docs/formats.txt: Updated.
-
-2005-04-14 Kirill Smelkov <kirr@mns.spb.ru>
-
- * include/freetype/freetype.h (FT_Vector_Transform),
- include/freetype/ftimage.h (FT_Raster_Params),
- include/freetype/ftoutln.h, src/base/ftoutln.c (FT_Outline_Get_CBox,
- FT_Outline_Copy, FT_Outline_Transform, FT_Vector_Transform,
- FT_Outline_Get_Bitmap), src/raster/ftraster.c (ft_black_render),
- src/smooth/ftgrays.c (gray_raster_render): Decorate parameters with
- `const' where appropriate.
-
-2005-04-14 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_charstrings): Catch this non-standard
- beginning of the /CharStrings dictionary:
-
- /CharStrings 118 dict def
- Private begin
- CharStrings begin
-
- * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Fix arguments
- to call of tt_sbit_decoder_load_bitmap.
-
-2005-04-13 Werner Lemberg <wl@gnu.org>
-
- * docs/TODO: Updated.
-
- * autogen.sh: Use `--force' for all commands.
-
-2005-04-09 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshalgo.c (ps_hints_apply): Change scaling values
- only if `fitted' is not zero.
-
-2005-04-06 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (tt_face_get_metrics) [FT_OPTIMIZE_MEMORY]:
- Fix typo which sometimes causes wrong metrics for the last glyph.
-
-2005-04-04 David Turner <david@freetype.org>
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (FT_OPTIMIZE_MEMORY): Comment out this macro for the upcoming 2.1.10
- release.
- (*_CHESTER_*): Removed. No longer used.
-
- * src/autofit/afhints.c (af_axis_hints_new_segment,
- af_axis_hints_new_edge): Small tweak to use less heap memory.
-
-2005-04-03 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1parse.c (T1_New_Parser): Relax the check for a valid
- first line in the font.
-
-2005-04-03 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES, include/freetype/freetype.h: Improve documentation
- of FT_Set_Pixel_Sizes and FT_Set_Char_Size.
-
-2005-03-26 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/src/base/ftsystem.c (ft_amiga_stream_io): Fix buffer
- offsets after a large read.
-
-2005-03-26 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afglobal.c (af_face_globals_get_metrics):
- s/index/gidx/.
-
- * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Fix compiler
- warnings.
-
- * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttsbit0.c.
-
- * src/sfnt/ttsbit0.h: Dummy file for build with `make'.
-
-2005-03-26 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- Update of the Amiga port.
-
- * builds/amiga/makefile, builds/amiga/makefile.os4,
- builds/amiga/smakefile: Included the base extension files
- (ftbitmap.c, ftotval.c, ftpfr.c, ftstroke.c, ftxf86.c).
-
-2005-03-25 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- Update of the Amiga port.
-
- * builds/amiga/makefile, builds/amiga/smakefile: Handle new modules.
-
- * builds/amiga/makefile.os4: Makefile for AmigaOS4 SDK.
-
- * builds/amiga/README: Updated.
-
- * builds/amiga/include/freetype/config/ftconfig.h: Handle gcc for
- AmigaOS4.
-
- * builds/amiga/include/freetype/config/ftmodule.h: Handle new
- modules.
-
- * builds/amiga/src/base/ftdebug.c: Updated to current version of
- default ftdebug.c.
- Add various include files and macros to have proper support for
- both AmigaOS4 and older AmigaOS versions.
- Don't declare KVPrintF explicitly.
- Replace getenv with GetVar.
- Actually enable debugging code.
-
- * builds/amiga/src/base/ftsystem.c: Major rewrite.
-
-2005-03-23 Werner Lemberg <wl@gnu.org>
-
- * tests/*: Removed.
-
-2005-03-23 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES, docs/INSTALL.ANY: Updated.
-
- * include/freetype/ftmoderr.h: Replace `Autohint' with `Autofit'.
- Add `OTvalid'.
-
- * src/autofit/aferrors.h: New file.
-
- * src/autofit/afglobal.c, src/autofit/afhints.c,
- src/autofit/aflatin.c, src/autofit/afloader.c: s/FT_Err_/AF_Err_/.
- Include aferrors.h.
-
- * src/autofit/rules.mk (AUTOF_DRV_H): Include aferrors.h.
-
- * src/otvalid/otverror.h: s/FT_Mod_Err_OTV/FT_Mod_Err_OTvalid/.
-
-2005-03-22 David Turner <david@freetype.org>
-
- * src/autohint/*: Removed.
- * Jamfile: Updated.
-
-2005-03-15 David Turner <david@freetype.org>
-
- * src/bdf/bdflib.c: Remove compiler warnings.
- (hash_rehash, hash_init): Don't call FT_MEM_ZERO.
- (_bdf_list_t): Add `memory' field.
- (_bdf_list_init, _bdf_list_done, _bdf_list_ensure): New functions.
- (_bdf_shift, _bdf_join): Rename to...
- (_bdf_list_shift, _bdf_list_join): This.
- (_bdf_split): Renamed to...
- (_bdf_list_split): This. Use new functions.
- (bdf_internal_readstream): Removed.
- (NO_SKIP): New macro.
- (_bdf_readstream): Rewritten.
- (bdf_create_property, _bdf_add_comment): Improve allocation.
- (_bdf_set_default_spacing, _bdf_parse_glyphs): Updated. Improve
- allocation.
- (_bdf_parse_properties, _bdf_parse_start): Updated.
- (bdf_load_font): Updated to use new functions.
-
- * src/type1/t1parse.c (check_type1_format): New function.
- (T1_New_Parser): Use it to check font header before allocating
- anything on the heap.
-
- * src/type42/t42parse.c (t42_parser_init): Modify functions to check
- the font header before allocating anything on the heap.
-
- * include/freetype/internal/ftmemory.h (FT_ARRAY_MAX,
- FT_ARRAY_CHECK): New macros.
-
- * src/base/ftstream.c (FT_Stream_TryRead): New function.
- * include/freetype/internal/ftstream.h: Updated.
-
- * src/pcf/pcfread.c (pcf_read_TOC), src/pcf/pcfutil.c
- (BitOrderInvert, TwoByteSwap, FourByteSwap): Minor fixes and
- simplifications. Try to protect the PCF driver from doing stupid
- things with broken fonts.
-
- * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Check the LZW header before
- doing anything else. This avoids unnecessary heap allocations
- (400KByte of heap memory for the LZW decoder).
-
- * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Ditto for the gzip
- decoder, although the code savings are smaller.
-
- * docs/CHANGES: Updated.
-
-2005-03-10 David Turner <david@freetype.org>
-
- * src/tools/glnames.py: Add comment to explain the compression
- being used for the Adobe Glyph List.
-
-2005-03-10 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttpload.c (tt_face_load_cvt, tt_face_load_fpgm):
- Fix serious typo which prevented correct TT rendering.
-
- * include/freetype/internal/ftmemory.h: Undo change from 2005-03-03.
- To suppress warnings it is sufficient to use `-fno-strict-aliasing'.
-
-2005-03-10 Werner Lemberg <wl@gnu.org>
-
- * src/tools/glnames.py: Formatted.
- Format output to be in sync with other FreeType code.
- Import `re' and `os.path'.
- (StringTable) <__init__>: Add parameter to initialize master table
- name.
- (StringTable) <dump>: Don't pass master table name.
- (StringTable) <dump_sublist>: Emit explanatory comment.
- Simplify and make output more human readable.
- (t1_bias, glyph_list, adobe_glyph_names): Removed. Unused.
- (main): Use `basename' for file name in header.
-
- * src/psnames/pstables.h: Regenerated.
-
-2005-03-09 David Turner <david@freetype.org>
-
- * src/tools/glnames.py: Rewrite the generator for the `pstables.h'
- header file which contains various constant tables related to glyph
- names. It now uses a different, more compact storage scheme that
- saves about 20KB. This also closes Savannah bug #12262.
-
- * src/psnames/pstables.h: Regenerated.
-
- * src/psnames/psmodule.c (ps_unicode_value): Use
- `ft_get_adobe_glyph_index', a new function defined in `pstables.h'.
- (ps_get_macintosh_name, ps_get_standard_strings): Updated.
-
- * src/base/ftobjs.c (FT_Set_Char_Size): Handle fractional sizes
- more carefully. This fixes Savannah bug #12263.
-
-2005-03-06 David Turner <david@freetype.org>
-
- * src/otvalid/otvgsub.c, src/otvalid/otvgpos.c: Make static tables
- constant.
-
- * src/autofit/aflatin.c (af_latin_metrics_init): Fix Savannah bug
- #12212 (auto-hinter refuses to work if no Unicode charmap in font).
-
-2005-03-05 Werner Lemberg <wl@gnu.org>
-
- * autogen.sh: New script for bootstrapping.
-
- * README.CVS: New file which documents bootstrapping.
-
- * builds/unix/aclocal.m4, builds/unix/config.guess,
- builds/unix/config.sub, builds/unix/configure,
- builds/unix/ltmain.sh: Removed.
-
-2005-03-04 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftutil.c: Include FT_INTERNAL_OBJECTS_H.
-
-2005-03-03 Werner Lemberg <wl@gnu.org>
-
- Various fixes for C and C++ compiling.
-
- * src/autofit/*: Add copyright messages.
-
- * src/autofit/afhints.c (af_glyph_hints_done): Don't use
- `AF_Dimension' but `int' for loop counter.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths): Don't use
- `AF_Dimension' but `int' for loop counter.
- Use proper enumeration value for `render_mode'.
- (af_latin_metrics_scale_dim): Don't shadow variables.
- (af_latin_hints_compute_segments): Use proper cast for `major_dir'
- and `segment_dir'.
- (af_latin_align_linked_edge, af_latin_hint_edges): Fix arguments of call to
- `af_latin_compute_stem_width'.
- (af_latin_hints_apply): Don't use `AF_Dimension' but `int' for loop
- counter.
-
- * src/base/ftdbgmem.c (ft_mem_table_get_source, FT_DumpMemory): Use
- proper cast for memory allocation.
-
- * src/cff/cffdrivr.c (cff_get_kerning): Use proper cast for
- initialization of `sfnt'.
-
- * src/sfnt/sfdriver.c: Include `ttkern.h'.
-
- * src/sfnt/ttkern.c (tt_face_get_kerning): Don't shadow variables.
-
- * src/truetype/ttgload.c: Include `ttpload.h'.
-
-2005-03-03 David Turner <david@freetype.org>
-
- * include/freetype/internal/ftmemory.h (FT_ALLOC, FT_REALLOC,
- FT_QALLOC, FT_QREALLOC) [gcc >= 3.3]: Provide macro versions which
- avoid compiler warnings.
- (FT_NEW, FT_NEW_ARRAY, FT_RENEW_ARRAY, FT_QNEW, FT_QNEW_ARRAY,
- FT_QRENEW_ARRAY, FT_ALLOC_ARRAY, FT_REALLOC_ARRAY): Updated.
-
- * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
- FT_FACE_FIND_GLOBAL_SERVICE, FT_FACE_LOOKUP_SERVICE) [__cplusplus]:
- Provide macro versions which avoid compiler warnings.
-
- * src/base/ftutil.c (ft_highpow2): New utility function.
-
- * include/freetype/internal/ftobjs.h: Updated.
-
- * src/pfr/pfrload.c (pfr_get_gindex, pfr_compare_kern_pairs,
- pfr_sort_kerning_pairs): Don't define if FT_OPTIMIZE_MEMORY is set.
- (pfr_phy_font_done): Don't handle `kern_pairs' if FT_OPTIMIZE_MEMORY
- is set.
- (pfr_phy_font_load): Don't call `pfr_sort_kerning_pairs' if
- FT_OPTIMIZE_MEMORY is set.
-
- * src/pfr/pfrobjs.c (pfr_slot_load): Comment out some code which
- doesn't work with broken fonts.
- (pfr_face_get_kerning) [FT_OPTIMIZE_MEMORY]: Implement.
-
- * src/pfr/pfrtypes.h (PFR_KernItemRec): Optimize member types.
- (PFR_NEXT_KPAIR): New macro.
- (PFR_PhyFontRec): Don't define `kern_pairs' if FT_OPTIMIZE_MEMORY is
- set.
-
- * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Introduce
- temporary variable to avoid gcc warning.
- (tt_face_load_sbit_image): Mark unused variables with FT_UNUSED.
-
- * src/truetype/ttpload.c (tt_face_load_loca) [FT_OPTIMIZE_MEMORY]:
- Remove redundant variable.
-
- * include/freetype/config/ftmodule.h: Moving the order of drivers to
- speed up font loading. The PCF and BDF loaders are still slow and
- consume far too much memory.
-
-2005-03-03 Werner Lemberg <wl@gnu.org>
-
- * devel/ftoption.h: Updated to recent changes.
-
-2005-03-02 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afdummy.c, src/autofit/afdummy.h
- (af_dummy_script_class): Fix type.
-
- * src/autofit/aflatin.c, src/autofit/aflatin.h
- (af_latin_script_class): Fix type.
-
- * src/autofit/rules.mk (AUTOF_DRV_SRC): Fix typo.
-
-2005-03-01 David Turner <david@freetype.org>
-
- * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning),
- src/sfnt/ttsbit0.c (tt_face_load_sbit_strikes,
- tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_compound,
- tt_sbit_decoder_load_image), src/sfnt/ttload.c
- (tt_face_load_metrics): Remove compiler warnings
- -- redundant variables, missing initializations, etc.
-
- * src/sfnt/ttsbit.h: Handle FT_OPTIMIZE_MEMORY.
-
- * src/autofit/rules.mk, src/autofit/module.mk,
- src/autofit/afangles.h: New files.
-
- * src/autofit/afhints.c (af_axis_hints_new_segment,
- af_axis_hints_new_edge): New functions.
- (af_glyph_hints_done): Do proper deallocation.
- (af_glyph_hints_reload): Only reallocate points array. This
- drastically reduces heap usage.
-
- * src/autofit/afhints.h (AF_PointRec, AF_SegmentRec): Optimize
- member types and positions.
- (AF_AxisHintsRec): Add `max_segments' and `max_edges'.
- (af_axis_hints_new_segment, af_axis_hints_new_edge): New prototypes.
-
- * src/autofit/aflatin.c (af_latin_metrics_scale): Don't call
- AF_SCALER_EQUAL_SCALES.
- (af_latin_hints_compute_segments): Change return type to FT_Error.
- Update all callers.
- Improve segment allocation.
- (af_latin_hints_compute_edges): Change return type to FT_Error.
- Update all callers.
- Improve edge allocation and link handling.
- (af_latin_hints_detect_features): Change return type to FT_Error.
- Update all callers.
-
- * src/autofit/aflatin.h: Updated.
-
- * src/autofit/afloader.c (af_loader_load_g)
- <FT_GLYPH_FORMAT_OUTLINE>: Assure axis->num_edges > 1. This fixes
- a bug with certain fonts.
-
- * include/freetype/config/ftmodule.h: The auto-fitter is now the
- only supported auto-hinting module.
-
- * include/freetype/config/ftstdlib.h (FT_INT_MAX): New macro.
-
-2005-02-28 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttpload.c (tt_face_load_loca): Fix typo.
-
- * src/sfnt/ttkern.c: Include `ttkern.h'.
- (FT_COMPONENT): Updated.
-
- * include/freetype/internal/fttrace.h: Add entry for `ttkern'.
-
- * src/sfnt/ttsbit0.c: s/FT_Err_/SFNT_Err_/.
- Decorate constants with `U' and `L' where necessary.
-
- * src/sfnt/ttcmap.c (tt_cmap4_next): Remove unused variable.
-
-2005-02-28 David Turner <david@freetype.org>
-
- * src/base/ftdbgmem.c (FT_DumpMemory): Added sorting of memory
- sources according to decreasing maximum cumulative allocations.
- (ft_mem_source_compare): New auxiliary function.
-
- * src/sfnt/ttsbit0.c: New file, implementing a heap-optimized
- embedded bitmap loader.
-
- * src/sfnt/ttsbit.c: Include `ft2build.h', FT_INTERNAL_DEBUG_H,
- FT_INTERNAL_STREAM_H, FT_TRUETYPE_TAGS_H.
- Load `ttsbit0.c' if FT_OPTIMIZE_MEMORY is set, otherwise use
- file contents.
- (tt_face_load_sbit_strikes): Set up root fields to indicate the
- strikes. This fixes Savannah bug #12107.
- Use `static' keyword for `sbit_line_metrics_field',
- `strike_start_fields', `strike_end_fields'.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Define
- `sbit_table', `sbit_table_size', `sbit_num_strikes' if
- FT_OPTIMIZE_MEMORY is set.
- Don't define `num_sbit_strikes' and `sbit_strikes' if
- FT_OPTIMIZE_MEMORY is set.
-
- * src/cff/cffobjs.c (sbit_size_reset): Handle FT_OPTIMIZE_MEMORY.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Fixed bug that prevented
- loading SFNT fonts without a `kern' table.
- Properly pass root->face_flags.
- Remove code for TT_CONFIG_OPTION_EMBEDDED_BITMAPS.
-
- * src/sfnt/sfdriver.c (sfnt_interface)
- [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Don't use `tt_find_sbit_image'
- and `tt_load_sbit_metrics'.
-
- * src/sfnt/ttcmap.c: Optimize linear charmap scanning for Format 4.
- (OPT_CMAP4): New macro.
- (TT_CMap4Rec) [OPT_CMAP4]: New structure.
- (tt_cmap4_init, tt_cmap4_set_range, tt_cmap4_next, tt_cmap4_reset)
- [OPT_CMAP4]: New functions.
- (tt_cmap4_char_next) [OPT_CMAP4]: Use `tt_cmap4_next' and
- `tt_cmap4_reset'.
- (tt_cmap4_class_rec) [OPT_CMAP4]: Use `TT_CMap4Rec' and
- `tt_cmap4_init'.
-
- * src/truetype/ttobjs.c (Reset_SBit_Size): Handle
- FT_OPTIMIZE_MEMORY.
-
- * src/autofit/afhints.h (AF_PointRec, AF_SegmentRec, AF_EdgeRec):
- Optimize member types.
-
- * src/autofit/afloader.c (af_loader_done): Call
- `af_glyph_hints_done'.
-
-2005-02-27 David Turner <david@freetype.org>
-
- * src/sfnt/ttkern.c (tt_face_load_kern): Fix a small bug which
- caused invalid (random) return values for the horizontal kerning.
-
-2005-02-25 David Turner <david@freetype.org>
-
- Implement several memory optimizations to drastically reduce the
- heap usage of FreeType, especially in the case of memory-mapped
- files. The idea is to avoid loading and decoding tables in the
- heap, and instead access the raw data whenever possible (i.e., when
- it doesn't compromise performance).
-
- This has several benefits: For example, opening vera.ttf now uses
- just a small amount of memory (even when the FT_Library footprint is
- accounted for), until you start loading glyphs. Even then, you save
- at least 20KB compared to the non-optimized case. Performance of
- various operations, including open and close, has also been
- dramatically improved.
-
- More optimizations to come, especially for the auto-hinter.
-
- * include/freetype/internal/sfnt.h (TT_Face_GetKerningFunc): New
- function type.
- (SFNT_Interface): Add it.
-
- * include/freetype/internal/tttypes.h (TT_HdmxEntryRec, TT_HdmxRec,
- TT_Kern0_PairRec): Don't define if FT_OPTIMIZE_MEMORY is set.
- (TT_FaceRec): Define `horz_metrics', `horz_metrics_size',
- `vert_metrics', `vert_metrics_size', `hdmx_table',
- `hdmx_table_size', `hdmx_record_count', `hdmx_record_size',
- `hdmx_record_sizes', `kern_table', `kern_table_size,
- `num_kern_tables', `kern_avail_bits', `kern_order_bits' if
- FT_OPTIMIZE_MEMORY is set.
- Don't define `hdmx', `num_kern_pairs', `kern_table_index',
- `kern_pairs' if FT_OPTIMIZE_MEMORY is set.
-
- * src/base/ftdbgmem.c (ft_mem_table_set): Don't shadow variable.
- Fix compiler warning.
-
- * src/cff/cffdrivr.c (Get_Kerning): Renamed to...
- (cff_get_kerning): This. Simplify.
- (cff_driver_class): Updated.
-
- * src/sfnt/Jamfile (_sources): Add `ttkern'.
- * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `ttkern.c'.
-
- * src/sfnt/sfdriver.c (sfnt_interface): Add `tt_face_get_kerning'.
-
- * src/sfnt/sfnt.c: Include `ttkern.c'.
-
- * src/sfnt/sfobjs.c: Include `ttkern.h'.
- (sfnt_load_face): Consider the `kern' and `gasp' table as optional.
- (sfnt_done_face): Call `tt_face_done_kern'.
- Handle horizontal metrics for FT_OPTIMIZE_MEMORY.
-
- * src/sfnt/ttkern.c, src/sfnt/ttkern.h: New files. Code has been
- taken from `ttload.c' and `ttload.h'.
- Provide special versions of `tt_face_load_kern',
- `tt_face_get_kerning', and `tt_face_done_kern' for
- FT_OPTIMIZE_MEMORY.
-
- * src/sfnt/ttload.c (tt_face_load_metrics, tt_face_load_hdmx,
- tt_face_free_hdmx): Provide version for FT_OPTIMIZE_MEMORY.
- (tt_face_load_kern, tt_kern_pair_compare, TT_KERN_INDEX): Moved to
- `ttkern.c'.
-
- * src/sfnt/ttload.h: Updated.
-
- * src/sfnt/ttsbit.c (sbit_metrics_field): Add `static' keyword.
-
- * src/truetype/ttdriver.c (Get_Kerning): Renamed to...
- (tt_get_kerning): This. Simplify.
- (tt_driver_class): Updated.
-
- * src/truetype/ttgload.c (TT_Get_Metrics): Renamed to...
- (tt_face_get_metrics): This. Provide version for FT_OPTIMIZE_MEMORY.
- Update all callers.
- (Get_Advance_Widths): Replaced with...
- (Get_Advance_WidthPtr): This. Provide version for
- FT_OPTIMIZE_MEMORY.
- Update all callers.
-
- * src/truetype/ttgload.h: Updated.
-
-2005-02-22 David Turner <david@freetype.org>
-
- * src/base/ftdbgmem.c: Partly rewritten. Added the ability to list
- all allocation sites in the memory debugger. Also a new function
- FT_DumpMemory() was added. It is only available in builds with
- FT_DEBUG_MEMORY defined, and you must declare it in your own code to
- use it, i.e., with something like:
-
- extern void FT_DumpMemory( FT_Memory );
-
- ...
-
- FT_DumpMemory( memory );
-
- * include/freetype/config/ftoption.h
- (TT_CONFIG_OPTION_BYTECODE_INTERPRETER): Comment out definition --
- again.
- (FT_OPTIMIZE_MEMORY): New configuration macro to control various
- optimizations for reducing the heap footprint of memory-mapped
- TrueType files.
-
- * include/freetype/internal/ftmemory.h (FT_ARRAY_ZERO): New
- convenience macro.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec)
- [FT_OPTIMIZE_MEMORY]: Use optimized types for `num_locations' and
- `glyph_locations'.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Call
- `tt_face_get_location'.
-
- * src/truetype/ttobjs.c (tt_face_init)
- [FT_CONFIG_OPTION_INCREMENTAL]: Improve error handling.
- (tt_face_done): Call `tt_face_done_loca'.
-
- * src/truetype/ttpload.c (tt_face_get_location, tt_face_done_loca):
- New functions. If FT_OPTIMIZE_MEMORY is set, the locations table is
- read directly from memory-mapped streams, instead of being decoded
- into the heap.
- (tt_face_load_loca) [FT_OPTIMIZE_MEMORY]: New implementation.
- (tt_face_load_cvt, tt_face_load_fpgm): Only load table if the
- bytecode interpreter is compiled in.
-
- * src/truetype/ttpload.h: Updated.
-
- * src/autohint/ahglyph.c (ah_outline_load): Improve allocation
- logic.
-
-2005-02-20 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
- --copy' from libtool 1.5.14.
- * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
- automake 1.9.4.
-
- * builds/unix/config.guess, builds/unix/config.sub: Updated from
- `config' CVS module at subversions.gnu.org.
-
- * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
- `texinfo' CVS module at subversions.gnu.org.
-
-2005-02-14 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffcmap.c (cff_cmap_unicode_init): Don't try to build
- a cmap for a CID-keyed font which doesn't have SIDs.
-
-2005-02-13 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (read_binary_data): Return more meaningful
- value.
- (parse_encoding, parse_subrs, parse_charstrings, parse_dict): Check
- parser error value after call to T1_Skip_PS_Token (where necessary).
-
- * src/type1/t1parse.c (T1_Get_Private_Dict): Check parser error
- value after call to T1_Skip_PS_Token.
-
- * src/cid/cidparse.c (cid_parser_new): Check parser error value
- after call to cid_parser_skip_PS_token.
-
- * src/type42/t42parse.c (t42_parse_encoding, t42_parse_sfnts,
- t42_parse_charstrings, t42_parse_dict): Check parser error value
- after call to T1_Skip_PS_Token (where necessary).
-
- * src/psaux/psobjs.c (skip_string, ps_parser_skip_PS_token,
- ps_tobytes): Add error messages.
-
-2005-02-12 Werner Lemberg <wl@gnu.org>
-
- * configure: Output more variables to the created Makefile so that
- it can be used for ft2demos also (if the FT2DEMOS variable is
- defined).
-
-2005-02-10 David Turner <david@freetype.org>
-
- * src/pfr/pfrgload.c (pfr_glyph_load): Fix an unbounded growing
- dynamic array when loading a glyph from a PFR font (Savannah bug
- #11921).
-
- * src/base/ftbitmap.c (FT_Bitmap_Convert): Small improvements to the
- conversion function (mainly stupid optimization).
-
- * src/base/Jamfile: Adding ftbitmap.c to the list of compiled files.
-
-2005-02-10 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype-config.in: Add new flag `--ftversion' to
- return the FreeType version. Suggested by George Williams
- <gww@silcom.com>.
-
- * docs/CHANGES: Updated.
-
-2005-02-09 Werner Lemberg <wl@gnu.org>
-
- * src/otvalid/otvmod.c (otv_validate): Deallocate arrays in case
- of error. Reported by YAMANO-UCHI Hidetoshi <mer@din.or.jp>.
-
-2005-02-08 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- <op_closepath>: Accept `T1_Parse_Have_Moveto' state also which can
- happen in empty glyphs. Reported by Ian Brown
- <ian.brown@printsoft.de> (Savannah bug #11856).
-
-2005-02-04 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/*: Removed. Obsolete.
-
-2004-12-28 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
- --copy' from libtool 1.5.10.
- * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
- automake 1.9.4.
- * builds/unix/configure: Regenerated with autoconf 2.59b.
-
- * builds/unix/config.guess, builds/unix/config.sub: Updated from
- `config' CVS module at subversions.gnu.org.
-
- * builds/unix/install-sh: Updated from
- `texinfo' CVS module at subversions.gnu.org.
-
- * builds/unix/ftsystem.c (FT_Stream_Open): Add proper cast for
- ft_alloc.
- Fix compiler warning.
-
-2004-12-27 Dirck Blaskey <listtarget@danbala.com>
-
- * src/cff/cffobjs.c (cff_face_init): Improve computation of
- FT_STYLE_BOLD_FLAG.
-
-2004-12-27 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): A CFF within an SFNT can have
- only a single font. This is undocumented but has been verified on
- the opentype list.
-
-2004-12-26 Werner Lemberg <wl@gnu.org>
-
- * Jamfile (FT2_COMPONENTS): Add `otvalid'.
-
-2004-12-25 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftbitmap.c (FT_Bitmap_Convert): Fix compiler warning.
-
-2004-12-15 Werner Lemberg <wl@gnu.org>
-
- * vms_make.com: Add ftbitmap.obj.
-
-2004-12-14 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftbitmap.c, include/freetype/ftbitmap.h: New files for
- handling various bitmap formats.
-
- * include/freetype/config/ftheader.h (FT_BITMAP_H): New macro.
-
- * src/base/rules.mk (BASE_EXT_SRC): Add ftbitmap.c.
-
- * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Don't convert bitmaps to 8bpp
- but return them as-is.
-
- * docs/CHANGES: Mention new bitmap API.
- * include/freetype/ftchapters.h: Updated.
-
-2004-12-11 Robert Clark <freetype@ratty.org.uk>
-
- * src/base/ftobjs.c (FT_Get_Kerning): Make kerning amount
- dependent on ppem by scaling down for ppem < 25, then do normal
- rounding. This gives slightly better results than rounding towards
- zero.
-
-2004-12-09 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Get_Kerning): Always round towards zero
- for FT_KERNING_DEFAULT. This greatly enhances the kerning for
- small ppem values.
-
-2004-12-08 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (ft_glyphslot_clear): Reset `lsb_delta' and
- `rsb_delta'.
-
-2004-12-05 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/install.mk (install): Use $(OBJ_BUILD) for ftconfig.h.
-
-2004-12-03 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
-
- * include/freetype/ttnameid.h: Updated to latest
- specifications from Microsoft.
-
-2004-11-26 Jouk Jansen <joukj@hrem.stm.tudelft.nl>
-
- * vms_make.com: Include ftbbox.c.
- Fix `ccopt'.
- Handle `otvalid' module.
- Update `vmslib.dat' default values.
- Fixes to `libs.opt'.
-
-2004-11-23 Anders Kaseorg <anders@kaseorg.com>
-
- * src/base/ftoutln.c (FT_OrientationExtremumRec,
- ft_orientation_extremum_compute): Removed.
- (FT_Outline_Get_Orientation): Rewritten, simplified.
-
- * src/autohint/ahglyph.c: Include FT_OUTLINE_H.
- (ah_test_extremum, ah_get_orientation): Removed.
- (ah_outline_load): Use FT_Outline_Get_Orientation.
-
- * src/base/ftsynth.c (ft_test_extrema, ft_get_orientation): Removed.
- (FT_GlyphSlot_Embolden): Use FT_Outline_Get_Orientation.
-
-2004-11-23 Fernando Papa <fpapa@netgate.com.uy>
-
- * src/truetype/ttinterp.h: Fix typo.
-
-2004-11-22 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
-
- * builds/win32/detect.mk: Corrected logic that detects Windows NT to
- use the previous change even if win32 is forced. Corrected
- detection of win32 on Win9X.
-
- * builds/dos/detect.mk: Added same correction as for win32 about
- COPY on Windows NT. Detection of plain DOS 7.x.
-
-2004-11-22 Werner Lemberg <wl@gnu.org>
-
- * builds/detect.mk: Undo change from 2004-11-20.
- * builds/win32/detect.mk: If the `OS' environment variable contains
- `Windows_NT', use `cmd.exe /c copy' for copying files.
-
-2004-11-20 Werner Lemberg <wl@gnu.org>
-
- * builds/detect.mk (dos_setup): Use `cmd.exe' for copying
- $(CONFIG_MK) to force lowercase file name under Windows.
-
-2004-11-19 Werner Lemberg <wl@gnu.org>
-
- Fix a serious bug in the TT hinter.
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Don't shift
- points vertically before hinting.
-
- * docs/CHANGES: Updated.
-
- * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily,
- FTC_GCache_Lookup): A new try to fix comparison with zero.
-
-2004-11-16 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.ac: Add `-fno-strict-aliasing' if gcc is
- used.
- * builds/unix/configure: Regenerated.
- * builds/unix/config.guess, builds/unix/config.sub: Updated from
- `config' CVS module at subversions.gnu.org.
-
-2004-11-16 Dr. Martin P.J. Zinser <zinser@decus.de>
-
- * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily,
- FTC_GCache_Lookup): Fix comparison with zero.
-
- * docs/INSTALL.VMS: Updated.
-
- * vms_make.com: Updated. All `descrip.mms' files are now created
- automatically.
-
- * src/*/descrip.mms: Removed.
-
-2004-11-16 Owen Taylor <otaylor@redhat.com>
-
- * builds/unix/freetype-config.in: Suppress -L$libdir for
- /usr/lib64 as well as /usr/lib. (Reported by Dan Winship -
- https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=139199)
-
-2004-11-11 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffdrivr.c (cff_service_ps_info): Updated.
- * src/cid/cidriver.c (cid_service_ps_info): Updated.
- * src/type42/t42drivr.c (t42_ps_get_font_private): New function.
- (t42_service_ps_info): Updated.
-
- * src/type42/t42parse.c (t42_parse_dict): Remove compiler warning.
-
-2004-11-11 David Bevan <dbevan@emtex.com>
-
- Add new function FT_Get_PS_Font_Private().
-
- * include/freetype/internal/services/svpsinfo.h
- (PS_GetFontPrivateFunc): New service function.
-
- * include/freetype/t1tables.h, src/base/fttype1.c
- (FT_Get_PS_Font_Private): New function.
-
- * src/type1/t1driver.c (t1_ps_get_font_private): New function.
- (t1_service_ps_info): Updated.
-
-2004-10-13 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftstdlib.h: Include `stddef.h'.
- (ft_ptrdiff_t): Define.
-
- * include/freetype/fttypes.h (FT_PtrDist): Use `ft_ptrdiff_t'.
-
- * src/cid/cidload.c (cid_parse_dict), src/type1/t1load.c
- (parse_dict): Fix compiler warning.
-
-2004-10-11 Joshua Neal <jneal@csdaily.com>
-
- * src/sfnt/ttcmap.c (tt_face_build_cmaps): Check for pointer
- overflow.
-
- * src/sfnt/ttload.c (tt_face_load_hdmx): Protect against bad input.
- Don't use FT_QNEW_ARRAY but FT_NEW_ARRAY to make deallocation work
- in case of failure.
-
- * src/sfnt/ttsbit.c (Load_SBit_Range): Check range intervals.
- (tt_face_load_sbit_strikes): Allocate `strike_sbit_ranges' after
- frame test.
-
- * src/truetype/ttgload.c (TTLoad_Simple_Glyph): Add assertion for
- `flag'.
-
-2004-10-09 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2004-10-09 Boris Letocha <b.letocha@cz.gmc.net>
-
- Fix handling of NPUSHW if skipped in data stream.
-
- * src/truetype/ttinterp.c (opcode_length): Set value for NPUSHW
- to -2.
- (SkipCode, TT_RunIns): Use opcode_length value for computation of
- bytes to be skipped.
-
-2004-09-10 Jouk Jansen <joukj@hrem.stm.tudelft.nl>
-
- * vms_make.com: Updated.
-
-2004-09-09 Werner Lemberg <wl@gnu.org>
-
- Adding OpenType validation module. The code is based on the
- (unfinished) `otlayout' module but has been heavily modified to make
- it much more compact.
-
- * src/otvalid/*: New module.
-
- * include/freetype/ftotval.h, src/base/ftotval.c,
- include/freetype/internal/services/svotval.h: New files.
-
- * include/freetype/config/ftmodule.h: Add otv_module_class.
- * include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
- macro.
- * include/freetype/internal/ftserv.h
- (FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
- * include/freetype/internal/fttrace.h (otvmodule, otvcommon,
- otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
-
- * include/freetype/ftchapters.h: Updated.
-
- * src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
- src/base/rules.mk (BASE_EXT_SRC): Updated.
-
- * docs/CHANGES: Updated.
-
-2004-09-08 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/sources.py (re_source_block_format2) <column>:
- Use lookahead assertion to not match `*/'. This removes spurious
- insertions of `/' in the HTML output.
-
-2004-09-07 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Fix call to
- FT_NEW_ARRAY.
-
-2004-09-04 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftobjs.h: Don't include
- FT_CONFIG_STANDARD_LIBRARY_H.
- (FT_Validator, FT_ValidationLevel, FT_ValidatorRec, FT_VALIDATOR,
- ft_validator_init, ft_validator_run, ft_validator_error, FT_INVALID,
- FT_INVALID_TOO_SHORT, FT_INVALID_OFFSET, FT_INVALID_FORMAT,
- FT_INVALID_GLYPH_ID, FT_INVALID_DATA): Move to...
-
- * include/freetype/internal/ftvalid.h: New file.
- Make FT_INVALID return module-specific error codes.
-
- * include/freetype/internal/internal.h (FT_INTERNAL_VALIDATE_H): New
- macro.
-
- * include/freetype/fterrors.h: Undefine FT_ERR_PREFIX only if
- FT_KEEP_ERR_PREFIX isn't defined.
-
- * src/base/ftobjs.c: Include FT_INTERNAL_VALIDATE_H.
-
- * src/sfnt/ttcmap.h: Don't include FT_INTERNAL_OBJECTS_H but
- FT_INTERNAL_VALIDATE_H.
-
- * src/sfnt/ttcmap.c: Don't include FT_INTERNAL_OBJECTS_H but
- FT_INTERNAL_VALIDATE_H.
- Include sferrors.h before FT_INTERNAL_VALIDATE_H.
- s/FT_Err_Ok/SFNT_Err_Ok/.
-
- * src/sfnt/sferrors.h: Define FT_KEEP_ERR_PREFIX.
-
- * src/type1/t1afm.c: Include t1errors.h.
-
-2004-09-03 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftdebug.c (ft_debug_init): Highest debug level is 7,
- not 6.
- * docs/DEBUG: Updated.
-
-2004-08-30 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/tttags.h (TTAG_BASE, TTAG_GDEF, TTAG_GPOS,
- TTAG_JSTF): New tags.
-
- * include/freetype/fttypes.h (FT_Bytes, FT_Tag): New typedefs.
- (FT_Int): Add `signed'.
-
-2004-08-29 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/otlgpos.c (otl_gpos_subtable_validate): Add argument
- to pass number of lookups.
- Update all callers.
- Don't call otl_lookup_list_validate but otl_lookup_validate.
- (otl_gpos_validate): Call otl_lookup_list_validate instead of
- otl_gpos_subtable_validate.
-
- * src/otlayout/otlgpos.h: Updated.
-
- * src/otlayout/otljstf.c (otl_jstf_max_validate): Add argument to
- pass number of lookups.
- Update all callers.
-
-
- * src/cff/cffparse.c (cff_parse_real): s/exp/exponent/ to avoid
- compiler warning.
-
-
- * src/sfnt/ttcmap0.c, src/sfnt/ttcmap0.h: Renamed to...
- * src/sfnt/ttcmap.c, src/sfnt/ttcmap.h: This.
- * src/sfnt/Jamfile, src/sfnt/rules.mk, src/sfnt/sfdriver.c,
- src/sfnt/sfnt.c, src/sfnt/sfobjs.c: Updated.
-
-
- * builds/compiler/gcc-dev.mk (CFLAGS): Don't add `-Wnested-externs'
- if compiler is g++ (v3.3.3 emits a warning otherwise).
-
-2004-08-28 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/otlgpos.c (otl_value_length): Return number of bytes,
- not number of 16bit entities.
- (otl_gpos_lookup2_validate): Check class definition tables for
- format 2.
- Fix loop for format 2.
- (otl_liga_mark2_validate): Fix offset for otl_anchor_validate.
-
-2004-08-27 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftmac.c: Don't include truetype/ttobjs.h.
- Don't include type1/t1objs.h.
- (FT_New_Face_From_FSSpec) [!__MWERKS__]: Remove compiler warnings.
-
-2004-08-27 Mathieu Malaterre <mathieu@malaterre.com>
-
- * src/base/ftmac.c: Handle OS_INLINE for xlc compiler also.
-
-2004-08-27 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/otlayout.h: Add copyright.
- (OTL_INVALID_OFFSET): Removed.
-
- * src/otlayout/otlgdef.h: Include otlayout.h.
- Comment out inclusion of otltable.h.
-
- * src/otlayout/otlgpos.c (otl_gpos_lookup4_validate): Fix call
- to otl_base_array_validate.
- (otl_liga_mark2_validate): Fix `for' loop.
-
- * src/otlayout/otlgsub.c (otl_ligature_validate): Check `glyph_id',
- not components array.
-
- * src/otlcommn.c (otl_lookup_get_count, otl_feature_get_count):
- Comment out.
- (otl_lookup_list_get_count, otl_feature_list_get_count): Activate.
- (otl_feature_list_validate, otl_gsubgpos_get_lookup_count):
- s/otl_lookup_get_count/otl_lookup_list_get_count/.
- (otl_script_list_validate):
- s/otl_feature_get_count/otl_feature_list_get_count/.
- (otl_script_validate): Call otl_lang_validate for default language.
-
- * src/otlayout/otlcommn.h: Updated.
-
-2004-08-16 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/otlgpos.c (otl_gpos_lookup1_validate,
- otl_gpos_lookup2_validate, otl_gpos_lookup3_validate,
- otl_gpos_lookup4_validate, otl_gpos_lookup5_validate,
- otl_gpos_lookup6_validate, otl_gpos_lookup9_validate,
- otl_gpos_validate): Update
- function arguments.
- (otl_gpos_lookup7_validate, otl_gpos_lookup8_validate): Update
- function arguments.
- Handle NULL offsets correctly.
- Check sequence and lookup indices for format 3.
- (otl_pos_rule_validate, otl_chain_pos_rule_validate): Add argument
- to pass lookup count.
- Check sequence and glyph indices.
- (otl_gpos_subtable_validate): Update function arguments.
- Update callers.
-
- * src/otlayout/otlgpos.h: Updated.
-
- * src/otlayout/otlgsub.c (otl_gsub_lookup1_validate,
- otl_gsub_lookup3_validate, otl_gsub_lookup8_validate): Update
- function arguments.
- Add glyph index checks.
- (otl_sequence_validate, otl_alternate_set_validate,
- otl_ligature_validate): Add argument to pass glyph count.
- Update callers.
- Add glyph index check.
- (otl_gsub_lookup2_validate, otl_gsub_lookup4_validate): Update
- function arguments.
- (otl_ligature_set_validate): Add argument to pass glyph count.
- Update caller.
- (otl_sub_class_rule_validate,
- otl_sub_class_rule_set_validate): Removed.
- (otl_sub_rule_validate, otl_chain_sub_rule_validate): Add argument
- to pass lookup count.
- Update callers.
- Add lookup index check.
- (otl_sub_rule_set_validate, otl_chain_sub_rule_set_validate): Add
- argument to pass lookup count.
- Update callers.
- (otl_gsub_lookup5_validate): Update function arguments.
- Handle NULL offsets correctly.
- Don't call otl_sub_class_rule_set_validate but
- otl_sub_rule_set_validate.
- Check sequence and lookup indices for format 3.
- (otl_gsub_lookup6_validate): Update function arguments.
- Handle NULL offsets correctly.
- Check sequence and lookup indices for format 3.
- (otl_gsub_lookup7_validate, otl_gsub_validate): Update function
- arguments.
-
- * src/otlayout/otlgsub.h: Updated.
-
- * src/otlayout/otlbase.c (otl_base_validate): Handle NULL offsets
- correctly.
-
- * src/otlayout/otlcommn.c (otl_class_definition_validate): Fix
- compiler warning.
- (otl_coverage_get_first, otl_coverage_get_last): New functions.
- (otl_lookup_validate): Add arguments to pass lookup and glyph
- counts.
- Update callers.
- (otl_lookup_list_validate): Add argument to pass glyph count.
- Update callers.
-
- * src/otlayout/otlcommn.h: Updated.
-
- * src/otlayout/otljstf.c (otl_jstf_extender_validate,
- otl_jstf_max_validate, otl_jstf_script_validate,
- otl_jstf_priority_validate, otl_jstf_lang_validate): Add parameter
- to validate glyph indices.
- Update callers.
- (otl_jstf_validate): Add parameter which specifies number of glyphs
- in font.
-
- * src/otlayout/otljstf.h: Updated.
-
-2004-08-15 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/otlgpos.c (otl_liga_mark2_validate): Add parameter
- to handle possible NULL values properly.
- Update all callers.
-
-2004-08-15 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/gpos.c: Rename counting variables to be more
- meaningful.
- Add copyright.
- (otl_liga_attach_validate): Renamed to...
- (otl_liga_mark2_validate): This.
- Update all callers.
- (otl_mark2_array_validate): Removed.
- (otl_gpos_lookup6_validate): Call otl_liga_mark2_validate, not
- otl_mark2_array_validate.
- (otl_pos_class_set_validate, otl_pos_class_rule_validate): Removed.
- (otl_gpos_lookup7_validate): Complete code for format 2.
- (otl_chain_pos_class_rule_validate,
- otl_chain_pos_class_set_validate): Removed.
- (otl_gpos_lookup8_validate): Don't call
- otl_chain_pos_class_set_validate but
- otl_chain_pos_rule_set_validate.
- Simplify some code.
-
- * src/otlayout/otlgpos.h: Add copyright.
-
-2004-08-14 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/otljstf.c (otl_jstf_gsub_mods_validate): Removed.
- (otl_jstf_gpos_mods_validate): Renamed to...
- (otl_jstf_gsubgpos_mods_validate): This.
- Test whether lookup_count is zero.
- (otl_jstf_priority_validate): Use otl_jstf_gsubgpos_mods_validate.
- (otl_jstf_validate): Initialize gsub_lookup_count and
- gpos_lookup_count if gsub or gpos is zero.
-
- * src/otlayout/otlgsub.c: Rename counting variables to be more
- meaningful.
- Add copyright.
- (otl_gsub_lookup1_validate): Simplify code.
- (otl_gsub_lookup2_validate, otl_gsub_lookup3_validate,
- otl_gsub_lookup4_validate, otl_gsub_lookup7_validate): Remove unused
- variables.
- (otl_gsub_lookup5_validate): Remove unused variable.
- Fix call to otl_sub_rule_set_validate and
- otl_sub_class_rule_set_validate.
- (otl_chain_sub_class_rule_validate,
- otl_chain_sub_class_set_validate): Removed.
- (otl_gsub_lookup6_validate): Remove unused variable.
- Fix call to otl_chain_sub_rule_set_validate.
- (otl_gsub_lookup7_validate): Handle lookup type 8 also.
- (otl_gsub_lookup8_validate: New function.
- (otl_gsub_lookup1_apply, otl_gsub_lookup2_apply,
- otl_gsub_lookup3_apply): Commented out.
- (otl_gsub_validate_funcs): Add otl_gsub_lookup7_validate and
- otl_gsub_lookup8_validate.
- (otl_gsub_validate): Updated.
-
- * src/otlayout/otlgsub.h: Add copyright.
-
- * src/otlayout/otlcommn.c, src/otlayout/otlcommn.h
- (otl_coverage_get_index): Comment out.
-
-2004-08-13 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/otlcommn.c (otl_gsubgpos_get_lookup_count): New
- function.
- * src/otlayout/otlcommn.h: Updated.
-
- * src/otlayout/otlbase.c: Rename counting variables to be more
- meaningful.
- Add copyright message.
- * src/otlayout/otlbase.h: Add copyright message.
-
- * src/otlayout/otlgdef.c: Rename counting variables to be more
- meaningful.
- Add copyright message.
- Use OTL_CHECK everywhere.
- (otl_caret_value_validate): Remove unused variable.
- (otl_gdef_validate): All tables are optional.
- * src/otlayout/otlgdef.h: Add copyright message.
-
- * src/otlayout/otljstf.c: Rename counting variables to be more
- meaningful.
- Add copyright message.
- (otl_jstf_gsub_mods_validate, otl_jstf_gpos_mods_validate): Add
- parameter to pass lookup count.
- Update all callers.
- Check lookup array.
- (otl_jstf_max_validate):
- s/otl_gpos_subtable_check/otl_gpos_subtable_validate/.
- (otl_jstf_priority_validate, otl_jstf_lang_validate,
- otl_jstf_script_validate): Add two parameters to pass lookup counts.
- Update all callers.
- (otl_jstf_validate): Add two parameters to pass GPOS and GSUB
- table offsets; use otl_gsubgpos_get_lookup_count to convert extract
- lookup counts.
- Fix typo.
- * src/otlayout/otljstf.h: Updated.
- Add copyright message.
-
- * src/otlayout/otlgpos.c (otl_gpos_subtable_validate): New function.
- (otl_gpos_validate): Use it.
- * src/otlayout/otlgpos.h: Updated.
-
-2004-08-13 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/otcommn.c: Use OTL_CHECK everywhere.
- (otl_coverage_validate): Initialize `p',
- s/count/num_glyphs/.
- s/start_cover/start_coverage/.
- (otl_coverage_get_index): Return OTL_Long, not OTL_Int.
- Remove unused variables.
- (otl_class_definition_validate): s/count/num_glyphs/.
- Remove unused variables.
- (otl_class_definition_get_value, otl_device_table_get_start,
- otl_device_table_get_end, otl_device_table_get_delta,
- otl_lookup_get_table, otl_lookup_list_get_count,
- otl_lookup_list_get_lookup, otl_lookup_list_get_table,
- otl_feature_get_lookups, otl_feature_list_get_count,
- otl_feature_list_get_feature, otl_lang_get_count,
- otl_lang_get_req_feature, otl_lang_get_features): Commented out
- temporarily until we really need it.
- (otl_lookup_validate): Removed.
- (otl_lookup_table_validate): Renamed to ...
- (otl_lookup_validate): This. Update callers.
- (otl_lookup_list_validate): Remove already commented out definition
- and move the other definition up.
- (otl_feature_validate): Add parameter to pass number of lookups.
- Update callers.
- Check lookup indices.
- (otl_feature_list_validate): Add parameter to pass lookup table.
- Update callers.
- (otl_lang_validate): Add parameter to pass number of features.
- Update callers.
- Handle req_feature and check feature indices.
- (otl_script_validate): Add parameter to pass number of features.
- Update callers.
- (otl_script_list_validate): Add parameter to pass feature table.
- Update callers.
-
- * src/otlayout/otcommn.h: s/LOCALDEF/LOCAL/.
- Comment out the same functions as in otcommn.c.
- (otl_script_list_get_script): Removed.
-
- * src/otlayout/otlgsub.c (otl_gsub_lookup1_apply): Change `index' to
- type OTL_Long.
- (otl_gsub_lookup2_apply, otl_gsub_lookup3_apply): Change `index' to
- type OTL_Long.
- Fix test.
- (otl_gsub_validate): Fix order of validation.
-
- * src/otlayout/otlgpos.c (otl_gpos_validate): Fix order of
- validation.
-
-2004-08-12 Werner Lemberg <wl@gnu.org>
-
- Make otlayout module compile (without actually working).
-
- * src/otlayout/*: s/OTL_Valid/OTL_Validator/.
- s/NULL/0/.
-
- * src/otlayout/otlayout.h: Fix various typos.
- (OTL_Bool): New typedef.
- (OTL_Int, OTL_Long, OTL_Int16, OTL_Int32): Use `signed' keyword.
- (OTL_Err_InvalidArgument): Removed.
- (OTL_Err_InvalidData, OTL_Err_InvalidSize): New enum values.
- (OTL_MAKE_TAG): Add missing parenthesis.
- (OTL_INVALID_DATA): Use OTL_Err_InvalidData.
- (OTL_INVALID_TOO_SHORT): Use OTL_Err_InvalidSize.
- (OTL_INVALID_FORMAT, OTL_INVALID_OFFSET): New macros.
-
- * src/otlayout/otlgpos.c: s/FT_/OTL_/.
- s/OTL_Short/OTL_Int16/.
- (otl_gpos_pairset_validate): Add return type.
- (otl_base_array_validate): Fix call to otl_anchor_validate.
- (otl_liga_array_validate): Fix call to otl_liga_attach_validate.
- (otl_gpos_lookup5_validate): Fix typos.
- (otl_gpos_lookup6_validate): Fix call to otl_mark2_array_validate.
- (otl_gpos_lookup7_validate): Comment out unfinished code.
- Fix typos.
-
- * src/otlayout/otlgsub.c: Add forward declaration for
- otl_gsub_validate_funcs.
- (otl_gsub_lookup1_apply, otl_gsub_lookup2_apply,
- otl_gsub_lookup3_apply): Fix call to otl_parser_check_property.
- s/otl_coverage_lookup/otl_coverage_get_index/.
- (otl_ligature_validate): Add missing variable declaration.
- (otl_sub_rule_validate): Fix typo.
- (otl_sub_class_rule_validate): Add missing variable declaration.
- Fix typo.
- (otl_gsub_lookup5_validate): Fix typo.
- (otl_gsub_lookup6_validate): Fix call to
- otl_chain_sub_class_set_validate.
- (otl_gsub_validate_funcs): Don't use `const'.
-
- * src/otlayout/otlcommn.c (otl_class_definition_get_value,
- otl_device_table_validate, otl_device_table_get_delta,
- otl_lookup_validate, otl_script_validate): Add missing
- variable declarations.
- (otl_lookup_list_validate): Comment out first definition.
- (otl_lookup_list_foreach, otl_feature_list_foreach): Comment out.
- (otl_feature_list_validate):
- s/otl_feature_table_validate/otl_feature_validate/.
- (otl_script_list_validate):
- s/otl_script_table_validate/otl_script_validate/.
-
- * src/otlayout/otlcommn.h: Comment out first declaration.
- (otl_lookup_list_foreach, otl_feature_list_foreach): Comment out.
-
- * src/otlayout/otlbase.c (otl_base_coord_validate): Fix call to
- otl_device_table_validate.
- (otl_base_script_validate): Add missing variable declarations.
- (otl_base_script_list_validate): Fix call to
- otl_base_script_validate.
- (otl_axis_table_validate): Fix calls to otl_base_tag_list_validate
- and otl_base_script_list_validate.
- (otl_base_validate): Fix calls to otl_axis_table_validate.
-
- * src/otlayout/otlgdef.c (otl_attach_list_validate): Fix call to
- otl_attach_point_validate.
- (otl_caret_value_validate): Add missing variable declaration.
- Fix call to otl_device_table_validate.
- (otl_ligature_glyph_validate): Fix call to otl_caret_value_validate.
- (otl_ligature_caret_list_validate): Fix call to
- otl_ligature_glyph_validate.
- (otl_gdef_validate): Fix calls to otl_class_definition_validate,
- otl_attach_list_validate, otl_ligature_caret_list_validate, and
- otl_class_definition_validate.
-
- * src/otlayout/otltable.h (otl_table_validate, otl_table_init,
- otl_table_set_script): Comment out.
-
- * src/otlayout/otlparse.h (OTL_ParserRec):
- s/OTL_Alternate/OTL_GSUB_Alternate/.
- (OTL_ParseError): Add OTL_Err_Parser_Memory and
- OTL_Err_Parser_Internal.
- (otl_parser_error): Fix typo.
- (otl_parser_check_property): Remove third argument.
-
- * src/otlayout/otlparse.c (otl_string_ensure):
- s/OTL_Parse_Err_Memory/OTL_Err_Parser_Memory/.
- (OTL_STRING_ENSURE, otl_parser_error, otl_parser_get_index,
- otl_parser_replace_1, otl_parser_replace_n): Fix typos.
- (OTL_PARSER_UNCOVERED): Removed.
- (otl_parser_check_property): Remove third argument.
-
- * src/otlayout/otljstf.c (otl_jstf_priority_validate): Add missing
- variable declaration.
-
- * src/otlayout/otlutils.h (OTL_MEM_REALLOC): Fix typo.
-
-2004-08-11 Danny <dannyboynow@yahoo.com>
-
- * src/base/ftstream.c (FT_Stream_Close): Don't reset stream->close
- to NULL. This allows custom close functions to delete the FT_STREAM
- object.
-
-2004-08-11 Werner Lemberg <wl@gnu.org>
-
- Add API to get information about SFNT tables.
-
- * include/freetype/internal/services/svsfnt.h
- (FT_SFNT_Table_Info_Func): New typedef.
- (SFNT_Table): Add it.
-
- * src/base/ftobjs (FT_Sfnt_Table_Info): New function.
-
- * include/freetype/tttables.h: Updated.
-
- * src/sfnt/sfdriver.c (sfnt_table_info): New function.
- (sfnt_service_sfnt_table): Add it.
-
- * docs/CHANGES: Updated.
-
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.
-
- * builds/unix/configure.ac (version_info): Set to 9:8:3.
- * builds/unix/configure: Updated.
-
- * builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.
-
- * builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
- s/2.1.9/2.1.10/.
-
- * docs/CHANGES, docs/VERSION.DLL: Updated.
-
-2004-08-11 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/base/ftrfork.c (FT_Raccess_Guess)
- [!FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK]: Remove compiler
- warnings.
-
-2004-08-06 Adam Piotrowski <st_intel@poczta.onet.pl>
-
- * src/pfr/pfrload.c (pfr_sort_kerning_pairs): Single-byte
- adjustments are unsigned, not signed.
-
-2004-08-05 David Turner <david@freetype.org>
-
- `Activate' gray-scale specifying hinting within the TrueType
- bytecode interpreter. This is an experimental feature which
- should probably be made optional.
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
- load_truetype_glyph): Move the code to set the pedantic_hinting flag
- to...
- (TT_Load_Glyph): Here.
- Set `grayscale' flag except for `FT_LOAD_TARGET_MONO'.
-
- * src/truetype/ttinterp.c (Ins_GETINFO): Return MS rasterizer
- version 1.7.
- Return rotation and stretching info only if glyph is rotated or
- stretched, respectively.
- Handle grayscale info.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): Add `grayscale'
- member.
-
-2004-08-02 George Williams <gww@silcom.com>
-
- * src/base/ftobjs.c (FT_Attach_File): Initialize `open.stream'.
-
-2004-08-01 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2004-08-01 George Williams <gww@silcom.com>
-
- FreeType now can read kerning values from PFM files.
-
- * src/type1/t1afm.c (T1_Done_AFM): Renamed to...
- (T1_Done_Metrics): This.
- Update all callers.
- (T1_Read_AFM): Make it static.
- Don't enter and leave a frame.
- (LITTLE_ENDIAN_USHORT, LITTLE_ENDIAN_UINT): New macros.
- (T1_Read_PFM): New function.
- (T1_Read_Metrics): New higher-level function to be used instead of
- T1_Read_AFM.
- Update all callers.
-
-2004-07-31 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfread (pcf_load_font), src/bdf/bdfdrivr.c
- (BDF_Face_Init), src/truetype/ttgxvar (TT_Get_MM_Var,
- tt_face_vary_cvt): Fix compiler warnings.
-
-2004-07-26 Søren Sandmann <sandmann@daimi.au.dk>
-
- * src/pcf/pcfread.c (pcf_interpret_style): Always allocate memory for
- face->style_name.
- * src/pcf/pcfdrivr.c (PCF_Face_Done): Free `style_name'.
-
-2004-07-26 Darren J Longhorn <darren.longhorn@redcom.co.uk>
-
- * include/freetype/config/ftconfig.h (FT_SIZEOF_LONG): Recognize
- five-byte `long' (which is avoided then).
-
-2004-07-25 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/pcf/pcfdrivr.c (PCF_Set_Pixel_Size): Compare heights, not
- ppem values.
- (PCF_Set_Point_Size): Don't call PCF_Set_Pixel_Size but provide own
- code to compare ppem values.
- * src/bdf/bdfdrivr.c (BDF_Set_Pixel_Size): Compare heights, not
- ppem values.
- (BDF_Set_Point_Size): Don't call BDF_Set_Pixel_Size but provide own
- code to compare ppem values.
-
-2004-07-25 Kornfeld Eliyahu Peter <peter@e-kadmon.net>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Handle
- TT_NAME_ID_PREFERRED_FAMILY and TT_NAME_ID_PREFERRED_SUBFAMILY.
-
-2004-07-24 Derek B. Noonburg <derekn@foolabs.com>
-
- * src/cff/cffload.c (cff_font_load): Always create inverse mapping.
- Even if the charstring count is the same as the CID count, it is
- still possible that the font uses a different CID -> GID mapping.
-
-2004-07-23 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttobjs.c (tt_face_init): Accept 0x00020000 format tag
- found in some Arphic fonts made for Chinese version of Windows 3.1.
-
-2004-07-17 David Turner <david@freetype.org>
-
- Fixed a dangling pointer bug in the cache code that happened in very
- rare cases, i.e., when a new family object was destroyed by an
- out-of-memory condition during a glyph node initialization. The
- function FTC_Cache_Lookup would flush the cache and restart the
- lookup with a bad pointer.
-
- * include/freetype/cache/ftcglyph.h (FTC_FAMILY_TREE): New macro.
- (FTC_GCACHE_LOOKUP_CMP): Use it.
- Handle reference count in `num_nodes' correctly.
-
- * src/cache/ftcglyph.c (FTC_GNode_UnselectFamily): Use
- FTC_FAMILY_FREE.
- (FTC_GCache_Lookup): Handle reference count in `num_nodes' correctly.
-
- * src/cache/ftcmanag.c (FTC_Manager_FlushN): Fixed a cache flushing
- bug.
-
- * src/truetype/ttinterp.c (Normalize): Fixed a bug that caused
- long and unnecessary delays while normalizing huge vectors.
-
-2004-07-15 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
- * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix compiler
- warning.
-
-2004-07-15 David Turner <david@freetype.org>
-
- * src/base/ftstroke.c (FT_Stroker_ParseOutline): Single points
- are not stroked, preventing a bug with pala.ttf and other
- fonts.
-
- * include/freetype/ftstroke.h: Updating documentation comments.
-
-2004-07-13 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftstroke.c (ft_stroke_border_reverse): Removed. Unused.
-
-2004-07-12 David Turner <david@freetype.org>
-
- * src/base/ftstroke.c (ft_stroke_border_close): Add second parameter
- to indicate reversion of points.
- Update all callers.
- (ft_stroke_border_reverse): Fix initialization of `point1' and
- `tag1'.
-
- * src/cache/ftcsbits.c (ftc_snode_load): Fixing advance computation
- for transformed glyphs.
-
-2004-07-11 David Turner <david@freetype.org>
-
- Fix bugs that prevented the stroker to correctly generate stroked
- paths from closed paths, i.e., nearly all glyphs in vectorial fonts.
-
- The code is still _very_ buggy though; treat with special care.
-
- * src/base/ftstroke.c (FT_STROKE_TAG_BEGIN_END): New macro.
- (ft_stroke_border_reverse): New function.
- (ft_stroker_inside): Remove local variable `sigma'; use different
- threshold.
- (ft_stroker_add_reverse_left): Switch begin/end tags if necessary.
- (FT_Stroker_EndSubPath): Call ft_stroker_inside and
- ft_stroke_border_reverse.
-
-2004-06-26 Peter Kovar <peter.kovar@r3.roburnet.sk>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fix typo.
-
-2004-06-25 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1afm.c (afm_atoindex): Fix boundary test. Reported
- by Dirck Blaskey.
-
-2004-06-24 David Turner <david@freetype.org>
-
-
- * Version 2.1.9 released.
- =========================
-
-
- * src/truetype/ttgload.c, src/truetype/ttxgvar.c: Removing
- compiler warnings.
-
-2004-06-23 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftmemory.h [FT_DEBUG_MEMORY]: Declare
- FT_QAlloc_Debug and FT_QRealloc_Debug.
-
- * src/base/ftutil.c (FT_QAlloc): Fix error and debug messages.
- (FT_QRealloc): Call FT_QAlloc if original pointer is NULL.
- Fix error message.
-
-2004-06-23 David Turner <david@freetype.org>
-
- * include/freetype/internal/ftmemory.h, src/base/ftutil.c
- (FT_QAlloc, FT_QRealloc), src/base/ftdbgmem.c (FT_QAlloc_Debug,
- FT_QRealloc_Debug): New functions that perform allocation without
- zero-ing out the corresponding blocks.
-
- * include/freetype/internal/ftmemory.h (FT_MEM_QALLOC,
- FT_MEM_QREALLOC, FT_MEM_QNEW, FT_MEM_QNEW_ARRAY,
- FT_MEM_QRENEW_ARRAY, FT_QALLOC, FT_QREALLOC, FT_QNEW, FT_QNEW_ARRAY,
- FT_QRENEW_ARRAY): New macros.
-
- * src/base/ftstream.c (FT_Stream_EnterFrame): Use FT_QALLOC.
- * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Use FT_QNEW_ARRAY.
- * src/sfnt/sfobjs.c (tt_face_get_name): Use FT_QNEW_ARRAY.
-
- * src/sfnt/ttload.c (tt_face_load_directory, tt_face_load_metrics,
- tt_face_load_gasp): Use FT_QNEW_ARRAY.
- (tt_face_load_kern): Use FT_QNEW_ARRAY.
- Small optimization in the kerning table verifier; this speeds up
- TrueType face opening by about 7%.
- (tt_face_load_hdmx): Use FT_QNEW_ARRAY and FT_QALLOC.
-
- * include/freetype/config/ftmodule.h: Changed the order of modules,
- putting TrueType and Type 1 first. This dramatically improves the
- performance of face open/close operations. For example, putting the
- TrueType driver first in the list results in a 5x speedup when
- opening `Vera.ttf'.
-
- The very problem is that both the PCF and BDF drivers do a lot more
- than necessary to detect that they cannot handle a font file.
-
-2004-06-22 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfread.c (pcf_read_TOC, pcf_get_properties,
- pcf_get_metrics, pcf_get_bitmaps, pcf_get_encodings): Improve
- debugging messages.
-
- * src/pcf/pcfdrivr.c (FT_COMPONENT): Move up.
- (PCF_Face_Init): Simplify code.
-
- * src/bdf/bdfdrivr.h (BDF_FaceRec): New element `default_glyph'.
-
- * src/bdf/bdflib.c (_bdf_add_property, _bdf_parse_start),
- src/bdf/bdf.h (bdf_font_t): s/default_glyph/default_char/.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Fix number of glyphs.
- Set `default_glyph'.
- (BDF_Glyph_Load): Use `default_glyph' for undefined glyph.
-
- * docs/CHANGES: Updated.
-
-2004-06-21 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2004-06-21 David Turner <david@freetype.org>
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
- load_truetype_glyph): Don't access (unrounded)
- `TT_Size.root.metrics' but (rounded) `TT_Size.metrics'. This fixes
- a scaling bug that caused incorrect rendering when the bytecode
- interpreter was enabled.
-
-2004-06-14 Huw D M Davies <h.davies1@physics.ox.ac.uk>
-
- * src/winfonts/winfnt.c (FNT_Face_Init): Set x_ppem and y_ppem
- based on pixel_width and pixel_height.
- (FNT_Size_Set_Pixels): Updated.
-
-2004-06-14 Werner Lemberg <wl@gnu.org>
-
- * src/lzw/zopen.c: Comment out inclusion of signal.h and unistd.h.
- Reported by Hyvärinen Jyrki Juhani.
-
-2004-06-11 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2004-06-10 David Turner <david@freetype.org>
-
- * src/base/ftobject.c, src/base/fthash.c, src/base/ftexcept.c,
- src/base/ftsysio.c, src/base/ftsysmem.c, src/base/ftlist.c: Removed.
- Obsolete.
-
- * src/raster/ftraster.c (Alignment, PAlignment): New union to fix
- problems with 64bit systems.
- (AlignProfileSize): Use it.
-
-2004-06-08 David Turner <david@freetype.org>
-
- * include/freetype/freetype.h (FT_Glyph_Metrics): Move `lsb_delta'
- and `rsb_delta' elements to...
- (FT_GlyphSlotRec): Here to retain binary compatibility with older
- FreeType versions.
- Update all users.
-
- * src/sfnt/sfobjs.c (tt_face_get_name): Remove compiler warning.
-
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Add missing initialization
- of slot->metrics.width and slot->metrics.height when loading a
- Windows FNT glyph. Thanks to Huw Davies.
-
- * include/freetype/cache/ftcmru.h (FTC_MruNode_CompareFunc): Change
- return type to FT_Bool.
-
- * src/cache/ftcbasic.c (ftc_basic_family_compare): Change return
- type to FT_Bool.
-
- * src/cache/ftccache.c (FTC_Cache_Init, ftc_cache_init): Make
- the former call the latter, not vice versa.
- (FTC_Cache_Done, ftc_cache_done): Ditto.
-
- * src/cache/ftcglyph.c (FTC_GNode_Compare, ftc_gnode_compare): Make
- the former call the latter, not vice versa.
- (FTC_GCache_Init, ftc_gcache_init): Ditto.
- (FTC_GCache_Done, ftc_gcache_done): Ditto.
-
- * src/cache/ftcimage.c (FTC_INode_Free, ftc_inode_free): Make the
- former call the latter, not vice versa.
- (FTC_INode_Weight, ftc_inode_weight): Ditto.
-
- * src/cache/ftcmanag.c (ftc_size_node_compare,
- ftc_size_node_compare_faceid, ftc_face_node_compare): Change return
- type to FT_Bool.
-
- * src/cache/ftcsbits.c (FTC_SNode_Free, ftc_snode_free): Make the
- former call the latter, not vice versa.
- (FTC_SNode_Weight, ftc_snode_weight): Ditto.
- (FTC_SNode_Compare, ftc_snode_compare): Ditto.
-
- * src/cache/ftcsbits.c: Fix some bugs and inefficiencies in the cache
- sub-system.
-
-2004-06-05 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afloader.c (af_loader_load_g): Set `lsb_delta' and
- `rsb_delta' in slot->metrics and tune side bearings slightly.
-
-2004-06-04 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2004-06-04 David Chester <davidchester@qmx.net>
-
- Improve inter-letter spacing for autohinted glyphs.
-
- * include/freetype/freetype.h (FT_Glyph_Metrics): Add elements
- `lsb_delta' and `rsb_delta'.
-
- * src/autohint/ahhint.c (ah_hinter_load): Set `lsb_delta' and
- `rsb_delta' in slot->metrics and tune side bearings slightly.
-
-2004-06-04 David Turner <david@freetype.org>
-
- * src/autofit/*: Important fixes to the auto-fitter. The output
- now seems to be 100% equivalent to the auto-hinter, while being
- about 2% faster (which proves that script-specific algorithm
- selection isn't a performance problem).
-
- To test it, change `autohint' to `autofit' in
- <freetype/config/ftmodule.h> and recompile.
-
- A few more testing is needed before making this the official
- auto-hinting module.
-
-2004-06-02 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (compute_glyph_metrics): Fix compiler
- warnings.
-
-2004-06-01 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (tt_face_get_name): Make sure that an English
- name record for the Apple platform is preferred to a non-English
- entry for the Microsoft platform. Problem reported by HANDA
- Ken'ichi.
-
-2004-05-19 George Williams <gww@silcom.com>
-
- * src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): New
- auxiliary functions.
- (T1_Get_MM_Var): Provide axis tags.
- Use mm_axis_unmap and mm_weights_unmap to provide default values
- for design and normalized axis coordinates.
-
- * include/freetype/t1tables.h (PS_DesignMapRec): Change type of
- `design_points' to FT_Long.
- Update all users.
-
-2004-05-17 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftbbox.c (BBox_Conic_Check): Fix boundary cases.
- Reported by Mikey Anbary <manbary@vizrt.com>.
-
-2004-05-15 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_done_face): Free face->postscript_name.
-
-2004-05-15 George Williams <gww@silcom.com>
-
- * src/sfnt/ttload.c (tt_face_load_max_profile): Always set
- face->root.num_glyphs.
-
-2004-05-14 Masatake YAMATO <jet@gyve.org>
- George Williams <gww@silcom.com>
-
- * src/sfnt/ttload.c (sfnt_dir_check): Handle `bhed' properly.
-
-2004-05-14 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftcbasic.c (ftc_basic_family_compare,
- ftc_basic_family_init, ftc_basic_family_get_count,
- ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
- ftc_basic_gnode_compare_faceid): Adjust parameters and return types
- to prototypes given in header files from include/freetype/cache.
- Use casts to proper types locally.
- (ftc_basic_image_family_class, ftc_basic_image_cache_class,
- ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class): Remove
- casts.
-
- * src/cache/ftccback.h: Adjust parameters and return types to
- prototypes given in header files from include/freetype/cache.
-
- * src/cache/ftcimage.c (ftc_inode_free, ftc_inode_new,
- ftc_inode_weight): Adjust parameters and return types to prototypes
- given in header files from include/freetype/cache. Use casts to
- proper types locally.
-
- * src/cache/ftcsbits.c (ftc_snode_free, ftc_snode_new,
- ftc_snode_weight, ftc_snode_compare): Adjust parameters and return
- types to prototypes given in header files from
- include/freetype/cache. Use casts to proper types locally.
-
- * src/cache/ftccmap.c (ftc_cmap_node_free, ftc_cmap_node_new,
- ftc_cmap_node_weight, ftc_cmap_node_compare,
- ftc_cmap_node_remove_faceid): Adjust parameters and return types to
- prototypes given in header files from include/freetype/cache. Use
- casts to proper types locally.
- (ftc_cmap_cache_class): Remove casts.
-
- * src/cache/ftcglyph.c (ftc_gnode_compare, ftc_gcache_init,
- ftc_gcache_done): Adjust parameters and return types to prototypes
- given in header files from include/freetype/cache. Use casts to
- proper types locally.
-
- * src/cache/ftcmanag.c (ftc_size_node_done, ftc_size_node_compare,
- ftc_size_node_init, ftc_size_node_reset,
- ftc_size_node_compare_faceid, ftc_face_node_init,
- ftc_face_node_done, ftc_face_node_compare: Adjust parameters and
- return types to prototypes given in header files from
- include/freetype/cache. Use casts to proper types locally.
-
- (ftc_size_list_class, ftc_face_list_class): Remove casts.
-
-2004-05-13 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahmodule.c (ft_autohinter_init, ft_autohinter_done):
- Use FT_Module as parameter and do a cast to FT_AutoHinter locally.
- (autohint_module_class): Remove casts.
-
- * src/base/ftglyph.c (ft_bitmap_glyph_init, ft_bitmap_glyph_copy,
- ft_bitmap_glyph_done, ft_bitmap_glyph_bbox, ft_outline_glyph_init,
- ft_outline_glyph_done, ft_outline_glyph_copy,
- ft_outline_glyph_transform, ft_outline_glyph_bbox,
- ft_outline_glyph_prepare): Use FT_Glyph as parameter and do a cast
- to FT_XXXGlyph locally.
- Use FT_CALLBACK_DEF throughout.
- (ft_bitmap_glyph_class, ft_outline_glyph_class): Remove casts.
-
- * src/bdf/bdfdrivr.c (bdf_cmap_init, bdf_cmap_done,
- bdf_cmap_char_index, bdf_cmap_char_next): Use FT_CMap as parameter
- and do a cast to BDF_CMap locally.
- (bdf_cmap_class): Remove casts.
-
-2004-05-12 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.h (CFF_Builder): Remove `error'.
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Replace
- `Memory_Error' with `Fail' and update all users.
-
-2004-05-11 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/psaux.h (T1_ParseState): New
- enumeration.
- (T1_BuilderRec): Replace `path_begun' with `parse_state'.
- Remove `error'.
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Replace
- `Memory_Error' with `Fail' and update all users.
- Don't use `builder->error'.
- Replace `path_begun' with `parse_state' and check parsing states.
-
- * src/psaux/psobjs.c (t1_builder_init, t1_builder_start_point):
- Replace `path_begun' with `parse_state' and check parsing states.
-
-2004-05-10 George Williams <gww@silcom.com>
-
- * src/truetype/ttxgvar.c (ft_var_load_avar): Do free arrays in case
- of error -- `avar' is optional so we can't rely on tt_done_blend
- being called automatically.
-
-2004-05-09 George Williams <gww@silcom.com>
-
- * src/truetype/ttxgvar.c (ft_var_load_avar, ft_var_load_gvar): Fix
- error handling.
-
-2004-05-07 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrobjs.c, src/pfr/pfrobjs.h (pfr_face_init,
- pfr_face_done, pfr_face_get_kerning, pfr_slot_init, pfr_slot_done,
- pfr_slot_load): Don't use PFR_XXX but FT_XXX arguments which are
- typecast to the proper PFR_XXX types within the function.
- Update code accordingly.
-
- * src/pfr/pfrdrivr.c (pfr_get_kerning, pfr_get_advance,
- pfr_get_metrics, pfr_get_service): Don't use PFR_XXX but FT_XXX
- arguments which are typecast to the proper PFR_XXX types within the
- function.
- Update code accordingly.
- Use FT_CALLBACK_DEF throughout.
- (pfr_metrics_service_rec, pfr_driver_class): Remove casts.
-
-2004-05-06 Masatake YAMATO <jet@gyve.org>
-
- * src/truetype/ttgxvar.c (ft_var_load_gvar): Use FT_FACE_STREAM.
- (*): Rename local variable OffsetToData to offsetToData.
-
-2004-05-06 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_size_done, cff_size_init, cff_size_reset,
- cff_slot_done, cff_slot_init, cff_face_init, cff_face_done): Access
- root fields directly.
- * src/cff/cffdrivr.c (Load_Glyph): Access root fields directly.
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Save current
- frame before calling TT_Vary_Get_Glyph_Deltas.
-
- * src/pcf/pcfdrivr.c (PCF_CMapRec): Rename `cmap' to `root' for
- consistency.
- (pcf_cmap_init, pcf_cmap_done, pcf_cmap_char_index,
- pcf_cmap_char_next): Don't use PCF_XXX but FT_XXX arguments which
- are typecast to the proper PCF_XXX types within the function.
- Update code accordingly.
- (pcf_cmap_class): Remove casts.
- (PCF_Face_Done, PCF_Face_Init, PCF_Set_Pixel_Size): Don't use
- PCF_XXX but FT_XXX arguments which are typecast to the proper
- PCF_XXX types within the function.
- Update code accordingly.
- Use FT_CALLBACK_DEF throughout.
- (PCF_Set_Point_Size): New wrapper function.
- (PCF_Glyph_Load, pcf_driver_requester): Use FT_CALLBACK_DEF.
- (pcf_driver_class): Remove casts.
-
-2004-05-04 Steve Hartwell <shspamsink@comcast.net>
-
- * src/truetype/ttobjs.c (tt_driver_done): Fix typo.
-
-2004-05-04 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdfdrivr.c (BDF_Face_Done, BDF_Face_Init,
- BDF_Set_Pixel_Size): Don't use BDF_XXX but FT_XXX arguments which
- are typecast to the proper BDF_XXX types within the function.
- Update code accordingly.
- Use FT_CALLBACK_DEF throughout.
- (BDF_Set_Point_Size): New wrapper function.
- (bdf_driver_class): Remove casts.
-
- * src/cff/cffdrivr.c (Get_Kerning, Load_Glyph, cff_get_interface):
- Don't use CFF_XXX but FT_XXX arguments which are typecast to the
- proper CFF_XXX types within the function.
- Update code accordingly.
- Use FT_CALLBACK_DEF throughout.
- (cff_driver_class): Remove casts.
-
- * src/cff/cffobjs.h, src/cff/cffobjs.c (cff_size_done,
- cff_size_init, cff_size_reset, cff_slot_done, cff_slot_init,
- cff_face_init, cff_face_done, cff_driver_init, cff_driver_done):
- Don't use CFF_XXX but FT_XXX arguments which are typecast to the
- proper CFF_XXX types within the function.
- Update code accordingly.
- (cff_point_size_reset): New wrapper function.
-
- * src/cid/cidobjs.h, src/cid/cidobjs.c (cid_slot_done,
- cid_slot_init, cid_size_done, cid_size_init, cid_size_reset,
- cid_face_done, cid_face_init, cid_driver_init, cid_driver_done):
- Don't use CID_XXX but FT_XXX arguments which are typecast to the
- proper CID_XXX types within the function.
- Update code accordingly.
- (cid_point_size_reset): New wrapper function.
-
- * src/cid/cidgload.c, src/cid/cidgload.h (cid_slot_load_glyph):
- Don't use CID_XXX but FT_XXX arguments which are typecast to the
- proper CID_XXX types within the function.
- Update code accordingly.
-
- * src/cid/cidriver.c (cid_get_interface):
- Don't use CID_XXX but FT_XXX arguments which are typecast to the
- proper CID_XXX types within the function.
- Update code accordingly.
- Use FT_CALLBACK_DEF.
- (t1cid_driver_class): Remove casts.
-
- * src/truetype/ttdriver.c (tt_get_interface): Use FT_CALLBACK_DEF.
- * src/truetype/ttgxvar.c (ft_var_load_avar): Don't free non-local
- variables (this is done later).
- (ft_var_load_avar): Fix call to FT_FRAME_ENTER.
- (TT_Get_MM_Var): Fix size for `fvar_fields'.
- (TT_Vary_Get_Glyph_Deltas): Handle deallocation of local variables
- correctly.
-
- * src/base/ftdbgmem.c (ft_mem_debug_realloc): Don't abort if
- current size is zero.
-
-2004-05-03 Steve Hartwell <shspamsink@comcast.net>
-
- * src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
- tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
- tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
- typecast to the proper TT_XXX types within the function.
- Update code accordingly.
-
- * src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
- Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
- FT_XXX arguments which are typecast to the proper TT_XXX types
- within the function.
- Update code accordingly.
- (tt_driver_class): Remove casts.
-
-2004-05-02 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (tt_face_free_names): Check that `table->names'
- is not NULL. Reported by Gordon Childs <gchilds@quickcut.com.au>.
-
-2004-04-29 Werner Lemberg <wl@gnu.org>
-
- * docs/formats.txt: Add more information on PFR format.
-
-2004-04-28 Werner Lemberg <wl@gnu.org>
-
- * docs/formats.txt: New file.
- * docs/CHANGES: Updated.
-
-2004-04-28 Masatake YAMATO <jet@gyve.org>
-
- * include/freetype/internal/tttypes.h (GX_BlendRec_)
- [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Fix a typo.
-
- * src/truetype/ttgxvar.h (GX_BlendRec_): Fix a typo.
-
-2004-04-27 Masatake YAMATO <jet@gyve.org>
-
- * src/truetype/ttgxvar.h: Use FT_LOCAL instead of FT_LOCAL_DEF
- for function declarations.
-
-2004-04-25 George Williams <gww@silcom.com>
-
- * src/truetype/ttgxvar.c (ft_var_apply_tuple): Fix typo.
-
-2004-04-25 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/Jamfile, docs/CHANGES: Updated.
-
-2004-04-24 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfdrivr.c: Revert change from 2004-04-17.
- * src/pcf/pcfutil.c: Use FT_LOCAL_DEF.
- * src/pcf/pcfutil.h: Include FT_CONFIG_CONFIG_H.
- Use FT_BEGIN_HEADER and FT_END_HEADER.
- Use FT_LOCAL.
-
-2004-04-24 George Williams <gww@silcom.com>
-
- Add support for Apple's distortable font technology (in GX fonts).
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (TT_CONFIG_OPTION_GX_VAR_SUPPORT): New macro.
-
- * include/freetype/ftmm.h (FT_Var_Axis, FT_Var_Named_Style,
- FT_MM_Var): New structures.
- (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
- FT_Set_Var_Blend_Coordinates): New function declarations.
-
- * include/freetype/internal/services/svmm.h (FT_Get_MM_Var_Func,
- FT_Set_Var_Design_Func): New typedefs.
- Update MultiMasters service.
-
- * include/freetype/internal/tttypes.h
- [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include FT_MULTIPLE_MASTERS_H.
- (GX_Blend) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New typedef.
- (TT_Face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New members `doblend'
- and `blend'.
-
- * include/freetype/tttags.h (TTAG_avar, TTAG_cvar, TTAG_gvar): New
- macros.
-
- * include/freetype/internal/fttrace.h: Add `ttgxvar'.
-
- * src/base/ftmm.c (FT_Get_MM_Var, FT_Set_Var_Design_Coordinates,
- FT_Set_Var_Blend_Coordinates): New functions.
-
- * src/sfnt/sfobjs.c (sfnt_load_face)
- [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Set FT_FACE_FLAG_MULTIPLE_MASTERS
- flag for GX var fonts.
-
- * src/truetype/ttgxvar.c, src/truetype/ttgxvar.h: New files.
-
- * src/truetype/truetype.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
- ttgxvar.c.
-
- * src/truetype/ttdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
- FT_MULTIPLE_MASTERS_H, FT_SERVICE_MULTIPLE_MASTERS_H, and ttgxvar.h.
- (tt_service_gx_multi_masters) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]:
- New service.
- (tt_services) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated.
-
- * src/truetype/ttgload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
- ttgxvar.h.
- (TT_Process_Simple_Glyph, load_truetype_glyph)
- [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Support GX var fonts.
-
- * src/truetype/ttobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
- ttgxvar.h.
- (tt_done_face) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
- tt_done_blend.
-
- * src/truetype/ttpload.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
- ttgxvar.h.
- (tt_face_load_cvt) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Call
- tt_face_vary_cvt.
-
- * src/truetype/rules.mk (TT_DRV_SRC): Add ttgxvar.c.
-
- * src/type1/t1driver.c (t1_service_multi_masters): Add T1_Get_MM_Var
- and T1_Set_Var_Design.
-
- * src/type1/t1load.c (FT_INT_TO_FIXED, FT_FIXED_TO_INT): New macros.
- (T1_Get_MM_Var, T1_Set_Var_Design): New functions.
-
- * src/type1/t1load.h (T1_Get_MM_Var, T1_Set_Var_Design): New
- function declarations.
-
-2004-04-23 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftcache.h (FT_Get_CharMap_Index): Rename
- declaration and move to...
- * include/freetype/freetype.h (FT_Get_Charmap_Index): Here.
- (FREETYPE_PATCH): Set to 9.
-
- * src/base/ftobjs.c (FT_Get_Charmap_Index): New function.
-
- * builds/unix/configure.ac (version_info): Set to 9:7:3.
- * builds/unix/configure: Updated.
-
- * builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj: s/218/219/.
-
- * builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
- s/2.1.8/2.1.9/.
-
- * docs/CHANGES, docs/VERSION.DLL: Updated.
-
-2004-04-21 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffparse.c (cff_parser_run), src/psaux/psobjs.c
- (ps_parser_load_field): Use FT_CHAR_BIT.
-
-2004-04-21 David Turner <david@freetype.org>
-
-
- * Version 2.1.8 released.
- =========================
-
-
- * src/cff/cffobjs.c (cff_face_init): Fix a small memory leak.
-
- * src/autofit/afloader.c (af_loader_load_g), src/autofit/afmodule.c
- (af_autofitter_load_glyph), src/base/ftdebug.c (FT_Trace_Get_Name):
- Remove compiler warnings.
-
- * src/autofit/aftypes.h: Undefine AF_DEBUG.
-
- * src/lzw/zopen.c (rmask), src/pcf/pcfdrivr.c (pcf_service_bdf,
- pcf_services), src/pcf/pcfread.c (tableNames), src/psaux/psobjs.c
- (ft_char_table), src/type42/t42drivr.c (t42_service_glyph_dict,
- t42_service_ps_font_name): Decorate data arrays with `const' to
- avoid populating the `.data' segment.
-
- * src/lzw/Jamfile: New file.
-
-2004-04-20 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/psobjs.c (T1Radix): Renamed to...
- (ps_radix): This.
- Update current cursor position.
-
- * docs/CHANGES: Updated.
-
-2004-04-18 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c, src/truetype/ttgload.h (TT_Load_Glyph),
- src/ttdriver.c (Load_Glyph): Change type of `glyph_index' to
- FT_UInt. From Lex Warners.
-
-2004-04-17 Chisato Yamauchi <cyamauch@a.phys.nagoya-u.ac.jp>
-
- * src/sfnt/ttload.c (tt_face_load_sfnt_header): Really fix change
- from 2004-03-19.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Use `ft_strlen'.
-
- * src/pcf/pcfutil.c, src/pcf/pcfutil.h: Decorate functions with
- `static'.
- Remove unused function `RepadBitmap'.
- * src/pcf/pcfdrivr.c: Don't include pcfutil.h.
-
-2004-04-16 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype-config.in (usage): Fix and improve usage
- information.
-
-2004-04-15 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ftconfig.in, builds/vms/ftconfig.h: Define
- FT_CHAR_BIT.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Don't apply autohinting if
- glyph is vertically distorted or mirrored.
-
- * src/cff/cffgload.c (cff_slot_load): Handle zero `size' properly
- for embedded bitmaps.
-
- * docs/CHANGES: Updated.
-
-2004-04-15 bytesoftware <bytesoftware@btinternet.com>
-
- * include/freetype/config/ftconfig.h, src/base/ftstream.c
- (FT_Stream_ReadFields): More fixes using FT_CHAR_BIT.
-
-2004-04-14 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftconfig.h (FT_CHAR_BIT): New macro.
-
-2004-04-14 Alex Strelnikov <ptktyrf@mail.ru>
-
- * src/cache/ftcsbits.c (ftc_snode_load): Initialize `*asize' in case
- of error.
-
-2004-04-14 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftmac.c [__GNUC__]: Define OS_INLINE.
- * builds/unix/configure.ac: Don't try to remove `-ansi' compilation
- switch on the Mac.
-
- * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
- --copy' from libtool 1.5.6.
- * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
- automake 1.8a.
- * builds/unix/configure: Regenerated with autoconf 2.59a.
-
-2004-04-13 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftconfig.h: Use CHAR_BIT to define
- size of FT_SIZEOF_xxx.
-
-2004-04-12 Chisato Yamauchi <cyamauch@a.phys.nagoya-u.ac.jp>
-
- * include/freetype/internal/sfnt.h (TT_Find_SBit_Image_Func,
- TT_Load_SBit_Metrics_Func): New typedefs.
- (SFNT_Interface): Add find_sbit_image and load_sbit_metrics.
-
- * src/sfnt/sfdriver.c (sfnt_interface): Updated.
- * src/sfnt/ttsbit.h (tt_find_sbit_image, tt_load_sbit_metrics): New
- declarations.
- * src/sfnt/ttsbit.c (find_sbit_image): Renamed to...
- (tt_find_sbit_image): This.
- Updated all callers.
- (load_sbit_metrics): Renamed to...
- (tt_load_sbit_metrics): This.
- Updated all callers.
-
-2004-04-12 Werner Lemberg <wl@gnu.org>
-
- * configure: Accept makepp also.
-
- * builds/unix/detect.mk: Use proper path to unix-def.mk.
- * builds/unix/unix-def.in (BUILD_DIR, PLATFORM): Remove.
- * builds/unix/unix.mk (BUILD_DIR, PLATFORM): Define.
- Use BUILD_DIR.
-
- * docs/INSTALL, docs/INSTALL.GNU, docs/INSTALL.UNX: Update
- documentation on makepp.
-
-2004-04-11 Werner Lemberg <wl@gnu.org>
-
- * src/lzw/zopen.c: Don't include sys/param.h and sys/stat.h.
-
-2004-04-10 Werner Lemberg <wl@gnu.org>
-
- * src/lzw/ftlzw.c: Include zopen.h dependent on
- FT_CONFIG_OPTION_USE_LZW.
-
- * src/base/ftdebug.c: s/index/idx/ to avoid compiler warnings.
-
-2004-04-02 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
- --copy' from libtool 1.5.2.
- * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
- automake 1.8a.
- * builds/unix/configure: Regenerated with autoconf 2.59a.
-
-2004-04-01 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ft-munmap.m4 (FT_MUNMAP_PARAM): Fix arguments of
- AC_COMPILE_IFELSE.
- * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
- automake 1.8a.
- * builds/unix/configure: Regenerated with autoconf 2.59a.
- * builds/unix/config.guess, builds/unix/config.sub: Updated from
- `config' CVS module at subversions.gnu.org.
- * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
- `texinfo' CVS module at subversions.gnu.org.
- * builds/freetype.mk (refdoc): Updated.
-
-2004-03-31 Werner Lemberg <wl@gnu.org>
-
- Handle broken FNT files which don't have a trailing NULL byte
- in the face name string.
-
- * src/winfonts/winfnt.h (FNT_FontRec): New member `family_name'.
- * src/winfonts/winfnt.c (fnt_font_done): Free font->family_name.
- (FNT_Face_Init): Append a final zero byte to the font face name.
-
-2004-03-30 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (tt_face_load_sfnt_header): Fix change from
- 2004-03-19.
-
-2004-03-27 Werner Lemberg <wl@gnu.org>
-
- * src/base/descrip.mms (OBJS): Add ftbbox.obj.
-
-2004-03-26 George Williams <gww@silcom.com>
-
- Add vertical phantom points.
-
- * include/freetype/internal/tttypes.h (TT_LoaderRec): Add
- `top_bearing', `vadvance', `pp3', and `pp4'.
-
- * src/autofit/afloader.c (af_loader_load_g): Handle two more points.
-
- * src/autohint/ahhint.c (ah_hinter_load): Handle two more points.
- * src/truetype/ttgload.c (Get_VMetrics): New function.
- (TT_Load_Simple_Glyph, TT_Process_Simple_Glyph): Handle two more
- points.
- (load_truetype_glyph): Use Get_VMetrics.
- Handle two more points.
- (compute_glyph_metrics): Thanks to vertical phantom points we now
- can always compute `advance_height' and `top_bearing'.
- * src/truetype/ttobjs.h (TT_SubglyphRec): Add vertical phantom
- points.
-
-
- * src/autohint/ahglyph.c (ah_outline_load): Fix allocation of
- `news'.
-
-2004-03-21 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Fix left side bearing.
-
-2004-03-20 Steve Hartwell <shspamsink@comcast.net>
-
- * src/cache/ftcmru.c (FTC_MruList_RemoveSelection): Handle a NULL
- value for `selection' as `select all'.
-
-2004-03-19 Steve Hartwell <shspamsink@comcast.net>
-
- * src/sfnt/ttload.c (tt_face_load_sfnt_header): Reject face_index
- values > 0 if loading non-TTC fonts.
-
- * src/base/ftmac.c (open_face_from_buffer): Set positive face_index
- to zero before calling FT_Open_Face.
-
- * docs/CHANGES: Updated.
-
-2004-03-04 Werner Lemberg <wl@gnu.org>
-
- * Jamfile, vms_make.com, builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype/vcproj, include/freetype/ftmoderr.h:
- Add LZW module.
-
- * Jamfile.in: Removed.
-
- * docs/CHANGES: Updated.
-
- * include/freetype/internal/ftobjs.h: s/MIN/FT_MIN/, s/MAX/FT_MAX/,
- s/ABS/FT_ABS/. Updated all callers.
-
- * src/type1/t1load.c (parse_dict), src/pcf/pcfdrivr.c
- (PCF_Face_Init): Use FT_ERROR_BASE.
-
-2004-03-04 Albert Chin <china@thewrittenword.com>
-
- Add support for PCF fonts compressed with LZW (extension .pcf.Z,
- created with `compress').
-
- * include/freetype/config/ftoption.h, devel/ftoption.h
- (FT_CONFIG_OPTION_USE_LZW): New macro.
-
- * include/freetype/ftlzw.h: New file.
- * include/freetype/config/ftheader.h (FT_LZW_H): New macro for
- ftlzw.h.
-
- * src/lzw/*: New files.
-
- * src/pcf/pcfdrivr.c: Include FT_LZW_H.
- (PCF_Face_Init): Try LZW also.
-
- * src/gzip/ftgzip.c: s/0/Gzip_Err_Ok/ where appropriate.
- Beautify.
-
-2004-03-03 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshalgo.c (psh_hint_table_init): Simplify code.
-
-2004-03-02 Werner Lemberg <wl@gnu.org>
-
- Add embedded bitmap support to CFF driver.
-
- * src/cff/cffobjs.h (CFF_SizeRec): New structure.
-
- * src/cff/cffgload.c (cff_builder_init): Updated.
- (cff_slot_load): Updated.
- [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Load sbit.
-
- * src/cff/cffobjs.c (sbit_size_reset)
- [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: New function.
- (cff_size_get_globals_funcs, cff_size_done, cff_size_init): Updated.
- (cff_size_reset): Updated.
- [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Call sbit_size_reset.
-
- * src/cff/cffdrivr.c (Load_Glyph): Updated.
- (cff_driver_class): Use CFF_SizeRec.
-
- * docs/CHANGES: Updated.
-
-2004-03-01 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshglob.c (psh_globals_scale_widths): Don't use
- FT_RoundFix but FT_PIX_ROUND.
- (psh_blues_snap_stem): Don't use blue_shift but blue_threshold.
-
- * src/pshinter/pshalgo.c (PSH_STRONG_THRESHOLD_MAXIMUM): New macro.
- (psh_glyph_find_strong_points): Use PSH_STRONG_THRESHOLD_MAXIMUM.
- (psh_glyph_find_blue_points): New function. Needed for fonts like
- p052003l.pfb (URW Palladio L Roman) which have flex curves at the
- base line within blue zones, but the flex curves aren't covered by
- hints.
- (ps_hints_apply): Use psh_glyph_find_blue_points.
-
-2004-02-27 Garrick Meeker <garrick@digitalanarchy.com>
-
- * builds/unix/configure.ac: Fix compiler flags for
- `--with-old-mac-fonts'.
- * builds/unix/configure: Regenerated.
-
- * src/base/ftmac.c: s/TARGET_API_MAC_CARBON/!TARGET_API_MAC_OS8/.
- (FT_New_Face_From_Resource): New function.
- (FT_New_Face): Use FT_New_Face_From_Resource.
- (FT_New_Face_From_FSSpec): Use FT_New_Face_From_Resource.
- [__MWERKS__]: Don't include FSp_fopen.h.
-
-2004-02-26 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshglob.c (psh_globals_new): Fix value of
- `dim->stdw.count'.
- Don't assign default values to blue scale and blue shift.
-
-2004-02-25 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2004-02-25 Garrick Meeker <garrick@digitalanarchy.com>
- Steve Hartwell <shspamsink@comcast.net>
-
- Improve MacOS fond support. Provide a new API
- `FT_New_Face_From_FSSpec' similar to `FT_New_Face'.
-
- * src/base/ftmac.c [__MWERKS__]: Include FSp_fopen.h.
- STREAM_FILE [__MWERKS__]: New macro.
- (ft_FSp_stream_close, ft_FSp_stream_io) [__MWERKS__]: New functions.
- (file_spec_from_path) [__MWERKS__]: Updated #if statement.
- (get_file_type, make_lwfn_spec): Use `const' for argument.
- (is_dfont) [TARGET_API_MAC_CARBON]: Removed.
- (count_face_sfnt, count_faces): New functions.
- (parse_fond): Do some range checking.
- (read_lwfn): Change type of second argument.
- No longer call FSpOpenResFile.
- (OpenFileAsResource): New function.
- (FT_New_Face_From_LWFN): Use `const' for second argument.
- Use OpenFileAsResource.
- (FT_New_Face_From_Suitcase): Change type of second argument.
- No longer call FSpOpenResFile.
- Loop over all resource indices.
- (FT_New_Face_From_dfont) [TARGET_API_MAC_CARBON]: Removed.
- (FT_GetFile_From_Mac_Name): Use `const' for first argument.
- (ResourceForkSize): Removed.
- (FT_New_Face): Updated to use new functions.
- (FT_New_Face_From_FSSpec): New function.
-
- * include/freetype/ftmac.h: Updated.
-
-2004-02-24 Malcolm Taylor <mtaylor@clear.net.nz>
-
- * src/autohint/ahhint.c (ah_hinter_load) <FT_GLYPH_FORMAT_OUTLINE>:
- Handle case where outline->num_vedges is zero while computing hinted
- metrics.
-
-2004-02-24 Gordon Childs <gchilds@quickcut.com.au>
-
- * src/cff/cffcmap.c (cff_cmap_unicode_init): Provide correct value
- for `count'.
-
-2004-02-24 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/t1tables.h (PS_PrivateRec): Add
- `expansion_factor'.
-
- * src/pshinter/pshglob (psh_blues_scale_zones): Fix computation
- of blues->no_overshoots -- `blues_scale' is stored with a
- magnification of 1000, and `scale' returns fractional pixels.
-
- * src/type1/t1load.c (T1_Open_Face): Initialize `blue_shift',
- `blue_fuzz', `expansion_factor', and `blue_scale' according to the
- Type 1 specification.
-
- * src/type1/t1tokens.h: Handle `ExpansionFactor'.
-
- * docs/CHANGES: Updated.
-
-2004-02-24 Masatake YAMATO <jet@gyve.org>
-
- Provide generic access to MacOS resource forks.
-
- * src/base/ftrfork.c, include/freetype/internal/ftrfork.h: New
- files.
-
- * src/base/ftobjs.c: Include FT_INTERNAL_RFORK_H.
- (Mac_Read_POST_Resource, Mac_Read_sfnt_Resource): Remove arguments
- `resource_listoffset' and `resource_data' and adapt code
- accordingly. These values are calculated outside of the function
- now.
- Add new argument `offsets'.
- (IsMacResource): Use `FT_Raccess_Get_HeaderInfo' and
- `FT_Raccess_Get_DataOffsets'.
- (load_face_in_embedded_rfork): New function.
- (load_mac_face): Use load_face_in_embedded_rfork.
- (ft_input_stream_new): Renamed to...
- (FT_Stream_New): This. Use FT_BASE_DEF. Updated all callers.
- (ft_input_stream_free): Renamed to...
- (FT_Stream_Free): This. Use FT_BASE_DEF. Updated all callers.
-
- * src/base/ftbase.c: Include ftrfork.c.
-
- * src/base/rules.mk (BASE_SRC), src/base/Jamfile: Updated.
-
- * include/freetype/internal/internal.h (FT_INTERNAL_RFORK_H):
- New macro.
-
- * include/freetype/internal/fttrace.h: Added `rfork' as a new
- trace definition.
-
- * include/freetype/internal/ftstream.h: Declare FT_Stream_New and
- FT_Stream_Free.
-
- * include/freetype/config/ftoption.h, devel/ftoption.h
- (FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK): New option.
-
- * include/freetype/config/ftstdlib.h (ft_strrchr): New macro.
-
-2004-02-23 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
- * include/freetype/internal/ftdebug.h: Include FT_FREETYPE_H.
-
-2004-02-23 Masatake YAMATO <jet@gyve.org>
-
- Provide a simple API to control FreeType's tracing levels.
-
- * include/freetype/internal/ftdebug.h (FT_Trace_Get_Count,
- FT_Trace_Get_Name): New declarations.
-
- * src/base/ftdebug.c (FT_Trace_Get_Count, FT_Trace_Get_Name): New
- functions.
-
-2004-02-23 David Turner <david@freetype.org>
-
- * src/autofit/afhints.c, src/autofit/afhints.h,
- src/autofit/aflatin.c, src/autofit/afloader.c, src/types.h: Grave
- bugs have been fixed. The auto-fitter works, doesn't crash, but
- still produces unexpected results...
-
-2004-02-21 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshalgo.c (PSH_STRONG_THRESHOLD): Changed to hold
- the accepted shift for strong points in fractional pixels (which
- is a heuristic value).
- (psh_glyph_find_strong_points): Compute threshold for
- psh_hint_table_find_strong_points.
- (psh_hint_table_find_strong_point): Add parameter to pass threshold.
-
-2004-02-20 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshrec.c (ps_mask_table_set_bits): Don't call
- ps_mask_table_alloc but ps_mask_table_last.
- (ps_hints_t2mask): Use correct position and number for vertical
- and horizontal hinter mask bits.
-
- * docs/CHANGES: Updated.
-
-2004-02-19 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftstroke.c (FT_Glyph_StrokeBorder): Fix enum handling.
- * src/cff/cffdrivr.c (cff_get_cmap_info): Remove compiler warning.
-
-2004-02-18 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h: Document FT_LOAD_TARGET_XXX properly.
-
- * src/base/ftglyph.c (ft_bitmap_glyph_class,
- ft_outline_glyph_class): Tag with FT_CALLBACK_TABLE_DEF.
-
- * src/smooth/ftsmooth.c (ft_smooth_render): Handle
- FT_RENDER_MODE_LIGHT.
-
-2004-02-17 Werner Lemberg <wl@gnu.org>
-
- Fix callback functions in cache module.
-
- * src/cache/ftccback.h: New file for callback declarations.
-
- * src/cache/ftcbasic.c (ftc_basic_family_compare,
- ftc_basic_family_init, ftc_basic_family_get_count,
- ftc_basic_family_load_bitmap, ftc_basic_family_load_glyph,
- ftc_basic_gnode_compare_faceid): Use FT_CALLBACK_DEF.
- (ftc_basic_image_family_class, ftc_basic_image_cache_class,
- ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class):
- Use FT_CALLBACK_TABLE_DEF and local wrapper functions.
-
- * src/cache/ftccache.c: Include ftccback.h.
- (ftc_cache_init, ftc_cache_done): New wrapper functions which use
- FT_LOCAL_DEF.
-
- * src/cache/ftccmap.c: Include ftccback.h.
- (ftc_cmap_cache_class): Use local wrapper functions.
-
- * src/cache/ftcglyph.c: Include ftccback.h.
- (ftc_gnode_compare, ftc_gcache_init, ftc_gcache_done): New wrapper
- functions which use FT_LOCAL_DEF.
-
- * src/cache/ftcimage.c: Include ftccback.h.
- (ftc_inode_free, ftc_inode_new, ftc_inode_weight): New wrapper
- functions which use FT_LOCAL_DEF.
-
- * src/cache/ftcmanag.c (ftc_size_list_class, ftc_face_list_class):
- Use FT_CALLBACK_TABLE_DEF.
-
- * src/cache;/ftcsbits.c: Include ftccback.h.
- (ftc_snode_free, ftc_snode_new, ftc_snode_weight,
- ftc_snode_compare): New wrapper functions which use FT_LOCAL_DEF.
-
- * src/cache/rules.mk (CACHE_DRV_H): Add ftccback.h.
-
-2004-02-17 Masatake YAMATO <jet@gyve.org>
-
- * include/freetype/ftmac.h (FT_GetFile_From_Mac_Name): Fix a typo
- (FT_EXPORT_DEF -> FT_EXPORT).
-
- * include/freetype/ftxf86.h (FT_Get_X11_Font_Format): Ditto.
-
-2004-02-15 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Set_Char_Size): Fix typo.
-
-2004-02-14 Masatake YAMATO <jet@gyve.org>
-
- * builds/unix/ftsystem.c: Include errno.h.
- (ft_close_stream): Renamed to...
- (ft_close_stream_by_munmap): This.
- (ft_close_stream_by_free): New function.
- (FT_Stream_Open): Use fallback method if mmap fails.
- Use proper function for closing the stream.
-
-2004-02-14 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_dict): Initialize `start_binary'.
-
-2004-02-13 Robert Etheridge <roberte@stcc.cc.tx.us>
-
- * src/type42/t42objs.c (T42_Face_Init), src/type1/t1objs.c
- (T1_Face_Init), src/cid/cidobjs.c (cid_face_init): Fix computation
- of underline_position and underline_thickness.
-
-2004-02-12 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Set_Char_Size): Return immediately if
- ppem values don't change. Suggested by Graham Asher.
-
-2004-02-11 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidload.c (cid_face_open): Always allocate
- face->cid_stream so that we can deallocate it safely.
-
-2004-02-10 Werner Lemberg <wl@gnu.org>
-
- Make the PS parser more tolerant w.r.t. non-standard font data. In
- general, an error is only reported in case of a syntax error; a
- wrong type is now simply ignored (if possible). To be independent
- of the order of various MM-specific keywords, the parse_shared_dict
- routine has been removed -- the PS parser is now capable to skip
- this data. It no longer fails on parsing e.g.
-
- dup /WeightVector exch def
-
- Since the token following /WeightVector isn't `[' (starting an
- array) it is simply ignored.
-
- * include/freetype/fterrdef.h: Define `FT_Err_Ignore' (0xA2) as a
- new internal error value.
-
- * src/type1/t1load.c (parse_blend_axis_types,
- parse_blend_design_positions, parse_blend_design_map): Return
- T1_Err_Ignore if no proper array is following the keyword.
- (parse_weight_vector): Use T1_ToTokenArray, initializing `blend'
- structure, if necessary.
- Return T1_Err_Ignore if no proper array is following the keyword.
- (parse_shared_dict): Removed.
- (parse_encoding): Set parser->root.error to return T1_Err_Ignore
- if no result can be obtained.
- Check for errors before accessing `elements' array.
- (t1_keywords): Remove /shareddict.
- (parse_dict): Reset error if t1_load_keyword returns T1_Err_Ignore.
- Set keyword_flag only in case of success.
- Check error code if skipping an unrecognized token.
- (T1_Open_Face) [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: Call T1_Done_Blend
- if blend commands haven't set up a proper MM font.
-
- * src/psaux/psobjs.c (ps_parser_load_field_table): Remove special
- code for synthetic fonts.
- Return PSaux_Err_Ignore if no proper value has been found.
-
-2004-02-09 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_endchar>: Preserve glyph width before calling
- cff_operator_seac.
-
-2004-02-09 Martin Muskens <mmuskens@aurelon.com>
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Handle special
- first argument for `hintmask' and `cntrmask' operators also.
-
-2004-02-08 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.in: Call AC_SUBST for `enable_shared',
- `hardcode_libdir_flag_spec', and `wl'.
- * builds/unix/configure: Regenerated.
-
- * builds/unix/freetype-config.in: Make --prefix and --exec-prefix
- actually work.
- Report a proper --rpath (or -R) value for --libs argument if a
- shared library has been built.
-
- * docs/CHANGES: Updated.
-
-2004-02-07 Keith Packard <keithp@keithp.com>
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init, BDF_Set_Pixel_Size): Fix
- computation of various vertical and horizontal metric values.
-
- * src/pcfdrivr.c (PCF_Set_Pixel_Size), src/pcfread (pcf_load_font):
- Ditto.
-
-2004-02-07 Werner Lemberg <wl@gnu.org>
-
- * builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.dsw, docs/CHANGES: Updated.
-
-2004-02-07 Vitaliy Pasternak <v_a_pasternak@mail.ru>
-
- * builds/win32/visualc/freetype.sln,
- builds/win32/visualc/freetype.vcproj: New files for VS.NET 2003.
-
-2004-02-03 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP):
- Initialize `node'.
- * src/type1/t1load.c (parse_dict): Initialize `have_integer'.
-
-2004-02-02 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_dict): Handle `RD' and `-|' commands
- outside of /Subrs or /CharStrings. This can happen if there is
- additional code manipulating those two arrays so that FreeType
- doesn't recognize them properly.
- (T1_Open_Face): Improve an error message.
-
-2004-02-01 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_charstrings): Exit immediately if
- there are no elements in /CharStrings. This is needed for fonts
- like Optima-Oblique which not only define /CharStrings but access it
- also.
-
-2004-02-01 David Turner <david@freetype.org>
-
- * src/sfnt/Jamfile: Removing `ttcmap' from the list of sources.
-
- * include/freetype/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP)
- <FTC_INLINE>: Provide macro version which doesn't use inline code.
- * include/freetype/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP)
- <FTC_INLINE>: Ditto.
- Use FTC_MRULIST_LOOKUP_CMP.
- * include/freetype/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): New
- macro.
- (FTC_MRULIST_LOOKUP): Use it.
-
- * src/cache/Jamfile (_sources), src/cache/descrip.mms: Updated.
- * src/cache/ftcbasic.c: Fix compiler warnings.
- * src/cache/ftcmanag.c (FTC_Manager_LookupSize,
- FTC_Manager_LookupFace) <FTC_INLINE>: Use FTC_MRULIST_LOOKUP_CMP.
- * src/cache/ftcmru.c (FTC_MruList_Find): Fix a bug (found after
- heavy testing).
-
- * Jamfile: Updating `refdoc' target, and adding `autohint' to the
- list of modules to build. Both the autohinter and autofitter will
- be built by default. But which one will be used is determined by
- the content of `ftmodule.h'.
-
- * src/autofit/*: Many updates, but the code is still buggy...
-
-2004-01-31 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (cff_operator_seac): Fix magnitude of
- accent offset.
- Update code similarly to the seac support for Type 1 fonts.
- (cff_decoder_parse_charstrings) <cff_op_endchar>: Fix magnitude
- of accent offset.
- Don't hint glyphs twice if seac is emulated.
- <cff_op_flex>: Assign correct point tags.
- * docs/CHANGES: Updated.
-
-2004-01-30 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1parse.c (T1_Get_Private_Dict): Use FT_MEM_MOVE, not
- FT_MEM_COPY, for copying the private dict.
-
- * src/type1/t1load.c (parse_subrs): Assign number of subrs only
- in first run.
- (parse_charstrings): Parse /CharStrings in second run without
- assigning values.
- (parse_dict): Skip all /CharStrings arrays but the first. We need
- this for non-standard fonts like `Optima' which have different
- outlines depending on the resolution. Note that there is no
- guarantee that we get fitting /Subrs and /CharStrings arrays; this
- can only be done by a real PS interpreter.
-
-2004-01-29 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
-
- * builds/win32/visualc/index.html: New file, giving detailed
- explanations about forcing CR+LF line endings for the VC++ project
- files.
-
-2004-01-22 Garrick Meeker <garrick@digitalanarchy.com>
-
- * src/cff/cffload.c (cff_subfont_load): Initialize `dict'.
-
-2004-01-22 Werner Lemberg <wl@gnu.org>
-
- Add support for the hexadecimal representation of binary data
- started with `StartData' in CID-keyed Type 1 fonts.
-
- * include/freetype/internal/t1types.h (CID_FaceRec): Add new
- members `binary_data' and `cid_stream'.
-
- * src/cid/cidload.c (cid_read_subrs): Use `face->cid_stream'.
- (cid_hex_to_binary): New auxiliary function.
- (cid_face_open): Add new argument `face_index' to return quickly
- if less than zero. Updated all callers.
- Call `cid_hex_to_binary', then open and assign memory stream to
- `face->cid_stream' if `parser->binary_length' is non-zero.
- * src/cid/cidload.h: Updated.
-
- * src/cid/cidobjs.c (cid_face_done): Free `binary_data' and
- `cid_stream'.
-
- * src/cid/cidparse.c (cid_parser_new): Check arguments to
- `StartData' and set parser->binary_length accordingly.
- * src/cid/cidparse.h (CID_Parser): New member `binary_length'.
-
- * src/cid/cidgload.c (cid_load_glyph): Use `face->cid_stream'.
-
- * docs/CHANGES: Updated.
-
-2004-01-21 Werner Lemberg <wl@gnu.org>
-
- include/freetype/config/ftstdlib.h (ft_atoi): Replaced with...
- (ft_atol): This.
- * src/base/ftdbgmem.c: s/atol/ft_atol/.
- * src/type42/t42drivr.c: s/ft_atoi/ft_atol/.
-
-2004-01-20 Masatake YAMATO <jet@gyve.org>
-
- * include/freetype/ftcache.h: Delete duplicated definition of
- FTC_FaceID.
-
- * src/cff/cffdrivr.c (cff_get_cmap_info): Call sfnt module's TT CMap
- Info service function if the cmap comes from sfnt. Return 0 if the
- cmap is synthesized in cff module.
-
-2004-01-20 David Turner <david@freetype.org>
-
- * src/cache/ftcmanag.c (ftc_size_node_compare): Call
- FT_Activate_Size.
-
-2004-01-20 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1parse.c (T1_Get_Private_Dict): Skip exactly one
- CR, LF, or CR/LF after `eexec'.
-
-2004-01-18 David Turner <david@freetype.org>
-
- * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Remove compiler
- warning.
-
- * src/tools/docmaker/*: Updating beautifier tool.
-
-2004-01-15 David Turner <david@freetype.org>
-
- * src/base/ftoutln.c (ft_orientation_extremum_compute): Fix
- infinite loop bug.
-
- * include/freetype/ftstroke.h: Include FT_GLYPH_H.
- (FT_Stroker_Rewind, FT_Glyph_Stroke, FT_Glyph_StrokeBorder): New
- declarations.
-
- * src/base/ftstroke.c: Include FT_INTERNAL_OBJECTS_H.
- (FT_Outline_GetOutsideBorder): Inverse result.
- (FT_Stroker_Rewind, FT_Glyph_Stroke, FT_Glyph_StrokeBorder): New
- functions.
- (FT_Stroker_EndSubPath): Close path if needed.
- (FT_Stroker_Set, FT_Stroker_ParseOutline): Use FT_Stroker_Rewind.
-
- * include/freetype/cache/ftcmanag.h (FTC_ScalerRec,
- FTC_Manager_LookupSize): Moved to...
- * include/freetype/ftcache.h (FTC_ScalerRec,
- FTC_Manager_LookupSize): Here.
-
- * src/tools/docmaker/docbeauty.py: New file to beautify the
- documentation comments (e.g., to convert them to single block border
- mode).
- * src/tools/docmaker/docmaker.py (file_exists, make_file_list):
- Moved to...
- * src/tools/docmaker/utils.py (file_exists, make_file_list): Here.
-
-2004-01-14 David Turner <david@freetype.org>
-
- * include/freetype/internal/ftmemory.h (FT_ARRAY_COPY,
- FT_ARRAY_MOVE): New macros to make copying arrays easier.
- Updated all relevant code to use them.
-
-2004-01-14 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_font_load): Load charstrings_index earlier.
- Use number of charstrings as argument to CFF_Load_FD_Select (as
- documented in the CFF specs).
-
-2004-01-13 Graham Asher <graham.asher@btinternet.com>
-
- * src/pshinter/pshalgo.c (psh_glyph_init): Move assignment of
- `glyph->memory' up to free arrays properly in case of failure.
-
-2004-01-10 Masatake YAMATO <jet@gyve.org>
-
- Make `FT_Get_CMap_Language_ID' work with CFF. Bug reported by
- Steve Hartwell <shspamsink@comcast.net>.
-
- * src/cff/cffdrivr.c: Include FT_SERVICE_TT_CMAP_H.
- (cff_services): Added an entry for FT_SERVICE_ID_TT_CMAP.
- (cff_get_cmap_info): New function.
- (cff_service_get_cmap_info) New entry for cff_services.
-
- * src/sfnt/ttcmap0.c: Exit loop after a format match has been found.
- Suggested by Steve Hartwell <shspamsink@comcast.net>.
-
-2004-01-03 Masatake YAMATO <jet@gyve.org>
-
- * src/base/ftobjs.c (destroy_charmaps): New function.
- (destroy_face, open_face): Use `destroy_charmaps'.
-
-2004-01-01 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2004-01-01 Michael Jansson <mjan@em2-solutions.com>
-
- * src/winfonts/winfnt.c (FNT_Size_Set_Pixels): Fix sign of
- size->metrics.descender.
-
-2003-12-31 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- [FT_DEBUG_LEVEL_TRACE]: Use `%ld' in FT_TRACE4.
- <cff_op_flex1>: Change type of dx and dy to FT_Pos and remove
- cast for accessing arguments.
-
-2003-12-31 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Revert previous
- change. It's not necessary.
-
-2003-12-29 Smith Charles <smith.charles@free.fr>
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle `repeated
- flags set' correctly.
-
-2003-12-29 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): Fix memory leak by deallocating
- `full' and `weight' properly.
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_hintmask> [FT_DEBUG_LEVEL_TRACE]: Use `0x' as prefix for
- tracing output.
-
-2003-12-26 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/sfnt.h (TT_Set_SBit_Strike_Func):
- Use FT_UInt for ppem values.
- * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use FT_UInt for
- ppem values.
- * src/sfnt/ttsbit.h: Updated.
-
- * src/base/ftobjs.c (FT_Set_Pixel_Sizes): Don't allow ppem values
- larger than -0FFFF.
-
-2003-12-25 Werner Lemberg <wl@gnu.org>
-
- * src/base/fttrigon.c, src/base/ftgloadr.c: Include
- FT_INTERNAL_OBJECTS_H.
-
- * src/base/ftstroke.c (FT_Outline_GetInsideBorder,
- FT_Outline_GetOutsideBorder): s/or/o/ to make it compile with
- C++ compilers.
-
- * src/cache/ftcmru.c, include/freetype/cache/ftcmru.h:
- s/select/selection/ to avoid compiler warning.
- * src/cff/cffload.h: s/select/ftselect/ to avoid potential
- compiler warning.
-
-2003-12-24 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftcsbits.c (FTC_SNode_Weight):
- s/FTC_SBIT_ITEM_PER_NODE/FTC_SBIT_ITEMS_PER_NODE/.
-
-2003-12-24 David Turner <david@freetype.org>
-
- * Fixed compilation problems in the cache sub-system.
-
- * Partial updates to src/autofit.
-
- * Jamfile (FT2_COMPONENTS): Add autofit module.
-
-2003-12-23 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (cff_lookup_glyph_by_stdcharcode): Handle
- CID-keyed fonts.
-
-2003-12-23 David Turner <david@freetype.org>
-
- * include/freetype/internal/ftobjs.h (FT_PAD_FLOOR, FT_PAD_ROUND,
- FT_PAD_CEIL, FT_PIX_FLOOR, FT_PIX_ROUND, FT_PIX_CEIL): New macros.
- They are used to avoid compiler warnings with very pedantic compilers.
- Note that `(x) & -64' causes a warning if (x) is not signed. Use
- `(x) & ~63' instead!
- Updated all related code.
-
- Add support for extraction of `inside' and `outside' borders.
-
- * src/base/ftstroke.c (FT_StrokerBorder): New enumeration.
- (FT_Outline_GetInsideBorder, FT_Outline_GetOutsideBorder,
- FT_Stroker_GetBorderCounts, FT_Stroker_ExportBorder): New functions.
- (FT_StrokeBorderRec): New boolean member `valid'.
- (ft_stroke_border_get_counts): Updated.
- * include/freetype/ftstroke.h: Updated.
-
-2003-12-22 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftwinfnt.h (FT_WinFNT_ID_*): New definitions
- to describe the `charset' field in FT_WinFNT_HeaderRec.
- * src/winfonts/winfnt.c (FNT_Face_Init): Set encoding to
- FT_ENCODING_NONE except for FT_WinFNT_ID_MAC.
-
- * include/freetype/freetype.h (FT_Encoding): Improve comment,
- based on work by Detlef Würkner <TetiSoft@apg.lahn.de>.
-
- * docs/CHANGES: Updated.
-
-2003-12-22 David Turner <david@freetype.org>
-
- * include/freetype/ftcache.h,
- include/freetype/cache/ftcmanag.h,
- include/freetype/cache/ftccache.h,
- include/freetype/cache/ftcmanag.h,
- include/freetype/cache/ftcmru.h (added),
- include/freetype/cache/ftlru.h (removed),
- include/freetype/cache/ftcsbits.h,
- include/freetype/cache/ftcimage.h,
- include/freetype/cache/ftcglyph.h,
- src/cache/ftcmru.c,
- src/cache/ftcmanag.c,
- src/cache/ftccache.c,
- src/cache/ftcglyph.c,
- src/cache/ftcimage.c,
- src/cache/ftcsbits.c,
- src/cache/ftccmap.c,
- src/cache/ftcbasic.c (added),
- src/cache/ftlru.c (removed):
-
- *Complete* rewrite of the cache sub-system to `solve' the
- following points:
-
- - all public APIs have been moved to FT_CACHE_H, everything
- under `include/freetype/cache' is only needed by client
- applications that want to implement their own caches
-
- - a new function named FTC_Manager_RemoveFaceID to deal
- with the uninstallation of FaceIDs
-
- - the image and sbit cache are now abstract classes, that
- can be extended much more easily by client applications
-
- - better performance in certain areas. Further optimizations
- to come shortly anyway...
-
- - the FTC_CMapCache_Lookup function has changed its signature,
- charmaps can now only be retrieved by index
-
- - FTC_Manager_Lookup_Face => FTC_Manager_LookupFace
- FTC_Manager_Lookup_Size => FTC_Manager_LookupSize (still in
- private header for the moment)
-
-2003-12-21 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_dict): Stop parsing if `eexec' keyword
- is encountered.
-
-2003-12-19 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 32. For
- example, the Japanese Hiragino font already contains 15 subfonts.
-
- * src/cff/cffload.c (cff_font_load): Deallocate `sids' array for
- CID-keyed fonts.
-
- * devel/ftoption.h: Define FT_DEBUG_MEMORY.
-
-2003-12-18 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ttnameid.h (TT_ADOBE_ID_LATIN_1): New macro.
- * src/type1/t1objs.c (T1_Face_Init): Use TT_ADOBE_ID* values.
-
-2003-12-18 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cfftypes.h (CFF_FontRecDictRec): Change type of
- `cid_count' to `FT_ULong'.
-
- * src/cff/cffgload.c (cff_slot_load): Take care of empty `cids'
- array.
-
- * src/cff/cffload.c (cff_charset_done): Free `cids' array.
- (cff_font_load): Create cids array only for CID-keyed fonts which
- are subsetted.
-
- * src/cff/cffobjs.c (cff_face_init): Check the availability of
- the PSNames modules for non-pure CFFs also.
- Set FT_FACE_FLAG_GLYPH_NAMES for a non-pure CFF also if it isn't
- CID-keyed.
-
- * src/cff/rules.mk (CFF_DRV_H): Add cfftypes.h.
-
-2003-12-17 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Don't set
- FT_FACE_FLAG_GLYPH_NAMES if the font contains a version 3.0 `post'
- table.
-
- * docs/CHANGES: Updated.
-
-2003-12-17 Masatake YAMATO <jet@gyve.org>
-
- Add new function FT_Get_CMap_Language_ID to extract the language ID
- for TrueType/sfnt fonts.
-
- * include/freetype/internal/services/svttcmap.h: New file.
- * include/freetype/internal/ftserv.h (FT_SERVICE_TT_CMAP_H): Add
- svttcmap.h.
-
- * src/sfnt/sfdriver.c: Include ttcmap0.h.
- (tt_service_get_cmap_info): New service.
- (sfnt_services): Updated.
-
- * src/sfnt/ttcmap0.c (tt_cmap*_get_info): New functions.
- (tt_cmap*_class_rec): Add tt_cmap*_get_info members.
- (tt_get_cmap_info): New function.
- * src/sfnt/ttcmap0.h: Include FT_SERVICE_TT_CMAP_H.
- (TT_CMap_ClassRec): New field `get_cmap_info'.
- (tt_get_cmap_info): New declaration.
-
- * src/base/ftobjs.c: Include FT_SERVICE_TT_CMAP_H.
- (FT_Get_CMap_Language_ID): New function implementation.
- * include/freetype/tttables.h (FT_Get_CMap_Language_ID): New
- function declaration.
-
-2003-12-16 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttcmap.c, src/sfnt/ttcmap.h: Removed. Obsolete.
-
- * include/freetype/internal/sfnt.h (SFNT_Interface): Remove
- obsolete fields `load_charmap' and `free_charmap'.
- (TT_CharMap_Load_Func, TT_CharMap_Free_Func): Removed.
- * src/sfnt/sfnt.c: Don't include ttcmap.c.
- * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttcmap.c.
- * src/sfnt/ttload.c: Don't include ttcmap.h.
- * src/sfnt/sfdriver.c: Don't include ttcmap.h.
- (sfnt_interface): Updated.
-
- * include/freetype/internal/tttypes.h (TT_TableDirRec,
- TT_CMapDirRec, TT_CMapDirEntryRec, TT_CMap0, TT_CMap2SubHeaderRec,
- TT_CMap2Rec, TT_CMap4Segment, TT_CMap4Rec, TT_CMap6,
- TT_CMapGroupRec, TT_CMap8_12Rec, TT_CMap10Rec, TT_CharMap_Func,
- TT_CharNext_Func, TT_CMapTableRec, TT_CharMapRec): Removed.
- Obsolete.
- * src/cff/cffobjs.h (CFF_CharMapRec): Removed. Obsolete.
-
-2003-12-15 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2003-12-15 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * builds/atari/*: New directory for building FreeType 2 on Atari
- with the PureC compiler.
-
-2003-12-12 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add
- cast.
- * src/cff/cffdrivr.c (cff_ps_has_glyph_names): Assure that return
- value is either 0 or 1.
-
-2003-12-12 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffdrivr.c (cff_get_glyph_name): Improve error message.
- (cff_get_name_index): Return if no PSNames service is available.
- (cff_ps_has_glyph_names): Handle CID-keyed fonts correctly.
- * src/cff/cfftypes.h (CFF_CharsetRec): New field `cids', used for
- CID-keyed fonts. This is the inverse mapping of `sids'.
- * src/cff/cffload.c (cff_charset_load): New argument `invert'.
- Initialize charset->cids if `invert' is set.
- (cff_font_load): In call to cff_charset_load, set `invert' to true
- for CID-keyed fonts.
- * src/cff/cffgload.c (cff_slot_load): Handle glyph index as CID
- and map it to the real glyph index.
-
- * docs/CHANGES: Updated.
-
-2003-12-11 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): Don't set
- FT_FACE_FLAG_GLYPH_NAMES for CID-keyed fonts.
- Don't construct a cmap for CID-keyed fonts.
-
-2003-12-10 Werner Lemberg <wl@gnu.org>
-
- Use implementation specific SID value 0xFFFF to indicate that
- a dictionary element is missing.
-
- * src/cff/cffload.c (cff_subfont_load): Initialize all fields
- which hold SIDs to 0xFFFF.
- (cff_index_get_sid_string): Handle SID value 0xFFFF.
- Handle case where `psnames' is zero.
- (cff_font_load): Updated.
- Don't load encoding for CID-keyed CFFs.
-
- * src/cff/cffobjs.c (cff_face_init): Updated.
- Don't check for PSNames module if font is CID-keyed.
- Compute style name properly (using the same algorithm as in the
- CID driver).
- Fix computation of style flags.
-
- * src/cff/cfftoken.h: Comment out handling of base_font_name.
- Rename `postscript' field to `embedded_postscript'
- * src/cff/cfftypes.h (CFF_FontRecDictRec): Remove `base_font_name'
- and `postscript'.
-
-2003-12-10 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/pcf/pcfdrivr.c (pcf_get_charset_id): New function (a clone
- of the similar BDF function).
- (pcf_service_bdf): Use it.
-
-2003-12-09 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Set FT_FACE_FLAG_GLYPH_NAMES
- only if a `post' table is present.
-
-2003-12-09 George Williams <gww@silcom.com>
-
- * src/base/ftobjs.c (load_mac_face): Recent versions of Linux
- support Mac's HFS+ file system, thus enable code to read /rsrc on
- non-Macintosh platforms also.
-
-2003-12-08 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/psaux.h (PS_TableRec): Change type
- of `lengths' to FT_PtrDist.
- (T1_DecoderRec): Change type of `subrs_len' to FT_PtrDist.
- * include/freetype/internal/t1types.h (T1_FontRec): Change type
- of `subrs_len' and `charstrings_len' to FT_PtrDist.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Replace `junk'
- variable with better solution.
- (IsMacResource): Remove unused variable `map_len'.
- Replace `junk' variable with better solution.
- (FT_Open_Face) [!FT_MACINTOSH]: Add conditional
- FT_CONFIG_OPTION_MAC_FONTS.
-
-2003-12-08 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * src/autohint/ahhint.c (ah_hinter_hint_edges,
- ah_hinter_align_strong_points): Add some casts.
-
- * src/base/ftoutln.c (FT_OrientationExtremumRec): Change type
- of `pos' to FT_Long.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource,
- Mac_Read_sfnt_Resource): Change type of `len' to FT_Long.
-
- * src/type42/t42parse.c (t42_parse_dict): Add cast for `n_keywords'.
-
-2003-12-07 Werner Lemberg <wl@gnu.org>
-
- * docs/raster.txt: New file, taken from FreeType 1 and completely
- revised.
-
-2003-12-04 Masatake YAMATO <jet@gyve.org>
-
- * src/type1/t1driver.c (Get_Interface): Remove FT_UNUSED for
- t1_interface. t1_interface is used.
-
-2003-11-27 David Turner <david@freetype.org>
-
- * src/pfr/pfrdrivr.c (pfr_get_metrics): Revert incorrect change of
- 2003-11-23: For PFR fonts, metrics->x_scale and metrics->y_scale are
- the scaling values for outline units, not for metric units.
-
-2003-11-25 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftcalc.c, include/freetype/internal/ftcalc.h
- (FT_MulDiv_No_Round): Surround code with `#ifdef
- TT_CONFIG_OPTION_BYTECODE_INTERPRETER ... #endif'.
-
-2003-11-23 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftcalc.c (FT_MulDiv_No_Round): New function (32 and
- 64 bit version).
- * include/freetype/internal/ftcalc.h: Updated.
-
- * src/truetype/ttinterp.c (TT_MULDIV_NO_ROUND): New macro.
- (TT_INT64): Removed.
- (DO_DIV): Use TT_MULDIV_NO_ROUND.
-
- * src/pfr/pfrdrivr.c (pfr_get_metrics): Directly use
- metrics->x_scale and metrics->y_scale.
-
-2003-11-22 Rogier van Dalen <R.C.van.Dalen@umail.leidenuniv.nl>
-
- * src/truetype/ttinterp.c (CUR_Func_move_orig): New macro.
- (Direct_Move_Orig, Direct_Move_Orig_X, Direct_Move_Orig_Y): New
- functions. Similar to Direct_Move, Direct_Move_X, and
- Direct_Move_Y but without touching.
- (Compute_Funcs): Use new functions.
-
- (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid,
- Round_Up_To_Grid, Round_To_Double_Grid, Round_Super,
- Round_Super_45): Fix rounding of value zero.
-
- (DO_DIV): Don't use TT_MULDIV.
-
- (Ins_SHC): This instruction actually touches the points.
- (Ins_MSIRP): Fix undocumented behaviour.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): Updated.
-
-2003-11-22 Werner Lemberg <wl@gnu.org>
-
- * docs/VERSION.DLL, docs/CHANGES: Updated.
-
- * src/base/ftobjs.c (FT_Set_Char_Size): Make metrics->x_scale and
- metrics->y_scale really precise.
-
- (FT_Load_Glyph): Update computation of linearHoriAdvance and
- linearVertAdvance.
-
- * src/truetype/ttinterp.c (Update_Max): Use FT_REALLOC.
-
-2003-11-22 David Turner <david@freetype.org>
-
- * src/autofit/*: More updates.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8.
- * builds/unix/configure.ac (version_info): Set to 9:6:3.
- * README: Updated.
-
-2003-11-13 John A. Boyd Jr. <jaboydjr@netwalk.com>
-
- * src/bdf/bdfdrivr.c (bdf_interpret_style), src/pcf/pcfread.c
- (pcf_interpret_style): Replace spaces with dashes in properties
- SETWIDTH_NAME and ADD_STYLE_NAME to simplify parsing.
-
-2003-11-11 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2003-11-11 John A. Boyd Jr. <jaboydjr@netwalk.com>
-
- Handle SETWIDTH_NAME and ADD_STYLE_NAME properties for BDF and PCF
- fonts.
-
- * src/bdf/bdfdrivr.c (bdf_interpret_style): New auxiliary function.
- (BDF_Face_Init): Don't handle style properties but call
- bdf_interpret_style.
-
- * src/pcf/pcfread.c (pcf_interpret_style): New auxiliary function.
- (pcf_load_font): Don't handle style properties but call
- pcf_interpret_style.
-
-2003-11-07 Werner Lemberg <wl@gnu.org>
-
-
- * Version 2.1.7 released.
- =========================
-
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7.
-
- * builds/unix/ft2unix.h: Fix comments.
-
- * builds/unix/ftconfig.in: Synchronized with ANSI version.
- Use `#undef' in templates as recommended in the autoconf
- documentation.
- Since real `#undef' lines don't survive during configuration, use
- `/undef' instead; the postprocessing facility of the
- AC_CONFIG_HEADERS autoconf macro converts them to `#undef'.
-
- * builds/unix/install.mk (install): Install Unix version of
- `ftconfig.h'.
-
- * builds/unix/unix-cc.in (CFLAGS): Set FT_CONFIG_CONFIG_H macro
- to include the correct `ftconfig.h' file.
-
- * builds/unix/ft-munmap.m4 (FT_MUNMAP_DECL): Removed.
- (FT_MUNMAP_PARAM): Updated syntax to autoconf 2.59.
-
- * builds/unix/freetype2.m4: Updated syntax to autoconf 2.59.
-
- * builds/unix/configure.ac: Use AC_CONFIG_HEADERS instead of
- AC_CONFIG_HEADER to create ftconfig.h, and use second argument
- to replace `/undef' with `#undef'.
- Don't use FT_MUNMAP_DECL but AC_CHECK_DECLS to check for munmap.
- Use AS_HELP_STRING in AC_ARG_WITH.
- Update syntax to autoconf 2.59.
-
- * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
- --copy' from libtool 1.5.
- * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
- automake 1.7.8.
- * builds/unix/configure: Regenerated with autoconf 2.59.
- * builds/unix/config.guess, builds/unix/config.sub: Updated from
- `config' CVS module at subversions.gnu.org
- * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
- `texinfo' CVS module at subversions.gnu.org.
-
- * builds/vms/ftconfig.h: Synchronized with ANSI version.
-
- * docs/CUSTOMIZE: Fix documentation error.
- * docs/CHANGES, docs/VERSION.DLL, docs/release: Updated.
-
- * builds/freetype.mk (refdoc): Updated --title.
-
-2003-11-07 David Turner <david@freetype.org>
-
-
- * Version 2.1.6 released.
- =========================
-
-
- * install: Removed. Obsolete.
-
-2003-11-04 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfdriver.c: Include FT_SERVICE_SFNT_H.
- (sfnt_service_sfnt_table): New service.
- (sfnt_services): Updated.
-
- * docs/license.txt: Reworded.
-
-2003-11-03 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/*: Add a guard to all public header files which
- load FT_FREETYPE_H to reject freetype.h from FreeType 1.
-
-2003-11-02 Patrick Welche <prlw1@newn.cam.ac.uk>
-
- * builds/unix/freetype2.m4, builds/unix/ft-munmap.m4: Protect
- first argument of AC_DEFUN with brackets to avoid possible
- expansion.
-
-2003-11-02 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/cache/ftcglyph.h: Don't include stddef.h.
-
- * include/freetype/freetype.h: Fix check for ft2build.h.
-
-2003-11-01 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h: Check that ft2build.h has been
- loaded first.
-
- * src/base/fttype1.c (FT_Get_PS_Font_Info): Fix incorrectly applied
- patch.
-
-2003-10-31 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/base/fttype1.c (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names):
- Fix parameter order in calls to FT_FACE_FIND_SERVICE.
-
-2003-10-31 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftserv.h
- (FT_SERVICE_POSTSCRIPT_NAMES_H): Removed. Unused.
-
- * src/type42/t42drivr.c (t42_services): Updated.
-
-2003-10-29 David Turner <david@freetype.org>
-
- * include/freetype/internal/bdftypes.h: Removed. Obsolete.
- * src/base/ftbdf.c: Updated.
-
- * include/freetype/internal/cfftypes.h: Moved to...
- * src/cff/cfftypes.h: This place since no other module needs to
- know about those types.
-
- * include/freetype/internal/t42types.h: Moved to...
- * src/type42/t42types.h: This place since no other module needs to
- know about those types.
-
- * include/freetype/internal/services/svbdf.h: Include FT_BDF_H.
-
- * include/freetype/internal/services/svpsname.h: Renamed to...
- * include/freetype/internal/services/svpscmap.h: This.
- Updated `FT_Service_PsNames' -> `FT_Service_PsCMaps' and
- `POSTSCRIPT_NAMES' -> `POSTSCRIPT_CMAPS' everywhere.
-
- * include/freetype/internal/services/svpsinfo.h: New file, providing
- PostScript info service.
-
- * include/freetype/internal/ftserv.h (FT_SERVICE_POSTSCRIPT_CMAPS_H,
- FT_SERVICE_POSTSCRIPT_INFO_H): New macros for svpscmap.h and
- svpsinfo.h.
- * include/freetype/internal/internal.h (FT_INTERNAL_TYPE42_TYPES_H,
- FT_INTERNAL_CFF_TYPES_H, FT_INTERNAL_BDF_TYPES_H): Removed.
-
- * src/base/fttype1.c: Don't include FT_INTERNAL_TYPE1_TYPES_H and
- FT_INTERNAL_TYPE42_TYPES_H but FT_INTERNAL_SERVICE_H and
- FT_SERVICE_POSTSCRIPT_INFO_H.
- (FT_Get_PS_Font_Info, FT_Has_PS_Glyph_Names): Use new
- POSTSCRIPT_INFO service.
-
- * src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
- (cff_ps_has_glyph_names): New function.
- (cff_service_ps_info): New service.
- (cff_services): Updated.
-
- * src/cff/cffload.h, src/cff/cffobjs.h, src/cff/cffparse.h: Don't
- include FT_INTERNAL_CFF_TYPES_H but cfftypes.h directly.
-
- * src/cid/cidriver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
- (cid_ps_get_font_info): New function.
- (cid_service_ps_info): New service.
- (cid_services): Updated.
-
- * src/type1/t1driver.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
- (t1_ps_get_font_info, t1_ps_has_glyph_names): New functions.
- (t1_service_ps_info): New service.
- (t1_services): Updated.
-
- * src/type42/t42drivr.c: Include FT_SERVICE_POSTSCRIPT_INFO_H.
- (t42_ps_get_font_info, t42_ps_has_glyph_names): New functions.
- (t42_service_ps_info): New service.
-
- * src/type42/t42objs.h: Don't include FT_INTERNAL_TYPE42_TYPES_H
- but t42types.h directly.
-
- * src/psnames/psmodule.c (psnames_interface, psnames_services):
- Renamed to...
- (pscmaps_interface, pscmaps_services): This.
- Updated all users.
-
-
- * src/gzip/infblock.c (inflate_blocks): Remove compiler warning.
-
-2003-10-22 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_encoding): Handle `/Encoding [ ... ]'.
-
- * src/type1/t1parse.c (T1_Get_Private_Dict): Test whether `eexec'
- is real.
-
- * src/type42/t42parse.c (t42_parse_encoding): Improve boundary
- checking while parsing.
-
- * docs/CHANGES: Updated.
-
-2003-10-21 Josselin Mouette <joss@debian.org>
-
- * include/freetype/internal/t1types.h (T1_FontRec): `paint_type'
- and `stroke_width' aren't pointers.
-
- * src/type42/t42objs.c (T42_Face_Done), src/type1/t1objs.c
- (T1_Face_Done): Don't free `paint_type' and `stroke_width'.
-
-2003-10-20 Graham Asher <graham.asher@btinternet.com>
-
- * src/winfonts/winfnt.c (fnt_cmap_class): Fix position of `const'.
-
-2003-10-19 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahhint.c (ah_hinter_load_glyph): Patch from
- 2003-08-18 introduced a severe bug (FT_Render_Glyph was called
- twice under some circumstances, causing strange results). This
- is fixed now by clearing the FT_LOAD_RENDER bit of `load_flags'.
-
- * src/base/ftpfr.c (FT_Get_PFR_Metrics): Initialize `error'.
- * src/psaux/psobjs.c (ps_tobytes): Initialize `n'.
- * src/type42/t42parse.c (t42_parse_sfnts): Initialize `string_size'.
-
-2003-10-16 Werner Lemberg <wl@gnu.org>
-
- Completely revised Type 42 parser. It now handles both fonts
- produced with ttftot42 (tested version 0.3.1) and
- TrueTypeToType42.ps (tested version May 2001; it is necessary to
- fix the broken header comment to be `%!PS-TrueTypeFont...').
-
- * src/type42/t42objs.c (T42_GlyphSlot_Load): Change fourth
- parameter to `FT_UInt'.
- * src/type42/t42objs.h: Updated.
-
- * src/type42/t42parse.h (T42_ParserRec): Change type of `in_memory'
- to FT_Bool.
- (T42_Loader): Change type of `num_chars' and `num_glyphs' to
- FT_UInt.
- Add `swap_table' element.
- * src/type42/t42parse.c (T42_KEYWORD_COUNT, T1_ToFixed,
- T1_ToCoordArray, T1_ToTokenArray): Removed.
- (T1_ToBytes): New macro.
- (t42_is_alpha, t42_hexval): Removed.
- (t42_is_space): Handle `\0'.
- (t42_parse_encoding): Updated to use new PostScript parser routines
- from psaux.
- Handle `/Encoding [ ... ]' also.
- (T42_Load_Status): New enumeration.
- (t42_parse_sfnts): Updated to use new PostScript parser routines
- from psaux.
- (t42_parse_charstrings): Updated to use new PostScript parser
- routines from psaux.
- Handle `/CharStrings << ... >>' also.
- Don't expect that /.notdef is the first element in dictionary. Copy
- code from type1 module to handle this.
- (t42_parse_dict): Updated to use new PostScript parser routines
- from psaux.
- Remove code for synthetic fonts (which can't occur in Type 42
- fonts).
- (t42_loader_done): Release `swap_table'.
-
- * src/psaux/psobjs.c (skip_string): Increase `cur' properly.
-
- * src/type1/t1load.c (parse_charstrings): Make test for `.notdef'
- faster.
-
-2003-10-15 Graham Asher <graham.asher@btinternet.com>
-
- * src/autohint/ahglobal.c (blue_chars), src/winfonts/winfnt.c
- (fnt_cmap_class_rec, fnt_cmap_class), src/bdf/bdflib.c (empty,
- _num_bdf_properties), src/gzip/infutil.c (inflate_mask),
- src/gzip/inffixed.h (fixed_bl, fixed_bd, fixed_tl, fixed_td),
- src/gzip/inftrees.h (inflate_trees_fixed), src/gzip/inftrees.c
- (inflate_trees_fixed): Decorate with more `const' to avoid
- writable global variables which are disallowed on ARM.
-
-2003-10-08 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_font_matrix, parse_charstrings): Remove
- code specially for synthetic fonts; this is handled elsewhere.
- (parse_encoding): Remove code specially for synthetic fonts; this is
- handled elsewhere.
- Improve boundary checking while parsing.
- (parse_dict): Improve boundary checking while parsing.
- Use ft_memcmp to simplify code.
-
-2003-10-07 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_subrs, parse_dict): Handle synthetic
- fonts properly.
- (parse_charstrings): Copy correct number of characters into
- `name_table'.
-
-2003-10-06 Werner Lemberg <wl@gnu.org>
-
- Heavy modification of the PS parser to handle comments and strings
- correctly. This doesn't slow down the loading of PS fonts
- significantly since charstrings aren't affected.
-
- * include/freetype/config/ftstdlib.h (ft_xdigit): Renamed to...
- (ft_isxdigit): This. Updated all callers.
- (ft_isdigit): New alias to `isdigit'.
-
- * include/freetype/internal/psaux.h (PS_Parser_FuncsRec): Renamed
- `skip_alpha' to `skip_PS_token'.
- Add parameter to `to_bytes' and change some argument types.
-
- * src/psaux/psauxmod.c (ps_parser_funcs): Updated.
- * src/psaux/psobjs.c (ft_char_table): New array to map character
- codes (ASCII and EBCDIC) of digits to numbers.
- (OP): New auxiliary macro holding either `>=' or `<' depending on
- the character encoding.
- (skip_comment): New function.
- (skip_spaces): Use it.
- (skip_alpha): Removed.
- (skip_literal_string, skip_string): New functions.
- (ps_parser_skip_PS_token): New function. This is a better
- replacement of...
- (ps_parser_skip_alpha): Removed.
- (ps_parser_to_token, ps_parser_to_token_array): Updated.
- (T1Radix): Rewritten, using `ft_char_table'.
- (t1_toint): Renamed to...
- (ps_toint): This. Update all callers.
- Use `ft_char_table'.
- (ps_tobytes): Add parameter to handle delimiters and change some
- argument types.
- Use `ft_char_table'.
- (t1_tofixed): Renamed to...
- (ps_tofixed): This. Update all callers.
- Use `ft_char_table'.
- (t1_tocoordarray): Renamed and updated to...
- (ps_tocoordarray): This. Update all callers.
- (t1_tofixedarray): Renamed and updated to...
- (ps_tofixedarray): This. Update all callers.
- (t1_tobool): Renamed to...
- (ps_tobool): This. Update all callers.
- (ps_parser_load_field): Updated.
- (ps_parser_load_field_table): Use `T1_MAX_TABLE_ELEMENTS'
- everywhere.
- (ps_parser_to_int, ps_parser_to_fixed, ps_parser_to_coord_array,
- ps_parser_to_fixed_array): Skip spaces. Updated.
- (ps_parser_to_bytes): Add parameter to handle delimiters and change
- some argument types. Updated.
- * src/psaux/psobjs.h: Updated.
-
- * src/cid/cidload.c (cid_parse_dict): Updated.
- * src/cid/cidparse.c (cid_parser_new): Check whether the `StartData'
- token was really found.
- * src/cid/cidparse.h (cid_parser_skip_alpha): Updated and renamed
- to...
- (cid_parser_skip_PS_token): This.
-
- * src/type1/t1parse.h (T1_ParserRec): Use `FT_Bool' for boolean
- fields.
- (T1_Skip_Alpha): Replaced with...
- (T1_Skip_PS_Token): This new macro.
- * src/type1/t1parse.c (hexa_value): Removed.
- (T1_Get_Private_Dict): Use `ft_isxdigit' and
- `psaux->ps_parser_funcs_to_bytes' for handling ASCII hexadecimal
- encoding.
- After decrypting, replace the four random bytes at the beginning
- with whitespace.
- * src/type1/t1load.c (t1_allocate_blend): Use proper error values.
- (parser_blend_design_positions, parse_blend_design_map,
- parse_weight_vector): Updated.
- (is_space): Handle `\f' also.
- (is_name_char): Removed.
- (read_binary_data): Updated.
- (parse_encoding): Use `ft_isdigit'.
- Updated.
- (parse_subrs): Updated.
- (TABLE_EXTEND): New macro.
- (parse_charstrings): Updated.
- Provide a workaround for buggy fonts which have more entries in the
- /CharStrings dictionary then expected; the function now adds some
- slots and skips entries which still exceed the new limit.
- (parse_dict): Updated.
- Terminate on the token `closefile'.
-
- * src/type42/t42parse.c (T1_Skip_Alpha): Replaced with...
- (T1_Skip_PS_Token): This new macro. Updated all callers.
- (t42_parse_encoding): Use `ft_isdigit'.
-
-
- * src/base/ftmm.c (ft_face_get_mm_service): Return FT_Err_Ok if
- success.
-
-2003-10-05 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftmodule.h: Renamed to...
- * include/freetype/ftmodapi.h: This to avoid duplicate file names.
- * include/freetype/config/ftheader.h (FT_MODULE_H): Updated.
-
-2003-10-04 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftoutln.c (FT_OrientationExtremumRec,
- FT_Outline_Get_Orientation): Trivial typo fixes to make it compile.
-
-2003-10-02 Markus F.X.J. Oberhumer <markus@oberhumer.com>
-
- * src/winfonts/winfnt.c (FT_WinFNT_HeaderRec): `color_table_offset'
- has four bytes, not two.
- Fix all users.
- (fnt_font_load, FNT_Load_Glyph): Add more font validity tests.
-
-2003-10-01 David Turner <david@freetype.org>
-
- * src/autofit/*: Adding first source files of the new multi-script
- `auto-fitter'.
-
- * include/freetype/ftoutln.h (FT_Orientation): New enumeration.
- (FT_Outline_Get_Orientation): New declaration.
-
- * src/base/ftoutln.c (FT_OrientationExtremumRec): New structure.
- (ft_orientation_extremum_compute): New auxiliary function.
- (FT_Outline_Get_Orientation): New function to compute the fill
- orientation of a given glyph outline.
-
- * include/freetype/internal/ftserv.h (FT_FACE_LOOKUP_SERVICE): Fixed
- trivial bug which could crash the font engine when a cached service
- pointer was retrieved.
-
-2003-09-30 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidload.c (cid_parse_dict): Skip token if no keyword is
- found.
-
- * src/type1/t1parse.c (IS_T1_WHITESPACE, IS_T1_LINESPACE,
- IS_T1_SPACE): Removed.
- (PFB_Tag): Removed.
- (read_pfb_tag): Don't use PFB_Tag.
-
- * src/type42/t42parse.c (t42_is_space): Handle `\f' also.
- (t42_parse_encoding): Handle synthetic fonts.
-
-2003-09-29 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/t1types.h: Don't include
- FT_INTERNAL_OBJECTS_H but FT_INTERNAL_SERVICE_H.
- * src/truetype/ttobjs.c: Don't include
- FT_SERVICE_POSTSCRIPT_NAMES_H.
-
-2003-09-29 David Turner <david@freetype.org>
-
- Added new service to handle glyph name dictionaries, replacing the
- old internal header named `psnames.h' by `services/svpsname.h'.
- Note that this is different from `services/svpostnm.h' which only
- handles the retrieval of PostScript font names for a given face.
- (Should we merge these two services into a single header?)
-
- * include/freetype/internal/psnames.h: Removed. Most of its
- contents is moved to...
- * include/freetype/internal/services/svpsname.h: New file.
-
- * include/freetype/internal/services/svpostnm.h
- (FT_SERVICE_ID_POSTSCRIPT_NAME): Replaced with...
- (FT_SERVICE_ID_POSTSCRIPT_FONT_NAME): New macro.
- (PsName): Service named changed to...
- (PsFontName): This.
- Updated `FT_Service_PsName' -> `FT_Service_PsFontName' and
- `POSTSCRIPT_NAME' -> `POSTSCRIPT_FONT_NAME' everywhere.
-
- * include/freetype/internal/internal.h
- (FT_INTERNAL_POSTSCRIPT_NAMES_H): Removed.
- * include/freetype/internal/psaux.h: Include
- FT_SERVICE_POSTSCRIPT_NAMES_H.
- (T1_DecoderRec): Updated type of `psnames'.
- * include/freetype/internal/t1types.h: Don't include
- FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
- Include FT_INTERNAL_OBJECTS_H.
- * include/freetype/internal/t42types.h: Don't include
- FT_INTERNAL_POSTSCRIPT_NAMES_H.
- * include/freetype/internal/tttypes.h (TT_FaceRec): Updated.
-
- * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE): Changed
- order of parameters. All callers updated.
- (FT_FACE_FIND_GLOBAL_SERVICE): New macro to look up a service
- globally, checking all modules.
- (FT_ServiceCacheRec): Updated.
- (FT_SERVICE_POSTSCRIPT_NAMES_H): New macro for accessing
- `svpsname.h'.
-
- * include/freetype/internal/ftobjs.h, src/base/ftobjs.c
- (ft_module_get_service): New function.
-
- * src/cff/cffdrivr.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
- but FT_SERVICE_POSTSCRIPT_NAMES_H.
- (cff_get_glyph_name, cff_get_name_index): Use new POSTSCRIPT_NAMES
- service.
- * src/cff/cffcmap.c (cff_cmap_unicode_init): Updated.
- * src/cff/cffload.c, src/cff/cffload.h: Don't include
- FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
- (cff_index_get_sid_string): Updated.
- * src/cff/cffobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
- but FT_SERVICE_POSTSCRIPT_NAMES_H.
- (cff_face_init): Use new POSTSCRIPT_NAMES service.
- * src/cff/cffobjs.h: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
- but FT_SERVICE_POSTSCRIPT_NAMES_H.
-
- * src/cid/cidobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
- but FT_SERVICE_POSTSCRIPT_NAMES_H.
- (cid_face_init): Use new POSTSCRIPT_NAMES service.
- * src/cid/cidriver.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H.
-
- * src/psaux/t1cmap.c (t1_cmap_std_init, t1_cmap_unicode_init): Use
- new POSTSCRIPT_NAMES service.
- * src/psaux/t1decode.h (t1_lookup_glyph_by_stdcharcode,
- t1_decode_init): Use new POSTSCRIPT_NAMES service.
- * src/psaux/t1cmap.h, src/psaux/t1decode.h: Don't include
- FT_INTERNAL_POSTSCRIPT_NAMES_H.
-
- * src/psnames/psmodule.c: Don't include
- FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
- (ps_build_unicode_table): Renamed to...
- (ps_unicodes_init): This.
- (ps_lookup_unicode): Renamed to...
- (ps_unicodes_char_index): This.
- (ps_next_unicode): Renamed to...
- (ps_unicodes_char_next): This.
- (psnames_interface): Updated.
- (psnames_services): New services list.
- (psnames_get_service): New function.
- (psnames_module_class): Updated.
-
- * src/sfnt/sfobjs.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
- but FT_SERVICE_POSTSCRIPT_NAMES_H.
- (sfnt_init_face): Use new POSTSCRIPT_NAMES service.
- * src/sfnt/ttpost.c: Don't include FT_INTERNAL_POSTSCRIPT_NAMES_H
- but FT_SERVICE_POSTSCRIPT_NAMES_H.
- (tt_face_get_ps_name): Updated.
-
- * src/truetype/ttobjs.c: Don't include
- FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
-
- * src/type1/t1driver.c: Don't include
- FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
- * src/type1/t1objs.c: Don't include
- FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
- (T1_Face_Init): Use new POSTSCRIPT_NAMES service.
-
- * src/type42/t42drivr.c (t42_get_ps_name): Renamed to...
- (t42_get_ps_font_name): This.
- (t42_service_ps_name): Renamed to...
- (t42_service_ps_font_name): This.
- (t42_services): Updated.
- * src/type42/t42objs.c (T42_Face_Init): Use new POSTSCRIPT_NAMES
- service.
- * src/type42/t42objs.h: Don't include
- FT_INTERNAL_POSTSCRIPT_NAMES_H but FT_SERVICE_POSTSCRIPT_NAMES_H.
-
-
- * src/base/ftglyph.c (FT_Get_Glyph): Don't access `slot' before
- testing its validity. Reported by Henry Maddocks
- <maddocks@metservice.com>.
-
-2003-09-21 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE):
- Fix compilation warning (s/pptr/Pptr/).
-
- * include/freetype/internal/internal.h (FT_INTERNAL_PFR_H,
- FT_INTERNAL_FNT_TYPES_H): Removed.
-
-2003-09-21 David Turner <david@freetype.org>
-
- Migrating the PFR and WINFNT drivers to the new service-based
- internal API.
-
- * include/freetype/internal/fnttypes.h: Removed. Most of its data
- are moved to winfnt.h and...
- * include/freetype/internal/services/svwinfnt.h: New file.
-
- * include/freetype/internal/pfr.h: Removed. Most of its data are
- moved to...
- * include/freetype/internal/services/svpfr.h: New file.
-
- * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
- FT_FACE_LOOKUP_SERVICE): Simplify fix of 2003-09-16 by removing
- pointer type argument.
- Updated all callers.
- Update macro names of services header files.
-
- * src/base/ftobjs.c (FT_Get_Name_Index): Simplified code.
-
- * src/base/ftpfr.c: Include FT_SERVICE_PFR_H instead of
- FT_INTERNAL_PFR_H.
- (ft_pfr_check, FT_Get_PFR_Metrics, FT_Get_PFR_Kerning,
- FT_Get_PFR_Advance): Use services provided in `PFR_METRICS'.
-
- * src/base/ftwinfnt.c: Include FT_SERVICE_WINFNT_H instead of
- FT_INTERNAL_FNT_TYPES_H.
- (FT_Get_WinFNT_Header): Use service provided in `WINFNT'.
-
- * src/pfr/pfrdrivr.c: Include FT_SERVICE_PFR_H and
- FT_SERVICE_XFREE86_NAME_H instead of FT_INTERNAL_PFR_H.
- (pfr_service_bdf): Updated.
- (pfr_services): New services list.
- (pfr_get_service): New function.
- (pfr_driver_class): Updated.
-
- * src/winfonts/winfnt.c: Include FT_SERVICE_WINFNT_H and
- FT_SERVICE_XFREE86_NAME_H instead of FT_INTERNAL_FNT_TYPES_H.
- (winfnt_get_header, winfnt_get_service): New functions.
- (winfnt_service_rec): New structure providing WINFNT services.
- (winfnt_services): New services list.
- (winfnt_driver_class): Updated.
- * src/winfonts/winfnt.h: Add most of the removed fnttypes.h data.
-
- * src/sfnt/sfdriver.c (sfnt_service_ps_name): Fix typo.
-
- * src/type1/t1driver.c (t1_service_ps_name): Fix typo.
-
- * src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrsbit.c,
- src/psaux/psobjs.c, src/sfnt/sfobjs.c, src/truetype/ttobjs.c,
- src/type1/t1objs.c, src/type42/t42objs.c: Removing various compiler
- warnings.
-
-2003-09-19 David Bevan <dbevan@emtex.com>
-
- * src/type1/t1parse.c (pfb_tag_fields): Removed.
- (read_pfb_tag): Fix code so that it doesn't fail on end-of-file
- indicator (0x8003).
- * docs/CHANGES: Updated.
-
-2003-09-16 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftserv.h (FT_FACE_FIND_SERVICE,
- FT_FACE_LOOKUP_SERVICE): Add parameter to pass pointer type.
- Ugly, I know, but this is needed for compilation with C++ --
- maybe someone knows a better solution?
- Updated all callers.
-
- * src/base/ftobjs.c (FT_Get_Name_Index, FT_Get_Glyph_Name): Remove
- C++ compiler warnings.
-
- * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property):
- Fix order of arguments passed to FT_FACE_FIND_SERVICE.
-
-2003-09-15 Werner Lemberg <wl@gnu.org>
-
- Avoid header files with identical names.
-
- * include/freetype/internal/services/bdf.h: Renamed to...
- * include/freetype/internal/services/svbdf.h: This.
- Add copyright notice.
- * include/freetype/internal/services/glyfdict.h: Renamed to...
- * include/freetype/internal/services/svgldict.h: This.
- Add copyright notice.
- * include/freetype/internal/services/multmast.h: Renamed to...
- * include/freetype/internal/services/svmm.h: This.
- Add copyright notice.
- Add FT_BEGIN_HEADER and FT_END_HEADER.
- * include/freetype/internal/services/sfnt.h: Renamed to...
- * include/freetype/internal/services/svsfnt.h: This.
- Add copyright notice.
- * include/freetype/internal/services/postname.h: Renamed to...
- * include/freetype/internal/services/svpostnm.h: This.
- Add copyright notice.
- * include/freetype/internal/services/xf86name.h: Renamed to...
- * include/freetype/internal/services/svxf86nm.h: This.
- Add copyright notice.
-
- * include/freetype/internal/ftserv.h: Add FT_BEGIN_HEADER and
- FT_END_HEADER.
- Add copyright notice.
- Update macro names of services header files.
-
- * builds/freetype.mk (SERVICES_DIR): New variable.
- (BASE_H): Add services header files.
-
-2003-09-11 Werner Lemberg <wl@gnu.org>
-
- * builds/toplevel.mk (distclean): Remove `builds/unix/freetype2.pc'.
-
- * src/cff/cffdrivr.c: Don't load headers twice.
-
- * include/freetype/internal/ftserv.h (FT_SERVICE_SFNT_H): New macro.
- * src/base/ftobjs.c: Include FT_SERVICE_SFNT_H.
-
- * src/cff/cffcmap.c: Include `cfferrs.h'.
- * src/pfr/pfrdrivr.c: Include `pfrerror.h'.
- * src/sfnt/sfdriver.c: Include `sferrors.h'.
- * src/psaux/psobjs.h: Add declaration for `ps_parser_to_bytes'.
-
-2003-09-11 David Turner <david@freetype.org>
-
- Introducing the concept of `module services'. This is the first
- step towards a massive simplification of the engine's internals, in
- order to get rid of various numbers of hacks.
-
- Note that these changes will break source & binary compatibility for
- authors of external font drivers.
-
- * include/freetype/config/ftconfig.h (FT_BEGIN_STMNT, FT_END_STMNT,
- FT_DUMMY_STMNT): New macros.
-
- * include/freetype/internal/ftserv.h: New file, containing the new
- structures and macros to provide `services'.
-
- * include/freetype/internal/internal.h (FT_INTERNAL_EXTENSION_H,
- FT_INTERNAL_EXTEND_H, FT_INTERNAL_HASH_H, FT_INTERNAL_OBJECT_H):
- Removed, obsolete.
- (FT_INTERNAL_SERVICE_H): New macro for `ftserv.h'.
-
- * include/freetype/internal/services/bdf.h,
- include/freetype/internal/services/glyfdict.h,
- include/freetype/internal/services/postname.h,
- include/freetype/internal/services/xf86name.h: New files.
-
- * include/freetype/ftmm.h (FT_Get_MM_Func, FT_Set_MM_Design_Func,
- FT_Set_MM_Blend_Func): Function pointers moved (in modified form)
- to...
- * include/freetype/internal/services/multmast.h: New file.
-
- * include/freetype/internal/sfnt.h (SFNT_Interface): `get_interface'
- is now of type `FT_Module_Requester'.
- (SFNT_Get_Interface_Func, SFNT_Load_Table_Func): Function pointers
- moved (in modified form) to...
- * include/freetype/internal/services/sfnt.h: New file.
-
- * include/freetype/tttables.h (FT_Get_Sfnt_Table_Func): Function
- pointer moved (in modified form) to `services/sfnt.h'.
-
- * include/freetype/ftmodule.h (FT_Module_Interface): Make it a
- a typedef to `FT_Pointer'.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Add
- `postscript_name'.
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove
- `postscript_name'.
- Add `services' element.
- (FT_LibraryRec): Remove `meta_class'.
-
- * src/base/ftbdf.c: Include FT_SERVICE_BDF_H.
- (test_font_type): Removed.
- (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Use services
- provided in `FT_SERVICE_ID_BDF'.
-
- * src/base/ftmm.c: Include FT_SERVICE_MULTIPLE_MASTERS_H.
- (ft_face_get_mm_service): New auxiliary function to get services
- from `FT_SERVICE_ID_MULTI_MASTERS'.
- (FT_Get_Multi_Master, FT_Set_MM_Design_Coordinates,
- FT_Set_MM_Blend_Coordinates): Use `ft_face_get_mm_service'.
-
- * src/base/ftobjs.c: Include FT_SERVICE_POSTSCRIPT_NAME_H and
- FT_SERVICE_GLYPH_DICT_H.
- (ft_service_list_lookup): New function to get a specific service.
- (destroy_face): Updated.
- (Mac_Read_POST_Resource): Simplify some code.
- (IsMacResource): Fix warnings.
- (FT_Get_Name_Index, FT_Get_Glyph_Name): Use services provided in
- `FT_SERVICE_ID_GLYPH_DICT'.
- (FT_Get_Postscript_Name): Use service provided in
- `FT_SERVICE_ID_POSTSCRIPT_NAME'.
- (FT_Get_Sfnt_Table, FT_Load_Sfnt_Table): Use services provided in
- `FT_SERVICE_ID_SFNT_TABLE'.
-
- * src/base/ftxf86.c: Include FT_SERVICE_XFREE86_NAME_H.
- (FT_Get_X11_Font_Format): Use service provided in
- `FT_SERVICE_ID_XF86_NAME'.
-
- * src/bdf/bdfdrivr.c: Include FT_SERVICE_BDF_H and
- FT_SERVICE_XFREE86_NAME_H.
- (bdf_get_charset_id): New function.
- (bdf_service_bdf): New structure providing BDF services.
- (bdf_services): New services list.
- (bdf_driver_requester): Use `ft_service_list_lookup'.
-
- * src/cff/cffdrivr.c: Include FT_SERVICE_XFREE86_NAME_H and
- FT_SERVICE_GLYPH_DICT_H.
- (cff_service_glyph_dict): New structure providing CFF services.
- (cff_services): New services list.
- (cff_get_interface): Use `ft_service_list_lookup'.
-
- * src/cid/cidriver.c: Include FT_SERVICE_POSTSCRIPT_NAME_H and
- FT_SERVICE_XFREE86_NAME_H.
- (cid_service_ps_name): New structure providing CID services.
- (cid_services): New services list.
- (cid_get_interface): Use `ft_service_list_lookup'.
-
- * src/pcf/pcfdrivr.c: Include FT_SERVICE_BDF_H and
- FT_SERVICE_XFREE86_NAME_H.
- (pcf_service_bdf): New structure providing PCF services.
- (pcf_services): New services list.
- (pcf_driver_requester): Use `ft_service_list_lookup'.
-
- * src/sfnt/sfdriver.c: Include FT_SERVICE_GLYPH_DICT_H and
- FT_SERVICE_POSTSCRIPT_NAME_H.
- (get_sfnt_glyph_name): Renamed to...
- (sfnt_get_glyph_name): This.
- (get_sfnt_postscript_name): Renamed to...
- (sfnt_get_ps_name): This.
- Updated.
- (sfnt_service_glyph_dict, sfnt_service_ps_name): New structures
- providing services.
- (sfnt_services): New services list.
- (sfnt_get_interface): Use `ft_service_list_lookup'.
-
- * src/truetype/ttdriver.c: Include FT_SERVICE_XFREE86_NAME_H.
- (tt_services): New services list.
- (tt_get_interface): Use `ft_service_list_lookup'.
-
- * src/type1/t1driver.c: Include FT_SERVICE_MULTIPLE_MASTERS_H,
- FT_SERVICE_GLYPH_DICT_H, FT_SERVICE_XFREE86_NAME_H, and
- FT_SERVICE_POSTSCRIPT_NAME_H.
- (t1_service_glyph_dict, t1_service_ps_name,
- t1_service_multi_masters): New structures providing Type 1 services.
- (t1_services): New services list.
- (Get_Interface): Use `ft_service_list_lookup'.
-
- * src/type42/t42drivr.c: Include FT_SERVICE_XFREE86_NAME_H,
- FT_SERVICE_GLYPH_DICT_H, and FT_SERVICE_POSTSCRIPT_NAME_H.
- (t42_service_glyph_dict, t42_service_ps_name): New structures
- providing Type 42 services.
- (t42_services): New services list.
- (T42_Get_Interface): Use `ft_service_list_lookup'.
-
-
- * README, docs/CHANGES: Updating version numbers for 2.1.6, and
- removing obsolete warnings in the documentation.
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6.
- * builds/unix/configure.ac (version_info): Set to 9:5:3.
- * builds/unix/configure: Regenerated.
-
- * include/freetype/internal/ftcore.h,
- include/freetype/internal/ftexcept.h,
- include/freetype/internal/fthash.h,
- include/freetype/internal/ftobject.h: Removed. Obsolete.
-
-2003-09-09 David Turner <david@freetype.org>
-
- Fixing PFR kerning support. The tables within the font file contain
- (charcode,charcode) kerning pairs, we need to convert them to
- (gindex,gindex).
-
- * src/base/ftpfr.c (ft_pfr_check): Fix serious typo.
- * src/pfr/pfrload.c: Remove dead code.
- (pfr_get_gindex, pfr_compare_kern_pairs, pfr_sort_kerning_pairs):
- New functions.
- (pfr_phy_font_done): Free `kern_pairs'.
- (pfr_phy_font_load): Call `pfr_sort_kerning_pairs'.
- * src/pfr/pfrobjs.c (pfr_face_get_kerning): Fix kerning extraction.
- * src/pfr/pfrtypes.h (PFR_KERN_PAIR_INDEX): New macro.
- (PFR_KernPairRec): Make `kerning' an FT_Int.
- (PFR_PhyFontRec): New element `kern_pairs'.
- (PFR_KernFlags): Values of PFR_KERN_2BYTE_CHAR and
- PFR_KERN_2BYTE_ADJ were erroneously reversed.
-
- * include/freetype/ftoption.h: Commenting out the macro
- TT_CONFIG_OPTION_BYTECODE_INTERPRETER.
-
-2003-09-02 David Turner <david@freetype.org>
-
-
- * Version 2.1.5 released.
- =========================
-
-
-2003-08-31 Manish Singh <yosh@gimp.org>
-
- * src/bdf/bdflib.c (_bdf_readstream): Don't use FT_MEM_COPY but
- FT_MEM_MOVE.
-
-2003-08-30 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FT_ENCODING_SJIS, FT_ENCODING_GB2312,
- FT_ENCODING_BIG5, FT_ENCODING_WANSUNG, FT_ENCODING_JOHAB): New
- enumerations of FT_Encoding. The FT_ENCODING_MS_* variants except
- FT_ENCODING_MS_SYMBOL are now deprecated.
- Updated all users.
- * docs/CHANGES: Document it.
-
-2003-08-27 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Accept lowercase characters
- for spacing.
-
-2003-08-27 Mike FABIAN <mfabian@suse.de>
-
- * src/pcf/pcfread.c (pcf_load_font), src/bdf/bdfdrivr.c
- (BDF_Face_Init): Accept lowercase characters for slant and weight.
-
-2003-08-18 David Turner <david@freetype.org>
-
- * include/freetype/config/ftoption.h: Disabling TrueType bytecode
- interpreter until the UNPATENTED_HINTING works as advertised.
-
- * src/autohint/ahhint.c (ah_hinter_load_glyph): Use `|' for
- setting `load_flags'.
-
- * Jamfile: Adding the `refdoc' target to the Jamfile in order to
- build the API Reference in `docs/reference' automatically.
-
- * include/freetype/t1tables.h (PS_FontInfoRec), src/cid/cidtoken.h,
- src/type1/t1tokens.h, src/type42/t42parse.c: Resetting the types of
- `italic_angle', `underline_position', and `underline_thickness' to
- their previous values (i.e., long, short, and ushort) in order to
- avoid breaking binary compatibility.
-
- * include/freetype/ttunpat.h: Fixing documentation comment.
-
- * include/freetype/config/ftoption.h, devel/ftoption.h
- (TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING): Replaced with...
- (TT_CONFIG_OPTION_UNPATENTED_HINTING): This. Updated all users.
- (TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING): Removed.
-
- * include/freetype/internal/ftobjs.h (FT_DEBUG_HOOK_TYPE1): Removed.
- (FT_DEBUG_HOOK_UNPATENTED_HINTING): New macro. Use this with
- `FT_Set_Debug_Hook' to get the same effect as the removed
- TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING.
-
- * src/truetype/ttobjs.c (tt_face_init): Use
- `FT_DEBUG_HOOK_UNPATENTED_HINTING'.
-
-2003-08-06 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1gload.c (T1_Load_Glyph), src/cff/cffgload.c
- (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph): Fix
- previous change.
-
-2003-08-05 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1gload.c (T1_Load_Glyph), src/cff/cffgload.c
- (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph): Apply
- font matrix to advance width also.
- * docs/CHANGES: Updated.
-
-2003-07-26 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.ac (version_info): Set to 9:4:3.
- * builds/unix/configure: Updated.
- * docs/CHANGES, docs/VERSION.DLL: Updated.
-
- * include/freetype/freetype.h (FT_GlyphSlot): Change 2003-06-16
- also breaks binary compatibility. Reintroduce an unsigned integer
- at the old position of `flags' called `reserved'.
-
-2003-07-25 Werner Lemberg <wl@gnu.org>
-
- Make API reference valid HTML 4.01 transitional.
-
- * src/tools/docmaker/tohtml.py (html_header_1): Add doctype
- and charset.
- (html_header_2): Fix style elements and add some more.
- Fix syntax.
- (block_header, block_footer, description_header, description_footer,
- marker_header, marker_footer, source_header, source_footer,
- chapter_header): Don't use <center>...</center> but `align=center'
- table attribute.
- (chapter_inter, chapter_footer): Add <li> and use special <ul>
- class.
- Use double quotes around table widths given in percent.
- (keyword_prefix, keyword_suffix): Don't change font color directly
- but use a new <span> class.
- (section_synopsis_header, section_synopsis_footer): Don't change
- color.
- (code_header, code_footer): Don't change font color directly but
- use a special <pre> class.
- (print_html_field): <tr> gets the `valign' attribute, not <table>.
- (print_html_field_list): Ditto.
- (index_exit): Don't use <center>...</center> but `align=center'
- table attribute.
- (section_enter): Ditto.
- (toc_exit): Don't emit </table>.
- (block_enter): Use <h4><a>, not <a><h4>.
- (__init__): Fix tag order in self.html_footer.
-
-2003-07-25 David Turner <david@freetype.org>
-
- This change reimplements fix from 2003-05-30 without breaking
- binary compatibility.
-
- * include/freetype/t1tables.h (PS_FontInfoRec): `italic_angle',
- `is_fixed_pitch', `underline_position', `underline_thickness' are
- reverted to be normal values.
-
- * include/freetype/internal/psaux.h (T1_FieldType): Remove
- `T1_FIELD_TYPE_BOOL_P', `T1_FIELD_TYPE_INTEGER_P',
- `T1_FIELD_TYPE_FIXED_P', `T1_FIELD_TYPE_FIXED_1000_P'.
- (T1_FIELD_TYPE_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P,
- T1_FIELD_FIXED_1000_P): Removed.
- (T1_FIELD_TYPE_BOOL): Renamed to...
- (T1_FIELD_BOOL): New macro. Updated all callers.
-
- * src/type42/t42parse.c: `italic_angle', `is_fixed_pitch',
- `underline_position', `underline_thickness', `paint_type',
- `stroke_width' are reverted to be normal values.
- (T42_KEYWORD_COUNT): New macro.
- (t42_parse_dict): New array `keyword_flags' to mark that a value has
- already been assigned to a dictionary entry.
- * src/type42/t42objs.c (T42_Face_Init, T42_Face_Done): Updated.
-
- * src/cid/cidtoken.h: `italic_angle', `is_fixed_pitch',
- `underline_position', `underline_thickness' are reverted to be
- normal values.
- * src/cid/cidobjs.c (cid_face_done, cid_face_init): Updated.
-
- * src/psaux/psobjs.c (ps_parser_load_field): Updated.
-
- * src/type1/t1tokens.h: `italic_angle', `is_fixed_pitch',
- `underline_position', `underline_thickness', `paint_type',
- `stroke_width' are reverted to be normal values.
- * src/type1/t1objs.c (T1_Face_Done, T1_Face_Init): Updated.
- * src/type1/t1load.c (T1_FIELD_COUNT): New macro.
- (parse_dict): Add parameter for keyword flags.
- Record only first instance of a field.
- (T1_Open_Face): New array `keyword_flags'.
-
-2003-07-24 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
- * builds/unix/configure.ac (version_info): Set to 10:0:3.
- * builds/unix/configure: Updated.
- * builds/freetype.mk (refdoc): Fix --title.
-
- * docs/CHANGES, docs/VERSION.DLL, README: Updated.
-
- * src/tools/docmaker/sources.py (re_crossref): Fix regular
- expression to handle trailing punctuation characters.
- * src/tools/docmaker/tohtml.py (make_html_word): Updated.
-
- * docs/release: New file.
-
-2003-07-23 YAMANO-UCHI Hidetoshi <mer@din.or.jp>
-
- * include/freetype/internal/psaux.h (PS_Parser_FuncsRec): New
- member function `to_bytes'.
-
- * src/psaux/psauxmod.c (ps_parser_funcs): New member
- `ps_parser_to_bytes'.
- (psaux_module_class): Increase version to 0x20000L.
-
- * src/psaux/psobjs.c (IS_T1_LINESPACE): Add \f.
- (IS_T1_NULLSPACE): New macro.
- (IS_T1_SPACE): Add it.
- (skip_spaces, skip_alpha): New functions.
- (ps_parser_skip_spaces, ps_parser_skip_alpha): Use them.
- (ps_tobytes, ps_parser_to_bytes): New functions.
-
-2003-07-07 Werner Lemberg <wl@gnu.org>
-
- * builds/freetype.mk (DOC_DIR): New variable.
- (refdoc): Use *_DIR variables.
- (distclean): Remove documentation files.
-
- * builds/detect.mk (std_setup, dos_setup): Mention `make refdoc'.
-
- * configure: Set DOC_DIR variable.
-
-2003-07-07 Patrik Hägglund <patrik.hagglund@bredband.net>
-
- * builds/freetype.mk (refdoc): New target to build the
- documentation.
- (.PHONY): Updated.
-
- * include/freetype/freetype.h: Improve documentation of FT_CharMap.
- * include/freetype/ftimage,h: Fix documentation of FT_OUTLINE_FLAGS.
- * include/freetype/tttables.h: Document FT_Sfnt_Tag.
-
-2003-07-06 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfread.c
- (pcf_load_font): Fix computation of height if PIXEL_SIZE property is
- missing.
-
-2003-07-01 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftcsbits.c (ftc_sbit_node_compare): Only add `size' if
- there is no error. Reported by Knut St. Osmundsen
- <bird-freetype@anduin.net>.
-
-2003-06-30 Werner Lemberg <wl@gnu.org>
-
- A new try to synchronize bitmap font access.
-
- * include/freetype/freetype.h (FT_Bitmap_Size): `height' is now
- defined to return the baseline-to-baseline distance. This was
- already the value returned by the BDF and PCF drivers.
-
- The `width' field now gives the average width. I wasn't able to
- find something better. It should be taken as informative only.
-
- New fields `size', `x_ppem', and `y_ppem'.
-
- * src/pcf/pcfread.c (pcf_load_font): Updated to properly fill
- FT_Bitmap_Size.
- Do proper rounding and conversion from 72.27 to 72 points.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Updated to properly fill
- FT_Bitmap_Size.
- Do proper rounding and conversion from 72.27 to 72 points.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Updated to properly fill
- FT_Bitmap_Size.
-
- * src/winfonts/winfnt.c (FNT_Face_Init): Updated to properly fill
- FT_Bitmap_Size.
-
-2003-06-29 Werner Lemberg <wl@gnu.org>
-
- Redesigning the FNT driver to return multiple faces, not multiple
- strikes. At least one font (app850.fon from WinME) contains
- different FNT charmaps for its subfonts. Consequently, the previous
- design of having multiple bitmap strikes in a single font face fails
- since we have only one charmap per face.
-
- * include/freetype/internal/fnttypes.h (FNT_Size_Rec): Removed.
- (FNT_FaceRec): Remove `num_fonts' field and replace `fonts' with
- `font'.
-
- * src/base/ftwinfnt.c (FT_Get_WinFNT_Header): Updated.
-
- * src/winfonts/winfnt.c (fnt_font_load): Don't set pixel_width equal
- to pixel_height.
- (fnt_face_done_fonts): Removed.
- (fnt_face_get_dll_fonts): Renamed to...
- (fnt_face_get_dll_font): This. Add second function argument to
- select face index.
- Updated to load just one subfont.
- (fnt_font_done, FNT_Face_Done): Updated.
- (FNT_Face_Init): Handle `face_index'.
- Updated.
- (FNT_Size_Set_Pixels): Simplified; similar to BDF and PCF, the
- bitmap width is now ignored.
- (FNT_Load_Glyph): Updated.
- Fix glyph index computation.
- (winfnt_driver_class): Updated.
-
-2003-06-25 Owen Taylor <otaylor@redhat.com>
-
- * src/sfnt/ttload.c (tt_face_load_hdmx): Don't assign
- num_records until we actually decide to load the table,
- otherwise, we'll segfault in tt_face_free_hdmx.
-
-2003-06-24 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffdrivr.c (cff_get_glyph_name): Protect against zero
- glyph name pointer. Reported by Mikey Anbary <manbary@vizrt.com>.
-
-2003-06-23 Werner Lemberg <wl@gnu.org>
-
- * src/tools/glnames.py: Updated to AGL 2.0.
- * src/psnames/pstables.h: Regenerated.
-
-2003-06-22 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/cache/ftcglyph.h, include/freetype/ttnameid.h,
- src/base/ftcalc.c, src/base/fttrigon.c, src/cff/cffgload.c,
- src/otlayout/otlgsub.c, src/pshinter/pshrec.c,
- src/psnames/psmodule.c, src/sfnt/sfobjs.c, src/truetype/ttdriver.c:
- Decorate constants with `U' and `L' if appropriate.
-
- * include/freetype/ftmoderr.h: Updated to include recent module
- additions.
-
- * src/pshinter/pshnterr.h (FT_ERR_BASE): Define as
- `FT_Mod_Err_PShinter'.
- * src/type42/t42error.h (FT_ERR_BASE): Define as
- `FT_Mod_Err_Type42'.
-
- * src/pshinter/pshrec.h (PS_HINTS_MAGIC): Removed. Not used.
-
- * include/freetype/config/ftconfig.h [__MWERKS__]: Define FT_LONG64
- and FT_INT64.
-
-2003-06-21 Werner Lemberg <wl@gnu.org>
-
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Use first_char in
- computation of glyph_index.
- (FNT_Size_Set_Pixels): To find a strike, first check pixel_height
- only, then try to find a better hit by comparing pixel_width also.
- Without this fix it isn't possible to access all strikes.
- Also compute metrics.max_advance to be in sync with other bitmap
- drivers.
-
- * src/base/ftobjs.c (FT_Set_Char_Size): Remove redundant code.
- (FT_Set_Pixel_Sizes): Assign value to `metrics' after validation of
- arguments.
-
-2003-06-20 Werner Lemberg <wl@gnu.org>
-
- Synchronize computation of height and width for bitmap strikes. The
- `width' field in the FT_Bitmap_Size structure is now only useful to
- enumerate different strikes. The `max_advance' field of the
- FT_Size_Metrics structure should be used to get the (maximum) width
- of a strike.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Don't use AVERAGE_WIDTH for
- computing `available_sizes->width' but make it always equal to
- `available_sizes->height'.
-
- * src/pcf/pcfread.c (pcf_load_font): Don't use RESOLUTION_X for
- computing `available_sizes->width' but make it always equal to
- `available_sizes->height'.
-
- * src/truetype/ttdriver.c (Set_Pixel_Sizes): Pass only single
- argument to function.
-
- * src/psnames/psmodule.c (ps_unicode_value): Handle `.' after
- `uniXXXX' and `uXXXX[X[X]]'.
-
-2003-06-19 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdfdrivr.c: s/FT_Err_/BDF_Err/.
- * src/cache/ftccache.c, src/cache/ftcsbits.c, src/cache/ftlru.c:
- s/FT_Err_/FTC_Err_/.
- * src/cff/cffcmap.c: s/FT_Err_/CFF_Err_/.
- * src/pcf/pcfdrivr.c: s/FT_Err_/PCF_Err_/.
- * src/psaux/t1cmap.c: Include psauxerr.h.
- s/FT_Err_/PSaux_Err_/.
- * src/pshinter/pshnterr.h: New file.
- * src/pshinter/rules.mk: Updated.
- * src/pshinter/pshalgo.c, src/pshinter/pshrec.c: Include pshnterr.h.
- s/FT_Err_/PSH_Err_/.
- * src/pfr/pfrdrivr.c, src/pfr/pfrobjs.c, src/pfr/pfrsbit.c:
- s/FT_Err_/PFR_Err_/.
- * src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
- src/sfnt/ttload.c: s/FT_Err_/SFNT_Err_/.
- * src/truetype/ttgload.c: s/FT_Err_/TT_Err_/.
- * src/gzip/ftgzip.c: Load FT_MODULE_ERRORS_H and define
- FT_ERR_PREFIX and FT_ERR_BASE.
- s/FT_Err_/Gzip_Err_/.
-
-2003-06-19 Dirck Blaskey <listtarget@danbala.com>
-
- * src/cff/cffload (cff_encoding_load): `nleft' must be FT_UInt,
- otherwise adding 1 might wrap the result.
-
-2003-06-18 Werner Lemberg <wl@gnu.org>
-
- * src/psnames/psmodule.c (ps_unicode_value): Add support to
- recognize `uXXXX[X[X]]' glyph names.
- Don't handle glyph names starting with `uni' which have more than
- four digits.
-
-2003-06-16 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FT_Open_Flags): Replaced with
- #defines for the constants.
- (FT_Open_Args): Change type of `flags' to FT_UInt.
- (FT_GlyphSlot): Move `flags' to FT_Slot_Internal.
-
- * include/freetype/ftimage.h (FT_Outline_Flags, FT_Raster_Flag):
- Replaced with #defines for the constants.
-
- * include/freetype/internal/ftobjs.h (FT_Slot_Internal): New
- field `flags' (from FT_GlyphSlot).
- Updated all affected source files.
- (FT_GLYPH_OWN_BITMAP): New macro (from ftgloadr.h).
-
- * include/freetype/internal/ftgloadr.h (FT_GLYPH_OWN_BITMAP): Moved
- to ftobjs.h.
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Use dummy
- FT_GlyphSlot_Internal object.
-
-2003-06-15 Werner Lemberg <wl@gnu.org>
-
- * builds/compiler/gcc.mk, builds/compiler/gcc-dev.mk (CFLAGS):
- Add -fno-strict-aliasing to get rid of zillion warnings from gcc
- version 3.3.
-
-2003-06-14 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftglyph.h (ft_glyph_bbox_unscaled,
- ft_glyph_bbox_subpixels, ft_glyph_bbox_gridfit,
- ft_glyph_bbox_truncate, ft_glyph_bbox_pixels): Replaced with
- FT_GLYPH_BBOX_UNSCALED, FT_GLYPH_BBOX_SUBPIXELS,
- FT_GLYPH_BBOX_GRIDFIT, FT_GLYPH_BBOX_TRUNCATE, FT_GLYPH_BBOX_PIXELS.
- The lowercase variants are now (deprecated aliases) to the uppercase
- versions.
- Updated all other files.
-
- * include/freetype/ftmodule.h (ft_module_font_driver,
- ft_module_renderer, ft_module_hinter, ft_module_styler,
- ft_module_driver_scalable, ft_module_driver_no_outlines,
- ft_module_driver_has_hinter): Replaced with FT_MODULE_FONT_DRIVER,
- FT_MODULE_RENDERER, FT_MODULE_HINTER, FT_MODULE_STYLER,
- FT_MODULE_DRIVER_SCALABLE, FT_MODULE_DRIVER_NO_OUTLINES,
- FT_MODULE_DRIVER_HAS_HINTER.
- The lowercase variants are now (deprecated aliases) to the uppercase
- versions.
- Updated all other files.
-
- * src/base/ftglyph.c (FT_Glyph_Get_CBox): Handle bbox_mode better
- as enumeration.
-
- * src/pcf/pcfdrivr.c (pcf_driver_class), src/winfonts/winfnt.c
- (winfnt_driver_class), src/bdf/bdfdrivr.c (bdf_driver_class): Add
- the FT_MODULE_DRIVER_NO_OUTLINES flag.
-
-2003-06-13 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/pfr/pfrobjs.c (pfr_slot_load): Apply font matrix.
-
-2003-06-13 Werner Lemberg <wl@gnu.org>
-
- * builds/dos/detect.mk: Test not only for `Dos' but for `DOS' also.
-
- * builds/dos/dos-emx.mk, builds/compiler/emx.mk: New files for
- EMX gcc compiler.
- * builds/dos/detect.mk: Add target `emx'.
-
- * builds/compiler/watcom.mk (LINK_LIBRARY): GNU Make for DOS doesn't
- like a trailing semicolon; add a dummy command.
-
- * src/cid/cidload.c: Remove parse_font_bbox code (already enclosed
- with #if 0 ... #endif).
-
- * src/type1/t1tokens.h: Handle /FontName.
- * src/type1/t1load.c (parse_font_name): Removed.
- Remove parse_font_bbox code (already enclosed with #if 0 ...
- #endif).
-
- * src/type42/t42parse.c (t42_parse_font_name): Removed.
- Remove t42_parse_font_bbox code (already enclosed with #if 0 ...
- #endif).
- (t42_keywords): Handle /FontName with T1_FIELD_KEY.
-
-2003-06-12 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/psaux.h (T1_FieldType): Add
- T1_FIELD_TYPE_KEY.
- (T1_FIELD_KEY): New macro.
- * src/psaux/psobjs.c (ps_parser_load_field): Handle
- T1_FIELD_TYPE_KEY.
-
- * src/cid/cidtoken.h: Use T1_FIELD_KEY for /CIDFontName.
-
-2003-06-11 Alexander Malmberg <alexander@malmberg.org>
-
- * src/cache/ftlru.c (FT_LruList_Remove_Selection): Decrease
- number of nodes.
- (FT_LruList_Lookup): Fix assertion for out-of-memory case.
-
-2003-06-11 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidload.c (cid_decrypt): Removed.
- (cid_read_subrs): Use t1_decrypt from psaux module.
- * src/cid/cidload.h: Updated.
- * src/cid/cidgload.c (cid_load_glyph): Use t1_decrypt from psaux
- module.
-
-2003-06-10 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidobjs.c: Apply change 2003-05-31 from <Ron.Dev@gmx.de>.
- Compute style flags.
- Fix computation of root->height.
- * src/cid/cidtoken.h: Handle FontBBox.
- * src/cid/cidload.c (cid_load_keyword): Handle
- T1_FIELD_LOCATION_BBOX.
- (parse_font_bbox): Commented out.
- (cid_field_records): Comment out element for parsing FontBBox.
-
- * src/type42/t42parse.c (t42_parse_font_bbox): Commented out.
- (t42_keywords): Handle FontBBox with T1_FIELD_BBOX, not with
- T1_FIELD_CALLBACK.
- (t42_parse_font_bbox): Commented out.
- (t42_load_keyword): Handle T1_FIELD_LOCATION_BBOX.
- * src/type42/t42objs.c (T42_Face_Init): Apply change 2003-05-31
- from <Ron.Dev@gmx.de>.
-
-2003-06-09 George Williams <gww@silcom.com>
-
- * src/truetype/ttinterp.c (SetSuperRound) <0x30>: Follow Apple's
- TrueType specification.
- (Ins_MDRP, Ins_MIRP): Fix single width cut-in test.
-
-2003-06-09 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/gzip/ftgzip.c: (inflate_mask): Replaced with...
- (NO_INFLATE_MASK): This.
- * src/gzip/infutil.h: Declare `inflate_mask' conditionally by
- NO_INFLATE_MASK.
-
-2003-06-09 Alexis S. L. Carvalho <alexis@cecm.usp.br>
-
- * src/gzip/ftgzip.c (ft_gzip_file_fill_output): Handle Z_STREAM_END
- correctly.
-
-2003-06-09 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * src/pshinter/pshglob.c (psh_globals_new): Change calculation of
- dim->stdw.count to avoid compiler problem.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Move the block
- variables to the beginning of the function to avoid compiler
- problems.
- Add casts necessary for 16bit compilers.
-
-2003-06-09 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/rules.mk (PFR_DRV_SRC): Add pfrsbit.c.
- (PFR_DRV_H): Add pfrtypes.h.
-
- * include/freetype/config/ftconfig.h: s/__MWKS__/__MWERKS__/.
-
-2003-06-08 Karl Schultz <kschultz@rsinc.com>
-
- * src/pfr/pfrsbit.c (pfr_bitwriter_init): Change type of third
- argument to FT_Bool.
- (pfr_lookup_bitmap_data): Change type of third and fourth argument
- to FT_UInt. Updated caller.
- (pfr_load_bitmap_bits): Change type of fourth argument to FT_Bool.
-
-2003-06-08 Werner Lemberg <wl@gnu.org>
-
- Completely revised FreeType's make management.
-
- . In all makefiles `/' is used as the path separator. The
- conversion to the real path separators is done as late as
- possible using $(subst ...).
-
- . $(HOSTSEP) no longer exists. Now, $(SEP) gives the path separator
- for the operating system, and the new $(COMPILER_SEP) the path
- separator for the compiler tools.
-
- . $(BUILD) has been renamed to $(BUILD_DIR). In general, all
- directory variables end with `_DIR'. The variants ending in `_'
- (like `BASE_' have been removed).
-
- The following ChangeLog entries only describe changes which are
- not related to the redesign.
-
- * builds/beos/beos-def.mk (BUILD_DIR): Fix typo.
- * builds/compiler/watcom.mk (LINK_LIBRARY): Fix linker call to avoid
- overlong arguments as suggested by J. Ali Harlow
- <ali@avrc.city.ac.uk>.
- * builds/dos/dos-wat.mk: New file.
- * builds/freetype.mk (FREETYPE_H): Include header files from the
- `devel' subdirectory.
-
- * builds/os2/os2-dev.mk, builds/unix/unixddef.mk,
- builds/unix/unixddef.mk, builds/win32/w32-bccd.mk,
- builds/win32/w32-dev.mk (BUILD_DIR): Fix path.
-
- * builds/unix/configure.ac, builds/unix/configure: Updated.
- * builds/unix/unix-def.in (DISTCLEAN): Add `freetype2.pc'.
-
-2003-06-07 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftmac.c (FT_New_Face_From_SFNT): s/rlen/sfnt_size/ to
- make it compile.
-
- * devel/ftoption.h: Updated.
-
-2003-06-07 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * include/freetype/internal/psaux.h, src/truetype/ttgload.h:
- s/index/idx/ to fix compiler warnings.
-
- * src/sfnt/ttcmap0.c (tt_face_build_cmaps): Use more `volatile' to
- fix compiler warning.
-
- * src/gzip/ftgzip.c (BUILDFIXED): Removed.
- * src/gzip/inftrees.c (inflate_trees_fixed) [!BUILDFIXED]: Use
- FT_UNUSED to remove compiler warning.
-
-2003-06-06 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftstroker.h: Renamed to...
- * include/freetype/ftstroke.h: This.
-
- * src/base/ftstroker.c: Renamed to...
- * src/base/ftstroke.c: This.
-
- * include/freetype/config/ftheader.h (FT_STROKER_H): Updated.
-
- * src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk:
- Updated.
-
- * src/pcf/pcfdriver.c: Renamed to...
- * src/pcf/pcfdrivr.c: This.
- * src/pcf/pcfdriver.h: Renamed to...
- * src/pcf/pcfdrivr.h: This.
-
- * src/pcf/Jamfile, src/pcf/rules.mk: Updated.
-
-2003-06-05 Wenlin Institute (Tom Bishop) <wenlin@wenlin.com>
-
- * src/base/ftmac.c (file_spec_from_path) [TARGET_API_MAC_CARBON]:
- Add `#if !defined(__MWERKS__)'.
-
-2003-06-05 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/psaux.h (T1_FieldType): Add
- T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.
- (T1_FIELD_FIXED_1000, T1_FIELD_FIXED_1000_P): New macros.
- * src/psaux/psobjs.c (ps_parser_load_field): Handle
- T1_FIELD_TYPE_FIXED_1000 and T1_FIELD_TYPE_FIXED_1000_P.
-
- * src/cff/cffparse.c (cff_kind_fixed_thousand): New enumeration.
- (CFF_FIELD_FIXED_1000): New macro.
- (cff_parser_run): Handle cff_kind_fixed_thousand.
- * src/cff/cfftoken.h: Use CFF_FIELD_FIXED_1000 for blue_scale.
- * src/cff/cffload (cff_subfont_load): Fix default values of
- expansion_factor and blue_scale.
-
- * src/cid/cidtoken.h, src/type1/t1tokens.h: Use T1_FIELD_FIXED_1000
- for blue_scale.
-
- * src/pshinter/pshglob.c (psh_globals_new): Fix default value of
- blue_scale.
-
-2003-06-04 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * include/freetype/internal/ftdriver.h,
- include/freetype/internal/ftobjs.h,
- include/freetype/internal/psaux.h, src/cid/cidgload.c,
- src/psaux/psobjs.c, src/psaux/t1decode.c, src/psaux/psobjs.h,
- src/pshinter/pshrec.c, src/pshinter/pshalgo.c,
- src/psnames/psmodule.c, src/raster/ftraster.c, src/sfnt/sfobjs.c,
- src/smooth/ftgrays.c, src/smooth/ftsmooth.c, src/truetype/ttobjs.c,
- src/truetype/ttdriver.c, src/truetype/ttgload.c, src/type1/t1afm.c,
- src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1load.c,
- src/type1/t1objs.c, src/type42/t42parse.c, src/type42/t42parse.h:
- Many casts and slight argument type changes to make it work with
- a 16bit compiler.
-
-2003-06-04 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftoption.h: Defining
- TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING by default is a bad idea
- since some fonts (e.g. Arial) produce worse results than without
- hinting. Reverted.
-
-2003-06-04 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph)
- [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Call
- FT_GlyphLoader_CheckPoints before adding phantom points. This fixes
- a segfault bug with fonts (e.g. htst3.ttf) which have nested
- subglyphs more than one level deep. Reported by Anthony Fok.
-
- * include/freetype/config/ftoption.h: Define
- TT_CONFIG_OPTION_BYTECODE_INTERPRETER,
- TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING, and
- TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING to make it the new
- default.
-
-2003-06-03 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahhint.c (ah_hinter_hint_edges): Removed. Just a
- wrapper for ah_hint_edges.
- (ah_hint_edges): Renamed to...
- (ah_hinter_hint_edges): This.
-
- * src/base/ftobjs.c (FT_Set_Hint_Flags): Removed. Unused.
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec),
- include/freetype/internal/psaux.h (T1_DecoderRec),
- src/cff/cffgload.h (CFF_Builder): Remove `hint_flags' field.
- Unused.
-
- * src/cff/cffgload.c (cff_builder_init): Updated.
- (cff_decoder_parse_charstrings) <cff_op_endchar>: Call hinter->apply
- with decoder->hint_mode instead of builder->hint_flags.
- * src/psaux/t1decode.c (t1_decoder_init): Updated.
-
- * src/base/ftstroker.c (ft_stroke_border_export): s/index/idx/.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Commented out code which
- increased root->height by 15% if the line gap was zero. There exist
- fonts (containing e.g. form drawing characters) which intentionally
- have a zero line gap value.
-
- * src/truetype/ttinterp.c (Free_Project, CUR_Func_freeProj):
- Removed. Unused.
- Updated all callers.
-
-2003-06-02 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): Use symbolic names for
- Adobe specific encoding IDs (there was a wrong EID value for custom
- encoding).
-
- * src/cff/cffcmap.h (CFF_CMapStdRec): Remove `count'.
- * src/cff/cffcmap.c (cff_cmap_encoding_init,
- cff_cmap_encoding_done): Updated.
- (cff_cmap_encoding_char_index, cff_cmap_encoding_char_next): Use
- 256 as limit for character code.
-
-2003-06-01 Werner Lemberg <wl@gnu.org>
-
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Revert change from
- 2003-03-20.
-
-2003-05-31 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/fttrigon.h (FT_Vector_Normalize): Removed.
-
-2003-05-31 <Ron.Dev@gmx.de>
-
- * src/type1/t1objs.c (T1_Face_Init): Improve algorithm for guessing
- the font style by ignoring spaces and hyphens.
-
- * builds/unix/freetype2.in: Fix `Version' field.
-
-2003-05-30 Werner Lemberg <wl@gnu.org>
-
- Avoid overwriting of numeric font dictionary entries for synthetic
- fonts. Additionally, some entries were handled as `integer' instead
- of `number'.
-
- * include/freetype/internal/psaux.h (T1_FieldType): Add
- T1_FIELD_TYPE_BOOL_P, T1_FIELD_TYPE_INTEGER_P, and
- T1_FIELD_TYPE_FIXED_P.
- (T1_FIELD_BOOL_P, T1_FIELD_NUM_P, T1_FIELD_FIXED_P): New macros.
- * src/psaux/psobjs.c (ps_parser_load_field): Handle new field types.
-
- * include/freetype/internal/cfftypes.h (CFF_FontRecDict),
- src/cff/cfftoken.h: Change type of underline_position and
- underline_thickness to FT_Fixed.
- * src/cff/cffload.c (cff_subfont_load): Fix default values of
- underline_position and underline_thickness.
- * src/cff/cffobjs.c (cff_face_init): Set underline_position
- and underline_thickness in `root'.
-
- * include/freetype/internal/t1types.h (T1_Font): Change point_type
- and stroke_width to pointers.
- * include/freetype/t1tables.h (PS_FontInfo): Change italic_angle,
- is_fixed_pitch, underline_position, and underline_thickness to
- pointers.
- * src/type1/t1tokens.h: Change italic_angle, is_fixed_pitch,
- underline_position, and underline_thickness to pointers. Change
- the type of the latter two to `fixed'.
- Change type of stroke_width to `fixed' and make it a pointer.
- Change paint_type to pointer.
- * src/type1/t1objs.c (T1_Face_Done): Updated.
- (T1_Face_Init): Updated.
- Fix assignment of underline_position and underline_thickness.
-
- * src/cid/cidtoken.h: Change italic_angle, is_fixed_pitch,
- underline_position, and underline_thickness to pointers. Change
- the type of the latter two to `fixed'.
- Change type of stroke_width to `fixed'.
- * src/cid/cidobjs.c (cid_face_done): Updated.
- (cid_face_init): Updated.
- Fix assignment of underline_position and underline_thickness.
-
- * src/type42/t42parse.c: Change italic_angle, is_fixed_pitch,
- underline_position, and underline_thickness to pointers. Change the
- type of the latter two to `fixed'.
- Change type of stroke_width to `fixed' and make it a pointer.
- Change paint_type to pointer.
- * src/type42/t42objs.c (T42_Face_Init): Updated.
- Fix assignment of underline_position and underline_thickness.
- (T42_Face_Done): Updated.
-
- * src/base/ftobjs.c (open_face_from_buffer): Fix compiler warning.
- * src/pshinter/pshglob.c, src/pshinter/pshglob.h
- (psh_globals_set_scale): Make it a local function.
-
- * test/gview.c: Fix renaming ps3->ps typo.
- Formatting.
-
-2003-05-29 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshalgo1.[ch], src/pshinter/pshalgo2.[ch]: Removed.
- * src/pshinter/pshalgo.h: Removed.
-
- * src/pshinter/pshalgo3.[ch]: Renamed to...
- * src/pshinter/pshalgo.[ch]: New files.
- s/PSH3/PSH/.
- s/psh3/psh/.
- s/ps3/ps/.
-
- * src/pshinter/pshrec.c, src/pshinter/pshinter.c: Updated.
- * src/pshinter/rules.mk, src/pshinter/Jamfile: Updated.
-
- * src/pshinter/pshglob.[ch] (psh_dimension_snap_width): Commented
- out.
-
- * tests/gview.c: Remove code for pshalgo1 and pshalgo2.
- Updated.
-
-2003-05-28 Martin Zinser <zinser@decus.de>
-
- * vms_make.com: Reworked support for shareable images on VMS. The
- first version was kind of a hack; the current implementation of the
- procedure to extract the required symbols is much cleaner.
-
- Reworked creation of MMS files, avoiding a number of temporary files
- which were created in the previous version.
-
- Further work on creating descrip.mms files on the fly.
-
- * builds/vms/descrip.mms, src/autohint/descrip.mms,
- src/type1/descrip.mms: Removed.
-
-2003-05-28 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshalgo3.c (psh3_glyph_compute_extrema): Skip
- contours with only a single point to avoid segfault.
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Activate code for
- handling `origin'.
-
-2003-05-24 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahtypes.h (AH_OPTION_NO_STRONG_INTERPOLATION):
- Removed since unused.
-
-2003-05-21 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftstdlib.h (ft_strcat): New wrapper macro
- for strcat.
-
- * src/base/ftmac.c (create_lwfn_name): s/isupper/ft_isupper/.
- (parse_font): s/memcpy/ft_memcpy/.
- (is_dfont) [TARGET_API_MAC_CARBON]: s/memcmp/ft_memcmp/.
- * src/base/ftobjs.c (load_mac_face) [FT_MACINTOSH]:
- s/strlen/ft_strlen/.
- s/strcat/ft_strcat/.
- s/strcpy/ft_strcpy/.
- * src/gzip/zutil.h: s/memset/ft_memset/.
- s/memcmp/ft_memcmp/.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdriver.c
- (PCF_Face_Init): Test for charset registry case-insensitively.
-
- * src/gzip/ftgzip.c (ft_gzip_file_io): Revert change from yesterday;
- it has already been fixed differently.
-
- * src/truetype/ttinterp.c (DO_SFVTL): Add missing braces around
- if-clause.
-
-2003-05-21 Martin Zinser <zinser@decus.de>
-
- * t1load.c (parse_blend_axis_types): Fix compiler warning.
-
- * descrip.mms: Removed. Now created by...
-
- * vms_make.com: New file.
-
-2003-05-21 Weiqi Gao <weiqigao@networkusa.net>
-
- * src/gzip/ftgzip.c (ft_gzip_file_io): Avoid zero value of `delta'
- to prevent infinite loop.
-
-2003-05-21 Lars Clausen <lrclause@cs.uiuc.edu>
-
- * docs/VERSION.DLL: Provide better autoconf snippet to check
- FreeType version.
-
-2003-05-21 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (open_face): Free `internal' not
- `face->internal' in case of error to avoid possible segfault.
-
- * src/pshinter/pshalgo3.c (ps3_hints_apply): Check whether we
- actually have an outline.
-
-2003-05-20 David Chester <davidchester@qmx.net>
-
- * src/pshinter/pshalgo3.c (ps3_hints_apply): Try to optimize
- y_scale so that the top of non-capital letters is aligned on a pixel
- boundary whenever possible.
-
- * src/autohint/ahhint.c (ah_hint_edges): Make sure that lowercase
- m's maintain their symmetry.
-
-2003-05-20 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahhint.c (ah_hinter_load_glyph): Oops! David's
- patch from yesterday has been resolved already in a different
- way. Reverted.
-
-2003-05-19 David Chester <davidchester@qmx.net>
-
- * src/autohint/ahhint.c (ah_hinter_load_glyph): Don't scale
- y_scale locally but face->size->metrics.y_scale.
-
-2003-05-19 David Turner <david@freetype.org>
-
- * src/sfnt/ttcmap0.c (tt_cmap4_char_next): Select proper start
- value for `hi' to avoid infinite loop.
-
-2003-05-18 Yong Sun <sunyong@njstar.com>
-
- * src/raster/ftraster.c (Insert_Y_Turn): Fix overflow test.
-
-2003-05-18 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftoption.h [FT_CONFIG_OPTION_MAC_FONTS]:
- New macro.
- * src/base/ftobjs.c: Use it to control mac font support on non-mac
- platforms.
-
-2003-05-17 George Williams <gww@silcom.com>
-
- Implement partial support of Mac fonts on non-Mac platforms.
-
- * src/base/ftobjs.c (memory_stream_close, new_memory_stream,
- open_face_from_buffer, Mac_Read_POST_Resource,
- Mac_Read_sfnt_Resource, IsMacResource, IsMacBinary, load_mac_face)
- [!FT_MACINTOSH]: New functions.
- (FT_Open_Face) [!FT_MACINTOSH]: Use load_mac_face.
-
-2003-05-17 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Load_Glyph): Scale linear advance width only
- if FT_FACE_FLAG_SCALABLE is set (otherwise we have a division by
- zero since FNT and friends don't define `face->units_per_EM').
-
-2003-05-15 David Turner <david@freetype.org>
-
- * src/base/fttrigon.c (FT_Vector_Rotate): Avoid rounding errors
- for small values.
-
-2003-05-15 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahtypes.h (AH_PointRec): Remove unused `in_angle'
- and `out_angle' fields.
-
-2003-05-14 George Williams <gww@silcom.com>
-
- * src/base/ftmac.c (FT_New_Face_From_SFNT): Handle CFF files also.
-
-2003-05-14 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h: Fix typo in comment
- (FT_HAS_FIXED_SIZES).
-
-2003-05-10 Dan Williams <dan@bigw.org>
-
- * builds/unix/aclocal.m4: Comment out definition of
- `allow_undefined_flag' for Darwin 1.3.
- * builds/unix/configure.ac: Add option --with-old-mac-fonts.
- * builds/unix/ltmain.sh: Fix version numbering for Darwin 1.3.
- * builds/unix/configure: Regenerated.
-
- * include/freetype/config/ftconfig.h: Fix conditions for defining
- `FT_MACINTOSH'.
- * src/base/ftbase.c: Include `ftmac.c' conditionally.
- * src/base/ftmac.c: Handle __GNUC__.
-
-2003-05-07 YAMANO-UCHI Hidetoshi <mer@din.or.jp>
-
- * src/cid/cidload.c (is_alpha): Removed.
- (cid_parse_dict): Use `cid_parser_skip_alpha' instead of `is_alpha'.
-
-2003-05-07 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahoptim.c, src/autohint/ahoptim.h: Obsolete, removed.
-
-2003-05-07 David Turner <david@freetype.org>
-
- * src/autohint/ahglyph.c (ah_setup_uv): Exchange `for' loop and
- `switch' statement to make it run faster.
- (ah_outline_compute_segments): Reset `segment->score' and
- `segment->link'.
- (ah_outline_link_segments): Provide alternative code which does
- the same but runs much faster.
- Handle major direction also.
- (ah_outline_compute_edges): Scale `edge_distance_threshold' down
- after rounding instead of scaling comparison value in loop.
-
- * src/autohint/ahhint.c (ah_hinter_align_strong_points): Provide
- alternative code which runs faster.
- Handle `before->scale == 0'.
-
- * src/autohint/ahtypes.h (AH_SegmentRec): Move some fields down.
- (AH_EdgeRec): Move some fields in structure.
- New field `scale'.
-
- * src/sfnt/ttcmap0.c (tt_cmap4_char_next): Use binary search.
-
-2003-05-02 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahoptim.c (LOG): Renamed to...
- (AH_OPTIM_LOG): This.
- (AH_Dump_Springs): Fix log message format.
-
- * src/autohint/ahhint.c (ah_hint_edges_3): Renamed to...
- (ah_hint_edges): This.
-
-2002-05-02 Keith Packard <keithp@keithp.com>
-
- * src/bdf/bdfdrivr.c (BDF_Set_Pixel_Size): Initialize `max_advance'.
-
-2003-05-01 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahglyph.c (ah_test_extrema): Renamed to...
- (ah_test_extremum): This.
-
-2003-04-28 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.ac: Generate `freetype.pc' from
- `freetype.in'.
- * builds/unix/configure: Regenerated.
- * builds/unix/install.mk (install, uninstall): Handle `freetype.pc'.
-
-2003-04-28 Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
-
- * builds/unix/freetype2.in: New file. Contains building information
- for the `pkg-config' package.
-
-2003-04-28 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c (FT_Load_Glyph): Fix boundary check for
- `glyph_index'.
-
-2003-04-25: Graham Asher <graham.asher@btinternet.com>
-
- Added the optional unpatented hinting system for TrueType. It
- allows typefaces which need hinting to produce correct glyph forms
- (e.g., Chinese typefaces from Dynalab) to work acceptably without
- infringing Apple patents. This system is compiled only if
- TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING is defined in
- ftoption.h.
-
- * include/freetype/ttunpat.h: New file. Defines
- FT_PARAM_TAG_UNPATENTED_HINTING.
-
- * include/freetype/config/ftheader.h (FT_TRUETYPE_UNPATENTED_H): New
- macro to use when including ttunpat.h.
-
- * include/freetype/config/ftoption.h
- (TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING,
- TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING): New configuration macros
- (not defined, but in comments) for the unpatented hinting system.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec)
- [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: New element `FT_Bool
- unpatented_hinting'.
-
- * src/truetype/ttinterp.c (NO_APPLE_PATENT, APPLE_THRESHOLD):
- Removed.
- (GUESS_VECTOR): New macro.
- (TT_Run_Context) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]:
- Set `both_x_axis'.
- (tt_default_graphics_state)
- [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Updated.
- (Current_Ratio) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]:
- Handle `unpatented_hinting'.
- (Direct_Move) [NO_APPLE_PATENT]: Removed.
- [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Insert assertion.
- (Project, FreeProject)
- [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Insert assertion.
- (Compute_Funcs) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]:
- Implement unpatented hinting.
- (DO_SPVTCA, DO_SFVTCA, DO_SPVTL, DO_SFVTL, DO_SPVFS, DO_SFVFS,
- Ins_SDPVTL): Call `GUESS_VECTOR'.
- (DO_GPV, DO_GFV) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]:
- Handle `unpatented_hinting'.
- (Compute_Point_Displacement) [NO_APPLE_PATENT]: Removed.
- [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Implement unpatented
- hinting.
- (Move_Zp2_Point, Ins_SHPIX, Ins_DELTAP, Ins_DELTAC)
- [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Implement unpatented
- hinting.
- (TT_RunIns): Updated.
-
- * src/truetype/ttobjs.c
- [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Include
- FT_TRUETYPE_UNPATENTED_H.
- (tt_face_init) [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING,
- TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING]: Check
- FT_PARAM_TAG_UNPATENTED_HINTING.
-
- * src/truetype/ttobjs.h (TT_GraphicsState)
- [TT_CONFIG_OPTION_COMPILE_UNPATENTED_HINTING]: Add `both_x_axis'.
-
-2003-04-25 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdflib.c (hash_bucket, hash_lookup): Use `const' for first
- argument.
- (bdf_get_font_property): Use `const' for third argument.
- Updated all callers.
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Set pixel width and height
- similar to the PCF driver.
- * src/bdf/bdf.h (_hashnode): Use `const' for `key'.
- Updated.
-
- * src/gzip/ftgzip.c: C++ doesn't like that the array `inflate_mask'
- is declared twice. It is perhaps better to modify the zlib source
- files directly instead of this hack.
- (zcalloc, zfree, ft_gzip_stream_close, ft_gzip_stream_io): Add casts
- to make build with g++ successful.
-
-2003-04-24 Manish Singh <yosh@gimp.org>
-
- * src/cid/cidobjs.c (cid_face_init), src/type1/t1objs.c
- (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Split on `-'
- also for searching the style name.
-
-2003-04-24 David Turner <david@freetype.org>
-
- * src/pcf/pcfread.c (pcf_load_font): Fixed the computation of
- face->num_glyphs. We must increase the value by 1 to respect the
- convention that glyph index 0 always corresponds to the `missing
- glyph'.
-
-2003-04-24 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/unix-cc.in (CFLAGS): Add @CPPFLAGS@.
-
-2003-04-24 Dieter Baron <dillo@netbsd.org>
-
- * builds/unix/freetype-config.in (cflags): Emit FreeType 2's include
- files first. Otherwise there are conflicts with FreeType 1
- installed simultaneously.
-
-2003-04-23 Werner Lemberg <wl@gnu.org>
-
- Fixing bugs reported by Nelson Beebe.
-
- * src/base/ftstroker.c (FT_Stroker_ParseOutline): Remove unused
- variable `in_path'.
-
- * src/base/ftobjs (ft_glyphslot_set_bitmap): Change type of
- second argument to `FT_Byte*'.
- * include/freetype/internal/ftobjs.h: Updated.
-
- * src/bdf/bdflib.c (_bdf_readstream): Remove unused variable `res'.
- (_bdf_parse_glyphs): Remove unused variable `next'.
- Mark `call_data' as unused.
-
- * src/cache/ftlru.c (FT_LruList_Lookup): Remove unused variable
- `plast'.
-
- * src/pcf/pcfread.c (pcf_seek_to_table_type): Slight recoding to
- actually use `error'.
- (pcf_load_font): Remove unused variable `avgw'.
-
- * src/pfr/pfrobjs.c (pfr_face_get_kerning): Change return type
- to `void'.
- Mark `error' as unused.
- * src/pfr/pfrobjs.h: Updated.
- * src/pfr/pfrdrivr.c (pfr_get_kerning): Updated.
-
- * src/sfnt/ttload.c (sfnt_dir_check): Remove unused variable
- `format_tag'.
-
- * src/sfnt/ttcmap0.c (tt_cmap6_validate, tt_cmap10_validate): Remove
- unused variable `start'.
- (tt_cmap10_char_next): Remove unused variable `result'
-
- * src/sfnt/sfobjs.c (tt_face_get_name): Mark `error' as unused.
-
- * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Mark `error' as
- unused.
-
- * src/type1/t1objs.c (T1_Face_Init): Remove unused variable
- `pshinter'.
-
- * src/type1/t1gload.c (T1_Load_Glyph): Use `glyph_data_loaded'
- only for FT_CONFIG_OPTION_INCREMENTAL.
-
-2003-04-23 Akito Hirai <akito@kde.gr.jp>
-
- * src/sfnt/ttcmap0.c (tt_cmap4_validate): Provide a weak variant
- of the glyph ID bounding check if FT_VALIDATE_TIGHT is not active.
- Without this change, many CJK fonts from Dynalab are rejected.
-
-2003-04-23 Joe Marcus Clarke <marcus@FreeBSD.org>
-
- * src/base/ftbdf.c (FT_Get_BDF_Property): Check for valid
- `get_interface'.
-
-2003-04-23 Paul Miller <paulm@profoundeffects.com>
-
- * src/base/ftmac.c (parse_fond): Fix handling of style names.
-
-2003-04-23 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrload.c (pfr_extra_item_load_font_id): Use FT_PtrDist
- instead of FT_UInt for `len'.
-
-2003-04-22 Werner Lemberg <wl@gnu.org>
-
- * src/gzip/ftgzip.c (zcalloc) [!FT_CONFIG_OPTION_SYSTEM_ZLIB]:
- Convert K&R format to modern C usage.
- (FT_Stream_OpenGzip): Use long constant.
-
-2003-04-21 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftccache.c (ftc_cache_lookup): Remove shadow declaration
- of `manager'.
-
-2003-04-20 Werner Lemberg <wl@gnu.org>
-
- * doc/INSTALL.UNX: Cleaned up.
-
-2003-04-09 Torrey Lyons <torrey@mrcla.com>
-
- * src/base/ftmac.c (open_face_from_buffer): Removed a double-free
- bug that had nasty consequences when trying to open an `invalid'
- font on a Mac.
-
-2003-04-09 Mike Fabian <mfabian@suse.de>
-
- * src/bdf/bdfdrivr.h (BDF_encoding_el), src/pcf/pcf.h
- (PCF_EncodingRec): Changed FT_Short to FT_UShort in order to be able
- to access more than 32768 glyphs in fonts.
-
-2003-04-08 David Turner <david@freetype.org>
-
-
- * Version 2.1.4 released.
- =========================
-
-
-2003-04-03 Martin Muskens <mmuskens@aurelon.com>
-
- * src/type1/t1load.c (T1_Open_Face): Fixed the code to make it
- handle special cases where a font only contains a `.notdef' glyph
- (happens in PDF-embedded fonts). Otherwise, FT_Panic was called.
-
-2003-03-27 David Turner <david@freetype.org>
-
- * README: Updated.
-
- * README.UNX: Removed (now replaced by docs/INSTALL.UNX).
-
- * src/pshinter/pshalgo3.c: The hinter now performs as in 2.1.3 and
- will ignore stem quantization only when FT_LOAD_TARGET_SMOOTH is
- used.
- (psh3_dimension_quantize_len): Enabled.
- (psh3_hint_align): Enable commented code.
- (psh3_hint_align_light): Commented out.
-
- * src/base/ftobjs.c (FT_Set_Char_Size): Changed the default
- computations to include rounding in all cases; this is required to
- provide accurate kerning data when native TrueType hinting is
- enabled.
-
- * src/type1/t1load.c (is_name_char): The Type 1 loader now accepts
- more general names according to the PostScript specification (the
- previous one was too restrictive).
- (parse_font_name, parse_encoding, parse_charstrings, parse_dict):
- Use `is_name_char'.
- (parse_subrs): Handle empty arrays.
-
-2003-03-20 David Turner <david@freetype.org>
-
- Serious rewriting of the documentation.
-
- * docs/BUGS, docs/BUILD: Removed.
- * docs/DEBUG.TXT: Renamed to...
- * docs/DEBUG: This.
- * docs/CUSTOMIZE, docs/TRUETYPE, docs/UPGRADE.UNX: New files.
- * docs/INSTALL.ANY, docs/INSTALL.UNX, docs/INSTALL.GNU New files,
- containing platform specific information previously in INSTALL.
- * docs/readme.vms: Renamed to...
- * docs/INSTALL.VMS: This.
-
- * docs/*: Updated.
-
- Introduced three new functions to deal with glyph bitmaps within
- FT_GlyphSlot objects:
-
- ft_glyphslot_free_bitmap
- ft_glyphslot_alloc_bitmap
- ft_glyphslot_set_bitmap
-
- These functions are much more convenient to use than managing the
- FT_GLYPH_OWN_BITMAP flag manually.
-
- * include/freetype/internal/ftobjs.h (ft_glyphslot_free_bitmap,
- ft_glyphslot_alloc_bitmap, ft_glyphslot_set_bitmap): New functions.
- * src/base/ftobjs.c: Implement them.
- (ft_glyphslot_done): Use ft_glyphslot_free_bitmap.
-
- * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/pcf/pcfdriver.c
- (PCF_Glyph_Load): Remove unused variable `memory'.
- Use `ft_glyphslot_*' functions.
- Don't set `FT_GLYPH_OWN_BITMAP'.
-
- * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Use
- `ft_glyphslot_alloc_bitmap'.
-
- * src/sfnt/ttsbit.c (Load_SBit_Image): Change 5th argument to type
- `FT_GlyphSlot'.
- Adding argument `depth' to handle recursive calls.
- Use `ft_glyphslot_alloc_bitmap'.
- (tt_face_load_sbit_image): Remove unused variable `memory'.
- Don't handle `FT_GLYPH_OWN_BITMAP'.
- Update call to Load_SBit_Image.
-
- * src/type42/t42objs.c (ft_glyphslot_clear): Renamed to...
- (t42_glyphslot_clear): This. Updated caller.
- Call `ft_glyphslot_free_bitmap'.
-
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Use
- `ft_glyphslot_set_bitmap'.
- Don't handle `FT_GLYPH_OWN_BITMAP'.
-
- * src/cache/ftlru.c (FT_LruList_Lookup): Fixed an invalid assertion
- check.
-
- * src/autohint/ahglyph.c (ah_outline_load): Add two scaling
- arguments.
- * src/autohint/ahglyph.h: Updated.
- * src/autohint/ahhint.c (ah_hinter_load): Updated.
- * src/autohint/ahglobal.c (ah_hinter_compute_widths): Updated.
-
- * src/cache/ftccache.c (ftc_family_done): Fixed small bug that could
- crash the cache in rare circumstances (mostly with broken fonts).
-
-2003-03-15 David Turner <david@freetype.org>
-
- * src/truetype/ttdriver.c (Set_Char_Sizes): Fixed a small rounding
- bug. Actually, it seems that previous versions of FreeType didn't
- perform TrueType rounding exactly as appropriate.
-
-2003-03-14 David Turner <david@freetype.org>
-
- * src/truetype/ttdriver.c (Set_Char_Sizes): Fixing the small
- TrueType native rendering glitches; they came from a small rounding
- error.
-
-2003-03-13 David Turner <david@freetype.org>
-
- Added new environment variables to control memory debugging with
- FreeType. See the description of `FT2_DEBUG_MEMORY',
- `FT2_ALLOC_TOTAL_MAX' and `FT2_ALLOC_COUNT_MAX' in DEBUG.TXT.
-
- * src/base/ftdbgmem.c (FT_MemTableRec): Add `alloc_count',
- `bound_total', `alloc_total_max', `bound_count', `alloc_count_max'.
- (ft_mem_debug_alloc): Handle new variables.
- (ft_mem_debug_init): s/FT_DEBUG_MEMORY/FT2_DEBUG_MEMORY/.
- Handle new environment variables.
- * docs/DEBUG.TXT: Updated.
-
- Fixed the cache sub-system to correctly deal with out-of-memory
- conditions.
-
- * src/cache/ftccache.c (ftc_node_destroy): Comment out generic
- check.
- (ftc_cache_lookup): Implement loop.
- * src/cache/ftccmap.c: Define FT_COMPONENT.
- * src/cache/ftcsbits.c (ftc_sbit_node_load): Handle
- FT_Err_Out_Of_Memory.
- * src/cache/ftlru.c: Include FT_INTERNAL_DEBUG_H.
- (FT_LruList_Lookup): Implement loop.
-
- * src/pfr/pfrobjs.c (pfr_face_done): Fix memory leak.
- (pfr_face_init): Fixing compiler warnings.
-
- * src/psaux/psobjs.c (reallocate_t1_table): Fixed a bug (memory
- leak) that only happened when a try to resize an array would end in
- an out-of-memory condition.
-
- * src/smooth/ftgrays.c (gray_convert_glyph): Removed compiler
- warnings / volatile bug.
-
- * src/truetype/ttobjs.c (tt_glyphzone_done): Removed segmentation
- fault that happened in tight memory environments.
-
-2003-02-28 Pixel <pixel@mandrakesoft.com>
-
- * src/gzip/ftgzip.c (ft_gzip_file_done): Fixed memory leak: The ZLib
- stream was not properly finalized.
-
-2003-02-25 Anthony Fok <anthony@thizlinux.com>
-
- * src/cache/ftccmap.c: Include FT_TRUETYPE_IDS_H.
- (ftc_cmap_family_init): The cmap cache now
- supports UCS-4 charmaps when available in Asian fonts.
-
- * src/sfnt/ttload.c, src/base/ftobjs.c: Changed `asian' to `Asian'
- in comments.
-
-2003-02-25 David Turner <david@freetype.org>
-
- * src/gzip/ftgzip.c (ft_gzip_file_fill_output): Fixed a bug that
- caused FreeType to loop endlessly when trying to read certain
- compressed gzip files. The following test reveals the bug:
-
- touch 0123456789 ; gzip 0123456789 ; ftdump 0123456789.gz
-
- Several fixes to the PFR font driver:
-
- - The list of available embedded bitmaps was not correctly set in
- the root FT_FaceRec structure describing the face.
-
- - The glyph loader always tried to load the outlines when
- FT_LOAD_SBITS_ONLY was specified.
-
- - The table loaded now scans for *undocumented* elements of a
- physical font's auxiliary data record. This is necessary to
- retrieve the `real' family and style names.
-
- NOTE THAT THESE CHANGES THE FAMILY NAME OF MANY PFR FONTS!
-
- * src/pfr/pfrload.c (pfr_aux_name_load): New function.
- (pfr_phy_font_done): Free `family_name' and `style_name' also.
- Remove unused variables.
- (pfr_phy_font_load): Extract useful information from the auxiliary
- bytes.
-
- * src/pfr/pfrobjs.c (pfr_face_done): Set pointers to NULL.
- (pfr_face_init): Provide fallback values for `family_name' and
- `style_name'.
- Handle strikes.
- (pfr_slot_load): Handle FT_LOAD_SBITS_ONLY.
- * src/pfr/pfrtypes.h (PFR_PhyFontRec): Add fields `ascent',
- `descent', `leading', `family_name', and `style_name'.
-
- * src/truetype/ttdriver.c (Set_Char_Sizes): Fixed a rounding bug
- when computing the scale factors for a given character size in
- points with resolution.
-
- * devel/ft2build.h, devel/ftoption.h: New files (in a new directory)
- which are special development versions of include/ft2build.h and
- include/freetype/config/ftoption.h, respectively.
-
-2003-02-18 David Turner <david@freetype.org>
-
- Fixing the slight distortion problem that occurred due to the latest
- auto-hinter changes.
-
- * src/base/ftobjs.c (ft_recompute_scaled_metrics): Fix rounding.
-
- * src/truetype/ttdriver.c (Set_Char_Sizes): New variable `metrics2'.
- [!TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Removed.
-
- * src/truetype/ttobjs.h (TT_SizeRec): New field `metrics'.
- * src/truetype/ttobjs.c (Reset_Outline_Size): Fix initialization of
- `metrics'.
- [FT_CONFIG_CHESTER_ASCENDER]: Code removed.
- (Reset_SBit_Size): Fix initialization of `metrics'.
-
- * src/truetype/ttinterp.c (TT_Load_Context): Fix initialization of
- `exec->metrics'.
-
- * src/autohint/ahhint.c (ah_hinter_load): Disabled the advance width
- `correction' which seemed to provide more trouble than benefits.
-
-2003-02-13 Graham Asher <graham.asher@btinternet.com>
-
- Changed the incremental loading interface in a way that makes it
- simpler and allows glyph metrics to be changed (e.g., by adding a
- constant, as required by CFF fonts) rather than just overridden.
- This was required to make the GhostScript-to-FreeType bridge work.
-
- * src/cff/cffgload.c (cff_slot_load) [FT_CONFIG_OPTION_INCREMENTAL]:
- Allow metrics to be overridden.
- * src/cid/cidgload.c (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL]:
- Ditto.
-
- * src/truetype/ttgload.c (load_truetype_glyph)
- [FT_CONFIG_OPTION_INCREMENTAL]: Simplify.
- (compute_glyph_metrics) [FT_CONFIG_OPTION_INCREMENTAL]: Code block
- moved down.
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String)
- [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
-
- * include/freetype/ftincrem.h: Updated.
-
-2003-01-31 David Turner <david@freetype.org>
-
- * docs/CHANGES, docs/VERSION.DLL, docs/TODO: Updating documentation
- for the 2.1.4 release.
-
- * builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/index.html: Updating the project file for
- 2.1.4.
-
- * src/gzip/adler32.c, src/gzip/ftgzip.c, src/gzip/infblock.c,
- src/gzip/infcodes.c, src/gzip/inflate.c, src/gzip/inftrees.c,
- src/gzip/infutil.c: Removed old-style (K&R)function definitions.
- This avoids warnings with Visual C++ at its most pedantic mode.
-
- * src/pfr/pfrsbit.c: Removed compiler warnings.
-
- * src/cache/ftccmap.c (ftc_cmap_family_init): Changed an FT_ERROR
- into an FT_TRACE1 since it caused `ftview' and others to dump too
- much junk when trying to display a waterfall with a font without a
- Unicode charmap (e.g. SYMBOL.TTF).
-
- Implemented FT_CONFIG_CHESTER_BLUE_SCALE, corresponding to the last
- patch from David Chester, but with a much simpler (and saner)
- implementation.
-
- * src/autohint/ahhint.c (ah_hinter_load_glyph)
- [FT_CONFIG_CHESTER_BLUE_SCALE]: Try to optimize the y_scale so that
- the top of non-capital letters is aligned on a pixel boundary
- whenever possible.
-
- * src/base/ftobjs.c (FT_Set_Char_Size)
- [FT_CONFIG_CHESTER_BLUE_SCALE]: Round differently.
- * src/truetype/ttdriver.c (Set_Char_Sizes)
- [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Do some rounding only
- if this macro is defined.
-
- * src/truetype/ttobjs.c (Reset_Outline_Size)
- [FT_CONFIG_CHESTER_ASCENDER]: Round differently.
-
- * src/pshinter/pshalgo3.c: Improved the Postscript hinter. Getting
- rid of stem snapping seems to work well here (though the stems are
- still slightly moved to increase contrast).
- (psh3_dimension_quantize_len): Commented out.
- (psh3_hint_align_light): New function.
- (psh3_hint_align): Comment out some code.
-
- THIS IMPROVES ANTI-ALIASED RENDERING, BUT MONOCHROME AND LCD MODES
- STILL SUCK.
-
-2003-01-22 David Chester <davidchester@qmx.net>
-
- * src/autohint/ahhint.c (ah_compute_stem_width): Small fix to the
- stem width optimization.
-
-2003-01-22 David Turner <david@freetype.org>
-
- Adding a new API `FT_Get_BDF_Property' to retrieve the BDF
- properties of a given PCF or BDF font.
-
- * include/freetype/ftbdf.h (BDF_PropertyType): New enumeration.
- (BDF_Property, BDF_PropertyRec): New structure.
- FT_Get_BDF_Property): New function.
- * include/freetype/internal/bdftypes.h: Include FT_BDF_H.
- (BDF_GetPropertyFunc): New function pointer.
-
- * src/base/ftbdf.c (test_font_type): New helper function.
- (FT_Get_BDF_Charset_ID): Use `test_font_type'.
- (FT_Get_BDF_Property): New function.
-
- * src/bdf/bdfdrivr.c: Include FT_BDF_H.
- (bdf_get_bdf_property, bdf_driver_requester): New functions.
- (bdf_driver_class): Use `bdf_driver_requester'.
-
- * src/pcf/pcfdrivr.c: Include FT_BDF_H.
- (pcf_get_bdf_property, pcf_driver_requester): New functions
- (pcf_driver_class): Use `pcf_driver_requester'.
-
- * src/pcf/pcfread.c: Include `pcfread.h'.
- (pcf_find_property): Decorate it with FT_LOCAL_DEF.
- * src/pcf/pcfread.h: New file, providing `pcf_find_property'.
-
- * src/sfnt/ttload.c (sfnt_dir_check): Relaxed the `head' table size
- verification to accept a few broken fonts who pad the size
- incorrectly (the table should be padded, but its `size' field
- shouldn't according to the specification).
-
-2003-01-18 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ltmain.sh: Regenerated with `libtoolize --force
- --copy' from libtool 1.4.3.
- * builds/unix/aclocal.m4: Regenerated with `aclocal -I .' from
- automake 1.7.1.
- * builds/unix/configure: Regenerated with autoconf 2.54.
- * builds/unix/config.guess, builds/unix/config.sub: Updated from
- `config' CVS module at subversions.gnu.org.
- * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
- `automake' CVS module at subversions.gnu.org.
-
-2003-01-15 David Turner <david@freetype.org>
-
- * include/freetype/freetype.h: Fixed documentation for
- FT_Size_Metrics.
-
-2003-01-15 James Su <suzhe@turbolinux.com.cn>
-
- * src/gzip/ftgzip.c (ft_gzip_check_header): Bugfix: couldn't read
- certain gzip-ed font files (typo: `&&' -> `&').
-
-2003-01-15 Huw D M Davies <h.davies1@physics.ox.ac.uk>
-
- Added a Windows .FNT specific API (mostly for Wine). Also fixed a
- nasty bug in the header loader which would cause invalid memory
- overwrites.
-
- * include/freetype/config/ftheader.h (FT_WINFONTS_H): New macro
- for ftwinfnt.h.
- * include/freetype/internal/fnttypes.h: Include FT_WINFONTS_H.
- (FNT_FontRec): Updated.
- Move Windows FNT definition to...
- * include/freetype/ftwinfnt.h: This new file.
- (FT_WinFNT_HeaderRec): Rename `reserved2' to `reserved1'.
- * src/base/ftwinfnt.c: New file, providing `FT_Get_WinFNT_Header'.
- * src/winfonts/winfnt.c (winfnt_header_fields): Updated.
- Rename `reserved2' to `reserved1'.
- (fnt_font_load): Updated.
-
- * src/base/Jamfile, src/base/descrip.mms, src/base/rules.mk:
- Updated.
-
-2003-01-14 Graham Asher <graham.asher@btinternet.com>
-
- * include/freetype/ftglyph.h, src/base/ftglyph.c: Added `const' to
- the type of the first argument to FT_Matrix_Multiply, which isn't
- changed -- this adds documentation and convenience.
-
-2003-01-13 Graham Asher <graham.asher@btinternet.com>
-
- * src/sfnt/ttload.c (tt_face_load_metrics)
- [FT_CONFIG_OPTION_INCREMENTAL]: TrueType typefaces without
- horizontal metrics (without the `hmtx' table) are now tolerated if
- an incremental interface has been specified that has a
- get_glyph_metrics function, implying that metrics will be supplied
- from outside. This happens for certain Type 42 fonts passed from
- GhostScript.
-
-2003-01-11 David Chester <davidchester@qmx.net>
-
- Patches to the auto-hinter in order to slightly improve the output.
- Note that everything is controlled through the new
- FT_CONFIG_OPTION_CHESTER_HINTS defined in `ftoption.h'. There are
- also individual FT_CONFIG_CHESTER_XXX macros to control individual
- `features'.
-
- Note that all improvements are enabled by default, but can be
- tweaked for optimization and testing purposes. The configuration
- macros will most likely disappear in the short future.
-
- * include/freetype/config/ftoption.h
- (FT_CONFIG_OPTION_CHESTER_HINTS): New macro.
- (FT_CONFIG_CHESTER_{SMALL_F,ASCENDER,SERIF,STEM,BLUE_SCALE})
- [FT_CONFIG_OPTION_CHESTER_HINTS]: New macros to control individual
- features.
-
- * src/autohint/ahglobal.c (blue_chars) [FT_CONFIG_CHESTER_SMALL_F]:
- Add blue zone for `fijkdbh'.
- * src/autohint/ahglobal.h (AH_IS_TOP_BLUE)
- [FT_CONFIG_CHESTER_SMALL_F]: Use `AH_BLUE_SMALL_F_TOP'.
- * src/autohint/ahglyph.c (ah_outline_compute_edges)
- [FT_CONFIG_CHESTER_SERIF]: Use `AH_EDGE_SERIF'.
- (ah_outline_compute_blue_edges) [FT_CONFIG_CHESTER_SMALL_F]:
- Increase threshold for `best_dist'.
- * src/autohint/ahhint.c (ah_compute_stem_width)
- [FT_CONFIG_CHESTER_SERIF]: Provide new version for improved serif
- handling.
- (ah_align_linked_edge) [FT_CONFIG_CHESTER_SERIF]: Use special
- version of `ah_compute_stem_width'.
- (ah_hint_edges_3) [FT_CONFIG_CHESTER_STEM]: A new algorithm for stem
- alignment when stem widths are less than 1.5 pixels wide centers the
- stem slightly off-center of the center of a pixel (this increases
- sharpness and consistency).
- [FT_CONFIG_CHESTER_SERIF]: Use special version of
- `ah_compute_stem_width'.
- * src/autohint/ahtypes.h [FT_CONFIG_CHESTER_SMALL_F]: Add
- `AH_BLUE_SMALL_F_TOP'.
-
-2003-01-11 David Turner <david@freetype.org>
-
- * include/freetype/internal/fnttypes.h (WinFNT_HeaderRec): Increase
- size of `reserved2' to avoid memory overwrites.
-
-2003-01-08 Huw Davies <huw@codeweavers.com>
-
- * src/winfonts/winfnt.c (winfnt_header_fields): Read 16 bytes into
- `reserved2', not `reserved'.
-
- * src/base/ftobjs.c (find_unicode_charmap): Fixed the error code
- returned when the font doesn't contain a Unicode charmap. This
- allows FT2 to load `symbol.ttf' and a few others correctly since the
- last release.
- (open_face): Fix return value.
-
-2003-01-08 Owen Taylor <owen@redhat.com>
-
- Implemented the FT_RENDER_MODE_LIGHT hinting mode in the auto and
- postscript hinters.
-
- * src/autohint/ahtypes.h (AH_HinterRec): Add `do_stem_adjust'.
- * src/autohint/ahhint.c (ah_compute_stem_width): Handle
- hinter->do_stem_adjust.
- (ah_hinter_load_glyph): Set hinter->do_stem_adjust.
-
- * src/pshinter/pshalgo3.h (PSH3_GlyphRec): Add `do_stem_adjust'.
- * src/pshinter/pshalgo3.c (psh3_hint_align): Use `do_stem_adjust'.
- (ps3_hints_apply): Handle FT_RENDER_MODE_LIGHT.
-
- * include/freetype/freetype.h (FT_Render_Mode): Add
- FT_RENDER_MODE_LIGHT.
-
- * src/truetype/ttgload.c: Fixing the TrueType loader to handle
- invalid composites correctly by limiting the recursion depth.
- (TT_MAX_COMPOSITE_RECURSE): New macro.
- (load_truetype_glyph): Add argument `recurse_count'.
- Load a composite only if the numbers of contours is -1, emit error
- otherwise.
- (TT_Load_Glyph): Updated.
-
-2003-01-08 David Turner <david@freetype.org>
-
- * Jamrules, Jamfile, Jamfile.in, src/*/Jamfile: Small changes to
- support the compilation of FreeType 2 as part of larger projects
- with their own configuration options (only with Jam).
-
-2003-01-07 David Turner <david@freetype.org>
-
- * src/base/ftstroker.c: Probably the last bug-fixes to the stroker;
- the API is likely to change, however.
- (ft_stroke_border_close): Don't record empty paths.
- (ft_stroke_border_get_counts): Increase `num_points' also in for loop.
- (ft_stroke_border_export): Don't increase `write' twice in for loops.
- (ft_stroker_outside): Handle `phi' together with `theta'.
- (FT_Stroker_ParseOutline): New function.
-
- * src/base/fttrigon.c (FT_Angle_Diff): Fixing function: It returned
- invalid values for large negative angle differences (resulting in
- incorrect stroker computations, among other things).
-
- * src/cache/ftccache.c (ftc_node_hash_unlink): Removing incorrect
- assertion, and changing code to avoid hash table size contraction.
-
- * src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms: Adding
- `ftstroker' to default build, as optional component.
-
-2002-12-26 David Turner <david@freetype.org>
-
- * src/gzip/adler32.c, src/gzip/infblock.c, src/gzip/inflate.c,
- src/gzip/inftrees.c, src/gzip/zconf.h, src/gzip/zlib.h,
- src/gzip/zutil.h: Updates to allow compilation without compiler
- warnings with LCC-Win32.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
- * builds/unix/configure.ac (version_info): Increased to 9:3:3.
- * builds/unix/configure: Regenerated.
- * docs/VERSION.DLL: Updated.
-
-2002-12-23 Anthony Fok <anthony@thizlinux.com>
-
- * builds/unix/configure.ac, builds/unix/unix-cc.in (LINK_LIBRARY),
- builds/unix/unix-def.in (SYSTEM_ZLIB): Small fix to configure
- sub-system on Unix to allow other programs to correctly link with
- zlib when needed.
-
-2002-12-19 David Turner <david@freetype.org>
-
- * include/freetype/internal/sfnt.h (SFNT_Load_Table_Func): New
- function pointer.
-
- * include/freetype/tttables.h (FT_Load_Sfnt_Table): New function.
- * src/base/ftobjs.c: Implement it.
-
- * src/sfnt/sfdriver.c (sfnt_get_interface): Handle `load_sfnt'
- module request.
-
-2002-12-17 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c (find_unicode_charmap): Added some comments to
- better explain what's happening there.
- (open_face): Included Graham Asher's fix to prevent faces without
- Unicode charmaps from loading.
-
- * src/winfonts/winfnt.c: Included George Williams's fix to support
- version 2 fonts correctly.
- (winfnt_header_fields): Updated.
- (fnt_font_load): Handle version 2 fonts.
- (FNT_Load_Glyph): Updated.
-
-2002-12-16 David Turner <david@freetype.org>
-
- * docs/VERSION.DLL: Updating document to better explain the
- differences between the three version numbers being used on Unix, as
- well as providing an autoconf fragment provided by Lars Clausen.
-
- * src/smooth/ftgrays.c (gray_render_conic): Fixed small bug that
- prevented Bézier arcs with negative vertical coordinates to be
- rendered appropriately.
-
-2002-12-02 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
-
- * src/base/ftobjs.c: Modified the logic to get Unicode charmaps.
- Now it loads UCS-4 charmaps when there is one.
- (find_unicode_charmap): New function.
- (open_face): Refer to the above one.
- (FT_Select_Charmap): Idem.
-
-2002-11-29 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
-
- * include/freetype/ftgzip.h: Correct the name of the controlling
- macro (was __FTXF86_H__ ...).
-
-2002-11-27 Vincent Caron <v.caron@zerodeux.net>
-
- * builds/unix/unix-def.in, builds/unix/freetype-config.in,
- builds/unix/configure.ac, src/gzip/rules.mk, src/gzip/ftgzip.c
- [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Adding support for system zlib
- installations if available on the target platform (Unix only).
-
-2002-11-23 David Turner <david@freetype.org>
-
- * src/cff/cffload.c (cff_charset_load, cff_encoding_load): Modified
- charset loader to accept pre-defined charsets, even when the font
- contains fewer glyphs. Also enforced more checks to ensure that we
- never overflow the character codes array in the encoding.
-
-2002-11-22 Antoine Leca <Antoine-Freetype@Leca-Marti.org>
-
- * include/freetype/ttnameid.h: Updated to latest OpenType
- specification.
-
-2002-11-18 David Turner <david@freetype.org>
-
-
- * Version 2.1.3 released.
- =========================
-
-
-2002-11-07 David Turner <david@freetype.org>
-
- * src/cache/ftcsbits.c (ftc_sbit_node_load): Fixed a small bug that
- caused problems with embedded bitmaps.
-
- * src/otlayout/otlayout.h, src/otlayout/otlconf.h,
- src/otlayout/otlgsub.c, src/otlayout/otlgsub.h,
- src/otlayout/otlparse.c, src/otlayout/otlparse.h,
- src/otlayout/otlutils.h: Updating the OpenType Layout code, adding
- support for the first GSUB lookups. Nothing that really compiles
- for now though.
-
- * src/autohint/ahhint.c (ah_align_serif_edge): Disabled serif stem
- width quantization. It produces slightly better shapes though this
- is not distinguishable with many fonts.
- Remove other dead code.
-
- * src/Jamfile, src/*/Jamfile: Simplified.
- Use $(FT2_SRC_DIR).
-
-2002-11-06 David Turner <david@freetype.org>
-
- * include/freetype/freetype.h (FT_LOAD_TARGET_LIGHT): New macro.
- (FT_LOAD_TARGET, FT_LOAD_TARGET_MODE): Use `& 15' instead of `& 7'.
-
-2002-11-05 David Turner <david@freetype.org>
-
- * include/freetype/config/ftoption.h, src/gzip/ftgzip.c: Added
- support for the FT_CONFIG_OPTION_SYSTEM_ZLIB option, used to specify
- the use of system-wide zlib.
-
- Note that this macro, as well as
- TT_CONFIG_OPTION_BYTECODE_INTERPRETER, is not #undef-ed anymore.
- This allows the build system to define them depending on the
- configuration (typically by adding -D flags at compile time).
-
- * src/sfnt/ttcmap0.c (tt_face_build_cmaps): Removed compiler
- warnings in optimized mode relative to the `volatile' local
- variables. This was not a compiler bug after all, but the fact that
- a pointer to a volatile variable is not the same as a volatile
- pointer to a variable :-)
-
- The fix was to change
- `volatile FT_Byte* p'
- into
- `FT_Byte* volatile p'.
-
- * src/pfr/pfrload.c (pfr_phy_font_load), src/pfr/pfrdrivr.c
- (pfr_get_metrics), src/gzip/inftrees.c: Removed compiler warnings in
- optimized modes.
-
- * src/gzip/*.[hc]: Modified our zlib copy in order to prevent
- exporting any zlib function names outside of the component. This
- prevents linking problems on some platforms, when applications want
- to link FreeType _and_ zlib together.
-
-2002-11-05 Juliusz <jch@pps.jussieu.fr>
-
- * src/psaux/psobjs.c (ps_table_add): Modified increment loop in
- order to implement exponential behaviour.
-
-2002-11-01 David Turner <david@freetype.org>
-
- Added PFR-specific public API. Fixed the kerning retrieval routine
- (it returned invalid values when the outline and metrics resolution
- differ).
-
- * include/freetype/ftpfr.h, include/freetype/internal/pfr.h: New
- files.
-
- * include/freetype/internal/internal.h (FT_INTERNAL_PFR_H): New
- macro for pfr.h.
-
- * src/base/ftpfr.c: New file.
- * src/base/Jamfile, src/base/descrip.mms: Updated.
-
- * src/pfr/pfrdrivr.c: Include FT_INTERNAL_PFR_H.
- (pfr_get_kerning, pfr_get_advance, pfr_get_metrics): New functions.
- (pfr_service_rec): New format interface.
- (pfr_driver_class): Use `pfr_service_rec'.
- Replace `pfr_face_get_kerning' with `pfr_get_kerning'.
- * src/pfr/pfrobjs.c: Remove dead code.
-
- * src/base/ftobjs.c (ft_glyphslot_clear): Small internal fix to
- better support bitmap-based font formats.
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Fix handling of
- `scale'.
- Fix arguments to `FT_Vector_From_Polar'.
-
-2002-10-31 David Turner <david@freetype.org>
-
- Add support for automatic handling of gzip-compressed PCF files.
-
- * src/gzip/*: New files, taken from the zlib package (except
- ftgzip.c).
-
- * include/freetype/ftgzip.h, src/gzip/ftgzip.c: New files.
- * include/freetype/config/ftheader.h (FT_GZIP_H): New macro for
- `ftgzip.h'.
-
- * src/pcf/pcfdriver.c: Include FT_GZIP_H and FT_ERRORS_H.
- (PCF_Face_Init): If normal open fails, try to open gzip stream.
- (PCF_Face_Done): Close gzip stream.
-
- * include/freetype/internal/pcftypes.h (PCF_Public_FaceRec),
- src/pcf/pcf.h (PCF_FaceRec): Add `gzip_stream' and `gzip_source'.
-
- * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_USE_ZLIB):
- New macro.
- (T1_CONFIG_OPTION_DISABLE_HINTER, FT_CONFIG_OPTION_USE_CMAPS
- FT_CONFIG_OPTION_NO_CONVENIENCE_FUNCS,
- FT_CONFIG_OPTION_ALTERNATE_GLYPH_FORMATS): Removed.
-
- (FT_EXPORT, FT_EXPORT_DEF, FT_DEBUG_LEVEL_ERROR,
- FT_DEBUG_LEVEL_TRACE, FT_DEBUG_MEMORY): Comment out definitions so
- that platform specific configuration file can override.
-
- * include/freetype/internal/ftstream.h: Include FT_SYSTEM_H.
-
-2002-10-30 David Turner <david@freetype.org>
-
- * FreeType 2.1.3rc3 released.
-
-2002-10-25 David Turner <david@freetype.org>
-
- * include/freetype/ftcache.h (FT_POINTER_TO_ULONG): New macro.
- (FTC_FACE_ID_HASH): Rewritten, using FT_POINTER_TO_ULONG.
-
-2002-10-22 Giuseppe Ghibò <ghibo@mandrakesoft.com>
-
- * include/freetype/freetype.h (FT_Encoding): Fix entry for latin-2.
-
-2002-10-07 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FT_Open_Face): Use `const' for `args'
- (suggested by Graham).
- * src/base/ftobjs.c (FT_Open_Face): Updated.
- (ft_input_stream_new): Ditto.
-
-2002-10-05 David Turner <david@freetype.org>
-
- Adding support for embedded bitmaps to the PFR driver, and rewriting
- its kerning loader/handler to use all kerning pairs in a physical
- font (and not just the first item).
-
- * src/pfr/pfr.c: Include `pfrsbit.c'.
- * src/pfr/pfrgload.c: Include `pfrsbit.h'.
- * src/pfr/pfrload.c (pfr_extra_item_load_kerning_pairs): Rewritten.
- (pfr_phy_font_done, pfr_phy_font_load): Updated.
- * src/pfr/pfrobjs.c: Include `pfrsbit.h'.
- (pfr_face_init): Handle kerning and embedded bitmaps.
- (pfr_slot_load): Load embedded bitmaps.
- (PFR_KERN_INDEX): Removed.
- (pfr_face_get_kerning): Rewritten.
- * src/pfr/pfrsbit.c, src/pfr/pfrsbit.h: New files.
- * src/pfr/pfrtypes.h (PFR_KernItemRec): New structure.
- (PFR_KERN_INDEX): New macro.
- (PFR_PhyFontRec): Add items for kerning and embedded bitmaps.
- * src/pfr/Jamfile (_sources) [FT2_MULTI]: Add `pfrsbit'.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Don't load bitmap fonts if
- FT_LOAD_NO_RECURSE is set.
- Load embedded bitmaps only if FT_LOAD_NO_BITMAP isn't set.
-
- * src/tools/docmaker/content.py, src/tools/docmaker/sources.py,
- src/tools/docmaker/tohtml.py: Fixing a few nasty bugs.
-
- * src/sfnt/ttcmap0.c (tt_cmap4_validate): The validator for format 4
- sub-tables is now capable of dealing with invalid `length' fields at
- the start of the sub-table. This allows fonts like `mg______.ttf'
- (i.e. Marriage) to return accurate charmaps.
-
- * docs/CHANGES: Updated.
-
-2002-10-05 Werner Lemberg <wl@gnu.org>
-
- * src/smooth/ftgrays.c (SUBPIXELS): Add cast to `TPos'.
- Update all callers.
- (TRUNC): Add cast to `TCoord'.
- Update all callers.
- (TRaster): Use `TPos' for min_ex, max_ex, min_ey, max_ey, and
- last_ey.
- Update all casts.
- (gray_render_line): Fix casts for `p' and `first'.
-
-2002-10-02 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/bdf/bdflib.c (bdf_load_font): Allocate the _bdf_parse_t
- structure with FT_ALLOC instead of using the stack.
-
-2002-09-27 Werner Lemberg <wl@gnu.org>
-
- * src/include/freetype/internal/tttypes.h (num_sbit_strikes,
- num_sbit_scales): Use `FT_ULong'.
- * src/sfnt/sfobjs.c (sfnt_load_face): Updated accordingly.
- * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Ditto.
- (find_sbit_image): Remove cast.
- * src/raster/ftrend1.c (ft_raster1_render): Fix cast.
-
-2002-09-27 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * src/sfnt/ttload.c (tt_face_load_names): Use cast.
- * src/sfnt/ttcmap.c (code_to_next2): Use long constant.
- (code_to_index4): Use cast.
- (code_to_index8_12): Fix cast.
- * src/sfnt/ttcmap0.c (tt_cmap4_char_next, tt_cmap8_char_index,
- tt_cmap12_char_index): Use cast for `result'.
- (tt_face_build_cmaps): Use cast.
- * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_ucs4): Use cast for
- `code'.
- (sfnt_load_face): Use FT_Int32 for `flags'.
-
- * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line,
- gray_compute_cbox, gray_convert_glyph, gray_raster_reset): Add casts
- to `TCoord' and `int'.
- More 16bit fixes.
- s/FT_Pos/TPos/.
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Add casts.
-
-2002-09-26 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttpost.c (load_post_names, tt_face_free_ps_names,
- tt_face_get_ps_name): Replace switch statement with if clauses to
- make it more portable.
-
- * src/cff/cffobjs.c (cff_face_init): Ditto.
-
- * include/freetype/ftmodule.h (FT_Module_Class): Use `FT_Long' for
- `module_size'.
- * include/freetype/ftrender.h (FT_Glyph_Class_): Use `FT_Long' for
- `glyph_size'.
-
- * src/base/ftobjs.c (FT_Render_Glyph): Change second parameter to
- `FT_Render_Mode'.
- (FT_Render_Glyph_Internal): Change third parameter to
- `FT_Render_Mode'.
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Change second parameter
- to `FT_Render_Mode'.
-
- * src/raster/ftrend1.c (ft_raster1_render): Change third parameter
- to `FT_Render_Mode'.
- * src/smooth/ftsmooth.c (ft_smooth_render, ft_smooth_render_lcd,
- ft_smooth_render_lcd_v): Ditto.
- (ft_smooth_render_generic): Change third and fifth parameter to
- `FT_Render_Mode'.
-
- * include/freetype/freetype.h, include/freetype/internal/ftobjs.h,
- include/freetype/ftglyph.h: Updated.
-
- * src/cff/cffdrivr.c (Load_Glyph), src/pcf/pcfdriver.c
- (PCF_Glyph_Load), src/pfr/pfrobjs.c (pfr_slot_load),
- src/winfonts/winfnt.c (FNT_Load_Glyph), src/t42/t42objs.c
- (T42_GlyphSlot_Load), src/bdf/bdfdrivr.c (BDF_Glyph_Load): Change
- fourth parameter to `FT_Int32'.
-
- * src/pfr/pfrobjs.c (pfr_face_init): Add two missing parameters
- and declare them as unused.
-
- * src/cid/cidparse.h (CID_Parser): Use FT_Long for `postscript_len'.
-
- * src/psnames/psnames.h (PS_Unicode_Value_Func): Change return
- value to FT_UInt32.
- * src/psnames/psmodule.c (ps_unicode_value, ps_build_unicode_table):
- Updated accordingly.
-
-2002-09-26 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * src/cff/cffdrivr.c (Get_Kerning): Use FT_Long for `middle'.
- (cff_get_glyph_name): Use cast for result of ft_strlen.
- * src/cff/cffparse.c (cff_parse_real): User cast for assigning
- `exp'.
- * src/cff/cffload.c (cff_index_get_pointers): Use FT_ULong for
- some local variables.
- (cff_charset_load, cff_encoding_load): Use casts to FT_UInt for some
- switch statements.
- (cff_font_load): Use cast in call to CFF_Load_FD_Select.
- * src/cff/cffobjs.c (cff_size_init): Use more casts.
- (cff_face_init): Use FT_Int32 for `flags'.
- * src/cff/cffgload.c (cff_operator_seac): Use cast for assigning
- `adx' and `ady'.
- (cff_decoder_parse_charstrings): Use FT_ULong for third parameter.
- Use more casts.
- * src/cff/cffcmap.c (cff_cmap_unicode_init): Use cast for `count'.
-
- * src/cid/cidload.c (cid_read_subrs): Use FT_ULong for `len'.
- * src/cid/cidgload.c (cid_load_glyph): Add missing cast for
- `cid_get_offset'.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <18>: Use
- cast for `num_points'.
- (t1_decoder_init): Use cast for assigning `decoder->num_glyphs'.
-
- * src/base/ftdebug.c (ft_debug_init): Use FT_Int.
- * include/freetype/internal/ftdriver.h (FT_Slot_LoadFunc): Use
- `FT_Int32' for fourth parameter.
- * src/base/ftobjs.c (open_face): Use cast for calling
- clazz->init_face.
-
- * src/raster/ftraster.c (Set_High_Precision): Use `1' instead of
- `1L'.
- (Finalize_Profile_Table, Line_Up, ft_black_init): Use casts.
- * src/raster/ftrend1.c (ft_raster1_render): Ditto.
-
- * src/sfnt/sfnt_dir_check: Compare `magic' with unsigned long
- constant.
-
-2002-09-26 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/include/freetype/config/ftmodule.h: Updated.
-
-2002-09-25 David Turner <david@freetype.org>
-
- * src/autohint/ahtypes.h (AH_HINT_METRICS): Disabling metrics
- hinting in the auto-hinter. This produces much better anti-aliased
- text.
-
- * docs/CHANGES: Updating the changes documentation.
-
-2002-09-25 Anthony Fok <anthony@thizlinux.com>
-
- * src/sfnt/ttcmap0.c (tt_cmap4_validate, tt_cmap4_char_index,
- tt_cmap4_char_next): Added support for opens___.ttf (it contains a
- charmap that uses offset=0xFFFFU instead of 0x0000 to indicate a
- missing glyph).
-
-2002-09-21 Wolfgang Domröse <porthos.domroese@harz.de>
-
- * src/truetype/ttdriver.c (Load_Glyph): Fourth parameter must be
- FT_Int32.
- * src/truetype/ttgload.c, src/truetype/ttgload.h (TT_Load_Glyph):
- Ditto.
-
-2002-09-19 Wolfgang Domröse <porthos.domroese@harz.de>
-
- More 16bit fixes.
-
- * src/autohint/ahglobal.c (sort_values): Use FT_Pos for `swap'.
- (ah_hinter_compute_widths): Use FT_Pos for `dist'.
- Use AH_MAX_WIDTHS.
- * src/autohint/ahglyph.c (ah_outline_scale_blue_edges): Use FT_Pos
- for `delta'.
- (ah_outline_compute_edges): Replace some ints with FT_Int and
- FT_Pos.
- (ah_test_extrema): Clean up code.
- (ah_get_orientation): Use 4 FT_Int variables instead of FT_BBox to
- hold indices.
- * src/autohint/ahtypes.h (AH_SegmentRec): Change type of `score'
- to FT_Pos.
-
-2002-09-19 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/config.guess, builds/unix/config.sub: Updated to
- recent versions.
-
-2002-09-18 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c (FT_Library_Version): Bugfix.
-
- * FreeType 2.1.3rc2 (release candidate 2) is released!
-
-2002-09-17 David Turner <david@freetype.org>
-
- * include/freetype/freetype.h, include/freetype/ftimage.h,
- include/freetype/ftstroker.h, include/freetype/ftsysio.h,
- include/freetype/ftsysmem.h, include/freetype/ttnameid.h: Updating
- the in-source documentation.
-
- * src/tools/docmaker/tohtml.py: Updating the HTML formatter in the
- DocMaker tool.
-
- * src/tools/docmaker.py: Removed.
-
-2002-09-17 Werner Lemberg <wl@gnu.org>
-
- More 16bit fixes.
-
- * src/psaux/psobjs.c (reallocate_t1_table): Use FT_Long for
- second parameter.
-
-2002-09-16 Werner Lemberg <wl@gnu.org>
-
- 16bit fixes from Wolfgang Domröse.
-
- * src/type1/t1parse.h (T1_ParserRec): Change type of `base_len'
- and `private_len' to FT_Long.
- * src/type1/t1parse.c (T1_Get_Private_Dict): Remove cast for
- `private_len'.
- * src/type1/t1load.c: Use FT_Int cast for most calls of T1_ToInt.
- Use FT_PtrDist where appropriate.
- (parse_encoding): Use FT_Long for `count' and `n'.
- (read_binary_data): Use FT_Long* for second parameter.
- * src/type1/t1afm.c (afm_atoindex): Use FT_PtrDist.
-
- * src/cache/ftcsbits.c (ftc_sbit_node_load): Remove unused label.
- * src/pshinter/pshalgo3.c (psh3_hint_align): Remove unused variable.
-
-2002-09-14 Werner Lemberg <wl@gnu.org>
-
- Making ftgrays.c compile stand-alone again.
-
- * include/freetype/ftimage.h: Include ft2build.h only if _STANDALONE_
- isn't defined.
- * src/smooth/ftgrays.c [_STANDALONE_]: Define ft_memset,
- FT_BEGIN_HEADER, FT_END_HEADER.
- (FT_MEM_ZERO): Define.
- (TRaster) [GRAYS_USE_GAMMA]: Use `unsigned char' instead of FT_Byte.
- (gray_render_span, gray_init_gamma): Don't use `FT_UInt'.
- Don't cast with `FT_Byte'.
- (grays_init_gamma): Don't use `FT_UInt'.
-
-2002-09-14 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftinit.c (FT_Add_Default_Modules): Improve error message.
- * src/pcf/pcfdriver.c (PCF_Face_Done): Improve tracing message.
- * include/freetype/config/ftoption.h (FT_MAX_MODULES): Increased
- to 32.
-
-2002-09-10 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.ac (version_info): Set to 9:2:3.
- * builds/unix/configure: Regenerated.
- * docs/VERSION.DLL: Updated.
-
-2002-09-09 David Turner <david@freetype.org>
-
- * src/pshinter/pshalgo2.c (psh2_glyph_find_strong_points),
- src/pshinter/pshalgo3.c (psh3_glyph_find_strong_points): Adding fix
- to prevent segfault when hints are provided in an empty glyph.
-
- * src/cache/ftccache.i (GEN_CACHE_LOOKUP) [FT_DEBUG_LEVEL_ERROR]:
- Removed conditional code. This fixes a bug that prevented
- compilation in debug mode of template instantiation.
-
- * include/freetype/ftimage.h: Removed incorrect `zft_' definitions
- and updated constants documentation comments.
-
- * src/cff/cffparse.c (cff_parser_run): Fixed the CFF table loader.
- It didn't accept empty arrays, and this prevented the loading of
- certain fonts.
-
- * include/freetype/freetype.h (FT_FaceRec): Updating documentation
- comment. The `descender' value is always *negative*, not positive.
-
-2002-09-09 Owen Taylor <owen@redhat.com>
-
- * src/pcf/pcfdriver.c (PCF_Glyph_Load): Fixing incorrect computation
- of bitmap metrics.
-
-2002-09-08 David Turner <david@freetype.org>
-
- Various updates to correctly support subpixel rendering.
-
- * include/freetype/config/ftmodule.h: Add two renderers for LCD.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Updated.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_lcd,
- ft_smooth_render_lcd_v): Set FT_PIXEL_MODE_LCD and
- FT_PIXEL_MODE_LCD_V, respectively.
-
- * include/freetype/cache/ftcimage.h (FTC_ImageTypeRec): New
- structure.
- Updated all users.
- (FTC_ImageDesc): Removed.
- (FTC_ImageCache_Lookup): Second parameter is now of type
- `FTC_ImageType'.
- Updated all users.
- (FTC_IMAGE_DESC_COMPARE): Updated and renamed to...
- (FTC_IMAGE_TYPE_COMPARE): This.
- (FTC_IMAGE_DESC_HASH): Updated and renamed to...
- (FTC_IMAGE_TYPE_HASH): This.
-
- * include/freetype/cache/ftcsbits.h (FTC_SBitRec): Field `num_grays'
- replaced with `max_grays'.
- `pitch' is now FT_Short.
- (FTC_SBitCache_Lookup): Second parameter is now of type
- `FTC_ImageType'.
- Updated all users.
-
- * src/cache/ftcimage.c (FTC_ImageQueryRec, FTC_ImageFamilyRec):
- Updated.
- (ftc_image_node_init): Updated.
- Moved code to convert type flags to load flags to...
- (FTC_Image_Cache_Lookup): This function.
- (ftc_image_family_init): Updated.
-
- * src/cache/ftcsbits.c (FTC_SBitQueryRec, FTC_SBitFamilyRec):
- Updated.
- (ftc_sbit_node_load): Updated.
- Moved code to convert type flags to load flags to...
- (FTC_SBitCache_Lookup): This function.
-
- * src/autohint/ahtypes.h (AH_HinterRec): Replace `no_*_hints' with
- `do_*_snapping'.
- Update all users (with negation).
- * src/autohint/ahhint.c (ah_compute_stem_width): Fix threshold for
- `dist' for `delta' < 40.
-
- * src/pshinter/pshalgo3.h (PSH3_GlyphRec): Replace `no_*_hints' with
- `do_*_snapping'.
- Update all users (with negation).
- * src/pshinter/pshalgo3.c (psh3_dimension_quantize_len): New
- function.
- (psh3_hint_align): Use it.
- Improve hinting code.
- [STRONGER]: Removed.
- (STRONGER): Removed.
-
- * include/freetype/freetype.h (FT_Set_Hint_Flags, FT_HINT_*):
- Removed.
-
-2002-09-05 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidobjs.c (CID_Size_Init): Renamed to...
- (cid_size_init): This.
- * src/psaux/psobjs.c (T1_Builder_Add_Point1): Renamed to...
- (t1_builder_add_point1): This.
-
- Updated all affected code.
-
- * src/pshinter/pshalgo3.c (psh3_hint_align): Fix compiler warnings.
- * src/type1/t1gload.c (T1_Compute_Max_Advance): Ditto.
-
-2002-09-04 David Turner <david@freetype.org>
-
- * include/freetype/freetype.h: Corrected the definition of
- ft_encoding_symbol to be FT_ENCODING_MS_SYMBOL (instead of
- the erroneous FT_ENCODING_SYMBOL).
-
- * builds/unix/unix-def.in (datadir): Initialize it (thanks to
- Anthony Fok).
-
-2002-08-29 David Turner <david@freetype.org>
-
- Slight modification to the Postscript hinter to slightly increase
- the contrast of smooth hinting. This is very similar to what the
- auto-hinter does when it comes to stem width computations. However,
- it produces better results with well-hinted fonts.
-
- * include/freetype/internal/psaux.h (T1_Decoder_FuncsRec): Add hint
- mode to `init' member function.
- (T1_DecoderRec): Add hint mode.
- * include/freetype/internal/pshints (T1_Hints_ApplyFunc,
- T2_Hints_ApplyFunc): Pass `hint_mode', not `hint_flags'.
- * src/psaux/t1decode.c (t1_decoder_init): Add hint mode argument.
- * src/pshinter/pshalgo1.c (ps1_hints_apply): Pass hint mode, not
- hint flags.
- * src/pshinter/pshalgo2.c (ps2_hints_apply): Ditto.
- * src/pshinter/pshalgo3.c (ps3_hints_apply): Ditto.
- (STRONGER): New macro.
- (psh3_hint_align, psh3_hint_table_align_hints): Pass `glyph' instead
- of `hint_flags'.
- Implement announced changes.
- * src/pshinter/pshalgo3.h (PSH3_GlyphRec): Add flags to control
- vertical and horizontal hints and snapping.
-
- * README, docs/CHANGES: Updating for the 2.1.3 release.
-
-2002-08-27 David Turner <david@freetype.org>
-
- * Massive re-formatting changes to many, many source files. I don't
- want to list them all here. The operations performed were all
- logical transformations of the sources:
-
- - trying to convert all enums and constants to CAPITALIZED_STYLE,
- #with define definitions like
-
- #define my_old_constants MY_NEW_CONSTANT
-
- - big, big update of the documentation comments
-
- * include/freetype/freetype.h, src/base/ftobjs.c,
- src/smooth/ftsmooth.c, include/freetype/ftimage.h: Adding support
- for LCD-optimized rendering though the new constants/enums:
-
- FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V
- FT_PIXEL_MODE_LCD, FT_PIXEL_MODE_LCD_V
-
- This is still work in progress, don't expect everything to work
- correctly though most of the features have been implemented.
-
- * Adding new FT_LOAD_XXX flags, used to specify both hinting and
- rendering targets:
-
- FT_LOAD_TARGET_NORMAL :: anti-aliased hinting & rendering
- FT_LOAD_TARGET_MONO :: monochrome bitmaps
- FT_LOAD_TARGET_LCD :: horizontal RGB/BGR decimated
- hinting & rendering
- FT_LOAD_TARGET_LCD_V :: vertical RGB/BGR decimated
- hinting & rendering
-
- Note that FT_LOAD_TARGET_NORMAL is 0, which means that the default
- behaviour of the font engine is _unchanged_.
-
- * include/freetype/ftimage.h
- (FT_Outline_{Move,Line,Conic,Cubic}To_Func): Renamed to...
- (FT_Outline_{Move,Line,Conic,Cubic}ToFunc): This.
- (FT_Raster_Span_Func): Renamed to ...
- (FT_SpanFunc): This.
- (FT_Raster_{New,Done,Reset,Set_Mode,Render}_Func): Renamed to ...
- (FT_Raster_{New,Done,Reset,SetMode,Render}Func}: This.
-
- Updated all affected code.
-
- * include/freetype/ftrender.h
- (FT_Glyph_{Init,Done,Transform,BBox,Copy,Prepare}_Func): Renamed
- to ...
- (FT_Glyph_{Init,Done,Transform,GetBBox,Copy,Prepare}Func): This.
- (FTRenderer_{render,transform,getCBox,setMode}): Renamed to ...
- (FT_Renderer_{RenderFunc,TransformFunc,GetCBoxFunc,SetModeFunc}):
- This.
-
- Updated all affected code.
-
- * src/autohint/ahtypes.h (AH_Point, AH_Segment, AH_Edge, AH_Globals,
- AH_Face_Globals, AH_Outline, AH_Hinter): These typedefs are now
- pointers to the corresponding `*Rec' structures. All source files
- have been updated accordingly.
-
- * src/cff/cffgload.c (cff_decoder_init): Add hint mode as parameter.
- * src/cff/cffgload.h (CFF_Decoder): Add `hint_mode' element.
-
- * src/cid/cidgload.c (CID_Compute_Max_Advance): Renamed to...
- (cid_face_compute_max_advance): This.
- (CID_Load_Glyph): Renamed to...
- (cid_slot_load_glyph): This.
- * src/cid/cidload.c (CID_Open_Face): Renamed to...
- (cid_face_open): This.
- * src/cid/cidobjs.c (CID_GlyphSlot_{Done,Init}): Renamed to...
- (cid_slot_{done,init}): This.
- (CID_Size_{Get_Globals_Funcs,Done,Reset): Renamed to...
- (cid_size_{get_globals_funcs,done,reset): This.
- (CID_Face_{Done,Init}): Renamed to...
- (cid_face_{done,init}): This.
- (CID_Driver_{Done,Init}: Renamed to...
- (cid_driver_{done,init}: This.
- * src/cid/cidparse.c (CID_{New,Done}_Parser): Renamed to...
- (cid_parser_{new,done}): This.
- * src/cid/cidparse.h (CID_Skip_{Spaces,Alpha}): Renamed to...
- (cid_parser_skip_{spaces,alpha}): This.
- (CID_To{Int,Fixed,CoordArray,FixedArray,Token,TokenArray}): Renamed
- to...
- (cid_parser_to_{int,fixed,coord_array,fixed_array,token,token_array}):
- This.
- (CID_Load_{Field,Field_Table): Renamed to...
- (cid_parser_load_{field,field_table}): This.
- * src/cid/cidriver.c (CID_Get_Interface): Renamed to...
- (cid_get_interface): This.
-
- Updated all affected code.
-
- * src/psaux/psobjs.c (PS_Table_*): Renamed to...
- (ps_table_*): This.
- (T1_Builder_*): Renamed to...
- (t1_builder_*): This.
- * src/psaux/t1decode.c (T1_Decoder_*): Renamed to...
- (t1_decoder_*): This.
-
- * src/psnames/psmodule.c (PS_*): Renamed to...
- (ps_*): This.
-
- Updated all affected code.
-
- * src/sfnt/sfdriver (SFNT_Get_Interface): Renamed to...
- (sfnt_get_interface): This.
- * src/sfnt/sfobjs.c (SFNT_*): Renamed to...
- (sfnt_*): This.
- * src/sfnt/ttcmap.c (TT_CharMap_{Load,Free}): Renamed to...
- (tt_face_{load,free}_charmap): This.
- * src/sfnt/ttcmap0.c (TT_Build_CMaps): Renamed to...
- (tt_face_build_cmaps): This.
- * src/sfnt/ttload.c (TT_*): Renamed to...
- (tt_face_*): This.
- * src/sfnt/ttpost.c (TT_Post_Default_Names): Renamed to...
- (tt_post_default_names): This.
- (Load_*): Renamed to...
- (load_*): This.
- (TT_*): Renamed to...
- (tt_face_*): This.
- * src/sfnt/ttsbit.c (TT_*): Renamed to...
- (tt_face_*): This.
- ({Find,Load,Crop}_*): Renamed to...
- ({find,load,crop}_*): This.
-
- Updated all affected code.
-
- * src/smooth/ftsmooth.c (ft_smooth_render): Renamed to...
- (ft_smooth_render_generic): This.
- Make function more generic by adding vertical and horizontal scaling
- factors.
- (ft_smooth_render, ft_smooth_render_lcd, ft_smooth_render_lcd_v):
- New functions.
-
- (ft_smooth_lcd_renderer_class, ft_smooth_lcdv_renderer_class): New
- classes.
-
- * src/truetype/ttobjs.c (TT_{Done,New}_GlyphZone): Renamed to...
- (tt_glyphzone_{done,new}): This.
- (TT_{Face,Size,Driver}_*): Renamed to...
- (tt_{face,size,driver}_*): This.
- * src/truetype/ttpload.c (TT_Load_Locations): Renamed to...
- (tt_face_load_loca): This.
- (TT_Load_Programs): Renamed to...
- (tt_face_load_fpgm): This.
- (TT_*): Renamed to...
- (tt_face_*): This.
-
-2002-08-27 Werner Lemberg <wl@gnu.org>
-
- * docs/VERSION.DLL: New file.
-
-2002-08-23 Graham Asher <graham.asher@btinternet.com>
-
- * src/cff/cffgload.c (cff_operator_seac)
- [FT_CONFIG_OPTION_INCREMENTAL]: Incremental fonts (actually not
- incremental in the case of CFF but just using callbacks to get glyph
- recipes) pass the character code, not the glyph index, to the
- get_glyph_data function; they have no valid charset table.
-
- * src/cff/cffload.c (cff_font_load): Removed special cases for
- FT_CONFIG_OPTION_INCREMENTAL, which are no longer necessary; CFF
- fonts provided via the incremental interface now have to conform
- more closely to the CFF font format.
-
- * src/cff/cffload.h (cff_font_load): Removed argument now unneeded.
-
- * src/cff/cffobjs.c (cff_face_init): Changed call to cff_font_load
- to conform with new signature.
-
-2002-08-22 David Turner <david@freetype.org>
-
- * src/base/ftobject.c, src/base/ftsynth.c, src/base/ftstroker.c,
- src/bdf/bdfdrivr.c: Removed compiler warnings.
-
-2002-08-21 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshalgo3.c (psh3_glyph_compute_inflections,
- psh3_glyph_compute_extrema, psh3_hint_table_find_strong_point): Fix
- compiler warnings and resolve shadowing of local variables.
-
-2002-08-21 David Turner <david@freetype.org>
-
- The automatic and Postscript hinter now automatically detect
- inflection points in glyph outlines and treats them specially. This
- is very useful to prevent nasty effect like the disappearing
- diagonals of `S' and `s' in many, many fonts.
-
- * src/autohint/ahtypes.h (ah_flag_inflection): New macro.
- * src/autohint/ahangles.c (ah_angle_diff): New function.
- * src/autohint/ahangles.h: Updated.
- * src/autohint/ahglyph.c (ah_outline_compute_inflections): New
- function.
- (ah_outline_detect_features): Use it.
- * src/autohint/ahhint.c (ah_hinter_align_strong_points)
- [!AH_OPTION_NO_WEAK_INTERPOLATION]: Handle inflection.
-
- * src/tools/docmaker/docmaker.py, src/tools/docmaker/utils.py,
- src/tools/docmaker/tohtml.py: Updating the DocMaker tool.
-
- * include/freetype/freetype.h: Changing the type of the `load_flags'
- parameter from `FT_Int' to `FT_Int32', this in order to support more
- options. This should only break binary and/or source compatibility
- on 16-bit platforms (Atari?).
- (FT_LOAD_NO_AUTOHINT): New macro.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Updated.
- Handle FT_LOAD_NO_AUTOHINT.
- (FT_Load_Char): Updated.
-
- * src/pshinter/pshalgo3.c, src/base/ftobjs.c, src/base/ftobject.c,
- src/autohint/ahglyph.c, include/freetype/freetype.h: Fixing typos
- and removing compiler warnings.
-
-2002-08-20 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (TT_Get_Metrics): Add guard for k = 0.
-
-2002-08-20 David Turner <david@freetype.org>
-
- * src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.c,
- src/pshinter/pshglob.c, src/pshinter/pshrec.c,
- src/autohint/ahmodule.c [DEBUG_HINTER]: Removing compiler warnings
- (only used in development builds anyway).
-
- Improve support of local extrema and stem edge points.
-
- * src/pshinter/pshalgo3.h (PSH3_Hint_TableRec): Use PSH3_ZoneRec
- for `zones'.
- (PSH3_DIR_UP, PSH3_DIR_DOWN): Exchange values.
- (PSH3_DIR_HORIZONTAL, PSH3_DIR_VERTICAL): New macros.
- (PSH3_DIR_COMPARE, PSH3_DIR_IS_HORIZONTAL, PSH3_IS_VERTICAL): New
- macros.
- (PSH3_POINT_INFLEX): New enum.
- (psh3_point_{is,set}_{off,inflex}): New macros.
- (PSH3_POINT_{EXTREMUM,POSITIVE,NEGATIVE,EDGE_MIN,EDGE_MAX): New
- enum values.
- (psh3_point_{is,set}_{extremum,positive,negative,edge_min,edge_max}):
- New macros.
- (PSH3_PointRec): New members `flags2' and `org_v'.
- (PSH3_POINT_EQUAL_ARG, PSH3_POINT_ANGLE): New macros.
-
- * src/pshinter/pshalgo3.c [DEBUG_HINTER]: Removing compiler
- warnings.
- (COMPUTE_INFLEXS): New macro.
- (psh3_hint_align): Simplify some basic arithmetic computations.
- (psh3_point_is_extremum): Removed.
- (psh3_glyph_compute_inflections) [COMPUTE_INFLEXS]: New function.
- (psh3_glyph_init) [COMPUTE_INFLEXS]: Use it.
- (psh3_glyph_compute_extrema): New function.
- (PSH3_STRONG_THRESHOLD): Increased to 30.
- (psh3_hint_table_find_strong_point): Improved.
- (psh3_glyph_find_strong_points,
- psh3_glyph_interpolate_strong_points): Updated.
- (psh3_hints_apply): Use psh3_glyph_compute_extrema.
-
- * test/gview.c (draw_ps3_hint, ps3_draw_control_points): New
- functions.
- Other small updates.
-
- * Jamfile: Small updates.
-
-2002-08-18 Arkadiusz Miskiewicz <misiek@pld.ORG.PL>
-
- * builds/unix/install.mk (install, uninstall): Add $(DESTDIR) to
- make life easier for package maintainers.
-
-2002-08-18 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfdriver.c (PCF_Glyph_Load): Fix computation of
- horiBearingX.
- * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Fix computation of
- horiBearingY.
-
-2002-08-16 George Williams <gww@silcom.com>
-
- Add support for Apple composite glyphs.
-
- * include/freetype/config/ftoption.h
- (TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED): New macro.
-
- * src/truetype/ttgload.c (OVERLAP_COMPOUND, SCALED_COMPONENT_OFFSET,
- UNSCALED_COMPONENT_OFFSET): New macros for additional OpenType
- glyph loading flags.
- (load_truetype_glyph): Implement it.
-
-2002-08-16 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (cff_free_glyph_data),
- src/cff/cffload.c (cff_font_load): Use FT_UNUSED.
-
-2002-08-15 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Initialize `error'.
- * src/sfnt/sfobjs.c (SFNT_Load_Face): Fix compiler warning.
-
-2002-08-15 Graham Asher <graham.asher@btinternet.com>
-
- Implemented the incremental font loading system for the CFF driver.
- Tested using the GhostScript-to-FreeType bridge (under development).
-
- * src/cff/cffgload.c (cff_get_glyph_data, cff_free_glyph_data): New
- functions.
- (cff_operator_seac, cff_compute_max_advance, cff_slot_load): Use
- them.
- * src/cff/cffload.c (cff_font_load): Add `face' parameter.
- Load charset and encoding only if there are glyphs.
- [FT_CONFIG_OPTION_INCREMENTAL]: Incremental fonts don't need
- character recipes.
- * src/cff/cffload.h, src/cff/cffobjs.c: Updated.
-
- * src/cid/cidgload.c (cid_load_glyph)
- [FT_CONFIG_OPTION_INCREMENTAL]: Corrected the incremental font
- loading implementation to use the new system introduced on
- 2002-08-01.
-
-2002-08-06 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffcmap.c: Remove compiler warnings.
- * src/cache/ftccache.c, src/cache/ftccache.i,
- src/pfr/pfrload.c, src/pfr/pfrgload.c: s/index/idx/.
- * src/cff/cffload.c: s/select/fdselect/.
- * src/raster/ftraster.c: s/wait/waiting/.
-
-2002-08-01 Graham Asher <graham.asher@btinternet.com>
-
- * src/type1/t1load.c (T1_Open_Face): Tolerate a face with no
- charstrings if there is an incremental loading interface. Type 1
- faces supplied by PostScript interpreters like GhostScript will
- typically not provide any charstrings at load time, so this is
- essential if they are to work.
-
-2002-08-01 Graham Asher <graham.asher@btinternet.com>
-
- Modified incremental loading interface to be closer to David's
- preferences. The header freetype.h is not now affected, the
- interface is specified via an FT_Parameter, the pointer to the
- interface is hidden in an internal part of the face record, and all
- the definitions are in ftincrem.h.
-
- * include/freetype/freetype.h [FT_CONFIG_OPTION_INCREMENTAL]:
- Removed.
- * include/freetype/internal/ftobjs.h [FT_CONFIG_OPTION_INCREMENTAL]:
- Include FT_INCREMENTAL_H.
- (FT_Face_InternalRec) [FT_CONFIG_OPTION_INCREMENTAL]: Add
- `incremental_interface'.
-
- * src/base/ftobjs.c (open_face, FT_Open_Face)
- [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
- * src/sfnt/sfobjs.c (SFNT_Load_Face) [FT_CONFIG_OPTION_INCREMENTAL]:
- Updated.
-
- * src/truetype/ttgload.c (load_truetype_glyph)
- [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
- Free loaded glyph data properly.
- (compute_glyph_metrics, TT_Load_Glyph)
- [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
- * src/truetype/ttobjs.c (TT_Face_Init)
- [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String)
- [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
- (T1_Parse_Glyph) [FT_CONFIG_OPTION_INCREMENTAL]: Updated.
- Free loaded glyph data properly.
- (T1_Load_Glyph): Updated.
- [FT_CONFIG_OPTION_INCREMENTAL]: Free loaded glyph data properly.
-
-2002-07-30 David Turner <david@freetype.org>
-
- * include/freetype/ftincrem.h: Adding new experimental header file
- to demonstrate a `cleaner' API to support incremental font loading.
-
- * include/freetype/config/ftheader.h (FT_INCREMENTAL_H): New macro.
-
- * src/tools/docmaker/*: Adding new (more advanced) version of
- the DocMaker tool, using Python's sophisticated regexps.
-
-2002-07-28 Werner Lemberg <wl@gnu.org>
-
- s/ft_memset/FT_MEM_SET/.
- s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.
-
-2002-07-27 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (sfnt_dir_check): Make it work with TTCs.
-
-2002-07-26 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph)
- [FT_CONFIG_OPTION_INCREMENTAL]: s/memset/ft_memset/.
-
- * src/autohint/ahhint.c (ah_hint_edges_3): Fix compiler warning.
- * src/cff/cffload.c (cff_encoding_load): Remove `memory' variable.
- * src/cff/cffcmap.c (cff_cmap_encoding_init): Remove `psnames'
- variable.
- * src/truetype/ttgload.c (load_truetype_glyph): Remove statement
- without effect.
- * src/truetype/ttdriver (Get_Char_Index, Get_Next_Char): Removed.
-
- * src/pshinter/pshalgo3.c (psh3_hint_table_record,
- psh3_hint_table_init, psh3_hint_table_activate_mask): Fix error
- message.
-
-2002-07-24 Graham Asher <graham.asher@btinternet.com>
-
- * src/truetype/ttobjs.c: Fix for bug reported by Sven Neumann
- [sven@gimp.org] on the FreeType development forum: `If
- FT_CONFIG_OPTION_INCREMENTAL is undefined (this is the default), the
- TrueType loader crashes in line 852 of src/truetype/ttgload.c when
- it tries to access face->glyph_locations.'
-
-2002-07-18 Graham Asher <graham.asher@btinternet.com>
-
- Added types and structures to support incremental typeface loading.
- The FT_Incremental_Interface structure, defined in freetype.h, is
- designed to be passed to FT_Open_Face to provide callback functions
- to obtain glyph recipes and metrics, for fonts like those passed
- from PostScript that do not necessarily provide all, or any, glyph
- information, when first opened.
-
- * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_INCREMENTAL):
- New configuration macro to enable incremental face loading. By
- default it is not defined.
-
- * include/freetype/freetype.h (FT_Basic_Glyph_Metrics,
- FT_Get_Glyph_Data_Func, FT_Get_Glyph_Metrics_Func,
- FT_Incremental_Interface_Funcs, FT_Incremental_Interface)
- [FT_CONFIG_OPTION_INCREMENTAL]: New.
- (FT_Open_Args, FT_FaceRec) [FT_CONFIG_OPTION_INCREMENTAL]: New field
- `incremental_interface'.
- (FT_Open_Flags) [FT_CONFIG_OPTION_INCREMENTAL]: New enum
- `ft_open_incremental'.
-
- * include/freetype/fttypes.h: Include FT_CONFIG_CONFIG_H.
- (FT_Data): New structure to represent binary data.
-
- * src/base/ftobjs.c (open_face) [FT_CONFIG_OPTION_INCREMENTAL]:
- Add parameter for incremental loading.
- (FT_Open_Face) [FT_CONFIG_OPTION_INCREMENTAL]: Use incremental
- interface.
-
- * src/truetype/ttgload.c (load_truetype_glyph)
- [FT_CONFIG_OPTION_INCREMENTAL]: Added the incremental loading system
- for the TrueType driver.
- (compute_glyph_metrics): Return FT_Error.
- [FT_CONFIG_OPTION_INCREMENTAL]: Check for overriding metrics.
- (TT_Load_Glyph) [FT_CONFIG_OPTION_INCREMENTAL]: Don't look for
- the glyph table while handling an incremental font.
- Get glyph offset.
-
- * src/truetype/ttobjs.c (TT_Face_Init)
- [FT_CONFIG_OPTION_INCREMENTAL]: Added the incremental loading
- system for the TrueType driver.
-
- * src/cid/cidgload.c (cid_load_glyph)
- [FT_CONFIG_OPTION_INCREMENTAL]: Added the incremental loading system
- for the CID driver.
-
- * src/sfnt/sfobjs.c (SFNT_Load_Face) [FT_CONFIG_OPTION_INCREMENTAL]:
- Changes to support incremental Type 42 fonts: Assume a font has
- glyphs if it has an incremental interface object.
-
- * src/type1/t1gload.c (T1_Parse_Glyph): Renamed to...
- (T1_Parse_Glyph_And_Get_Char_String): This.
- [FT_CONFIG_OPTION_INCREMENTAL]: Added support for incrementally
- loaded Type 1 faces.
- (T1_Parse_Glyph): New function.
- (T1_Load_Glyph): Updated.
-
-2002-07-17 David Turner <david@freetype.org>
-
- Cleaning up the cache sub-system code; linear hashing is now the
- default.
-
- * include/freetype/cache/ftccache.h, src/cache/ftccache.i,
- src/cache/ftccache.c [!FTC_CACHE_USE_LINEAR_HASHING]: Removed.
- (FTC_CACHE_USE_LINEAR_HASHING): Removed also.
-
- FT_CONFIG_OPTION_USE_CMAPS is now the default.
-
- * include/freetype/internal/ftdriver.h (FT_Driver_ClassRec): Remove
- `get_char_index' and `get_next_char'.
-
- * include/freetype/config/ftoption.h,
- include/freetype/internal/tttypes.h, src/base/ftobjs.c,
- src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/pcf/pcfdrivr.c,
- src/pfr/pfrdrivr.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c,
- src/sfnt/ttcmap0.h, src/sfnt/ttload.c, src/type1/t1objs.c,
- src/type42/t42objs.c, src/winfonts/winfnt.c
- [!FT_CONFIG_OPTION_USE_CMAPS]: Removed. The new cmap code is now
- the default.
-
- * src/type42/t42objs.c (T42_CMap_CharIndex, T42_CMap_CharNext):
- Removed.
- * src/type42/t42objs.h: Updated.
-
- * src/cid/cidriver.c (Cid_Get_Char_Index, Cid_Get_Next_Char):
- Removed.
- (t1cid_driver_class): Updated.
- * src/truetype/ttdriver.c (tt_driver_class): Updated.
- * src/type1/t1driver.c (Get_Char_Index, Get_Next_Char): Removed
- (t1_driver_class): Updated.
- * src/type42/t42drivr.c (t42_driver_class): Updated.
-
- * src/base/ftobjs.c (open_face): Select Unicode cmap by default.
-
- * src/sfnt/ttload.c (TT_Load_SFNT_Header): Fixed a recent bug that
- prevented OpenType fonts to be recognized by FreeType.
-
-2002-07-11 David Turner <david@freetype.org>
-
- Changing the SFNT loader to check for SFNT-based font files
- differently. We now ignore the range `helper' fields and check the
- `head' table's magic number instead.
-
- * include/freetype/internal/tttypes.h (SFNT_HeaderRec): Add `offset'
- field.
-
- * src/sfnt/ttload.c (sfnt_dir_check): New function.
- (TT_Load_SFNT_HeaderRec): Renamed to...
- (TT_Load_SFNT_Header): This.
- Implement new functionality.
- * src/sfnt/ttload.h: Updated.
- * src/sfnt/sfdriver.c (sfnt_interface): Updated.
-
- * src/base/ftobject.c, src/base/fthash.c: Updated object sub-system
- and dynamic hash table implementation (still experimental, don't
- use).
- * include/freetype/internal/fthash.h: Updated.
- * include/freetype/internal/ftobjs.h (FT_LibraryRec): New member
- `meta_class'.
-
- Fixing a bug in the Type 1 loader that prevented valid font bounding
- boxes to be loaded from multiple master fonts.
-
- * include/freetype/t1tables.h (PS_BlendRec): Add `bboxes' field.
-
- * include/freetype/internal/psaux.h (T1_FieldType): Add
- `T1_FIELD_TYPE_BBOX'.
- (T1_FieldLocation): Add `T1_FIELD_LOCATION_BBOX'.
- (T1_FIELD_BBOX): New macro.
-
- * src/psaux/psobjs.c (PS_Parser_LoadField): Handle T1_FIELD_TYPE_BBOX.
- * src/type1/t1load.c (t1_allocate_blend): Create blend->bboxes.
- (T1_Done_Blend): Free blend->bboxes.
- (t1_load_keyword): Handle T1_FIELD_LOCATION_BBOX.
- (parse_font_bbox): Commented out.
- (t1_keywords): Comment out `parse_font_bbox'.
- * src/type1/t1tokens.h: Define `FontBBox' field.
-
-2002-07-10 David Turner <david@freetype.org>
-
- * src/cff/cffobjs.c: Small fix to select the Unicode charmap by
- default when needed.
- Small fix to allow OpenType fonts to support Adobe charmaps when
- needed.
-
- * src/cff/cffcmap.c, src/cff/cffcmap.h: New files to support
- charmaps for CFF fonts.
-
- * src/cff/cff.c, src/cff/Jamfile, src/cff/rules.mk: Updated.
-
- * include/freetype/internal/cfftypes.h (CFF_EncodingRec): Use
- fixed-length arrays for `sids' and `codes'. Add `count' member.
- (CFF_FontRec): Add `psnames' member.
-
- * src/cff/cffdrivr.c, src/cff/cffload.c, src/cff/cffload.h,
- src/cff/cffobjs.c, src/cff/cffobjs.h, src/cff/cffparse.c,
- src/cffparse.h, src/cff/cffgload.c, src/cff/cffgload.h: Adding
- support for CFF charmaps, reformatting the sources, and removing
- some bugs in the Encoding and Charset loaders.
- Many fonts renamed to use lowercase only:
-
- CFF_Builder_Init -> cff_builder_init
- CFF_Builder_Done -> cff_builder_done
- CFF_Init_Decoder -> cff_decoder_init
- CFF_Parse_CharStrings -> cff_decoder_parse_charstrings
- CFF_Load_Glyph -> cff_slot_load
- CFF_Init_Decoder -> cff_decoder_init
- CFF_Prepare_Decoder -> cff_decoder_prepare
- CFF_Get_Standard_Encoding -> cff_get_standard_encoding
- CFF_Access_Element -> cff_index_access_element
- CFF_Forget_Element -> cff_index_forget_element
- CFF_Get_Name -> cff_index_get_name
- CFF_Get_String -> cff_index_get_sid_string
- CFF_Get_FD -> cff_fd_select_get
- CFF_Done_Charset -> cff_charset_done
- CFF_Load_Charset -> cff_charset_load
- CFF_Done_Encoding -> cff_encoding_done
- CFF_Load_Encoding -> cff_encoding_load
- CFF_Done_SubFont -> cff_subfont_done
- CFF_Load_Font -> cff_font_load
- CFF_Done_Font -> cff_font_done
- CFF_Size_Get_Globals_Funcs -> cff_size_get_globals_funcs
- CFF_Size_Done -> cff_size_done
- CFF_Size_Init -> cff_size_init
- CFF_Size_Reset -> cff_size_reset
- CFF_GlyphSlot_Done -> cff_slot_done
- CFF_GlyphSlot_Init -> cff_slot_init
- CFF_StrCopy -> cff_strcpy
- CFF_Face_Init -> cff_face_init
- CFF_Face_Done -> cff_face_done
- CFF_Driver_Init -> cff_driver_init
- CFF_Driver_Done -> cff_driver_done
- CFF_Parser_Init -> cff_parser_init
- CFF_Parser_Run -> cff_parser_run
-
- add_point -> cff_builder_add_point
- add_point1 -> cff_builder_add_point1
- add_contour -> cff_builder_add_contour
- close_contour -> cff_builder_close_contour
- cff_explicit_index -> cff_index_get_pointers
-
-2002-07-09 Owen Taylor <owen@redhat.com>
-
- * src/pshinter/pshglob.c (psh_globals_new): Fixed a bug that
- prevented the hinter from using correct standard width and height
- values, resulting in hinting bugs with certain fonts (e.g. Utopia).
-
-2002-07-07 David Turner <david@freetype.org>
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Added code to return
- successfully when the function is called with a bitmap glyph (the
- previous code simply returned with an error).
-
- * docs/DEBUG.TXT: Adding debugging support documentation.
-
- * src/base/ftdebug.c (ft_debug_init), builds/win32/ftdebug.c
- (ft_debug_init), builds/amiga/src/ftdebug.c (ft_debug_init): Changed
- the syntax of the FT2_DEBUG environment variable used to control
- debugging output (i.e. logging and error messages). It must now
- look like:
-
- any:6 memory:4 io:3 or
- any:6,memory:4,io:3 or
- any:6;memory:4;io:3
-
-2002-07-07 Owen Taylor <owen@redhat.com>
-
- * src/pshinter/pshglob.c (psh_blues_snap_stem): Adding support for
- blue fuzz.
- * src/pshinter/pshglob.h (PSH_BluesRec): Add `blue_fuzz' field.
- * src/type1/t1load.c (T1_Open_Face): Initialize `blue_fuzz'.
-
- Adding support for hinter-specific bit flags, and the new
- FT_Set_Hint_Flags high-level API.
-
- * include/freetype/freetype.h (FT_Set_Hint_Flags): New function.
- (FT_HINT_NO_INTEGER_STEM, FT_HINT_NO_HSTEM_ALIGN,
- FT_HINT_NO_VSTEM_ALIGN): New macros.
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Add
- `hint_flags' member.
-
- * src/base/ftobjs.c (FT_Set_Hint_Flags): New function.
-
- * include/freetype/internal/psaux.h (T1_DecoderRec): Add `hint_flags'
- member.
-
- * include/freetype/internal/pshints.h (T1_Hints_ApplyFunc,
- T2_Hints_ApplyFunc): Add parameter to pass hint flags.
-
- * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings,
- T1_Decoder_Init): Use decoder->hint_flags.
- * src/cff/cffgload.h (CFF_Builder): Add `hint_flags' field.
- * src/cff/cffgload.c (CFF_Builder_Init): Set builder->hint_flags.
- (CFF_Parse_CharStrings): Updated.
- * src/pshinter/pshalgo1.c (ps1_hints_apply): Add parameter to handle
- hint flags (unused).
- * src/pshinter/pshalgo1.h: Updated.
- * src/pshinter/pshalgo2.c (ps2_hints_apply): Add parameter to handle
- hint flags (unused).
- * src/pshinter/pshalgo2.h: Updated.
- * src/pshinter/pshalgo3.c (ps3_hints_apply): Add parameter to handle
- hint flags.
- * src/pshinter/pshalgo3.h: Updated.
-
-2002-07-04 David Turner <david@freetype.org>
-
- * src/pfr/pfrobjs.c (pfr_slot_load): Fixed a small bug that returned
- incorrect advances when the outline resolution was different from
- the metrics resolution.
-
- * src/autohint/ahhint.c: Removing compiler warnings.
-
- * src/autohint/ahglyph.c: s/FT_MEM_SET/FT_ZERO/ where appropriate.
- (ah_outline_link_segments): Slight improvements to the serif
- detection code. More work is needed though.
-
-2002-07-03 David Turner <david@freetype.org>
-
- Small improvements to the automatic hinter. Uneven stem-widths have
- now disappeared and everything looks much better, even if there are
- still issues with serifed fonts.
-
- * src/autohint/ahtypes.h (AH_Globals): Added `stds' array.
- * src/autohint/ahhint.c (OPTIM_STEM_SNAP): New #define.
- (ah_snap_width): Commented out.
- (ah_align_linked_edge): Renamed to...
- (ah_compute_stem_width): This.
- Don't allow uneven stem-widths.
- (ah_align_linked_edge): New function.
- (ah_align_serifed_edge): Don't strengthen serifs.
- (ah_hint_edges_3, ah_hinter_scale_globals): Updated.
-
-2002-07-03 Owen Taylor <owen@redhat.com>
-
- Adding new algorithm based on Owen Taylor's recent work.
-
- * src/pshinter/pshalgo3.c, src/pshinter/pshalgo3.h: New files.
- * src/pshinter/pshalgo.h: Updated.
- Use pshalgo3 by default.
- * src/pshinter/pshinter.c: Include pshalgo3.c.
-
- * src/pshinter/Jamfile, src/pshinter/rules.mk: Updated.
-
-2002-07-01 Owen Taylor <owen@redhat.com>
-
- * src/pshinter/pshalgo2.c (psh2_glyph_find_strong_points): Fix a bug
- where, if a glyph has more than hint mask, the second mask gets
- applied to points that should have been covered by the first mask.
-
-2002-07-01 Keith Packard <keithp@keithp.com>
-
- * src/sfnt/ttcmap0.c (tt_cmap8_char_next, tt_cmap12_char_next):
- Fixing the cmap 8 and 12 parsing routines.
-
-2002-07-01 David Turner <david@freetype.org>
-
- * src/base/ftsynth.c: Include FT_TRIGONOMETRY_H.
- (FT_Outline_Embolden): Renamed to...
- (FT_GlyphSlot_Embolden): This.
- Updated to new trigonometric functions.
- (FT_Outline_Oblique): Renamed to...
- (FT_GlyphSlot_Oblique): This.
- (ft_norm): Removed.
- * include/freetype/ftsynth.h: Updated.
-
-2002-06-26 David Turner <david@freetype.org>
-
- * include/freetype/internal/ftobject.h: Updating the object
- sub-system definitions (still experimental).
-
- * src/base/fthash.c (ft_hash_remove): Fixing a small reallocation
- bug.
-
- * src/base/fttrigon.c (FT_Vector_From_Polar, FT_Angle_Diff): New
- functions.
- * include/freetype/fttrigon.h: Updated.
-
-
- Adding path stroker component (work in progress).
-
- * include/freetype/ftstroker.h, src/base/ftstroker.c: New files.
- * src/base/Jamfile: Updated.
-
- * include/freetype/config/ftheader.h (FT_STROKER_H): New macro.
-
-
- * src/truetype/ttgload.c (TT_Load_Composite_Glyph),
- src/base/ftoutln.c (FT_Vector_Transform): Fixed Werner's latest fix.
- FT_Vector_Transform wasn't buggy, the TrueType composite loader was.
-
-2002-06-24 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
-
-2002-06-21 David Turner <david@freetype.org>
-
-
- * Version 2.1.2 released.
- =========================
-
-
-2002-06-21 Roberto Alameda <ojancano@geekmail.de>.
-
- * include/freetype/internal/t42types.h (T42_Font): Removed since
- it is already in t42objs.h.
- (T42_Face): Use T1_FontRec.
-
- * src/base/fttype1.c (FT_Get_PS_Font_Info): Updated.
- (FT_Has_PS_Glyph_Names): Check for type42 driver name also.
- * src/type42/t42objs.h: Include FT_INTERNAL_TYPE42_TYPES_H.
- (T42_Face): Removed since it is already in t42types.h.
-
-2002-06-21 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/pfrgload.c (pfr_glyph_load_compound): Fix loading of composite
- glyphs.
-
-2002-06-21 Sven Neumann <sven@convergence.de>
-
- * src/pfr/pfrtypes.h (PFR_KernPair): New structure.
- (PFR_PhyFont): Use it.
- (PFR_KernFlags): New enumeration.
- * src/pfr/pfrload.c (pfr_extra_item_load_kerning_pairs): New
- function.
- (pfr_phy_font_extra_items): Use it.
- (pfr_phy_font_done): Updated.
- * src/pfr/pfrobjs.c (pfr_face_init): Set kerning flag conditionally.
- (pfr_face_get_kerning): New function.
- * src/pfr/pfrobjs.h: Updated.
- * src/pfr/pfrdrivr.c (pfr_driver_class): Updated.
-
-2002-06-21 David Turner <david@freetype.org>
-
- * README, docs/CHANGES: Preparing the 2.1.2 release.
-
-2002-06-19 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/base/fttype1.c: Include FT_INTERNAL_TYPE42_TYPES_H.
- (t1_face_check_cast): Removed.
- (FT_Get_PS_Font_Info): Make it work with CID and Type 42 drivers
- also.
-
-2002-06-19 Sebastien BARRE <http://barre.nom.fr/contact.html#email>
-
- * src/type42/t42parse.c (t42_parse_sfnts): Fix compiler warning.
-
-2002-06-19 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftoutln.c (FT_Vector_Transform): Fix serious typo
- (xy <-> yx).
- * src/truetype/ttgload.c (load_truetype_glyph): Replace `|' with
- `||' to make code easier to read.
-
-2002-06-18 Roberto Alameda <ojancano@geekmail.de>.
-
- * src/type42/t42objs.c (t42_check_size_change): Removed.
- (T42_Size_SetChars, T42_Size_SetPixels): Use FT_Activate_Size
- instead.
- (T42_GlyphSlot_Load): Remove call to t42_check_size_change.
-
-2002-06-18 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/psaux/t1cmap.c (t1_cmap_custom_char_index,
- t1_cmap_custom_char_next): Fix index computation -- indices start
- with 0 and not with cmap->first.
-
- Provide default charmaps.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdriver.c
- (PCF_Face_Init), src/pfr/pfrobjs.c (pfr_face_init),
- src/type1/t1objs (T1_Face_Init), src/winfonts/winfnt.c
- (FNT_Face_Init): Implement it.
-
-2002-06-17 Sven Neumann <sven@gimp.org>
-
- * src/pfr/pfrobjs.c (pfr_face_init): Fix typo.
-
-2002-06-16 Leonard Rosenthol <leonardr@lazerware.com>
-
- Updated Win32/VC++ projects to include the new PFR driver.
-
- * builds/win32/visualc/freetype.dsp: Updated.
-
-2002-06-16 Anthony Fok <fok@debian.org>
-
- Install freetype2.m4.
-
- * builds/unix/install.mk (install, uninstall): Handle it.
-
-2002-06-16 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- Same fix for PFR driver.
-
- * src/pfr/pfrcmap.c (pfr_cmap_char_index, pfr_cmap_char_next):
- Increase return value by 1.
- * src/pfr/pfrobjs.c (pfr_slot_load): Decrease index by 1.
-
-2002-06-15 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- Fix glyph indices to make index zero always the undefined glyph.
-
- * src/bdf/bdfdrivr.c (bdf_cmap_init): Don't decrease
- cmap->num_encodings.
- (bdf_cmap_char_index, bdf_cmap_char_next, BDF_Get_Char_Index):
- Increase result by 1 for normal cases.
- (BDF_Glyph_Load): Decrease index by 1.
-
- * src/pcf/pcfdriver.c (pcf_cmap_char_index, pcf_cmap_char_next,
- PCF_Char_Get_Index): Increase result by 1 for normal cases.
- (PCF_Glyph_Load): Decrease index by 1.
- * src/pcf/pcfread.c (pcf_get_encodings): Don't decrease j for
- allocating `encoding'.
-
- * src/base/ftobjs.c (FT_Load_Glyph, FT_Get_Glyph_Name): Fix
- bounding tests.
-
-2002-06-14 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- Add new cmap support to BDF driver.
-
- * src/bdf/bdfdrivr.c (BDF_CMapRec) [FT_CONFIG_OPTION_USE_CMAPS]:
- New structure.
- (bdf_cmap_init, bdf_cmap_done, bdf_cmap_char_index,
- bdf_cmap_char_next) [FT_CONFIG_OPTION_USE_CMAPS]: New functions.
- (BDF_Get_Char_Index) [!FT_CONFIG_OPTION_USE_CMAPS]: Use only
- conditionally.
- (BDF_Face_Init): Handle `AVERAGE_WIDTH' and `POINT_SIZE' keywords.
- Implement new cmap handling.
- (bdf_driver_class): Updated.
-
-2002-06-14 Werner Lemberg <wl@gnu.org>
-
- * Makefile, configure, */*.mk, builds/unix/unix-def.in,
- docs/CHANGES, docs/INSTALL: s/TOP/TOP_DIR/.
-
-2002-06-12 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdflib.c: s/FT_Short/short/ for consistency.
-
-2002-06-11 David Turner <david@freetype.org>
-
- * builds/win32/ftdebug.c: Added a missing #endif.
-
- * src/sfnt/ttload.c, src/bdf/bdflib.c: Removing compiler warnings.
-
- Removed the bug in Type 42 driver that prevented un-hinted outlines
- to be loaded.
-
- * src/type42/t42objs.c (T42_Face_Init): Call FT_Done_Size.
- (T42_Size_Init): Call FT_Activate_Size.
- (t42_check_size_change): New function.
- (T42_Size_SetChars, T42_Size_SetPixels): Use it.
- (ft_glyphslot_clear): Replace FT_MEM_SET with FT_ZERO.
- (T42_GlyphSlot_Load): Use t42_check_size_change.
- Initialize more fields of `glyph'.
-
- * builds/win32/visualc/freetype.dsp: Updated.
-
-2002-06-09 David Turner <david@freetype.org>
-
-
- * Version 2.1.1 released.
- =========================
-
-
-2002-06-08 Juliusz Chroboczek <jch@pps.jussieu.fr>
-
- * include/freetype/internal/ftobjs.h, src/autohint/ahglyph.c,
- src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/smooth/ftgrays.c: Don't
- use `setjmp', `longjmp', and `jmp_buf' but `ft_setjmp', `ft_longjmp',
- and `ft_jmp_buf'.
- Removed direct references to <stdio.h> and <setjmp.h> when
- appropriate, to eventually replace them with a
- FT_CONFIG_STANDARD_LIBRARY_H. Useful for the XFree86 Font Server
- backend based on FT2.
-
- * src/base/fttype1.c (FT_Has_PS_Glyph_Names): Fix return value.
-
-2002-06-08 David Turner <david@freetype.org>
-
- * src/pcf/pcfdriver.c (pcf_cmap_char_next): Fixed a bug that caused
- the function to return invalid values.
-
- * src/cache/ftccache.i: Removing a typo that prevented
- the source's compilation.
-
- * src/cache/ftccache.c (ftc_node_hash_unlink): Fixed a
- bug that caused nasty memory overwrites. The hash table's
- buckets array wasn't correctly resized when shrunk.
-
-2002-06-08 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/smakefile, builds/amiga/makefile: Updated.
-
-2002-06-08 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftccache.c (ftc_node_hash_unlink, ftc_node_hash_link)
- [FTC_CACHE_USE_LINEAR_HASHING]: Fix returned error code.
- Fix debugging messages.
- * src/cache/ftccache.i (GEN_CACHE_LOOKUP): Move declaration of
- `family' and `hash' up to make it compilable with g++.
-
- * src/type42/t42error.h: New file.
- * src/type42/t42drivr.c, src/type42/t42objs.c,
- src/type42/t42parse.c: Use t42 error codes.
- * src/type42/rules.mk: Updated.
-
- * src/base/ftnames.c: Include FT_INTERNAL_STREAM_H.
-
-2002-06-08 David Turner <david@freetype.org>
-
- * src/cache/ftccmap.c: GEN_CACHE_FAMILY_COMPARE,
- GEN_CACHE_NODE_COMPARE, GEN_CACHE_LOOKUP) [FTC_CACHE_USE_INLINE]:
- New macros.
- (ftc_cmap_cache_lookup) [!FTC_CACHE_USE_INLINE]: Typedef to
- ftc_cache_lookup.
- (FTC_CMapCache_Lookup): Updated.
-
- Adding various experimental optimizations to the cache manager.
-
- * include/freetype/cache/ftccache.h (FTC_CACHE_USE_INLINE,
- FTC_CACHE_USE_LINEAR_HASHING): New options.
- (FTC_CacheRec) [FTC_CACHE_USE_LINEAR_HASHING]: New elements `p',
- `mask', and `slack'.
-
- * src/cache/ftccache.c (FTC_HASH_MAX_LOAD, FTC_HASH_MIN_LOAD,
- FTC_HASH_SUB_LOAD) [FTC_CACHE_USE_LINEAR_HASHING,
- FTC_HASH_INITIAL_SIZE]: New macros.
- (ftc_node_mru_link, ftc_node_mru_up): Optimized.
- (ftc_node_hash_unlink, ftc_node_hash_link)
- [FTC_CACHE_USE_LINEAR_HASHING]: New variants.
- (FTC_PRIMES_MIN, FTC_PRIMES_MAX, ftc_primes, ftc_prime_closest,
- FTC_CACHE_RESIZE_TEST, ftc_cache_resize)
- [!FTC_CACHE_USE_LINEAR_HASHING]: Define it conditionally.
- (ftc_cache_init, ftc_cache_clear) [FTC_CACHE_USE_LINEAR_HASHING]:
- Updated.
- (ftc_cache_lookup) [FTC_CACHE_USE_LINEAR_HASHING]: Implement it.
-
- * src/cache/ftccache.i: New file.
-
- * src/cache/ftcsbits.c (GEN_CACHE_FAMILY_COMPARE,
- GEN_CACHE_NODE_COMPARE, GEN_CACHE_LOOKUP) [FTC_CACHE_USE_INLINE]:
- New macros.
- (ftc_sbit_cache_lookup) [!FTC_CACHE_USE_INLINE]: Typedef to
- ftc_cache_lookup.
- (FTC_SBitCache_Lookup): Updated.
-
- * src/type42/t42parse.c: Removing duplicate function.
-
-2002-06-07 Graham Asher <graham.asher@btinternet.com>
-
- * src/base/ftobjs.c (FT_Render_Glyph_Internal): Changed definition
- from FT_EXPORT_DEF to FT_BASE_DEF.
-
-2002-06-07 David Turner <david@freetype.org>
-
- Fixed the bug that prevented the correct display of fonts with
- `ftview'.
-
- * src/type42/t42drivr.c: Split into...
- * src/type42/t42drivr.h, src/type42/t42parse.c,
- src/type42/t42parse.h, src/type42/t42objs.h, src/type42/t42objs.c,
- src/type42/type42.c: New files.
-
- (t42_get_glyph_name, t42_get_ps_name, t42_get_name_index): Use
- `face->type1'.
-
- (Get_Interface): Renamed to...
- (T42_Get_Interface): This.
- Updated.
- (T42_Open_Face, T42_Face_Done): Updated.
- (T42_Face_Init): Add new cmap support.
- Updated.
- (T42_Driver_Init, T42_Driver_Done, T42_Size_Init, T42_Size_Done,
- T42_GlyphSlot_Init, T42_GlyphSlot_Done): Updated.
- (Get_Char_Index, Get_Next_Char): Renamed to...
- (T42_CMap_CharIndex, T42_CMap_CharNext): This.
- Updated.
- (T42_Char_Size, T42_Pixel_Size): Renamed to...
- (T42_Size_SetChars, T42_Size_SetPixels): This.
- (T42_Load_Glyph): Renamed to...
- (T42_GlyphSlot_Load): This.
-
- (t42_init_loader, t42_done_loader): Renamed to...
- (t42_loader_init, t42_loader_done): This.
- (T42_New_Parser, T42_Finalize_Parser): Renamed to...
- (t42_parser_init, t42_parser_done): This.
- (parse_dict): Renamed to...
- (t42_parse_dict): This.
- (is_alpha, is_space, hexval): Renamed to...
- (t42_is_alpha, t42_is_space, t42_hexval): This.
- (parse_font_name, parse_font_bbox, parse_font_matrix,
- parse_encoding, parse_sfnts, parse_charstrings, parse_dict):
- Renamed to...
- (t42_parse_font_name, t42_parse_font_bbox, t42_parse_font_matrix,
- t42_parse_encoding, t42_parse_sfnts, t42_parse_charstrings,
- t42_parse_dict): This.
- Updated.
-
- (t42_keywords): Updated.
-
- * src/type42/Jamfile, src/type42/descrip.mms: Updated.
-
-2002-06-03 Werner Lemberg <wl@gnu.org>
-
- Add 8bpp support to BDF driver.
-
- * src/bdf/bdflib.c (_bdf_parse_start): Handle 8bpp.
- * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Ditto.
- * src/bdf/README: Updated.
-
-2002-06-02 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/pfr/pfrload.c (pfr_phy_font_done): Free `blue_values' array.
-
-2002-05-29 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/bdf/bdflib.c (_bdf_readstream): Allocate `buf' dynamically.
- (_bdf_parse_glyphs): Use correct size for allocating
- `font->unencoded'.
- (bdf_load_font): Free array conditionally.
- Return proper error code in case of failure.
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Make it more robust against
- unusual fonts.
-
-2002-05-29 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/descrip.mms, src/type42/descrip.mms: New files.
- * descrip.mms (all): Updated.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix typo which prevented
- compilation.
- * src/pshglob.c (psh_blues_scale_zones): Fix compiler warning.
-
-2002-05-28 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/makefile, builds/amiga/smakefile,
- amiga/include/freetype/config/ftmodule.h: Updated to include
- support for BDF and Type42 drivers.
-
- * docs/modules.txt: Updated.
-
-2005-05-28 David Turner <david@freetype.org>
-
- * docs/CHANGES: Updating file for next release (2.1.1).
-
- * src/bdf/bdflib.c: Removing compiler warnings.
-
- * include/freetype/ftxf86.h, src/base/ftxf86.c: New files.
- They provide a new API (FT_Get_X11_Font_Format) to retrieve an
- X11-compatible string describing the font format of a given face.
- This was put in a new optional base source file, corresponding to a
- new public header (named FT_XFREE86_H since this function should
- only be used within the XFree86 font server IMO).
-
- * include/freetype/config/ftheader.h (FT_XFREE86_H): New macro (not
- documented yet).
-
- * src/base/fttype1.c: New file, providing two new API functions
- (FT_Get_PS_Font_Info and FT_Has_PS_Glyph_Names).
- * include/freetype/t1tables.h: Updated.
-
- * src/base/Jamfile, src/base/rules.mk, src/base/descrip.mms:
- Updating build control files for the new files `ftxf86.c' and
- `fttype1.c' in src/base.
-
- * src/pshinter/pshglob.c (psh_blues_scale_zones): Fixed a bug that
- prevented family blue zones substitution from happening correctly.
-
- * include/freetype/ftbdf.h FT_Get_BDF_Charset_ID): Adding
- documentation comment.
-
-2002-05-28 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftnames.c (FT_Get_Sfnt_Name): Don't use FT_STREAM_READ_AT
- but FT_STREAM_READ.
- Declare `stream' variable.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs): Replace floating point math
- with calls to `FT_MulDiv'.
-
-2002-05-28 David Turner <david@freetype.org>
-
- Fixing the SFNT name table loader to support various buggy fonts.
- It now ignores empty name entries, entries with invalid pointer
- Offsets and certain fonts containing tables with broken
- `storageOffset' fields.
-
- Name strings are now loaded on demand, which reduces the memory
- requirements for a given FT_Face tremendously (for example, the name
- table of Arial.ttf is about 10Kb and contains 70 names).
-
- This is a temporary fix. The whole name table loader and interface
- will be rewritten in a much more cleanly way shortly, once CSEH have
- been introduced in the sources.
-
- * include/freetype/internal/tttypes.h (TT_NameEntryRec): Change
- type of `stringOffset' to FT_ULong.
- (TT_NameTableRec): Change type of `numNameRecords' and
- `storageOffset' to FT_UInt.
- Replace `storage' with `stream'.
- * src/base/ftnames.c (FT_Get_Sfnt_Name): Load name on demand.
- * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Ditto.
- Make code more robust.
- * src/sfnt/sfobjs.c (TT_NameEntry_ConvertFunc): New typedef.
- (tt_face_get_name): Use it.
- Make code more robust.
- * src/sfnt/ttload.c (TT_Load_Names): Use `static' for arrays.
- Handle invalid `storageOffset' data better.
- Set length fields to zero for invalid or ignored data.
- Remove code within FT_DEBUG_LEVEL_TRACE.
- (TT_Free_Names): Updated.
-
-2002-05-24 Tim Mooney <enchanter@users.sourceforge.net>
-
- * builds/unix/ft-munmap.m4: New file, extracted FT_MUNMAP_DECL and
- FT_MUNMAP_PARAM from aclocal.m4 into here, so aclocal.m4 can be
- rebuilt from sources. Set macro serial to 1, and use third argument
- to AC_DEFINE for our two custom symbols, so ftconfig.in could one day
- be rebuilt with autoheader (not recommended now, ftconfig.in is a
- custom source file)
-
-2002-05-22 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftheader.h (FT_BEZIER_H): Removed.
- (FT_BDF_H): New macro for accessing `ftbdf.h'.
-
- * src/type42/t42drivr.c (hexval): Fix typo.
-
-2002-05-21 Martin Muskens <mmuskens@aurelon.com>
-
- * src/psaux/psobjs.c (T1Radix): New function.
- (t1_toint): Use it to handle numbers in radix format.
-
- * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Add dummy
- for undocumented, obsolete opcode 15.
-
-2002-05-21 David Turner <david@freetype.org>
-
- * src/bdf/bdflib.c: Removed compiler warning, and changed all tables
- to the `static const' storage specifier (instead of simply
- `static').
-
- * src/type42/t42drivr.c (hexval): Use more efficient code.
- Removing compiler warnings.
- * src/bdf/bdfdrivr.c: Removing compiler warnings.
-
- * include/freetype/internal/ftbdf.h, src/base/ftbdf.c,
- src/base/descrip.mms, src/base/Jamfile, src/base/rules.mk
- (FT_Get_BDF_Charset_ID): New API to retrieve BDF-specific strings
- from a face. This is much cleaner than accessing the internal types
- `BDF_Public_Face' defined in FT_INTERNAL_BDF_TYPES_H.
-
-2002-05-21 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/README: Mention Microsoft's SBIT tool.
-
- * src/cff/cffdrivr.c, src/cid/cidriver.c, src/pcf/pcfdriver.c,
- src/truetype/ttdriver.c, src/type1/t1driver.c,
- src/winfonts/winfnt.c, src/type42/t42drivr.c, src/bdf/bdfdrivr.c
- [FT_CONFIG_OPTION_DYNAMIC_DRIVERS]: Completely removed. It has
- been never used.
-
-2002-05-21 Roberto Alameda <ojancano@geekmail.de>.
-
- * src/type42/t42drivr.c: s/T42_ENCODING_TYPE_/T1_ENCODING_TYPE_/.
- (parse_font_matrix): Remove unnecessary code.
- (parse_sfnts): Initialize some variables.
- (t42_driver_class) [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Use
- ft_module_driver_has_hinter conditionally.
- Moved some type 42 specific structure definitions to...
- * include/freetype/internal/t42types.h: New file.
- * include/freetype/internal/internal.h (FT_INTERNAL_T42_TYPES_H):
- New macro.
-
-2002-05-20 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/cache/ftcsbits.h (FTC_SBit): Added a new field
- `num_grays' for specifying the number of used gray levels.
- * src/cache/ftcsbits.c (ftc_sbit_node_load): Initialize it.
-
-2002-05-19 Werner Lemberg <wl@gnu.org>
-
- Adding a driver for BDF fonts written by Francesco Zappa Nardelli
- <Francesco.Zappa.Nardelli@ens.fr>. Heavily modified by me to
- better adapt it to FreeType, removing unneeded stuff. Additionally,
- it now supports Mark Leisher's BDF extension for anti-aliased
- bitmap glyphs with 2 and 4 bpp.
-
- * src/bdf/*: New driver.
- * include/freetype/internal/bdftypes.h: New file.
- * include/freetype/internal/fttrace.h: Added BDF driver components.
- * include/freetype/fterrdef.h: Added error codes for BDF driver.
- * include/freetype/config/ftmodule.h, src/Jamfile: Updated.
- * include/freetype/internal/internal.h (FT_INTERNAL_BDF_TYPES_H):
- New macro.
-
- * include/freetype/config/ftstdlib.h (ft_sprintf): New alias for
- sprintf.
-
-2002-05-18 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/fttrace.h: Added Type 42 driver
- component.
- * src/type42/t42drivr.c: Use it.
-
- * include/freetype/internal/internal.h (FT_INTERNAL_PCF_TYPES_H):
- New macro.
-
-2002-05-17 Werner Lemberg <wl@gnu.org>
-
- * src/type42/Jamfile: New file.
-
-2002-05-14 Werner Lemberg <wl@gnu.org>
-
- Adding a driver for Type42 fonts written by Roberto Alameda
- <ojancano@geekmail.de>.
-
- * src/type42/*: New driver.
- * include/freetype/config/ftmodule.h, src/Jamfile: Updated.
- * include/freetype/config/ftstdlib.h (ft_xdigit, ft_memcmp,
- ft_atoi): New aliases for xdigit, memcmp, and atoi, respectively.
-
-2002-05-12 Owen Taylor <otaylor@redhat.com>
-
- * src/sfnt/ttload.c (TT_LookUp_Table): Protect against tables
- with a zero length value.
-
-2002-05-12 Michael Pfeiffer <michael.pfeiffer@utanet.at>
-
- * builds/beos/beos.mk: Include `link-std.mk'.
-
-2002-05-12 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.h (T1_Loader): Renamed to...
- (T1_LoaderRec): This.
- (T1_Loader): Now pointer to T1_LoaderRec.
- * src/type1/t1load.c: Updated.
-
- * include/freetype/internal/t1types.h, src/type1/t1load.c,
- src/type1/t1objs.c:
- s/T1_ENCODING_TYPE_EXPORT/T1_ENCODING_TYPE_EXPERT/.
-
-2002-05-06 Werner Lemberg <wl@gnu.org>
-
- * README: Add a note regarding libttf vs. libfreetype.
-
-2002-05-05 Werner Lemberg <wl@gnu.org>
-
- FreeType 2 can now be built in an external directory with the
- configure script also.
-
- * builds/freetype.mk (INCLUDES): Add `OBJ_DIR'.
-
- * builds/unix/detect.mk (have_mk): New variable to test for
- external build.
- (unix-def.mk): Defined according to value of `have_mk'.
- * builds/unix/unix.mk (have_mk): New variable to test for
- external build.
- Select include paths for unix-def.mk and unix-cc.mk according
- to value of `have_mk'.
- * builds/unix/unix-def.in (OBJ_BUILD): New variable.
- (DISTCLEAN): Use it.
- * builds/unix/unix-cc.in (LIBTOOL): Define default value only
- if not yet defined.
- * builds/unix/install.mk (install): Use `OBJ_BUILD' for installing
- freetype-config.
-
- * configure: Don't depend on bash features.
- (ft2_dir, abs_curr_dir, abs_ft2_dir): New variables (code
- partially taken from Autoconf).
- Build a dummy Makefile if not building in source tree.
-
- * docs/INSTALL: Document it.
-
-2002-05-04 David Turner <david@freetype.org>
-
- * src/truetype/ttgload.c (TT_Load_Glyph): Finally fixing the last
- bug that prevented FreeType 2.x and FreeType 1.x to produce
- bit-by-bit identical monochrome glyph bitmaps with native TrueType
- hinting. The culprit was a single-bit flag that wasn't set
- correctly by the TrueType glyph loader.
-
- * src/otlayout/otlayout.h, src/otlayout/otlbase.c,
- src/otlayout/otlbase.h, src/otlayout/otlconf.h,
- src/otlayout/otlgdef.c, src/otlayout/otlgdef.h,
- src/otlayout/otlgpos.c, src/otlayout/otlgpos.h,
- src/otlayout/otlgsub.c, src/otlayout/otlgsub.h,
- src/otlayout/otljstf.c, src/otlayout/otljstf.h,
- src/otlayout/otltable.c, src/otlayout/otltable.h,
- src/otlayout/otltags.h: New OpenType Layout source files. The
- module is still incomplete.
-
-2002-05-02 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttcmap0.c (tt_cmap4_char_index): Fix serious typo
- (0xFFFU -> 0xFFFFU).
-
-2002-05-01 Werner Lemberg <wl@gnu.org>
-
- * docs/INSTALL: Fix URL of makepp.
-
-2002-05-01 David Turner <david@freetype.org>
-
- * src/sfnt/sfobjs.c (tt_face_get_name): Fixing a bug that caused
- FreeType to crash when certain broken fonts (e.g. `hya6gb.ttf')
- were opened.
-
- * src/sfnt/ttload.c (TT_Load_Names): Applied a small work-around to
- manage fonts containing a broken name table (e.g. `hya6gb.ttf').
-
- * src/sfnt/ttcmap0.c (tt_cmap4_validate): Fixed over-restrictive
- validation test. The charmap validator now accepts overlapping
- ranges in format 4 charmaps.
-
- * src/sfnt/ttcmap0.c (tt_cmap4_char_index): Switched to a binary
- search algorithm. Certain fonts contain more than 170 distinct
- segments!
-
- * include/freetype/config/ftstdlib.h: Adding an alias for the `exit'
- function. This will be used in the near future to panic in case of
- unexpected exception (which shouldn't happen in theory).
-
- * include/freetype/internal/fthash.h, src/base/fthash.c: New files.
- This is generic implementation of dynamic hash tables using a linear
- algorithm (to get rid of `stalls' during resizes). In the future
- this will be used in at least three parts of the library: the cache
- sub-system, the object sub-system, and the memory debugger.
-
- * src/base/Jamfile: Updated.
-
- * include/freetype/internal/internal.h (FT_INTERNAL_HASH_H,
- FT_INTERNAL_OBJECT_H): New macros.
-
- * include/freetype/internal/ftcore.h: New file to group all new
- definitions related to exception handling and memory management. It
- is very likely that this file will disappear or be renamed in the
- future.
-
- * include/freetype/internal/ftobject.h, include/freetype/ftsysmem.h:
- Adding comments to better explain the object sub-system as well as
- the new memory manager interface.
-
-2002-04-30 Wenlin Institute (Tom Bishop) <wenlin@wenlin.com>
-
- * src/base/ftmac.c (p2c_str): Removed.
- (file_spec_from_path) [TARGET_API_MAC_CARBON]: Added support for
- OS X.
- (is_dfont) [TARGET_API_MAC_CARBON]: Define only for OS X.
- Handle `nameLen' <= 6 also.
- (parse_fond): Remove unused variable `name_table'.
- Use functionality of old p2c_str directly.
- Add safety checks.
- (read_lwfn): Initialize `size_p'.
- Check for size_p == NULL.
- (new_memory_stream, open_face_from_buffer): Updated to FreeType 2.1.
- (FT_New_Face_From_LWFN): Remove unused variable `memory'.
- Remove some dead code.
- (FT_New_Face_From_SFNT): Remove unused variable `stream'.
- (FT_New_Face_From_dfont) [TARGET_API_MAC_CARBON]: Define only for
- OS X.
- (FT_New_Face_From_FOND): Remove unused variable `error'.
- (ResourceForkSize): New function.
- (FT_New_Face): Use it.
- Handle empty resource forks.
- Conditionalize some code for OS X.
- Add code to call normal loader as a fallback.
-
-2002-04-30 Werner Lemberg <wl@gnu.org>
-
- `interface' is reserved on the Mac.
-
- * include/freetype/ftoutln.h, include/freetype/internal/sfnt.h,
- src/base/ftoutln.c: s/interface/func_interface/.
- * src/base/ftbbox.c (FT_Outline_Get_BBox):
- s/interface/bbox_interface/.
- * src/cff/cffdrivr.c: s/interface/module_interface/.
- * src/cff/cffload.c, src/cff/cffload.h:
- s/interface/psnames_interface/.
- * src/cid/cidriver.c: s/interface/cid_interface/.
- * src/sfnt/sfdriver.c: s/interface/module_interface/.
- * src/smooth/ftgrays.c: s/interface/func_interface/.
- * src/truetype/ttdriver.c: s/interface/tt_interface/.
- * src/type1/t1driver.c: s/interface/t1_interface/.
-
- Some more variable renames to avoid troubles on the Mac.
-
- * src/raster/ftraster.c:
- s/Unknown|Ascending|Descending|Flat/\1_State/.
- * src/smooth/ftgrays.c: s/TScan/TCoord/.
-
- Other changes for the Mac.
-
- * include/freetype/config/ftconfig.h: Define FT_MACINTOSH for
- Mac platforms.
- * src/base/ftobjs.c: s/macintosh/FT_MACINTOSH/.
-
- * src/raster/ftrend1.c (ft_raster1_render): Make `pitch' always
- an even number.
-
-2002-04-29 Jouk Jansen <joukj@hrem.stm.tudelft.nl>
-
- * descrip.mms (all): Add pfr driver.
-
-2002-04-28 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrerror.h: New file.
- * include/freetype/ftmoderr.h: Add PFR error codes.
- * src/pfr/pfrgload.c: Include pfrerror.h.
- Use PCF error codes.
- (pfr_extra_item_load_stem_snaps): Fix debug message.
- * src/pfr/pfrgload.c: Include pfrerror.h.
- Use PCF error codes.
- (pfr_extra_item_load_bitmap_info, pfr_glyph_load_simple,
- pfr_glyph_load_compound): Fix debug message.
- * src/pfr/pfrobjs.c: Include pfrerror.h.
- Use PCF error codes.
- (pfr_face_init): Return PFR_Err_Unknown_File_Format.
- * src/pfr/rules.mk (PFR_DRV_H): Include pfrerror.h.
-
- * src/pcf/pcfdriver.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_CMAPS]:
- `root' -> `face->root'.
- * src/sfnt/ttcmap0.c (TT_Build_CMaps) [!FT_CONFIG_OPTION_USE_CMAPS]:
- Removed.
- * src/sfnt/ttcmap0.c: Declare TT_Build_CMaps only for
- FT_CONFIG_OPTION_USE_CMAPS.
-
-2002-04-27 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftccache.c (ftc_cache_lookup),
- src/cache/ftccmap.c (ftc_cmap_family_init),
- src/cache/ftcmanag.c (ftc_family_table_alloc),
- src/cache/ftcsbits.c (FTC_SBit_Cache_Lookup): Use FTC_Err_*.
- src/cache/ftcimage.c (FTC_Image_Cache_Lookup): Use FTC_Err_*.
- (FTC_ImageCache_Lookup): Fix handling of invalid arguments.
-
-2002-04-22 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.ac: Set `version_info' to 9:1:3 (FT2
- version 2.0.9 has 9:0:3).
- * builds/unix/configure: Regenerated (using autoconf 2.53).
-
-2002-04-19 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrload.c (pfr_extra_items_parse): Fix debug message.
- (pfr_phy_font_load): s/size/Size/ for local variable to avoid
- compiler warning.
- * src/pfr/pfrobjs.c (pfr_face_init): Fix debug message.
- (pfr_slot_load): Remove redundant local variable.
-
-2002-04-19 David Turner <david@freetype.org>
-
- Adding a PFR font driver to the FreeType sources. Note that it
- doesn't support embedded bitmaps or kerning tables yet.
-
- src/pfr/*: New files.
-
- * include/freetype/config/ftmodule.h,
- include/freetype/internal/fttrace.h, src/Jamfile: Updated.
-
- * src/type1/t1gload.h (T1_Load_Glyph), src/type1/t1gload.c
- (T1_Load_Glyph): Fixed incorrect parameter sign-ness in callback
- function.
-
- * include/freetype/internal/ftmemory.h (FT_MEM_ZERO, FT_ZERO): New
- macros.
-
- * include/freetype/internal/ftstream.h (FT_NEXT_OFF3, FT_NEXT_UOFF3,
- FT_NEXT_OFF3_LE, FT_NEXT_UOFF3_LE): New macros to parse in-memory
- 24-bit integers.
-
-2002-04-18 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c, builds/win32/ftdebug.c,
- builds/amiga/src/base/ftdebug.c: Version 2.1.0 couldn't be linked
- against applications in Win32 and Amiga builds due to changes to
- `src/base/ftdebug.c' that were not properly propagated to
- `builds/win32' and `builds/amiga'. This has been fixed.
-
- * include/freetype/internal/ftobject.h,
- include/freetype/internal/ftexcept.h, include/freetype/ftsysmem.h,
- include/freetype/ftsysio.h, src/base/ftsysmem.c, src/base/ftsysio.c:
- New experimental files.
-
-2002-04-17 David Turner <david@freetype.org>
-
-
- * Version 2.1.0 released.
- =========================
-
-
-2002-04-17 Michael Jansson <mjan@em2-solutions.com>
-
- * src/type1/t1gload.c (T1_Compute_Max_Advance): Fixed a small bug
- that prevented the function to return the correct value.
-
-2002-04-16 Francesco Zappa Nardelli <Francesco.Zappa.Nardelli@ens.fr>
-
- * src/pcf/pcfread.c (pcf_get_accel): Fix parsing of accelerator
- tables.
-
-2002-04-15 David Turner <david@freetype.org>
-
- * docs/FTL.txt: Formatting.
-
- * include/freetype/config/ftoption.h: Reduce the size of the
- render pool from 32kByte to 16kByte.
-
- * src/pcf/pcfread.c (pcf_seek_to_table_type): Remove compiler
- warning.
-
- * include/freetype/config/ftoption.h (FT_MAX_EXTENSIONS): Removed.
-
- * docs/CHANGES: Preparing 2.1.0 release.
-
-2002-04-13 Werner LEMBERG <wl@gnu.org>
-
- * src/cff/cffgload.c (CFF_Parse_CharStrings): s/rand/Rand/ to avoid
- compiler warning.
-
-2002-04-12 David Turner <david@freetype.org>
-
- * README.UNX: Updated the Unix-specific quick-compilation guide to
- warn about the GNU Make requirement at compile time.
-
- * include/freetype/config/ftstdlib.h,
- include/freetype/config/ftconfig.h,
- include/freetype/config/ftheader.h,
- include/freetype/internal/ftmemory.h,
- include/freetype/internal/ftobjs.h,
-
- src/autohint/ahoptim.c,
-
- src/base/ftdbgmem.c, src/base/ftdebug.c, src/base/ftmac.c,
- src/base/ftobjs.c, src/base/ftsystem.c,
-
- src/cache/ftcimage.c, src/cache/ftcsbits.c,
-
- src/cff/cffdrivr.c, src/cff/cffload.c, src/cff/cffobjs.c,
-
- src/cid/cidload.c, src/cid/cidparse.c, src/cid/cidriver.c,
-
- src/pcf/pcfdriver.c, src/pcf/pcfread.c,
-
- src/psaux/t1cmap.c, src/psaux/t1decode.c,
-
- src/pshinter/pshalgo1.c, src/pshinter/pshalgo2.c,
- src/pshinter/pshrec.c,
-
- src/psnames/psmodule.c,
-
- src/raster/ftraster.c,
-
- src/sfnt/sfdriver.c, src/sfnt/ttload.c,
-
- src/smooth/ftgrays.c,
-
- src/type1/t1afm.c, src/type1/t1driver.c, src/type1/t1gload.c,
- src/type1/t1load.c, src/type1/t1objs.c, src/type1/t1parse.c,
-
- builds/unix/ftconfig.in, builds/vms/ftconfig.h,
-
- builds/amiga/src/base/ftdebug.c:
-
- Added the new configuration file `ftstdlib.h' used to define
- aliases for all ISO C library functions used by the engine
- (e.g. strlen, qsort, setjmp, etc.).
-
- This eases the porting of FreeType 2 to environments like
- XFree86 modules/extensions.
-
- Also removed many #include <string.h>, #include <stdlib.h>, etc.
- from the engine's sources where they are not needed.
-
- * src/sfnt/ttpost.c: Use macro name for psnames.h.
-
-2002-04-12 Vincent Caron <v.caron@zerodeux.net>
-
- * configure, builds/detect.mk: Updated the build system to print
- a warning message in case GNU Make isn't used to build the library.
-
-2002-04-11 David Turner <david@freetype.org>
-
- * README, docs/CHANGES, Jamfile.in: Updates for the 2.1.0 release.
-
- * docs/FTL.txt: Updated license text to provide a preferred
- disclaimer and adjust copyright dates/extents.
-
- * include/freetype/cache/ftcglyph.h: Removing obsolete (and
- confusing) comment.
-
- * Jamfile.in: New file.
-
-2002-04-11 Maxim Shemanarev <mcseemagg@yahoo.com>
-
- * src/smooth/ftgrays.c (gray_hline): Minor optimization.
-
-2002-04-02 Werner Lemberg <wl@gnu.org>
-
- Fixes from the stable branch:
-
- * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_OLD_CALCS):
- Removed.
- [FT_CONFIG_OPTION_OLD_CALCS]: Removed.
- * include/freetype/internal/ftcalc.h, src/base/ftcalc.c
- [FT_CONFIG_OPTION_OLD_CALCS]: Removed.
-
- * src/base/fttrigon.c (FT_Vector_Length): Change algorithm to match
- output of FreeType 1.
-
- * src/pshinter/pshglob.c (psh_globals_scale_widths): Fixed a small
- bug that created un-even stem widths when hinting Postscript fonts.
-
- * src/type1/t1driver.c, src/type1/t1parse.c: 16bit fixes.
-
-2002-04-01 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c: 16bit fixes.
- (TT_Load_Simple_Glyph): Improve debug messages.
- (load_truetype_glyph): Remove dead code.
- * src/truetype/ttinterp.c: 16bit fixes.
- * src/truetype/ttobjs.c: Ditto.
-
- * include/freetype/ftsnames.h, include/freetype/internal/sfnt.h,
- src/cff/cffload.h, src/psaux/psobjs.h, src/truetype/ttinterp.[ch],
- src/sfnt/ttpost.h: s/index/idx/.
-
-2002-03-31 Yao Zhang <yaoz@vidar.niaaa.nih.gov>
-
- * src/truetype/ttobjs.c (TT_Size_Init): Fix typo.
-
-2002-03-31 Werner Lemberg <wl@gnu.org>
-
- * src/otlayout/otlcommn.c, src/otlayout/otlcommn.h: s/index/idx/.
- * src/psaux/t1cmap.c: Ditto.
- * src/sfnt/ttcmap0.c: Ditto.
-
- * include/freetype/internal/tttypes.h,
- include/freetype/internal/sfnt.h (TT_Goto_Table_Func): Renamed to ...
- (TT_Loader_GotoTableFunc): This.
- * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Fix debug
- messages.
- * src/psnames/psmodule.c (psnames_interface)
- [!FT_CONFIG_OPTION_ADOBE_GLYPH_LIST]: Fix typo.
- * src/sfnt/sfdriver.c (get_sfnt_table): 16bit fix.
- * src/sfnt/ttcmap.c: 16bit fixes (0xFFFF -> 0xFFFFU).
- * src/sfnt/ttcmap0.c: 16bit fixes.
- (TT_Build_CMaps): Simplify debug messages.
- (tt_cmap12_char_next): Fix offset.
- * src/sfnt/ttload.c (TT_Load_Names, TT_Load_CMap): Fix debug
- messages.
- (TT_Load_OS2): 16bit fix.
-
-2002-03-30 David Turner <david@freetype.org>
-
- * include/freetype/internal/tttypes.h: Adding comments to some of
- the TT_FaceRec fields.
-
- * src/sfnt/ttcmap0.c (TT_Build_CMaps): Removed compiler warnings.
-
- * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_{utf16,ucs4,other}:
- New functions.
- (tt_face_get_name): Use them to properly extract an ascii font name.
-
-2002-03-30 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/t1tables.h (t1_blend_max): Fix typo.
- * src/base/ftstream.c: Simplify FT_ERROR calls.
- * src/cff/cffdrivr.c (cff_get_glyph_name): Fix debug message.
-
- * src/cff/cffobjs.c (CFF_Driver_Init, CFF_Driver_Done)
- [TT_CONFIG_OPTION_EXTEND_ENGINE]: Removed.
- * src/cff/sfobjs.c (SFNT_Load_Face)
- [TT_CONFIG_OPTION_EXTEND_ENGINE]: Ditto.
- * src/truetype/ttobjs.c (TT_Init_Driver, TT_Done_Driver)
- [TT_CONFIG_OPTION_EXTEND_ENGINE]: Ditto.
-
- * src/truetype/ttdriver.c, src/truetype/ttobjs.c,
- src/truetype/ttobjs.h: Renaming driver functions to the
- FT_<Subject>_<Action> scheme:
-
- TT_Init_Driver => TT_Driver_Init
- TT_Done_Driver => TT_Driver_Done
- TT_Init_Face => TT_Face_Init
- TT_Done_Face => TT_Face_Done
- TT_Init_Size => TT_Size_Init
- TT_Done_Size => TT_Size_Done
- TT_Reset_Size => TT_Size_Reset
-
-2002-03-29 Werner Lemberg <wl@gnu.org>
-
- * builds/vms/ftconfig.h: Rename LOCAL_DEF and LOCAL_FUNC to
- FT_LOCAL and FT_LOCAL_DEF, respectively, as with other ftconfig.h
- files.
- * builds/unix/ftconfig.in: Add argument to FT_LOCAL and
- FT_LOCAL_DEF.
- * src/truetype/ttinterp.c: s/FT_Assert/FT_ASSERT/.
- * builds/unix/configure.ac: Temporarily deactivate creation of
- ../../Jamfile.
- * builds/unix/configure: Updated.
-
-2002-03-28 KUSANO Takayuki <AE5T-KSN@asahi-net.or.jp>
-
- * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Fix serious typos.
-
-2002-03-28 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/psaux.h (PSAux_ServiceRec): Fix
- compiler warnings.
- * include/freetype/internal/t1types.h (T1_FaceRec): Use `const' for
- some members.
- * src/base/ftapi.c (FT_New_Memory_Stream): Fix typos.
- * src/psaux/t1cmap.c (t1_cmap_std_init, t1_cmap_unicode_init): Add
- cast.
- (t1_cmap_{standard,expert,custom,unicode}_class_rec): Use
- `FT_CALLBACK_TABLE_DEF'.
- * src/psaux/t1cmap.h: Updated.
- * src/sfnt/ttcmap0.c (TT_Build_CMaps): Use `ft_encoding_none'
- instead of zero.
- * src/type1/t1objs.c (T1_Face_Init): Use casts.
-
-2002-03-26 David Turner <david@freetype.org>
-
- * src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c:
- Fixed a small bug in the FT_CMaps support code.
-
-2002-03-25 David Turner <david@freetype.org>
-
- * src/truetype/ttinterp.c (Norm): Replaced with...
- (TT_VecLen): This.
- (TT_MulFix14, TT_DotFix14): New functions.
- (Project, Dual_Project, Free_Project, Compute_Point_Displacement,
- Ins_SHPIX, Ins_MIAP, Ins_MIRP): Use them.
- [FT_CONFIG_OPTION_OLD_CALCS]: Removed all code.
-
-2002-03-22 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/type1/t1objs.c:
- Various fixes to make the FT_CMaps support work correctly (more
- tests are still needed).
-
- * include/freetype/internal/ftobjs.h, src/sfnt/Jamfile,
- src/sfnt/rules.mk, src/sfnt/sfnt.c, src/sfnt/sfobjs.c,
- src/sfnt/ttload.c, src/sfnt/ttcmap0.c, src/sfnt/ttcmap0.h: Updated
- the SFNT charmap support to use FT_CMaps.
-
- * include/freetype/fterrdef.h: New file.
- * include/freetype/fterrors.h: Include it. It contains all error
- codes.
- * include/freetype/config/ftheader.h (FT_ERROR_DEFINITIONS_H): New
- macro.
-
- * include/freetype/internal/ftmemory.h, and a lot of other files:
- Changed the names of memory macros. Examples:
-
- MEM_Set => FT_MEM_SET
- MEM_Copy => FT_MEM_COPY
- MEM_Move => FT_MEM_MOVE
-
- ALLOC => FT_ALLOC
- FREE => FT_FREE
- REALLOC = >FT_REALLOC
-
- FT_NEW was introduced to allocate a new object from a _typed_
- pointer.
-
- Note that ALLOC_ARRAY and REALLOC_ARRAY have been replaced by
- FT_NEW_ARRAY and FT_RENEW_ARRAY which take _typed_ pointer
- arguments.
-
- This results in _lots_ of sources being changed, but makes the code
- more generic and less error-prone.
-
- * include/freetype/internal/ftstream.h, src/base/ftstream.c,
- src/cff/cffload.c, src/pcf/pcfread.c, src/sfnt/ttcmap.c,
- src/sfnt/ttcmap0.c, src/sfnt/ttload.c, src/sfnt/ttpost.c,
- src/sfnt/ttsbit.c, src/truetype/ttgload.c, src/truetype/ttpload.c,
- src/winfonts/winfnt.c: Changed the definitions of stream macros.
- Examples:
-
- NEXT_Byte => FT_NEXT_BYTE
- NEXT_Short => FT_NEXT_SHORT
- NEXT_UShortLE => FT_NEXT_USHORT_LE
- READ_Short => FT_READ_SHORT
- GET_Long => FT_GET_LONG
- etc.
-
- Also introduced the FT_PEEK_XXXX functions.
-
- * src/cff/cffobjs.c (CFF_Build_Unicode_Charmap): Removed commented
- out function.
- (find_encoding): Removed.
- (CFF_Face_Init): Remove charmap support.
-
- * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_USE_CMAPS,
- TT_CONFIG_CMAP_FORMAT{0,2,4,6,8,10,12}): New macros to fine-tune
- support of cmaps.
-
-2002-03-21 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c, src/pcf/pcfdriver.c, src/pcf/pcfread.c: Updated
- to new FT_CMap definitions.
-
- * src/psaux/t1cmap.h, src/psaux/t1cmap.c, src/type1/t1cmap.h,
- src/type1/t1cmap.c: Updating and moving the Type 1 FT_CMap support
- from `src/type1' to `src/psaux' since it is going to be shared by
- the Type 1 and CID font drivers.
-
- * src/psaux/Jamfile, src/psaux/psaux.c, src/psaux/psauxmod.c,
- src/psaux/rules.mk, include/freetype/internal/psaux.h: Added support
- for Type 1 FT_CMaps.
-
-2002-03-20 David Turner <david@freetype.org>
-
- * src/base/ftgloadr.c (FT_GlyphLoader_CheckSubGlyphs): Fixed a
- memory allocation bug that was due to un-careful renaming of the
- FT_SubGlyph type.
-
- * src/base/ftdbgmem.c (ft_mem_table_destroy): Fixed a small bug that
- caused the library to crash with Electric Fence when memory
- debugging is used.
-
- * Renaming stream macros. Examples:
-
- FILE_Skip => FT_STREAM_SKIP
- FILE_Read => FT_STREAM_READ
- ACCESS_Frame => FT_FRAME_ENTER
- FORGET_Frame => FT_FRAME_EXIT
- etc.
-
- * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Fixed memory leak.
-
- * include/freetype/internal/ftobjs.h: Changing the definition of
- FT_CMap_CharNextFunc slightly.
-
- * src/cff/*.c: Updating CFF type definitions.
-
-2002-03-14 David Turner <david@freetype.org>
-
- * include/freetype/internal/autohint.h, src/autohint/ahmodule.c,
- src/base/ftapi.c, src/base/ftobjs.c: Updating the type definitions
- for the auto-hinter module.
-
- FT_AutoHinter_Interface => FT_AutoHinter_ServiceRec
- FT_AutoHinter_Interface* => FT_AutoHinter_Service
- etc.
-
- FT_AutoHinter_Get_Global_Func => FT_AutoHinter_GlobalGetFunc
- FT_AutoHinter_Done_Global_Func => FT_AutoHinter_GlobalDoneFunc
- etc.
-
- * ahloader.h [_STANDALONE_]: Removed all conditional code.
-
- * include/freetype/internal/cfftypes.h, src/cff/*.c: Updating the
- type definitions of the CFF font driver.
-
- CFF_Font => CFF_FontRec
- CFF_Font* => CFF_Font
- etc.
-
- * include/freetype/internal/fnttypes.h, src/winfonts/*.c: Updating
- type definitions of the Windows FNT font driver.
-
- * include/freetype/internal/ftdriver.h,
- include/freetype/internal/ftobjs.h, src/base/ftapi.c,
- src/base/ftobjs.c, src/cff/cffdrivr.c, src/cff/cffdrivr.h,
- src/cid/cidriver.c, src/cid/cidriver.h, src/pcf/pcfdriver.c,
- src/pcf/pcfdriver.h, src/truetype/ttdriver.c,
- src/truetype/ttdriver.h, src/type1/t1driver.c, src/type1/t1driver.h,
- src/winfonts/winfnt.c, src/winfonts/winfnt.h: Updating type
- definitions for font drivers.
-
- FTDriver_initFace => FT_Face_InitFunc
- FTDriver_initGlyphSlot => FT_Slot_InitFunc
- etc.
-
- * src/cid/cidobjs.c (CID_Face_Init): Remove dead code.
-
- * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: Updated a
- few face method definitions:
-
- FT_PSName_Requester => FT_Face_GetPostscriptNameFunc
- FT_Glyph_Name_Requester => FT_Face_GetGlyphNameFunc
- FT_Name_Index_Requester => FT_Face_GetGlyphNameIndexFunc
-
- * src/base/ftapi.c: New file. It contains backward compatibility
- functions.
-
- * include/freetype/internal/psaux.h, src/cid/cidload.c,
- src/cidtoken.h, src/psaux/psobjs.c, src/psaux/psobjs.h,
- src/psaux/t1decode.c, src/type1/t1load.c, src/type1/t1tokens.h:
- Updated common PostScript type definitions.
- Renamed all enumeration values like to uppercase variants:
-
- t1_token_any => T1_TOKEN_TYPE_ANY
- t1_field_cid_info => T1_FIELD_LOCATION_CID_INFO
- etc.
-
- * include/freetype/internal/psglobal.h: Removed.
- * include/freetype/internal/pshints.h, src/pshinter/pshglob.h:
- Updated.
-
- * include/freetype/internal/tttypes.h,
- include/freetype/internal/sfnt.h, src/base/ftnames.c,
- src/cff/cffdrivr.c, src/sfnt/*.c, src/truetype/*.c: Updated
- SFNT/TrueType type definitions.
-
- * include/freetype/freetype.h, include/freetype/internal/ftgloadr.h:
- Updating type definitions for the glyph loader.
-
-2002-03-13 Antoine Leca <antoine@oriolnet.com>
-
- * include/freetype/config/ftoption.h: Changed the automatic
- detection of Microsoft C compilers to automatically support 64-bit
- integers only since revision 9.00 (i.e. >= Visual C++ 2.0).
-
-2002-03-08 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftutil.c (FT_Realloc): Use MEM_Set instead of memset.
-
-2002-03-07 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,
- ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
- ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
- FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
- * src/base/ftcalc.c (FT_MulFix): Ditto.
- * src/cff/cffdrivr.c (cff_get_name_index): Ditto.
- * src/cff/cffobjs.c (CFF_Size_Get_Globals_Funcs, CFF_Size_Init,
- CFF_GlyphSlot_Init): Ditto.
- * src/cid/cidobjs.c (CID_GlyphSlot_Init,
- CID_Size_Get_Globals_Funcs): Ditto.
- * src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
- Ditto.
- * src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
- * src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
- variables.
-
- * include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
- to...
- (T1_Builder_FuncsRec): This.
- (T1_Builder_Funcs): New typedef.
- (PSAux_Interface): Remove compiler warnings.
- * src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
- (t1_builder_funcs): Updated.
-
- * src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
- (PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
- (PSH_AlignmentRec): Updated.
-
- * include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
- typo.
- * include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
- * src/base/ftstream (FT_Get_Char): Rename to...
- (FT_Stream_Get_Char): This.
-
- * src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
- a built-in function in gcc, causing warning messages with gcc 3.0.
- * src/autohint/ahglyph.c (ah_outline_load): Ditto.
- * src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
- * src/cache/ftcmanag.c (ftc_family_table_alloc,
- ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
- Ditto.
- * src/cff/cffload.c (cff_new_index, cff_done_index,
- cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
- CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
- CFF_Done_Font): Ditto.
- * src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
- * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
- * src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
- ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
- * src/pshinter/pshalgo1.c (psh1_hint_table_record,
- psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
- * src/pshinter/pshalgo2.c (psh2_hint_table_record,
- psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
- * src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
- TT_Get_PS_Name): Ditto.
- * src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
- load_truetype_glyph): Ditto.
- * src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
- * src/type1/t1afm.c (T1_Get_Kerning): Ditto.
- * include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
-
-2002-03-06 David Turner <david@freetype.org>
-
- * src/type1/t1objs.c (T1_Face_Init), src/cid/cidobjs.c
- (CID_Face_Init): Fixed another bug related to the
- ascender/descender/text height of Postscript fonts.
-
- * src/pshinter/pshalgo2.c (print_zone): Renamed to ...
- (psh2_print_zone): This.
- * src/pshinter/pshalgo1.c (print_zone): Renamed to ...
- (psh1_print_zone): This.
-
- * include/freetype/freetype.h, include/freetype/internal/ftobjs.h,
- src/base/ftobjs.c: Adding the new FT_Library_Version API to return
- the library's current version in dynamic links.
- * src/base/ftinit.c (FT_Init_FreeType): Updated.
-
-2002-03-06 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshglob.h (PSH_DimensionRec): s/std/stdw/.
- * src/pshinter/pshglob.c (psh_global_scale_widths,
- psh_dimension_snap_width, psh_globals_destroy, psh_globals_new):
- Ditto.
-
-2002-03-05 David Turner <david@freetype.org>
-
- * src/type1/t1objs.c (T1_Face_Init), src/cff/cffobjs.c
- (CFF_Face_Init), src/cid/cidobjs.c (CID_Face_Init): Removing the bug
- that returned global BBox values in 16.16 fixed format (instead of
- integer font units).
-
- * src/cid/cidriver.c (cid_get_postscript_name): Fixed a bug that
- caused the CID driver to return Postscript font names with a leading
- slash (`/') as in `/MOEKai-Regular'.
-
- * src/sfnt/ttload.c (TT_Load_Names), src/sfnt/sfobjs.c (Get_Name),
- src/sfnt/sfdriver.c (get_sfnt_postscript_name): Fixed the loader so
- that it accepts broken fonts like `foxjump.ttf', which made FreeType
- crash when trying to load them.
-
- Also improved the name table parser to be able to load
- Windows-encoded entries before Macintosh or Unicode ones, since it
- seems some fonts don't have reliable values here anyway.
-
- * include/freetype/internal/psnames.h: Add typedef for
- `PSNames_Service'.
-
-2002-03-05 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/aclocal.m4, builds/unix/ltmain.sh: Update to libtool
- 1.4.2.
- Apply a small patch for AIX to make shared libraries work (this
- patch is already in the CVS version of libtool).
-
- * builds/unix/config.sub, builds/unix/config.guess: Updated to
- recent versions.
-
- * builds/unix/configure.ac: Fix typo
- (AC_CONFIG_FILE->AC_CONFIG_FILES).
-
- * builds/unix/configure: Regenerated.
-
-2002-02-28 David Turner <david@freetype.org>
-
- * include/freetype/ftconfig.h: Changed `FT_LOCAL xxxx' to
- `FT_LOCAL( xxxx )' everywhere in the source. The same goes for
- `FT_LOCAL_DEF xxxx' which is translated to `FT_LOCAL_DEF( xxxxx )'.
-
- * include/freetype/freetype.h (FREETYPE_MINOR, FREETYPE_PATCH):
- Changing version to 2.1.0 to indicate an unstable branch.
- Added the declarations of FT_Get_First_Char and FT_Get_Next_Char.
-
- * src/base/ftobjs.c: Implement FT_Get_First_Char and
- FT_Get_Next_Char.
-
- * include/freetype/t1tables.h: Renaming structure types. This
-
- typedef T1_Struct_
- {
- } T1_Struct;
-
- becomes
-
- typedef PS_StructRec_
- {
- } PS_StructRec, *PS_Struct;
-
- typedef PS_StructRec T1_Struct; /* backward compatibility */
-
- Hence, we increase the coherency of the source code by effectively
- using the `Rec' prefix for structure types.
-
-2002-02-27 David Turner <david@freetype.org>
-
- * src/sfnt/ttload.c (TT_Load_Names): Simplifying and securing the
- names table loader. Invalid individual name entries are now handled
- correctly. This allows the loading of very buggy fonts like
- `foxjump.ttf' without allocating tons of memory and causing crashes.
-
- * src/otlayout/otlcommon.h, src/otlayout/otlcommon.c: Adding (still
- experimental) code for OpenType Layout tables validation and
- parsing.
-
- * src/type1/t1cmap.h, src/type1/t1cmap.c: Adding (still
- experimental) code for Type 1 charmap processing.
-
- * src/sfnt/ttcmap0.c: New file. It contains a new, still
- experimental SFNT charmap processing support.
-
- * include/freetype/internal/ftobjs.h: Adding validation support as
- well as internal charmap object definitions (FT_CMap != FT_CharMap).
-
-2002-02-24 David Turner <david@freetype.org>
-
- * Renaming stream functions to the FT_<Subject>_<Action> scheme:
-
- FT_Seek_Stream => FT_Stream_Seek
- FT_Skip_Stream => FT_Stream_Skip
- FT_Read_Stream => FT_Stream_Read
- FT_Read_Stream_At => FT_Stream_Read_At
- FT_Access_Frame => FT_Stream_Enter_Frame
- FT_Forget_Frame => FT_Stream_Exit_Frame
- FT_Extract_Frame => FT_Stream_Extract_Frame
- FT_Release_Frame => FT_Stream_Release_Frame
- FT_Get_XXXX => FT_Stream_Get_XXXX
- FT_Read_XXXX => FT_Stream_Read_XXXX
-
- FT_New_Stream( filename, stream ) =>
- FT_Stream_Open( stream, filename )
-
- (The function doesn't create the FT_Stream structure, it simply
- initializes it for reading.)
-
- FT_New_Memory_Stream( library, FT_Byte* base, size, stream ) =>
- FT_Stream_Open_Memory( stream, const FT_Byte* base, size )
-
- FT_Done_Stream => FT_Stream_Close
- FT_Stream_IO => FT_Stream_IOFunc
- FT_Stream_Close => FT_Stream_CloseFunc
-
- ft_close_stream => ft_ansi_stream_close (in base/ftsystem.c only)
- ft_io_stream => ft_ansi_stream_io (in base/ftsystem.c only)
-
- * src/base/ftutil.c: New file. Contains all memory and list
- management code (previously in `ftobjs.c' and `ftlist.c',
- respectively).
-
- * include/freetype/internal/ftobjs.h: Moving all code related to
- glyph loaders to ...
- * include/freetype/internal/ftgloadr.h: This new file.
- `FT_GlyphLoader' is now a pointer to the structure
- `FT_GlyphLoaderRec'.
- (ft_glyph_own_bitmap): Renamed to ...
- (FT_GLYPH_OWN_BITMAP): This.
- * src/base/ftobjs.c: Moving all code related to glyph loaders
- to ...
- * src/base/ftgloadr.c: This new file.
-
-2002-02-22 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftdebug.h (FT_Trace): Remove comma in
- enum to avoid compiler warnings.
-
-2002-02-21 David Turner <david@freetype.org>
-
- Modified the debug sub-system initialization. Trace levels can now
- be specified within the `FT2_DEBUG' environment variable. See the
- comments within `ftdebug.c' for more details.
-
- * src/base/ftdebug.c: (FT_SetTraceLevel): Removed.
- (ft_debug_init): New function.
- (ft_debug_dummy): Removed.
- Updated to changes in ftdebug.h
-
- * include/freetype/internal/ftdebug.h: Always define
- FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE is defined.
- (FT_Assert): Renamed to ...
- (FT_ASSERT): This.
- Some stuff from ftdebug.h has been moved to ...
-
- * include/freetype/internal/fttrace.h: New file, to define the trace
- levels used for debugging. It is used both to define enums and
- toggle names for FT2_DEBUG.
-
- * include/freetype/internal/internal.h: Updated.
-
- * src/base/ftobjs.c, src/base/ftstream.c: Updated.
-
- * include/freetype/internal/ftextend.h, src/base/ftextend.c:
- Removed. Both files are now completely obsolete.
- * src/base/Jamfile, src/base/rules.mk: Updated.
-
- * include/freetype/fterrors.h: Adding `#undef FT_ERR_CAT' and
- `#undef FT_ERR_XCAT' to avoid warnings with certain compilers (like
- LCC).
-
- * src/pshinter/pshalgo2.c (print_zone): Renamed to ...
- (psh2_print_zone): This to avoid errors during compilation of debug
- library.
-
- * src/smooth/ftgrays.c (FT_COMPONENT): Change definition to as
- `trace_smooth'.
-
-2002-02-20 David Turner <david@freetype.org>
-
- * README: Adding `devel@freetype.org' address for bug reports.
-
-2002-02-20 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/install.mk (check): New dummy target.
- (.PHONY): Add it.
-
-2002-02-19 Werner Lemberg <wl@gnu.org>
-
- * builds/freetype.mk (FT_CFLAGS): Use $(INCLUDE_FLAGS) first.
-
- * src/cache/ftccache.c (ftc_cache_resize): Mark `error' as unused
- to avoid compiler warning.
- * src/cff/cffload.c (CFF_Get_String): Ditto.
- * src/cff/cffobjs.c (CFF_StrCopy): Ditto.
- * src/psaux/psobjs.c (PS_Table_Done): Ditto.
- * src/pcf/pcfread.c (pcf_seek_to_table_type): Ditto.
- * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Ditto.
- (pcf_get_bitmaps): The same for `sizebitmaps'.
- * src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): The same for
- `orig_y'.
- (t1operator_seac): Comment out more dead code.
- * src/pshinter/pshalgo2.c (ps2_hints_apply): Add `DEBUG_HINTER'
- conditional.
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
- load_truetype_glyph): Add `TT_CONFIG_OPTION_BYTECODE_INTERPRETER'
- conditional.
-
-2002-02-18 Werner Lemberg <wl@gnu.org>
-
- * src/autohint/ahglyph.c (ah_outline_link_segments): Remove unused
- variables.
- * src/autohint/ahhint.c (ah_align_serif_edge): Use FT_UNUSED instead
- of UNUSED.
- * src/autohint/ahmodule.c (ft_autohinter_reset): Ditto.
- * src/pshinter/pshrec.c (ps_mask_table_merge): Fix typo in variable
- swapping code.
- * src/pshinter/pshglob.h (PSH_Blue_Align): Add PSH_BLUE_ALIGN_NONE.
- * src/pshinter/pshglob.c (psh_blues_snap_stem): Use it.
- * src/pshinter/pshalgo1.c (psh1_hint_table_optimize): Ditto.
- * src/pshinter/pshalgo2.c (psh2_hint_align): Ditto.
- * include/freetype/internal/ftobjs.h (UNUSED): Removed.
-
-2002-02-10 Roberto Alameda <ojancano@geekmail.de>
-
- Add support for ISOLatin1 PS encoding.
-
- * include/freetype/freetype.h (ft_encoding_latin_1): New tag
- (`lat1').
- * include/freetype/internal/t1types.h (T1_Encoding_Type): Add
- `t1_encoding_isolatin1'.
- * src/type1/t1driver.c (Get_Char_Index, Get_Next_Char): Handle
- ft_encoding_latin_1.
- * src/type1/t1load.c (parse_encoding): Handle `ISOLatin1Encoding'.
- * src/type1/t1objs.c (T1_Face_Init): Handle `t1_encoding_isolatin1'.
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2002-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/ChangeLog.22 b/freetype/ChangeLog.22
deleted file mode 100644
index 86662f6e..00000000
--- a/freetype/ChangeLog.22
+++ /dev/null
@@ -1,2837 +0,0 @@
-2006-05-12 Werner Lemberg <wl@gnu.org>
-
-
- * Version 2.2.1 released.
- =========================
-
-
- Tag sources with `VER-2-2-1'.
-
-2006-05-12 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/sources.py (re_source_keywords): Add word
- boundary markers.
- * src/tools/docmaker/content.py (re_field): Allow `.' in field names
- (but not at the beginning or end).
- * src/tools/docmaker/tohtml.py (html_header_1): Use `utf-8' charset.
- (block_footer): Split into...
- (block_footer_start, block_footer_middle, block_footer_end): This to
- add navigation buttons.
- (HtmlFormatter::block_exit): Updated.
-
- * include/freetype/*: Many minor documentation improvements (adding
- links, spelling errors, etc.).
-
-2006-05-11 Werner Lemberg <wl@gnu.org>
-
- * README: Minor updates.
-
- * include/freetype/*: s/scale/scaling value/ where appropriate.
- Many other minor documentation improvements.
-
- * src/tools/docmaker/sources.py (re_italic, re_bold): Handle
- trailing punctuation.
- * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word): Add
- warning message for undefined cross references.
- Update handling of re_italic and re_bold.
-
-2006-05-11 Masatake YAMATO <jet@gyve.org>
-
- * builds/unix/ftsystem.c (FT_Stream_Open): Check errno only if
- read system call returns -1.
- Remove a redundant parenthesis.
-
-2006-05-10 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ftsystem.c (FT_Stream_Open): Avoid infinite loop if
- given an empty, un-mmap()able file. Reported and suggested fix in
- Savannah bug #16555.
-
- * builds/freetype.mk (refdoc): Write-protect the `docmaker'
- directory to suppress generation of .pyc files. According to the
- Python docs there isn't a more elegant solution (currently).
-
- * builds/toplevel.mk (dist): New target which builds .tar.gz,
- .tar.bz2, and .zip files. Note that the version number is still
- hard-coded.
- (do-dist): Sub-target of `dist'.
- (CONFIG_GUESS, CONFIG_SUB): New variables.
- (.PHONY): Updated.
-
-2006-05-09 Rajeev Pahuja <rpahuja@esri.com>
-
- * builds/win32/visualc/freetype.sln,
- builds/win32/visualc/freetype.vcproj: Upgraded to VS.NET 2005 from
- VS.NET 2003
- Added files ftbbox.c, fttype1.c, ftwinfnt.c, ftsynth.c.
-
- * builds/win32/visualc/index.html: Updated.
-
-2006-05-07 Werner Lemberg <wl@gnu.org>
-
- Put version information into the configure script. Reported by Paul
- Watson <pwatson@redlinepy.com>.
-
- * builds/unix/configure.ac: Renamed to...
- * builds/unix/configure.raw: This which now serves (with appropriate
- modifications) as a template for configure.ac.
-
- * version.sed: New script.
-
- * autogen.sh: Generate configure.ac from configure.raw, using
- FREETYPE_MAJOR, FREETYPE_MINOR, and FREETYPE_PATCH from freetype.h.
-
-2006-05-06 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
- * builds/unix/configure.ac (version_info): Set to 9:10:3.
-
- * builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj, builds/freetype.mk (refdoc),
- Jamfile (RefDoc), README: s/220/221/, s/2.2.0/2.2.1/.
- Minor updates.
-
- * docs/CHANGES, docs/VERSION.DLL, docs/PROBLEMS, README.CVS:
- Updated.
-
- * builds/unix/install-sh: Updated from `texinfo' CVS module at
- savannah.gnu.org.
-
- * devel/ftoption.h: Synchronize with
- include/freetype/config/ftoption.h.
-
-2006-05-04 Werner Lemberg <wl@gnu.org>
-
- * src/lzw/ftlzw2.c: Renamed to...
- * src/lzw/ftlzw.c: This.
-
- * src/lzw/Jamfile, src/lzw/rules.mk: Updated.
-
- * builds/mac/FreeType.m68k_cfm.make.txt,
- builds/mac/FreeType.m68k_far.make.txt,
- builds/mac/FreeType.ppc_carbon.make.txt,
- builds/mac/FreeType.ppc_classic.make.txt: Updated.
-
-2006-05-03 David Turner <david@freetype.org>
-
- Allow compilation again with C++ compilers.
-
- * include/freetype/internal/ftmemory.h (FT_ASSIGNP,
- FT_ASSIGNP_INNER): New macros which do the actual assignment, and
- which exist in two variants (for C and C++).
- Update callers accordingly.
-
-2006-05-03 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftoption.h (FT_STRICT_ALIASING): Removed.
-
-2006-05-02 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftmemory.h: s/new/newsz/ (for C++).
- (FT_ALLOC): Remove redundant redefinition.
-
- * builds/compiler/gcc-dev.mk (CFLAGS) [g++]: Don't use
- `-Wstrict-prototypes'.
-
- * src/base/ftstream.c (FT_Stream_EnterFrame): Add cast.
-
- * include/freetype/config/ftconfig.h (FT_BASE_DEF) [__cplusplus]:
- Remove `extern'.
-
-2006-05-02 David Turner <david@freetype.org>
-
- Update the memory management functions and macros to safely deal
- with array size buffer overflows. This corresponds to attempts to
- allocate arrays that are too large. For an example, consider the
- following code:
-
- count = read_uint32_from_file(); array = malloc( sizeof ( Item ) *
- count ); for ( nn = 0; nn < count; nn++ )
- array[nn] = read_item_from_file();
-
- If `count' is larger than `FT_UINT_MAX/sizeof(Item)', the
- multiplication overflows, and the array allocated os smaller than
- the data read from the file. In this case, the heap will be
- trashed, and this can be used as a denial-of-service attack, or make
- the engine crash later.
-
- The FT_ARRAY_NEW and FT_ARRAY_RENEW macros now ensure that the new
- count is no larger than `FT_INT_MAX/item_size', otherwise a new
- error code `FT_Err_Array_Too_Large' will be returned.
-
- Note that the memory debugger now works again when FT_DEBUG_MEMORY
- is defined. FT_STRICT_ALIASING has disappeared; the corresponding
- code is now the default.
-
-
- * include/freetype/config/ftconfig.h (FT_BASE_DEF) [!__cplusplus]:
- Don't use `extern'.
-
- * include/freetype/fterrdef.h (FT_Err_Array_Too_Large): New error
- code.
-
- * include/freetype/internal/ftmemory.h (FT_DEBUG_INNER)
- [FT_DEBUG_MEMORY]: New macro.
- (ft_mem_realloc, ft_mem_qrealloc): Pass new object size count also.
- (ft_mem_alloc_debug, ft_mem_qalloc_debug, ft_mem_realloc_debug,
- ft_mem_qrealloc_debug, ft_mem_free_debug): Removed.
- (FT_MEM_ALLOC, FT_MEM_REALLOC, FT_MEM_QALLOC, FT_MEM_QREALLOC,
- FT_MEM_FREE): Redefine.
- (FT_MEM_NEW_ARRAY, FT_MEM_RENEW_ARRAY, FT_MEM_QNEW_ARRAY,
- FT_MEM_QRENEW_ARRAY): Redefine.
- (FT_ALLOC_MULT, FT_REALLOC_MULT, FT_MEM_QALLOC_MULT,
- FT_MEM_QREALLOC_MULT): New macros. Update callers where
- appropriate.
- (FT_MEM_SET_ERROR): Slightly redefine.
-
-
- * src/base/ftdbgmem.c (_ft_debug_file, _ft_debug_lineno)
- [FT_DEBUG_MEMORY]: New global variables, replacing...
- (FT_MemTableRec) [FT_DEBUG_MEMORY]: Remove `filename' and
- `line_no'. Update all callers.
- (ft_mem_debug_alloc) [FT_DEBUG_MEMORY]: Avoid possible integer
- overflow.
- (ft_mem_alloc_debug, ft_mem_realloc_debug, ft_mem_qalloc_debug,
- ft_mem_qrealloc_debug, ft_mem_free_debug): Removed.
-
- * src/base/ftmac.c (read_lwfn): Catch integer overflow.
- * src/base/ftrfork.c (raccess_guess_darwin_hfsplus): Ditto.
- * src/base/ftutil.c: Remove special code for FT_STRICT_ALIASING.
- (ft_mem_alloc, ft_mem_realloc, ft_mem_qrealloc): Rewrite.
-
-
- * include/freetype/ftstream.h (FT_FRAME_ENTER, FT_FRAME_EXIT,
- FT_FRAME_EXTRACT, FT_FRAME_RELEASE): Use FT_DEBUG_INNER to report the
- place where the frames were entered, extracted, exited or released
- in the memory debugger.
-
- * src/base/ftstream.c (FT_Stream_ReleaseFrame) [FT_DEBUG_MEMORY]:
- Call ft_mem_free.
- (FT_Stream_EnterFrame) [FT_DEBUG_MEMORY]: Use ft_mem_qalloc.
- (FT_Stream_ExitFrame) [FT_DEBUG_MEMORY]: Use ft_mem_free.
-
-2006-04-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Correct pfb_pos
- initialization, remove extra cast to copy to pfb_lenpos. This fixes
- parsing of PFB fonts with MacOS resource fork (bug introduced
- 2003-09-11). Patch provided by Huib-Jan Imbens <ft@imbens.nl>.
-
-2006-04-29 Werner Lemberg <wl@gnu.org>
-
- Further C library abstraction. Based on a patch from
- msn2@bidyut.com.
-
- * include/freetype/config/ftstdlib.h (FT_CHAR_BIT, FT_FILE,
- ft_fopen, ft_fclose, ft_fseek, ft_ftell, ft_fread, ft_smalloc,
- ft_scalloc, ft_srealloc, ft_sfree, ft_labs): New wrapper macros for
- C library functions. Update all users accordingly (and catch some
- other places where the C library function was used instead of the
- wrapper functions).
-
- * src/base/ftsystem.c: Don't include stdio.h and stdlib.h.
- * src/gzip/zutil.h [MSDOS && !(__TURBOC__ || __BORLANDC__)]: Don't
- include malloc.h.
-
-
- * builds/unix/unix-def.in (datarootdir): Define, for autoconf 2.59c
- and forthcoming versions.
-
-2006-04-28 Werner Lemberg <wl@gnu.org>
-
- * src/lzw/ftlzw.c, src/lzw/zopen.c, src/lzw/zopen.h: Removed,
- obsolete.
-
-2006-04-27 yi luo <luoyi.ly@gmail.com>
-
- * builds/win32/visualc/freetype.vcproj: Updated.
-
-2006-04-26 David Turner <david@freetype.org>
-
-
- * Version 2.2 released.
- =======================
-
-
- Tag sources with `VER-2-2-0'.
-
-2006-04-26 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/psobjs.c (shift_elements): Don't use FT_Long but
- FT_PtrDist for `delta'. Reported by Céline PILLET
- <Celine.Pillet@Tagginfo.com>.
-
-2006-04-21 David Turner <david@freetype.org>
-
- * include/freetype/ftincrem.h: Documentation updates.
- (FT_Incremental_Interface): New typedef.
-
- * include/freetype/ftmodapi.h, include/freetype/ftglyph.h:
- Documentation updates.
-
- * include/freetype/freetype.h: Documentation update.
- (FT_HAS_FAST_GLYPHS): Always set to 0.
-
- * include/freetype/ftstroke.h, src/base/ftstroke.c (FT_Stroker_New):
- Take an FT_Library argument instead of FT_Memory.
-
- * src/sfnt/ttcmap.c: Remove compiler warnings (gcc-4.0.2).
-
-2006-04-13 David Turner <david@freetype.org>
-
- * src/autofit/afloader.c (af_loader_init, af_loader_load_g): Remove
- superfluous code in the auto-fitter's loader.
-
-2006-04-05 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/makefile, builds/amiga/makefile.os4,
- builds/amiga/smakefile: Added FT2_BUILD_LIBRARY define.
-
-2006-04-03 luoyi <luoyi.ly@gmail.com>
-
- * builds/compiler/intelc.mk (TE): New variable.
- (ANSIFLAGS): Updated.
-
-2006-04-03 Werner Lemberg <wl@gnu.org>
-
- * builds/exports.mk (clean_symbols_list, clean_apinames): Removed.
- (CLEAN): Add $(EXPORTS_LIST) and $(APINAMES_EXE).
- (.PHONY): Updated.
-
- * configure.ac: Minor fixes to improve --help output.
-
-
- * docs/PROBLEMS: New file.
-
-2006-04-01 David Turner <david@freetype.org>
-
- * docs/CHANGES: Updated.
-
- * include/freetype/ftcache.h, include/freetype/config/ftheader.h:
- Update documentation comments.
-
-2006-04-01 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/install.mk (uninstall): Don't handle `cache'
- directory which no longer exists.
-
-2006-03-29 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * src/psaux/psconv.c: Changed some variables which are expected to
- hold negative values from `char' to `FT_Char' to allow building with
- a compiler where `char' is unsigned by default.
-
-2006-03-27 David Turner <david@freetype.org>
-
- * src/sfnt/ttkern.c (tt_face_get_kerning): Fix a serious bug that
- causes some programs to go into an infinite loop when dealing with
- fonts that don't have a properly sorted kerning sub-table.
-
-2006-03-26 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdflib.c (ERRMSG4): New macro.
- (_bdf_parse_glyphs): Handle invalid BBX values.
-
- * include/freetype/fterrdef.h (FT_Err_Bbx_Too_Big): New error
- macro.
-
-2006-03-23 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-
- * src/tools/docmaker/tohtml.py (html_header_2): Add horizontal
- padding between table elements.
- (html_header_1): The `DOCTYPE' comment must be in uppercase.
- (make_html_para): Convert `...' quotations into real left and
- right single quotes.
- Use `para_header' and `para_footer'.
-
- * src/tools/docmaker/sources.py (re_bold, re_italic): Accept "'"
- also.
-
-2006-03-23 David Turner <david@freetype.org>
-
- Add FT_Get_SubGlyph_Info API to retrieve subglyph data. Note that
- we do not expose the FT_SubGlyphRec structure.
-
- * include/freetype/internal/ftgloadr.h (FT_SUBGLYPH_FLAGS_*): Moved
- to...
- * include/freetype/freetype.h (FT_SUBGLYPH_FLAGS_*): Here.
- (FT_Get_SubGlyph_Info): New declaration.
-
- * src/base/ftobjs.c (FT_Get_SubGlyph_Info): New function.
-
-
- * src/autofit/afloader.c (af_loader_load_g): Compute lsb_delta and
- rsb_delta correctly in edge cases.
-
-2006-03-22 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftccache.c, (ftc_node_mru_up, FTC_Cache_Lookup)
- [!FTC_INLINE]: Compile conditionally.
- * src/cache/ftccache.h: Updated.
-
- * src/cache/ftcglyph.c (FTC_GNode_Init, FTC_GNode_UnselectFamily,
- FTC_GNode_Done, FTC_GNode_Compare, FTC_Family_Init, FTC_GCache_New):
- s/FT_EXPORT/FT_LOCAL/.
- (FTC_GCache_Init, FTC_GCache_Done): Commented out.
- (FTC_GCache_Lookup) [!FTC_INLINE]: Compile conditionally.
- s/FT_EXPORT/FT_LOCAL/.
- * src/cache/ftcglyph.h: Updated.
-
- * src/cache/ftcimage.c (FTC_INode_Free, FTC_INode_New):
- s/FT_EXPORT/FT_LOCAL/.
- (FTC_INode_Weight): Commented out.
- * src/cache/ftcimage.h: Updated.
-
- * src/cache/ftcmanag.c (FTC_Manager_Compress,
- FTC_Manager_RegisterCache, FTC_Manager_FlushN):
- s/FT_EXPORT/FT_LOCAL/.
- * src/cache/ftcmanag.h: Updated.
-
- * src/cache/ftcsbits.c (FTC_SNode_Free, FTC_SNode_New,
- FTC_SNode_Compare): s/FT_EXPORT/FT_LOCAL/.
- (FTC_SNode_Weight): Commented out.
- * src/cache/ftcsbits.h: Updated.
-
-2006-03-22 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftccache.c, src/cache/ftccache.h (FTC_Node_Destroy):
- Remove, unused.
-
- * src/cache/ftccmap.h: Remove, unused.
-
- * src/cache/rules.mk (CACHE_DRV_H): Remove ftccmap.h.
-
-2006-03-21 Zhe Su <james.su@gmail.com>
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Improve
- algorithm.
-
-2006-03-21 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cfftypes.h (CFF_CharsetRec): Add `max_cid' member.
-
- * src/cff/cffload.c (cff_charset_load): Set `charset->max_cid'.
-
- * src/cff/cffgload.c (cff_slot_load): Change type of third parameter
- to `FT_UInt'.
- Check range of `glyph_index'.
- * src/cff/cffgload.h: Updated.
-
-
- * src/sfnt/ttcmap.c (tt_face_build_cmaps): Handle invalid offset
- correctly.
-
-
- * builds/freetype.mk (refdoc), docs/CHANGES, Jamfile (RefDoc),
- README: s/2.1.10/2.2/.
-
-2006-03-21 David Turner <david@freetype.org>
-
- * src/autofit/aflatin.c (af_latin_metrics_scale): Fix small bug
- that crashes the auto-hinter (introduced by previous patch).
-
-2006-03-20 Werner Lemberg <wl@gnu.org>
-
- * builds/freetype.mk (CACHE_DIR, CACHE_H): Remove.
- (FREETYPE_H): Updated.
-
- * src/cache/rules.mk (CACHE_H_DIR): Remove.
- (CACHE_DRV_H): Updated.
-
-2006-03-20 David Turner <david@freetype.org>
-
- * include/freetype/cache/ftccache.h,
- include/freetype/cache/ftccmap.h, include/freetype/cache/ftcglyph.h
- include/freetype/cache/ftcimage.h include/freetype/cache/ftcmanag.h
- include/freetype/cache/ftcmru.h include/freetype/cache/ftcsbits.h:
- Move to...
-
- * src/cache/ftccache.h, src/cache/ftcglyph.h, src/cache/ftcimage.h,
- src/cache/ftcsbits.h, src/cache/ftcmanag.h, src/cache/ftccmap.h,
- src/cache/ftcmru.h: This new location.
- Update declarations according to the changes in the corresponding
- source files.
-
- Note that these files are not used by FreeType clients; all public
- APIs of the cache module have been already moved to
- `include/freetype/ftcache.h', and all FT_CACHE_INTERNAL_XXXX_H
- macros resolve to it.
-
- Reason for the move is to allow modifications of the internals
- without interferences with rogue clients. Note that there are no
- known clients that access the cache internals at the moment.
-
- * builds/unix/install.mk (install): Don't install headers from
- $(CACHE_H).
- Remove `freetype/cache' from the target directory.
-
- * include/freetype/config/ftheader.h (FT_CACHE_MANAGER_H,
- FT_CACHE_INTERNAL_MRU_H, FT_CACHE_INTERNAL_MANAGER_H,
- FT_CACHE_INTERNAL_CACHE_H, FT_CACHE_INTERNAL_GLYPH_H,
- FT_CACHE_INTERNAL_IMAGE_H, FT_CACHE_INTERNAL_SBITS_H): Point to
- FT_CACHE_H.
-
- * src/cache/ftcbasic.c, src/cache/ftccache.h, src/cache/ftccback.h,
- src/cache/ftccmap.c, src/cache/ftcglyph.c, src/cache/ftcglyph.h,
- src/cache/ftcimage.c, src/cache/ftcimage.h, src/cache/ftcmanag.c,
- src/cache/ftcmanag.h, src/cache/ftcmru.h, src/cache/ftcsbits.c,
- src/cache/ftcsbits.h: Don't use the FT_CACHE_INTERNAL_XXX_H macros
- but include the headers directly (which are now in `src/cache').
-
- * src/cache/ftccache.c: Don't use the FT_CACHE_INTERNAL_XXX_H
- macros but include the headers directly.
- (FTC_Cache_Init, FTC_Cache_Done, FTC_Cache_NewNode,
- FTC_Cache_Lookup, FTC_Cache_RemoveFaceID): Declare as FT_LOCAL_DEF.
-
- * src/cache/ftccache.c: Don't use the FT_CACHE_INTERNAL_XXX_H
- macros but include the headers directly.
- (FTC_MruNode_Prepend, FTC_MruNode_Up, FTC_MruNode_Remove,
- FTC_MruList_Init, FTC_MruList_Reset, FTC_MruList_Done,
- FTC_MruList_New, FTC_MruList_Remove, FTC_MruList_RemoveSelection):
- Declare as FT_LOCAL_DEF.
- (FTC_MruList_Find, FTC_MruList_Lookup) [!FTC_INLINE]: Compile
- conditionally.
- Declare as FT_LOCAL_DEF.
-
-
- * builds/win32/visualc/freetype.dsp: Update project file, add
- missing base source files (ftstroke.c, ftxf86.c, etc.).
-
-
- * src/autofit/afcjk.c, src/autofit/aflatin.c, src/base/ftobjs.c,
- src/cff/cffobjs.c, src/cid/cidobjs.c, src/pfr/pfrobjs.c,
- src/sfnt/sfobjs.c, src/sfnt/ttmtx.c, src/type1/t1afm.c,
- src/type1/t1objs.c: Remove compiler warnings when building with
- Visual C++ 6 and /W4.
-
- * src/autofit/aflatin.c (af_latin_hints_init): Disable horizontal
- hinting for italic/oblique fonts.
-
-
-
- * src/truetype/ttpload.c, src/truetype/ttpload.h
- (tt_face_get_device_metrics): Change second argument to `FT_UInt'.
-
-2006-03-06 David Turner <david@freetype.org>
-
- * src/cache/ftcmanag.c (FTC_Manager_Lookup_Size): Prevent crashes in
- Mozilla/FireFox print preview in Ubuntu Hoary.
-
-2006-02-28 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftutil.c (ft_mem_qalloc) [FT_STRICT_ALIASING]: Do not
- return error when size == 0.
-
-2006-02-28 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftobjs.c (FT_Done_Library): Remove modules in reverse
- order so that type42 module is removed before truetype module. This
- avoids double free in some occasions.
-
-2006-02-28 David Turner <david@freetype.org>
-
- * Release candidate VER-2-2-0-RC4.
- ----------------------------------
-
- * docs/CHANGES: Documentation updates.
-
-2006-02-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * modules.cfg (BASE_EXTENSIONS): Compile in ftgxval.c by default to
- build ftvalid in ft2demos. It works as dummy ABI if gxvalid is not
- built.
-
-2006-02-27 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/cache/ftccache.h
- [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove declaration of
- ftc_node_done.
-
- * src/cache/ftccache.c (ftc_node_destroy)
- [!FT_CONFIG_OPTION_OLD_INTERNALS]: Mark as FT_LOCAL_DEF. This
- should now fix all possible compilation options.
-
-2006-02-27 David Turner <david@freetype.org>
-
- * src/base/ftutil.c (ft_mem_alloc, ft_mem_qalloc, ft_mem_realloc,
- ft_mem_qrealloc): Return an error if a negative size is passed in
- parameters.
-
- * src/cache/ftccache.c (ftc_node_destroy): Mark as FT_BASE_DEF since
- it needs to be exported for rogue clients.
-
- * src/pshinter/pshglob.c (psh_blues_set_zones_0): Prevent problems
- with malformed fonts which have an odd number of blue values (these
- are broken according to the specs).
-
- * src/cff/cffload.c (cff_subfont_load), src/type1/t1load.c
- (T1_Open_Face): Modify the loaders to force even-ness of
- `num_blue_values'.
-
- (cff_index_access_element): Ignore invalid entries in index files.
-
-2006-02-27 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftobjs.c (FT_Set_Char_Size): Check the case where width
- or height is 0.
-
-2006-02-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/mac/FreeType.m68k_cfm.make.txt,
- builds/mac/FreeType.m68k_far.make.txt,
- builds/mac/FreeType.ppc_carbon.make.txt,
- builds/mac/FreeType.ppc_classic.make.txt: Update to new header
- inclusion introduced on 2006-02-16.
-
-2006-02-27 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftobjs.c (GRID_FIT_METRICS): New macro.
- (ft_glyphslot_grid_fit_metrics, FT_Load_Glyph) [GRID_FIT_METRICS]:
- Re-enable glyph metrics grid-fitting. It is now done in the base
- layer.
- (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Make sure the width and
- height are not too small or too large, just like we were doing in
- 2.1.10.
-
- * src/autofit/afloader.c (af_loader_load_g): The vertical metrics
- are not scaled.
-
-2006-02-26 Werner Lemberg <wl@gnu.org>
-
- * docs/release: Minor additions and clarifications.
-
- * docs/CHANGES: Updated to reflect many fixes for backward
- compatibility. Still incomplete.
-
-2006-02-26 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c (ft_recompute_scaled_metrics): Re-enable
- conservative rounding of metrics to avoid breaking clients like
- Pango (see https://bugzilla.gnome.org/show_bug.cgi?id=327852).
-
-2006-02-25 Werner Lemberg <wl@gnu.org>
-
- * devel/ftoption.h: Synchronize with
- include/freetype/config/ftoption.h.
-
- * src/cache/ftccache.c (ftc_node_destroy): Use FT_LOCAL_DEF (again).
-
-2006-02-25 David Turner <david@freetype.org>
-
- Fix compiler warnings as well as C++ compilation problems.
- Add missing prototypes.
-
- * src/autofit/afcjk.c, src/base/ftobjs.c, src/base/ftutil.c,
- src/bdf/bdfdrivr.c, src/cff/cffcmap.c, src/cff/cffobjs.c,
- src/psaux/afmparse.c,, src/psaux/t1cmap.c, src/smooth/ftgrays.c
- src/tools/apinames.c, src/truetype/ttdriver.c: Add various casts,
- initialize variables, and decorate functions with FT_CALLBACK_DEF,
- etc., to fix compiler warnings (and C++ compiling errors).
-
- * src/cache/ftcbasic.c: Fix `-Wmissing-prototypes' warnings with
- gcc.
-
- * builds/unix/ftsystem.c: Don't include FT_INTERNAL_OBJECTS_H but
- FT_INTERNAL_STREAM_H.
-
- * src/base/ftsystem.c: Include FT_INTERNAL_STREAM_H.
-
- * include/freetype/config/ftheader.h (FT_PFR_H): New macro.
-
- * include/freetype/config/ftoption.h (FT_STRICT_ALIASING): Don't
- define for C++.
-
- * include/freetype/internal/services/svotval.h: Don't include
- FT_OPENTYPE_VALIDATE_H but FT_INTERNAL_VALIDATE_H.
-
- * include/freetype/internal/services/svpfr.h: Include FT_PFR_H.
-
- * src/gzip/ftgzip.c: Include FT_GZIP_H.
-
- * src/lzw/ftlzw.c, src/lzw/ftlzw2.c: Include FT_LZW_H.
-
- * src/sfnt/ttbdf.c (tt_face_load_bdf_props): Rearrange code.
-
-2006-02-24 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftoutln.c (FT_OUTLINE_GET_CONTOUR, ft_contour_has,
- ft_contour_enclosed, ft_outline_get_orientation): Commented out. We
- have to wait until `FT_GlyphSlot_Own_Bitmap' is stabilized.
- (FT_Outline_Embolden): Use `FT_Outline_Get_Orientation'.
-
-2006-02-24 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/ftbitmap.h (FT_Bitmap_Embolden): Update
- documentation.
-
- * include/freetype/ftsynth.h (FT_GlyphSlot_Own_Bitmap),
- src/base/ftsynth.c (FT_GlyphSlot_Own_Bitmap): New function to make
- sure a glyph slot owns its bitmap. It is also marked experimental
- and due to change.
- (FT_GlyphSlot_Embolden): Undo the last change. It turns out that
- rendering the outline confuses some applications.
-
-2006-02-24 David Turner <david@freetype.org>
-
- * Release candidate VER-2-2-0-RC3.
- ----------------------------------
-
- * src/cache/ftcbasic.c: Correct compatibility hack bug.
-
-2006-02-24 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/freetype.h (FT_Size_RequestRec): Change the type
- of `width' and `height' to `FT_Long'.
- (enum FT_Size_Request_Type), src/base/ftobjs.c (FT_Request_Metrics):
- New request type `FT_SIZE_REQUEST_TYPE_SCALES' to specify the scales
- directly.
-
-2006-02-23 David Turner <david@freetype.org>
-
- Two BDF patches from Debian libfreetype6 for 2.1.10.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs): Fix a bug with zero-width
- glyphs.
- Fix a problem with large encodings.
-
-
- Fix binary compatibility issues for gnustep-back (GNUstep backend
- module) which still crashes under Sarge.
-
- * src/cache/ftccmap.c (FTC_OldCMapType, FTC_OldCMapIdRec,
- FTC_OldCMapDesc) [FT_CONFIG_OPTION_OLD_INTERNALS]: New data
- structures and enumerations.
- (FTC_CMapCache_Lookup) [FT_CONFIG_OPTION_OLD_INTERNALS]: New
- compatibility code.
-
- * src/cache/ftcbasic.c: Fix a silly bug that prevented our `hack' to
- support rogue clients compiled against 2.1.7 to work correctly.
- This probably explains the GNUstep crashes with the second release
- candidate.
-
-2006-02-23 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/ftoutln.h (enum FT_Orientation): New value
- `FT_ORIENTATION_NONE'.
-
- * src/base/ftoutln.c (FT_OUTLINE_GET_CONTOUR, ft_contour_has,
- ft_contour_enclosed, ft_outline_get_orientation): Another version of
- `FT_Outline_Get_Orientation'. This version differs from the public
- one in that each part (contour not enclosed in another contour) of the
- outline is checked for orientation.
- (FT_Outline_Embolden): Use `ft_outline_get_orientation'.
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Render the outline and
- use bitmap's embolden routine when the outline one failed.
-
-2006-02-22 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * modules.cfg: Compile in ftotval.c and ftxf86.c by default for ABI
- compatibility.
-
- * src/sfnt/sfobjs.c (sfnt_done_face): Fix a memory leak.
-
- * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_bit_aligned,
- tt_sbit_decoder_load_byte_aligned) [FT_OPTIMIZE_MEMORY]: Fix sbit
- loading. (Only tested with bit aligned sbit with x_pos == 0.)
-
- * src/truetype/ttpload.c (tt_face_load_hdmx,
- tt_face_get_device_metrics) [FT_OPTIMIZE_MEMORY]: `hdmx' is not
- actually used.
-
-2006-02-21 David Turner <david@freetype.org>
-
- Add a new API named FT_Get_TrueType_Engine_Type to determine whether
- we have a patented, unpatented, or unimplemented TrueType bytecode
- interpreter.
-
- The FT_Get_Module_Flags API was removed consequently.
-
- * include/freetype/ftmodapi.h (FT_Module_Get_Flags): Removed.
- Replaced with...
- (FT_Get_TrueType_Engine_Type): This.
- (FT_TrueTypeEngineType): New enumeration.
-
- * include/freetype/internal/ftserv.h (FT_SERVICE_TRUETYPE_ENGINE_H):
- New macro.
-
- * src/base/ftobjs.c: Include FT_SERVICE_TRUETYPE_ENGINE_H.
- (FT_Module_Get_Flags): Removed. Replaced with...
- (FT_Get_TrueType_Engine_Type): This.
-
- * src/truetype/ttdriver.c: Include FT_SERVICE_TRUETYPE_ENGINE_H.
- (tt_service_truetype_engine): New service structure.
- (tt_services): Register it.
-
- * include/freetype/internal/services/svtteng.h: New file.
-
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Fix silly bug that prevented
- embedded bitmaps from being correctly listed and used.
-
-
- * src/sfnt/ttmtx.c (tt_face_load_hmtx): Disable memory optimization
- if FT_CONFIG_OPTION_OLD_INTERNALS is used. The is necessary because
- libXfont is directly accessing the HMTX data, unfortunately.
- Fix some compiler warnings.
- (tt_face_get_metrics): Ditto.
-
-
- * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Fix handling of
- character advances.
-
-2006-02-20 David Turner <david@freetype.org>
-
- Support binary compatibility with the X.Org server's Xfont library.
- Note that this change unfortunately prevents memory optimizations
- for the embedded bitmap loader.
-
- * include/freetype/internal/sfnt.h (SFNT_Interface): Move
- `set_sbit_strike' and `load_sbit_metrics' fields to the location of
- version 2.1.8.
-
- * src/sfnt/sfdriver.c (tt_face_set_sbit_strike_stub): Call
- FT_Size_Request.
- (sfnt_interface): Updated.
-
- * src/sfnt/ttsbit.c [FT_CONFIG_OPTION_OLD_INTERNALS]: Don't load
- ttsbit0.c.
- (tt_load_sbit_metrics): Make `sbit_small_metrics_fields' static.
-
- * src/sfnt/ttsbit.h: Updated.
-
-2006-02-17 David Turner <david@freetype.org>
-
- * builds/unix/unix-cc.in (LINK_LIBRARY): Don't filter out exported
- functions anymore. This ensures that all FT_BASE internal functions
- are available for dynamic linking.
-
- * include/freetype/ftcache.h (FTC_IMAGE_TYPE_COMPARE,
- FTC_IMAGE_TYPE_HASH), src/cache/ftcbasic.c (FTC_OldFontRec,
- FTC_OldImageDescRec, FTC_ImageCache_Lookup, FTC_Image_Cache_New,
- FTC_OldImageDesc, FTC_OLD_IMAGE_FORMAT, ftc_old_image_xxx,
- ftc_image_type_from_old_desc, FTC_Image_Cache_Lookup,
- FTC_SBitCache_Lookup, FTC_SBit_Cache_New, FTC_SBit_Cache_Lookup)
- [FT_CONFIG_OPTION_OLD_INTERNALS]: Try to revive old functions of the
- cache sub-system. We try to recognize old legacy signatures with a
- gross hack (hope it works).
-
-2006-02-17 Werner Lemberg <wl@gnu.org>
-
- * devel/ftoption.h: Synchronize with
- include/freetype/config/ftoption.h.
-
-2006-02-16 David Turner <david@freetype.org>
-
- Massive changes to the internals to respect the internal object
- layouts and exported functions of FreeType 2.1.7. Note that the
- cache sub-system cannot be fully retrofitted, unfortunately.
-
- * include/freetype/config/ftoption.h
- (FT_CONFIG_OPTION_OLD_INTERNALS): New macro.
-
- * include/freetype/ftcache.h, include/freetype/cache/ftccache.h,
- include/freetype/cache/ftccmap.h,
- include/freetype/internal/ftcalc.h,
- include/freetype/internal/ftdriver.h,
- include/freetype/internal/ftmemory.h,
- include/freetype/internal/ftobjs.h,
- include/freetype/internal/psaux.h, include/freetype/internal/sfnt.h,
- include/freetype/internal/t1types.h,
- include/freetype/internal/tttypes.h, src/base/ftcalc.c,
- src/base/ftdbgmem.c, src/base/ftobjs.c, src/base/ftutil.c,
- src/bdf/bdfdrivr.c, src/cache/ftccache.c, src/cache/ftccback.h,
- src/cache/ftcmanag.c, src/cff/cffdrivr.c, src/cid/cidriver.c,
- src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c, src/psaux/psauxmod.c,
- src/sfnt/sfdriver.c, src/truetype/ttdriver.c, src/type1/t1driver.c,
- src/type1/t1objs.c, src/type42/t42drivr.c, src/winfonts/winfnt.c:
- Use FT_CONFIG_OPTION_OLD_INTERNALS to revive old functions and data
- structures.
-
- Move newly added structure elements to the end of the affected
- structure and add stub fields (if FT_CONFIG_OPTION_OLD_INTERNALS is
- defined) to assure binary compatibility with older FreeType
- versions.
- Use FT_CONFIG_OPTION_OLD_INTERNALS to add function stubs for old
- functions:
-
- ft_stub_set_char_sizes
- ft_stub_set_pixel_sizes
-
- Rename the following internal functions to provide the old function
- names as stubs:
-
- FT_Alloc -> ft_mem_alloc
- FT_QAlloc -> ft_mem_qalloc
- FT_Realloc -> ft_mem_realloc
- FT_QRealloc -> ft_mem_qrealloc
- FT_Free -> ft_mem_free
- FT_Alloc_Debug -> ft_mem_alloc_debug
- FT_QAlloc_Debug -> ft_mem_qalloc_debug
- FT_Realloc_Debug -> ft_mem_realloc_debug
- FT_QRealloc_Debug -> ft_mem_qrealloc_debug
- FT_Free_Debug -> ft_mem_free_debug
-
-2006-02-15 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove
- unused `max_points' and `max_contours'.
-
- * src/cid/cidobjs.c (cid_face_init), src/type1/t1objs.c
- (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Update.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Remove unused
- `max_components'.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): Remove unused
- `loadSize' and `loadStack'.
-
- * src/truetype/ttinterp.c (TT_Done_Context, TT_Load_Context),
- src/sfnt/ttload.c (tt_face_load_maxp): Update.
-
- * src/cff/cffobjs.h (cff_size_select), src/sfnt/sfdriver.c
- (sfnt_interface), src/truetype/ttdriver.c (tt_size_request): Fix
- compiler errors/warnings when TT_CONFIG_OPTION_EMBEDDED_BITMAPS is not
- defined.
-
- * src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_get_metrics): Fix
- possible segment faults for the non-FT_OPTIMIZE_MEMORY'ed versions.
- (finally!)
-
-
- For most OpenType tables, `tt_face_load_xxxx' simply loads the table
- and `face->root' is set later in `sfnt_load_face'. Here, we try to
- make this work for _all_ tables. Also improve tracing messages.
-
- * src/sfnt/ttsbit.c, src/sfnt/ttsbit0.c, src/sfnt/ttload.c,
- src/sfnt/ttmtx.c: all `tt_face_load_xxxx' should load the table and
- then exit. Error handling or setting face->root is done later in
- `sfnt_load_face'.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Work harder.
- Mac bitmap-only fonts are not scalable.
- Check that `face->header.Units_Per_EM' is not zero.
- (LOAD_, LOADM_): Emit pretty trace messages.
-
- * src/sfnt/ttsbit0.c (tt_face_load_strike_metrics): Read metrics
- from `eblc'.
-
- * src/sfnt/ttcmap.c (tt_face_build_cmaps), src/sfnt/ttpost.c
- (load_format_20, load_format_25, tt_face_get_ps_name): Use
- face->max_profile.numGlyphs, instead of face->root.num_glyphs.
-
-2006-02-14 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftoutln.h (FT_Outline_Embolden): Mention in
- documentation that negative strength values are possible.
- Give an example call.
-
- * include/freetype/freetype.h (FT_GlyphSlotRec): Improve
- documentation of `outline' field.
-
- * src/sfnt/sfobjs.c: Include FT_INTERNAL_DEBUG_H.
- * src/sfnt/sfdriver.c: Include ttmtx.h.
-
- * src/autofit/afcjk.c: Include aftypes.h and aflatin.h.
-
-2006-02-14 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/sfnt/ttmtx.c (tt_face_get_metrics): Typo.
-
-2006-02-14 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/sfnt/ttmtx.c (tt_face_load_hhea, tt_face_load_hmtx): Simply
- return error if table is missing.
- Check table length in non-FT_OPTIMIZE_MEMORY'ed `tt_face_load_hmtx'.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Take care of missing metrics
- tables. The last change makes Mac bitmap-only font not load and
- this fixes it.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation
- error when FT_CONFIG_OPTION_INCREMENTAL is defined.
-
-2006-02-13 Chia-I Wu <b90201047@ntu.edu.tw>
-
- Clean up the SFNT_Interface. In this final pass, `load_hmtx' is
- split from `load_hhea'.
-
- * include/freetype/internal/sfnt.h, src/sfnt/sfdriver.c,
- src/sfnt/ttmtx.c, src/sfnt/ttmtx.h: Split `hmtx' from `hhea'.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Update.
-
-2006-02-13 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/sfnt/ttmtx.h, src/sfnt/ttmtx.c: Why are there two copies of
- code...
-
-2006-02-13 Chia-I Wu <b90201047@ntu.edu.tw>
-
- Clean up the SFNT_Interface. In this pass, we want to treat the
- font directory (offset table and table directory) as a normal table
- like the others. This also means that TTCs are no longer recognized
- there but in `init_face'.
-
- * include/freetype/internal/sfnt.h (SFNT_Interface),
- src/sfnt/sfdriver.c: `load_sfnt_header' and `load_directory' are
- combined and renamed to `load_font_dir'.
-
- * src/sfnt/ttload.h, src/sfnt/ttload.c:
- s/sfnt_dir_check/check_table_dir/.
- `sfnt_init' is moved to sfobjs.c and renamed to `sfnt_open_font'.
- `tt_face_load_sfnt_header' and `tt_face_load_directory' are combined
- and renamed to `tt_face_load_font_dir'.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Recognize TTC here.
-
-2006-02-13 Chia-I Wu <b90201047@ntu.edu.tw>
-
- Clean up the SFNT_Interface. Table loading functions are now named
- after the tables' tags; `hdmx' is TrueType-specific and thus the
- code is moved to the truetype module; `get_metrics' is moved here
- from the truetype module so that the code can be shared with the cff
- module.
-
- This pass involves no real changes. That is, the code is moved
- verbatim mostly. The only exception is the return value of
- `tt_face_get_metrics'.
-
- * include/freetype/internal/sfnt.h, src/sfnt/rules.mk,
- src/sfnt/sfdriver.c, src/sfnt/sfnt.c, src/sfnt/sfobjs.c,
- src/sfnt/ttload.c, src/sfnt/ttload.h, src/sfnt/ttsbit.c,
- src/sfnt/ttsbit.h, src/sfnt/ttsbit0.c: Clean up the SFNT_Interface.
-
- * src/sfnt/ttmtx.c, src/sfnt/ttmtx.h: New files. Metrics-related
- tables' loading and parsing code is moved to here.
- Move `tt_face_get_metrics' here from the truetype module. The
- return value is changed from `void' to `FT_Error'.
-
- * include/freetype/internal/fttrace.h: New trace: ttmtx.
-
- * src/truetype/ttpload.c, src/truetype/ttpload.h: `hdmx' loading and
- parsing code is moved here.
- New function `tt_face_load_prep' split from `tt_face_load_fpgm'.
- `tt_face_load_fpgm' returns `FT_Err_Ok' if `fpgm' doesn't exist.
-
- * src/cff/cffgload.c, src/cff/cffobjs.c: Update.
-
- * src/truetype/ttgload.c, src/truetype/ttobjs.c: Update.
-
-2006-02-11 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/autofit/afcjk.c (af_cjk_metrics_init): Fix a stupid bug...
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths): Use
- AF_LatinMetricsRec as the dummy metrics because we cast the metrics
- to it later in `af_latin_hints_link_segments'.
-
-2006-02-11 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/config/ftoption.h (AF_CONFIG_OPTION_CJK): #define
- to enable autofit CJK script support. (#define'd by default.)
-
- * src/autofit/aflatin.h (AF_LATIN_CONSTANT): New macro.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths): Make sure
- that `edge_distance_threshold' is always set.
- (af_latin_hints_link_segments): Potential divide-by-zero bug.
- Use latin constant in the scoring formula.
-
- * src/autofit/afcjk.c: Minor updates due to the above three changes.
-
- * docs/TODO, docs/CHANGES: Updated.
-
-2006-02-09 Chia-I Wu <b90201047@ntu.edu.tw>
-
- Introduce experimental autofit CJK module based on akito's autohint
- patch. You need to #define AF_MOD_CJK in afcjk.c to enable it.
-
- * src/autofit/afglobal.c, src/autofit/afcjk.h, src/autofit/afcjk.c,
- src/autofit/rules.mk, src/autofit/autofit.c, src/autofit/aftypes.h:
- Add CJK module based on akito's autohint patch.
-
- * src/autofit/afhints.h (AF_SegmentRec): New field `len' for the
- overlap length of the segments.
- (AF_SEGMENT_LEN, AF_SEGMENT_DIST): New macros.
-
- * src/autofit/aflatin.h (af_latin_metrics_init_widths),
- src/autofit/aflatin.c (af_latin_metrics_init_widths): Made
- `FT_LOCAL'.
- Use the character given by the caller.
- (af_latin_metrics_init_widths, af_latin_hints_link_segments): Scale
- the thresholds.
-
- * src/autofit/afloader.c (af_loader_load_g): Respect
- AF_SCALER_FLAG_NO_ADVANCE.
-
-2006-02-09 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidparse.c (cid_parse_new): Remove shadowing variable.
-
-2006-02-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/cid/cidparse.c (cid_parse_new): Fix for abnormally short or
- broken CIDFont. Reported by Taek Kwan(TK) Lee (see ft-devel
- 2005-11-02).
-
-2006-02-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.ac: Fix bug for `--with-old-mac-fonts'
- option on UNIX platform. It has been broken since 2006-01-11.
-
-2006-02-01 Werner Lemberg <wl@gnu.org>
-
- * src/otvalid/module.mk: s/otvalid_module_class/otv_module_class/.
- * src/gxvalid/module.mk: s/gxvalid_module_class/gxv_module_class/.
-
- * builds/unix/unixddef.mk: Actually do define PLATFORM (fixing
- change from 2006-01-31).
- (TOP_DIR, OBJ_DIR): Update.
-
- * builds/unix/install.mk (install): Fix path for ftmodule.h.
-
- * Makefile, *.mk, builds/unix/unix-cc.in, builds/unix-def.in: Use
- `?=' where appropriate.
-
- * builds/detect.mk (TOP_DIR), builds/os2/os2-dev.mk (TOP_DIR),
- builds/win32/w32-dev.mk (TOP_DIR): Removed. Defined elsewhere.
-
-2006-01-31 Werner Lemberg <wl@gnu.org>
-
- Implement new, simplified module selection. With GNU make it is now
- sufficient to modify a single file, `modules.cfg', to control the
- inclusion of modules and base extension files.
-
- This change also fixes the creation of ftmodule.h; it now depends on
- `modules.cfg' and thus is rebuilt only if necessary.
-
- Finally, a version of `ftoption.h' in OBJ_DIR is preferred over the
- default location.
-
- * modules.cfg: New file.
-
- * builds/freetype.mk: Don't include `modules.mk'.
- Include all `rules.mk' files as specified in `modules.cfg'.
- (FTOPTION_FLAG, FTOPTION_H): New variables.
- (FT_CFLAGS): Add macro definition for FT_CONFIG_MODULES_H.
- Add FTOPTION_FLAG.
- ($(FT_INIT_OBJ)): Don't use FT_MODULE_LIST.
- (CONFIG_H): Add FTMODULE_H and FTOPTION_H.
- (INCLUDES): Add DEVEL_DIR.
- (INCLUDE_FLAGS, FTSYS_SRC, FTSYS_OBJ, FTDEBUG_SRC, FTDEBUG_OBJ,
- OBJ_M, OBJ_S): Use `:=', not `='.
- (remove_ftmodule_h): New phony target to delete `ftmodule.h'.
- (distclean): Add remove_ftmodule_h.
-
- * builds/modules.mk: (MODULE_LIST): Removed.
- (make_module_list, clean_module_list): Replace targets
- with...
- (FTMODULE_H_INIT, FTMODULE_H_CREATE, FTMODULE_H_DONE): New
- variables. Reason for the change is that it is not possible to have
- a phony prerequisite which is run only if the target file must be
- rebuilt (phony prerequisites act like subroutines and are *always*
- executed). We only want to rebuild `ftmodule.h' if `module.cfg' is
- changed.
- Update all callers.
- ($FTMODULE_H)): Rule to create `ftmodule.h', depending on
- `modules.cfg'.
-
- * builds/toplevel.mk: Rewrite and simplify module handling.
- (MODULES_CFG, FTMODULE_H): New variables.
- Include MODULES_CFG.
- (MODULES): New variable to include all `module.mk' and `rules.mk'
- files. We no longer use make's `wildcard' function for this.
-
- * Makefile (USE_MODULES): Remove. Update all users.
- (OBJ_DIR): Define it here.
-
- * src/*/module.mk: Change
-
- make_module_list: foo
- foo: ...
-
- to
-
- FTMODULE_H_COMMANDS += FOO
- define FOO
- ...
- endef
-
- in all files. `FTMODULE_H_COMMANDS' is used in `FTMODULE_H_CREATE'.
-
- * src/base/rules.mk (BASE_EXT_SRC): Use BASE_EXTENSIONS.
-
- * builds/unix/detect.mk (setup): Always execute `configure' script.
- (have_mk): Rename to...
- (have_Makefile): This.
- Don't use `strip' function.
-
- * builds/unix/unix.mk: Include `install.mk' only if BUILD_PROJECT is
- defined.
- (have_mk): Don't use `strip' function.
- Test for unix-def.mk in OBJ_DIR, not BUILD_DIR (and invert the test
- accordingly).
-
- * builds/unix/install.mk (install, uninstall): Handle `ftmodule.h'.
-
- * builds/os2/os2-dev.mk, builds/unix/unix-dev.mk,
- builds/win32/w32-bccd.mk, builds/win32/w32-dev.mk: Don't define
- BUILD_DIR but DEVEL_DIR for development header files.
-
- * builds/ansi/ansi-def.mk (TOP_DIR, OBJ_DIR),
- builds/beos/beos-def.mk (TOP_DIR, OBJ_DIR), builds/unix/unix-def.in
- (TOP_DIR, OBJ_DIR): Removed. Defined elsewhere.
-
- * builds/dos/dos-def.mk (OBJ_DIR), builds/os2/os2-def.mk (OBJ_DIR),
- builds/win32/win32-def.mk (OBJ_DIR): Removed. Defined elsewhere.
-
- * builds/unix/unixddef.mk: Don't define BUILD_DIR but DEVEL_DIR for
- development header files.
- Don't define PLATFORM.
-
- * configure: Copy `modules.cfg' to builddir if builddir != srcdir.
- Update snippet taken from autoconf's m4sh.m4 to current CVS version.
- Be more verbose.
-
- * include/freetype/config/ftmodule.h: Add comments -- this file is
- no longer used if FreeType is built with GNU make.
-
- * docs/CHANGES, docs/CUSTOMIZE, docs/INSTALL, docs/INSTALL.ANY,
- docs/INSTALL.GNU, docs/INSTALL.UNX: Document new build mechanism.
- Other minor updates.
-
- * modules.txt: Removed. Contents included in `modules.cfg'.
-
-
- * include/freetype/internal/ftmemory.h (FT_QAlloc_Debug,
- FT_Free_Debug) [FT_STRICT_ALIASING]: Fix typos.
-
- * src/base/ftdbgmem.c (FT_Alloc_Debug, FT_Realloc_Debug,
- FT_QAlloc_Debug, FT_QRealloc_Debug, FT_Free_Debug)
- [FT_STRICT_ALIASING]: Implement.
-
-2006-01-31 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
- (cid_face_init), src/pfr/pfrobjs.c (pfr_face_init),
- src/type1/t1objs.c (T1_Face_Init): Set face->height to MAX(1.2 *
- units_per_EM, ascender - descender).
-
-2006-01-31 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/internal/t1types.h (AFM_FontInfo),
- src/psaux/afmparse.c, src/tools/test_afm.c: Read `FontBBox',
- `Ascender', and `Descender' from an AFM.
-
- * src/type1/t1afm.c (T1_Read_Metrics): Use the metrics from the AFM.
-
- * include/freetype/freetype.h (FT_FaceRec): Mention that fields may
- be changed after file attachment.
-
-2006-01-28 Werner Lemberg <wl@gnu.org>
-
- * src/*/module.mk (.PHONY): Add.
-
-2006-01-27 Werner Lemberg <wl@gnu.org>
-
- * README, docs/FTL.TXT: Fix email address for bug reports.
- Other minor formatting.
-
- * devel/ftoption.h: Synchronize with
- include/freetype/config/ftoption.h.
-
- * src/autofit/module.mk (add_autofit_module), src/bdf/module.mk
- (add_bdf_module), src/type42/module.mk (add_type42_driver): Fix
- whitespace.
-
- * src/smooth/module.mk (add_smooth_renderer): Add lcd and lcdv
- renderer classes.
-
-2006-01-27 David Turner <david@freetype.org>
-
- * builds/unix/configure.ac: Fix build problem on Cygwin.
-
- * builds/unix/install.mk (install): Don't install the internal
- headers, and remove existing ones if found in the target install
- directory.
-
- * src/autofit/afwarp.c: Add simple #ifdef to prevent compilation
- if the warp hinter isn't active (it shouldn't, still experimental).
-
- * Jamfile, include/freetype/config/ftmodule.h: Remove `gxvalid'
- and `otvalid' from the list of modules that are linked statically
- to a given FreeType library. Functionality has been moved to the
- `ftvalid' CVS module.
-
- Note also that current Make-based build system still compiles the
- modules though.
-
- * include/freetype/config/ftoption.h (FT_STRICT_ALIASING): New macro
- which controls the definitions of the memory management functions to
- avoid warnings with recent versions of GCC. This macro is only here
- to be disabled, in case we detect problems with the new scheme.
-
- NOTE: Disable macro to use the memory debugger -- this will be fixed
- later!
-
- * include/freetype/internal/ftmemory.h, src/base/ftutil.c (FT_Alloc,
- FT_QAlloc, FT_Realloc, FT_QRealloc, FT_Free) [FT_STRICT_ALIASING]:
- New versions.
-
-
- * builds/win32/visualc/freetype.dsp: Updating project file to
- define FT2_BUILD_LIBRARY, and remove gxvalid + otvalid modules from
- compilation.
-
-
- * builds/freetype.mk (FT_CFLAGS), Jamfile (DEFINES): Define the
- macro FT2_BUILD_LIBRARY when compiling the library.
-
- * include/freetype/config/ftheader.h: Remove inclusions of internal
- headers except if the macro FT2_BUILD_LIBRARY is defined.
-
-
- * include/freetype/internal/psaux.h (AFM_KernPair, AFM_TrackKern,
- AFM_FontInfo): Move structure declarations to...
- * include/freetype/internal/t1types.h: This file.
-
-
- * (many files): Fix compiler warnings.
- Various minor reorganizations.
-
-
- * src/cff/cffload.c (cff_font_done): Don't free static array
- `subfonts'.
-
- * src/otvalid/otvcommn.c (otv_ClassDef_validate),
- src/otvalid/otvgpos.c (otv_x_sxy): Fix debugging information.
-
-
- Get rid of writable static variables (i.e., the string table) in
- afmparse, and fix compilation in FT2_MULTI mode.
-
- * src/psaux/afmparse.c: Include ft2build.h and FT_FREETYPE_H.
- (AFM_MAX_ARGUMENTS): Define...
- * src/psaux/afmparse.h: Here.
- * src/psaux/Jamfile (_sources): Add afmparse.
-
- * src/psaux/psconv.c: Include psconv.h.
-
- * src/type1/t1afm.c: Don't include FT_INTERNAL_TYPE1_TYPES_H but
- FT_INTERNAL_POSTSCRIPT_AUX_H.
- * src/type1/t1afm.h: Include FT_INTERNAL_TYPE1_TYPES_H.
-
-2006-01-23 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/freetype.h (FT_Select_Size): Rename the second
- argument from `idx' to `strike_index'.
- (FT_Size_Request_Type): Add FT_SIZE_REQUEST_TYPE_MAX to the end of
- this enum.
-
- * include/freetype/internal/ftobjs.h (FT_REQUEST_WIDTH,
- FT_REQUEST_HEIGHT): New macros to get the width and height of a
- request, in fractional pixels.
-
- * include/freetype/internal/ftobjs.h (FT_Select_Metrics,
- FT_Request_Metrics), src/base/ftobjs.c (FT_Select_Metrics,
- FT_Request_Metrics): New base functions to set the font metrics. They
- were part of FT_Select_Size/FT_Request_Size and are made independent
- functions so that metrics are not set again and again.
-
- * src/base/ftobjs.c (FT_Select_Size, FT_Request_Size): Metrics are set
- only when driver's size_select/size_request is NULL. That is, drivers
- should set the metrics themselves.
- (FT_Match_Size): Round before matching. This was what we did and it
- does cause some problems without rounding.
-
- * src/cff/cffobjs.c (cff_size_select), src/truetype/ttdriver.c
- (tt_size_select): Set the font metrics.
- s/index/strike_index/.
- The scaled metrics are always preferred over strikes' metrics, even
- when some strike is selected. This is done because the strikes'
- metrics are not reliable, e.g., the sign of the descender is wrong for
- some fonts.
-
- * src/cff/cffobjs.c (cff_size_request), src/truetype/ttdriver.c
- (tt_size_request): Set the font metrics.
- Call cff_size_select/tt_size_select when some strike is matched.
-
- * src/bdf/bdfdrivr.c, src/cff/cffobjs.c, src/cid/cidobjs.c,
- src/pcf/pcfdrivr.c, src/truetype/ttdriver.c, src/type1/t1objs.c,
- src/type1/t1objs.h, src/type42/t42objs.c, src/winfonts/winfnt.c:
- Set the font metrics.
- s/index/strike_index/.
-
- * src/tools/test_afm.c, src/psaux/psconv.c: Older versions of these
- files were committed. Just a catch-up.
- (PS_Conv_ToFixed): Remove the `goto'.
- (PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Speed up a little.
-
- * src/sfnt/ttsbit.c (tt_face_load_sbit_strikes,
- tt_face_load_strike_metrics), src/sfnt/ttsbit0.c
- (tt_face_load_sbit_strikes, tt_face_load_strike_metrics): The
- advertised metrics in `available_sizes' are different from those
- actually used.
-
-2006-01-23 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/psaux/psaux.c src/psaux/psauxmod.c src/type1/t1driver.c: Make
- AFM parser optional, controlled by `T1_CONFIG_OPTION_NO_AFM'.
-
-2006-01-22 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
- `texinfo' CVS module at savannah.gnu.org.
-
-2006-01-21 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/rules.mk (AUTOF_DRV_SRC): Add afwarp.c.
-
- * src/autofit/afloader.c (af_loader_load_g): Move AF_USE_WARPER up
- to avoid compiler warnings.
-
- * src/autofit/afwarp.c (af_warper_compute_line_best): Remove
- shadowing variable declarations.
- Fix warning parameters and replace printf with AF_LOG.
- (af_warper_compute): Remove unused variable.
-
-2006-01-20 David Turner <david@freetype.org>
-
- Adding experimental implementation of `warp hinting' (new hinting
- algorithm for gray-level and LCD rendering). It is disabled by
- default, you need to #define AF_USE_WARPER in aftypes.h.
-
- * src/autofit/afhints.c (af_glyph_hints_scale_dim) [AF_USE_WARPER]:
- New function.
- * src/autofit/afhints.h: Updated.
-
- * src/autofit/aflatin.c [AF_USE_WARPER]: Include afwarp.h.
- (af_latin_hints_init) [AF_USE_WARPER]: Reset mode to
- FT_RENDER_MODE_NORMAL if an LCD mode is selected.
- (af_latin_hints_apply) [AF_USE_WARPER]: Call af_warper_compute
- appropriately.
-
- * src/autofit/afloader.c (af_loader_load_g) [!AF_USER_WARPER]:
- Isolate code for adjusting metrics.
-
- * src/autofit/aftypes.h (AF_USE_WARPER): New macro (commented out by
- default).
-
- * src/autofit/afwarp.c, src/autofit/afwarp.h: New files.
-
- * src/autofit/autofit.c [AF_USE_WARPER]: Include afwarp.c.
-
- * src/autofit/Jamfile (_sources): Add afwarp.
-
-2006-01-19 David Turner <david@freetype.org>
-
- * src/sfnt/ttsbit0.c (tt_face_load_strike_metrics): Fix small bug
- that prevented compilation when FT_OPTIMIZE_MEMORY is defined.
-
-2006-01-19 Brian Weed <bw@imaginengine.com>
-
- * builds/win32/visualc/freetype.dsp: Updated.
-
-2006-01-17 Werner Lemberg <wl@gnu.org>
-
- Use pscmap service in CFF module.
-
- * src/cff/cffcmap.c (cff_cmap_uni_pair_compare): Removed.
- (cff_sid_to_glyph_name): New function.
- (cff_cmap_unicode_init, cff_cmap_unicode_done,
- cff_cmap_unicode_char_index, cff_cmap_unicode_char next): Use pscmap
- service.
- (cff_cmap_unicode_class_rec): Updated.
- * src/cff/cffcmap.h (CFF_CMapUnicode, CFF_CMap_UniPair): Removed.
-
-
- * src/psnames/psmodule.c (ps_unicodes_char_next): Fix `unicode'
- return value.
-
-
- * src/psaux/afmparse.c (afm_parser_read_vals): Use double casting
- to avoid compiler warnings regarding type-punning.
-
-2006-01-16 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/psaux/afmparse.c, src/psaux/afmparse.h: New files which
- implement an AFM parser.
-
- * src/psaux/psconv.c, src/psaux/psconv.h: New files to provide
- conversion functions (e.g., PS real number => FT_Fixed) for the
- PS_Parser and AFM_Parser. Some of the functions are taken, with
- some modifications, from the file psobjs.c.
-
- * src/psaux/psobjs.c: Use functions from psconv.c.
-
- * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Add
- `AFM_Parser' to the `psaux' service.
-
- * src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Include
- those new files.
-
- * src/tools/test_afm.c: A test program for AFM parser.
-
- * include/freetype/internal/services/svkern.h: New file providing a
- `Kerning' service. It is currently only used to get the track
- kerning information.
-
- * include/freetype/internal/ftserv.h (FT_SERVICE_KERNING_H): New
- macro.
-
- * src/type1/t1driver.c, src/type1/t1objs.c, src/type1/t1afm.c,
- src/type1/t1afm.h: Update to use the AFM parser.
- Provide the `Kerning' service.
-
- * include/freetype/freetype.h, src/base/ftobjs.c: New API
- `FT_Get_Track_Kerning'.
-
-2006-01-15 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/internal/ftobjs.h, src/base/ftobjs.c,
- src/bdf/bdfdrivr.c, src/cff/cffgload.c, src/cid/cidgload.c,
- src/pcf/pcfdrivr.c, src/type1/t1gload.c, src/winfonts/winfnt.c:
- s/ft_fake_vertical_metrics/ft_synthesize_vertical_metrics/.
-
- * docs/CHANGES: Mention that vertical metrics are synthesized for
- fonts not having this info.
-
-2006-01-15 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/internal/ftobjs.h (ft_fake_vertical_metrics),
- src/base/ftobjs.c (ft_fake_vertical_metrics): New function to fake
- vertical metrics.
-
- * src/cff/cffgload.c, src/cid/cidgload.c, src/pcf/pcfdrivr.c,
- src/type1/t1gload.c, src/winfonts/winfnt.c: Fake vertical metrics,
- which are monotone.
-
- * src/truetype/ttgload.c (compute_glyph_metrics): Some fixes and
- formattings in vertical metrics faking. There is still room for
- improvements (and so does the CFF module).
-
-2006-01-15 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/pcf/pcfdrivr.c
- (PCF_Glyph_Load), src/winfonts/winfnt.c (FNT_Load_Glyph): Don't set
- the linear advance fields as they are only used by the outline
- glyphs.
-
- * include/freetype/freetype.h: Documentation updates and
- clarifications.
- The meaning of FT_LOAD_FORCE_AUTOHINT is changed so that no real
- change need be made to the code.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Resolve flag dependencies and
- decide whether to use the auto-hinter according to documentation.
- There should to be no real difference.
- Some checks (e.g., is text height positive?) after the glyph is
- loaded.
- (FT_Select_Size, FT_Request_Size): Scales are set to wrong values.
- Be careful that scales won't be negative.
-
-2006-01-14 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * docs/CHANGES: Mention the size selection change.
-
- * src/bdf/bdfdrivr.c (BDF_Size_Request, BDF_Size_Select),
- src/pcf/pcfdrivr.c (PCF_Size_Request, PCF_Size_Select),
- src/winfonts/winfnt.c (FNT_Size_Request, FNT_Size_Select): Do size
- matching for requests of type NOMINAL and REAL_DIM.
-
- * src/winfonts/winfnt.c (FNT_Face_Init): Print trace message when
- `pixel_height' is used for nominal height.
-
- * src/base/ftobjs.c (FT_Request_Size): Call `FT_Match_Size' if the
- face is bitmap only and driver doesn't provide `request_size'. This
- is added merely for completion as no driver satisfies the conditions.
-
-2006-01-13 Chia-I Wu <b90201047@ntu.edu.tw>
-
- Introduce new size selection interface.
-
- * include/freetype/internal/ftdriver.h (struct FT_Driver_ClassRec):
- Replace `set_char_sizes' and `set_pixel_sizes' by `request_size' and
- `select_size'.
-
- * include/freetype/freetype.h (FT_Select_Size, FT_Size_Request_Type,
- FT_Size_Request, FT_Request_Size, FT_Select_Size), src/base/ftobjs.c
- (FT_Select_Size, FT_Request_Size): API additions to export the new
- size selection interface.
-
- * src/base/ftobjs.c (FT_Set_Char_Size, FT_Set_Pixel_Sizes): Use
- `FT_Request_Size'.
-
- * include/freetype/internal/ftobjs.h (FT_Match_Size),
- src/base/ftobjs.c (FT_Match_Size): New function to match a size
- request against `available_sizes'. Drivers supporting bitmap strikes
- can use this function to implement `request_size'.
-
- * src/bdf/bdfdrivr.c, src/cid/cidobjs.c, src/cid/cidobjs.h,
- src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/type1/t1driver.c,
- src/type1/t1objs.c, src/type1/t1objs.h, src/type42/t42drivr.c,
- src/type42/t42objs.c, src/type42/t42objs.h, src/winfonts/winfnt.c:
- Update to new size selection interface.
-
- * src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffobjs.c,
- src/cff/cffobjs.h, src/truetype/ttdriver.c, src/truetype/ttgload.c,
- src/truetype/ttobjs.c, src/truetype/ttobjs.h: Update to new size
- selection interface.
- Make `strike_index' FT_ULong and always defined.
- Use `load_strike_metrics' provided by SFNT interface.
-
-2006-01-13 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/internal/sfnt.h (SFNT_Interface): New method
- `load_strike_metrics' used to load the strike's metrics.
-
- * src/sfnt/sfdriver.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
- src/sfnt/ttsbit0.c: New function `tt_face_load_strike_metrics'.
-
- * src/pfr/pfrobjs.c (pfr_face_init): Set FT_Bitmap_Size correctly.
-
- * src/winfonts/winfnt.c (FNT_Face_Init): Use `nominal_point_size' for
- nominal size unless it is obviously incorrect.
-
- * include/freetype/freetype.h (FT_Bitmap_Size): Update the comments on
- FNT driver.
-
-2006-01-12 Werner Lemberg <wl@gnu.org>
-
- Prepare use of pscmap service within CFF module.
-
- * include/freetype/internal/services/svpscmap.h: Include
- FT_INTERNAL_OBJECTS_H.
- (PS_Unicode_Index_Func): Removed. Unused.
- (PS_Macintosh_Name_Func): Renamed to...
- (PS_Macintosh_NameFunc): This.
- Update all callers.
- (PS_Adobe_Std_Strings_Func): Renamed to...
- (PS_Adobe_Std_StringsFunc): This.
- Update all callers.
- (PS_UnicodesRec): This is the former `PS_Unicodes' structure.
- Add `cmap' member.
- Update all callers.
- (PS_Unicodes): This is now a typedef'd pointer to PS_UnicodesRec.
- Update all callers.
- (PS_Glyph_NameFunc): New typedef.
- (PS_Unicodes_InitFunc): Change arguments to expect a function
- and generic data pointer which returns a glyph name from a given
- index.
-
- * src/psnames/psmodule.c (ps_unicodes_init, ps_unicodes_char_index,
- ps_unicodes_char_next, pscmaps_interface): Updated.
-
- * include/freetype/internal/t1types.h (T1_FaceRec): Updated.
-
- * src/psaux/t1cmap.h (T1_CMapStdRec): Updated.
- (T1_CMapUnicode, T1_CMapUnicodeRec): Removed.
-
- * src/psaux/t1cmap.c (t1_get_glyph_name): New callback function.
- (t1_cmap_unicode_init, t1_cmap_unicode_done,
- t1_cmap_unicode_char_index, t1_cmap_unicode_char_next,
- t1_cmap_unicode_class_rec): Updated.
-
- * src/type42/t42types.h (T42_FaceRec): Updated.
-
-2006-01-11 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * include/freetype/ftmac.h: Add declaration of new functions
- FT_New_Face_From_FSRef and FT_GetFile_From_Mac_ATS_Name that
- were introduced by the jumbo patch on 2006-01-11.
-
-2006-01-11 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #15056 and use pscmap service in psaux module.
-
- * include/freetype/internal/services/svpscmap.h (PS_UniMap): Use
- FT_UInt32 for `glyph_index'.
- (PS_Unicodes_InitFunc): Use FT_String for `glyph_names'.
- (PS_Unicodes_CharIndexFunc): Use FT_UInt32 for `unicode'.
- (PS_Unicodes_CharNextFunc): Make second argument a pointer to
- FT_UInt32.
-
- * src/psnames/psmodule.c (VARIANT_BIT, BASE_GLYPH): New macros.
- (ps_unicode_value): Set VARIANT_BIT in return value if glyph is a
- variant glyph (this is, it has non-leading `.' in its name).
- (compare_uni_maps): Sort base glyphs before variant glyphs.
- (ps_unicodes_init): Use FT_String for `glyph_names' argument.
- Reallocate only if number of used entries is much smaller.
- Updated to handle variant glyphs.
- (ps_unicodes_char_index, ps_unicodes_char_next): Prefer base glyphs
- over variant glyphs.
- Simplify code.
-
- * src/psaux/t1cmap.c (t1_cmap_uni_pair_compare): Removed.
- (t1_cmap_unicode_init, t1_cmap_unicode_char_index,
- t1_cmap_unicode_char_next): Use pscmap service.
- (t1_cmap_unicode_done): Updated.
-
- * src/psaux/t1cmap.h (T1_CMapUniPair): Removed.
- (T1_CMapUnicode): Use PS_Unicodes structure.
-
-2006-01-11 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Jumbo patch to fix `deprecated' warning of cross-build for Tiger on
- Intel, as reported by Sean McBride <sean@rogue-research.com> on
- 2005-08-24.
-
- * src/base/ftmac.c: Heavy change to build without deprecated Carbon
- functions on Tiger.
-
- * builds/unix/configure.ac: Add options and autochecks for Carbon
- functions availabilities, for MacOS X.
-
- * builds/mac/ascii2mpw.py: Add converter for character `\305'.
- * builds/mac/FreeType.m68k_{far|cfm}.make.txt: Add conditional
- macros to avoid unavailable functions.
- ftmac.c must be compiled without `-strict ansi', because it disables
- cpp macro to use ToolBox system call.
-
- * builds/mac/FreeType.ppc_{classic|carbon}.make.txt: Add conditional
- macros to avoid unavailable functions.
-
- * builds/mac/README: Detailed notes on function availabilities.
-
- * docs/CHANGES: Notes about (possible) incompatibilities.
-
-2006-01-08 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2006-01-08 Huw D M Davies <h.davies1@physics.ox.ac.uk>
-
- * include/freetype/ftmodapi.h (FT_Module_Get_Flags): New
- declaration.
-
- * src/base/ftobjs.c (FT_Module_Get_Flags): New function.
-
-2006-01-07 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfread.c (pcf_get_bitmaps): Remove unused variable
- `bitmaps'. Reported by Yu Lei <yulei0@gmail.com>.
-
- * src/base/ftutil.c (ft_highpow2): s/FT_BASE/FT_BASE_DEF/.
- Reported by Niels Boldt <nielsboldt@gmail.com>.
-
-2005-12-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/sfnt/sfnt/ttbdf.c: Add newline '\n' to the end of file, for
- MPW compiler.
-
-2005-12-23 David Turner <david@freetype.org>
-
- * Jamfile (RefDoc), docs/reference/README: Fix it so that `jam
- refdoc' works correctly to generate the API reference in
- `docs/reference'.
-
- * src/tools/docmaker/tohtml.py (print_html_field,
- print_html_field_list): Update to output nicer fields lists in the
- API reference.
-
- * src/base/ftobjs.c (FT_Load_Glyph): FT_LOAD_TARGET_LIGHT now
- forces auto-hinting.
-
- * freetype/freetype.h: Updating the documentation for
- FT_LOAD_TARGET_XXX and FT_Render_Mode values.
-
-2005-12-23 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c (FT_New_Face_From_Suitcase): Count scalable faces
- in supported formats (sfnt, LWFN) only, and ignore bitmap faces in
- unsupported formats (fbit, NFNT). The number of available faces are
- passed via face->num_faces. If bitmap faces are embedded in sfnt
- resource, face->num_fixed_size is correctly set. In public API,
- FT_New_Face() and FT_New_Face_From_FSSpec() count the faces as
- FT_GetFile_From_Mac_Name(), which ignores NFNT resources.
-
- * doc/CHANGES: Mention the changes.
-
-2005-12-17 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/truetype/ttinterp.c (Update_Max): Set current size of buffer
- correctly (so that memory debug system won't panic).
-
-2005-12-16 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/internal/ftobjs.h (ft_glyphslot_grid_fit_metrics),
- src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Removed.
-
- * src/base/ftobjs.c (ft_recompute_scaled_metrics): Do not round.
-
- * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
- (cid_slot_load_glyph), src/truetype/ttgload.c (compute_glyph_metrics),
- src/type1/t1gload.c (T1_Load_Glyph): Do not round glyph metrics.
-
- * doc/CHANGES: Mention the changes.
-
-2005-12-13 David Turner <david@freetype.org>
-
- Change the implementation of the LIGHT hinting mode to completely
- disable horizontal hinting. This is an experimental effort to
- integrate David Chester's latest patch without affecting the other
- hinting modes as well.
-
- Note that this doesn't force auto-hinting for all fonts, however.
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Don't set
- scaler_flags here but...
- (af_glyph_hints_rescale): Here.
-
- * src/autofit/aflatin.c (af_latin_hints_init): Disable horizontal
- hinting for `light' hinting mode.
-
-
- * Jamfile: Small fix to ensure that ftexport.sym is placed into the
- same location as other generated objects (i.e., within the `objs'
- directory of the current directory).
-
-
- Add support for an embedded `BDF ' table within SFNT-based bitmap
- font files. This is used to store atoms & properties from the
- original BDF fonts that were used to generate the font file.
-
- The feature is controlled by TT_CONFIG_OPTION_BDF within
- `ftoption.h' and is used to implement FT_Get_BDF_Property for these
- font files.
-
- At the moment, this is still experimental, the BDF table format
- isn't cast into stone yet.
-
- * include/freetype/config/ftoption.h (TT_CONFIG_OPTION_BDF): New
- macro.
-
- * include/freetype/config/ftstdlib.h (ft_memchr): New macro.
-
- * include/freetype/internal/tttypes.h (TT_BDFRec, TT_BDF)
- [TT_CONFIG_OPTION_BDF]: New structure.
- (TT_FaceRec) [TT_CONFIG_OPTION_BDF]: New member `bdf'.
-
- * include/freetype/tttags.h (TTAG_BDF): New macro.
-
- * src/sfnt/Jamfile (_sources): Add ttbdf.
-
- * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttbdf.c.
-
- * src/sfnt/sfdriver.c [TT_CONFIG_OPTION_BDF]: Include ttbdf.h and
- FT_SERVICE_BDF_H.
- (sfnt_get_charset_it) [TT_CONFIG_OPTION_BDF]: New function.
- (sfnt_service_bdf) [TT_CONFIG_OPTION_BDF]: New service.
- (sfnt_services) [TT_CONFIG_OPTION_BDF]: Add sfnt_service_bdf.
-
- * src/sfnt/sfnt.c [TT_CONFIG_OPTION_BDF]: Include ttbdf.c.
-
- * src/sfnt/sfobjs.c [TT_CONFIG_OPTION_BDF]: Include ttbdf.h.
- (sfnt_done_face) [TT_CONFIG_OPTION_BDF]: Call
- tt_face_free_bdf_props.
-
- * src/sfnt/ttbdf.h, src/sfnt/ttbdf.c: New files.
-
-2005-12-07 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Move tag check to...
- * src/sfnt/ttload.c (sfnt_init): Here, before handling TTCs.
-
-2005-12-06 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/truetype/ttobjs.c (tt_size_init): size->ttmetrics.valid is
- initialized twice.
- size->strike_index is not initialized.
-
-2005-12-02 Taek Kwan(TK) Lee <taeklee@gmail.com>
-
- * src/type42/t42objs.c (T42_Face_Init): Replace call to
- FT_New_Memory_Face with call to FT_Open_Face to pass `params'.
-
-2005-11-30 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Document ftdump's `-v' option.
- Document latest charmap code changes.
-
- * src/sfnt/ttcmap.c, src/sfnt/ttcmap.h:
- s/TT_CMAP_FLAG_OVERLAPPED/TT_CMAP_FLAG_OVERLAPPING/.
-
-2005-11-30 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary,
- tt_cmap12_char_map_binary): Fix compiler warnings.
-
-2005-11-29 Chia-I Wu <b90201047@ntu.edu.tw>
-
- Major update to distinguish between unsorted and overlapping
- segments for cmap format 4. For overlapping but sorted segments,
- which is previously considered unsorted, we still use binary search.
-
- * src/sfnt/ttcmap.h (TT_CMapRec_): Replace `unsorted' by `flags'.
- (TT_CMAP_FLAG_UNSORTED, TT_CMAP_FLAG_OVERLAPPED): New macros.
-
- * src/sfnt/ttcmap.c (OPT_CMAP4): Removed as it is always defined.
- (TT_CMap4Rec_): Remove `old_charcode' and `table_length'.
- (tt_cmap4_reset): Removed.
- (tt_cmap4_init): Updated accordingly.
- (tt_cmap4_next): Updated accordingly.
- Take care of overlapping segments.
- (tt_cmap4_validate): Make sure the subtable is large enough.
- Do not check glyph_ids because some fonts set the length wrongly.
- Also, if all segments have offset 0, glyph_ids is always invalid.
- It does not cause any problem so far only because the check misses
- equality.
- Distinguish between unsorted and overlapping segments.
- (tt_cmap4_char_map_linear, tt_cmap4_char_map_binary): New functions
- to do `charcode => glyph index' by linear/binary search.
- (tt_cmap4_char_index, tt_cmap4_char_next): Use
- tt_cmap4_char_map_linear and tt_cmap4_char_map_binary.
- (tt_face_build_cmaps): Treat the return value of validator as flags
- for cmap.
-
-2005-11-29 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/sfnt/ttcmap.c (TT_CMap12Rec_, tt_cmap12_init, tt_cmap12_next):
- New structures and functions for fast `next char'.
- (tt_cmap12_char_map_binary): New function to do `charcode => glyph
- index' by binary search.
- (tt_cmap12_char_index, tt_cmap12_char_next): Use
- tt_cmap12_char_map_binary.
- (tt_face_build_cmaps): Check table and offset correctly (equality is
- missing).
-
-2005-11-15 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/smakefile: Adjusted the compiler options
- to the current sources, now really builds the gxvalid, gzip
- and psnames modules.
-
- * builds/amiga/src/base/ftsystem.c: The assumed Seek() position
- in the file cache was off by one byte which could cause false
- errors in font files.
-
-2005-11-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/mac/FreeType.m68k_far.make.txt,
- builds/mac/FreeType.m68k_cfm.make.txt,
- builds/mac/FreeType.ppc_classic.make.txt,
- builds/mac/FreeType.ppc_carbon.make.txt:
- Updated for MPW to build all available modules.
-
-2005-11-21 Håvard Wall <haavardw@ifi.uio.no>
-
- * src/bdf/bdfdrivr.c (bdf_interpret_style, BDF_Face_Done): Fix small
- memory leak.
-
-2005-11-21 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (sfnt_init): Add tracing message.
-
-2005-11-21 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Image_offset was
- added twice to image_start if image_format was 2 or 5.
-
-2005-11-21 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Check that format_tag is known
- before loading the table directory.
-
- * src/sfnt/ttload.c (tt_face_load_sfnt_header,
- tt_face_load_directory): Delay sfnt_dir_check from
- tt_face_load_sfnt_header to tt_face_load_directory.
-
-2005-11-20 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/sfnt/ttload.c (sfnt_dir_check): Clean up and return correct
- error code.
- (sfnt_init): New function to fill in face->ttc_header. A non-TTC font
- is synthesized into a TTC font with one offset table.
- (tt_face_load_sfnt_header): Use sfnt_init.
- Fix an invalid access if the font is TTC and face_index is -1.
-
-2005-11-18 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (tt_face_load_metrics): Ignore excess number
- of metrics instead of aborting. Patch suggested by Derek Noonburg.
-
- * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
- (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Scale
- the glyph properly if no hinter is available.
-
- * docs/CHANGES: Mention scaling bug.
-
-2005-11-18 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * include/freetype/ftgxval.h, src/base/ftgxval.c
- (FT_TrueTypeGX_Free, FT_ClassicKern_Free): New functions to free
- buffers allocated by gxvalid module.
- * include/freetype/ftotval.h, src/base/ftotval.c
- (FT_OpenType_Free): New function to free buffer allocated by
- otvalid module.
-
-2005-11-18 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * builds/unix/ftsystem.c (FT_Stream_Open, FT_New_Memory,
- FT_Done_Memory), builds/vms/ftsystem.c (FT_Stream_Open, FT_New_Memory,
- FT_Done_Memory), builds/win32/ftdebug.c (FT_Message, FT_Panic):
- s/FT_EXPORT/FT_BASE/.
-
-2005-11-17 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/src/base/ftdebug.c (FT_Trace_Get_Count,
- FT_Trace_Get_Name, FT_Message, FT_Panic),
- builds/amiga/src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory,
- FT_Stream_Open): s/FT_EXPORT/FT_BASE/.
-
-2005-11-17 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/makefile, builds/amiga/makefile.os4,
- builds/amiga/smakefile,
- builds/amiga/include/freetype/config/ftmodule.h: Updated the Amiga
- build files (added support for the gxvalid module).
-
-2005-11-17 Werner Lemberg <wl@gnu.org>
-
- Add vertical metrics support to OpenType CFF outlines. Based on a
- patch from Mike Moening <MikeM@RetekSolutions.com>.
-
- * src/cff/cffgload.c (cff_face_get_vertical_metrics): New function.
- (cff_slot_load): Use cff_face_get_vertical_metrics.
-
- * docs/CHANGES: Updated.
-
-2005-11-17 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftcalc.c (FT_MulTo64): Commented out.
-
- * include/freetype/internal/ftcalc.h (FT_SqrtFixed),
- src/base/ftcalc.c (FT_SqrtFixed),
- include/freetype/internal/ftdebug.h (FT_Trace_Get_Count,
- FT_Trace_Get_Name, FT_Message, FT_Panic), src/base/ftdebug.c
- (FT_Trace_Get_Count, FT_Trace_Get_Name, FT_Message, FT_Panic),
- include/freetype/internal/ftobjs.h (FT_New_Memory, FT_Done_Memory),
- include/freetype/internal/ftstream.h (FT_Stream_Open),
- src/base/ftsystem.c (FT_New_Memory, FT_Done_Memory, FT_Stream_Open):
- s/FT_EXPORT/FT_BASE/.
-
- * builds/exports.mk: Manually add TT_New_Context to EXPORTS_LIST
- too.
-
-2005-11-15 David Turner <david@freetype.org>
-
- * src/base/fttrigon.c (ft_trig_prenorm): Fix a bug that created
- invalid computations, resulting in very weird bugs in TrueType
- bytecode hinted fonts.
-
- * src/truetype/ttinterp.c (FT_UNUSED_EXEC): Don't perform a
- structure copy each time.
-
-2005-11-11 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftccache.c (FTC_Cache_Clear), src/cache/ftcmanag.c
- (FTC_Manager_Check): Remove FT_EXPORT_DEF tag.
-
- * src/base/ftcalc.c (FT_Add64): Remove FT_EXPORT_DEF tag.
- (FT_Div64by32, FT_Sqrt32): Commented out. Unused.
-
- * include/freetype/internal/ftcalc.h (SQRT_32): Removed. Unused.
- (FT_Sqrt32): Commented out. Unused.
-
- * include/freetype/cache/ftccache.h:
- s/ftc_node_destroy/FTC_Node_Destroy/.
-
- * src/cache/ftccback.h (ftc_node_destroy): New declaration.
-
- * src/cache/ftccache.c (ftc_node_destroy): Use FT_LOCAL_DEF tag.
- (FTC_Node_Destroy): New exported wrapper function for
- ftc_node_destroy.
-
- * src/cache/ftcmanag.c: Include ftccback.c.
-
-2005-11-10 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afangles.c, src/autofit/aftypes.h (af_angle_diff):
- Comment out. Unused.
-
- * builds/exports.mk ($(EXPORTS_LIST)): Add TT_RunIns.
-
-2005-11-10 Christian Biesinger <cbiesinger@web.de>
-
- * builds/beos/beos.mk: Call beos-def.mk before anything else to
- define the separator.
-
- * builds/unix/unix-cc.in (LINK_LIBRARY): Add `-no-undefined' flag.
-
-2005-11-07 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1afm.c (T1_Read_PFM): Zero offset means `no kerning
- table available'. From Sergey Tolstov <stolstov@esri.com>.
-
-2005-11-03 Ville Syrjälä <syrjala@sci.fi>
-
- * src/base/ftobjs.c (FT_Open_Face): Avoid possible memory leak.
-
-2005-11-02 Werner Lemberg <wl@gnu.org>
-
- Make compiling instructions in docs/CUSTOMIZE work again.
-
- * builds/unix/unix-cc.in (CPPFLAGS): New variable.
- (CFLAGS): Don't include @CPPFLAGS@.
- * builds/freetype.mk (FT_CFLAGS): Add CPPFLAGS.
-
-2005-10-28 David Turner <david@freetype.org>
-
- Update build system to support the generation of a list of exported
- symbols or Windows .DEF files by parsing the public headers with the
- `apinames' tool located in src/tools/apinames.c.
-
- Only tested on Unix at the moment. On Windows, the .DEF file is
- generated but isn't used yet to generate a DLL.
-
- * builds/exports.mk: New file.
-
- * builds/freetype.mk: Include exports.mk.
- (dll): New target.
- (clean_project_dos): Fix rule.
-
- * builds/compiler/visualc.mk (TE), builds/dos/dos-def.mk (E),
- builds/os2/os2-def.mk (E), builds/win32/win32-def.mk (E): New
- variables for controlling executable extensions.
-
- * builds/unix/unix-cc.in (EXPORTS_LIST, CCexe),
- builds/win32/w32-bcc.mk, builds/win32/w32-gcc.mk,
- builds/win32/w32-icc.mk, builds/win32/w32-icc.mk,
- builds/win32/w32-mingw32.mk, builds/win32/w32-vcc,
- builds/win32/w32-wat.mk (EXPORTS_LIST, EXPORT_OPTIONS,
- APINAMES_OPTIONS): New targets for controlling the `apinames' tool.
-
- * Jamfile (GenExportSymbols): Updated.
-
-
- * src/pfr/pfrtypes.h, src/pfr/pfrload.c, src/pfr/pfrobjs.c
- [!FT_OPTIMIZE_MEMORY]: Fold memory optimization code into
- FT_OPTIMIZE_MEMORY chunks for better maintainability and simplicity.
-
-
- * src/base/fttrigon.c (ft_trig_prenorm), src/base/ftcalc.c
- (FT_MulFix): Performance optimizations.
-
-
- * include/freetype/internal/ftgloadr.h (FT_GLYPHLOADER_CHECK_P,
- FT_GLYPHLOADER_CHECK_C, FT_GLYPHLOADER_CHECK_POINTS): New macros for
- checking points and contours. Update callers to use
- FT_GLYPHLOADER_CHECK_POINTS instead of FT_GlyphLoader_CheckPoints
- at profile-detected hot-spots.
-
- * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Set `adjust'
- to 0 to not call `AdjustPoints' every time.
-
-
- * src/autofit/aftypes.h (AF_ANGLE_DIFF): New macro to inline
- FT_Angle_Diff.
-
- * src/autofit/afhints.c (af_direction_compute): Re-implement.
- (af_glyph_hints_compute_inflections, af_glyph_hints_reload): Use
- AF_ANGLE_DIFF to speed up the detection of inflexions.
-
-
- * src/tools/apinames.c: Include <string.h>.
- (OutputFormat): New enumeration.
- (names_dump): Add two parameters to control output format and DLL
- name.
- (names_dump_windef): Removed. Code folded into `names_dump'.
- (read_header_file): Use isalnum, not isalpha. Otherwise function
- names with digits aren't read correctly.
- (usage): Updated.
- (main): New option `-o' to control output file name.
- New option `-d' to indicate DLL file name.
- Extend `-w' flag to handle Borland and Watcom compilers and linkers.
-
-2005-10-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/mac/ftlib.prj, builds/mac/freetype.mak: Removed.
- ftlib.prj is unmaintained and incompatible with current tree.
- freetype.mak is unrecoverably broken.
-
- * builds/mac/ftlib.prj.xml: Added.
- Generated by Metrowerks CodeWarrior 9.0.
-
- * builds/mac/FreeType.m68k_far.make.txt,
- builds/mac/FreeType.m68k_cfm.make.txt,
- builds/mac/FreeType.ppc_classic.make.txt,
- builds/mac/FreeType.ppc_carbon.make.txt: Added.
- Skeleton files of MPW makefiles.
-
- * builds/mac/ascii2mpw.py: Added.
- Python script to make MPW makefile from skeleton.
-
- * builds/mac/README: Updated.
- Almost rewritten to use new files.
-
-2005-10-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c: Fix invalid casts from NULL to integer typed
- variables. Advised by David Turner, Masatake YAMATO, Sean McBride,
- and George Williams.
-
-2005-10-27 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftsysmem.h, include/freetype/ftsysio.h: Removed.
- Obsolete.
-
-2005-10-25 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfdriver.c (sfnt_interface): Move out
- `tt_face_get_kerning' from a #ifdef clause. Reported by Tony J.
- Ibbs <tibs@sj.co.uk>.
-
-2005-10-23 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftdbgmem.c (ft_mem_debug_realloc): Make it compile with
- C++.
-
-2005-10-21 David Turner <david@freetype.org>
-
- * src/base/ftdbgmem.c (ft_mem_table_set, ft_mem_debug_realloc):
- Another realloc memory counting bug fix.
-
- * src/tools/Jamfile: Add missing file.
-
- * src/lzw/Jamfile: Fix incorrect source file reference.
-
-2005-10-20 David Turner <david@freetype.org>
-
- * src/base/ftdbgmem.c (ft_mem_table_set, ft_mem_table_remove,
- ft_mem_debug_alloc, ft_mem_debug_free, ft_mem_debug_realloc): Fixes
- to better account for memory reallocations.
-
- * src/lzw/ftlzw2.c, src/lzw/ftzopen.h, src/lzw/ftzopen.c,
- src/lzw/rules.mk: First version of LZW loader re-implementation.
- Apparently, this saves about 330 KB of heap memory when loading
- timR24.pcf.Z.
-
-2005-10-20 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/ftbitmap.h (FT_Bitmap_Copy, FT_Bitmap_Embolden),
- src/base/ftbdf.c (FT_Get_BDF_Property), src/cache/ftcmru.c
- (FTC_MruList_Reset, FTC_MruList_Done, FTC_MruList_Lookup): Fix
- FT_EXPORT/FT_EXPORT_DEF tagging.
-
-2005-10-19 Chia-I Wu <b90201047@ntu.edu.tw>
-
- * src/truetype/ttgload.c (TT_Load_Glyph): Allow size->ttmetrics to
- be invalid when FT_LOAD_NO_SCALE is set.
-
-2005-10-17 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c (FT_Open_Face): Don't call FT_New_GlyphSlot and
- FT_New_Size if we are opening a face with face_index < 0 (which is
- only used for testing the format).
-
- * src/gxvalid/gxvmort0.c (gxv_mort_subtable_type0_entry_validate):
- Remove compiler warning.
-
-2005-10-16 David Turner <david@freetype.org>
-
- * src/tools/apinames.c: Add new tool to extract public API function
- names from header files.
-
-2005-10-05 Werner Lemberg <wl@gnu.org>
-
- Add FT_FACE_FLAG_HINTER to indicate that a specific font driver has
- a hinting engine of its own.
-
- * include/freetype/freetype.h (FT_FACE_FLAG_HINTER): New macro.
-
- * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
- (cid_face_init), src/truetype/ttobjs.c (tt_face_init)
- [TT_CONFIG_OPTION_BYTECODE_INTERPRETER], src/type1/t1objs.c
- (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init)
- [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Update face flags.
-
- * docs/CHANGES: Document it.
-
-2005-09-27 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype2.m4: Add license exception so that the file
- can be used in any other autoconf script.
-
-2005-09-26 David Turner <david@freetype.org>
-
- * src/autofit/aflatin.c (af_latin_compute_stem_width): Fix bad
- computation of the `vertical' flag, causing ugly things in LCD mode
- and others.
-
-2005-09-23 David Turner <david@freetype.org>
-
- * src/autofit/aflatin.c (af_latin_hints_init): Fix a bug that
- prevented internal hint mode bitflags from being computed correctly.
-
- * src/base/Jamfile: Adding src/base/ftgxval.c.
-
- * src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
- src/gxvalid/gxvfeat.c, src/gxvalid/gxvjust.c, src/gxvalid/gxvkern.c,
- src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
- src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
- src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c,
- src/gxvalid/gxvmort5.c, src/gxvalid/gxvmorx.c,
- src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
- src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx5.c,
- src/gxvalid/gxvopbd.c, src/gxvalid/gxvprop.c,
- src/truetype/ttgload.c: Remove _many_ compiler warnings when
- compiling with Visual C++ at maximum level (/W4).
-
- * src/autofit/afangles.c (af_angle_atan): Replaced CORDIC-based
- implementation with one using lookup tables. This simple thing
- speeds up glyph loading by 18%, according to ftbench!
-
- * src/sfnt/sfdriver.c (sfnt_get_interface): Don't check for
- `get_sfnt' and `load_sfnt' module interfaces.
-
-2005-09-22 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Mention SING Glyphlet support.
-
-2005-09-22 David Turner <david@freetype.org>
-
- * src/base/Jamfile: Disable compilation of ftgxval module
- temporarily.
-
-2005-09-19 David Somers <dsomers@omz13.com>
-
- * src/sfnt/ttload.c (sfnt_dir_check): Modified to allow a
- font to have no `head' table if tables `SING' and `META' are
- present; this is to support `SING Glyphlet'.
-
- `SING Glyphlet' is an extension to OpenType developed by Adobe
- primarily to facilitate adding supplemental glyphs to an OpenType
- font (with emphasis on, but not necessarily limited to, gaiji to a
- CJK font). A SING Glyphlet Font is an OpenType font that contains
- the outline(s), either in a `glyf' or `CFF' table, for a glyph;
- `cmap', `BASE', and `GSUB' tables are present with the same format
- and functionality as a regular OpenType font; there are no `name',
- `head', `OS/2', and `post' tables; there are two new tables, `SING'
- which contains details about the glyphlet, and `META' which contains
- metadata.
-
- Further information on the SING Glyphlet format can be found at:
-
- https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5148.SING_Tutorial.pdf
-
- * include/freetype/tttags.h (TTAG_SING, TTAG_META): New macros for
- the OpenType tables `SING' and `META'. These two tables are used in
- SING Glyphlet Format fonts.
-
-2005-09-09 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Reactivate code to set
- FT_FACE_FLAG_KERNING which has been commented out erroneously.
-
- * docs/CHANGES: Document it.
-
-2005-09-05 Werner Lemberg <wl@gnu.org>
-
- Fixes for `make multi' and using C++ compiler.
-
- * src/gxvalid/gxvcommn.c (gxv_set_length_by_ushort_offset,
- gxv_set_length_by_ulong_offset, gxv_array_getlimits_byte,
- gxv_array_getlimits_ushort): Declare with FT_LOCAL_DEF.
- (gxv_compare_ranges): Make it static.
- (gxv_LookupTable_fmt0_validate, gxv_LookupTable_fmt2_validate,
- gxv_LookupTable_fmt4_validate, gxv_LookupTable_fmt6_validate,
- gxv_LookupTable_fmt8_validate, gxv_LookupTable_validate): Improve
- trace messages.
- (gxv_StateArray_validate, gxv_XStateArray_validate): s/class/clazz/.
- (GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
- GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Move to
- gxvcommn.h.
-
- * src/gxvalid/gxvcommn.h: Add prototypes for
- gxv_StateTable_subtable_setup, gxv_XStateTable_subtable_setup,
- gxv_XStateTable_validate, gxv_array_getlimits_byte,
- gxv_array_getlimits_ushort, gxv_set_length_by_ushort_offset,
- gxv_set_length_by_ulong_offset, gxv_odtect_add_range,
- gxv_odtect_validate.
- (GXV_STATETABLE_HEADER_SIZE, GXV_STATEHEADER_SIZE,
- GXV_XSTATETABLE_HEADER_SIZE, GXV_XSTATEHEADER_SIZE): Moved from
- gxvcommn.c.
-
- * src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
- gxv_bsln_parts_fmt1_validate): Improve trace messages.
-
- * src/gxvalid/gxvfeat.c: Split off predefined registry stuff to...
- * src/gxvalid/gxvfeat.h: New file.
-
- * src/gxvalid/gxvjust.c (gxv_just_wdc_entry_validate): Improve trace
- message.
-
- * src/gxvalid/gxvkern.c (GXV_kern_Dialect): Add KERN_DIALECT_UNKNOWN.
- (gxv_kern_subtable_fmt1_valueTable_load,
- gxv_kern_subtable_fmt1_subtable_setup,
- gxv_kern_subtable_fmt1_entry_validate): Fix C++ compiler errors.
- (gxv_kern_coverage_validate): Use KERN_DIALECT_UNKNOWN.
- Improve trace message.
- (gxv_kern_validate_generic): Fix C++ compiler error.
- Improve trace message.
- (gxv_kern_validate_classic): Fix C++ compiler error.
-
- * src/gxvalid/gxvmort0.c (gxv_mort_subtable_type0_validate): Declare
- with FT_LOCAL_DEF.
-
- * src/gxvalid/gxvmort1.c
- (gxv_mort_subtable_type1_substitutionTable_load,
- gxv_mort_subtable_type1_subtable_setup): Fix C++ compiler errors.
- (gxv_mort_subtable_type1_substTable_validate): Improve trace
- message.
- (gxv_mort_subtable_type1_validate): Declare with FT_LOCAL_DEF.
-
- * src/gxvalid/gxvmort2.c (gxv_mort_subtable_type2_opttable_load,
- gxv_mort_subtable_type2_subtable_setup,
- gxv_mort_subtable_type2_ligActionOffset_validate,
- gxv_mort_subtable_type2_ligatureTable_validate): Fix C++ compiler
- errors.
- (gxv_mort_subtable_type2_validate): Declare with FT_LOCAL_DEF.
-
- * src/gxvalid/gxvmort4.c (gxv_mort_subtable_type4_validate): Declare
- with FT_LOCAL_DEF.
-
- * src/gxvalid/gxvmort5.c (gxv_mort_subtable_type5_subtable_setup,
- gxv_mort_subtable_type5_InsertList_validate): Fix C++ compiler
- errors.
- (gxv_mort_subtable_type5_validate): Declare with FT_LOCAL_DEF.
-
- * src/gxvalid/gxvmort.c: Include gxvfeat.h.
- (gxv_mort_featurearray_validate, gxv_mort_coverage_validate):
- Declare with FT_LOCAL_DEF.
- (gxv_mort_subtables_validate, gxv_mort_validate): Improve trace
- messages.
-
- * src/gxvalid/gxvmort.h (gxv_mort_feature_validate): Remove.
-
- * src/gxvalid/gxvmorx0.c (gxv_morx_subtable_type0_validate): Declare
- with FT_LOCAL_DEF.
-
- * src/gxvalid/gxvmorx1.c
- (gxv_morx_subtable_type1_substitutionTable_load,
- gxv_morx_subtable_type1_subtable_setup,
- gxv_morx_subtable_type1_entry_validate,
- gxv_morx_subtable_type1_substitutionTable_validate): Fix C++
- compiler errors.
- (gxv_morx_subtable_type1_validate): Declare with FT_LOCAL_DEF.
-
- * src/gxvalid/gxvmorx2.c (gxv_morx_subtable_type2_opttable_load,
- gxv_morx_subtable_type2_subtable_setup,
- gxv_morx_subtable_type2_ligActionIndex_validate,
- gxv_morx_subtable_type2_ligatureTable_validate): Fix C++ compiler
- errors.
- (gxv_morx_subtable_type2_validate): Declare with FT_LOCAL_DEF.
- Fix typo.
-
- * src/gxvalid/gxvmorx4.c (gxv_morx_subtable_type4_validate): Declare
- with FT_LOCAL_DEF.
-
- * src/gxvalid/gxvmorx5.c (gxv_morx_subtable_type5_insertionGlyph_load,
- gxv_morx_subtable_type5_subtable_setup): Fix C++ compiler error.
- (gxv_morx_subtable_type5_validate): Declare with FT_LOCAL_DEF.
-
- * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate,
- gxv_morx_validate): Improve trace message.
-
- * src/gxvalid/gxvopbd.c (gxv_opbd_LookupFmt4_transit): Fix compiler
- warnings.
- (gxv_opbd_validate): Improve trace message.
-
- * src/gxvalid/gxvprop.c: Decorate constants with `U' and `L' where
- appropriate.
- (gxv_prop_zero_advance_validate, gxv_prop_validate): Improve trace
- message.
-
- * src/gxvalid/gxvtrak.c (gxv_trak_trackTable_validate): Remove unused
- parameter. Update all callers.
- (gxv_trak_validate): Improve trace message.
-
- * rules.mk (GXV_DRV_H): Add gxvfeat.h.
-
-2005-09-01 Werner Lemberg <wl@gnu.org>
-
- * src/gxvalid/gxvbsln.c (GXV_BSLN_VALUE_EMPTY): Add `U'.
-
- * src/gxvalid/gxvmort1.c (GXV_MORT_SUBTABLE_TYPE1_HEADER_SIZE),
- src/gxvalid/gxvmort2.c (GXV_MORT_SUBTABLE_TYPE2_HEADER_SIZE): Fix
- typo.
-
- * src/gxvalid/gxvmorx0.c, src/gxvalid/gxvmorx1.c,
- src/gxvalid/gxvmorx2.c, src/gxvalid/gxvmorx4.c,
- src/gxvalid/gxvmorx5.c, src/gxvalid/gxvmort.c: Improve trace
- messages.
- Decorate constants with `U' and `L' where appropriate.
- Fix compiler warnings.
-
-2005-08-31 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fix typo.
-
- * src/gxvalid/gxvbsln.c (gxv_bsln_validate): Fix trace message.
-
- * src/gxvalid/gxvcommn.c (gxv_odtect_add_range): Use `const'.
-
- * src/gxvalid/gxvfeat.c, src/gxvalid/gxvjust.c,
- src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmod.c,
- src/gxvalid/gxvmort0.c, src/gxvalid/gxvmort1.c,
- src/gxvalid/gxvmort2.c, src/gxvalid/gxvmort4.c,
- src/gxvalid/gxvmort5.c, src/gxvalid/gxvmort.c: Improve trace
- messages.
- Decorate constants with `U' and `L' where appropriate.
- Fix compiler warnings.
-
-2005-08-30 Werner Lemberg <wl@gnu.org>
-
- * src/gxvalid/README: Revised.
- * src/gxvalid/gxvbsln.c: Fix compiler warnings.
- * src/gxvalid/gxvcommn.c: Fix compiler warnings.
- (gxv_XEntryTable_validate, gxv_compare_ranges): Remove unused
- parameter. Update all callers.
- Improve trace messages.
- Some formatting.
-
-2005-08-29 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h, include/freetype/ftchapters.h: Add
- a preliminary section with some explanations about user allocation.
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter.section_enter):
- Don't abort if there are no data types, functions, etc., in a
- section.
- Print synopsis only if we have a data type, function, etc.
-
- * docs/INSTALL.ANY, docs/INSTALL, docs/INSTALL.UNX, docs/CUSTOMIZE,
- docs/INSTALL.GNU, docs/TRUETYPE, docs/DEBUG, docs/UPGRADE.UNX,
- docs/VERSION.DLL, docs/formats.txt: Revised, formatted.
-
-2005-08-28 George Williams <gww@silcom.com>
-
- * src/truetype/ttgload.c [TT_MAX_COMPOSITE_RECURSE]: Removed.
- (load_truetype_glyph): Limit recursion depth by `maxComponentDepth'.
-
-2005-08-25 J. Ali Harlow <ali@avrc.city.ac.uk>
-
- * builds/unix/freetype2.in (CFlags): Add missing directory.
-
-2005-08-24 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Mention gxvalid module.
-
-2005-08-23 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_metrics_scale): Initialize
- render mode properly. Reported by chris@dokein.co.uk.
-
-2005-08-23 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Add gxvalid module to validate TrueType GX/AAT tables.
-
- Modifications on existing files:
-
- * Jamfile: Register gxvalid module.
- * src/base/Jamfile: Register ftgxval.c.
- * src/base/rule.mk: Register ftgxval.c.
- * docs/INSTALL.ANY: Register gxvalid/gxvalid.c.
-
- * include/freetype/config/ftheader.h (FT_GX_VALIDATE_H): New macro
- to include gxvalid header file.
- * include/freetype/config/ftmodule.h: Register gxv_module_class.
-
- * include/freetype/ftchapters.h: Add comment about gx_validation.
- * include/freetype/ftotval.h: Change keyword FT_VALIDATE_XXX
- to FT_VALIDATE_OTXXX to co-exist with gxvalid.
- * include/freetype/tttags.h: Add tags for TrueType GX/AAT tables.
-
- * include/freetype/internal/ftserv.h (FT_SERVICE_GX_VALIDATE_H): New
- macro for gxvalid service.
- * include/freetype/internal/fttrace.h: Add trace facilities for
- gxvalid.
-
- New files on existing directories:
-
- * include/freetype/internal/services/svgxval.h: Registration of
- validation service for TrueType GX/AAT and classic kern table.
- * include/freetype/ftgxval.h: Public API definition to use gxvalid.
- * src/base/ftgxval.c: Public API of gxvalid.
-
- New files under src/gxvalid/:
-
- * src/gxvalid/Jamfile src/gxvalid/README src/gxvalid/module.mk
- src/gxvalid/rules.mk src/gxvalid/gxvalid.c src/gxvalid/gxvalid.h
- src/gxvalid/gxvbsln.c src/gxvalid/gxvcommn.c src/gxvalid/gxvcommn.h
- src/gxvalid/gxverror.h src/gxvalid/gxvfeat.c src/gxvalid/gxvfgen.c
- src/gxvalid/gxvjust.c src/gxvalid/gxvkern.c src/gxvalid/gxvlcar.c
- src/gxvalid/gxvmod.c src/gxvalid/gxvmod.h src/gxvalid/gxvmort.c
- src/gxvalid/gxvmort.h src/gxvalid/gxvmort0.c src/gxvalid/gxvmort1.c
- src/gxvalid/gxvmort2.c src/gxvalid/gxvmort4.c src/gxvalid/gxvmort5.c
- src/gxvalid/gxvmorx.c src/gxvalid/gxvmorx.h src/gxvalid/gxvmorx0.c
- src/gxvalid/gxvmorx1.c src/gxvalid/gxvmorx2.c src/gxvalid/gxvmorx4.c
- src/gxvalid/gxvmorx5.c src/gxvalid/gxvopbd.c src/gxvalid/gxvprop.c
- src/gxvalid/gxvtrak.c: New files, gxvalid body.
-
-2005-08-21 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (TT_Load_Glyph): Only translate outline
- to (0,0) if bit 1 of the `head' table isn't set. This improves
- rendering of buggy fonts.
-
-2005-08-20 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/truetype/ttdriver.c (Load_Glyph): Don't check the validity of
- ttmetrics here. TrueType fonts with only sbits always have
- ttmetrics.valid set to false.
-
- * src/truetype/ttgload.c (TT_Load_Glyph): Check that ttmetrics is
- valid before loading outline glyph.
-
- * src/cache/ftcimage.c (FTC_INode_New): Fix a memory leak.
-
-2005-08-20 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (tt_face_load_metrics_header): Ignore missing
- `hhea' table for SFNT Mac fonts. Change based on a patch by
- mpsuzuki@hiroshima-u.ac.jp.
-
-2005-08-20 Masatake YAMATO <jet@gyve.org>
-
- * src/otvalid/otvmod.c (otv_validate): Use ft_validator_run instead
- of ft_setjmp.
-
-2005-08-19 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fix compiler
- warnings.
-
-2005-08-16 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/truetype/ttinterp.c, src/truetype/ttinterp.h: Update copyright
- messages.
-
-2005-08-16 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/truetype/ttinterp.c, src/truetype/ttinterp.h: Remove original
- TT_Done_Context and rename TT_Destroy_Context to TT_Done_Context
- with slight changes.
- Update all callers.
- (TT_New_Context): Now takes TT_Driver argument directly.
- Update all callers.
-
- * src/truetype/ttobjs.h (tt_slot_init): New function.
- * src/truetype/ttobjs.c (tt_driver_init): Initialize execution
- context here.
- (tt_slot_init): New function to create extra points for the internal
- glyph loader. We then use it directly, instead of face's glyph
- loader, when loading glyph.
-
- * src/truetype/ttdriver.c (tt_driver_class): Use tt_slot_init for
- glyph slot initialization.
- (Load_Glyph): Load flag dependencies are handled here. Return error
- if size is NULL.
-
- * src/truetype/ttgload.c: Heavy cleanup and refactoring.
- (org_to_cur): Removed.
- (TT_Load_Simple_Glyph): Call FT_GlyphLoader_CheckPoints.
- (TT_Hint_Glyph): New function to hint a zone, prepared by caller.
- (TT_Process_Simple_Glyph): s/load/loader/.
- Use loader->pp values instead of recalculation.
- Use TT_Hint_Glyph.
- No need to save/restore loader->stream before and after
- TT_Vary_Get_Glyph_Deltas now.
- (TT_LOADER_SET_PP): New macro to calculate and set the four phantom
- points.
- (load_truetype_glyph): Never set exec->glyphSize to 0. This closes
- Savannah bug #13107.
- Forget glyph frame before calling TT_Process_Simple_Glyph.
- Use TT_LOADER_SET_PP.
- Scale all four phantom points.
- Split off some functionality to ...
- (TT_Process_Composite_Component, TT_Process_Composite_Glyph): These
- new functions.
- (TT_Load_Glyph): Set various fields of `glyph' here, not in
- load_truetype_glyph and compute_glyph_metrics.
- Split off some functionality to ...
- (load_sbit_image, tt_loader_init): These new functions.
- (compute_glyph_metrics): Call FT_Outline_Get_CBox.
-
-2005-08-08 Werner Lemberg <wl@gnu.org>
-
- * docs/INSTALL.ANY: Updated.
-
-2005-08-05 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (cff_builder_close_contour),
- src/psaux/psobjs.c (t1_builder_close_contour): Protect against
- zero `outline' pointer.
-
- * src/base/ftgloadr.c (FT_GlyphLoader_Add): Protect against zero
- `loader' address.
-
-2005-08-03 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfdriver.c (sfnt_interface) [FT_OPTIMIZE_MEMORY]:
- Reactivate pointers to tt_find_sbit_image and tt_load_sbit_metrics
- to make X work again.
-
-2005-08-02 Werner Lemberg <wl@gnu.org>
-
- * src/otvalid/otvcommn.h: Remove dead code.
-
-2005-07-31 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/truetype/ttobjs.h (tt_size_run_fpgm, tt_size_run_prep): New
- functions.
-
- * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): New
- functions.
- (tt_size_init): Add 4, instead of 2, (phantom) points to twilight
- zone.
- Move code that runs fpgm to tt_size_run_fpgm.
- (Reset_Outline_Size): Move code that runs prep to tt_size_run_prep.
- (tt_glyphzone_new): Allocate right size of arrays.
- Set max_points and max_contours properly.
-
-2005-07-26 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/truetype/ttdriver.c (Set_Char_Sizes): Avoid unnecessary
- computations and clean up.
-
- * src/truetype/ttobjs.h (struct TT_SizeRec_): Comment on the
- internal copy of metrics.
-
-2005-07-12 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftoutln.h (FT_Outline_Embolden): Fix prototype.
- Reported by Xerxes.
-
-2005-07-04 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftmemory.h (FT_REALLOC_ARRAY): Fix typo.
- Reported by Brett Hutley.
-
-2005-06-30 David Turner <david@freetype.org>
-
- * src/sfnt/ftbitmap.c, src/truetype/ttgload.c, src/sfnt/ttcmap.c:
- Removing compiler warnings (Visual C++ /W4).
-
-
- Implement a work-around for broken C preprocessor in Visual C++ (it
- has been confirmed by the MS developers that it is indeed a bug
- which won't be fixed in the very near future).
-
- * Jamfile (FT2_COMPONENTS): Include otvalid (again).
-
- * src/otvalid/otvcommn.h (OTV_NAME, OTV_FUNC): New macros.
- (OTV_NEST1, OTV_NEST2, OTV_NEST3): Use OTV_NAME and OTV_FUNC to
- avoid argument expansion by argument prescan.
- Append `Func' to all affected macros and change them to take just a
- single argument. Example: `AttachList' is renamed to
- `AttachListFunc'.
-
- * src/otvalid/otvgdef.c, src/otvalid/otvgpos.c,
- src/otvalid/otvgsub.c, src/otvjstf.c: Append `Func' to macros
- affected by the changes to OTV_NESTx and modify them to take just a
- single argument.
-
-2005-06-20 Chia I Wu <b90201047@ntu.edu.tw>
-
- * include/freetype/internal/ftobjs.h, src/base/ftobjs.c: New function
- ft_glyphslot_grid_fit_metrics.
-
- * src/truetype/ttgload.c (compute_glyph_metrics): Use
- ft_glyphslot_grid_fit_metrics.
-
- * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
- (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph): Use
- ft_glyphslot_grid_fit_metrics.
- FT_Outline_Get_CBox is called twice.
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Modify metrics to more
- reasonable values when emboldening outline glyphs. The theoretic
- ones are unrealistic.
-
-2005-06-16 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/base/ftoutln.c (FT_Outline_Embolden): Strength should be
- halved.
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Change the default
- strength.
- Don't increase slot->advance.y.
-
-2005-06-16 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FREETYPE_MINOR): Set to 2.
- (FREETYPE_PATCH): Set to 0.
-
- * builds/unix/configure.ac (version_info): Set to 9:9:3.
- Currently, we are still binary compatible.
-
- * builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj: s/219/2110/, s/2.1.9/2.1.10/.
-
- * builds/freetype.mk (refdoc), README, Jamfile (RefDoc):
- s/2.1.9/2.1.10/.
-
- * docs/CHANGES, docs/VERSION.DLL: Updated.
-
- * ChangeLog: Split off older entries into...
- * ChangeLog.20, ChangeLog.21: These new files.
-
-2005-06-15 Kirill Smelkov <kirr@mns.spb.ru>
-
- The next release will be 2.2.0, so don't worry about source code
- backward compatibility.
-
- * include/freetype/ftimage.h (FT_Outline_MoveToFunc,
- FT_Outline_LineToFunc, FT_Outline_ConicToFunc,
- FT_Outline_CubicToFunc, FT_SpanFunc, FT_Raster_RenderFunc),
- include/freetype/ftrender.h (FT_Glyph_TransformFunc,
- FT_Renderer_RenderFunc, FT_Renderer_TransformFunc): Decorate
- parameters with `const' where appropriate.
-
-2005-06-15 Chia I Wu <b90201047@ntu.edu.tw>
-
- * src/sfnt/ttsbit.c (tt_face_load_sbit_image): Compute vertBearingY
- to make glyphs centered vertically.
-
- * src/truetype/ttgload.c (compute_glyph_metrics): Compute
- vertBearingY to make glyphs centered vertically.
- Fix some bugs in vertical metrics:
-
- . loader->pp3.y and loader->pp4.y are in 26.6 format, not in font
- units.
- . As we use the glyph's cbox to calculate the top bearing now
- there is no need to adjust `top'.
-
-2005-06-15 Werner Lemberg <wl@gnu.org>
-
- * src/otvalid/otvcommn.h (OTV_OPTIONAL_TABLE): Use FT_UShort to be
- in sync with OTV_OPTIONAL_OFFSET. Reported by YAMATO Masatake.
-
-2005-06-13 Werner Lemberg <wl@gnu.org>
-
- * docs/release: Update.
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2005-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/ChangeLog.23 b/freetype/ChangeLog.23
deleted file mode 100644
index 4c80504c..00000000
--- a/freetype/ChangeLog.23
+++ /dev/null
@@ -1,7948 +0,0 @@
-2010-02-13 Werner Lemberg <wl@gnu.org>
-
- * Version 2.3.12 released.
- ==========================
-
-
- Tag sources with `VER-2-3-12'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.3.12.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.3.11/2.3.12/, s/2311/2312/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 12.
-
- * builds/unix/configure.raw (version_info): Set to 10:0:4.
-
-2010-02-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Improve autotool version checking to work with beta releases.
-
- * autogen.sh (check_tool_version): Improve the extraction of version
- number from "tool --version" output. Some beta releases of
- autotools have extra strings before version number.
-
-2010-02-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix overallocating bug in FT_Outline_New_Internal().
-
- * src/base/ftoutln.c (FT_Outline_New_Internal): The length of
- FT_Outline->points[] should be numPoints, not 2 * numPoints.
- Found by Paul Messmer, see
- https://lists.gnu.org/archive/html/freetype-devel/2010-02/msg00003.html
-
-2010-02-10 Ken Sharp <ken.sharp@artifex.com>
-
- Really fix Savannah bug #28678 (part 2).
-
- Since we consider `sbw' for the horizontal direction only, we still have
- to synthesize vertical metrics if the user wants to use the vertical
- writing direction.
-
- * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
- (cid_slot_load_glyph), src/type1/t1gload.c (T1_Load_Glyph):
- Synthesize vertical metrics (only) if FT_LOAD_VERTICAL_LAYOUT is
- set.
-
-2010-02-10 Ken Sharp <ken.sharp@artifex.com>
-
- Really fix Savannah bug #28678 (part 1).
-
- After long discussion, we now consider the character width vector
- (wx,wy) returned by the `sbw' Type 1 operator as being part of *one*
- direction only. For example, if you are using the horizontal
- writing direction, you get the horizontal and vertical components of
- the advance width for this direction. Note that OpenType and CFF fonts
- don't have such a vertical component; instead, the GPOS table can be
- used to generate two-dimensional advance widths (but this isn't
- handled by FreeType).
-
- * include/freetype/ftincrem.h (FT_Incremental_MetricsRec): Add
- `advance_v' field to hold the vertical component of the advance
- value.
-
- * src/truetype/ttgload.c (tt_get_metrics), src/cff/cffgload.c
- (cff_slot_load), src/type1/t1gload.c
- (T1_Parse_Glyph_And_Get_Char_String), src/cid/cidgload.c
- (cid_load_glyph): Use it.
-
-2010-02-08 Werner Lemberg <wl@gnu.org>
-
- * devel/ftoption.h [FT_CONFIG_OPTION_PIC]: Define.
-
-2010-02-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Prevent NULL pointer dereference passed to FT_Module_Requester.
-
- * src/sfnt/sfdriver.c (sfnt_get_interface): Don't use `module'.
- * src/psnames/psmodule.c (psnames_get_interface): Ditto.
-
- * src/cff/cffdrivr.c (cff_get_interface): Check NULL `driver'.
- * src/truetype/ttdriver.c (tt_get_interface): Ditto.
-
-2010-01-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix memory leaks in previous patch.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Don't overwrite the strings
- allocated for face->root.family_name and style_name.
-
-2010-01-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- New parameters for FT_Open_Face() to ignore preferred family names.
-
- Preferred family names should be used for legacy systems that
- can hold only a few faces (<= 4) for a family name. Suggested by
- Andreas Heinrich.
- https://lists.gnu.org/archive/html/freetype/2010-01/msg00001.html
-
- * include/freetype/ftsnames.h (FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY,
- FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY): Define.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Check the arguments and
- ignore preferred family and subfamily names if requested.
-
-2010-01-27 Ken Sharp <ken.sharp@artifex.com>
-
- Fix Savannah bug #28678.
-
- * src/cff/cffgload.c (cff_slot_load), src/cid/cidgload.c
- (cid_load_glyph): Handle vertical metrics correctly.
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Handle
- vertical metrics correctly.
- (T1_Load_Glyph): Don't synthesize vertical metrics.
-
-2010-01-14 Werner Lemberg <wl@gnu.org>
-
- Make FT_Set_Transform work if no renderer is available.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Apply `standard' transformation
- if no renderer is compiled into the library.
-
-2010-01-14 Werner Lemberg <wl@gnu.org>
-
- Fix compilation warning.
-
- * src/base/ftbase.h: s/LOCAL_DEF/LOCAL/.
- * src/base/ftobjs.c: Include ftbase.h conditionally.
-
-2010-01-11 Kwang Yul Seo <skyul@company100.net>
-
- Provide inline assembly code for RVCT compiler.
- This is Savannah patch #7059.
-
- * include/freetype/config/ftconfig.h (FT_MULFIX_ASSEMBLER,
- FT_MulFix_arm) [__CC_ARM || __ARM_CC]: Define.
-
-2010-01-08 Ken Sharp <ken.sharp@artifex.com>
-
- Fix Savannah bug #28521.
-
- Issue #28226 involved a work-around for a font which used the
- `setcurrentpoint' operator in an invalid way; this operator is only
- supposed to be used with the result of OtherSubrs, and the font used
- it directly. The supplied patch removed the block of code which
- checked this usage entirely.
-
- This turns out to be a Bad Thing. If `setcurrentpoint' is being
- used correctly it should reset the flex flag in the decoder. If we
- don't do this then the flag never gets reset and we omit any further
- contours from the glyph (at least until we close the path or
- similar).
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- <op_setcurrentpoint>: Handle `flex_state' correctly.
-
-2010-01-05 Werner Lemberg <wl@gnu.org>
-
- Apply reports from clang static analyzer.
-
- * src/lzw/ftlzw.c (ft_lzw_file_init), src/base/ftstroke.c
- (FT_Stroker_ParseOutline), src/base/ftsynth.c
- (FT_GlyphSlot_Embolden): Remove dead code.
-
- * src/base/ftpatent.c (_tt_check_patents_in_table): Initialize
- `offset_i' and `length_i'.
-
-2010-01-05 Ralph Giles <giles@ghostscript.com>
-
- Enable the incremental font interface by default.
-
- Ghostscript requires the incremental font interface for handling
- some Postscript documents. It is moving to using FreeType as its
- primary renderer; supporting this in the default build makes it
- Ghostscript to be linked against the system FreeType when one is
- available.
-
- * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_INCREMENTAL):
- Uncomment.
-
-2010-01-05 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #28395.
-
- * src/truetype/ttdriver.c (Load_Glyph), src/type1/t1gload.c
- (T1_Load_Glyph): Don't check `num_glyphs' if incremental interface
- is used.
-
-2010-01-05 Ken Sharp <ken.sharp@artifex.com>
-
- Make Type 1 `seac' operator work with incremental interface.
- This fixes Savannah bug #28480.
-
- * src/psaux/t1decode.c (t1operator_seac): Don't check `glyph_names'
- if incremental interface is used.
-
-2010-01-04 Ken Sharp <ken.sharp@artifex.com>
-
- Make incremental interface work with TrueType fonts.
- This fixes Savannah bug #28478.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Don't check
- `glyf_offset' if incremental interface is used.
-
-2009-12-31 Lars Abrahamsson <wonko@opera.com>
-
- Make compilation with FT_CONFIG_OPTION_PIC work again.
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap) [FT_CONFIG_OPTION_PIC]:
- Declare `library' for FT_BITMAP_GLYPH_CLASS_GET.
-
- * src/base/ftinit.c (ft_destroy_default_module_classes,
- ft_create_default_module_classes): Use proper casts (needed for C++
- compilation).
-
- * src/sfnt/ttcmap.c (tt_cmap13_class_rec): Use FT_DEFINE_TT_CMAP.
-
-2009-12-22 Marc Kleine-Budde <mkl@pengutronix.de>
-
- Make freetype-config aware of $SYSROOT.
- This is Savannah patch #7040.
-
- * builds/unix/freetype-config.in: Decorate with ${SYSROOT} where
- appropriate.
-
-2009-12-20 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warning.
- Reported by Sean.
-
- * src/base/ftdbgmem.c [!FT_DEBUG_MEMORY]: ANSI C doesn't like empty
- source files; however, some compilers warn about an unused variable
- declaration. This is now replaced with a typedef.
-
-2009-12-18 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #28320.
-
- There exist corrupt, subsetted fonts (embedded in PDF files) which
- contain a private dict that ends with an unterminated floating point
- number (no operator following). We now ignore this error (as
- acrobat does).
-
- * src/cff/cffparse.c (cff_parser_run): Don't emit a syntax error for
- unterminated floating point numbers.
-
-2009-12-16 Werner Lemberg <wl@gnu.org>
-
- Really fix compiler warnings.
- Reported by Sean.
-
- * src/truetype/ttgxvar.c (GX_PT_POINTS_ARE_WORDS,
- GX_PT_POINT_RUN_COUNT_MASK): Convert enum values to macros.
-
-2009-12-16 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Improve configure.raw to copy some options from CFLAGS to LDFLAGS.
- The linker of Mac OS X 10.6 is sensitive to the architecture. If
- the architectures are specified explicitly for the C compiler, the
- linker requires the architecture specifications too.
-
- * builds/unix/configure.raw: Replace `-isysroot' option parser by
- more generic argument parser.
-
-2009-12-15 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warnings.
- Reported by Sean.
-
- * src/truetype/ttgxvar.c (ft_var_readpackeddeltas): Fix counter data
- type.
-
-2009-12-14 Ken Sharp <ken.sharp@artifex.com>
-
- Ignore invalid `setcurrentpoint' operations in Type 1 fonts.
- This fixes Savannah bug #28226.
-
- At least two wild PostScript files of unknown provenance contain
- Type 1 fonts, apparently converted from TrueType fonts in earlier
- PDF versions of the files, which use the `setcurrentpoint' operator
- inappropriately.
-
- FreeType currently throws an error in this case, but Ghostscript and
- Adobe Distiller both accept the fonts and ignore the problem. This
- commit #ifdefs out the check so PostScript interpreters using
- FreeType can render these files.
-
- The specification says `setcurrentpoint' should only be used to set
- the point after a `Subr' call, but these fonts use it to set the
- initial point to (0,0). Unnecessarily so, as they correctly use an
- `hsbw' operation which implicitly sets the initial point.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- <op_setcurrentpoint>: Comment out code.
-
-2009-12-14 Bram Tassyns <bramt@enfocus.be>
-
- Fix parsing of /CIDFontVersion.
- This fixes Savannah bug #28287.
-
- * src/cid/cidtoken.h: `cid_version' in CID_FaceInfoRec (in
- t1tables.h) is of type FT_Fixed.
-
-2009-12-14 Werner Lemberg <wl@gnu.org>
-
- Trace glyph index in CID module.
- Suggested in Savannah patch #7023.
-
- * src/cid/cidgload.c (cid_load_glyph): Add tracing message.
-
-2009-12-03 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warnings.
-
- * src/truetype/ttgload.c (tt_get_metrics): Put `Exit' label into the
- proper preprocessor conditional.
- * src/pfr/pfrobjs.c (pfr_slot_load): Pacify gcc.
-
-2009-11-25 John Tytgat <John.Tytgat@esko.com>
-
- Better handling of start of `eexec' section.
- This fixes Savannah bug #28090.
-
- * src/type1/t1parse.c (T1_Get_Private_Dict): Skip all whitespace
- characters before start of `eexec' section.
-
-2009-11-20 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #27742.
-
- * src/base/ftstroke.c (ft_stroker_outside): Avoid silent division by
- zero, using a threshold for `theta'.
-
-2009-11-20 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #28036.
-
- * src/type1/t1afm.c (t1_get_index): Fix comparison.
-
-2009-11-16 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warnings.
- Reported by Kevin Blenkinsopp <arqon@promode.org>.
-
- * src/sfnt/ttload.c (check_table_dir): Use proper data type.
-
-2009-11-15 Werner Lemberg <wl@gnu.org>
-
- Really fix FreeDesktop bug #21197.
- This also fixes Savannah bug #28021.
-
- * src/autofit/aflatin.c (af_latin_metrics_check_digits),
- src/autofit/aflatin2.c (af_latin2_metrics_check_digits): Fix loop.
-
-2009-11-15 Werner Lemberg <wl@gnu.org>
-
- Add tracing messages for advance values.
-
- * src/base/ftobjs.c (FT_Load_Glyph), src/truetype/ttgload.c
- (TT_Get_HMetrics, TT_Get_VMetrics): Do it.
-
-2009-11-08 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warning.
- Reported by Jeremy Manson <jeremy.manson@gmail.com>.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Initialize `error'.
-
-2009-11-04 Werner Lemberg <wl@gnu.org>
-
- Remove compiler warning.
- Reported by Sean McBride <sean@rogue-research.com>.
-
- * src/tools/apinames.c (read_header_file)<STATE_TYPE>: Use a cast to
- `int', as specified in the printf(3) man page.
-
-2009-11-04 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #27921.
-
- * src/cff/cffobjs.c (cff_face_init), src/cid/cidobjs.c
- (cid_face_init), src/type1/t1afm.c (T1_Read_Metrics),
- src/type1/t1objs.c (T1_Face_Init): Don't use unsigned constant
- values for rounding if the argument can be negative.
-
-2009-11-03 Bram Tassyns <bramt@enfocus.be>
-
- Add basic support for Type1 charstrings in CFF.
- This fixes Savannah bug #27922.
-
- * src/cff/cffgload.c (CFF_Operator, cff_argument_counts): Handle
- `seac', `sbw', and `setcurrentpoint' opcodes.
- (cff_compute_bias): Add parameter to indicate the charstring type.
- Update all callers.
- (cff_operator_seac): Add parameter for side bearing.
- (cff_decoder_parse_charstrings): Updated for more Type1 support.
-
-2009-11-03 Werner Lemberg <wl@gnu.org>
-
- Return correct `linearHoriAdvance' value for embedded TT bitmaps too.
- Reported by Jeremy Manson <jeremy.manson@gmail.com>.
-
- src/truetype/ttgload.c (load_truetype_glyph): Add parameter to
- quickly load the glyph header only.
- Update all callers.
- (tt_loader_init): Add parameter to quickly load the `glyf' table
- only.
- Update all callers.
- (TT_Load_Glyph): Compute linear advance values for embedded bitmap
- glyphs too.
-
-2009-11-03 Werner Lemberg <wl@gnu.org>
-
- Improve code readability.
-
- * src/ttgload.c (load_truetype_glyph): Move metrics calculation
- to...
- (tt_get_metrics): This new function.
-
-2009-10-26 Bram Tassyns <bramt@enfocus.be>
-
- Fix Savannah bug #27811.
-
- * src/truetype/ttxgvar.c (ft_var_readpackeddeltas): Fix
- signed/unsigned mismatch.
-
-2009-10-19 Ning Dong <flintning@163.com>
-
- Fix handling of `get' and `put' CFF instructions.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_get,
- cff_op_put>: Appendix B of Adobe Technote #5177 limits the number of
- elements for the `get' and `put' operators to 32.
- * src/cff/cffgload.h (CFF_MAX_TRANS_ELEMENTS): Define.
- (CFF_Decoder): Use it for `buildchar' and remove `len_buildchar'.
-
-2009-10-18 Werner Lemberg <wl@gnu.org>
-
- Fix handling of `dup' CFF instruction.
- Problem and solution reported by Ning Dong <flintning@163.com>.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_dup>:
- Increase `args' by 2, not 1.
-
-2009-10-10 Werner Lemberg <wl@gnu.org>
-
- * Version 2.3.11 released.
- ==========================
-
-
- Tag sources with `VER-2-3-11'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.3.11.
-
- * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj: s/2.3.10/2.3.11/, s/2310/2311/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 11.
-
- * builds/unix/configure.raw (version_info): Set to 9:22:3.
-
-2009-10-10 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES, docs/release: Updated.
-
-2009-10-10 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/pcf/pcfread.c (pcf_get_properties): Fix a bug in the nprops
- truncation. Reported by Martin von Gagern and Peter Volkov.
- https://bugs.gentoo.org/288357 and https://bugs.gentoo.org/288256
-
-2009-10-06 Werner Lemberg <wl@gnu.org>
-
- * Version 2.3.10 released.
- ==========================
-
-
- Tag sources with `VER-2-3-10'.
-
- * builds/toplevel.mk (major, minor, patch): Fix regexp to allow more
- than a single digit.
- (dist): We now use git.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.3.10.
-
- * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj: s/2.3.9/2.3.10/, s/239/2310/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.
-
- * builds/unix/configure.raw (version_info): Set to 9:21:3.
-
-2009-10-06 Werner Lemberg <wl@gnu.org>
-
- Fix `make multi'.
-
- * src/cache/ftccache.c, src/cache/ftcsbits.c (FT_COMPONENT): Define.
-
- * src/sfnt/sfdriver.c: Include FT_INTERNAL_DEBUG_H.
-
-2009-09-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Fix Savannah bug #27441, clean up Redhat bugzilla #513582.
- Tricky casts in FTC_{CACHE,GCACHE,MRULIST}_LOOKUP_CMP() are removed.
- Now these functions should be called with FTC_Node or FTC_MruNode
- variable, and the caller should cast them to appropriate pointers to
- concrete data. These tricky casts can GCC-4.4 optimizer (-O2)
- confused and the crashing binaries are generated.
-
- * src/cache/ftcmru.h (FTC_MRULIST_LOOKUP_CMP): Drop tricky cast.
- Now the 4th argument `node' of this function should be typed as
- FTC_MruNode.
-
- * src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP): For inline
- implementation, new temporal variable FTC_MruNode `_mrunode' to take
- the pointer from FTC_MRULIST_LOOKUP_CMP(). For non-inline
- implementation, tricky cast is dropped.
-
- * src/cache/ftcmanag.c (FTC_SIZE_NODE): New macro casting
- to FTC_SizeNode.
- (FTC_Manager_LookupSize): Replace FTC_SizeNode `node' by FTC_MruNode
- `mrunode', and FTC_SIZE_NODE() is inserted.
- (FTC_FACE_NODE): New macro casting to FTC_FaceNode.
- (FTC_Manager_LookupFace) Replace FTC_FaceNode `node' by FTC_MruNode
- `mrunode', and FTC_FACE_NODE() is inserted.
-
- * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Change the type of
- `node' from FTC_INode to FTC_Node. Extra casting macro FTC_NODE()
- is dropped.
- (FTC_ImageCache_LookupScaler): Ditto.
- (FTC_SBitCache_Lookup): Change the type of `node' from FTC_SNode to
- FTC_Node. Extra casting macro FTC_NODE() is dropped. FTC_SNODE()
- is inserted.
- (FTC_SBitCache_LookupScaler): Ditto.
-
- * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Change the type of
- `node' from FTC_CMapNode to FTC_Node. Extra casting macro
- FTC_NODE() is dropped, FTC_CMAP_NODE() is inserted.
-
-2009-09-25 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache, psaux, type1] Fix for multi build.
- In multi build, some cpp functions are left as unresolved symbols.
-
- * src/cache/ftcbasic.c: Include FT_INTERNAL_DEBUG_H for FT_TRACE1().
-
- * src/psaux/t1decode.c: Include FT_INTERNAL_CALC_H for
- FIXED_TO_INT().
- * src/type1/t1gload.c: Ditto.
- * src/type1/t1objs.c: Ditto.
-
-2009-09-25 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [autofit] Fix for multi build.
-
- * src/autofit/afmodule.h: Include FT_INTERNAL_OBJECTS_H to use
- FT_DECLARE_MODULE() macro in multi build.
-
- * src/autofit/aflatin.c: Include <ft2build.h> to handle
- FT_ADVANCES_H correctly in multi build.
-
-2009-09-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Check the face filled by FTC_Manager_LookupFace().
-
- * src/cache/ftcbasic.c (ftc_basic_family_get_count): Return
- immediately if FTC_Manager_LookupFace() fills face by NULL. Such
- case can occur when the code is optimized by GCC-4.2.x.
-
-2009-09-23 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2009-09-12 Werner Lemberg <wl@gnu.org>
-
- [raster] Fix 5-levels grayscale output.
- This was broken since version 2.3.0.
-
- * src/raster/ftraster.c (count_table): Use pre-2.3.0 values (which
- were then computed dynamically).
- (Vertical_Gray_Sweep_Step): Updated.
-
- (ft_black_render): Initialize `worker->gray_lines' (problem found by
- valgrind).
-
- (FT_RASTER_OPTION_ANTI_ALIASING, DEBUG_RASTER): Don't #undef, just
- comment out.
-
-2009-09-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Improve configure.raw for cross build.
-
- * builds/unix/configure.raw: Remove temporal files created by the
- suffix checking for CC_BUILD. Set XX_ANSIFLAGS and XX_CFLAGS when
- cross compiler is GCC. AC_PROG_CC checks whether the cross compiler
- is GCC, its result is stored in GCC.
-
-2009-09-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [BDF] Modify hash API to take size_t value instead of void *.
-
- The hash API in BDF driver is designed to be generic, it takes
- void * typed data. But BDF driver always gives an unsigned long
- integer (the index to a property). To reduce non-essential
- casts from unsigned long to void* and from void* to unsigned
- long, the hash API is changed to take size_t integer.
- The issue of incompatible cast between unsigned long and void*
- on LLP64 platform is reported by NightStrike from MinGW-Win64
- project. See
- https://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html
-
- * src/bdf/bdf.h: The type of hashnode->data is changed from
- void* to size_t.
-
- * src/bdf/bdflib.c (hash_insert): Get size_t data, instead of
- void* data.
- (bdf_create_property): Get the name length of new property by
- size_t variable, with a cut-off at FT_ULONG_MAX.
- (_bdf_set_default_spacing): Get the name length of the face by
- size_t variable, with a cut-off at 256.
- (bdf_get_property): Get the property id by size_t variable to
- reduce the casts between 32-bit prop ID & hashnode->data during
- simple copying.
- (_bdf_add_property): Ditto.
- (_bdf_parse_start): Calculate the index to the property array
- by size_t variable.
- (bdf_get_font_property): Drop a cast to unsigned long.
-
-2009-09-10 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [Win64] Improve the computation of random seed from stack address.
-
- On LLP64 platform, the conversion from pointer to FT_Fixed need
- to drop higher 32-bit. Explicit casts are required. Reported by
- NightStrike from MinGW-w64 project. See
- https://lists.gnu.org/archive/html/freetype/2009-09/msg00000.html
-
- * src/cff/cffgload.c: Convert the pointers to FT_Fixed explicitly.
-
- * src/psaux/t1decode.c: Ditto.
-
-
-2009-09-03 Werner Lemberg <wl@gnu.org>
-
- [raster] Improvements for stand-alone mode.
-
- * src/raster/rules.mk: Don't handle ftmisc.h. It is needed for
- stand-alone mode only.
-
- * src/raster/ftmisc.h (FT_MemoryRec, FT_Alloc_Func, FT_Free_Func,
- FT_Realloc_Func): Copy declarations from ftsystem.h.
-
-2009-09-02 Bram Tassyns <bramt@enfocus.be>
-
- Improve vertical metrics calculation (Savannah bug #27364).
-
- The calculation of `vertBearingX' is not defined in the OTF font
- spec so FreeType does a `best effort' attempt. However, this value
- is defined in the PDF and PostScript specs, and that algorithm is
- better than the one FreeType currently uses:
-
- FreeType: Use the middle of the bounding box as the X coordinate
- of the vertical origin.
-
- Adobe PDF spec: Use the middle of the horizontal advance vector as
- the X coordinate of the vertical origin.
-
- FreeType's algorithm goes wrong if you have a really small glyph
- (like the full-width, circle-like dot at the end of the sentence, as
- used in CJK scripts) with large bearings. With the FreeType
- algorithm this dot gets centered on the baseline; with the PDF
- algorithm it gets the correct location (in the top right). Note
- that this is a serious issue, it's like printing the dot at the end
- of a Roman sentence at the center of the textline instead of on the
- baseline like it should. So i believe the PDF spec's algorithm
- should be used in FreeType as well.
-
- The `vertBearingY' value for such small glyphs is also very strange
- if no `vmtx' information is present, since the height of the bbox is
- not representable for the height of the glyph visually (the
- whitespace up to the baseline is part of the glyph). The fix also
- includes some code for a better estimate of `vertBearingY'.
-
- * src/base/ftobjs.c (ft_synthesize_vertical_metrics): `vertBearingX'
- is now calculated as described by the Adobe PDF Spec. Estimate for
- `vertBearingY' now works better for small glyphs completely above or
- below the baseline into account.
-
- * src/cff/cffgload.c (cff_slot_load): `vertBearingX' is now
- calculated as described by the Adobe PDF Spec. Vertical metrics
- information was always ignored when FT_CONFIG_OPTION_OLD_INTERNALS
- was not defined.
-
- * src/truetype/ttgload.c (compute_glyph_metrics): `vertBearingX' is
- now calculated as described by the Adobe PDF Spec.
-
-2009-09-01 John Tytgat <John.Tytgat@esko.com>
-
- Fix custom cmap for empty Type 1 font (Savannah bug #27294).
-
- * include/freetype/internal/t1types.h (T1_EncodingRecRec_): Update
- comment to reflect revised code_last meaning.
- * src/type1/t1load.c (T1_Open_Face), src/type42/t42objs.c
- (T42_Open_Face): Assign max_char as highest character code + 1 and
- use this for T1_EncodingRecRec_::code_last.
- * src/psaux/t1cmap.c (t1_cmap_custom_init): Follow revised
- T1_EncodingRecRec_::code_last meaning.
-
-2009-08-25 Werner Lemberg <wl@gnu.org>
-
- Fix rendering of horizontally compressed CFFs.
- Bug reported by Ivan Nincic <inincic@pdftron.com>.
-
- * src/cff/cffgload.c (cff_slot_load): Thinko: Check `xx' element of
- `font_matrix' also.
-
- * docs/CHANGES: Updated.
-
-2009-08-03 suyu0925@gmail.com
-
- Don't call `ft_fseek' every time when executing `ft_fread'.
-
- * src/base/ftstream.c (FT_Stream_Seek), src/base/ftsystem.c
- (ft_ansi_stream_io): Implement it.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Cast a charcode to 32-bit in cmap format 14 parser.
-
- * src/sfnt/ttcmap.c (tt_cmap14_char_var_index,
- tt_cmap14_char_var_isdefault, tt_cmap14_char_variants,
- tt_cmap14_variant_chars): Correct mismatches from
- FT_CMap_CharVarIndexFunc prototype, FT_ULong arguments
- are replaced by FT_UInt32 arguments.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Cast a charcode to 32-bit in cmap format 12 parser.
-
- * src/sfnt/ttcmap.c (tt_cmap12_char_next):
- Insert explicit cast from FT_UFast to FT_UInt32
- for return value.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- psaux: Fix a few casts to FT_Int32 value.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings):
- Fix a few casts setting `value' from FT_Long to FT_Int32,
- because `value' is typed as FT_Int32 since 2009-06-22.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Fix a data type mismatching with its source.
-
- * src/sfnt/ttcmap.c (tt_cmap13_char_next): Fix the
- type of `gindex' from FT_ULong to FT_UInt because
- it is set by FT_UInt tt_cmap13_char_map_binary() or
- TT_CMap13->cur_gindex.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Extend a few local variables to load 32-bit values.
-
- * src/sfnt/ttkern.c (tt_face_load_kern): Extend `count'
- and `kern' to load 32-bit values.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pfr: Extend `num_aux' to take 32-bit value.
-
- * src/pfr/pfrload.c (pfr_phy_font_load): Extend
- `num_aux' to load 32-bit value.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pcf: Truncate FT_ULong `nprops' to fit to int PCF_Face->nprops.
-
- * src/pcf/pcfread.c (pcf_get_properties): Load `nprops'
- as FT_ULong value from PCF file, but truncate it as
- int to fit PCF_Face->nprops. The number of truncated
- properties is shown in the trace message.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- gxvalid: Extend a few local variables to reduce the casts.
-
- * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
- Extend `type' and `rest' to take FT_ULong values.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- gxvalid: Extend `settingTable' to take 32-bit offset.
-
- * src/gxvalid/gxvfeat.c (gxv_feat_name_validate):
- Extend `settingTable' to take 32-bit offset.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- autofit: Cast FT_Long glyph_count to compare with FT_UInt GID.
-
- * src/autofit/afglobal.c (af_face_globals_is_digit,
- af_face_globals_compute_script_coverage): Cast FT_Long
- globals->glyph_count to FT_ULong, to compare with FT_UInt
- gindex.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- smooth: Exclude 16-bit system in invalid pitch/height check.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic):
- pitch and height are typed as FT_UInt but checked to fit
- 16-bit range, to avoid the overflows. On 16-bit system,
- this checking inserts a conditional that never occurs.
-
-2009-07-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cff: Type large constants > 0x7FFF as long for 16-bit systems.
-
- * src/cff/cffload.c (cff_charset_load): Type large
- constants > 0x7FFF as long, because normal constants
- are typed signed integer that is less than 0x8000 on
- 16-bit systems.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- base: Remove an unused variable.
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Remove an
- unused variable `library'. glyph->library is used.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cache: Check higher bits in flags for non ILP32 systems.
-
- 4 public functions ought to take FT_ULong flags, but take
- FT_UInt flags. To keep binary compatibility, we drop higher
- bits on non ILP32 platforms,
- ILP64 systems: No drop occurs.
- LP64 systems: Higher bits are not used.
- 16-bit systems: Drop can occur.
- See
- https://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00065.html
- These functions will be refined to take FT_ULong flags in
- next bump with incompatible API change.
-
- * src/cache/ftcbasic.c (FTC_ImageCache_Lookup):
- Check `flags' in `type', the 2nd argument.
- (FTC_SBitCache_Lookup): Ditto.
- (FTC_ImageCache_LookupScaler): Check `load_flags',
- the 3rd argument.
- (FTC_SBitCache_LookupScaler): Ditto.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Ignore invalid GIDs in glyph name lookup.
-
- * include/freetype/internal/fttrace.h:
- New trace module for sfdriver.c is added.
-
- * src/sfnt/sfdriver.c (sfnt_get_name_index):
- Restrict glyph name lookup to FT_UInt GID.
- Genuine TrueType can hold 16-bit glyphs.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pcf: Fix a comparison between FT_Long and FT_ULong.
-
- * src/pcf/pcfread.c (pcf_get_bitmaps): Return an error
- if PCF_Face->nmetrics is negative.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- gxvalid: Guarantee `nFeatureFlags' size up to 32-bit.
-
- * src/gxvalid/gxvmort.c (gxv_mort_featurearray_validate):
- Extend the 3rd argument `nFeatureFlags' to FT_ULong.
- * src/gxvalid/gxvmort.h: Ditto.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Insert explicit cast for LP64 system.
-
- * src/sfnt/ttkern.c (tt_face_load_kern): Insert
- cast from unsigned long to FT_UInt32.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- gxvalid: Guarantee `just' table size upto 32-bit.
-
- * src/gxvalid/gxvjust.c (gxv_just_validate):
- The type of `offset' is changed from FT_UInt to
- FT_Offset, for 16-bit platforms.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- gxvalid: Guarantee `trak' table size upto 32-bit.
-
- * src/gxvalid/gxvtrak.c (gxv_trak_validate):
- The type of `offset' is changed from FT_UInt to
- FT_Offset, for 16-bit platforms.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- type1: Fix a data type mismatching with its source.
-
- * include/freetype/internal/t1types.h: The type of
- T1_Face->buildchar is matched with T1_Decoder->top.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pfr: Fix a data type mismatching with its source.
-
- * src/pfr/pfrtypes.h: The type of PFR_KernItem->offset
- is extended from FT_UInt32 to FT_Offset, because it is
- calculated with the pointer difference, in
- pfr_extra_item_load_kerning_pairs().
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pfr: Fix a data type mismatching with its source.
-
- * src/pfr/pfrtypes.h: The type of PFR_PhyFont->chars_offset
- is extended from FT_UInt32 to FT_Offset, because it is
- calculated with the pointer difference in pfr_phy_font_load().
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pfr: Fix a data type mismatching with its source.
-
- * src/pfr/pfrtypes.h: The type of PFR_PhyFont->bct_offset
- is extended from FT_UInt32 to FT_Long, because it is
- loaded by FT_STREAM_POS() in pfr_phy_font_load().
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- smooth: Improve the format in debug message.
-
- * src/smooth/ftgrays.c (gray_dump_cells): Improve the
- format specifications to dump variables.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Fix a data type mismatching with its source.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): The type of
- local `flags' is matched with FT_Face->face_flags.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- psaux: Fix a data type mismatching with its source.
-
- * include/freetype/internal/psaux.h: The type of
- T1_DecoderRec.buildchar is matched with
- T1_DecoderRec.top.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Extend TrueType GX packed deltas to FT_Offset.
-
- * src/truetype/ttgxvar.c (ft_var_readpackeddeltas):
- The type of 2nd argument `delta_cnt' is changed from
- FT_Int to FT_Offset, because its source can be cvt
- table size calculated from stream position.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Extend mmvar_len to hold size_t values.
-
- * src/truetype/ttgxvar.h: The type of
- GX_BlendRec.mmvar_len is changed from FT_Int to
- FT_Offset, because TT_Get_MM_Var() calculates it
- by sizeof() results.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Check invalid function number in IDEF instruction.
-
- * src/truetype/ttinterp.c (Ins_IDEF): Check
- if the operand fits to 8-bit opcode limitation.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Check invalid function number in FDEF instruction.
-
- * src/truetype/ttinterp.c (Ins_FDEF): Check
- if the operand fits 16-bit function number.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Truncate the deltas of composite glyph at 16-bit values.
-
- * src/truetype/ttgload.c (load_truetype_glyph):
- Insert cast from FT_Long (deltas[i].{x,y}) to
- FT_Int16 in the summation of deltas[] for composite
- glyphs. Because deltas[i] is typed as FT_Pos,
- its component x, y are typed as FT_Long, but
- their sources are always FT_Int16 when they are
- loaded by ft_var_readpackeddeltas(). However,
- the limitation about the summed deltas is unclear.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Truncate the instructions upto 16-bit per a glyph.
-
- * src/truetype/ttgload.c (TT_Hint_Glyph): Truncate
- the instructions upto 16-bit length per a glyph.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Cast the numerical operands to 32-bit for LP64 systems.
-
- * src/truetype/ttinterp.c (Ins_SPHIX, INS_MIAP,
- Ins_MIRP): Insert cast from long (args[], the
- operands passed to TrueType operator) to FT_Int32
- (the argument of TT_MulFix14()).
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Cast the project vector to 32-bit for LP64 system.
-
- * src/truetype/ttinterp.c (Project, DualProject):
- Insert casts from FT_Pos (the arguments `dx', `dy')
- to FT_UInt32 (the argument to TT_DotFix14()).
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Cast the scaling params to 32-bit for LP64 system.
-
- * src/truetype/ttgload.c (TT_Process_Composite_Component):
- Insert casts from long (return value of FT_MulFix()) to
- FT_Int32 (the argument to FT_SqrtFixed()).
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Cast a character code to FT_UInt32 for LP64 system.
-
- * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary,
- tt_cmap14_variants, tt_cmap14_char_variants,
- tt_cmap14_def_char_count, tt_cmap14_get_def_chars,
- tt_cmap14_get_nondef_chars, tt_cmap14_variant_chars)
- Insert casts when FT_UInt32 variable is loaded by
- TT_NEXT_{UINT24|ULONG}. Because most of them are
- compared with FT_UInt32 values in public API, replacing
- FT_UFast is not recommended.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Cast a character code to FT_UInt32 for LP64 system.
-
- * src/sfnt/ttcmap.c (tt_cmap4_init, tt_cmap4_next):
- Insert the casts from unsigned long constant to
- FT_UInt32.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Extend TT_BDF->strings_size to FT_ULong for huge BDF.
-
- * include/freetype/internal/tttypes.h: The type
- of TT_BDF->string_size is extended from FT_UInt32
- to FT_ULong, because BDF specification does not
- restrict the length of string.
- * src/sfnt/ttbdf.c: The scratch variable `strings'
- to load TT_BDF->string_size is matched with
- TT_BDF->string_size.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- psaux: Handle the string length by FT_Offset variables.
-
- * src/psaux/afmparse.c (afm_parser_next_key,
- afm_tokenize, afm_parse_track_kern,
- afm_parse_kern_pairs, afm_parse_kern_data,
- afm_parser_skip_section, afm_parser_parse):
- The length of key is handled by FT_Offset,
- instead of FT_UInt. Although the length of
- PostScript strings or name object is 16-bit,
- AFM_STREAM_KEY_LEN() calculates the length
- from the pointer difference.
-
- * src/psaux/afmparse.h (afm_parser_next_key):
- Ditto.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pcf: Fix some data types mismatching with their sources.
-
- * src/pcf/pcfread.c (pcf_get_bitmaps): The types
- of `nbitmaps', `i', `sizebitmaps' are matched with
- the type of area FT_Bitmap.pitch * FT_Bitmap.rows.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pcf: Handle the string length by size_t variables.
-
- * src/pcf/pcfread.c (pcf_interpret_style): The types
- of nn, len, lengths[4] are changed to size_t, because
- they are loaded by (or compared with) ft_strlen().
-
- * src/pcf/pcfutil.c (BitOrderInvert, TwoByteSwap,
- FourByteSwap): The type of the 2nd argument `nbytes'
- is changed to size_t, for similarity with ANSI C
- string functions.
-
- * src/pcf/pcfdrivr.c (PCF_Glyph_Load): The type of
- `bytes' is changed to FT_Offset, because it is passed
- to FT_ALLOC(), via ft_glyphslot_alloc_bitmap(). At
- least, using unsigned type is better.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pcf: Fix some data types mismatching with their sources.
-
- * src/pcf/pcfread.c (pcf_seek_to_table_type,
- pcf_has_table_type): The type of 3rd argument
- `ntables' is matched with PCF_Toc->count.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- otvalid: Truncate the glyph index to 16-bit.
-
- * src/otvalid/otvalid.c (otv_validate): Checks
- face->num_glyphs does not exceed 16-bit limit,
- pass FT_UInt num_glyphs to backend functions
- otv_{GPOS|GSUB|GDEF|JSTF|MATH}_validate().
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cache: Insert explicit casts for LP64 systems.
-
- * src/cache/ftcbasic.c (FTC_ImageCache_Lookup,
- FTC_SBitCache_Lookup): The type of FTC_ImageType->width
- is FT_Int, so the cast to unsigned larger type FT_ULong
- is introduced for the comparisons with 0x10000L for
- LP64 platform.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cache: Fix some data types mismatching with their sources.
-
- * src/cache/ftccache.h: The type of return value
- by FTC_Node_WeightFunc function is changed to
- FT_Offset. The type of FTC_CacheClass->cache_size
- is changed to FT_Offset, too.
-
- * src/cache/ftccback.h (ft_inode_weight,
- ftc_snode_weight): Ditto.
-
- * src/cache/ftccmap.c (ftc_cmap_node_weight): Ditto.
-
- * src/cache/ftcimage.c (ftc_inode_weight,
- FTC_INode_Weight): Ditto.
-
- * src/cache/ftcsbits.c (ftc_snode_weight,
- FTC_SNode_Weight): Ditto.
-
- * src/cache/ftcmru.h: The type of
- FTC_MruListClass->node_size is changed to FT_Offset,
- because it is passed to FT_ALLOC() to specify the
- size of buffer.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- XXX_cmap_encoding_char_next() return FT_UInt32 values.
-
- * include/freetype/internal/services/svpscmap.h:
- The size of the charcode value returned by
- the function typed PS_Unicodes_CharNextFunc is
- matched with its input charcode value.
-
- * src/cff/cffmap.c (cff_cmap_encoding_char_next,
- cff_cmap_unicode_char_next): Ditto.
-
- * src/pfr/pfrmap.c (pfr_cmap_encoding_char_next):
- Ditto.
-
- * src/psaux/t1cmap.c (t1_cmap_std_char_next,
- t1_cmap_custom_char_next, t1_cmap_unicode_char_next):
- Ditto.
-
- * src/psnames/psmodule.c (ps_unicodes_char_next):
- Ditto.
-
- * src/winfonts/winfnt.c (fnt_cmap_char_next):
- Ditto.
-
- * src/sfnt/ttcmap.c (tt_cmap0_char_next,
- tt_cmap2_char_next, tt_cmap4_char_next,
- tt_cmap6_char_next, tt_cmap10_char_next,
- tt_cmap12_char_next, tt_cmap13_char_next): Ditto.
- (tt_cmap14_char_variants): Handle base unicode
- codepoint by FT_UInt32 variable to avoid overflow
- on 16-bit platforms.
- (tt_cmap14_ensure): The type of `num_results' is
- extend to FT_UInt32, to cover unsigned 32-bit
- `numVarSelectorRecords' in cmap14 table header.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- truetype: Extend TT_Face->num_locations for broken TTFs.
-
- * include/freetype/internal/tttypes.h:
- TT_Face->num_locations are extended from FT_UInt
- to FT_ULong, to stand with broken huge loca table.
- Some people insists there are broken TTF including
- the glyphs over 16-bit limitation, in PRC market.
- * src/truetype/ttpload.c (tt_face_load_loca):
- Remove unrequired 16-bit truncation for FT_UInt
- TT_Face->num_locations.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- smooth: Fix some data types mismatching with their sources.
-
- * src/smooth/ftgrays.c: The type of `TCoord' is
- matched to `TPos', because they are mixed in
- gray_set_cell(). The type of TCell->x is extended
- to `TPos', because gray_find_cell() sets it by
- TWorker.ex. The type of TCell->cover is extended
- to `TCoord', because gray_render_scanline() adds
- TCoord value to it. The type of TWork.cover is matched
- with TCell->cover. The types of
- TWork.{max_cells,num_cells} are changed to FT_PtrDist,
- because they are calculated from the memory addresses.
- The type of TWork.ycount is changed to TPos, because
- it is calculated from TPos variables.
- (gray_find_cell): The type of `x' is matched with
- its initial value ras.ex.
- (gray_render_scanline): The types of `mod', `lift'
- and `rem' are changed to TCoord, because their values
- are set with explicit casts to TCoord. When ras.area
- is updated by the differential values including
- `delta', they are explicitly cast to TArea, because
- the type of `delta' is not TArea but TCoord.
- (gray_render_line): The type of `mod' is extended
- from int to TCoord, because (TCoord)dy is added to mod.
- (gray_hline): The argument `acount' is extended to
- TCoord, to match with the parameters in the callers.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cff: Fix some data types mismatching with their sources.
-
- * src/cff/cffobjs.c (cff_face_init): The type of
- `scaling' is matched with the scaling parameter
- in FT_Matrix_Multiply_Scaled() and
- FT_Vector_Transform_Scaled().
-
- * src/cff/cffparse.c (cff_parse_real): The type of
- `power_ten', `scaling', `exponent_add',
- `integer_length', `fraction_length',
- `new_fraction_length' and `shift' are matched with
- the type of `exponent' to avoid unexpected truncation.
- (cff_parse_fixed_scaled): The type of `scaling' is
- matched with the `scaling' argument to
- cff_parse_real().
- (cff_parse_fixed_dynamic): Ditto.
- (cff_parse_font_matrix): The type of `scaling' is
- matched with the `scaling' argument to
- cff_parse_dynamic().
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- autofit: Fix some data types mismatching with their sources.
-
- * src/autofit/afglobal.c: Correct the type of
- AF_FaceGlobalsRec.glyph_count to match with
- FT_Face->num_glyphs.
- (af_face_globals_compute_script_coverage):
- Insert explicit cast to compare
- FT_Long AF_FaceGlobalsRec.glyph_count versus
- FT_UInt gindex. The type of `nn' is changed
- to scan glyph index upto AF_FaceGlobalsRec.glyph_count.
- (af_face_globals_get_metrics): The type of `script_max'
- is changed to cover size_t value. Insert explicit cast
- to compare FT_Long AF_FaceGlobalsRec.glyph_count versus
- FT_UInt gindex.
-
- * src/autofit/afhints.c (af_axis_hints_new_segment):
- Insert explicit cast to calculate `big_max' from
- integer and size_t values.
- (af_axis_hints_new_edge): Ditto.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues):
- The type of `best_y' is matched to FT_Vector.y.
- (af_latin_compute_stem_width): The type of `delta' is
- matched to `dist' and `org_dist'.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- autofit: Count the size of the memory object by ptrdiff_t.
-
- * src/autofit/afcjk.c (af_cjk_hint_edges): The
- number of edges `n_edges' should be counted by
- FT_PtrDist variable instead of FT_Int.
-
- * src/autofit/aflatin.c (af_latin_hint_edges):
- Ditto.
-
- * src/autofit/aftypes.h: In AF_ScriptClassRec,
- the size of metric `script_metrics_size' should
- be counted by FT_Offset variable instead of FT_UInt.
-
- * src/autofit/afhints.c
- (af_glyph_hints_align_strong_points): The cursors
- for the edges `min', `max', `mid' in the memory
- buffer should be typed FT_PtrDist.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- autofit: Fix for unused variable `first'.
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Insert
- FT_UNUSED() to hide the unused variable warning.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Improve bitmap size or pixel variables for 16-bit systems.
-
- * include/freetype/config/ftstdlib.h: Introduce
- FT_INT_MIN, to use in signed integer overflow in
- 16-bit and 64-bit platforms.
-
- * include/freetype/internal/fttrace.h: Add a tracer
- to ftsynth.c.
-
- * src/base/ftbitmap.c (FT_Bitmap_Embolden): Check
- invalid strength causing integer overflow on 16-bit
- platform.
-
- * src/base/ftcalc.c (ft_corner_orientation): Change
- the internal calculation from FT_Int to FT_Long, to
- avoid an overflow on 16-bit platforms. The caller of
- this function should use only the sign of result,
- so the cast to FT_Int is acceptable.
-
- * src/base/ftsynth.c: Introduce a tracer for synth module.
- (FT_GlyphSlot_Embolden): Check invalid strength causing
- integer overflow on 16-bit platform.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): The glyph index
- in FT2 API is typed as FT_UInt, although BDF driver
- can handle unsigned long glyph index internally. To
- avoid integer overflow on 16-bit platform, too large
- glyph index should be excluded.
- (BDF_Glyph_Load): The glyph pitch in FT2 is typed as
- FT_UInt, although BDF driver can handle unsigned long
- glyph pitch internally. To avoid integer overflow on
- 16-bit platform, too large glyph pitch should not be
- returned.
-
- * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): The glyph
- pitch in FT2 is typed as FT_UInt, although PFR font
- format can include huge bitmap glyph with 24-bit pitch
- (however, a glyph spends 16.7 pixel, it's not realistic).
- To avoid integer overflow on 16-bit platform, huge
- bitmap glyph should be excluded.
-
- * src/smooth/ftgrays.c (gray_hline): As FT_Span.x is
- truncated to fit its type (16-bit short), FT_Span.y
- should be truncated to fit its type (FT_Int).
-
- * src/cff/cffdrivr.c (cff_get_ros): CFF specification
- defines the supplement in ROS as a real number.
- Truncate it to fit public FT2 API.
-
- * src/cff/cffparse.c (cff_parse_cid_ros): Warn the
- supplement if it is truncated or rounded in cff_get_ros().
-
- * src/cff/cfftypes.h: Change the type of internal variable
- `supplement' from FT_Long to FT_ULong to fit the signedness
- to the type in public API.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- psaux: Prevent invalid arguments to afm_parser_read_vals().
-
- * src/psaux/afmparse.c (afm_parser_read_vals): Change
- the type of `n' to prevent negative number how many
- arguments should be parsed.
-
- * src/psaux/afmparse.h (afm_parser_read_vals): Ditto.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- base: Prevent some overflows on LP64 systems.
-
- * src/base/ftadvanc.c (FT_Get_Advances): Cast the
- unsigned long constant FT_LOAD_ADVANCE_ONLY to FT_UInt32
- for LP64 platforms.
-
- * src/base/ftcalc.c (FT_Sqrt32): All internal variables
- are changed to FT_UInt32 from FT_ULong.
- (FT_MulDiv): Insert casts to FT_Int32 for LP64 platforms.
- This function is designed for 32-bit integer, although
- their arguments and return value are FT_Long.
-
- * src/base/ftobjs.c (FT_Get_Char_Index): Check `charcode'
- is within unsigned 32-bit integer for LP64 platforms.
- (FT_Face_GetCharVariantIndex): Check `charcode' and
- `variantSelector' are within 32-bit integer for LP64
- platforms.
- (FT_Face_GetCharsOfVariant): Check `variantSelector' is
- within unsigned 32-bit integer for LP64 platforms.
-
- * src/base/fttrigon.c (ft_trig_downscale): The FT_Fixed
- variable `val' and unsigned long constant FT_TRIG_SCALE
- are cast to FT_UInt32, when calculates FT_UInt32.
- (FT_Vector_Rotate): The long constant 1L is cast to
- FT_Int32 to calculate FT_Int32 `half'.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cff: Cast the long variables to 32-bit for LP64 systems.
-
- * src/cff/cffdrivr.c (cff_get_advances): Insert
- explicit cast to modify a 32-bit flag by unsigned
- long constant.
-
- * src/cff/cffobjs.c (cff_face_init): Ditto.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings):
- Replace the casts to FT_Long by the casts to FT_Int32
- for LP64 platforms.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pcf: Improve PCF_PropertyRec.value names on LP64 platforms.
-
- * src/pcf/pcf.h: In PCF_PropertyRec.value, the member
- `integer' is replaced by `l', `cardinal' is replaced
- by `ul', to fix the difference between the name and
- the types on LP64 platforms.
-
- * src/pcf/pcfdrivr.c (pcf_get_bdf_property): Reflect
- PCF_PropertyRec.value change, with appropriate casts
- to FT_Int32/FT_UInt32. Their destinations
- BDF_PropertyRec.{integer|cardinal} are public and
- explicitly defined as FT_Int32/FT_UInt32.
-
- * src/pcf/pcfread.c (pcf_get_properties, pcf_load_font):
- Reflect PCF_PropertyRec.value change.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- pcf: Fix some data types mismatching with their sources.
-
- * src/pcf/pcfdrivr.c (pcf_cmap_char_index): The type of
- `code' is matched to PCF_Encoding->enc.
- (pcf_cmap_char_next): The type of `charcode' is matched
- to PCF_Encoding->enc. When *acharcode is set by charcode,
- an overflow is checked and cast to unsigned 32-bit
- integer.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- bdf: Improve bdf_property_t.value names for LP64 platforms.
-
- * src/bdf/bdf.h: In bdf_property_t.value, the member
- `int32' is replaced by `l', `card32' is replaced by
- `ul', to fix the difference between the name and the
- types on LP64 platforms.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Reflect
- bdf_property_t.value change.
- (bdf_get_bdf_property): Reflect bdf_property_t.value
- change, with appropriate casts to FT_Int32/FT_UInt32.
- Their destinations BDF_PropertyRec.{integer|cardinal}
- are public and explicitly defined as FT_Int32/FT_UInt32.
-
- * src/bdf/bdflib.c (_bdf_add_property): Reflect
- bdf_property_t.value change.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- bdf: Fix some data types mismatching with their sources.
-
- * src/bdf/bdfdrivr.c (bdf_cmap_char_index): The type
- of `code' is matched with BDF_encoding_el->enc.
- (bdf_cmap_char_next): The type of `charcode' is
- matched with BDF_encoding_el->enc. When *acharcode
- is set by charcode, an overflow is checked and
- cast to unsigned 32-bit integer.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- autofit: Improve Unicode range definitions.
-
- * src/autofit/aftypes.h (AF_UNIRANGE_REC): New macro
- to declare a range by two unsigned 32-bit integer,
- to avoid 64-bit range definition on LP64 platforms.
-
- * src/autofit/aflatin.c (af_latin_uniranges): Ditto.
-
- * src/autofit/aflatin2.c (af_latin2_uniranges): Ditto.
-
- * src/autofit/afindic.c (af_indic_uniranges): Ditto.
-
- * src/autofit/afcjk.c (af_cjk_uniranges): Declare
- the ranges by AF_UNIRANGE_REC.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- smooth: Fix a data type mismatching with its source.
-
- * src/smooth/ftgrays.c (gray_sweep): The type of
- `area' is matched with the 3rd argument `area'
- of gray_hline().
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- smooth: Fix a data type mismatching with its source.
-
- * src/smooth/ftgrays.c (gray_render_line): The type
- of `area' is matched with TWorker.area.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cache: Disable the legacy compatibility if 16-bit system.
-
- * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Exclude
- the legacy behaviour from 16-bit platform, because the
- current hack cannot detect the caller uses this function
- via legacy convention.
- (FTC_SBitCache_Lookup): Ditto.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cache: Check 32-bit glyph index on 16-bit systems.
-
- * src/cache/ftcbasic.c (ftc_basic_family_get_count):
- Check overflow caused by the face including large
- number of glyphs > 64k.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cache: Fix some data types mismatching with their sources.
-
- * src/cache/ftccache.c (ftc_cache_resize): The types of
- `p', `mask', `count' are matched with FTC_Cache->{p,mask}.
- (FTC_Cache_Clear): The type of `old_index' is matched to
- FTC_Cache->{p,mask}.
-
- * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): The type
- of `_idx' is matched with FTC_Cache->{p,mask}.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cache: Fix some data types mismatching with their sources.
-
- * src/cache/ftcsbits.c (ftc_snode_load): The types
- of `xadvance' and `yadvance' are matched with
- FT_GlyphSlot->advance.{x|y}.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cache: Cast NULL to a required function type explicitly.
-
- * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID):
- Insert explicit cast from NULL to function type.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- fttypes.h: Cast FT_MAKE_TAG output to FT_Tag explicitly.
-
- * include/freetype/fttypes.h (FT_MAKE_TAG):
- Cast the result to FT_Tag.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- psnames: Handle Unicode codepoints by FT_UInt32 variables.
-
- * src/psnames/psmodule.c (BASE_GLYPH): Cast the result
- to unsigned 32-bit integer for LP64 platform.
- (ps_unicode_value): Return the value by unsigned 32-bit
- integer instead of unsigned long.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- psaux: Use size_t variable to pass the buffer size.
-
- * src/psaux/psaux.h (to_bytes): The type of `max_bytes'
- (the argument to pass the buffer size) is changed to
- size_t, to match with ANSI C string functions.
-
- * src/psaux/psconv.h (PS_Conv_StringDecode,
- PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto.
-
- * src/psaux/psconv.c (PS_Conv_StringDecode,
- PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Ditto.
-
- * src/psaux/psobjs.h (ps_parser_to_bytes): Ditto.
-
- * src/psaux/psobjs.c (ps_parser_to_bytes): Ditto.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- type1: Use size_t variable to pass the string length.
-
- * psaux.h: The type of `len' (the argument to pass
- the buffer size to the function in AFM_ParserRec)
- is changed to size_t, to match with ANSI C string
- functions.
-
- * t1afm.c (t1_get_index): Ditto.
-
- * test_afm.c (dummy_get_index): Ditto.
-
- * afmparse.c (afm_parser_read_vals): To call
- AFM_ParserRec.get_index, the length of token
- `len' is cast to size_t.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cid: Fix some data types mismatching with their sources.
-
- * src/cid/cidparse.c (cid_parser_new): The types of
- `read_len' and `stream_len' are matched to
- FT_Stream->size. Unrequired cast is removed.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cff: Fix for unused variable `rest'.
-
- * src/cff/cffparse.c (cff_parse_real): Insert
- FT_UNUSED() to hide the unused variable warning.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- cff: Fix some data types mismatching with their sources.
-
- * src/cff/cffgload.c (cff_slot_load): The types of
- `top_upm' and `sub_upm' are matched with
- CFF_FontRecDict->units_per_em.
-
- * src/cff/cffobjs.c (cff_size_select): Ditto.
- (cff_size_request): Ditto.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- bdf: Fix some data types mismatching with their sources.
-
- * bdflib.c (_bdf_list_ensure): The type of `num_items'
- is matched with _bdf_list_t.used. Also the types of
- `oldsize', `newsize', `bigsize' are matched too.
- (_bdf_readstream): `cursor' is used as an offset to
- the pointer, it should be typed as FT_Offset. Also
- the types of `bytes', `start', `end', `avail' are matched.
-
- * bdfdrivr.c: The type of BDF_CMap->num_encodings is
- matched with FT_CMap->clazz->size.
- (bdf_cmap_char_index): The types of `min', `max', `mid'
- are matched with BDF_CMap->num_encodings. The type of
- `result' is matched with encoding->glyph.
- (bdf_cmap_char_next): Ditto, the type of `code' is
- matched with BDF_encoding_el.enc.
- (bdf_interpret_style): The type of `lengths' is changed
- to size_t, to take the value by ft_strlen(). Also the
- types of `len', `nn', `mm' are matched.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- sfnt: Count the size of the memory object by ptrdiff_t.
-
- * src/sfnt/ttbdf.c (tt_face_find_bdf_prop): The type of
- `property_len' is changed from FT_UInt to FT_Offset,
- to match with size_t, which is appropriate type for the
- object in the memory buffer.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- lzw: Count the size of the memory object by ptrdiff_t.
-
- * src/lzw/ftzopen.h: The types of FT_LzwState->{buf_total,
- stack_size} are changed from FT_UInt to FT_Offset, to match
- with size_t, which is appropriate type for the object in
- the memory buffer.
-
- * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): The types of
- `old_size' and `new_size' are changed from FT_UInt to
- FT_Offset, to match with size_t, which is appropriate type
- for the object in the memory buffer.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- otvalid: Count the table size on memory by ptrdiff_t.
-
- * src/otvalid/otvgpos.c (otv_ValueRecord_validate):
- Change the type of table size from FT_UInt to
- FT_PtrDist because it is calculated by the memory
- addresses.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- otvalid: Prevent an overflow by GPOS/GSUB 32b-bit offset.
-
- * src/otvalid/otvgpos.c (otv_ExtensionPos_validate):
- Extend ExtensionOffset from FT_UInt to FT_ULong, to
- cover 32-bit offset on 16-bit platform.
-
- * src/otvalid/otvgsub.c (otv_ExtensionSubst_validate):
- Ditto.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- ftobjs.c: Prevent an overflow in glyph index handling.
-
- * src/base/ftobjs.c (FT_Face_GetCharsOfVariant):
- Improve the cast in comparison to avoid the truncation.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Improve the variable types in raccess_make_file_name().
-
- * src/base/ftrfork.c (raccess_make_file_name):
- Change the type of cursor variable `tmp' to const char*,
- to prevent the unexpected modification of original pathname.
- (raccess_make_file_name): Change the type of new_length
- to size_t.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- ftpatent.c: Fix for unused variable `error'.
-
- * src/base/ftpatent.c (_tt_check_patents_in_range):
- Fix warning for unused variable `error'.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- type1: Check invalid string longer than PostScript limit.
-
- * src/type1/t1afm.c (t1_get_index): Check invalid string
- which exceeds the limit of PostScript string/name objects.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- gzip: Use FT2 zcalloc() & zfree() in ftgzip.c by default.
-
- * src/gzip/ftgzip.c (zcalloc, zcfree): Disable all
- zcalloc() & zfree() by zlib in zutil.c, those in
- ftgzip.c by FT2 are enabled by default. To use
- zlib zcalloc() & zfree(), define USE_ZLIB_ZCALLOC.
- See discussion:
- https://lists.gnu.org/archive/html/freetype-devel/2009-02/msg00000.html
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- gzip: Distinguish PureC from TurboC on MSDOS.
-
- * src/gzip/zutil.c (zcalloc, zcfree): Enable only for
- MSDOS platform.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- gxvalid: Insert PureC pragma to allow unevaluated variables.
-
- * builds/atari/ATARI.H: Insert PureC pragma not to
- warn against set-but-unevaluated variable in gxvalid
- module.
-
-2009-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- gxvalid: Pass the union by the pointer instead of the value.
-
- * src/gxvalid/gxvcommn.h:
- - Declare new type `GXV_LookupValueCPtr'.
- - Update the type of the 2nd argument to pass GXV_LookupValueDesc
- data to the function prototyped as GXV_Lookup_Value_Validate_Func,
- from GXV_LookupValueDesc to GXV_LookupValueCPtr.
- - Likewise for the function prototyped as
- GXV_Lookup_Fmt4_Transit_Func.
-
- - Declare new type `GXV_StateTable_GlyphOffsetCPtr'.
- - Update the type of the 3rd argument to pass
- GXV_StateTable_GlyphOffsetDesc data to the function prototyped
- as GXV_StateTable_Entry_Validate_Func, from
- GXV_StateTable_GlyphOffsetDesc to GXV_StateTable_GlyphOffsetCPtr.
-
- - Declare new type `GXV_XStateTable_GlyphOffsetCPtr'.
- - Update the type of the 3rd argument to pass
- GXV_XStateTable_GlyphOffsetDesc data to the function prototyped
- as GXV_XStateTable_Entry_Validate_Func,
- from GXV_XStateTable_GlyphOffsetDesc
- to GXV_XStateTable_GlyphOffsetCPtr.
-
- * src/gxvalid/gxvcommn.c (gxv_LookupTable_fmt0_validate,
- gxv_XClassTable_lookupval_validate,
- gxv_XClassTable_lookupfmt4_transit):
- Update from GXV_LookupValueDesc to GXV_LookupValueCPtr.
-
- * src/gxvalid/gxvbsln.c (gxv_bsln_LookupValue_validate,
- gxv_bsln_LookupFmt4_transit): Ditto.
-
- * src/gxvalid/gxvjust.c
- (gxv_just_pcTable_LookupValue_entry_validate,
- gxv_just_classTable_entry_validate,
- gxv_just_wdcTable_LookupValue_validate): Ditto.
-
- * src/gxvalid/gxvkern.c
- (gxv_kern_subtable_fmt1_entry_validate): Ditto.
-
- * src/gxvalid/gxvlcar.c (gxv_lcar_LookupValue_validate,
- gxv_lcar_LookupFmt4_transit): Ditto.
-
- * src/gxvalid/gxvopbd.c (gxv_opbd_LookupValue_validate,
- gxv_opbd_LookupFmt4_transit): Ditto.
-
- * src/gxvalid/gxvprop.c (gxv_prop_LookupValue_validate,
- gxv_prop_LookupFmt4_transit): Ditto.
-
- * src/gxvalid/gxvmort4.c
- (gxv_mort_subtable_type4_lookupval_validate): Ditto.
-
- * src/gxvalid/gxvmort0.c
- (gxv_mort_subtable_type0_entry_validate): Update
- from GXV_StateTable_GlyphOffsetDesc
- to GXV_StateTable_GlyphOffsetCPtr.
-
- * src/gxvalid/gxvmort1.c
- (gxv_mort_subtable_type1_entry_validate): Ditto.
-
- * src/gxvalid/gxvmort2.c
- (gxv_mort_subtable_type2_entry_validate): Ditto.
-
- * src/gxvalid/gxvmort5.c
- (gxv_mort_subtable_type5_entry_validate): Ditto.
-
- * src/gxvalid/gxvmorx2.c
- (gxv_morx_subtable_type2_entry_validate): Ditto.
-
- * src/gxvalid/gxvmorx5.c
- (gxv_morx_subtable_type5_entry_validate): Ditto.
-
- * src/gxvalid/gxvmorx1.c
- (gxv_morx_subtable_type1_entry_validate): Ditto.
- (gxv_morx_subtable_type1_LookupValue_validate,
- gxv_morx_subtable_type1_LookupFmt4_transit):
- Update from GXV_LookupValueDesc to GXV_LookupValueCPtr.
-
- * src/gxvalid/gxvmorx0.c
- (gxv_morx_subtable_type0_entry_validate): Update
- from GXV_XStateTable_GlyphOffsetDesc
- to GXV_XStateTable_GlyphOffsetCPtr.
-
-2009-07-29 Fabrice Bellet <fabrice@bellet.info>
-
- Fix Redhat bugzilla #513582 and Savannah bug #26849.
-
- * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP) <FTC_INLINE>: Fix
- aliasing bug.
-
-2009-07-19 Werner Lemberg <wl@gnu.org>
-
- Document recent library changes.
-
- * docs/CHANGES: Do it.
-
-2009-07-17 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #23786.
-
- * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't reset x_ppem
- and y_ppem. Otherwise the `*_CVT_Stretched' functions in ttinterp.c
- get never called.
- An anonymous guy suggested this change on Savannah, and it seems to
- be the right solution.
-
-2009-07-15 Werner Lemberg <wl@gnu.org>
-
- * docs/release: Updated.
-
-2009-07-15 Werner Lemberg <wl@gnu.org>
-
- README.CVS -> README.git
-
- * README.CVS: Renamed to...
- * README.git: This.
- Updated.
-
-2009-07-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Borland C++ compiler patch proposed by Mirco Babin.
- https://lists.gnu.org/archive/html/freetype/2009-07/msg00016.html.
-
- * builds/exports.mk: Delete unused flags, CCexe_{CFLAGS,LDFLAGS}.
- Fix APINAMES_C and APINAMES_EXE pathnames to reflect the platform
- specific pathname syntax.
- * builds/compiler/bcc.mk: Remove unused flag, CCexe_LDFLAGS.
- Define TE = `-e' separately (bcc32 cannot specify the pathname of
- binary executable by T = `-o').
- Extend the large page size in linking freetype.lib.
- Add extra CLEAN target to delete bcc specific temporary files.
- * builds/compiler/bcc-dev.mk: Ditto.
-
-2009-07-14 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #27026.
-
- * builds/win32/vc2005/freetype.sln: Use correct version number.
-
-2009-07-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Add a script to check the undefined and unused trace macros.
-
- * src/tools/chktrcmp.py: A script to check trace_XXXX macros
- that are used in C source but undefined in fttrace.h, or
- defined in fttrace.h but unused in C sources. See
- https://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html.
- * docs/DEBUG: Mention on chktrcmp.py.
- * docs/release: Ditto.
-
-2009-07-09 Werner Lemberg <wl@gnu.org>
-
- [ftraster] Make it compile again with -D_STANDALONE_.
-
- * src/raster/ftraster.c [_STANDALONE_]: Define
- FT_CONFIG_STANDARD_LIBRARY_H.
- Include `string.h'.
- Don't include `rastpic.h'.
- Define FT_DEFINE_RASTER_FUNCS.
-
-2009-07-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- smooth: Check glyph size by width/height, instead of pitch/height.
- Suggested by der Mouse <mouse@Rodents-Montreal.ORG>.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Improve
- the check for too large glyph. Replace the pair of `pitch' and
- `height' by the pair of `width' and `height'. `pitch' cannot
- be greater than `height'. The required is checking the product
- `pitch' * `height' <= FT_ULONG_MAX, but we use cheap checks for
- the realistic case only.
-
-2009-07-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Register 2 missing trace components, t1afm and ttbdf.
-
- * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( t1afm )
- and FT_TRACE_DEF( ttbdf ). See
- https://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00013.html
-
-2009-07-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Register a trace component for ftgloadr.c.
-
- * include/freetype/internal/fttrace.h: Add FT_TRACE_DEF( gloader ).
- The macro `trace_gloader' was already used in the initial version
- on 2002-02-24.
-
-2009-07-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Prevent the overflows by a glyph with too many points or contours.
- The bug is reported by Boris Letocha <b.letocha@gmc.net>. See
- https://lists.gnu.org/archive/html/freetype-devel/2009-06/msg00031.html
- https://lists.gnu.org/archive/html/freetype-devel/2009-07/msg00002.html
-
- * include/freetype/ftimage.h (FT_OUTLINE_CONTOURS_MAX,
- FT_OUTLINE_POINTS_MAX): New macros to declare the maximum
- values of FT_Outline.{n_contours,n_points}.
- * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Check the
- total numbers of points and contours cause no overflows in
- FT_Outline.{n_contours,n_points}.
-
- * include/freetype/internal/ftgloadr.h (FT_GLYPHLOADER_CHECK_P,
- FT_GLYPHLOADER_CHECK_C): Compare the numbers of points and
- contours as unsigned long number, instead of signed int, to
- prevent the overflows on 16-bit systems.
-
-2009-07-05 Bram Tassyns <bramt@enfocus.be>
-
- Improve compatibility to Acroread.
- This fixes Savannah bug #26944.
-
- * src/cff/cffload.c (cff_charset_compute_cids): For multiple GID to
- single CID mappings, make the lowest value win.
-
-2009-06-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- ftpatent: Fix a bug by wrong usage of service->table_info().
- https://lists.gnu.org/archive/html/freetype-devel/2008-12/msg00039.html
-
- * include/freetype/internal/services/svsfnt.h: Extend
- FT_SFNT_TableInfoFunc() to take new argument to obtain the offset
- to the specified table.
- * src/sfnt/sfdriver.c (sfnt_table_info): Extend to return the
- table-offset to the caller function.
- * src/base/ftpatent.c (_tt_check_patents_in_table): Use new
- service->table_info().
- * src/base/ftobjs.c (FT_Sfnt_Table_Info): Synchronize to new
- service->table_info().
-
-2009-06-28 Werner Lemberg <wl@gnu.org>
-
- [psaux, cff] Protect against nested `seac' calls.
-
- * include/freetype/internal/psaux.h (T1_Decoder), src/cff/cffgload.h
- (CFF_Decoder): Add `seac' boolean variable.
-
- * src/cff/cffgload.c (cff_operator_seac), src/psaux/t1decode.c
- (t1operator_seac): Use it.
-
-2009-06-28 Werner Lemberg <wl@gnu.org>
-
- Thinko.
-
- * src/psaux/t1decode.c (t1operator_seac)
- [FT_CONFIG_OPTION_INCREMENTAL]: Test for existence of incremental
- interface.
-
-2009-06-28 Werner Lemberg <wl@gnu.org>
-
- * devel/ftoption.h [FT_CONFIG_OPTION_INCREMENTAL]: Define.
-
-2009-06-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Add tools to preprocess the source files for AtariST PureC.
-
- * builds/atari/deflinejoiner.awk: New file to filter C source files
- for broken C preprocessor of PureC compiler.
-
- * builds/atari/gen-purec-patch.sh: New file to generate a patch set
- for PureC, by using deflinejoiner.awk.
-
-2009-06-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Keep existing modules.cfg in the building tree.
-
- * configure: If `configure' is executed outside of the source tree,
- an existing `modules.cfg' file in the build directory should be
- kept, not overwritten by the version in the source tree.
-
-2009-06-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Filter --srcdir= option before invoking builds/unix/configure.
-
- * configure: If builds/unix/configure is invoked with --srcdir
- option, the option should take `builds/unix' directory instead of
- the top source directory. Thus the configure script in the top
- directory should modify the --srcdir= option if
- `builds/unix/configure' is invoked.
-
-2009-06-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Improve configure.raw for cross-building on exe-suffixed systems.
-
- * builds/unix/configure.raw: Fix a bug in sed script to extract
- native suffix for binary executables, patch by Peter Breitenlohner.
- https://lists.gnu.org/archive/html/freetype-devel/2009-04/msg00036.html
-
-2009-06-26 Werner Lemberg <wl@gnu.org>
-
- [truetype] Remove TT_SubGlyphRec.
-
- * src/truetype/ttobjs.h (TT_SubGlyphRec): Removed, unused.
-
-2009-06-26 Werner Lemberg <wl@gnu.org>
-
- * */*: For warning messages, replace FT_ERROR with FT_TRACE0.
-
- FT_ERROR is now used only if a function produces a non-zero `error'
- value.
-
- Formatting, improving and harmonizing debug strings.
-
-2009-06-25 Werner Lemberg <wl@gnu.org>
-
- Provide version information better.
-
- * src/base/ftinit.c (FT_Init_FreeType): Don't set version here
- but...
- * src/base/ftobjs.c (FT_New_Library): Here.
-
-2009-06-22 Werner Lemberg <wl@gnu.org>
-
- Use 16.16 format while parsing Type 1 charstrings.
- This fixes Savannah bug #26867.
-
- Previously, only integers have been used which can lead to serious
- rounding errors.
-
- However, fractional values are only used internally; after the
- charstrings (of either Type 1 or 2) have been processed, the
- resulting coordinates get rounded to integers currently -- before
- applying scaling. This should be fixed; at the same time a new load
- flag should be introduced, to be used in combination with
- FT_LOAD_NO_SCALE, which indicates that font units are returned in
- 16.16 format. Similarly, the incremental interface should be
- extended to allow fractional values for metrics.
-
- * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `shift'
- field.
- * include/freetype/internal/pshints.h (T1_Hints_SetStemFunc,
- T1_Hints_SetStem3Func): Use FT_Fixed for coordinates.
-
- * src/psaux/psobjs.c: Include FT_INTERNAL_CALC_H.
- (t1_build_add_point): Always convert fixed to integer.
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings):
- Use 16.16 format everywhere (except for large integers followed by a
- `div').
- [CAN_HANDLE_NON_INTEGRAL_T1_OPERANDS]: Remove #ifdef and activate
- code unconditionally.
- Add support for random numbers and update remaining code
- accordingly; this should work now.
- (t1operator_seac): Updated.
- * src/psaux/pshrec.c: Include FT_INTERNAL_CALC_H.
- (ps_hints_t1stem3, t1_hints_stem): Updated.
-
- * src/cid/cidgload.c: Include FT_INTERNAL_CALC_H.
- (cid_load_glyph) [FT_CONFIG_OPTION_INCREMENTAL],
- (cid_face_compute_max_advance, cid_slot_load_glyph): Updated.
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String)
- [FT_CONFIG_OPTION_INCREMENTAL], (T1_Get_Advances, T1_Load_Glyph):
- Updated.
- * src/type1/t1load.c: Include FT_INTERNAL_CALC_H.
- * src/type1/t1objs.c (T1_Face_Init): Updated.
-
-2009-06-21 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshrec.c: Use PSH_Err_Ok.
-
-2009-06-21 Werner Lemberg <wl@gnu.org>
-
- Code beautification.
-
- * src/type1/t1load.c (FT_INT_TO_FIXED): Removed.
- Replace everywhere with INT_TO_FIXED.
- (FT_FIXED_TO_INT): Move to ...
- * include/freetype/internal/ftcalc.h (FIXED_TO_INT): Here.
- Update all users.
-
-2009-06-20 Werner Lemberg <wl@gnu.org>
-
- Remove unused variables.
-
- * include/freetype/internal/psaux.h (T1_BuilderRec),
- src/cff/cffgload.h (CFF_Builder): Remove `last'.
- Update all users.
-
-2009-06-20 Werner Lemberg <wl@gnu.org>
-
- [psaux] Check large integers while parsing charstrings.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Large
- integers must be followed by a `div' operator.
-
-2009-06-20 Werner Lemberg <wl@gnu.org>
-
- [cff] Revert last change.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Do it.
- Next time, don't confuse Type 2 charstring opcodes with TOP DICT
- values...
-
-2009-06-20 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_metrics_check_digits): Fix
- compiler warning.
-
-2009-06-20 Werner Lemberg <wl@gnu.org>
-
- * builds/compiler/gcc.mk (CFLAGS): Use -O3, not -O6.
-
-2009-06-19 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix handling of reserved byte 0xFF.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Abort if byte
- 0xFF is encountered.
-
-2009-06-19 Werner Lemberg <wl@gnu.org>
-
- Improve debug messages for Type1 charstrings.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Emit newlines
- after instructions.
- Prettify output.
-
-2009-06-19 Werner Lemberg <wl@gnu.org>
-
- More ftgray fixes for FT_STATIC_RASTER.
- Problems reported by suyu@cooee.cn.
-
- * src/smooth/ftgrays.c (gray_move_to, gray_raster_render): Use
- RAS_VAR.
-
-2009-06-18 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2009-06-18 Werner Lemberg <wl@gnu.org>
-
- Fix B/W rasterization of subglyphs with different drop-out modes.
-
- Normally, the SCANMODE instruction (if present) to set the drop-out
- mode in a TrueType font is located in the `prep' table only and thus
- valid for all glyphs. However, there are fonts like `pala.ttf'
- which additionally contain this instruction in the hinting code of
- some glyphs (but not all). As a result it can happen that a
- composite glyph needs multiple drop-out modes for its subglyphs
- since the rendering state gets reset for each subglyph.
-
- FreeType collects the hinted outlines from all subglyphs, then it
- sends the data to the rasterizer. It also sends the drop-out mode
- -- after hinting has been applied -- and here is the error: It sends
- the drop-out mode of the last subglyph only; drop-out modes of all
- other subglyphs are lost.
-
- This patch fixes the problem; it adds a second, alternative
- mechanism to pass the drop-out mode: For each contour, the
- rasterizer now checks the first `tags' array element. If bit 2 is
- set, bits 5-7 contain the contour's drop-out mode, overriding the
- global drop-out mode.
-
- * include/freetype/ftimage.h (FT_CURVE_TAG_HAS_SCANMODE): New macro.
-
- * src/truetype/ttgload.c (TT_Hint_Glyph): Store drop-out mode in
- `tags[0]'.
-
- * src/raster/ftraster.c (Flow_Up, Overshoot_Top, Overshoot_Bottom):
- Use bits 3-5 instead of 0-2.
- (New_Profile): Set the drop-out mode in the profile's `flags' field.
- (Decompose_Curve): Check `tags[0]' and set `dropOutControl' if
- necessary.
- (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
- Horizontal_Gray_Sweep_Drop, Draw_Sweep): Use the profile's drop-out
- mode.
-
-2009-06-16 Werner Lemberg <wl@gnu.org>
-
- Improve scan conversion rules 4 and 6.
-
- Two new constraints are introduced to better identify a `stub' -- a
- concept which is only vaguely described in the OpenType
- specification. The old code was too rigorous and suppressed more
- pixel than it should.
-
- . The intersection of the two profiles with the scanline is less
- than a half pixel. Code related to this was already present in
- the sources but has been commented out.
-
- . The endpoint of the original contour forming a profile has a
- distance (`overshoot') less than half a pixel to the scanline.
-
- Note that the two additional conditions fix almost all differences
- to the Windows rasterizer, but some problematic cases remain.
-
- * src/raster/ftraster.c (Overshoot_Top, Overshoot_Bottom): New
- macros for the `flags' field in the `TProfile' structure.
- (IS_BOTTOM_OVERSHOOT, IS_TOP_OVERSHOOT): New macros.
- (New_Profile, End_Profile): Pass overshoot flag as an argument and
- set it accordingly.
- Update callers.
- (Vertical_Sweep_Drop, Horizontal_Sweep_Drop): Implement the two new
- constraints.
-
-2009-06-11 Werner Lemberg <wl@gnu.org>
-
- Increase precision for B/W rasterizer.
-
- * src/raster/ftraster.c (Set_High_Precision): Add two more bits to
- the precision. This corrects rendering of some small glyphs, for
- example, glyph `xi' in verdana.ttf at 13 ppem. Testing with ftbench
- on my GNU/Linux box I don't see a performance degradation.
-
-2009-06-08 Michael Zucchi <notzed@gmail.com>
-
- Handle FT_STROKER_LINECAP_BUTT.
- This fixes Savannah bug #26757.
-
- * src/base/ftstroke.c (ft_stroker_cap): Implement it.
-
-2009-06-07 Harald Fernengel <harry@kdevelop.org>
-
- Fix some potential out-of-memory crashes.
-
- * src/base/ftobjs.c (ft_glyphslot_done): Check `slot->internal'.
- * src/base/ftstream.c (FT_Stream_ReleaseFrame): Check `stream'.
- * src/truetype/ttinterp.c (TT_New_Context): Avoid double-free of
- `exec' in case of failure.
-
-2009-06-07 Werner Lemberg <wl@gnu.org>
-
- Simplify math.
- Suggested by Alexei Podtelezhnikov <apodtele@gmail.com>.
-
- * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
- Horizontal_Gray_Sweep_Drop): Do it.
-
-2009-06-04 Werner Lemberg <wl@gnu.org>
-
- Preparation for fixing scan conversion rules 4 and 6.
-
- * src/raster/ftraster.c (TFlow): Replace enumeration with...
- (Flow_Up): This macro.
- (TProfile): Replace `flow' member with `flags' bit field.
- Update all affected code.
-
-2009-05-29 James Cloos <cloos@jhcloos.com>
-
- Enable autohinting for glyphs rotated by multiples of 90°.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Alter check for permitted
- matrices to allow rotations by multiples of 90°, not only unrotated,
- possibly slanted matrices.
-
-2009-05-28 Werner Lemberg <wl@gnu.org>
-
- Remove compiler warning.
- Reported by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
-
- * src/autofit/aflatin2.c (af_latin2_hint_edges): Move declaration of
- `n_edges' into `#if' block.
-
-2009-05-28 Werner Lemberg <wl@gnu.org>
-
- Make compilation work with FT_CONFIG_OPTION_USE_ZLIB not defined.
- Reported by Krzysztof Kowalczyk <kkowalczyk@gmail.com>.
-
- * src/pcf/pcfdrivr.c (PCF_Face_Init) [!FT_CONFIG_OPTION_USE_ZLIB]:
- Make it work.
- Simplify #ifdef logic.
-
-2009-05-22 Werner Lemberg <wl@gnu.org>
-
- Improve b/w rasterizer.
- Problem reported by Krzysztof Kotlenga <pocek@users.sf.net>.
-
- * src/raster/raster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
- Horizontal_Gray_Sweep_Drop): For smart drop-out mode, if
- intersections are equally distant relative to next pixel center,
- select the left pixel, not the right one.
-
-2009-05-19 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #26600.
-
- * src/type42/t42parse.c (t42_load_keyword): Handle
- T1_FIELD_LOCATION_FONT_EXTRA.
-
-2009-04-30 Werner Lemberg <wl@gnu.org>
-
- Document recent changes to ftview.
-
- * docs/CHANGES: Do it.
-
-2009-04-27 Werner Lemberg <wl@gnu.org>
-
- autohinter: Don't change digit widths if all widths are the same.
- This fixes FreeDesktop bug #21197.
-
- * src/autofit/afglobal.c (AF_DIGIT): New macro.
- (af_face_globals_compute_script_coverage): Mark ASCII digits in
- `glyph_scripts' array.
- (af_face_globals_get_metrics): Updated.
- (af_face_globals_is_digit): New function.
- * src/autofit/afglobal.h: Updated.
- (AF_ScriptMetricsRec): Add `digits_have_same_width' flag.
-
- * src/autofit/aflatin.c: Include FT_ADVANCES_H.
- (af_latin_metrics_check_digits): New function.
- (af_latin_metrics_init): Use it.
- * src/autofit/aflatin.h: Updated.
- * src/autofit/afcjk.c (af_cjk_metrics_init): Updated.
-
- * src/autofit/aflatin2.c: Similar changes as with aflatin.c.
-
- * src/autofit/afloader.c (af_loader_load_g): Test digit width.
-
- * docs/CHANGES: Document it.
-
-2009-04-26 Werner Lemberg <wl@gnu.org>
-
- Make ftgrays compile with _STANDALONE_ and FT_STATIC_RASTER again.
- Problems reported by suyu@cooee.cn.
-
- * src/smooth/ftgrays.c (FT_DEFINE_OUTLINE_FUNCS,
- FT_DEFINE_RASTER_FUNCS) [_STANDALONE_]: Define.
- [!_STANDALONE_]: Include ftspic.h only here.
- (ras): Define/declare after definition of `TWorker'.
- Use `RAS_VAR_' where necessary.
-
-2009-04-21 Karl Berry <karl@gnu.org>
-
- Fix AC_CHECK_FT2.
-
- * builds/unix/freetype2.m4: Only check PATH for freetype-config if
- we did not already find it from a prefix option.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Add #error to modules and files that do not support PIC yet.
-
- When FT_CONFIG_OPTION_PIC is defined the following files will
- create #error:
- * src/bdf/bdfdrivr.h
- * src/cache/ftcmanag.c
- * src/cid/cidriver.h
- * src/gxvalid/gxvmod.h
- * src/gzip/ftgzip.c
- * src/lzw/ftlzw.c
- * src/otvalid/otvmod.h
- * src/pcf/pcfdrivr.h
- * src/pfr/pfrdrivr.h
- * src/psaux/psauxmod.h
- * src/type1/t1driver.h
- * src/type42/t42drivr.h
- * src/winfonts/winfnt.h
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Position Independent Code (PIC) support in autofit module.
-
- * include/freetype/internal/autohint.h add macros to init
- instances of FT_AutoHinter_ServiceRec.
-
- * src/autofit/afmodule.h declare autofit_module_class
- using macros from ftmodapi.h,
- when FT_CONFIG_OPTION_PIC is defined create and destroy
- functions will be declared.
- * src/autofit/afmodule.c when FT_CONFIG_OPTION_PIC is defined
- af_autofitter_service and autofit_module_class structs
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
- And macros will be used from afpic.h in order to access them.
-
- * src/autofit/aftypes.h add macros to init and declare
- instances of AF_ScriptClassRec.
-
- * src/autofit/afcjk.h declare af_cjk_script_class
- using macros from aftypes.h,
- when FT_CONFIG_OPTION_PIC is defined init function will be declared.
- * src/autofit/afcjk.c when FT_CONFIG_OPTION_PIC is defined
- af_cjk_script_class struct will have function to init it instead of
- being allocated in the global scope.
-
- * src/autofit/afdummy.h declare af_dummy_script_class
- using macros from aftypes.h,
- when FT_CONFIG_OPTION_PIC is defined init function will be declared.
- * src/autofit/afdummy.c when FT_CONFIG_OPTION_PIC is defined
- af_dummy_script_class struct will have function to init it instead of
- being allocated in the global scope.
-
- * src/autofit/afindic.h declare af_indic_script_class
- using macros from aftypes.h,
- when FT_CONFIG_OPTION_PIC is defined init function will be declared.
- * src/autofit/afindic.c when FT_CONFIG_OPTION_PIC is defined
- af_indic_script_class struct will have function to init it instead of
- being allocated in the global scope.
-
- * src/autofit/aflatin.h declare af_latin_script_class
- using macros from aftypes.h,
- when FT_CONFIG_OPTION_PIC is defined init function will be declared.
- * src/autofit/aflatin.c when FT_CONFIG_OPTION_PIC is defined
- af_latin_script_class struct will have function to init it instead of
- being allocated in the global scope.
- Change af_latin_blue_chars to be PIC-compatible by being a two
- dimensional array rather than array of pointers.
-
-
- * src/autofit/aflatin2.h declare af_latin2_script_class
- using macros from aftypes.h,
- when FT_CONFIG_OPTION_PIC is defined init function will be declared.
- * src/autofit/aflatin2.c when FT_CONFIG_OPTION_PIC is defined
- af_latin2_script_class struct will have function to init it instead of
- being allocated in the global scope.
- Change af_latin2_blue_chars to be PIC-compatible by being a two
- dimensional array rather than array of pointers.
-
- * src/autofit/afglobal.c when FT_CONFIG_OPTION_PIC is defined
- af_script_classes array initialization was moved to afpic.c and
- is later referred using macros defined in afpic.h.
-
- New Files:
- * src/autofit/afpic.h declare struct to hold PIC globals for autofit
- module and macros to access them.
- * src/autofit/afpic.c implement functions to allocate, destroy and
- initialize PIC globals for autofit module.
-
- * src/autofit/autofit.c add new file to build: afpic.c.
- * src/autofit/jamfile add new files to FT2_MULTI build: afpic.c.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Position Independent Code (PIC) support in pshinter module.
-
- * include/freetype/internal/pshints.h add macros to init
- instances of PSHinter_Interface.
-
- * src/pshinter/pshmod.h declare pshinter_module_class
- using macros from ftmodapi.h,
- when FT_CONFIG_OPTION_PIC is defined create and destroy
- functions will be declared.
- * src/pshinter/pshmod.c when FT_CONFIG_OPTION_PIC is defined
- pshinter_interface and pshinter_module_class structs
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
- And macros will be used from pshpic.h in order to access them.
-
- New Files:
- * src/pshinter/pshpic.h declare struct to hold PIC globals for pshinter
- module and macros to access them.
- * src/pshinter/pshpic.c implement functions to allocate, destroy and
- initialize PIC globals for pshinter module.
-
- * src/pshinter/pshinter.c add new file to build: pshpic.c.
- * src/pshinter/jamfile add new files to FT2_MULTI build: pshpic.c.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Position Independent Code (PIC) support in psnames module.
-
- * include/freetype/internal/services/svpscmap.h add macros to init
- instances of FT_Service_PsCMapsRec.
-
- * src/psnames/psmodule.h declare psnames_module_class
- using macros from ftmodapi.h,
- when FT_CONFIG_OPTION_PIC is defined create and destroy
- functions will be declared.
- * src/psnames/psmodule.c when FT_CONFIG_OPTION_PIC is defined
- pscmaps_interface and pscmaps_services structs
- and psnames_module_class array
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
- And macros will be used from pspic.h in order to access them.
-
- New Files:
- * src/psnames/pspic.h declare struct to hold PIC globals for psnames
- module and macros to access them.
- * src/psnames/pspic.c implement functions to allocate, destroy and
- initialize PIC globals for psnames module.
-
- * src/psnames/psnames.c add new file to build: pspic.c.
- * src/psnames/jamfile add new files to FT2_MULTI build: pspic.c.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Position Independent Code (PIC) support in raster renderer.
-
- * src/raster/ftrend1.h declare ft_raster1_renderer_class
- and ft_raster5_renderer_class
- using macros from ftrender.h,
- when FT_CONFIG_OPTION_PIC is defined create and destroy
- functions will be declared.
- * src/smooth/ftrend1.c when FT_CONFIG_OPTION_PIC is defined
- ft_raster1_renderer_class and ft_raster5_renderer_class structs
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
- Macros will be used from rastpic.h in order to access
- ft_standard_raster from the pic_container (allocated in ftraster.c).
- In ft_raster1_render when PIC is enabled, the last letter of
- module_name is used to verify the renderer class rather than the
- class pointer.
-
- * src/raster/ftraster.c when FT_CONFIG_OPTION_PIC is defined
- ft_standard_raster struct will have function to init it
- instead of being allocated in the global scope.
-
- New Files:
- * src/raster/rastpic.h declare struct to hold PIC globals for raster
- renderer and macros to access them.
- * src/raster/rastpic.c implement functions to allocate, destroy and
- initialize PIC globals for raster renderer.
-
- * src/raster/raster.c add new file to build: rastpic.c.
- * src/raster/jamfile add new files to FT2_MULTI build: rastpic.c.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Position Independent Code (PIC) support in smooth renderer.
-
- * src/smooth/ftsmooth.h declare ft_smooth_renderer_class,
- ft_smooth_lcd_renderer_class and ft_smooth_lcdv_renderer_class
- using macros from ftrender.h,
- when FT_CONFIG_OPTION_PIC is defined create and destroy
- functions will be declared.
- * src/smooth/ftsmooth.c when FT_CONFIG_OPTION_PIC is defined
- the following structs:
- ft_smooth_renderer_class, ft_smooth_lcd_renderer_class
- and ft_smooth_lcdv_renderer_class
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
- And macros will be used from ftspic.h in order to access
- ft_grays_raster from the pic_container (allocated in ftgrays.c).
-
- * src/smooth/ftgrays.h include FT_CONFIG_CONFIG_H
- * src/smooth/ftgrays.c when FT_CONFIG_OPTION_PIC is NOT defined
- func_interface was moved from gray_convert_glyph_inner function
- to the global scope.
- When FT_CONFIG_OPTION_PIC is defined
- func_interface and ft_grays_raster structs
- will have functions to init them
- instead of being allocated in the global scope.
- And func_interface will be allocated on the stack of
- gray_convert_glyph_inner.
-
- New Files:
- * src/smooth/ftspic.h declare struct to hold PIC globals for smooth
- renderer and macros to access them.
- * src/smooth/ftspic.c implement functions to allocate, destroy and
- initialize PIC globals for smooth renderer.
-
- * src/smooth/smooth.c add new file to build: ftspic.c.
- * src/smooth/jamfile add new files to FT2_MULTI build: ftspic.c.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Position Independent Code (PIC) support in cff driver.
-
- * include/freetype/internal/services/svcid.h add macros to init
- instances of FT_Service_CIDRec.
- * include/freetype/internal/services/svpsinfo.h add macros to init
- instances of FT_Service_PsInfoRec.
-
- * src/cff/cffcmap.h declare cff_cmap_encoding_class_rec
- and cff_cmap_unicode_class_rec using macros from
- ftobjs.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
- functions will be declared.
- * src/cff/cffcmap.c when FT_CONFIG_OPTION_PIC is defined
- the following structs:
- cff_cmap_encoding_class_rec and cff_cmap_unicode_class_rec
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
-
- * src/cff/cffdrivr.h declare cff_driver_class using macros from
- ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
- functions will be declared.
- * src/cff/cffdrivr.c when FT_CONFIG_OPTION_PIC is defined
- the following structs:
- cff_service_glyph_dict, cff_service_ps_info, cff_service_ps_name
- cff_service_get_cmap_info, cff_service_cid_info, cff_driver_class,
- and cff_services array
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
- And macros will be used from cffpic.h in order to access them
- from the pic_container.
- Use macros from cffpic.h in order to access the
- structs allocated in cffcmap.c
-
- * src/cff/cffobjs.c Use macros from cffpic.h in order to access the
- structs allocated in cffcmap.c
-
- * src/cff/parser.c when FT_CONFIG_OPTION_PIC is defined
- implement functions to create and destroy cff_field_handlers array
- instead of being allocated in the global scope.
- And macros will be used from cffpic.h in order to access it
- from the pic_container.
-
- New Files:
- * src/cff/cffpic.h declare struct to hold PIC globals for cff
- driver and macros to access them.
- * src/cff/cffpic.c implement functions to allocate, destroy and
- initialize PIC globals for cff driver.
-
- * src/cff/cff.c add new file to build: cffpic.c.
- * src/cff/jamfile add new files to FT2_MULTI build: cffpic.c.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Position Independent Code (PIC) support in sfnt driver.
-
- * include/freetype/internal/services/svbdf.h add macros to init
- instances of FT_Service_BDFRec.
- * include/freetype/internal/services/svgldict.h add macros to init
- instances of FT_Service_GlyphDictRec.
- * include/freetype/internal/services/svpostnm.h add macros to init
- instances of FT_Service_PsFontNameRec.
- * include/freetype/internal/services/svsfnt.h add macros to init
- instances of FT_Service_SFNT_TableRec.
- * include/freetype/internal/services/svttcmap.h add macros to init
- instances of FT_Service_TTCMapsRec.
- * include/freetype/internal/sfnt.h add macros to init
- instances of SFNT_Interface.
-
- * src/sfnt/sfdriver.h declare sfnt_module_class using macros from
- ftmodapi.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
- functions will be declared.
- * src/sfnt/sfdriver.c when FT_CONFIG_OPTION_PIC is defined
- the following structs:
- sfnt_service_sfnt_table, sfnt_service_glyph_dict, sfnt_service_ps_name
- tt_service_get_cmap_info, sfnt_service_bdf, sfnt_interface,
- sfnt_module_class, and sfnt_services array
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
- And macros will be used from sfntpic.h in order to access them
- from the pic_container.
-
- * src/sfnt/ttcmap.h add macros to init
- instances of TT_CMap_ClassRec.
- * src/sfnt/ttcmap.c when FT_CONFIG_OPTION_PIC is defined
- the following structs:
- tt_cmap0_class_rec, tt_cmap2_class_rec, tt_cmap4_class_rec
- tt_cmap6_class_rec, tt_cmap8_class_rec, tt_cmap10_class_rec,
- tt_cmap12_class_rec, tt_cmap14_class_rec and tt_cmap_classes array
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
- And macros will be used from sfntpic.h in order to access them
- from the pic_container.
- The content of tt_cmap_classes is now described in the
- new file 'ttcmapc.h'.
-
- New Files:
- * src/sfnt/sfntpic.h declare struct to hold PIC globals for sfnt
- driver and macros to access them.
- * src/sfnt/sfntpic.c implement functions to allocate, destroy and
- initialize PIC globals for sfnt driver.
- * src/sfnt/ttcmapc.h describing the content of
- tt_cmap_classes allocated in ttcmap.c
-
- * src/sfnt/sfnt.c add new file to build: sfntpic.c.
- * src/sfnt/jamfile add new files to FT2_MULTI build: sfntpic.c.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Position Independent Code (PIC) support in truetype driver.
-
- * include/freetype/internal/services/svmm.h add macros to init
- instances of FT_Service_MultiMastersRec.
- * include/freetype/internal/services/svttglyf.h add macros to init
- instances of FT_Service_TTGlyfRec.
-
- * src/truetype/ttdriver.h declare tt_driver_class using macros from
- ftdriver.h, when FT_CONFIG_OPTION_PIC is defined create and destroy
- functions will be declared.
- * src/truetype/ttdriver.c when FT_CONFIG_OPTION_PIC is defined
- the following structs:
- tt_service_gx_multi_masters, tt_service_truetype_glyf, tt_driver_class
- and tt_services array,
- will have functions to init or create and destroy them
- instead of being allocated in the global scope.
- And macros will be used from ttpic.h in order to access them
- from the pic_container.
- * src/truetype/ttobjs.c change trick_names array to be
- PIC-compatible by being a two dimensional array rather than array
- of pointers.
-
- New Files:
- * src/truetype/ttpic.h declare struct to hold PIC globals for truetype
- driver and macros to access them.
- * src/truetype/ttpic.c implement functions to allocate, destroy and
- initialize PIC globals for truetype driver.
-
- * src/truetype/truetype.c add new file to build: ttpic.c.
- * src/truetype/jamfile add new files to FT2_MULTI build: ttpic.c.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Position Independent Code (PIC) support and infrastructure in base.
-
- * include/freetype/config/ftoption.h add FT_CONFIG_OPTION_PIC
- * include/freetype/internal/ftobjs.h Add pic_container member to
- FT_LibraryRec.
- Add macros to declare and init instances of FT_CMap_ClassRec.
- Add macros to init instances of FT_Outline_Funcs and FT_Raster_Funcs.
- Add macros to declare, allocate and initialize modules
- (FT_Module_Class).
- Add macros to declare, allocate and initialize renderers
- (FT_Renderer_Class).
- Add macro to init instances of FT_Glyph_Class.
- Add macros to declare, allocate and initialize drivers
- (FT_Driver_ClassRec).
- * include/freetype/internal/ftpic.h new file to declare the
- FT_PIC_Container struct and the functions to allocate and destroy it.
- * include/freetype/internal/ftserv.h add macros to allocate and
- destroy arrays of FT_ServiceDescRec.
- * include/freetype/internal/internal.h define macro to include
- ftpic.h.
-
- New Files:
- * src/base/ftpic.c implement functions to allocate and destroy the
- global pic_container.
- * src/base/basepic.h declare struct to hold PIC globals for base and
- macros to access them.
- * src/base/basepic.c implement functions to allocate, destroy and
- initialize PIC globals for base.
-
- * src/base/ftinit.c when FT_CONFIG_OPTION_PIC is defined implement
- functions that allocate and destroy ft_default_modules according to
- FT_CONFIG_MODULES_H in the pic_container instead of the global scope
- and use macro from basepic.h to access it.
- * src/base/ftobjs.c add calls to the functions that allocate and
- destroy the global pic_container when the library is created and
- destroyed.
-
- * src/base/jamfile add new files to FT2_MULTI build:
- ftpic.c and basepic.c.
- * src/base/ftbase.c add new files to build:
- ftpic.c and basepic.c.
-
- * src/base/ftglyph.c when FT_CONFIG_OPTION_PIC is defined
- ft_bitmap_glyph_class and ft_outline_glyph_class will be allocated
- in the pic_container instead of the global scope and use macros from
- basepic.h to access them.
- * src/base/ftbbox.c allocate bbox_interface struct on the stack
- instead of the global scope when FT_CONFIG_OPTION_PIC is defined.
- * src/base/ftstroke.c access ft_outline_glyph_class allocated in
- ftglyph.c via macros from basepic.h
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Preparing changes in cff parser later needed for PIC version.
-
- * src/cff/cffload.c, src/cff/cffload.h, src/cff/cffobjs.c,
- src/cff/cffparse.c, src/cff/cffparse.h: Add library pointer to
- 'CFF_ParserRec' set by `cff_parser_init'.
- Route library pointer from 'cff_face_init' to 'cff_subfont_load'
- for `cff_parser_init'.
-
- * src/cff/cffparse.c (CFF_Field_Handler): Move it to...
- * src/cff/cffparse.h: This file, to be used by other C files.
-
-2009-04-05 Oran Agra <oran@monfort.co.il>
-
- Minor change in ftstroke.c.
-
- * src/base/ftstroke.c (FT_StrokerRec): Replace `memory' member with
- `library' needed for PIC version.
- Update all callers.
-
-2009-04-04 Werner Lemberg <wl@gnu.org>
-
- ftnames.c -> ftsnames.c
-
- * src/base/ftnames.c: Rename to...
- * src/base/ftsnames.c: This.
- * src/base/Jamfile, src/base/rules.mk, src/base/ftbase.c: Updated.
-
-2009-04-04 Werner Lemberg <wl@gnu.org>
-
- Add support for cmap type 13.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (TT_CONFIG_CMAP_FORMAT_13): New macro.
-
- * src/sfnt/ttcmap.c (TT_CMap13Rec, tt_cmap13_init,
- tt_cmap13_validate, tt_cmap13_char_index, tt_cmap13_char_next,
- tt_cmap13_get_info, tt_cmap13_char_map_def_binary,
- tt_cmap14_class_rec): New functions and structures for cmap 13
- support.
- (tt_cmap_classes): Register tt_cmap13_class_rec.
-
- * docs/CHANGES: Mention cmap 13 support.
-
-2009-04-01 Werner Lemberg <wl@gnu.org>
-
- Ignore empty contours in CFF glyphs.
-
- Problem reported by Albert Astals Cid <aacid@kde.org>.
-
- * src/cff/cffgload.c (cff_builder_close_contour): Synchronize with
- t1_builder_close_contour.
-
-2009-03-21 Werner Lemberg <wl@gnu.org>
-
- Another redundant header inclusion.
-
- * src/truetype/ttgxvar.c: Fix Ghostscript Coverity issue #4041.
-
-2009-03-21 Werner Lemberg <wl@gnu.org>
-
- Remove redundant header inclusions.
-
- This covers many Ghostscript Coverity issues.
-
- * src/*: Do it.
-
-2009-03-21 Werner Lemberg <wl@gnu.org>
-
- Fix Ghostscript Coverity issue #3904.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
- invalid values of `runcnt'.
-
-2009-03-20 Werner Lemberg <wl@gnu.org>
-
- Fix `make multi' run.
-
- * src/smooth/ftsmooth.h: Include FT_INTERNAL_DEBUG_H.
-
-2009-03-20 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #25923.
-
- * src/cache/ftccmap.c (FTC_CMAP_HASH): Fix typo.
-
-2009-03-20 Werner Lemberg <wl@gnu.org>
-
- Protect against too large glyphs.
-
- Problem reported by Tavis Ormandy <taviso@google.com>.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Don't allow
- `pitch' or `height' to be larger than 0xFFFF.
-
-2009-03-20 Werner Lemberg <wl@gnu.org>
- Tavis Ormandy <taviso@google.com>
-
- Fix validation for various cmap table formats.
-
- * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate,
- tt_cmap12_validate): Check `length' correctly.
- (tt_cmap_14_validate): Check `length' and `numMappings' correctly.
-
-2009-03-20 Werner Lemberg <wl@gnu.org>
-
- Protect against malformed compressed data.
-
- * src/lzw/ftzopen.c (ft_lzwstate_io): Test whether `state->prefix' is
- zero.
-
-2009-03-20 Werner Lemberg <wl@gnu.org>
-
- Protect against invalid SID values in CFFs.
-
- Problem reported by Tavis Ormandy <taviso@google.com>.
-
- * src/cff/cffload.c (cff_charset_load): Reject SID values larger
- than 64999.
-
-2009-03-19 Vincent Richomme <richom.v@free.fr>
-
- Update WinCE Visual C project files.
-
- * builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2008-ce/freetype.vcproj: Add missing base extension
- files.
-
-2009-03-19 Werner Lemberg <wl@gnu.org>
-
- Remove unused Win32 code.
-
- * builds/wince/ftdebug.c: Remove code guarded with `!_WIN32_WCE'.
- Since Win32 is handled separately this is no longer needed.
-
-2009-03-19 Vincent Richomme <richom.v@free.fr>
-
- Make `gzip' module compile on WinCE.
-
- * src/gzip/zconf.h [_WIN32_WCE]: Define NO_ERRNO_H.
-
-2009-03-19 Werner Lemberg <wl@gnu.org>
-
- Remove unused WinCE code.
-
- * builds/win32/ftdebug.c: Remove code guarded with `_WIN32_WCE'.
- Since WinCE is handled separately this is no longer needed.
-
-2009-03-16 Werner Lemberg <wl@gnu.org>
-
- docmaker: Don't ignore single-line code blocks.
-
- * src/tools/docmaker/content.py (DocBlock::_init__): Fix change from
- 2009-01-31.
-
-2009-03-15 Steve Langasek <steve.langasek@canonical.com>
-
- Use __asm__ for declaring assembly instead of asm.
-
- * builds/unix/ftconfig.in (FT_MulFix_arm): Use __asm__ instead of
- asm on arm, fixing a build failure on armel with -pedantic.
-
-2009-03-14 Werner Lemberg <wl@gnu.org>
-
- Fix valgrind warning.
-
- * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_bit_aligned): Don't read
- past the end of the frame.
-
-2009-03-12 Werner Lemberg <wl@gnu.org>
-
- * Version 2.3.9 released.
- =========================
-
-
- Tag sources with `VER-2-3-9'.
-
-2009-03-12 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype2.in: Move @FT2_EXTRA_LIBS@ to `Libs.private'.
-
-2009-03-12 Werner Lemberg <wl@gnu.org>
-
- Fix some FreeType Coverity issues as reported for Ghostscript.
-
- * src/base/ftobjs.c (FT_New_Face, FT_New_Memory_Face): Initialize
- `args.stream' (#3874, #3875).
- (open_face_PS_from_sfnt_stream): Improve error management (#3786).
- * src/base/ftmm.c (ft_face_get_mm_service): Fix check of `aservice'
- (#3870).
- * src/base/ftstroke.c (ft_stroke_border_get_counts): Remove dead
- code (#3790).
- * src/base/ftrfork.c (raccess_guess_apple_generic): Check error
- value of `FT_Stream_Skip' (#3784).
-
- * src/type1/t1gload.c (T1_Load_Glyph): Check `size' before accessing
- it (#3872)
-
- * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Check `face' before accessing
- it (#3871).
- * src/pcf/pcfread.c (pcf_get_metrics): Handle return value of
- `pcf_get_metric' (#3789, #3782).
- (pcf_get_properties): Use FT_STREAM_SKIP (#3783).
-
- * src/cache/ftcmanag.c (FTC_Manager_RegisterCache): Fix check of
- `acache' (#3797)
-
- * src/cff/cffdrivr.c (cff_ps_get_font_info): Fix check of `cff'
- (#3796).
- * src/cff/cffgload.c (cff_decoder_prepare): Check `size' (#3795).
- * src/cff/cffload.c (cff_index_get_pointers): Add comment (#3794).
-
- * src/bdf/bdflib.c (_bdf_add_property): Check `fp->value.atom'
- (#3793).
- (_bdf_parse_start): Add comment (#3792).
-
- * src/raster/ftraster.c (Finalize_Profile_Table): Check
- `ras.fProfile' (#3791).
-
- * src/sfnt/ttsbit.c (Load_SBit_Image): Use FT_STREAM_SKIP (#3785).
-
- * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Properly ignore
- seek error (#3781).
-
-2009-03-11 Michael Toftdal <toftdal@gmail.com>
-
- Extend CID service functions to handle CID-keyed CFFs as CID fonts.
-
- * include/freetype/ftcid.h (FT_Get_CID_Is_Internally_CID_keyed,
- FT_Get_CID_From_Glyph_Index): New functions.
-
- * include/freetype/internal/services/svcid.h
- (FT_CID_GetIsInternallyCIDKeyedFunc,
- FT_CID_GetCIDFromGlyphIndexFunc): New function typedefs.
- (CID Service): Use them.
-
- * src/base/ftcid.c: Include FT_CID_H.
- (FT_Get_CID_Is_Internally_CID_keyed, FT_Get_CID_From_Glyph_Index):
- New functions.
-
- * src/cff/cffdrivr.c (cff_get_is_cid, cff_get_cid_from_glyph_index):
- New functions.
- (cff_service_cid_info): Add them.
- * src/cff/cffload.c (cff_font_load): Don't free `font->charset.sids'
- -- it is needed for access as a CID-keyed font. It gets deleted
- later on.
-
- * src/cid/cidriver.c (cid_get_is_cid, cid_get_cid_from_glyph_index):
- New functions.
- (cid_service_cid_info): Add them.
-
- * docs/CHANGES: Updated.
-
-2009-03-11 Bram Tassyns <bramt@enfocus.be>
-
- Fix Savannah bug #25597.
-
- * src/cff/cffparse.c (cff_parse_real): Don't allow fraction_length
- to become larger than 9.
-
-2009-03-11 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #25814.
-
- * builds/unix/freetype2.in: As suggested in the bug report, move
- @LIBZ@ to `Libs.private'.
-
-2009-03-11 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #25781.
- We now simply check for a valid `offset', no longer handling `delta
- = 1' specially.
-
- * src/sfnt/ttcmap.c (tt_cmap4_validate): Don't check `delta' for
- last segment.
- (tt_cmap4_set_range, tt_cmap4_char_map_linear,
- tt_cmap4_char_map_binary): Check offset.
-
-2009-03-11 Werner Lemberg <wl@gnu.org>
-
- * src/base/Jamfile: Fix handling of ftadvanc.c.
- Reported by Oran Agra <oran@monfort.co.il>.
-
-2009-03-10 Vincent Richomme <richom.v@free.fr>
-
- Restructure Win32 and Wince compiler support.
-
- * src/builds/win32: Remove files for WinCE.
- Move VC 2005 support to a separate directory.
- Add directory for VC 2008 support.
-
- * src/builds/wince: New directory hierarchy for WinCE compilers
- (VC 2005 and VC 2008).
-
-2009-03-09 Werner Lemberg <wl@gnu.org>
-
- More preparations for 2.3.9 release.
-
- * docs/CHANGES: Updated.
-
- * Jamfile, README: s/2.3.8/2.3.9/, s/238/239/.
-
-2009-03-09 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/rules.mk (SFNT_DRV_H): Add ttsbit0.c.
-
-2009-03-09 Alexey Kryukov <anagnost@yandex.ru>
-
- Fix handling of EBDT formats 8 and 9 (part 2).
-
- This patch fixes the following problems in ttsbit0.c:
-
- . Bitmaps for compound glyphs were never allocated.
-
- . `SBitDecoder' refused to load metrics if some other metrics have
- already been loaded. This condition certainly makes no sense for
- recursive calls, so I've just disabled it. Another possibility
- would be resetting `decoder->metrics_loaded' to false before
- loading each composite component. However, we must restore the
- original metrics after finishing the recursion; otherwise we can
- get a misaligned glyph.
-
- . `tt_sbit_decoder_load_bit_aligned' incorrectly handled `x_pos',
- causing some glyph components to be shifted too far to the right
- (especially noticeable for small sizes).
-
- Note that support for grayscale bitmaps (not necessarily compound) is
- completely broken in ttsbit0.c.
-
- * src/sfnt/tt_sbit_decoder_load_metrics: Always load metrics.
- (tt_sbit_decoder_load_bit_aligned): Handle `x_pos' correctly in case
- of `h == height'.
- (tt_sbit_decoder_load_compound): Reset metrics after loading
- components.
- Allocate bitmap.
-
-2009-03-09 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.raw (version_info): Set to 9:20:3.
-
-2009-03-03 David Turner <david@freetype.org>
-
- Protect SFNT kerning table parser against malformed tables.
-
- This closes Savannah BUG #25750.
-
- * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning): Fix a
- bug where a malformed table would be successfully loaded but later
- crash the engine during parsing.
-
-2009-03-03 David Turner <david@freetype.org>
-
- Update documentation and bump version number to 2.3.9.
-
- * include/freetype/freetype.h: Bump patch version to 9.
- * docs/CHANGES: Document the ABI break in 2.3.8.
- * docs/VERSION.DLL: Update version numbers table for 2.3.9.
-
-2009-03-03 David Turner <david@freetype.org>
-
- Remove ABI-breaking field in public PS_InfoFontRec definition.
-
- Instead, we define a new internal PS_FontExtraRec structure to
- hold the additional field, then place it in various internal
- positions of the corresponding FT_Face derived objects.
-
- * include/freetype/t1tables.h (PS_FontInfoRec): Remove the
- `fs_type' field from the public structure.
- * include/freetype/internal/psaux.h (T1_FieldLocation): New
- enumeration `T1_FIELD_LOCATION_FONT_EXTRA'.
- * include/freetype/internal/t1types.h (PS_FontExtraRec): New
- structure.
- (T1_FontRec, CID_FaceRec): Add it.
-
- * src/cid/cidload.c (cid_load_keyword): Handle
- T1_FIELD_LOCATION_FONT_EXTRA.
- * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c:
- Adjust FT_STRUCTURE and T1CODE properly to handle `FSType'.
- * src/type1/t1load.c (t1_load_keyword): Handle
- T1_FIELD_LOCATION_FONT_EXTRA.
-
- * include/freetype/internal/services/svpsinfo.h (PsInfo service):
- Add `PS_GetFontExtraFunc' function typedef.
-
- * src/base/ftfstype.c: Include FT_INTERNAL_SERVICE_H and
- FT_SERVICE_POSTSCRIPT_INFO_H.
- (FT_Get_FSType_Flags): Use POSTSCRIPT_INFO service.
-
- * src/cff/cffdrivr.c (cff_service_ps_info): Updated.
- * src/cid/cidriver.c (cid_ps_get_font_extra): New function.
- (cid_service_ps_info): Updated.
- * src/type1/t1driver.c (t1_ps_get_font_extra): New function.
- (t1_service_ps_info): Updated.
- * src/type42/t42drivr.c (t42_ps_get_font_extra): New function.
- (t42_service_ps_info): Updated.
-
-2009-03-02 Alexey Kryukov <anagnost@yandex.ru>
-
- Fix handling of EBDT formats 8 and 9.
-
- The main cycle in `blit_sbit' makes too many iterations: it actually
- needs the count of lines in the source bitmap rather than in the
- target image.
-
- * src/sfnt/ttsbit.c (blit_sbit) [FT_CONFIG_OPTION_OLD_INTERNALS]:
- Add parameter `source_height' and use it for main loop.
- (Load_SBit_Single) [FT_CONFIG_OPTION_OLD_INTERNALS]: Updated.
-
-2009-02-23 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #25669.
-
- * src/base/ftadvanc.h (FT_Get_Advances): Fix serious typo.
-
- * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics): Fix
- scaling factor for non-scalable fonts.
-
- * src/cff/cffdrivr.c (cff_get_advances): Use correct advance width
- value to prevent incorrect scaling.
-
- * docs/CHANGES: Document it.
-
-2009-02-15 Matt Godbolt <matt@godbolt.org>
-
- Fix Savannah bug #25588.
-
- * builds/unix/ftconfig.in (FT_MulFix_arm): Use correct syntax for
- `orr' instruction.
-
-2009-02-11 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttobjs.c (tt_check_trickyness): Add `DFKaiShu'.
- Reported by David Bevan <dbevan@emtex.com>.
-
-2009-02-09 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #25495.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Test for bitmap strikes before
- setting metrics and bbox values. This ensures that the check for a
- font with neither a `glyf' table nor bitmap strikes can be performed
- early enough to set metrics and bbox values too.
-
-2009-02-04 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #25480.
-
- * builds/unix/freetype-config.in: For --ftversion, don't use $prefix
- but $includedir.
-
-2009-01-31 Werner Lemberg <wl@gnu.org>
-
- Minor docmaker improvements.
-
- * src/tools/docmaker/content.py (DocBlock::__init__): Ignore empty
- code blocks.
-
-2009-01-25 Werner Lemberg <wl@gnu.org>
-
- Fix SCANCTRL handling in TTFs.
- Problem reported by Alexey Kryukov <anagnost@yandex.ru>.
-
- * src/truetype/ttinterp.c (Ins_SCANCTRL): Fix threshold handling.
-
-2009-01-23 Werner Lemberg <wl@gnu.org>
-
- Move FT_Get_FSType_Flags to a separate file.
- Problem reported by Mickey Gabel <mickey@monfort.co.il>.
-
- * src/base/ftobjs.c (FT_Get_FSType_Flags): Move to...
- * src/base/ftfstype.c: This new file.
-
- * modules.cfg (BASE_EXTENSION): Add ftfstype.c.
-
- * docs/INSTALL.ANY: Updated.
-
- * builds/mac/*.txt, builds/amiga/*makefile*,
- builds/win32/{visualc,visualce}/freetype.*, builds/symbian/*:
- Updated.
-
-2009-01-22 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/ftsystem.c (FT_Stream_Open): Fix 2 error
- messages ending without "\n".
-
-2009-01-22 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix Savannah bug #25347.
-
- * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Rewind
- the stream to the original position passed to this function,
- when ft_lookup_PS_in_sfnt_stream() failed.
- (Mac_Read_sfnt_Resource): Rewind the stream to the head of
- sfnt resource body, when open_face_PS_from_sfnt_stream()
- failed.
-
-2009-01-19 Michael Lotz <mmlr@mlotz.ch>
-
- Fix Savannah bug #25355.
-
- * include/freetype/config/ftconfig.h (FT_MulFix_i386): Make
- assembler code work with gcc 2.95.3 (as used by the Haiku project).
- Add `cc' register to the clobber list.
-
-2009-01-18 Werner Lemberg <wl@gnu.org>
-
- Protect FT_Get_Next_Char.
-
- * src/sfnt/ttcmap.c (tt_cmap4_set_range): Apply fix similar to
- change from 2008-07-22.
-
- Patch from Ronen Ghoshal <rghoshal@emtex.com>.
-
-2009-01-18 Werner Lemberg <wl@gnu.org>
-
- Implement FT_Get_Name_Index for SFNT driver.
-
- * src/sfnt/sfdriver.c (sfnt_get_name_index): New function.
- (sfnt_service_glyph_dict): Use it.
-
- Problem reported by Truc Truong <tructv@necsv.com>.
-
-2009-01-18 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftstroke.h (FT_Outline_GetInsideBorder): Fix
- documentation. Problem reported by Truc Truong <tructv@necsv.com>.
-
- * docs/CHANGES: Updated.
-
-2009-01-14 Werner Lemberg <wl@gnu.org>
-
- * Version 2.3.8 released.
- =========================
-
-
- Tag sources with `VER-2-3-8'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.3.8.
-
- * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj: s/2.3.7/2.3.8/, s/237/238/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8.
-
- * builds/unix/configure.raw (version_info): Set to 9:19:3.
-
- * docs/release: Updated.
-
-2009-01-14 Werner Lemberg <wl@gnu.org>
-
- * builds/toplevel.mk (dist): Compress better.
-
-2009-01-13 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Get_FSType_Flags): Cast for compilation
- with C++.
-
-2009-01-13 Werner Lemberg <wl@gnu.org>
-
- Don't use stdlib.h and friends directly.
- Reported by Mickey Gabel <mickey@monfort.co.il>.
-
- * src/base/ftdbgmem.c: s/<stdlib.h>/FT_CONFIG_STANDARD_LIBRARY_H/.
-
- * src/gzip/ftgzip.c, src/lzw/ftlzw.c, src/raster/ftmisc.h:
- s/<string.h>/FT_CONFIG_STANDARD_LIBRARY_H/.
-
- * src/autofit/aftypes.h, src/autofit/afhints.c,
- src/pshinter/pshalgo.c: s/<stdio.h>/FT_CONFIG_STANDARD_LIBRARY_H/
-
- * src/lzw/ftlzw.c, src/base/ftdbgmem.c: Don't include stdio.h.
-
-2009-01-12 Werner Lemberg <wl@gnu.org>
-
- Avoid compiler warnings.
-
- * */*: s/do ; while ( 0 )/do { } while ( 0 )/.
- Reported by Sean McBride <sean@rogue-research.com>.
-
-2009-01-12 Werner Lemberg <wl@gnu.org>
-
- Fix stdlib dependencies.
-
- Problem reported by Mickey Gabel <mickey@monfort.co.il>.
-
- * include/freetype/config/ftstdlib.h (ft_exit): Removed. Unused.
-
- * src/autofit/afhints.c, src/base/ftlcdfil.c, src/smooth/ftsmooth.c:
- s/memcpy/ft_memcpy/.
- * src/psaux/t1decode.c: s/memset/ft_memset/, s/memcpy/ft_memcpy/.
-
-2009-01-11 Werner Lemberg <wl@gnu.org>
-
- * docs/formats.txt: Add link to PCF specification.
-
- * include/freetype/ftbdf.h (FT_Get_BDF_Property): Improve
- documentation.
-
-2009-01-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance,
- FT_Get_Advances): Change the type of load_flags from FT_UInt32 to
- FT_Int32, to match with the flags for FT_Load_Glyph().
- * src/cff/cffdrivr.c (cff_get_advances): Ditto.
- * src/truetype/ttdriver.c (tt_get_advances): Ditto.
- * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances):
- Ditto.
- * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
- Ditto.
-
-2009-01-09 Daniel Zimmermann <netzimme@aol.com>
-
- * src/gxvalid/gxvmort.c (gxv_mort_feature_validate): Fix wrong
- length check. From Savannah patch #6682.
-
-2009-01-09 Werner Lemberg <wl@gnu.org>
-
- Fix problem with T1_FIELD_{NUM,FIXED}_TABLE2.
-
- * src/psaux/psobjs.c (ps_parser_load_field_table): Don't handle
- `count_offset' if it is zero (i.e., unused). Otherwise, the first
- element of the structure which holds the data is erroneously
- modified. Problem reported by Chi Nguyen <chint@necsv.com>.
-
-2009-01-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftadvanc.c (_ft_face_scale_advances, FT_Get_Advance,
- FT_Get_Advances): Extend the type of load_flags from FT_UInt to
- FT_UInt32, to pass 32-bit flags on 16bit platforms.
- * src/cff/cffdrivr.c (cff_get_advances): Ditto.
- * src/truetype/ttdriver.c (tt_get_advances): Ditto.
- * include/freetype/ftadvanc.h (FT_Get_Advance, FT_Get_Advances):
- Ditto.
- * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
- Ditto.
-
-2009-01-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (FT_Done_Library): Issue an error message when
- FT_Done_Face() cannot free all faces. If the list of the opened
- faces includes broken face which FT_Done_Face() cannot free,
- FT_Done_Library() retries FT_Done_Face() and it can fall into
- an endless loop. See the discussion:
- https://lists.gnu.org/archive/html/freetype-devel/2008-09/msg00047.html
- https://lists.gnu.org/archive/html/freetype-devel/2008-10/msg00000.html
-
-2009-01-07 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Document new key `a' in ftdiff.
-
-2009-01-06 Werner Lemberg <wl@gnu.org>
-
- * autogen.sh: Don't use GNUisms while calling sed. Problem reported
- by Sean McBride.
-
-2009-01-06 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftbitmap.c (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_LCD
- and FT_PIXEL_MODE_LCD_V. Problem reported by Chi Nguyen
- <chint@necsv.com>.
-
-2009-01-06 Diego Pettenò <flameeyes@gmail.com>
-
- * builds/unix/configure.raw: Don't call AC_CANONICAL_BUILD and
- AC_CANONICAL_TARGET and use $host_os only. A nice explanation for
- this change can be found at
- https://blog.flameeyes.eu/s/canonical-target.
-
- From Savannah patch #6712.
-
-2009-01-06 Sean McBride <sean@rogue-research.com>
-
- * src/base/ftdbgmem.c (_debug_mem_dummy): Make it static.
-
- * src/base/ftmac.c: Remove some #undefs.
-
-2008-12-26 Werner Lemberg <wl@gnu.org>
-
- Set `face_index' field in FT_Face for all font formats.
-
- * cff/cffobjs.c (cff_face_init), winfonts/winfnt.c (FNT_Face_Init),
- sfnt/sfobjs.c (sfnt_init_face): Do it.
-
- * docs/CHANGES: Document it.
-
-2008-12-22 Steve Grubb
-
- * builds/unix/ftsystem.c (FT_Stream_Open): Reject zero-length files.
- Patch from Savannah bug #25151.
-
-2008-12-21 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrdrivr.c, src/winfonts/winfnt.c, src/cache/ftcmanag.c,
- src/smooth/ftgrays.c, src/base/ftobjs.c, src/sfobjs.c:
- s/_Err_Bad_Argument/_Err_Invalid_Argument/. The former is for
- errors in the bytecode interpreter only.
-
-2008-12-21 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftpfr.c (FT_Get_PFR_Metrics): Protect against NULL
- arguments.
- Fix return value for non-PFR fonts. Both problems reported by Chi
- Nguyen <chint@necsv.com>.
-
-2008-12-21 anonymous
-
- FT_USE_MODULE declares things as:
-
- extern const FT_Module_Class
-
- (or similar for C++). However, the actual types of the variables
- being declared are often different, e.g., FT_Driver_ClassRec or
- FT_Renderer_Class. (Some are, indeed, FT_Module_Class.)
-
- This works with most C compilers (since those structs begin with an
- FT_Module_Class struct), but technically it's undefined behavior.
-
- To quote the ISO/IEC 9899:TC2 final committee draft, section 6.2.7
- paragraph 2:
-
- All declarations that refer to the same object or function shall
- have compatible type; otherwise, the behavior is undefined.
-
- (And they are not compatible types.)
-
- Most C compilers don't reject (or even detect!) code which has this
- issue, but the GCC LTO development branch compiler does. (It
- outputs the types of the objects while generating .o files, along
- with a bunch of other information, then compares them when doing the
- final link-time code generation pass.)
-
- Patch from Savannah bug #25133.
-
- * src/base/ftinit.c (FT_USE_MODULE): Include variable type.
-
- * builds/amiga/include/freetype/config/ftmodule.h,
- include/freetype/config/ftmodule.h, */module.mk: Updated to declare
- pass correct types to FT_USE_MODULE.
-
-2008-12-21 Hongbo Ni <hongbo@njstar.com>
-
- * src/autofit/aflatin.c (af_latin_hint_edges),
- src/autofit/aflatin2.c (af_latin2_hint_edges), src/autofit/afcjk.c
- (af_cjk_hint_edges): Protect against division by zero. This fixes
- Savannah bug #25124.
-
-2008-12-18 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2008-12-18 David Bevan <dbevan@emtex.com>
-
- Provide API for accessing embedding and subsetting restriction
- information.
-
- * include/freetype.h (FT_FSTYPE_INSTALLABLE_EMBEDDING,
- FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING,
- FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING, FT_FSTYPE_EDITABLE_EMBEDDING,
- FT_FSTYPE_NO_SUBSETTING, FT_FSTYPE_BITMAP_EMBEDDING_ONLY): New
- macros.
- (FT_Get_FSType_Flags): New function declaration.
-
- * src/base/ftobjs.c (FT_Get_FSType_Flags): New function.
-
- * src/cid/cidtoken.h, src/type1/t1tokens.h, src/type42/t42parse.c
- (t42_keywords): Handle `FSType'.
-
- * include/freetype/t1tables.h (PS_FontInfoRec): Add `fs_type' field.
-
-2008-12-17 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Don't use internal
- macros so that copying the source code into an application works
- out of the box.
-
-2008-12-17 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftsynth.h, src/base/ftsynth.c: Move
- FT_GlyphSlot_Own_Bitmap to...
- * include/freetype/ftbitmap.h, src/base/ftbitmap.c: These files.
-
- * docs/CHANGES: Document it.
-
-2008-12-10 Werner Lemberg <wl@gnu.org>
-
- Generalize the concept of `tricky' fonts by introducing
- FT_FACE_FLAG_TRICKY to indicate that the font format's hinting
- engine is necessary for correct rendering.
-
- At the same time, slightly modify the behaviour of tricky fonts:
- FT_LOAD_NO_HINTING is now ignored. To really force raw loading
- of tricky fonts (without hinting), both FT_LOAD_NO_HINTING and
- FT_LOAD_NO_AUTOHINT must be used.
-
- Finally, tricky TrueType fonts always use the bytecode interpreter
- even if the patented code is used.
-
- * include/freetype/freetype.h (FT_FACE_FLAG_TRICKY, FT_IS_TRICKY):
- New macros.
-
- * src/truetype/ttdriver.c (Load_Glyph): Handle new load flags
- semantics as described above.
-
- * src/truetype/ttobjs.c (tt_check_trickyness): New function, using
- code of ...
- (tt_face_init): This function, now simplified and updated to new
- semantics.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Don't use autohinter for tricky
- fonts.
-
- * docs/CHANGES: Document it.
-
-2008-12-09 Werner Lemberg <wl@gnu.org>
-
- Really fix Savannah bug #25010: An SFNT font with neither outlines
- nor bitmaps can be considered as containing space `glyphs' only.
-
- * src/truetype/ttpload.c (tt_face_load_loca): Handle the case where
- a `glyf' table is missing.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Abort if we have no
- `glyf' table but a non-zero `loca' entry.
- (tt_loader_init): Handle missing `glyf' table.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Undo change 2008-12-05.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): A font with neither outlines
- nor bitmaps is scalable.
-
-2008-12-05 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_uniranges): Add more ranges. This
- fixes Savannah bug #21190 which also provides a basic patch.
-
-2008-12-05 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): Use value
- 0x100 instead of 0x10000; the latter value is already occupied by
- FT_LOAD_TARGET_LIGHT. Bug reported by James Cloos.
-
-
- Handle SFNT with neither outlines nor bitmaps. This fixes Savannah
- bug #25010.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Reject fonts with neither
- outlines nor bitmaps.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Don't return an error if there
- is no table with glyphs.
-
-
- * src/sfnt/ttload.c (tt_face_lookup_table): Improve debugging
- message.
-
-2008-12-01 Werner Lemberg <wl@gnu.org>
-
- GDEF tables need `glyph_count' too for validation. Problem reported
- by Chi Nguyen <chint@necsv.com>.
-
- * src/otvalid/otvgdef.c (otv_GDEF_validate), src/otvalid/otvalid.h
- (otv_GDEF_validate), src/otvalid/otvmod.c (otv_validate): Pass
- `glyph_count'.
-
-2008-11-29 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afcjk.c, src/base/ftoutln.c, src/base/ftrfork.c,
- src/bdf/bdfdrivr.c, src/gxvalid/gxvmorx.c, src/otvalid/otvmath.c,
- src/pcf/pcfdrivr.c, src/psnames/pstables.h, src/smooth/ftgrays.c,
- src/tools/glnames.py, src/truetype/ttinterp.c, src/type1/t1load.c,
- src/type42/t42objs.c, src/winfonts/winfnt.c: Fix compiler warnings
- (Atari PureC).
-
-2008-11-29 James Cloos <cloos@jhcloos.com>
-
- * src/type/t1load.c (mm_axis_unmap): Revert previous patch and fix
- it correctly by using FT_INT_TO_FIXED (FreeType expects 16.16 values
- in the /BlendDesignMap space).
-
-2008-11-29 James Cloos <cloos@jhcloos.com>
-
- * src/type1/t1load.c (mm_axis_unmap): `blend_points' is FT_Fixed*,
- whereas `design_points' is FT_Long*. Therefore, return blend rather
- than design points.
-
-2008-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffparse.c (cff_parse_real): Handle more than nine
- significant digits correctly. This fixes Savannah bug #24953.
-
-2008-11-25 Daniel Zimmermann <netzimme@aol.com>
-
- * src/base/ftstream.c (FT_Stream_ReadFields): Don't access stream
- before the NULL check. From Savannah patch #6681.
-
-2008-11-24 Werner Lemberg <wl@gnu.org>
-
- Fixes from the gnuwin32 port.
-
- * src/base/ftlcdfil.c: s/EXPORT/EXPORT_DEF/.
-
- * src/base/ftotval.c: Include FT_OPENTYPE_VALIDATE_H.
-
- * src/psaux/psobjs.c (ps_table_add): Check `length'.
-
-2008-11-15 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (tt_default_graphics_state): The default
- value for `scan_type' is zero, as confirmed by Greg Hitchcock from
- Microsoft. Problem reported by Michal Nowakowski
- <miszka@limes.com.pl>.
-
-2008-11-12 Tor Andersson <tor.andersson@gmail.com>
-
- * src/cff/cffdrivr.c (cff_get_cmap_info): Initialize `format' field.
- This fixes Savannah bug #24819.
-
-2008-11-08 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Remove #if 0/#endif guards
- since OpenType version 1.5 has been released.
-
- * include/ttnameid.h (TT_NAME_ID_WWS_FAMILY,
- TT_NAME_ID_WWS_SUBFAMILY): New macros for OpenType 1.5.
- (TT_URC_COPTIC, TT_URC_VAI, TT_URC_NKO, TT_URC_BALINESE,
- TT_URC_PHAGSPA, TT_URC_NON_PLANE_0, TT_URC_PHOENICIAN,
- TT_URC_TAI_LE, TT_URC_NEW_TAI_LUE, TT_URC_BUGINESE,
- TT_URC_GLAGOLITIC, TT_URC_YIJING, TT_URC_SYLOTI_NAGRI,
- TT_URC_LINEAR_B, TT_URC_ANCIENT_GREEK_NUMBERS, TT_URC_UGARITIC,
- TT_URC_OLD_PERSIAN, TT_URC_SHAVIAN, TT_URC_OSMANYA,
- TT_URC_CYPRIOT_SYLLABARY, TT_URC_KHAROSHTHI, TT_URC_TAI_XUAN_JING,
- TT_URC_CUNEIFORM, TT_URC_COUNTING_ROD_NUMERALS, TT_URC_SUNDANESE,
- TT_URC_LEPCHA, TT_URC_OL_CHIKI, TT_URC_SAURASHTRA, TT_URC_KAYAH_LI,
- TT_URC_REJANG, TT_URC_CHAM, TT_URC_ANCIENT_SYMBOLS,
- TT_URC_PHAISTOS_DISC, TT_URC_OLD_ANATOLIAN, TT_URC_GAME_TILES): New
- macros for OpenType 1.5.
-
-2008-11-08 Wenlin Institute <wenlin@wenlin.com>
-
- * src/base/ftobjs.c (ft_glyphslot_free_bitmap): Protect against
- slot->internal == NULL. Reported by Graham Asher.
-
-2008-11-08 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (tt_face_get_name): Modified to return an error
- code so that memory allocation problems can be distinguished from
- missing table entries. Reported by Graham Asher.
- (GET_NAME): New macro.
- (sfnt_load_face): Use it.
-
-2008-11-05 Werner Lemberg <wl@gnu.org>
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Undefine
- TT_CONFIG_OPTION_UNPATENTED_HINTING. This fixes the return value of
- `FT_Get_TrueType_Engine_Type' (and makes it work as documented).
- Reported in bug #441638 of bugzilla.novell.com.
-
- * docs/CHANGES: Document it.
-
-2008-11-03 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_subrs): Use an endless loop. There are
- fonts (like HELVI.PFB version 003.001, used on OS/2) which define
- some `subrs' elements more than once. Problem reported by Peter
- Weilbacher <mozilla@weilbacher.org>.
-
-2008-10-15 Graham Asher <graham.asher@btinternet.com>
-
- * src/sfnt/ttpost.c (tt_post_default_names): Add `const'.
-
-2008-10-15 David Turner <david@freetype.org>
-
- * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Disambiguate for
- meddlesome compilers' warning against `for ( ...; ...; ...) ;'.
-
-2008-10-14 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): Remove compiler warning.
- Suggested by Bram Tassyns in Savannah patch #6651.
-
-2008-10-12 Graham Asher <graham.asher@btinternet.com>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Fix computation of
- `underline_position'.
-
-2008-10-12 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2008-10-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix Savannah bug #24468.
-
- According to include/freetype/internal/ftobjs.h, the appropriate
- type to interchange single character codepoint is FT_UInt32. It
- should be distinguished from FT_UInt which can be 16bit integer.
-
- * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Change the type
- of the second argument `pcharcode' from FT_UInt* to FT_UInt32*.
- (tt_cmap4_char_map_binary): Ditto.
- (tt_cmap14_get_nondef_chars): Change the type of return value
- from FT_UInt* to FT_UInt32*.
-
-2008-10-08 John Tytgat <John.Tytgat@esko.com>
-
- Fix Savannah bug #24485.
-
- * src/type1/t1load.c (parse_charstrings): Assure that we always have
- a .notdef glyph.
-
-2008-10-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c: Include FT_TRUETYPE_TAGS_H for multi build.
- * builds/mac/ftmac.c: Ditto.
-
-2008-10-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * include/freetype/tttags.h (TTAG_TYP1, TTAG_typ1): Fix definitions.
- * src/base/ftobjs.c: Include FT_TRUETYPE_TAGS_H.
-
-2008-10-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/sfnt/sfobjs.c (sfnt_open_font): Allow `typ1' version tag in
- the beginning of sfnt container.
- * src/sfnt/ttload.c (check_table_dir): Return
- `SFNT_Err_Table_Missing' when sfnt table directory structure is
- correct but essential tables for TrueType fonts (`head', `bhed' or
- `SING') are missing. Other errors are returned by
- SFNT_Err_Unknown_File_Format.
-
- * src/base/ftobjs.c (FT_Open_Face): When TrueType driver returns
- `FT_Err_Table_Missing', try `open_face_PS_from_sfnt_stream'. It is
- enabled only when old mac font support is configured.
-
-2008-10-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * include/freetype/tttags.h (TTAG_CID, TTAG_FOND, TTAG_LWFN,
- TTAG_POST, TTAG_sfnt, TTAG_TYP1, TTAG_typ1): New tags to simplify
- the repeated calculations of these values in ftobjs.c and ftmac.c.
- * src/base/ftobjs.c: Replace all FT_MAKE_TAG by new tags.
- * src/base/ftmac.c: Ditto.
- * builds/mac/ftmac.c: Ditto.
-
-2008-10-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (ft_lookup_PS_in_sfnt_stream): Remove wrong
- initialization of *is_sfnt_cid.
-
-2008-10-04 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Remove compiler
- warnings.
-
-2008-10-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Replaced by...
- (ft_lookup_PS_in_sfnt_stream): This.
- (open_face_PS_from_sfnt_stream): New function. It checks whether
- the stream is sfnt-wrapped Type1 PS font or sfnt-wrapped CID-keyed
- font, then try to open a face for given face_index.
- (Mac_Read_sfnt_Resource): Replace the combination of
- `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' by
- `open_face_PS_from_sfnt_stream'.
- * src/base/ftmac.c (FT_New_Face_From_SFNT): Ditto.
- * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto.
- * src/base/ftbase.h: Remove `ft_lookup_PS_in_sfnt' and add
- `open_face_PS_from_sfnt_stream'.
-
-2008-10-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (ft_lookup_PS_in_sfnt): Set *is_sfnt_cid to
- FALSE if neither `CID ' nor `TYP1' is found in the sfnt container.
-
-2008-10-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * include/freetype/config/ftconfig.h: Define FT_MACINTOSH when SC or
- MrC compiler of MPW is used. These compilers do not define the
- macro __APPLE__ by themselves.
- * builds/unix/ftconfig.in: Ditto.
- * builds/vms/ftconfig.h: Ditto.
- * src/base/ftbase.c: Use FT_MACINTOSH instead of __APPLE__, to
- include ftmac.c if FreeType 2 is built by MPW.
- * src/base/ftobjs.c: Use FT_MACINTOSH instead of __APPLE__, to
- enable shared functions for ftmac.c if FreeType 2 is built by MPW.
-
- * builds/mac/ftmac.c: Include ftbase.h.
- (memory_stream_close): Removed.
- (new_memory_stream): Ditto.
- (open_face_from_buffer): Removed. Use the implementation in
- ftobjs.c.
- (ft_lookup_PS_in_sfnt): Ditto.
-
- * builds/mac/FreeType.m68k_far.make.txt: Build ftmac.c as an
- included part of ftbase.c, to share the functions in ftobjs.c. The
- rule compiling ftmac.c separately is removed and the rule copying
- ftbase.c from src/base/ftbase.c to builds/mac/ftbase.c is added.
- * builds/mac/FreeType.m68k_cfm.make.txt: Ditto.
- * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
- * builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
-
-2008-10-02 Bram Tassyns <bramt@enfocus.be>
-
- * src/cff/cffgload.c (cff_slot_load): Map CID 0 to GID 0. This
- fixes Savannah bug #24430.
-
-2008-10-02 Werner Lemberg <wl@gnu.org>
-
- * builds/freetype.mk (BASE_H): Rename to...
- (INTERNAL_H): This.
- (FREETYPE_H): Updated.
- * src/base/rules.mk: (BASE_OBJ_S, OBJ_DIR/%.$O): Add BASE_H.
- * src/bdf/rules.mk (BDF_DRV_H): Add bdferror.h.
- * src/cache/rules.mk (CACHE_DRV_H): Add ftccache.h and ftcsbits.h.
- * src/pcf/rules.mk (PCF_DRV_H): Add pcfread.h.
- * src/raster/rules.mk (RASTER_DRV_H): Add ftmisc.h.
- * src/type42/rules.mk (T42_DRV_H): Add t42types.h.
-
-2008-10-02 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftbase.h: New file to declare the private utility
- functions shared by the sources of base modules. Currently,
- `ft_lookup_PS_in_sfnt' and `open_face_from_buffer' are declared to
- share between ftobjs.c and ftmac.c.
-
- * src/base/rule.mk: Add ftbase.h.
-
- * src/base/ftobjs.c: Include ftbase.h.
- (memory_stream_close): Build on any platform when old MacOS font
- support is enabled.
- (new_memory_stream): Ditto.
- (open_face_from_buffer): Build on any platform when old MacOS font
- support is enabled. The counting of the face in a font file is
- slightly different between Carbon-dependent parser and Carbon-free
- parser. They are merged with the platform-specific conditional.
- (ft_lookup_PS_in_sfnt): Ditto.
-
- * src/base/ftmac.c: Include ftbase.h.
- (memory_stream_close): Removed.
- (new_memory_stream): Ditto.
- (open_face_from_buffer): Removed. Use the implementation in
- ftobjs.c.
- (ft_lookup_PS_in_sfnt): Ditto.
-
-2008-10-02 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): `psnames_error' is only needed
- if TT_CONFIG_OPTION_POSTSCRIPT_NAMES is defined.
-
-2008-10-01 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttobjs.c (tt_face_done), src/cff/cffobjs.c
- (cff_face_done), src/pfr/pfrobjs.c (pfr_face_done),
- src/pcf/pcfdrivr.c (PCF_Face_Done), src/cid/cidobjs.c
- (cid_face_done), src/bdf/bdfdrivr. (BDF_Face_Done),
- src/sfnt/sfobjs.c (sfnt_face_done): Protect against face == 0.
- Reported by Graham Asher.
-
-2008-09-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/rules.mk: Add conditional source to BASE_SRC, for `make
- multi' on Mac OS X. If the macro $(ftmac_c) is defined,
- $(BASE_DIR)/$(ftmac_c) is added to BASE_SRC. In a normal build, the
- lack of ftmac.c in BASE_SRC is not serious because ftbase.c includes
- ftmac.c.
- * builds/unix/unix-def.in: Add a macro definition of $(ftmac_c).
- * builds/unix/configure.raw: Add procedure to set up appropriate
- value of $(ftmac_c) with the consideration of the availability of
- Carbon framework.
-
-2008-09-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/Jamfile: Add target for multi build by jam on Mac OS X.
- * src/base/ftobjs.c (FT_New_Face): Fix the condition to include this
- function for MPW building. It is synchronized the condition to
- include ftmac.c source into ftbase.c.
-
-2008-09-22 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (CFF_Operator, cff_argument_counts,
- cff_decoder_parse_charstrings): Handle (invalid)
- `callothersubr' and `pop' instructions.
-
-2008-09-22 John Tytgat <John.Tytgat@esko.com>
-
- Fix Savannah bug #24307.
-
- * include/freetype/internal/t1types.h (CID_FaceRec),
- src/type42/t42types.h (T42_FaceRec): Comment out `afm_data'.
-
-2008-09-21 Werner Lemberg <wl@gnu.org>
-
- * src/smooth/ftgrays.c (gray_raster_render): Don't dereference
- `target_map' if FT_RASTER_FLAG_DIRECT is set. Problem reported by
- Stephan T. Lavavej <stl@nuwen.net>.
-
-2008-09-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/otvalid/Jamfile: Add missing target `otvmath' for multi build
- by jam.
- * src/sfnt/Jamfile: Add missing target `ttmtx' for multi build by
- jam.
-
-2008-09-20 Werner Lemberg <wl@gnu.org>
-
- * src/smooth/ftgrays.c (gray_find_cell): Fix threshold. The values
- passed to this function are already `normalized'. Problem reported
- by Stephan T. Lavavej <stl@nuwen.net>.
-
- * docs/CHANGES: Document it.
-
-2008-09-20 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftoutln.c: Include FT_INTERNAL_DEBUG_H.
- (FT_Outline_Decompose): Decorate with tracing messages.
-
- * src/smooth/ftgrays.c [DEBUG_GRAYS]: Replace with
- FT_DEBUG_LEVEL_TRACE.
- [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: Include stdio.h and
- stdarg.h.
-
- (FT_TRACE) [_STANDALONE_]: Remove.
- (FT_Message) [_STANDALONE_ && FT_DEBUG_LEVEL_TRACE]: New function.
- (FT_TRACE5, FT_TRACE7) [_STANDALONE_]: New macros.
- (FT_ERROR) [_STANDALONE_]: Updated.
-
- (gray_hline) [FT_DEBUG_LEVEL_TRACE]: Fix condition.
- Use FT_TRACE7.
- (gray_dump_cells): Make it `static void'.
- (gray_convert_glyph): Use FT_TRACE7.
-
- (FT_Outline_Decompose) [_STANDALONE_]: Synchronize with version in
- ftoutln.c.
-
- * src/base/ftadvanc.c (FT_Get_Advance, FT_Get_Advances): Use
- FT_ERROR_BASE.
-
- * docs/formats.txt: Updated.
-
-2008-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c: Import sfnt-wrapped Type1 and sfnt-wrapped
- CID-keyed font support.
- * builds/mac/ftmac.c: Ditto.
-
-2008-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Fix double free bug in
- sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font support code.
- `open_face_from_buffer' frees the passed buffer if it cannot open a
- face from the buffer, so the caller must not free it.
-
-2008-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add initial support
- for sfnt-wrapped Type1 and sfnt-wrapped CID-keyed font.
- (ft_lookup_PS_in_sfnt): New function to look up `TYP1' or `CID '
- table in sfnt table directory. It is used before loading TrueType
- font driver.
-
- * docs/CHANGES: Add note about the current status of sfnt-wrapped
- Type1 and sfnt-wrapped CID-keyed font support.
-
-2008-09-18 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftsystem.c (FT_Done_Memory): Use ft_sfree directly for
- orthogonality (ft_free and ft_sfree could belong to different memory
- pools). This fixes Savannah bug #24297.
-
-2008-09-18 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/cff/cffobjs.c (cff_face_init): Use TTAG_OTTO defined
- in tttags.h instead of numerical value 0x4F54544FL.
-
-2008-09-16 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.h, src/cff/cffgload.c
- (cff_decoder_set_width_only): Eliminate function call.
-
-2008-09-15 George Williams <gww@silcom.com>
-
- Fix Savannah bug #24179, reported by Bram Tassyns.
-
- * src/type1/t1load.c (mm_axis_unmap, T1_Get_MM_Var): Fix computation
- of default values.
-
-2008-09-15 Werner Lemberg <wl@gnu.org>
-
- * src/tools/glnames.py (main): Surround `ft_get_adobe_glyph_index'
- and `ft_adobe_glyph_list' with FT_CONFIG_OPTION_ADOBE_GLYPH_LIST to
- prevent unconditional definition. This fixes Savannah bug #24241.
-
- * src/psnames/pstables.h: Regenerated.
-
-2008-09-13 Werner Lemberg <wl@gnu.org>
-
- * autogen.sh, builds/unix/configure.raw,
- include/freetype/config/ftconfig.h, builds/unix/ftconfig.in: Minor
- beautifying.
-
- * include/freetype/ftadvanc.h, include/freetype/ftgasp.h,
- include/freetype/ftlcdfil.h: Protect against FreeType 1.
- Some other minor fixes.
-
- * devel/ftoption.h: Synchronize with
- include/freetype/config/ftoption.h.
-
-2008-09-11 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftbase.c: Include ftadvanc.c.
-
-2008-09-11 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/ftconfig.in: Duplicate the cpp computation of
- FT_SIZEOF_{INT|LONG} from include/freetype/config/ftconfig.h.
- (FT_USE_AUTOCONF_SIZEOF_TYPES): New macro. If defined, the cpp
- computation is disabled and the statically configured sizes are
- used. This fixes Savannah bug #21250.
-
- * builds/unix/configure.raw: Add the checks to compare the cpp
- computation results of the bit length of int and long versus the
- sizes detected by running `configure'. If the results are
- different, FT_USE_AUTOCONF_SIZEOF_TYPES is defined to prioritize the
- results.
- New option --{enable|disable}-biarch-config is added to define or
- undefine FT_USE_AUTOCONF_SIZEOF_TYPES manually.
-
-2008-09-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: Clear FT2_EXTRA_LIBS when Carbon or
- ApplicationServices framework is missing. Although this value is not
- used in building of FreeType2, it is written in `freetype2.pc' and
- `freetype-config'.
-
-2008-09-01 David Turner <david@freetype.org>
-
- * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Accept a negative cmap
- index to mean `use default cached FT_Face's charmap'. This fixes
- Savannah bug #22625.
- * include/freetype/ftcache.h: Document it.
-
-
- Make FT_MulFix an inlined function. This is done to speed up
- FreeType a little (on x86 3% when loading+hinting, 10% when
- rendering, ARM savings are more important though). Disable this by
- undefining FT_CONFIG_OPTION_INLINE_MULFIX.
-
- Use of assembler code can now be controlled with
- FT_CONFIG_OPTION_NO_ASSEMBLER.
-
- * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in
- [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_arm): New assembler
- implementation.
- [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MulFix_i386): Assembler
- implementation taken from `ftcalc.c'.
- [!FT_CONFIG_OPTION_NO_ASSEMBLER] (FT_MULFIX_ASSEMBLER): New macro
- which is defined to the platform-specific assembler implementation
- of FT_MulFix.
- [FT_CONFIG_OPTION_INLINE_MULFIX && FT_MULFIX_ASSEMBLER]
- (FT_MULFIX_INLINED): New macro.
-
- * include/freetype/config/ftoption.h (FT_CONFIG_OPTION_NO_ASSEMBLER,
- FT_CONFIG_OPTION_INLINE_MULFIX): New macros.
-
- * include/freetype/freetype.h: Updated to handle FT_MULFIX_INLINED.
-
- * src/base/ftcalc.c: Updated to use FT_MULFIX_ASSEMBLER and
- FT_MULFIX_INLINED.
-
-
- Add a new header named FT_ADVANCES_H declaring some new APIs to
- extract the advances of one or more glyphs without necessarily
- loading their outlines. Also provide `fast loaders' for the
- TrueType, Type1, and CFF font drivers (more to come later).
-
- * src/base/ftadvanc.c, include/freetype/ftadvanc.h: New files.
-
- * include/freetype/config/ftheader.h (FT_ADVANCES_H): New macro.
- * include/freetype/freetype.h (FT_LOAD_ADVANCE_ONLY): New macro.
-
- * include/freetype/internal/ftdriver.h (FT_Face_GetAdvancesFunc):
- `flags' and `advances' are now of type `FT_UInt' and `FT_Fixed',
- respectively.
-
- * src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC): Add
- ftadvanc.c.
-
- * src/cff/cffdrivr.c (cff_get_advances): New function.
- (cff_driver_class): Register it.
-
- * src/cff/cffgload.c (cff_decoder_set_width_only): New function.
- (cff_decoder_parse_charstrings): Handle `width_only'.
- (cff_slot_load): Handle FT_LOAD_ADVANCE_ONLY.
-
- * src/cff/cffgload.h (cff_decoder): New element `width_only'.
- (cff_decoder_set_width_only): New declaration.
-
- * src/truetype/ttdriver.c (tt_get_advances): New function.
- (tt_driver_class): Register it.
-
- * src/truetype/ttgload.c (Get_HMetrics, Get_VMetrics): Renamed to...
- (TT_Get_HMetrics, TT_Get_VMetrics): This.
- Update callers.
- * src/truetype/ttgload.h: Declare them.
-
- * src/type1/t1gload.h, src/type1/t1gload.c (T1_Get_Advances): New
- function.
- * src/type1/t1driver.c (t1_driver_class): Register T1_Get_Advances.
-
-
- Add checks for minimum version of the `autotools' stuff.
-
- * autogen.sh: Implement it.
- (get_major_version, get_minor_version, get_patch_version,
- compare_to_minimum_version, check_tool_version): New auxiliary
- functions.
-
- * README.CVS: Document it.
-
-2008-08-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/sfnt/sfobjs.c (sfnt_open_font): Use TTAG_OTTO defined in
- tttags.h instead of FT_MAKE_TAG( 'O', 'T', 'T', 'O' ).
-
-2008-08-28 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_encoding): Protect against infinite
- loop. This fixes Savannah bug #24150 (where a patch has been posted
- too).
-
-2008-08-23 Werner Lemberg <wl@gnu.org>
-
- * src/type/t1afm.c (compare_kern_pairs), src/psaux/afmparse.c
- (afm_compare_kern_pairs): Fix comparison. This fixes Savannah bug
- #24119.
-
-2008-08-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (FT_Stream_New): Initialize *astream always,
- even if passed library or arguments are invalid. This fixes a bug
- that an uninitialized stream is freed when an invalid library handle
- is passed. Originally proposed by Mike Fabian, 2008/08/18 on
- freetype-devel.
- (FT_Open_Face): Ditto (stream).
- (load_face_in_embedded_rfork): Ditto (stream2).
-
-2008-08-18 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c: Add a fallback to guess the availability of the
- `ResourceIndex' type. It is used when built without configure
- (e.g., a build with Jam).
- * builds/mac/ftmac.c: Ditto.
- * builds/unix/configure.raw: Set HAVE_TYPE_RESOURCE_INDEX to 1 or 0
- explicitly, even if `ResourceIndex' is unavailable.
-
-2008-08-18 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: In checking of Mac OS X features,
- all-in-one header file `Carbon.h' is replaced by the minimum
- header file `CoreServices.h', similar to current src/base/ftmac.c.
-
-2008-08-18 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/sfnt/ttcmap.c (tt_cmap2_validate): Skip the validation of
- sub-header when its code_count is 0. Many Japanese Dynalab fonts
- include such an empty sub-header (code_count == 0, first_code == 0
- delta == 0, but offset != 0) as the second sub-header in SJIS cmap.
-
-2008-08-04 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1tokens.h: Handle `ForceBold' keyword. This fixes
- Savannah bug #23995.
-
- * src/cid/cidload.c (parse_expansion_factor): New callback function.
- (cid_field_records): Use it for `ExpansionFactor'.
- * src/cod/cidtoken.h: Handle `ForceBold' keyword.
- Don't handle `ExpansionFactor'.
-
-2008-08-04 Bram Tassyns <bramt@enfocus.be>
-
- * src/cff/cffparse.c (cff_parse_fixed_scaled): Fix thinko which
- resulted in incorrect scaling. This fixes Savannah bug #23973.
-
-2008-08-04 Werner Lemberg <wl@gnu.org>
-
- Be more tolerant w.r.t. invalid entries in SFNT table directory.
-
- * src/sfnt/ttload.c (check_table_dir): Ignore invalid entries and
- adjust table count.
- Add more trace messages.
- (tt_face_load_font_dir): Updated.
-
-2008-07-30 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): No longer
- assume that the first argument on the stack is the bottom-most
- element. Two reasons:
-
- o According to people from Adobe it is missing in the Type 2
- specification that pushing of additional, superfluous arguments
- on the stack is prohibited.
-
- o Acroread in general handles fonts differently, namely by popping
- the number of arguments needed for a particular operand (as a PS
- interpreter would do). In case of buggy fonts this causes a
- different interpretation which of the elements on the stack are
- superfluous and which not.
-
- Since there are CFF subfonts (embedded in PDFs) which rely on
- Acroread's behaviour, FreeType now does the same.
-
-2008-07-27 Werner Lemberg <wl@gnu.org>
-
- Add extra mappings for `Tcommaaccent' and `tcommaaccent'. This
- fixes Savannah bug #23940.
-
- * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): Rename to...
- (EXTRA_GLYPH_LIST_SIZE): This.
- Increase by 2.
- (ft_wgl_extra_unicodes): Rename to...
- (ft_extra_glyph_unicodes): This.
- Add two code values.
- (ft_wgl_extra_glyph_names): Rename to...
- (ft_extra_glyph_names): This.
- Add two glyphs.
- (ft_wgl_extra_glyph_name_offsets): Rename to...
- (ft_extra_glyph_name_offsets): This.
- Add two offsets.
-
- (ps_check_wgl_name, ps_check_wgl_unicode): Rename to...
- (ps_check_extra_glyph_name, ps_check_extra_glyph_unicode): This.
- Updated.
- (ps_unicodes_init): Updated.
-
-2008-07-26 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (cff_decoder_prepare,
- cff_decoder_parse_charstrings): Improve debug output.
-
-2008-07-22 Martin McBride <mmcbride@emtex.com>
-
- * src/sfnt/ttcmap.c (tt_cmap4_validate, tt_cmap4_char_map_linear,
- tt_cmap4_char_map_binary): Handle fonts which treat the last segment
- specially. According to the specification, such fonts would be
- invalid but acroread accepts them.
-
-2008-07-16 Jon Foster <Jon.Foster@cabot.co.uk>
-
- * src/pfr/pfrdrivr.c (pfr_get_advance): Fix off-by-one error.
-
- * src/base/ftcalc.c (FT_MulFix): Fix portability issue.
-
- * src/sfnt/ttpost.c (MAC_NAME) [!FT_CONFIG_OPTION_POSTSCRIPT_NAMES]:
- Fix compiler warning.
-
-2008-07-16 Werner Lemberg <wl@gnu.org>
-
- Handle CID-keyed fonts wrapped in an SFNT (with cmaps) correctly.
-
- * src/cff/cffload.c (cff_font_load): Pass `pure_cff'.
- Invert sids table only if `pure_cff' is set.
- * src/cff/cffload.h: Updated.
-
- * src/cff/cffobjs.c (cff_face_init): Updated.
- Set FT_FACE_FLAG_CID_KEYED only if pure_cff is set.
-
- * docs/CHANGES: Updated.
-
-2008-07-09 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttpload.c (tt_face_load_loca): Handle buggy fonts
- where num_locations < num_glyphs. Problem reported by Ding Li.
-
-2008-07-05 Werner Lemberg <wl@gnu.org>
-
- Since FreeType uses `$(value ...)', we now need GNU make 3.80 or
- newer. This fixes Savannah bug #23648.
-
- * configure: zsh doesn't like ${1+"$@"}.
- Update needed GNU make version.
- * builds/toplevel.mk: Check for `$(eval ...)'.
- * docs/INSTALL.GNU, docs/INSTALL.CROSS, docs/INSTALL.UNIX: Document
- it.
-
-2008-07-04 Werner Lemberg <wl@gnu.org>
-
- * src/raster/ftraster.c (Draw_Sweep): If span is smaller than one
- pixel, only check for dropouts if neither start nor end point lies
- on a pixel center. This fixes Savannah bug #23762.
-
-2008-06-29 Werner Lemberg <wl@gnu.org>
-
- * Version 2.3.7 released.
- =========================
-
-
- Tag sources with `VER-2-3-7'.
-
- * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
- version number to 2.3.7.
-
- * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj: s/2.3.6/2.3.7/, s/236/237/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7.
-
- * builds/unix/configure.raw (version_info): Set to 9:18:3.
-
- * docs/release: Updated.
-
-2008-06-28 Werner Lemberg <wl@gnu.org>
-
- * src/ftglyph.c (FT_Matrix_Multiply, FT_Matrix_Invert): Move to...
- * src/ftcalc.c: Here. This fixes Savannah bug #23729.
-
-2008-06-27 Werner Lemberg <wl@gnu.org>
-
- * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
- Horizontal_Gray_Sweep_Drop): Test for intersections which
- degenerate to a single point can be ignored; this has been confirmed
- by Greg Hitchcock from Microsoft. (This was commented out code.)
-
-2008-06-26 Werner Lemberg <wl@gnu.org>
-
- Improve navigation in API reference.
-
- * src/tools/docmaker/tohtml.py (html_header_3): Renamed to...
- (html_header_6): This.
- (html_header_3, html_header_3i, html_header_4, html_header_5,
- html_header_5t): New strings.
- (toc_footer_start, toc_footer_end): New strings.
- (HtmlFormatter::html_header): Updated.
- (HtmlFormatter::html_index_header, HtmlFormatter::html_toc_header):
- New strings.
- (HtmlFormatter::index_enter): Use `html_index_header'.
- (HtmlFormatter::index_exit): Print `html_footer'.
- (HtmlFormatter::toc_enter): Use `html_toc_header'.
- (HtmlFormatter::toc_exit): Print proper footer.
-
- Convert ~ to non-breakable space.
-
- * src/tools/docmaker/tohtml.py (make_html_para): Implement it.
- Update header files accordingly.
-
-2008-06-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: Check type `ResourceIndex' explicitly
- and define HAVE_TYPE_RESOURCE_INDEX if it is defined. Mac OS X 10.5
- bundles 10.4u SDK with MAC_OS_X_VERSION_10_5 macro but without
- ResourceIndex type definition. The macro does not inform the type
- availability.
- * src/base/ftmac.c: More parentheses are inserted to clarify the
- conditionals to disable legacy APIs in `10.5 and later' cases. If
- HAVE_TYPE_RESOURCE_INDEX is not defined, ResourceIndex is defined.
-
-2008-06-24 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Ins_SCANTYPE): Don't check rendering
- mode.
-
- * src/raster/ftraster.c (Render_Glyph, Render_Gray_Glyph,
- Draw_Sweep): No-dropout mode is value 2, not value 0.
- (Draw_Sweep): Really skip dropout handling for no-dropout mode.
-
-2008-06-24 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/psobjs.c (t1_builder_close_contour): Don't add contour
- if it consists of one point only. Based on a patch from Savannah
- bug #23683 (from John Tytgat).
-
-2008-06-22 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (TT_Load_Glyph): Protect bytecode stuff
- with IS_HINTED.
-
- * docs/CHANGES: Updated.
-
-2008-06-22 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: If CFLAGS has `-isysroot XXX' option
- but LDFLAGS does not, import it to LDFLAGS. The option is used to
- specify non-default SDK on Mac OS X (e.g., universal binary SDK for
- Mac OS X 10.4 on PowerPC platform). Although Apple TechNote 2137
- recommends to add the option only to CFLAGS, LDFLAGS should include
- it because libfreetype.la is built with -no-undefined. This fixes a
- bug reported by Ryan Schmidt in MacPorts,
- https://trac.macports.org/ticket/15331.
-
-2008-06-21 Werner Lemberg <wl@gnu.org>
-
- Enable access to the various dropout rules of the B&W rasterizer.
- Pass dropout rules from the TT bytecode interpreter to the
- rasterizer.
-
- * include/freetype/ftimage.h (FT_OUTLINE_SMART_DROPOUTS,
- FT_OUTLINE_EXCLUDE_STUBS): New flags for FT_Outline.
-
- * src/raster/ftraster.c (Vertical_Sweep_Drop, Horizontal_Sweep_Drop,
- Horizontal_Gray_Sweep_Drop): Use same mode numbers as given in the
- OpenType specification.
- Fix mode 4 computation.
- (Render_Glyph, Render_Gray_Glyph): Handle new outline flags.
-
- * src/truetype/ttgload.c (TT_Load_Glyph) Convert scan conversion
- mode to FT_OUTLINE_XXX flags.
-
- * src/truetype/ttinterp.c (Ins_SCANCTRL): Enable ppem check.
-
-2008-06-19 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): Compute final
- `dict->units_per_em' value before assigning it to
- `cffface->units_per_EM'. Otherwise, CFFs without subfonts are
- scaled incorrectly if the font matrix is non-standard. This fixes
- Savannah bug #23630.
-
- * docs/CHANGES: Updated.
-
-2008-06-19 Werner Lemberg <wl@gnu.org>
-
- * src/type/t1objs.c (T1_Face_Init): Slightly improve algorithm fix
- from 2008-06-19.
-
-2008-06-18 Werner Lemberg <wl@gnu.org>
-
- * src/type/t1objs.c (T1_Face_Init): Fix change from 2008-03-21.
- Reported by Peter Weilbacher <mozilla@weilbacher.org>.
-
- * docs/CHANGES: Updated.
-
-2008-06-15 George Williams <gww@silcom.com>
-
- * src/otvalid/otvgpos.c (otv_MarkBasePos_validate): Set
- `valid->extra2' to 1. This is undocumented in the OpenType 1.5
- specification.
-
-2008-06-15 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftcalc.c (FT_MulFix) <asm>: Protect registers correctly
- from clobbering. Patch from Savannah bug report #23556.
-
- * docs/CHANGES: Document it.
-
-2008-06-10 Werner Lemberg <wl@gnu.org>
-
- * autogen.sh: Add option `--install' to libtoolize.
-
-2008-06-10 Werner Lemberg <wl@gnu.org>
-
- * Version 2.3.6 released.
- =========================
-
-
- Tag sources with `VER-2-3-6'.
-
- * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
- version number to 2.3.6.
-
- * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj: s/2.3.5/2.3.6/, s/235/236/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6.
-
- * builds/unix/configure.raw (version_info): Set to 9:17:3.
-
-
- * include/freetype/internal/psaux.h (T1_BuilderRec): Remove `scale_x'
- and `scale_y'.
- * src/cff/cffgload.h (CFF_Builder): Remove `scale_x' and `scale_y'.
-
-
- * src/cff/cffparse.c: Include FT_INTERNAL_DEBUG_H.
- * src/cff/cffobjs.h: Include FT_INTERNAL_POSTSCRIPT_HINTS_H.
-
-2008-06-10 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (open_face): Check `clazz->init_face' and
- `clazz->done_face'.
-
-2008-06-09 VaDiM <s_sliva@rambler.ru>
-
- Support debugging on WinCE. From Savannah patch #6536; this fixes
- bug #23497.
-
- * builds/win32/ftdebug.c (OutputDebugStringEx): New function/macro
- as a replacement for OutputDebugStringA (which WinCE doesn't have).
- Update all callers.
- (ft_debug_init) [_WIN32_CE]: WinCE apparently doesn't have
- environment variables.
-
-2008-06-09 Werner Lemberg <wl@gnu.org>
-
- * README.CVS: Updated.
-
- * builds/unix/configure.raw, builds/unix/freetype-config.in: Updated
- for newer versions of autoconf and friends.
-
-2008-06-08 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1parse.h (T1_ParserRec): Make `base_len' and
- `private_len' unsigned.
-
- * src/type1/t1parse.c (read_pfb_tag): Make `asize' unsigned and read
- it as such.
- (T1_New_Parser, T1_Get_Private_Dict): Make `size' unsigned.
-
-
- * src/base/ftstream.c (FT_Stream_Skip): Reject negative values.
-
-
- * src/type1/t1load.c (parse_blend_design_positions): Check `n_axis'
- for sane value.
- Fix typo.
-
-
- * src/psaux/psobjs.c (ps_table_add): Check `idx' correctly.
-
-
- * src/truetype/ttinterp (Ins_SHC): Use BOUNDS() to check
- `last_point'.
-
-
- * src/sfnt/ttload.c (tt_face_load_max_profile): Limit
- `maxTwilightPoints'.
-
-2008-06-06 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Ins_IP): Handle case `org_dist == 0'
- correctly. This fixes glyphs `t' and `h' of Arial Narrow at 12ppem.
-
-2008-06-03 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftcache.h (FTC_FaceID): Change type back to
- FT_Pointer. Reported by Ian Britten <britten@caris.com>.
-
-2008-06-02 Werner Lemberg <wl@gnu.org>
-
- Emit header info for defined FreeType objects in reference.
-
- * src/tools/docmaker/content.py (re_header_macro): New regexp.
- (ContentProcessor::__init__): Initialize new dictionary `headers'.
- (DocBlock::__init__): Collect macro header definitions.
-
- * src/tools/docmaker/tohtml.py (header_location_header,
- header_location_footer): New strings.
- (HtmlFormatter::__init__): Pass `headers' dictionary.
- (HtmlFormatter::print_html_field): Don't emit paragraph tags.
- (HtmlFormatter::print_html_field_list): Emit empty paragraph.
- (HtmlFormatter::block_enter): Emit header info.
-
-2008-06-01 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftheader.h (FT_UNPATENTED_HINTING_H,
- FT_INCREMENTAL_H): Added.
-
-2008-05-28 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/sources.py (SourceBlock::__init__): While
- looking for markup tags, return immediately as soon a single one is
- found.
-
-2008-05-28 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Ins_MD): The MD instruction also uses
- original, unscaled input values. Confirmed by Greg Hitchcock from
- Microsoft.
-
-2008-05-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py (block_footer_start,
- block_footer_middle): Beautify output.
-
-2008-05-25 Werner Lemberg <wl@gnu.org>
-
- * src/raster/ftraster.c (fc_black_render): Return 0 when we are
- trying to render into a zero-width/height bitmap, not an error code.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Move initialization
- of the graphics state for subglyphs to...
- (TT_Hint_Glyph): This function.
- Hinting instructions for a composite glyph apparently refer to the
- just hinted subglyphs, not the unhinted, unscaled outline. This
- seems to fix Savannah bugs #20973 and (at least partially) #23310.
-
-2008-05-20 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c (FT_New_Face_From_Suitcase): Check if valid
- `aface' is returned by FT_New_Face_From_FOND(). The patch was
- proposed by an anonymous reporter of Savannah bug #23204.
-
-2008-05-18 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshalgo.c (ps_hints_apply): Reset scale values after
- correction for pixel boundary. Without this patch, the effect can
- be cumulative under certain circumstances, making glyphs taller and
- taller after each call. This fixes Savannah bug #19976.
-
-2008-05-18 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftdebug.c (FT_Message, FT_Panic): Send output to stderr.
- This fixes Savannah bug #23280.
-
- * docs/CHANGES: Updated.
-
-2008-05-18 David Turner <david@freetype.org>
-
- * src/psnames/psmodule.c (ft_wgl_extra_unicodes,
- ft_wgl_extra_glyph_names, ft_wgl_extra_glyph_name_offsets,
- ps_check_wgl_name, ps_check_wgl_unicode): Use `static' to make
- declarations non-global.
-
- * src/type1/t1load.c: Add missing comment.
-
-2008-05-17 Sam Hocevar <samh>
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Handle zero-contour
- glyphs correctly. Patch from Savannah bug #23277.
-
-2008-05-16 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2008-05-16 Sergey Tolstov <stolstov@esri.com>
-
- Improve support for WGL4 encoded fonts.
-
- * src/psnames/psmodule.c (WGL_EXTRA_LIST_SIZE): New macro.
- (ft_wgl_extra_unicodes, ft_wgl_extra_glyph_names,
- ft_wgl_extra_glyph_name_offsets): New arrays.
- (ps_check_wgl_name, ps_check_wgl_unicode): New functions.
- (ps_unicodes_init): Use them to add additional Unicode mappings.
-
-2008-05-15 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- <op_closepath>: `closepath' without a path is a no-op, not an error
- (cf. the PS reference manual).
-
- Reported by Martin McBride.
-
-2008-05-15 Werner Lemberg <wl@gnu.org>
-
- * builds/toplevel.mk (CONFIG_GUESS, CONFIG_SUB): Updated.
-
-2008-05-15 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_subrs): Accept fonts with a subrs array
- which contains a single but empty entry. This is technically
- invalid (since it must end with `return'), but...
-
- Reported by Martin McBride.
-
-2008-05-14 Werner Lemberg <wl@gnu.org>
-
- Finish fix of scaling bug of CID-keyed CFF subfonts.
-
- * include/freetype/internal/ftcalc.h, src/base/ftcalc.c
- (FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled): New
- functions.
-
- * src/cff/cffobjs.h (CFF_Internal): New struct. It is used to
- provide global hinting data for both the top-font and all subfonts
- (with proper scaling).
-
- * src/cff/cffobjs.c (cff_make_private_dict): New function, using
- code from `cff_size_init'.
- (cff_size_init, cff_size_done, cff_size_select, cff_size_request):
- Use CFF_Internal and handle subfonts.
- (cff_face_init): Handle top-dict and subfont matrices correctly;
- apply some heuristic in case of unlikely matrix concatenation
- results. This has been discussed with people from Adobe (thanks
- goes mainly to David Lemon) who confirm that the CFF specs are fuzzy
- and not correct.
-
- * src/cff/cffgload.h (cff_decoder_prepare): Add `size' argument.
-
- * src/cff/cffgload.c (cff_builder_init): Updated.
- (cff_decoder_prepare): Handle hints globals for subfonts.
- Update all callers.
- (cff_slot_load): Handling scaling of subfonts properly.
-
- * src/cff/cffparse.c (cff_parse_fixed_dynamic): New function.
- (cff_parse_font_matrix): Use it.
-
- * src/cff/cfftypes.h (CFF_FontDictRec): Make `units_per_em'
- FT_ULong.
-
- * docs/CHANGES: Document it.
-
-2008-05-13 Werner Lemberg <wl@gnu.org>
-
- * src/winfonts/winfnt.c (fnt_face_get_dll_font, FNT_Face_Init):
- Handle case `face_index < 0'.
- * docs/CHANGES: Document it.
-
-2008-05-04 Werner Lemberg <wl@gnu.org>
-
- First steps to fix the scaling bug of CID-keyed CFF subfonts,
- reported by Ding Li on 2008/03/28 on freetype-devel.
-
- * src/base/cff/cffparse.c (power_tens): New array.
- (cff_parse_real): Rewritten to introduce a fourth parameter which
- returns the `scaling' of the real number so that we have no
- precision loss. This is not used yet.
- Update all callers.
- (cff_parse_fixed_thousand): Replace with...
- (cff_parse_fixed_scaled): This function. Update all callers.
-
-2008-05-03 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Load_Glyph): Call the auto-hinter without
- transformation since it recursively calls FT_Load_Glyph. This fixes
- Savannah bug #23143.
-
-2008-04-26 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/psaux.h (T1_BuilderRec): Mark `scale_x'
- and `scale_y' as obsolete since they aren't used.
- * src/psaux/psobjs.c (t1_builder_init): Updated.
-
- * src/cff/cffgload.h (CFF_Builder): Mark `scale_x' and `scale_y' as
- obsolete since they aren't used.
- * src/cff/cffgload.c (cff_builder_init): Updated.
-
-2008-04-14 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfdrivr.c (PCF_Face_Init): Protect call to
- `FT_Stream_OpenLZW' with `FT_CONFIG_OPTION_USE_LZW'. From Savannah
- bug #22909.
-
-2008-04-13 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/psconv.c (PS_Conv_ToFixed): Increase precision if
- integer part is zero.
-
-2008-04-01 Werner Lemberg <wl@gnu.org>
-
- Fix compilation with g++ 4.1 (with both `single' and `multi'
- targets).
-
- * src/base/ftobjs.c (FT_Open_Face): Don't define a variable in block
- which is crossed by a `goto'.
-
- * src/otvalid/otvalid.h (otv_MATH_validate): Add prototype.
-
-2008-03-31 Werner Lemberg <wl@gnu.org>
-
- Fix support for subsetted CID-keyed CFFs.
-
- * include/freetype/freetype.h (FT_FACE_FLAG_CID_KEYED,
- FT_IS_CID_KEYED): New macros.
-
- * src/cff/cffobjs.c (cff_face_init): Set number of glyphs to the
- maximum CID value in CID-keyed CFFs.
- Handle FT_FACE_FLAG_CID_KEYED flag.
-
- * docs/CHANGES: Document it.
-
-
- Fix CFF font matrix calculation and improve precision.
-
- * src/cff/cffparse.c (cff_parse_real): Increase precision if integer
- part is zero.
- (cff_parse_font_matrix): Simplify computation of `units_per_em';
- this prevents overflow also.
-
-
- Support FT_Get_CID_Registry_Ordering_Supplement for PS CID fonts.
-
- * src/cid/cidriver.c: Include FT_SERVICE_CID_H.
- (cid_get_ros): New function.
- (cid_service_cid_info): New service structure.
- (cid_services): Register it.
-
-2008-03-23 Werner Lemberg <wl@gnu.org>
-
- Adjustments for Visual C++ 8.0, as reported by Rainer Deyke.
-
- * builds/compiler/visualc.mk (CFLAGS): Remove /W5.
- (ANSIFLAGS): Add _CRT_SECURE_NO_DEPRECATE.
-
-2008-03-21 Laurence Darby <ldarby>
-
- * src/type1/t1objs.c (T1_Face_Init): Use `/Weight'. Patch from
- Savannah bug #22675.
-
-2008-03-13 Derek Clegg <dclegg@apple.com>
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix named style loop.
- Patch from Savannah bug #22541.
-
-2008-03-03 Masatoshi Kimura <VYV03354@nifty.ne.jp>
-
- * src/sfnt/ttcmap.c (tt_cmap14_char_map_nondef_binary,
- tt_cmap14_find_variant): Return correct value.
- (tt_cmap14_variant_chars): Fix check for `di'.
-
-2008-02-29 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2008-02-29 Wolf
-
- Add build support for symbian platform. From Savannah bug #22440.
-
- * builds/symbian/*: New files.
-
-2008-02-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c (parse_fond): Fix a bug of PostScript font name
- synthesis. For any face of a specified FOND, always the name for
- the first face was used. Except of a FOND that refers multiple
- Type1 font files, wrong synthesized font names are not used at all,
- so this is an invisible bug. A few limit checks are added too.
-
- * builds/mac/ftmac.c: Ditto.
-
-2008-02-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: Split compiler option to link Carbon
- frameworks to one option for CoreServices framework and another
- option for ApplicationServices framework. The split options can be
- managed by GNU libtool to avoid unrequired duplication when FreeType
- is linked with other applications. Suggested by Daniel Macks,
- Savannah bug #22366.
-
-2008-02-18 Victor Stinner <victor.stinner@haypocalc.com>
-
- * src/truetype/ttinterp.c (Ins_IUP): Check number of points. Fix
- from Savannah bug #22356.
-
-2008-02-17 Jonathan Blow <jon@number-none.com>
-
- * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
- Check for valid callback pointers.
-
-2008-02-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c (FT_New_Face_From_SFNT): Check the sfnt resource
- handle by its value instead of ResError(), fix provided by Deron
- Kazmaier. According to the Resource Manager Reference,
- GetResource(), Get1Resource(), GetNamedResource(),
- Get1NamedResource() and RGetResource() set noErr but return NULL
- handle when they can not find the requested resource. These
- functions never return undefined values, so it is sufficient to
- check if the handle is not NULL.
-
- * builds/mac/ftmac.c (FT_New_Face_From_SFNT): Ditto.
-
-2008-02-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftbase.c: <ftmac.c> is replaced by "ftmac.c" as other
- inclusion styles. Now it always includes src/base/ftmac.c;
- builds/mac/ftmac.c is never included in any configuration.
-
- * builds/unix/configure.raw: Print warning if configure is executed
- with options to specify Carbon functionalities explicitly.
-
- * docs/INSTALL.MAC: Note that legacy builds/mac/ftmac.c is not
- included automatically and manual replacement is required.
-
-2008-02-11 Werner Lemberg <wl@gnu.org>
-
- * builds/modules.mk (CLOSE_MODULE, REMOVE_MODULE), builds/detect.mk
- (dos_setup), builds/freetype.mk (clean_project_dos,
- distclean_project_dos): Don't use \ but $(SEP). Reported by Duncan
- Murdoch.
-
-2008-01-18 Sylvain Pasche <sylvain.pasche@gmail.com>
-
- * src/base/ftlcdfil.c (_ft_lcd_filter_legacy): Updated comment to
- mention intra-pixel algorithm.
-
- * include/freetype/freetype.h (FT_Render_Mode): Mention that
- FT_Library_SetLcdFilter can be used to reduce fringes.
-
-2008-01-16 Werner Lemberg <wl@gnu.org>
-
- * src/raster/ftraster.c (ft_black_render): Check `outline' before
- using it. Reported by Allan Yang.
-
-2008-01-12 Werner Lemberg <wl@gnu.org>
-
- * src/raster/ftraster.c (FT_CONFIG_OPTION_5_GRAY_LEVELS): Remove.
-
-2008-01-12 Allan Yang, Jian Hua - SH <Allan.Yang@fmc.fujitsu.com>
-
- * src/raster/ftraster.c (ft_black_init)
- [FT_RASTER_OPTION_ANTI_ALIASING]: Fix compilation.
-
-2008-01-10 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Handle the case
- where the number of contours in a simple glyph is zero (and which
- does contain an entry in the `glyf' table). This fixes Savannah bug
- #21990.
-
-2008-01-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Formatting suggested by Sean McBride.
-
- * builds/mac/ftmac.c: Formatting (tab expanded).
- * src/autofit/afindic.c: Ditto.
- * src/base/ftcid.c: Ditto.
- * src/base/ftmac.c: Ditto.
-
-2007-12-30 Werner Lemberg <wl@gnu.org>
-
- * src/smooth/ftgrays.c (gray_raster_render): Check `outline'
- correctly.
-
-2007-12-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Improvement of POSIX resource-fork accessor to load unsorted
- references in a resource. In HelveLTMM (resource-fork PostScript
- Type1 font bundled with Mac OS X since 10.3.x), the appearance order
- of PFB chunks is not sorted; sorting the chunks by reference IDs is
- required.
-
- * include/freetype/internal/ftrfork.h (FT_RFork_Ref): New structure
- type to store a pair of reference ID and offset to the chunk.
-
- * src/base/ftrfork.c (ft_raccess_sort_ref_by_id): New function to
- sort FT_RFork_Ref by their reference IDs.
-
- (FT_Raccess_Get_DataOffsets): Returns an array of offsets that is
- sorted by reference ID.
-
-2007-12-14 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffparse.c (cff_parse_real): Don't apply `power_ten'
- division too early; otherwise the most significant digit(s) of the
- final result are lost as the value is truncated to an integer. This
- fixes Savannah bug #21794 (where the patch has been posted too).
-
-2007-12-06 Fix <4d876b82@gmail.com>
-
- Pass options from one configure script to another as-is (not
- expanded). This is needed for options like
- --includedir='${prefix}/include'.
-
- * builds/unix/detect.mk, configure: Prevent argument expansion in
- call to the (real) `configure' script.
-
-2007-12-06 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fix compilation if
- TT_USE_BYTECODE_INTERPRETER isn't defined.
-
-2007-12-06 Werner Lemberg <wl@gnu.org>
-
- There exist CFFs which contain opcodes for the Type 1 operators
- `hsbw' and `closepath' which are both invalid in Type 2 charstrings.
- However, it doesn't harm to support them.
-
- * src/cff/cffgload.c (CFF_Operator): Add `cff_op_hsbw' and
- `cff_op_closepath.'
- (cff_argument_counts): Ditto.
-
- (cff_decoder_parse_charstrings): Handle Type 1 opcodes 9 (closepath)
- and 13 (hsbw) which are invalid in Type 2 charstrings.
-
-2007-12-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftrfork.c (raccess_guess_darwin_newvfs): New function to
- support new pathname syntax `..namedfork/rsrc' to access a resource
- fork on Mac OS X. The legacy syntax `/rsrc' does not work on
- case-sensitive HFS+.
- (raccess_guess_darwin_hfsplus): Fix a bug in the calculation of
- buffer size to store a pathname.
- * include/freetype/internal/ftrfork.h: Increment the number of
- resource fork guessing rule.
-
-2007-12-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: Improve the compile tests to search
- Carbon functions.
- * builds/mac/ftmac.c: Import fixes for Carbon incompatibilities
- proposed by Sean McBride from src/base/ftmac.c (see 2007-11-16).
-
-2007-12-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- The documents and comments for Mac OS X are improved by Sean
- McBride.
-
- * src/base/ftmac.c: Fix a comment.
- * include/freetype/ftmac.h: Ditto.
- * docs/INSTALL.MAC: Improve English and add comment on lowest
- system version specified by MACOSX_DEPLOYMENT_TARGET.
-
-2007-12-04 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_subfont_load): Don't use logical OR to
- concatenate error codes.
- * src/sfnt/ttsbit.c (Load_SBit_Range): Ditto.
-
-2007-12-04 Graham Asher <graham.asher@btinternet.com>
-
- * src/truetype/ttobjs.c (tt_face_init): Don't use logical OR to
- concatenate error codes.
-
-2007-12-04 Sean McBride <sean@rogue-research.com>
-
- * src/pfr/pfrgload.c (pfr_glyph_load_compound): Remove compiler
- warning.
-
-2007-11-20 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix MacOS legacy font support by Masatake Yamato on Mac OS X. It is
- not working since 2.3.5. In FT_Open_New(), if FT_New_Stream()
- cannot mmap() the specified file and cannot seek to head of the
- specified file, it returns NULL stream and FT_Open_New() returns the
- error immediately. On MacOS, most legacy MacOS fonts fall into such
- a scenario because their data forks are zero-sized and cannot be
- sought. To proceed to guessing of resource fork fonts, the
- functions for legacy MacOS font must properly handle the NULL stream
- returned by FT_New_Stream().
-
- * src/base/ftobjs.c (IsMacBinary): Return error
- FT_Err_Invalid_Stream_Operation immediately when NULL stream is
- passed.
- (FT_Open_Face): Even when FT_New_Stream() returns an error, proceed
- to fallback. Originally, legacy MacOS font is tested in the cases
- of FT_Err_Invalid_Stream_Operation (occurs when data fork is empty)
- or FT_Err_Unknown_File_Format (occurs when AppleSingle header or
- .dfont header is combined). Now the case of
- FT_Err_Cannot_Open_Stream is included.
-
- * src/base/ftrfork.c (FT_Raccess_Guess): When passed stream is NULL,
- skip FT_Stream_Seek(), which seeks to the head of stream, and
- proceed to unit testing of raccess_guess_XXX(). FT_Stream_Seek()
- for a NULL stream causes a Bus error on Mac OS X.
- (raccess_guess_apple_double): Return FT_Err_Cannot_Open_Stream
- immediately if passed stream is NULL.
- (raccess_guess_apple_single): Ditto.
-
-2007-11-16 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix for Carbon incompatibilities since Mac OS X 10.5,
- proposed by Sean McBride.
-
- * doc/INSTALL.MAC: Comment on MACOSX_DEPLOYMENT_TARGET.
-
- * include/freetype/ftmac.h: Deprecate FT_New_Face_From_FOND and
- FT_GetFilePath_From_Mac_ATS_Name. Since Mac OS X 10.5, calling
- Carbon functions from a forked process is classified as unsafe
- by Apple. All Carbon-dependent functions should be deprecated.
-
- * src/base/ftmac.c: Use essential header files
- <CoreServices/CoreServices.h> and
- <ApplicationServices/ApplicationServices.h> instead of
- all-in-one header file <Carbon/Carbon.h>.
-
- Include <sys/syslimits.h> and replace HFS_MAXPATHLEN by Apple
- genuine macro PATH_MAX.
-
- Add fallback macro for kATSOptionFlagsUnRestrictedScope which
- is not found in Mac OS X 10.0.
-
- Multi-character constants ('POST', 'sfnt' etc) are replaced by
- 64bit constants calculated by FT_MAKE_TAG() macro.
-
- For the index in the segment of resource fork, new portable
- type ResourceIndex is introduced for better compatibility.
- This type is since Mac OS X 10.5, so it is defined as short
- when built on older platforms.
-
- (FT_ATSFontGetFileReference): If build target is only the systems
- 10.5 and newer, it calls Apple genuine ATSFontGetFileReference().
-
- (FT_GetFile_From_Mac_ATS_Name): Return an error if system is 10.5
- and newer or 64bit platform, because legacy type FSSpec type is
- removed completely.
-
- (FT_New_Face_From_FSSpec): Ditto.
-
-2007-11-01 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_done_face): Check `sfnt' everywhere. This
- fixes Savannah bug #21485.
-
-2007-10-29 Daniel Svoboda <dasvo@planeta@cz>
-
- * src/winfonts/winfnt.c (FNT_Face_Init): Check first that the driver
- can handle the font at all, then check `face_index'. Otherwise, the
- driver might return the wrong error code. This fixes Savannah bug
- #21468.
-
-2007-10-21 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Support bit 9 and prepare
- support for bit 8 of the `fsSelection' field in the `OS/2' table.
- MS is already using this; hopefully, this becomes part of OpenType
- 1.5.
- Prepare also support for `name' IDs 21 (WWS_FAMILY) and 22
- (WWS_SUBFAMILY).
-
-2007-10-20 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py (html_header_2): Fix typo.
- Add `td.left' element to CSS.
- (toc_section_enter): Use it.
-
-2007-10-18 David Turner <david@freetype.org>
-
- * include/freetype/freetype.h, src/base/ftobjs.c: Rename API
- functions related to cmap type 14 support to the
- `FT_Object_ActionName' scheme:
-
- FT_Get_Char_Variant_Index -> FT_Face_GetCharVariantIndex
- FT_Get_Char_Variant_IsDefault -> FT_Face_GetCharVariantIsDefault
- FT_Get_Variant_Selectors -> FT_Face_GetVariantSelectors
- FT_Get_Variants_Of_Char -> FT_Face_GetVariantsOfChar
- FT_Get_Chars_Of_Variant -> FT_Face_GetCharsOfVariant
-
- Update documentation accordingly.
-
- * src/sfnt/ttcmap.c: Stronger cmap 14 validation.
- Make the code a little more consistent with FreeType coding
- conventions and modify the cmap14 functions that returned a newly
- allocated array to use a persistent vector from the TT_CMap14 object
- instead.
-
- (TT_CMap14Rec): Provide array and auxiliary data for result.
- (tt_cmap14_done, tt_cmap14_ensure): New functions.
-
- (tt_cmap14_init, tt_cmap14_validate, tt_cmap14_char_map_def_binary,
- tt_cmap14_char_map_nondef_binary, tt_cmap14_find_variant,
- tt_cmap14_char_var_index, tt_cmap14_variants,
- tt_cmap14_char_variants, tt_cmap14_def_char_count,
- tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars,
- tt_cmap14_variant_chars, tt_cmap14_class_rec): Updated and improved.
-
-2007-10-15 George Williams <gww@silcom.com>
-
- Add support for cmap type 14.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (TT_CONFIG_CMAP_FORMAT_14): New macro.
-
- * include/freetype/internal/ftobjs.h (FT_CMap_CharVarIndexFunc,
- FT_CMap_CharVarIsDefaultFunc, FT_CMap_VariantListFunc,
- FT_CMap_CharVariantListFunc, FT_CMap_VariantCharListFunc): New
- support function prototypes.
- (FT_CMap_ClassRec): Add them.
- Update all users.
-
- * include/freetype/ttnameid.h (TT_APPLE_ID_VARIANT_SELECTOR): New
- macro.
-
- * include/freetype/freetype.h (FT_Get_Char_Variant_Index,
- FT_Get_Char_Variant_IsDefault, FT_Get_Variant_Selectors,
- FT_Get_Variants_Of_Char, FT_Get_Chars_Of_Variant): New API
- functions.
-
- * src/base/ftobjs.c (find_variant_selector_charmap): New auxiliary
- function.
- (FT_Set_Charmap): Disallow cmaps of type 14.
- (FT_Get_Char_Variant_Index, FT_Get_Char_Variant_IsDefault,
- FT_Get_Variant_Selectors, FT_Get_Variants_Of_Char,
- FT_Get_Chars_Of_Variant): New API functions.
-
- * src/sfnt/ttcmap.c (TT_PEEK_UINT24, TT_NEXT_UINT24): New macros.
-
- (TT_CMap14Rec, tt_cmap14_init, tt_cmap14_validate,
- tt_cmap14_char_index, tt_cmap14_char_next, tt_cmap14_get_info,
- tt_cmap14_char_map_def_binary, tt_cmap14_char_map_nondef_binary,
- tt_cmap14_find_variant, tt_cmap14_char_var_index,
- tt_cmap14_char_var_isdefault, tt_cmap14_variants,
- tt_cmap14_char_variants, tt_cmap14_def_char_count,
- tt_cmap14_get_def_chars, tt_cmap14_get_nondef_chars,
- tt_cmap14_variant_chars, tt_cmap14_class_rec): New functions and
- structures for cmap 14 support.
- (tt_cmap_classes): Register tt_cmap14_class_rec.
- (tt_face_build_cmaps): One more error message.
-
- * docs/CHANGES: Mention cmap 14 support.
-
-2007-10-01 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (find_unicode_charmap): If search for a UCS-4
- charmap fails, do the loop again while searching a UCS-2 charmap.
- This favours MS charmaps over Apple ones.
-
-2007-08-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c: Introduction of abstract `short' data types,
- ResFileRefNum and ResID. These types were introduced for Copland,
- then backported to MPW. The variables exchanged with FileManager
- QuickDraw frameworks are redefined by these data types. Patch was
- proposed by Sean McBride.
- * builds/mac/ftmac.c: Ditto.
-
-2007-08-18 Werner Lemberg <wl@gnu.org>
-
- * src/otvalid/otvcommn.c (otv_x_y_ux_sy): Skip context glyphs. Found
- by Imran Yousaf. Fixes Savannah bug #20773.
-
- (otv_Lookup_validate): Correct handling of LookupType. Found by
- Imran Yousaf. Fixes Savannah bug #20782.
-
-2007-08-17 George Williams <gww@silcom.com>
-
- * src/otvalid/otvgsub.c (otv_SingleSubst_validate): Fix handling of
- SingleSubstFormat1.
-
-2007-08-11 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: Fix a bug which sets CC_BUILD by
- ${build-gcc} (unchecked) instead of by ${build}-gcc (checked).
- Found by Ryan Hill.
-
-2007-08-11 George Williams <gww@silcom.com>
-
- * src/otvalid/otvcommn.c, src/otvalid/otvcommn.h
- (otv_Coverage_validate): Add fourth argument to pass an expected
- count value. Update all users.
- Check glyph IDs.
- (otv_ClassDef_validate): Check `StartGlyph'.
-
- * src/otvalid/otvgsub.c (otv_SingleSubst_validate): More glyph ID
- checks.
-
- * src/otvalid/otvmath.c (otv_MathConstants_validate): There are only
- 56 constants.
- (otv_GlyphAssembly_validate, otv_MathGlyphConstruction_validate):
- Check glyph IDs.
-
-2007-08-08 Werner Lemberg <wl@gnu.org>
-
- * src/otvalid/otvbase.c, src/otvalid/otvcommn.c,
- src/otvalid/otvgdef.c, src/otvalid/otvgpos.c, src/otvalid/otvgsub.c,
- src/otvalid/otvjstf.c: s/FT_INVALID_DATA/FT_INVALID_FORMAT/ where
- appropriate. Reported by George.
-
- * include/freetype/internal/fttrace.h: Define `trace_otvmath'.
-
- * src/otvalid/rules.mk (OTV_DRV_SRC): Add otvmath.c.
-
- * docs/CHANGES: Updated.
-
-2007-08-08 George Williams <gww@silcom.com>
-
- Add `MATH' validating support to otvalid module.
-
- * include/freetype/tttags.h (TTAG_MATH): New macro.
- * include/freetype/ftotval.h (FT_VALIDATE_MATH): New macro.
- (FT_VALIDATE_OT): Updated.
-
- * src/otvalid/otvmath.c: New file.
-
- * src/otvalid/otvalid.c: Include otvmath.c.
- * src/otvalid/otvmod.c (otv_validate): Handle `MATH' table.
-
-2007-08-04 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.raw: Add call to AC_LIBTOOL_WIN32_DLL.
- Fixes Savannah bug #20686.
-
-2007-08-03 Werner Lemberg <wl@gnu.org>
-
- * src/psnames/psmodule.c: Fix usage of
- FT_CONFIG_OPTION_POSTSCRIPT_NAMES macro. Reported by Graham Asher.
-
-2007-07-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c (open_face_from_buffer): The argument
- `driver_name' is typed as `const char*' to match with the
- callers in FT_New_Face_From_LWFN and FT_New_Face_From_SFNT.
- This is same with open_face_from_buffer in src/base/ftobjs.c.
- Found and fixed by Sean McBride.
-
-2007-07-28 Werner Lemberg <wl@gnu.org>
-
- * src/raster/ftraster.c (count_table): Make it conditional.
- * src/base/ftobjs.c (FT_New_Library): Check FT_RENDER_POOL_SIZE with
- a preprocessor statement.
-
-2007-07-27 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftoutln.c (FT_Outline_Translate): Check `outline' before
- first usage. From Savannah patch #6115.
-
-2007-07-16 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2007-07-16 Derek Clegg <dclegg@apple.com>
-
- Add new service for getting the ROS from a CID font.
-
- * include/freetype/config/ftheader.h (FT_CID_H): New macro.
- * include/freetype/ftcid.h: New file.
-
- * include/freetype/internal/ftserv.h (FT_SERVICE_CID_H): New macro.
- * include/freetype/internal/services/svcid.h: New file.
-
- * src/base/ftcid.c: New file.
-
- * src/cff/cffdrivr.c: Include FT_SERVICE_CID_H.
- (cff_get_ros): New function.
- (cff_service_cid_info): New service structure.
- (cff_services): Register it.
-
- * src/cff/cffload.c (cff_font_done): Free registry and ordering.
-
- * src/cff/cfftypes.h (CFF_FontRec): Add `registry' and `ordering'.
-
- * modules.cfg (BASE_EXTENSIONS): Add ftcid.c.
-
-2007-07-11 Derek Clegg <dclegg@apple.com>
-
- Add support for postscript name service to CFF driver.
-
- * src/cff/cffdrivr.c: Include FT_SERVICE_POSTSCRIPT_NAME_H.
- (cff_get_ps_name): New function.
- (cff_service_ps_name): New service structure.
- (cff_services): Register it.
-
-2007-07-07 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftglyph.c (FT_Glyph_Copy): Fix initialization of
- `target'. Reported by Sean McBride.
-
-2007-07-06 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrcmap.c: Include pfrerror.h.
-
- * src/autofit/afindic.c: Add some external declarations to pacify
- `make multi' compilation.
-
- * src/cid/cidgload.c (cid_load_glyph): Pacify compiler.
-
- * src/cff/cffdrivr.c (cff_ps_get_font_info), src/cff/cffobjs.c
- (cff_strcpy), include/freetype/internal/ftmemory.h (FT_MEM_STRDUP),
- src/autofit/aflatin.c (af_latin_hints_compute_edges),
- src/autofit/afcjk.c (af_cjk_hints_compute_edges), src/sfnt/ttmtx.c
- (tt_face_get_metrics), src/base/ftobjs.c (open_face)
- [FT_CONFIG_OPTION_INCREMENTAL]: Fix compilation with C++ compiler.
-
- * docs/release: Mention test compilation targets.
-
-2007-07-04 Werner Lemberg <wl@gnu.org>
-
- * docs/PROBLEMS: Mention that some PS based fonts can't be
- handled correctly by FreeType.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Always allow a
- recursion depth of 1. This was the maximum value in TrueType 1.0,
- and some older fonts don't set this field correctly.
-
- * src/gxvalid/gxvmort1.c
- (gxv_mort_subtable_type1_substTable_validate): Fix tracing message.
-
-2007-07-03 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
- `round' to pacify compiler.
-
-2007-07-02 Werner Lemberg <wl@gnu.org>
-
-
- * Version 2.3.5 released.
- =========================
-
-
- Tag sources with `VER-2-3-5'.
-
- * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
- version number to 2.3.5.
-
- * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj: s/2.3.4/2.3.5/, s/234/235/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
-
- * builds/unix/configure.raw (version_info): Set to 9:16:3.
-
-2007-07-01 David Turner <david@freetype.org>
-
- * include/freetype/freetype.h, src/base/ftpatent.c
- (FT_Face_SetUnpatentedHinting): New function to dynamically change
- the setting after a face is created.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Fix a small bug
- that created distortions in the bytecode interpreter results.
-
-2007-06-30 David Turner <david@freetype.org>
-
- * src/truetype/ttinterp.c (Ins_IUP): Add missing variable
- initialization.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Get rid of an
- infinite loop in the case of degenerate fonts.
-
-2007-06-26 Rahul Bhalerao <b.rahul.pm@gmail.com>
-
- Add autofit module for Indic scripts. This currently just reuses
- the CJK-specific functions.
-
- * include/freetype/config/ftoption.h (AF_CONFIG_OPTION_INDIC): New
- macro.
- * devel/ftoption.h: Synchronize with
- include/freetype/config/ftoption.h.
-
- * src/autofit/afindic.c, src/autofit/afindic.h: New files.
-
- * src/autofit/afglobal.c, src/autofit/aftypes.h,
- src/autofit/autofit.c: Updated.
-
- * src/autofit/Jamfile (_sources), * src/autofit/rules.mk
- (AUTOF_DRV_SRC): Updated.
-
-2007-06-23 David Turner <david@freetype.org>
-
- * src/truetype/ttgload.c (TT_Load_Simple): Fix change from
- 2007-06-16 that prevented the TrueType module from loading most
- glyphs.
-
-2007-06-20 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (cff_slot_load): Fix logic of 2007-05-28
- change.
-
-2007-06-19 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_encoding): Handle one more error.
-
-2007-06-19 Dmitry Timoshkov <dmitry@codeweavers.com>
-
- * src/winfonts/winfnt.c (fnt_face_get_dll_font): Return error
- FNT_Err_Invalid_File_Format if file format was recognized but
- the file doesn't contain any FNT(NE) or RT_FONT(PE) resources.
- Add verbose debug logs to make it easier to debug failing load
- attempts.
- (FNT_Face_Init): A single FNT font can't contain more than 1 face,
- so return an error if requested face index is > 0.
- Do not do further attempt to load fonts if a previous attempt has
- failed but returned error FNT_Err_Invalid_File_Format, i.e., the
- file format has been recognized but no fonts found in the file.
-
-2007-07-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c: Apply patches proposed by Sean McBride.
- (FT_GetFile_From_Mac_Name): Insert FT_UNUSED macros to fix
- the compiler warnings against unused arguments.
- (FT_ATSFontGetFileReference): Ditto.
- (FT_GetFile_From_Mac_ATS_Name): Ditto.
- (FT_New_Face_From_FSSpec): Ditto.
- (lookup_lwfn_by_fond): Fix wrong comment.
- Replace `const StringPtr' by more appropriate type
- `ConstStr255Param'.
- FSRefMakePathPath always returns UTF8 POSIX pathname in
- Mach-O, thus HFS pathname support is dropped.
- (count_faces): Remove HLock and HUnlock which is not
- required on Mac OS X anymore.
- (FT_New_Face_From_SFNT): Ditto.
- (FT_New_Face_From_FOND): Ditto.
- * builds/mac/ftmac.c: Synchronize to src/base/ftmac.c,
- except of HFS pathname support and HLock/HUnlock.
- They are required on classic CFM environment.
-
-2007-06-18 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/psobjs.c (ps_parser_skip_PS_token): Remove incorrect
- assertion.
- (ps_parser_to_bytes): Fix error message.
-
- * src/type42/t42objs.c (T42_Open_Face): Handle one more error.
- * src/type42/t42parse.c (t42_parse_sfnts): s/alloc/allocated/.
- Don't allow mixed binary and hex strings.
- Handle string_size == 0 and string_buf == 0.
- (t42_parse_encoding): Handle one more error.
-
-2007-06-18 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/psobjs.c (ps_tofixedarray, ps_tocoordarray): Fix exit
- logic.
- (ps_parser_load_field) <T1_FIELD_TYPE_BBOX>: Skip delimiters
- correctly.
- (ps_parser_load_field_table): Use `fields->array_max' instead of
- T1_MAX_TABLE_ELEMENTS to limit the number of arguments.
-
- * src/cff/cffgload.c (cff_decoder_prepare): Fix change from
- 2007-06-06.
-
-2007-06-17 Werner Lemberg <wl@gnu.org>
-
- * src/tools/ftrandom.c (font_size): New global variable.
- (TestFace): Use it.
- (main): Handle new option `--size' to set `font_size'.
- (Usage): Updated.
-
- * src/winfonts/winfnt.c (fnt_face_get_dll_font): Exit in case of
- invalid font.
- (FNT_Load_Glyph): Protect against invalid bitmap width.
-
-2007-06-16 David Turner <david@freetype.org>
-
- * src/smooth/ftgrays.c (gray_find_cell, gray_set_cell, gray_hline):
- Prevent integer overflows when rendering very large outlines.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check the
- well-formedness of the contours array when loading a glyph.
-
- * src/truetype/ttinterp.c (TT_Load_Context): Initialize `zp0', `zp1',
- and `zp2'.
- (Ins_IP): Check argument ranges to reject bogus operations properly.
- (IUP_WorkerRec): Add `max_points' member.
- (_iup_worker_interpolate): Check argument ranges.
- (Ins_IUP): Ignore empty outlines.
-
-2007-06-16 Dmitry Timoshkov <dmitry@codeweavers.com>
-
- * src/winfonts/winfnt.h: Add necessary structures for PE resource
- parsing.
- (WinPE32_HeaderRec): New structure.
- (WinPE32_SectionRec): New structure.
- (WinPE_RsrcDirRec): New structure.
- (WinPE_RsrcDirEntryRec): New structure.
- (WinPE_RsrcDataEntryRec): New structure.
- (FNT_FontRec): Remove unused `size_shift' field.
-
- * src/winfonts/winfnt.c (fnt_face_get_dll_font): Add support for
- loading bitmap .fon files in PE format.
-
-2007-06-15 Dmitry Timoshkov <dmitry@codeweavers.com>
-
- * builds/win32/ftdebug.c: Unify debug level handling with other
- platforms.
-
-2007-06-14 Dmitry Timoshkov <dmitry@codeweavers.com>
-
- * builds/win32/ftdebug.c (FT_Message): Send debug output to the
- console as well as to the debugger.
-
-2007-06-14 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_uniranges): Expand structure to
- cover all ranges which could possibly be handled by the aflatin
- module (since the default fallback for unknown ranges is now the
- afcjk module). It might be necessary to fine-tune this further by
- splitting off modules for Greek, Cyrillic, or other blocks.
-
-2007-06-11 David Turner <david@freetype.org>
-
- * src/autofit/aflatin.c (af_latin_hints_link_segments): Fix
- incorrect segment linking computation. This was the root cause of
- Savannah bug #19565.
-
-
- * src/autofit/* [FT_OPTION_AUTOFIT2]: Some very experimental changes
- to improve the Latin auto-hinter. Note that the new code is
- disabled by default since it is not stabilized yet.
-
- * src/autofit/aflatin2.c, src/autofit/aflatin2.h: New files
- (disabled currently).
-
- * src/autofit/afhints.c: Remove dead code.
- (af_axis_hints_new_edge): Add argument to handle segment directions.
- (af_edge_flags_to_string): New function.
- (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Handle
- option flags.
- (af_glyph_hints_reload): Add argument to handle inflections.
- Simplify.
- (af_direction_compute): Fine tuning.
- (af_glyph_hints_align_edge_points): Fix logic.
- (af_glyph_hints_align_strong_points): Do linear search for small
- edge counts.
- (af_glyph_hints_align_weak_points): Skip any touched neighbors.
- (af_iup_shift): Handle zero `delta'.
-
- * src/autofit/afhints.h: Updated.
- (AF_SORT_SEGMENTS): New macro (disabled).
- (AF_AxisHintsRec) [AF_SORT_SEGMENTS]: New member `mid_segments'.
-
- * src/autofit/afglobal.c (af_face_globals_get_metrics): Add
- argument to pass option flags for handling scripts.
- * src/autofit/afglobal.h: Updated.
-
- * src/autofit/afcjk.c: Updated.
- * src/autofit/aflatin.c: Updated.
- (af_latin_metrics_scale_dim): Don't reduce scale by 2%.
-
- (af_latin_hints_compute_segments) [AF_HINT_METRICS]: Remove dead code.
- (af_latin_hints_compute_edges) [AF_HINT_METRICS]: Remove dead code.
- Don't set `edge->dir'
- (af_latin_hint_edges): Add more logging.
-
- * src/autofit/afloader.c: Updated.
-
-2007-06-11 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Document FT_Face_CheckTrueTypePatents.
-
-2007-06-10 David Turner <david@freetype.org>
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Slight speed-up to
- the TrueType glyph loader.
-
- * include/freetype/config/ftoption.h: Clarify documentation
- regarding unpatented hinting.
-
-
- Add new `FT_Face_CheckTrueTypePatents' API.
-
- * include/freetype/freetype.h (FT_Face_CheckTrueTypePatents): New
- declaration.
-
- * include/freetype/internal/services/svttglyf.h,
- src/base/ftpatent.c: New files.
-
- * include/freetype/internal/ftserv.h (FT_SERVICE_TRUETYPE_GLYF_H):
- New macro.
-
- * src/truetype/ttdriver.c: Include FT_SERVICE_TRUETYPE_GLYF_H and
- `ttpload.h'.
- (tt_service_truetype_glyf): New service structure.
- (tt_services): Register it.
-
- * modules.cfg (BASE_EXTENSIONS), src/base/Jamfile (_sources): Add
- `ftpatent.c'.
-
-2007-06-08 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Undo change from 2007-04-28.
- Fonts without a cmap must be handled correctly by FreeType (anything
- else would be a bug).
-
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- [FT_DEBUG_LEVEL_TRACE]: Improve tracing message.
-
-2007-06-07 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttsbit0.c (tt_sbit_decoder_init,
- tt_sbit_decoder_load_image): Protect against integer overflows.
-
-
- * src/pfr/pfrgload.c (pfr_glyph_load_simple): More bounding checks
- for `x_control' and `y_control'.
-
-2007-06-06 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftoutln.c (FT_Outline_Decompose): Check `last'.
-
-
- * src/pfr/pfrcmap.c (pfr_cmap_init): Convert assertion into normal
- FreeType error.
-
-
- * src/winfonts/winfnt.c (fnt_face_get_dll_font): Do a rough check of
- `font_count'.
-
-
- * src/type1/t1load.c (parse_font_matrix): Check `temp_scale'.
-
-
- * src/cff/cffgload.c (cff_decoder_prepare): Change return type to
- `FT_Error'.
- Check `fd_index'.
- (cff_slot_load): Updated.
- * src/cff/cffgload.h: Updated.
-
-2007-06-05 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrgload.c (pfr_glyph_done): Comment out unused code.
- (pfr_glyph_load_simple): Convert assertion into normal FreeType
- error.
- Check `idx'.
- (pfr_glyph_load_compound, pfr_glyph_curve_to, pfr_glyph_line_to):
- Convert assertion into normal FreeType error.
-
- * src/pfr/pfrtypes.h (PFR_GlyphRec): Comment out unused code.
-
-
- * src/winfonts/winfnt.c (FNT_Face_Init): Check `family_size'.
-
-
- * src/psaux/psobjs.c (ps_tocoordarray, ps_tofixedarray): Return -1
- in case of parsing error.
- (ps_parser_load_field): Updated.
-
- * src/type1/t1load.c (parse_font_matrix): Updated.
-
-2007-06-04 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidgload.c (cid_load_glyph): Check `fd_select'.
-
- * src/tools/ftrandom/Makefile: Depend on `libfreetype.a'.
-
-2007-06-03 Werner Lemberg <wl@gnu.org>
-
- * src/tools/ftrandom/*: Add the `ftrandom' test program written by
- George Williams (with some modifications).
-
-2007-06-03 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (destroy_charmaps), src/type1/t1objs.c
- (T1_Face_Done), src/winfonts/winfnt.c (FNT_Face_Done): Check for
- face == NULL. Suggested by Graham Asher.
-
-2007-06-03 Ismail Dönmez <ismail@pardus.org.tr>
-
- * src/base/ftobjs.c (FT_Request_Metrics): Fix compiler warning.
-
-2007-06-02 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/fterrdef.h (FT_Err_Corrupted_Font_Header,
- FT_Err_Corrupted_Font_Glyphs): New error codes for BDF files.
-
- * src/bdf/bdflib.c (bdf_load_font): Use them.
-
- * src/bdf/bdflib.c (_bdf_parse_start): Check `FONT' better.
-
-2007-06-01 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Request_Metrics), src/cache/ftccmap.c
- (FTC_CMapCache_Lookup): Remove unused code.
-
-2007-06-01 Sean McBride <sean@rogue-research.com>
-
- * src/truetype/ttinterp.c (Null_Vector, NULL_Vector): Removed,
- unused.
-
-2007-06-01 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidparse.c (cid_parser_new): Don't continue second search
- pass for `StartData' if an error has occurred.
- Exit properly if no `StartData' has been seen at all.
-
- * builds/unix/ftsystem.c (FT_Stream_Open): Don't use ULONG_MAX but
- LONG_MAX to avoid compiler warning. Suggested by Sean McBride.
-
-2007-05-30 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_subrs, parse_charstrings): Protect
- against too small binary data strings.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs): Check `STARTCHAR' better.
-
-2007-05-28 David Turner <david@freetype.org>
-
- * src/cff/cffgload.c (cff_slot_load): Do not apply the identity
- transformation. This significantly reduces the loading time of CFF
- glyphs.
-
- * docs/CHANGES: Updated.
-
- * src/autofit/afglobal.c (AF_SCRIPT_LIST_DEFAULT): Change default
- hinting script to CJK, since it works well with more scripts than
- latin. Thanks to Rahul Bhalerao <b.rahul.pm@gmail.com> for pointing
- this out!
-
-2007-05-25 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2007-05-24 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttobjs.h (tt_size_ready_bytecode): Move declaration
- into TT_USE_BYTECODE_INTERPRETER preprocessor block.
-
-2007-05-24 Graham Asher <graham.asher@btinternet.com>
-
- * src/truetype/ttobjs.c (tt_size_ready_bytecode)
- [!TT_USE_BYTECODE_INTERPRETER]: Removed. Unused.
-
-2007-05-22 David Turner <david@freetype.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Fix last change to
- avoid crashes in case the bytecode interpreter is not used.
-
-
- Avoid heap blowup with very large .Z font files. This fixes
- Savannah bug #19910.
-
- * src/lzw/ftzopen.h (FT_LzwStateRec): Remove `in_cursor',
- `in_limit', `pad', `pad_bits', and `in_buff' members.
- Add `buf_tab', `buf_offset', `buf_size', `buf_clear', and
- `buf_total' members.
-
- * src/lzw/ftzopen.c (ft_lzwstate_get_code): Rewritten. It now takes
- only one argument.
- (ft_lzwstate_refill, ft_lzwstate_reset, ft_lzwstate_io): Updated.
-
-2007-05-20 Ismail Dönmez <ismail@pardus.org.tr>
-
- * src/pshinter/pshrec.c (ps_mask_table_set_bits): Add `const'.
- (ps_dimension_set_mask_bits): Remove `const'.
-
-2007-05-19 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttmtx.c (tt_face_get_metrics)
- [!FT_CONFIG_OPTION_OLD_INTERNALS]: Another type-punning fix.
-
-2007-05-19 Derek Clegg <dclegg@apple.com>
-
- Savannah patch #5929.
-
- * include/freetype/tttables.h, src/base/ftobjs.c
- (FT_Get_CMap_Format): New function.
-
- * include/freetype/internal/services/svttcmap.c (TT_CMapInfo): Add
- `format' member.
- * src/sfnt/ttcmap.c (tt_cmap{0,2,4,6,8,10,12}_get_info): Set
- cmap_info->format.
-
-2007-05-19 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Save graphics state
- before handling subglyphs so that it can be reinitialized each time.
- This fixes Savannah bug #19859.
-
-2007-05-16 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftccache.c (ftc_node_mru_link, ftc_node_mru_unlink),
- src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP), src/cache/ftcglyph.h
- (FTC_GCACHE_LOOKUP_CMP), src/pshinter/pshmod.c (ps_hinter_init),
- src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_load_hhea,
- tt_face_get_metrics): Fix type-punning issues.
-
-2007-05-15 David Turner <david@freetype.org>
-
- * include/freetype/config/ftstdlib.h,
- include/freetype/internal/ftobjs.h: As suggested by Graham Asher,
- ensure that ft_isalnum, ft_isdigit, etc., use hard-coded values
- instead of relying on the locale-dependent functions provided by
- <ctypes.h>.
-
-2007-05-15 Graham Asher <graham.asher@btinternet.com>
-
- * src/autofit/afcjk.c (af_cjk_hints_compute_edges): Remove unused
- variable.
- * src/autofit/afloader.c (af_loader_load_g): Ditto.
-
- * src/base/ftobjs.c (ft_validator_error): Use `ft_jmp_buf'.
- (open_face_from_buffer): Initialize `stream'.
- (FT_Request_Metrics): Remove unused variable.
- Remove redundant `break' statements.
- (FT_Get_Track_Kerning): Remove unused variable.
-
- * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs,
- afm_parse_kern_data): Remove redundant
- `break' statements.
- (afm_parser_parse): Ditto.
- Don't use uninitialized variables.
-
- * src/psnames/psmodule.c (VARIANT_BIT): Define as unsigned long.
- Use `|' operator instead of `^' to set it.
- Update all users.
-
- * src/sfnt/ttcmap.c (tt_face_build_cmaps): Use `ft_jmp_buf'.
- * src/sfnt/ttkern.c (tt_face_load_kern): Remove unused variable.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant
- comparison.
- (TT_Process_Simple_Glyph): Use FT_UInt for `n_points' and `i'.
- (TT_Load_Glyph): Remove unused variable.
-
-2007-05-13 Derek Clegg <dclegg@apple.com>
-
- * src/base/ftobjs.c (FT_New_Library): Only allocate rendering pool
- if FT_RENDER_POOL_SIZE is > 0. From Savannah patch #5928.
-
-2007-05-11 David Turner <david@freetype.org>
-
- * src/cache/ftcbasic.c, include/freetype/ftcache.h
- (FTC_ImageCache_LookupScaler, FTC_SBit_Cache_LookupScaler): Two new
- functions that allow us to look up glyphs using an FTC_Scaler object
- to specify the size, making it possible to use fractional pixel
- sizes.
-
- * src/truetype/ttobjs.c (tt_size_ready_bytecode): Set
- `size->cvt_ready'. Reported by Boris Letocha.
-
-2007-05-09 Graham Asher <graham.asher@btinternet.com>
-
- * src/truetype/ttinterp.c (Ins_IP), src/autofit/aflatin.c
- (af_latin_metrics_scale_dim): Fix compiler warnings.
-
-2007-05-06 Werner Lemberg <wl@gnu.org>
-
- * builds/win32/visualce/freetype.sln: Removed, as requested by
- Vincent.
-
-2007-05-04 Vincent RICHOMME <richom.v@free.fr>
-
- * builds/win32/visualce/*: Add Visual C++ project files for Pocket
- PC targets.
-
- * docs/CHANGES: Document them.
-
-2007-05-04 <harry@kdevelop.org>
-
- * builds/unix/ftsystem.c (FT_Stream_Open): Handle return value 0 of
- mmap (which might happen on some RTOS). From Savannah patch #5909.
-
-2007-05-03 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Set_Char_Size): Simplify code.
- * include/freetype/freetype.h (FT_Set_Char_Size): Update
- documentation.
-
-2007-04-28 Victor Stinner <victor.stinner@inl.fr>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Check error code after loading
- `cmap'.
-
-2007-04-27 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check for negative
- number of points in contours. Problem reported by Victor Stinner
- <victor.stinner@haypocalc.com>.
- (TT_Process_Simple_Glyph): Synchronize variable types.
-
-2007-04-26 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftglyph.c (FT_Glyph_Copy): Always set second argument to
- zero in case of error. This fixes Savannah bug #19689.
-
-2007-04-25 Boris Letocha <b.letocha@cz.gmc.net>
-
- * src/truetype/ttobjs.c: Fix a typo that created a speed regression
- in the TrueType bytecode loader.
-
-2007-04-10 Martin Horak <horakm@centrum.cz>
-
- * src/sfnt/sfobjs.c (sfnt_load_face) [FT_CONFIG_OPTION_INCREMENTAL]:
- Ignore `hhea' table. This fixes Savannah bug #19261.
-
-2007-04-09 Werner Lemberg <wl@gnu.org>
-
-
- * Version 2.3.4 released.
- =========================
-
-
- Tag sources with `VER-2-3-4'.
-
- * docs/CHANGES, docs/VERSION.DLL: Update documentation and bump
- version number to 2.3.4.
-
- * README, Jamfile (RefDoc), builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj: s/2.3.3/2.3.4/, s/233/234/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
-
- * builds/unix/configure.raw (version_info): Set to 9:15:3.
-
-2007-04-09 Martin Horak <horakm@centrum.cz>
-
- * src/truetype/ttgload.c (load_truetype_glyph): Save and restore
- memory stream to avoid a crash with the incremental memory
- interface (Savannah bug #19260).
-
-2007-04-06 David Turner <david@freetype.org>
-
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Fix buffer-overwrite
- bug (Savannah bug #19536).
-
-2007-04-04 Werner Lemberg <wl@gnu.org>
-
-
- * Version 2.3.3 released.
- =========================
-
-
- Tag sources with `VER-2-3-3'.
-
- * docs/CHANGES: Mention CVE-2007-1351.
-
-2007-04-03 David Turner <david@freetype.org>
-
- * src/base/ftobjs.c (FT_Set_Char_Size): As suggested by James Cloos,
- if one of the resolution values is 0, treat it as if it were the
- same as the other value.
-
-2007-04-02 David Turner <david@freetype.org>
-
- Add special code to detect `extra-light' fonts and do not snap their
- stem widths too much to avoid bizarre hinting effects.
-
- * src/autofit/aflatin.h (AF_LatinAxisRec): Add `standard_width' and
- `extra_light' members.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize
- them.
- (af_latin_metrics_scale_dim): Set `extra_light'.
- (af_latin_compute_stem_width): Use `extra_light'.
-
-2007-03-28 David Turner <david@freetype.org>
-
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Fix zero-ing of the
- padding.
-
-2007-03-28 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdflib.c (setsbit, sbitset): Handle values >= 128
- gracefully.
- (_bdf_set_default_spacing): Increase `name' buffer size to 256 and
- issue an error for longer names. This fixes CVE-2007-1351.
- (_bdf_parse_glyphs): Limit allowed number of glyphs in font to the
- number of code points in Unicode.
-
- * builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj, README: s/2.3.2/2.3.3/,
- s/232/233/.
-
- * docs/CHANGES: Mention ftdiff.
-
-2007-03-26 David Turner <david@freetype.org>
-
- * src/truetype/ttinterp.c [FIX_BYTECODE]: Remove it and
- corresponding code.
- (Ins_MD): Last regression fix.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Fix blues
- computations in order to ignore single-point contours. These are
- never rasterized and correspond in certain fonts to mark-attach
- points that are very far from the glyph's real outline, ruining the
- computation.
-
- * src/autofit/afloader.c (af_loader_load_g): In the case of
- monospaced fonts, always set `rsb_delta' and `lsb_delta' to 0.
- Otherwise code that uses them will most certainly ruin the fixed
- advance property.
-
- * docs/CHANGES, docs/VERSION.DLL, README, Jamfile (RefDoc): Update
- documentation and bump version number to 2.3.3.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
-
- * builds/unix/configure.raw (version_info): Set to 9:14:3.
-
-2007-03-26 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/ftconfig.in: Disable Carbon framework dependency on
- 64bit ABI on Mac OS X 10.4.x (ppc & i386). Found by Sean McBride.
- * builds/vms/ftconfig.h: Ditto.
- * include/freetype/config/ftconfig.h: Ditto.
-
-2007-03-22 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/ftsystem.c (FT_Stream_Open): Temporary fix to prevent
- 32bit unsigned long overflow by 64bit filesize on LP64 platform, as
- proposed by Sean McBride:
- https://lists.gnu.org/archive/html/freetype-devel/2007-03/msg00032.html
-
-2007-03-22 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/ftconfig.in: Suppress SGI compiler's warning against
- setjmp, proposed by Sean McBride:
- https://lists.gnu.org/archive/html/freetype-devel/2007-03/msg00032.html
-
-2007-03-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: Dequote `OS_INLINE' in comment of
- conftest.c, to avoid unexpected shell evaluation. Possibly it is a
- bug or undocumented behaviour of autoconf.
-
-2007-03-18 David Turner <david@freetype.org>
-
- * src/truetype/ttinterp.c (Ins_MDRP): Another bytecode regression
- fix; testing still needed.
-
- * src/truetype/ttinterp.c (Ins_MD): Another bytecode regression fix.
-
-2007-03-17 David Turner <david@freetype.org>
-
- * src/truetype/ttinterp.c (Ins_IP): Fix wrong handling of the
- (undocumented) twilight zone special case.
-
-2007-03-09 Werner Lemberg <wl@gnu.org>
-
-
- * Version 2.3.2 released.
- =========================
-
-
- Tag sources with `VER-2-3-2'.
-
- * builds/win32/visualc/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj, README: s/2.3.1/2.3.2/,
- s/231/232/.
-
-2007-03-08 David Turner <david@freetype.org>
-
- * docs/CHANGES, docs/VERSION.DLL: Updated for upcoming release.
-
- * builds/unix/configure.raw (version_info): Set to 9:13:3.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
-
- * README, Jamfile (RefDoc): s/2.3.1/2.3.2/.
-
- * src/base/ftutil.c (ft_mem_strcpyn): Fix a bug that prevented the
- function to work properly, over-writing user-provided buffers in
- some cases. Reported by James Cloos <cloos@jhcloos.com>.
-
-
-2007-03-05 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftstdlib.h (ft_strstr): New wrapper
- macro for `strstr'.
-
- * src/truetype/ttobjs.c (tt_face_init): Use ft_strstr for scanning
- `trick_names', as suggested by Ivan Nincic.
-
-2007-03-05 David Turner <david@freetype.org>
-
- * src/base/ftinit.c (FT_Init_FreeType): Fix a small memory leak in
- case FT_Init_FreeType fails for some reason. Problem reported by
- Maximilian Schwerin <maximilian.schwerin@buelowssiege.de>.
-
- * src/truetype/ttobjs.c (tt_size_init_bytecode): Clear the `x_ppem'
- and `y_ppem' fields of the `TT_Size.metrics' structure, not those of
- `TT_Size.root.metrics'. Problem reported by Daniel Glöckner
- <daniel-gl@gmx.net>.
-
- * src/type1/t1afm.c (T1_Read_PFM): Read kerning values as 16-bit
- signed values, not unsigned ones. Problem reported by Johannes
- Walther <joh_walt@yahoo.de>.
-
-2007-02-21 David Turner <david@freetype.org>
-
- * src/pshinter/pshalgo.c (psh_hint_align): Fix a bug in the hinting
- of small and ghost stems in the Postscript interpreter.
-
-2007-02-20 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Fix memory
- leak, patch by "Jjgod Jiang" <gzjjgod@gmail.com>.
- * builds/mac/ftmac.c (FT_GetFileRef_From_Mac_ATS_Name): Ditto.
-
-2007-02-16 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Ins_MD): Remove unused variable.
- * src/autofit/aflatin.c (af_latin_hints_link_segments): Ditto.
-
-2007-02-14 David Turner <david@freetype.org>
-
- It seems that the following changes fix most of the known
- interpreter problems with my fonts, but more testing is needed,
- though.
-
- * src/truetype/ttinterp.c (FIX_BYTECODE): Activate.
- (TT_MulFix14): Rewrite.
- (Ins_MD, Ins_MDRP, Ins_IP) [FIX_BYTECODE]: Improved and updated.
- (Ins_MIRP): Ditto.
-
-2007-02-12 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Project_x, Project_y): Remove compiler
- warnings.
-
- * src/pcf/pcfread.c (pcf_interpret_style), src/bdf/bdfdrivr.c
- (bdf_interpret_style): Ditto.
-
-2007-02-12 David Turner <david@freetype.org>
-
- Simplify projection and dual-projection code interface.
-
- * src/truetype/ttinterp.h (TT_Project_Func): Use `FT_Pos', not
- FT_Vector' as argument type.
- * src/truetype/ttinterp.c (CUR_Func_project, CUR_Func_dualproj):
- Updated.
- (CUR_fast_project, CUR_fast_dualproj): New macros.
- (Project, Dual_Project, Project_x, Project_y): Updated.
- (Ins_GC, Ins_SCFS, Ins_MDAP, Ins_MIAP, Ins_IP): Use new `fast'
- macros.
-
-
- * src/autofit/afloader.c (af_loader_load_g): Improve spacing
- adjustments for the non-light auto-hinted modes. Gets rid of
- `inter-letter spacing is too wide' problems.
-
- * src/autofit/aflatin.c (af_latin_hints_link_segments,
- af_latin_hints_compute_edges): Slight optimization of the segment
- linker and better handling of serif segments to get rid of broken
- `9' in Arial at 9pt (96dpi).
-
-
- Introduce new string functions and the corresponding macros to get
- rid of various uses of strcpy and other `evil' functions, as well as
- to simplify a few things.
-
- * include/freetype/internal/ftmemory.h (ft_mem_strdup, ft_mem_dup,
- ft_mem_strcpyn): New declarations.
- (FT_MEM_STRDUP, FT_STRDUP, FT_MEM_DUP, FT_DUP, FT_STRCPYN): New
- macros.
- * src/base/ftutil.c (ft_mem_dup, ft_mem_strdup, ft_mem_strcpyn): New
- functions.
-
- * src/bdf/bdfdrivr.c (bdf_interpret_style, BDF_Face_Init),
- src/bdf/bdflib.c (_bdf_add_property), src/pcf/pcfread.c
- (pcf_get_properties, pcf_interpret_style, pcf_load_font),
- src/cff/cffdrivr.c (cff_get_glyph_name), src/cff/cffload.c
- (cff_index_get_sid_string), src/cff/cffobjs.c (cff_strcpy),
- src/sfnt/sfdriver.c (sfnt_get_glyph_name), src/type1/t1driver.c
- (t1_get_glyph_name), src/type42/t42drivr.c (t42_get_glyph_name,
- t42_get_name_index): Use new functions and simplify code.
-
- * builds/mac/ftmac.c (FT_FSPathMakeSpec): Don't use FT_MIN.
-
-2007-02-11 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afloader.c (af_loader_load_g): Don't change width for
- non-spacing glyphs.
-
-2007-02-07 Tom Parker <palfrey@tevp.net>
-
- * src/cff/cffdrivr.c (cff_get_name_index): Protect against NULL
- pointer.
-
-2007-02-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * include/freetype/ftmac.h (FT_DEPRECATED_ATTRIBUTE):
- Introduce __attribute((deprecated))__ to warn functions
- which use non-ANSI data types in its interfaces.
- (FT_GetFile_From_Mac_Name): Deprecated, using FSSpec.
- (FT_GetFile_From_Mac_ATS_Name): Deprecated, using FSSpec.
- (FT_New_Face_From_FSSpec): Deprecated, using FSSpec.
- (FT_New_Face_From_FSRef): Deprecated, using FSRef.
-
- * src/base/ftmac.c: Predefine FT_DEPRECATED_ATTRIBUTE as void
- to avoid warning in building FreeType.
- * builds/mac/ftmac.c: Ditto.
-
-2007-02-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftbase.c: Fix to use builds/mac/ftmac.c, if configured
- `--with-fsspec' etc. Replace #include "ftmac.c" with
- #include <ftmac.c>.
-
-2007-02-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * include/freetype/ftmac.h (FT_GetFilePath_From_Mac_ATS_Name):
- Introduced as replacement of FT_GetFile_From_Mac_ATS_Name.
- * src/base/ftmac.c (FT_GetFilePath_From_Mac_ATS_Name): Ditto.
- (FT_GetFile_From_Mac_ATS_Name): Rewritten as wrapper of
- FT_GetFilePath_From_Mac_ATS_Name.
- * builds/mac/ftmac.c: Ditto.
-
-2007-02-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * include/freetype/ftmac.h: Fixed wrong comment: FSSpec of
- FT_GetFile_From_Mac_Name, FT_GetFile_From_Mac_ATS_Name are
- for passing to FT_New_Face_From_FSSpec.
-
-2007-02-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: Check whether Mac OS X system headers
- can be built under ANSI C mode.
-
- * src/base/ftmac.c (OS_INLINE): Redefine OS_INLINE by a version
- compatible to ANSI C in case system headers are ANSI C incompatible.
- * builds/mac/ftmac.c (OS_INLINE): Ditto.
-
-2007-02-01 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ttnameid.h (TT_MS_LANGID_DZONGHKA_BHUTAN):
- Explain why applications shouldn't use it. Found by Alexei.
-
-2007-02-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * builds/unix/freetype2.m4 (AC_CHECK_FT2): Fix spelling of warning
- message.
-
- * src/gxvalid/gxvmort1.c
- (gxv_mort_subtable_type1_substTable_validate): Fix debugging
- message.
-
-2007-01-31 Werner Lemberg <wl@gnu.org>
-
-
- * Version 2.3.1 released.
- =========================
-
-
- Tag sources with `VER-2-3-1-FINAL'.
-
- * builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj: s/230/231/.
- * builds/win32/visualc/index.html: s/221/231/.
-
- * vms_make.com: Add `ftgasp'.
-
-2007-01-30 David Turner <david@freetype.org>
-
- Tag sources with VER-2-3-1 to prepare release.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
- * docs/VERSION.DLL, docs/release, README, Jamfile (RefDoc):
- s/2.3.0/2.3.1/.
-
- * builds/unix/configure.raw (version_info): Set to 9:12:3.
-
-
- * src/autofit/aftypes.h (AF_USE_WARPER), src/autofit/afloader.c
- (af_loader_load_g): Disable the warper (i.e., the light hinting
- improvements) to make a 2.3.1 bugfix release before introducing a
- new feature. This should give us more time to tune and improve the
- warper for the next release.
-
- * docs/CHANGES: Update accordingly.
-
-2007-01-25 David Turner <david@freetype.org>
-
- For light auto-hinting, improve glyph advance widths and resurrect
- normal/full hinting to its normal quality.
-
- * src/autofit/afhints.h (AF_GlyphHintsRec): New members `xmin_delta'
- and `xmax_delta'.
- * src/autofit/afhints.c (af_glyph_hints_reload): Reset `xmin_delta'
- and `xmax_delta'.
-
- * src/autofit/afloader.c (af_loader_load_g) <AF_USE_WARPER>: Replace
- preprocessor conditional with if-clause, handling both light and
- normal mode.
-
- * src/autofit/afwarp.c (AF_WarpScore): Fine-tune again.
- (af_warper_compute): Handle `xmin_delta' and `xmax_delta'.
-
-2007-01-25 Werner Lemberg <wl@gnu.org>
-
- * docs/release: Updated -- Savannah uses a new uploading scheme.
-
-2007-01-25 David Turner <david@freetype.org>
-
- * src/cff/cffload.c (cff_index_get_pointers): Improve previous fix.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_callsubr, cff_op_callgsubr>: Fix sanity check for empty
- functions.
-
- * docs/CHANGES: Document light auto-hinting improvement.
-
-2007-01-25 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_index_get_pointers): Handle last entry
- correctly in a sanity check. Since this function is only used to
- load local and global functions, any charstring that called the last
- local/global function would fail otherwise. This fixes Savannah bug
- #18867.
-
- * docs/CHANGES: Document it.
-
-2007-01-23 David Turner <david@freetype.org>
-
- * src/truetype/ttobjs.c (tt_size_ready_bytecode): Fix typo that
- prevented compilation when disabling both the unpatented and the
- bytecode interpreter in the TrueType font driver.
-
-
- Fix and enable the warper to improve `light' hinting mode. This is
- not necessarily a final version, but it seems to work well.
-
- * src/autofit/aflatin.c (af_latin_hints_init) [AF_USE_WARPER]:
- Disable code.
- (af_latin_hints_apply) [AF_USE_WARPER]: Handle FT_RENDER_MODE_LIGHT.
- * src/autofit/aftypes.h: Activate AF_USE_WARPER.
-
- * src/autofit/afwarp.c (AF_WarpScore): Tune table.
- (af_warper_compute_line_best): Fix array size of `scores'.
- (af_warper_compute): Better handling of border cases.
- * src/autofit/afwarp.h (AF_WarperRec): Remove unused members `X1'
- and `X2'.
-
-2007-01-21 Werner Lemberg <wl@gnu.org>
-
- * ChangeLog: Split off older entries into...
- * ChangeLog.22: This new file.
-
-2007-01-21 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Document SHZ fix.
-
-2007-01-21 George Williams <gww@silcom.com>
-
- * src/truetype/ttinterp.c (Ins_SHZ): SHZ doesn't move phantom
- points.
-
-2007-01-21 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttmtx.c (tt_face_get_metrics)
- [!FT_CONFIG_OPTION_OLD_INTERNALS]: Fix limit check.
-
-2007-01-17 Werner Lemberg <wl@gnu.org>
-
-
- * Version 2.3.0 released.
- =========================
-
-
- Tag sources with `VER-2-3-0-FINAL'.
-
-2007-01-17 Werner Lemberg <wl@gnu.org>
-
- * docs/release: Updated.
-
-2007-01-16 David Turner <david@freetype.org>
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments),
- src/cff/cffdrivr.c (cff_ps_get_font_info), src/truetype/ttobjs.c
- (tt_face_init), src/truetype/ttinterp.c (Ins_SHC): Fix compiler
- warnings.
-
-2007-01-15 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- * builds/amiga/makefile, builds/amiga/makefile.os4,
- builds/amiga/smakefile: Add `ftgasp.c' and `ftlcdfil.c'.
-
- * builds/amiga/include/freetype/config/ftconfig.h: Synchronize.
-
-2007-01-14 Detlef Würkner <TetiSoft@apg.lahn.de>
-
- Fix various compiler warnings.
-
- * src/truetype/ttdriver.c (tt_size_select), src/cff/cffobjs.h,
- src/cff/cffobjs.c (cff_size_request), src/type42/t42objs.h:
- s/index/strike_index/.
- * src/base/ftobjs.c (FT_Match_Size): s/index/size_index/.
-
- * src/gxvalid/gxvmorx5.c
- (gxv_morx_subtable_type5_InsertList_validate): s/index/table_index/.
-
- * src/truetype/ttinterp.c (Compute_Point_Displacement),
- src/pcf/pcfread.c (pcf_seek_to_table_type): Avoid possibly
- uninitialized variables.
-
-2007-01-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * docs/CHANGES, docs/INSTALL.MAC: Improvements.
-
-2007-01-13 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1afm.c (T1_Read_Metrics): MS Windows allows PFM
- versions up to 0x3FF without complaining.
-
-2007-01-13 Derek Clegg <dclegg@apple.com>
-
- Add FT_Get_PS_Font_Info interface to CFF driver.
-
- * src/cff/cfftypes.h: Include FT_TYPE1_TABLES_H.
- (CFF_FontRec): Add `font_info' field.
-
- * src/cff/cffload.c: Include FT_TYPE1_TABLES_H.
- (cff_font_done): Free font->font_info if necessary.
-
- * src/cff/cffdrivr.c (cff_ps_get_font_info): New function.
- (cff_service_ps_info): Register cff_ps_get_font_info.
-
-2007-01-13 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Fix compilation
- with C++ compiler.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_segments,
- af_glyph_hints_dump_edges): Ditto.
-
- * src/base/rules.mk (BASE_SRC): Remove ftgasp.c (it's already in
- `modules.cfg').
-
- * src/sfnt/ttsbit0.h: Remove.
-
- * src/sfnt/rules.mk (SFNT_DRV_SRC): Don't include ttsbit0.c.
-
-2007-01-12 David Turner <david@freetype.org>
-
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Fix memory stomping
- bug in the bitmap emboldener if the pitch of the source bitmap is
- much larger than its width.
-
- * src/truetype/ttinterp.c (Update_Max): Fix aliasing-related
- compilation warning.
-
-2007-01-12 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/install-sh, builds/unix/mkinstalldirs: Updated from
- `automake' CVS module from sources.redhat.com.
-
-2007-01-11 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (is_space): Removed.
- (parse_encoding, parse_charstrings): Use IS_PS_DELIM.
- (parse_charstrings): Use IS_PS_TOKEN.
-
-
- * autogen.sh: Avoid bash specific syntax.
-
-2007-01-11 David Turner <david@freetype.org>
-
- * docs/CHANGES: Small update.
-
- * builds/unix/configure.raw (version_info): Set to 9:11:3.
-
- * src/base/ftobjs.c (IsMacResource): Fix a small bug that caused a
- crash with some Mac OS X .dfont files. Submitted by Masatake
- Yamato.
-
- * autogen.sh: Small fix to get it working on Mac OS X properly:
- The issue is that GNU libtool is called `glibtool' on this platform,
- and we must call `glibtoolize', since `libtoolize' doesn't exist.
-
-2007-01-10 David Turner <david@freetype.org>
-
- * all-sources: Tag all sources with VER-2-3-0-RC1 and
- VER-2-3-0.
-
- * Jamfile (RefDoc), README, builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj, docs/VERSION.DLL: Update
- version number to 2.3.0.
-
- * include/freetype/freetype.h (FREETYPE_MINOR): Set to 3.
- (FREETYPE_PATCH): Set to 0.
-
- * include/freetype/ftchapters.h, include/freetype/ftgasp.h,
- include/freetype/ftlcdfil.h: Update reference documentation with
- GASP support and LCD filtering sections.
-
- * src/pshinter/pshalgo.c (psh_glyph_compute_inflections): Fix a typo
- which created an endless loop with some malformed font files.
-
-2007-01-10 Derek Clegg <dclegg@apple.com>
-
- * src/type1/t1load.c (T1_Get_MM_Var): Always return fixed-point
- values.
-
-2007-01-08 David Turner <david@freetype.org>
-
- * docs/CHANGES: Updated.
-
- * include/freetype/ftgasp.h, src/base/ftgasp.c: New files which add
- a new API `FT_Get_Gasp' to return entries of the `gasp' table
- corresponding to a given character pixel size.
-
- * src/sfnt/ttload.c (tt_face_load_gasp): Add version check for the
- `gasp' table, in order to avoid potential problems with later
- versions.
-
- * include/freetype/config/ftheader.h (FT_GASP_H): New macro for
- <freetype/ftgasp.h>.
-
- * src/base/rules.mk (BASE_SRC), src/base/Jamfile (_sources),
- modules.cfg (BASE_EXTENSIONS), builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj: Add src/base/ftgasp.c to the
- default build.
-
-2007-01-07 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidparse.c (cid_parser_new): Improve error message for
- Type 11 fonts.
- Scan for `/sfnts' token.
-
-2007-01-07 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidparse.c (cid_parser_new): Reject Type 11 fonts.
-
-2007-01-06 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_index_init): Remove unused variable.
- (cff_index_read_offset): s/perror/errorp/ to avoid global shadowing.
-
-2007-01-04 David Turner <david@freetype.org>
-
- * src/pfr/pfrobjs.c (pfr_face_init): Detect non-scalable fonts
- correctly. This fixes Savannah bug #17876.
-
-
- Do not allocate interpreter-specific tables in memory if we are not
- going to load glyphs with the bytecode interpreter anyway.
-
- * src/truetype/ttgload.c (tt_loader_init): Load execution context
- only if glyph is hinted.
- Updated.
- * src/truetype/ttobjs.h (TT_SizeRec): Add members `bytecode_ready'
- and `cvs_ready'.
- Add `tt_size_ready_bytecode' declaration.
- * src/truetype/ttobjs.c (tt_size_done_bytecode,
- tt_size_init_bytecode, tt_size_ready_bytecode): New functions.
- (tt_size_init): Move most code into `tt_size_init_bytecode'.
- (tt_size_done): Move most code into `tt_size_done_bytecode'.
- (tt_size_reset): Move some code to `tt_size_ready_bytecode'.
-
-
- Don't extract the metrics table from the SFNT font file. Instead,
- reparse it on each glyph load. The runtime difference is not
- noticeable, and it can save a lot of heap memory when memory-mapped
- files are not used.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Add members
- `horz_metrics_offset' and `vert_metrics_offset'.
- * src/sfnt/ttmtx.c (tt_face_load_hmtx, tt_face_get_metrics):
- Updated.
-
-
- * src/sfnt/ttcmap.c (tt_cmap4_validate): Slight optimization.
-
-
- Do not load the CFF index offsets into memory, since this wastes a
- *lot* of heap memory with large Asian CFF fonts. There is no
- significant performance loss.
-
- * src/cff/cffload.h: Add `cff_charset_cid_to_gindex' declaration.
- * src/cff/cfftypes.h (CFF_IndexRec): Add fields `start' and
- `data_size'.
- (CFF_CharsetRec): Add field `num_glyphs'.
-
- * src/cff/cffload.c (cff_index_read_offset, cff_index_load_offsets,
- cff_charset_cid_to_gindex): New functions.
- (cff_new_index): Renamed to...
- (cff_index_init): This. Update all callers.
- Updated -- some code has been moved to `cff_index_load_offsets'.
- (cff_done_index): Renamed to...
- (cff_index_done): This. Update all callers.
- (cff_index_get_pointers, cff_index_access_element): Updated to use
- stream offsets.
- (cff_charset_compute_cids): Set `num_glyphs' field.
- (cff_encoding_load): Updated.
-
- * src/cff/cffgload.c (cff_slot_load): Updated.
-
-2007-01-04 David Turner <david@freetype.org>
-
- * docs/INSTALL.UNIX: Simplify some parts, add reference to
- autogen.sh and pointer to README.CVS.
-
- * README.CVS: Add common problem description and solution
- when running autogen.sh.
-
- * docs/INSTALL: Add reference to MacOS X.
-
- * docs/MAKEPP, docs/INSTALL.MAC: New documentation files.
-
- * docs/TODO: Remove obsolete items.
-
- * src/raster/ftraster.c: (TRaster_Instance): Replace it with...
- (TWorker): This.
- Remove `count_table' and `memory'.
- Make `grays' a pointer.
- (TRaster): New structure.
- (count_table): New static array.
- (RAS_ARGS, RAS_ARG, RAS_VARS, RAS_VAR, FT_UNUSED_RASTER, cur_ras,
- Vertical_Gray_Sweep_Step, ft_black_new, ft_black_done,
- ft_black_set_mode, ft_black_render): Updated.
- (ft_black_init): Don't initialize `count_table'.
- (ft_black_reset): Use the render pool. This saves about 6KB of
- heap space for each FT_Library instance.
-
- * src/smooth/ftgrays.c (TRaster): Replaced with...
- (TWorker): This.
- Remove `memory'.
- (TRaster): New structure.
-
- (RAS_ARG_, RAS_ARG, RAS_VAR_, RAS_VAR, ras, gray_render_line,
- gray_move_to, gray_line_to, gray_conic_to, gray_cubic_to,
- gray_render_span, gray_raster_render): Updated.
- (gray_raster_reset): Use the render pool. This saves about 6KB of
- heap space for each FT_Library instance.
-
- * src/sfnt/sfobjs.c, src/sfnt/ttkern.c, src/sfnt/ttkern.h,
- src/sfnt/ttmtx.c, src/sfnt/ttsbit.c, src/sfnt/ttsbit.h,
- src/truetype/ttpload.c, include/freetype/config/ftoption.h: Remove
- FT_OPTIMIZE_MEMORY macro (and code for !FT_OPTIMIZE_MEMORY) since
- the optimization is no longer experimental.
-
- * src/pshinter/pshalgo.c (psh_glyph_interpolate_normal_points):
- Remove a typo that results in no hinting and a memory leak with some
- large Asian CFF fonts.
-
- * src/base/ftobjs.c (FT_Done_Library): Remove a subtle memory leak
- which happens when FT_Done_Library is called with still opened
- CFF_Faces in it. We need to close all faces before destroying the
- modules, or else some bad things (memory leaks) may happen.
-
-2007-01-02 Werner Lemberg <wl@gnu.org>
-
- * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate):
- Remove compiler warning.
-
-2007-01-02 David Turner <david@freetype.org>
-
- * src/sfnt/sfobjs.c: Add documentation comment.
-
-2006-12-31 Masatake YAMATO <jet@gyve.org>
-
- * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt0_pairs_validate): New
- function.
- Check uniqueness of the gid pairs.
- (gxv_kern_subtable_fmt0_validate): Move some code to
- `gxv_kern_subtable_fmt0_pairs_validate'.
-
-2006-12-22 David Turner <david@freetype.org>
-
- * src/autofit/aflatin.c, src/truetype/ttgload.c: Remove compiler
- warnings.
-
- * builds/win32/visualc/freetype.vcproj: Add _CRT_SECURE_NO_DEPRECATE
- to avoid deprecation warnings with Visual C++ 8.
-
-2006-12-16 Anders Kaseorg <anders@kaseorg.com>
-
- * src/base/ftlcdfil.c (FT_Library_SetLcdFilter)
- [FT_FORCE_LIGHT_LCD_FILTER]: Fix typo.
-
-2006-12-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * include/freetype/internal/services/svotval.h: Add `volatile' to
- sync with the modification by Jens Claudius on 2006-08-22; cf.
- https://cvs.savannah.gnu.org/viewcvs/freetype/freetype2/src/otvalid/otvmod.c?r1=1.4&r2=1.5
-
-2006-12-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c: Specialized for Mac OS X only.
- * builds/unix/ftconfig.in: Fixed for ppc64 missing Carbon framework.
- * builds/unix/configure.raw: Ditto. When explicit switches for
- FSSpec/FSRef/QuickDraw/ATS availability are given to configure,
- builds/mac/ftmac.c is used instead of default src/base/ftmac.c.
-
-2006-12-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/mac/ftmac.c: Copied src/base/ftmac.c for legacy system.
- * builds/mac/FreeType.m68k_cfm.make.txt: Fix to use builds/mac/ftmac.c
- instead of src/base/ftmac.c
- * builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
- * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
- * builds/mac/FreeType.m68k_far.make.txt: Ditto, and exclude gxvalid.c
- that cannot be built at present.
-
-2006-12-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c: Improvement of resource fork handler for
- POSIX, cf.
- https://lists.gnu.org/archive/html/freetype-devel/2006-10/msg00025.html
- (Mac_Read_sfnt_Resource): Count only `sfnt' resource of suitcase font
- format or .dfont, to simulate the face index number counted by ftmac.c.
- (IsMacResource): Return the number of scalable faces correctly.
-
-2006-12-10 Werner Lemberg <wl@gnu.org>
-
- * builds/toplevel.mk (version): Protect against `distclean' target.
-
-2006-12-09 Werner Lemberg <wl@gnu.org>
-
- * builds/*/*def.mk, builds/*/detect.mk (CAT): Define to either `cat'
- or `type'.
-
- * builds/freetype.mk (version): Extracted from freetype.h, using
- GNU make's built-in string functions.
- (refdoc): Use $(version) instead of static version number.
-
-2006-12-08 Werner Lemberg <wl@gnu.org>
-
- * builds/toplevel.mk (dist): Extract version number from freetype.h.
-
-2006-12-08 Vladimir Volovich <vvv@vsu.ru>
-
- * src/tools/apinames.c (State): Remove final comma in structure --
- xlc v5 under AIX 4.3 doesn't like this.
-
-2006-12-07 David Turner <david@freetype.org>
-
- * src/autofit/afloader.c (af_loader_load_g): Small adjustment
- to the spacing of auto-fitted glyphs. This only impacts rare
- cases (e.g., Arial Bold at rather small character sizes).
-
-2006-12-03 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/rules.mk (SFNT_DRV_SRC): Add ttsbit0.c.
-
-2006-12-01 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (tt_face_get_name): All Unicode strings are
- encoded in UTF-16BE. Patch from Rajeev Pahuja <rpahuja@esri.com>.
- (tt_name_entry_ascii_from_ucs4): Removed.
-
-
- * include/freetype/ftxf86.h: Fix and extend comment so that it
- appears in the documentation.
-
- * include/freetype/ftchapters.h: Add `font_format' section.
-
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter::index_exit): Add link
- to TOC in index page.
-
-2006-11-28 David Turner <david@freetype.org>
-
- * src/smooth/ftgrays.c (gray_raster_render): Return 0 when we are
- trying to render into a zero-width/height bitmap, not an error code.
-
- * src/truetype/ttobjs.c (tt_face_init): Fix typo in previous patch.
-
- * src/smooth/ftgrays.c: Remove hard-coded error values; use FreeType
- ones instead.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_segments): Remove unused
- variable.
-
-2006-11-26 Pierre Hanser <hanser@club-internet.fr>
-
- * src/truetype/ttobjs.c (tt_face_init): Protect against NULL pointer.
-
-2006-11-25 David Turner <david@freetype.org>
-
- * src/autofit/afhints.c (af_glyph_hints_dump_points,
- af_glyph_hints_dump_segments, af_glyph_hints_dumpedges) [!AF_DEBUG]:
- Add stubs to link the `ftgrid' test program when debugging is
- disabled in the auto-hinter.
-
-2006-11-23 David Turner <david@freetype.org>
-
- * src/autofit/afhints.c, src/autofit/afhints.h, src/autofit/aflatin.c,
- src/autofit/aftypes.h: Miscellaneous auto-hinter improvements.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_segments) [AF_DEBUG]:
- Emit more sensible information.
-
- * src/autofit/afhints.h (AF_SegmentRec): Add `height' member.
-
- * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Improve
- rounding of blue values.
- (af_latin_hints_compute_segments): Hint segment heights.
- (af_latin_hints_link_segments): Reduce `len_score' value.
- (af_latin_hints_compute_edges): Increase `segment_length_threshold'
- value and use `height' member for comparisons.
- (af_latin_hint_edges): Extend logging message.
- Improve handling of remaining edges.
-
-2006-11-22 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #15553.
-
- * src/truetype/ttgload.c (tt_loader_init): Re-execute the CVT
- program after a change from mono to grayscaling (and vice versa).
- Use correct constant for comparison to get `exec->grayscale'.
-
-2006-11-18 Werner Lemberg <wl@gnu.org>
-
- Because FT_Load_Glyph expects CID values for CID-keyed fonts, the
- test for a valid glyph index must be deferred to the font drivers.
- This patch fixes Savannah bug #18301.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Don't check `glyph_index'.
- * src/bdf/bdfdrivr.c (BDF_Glyph_Load), src/cff/cffgload.c
- (cff_slot_load), src/cid/cidgload.c (cid_slot_load_glyph),
- src/pcf/pcfdrivr.c (PCF_Glyph_Load), src/pfr/pfrobjs.c
- (pfr_slot_load), src/truetype/ttdriver.c (Load_Glyph),
- src/type1/t1gload.c (T1_Load_Glyph), src/winfonts/winfnt.c
- (FNT_Load_Glyph): Check validity of `glyph_index'.
-
-2006-11-13 David Turner <david@freetype.org>
-
- * src/truetype/ttinterp.c (FIX_BYTECODE): Undefine. The interpreter
- `enhancements' are still too buggy for general use.
-
- * src/base/ftlcdfil.c: Add support for FT_FORCE_LIGHT_LCD_FILTER and
- FT_FORCE_LEGACY_LCD_FILTER at compile time. Define these macros
- when building the library to change the default LCD filter to be
- used. This is only useful for experimentation.
-
- * include/freetype/ftlcdfil.h: Update documentation.
-
-2006-11-10 David Turner <david@freetype.org>
-
- * src/smooth/ftsmooth.c: API change for the LCD
- filter. The FT_LcdFilter value is an enumeration describing which
- filter to apply, with new values FT_LCD_FILTER_LIGHT and
- FT_LCD_FILTER_LEGACY (the latter implements the LibXft original
- algorithm which produces strong color fringes for everything
- except very-well hinted text).
-
- * include/freetype/ftlcdfil.h (FT_Library_SetLcdFilter): Change
- second parameter to an enum type.
-
- * src/base/ftlcdfil.c (USE_LEGACY): Define.
- (_ft_lcd_filter): Rename to...
- (_ft_lcd_filter_fir): This.
- Update parameters.
- (_ft_lcd_filter_legacy) [USE_LEGACY]: New filter function.
- (FT_Library_SetLcdFilter): Update parameters.
- Handle new filter modes.
-
- * include/internal/ftobjs.h: Include FT_LCD_FILTER_H.
- (FT_Bitmap_LcdFilterFunc): Change third argument to `FT_Library'.
- (FT_LibraryRec) [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Add filtering
- callback and update other fields.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic)
- [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Update.
- Other minor improvements.
-
- * src/autofit/aflatin.c: Various tiny improvements that drastically
- improve the handling of serif fonts and of LCD/LCD_V hinting modes.
- (af_latin_hints_compute_edges): Fix typo.
- (af_latin_compute_stem_width): Take better care of diagonal stems.
-
-2006-11-09 David Turner <david@freetype.org>
-
- * src/pshinter/pshalgo.c (psh_glyph_compute_inflections): Fix
- typo which created a variable-used-before-initialized bug.
-
-2006-11-07 Zhe Su <james.su@gmail.com>
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Handle vertical layout
- also.
-
-2006-11-03 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftcalc.c: Don't use `long long' but `FT_Int64'.
-
-2006-11-02 David Turner <david@freetype.org>
-
- Add a few tweaks to better handle serif fonts.
- Add more debugging messages.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_edges): Ignore
- segments that are less than 1.5 pixels high. This gets rid of
- *many* corner cases with serifs.
- (af_latin_align_linked_edge): Add logging message.
- (af_latin_hint_edges): Use AF_HINTS_DO_BLUES.
- Add logging messages.
- Handle AF_EDGE_FLAG flag specially.
-
- * src/autofit/afmodule.c [AF_DEBUG]: Add _af_debug,
- _af_debug_disable_blue_hints, and _af_debug_hints variables.
-
- * src/autofit/aftypes.h (AF_LOG) [AF_DEBUG]: Use _af_debug.
- Update external declarations.
- (af_corner_orientation, af_corner_is_flat): Replaced by...
-
- * include/freetype/internal/ftcalc.h (ft_corner_orientation,
- ft_corner_is_flat): These declarations.
-
- * src/autofit/afangles.c (af_corner_orientation, af_corner_is_flat):
- Comment out. Replaced by...
-
- * src/base/ftcalc.h (ft_corner_orientation, ft_corner_is_flat):
- These functions. Update all callers.
- (FT_Add64) [!FT_LONG64]: Simplify.
-
- * src/autofit/afhints.c: Include FT_INTERNAL_CALC_H.
- (af_direction_compute): Add a missing FT_ABS call. This bug caused
- production of garbage by missing lots of segments.
-
- * src/autofit/afhints.h (AF_HINTS_DO_BLUES): New macro.
-
- * src/autofit/afloader.c (af_loader_init, af_loader_done)
- [AF_DEBUG]: Set _af_debug_hints.
-
-
- * src/pshinter/pshalgo.c: Include FT_INTERNAL_CALC_H.
- (psh_corner_is_flat, psh_corner_orientation): Use ft_corner_is_flat
- and ft_corner_orientation.
-
-
- * src/gzip/inftrees.c (huft_build): Remove compiler warning.
-
-2006-10-24 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_encoding_load): Remove unused variable.
-
- * src/base/ftobjs.c (FT_Select_Charmap): Disallow FT_ENCODING_NONE
- as argument.
-
-2006-10-23 Zhe Su <zsu@novell.com>
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Re-implement to
- better deal with broken Asian fonts with strange glyphs, having
- self-intersections and other peculiarities. The used algorithm is
- based on the nonzero winding rule.
-
-2006-10-23 David Turner <david@freetype.org>
-
- Speed up the CFF font loader. With some large CFF fonts,
- FT_Open_Face is now more than three times faster.
-
- * src/cff/cffload.c (cff_get_offset): Removed.
- (cff_new_index): Inline functionality of `cff_get_offset'.
- (cff_charset_compute_cids, cff_charset_free_cids): New functions.
- (cff_charset_done): Call `cff_charset_free_cids'.
- (cff_charset_load): Call `cff_charset_compute_cids'.
- (cff_encoding_load) <Populate>: Ditto, to replace inefficient loop.
-
- * src/sfnt/ttmtx.c (tt_face_load_hmtx): Replace calls to FT_GET_XXX
- with FT_NEXT_XXX.
-
-
- Speed up the Postscript hinter, with more than 100% speed increase
- on my machine.
-
- * src/pshinter/pshalgo.c (psh_corner_is_flat,
- psh_corner_orientation): New functions.
- (psh_glyph_compute_inflections): Merge loops for efficiency.
- Use `psh_corner_orientation'.
- (psh_glyph_init): Use `psh_corner_is_flat'.
- (psh_hint_table_find_strong_point): Renamed to...
- (psh_hint_table_find_strong_points): This.
- Rewrite, adding argument to handle all points at once.
- Update all callers.
- (PSH_MAX_STRONG_INTERNAL): New macro.
- (psh_glyph_interpolate_normal_points): Rewrite for efficiency.
-
-2006-10-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c (FT_New_Face_From_FOND): Initialize variable
- `error' with FT_Err_Ok.
-
-2006-10-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * docs/INSTALL.CROSS: New document file for cross-building.
-
- * builds/unix/configure.raw: Preliminary cross-building support.
- Find native C compiler and pass it by CC_BUILD, and
- find suffix for native executable and pass it by EXEEXT_BUILD.
- Also suffix for target executable is passed by EXEEXT.
-
- * builds/unix/unix-cc.in (CCraw_build, E_BUILD): New variables to
- build `apinames' which runs on building system. They are set by
- CC_BUILD and EXEEXT_BUILD.
-
- * builds/exports.mk (APINAMES_EXE): Change the extension for
- apinames from the suffix for target (E) to that for building host
- (E_BUILD).
-
-2006-10-12 Werner Lemberg <wl@gnu.org>
-
- * docs/INSTALL.UNX, docs/UPGRADE.UNX: Renamed to...
- * docs/INSTALL.UNIX, docs/UPGRADE.UNIX: This. Update all documents
- which reference those files.
-
-2006-10-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw (FT2_EXTRA_LIBS): New variable. It is
- embedded in freetype2.pc and freetype-config. Use it to record
- Carbon dependency of MacOSX.
-
- * builds/unix/freetype2.in: Embed FT2_EXTRA_LIBS.
-
- * builds/unix/freetype-config.in: Ditto.
-
-2006-10-11 Werner Lemberg <wl@gnu.org>
-
- * devel/ftoption.h (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): Define for
- development.
-
-2006-10-03 Jens Claudius <jens.claudius@yahoo.com>
-
- * include/freetype/config/ftstdlib.h: Cast away volatileness from
- argument to ft_setjmp.
-
- * include/freetype/internal/ftvalid.h: Add comment that
- ft_validator_run must not be used.
-
-2006-10-01 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftbase.c: Undo change from 2006-09-30.
-
- * src/base/rules.mk (BASE_SRC): Remove `ftlcdfil.c'.
-
-2006-09-30 David Turner <david@freetype.org>
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec):
- s/unpatented_hinting/ignore_unpatented_hinter/.
- Update all callers.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Refine the algorithm whether
- auto-hinting shall be used or not.
-
- * src/truetype/ttobjs.c (tt_face_init): Ditto.
-
-2006-09-30 Werner Lemberg <wl@gnu.org>
-
- * src/base/rules.mk (BASE_SRC): Remove `ftapi.c' (which is no longer
- in use).
-
- * src/base/ftbase.c: Include `ftlcdfil.c'.
-
-2006-09-29 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary): Fix algorithm for
- overlapping segments. Bug reported by Stefan Koch.
-
-2006-09-28 David Turner <david@freetype.org>
-
- Fix a bug in the automatic unpatented hinting support which prevents
- normal bytecode hinting to work properly.
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec):
- s/force_autohint/unpatented_hinting/. Update all callers.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Updated code.
-
- * src/autofit/aftypes.h (AF_DEBUG): Undefine to get rid of traces.
-
-2006-09-27 David Turner <david@freetype.org>
-
- * include/freetype/freetype.h (FT_FREETYPE_PATCH): Set to 2.
-
-
- Add a new API to support color filtering of subpixel glyph bitmaps.
- In a default build, the function `FT_Library_SetLcdFilter' returns
- `FT_Err_Unimplemented_Feature'; you need to #define
- FT_CONFIG_OPTION_SUBPIXEL_RENDERING in ftoption.h to compile the
- real implementation.
-
- * include/freetype/ftlcdfil.h, src/base/ftlcdfil.c: New files.
-
- * include/freetype/internal/ftobjs.h (FT_Bitmap_LcdFilterFunc): New
- typedef.
- (FT_LibraryRec) [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: New members
- `lcd_filter_weights' and `lcd_filter'.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove arguments
- `hmul' and `vmul'.
-
- Handle subpixel rendering.
- Simplify function.
- (ft_smooth_render_lcd): Use `FT_RENDER_MODE_LCD'.
- (ft_smooth_render_lcd_v): Use `FT_RENDER_MODE_LCD_V'.
-
- * include/freetype/config/ftheader.h (FT_LCD_FILTER_H): New macro,
- pointing to <freetype/ftlcdfil.h>.
-
- * src/base/Jamfile (_sources), src/base/rules.mk (BASE_SRC),
- vms_make.com: Add `ftlcdfil.c' to the list of compiled source files.
-
- * modules.cfg (BASE_EXTENSIONS): Add ftlcdfil.c.
-
-2006-09-26 David Bustin
-
- * src/pfr/pfrobjs.c (pfr_face_get_kerning): Skip adjustment bytes
- correctly. Reported as Savannah bug #17843.
-
-2006-09-26 David Turner <david@freetype.org>
-
- * src/autofit/afhints.h (AF_HINTS_DO_HORIZONTAL,
- AF_HINTS_DO_VERTICAL, AF_HINTS_DO_ADVANCE): New macros to disable
- horizontal and vertical hinting for the purpose of debugging the
- auto-fitter.
-
- * src/autofit/afmodule.c (_af_debug_disable_horz_hints,
- _af_debug_disable_vert_hints) [AF_DEBUG]: New global variables.
-
- * src/autofit/aftypes.h [AF_DEBUG]: Declare above variables.
-
- * include/freetype/config/ftoption.h, devel/ftoption.h
- (FT_CONFIG_OPTION_SUBPIXEL_RENDERING): New macro to control whether
- we want to compile LCD-optimized rendering code (à la ClearType) or
- not. The macro *must* be disabled in default builds of the library
- for patent reasons.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Disable
- LCD-specific rendering when FT_CONFIG_OPTION_SUBPIXEL_RENDERING
- isn't defined at compile time. This only changes the content of the
- rendered glyph to match the one of normal gray-level rendering,
- hence clients should not need to be modified.
-
- * docs/CHANGES: Updated.
-
-2006-09-18 Garrick Meeker <garrick@digitalanarchy.com>
-
- * src/base/ftmac.c (FT_New_Face_From_FOND): Fall back to SFNT if
- LWFN fails and both are available.
-
-2006-09-11 David Turner <david@freetype.org>
-
- * src/sfnt/sfobjs.c (tt_face_get_name): Support some fonts which
- report their English names through an Apple Roman
- (platform,encoding) pair, with language_id != English.
-
- If the font uses another name entry with language_id == English, it
- will be selected correctly, though.
-
- * src/truetype/ttobjs.c (tt_face_init): Add unpatented hinting
- selection for `mingli.ttf'.
-
-2006-09-05 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttpload.c (tt_face_load_hdmx): Handle `record_size'
- values which have the upper two bytes set to 0xFF instead of 0x00
- (as it happens in at least two CJKV fonts, `HAN NOM A.ttf' and
- `HAN NOM B.ttf').
-
- * src/smooth/ftgrays.c [GRAYS_USE_GAMMA]: Really remove all code.
-
-2006-09-05 David Turner <david@freetype.org>
-
- Minor source cleanups and optimizations.
-
- * src/smooth/ftgrays.c (GRAYS_COMPACT): Removed.
- (TRaster): Remove `count_ex' and `count_ey'.
- (gray_find_cell): Remove 2nd and 3rd argument.
- (gray_alloc_cell): Merged with `gray_find_cell'.
- (gray_record_cell): Simplify.
- (gray_set_cell): Rewrite.
- (gray_start_cell): Apply offsets to `ras.ex' and `ras.ey'.
- (gray_render_span): Don't use FT_MEM_SET for small values.
- (gray_dump_cells) [DEBUG_GRAYS]: New function.
- (gray_sweep): Avoid buffer overwrites when to drawing the end of a
- bitmap scanline.
- (gray_convert_glyph): Fix speed-up.
-
-2006-09-04 David Turner <david@freetype.org>
-
- * src/smooth/ftgrays.c (gray_convert_glyphs): Make it work with
- 64bit processors.
-
-2006-09-03 Werner Lemberg <wl@gnu.org>
-
- * devel/ftoption.h: Synchronize with
- include/freetype/config/ftoption.h.
-
- * src/smooth/ftgrays.c (gray_record_cell): Remove shadowing
- variable declaration.
- (gray_convert_glyph): Fix compiler warnings.
-
-2006-09-01 David Turner <david@freetype.org>
-
- * src/truetype/ttobjs.c (tt_face_init): Update the TrueType loader
- to recognize a few fonts that require the automatic unpatented
- loader.
-
- * src/smooth/ftgrays.c: Optimize the performance of the anti-aliased
- rasterizer. The speed improvement is between 15% and 25%, depending
- on the font data.
-
- (GRAYS_USE_GAMMA, GRAYS_COMPACT): Removed, and all associated code.
- (TCell): Redefine.
- (TRaster): New members `buffer', `buffer_size', `ycells', `ycount'.
- (gray_init_cells): Updated.
- (gray_find_cell, gray_alloc_cell): New functions.
- (gray_record_cell): Rewritten to use `gray_find_cell' and
- `gray_alloc_cell'.
- (PACK, LESS_THAN, SWAP_CELLS, DEBUG_SORT, QUICK_SORT, SHELL_SORT,
- QSORT_THRESHOLD):
- Removed.
- (gray_shell_sort, gray_quick_sort, gray_check_sort,
- gray_dump_cells): Removed.
- (gray_sweep): Rewritten.
- (gray_convert_glyph): Rewrite code which used one of the sorting
- functions.
- (gray_raster_render): Updated.
-
-2006-08-29 Dr. Werner Fink <werner@suse.de>
-
- * configure: Make it possible to handle configure options which
- have strings containing spaces.
-
-2006-08-27 David Turner <david@freetype.org>
-
- * include/freetype/config/ftoption.h (TT_USE_BYTECODE_INTERPRETER):
- New macro, defined if either TT_CONFIG_OPTION_BYTECODE_INTERPRETER
- or TT_CONFIG_OPTION_UNPATENTED_HINTING is defined.
-
- * include/freetype/internal/ftcalc.h, src/base/ftcalc.c,
- src/truetype/truetype.c, src/truetype/ttdriver.c,
- src/truetype/ttgload.c, src/truetype/ttgload.h,
- src/truetype/ttinterp.c, src/truetype/ttobjs.c,
- src/truetype/ttobjs.h, src/truetype/ttpload.c, src/type42/t42drivr.c:
- s/TT_CONFIG_OPTION_BYTECODE_INTERPRETER/TT_USE_BYTECODE_INTERPRETER/.
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New
- member `force_autohint'.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Use `force_autohint'.
-
- * src/truetype/ttobjs.c (tt_face_init): Prepare code for testing
- against a list of font names which need the bytecode interpreter.
-
-2006-08-27 Jens Claudius <jens.claudius@yahoo.com>
-
- Fix miscellaneous compiler warnings.
-
- * include/freetype/internal/ftobjs.h: Close comment with `*/' to
- avoid `/* in comment' compiler warning.
-
- * src/base/ftdbgmem.c (ft_mem_table_get_source): Turn cast
- `(FT_UInt32)(void*)' into `(FT_UInt32)(FT_PtrDist)(void*)' since on
- 64-bit platforms void* is larger than FT_UInt32.
-
- * src/base/ftobjs.c (t_validator_error): Cast away
- volatileness of argument to ft_longjmp. Spotted by Werner
- `Putzfrau' Lemberg.
-
- * src/bdf/bdflib.c (bdf_load_font): Initialize local
- variable `lineno'.
-
- * src/gxvalid/gxvmod.c (classic_kern_validate): Mark local variable
- `error' as volatile.
-
-2006-08-27 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ftconfig.in: Synchronize with main ftconfig.h.
- Reported by Jens.
-
-2006-08-22 Jens Claudius <jens.claudius@yahoo.com>
-
- Fix for previous commit, which caused many compiler warnings/errors
- about addresses of volatile objects passed as function arguments as
- non-volatile pointers.
-
- * include/freetype/internal/ftvalid.h: Make FT_Validator typedef a
- pointer to a volatile object.
-
- * src/gxvalid/gxvmod.c (gxv_load_table): Make function argument
- `table' a pointer to a volatile object.
-
- * src/otvalid/otvmod.c (otv_load_table): Make function argument
- `table' a pointer to a volatile object.
-
-2006-08-18 Jens Claudius <jens.claudius@yahoo.com>
-
- * src/gxvalid/gxvmod.c (GXV_TABLE_DECL): Mark local variable `_sfnt'
- as volatile since it must keep its value across a call to ft_setjmp.
- (gxv_validate): Same for local variables `memory' and `valid'.
- (classic_kern_validate): Same for local variables `memory',
- `ckern', and `valid'.
-
- * src/otvalid/otvmod.c (otv_validate): Same for function parameter
- `face' and local variables `base', `gdef', `gpos', `gsub', `jstf',
- and 'valid'.
-
- * src/sfnt/ttcmap.c (tt_face_build_cmaps): Same for local variable
- `cmap'.
-
-2006-08-16 David Turner <david@freetype.org>
-
- * src/cid/cidgload.c (cid_slot_load_glyph): Remove compiler
- warnings.
-
- * src/base/ftobjs.c (ft_validator_run): Disable function; it is
- buggy by design. Always return -1.
-
-
- Improvements to native TrueType hinting. This is a first try,
- controlled by the FIX_BYTECODE macro in src/truetype/ttinterp.c.
-
- * include/freetype/internal/ftgloadr.h (FT_GlyphLoadRec): Add member
- `extra_points2'.
-
- * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add member
- `orus'.
-
- * src/base/ftgloadr.c (FT_GlyphLoader_Reset,
- FT_GlyphLoader_Adjust_Points, FT_GlyphLoader_CreateExtra,
- FT_GlyphLoader_CheckPoints, FT_GlyphLoader_CopyPoints): Updated to
- handle `extra_points2'.
-
- * src/truetype/ttgload.c (tt_prepare_zone): Handle `orus'.
- Remove compiler warning.
- (cur_to_arg): Remove macro.
- (TT_Hint_Glyph): Updated.
- (TT_Process_Simple_Glyph): Handle `orus'.
-
- * src/truetype/ttinterp.c (FIX_BYTECODE): New macro.
- (Ins_MD, Ins_MDRP, Ins_IP) [FIX_BYTECODE]: Handle `orus'.
- (LOC_Ins_IUP): Renamed to...
- (IUP_WorkerRec): This.
- Add `orus' member.
- (Shift): Renamed to...
- (_iup_worker_shift): This.
- Updated.
- (Interp): Renamed to...
- (_iup_worker_interpolate): This.
- Updated to handle `orus'.
- (Ins_IUP): Updated.
-
- * src/truetype/ttobjs.c (tt_glyphzone_done, tt_glyphzone_new):
- Handle `orus'.
-
-2006-08-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * modules.cfg (BASE_EXTENSIONS): Compile in ftgxval.c by default to
- build ftvalid in ft2demos. This has been inadvertently changed
- 2006-08-13.
-
-2006-08-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- `ft_validator_run' wrapping `setjmp' can cause a crash, as found by
- Jens:
- https://lists.gnu.org/archive/html/freetype-devel/2006-08/msg00004.htm.
-
- * src/otvalid/otvmod.c: Replace `ft_validator_run' by `ft_setjmp'.
- It reverts the change introduced on 2005-08-20.
-
- * src/gxvalid/gxvmod.c: Ditto.
-
-2006-08-13 Jens Claudius <jens.claudius@yahoo.com>
-
- * finclude/freetype/internal/psaux.h: (T1_TokenType): Add
- T1_TOKEN_TYPE_KEY.
- (T1_FieldRec): Add `dict'.
- (T1_FIELD_DICT_FONTDICT, T1_FIELD_DICT_PRIVATE): New macros.
- (T1_NEW_XXX, T1_FIELD_XXX): Update to take the dictionary where a PS
- keyword is expected as an additional argument.
-
- * src/cid/cidload.c: (cid_field_records): Adjust invocations of
- T1_FIELD_XXX.
-
- * src/cid/cidtoken.h: Adjust invocations of T1_FIELD_XXX.
-
- * src/psaux/psobjs.c: Add macro FT_COMPONENT for tracing.
- (ps_parser_to_token): Report a PostScript key as T1_TOKEN_TYPE_KEY,
- not T1_TOKEN_TYPE_ANY.
- (ps_parser_load_field): Make sure a token that should be a string or
- name is really a string or name.
- Avoid memory leak if a keyword has been already encountered and its
- value is overwritten.
- * src/type1/t1load.c: (t1_keywords): Adjust invocations of
- T1_FIELD_XXX.
- (parse_dict): Ignore keywords that occur in the wrong dictionary
- (e.g., in `Private' instead of `FontDict').
-
- * src/type1/t1tokens.h: Adjust invocations of T1_FIELD_XXX.
-
- * src/type42/t42parse.c: (t42_keywords): Adjust invocations of
- T1_FIELD_XXX.
-
-2006-07-18 Jens Claudius <jens.claudius@yahoo.com>
-
- Move creation of field `buildchar' of T1_DecoderRec out of
- `t1_decoder_init' and let the caller of `t1_decoder_init' take care
- of it.
-
- Call the finisher for T1_Decoder in `cid_face_compute_max_advance'
- and `T1_Compute_Max_Advance'.
-
- * include/freetype/internal/psaux.h (T1_DecoderRec): Remove field
- `face', add `len_buildchar'.
-
- * include/freetype/internal/t1types.h (T1_FaceRec): Add field
- `buildchar'.
-
- * src/cid/cidgload.c (cid_face_compute_max_advance): Call finisher
- for T1_Decoder.
- (cid_slot_load_glyph): Do not ignore failure when initializing the
- T1_Decoder.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Updated.
- (t1_decoder_init): Remove initialization of fields `buildchar' and
- `len_buildchar'.
- (t1_decoder_done): Remove deallocation of field `buildchar'.
-
- * freetype/src/type1/t1gload.c (T1_Compute_Max_Advance): Initialize
- T1_Decoder's `buildchar' and `len_buildchar'; call finisher for
- T1_Decoder.
- (T1_Load_Glyph): Initialize T1_Decoder's `buildchar' and
- `len_buildchar'; make sure to call finisher for T1_Decoder even in
- case of error.
-
- * src/type1/t1load.c (T1_Open_Face): Allocate new field `buildchar'
- of T1_FaceRec.
-
- * src/type1/t1objs.c (T1_Face_Done): Free new field `buildchar' of
- T1_FaceRec.
-
-2006-07-14 Jens Claudius <jens.claudius@yahoo.com>
-
- * include/freetype/internal/psaux.h: New macros IS_PS_NEWLINE,
- IS_PS_SPACE, IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT,
- and IS_PS_BASE85 (from src/psaux/psconv.h).
- (T1_FieldLocation): Add T1_FIELD_LOCATION_LOADER,
- T1_FIELD_LOCATION_FACE, and T1_FIELD_LOCATION_BLEND.
- (T1_DecoderRec): New fields `buildchar' and `face'.
- (IS_PS_TOKEN): New macro.
-
- * include/freetype/internal/t1types.h (T1_FaceRec): New fields
- `ndv_idx', `cdv_idx', and `len_buildchar'.
-
- * include/freetype/t1tables.h (PS_BlendRec): New fields
- `default_design_vector' and `num_default_design_vector'.
-
- * src/psaux/psconv.h: Move macros IS_PS_NEWLINE, IS_PS_SPACE,
- IS_PS_SPECIAL, IS_PS_DELIM, IS_PS_DIGIT, IS_PS_XDIGIT, and
- IS_PS_BASE85 to include/freetype/internal/psaux.h.
-
- * src/psaux/psobjs.c (ps_parser_to_token_array): Allow `token'
- argument to be NULL if we want only to count the number of tokens.
- (ps_tocoordarray): Allow `coords' argument to be NULL if we just
- want to skip the array.
- (ps_tofixedarray): Allow `values' argument to be NULL if we just
- want to skip the array.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add support
- for (partially commented out) othersubrs 19-25, 27, and 28.
- (t1_decoder_init): Initialize new fields `face' and `buildchar'.
- (t1_decoder_done): Release new field `buildchar'.
-
- * src/type1/t1load.c (parse_buildchar, parse_private): New
- functions.
- (t1_keywords): Register them.
- (t1_allocate_blend): Updated.
- (t1_load_keyword): Handle field types T1_FIELD_LOCATION_LOADER,
- T1_FIELD_LOCATION_FACE and T1_FIELD_LOCATION_BLEND.
- (parse_dict): Remove `keyword_flags' argument.
- Use new macro IS_PS_TOKEN.
- Changed function so that later PostScript definitions override
- earlier ones.
- (t1_init_loader): Initialize new field `keywords_encountered'.
- (T1_Open_Face): Initialize new fields `ndv_idx', `cdv_idx', and
- `len_buildchar'.
- Remove `keywords_flags'.
-
- * src/type1/t1load.h (T1_LoaderRec): New field
- `keywords_encountered'.
- (T1_PRIVATE, T1_FONTDIR_AFTER_PRIVATE): New macros.
-
- * src/type1/t1tokens.h [!T1_CONFIG_OPTION_NO_MM_SUPPORT]: New
- entries for parsing /NDV, /CDV, and /DesignVector.
-
-2006-07-07 Werner Lemberg <wl@gnu.org>
-
- Add many checks to protect against malformed PCF files.
-
- * src/pcf/pcfdrivr.c (PCF_Face_Done): Protect against NULL pointers.
- (PCF_Face_Init): Add calls to PCF_Face_Done in case of errors.
-
- * src/pcf/pcfread.c (pcf_read_TOC): Protect against malformed table
- data and check that tables don't overlap (using a simple
- bubblesort).
- (PCF_METRIC_SIZE, PCF_COMPRESSED_METRIC_SIZE, PCF_PROPERTY_SIZE):
- New macros which give the size of data structures in the data
- stream.
- (pcf_get_properties): Use rough estimates to get array size limits.
- Assign `face->nprops' and `face->properties' earlier so that a call
- to PCF_Face_Done can do the clean-up in case of error.
- Protect against invalid string offsets.
- (pcf_get_metrics): Clean up code.
- Adjust tracing message levels.
- Use rough estimate to get array size limit.
- (pcf_get_bitmaps): Clean up code.
- Adjust tracing message levels.
- Use rough estimates to get offset limits.
- (pcf_get_encodings): Adjust tracing message level.
- (pcf_get_accel): Clean up code.
-
-2006-06-26 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Handle fonts correctly which
- don't have a POINT_SIZE property. This fixes Savannah bug #16914.
-
-2006-06-26 Jens Claudius <jens.claudius@yahoo.com>
-
- * src/psaux/t1decode.c (T1_Operator, t1_args_count): Add opcode 15.
- (t1_decoder_parse_charstrings): Operator with
- opcode 15 pops its two arguments.
- Handle the case where the pops of an othersubr may be part of a
- subroutine.
- Handle unknown othersubrs gracefully: count their operands and let
- the following pop operators push the operands as the results onto
- the Type1 stack.
- Improve handling of setcurrentpoint opcode.
-
-2006-06-25 Jens Claudius <jens.claudius@yahoo.com>
-
- The Type 1 parser now skips over top-level procedures as required
- for a `Simplified Parser'. This makes the parser more robust as it
- doesn't poke around in PostScript code. Additionally, it makes the
- FontDirectory hackery in src/type1/t1load.c unnecessary.
-
- * src/psaux/psobjs.c (IS_OCTAL_DIGIT): New macro.
- (skip_literal_string): Add FT_Error as return value.
- Handle escapes better.
- (skip_string): Add FT_Error as return value.
- Don't set `parser->error' but return error code directly.
- (skip_procedure): New function.
- (ps_parser_skip_PS_token): Handle procedures.
- Update code.
- (ps_parser_to_token): Update code.
- (ps_parser_load_field_table): Handle bbox entries also.
-
- * src/type1/t1load.c (parse_dict): Remove FontDirectory hackery.
- Add commented-out code for synthetic fonts.
-
-2006-06-24 Eugeniy Meshcheryakov <eugen@univ.kiev.ua>
-
- Fix two hinting bugs as reported in
- https://lists.gnu.org/archive/html/freetype-devel/2006-06/msg00057.html.
-
- * include/freetype/internal/tttypes.h (TT_GlyphZoneRec): Add
- `first_point' member.
-
- * src/truetype/ttgload.c (tt_prepare_zone): Initialize
- `first_point'.
- (TT_Process_Composite_Glyph): Always untouch points.
-
- * src/truetype/ttinterp.c (Ins_SHC): Fix computation of
- `first_point' and `last_point' in case of composite glyphs.
- (Ins_IUP): Fix computation of `end_point'.
-
-2006-06-22 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Insert EndianS16_BtoN and EndianS32_BtoN as workaround for Intel
- Mac. The original patch was written by David Sachitano and Lawrence
- Coopet, and modified by Sean McBride for MPW compatibility. Only
- required data are converted; unused data are left in big endian.
-
- * src/base/ftmac.c: Include <Endian.h> for byteorder macros for non
- Mac OS X platforms.
- (OS_INLINE): Undefine before definition.
- (count_faces_sfnt): Insert EndianS16_BtoN to parse the header of
- FontAssociation table in FOND resource.
- (count_faces_scalable): Insert EndianS16_BtoN to parse the header
- and fontSize at each entry of FontAssociation table in FOND
- resource.
- (parse_fond): Insert EndianS16_BtoN and EndianS32_BtoN to parse
- ffStylOff of FamilyRecord header of FOND resource, the header,
- fontSize, fontID at each entry of FontAssociation table, and
- StyleMapping table.
- (count_faces): Call `HUnlock' after all FOND utilization.
-
-2006-06-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Public API of TrueTypeGX, OpenType, and classic kern table validator
- should return `FT_Err_Unimplemented_Feature' if validation service
- is unavailable (disabled in `modules.cfg'). It is originally
- suggested by David Turner, cf.
- https://lists.gnu.org/archive/html/freetype-devel/2005-11/msg00078.html
-
- * src/base/ftgxval.c (FT_TrueTypeGX_Validate): Return
- FT_Err_Unimplemented_Feature if TrueTypeGX validation service is
- unavailable.
- (FT_ClassicKern_Validate): Return FT_Err_Unimplemented_Feature if
- classic kern table validation service is unavailable.
-
- * src/base/ftotval.c (FT_OpenType_Validate): Return
- FT_Err_Unimplemented_Feature if OpenType validation service is
- unavailable.
-
-2006-06-08 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdflib.c (bdf_load_font): Fix memory leaks in case of
- errors.
-
-2006-06-07 David Turner <david@freetype.org>
-
- * src/type1/t1afm.c (KERN_INDEX): Make it more robust.
- (T1_Read_Metrics): Fix memory leak which happened when the metrics
- file doesn't have kerning pairs. This fixes Savannah bug #16768.
-
-2006-06-06 David Turner <david@freetype.org>
-
- Fix memory leak described in Savannah bug #16759.
-
- We change `ps_unicodes_init' so that it also takes a
- `free_glyph_name' callback to release the glyph names returned by
- `get_glyph_name'
-
- * include/freetype/internal/services/svpscmap.h (PS_Glyph_NameFunc):
- Renamed to ...
- (PS_GetGlyphNameFunc): This.
- (PS_FreeGlyphNameFunc): New typedef.
- (PS_Unicodes_InitFunc): Add variable for PS_FreeGlyphNameFunc.
-
- * src/cff/cffcmap.c (cff_sid_to_glyph_name): Use `TT_Face' for first
- argument.
- (cff_sid_free_glyph_name): New function.
- (cff_cmap_unicode_init): Updated.
-
- * src/psaux/t1cmap.c (t1_cmap_unicode_init): Updated.
-
- * src/psnames/psmodule.c (ps_unicodes_init): Add variable for
- PS_FreeGlyphNameFunc and use it.
-
-
-2006-06-04 David Turner <david@freetype.org>
-
- * src/base/ftutil.c (ft_mem_qrealloc): Fix the function to accept
- `item_size == 0' as well -- though this sounds weird, it can
- theoretically happen. This fixes Savannah bug #16669.
-
- * src/pfr/pfrobjs.c (pfr_face_init): Fix the computation
- of `face->num_glyphs' which missed the last glyph, due to
- the offset-by-1 computation, since the PFR format doesn't
- guarantee that glyph index 0 corresponds to the `missing
- glyph. This fixes Savannah bug #16668.
-
-2006-05-25 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/unix-cc.in (LINK_LIBRARY): Don't comment out
- `-no-undefined'. Reported by Christian Biesinger.
-
-2006-05-19 Brian Weed <bw@imaginengine.com>
-
- * builds/win32/visualc/freetype.dsp: Release libraries no longer
- have debug information, and debug libraries use `C7 compatible'
- debug info.
-
-2006-05-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Apply patch by Derek Clegg to fix two memory leaks in the MacOS
- resource fork handler. This fixes Savannah bug #16631.
-
- * src/base/ftobjs.c (load_face_in_embedded_rfork): Replace
- `FT_Stream_Close' by `FT_Stream_Free' to fix memory leak.
-
- * src/base/ftrfork.c (raccess_guess_linux_double_from_file_name):
- Replace `FT_Stream_Close' by `FT_Stream_Free' to fix memory leak.
-
-2006-05-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * build/unix/configure.raw: Add a fallback to disable Carbon
- dependency, if configured with no options on Mac OS X.
-
-2006-05-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftmac.c (open_face_from_buffer): Deallocate stream when
- its content cannot be parsed as supported font. This fixes
- the second part of Savannah bug #16590.
-
-2006-05-18 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (TT_Load_Composite_Glyph)
- [TT_CONFIG_OPTION_BYTECODE_INTERPRETER]: Make it compilable again.
-
-2006-05-17 David Turner <david@freetype.org>
-
- This is a major patch used to drastically improve the performance of
- loading glyphs. This both speeds up loading the glyph vectors
- themselves and the auto-fitter module.
-
- We now use inline assembler code with GCC to implement `FT_MulFix',
- which is probably the most important function related to the
- engine's performance.
-
- The resulting speed-up is about 25%.
-
-
- * include/freetype/internal/tttypes.h (TT_LoaderRec): Add fields
- `cursor' and `limit'.
-
- * src/autofit/afangles.c (af_corner_is_flat, af_corner_orientation):
- New functions.
- (AF_ATAN_BITS, af_arctan, af_angle_atan): Comment out.
- [TEST]: Remove.
-
- * src/autofit/afcjk.c (AF_Script_UniRangeRec): Comment out test
- code.
-
- * src/autofit/afhints.c (af_axis_hints_new_segment): Don't call
- `FT_ZERO'
- (af_direction_compute, af_glyph_hints_compute_inflections): Rewritten.
- (af_glyph_hints_reload: Rewrite recognition of weak points.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments): Move
- constant values out of the loops.
-
- * src/autofit/aftypes.h: Updated.
-
- * src/base/ftcalc.c (FT_MulFix): Use inline assembler code.
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Use vector
- product to get orientation.
-
- * src/gzip/ftgzip.c (ft_get_uncompressed_size): New function.
- (FT_Stream_OpenGzip): Use it to handle small files directly in
- memory.
-
- * src/psaux/psconv.c (PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode):
- Improve performance.
-
- * src/truetype/ttgload.c (TT_Access_Glyph_Frame): Set `cursor' and
- `limit'.
-
- (TT_Load_Glyph_Header, TT_Load_Simple_Glyph,
- TT_Load_Composite_Glyph): Updated. Add threshold to protect against
- exceedingly large values of number of contours. Speed up by
- reducing the number of loops.
-
- * src/type1/t1gload.c (T1_Load_Glyph): Don't apply unit matrix.
-
-
- * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Change the threshold
- used to detect rogue clients from 4 to 16. This is to prevent some
- segmentation faults with fonts like `KozMinProVI-Regular.otf' which
- comes from the Japanese Adobe Reader Asian Font pack.
-
-2007-05-17 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_font_done): Deallocate subfont array. This
- fixes the first part of Savannah bug #16590.
-
-2006-05-16 Werner Lemberg <wl@gnu.org>
-
- * docs/PROBLEMS: Updated icl issues.
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2006-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/ChangeLog.24 b/freetype/ChangeLog.24
deleted file mode 100644
index 17e98c48..00000000
--- a/freetype/ChangeLog.24
+++ /dev/null
@@ -1,6360 +0,0 @@
-2013-05-08 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.12 released.
- ==========================
-
-
- Tag sources with `VER-2-4-12'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.12.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.11/2.4.12/, s/2411/2412/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 12.
-
- * builds/unix/configure.raw (version_info): Set to 16:1:10.
-
-2013-05-08 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2013-05-08 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Typo.
-
-2013-05-05 Werner Lemberg <wl@gnu.org>
-
- Synchronize `ftconfig.h'.
-
- * builds/unix/ftconfig.in: Updated.
-
-2013-05-05 Werner Lemberg <wl@gnu.org>
-
- Fix compilation with C++.
-
- * src/base/md5.c (body): Use proper cast.
-
-2013-05-05 Werner Lemberg <wl@gnu.org>
-
- Fix 64bit compilation issues.
-
- * include/freetype/config/ftconfig.h [FT_LONG64]: Typedef
- `FT_Int64' here.
-
- * src/base/ftcalc.c: Remove typedef of `FT_Int64'.
- (FT_DivFix): Fix cast.
- * src/base/fttrigon.c: Remove typedef of `FT_Int64'.
-
-2013-05-05 Werner Lemberg <wl@gnu.org>
-
- [raster] Fix clang issues.
-
- Fix suggested by <octoploid@yandex.com>.
-
- * src/raster/ftraster.c (ULong): New typedef.
- (SCALED): Add proper cast.
-
-2013-05-04 Werner Lemberg <wl@gnu.org>
-
- Fix clang fixes.
-
- * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate): Use
- correct types.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <default>: Force
- unsigned for computations.
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Ditto.
- * src/cff/cffparse.c (cff_parse_integer): Ditto.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto.
-
-2013-05-04 Werner Lemberg <wl@gnu.org>
-
- [cff] Make Adobe CFF engine work correctly on 64bit hosts.
-
- Reported by numerous people on the `freetype-devel' list. Without
- this fix, glyphs aren't properly aligned on a common baseline.
-
- On 64bit systems, `FT_Pos' expands to `long int', having a width of
- 64bit. `CF2_Fixed' expands to `int' which is normally 32bit wide on
- 64bit hosts also. Wrong casts filled up the blues arrays with
- incorrect values. Note that all blues values are accessed with the
- `cf2_blueToFixed' macro which handles the 64bit to 32bit conversion.
-
- * src/cff/cf2ft.h (cf2_getBlueValues, cf2_getOtherBlues,
- cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Use `FT_Pos' for
- `data', not `CF2_Fixed'.
- * src/cff/cf2ft.c (cf2_getBlueValues, cf2_getOtherBlues,
- cf2_getFamilyBlues, cf2_getFamilyOtherBlues): Updated.
- * src/cff/cf2blues.c (cf2_blues_init): Updated.
-
-2013-05-04 Werner Lemberg <wl@gnu.org>
-
- More fixes for clang's `sanitize' feature.
-
- * src/base/ftcalc.c (FT_DivFix): Use unsigned values for
- computations which use the left shift operator and convert to signed
- as the last step.
- * src/base/fttrigon.c (ft_trig_prenorm, FT_Vector_Rotate,
- FT_Vector_Length, FT_Vector_Polarize): Ditto.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Simplify.
- * src/cff/cffload.c (cff_subfont_load): Fix constant.
- * src/cff/cffparse.c (cff_parse_integer, cff_parse_real, do_fixed,
- cff_parse_fixed_dynamic): Use unsigned values for computations which
- use the left shift operator and convert to signed as the last step.
-
- * src/cid/cidload.c (cid_get_offset): Ditto.
-
- * src/psaux/psconv.c (PS_Conv_ToFixed): Ditto.
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Ditto.
-
- * src/truetype/ttinterp.c (TT_MulFix14, TT_DotFix14): Ditto.
-
-2013-05-04 Werner Lemberg <wl@gnu.org>
-
- Fix errors reported by clang's `sanitize' feature.
-
- * include/freetype/internal/ftstream.h: Simplify and fix integer
- extraction macros.
- (FT_INT8_, FT_BYTE_I16, FT_BYTE_I32, FT_INT8_I16, FT_INT8_I32,
- FT_INT8_I32, FT_INT8_U32): Removed.
- (FT_PEEK_SHORT, FT_PEEK_LONG, FT_PEEK_OFF3, FT_PEEK_SHORT_LE,
- FT_PEEK_LONG_LE, FT_PEEK_OFF3_LE): Use unsigned values for
- computations and convert to signed as the last step.
-
- * src/cff/cf2fixed.h (cf2_intToFixed, cf2_fixedToInt,
- cf2_fracToFixed): Avoid shifts of negative values.
- (cf2_intToFrac, cf2_fixedToFrac, cf2_fixedTo26Dot6): Removed,
- unused.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdEXTENDEDNMBR,
- default>: Use unsigned values for computations and convert to signed
- as the last step.
- Use proper types in tracing messages.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Use unsigned
- values for computation of operands and convert to signed as the last
- step.
- Use proper type in tracing message.
-
-2013-05-03 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cf2blues.c: Remove dead code.
-
-2013-05-02 Chris Liddell <chris.liddell@artifex.com>
-
- * src/cff/cffgload.c: Include FT_CFF_DRIVER_H.
-
-2013-04-27 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
- * README: Improved.
-
-2013-04-13 Werner Lemberg <wl@gnu.org>
-
- [cff] Add a new Type 2 interpreter and hinter.
-
- This work, written by Dave Arnold <darnold@adobe.com> and fully
- integrated into FreeType by me, is a donation by Adobe in
- collaboration with Google. It is vastly superior to the old CFF
- engine, and it will replace it soon. Right now, it is still off by
- default, and you have to explicitly select it using the new
- `hinting-engine' property of the cff driver.
-
- For convenience, (most of) the new files are committed separately.
-
- * include/freetype/config/ftheader.h (FT_CFF_DRIVER_H): New macro.
- * include/freetype/ftcffdrv.h: New file to access CFF driver
- properties.
- * include/freetype/fterrdef.h (FT_Err_Glyph_Too_Big): New error
- code.
- * include/freetype/internal/fttrace.h: Add `cf2blues', `cf2hints',
- and `cf2interp'.
-
- * src/cff/cffgload.h (CFF_SubFont): New member `current_subfont'.
- * src/cff/cffobjs.h (CFF_DriverRec): New members `hinting_engine'
- and `no_stem_darkening'.
- * src/cff/cfftypes.h (CFF_FontRec): New member `cf2_instance'.
-
- * src/cff/cff.c: Include new files.
- * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle
- `hinting-engine' and `no-stem-darkening' properties (only the Adobe
- engine listens to them).
- * src/cff/cffgload.c: Include `cf2ft.h'.
- (cff_decoder_prepare): Initialize `current_subfont'.
- (cff_build_add_point): Handle Adobe engine which uses 16.16
- coordinates.
- (cff_slot_load): Handle FT_LOAD_NO_SCALE and FT_LOAD_NO_HINTING
- separately.
- Choose rendering engine based on `hinting_engine' property.
- * src/cff/cffload.c (cff_font_done): Call finalizer of the Adobe
- engine.
- * src/cff/cffobjs.c: Include FT_CFF_DRIVER_H.
- (cff_driver_init): Set default property values.
-
- * src/cff/rules.mk (CFF_DRV_SRC, CFF_DRV_H): Add new files.
-
- * src/cff/cf2*.*: New files, containing the Adobe engine.
-
-2013-04-12 Werner Lemberg <wl@gnu.org>
-
- [cff] Minor code administration issues.
-
- * src/cff/cffgload.c (check_points): Rename to...
- (cff_check_points): ...this and make it FT_LOCAL.
- (cff_builder_add_point, cff_builder_add_point1,
- cff_builder_start_point, cff_builder_close_contour,
- cff_lookup_glyph_by_stdcharcode, cff_get_glyph_data,
- cff_free_glyph_data): Make them FT_LOCAL.
-
- * src/cff/cffgload.h: Updated.
-
-2013-04-12 Werner Lemberg <wl@gnu.org>
-
- Add output bitmap checksums.
-
- Use `FT2_DEBUG=bitmap:3' for tracing.
-
- * src/base/md5.c, src/base/md5.h: New files, taken from
-
- https://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
-
- * include/freetype/internal/fttrace.h: Add `bitmap'.
-
- * src/base/ftobjs.c [FT_DEBUG_LEVEL_TRACE]: Include `md5.c'
-
- (FT_Render_Glyph_Internal) [FT_DEBUG_LEVEL_TRACE]: For tracing,
- convert resulting bitmap to a uniform format and compute a checksum.
- Use `bitmap' category for the tracing message.
-
- * src/base/rules.mk (BASE_H): Updated.
-
- * docs/LICENSE.TXT: Updated.
-
-2013-04-12 Werner Lemberg <wl@gnu.org>
-
- [cff] Add framework for CFF properties.
-
- * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC7):
- New macro.
-
- * src/cff/cffdrivr.c: Include FT_SERVICE_PROPERTIES_H.
- (cff_property_set, cff_property_get): New functions, still empty.
- Define `cff_service_properties' service.
- Update `cff_services'.
-
- * src/cff/cffpic.h: Include FT_SERVICE_PROPERTIES_H.
- (CFF_SERVICE_PROPERTIES_GET): New macro.
- (CffModulePIC): Add `cff_service_properties'.
-
-2013-04-03 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #38589.
-
- * src/bdf/bdflib.c (_bdf_readstream): Thinko.
-
-2013-03-31 Werner Lemberg <wl@gnu.org>
-
- * configure: Use egrep, not grep.
-
- Problem reported Mojca Miklavec <mojca.miklavec.lists@gmail.com>.
-
-2013-03-29 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftlcdfil.h: Add description of color filtering.
-
- Based on a contribution from Antti S. Lankila <alankila@bel.fi>
- (Savannah bug #38607).
-
-2013-03-23 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor.
-
- * src/autofit/afmodule.c (af_property_set): Typo.
- (af_autofitter_init, af_autofitter_done): Use cast.
-
-2013-03-21 Werner Lemberg <wl@gnu.org>
-
- * configure: Automatically test for `gmake' also.
-
- Suggested by Mojca Miklavec <mojca.miklavec.lists@gmail.com>.
-
-2013-03-21 Peter Breitenlohner <peb@mppmu.mpg.de>
-
- Respect CONFIG_SHELL from the environment.
-
- Some large packages using FreeType have to use a broken (deficient)
- /bin/sh. The configure scripts (as generated by Autoconf) are
- clever enough to find a better shell and put that one into the
- environment variable CONFIG_SHELL. If that environment variable is
- already set the script skips the test and assumes to be already
- running under a good shell.
-
- * builds/unix/detect.mk: Honour CONFIG_SHELL.
- * builds/unix/unix-def.in (SHELL): Define.
-
-2013-03-21 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah patch #7971.
-
- * configure: Handle MAKE environment variable also.
-
-2013-03-17 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #38538.
-
- * builds/amiga/src/base/ftdebug.c, builds/win32/ftdebug.c,
- builds/wince/ftdebug.c (FT_Throw): Add function.
-
-2013-03-17 Werner Lemberg <wl@gnu.org>
-
- [raster] Remove dead code.
-
- * src/raster/rastpic.c (ft_raster1_renderer_class_pic_init)
- src/smooth/ftspic.c (ft_smooth_renderer_class_pic_init): Do it.
-
-2013-03-17 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshpic.h (GET_PIC): Use correct container.
-
-2013-03-15 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftmoderr.h: Fix commit from 2013-03-11.
-
- The previous version was not backward compatible. Reported by
- Behdad.
-
-2013-03-14 Werner Lemberg <wl@gnu.org>
-
- */*: Use FT_ERR_EQ, FT_ERR_NEQ, and FT_ERR where appropriate.
-
- FT_Err_XXX and friends are no longer directly used in the source
- code.
-
-2013-03-14 Werner Lemberg <wl@gnu.org>
-
- New error management macros.
-
- * include/freetype/fterrors.h (FT_ERR_XCAT, FT_ERR_CAT): Move to...
- * include/freetype/fttypes.h: ... this file.
- (FT_ERR, FT_ERR_EQ, FT_ERR_NEQ, FT_MODERR_EQ, FT_MODERR_NEQ): New
- macros.
-
- * include/freetype/freetype.h: Updated.
-
-2013-03-14 Werner Lemberg <wl@gnu.org>
-
- */*: Use FT_Err_Ok only.
-
- This is a purely mechanical conversion.
-
-2013-03-14 Werner Lemberg <wl@gnu.org>
-
- */*: Use `FT_THROW'.
-
- This is essentially a mechanical conversion, adding inclusion of
- `FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for
- stand-alone compiling modes of the rasterizer modules.
-
- To convert the remaining occurrences of FT_Err_XXX and friends it is
- necessary to rewrite the code. Note, however, that it doesn't harm
- if some cases are not handled since FT_THROW is a no-op.
-
-2013-03-13 Werner Lemberg <wl@gnu.org>
-
- Introduce `FT_THROW' macro.
-
- The idea is to replace code like
-
- return FT_Err_Foo_Bar;
-
- or
-
- return CFF_Err_Foo_Bar;
-
- with
-
- return FT_THROW( Foo_Bar );
-
- The FT_THROW macro has two functions:
-
- . It hides the module specific prefix.
-
- . In debug mode, it calls the empty function `FT_Throw' which can
- be thus used to set a breakpoint.
-
- * include/freetype/internal/ftdebug.h (FT_THROW): New macro.
- (FT_Throw): New prototype.
- * src/base/ftdebug.c (FT_Throw): New function.
-
-2013-03-12 Werner Lemberg <wl@gnu.org>
-
- Remove `FT_KEEP_ERR_PREFIX'.
-
- The idea is to always have FT_ERR_PREFIX available internally.
-
- * include/freetype/fterrors.h: Use FT2_BUILD_LIBRARY to guard
- undefinition of FT_ERR_PREFIX
-
- * src/gxvalid/gxverror.h, src/otvalid/otverror.h,
- src/sfnt/sferrors.h: Updated.
-
-2013-03-11 Werner Lemberg <wl@gnu.org>
-
- [gxvalid] Fix module error.
-
- * src/gxvalid/gxverror.h (FT_ERR_BASE): Define as
- FT_Mod_Err_GXvalid.
- * include/freetype/ftmoderr.h: Add module error for `GXvalid'.
-
-2013-03-11 Werner Lemberg <wl@gnu.org>
-
- Always use module related error codes.
-
- * src/cff/cffobjs.c (cff_face_init), src/type1/t1objs.c
- (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Use
- `FT_ERROR_BASE'.
-
- * src/type1/t1load.c (parse_encoding): Use
- T1_Err_Unknown_File_Format.
-
-2013-03-08 Werner Lemberg <wl@gnu.org>
-
- [cff] Set `linear{Hori,Vert}Advance' for embedded bitmaps also.
-
- Problem reported by Khaled Hosny <khaledhosny@eglug.org>.
-
- * src/cff/cffgload.c (cff_slot_load): Implement it.
-
-2013-02-23 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fix commit ab02d9e8.
-
- * src/base/ftbbox.c (BBox_Cubic_Check): Change scaling to msb of 22.
-
-2013-02-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] New bisecting BBox_Cubic_Check (disabled).
-
- * src/base/ftbbox.c (BBox_Cubic_Check): New bisecting algorithm
- for extremum search built around simple condition that defines
- which half contains the extremum.
-
-2013-02-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [tools] Update BBox testing tool.
-
- * src/tools/test_bbox.c: Add another cubic outline with exact BBox.
- (REPEAT): Increase the number of benchmarking cycles.
- (profile_outline): Tweak output formatting.
-
-2013-02-02 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #38235.
-
- * builds/unix/configure.raw: Don't generate `freetype-config' and
- `freetype.pc'.
-
- * builds/unix/unix-def.in (FT2_EXTRA_LIBS, LIBBZ2, LIBZ,
- build_libtool_libs, ft_version): New variables to be substituted.
- (freetype-config, freetype.pc): New rules to generate those files.
-
- * builds/unix/freetype-config.in: Remove code for handling `rpath'.
- The use of $rpath has been accidentally removed in a patch from
- 2009-12-22, and apparently noone has missed it since.
- Use `%' instead of `@' as a variable substitution marker.
- Use quotes.
-
- * builds/unix/freetype.in: Use `%' instead of `@' as a variable
- substitution marker.
- Use quotes.
-
-2013-02-07 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttobjs.c (tt_size_run_prep): Reset more GS variables.
-
- BTW, Greg agrees that the OpenType specification is missing the list
- of GS variables which will always be reset to the default values
- after the `prep' table has been executed.
-
-2013-02-06 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttobjs.c (tt_size_run_prep): Reset reference points.
-
- Up to now, we simply took a snapshot of the Graphics State after the
- `prep' table has been executed, and right before a glyph's bytecode
- was run it got reloaded. However, as Greg Hitchcock has told us in
- private communication, reference points get reset to zero in the MS
- rasterizer and we follow in due course. While reasonable, this is
- undocumented behaviour.
-
- Most notably, this fixes the rendering of Arial's `x' glyph in
- subpixel hinting mode.
-
-2013-02-05 Werner Lemberg <wl@gnu.org>
-
- [truetype] A better fix for Savannah bug #38211.
-
- * src/truetype/ttinterp.c (Ins_IP): Implement identical behaviour to
- MS rasterizer if rp1 == rp2 (confirmed by Greg Hitchcock).
-
-2013-02-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [pcf] Streamline parsing of PCF encoding table.
-
- * src/pcf/pcfread.c (pcf_get_encodings): Use simpler double for-loop.
- Reallocate array instead of using temporary storage.
-
-2013-02-01 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #38227.
-
- * builds/unix/freetype-config.in: Set LC_ALL.
-
-2013-02-01 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #38221.
-
- This complements commit 83c0ebab.
-
- * src/base/ftcalc.c (FT_MulDiv_No_Round): Don't enclose with
- `TT_USE_BYTECODE_INTERPRETER'.
-
-2013-02-01 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #38211.
-
- * src/truetype/ttinterp.c (Ins_IP): Make FreeType behave identical
- to other interpreters if rp1 == rp2 (which is invalid).
-
-2013-01-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Small optimization of BBox calculation.
-
- * src/base/ftbbox.c (BBox_Cubic_Check): Use FT_MSB function in
- scaling algorithm.
-
-2013-01-26 Infinality <infinality@infinality.net>
-
- [truetype] Minor formatting fix.
-
- * src/truetype/ttinterp.c: Updated.
- (DO_RS): Fix indentation.
-
-2013-01-26 Infinality <infinality@infinality.net>
-
- [truetype] Fix rasterizer_version logic in sph.
-
- * src/truetype/ttsubpix.c: Updated.
- (ALWAYS_SKIP_DELTAP_Rules): Remove rule for Trebuchet MS.
- (sph_set_tweaks): Fix `rasterizer_version' logic.
-
-2013-01-26 Infinality <infinality@infinality.net>
-
- [truetype] Align more to ClearType whitepaper for sph.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Add flags
- for detected opcode patterns and compatibility mode.
-
- * src/truetype/ttgload.c (tt_loader_init): Complete conditional.
-
- * src/truetype/ttinterp.c: Updated.
- Remove SPH_DEBUG and replace with FT_TRACE7.
- (DO_RS): More conditions.
- (Ins_FDEF): Add more opcode detection patterns.
- More specific conditions when flagging an fdef.
- Make compatibility mode only turn on when delta fdefs are found.
- (Ins_CALL, Ins_LOOPCALL): Set flags for currently executed fdef.
- (Ins_SHPIX): Remove logic to handle ttfautohinted fonts.
- Simplify conditionals where possible.
- Use `&' instead of `%' operator for dumb compilers.
- (Ins_MIAP): Adjust twilight zone conditional.
- Ensure `ignore_x_mode' is on when testing sph conditionals.
- (Ins_MIRP): Ensure `ignore_x_mode' is on when testing sph
- conditionals.
- Do cvt cutin always when `ignore_x_mode' is active.
- Remove test for ttfautohinted fonts.
- (Ins_DELTAP): Ensure `ignore_x_mode' is on when testing sph
- conditionals.
- Do cvt cutin always when `ignore_x_mode' is active.
- Remove test for ttfautohinted fonts.
- Use `&' instead of `%' operator for dumb compilers.
- (Ins_GETINFO): Remove SPH_DEBUG and replace with FT_TRACE7.
-
- * src/truetype/ttinterp.h: Updated.
- (TT_ExecContextRec): Remove compatibility_mode variable.
- Add variable to indicate when executing in special fdefs for sph.
-
- * src/truetype/ttobjs.h: Updated.
- (TT_DefRecord): Add flags to identify special fdefs for sph.
- (TT_SizeRec): Remove unnecessary ttfautohinted variable.
-
- * src/truetype/ttsubpix.c: Updated.
- (COMPATIBILITY_MODE_Rules): Remove all. Auto-detected now.
- (PIXEL_HINTING_Rules): Remove all. Unnecessary after fixes.
- (SKIP_NONPIXEL_Y_MOVES_Rules): Remove Ubuntu.
- (SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Arial Bold `N'.
- (SKIP_OFFPIXEL_Y_MOVES_Rules): Remove all. Happens automatically
- now.
- (ROUND_NONPIXEL_Y_MOVES_Rules): Remove Ubuntu.
- (ROUND_NONPIXEL_Y_MOVES_Rules_Exceptions): Remove all.
- (NORMAL_ROUND_Rules): Remove Verdana.
- (NO_DELTAP_AFTER_IUP_Rules): Remove all.
- (sph_set_tweaks): Performance fix. Don't run prep always.
- Adjust conditional for sph_compatibility_mode.
-
- * src/truetype/ttsubpix.h: Add new fdef flags for sph.
-
-2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fix broken emboldening at small sizes.
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Do not attempt to
- normalize zero-length vectors.
-
-2013-01-25 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #38167.
-
- This fixes commit 83c0ebab from 2012-06-27.
-
- * src/truetype/ttinterp.h:
- s/TT_CONFIG_OPTION_BYTECODE_INTERPRETER/TT_USE_BYTECODE_INTERPRETER/.
-
-2013-01-25 Xi Wang <xi.wang@gmail.com>
-
- [sfnt] Fix broken pointer overflow checks.
-
- Many compilers such as gcc and clang optimize away pointer overflow
- checks `p + n < p', because pointer overflow is undefined behavior.
- Use a safe form `n > p_limit - p' instead.
-
- Also avoid possible integer overflow issues, for example, using
- `num_glyphs > ( p_limit - p ) / 2' rather than `num_glyphs * 2'
- given a large `num_glyphs'.
-
- * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_image): Implement it.
-
-2013-01-25 Werner Lemberg <wl@gnu.org>
-
- [base] Fix `make multi'.
-
- * src/base/ftoutln.c, src/base/fttrigon.c: Include
- FT_INTERNAL_CALC_H.
-
-2013-01-25 David 'Digit' Turner <digit@google.com>
-
- [truetype] Fix C++ compilation.
-
- * src/truetype/ttsubpix.h: Updated.
- (SPH_X_SCALING_RULES_SIZE): Moved and renamed to...
- * src/truetype/ttsubpix.c (X_SCALING_RULES_SIZE): This.
- (sph_X_SCALING_Rules): Removed.
- (scale_test_tweak): Make function static.
- (sph_test_tweak_x_scaling): New function.
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Updated.
-
-2013-01-23 Werner Lemberg <wl@gnu.org>
-
- [base] Make `FT_Hypot' really internal.
-
- * include/freetype/fttrigon.h (FT_Hypot): Move to...
- * include/freetype/internal/ftcalc.h: This file.
-
- * src/base/fttrigon.c (FT_Hypot): Move to...
- * src/base/ftcalc.c: This file.
- Include FT_TRIGONOMETRY_H.
-
- * src/truetype/ttgload.c: Don't include FT_TRIGONOMETRY_H.
-
-2013-01-23 Werner Lemberg <wl@gnu.org>
-
- [truetype] Revert change from 2013-01-22.
-
- FreeType's `height' value is the baseline-to-baseline distance...
-
- * src/truetype/ttobjs.c (tt_size_reset): Undo.
-
-2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base, truetype] New internal `FT_Hypot' function.
-
- * include/freetype/fttrigon.h (FT_Hypot): Declare it.
- * src/base/fttrigon.c (FT_Hypot): Define it.
- * src/truetype/ttgload.c (TT_Process_Composite_Component): Use it
- instead of explicit expressions.
- * src/truetype/ttinterp.c (Current_Ratio, Normalize): Use it instead
- of TT_VecLen.
- (TT_VecLen): Removed.
-
-2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fix integer overflow.
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and
- outgoing vectors and use fixed point arithmetic.
-
-2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fix integer overflow.
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Scale the
- coordinates down to avoid overflow.
-
-2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Split out MSB function.
-
- * src/base/fttrigon.c (ft_trig_prenorm): Borrow from here.
- * include/freetype/internal/ftcalc.h (FT_MSB): Declare here.
- * src/base/ftcalc.c (FT_MSB): Define here.
-
-2013-01-22 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix font height.
-
- * src/truetype/ttobjs.c (tt_size_reset): The Windows rendering
- engine uses rounded values of the ascender and descender to compute
- the TrueType font height.
-
-2013-01-16 Behdad Esfahbod <behdad@behdad.org>
-
- [sfnt] Fix optimized sbit loader.
-
- It was not taking bit_depth into consideration when blitting!
-
- * src/sfnt/ttsbit0.c (tt_sbit_decoder_load_byte_aligned,
- * tt_sbit_decoder_load_bit_aligned): Handle bit
- depth.
-
-2013-01-16 David 'Digit' Turner <digit@google.com>
-
- [truetype] Improve subpixel code.
-
- This patches fixes many issues with the ttsubpix implementation.
-
- 1. Data tables are defined, instead of declared, in the header, and
- thus copied into each source file that includes it.
-
- 2. These tables were defined as global, mutable, visible variables,
- and thus costing private RAM to every process that loads the
- library (> 50 KB / process, this is huge!).
-
- Additionally, this also made the library export the symbols
- completely needlessly.
-
- 3. Missing `sph_' and `SPH_' prefixes to some of the definitions.
-
- Note that this doesn't try to fix the incredibly inefficient storage
- format for the data tables used by the code. This one will require
- another pass in the future.
-
- * src/truetype/ttinterp.h (MAX_NAME_SIZE, MAX_CLASS_MEMBERS):
- Renamed to...
- (SPH_MAX_NAME_SIZE, SPH_MAX_CLASS_MEMBERS): This.
- Update all users.
-
- (SPH_TweakRule, SPH_ScaleRule): Decorate with `const' where
- appropriate.
-
- (Font_Class): Rename to...
- (SPH_Font_Class): This. Decorate with `const' where appropriate.
-
- * src/truetype/ttsubpix.h (scale_test_tweak, sph_test_tweak):
- Decorate arguments with `const' where appropriate.
-
- Move font tweaking tables to...
-
- * src/truetype/ttsubpix.c: This file and decorate them with `static'
- and `const' where appropriate.
-
- (X_SCALING_Rules, X_SCALING_RULES_SIZE): Renamed to...
- (sph_X_SCALING_Rules, SPH_X_SCALING_RULES_SIZE): This.
- Update all users.
-
-2013-01-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Improve accuracy of normalization of short vectors.
-
- Unit vector components are stored as 2.14 fixed-point numbers. In
- order to calculate all 14 bits accurately, a short vector to be
- normalized has to be upscaled to at least 14 bits before its length
- is calculated. This has been safe since accurate CORDIC algorithms
- were adopted.
-
- * src/truetype/ttinterp.c (Normalize): Scale short vectors by 0x4000.
-
-2013-01-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Kill very old vector normalization hacks.
-
- Back in the days, vector length calculations were not very accurate
- and the vector normalization function, Normalize, had to meticulously
- correct the errors for long vectors [commit b7ef2b096867]. It was no
- longer necessary after accurate CORDIC algorithms were adopted, but
- the code remained. It is time to kill it.
-
- * src/truetype/ttinterp.c (Normalize): Remove error compensation.
- (TT_VecLen): Remove any mention of old less accurate implementation.
-
-2013-01-11 Werner Lemberg <wl@gnu.org>
-
- Disable FT_CONFIG_OPTION_OLD_INTERNALS.
-
- After the next release we are going to remove the code completely.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (FT_CONFIG_OPTION_OLD_INTERNALS): Comment out.
- * docs/CHANGES: Document it.
-
-2013-01-10 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Update the overflow protection bit.
-
- The recent optimizations of CORDIC iterations drastically reduce the
- expansion factor. Vector components with MSB of 29 are now safe
- from overflow.
-
- * src/base/fttrigon.c (FT_TRIG_SAFE_MSB): New macro.
- (ft_trig_prenorm): Use it and remove dead code.
-
-2013-01-09 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base, pshinter] Use FT_ABS, FT_MIN, and FT_MAX for readability.
-
- * src/base/ftbbox.c: Updated.
- * src/base/ftobjs.c: Updated.
- * src/base/fttrigon.c: Updated.
- * src/pshinter/pshalgo.c: Updated.
- * src/pshinter/pshrec.c: Updated.
-
-2013-01-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Clean up trigonometric core.
-
- * src/base/fttrigon.c: Document the algorithm in a large comment.
- (FT_TRIG_COSCALE): Remove macro.
- (FT_Tan: Use `FT_TRIG_SCALE' instead.
- (FT_Cos, FT_Vector_Unit): Ditto and round the return values.
-
-2013-01-02 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Use rounding in CORDIC iterations.
-
- * src/base/fttrigon.c (ft_trig_pseudo_rotate,
- ft_trig_pseudo_polarize): Improve accuracy by rounding.
-
-2013-01-02 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Reduce trigonometric algorithms.
-
- After we get within 45 degrees by means of true 90-degree rotations,
- we can remove initial 45-degree CORDIC iteration and start from
- atan(1/2) pseudorotation, reducing expansion factor thereby.
-
- * src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macros.
- (ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Update.
-
- * src/tools/cordic.py: Bring up to date with trigonometric core.
-
- * docs/CHANGES: Old typo.
-
-2013-01-02 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/pshinter/pshalgo.h: Remove unused code.
-
-2012-12-27 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (tt_loader_init): Add more tracing.
-
-2012-12-23 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix handling of /FontBBox in MM fonts.
- Problem reported by Del Merritt <del@alum.mit.edu>
-
- If we have
-
- /FontBBox { { 11 12 13 14 15 16 17 18 }
- { 21 22 23 24 25 26 27 28 }
- { 31 32 33 34 35 36 37 38 }
- { 41 42 43 44 45 46 47 48 } }
-
- in the /Blend dictionary, then the first BBox is { 11 21 31 41 },
- the second { 12 22 32 42 }, etc.
-
- * include/freetype/internal/psaux.h (T1_FieldType): Add
- `T1_FIELD_TYPE_MM_BBOX' (for temporary use).
-
- * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>:
- Implement it.
-
-2012-12-21 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/tools/cordic.py: Bring up to date with trigonometric core.
-
-2012-12-21 Werner Lemberg <wl@gnu.org>
-
- Check parameters of `FT_Outline_New'.
- Problem reported by Robin Watts <robin.watts@artifex.com>.
-
- * src/base/ftoutln.c (FT_Outline_New_Internal): Ensure that
- `numContours' and `numPoints' fit into FT_Outline's `n_points' and
- `n_contours', respectively.
-
-2012-12-20 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.11 released.
- ==========================
-
-
- Tag sources with `VER-2-4-11'.
-
- * docs/CHANGES, docs/release: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.11.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.10/2.4.11/, s/2410/2411/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 11.
-
- * builds/unix/configure.raw (version_info): Set to 16:0:10.
-
- * builds/toplevel.mk (dist): Don't include `.mailmap'.
-
-2012-12-20 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Improve trigonometric core.
-
- FreeType used to rely on a 24-step iteration CORDIC algorithm to
- calculate trigonometric functions and rotate vectors. It turns out
- that once the vector is in the right half-plane, the initial rotation
- by 63 degrees is not necessary. The algorithm is perfectly capable
- to converge to any angle starting from the second 45 degree rotation.
- This patch removes the first rotation and makes it a 23-step CORDIC
- algorithm.
-
- * src/base/fttrigon.c (FT_TRIG_SCALE, FT_TRIG_COSCALE): Update macro
- values.
- (ft_trig_pseudo_rotate, ft_trig_pseudo_polarize): Remove initial
- rotation.
-
-2012-12-19 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (ft_property_do): Fix compiler warning.
-
-2012-12-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftrfork.c (FT_Raccess_Guess): Switch to FT_Int counters.
-
-2012-12-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Clean up trigonometric core.
-
- * src/base/fttrigon.c (ft_trig_pseudo_polarize): Align algorithm
- with `ft_trig_pseudo_rotate'.
-
-2012-12-18 Infinality <infinality@infinality.net>
-
- [truetype] Minor performance enhancement.
-
- * src/truetype/ttgload.c: (TT_Process_Simple_Glyph): Use FT_MulFix
- instead of FT_MulDiv.
-
-2012-12-17 Infinality <infinality@infinality.net>
-
- [truetype] Remove unused code and variables.
-
- * src/truetype/ttinterp.c: Updated.
- (Ins_FDEF): Remove opcode patterns that are not being used.
-
-2012-12-16 Werner Lemberg <wl@gnu.org>
-
- Various compiler warning fixes.
-
- * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Use
- `logical not' operator instead of negation. The idea is that `~'
- returns exactly the data type enforced by the cast to a pointer (be
- it 32bit or 64bit or whatever), while a negative integer has not
- this flexibility.
- * src/cache/ftccmap.c (FTC_CMAP_UNKNOWN): Ditto.
- * src/truetype/ttgxvar.c (ALL_POINTS, TT_Get_MM_Var): Ditto.
- * src/type/t1load.c (T1_Get_MM_Var): Ditto.
- (parse_blend_axis_types): Use cast.
- * src/bdf/bdflib.c (_bdf_readstream): Use cast.
-
-2012-12-16 Infinality <infinality@infinality.net>
-
- [truetype] Remove unused code and variables. Add minor fixes.
-
- * src/truetype/ttsubpix.h: Updated.
- (SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Trebuchet MS.
- (ALLOW_X_DMOVEX_Rules): Remove Arial characters.
- (ALLOW_X_DMOVE_Rules): Remove Arial characters.
- (RASTERIZER_35_Rules): Verdana no longer needs to be here.
- (SKIP_IUP_Rules): Formatting fix.
- (DELTAP_SKIP_EXAGGERATED_VALUES_Rules): Remove Segoe UI.
- (COMPATIBLE_WIDTHS_Rules): Add Monaco and Trebuchet MS.
- (X_SCALING_Rules): Add misc. corrective fixes.
-
- * src/truetype/ttgload.c: (TT_Process_Simple_Glyph): Adjust correction
- factor for emboldening during scaling.
-
- * src/truetype/ttinterp.h: Updated.
- (TT_ExecContextRec): Remove unused variables.
-
- * src/truetype/ttobjs.h: Updated.
- (TT_SizeRec): Add ttfautohinted variable.
-
- * src/truetype/ttinterp.c: Updated.
- (Ins_FDEF): Rework code to fix bugs and add more detection.
- (Ins_CALL): Remove unused code.
- (Ins_LOOPCALL): Remove unused code.
- (TT_RunIns): Remove unused code.
- (Ins_SHPIX): Add logic to handle ttfautohinted fonts.
- (Ins_MIRP): Don't round x in cut-in calculation. Add logic to handle
- ttfautohinted fonts.
-
-2012-12-16 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #37936.
-
- * src/sfnt/ttload.c (tt_face_load_gasp): Avoid memory leak.
-
-2012-12-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fix 11-year old bug.
-
- Since the initial commit (ebe85f59) the value of FT_TRIG_SCALE has
- always been slightly less than the correct value, which has been
- given in the comment as a hexadecimal. As a result, vector lengths
- were underestimated and rotated vectors were shortened.
-
- * src/base/fttrigon.c (FT_TRIG_SCALE): Fix macro value.
-
-2012-12-15 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #37907.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Normalize
- negative second parameter of `ENCODING' field also.
-
-2012-12-15 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #37906.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Use correct array
- size for checking `glyph_enc'.
-
-2012-12-15 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #37905.
-
- * src/bdf/bdflib.c (_bdf_parse_start) <STARTPROPERTIES>: Reset
- `props_size' to zero in case of allocation error; this value gets
- used in a loop in `bdf_free_font'.
-
-2012-12-10 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Scale F_dot_P down.
-
- The dot product between freeVector and projVector or cosine of
- the angle between these FT_F2Dot14 unit vectors used to be scaled up
- by 4 and routinely occupied 32 bits in an FT_Long field F_dot_P.
- This patch scales the value down by 2^14 instead, which simplifies
- its use throughout the bytecode interpreter.
-
- This does not lead to the loss of precision because the lower bits
- are unreliable anyway. Consider two unit vectors (1,0) and (.6,.8)
- for which the true value of F_dot_P is .6 * 0x40000000 = 0x26666666.
- These vectors are stored as (0x4000,0) and (0x2666,0x3333) after
- rounding and F_dot_P is assigned 0x26660000. The lower bits were
- already lost while rounding the unit vector components.
-
- Besides code simplification, this change can lead to better
- performance when FT_MulDiv with the scaled-down F_dot_P is less
- likely to use the costly 64-bit path. We are not changing the type
- of F_dot_P to FT_F2Dot14 at this point.
-
- * src/truetype/ttinterp.c (Compute_Funcs): Scale F_dot_P down by 14
- bits and modify its use accordingly.
- (Direct_Move, Direct_Move_Orig, Compute_Point_Displacement): Modify
- the use of F_dot_P field.
- * src/truetype/ttobjs.c (tt_size_run_fpgm): Change arbitrary
- assignment of F_dot_P to its theoretical maximum in case we decide
- to scale back its type later.
-
-2012-12-09 Johnson Y. Yan <yinsen_yan@foxitsoftware.com>
-
- [type1] Another fix for 2012-09-17 commit.
-
- * src/type1/t1parse.c (T1_Get_Private_Dict) <found>: Correctly set
- `limit' value.
-
-2012-12-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Tweak the previous commit.
-
- * src/truetype/ttinterp.c (Current_Ratio): Put unit vector
- components as the second TT_MulFix14 arguments. This is required
- on 16-bit systems.
-
-2012-12-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Microoptimizations in bytecode interpreter.
-
- * src/truetype/ttinterp.c (TT_DivFix14): New macro.
- (Normalize): Use it here.
- (Current_Ratio): Use TT_MulFix14 instead of FT_MulDiv.
- (Ins_SHPIX): Cancel out two TT_MulFix14 calls.
-
-2012-12-05 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Cosmetic improvement in bytecode interpreter.
-
- * src/truetype/ttinterp.c: Use explicit calls to FT_MulDiv,
- FT_MulFix, and FT_DivFix instead of macros.
-
-2012-12-03 John Tytgat <John.Tytgat@esko.com>
-
- [pshinter] Clamp BlueScale value.
-
- This is Savannah bug #37856.
-
- * src/pshinter/pshglob.c (psh_calc_max_height): New function.
- (psh_globals_new): Use it to limit BlueScale value to
- `1 / max_of_blue_zone_heights'.
-
-2012-12-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype, type1] Revise the use of FT_MulDiv.
-
- * src/truetype/ttgxvar.c: Updated.
- * src/truetype/ttobjs.c: Updated.
- * src/type1/t1load.c: Updated.
-
-2012-11-30 Werner Lemberg <wl@gnu.org>
-
- [configure] Preserve customized `ftoption.h'.
-
- Problem reported by Del Merritt <del@alum.mit.edu>.
-
- * builds/unix/configure.raw <cpp computation of bit length>: Don't
- remove existing FreeType configuration files.
-
-2012-11-29 John Tytgat <John.Tytgat@esko.com>
-
- [type1] Fix Savannah bug #37831.
-
- The bug report also contains a patch.
-
- * src/type1/t1parse.c (T1_Get_Private_Dict) <found>: Really fix
- change from 2012-09-17.
-
-2012-11-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Fix formatting and typo.
-
-2012-11-27 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [cid, type1, type42] Clean up units_per_EM calculations.
-
- * src/cid/cidload.c (cid_parse_font_matrix): Updated.
- * src/type1/t1load.c (t1_parse_font_matrix): Updated.
- * src/type42/t42parse.c (t42_parse_font_matrix): Updated.
-
-2012-11-27 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [ftstroke] Minor improvement.
-
- * src/base/ftstroke.c: Replace nested FT_DivFix and FT_MulFix with
- FT_MulDiv.
-
-2012-11-17 Werner Lemberg <wl@gnu.org>
-
- * src/base/fttrigon.c (ft_trig_downscale): Make 64bit version work.
-
-2012-11-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fix integer overflows in dd5718c7d67a.
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use FT_MulDiv.
-
-2012-11-15 Werner Lemberg <wl@gnu.org>
-
- [autofit] Trace stem widths.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths): Add some
- FT_TRACE calls.
-
-2012-11-13 Werner Lemberg <wl@gnu.org>
-
- [cff] Add support for OpenType Collections (OTC).
-
- * src/cff/cffload.c (cff_font_load): Separate subfont and face
- index handling to load both pure CFFs with multiple subfonts and
- OTCs (with multiple faces where each face holds exactly one
- subfont).
- * src/cff/cffobjs.c (cff_face_init): Updated.
-
-2012-11-12 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor improvement.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Fix
- loop.
-
-2012-11-10 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve tracing.
-
- * src/autofit/aflatin.c (af_latin_hint_edges)
- [FT_DEBUG_LEVEL_TRACE]: Count number of actions and emit something
- if there weren't any.
-
-2012-11-04 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fortify emboldening code against egregious distortions.
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Threshold emboldening
- strength when it leads to segment collapse.
-
-2012-11-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Clean up emboldening code and improve comments there.
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Replace sequential
- calls to FT_MulFix and FT_DivFix with FT_MulDiv.
- Mention that bisectors are used to figure out the shift direction.
-
-2012-10-24 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add standard character to `AF_ScriptClassRec' structure.
-
- * src/autofit/aftypes.h (AF_ScriptClassRec): Add `standard_char'
- member.
- (AF_DEFINE_SCRIPT_CLASS): Updated.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths): Use it.
- (af_latin_metrics_init, af_latin_script_class): Updated.
-
- * src/autofit/aflatin.c (af_latin2_metrics_init_widths): Use it.
- (af_latin2_metrics_init, af_latin2_script_class): Updated.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Use it.
- (af_cjk_metrics_init, af_cjk_script_class): Updated.
-
- * src/autofit/afindic.c (af_indic_metrics_init,
- af_indic_script_class): Updated.
-
- * src/autofit/afcjk.h, src/autofit/aflatin.h: Updated.
-
- * src/autofit/afdummy.c: Updated.
-
-2012-10-24 Werner Lemberg <wl@gnu.org>
-
- [autofit] Only use Unicode CMap.
-
- * src/autofit/aflatin.c (af_latin_metrics_init): Implement it, to be
- in sync with `af_face_globals_compute_script_coverage'.
-
-2012-10-21 Werner Lemberg <wl@gnu.org>
-
- [psaux] Improve parsing of invalid numbers.
-
- * src/psaux/psconv.c (PS_Conv_Strtol): Always parse complete number,
- even in case of overflow.
- (PS_Conv_ToInt): Only increase cursor if parsing was successful.
- (PS_Conv_ToFixed): Ditto.
- Trace underflow and data error.
-
-2012-10-21 Werner Lemberg <wl@gnu.org>
-
- [smooth] Improve tracing.
-
- * src/smooth/ftgrays.c (gray_sweep): Trace last sweep line of
- current band also.
-
-2012-10-20 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Cheaper way to threshold angles between vectors.
-
- * src/truetype/ttinterp.c (Ins_ISECT): Thresholding tangent is a lot
- cheaper than thresholding sine.
-
-2012-10-20 Werner Lemberg <wl@gnu.org>
-
- [cff] Improve parsing of invalid real numbers.
-
- * src/cff/cffparse.c (cff_parse_real): Always parse complete number,
- even in case of overflow or underflow.
- Also trace one more underflow.
-
-2012-10-20 Andreas Pehnack <andreas.pehnack@me.com>
-
- [sfnt] Load pure CFF fonts wrapped in SFNT container.
-
- Such fonts only have a `cmap' and a `CFF' table.
-
- * src/sfnt/ttload.c (tt_face_load_font_dir): Don't call
- `check_table_dir' if font signature is `OTTO'.
-
-2012-10-20 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix some value overflows and improve tracing.
-
- * src/psaux/psconv.c: Include FT_INTERNAL_DEBUG_H.
- (FT_COMPONENT): Define.
- (PS_Conv_Strtol): Return FT_Long.
- Handle bad data and overflow.
- Emit some tracing messages in case of error.
- (PS_Conv_ToInt): Return FT_Long.
- (PS_Conv_ToFixed): Updated.
- * src/psaux/psconv.h: Updated.
-
- * include/freetype/internal/fttrace.h: Add `psconv'.
-
-2012-10-20 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix `make multi CC=c++'.
-
- * src/autofit/aflatin.c, src/autofit/aflatin2.c: Include
- `afglobal.h'.
- * src/autofit/afloader.c: Fix order of header files.
- * src/autofit/afmodule.c: Include `afglobal.h' and `aferrors.h'.
-
-2012-10-19 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix more value errors and improve tracing.
-
- * src/cff/cffparse.c (cff_parse_integer): Emit tracing message in
- case of error.
- (cff_parse_real): Handle and trace overflow, underflow, and bad data
- consistently.
- (do_fixed): New helper function, handling and tracing overflow.
- (cff_parse_fixed, cff_parse_fixed_scaled): Use `do_fixed'.
-
-2012-10-17 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix some value overflows.
-
- * src/psaux/psconv.c (PS_Conv_ToFixed): Implement it.
-
-2012-10-17 Bram Tassyns <BramT@enfocus.com>
-
- [cff] Fix value overflow.
-
- * src/cff/cffparse.c (cff_parse_fixed_scaled): Implement it.
-
-2012-10-17 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #37572.
-
- * src/truetype/ttinterp.c (Ins_ISECT): Use angle between vectors to
- avoid grazing intersections. The previous threshold was too coarse,
- incorrectly rejecting short but valid vectors.
-
-2012-09-30 Gilles Espinasse <g.esp@free.fr>
-
- Remove useless `rm' detection.
-
- `rm -f' is directly used in the `configure' script created by
- autoconf, thus no availability test is necessary.
-
- * builds/unix/configure.raw (RMF): Remove test.
- * builds/unix/unix-def.in (DELETE): Updated.
-
-2012-09-29 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor optimization.
-
- * src/autofit/afglobal.c (af_face_globals_compute_script_coverage):
- Add loop condition.
-
-2012-09-29 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix thinko.
-
- * src/autofit/aftypes.h (AF_SCRIPT):
- s/AF_SCRIPT_NONE/AF_SCRIPT_DUMMY/. We already use `AF_SCRIPT_NONE'
- as a bit mask.
-
- * src/autofit/afdummy.c: Updated.
-
-2012-09-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] Implement `increase-x-height' property.
-
- * include/freetype/ftautoh.h (FT_Prop_IncreaseXHeight): New
- structure.
-
- * include/autofit/afmodule.c (af_property_get_face_globals): New
- function, re-using code from `af_property_get'.
- (af_property_set, af_property_get): Handle `increase-x-height'.
- Updated.
-
-2012-09-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] Implement Infinality's `increase glyph heights'.
-
- This is an improved version of a similar fix contained in the
- so-called `Infinality patch', taken from
-
- http://www.infinality.net/fedora/linux/zips/freetype-infinality-2.4.10-20120616_01-x86_64.tar.bz2
-
- which addresses various enhancements of the auto-hinter. Without
- properties to control a module's metadata it wasn't possible to
- adapt the patches because everything was originally controlled by
- environment variables which I consider not suitable in general.
-
- A patch to control `increase_x_height' follows.
-
- * src/autofit/afglobal.h (AF_PROP_INCREASE_X_HEIGHT_MIN,
- AF_PROP_INCREASE_X_HEIGHT_MAX): New macros.
- (AF_FaceGlobalsRec): Add `increase_x_height' member.
- * src/autofit/afglobal.c (af_face_globals_new): Initialize it.
-
- * src/autofit/aflatin.c (af_latin_metrics_scale_dim),
- * src/autofit/aflatin2.c (af_latin2_metrics_scale_dim): Implement
- handling of `increase_x_height'.
-
-2012-09-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add hierarchical property access to some structures.
-
- * src/autofit/afglobal.h: Include `afmodule.h'.
- (AF_FaceGlobalsRec): Add `module' member.
- (AF_FaceGlobals): Typedef moved to...
- * src/autofit/aftypes.h: Here.
- (AF_ScriptMetricsRec): Add `globals' member.
-
- * src/autofit/afglobal.c (af_face_globals_new,
- af_face_globals_compute_script_coverage,
- af_face_globals_get_metrics): Updated.
-
- * src/autofit/afloader.c (af_loader_reset), src/autofit/afmodule.c
- (af_property_get): Updated.
-
-2012-09-17 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix Savannah bug #37350.
-
- * src/type1/t1parse.c (T1_Get_Private_Dict) <found>: Check for ASCII
- storage only if we actually have at least four bytes.
-
-2012-09-15 Werner Lemberg <wl@gnu.org>
-
- [autofit] Implement `fallback-script' property.
-
- * src/autofit/afglobal.c: s/default_script/fallback_script/.
- * src/autofit/afglobal.h: s/AF_SCRIPT_DEFAULT/AF_SCRIPT_FALLBACK/.
-
- * src/autofit/afmodule.c: s/default_script/fallback_script/.
- (af_property_set, af_property_get): Implement `fallback-script'.
- * src/autofit/afmodule.h: s/default_script/fallback_script/.
-
- * include/freetype/ftautoh.h: Document it.
-
-2012-09-15 Werner Lemberg <wl@gnu.org>
-
- [autofit] Correct previous Unicode 6.1.0 change.
-
- The auto-hinter's latin module only handles latin ligatures in the
- `Alphabetical Presentation Forms' block.
-
- * src/autofit/aflatin.c (af_latin_uniranges): Fix it.
-
-2012-09-15 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afmodule.c: s/FT_Err_/AF_Err_/.
-
-2012-09-15 Werner Lemberg <wl@gnu.org>
-
- [autofit] Make default script a global property.
-
- * src/autofit/afmodule.h (AF_ModuleRec): Add `default_script' field.
-
- * src/autofit/afglobal.c (af_face_globals_compute_script_coverage,
- af_face_globals_new), src/autofit/afloader.c (af_loader_reset),
- src/autofit/afmodule.c (af_property_get) <glyph-to-script-map>,
- af_autofitter_init:
- Handle default script.
-
- * src/autofit/afglobal.h: Updated.
-
-2012-09-15 Werner Lemberg <wl@gnu.org>
-
- Use `FT_Module' instead of `FT_Library' argument in property funcs.
-
- This internal change simplifies access to global module data.
-
- * include/freetype/internal/services/svprop.h
- (FT_Properties_SetFunc, FT_Properties_GetFunc): Change accordingly.
-
- * src/base/ftobjs.c (ft_property_do), src/autofit/afmodule.c
- (af_property_set, af_property_get): Updated.
-
-2012-09-14 Werner Lemberg <wl@gnu.org>
-
- [autofit] Update to Unicode 6.1.0.
-
- * src/autofit/afcjk.c (af_cjk_uniranges), src/autofit/aflatin.c
- (af_latin_uniranges): Add and fix ranges.
-
-2012-09-14 Werner Lemberg <wl@gnu.org>
-
- [autofit] Pass `AF_Module' instead of `AF_Loader'.
-
- We want to access the (not yet existing) module's global data later
- on.
-
- * src/autofit/afloader.c: Include `afmodule.h'.
- (af_loader_init, af_loader_reset, af_loader_done,
- af_loader_load_glyph): Change accordingly.
- * src/autofit/afmodule.c (AF_ModuleRec): Move to `afmodule.h'.
- Updated.
-
- * src/autofit/afmodule.h: Include `afloader.h'.
- (AF_ModuleRec): Define here.
- * src/autofit/afloader.h (AF_Module): Define here.
- Updated.
-
-2012-09-14 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix `make multi'.
-
- * include/freetype/internal/fttrace.h: Add `afmodule'.
- * src/autofit/afmodule.c: Include FT_INTERNAL_DEBUG_H.
- (FT_COMPONENT): Define.
-
-2012-09-14 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afmodule.c: s/FT_Autofitter/AF_Module/.
-
-2012-09-12 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor reorganization.
-
- * src/autofit/afglobal.c (AF_SCRIPT_LIST_DEFAULT,
- AF_SCRIPT_LIST_NONE, AF_DIGIT): Move to...
- * src/autofit/afglobal.h (AF_SCRIPT_DEFAULT, AF_SCRIPT_LIST_NONE,
- AF_DIGIT): This and update code.
-
-2012-09-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Implement `glyph-to-script-map' property.
-
- * include/freetype/ftautoh.h: New public header file.
- * include/freetype/config/ftheader.h (FT_AUTOHINTER_H): New macro.
-
- * src/autofit/afglobal.c (AF_FaceGlobalsRec): Move structure to...
- * src/autofit/afglobal.h: This header file.
- * src/autofit/afmodule.c: Include FT_AUTOHINTER_H.
- (af_property_get): Handle `glyph-to-script-map'.
-
-2012-08-31 Werner Lemberg <wl@gnu.org>
-
- [autofit] Implement properties service framework.
-
- No properties are added yet.
-
- * src/autofit/afmodule.c: Include FT_SERVICE_PROPERTIES_H.
- (af_property_set, af_property_get): New dummy functions.
- (af_service_properties, af_services, af_get_interface): Provide
- service setup.
- (autofit_moduleclass): Add service interface.
-
- * src/autofit/afpic.c: Add necessary forward declarations.
- (autofit_module_class_pic_init): Add code for service addition.
- (autofit_module_pic_free): Add code for service removal.
- * src/autofit/afpic.h (AF_SERVICES_GET, AF_SERVICE_PROPERTIES_GET):
- New macros which provide necessary syntactical sugar for PIC
- support.
-
-2012-08-30 Werner Lemberg <wl@gnu.org>
-
- Implement properties to control FreeType modules.
-
- * include/freetype/fterrdef.h (FT_Err_Missing_Property): New error
- code.
- * include/freetype/ftmodapi.h (FT_Property_Set, FT_Property_Get):
- New API.
-
- * include/freetype/internal/services/svprop.h: New file.
- * include/freetype/internal/ftserv.h (FT_SERVICE_PROPERTIES_H): New
- macro.
-
- * src/base/ftobjs.c: Include FT_SERVICE_PROPERTIES_H.
- (ft_property_do, FT_Property_Set, FT_Property_Get): New functions.
-
-2012-08-29 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Allow `-' in tags and identifiers.
-
- * src/tools/docmaker/content.py (re_identifier),
- src/tools/docmaker/sources.py (re_markup_tag1, re_markup_tag2,
- re_crossref): Add `-' in patterns.
-
-2012-08-27 Werner Lemberg <wl@gnu.org>
-
- [FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
-
- * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER),
- include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
- FT_DEFINE_MODULE), include/freetype/internal/ftserv.h
- (FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2,
- FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4,
- FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6),
- src/autofit/afpic.c (autofit_module_class_pic_init),
- src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c
- (ft_create_default_module_classes), src/cff/cffparse.c
- (FT_Create_Class_cff_field_handlers), src/cff/cffpic.c
- (cff_driver_class_pic_init), src/pshinter/pshpic.c
- (pshinter_module_class_pic_init), src/psnames/pspic.c
- (psnames_module_class_pic_init), src/raster/rastpic.c
- (ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c
- (sfnt_module_class_pic_init), src/sfnt/ttcmap.c
- (FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c
- (ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c
- (tt_driver_class_pic_init): Initialize allocation variable.
-
-2012-08-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix compilation warning.
-
- * src/truetype/ttgload.c (IS_HINTED): Move macro to...
- * src/truetype/ttobjs.h: This header file.
-
-2012-08-27 Werner Lemberg <wl@gnu.org>
-
- [autofit, cff, pshinter, psnames] More renamings for orthogonality.
-
- * src/autofit/afmodule.c, src/autofit/afpic.h:
- s/AF_AUTOFITTER_/AF_/.
-
- * src/cff/cffdrivr.c, src/cff/cffobjs.c, src/cff/cffparse.c,
- src/cff/cffpic.h: s/FT_CFF_/CFF_/.
-
- * src/pshinter/pshmod.c, src/pshinter/pshpic.h:
- s/FT_PSHINTER_/PSHINTER_/.
-
- * src/psnames/psmodule.c, src/psnames/pspic.h:
- s/FT_PSCMAPS/PSCMAPS_/.
-
-2012-08-27 Werner Lemberg <wl@gnu.org>
-
- [sfnt, truetype] More renamings for orthogonality.
-
- * src/sfnt/sfdriver.c, src/sfnt/sfntpic.h, src/sfnt/ttcmap.c,
- src/truetype/ttdriver.c, src/truetype/ttpic.h: s/FT_SFNT_/SFNT_/,
- s/FT_TT_/TT_/, s/GET_CMAP_INFO_GET/CMAP_INFO_GET/.
-
-2012-08-27 Werner Lemberg <wl@gnu.org>
-
- [autofit] Some macro and variable renamings for orthogonality.
-
- * include/freetype/internal/autohint.h, src/base/ftobjs.c,
- src/autofit/afmodule.c, src/autofit/afpic.c, src/autofit/afpic.h:
- s/SERVICE/INTERFACE/, s/service/interface/, s/Service/Interface/.
-
-2012-08-26 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #37178.
-
- * src/base/ftobjs.c (FT_Open_Face): Initialize `error' with
- `FT_Err_Missing_Module' before loop to indicate `no valid drivers'.
-
-2012-08-17 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftsynth.c (FT_GlyphSlot_Oblique): Fix shear angle.
-
- The old value was far too large (more than 20°). The new one
- corresponds to 12°, quite common in typography.
-
-2012-08-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Fix Savannah bug #37017.
-
- * src/smooth/ftgrays.c (gray_render_cubic): Use a different set of
- checks when detecting super curvy splines to be split.
-
-2012-08-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve recognition of flat segments.
-
- Problem reported by Brad Dunzer <BDunzer@extensis.com>.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): We have
- a flat segment if the horizontal distance of best on-points is
- larger than a given threshold.
-
-2012-08-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Variable renamings.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Replace
- `glyph' with `outline'.
- s/best_first/best_contour_first/.
- s/best_last/best_contour_last/.
-
-2012-07-31 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix Savannah bug #37000.
-
- * src/type1/t1load.c (parse_encoding): Fix order of checks.
-
-2012-07-17 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix Savannah bug #36833.
-
- * src/psaux/t1decode.c (t1operator_seac): `seac' is not a valid
- operator if we want metrics only.
-
-2012-07-16 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix Savannah bug #36832.
-
- * src/type1/t1load.c (parse_charstrings): Reject negative number of
- glyphs.
-
-2012-07-13 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix Savannah bug #36829.
-
- * src/type1/t1load.c (parse_encoding): Check cursor position after
- call to T1_Skip_PS_Token.
-
-2012-07-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Revert the last commit 45337b07.
-
- * src/base/ftstroke.c (FT_Stroker_New): Revert the previous change.
-
-2012-07-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [ftstroke] Fix uninitialized return value.
-
- * src/base/ftstroke.c (FT_Stroker_New): Return FT_Err_Ok instead.
-
-2012-07-11 Werner Lemberg <wl@gnu.org>
-
- [smooth] Avoid memory leak in case of failure.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use flags to
- indicate what to clean up after finishing the function, with and
- without errors.
-
-2012-07-09 Werner Lemberg <wl@gnu.org>
-
- Fix compilation with MSVC 5.0.
-
- Problem reported by Peter Breitenlohner and Akira Kakuto.
-
- * include/freetype/config/ftstdlib.h (ft_setjmp): Updated.
- * src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove cast.
-
-2012-07-09 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve debugging messages; do some code cleanup.
-
- * src/autofit/aflatin.c (af_latin_align_linked_edge,
- af_latin_hint_edges): Synchronize with formatting used in the
- ttfautohint project.
-
-2012-07-07 Gilles Espinasse <g.esp@free.fr>
-
- Fix strict-aliasing warning.
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Avoid double cast.
-
-2012-07-07 Dave Thomas <dave.thomas@metaforic.com>
-
- [ARM] Fix FT_MulFix_arm.
-
- * include/freetype/config/ftconfig.h (FT_MulFix_arm) [__arm__]:
- Avoid ADDS instruction to clobber condition codes.
-
-2012-07-06 Werner Lemberg <wl@gnu.org>
-
- [autofit] Do some code cleanup.
-
- * src/autofit/afglobal.c (af_face_globals_new): Simplify.
-
- * src/autofit/afhints.c: Use `FT_TRACE7' instead of `printf'
- everywhere.
- (FT_COMPONENT): New macro.
- (af_glyph_hints_done): Simplify.
-
- * include/freetype/internal/fttrace.h: Updated.
-
-2012-07-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve output of debugging information.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_segments): Print more
- data; report no data.
- (af_glyph_hints_dump_edges): Report no data.
-
-2012-07-04 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix Savannah bug #36091.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues),
- src/autofit/aflatin2.c (af_latin2_metrics_init_blues): Change the
- constraint for testing round vs. flat segment: Accept either a
- small distance or a small angle.
-
-2012-07-04 Werner Lemberg <wl@gnu.org>
-
- [autofit] Beautify blue zone tracing.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues),
- src/autofit/aflatin2.c (af_latin2_metrics_init_blues): Implement it.
-
-2012-07-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Quantize stem widths.
-
- * src/autofit/afangles.c (af_sort_widths): Rename to...
- (af_sort_and_quantize_widths): This.
- Add code to avoid stem widths which are almost identical.
- * src/autofit/aftypes.h, src/autofit/aflatin.c, src/autofit/afcjk.c:
- Updated.
-
-2012-07-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor speed-up.
-
- * src/autofit/afangles (af_sort_pos, af_sort_widths): Don't swap
- elements if they are equal.
-
-2012-06-30 Gilles Espinasse <g.esp@free.fr>
-
- Fix `checking if gcc static flag -static works' test.
-
- On my linux build tree, I receive yes answer in every package I
- build except FreeType for this test checking if gcc static flag
- `-static' works
-
- In FreeType, no is received, unless bzip2 and zlib are disabled using
-
- ./configure --without-bzip2 --without-zlib
-
- The reason is that bzip2 and zlib tests add `-lz' and `-lbz2' to
- LDFLAGS and this broke static flag test.
-
- * builds/unix/configure.raw: Update CFLAGS and LDFLAGS only after
- LT_INIT has run.
-
-2012-06-28 Infinality <infinality@infinality.net>
-
- [truetype] Fix various artifacts.
-
- Verdana was broken in the original Infinality commit. Also
- includes other minor fixes.
-
- * src/truetype/ttsubpix.h: Updated. Removed unused macros.
- (RASTERIZER_35_Rules): Add Verdana.
- (SKIP_NONPIXEL_Y_MOVES_Rules): Add Tahoma `s'.
- (MIRP_CVT_ZERO_Rules): Remove Verdana.
- (ALWAYS_SKIP_DELTAP_Rules): Add Russian char 0x438.
- (COMPATIBLE_WIDTHS_Rules): Rearrange some rules.
- (X_SCALING_Rules): Adjust Verdana `a' at 12 and 13 ppem.
-
- * src/truetype/ttsubpix.c: Updated.
- (sph_set_tweaks): Re-execute fpgm always.
-
-2012-06-28 Gilles Espinasse <g.esp@free.fr>
-
- Fix CFLAGS and LDFLAGS share configure test.
-
- * builds/unix/configure.raw: Fix typo.
-
-2012-06-28 Werner Lemberg <wl@gnu.org>
-
- [truetype] Set the `subpixel_positioned' flag unconditionally.
-
- This is how the code currently behaves.
-
- * src/truetype/ttgload.c (tt_loader_init): Do it.
-
-2012-06-27 Werner Lemberg <wl@gnu.org>
-
- Fix conditional compilation.
-
- * src/base/basepic.c: Use FT_CONFIG_OPTION_MAC_FONTS.
-
-2012-06-27 Werner Lemberg <wl@gnu.org>
-
- Fix conditional compilation.
-
- * include/freetype/internal/ftcalc.h (FT_MulDiv_No_Round): Don't
- enclose with `TT_USE_BYTECODE_INTERPRETER'; we now need the function
- elsewhere also.
-
- * src/autofit/afcjk.h: Use AF_CONFIG_OPTION_CJK.
-
- * src/truetype/ttgload.c (tt_loader_init): Fix compiler warning.
-
- * src/truetype/ttinterp.c (Ins_MSIRP): Fix compiler warning.
-
- * src/truetype/ttinterp.h: Use
- TT_CONFIG_OPTION_BYTECODE_INTERPRETER.
-
-2012-06-26 Infinality <infinality@infinality.net>
-
- [truetype] Remove unused rounding functionality.
-
- The subpixel hinting patch contained the concept of an adjustable
- number of gridlines per pixel. This is no longer used due to x
- being completely ignored instead. This will return some of the
- code to its existing state prior to the original Infinality
- commit.
-
- * include/freetype/internal/ftobjs.h (FT_PIX_FLOOR_GRID,
- FT_PIX_ROUND_GRID, FT_PIX_CEIL_GRID): Removed.
-
- * src/truetype/ttinterp.c: Updated.
- (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid,
- Round_Up_To_Grid, Round_To_Double_Grid, Round_Super, Round_Super_45,
- SetSuperRound): Remove parameter to handle the number of grid lines per
- pixel.
- (SET_SuperRound, ROUND_None, CUR_Func_round): Updated.
- (DO_SROUND, DOS45ROUND, DO_ODD, DO_EVEN): Updated.
- (DO_ROUND, DO_NROUND): Updated.
- (Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP,
- Ins_MDRP, Ins_MIRP): Perform Round_None instead of calling a modified
- rounding function. Remove gridlines_per_pixel. Create a local
- variable to store control value cutin. Simplify the conditional for
- ignore_x_mode. Adjust rounding calls to pass only two values.
-
-2012-06-25 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #36705.
-
- Handle numbers like 2.001 correctly.
-
- * src/cff/cffparse.c (cff_parse_real): Avoid negative values for
- `shift'.
-
-2012-06-18 Infinality <infinality@infinality.net>
-
- [truetype] Support subpixel hinting.
-
- This is the large, famous `Infinality' patch to support ClearType
- bytecode which has been available from
- http://www.infinality.net/blog/ for some time, and which has been
- refined over the last years. While still experimental, it is now
- mature enough to be included directly into FreeType.
-
- Most of the code is based on the ClearType whitepaper written by
- Greg Hitchcock
-
- https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
-
- which gives a detailed overview of the necessary changes to the
- Microsoft rasterizer so that older fonts are supported. However, a
- lot of details are still missing, and this patches provides a
- framework to easily handle rendering issues down to the glyph level
- of certain fonts.
-
- Note that ClearType support is not completely implemented! In
- particular, full support for the options `compatible_widths',
- `symmetrical_smoothing, and `bgr' (via the GETINFO bytecode
- instruction) is missing.
-
- * src/truetype/ttsubpix.c: New file, providing code to handle
- `tweaks', this is, rules for certain glyphs in certain fonts
- (including wildcards) which need a special treatment.
-
- * src/truetype/ttsubpix.h: New file, holding the tweaking rules.
-
- * include/freetype/config/ftoption.h, src/devel/ftoption.h
- (TT_CONFIG_OPTION_SUBPIXEL_HINTING): New macro.
-
- * include/freetype/internal/ftobjs.h (FT_PIX_FLOOR_GRID,
- FT_PIX_ROUND_GRID, FT_PIX_CEIL_GRID): New macros.
-
- * src/truetype/truetype.c [TT_USE_BYTECODE_INTERPRETER]: Include
- `ttsubpix.c'.
-
- * src/truetype/ttgload.c: Include `ttsubpix.h'.
- [All changes below are guarded by TT_CONFIG_OPTION_SUBPIXEL_HINTING.]
-
- (tt_get_metrics): Set tweak flags.
- (TT_Hint_Glyph): Call `FT_Outline_EmboldenXY' if necessary.
- (TT_Process_Simple_Glyph): Compensate emboldening if necessary.
- (compute_glyph_metrics): Handle `compatible widths' option.
- (tt_loader_init): Handle ClearType GETINFO information bits.
-
- * src/truetype/rules.mk (TT_DRV_SRC): Updated.
-
- * src/truetype/ttinterp.c: Include `ttsubpix.h'.
- [Where necessary, changes below are guarded by
- TT_CONFIG_OPTION_SUBPIXEL_HINTING.]
-
- (Direct_Move, Direct_Move_X): Extended.
- (Round_None, Round_To_Grid, Round_To_Half_Grid, Round_Down_To_Grid,
- Round_Up_To_Grid, Round_To_Double_Grid, Round_Super, Round_Super_45,
- SetSuperRound): Add parameter to handle the number of grid lines per
- pixel.
- (SET_SuperRound, ROUND_None, CUR_Func_round): Updated.
- (DO_SROUND, DOS45ROUND, DO_ODD, DO_EVEN): Updated.
- (DO_ROUND, DO_NROUND): Updated.
- (DO_RS): Take care of `Typeman' bytecode patterns.
- (Ins_FDEF): Add some debugging code. Commented out.
- (Ins_ENDF): Restore state.
- (Ins_CALL, Ins_LOOPCALL): Handle inline delta functions.
- (Ins_MD): Handle `Vacuform' rounds.
- (Move_Zp2_Point, Ins_SHPIX, Ins_MSIRP, Ins_MDAP, Ins_MIAP,
- Ins_MDRP, Ins_MIRP): Handle tweaks.
- (Ins_ALIGNRP): Add tweak guard.
- (Ins_IUP, Ins_DELTAP): Handle tweaks.
- (Ins_GETINFO): Handle new ClearType bits.
- (TT_RunIns): Handle tweaks.
-
- * src/truetype/ttinterp.h: Updated.
- (SPH_TweakRule, SPH_ScaleRule): New structures for tweaks.
- (TT_ExecContextRec): Add members for subpixel hinting support.
-
- * src/truetype/ttobjs.h (TT_DefRecord): Add `inline_delta' member.
-
-2012-06-15 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.10 released.
- =========================
-
-
- Tag sources with `VER-2-4-10'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.10.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.9/2.4.10/, s/249/2410/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 10.
-
- * builds/unix/configure.raw (version_info): Set to 15:0:9.
-
-2012-06-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Improve spacing.
-
- * docs/CHANGES: Updated.
-
-2012-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/exports.mk: Add CCexe_CFLAGS and CCexe_LDFLAGS.
-
- to pass special compiler/linker flags under cross development.
- Suggested by Savannah bug #36367.
-
- ChangeLog on 2010-07-15 saying as they were removed was wrong
- for the official trunk of FreeType2. This commit is the first
- introduction of them.
-
-2012-06-14 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2012-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Add new versions of NEC FA family to tricky font list.
-
- NEC FA family dated in 1996 have different checksum.
- Reported by Johnson Y. Yan <yinsen_yan@foxitsoftware.com>; see
-
- https://lists.gnu.org/archive/html/freetype-devel/2012-06/msg00023.html
-
- * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): 4 sets
- of fpgm & prep table checksums for FA-Gothic, FA-Minchou,
- FA-RoundedGothicM, FA-RoundedGothicB are added. The family
- names in sample PDF are truncated, thus the list of the
- family names in tt_check_trickyness_family() is not updated yet.
-
-2012-06-06 Werner Lemberg <wl@gnu.org>
-
- [ftraster] Fix rounding issue causing visual artifacts.
-
- Problem reported by jola <hans-jochen.lau@lhsystems.com>; see
-
- https://lists.gnu.org/archive/html/freetype-devel/2012-05/msg00036.html
-
- * src/raster/ftraster.c (SMulDiv_No_Round): New macro.
- (Line_Up): Use it.
- * src/raster/ftmisc.h (FT_MulDiv_No_Round): Copied from `ftcalc.c'.
-
-2012-05-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Simplify.
-
- We now use the cross product of the direction vectors to compute the
- outline's orientation.
-
-2012-05-28 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2012-05-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- New function FT_Outline_EmboldenXY.
-
- * include/freetype/ftoutln.h (FT_Outline_EmboldenXY): Define it.
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Implement it, using a
- simplified emboldening algorithm.
- (FT_Outline_Embolden): Make it a special case of
- `FT_Outline_EmboldenXY'
-
-2012-05-07 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix Savannah bug #36386.
-
- * src/type1/t1load.c (t1_load_keyword): Ignore keyword if context is
- not valid.
-
-2012-04-07 Werner Lemberg <wl@gnu.org>
-
- Remove compiler warning.
-
- * src/truetype/ttgload.c (TT_Load_Glyph)
- [!TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Access `glyph->face' directly.
-
-2012-03-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Properly copy scaler flags to script metrics object.
-
- Without this patch, only the dummy and cjk autohinter modules get
- them (since they copy the whole scaler object).
-
- * src/autofit/aflatin.c (af_latin_metrics_scale),
- src/autofit/aflatin2.c (af_latin2_metrics_scale): Implement it.
-
-2012-03-22 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [bdflib] Remove redundant macro.
-
- * src/bdf/bdflib.c (isdigok): Remove and replace with sbitset, which
- is exactly the same.
-
-2012-03-20 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [configure] Fix Savannah bug #35644.
-
- * builds/unix/configure.raw: Check `-ansi' flag works even if gcc
- is used. Bionic libc headers for Android lose the consistency
- when they are parsed with __STDC_VERSION__ older than 199901L or
- __STRICT_ANSI__.
-
-2012-03-20 Werner Lemberg <wl@gnu.org>
-
- [bdf] Improvement to Savannah bug #35656.
-
- * src/bdf/bdflib.c (isdigok): Add cast, as suggested in report.
-
-2012-03-17 Chris Liddell <chris.liddell@artifex.com>
-
- [type1] Fix Savannah bug #35847.
-
- * src/type1/t1load.c (parse_subrs): Fix the loop exit condition;
- we want to exit when we have run out of data.
-
-2012-03-16 Werner Lemberg <wl@gnu.org>
-
- [bdf] Really fix Savannah bug #35658.
-
- * src/bdf/bdflib.c (_bdf_list_split): Add one more `field' initializer.
-
-2012-03-14 Yann Droneaud <yann@droneaud.fr>
-
- [sfnt] Make arrays static like all others.
-
- * src/sfnt/ttload.c (tt_face_load_maxp, tt_face_load_os2),
- src/sfnt/ttmtx.c (tt_face_load_hhea): Add `static' keyword to frame
- fields.
-
-2012-03-14 Huw Davies <huw@codeweavers.com>
-
- [sfnt] A refinement of the previous commit.
-
- * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16,
- tt_name_entry_ascii_from_other): Stop at null byte.
-
-2012-03-14 Huw Davies <huw@codeweavers.com>
-
- [sfnt] Add `name' table compatibility to MS Windows.
-
- * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16,
- tt_name_entry_ascii_from_other): Don't replace `\0' with question
- marks when converting strings.
-
-2012-03-14 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix Savannah bug #35833.
-
- Based on the patch given in the bug report.
-
- * src/type1/t1load.c (IS_INCREMENTAL): New macro.
- (read_binary_data): Add parameter `incremental'.
- Update all callers using `IS_INCREMENTAL'.
-
-2012-03-11 Werner Lemberg <wl@gnu.org>
-
- [autofit] Return correct linear advance width values.
-
- This was quite a subtle bug which accidentally showed up with glyph
- `afii10023' of arial.ttf (version 2.76). This glyph is a composite;
- the first component, `E', has an advance width of 1366 font units,
- while the advance width of the composite itself (which looks like
- uppercase `E' with dieresis) is 1367 font units. I think this is
- actually a bug in the font itself, because there is no reason that
- this glyph has not the same width as uppercase `E' without the
- dieresis. Anyway, it helped identify this problem.
-
- Using the TrueType hinter, the correct value (1367) of `afii10023'
- was returned, but the autohinter mysteriously returned 1366.
-
- Digging in the code showed that the autohinter recursively calls
- FT_Load_Glyph to load the glyph, adding the FT_LOAD_NO_SCALE load
- flag. However, the `linearHoriAdvance' field is still returned as a
- scaled value. To avoid scaling twice, the old code in autofit reset
- `linearHoriAdvance', using the `horiAdvance' field. This seemed to
- work since FT_LOAD_NO_SCALE was in use, but it failed actually,
- because `horiAdvance' is defined as the distance of the first
- subglyph's phantom points, which in turn are initialized using the
- advance width of the first subglyph. And as the given example
- shows, these widths can differ.
-
- * src/autofit/afloader.c (af_loader_load_g): Temporarily set
- FT_LOAD_LINEAR_DESIGN while calling FT_Load_Glyph to get unscaled
- values for the linear advance widths.
-
-2012-03-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix SSW instruction.
-
- * src/truetype/ttinterp.c (DO_SSW): SSW *does* use font units. For
- verification, it took some time to find a font which actually uses
- this instruction.
-
-2012-03-09 Vinnie Falco <vinnie.falco@gmail.com>
-
- Prepare source code for amalgamation.
-
- * include/freetype/freetype.h: Swap order of preprocessor blocks.
-
-2012-03-08 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.9 released.
- =========================
-
-
- Tag sources with `VER-2-4-9'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.9.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.8/2.4.9/, s/248/249/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 9.
-
- * builds/unix/configure.raw (version_info): Set to 14:1:8.
-
-2012-03-08 Werner Lemberg <wl@gnu.org>
-
- [bdf] Add missing overflow check.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs) <BITMAP>: Add threshold for
- `glyph->bpr'.
-
-2012-03-07 Vinnie Falco <vinnie.falco@gmail.com>
-
- Prepare source code for amalgamation.
-
- * src/autofit/aferrors.h, src/bdf/bdferror.h, src/bzip2/ftbzip2.c,
- src/cache/ftcerror.h, src/cff/cfferrs.h, src/cid/ciderrs.h,
- src/gxvalid/gxverror.h, src/gzip/ftgzip.c, src/lzw/ftlzw.c,
- src/otvalid/otverror.h, src/pcf/pcferror.h, src/pfr/pfrerror.h,
- src/psaux/psauxerr.h, src/pshinter/pshnterr.h,
- src/psnames/psnamerr.h, src/raster/rasterrs.h, src/sfnt/sferrors.h,
- src/smooth/ftsmerrs.h, src/truetype/tterrors.h,
- src/type1/t1errors.h, src/type42/t42error.h, src/winfonts/fnterrs.h:
- Add #undef FT_ERR_PREFIX before #define FT_ERR_PREFIX.
-
-2012-03-03 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #35660.
-
- For some divisions, we use casts to 32bit entities. Always guard
- against division by zero with these casts also.
-
- * src/base/ftcalc.c (ft_div64by32): Remove redundant cast.
- (FT_MulDiv, FT_MulDiv_No_Round): Add 32bit cast.
- (FT_DivFix): Add 32bit cast (this omission triggered the bug).
-
-2012-03-03 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix handling of track kerning.
-
- * src/psaux/afmparse.c (afm_parse_track_kern): Don't inverse sign
- for `min_kern'. It is indeed quite common that track kerning
- *increases* spacing for very small sizes.
-
-2012-03-02 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #35689.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check first outline
- point.
-
-2012-03-01 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #35656.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs) <_BDF_BITMAP>: Check validity
- of nibble characters instead of accessing `a2i' array.
-
-2012-03-01 Werner Lemberg <wl@gnu.org>
-
- [winfonts] Fix Savannah bug #35659.
-
- * src/winfonts/winfnt.c (FNT_Face_Init): Check number of glyphs.
-
-2012-03-01 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #35658.
-
- * src/bdf/bdflib.c (_bdf_list_split): Initialize `field' elements
- properly.
-
-2012-03-01 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix Savannah bug #35657.
-
- If in function `skip_spaces' the routine `skip_comment' comes to the
- end of buffer, `cur' is still increased by one, so we need to check
- for `p >= limit' and not `p == limit'.
-
- * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed,
- PS_Conv_ASCIIHexDecode, PS_Conv_EexecDecode): Fix boundary checking.
-
-2012-03-01 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #35646.
-
- * src/truetype/ttinterp.c (Ins_MIRP): Typo, present since ages. The
- code is now in sync with the other operators (e.g. MSIRP) which
- modify twilight points.
-
-2012-03-01 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #35643.
-
- * src/bdf/bdflib.c (_bdf_list_ensure): Bring code in sync with
- comment before `_bdf_list_split', this is, really allocate at least
- five `field' elements.
-
-2012-03-01 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #35641.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs) <DWIDTH, BBX>: Abort if
- _BDF_ENCODING isn't set. We need this because access to the `glyph'
- variable might be undefined otherwise.
-
-2012-03-01 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #35640.
-
- * src/truetype/ttinterp.c (SkipCode, TT_RunIns): Fix boundary check
- for NPUSHB and NPUSHW instructions.
-
-2012-02-29 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #35601.
-
- * src/truetype/ttinterp.c (Ins_SHZ): Use number of points instead of
- last point for loop.
- Also remove redundant boundary check.
-
-2012-02-29 Werner Lemberg <wl@gnu.org>
-
- [truetype] Remove redundant check.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Remove redundant
- second check for ordered contour start points.
-
-2012-02-29 Werner Lemberg <wl@gnu.org>
-
- [truetype] Make SHC instruction behave similar to MS rasterizer.
-
- * src/truetype/ttinterp.c (Ins_SHC): Handle virtual contour in
- twilight zone.
-
-2012-02-29 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Avoid modulo operators against a power-of-two denominator.
-
- * src/afcjk.c (af_hint_normal_stem), src/base/ftoutln.c
- (ft_contour_has), src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_vvcurveto, cff_op_hhcurveto, cff_op_hvcurveto>,
- src/gxvalid/gxvcommn.c (GXV_32BIT_ALIGNMENT_VALIDATE),
- src/gxvalid/gxvfeat.c (gxv_feat_setting_validate): Replace `%' with
- `&' operator.
-
-2012-02-29 Werner Lemberg <wl@gnu.org>
-
- [autofit] Don't synchronize digit widths for light rendering mode.
-
- We don't hint horizontally in this mode.
-
- * src/autofit/afloader.c (af_loader_load_g) <Hint_Metrics>:
- Implement it.
-
-2012-02-26 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [type42] Minor code optimization (again).
-
- * src/type42/t42parse.c (t42_parse_sfnts): Simplify previous change.
-
-2012-02-26 Mateusz Jurczyk <mjurczyk@google.com>
- Werner Lemberg <wl@gnu.org>
-
- [smooth] Fix Savannah bug #35604.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `FT_Pos'
- instead of `FT_UInt' for some variables and update comparisons
- accordingly. A detailed analysis can be found in the bug report.
-
-2012-02-26 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [type42] Minor code optimization.
-
- * src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of
- modulo operator.
-
-2012-02-26 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2012-02-26 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix Savannah bug #35608.
-
- * src/type1/t1parse.c (T1_Get_Private_Dict): Reject too short
- dictionaries.
-
-2012-02-26 Werner Lemberg <wl@gnu.org>
-
- [bdf] Support `ENCODING -1 <n>' format.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Implement it.
-
-2012-02-26 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #35607.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs) <ENCODING>: Normalize
- negative encoding values.
-
-2012-02-26 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix Savannah bug #35606.
-
- * src/type1/t1load.c (parse_subrs): Add proper guards for `strncmp'.
-
- * src/psaux/psobjs.c (ps_parser_skip_PS_token): Emit error message
- only if cur < limit.
-
-2012-02-25 Werner Lemberg <wl@gnu.org>
-
- [pcf] Fix Savannah bug #35603.
-
- * src/pcf/pcfread.c (pcf_get_properties): Assure final zero byte in
- `strings' array.
-
-2012-02-25 Werner Lemberg <wl@gnu.org>
-
- [type42] Fix Savannah bug #35602.
-
- * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size' more
- thoroughly.
-
-2012-02-25 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bugs #35599 and #35600.
-
- * src/bdf/bdflib.c (ACMSG16): New warning message.
- (_bdf_parse_glyphs) <_BDF_BITMAP>: Check line length.
-
-2012-02-24 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bugs #35597 and #35598.
-
- * src/bdf/bdflib.c (_bdf_is_atom): Fix handling of property value.
-
-2012-02-24 Vinnie Falco <vinnie.falco@gmail.com>
-
- Prepare source code for amalgamation (6/6).
-
- * src/cff/cffdrivr.c: s/Load_Glyph/cff_glyph_load/.
-
- * src/cid/cidload.c: s/parse_font_matrix/cid_parse_font_matrix/.
- s/t1_init_loader/cid_init_loader/.
- s/t1_done_loader/cid_done_loader/.
-
- * src/psaux/t1cmap.c: s/t1_get_glyph_name/psaux_get_glyph_name/.
-
- * src/truetype/ttdriver.c: s/Load_Glyph/tt_glyph_load/.
-
- * src/type1/t1load.c: s/parse_font_matrix/t1_parse_font_matrix/.
-
-2012-02-24 Vinnie Falco <vinnie.falco@gmail.com>
-
- Prepare source code for amalgamation (5/6).
-
- * include/freetype/fterrors.h: Undefine FT_KEEP_ERR_PREFIX after
- using it.
-
-2012-02-22 Vinnie Falco <vinnie.falco@gmail.com>
-
- Prepare source code for amalgamation (4/6).
-
- * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine RAS_ARG,
- RAS_ARGS, RAS_VAR, and RAS_VARS before defining it.
-
- * src/smooth/ftgrays.c: s/TRaster/black_TRaster/,
- s/PRaster/black_PRaster/.
- * src/raster/ftraster.c: s/TRaster/gray_TRaster/,
- s/PRaster/gray_PRaster/.
-
-2012-02-20 Vinnie Falco <vinnie.falco@gmail.com>
-
- Prepare source code for amalgamation (3/6).
-
- * src/smooth/ftgrays.c: s/TWorker/black_TWorker/,
- s/PWorker/black_PWorker/.
- * src/raster/ftraster.c: s/TWorker/gray_TWorker/,
- s/PWorker/gray_PWorker/.
-
-2012-02-20 Vinnie Falco <vinnie.falco@gmail.com>
-
- Prepare source code for amalgamation (2/6).
-
- * src/smooth/ftgrays.c, src/raster/ftraster.c: Undefine FLOOR,
- CEILING, TRUNC, and SCALED before defining it.
-
-2012-02-20 Vinnie Falco <vinnie.falco@gmail.com>
-
- Prepare source code for amalgamation (1/6).
-
- See discussion starting at
-
- https://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00037.html
-
- * src/smooth/ftgrays.c: s/TBand/gray_TBand/.
- * src/raster/ftraster.c: s/TBand/black_TBand/.
-
-2012-02-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [autofit] Fix outline flags.
-
- * src/autofit/afloader.c (af_loader_load_g): Don't reassign
- `outline.flags' so that this information is preserved. See
- discussion starting at
-
- https://lists.gnu.org/archive/html/freetype-devel/2012-02/msg00046.html
-
-2012-02-11 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #35466.
-
- Jump instructions are now bound to the current function. The MS
- Windows rasterizer behaves the same, as confirmed by Greg Hitchcock.
-
- * src/truetype/ttinterp.h (TT_CallRec): Add `Cur_End' element.
- * src/truetype/ttobjs.h (TT_DefRecord): Add `end' element.
-
- * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF): Check upper
- bound of jump address.
- (Ins_FDEF, Ins_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns): Updated.
-
-2012-02-11 Werner Lemberg <wl@gnu.org>
-
- We don't use `extensions'.
-
- * include/freetype/internal/ftobjs.h (FT_DriverRec): Remove
- `extensions' field.
-
-2012-02-11 Werner Lemberg <wl@gnu.org>
-
- Clean up `generic' fields.
-
- * include/freetype/internal/ftobjs.h (FT_ModuleRec, FT_LibraryRec):
- Remove `generic' field since users can't access it.
-
- * src/base/ftobjs.c (FT_Done_GlyphSlot): Call `generic.finalizer' as
- advertised in the documentation of FT_Generic.
- (Destroy_Module, FT_Done_Library): Updated to changes in `ftobjs.h'.
-
-2012-02-07 Werner Lemberg <wl@gnu.org>
-
- [autofit] Harmonize function arguments.
-
- * src/autofit/afloader.c, src/autofit/afloader.h: Use `FT_Int32' for
- `load_flags'.
-
-2012-02-07 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): Remove unnecessary casts.
-
-2012-01-17 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Fix Savannah bug #35286.
-
- Patch submitted by anonymous reporter.
-
- * src/gxvalid/gxvcommn.c (gxv_XStateTable_subtable_setup):
- gxv_set_length_by_ulong_offset() must be called with 3, not 4,
- the number of the subtables in the state tables; classTable,
- stateArray, entryTable.
-
-2012-01-17 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [raccess] Modify for PIC build.
-
- Based on the patch provided by Erik Dahlstrom <ed@opera.com>,
- https://lists.gnu.org/archive/html/freetype-devel/2012-01/msg00010.html
-
- Also `raccess_guess_table[]' and `raccess_rule_by_darwin_vfs()'
- are renamed with `ft_' suffixes.
-
- * src/base/ftbase.h: `raccess_rule_by_darwin_vfs()' is renamed
- to `ft_raccess_rule_by_darwin_vfs()'.
- * src/base/ftobjs.c: Ditto.
-
- * src/base/ftrfork.c: Declarations of FT_RFork_Rule,
- raccess_guess_rec, are moved to...
- * include/freetype/internal/ftrfork.h: Here.
-
- * include/freetype/internal/ftrfork.h:
- FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END} macros are defined
- to replace raccess_guess_table[] in both of PIC and non-PIC
- modes.
- * src/base/ftrfork.c: raccess_guess_table[] array is rewritten
- by FT_RFORK_RULE_ARRAY_{BEGIN,ENTRY,END}.
-
- * src/base/basepic.h (BasePIC): Add `ft_raccess_guess_table'
- storage. (FT_RACCESS_GUESS_TABLE_GET): New macro to retrieve
- the function pointer from `ft_raccess_guess_table' storage in
- `BasePIC' structure.
- * src/base/ftrfork.c (FT_Raccess_Guess): Rewritten with
- FT_RACCESS_GUESS_TABLE_GET.
- (raccess_get_rule_type_from_rule_index): Add `library' as the
- first argument to the function, to retrieve the storage of
- `ft_raccess_guess_table' from it. Also `raccess_guess_table'
- is replaced by FT_RACCESS_GUESS_TABLE_GET.
- (ft_raccess_rule_by_darwin_vfs): Ditto.
-
-2012-01-16 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Remove trailing spaces.
-
-2012-01-16 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Formatting PIC related sources.
-
- * src/autofit/afpic.c: Harmonize to FT2 coding conventions.
- * src/base/basepic.c: Ditto.
- * src/base/ftpic.c: Ditto.
- * src/cff/cffpic.c: Ditto.
- * src/pshinter/pshpic.c: Ditto.
- * src/psnames/pspic.c: Ditto.
- * src/raster/rastpic.c: Ditto.
- * src/sfnt/sfntpic.c: Ditto.
- * src/smooth/ftspic.c: Ditto.
- * src/truetype/ttpic.c: Ditto.
-
-2012-01-16 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [autofit] Fix the inclusion of `aflatin2.h' in PIC file.
-
- * src/autofit/afpic.c: Include `aflatin2.h' when
- FT_OPTION_AUTOFIT2 is defined, as afglobal.c does so.
- Unconditionally inclusion causes declared but unimplemented
- warning by GCC 4.6.
-
-2012-01-16 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cff] Remove redundant declarations of cff_cmap_XXX_class_rec.
-
- * src/cff/cffpic.c: The declarations of
- FT_Init_Class_cff_cmap_encoding_class_rec() and
- FT_Init_Class_cff_cmap_unicode_class_rec() are removed.
- They can be obtained by the inclusion of cffcmap.h.
- cffcmap.h invokes FT_DECLARE_CMAP_CLASS() and it declares
- FT_Init_Class_cff_cmap_encoding_class_rec() etc in PIC mode.
-
-2012-01-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix redundant declaration warning in PIC mode.
-
- Originally FT_DEFINE_{DRIVER,MODULE,RENDERER}() macros were
- designed to declare xxx_pic_{free,init} by themselves.
- Because these macros are used at the end of the module
- interface (e.g. ttdriver.c) and the wrapper source to build
- a module as a single object (e.g. truetype.c) includes
- the PIC file (e.g. ttpic.c) before the module interface,
- these macros are expanded AFTER xxx_pic_{free,init} body
- when the modules are built as single object.
- The declaration after the implementation causes the redundant
- declaration warnings, so the declarations are moved to module
- PIC headers (e.g. ttpic.h). Separating to other header files
- are needed for multi build.
-
- * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER):
- Remove class_##_pic_free and class_##_pic_init declarations.
- * include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
- FT_DEFINE_MODULE): Ditto.
-
- * src/base/basepic.h: Insert a comment and fix coding style.
- * src/autofit/afpic.h: Declare autofit_module_class_pic_{free,
- init}.
- * src/cff/cffpic.h: Declare cff_driver_class_pic_{free,init}.
- * src/pshinter/pshpic.h: Declare pshinter_module_class_pic_{free,
- init}.
- * src/psnames/pspic.h: Declare psnames_module_class_pic_{free,
- init}.
- * src/raster/rastpic.h: Declare
- ft_raster{1,5}_renderer_class_pic_{free,init}
- * src/sfnt/sfntpic.h: Declare sfnt_module_class_pic_{free,init}.
- * src/smooth/ftspic.h: Declare
- ft_smooth_{,lcd_,lcdv_}renderer_class_pic_{free,init}.
- * src/truetype/ttpic.h: Declare tt_driver_class_pic_{free,init}.
-
-2012-01-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Make pspic.c to include module error header to fix multi build.
-
- * src/psnames/pspic.c: Include `psnamerr.h'.
-
-2012-01-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [base] Fix a dereference of uninitialized variable in PIC mode.
-
- * src/base/ftglyph.c (FT_Glyph_To_Bitmap): `glyph' must be
- set before dereferring to obtain `library'. The initialization
- of `clazz', `glyph', `library' and NULL pointer check are
- reordered to minimize PIC conditionals.
-
-2012-01-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [base] Insert explicit cast for GCC 4.6 in PIC mode.
-
- * src/base/ftinit.c (FT_Add_Default_Modules): Under PIC
- configuration, FT_DEFAULT_MODULES_GET returns
- FT_Module_Class** pointer, GCC 4.6 warns that
- const FT_Module_Class* const* variable is warned as
- inappropriate to store it. To calm it, explicit cast is
- inserted. Also `library' is checked to prevent the NULL
- pointer dereference in FT_DEFAULT_MODULES_GET.
-
-2012-01-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix PIC build broken by d9145241fe378104ba4c12a42534549faacc92e6.
-
- Under PIC configuration, FT_{CFF,PSCMAPS,SFNT,TT}_SERVICES_GET
- take no arguments but derefer the variable named `library'
- internally.
-
- * src/cff/cffdrivr.c (cff_get_interface): Declare `library' and
- set it if non-NULL driver is passed.
- * src/truetype/ttdriver.c (tt_get_interface): Ditto.
-
- * src/sfnt/sfdriver.c (sfnt_get_interface): Declare `library'
- under PIC configuration, and set it if non-NULL module is given.
- * src/psnames/psmodule.c (psnames_get_interface): Ditto.
-
-2012-01-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Make PIC files include module error headers, to use the error codes
- with per-module prefix.
-
- * src/autofit/afpic.c: Include `aferrors.h'.
- * src/cff/cffpic.c: Include `cfferrs.h'.
- * src/pshinter/pshpic.c: Include `pshnterr.h'.
- * src/raster/rastpic.c: Include `rasterrs.h'.
- * src/sfnt/sfntpic.c: Include `sferrors.h'.
- * src/smooth/ftspic.c: Include `ftsmerrs.h'.
- * src/truetype/ttpic.c: Include `tterrors.h'.
-
-2012-01-04 Tobias Ringström <tobias@ringis.se>
-
- [truetype] Fix IP instruction if x_ppem != y_ppem.
-
- * src/truetype/ttinterp.c (Ins_IP): Scale `orus' coordinates
- properly.
-
-2012-01-02 Werner Lemberg <wl@gnu.org>
-
- Fix tracing message for `loca' table.
-
- * src/truetype/ttpload.c (tt_face_get_location): Don't emit a
- warning message if the last `loca' entry references an empty glyph.
-
-2011-12-10 Werner Lemberg <wl@gnu.org>
-
- Add some variable initializations.
- Reported by Richard COOK <rscook@unicode.org>.
-
- * src/type1/t1driver.c (t1_ps_get_font_value): Initialize `val'.
- * src/smooth/ftgrays.c (gray_render_conic): Initialize `levels'
- earlier.
-
-2011-12-08 Werner Lemberg <wl@gnu.org>
-
- Fix serious scaling bug in `FT_Get_Advances'.
-
- * src/base/ftadvanc.c (FT_Get_Advances): Advance values returned by
- `FT_Load_Glyph' must be simply multiplied by 1024.
-
-2011-12-08 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdflib.c (_bdf_parse_start): Drop redundant error tracing.
-
-2011-12-02 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [mac] Unify DARWIN_NO_CARBON with FT_MACINTOSH.
-
- Originally FT_MACINTOSH was a pure auto macro and DARWIN_NO_CARBON
- was a configurable macro to disable Carbon-dependent code. Because
- now configure script sets DARWIN_NO_CARBON by default and disables
- Darwin & Carbon-dependent codes, these macros can be unified.
- FT_MACINTOSH (undefined by default) is kept and DARWIN_NO_CARBON
- (defined by default) is removed, because DARWIN_NO_CARBON violates
- FT_XXX naming convention of public macros, and a macro configured by
- default is not portable for the building without configure (e.g.
- make devel).
-
- * builds/unix/configure.raw: Define FT_MACINTOSH if Carbon-based
- old Mac font support is requested and Carbon is available.
- * builds/unix/ftconfig.in: Undefine FT_MACINTOSH when the support
- for Mac OS X without Carbon (e.g. Mac OS X 10.4 for ppc64) is
- requested.
- * include/freetype/config/ftconfig.in: Ditto.
- * builds/vms/ftconfig.h: Ditto.
-
- * src/base/ftbase.h: Remove DARWIN_NO_CARBON.
- * src/base/ftbase.c: Ditto.
- * src/base/ftobjs.c: Ditto.
- * src/base/ftrfork.c: Ditto.
-
- * src/base/ftmac.c: Compile the body if FT_MACINTOSH is defined
- (same with TT_USE_BYTECODE_INTERPRETER in ttinterp.c).
- * builds/mac/ftmac.c: Ditto.
-
- * builds/mac/FreeType.m68k_cfm.make.txt: Define FT_MACINTOSH.
- * builds/mac/FreeType.m68k_far.make.txt: Ditto.
- * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
- * builds/mac/FreeType.ppc_carbon.make.txt: Ditto.
-
-2011-11-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix Savannah bug #34728 (`make devel' on Mac OS X).
-
- * builds/toplevel.mk: Check `/dev/null' to identify the Unix-
- like systems without `init' nor `hurd' (e.g. Mac OS X >= 10.4).
- * builds/unix/detect.mk: Ditto.
-
-2011-11-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [apinames] Fix the overflow of signed integer hash.
-
- * src/tools/apinames.c (names_add): Change the type of `h' from
- int to unsigned int, to prevent undefined behaviour in the
- overflow of signed integers (overflow of unsigned int is defined
- to be wrap around). Found by clang test suggested by Sean
- McBride.
-
-2011-11-30 Werner Lemberg <wl@gnu.org>
-
- [winfonts] Remove casts.
-
- * src/winfonts/winfnt.c (winfnt_driver_class): Remove all casts and
- update affected functions.
- (FNT_Size_Select): Fix number of arguments.
-
-2011-11-30 Werner Lemberg <wl@gnu.org>
-
- [type42] Remove casts.
-
- * src/type42/t42drivr.c (t42_driver_class): Remove all casts and
- update affected functions.
-
- * src/type42/t42objs.c, src/type42/t42objs.h: Updated for t42 driver
- changes.
-
-2011-11-30 Werner Lemberg <wl@gnu.org>
-
- [type1] Remove casts.
-
- * src/type1/t1driver.c (t1_driver_class): Remove all casts and
- update affected functions.
-
- * src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1objs.c:
- Updated for t1driver changes.
- src/type1/t1objs.h (T1_Driver): Remove unused typedef.
- Updated for t1driver changes.
-
-2011-11-27 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #34896.
-
- ENCODING now covers the whole Unicode range.
-
- Note, however, that this change is quite expensive since it
- increases the size of three arrays by almost 400kByte in total. The
- right fix is to replace the logic with something smarter.
- Additionally, there exist very old BDFs for three-byte CCCII
- encoding which exceeds the range of Unicode (another reason to have
- a smarter logic).
-
- * src/bdf/bdf.h (bdf_font_t): Increase size of `nmod' and `umod'
- arrays.
- * src/bdf/bdflib.c (bdf_parse_t): Increase size of `have' array.
-
-2011-11-27 Werner Lemberg <wl@gnu.org>
-
- [bdf] Improve tracing.
-
- * src/bdf/bdflib.c (DBGMSG1, DBGMSG2): New macros.
- (_bdf_parse_glyphs): Use them.
-
-2011-11-26 Werner Lemberg <wl@gnu.org>
-
- Improve tracing.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Done), src/pcf/pcfdrivr.c
- (PCF_Face_Done): Remove tracing message.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init), src/cff/cffobjs.c
- (cff_face_init), src/cid/cidobjs.c (cid_face_init),
- src/pfr/pfrobjs.c (pfr_face_init), src/sfnt/sfobjs.c
- (sfnt_init_face), src/truetype/ttobjs.c (tt_face_init),
- src/type1/t1objs.c (T1_Face_Init), src/type42/t42objs.c
- (T42_Face_Init), src/winfonts/winfnt.c (FNT_Face_Init): Add
- `greeting' message.
-
- * src/sfnt/sfobjs.c (sfnt_open_font), src/type42/t42objs.c
- (T42_Open_Face): Improve tracing.
-
-2011-11-26 Werner Lemberg <wl@gnu.org>
-
- [cid] Fix error code.
-
- * src/cid/cidparse.c (cid_parser_new): Do it.
-
-2011-11-26 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix error code.
-
- * src/cff/cffload.c (cff_font_load): Do it.
-
-2011-11-26 Werner Lemberg <wl@gnu.org>
-
- Add new error code FT_Err_Missing_Module.
-
- Previously, FreeType misleadingly returned
- FT_Err_Unknown_File_Format if a module was missing (or a test was
- missing completely).
-
- * include/freetype/fterrdef.h (FT_Err_Missing_Module): Define.
-
- * src/cff/cffobjs.c (cff_face_init), src/cff/cffdrivr.c
- (cff_get_glyph_name), src/cid/cidobjs.c (cid_face_init),
- src/sfnt/sfobjs.c (sfnt_init_face), src/truetype/ttobjs.c
- (tt_face_init), src/type1/t1objs.c (T1_Face_Init),
- src/type42/t42objs.c (T42_Face_Init, T42_Driver_Init): Updated.
-
- * src/type1/t1afm.c (T1_Read_Metrics), src/type/t1objs.c
- (T1_Face_Init), src/type42/t42objs.c (T42_Face_Init): Remove now
- redundant test for `psaux'.
-
-2011-11-25 Werner Lemberg <wl@gnu.org>
-
- [bdf] Add more error messages.
-
- * src/bdf/bdflib.c (_bdf_set_default_spacing, _bdf_add_property):
- Add line number argument.
- Update all callers.
- (ERRMSG5, ERRMSG6, ERRMSG7, ERRMSG8, ERRMSG9): New macros.
- (_bdf_readstream, _bdf_set_default_spacing, _bdf_add_property,
- _bdf_parse_glyphs, _bdf_parse_start): Add error messages.
-
-2011-11-24 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/fterrors.h: Remove dead code.
-
-2011-11-15 Werner Lemberg <wl@gnu.org>
-
- * docs/releases: Updated.
-
-2011-11-15 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.8 released.
- =========================
-
-
- Tag sources with `VER-2-4-8'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.8.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.7/2.4.8/, s/247/248/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 8.
-
- * builds/unix/configure.raw (version_info): Set to 14:0:8.
-
-2011-11-13 Chris Liddell <chris.liddell@artifex.com>
-
- Add FT_Get_PS_Font_Value() API.
-
- This allows a Type 1 font face to be interrogated to retrieve most
- of the dictionary keys (keys not relevant to FreeType's Type 1
- interpreter are not available).
-
- * include/freetype/internal/services/svpsinfo.h
- (PS_GetFontValueFunc): New typedef.
- (PSInfo): Add `ps_get_font_value'.
- (FT_DEFINE_SERVICE_PSINFOREC): Updated.
-
- * include/freetype/internal/t1types.h (T1_EncodingType): Moved to...
- * include/freetype/t1tables.h: Here.
- (PS_Dict_Keys): New enumeration.
- (FT_Get_PS_Font_Value): New declaration.
-
- * src/base/fttype1.c (FT_Get_PS_Font_Value): New function.
-
- * src/type1/t1driver.c (t1_ps_get_font_value): This new function
- does the real job.
- (t1_service_ps_info): Add it.
-
- * src/cff/cffdrivr.c (cff_service_ps_info), src/cid/cidriver.c
- (cid_service_ps_info), src/type42/t42drivr.c (t42_service_ps_info):
- Updated.
-
-2011-11-08 Braden Thomas <bthomas@apple.com>
-
- [cid] Various loading fixes.
-
- * src/cid/cidload.c (cid_load_keyword) <default>,
- (parse_font_matrix, parse_expansion_factor): Correctly check number
- of dictionaries.
- (cid_read_subrs): Protect against invalid values of `num_subrs'.
- Assure that the elements of the `offsets' array are ascending.
-
-2011-11-05 Werner Lemberg <wl@gnu.org>
-
- * README: We use copyright ranges also.
-
- According to
-
- https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html
-
- this should be mentioned explicitly.
-
-2011-10-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [raccess] Supplement for previous fix.
-
- * src/base/ftbase.h (raccess_rule_by_darwin_vfs): Do not declare
- it on native Mac OS X.
- * src/base/ftrfork.c (raccess_get_rule_type_from_rule_index):
- Hide raccess_get_rule_type_from_rule_index() on native Mac OS X
- too.
-
-2011-10-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [raccess] Hide raccess_rule_by_darwin_vfs() on native Mac OS X.
-
- * src/base/ftrfork.c (raccess_rule_by_darwin_vfs): Do not
- compile on native Mac OS X because it is not used.
-
-2011-10-25 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix MD instruction for twilight zone.
-
- * src/truetype/ttinterp.c (Ins_MD): Without this fix, the MD
- instruction applied to original coordinates of twilight points
- always returns zero.
-
-2011-10-18 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.7 released.
- =========================
-
-
- Tag sources with `VER-2-4-7'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.7.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.6/2.4.7/, s/246/247/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 7.
-
- * builds/unix/configure.raw (version_info): Set to 13:2:7.
-
-2011-10-15 Kal Conley <kcconley@gmail.com>
-
- Fix handling of transformations if no renderer is present.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Thinko.
-
-2011-10-15 Kal Conley <kcconley@gmail.com>
-
- Fix conditions for autohinting.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Handle
- FT_LOAD_IGNORE_TRANSFORM.
-
-2011-10-07 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Fix a bug to detect too large offset in morx table.
-
- * src/gxvalid/gxvmorx2.c
- (gxv_morx_subtable_type2_ligActionIndex_validate): Fix a bug
- that too large positive offset cannot be detected.
-
-2011-10-01 Braden Thomas <bthomas@apple.com>
-
- Handle some border cases.
-
- * include/freetype/config/ftstdlib.h (FT_USHORT_MAX): New macro.
-
- * src/base/ftbitmap.c (FT_Bitmap_Convert): Protect against invalid
- value of `target->rows'.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Add check for
- flex start.
-
- * src/raster/ftrend1.c (ft_raster1_render): Check `width' and
- `height'.
-
- * src/truetype/ttgxvar.c (TT_Vary_Get_Glyph_Deltas): Protect against
- invalid values in `localpoints' array.
-
-2011-10-01 Werner Lemberg <wl@gnu.org>
-
- [psnames] Handle zapfdingbats.
- Problem reported by Nicolas Rougier <Nicolas.Rougier@inria.fr>.
-
- * src/tools/glnames.py (adobe_glyph_list): Add data from AGL's
- `zapfdingbats.txt' file.
-
- * src/psnames/pstables.h: Regenerated.
-
-2011-09-27 Simon Bünzli <zeniko@gmail.com>
-
- [type1] Fix Savannah bug #34189.
-
- * src/type1/t1load.c (T1_Open_Face): Initialize
- `face->len_buildchar'.
-
-2011-09-26 Werner Lemberg <wl@gnu.org>
-
- [cff] Dump SIDs while tracing.
-
- * src/cff/cffobjs.c (cff_face_init): Do it.
-
- * src/cff/cffparse.c (cff_parser_run) [FT_DEBUG_LEVEL_TRACE]
- <cff_kind_string>: Identify as SID.
-
-2011-09-17 Werner Lemberg <wl@gnu.org>
-
- Remove unused FT_ALIGNMENT macro.
-
- * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h: Do it.
-
-2011-09-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Slightly optimize conic and cubic flatteners.
-
- * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move
- out some code from the main loop to speed it up.
-
-2011-09-11 Tomas Hoger <thoger@redhat.com>
-
- Slightly improve LZW_CLEAR handling.
-
- * src/lzw/ftzopen.c (ft_lzwstate_io) <FT_LZW_PHASE_CODE>:
- Ensure that subsequent (modulo garbage byte(s)) LZW_CLEAR codes are
- handled as clear codes. This also re-sets old_code and old_char to
- predictable values, which is a little better than using `random'
- ones if the code following LZW_CLEAR is invalid.
-
-2011-09-11 Tomas Hoger <thoger@redhat.com>
-
- Add explicit LZW decompression stack size limit.
-
- Stack larger than 1<<LZW_MAX_BITS is never needed if prefix table is
- constructed correctly. It's even less than that, see e.g.
- libarchive code comment for a better size upper bound:
-
- http://code.google.com/p/libarchive/source/browse/trunk/libarchive/archive_read_support_filter_compress.c?r=3635#121
-
- This patch adds explicit stack size limit, enforced when stack is
- realloced.
-
- An alternative is to ensure that code < state->prefix[code - 256]
- when traversing prefix table. Such check is less efficient and
- should not be required if prefix table is constructed correctly in
- the first place.
-
- * src/lzw/ftzopen.c (ft_lzwstate_stack_grow): Implement it.
-
-2011-09-11 Tomas Hoger <thoger@redhat.com>
-
- Protect against loops in the prefix table.
-
- LZW decompressor did not sufficiently check codes read from the
- input LZW stream. A specially-crafted or corrupted input could
- create a loop in the prefix table, which leads to memory usage
- spikes, as there's no decompression stack size limit.
-
- * src/lzw/ftzopen.c (ft_lzwstate_io) <FT_LZW_PHASE_START>: First
- code in valid LZW stream must be 0..255.
- <FT_LZW_PHASE_CODE>: In the special KwKwK case, code == free_ent,
- code > free_ent is invalid.
-
-2011-09-09 Werner Lemberg <wl@gnu.org>
-
- Better tracing of metrics.
-
- * src/base/ftobjs.c (FT_Request_Size, FT_Select_Size): Decorate with
- FT_TRACE.
-
-2011-09-07 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #33816.
-
- * src/cff/cfftypes.h (CFF_FontRecDictRec): New member
- `has_font_matrix'.
- * src/cff/cffparse.c (cff_parse_font_matrix): Set it.
- Update tracing output.
- * src/cff/cffobjs.c (cff_face_init): Use it so that the heuristics
- can be removed.
-
-2011-08-30 Werner Lemberg <wl@gnu.org>
-
- Better tracing of metrics.
-
- * src/base/ftobjs.c (FT_Select_Metrics, FT_Request_Metrics):
- Decorate with FT_TRACE.
-
-2011-08-25 Werner Lemberg <wl@gnu.org>
-
- [cff] Better tracing of the parsing process.
-
- * src/cff/cffload.c (cff_subfont_load, cff_font_load): Decorate with
- FT_TRACE.
-
- * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox,
- cff_parse_private_dict, cff_parse_cid_ros): Updated.
- (CFF_FIELD_NUM, CFF_FIELD_FIXED, CFF_FIELD_FIXED_1000,
- CFF_FIELD_STRING, CFF_FIELD_BOOL, CFF_FIELD_CALLBACK, CFF_FIELD,
- CFF_FIELD_DELTA): Add argument for ID.
- (cff_parser_run): Decorate with FT_TRACE.
-
- * src/cff/cffparse.h (CFF_Field_Handler) [FT_DEBUG_LEVEL_TRACE]: Add
- `id' member.
-
- * src/cff/cfftoken.h: Add IDs to all fields.
-
-2011-08-16 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #34022.
-
- * README, docs/INSTALL: Remove references to UPGRADE.UNIX.
-
-2011-08-15 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #34018.
-
- * docs/UPGRADE.UNIX: Removed. Obsolete.
-
-2011-08-15 David Bevan <david.bevan@pb.com>
-
- Fix Savannah bug #33992.
-
- * src/base/ftstroke.c (FT_Stroker_ParseOutline): Fix border case.
-
-2011-08-12 Werner Lemberg <wl@gnu.org
-
- [truetype] Fix degenerate case in S{P,F,DP}VTL opcodes.
-
- * src/truetype/ttinterp.c (Ins_SxVTL): Handle p1 == p2 specially.
- (Ins_SDPVTL): Handle v1 == v2 specially.
-
-2011-08-09 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #33975.
-
- * src/cff/cffparse.c (cff_parse_font_matrix): Fix typo.
-
-2011-07-29 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.6 released.
- =========================
-
-
- Tag sources with `VER-2-4-6'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.6.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.5/2.4.6/, s/245/246/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 6.
-
- * builds/unix/configure.raw (version_info): Set to 13:1:7.
-
-2011-07-29 Werner Lemberg <wl@gnu.org>
-
- [cff] Add some more tracing infos.
-
- * src/cff/cffparse.c (cff_parse_font_matrix, cff_parse_font_bbox,
- cff_parse_cid_ros): Add tracing.
-
-2011-07-22 Dirk Müller <dmueller@suse.de>
-
- [psaux, type1] Fix null pointer dereferences.
-
- Found with font fuzzying.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Check
- `decoder->buildchar'.
-
- * src/type1/t1load.c (t1_load_keyword): Check `blend->num_designs'.
-
-2011-07-20 Chris Morgan <cmorgan@cybexintl.com>
-
- Add FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT.
-
- Useful for embedded systems which don't need file stream support.
-
- * src/base/ftsystem.c, src/base/ftobjs.c (FT_Stream_New): Implement
- it.
-
-2011-07-20 Elton Chung <elton328@gmail.com>
-
- * src/base/ftpatent.c (FT_Face_SetUnpatentedHinting): Fix typo.
-
-2011-07-16 Steven Chu <steven.f.chu@gmail.com>
-
- [truetype] Fix metrics on size request for scalable fonts.
-
- * src/truetype/ttdriver.c (tt_size_request): Fix copying metrics
- from TT_Size to FT_Size if scalable font.
-
- See
-
- https://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00049.html
-
- for some comparison images.
-
-2011-07-14 Matthias Drochner <M.Drochner@fz-juelich.de>.
-
- [psaux] Fix potential sign extension problems.
-
- When shifting right a signed value, it is not defined by the
- C standard whether one gets a sign extension or not. Use a macro to
- do an explicit cast from a signed short (assuming that this is
- 16bit) to an int.
-
- * src/psaux/t1decode.c (Fix2Int): New macro.
- Use it where appropriate.
-
-2011-07-14 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- <op_callothersubr>: Better handling of subroutine index 0.
- From Matthias Drochner <M.Drochner@fz-juelich.de>.
-
-2011-07-10 Алексей Подтележников <apodtele@gmail.com>
-
- [psaux] Optimize previous commit.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- <op_callothersubr>: Move error check down to avoid testing twice for
- good cases.
-
-2011-07-08 Werner Lemberg <wl@gnu.org>
-
- [psaux] Add better argument check for `callothersubr'.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- <op_callothersubr>: Reject negative arguments.
-
-2011-07-07 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Try harder to find non-zero values for ascender and descender.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Consult `OS/2' table in case
- the `hhea' table's values are zero.
-
-2011-07-03 Werner Lemberg <wl@gnu.org>
-
- Fix previous commit.
-
- We want to unset FT_FACE_FLAG_SCALABLE only if there are bitmap
- strikes in the font.
-
- * src/truetype/ttobjs.c (tt_face_init): Implement it.
-
- * docs/CHANGES: Updated.
-
-2011-07-02 Just Fill Bugs <mozbugbox@yahoo.com.au>
-
- [truetype] Fix Savannah bug #33246.
-
- * src/truetype/ttobjs.c (tt_check_single_notdef): New function.
- (tt_face_init): Use it to test FT_FACE_FLAG_SCALABLE.
-
-2011-07-02 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2011-07-02 David Bevan <david.bevan@pb.com>
-
- [ftstroke] Major revision.
-
- The main problems
- -----------------
-
- o If FT_STROKER_LINEJOIN_BEVEL was specified, unlimited miter
- joins (not bevel joins) were generated. Indeed, the meanings of
- `miter' and `bevel' were incorrectly reversed (consistently) in
- both the code and comments.
-
- o The way bevel joins were constructed (whether specified
- explicitly, or created as a result of exceeding the miter limit)
- did not match what is required for stroked text in PostScript or
- PDF.
-
- The main fixes
- --------------
-
- o The behaviour of FT_STROKER_LINEJOIN_BEVEL has been corrected.
-
- o A new line join style, FT_STROKER_LINEJOIN_MITER_FIXED, has been
- introduced to support PostScript and PDF miter joins.
-
- o FT_STROKER_LINEJOIN_MITER_VARIABLE has been introduced as an
- alias for FT_STROKER_LINEJOIN_MITER.
-
- Additionally, a variety of stroking errors have been fixed. These
- would cause various artifacts (including points `at infinity'),
- especially when stroking poor quality fonts.
-
- See
-
- https://lists.gnu.org/archive/html/freetype-devel/2011-07/msg00001.html
-
- for example documents. The FreeType stroker now produces results
- very similar to that produced by GhostScript and Distiller for these
- fonts.
-
- Other problems
- --------------
-
- The following problems have been resolved:
-
- o Inside corners could be generated incorrectly. Intersecting the
- inside corner could cause a missing triangular area and other
- effects.
-
- The intersection point can only be used if the join is between
- two lines and both lines are long enough. The `optimization'
- condition in `ft_stroker_inside' has been corrected; this
- requires the line length to be passed into various functions and
- stored in `FT_StrokerRec'.
-
- o Incorrect cubic curves could be generated. The angle
- calculations in `FT_Stroker_CubicTo' have been corrected to
- handle the case of the curve crossing the +/-PI direction.
-
- o If the border radius was greater than the radius of curvature of
- a curve, then the negative sector would end up outside (not
- inside) the border. This situation is now recognized and the
- negative sector is circumnavigated in the opposite direction.
- (If round line joins are being used, this code is disabled
- because the line join will always cover the negative sector.)
-
- o When a curve is split, the arcs may not join smoothly (especially
- if the curve turns sharply back on itself). Changes in
- direction between adjacent arcs were not handled. A round
- corner is now added if the deviation from one arc to the next is
- greater than a suitable threshold.
-
- o The current direction wasn't retained if a the outline contained
- a zero length lineto or a curve that was determined to be
- `basically a point'. This could cause a spurious join to be
- added.
-
- o Cubics with close control points could be mishandled. All eight
- cases are now distinguished correctly.
-
- Other improvements
- ------------------
-
- o Borders for cubic curves could be too `flat'.
- FT_SMALL_CUBIC_THRESHOLD has been reduced a little to prevent
- this.
-
- o The handling and use of movable points has been simplified a
- little.
-
- o Various values are now computed only if the results are actually
- needed.
-
- o The directions of the outer and inner borders have been swapped,
- as recommended by Graham Asher.
-
- * src/base/ftstroke.c: Revised.
- * include/freetype/ftstroke.h: Updated.
-
-2011-06-30 İsmail Dönmez <ismail@namtrac.org>
-
- * builds/toplevel.mk: We use git, not CVS, thus skip `.gitignore'.
-
-2011-06-29 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #33663.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs): Handle negative values for
- ENCODING correctly.
-
- * docs/CHANGES: Document it.
-
-2011-06-24 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.5 released.
- =========================
-
-
- Tag sources with `VER-2-4-5'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.5
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.4/2.4.5/, s/244/245/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
-
- * builds/unix/configure.raw (version_info): Set to 13:0:7.
-
-2011-06-20 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Fix change
- from 2011-05-04.
-
-2011-06-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] make the `prop' validation tracing verbose.
-
- * src/gxvalid/gxvprop.c: Add tracing messages for errors.
-
-2011-06-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [autogen.sh] Reflect environment variable LIBTOOLIZE.
-
-2011-06-18 Werner Lemberg <wl@gnu.org>
-
- Update license documentation.
-
- * docs/GPL.TXT: Renamed to...
- * docs/GPLv2.TXT: This.
-
- * docs/LICENSE.TXT: Updated.
-
-2011-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix g++4.6 compiler warnings in module drivers.
-
- The background is same with previous commit.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints):
- Init `points'. (TT_Vary_Get_Glyph_Deltas): Init
- `delta_xy'. (TT_Get_MM_Var): Init `mmvar'.
- * src/type1/t1load.c (T1_Get_MM_Var): Ditto.
- * src/cff/cffdrivr.c (cff_ps_get_font_info): Init
- `font_info'.
- * src/cff/cffload.c (cff_index_get_pointers): Init `t'.
- (cff_font_load): Init `sub'.
- * src/cff/cffobjs.c (cff_size_init): Init `internal'.
- (cff_face_init): Init `cff'.
- * src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps):
- Init `snaps'.
- * src/pcf/pcfread.c (pcf_get_properties): Init `properties'.
- (pcf_get_bitmaps): Init `offsets'. (pcf_get_encodings):
- Init `tmpEncoding'.
- * src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'.
- * src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'.
- * src/cache/ftcmru.c (FTC_MruList_New): Init `node'.
- * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and
- `zip_buff'.
- * src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'.
- * src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'.
-
-2011-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [base] Fix g++4.6 compiler warnings in src/base/*.c.
-
- Passing uninitialized pointer to FT_NEW() families is
- not problematic theoretically (as far as the returned
- pointer is checked before writing), but g++4.6 dislikes
- it and warns by -Wuninitialized. Initialize them by NULL.
-
- * src/base/ftobjs.c (FT_Stream_New): Init `stream'.
- (new_memory_stream): Ditto.
- (FT_New_GlyphSlot): Init `slot'.
- (FT_CMap_New): Init `cmap'.
- (open_face_PS_from_sfnt_stream): Init `sfnt_ps'.
- (Mac_Read_POST_Resource): Init `pfb_data'.
- (Mac_Read_sfnt_Resource): Init `sfnt_data'.
- * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets):
- Init `offsets_internal' and `ref'.
- (raccess_guess_darwin_hfsplus): Init `newpath'.
- (raccess_guess_darwin_newvfs): Ditto.
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer):
- Init `buffer'.
- * src/base/ftstroke.c (FT_Stroker_New): Init `stroker'.
-
-2011-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Cleanup.
-
- Some invalid, overrunning, unrecommended non-zero values
- are cared in paranoid validation mode only. There are
- many lines looking like:
-
- if ( valid->root->level >= FT_VALIDATE_PARANOID )
- FT_INVALID_xxx;
-
- To simplify them, GXV_SET_ERR_IF_PARANOID( err ) is
- introduced for more paranoid validation in future.
-
- * src/gxvalid/gxvcommn.h (IS_PARANOID_VALIDATION):
- New macro to assure valid->root->level is more or
- equal to FT_VALIDATE_PARANOID. (GXV_SET_ERR_IF_PARANOID):
- New macro to raise an error if in paranoid validation.
- * src/gxvalid/gxvcommn.c: Use GXV_SET_ERR_IF_PARANOID().
- * src/gxvalid/gxvfeat.c: Ditto.
- * src/gxvalid/gxvjust.c: Ditto.
- * src/gxvalid/gxvkern.c: Ditto.
- * src/gxvalid/gxvmort.c: Ditto.
- * src/gxvalid/gxvmort0.c: Ditto.
- * src/gxvalid/gxvmort1.c: Ditto.
- * src/gxvalid/gxvmort2.c: Ditto.
- * src/gxvalid/gxvmorx1.c: Ditto.
- * src/gxvalid/gxvmorx2.c: Ditto.
-
-2011-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Fix gcc4.6 compiler warnings in gxvtrak.c.
-
- * src/gxvalid/gxvtrak.c (gxv_trak_trackTable_validate):
- Check different entries pointing same tracking value.
- (gxv_trak_validate): Remove unused variable `table_size'.
-
-2011-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Fix gcc4.6 compiler warnings in gxvmorx*.c.
-
- * src/gxvalid/gxvmorx.c (gxv_morx_subtables_validate):
- Conditionalize unvalidated variable `subFeatureFlags'.
- (gxv_morx_chain_validate): Conditionalize unvalidated
- variable `defaultFlags'.
-
- * src/gxvalid/gxvmorx0.c
- (gxv_morx_subtable_type0_entry_validate):
- Conditionalize unvalidated variables; `markFirst',
- `dontAdvance', `markLast', `verb'.
-
- * src/gxvalid/gxvmorx1.c
- (gxv_morx_subtable_type1_entry_validate): Conditionalize
- unvalidated variables; `setMark', `dontAdvance'.
-
- * src/gxvalid/gxvmorx2.c
- (gxv_morx_subtable_type2_ligActionOffset_validate):
- Conditionalize unvalidated variables; `last', `store'.
- Checking for overrunning offset is added.
- (gxv_morx_subtable_type2_entry_validate):
- Conditionalize unvalidated variables; `setComponent',
- `dontAdvance', `performAction'.
- (gxv_morx_subtable_type2_ligatureTable_validate):
- Check if the GID for ligature does not exceed the
- max GID in `maxp' table.
-
- * src/gxvalid/gxvmort5.c
- (gxv_morx_subtable_type5_InsertList_validate):
- Conditionalize unvalidated loading of `insert_glyphID'
- array. (gxv_morx_subtable_type5_entry_validate):
- Conditionalize unvalidated variables; `setMark',
- `dontAdvance', `currentIsKashidaLike',
- `markedIsKashidaLike', `currentInsertBefore',
- `markedInsertBefore'.
-
-2011-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Fix gcc4.6 compiler warnings in gxvmort*.c.
-
- * src/gxvalid/gxvmort.c (gxv_mort_subtables_validate):
- Conditionalize unvalidated variable `subFeatureFlags'.
- (gxv_mort_chain_validate): Conditionalize unvalidated
- variable `defaultFlags'.
-
- * src/gxvalid/gxvmort0.c
- (gxv_mort_subtable_type0_entry_validate): Check the
- conflict of the marks for the glyphs.
-
- * src/gxvalid/gxvmort1.c
- (gxv_mort_subtable_type1_offset_to_subst_validate):
- Local variables `min_gid', `max_gid' are replaced by
- variables in the validator.
- (gxv_mort_subtable_type1_entry_validate): Conditionalize
- unvalidated variables; `setMark', `dontAdvance'.
- (gxv_mort_subtable_type1_substTable_validate):
- Validate the GID by the min/max GIDs in the validator.
-
- * src/gxvalid/gxvmort2.c
- (gxv_mort_subtable_type2_ligActionOffset_validate):
- Conditionalize unvalidated variables; `last', `store'.
- Checking for overrunning offset is added.
- (gxv_mort_subtable_type2_entry_validate):
- Conditionalize unvalidated variables; `setComponent',
- `dontAdvance'.
- (gxv_mort_subtable_type2_ligatureTable_validate):
- Check if the GID for ligature does not exceed the
- max GID in `maxp' table.
-
- * src/gxvalid/gxvmort5.c
- (gxv_mort_subtable_type5_InsertList_validate):
- Conditionalize unvalidated loading of `insert_glyphID'
- array. (gxv_mort_subtable_type5_entry_validate):
- Conditionalize unvalidated variables; `setMark',
- `dontAdvance', `currentIsKashidaLike',
- `markedIsKashidaLike', `currentInsertBefore',
- `markedInsertBefore'.
-
-2011-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Fix gcc4.6 compiler warnings in gxvkern.c.
-
- * src/gxvalid/gxvkern.c
- (gxv_kern_subtable_fmt0_pairs_validate): Conditionalize
- unvalidated variable `kernValue'.
- (gxv_kern_subtable_fmt1_entry_validate): Conditionalize
- unvalidated variables; `push', `dontAdvance', `kernAction',
- `kernValue'.
- (gxv_kern_coverage_new_apple_validate): Conditionalize
- trace-only variables; `kernVertical', `kernCrossStream',
- `kernVariation'.
- (gxv_kern_coverage_classic_apple_validate): Conditionalize
- trace-only variables; `horizontal', `cross_stream'.
- (gxv_kern_coverage_classic_microsoft_validate):
- Conditionalize trace-only variables; `horizontal',
- `minimum', `cross_stream', `override'.
- (gxv_kern_subtable_validate): Conditionalize trace-only
- variables; `version', `tupleIndex'.
-
-2011-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Fix gcc4.6 compiler warnings in gxvjust.c.
-
- * src/gxvalid/gxvjust.c (gxv_just_check_max_gid):
- New function to unify the checks of too large GID.
- (gxv_just_wdp_entry_validate): Conditionalize unvalidated
- variables; `beforeGrowLimit', `beforeShrinkGrowLimit',
- `afterGrowLimit', `afterShrinkGrowLimit', `growFlags',
- `shrinkFlags'. Additional check for non-zero values in
- unused storage `justClass' is added.
- (gxv_just_actSubrecord_type0_validate): Conditionalize
- unvalidated variable `order'. GID is checked by
- gxv_just_check_max_gid(). Additional check for upside-down
- relationship between `lowerLimit' and `upperLimit' is added.
- (gxv_just_actSubrecord_type1_validate): GID is checked by
- gxv_just_check_max_gid().
- (gxv_just_actSubrecord_type2_validate): Conditionalize
- unvalidated variable `substThreshhold'. GID is checked by
- gxv_just_check_max_gid().
- (gxv_just_actSubrecord_type5_validate): GID is checked by
- gxv_just_check_max_gid().
- (gxv_just_classTable_entry_validate): Conditionalize
- unvalidated variables; `setMark', `dontAdvance',
- `markClass', `currentClass'.
-
-2011-06-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Preparation to fix gcc4.6 compiler warnings.
-
- * src/gxvalid/gxvcommn.h (GXV_LOAD_TRACE_VARS): New macro to
- conditionalize the variable which is only used for trace messages.
- Automatically set by FT_DEBUG_LEVEL_TRACE.
- (GXV_LOAD_UNUSED_VARS): New macro to conditionalize the loading of
- unvalidated variables. Undefined by default to calm gcc4.6 warning.
- (GXV_ValidatorRec.{min_gid,max_gid}): New variables to hold defined
- GID ranges, for the comparison of GID ranges in different subtables.
-
-2011-06-08 Werner Lemberg <wl@gnu.org>
-
- [autofit] Remove unused structure member.
-
- * src/autofit/afhints.h (AF_SegmentRec): Remove `contour'.
- * src/autofit/aflatin.c (af_latin_hints_compute_segments),
- src/autofit/aflatin2.c (af_latin2_hints_compute_segments): Updated.
-
-2011-05-30 Werner Lemberg <wl@gnu.org>
-
- Fix g++ 4.6 compilation.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_segments,
- af_glyph_hints_dump_edges): Use cast.
-
-2011-05-30 Werner Lemberg <wl@gnu.org>
-
- Fix gcc 4.6 compiler warnings.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Use casts and
- remove unused variables.
- * src/autofit/aflatin.c (af_latin_hints_compute_edges): Comment out
- `up_dir'.
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use `height_org'
- and `width_org' conditionalized.
-
-2011-05-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [mac] Conditionalize the inclusion of `AvailabilityMacros.h'.
-
- The native SDK on earliest Mac OS X (10.0-10.1) did not have
- `AvailabilityMacros.h'. To prevent the inclusion of missing
- header file, ECANCELED (introduced in 10.2) in POSIX header
- file <errno.h> is checked to detect the system version.
-
- * include/freetype/config/ftconfig.h: Conditionalize the
- inclusion of `AvailabilityMacros.h'.
- * builds/unix/ftconfig.in: Ditto.
- * builds/vms/ftconfig.h: Ditto.
-
-2011-05-27 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve tracing of hinting process.
-
- * src/autofit/aflatin.c (af_latin_hint_edges): Add tracing message
- `ADJUST'.
-
-2011-05-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix trace message.
-
- * src/autofit/aflatin.c (af_latin_hint_edges): Show correct value in
- tracing message.
-
-2011-05-24 Daniel Zimmermann <netzimme@googlemail.com>
-
- Reduce warnings for MS Visual Studio 2010.
-
- * src/autofit/afhints.c (af_glyph_hints_get_num_segments,
- af_glyph_hints_get_segment_offset) [!FT_DEBUG_AUTOFIT]: Provide
- return value.
- * src/cff/cffgload.c (cff_slot_load): Add cast.
- * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids): Use proper
- loop variable type.
-
-2011-05-16 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Automake component `builds/unix/install-sh' is removed.
-
- * builds/unix/install-sh: Removed. It is not needed to
- include repository, because autogen.sh installs it.
- * builds/unix/.gitignore: Register install-sh.
-
-2011-05-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [autofit] Make trace message for CJK bluezone more verbose.
-
-2011-05-08 Just Fill Bugs <mozbugbox@yahoo.com.au>
- suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [autofit] Add bluezones for CJK Ideographs.
-
- To remove extrema of vertical strokes of CJK Ideographs at
- low resolution and make the top and bottom horizontal stems
- aligned, bluezones for CJK Ideographs are calculated from
- sample glyphs. At present, vertical bluezones (bluezones
- to align vertical stems) are disabled by default. For detail, see
- https://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00070.html
- https://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00092.html
- https://lists.gnu.org/archive/html/freetype-devel/2011-05/msg00001.html
-
- * include/freetype/internal/fttrace.h: New trace component `afcjk'.
- * src/autofit/afcjk.h (AF_CJK{Blue,Axis,Metric}Rec): Add CJK version
- for AF_Latin{Blue,Axis,Metric}Rec.
- (af_cjk_metrics_check_digits): Ditto, shared with Indic module.
- (af_cjk_metrics_init_widths): Ditto.
- (af_cjk_metrics_init): Take AF_CJKMetric instead of AF_LatinMetric.
- (af_cjk_metrics_scale): Ditto (declaration).
- (af_cjk_hints_init): Ditto (declaration).
- (af_cjk_hints_apply): Ditto (declaration).
- * src/autofit/afcjk.c (af_cjk_metrics_scale): Ditto (body).
- (af_cjk_hints_init): Ditto (body).
- (af_cjk_hints_apply): Ditto (body).
- (af_cjk_metrics_init_widths): Duplicate af_latin_metrics_init_widths.
- (af_cjk_metrics_check_digits): Duplicate af_latin_metrics_check_digits.
- (af_cjk_metrics_init): Call CJK bluezone initializer.
- (af_cjk_metrics_scale_dim): Add code to scale bluezones.
- (af_cjk_hints_compute_blue_edges): New function, CJK version of
- af_latin_hints_compute_blue_edges.
- (af_cjk_metrics_init_blues): New function, CJK version of
- af_latin_metrics_init_blues.
- (af_cjk_hint_edges): Add code to align the edge stems to blue zones.
-
- * src/autofit/afindic.c (af_indic_metrics_init): Take AF_CJKMetric
- instead of AF_LatinMetric, and initialize as af_cjk_metrics_init.
- However bluezones are not initialized.
- (af_indic_metrics_scale): Take AF_CJKMetric instead of AF_LatinMetric.
- (af_indic_hints_init): Ditto.
- (af_indic_hints_apply): Ditto.
-
- * docs/CHANGES: Note about CJK bluezone support.
-
-2011-05-06 Werner Lemberg <wl@gnu.org>
-
- [autofit] Remove unused struct member.
-
- * src/autofit/aflatin.h (AF_LatinAxis): Remove `control_overshoot'.
-
-2011-05-04 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Simplify.
-
-2011-05-01 Just Fill Bugs <mozbugbox@yahoo.com.au>
- Werner Lemberg <wl@gnu.org>
-
- [autofit] Add more debugging functions.
-
- * src/autofit/afhints.c (af_glyph_hints_get_num_segments,
- af_glyph_hints_get_segment_offset): New functions.
-
-2011-05-01 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Add new option `--disable-mmap' to configure script.
-
- * builds/unix/configure.raw: New option `--disable-mmap'
- is added. It is for the developers to simulate the systems
- without mmap() (like 4.3BSD, minix etc) on POSIX systems.
-
-2011-04-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Always recalculate the sfnt table checksum.
-
- * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Recalculate
- the sfnt table checksum even if non-zero value is written in
- the TrueType font header. Some bad PDF generators write
- wrong values. For details see examples and benchmark tests
- of the latency by recalculation:
- https://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00091.html
- https://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00096.html
-
-2011-04-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Register a set of tricky fonts, NEC FA family.
-
- * src/truetype/ttobjs.c (tt_check_trickyness_sfnt_ids):
- Add 8 checksum sets for NEC FA family. For the tricky fonts
- without some tables (e.g. NEC FA fonts lack cvt table),
- extra check is added to assure that a zero-length table in the
- registry is not included in the font.
-
-2011-04-29 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Fix a bug in the sfnt table checksum getter.
-
- * src/truetype/ttobjs.c (tt_get_sfnt_checksum): Check the
- return value of face->goto_table() correctly.
-
-2011-04-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve tracing messages.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues,
- af_latin_align_linked_edge, af_latin_hint_edges): Do it.
-
-2011-04-25 Kan-Ru Chen <kanru@kanru.info>
-
- [truetype] Always check the checksum to identify tricky fonts.
-
- Because some PDF generators mangle the family name badly,
- the trickyness check by the checksum should be invoked always.
- For sample PDF, see
- https://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00073.html
-
- * src/truetype/ttobjs.c (tt_check_trickyness): Even when
- tt_check_trickyness_family() finds no trickyness,
- tt_check_trickyness_sfnt_ids() is invoked.
-
-2011-04-22 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [autofit] Add more Indic scripts with hanging baseline.
-
- * src/autofit/afindic.c (af_indic_uniranges): Tibetan, Limbu,
- Sundanese, Meetei Mayek, Syloti Nagri and Sharada scripts are
- added.
-
-2011-04-21 Behdad Esfahbod <behdad@behdad.org>
-
- Always ignore global advance.
-
- This makes FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH redundant,
- deprecated, and ignored. The new behavior is what every major user
- of FreeType has been requesting. Global advance is broken in many
- CJK fonts. Just ignoring it by default makes most sense.
-
- * src/truetype/ttdriver.c (tt_get_advances),
- src/truetype/ttgload.c (TT_Get_HMetrics, TT_Get_VMetrics,
- tt_get_metrics, compute_glyph_metrics, TT_Load_Glyph),
- src/truetype/ttgload.h: Implement it.
-
- * docs/CHANGES: Updated.
-
-2011-04-21 rainy6144 <rainy6144@gmail.com>
-
- [autofit] Blur CJK stems if too many to preserve their gaps.
-
- When there are too many stems to preserve their gaps in the
- rasterization of CJK Ideographs at a low resolution, blur the
- stems instead of showing clumped stems. See
- https://lists.gnu.org/archive/html/freetype-devel/2011-02/msg00011.html
- https://lists.gnu.org/archive/html/freetype-devel/2011-04/msg00046.html
- for details.
-
- * src/autofit/afcjk.c (af_cjk_hint_edges): Store the position of
- the previous stem by `has_last_stem' and `last_stem_pos', and skip
- a stem if the current and previous stem are too near to preserve
- the gap.
-
-2011-04-18 Werner Lemberg <wl@gnu.org>
-
- Integrate autofitter debugging stuff.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (FT_DEBUG_AUTOFIT): New macro.
-
- * include/freetype/internal/fttrace.h: Add trace components for
- autofitter.
-
- * src/autofit/aftypes.h (AF_LOG): Removed.
- (_af_debug): Removed.
-
- * src/autofit/*: s/AF_DEBUG/FT_DEBUG_AUTOFIT/.
- s/AF_LOG/FT_TRACE5/.
- Define FT_COMPONENT where necessary.
-
-2011-04-18 Werner Lemberg <wl@gnu.org>
-
- Synchronize config files.
-
- * builds/unix/ftconfig.in: Copy missing assembler routines from
- include/freetype/config/ftconfig.h.
-
-2011-04-13 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix Savannah bug #33047.
-
- Patch submitted by anonymous reporter.
-
- * src/psaux/psobjs.c (ps_table_add): Use FT_PtrDist for pointer
- difference.
-
-2011-04-11 Kan-Ru Chen <kanru@kanru.info>
-
- Fix reading of signed integers from files on 64bit platforms.
-
- Previously, signed integers were converted to unsigned integers, but
- this can fail because of sign extension. For example, 0xa344a1eb
- becomes 0xffffffffa344a1eb.
-
- We now do the reverse which is always correct because the integer
- size is the same during the cast from unsigned to signed.
-
- * include/freetype/internal/ftstream.h, src/base/ftstream.c
- (FT_Stream_Get*): Replace with...
- (FT_Stream_GetU*): Functions which read unsigned integers.
- Update all macros accordingly.
-
- * src/gzip/ftgzip.c (ft_gzip_get_uncompressed_size): Updated.
-
-2011-04-07 Werner Lemberg <wl@gnu.org>
-
- Update Unicode ranges for CJK autofitter; in particular, add Hangul.
-
- * src/autofit/afcjk.c (af_cjk_uniranges): Update to Unicode 6.0.
-
-2011-04-04 Werner Lemberg <wl@gnu.org>
-
- Fix formatting of autofit debug dumps.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_points,
- af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Adjust
- column widths.
-
-2011-03-30 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aftypes.h (AF_OutlineRec): Removed, unused.
-
-2011-03-24 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 256.
- This limit is given on p. 37 of Adobe Technical Note #5014.
-
-2011-03-23 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttpload.c (tt_face_load_loca): Fix mismatch warning.
-
-2011-03-20 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_open_font): Check number of TTC subfonts.
-
-2011-03-19 Werner Lemberg <wl@gnu.org>
-
- More C++ compilation fixes.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_points,
- af_glyph_hints_dump_segments, af_glyph_hints_dump_edges)
- [__cplusplus]: Protect with `extern "C"'.
-
-2011-03-18 Werner Lemberg <wl@gnu.org>
-
- C++ compilation fixes.
-
- * src/autofit/aflatin.c (af_latin_hints_apply), src/autofit/afcjk.c
- (af_cjk_hints_apply): Use cast for `dim'.
-
-2011-03-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- A better fix for Savannah bug #32671.
-
- * src/smooth/ftgrays.c (gray_render_conic): Clean up code and
- replace WHILE loop with a more natural DO-WHILE construct.
-
-2011-03-16 Werner Lemberg <wl@gnu.org>.
-
- * src/base/ftstroke.c (FT_StrokerRec): Remove unused `valid' field.
- Suggested by Graham Asher.
-
-2011-03-09 Werner Lemberg <wl@gnu.org>
-
- Make FT_Sfnt_Table_Info return the number of SFNT tables.
-
- * src/sfnt/sfdriver.c (sfnt_table_info): Implement it.
- * include/freetype/tttables.h: Update documentation.
- * docs/CHANGES: Updated.
-
-2011-03-07 Bram Tassyns <bramt@enfocus.be>
-
- [cff] Fix Savannah bug #27988.
-
- * src/cff/cffobjs.c (remove_style): New function.
- (cff_face_init): Use it to strip off the style part of the family
- name.
-
-2011-03-07 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2011-03-07 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Quick fix for Savannah bug #32671.
-
- This isn't the optimal solution yet, but it restores the previous
- rendering quality (more or less).
-
- * src/smooth/ftgrays.c (gray_render_conic): Do more splitting.
-
-2011-03-06 Werner Lemberg <wl@gnu.org>
-
- Fix autohinting fallback.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Assure that we only check TTFs,
- ignoring CFF-based OTFs.
-
-2011-02-27 Werner Lemberg <wl@gnu.org>
-
- Add AF_CONFIG_OPTION_USE_WARPER to control the autofit warper.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (AF_CONFIG_OPTION_USE_WARPER): New macro.
- * src/autofit/aftypes.h (AF_USE_WARPER): Remove.
-
- * src/autofit/*: s/AF_USE_WARPER/AF_CONFIG_OPTION_USE_WARPER/.
-
- * src/autofit/afwarp.c [!AF_CONFIG_OPTION_USE_WARPER]: Replace dummy
- variable assignment with a typedef.
-
-2011-02-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Slight simplifications.
-
- * src/autofit/aflatin.c (af_latin_hints_link_segments): Remove
- test which always returns false.
- (af_latin_hints_compute_blue_edges): Remove redundant assignment.
-
-2011-02-24 Werner Lemberg <wl@gnu.org>
-
- * docs/PROBLEMS: Mention rendering differences on different
- platforms.
- Suggested and worded by Jason Owen <jason.a.owen@gmail.com>.
-
-2011-02-24 Werner Lemberg <wl@gnu.org>
-
- [autofit] Comment out unused code.
-
- * src/autofit/aflatin.c, src/autofit/aflatin2.c
- (af_latin_hints_compute_edges): Do it.
-
-2011-02-24 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afhints.h (AF_GlyphHints): Remove unused field.
-
-2011-02-20 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Fix an off-by-one bug in `FTC_Manager_RemoveFaceID'.
- Found by <ychen1392001@yahoo.com.cn>, see detail in
-
- https://lists.gnu.org/archive/html/freetype/2011-01/msg00023.html
-
- * src/cache/ftccache.c (FTC_Cache_RemoveFaceID): Check the node
- buckets[cache->p + cache->mask] too.
-
-2011-02-19 Kevin Kofler <kevin.kofler@chello.at>
-
- Fall back to autohinting if a TTF/OTF doesn't contain any bytecode.
- This is Savannah patch #7471.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Implement it.
-
-2011-02-19 John Tytgat <John.Tytgat@esko.com>
-
- [cff] Fix subset prefix removal.
- This is Savannah patch #7465.
-
- * src/cff/cffobjs.c (remove_subset_prefix): Update length after
- subset prefix removal.
-
-2011-02-13 Bradley Grainger <bgrainger@logos.com>
-
- Add inline assembly version of FT_MulFix for MSVC.
-
- * include/freetype/config/ftconfig.h: Ported the FT_MulFix_i386
- function from GNU inline assembly syntax (see #ifdef __GNUC__ block
- above) to MASM syntax for Microsoft Visual C++.
-
-2011-02-13 Bradley Grainger <bgrainger@logos.com>
-
- Add project and solution files in Visual Studio 2010 format.
-
- * builds/win32/.gitignore: Ignore user-specific cache files.
- * builds/win32/vc2010/: Add VS2010 project & solution files, created
- by upgrading builds/win32/vc2008/freetype.vcproj.
- * objs/.gitignore: Ignore Visual Studio output files.
-
-2011-02-01 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afdummy.c: Include `aferrors.h'.
- Problem reported by Chris Liddell <chris.liddell@artifex.com>.
-
-2011-02-01 Werner Lemberg <wl@gnu.org>
-
- [cff] Ignore unknown operators in charstrings.
- Patch suggested by Miles.Lau <sunliang_liu@foxitsoftware.com>.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Emit tracing
- message for unknown operators and continue instead of exiting with a
- syntax error.
-
-2011-02-01 Werner Lemberg <wl@gnu.org>
-
- [truetype] FT_LOAD_PEDANTIC now affects `prep' and `fpgm' also.
-
- * src/truetype/ttgload.c (tt_loader_init): Handle
- `FT_LOAD_PEDANTIC'.
- * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep,
- tt_size_init_bytecode, tt_size_ready_bytecode): New argument to
- handle pedantic mode.
- * src/truetype/ttobjs.h: Updated.
-
-2011-01-31 Werner Lemberg <wl@gnu.org>
-
- [truetype] Protect jump instructions against endless loops.
-
- * src/truetype/interp.c (DO_JROT, DO_JMPR, DO_JROF): Exit with error
- if offset is zero.
-
-2011-01-31 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improve handling of invalid references.
-
- * src/truetype/interp.c: Set even more TT_Err_Invalid_Reference
- error codes only if pedantic hinting is active. At the same time,
- try to provide sane values which hopefully allow useful
- continuation. Exception to this is CALL and LOOPCALL – due to
- possible stack corruption it is necessary to bail out.
-
-2011-01-31 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improve handling of stack underflow.
-
- * src/truetype/ttinterp.c (TT_RunIns, Ins_FLIPPT, Ins_DELTAP,
- Ins_DELTAC): Exit with error only if `pedantic_hinting' is set.
- Otherwise, try to do something sane.
-
-2011-01-30 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttmtx.c (tt_face_load_hmtx): Fix tracing message.
-
-2011-01-30 LIU Sun-Liang <sunliang_liu@foxitsoftware.com>
-
- [truetype]: Fix behaviour of MIAP for invalid arguments.
-
- * src/truetype/ttinterp.c (Ins_MIAP): Set reference points even in
- case of error.
-
-2011-01-18 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix handling of MIRP instruction.
-
- Thanks to Greg Hitchcock who explained the issue.
-
- * src/truetype/ttinterp.c (Ins_MIRP): Replace a `>=' operator with
- `>' since the description in the specification is incorrect.
- This fixes, for example, glyph `two' in font `Helvetica Neue LT Com
- 65 medium' at 15ppem.
-
-2011-01-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix ARM assembly code in include/freetype/config/ftconfig.h.
-
- * include/freetype/config/ftconfig.h (FT_MulFix_arm):
- Copy the maintained code from builds/unix/ftconfig.in.
- Old GNU binutils could not accept the reduced syntax
- `orr %0, %2, lsl #16'. Un-omitted syntax like RVCT,
- `orr %0, %0, %2, lsl #16' is better. Reported by
- Johnson Y. Yan. The bug report by Qt developers is
- considered too.
-
- https://bugreports.qt.io/browse/QTBUG-6521
-
-2011-01-15 Werner Lemberg <wl@gnu.org>
-
- [raster] Make bbox handling the same as with Microsoft's rasterizer.
-
- Right before B/W rasterizing, the bbox gets simply rounded to
- integers. This fixes, for example, glyph `three' in font `Helvetica
- Neue LT Com 65 Medium' at 11ppem.
-
- Thanks to Greg Hitchcock who explained this behaviour.
-
- * src/raster/ftrend1.c (ft_raster1_render): Implement it.
-
-2011-01-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Copy -mcpu=* & -march=* options from CFLAGS to LDFLAGS.
-
- * builds/unix/configure.raw: Consider recent gcc-standard
- flags to specify architecture in CFLAGS & LDFLAGS
- harmonization. Requested by Savannah bug #32114, to
- support multilib feature of BuildRoot SDK correctly.
-
-2011-01-15 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix off-by-one bug in CFLAGS & LDFLAGS harmonizer.
-
- * builds/unix/configure.raw: Some important options that
- included in CFLAGS but not in LDFLAGS are copied to
- LDFLAGS, but the last option in CFLAGS was not checked.
-
-2011-01-13 Werner Lemberg <wl@gnu.org>
-
- [raster] Add undocumented drop-out rule to the other bbox side also.
-
- * src/raster/ftraster.c (Vertical_Sweep_Drop,
- Horizontal_Sweep_Drop): Implement it.
-
-2011-01-13 Werner Lemberg <wl@gnu.org>
-
- [raster] Reduce jitter value.
-
- This catches a rendering problem with glyph `x' from Tahoma at
- 10ppem. It seems that the increase of the precision in the change
- from 2009-06-11 makes a larger jitter value unnecessary.
-
- * src/raster/ftraster.c (Set_High_Precision): Implement it.
-
-2011-01-13 Werner Lemberg <wl@gnu.org>
-
- [raster] Handle drop-outs at glyph borders according to Microsoft.
-
- If a drop-out rule would switch on a pixel outside of the glyph's
- bounding box, use the right (or top) pixel instead. This is an
- undocumented feature, but some fonts like `Helvetica Neue LT Com 65
- Medium' heavily rely on it.
-
- Thanks to Greg Hitchcock who explained this behaviour.
-
- * src/raster/ftraster.c (Vertical_Sweep_Drop,
- Horizontal_Sweep_Drop): Implement it.
-
-2011-01-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Fix Savannah bug #31923, patch drafted by Harsha.
-
- When a node comparator changes the cached nodes during the
- search of a node matching with queried properties, the
- pointers obtained before the function should be updated to
- prevent the dereference to freed or reallocated nodes.
- To minimize the rescan of the linked list, the update is
- executed when the comparator notifies the change of cached
- nodes. This change depends previous change:
- 38b272ffbbdaae276d636aec4ef84af407d16181
-
- * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Rescan the
- top node if the cached nodes are changed.
- * src/cache/ftccache.c (FTC_Cache_Lookup): Ditto.
-
-2011-01-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Notice if a cache query induced the node list change.
-
- Some node comparators (comparing the cache node contents and the
- properties specified by the query) can flush the cache node to
- prevent the cache inflation. The change may invalidate the pointers
- to the node obtained before the node comparison, so it should be
- noticed to the caller. The problem caused by the cache node
- changing is reported by Harsha, see Savannah bug #31923.
-
- * src/cache/ftccache.h (FTC_Node_CompareFunc): Add new argument
- `FT_Bool* list_changed' to indicate the change of the cached nodes
- to the caller.
- (FTC_CACHE_LOOKUP_CMP): Watch the change of the cached nodes by
- `_list_changed'.
- (FTC_CACHE_TRYLOOP_END): Take new macro argument `_list_changed'
- and update it when `FTC_Manager_FlushN' flushes any nodes.
-
- * src/cache/ftccback.h (ftc_snode_compare): Updated to fit with new
- FTC_Node_CompareFunc type.
- (ftc_gnode_compare): Ditto.
-
- * src/cache/ftcbasic.c: Include FT_INTERNAL_OBJECTS_H to use
- TRUE/FALSE macros.
- (ftc_basic_gnode_compare_faceid): New argument `FT_Bool*
- list_changed' to indicate the change of the cache nodes (anyway, it
- is always FALSE).
-
- * src/cache/ftccmap.c: Include FT_INTERNAL_OBJECTS_H to use
- TRUE/FALSE macros.
- (ftc_cmap_node_compare): New argument `FT_Bool* list_changed' to
- indicate the change of the cache nodes (anyway, it is always FALSE).
- (ftc_cmap_node_remove_faceid): Ditto.
-
- * src/cache/ftccache.c (FTC_Cache_NewNode): Pass a NULL pointer to
- `FTC_CACHE_TRYLOOP_END', because the result is not needed.
- (FTC_Cache_Lookup): Watch the change of the cache nodes by
- `list_changed'.
- (FTC_Cache_RemoveFaceID): Ditto.
-
- * src/cache/ftcglyph.c: Include FT_INTERNAL_OBJECTS_H to use
- TRUE/FALSE macros.
- (ftc_gnode_compare): New argument `FT_Bool* list_changed' to
- indicate the change of the cache nodes (anyway, it is always FALSE).
- (FTC_GNode_Compare): New argument `FT_Bool* list_changed' to be
- passed to `ftc_gnode_compare'.
- * src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto.
-
- * src/cache/ftcsbits.c (ftc_snode_compare): New argument `FT_Bool*
- list_changed' to indicate the change of the cache nodes, anyway. It
- is updated by `FTC_CACHE_TRYLOOP'.
- (FTC_SNode_Compare): New argument `FT_Bool* list_changed' to be
- passed to `ftc_snode_compare'.
- * src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto.
-
-2011-01-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Fit `FTC_GNode_Compare' to `FTC_Node_CompareFunc'.
-
- * src/cache/ftcglyph.h (FTC_GNode_Compare): Add the 3rd
- argument `FTC_Cache cache' to fit FTC_Node_CompareFunc
- prototype.
- * src/cache/ftcglyph.c (FTC_GNode_Compare): Ditto. Anyway,
- `cache' is not used by its child `ftc_gnode_compare'.
-
-2011-01-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Deduplicate the code to get the top node by a hash.
-
- There are several duplicated code fragments getting the top node
- from a cache by a given hash, like:
-
- idx = hash & cache->mask;
- if ( idx < cache->p )
- idx = hash & ( cache->mask * 2 + 1 );
- pnode = cache->buckets + idx;
-
- To remove duplication, a cpp-macro to do same work
- `FTC_NODE__TOP_FOR_HASH' is introduced. For non-inlined
- configuration, non-`ftc_get_top_node_for_hash' is also introduced.
-
- * src/cache/ftccache.h (FTC_NODE__TOP_FOR_HASH): Declare
- and implement inlined version.
- (FTC_CACHE_LOOKUP_CMP): Use `FTC_NODE__TOP_FOR_HASH'.
- * src/cache/ftccache.c (ftc_get_top_node_for_hash): Non-inlined
- version.
- (ftc_node_hash_unlink): Use `FTC_NODE__TOP_FOR_HASH'.
- (ftc_node_hash_link): Ditto.
- (FTC_Cache_Lookup): Ditto.
-
-2011-01-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] inline-specific functions are conditionalized.
-
- * src/cache/ftcglyph.c (FTC_GNode_Compare): Conditionalized for
- inlined configuration. This function is a thin wrapper of
- `ftc_gnode_compare' for inlined `FTC_CACHE_LOOKUP_CMP' (see
- `nodecmp' argument). Under non-inlined configuration,
- `ftc_gnode_compare' is invoked by `FTC_Cache_Lookup', via
- `FTC_Cache->clazz.node_compare'.
-
- * src/cache/ftcglyph.h (FTC_GNode_Compare): Ditto.
- * src/cache/ftcsbits.c (FTC_SNode_Compare): Ditto, for
- `ftc_snode_compare'.
- * src/cache/ftcsbits.h (FTC_SNode_Compare): Ditto.
-
-2011-01-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Correct a type mismatch under non-inlined config.
-
- * src/cache/ftcglyph.h (FTC_GCACHE_LOOKUP_CMP): `FTC_GCache_Lookup'
- takes the node via a pointer `FTC_Node*', differently from cpp-macro
- `FTC_CACHE_LOOKUP_CMP'.
-
-2011-01-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Update Jamfile to include Bzip2 support.
-
- * Jamfile: Include src/bzip2 to project.
- Comments for lzw, gzip, bzip2 are changed to clarify that
- they are for compressed PCF fonts, not others.
- (e.g. compressed BDF fonts are not supported yet)
-
-2011-01-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Update Symbian project files to include Bzip2 support.
-
- Currently, it provides `FT_Stream_OpenBzip2' that returns
- unimplemented error always, to prevent unresolved symbol
- error for the applications designed for Unix systems.
-
- * builds/symbian/bld.inf: Include ftbzip2.h.
- * builds/symbian/freetype.mmp: Include ftbzip2.c.
-
-2011-01-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Update classic MacOS makefiles to include Bzip2 support.
-
- Currently, it provides `FT_Stream_OpenBzip2' that returns
- unimplemented error always, to prevent unresolved symbol
- error for the applications designed for Unix systems.
-
- * builds/mac/FreeType.m68k_cfm.make.txt: Include ftbzip2.c.o.
- * builds/mac/FreeType.m68k_far.make.txt: Ditto.
- * builds/mac/FreeType.ppc_carbon.make.txt: Include ftbzip2.c.x.
- * builds/mac/FreeType.ppc_classic.make.txt: Ditto.
-
-2011-01-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Update Amiga makefiles to include Bzip2 support.
-
- Currently, it provides `FT_Stream_OpenBzip2' that returns
- unimplemented error always, to prevent unresolved symbol
- error for the applications designed for Unix systems.
-
- * builds/amiga/makefile: Include bzip2.ppc.o built from ftbzip2.c.
- * builds/amiga/makefile.os4: Include bzip2.o built from ftbzip2.c.
- * builds/amiga/smakefile: Ditto.
-
-2011-01-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Update pkg-config tools to reflect Bzip2 support.
-
- * builds/unix/freetype-config.in: Include `-lbz2' to
- --libs output, if built with Bzip2 support.
- * builds/unix/freetype2.in: Ditto.
-
-2011-01-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * builds/unix/configure.raw: Remove `SYSTEM_BZ2LIB' macro.
-
- SYSTEM_ZLIB is used to switch the builtin zlib source
- or system zlib source out of FreeType2. But ftbzip2
- module has no builtin bzip2 library and always requires
- system bzip2 library. Thus SYSTEM_BZ2LIB is always yes,
- it is not used.
-
-2011-01-03 Werner Lemberg <wl@gnu.org>
-
- */rules.mk: Handle `*pic.c' files.
-
-2010-12-31 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cfftypes.h (CFF_MAX_CID_FONTS): Increase to 64.
- Problem reported by Tom Bishop <wenlin@wenlin.com>.
-
-2010-12-31 Werner Lemberg <wl@gnu.org>
-
- Improve bzip2 support.
-
- * include/freetype/ftmoderr.h: Add bzip2.
-
- * docs/INSTALL.ANY, docs/CHANGES: Updated.
-
- * src/pcf/README: Updated.
- * include/freetype/internal/pcftypes.h: Obsolete, removed.
-
-2010-12-31 Joel Klinghed <the_jk@yahoo.com>
-
- Add bzip2 compression support to handle *.pcf.bz2 files.
-
- * builds/unix/configure.raw: Test for libbz2 library.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (FT_CONFIG_OPTION_USE_BZIP2): Define.
- * include/freetype/config/ftheader.h (FT_BZIP2_H): Define.
-
- * include/freetype/ftbzip2.h: New file.
-
- * src/bzip2/*: New files.
-
- * src/pcf/pcf.h: s/gzip_/comp_/.
- * src/pcf/pcfdrivr.c: Include FT_BZIP2_H.
- s/gzip_/comp_/.
- (PCF_Face_Init): Handle bzip2 compressed files.
-
- * docs/formats.txt, modules.cfg: Updated.
-
-2010-12-25 Harsha <mm.harsha@gmail.com>
-
- Apply Savannah patch #7422.
-
- If we encounter a space in a string then the sbit buffer is NULL,
- height and width are 0s. So the check in ftc_snode_compare will
- always pass for spaces (comparison with 255). Here the comments
- above the condition are proper but the implementation is not. When
- we create an snode I think it is the proper way to initialize the
- width to 255 and then put a check for being equal to 255 in snode
- compare function.
-
- * src/cache/ftcsbits.c (FTC_SNode_New): Initialize sbit widths with
- value 255.
- (ftc_snode_compare): Fix condition.
-
-2010-12-13 Werner Lemberg <wl@gnu.org>
-
- Fix parameter handling of `FT_Set_Renderer'.
- Reported by Kirill Tishin <siege@bk.ru>.
-
- * src/base/ftobjs.c (FT_Set_Renderer): Increment `parameters'.
-
-2010-12-09 Werner Lemberg <wl@gnu.org>
-
- [cff] Allow `hlineto' and `vlineto' without arguments.
-
- We simply ignore such instructions. This is invalid, but it doesn't
- harm; and indeed, there exist such subsetted fonts in PDFs.
-
- Reported by Albert Astals Cid <aacid@kde.org>.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- [cff_op_hlineto]: Ignore instruction if there aren't any arguments
- on the stack.
-
-2010-11-28 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.4 released.
- =========================
-
-
- Tag sources with `VER-2-4-4'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.4
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.3/2.4.4/, s/243/244/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
-
- * builds/unix/configure.raw (version_info): Set to 12:2:6.
-
-2010-11-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [ftsmooth]: Minor code simplification.
-
- * src/smooth/ftgrays (gray_render_cubic): Do only one comparison
- instead of two.
-
-2010-11-26 Johnson Y. Yan <yinsen_yan@foxitsoftware.com>
-
- [truetype] Better multi-threading support.
-
- * src/truetype/ttinterp.c (TT_Load_Context): Reset glyph zone
- references.
-
-2010-11-23 John Tytgat <John.Tytgat@esko.com>
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstring): Expand
- start_point, check_points, add_point, add_point1, close_contour
- macros.
- Remove add_contour macro.
- Return error code from t1_builder_start_point and
- t1_builder_check_points when there was one (instead of returning 0).
-
-2010-11-22 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Identify the tricky fonts by cvt/fpgm/prep checksums.
- Some Latin TrueType fonts are still expected to be unhinted.
- Fix Savannah bug #31645.
-
- * src/truetype/ttobjs.c (tt_check_trickyness): Divided to...
- (tt_check_trickyness_family): this checking family name, and
- (tt_check_trickyness_sfnt_ids): this checking cvt/fpgm/prep.
- (tt_get_sfnt_checksum): Function to retrieve the sfnt checksum
- for specified subtable even if cleared by lazy PDF generators.
- (tt_synth_sfnt_checksum): Function to calculate the checksum.
-
-2010-11-18 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix `loca' handling for inconsistent number of glyphs.
- Reported by Johnson Y. Yan <yinsen_yan@foxitsoftware.com>.
-
- * src/truetype/ttpload.c (tt_face_load_loca): While sanitizing,
- handle case where `loca' is the last table in the font.
-
-2010-11-18 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Ignore all errors while loading `OS/2' table.
- Suggested by Johnson Y. Yan <yinsen_yan@foxitsoftware.com>.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Do it.
-
-2010-11-18 Johnson Y. Yan <yinsen_yan@foxitsoftware.com>
-
- [type1] Fix matrix normalization.
-
- * src/type1/t1load.c (parse_font_matrix): Handle sign of scaling
- factor.
-
-2010-11-18 Werner Lemberg <wl@gnu.org>
-
- [type1] Improve guard against malformed data.
- Based on a patch submitted by Johnson Y. Yan
- <yinsen_yan@foxitsoftware.com>
-
- * src/type1/t1load.c (read_binary_data): Check `size'.
-
-2010-11-17 Werner Lemberg <wl@gnu.org>
-
- [sfnt] While tracing, output table checksums also.
-
- * src/sfnt/ttload.c (tt_face_load_font_dir): Do it.
-
-2010-11-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [UVS] Fix `find_variant_selector_charmap', Savannah bug #31545.
-
- Since 2010-07-04, `find_variant_selector_charmap' returns
- the first cmap subtable always under rogue-compatible
- configuration, it causes NULL pointer dereference and
- make UVS-related functions crashed.
-
- * src/base/ftobjs.c (Fix find_variant_selector_charmap):
- Returns UVS cmap correctly.
-
-2010-11-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [ftsmooth] Improve rendering.
-
- * src/smooth/ftsmooth.c (gray_render_conic): Since version 2.4.3,
- cubic deviations have been estimated _after_ UPSCALE, whereas
- conic ones have been evaluated _before_ UPSCALE, which produces
- inferior rendering results. Fix this.
- Partially undo change from 2010-10-15 by using ONE_PIXEL/4; this has
- been tested with demo images sent to the mailing list. See
-
- https://lists.gnu.org/archive/html/freetype-devel/2010-10/msg00055.html
-
- and later mails in this thread.
-
-2010-10-28 Werner Lemberg <wl@gnu.org>
-
- [ftraster] Minor fixes.
-
- Reported by Tom Bishop <wenlin@wenlin.com>.
-
- * src/raster/ftraster.c (ULong): Remove unused typedef.
- (TWorker): Remove unused variable `precision_mask'.
-
-2010-10-28 Werner Lemberg <wl@gnu.org>
-
- [ftraster] Fix rendering.
-
- Problem reported by Tom Bishop <wenlin@wenlin.com>; see
- thread starting with
-
- https://lists.gnu.org/archive/html/freetype/2010-10/msg00049.html
-
- * src/raster/ftraster.c (Line_Up): Replace FMulDiv with SMulDiv
- since the involved multiplication exceeds 32 bits.
-
-2010-10-25 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Revert a change of `_idx' type in `FTC_CACHE_LOOKUP_CMP'.
-
- * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Revert
- the type of `_idx' from FT_PtrDist (by previous change)
- to original FT_UFast, to match with FT_CacheRec.
-
-2010-10-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Change the hash types to FT_PtrDist.
-
- On LLP64 platforms (e.g. Win64), FT_ULong (32-bit)
- variables are inappropriate to calculate hash values
- from the memory address (64-bit). The hash variables
- are extended from FT_ULong to FT_PtrDist and new
- hashing macro functions are introduced. The hash
- values on 16-bit memory platforms are changed, but
- ILP32 and LP64 are not changed. The hash value in
- the cache subsystem is not reverted to the memory
- address, so using signed type FT_PtrDist is safe.
-
- * src/cache/ftccache.h (_FTC_FACE_ID_HASH): New hash
- function to replace `FTC_FACE_ID_HASH' for portability.
- * src/cache/ftcmanag.h (FTC_SCALER_HASH): Replace
- `FTC_FACE_ID_HASH' by `_FTC_FACE_ID_HASH'.
- * src/cache/ftccmap.c (FTC_CMAP_HASH): Ditto.
-
- * src/cache/ftccache.h (FTC_NodeRec): The type of the
- member `hash' is changed from FT_UInt32 to FT_PtrDist.
-
- * src/cache/ftccache.h (FTC_Cache_Lookup): The type of the
- argument `hash' is changed from FT_UInt32 to FT_PtrDist.
- (FTC_Cache_NewNode): Ditto.
- * src/cache/ftccache.c (ftc_cache_add): Ditto.
- (FTC_Cache_Lookup): Ditto. (FTC_Cache_NewNode): Ditto.
- * src/cache/ftcglyph.h (FTC_GCache_Lookup): Ditto.
- * src/cache/ftcglyph.c (FTC_GCache_Lookup): Ditto.
-
- * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): The type
- of the internal variable `hash' is changed to FT_PtrDist
- from FT_UInt32. (FTC_ImageCache_LookupScaler): Ditto.
- (FTC_SBitCache_Lookup): Ditto.
- (FTC_SBitCache_LookupScaler): Ditto.
- * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Ditto.
- * src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): Ditto.
- Also the type of the internal variable `_idx' is changed to
- FT_PtrDist from FT_UFast for better pointer calculation.
-
-2010-10-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Hide internal macros incompatible with LLP64.
-
- `FT_POINTER_TO_ULONG', `FTC_FACE_ID_HASH', and
- `FTC_IMAGE_TYPE_HASH' are enclosed by
- FT_CONFIG_OPTION_OLD_INTERNALS and hidden from
- normal clients.
-
- For the history of these macros, see the investigation:
- https://lists.gnu.org/archive/html/freetype/2010-10/msg00022.html
-
-2010-10-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Change the type of `FT_MEM_VAL' from FT_ULong to FT_PtrDist.
-
- On LLP64 platforms (e.g. Win64), unsigned long (32-bit)
- cannot cover the memory address (64-bit). `FT_MEM_VAL' is
- used for hashing only and not dereferred, so using signed
- type FT_PtrDist is safe.
-
- * src/base/ftdbgmem.c (FT_MEM_VAL): Change the type of the
- return value from FT_ULong to FT_PtrDist.
- (ft_mem_table_resize): The type of hash is changed to
- FT_PtrDist. (ft_mem_table_get_nodep): Ditto.
-
-2010-10-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Replace "%lx" for memory address by "%p", LLP64 platforms.
-
- On LLP64 platforms (e.g. Win64), long (32-bit) cannot cover
- the memory address (64-bit). Also the casts from the pointer
- type to long int should be removed to preserve the address
- correctly.
-
- * src/raster/ftraster.c (New_Profile): Replace "%lx" by "%p".
- (End_Profile) Ditto.
- * src/truetype/ttinterp.c (Init_Context): Ditto.
-
-2010-10-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Fix thinko in spline flattening.
-
- FT_MAX_CURVE_DEVIATION is dependent on the value of ONE_PIXEL.
-
- * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): Remove it and
- replace it everywhere with ONE_PIXEL/8.
-
-2010-10-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [raccess] Skip unrequired resource access rules by Darwin VFS.
-
- When a resource fork access rule by Darwin VFS could open the
- resource fork but no font is found in it, the rest of rules
- by Darwin VFS are skipped. It reduces the warnings of the
- deprecated resource fork access method by recent Darwin kernel.
- Fix MacPorts ticket #18859:
- https://trac.macports.org/ticket/18859
-
- * src/base/ftobjs.c (load_face_in_embedded_rfork):
- When `FT_Stream_New' returns FT_Err_Cannot_Open_Stream, it
- means that the file is possible to be `fopen'-ed but zero-sized.
- Also there is a case that the resource fork is not zero-sized,
- but no supported font exists in it. If a rule by Darwin VFS
- falls into such cases, there is no need to try other Darwin VFS
- rules anymore. Such cases are marked by vfs_rfork_has_no_font.
- If it is TRUE, the Darwin VFS rules are skipped.
-
-2010-10-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [raccess] Grouping resource access rules based on Darwin VFS.
-
- MacOS X/Darwin kernel supports a few tricky methods to access
- a resource fork via ANSI C or POSIX interface. Current resource
- fork accessor tries all possible methods to support all kernels.
- But if a method could open a resource fork but no font is found,
- there is no need to try other methods older than tested method.
- To determine whether the rule index is for Darwin VFS, a local
- function `ftrfork.c::raccess_rule_by_darwin_vfs' is introduced.
- To use this function in ftobjs.c etc but it should be inlined,
- it is exposed by ftbase.h.
-
- * src/base/ftrfork.c (FT_RFork_Rule): New enum type to identify
- the rules to access the resource fork.
- (raccess_guess_rec): New structure to bind the rule function and
- rule enum type.
- (FT_Raccess_Guess): The list of the rule functions is replaced by
- (raccess_guess_table): This. This is exposed to be used by other
- intra module functions.
- (raccess_rule_by_darwin_vfs): A function to return a boolean
- if the rule specified by the rule index is based on Darwin VFS.
-
-2010-10-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Prevent to open a FT_Stream for zero-sized file on non-Unix.
-
- builds/unix/ftsystem.c prevents to open an useless stream from
- zero-sized file and returns FT_Err_Cannot_Open_Stream, but the
- stream drivers for ANSI C, Amiga and VMS return useless streams.
- For cross-platform consistency, all stream drivers should act
- same.
-
- * src/base/ftsystem.c (FT_Stream_Open): If the size of the opened
- file is zero, FT_Err_Cannot_Open_Stream is returned.
- * builds/amiga/src/base/ftsystem.c (FT_Stream_Open): Ditto.
- * src/vms/ftsystem.c (FT_Stream_Open): Ditto.
-
-2010-10-12 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #31310.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Protect against
- invalid `runcnt' values.
-
-2010-10-08 Chris Liddell <chris.liddell@artifex.com>
-
- [sfnt] Fix Savannah bug #31275.
-
- * src/sfnt/ttpost.c: Include FT_INTERNAL_DEBUG_H.
-
-2010-10-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improve error handling of `SHZ' bytecode instruction.
- Problem reported by Chris Evans <scarybeasts@gmail.com>.
-
- * src/truetype/ttinterp.c (Ins_SHZ): Check `last_point'.
-
-2010-10-05 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #31253.
- Patch submitted by an anonymous reporter.
-
- * configure: Use `awk' instead of `sed' to manipulate output of `ls
- -id'.
-
-2010-10-03 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.3 released.
- =========================
-
-
- Tag sources with `VER-2-4-3'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.3
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.2/2.4.3/, s/242/243/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
-
- * builds/unix/configure.raw (version_info): Set to 12:1:6.
-
-2010-10-03 Werner Lemberg <wl@gnu.org>
-
- Avoid `configure' issues with symbolic links.
- Based on a patch from Alexander Stohr <Alexander.Stohr@gmx.de>.
-
- * configure: Compare directories using `ls -id'.
- Check existence of `reference' subdirectory before creating it.
-
-2010-10-02 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #31088 (sort of).
-
- * src/sfnt/ttload.c (tt_face_load_maxp): Always allocate at least 64
- function entries.
-
-2010-10-02 Werner Lemberg <wl@gnu.org>
-
- [smooth] Fix splitting of cubics for negative values.
-
- Reported by Róbert Márki <gsmiko@gmail.com>; see
- https://lists.gnu.org/archive/html/freetype/2010-09/msg00019.html.
-
- * src/smooth/ftgrays.c (gray_render_cubic): Fix thinko.
-
-2010-10-01 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Fix Savannah bug #31040.
-
- * src/truetype/ttinterp.c (free_buffer_in_size): Remove.
- (TT_RunIns): Updated.
-
-2010-09-20 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [sfnt] Make error message filling NULL names less verbose.
-
- * src/sfnt/ttpost.c (load_format_20): Showing 1 summary message
- when we fill `post' names by NULL, instead of per-entry message.
-
-2010-09-20 Graham Asher <graham.asher@btinternet.com>
- David Bevan <david.bevan@pb.com>
-
- [smooth] Fix and improve spline flattening.
-
- This fixes the flattening of cubic, S-shaped curves and speeds up
- the handling of both the conic and cubic arcs.
-
- See the discussions on the freetype-devel mailing list in late
- August and September 2010 for details.
-
- * src/smooth/ftgrays.c (FT_MAX_CURVE_DEVIATION): New macro.
- (TWorker): Remove `conic_level' and `cubic_level' elements.
- (gray_render_conic): Simplify algorithm.
- (gray_render_cubic): New algorithm; details are given in the code
- comments.
- (gray_convert_glyph): Remove heuristics.
-
-2010-09-19 Werner Lemberg <wl@gnu.org>
-
- Minor fixes.
-
- * src/cff/cffload.c (cff_charset_compute_cids): `charset->sids[i]'
- is `FT_UShort'.
- (cff_index_access_element): Don't use additions in comparison.
- * src/sfnt/ttpost.c (load_format_20): Make `post_limit' of type
- `FT_Long'.
- Don't use additions in comparison.
- Improve tracing messages.
- (load_format_25, load_post_names): Make `post_limit' of type
- `FT_Long'.
-
-2010-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cff] Truncate the element length at the end of the stream.
- See Savannah bug #30975.
-
- * src/cff/cffload.c (cff_index_access_element): `off2', the offset
- to the next element is truncated at the end of the stream to prevent
- invalid I/O. As `off1', the offset to the requested element has
- been checked by `FT_STREAM_SEEK', `off2' should be checked
- similarly.
-
-2010-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cff] Ignore CID > 0xFFFFU.
- See Savannah bug #30975.
-
- * src/cff/cffload.c (cff_charset_compute_cids): Ignore CID if
- greater than 0xFFFFU. CFF font spec does not mention maximum CID in
- the font, but PostScript and PDF spec define that maximum CID is
- 0xFFFFU.
-
-2010-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cff] Make trace message in` cff_charset_load' verbose.
- See Savannah bug #30975.
-
- * src/cff/cffload.c (cff_charset_load): Report the original `nleft'
- and truncated `nleft'.
-
-2010-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cff] Correct `max_cid' from CID array length to max CID.
- See Savannah bug #30975.
-
- * src/cff/cffload.c (cff_charset_compute_cids): Don't increment
- max_cid after detecting max CID. The array CFF_Charset->cids is
- allocated by max_cid + 1.
- (cff_charset_cid_to_gindex): Permit CID is less than or equal to
- CFF_Charset->max_cid.
- * src/cff/cffobjs.c (cff_face_init): FT_Face->num_glyphs is
- calculated as CFF_Charset->max_cid + 1.
-
-2010-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Sanitize the broken offsets in `loca'.
- See Savannah bug #31040.
-
- * src/truetype/ttpload.c (tt_face_get_location): If `pos1', the
- offset to the requested entry in `glyf' exceeds the end of the
- table, return offset=0, length=0. If `pos2', the offset to the next
- entry in `glyf' exceeds the end of the table, truncate the entry
- length at the end of `glyf' table.
-
-2010-09-19 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [sfnt] Prevent overrunning in `post' table parser.
- See Savannah bug #31040.
-
- * src/sfnt/ttpost.c (load_post_names): Get the length of `post'
- table and pass the limit of `post' table to `load_format_20' and
- `load_format_25'.
- (load_format_20): Stop the parsing when we reached at the limit of
- `post' table. If more glyph names are required, they are filled by
- NULL names.
-
-2010-09-17 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Don't duplicate size->twilight structure to be freed.
- See Savannah bug #31040 for detail.
-
- * src/truetype/ttinterp.c (free_buffer_in_size): Don't duplicate
- FT_GlyphZoneRec size->twilight to be freed. If duplicated,
- `FT_FREE' erases the duplicated pointers only and leave original
- pointers. They can cause the double-free crash when the burst
- errors occur in TrueType interpreter and `free_buffer_in_size' is
- invoked repeatedly.
-
-2010-09-15 Werner Lemberg <wl@gnu.org>
-
- Make bytecode debugging with FontForge work again.
-
- * src/truetype/ttinterp.c (TT_RunIns): Don't call
- `free_buffer_in_size' in case of error if a debugger is active.
-
-2010-09-14 Werner Lemberg <wl@gnu.org>
-
- Improve tracing messages.
-
- * src/truetype/ttinterp.c (TT_RunIns): Improve wording of tracing
- message.
- * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Add
- tracing message.
- * src/truetype/ttgload.c (tt_loader_init): Add tracing message.
- * src/cache/ftcsbits.c (ftc_snode_load): Emit tracing message if
- glyph doesn't fit into a small bitmap container.
-
-2010-09-13 Werner Lemberg <wl@gnu.org>
-
- Fix minor issues reported by <muktha.narayan@wipro.com>.
-
- * src/autofit/aflatin.c (af_latin_compute_stem_width): Remove
- redundant conditional check.
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Ditto.
- * src/cff/cffload.c (cff_encoding_load): Remove conditional check
- which always evaluates to `true'.
- * src/pshinter/pshalgo.c (ps_glyph_interpolate_strong_points):
- Ditto.
- * src/truetype/ttinterp.c (Ins_IUP): Ditto.
- * src/cid/cidgload.c (cid_slot_load_glyph): Don't check for NULL if
- value is already dereferenced.
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix check of `face'.
-
-2010-08-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Ignore the environmental setting of LIBTOOL.
- Patch is suggested by Adrian Bunk, to prevent unexpected
- reflection of environmental LIBTOOL. See:
- https://savannah.nongnu.org/patch/?7290
-
- * builds/unix/unix-cc.in: LIBTOOL is unconditionally set to
- $(FT_LIBTOOL_DIR)/libtool. FT_LIBTOOL_DIR is set to $(BUILD_DIR)
- by default.
- * configure: When configured for the building out of source tee,
- FT_LIBTOOL_DIR is set to $(OBJ_DIR).
-
-2010-08-31 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Decrease the trace level catching the interpreter error.
-
- * src/truetype/ttinterp.c (TT_RunIns): Decrease the trace level
- showing the error when the interpreter returns with an error,
- from` FT_TRACE7' to `FT_TRACE1'.
-
-2010-08-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Prevent bytecode reuse after the interpretation error.
-
- * src/truetype/ttinterp.c (free_buffer_in_size): New function to
- free the buffer allocated during the interpretation of this glyph.
- (TT_RunIns): Unset FT_Face->size->{cvt_ready,bytecode_ready} if
- an error occurs in the bytecode interpretation. The interpretation
- of invalid bytecode may break the function definitions and referring
- them in later interpretation is danger. By unsetting these flags,
- `fpgm' and `prep' tables are executed again in next interpretation.
-
- This fixes Savannah bug #30798, reported by Robert Święcki.
-
-2010-08-29 Werner Lemberg <wl@gnu.org>
-
- [ftraster] Pacify compiler.
-
- * src/raster/ftraster.c (ft_black_new) [_STANDALONE_]: `memory' is
- not used.
-
-2010-08-29 Werner Lemberg <wl@gnu.org>
-
- [cff] Allow SIDs >= 65000.
-
- * src/cff/cffload.c (cff_charset_load): Fix change from 2009-03-20:
- The threshold for SIDs is not applicable here. I misinterpreted the
- `SID values 65000 and above are available for implementation use'
- sentence in the CFF specification.
-
- Problem reported by Ivan Ninčić <inincic@pdftron.com>.
-
-2010-08-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Force hinting when the font lacks its familyname.
-
- In Type42 or Type11 font embedded in PostScript & PDF, TrueType sfnt
- stream may lack `name' table because they are not required. Hinting
- for nameless fonts is safer for PDFs including embedded Chinese
- fonts. Written by David Bevan, see:
-
- https://lists.gnu.org/archive/html/freetype-devel/2010-08/msg00021.html
- https://lists.freedesktop.org/archives/poppler/2010-August/006310.html
-
- * src/truetype/ttobjs.c (tt_check_trickyness): If a NULL pointer by
- nameless font is given, TRUE is returned to enable hinting.
-
-2010-08-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Register yet another tricky TrueType font.
-
- * src/truetype/ttobjs.c (tt_check_trickyness): Add `HuaTianKaiTi?',
- a Kaishu typeface paired with `HuaTianSongTi?' by Huatian
- Information Industry.
-
-2010-08-17 Teijo Kinnunen <Teijo.Kinnunen@nuance.com>
-
- [cache] Fix Savannah bug #30788.
-
- * src/cache/ftccache.c (FTC_Cache_Clear): Check `cache->buckets' for
- NULL too.
-
-2010-08-10 Werner Lemberg <wl@gnu.org>
-
- Try to fix Savannah bug #30717 (and probably #30719 too).
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Add another
- overflow test for `width' and `height'.
-
-2010-08-06 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.2 released.
- =========================
-
-
- Tag sources with `VER-2-4-2'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.2
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.1/2.4.2/, s/241/242/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
-
- * builds/unix/configure.raw (version_info): Set to 12:0:6.
-
-2010-08-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix Savannah bug #30648.
-
- * src/base/ftobjs.c (FT_Done_Library): Specify the order of font
- drivers during the face closing process. Type42 faces should be
- closed before TrueType faces, because a Type42 face refers to
- another internal TrueType face which is created from sfnt[] array on
- the memory.
-
-2010-08-06 Yuriy Kaminskiy <yumkam@mail.ru>
-
- [raster] Fix valgrind warning.
-
- * src/raster/ftraster.c (Decompose_Curve) <default>: Access point[0]
- only if we don't hit `limit'.
-
-2010-08-06 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix Savannah bug #30658.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Check that the total
- length of collected POST segments does not overrun the allocated
- buffer.
-
-2010-08-06 Yuriy Kaminskiy <yumkam@mail.ru>
-
- Fix conditional usage of FT_MulFix_i386.
- With -ansi flag, gcc does not define `i386', only `__i386__'.
-
- * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in:
- s/i386/__i386__/.
-
-2010-08-05 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #30657.
-
- * src/truetype/ttinterp.c (BOUNDSL): New macro.
- Change `BOUNDS' to `BOUNDSL' where appropriate.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): Fix type of
- `cvtSize'.
-
-2010-08-05 Werner Lemberg <wl@gnu.org>
-
- [type42] Fix Savannah bug #30656.
-
- * src/type42/t42parse.c (t42_parse_sfnts): Protect against negative
- string_size.
- Fix comparison.
-
-2010-08-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cff] Don't use any values in decoder after parsing error.
-
- * src/cff/cffgload.c (cff_slot_load): Skip the evaluations
- of the values in decoder, if `cff_decoder_parse_charstrings'
- returns any error.
-
-2010-08-04 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #30644.
-
- * src/base/ftstream.c (FT_Stream_EnterFrame): Fix comparison.
-
-2010-08-04 Werner Lemberg <wl@gnu.org>
-
- `make devel' fails if FT_CONFIG_OPTION_OLD_INTERNALS is set.
-
- * devel/ftoption.h: Synchronize with
- include/freetype/config/ftoption.h.
-
-2010-08-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cff] Improve stack overflow test.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Check stack
- after execution of operations too.
-
-2010-07-18 Werner Lemberg <wl@gnu.org>
-
- Add reference counters and to FT_Library and FT_Face objects.
-
- * include/freetype/freetype.h (FT_Reference_Face): New function.
- * include/freetype/ftmodapi.h (FT_Reference_Library): New function.
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec,
- FT_LibraryRec): New field `refcount'.
-
- * src/base/ftobjs.c (FT_Open_Face, FT_New_Library): Handle
- `refcount'.
- (FT_Reference_Face, FT_Reference_Library): Implement new functions.
- (FT_Done_Face, FT_Done_Library): Handle `refcount'.
-
- * docs/CHANGES: Updated.
-
-2010-07-18 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.1 released.
- =========================
-
-
- Tag sources with `VER-2-4-1'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.1.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.0/2.4.1/, s/240/241/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
- * builds/unix/configure.raw (version_info): Set to 11:1:5.
-
-2010-07-17 Werner Lemberg <wl@gnu.org>
-
- [cff] Final try to fix `hintmask' and `cntrmask' limit check.
-
- Problem reported by Tobias Wolf <towolf@gmail.com>.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_hintmask>: Sigh. I'm apparently too silly to fix this
- correctly in less than three tries.
-
-2010-07-12 Werner Lemberg <wl@gnu.org>
-
- * Version 2.4.0 released.
- =========================
-
-
- Tag sources with `VER-2-4-0'.
-
- * docs/CHANGES: Updated.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.4.0.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.3.12/2.4.0/, s/2312/240/.
-
- * include/freetype/freetype.h (FREETYPE_MINOR): Set to 4.
- (FREETYPE_PATCH): Set to 0.
-
- * builds/unix/configure.raw (version_info): Set to 11:0:5.
-
-2010-07-12 Werner Lemberg <wl@gnu.org>
-
- Remove C++ warnings.
-
- */*: Initialize pointers where necessary to make g++ happy.
-
-2010-07-12 malc <av1474@comtv.ru>
- Richard Henderson <rth@redhat.com>
-
- Fix type-punning issues with C++.
-
- * include/freetype/internal/ftmemory.h (FT_ASSIGNP) [__cplusplus]:
- Emulate a `typeof' operator with an inline template which uses
- `static_cast'.
-
-2010-07-11 Werner Lemberg <wl@gnu.org>
-
- Fix C++ compilation issue.
-
- * src/tools/apinames.c (names_dump) <OUTPUT_WATCOM_LBC>: Fix
- type of `dot' variable.
-
-2010-07-10 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix another case reported in Savannah bug #30373.
- Permit a face for Type1, Type42 and CFF without charmap,
- patch by Tor Andersson.
-
- * src/type1/t1objs.c (T1_Face_Init): Reset the error if it
- is FT_Err_No_Unicode_Glyph_Name.
- * src/type42/t42objs.c (T42_Face_Init): Ditto.
- * src/cff/cffobjs.c (cff_face_init): Ditto.
-
-2010-07-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Use defined macros to set {platform,encoding}_id.
-
- * src/bdf/bdfdrivr.c: Include ttnameid.h and use macros to
- set charmap.{platform,encoding}_id.
- * src/pcf/pcfdrivr.c: Ditto.
- * src/winfonts/winfnt.c: Ditto.
- * src/type1/t1objs.c: Ditto.
- * src/type42/t42objs.c: Ditto.
- * src/cff/cffobjs.c: Ditto.
- * src/pfr/pfrobjs.c: Ditto.
-
-2010-07-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix Savannah bug #30373.
- Too serious check of errors by `FT_CMap_New' since 2010-07-04
- is fixed. Reported by Tor Andersson.
-
- * include/freetype/fterrdef.h
- (PSnames_Err_No_Unicode_Glyph_Name): New error code to
- indicate the Unicode charmap synthesis failed because
- no Unicode glyph name is found.
-
- * src/psnames/psmodule.c (ps_unicodes_init): Return
- PSnames_Err_No_Unicode_Glyph_Name when no Unicode glyph name
- is found in the font.
- * src/cff/cffcmap.c (cff_cmap_unicode_init): Return
- CFF_Err_No_Unicode_Glyph_Name when no SID is available.
-
- * src/type1/t1objs.c (T1_Face_Init): Proceed if `FT_CMap_New'
- is failed by the lack of Unicode glyph name.
- * src/type42/t42objs.c (T42_Face_Init): Ditto.
- * src/cff/cffobjs.c (cff_face_init): Ditto.
-
-2010-07-09 Ken Sharp <ken.sharp@artifex.com>
-
- Make ftraster.c compile in stand-alone mode with MSVC compiler.
-
- * src/raster/ftmisc.h (FT_Int64) [_WIN32, _WIN64]: Fix typedef
- since there is no `inttypes.h' for MSVC.
-
-2010-07-08 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #30361.
-
- * src/truetype/ttinterp.c (Ins_IUP): Fix bounds check.
-
-2010-07-06 Werner Lemberg <wl@gnu.org>
-
- Pacify compiler.
-
- * src/cff/cffload.c (cff_index_get_pointers): Initialize
- `new_bytes'.
-
-2010-07-05 Eugene A. Shatokhin <spectre@ispras.ru>
-
- Fix Savannah bug #27648.
-
- * src/base/ftobjs.c (ft_remove_renderer, FT_Add_Module): Call
- `raster_done' only if we have an outline glyph format.
-
-2010-07-05 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #30030.
-
- * builds/win32/*/freetype.vcproj: Add ftxf86.c.
-
-2010-07-05 Werner Lemberg <wl@gnu.org>
-
- [cff] Next try to fix `hintmask' and `cntrmask' limit check.
-
- Problem reported by malc <av1474@comtv.ru>.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_hintmask>: It is possible that there is just a single byte
- after the `hintmask' or `cntrmask', e.g., a `return' instruction.
-
-2010-07-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Restrict the number of the charmaps in a rogue-compatible mode.
- Fix for Savannah bug #30059.
-
- * src/cache/ftccmap.c (FTC_CMapCache_Lookup): Replace `16' the
- minimum character code passed by a legacy rogue client by...
- * include/freetype/config/ftoption.h (FT_MAX_CHARMAP_CACHEABLE):
- This. It is undefined when FT_CONFIG_OPTION_OLD_INTERNALS is
- undefined (thus the rogue client compatibility is not required).
-
- * src/cff/cffobjs.c (cff_face_init): Abort the automatic
- selection or synthesis of Unicode cmap subtable when the charmap
- index exceeds FT_MAX_CHARMAP_CACHEABLE.
- * src/sfnt/ttcmap.c (tt_face_build_cmaps): Issue error message
- when the charmap index exceeds FT_MAX_CHARMAP_CACHEABLE.
-
- * src/base/ftobjs.c (find_unicode_charmap): When Unicode charmap
- is found after FT_MAX_CHARMAP_CACHEABLE, ignore it and search
- earlier one.
- (find_variant_selector_charmap): When UVS charmap is found after
- FT_MAX_CHARMAP_CACHEABLE, ignore it and search earlier one.
- (FT_Select_Charmap): When a charmap matching with requested
- encoding but after FT_MAX_CHARMAP_CACHEABLE, ignore and search
- earlier one.
- (FT_Set_Charmap): When a charmap matching with requested
- charmap but after FT_MAX_CHARMAP_CACHEABLE, ignore and search
- earlier one.
- (FT_Get_Charmap_Index): When a requested charmap is found
- after FT_MAX_CHARMAP_CACHEABLE, return the inverted charmap
- index.
-
-2010-07-04 Werner Lemberg <wl@gnu.org>
-
- TrueType hinting is no longer patented.
-
- * include/freetype/config/ftoption.h, devel/ftoption.h
- (TT_CONFIG_OPTION_BYTECODE_INTERPRETER): Define.
- (TT_CONFIG_OPTION_UNPATENTED_HINTING): Undefine.
-
- * docs/CHANGES, docs/INSTALL, include/freetype/freetype.h: Updated.
- * docs/TRUETYPE, docs/PATENTS: Removed.
-
-2010-07-04 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Check error value by `FT_CMap_New'.
-
- * src/cff/cffobjs.c (cff_face_init): Check error value by
- `FT_CMap_New'.
- * src/pfr/pfrobjs.c (pfr_face_init): Ditto.
- * src/type1/t1objs.c (T1_Face_Init): Ditto.
- * src/type42/t42objs.c (T42_Face_Init): Ditto.
-
-2010-07-03 Werner Lemberg <wl@gnu.org>
-
- Make ftgrays.c compile stand-alone again.
-
- * src/smooth/ftgrays.c [_STANDALONE_]: Include `stddef.h'.
- (FT_INT_MAX, FT_PtrDist)[_STANDALONE_]: Define.
-
-2010-07-02 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Additional fix for Savannah bug #30306.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): If the type of the
- POST fragment is 0, the segment is completely ignored. The declared
- length of the segment is not cared at all. According to Adobe
- Technical Note 5040, type 0 segment is a comment only and should not
- be loaded for the interpreter. Reported by Robert Święcki.
-
-2010-07-01 Werner Lemberg <wl@gnu.org>
-
- [truetype] Protect against code range underflow.
-
- * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF): Don't allow
- negative IP values.
-
-2010-07-01 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add rudimentary tracing for bytecode instructions.
-
- * src/truetype/ttinterp.c (opcode_name) [FT_DEBUG_LEVEL_TRACE]: New
- array.
- (TT_RunIns): Trace opcodes.
-
-2010-06-30 Werner Lemberg <wl@gnu.org>
-
- [smooth] Fix Savannah bug #30263.
-
- * src/smooth/ftgrays.c (gray_render_span): Use cast to `unsigned
- int' to avoid integer overflow.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Use smaller
- threshold values for `width' and `height'. This is not directly
- related to the bug fix but makes sense anyway.
-
-2010-07-01 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Initial fix for Savannah bug #30306.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Check `rlen', the
- length of fragment declared in the POST fragment header, and prevent
- an underflow in length calculation. Some fonts set the length to
- zero in spite of the existence of a following 16bit `type'.
- Reported by Robert Święcki.
-
-2010-07-01 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Additional fix for Savannah bug #30248 and #30249.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the buffer size
- during gathering PFB fragments embedded in LaserWriter PS font for
- Macintosh. Reported by Robert Święcki.
-
-2010-06-30 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Minor optimizations by avoiding divisions.
-
- * src/sfnt/ttkern.c (tt_face_load_kern, tt_face_get_kerning):
- Replace divisions with multiplication in comparisons.
-
-2010-06-29 Werner Lemberg <wl@gnu.org>
-
- Fix minor tracing issues.
-
- * src/cff/cffgload.c, src/truetype/ttgload.c: Adjust tracing levels.
-
-2010-06-27 Werner Lemberg <wl@gnu.org>
-
- [cff] Really fix `hintmask' and `cntrmask' limit check.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_hintmask>: Fix thinko and handle tracing also.
-
-2010-06-27 Werner Lemberg <wl@gnu.org>
-
- Fix valgrind warning.
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Initialize
- `result' array.
-
-2010-06-27 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix memory leak.
-
- * src/cff/cffgload.c (cff_operator_seac): Free charstrings even in
- case of errors.
-
-2010-06-27 Werner Lemberg <wl@gnu.org>
-
- [cff] Protect against invalid `hintmask' and `cntrmask' operators.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_hintmask>: Ensure that we don't exceed `limit' while parsing
- the bit masks of the `hintmask' and `cntrmask' operators.
-
-2010-06-26 Werner Lemberg <wl@gnu.org>
-
- Fix PFR change 2010-06-24.
-
- * src/pfr/pfrgload.c (pfr_glyph_load_simple): Really protect against
- invalid indices.
-
-2010-06-26 Werner Lemberg <wl@gnu.org>
-
- Improve PFR tracing messages.
-
- * src/pfr/pfrgload.c (pfr_glyph_load_rec): Emit tracing messages for
- simple and compound glyph offsets.
-
-2010-06-26 Werner Lemberg <wl@gnu.org>
-
- Fix last PFR change.
-
- * src/pfr/pfrobjs.c (pfr_face_init): Fix rejection logic.
-
-2010-06-26 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #30262.
-
- * src/sfnt/ttload.c (tt_face_load_maxp): Limit `maxComponentDepth'
- arbitrarily to 100 to avoid stack exhaustion.
-
-2010-06-26 Werner Lemberg <wl@gnu.org>
-
- Add some memory checks (mainly for debugging).
-
- * src/base/ftstream.c (FT_Stream_EnterFrame): Exit with error
- if the frame size is larger than the stream size.
-
- * src/base/ftsystem.c (ft_ansi_stream_io): Exit with error if
- seeking a position larger than the stream size.
-
-2010-06-25 Werner Lemberg <wl@gnu.org>
-
- [pfr] Fix Savannah bug #30261.
-
- * src/pfr/pfrobjs.c (pfr_face_init): Reject fonts which contain
- neither outline nor bitmap glyphs.
-
-2010-06-25 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #30254.
-
- * src/cff/cffload.c (cff_index_get_pointers): Do sanity check for
- first offset also.
-
-2010-06-25 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Initial fix for Savannah bug #30248 and #30249.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Check the error during
- reading a PFB fragment embedded in LaserWriter PS font for Macintosh.
- Reported by Robert Święcki.
-
-2010-06-24 Werner Lemberg <wl@gnu.org>
-
- [pcf] Fix Savannah bug #30247.
-
- * src/pcf/pcfread.c (pcf_get_metrics): Disallow (invalid) fonts with
- zero metrics.
-
-2010-06-24 Graham Asher <graham.asher@btinternet.com>
-
- * src/smooth/ftgrays.c (gray_render_cubic): Fix algorithm.
- The previous version was too aggressive, as demonstrated in
- https://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00020.html.
-
-2010-06-24 Werner Lemberg <wl@gnu.org>
-
- */*: Use module specific error names where appropriate.
-
-2010-06-24 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #30236.
-
- * src/sfnt/ttcmap.c (tt_face_build_cmaps): Improve check for pointer
- to `cmap_table'.
-
-2010-06-24 Werner Lemberg <wl@gnu.org>
-
- [pfr] Fix Savannah bug #30235.
-
- * src/pfr/pfrgload.c (pfr_glyph_load_simple): Protect against
- invalid indices if there aren't any coordinates for indexing.
-
-2010-06-24 Werner Lemberg <wl@gnu.org>
-
- [bdf]: Font properties are optional.
-
- * src/bdf/bdflib.c (_bdf_readstream): Use special error code to
- indicate a redo operation.
- (_bdf_parse_start): Handle `CHARS' keyword here too and pass current
- input line to `_bdf_parse_glyph'.
-
-2010-06-23 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #30220.
-
- * include/freetype/fterrdef.h
- (BDF_Err_Missing_Fontboundingbox_Field): New error code.
-
- * src/bdf/bdflib.c (_bdf_parse_start): Check for missing
- `FONTBOUNDINGBOX' field.
- Avoid memory leak if there are multiple `FONT' lines (which is
- invalid but doesn't hurt).
-
-2010-06-21 Werner Lemberg <wl@gnu.org>
-
- [pfr] Fix Savannah bug #30168.
-
- * src/pfr/pfrgload.c (pfr_glyph_load_compound): Limit the number of
- subglyphs to avoid endless recursion.
-
-2010-06-20 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix Savannah bug #30145.
-
- * src/psaux/psobjs.c (t1_builder_add_contour): Protect against
- `outline == NULL' which might happen in invalid fonts.
-
-2010-06-19 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #30135.
-
- * src/bdf/bdflib.c (_bdf_list_join): Don't modify value in static
- string `empty'.
- (_bdf_parse_glyph): Avoid memory leak in case of error.
-
-2010-06-15 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix Savannah bug #30108.
-
- * src/autofit/afglobal.c (af_face_globals_compute_script_coverage):
- Properly mask AF_DIGIT bit in comparison.
-
-2010-06-11 Werner Lemberg <wl@gnu.org>
-
- [pshinter] Fix Savannah bug #30106.
-
- Point numbers for FreeType's implementation of hinting masks are
- collected before the final number of points of a glyph has been
- determined; in particular, the code for handling the `endchar'
- opcode can reduce the number of points.
-
- * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Assure that
- `end_point' is not larger than `glyph->num_points'.
-
-2010-06-11 Werner Lemberg <wl@gnu.org>
-
- [cff]: Improve debugging output.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_hintmask>: Implement it.
-
-2010-06-10 Graham Asher <graham.asher@btinternet.com>
-
- ftgrays: Speed up rendering of small cubic splines.
-
- * src/smooth/ftgrays.c (gray_render_cubic): Implement new,
- simplified algorithm to find out whether the spline can be replaced
- with two straight lines. See this thread for more:
-
- https://lists.gnu.org/archive/html/freetype-devel/2010-06/msg00000.html
-
-2010-06-09 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #30082.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_callothersubr>: Protect against stack underflow.
-
-2010-06-08 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #30053.
-
- * src/cff/cffparse.c (cff_parse_real): Handle border case where
- `fraction_length' has value 10.
-
-2010-06-07 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #30052.
- This bug has been introduced with commit 2415cbf3.
-
- * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Protect
- against endless loop in case of corrupted font header data.
-
-2010-05-26 Werner Lemberg <wl@gnu.org>
-
- Remove unused variable.
- Found by Graham.
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Remove unused
- variable `first' in first block.
-
-2010-05-22 Werner Lemberg <wl@gnu.org>
-
- Fix various memory problems found by linuxtesting.org.
-
- * src/base/ftgxval.c (FT_TrueTypeGX_Free, FT_ClassicKern_Free),
- src/base/ftotval.c (FT_OpenType_Free), src/base/ftpfr.c
- (ft_pfr_check): Check `face'.
-
- * src/base/ftobjs.c (FT_Get_Charmap_Index): Check `charmap' and
- `charmap->face'.
- (FT_Render_Glyph): Check `slot->face'.
- (FT_Get_SubGlyph_Info): Check `glyph->subglyphs'.
-
-2010-05-22 Werner Lemberg <wl@gnu.org>
-
- autofit: Remove dead code.
- Suggested by Graham.
-
- * src/autofit/afhints.c (af_glyph_hints_compute_inflections):
- Removed.
- (af_glyph_hints_reload): Remove third argument.
- Update all callers.
-
-2010-05-21 Bram Tassyns <bramt@enfocus.be>
-
- [cff] Fix Savannah bug #27987.
-
- * src/cff/cffobjs.c (remove_subset_prefix): New function.
- (cff_face_init): Use it to adjust `cffface->family_name'.
-
-2010-05-20 Werner Lemberg <wl@gnu.org>
-
- TrueType: Make FreeType ignore maxSizeOfInstructions in `maxp'.
-
- Acroread does the same.
-
- * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Call
- `Update_Max' to adjust size of instructions array if necessary and
- add a rough safety check.
-
- (load_truetype_glyph): Save `loader->byte_len' before recursive
- call.
-
- * src/truetype/ttinterp.h, src/truetype/ttinterp.c (Update_Max):
- Declare it as FT_LOCAL.
-
-2010-05-18 Hongbo Ni <hongbo@njstar.com>
-
- Apply Savannah patch #7196.
-
- * src/cff/cffgload.c (cff_slot_load): Prevent crash if CFF subfont
- index is out of range.
-
-2010-05-11 Werner Lemberg <wl@gnu.org>
-
- * docs/formats.txt: Give pointer to PCF documentation.
- Information provided by Alan Coopersmith
- <alan.coopersmith@oracle.com>.
-
-2010-05-10 Ken Sharp <ken.sharp@artifex.com>
-
- [psaux] Fix Savannah bug #29846.
-
- Previously we discovered fonts which used `setcurrentpoint' to set
- the initial point of a contour to 0,0. This caused FreeType to
- raise an error, because the `setcurrentpoint' operator is only
- supposed to be used with the results from an OtherSubr subroutine.
-
- This was fixed by simply ignoring the error and carrying on.
-
- Now we have found a font which uses setcurrentpoint to actually
- establish a non-zero point for a contour during the course of a
- glyph program. FWIW, these files may be produced by an application
- called `Intaglio' on the Mac, when converting TrueType fonts to
- Type 1.
-
- The fix allows the new invalid behaviour, the old invalid behaviour
- and real proper usage of the operator to work the same way as Adobe
- interpreters apparently do.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Make
- `setcurrentpoint' use the top two elements of the stack to establish
- unconditionally the current x and y coordinates.
-
- Make the `flex' subroutine handling (OtherSubr 0) put the current
- x,y coordinates onto the stack, instead of two dummy uninitialised
- values.
-
-2010-04-14 Ken Sharp <ken.sharp@artifex.com>
-
- [psaux] Fix Savannah bug #29444.
-
- * src/psaux/psobjs.c (t1_builder_start_point): Accept (invalid)
- `lineto' immediately after `hsbw', in accordance with Acrobat, GS,
- and others.
-
-2010-04-14 Michał Cichoń <thedmd@artifexmundi.com>
-
- [psaux] Fix Savannah bug #27999.
-
- * src/cache/ftcmanag.c (FTC_Manager_RemoveFaceID): Only remove
- selected entry, not all.
-
-2010-04-06 Jonathan Kew <jfkthame@gmail.com>
-
- [truetype] Add overflow check to `fvar' table.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Check axis and instance
- count.
-
-2010-04-05 Ken Sharp <ken.sharp@artifex.com>
-
- [raster] Fix Savannah bug #29335.
-
- * src/raster/ftraster.c (Line_Up): Use slow multiplication to
- prevent overflow. This shouldn't have any serious impact on speed,
- however.
-
-2010-04-05 Werner Lemberg <wl@gnu.org>
-
- Add new function `FT_Library_SetLcdFilterWeights'.
-
- This is based on code written by Lifter
- <https://unixforum.org/index.php?showuser=11691>. It fixes
- FreeDesktop bug #27386.
-
- * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): New
- function.
-
- * include/freetype/ftlcdfil.h: Updated.
-
- * docs/CHANGES: Updated.
-
-2010-04-01 John Tytgat <John.Tytgat@esko.com>
-
- [truetype] Fix Savannah bug #29404.
-
- * src/truetype/ttgload.c: Revert change 2752bd1a (check on bit 1
- of `head' table of TrueType fonts).
-
-2010-03-14 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix `multi build' for Tytgat's CFF driver improvement.
-
- * src/base/cffload.h (cff_index_get_name): Added.
-
-2010-03-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Remove duplicated inclusion of `FT_OUTLINE_H' in ftobjs.c.
-
- * src/base/ftobjs.c: Remove 2nd inclusion of `FT_OUTLINE_H'.
-
-2010-03-11 Chris Liddell <chris.liddell@artifex.com>
-
- [raster] Fix Savannah bug #27442.
-
- * src/raster/ftraster.c (ft_black_reset): Fix `buffer_size'.
-
-2010-03-09 Werner Lemberg <wl@gnu.org>
-
- [cff] Remove unused variable.
- Reported by Graham.
-
- * src/cff/cffparse.c (cff_parse_real): Remove `rest'.
-
-2010-03-02 John Tytgat <John.Tytgat@esko.com>
-
- [cff] Improve CFF string (especially glyphname) lookup performance.
-
- We do this by avoiding memory allocation and file I/O. This is
- Savannah patch #7104.
-
- * src/cff/cfftypes.h: Include PS cmaps service and
- FT_INTERNAL_POSTSCRIPT_HINTS_H.
- (CFF_SubFontRec): Remove `num_local_subrs'.
- (CFF_FontRec): Add `num_strings', `strings', and `string_pool'
- fields.
- Remove `string_index' and `num_global_subrs' fields.
- Use real types instead of `void' for `pshinter' and `psnames' fields.
-
- * src/cff/cffload.c: Don't include PS cmaps service.
- (cff_index_get_pointers): Add `pool' parameter which allows inserting
- an extra NUL character for each String INDEX entry.
- (cff_index_get_name): Make it a local function.
- (cff_index_get_string): New function.
- (cff_subfont_load): Updated.
- (cff_font_load): Initialize `num_strings', `strings', and
- `string_pool' fields in the `CFF_FontRec' structure.
- (cff_index_get_sid_string): Use `cff_index_get_string' instead of
- `cff_index_get_name'.
- (cff_font_done): Updated.
-
- * src/cff/cffload.h: Don't include PS cmaps service.
- (cff_index_get_string): Added.
- (cff_index_get_sid_string): Updated.
-
- * src/cff/cffobjs.c: Don't include PS cmaps service and
- FT_INTERNAL_POSTSCRIPT_HINTS_H.
- (cff_size_get_globals_funcs, cff_slot_init): Updated.
- (cff_face_init): Follow `cff_index_get_name',
- `cff_index_get_string', and `cff_index_get_sid_string' changes.
-
- * src/cff/cffcmap.c (cff_sid_free_glyph_name): Removed.
- (cff_sid_to_glyph_name): Use `cff_index_get_cid_string'.
- (cff_cmap_unicode_init): Updated.
-
- * src/cff/cffdrivr.c: Don't include PS cmap service.
- (cff_get_glyph_name): Avoid unnecessary lookup for POSTSCRIPT_CMAPS
- service.
- (cff_get_glyph_name, cff_ps_get_font_info, cff_get_ros): Follow API
- `cff_index_get_sid_string' change.
- (cff_get_name_index): Use `cff_index_get_string' instead of
- `cff_index_get_name'.
-
- * src/cff/cffgload.c: Don't include FT_INTERNAL_POSTSCRIPT_HINTS_H.
- (cff_decoder_init, cff_decoder_prepare): Updated.
-
-2010-02-27 Werner Lemberg <wl@gnu.org>
-
- Simplify code.
- Suggested by Behdad.
-
- * src/base/ftobjs.c (FT_Get_First_Char): Don't use a loop since we
- call FT_Get_Next_Char anyway if necessary.
-
-2010-02-26 Behdad Esfahbod <behdad@behdad.org>
-
- Improve handling of invalid glyph indices in char->index functions.
-
- * src/base/ftobjs.c (FT_Get_First_Char, FT_Get_Next_Char): Use a
- loop.
-
-2010-02-18 Chris Liddell <chris.liddell@artifex.com>
-
- [truetype] Fix Savannah bug #28905.
-
- Initialize phantom points before calling the incremental interface
- to update glyph metrics.
-
- * src/truetype/ttgload.c (tt_get_metrics_incr_overrides)
- [FT_CONFIG_OPTION_INCREMENTAL]: New function, split off from...
- (tt_get_metrics): This.
- Updated.
- (load_truetype_glyph): Use tt_get_metrics_incr_overrides.
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2010-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/ChangeLog.25 b/freetype/ChangeLog.25
deleted file mode 100644
index 6e04427e..00000000
--- a/freetype/ChangeLog.25
+++ /dev/null
@@ -1,5161 +0,0 @@
-2014-12-30 Werner Lemberg <wl@gnu.org>
-
- * Version 2.5.5 released.
- =========================
-
-
- Tag sources with `VER-2-5-5'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.5.5.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.5.4/2.5.5/, s/254/255/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
-
- * builds/unix/configure.raw (version_info): Set to 17:4:11.
- * CMakeLists.txt (VERSION_PATCH): Set to 5.
- * docs/CHANGES: Updated.
-
- * builds/toplevel.mk (dist): Fix typos.
-
-2014-12-24 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Formatting and nanooptimizations.
-
- * src/base/ftcalc.c,
- * src/base/fttrigon.c: Revise sign restoration.
-
-2014-12-13 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfread.c (pcf_read_TOC): Improve fix from 2014-12-08.
-
-2014-12-11 Werner Lemberg <wl@gnu.org>
-
- * builds/toplevel.mk (dist): Use older POSIX standard for `tar'.
-
- Apparently, BSD tar isn't capable yet of handling POSIX-1.2001
- (contrary to GNU tar), so force the POSIX-1.1988 format.
-
- Problem reported by Stephen Fisher <sfisher@SDF.ORG>.
-
-2014-12-11 Werner Lemberg <wl@gnu.org>
-
- * src/type42/t42parse.c (t42_parse_sfnts): Reject invalid TTF size.
-
-2014-12-11 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix off-by-one check.
-
- Problem reported by Dennis Felsing <dennis@felsin9.de>.
-
-2014-12-11 Werner Lemberg <wl@gnu.org>
-
- * src/type42/t42parse.c (t42_parse_sfnts): Check `string_size'.
-
- Problem reported by Dennis Felsing <dennis@felsin9.de>.
-
-2014-12-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [gxvalid] Fix a naming convention conflicting with ftvalid.
-
- See previous changeset for otvalid.
-
- * src/gxvalid/{gxvcommn.h, gxvmort.h, gxvmorx.h}: Replace
- `valid' by `gxvalid'.
- * src/gxvalid/{gxvbsln.c, gxvcommn.c, gxvfeat.c, gxvjust.c,
- gxvkern.c, gxvlcar.c, gxvmort.c, gxvmort0.c, gxvmort1.c,
- gxvmort2.c, gxvmort4.c, gxvmort5.c, gxvmorx.c, gxvmorx0.c,
- gxvmorx1.c, gxvmorx2.c, gxvmorx4.c, gxvmorx5.c, gxvopbd.c,
- gxvprop.c, gxvtrak.c}: Replace `valid' by `gxvalid' if
- it is typed as GXV_Validator.
-
-2014-12-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [otvalid] Fix a naming convention conflicting with ftvalid.
-
- Some prototypes in ftvalid.h use `valid' for the variables
- typed as FT_Validator. Their implementations in src/base/
- ftobjs.c and utilizations in src/sfnt/ttcmap.c do similar.
-
- Some macros in otvcommn.h assume the exist of the variable
- `valid' typed as OTV_Validator in the caller.
-
- Mixing these two conventions cause invalid pointer conversion
- and unexpected SEGV in longjmp. To prevent it, all variables
- typed as OTV_Validator are renamed to `otvalid'.
-
- * src/otvalid/otvcommn.h: Replace `valid' by `otvalid'.
- * src/otvalid/{otvcommn.c, otvbase.c, otvgdef.c, otvgpos.c,
- otvgsub.c, otvjstf.c, otvmath.c}: Replace `valid' by `otvalid'
- if it is typed as OTV_Validator.
-
-2014-12-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [ftvalid] Introduce FT_THROW() in FT_INVALID_XXX macros.
-
- Original patch is designed by Werner Lemberg. Extra part
- for otvalid and gxvalid are added by suzuki toshiya, see
- discussion:
- https://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00002.html
- https://lists.nongnu.org/archive/html/freetype-devel/2014-12/msg00007.html
-
- * include/internal/ftvalid.h: Introduce FT_THROW() in FT_INVALID_().
- * src/gxvalid/gxvcommn.h: Ditto.
- * src/otvalid/otvcommn.h: Ditto.
-
-2014-12-08 Werner Lemberg <wl@gnu.org>
-
- [pcf] Fix Savannah bug #43774.
-
- Work around `features' of X11's `pcfWriteFont' and `pcfReadFont'
- functions. Since the PCF format doesn't have an official
- specification, we have to exactly follow these functions' behaviour.
-
- The problem was unveiled with a patch from 2014-11-06, fixing issue
- #43547.
-
- * src/pcf/pcfread.c (pcf_read_TOC): Don't check table size for last
- element. Instead, assign real size.
-
-2014-12-07 Werner Lemberg <wl@gnu.org>
-
- Work around a bug in Borland's C++ compiler.
-
- See
-
- http://qc.embarcadero.com/wc/qcmain.aspx?d=118998
-
- for Borland's bug tracker entry.
-
- Reported by Yuliana Zigangirova <zigangirova@inbox.ru>,
- https://lists.gnu.org/archive/html/freetype-devel/2014-04/msg00001.html.
-
- * include/internal/ftvalid.h (FT_ValidatorRec), src/smooth/ftgrays.c
- (gray_TWorker_): Move `ft_jmp_buf' field to be the first element.
-
-2014-12-07 Werner Lemberg <wl@gnu.org>
-
- */*: Decorate hex constants with `U' and `L' where appropriate.
-
-2014-12-07 Werner Lemberg <wl@gnu.org>
-
- [truetype] Prevent memory leak for buggy fonts.
-
- * src/truetype/ttobjs.c (tt_size_done): Unconditionally call
- `tt_size_done_bytecode'.
-
-2014-12-06 Werner Lemberg <wl@gnu.org>
-
- * Version 2.5.4 released.
- =========================
-
-
- Tag sources with `VER-2-5-4'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.5.4.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.5.3/2.5.4/, s/253/254/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
-
- * builds/unix/configure.raw (version_info): Set to 17:3:11.
- * CMakeLists.txt (VERSION_PATCH): Set to 4.
- * docs/CHANGES: Updated.
-
-2014-12-04 Werner Lemberg <wl@gnu.org>
-
- docs/CHANGES: Updated, formatted.
-
-2014-12-04 Dave Arnold <darnold@adobe.com>
-
- [cff] Modify an FT_ASSERT.
-
- * src/cff/cf2hints.c (cf2_hintmap_map): After the fix for Savannah
- bug #43661, the test font `...aspartam.otf' still triggers an
- FT_ASSERT. Since hintmap still works with count==0, ...
- (cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): ... add that term to
- suppress the assert.
-
-2014-12-04 Dave Arnold <darnold@adobe.com>
-
- [cff] Fix Savannah bug #43661.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,
- cf2_cmdVSTEM, cf2_cmdHINTMASK>: Don't append to stem arrays after
- hintmask is constructed.
-
- * src/cff/cf2hints.c (cf2_hintmap_build): Add defensive code to
- avoid reading past end of hintmask.
-
-2014-12-03 Werner Lemberg <wl@gnu.org>
-
- docs/CHANGES: Updated.
-
-2014-12-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Better fix for conversion specifiers in debug messages.
-
- Using `%ld' for pointer differences causes warnings on 32bit
- platforms. The correct type would be (the relatively new) `%td',
- however, this is missing on some important platforms.
-
- This patch improves the change from 2014-11-28.
-
- * src/autofit/afhints.c (AF_INDEX_NUM): Use `int' typecast. Our
- pointer differences are always sufficiently small.
- (af_glyph_hints_dump_points, af_glyph_hints_dump_segments,
- af_glyph_hints_dump_edge): Revert to `%d' and use `AF_INDEX_NUM'.
-
-2014-12-03 Werner Lemberg <wl@gnu.org>
-
- FT_Sfnt_Tag: s/ft_sfnt_xxx/FT_SFNT_XXX/ for orthogonality.
-
- All public FreeType enumeration and flag values are uppercase...
-
- * include/tttables.h (FT_Sfnt_Tag): Implement it. For backward
- compatibility, retain the old values as macros.
-
- * src/base/ftfstype.c (FT_Get_FSType_Flags), src/sfnt/sfdriver.c
- (get_sfnt_table): Updated.
-
-2014-12-02 Werner Lemberg <wl@gnu.org>
-
- * include/*: Improve structure of documentation.
-
- . Add and update many `<Order>' tags.
- . Apply various documentation fixes.
- . Remove details to deprecated (or never implemented) data.
-
-2014-12-02 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Always handle `<Order>' section elements.
-
- Previously, those elements were handled only for sections present in
- a `<Sections>' chapter element.
-
- * src/tools/docmaker/content.py (ContentProcessor::finish):
- Implement it.
-
-2014-12-02 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Properly handle empty rows in Synopsis.
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit
- `&nbsp;' for empty fields.
-
-2014-12-02 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Thinko.
-
- * src/tools/docmaker/content.py (DocBlock::get_markup_words_all):
- Emit `/empty/' string for first element also.
-
-2014-12-02 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Honour empty lines in `<Order>' section element.
-
- This greatly improves the readability of the `Synopsis' links.
-
- * src/tools/docmaker/content.py (DocBlock::get_markup_words_all):
- Insert string `/empty/' between items.
-
- * src/tools/docmaker/formatter.py (Formatter::section_dump): Make it
- robust against nonexistent keys.
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Emit
- empty <td> elements for `/empty/'.
-
-2014-12-02 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Ensure Python 3 compatibility.
-
- * src/tools/docmaker/content.py (ContentProcessor::set_section,
- ContentProcessor::finish): Replace `has_key' function with `in'
- keyword.
-
- * src/tools/docmaker/formatter.py (Formatter::__init__): Replace
- sorting function with a key generator.
- (Formatter::add_identifier): Replace `has_key' function with `in'
- keyword.
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter::html_source_quote):
- Replace `has_key' function with `in' keyword.
- (HtmlFormatter::index_exit, HtmlFormatter::section_enter): Use
- integer division.
- s/<>/>/.
-
- * src/tools/docmaker/utils.py: Import `itertools'.
- (index_sort): Replaced by...
- (index_key): ... this new key generator (doing exactly the same).
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Don't output a block multiple times.
-
- This bug was hidden by not processing all lines of `<Order>' blocks.
-
- * src/tools/docmaker/formatter.py (Formatter::section_dump): Filter
- out field names.
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Use field values as HTML link targets where possible.
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter::make_block_url):
- Accept second, optional argument to specify a name.
- (HtmlFormatter::html_source_quote): Link to field ID if possible.
- (HtmlFormatter::print_html_field_list): Emit `id' attribute.
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Allow empty lines in `<Order>' blocks.
-
- Before this patch, the suggested order of entries stopped at the
- first empty line.
-
- Obviously, nobody noticed that this problem caused a much reduced
- set of links in the `Synopsis' sections; in particular, the
- `<Order>' blocks contain a lot of entries that wouldn't be listed
- otherwise...
-
- * src/tools/docmaker/content.py (DocBlock::get_markup_words_all):
- New function to iterate over all items.
- (DocSection::process): Use it.
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/sources.py (column) [Format 2]: Fix regexp.
-
- After the single asterisk there must be no other immediately following
- asterisk.
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: Improve CSS for vertical spacing.
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Improve HTML code for table of contents.
-
- * src/tools/docmaker/tohtml.py: Introduce a new table class `toc',
- together with proper CSS.
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Provide higher-level markup and simplify HTML.
-
- * src/tools/docmaker/tohtml.py: Instead of using extraneous `<div>'
- elements, use CSS descendants (of class `section') to format the
- data.
-
- Also remove redundant <p> and <br> elements, replacing them with
- proper CSS.
-
- Globally reduce page width to 75%.
-
- (block_header): Rename <div> class to `section'.
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Add `top' links after blocks.
-
- * src/tools/docmaker/tohtml.py (block_footer_middle): Implement it.
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: Improve CSS for fields.
-
- Make fields align horizontally relative to full line width.
-
-2014-11-29 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: Fix index and TOC templates.
-
- This thinko was introduced 2014-11-27.
-
-2014-11-28 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Format field lists with CSS.
-
- This also simplifies the inserted HTML code.
-
- * src/tools/docmaker/tohtml.py
- (HtmlFormatter::print_html_field_list): Do it.
-
-2014-11-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix compiler warning to the comparison between signed and
- unsigned variable.
-
- * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Fix the comparison
- between `ypos + ysize' and FT_INT_{MAX,MIN}.
-
-2014-11-28 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Replace empty `<td>' with CSS.
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter::section_enter): Do
- it.
-
-2014-11-28 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Replace some `<table>' tags with `<h4>' and `<div>'.
-
- * src/tools/docmaker/tohtml.py (marker_*): Use `<h4>'.
- (source_*): Use `<div>'.
- (HtmlFormatter::block_enter): s/<h4>/<h3>/.
-
-2014-11-28 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix compiler warning to conversion specifiers in debug messages.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_points): Add length
- modifier to dump long integers.
- (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Ditto.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: Use more CSS for index.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Replace `name' attribute of `<a>' with `id'.
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter::block_enter): Do it.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: Remove remaining `width' attributes.
-
- For `Index' and `TOC' links, we now simply use the `text-align' CSS
- property of `<td>' to enforce flush-left and flush-right,
- eliminating the hack with an empty, full-width `<td>' element
- inbetween.
-
- The change also enforces the same (smaller) size for all index and
- TOC links.
-
-2014-11-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/cff/cf2font.c: Include `ftcalc.h' to use FT_MSB(),
- cf2font.c could not find it under `make multi' build.
-
-2014-11-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove
- unrequired negative value check for `width' and `height'.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: More HTML table refactoring.
-
- Replace some `<table>' tags with `<div>' to simplify structure.
-
- Move `bgcolor' attribute to CSS.
-
- Replace most `width' attributes with CSS. The remaining instances
- (providing a similar effect as LaTeX's `\hfill' command) are removed
- in a later patch.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: Replace <font> with CSS.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: Center <table> with CSS.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: Replace `<center>' with `<div>'.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/tohtml.py: Remove redundant `<center>' tags.
-
- This starts a series of commits into the direction of generating
- valid HTML 5 code, especially using much more CSS.
-
-2014-11-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Prevent too negative values (< FT_INT_MIN) in bitmap metrics,
- suggested by Alexei.
-
- * src/pfr/pfrsbit.c (pfr_slot_load_bitmap): Prevent too
- negative values in `xpos' and `ypos + ysize'.
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Prevent
- too negative values in `x_left' and `y_top'. Either negative
- values in `width' and `height' are checked.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Produce better HTML code.
-
- * src/tools/docmaker/tohtml.py: Always use double quotes for
- attribute values.
- (source_footer): Close `td' and `tr' groups.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- Use better way to disable creation of .pyc files for `make refdoc'.
-
- Python 2.6 was released in 2008...
-
- * builds/freetype.mk (refdoc): Use python's `-B' option.
-
- * builds/detect.mk (std_setup, dos_setup): Mention required python
- version for `refdoc' target.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/sources.py (re_bold, re_italic): Use
- non-grouping parentheses.
- * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word):
- Updated.
-
-2014-11-27 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Get_Glyph_Name): Fix compiler warning.
-
- Introduced in previous change. Reported by Alexei.
-
-2014-11-26 Werner Lemberg <wl@gnu.org>
-
- * src/*: Add checks for parameters of API functions where missing.
-
- `API functions' are functions tagged with `FT_EXPORT_DEF'.
-
- Besides trivial fixes, the following changes are included, too.
-
- * src/base/ftbdf.c (FT_Get_BDF_Charset_ID, FT_Get_BDF_Property): Set
- error code if no service is available.
-
- * src/base/ftinit.c (FT_Done_FreeType): Change return value for
- invalid `library' parameter to `Invalid_Library_Handle'.
-
- * src/base/ftobjs.c (FT_New_Size): Change return value for invalid
- `asize' parameter to `Invalid_Argument'.
-
- * src/base/ftoutln.c (FT_Outline_Copy): Change return value for
- invalid `source' and `target' parameters to `Invalid_Outline'.
- (FT_Outline_Done_Internal): Change return value for invalid
- `outline' parameter to `Invalid_Outline'.
-
-2014-11-26 Werner Lemberg <wl@gnu.org>
-
- * src/cache/ftcbasic.c: Use single calls to `FT_TRACE'.
-
-2014-11-26 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Additional
- overflow check in the summation of POST fragment lengths,
- suggested by Mateusz Jurczyk <mjurczyk@google.com>.
-
-2014-11-26 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Insert comments
- and fold too long tracing messages.
-
-2014-11-26 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix Savannah bug #43540.
-
- * src/base/ftmac.c (parse_fond): Prevent a buffer overrun
- caused by a font including too many (> 63) strings to store
- names[] table.
-
-2014-11-26 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Use unsigned long
- variables to read the lengths in POST fragments. Suggested by
- Mateusz Jurczyk <mjurczyk@google.com>.
-
-2014-11-26 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix Savannah bug #43539.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow
- by a broken POST table in resource-fork.
-
-2014-11-26 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix Savannah bug #43538.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Fix integer overflow
- by a broken POST table in resource-fork.
-
-2014-11-26 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): Avoid memory leak
- by a broken POST table in resource-fork. Return after freeing
- the buffered POST table when it is found to be broken.
-
-2014-11-25 Werner Lemberg <wl@gnu.org>
-
- */*: s/Invalid_Argument/Invalid_Size_Handle/ where appropriate.
-
-2014-11-25 Werner Lemberg <wl@gnu.org>
-
- */*: s/Invalid_Argument/Invalid_Stream_Handle/ where appropriate.
-
-2014-11-25 Werner Lemberg <wl@gnu.org>
-
- */*: s/Invalid_Argument/Invalid_Library_Handle/ where appropriate.
-
-2014-11-25 Werner Lemberg <wl@gnu.org>
-
- */*: s/Invalid_Argument/Invalid_Outline/ where appropriate.
-
-2014-11-25 Werner Lemberg <wl@gnu.org>
-
- */*: s/Invalid_Argument/Invalid_Face_Handle/ where appropriate.
-
-2014-11-24 Werner Lemberg <wl@gnu.org>
-
- [Savannah bug #43682] Adjust some renderer callbacks.
-
- * src/raster/ftraster.c (ft_black_set_mode): Change return type to
- `int' to stay in sync with `FT_Renderer_SetModeFunc' prototype.
-
- * src/smooth/ftgrays.c (gray_raster_set_mode): New dummy function
- for orthogonality.
- (ft_grays_raster): Use it.
-
-2014-11-25 Werner Lemberg <wl@gnu.org>
-
- [Savannah bug #43682] Properly handle missing return errors.
-
- The functions in this patch *do* return non-trivial errors that must
- be taken care of.
-
- * src/autofit/afloader.c (af_loader_load_g), src/base/ftobjs.c
- (FT_Render_Glyph_Internal), src/base/ftoutln.c (FT_Outline_Render),
- src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_endchar>,
- src/psaux/psobjs.c (ps_parser_load_field_table), src/psaux/t1decode
- (t1_decoder_parse_charstrings) <op_endchar>, src/truetype/ttgload.c
- (load_truetype_glyph <subglyph loop>, tt_loader_init,
- TT_Load_Glyph), src/truetype/ttgxvar.c (TT_Set_MM_Blend),
- src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Do it.
-
-2014-11-25 Werner Lemberg <wl@gnu.org>
-
- [Savannah bug #43682] Add/remove `void' casts to some functions.
-
- We use a cast to indicate that we intentionally ignore a function's
- return value. However, this doesn't apply to API functions where
- errors can only happen for trivially invalid input.
-
- * src/base/ftstroke.c (FT_Glyph_Stroke, FT_Glyph_StrokeBorder),
- src/base/ftsynth.c (FT_GlyphSlot_Embolden), src/cff/cffgload.c
- (cff_slot_load), src/pfr/pfrdrivr.c (pfr_get_kerning),
- src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
- (t42_parse_encoding): Do it.
-
-2014-11-25 Werner Lemberg <wl@gnu.org>
-
- [Savannah bug #43682] Change some signatures to `void' return type.
-
- * include/internal/pshints.h (PSH_Globals_SetScaleFunc),
- include/internal/sfnt.h (TT_Get_Metrics_Func),
- src/pshinter/pshglob.c (psh_globals_set_scale),
- src/pshinter/pshrec.c (ps_hints_init), src/sfnt/ttmtx.c
- (tt_face_get_metrics), src/truetype/ttinterp.c (TT_Goto_CodeRange,
- TT_Set_CodeRange, TT_Clear_CodeRange, TT_Done_Context,
- TT_Save_Context): Do it.
-
- * src/pshinter/pshglob.h, src/pshinter/pshrec.h, src/sfnt/ttmtx.h,
- src/truetype/ttgload.c (TT_Hint_Glyph), src/truetype/ttinterp.c
- (TT_Run_Context), src/truetype/ttinterp.h, src/truetype/ttobjs.c
- (tt_size_run_fpgm, tt_size_run_prep): Updated.
-
-2014-11-24 Werner Lemberg <wl@gnu.org>
-
- Remove all code related to FT_MAX_CHARMAP_CACHEABLE.
-
- This is no longer used.
-
- * src/base/ftobjs.c, src/cache/ftccmap.c, src/cff/cffobjs.c,
- src/sfnt/ttcmap.c: Do it.
-
-2014-11-24 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #43680.
-
- This adds an additional constraint to make the fix from 2013-01-25
- really work.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_image) <index_format==4>:
- Check `p' before `num_glyphs'.
-
-2014-11-24 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix Savannah bug #43679.
-
- * src/truetype/ttpload.c (tt_face_load_hdmx): Check minimum size of
- `record_size'.
-
-2014-11-24 Jarkko Pöyry <jarkko.poyry@gmail.com>
-
- [cff, pfr, psaux, winfonts] Fix Savannah bug #43676.
-
- Don't cast cmap init function pointers to an incompatible type.
-
- Without this patch, the number of parameters between declaration and
- the real signature differs. Calling such a function results in
- undefined behavior.
-
- ISO/IEC 9899:TC3 (Committee Draft September 7, 2007)
- 6.5.2.2 Function calls
- 9 If the function is defined with a type that is not
- compatible with the type (of the expression) pointed to by
- the expression that denotes the called function, the
- behavior is undefined.
-
- On certain platforms (c -> js with emscripten) this causes
- termination of execution or invalid calls because in the emscripten
- implementation, function pointers of different types are stored in
- different pointer arrays. Incorrect pointer type here results in
- indexing of an incorrect array.
-
- * src/cff/cffcmap.c (cff_cmap_encoding_init, cff_cmap_unicode_init),
- src/pfr/pfrcmap.c (pfr_cmap_init), src/psaux/t1cmap.c
- t1_cmap_standard_init, t1_cmap_expert_init, t1_cmap_custom_init,
- t1_cmap_unicode_init), src/winfonts/winfnt.c (fnt_cmap_init): Fix
- signature.
-
-2014-11-24 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #43672.
-
- * src/sfnt/ttkern.c (tt_face_load_kern): Use correct value for
- minimum table length test.
-
-2014-11-24 Werner Lemberg <wl@gnu.org>
-
- [type1, type42] Another fix for Savannah bug #43655.
-
- * src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c
- (t42_parse_charstrings): Add another boundary testing.
-
-2014-11-24 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Formatting, copyright, improved documentation.
-
- * src/tools/docmaker/*: No code changes besides trivial
- modifications.
-
-2014-11-22 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #43660.
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs) <"ENDFONT">: Check
- `_BDF_GLYPH_BITS'.
-
-2014-11-22 Werner Lemberg <wl@gnu.org>
-
- [type42] Allow only embedded TrueType fonts.
-
- This is a follow-up to Savannah bug #43659.
-
- * src/type42/t42objs.c (T42_Face_Init): Exclusively use the
- `truetype' font driver for loading the font contained in the `sfnts'
- array.
-
-2014-11-22 Werner Lemberg <wl@gnu.org>
-
- [type42] Fix Savannah bug #43659.
-
- * src/type42/t42objs.c (T42_Open_Face): Initialize `face->ttf_size'.
-
- * src/type42/t42parse.c (t42_parse_sfnts): Always set
- `face->ttf_size' directly. This ensures a correct stream size in
- the call to `FT_Open_Face', which follows after parsing, even for
- buggy input data.
- Fix error messages.
-
-2014-11-22 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #43658.
-
- * src/cff/cf2ft.c (cf2_builder_lineTo, cf2_builder_cubeTo): Handle
- return values of point allocation routines.
-
-2014-11-22 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #43656.
-
- * src/sfnt/ttcmap.c (tt_cmap4_validate): Fix order of validity
- tests.
-
-2014-11-21 Werner Lemberg <wl@gnu.org>
-
- [type1, type42] Fix Savannah bug #43655.
-
- * src/type1/t1load.c (parse_charstrings), src/type42/t42parse.c
- (t42_parse_charstrings): Fix boundary testing.
-
-2014-11-21 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfread.c (pcf_get_metrics): Sanitize invalid metrics.
-
-2014-11-21 Werner Lemberg <wl@gnu.org>
-
- [ftlcdfil] Obey flow direction.
-
- * src/base/ftlcdfil.c (_ft_lcd_filter_fir, _ft_lcd_filter_legacy):
- Handle `up' flow.
-
-2014-11-21 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftbitmap.c (FT_Bitmap_Convert): Improve.
-
- This commit completes argument checks and adds support for different
- flow directions.
-
-2014-11-21 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftbitmap.c (FT_Bitmap_Copy): Improve.
-
- This commit adds argument checks and support for different flow
- directions.
-
-2014-11-20 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftbitmap.c (FT_Bitmap_New): Check argument.
-
-2014-11-19 Werner Lemberg <wl@gnu.org>
-
- Change some fields in `FT_Bitmap' to unsigned type.
-
- This doesn't break ABI.
-
- * include/ftimage.h (FT_Bitmap): Make `rows', `width', `num_grays',
- `pixel_mode', and `palette_mode' unsigned types.
-
- * src/base/ftbitmap.c: Updated.
- (FT_Bitmap_Copy): Fix casts.
-
- * src/cache/ftcsbits.c, src/raster/ftraster.c, src/sfnt/pngshim.c:
- Updated.
-
-2014-11-19 Werner Lemberg <wl@gnu.org>
-
- Make `FT_Bitmap_Convert' correctly handle negative `pitch' values.
-
- * src/base/ftbitmap.c (FT_Bitmap_Convert): Always use positive value
- for the pitch while copying data.
- Correctly set pitch sign in target bitmap.
-
-2014-11-19 Werner Lemberg <wl@gnu.org>
-
- Minor code improvement in `FT_Bitmap_Embolden'.
-
- * src/base/ftbitmap.c (FT_Bitmap_Embolden) <FT_PIXEL_MODE_GRAY[24]>:
- Fix thinko.
-
-2014-11-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/fttrigon.c: Use dedicated `FT_Angle' for arctan table.
-
-2014-11-19 Behdad Esfahbod <behdad@behdad.org>
-
- Avoid compiler warnings on x86-64 for `FT_MulFix'.
-
- `FT_MulFix' takes `FT_Long' parameters as defined in `freetype.h',
- but several inline implementations of it in `ftcalc.h' take
- `FT_Int32' arguments. This is causing compiler warnings on x86-64:
- If parameters of type `FT_Fixed' (= `FT_Long') are passed to the
- inline implementation of this function, integer values are truncated
- from 64bit to 32bit.
-
- * include/internal/ftcalc.h (FT_MulFix) [FT_MULFIX_ASSEMBLER]: Add
- casts.
-
-2014-11-15 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #43597.
-
- * src/sfnt/pngshim.c (Load_SBit_Png): Protect against too large
- bitmaps.
-
-2014-11-12 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #43591.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_init): Protect against addition
- and multiplication overflow.
-
-2014-11-12 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #43590.
-
- * src/sfnt/ttload.c (check_table_dir, tt_face_load_font_dir):
- Protect against addition overflow.
-
-2014-11-12 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #43589.
-
- * src/sfnt/sfobjs.c (woff_open_font): Protect against addition
- overflow.
-
-2014-11-12 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #43588.
-
- * src/sfnt/ttcmap.c (tt_cmap8_validate, tt_cmap10_validate,
- tt_cmap12_validate, tt_cmap13_validate, tt_cmap14_validate): Protect
- against overflow in additions and multiplications.
-
-2014-11-10 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] CORDIC improvements.
-
- The scaling between the hypotenuse and its CORDIC approximation is
- based on regression analysis. The smaller padding for `theta' is
- justified by its maximum error of less than 6.
-
- * src/base/fttrigon.c (ft_trig_downscale): Borrow code from
- ./ftcalc.c (ft_multo64), change linear intercept.
- (ft_trig_pseudo_polarize): Decrease `theta' padding.
-
-2014-11-09 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftstroke.c (ft_stroker_inside): Fix border intersections.
-
- One more place to check whether `radius' is zero.
-
- Problem reported by Marco Wertz <marco.wertz@gmx.de>.
-
-2014-11-07 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #43535.
-
- * src/bdf/bdflib.c (_bdf_strncmp): New macro that checks one
- character more than `strncmp'.
- s/ft_strncmp/_bdf_strncmp/ everywhere.
-
-2014-11-06 Werner Lemberg <wl@gnu.org>
-
- [pcf] Fix Savannah bug #43548.
-
- * src/pcf/pcfread.c (pcf_get_encodings): Add sanity checks for row
- and column values.
-
-2014-11-06 Werner Lemberg <wl@gnu.org>
-
- [pcf] Fix Savannah bug #43547.
-
- * src/pcf/pcfread.c (pcf_read_TOC): Check `size' and `offset'
- values.
-
-2014-11-06 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfread.c (pcf_read_TOC): Avoid memory leak.
-
-2014-11-03 Infinality <infinality@infinality.net>
-
- * src/truetype/ttsubpix.c (COMPATIBILITY_MODE_Rules): Updated.
-
- The previous commit deteriorates rendering of DejaVu and similar
- fonts; this gets compensated with this rule.
-
-2014-11-03 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Ins_DELTAP): Fix subpixel hinting.
-
- Before this patch, it was impossible to ever call DELTAP[123] in
- subpixel hinting mode as described in the ClearType whitepaper; it
- only worked if in `compatibility mode'. However, compatibility mode
- essentially disables SHPIX, completely ruining hinting of
- ttfautohint output, for example.
-
- We now follow the whitepaper more closely so that DELTAP[123]
- instructions for touched points in the non-subpixel direction are
- executed.
-
-2014-10-31 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Improve code readability.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.
-
-2014-10-31 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Reduce outline translations during rendering.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Translate origin
- virtually by modifying cbox, actually translate outline if cumulative
- shift is not zero.
-
-2014-10-30 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Fix Savannah bug #35604 (cont'd).
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Remove checks and
- casts that became unnecessary after the variable type upgrades.
-
-2014-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Improve code readability.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Rearrange code.
-
-2014-10-29 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Unify hypotenuse approximations.
-
- * include/internal/ftcalc.h (FT_HYPOT): Move macro from here...
- * include/internal/ftobjs.h: ... to here, next to required `FT_ABS'.
- * src/smooth/ftgrays.c (gray_render_cubic): Use it here.
-
-2014-10-25 Werner Lemberg <wl@gnu.org>
-
- [cff] Test valid darkening parameter macros in `ftoption.h'.
-
- We no longer need an otherwise unused typedef that can cause a gcc
- warning.
- Problem reported by Alexei.
-
- * src/cff/cffobjs.c (cff_driver_init): Use
- `CFF_CONFIG_OPTION_DARKENING_PARAMETER_XXX' macros directly.
- (SET_DARKENING_PARAMETERS): Removed.
- Compile time tests are now ...
-
- * devel/ftoption.h, include/config/ftoption.h: ... here.
-
-2014-10-25 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Improve flat corner definition.
-
- * include/internal/ftcalc.h (FT_HYPOT): Macro to approximate Euclidean
- distance with the alpha max plus beta min algorithm.
- * src/base/ftcalc.c (ft_corner_is_flat): Use it instead of Taxicab
- metric.
-
-2014-10-23 David Weiß <David.Weiss@ptvgroup.com>
-
- [build] Improve property file for vc2010.
-
- User-defined properties should be empty by default to prevent linker
- failures.
-
- * builds/windows/vc2010/freetype.user.props,
- builds/windows/vc2010/freetype.vcxproj:
- s/OptionsDirectory/UserOptionDirectory/.
- Comment out all user options.
-
-2014-10-23 Werner Lemberg <wl@gnu.org>
-
- [cff] Work around bug in preprocessor of MSVC 2010.
-
- We have been hit by
-
- https://connect.microsoft.com/VisualStudio/feedback/details/718976/msvc-pr
-
- * devel/ftoption.h, include/config/ftoption.h: Replace
- `CFF_CONFIG_OPTION_DARKENING_PARAMETERS' with eight macros
- `CFF_CONFIG_OPTION_DARKENING_PARAMETER_{X,Y}{1,2,3,4}'.
-
- * src/cff/cffobjs.c (SET_DARKENING_PARAMETERS): Removed. We no
- longer need double expansion.
- (SET_DARKENING_PARAMETERS_0): Renamed to ...
- (SET_DARKENING_PARAMETERS): ... this.
- Update call.
-
-2014-10-20 Werner Lemberg <wl@gnu.org>
-
- [sbit] Minor fixes.
-
- * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]:
- Accept overlay format also, but emit warning message in that case.
- (tt_sbit_decoder_load_metrics): Add missing newline to error
- message.
- (tt_sbit_load_sbix_image): Add `rgbl' graphic type (as used on iOS
- 7.1) to the list of unsupported formats.
-
-2014-10-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Clean up bytecode rounding.
-
- Zero distance does not have to be treated specially if you follow
- specifications and check the sign as the very last step of rounding.
-
- * src/truetype/ttinterp.c (Round_None, Round_To_Grid,
- Round_Down_To_Grid, Round_Up_To_Grid, Round_To_Double_Grid): Use
- macros when available, do not check for non-zero distance.
- (Round_To_Half_Grid, Round_Super, Round_Super_45): Ditto, return phase
- if sign changed.
-
-2014-10-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Unwrap engine compensation settings.
-
- * src/truetype/ttobjs.c (tt_size_init_bytecode): Updated.
-
-2014-10-18 David Weiß <David.Weiss@ptvgroup.com>
-
- [build] Add property file to vc2010 project.
-
- This simplifies custom build configurations, especially for
- automated build environments.
-
- * builds/windows/vc2010/freetype.user.props: New configuration file.
-
- * builds/windows/vc2010/freetype.vcxproj: Include
- `freetype.user.props' and use its data fields.
-
- * builds/windows/vc2010/index.html: Updated.
-
-2014-10-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Telugu.
-
- This essentially moves the Telugu script from the `Indic' hinter to
- the `Latin' hinter.
-
- Note that this is a first shot and quite certainly needs
- refinements.
-
- * src/autofit/afblue.dat: Add blue zone data for Telugu.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Telugu standard characters and move
- data out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Telugu data out of
- AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afstyles.h: Update Telugu data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2014-10-18 David Wimsey <david@wimsey.us>
-
- [cmake] Add iOS build support.
- From Savannah patch #8497.
-
- * builds/cmake/iOS.cmake: New file. Universal binaries are built
- with both 32 and 64 bit arm architectures.
-
- * CMakeLists.txt (IOS_PLATFORM): New variable for running the iOS
- toolchain. Possible values are `OS' to build on iOS, or
- `SIMULATOR' to build on APPLE.
-
-2014-10-16 Behdad Esfahbod <behdad@behdad.org>
- Werner Lemberg <wl@gnu.org>
-
- [cff] Add `CFF_CONFIG_OPTION_DARKENING_PARAMETERS' config macro.
-
- * devel/ftoption.h, include/config/ftoption.h
- (CFF_CONFIG_OPTION_DARKENING_PARAMETERS): New macro.
-
- * src/cff/cffobjs.c (SET_DARKENING_PARAMETERS,
- SET_DARKENING_PARAMETERS_0): New macros.
- (cff_driver_init): Use new macros.
-
-2014-10-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Limit delta shift range.
-
- The valid range for delta shift is zero through six. Negative values
- are invalid according to
-
- https://developer.apple.com/fonts/TrueType-Reference-Manual/RM04/Chap4.html#delta%20shift
-
- * src/truetype/ttobjs.h (delta_shift, delta_base): Make unsigned.
- * src/truetype/ttinterp.h (DO_SDS): Throw an error if `delta_shift'
- is out of range.
- (Ins_DELTAP, Ins_DELTAC): Optimize for valid `delta_shift'.
-
-2014-10-16 Werner Lemberg <wl@gnu.org>
-
- A better fix for Savannah bug #43392.
- Suggested by Doug Felt <dougfelt@gmail.com>.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Set
- `vertAdvance' to zero...
-
- * src/truetype/ttgload.c (TT_Load_Glyph): ... and set here a default
- value for `vertAdvance' based on `linearVertAdvance' in case
- `vertAdvance' is zero. Note that the previous computed ad-hoc value
- for `linearVertAdvance' was apparently not tested in a real-life
- situation.
-
-2014-10-14 David Weiß <David.Weiss@ptvgroup.com>
-
- [build] Better optimization settings for vc2010 solution file.
-
- * builds/windows/vc2010/freetype.sln,
- builds/windows/vc2010/freetype.vcxproj: Updated.
-
-2014-10-14 Werner Lemberg <wl@gnu.org>
-
- [autofit] Adjust Devanagari character range.
-
- * src/autofit/afranges.c (af_deva_uniranges): Omit characters that
- are common to all other Indic scripts.
-
-2014-10-12 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #43392.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics): Don't let
- vertical metrics uninitialized.
-
-2014-10-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Small bbox correction.
-
- * src/base/ftbbox.c (FT_Outline_Get_BBox): Start from nonsense bbox
- instead of initial point that could be `off' in conic outlines.
-
-2014-10-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fix Savannah bug #43356.
-
- * src/base/ftbbox.c (BBox_Move_To, BBox_Conic_To): Update bbox in case
- of implicit `to'.
- (BBox_Line_To): New emitter that does not update bbox.
-
-2014-10-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Introduce and use new macro `FT_UPDATE_BBOX'
-
- * src/base/ftbbox.c (FT_UPDATE_BBOX): New macro.
- (FT_Outline_Get_BBox): Use it here.
-
-2014-10-02 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Significant optimization of `ft_div64by32'
-
- We shift as many bits as we can into the high register, perform
- 32-bit division with modulo there, then work through the remaining
- bits with long division. This optimization is especially noticeable
- for smaller dividends that barely use the high register.
-
- * src/base/ftcalc.c (ft_div64by32): Updated.
-
-2014-10-02 Dave Arnold <darnold@adobe.com>
-
- [cff] Fix Savannah bug #43271.
-
- * src/cff/cf2font.c (cf2_computeDarkening): Change overflow
- detection to use logarithms and clamp `scaledStem'.
-
-2014-10-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftcalc.c: Remove miscellaneous type casts.
-
-2014-10-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Use more common `FT_MSB' implementation with masks.
-
- * src/base/ftcalc.c (FT_MSB): Updated.
-
-2014-09-30 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Clean up.
-
- * src/base/ftcalc.c (FT_MOVE_SIGN): New macro for frequently used
- code.
-
-2014-09-25 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Avoid unnecessary long division.
-
- This applies to `FT_MulDiv' but not to `FT_DivFix', where overflows or
- lack thereof are predicted accurately.
-
- * src/base/ftcalc.c (ft_div64by32): Improve readability.
- (FT_MulDiv, FT_MulDiv_No_Round) [!FT_LONG64]: Use straight division
- when multiplication stayed within 32 bits.
-
-2014-09-24 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor clean-ups.
-
- * src/autofit/afhints.c (AF_FLAGS): Remove obsolete values.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_points,
- af_glyph_hints_align_strong_points): Updated.
-
- * src/autofit/aflatin.c (af_latin_hints_link_segments,
- af_latin_hints_compute_segments), src/autofit/afcjk.c
- (af_cjk_hints_link_segments), src/autofit/aflatin2.c
- (af_latin2_hints_link_segments, af_latin2_hints_compute_segments):
- There are no longer fake segments since more than 10 years...
-
-2014-09-22 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor code streamlining.
-
- * src/autofit/afhints.c (af_axis_hints_new_edge): Remove redundant
- initialization.
-
-2014-09-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftcalc.c: Harmonize code.
-
-2014-09-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Tighten the overflow check in `FT_MulDiv'.
-
- * src/base/ftcalc.c (FT_MulDiv) [!FT_LONG64]: Updated.
-
-2014-09-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Fix Savannah bug #43153.
-
- * src/psaux/psconv.c (PS_Conv_ToFixed): Add protection against
- overflow in `divider'.
-
-2014-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Tighten the overflow check in `FT_DivFix'.
-
- This fixes a 13-year old bug. The original overflow check should have
- been updated when rounding was introduced into this function
- (c2cd00443b).
-
- * src/base/ftcalc.c (FT_DivFix) [!FT_LONG64]: Updated.
- * include/freetype.h (FT_DivFix): Updated documentation.
-
-2014-09-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Tighten the overflow check in `FT_MulFix'.
-
- * src/base/ftcalc.c (FT_MulFix) [!FT_LONG64]: Updated.
-
-2014-09-02 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Shortcut ppem calculations for square pixels.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): New field
- `cur_ppem_func' with a function pointer.
- * src/truetype/ttinterp.c (TT_RunIns): Initialize `cur_ppem_func'
- depending on the pixel geometry to either...
- (Current_Ppem_Stretched): ... this for stretched pixels.
- (Current_Ppem): ... or this for square pixels.
- (DO_MPPEM, DO_MPS, Ins_DELTAP, Ins_DELTAC): Use `cur_ppem_func'.
-
-2014-08-31 Behdad Esfahbod <behdad@behdad.org>
-
- Don't use `register' keyword. Fixes compiler warnings.
-
- * src/base/ftcalc.c (FT_Add64) [!FT_LONG64]: Do it.
- * src/gzip/inftrees.c (huft_build): Ditto.
- * src/truetype/ttinterp.c (TT_MulFix14_arm): Ditto.
-
-2014-08-24 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Optimize DELTAP and DELTAC.
-
- * src/truetype/ttinterp.c (Ins_DELTAP, Ins_DELTAC): Move ppem
- calculations outside of the loop.
-
-2014-08-21 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Fix Savannah bug #43033.
-
- * include/config/ftconfig.h, builds/unix/ftconfig.in,
- builds/vms/ftconfig.h [FT_LONG64]: Do not disable the macro when
- 64-bit type is `long'.
-
-2014-08-20 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Small optimization of `FT_MulFix'.
-
- * src/base/ftcalc.c (FT_MulFix): Loosen up the condition for direct
- 32-bit calculations.
-
-2014-08-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Use unsigned calculation in `FT_MulDiv'.
-
- * src/base/ftcalc.c (FT_MulDiv): Updated to expand 32-bit range.
-
-2014-08-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Remove truncation in `FT_DivFix'.
-
- * src/base/ftcalc.c (FT_DivFix): Updated.
-
-2014-08-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Minor refactoring.
-
- * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Updated.
-
-2014-08-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Turn FT_MSB into a macro when using gcc builtins.
-
- * src/base/ftcalc.c, include/internal/ftcalc.h: Updated.
-
-2014-08-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Avoid undefined FT_MSB in `BBox_Cubic_Check'.
-
- * src/base/ftbbox.c (BBox_Cubic_Check): Update.
- (update_cubic_max): Replace with...
- (cubic_peak): ... this, which now handles upscaling.
-
-2014-08-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Handle collapsed outlines to avoid undefined FT_MSB.
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Update.
-
-2014-08-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Restore FT_MulFix inlining.
-
- * include/freetype.h (FT_MulFix): Unconditionally defined.
-
- * src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: Move code from here...
-
- * include/internal/ftcalc.h [FT_MULFIX_ASSEMBLER]: ... to here,
- which conditionally replaces the function with an inline version
- through the macro.
-
-2014-08-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Refactor.
-
-2014-07-26 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix typo.
-
- * src/cff/cf2hints.c (cf2_glyphpath_computeOffset): Use correct
- offsets in third quadrant.
-
- Reported by maks <maksqwe1@ukr.net>.
-
-2014-07-17 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #42788.
-
- * src/pfr/pfrobjs.c: Include `ftcalc.h'.
-
-2014-07-16 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Replace `ft_highpow2' function.
-
- * src/pfr/pfrobjs.c (pfr_face_get_kerning): Use `FT_MSB' instead of
- `ft_highpow2'.
-
- * src/base/ftutil.c, include/internal/ftobjs.h (ft_highpow2): Remove
- it.
-
-2014-07-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftcalc.c (FT_MSB): Utilize gcc builtins.
-
-2014-07-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Move assembler code back in the source file.
-
- FT_MulFix assembler used to reside in ftcalc.c before f47d263f1b.
-
- * include/config/ftconfig.h, builds/unix/ftconfig.in,
- builds/vms/ftconfig.h [FT_MULFIX_ASSEMBLER]: Move code from here...
-
- * src/base/ftcalc.c [FT_MULFIX_ASSEMBLER]: ... to here.
-
-2014-07-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Further clean up color bitmap conversion.
-
- * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Stop
- using FT_MulFix and FT_DivFix since all calculations fit into 32 bits.
-
-2014-07-13 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improve handling of buggy `prep' tables.
-
- In case of an error in the `prep' table, no longer try to execute it
- again and again. This makes FreeType handle endless loops in buggy
- fonts much faster.
-
- * src/truetype/ttobjs.h (TT_SizeRec): The fields `bytecode_ready'
- and `cvt_ready' are now negative if not initialized yet, otherwise
- they indicate the error code of the last run.
-
- * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep,
- tt_size_done_bytecode, tt_size_init_bytecode,
- tt_size_ready_bytecode, tt_size_init, tt_size_done, tt_size_reset):
- Updated.
-
- * src/truetype/ttgload.c (tt_loader_init): Updated.
- * src/truetype/ttinterp.c (TT_RunIns): Force reexecution of `fpgm'
- and `prep' only if we are in the `glyf' table.
-
-2014-07-12 Werner Lemberg <wl@gnu.org>
-
- * builds/vms/ftconfig.h: Synchronize.
- Problem reported by Alexei.
-
-2014-07-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Clean up bitmap conversion.
-
- * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use
- appropriate FT_DivFix and remove superfluous upscaling.
-
-2014-07-04 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Small optimization of the ancient code.
-
- * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round): Loosen up the
- condition for direct 32-bit calculations.
-
-2014-06-27 Werner Lemberg <wl@gnu.org>
-
- Fix Apple standard glyph names.
-
- * src/sfnt/ttpost.c (tt_post_default_names): Synchronize with
- `tools/glnames.py'
-
- Problem reported by Adam Twardoch <adam@fontlab.com>.
-
-2014-06-17 Werner Lemberg <wl@gnu.org>
-
- Partially revert commit from 2014-06-13.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Move
- declaration of `p_first' and `p_last' out of the loop.
-
-2014-06-17 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype2.m4: s/AC_PATH_PROG/AC_PATH_TOOL/.
-
- This simplifies cross-compiling.
-
-2014-06-13 Werner Lemberg <wl@gnu.org>
-
- Fix more compiler warnings.
- Reported by Wojciech Mamrak <wmamrak@gmail.com>.
-
- * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
- Make integer constant unsigned.
-
- * src/sfnt/ttsbit.c (tt_face_load_strike_metrics)
- <TT_SBIT_TABLE_TYPE_SBIX>: Fix types.
- (tt_sbit_decoder_load_compound, tt_face_load_sbix_image): Add proper
- casts.
-
-2014-06-13 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warnings.
- Reported by Wojciech Mamrak <wmamrak@gmail.com>.
-
- * src/autofit/afglobal.c (af_face_globals_compute_style_coverage),
- src/autofit/afmodule.c (af_property_set): Fix `signed' vs.
- `unsigned' issues.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Make compiler
- happy.
-
- * src/base/ftlcdfil.c (_ft_lcd_filter_fir): Use only four elements
- for `fir'.
- Fix `signed' vs. `unsigned' issues.
-
- * src/sfnt/sfobjs.c (WRITE_BYTE): Removed, unused.
- (WRITE_USHORT, WRITE_ULONG): Add proper casts.
-
- * src/truetype/ttgload.c (TT_Get_VMetrics): Add proper casts.
-
- * src/truetype/ttinterp.c (Ins_DELTAP): Add proper casts for `B1'
- and `B2'.
-
-2014-05-16 Alexey Petruchik <alexey.petruchik@gmail.com>
-
- [cmake] Add option to build OS X framework.
-
- * CMakeLists.txt: Update accordingly.
-
- * builds/mac/freetype-Info.plist: New file.
-
-2014-05-13 Pavel Koshevoy <pkoshevoy@gmail.com>
-
- * CMakeLists.txt (BASE_SRCS): Add missing `ftbdf.c'.
-
-2014-05-11 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix variable initializations.
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Assign default
- values to `in_dir' and `out_dir' for all points.
-
-2014-05-11 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix crash with font `CabinSketch-Bold.ttf'.
-
- Problem reported by Ralf S. Engelschall <rse@engelschall.com>.
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Fix threshold for
- finding first non-near point.
- Properly initialize non-near point deltas.
-
-2014-05-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Devanagari.
-
- This essentially moves the Devanagari script from the `Indic' hinter
- to the `Latin' hinter. Thanks to Girish Dalvi
- <girish.dalvi@gmail.com> for guidance with blue zone characters!
-
- * src/autofit/afblue.dat: Add blue zone data for Devanagari.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Devanagari standard characters and
- move data out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Devanagari data out of
- AF_CONFIG_OPTION_INDIC block.
- Move U+20B9, (new) Rupee sign, from Latin to Devanagari.
-
- * src/autofit/afstyles.h: Update Devanagari data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2014-05-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix handling of neutral blue zones in stems.
-
- * src/autofit/afhints.h (AF_Edge_Flags): New value
- `AF_EDGE_NEUTRAL'.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_blue_edges): Trace
- neutral blue zones with AF_EDGE_NEUTRAL.
- (af_latin_hint_edges): Skip neutral blue zones if necessary.
-
-2014-04-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Introduce neutral blue zones to the latin module.
-
- Such blue zones match either the top or the bottom of a contour. We
- need them for scripts where accent-like elements directly touch the
- base character (for example, some vowel signs in Devanagari, cf.
- U+0913 or U+0914).
-
- * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_NEUTRAL): New
- property.
-
- * src/autofit/afblue.h: Regenerated.
-
- * src/autofit/aflatin.h (AF_LATIN_IS_NEUTRAL_BLUE): New macro.
- (AF_LATIN_BLUE_NEUTRAL): New enumeration value.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues,
- af_latin_hints_compute_blue_edges): Handle neutral blue zones.
-
-2014-04-25 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/hbshim.c: Partially revert commit from 2014-04-17.
-
- Using input glyph coverage data is simply wrong.
-
- Problem reported by Nikolaus Waxweiler <madigens@gmail.com> and
- Mantas Mikulėnas <grawity@gmail.com>.
-
-2014-04-23 Werner Lemberg <wl@gnu.org>
-
- * src/raster/ftraster.c (Vertical_Sweep_Span): Use drop-out mode.
-
- This spot has been missed while introducing support for various
- drop-out modes years ago (including no drop-out mode, which this
- commit fixes).
-
- Problem reported by Patrick Thomas <pthomas505@gmail.com>.
-
-2014-04-22 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/pngshim.c (error_callback): s/longjmp/ft_longjmp/.
-
-2014-04-20 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix Savannah bug #42148.
-
- The adaptation of the cjk auto-hinter module to blue stringsets in
- 2013-08-25 had three severe bugs. Mea culpa.
-
- 1. Contrary to the latin auto-hinter, characters for reference and
- overshoot values of a blue zone are specified separately. Due to
- the screwed-up change it didn't work at all.
-
- 2. A boolean comparison was erroneously replaced with a cast,
- causing invalid results with the `^' operator later on. The
- visual artifact caused by this problem is the topic of the bug
- report.
-
- 3. Two flag values were inverted, causing incorrect assignment of
- reference and overshoot values.
-
- * src/autofit/afblue.dat: Fix CJK bluestrings, introducing a new
- syntax to have both reference and overshoot characters in a single
- string. This is error #1.
- Add extensive comments.
-
- * src/autofit/afblue.hin (AF_BLUE_PROPERTY_CJK_FILL): Removed, no
- longer used.
- (AF_BLUE_PROPERTY_CJK_TOP, AF_BLUE_PROPERTY_CJK_HORIZ): Fix values.
- This is error #3.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_blues): Correct error #1.
- Use character `|' to separate characters for reference and overshoot
- values.
- Improve tracing messages, synchronizing them with the latin
- auto-hinter.
- (af_cjk_hints_compute_blue_edges): Fix value of `is_top_right_blue'.
- This is error #2.
- (af_cjk_align_linked_edge): Add tracing message.
-
- * src/autofit/afcjk.h (AF_CJK_IS_FILLED_BLUE): Removed, no longer
- used.
-
-2014-04-17 Werner Lemberg <wl@gnu.org>
-
- [autofit] More coverage fixes for complex scripts.
-
- * src/autofit/hbshim.c (af_get_coverage): Merge input glyph coverage
- of GSUB lookups into output coverage. Otherwise, ligatures are not
- handled properly.
- Don't check blue zone characters for default coverage.
-
-2014-04-17 Werner Lemberg <wl@gnu.org>
-
- Make `FT_Get_SubGlyph_Info' actually work.
-
- * src/base/ftobjs.c (FT_Get_SubGlyph_Info): Return FT_Err_Ok
- if there is no error.
-
-2014-04-15 Werner Lemberg <wl@gnu.org>
-
- [afblue.pl]: Minor improvements.
-
- * src/tools/afblue.pl: Allow whitespace before comments.
- Ignore whitespace in strings.
-
-2014-04-14 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve coverage handling.
-
- * src/autofit/hbshim.c (af_get_coverage): Don't exclude glyphs
- appearing in the GPOS table if we are processing the default
- coverage.
-
-2014-04-13 David Weber <weber.aulendorf@googlemail.com>
-
- [smooth] Fix stand-alone compilation.
-
- * src/smooth/ftgrays.c (FT_BEGIN_STMNT, FT_END_STMNT): Define.
-
-2014-04-12 Werner Lemberg <wl@gnu.org>
-
- [autofit] Redesign the recognition algorithm of strong points.
-
- In particular, local extrema without horizontal or vertical segments
- are better recognized:
-
- + A + D
- \ /
- \ /
- \ /
- \ /
- \ + C
- \ /
- B +/
-
- If the distances AB and CD are large, point B wasn't previously
- detected as an extremum since the `ft_corner_is_flat' function
- `swallowed' BC regardless of its direction, tagging point B as weak.
- The next iteration started at B and made `ft_corner_is_flat' swallow
- point C, tagging it as weak also, et voilà.
-
- To improve that, another pass gets now performed before calling
- `ft_corner_is_flat' to improve the `topology' of an outline: A
- sequence of non-horizontal or non-vertical vectors that point into
- the same quadrant are handled as a single, large vector.
-
- Additionally, distances of near points are now accumulated, which
- makes the auto-hinter handle them as if they were prepended to the
- next non-near vector.
-
- This generally improves the auto-hinter's rendering results.
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Implement it.
-
- * src/autofit/afhints.h (AF_FLAGS): Remove no longer used flag
- `AF_FLAG_NEAR'.
-
-2014-04-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve scoring algorithm for identifying stems.
-
- Problem reported by Karsten Lücke <karsten.luecke@kltf.de>.
-
- The new algorithm takes care of the width of stems: If the distance
- between two segments is larger than the largest stem width, the
- demerits quickly increase for larger distances. This improves
- hinting of slanted fonts (especially if the inner parts of serifs
- have non-horizontal `shoulders'), avoiding false stem links.
-
- * src/autofit/aflatin.c (af_latin_hints_link_segments): Use largest
- stem width (if available) to compute better demerits for distances
- between stems.
- (af_latin_hints_detect_features): Pass stem width array and array
- size.
- (af_latin_metrics_init_widths): Updated to use original algorithm.
- (af_latin_hints_apply): Updated to use new algorithm.
-
- * src/autofit/aflatin.h: Updated.
- * src/autofit/afcjk.c: Updated.
-
-2014-04-03 Werner Lemberg <wl@gnu.org>
-
- Don't require `gzip' module for `sfnt'.
-
- Reported by Preet <prismatic.project@gmail.com>.
-
- * src/sfnt/sfobjs.c (woff_open_font): Guard use of
- FT_Gzip_Uncompress with FT_CONFIG_OPTION_USE_ZLIB.
-
-2014-03-27 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #38235.
-
- Work around a bug in pkg-config version 0.28 and earlier: If a
- variable value gets surrounded by doublequotes (in particular values
- for the `prefix' variable), the prefix override mechanism fails.
-
- * builds/unix/freetype2.in: Don't use doublequotes.
- * builds/unix/unix-def.in (freetype.pc): Escape spaces in directory
- names with backslashes.
-
-2014-03-24 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #41946.
-
- Based on a patch from Marek Kašík <mkasik@redhat.com>.
-
- * builds/unix/configure.raw (LIBS_CONFIG): Remove.
- * builds/unix/freetype-config.in (libs): Hard-code value.
- * builds/unix/unix-def.in: Updated.
-
-2014-03-22 Werner Lemberg <wl@gnu.org>
-
- Another revert for the change from 2014-03-18.
-
- Problem reported by Nikolaus Waxweiler <madigens@gmail.com>.
-
- * src/base/ftcalc.c (FT_MulFix): Ensure that an `FT_MulFix' symbol
- gets always exported.
-
-2014-03-20 Werner Lemberg <wl@gnu.org>
-
- CMakeLists.txt: Another fix for include directories.
-
- Problem reported by Taylor Holberton <taylorcholberton@gmail.com>.
-
-2014-03-19 Werner Lemberg <wl@gnu.org>
-
- CMakeLists.txt: Fix include directories.
-
- Problem reported by Taylor Holberton <taylorcholberton@gmail.com>.
-
-2014-03-19 Werner Lemberg <wl@gnu.org>
-
- Partially revert last commit.
-
- Found by Alexei.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initializing
- those variables is plain wrong, since we are in a loop.
-
-2014-03-18 Sean McBride <sean@rogue-research.com>
- Werner Lemberg <wl@gnu.org>
-
- Fix clang warnings.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Initialize
- some variables.
-
- * src/base/ftcalc.c (FT_MulFix): Only use code if
- `FT_MULFIX_INLINED' is not defined.
-
- * src/bdf/bdfdrivr.c (bdf_cmap_class), src/cache/ftcbasic.c
- (ftc_basic_image_family_class, ftc_basic_image_cache_class,
- ftc_basic_sbit_family_class, ftc_basic_sbit_cache_class),
- src/cache/ftccmap.c (ftc_cmap_cache_class), src/cache/ftcmanag.c
- (ftc_size_list_class, ftc_face_list_class), src/pcf/pcfdrivr.c
- (pcf_cmap_class), src/pfr/pfrdrivr.c (pfr_metrics_service_rec): Make
- function static.
-
- * src/type1/t1driver.c (t1_ps_get_font_value): Remove redundant
- code.
-
-2014-03-17 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #41869.
-
- This works around a problem with HarfBuzz (<= 0.9.26), which doesn't
- validate glyph indices returned by
- `hb_ot_layout_lookup_collect_glyphs'.
-
- * src/autofit/hbshim.c (af_get_coverage): Guard `idx'.
-
- * docs/CHANGES: Updated.
-
-2014-03-14 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.raw: Don't show error messages of `which'.
-
-2014-03-09 Alan Coopersmith <alan.coopersmith@oracle.com>
-
- Fix cppcheck 1.64 warning.
-
- * src/autofit/afglobal.c (af_face_globals_new): Catch NULL pointer
- dereference in case of error.
-
-2014-03-09 Sean McBride <sean@rogue-research.com>
-
- * src/sfnt/ttcmap.c (tt_face_build_cmaps): Remove clang warning.
-
-2014-03-06 Werner Lemberg <wl@gnu.org>
-
- * Version 2.5.3 released.
- =========================
-
-
- Tag sources with `VER-2-5-3'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.5.3.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.5.2/2.5.3/, s/252/253/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
-
- * builds/unix/configure.raw (version_info): Set to 17:2:11.
- * CMakeLists.txt (VERSION_PATCH): Set to 3.
- * docs/CHANGES: Updated.
-
-2014-03-06 Werner Lemberg <wl@gnu.org>
-
- Fixes for compilation with C++.
-
- * src/autofit/hbshim.c (scripts): Change type to `hb_script_t'.
- (af_get_coverage): Updated.
- (COVERAGE): Add cast.
-
-2014-03-06 Sean McBride <sean@rogue-research.com>
-
- Remove more clang analyzer warnings.
-
- * src/bdf/bdflib.c (_bdf_readstream), src/truetype/ttgload.c
- (TT_Load_Glyph): Remove dead stores.
-
-2014-03-05 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.raw: Simplify.
-
-2014-03-05 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Fix a bug in configure in library dependency setting
- Reported in https://bugs.freedesktop.org/show_bug.cgi?id=75652.
-
- * builds/unix/configure.raw: Use `x"${xxx}" != xno' style.
-
-2014-03-04 Werner Lemberg <wl@gnu.org>
-
- Minor fix for `make devel'.
-
- * builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Don't use
- pkg-config for bzip2 since not all GNU/Linux distributions have
- `bzip2.pc' (and the header file `bzlib.h' is located in /usr/include
- normally).
-
-2014-03-04 Sean McBride <sean@rogue-research.com>
-
- Fix several clang static analyzer dead store warnings.
-
- * src/autofit/afhints.c (af_glyph_hints_reload,
- af_glyph_hints_align_weak_points): Remove unnecessary assignments.
-
- * src/bdf/bdflib.c (bdf_font_load): Ditto.
-
- * src/pshinter/pshalgo.c (psh_glyph_compute_extrema,
- psh_glyph_interpolate_other_points): Ditto.
-
- * src/type1/t1load.c (T1_Set_MM_Blend): Ditto.
-
-2014-03-03 Werner Lemberg <wl@gnu.org>
-
- Rewrite library option handling in `configure'.
-
- o Introduce `auto' value for `--with-XXX' library options; this is
- now the default.
-
- o First use `pkg-config' for library detection, then fall back to
- other tests.
-
- * builds/unix/configure.raw (--with-zlib, --with-bzip2, --with-png,
- --with-harfbuzz): Rewrite.
- Use new `xxx_reqpriv', `xxx_libpriv', and `xxx_libstaticconf'
- variables to collect data for `freetype2.pc' and `freetype-config'.
- (FT2_EXTRA_LIBS): Renamed to ...
- (ft2_extra_libs): This since it gets no longer substituted.
- (REQUIRES_PRIVATE, LIBS_PRIVATE, LIBS_CONFIG, LIBSSTATIC_CONFIG):
- New output variables, replacing `XXX_PKG' and `LIBXXX'.
- Add notice at the end of `configure' showing the library
- configuration.
-
- * builds/unix/freetype-config.in (--static): New command line
- option.
- (libs): Updated.
- (staticlibs): New variable, to be used if `--static' is given.
- * docs/freetype-config.1: Document `--static'.
-
- * builds/unix/freetype2.in, builds/unix/unix-def.in: Updated.
-
-2014-03-01 Werner Lemberg <wl@gnu.org>
-
- Avoid `long long' warnings with older gcc compilers.
- Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
-
- * builds/unix/configure.raw: Don't use gcc's `-pedantic' flag for
- versions < 4.6. This is especially needed for Max OS X since this
- OS runs a gcc variant (or emulation) based on version 4.2.1.
-
-2014-03-01 Werner Lemberg <wl@gnu.org>
-
- * docs/INSTALL.CROSS: Revised and updated.
-
-2014-03-01 Werner Lemberg <wl@gnu.org>
-
- Make `make clean' remove `freetype2.pc'.
-
- This is a generated file at build time, not configure time.
-
- * builds/unix/unix-def.in (DISTCLEAN): Move `freetype2.pc' to ...
- (CLEAN): This variable.
-
-2014-03-01 Werner Lemberg <wl@gnu.org>
-
- Use pkg-config for detecting libpng and libbz2 also.
-
- * builds/unix/configure.raw (HAVE_PKG): New variable.
- Search for libbz2 using `pkg-config'; s/BZ2/BZIP2/.
- Search for libpng using `pkg-config'.
- Fix definition of `LIBHARFBUZZ' variable.
- * builds/unix/freetype-config.in ($libs): Updated.
- * builds/unix/freetype2.in: Add `URL' field.
- Update `Requires.private' and `Libs.private'.
- * builds/unix/unix-def.in: Updated.
-
-2014-03-01 Werner Lemberg <wl@gnu.org>
-
- Add configure support for HarfBuzz.
-
- * builds/unix/pkg.m4: New file.
- * builds/unix/configure.raw: Search for libharfbuzz using
- `pkg-config'.
- Add `--without-harfbuzz' option.
- * builds/unix/freetype-config.in, builds/unix/freetype2.in,
- builds/unix/unix-def.in (freetype-config, freetype2.pc): Handle
- HarfBuzz.
-
- * docs/INSTALL.UNIX: Document interdependency of FreeType with
- HarfBuzz.
-
-2014-02-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [cff] Math simplifications.
-
- * src/cf2blues.c (cf2_blues_init): Use `FT_MulDiv'.
- * src/cf2ft.c (cf2_getScaleAndHintFlag): Use simple division.
-
-2014-02-28 Dave Arnold <darnold@adobe.com>
-
- [cff] Fix Savannah bug #41697, part 2.
-
- * src/cff/cf2ft.c (cf2_initLocalRegionBuffer,
- cf2_initGlobalRegionBuffer): It is possible for a charstring to call
- a subroutine if no subroutines exist. This is an error but should
- not trigger an assert. Split the assert to account for this.
-
-2014-02-28 Dave Arnold <darnold@adobe.com>
-
- [cff] Fix Savannah bug #41697, part 1.
-
- * src/cff/cf2hints.c (cf2_hintmap_build): Return when `hintMask' is
- invalid. In this case, it is not safe to use the length of
- `hStemHintArray'; the exception has already been recorded in
- `hintMask'.
-
-2014-02-26 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #41696.
-
- * src/sfnt/ttcmap.c (tt_cmap0_validate, tt_cmap2_validate,
- tt_cmap4_validate, tt_cmap14_validate): Fix limit tests.
-
-2014-02-26 Werner Lemberg <wl@gnu.org>
-
- [winfnt] Fix Savannah bug #41694.
-
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Check glyph offset.
-
-2014-02-26 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #41693.
-
- * src/cff/cffload.c (CFF_Load_FD_Select): Reject empty array.
-
-2014-02-26 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix Savannah bug #41692.
-
- bdflib puts data from the input stream into a buffer in chunks of
- 1024 bytes. The data itself gets then parsed line by line, simply
- increasing the current pointer into the buffer; if the search for
- the final newline character exceeds the buffer size, more data gets
- read.
-
- However, in case the current line's end is very near to the buffer
- end, and the keyword to compare with is longer than the current
- line's length, an out-of-bounds read might happen since `memcmp'
- doesn't stop properly at the string end.
-
- * src/bdf/bdflib.c: s/ft_memcmp/ft_strncmp/ to make comparisons
- stop at string ends.
-
-2014-02-17 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [autofit] Fix `make multi' compilation.
-
- * src/autofit/hbshim.c: Include `afglobal.h' and `aftypes.h'.
-
-2014-02-19 Werner Lemberg <wl@gnu.org>
- Simon Bünzli <zeniko@gmail.com>
-
- Fix Savannah bug #32902.
-
- Patch taken from
-
- https://code.google.com/p/sumatrapdf/source/browse/trunk/ext/_patches/freetype2.patch?spec=svn8620&r=8620#87
-
- with slight modifications.
-
- * src/type1/t1parse.c (T1_Get_Private_Dict): Add heuristic test to
- handle fonts that incorrectly use \r at the beginning of an eexec
- block.
-
-2014-02-19 Simon Bünzli <zeniko@gmail.com>
-
- Fix Savannah bug #41590.
-
- * src/type1/t1load.c (parse_encoding): Protect against invalid
- number.
-
-2014-02-12 Dave Arnold <darnold@adobe.com>
-
- [cff] Optimize by using `FT_MulDiv'.
- Suggested by Alexei.
-
- * src/cff/cf2font.c (cf2_computeDarkening): Do it.
-
-2014-02-12 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #41465.
-
- * builds/unix/unix-def.in (CLEAN): Add `freetype-config'.
- (DISTCLEAN): Remove `freetype-config'.
-
-2014-02-08 Sean McBride <sean@rogue-research.com>
-
- Fix clang static analyzer and compiler warnings.
-
- * src/autofit/afhints.c (af_glyph_hints_align_weak_points),
- src/autofit/afloader (af_loader_load_g) <FT_GLYPH_FORMAT_COMPOSITE>,
- src/base/ftcalc.c (FT_MSB), src/base/ftoutln.c
- (FT_Outline_Decompose), src/bdf/bdfdrivr.c (bdf_interpret_style),
- src/cff/cffparse.c (cff_parse_integer), src/cid/cidparse.c
- (cid_parser_new), src/pfr/pfrload.c (pfr_phy_font_load),
- src/raster/ftraster.c (Decompose_Curve), src/sfnt/sfdriver.c
- (sfnt_get_ps_name), src/sfnt/ttcmap.c (tt_cmap12_next,
- tt_cmap13_next), src/smooth/ftgrays.c (gray_hline): Remove dead
- code.
-
- * src/autofit/afmodule.c (af_property_get_face_globals,
- af_property_set, af_property_get), src/base/ftbitmap.c
- (ft_gray_for_premultiplied_srgb_bgra): Make functions static.
-
- * src/base/ftobjs.c (ft_remove_renderer): Protect against
- library == NULL.
- (ft_property_do): Make function static.
-
- * src/base/ftrfork.c: Include `ftbase.h'.
-
- * src/sfnt/ttsbit.c (tt_face_load_sbix_image)
- [!FT_CONFIG_OPTION_USE_PNG], src/type1/t1gload.c
- (T1_Compute_Max_Advance): Avoid compiler warning.
-
- * src/truetype/ttinterp.c (TT_New_Context): Reduce scope of
- variable.
-
-2014-02-08 Werner Lemberg <wl@gnu.org>
-
- Fix Windows build directories.
-
- The build target is now `windows' instead of `win32'.
-
- Problem reported by Nickolas George <darknova.clan@gmail.com>.
-
- * builds/modules.mk: Don't use `win32' and `win16' (!) but
- `windows'.
-
- * builds/windows/detect.mk, builds/windows/win32-def.mk:
- s/win32/windows/.
-
-2014-02-08 Eugen Sawin <esawin@mozilla.com>
-
- Fix Savannah bug #41507.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap)
- [!FT_CONFIG_OPTION_USE_PNG] <17, 17, 19>: Fix error handling.
-
-2014-02-08 Dave Arnold <darnold@adobe.com>
-
- [cff] Fix minor performance bug.
-
- * src/cff/cf2font.c (cf2_font_setup): Darkening amount and blue zone
- calculations are now cached and not recomputed on each glyph.
-
-2014-02-05 Werner Lemberg <wl@gnu.org>
-
- Fix problems with perl 5.8.8 as distributed with current MinGW.
-
- * src/tools/afblue.pl: Work-around for Perl bug #63402.
- (string_re): Avoid `possessive quantifiers', which have been
- introduced in Perl version 5.10.
-
-2014-02-04 Werner Lemberg <wl@gnu.org>
-
- Fix compilation with MinGW.
-
- Right now, compilation out of the box with latest MinGW is broken
- due to bugs in header files of mingwrt 4.0.3 in strict ANSI mode,
- cf.
-
- https://sourceforge.net/p/mingw/bugs/2024/
- https://sourceforge.net/p/mingw/bugs/2046/
-
- * builds/unix/configure.raw: Don't set `-ansi' flag for MinGW.
-
-2014-02-04 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor fix.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths),
- src/autofit/aflatin.c (af_latin_metrics_init_widths): Fix handling
- of alternative standard characters.
- This also fixes a compilation warning in non-debug mode.
-
-2014-02-03 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #41363.
-
- * src/cff/cf2ft.c (cf2_checkTransform): Convert assertion into
- parameter check.
- (cf2_decoder_parse_charstrings): Call `cf2_checkTransform' only if
- we are scaling the outline.
- (cf2_getPpemY): Remove problematic assertion.
-
-2014-01-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Introduce two more slots for standard characters.
-
- This is useful for OpenType features like `c2sc' (caps to small
- caps) that don't have lowercase letters by definition, or other
- features that mainly operate on numerals.
-
- * src/autofit/afscript.h: Add more standard characters.
-
- * src/autofit/aftypes.h: Update use of `SCRIPT' macro.
- (AF_ScriptClassRec): Add members to hold two more standard
- characters.
- (AF_DEFINE_SCRIPT_CLASS): Updated.
-
- * src/autofit/afglobal.c, src/autofit/afglobal.h,
- * src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/hbshim.c:
- Update use of `SCRIPT' macro.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths),
- src/autofit/aflatin.c (af_latin_metrics_init_widths): Scan two more
- standard characters.
-
-2014-01-24 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #41320.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues)
- <AF_LATIN_IS_LONG_BLUE>: Avoid negative index of `last'.
-
-2014-01-23 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #41310.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap) <glyph_format==5>:
- Don't check metrics, which this format doesn't have.
- This is another correction to the commit from 2013-11-21.
-
-2014-01-23 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #41309.
-
- * src/type1/t1load.c (t1_parse_font_matrix): Properly handle result
- of `T1_ToFixedArray'.
-
- * src/cid/cidload.c (cid_parse_font_matrix): Synchronize with
- `t1_parse_font_matrix'.
-
- * src/type42/t42parse.c (t42_parse_font_matrix): Synchronize with
- `t1_parse_font_matrix'.
- (t42_parse_encoding): Synchronize with `t1_parse_encoding'.
-
- * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_BBOX>,
- <T1_FIELD_TYPE_MMOX>: Properly handle result of `ps_tofixedarray'.
-
-2014-01-22 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/hbshim.c (af_get_coverage): Fix memory leaks.
-
-2014-01-16 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve tracing of style coverages.
-
- * include/internal/fttrace.h: Add `afglobal' for tracing style
- coverages.
-
- * src/autofit/afglobal.c: Include FT_INTERNAL_DEBUG_H.
- (FT_COMPONENT): Define.
- (af_face_globals_compute_style_coverage): Trace `gstyles' array
- data.
-
-2014-01-09 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #41158.
-
- * builds/unix/install.mk (install): Create man page directory.
-
-2014-01-08 Chongyu Zhu <lembacon@gmail.com>
-
- [arm] Fix Savannah bug #41138, part 2.
-
- * builds/unix/ftconfig.in (FT_MulFix_arm), include/config/ftconfig.h
- (FT_MulFix_arm), src/truetype/ttinterp.c (TT_MulFix14_arm): Fix
- preprocessor conditionals for `add.w'.
-
-2014-01-08 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix Savannah bug #41138, part 1.
-
- * src/tools/afblue.pl <Handling #endif>: Produce correct auxiliary
- enumeration names for generated `#else'.
-
- * src/autofit/afblue.h: Regenerated.
-
-2014-01-06 Werner Lemberg <wl@gnu.org>
-
- Add manual page for `freetype-config'.
- Contributed by Nis Martensen <nis.martensen@web.de>.
-
- * docs/freetype-config.1: New file.
-
- * builds/unix/unix-def.in (mandir): Define.
- * builds/unix/install.mk (install, uninstall): Handle manpage.
-
-2014-01-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor fixes for `afblue.pl'.
-
- * src/tools/afblue.pl (aux_name): Don't use `reverse'.
- <Handling #endif>: Use proper indentation for generated `#else'.
-
- * src/autofit/afblue.h: Regenerated.
-
-2014-01-04 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix Indic scripts.
-
- Split the single, incorrect Indic entry into separate scripts so
- that the covered ranges are the same: Bengali, Devanagari, Gujarati,
- Gurmukhi, Kannada, Limbu, Malayalam, Oriya, Sinhala, Sundanese,
- Syloti Nagri, Tamil, Telugu, and Tibetan. At the same time, remove
- entries for Meetei Mayek and Sharada – the Unicode ranges were
- incorrect (and nobody has complained about that), fonts are scarce
- for those scripts, and the Indic auto-hinter support is rudimentary
- anyways.
-
- * src/autofit/afscript.h: Updated, using AF_CONFIG_OPTION_INDIC and
- AF_CONFIG_OPTION_CJK.
-
- * src/autofit/afstyles.h (STYLE_DEFAULT_INDIC): New auxiliary macro.
- Use it, together with AF_CONFIG_OPTION_INDIC and
- AF_CONFIG_OPTION_CJK, to update.
-
- * src/autofit/afranges.c [AF_CONFIG_OPTION_INDIC]: Updated.
- [!AF_CONFIG_OPTION_INDIC, !AF_CONFIG_OPTION_CJK]: Removed.
- Sort entries by tags.
-
-2014-01-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Thinko.
-
- * src/autofit/hbshim.c (af_get_char_index): Similar to
- `af_get_coverage', reject glyphs which are not substituted.
-
-2014-01-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix handling of default coverages.
-
- With this commit, the implementation of coverage handling is
- completed.
-
- * src/autofit/hbshim.c (af_get_coverage): Exit early if nothing to
- do.
- Reject coverages which don't contain appropriate glyphs for blue
- zones.
-
-2014-01-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix handling of default coverages.
-
- * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
- First handle non-default coverages, then the default coverage of the
- default script, and finally the other default coverages.
-
-2014-01-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix scaling of HarfBuzz shaping.
-
- * src/autofit/hbshim.c (af_get_char_index): Scale to units per EM.
-
-2014-01-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Better ftgrid support.
-
- * src/autofit/afhints.c (af_glyph_hints_get_segment_offset): Add
- parameters `is_blue' and `blue_offset'.
-
-2014-01-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Remove some styles.
-
- * src/autofit/afcover.h: Remove coverages for alternative fractions,
- denominators, numerators, and fractions.
-
- * src/autofit/afstyles.h (META_STYLE_LATIN): Updated.
-
-2014-01-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add more styles.
-
- * src/autofit/afstyles.h (STYLE_LATIN, META_STYLE_LATIN): New
- auxiliary macros; use them to define styles for Cyrillic, Greek, and
- Latin.
-
- * src/autofit/afcover.h: Remove coverage for oldstyle figures.
- Since those digits are used in combination with ordinary letters, it
- makes no sense to handle them separately.
-
- * src/autofit/afglobal.c (af_face_globals_get_metrics): Don't limit
- `options' parameter to 4 bits.
-
-2014-01-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix style assignments to glyphs.
-
- * src/autofit/hbshim.c (af_get_coverage)
- [FT_CONFIG_OPTION_USE_HARFBUZZ]: Scan GPOS coverage of features also
- so that we can skip glyphs that have both GSUB and GPOS data.
-
-2014-01-01 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/hbshim.c: s/{lookups,glyphs}/gsub_{lookups,glyphs}/.
-
-2014-01-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Implement and use `af_get_char_index' with HarfBuzz.
-
- * src/autofit/hbshim.c (COVERAGE) [FT_CONFIG_OPTION_USE_HARFBUZZ]:
- Redefine to construct HarfBuzz features.
- (af_get_char_index) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Rewritten.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Use
- `y_offset' to adjust `best_y'.
-
-2013-12-31 Werner Lemberg <wl@gnu.org>
-
- [autofit] s/AF_STYLE_...._DEFAULT/AF_STYLE_...._DFLT/i.
-
-2013-12-31 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix interface of `af_get_char_index'.
-
- * src/autofit/hbshim.c (af_get_char_index): Return error value.
- Add argument for y offset (to be used in a yet-to-come patch).
-
- * src/autofit/hbshim.h, src/autofit/afcjk.c,
- src/autofit/aflatin.c: Updated.
-
-2013-12-30 Werner Lemberg <wl@gnu.org>
-
- [autofit] Don't combine multiple features into one set.
-
- Combining them, as originally envisioned, would lead to much more
- complicated code, as investigations have shown meanwhile. The major
- drawback is that we run out of available style slots much earlier.
- However, this is only a theoretical issue since we don't support a
- large number of scripts currently.
-
- * src/autofit/afcover.h: Replace `COVERAGE_{1,2,3}' macros with
- a single-element `COVERAGE' macro, sort the elements by the feature
- tags, and add entry for `ruby'.
-
- * src/autofit/aftypes.h: Updated.
- * src/autofit/hbshim.c: Updated.
-
-2013-12-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Code shuffling to reduce use of cpp macros.
-
- * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
- Call `af_get_coverage' unconditionally.
-
- * src/autofit/autofit.c: Include `hbshim.c' unconditionally.
-
- * src/autofit/hbshim.c (af_get_coverage)
- [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Provide dummy function.
-
- * src/autofit/hbshim.h: Provide function declarations
- unconditionally.
-
-2013-12-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add wrapper function for `FT_Get_Char_Index'.
-
- Yet-to-come changes will provide HarfBuzz functionality for the new
- function.
-
- * src/autofit/hbshim.c (af_get_char_index): New function.
- * src/autofit/hbshim.h: Updated.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths,
- af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths,
- af_latin_metrics_init_blues, af_latin_metrics_check_digits):
- Updated.
-
-2013-12-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Use `global' HarfBuzz font object.
-
- We now use `hb_font' instead of `hb_face' since yet-to-come changes
- need this.
-
- * src/autofit/afglobal.h: Include `hbshim.h'.
- (AF_FaceGlobalsRec) [FT_CONFIG_OPTION_USE_HARFBUZZ]: New member
- `hb_font'.
-
- * src/autofit/afglobal.c (af_face_globals_new)
- [FT_CONFIG_OPTION_USE_HARFBUZZ]: Create `hb_font'.
- (af_face_globals_free) [FT_CONFIG_OPTION_USE_HARFBUZZ]: Destroy
- `hb_font'.
-
- * src/autofit/hbshim.h: Include HarfBuzz headers.
-
- * src/autofit/hbshim.c: Include `hbshim.h' instead of HarfBuzz
- headers.
- (af_get_coverage): Updated.
-
-2013-12-27 Werner Lemberg <wl@gnu.org>
-
- [autofit] Handle `DFLT' OpenType script for coverages.
-
- * include/ftautoh.h: Document new `default-script' property.
-
- * src/autofit/hbshim.c (af_get_coverage): Use `AF_FaceGlobals' for
- type of first parameter.
- (script_tags): Add one more element.
- (af_get_coverage): Adjust `script_tags' to handle `DFLT' script tag.
-
- * src/autofit/hbshim.h: Updated.
-
- * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
- Updated.
-
- * src/autofit/afglobal.h (AF_SCRIPT_DEFAULT): New macro.
-
- * src/autofit/afmodule.h (AF_ModuleRec): New `default_script'
- member.
-
- * src/autofit/afmodule.c (af_property_set, af_property_get): Handle
- `default-script' property.
- (af_autofitter_init): Updated.
-
-2013-12-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [ftrfork] Fix the face order difference between POSIX and Carbon.
-
- The fragmented resources in Suitcase and .dfont should be reordered
- when `POST' resource for Type1 is being restored, but reordering of
- sfnt resources induces the different face order. Now the ordering
- is restricted to `POST' resource only, to prevent the different
- order issue (e.g. the face index in the fontconfig cache generated
- with Carbon framework is incompatible with that by FreeType 2
- without Carbon framework.) Found by Khaled Hosny and Hin-Tak Leung.
-
- https://lists.gnu.org/archive/html/freetype-devel/2013-02/msg00035.html
- https://lists.gnu.org/archive/html/freetype-devel/2013-12/msg00027.html
-
- * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Add a switch
- `sort_by_res_id' to control the fragmented resource ordering.
- * include/internal/ftrfork.h: Declare new switch.
- * src/base/ftobjs.c (IsMacResource): Enable the sorting for `POST'
- resource, and disable the sorting for `sfnt' resource.
-
-2013-12-25 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #40997.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Only use OR operator to
- adjust face flags since FT_FACE_FLAG_EXTERNAL_STREAM might already
- be set.
- * src/cff/cffobjs.c (cff_face_init): Ditto.
- * src/cid/cidobjs.c (cid_face_init): Ditto.
- * src/pcf/pcfread.c (pcf_load_font): Ditto.
- * src/pfr/pfrobjs.c (pfr_face_init): Ditto.
- * src/type1/t1objs.c (T1_Face_Init): Ditto.
- * src/type42/t42objs.c (T42_Face_Init): Ditto.
- * src/winfonts/winfnt.c (FNT_Face_Init): Ditto.
-
-2013-12-21 Werner Lemberg <wl@gnu.org>
-
- [autofit] Introduce `coverages'.
-
- Coverages are the interface to the HarfBuzz library to access
- OpenType features for handling glyphs not addressable by the cmap.
-
- Right now, compilation of HarfBuzz is only added to the development
- build. A solution for standard build mode will be delayed until
- HarfBuzz gets split into two libraries to avoid mutual dependencies
- between FreeType and HarfBuzz.
-
- Note that this is only a first step in handling coverages, basically
- providing the framework only. Code for handling selected OpenType
- features (this is, actually using the data in `afcover.h') will
- follow.
-
- * devel/ftoption.h, include/config/ftoption.h
- (FT_CONFIG_OPTION_USE_HARFBUZZ): New macro.
-
- * src/autofit/hbshim.c, src/autofit/hbshim.h, src/autofit/afcover.h:
- New files.
-
- * src/autofit/afscript.h: Add HarfBuzz script name tags.
-
- * src/autofit/afstyles.h: Add default coverage enumeration values.
-
- * src/autofit/aftypes.h: Update use of `SCRIPT' and `STYLE' macros.
- (AF_Coverage): New enumeration (generated by `afcover.h').
- (AF_StyleClassRec): New member `coverage'.
- (AF_DEFINE_STYLE_CLASS): Updated.
-
- * include/internal/fttrace.h: Add `afharfbuzz' for tracing coverage
- data.
-
- * src/autofit/afglobal.h: Update use of `SCRIPT' and `STYLE' macros.
- (AF_SCRIPT_FALLBACK): Renamed to ...
- (AF_STYLE_FALLBACK): ... this.
-
- * src/autofit/afglobal.c: Include `hbshim.c'.
- Update use of `SCRIPT' and `STYLE' macros.
- (af_face_globals_compute_style_coverage)
- [FT_CONFIG_OPTION_USE_HARFBUZZ]: Call `af_get_coverage'.
- Update.
-
- * src/autofit/afmodule.h (AF_ModuleRec):
- s/fallback_script/fallback_style/.
-
- * src/autofit/afmodule.c (af_property_set): Adapt handling of
- `fallback-script' property to set a fallback style.
- (af_property_get, af_autofitter_init): Updated.
-
- * src/autofit/afpic.c: Update use of `SCRIPT' and `STYLE' macros.
-
- * src/autofit/afranges.h: Update use of `SCRIPT' macro.
-
- * src/autofit/autofit.c [FT_CONFIG_OPTION_USE_HARFBUZZ]: Include
- `hbshim.c'.
-
- * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `hbshim.c'.
- (AUTOF_DRV_H): Add `afcover.h'.
-
- * builds/freetype.mk (INCLUDE_FLAGS) [DEVEL_DIR]: Use pkg-config for
- all libraries needed by FreeType.
-
-2013-12-21 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #40975 (sort of).
-
- * src/truetype/ttinterp.c (Ins_IP): Fix sign typo to make FreeType
- behave the same as the Windows TrueType engine for the invalid case.
-
-2013-12-21 Werner Lemberg <wl@gnu.org>
-
- [autofit] Make PIC mode work actually.
-
- * src/autofit/afpic.h (AFModulePIC): Fix array sizes to fit the
- enumeration values automatically generated by including `afscript.h'
- and friends.
-
- * src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
-
-2013-12-21 Werner Lemberg <wl@gnu.org>
-
- Fix PIC linking.
-
- * include/internal/ftrfork.h (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Fix
- generated function name.
-
- * src/base/basepic.c (FT_Init_Table_raccess_guess_table): Rename
- to ...
- (FT_Init_Table_ft_raccess_guess_table): ... this so that the
- function name correctly corresponds to what the macro framework
- expects.
-
- * src/psnames/rules.mk (PSNAMES_DRV_SRC_S): Use correct file name so
- that PIC functions are compiled also.
-
-2013-12-21 Werner Lemberg <wl@gnu.org>
-
- [base] Add missing dependencies to Makefile.
-
- * src/base/rules.mk (BASE_SRC): Add `basepic.c' and `ftpic.c'.
- (BASE_H): Add `basepic.h'.
-
-2013-12-20 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix PIC compilation.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths),
- src/autofit/aflatin.c (af_latin_metrics_init_widths)
- [FT_CONFIG_OPTION_PIC]: Declare `globals'.
-
- * src/autofit/afglobal.c: Always call AF_DEFINE_SCRIPT_CLASS, and
- AF_DEFINE_STYLE_CLASS.
-
- * src/autofit/afpic.c: Include `afglobal.h'.
- (autofit_module_class_pic_init): Typo.
-
- * src/autofit/aftypes.h (AF_DEFINE_SCRIPT_CLASS,
- AF_DEFINE_STYLE_CLASS): Don't use the same identifier for macro
- parameter and structure member.
-
-2013-12-20 Werner Lemberg <wl@gnu.org>
-
- [autofit] Introduce `styles'.
-
- This is the new top-level structure for handling glyph input data;
- scripts are now defined separately.
-
- * src/autofit/aftypes.h (SCRIPT): Updated.
- (AF_ScriptClassRec): Move `blue_stringset' and `writing_system'
- members to ...
- (AF_Style_ClassRec): ... this new structure.
- (AF_Style): New enumeration.
- (AF_StyleMetricsRec): Replace `script' enumeration with
- `style_class' pointer.
- (AF_DEFINE_SCRIPT_CLASS, AF_DECLARE_SCRIPT_CLASS): Updated.
- (AF_DEFINE_STYLE_CLASS, AF_DECLARE_STYLE_CLASS): New macros.
-
- * src/autofit/afstyles.h: New file, using data from `afscript.h'.
- * src/autofit/afscript.h: Updated.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths,
- af_cjk_metrics_init_blues, af_cjk_hint_edges): Updated.
-
- * src/autofit/afglobal.c (SCRIPT): Updated.
- (STYLE): Redefine macro to load `afstyles.h'.
- (af_script_names) [FT_DEBUG_LEVEL_TRACE]: Replace with...
- (af_style_names): ... this array.
- (af_face_globals_compute_script_coverage): Renamed to...
- (af_face_globals_compute_style_coverage): ... this.
- Updated.
- (af_face_globals_new, af_face_globals_free,
- af_face_globals_get_metrics): Updated.
-
- * src/autofit/afglobal.h (SCRIPT): Updated.
- (STYLE): Redefine macro to load `afstyles.h'.
- (AF_SCRIPT_FALLBACK): Update definition. This will get more
- refinements with later on.
- (AF_SCRIPT_UNASSIGNED): Replace with...
- (AF_STYLE_UNASSIGNED): ... this macro.
- (AF_FaceGlobalsRec): Updated.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths,
- af_latin_metrics_init_blues, af_latin_metrics_scale_dim,
- af_latin_hint_edges): Updated.
-
- * src/autofit/aflatin2.c (af_latin2_metrics_init_widths): Updated.
- (af_ltn2_uniranges): Removed.
-
- * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
- Updated.
-
- * src/autofit/afpic.c (autofit_module_class_pic_init): Updated.
- * src/autofit/afpic.h (AF_STYLE_CLASSES_GET): New macro.
- (AFModulePIC): Add `af_style_classes' and `af_style_classes_rec'
- members.
-
- * src/autofit/afranges.h: Updated.
-
- * src/autofit/rules.mk (AUTOF_DRV_H): Add `afstyles.h'.
-
-2013-12-19 Werner Lemberg <wl@gnu.org>
-
- [autofit] Factor scripts and uniranges out of writing system files.
-
- * src/autofit/afranges.c, src/autofit/afranges.h: New files.
-
- * src/autofit/afscript.h: Extend `SCRIPT' macro with more
- parameters, taking data from the writing system files.
-
- * src/autofit/aftypes.h: Updated.
-
- * src/autofit/afglobal.c: Include `afranges.h'.
- Load `afscript.h' to call AF_DEFINE_SCRIPT_CLASS.
- * src/autofit/afglobal.c: Include `afranges.h'.
- Load `afscript.h' to call AF_DECLARE_SCRIPT_CLASS.
-
- * src/autofit/afcjk.c, src/autofit/afcjk.h: Updated.
- * src/autofit/afdummy.c, src/autofit/afdummy.h: Updated.
- * src/autofit/afindic.c, src/autofit/afindic.h: Updated.
- * src/autofit/aflatin.c, src/autofit/aflatin.h: Updated.
- * src/autofit/aflatin2.c, src/autofit/aflatin2.h: Updated.
-
- * src/autofit/afpic.c: Updated.
-
- * src/autofit/autofit.c: Include `afranges.c'.
- * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afranges.c'.
-
-2013-12-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] More code orthogonality.
-
- * src/autofit/aftypes.h (AF_StyleMetrics): Replace `script_class'
- pointer to an `AF_ScriptClass' structure with `script' index of type
- `AF_Script'.
- Move some code around.
-
- * src/autofit/afcjk.c: Include `afpic.h'.
- (af_cjk_metrics_init_widths, af_cjk_metrics_init_blues,
- af_cjk_hint_edges): Updated.
-
- * src/autofit/aflatin.c: Include `afpic.h'.
- (af_latin_metrics_init_widths, af_latin_metrics_init_blues,
- af_latin_metrics_scale_dim, af_latin_hint_edges): Updated.
-
- * src/autofit/afglobal.c (af_face_globals_get_metrics): Updated.
-
- * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
- Updated.
-
-2013-12-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] s/ScriptMetrics/StyleMetrics/.
-
-2013-12-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] s/script_{metrics,hints}/style_{metrics,hints}/
-
-2013-12-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] s/gscripts/gstyles/.
-
-2013-12-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] s/glyph_scripts/glyph_styles/.
-
- This is the first commit of a series to create a new top-level
- structure (a `style') for handling scripts, writing_systems, and
- soon-to-be-added coverages.
-
-2013-12-17 Werner Lemberg <wl@gnu.org>
-
- [autofit] s/AF_Script_/AF_WritingSystem_/ where appropriate.
-
-2013-12-11 Infinality <infinality@infinality.net>
-
- [truetype] Simplify logic of rendering modes.
-
- This patch unifies the subpixel and non-subpixel cases.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): Remove
- `grayscale_hinting'; all code should refer to `grayscale' instead.
- Remove unused `native_hinting' member.
- Rename `subpixel_hinting' member to `subpixel.
-
- * src/truetype/ttgload.c (TT_LOADER_SET_PP): Updated.
- (tt_loader_init): Updated.
-
- * src/truetype/ttinterp.c (Ins_GETINFO): Simplify.
- Updated.
-
-2013-12-11 Werner Lemberg <wl@gnu.org>
-
- [documentation] Add section how to include FreeType header files.
- Problem reported by David Kastrup <dak@gnu.org>.
-
- Surprisingly, a description how to do that was completely missing in
- the API reference.
-
- * include/freetype.h, include/ftchapters.h: New documentation
- section `header_inclusion'.
-
-2013-12-10 Werner Lemberg <wl@gnu.org>
-
- [autofit] s/DFLT/NONE/, s/dflt/none/.
-
-2013-12-10 Werner Lemberg <wl@gnu.org>
-
- [autofit] s/AF_SCRIPT_NONE/AF_SCRIPT_UNASSIGNED/.
-
-2013-12-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix scaling of vertical phantom points.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Scale pp3.x and
- pp4.x also.
-
-2013-12-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix positioning of composite glyphs.
- Problem reported by Nigel Tao <nigeltao@golang.org>.
-
- * src/truetype/ttgload.c (TT_Hint_Glyph): Remove code that shifts
- the glyph (component) by a fractional value computed from the LSB
- phantom point. This is wrong, since the horizontal phantom points
- get rounded horizontally later on.
-
-2013-12-08 Werner Lemberg <wl@gnu.org>
-
- * Version 2.5.2 released.
- =========================
-
-
- Tag sources with `VER-2-5-2'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.5.2.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.5.1/2.5.2/, s/251/252/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
-
- * builds/unix/configure.raw (version_info): Set to 17:1:11.
- * CMakeLists.txt (VERSION_PATCH): Set to 2.
- * docs/CHANGES: Updated.
-
-2013-12-07 Werner Lemberg <wl@gnu.org>
-
- [truetype] Next round in phantom point handling.
-
- Greg Hitchcock provided very interesting insights into the
- complicated history of the horizontal positions of the TSB and BSB
- phantom points.
-
- * src/truetype/ttgload.c (TT_LOADER_SET_PP)
- [TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Use `subpixel_hinting' and
- `grayscale_hinting' flags as conditionals for the x position of TSB
- and BSB.
-
-2013-12-05 Werner Lemberg <wl@gnu.org>
-
- * builds/freetype.mk (FT_CC): Removed. Unused.
-
-2013-12-04 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix handling of embedded bitmap strikes.
-
- This corrects the commit from 2013-11-21. Problem reported by
- Andrey Panov <panov@canopus.iacp.dvo.ru>.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Fix logic to
- detect excessive bytes for bit-aligned bitmaps.
-
-2013-12-03 Werner Lemberg <wl@gnu.org>
-
- [truetype] Remove dead code.
-
- Reported by Nigel Tao <nigeltao@golang.org>.
-
- * include/internal/tttypes.h (TT_LoaderRec): Remove unused
- `preserve_pps' field.
- * src/truetype/ttgload.c (TT_Hint_Glyph): Updated.
-
-2013-12-03 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix phantom point handling.
-
- This is a further improvement to the changes from 2013-11-06.
-
- * src/truetype/ttgload.c (TT_Hint_Glyph): Horizontal phantom points
- are rounded horizontally, vertical ones are rounded vertically.
- (TT_LOADER_SET_PP): The horizontal position of vertical phantom
- points in pre-ClearType mode is zero, as shown in the OpenType
- specification.
-
-2013-12-02 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix change from 2013-11-20.
-
- Problem reported by Akira Kakuto <kakuto@fuk.kindai.ac.jp>.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Protect call to
- `Update_Max' with both a TT_USE_BYTECODE_INTERPRETER guard and a
- `IS_HINTED' clause.
- Also remove redundant check using `maxSizeOfInstructions' – in
- simple glyphs, the bytecode data comes before the outline data, and
- a validity test for this is already present.
-
-2013-11-27 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix use of dumping functions in `ftgrid' demo program.
-
- * src/autofit/afhints.c (AF_DUMP) [FT_DEBUG_AUTOFIT]: New macro.
- (af_glyph_hints_dump_points, af_glyph_hints_dump_segments,
- af_glyph_hints_dump_edges) [FT_DEBUG_AUTOFIT]: Add parameter to
- handle output to stdout.
- Use AF_DUMP.
- (af_glyph_hints_dump_points, af_glyph_hints_dump_segments,
- af_glyph_hints_dump_edges) [!FT_DEBUG_AUTOFIT]: Removed.
-
-2013-11-25 Werner Lemberg <wl@gnu.org>
-
- * Version 2.5.1 released.
- =========================
-
-
- Tag sources with `VER-2-5-1'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.5.1.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.5.0/2.5.1/, s/250/251/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
- * builds/unix/configure.raw (version_info): Set to 17:0:11.
- * CMakeLists.txt (VERSION_PATCH): Set to 1.
- * docs/CHANGES, docs/release: Updated.
-
-2013-11-23 Werner Lemberg <wl@gnu.org>
-
- [truetype]: Add tricky font names `hkscsiic.ttf' and `iicore.ttf'.
-
- * src/truetype/ttobjs.c (TRICK_NAMES_MAX_CHARACTERS,
- TRICK_NAMES_COUNT): Updated.
- (trick_names): Add family name for the two fonts.
-
-2013-11-23 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Typo.
-
-2013-11-21 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Typo.
-
- Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Return correct `bsize->width'
- value if the font lacks an `OS/2' table.
-
-2013-11-21 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Improve handling of buggy embedded bitmap strikes.
-
- We are now able to successfully load `AppleMyoungJo.ttf'.
- Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Don't trust glyph
- format.
-
-2013-11-20 Werner Lemberg <wl@gnu.org>
-
- [truetype] Don't trust `maxp's `maxSizeOfInstructions'.
-
- Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>; see
-
- https://lists.nongnu.org/archive/html/freetype-devel/2013-08/msg00005.html
-
- for details.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Check size of `fpgm' and `prep'
- tables also for setting `autohint'.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Use code from
- `TT_Process_Composite_Glyph' for handling unreliable values of
- `maxSizeOfInstructions'.
-
-2013-11-16 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix `OS/2' table version 5 support.
-
- We now follow the `official' announcement from Microsoft (on the
- OpenType mailing list, which unfortunately hasn't a public archive).
-
- * include/freetype/tttables.h (TT_OS2):
- s/usLowerPointSize/usLowerOpticalPointSize/,
- s/usUpperPointSize/usUpperOpticalPointSize/.
-
- * src/sfnt/ttload.c (tt_face_load_os2): Update, and set correct
- default values.
-
-2013-11-13 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ft2unix.h: Remove. No longer necessary.
-
- * builds/unix/install.mk (install): Updated.
-
-2013-11-13 Werner Lemberg <wl@gnu.org>
-
- Simplify header file hierarchy.
-
- This large patch changes the header file directory layout from
- `include/freetype/...' to `include/...', effectively removing one
- level. Since the file `ft2build.h' is also located in `include'
- (and it stays there even after installation), all FreeType header
- files are now in a single directory.
-
- Applications that use (a) `freetype-config' or FreeType's
- `pkg-config' file to get the include directory for the compiler, and
- (b) the documented way for header inclusion like
-
- #include <ft2build.h>
- #include FT_FREETYPE_H
- ...
-
- don't need any change to the source code.
-
- * include/freetype/*: Move up to...
- * include/*: ... this directory.
-
- * builds/amiga/include/freetype/*: Move up to...
- * builds/amiga/include/*: ... this directory.
-
- */*: Essentially do `s@/freetype/@/@' where appropriate.
-
- * CMakeLists.txt: Simplify.
- * builds/unix/freetype-config.in, builds/unix/freetype2.in: For
- `--cflags', return a single directory.
- * builds/unix/install.mk (install): No longer try to remove `cache'
- and `internal' subdirectories; instead, remove the `freetype'
- subdirectory.
-
-2013-11-12 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix last `truetype' commit.
-
- * src/truetype/ttgload.c (tt_get_metrics): Preserve stream position.
- Return error value.
- (load_truetype_glyph): Updated.
-
-2013-11-10 Werner Lemberg <wl@gnu.org>
-
- * docs/CMAKE: New dummy file.
-
-2013-11-08 Dave Arnold <darnold@adobe.com>
-
- [cff] Fix for hints that touch.
-
- * src/cff/cf2hints.c (cf2_hintmap_insertHint): Fix condition for
- finding index value of insertion point.
-
-2013-11-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix handling of phantom points in composite glyphs.
- Problem reported by Nigel Tao <nigeltao@golang.org>.
-
- This is a follow-up commit to the previous one.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Call
- `tt_get_metrics' after loading the glyph header.
-
-2013-11-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improve emulation of vertical metrics.
-
- This commit also improves the start values of vertical phantom
- points. Kudos to Greg Hitchcock for help.
-
- * src/truetype/ttgload.c (TT_Get_VMetrics): Add parameter to pass
- `yMax' value. Replace code with fixed Microsoft definition.
- (tt_get_metrics): Updated.
- (TT_LOADER_SET_PP): Add explanation how to initialize phantom
- points, taken from both the OpenType specification and private
- communication with Greg (which will eventually be added to the
- standard).
- Fix horizontal position of `pp3' and `pp4'.
-
- * src/truetype/ttgload.h: Updated.
-
- * src/truetype/ttdriver.c (tt_get_advances): Updated.
-
- * docs/CHANGES: Updated.
-
-2013-11-05 Werner Lemberg <wl@gnu.org>
-
- * builds/windows/vc2010/freetype.vcxproj: s/v110/v100/.
- PlatformToolSet version 110 is for VC2012.
-
- Problem reported (with solution) by Dave Arnold <darnold@adobe.com>.
-
-2013-11-05 Werner Lemberg <wl@gnu.org>
-
- [truetype] Correctly reset point tags for glyph components.
- Problem reported by Nigel Tao <nigeltao@golang.org>.
-
- * src/truetype/ttgload.c (TT_Process_Composite_Glyph): Fix loop.
-
-2013-11-02 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix GETINFO opcode handling of subpixel hinting bits.
-
- * src/truetype/ttinterp.c (Ins_GETINFO): Don't request bit 6 set to
- get info on subpixel hinting.
-
- * docs/CHANGES: Updated.
-
-2013-11-02 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #40451.
-
- Simply apply the patch from the bug report.
-
- * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h: The used #pragma directives only
- work with gcc versions 4.6 and higher.
-
-2013-11-01 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2013-11-01 Werner Lemberg <wl@gnu.org>
-
- [truetype] Minor code refactoring.
-
- Two benefits: The allocated FDEF (and IDEF) array gets slightly
- smaller, and the `ttdebug' demo program has access to function
- numbers without additional costs.
-
- Fortunately, no changes to FontForge are necessary – this is the
- only external TrueType debugger I know of, but others may exist and
- should check the code accordingly.
-
- * src/truetype/ttinterp.h (TT_CallRec): Replace `Cur_Restart' and
- `Cur_End' with a pointer to the corresponding `TT_DefRecord'
- structure.
-
- * src/truetype/ttinterp.c (DO_JROT, DO_JMPR, DO_JROF, Ins_ENDF,
- Ins_CALL, Ins_LOOPCALL, Ins_UNKNOWN, TT_RunIns <Invalid_Opcode>):
- Updated.
-
-2013-10-27 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Implement support for `OS/2' table version 5.
-
- See
-
- http://typedrawers.com/discussion/470/new-microsoft-size-specific-design-selection-mechanism
-
- for the announcement.
-
- * include/freetype/tttables.h (TT_OS2): Add fields
- `usLowerPointSize' and `usUpperPointSize'. Since FreeType returns
- this structure only as a pointer through `FT_Get_Sfnt_Table', there
- shouldn't be any ABI problems.
-
- * src/sfnt/ttload.c (tt_face_load_os2): Implement it.
-
- * docs/CHANGES: Updated.
-
-2013-10-24 Werner Lemberg <wl@gnu.org>
-
- * README.git, docs/CHANGES, docs/INSTALL: Updated.
-
-2013-10-24 John Cary <cary@txcorp.com>
-
- Provide cmake support.
-
- * CMakeLists.txt: New file.
-
-2013-10-23 Kenneth Miller <kennethadammiller@yahoo.com>
- Werner Lemberg <wl@gnu.org>
-
- Provide support for x64 builds in Visual C++ project files.
-
- * src/builds/win32: Renamed to...
- * src/builds/windows: This.
-
- * src/builds/windows/vc2010/*: Updated to handle x64 target.
-
- * src/builds/windows/*.mk, docs/INSTALL.GNU: s/win32/windows/ where
- appropriate.
-
-2013-10-22 Werner Lemberg <wl@gnu.org>
-
- * src/base/md5.c, src/base/md5.h: Updated to recent version.
-
- * src/base/ftobjs.c: Updated; `md5.c' no longer uses `free'.
-
- The canonical URL to get updates for this file is
-
- https://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/popa3d/popa3d/md5/
-
- as the author told me in private communication.
-
-2013-10-19 Werner Lemberg <wl@gnu.org>
-
- [autofit] s/SMALL_TOP/X_HEIGHT/.
-
- * src/autofit/afblue.dat: Updated.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/aflatin.c, src/autofit/aflatin.h,
- src/autofit/aflatin2.c: Updated.
-
-2013-10-19 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afblue.dat: s/MINOR/DESCENDER/.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
-2013-10-16 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add description strings to script entries.
-
- Currently, this is unused.
-
- * src/autofit/afscript.h: Do it.
- * src/autofit/afglobal.c, src/autofit/afpic.c,
- src/autofit/aftypes.h: Updated.
-
-2013-10-16 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve tracing message for extra light flag.
-
- * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Do it.
-
-2013-10-15 Chongyu Zhu <lembacon@gmail.com>
-
- [arm] Fix thumb2 inline assembly under LLVM.
-
- When using `ADD' with an immediate operand, the instruction is
- actually `ADD Rd, Rn, #<imm12>', that is, the maximum of the
- immediate operand cannot exceed 4095. It will fail to compile with
- LLVM.
-
- However, in GCC, due to some legacy compatibility considerations,
- `ADD.W' will be automatically emitted when the immediate operand is
- larger than 4095.
-
- * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h
- (FT_MulFix_arm) [__GNUC__]: Support clang compiler.
-
- * src/truetype/ttinterp.c (TT_MulFix14_arm) [__GNUC__]: Ditto.
-
-2013-10-12 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve tracing of `latin' hinter.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Report blue
- zone types.
- (af_latin_metrics_scale_dim): Report scaling changes due to x height
- alignment.
- Report scaled stroke width and blue zone values.
-
-2013-10-03 Dave Arnold <darnold@adobe.com>
-
- * src/cff/cf2font.c (cf2_computeDarkening): Avoid division by zero.
-
- Note that the old code avoided using a region of the piecewise
- linear function where the slope was zero. The recovery was to use a
- different section of the function, which produced a different,
- incorrect amount of darkening.
-
-2013-10-02 Darrell Bellert <darrell.bellert@hl.konicaminolta.us>
-
- * src/sfnt/ttload.c (tt_face_load_pclt): Fix `pclt_fields'.
-
-2013-10-02 Dave Arnold <darnold@adobe.com>
-
- * src/cff/cf2font.c (cf2_computeDarkening): Initialize darkenAmount.
-
- This line was lost in commit 89ca1fd6 (from 2013-06-25). The effect
- is to use a previous darkening amount when producing an unhinted,
- unscaled outline. This can cause autohint samples in ftgrid and
- ftview to be based on darkened CFF outlines instead of unhinted,
- undarkened ones.
-
-2013-09-29 Dave Arnold <darnold@adobe.com>
-
- Fix Savannah bug #39295.
-
- The bug was caused by switching to the initial hintmap (the one in
- effect when `moveto' executes) just before drawing the final element
- in the charstring. This ensured that the path was closed (in both
- Character Space and Device Space). But if the final element was a
- curve and if the final hintmap was different enough from the initial
- one, then the curve was visibly distorted.
-
- The first part of the fix is to draw the final curve using the final
- hintmap as specified by the charstring. This corrects the
- distortion but does not ensure closing in Device Space. It may
- require the rasterizer to automatically generate an extra closing
- line. Depending on the hintmap differences, this line could be from
- zero to a couple pixels in length.
-
- The second part of the fix covers the case where the charstring
- subpath is closed with an explicit line. We now modify that line's
- end point to avoid the distortion.
-
- Some glyphs in the bug report font (TexGyreHeros-Regular) that show
- the change are:
-
- 25ppem S (98)
- 24ppem eight (52)
- 25.5ppem p (85)
-
- Curves at the *end* of a subpath are no longer distorted. However,
- some of these glyphs have bad hint substitutions in the middle of a
- subpath, and these are not affected.
-
- The patch has been tested with a set of 106 fonts that shipped with
- Adobe Creative Suite 4, together with 756 Open Source CFF fonts from
- Google Fonts. There are 1.5 million glyphs, of which some 20k are
- changed with the fix. A sampling of a few hundred of these changes
- have been examined more closely, and the changes look good (or at
- least acceptable).
-
- * src/cff/cf2hints.h (CF2_GlyphPathRec): New element `pathIsClosing'
- to indicate that we synthesize a closepath line.
-
- * src/cff/cf2hints.c (cf2_glyphpath_init): Updated.
- (cf2_glyphpath_pushPrevElem): If closing, use first hint map (for
- `lineto' operator) and adjust hint zone.
- For synthesized closing lines, use end point in first hint zone.
- (cf2_glyphpath_lineTo): Take care of synthesized closing lines. In
- particular, shift the detection of zero-length lines from character
- space to device space.
- (cf2_glyphpath_closeOpenPath): Remove assertion.
- Updated.
-
-2013-09-25 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_{grek,cyrl}_uniranges): Fix arrays.
-
-2013-09-25 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [bdf, pcf] Refuse non-zero face_index.
-
- Suggested by Akira Tagoh, see
-
- https://lists.gnu.org/archive/html/freetype/2013-09/msg00030.html
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Return `Invalid_Argument'
- error if the font could be opened but non-zero `face_index' is
- given.
- * src/pcf/pcfdrivr.c (PCF_Face_Init): Ditto.
-
- * src/type42/t42objs.c (T42_Face_Init): Remove unrequired FT_UNUSED
- macro for `face_index' because it is validated later.
-
-2013-09-23 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #40090.
-
- * src/autofit/afcjk.c (af_cjk_metrics_scale): Revert commit
- 306f8c5d (from 2013-08-25) affecting this function.
-
-2013-09-22 Werner Lemberg <wl@gnu.org>
-
- [autofit] Disunify Cyrillic and Greek handling from Latin.
-
- * src/autofit/afscript.h: Add Cyrillic and Greek.
-
- * src/autofit/afblue.dat (AF_BLUE_STRINGSET_GREK,
- AF_BLUE_STRINGSET_CYRL): Add blue zones for Greek and Cyrillic.
- (AF_BLUE_STRINGSET_LATN): Fix typo.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/aflatin.c (af_grek_uniranges, af_cyrl_uniranges): New
- arrays.
- (af_grek_script_class, af_cyrl_script_class): New scripts.
- * src/autofit/aflatin.h: Updated.
-
-2013-09-20 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2013-09-20 Behdad Esfahbod <behdad@behdad.org>
-
- Fix vertical size of emboldened glyphs.
-
- Cf. https://bugzilla.gnome.org/show_bug.cgi?id=686709
-
- * src/base/ftsynth.c (FT_GlyphSlot_Embolden): Adjust `horiBearingY'
- also.
-
-2013-09-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * include/freetype/ftoutln.h: Correct FT_Outline_Get_Orientation
- algorithm description.
-
-2013-09-11 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve Hebrew rendering.
-
- This change introduces a new blue zone property
- `AF_BLUE_PROPERTY_LATIN_LONG' to make the auto-hinter ignore short
- top segments.
-
- * src/autofit/afblue.dat: Fix Hebrew blue strings.
- Use AF_BLUE_PROPERTY_LATIN_LONG for AF_BLUE_STRING_HEBREW_TOP.
-
- * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_LONG): New macro.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Updated.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Handle
- `AF_LATIN_IS_LONG_BLUE'.
-
- * src/autofit/aflatin.h (AF_LATIN_IS_LONG_BLUE): New macro.
-
-2013-08-28 Behdad Esfahbod <behdad@google.com>
-
- [sfnt] Fix frame access while reading WOFF table directory.
-
- * src/sfnt/sfobjs.c (woff_open_font): Using single memory frame
- while reading the directory entries for the whole loop.
-
-2013-08-29 Werner Lemberg <wl@gnu.org>
- Behdad Esfahbod <behdad@google.com>
-
- Implement support for WOFF containers.
-
- We simply synthesize a SFNT from the WOFF, create a memory stream
- for the new data, and load the SFNT as usual.
-
- Does NOT add any API to access WOFF metadata or private blocks.
-
- * include/freetype/internal/tttypes.h (WOFF_HeaderRec,
- WOFF_TableRec): New structures.
-
- * include/freetype/tttags.h (TTAG_wOFF): New macro.
-
- * src/base/ftobjs.c (FT_Open_Face): Set `stream' after calling
- `open_face'.
-
- * src/sfnt/sfobjs.c [FT_CONFIG_OPTION_SYSTEM_ZLIB]: Include
- `FT_GZIP_H'.
- (WRITE_BYTE, WRITE_USHORT, WRITE_ULONG): New temporary macros for
- writing to a stream.
- (sfnt_stream_close, compare_offsets, woff_open_font): New functions.
- (sfnt_open_font): Handle `TTAG_wOFF'.
- (sfnt_init_face): Set `stream' after calling `sfnt_open_font'.
-
- * src/truetype/ttobjs.c (tt_face_init): Set `stream' after calling
- `sfnt->init_face'.
-
- * src/base/ftobjs.c (open_face): Use a pointer to FT_Stream as an
- argument so that a changed stream survives.
- Update callers.
-
-2013-08-28 Werner Lemberg <wl@gnu.org>
-
- [gzip] New function `FT_Gzip_Uncompress'.
-
- This is modeled after zlib's `uncompress' function. We need this
- for WOFF support.
-
- * include/freetype/ftgzip.h, src/gzip/ftgzip.c (FT_Gzip_Uncompress):
- New function.
-
- * src/gzip/rules.mk: Rewrite to better reflect dependencies.
-
-2013-08-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix `make multi' compilation.
-
- * src/autofit/afblue.cin, src/autofit/afblue.c: Don't include
- `afblue.h' but `aftypes.h'.
- * src/autofit/afcjk.c: Don't include `aftypes.h' but `afglobal.h'.
-
-2013-08-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix C++ compilation.
-
- * src/autofit/afglobal.c (af_face_globals_get_metrics),
- src/autofit/afdummy.c (af_dflt_script_class), src/autofit/afindic.c
- (af_deva_script_class): Use proper casts.
-
-2013-08-27 Behdad Esfahbod <behdad@google.com>
-
- * src/sfnt/ttload.c (tt_face_load_font_dir): Fix sign typos.
-
-2013-08-27 Behdad Esfahbod <behdad@google.com>
-
- FT_Open_Face: Improve external stream handling.
-
- If the font's `clazz->init_face' function wants to swap to new
- stream, handling of whether original stream was external could
- result to either memory leak or double free. Mark externality into
- face flags before calling `init_face' such that the clazz can handle
- external streams properly.
-
- * src/base/ftobjs.c (FT_Open_Face): Move code to set
- FT_FACE_FLAG_EXTERNAL_STREAM to...
- (open_face): This function.
-
-2013-08-27 Werner Lemberg <wl@gnu.org>
-
- Remove `FT_SqrtFixed' function.
-
- It's no longer used.
-
- * include/freetype/internal/ftcalc.h, src/base/ftcalc.c: Do it.
-
-2013-08-27 Werner Lemberg <wl@gnu.org>
-
- [autofit] While tracing, report script names instead of ID values.
-
- * src/autofit/afglobal.c (af_script_names) [FT_DEBUG_LEVEL_TRACE]:
- New array.
- * src/autofit/afglobal.h: Updated.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths,
- af_cjk_hint_edges): Use `af_script_names'.
- * src/autofit/aflatin.c (af_latin_metrics_init_widths,
- af_latin_hint_edges): Ditto.
-
-2013-08-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Report used script while hinting a glyph.
-
- * src/autofit/afcjk.c (af_cjk_hint_edges), src/autofit/aflatin.c
- (af_latin_hint_edges): Implement it.
-
-2013-08-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Hebrew script.
-
- * src/autofit/afblue.dat: Add blue strings for Hebrew.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/aflatin.c (af_hebr_uniranges): New array.
- (af_hebr_script_class): New script.
- * src/autofit/aflatin.h, src/autofit/afscript.h: Updated.
-
-2013-08-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve tracing messages.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Mention script
- ID in tracing message.
- (af_cjk_metrics_init_blues): Initialize `axis' outside of the inner
- loop.
- Improve tracing messages.
- (af_cjk_hint_edges) [FT_DEBUG_LEVEL_TRACE]: New variable
- `num_actions' to count hinting actions.
- Improve tracing messages.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths): Mention
- script ID in tracing message.
- (af_latin_metrics_init_blues, af_latin_hint_edges): Improve tracing
- messages.
-
-2013-08-26 Werner Lemberg <wl@gnu.org>
-
- Better tracing of loaded glyphs.
-
- Previously, the loading of a glyph was traced at level 4, if at all.
- With this change, all font loading routines emit a tracing message
- at level 1, making it easier to select tracing output (for example
- using F2_DEBUG="any:1 afhints:7 aflatin:7").
-
- * src/bdf/bdfdrivr.c (BDF_Glyph_Load): Add tracing message.
- * src/cff/cffdrivr.c (cff_glyph_load): Ditto.
- * src/cff/cffgload.c (cff_decoder_prepare): Improve tracing
- messages.
- * src/cid/cidgload.c (cid_load_glyph): Use level 1 for tracing
- message.
- * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Ditto.
- * src/pfr/pfrobjs.c (pfr_slot_load): Add tracing message.
- * src/truetype/ttgload.c (TT_Load_Glyph): Ditto.
- * src/type1/t1gload.c (T1_Load_Glyph): Ditto.
- * src/type42/t42objs.c (T42_GlyphSlot_Load): Ditto.
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.
-
-2013-08-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix script selection.
-
- * src/autofit/afglobal.c (af_face_globals_get_metrics): Use
- `AF_SCRIPT_DFLT', not value 0.
- Simplify code.
-
- * src/autofit/afscript.h: Sort by script name.
-
-2013-08-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Make `dummy' hinter work as expected.
-
- * src/autofit/afdummy.c (af_dummy_hints_init): Properly set scaling
- information.
- (af_dummy_hints_apply): Scale the glyphs.
-
-2013-08-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Make `cjk' module use blue stringsets.
-
- * src/autofit/afcjk.c (AF_CJK_MAX_TEST_CHARACTERS): Removed.
- (af_cjk_hani_blue_chars): Removed.
- (AF_CJK_BLUE_TYPE_*): Removed.
- (af_cjk_metrics_init_blues): Replace AF_CJK_MAX_TEST_CHARACTERS with
- AF_BLUE_STRING_MAX_LEN.
- Change loops to use offsets (in file `afblue.h') into the new arrays
- `af_blue_stringsets' and `af_blue_strings' (in file `afblue.c').
- Instead of three dimensions (as used in the old blue string array)
- we now use properties to do the same, saving one loop nesting level.
-
- * src/autofit/afcjk.h: Remove old enumeration values superseded by
- the new data in `afblue.h'.
- (AF_CJK_IS_TOP_BLUE, AF_CJK_IS_HORIZ_BLUE, AF_CJK_IS_FILLED_BLUE,
- AF_CJK_IS_RIGHT_BLUE): New macros, to be used in
- `af_cjk_metrics_init_blues'.
- (AF_CJK_BLUE_IS_RIGHT): Remove this now redundant enum value.
- (AF_CJK_BLUE_IS_TOP): Renamed to...
- (AF_CJK_BLUE_TOP): This.
- (AF_CJK_MAX_BLUES): Remove.
- (AF_CJKAxisRec): Updated.
-
-2013-08-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Typo.
-
- * src/autofit/afblue.hin, src/autofit/afblue.c (GET_UTF8_CHAR): Use
- cast.
-
-2013-08-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Synchronize `cjk' with `latin' module (and vice versa).
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths): Add tracing
- messages.
- (af_cjk_metrics_init_blues): Don't pass blue string array as
- argument but use the global array directly.
- Use `outline' directly.
- Update and add tracing messages.
- (af_cjk_metrics_init): Simplify code.
- (af_cjk_metrics_scale_dim): Improve tracing message.
- (af_cjk_metrics_scale): Synchronize.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths,
- af_latin_metrics_init_blues): Improve and add tracing messages.
-
-2013-08-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Make `latin' module use blue stringsets.
-
- * src/autofit/aflatin.c (AF_LATIN_MAX_TEST_CHARACTERS): Removed.
- (af_latin_blue_chars): Removed.
- (af_latin_metrics_init_blues): Replace AF_LATIN_MAX_TEST_CHARACTERS
- with AF_BLUE_STRING_MAX_LEN.
- Change loops to use offsets (in file `afblue.h') into the new arrays
- `af_blue_stringsets' and `af_blue_strings' (in file `afblue.c').
- Use `AF_LATIN_IS_SMALL_TOP_BLUE' macro.
-
- * src/autofit/aflatin.h: Remove old enumeration values superseded by
- the new data in `afblue.h'.
- (AF_LATIN_IS_TOP_BLUE): Updated definition.
- (AF_LATIN_IS_SMALL_TOP_BLUE): New macro.
- (AF_LATIN_MAX_BLUES): Remove.
- (AF_LatinAxisRec): Updated.
-
-2013-08-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue stringsets.
-
- * src/autofit/aftypes.h: Include `afblue.h'.
- (AF_ScriptClassRec): Add `blue_stringset' field.
- (AF_DEFINE_SCRIPT_CLASS): Updated.
-
- * src/autofit/autofit.c: Include `afblue.c'.
-
- * src/autofit/afcjk.c (af_hani_script_class), src/autofit/afdummy.c
- (af_dflt_script_class), src/autofit/afindic.c
- (af_deva_script_class), src/autofit/aflatin.c
- (af_latn_script_class), src/autofit/aflatin2.c
- (af_ltn2_script_class): Updated.
-
- * src/autofit/rules.mk (AUTOF_DRV_SRC): Add `afblue.c'.
-
-2013-08-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Introduce data file for blue strings.
-
- The idea is to have a central file which gets processed by a Perl
- script to create proper `.c' and `.h' files using templates. There
- are two other reasons to do that:
-
- . The data file should be easily readable. We use UTF-8 encoding
- which then gets converted to single bytes.
-
- . Since the number of supported scripts will increase soon, the
- current usage of blue string arrays is a waste of space. Using
- the Perl script it is possible to imitate jagged arrays,
- defining enumeration constants as offsets into the arrays.
-
- This commit only adds files without changing any functionality.
-
- * src/autofit/afblue.dat: New data file.
- * src/tools/afblue.pl: New Perl script for processing `afblue.dat'.
-
- * src/autofit/afblue.cin, src/autofit/afblue.hin: New template files
- for...
- * src/autofit/afblue.c, src/autofit/afblue.c: New source files.
- To avoid a dependency on Perl, we add them too.
-
-2013-08-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Enable new algorithm for `BBox_Cubic_Check'.
-
- * src/base/ftbbox.c: Enable new BBox_Cubic_Check algorithm, remove
- the old one.
- Improve comments.
-
-2013-08-18 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/unix-def.in (freetype2.pc): Don't set executable bit.
-
-2013-08-18 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #39804.
-
- * builds/unix/configure.raw (LIBPNG): Define and export.
- * builds/unix/freetype-config.in, builds/unix/freetype2.in: Handle
- libpng.
-
-2013-08-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Clean up BBox_Conic_Check.
-
- * src/base/ftbbox.c (BBox_Conic_Check): Remove redundant checks for
- extremum at the segment ends, which are already within the bbox.
- Slightly modify calculations.
-
-2013-08-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Finish experimental (disabled) BBox_Cubic_Check implementation.
-
- * src/base/ftbbox.c (BBox_Cubic_Check): Scale arguments to improve
- accuracy and avoid overflows.
-
-2013-08-13 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Refactor experimental (disabled) BBox_Cubic_Check.
-
- * src/base/ftbbox.c (BBox_Cubic_Check): Implement the minimum search
- as the mirror image of the maximum search implemented here...
- (update_max): New function.
-
-2013-08-06 John Tytgat <John.Tytgat@esko.com>
-
- Fix Savannah bug #39702.
-
- * src/cff/cffload.c (cff_index_get_pointers): Check for `cur_offset
- != 0'; this stronger test is mandated by the CFF specification.
- Fix test for INDEX structures which have one or more empty entries
- at the end.
-
-2013-08-05 Werner Lemberg <wl@gnu.org>
-
- Fix gcc pragmas, part 2.
-
- * src/truetype/ttinterp.c (TT_MulFix14_long_long,
- TT_DotFix14_long_long): `#pragma gcc diagnostic {push,pop}' has been
- introduced with gcc version 4.6.
-
-2013-08-05 Werner Lemberg <wl@gnu.org>
-
- Fix gcc pragmas.
-
- * src/truetype/ttinterp.c (TT_MulFix14_long_long,
- TT_DotFix14_long_long): Older gcc versions don't accept diagnostic
- pragmas within a function body.
-
-2013-08-05 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #39700.
-
- * builds/unix/ftconfig.h: Synchronize with
- `include/freetype/config/ftconfig.h'.
-
- * builds/vms/ftconfig.h: Ditto.
- Make the differences to the master `ftconfig.h' file as small as
- possible for easier maintenance.
-
-2013-08-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve handling of `near' points.
-
- Points which are very near to each other are now marked as such.
- The `weak' flag is then computed by using the `in' vector of the
- first and the `out' vector of the last point of a group of near
- points.
-
- For example, this fixes the rendering of glyph `Oslash' in
- `Roboto-Thin.ttf'.
-
- * src/autofit/afhints.h (AF_Flags): New value `AF_FLAGS_NEAR'.
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Introduce
- the heuristic value `near_limit' to decide whether the current point
- is near to the previous one, then set `AF_FLAG_NEAR' accordingly.
- Store good `in' vector (of last non-near point) in
- `last_good_in_{x,y}' and use it as an argument to
- `ft_corner_is_flat' if necessary.
-
-2013-08-02 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftcffdrv.h: Improve documentation.
- This is based on blog entries from David Lemon and Dave Arnold (both
- from Adobe) with kind permission. Dave also helped in
- proof-reading.
-
-2013-08-02 Werner Lemberg <wl@gnu.org>
-
- [autofit] Move declaration of scripts into separate file.
-
- This has the benefit that we don't need to duplicate the data at
- different places.
-
- * src/autofit/afscript.h: New file.
-
- * src/autofit/aftypes.h (AF_Script): Include `afscript.h' to define
- the enumeration values.
-
- * src/autofit/afglobal.c: Include `afscript.h' to get the script
- specific header files.
- (af_script_classes): Include `afscript.h' to fill this array.
-
- * src/autofit/afpic.c: Include `afscript.h' to get the script
- specific header files.
- (autofit_module_class_pic_init): Include `afscript.h' for
- initialization.
- * src/autofit/afpic.h (AF_SCRIPT_CLASSES_COUNT,
- AF_SCRIPT_CLASSES_REC_COUNT): Removed. Use `AF_SCRIPT_MAX' instead.
-
- * src/autofit/rules.mk (AUTOF_DRV_H): Updated.
-
-2013-08-02 Werner Lemberg <wl@gnu.org>
-
- [autofit] Move declaration of writing systems into separate file.
-
- This has the benefit that we don't need to duplicate the data at
- different places.
-
- * src/autofit/afwrtsys.h: New file.
-
- * src/autofit/aftypes.h (AF_WritingSystem): Include `afwrtsys.h' to
- define the enumeration values.
-
- * src/autofit/afglobal.c: Include `afwrtsys.h' to get the writing
- system specific header files.
- Include `afpic.h'.
- (af_writing_system_classes): Include `afwrtsys.h' to fill this
- array.
-
- * src/autofit/afpic.c: Include `afwrtsys.h' to get the writing
- system specific header files.
- (autofit_module_class_pic_init): Include `afwrtsys.h' for
- initialization.
- * src/autofit/afpic.h (AF_WRITING_SYSTEM_CLASSES_COUNT,
- AF_WRITING_SYSTEM_CLASSES_REC_COUNT): Removed. Use
- `AF_WRITING_SYSTEM_MAX' instead.
-
-2013-08-02 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix compilation with g++.
-
- * src/sfnt/pngshim.c (error_callback, read_data_from_FT_stream): Use
- cast.
- (Load_SBit_Png): Pacify compiler.
-
-2013-08-02 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
- Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix `make multi'.
-
- * include/freetype/config/ftconfig.h (FT_LOCAL_ARRAY,
- FT_LOCAL_ARRAY_DEF): New macros.
-
- * src/autofit/afglobal.c (af_writing_system_classes,
- af_script_classes): Use FT_LOCAL_ARRAY_DEF.
- * src/autofit/afglobal.h: Declare `af_writing_system_classes' and
- `af_script_classes'.
- * src/autofit/afloader.c: Include `afpic.h'.
-
-2013-08-01 Werner Lemberg <wl@gnu.org>
-
- Another round of cppcheck nitpicks.
-
- The call was (from the top-level of the FreeType tree):
-
- cppcheck --force \
- --enable=all \
- -I /usr/include \
- -I /usr/local/include \
- -I /usr/lib/gcc/i586-suse-linux/4.7/include \
- -I include \
- -I include/freetype \
- -I include/freetype/config \
- -I include/freetype/internal \
- -DFT2_BUILD_LIBRARY \
- . &> cppcheck.log
-
- using cppcheck git commit f7e93f99.
-
- Note that cppcheck still can't handle `#include FOO' (with `FOO' a
- macro).
-
- */* Improve variable scopes.
- */* Remove redundant initializations which get overwritten.
-
- * src/gxvalid/*: Comment out redundant code or guard it with
- FT_DEBUG_LEVEL_TRACE.
-
-2013-07-30 Werner Lemberg <wl@gnu.org>
-
- [autofit] Introduce `writing systems'.
-
- This patch adds a new top level to the auto-hinter's script class
- hierarchy. It defines `writing systems' which can contain multiple
- scripts.
-
- For example, the `latin' writing system (in file `aflatin.c') is
- able to support scripts like Latin, Cyrillic, Armenian, etc., which
- can be handled similarly.
-
- Scripts are now named using four-letter OpenType tags.
-
- * src/autofit/aftypes.h (AF_ScriptClassRec): Move relevant members
- to...
- (AF_WritingSystemClassRec): This new structure. It holds pointers
- to functions which can be shared among related scripts.
- (AF_WritingSystem): New enumeration.
- (AF_Script): Revised values using four-letter tags.
- (AF_DEFINE_WRITING_SYSTEM_CLASS): New macro.
- (AF_DEFINE_SCRIPT_CLASS): Updated.
-
- * src/autofit/afglobal.c (af_writing_system_classes): New global,
- constant array.
- (af_script_classes): Updated.
- (af_face_globals_free): Updated.
- Remove assertion.
- (af_face_globals_get_metrics): Updated.
-
- * src/autofit/afglobal.h (AF_SCRIPT_FALLBACK)
- [!AF_CONFIG_OPTION_CJK]: Handle this case.
-
- * src/autofit/afloader.c (af_loader_load_g, af_loader_load_glyph):
- Updated.
-
- * src/autofit/afpic.c (autofit_module_class_pic_init): Updated;
- initialize structures for both writing systems and scripts.
- * src/autofit/afpic.h: Updated.
- (AF_WRITING_SYSTEM_CLASSES_GET): New macro.
-
- * src/autofit/afcjk.c (af_cjk_writing_system_class): New writing
- system.
- (af_cjk_uniranges): Renamed to...
- (af_hani_uniranges): This.
- (af_cjk_script_class): Reduced and renamed to...
- (af_hani_script_class): This.
- * src/autofit/afcjk.h: Updated.
-
- * src/autofit/afdummy.c (af_dummy_writing_system_class): New writing
- system.
- (af_dummy_script_class): Reduced and renamed to...
- (af_dflt_script_class): This.
- * src/autofit/afdummy.h: Updated.
-
- * src/autofit/afindic.c (af_indic_writing_system_class): New writing
- system.
- (af_indic_uniranges): Renamed to...
- (af_deva_uniranges): This.
- (af_indic_script_class): Reduced and renamed to...
- (af_deva_script_class): This.
- * src/autofit/afcjk.h: Updated.
-
- * src/autofit/aflatin.c (af_latin_writing_system_class): New writing
- system.
- (af_latin_uniranges): Renamed to...
- (af_latn_uniranges): This.
- (af_latin_script_class): Reduced and renamed to...
- (af_latn_script_class): This.
- * src/autofit/aflatin.h: Updated.
-
- * src/autofit/aflatin2.c (af_latin2_writing_system_class): New
- writing system.
- (af_latin2_uniranges): Renamed to...
- (af_ltn2_uniranges): This.
- Synchronize ranges with `latin'.
- (af_latin2_script_class): Reduced and renamed to...
- (af_ltn2_script_class): This.
- * src/autofit/aflatin2.h: Updated.
-
-2013-07-30 Werner Lemberg <wl@gnu.org>
-
- [autofit] Variable renaming.
-
- * src/autofit/aftypes.h (AF_ScriptMetricsRec):
- s/clazz/script_class/.
- Update all users.
-
-2013-07-30 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- Ignore libpng-config under cross-building configuration,
- because it will return the flags for the hosting environment.
-
- * builds/unix/configure.raw: Ignore libpng-config when
- `cross_compiling' == yes.
-
-2013-07-30 Behdad Esfahbod <behdad@google.com>
-
- Prevent division by zero by a transparent color.
-
- * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra):
- Return 0 immediately, when alpha channel is zero.
-
-2013-07-25 Behdad Esfahbod <behdad@google.com>
-
- Add FT_FACE_FLAG_COLOR and FT_HAS_COLOR.
-
- Also disambiguate Google's color bitmap tables.
-
- * include/freetype/freetype.h (FT_FACE_FLAG_COLOR, FT_HAS_COLOR):
- New macros.
-
- * include/freetype/internal/tttypes.h (TT_SbitTableType): Add
- TT_SBIT_TABLE_TYPE_CBLC.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Handle FT_FACE_FLAG_COLOR.
-
- * src/sfnt/ttsbit.c (tt_face_load_sbit,
- tt_face_load_strike_metrics, tt_face_load_sbit_image): Handle
- TT_SBIT_TABLE_TYPE_CBLC.
-
-2013-07-24 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [sfnt] Fix for `make multi' target.
-
- * src/sfnt/pngshim.c (Load_SBit_Png): Use FT_LOCAL_DEF().
-
-2013-07-20 Werner Lemberg <wl@gnu.org>
-
- * docs/INSTALL.GNU: Updated.
-
-2013-07-20 Behdad Esfahbod <behdad@google.com>
-
- [sfnt] Fix `sbix' table version handling.
-
- * src/sfnt/ttsbit.c (tt_face_load_sbit) [TT_SBIT_TABLE_TYPE_SBIX]:
- USHORT version numbers are to be considered as `minor'.
-
-2013-07-19 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix segment classification for blue zones.
-
- The old code (essentially unchanged since the very beginning)
- incorrectly handled this configuration
-
- x -o- x
- / \
- / \
- / \
- o o
-
- as flat and this
-
- o o
- / /
- x| x|
- | |
- o---------------o
-
- as round. (`o' and `x' are on and off points, respectively).
-
- This is a major change which should improve the rendering results
- enormously for many TrueType fonts, especially in the range approx.
- 20-40ppem, fixing the appearance of many overshoots.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Look at the
- first and last points of the segment, not the points right before
- and after.
-
-2013-07-19 Behdad Esfahbod <behdad@google.com>
-
- [sfnt] `sbix' fix-ups.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Apple's `sbix' color bitmaps
- are rendered scaled and then the `glyf' outline rendered on top. We
- don't support that yet, so just ignore the `glyf' outline and
- advertise it as a bitmap-only font.
-
- * src/sfnt/ttsbit.c (tt_face_load_strike_metrics)
- [TT_SBIT_TABLE_TYPE_SBIX]: Return metrics in 26.6 units.
- (tt_face_load_sbix_image): Typo.
-
-2013-07-18 Behdad Esfahbod <behdad@google.com>
-
- [sfnt] Add support for Apple's `sbix' color bitmap table.
-
- * include/freetype/internal/tttypes.h (TT_SBit_MetricsRec): Widen
- fields to FT_Short and FT_UShort, respectively.
- (TT_SbitTableType): New enumeration.
- (TT_FaceRec): Add `sbit_table_type' field.
-
- * include/freetype/tttags.h (TTAG_sbix): New macro.
-
- * src/sfnt/pngshim.c (Load_SBit_Png): Pass a more generic
- FT_GlyphSlot argument instead FT_Bitmap.
- Add flag to control map and metrics handling.
- Update all users.
-
- * src/sfnt/ttsbit.c: Include `ttmtx.h'.
- (tt_face_load_eblc): Renamed to...
- (tt_face_load_sbit): This.
- Handle `sbix' bitmaps.
- (tt_face_free_eblc): Renamed to...
- (tt_face_load_sbit): This.
- Updated.
- (tt_face_load_strike_metrics): Handle `sbix' bitmaps.
- (tt_face_load_sbix_image): New function.
- (tt_sbit_decoder_alloc_bitmap, tt_sbit_decoder_load_image,
- tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned,
- tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png,
- tt_sbit_decoder_load_image, tt_sbit_decoder_load_bitmap): Don't pass
- and handle load flags.
- (tt_sbit_decoder_load_bitmap) [!FT_CONFIG_OPTION_USE_PNG]: Better
- handle formats 17-19.
- Move color to grayscale conversion to...
- (tt_face_load_sbit_image): Here.
- Handle `sbix' bitmaps.
-
- * src/sfnt/pngshim.h: Updated.
- * src/sfnt/ttsbit.h: Updated.
- * src/sfnt/sfdriver.c: Updated.
-
-2013-07-18 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Ignore invalid magic number in `head' or `bhed'.
-
- Other font engines seem to ignore it also. Problem reported by
- Hin-Tak Leung <htl10@users.sourceforge.net>.
-
- * src/sfnt/ttload.c (check_table_dir): Don't abort but warn only if
- we have an invalid magic number.
-
-2013-07-16 Werner Lemberg <wl@gnu.org>
-
- [smooth] Fix segfault caused by previous commit.
-
- * src/smooth/ftgrays.c (gray_set_cell): Always compute
- `ras.invalid'.
-
-2013-07-16 David Turner <digit@google.com>
-
- [smooth] Improve performance.
-
- Provide a work-around for an ARM-specific performance bug in GCC.
- This speeds up the rasterizer by more than 5%.
-
- Also slightly optimize `set_gray_cell' and `gray_record_cell' (which
- also improves performance on other platforms by a tiny bit (<1%).
-
- * src/smooth/ftgrays.c (FT_DIV_MOD): New macro.
- Use it where appropriate.
-
- (gray_record_cell, gray_set_cell, gray_move_to,
- gray_convert_glyph_inner): Streamline condition handling.
-
-2013-07-16 David Turner <digit@google.com>
-
- [truetype] Add assembler code for TT_MulFix14 and TT_DotFix14.
-
- This patch provides slightly optimized versions for ARM, x86, and
- x86_64 CPUs if built with GCC.
-
- Also remove some dead code.
-
- * src/truetype/ttinterp.c (TT_MulFix14_arm, TT_MulFix14_long_long,
- TT_DotFix14_long_long): New functions.
-
-2013-07-16 David Turner <digit@google.com>
-
- Optimize FT_MulFix for x86_64 GCC builds.
-
- This patch provides an optimized `FT_MulFix' implementation for
- x86_64 machines when FreeType is built with GCC, or compatible
- compilers like Clang.
-
- Example:
- bin/ftbench -p -t 5 -s 14 -f 0008 Arial.ttf
-
- Before:
-
- Load 4.863 us/op
- Load_Advances (Normal) 4.816 us/op
- Load_Advances (Fast) 0.028 us/op
- Render 2.753 us/op
- Get_Glyph 0.463 us/op
- Get_CBox 0.077 us/op
- Get_Char_Index 0.023 us/op
- Iterate CMap 13.898 us/op
- New_Face 12.368 us/op
- Embolden 0.028 us/op
- Get_BBox 0.302 us/op
-
- After:
-
- Load 4.617 us/op
- Load_Advances (Normal) 4.645 us/op
- Load_Advances (Fast) 0.027 us/op
- Render 2.789 us/op
- Get_Glyph 0.460 us/op
- Get_CBox 0.077 us/op
- Get_Char_Index 0.024 us/op
- Iterate CMap 13.403 us/op
- New_Face 12.278 us/op
- Embolden 0.028 us/op
- Get_BBox 0.301 us/op
-
- * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h
- (FT_MulFix_x86_64): New function.
-
-2013-07-16 David Turner <digit@google.com>
-
- Speed up ARMv7 support.
-
- When building for ARMv7 with thumb2 instructions, the optimized
- `FT_MulFix_arm' assembly routine was not being used.
-
- The reason for this is in the `ftconfig.h' header, namely:
-
- - The assembly routine uses the `smull' instruction which is not
- available when generating Thumb-1 machine code. It is available
- in Thumb-2 mode, though.
-
- - The header was written a long time ago before Thumb-2 became
- widely popular (e.g. with Android). So it simply doesn't use the
- assembly routine if the `__thumb__' built-in macro is defined.
-
- - When compiling in Thumb-2 mode, the compiler will define both
- `__thumb__' and `__thumb2__'.
-
- By checking for `(__thumb2__ || !__thumb__)', we ensure that the
- assembly routine is only avoided when generating Thumb-1 code.
-
- Given that this is performance-sensitive function, this improves
- `ftbench' as follows on a Galaxy Nexus:
-
- Before (us/op) After (us/op)
-
- - loading Arial.ttf glyphs at 14 ppem [1]
-
- Load 34.285 33.098
-
- - same operation with the light auto-hinter [2]
-
- Load 31.317 29.590
-
- - same operation without hinting [3]
-
- Load 6.143 5.376
-
- - loading Arial.ttf advances at 14 ppem [4]
-
- Load_Advances (normal) 34.216 33.016
- Load_Advances (fast) 0.176 0.176
-
- [1] ftbench -t 5 -p -s 14 -b a -f 0008 Arial.ttf
- [2] ftbench -t 5 -p -s 14 -b a -r 1 -f 0028 Arial.ttf
- [3] ftbench -t 5 -p -s 14 -b a -f 000a Arial.ttf
- [4] ftbench -t 5 -p -s 14 -b b -f 0008 Arial.ttf
-
- * builds/unix/ftconfig.in, include/freetype/config/ftconfig.h
- (FT_MULFIX_ASSEMBLER): Fix handling for ARMv7.
-
-2013-06-28 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2013-06-27 Werner Lemberg <wl@gnu.org>
-
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Fix bitmap width guard.
-
-2013-06-25 Werner Lemberg <wl@gnu.org>
-
- [cff] Add darkening limit to `darkening-parameters'.
-
- * src/cff/cffdrivr.c (cff_property_set): Add check.
-
-2013-06-25 Werner Lemberg <wl@gnu.org>
-
- [cff] Add `darkening-parameters' property.
-
- * include/freetype/ftcffdrv.h: Document it.
-
- * src/cff/cffdrivr.c (cff_property_set, cff_property_get): Handle
- `darkening-parameters' property.
-
- * src/cff/cf2font.h (CF2_FontRec): Add `darkenParams' array.
-
- * src/cff/cf2font.c (cf2_computeDarkening): Add `darkenParams'
- argument and use it.
- Update all callers.
-
- * src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Copy
- `darken_params' values.
-
- * src/cff/cffobjs.h (CFF_DriverRec): Add `darken_params' array.
-
- * src/cff/cffobjs.c (cff_driver_init): Set default values for
- `darken_params'.
-
-2013-06-25 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Code shuffling.
-
- * src/tools/docmaker/tohtml.py (re_url): Move regexp...
- * src/tools/docmaker/sources.py: ... to this file.
-
-2013-06-25 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Remove unused functions.
-
- * src/tools/docmaker/content.py (DocMarkup.get_start,
- DocBlock.get_markup_name): Removed.
- * src/tools/docmaker/tohtml.py (html_quote0, dump_html_code,
- HtmlFormatter.make_html_words): Removed.
-
-2013-06-25 Werner Lemberg <wl@gnu.org>
-
- * builds/freetype.mk (dll): Remove target.
-
- Problem reported by Jörg Günnewig <joerg.guennewig@googlemail.com>.
-
-2013-06-25 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Recognise URLs.
-
- * src/tools/docmaker/tohtml.py (re_url): New regular expression.
- (make_html_para): Use it.
-
-2013-06-19 Werner Lemberg <wl@gnu.org>
-
- * Version 2.5.0.1 released.
- ===========================
-
-
- Tag sources with `VER-2-5-0-1'.
-
- * include/freetype/config/ftoption.h: Undefine
- CFF_CONFIG_OPTION_OLD_ENGINE.
- * devel/ftoption.h: Define CFF_CONFIG_OPTION_OLD_ENGINE.
-
-2013-06-19 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/install.mk (install): Don't create `cache' directory.
-
- Found by Peter Breitenlohner <peb@mppmu.mpg.de>.
-
-2013-06-19 Werner Lemberg <wl@gnu.org>
-
- * Version 2.5.0 released.
- =========================
-
-
- Tag sources with `VER-2-5-0'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.5.0.
-
- * README, Jamfile (RefDoc),
- builds/win32/vc2005/freetype.vcproj, builds/win32/vc2005/index.html,
- builds/win32/vc2008/freetype.vcproj, builds/win32/vc2008/index.html,
- builds/win32/vc2010/freetype.vcxproj, builds/win32/vc2010/index.html,
- builds/win32/visualc/freetype.dsp,
- builds/win32/visualc/freetype.vcproj,
- builds/win32/visualc/index.html, builds/win32/visualce/freetype.dsp,
- builds/win32/visualce/freetype.vcproj,
- builds/win32/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.4.12/2.5.0/, s/2412/250/.
-
- * include/freetype/freetype.h (FREETYPE_MINOR): Set to 5.
- (FREETYPE_PATCH): Set to 0.
-
- * builds/unix/configure.raw (version_info): Set to 16:2:10.
-
- * src/base/ftobjs.c (FT_Open_Face): Pacify compiler.
- * src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIRP): Ditto.
-
-2013-06-18 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #39269.
-
- * src/base/ftgloadr.c (FT_GlyphLoader_CheckPoints): Free memory in
- case of reallocation failures.
-
-2013-06-18 Andrew Church <achurch+savannah@achurch.org>
-
- Fix Savannah bug #39266.
-
- If memory allocations fail at certain points while opening a font,
- FreeType can either crash due to a NULL dereference or leak memory.
-
- * include/freetype/internal/ftobjs.c (FT_Face_InternalRec,
- FT_LibraryRec): Make `refcount' a signed integer. If, for example,
- FT_Open_Face() fails in a memory allocation before the face's
- reference count is set to 1, a subsequent `FT_Done_Library' call
- would otherwise loop over `FT_Done_Face' 2^32 times before freeing
- the face.
-
- * src/base/ftobjs.c (open_face): Initialize `stream' and friends
- earlier.
- (FT_Open_Face) <Fail>: Behave correctly if `node' is NULL.
- (FT_Destroy_Module) <Fail>: Check that `renderer_clazz' is valid.
-
-2013-06-14 Werner Lemberg <wl@gnu.org>
-
- * src/smooth/ftgrays.c One final pragma to silence 64-bit MSVC.
-
-2013-06-06 Dave Arnold <darnold@adobe.com>
- Werner Lemberg <wl@gnu.org>
-
- [cff] Add code to Adobe's engine to handle ppem > 2000.
-
- * src/cff/cffgload.c (cff_slot_load): If we get
- FT_Err_Glyph_Too_Big, retry unhinted and scale up later on.
-
-2013-06-12 Werner Lemberg <wl@gnu.org>
-
- Another try on pragmas.
-
- * include/freetype/internal/ftdebug.h: Move pragmas to...
- * include/freetype/internal/internal.h: ... this file since it gets
- included by all source files.
- * include/freetype/internal/ftserv.h: Remove pragma which has no
- effect.
-
-2013-06-12 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftdebug.h: Disable MSVC warning C4127.
-
- This partially undoes commit 3f6e0e0c.
-
-2013-06-12 Werner Lemberg <wl@gnu.org>
-
- More compiler warning fixes.
-
- */*: Use cast to `FT_Bool' (or `Bool') where appropriate.
-
-2013-06-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improve handling of broken sbit advance widths.
-
- * src/truetype/ttgload.c (TT_Load_Glyph): Use the glyph's (scaled)
- `linearHoriAdvance' if the sbit's `horiAdvance' value is zero.
-
- Cf. font `Fixedsys Excelsior' v3.01 (FSEX300.ttf), glyph A, 16ppem.
-
-2013-06-10 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Improve embedded bitmap tracing.
-
- * src/base/ftobjs.c (FT_Request_Size): Move trace message regarding
- bitmap strike match to...
- (FT_Match_Size): This function.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_metrics,
- tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned,
- tt_sbit_decoder_load_compound, tt_sbit_decoder_load_png,
- tt_sbit_decoder_load_image): Decorate with tracing messages.
-
-2013-06-10 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #39160.
-
- * src/truetype/ttinterp.c (Ins_SDPVTL): Set projection vector too
- for the degenerate case.
-
-2013-06-09 David Turner <digit@google.com>
-
- * src/cache/ftcmanag.c (FTC_Manager_Reset): Add missing cache flush.
-
- This code, present since eight(!) years in the unused `CACHE'
- branch, has been forgotten to apply to the master branch. It's
- really amazing that noone has ever complained since
- `FTC_Manager_Reset' is pretty useless without flushing the cache.
-
-2013-06-07 Werner Lemberg <wl@gnu.org>
-
- Add and improve pragmas for MSVC compiler.
-
- * include/freetype/internal/ftdebug.h: Remove pragmas.
- * include/freetype/internal/ftserv.h: Use push and pop for pragmas.
- * include/freetype/internal/ftvalid.h: Handle warning C4324.
- * src/base/ftobjs.c: Use push and pop for pragmas.
- * src/gzip/ftgzip.c: Handle warning C4244.
-
-2013-06-07 Werner Lemberg <wl@gnu.org>
-
- [cff] s/cf2_getGlyphWidth/cf2_getGlyphOutline/.
-
- * src/cff/cf2font.c, src/cff/cf2font.h, src/cff/cf2ft.c: Do it.
-
-2013-06-06 Dave Arnold <darnold@adobe.com>
-
- [cff] Add early exit feature for width-only calls.
-
- This is for `FT_Get_Advance'.
-
- There are 7 places where the spec says the width can be defined:
-
- hstem/hstemhm
- vstem/vstemhm
- cntrmask/hintmask
- hmoveto
- vmoveto
- rmoveto
- endchar
-
- * src/cff/cf2intrp.c (cf2_doStems): Exit early for width-only calls,
- if possible.
-
- (cf2_interpT2CharString) <cf2_cmdHSTEM>, <cf2_cmdVSTEM>,
- <cf2_cmdVMOVETO>, <cf2_cmdENDCHAR>, <cf2_cmdHINTMASK>,
- <cf2_cmdRMOVETO>, <cf2_cmdHMOVETO>: Exit early for width-only calls.
-
-2013-06-06 Werner Lemberg <wl@gnu.org>
-
- Next round of compiler fixes.
-
- * builds/win32/ftdebug.c, builds/wince/ftdebug.c (ft_debug_init):
- Add proper cast.
-
- * include/freetype/internal/ftserv.h (FT_SERVICE_UNAVAILABLE): Fix
- cast.
- * include/freetype/internal/ftstream.h: Decorate stream and frame
- macros with `FT_Long' and `FT_ULong' as appropriate.
-
- * src/base/ftrfork.c (raccess_guess_darwin_hfsplus,
- raccess_guess_darwin_newvfs): Use cast.
-
- * src/bdf/bdflib.c (_bdf_set_default_spacing): Use cast.
-
- * src/cache/ftcmanag.c (FTC_Manager_Check): Fix cast.
- * src/cache/ftcmanag.h (FTC_ManagerRec): Ditto.
-
- * src/cff/cf2arrst.c (cf2_arrstack_setNumElements): Use cast.
- * src/cff/cf2ft.c (cf2_freeSeacComponent): Ditto.
- * src/cff/cffobjs.c (remove_subset_prefix, remove_style): Ditto.
-
- * src/cid/cidparse.c (cid_parser_new): Use cast.
-
- * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Use cast.
-
- * src/psaux/psobjs.c (reallocate_t1_table): Fix argument type.
-
- * src/raster/ftraster.c (ft_black_reset): Use cast.
-
- * src/truetype/ttgxvar.c (FT_Stream_FTell): Use cast.
- (ALL_POINTS): Fix cast.
-
- * src/type1/t1driver.c (t1_ps_get_font_value): Add casts.
- * src/type1/t1parse.c (T1_Get_Private_Dict): Add cast.
-
-2013-06-05 Dave Arnold <darnold@adobe.com>
-
- Fix more MSVC Win32 compiler warnings.
-
- * src/base/ftobjs.c: Fix typo in MS pragma.
-
- * src/base/bdflib.c (_bdf_set_default_spacing, _bdf_add_property):
- `lineno' is only used in debug mode.
-
- * src/cff/cf2ft.c (cf2_builder_moveTo): `params' is only used in
- debug mode.
-
-2013-06-05 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warnings.
-
- * include/freetype/internal/ftmemory.h: Decorate memory allocation
- macros with `FT_Long' where appropriate.
- Remove duplicate of FT_MEM_QRENEW_ARRAY definition.
-
- * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use
- cast.
-
- * src/base/ftobjs.c: Add warning disabling pragma for MSVC while
- including `md5.c'.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdESC>: Add
- cast.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Fix casts.
- (tt_sbit_decoder_load_bitmap): Beautification.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Initialize
- variables (earlier).
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Pacify compiler.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use unsigned constants
- where appropriate.
-
- * src/type1/t1load.c (T1_Get_MM_Var): Ditto.
-
-2013-06-04 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cf2font.c (cf2_getGlyphWidth): Initialize `advWidth'.
-
- Problem reported by Ingmar Sittl <ingmar.sittl@elektrobit.com>.
-
-2013-06-04 Werner Lemberg <wl@gnu.org>
-
- Apply fixes for cppcheck nitpicks.
-
- https://cppcheck.sourceforge.net/
-
- The call was (from the top-level of the FreeType tree):
-
- cppcheck --force \
- --enable=all \
- -I include \
- -I include/freetype/ \
- -I include/freetype/config/ \
- -I include/freetype/internal/ \
- . &> cppcheck.log
-
- Note that the current version heavily chokes on FreeType, delivering
- many wrong results. I will report those issues to the cppcheck team
- so that a newer version gives improved results hopefully.
-
- */* Improve variable scopes.
- */* Remove redundant initializations which get overwritten.
-
- * src/base/ftmac.c, builds/mac/ftmac.c (count_faces_scalable):
- Remove unused variable.
-
- * src/base/ftdbgmem.c (ft_mem_table_destroy): `table' can't be zero.
-
- * src/gxvalid/gxvkern.c (gxv_kern_subtable_fmt1_entry_validate):
- Remove functionless code.
-
- * src/tools/ftrandom.c (main): Fix memory leak.
-
-2013-06-03 Werner Lemberg <wl@gnu.org>
-
- Add CFF_CONFIG_OPTION_OLD_ENGINE configuration option.
-
- This controls whether the old FreeType CFF engine gets compiled into
- FreeType. It is now disabled by default.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (CFF_CONFIG_OPTION_OLD_ENGINE): New macro.
-
- * src/cff/cffdrivr.c (cff_property_set), src/cff/cffgload.c
- (CFF_Operator, cff_argument_counts, cff_builder_add_point,
- cff_operator_seac, cff_decoder_parse_charstrings, cff_slot_load),
- src/cff/cffgload.h, src/cff/cffobjs.c (cff_driver_init): Use
- CFF_CONFIG_OPTION_OLD_ENGINE to guard the affected code.
-
- * docs/CHANGES: Updated.
-
-2013-06-02 Werner Lemberg <wl@gnu.org>
-
- Fix PNG library handling.
-
- * builds/unix/configure.raw: Don't use LIBPNG_LIBS but
- LIBPNG_LDFLAGS.
-
-2013-05-23 Behdad Esfahbod <behdad@google.com>
-
- Add support for color embedded bitmaps (eg. color emoji).
-
- A new load flag, FT_LOAD_COLOR, makes FreeType load color
- embedded-bitmaps, following this draft specification
-
- https://color-emoji.googlecode.com/git/specification/v1.html
-
- which defines two new SFNT tables, `CBDT' and `CBLC' (named and
- modeled after `EBDT' and `EBLC', respectively). The color bitmaps
- are stored in the new FT_PIXEL_MODE_BGRA format to represent BGRA
- pre-multiplied sRGB images. If PNG support is available, PNG color
- images as defined in the same proposed specification are supported
- also.
-
- Note that color bitmaps are converted to grayscale if client didn't
- ask for color.
-
- * builds/unix/configure.raw: Search for libpng.
- Add `--without-png' option.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (FT_CONFIG_OPTION_USE_PNG): New macro.
-
- * include/freetype/freetype.h (FT_LOAD_COLOR): New load flag.
-
- * include/freetype/ftimage.h (FT_Pixel_Mode): Add
- `FT_PIXEL_MODE_BGRA'.
-
- * include/freetype/tttags.h (TTAG_CBDT, TTAG_CBLC): New tags.
-
- * src/base/ftbitmap.c (FT_Bitmap_Embolden): Updated.
- (ft_gray_for_premultiplied_srgb_bgra): New function.
- (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_BGRA.
-
- * src/sfnt/pngshim.c, src/sfnt/pngshim.h: New files.
-
- * src/sfnt/sfnt.c: Include `pngshim.c'.
-
- * src/sfnt/ttsbit.c: Include FT_BITMAP_H and `pngshim.h'
- (tt_face_load_eblc): Load `CBLC'.
- (tt_sbit_decoder_init): Load `CBDT'.
- (tt_sbit_decoder_alloc_bitmap): Pass load flags to select between
- color and grayscale bitmaps.
- Set `num_grays'. This is used by `ftview' to choose the blending
- algorithm.
- (tt_sbit_decoder_load_byte_aligned,
- tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_compound,
- tt_sbit_decoder_load_image): Pass load flag.
- s/write/pwrite/.
- Don't call `tt_sbit_decoder_alloc_bitmap'.
- Updated.
- (tt_sbit_decoder_load_png) [FT_CONFIG_OPTION_USE_PNG]: New function.
- (tt_sbit_decoder_load_bitmap): Pass load flag.
- Handle new glyph formats 17, 18, and 19.
- Call `tt_sbit_decoder_alloc_bitmap'.
- Flatten color bitmaps if necessary.
- (tt_face_load_sbit_image): Updated.
-
- * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `pngshim.c'.
-
- * docs/CHANGES: Updated.
-
-2013-05-24 Guenter <info@gknw.net>
-
- Apply Savannah patch #8055.
-
- Make `apinames' create an import file for NetWare.
-
- * src/tools/apinames.c (PROGRAM_VERSION): Set to 0.2.
- (OutputFormat): Add `OUTPUT_NETWARE_IMP'.
- (names_dump): Handle it.
- (usage): Updated.
- (main): Handle new command line flag `-wN'.
-
-2013-05-23 Behdad Esfahbod <behdad@behdad.org>
-
- Compilation fix.
-
- * src/truetype/ttinterp.c (TT_RunIns)
- [!TT_CONFIG_OPTION_SUBPIXEL_HINTING]: Make it work.
-
-2013-05-22 Infinality <infinality@infinality.net>
-
- [truetype] Formatting and an additional subpixel tweak.
-
- * src/truetype/ttinterp.c (Ins_SHPIX): Formatting fix.
- * src/truetype/ttsubpix.c (SKIP_NONPIXEL_Y_MOVES_Rules):
- Revert previous modification for Verdana clones.
-
-2013-05-22 Infinality <infinality@infinality.net>
-
- [truetype] Adjust subpixel zp2 moves and tweak rules.
-
- These modifications fix thin diagonal stems in some legacy fonts.
-
- * src/truetype/ttinterp.c (Direct_Move_X): Remove unused macro.
- (Move_Zp2_Point): Don't always disable x moves for subpixel rendering.
- (Ins_SHP): Disable x moves here for subpixel rendering.
- (Ins_SHPIX): Only disable x moves in compatibility mode.
- Split out zp2 move reversals and reorder conditional respectively.
-
- * src/truetype/ttsubpix.c (SKIP_NONPIXEL_Y_MOVES_Rules): Fix oversight.
- Only adjust Verdana clones for 17 ppem.
- (SKIP_NONPIXEL_Y_MOVES_Rules_Exceptions): Add Courier New.
- (ALWAYS_SKIP_DELTAP_Rules): Found additional cases for Arial `s'.
-
-2013-05-20 Infinality <infinality@infinality.net>
-
- [truetype] Simplify and improve subpixel function detection.
-
- Some small enhancements have allowed the removal of many macros and
- the simplification of existing rules in `ttsubpix.c'.
-
- * src/truetype/ttsubpix.h (SPH_TWEAK_ALLOW_X_DMOVEX,
- SPH_TWEAK_ALLOW_X_MOVE_ZP2,
- SPH_TWEAK_DELTAP_SKIP_EXAGGERATED_VALUES,
- SPH_TWEAK_SKIP_INLINE_DELTAS, SPH_TWEAK_MIRP_CVT_ZERO): Removed.
- (SPH_TWEAK_SKIP_NONPIXEL_Y_MOVES_DELTAP): New rule macro.
-
- * src/truetype/ttsubpix.c: Updated affected rules.
-
- * src/truetype/ttinterp.c (Direct_Move_X): Updated.
- (INS_FDEF): Add additional function detection.
- (INS_ENDF): Set runtime flag.
- (Ins_CALL): Skip the call under certain conditions.
- Remove bad code.
- (Ins_LOOPCALL): Skip the call under certain conditions.
- Remove bad code.
- (Move_Zp2_Point): Updated.
- (Ins_SHPIX): Updated.
- Skip the move under some situations.
- (Ins_MIAP): Improve conditions.
- (Ins_MIRP): Updated.
- (Ins_DELTAP): Skip move under certain conditions.
- Simplify conditions.
- (TT_RunIns): Updated.
- Add code to handle new function detection.
- Trace messages.
-
-2013-05-17 Werner Lemberg <wl@gnu.org>
-
- Update more FT_Err_XXX macros using FT_ERR and FT_THROW;
-
- * builds/amiga/src/base/ftsystem.c, builds/mac/ftmac.c,
- builds/unix/ftsystem.c, builds/vms/ftsystem.c: Do it.
-
-2013-05-15 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add `interpreter-version' property.
-
- This makes the option TT_CONFIG_OPTION_SUBPIXEL_HINTING controllable
- at runtime.
-
- * include/freetype/ftttdrv.h: New file.
-
- * include/freetype/config/ftheader.h (FT_TRUETYPE_DRIVER_H): New
- macro.
-
- * src/truetype/ttdriver.c: Include FT_TRUETYPE_DRIVER_H.
- (tt_property_set, tt_property_get): Fill templates.
-
- * src/truetype/ttobjs.h (TT_DriverRec): Add `interpreter_version'
- member.
- Remove unused `extension_component' member.
-
- * src/truetype/ttgload.c: Include FT_TRUETYPE_DRIVER_H.
- (tt_get_metrics, TT_Hint_Glyph, TT_Process_Simple_Glyph,
- compute_glyph_metrics, tt_loader_init): Use `interpreter_version'.
-
- * src/truetype/ttinterp.c: Include FT_TRUETYPE_DRIVER_H.
- (SUBPIXEL_HINTING): New macro to check `interpreter_version' flag.
- Update all affected functions to use it.
- Use TT_INTERPRETER_VERSION_XXX where appropriate.
-
- * src/truetype/ttobjs.c: Include FT_TRUETYPE_DRIVER_H.
- (tt_driver_init): Initialize `interpreter_version'.
-
- * src/truetype/ttsubpix.c: Include FT_TRUETYPE_DRIVER_H.
- Use TT_INTERPRETER_VERSION_XXX where appropriate.
-
-2013-05-13 Werner Lemberg <wl@gnu.org>
-
- [truetype] Avoid empty source file.
-
- * src/truetype/ttsubpix.c [!TT_CONFIG_OPTION_SUBPIXEL_HINTING]:
- Provide dummy typedef.
-
-2013-05-13 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cf2font.c (cf2_getGlyphWidth): Fix uninitialized variable.
-
- Fix suggested by Vaibhav Nagarnaik <vnagarnaik@gmail.com>.
-
-2013-05-13 Brian Nixon <bnixon@yahoo.com>
-
- Fix Savannah bug #38970.
-
- * src/base/ftdebug.c, builds/win32/ftdebug.c,
- builds/wince/ftdebug.c, builds/amiga/src/base/ftdebug.c
- (ft_debug_init): Don't read past the environment variable FT2_DEBUG.
-
-2013-05-12 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add framework for TrueType properties.
-
- * src/truetype/ttdriver.c: Include FT_SERVICE_PROPERTIES_H.
- (tt_property_set, tt_property_get): New functions, still empty.
- Define `tt_service_properties' service.
- Update `tt_services'.
-
- * src/truetype/ttpic.h: Include FT_SERVICE_PROPERTIES_H.
- (TT_SERVICE_PROPERTIES_GET): New macro.
- (TTModulePIC): Add `tt_service_properties'.
-
-2013-05-12 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #38967.
-
- * src/base/ftcalc.c (FT_DivFix) [FT_LONG64]: Fix cast.
-
-2013-05-12 Werner Lemberg <wl@gnu.org>
-
- Introduce unsigned 64bit type (if available).
-
- * include/freetype/config/ftconfig.h: Define FT_UINT64 if available.
- [FT_LONG64]: Provide FT_UInt64.
-
- * builds/unix/ftconfig.in: Synchronized.
-
-2013-05-12 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #38968.
-
- * include/freetype/ftmodapi.h: Add `FT_EXPORT' to
- FT_Property_{Set,Get}.
- * src/base/ftobjs.c: Add `FT_EXPORT_DEF' to
- FT_Property_{Set,Get}.
-
-2013-05-10 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Clean up bitmap code.
-
- * src/sfnt/ttsbit.c: Deleted.
- * src/sfnt/ttsbit0.c: Renamed to `ttsbit.c'.
- * rules.mk (SFNT_DRV_H): Updated.
-
-2013-05-10 Werner Lemberg <wl@gnu.org>
-
- */* [FT_CONFIG_OPTION_OLD_INTERNALS]: Remove macro and guarded code.
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2013-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/ChangeLog.26 b/freetype/ChangeLog.26
deleted file mode 100644
index a4fc0606..00000000
--- a/freetype/ChangeLog.26
+++ /dev/null
@@ -1,5711 +0,0 @@
-2016-07-12 Werner Lemberg <wl@gnu.org>
-
- * Version 2.6.5 released.
- =========================
-
-
- Tag sources with `VER-2-6-5'.
-
- This commit immediately follows `[mac] Fix ftexport.sym target in
- Jamfile.' on a separate branch, which was then merged with master
- after the release.
-
- * include/freetype/config/ftoption.h
- (TT_CONFIG_OPTION_SUBPIXEL_HINTING): Comment out.
-
- * docs/VERSION.TXT: Add entry for version 2.6.5.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.6.4/2.6.5/, s/264/265/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 5.
-
- * builds/unix/configure.raw (version_info): Set to 18:5:12.
- * CMakeLists.txt (VERSION_PATCH): Set to 5.
-
- * docs/CHANGES: Updated.
-
-2016-07-11 Werner Lemberg <wl@gnu.org>
-
- Conditionally compile environment support.
-
- * include/freetype/internal/ftobjs.h, src/autofit/afmodule.c,
- src/base/ftobjs.c, src/cff/cffdrivr.c, src/truetype/ttdriver.c:
- Decorate with `FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES' where
- necessary.
-
-2016-07-11 Werner Lemberg <wl@gnu.org>
-
- Handle properties in `FREETYPE_PROPERTIES' environment variable.
-
- This commit covers the most important one.
-
- * src/autofit/afmodule.c (af_property_set): Handle `warping',
- `darkening-parameters', and `no-stem-darkening'.
-
- * src/cff/cffdrivr.c (cff_property_set): Handle
- `darkening-parameters', `hinting-engine', and `no-stem-darkening'.
-
- * src/truetype/ttdriver.c (tt_property_set): Handle
- `interpreter-version'.
-
-2016-07-11 Werner Lemberg <wl@gnu.org>
-
- Replace calls to `atol' with `strtol'.
-
- We later on need strtol's `endptr' feature.
-
- * include/freetype/config/ftstdlib.h (ft_atol): Replace with...
- (ft_strtol): ... this.
-
- * src/base/ftdbgmem.c (ft_mem_debug_init): Updated.
- * src/cid/cidparse.c (cid_parser_new): Ditto.
- * src/type42/t42drivr.c (t42_get_name_index), src/type42/t42objs.c
- (T42_GlyphSlot_Load): Ditto.
-
-2016-07-10 Werner Lemberg <wl@gnu.org>
-
- Implement handling of `FREETYPE_PROPERTIES' environment variable.
-
- Recognizing properties follows in another commit.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES): New macro.
-
- * include/freetype/config/ftstdlib.h (ft_getenv): New macro.
-
- * src/base/ftinit.c (ft_set_default_properties): New function to
- parse `FREETYPE_PROPERTIES' and calling `ft_property_string_set'.
- (FT_Init_FreeType): Updated.
-
-2016-07-09 Werner Lemberg <wl@gnu.org>
-
- Add function `ft_property_string_set'.
-
- This is a preparation for handling an `FREETYPE_PROPERTIES'
- environment variable to control (some) driver properties.
-
- No change in functionality.
-
- * src/base/ftobjs.c (ft_property_do): Add `value_is_string'
- parameter.
- (ft_property_string_set): New function.
- (FT_Property_Set, FT_Property_Get): Updated.
-
- * include/freetype/internal/ftobjs.h: Updated.
-
- * include/freetype/internal/services/svprop.h
- (FT_Properties_SetFunc): Add `value_is_string' parameter.
-
- * src/autofit/afmodule.c (af_property_set), src/cff/cffdrivr.c
- (cff_property_set), src/truetype/ttdriver.c (tt_property_set):
- Updated, emitting an error currently if `value_is_string' is set.
-
-2016-07-09 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [mac] Fix ftexport.sym target in Jamfile.
-
- * Jamfile: Update the directories of the header files scanned for
- ftexport.sym. They were incorrect since the migration of the
- header files, on 2015-06-22. Either inexisting include/cache
- (removed on 2006-03-20) is not needed to be listed explicitly.
- Now ftmac.h is scanned only in the case of Mac OS & Mac OS X.
-
-2016-07-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Sub-banding protocol revision.
-
- Rasterization sub-banding is utilized at large sizes while using a
- rather small fixed memory pool. Indeed it is possible to make an
- educated guess how much memory is necessary at a given size for a
- given glyph. It turns out that, for a large majority of European
- glyphs, you should store about 8 times more boundary pixels than
- their height. Or, vice versa, if your memory pool can hold 800
- pixels the band height should be 100 and you should sub-band
- anything larger than that. Should you still run out of memory,
- FreeType bisects the band but you have wasted some time. This is
- what has been implemented in FreeType since the beginning.
-
- It was overlooked, however, that the top band could grow to twice
- the default band size leading to unnecessary memory overflows there.
- This commit fixes that. Now the bands are distributed more evenly
- and cannot exceed the default size.
-
- Now the magic number 8 is really suitable for rather simple European
- scripts. For complex Chinese logograms the magic number should be
- 13 but that is subject for another day.
-
- * src/smooth/ftgrays.c (gray_convert_glyph): Revise sub-banding
- protocol.
-
-2016-07-07 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [mac] Fix Savannah bug #48417.
-
- Mac OS X linker throws errors when `-exported_symbol_list' input
- file includes non-existing symbols. Reported by Ryan Schmidt.
-
- * builds/exports.mk: Exclude ftmac.h from the headers for apinames
- by default. Include it when ftmac.c would be compiled.
-
-2016-07-06 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (TInstruction_Function): Removed, unused.
-
-2016-07-05 Werner Lemberg <wl@gnu.org>
-
- * Version 2.6.4 released.
- =========================
-
-
- Tag sources with `VER-2-6-4'.
-
- * docs/VERSION.TXT: Update documentation and bump version number to
- 2.6.4.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.6.3/2.6.4/, s/263/264/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.
-
- * builds/unix/configure.raw (version_info): Set to 18:4:12.
- * CMakeLists.txt (VERSION_PATCH): Set to 4.
-
- * docs/CHANGES: Updated.
-
-2016-07-05 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Fix compiler warning.
-
-2016-07-04 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Variable type revision (part 2).
-
- * src/smooth/ftgrays.c (TArea): Restore original definition as `int'.
- (gray_render_line) [FT_LONG64]: Updated.
- (gray_convert_glyph): 32-bit band bisection stack should be 32 bands.
- (gray_convert_glyph_inner): Trace successes and failures.
-
-2016-07-04 Werner Lemberg <wl@gnu.org>
-
- [autofit] Handle single-point contours as segments.
-
- Doing so allows us to link them to edges – some fonts like
- `NotoSansGurmukhi-Regular' have such isolated points sitting exactly
- on other outlines.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments): Don't
- ignore one-point contours but handle them specially as one-point
- segments.
- (af_latin_hints_compute_edges): Append one-point segments to edges
- if possible.
-
-2016-07-02 Werner Lemberg <wl@gnu.org>
-
- [autofit] Remove unused structure members.
-
- * src/autofit/afhints.h (AF_SegmentRec, AF_EdgeRec): Remove
- `num_linked'.
-
- * src/autofit/afcjk.c (af_cjk_hints_link_segments): Updated.
-
-2016-07-02 Werner Lemberg <wl@gnu.org>
-
- [autofit] Update to Unicode 9.0.0.
-
- * src/autofit/afranges.c (af_arab_nonbase_uniranges,
- af_cyrl_uniranges): Add new data.
-
-2016-07-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Variable type revision (part 1).
-
- This patch restores original `TCoord' definition as `int' so that the
- rendering pool is used more efficiently on LP64 platforms (unix).
-
- * src/smooth/ftgrays.c (gray_TWorker, TCell, gray_TBand): Switch some
- fields to `TCoord'.
- (gray_find_cell, gray_render_scanline, gray_render_line, gray_hline,
- gray_sweep, gray_convert_glyph): Updated.
-
-2016-06-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Minor clean-ups.
-
- * src/smooth/ftgrays.c (gray_TWorker): Remove redundant `ycount'.
- (gray_sweep, gray_convert_glyph, gray_dump_cells): Updated.
-
-2016-06-27 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Minor clean-ups.
-
- * src/smooth/ftgrays.c (gray_convert_glyph): Do not use volatile
- qualifier.
- (gray_raster_render): Move span initializations from here.
- (gray_sweep): ... to here and remove unused `target' argument.
-
-2016-06-26 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [pcf] Fix handling of very large fonts (#47708).
-
- * src/pcf/pcfread.c (pcf_get_encodings): Make `encodingOffset' an
- unsigned short.
- Only reject `0xFFFF' as an invalid encoding offset.
-
-2016-06-25 Werner Lemberg <wl@gnu.org>
-
- [truetype] Really fix deallocation in case of error (#47726).
-
- * src/truetype/ttgload.c (load_truetype_glyph): Thinko; initialize
- `outline.points' also.
-
-2016-06-23 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Consolidate memory management.
-
- * src/smooth/ftgrays.c (gray_init_cells): Remove function.
- (gray_TWorker): Remove fields that become local variables.
- (gray_raster_render): Move rendering buffer declaration from here.
- (gray_convert_glyph): ... to here and update accordingly.
-
-2016-06-22 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Consolidate boundary checks.
-
- Removing the checks from `gray_hline' shaves 1% off rendering speed.
-
- * src/smooth/ftgrays.c [STANDALONE_]: Duplicate `FT_MIN' and `FT_MAX'.
- (gray_TWorker): No need to store `clip_box'.
- (gray_hline): Remove unnecessary boundary checks.
- (gray_convert_glyph): Move boundary checks from here.
- (gray_raster_render): ... to here and consolidate.
-
-2016-06-21 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Use `FT_Outline_Get_CBox'.
-
- * src/smooth/ftgrays.c [STANDALONE_]: Duplicate `FT_Outline_Get_CBox'.
- (gray_compute_cbox): Remove this function.
- (gray_convert_glyph): Update to use `FT_Outline_Get_CBox'.
-
-2016-06-20 Werner Lemberg <wl@gnu.org>
-
- [smooth] Remove compiler warnings.
-
- * src/smooth/ftgrays.c (gray_convert_glyph): Fix reports from clang.
-
-2016-06-20 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Sanitize memory management.
-
- * src/smooth/ftgrays.c (gray_convert_glyph): Cleaned up.
-
-2016-06-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Remove `band_shoot' that never worked.
-
- * src/smooth/ftgrays.c (gray_TWorker): Remove `band_shoot'.
- (gray_convert_glyph): Updated.
-
-2016-06-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [raster, smooth] Handle FT_RENDER_POOL_SIZE better.
-
- * src/raster/ftraster.c (FT_MAX_BLACK_POOL): New macro.
- (ft_black_render): Updated.
- * src/smooth/ftgrays.c (FT_MAX_GRAY_POOL): New macro.
- (gray_raster_render): Updated.
-
-2016-06-16 Werner Lemberg <wl@gnu.org>
-
- * src/base/md5.c: Updated to recent version.
-
-2016-06-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_hline): Optimize if-condition.
-
-2016-06-13 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Cherokee script.
-
- * src/autofit/afblue.dat: Add blue zone data for Cherokee.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Cherokee standard characters.
-
- * src/autofit/afranges.c: Add Cherokee data.
-
- * src/autofit/afstyles.h: Add Cherokee data.
-
-2016-06-09 David Capello <davidcapello@gmail.com>
-
- [cmake] Avoid modifying `ftconfig.h' and `ftoption.h' files.
-
- * CMakeLists.txt: Each time cmake is run those files are
- modified and the whole FreeType library is recompiled. With this
- change we change the files only if there are real modifications, so
- we can avoid recompilations.
-
-2016-06-09 Werner Lemberg <wl@gnu.org>
-
- [bdf] Check number of properties (#48166).
-
- * src/bdf/bdflib.c (_bdf_parse_start): Implement.
-
-2016-06-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Re-enable new line renderer on 64-bit archs.
-
- * src/smooth/ftgrays.c (gray_render_line): Conditionally re-enable new
- implementation, where it is safe from overflows.
-
-2016-06-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Minor clean-ups.
-
- * src/smooth/ftgrays.c (gray_dump_cells): Move out of the way.
- (gray_render_span): Remove spurious casts and streamline.
-
-2016-06-07 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Ethiopic script.
-
- * src/autofit/afblue.dat: Add blue zone data for Ethiopic.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Ethiopic standard characters.
-
- * src/autofit/afranges.c: Add Ethiopic data.
-
- * src/autofit/afstyles.h: Add Ethiopic data.
-
-2016-06-07 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix compilation with VS2016 (#48126).
-
- This compiler doesn't recognize the end-of-comment sequence `*/' if
- it immediately follows non-ASCII characters.
-
- * src/autofit/afscript.h: Ensure whitespace before `*/'.
-
-2016-06-04 Werner Lemberg <wl@gnu.org>
-
- Fix a test for named instances (#48122).
-
- This was missed while giving negative face indices an extended
- meaning.
-
- * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Implement.
-
-2016-05-31 Nikolaus Waxweiler <madigens@gmail.com>
-
- [truetype] Let SHPIX move points in the twilight zone in v40.
-
- * src/truetype/ttinterp.c (Ins_SHPIX): Allow SHPIX to move points in
- the twilight zone. Otherwise, treat SHPIX the same as DELTAP.
- Unbreaks various fonts such as older versions of Rokkitt and DTL
- Argo T Light that would glitch severely after calling ALIGNRP after a
- blocked SHPIX.
-
-2016-05-30 Werner Lemberg <wl@gnu.org>
-
- [type42] Support `CharStrings' entry format as created by LilyPond.
-
- * src/type42/t42parse.c (t42_parse_charstrings): Handle entries
- having the format
-
- (foo) cvn 12345 def
-
-2016-05-28 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afranges.c: Remove `UL' postfix from hex numbers.
-
- Suggested by Alexei. `UL' is only needed for 16bit compilers, but
- it seems noone is using this anymore (and we no longer test whether
- FreeType compiles in such an environment). Otherwise, it is easy to
- add the postfix to the `AF_UNICODE_RANGE' macro.
-
-2016-05-26 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Shrink bisection stack.
-
- The convergence of Bézier flatteners is fast with the deviation
- from straight line being asymptotically cut 4-fold on each bisection.
- This justifies smaller bisection stack size.
-
- * src/smooth/ftgrays.c (gray_TWorker): Remove common `bez_stack'.
- (gray_render_conic): Create and use conic `bez_stack'. Move back the
- band analysis from...
- (gray_conic_to): ... here.
- (gray_render_cubic): Create and use cubic `bez_stack'. Move back the
- band analysis from...
- (gray_cubic_to): ... here.
- (gray_move_to): Updated.
-
-2016-05-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fixes for Armenian and Gujarati ranges.
-
- * src/autofit/afranges.c (af_armn_uniranges): Corrected.
- (af_guru_nonbase_uniranges): Make U+0A3E a base character.
-
-2016-05-24 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Armenian script.
-
- * src/autofit/afblue.dat: Add blue zone data for Armenian.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Armenian standard characters.
-
- * src/autofit/afranges.c: Add Armenian data.
-
- * src/autofit/afstyles.h: Add Armenian data.
-
-2016-05-23 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/unix-cc.in (LINK_LIBRARY): Use `-export-symbols'.
-
- This was commented about 10 years ago – I think the reason then to
- disable libtool's `-export-symbols' option was to give some badly
- programmed applications access to internal FreeType functions.
-
- I believe that we should no longer take care of such programs; the
- number of symbols exported should be rather restricted as much as
- possible.
-
-2016-05-22 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Gurmukhi script.
-
- This essentially moves the Gurmukhi script from the `Indic' hinter to
- the `Latin' hinter.
-
- * src/autofit/afblue.dat: Add blue zone data for Gurmukhi.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Gurmukhi standard characters and move
- data out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Gurmukhi data out of
- AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afstyles.h: Update Gurmukhi data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2016-05-21 Werner Lemberg <wl@gnu.org>
-
- Minor clang++ fixes.
-
- * src/base/ftobjs.c (FT_Add_Module), src/psaux/psobjs.c
- (ps_parser_load_field), src/type1/t1load.c (parse_subrs): Add
- initializer.
-
- * src/cache/ftccache.h (FTC_CACHE_TRYLOOP_END): Avoid implicit
- conversion from NULL to boolean.
-
-2016-05-21 Werner Lemberg <wl@gnu.org>
-
- Work around a bug of the C 8.0.0.1 compiler on AIX 5.3 (#47955).
-
- * include/freetype/internal/ftmemory.h (cplusplus_typeof): Use
- braces for `extern "C++"'.
-
-2016-05-17 Nikolaus Waxweiler <madigens@gmail.com>
-
- [truetype] Make TT_LOADER_SET_PP support subpixel hinting [3/3].
-
- * src/truetype/ttgload.c (TT_LOADER_SET_PP): Replace macro with...
- (tt_loader_set_pp): ... this new function.
- Update all callers.
-
-2016-05-17 Nikolaus Waxweiler <madigens@gmail.com>
-
- [truetype] New implementation of v38 bytecode interpreter [2/3].
-
- This patch actually modifies the bytecode interpreter.
-
- See added comments in `ttinterp.h' for more information on this and
- the following commit in the series.
-
- * src/truetype/ttinterp.c (SUBPIXEL_HINTING): Replaced by...
- (NO_SUBPIXEL_HINTING, SUBPIXEL_HINTING_INFINALITY,
- SUBPIXEL_HINTING_MINIMAL): ...new macros.
- (Direct_Move, Direct_Move_X, Direct_Move_Y): Handle backward
- compatibility.
- Updated.
- (Ins_RS, Ins_FDEF, Ins_ENDF, Ins_CALL, Ins_LOOPCALL, Ins_MD):
- Updated.
- (Ins_INSTCTRL): Handle native ClearType mode flag.
- Updated.
- (Ins_FLIPPT, Ins_FLIPRGON, Ins_FLIPRGOFF): Handle backward
- compatibility.
- (Move_Zp2_Point): Ditto.
- (Ins_SHP): Updated.
- (Ins_SHPIX): Handle backward compatibility.
- Updated.
- (Ins_MSIRP, Ins_MDAP, Ins_MIAP, Ins_MDRP, Ins_MIRP): Updated.
- (Ins_ALIGNRP): Updated.
- (Ins_IUP, Ins_DELTAP): Handle backward compatibility.
- Updated.
- (Ins_GETINFO): Handle v38 flags.
- Updated.
- (TT_RunIns): Handle backward compatibility mode.
- Updated.
-
-2016-05-17 Nikolaus Waxweiler <madigens@gmail.com>
-
- [truetype] New implementation of v38 bytecode interpreter [1/3].
-
- This patch prepares data structures and the like.
-
- See added comments in `ttinterp.h' for more information on this and
- the following commits in the series.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (TT_CONFIG_OPTION_SUBPIXEL_HINTING): Assign values to differentiate
- between subpixel versions.
- (TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY,
- TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL): New macros.
-
- * include/freetype/ftttdrv.h (TT_INTERPRETER_VERSION_40): New macro.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Updated.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): Define new fields
- `subpixel_hinting_lean', `vertical_lcd_lean',
- `backward_compatibility', `iupx_called', iupy_called', and
- `grayscale_cleartype' for new hinting mode.
-
- * src/truetype/ttdriver.c (tt_property_set): Handle v38 and v40
- interpreters conditionally.
-
- * src/truetype/ttgload.c (TT_Hint_Glyph): Save phantom points unless
- in v38 backward compatibility mode.
- Updated.
- (compute_glyph_metrics): Add v38 backward compatibility mode
- constraint for adjusting advance widths.
- Updated.
- (tt_loader_init): Handle new flags `subpixel_hinting_lean',
- `grayscale_cleartype', and `vertical_lcd_lean'.
- Updated.
- (tt_get_metrics, TT_Process_Simple_Glyph, TT_LOADER_SET_PP):
- Updated.
-
- * src/truetype/ttobjs.c (tt_driver_init): Conditionally set
- default interpreter version number.
-
- * src/truetype/ttsubpix.c, src/truetype/ttsubpix.h: Updated.
-
-2016-05-17 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix matrix scaling (#47848).
-
- * include/freetype/config/ftstdlib.h (FT_LONG_MIN): New macro.
-
- * src/cff/cffparse.c (cff_parse_font_matrix): Use largest scaling
- value of all matrix coefficients to scale matrix.
-
- * src/cff/cffobjs.c (cff_face_init): Use `matrix->yx' member for
- matrix normalization if `matrix->yy' is zero.
-
-2016-05-16 Werner Lemberg <wl@gnu.org>
-
- [base] Reject invalid sfnt Mac resource (#47891).
-
- * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Check validity
- of `CID ' and `TYPE1' table offset and length.
-
-2016-05-16 Werner Lemberg <wl@gnu.org>
-
- [cid] Fix scanning for `StartData' and `/sfnts' (#47892).
-
- * src/cid/cidparse.c (STARTDATA, STARTDATA_LEN, SFNTS, SFNTS_LEN):
- New macros.
- (cid_parser_new): Fix and document algorithm.
-
-2016-05-16 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Improve the recursive reference detector.
-
- The previous fix for #46372 misunderstood a composite glyph referring
- same component twice as a recursive reference. See the discussion
-
- https://lists.gnu.org/archive/html/freetype/2016-05/msg00000.html
-
- Thanks to Khaled Hosny for finding this issue.
-
- * src/truetype/ttgload.c (ft_list_get_node_at): A function to get
- the i-th node from FT_List.
- (load_truetype_glyph): In the traversal scan of the reference tree
- in the composite glyph, we clear the nodes filled by previous
- sibling chain.
-
-2016-05-07 Werner Lemberg <wl@gnu.org>
-
- [cache] Allow value 0 for face ID.
-
- We never dereference `face_id', and some implementations might use a
- running number instead of a pointer. Additionally, disallowing
- value zero was undocumented.
-
- * src/cache/ftccmap.c (FTC_CMapCache_Lookup), src/cache/ftcmanag.c
- (FTC_Manager_LookupFace, FTC_Manager_RemoveFaceID): Remove test for
- `face_id'.
-
-2016-05-05 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] More efficient accounting of conic splits and draws.
-
- A single decrement counter of segments to draw, instead of an array,
- contains all the information necessary to decide when to split and
- when to draw a conic segment. The number of splits before each draw is
- equal to the number of trailing zeros in the counter.
-
- * src/smooth/ftgrays.c (gray_TWorker): Remove `lev_stack'.
- (gray_render_conic): Updated to use decrement counter of segments.
-
-2016-05-05 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Fix logic for `FT_Property_Set'.
-
- Otherwise some properties could be set to arbitrary values, which is
- harmless, but querying could give wrong positive results.
-
- * src/cff/cffdrivr.c (cff_property_set) [hinting-engine],
- * src/truetype/ttdriver.c (tt_property_set) [interpreter-version]:
- Only allow defined values.
-
-2016-04-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Gujarati script.
-
- This essentially moves the Gujarati script from the `Indic' hinter to
- the `Latin' hinter.
-
- * src/autofit/afblue.dat: Add blue zone data for Gujarati.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Gujarati standard characters and move
- data out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Gujarati data out of
- AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afstyles.h: Update Gujarati data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2016-04-24 Werner Lemberg <wl@gnu.org>
-
- Minor.
-
- * include/freetype/freetype.h (FT_HAS_*, FT_IS_*): Protect macro
- argument with parentheses.
-
-2016-04-24 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix deallocation in case of error (#47726).
-
- * src/truetype/ttgload.c (load_truetype_glyph): Initialize fields in
- `outline' that are going to be deallocated in case of error.
-
-2016-04-23 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve Georgian blue zone characters.
-
- Suggested by Akaki Razmadze <razmadzekoko@gmail.com>.
-
- * src/autofit/afblue.dat (AF_BLUE_STRING_GEORGIAN_MKHEDRULI_BOTTOM):
- Updated.
-
- * src/autofit/afblue.c: Regenerated.
-
-2016-04-16 David Capello <davidcapello@gmail.com>
-
- [cmake] Honor SKIP_INSTALL_* settings (as used in zlib).
-
- As FreeType depends on zlib, if we don't install zlib (e.g., because
- we defined SKIP_INSTALL_ALL), FreeType cannot be installed, too
- (cmake triggers an error saying that FreeType cannot be installed
- because zlib target isn't in the export set).
-
- * CMakeLists.txt: Honor `SKIP_INSTALL_HEADERS',
- `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL' settings.
-
-2016-04-16 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] Another fix for non-intermediate GX tuples.
-
- * src/truetype/ttgxvar.c (ft_var_apply_tuple): Add some missing
- cases.
-
-2016-04-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Remove forgotten macro.
-
- * include/freetype/internal/internal.h
- [FT_INTERNAL_POSTSCRIPT_GLOBALS_H]: Remove.
-
-2016-04-09 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Georgian scripts.
-
- Georgian is problematic, since `uppercase' forms of Mkhedruli
- (called Mtavruli) are not yet defined in Unicode, which means that
- proper blue zones can't be defined. However, there is already a
- proposal submitted to Unicode; see
-
- https://www.unicode.org/L2/L2016/16034-n4707-georgian.pdf
-
- Additionally, due to historical reasons, Unicode treats Khutsuri as
- the same script as Mkhedruli, and so does OpenType. However, since
- the two scripts have completely different shapes it can happen that
- blue zones differ considerably. The tag `geok' used here (derived
- from ISO 15924) to differentiate the two scripts is not an OpenType
- tag in use. If we now have a font that contains both glyphs for
- Mkhedruli and Khutsuri, and it uses OpenType features for both also,
- HarfBuzz unavoidably treats all glyphs as `geor'. As a consequence,
- blue zones for `geok' are not used for glyphs involved in the
- OpenType features.
-
- An issue not yet resolved is which OpenType feature should be used
- to access Mtavruli glyph shapes; right now, FreeType doesn't set up
- support for them, but it is easy to add them later on as soon as
- more information is available.
-
- * src/autofit/afblue.dat: Add blue zone data for Georgian.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Georgian standard characters.
-
- * src/autofit/afranges.c: Add Georgian data.
-
- * src/autofit/afstyles.h: Add Georgian data.
-
-2016-04-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Provide dummy blue zone for pseudo script `none'.
-
- Even if the dummy hinter is used as the handler for `none' (which
- doesn't use blue zones), it is more consistent than the old value
- (which was 0), pointing to Arabic...
-
- * src/autofit/afblue.dat: Add `AF_BLUE_STRINGSET_NONE'.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afstyles.h (none_dflt): Use AF_BLUE_STRINGSET_NONE.
-
-2016-03-30 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrload.c (pfr_aux_name_load): Thinko (#47567).
-
-2016-03-30 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrload.c (pfr_log_font_count): Better font size estimate.
-
-2016-03-30 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrload.c (pfr_aux_name_load): Fix memory leak (#47567).
-
-2016-03-29 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftadvanc.c (FT_Get_Advances): Fix invalid left shift.
-
-2016-03-29 Werner Lemberg <wl@gnu.org>
-
- [pfr] Fix binary search (#47514).
-
- * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Handle border
- conditions correctly.
-
-2016-03-29 Werner Lemberg <wl@gnu.org>
-
- [pfr] Minor.
-
- * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Replace `left',
- `right', and `middle' with `min', `max', and `mid' as used in other
- FreeType binary search code.
- (pfr_load_bitmap_metrics): Fix invalid left shift.
-
-2016-03-29 Werner Lemberg <wl@gnu.org>
-
- * src/pfr/pfrtypes.h: Replace all enums with macros.
-
- We need `~FOO' to unset bits, and only with unsigned values (which
- `enum' isn't normally) this works cleanly.
-
-2016-03-26 Werner Lemberg <wl@gnu.org>
-
- [pfr] Robustify bitmap strike handling (#47514).
-
- We did a binary search for a charcode without ensuring that the
- searched data is ordered. Validating the order is now done lazily,
- this is, the first access to a bitmap glyph triggers the order check
- in the corresponding bitmap strike.
-
- * src/pfr/pfrtypes.h (PFR_BitmapFlags): New values
- `PFR_BITMAP_VALID_CHARCODES' and `PFR_BITMAP_CHARCODES_VALIDATED'.
-
- * src/pfr/pfrsbit.c (pfr_lookup_bitmap_data): Make `flags' argument
- a pointer. Handle new PFR_BITMAP_XXX flags.
- (pfr_slot_load_bitmap): Updated.
-
-2016-03-26 Werner Lemberg <wl@gnu.org>
-
- [pfr] Fix handling of compound glyphs.
-
- Extra items are indicated with different bit positions.
-
- * src/pfr/pfrtypes.h (PFR_GlyphFlags): Replace
- `PFR_GLYPH_EXTRA_ITEMS' with `PFR_GLYPH_SIMPLE_EXTRA_ITEMS' and
- `PFR_GLYPH_COMPOUND_EXTRA_ITEMS'.
-
- * src/pfr/pfrgload.c (pfr_glyph_load_simple,
- pfr_glyph_load_compound): Use them.
-
-2016-03-25 Werner Lemberg <wl@gnu.org>
-
- [pfr] Minor.
-
- * src/pfr/pfrsbit.c, src/pfr/pfrobjs.c: Use flag names instead of
- bare numbers.
-
-2016-03-25 Werner Lemberg <wl@gnu.org>
-
- [pfr] Various clang sanitizer fixes.
-
- * src/pfr/pfrsbit.c (pfr_load_bitmap_metrics): Correctly handle
- signed nibbles.
- (pfr_slot_load_bitmap): Correctly exit frame in case of error.
- Fix invalid left shifts.
-
-2016-03-23 Werner Lemberg <wl@gnu.org>
-
- Rename `VERSION.DLL' (#47472).
-
- * docs/VERSION.DLL: Renamed to...
- * docs/VERSIONS.TXT: ...this.
-
-2016-03-23 Werner Lemberg <wl@gnu.org>
-
- [raster, smooth] Directly test outline size (#47500).
-
- This improves stand-alone compilation.
-
- * src/base/ftoutln.c (FT_Outline_Render): Move cbox size test to...
-
- * src/raster/ftraster.c (ft_black_render), src/smooth/ftgrays.c
- (gray_raster_render): ...these functions.
-
-2016-03-23 Werner Lemberg <wl@gnu.org>
-
- [raster, smooth] Fix some clang sanitizer runtime issues.
-
- * src/raster/ftraster.c (ft_black_reset, ft_black_set_mode,
- ft_black_render): Harmonize signatures with `ftimage.h'.
-
- * src/smooth/ftgrays.c (gray_raster_render, gray_raster_reset):
- Ditto.
-
-2016-03-22 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Minor.
-
- This fixes an AddressSanitizer issue:
-
- ttgload.c:430:7: runtime error: null pointer passed as argument 1,
- which is declared to never be null
-
-2016-03-21 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Thinko.
-
- This fixes the previous commit to this file.
-
-2016-03-21 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Partly revert recent changes.
-
- * src/smooth/ftgrays.c (gray_conic_to, gray_cubic_to): Rework
- conditions to fix rendering issues.
-
-2016-03-20 Werner Lemberg <wl@gnu.org>
-
- [autofit] Show `near' points in tracing.
-
- * src/autofit/afhints.h (AF_FLAG_NEAR): New macro.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_points): Implement it.
- (af_glyph_hints_reload): Handle AF_FLAG_NEAR.
-
-2016-03-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Minor refactoring and microoptimizations.
-
- * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move
- band clipping from here.
- (gray_conic_to, gray_cubic_to): ... to here.
- (gray_render_line, gray_render_scanline): Initialize variables closer
- to their use.
-
-2016-03-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Minor refactoring.
-
- * src/smooth/ftgrays.c (gray_render_conic, gray_render_cubic): Move
- upscaling from here.
- (gray_conic_to, gray_cubic_to): ... to here.
-
-2016-03-15 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_compute_stem_width): Optimize.
-
-2016-03-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Temporarily revert 6eb6158dd787 (#47114).
-
- * src/smooth/ftgrays.c (gray_render_line): Old implementation.
-
-2016-03-12 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Improve coverage of rasterfuzzer.
-
- * src/tools/ftfuzzer/rasterfuzzer.cc (LLVMFuzzerTestOneInput): Use
- input data for `tags' array also.
- Trim input data to get more positive hits.
-
-2016-03-11 Pavlo Denysov <paul.kiev+savannah@gmail.com>
-
- Fix CMake issues for iOS (patch #8941).
-
- * CMakeLists.txt (CMAKE_TOOLCHAIN_FILE): Fix directory.
- * builds/cmake/iOS.cmake: No longer enforce gcc.
-
-2016-03-09 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] Fix handling of non-intermediate GX tuples.
-
- We probably did not notice this as all fonts we tested had only
- tuple_coords[i] be +1 or -1 for non-intermediate tuples.
-
- * src/truetype/ttgxvar.c (ft_var_apply_tuple): Implement it.
-
-2016-03-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Refuse to render enormous outlines (#47114).
-
- The goal is to avoid integer overflows in the rendering algorithms.
- The limit is chosen arbitrarily at some 2^18 pixels, which should be
- enough for modern devices including printers.
-
- * src/base/ftoutln.c (FT_Outline_Render): Check CBox and reject
- enormous outlines.
-
-2016-03-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Replace left shifts with multiplications (#47114).
-
- * src/smooth/ftgrays.c (SUBPIXELS, UPSCALE, DOWNSCALE): Do it.
-
-2016-03-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Avoid excessive stem length rounding (#25392).
-
- * src/autofit/aflatin.c (af_latin_compute_stem_width): Add argument
- to pass difference between hinted and unhinted position of base
- point; use this to adjust the stem width depending on the PPEM so
- that it doesn't become too large under certain circumstances.
- Update all callers using value 0 for this argument except...
- (af_latin_align_linked_edge): Pass position delta of base point to
- `af_latin_compute_stem_width'.
-
-2016-03-05 J Raynor <jxraynor@gmail.com>
-
- Make FreeType compile on AIX out of the box.
-
- * builds/unix/configure.raw (XX_ANSIFLAGS): Don't use `-ansi' on
- AIX.
-
-2016-03-01 Werner Lemberg <wl@gnu.org>
- Kostya Serebryany <kcc@google.com>
-
- [ftfuzzer] Add unit for testing smooth and black rasterizers.
-
- * src/tools/ftfuzzer/rasterfuzzer.cc: New file.
-
-2016-03-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix reallocation error introduced in 2016-02-27 (#47310).
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments): Reassign
- `prev_segment' after reallocation.
-
-2016-03-01 Werner Lemberg <wl@gnu.org>
-
- Fix clang warnings.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments): Use
- FT_UShort for `min_flags' and `max_flags'.
- Initialize `prev_*' variables.
-
- * src/cff/cffobjs.c (cff_face_init) [FT_DEBUG_LEVEL_TRACE]: Fix
- types of local variables.
-
- * src/smooth/ftgrays.c (gray_dump_cells) [FT_DEBUG_LEVEL_TRACE]:
- Update `printf' format string.
-
- * src/tools/ftfuzzer/ftfuzzer.cc (setIntermediateAxis): Add cast.
- (LLVMFuzzerTestOneInput): Fix loop type.
-
-2016-02-29 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Sinhala script.
-
- This essentially moves the Sinhala script from the `Indic' hinter to
- the `Latin' hinter.
-
- * src/autofit/afblue.dat: Add blue zone data for Sinhala.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Sinhala standard character and move data
- out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Sinhala data out of
- AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afstyles.h: Update Sinhala data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2016-02-27 Werner Lemberg <wl@gnu.org>
-
- [autofit] Properly handle spikes pointing to the x-axis.
-
- An example that gets better rendered is glyph `uusignTaml' (glyph
- index 2286) in font `FreeSerif.ttf' (Version 0412.2263) at 22ppem.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments): Properly
- handle segments where the last point of the first segment is
- identical to the first point in the second one. This can happen for
- malformed fonts or spikes. We either merge the new segment with the
- previous one (both segments point into the same direction), or we
- discard the shorter segment if they point into different directions.
-
-2016-02-27 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor code clean-up.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments): Change
- some local variable names to better differentiate between values
- along a segment and values orthogonal to it.
-
-2016-02-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve BOUND action.
-
- In complex glyph shapes, the original logic was too simple to cater
- for situations that would actually need something similar to PS Hint
- masks. This fix should alleviate the worst cases.
-
- * src/autofit/aflatin.c (af_latin_hint_edges): Don't allow
- complete disappearance of stems.
-
-2016-02-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Tamil script.
-
- This essentially moves the Tamil script from the `Indic' hinter to
- the `Latin' hinter.
-
- * src/autofit/afblue.dat: Add blue zone data for Tamil.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Tamil standard character and move data
- out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Tamil data out of
- AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afstyles.h: Update Tamil data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2016-02-18 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Malayalam script.
-
- This essentially moves the Malayalam script from the `Indic' hinter
- to the `Latin' hinter.
-
- * src/autofit/afblue.dat: Add blue zone data for Malayalam.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Malayalam standard characters and move
- data out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Malayalam data out of
- AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afstyles.h: Update Malayalam data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2016-02-16 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Fix integer overflow (#47114).
-
- * src/smooth/ftgrays.c (TArea): Make it unconditionally `long'.
-
-2016-02-15 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffparse.c (cff_parse_multiple_master): Improve tracing.
-
-2016-02-15 Werner Lemberg <wl@gnu.org>
-
- [cff] Handle T2 operator only with old CFF engine (#47157).
-
- * src/cff/cffparse.c (cff_parser_run) <opcode 31>: Enclose with
- #ifdef CFF_CONFIG_OPTION_OLD_ENGINE...#endif.
-
-2016-02-15 Werner Lemberg <wl@gnu.org>
-
- [cff] Partially handle `load' and `store' ops in old CFF engine.
-
- Now all glyphs of MM CFFs like `ITCGaramondMM-It.otf' can be
- displayed.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_store,
- cff_op_load>: Partially implement it.
-
- * src/cff/cffparse.c (cff_parser_init): Add new parameter to pass
- the number of Multiple Master axes.
- Update all callers.
- (cff_parse_multiple_master): Get number of axes.
- (cff_parser_run) <opcode 31>: Updated.
- * src/cff/cffparse.h: Updated.
- (CFF_ParserRec): Add `num_axes' field.
-
- * src/cff/cffload.c: Updated.
-
- * src/cff/cfftypes.h (CFF_FontRecDictRec): Add `num_axes' field.
-
-2016-02-15 Werner Lemberg <wl@gnu.org>
-
- [cff] Correctly trace SIDs that contain NULL bytes.
-
- We need this to properly trace Multiple Master CFFs, which contain
- two SIDs that are charstrings.
-
- This commit makes FreeType also show the last SID, omitted
- previously due to a bug.
-
- * src/cff/cfftypes.h (CFF_FontRec): Add `string_pool_size' field.
-
- * src/cff/cffload.c (cff_index_get_pointers): Add argument to return
- the pool size.
- Update all callers.
-
- * src/cff/cffobjs.c (cff_face_init) [FT_DEBUG_LEVEL_TRACE]: Directly
- access `cff->strings' to display the non-default strings.
-
-2016-02-14 Werner Lemberg <wl@gnu.org>
-
- * src/base/fthash.c: Include FT_INTERNAL_MEMORY_H.
-
-2016-02-14 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffparse.c: Include `cffgload.h'.
-
- Problem reported by Colin Walters <walters@verbum.org>.
-
-2016-02-14 Werner Lemberg <wl@gnu.org>
-
- [cff] Make old CFF engine show MM CFFs (without variations).
-
- The new code only displays the first master in the font.
-
- * src/cff/cffgload.c (cff_decode_parse_charstrings): Add new
- parameter to allow function calls from dictionaries also.
- <cff_op_blend>: Partially implement it.
- Update all callers.
- * src/cff/cffgload.h: Updated.
-
- * src/cff/cffparse.c (cff_parser_init): Add new parameter to pass the
- number of Multiple Master designs.
- Update all callers.
- (cff_parse_multiple_master): New function to rudimentarily parse
- operator.
- (cff_parser_run): Handle `T2' operator.
- * src/cff/cffparse.h: Updated.
- (CFF_ParserRec): Add `num_designs' field.
-
- * src/cff/cffload.c: Updated.
-
- * src/cff/cfftoken.h: Handle `MultipleMaster' operator.
-
- * src/cff/cfftypes.h (CFF_FontRecDictRec): Add `num_designs' field.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Don't handle `fvar' table for
- MM CFFs.
-
-2016-02-09 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Don't emit trailing newlines.
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_code):
- Use `rstrip'.
-
-2016-02-07 Werner Lemberg <wl@gnu.org>
-
- * Version 2.6.3 released.
- =========================
-
-
- Tag sources with `VER-2-6-3'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.6.3.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.6.2/2.6.3/, s/262/263/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.
-
- * builds/unix/configure.raw (version_info): Set to 18:3:12.
- * CMakeLists.txt (VERSION_PATCH): Set to 3.
-
- * docs/CHANGES: Updated.
-
-2016-02-07 Werner Lemberg <wl@gnu.org>
-
- Fix another runtime error found by clang's sanitizer (#47082).
-
- * src/base/ftstroke.c (ft_stroke_border_export): Properly handle
- empty input buffer.
-
-2016-02-07 Werner Lemberg <wl@gnu.org>
-
- Fix runtime errors found by clang's sanitizer (#47082).
-
- * src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c
- (FT_Outline_Copy), src/cache/ftcsbits.c (ftc_sbit_copy_bitmap):
- Properly handle empty input buffer.
-
-2016-02-07 Werner Lemberg <wl@gnu.org>
-
- [cff] Minor.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings) <cff_op_sqrt>:
- Remove dead code.
-
-2016-02-07 Werner Lemberg <wl@gnu.org>
-
- [cff] Implement missing operators in new engine (except `random').
-
- * src/cff/cf2font.h (CF2_STORAGE_SIZE): New macro.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString): Implement the
- following operators: abs, add, and, div, drop, dup, eq, exch, get,
- ifelse, index, mul, neg, not, or, put, roll, sqrt, sub.
-
- * src/cff/cf2stack.h, src/cff/cf2stack.c (cf2_stack_roll): New
- auxiliary function for `roll' operator.
-
-2016-02-06 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix some Type 2 operators in old CFF engine.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Fix `eq'
- operator, add `not' and (unsupported) `blend' operators.
-
-2016-02-05 Sebastian Rasmussen <sebras@gmail.com>
-
- Make direct call of `make install' work (#47072).
-
- * builds/unix/unix-def.in (freetype-config): Make sure
- `freetype-config' is generated for both make targets (`all' and
- `install').
-
-2016-02-05 Werner Lemberg <wl@gnu.org>
-
- [base] Fix advance width loading for MM and GX fonts (#47064).
-
- * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Return false for
- MM and GX fonts.
- Update callers.
-
-2016-02-03 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix handling of face_index == -1 for pure CFF.
-
- * src/cff/cffobjs.c (cff_face_init): Return correct number of faces.
-
-2016-01-30 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor tracing improvement.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_points): Insert newline
- at the start of a new contour.
-
-2016-01-28 Nikolaus Waxweiler <madigens@gmail.com>
-
- Remove unpatented hinter (3/3).
-
- * include/freetype/config/ftoption.h
- (TT_CONFIG_OPTION_UNPATENTED_HINTING): Remove.
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Remove
- `ignore_unpatented_hinter' field.
- Update users.
- (FT_DEBUG_HOOK_UNPATENTED_HINTING): Remove.
- Update users.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Remove
- `unpatented_hinting' field.
- Update users.
-
- * src/base/ftpatent.c (_tt_check_patents_in_range,
- _tt_check_patents_in_table, _tt_face_check_patents): Remove.
- (FT_Face_CheckTrueTypePatents, FT_Face_SetUnpatentedHinting):
- Replace code with dummies.
-
- * src/truetype/ttobjs.c (tt_face_init): Remove now defunct code.
- * src/truetype/ttobjs.h (TT_GraphicsState): Remove `both_x_axis'
- field.
-
-2016-01-28 Nikolaus Waxweiler <madigens@gmail.com>
-
- Remove unpatented hinter (2/3).
-
- * devel/ftoption.h (TT_CONFIG_OPTION_UNPATENTED_HINTING): Remove.
-
-2016-01-28 Nikolaus Waxweiler <madigens@gmail.com>
-
- Remove unpatented hinter (1/3).
-
- * src/truetype/ttinterp.c [TT_CONFIG_OPTION_UNPATENTED_HINTING]:
- Remove all code related to this macro.
-
-2016-01-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Kannada script.
-
- This essentially moves the Kannada script from the `Indic' hinter to
- the `Latin' hinter.
-
- * src/autofit/afblue.dat: Add blue zone data for Kannada.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Kannada standard characters and move
- data out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Kannada data out of
- AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afstyles.h: Update Kannada data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2016-01-22 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Better access to 64-bit integers for C99 compilers.
-
- * include/freetype/config/ftconfig.h [FT_LONG64]: Use
- __STDC_VERSION__ to define 64-bit integers.
- * builds/unix/ftconfig.in [FT_LONG64]: Ditto.
- * builds/vms/ftconfig.h [FT_LONG64]: Ditto.
-
-2016-01-21 Werner Lemberg <wl@gnu.org>
-
- [gxvalid] Remove commented out code.
-
- * src/gxvalid/gxvcommn.c (gxv_EntryTable_validate): Do it.
-
-2016-01-20 Werner Lemberg <wl@gnu.org>
-
- [autofit] Complete last autofit commit.
-
- Problem reported by Kostya Serebryany <kcc@google.com>.
-
- * src/autofit/afshaper.c (af_shaper_get_coverage)
- [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Update signature.
-
-2016-01-20 Werner Lemberg <wl@gnu.org>
-
- Still handle `__FTERRORS_H__'.
-
- We need this for backward compatibility.
-
- Problem reported by John Emmas <johne53@tiscali.co.uk>.
-
- * include/freetype/fterrors.h: Fix inclusion guard so that
- undefining either `FTERRORS_H_' or `__FTERRORS_H__' works as
- expected.
-
-2016-01-19 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix handling of default script.
-
- Patch taken from ttfautohint, commit
- 071ae2c00e0d67f9d19418f4fade1c23d27dc185.
-
- There were two bugs.
-
- - We now use non-standard script tags like `khms' for special
- purposes. However, HarfBuzz maps such tags to `DFLT', and
- without this commit the associated lookups were incorrectly
- assigned to the non-standard tags.
-
- - Let's assume we have a Bengali font, and the font's `DFLT'
- script tag handles the necessary lookups for Bengali, too.
- Without this commit, the `DFLT' lookups were assigned to
- ttfautohint's default script (usually `latn') before the
- standard lookups for Bengali were handled.
-
- We now have the following order while searching for covered
- glyph indices.
-
- special features of scripts (e.g. `sups' for Cyrillic)
- Unicode mappings of scripts
- remaining features of scripts (especially important for Indic
- scripts)
- default features of default script
-
- * src/autofit/afshaper.c, src/autofit/afshaper.h
- (af_shaper_get_coverage): Add boolean parameter to indicate default
- script.
- Update all callers.
-
- * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
- Fix search order for coverages.
-
-2016-01-19 Werner Lemberg <wl@gnu.org>
-
- Various minor clang fixes.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths),
- src/autofit/aflatin.c (af_latin_metrics_init_widths): Initialize
- `ch'.
-
- * src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Add cast.
-
- * src/base/ftdbgmem.c (ft_mem_table_destroy): Add cast.
-
- * src/base/fthash.c (hash_num_lookup): Add cast.
-
- * src/base/fttrigon.c (ft_trig_downscale) [FT_LONG64]: Fix cast.
-
- * src/gxvalid/gxvcommn.c (gxv_EntryTable_validate): Comment out
- redundant code.
-
- * src/type1/t1driver.c (t1_get_ps_font_value) <PS_DICT_SUBR>: Add
- cast.
-
- * src/type1/t1load.c (parse_subrs): Fix type of `count'.
-
-2016-01-19 Derek B. Noonburg <derekn@glyphandcog.com>
-
- [truetype] Add another tricky font.
-
- * src/truetype/ttobjs.c (TRICK_SFNT_IDS_NUM_FACES): Increase.
- (sfnt_id): Add variant of `DFKaiShu'.
-
-2016-01-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Empower `FT_Library_SetLcdFilterWeights'.
-
- * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): Enable filter
- in addition to setting weights.
- (FT_Library_SetLcdFilter): Clean out FT_FORCE_LIGHT_LCD_FILTER and
- FT_FORCE_LEGACY_LCD_FILTER.
- * include/freetype/ftlcdfil.h: Documentation update.
-
-2016-01-12 Werner Lemberg <wl@gnu.org>
-
- Don't use macro names that start with `_[A-Z]' [3/3].
-
- Such macro names are reserved for both C and C++.
-
- * src/cache/ftccache.h: s/_FTC_FACE_ID_HASH/FTC_FACE_ID_HASH/.
- Update all callers.
- (FTC_CACHE_LOOKUP_CMP): Replace `_XXX' with `XXX_'.
- * src/cache/ftcmru.c (FTC_MRULIST_LOOKUP_CMP): Ditto.
-
-2016-01-12 Werner Lemberg <wl@gnu.org>
-
- Don't use macro names that start with `_[A-Z]' [2/3].
-
- Such macro names are reserved for both C and C++.
-
- * include/freetype/ftimage.h, src/raster/ftraster.c,
- src/smooth/ftgrays.c, src/smooth/ftgrays.h:
- s/_STANDALONE_/STANDALONE_/.
-
-2016-01-12 Werner Lemberg <wl@gnu.org>
-
- Don't use macro names that start with `_[A-Z]' [1/3].
-
- Such macro names are reserved for both C and C++.
-
- * src/bdf/bdflib.c: Replace macros of the form `_BDF_XXX' with
- `BDF_XXX_'.
-
-2016-01-12 Werner Lemberg <wl@gnu.org>
-
- Don't use macro names that contain `__' [2/2].
-
- Such macro names are reserved for both C and C++.
-
- * src/cache/*: s/__/_/.
-
-2016-01-12 Werner Lemberg <wl@gnu.org>
-
- Don't use macro names that contain `__' [1/2].
-
- Such macro names are reserved for both C and C++.
-
- * */*: Replace macros of the form `__XXX_H__' with `XXX_H_'.
-
-2016-01-10 Jered Gray <jegray@google.com>
-
- [cff] Fix usage of `|' operator.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) [cf2_cmdEXTENDEDNMBR,
- default]: `|' is not guaranteed to be processed from left to right
- by the compiler. However, the code repeatedly calls
- `cf2_buf_readByte' to get the arguments to `|' ... Fix this.
-
-2015-12-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Make top-to-bottom hinting work in latin auto-hinter.
-
- This improves rendering of scripts like Bengali or Devanagari.
-
- * src/autofit/afhints.c (af_axis_hints_new_edge): Add parameter to
- pass top-to-bottom hinting flag. This makes the function sort edges
- in descending vertical position.
-
- * src/autofit/afhints.c: Updated.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_edges,
- af_latin_hint_edges): Use `top_to_bottom_hinting' flag.
-
- * src/autofit/afcjk.c (af_cjk_hints_compute_edges),
- src/autofit/aflatin2.c (af_latin2_hints_compute_edges): Updated.
-
-2015-12-24 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add hinting direction to `AF_ScriptClassRec'.
-
- Still unused.
-
- * src/autofit/afglobal.c (SCRIPT): Handle hinting direction.
-
- * src/autofit/aftypes.h (AF_ScriptClassRec): Add
- `top_to_bottom_hinting' field.
- (AF_HINTING_BOTTOM_TO_TOP, AF_HINTING_TOP_TO_BOTTOM): New macros.
- (AF_DEFINE_SCRIPT_CLASS): Updated.
-
-2015-12-23 Werner Lemberg <wl@gnu.org>
-
- [autofit] Start implementing hinting direction (up/down, down/up).
-
- Right now, it does nothing.
-
- * src/autofit/afscript.h: Add another parameter to `SCRIPT',
- specifying hinting direction.
-
- * src/autofit/afglobal.c, src/autofit/afglobal.h,
- src/autofit/afpic.c, src/autofit/afranges.h, src/autofit/afshaper.c,
- src/autofit/aftypes.h: Extend `SCRIPT' definitions.
-
-2015-12-22 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_subrs): Fix memory leak (#46744).
-
-2015-12-22 Werner Lemberg <wl@gnu.org>
-
- [base] Make hash interface symmetric.
-
- Use `num' and `str' infixes everywhere.
-
- * src/base/fthash.c (ft_hash_init): Renamed to...
- (hash_init): ... This.
- (ft_hash_str_init, ft_hash_num_init): New functions.
- (ft_hash_free): Renamed to...
- (ft_hash_str_free): ... This.
-
- * include/freetype/internal/fthash.h: Updated.
-
- * src/bdf/bdflib.c, src/type1/t1load.c, src/type1/t1objs.c: Updated.
-
-2015-12-21 Werner Lemberg <wl@gnu.org>
-
- [type1] Avoid shift of negative numbers (#46732).
-
- * src/type1/t1load.c (parse_subrs): Do it.
-
-2015-12-20 Werner Lemberg <wl@gnu.org>
-
- [type1, psaux] Handle large values of num_subrs correctly (#46692).
-
- We now use a hash to map from subr indices to array elements holding
- the subroutines, if necessary.
-
- * include/freetype/internal/t1types.h: Include FT_INTERNAL_HASH_H.
- (T1_FontRec): Add `subrs_hash' field.
-
- * include/freetype/internal/psaux.h: Include FT_INTERNAL_HASH_H.
- (T1_DecoderRec): Add `subrs_hash' field.
-
- * src/type1/t1load.h (T1_LoaderRec): Add `subrs_hash' field.
-
- * src/type1/t1driver.c: Include FT_INTERNAL_HASH_H.
- (t1_ps_get_font_value) [PS_DICT_SUBR]: Look up hash if necessary.
-
- * src/type1/t1load.c: Include FT_INTERNAL_HASH_H.
- (parse_subrs): Use hash for subr indices that exceed the allocated
- number of subr slots.
- (t1_init_loader): Remove unnecessary code.
- (t1_done_loader, T1_Open_Face): Updated.
-
- * src/type1/t1gload.c (T1_Compute_Max_Advance, T1_Get_Advances,
- T1_Load_Glyph): Updated.
-
- * src/type1/t1objs.c (T1_Face_Done): Updated.
-
- * src/psaux/t1decode.c: Include FT_INTERNAL_HASH_H.
- (t1_decoder_parse_charstrings) [op_callsubr]: Look up hash if
- necessary.
-
- * src/cid/cidgload.c (cid_load_glyph): Updated.
-
-2015-12-20 Werner Lemberg <wl@gnu.org>
-
- [base] Thinko: Remove free function pointer.
-
- We don't copy keys or values while hashing.
-
- * include/freetype/internal/fthash.h (FT_Hash_FreeFunc): Removed.
- (FT_HashRec): Remove `free' field.
-
- * src/base/fthash.c (hash_str_free): Removed.
- (ft_hash_init, ft_hash_free): Updated.
-
-2015-12-20 Werner Lemberg <wl@gnu.org>
-
- [base, bdf] Don't expose `FT_Hashnode' in hash functions.
-
- * src/base/fthash.c (hash_lookup, ft_hash_str_lookup,
- ft_hash_num_lookup): Return pointer to `size_t' instead of
- `FT_Hashnode'.
-
- * include/freetype/internal/fthash.h: Updated.
-
- * src/bdf/bdflib.c (bdf_get_property, _bdf_add_property,
- bdf_get_font_property): Updated.
-
-2015-12-20 Werner Lemberg <wl@gnu.org>
-
- [base, bdf] Add number hashing.
-
- * src/base/fthash.c (hash_num_lookup, hash_num_compare): New
- functions.
- (ft_hash_init): Add argument to select between number and string
- hashing.
- (ft_hash_num_insert, ft_hash_num_lookup): New functions.
-
- * include/freetype/internal/fthash.h: Updated.
-
- * src/bdf/bdflib.c (_bdf_parse_start): Updated.
-
-2015-12-20 Werner Lemberg <wl@gnu.org>
-
- [base] Introduce hash lookup, compare, and free function pointers.
-
- * include/freetype/internal/fthash.c (FT_Hash_LookupFunc,
- FT_Hash_CompareFunc, FT_Hash_FreeFunc): New typedefs.
- (FT_HashRec): Add `lookup', `compare', and `free' fields.
-
- * src/base/fthash.c (hash_str_lookup, hash_str_compare,
- hash_str_free): New functions.
- (ft_hash_init): Set function pointers.
- (hash_bucket, ft_hash_free): Use them.
-
-2015-12-20 Werner Lemberg <wl@gnu.org>
-
- [base, bdf] Use a union as a hash key.
-
- We want to support both an integer and a string key later on.
-
- * include/freetype/internal/fthash.h (FT_Hashkey): New union.
- (FT_HashnodeRec): Updated.
- (ft_hash_insert, ft_hash_lookup): Renamed to ...
- (ft_hash_str_insert, ft_hash_str_lookup): ... this.
-
- * src/base/fthash.c (hash_bucket): Updated.
- (ft_hash_insert, ft_hash_lookup): Renamed to ...
- (hash_insert, hash_lookup): ... this.
- (ft_hash_str_insert, ft_hash_str_lookup): New wrapper functions.
-
- * src/bdf/bdflib.c: Updated.
-
-2015-12-19 Werner Lemberg <wl@gnu.org>
-
- [bdf] Use new hash functions.
-
- * src/bdf/bdf.h: Include FT_INTERNAL_HASH_H.
- (hashnode, hashtable): Removed.
- (bdf_font_t): Use `FT_HashRec' type for `proptbl'.
-
- * src/bdf/bdflib.c: Remove all hash functions.
- Update code for new hash structure and function names.
-
-2015-12-19 Werner Lemberg <wl@gnu.org>
-
- [bdf, base] Lift hash functions from bdf driver to base module.
-
- * src/base/fthash.c, include/freetype/internal/fthash.h: New files,
- containing (massaged) code from `bdflib.c' and `bdf.h'.
-
- * include/freetype/internal/internal.h (FT_INTERNAL_HASH_H): New
- macro.
-
- * src/base/ftbase.c: Include `fthash.c'.
-
- * src/base/Jamfile (_sources): Add `fthash'.
-
- * src/base/rules.mk (BASE_SRC): Add `fthash.c'.
-
- * docs/LICENSE.TXT: Updated.
-
-2015-12-15 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Bengali script.
-
- This essentially moves the Bengali script from the `Indic' hinter to
- the `Latin' hinter.
-
- * src/autofit/afblue.dat: Add blue zone data for Bengali.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Bengali standard characters and move
- data out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Bengali data out of
- AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afstyles.h: Update Bengali data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2015-12-14 Ben Wagner <bungeman@gmail.com>
-
- [bdf] Remove dead code (#46625).
-
- The BDF specification only allows decimal numbers, no octal or
- hexadecimal decoding is needed.
-
- * src/bdf/bdflib.c (_bdf_atoul, _bdf_atol, _bdf_atous,
- _bdf_atos): Remove unused code and parameters.
- Update all callers.
- (odigits): Remove.
-
-2015-12-14 Werner Lemberg <wl@gnu.org>
-
- [base] Fix calls to `FT_Stream_Seek'.
-
- * src/base/ftobjs.c (Mac_Read_sfnt_Resource, FT_Open_Face): Set
- `error'.
-
-2015-12-14 Ben Wagner <bungeman@gmail.com>
-
- [base] Check error when seeking to data supplied offset (#46635).
-
- * src/base/ftobjs.c (open_face_PS_from_sfnt_stream):
- `ft_lookup_PS_in_sfnt_stream' returns offset and length from
- user supplied data. Use of this these values must be checked.
-
-2015-12-13 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Myanmar script.
-
- * src/autofit/afblue.dat: Add blue zone data for Myanmar.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Myanmar standard characters.
-
- * src/autofit/afranges.c: Add Myanmar data.
-
- * src/autofit/afstyles.h: Add Myanmar data.
-
-2015-12-12 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Minor.
-
-2015-12-12 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afscript.h: Avoid potential crash.
-
-2015-12-10 Werner Lemberg <wl@gnu.org>
-
- [autofit] Restore OpenType feature check.
-
- This was removed while rewriting the HarfBuzz interface.
-
- * src/autofit/afglobal.h (AF_FaceGlobalsRec): Add `hb_buf' field to
- hold internal HarfBuzz buffer, needed for feature comparison.
-
- * src/autofit/afglobal.c (af_face_globals_new,
- af_face_globals_free): Initialize and destroy `hb_buf'.
-
- * src/autofit/afshaper.c (af_shaper_get_cluster): Compare character
- (cluster) with and without applied feature.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Fix tracing
- message.
-
-2015-12-10 Werner Lemberg <wl@gnu.org>
-
- [autofit] Remove redundant code.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths): Do it.
-
-2015-12-09 Werner Lemberg <wl@gnu.org>
-
- [autofit] Thinko.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Don't count
- empty blue zones (bug introduced 2015-12-06).
-
-2015-12-09 Werner Lemberg <wl@gnu.org>
-
- [autofit] Introduce subscript top blue zones.
-
- This feature is mainly for Khmer: The idea is to avoid a clash
- between the top of subscript glyphs and the bottom of normal
- baseline glyphs.
-
- This only works for character clusters mapped to multiple glyphs.
-
- * src/autofit/afblue.dat: Add subscript top blue zone for Khmer.
-
- * src/autofit/afblue.hin (AF_BLUE_PROPERTY_LATIN_SUB_TOP): New
- macro.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/aflatin.h (AF_LATIN_IS_SUB_TOP_BLUE,
- AF_LATIN_BLUE_SUB_TOP): New macros.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Handle new
- blue zone property.
- Update tracing messages.
- (af_latin_metrics_scale_dim): Handle new blue zone property.
- (af_latin_hints_compute_blue_edges): Updated.
-
-2015-12-09 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix tracing message.
-
- * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Display
- inactive blue zones also.
-
-2015-12-06 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afblue.dat: Add more Khmer clusters.
-
- Some fonts have incorrect ligatures; we need more samples to get a
- good mean value.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
-2015-12-06 Werner Lemberg <wl@gnu.org>
-
- [autofit] Typos.
-
- * src/autofit/afshaper.c (af_shaper_buf_create, af_shaper_get_elem)
- [!FT_CONFIG_OPTION_USE_HARFBUZZ]: Make it compile.
-
-2015-12-06 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Khmer script.
-
- We split Khmer into two auto-hinter scripts: `Khmer' (`khmr') and
- `Khmer symbols' (`khms', U+19E0-U+19FF).
-
- * src/autofit/afblue.dat: Add blue zone data for Khmer.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Khmer standard characters.
-
- * src/autofit/afranges.c: Add Khmer data.
-
- * src/autofit/afstyles.h: Add Khmer data.
-
-2015-12-06 Werner Lemberg <wl@gnu.org>
-
- [autofit] Rewrite HarfBuzz interface to support character clusters.
-
- Scripts like Khmer have blue zones that can't be directly
- represented by Unicode characters. Instead, it is necessary to let
- HarfBuzz convert character clusters into proper glyph representation
- forms, then deriving the blue zone information from the resulting
- glyphs.
-
- * src/autofit/hbshim.c, src/autofit/hbshim.h: Replaced by...
- * src/autofit/afshaper.c, src/autofit/afshaper.h: ... these two new
- files, providing a new API to access HarfBuzz.
-
- The new API manages a HarfBuzz buffer with `af_shaper_buf_create'
- and `af_shaper_buf_destroy'. The buffer receives a UTF8 encoded
- string with function `af_shaper_get_cluster', and the resulting
- glyph data (indices, advance widths, vertical offsets) can be
- iteratively accessed with function `af_shaper_get_elem'.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths,
- af_cjk_metrics_init_blues, af_cjk_metrics_check_digits): Updated.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_widths,
- af_latin_metrics_init_blues, af_latin_metrics_check_digits):
- Updated.
-
- * include/freetype/internal/fttrace.h: s/afharfbuzz/afshaper/.
-
- * src/autofit/afglobal.c: s/hbshim.h/afshaper.h/.
- (af_face_globals_compute_style_coverage): Updated.
-
- * src/autofit/afglobal.h: s/hbshim.h/afshaper.h/.
-
- * src/autofit/autofit.c: s/hbshim.c/afshaper.c/.
-
- * src/autofit/Jamfile, src/autofit/rules.mk (AUTOF_DRV_SRC):
- Updated.
-
-2015-12-06 Werner Lemberg <wl@gnu.org>
-
- [autofit] Prepare forthcoming changes.
-
- This makes it easier to control the commits.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Add dummy
- loop. No functional change.
-
-2015-12-06 Werner Lemberg <wl@gnu.org>
-
- [autofit] Use string of standard characters.
-
- This is more flexible; additionally, it would allow character
- clusters.
-
- * src/autofit/aftypes.h (SCRIPT, AF_DEFINE_SCRIPT_CLASS): Updated.
- (AF_ScriptClassRec): Replace `standard_char[123]' with
- `standard_charstring'.
-
- * src/autofit/afscript.h: Replace last three character arguments
- of the `SCRIPT' calls with a string parameter, holding the standard
- characters (in UTF-8 encoding) separated with spaces.
-
- * src/autofit/afglobal.c, src/autofit/afglobal.h,
- src/autofit/afpic.c, src/autofit/afranges.c, src/autofit/hbshim.c
- (SCRIPT): Updated.
-
- * src/autofit/afcjk.c (af_cjk_metrics_init_widths),
- src/autofit/aflatin.c (af_latin_metrics_init_widths): Updated.
-
-2015-12-05 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afblue.dat: Separate blue zone characters with spaces.
-
- Another preparation for character cluster support.
-
- * src/autofit/afblue.c, src/autofit.afblue.h: Regenerated.
-
-2015-12-05 Werner Lemberg <wl@gnu.org>
-
- * src/tools/afblue.pl (convert_ascii_chars): Don't ignore spaces.
-
- Instead, reduce multiple spaces to a single one. We need this later
- for supporting character clusters in `afblue.dat'.
-
-2015-12-05 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afblue.hin (GET_UTF8_CHAR): Use `do...while(0)'.
-
- * src/autofit/afblue.h: Regenerated.
-
-2015-12-05 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afwarp.c: s/INT_MIN/FT_INT_MIN/.
-
-2015-12-03 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/install.mk (install): Remove stale `ft2build.h'.
-
-2015-12-01 Werner Lemberg <wl@gnu.org>
-
- [type1] Avoid dangling pointer (#46572).
-
- * src/type1/t1afm.c (T1_Read_Metrics): Properly reset
- `face->afm_data'.
-
-2015-11-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * include/freetype/ftlcdfil.h: Documentation tweak.
-
-2015-11-28 Werner Lemberg <wl@gnu.org>
-
- * Version 2.6.2 released.
- =========================
-
-
- Tag sources with `VER-2-6-2'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.6.2.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.6.1/2.6.2/, s/261/262/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.
-
- * builds/unix/configure.raw (version_info): Set to 18:2:12.
- * CMakeLists.txt (VERSION_PATCH): Set to 2.
-
- * docs/CHANGES: Updated.
-
-2015-11-28 Werner Lemberg <wl@gnu.org>
-
- Fix C++ compilation.
-
- * src/autofit/afloader.c: Include FT_INTERNAL_CALC_H.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Pacify compiler.
-
-2015-11-28 Nikolaus Waxweiler <madigens@gmail.com>
-
- Change default LCD filter to be normalized and color-balanced.
-
- * src/base/ftlcdfil.c (FT_Library_SetLcdFilter): Update
- `default_filter'.
-
-2015-11-28 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Allow references to section names.
-
- In the reference, we show the section's title enclosed in single
- quotes.
-
- * src/tools/docmaker/formatter.py (Formatter::__init__): Collect
- section names as identifiers.
-
- * src/tools/docmaker/tohtml.py (section_title_header): Split into...
- (section_title_header1, section_title_header2): ... these two
- strings.
- (HtmlFormatter::make_block_url, make_html_word, html_source_quote):
- Handle sections.
- (HtmlFormatter::section_enter): Updated to add `id' HTML attribute.
-
-2015-11-27 Tamas Kenez <tamas.kenez@adasworks.com>
-
- [cmake] Add script to test the config module.
-
- * builds/cmake/testbuild.sh: New file.
-
-2015-11-27 Tamas Kenez <tamas.kenez@adasworks.com>
-
- * CMakeLists.txt: Create `freetype-config.cmake' config module.
-
-2015-11-27 Tamas Kenez <tamas.kenez@adasworks.com>
-
- * CMakeLists.txt: Set CMAKE_DEBUG_POSTFIX to `d'.
-
-2015-11-27 Tamas Kenez <tamas.kenez@adasworks.com>
-
- [cmake] Add better control of library dependencies.
-
- * CMakeLists.txt: Add `WITH_*' variables to force/auto/omit
- ZLIB/BZip2/PNG/HarfBuzz.
-
-2015-11-27 Tamas Kenez <tamas.kenez@adasworks.com>
-
- [cmake] Make `FindHarfBuzz' observe the REQUIRED option.
-
- * builds/cmake/FindHarfBuzz.cmake: Implement it.
-
-2015-11-27 Werner Lemberg <wl@gnu.org>
-
- [cmake] Collect files specific to cmake in `builds/cmake'.
-
- * builds/FindHarfBuzz.cmake: Move to ...
- * builds/cmake/FindHarfBuzz.cmake: ... this place.
-
- * CMakeLists.txt (CMAKE_MODULE_PATH): Updated.
-
-2015-11-27 Alexander Bock <alexander.j.bock@nasa.gov>
-
- CMakeLists.txt: Honour new command line flag `FREETYPE_NO_DIST'.
-
-2015-11-26 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Allow `foo[bar]' as identifier.
-
- We need this to handle equally named properties in different
- modules.
-
- * src/tools/docmaker/content.py (re_identifier),
- src/tools/docmaker/sources.py (re_crossref): Allow `foo[bar]'.
-
- * src/tools/docmaker/tohtml.py (HtmlFormatter::make_html_word,
- HtmlFormatter::index_exit, HtmlFormatter::section_enter,
- HtmlFormatter::block_enter): Handle `foo[bar]'.
-
-2015-11-25 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdflib.c (bdf_load_font): Fix small memory leak (#46480).
-
- (_bdf_parse_glyphs): Always reset `p->glyph_name' after moving its
- contents.
-
-2015-11-21 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftcalc.h: Don't use `register' keyword.
-
- This fixes compiler warnings.
-
- Reported by Behdad.
-
-2015-11-20 Werner Lemberg <wl@gnu.org>
-
- Add `FT_LCD_FILTER_LEGACY1' enum value.
-
- This does the same as `FT_LCD_FILTER_LEGACY'.
-
- See
-
- https://bugs.freedesktop.org/show_bug.cgi?id=92981
-
- for the reasoning.
-
- * include/freetype/ftlcdfil.h (FT_LcdFilter): New value
- `FT_LCD_FILTER_LEGACY1'.
-
- * src/base/ftlcdfil.c (FT_Library_SetLcdFilter): Use it.
-
-2015-11-15 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afhints.c (af_get_segment_index): Fix it.
-
- The old code was too simple, returning invalid values in most cases
- where a segment crosses the contour start.
-
-2015-11-15 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdflib.c (bdf_load_font): Fix small memory leak (#46439).
-
-2015-11-11 Werner Lemberg <wl@gnu.org>
-
- [cff, autofit] Switch off stem darkening by default.
-
- * src/autofit/afmodule.c (af_autofitter_init), src/cff/cffobjs.c
- (cff_driver_init): Do it.
-
-2015-11-10 Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
-
- Allow native CFF hinter in FT_RENDER_MODE_LIGHT.
-
- Both the native CFF hinter and the auto-hinter now have a very
- similar rendering style.
-
- * include/freetype/freetype.h: Mention that FT_LOAD_TARGET_LIGHT no
- longer implies FT_LOAD_FORCE_AUTOHINT.
-
- * include/freetype/ftmodapi.h (FT_MODULE_DRIVER_HINTS_LIGHTLY): New
- macro.
-
- * include/freetype/internal/ftobjs.h (FT_DRIVER_HINTS_LIGHTLY): New
- macro.
-
- * src/cff/cffdrivr.c (cff_driver_class): Use it.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Update auto-hinter selection
- logic.
-
-2015-11-09 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidload.c (cid_face_open): Fix GDBytes guard (#46408).
-
-2015-11-09 Werner Lemberg <wl@gnu.org>
-
- [truetype] Remove integer to pointer conversion compiler warning.
-
- Problem reported by Alexei.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Use a solution found
- in the glib library to fix the issue.
-
-2015-11-08 Behdad Esfahbod <behdad@behdad.org>
-
- [sfnt] Accept version 3 of `EBLC' and `CBLC' tables also.
-
- * src/sfnt/ttsbit.c (tt_face_load_sbit): Implement it.
-
-2015-11-08 Philipp Knechtges <philipp-dev@knechtges.com>
-
- [autofit] Don't distort (latin) glyphs too much (#46195).
-
- * src/autofit/aflatin.h (AF_LatinBlueRec): Add `ascender' and
- `descender' fields.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Collect
- ascender and descender data for blue zones.
- (af_latin_metrics_scale_dim): Reject vertical scaling values that
- change the result by more than two pixels.
-
-2015-11-05 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Ignore embedded bitmaps with zero size (#46379).
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Implement
- it.
-
-2015-11-04 Werner Lemberg <wl@gnu.org>
-
- [truetype] Catch infinite recursion in subglyphs (#46372).
-
- * include/freetype/internal/tttypes.h (TT_LoaderRec): New field
- `composites'.
-
- * src/truetype/ttgload.c: Include FT_LIST_H.
- (load_truetype_glyph): Add composite subglyph index to a list;
- abort if index is already in list.
- (tt_loader_init): Updated.
- (tt_loader_done): New function.
- (TT_Load_Glyph): Call `tt_loader_done'.
-
-2015-11-04 Werner Lemberg <wl@gnu.org>
-
- [truetype] Better tracing of composite glyphs.
-
- * src/truetype/ttgload.c (TT_Load_Composite_Glyph,
- load_truetype_glyph): Implement it.
-
-2015-11-03 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Protect against zero-size bitmaps (#46345).
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bitmap): Check
- `glyph_size'.
-
-2015-11-02 Nikolaus Waxweiler <madigens@gmail.com>
-
- * src/autofit/afloader.c (af_loader_load_g): Implement emboldening.
-
-2015-11-02 Nikolaus Waxweiler <madigens@gmail.com>
-
- [autofit] Implement darkening computation function.
-
- This is a crude adaption of the original `cf2_computeDarkening'
- function.
-
- * src/autofit/afloader.c (af_intToFixed, af_fixedToInt,
- af_floatToFixed): New macros, taken from `cf2fixed.h'.
- (af_loader_compute_darkening): New function.
- * src/autofit/afloader.h: Updated.
-
-2015-11-02 Nikolaus Waxweiler <madigens@gmail.com>
-
- [autofit] Add functions to get standard widths for writing systems.
-
- We need the computed standard horizontal and vertical widths for the
- emboldening calculation. This method provides a convenient way to
- extract it from writing-system-specific metrics structures, which
- all script definitions must implement.
-
- * src/autofit/aftypes.h (AF_WritingSystem_GetStdWidthsFunc): New
- function type.
- (AF_WritingSystemClassRec): New member `style_metrics_getstdw'.
- (AF_DEFINE_WRITING_SYSTEM_CLASS): Updated.
-
- * src/autofit/afcjk.c (af_cjk_get_standard_width): New function.
- (af_cjk_writing_system_class): Updated.
- * src/autofit/afdummy.c (af_dummy_writing_system_class): Updated.
- * src/autofit/afindic.c (af_cjk_get_standard_width): New function.
- (af_indic_writing_system_class): Updated.
- * src/autofit/aflatin.c (af_latin_get_standard_width): New function.
- (af_indic_writing_system_class): Updated.
- * src/autofit/aflatin.c (af_latin_get_standard_width): New function.
- (af_indic_writing_system_class): Updated.
-
-2015-11-02 Nikolaus Waxweiler <madigens@gmail.com>
-
- [autofit] Extend `AF_FaceGlobalsRec' to hold emboldening data.
-
- * src/autofit/afglobal.h (AF_FaceGlobalsRec): Add fields.
-
- * src/autofit/afglobal.c (af_face_globals_new): Initialize new
- fields.
- (af_face_globals_free): Reset new fields.
-
-2015-11-02 Nikolaus Waxweiler <madigens@gmail.com>
-
- [autofit] Add stem-darkening properties.
-
- Actual code follows in a later commit.
-
- * include/freetype/ftautoh.h: Document `no-stem-darkening' and
- `darkening-parameters'.
-
- * src/autofit/afmodule.h: New fields `no_stem_darkening' and
- `darken_params'.
-
- * src/autofit/afmodule.c (af_property_set, af_property_get):
- Handle them.
- (af_autofitter_init): Initialize them.
-
-2015-11-02 Ben Wagner <bungeman@gmail.com>
-
- [ftfuzzer] Add support for multiple files (patch #8779).
-
- Currently, libFuzzer only supports mutation of a single file. We
- circumvent this problem by using an uncompressed tar archive as
- multiple-file input for the fuzzer.
-
- This patch enables tests of `FT_Attach_Stream' and AFM/PFM parsing;
- a constructed tarball should contain a font file as the first
- element, and files to be attached as further elements.
-
- * src/tools/ftfuzzer/ftfuzzer.cc: Include libarchive headers.
- (archive_read_entry_data, parse_data): New functions.
- (LLVMFuzzerTestOneInput): Updated.
-
- * src/tools/ftfuzzer/ftmutator.cc: New file, providing a custom
- mutator for libFuzzer that can mutate tarballs in a sensible way.
-
-2015-10-31 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix cmap 14 validation (#46346).
-
- * src/sfnt/ttcmap.c (tt_cmap14_validate): Check limit before
- accessing `numRanges' and `numMappings'.
- Fix size check for non-default UVS table.
-
-2015-10-31 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Handle infinite recursion in bitmap strikes (#46344).
-
- * src/sfnt/ttsbit.c (TT_SBitDecoder_LoadFunc,
- tt_sbit_decoder_load_bitmap, tt_sbit_decoder_load_byte_aligned,
- tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_png): Add
- argument for recursion depth.
- (tt_sbit_decoder_load_compound): Add argument for recursion depth.
- Increase recursion counter for recursive call.
- (tt_sbit_decoder_load_image): Add argument for recursion depth.
- Check recurse depth.
- (tt_face_load_sbit_image): Updated.
-
-2015-10-29 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afhints.c (af_glyph_hints_dump_points): Minor.
-
-2015-10-29 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt: Remove code to set MSVC's /FD compiler switch.
-
- Problem reported by David Capello <davidcapello@gmail.com>; see
-
- https://lists.nongnu.org/archive/html/freetype-devel/2015-10/msg00108.html
-
- for details.
-
-2015-10-27 Werner Lemberg <wl@gnu.org>
-
- [pfr] Add some safety guards (#46302).
-
- * src/pfr/pfrload.h (PFR_CHECK): Rename to...
- (PFR_CHECK_SIZE): ... this.
- (PFR_SIZE): [!PFR_CONFIG_NO_CHECKS]: Define to PFR_CHECK_SIZE.
-
- * src/pfr/pfrload.c (pfr_log_font_count): Check `count'.
- (pfr_extra_item_load_kerning_pairs): Remove tracing message.
- (pfr_phy_font_load): Use PFR_CHECK_SIZE where appropriate.
- Allocate `chars' after doing a size checks.
-
- * src/pfr/pfrsbit.c (pfr_load_bitmap_bits): Move test for invalid
- bitmap format to...
- (pfr_slot_load_bitmap): ... this function.
- Check bitmap size.
-
-2015-10-26 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix sanitizing logic for `loca' (#46223).
-
- * src/truetype/ttpload.c (tt_face_load_loca): A thinko caused an
- incorrect adjustment of the number of glyphs, most often using far
- too large values.
-
-2015-10-25 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve tracing.
-
- * src/autofit/afhints.c (af_print_idx, af_get_segment_index,
- af_get_edge_index): New functions.
-
- (af_glyph_hints_dump_points): Remove unnecessary `|', `[', and `]'.
- Add segment and edge index for each point.
- Slightly change printing order of some elements.
- Don't print `-1' but `--' for missing elements.
-
- (af_glyph_hints_dump_segments, af_glyph_hints_dump_edges): Remove
- unnecessary `|', `[', and `]'.
- Don't print `-1' but `--' for missing elements.
-
-2015-10-24 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Sanitize bitmap strike glyph height.
-
- Problem reported by Nikolay Sivov <bunglehead@gmail.com>.
-
- * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Avoid zero value
- for `metrics->height' by applying some heuristics.
-
-2015-10-22 Werner Lemberg <wl@gnu.org>
-
- [sfnt, type42] Fix clang compiler warnings.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Initialize `offset'.
-
- * src/type42/t42parse.c (t42_parse_sfnts): Use proper cast.
-
-2015-10-22 Dave Arnold <darnold@adobe.com>
- Werner Lemberg <wl@gnu.org>
-
- [cff] Avoid overflow/module arithmetic.
-
- This modifies the addition of subroutine number to subroutine bias
- from unsigned to signed, but does not change any results.
-
- * src/cff/cf2ft.c (cf2_initGlobalRegionBuffer,
- cf2_initLocalRegionBuffer): Change variable names from (unsigned)
- `idx' to (signed) `subrNum', since it is not an index until after
- the bias is added.
- * src/cff/cf2ft.h: Updated.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdCALLSUBR>:
- Updated similarly.
-
-2015-10-22 Werner Lemberg <wl@gnu.org>
-
- [cid] Better check of `SubrCount' dictionary entry (#46272).
-
- * src/cid/cidload.c (cid_face_open): Add more sanity tests for
- `fd_bytes', `gd_bytes', `sd_bytes', and `num_subrs'.
-
-2015-10-21 Werner Lemberg <wl@gnu.org>
-
- [base] Pacify compiler (#46266).
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Initialize `in' and
- `anchor'.
-
-2015-10-21 Werner Lemberg <wl@gnu.org>
-
- [type42] Fix heap buffer overflow (#46269).
-
- * src/type42/t42parse.c (t42_parse_sfnts): Fix off-by-one error in
- bounds checking.
-
-2015-10-21 Dave Arnold <darnold@adobe.com>
-
- [cff] Fix limit in assert for max hints.
-
- * src/cff/cf2interp.c (cf2_hintmask_setAll): Allow mask equal to the
- limit (96 bits).
-
-2015-10-21 Dave Arnold <darnold@adobe.com>
-
- [cff] Remove an assert (#46107).
-
- * src/cff/cf2hints.c (cf2_hintmap_insertHint): Ignore paired edges
- in wrong order.
-
-2015-10-21 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Avoid unnecessarily large allocation for WOFFs (#46257).
-
- * src/sfnt/sfobjs.c (woff_open_font): Use WOFF's `totalSfntSize'
- only after thorough checks.
- Add tracing messages.
-
-2015-10-21 Werner Lemberg <wl@gnu.org>
-
- [type42] Better check invalid `sfnts' array data (#46255).
-
- * src/type42/t42parse.c (t42_parse_sfnts): Table lengths must be
- checked individually against available data size.
-
-2015-10-20 Werner Lemberg <wl@gnu.org>
-
- [cid] Add a bunch of safety checks.
-
- * src/cid/cidload.c (parse_fd_array): Check `num_dicts' against
- stream size.
- (cid_read_subrs): Check largest offset against stream size.
- (cid_parse_dict): Move safety check to ...
- (cid_face_open): ... this function.
- Also test length of binary data and values of `SDBytes',
- `SubrMapOffset', `SubrCount', `CIDMapOffset', and `CIDCount'.
-
-2015-10-20 Werner Lemberg <wl@gnu.org>
-
- [cid] Avoid segfault with malformed input (#46250).
-
- * src/cid/cidload.c (cid_read_subrs): Return a proper error code for
- unsorted offsets.
-
-2015-10-20 StudioEtrange <nomorgan@gmail.com>
-
- * CMakeLists.txt: Enable shared library builds on MinGW (#46233).
-
-2015-10-20 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1afm.c (T1_Read_Metrics): Fix memory leak (#46229).
-
-2015-10-19 Ben Wagner <bungeman@gmail.com>
-
- [cid] Better handle invalid glyph stream offsets (#46221).
-
- * src/cid/cidgload.c (cid_load_glyph): Check minimum size of glyph
- length.
-
-2015-10-18 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix tracing of negative numbers.
-
- Due to incorrect casting negative numbers were shown as very large
- (positive) integers on 64bit systems.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_none>:
- Use division instead of shift.
-
-2015-10-18 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improve TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES (#46223).
-
- * devel/ftoption.h, include/freetype/config/ftoption.h: Surround it
- with #ifndef ... #endif, as suggested in the tracker issue.
-
-2015-10-18 Werner Lemberg <wl@gnu.org>
-
- [truetype] Better protection against malformed `fpgm' (#46223).
-
- * src/truetype/ttobjs.c (tt_size_init_bytecode): Don't execute a
- malformed `fpgm' table more than once.
-
-2015-10-17 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidgload.c (cid_load_glyph): Fix memory leak.
-
- Reported by Kostya Serebryany <kcc@google.com>.
-
-2015-10-17 Werner Lemberg <wl@gnu.org>
-
- [bdf] Prevent memory leak (#46217).
-
- * src/bdf/bdflib.c (_bdf_parse_glyphs) <STARTCHAR>: Check
- _BDF_GLYPH_BITS.
-
-2015-10-17 Werner Lemberg <wl@gnu.org>
-
- [bdf] Use stream size to adjust number of glyphs.
-
- * src/bdf/bdflib.c (ACMSG17): New message macro.
- (_bdf_parse_t): Add member `size'.
- (bdf_load_font): Set `size'.
- (_bdf_parse_glyphs): Adjust `cnt' if necessary.
-
-2015-10-17 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidload.c (cid_parse_dict): Check `[FG]DBytes' size.
-
-2015-10-17 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidgload.c (cid_glyph_load): Check file offsets (#46222).
-
-2015-10-17 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix heap buffer overflow (#46221).
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstring) <operator 12>:
- Fix limit check.
-
-2015-10-17 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidload.c (cid_parse_dict): Handle invalid input (#46220).
-
-2015-10-15 Kostya Serebryany <kcc@google.com>
-
- [ftfuzzer] Add README.
-
- * src/tools/ftfuzzer/README: New file.
-
-2015-10-15 Ben Wagner <bungeman@gmail.com>
-
- [bdf] Fix memory leak (#46213).
-
- * src/bdf/bdflib.c (bdf_load_font): Always go to label `Fail' in
- case of error.
-
-2015-10-15 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES (#46208).
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (TT_CONFIG_OPTION_MAX_RUNNABLE_OPCODES): New configuration macro.
-
- * src/truetype/ttinterp.c (MAX_RUNNABLE_OPCODES): Removed.
- (TT_RunIns): Updated.
-
-2015-10-15 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (TT_RunIns): Fix bytecode stack tracing.
-
- The used indices were off by 1.
-
-2015-10-15 Ben Wagner <bungeman@gmail.com>
- Werner Lemberg <wl@gnu.org>
-
- * src/tools/ftfuzzer/ftfuzzer.cc: Handle fixed sizes (#46211).
-
-2015-10-15 Werner Lemberg <wl@gnu.org>
-
- [base] Compute MD5 checksums only if explicitly requested.
-
- This improves profiling accuracy.
-
- * src/base/ftobjs.c (FT_Render_Glyph_Internal): Implement it.
-
-2015-10-14 Werner Lemberg <wl@gnu.org>
-
- [base] Use `FT_' namespace for MD5 functions (#42366).
-
- * src/base/ftobjs.c (MD5_*): Define as `FT_MD5_*'.
- Undefine HAVE_OPENSSL.
-
-2015-10-13 Werner Lemberg <wl@gnu.org>
-
- [type1] Correctly handle missing MM axis names (#46202).
-
- * src/type1/t1load.c (T1_Get_MM_Var): Implement it.
-
-2015-10-13 Werner Lemberg <wl@gnu.org>
-
- [pcf] Quickly exit if font index < 0.
-
- Similar to other font formats, this commit makes the parser no
- longer check the whole PCF file but only the header and the TOC if
- we just want to get the number of available faces (and a proper
- recognition of the font format).
-
- * src/pcf/pcfdrivr.c (PCF_Face_Init): Updated.
- Exit quickly if face_index < 0.
-
- * src/pcfread.c (pcf_load_font): Add `face_index' argument.
- Exit quickly if face_index < 0.
-
- * src/pcf/pcf.h: Updated.
-
-2015-10-13 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Handle TTCs and MM/GX variations.
-
- This patch also contains various other improvements.
-
- * src/tools/ftfuzzer/ftfuzzer.cc: Add preprocessor guard to reject
- pre-C++11 compilers.
- (FT_Global): New class. Use it to provide a global constructor and
- destructor for the `FT_Library' object.
- (setIntermediateAxis): New function to select an (arbitrary)
- instance.
- (LLVMFuzzerTestOneInput): Loop over all faces and named instances.
- Also call `FT_Set_Char_Size'.
-
-2015-10-13 Werner Lemberg <wl@gnu.org>
-
- [truetype] Refine some GX sanity tests.
-
- Use the `gvar' table size instead of the remaining bytes in the
- stream.
-
- * src/truetype/ttgxvar.h (GX_BlendRec): New field `gvar_size'.
-
- * src/truetype/ttgxvar.c (ft_var_load_gvar): Set `gvar_size'.
- (ft_var_readpackedpoints, ft_var_readpackeddeltas: New argument
- `size'.
- (tt_face_vary_cvt, TT_Vary_Apply_Glyph_Deltas): Updated.
-
-2015-10-13 Werner Lemberg <wl@gnu.org>
-
- [truetype] Another GX sanity test.
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Check
- `tupleCount'.
- Add tracing message.
-
-2015-10-13 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix memory leak for broken GX fonts (#46188).
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix scope of
- deallocation.
-
-2015-10-13 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix commit from 2015-10-10.
-
- * src/truetype/ttgxvar.c (ft_var_load_gvar): Add missing error
- handling body to condition.
-
-2015-10-12 Werner Lemberg <wl@gnu.org>
-
- [unix] Make MKDIR_P actually work.
-
- * builds/unix/configure.raw: Fix underquoting of `INSTALL' and
- `MKDIR_P'.
-
- Problem reported by Dan Liddell <lddll@yahoo.com>.
-
-2015-10-11 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Improve extraction of number of named instances.
-
- * src/sfnt/sfobjs.c (sfnt_init_face)
- [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Check number of instances against
- `fvar' table size.
-
-2015-10-10 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Fix overflow
- (#46149).
-
-2015-10-10 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix infinite loops with broken cmaps (#46167).
-
- * src/sfnt/ttcmap.c (tt_cmap8_char_next, tt_cmap12_next): Take care
- of border conditions (i.e., if the loops exit naturally).
-
-2015-10-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] More sanity tests for GX handling.
-
- These tests should mainly help avoid unnecessarily large memory
- allocations in case of malformed fonts.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints,
- ft_var_readpackeddeltas): Check number of points against stream
- size.
- (ft_var_load_avar): Check `pairCount' against table length.
- (ft_var_load_gvar): Check `globalCoordCount' and `glyphCount'
- against table length.
- (tt_face_vary_cvt): Check `tupleCount' and `offsetToData'.
- Fix trace.
- (TT_Vary_Apply_Glyph_Deltas): Fix trace.
- Free `sharedpoints' to avoid memory leak.
-
-2015-10-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] Better protection against malformed GX data (#46166).
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Correctly
- handle empty `localpoints' array.
-
-2015-10-10 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfread.c (pcf_read_TOC): Check stream size (#46162).
-
-2015-10-09 Werner Lemberg <wl@gnu.org>
-
- * src/gzip/ftgzip.c (FT_Stream_OpenGzip): Use real stream size.
-
-2015-10-08 Werner Lemberg <wl@gnu.org>
-
- [pcf] Protect against invalid number of TOC entries (#46159).
-
- * src/pcf/pcfread.c (pcf_read_TOC): Check number of TOC entries
- against size of data stream.
-
-2015-10-08 Werner Lemberg <wl@gnu.org>
-
- [type42] Protect against invalid number of glyphs (#46159).
-
- * src/type42/t42parse.c (t42_parse_charstrings): Check number of
- `CharStrings' dictionary entries against size of data stream.
-
-2015-10-08 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix some signed overflows (#46149).
-
- * src/sfnt/ttsbit.c (tt_face_load_strike_metrics)
- <TT_SBIT_TABLE_TYPE_SBIX>: Use `FT_MulDiv'.
-
-2015-10-08 Werner Lemberg <wl@gnu.org>
-
- [type1] Protect against invalid number of subroutines (#46150).
-
- * src/type1/t1load.c (parse_subrs): Check number of
- `Subrs' dictionary entries against size of data stream.
-
-2015-10-07 Kostya Serebryany <kcc@google.com>
-
- [ftfuzzer] Add support for LLVM's LibFuzzer.
-
- * src/tools/ftfuzzer/ftfuzzer.cc, src/tools/runinput.cc: New files.
-
-2015-10-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Faster alternative line renderer.
-
- This implementation renders the entire line segment at once without
- subdividing it into scanlines. The main speed improvement comes from
- reducing the number of divisions to just two per line segment, which
- is a bare minimum to calculate cell coverage in a smooth rasterizer.
- Notably, the progression from cell to cell does not itself require any
- divisions at all. The speed improvement is more noticeable at larger
- sizes.
-
- * src/smooth/ftgrays.c (gray_render_line): New implementation.
-
-2015-10-06 Werner Lemberg <wl@gnu.org>
-
- [cff] Return correct PS names from pure CFF (#46130).
-
- * src/cff/cffdrivr.c (cff_get_ps_name): Use SFNT service only for
- SFNT.
-
-2015-10-04 Werner Lemberg <wl@gnu.org>
-
- [base] Replace left shifts with multiplication (#46118).
-
- * src/base/ftglyph.c (ft_bitmap_glyph_bbox, FT_Get_Glyph): Do it.
-
-2015-10-04 Werner Lemberg <wl@gnu.org>
-
- * Version 2.6.1 released.
- =========================
-
-
- Tag sources with `VER-2-6-1'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.6.1.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.6/2.6.1/, s/26/261/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
- * builds/unix/configure.raw (version_info): Set to 18:1:12.
- * CMakeLists.txt (VERSION_PATCH): Set to 1.
-
- * src/autofit/afmodule.c [AF_DEBUG_AUTOFIT]: Ensure C linking for
- dumping functions.
-
-2015-10-04 Werner Lemberg <wl@gnu.org>
-
- [bzip2, gzip] Avoid access of uninitialized memory (#46109).
-
- * src/bzip2/ftbzip2.c (ft_bzip2_file_fill_input), src/gzip/ftgzip.c
- (ft_gzip_file_fill_input): In case of an error, adjust the limit to
- avoid copying uninitialized memory.
-
-2015-10-03 Werner Lemberg <wl@gnu.org>
-
- [bzip2, gzip] Avoid access of uninitialized memory (#46109).
-
- * src/bzip2/ftbzip2.c (ft_bzip2_file_fill_output), src/gzip/ftgzip.c
- (ft_gzip_file_fill_output): In case of an error, adjust the limit to
- avoid copying uninitialized memory.
-
-2015-10-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Clean up worker.
-
- * src/smooth/ftgrays.c (gray_TWorker): Remove never used fields.
-
-2015-10-01 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Make `tt_cmap4_char_map_linear' more robust (#46078).
-
- * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Take care of
- border conditions (i.e., if the loop exits naturally).
-
-2015-10-01 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afranges.c (af_deva_nonbase_uniranges): Fix ranges.
- They should be a subset of `af_deva_uniranges'.
-
-2015-10-01 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Make `tt_cmap4_char_map_linear' faster (#46078).
-
- * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Use inner loop to
- reject too large glyph indices.
-
-2015-09-30 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Clean up worker.
-
- * src/smooth/ftgrays.c (gray_TWorker): Remove lightly used `last_ey'.
- (gray_start_cell, gray_render_line): Update.
-
-2015-09-30 Werner Lemberg <wl@gnu.org>
-
- [autofit] Replace `no-base' with `non-base'.
-
- * src/autofit/*: Do it.
-
-2015-09-30 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Rewrite `tt_cmap4_char_map_linear' (#46078).
-
- * src/sfnt/ttcmap.c (tt_cmap4_char_map_linear): Add code to better
- skip invalid segments.
- If searching the next character, provide a more efficient logic to
- speed up the code.
-
-2015-09-30 Werner Lemberg <wl@gnu.org>
-
- [truetype] Adjust number of glyphs for malformed `loca' tables.
-
- * src/truetype/ttpload.c (tt_face_load_loca): Implement it.
-
-2015-09-29 Werner Lemberg <wl@gnu.org>
-
- [pshinter] Avoid harmless overflow (#45984).
-
- * src/pshinter/pshglob.c (psh_blues_set_zones): Fix it.
-
-2015-09-28 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Lao script.
-
- Thanks to Danh Hong <danhhong@gmail.com> for guidance with blue zone
- characters!
-
- * src/autofit/afblue.dat: Add blue zone data for Lao.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Lao standard characters.
-
- * src/autofit/afranges.c: Add Lao data.
-
- * src/autofit/afstyles.h: Add Lao data.
-
-2015-09-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [base] Fix a leak by broken sfnt-PS or resource fork (#46028).
-
- open_face_from_buffer() frees passed buffer if valid font
- is not found. But if copying to the buffer is failed,
- the allocated buffer should be freed within the caller.
-
- * src/base/ftobjs.c (open_face_PS_from_sfnt_stream): Free
- the buffer `sfnt_ps' if an error caused before calling
- open_face_from_buffer().
- (Mac_Read_sfnt_Resource): Free the buffer `sfnt_data' if
- an error caused before calling open_face_from_buffer();
-
-2015-09-27 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [mac] Fix buffer size calculation for LWFN font.
-
- * src/base/ftmac.c (read_lwfn): Cast post_size to FT_ULong
- to prevent confused copy by too large chunk size.
-
-2015-09-26 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (PIXEL_MASK): Remove unused macro.
-
-2015-09-26 Werner Lemberg <wl@gnu.org>
-
- [autofit] Minor tracing improvement.
-
- * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Don't emit
- blue zones header line if there are no blue zones.
-
-2015-09-26 Werner Lemberg <wl@gnu.org>
-
- [bzip2, gzip, lzw] Harmonize function signatures with prototype.
-
- Suggested by Hin-Tak Leung.
-
- * src/bzip2/ftbzip2.c (ft_bzip2_stream_io), src/gzip/ftgzip.c
- (ft_gzip_stream_io), src/lzw/ftlzw.c (ft_lzw_stream_io): Do it.
-
-2015-09-26 Hin-Tak Leung <htl10@users.sourceforge.net>
-
- Add new FT_LOAD_COMPUTE_METRICS load flag.
-
- * include/freetype/freetype.h (FT_LOAD_COMPUTE_METRICS): New macro.
- * src/truetype/ttgload.c (compute_glyph_metrics): Usage.
-
-2015-09-26 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Add cast.
-
-2015-09-25 Werner Lemberg <wl@gnu.org>
-
- [type1] Protect against invalid number of glyphs (#46029).
-
- * src/type1/t1load.c (parse_charstrings): Check number of
- `CharStrings' dictionary entries against size of data stream.
-
-2015-09-23 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Better checks for invalid cmaps (2/2) (#46019).
-
- While the current code in `FT_Get_Next_Char' correctly rejects
- out-of-bounds glyph indices, it can be extremely slow for malformed
- cmaps that use 32bit values. This commit tries to improve that.
-
- * src/sfnt/ttcmap.c (tt_cmap8_char_next, tt_cmap12_next,
- tt_cmap12_char_map_binary, tt_cmap13_next,
- tt_cmap13_char_map_binary): Reject glyph indices larger than or
- equal to the number of glyphs.
-
-2015-09-23 Werner Lemberg <wl@gnu.org>
-
- [base, sfnt] Better checks for invalid cmaps (1/2).
-
- * src/base/ftobjs.c (FT_Get_Char_Index): Don't return out-of-bounds
- glyph indices.
- (FT_Get_First_Char): Updated.
-
- * src/sfnt/ttcmap.c (tt_cmap6_char_next): Don't return character
- codes greater than 0xFFFF.
-
- (tt_cmap8_char_index): Avoid integer overflow in computation of
- glyph index.
- (tt_cmap8_char_next): Avoid integer overflows in computation of
- both next character code and glyph index.
-
- (tt_cmap10_char_index): Fix unsigned integer logic.
- (tt_cmap10_char_next): Avoid integer overflow in computation of
- next character code.
-
- (tt_cmap12_next): Avoid integer overflows in computation of both
- next character code and glyph index.
- (tt_cmap12_char_map_binary): Ditto.
- (tt_cmap12_char_next): Simplify.
-
- (tt_cmap13_char_map_binary): Avoid integer overflow in computation
- of next character code.
- (tt_cmap13_char_next): Simplify.
-
-2015-09-21 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [base] Check too long POST and sfnt resource (#45919).
-
- * src/base/ftbase.h (FT_MAC_RFORK_MAX_LEN): Maximum length of the
- resource fork for Mac OS. Resource forks larger than 16 MB can be
- written but can't be handled correctly, at least in Carbon routine.
- See https://support.microsoft.com/en-us/kb/130437.
-
- * src/base/ftobjs.c (Mac_Read_POST_Resource): No need to use `0x'
- prefix for `%p' formatter.
-
- * src/base/ftbase.c (Mac_Read_POST_Resource): Check the fragment and
- total size of the concatenated POST resource before buffer
- allocation.
- (Mac_Read_sfnt_Resource): Check the declared size of sfnt resource
- before buffer allocation.
-
- * src/base/ftmac.c (read_lwfn, FT_New_Face_From_SFNT): Check the
- total resource size before buffer allocation.
-
-2015-09-19 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Improve handling of invalid SFNT table entries (#45987).
-
- This patch fixes weaknesses in function `tt_face_load_font_dir'.
-
- - It incorrectly assumed that valid tables are always at the
- beginning. As a consequence, some valid tables after invalid
- entries (which are ignored) were never seen.
-
- - Duplicate table entries (this is, having the same tag) were not
- rejected.
-
- - The number of valid tables was sometimes too large, leading to
- access of invalid tables.
-
- * src/sfnt/ttload.c (check_table_dir): Add argument to return number
- of valid tables.
- Add another tracing message.
- (tt_face_load_font_dir): Only allocate table array for valid
- entries as returned by `check_table_dir'.
- Reject duplicate tables and adjust number of valid tables
- accordingly.
-
-2015-09-19 Werner Lemberg <wl@gnu.org>
-
- [pcf] Improve `FT_ABS' fix from 2015-09-17 (#45999).
-
- * src/pcf/pcfread.c (pcf_load_font): Do first the cast to FT_Short,
- then take the absolute value.
- Also apply FT_ABS to `height'.
-
-2015-09-17 Werner Lemberg <wl@gnu.org>
-
- [type42] Fix memory leak (#45989).
-
- * src/type42/t42parse.c (t42_parse_charstrings): Allow only a single
- `CharStrings' array.
-
-2015-09-17 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix memory leak (#45986).
-
- * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>:
- Free `temp' in case of error.
-
-2015-09-17 Werner Lemberg <wl@gnu.org>
-
- [psaux] Improve tracing message.
-
- * src/psaux/psobjs.c (ps_parser_load_field) <T1_FIELD_TYPE_MM_BBOX>:
- Handle plural correctly.
-
-2015-09-17 Werner Lemberg <wl@gnu.org>
-
- [pcf] Fix integer overflows (#45985).
-
- * src/pcf/pcfread.c (pcf_load_font): Use FT_MulDiv.
-
-2015-09-17 Werner Lemberg <wl@gnu.org>
-
- [pcf] Use FT_ABS for some property values (#45893).
-
- * src/pcf/pcfread.c (pcf_load_font): Take absolute values for
- AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE, RESOLUTION_X, and
- RESOLUTION_Y. In tracing mode, add warnings.
-
-2015-09-16 Werner Lemberg <wl@gnu.org>
-
- Minor fixes for some clang warnings.
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Cast, possible missing
- initialization.
-
- * src/truetype/ttgload.c (TT_Process_Composite_Component): Cast.
-
-2015-09-15 Werner Lemberg <wl@gnu.org>
-
- [type1, type42] Fix memory leaks (#45966).
-
- * src/type1/t1load.c (parse_blend_axis_types): Handle multiple axis
- names.
- (parse_blend_design_map): Allow only a single design map.
- (parse_encoding): Handle multiple encoding vectors.
-
- * src/type42/t42parse.c (t42_parse_encoding): Handle multiple
- encoding vectors.
-
-2015-09-15 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix integer type (#45965).
-
- * src/truetype/ttobjs.c (tt_synth_sfnt_checksum): Implement it.
-
-2015-09-15 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfread.c (pcf_load_font): Fix integer overflow (#45964).
-
-2015-09-15 Werner Lemberg <wl@gnu.org>
-
- [type1, type42] Check encoding array size (#45961).
-
- * src/type1/t1load.c (parse_encoding), src/type42/t42parse.c
- (t42_parse_encoding): Do it.
-
-2015-09-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftcalc.c (FT_MulFix) [FT_LONG64]: Improve.
-
-2015-09-14 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix another potential buffer overflow (#45955).
-
- * src/type1/t1parse (T1_Get_Private_Dict): Assure that check for
- `eexec' doesn't exceed `limit'.
-
-2015-09-13 Werner Lemberg <wl@gnu.org>
-
- Replace `mkinstalldirs' with AC_PROG_MKDIR_P.
-
- * builds/unix/mkinstalldirs: Removed, no longer needed.
-
- * builds/unix/configure.raw: Call `AC_PROG_MKDIR_P'.
- Update pwd call for `$INSTALL'.
-
- * builds/unix/unix-def.in (MKINSTALLDIRS): Use `@MKDIR_P@'.
-
- * autogen.sh: Updated.
-
-2015-09-13 Werner Lemberg <wl@gnu.org>
-
- [winfonts] Check alignment shift count for resource data (#45938).
-
- * src/winfonts/winfnt.c (fnt_face_get_dll_font): Implement it.
-
-2015-09-13 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix potential buffer overflow (#45923).
-
- * src/type1/t1parse.c (T1_Get_Private_Dict): Assure `cur' doesn't
- point to end of file buffer.
-
-2015-09-13 Werner Lemberg <wl@gnu.org>
-
- [gzip] Fix access of small compressed files (#45937).
-
- * src/gzip/ftgzip.c (ft_gzip_stream_close): Avoid memory leak.
-
- (ft_gzip_get_uncompressed_file): Correct byte order while reading
- unsigned long value. Without this change, the whole optimization of
- accessing small files in `FT_Stream_OpenGzip' is never executed! As
- a consequence, access to PCF files in general (which are normally
- small files) should be much improved now as originally intended.
-
-2015-09-11 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix potential buffer overflow (#45922).
-
- * src/psaux/psobjs.c (ps_parser_skip_PS_token): If a token is
- enclosed in balanced expressions, ensure that the cursor position
- doesn't get larger than the current limit.
-
-2015-09-11 Werner Lemberg <wl@gnu.org>
-
- [base] Avoid crash while tracing `load_mac_face'.
-
- Reported in Savannah bug #45919.
-
- * src/base/ftobjs.c (load_mac_face): Honour FT_OPEN_MEMORY while
- tracing.
-
-2015-09-11 Werner Lemberg <wl@gnu.org>
-
- [type42] Fix endless loop (#45920).
-
- * src/type42/t42parse.c (t42_parse_encoding): Synchronize with
- type1's `parse_encoding'.
-
-2015-09-10 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Allow `-' in bold and italic markup.
-
- * src/tools/docmaker/sources.py (re_italic, re_bold): Adjust
- accordingly.
-
-2015-09-09 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftcalc.c (FT_RoundFix): Improve.
-
-2015-09-09 Wojciech Mamrak <wmamrak@gmail.com>
-
- * src/base/ftcalc.c (FT_CeilFix, FT_FloorFix): Normalize.
-
- This commit makes the functions behave as expected, this is,
- rounding towards plus or minus infinity.
-
-2015-09-07 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_render_line): Simplify clipping.
-
-2015-09-04 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [raster,smooth] Microoptimizations.
-
- * src/raster/ftraster.c (Insert_Y_Turn, Finalize_Profile_Table,
- Bezier_Up): Use do-while loops.
-
- * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line,
- gray_convert_glyph): Ditto.
-
-2015-09-04 Werner Lemberg <wl@gnu.org>
-
- [autofit] Redesign code ranges (2/2).
-
- This commit adds two fallback scripts (`latb', `latp') and
- implements support for the no-base character ranges introduced in
- the previous commit.
-
- * src/autofit/aftypes.h (AF_ScriptClassRec): Add
- `script_uni_nobase_ranges' field.
- (AF_DEFINE_SCRIPT_CLASS): Updated.
-
- * src/autofit/afscript.h, src/autofit/afstyles.h: Add `latb' and
- `latp' fallback scripts.
-
- * src/autofit/afblue.dat: Add blue zones for Latin subscript and
- superscript fallback scripts.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afglobal.h (AF_NOBASE): New style flag for no-base
- characters.
- (AF_STYLE_MASK): Updated.
-
- * src/autofit/afglobal.c (SCRIPT): Updated.
- (af_face_globals_compute_style_coverage): Handle new style flag.
-
- * src/autofit/aflatin.c (af_latin_hints_apply): Handle new style
- flag.
-
- * src/autofit/afranges.h (SCRIPT): Use it to export no-base ranges.
-
-2015-09-04 Werner Lemberg <wl@gnu.org>
-
- [autofit] Redesign code ranges (1/2).
-
- This patch introduces auxiliary code ranges that identify no-base
- characters; they refer to glyphs of a script that should be hinted
- without alignments to blue zones (mostly diacritics).
-
- It also splits off ranges for fallback scripts that handle subscript
- and superscript characters not covered by OpenType features. For
- example, this greatly helps improve the hinting of various phonetic
- alphabets, which contain a large amount characters that look like
- superscript glyphs.
-
- Finally, code ranges are updated to Unicode 8.0, and enclosed
- characters are removed in general since they normally look better if
- they stay unhinted.
-
- * src/autofit/afranges.c (af_latn_uniranges): Updated to Unicode
- 8.0.
- Split off superscript-like and subscript-like glyphs into...
-
- (af_latb_uniranges, af_latp_uniranges): ... these two new arrays.
-
- (af_xxxx_nobase_uniranges): New arrays that hold no-base characters
- of the corresponding character ranges.
-
-2015-09-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Pass glyph index to hinting function.
-
- No functionality change yet.
-
- * src/autofit/aftypes.h (AF_WritingSystem_ApplyHintsFunc): Pass
- glyph index.
-
- * src/autofit/afcjk.c, src/autofit/afcjk.h (af_cjk_hints_apply),
- src/autofit/afdummy.c (af_dummy_hints_apply), src/autofit/afindic.c
- (af_indic_hints_apply), src/autofit/aflatin.c
- (af_latin_hints_apply), src/autofit/aflatin2.c
- (af_latin2_hints_apply), src/autofit/afloader.c (af_loader_load_g):
- Updated.
-
-2015-08-30 Werner Lemberg <wl@gnu.org>
-
- [autofit] Code clean-up.
-
- * src/autofit/afglobal.h (AF_STYLE_MASK): New macro.
- (AF_STYLE_UNASSIGNED): Use AF_STYLE_MASK for definition.
-
- * src/autofit/afglobal.c (af_face_globals_compute_style_coverage):
- Updated.
-
-2015-08-30 Werner Lemberg <wl@gnu.org>
-
- [autofit] Make glyph style array use 16bit values.
-
- * include/freetype/ftautoh.h (FT_Prop_GlyphToScriptMap): Use
- `FT_UShort' for `map' field.
-
- * src/autofit/afglobal.c (af_face_globals_compute_style_coverage,
- af_face_globals_new), src/autofit/hbshim.c, src/autofit/hbshim.h
- (af_get_coverage): Use FT_UShort for `glyph_styles' array.
-
- * src/autofit/afglobal.h (AF_STYLE_UNASSIGNED, AF_DIGIT): Extend to
- 16 bits.
- (AF_FaceGlobalsRec): Use `FT_UShort' for `glyph_styles' field.
-
-2015-08-26 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.raw: Need harfbuzz >= 0.9.21 (#45828).
-
-2015-08-25 Werner Lemberg <wl@gnu.org>
-
- [base] Improve kerning tracing and documentation.
-
- * src/base/ftobjs.c (FT_Get_Kerning): Emit tracing message if
- scaled-down kerning values differ.
-
-2015-08-18 Werner Lemberg <wl@gnu.org>
-
- [raster] Remove last remnants of `raster5' driver.
-
- * src/raster/ftrend1.h (ft_raster5_renderer_class): Removed.
-
- * src/raster/rastpic.c, src/raster/rastpic.h
- (ft_raster5_renderer_class_pic_init,
- ft_raster5_renderer_class_pic_free): Removed.
-
-2015-08-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Improve emboldener (#45596).
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Correct displacement
- of zero-length segments.
-
-2015-08-16 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Reoptimize arithmetic.
-
- * src/base/ftcalc.c (FT_MulDiv, FT_MulFix) [!FT_LONG64]: Remove
- special cases that slow down the general use.
-
-2015-08-15 pazer <ibemad@gmail.com>
-
- Fix C++ compilation (#45762).
-
- * src/base/ftstroke.c (ft_outline_glyph_class): Use
- FT_CALLBACK_TABLE.
-
-2015-08-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Clean up.
-
- * src/truetype/ttgload.c (TT_Process_Composite_Component): Use
- `FT_Outline_Transform' and `FT_Outline_Translate'.
- (translate_array): Dropped.
-
-2015-08-14 Andreas Enge <andreas.enge@inria.fr>
-
- * builds/unix/detect.mk (CONFIG_SHELL): Don't handle it (#44261).
-
-2015-08-13 Werner Lemberg <wl@gnu.org>
-
- [truetype] Introduce named instance access to GX fonts.
-
- For functions querying a face, bits 16-30 of the face index can hold
- the named instance index if we have a GX font. The indices start
- with value 1; value 0 indicates font access without GX variation
- data.
-
- * include/freetype/freetype.h (FT_FaceRec): Update documentation.
- * include/freetype/internal/sfnt.h: Ditto.
-
- * src/sfnt/sfobjs.c (sfnt_init_face)
- [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Get number of named instances and
- do argument checks.
- (sfnt_load_face): Updated.
-
- * src/truetype/ttobjs.c (tt_face_init)
- [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Use named instance, overwriting
- the style name.
-
- * src/base/ftobjs.c (open_face_from_buffer,
- open_face_PS_from_sfnt_stream): Updated.
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Updated.
- * src/cff/cffload.c (cff_font_load): Updated.
-
- * src/cff/cffobjs.c (cff_face_init): Make function exit early for
- pure CFF fonts if `font_index < 0'.
- Updated.
-
- * src/cid/cidobjs.c (cid_face_init): Updated.
- * src/pcf/pcfdrivr.c (PCF_Face_Init): Updated.
- * src/pfr/pfrobjs.c (pfr_face_init): Updated.
- * src/type1/t1objs.c (T1_Face_Init): Updated.
- * src/type42/t42objs.c (T42_Face_Init): Updated.
- * src/winfonts/winfnt.c (fnt_face_get_dll_font, FNT_Face_Init):
- Updated.
-
- * docs/CHANGES: Updated.
-
-2015-08-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [type1,cff,cid] Streamline font matrix application.
-
- * src/type1/t1gload.c (T1_Load_Glyph): Directly modify advances only
- if font matrix is not trivial.
- * src/cff/cffgload.c (cff_slot_load): Ditto.
- * src/cid/cidgload.c (cid_slot_load_glyph): Ditto for advances and the
- entire outline.
-
-2015-08-11 Werner Lemberg <wl@gnu.org>
-
- [builds/unix] Minor.
-
- * builds/unix/configure.raw:
- s/lib{priv,staticconf}/libs{priv,staticconf}/ for orthogonality with
- similarly named uppercase variables.
-
-2015-08-10 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [type1,cid,type42] Minor improvements.
-
- * src/type1/t1load.c (t1_parse_font_matrix): Scale units per EM only
- when necessary. Refresh comments.
- * src/cid/cidload.c (cid_parse_font_matrix): Ditto.
- * src/type42/t42parse.c (t42_parse_font_matrix): Refresh comments.
-
-2015-08-08 Werner Lemberg <wl@gnu.org>
-
- [type42] Fix glyph access.
-
- This is a severe bug: We've missed one level of indirection, as
- described in the Type 42 specification. As a result, ftview
- sometimes showed incorrect glyphs for given glyph names, and even
- displayed `error 0x0006' (invalid argument!) in case the number of
- glyph indices differed between the Type 42 font and the embedded
- TTF.
-
- Apparently, noone ever noticed it; this shows how much Type 42 fonts
- are in use...
-
- * src/type42/t42objs.c (T42_GlyphSlot_Load): Map Type 42 glyph index
- to embedded TTF's glyph index.
-
-2015-08-08 Werner Lemberg <wl@gnu.org>
-
- [type42] Minor clean-up.
-
- * src/type42/t42parse.c (t42_parse_font_matrix): Remove unused
- variable.
-
-2015-08-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [type42] Parse FontMatrix according to specifications.
-
- * src/type42/t42parse.c (t42_parse_font_matrix): Type 42 FontMatrix
- does not need scaling by 1000. Units_per_EM are taken from the
- embedded TrueType.
-
-2015-08-06 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve Arabic hinting.
-
- Problem reported by Titus Nemeth <tn@tntypography.eu> (by using
- ttfautohint).
-
- * src/autofit/afblue.dat: Add neutral blue zone for the tatweel
- character.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
-2015-08-05 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Clean up types.
-
- * src/truetype/ttobjs.c (TT_Size): Move declaration from here.
- * include/freetype/internal/tttypes.h (TT_Size): ... to here.
- (TT_LoaderRec): Switch to appropriate types for `face' and `size'.
- * src/truetype/ttgload.c: Remove corresponding type casts.
- * src/truetype/ttsubpix.c: Ditto.
-
-2015-08-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve recognition of flat vs. rounded segments.
-
- Lower the flatness threshold from upem/8 to upem/14, making the
- auto-hinter accept shorter elements.
-
- Synchronize flat/round stem selection algorithm with blue zone code.
-
- * src/autofit/aflatin.c (FLAT_THRESHOLD): New macro.
- (af_latin_metrics_init_blues): Use it.
- (af_latin_hints_compute_segments): Collect information on maximum
- and minimum coordinates of `on' points; use this to add a constraint
- for the flat/round decision similar to
- `af_latin_metrics_init_blues'.
-
-2015-08-04 Werner Lemberg <wl@gnu.org>
-
- Another left-shift bug (#45681).
-
- * src/base/ftobjs.c (IsMacBinary): Only accept positive values for
- `dlen'.
-
-2015-08-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fix `ft_corner_orientation'.
-
- Remove casting from `FT_Long' to `FT_Int' that might change the sign
- of the return value and make it faster too.
-
- * src/base/ftcalc.c (ft_corner_orientation): On 32-bit systems, stay
- with 32-bit arithmetic when safe. Use plain math on 64-bit systems.
- * src/pshinter/pshalgo.c: Remove old unused code.
-
-2015-08-03 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c (load_truetype_glyph)
- [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Fix crash for composite glyphs
- having a depth greater than 1.
-
-2015-08-03 Werner Lemberg <wl@gnu.org>
-
- Fix typo in clang bug from 2015-07-31 (#45678).
-
- * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Fix inequality.
-
-2015-08-02 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt: Improve shared library support.
-
- Based on a patch from John Cary <cary@txcorp.com>.
-
-2015-08-02 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype-config.in (enable_shared): Remove. Unused.
-
-2015-08-02 Werner Lemberg <wl@gnu.org>
-
- Fix more invalid left-shifts.
-
- * src/pfr/pfrgload.c (pfr_glyph_load_compound): Use multiplication,
- not left-shift.
-
- * src/truetype/ttgxvar.c (ft_var_load_avar, ft_var_load_gvar,
- tt_face_vary_cvt, TT_Vary_Apply_Glyph_Deltas): Use multiplication,
- not left-shift.
-
-2015-07-31 Werner Lemberg <wl@gnu.org>
-
- Fix some bugs found by clang's `-fsanitize=undefined' (#45661).
-
- * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Only accept
- positive values from header.
- Check overflow.
-
- * src/base/ftoutln.c (SCALED): Correctly handle left-shift of
- negative values.
-
- * src/bdf/bdf.h (_bdf_glyph_modified, _bdf_set_glyph_modified,
- _bdf_clear_glyph_modified): Use unsigned long constant.
-
- * src/bdf/bdfdrivr.c (BDF_Size_Select, BDF_Glyph_Load): Don't
- left-shift values that can be negative.
-
- * src/pcf/pcfdrivr.c (PCF_Size_Select, PCF_Glyph_Load): Don't
- left-shift values that can be negative.
-
- * src/raster/ftraster.c (SCALED): Correctly handle left-shift of
- negative values.
-
- * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Don't left-shift
- values that can be negative.
-
- * src/truetype/ttgload.c (TT_Load_Composite_Glyph,
- compute_glyph_metrics, load_sbit_image): Don't left-shift values
- that can be negative.
-
-2015-07-31 Werner Lemberg <wl@gnu.org>
-
- Define FT_LONG_MAX.
-
- * include/freetype/config/ftstdlib.h (FT_LONG_MAX): New macro.
- * src/cff/cf2arrst.c (cf2_arrstack_setNumElements): Use it.
-
-2015-07-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftcalc.c (FT_Vector_NormLen): Clarify.
-
-2015-07-27 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftcalc.c (FT_Vector_NormLen): Explicate type conversions.
-
-2015-07-26 Matthias Clasen <matthias.clasen@gmail.com>
-
- [cff] Don't use `hmtx' table for LSB (#45520).
-
- * src/cff/cffgload.c (cff_slot_load): Use `htmx' table for advance
- width only. Bug introduced 2015-04-10.
-
-2015-07-09 Werner Lemberg <wl@gnu.org>
-
- Better support of user-supplied C++ namespaces.
-
- See
-
- https://lists.nongnu.org/archive/html/freetype-devel/2015-07/msg00008.html
-
- for a rationale.
-
- * src/autofit/afpic.h, src/base/basepic.h, src/cff/cffpic.h,
- src/pshinter/pshpic.h, src/psnames/pspic.h, src/raster/rastpic.h,
- src/sfnt/sfntpic.h, src/smooth/ftspic.h, src/truetype/ttpic.h
- (FT_BEGIN_HEADER, FT_END_HEADER): Move macro calls to not enclose
- header files that contain FT_{BEGIN,END}_HEADER macros by
- themselves.
-
- * src/autofit/aftypes.h [FT_DEBUG_AUTOFIT]: Include
- FT_CONFIG_STANDARD_LIBRARY_H earlier.
-
- * src/truetype/ttpic.h: Include FT_INTERNAL_PIC_H.
-
-2015-07-07 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Make `tt_face_get_name' member of the SFNT interface.
-
- * include/freetype/internal/sfnt.h (TT_Get_Name_Func): New
- prototype.
- (SFNT_Interface, FT_DEFINE_SFNT_INTERFACE): New member `get_name'.
-
- * src/sfnt/sfdriver.c (sfnt_interface): Updated.
-
- * src/sfnt/sfobjs.c (tt_face_get_name): Tag it with `LOCAL_DEF'.
- * src/sfnt/sfobjs.h: Add prototype for it.
-
-2015-06-30 Werner Lemberg <wl@gnu.org>
-
- Fix some clang compiler warnings.
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY), src/cff/cf2intrp.c
- (cf2_interpT2CharString), src/truetype/ttgload.c
- (load_truetype_glyph), src/truetype/ttgxvar.c (tt_handle_deltas),
- src/truetype/ttinterp.c (Ins_INSTCTRL): Fix signedness issues.
-
-2015-06-29 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Speed up bytecode interpreter.
-
- * src/truetype/ttinterp.c (Normalize): Use `FT_Vector_NormLen'.
-
-2015-06-29 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Speed up emboldening.
-
- * src/base/ftoutln.c (FT_Outline_EmboldenXY): Use
- `FT_Vector_NormLen'.
-
-2015-06-29 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Implement fast vector normalization.
-
- The function uses Newton's iterations instead of dividing vector
- components by its length, which needs a square root. This is,
- literally, a bit less accurate but a lot faster.
-
- * src/base/ftcalc.c (FT_Vector_NormLen): New function.
-
-2015-06-28 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt: Always create `ftconfig.h'.
-
- For non-UNIX builds, the file stays unmodified. However, it's
- better to have the main configuration files at the same place
- regardless of the OS.
-
-2015-06-28 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt: Improve MSVC support (#43737).
-
-2015-06-28 Werner Lemberg <wl@gnu.org>
-
- [cmake] Check for libraries and create `ftoption.h'.
-
- * builds/FindHarfBuzz.cmake: New file, taken from
-
- https://trac.webkit.org/browser/trunk/Source/cmake/FindHarfBuzz.cmake
-
- * CMakeLists.Txt: Add path to local cmake modules.
- Find dependencies for zlib, bzip2, libpng, and harfbuzz.
- Create `ftoption.h' file.
- Set up include and linker stuff for libraries.
-
-2015-06-28 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt: Fix creation of `ftconfig.h'.
- Check for UNIX header files using `check_include_file'.
- Set up correct header include directories.
-
-2015-06-28 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt: Disallow in-source builds.
-
-2015-06-27 Werner Lemberg <wl@gnu.org>
-
- * src/tools/docmaker/utils.py (check_output): Add missing `\n'.
-
-2015-06-26 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt: Select platform-dependent `ftdebug.c'.
-
-2015-06-25 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt: Use cmake functions for generating `ftconfig.h'.
- Additionally, do this for UNIX only.
-
-2015-06-25 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt (BASE_SRCS): Use `ftbase.c' and `psnames.c'.
-
-2015-06-25 Werner Lemberg <wl@gnu.org>
-
- Another adjustment to header locations.
-
- This change is a result of a discussion thread on freetype-devel
-
- https://lists.nongnu.org/archive/html/freetype-devel/2015-06/msg00041.html
-
- Re-introduce the `freetype2' subdirectory for all FreeType header
- files after installation, and rename the `freetype2' subdirectory in
- the git repository to `freetype'.
-
- * include/freetype2: Renamed to...
- * include/freetype: This.
-
- * CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS,
- PRIVATE_HEADERS): Updated.
- Update creation of `ftconfig.h'.
- Install generated `ftconfig.h'.
-
- * Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated.
-
- * builds/amiga/include/config/ftconfig.h, builds/freetype.mk
- (PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work),
- builds/unix/freetype2.in: Updated.
-
- * builds/unix/freetype-config.in: Updated.
- * builds/unix/configure.raw: Don't check for `rmdir'.
- * builds/unix/unix-def.in (DELDIR): Use `rm -rf', which is portable
- according to the autoconf info manual.
- * builds/unix/install.mk (install, uninstall,
- distclean_project_unix): Update and simplify.
-
- * builds/wince/*, builds/windows/*: Updated.
-
- * devel/ft2build.h, include/ft2build.h: Updated.
-
- * include/freetype2/config/ftheader.h,
- include/freetype2/internal/ftserv.h,
- include/freetype2/internal/internal.h: Update all header file
- macros.
-
- * src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated.
-
- * docs/*: Updated.
-
-2015-06-24 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/bdf/bdflib.c (_bdf_parse_start): Disallow 0 bpp.
-
-2015-06-24 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/bdf/bdflib.c (_bdf_parse_start): Simplify bpp parsing.
-
-2015-06-23 Werner Lemberg <wl@gnu.org>
-
- s/TYPEOF/FT_TYPEOF/ (#45376).
-
- * builds/unix/ftconfig.in, builds/vms/ftconfig.in,
- include/freetype2/config/ftconfig.h,
- include/freetype2/internal/ftobjs.h, src/autofit/afwarp.h: Do it.
-
-2015-06-22 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #45097.
-
- We no longer `pollute' the namespace of possible header file names;
- instead we move `ft2build.h' up by one level so that it gets
- installed in the default include directory (e.g.,
- /usr/local/include). After this commit, only `ft2build.h' stays in
- the compiler's include path.
-
- No visible changes for the user who follows the standard FreeType
- header inclusion rules.
-
- * include/*: Move to ...
- * include/freetype2/*: This directory, except `ft2build.h'.
-
- * CMakeLists.txt (PUBLIC_HEADERS, PUBLIC_CONFIG_HEADERS,
- PRIVATE_HEADERS), Jamfile (HDRMACRO, RefDoc), autogen.sh: Updated.
-
- * builds/amiga/include/config/ftconfig.h, builds/freetype.mk
- (PUBLIC_DIR), builds/symbian/bld.inf, builds/toplevel.mk (work),
- builds/unix/install.mk (install, uninstall),
- builds/unix/freetype2.in: Updated.
-
- * builds/unix/freetype-config.in: Updated.
- Emit -I directory only if it is not `/usr/include'.
-
- * builds/wince/*, builds/windows/*: Updated.
-
- * devel/ft2build.h, include/ft2build.h: Updated.
-
- * include/freetype2/config/ftheader.h,
- include/freetype2/internal/ftserv.h,
- include/freetype2/internal/internal.h: Update all header file
- macros.
-
- * src/tools/chktrcmp.py (TRACE_DEF_FILES): Updated.
-
-2015-06-21 Werner Lemberg <wl@gnu.org>
-
- Make Jam support work again.
-
- This is just very basic stuff and just a little bit tested on
- GNU/Linux only. I won't delve into this since I'm not a Jam user.
-
- * Jamfile: Call `HDRMACRO' for `ftserv.h' also.
- (DEFINES): Replace with...
- (CCFLAGS): ... this.
-
- * src/Jamfile: Don't call `HDRMACRO' for `internal.h'; this is
- already handled in the top-level Jamfile.
-
- * src/autofit/Jamfile (DEFINES): Replace with...
- (CCFLAGS): ... this.
- (_sources): Add missing files.
-
- * src/cache/Jamfile: Don't call `HDRMACRO' for `ftcache.h'; it no
- longer contains macro header definitions.
-
- * src/base/Jamfile, src/cff/Jamfile, src/sfnt/Jamfile,
- src/truetype/Jamfile (_sources): Add missing files.
-
-2015-06-16 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #45326.
-
- * src/sfnt/sfntpic.h (SFNT_SERVICES_GET): Remove duplicate
- definitions.
-
-2015-06-07 Werner Lemberg <wl@gnu.org>
-
- * Version 2.6 released.
- =======================
-
-
- Tag sources with `VER-2-6'.
-
- * docs/VERSION.DLL: Update documentation and bump version number to
- 2.6.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.5.5/2.6/, s/255/26/.
-
- * include/freetype/freetype.h (FREETYPE_MINOR): Set to 6.
- (FREETYPE_PATCH): Set to 0.
-
- * builds/unix/configure.raw (version_info): Set to 18:0:12.
- * CMakeLists.txt (VERSION_MINOR): Set to 6.
- (VERSION_PATCH): Set to 0.
-
- * src/autofit/afmodule.c [!FT_MAKE_OPTION_SINGLE_OBJECT]: Add
- declarations for dumping functions.
-
- * src/truetype/ttinterp.c (TT_New_Context): Pacify compiler.
-
- * builds/toplevel.mk: Use `freetype.mk's code to compute the version
- string.
- Don't include a zero patch level in version string.
- * builds/freetype.mk: Remove code for computing the version string.
-
-2015-06-06 Ashish Azad <ashish.azad@samsung.com>
-
- Fix Savannah bug #45260.
-
- * src/pfr/pfrdrivr.c (pfr_get_kerning): Fix typo.
-
-2015-06-03 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix memory leak.
-
- Problem reported by Grissiom <chaos.proton@gmail.com>; in
-
- https://lists.nongnu.org/archive/html/freetype/2015-05/msg00013.html
-
- there is an example code to trigger the bug.
-
- * src/truetype/ttobjs.c (tt_size_init_bytecode): Free old `size'
- data before allocating again. Bug most probably introduced four
- years ago in version 2.4.3.
-
-2015-06-02 Werner Lemberg <wl@gnu.org>
-
- [raster] Add more tracing.
-
- * src/raster/ftraster.c (FT_TRACE7) [_STANDALONE_]: Define.
- (Vertical_Sweep_Span, Vertical_Sweep_Drop, Horizontal_Sweep_Span,
- Horizontal_Sweep_Drop, Render_Glyph): Add tracing calls.
-
-2015-06-01 Werner Lemberg <wl@gnu.org>
-
- [truetype] While tracing opcodes, show code position and stack.
-
- * src/truetype/ttinterp.c: Change all existing TRACE7 calls to
- TRACE6.
- (opcode_name): Add string lengths.
- (TT_RunIns): Implement display of code position and stack.
-
-2015-05-31 Werner Lemberg <wl@gnu.org>
-
- [truetype] In GX, make private point numbers work correctly.
-
- This is completely missing in Apple's documentation: If a `gvar'
- tuple uses private point numbers (this is, deltas are specified for
- some points only), the uncovered points must be interpolated for
- this tuple similar to the IUP bytecode instruction. Examples that
- need this functionality are glyphs `Oslash' and `Q' in Skia.ttf.
-
- * src/truetype/ttgxvar.c (tt_delta_shift, tt_delta_interpolate,
- tt_handle_deltas): New functions.
- (TT_Vary_Get_Glyph_Deltas): Renamed to...
- (TT_Vary_Apply_Glyph_Deltas): ... this; it directly processes the
- points and does no longer return an array of deltas.
- Add tracing information.
- Call `tt_handle_deltas' to interpolate missing deltas.
- Also fix a minor memory leak in case of error.
-
- * src/truetype/ttgxvar.h: Updated.
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
- load_truetype_glyph): Updated.
-
-2015-05-31 Werner Lemberg <wl@gnu.org>
-
- [truetype] In GX, make intermediate tuplets work at extrema.
-
- * src/truetype/ttgxvar.c (ft_var_apply_tuple): Fix range condition.
-
-2015-05-31 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add tracing information to GX code.
-
- * src/truetype/ttgxvar.c (ft_var_load_avar, ft_var_load_gvar,
- ft_var_apply_tuple, TT_Get_MM_Var, TT_Set_MM_Blend,
- TT_Set_Var_Design, tt_face_vary_cvt): Do it.
-
-2015-05-28 Werner Lemberg <wl@gnu.org>
-
- * src/tools/apinames.c (names_dump): Fix invalid reference.
-
- Problem reported by Guzman Mosqueda, Jose R
- <jose.r.guzman.mosqueda@intel.com>.
-
-2015-05-24 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix commit from 2015-05-22.
-
- * src/truetype/ttgload.c, src/truetype/ttinterp.c: Guard new code
- with `TT_CONFIG_OPTION_SUBPIXEL_HINTING'.
-
- Problem reported by Nikolaus Waxweiler <madigens@gmail.com>.
-
-2015-05-23 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix return values of GETINFO bytecode instruction.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): New fields
- `vertical_lcd' and `gray_cleartype'.
-
- * src/truetype/ttgload.c (tt_loader_init): Initialize new fields.
- Change `symmetrical smoothing' to TRUE, since FreeType produces
- exactly this.
-
- * src/truetype/ttinterp.c (Ins_GETINFO): Fix selector/return bit
- values for symmetrical smoothing, namely 11/18.
- Handle bits for vertical LCD subpixels (8/15) and Gray ClearType
- (12/19).
-
-2015-05-23 Werner Lemberg <wl@gnu.org>
-
- [truetype] Minor.
-
- * src/truetype/ttinterp.h (TT_ExecContext):
- s/subpixel/subpixel_hinting.
-
- * src/truetype/ttgload.c, src/truetype/ttgload.h: Updated.
-
-2015-05-22 Werner Lemberg <wl@gnu.org>
-
- [truetype] Support selector index 3 of the INSTCTRL instruction.
-
- This flag activates `native ClearType hinting', disabling backward
- compatibility mode as described in Greg Hitchcocks whitepaper. In
- other words, it enables unrestricted functionality of all TrueType
- instructions in ClearType.
-
- * src/truetype/ttgload.c (tt_get_metrics): Call `sph_set_tweaks'
- unconditionally.
- (tt_loader_init): Unset `ignore_x_mode' flag if bit 2 of
- `GS.instruct_control' is active.
-
- * src/truetype/ttinterp.c (Ins_INSTCTRL): Handle selector index 3.
- (Ins_GETINFO): Updated.
-
- * docs/CHANGES: Document it.
-
-2015-05-20 Werner Lemberg <wl@gnu.org>
-
- [truetype] Minor.
-
- * src/truetype/ttinterp.h (SetSuperRound): Fix type of `GridPeriod'
- argument.
-
-2015-05-17 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix loading of composite glyphs.
-
- * src/truetype/ttgload.c (TT_Load_Composite_Glyph): If the
- ARGS_ARE_XY_VALUES flag is not set, handle argument values as
- unsigned. I trust `ttx' (which has exactly such code) that it does
- the right thing here...
-
- The reason that noone has ever noticed this bug is probably the fact
- that point-aligned subglyphs are rare, as are subglyphs with a
- number of points in the range [128;255], which is quite large (or
- even in the range [32768;65535], which is extremely unlikely).
-
-2015-05-12 Chris Liddell <chris.liddell@artifex.com>
-
- [cff] Make the `*curveto' operators more tolerant.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString): The opcodes
- `vvcurveto', `hhcurveto', `vhcurveto', and `hvcurveto' all iterate,
- pulling values off the stack until the stack is exhausted.
- Implicitly the stack must be a multiple (or for subtly different
- behaviour) a multiple plus a specific number of extra values deep.
- If that's not the case, enforce it (as the old code did).
-
-2015-05-12 Chris Liddell <chris.liddell@artifex.com>
-
- [cff] fix incremental interface with new cff code.
-
- * src/cff/cf2ft.c (cf2_getSeacComponent): When using the incremental
- interface to retrieve glyph data for a SEAC, it be left to the
- incremental interface callback to apply the encoding to raw
- character index (as it was in the previous code).
-
-2015-04-29 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [autofit] Speed up IUP.
-
- * src/autofit/afhints.c (af_iup_interp): Separate trivial snapping to
- the same position from true interpolation, use `scale' to reduce
- divisions.
-
-2015-04-28 Werner Lemberg <wl@gnu.org>
-
- [cff] Use `name' table for PS name if we have a SFNT-CFF.
-
- This follows the OpenType 1.7 specification. See
-
- https://tug.org/pipermail/tex-live/2015-April/036634.html
-
- for a discussion.
-
- * src/cff/cffdrivr.c (cff_get_ps_name): Use the `sfnt' service if we
- have an SFNT.
-
-2015-04-27 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [truetype] Speed up IUP.
-
- * src/truetype/ttinterp.c (_iup_worker_interpolate): Separate trivial
- snapping to the same position from true interpolation.
-
-2015-04-21 Werner Lemberg <wl@gnu.org>
-
- [autofit] By default, enable warping code but switch off warping.
-
- Suggested by Behdad.
-
- * include/config/ftoption.h: Define AF_CONFIG_OPTION_USE_WARPER.
-
- * src/autofit/afmodule.c (af_autofitter_init): Initialize `warping'
- with `false'.
-
-2015-04-21 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated.
-
-2015-04-21 Werner Lemberg <wl@gnu.org>
-
- [autofit] Introduce `warping' property.
-
- This code replaces the debugging hook from the previous commit with
- a better, more generic solution.
-
- * include/ftautoh.h: Document it.
-
- * src/autofit/afmodule.h (AF_ModuleRec)
- [AF_CONFIG_OPTION_USE_WARPER]: Add `warping' field.
-
- * src/autofit/afmodule.c (_af_debug_disable_warper): Remove.
- (af_property_set, af_property_get, af_autofitter_init)
- [AF_CONFIG_OPTION_USE_WARPER]: Handle `warping' option.
-
- * src/autofit/afhints.h (AF_HINTS_DO_WARP): Remove use of the no
- longer existing `_af_debug_disable_warper'.
-
- * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
- (af_latin_hints_init), src/autofit/aflatin2.c (af_latin2_hints_init)
- [AF_CONFIG_OPTION_USE_WARPER]: Add `AF_SCALER_FLAG_NO_WARPER' to the
- scaler flags if warping is off.
-
- * src/autofit/aftypes.h: Updated.
-
-2015-04-16 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add debugging hook to disable warper.
-
- * src/autofit/afmodule.c (_af_debug_disable_warper)
- [FT_DEBUG_AUTOFIT]: New global variable.
-
- * src/autofit/aftypes.h: Updated.
- (AF_SCALER_FLAG_NO_WARPER): New macro (not actively used yet).
-
- * src/autofit/afhints.h (AF_HINTS_DO_WARP): New macro.
-
- * src/autofit/aflatin.c (af_latin_hints_apply)
- [AF_CONFIG_OPTION_USE_WARPER]: Use `AF_HINTS_DO_WARP' to control use
- of warper.
-
- * src/autofit/afcjk.c (af_cjk_hints_init, af_cjk_hints_apply)
- [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'.
-
- * src/autofit/aflatin2.c (af_latin2_hints_apply)
- [AF_CONFIG_OPTION_USE_WARPER]: Synchronize with `aflatin.c'.
-
-2015-04-10 Werner Lemberg <wl@gnu.org>
-
- [cff] Update advance width handling to OpenType 1.7.
-
- Problem reported by Behdad.
-
- * src/cff/cffdrivr.c (cff_get_advances): Handle SFNT case
- separately.
-
- * src/cff/cffgload.c (cff_slot_load): Use advance width and side
- bearing values from `hmtx' table if present.
-
-2015-04-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Use do-while loop.
-
-2015-04-02 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/autofit/aflatin.c (af_latin_hint_edges): Reduce logic.
-
-2015-04-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [autofit] Finish the thought.
-
- * src/autofit/afhints.c (af_direction_compute): make sure the long arm
- is never negative so that its `FT_ABS' is not necessary.
-
-2015-04-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Call dumper functions for tracing.
-
- * src/autofit/afcjk.c (af_cjk_hints_apply): Remove dead code.
- * src/autofit/afhints.c (af_glyph_hints_dump_points): Minor
- improvement.
- * src/autofit/afmodule.c (af_autofitter_load_glyph): Implement it.
-
-2015-04-01 Werner Lemberg <wl@gnu.org>
-
- [autofit] Make debugging stuff work again.
-
- The interface to ftgrid was broken in the series of commits starting
- with
-
- [autofit] Allocate AF_Loader on the stack instead of AF_Module.
-
- from 2015-01-14.
-
- * src/autofit/afmodule.c (_af_debug_hints_rec) [FT_DEBUG_AUTOFIT]:
- Use a global AF_GlyphHintsRec object for debugging.
- (af_autofitter_done, af_autofitter_load_glyph): Updated.
-
- * src/autofit/afloader.c (af_loader_init, af_loader_done): Updated.
-
-2015-04-01 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afhints.c (af_glyph_hints_done): Fix minor thinko.
-
-2015-03-29 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix Savannah bug #44629.
-
- * src/cff/cf2font.h (CF2_MAX_SUBR), src/cff/cffgload.h
- (CFF_MAX_SUBRS_CALLS): Set to 16.
-
-2015-03-29 Werner Lemberg <wl@gnu.org>
-
- [type1, truetype] Make the MM API more flexible w.r.t. `num_coords'.
-
- This commit allows `num_coords' to be larger or smaller than the
- number of available axes while selecting a design instance, either
- ignoring excess data or using defaults if data is missing.
-
- * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design):
- Implement it.
-
- * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design,
- T1_Set_Var_Design): Ditto.
-
-2015-03-29 Werner Lemberg <wl@gnu.org>
-
- [type1] Minor.
-
- * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design): Use
- FT_THROW.
- (T1_Set_Var_Design): Use T1_MAX_MM_AXIS and FT_THROW.
-
-2015-03-27 Werner Lemberg <wl@gnu.org>
-
- [cff] Trace charstring nesting levels.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdCALLGSUBR,
- cf2_cmdCALLSUBR, cf2_cmdRETURN>: Implement it.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings)
- <cff_op_callsubr, cff_op_callgsubr, cff_op_return>: Ditto.
-
-2015-03-21 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Optimize `FT_Angle_Diff'.
-
- Under normal circumstances we are usually close to the desired range
- of angle values, so that the remainder is not really necessary.
-
- * src/base/fttrigon.c (FT_Angle_Diff): Use loops instead of remainder.
-
- * src/autofit/aftypes.h (AF_ANGLE_DIFF): Ditto in the unused macro.
-
-2015-03-21 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improve `gvar' handling.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Correctly handle
- single-element runs. Cf. glyph `Q' in Skia.ttf with weights larger
- than the default.
-
-2015-03-20 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/fttrigon.c (FT_Vector_Rotate): Minor refactoring.
-
-2015-03-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Fix Savannah bug #44412 (part 2).
-
- * src/base/fttrigon.c (FT_Sin, FT_Cos, FT_Tan): Call `FT_Vector_Unit'.
-
-2015-03-11 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Arabic script.
-
- Thanks to Titus Nemeth <tn@tntypography.eu> for guidance!
-
- * src/autofit/afblue.dat: Add blue zone data for Arabic.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Arabic standard characters.
-
- * src/autofit/afranges.c: Add Arabic data.
-
- * src/autofit/afstyles.h: Add Arabic data.
-
- * docs/CHANGES: Document it.
-
-2015-03-11 Werner Lemberg <wl@gnu.org>
-
- Rename `svxf86nm.h' to `svfntfmt.h'; update related symbols.
-
- * include/internal/ftserv.h (FT_SERVICE_XFREE86_NAME_H): Renamed
- to...
- (FT_SERVICE_FONT_FORMAT_H): This.
-
- * include/internal/services/svfntfmt.h (FT_XF86_FORMAT_*): Renamed
- to ...
- (FT_FONT_FORMAT_*): This.
-
- src/base/ftfntfmt.c, src/bdf/bdfdrivr.c, src/cff/cffdrivr.c,
- src/cid/cidriver.c, src/pcf/pcfdrivr.c, src/pfr/pfrdrivr.c,
- src/truetype/ttdriver.c, src/type1/t1driver.c,
- src/type42/t42drivr.c, src/winfonts/winfnt.c: Updated.
-
-2015-03-11 Werner Lemberg <wl@gnu.org>
-
- [base] Rename `FT_XFREE86_H' to `FT_FONT_FORMATS_H'.
-
- * include/config/ftheader.h: Implement it.
- * src/base/ftfntfmt.c, docs/CHANGES: Updated.
-
-2015-03-11 Werner Lemberg <wl@gnu.org>
-
- [base] Rename `FT_Get_X11_Font_Format' to `FT_Get_Font_Format'.
-
- * include/ftfntfmt.h, src/base/ftfntfmt.c: Implement it.
-
- * docs/CHANGES: Updated.
-
-2015-03-11 Werner Lemberg <wl@gnu.org>
-
- Fix automatic copyright updating.
-
- * src/tools/update-copyright: Make scanning of `no-copyright'
- actually work.
-
- * src/tools/no-copyright: Don't include README in general.
-
-2015-03-11 Werner Lemberg <wl@gnu.org>
-
- Rename `ftxf86.[ch]' to `ftfntfmt.[ch]'.
-
- CMakeLists.txt, builds/amiga/makefile, builds/amiga/makefile.os4,
- builds/amiga/smakefile, builds/mac/FreeType.m68k_cfm.make.txt,
- builds/mac/FreeType.m68k_far.make.txt,
- builds/mac/FreeType.ppc_carbon.make.txt,
- builds/mac/FreeType.ppc_classic.make.txt, builds/symbian/bld.inf,
- builds/symbian/freetype.mmp, builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/freetype.vcxproj.filters,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj, docs/INSTALL.ANY,
- include/config/ftheader.h, include/ftfntfmt.h, modules.cfg,
- src/base/ftfntfmt.c, vms_make.com: Updated.
-
-2015-03-10 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Fix Savannah bug #44412 (part 1).
-
- * src/base/ftstroke.c (ft_stroker_inside): Handle near U-turns.
-
-2015-03-10 Werner Lemberg <wl@gnu.org>
-
- [base] Rename `FT_Bitmap_New' to `FT_Bitmap_Init'.
-
- * include/ftbitmap.h, src/base/ftbitmap.c: Implement it.
- Update all callers.
-
- * docs/CHANGES: Updated.
-
-2015-03-06 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning.
-
- Found by Alexei.
-
-2015-03-05 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftstroke.c: Simplify.
-
-2015-03-04 Werner Lemberg <wl@gnu.org>
-
- [truetype] Some fixes and code refactoring in `ttgxvar.c'.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix return value
- of `point_cnt' if two bytes are read.
- Use a more vertical coding style.
- (ft_var_readpackeddeltas): Use FT_UInt for `delta_cnt' parameter.
- Use a more vertical coding style.
-
-2015-03-03 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix Savannah bug #44241.
-
- * src/autofit/aflatin.c (af_latin_metrics_init_blues): Reject glyphs
- with less than 3 points.
-
-2015-03-02 Werner Lemberg <wl@gnu.org>
-
- Simplify `TYPEOF' macro.
-
- No need for two arguments.
-
- * include/config/ftconfig.h, builds/unix/ftconfig.in,
- builds/vms/ftconfig.h (TYPEOF): Updated.
-
- * include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR),
- src/autofit/afwarp.h (AF_WARPER_FLOOR): Updated.
-
-2015-03-01 Werner Lemberg <wl@gnu.org>
-
- Various compiler warning fixes for `make multi'.
-
- * src/autofit/afcjk.c (af_cjk_hints_compute_blue_edges),
- src/autofit/aflatin.c (af_latin_hint_compute_blue_edges,
- af_latin_hint_edges), src/autofit/aflatin2.c
- (af_latin2_hints_compute_blue_edges, af_latin2_hint_edges): Declare
- as `static'.
-
- * src/cache/ftccmap.c (FTC_CMAP_QUERY_HASH, FTC_CMAP_NODE_HASH):
- Removed. Unused.
- * src/cache/ftcimage.c: Include FT_INTERNAL_OBJECTS_H.
- * src/cache/ftcmanag.c (FTC_LRU_GET_MANAGER): Removed. Unused.
-
- * src/cff/cf2intrp.c: Include `cf2intrp.h'.
- * src/cff/cffdrivr.c (PAIR_TAG): Removed. Unused.
-
- * src/gzip/ftgzip.c (NO_DUMMY_DECL): Removed. Unused.
-
- * src/psaux/afmparse.c (afm_parser_read_int): Declare as `static'.
-
- * src/pshinter/pshalgo.c (STRONGER, PSH_ZONE_MIN, PSH_ZONE_MAX):
- Removed. Unused.
-
- * src/raster/ftraster.c (Render_Glyph): Declare as `static'.
-
- * src/sfnt/ttpost.c (load_format_20): Fix signedness warning.
-
- * src/truetype/ttdriver.c (PAIR_TAG): Removed. Unused.
- * src/truetype/ttsubpix.c (is_member_of_family_class,
- is_member_of_style_class): Declare as `static'.
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Declare
- as `static'.
- * src/type1/t1load.c (mm_axis_unmap, mm_weights_unmap): Declare as
- `static'.
- (T1_FIELD_COUNT): Removed. Unused.
- * src/type1/t1parse.h (T1_Done_Table): Removed. Unused.
-
- * src/type42/t42parse.c (T1_Done_Table): Removed. Unused.
-
-2015-02-25 Werner Lemberg <wl@gnu.org>
-
- [psaux] Signedness fixes.
-
- * include/internal/psaux.h, src/psaux/afmparse.c,
- src/psaux/afmparse.h, src/psaux/psconv.c, src/psaux/psobjs.c,
- src/psaux/t1cmap.c, src/psaux/t1decode.c: Apply.
-
-2015-02-25 Werner Lemberg <wl@gnu.org>
-
- [otvalid] Signedness fixes.
-
- * src/otvalid/otvcommn.c, src/otvalid/otvgdef.c,
- src/otvalid/otvgpos.c, src/otvalid/otvgsub.c, src/otvalid/otvmath.c:
- Apply.
-
-2015-02-25 Werner Lemberg <wl@gnu.org>
-
- * src/bzip2/ftbzip2.c (ft_bzip2_alloc): Signedness fix.
-
-2015-02-25 Werner Lemberg <wl@gnu.org>
-
- [lzw] Signedness fixes.
-
- * src/lzw/ftzopen.c, src/lzw/ftzopen.h: Apply.
-
-2015-02-25 Werner Lemberg <wl@gnu.org>
-
- [gxvalid] Signedness fixes.
-
- * src/gxvalid/gxvbsln.c, src/gxvalid/gxvcommn.c,
- src/gxvalid/gxvcommn.h, src/gxvalid/gxvjust.c,
- src/gxvalid/gxvkern.c, src/gxvalid/gxvlcar.c, src/gxvalid/gxvmort.c,
- src/gxvalid/gxvmort1.c, src/gxvalid/gxvmort2.c,
- src/gxvalid/gxvmorx.c, src/gxvalid/gxvmorx1.c,
- src/gxvalid/gxvmorx2.c, src/gxvalid/gxvopbd.c,
- src/gxvalid/gxvprop.c, src/gxvalid/gxvtrak.c: Apply.
-
-2015-02-25 Werner Lemberg <wl@gnu.org>
-
- [cache] Signedness fixes.
-
- * src/cache/ftcbasic.c, src/cache/ftccmap.c, src/cache/ftcimage.c,
- src/cache/ftcmanag.c, src/cache/ftcsbits.c: Apply.
-
-2015-02-25 Werner Lemberg <wl@gnu.org>
-
- Change dimension fields in `FTC_ImageTypeRec' to unsigned type.
-
- This doesn't break ABI.
-
- * include/ftcache.h (FTC_ImageTypeRec): Use unsigned types for
- `width' and `height'.
-
- * docs/CHANGES: Document it.
-
-2015-02-25 Werner Lemberg <wl@gnu.org>
-
- [cache] Don't use `labs'.
-
- This is the only place in FreeType where this function was used.
-
- * include/config/ftstdlib.h (ft_labs): Remove.
-
- * src/cache/ftcimage.c (ftc_inode_weight): Replace `ft_labs' with
- `FT_ABS'.
-
-2015-02-23 Werner Lemberg <wl@gnu.org>
-
- [cache] Replace `FT_PtrDist' with `FT_Offset'.
-
- * src/cache/ftccache.h (FTC_NodeRec): `FT_Offset' (a.k.a. `size_t')
- is a better choice for `hash' to hold a pointer than `FT_PtrDist'
- (a.k.a. `ptrdiff_t'), especially since the latter is signed,
- causing zillions of signedness warnings. [Note that `hash' was of
- type `FT_UInt32' before the change to `FT_PtrDist'.]
- Update all users.
-
- * src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccmap.c,
- src/cache/ftcglyph.c, src/cache/ftcglyph.h: Updated.
-
-2015-02-23 Werner Lemberg <wl@gnu.org>
-
- [smooth, raster] Re-enable standalone compilation.
-
- * src/raster/ftraster.c (FT_RENDER_POOL_SIZE, FT_MAX)
- [_STANDALONE_]: Define macros.
-
- * src/smooth/ftgrays.c (FT_RENDER_POOL_SIZE, FT_MAX, FT_ABS,
- FT_HYPOT) [_STANDALONE_]: Define macros.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- [smooth] Signedness fixes.
-
- * src/smooth/ftgrays.c, src/smooth/ftsmooth.c: Apply.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- * src/raster/ftraster.c: Use the file's typedefs everywhere.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttpost.c (load_format_20): Fix error tracing message.
-
- Bug introduced 6 commits earlier.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- [pshinter] Fix thinko.
-
- * src/pshinter/pshalgo.c (psh_glyph_find_strong_points): Correctly
- check `count'.
- Bug introduced two commits earlier.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- [raster] Signedness fixes.
-
- * src/raster/ftraster.c, src/raster/ftrend1.c: Apply.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- [pshinter] Signedness fixes.
-
- * src/pshinter/pshalgo.c, src/pshinter/pshglob.c,
- src/pshinter/pshrec.c: Apply.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- [pshinter] Use macros for (unsigned) flags, not enumerations.
-
- * src/pshinter/pshalgo.h (PSH_Hint_Flags): Replace with macros.
- Updated.
- * src/pshinter/pshrec.h (PS_Hint_Flags): Replace with macros.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- * src/pshinter/pshrec.c: Simplify.
- (ps_hints_open, ps_hints_stem): Remove switch statement.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Signedness fixes.
-
- * src/sfnt/pngshim.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap.c,
- src/sfnt/ttkern.c, src/sfnt/ttload.c, src/sfnt/ttpost.c,
- src/sfnt/ttsbit.c: Apply.
- * src/sfnt/sfdriver.c: Apply.
- (sfnt_get_ps_name): Simplify.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- [bdf] Signedness fixes.
-
- * src/bdf/bdf.h, src/bdf/bdfdrivr.c, src/bdf/bdfdrivr.h,
- src/bdf/bdflib.c: Apply.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- * src/bdf/bdflib.c (_bdf_atous): New function.
- (_bdf_parse_glyphs, _bdf_parse_start): Use it.
-
-2015-02-22 Werner Lemberg <wl@gnu.org>
-
- [pcf] Signedness fixes.
-
- * src/pcf/pcf.h, src/pcf/pcfdrivr.c: Apply.
- * src/pcf/pcfread.c: Apply.
- (pcf_get_encodings): Ignore invalid negative encoding offsets.
-
-2015-02-21 Werner Lemberg <wl@gnu.org>
-
- * src/winfonts/winfnt.c: Signedness fixes.
-
-2015-02-21 Werner Lemberg <wl@gnu.org>
-
- [type42] Signedness fixes.
-
- * src/type42/t42parse.c, src/type42/t42parse.h,
- src/type42/t42types.h: Apply.
-
-2015-02-21 Werner Lemberg <wl@gnu.org>
-
- [pfr] Signedness fixes.
-
- * src/pfr/pfrdrivr.c, src/pfr/pfrgload.c, src/pfr/pfrload.c,
- src/pfr/pfrload.h, src/pfr/pfrobjs.c, src/pfr/pfrsbit.c,
- src/pfr/pfrtypes.h: Apply.
-
-2015-02-21 Werner Lemberg <wl@gnu.org>
-
- [cff] Minor signedness fixes related to last commit.
-
- * src/cff/cf2ft.c, src/cff/cf2intrp.c, src/cff/cffgload.c: Apply.
-
-2015-02-20 Werner Lemberg <wl@gnu.org>
-
- [cff] Thinkos in bias handling.
-
- Only the final result is always positive.
-
- Bug introduced three commits earlier.
-
- * src/cff/cffgload.c, src/cff/cffgload.h: Apply.
-
-2015-02-20 Werner Lemberg <wl@gnu.org>
-
- [cid] Fix signedness issues and emit some better error codes.
-
- * src/cid/cidgload.c, src/cid/cidload.h, src/cid/cidobjs.c,
- src/cid/cidparse.h: Apply.
- * src/cid/cidload.c: Apply.
- (parse_fd_array): Reject negative values for number of dictionaries.
- * src/cid/cidparse.c: Apply.
- (cid_parser_new): Reject negative values for hex data length.
-
-2015-02-20 Werner Lemberg <wl@gnu.org>
-
- [cff] Signedness fixes for new engine.
-
- * src/cff/cf2arrst.c, src/cff/cf2fixed.h, src/cff/cf2ft.c,
- src/cff/cf2ft.h, src/cff/cf2hints.c, src/cff/cf2intrp.c: Apply.
-
-2015-02-20 Werner Lemberg <wl@gnu.org>
-
- [cff] Signedness fixes for basic infrastructure and old engine.
-
- * include/internal/pshints.h, src/cff/cffdrivr.c,
- src/cff/cffgload.c, src/cff/cffgload.h, src/cff/cffload.c,
- src/cff/cffobjs.c, src/cff/cffparse.c, src/pshinter/pshrec.c: Apply.
-
-2015-02-19 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Ignore `countSizePairs'.
-
- This is hard-coded to value 2 in `fvar' version 1.0 (and no newer
- version exists), but some fonts set it incorrectly.
-
- Problem reported by Adam Twardoch <adam@fontlab.com>.
-
-2015-02-19 Werner Lemberg <wl@gnu.org>
-
- [cff] Emit better error code for invalid private dict size.
-
- * src/cff/cffparse.c (cff_parse_private_dict): Reject negative
- values for size and offset.
-
-2015-02-19 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix signedness issues.
-
- * src/autofit/afangles.c, src/autofit/afcjk.c,
- src/autofit/afglobal.c, src/autofit/afhints.c,
- src/autofit/aflatin.c, src/autofit/aflatin2.c, src/autofit/afwarp.c,
- src/autofit/hbshim.c: Apply.
-
-2015-02-19 Werner Lemberg <wl@gnu.org>
-
- [autofit] Use macros for (unsigned) flags, not enumerations.
-
- This harmonizes with other code in FreeType (and reduces the number
- of necessary casts to avoid compiler warnings).
-
- * src/autofit/afblue.hin: Make flag macros unsigned.
- * src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afcjk.h: Replace flag enumeration with macros.
- * src/autofit/afcjk.c: Updated.
-
- * src/autofit/afhints.h (AF_Flags, AF_Edge_Flags): Replace with
- macros.
- * src/autofit/afhints.c: Updated.
-
- * src/autofit/aflatin.h: Replace flag enumerations with macros.
- * src/autofit/aflatin.c, src/autofit/aflatin2.c: Updated.
-
- * src/autofit/aftypes.h (AF_ScalerFlags): Replace with macros.
-
-2015-02-18 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix signedness issues.
-
- * include/internal/psaux.h, include/internal/t1types.h,
- src/psaux/psobjs.c, src/psaux/psobjs.h, src/psaux/t1decode.c,
- src/type1/t1gload.c, src/type1/t1load.c, src/type1/t1parse.c: Apply.
-
-2015-02-18 Werner Lemberg <wl@gnu.org>
-
- [psaux, type1] Fix minor AFM issues.
-
- * include/internal/t1types.h (AFM_KernPairRec): Make indices
- unsigned.
- Update users.
- (AFM_FontInfoRec): Make element counters unsigned.
- Update users.
- * src/psaux/afmparse.h (AFM_ValueRec): Add union member for unsigned
- int.
-
- * src/psaux/afmparse.c (afm_parse_track_kern, afm_parse_kern_pairs):
- Reject negative values for number of kerning elements.
-
- * src/type1/t1afm.c, src/tools/test_afm.c: Updated.
-
-2015-02-18 Werner Lemberg <wl@gnu.org>
-
- Don't use `FT_PtrDist' for lengths.
-
- Use FT_UInt instead.
-
- * include/internal/psaux.h (PS_Table_FuncsRec, PS_TableRec,
- T1_DecoderRec): Do it.
-
- * include/internal/t1types.h (T1_FontRec): Ditto.
-
- * src/cid/cidload.c (cid_parse_dict): Updated.
- * src/pfr/pfrload.c (pfr_extra_item_load_font_id): Ditto.
- * src/psaux/psobjs.c (ps_table_add), src/psaux/psobjs.h: Ditto.
- * src/type1/t1load.c (parse_blend_axis_types, parse_encoding,
- parse_charstrings, parse_dict): Ditto.
- * src/type42/t42parse.c (t42_parse_encoding, t42_parse_charstrings,
- t42_parse_dict): Ditto.
-
-2015-02-18 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1driver.c (t1_ps_get_font_value): Clean up.
- This handles negative values better, avoiding many casts.
-
-2015-02-17 Werner Lemberg <wl@gnu.org>
-
- [base] Fix Savannah bug #44284.
-
- * src/base/ftcalc.c (FT_MulFix): Typos.
-
-2015-02-17 Werner Lemberg <wl@gnu.org>
-
- [truetype] Finish compiler warning fixes for signedness issues.
-
- * src/truetype/ttgxvar.c, src/truetype/ttsubpix.c,
- src/truetype/ttsubpix.h: Apply.
-
-2015-02-17 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttsubpix.c: Adding missing `static' keywords.
-
-2015-02-17 Werner Lemberg <wl@gnu.org>
-
- [truetype] More signedness fixes.
-
- * include/internal/tttypes.h, src/truetype/ttinterp.h,
- src/truetype/ttobjs.h, src/truetype/ttinterp.c,
- src/truetype/ttobjs.c: Apply.
-
-2015-02-17 Werner Lemberg <wl@gnu.org>
-
- [truetype] Various signedness fixes.
-
- * include/internal/ftgloadr.h, src/truetype/ttpload.c: Apply.
-
- * src/truetype/ttgload.c: Apply.
- (TT_Get_VMetrics): Protect against invalid ascenders and descenders
- while constructing advance height.
-
-2015-02-16 Werner Lemberg <wl@gnu.org>
-
- [base] Finish compiler warning fixes for signedness issues.
-
- * src/base/ftglyph.c, src/base/ftlcdfil.c, src/base/ftstroke.c:
- Apply.
-
-2015-02-16 Werner Lemberg <wl@gnu.org>
-
- * include/tttables.h (TT_OS2): `fsType' must be FT_UShort.
-
-2015-02-16 Werner Lemberg <wl@gnu.org>
-
- More minor signedness warning fixes.
-
- * src/base/ftbbox.c, src/base/ftbitmap.c, src/base/fttrigon.c,
- src/base/ftutil.c: Apply.
-
-2015-02-16 Werner Lemberg <wl@gnu.org>
-
- Next round of minor compiler warning fixes.
-
- * include/internal/ftrfork.h (FT_RFork_Ref): Change `offset' member
- type to `FT_Long'.
- (CONST_FT_RFORK_RULE_ARRAY_BEGIN): Add `static' keyword.
-
- * include/internal/ftstream.h (FT_Stream_Pos): Return `FT_ULong'.
-
- * src/base/ftoutln.c, src/base/ftrfork.c, src/base/ftstream.c:
- Signedness fixes.
-
-2015-02-16 Werner Lemberg <wl@gnu.org>
-
- Various minor signedness fixes.
-
- * include/ftadvanc.h, include/internal/ftobjs.h,
- src/base/ftgloadr.c, src/base/ftobjs.c: Apply.
-
-2015-02-16 Werner Lemberg <wl@gnu.org>
-
- New `TYPEOF' macro.
-
- This helps suppress signedness warnings, avoiding issues with
- implicit conversion changes.
-
- * include/config/ftconfig.h, builds/unix/ftconfig.in,
- builds/vms/ftconfig.h (TYPEOF): Define.
-
- * include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR),
- src/autofit/afwarp.h (AF_WARPER_FLOOR): Use it.
-
-2015-02-16 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftsystem.c: Use casts in standard C function wrappers.
- (ft_alloc, ft_realloc, ft_ansi_stream_io, FT_Stream_Open): Do it.
-
-2015-02-16 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #44261.
-
- * builds/unix/detect.mk (setup) [unix]: Set `CONFIG_SHELL' in the
- environment also while calling the configure script.
-
-2015-02-16 Werner Lemberg <wl@gnu.org>
-
- * include/internal/ftmemory.h: Add some `FT_Offset' casts.
- (FT_MEM_SET, FT_MEM_COPY, FT_MEM_MOVE, FT_ARRAY_ZERO, FT_ARRAY_COPY,
- FT_MEM_MOVE): Do it.
-
-2015-02-15 Werner Lemberg <wl@gnu.org>
-
- [base] Clean up signedness issues in `ftdbgmem.c'.
-
- Also fix other minor issues.
-
- * src/base/ftdbgmem.c (FT_MemTableRec): Replace all FT_ULong types
- with FT_Long for consistency.
- (ft_mem_primes): Change type to `FT_Int'.
- (ft_mem_closest_prime, ft_mem_table_set): Updated.
-
- (ft_mem_debug_panic, ft_mem_debug_alloc, ft_mem_debug_free,
- ft_mem_debug_realloc): Use `static' keyword and fix signedness
- warnings where necessary.
-
- (ft_mem_table_resize, ft_mem_table_new, ft_mem_table_destroy,
- ft_mem_table_get_nodep, ft_mem_debug_init, FT_DumpMemory): Fix types
- and add or remove casts to avoid signedness warnings.
-
-2015-02-15 Werner Lemberg <wl@gnu.org>
-
- [base] Clean up signedness in arithmetic functions.
-
- This makes the code more readable and reduces compiler warnings.
-
- * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round, FT_MulFix,
- FT_DivFix): Convert input parameters to unsigned, do the
- computation, then convert the result back to signed.
- (ft_corner_orientation): Fix casts.
-
-2015-02-07 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Savannah bug #44184.
-
- * src/sfnt/ttload.c (check_table_dir, tt_face_load_font_dir): No
- longer reject `htmx' and `vmtx' tables with invalid length but
- sanitize them.
-
-2015-02-06 Jon Anderson <jon@websupergoo.com>
-
- [truetype] Fix regression in the incremental glyph loader.
-
- * src/truetype/ttgload.c (load_truetype_glyph): For incremental
- fonts, the glyph index may be greater than the number of glyphs
- indicated, so guard the check with a preprocessor conditional.
-
-2015-02-06 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix potential memory leak.
-
- While this doesn't show up with FreeType, exactly the same code
- leaks with ttfautohint's modified auto-hinter code (which gets used
- in a slightly different way).
-
- It certainly doesn't harm since it is similar to already existing
- checks in the code for embedded arrays.
-
- * src/autofit/afhints.c (af_glyph_hints_reload): Set `max_contours'
- and `max_points' for all cases.
-
-2015-01-31 Werner Lemberg <wl@gnu.org>
-
- [autofit] Add support for Thai script.
-
- Thanks to Ben Mitchell <ben@rosettatype.com> for guidance with blue
- zone characters!
-
- * src/autofit/afblue.dat: Add blue zone data for Thai.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Thai standard characters.
-
- * src/autofit/afranges.c: Add Thai data.
-
- * src/autofit/afstyles.h: Add Thai data.
-
-2015-01-23 Behdad Esfahbod <behdad@behdad.org>
-
- [raster] Handle `FT_RASTER_FLAG_AA' correctly.
-
- This fixes a breakage caused by the commit `[raster] Remove
- 5-level gray AA mode from monochrome rasterizer.'.
-
- Problem reported by Markus Trippelsdorf <markus@trippelsdorf.de>.
-
- * src/raster/ftraster.c (ft_black_render): Handle
- `FT_RASTER_FLAG_AA'.
-
- * src/raster/ftrend1.c (ft_raster1_render): Remove gray AA mode
- remnants.
-
-2015-01-18 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_New_Library): Fix compiler warning.
-
-2015-01-18 Chris Liddell <chris.liddell@artifex.com>
-
- [raster] Fix Savannah bug #44022.
-
- Add fallback for glyphs with degenerate bounding boxes.
-
- If a glyph has only one very narrow feature, the bbox can end up
- with either the width or height of the bbox being 0, in which case
- no raster memory is allocated and no attempt is made to render the
- glyph. This is less than ideal when the drop-out compensation in
- the rendering code would actually result in the glyph being
- rendered.
-
- This problem can be observed with the `I' glyph (gid 47) in the
- Autodesk RomanS TrueType font.
-
- * src/raster/ftrend1.c (ft_raster1_render): Add a fallback if either
- dimension is zero to explicitly round up/down (instead of simply
- round).
-
-2015-01-17 Werner Lemberg <wl@gnu.org>
-
- Add some tools to handle yearly copyright notice updates.
-
- We are now following the GNU guidelines: A new release automatically
- means that the copyright year of all affected files gets updated; it
- is no longer used to track years of modification changes.
-
- * src/tools/update-copyright-year: New Perl script.
- * src/tools/update-copyright: New shell script that calls
- `update-copyright-year' on all files.
- * src/tools/no-copyright: Exceptions that should not be handled by
- `update-copyright'
-
-2015-01-14 Werner Lemberg <wl@gnu.org>
-
- * docs/CHANGES: Updated, using a description from Behdad.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- * src/autofit/afmodule.c (af_autofitter_done): Fix compiler warning.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [autofit] Add embedded array of segments and edges.
-
- Avoids multiple mallocs per typical glyphs.
-
- With this and recent changes to avoid mallocs, the thread-safe
- stack-based loader is now as fast as the previous model that had one
- cached singleton.
-
- * src/autofit/afhints.h (AF_SEGMENTS_EMBEDDED, AF_EDGES_EMBEDDED):
- New macros.
- (AF_AxisHintsRec): Add two arrays for segments and edges.
-
- * src/autofit/afhints.c (af_axis_hints_new_segment): Only allocate
- data if number of segments exceeds given threshold value.
- (af_axis_hints_new_edge): Only allocate data if number of edges
- exceeds given threshold value.
- (af_glyph_hints_done): Updated.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [autofit] Add embedded arrays for points and contours.
-
- This avoids at least two malloc calls for typical glyphs.
-
- * src/autofit/afhints.h (AF_POINTS_EMBEDDED, AF_CONTOURS_EMBEDDED):
- New macros.
- (AF_GlyphHintsRec): Add two arrays for contours and points.
-
- * src/autofit/afhints.c (af_glyph_hints_init, af_glyph_hints_done):
- Updated.
- (af_glyph_hints_reload): Only allocate data if number of contours or
- points exceeds given threshold values.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [autofit] Allocate hints object on the stack.
-
- This avoids one malloc per load.
-
- * src/autofit/afloader.h (AF_LoaderRec): Change type of `hints' to
- `AF_GlyphHints'.
- Update prototype.
-
- * src/autofit/afloader.c (af_loader_init): Use `AF_GlyphHints'
- parameter instead of `FT_Memory'.
- (af_loader_done): Directly reset `load_hints'.
- (af_loader_load_g): Updated.
-
- * src/autofit/afmodule.c (af_autofitter_load_glyph): Use local
- `hints' object.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [autofit] Reuse slot glyph loader.
-
- No need to create a new glyph loader; we can reuse the one from
- `slot->internal->loader'. It's hard to tell why it was written that
- way originally, but new code looks sound and correct to me, and
- avoids lots of allocations.
-
- * src/autofit/afloader.c (af_loader_init): Change return type to
- `void'.
- Don't call `FT_GlyphLoader_New'.
- (af_loader_reset): Don't call `FT_GlyphLoader_Rewind'.
- (af_loader_load_g): Update code to use `internal->loader', which
- doesn't need copying of data.
-
- * src/autofit/afloader.h (AF_LoaderRec): Remove `gloader' member.
- Update prototype.
-
- * src/autofit/afmodule.c (af_autofitter_load_glyph): Updated.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [autofit] Remove (unused) support for composite glyphs.
-
- We never have to deal with composite glyphs in the autohinter, as
- those will be loaded into FORMAT_OUTLINE by the recursed
- `FT_Load_Glyph' function.
-
- In the rare cases that FT_LOAD_NO_RECURSE is set, it will imply
- FT_LOAD_NO_SCALE as per `FT_Load_Glyph', which then implies
- FT_LOAD_NO_HINTING:
-
- /* resolve load flags dependencies */
-
- if ( load_flags & FT_LOAD_NO_RECURSE )
- load_flags |= FT_LOAD_NO_SCALE |
- FT_LOAD_IGNORE_TRANSFORM;
-
- if ( load_flags & FT_LOAD_NO_SCALE )
- {
- load_flags |= FT_LOAD_NO_HINTING |
- FT_LOAD_NO_BITMAP;
-
- load_flags &= ~FT_LOAD_RENDER;
- }
-
- and as such the auto-hinter is never called. Thus, the recursion in
- `af_loader_load_g' never actually happens. So remove the depth
- counter as well.
-
- * src/autofit/afloader.c (af_loader_load_g): Remove `depth'
- parameter.
- <FT_GLYPH_FORMAT_COMPOSITE>: Remove associated code.
- (af_loader_load_glyph): Updated.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [raster] Fix uninitialized memory access.
-
- Apparently `ras.cProfile' might be uninitialized. This will be the
- case if `ras.top == ras.cProfile->offset', as can be seen in
- `End_Profile'. The overshoot code introduced in a change `Fix B/W
- rasterization of subglyphs with different drop-out modes.' (from
- 2009-06-18) violated this, accessing `ras.cProfile->flags'
- unconditionally just before calling `End_Profile' (which then
- detected that `cProfile' is uninitialized and didn't touch it).
-
- This was harmless, and was not detected by valgrind before because
- the objects were allocated on the `raster_pool', which was always
- initialized. With recent change to allocate raster buffers on the
- stack, valgrind now reported this invalid access.
-
- * src/raster/ftraster.c (Convert_Glyph): Don't access an
- uninitialized `cProfile'.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [smooth] Fix uninitialized memory access.
-
- Looks like `ras.span_y' could always be used without initialization.
- This was never detected by valgrind before because the library-wide
- `raster_pool' was used for the worker object and `raster_pool' was
- originally zero'ed. But subsequent reuses of it were using `span_y'
- uninitialized. With the recent change to not use `render_pool' and
- allocate worker and buffer on the stack, valgrind now detects this
- uninitialized access.
-
- * src/smooth/ftgrays.c (gray_raster_render): Initialize
- `ras.span_y'.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [base] Don't initialize unused `driver->glyph_loader'.
-
- * src/base/ftobjs.c (Destroy_Driver): Don't call
- `FT_GlyphLoader_Done'.
- (FT_Add_Module): Don't call `FT_GlyphLoader_New'.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [base] Don't allocate `library->raster_pool' anymore.
-
- It's unused after the following commits:
-
- [raster] Allocate render pool for mono rasterizer on the stack.
- [raster] Remove 5-level gray AA mode from monochrome rasterizer.
-
- The value of FT_RENDER_POOL_SIZE still serves the purpose it used to
- serve, which is, to adjust the pool size. But the pool is now
- allocated on the stack on demand.
-
- * src/base/ftobjs.c (FT_New_Library, FT_Done_Library): Implement.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [base] Do not reorder library->renderers upon use.
-
- Instead of keeping `library->renderers' in a MRU order, just leave
- it as-is. The MRU machinery wasn't thread-safe.
-
- With this patch, rasterizing glyphs from different faces from
- different threads doesn't fail choosing rasterizer
- (FT_Err_Cannot_Render_Glyph).
-
- Easiest to see that crash was to add a `printf' (or otherwise let
- thread yield in FT_Throw with debugging enabled).
-
- * src/base/ftobjs.c (FT_Render_Glyph_Internal), src/base/ftoutln.c
- (FT_Outline_Render): Don't call `FT_Set_Renderer'.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [raster] Allocate render pool for mono rasterizer on the stack.
-
- Instead of using the `render_pool' member of `FT_Library' that is
- provided down to the rasterizer, completely ignore that and allocate
- needed objects on the stack instead.
-
- With this patch, rasterizing glyphs from different faces from
- different threads doesn't crash in the monochrome rasterizer.
-
- * src/raster/ftraster.c (black_TRaster): Remove `buffer',
- `buffer_size', and `worker' members.
-
- (ft_black_render): Create `buffer' locally.
- (ft_black_reset): Updated.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [raster] Remove 5-level gray AA mode from monochrome rasterizer.
-
- It was off by default and couldn't be turned on at runtime. And the
- smooth rasterizer superseded it over ten years ago. No point in
- keeping. Comments suggested that it was there for compatibility
- with FreeType 1.
-
- 550 lines down.
-
- * src/raster/ftraster.c (FT_RASTER_OPTION_ANTI_ALIASING,
- RASTER_GRAY_LINES): Remove macros and all associated code.
-
- (black_TWorker): Remove `gray_min_x' and `gray_max_x'.
- (black_TRaster): Remove `grays' and `gray_width'.
-
- (Vertical_Sweep_Init, Vertical_Sweep_Span, Vertical_Sweep_Drop,
- ft_black_render): Updated.
-
- * src/raster/ftrend1.c (ft_raster1_render): Simplify code.
- (ft_raster5_renderer_class): Removed.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [smooth] Allocate render pool for smooth rasterizer on the stack.
-
- Instead of using the `render_pool' member of `FT_Library' that is
- provided down to the rasterizer, completely ignore that and allocate
- needed objects on the stack instead.
-
- With this patch, rasterizing glyphs from different faces from
- different threads doesn't crash in the smooth rasterizer.
-
- Bugs:
-
- https://bugzilla.redhat.com/show_bug.cgi?id=678397
- https://bugzilla.redhat.com/show_bug.cgi?id=1004315
- https://bugzilla.redhat.com/show_bug.cgi?id=1165471
- https://bugs.freedesktop.org/show_bug.cgi?id=69034
-
- * src/smooth/ftgrays.c (gray_TRaster): Remove `buffer',
- `buffer_size', `band_size', and `worker' members.
-
- (gray_raster_render): Create `buffer', `buffer_size', and
- `band_size' locally.
- (gray_raster_reset): Updated.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] Allocate TT_ExecContext in TT_Size instead of TT_Driver.
-
- Previously the code had stipulation for using a per-TT_Size exec
- context if `size->debug' was true. But there was no way that
- `size->debug' could *ever* be true. As such, the code was always
- using the singleton `TT_ExecContext' that was stored in `TT_Driver'.
- This was, clearly, not threadsafe.
-
- With this patch, loading glyphs from different faces from different
- threads doesn't crash in the bytecode loader code.
-
- * src/truetype/ttobjs.h (TT_SizeRec): Remove `debug' member.
- (TT_DriverRec): Remove `context' member.
-
- * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Remove
- `TT_ExecContext' code related to a global `TT_Driver' object.
-
- (tt_driver_done): Don't remove `TT_ExecContext' object here but ...
- (tt_size_done_bytecode): ... here.
-
- (tt_driver_init): Don't create `TT_ExecContext' object here but ...
- (tt_size_init_bytecode): ... here, only on demand.
-
- * src/truetype/ttinterp.c (TT_Run_Context): Remove defunct debug
- code.
- (TT_New_Context): Remove `TT_ExecContext' code related to a global
- `TT_Driver' object.
-
- * src/truetype/ttinterp.h: Updated.
-
- * src/truetype/ttgload.c (TT_Hint_Glyph, tt_loader_init): Updated.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- [autofit] Allocate AF_Loader on the stack instead of AF_Module.
-
- Stop sharing a global `AF_Loader'. Allocate one on the stack during
- glyph load.
-
- Right now this results in about 25% slowdown, to be fixed in a
- following commit.
-
- With this patch loading glyphs from different faces from different
- threads doesn't immediately crash in the autohinting loader code.
-
- Bugs:
-
- https://bugzilla.redhat.com/show_bug.cgi?id=1164941
-
- * src/autofit/afloader.c (af_loader_init): Pass
- `AF_Loader' and `FT_Memory' instead of `AF_Module' as arguments.
- (af_loader_reset, af_loader_load_glyph): Also pass `loader' as
- argument.
- (af_loader_done): Use `AF_Loader' instead of `AF_Module' as
- argument.
-
- * src/autofit/afmodule.c (af_autofitter_init): Don't call
- `af_loader_init'.
- (af_autofitter_done): Don't call `af_loader_done'.
- (af_autofitter_load_glyph): Use a local `AF_Loader' object.
-
- * src/autofit/afloader.h: Include `afmodule.h'.
- Update prototypes.
- Move typedef for `AF_Module' to...
-
- * src/autofit/afmodule.h: ... this place.
- No longer include `afloader.h'.
-
-2015-01-14 Behdad Esfahbod <behdad@behdad.org>
-
- * src/type42/t42objs.h (T42_DriverRec): Remove unused member.
-
-2015-01-12 Werner Lemberg <wl@gnu.org>
-
- Fix Savannah bug #43976.
-
- Assure that FreeType's internal include directories are found before
- `CPPFLAGS' (which might be set by the user in the environment), and
- `CPPFLAGS' before `CFLAGS'.
-
- * builds/freetype.mk (FT_CFLAGS): Don't add `INCLUDE_FLAGS'.
- (FT_COMPILE): Make this a special variable for compiling only the
- files handled in `freetype.mk'.
- (.c.$O): Removed, unused.
-
- * src/*/rules.mk (*_COMPILE): Fix order of include directories.
-
-2015-01-11 Werner Lemberg <wl@gnu.org>
-
- [truetype] Prettifying.
-
- * src/truetype/ttinterp.c (project, dualproj, fast_project,
- fast_dualproj): Rename to...
- (PROJECT, DUALPROJ, FAST_PROJECT, FAST_DUALPROJ): ... this.
-
-2015-01-11 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Ins_JROT, Ins_JROF): Simplify.
-
- Based on a patch from Behdad.
-
-2015-01-11 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Ins_SxVTL): Simplify function call.
-
-2015-01-11 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Normalize): Remove unused argument.
-
-2015-01-11 Werner Lemberg <wl@gnu.org>
-
- [truetype] More macro expansions.
-
- * src/truetype/ttinterp.c (FT_UNUSED_EXEC): Remove macro by
- expansion.
-
-2015-01-11 Werner Lemberg <wl@gnu.org>
-
- [truetype] More macro expansions.
-
- * src/truetype/ttinterp.c (INS_ARG): Remove macro by expansion,
- adjusting function calls where necessary.
- (FT_UNUSED_ARG): Removed, no longer needed.
-
-2015-01-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] More macro expansions.
-
- Based on a patch from Behdad.
-
- * src/truetype/ttinterp.c (DO_*): Expand macros into corresponding
- `Ins_*' functions.
- (TT_RunIns): Replace `DO_*' macros with `Ins_*' function calls.
- (ARRAY_BOUND_ERROR): Remove second definition, which is no longer
- needed.
- (Ins_SVTCA, Ins_SPVTCA, Ins_SFVTCA): Replaced with...
- (Ins_SxyTCA): New function.
-
-2015-01-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] Remove TT_CONFIG_OPTION_INTERPRETER_SWITCH.
-
- Behdad suggested this code simplification, and nobody objected...
-
- * include/config/ftoption.h, devel/ftoption.h
- (TT_CONFIG_OPTION_INTERPRETER_SWITCH): Remove.
-
- * src/truetype/ttinterp.c [TT_CONFIG_OPTION_INTERPRETER_SWITCH]:
- Remove related code.
- (ARRAY_BOUND_ERROR): Use do-while loop.
-
-2015-01-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] More macro expansions.
-
- * src/truetype/ttinterp.c, src/truetype/ttinterp.h (EXEC_ARG_,
- EXEC_ARG): Remove by replacing with expansion.
-
-2015-01-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] More macro expansions.
-
- Based on a patch from Behdad.
-
- * src/truetype/ttinterp.c (SKIP_Code, GET_ShortIns, NORMalize,
- SET_SuperRound, ROUND_None, INS_Goto_CodeRange, CUR_Func_move,
- CUR_Func_move_orig, CUR_Func_round, CUR_Func_cur_ppem,
- CUR_Func_read_cvt, CUR_Func_write_cvt, CUR_Func_move_cvt,
- CURRENT_Ratio, INS_SxVTL, COMPUTE_Funcs, COMPUTE_Round,
- COMPUTE_Point_Displacement, MOVE_Zp2_Point): Remove by replacing
- with expansion.
-
- (Cur_Func_project, CUR_Func_dualproj, CUR_fast_project,
- CUR_fast_dualproj): Replace with macros `project', `dualproj',
- `fast_project', `fast_dualproj'.
-
-2015-01-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] More macro expansions.
-
- * src/truetype/ttinterp.c (EXEC_OP_, EXEC_OP): Remove by replacing
- with expansion.
-
-2015-01-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] Remove code for static TrueType interpreter.
-
- This is a follow-up patch.
-
- * src/truetype/ttinterp.c, src/truetype/ttinterp.h
- [TT_CONFIG_OPTION_STATIC_INTERPRETER,
- TT_CONFIG_OPTION_STATIC_RASTER]: Remove macros and related code.
-
-2015-01-10 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (CUR): Remove by replacing with expansion.
-
- This starts a series of patches that simplifies the code of the
- bytecode interpreter.
-
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2015-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/ChangeLog.27 b/freetype/ChangeLog.27
deleted file mode 100644
index c59ed7b8..00000000
--- a/freetype/ChangeLog.27
+++ /dev/null
@@ -1,2106 +0,0 @@
-2016-12-30 Werner Lemberg <wl@gnu.org>
-
- * Version 2.7.1 released.
- =========================
-
-
- Tag sources with `VER-2-7-1'.
-
- * docs/VERSION.TXT: Add entry for version 2.7.1.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.7/2.7.1/, s/27/271/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
- * builds/unix/configure.raw (version_info): Set to 19:0:13.
- * CMakeLists.txt (VERSION_PATCH): Set to 1.
-
-2016-12-30 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Replace `rand' with an xorshift algorithm.
-
- * src/tools/ftfuzzer/ftfuzzer.cc: Don't include `stdlib.h'.
- (Random): Implement and use a 32bit `xorshift' algorithm.
-
-2016-12-30 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Restrict number of tested bitmap strikes.
-
- Malformed fonts often have large values for the number of bitmap
- strikes, and FreeType doesn't check the validity of all bitmap
- strikes in advance.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=353
-
- * src/tools/ftfuzzer/ftfuzzer.cc: Include `stdlib.h' for `rand'.
- (Random): Small class to provide n randomly selected numbers
- (without repetition) out of the value set [1,N].
- (LLVMFuzzerTestOneInput): Use it to test only up to 10 bitmap
- strikes.
-
-2016-12-29 Werner Lemberg <wl@gnu.org>
-
- [truetype] Variation font API stability issues.
-
- Make some functions work before a call to `TT_Set_MM_Blend'.
-
- * src/truetype/ttgxvar.c (tt_hadvance_adjust): Exit immediately if
- we don't blend.
- (TT_Get_MM_Blend, TT_Get_Var_Design): Return default values if we
- don't blend.
-
-2016-12-29 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Check axis data.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=348
-
-2016-12-29 Werner Lemberg <wl@gnu.org>
-
- [truetype] Tracing fixes.
-
- * src/truetype/ttgxvar.c (tt_hadvance_adjust): Emit correct
- information.
- (TT_Set_Var_Design): Fix typo.
- (TT_Get_Var_Design): Fix typos.
-
-2016-12-29 Werner Lemberg <wl@gnu.org>
-
- */*: Use `0.5f' for tracing 16.16 numbers.
-
-2016-12-29 Werner Lemberg <wl@gnu.org>
-
- [pcf] Protect against gzip bombs.
-
- Fix suggested by Kostya; reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=345
-
- * src/pcf/pcfread.c (pcf_read_TOC): Limit number of TOC entries to
- 1024.
-
-2016-12-28 Werner Lemberg <wl@gnu.org>
-
- [psnames] Only declare, not define, data in `pstables.h' (#49949).
-
- Pdfium includes `pstables.h' a second time; moving the definition
- from `pstables.h' to `psmodule.c' saves more than 60kByte data
- segment space for this case.
-
- * src/tools/glnames.py (StringTable::dump,
- StringTable::dump_sublist, dump_encoding, dump_array): Emit
- additional code to only define tables if `DEFINE_PS_TABLES' is set.
-
- * src/psnames/pstables.h: Regenerated.
- * src/psnames/psmodule.c (DEFINE_PS_TABLES): Define.
-
-2016-12-28 Werner Lemberg <wl@gnu.org>
-
- [cff] Catch `blend' op in non-variant fonts.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=334
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdBLEND>: Don't
- allow `blend' op for non-variant fonts.
-
-2016-12-28 Werner Lemberg <wl@gnu.org>
-
- [cff] Better check of number of blends.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdBLEND>,
- src/cff/cffparse.c (cff_parse_blend): Compare number of blends with
- stack size.
-
-2016-12-27 Werner Lemberg <wl@gnu.org>
-
- Documentation updates.
-
- * docs/CHANGES: Add missing information.
-
- * docs/formats.txt: Rewritten and updated.
-
-2016-12-27 Werner Lemberg <wl@gnu.org>
-
- [truetype, type1] Implement `FT_Get_Var_Design_Coordinates'.
-
- * src/truetype/ttgxvar.c (TT_Get_Var_Design): Implement.
- (TT_Set_Var_Design): Fix tracing.
-
- * src/type1/t1load.c (T1_Get_Var_Design): Implement.
-
-2016-12-24 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttpload.c (tt_face_load_hdmx): Ignore `version'.
-
- Problem reported by 張俊芝 <418092625@qq.com>.
-
-2016-12-24 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttsbit.c (tt_face_load_sbit): Allow more version values.
-
- Some fonts seem to have the `version' field in the wrong byte order.
-
- Problem reported by 張俊芝 <418092625@qq.com>.
-
-2016-12-24 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttpload.c (tt_face_load_loca): Sanitize table length.
-
- This trivial fix allows us to accept more fonts.
-
- Problem reported by 張俊芝 <418092625@qq.com>.
-
-2016-12-24 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Fix tracing.
-
-2016-12-22 Werner Lemberg <wl@gnu.org>
-
- * CMakeLists.txt: Make it work with cmake 2.8.11.2 (#49909).
-
-2016-12-22 Werner Lemberg <wl@gnu.org>
-
- Ensure used preprocessor symbols are defined (#49790).
-
- * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h: Check `__GNUC__', `__IBMC__',
- and `__SUNPRO_C' correctly.
-
-2016-12-22 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Check `count'.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=308
-
-2016-12-22 Werner Lemberg <wl@gnu.org>
-
- [cff] Protect against invalid `vsindex' and `blend' values.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=305
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdVSINDEX,
- cf2_cmdBLEND>: Implement it.
-
-2016-12-22 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Always use Adobe CFF engine.
-
- * src/tools/ftfuzzer/ftfuzzer.cc (FT_Global::FT_Global): Implement
- it.
-
-2016-12-21 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Thinko.
-
- I should really stop coding late in the evening...
-
- Thanks again to Ben for checking.
-
-2016-12-21 Werner Lemberg <wl@gnu.org>
-
- [autofit] Support variation fonts.
-
- (This ChangeLog entry was added later on.)
-
- * src/autofit/afglobal.c (af_face_globals_free): Remove useless
- code.
-
- * src/base/ftmm.c (FT_Set_MM_Design_Coordinates,
- * FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates,
- FT_Set_Var_Blend_Coordinates): Finalize
- auto-hinter data to enforce recomputation. Note that this is a
- brute-force method which should be improved.
-
-2016-12-21 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Thinko.
-
- Don't apply deltas twice for non-phantom points.
-
- Spotted by Ben Wagner.
-
-2016-12-21 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Another try for #49829.
-
- * src/cff/cffdrivr.c: Don't include
- `FT_SERVICE_METRICS_VARIATIONS_H'.
- (cff_get_advances): Use `ttface->variation_support'.
-
- * src/truetype/ttdriver.c (tt_get_advances): Use
- `ttface->variation_support'.
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
- load_truetype_glyph): Use `ttface->variation_support'.
-
-2016-12-21 Werner Lemberg <wl@gnu.org>
-
- [truetype, sfnt] Introduce font variation flags to `TT_Face'.
-
- * include/freetype/internal/tttypes.h (TT_FACE_FLAG_VAR_XXX):
- New macros describing available functionality of various OpenType
- tables related to font variation.
- (TT_Face): New fields `variation_support' and `mvar_support',
- replacing and extending `use_fvar'.
-
- * src/sfnt/sfobjs.c (sfnt_init_face, sfnt_load_face): Use
- `variation_support'.
-
- * src/truetype/ttgxvar.c (ft_var_load_hvar): Set `variation_support'
- field.
- (TT_Vary_Apply_Glyph_Deltas): Updated.
-
-2016-12-21 Werner Lemberg <wl@gnu.org>
-
- [base] Improve sanity check for Mac resources (#49888).
-
- * src/base/ftobjs.c (Mac_Read_sfnt_Resource): Abort if `rlen' is not
- positive.
-
-2016-12-20 Werner Lemberg <wl@gnu.org>
-
- [base] More sanity checks for Mac resources.
-
- We use
-
- https://github.com/kreativekorp/ksfl/wiki/Macintosh-Resource-File-Format
-
- and
-
- https://developer.apple.com/legacy/library/documentation/mac/pdf/MoreMacintoshToolbox.pdf#page=151
-
- as references.
-
- * include/freetype/internal/ftrfork.h (FT_RFork_Ref): Use FT_Short
- for `res_id'.
-
- * src/base/ftrfork.c (FT_Raccess_Get_HeaderInfo): Extract map length
- and use it to improve sanity checks.
- Follow the specification more closely;in particular, all data types
- are signed, not unsigned.
- (FT_Raccess_Get_DataOffsets): Follow the specification more closely;
- in particular, all data types are signed, not unsigned.
- Add some sanity checks.
-
-2016-12-20 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improve logic for getting fast advance widths.
-
- * src/cff/cffdrivr.c (cff_get_advances), src/truetype/ttdriver.c
- (tt_get_advances): Use `is_default_instance' for test; this gets
- recomputed after changing blend coordinates.
-
-2016-12-20 Ben Wagner <bungeman@google.com>
- Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix linear metrics of GX variation fonts (#49829).
-
- When asking for an unhinted non-default variations,
- `linearVertAdvance' is currently the value from the `hmtx' table
- instead of the actual value after applying the variation. `HVAR'
- support fixes this, but fonts will exist without that table and will
- need sane fallback.
-
- Problem also reported as
-
- https://bugs.chromium.org/p/skia/issues/detail?id=5917
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
- load_truetype_glyph): Implement linear advance adjustments if `HVAR'
- or `VVAR' tables are missing.
-
-2016-12-20 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Fast advance width retrieval for fonts with HVAR.
-
- Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
-
- * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Don't handle MM.
-
- * src/cff/cffdrivr.c: Include FT_SERVICE_METRICS_VARIATIONS_H.
- (cff_get_advances): Test for HVAR and VVAR.
-
- * src/truetype/ttdriver.c (tt_get_advances): Test for HVAR and VVAR.
-
-2016-12-18 Werner Lemberg <wl@gnu.org>
-
- [base] Fix invalid mac font recursion.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=304
-
- * src/base/ftobjs.c (FT_Open_Face): Code moved to...
- (ft_open_face_internal): ... this function.
- Add a parameter to control whether we try special Mac font handling
- in case of failure.
- (FT_Open_Face, FT_New_Face, FT_New_Memory_Face,
- open_face_from_buffer): Use `ft_open_face_internal'.
-
-2016-12-18 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffobjs.c (cff_face_init): Make named instances work.
-
-2016-12-18 Werner Lemberg <wl@gnu.org>
-
- [truetype, cff] Extend `get_var_blend' function of MM service.
-
- In particular, we need access to named instance data.
-
- * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func):
- Add argument for `FT_MM_Var'.
-
- * src/cff/cffload.c (cff_get_var_blend): Updated.
- * src/cff/cffload.h: Updated.
-
- * src/cff/cf2ft.c (cf2_getNormalizedVector): Updated.
-
- * src/truetype/ttgxvar.c (tt_get_var_blend): Updated.
- Accept value `NULL' for arguments.
- * src/truetype/ttgxvar.h: Updated.
-
-2016-12-18 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Handle `fvar' with zero axes as a non-MM font.
-
- This is better behaviour than exiting with an error.
-
- * include/freetype/internal/tttypes.h (TT_Face): Add `use_fvar'
- field.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Compute `use_fvar', also
- updating the validation code.
- Use `use_fvar' to compute FT_FACE_FLAG_MULTIPLE_MASTERS.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Remove `fvar' validation
- code.
-
-2016-12-18 Werner Lemberg <wl@gnu.org>
-
- Minor GX code shuffling.
-
- * include/freetype/internal/tttypes.h (TT_Face): Move
- `is_default_instance' into TT_CONFIG_OPTION_GX_VAR_SUPPORT
- block.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Updated.
- * src/truetype/ttgload.c (IS_DEFAULT_INSTANCE): New macro.
- (TT_Load_Glyph): Use it.
-
-2016-12-18 Werner Lemberg <wl@gnu.org>
-
- [cff] Better handling of non-CFF font formats.
-
- * src/cff/cffload.c (cff_font_load): Pure CFFs don't have a
- signature, so return `FT_Err_Unknown_File_Format' more often.
-
-2016-12-17 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_build_blend_vector): Remove redundant code.
-
-2016-12-17 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttobjs.c (tt_face_init): Simplify conditional code.
-
-2016-12-17 Werner Lemberg <wl@gnu.org>
-
- [sfnt, truetype] Various sanitizing fixes.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): If the axis count in `fvar' is
- zero, set `num_instances' to zero.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Handle `fvar' table with
- zero axes as invalid.
-
- * src/truetype/ttobjs.c (tt_face_init): Improve logic of loading
- `loca', `cvt', `fpgm', and `prep' table.
-
-2016-12-17 Werner Lemberg <wl@gnu.org>
-
- Improve tracing of `FT_Open_Face'.
-
- * src/base/ftobjs.c (FT_Open_Face): Return info on number of
- available faces and numbered instances, or the indices of the
- requested face and numbered instance.
-
- * src/sfnt/sfobjs. (sfnt_open_font): Trace number of subfonts.
-
-2016-12-17 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_load_private_dict): Always init `blend'.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=295
-
-2016-12-16 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix `cvar' sanity test.
-
- Reported by Dave Arnold.
-
- * src/truetype/ttgxvar.c (tt_face_vary_cvt): Use tuple count mask.
-
-2016-12-16 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Remove compiler warnings; fix `make multi'.
-
- * src/cff/cf2font.h: Include `cffload.h'.
-
- * src/cff/cffload.c: Include FT_MULTIPLE_MASTERS_H and
- FT_SERVICE_MULTIPLE_MASTERS_H.
- (cff_vstore_load): Eliminate `vsSize'.
- (cff_load_private_dict): Tag as `FT_LOCAL_DEF'.
-
- * src/cff/cffload.h: Include `cffobjs.h'.
- Provide declaration for `cff_load_private_dict'.
-
- * src/truetype/ttgxvar.c (ft_var_load_hvar): Eliminate
- `minorVersion' and `map_offset'.
-
-2016-12-16 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix heap buffer overflow (#49858).
-
- * src/cff/cffparse.c (cff_parser_run): Add one more stack size
- check.
-
-2016-12-15 Werner Lemberg <wl@gnu.org>
-
- Fix clang warnings.
-
- * src/cff/cffload.c (cff_blend_doBlend): Add cast.
- (cff_subfont_load): Set `error' correctly.
-
- * src/sfnt/ttmtx.c (tt_face_get_metrics): Typo.
-
-2016-12-15 Dave Arnold <darnold@adobe.com>
- Werner Lemberg <wl@gnu.org>
-
- [cff] Implement CFF2 support (2/2).
-
- The font variation code. All parts dependent on the GX code in the
- `truetype' module are guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
- In other words, you can still compile the `cff' module without
- defining TT_CONFIG_OPTION_GX_VAR_SUPPORT (which brings you CFF2
- support without font variation).
-
- * src/cff/cf2font.c (cf2_font_setup): Add support for font
- variation.
- * src/cff/cf2font.h (CF2_Font): Add fields for variation data.
-
- * src/cff/cf2ft.c (cf2_free_instance): Free blend data.
- (cf2_getVStore, cf2_getNormalizedVector): New functions.
- * src/cff/cf2ft.h: Updated.
-
- * src/cff/cf2intrp.c: Include `cffload.h'.
- (cf2_cmdRESERVED_15, cf2_cmdRESERVED_16): Replace with...
- (cf2_cmdVSINDEX, cf2_cmdBLEND): ... this new enum values.
- (cf2_doBlend): New function.
- (cf2_interpT2CharString): Handle `vsindex' and `blend' opcodes.
-
- * src/cff/cffload.c (FT_fdot14ToFixed): New macro.
- (cff_vstore_done, cff_vstore_load): New functions.
- (cff_blend_clear, cff_blend_doBlend, cff_blend_build_vector,
- cff_blend_check_vector): New functions.
- (cff_load_private_dict): Add arguments for blend vector.
- Handle blend data.
- (cff_subfont_load, cff_subfont_done): Updated.
- (cff_font_load): Handle CFF2 variation store data.
- (cff_font_done): Updated.
- * src/cff/cffload.h: Include `cffparse.h'.
- Updated.
-
- * src/cff/cffobjs.c (cff_face_done): Updated.
-
- * src/cff/cffparse.c: Include `cffload.h'.
- (cff_parse_num): Handle internal value 255.
- (cff_parse_vsindex, cff_parse_blend): New functions.
- (CFF_FIELD_BLEND): New macro.
- (cff_parser_run): Updated.
- * src/cff/cffparse.h (cff_kind_blend): New enum value.
-
- * src/cff/cfftoken.h: Handle `vstore', `vsindex', and `blend'
- dictionary values.
-
- * src/cff/cfftypes.h (CFF_VarData, CFF_AxisCoords, CFF_VarRegion,
- CFF_VStore, CFF_Blend): New structures.
- (CFF_FontRecDict): Add `vstore_offset' field.
- (CFF_Private): Add `vsindex' field.
- (CFF_SubFont): Add fields for blend data.
- (CFF_Font): Add `vstore' field.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): `CFF2' is equal to `gvar',
- since glyph variation data is directly embedded.
- (TT_Set_MM_Blend): Don't load `gvar' table for CFF2 fonts.
-
-2016-12-15 Dave Arnold <darnold@adobe.com>
- Werner Lemberg <wl@gnu.org>
-
- [cff] Implement CFF2 support (1/2).
-
- This commit does not contain the blend code for font variation
- support, which follows in another commit.
-
- You should ignore whitespace while inspecting this commit.
-
- * include/freetype/internal/tttypes.h (TT_Face): Add `isCFF2'
- member.
-
- * src/cff/cf2font.h (CF2_Font): Add `isCFF2' member.
-
- * src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Handle `isCFF2'
- flag.
- (cf2_getMaxstack): New function.
- * src/cff/cf2ft.h: Updated.
-
- * src/cff/cf2intrp.c (cf2_escRESERVED_38): New enum.
- (cf2_interpT2CharString): Handle CFF2 differences.
- Add tracing message for errors.
-
- * src/cff/cffdrivr.c (cff_get_glyph_name, cff_get_name_index):
- Update for CFF2.
-
- * src/cff/cffload.c (FT_FIXED_ONE): New macro.
- (cff_index_init, cff_index_load_offsets, cff_index_access_element,
- cff_index_get_name, cff_ft_select_get, cff_load_private_dict,
- cff_subfont_load, cff_font_load): Handle CFF2.
- * src/cff/cffload.h: Updated.
-
- * src/cff/cffobjs.c (cff_face_init): Handle CFF2.
-
- * src/cff/cffparse.c (cff_parse_maxstack): New function.
- (CFFCODE_TOPDICT, CFFCODE_PRIVATE): Removed
- * src/cff/cffparse.h (CFF2_MAX_STACK, CFF2_DEFAULT_STACK): New
- macros.
- (CFF2_CODE_TOPDICT, CFF2_CODE_FONTDICT, CFF2_CODE_PRIVATE): New
- macros.
-
- * src/cff/cfftoken.h: Add fields for CFF2 dictionaries (but no blend
- stuff).
-
- * src/cff/cfftypes.h (CFF_Index): Add `hdr_size' field.
- (CFF_FontRecDict): Add `maxstack' field.
- (CFF_Private): Add `subfont' field.
- (CFF_Font): Add `top_dict_length' and `cff2' fields.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Handle `CFF2' table.
-
-2016-12-15 Werner Lemberg <wl@gnu.org>
- Dave Arnold <darnold@adobe.com>
-
- [truetype] Provide HVAR advance width variation as a service.
-
- Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
-
- * src/truetype/ttdriver.c (tt_service_metrics_variations): Updated.
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Prevent
- double adjustment of advance width.
-
- * src/sfnt/ttmtx.c: Include FT_SERVICE_METRICS_VARIATIONS_H.
- (tt_face_get_metrics): Apply metrics variations.
-
-2016-12-15 Dave Arnold <darnold@adobe.com>
- Werner Lemberg <wl@gnu.org>
-
- [truetype] Provide function to apply `HVAR' advance width variation.
-
- Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
-
- * src/truetype/ttgxvar.c (tt_hadvance_adjust): New function.
- * src/truetype/ttgxvar.h: Updated.
-
-2016-12-15 Dave Arnold <darnold@adobe.com>
- Werner Lemberg <wl@gnu.org>
-
- [truetype] Add `HVAR' table parsing.
-
- Note that this is not complete yet; it only handles advance width
- variation.
-
- Activation of the code follows in another commit.
-
- Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
-
- * include/freetype/ftmm.h (FT_Var_Named_Style): Add `psid' member.
-
- * src/truetype/ttgxvar.h (GX_HVarData, GX_AxisCoords, GX_HVarRegion,
- GX_HVStore, GX_WidthMap): New auxiliary structures for...
- (GX_HVarTable): ... HVAR main structure.
- (GX_BlendRec): Add data for HVAR loading.
-
- * src/truetype/ttgxvar.c (FT_FIXED_ONE, FT_fdot14ToFixed,
- FT_intToFixed, FT_fixedToInt): New macros.
- (ft_var_load_hvar): New function.
- (TT_Get_MM_Var): Updated.
- (tt_done_blend): Deallocate HVAR data.
-
-2016-12-15 Dave Arnold <darnold@adobe.com>
-
- [cff] Extend number parsing.
-
- The forthcoming CFF2 support needs a dynamic parsing limit.
-
- * src/cff/cffparse.c (cff_parse_num, do_fixed, cff_parse_fixed,
- cff_parse_fixed_scaled, cff_parse_fixed_dynamic): Add argument for
- parser.
- (cff_parse_font_matrix, cff_parse_font_bbox, cff_parse_private_dict,
- cff_parse_multiple_master, cff_parse_cid_ros, cff_parser_run): Updated.
-
- * src/cff/cffparse.h (cff_parse_num): Export locally.
-
-2016-12-15 Dave Arnold <darnold@adobe.com>
-
- [cff] Implement dynamic stack size for Adobe engine.
-
- This also adds `cf2_stack_setReal' and `cf2_stack_pop', needed for
- the forthcoming CFF2 support.
-
- * src/cff/cf2stack.c (cf2_stack_init): Add argument for stack size.
- (cf2_stack_free): Deallocate stack.
- (cf2_stack_count, cf2_stack_pushInt, cf2_stack_pushFixed,
- cf2_stack_popInt, cf2_stack_popFixed, cf2_stack_getReal,
- cf2_stack_clear): Updated.
- (cf2_stack_setReal, cf2_stack_pop): New functions.
-
- * src/cff/cf2stack.h (CF2_Stack): Add `stackSize' member.
- Update function declarations.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString): Updated.
-
- * src/cff/cffparse.c (cff_parser_init): Add parameter for stack
- size; return error code.
- (cff_parser_done): New function.
- (cff_parser_run): Updated.
-
- * src/cff/cffparse.h (CFF_Parser): Add `stackSize' member and make
- `stack' a pointer.
- Update function declarations.
-
- * src/cff/cffload.c (cff_load_private_dict, cff_subfont_load):
- Updated.
-
-2016-12-15 Dave Arnold <darnold@adobe.com>
- Werner Lemberg <wl@gnu.org>
-
- [cff] Code shuffling.
-
- * src/cff/cfftypes.h (CFF_Font): Add `library' and `base_offset'
- fields.
-
- * src/cff/cffload.c (cff_subfont_load): Change last argument to
- `CFF_Font'
- Split off parsing of private dictionary into...
- (cff_load_private_dict): ...this new function.
- (cff_font_load): Updated.
-
-2016-12-14 Werner Lemberg <wl@gnu.org>
-
- [sfnt, truetype] Add framework for Metrics Variations service.
-
- No effect yet; service functions will be implemented later on.
-
- Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
-
- * include/freetype/internal/services/svmetric.h: New file.
-
- * include/freetype/internal/ftserv.h
- (FT_SERVICE_METRICS_VARIATIONS_H): New macro.
-
- * include/freetype/internal/tttypes.h (TT_Face): New field `var'.
-
- * src/sfnt/sfobjs.c: Include FT_SERVICE_METRICS_VARIATIONS_H.
- (sfnt_init_face): Initialize `face->var'.
-
- * src/truetype/ttdriver.c: Include FT_SERVICE_METRICS_VARIATIONS_H.
- (tt_service_metrics_variations): New service.
- (tt_services): Updated.
-
- * src/truetype/ttpic.h: Updated.
-
-2016-12-14 Werner Lemberg <wl@gnu.org>
-
- [cff] Add Multiple Masters service.
-
- The code simply uses the MM functions from the `truetype' module.
-
- Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
-
- * include/freetype/internal/tttypes.h (TT_Face): New field `mm'.
-
- * src/cff/cffdrivr.c: Include FT_SERVICE_MULTIPLE_MASTERS_H.
- (cff_set_mm_blend, cff_get_mm_blend, cff_get_mm_var,
- cff_set_var_design, cff_get_var_design): New functions.
- (cff_service_multi_masters): New service.
- (cff_services): Updated.
-
- * src/cff/cffload.c (cff_get_var_blend, cff_done_blend): New
- functions.
- * src/cff/cffload.h: Updated.
-
- * src/cff/cffpic.h (CFF_SERVICE_MULTI_MASTERS_GET): New macro.
-
- * src/sfnt/sfobjs.c: Include FT_SERVICE_MULTIPLE_MASTERS_H.
- (sfnt_init_face): Initialize `face->mm'.
-
-2016-12-14 Werner Lemberg <wl@gnu.org>
-
- Extend functionality of `ft_module_get_service'.
-
- It can now differentiate between local and global searches.
-
- * src/base/ftobjs.c (ft_module_get_service): Add `global' argument.
- (FT_Get_TrueType_Engine_Type): Updated.
-
- * src/cff/cffdrivr.c (cff_get_ps_name, cff_get_cmap_info): Updated.
-
- * include/freetype/internal/ftobjs.h: Updated.
- * include/freetype/internal/ftserv.h (FT_FACE_FIND_GLOBAL_SERVICE):
- Updated.
-
-2016-12-14 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (tt_get_var_blend): Fix compiler warning.
-
-2016-12-14 Dave Arnold <darnold@adobe.com>
- Werner Lemberg <wl@gnu.org>
-
- [sfnt, cff] Minor preparations.
-
- * include/freetype/tttags.h (TTAG_CFF2, TTAG_HVAR, TTAG_MVAR,
- TTAG_VVAR): New SFNT table tags.
-
- * src/cff/cf2fixed.h (CF2_FIXED_ONE, CF2_FIXED_EPSILON): Add cast.
-
-2016-12-10 Werner Lemberg <wl@gnu.org>
-
- [truetype, type1] Add `get_var_blend' to MM service.
-
- For internal use; we want to share code between the forthcoming CFF2
- support and TrueType.
-
- * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func):
- New typedef.
- (MultiMasters): Add `get_var_blend'.
- (FT_Service_MultiMasters): Updated.
-
- * src/truetype/ttgxvar.c (tt_get_var_blend): New function.
- * src/truetype/ttgxvar.h: Updated.
-
- * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
- * src/type1/t1driver.c (t1_service_multi_masters): Updated.
-
-2016-12-10 Werner Lemberg <wl@gnu.org>
-
- [truetype, type1] Add `done_blend' to MM service.
-
- For internal use; we want to share code between the forthcoming CFF2
- support and TrueType.
-
- * include/freetype/internal/services/svmm.h (FT_Done_Blend_Func):
- New typedef.
- (MultiMasters): Add `done_blend'.
- (FT_Service_MultiMasters): Updated.
-
- * src/truetype/ttgxvar.c (tt_done_blend): Use `TT_Face' as argument.
- * src/truetype/ttgxvar.h: Updated.
-
- * src/truetype/ttobjs.c (TT_Face_Done): Updated.
-
- * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Updated.
- * src/type1/t1driver.c (t1_service_multi_masters): Updated.
-
-2016-12-09 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Revert change from 2016-12-08.
-
- I missed the functionality of `ft_module_get_service', which makes
- the change unnecessary.
-
-2016-12-08 Werner Lemberg <wl@gnu.org>
-
- Add framework to support services with 8 functions.
-
- We will need this for CFF variation font support.
-
- * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC8):
- New macro.
-
-2016-12-08 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Add `get_glyph_name' and `get_name_index' to SFNT interface.
-
- CFF2 fonts will need access to those two functions.
-
- * include/freetype/internal/sfnt.h: Include FT_SERVICE_GLYPH_DICT_H.
- (SFNT_Interface): Add `get_glyph_name' and `get_name_index' members.
- (FT_DEFINE_SFNT_INTERFACE): Updated.
-
- * src/sfnt/sfdriver.c (sfnt_get_glyph_name, sfnt_get_name_index):
- Fix signatures to exactly correspond to the glyph dict service
- function typedefs.
- (sfnt_interface): Updated.
-
-2016-12-06 Dave Arnold <darnold@adobe.com>
-
- Add `FT_Get_Var_Design_Coordinates' function.
-
- Note that the low-level functions aren't implemented yet.
-
- * include/freetype/ftmm.h: Declare.
-
- * include/freetype/internal/services/svmm.h
- (FT_Get_Var_Design_Func): New typedef.
- (MultiMasters): New MM service function `get_var_design'.
- (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
- Update all callers.
-
- * src/base/ftmm.c (FT_Get_Var_Design_Coordinates): Implement.
-
- * src/truetype/ttdriver.c: Updated.
-
- * src/truetype/ttgxvar.c (TT_Get_Var_Design): New dummy function to
- handle `get_var_design' service.
- * src/truetype/ttgxvar.h: Updated.
-
- * src/type1/t1driver.c: Updated.
-
- * src/type1/t1load.c (T1_Get_Var_Design): New dump function to
- handle `get_var_design' service.
- * src/type1/t1load.h: Updated.
-
-2016-12-06 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_subrs): Fix memory leak.
-
- The `subrs' keyword might erroneously occur multiple times.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=231
-
-2016-12-01 Werner Lemberg <wl@gnu.org>
-
- [gzip] Improve building with external zlib (#49673).
-
- Building FreeType with external zlib 1.2.8 makes msvc 14 stop with
- the following error.
-
- ftgzip.c
- zlib-1.2.8\zlib.h(86): error C2061:
- syntax error: identifier 'z_const'
- zlib-1.2.8\zlib.h(94): error C2054:
- expected '(' to follow 'z_const'
- zlib-1.2.8\zlib.h(94): error C2085:
- 'msg': not in formal parameter list
- ...
- zlib-1.2.8\zlib.h(877): fatal error C1003:
- error count exceeds 100; stopping compilation
-
- The error happens because FreeType keeps an own copy of zlib-1.1.4
- under `src/gzip'. When building `src/gzip/ftgzip.c' with
- FT_CONFIG_OPTION_SYSTEM_ZLIB defined, it uses
-
- #include <zlib.h>
-
- which correctly finds an external `zlib.h', but `zlib.h' itself has
- a line
-
- #include "zconf.h"
-
- which makes Visual Studio 2015 find `src/gzip/zconf.h' while
- compiling the files in `src/gzip'.
-
- * src/gzip/zconf.h: Rename to...
- * src/gzip/ftzconf.h: ... this.
- * src/gzip/zlib.h, src/gzip/rules.mk (GZIP_DRV_SRCS): Updated.
-
-2016-12-01 Oleksandr Chekhovskyi <oleksandr.chekhovskyi@gmail.com>
-
- [autofit] Fix Emscripten crash (patch #9180).
-
- Function calls through pointers must use a matching signature to
- work on Emscripten, since such calls are dispatched through lookup
- tables grouped by signature.
-
- * src/autofit/aftypes.h (AF_WritingSystem_ApplyHintsFunc): Fix
- typedef.
-
-2016-11-29 Werner Lemberg <wl@gnu.org>
-
- [smooth] Revert previous commit. Already fixed with 6ca54c64.
-
-2016-11-29 Werner Lemberg <wl@gnu.org>
-
- [smooth] Avoid conditional jump on uninitialized value (#49711).
-
- * src/smooth/ftgrays.c (gray_raster_render): Initialize `worker'.
-
-2016-11-27 Nikolaus Waxweiler <madigens@gmail.com>
-
- [autofit] Code shuffling.
-
- Also improve some comments and remove unused code.
-
- No functional change.
-
- * src/autofit/afloader.c (af_loader_load_g): Merged with...
- (af_loader_load_glyph): ...this function.
- Split off emboldening code into...
- (af_loader_embolden_glyph_in_slot): ... this function.
-
-2016-11-17 Werner Lemberg <wl@gnu.org>
-
- Better support of LLP64 systems with gcc (and clang).
-
- * builds/unix/configure.raw: Call `AC_TYPE_LONG_LONG_INT'.
-
- * builds/unix/ftconfig.in (FT_LONG64): Enable for LLP64 systems (and
- suppress warnings) even without `FT_CONFIG_OPTION_FORCE_INT64'.
-
-2016-11-10 Werner Lemberg <wl@gnu.org>
-
- Fix `lcd_weights' array size.
-
- * include/freetype/internal/ftobjs.h (FT_LibraryRec): Do it.
-
- Reported by Nikolaus.
-
-2016-11-06 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (FT_Render_Glyph_Internal): Fix tracing.
-
-2016-11-06 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Improve FT_LOAD_BITMAP_METRICS_ONLY for `sbix' format.
-
- It's unavoidable to call the PNG engine, but to get the metrics it
- is sufficient to read the PNG image's header only.
-
- * src/sfnt/pngshim.c (Load_SBit_Png): Add argument to control the
- allocation of the glyph slot.
- * src/sfnt/pngshim.h: Updated.
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_png,
- tt_face_load_sbix_image, tt_face_load_sbit_image): Updated.
-
-2016-11-06 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Speed up `sbix' lookup.
-
- This also fixes a bug introduced in 2016-10-01 which prevents
- display of embedded bitmap fonts that use the `sbix' format.
-
- * src/sfnt/ttsbit.c (tt_face_load_sbit): Store `sbix' size and
- offset also in `ebdt_size' and `ebdt_start', respectively. This
- makes the test for an embedded bitmap data table succeed for this
- format.
-
- (tt_face_load_strike_metrics) <TT_SBIT_TABLE_TYPE_SBIX>: Use
- `ebdt_size' and `ebdt_start'
- (tt_face_load_sbix_image): Ditto.
-
-2016-11-06 Seigo Nonaka <nona@google.com>
- Werner Lemberg <wl@gnu.org>
-
- Introduce a way of quickly retrieving (embedded) bitmap metrics.
-
- `FT_Load_Glyph' doesn't generate a bitmap for a non-bitmap glyph
- until the user calls `FT_Render_Glyph'. However, it always
- allocates memory for bitmaps and copies or decodes the contents of a
- bitmap glyph, which can be quite slow for PNG data.
-
- * include/freetype/freetype.h (FT_LOAD_BITMAP_METRICS_ONLY): New
- macro.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Unset FT_LOAD_RENDER if
- FT_LOAD_BITMAP_METRICS_ONLY is used.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_alloc_bitmap,
- tt_sbit_decoder_load_bitmap): Add argument to control allocation of
- the glyph slot.
- (tt_sbit_decoder_load_image, tt_sbit_decoder_load_compound,
- tt_face_load_sbit_image): Updated.
-
- * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Quickly exit if
- `FT_LOAD_BITMAP_METRICS_ONLY' is set.
-
- * src/pfr/pfrsbit.c, src/pfr/pfrsbit.h (pfr_slot_load_bitmap): Add
- argument to control allocation of the glyph slot.
- * src/pfr/pfrobjs (pfr_slot_load): Updated.
-
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Ditto.
-
- * docs/CHANGES: Updated.
-
-2016-11-06 Werner Lemberg <wl@gnu.org>
-
- Synchronize with gnulib (#49448).
-
- * include/freetype/config/ftconfig.h, builds/unix/ftconfig.in,
- builds/vms/ftconfig.h (FT_TYPEOF): Update code to use definition in
- current version of `intprops.h'.
- Other minor synchronization to reduce code differences between the
- three files.
-
-2016-11-03 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] Clamp variation requests to valid range.
-
- This is required by OpenType 1.8; it also avoids rounding surprises.
-
- * src/truetype/ttgxvar.c (TT_Set_Var_Design): Clamp design coordinates
- outside of the allowed range to always stay within the range instead
- of producing an error.
-
-2016-10-29 Werner Lemberg <wl@gnu.org>
-
- [truetype] Remove clang warnings.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): Using `FT_ULong' for
- loop counter handling.
-
- * src/truetype/ttinterp.c: Updated.
- (Ins_SCANTYPE): Use signed constant.
- (TT_RunIns): Ensure `num_twilight_points' is 16bit.
-
-2016-10-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix commit from 2014-11-24.
-
- Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
-
- * src/truetype/ttpload.c (tt_face_load_hdmx): Fix file checking
- logic.
-
-2016-10-26 Werner Lemberg <wl@gnu.org>
-
- Add `FT_Get_{MM,Var}_Blend_Coordinates' functions.
-
- * include/freetype/ftmm.h: Declare.
-
- * include/freetype/internal/services/svmm.h (FT_Get_MM_Blend_Func):
- New typedef.
- (MultiMasters): New MM service function `get_mm_blend'.
- (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
- Update all callers.
-
- * src/base/ftmm.c (FT_Get_MM_Blend_Coordinates,
- FT_Get_Var_Blend_Coordinates): Implement.
-
- * src/truetype/ttdriver.c: Updated.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Blend): New function to handle
- `get_mm_blend' service.
- * src/truetype/ttgxvar.h: Updated.
-
- * src/type1/t1driver.c: Updated.
-
- * src/type1/t1load.c (T1_Get_MM_Blend): New function to handle
- `get_mm_blend' service.
- * src/type1/t1load.h: Updated.
-
- * docs/CHANGES: Document.
-
-2016-10-26 Werner Lemberg <wl@gnu.org>
-
- * src/type1/t1load.c (parse_subrs): Fix limit check.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=81
-
-2016-10-25 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [cff] Correct cmap format reporting (#24819).
-
- * src/cff/cffdrivr.c (cff_get_cmap_info): Throw an error on synthetic
- charmap instead of guessing its format and language.
-
-2016-10-22 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix SCANTYPE instruction (#49394).
-
- * src/truetype/ttinterp.c (Ins_SCANTYPE): Only use lower 16bits.
-
-2016-10-22 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Improve handling of invalid post 2.5 tables [#49393].
-
- * src/sfnt/ttpost.c (load_format_25): We need at least a single
- table entry.
-
-2016-10-14 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix handling of `cvar' table data.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=53
-
- * src/truetype/ttgxvar.c (tt_face_vary_cvt): Ignore invalid CVT
- indices.
-
-2016-10-11 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix handling of invalid flex subrs.
-
- Problem reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- <op_callothersubr>: Set `flex_state' after error checking.
-
-2016-10-11 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (tt_done_blend): Fix deallocation.
-
-2016-10-08 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidload.c (cid_face_open): Properly propagate `error'.
-
-2016-10-08 Werner Lemberg <wl@gnu.org>
-
- [cid] Fix parsing of subr offsets.
-
- Bug introduced 2016-05-16.
-
- * src/cid/cidparse.c (cid_parser_new): Fix off-by-one error.
-
-2016-10-01 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Disable bitmap strikes if we don't have a bitmap data table.
-
- * src/sfnt/ttsbit.c (tt_face_load_sbit): Check whether we have
- a bitmap data table.
-
-2016-10-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Remove impossibility.
-
- * src/smooth/ftgrays.c (TWorker): Rearrange fields.
- (gray_convert_glyph): Remove impossible condition and clean up.
-
-2016-09-29 Werner Lemberg <wl@gnu.org>
-
- [pcf] Enrich family name with foundry name and glyph width info.
-
- This is a very old patch from openSuSE (from 2006, submitted to
- FreeType in 2011) that I forgot to apply.
-
- https://build.opensuse.org/package/view_file/openSUSE:Factory/freetype2/freetype2-bitmap-foundry.patch
-
- Prepend the foundry name plus a space to the family name. There are
- many fonts just called `Fixed' which look completely different, and
- which have nothing to do with each other. When selecting `Fixed' in
- KDE or Gnome one gets results that appear rather random, the style
- changes often if one changes the size and one cannot select some
- fonts at all.
-
- We also check whether we have `wide' characters; all put together,
- we get family names like `Sony Fixed' or `Misc Fixed Wide'.
-
- * src/pcf/pcfread.c (pcf_load_font): Implement it.
-
- * docs/CHANGES: Document it.
-
-2016-09-29 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Speed up.
-
- * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Don't
- check for embedded bitmaps if we have a non-default instance.
-
-2016-09-29 Werner Lemberg <wl@gnu.org>
-
- [truetype] Disallow bitmap strikes for non-default instances.
-
- Also speed up access of default instances if GX variations are
- active.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Add
- `is_default_instance' member.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Initialize
- `is_default_instance'.
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
- load_truetype_glyph): Add test for default instance.
- (TT_Load_Glyph): Load embedded bitmaps for default instance only.
-
- * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Compute
- `is_default_instance'.
-
-2016-09-29 Werner Lemberg <wl@gnu.org>
-
- [truetype] Clean up `TT_Face' structure.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Remove unused
- fields `horz_metrics' and `vert_metrics'.
- Update documentation.
-
- * src/sfnt/sfobjs.c (sfnt_done_face): Updated.
-
-2016-09-28 Werner Lemberg <wl@gnu.org>
-
- More FT_ZERO usage.
-
- * src/gxvalid/gxvcommn.c (gxv_ClassTable_validate):
- s/ft_memset/FT_MEM_ZERO/.
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings):
- s/ft_memset/FT_ARRAY_ZERO/.
-
- * src/raster/ftraster.c (FT_ZERO): Define.
- (ft_black_new): Use it.
- * src/raster/ftrend1.c (ft_raster1_get_cbox):
- s/FT_MEM_ZERO/FT_ZERO/.
-
- * src/smooth/ftgrays.c (FT_ZERO): Define.
- (gray_raster_new): Use it.
- * src/smooth/ftsmooth.c (ft_smooth_get_cbox):
- s/FT_MEM_ZERO/FT_ZERO/.
-
-2016-09-28 Werner Lemberg <wl@gnu.org>
-
- */*: s/FT_MEM_ZERO/FT_ZERO/ where appropriate.
-
-2016-09-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Trace number of executed opcodes.
-
- * src/truetype/ttinterp.c (TT_RunIns): Implement it.
-
-2016-09-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Speed up `TT_Load_Glyph'.
-
- This avoids additional calls to `tt_face_lookup_table' for the
- `glyf' table, which can be expensive.
-
- * include/freetype/internal/tttypes.h (TT_LoaderRec): Move
- `glyf_offset' field to ...
- (TT_FaceRec): ... this structure.
- * src/truetype/ttgload.c (load_truetype_glyph): Updated.
- (tt_loader_init): Move initialization of `glyf_offset' to ...
- * src/truetype/ttpload.c (tt_face_load_loca): ... this function.
-
-2016-09-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Introduce dynamic limits for some bytecode opcodes.
-
- This speeds up FreeType's handling of malformed fonts.
-
- * src/truetype/ttinterp.c (TT_RunIns): Set up limits for the number
- of twilight points, the total number of negative jumps, and the
- total number of loops in LOOPCALL opcodes. The values are based on
- the number of points and entries in the CVT table.
- (Ins_JMPR): Test negative jump counter.
- (Ins_LOOPCALL): Test loopcall counter.
-
- * src/truetype/ttinterp.h (TT_ExecContext): Updated.
-
- * docs/CHANGES: Updated.
-
-2016-09-25 Werner Lemberg <wl@gnu.org>
-
- [truetype] Sanitize only last entry of `loca' table.
-
- Without this patch, a loca sequence like `0 100000 0 100000 ...',
- where value 100000 is larger than the `glyf' table size, makes
- FreeType handle the whole `glyf' table as a single glyph again and
- again, which is certainly invalid (and can be very slow, too).
-
- * src/truetype/ttpload.c (tt_face_get_location): Implement.
- Improve tracing messages.
-
-2016-09-25 Werner Lemberg <wl@gnu.org>
-
- * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Fix typo.
-
-2016-09-24 Werner Lemberg <wl@gnu.org>
-
- [autofit] Tracing fixes.
-
- * src/autofit/afmodule.c (af_autofitter_load_glyph): Call dumping
- functions only if we actually do tracing.
-
-2016-09-22 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Reduce divisions in the line renderer.
-
- We don't need some divisions if a line segments stays within a single
- row or a single column of pixels.
-
- * src/smooth/ftgrays.c (gray_render_line) [FT_LONG64]: Make divisions
- conditional.
-
-2016-09-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_sweep): Remove check for empty table.
-
-2016-09-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Another tiny speed-up.
-
- * src/smooth/ftgrays.c (gray_find_cell): Merge into...
- (gray_record_cell): ... this function.
-
-2016-09-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_{find,set}_cell): Remove dubious code.
-
-2016-09-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Fix valgrind warning and reoptimize.
-
- The algorithm calls `gray_set_cell' at the start of each new contour
- or when the contours cross the cell boundaries. Double-checking for
- that is wasteful.
-
- * src/smooth/ftgrays.c (gray_set_cell): Remove check for a new cell.
- (gray_convert_glyph): Remove initialization introduced by 44b172e88.
-
-2016-09-10 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix previous commit.
-
- Problems reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40
-
- We now map the strike index right before accessing the physical
- data, not earlier.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Set `face->sbit_strike_map'
- after creating the map so that...
-
- * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): ... this function
- can be used before and after setting up `sbit_strike_map'.
- (tt_face_set_sbit_strike): Revert change.
- (tt_sbit_decoder_init, tt_face_load_sbix_image): Map strike index.
-
- * src/truetype/ttdriver.c (tt_size_select): Revert change.
-
-2016-09-09 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Minor improvements.
-
- * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Ignore
- invalid strikes.
- Use better values for call to `FT_Set_Char_Size'.
-
-2016-09-09 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Don't provide (completely) broken strike data.
-
- FreeType tries to sanitize strike header data; we now reject
- completely broken ones.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): New
- `sbit_strike_map' array pointer.
-
- * src/base/ftobjs.c (FT_Match_Size): Reject matches where either
- width or height would be zero.
- Add tracing message in case of error.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Populate `sbit_strike_map',
- only using (more or less) valid strike header data for
- FT_Face's `available_sizes' array.
- (sfnt_done_face): Updated.
-
- * src/sfnt/ttsbit.c (tt_face_set_sbit_strike): Use
- `sbit_strike_map'.
- (tt_face_load_strike_metrics): Improve tracing.
-
- * src/truetype/ttdriver.c (tt_size_select): Use `sbit_strike_map'.
-
-2016-09-08 Werner Lemberg <wl@gnu.org>
-
- * Version 2.7 released.
- =======================
-
-
- Tag sources with `VER-2-7'.
-
- * docs/VERSION.TXT: Add entry for version 2.7.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.6.5/2.7/, s/265/27/.
-
- * include/freetype/freetype.h (FREETYPE_MINOR): Set to 7.
- (FREETYPE_PATCH): Set to 0.
-
- * builds/unix/configure.raw (version_info): Set to 18:6:12.
- * CMakeLists.txt (VERSION_MINOR): Set to 7.
- (VERSION_PATCH): Set to 0.
-
- * docs/CHANGES: Updated.
-
-2016-09-08 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c: Include `ttgxvar.h'.
-
- This fixes the `multi' build.
-
-2016-09-08 Werner Lemberg <wl@gnu.org>
-
- [autofit] Another improvement to Armenian support.
-
- Suggested by Hrant H Papazian <hpapazian@gmail.com>.
-
- * src/autofit/afscript.h: Use better suited characters to derive
- default stem widths.
-
-2016-09-07 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_hline): Micro-optimize.
-
-2016-09-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Operate in absolute bitmap coordinates.
-
- Simpler bitmap addressing improves performance by 1.5%.
-
- * src/smooth/ftgrays.c (gray_TWorker): Remove count fields.
- (gray_dump_cells, gray_find_cell, gray_set_cell, gray_hline,
- gray_sweep, gray_convert_glyph, gray_raster_render): Updated.
-
-2016-09-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Improve contour start (take 2).
-
- * src/smooth/ftgrays.c (gray_move_to): Call `gray_set_cell' directly
- instead of...
- (gray_start_cell): ... this function, which is removed.
- (gray_convert_glyph): Make initial y-coordinate invalid.
-
-2016-09-06 Werner Lemberg <wl@gnu.org>
-
- [type1] MM fonts support exactly zero named instances (#48748).
-
- * src/type1/t1load.c (T1_Get_MM_Var): Set `num_namedstyles' to zero.
-
-2016-09-06 Jonathan Kew <jfkthame@gmail.com>
-
- [cff] Fix uninitialized memory.
-
- Problem reported as
-
- https://bugzilla.mozilla.org/show_bug.cgi?id=1270288
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString): Initialize `storage'
- array to handle a `get' opcode without a previous `put'.
-
-2016-09-05 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_move_to, gray_start_cell): Revert.
-
-2016-09-05 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Improve contour start.
-
- * src/smooth/ftgrays.c (gray_move_to): Call `gray_set_cell' directly
- instead of...
- (gray_start_cell): ... this function, which is removed.
-
-2016-09-05 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix memory initialization.
-
- * src/cff/cf2stack.c (cf2_stack_init): Use `FT_NEW'. The `Q'
- variants of FreeType's memory allocation macros don't do zeroing.
-
-2016-09-05 Werner Lemberg <wl@gnu.org>
-
- [ftrandom] Minor improvements.
-
- * src/tools/ftrandom/ftrandom.c (_XOPEN_SOURCE): New macro, set to
- 500.
-
- * src/tools/ftrandom/Makefile (CFLAGS): Split off include
- directories to ...
- (INCLUDES): ... this new variable.
- (LDFLAGS): New variable.
- (ftrandom.o, ftrandom): Updated.
-
-2016-09-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve Armenian support.
-
- Thanks to Hrant H Papazian <hpapazian@gmail.com> for help.
-
- * src/autofit/afblue.dat (AF_BLUE_STRING_ARMENIAN_*): Improve
- selection of characters.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
-2016-09-04 Werner Lemberg <wl@gnu.org>
-
- [ftrandom] Improve Makefile.
-
- It now supports both a normal build (`./configure && make') and a
- development build (`make devel').
-
- * src/tools/ftrandom/Makefile (VPATH): Set it so that
- `libfreetype.a' gets searched in both `objs' (for the development
- build) and `objs/.libs' (for a normal build which uses libtool).
- (LIBS): Add missing libraries.
- (ftrandom.o): New rule.
- (ftrandom): Use automatic variables.
-
-2016-09-03 Werner Lemberg <wl@gnu.org>
-
- [truetype] More fixes for handling of GX deltas.
-
- Problems reported by Bob Taylor <Bob.Taylor@monotype.com>.
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix rough
- sanity test for glyph variation array header size.
- Always set stream position before reading packed x and y deltas.
- Fix thinko w.r.t. `localpoints' array.
-
-2016-09-03 Werner Lemberg <wl@gnu.org>
-
- [ftrandom] Various fixes.
-
- * src/tools/ftrandom/ftrandom.c (GOOD_FONTS_DIR): Provide better
- default.
- (error_fraction): Make it of type `double' to work as advertized –
- this was completely broken.
- Update all related code.
- (error_count, fcnt): Make it unsigned to fix compiler warnings.
- Update all related code.
- (fontlist): Change `len' member to `long' to fix compiler warnings.
- (FT_MoveTo, FT_LineTo, FT_ConicTo, FT_CubicTo, abort_test): Tag
- unused variables.
- (TestFace, FindFonts, copyfont, do_test): Fix compiler warnings.
- (ExecuteTest): Ditto.
- Call `FT_Done_FreeType'.
- (getErrorCnt): Replace `ceil' with an ordinary cast to `unsigned
- int'.
- (usage): Improve output.
- (main): Fix compiler warnings.
-
- * src/tools/ftrandom/README: Updated.
-
-2016-09-03 Werner Lemberg <wl@gnu.org>
-
- [base] Avoid negative bitmap strike dimensions (#48985).
-
- * src/base/ftobjs.c (FT_Open_Face): Check whether negation was
- actually successful. For example, this can fail for value
- -32768 if the type is `signed short'. If there are problems,
- disable the strike.
-
-2016-09-03 Werner Lemberg <wl@gnu.org>
-
- [cff] Avoid null pointer passed to FT_MEM_COPY (#48984).
-
- * src/cff/cffload.c (cff_index_get_name): Check `byte_len'.
-
-2016-09-02 Werner Lemberg <wl@gnu.org>
-
- [unix] Enable 64bit support in file system access (#48962).
-
- * builds/unix/configure.raw: Call `AC_SYS_LARGEFILE'.
-
-2016-09-02 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Avoid left shift of negative value (#48980).
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_bit_aligned): Use unsigned
- constant.
-
-2016-09-02 Werner Lemberg <wl@gnu.org>
-
- * src/smooth/ftgrays.c (gray_hline): Fix clang compiler warnings.
-
-2016-09-02 Werner Lemberg <wl@gnu.org>
-
- Some preparations for the next release.
-
- * include/freetype/config/ftoption.h
- (TT_CONFIG_OPTION_SUBPIXEL_HINTING): Enable.
-
- * docs/CHANGES: Updated.
-
-2016-09-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Simplify span rendering more.
-
- It turns out that there is significant cost associated with `FT_Span'
- creation and calls to `gray_render_span' because it happens so
- frequently. This removes these steps from our internal use but leaves
- it alone for `FT_RASTER_FLAG_DIRECT" to preserve API. The speed gain
- is about 5%.
-
- * src/smooth/ftgrays.c (gray_render_span): Removed. The code is
- migrated to...
- (gray_hline): ... here.
-
-2016-08-30 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Streamline pixmap drawing a bit more.
-
- Zero coverage is unlikely (1 out of 256) to warrant checking. This
- gives 0.5% speed improvement in rendering simple glyphs.
-
- * src/smooth/ftgrays.c (gray_hline, gray_render_span): Remove checks.
-
-2016-08-29 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Streamline pixmap drawing.
-
- This gives 2% speed improvement in rendering simple glyphs.
-
- * src/smooth/ftgrays.c (TPixmap): Reduced pixmap descriptor with a
- pointer to its bottom-left and pitch to be used in...
- (gray_TWorker): ... here.
- (gray_render_span): Move pixmap flow check from here...
- (gray_raster_render): .. to here.
-
-2016-08-27 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Reduce stack of band boundaries.
-
- * src/smooth/ftgrays.c (gray_TBand): Removed.
- (gray_convert_glyph): Updated to stack band boundaries concisely.
-
-2016-08-26 Werner Lemberg <wl@gnu.org>
-
- * src/cid/cidload.c (cid_face_open): Improve handling of `SDBytes'.
-
-2016-08-26 Werner Lemberg <wl@gnu.org>
-
- [cid] Fix commit from 2016-05-16.
-
- * src/cid/cidparse.c (cid_parser_new): Fix off-by-one errors.
-
-2016-08-26 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Cache offset and size to bitmap data table.
-
- This commit avoids `EBDT' and friends being looked up again and
- again while loading a single embedded bitmap.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec)
- [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: New fields `ebdt_start' and
- `ebdt_size'.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_init): Move table lookup to ...
- (tt_face_load_sbit): ... this function; also store the table size
- and offset.
-
-2016-08-26 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_raster_render): Minor tweaks.
-
-2016-08-26 Werner Lemberg <wl@gnu.org>
-
- [type1] Fix heap buffer overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36
-
- * src/type1/t1load.c (parse_charstrings): Reject fonts that don't
- contain glyph names.
-
-2016-08-25 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix previous commit (#48901).
-
- * src/sfnt/ttcmap.c (tt_cmap4_char_map_binary): Thinkos.
-
-2016-08-25 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Speed up handling of invalid format 4 cmaps.
-
- * src/sfnt/ttcmap.c (tt_cmap4_next, tt_cmap4_char_map_binary): Add
- tests for `num_glyph' from `tt_cmap4_char_map_linear'.
-
-2016-08-25 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftdriver.h: Remove unused typedefs.
-
-2016-08-22 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Simplify span rendering.
-
- This removes unnecessary complexity of span merging and buffering.
- Instead, the spans are rendered as they come, speeding up the
- rendering by about 5% as a result.
-
- * src/smooth/ftgrays.c [FT_MAX_GRAY_SPANS]: Macro removed.
- (gray_TWorker): Remove span buffer and related fields.
- (gray_sweep, gray_hline): Updated.
-
- * include/freetype/ftimage.h: Remove documentation note about
- `FT_MAX_GRAY_SPANS', which was never in `ftoption.h' and is now gone.
-
-2016-08-16 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix `MPS' instruction.
-
- According to Greg Hitchcock, MPS in DWrite really returns the point
- size.
-
- * src/truetype/ttobjs.h (TT_SizeRec): Add `point_size' member.
-
- * src/truetype/ttdriver.c (tt_size_request): Set `point_size'.
-
- * src/truetype/ttinterp.h (TT_ExecContextRec): Add `pointSize'
- member.
-
- * src/truetype/ttinterp.c (TT_Load_Context): Updated.
- (Ins_MPS): Fix instruction.
-
-2016-08-16 Werner Lemberg <wl@gnu.org>
-
- [lzw] Optimize last commit.
-
- * src/lzw/ftzopen.c (ft_lzwstate_get_code): Move check into
- conditional clause.
-
-2016-08-16 Werner Lemberg <wl@gnu.org>
-
- [lzw] Avoid invalid left shift.
-
- Reported as
-
- https://bugzilla.mozilla.org/show_bug.cgi?id=1295366
-
- * src/lzw/ftzopen.c (ft_lzwstate_get_code): Limit `num_bits'.
-
-2016-08-16 Werner Lemberg <wl@gnu.org>
-
- [lzw] Avoid buffer overrun.
-
- Reported as
-
- https://bugzilla.mozilla.org/show_bug.cgi?id=1273283
-
- * src/lzw/ftzopen.c (ft_lzwstate_refill): Ensure `buf_size' doesn't
- underflow.
-
-2016-08-16 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix compiler warning.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Add cast.
-
-2016-08-13 Werner Lemberg <wl@gnu.org>
-
- [winfonts] Avoid zero bitmap width and height.
-
- Reported as
-
- https://bugzilla.mozilla.org/show_bug.cgi?id=1272173
-
- * src/winfonts/winfnt.c (FNT_Face_Init): Check zero pixel height.
- (FNT_Load_Glyph): Check for zero pitch.
-
-2016-08-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/truetype/ttinterp.c (Pop_Push_Count): Revert changes.
-
-2016-08-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/truetype/ttinterp.c (TT_RunIns): Minor and formatting.
-
-2016-08-11 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/truetype/ttinterp.c (Pop_Push_Count): Fix some entries.
-
-2016-08-10 Peter Klotz <Peter.Klotz@ith-icoserve.com>
-
- * src/smooth/ftgrays.c (gray_hline): Fix uninitialized access.
-
-2016-08-10 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Use correct type for `italicAngle' field (#48732).
-
- * src/sfnt/ttload.c (tt_face_load_post): Fix types.
-
-2016-08-06 Jon Spencer <jon@jonspencer.ca>
-
- [sfnt] Fix `FT_Get_Advance' for bitmap strikes.
-
- `FT_Get_Advance' returns 0 for bitmap fonts. It first gets the
- advance value from the font table and then scales it by the
- `font->size->metrics->x_scale' field. But `FT_Select_Size' doesn't
- set that value for bitmap fonts and the advance gets scaled to zero.
-
- Taken from
-
- https://github.com/behdad/harfbuzz/issues/252
-
- * src/sfnt/ttsbit.c (tt_face_load_strike_metrics)
- <TT_SBIT_TABLE_TYPE_EBLC>: Set scale values.
-
-2016-08-06 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] Fix GX variation handling of composites.
-
- * src/truetype/ttgload.c (load_truetype_glyph)
- [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Check `ARGS_ARE_XY_VALUES' flag.
-
-2016-08-05 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Minor refactoring.
-
- * src/smooth/ftgrays.c (gray_render_scanline, gray_render_line):
- Updated.
-
-2016-07-29 Werner Lemberg <wl@gnu.org>
-
- [sfnt, truetype] Don't abort on invalid `maxComponentDepth'.
-
- Since 2016-05-16 we detect infinite recursion directly.
-
- * src/sfnt/ttload.c (tt_face_load_maxp): Don't adjust
- `maxComponentDepth'.
- * src/truetype/ttgload.c (load_truetype_glyph): Don't abort if
- `maxComponentDepth' is not valid. Instead, simply adjust its value
- and emit a tracing message.
-
-2016-07-26 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_metrics_scale_dim): Minor.
-
- No functional change.
-
-2016-07-22 Hin-Tak Leung <htl10@users.sourceforge.net>
-
- [truetype] Record the end of IDEFs.
-
- To match the logic in FDEF. The value of the end is only used for
- bound-checking in `Ins_JMPR', so it may not have been obvious that
- it was not recorded. Tested (as part of Font Validator 2.0) all the
- fonts on Fedora and did not see any change.
-
- * src/truetype/ttinterp.c (Ins_IDEF): Updated.
-
-2016-07-19 Werner Lemberg <wl@gnu.org>
-
- [truetype] Sanitizer fix, second try.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary
- tests and use only one slot more.
-
-2016-07-19 Werner Lemberg <wl@gnu.org>
-
- [truetype] Sanitizer fix.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Increase array
- to fix nested loops.
-
-2016-07-18 Werner Lemberg <wl@gnu.org>
-
- [truetype] Make GETDATA work only for GX fonts.
-
- * src/truetype/ttinterp.c (opcode_name): Updated.
- (Ins_GETDATA): Only define for `TT_CONFIG_OPTION_GX_VAR_SUPPORT'.
- (TT_RunIns): Updated.
-
-2016-07-17 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add support for Apple's
-
- GETDATA[], opcode 0x92
-
- bytecode instruction. It always returns 17, and we have absolutely
- no idea what it is good for...
-
- * src/truetype/ttinterp.c (Pop_Push_Count, opcode_name): Updated.
- (Ins_GETDATA): New function.
- (TT_RunIns): Add it.
-
-2016-07-16 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add bytecode support for GX variation fonts.
-
- This commit implements undocumented (but confirmed) stuff from
- Apple's old bytecode engine.
-
- GETVARIATION[], opcode 0x91
- This opcode pushes normalized variation coordinates for all axes
- onto the stack (in 2.14 format). Coordinate of first axis gets
- pushed first.
-
- GETINFO[], selector bit 3
- If GX variation support is enabled, bit 10 of the result is set
- to 1.
-
- * src/truetype/ttinterp.c: Include FT_MULTIPLE_MASTERS_H.
- (opcode_name) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Updated.
- (Ins_GETINFO) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Handle selector
- bit 3, checking support for variation glyph hinting.
- (Ins_GETVARIATION) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: New function
- to implement opcode 0x91.
- (TT_RunIns) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Handle opcode 0x91.
-
-2016-07-16 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix GETINFO bytecode instruction.
-
- * src/truetype/ttinterp.c (Ins_GETINFO): Fix return value for
- stretching information.
-
-2016-07-16 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] Make all glyphs in `Zycon' GX font work.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints): Fix boundary
- tests.
-
-2016-07-16 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix GX delta tracing.
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Trace
- relative point movements.
-
-2016-07-16 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] More fixes for GX.
-
- This finally fixes the rendering of the cyclist and the lizard in
- the `Zycon' font.
-
- * src/truetype/ttgxvar.c (ft_var_readpackedpoints): `first' point
- index is always cumulative.
-
- (tt_handle_deltas): Rename to...
- (tt_interpolate_deltas): ... This.
- Add new parameter for output point array.
- Update caller.
-
- (TT_Vary_Apply_Glyph_Deltas): Add `points_out' array; it now holds
- the intermediate results of `tt_interpolate_deltas' that are to be
- added to `outline->points'.
-
-2016-07-15 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments): Thinko.
-
- `max_pos' is always larger than `min_pos' so `FT_ABS' is not needed.
-
- Reported by Alexei.
-
-2016-07-16 Nikolaus Waxweiler <madigens@gmail.com>
-
- * src/truetype/ttinterp.c (Ins_MIRP): Fix copy-and-paste error.
-
- Problem reported by Hin-Tak Leung.
-
-2016-07-15 Werner Lemberg <wl@gnu.org>
-
- [autofit] Update and improve segment and edge tracing.
-
- * src/autofit/afhints.c (af_glyph_hints_dump_segments): Trace
- `delta' also.
- Don't show first point of segment as a replacement for `pos'; this
- is (a) misleading, since the difference to `pos' can be almost
- arbitrarily large in corner cases, and (b) it is better to have all
- segment data in font units instead of a single value given in output
- space coordinates.
- Improve layout.
- (af_glyph_hints_dump_edges): Show px->units and units->px conversion
- values for convenience.
- Improve layout.
-
-2016-07-15 Werner Lemberg <wl@gnu.org>
-
- [autofit] For edges, reject segments wider than 1px (#41334).
-
- * src/autofit/afhints.h (AF_SegmentRec): New member `delta'.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments): Compute
- `delta'.
- (af_latin_hints_compute_edges): Reject segments with a delta larger
- than 0.5px.
-
-2016-07-14 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FT_IS_NAMED_INSTANCE): New macro.
-
-2016-07-14 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix `face_index' value in `FT_Face' for named instances.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Don't strip off higher 16bits.
-
-2016-07-14 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix tracing.
-
-2016-07-14 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] Fix gxvar delta interpolation.
-
- The coordinates of the base font should be used for interpolation
- purposes, NOT the current points (i.e., the result of accumulation
- of previous deltas).
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Initialize
- `points_org' before looping over all tuples.
-
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2016-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/ChangeLog.28 b/freetype/ChangeLog.28
deleted file mode 100644
index b17a751d..00000000
--- a/freetype/ChangeLog.28
+++ /dev/null
@@ -1,3136 +0,0 @@
-2017-09-16 Werner Lemberg <wl@gnu.org>
-
- * Version 2.8.1 released.
- =========================
-
-
- Tag sources with `VER-2-8-1'.
-
- * docs/VERSION.TXT: Add entry for version 2.8.1.
- * docs/CHANGES: Updated.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.8/2.8.1/, s/28/281/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
- * builds/unix/configure.raw (version_info): Set to 21:0:15.
- * CMakeLists.txt (VERSION_PATCH): Set to 1.
-
-2017-09-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [sfnt] lowest gcc for vectors (e1d0249e) is changed to 4.7.
-
- __builtin_shuffle() was introduced in gcc-4.7. The lowest
- gcc to enable vector operation is delayed from 4.6 to 4.7.
-
- * src/sfnt/pngshim.c (premultiply_data): Fix cpp-macro to
- enable the vector operation, to change the lowest gcc version
- from 4.6 to 4.7.
-
-2017-09-13 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [cache] Fix a possible overflow by signed integer comparison.
-
- Improve the code by 5d3ff05615dda6d1325ed612381a17a0df04c975 ,
- issues are found by Behdad Esfahbod and Werner Lemberg.
-
- * src/cache/ftcbasic.c (FTC_ImageCache_Lookup): Replace
- a subtraction to check higher bit by a bit operation,
- and cpp-conditionalize for appropriate systems. Add better
- documentation to the comment.
- (FTC_ImageCache_LookupScaler): Ditto.
- (FTC_SBitCache_Lookup): Ditto.
- (FTC_SBitCache_LookupScaler): Ditto.
-
-2017-09-13 Werner Lemberg <wl@gnu.org>
-
- [autofit] Really fix #41334 (#52000).
-
- * src/autofit/aflatin.c (af_latin_hints_compute_segments): Set
- `segment->delta' everywhere.
-
-2017-09-12 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [autofit, sfnt] Fix for `make multi'.
-
- * src/autofit/afshaper.c: Include FT_ADVANCE_H, to use
- FT_Get_Advance() in it.
- * src/sfnt/ttcmap.c: Include FT_SERVICE_POSTSCRIPT_CMAPS_H
- to use PS_Unicodes in it, also include `ttpost.h' to use
- tt_face_get_ps_name() in it.
-
-2017-09-11 Azzuro <azzuro@team-mediaportal.com>
-
- [build] Improve builds with different MS Visual Studio versions.
-
- * builds/windows/vc2010/freetype.vcxproj: Switch platform toolset
- according to the Visual Studio version.
-
-2017-09-11 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttkern.c (tt_face_load_kern): Reject format 2 tables.
-
- Reported by Behdad.
-
-2017-09-09 Werner Lemberg <wl@gnu.org>
-
- [autofit] Improve communication with ftgrid.
-
- * src/autofit/afhints.c (af_glyph_hints_get_segment_offset):
- Provide values in font units.
-
-2017-09-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [base] Remove a check for resource ID in the resource fork driver.
-
- LastResort.dfont has a marginal resource ID 0xFFFF for sfnt
- resource. Inside Macintosh: More Macintosh Toolbox, `Resource IDs'
- (1-46), tells that some IDs are reserved and should not be used.
- FreeType2 just uses resource ID to sort the fragmented resource.
- To accept the marginal fonts, the checking is removed.
-
- * src/base/ftrfork.c (FT_Raccess_Get_DataOffsets): Remove res_id
- validity check, fix a trace message format.
-
-2017-09-08 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [sfnt, truetype] Register the tags for marginal fonts.
-
- The first 32bit of standard TrueType variants is 0x00010000,
- `OTTO', `ttcf', `true' or `typ1'. 2 marginal dfonts on legacy Mac
- OS X, Keyboard.dfont and LastResort.dfont, have the sfnt resources
- starting 0xA5 followed by `kbd' or `lst'. Considering the following
- data could be parsed as conventional TrueType fonts, the header
- checking is updated to allow these tags. It seems that recent Mac
- OS X has already switched to normal TTF for these fonts.
-
- See the discussion at
- http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3931.0
-
- * include/freetype/tttags.h (TTAG_0xA5kbd, TTAG_0xA5lst): New header
- tags for Keyboard.dfont and LastResort.dfont.
- * src/sfnt/sfobjs.c (sfnt_open_font): Accept the sfnt resource
- starts with TTAG_0xA5kbd or TTAG_0xA5lst.
- * src/truetype/ttobjs.c (tt_face_init): Accept the face with the
- format tag is TTAG_0xA5kbd or TTAG_0xA5lst.
-
-2017-09-05 Werner Lemberg <wl@gnu.org>
-
- Fix multiple calls of `FT_Bitmap_Convert'.
-
- The documentation of `FT_Bitmap_Convert' says that multiple calls do
- proper reallocation of the target FT_Bitmap object. However, this
- failed for the sequence
-
- non-empty bitmap
- empty bitmap
- non-empty bitmap
-
- Reason was that `FT_Bitmap_Convert' only reallocated the bitmap
- buffer if it became too small; it didn't make the buffer smaller.
- For an empty bitmap following a non-empty one, only the buffer
- dimension got set to zero, without deallocation. If the next call
- was a non-empty buffer again, an assertion in `ft_mem_qrealloc' was
- triggered.
-
- * src/base/ftbitmap.c (FT_Bitmap_Convert): Always reallocate target
- buffer to the correct size.
-
- * docs/CHANGES: Document it.
-
-2017-09-05 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix size and resolution handling.
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Use `SIZE' values if
- `POINT_SIZE', `RESOLUTION_X', or `RESOLUTION_Y' properties are
- missing.
-
- * docs/CHANGES: Document it.
-
-2017-08-25 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Swap `ALLOC_MULT' arguments (#51833).
-
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Updated.
- * src/winfonts/winfnt.c (FNT_Load_Glyph): Updated.
- * src/raster/ftrend1.c (ft_raster1_render): Updated.
-
-2017-08-23 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix clang compilation (#51788).
-
- * src/sfnt/pngshim.c (premultiply_data): Use vectors instead of
- scalars.
- (vector_shuffle): New macro to take care of a different built-in
- function name on clang.
-
-2017-08-22 Werner Lemberg <wl@gnu.org>
-
- [base] Don't zero out allocated memory twice (#51816).
-
- Patch applied from bug report.
-
- * src/base/ftutil.c (ft_mem_qrealloc): Use low-level allocation to
- avoid unnecessary overhead.
-
-2017-08-22 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflow.
-
- Changes triggered by
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3107
-
- * src/truetype/ttinterp.c (Ins_MDRP, Ins_MIRP, Ins_ALIGNPTS): Use
- NEG_LONG.
-
-2017-08-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [sfnt] Avoid synthetic unicode for symbol fonts with PUA.
-
- Reported as
-
- https://bugs.chromium.org/p/chromium/issues/detail?id=754574
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Check for FT_ENCODING_MS_SYMBOL.
-
-2017-08-16 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/pngshim.c (premultiply_data): Fix compiler warnings.
-
-2017-08-15 Behdad Esfahbod <behdad@behdad.org>
-
- [sfnt] Speed up PNG image loading.
-
- This reduces the overhead of `premultiply_data' by 60%.
-
- * src/sfnt/pngshim.c (premultiply_data): Provide code which uses
- gcc's (and clang's) `vector_byte' attribute to process 4 pixels at a
- time.
-
-2017-08-11 Werner Lemberg <wl@gnu.org>
-
- [sfnt, truetype] Improve handling of missing sbits.
-
- Requested by Behdad.
-
- Modern bitmap-only SFNTs like `NotoColorEmoji.ttf' don't contain
- entries in the bitmap strike(s) for empty glyphs. Instead, they
- rely that a space glyph gets created from the font's metrics data.
- This commit makes FreeType behave accordingly.
-
- * include/freetype/fterrdef.h (FT_Err_Missing_Bitmap): New error
- code.
-
- * src/sfnt/ttsbit.c (tt_sbit_decoder_load_image): Change error codes
- to make a distinction between a missing bitmap in a composite and a
- simple missing bitmap.
-
- * src/truetype/ttgload.c (TT_Load_Glyph): For a missing bitmap (in a
- bitmap-only font), synthesize an empty bitmap glyph if metrics are
- available.
-
-2017-08-10 Werner Lemberg <wl@gnu.org>
-
- [base] Minor API improvement for default variation axis setting.
-
- * src/base/ftmm.c (FT_Set_MM_Design_Coordinates,
- FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates,
- FT_Set_Var_Blend_Coordinates): Allow coords==NULL if num_coords==0.
-
- * docs/CHANGES: Updated.
-
-2017-08-08 Werner Lemberg <wl@gnu.org>
-
- [psnames] Really fix issue #49949.
-
- We now use a separate preprocessor macro to handle both definition
- and declaration of the glyph name arrays.
-
- * src/psnames/psmodule.c (DEFINE_PS_TABLE_DATA): New macro.
-
- * src/tools/glnames.py (StringTable::dump,
- StringTable::dump_sublist): Use `DEFINE_PS_TABLE_DATA'.
- (dump_encoding): Ditto.
- (main): Use `wb' mode for writing the output file, which works on
- Windows also.
-
- * src/psnames/pstables.h: Regenerated.
-
-2017-08-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Harmony LCD rendering.
-
- This is a new technology for LCD-optimized rendering. It capitalizes
- on the fact that each color channel grid is shifted by a third of a
- pixel. Therefore it is logical to render 3 separate monochrome
- bitmaps shifting the outline by 1/3 pixel, and then combine them.
- Importantly, the resulting output does not require additional LCD
- filtering.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic)
- [!FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Implement new LCD-optimized
- rendering.
-
- * include/freetype/ftlcdfil.h, include/freetype/freetype.h,
- include/freetype/config/ftoption.h, devel/ftoption.h: Updated
- documentation.
-
-2017-08-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Clean up.
-
-2017-08-08 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/sfnt/ttpost.c (format): Use otspec-compliant versions.
-
-2017-08-05 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2868
-
- * src/truetype/ttinterp.c (Ins_ALIGNRP): Use NEG_LONG.
-
-2017-08-05 Werner Lemberg <wl@gnu.org>
-
- [base, truetype] New function `FT_Get_Var_Axis_Flags'.
-
- The reserved `flags' field got a value in OpenType version 1.8.2;
- unfortunately, the public `FT_Var_Axis' structure misses the
- corresponding element. Since we can't add a new field, we add an
- access function.
-
- * src/base/ftmm.c (FT_Get_Var_Axis_Flags): New function.
-
- * include/freetype/ftmm.h (FT_VAR_AXIS_FLAG_HIDDEN): New macro.
- Updated.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Increase allocated memory
- of `mmvar' to hold axis flags.
- Fill the axis flags array.
-
- * docs/CHANGES: Updated.
-
-2017-08-03 Nikolaus Waxweiler <madigens@gmail.com>
-
- [truetype] Fix metrics of B/W hinting in v40 mode.
-
- Phantom points are now saved outside v40 backwards compatibility
- mode. This fixes the jumping glyphs when switching between v35 and
- v40 monochrome mode.
-
- * src/truetype/ttgload.c (TT_Hint_Glyph): Fix inversed bool logic.
-
-2017-08-03 Nikolaus Waxweiler <madigens@gmail.com>
-
- [truetype] Do not set any ClearType flags in v40 monochrome mode.
-
- This fixes weird behavior of instructions that resulted in rendering
- differences between v35 and v40 in monochrome mode, e.g., in
- `timesbi.ttf'.
-
- * src/truetype/ttinterp.c (Ins_GETINFO)
- [TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL]: Check
- `subpixel_hinting_lean'.
-
-2017-08-01 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Fix thinko.
-
-2017-08-01 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] Fix loading of named instances.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Preserve file position
- while loading the `avar' table.
-
-2017-08-01 Werner Lemberg <wl@gnu.org>
-
- [sfnt, truetype] Minor adjustments for OpenType 1.8.2.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): The units per EM value has now
- (tighter) limits.
-
- * src/truetype/ttgload.c (load_truetype_glyph): The new OpenType
- version explicitly allows all negative values for the number of
- contours if we have a composite glyph (this is for better backwards
- compatibility I guess), but it still recommends value -1.
-
-2017-07-26 Werner Lemberg <wl@gnu.org>
-
- [cff] Integer overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2738
-
- * src/cff/cf2hints.c (cf2_glyphpath_computeOffset,
- cf2_glyphpath_curveTo): Use ADD_INT32.
-
-2017-07-13 Werner Lemberg <wl@gnu.org>
-
- [base] Fix memory leak.
-
- Reported as
-
- https://bugs.chromium.org/p/chromium/issues/detail?id=738362
-
- * src/base/ftglyph.c (FT_Get_Glyph): Do proper deallocation in case
- of error.
-
-2017-07-12 Werner Lemberg <wl@gnu.org>
-
- [base] Integer overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2573
-
- * src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Use
- FT_PIX_CEIL_LONG and FT_PIX_ROUND_LONG.
-
-2017-07-12 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttpload.c (tt_face_get_location): Off-by-one typo.
-
- Also improve tracing message.
-
- Problem reported as
-
- https://bugs.chromium.org/p/chromium/issues/detail?id=738919
-
-2017-07-07 Werner Lemberg <wl@gnu.org>
-
- [cff] Integer overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2517
-
- * src/cff/cf2blues.c (cf2_blues_capture): Use SUB_INT32.
-
-2017-07-05 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttcmap.c (tt_cmap_unicode_class_rec): Fix warning.
-
-2017-07-05 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (FT_Stream_SeekSet): Fix warning (#51395).
-
-2017-07-04 Werner Lemberg <wl@gnu.org>
-
- [truetype] Prevent address overflow (#51365).
-
- * src/truetype/ttgxvar.c (FT_Stream_SeekSet): Add guard.
-
-2017-07-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftlcdfil.c (ft_lcd_filter_fir): Improve code.
-
-2017-07-03 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2455
-
- * src/truetype/ttinterp.c (Ins_SCFS): Use SUB_LONG.
-
-2017-07-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Ignore No_Unicode_Glyph_Name.
-
-2017-06-28 Ben Wagner <bungeman@google.com>
-
- Avoid Microsoft compiler warnings (#51331).
-
- While clang's sanitizer recommends a cast to unsigned for safe
- negation (to handle -INT_MIN), both MSVC and Visualc emit warning
- C4146 if an unsigned value gets negated.
-
- * include/freetype/internal/ftcalc.h (NEG_LONG, NEG_INT32),
- src/base/ftcalc.c (FT_MOVE_SIGN): Replace negation with a
- subtraction.
-
-2017-06-27 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffparse.c (do_fixed): Fix typo.
-
- Spotted by chris <chris@gcjd.org>.
-
-2017-06-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2384
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2391
-
- * src/base/ftcalc.c (FT_MulDiv, FT_MulDiv_No_Round, FT_DivFix): Use
- NEG_LONG.
-
- * src/truetype/ttinterp.c (Ins_SxVTL): Use NEG_LONG.
-
-2017-06-24 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2364
-
- * src/truetype/ttinterp.c (Ins_ISECT): Use NEG_LONG.
-
-2017-06-22 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2323
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2328
-
- * src/cff/cf2blues.c (cf2_blues_capture): Use ADD_INT32 and
- SUB_INT32.
-
- * src/truetype/ttinterp.c (Ins_SDPVTL): Use SUB_LONG and NEG_LONG.
-
-2017-06-21 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [sfnt] Synthesize a Unicode charmap if one is missing.
-
- * src/sfnt/ttcmap.h (tt_cmap_unicode_class_rec): Declare it.
- * src/sfnt/ttcmap.c (tt_get_glyph_name, tt_cmap_unicode_init,
- tt_cmap_unicode_done, tt_cmap_unicode_char_index,
- tt_cmap_unicode_char_next, tt_cmap_unicode_class_rec): Implement
- synthetic Unicode charmap class.
- (tt_get_cmap_info): Make sure the callback is available.
-
- * src/sfnt/sfobjs.c (sfnt_load_face)
- [FT_CONFIG_OPTION_POSTSCRIPT_NAMES]: If Unicode charmap is missing,
- synthesize one.
-
- * include/freetype/config/ftoption.h: Document it.
- * devel/ftoption.h: Ditto.
-
-2017-06-20 Tony Theodore <tonyt@logyst.com>
-
- Fix pkg-config in freetype-config for cross-compiling (#51274).
-
- * builds/unix/unix-def.in (PKG_CONFIG): New variable.
- (freetype-config): Use it in sed expression.
-
- * builds/unix/freetype-config.in: s/pkg-config/%PKG_CONFIG%/.
-
-2017-06-20 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2300
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2313
-
- * src/cff/cf2hints.c (cf2_hintmap_adjustHints): Use ADD_INT32.
-
- * src/truetype/ttinterp.c (Ins_ABS): Avoid FT_ABS.
-
-2017-06-17 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base, smooth] LCD filtering cleanups.
-
- * src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy):
- Clean up, start filtering from the bottom-left origin.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Updated.
-
-2017-06-16 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2270
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2276
-
- * src/truetype/ttinterp.c (Ins_MDRP, _iup_worker_interpolate): Use
- ADD_LONG and SUB_LONG.
-
-2017-06-15 Werner Lemberg <wl@gnu.org>
-
- [bdf, cff] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2244
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2261
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Replace calls to FT_ABS with
- direct code to avoid value negation.
-
- * src/cff/cf2blues.c (cf2_blues_capture): Use SUB_INT32 and
- ADD_INT32.
-
-2017-06-13 Werner Lemberg <wl@gnu.org>
-
- * src/winfonts/winfnt.c (FNT_Face_Init): Don't set active encoding.
-
- FreeType only sets a default active encoding for Unicode.
-
-2017-06-13 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2216
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2218
-
- * src/cff/cf2fixed.h (cf2_fixedAbs): Use NEG_INT32.
-
- * src/truetype/ttinterp.c (Ins_IP): Use SUB_LONG.
-
-2017-06-11 Werner Lemberg <wl@gnu.org>
-
- [cff] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2200
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2210
-
- * src/cff/cf2hints.c (cf2_hintmap_insertHint): Use SUB_INT32 and
- ADD_INT32.
-
- * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdVMOVETO>: Use
- ADD_INT32.
-
-2017-06-10 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix TT_Set_Var_Design.
-
- Reported by Nikolaus Waxweiler <madigens@gmail.com>.
-
- * src/truetype/ttgxvar.c (TT_Set_Var_Design): Correctly handle the
- case where we have less input coordinates than axes.
-
-2017-06-10 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftcalc.c (FT_DivFix): Fix embarrassing typo.
-
- Bug introduced 2017-05-28.
-
-2017-06-09 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2144
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2151
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2153
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2173
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2186
-
- * src/cff/cf2blues.c (cf2_blues_init): Use SUB_INT32.
-
- * src/truetype/ttinterp.c (Round_None, Round_To_Grid,
- Round_To_Half_Grid, Round_Down_To_Grid, Round_Up_To_Grid,
- Round_To_Double_Grid, Round_Super, Round_Super_45): Use ADD_LONG,
- SUB_LONG, NEG_LONG, FT_PIX_ROUND_LONG, FT_PIX_CEIL_LONG,
- FT_PAD_ROUND_LONG
- (Ins_SxVTL, Ins_MIRP): Use SUB_LONG.
- (_iup_worker_shift): Use SUB_LONG and ADD_LONG.
-
-2017-06-09 Werner Lemberg <wl@gnu.org>
-
- Provide more macros for flooring, ceiling, and rounding.
-
- These versions don't produce run-time errors due to integer
- overflow.
-
- * include/freetype/internal/ftobjs.h: Include FT_INTERNAL_CALC_H.
- (FT_PAD_ROUND_LONG, FT_PAD_CEIL_LONG, FT_PIX_ROUND_LONG,
- FT_PIX_CEIL_LONG): New macros.
- (FT_PAD_ROUND_INT32, FT_PAD_CEIL_INT32, FT_PIX_ROUND_INT32,
- FT_PIX_CEIL_INT32): New macros.
-
-2017-06-09 Werner Lemberg <wl@gnu.org>
-
- Remove unused macros.
-
- * include/freetype/internal/ftcalc.h (ADD_INT, SUB_INT, MUL_INT,
- NEG_INT): Deleted.
-
-2017-06-09 Werner Lemberg <wl@gnu.org>
-
- */*: Remove `OVERFLOW_' prefix.
-
- This increases readability.
-
-2017-06-07 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2133
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2137
-
- * src/cff/cf2hints.c (cf2_hint_init): Use OVERFLOW_SUB_INT32.
-
- * src/truetype/ttinterp.c (PROJECT, DUALPROJ): Use
- OVERFLOW_SUB_LONG.
-
-2017-06-06 Werner Lemberg <wl@gnu.org>
-
- [cff] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2109
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2110
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2122
-
- * src/cff/cf2blues.c (cf2_blues_init): Use OVERFLOW_SUB_INT32.
-
- * src/cff/cf2hints.c (cf2_hintmap_map): Synchronize if-else
- branches.
-
-2017-06-05 Werner Lemberg <wl@gnu.org>
-
- [cff] Integer overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2089
-
- * src/cff/cffload.c (cff_blend_doBlend): User OVERFLOW_ADD_INT32.
-
-2017-06-04 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2075
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2088
-
- * src/cff/cf2font.c (cf2_font_setup): Use OVERFLOW_MUL_INT32.
-
- * src/truetype/ttinterp.c (Ins_ISECT): Use OVERFLOW_MUL_LONG,
- OVERFLOW_ADD_LONG, and OVERFLOW_SUB_LONG.
-
-2017-06-03 Werner Lemberg <wl@gnu.org>
-
- [base, cff, truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2060
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2062
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2063
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2068
-
- * src/base/ftobjs.c (ft_glyphslot_grid_fit_metrics): Use
- OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG.
-
- * src/cff/cf2blues.c (cf2_blues_capture), src/cff/cf2hints.c
- (cf2_hintmap_adjustHints): Use OVERFLOW_SUB_INT32.
-
- * src/truetype/ttgload.c (compute_glyph_metrics): User
- OVERFLOW_SUB_LONG.
-
- * src/truetype/ttinterp.c (Direct_Move, Direct_Move_Orig,
- Direct_Move_X, Direct_Move_Y, Direct_Move_Orig_X,
- Direct_Move_Orig_Y, Move_Zp2_Point, Ins_MSIRP): Use
- OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG.
-
-2017-06-03 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/freetype-config.in: Fix pkg-config test (#51162).
-
- Patch directly taken from bug report.
-
-2017-06-03 Werner Lemberg <wl@gnu.org>
-
- [bdf] Synchronize sanity checks with pcf driver.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2054
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2058
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Check font ascent and descent.
- Check AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE, RESOLUTION_X, and
- RESOLUTION_Y properties.
-
-2017-06-03 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2047
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2057
-
- * src/cff/cf2hints.c (cf2_hintmap_map): Use OVERFLOW_SUB_INT32.
-
- * src/truetype/ttinterp.c (Ins_ADD): Use OVERFLOW_ADD_LONG.
- (Ins_SUB): Use OVERFLOW_SUB_LONG.
- (Ins_NEG): Use NEG_LONG.
-
-2017-06-03 Werner Lemberg <wl@gnu.org>
-
- ftcalc.h: Avoid left-shift of negative numbers.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2055
-
- * include/freetype/internal/ftcalc.h (INT_TO_F26DOT6,
- INT_TO_F2DOT14, INT_TO_FIXED, F2DOT14_TO_FIXED): Use multiplication.
-
-2017-06-02 Werner Lemberg <wl@gnu.org>
-
- [cff] Even more integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2046
-
- * src/cff/cf2intrp.c (cf2_doStems, cf2_interpT2CharString): Use
- OVERFLOW_ADD_INT32.
-
-2017-06-02 Werner Lemberg <wl@gnu.org>
-
- [cff] More integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2032
-
- * src/cff/cf2blues.c (cf2_blues_init): Use OVERFLOW_SUB_INT32.
-
-2017-06-02 Werner Lemberg <wl@gnu.org>
-
- [bdf] Don't left-shift negative numbers.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2031
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init): Use multiplication.
-
-2017-06-02 Werner Lemberg <wl@gnu.org>
-
- [bdf] Fix integer scanning routines.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2029
-
- * src/bdf/bdflib.c (_bdf_atoul, _bdf_atol, _bdf_atous, _bdf_atos):
- Stop scanning if result would overflow.
-
-2017-06-02 Werner Lemberg <wl@gnu.org>
-
- [cff] Fix integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2027
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2028
-
- * src/cff/cf2hints.c (cf2_hintmap_insertHint), src/cff/cf2intrp.c
- (cf2_doFlex): Use OVERFLOW_ADD_INT32 and OVERFLOW_SUB_INT32.
-
-2017-06-01 Werner Lemberg <wl@gnu.org>
-
- [smooth] Some 32bit integer overflow run-time errors.
-
- * src/smooth/ftgrays.c [STANDALONE] (OVERFLOW_ADD_LONG,
- OVERFLOW_SUB_LONG, OVERFLOW_MUL_LONG, NEG_LONG): New macros.
- [!STANDALONE]: Include FT_INTERNAL_CALC_H.
- (gray_render_cubic): Use those macros where appropriate.
-
-2017-06-01 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftglyph.c (FT_Get_Glyph): Check `slot->advance'.
-
-2017-06-01 Werner Lemberg <wl@gnu.org>
-
- [psaux] 32bit integer overflow tun-time errors (#46149).
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings): Use
- OVERFLOW_ADD_LONG and OVERFLOW_SUB_LONG where appropriate.
-
-2017-06-01 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter again.
-
- Problem reported by Marek Kašík <mkasik@redhat.com>.
-
- The problematic font that exceeds the old limit is Padauk-Bold,
- version 3.002, containing bytecode generated by a buggy version of
- ttfautohint.
-
-2017-05-31 Werner Lemberg <wl@gnu.org>
-
- [cff] 32bit integer overflow run-time errors 2/2 (#46149).
-
- This commit handles the new engine.
-
- * include/freetype/internal/ftcalc.h (OVERFLOW_ADD_INT32,
- OVERFLOW_SUB_INT32, OVERFLOW_MUL_INT32, NEG_INT, NEG_LONG,
- NEG_INT32): New macros.
-
- * src/cff/cf2ft.c (cf2_getScaleAndHintFlag): Use OVERFLOW_ADD_INT32.
-
- * src/cff/cf2hints.c (cf2_getWindingMomentum, cf2_hint_init,
- cf2_hintmap_map, cf2_glyphpath_hintPoint,
- cf2_glyphpath_computeIntersection, cf2_glyphpath_computeOffset,
- cf2_glyphpath_lineTo, cf2_glyphpath_curveTo): Use
- OVERFLOW_ADD_INT32, OVERFLOW_SUB_INT32, OVERFLOW_MUL_INT32, and
- NEG_INT32 where appropriate.
-
- * src/cff/cf2intrp.c (cf2_doFlex, cf2_doBlend,
- cf2_interpT2CharString): Ditto.
- Also add some other code where needed to avoid overflow.
-
-2017-05-30 Werner Lemberg <wl@gnu.org>
-
- [cff] 32bit integer overflow run-time errors 1/2 (#46149).
-
- This commit handles the old engine.
-
- * src/cff/cffgload.c: Include FT_INTERNAL_CALC_H.
- (cff_decoder_parse_charstrings): Use OVERFLOW_ADD_LONG and
- OVERFLOW_SUB_LONG where needed.
-
- * src/cff/cffparse.c: Include FT_INTERNAL_CALC_H.
- (power_ten_limits): New static array.
- (do_fixed): Use it to prevent multiplication overflow.
- (cff_parser_run): Use OVERFLOW_ADD_LONG.
-
-2017-05-30 Werner Lemberg <wl@gnu.org>
-
- [psaux] Correctly handle sequences of multiple number signs.
-
- * src/psaux/psconv.c (PS_Conv_Strtol, PS_Conv_ToFixed): Return zero
- if we encounter more than a single sign.
-
-2017-05-29 Werner Lemberg <wl@gnu.org>
-
- [pcf] 32bit integer overflow run-time errors (#46149).
-
- * src/pcf/pcfread.c (pcf_get_accel): Add sanity checks for
- `fontAscent' and `fontDescent'.
- (pcf_load_font): Add sanity checks for global height.
- Add sanity checks for AVERAGE_WIDTH, POINT_SIZE, PIXEL_SIZE,
- RESOLUTION_X, and RESOLUTION_Y properties.
-
-2017-05-29 Werner Lemberg <wl@gnu.org>
-
- Handle some integer overflow run-time errors (#46149, #48979).
-
- This commit (mainly for 32bit CPUs) is the first of a series of
- similar commits to handle known integer overflows. Basically, all
- of them are harmless, since they affect rendering of glyphs only,
- not posing security threats. It is expected that fuzzying will show
- up more overflows, to be fixed in due course.
-
- The idea is to mark places where overflows can occur, using macros
- that simply cast to unsigned integers, because overflow arithmetic
- is well defined in this case. Doing so suppresses run-time errors
- of sanitizers without adding computational overhead.
-
- * include/freetype/internal/ftcalc.h (OVERFLOW_ADD_INT,
- OVERFLOW_SUB_INT, OVERFLOW_MUL_INT, OVERFLOW_ADD_LONG,
- OVERFLOW_SUB_LONG, OVERFLOW_MUL_LONG): New macros.
-
- * src/base/ftcalc.c (FT_RoundFix, FT_CeilFix, FT_Matrix_Multiply,
- FT_Matrix_Multiply_Scaled, FT_Vector_Transform_Scaled,
- ft_corner_orientation): Use new macros.
-
- * src/base/ftoutln.c (FT_Outline_Get_Orientation): Use new macros.
-
-2017-05-28 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/ftcalc.h (FLOAT_TO_FIXED): Remove.
-
- This macro is not used.
-
-2017-05-28 Werner Lemberg <wl@gnu.org>
-
- [cff] s/cf2_floatToFixed/cf2_doubleToFixed/.
-
- The new name better describes what the macro actually does;
- additionally, we don't need a trailing `f' for literals (there was
- only a single such instance in the code, but this caused a clang
- warning because the macro itself uses `double' literals).
-
- * src/cff/cf2blues.c, src/cff/cf2blues.h, src/cff/cf2fixed.h,
- src/cff/cf2font.c, src/cff/cf2hints.c: Updated.
-
-2017-05-28 Werner Lemberg <wl@gnu.org>
-
- Fix negation of INT_MIN and LONG_MIN (#46149).
-
- * src/base/ftcalc.c (FT_MOVE_SIGN): Add argument to pass unsigned
- value, to be used as the result.
- (FT_MulDiv, FT_MulDiv_No_Round, FT_DivFix, FT_MulFix,
- FT_Vector_NormLen): Updated.
-
-2017-05-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix handling of design coordinates (#51127).
-
- * src/truetype/ttgxvar.c (tt_set_mm_blend): Compute all design
- coordinates if we have to create the `blends->coord' array.
- (TT_Get_MM_Blend, TT_Get_Var_Design): Select default instance
- coordinates if no instance is selected yet.
-
-2017-05-24 Werner Lemberg <wl@gnu.org>
-
- [bdf, pcf] Support ISO646.1991-IRV character encoding (aka ASCII).
-
- Problem reported by Marek Kašík <mkasik@redhat.com>, cf.
-
- https://bugzilla.redhat.com/show_bug.cgi?id=1451795
-
- * src/bdf/bdfdrivr.c (BDF_Face_Init), src/pcf/pcfdrivr.c
- (PCF_Face_Init): Implement it.
-
-2017-05-20 Nikolaus Waxweiler <madigens@gmail.com>
-
- [truetype] Always use interpreter v35 for B/W rendering (#51051).
-
- * src/truetype/ttgload.c (tt_loader_init)
- [TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL]: Adjust
- `subpixel_hinting_lean', `grayscale_cleartype', and
- `vertical_lcd_lean' accordingly.
-
- * src/truetype/ttinterp.c (Ins_GETINFO): Updated.
- (TT_RunIns): Update `backward_compatibility' flag.
-
-2017-05-20 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Implement minimal dynamic padding for LCD filtering.
-
- Extra bitmap padding for LCD filtering depends on the filter. The
- default 5-tap filter needs 2 extra subpixels. The light 3-tap filter
- needs only 1 extra subpixel. This space could be already available
- due to rounding. In order to optimize the padding, we now expand
- CBox for the given filter weights before rounding.
-
- This change breaks current Skia (and Firefox).
-
- * include/freetype/internal/ftobjs.h (FT_LibraryRec)
- [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Remove `lcd_extra' field.
-
- * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights,
- FT_Library_SetLcdFilter): Remove `lcd_extra' initializations.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Implement dymanic
- LCD padding.
-
-2017-05-15 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Return proper scaling values for SBIX bitmaps.
-
- Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
-
- * src/sfnt/ttsbit.c (tt_face_load_strike_metrics): Implement it.
-
-2017-05-15 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix error handling for embedded bitmaps.
-
- Problem reported by Hin-Tak Leung <htl10@users.sourceforge.net>.
-
- * src/truetype/ttgload.c (TT_Load_Glyph)
- [TT_CONFIG_OPTION_EMBEDDED_BITMAPS]: Handle error if font is not
- scalable.
-
-2017-05-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [autofit] Make autohint warping NORMAL option.
-
- This moves warping option from LIGHT to NORMAL mode. This makes LIGHT
- truly void of hinting in x-direction, with left side bearing never
- changed and right side bearing only altered by advance rounding.
- Therefore, LIGHT is now ready to return fractional advance. As a
- NORMAL option, warping substitutes normal hinting.
-
- * src/autofit/afcjk.c (af_cjk_hints_apply): Updated.
- * src/autofit/aflatin.c (af_latin_hints_apply): Updated.
- * src/autofit/aflatin2.c (af_latin2_hints_apply): Updated.
-
- * src/autofit/afloader.c (af_loader_load_glyph): Handle warping
- phantom points as normal.
-
-2017-05-14 Werner Lemberg <wl@gnu.org>
-
- Remove remnants of raster pool.
-
- * include/freetype/internal/ftobjs.h (FT_LibraryRec): Remove
- `raster_pool' and `raster_pool_size' fields.
-
- * src/base/ftobjs.c (FT_New_Library), src/raster/ftrend1.c
- (ft_raster1_init), src/smooth/ftsmooth.c (ft_smooth_init): Updated.
-
-2017-05-13 Werner Lemberg <wl@gnu.org>
-
- * Version 2.8 released.
- =======================
-
-
- Tag sources with `VER-2-8'.
-
- * docs/VERSION.TXT: Add entry for version 2.8.
- * docs/CHANGES: Updated.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.7.1/2.8/, s/271/28/.
-
- * include/freetype/freetype.h (FREETYPE_MINOR): Set to 8.
- (FREETYPE_PATCH): Set to 0.
-
- * builds/unix/configure.raw (version_info): Set to 20:0:14.
- * CMakeLists.txt (VERSION_MINOR): Set to 8.
- (VERSION_PATCH): Set to 0.
-
-2017-05-12 Hin-Tak Leung <htl10@users.sourceforge.net>
-
- Fix `FT_UINT_TO_POINTER' macro for Windows.
-
- * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h (FT_UINT_TO_POINTER) [_WIN64]:
- Fix definition.
-
-2017-05-11 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Chakma script.
-
- * src/autofit/afblue.dat: Add blue zone data for Chakma.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Chakma standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Chakma data.
-
-2017-05-10 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Kayah Li script.
-
- * src/autofit/afblue.dat: Add blue zone data for Kayah Li.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Kayah Li standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Kayah Li data.
-
-2017-05-10 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Bamum script.
-
- * src/autofit/afblue.dat: Add blue zone data for Bamum.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Bamum standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Bamum data.
-
-2017-05-10 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Saurashtra script.
-
- * src/autofit/afblue.dat: Add blue zone data for Saurashtra.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Saurashtra standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Saurashtra
- data.
-
-2017-05-10 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Buhid script.
-
- * src/autofit/afblue.dat: Add blue zone data for Buhid.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Buhid standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Buhid data.
-
-2017-05-08 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Shavian script.
-
- * src/autofit/afblue.dat: Add blue zone data for Shavian.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Shavian standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Shavian data.
-
-2017-05-08 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Vai script.
-
- * src/autofit/afblue.dat: Add blue zone data for Vai.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Vai standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Vai data.
-
-2017-05-08 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Osmanya script.
-
- * src/autofit/afblue.dat: Add blue zone data for Osmanya.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Osmanya standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Osmanya data.
-
-2017-05-08 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Coptic script.
-
- * src/autofit/afblue.dat: Add blue zone data for Coptic.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Coptic standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Coptic data.
-
-2017-05-08 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Carian script.
-
- * src/autofit/afblue.dat: Add blue zone data for Carian.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Carian standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Carian data.
-
-2017-05-07 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add tricky font `DFGirl-W6-WIN-BF' (from Dynalab).
-
- Reported by Roy Tam <roytam@gmail.com>.
-
- * src/truetype/ttobjs.c (tt_check_trickyness_family): Implement it.
-
-2017-05-07 Roy Tam <roytam@gmail.com>
- Werner Lemberg <wl@gnu.org>
-
- [truetype] More tricky fonts (mainly from Dynalab).
-
- * src/truetype/ttobjs.c (tt_check_trickyness_family,
- tt_check_trickyness_sfnt_ids): Add them.
-
-2017-05-07 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add tricky font `DLCHayMedium' (from Dynalab).
-
- Reported by Roy Tam <roytam@gmail.com>.
-
- * src/truetype/ttobjs.c (tt_check_trickyness_family): Implement it.
-
-2017-05-03 Werner Lemberg <wl@gnu.org>
-
- */*: s/backwards compatibility/backward compatibility/.
-
-2017-05-03 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Unified Canadian Syllabics script.
-
- * src/autofit/afblue.dat: Add blue zone data for Unified Canadian
- Syllabics.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Unified Canadian Syllabics standard
- character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Unified
- Canadian Syllabics data.
-
-2017-05-03 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org>
-
- [autofit] Add blue-zone support for Sundanese script.
-
- This essentially moves the Sundanese script from the `Indic' hinter
- to the `Latin' hinter.
-
- * src/autofit/afblue.dat: Add blue zone data for Sundanese.
-
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Sundanese standard character and move
- data out of AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afranges.c: Move Sundanese data out of
- AF_CONFIG_OPTION_INDIC block.
-
- * src/autofit/afstyles.h: Update Sundanese data; in particular, use
- AF_WRITING_SYSTEM_LATIN.
-
-2017-05-03 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Avestan script.
-
- * src/autofit/afblue.dat: Add blue zone data for Avestan.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Avestan standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Avestan data.
-
-2017-05-02 Behdad Esfahbod <behdad@behdad.org>
-
- [truetype] Make `IUP' gvar deltas do the same as Apple (#50832).
-
- When points are not touched by gvar interpolation deltas, FreeType
- gave a slightly different result than Apple's CoreText.
-
- The OpenType working group will update the specification to document
- the following behaviour: If the two points with deltas to the `left'
- and `right' of the untouched point have the same coordinate, then
- the inferred delta for the untouched point should be zero.
-
- * src/truetype/ttgxvar.c (tt_delta_interpolate): Implement new
- behaviour.
-
-2017-05-02 Werner Lemberg <wl@gnu.org>
-
- [autofit] Remove `slight' auto-hint mode again.
-
- A poll on freetype-devel favoured changes directly applied to
- `light'.
-
- * include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT,
- FT_RENDER_MODE_SLIGHT): Removed.
-
- * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
- (af_latin_hints_init), src/autofit/aflatin2.c
- (af_latin2_hints_init): Revert change from 2017-04-22.
-
- * src/autofit/afloader.c (af_loader_load_glyph) Remove references to
- FT_RENDER_MODE_SLIGHT.
- [AF_CONFIG_OPTION_TT_SIZE_METRICS]: Enable TrueType-like metrics
- unconditionally.
-
- * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Revert change from
- 2017-04-22.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Revert change from 2017-04-22.
-
- * src/pshinter/pshalgo.c (ps_hints_apply): Revert change from
- 2017-04-22.
-
- * src/smooth/ftsmooth.c (ft_smooth_render): Revert change from
- 2017-04-22.
-
- * docs/CHANGES: Updated.
-
-2017-04-30 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix metrics computation.
-
- Problem reported by Markus Trippelsdorf <markus@trippelsdorf.de> and
- Nikolaus Waxweiler <madigens@gmail.com>.
-
- * src/base/ftobjs.c (FT_Request_Size): Trigger recomputation of
- auto-hinter metrics. Without this change, multiple size changing
- calls for a single face fail.
-
-2017-04-29 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttdriver.c (tt_size_request): Properly check `error'.
-
- Reported by Earnestly <zibeon@googlemail.com> in
-
- https://lists.nongnu.org/archive/html/freetype/2017-04/msg00031.html
-
-2017-04-27 Werner Lemberg <wl@gnu.org>
-
- Introduce AF_CONFIG_OPTION_TT_SIZE_METRICS configuration option.
-
- * include/freetype/config/ftoption.h
- (AF_CONFIG_OPTION_TT_SIZE_METRICS): New option, commented out by
- default.
-
- * src/autofit/afloader.c (af_loader_load_glyph): Use
- AF_CONFIG_OPTION_TT_SIZE_METRICS to guard the corresponding code.
-
-2017-04-26 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/freetype.h (FT_Render_Mode): Fix order.
-
- This retains backward compatibility.
-
- Noted by Alexei.
-
-2017-04-22 Werner Lemberg <wl@gnu.org>
-
- [truetype] Do linear scaling for FT_LOAD_NO_HINTING (#50470).
-
- * src/truetype/ttobjs.h (TT_SizeRec): Add field `hinted_metrics' to
- hold hinted metrics.
- Make `metrics' a pointer so that `tt_glyph_load' can easily switch
- between metrics.
-
- * src/truetype/ttdriver.c (tt_size_request): Updated.
- (tt_glyph_load): Use top-level metrics if FT_LOAD_NO_HINTING is
- used.
-
- * src/truetype/ttgload.c (TT_Hint_Glyph, TT_Process_Simple_Glyph,
- TT_Process_Composite_Component, load_truetype_glyph,
- compute_glyph_metrics, TT_Load_Glyph): Updated.
-
- * src/truetype/ttinterp.c (TT_Load_Context): Updated.
-
- * src/truetype/ttobjs.c (tt_size_reset): Updated.
-
- * src/truetype/ttsubpix.c (sph_set_tweaks): Updated.
-
-2017-04-22 Werner Lemberg <wl@gnu.org>
-
- Add new `slight' auto-hinting mode.
-
- This mode uses fractional advance widths and doesn't scale glyphs
- horizontally, only applying vertical scaling and hinting.
-
- At the same time, the behaviour of the `light' auto-hinter gets
- restored for backward compatibility: Both vertical and horizontal
- scaling is again based on rounded metrics values (this was changed
- in a commit from 2017-03-30 as a side effect). To be more precise,
- the behaviour is restored for TrueType fonts only; for other font
- formats like Type 1, this is a new feature of the `light' hinting
- mode.
-
- * include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT): New macro.
- (FT_RENDER_MODE_SLIGHT): New render mode.
-
- * include/freetype/internal/ftobjs.h (FT_Size_InternalRec): Add
- `autohint_mode' and `autohint_metrics' fields.
-
- * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
- (af_latin_hints_init), src/autofit/aflatin2 (af_latin2_hints_init):
- Updated.
-
- * src/autofit/afloader.c (af_loader_embolden_glyph_in_slot): Use
- `autohint_metrics'.
- (af_loader_load_glyph): s/internal/slot_internal/.
- Initialize `autohint_metrics' and `autohint_mode' depending on
- current auto-hint mode.
- Use `autohint_metrics'.
- Updated.
-
- * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Updated.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Updated.
- (FT_New_Size): Allocate `internal' object.
-
- * src/pshinter/pshalgo.c (ps_hints_apply): Updated.
-
- * src/smooth/ftsmooth.c (ft_smooth_render): Updated.
-
-2017-04-22 Werner Lemberg <wl@gnu.org>
-
- Introduce `FT_Size_InternalRec' structure.
-
- We are going to extend this later on.
-
- * include/freetype/internal/ftobjs.h (FT_Size_InternalRec): New
- structure with a single field `module_data'.
-
- * src/base/ftobjs.c (FT_New_Size): Allocate `internal' field of
- `FT_Size' structure.
-
- * src/cff/cffgload.c (cff_builder_init, cff_decoder_prepare): Use
- `size->internal->module_data' instead of `size->internal'.
-
- * src/cff/cffobjs.c (cff_size_done): Deallocate `module_data'.
- (cff_size_init, cff_size_select, cff_size_request): Use
- `size->internal->module_data' instead of `size->internal'.
-
- * src/cif/cidobjs.c (cid_size_done, cid_size_init,
- cid_size_request): Use `size->internal->module_data' instead of
- `size->internal'.
-
- * src/psaux/psobjs.c (t1_builder_ini): Use
- `size->internal->module_data' instead of `size->internal'.
-
- * src/type1/t1objs.c (T1_Size_Done, T1_Size_Init, T1_Size_Request):
- Use `size->internal->module_data' instead of `size->internal'.
-
-2017-04-21 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftsmooth.h: Remove unused guards and declaration.
-
-2017-04-16 Hin-Tak Leung <htl10@users.sourceforge.net>
-
- Fix tracing messages.
-
- * src/base/ftobjs.c (FT_Face_GetCharVariantIndex,
- FT_Face_GetCharVariantIsDefault, FT_Face_GetVariantsOfChar): Print
- correct function name.
-
-2017-04-08 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Old Turkic script.
-
- * src/autofit/afblue.dat: Add blue zone data for Old Turkic.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Old Turkic standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Old Turkic data.
-
-2017-04-08 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Gothic script.
-
- * src/autofit/afblue.dat: Add blue zone data for Gothic.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Gothic standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Gothic data.
-
-2017-04-08 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Cypriot script.
-
- * src/autofit/afblue.dat: Add blue zone data for Cypriot.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Cypriot standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Cypriot data.
-
-2017-04-08 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Deseret script.
-
- * src/autofit/afblue.dat: Add blue zone data for Deseret.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Deseret standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Deseret data.
-
-2017-04-07 Werner Lemberg <wl@gnu.org>
-
- [autofit] Fix invalid character range description (#50745).
-
- Also reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1034
-
- * src/autofit/afranges.c (af_glag_nonbase_uniranges): Fix typo in
- recent commit.
-
-2017-04-07 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Fix clang warnings.
-
- * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Add
- casts.
-
-2017-04-06 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Lisu script.
-
- * src/autofit/afblue.dat: Add blue zone data for Lisu.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Lisu standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Lisu data.
-
-2017-04-06 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Osage script.
-
- * src/autofit/afblue.dat: Add blue zone data for Osage.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Osage standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Osage data.
-
-2017-04-06 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Glagolitic script.
-
- * src/autofit/afblue.dat: Add blue zone data for Glagolitic.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Glagolitic standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Glagolitic data.
-
-2017-04-06 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Tai Viet script.
-
- * src/autofit/afblue.dat: Add blue zone data for Tai Viet.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Tai Viet standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Tai Viet data.
-
-2017-04-06 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Tifinagh script.
-
- * src/autofit/afblue.dat: Add blue zone data for Tifinagh.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Tifinagh standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Tifinagh data.
-
-2017-04-06 Sascha Brawer <sascha@google.com>
- Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for N'Ko script.
-
- * src/autofit/afblue.dat: Add blue zone data for N'Ko.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add N'Ko standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add N'Ko data.
-
-2017-04-06 Sascha Brawer <sascha@google.com>
-
- [autofit] Add support for Adlam script.
-
- * src/autofit/afblue.dat: Add blue zone data for Adlam.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Adlam standard characters.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Adlam data.
-
-2017-04-06 Sascha Brawer <sascha@google.com>
-
- [autofit] Add support for Ol Chiki script.
-
- * src/autofit/afblue.dat: Add blue zone data for Ol Chiki.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Ol Chiki standard character.
-
- * src/autofit/afranges.c, src/autofit/afstyles.h: Add Ol Chiki data.
-
-2017-04-03 Werner Lemberg <wl@gnu.org>
-
- [truetype] Avoid reexecution of `fpgm' and `prep' in case of error.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=981
-
- * include/freetype/fterrdef.h (FT_Err_DEF_In_Glyf_Bytecode): New
- error code.
-
- * src/truetype/ttinterp.c (Ins_FDEF, Ins_IDEF): Prohibit execution
- of these two opcodes in `glyf' bytecode.
- (TT_RunIns): Don't enforce reexecution of `fpgm' and `prep' bytecode
- in case of error since function tables can no longer be modified
- (due to the changes in `Ins_FDEF' and `Ins_IDEF'). This change can
- enormously speed up handling of broken fonts.
-
-2017-04-02 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [autofit] Disable metrics adjustment for `FT_LOAD_TARGET_LCD'.
-
- * src/autofit/aflatin.c (af_latin_hints_init): Updated.
- * src/autofit/aflatin2.c (af_latin2_hints_init): Ditto.
-
-2017-04-01 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgload.c: Include FT_CONFIG_CONFIG_H.
-
- Otherwise FT_UINT_TO_POINTER might not be defined.
-
- Problem reported by Alexei.
-
-2017-03-31 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [autofit] Disable stem adjustment for `FT_LOAD_TARGET_LCD'.
-
- * include/freetype/freetype.h (FT_LOAD_TARGET_LCD): Document it.
- * src/autofit/afcjk.c (af_cjk_hints_init): Updated.
- * src/autofit/aflatin.c (af_latin_hints_init): Ditto.
- * src/autofit/aflatin2.c (af_latin2_hints_init): Ditto.
-
-2017-03-31 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffload.c (cff_font_load): Improve fix from 2017-01-04.
-
- Allow CFFs containing a single font to have an empty font name.
-
- Problem reported by 張俊芝 <418092625@qq.com> in
-
- https://lists.nongnu.org/archive/html/freetype-devel/2017-03/msg00074.html
-
-2017-03-30 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffparse.h (CFF2_DEFAULT_STACK): Set to 513 also.
-
- Requested by Dave Arnold.
-
-2017-03-30 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix HVAR and VVAR handling (#50678).
-
- * src/truetype/ttgxvar.c (tt_hvadvance_adjust): Handle
- glyph indices larger than `mapCount' as described in the
- specification.
-
-2017-03-30 Werner Lemberg <wl@gnu.org>
-
- [truetype] Allow linear scaling for unhinted rendering (#50470).
-
- * src/truetype/ttdriver.c (tt_size_request): Revert change from
- 2011-07-16; the intended metrics fix seems now to be implemented in
- a different way, making the patch unnecessary. Note that this
- change was usually patched out by all major GNU/Linux distributions
- due to heavy side effects.
-
- * src/truetype/ttgload.c (compute_glyph_metrics, TT_Load_Glyph):
- Refer to the metrics of the `TT_Size' object.
-
-2017-03-29 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix thinko related to PS name of default named instance.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): `strid' and `psid' are
- name ID values, not indices into the array of name entries.
-
-2017-03-27 Werner Lemberg <wl@gnu.org>
-
- [cid, truetype] Don't use `index' as a variable name.
-
- At least on FreeBSD there is a global declaration of `index' in file
- `/usr/include/strings.h'.
-
- * src/cff/cf2intrp.c, src/truetype/ttgload.c: s/index/idx/ where
- appropriate.
-
-2017-03-27 Wojciech Mamrak <wmamrak@gmail.com>
-
- [sfnt] Minor improvement for handling kern tables.
-
- * src/sfnt/ttkern.c (tt_face_load_kern): Don't check for
- cross-stream kerning tables since we reject format 2 tables later
- on anyways.
- Modify code for limit test...
- (tt_face_get_kerning): ... to avoid a limit test here.
-
-2017-03-27 Werner Lemberg <wl@gnu.org>
-
- [pcf] Fix compiler warnings.
-
- Reported by Alexander Hedges <ahedges@student.ethz.ch>.
-
- * src/pcf/pcfdrivr.c (pcf_property_set, pcf_property_get): Tag
- `property_name' with `FT_UNUSED' where necessary.
-
-2017-03-26 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/psobjs.c (t1_builder_close_contour): Add safety guard.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=941
-
-2017-03-23 Werner Lemberg <wl@gnu.org>
-
- [psaux] Better protect `flex' handling.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=935
-
- * src/psaux/t1decode.c (t1_decoder_parse_charstrings)
- <callothersubr>: Since there is not a single flex operator but a
- series of subroutine calls, malformed fonts can call arbitrary other
- operators after the start of a flex, possibly adding points. For
- this reason we have to check the available number of points before
- inserting a point.
-
-2017-03-23 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix check for default named instance.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): A `fixed' number needs four
- bytes, not two...
-
-2017-03-23 Werner Lemberg <wl@gnu.org>
-
- Make MM fonts work (again).
-
- * src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
- FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Ignore
- return value of `ft_face_get_mvar_service'; instead, check whether a
- service is actually returned.
-
-2017-03-20 Werner Lemberg <wl@gnu.org>
-
- [truetype] Some variable renamings.
-
- Too much local variables holding different structures were called
- `metrics'.
-
- * src/truetype/ttdriver.c (tt_size_select): s/metrics/size_metrics/.
-
- * src/truetype/ttgload.c (tt_get_metrics_incr_overrides,
- compute_glyph_metrics): s/metrics/incr_metrics/.
- (load_sbit_image): s/metrics/sbit_metrics/.
-
- * src/truetype/ttobjs.c (tt_size_run_fpgm): s/metrics/size_metrics/.
- (tt_size_init_bytecode): s/metrics/tt_metrics/.
- (tt_size_reset): s/metrics/size_metrics/.
-
-2017-03-20 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Don't add instances to non-variation fonts.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Fix it.
-
-2017-03-20 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffgload.c (cff_builder_init): Add safety guard (#50578).
-
-2017-03-18 Werner Lemberg <wl@gnu.org>
-
- Introduce FT_UINT_TO_POINTER macro (#50560).
-
- We have to make a separate case for Windows 64's LLP64 data model.
-
- * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h (FT_UINT_TO_POINTER): New macro.
-
- * src/truetype/ttgload.c (load_truetype_glyph): Use it.
-
-2017-03-18 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (TT_RunIns): Adjust loop counter (#50573).
-
- The problematic font that exceeds the old limit is Lato-Regular,
- version 2.007, containing bytecode generated by a buggy version of
- ttfautohint.
-
-2017-03-18 Werner Lemberg <wl@gnu.org>
-
- [truetype] Another limitation for bytecode loop count maximum.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=900
-
- * src/truetype/ttinterp.c (TT_RunIns): Limit `loopcall_counter_max'
- by number of glyphs also.
-
-2017-03-18 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Minor improvement.
-
- * src/tools/ftfuzzer/ftfuzzer.cc: Don't set intermediate axis if
- bitmap strikes are active.
-
-2017-03-18 Werner Lemberg <wl@gnu.org>
-
- Improve `make multi'.
-
- * src/autofit/aflatin2.c: Guard file with FT_OPTION_AUTOFIT2.
-
- * src/base/ftmac.c: Guard more parts of the file with FT_MACINTOSH.
-
- * src/psaux/afmparse.c: Guard file with T1_CONFIG_OPTION_NO_AFM.
-
- * src/sfnt/pngshim.c: Guard file with
- TT_CONFIG_OPTION_EMBEDDED_BITMAPS also.
-
- * src/sfnt/ttbdf.c: Avoid empty source file.
- * src/sfnt/ttpost.c: Guard file with
- TT_CONFIG_OPTION_POSTSCRIPT_NAMES.
- * src/sfnt/ttsbit.c: Guard file with
- TT_CONFIG_OPTION_EMBEDDED_BITMAPS.
-
- * src/truetype/ttgxvar.c, src/truetype/ttinterp.c: Avoid empty
- source file.
-
- * src/truetype/ttsubpix.c: Guard file with
- TT_USE_BYTECODE_INTERPRETER also.
-
- * src/type1/t1afm.c: Guard file with T1_CONFIG_OPTION_NO_AFM.
-
- * src/autofit/autofit.c, src/base/ftbase.c, src/cache/ftcache.c,
- src/cff/cff.c, src/cid/type1cid.c, src/gxvalid/gxvalid.c,
- src/pcf/pcf.c, src/pfr/pfr.c, src/psaux/psaux.c,
- src/pshinter/pshinter.c, src/psnames/psnames.c, src/raster/raster.c,
- src/sfnt/sfnt.c, src/smooth/smooth.c, src/truetype/truetype.c,
- src/type1/type1.c, src/type42/type42.c: Remove conditionals; sort
- entries.
-
-2017-03-17 Werner Lemberg <wl@gnu.org>
-
- Fixes for conditional compilation.
-
- * src/autofit/afcjk.c, src/autofit/afindic.c: Include `afcjk.h'
- earlier.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Put `memory' variable into
- TT_CONFIG_OPTION_GX_VAR_SUPPORT block.
- (sfnt_done_face): Protect some code with
- TT_CONFIG_OPTION_GX_VAR_SUPPORT.
-
- * src/sfnt/ttsbit.c (tt_face_load_sbix_image): Remove compiler
- warning.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Put `tmp' variable
- into TT_USE_BYTECODE_INTERPRETER block.
-
- (tt_loader_init): Put `error' variable into
- TT_USE_BYTECODE_INTERPRETER block.
-
-2017-03-17 Werner Lemberg <wl@gnu.org>
-
- Fix preprocessor warning.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h: Test whether
- TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined before checking its
- value.
-
-2017-03-17 Werner Lemberg <wl@gnu.org>
-
- `make multi' fixes; compiler warnings.
-
- * src/base/ftsnames.c: Include FT_INTERNAL_DEBUG_H.
-
- * src/cff/cffobjs.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
- FT_MULTIPLE_MASTERS_H and FT_SERVICE_MULTIPLE_MASTERS_H.
-
- * src/sfnt/sfdriver.c [TT_CONFIG_OPTION_GX_VAR_SUPPORT]: Include
- FT_MULTIPLE_MASTERS_H and FT_SERVICE_MULTIPLE_MASTERS_H.
- (get_win_string, get_apple_string): Initialize `result'.
-
-2017-03-17 Dave Arnold <darnold@adobe.com>
-
- [cff] Fix potential bugs in default NDV for CFF2.
-
- * src/cff/cffload.c (cff_blend_build_vector): Explicitly build blend
- vector when `lenNDV' is zero; don't rely on zero-init.
- Save `lenNDV' as part of cache key even when `lenNDV' is zero.
-
-2017-03-17 Dave Arnold <darnold@adobe.com>
-
- [cff] Fix CFF2 stack allocation.
-
- * src/cff/cffparse.c (cff_parser_init) add 1 for operator.
-
-2017-03-16 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (tt_done_blend): Free `vvar_table'.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=883
-
-2017-03-15 Werner Lemberg <wl@gnu.org>
-
- Remove clang compiler warnings (#50548).
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Make
- `var_postscript_prefix_len' unsigned.
-
- * src/autofit/afwarp.c (af_warper_compute_line_best): Remove
- redundant assignment.
-
- * src/cff/cffload.c (cff_subfont_load): Add casts.
-
- * src/cff/cffparse.c (cff_parse_blend): Remove redundant assignment.
-
- * src/sfnt/sfdriver.c (fmix32, murmur_hash_3_128): Add `static'
- keyword.
- Add casts.
- (fixed2float): Add cast.
- (sfnt_get_var_ps_name): Make `p' always initialized.
- Add casts.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Add casts.
-
-2017-03-15 Werner Lemberg <wl@gnu.org>
-
- [ftfuzzer] Limit number of tested faces and instances.
-
- This is inspired by the discussion in and analysis of
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=859
-
- * src/tools/ftfuzzer/ftfuzzer.cc (LLVMFuzzerTestOneInput): Use only
- up to 20 face indices.
- Use only up to 20 instance indices.
-
-2017-03-15 Werner Lemberg <wl@gnu.org>
-
- * src/tools/ftfuzzer/ftfuzzer.cc: Improve readability; formatting.
-
-2017-03-14 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Implement PS names for font instances [3/3].
-
- Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): New fields
- `var_postscript_prefix' and `var_postscript_prefix_len'.
-
- * src/sfnt/sfdriver.c: Include FT_TRUETYPE_IDS_H.
- (sfnt_is_alphanumeric): New wrapperfunction for `ft_isalnum'.
- (get_win_string, get_apple_string): Remove `const' from return
- value.
- (MAX_VALUE_DESCRIPTOR_LEN, MAX_PS_NAME_LEN): New macros.
- (hexdigits): New array.
- (sfnt_get_var_ps_name): New function, implementing Adobe TechNote
- 5902 to construct a PS name for a variation font instance.
- (sfnt_get_ps_name): Call `sfnt_get_var_ps_name' for font instances.
-
- * src/sfnt/sfobjs.c (sfnt_done_face): Updated.
-
- * src/truetype/ttgxvar.c (tt_set_mm_blend): Reset
- `face->postscript_name' to trigger recalculation for new instance
- parameters.
-
-2017-03-14 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Implement PS names for font instances [2/3].
-
- * src/sfnt/sfdriver.c (fix2float) [TT_CONFIG_OPTION_GX_VAR_SUPPORT]:
- New function to find the shortest representation of a 16.16
- fractional number.
-
-2017-03-14 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Implement PS names for font instances [1/3].
-
- Add 128bit MurmurHash 3 function.
-
- Everything is guarded with TT_CONFIG_OPTION_GX_VAR_SUPPORT.
-
- * src/sfnt/sfdriver.c (ROTL32): New macro.
- (fmix32, murmur_hash_3_128): New functions.
-
-2017-03-13 Werner Lemberg <wl@gnu.org>
-
- [truetype] Ignore invalid MVAR tags.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=838
-
- * src/truetype/ttgxvar.c (ft_var_load_mvar): Ignore value and emit
- warning for invalid tags.
- (tt_apply_mvar): Ignore invalid tags.
-
-2017-03-12 Werner Lemberg <wl@gnu.org>
-
- [truetype] Store and use design coordinates also.
-
- * include/freetype/internal/services/svmm.h (FT_Get_Var_Blend_Func):
- Add `normalizedcoords' argument.
-
- * src/truetype/ttgxvar.h (GX_BlendRec): Add `coords' field to store
- the design coordinates of the current instance.
- Updated.
-
- * src/truetype/ttgxvar.c (TT_Set_MM_Blend): Move functionality to...
- (tt_set_mm_blend): ... New function.
- Convert data in `normalizedcoords' array to `coords' array on
- demand.
- (TT_Set_Var_Design): Store argument data in `coords' array.
- (TT_Get_Var_Design): Get data from `coords' array.
- (tt_get_var_blend): Updated.
- (tt_done_blend): Updated.
-
- * src/cff/cffload.c, src/cff/cffload.h (cff_get_var_blend): Updated.
-
- * src/cff/cf2ft.c (cf2_getNormalizedVector): Updated.
-
- * src/cff/cffobjs.c (cff_face_init): Updated.
-
-2017-03-12 Werner Lemberg <wl@gnu.org>
-
- src/truetype/ttgxvar.[ch]: s/avar_checked/avar_loaded/.
-
-2017-03-08 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Another fix for buggy variation fonts.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=759
-
- * src/sfnt/sfobjs.c (sfnt_init_face): While setting number of
- instances to zero for `CFF' fonts table, ensure that there is no
- `CFF2' present also (which gets priority).
-
-2017-03-07 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Improve handling for buggy variation fonts.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=738
-
- * src/sfnt/sfobjs.c (sfnt_init_face): While setting number of
- instances to zero for `CFF' fonts table, ensure that there is no
- `glyf' table present also (which gets priority).
-
-2017-03-06 Werner Lemberg <wl@gnu.org>
-
- [sfnt, truetype] Always provide default instance.
-
- As documented in the OpenType specification, an entry for the
- default instance may be omitted in the named instance table. In
- particular this means that even if there is no named instance table
- in the font we actually do have a named instance, namely the default
- instance.
-
- For consistency, we always want the default instance in our list of
- named instances. If it is missing, we try to synthesize it.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Check whether the default
- instance is in the table of named instances. Otherwise adjust
- number of instances.
-
- * src/truetype/ttgxvar.c: Include FT_TRUETYPE_IDS_H.
- (TT_Get_MM_Var): Use `face->root.style_flags' as the number of named
- instances.
- Sythesize a named instance entry if necessary.
- (tt_done_blend): Free `normalized_stylecoords'.
-
-2017-03-05 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Remove redundant code.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Remove second test for
- `num_instances', which will always succeed.
-
-2017-03-04 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Add `get_name_id' service.
-
- * include/freetype/internal/sfnt.h (TT_Get_Name_ID_Func): New
- typedef.
- (SFNT_Interface): Add `get_name_id' field.
- (FT_DEFINE_SFNT_INTERFACE): Updated.
-
- * src/sfnt/sfdriver.c (search_name_id): Rename to...
- (sfnt_get_name_id): ... this.
- (sfnt_get_ps_name, sfnt_interface): Updated.
-
-2017-03-04 Werner Lemberg <wl@gnu.org>
-
- [truetype] Make `TT_Set_MM_Blend' set named instance index.
-
- * src/truetype/ttgxvar.h (GX_Blend): New array
- `normalized_stylecoords'.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Allocate and fill
- `normalized_stylecoords'.
- (TT_Set_MM_Blend): Check instance tuple and adjust `face_index'
- accordingly.
-
-2017-03-02 Werner Lemberg <wl@gnu.org>
-
- [truetype] Split off designer/normalized conversion routines.
-
- * src/truetype/ttgxvar.c (TT_Set_Var_Design): Split off conversion
- code designer->normalized coordinates to...
- (ft_var_to_normalized): ... New function.
- (TT_Get_Var_Design): Split off conversion code normalized->designer
- coordinates to...
- (ft_var_to_design): ... New function.
-
-2017-02-28 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Further generalize `sfnt_get_ps_name'; report invalid data.
-
- * src/sfnt/sfdriver.c (sfnt_ps_map): New array.
- (sfnt_is_postscript): New function.
- (char_type_func): New typedef.
- (get_win_string, get_apple_string): Add argument to specify
- character checking function.
- Add argument whether argument checking failures should be reported.
- Update callers.
- (search_name_id): Fix return value.
-
-2017-02-23 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Split off another bit of `sfnt_get_ps_name'.
-
- * src/sfnt/sfdriver.c (sfnt_get_ps_name): Split off some
- functionality into...
- (search_name_id): ... New function.
-
-2017-02-23 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Modularize `sfnt_get_ps_name'.
-
- * src/sfnt/sfdriver.c (sfnt_get_ps_name): Split off some
- functionality into...
- (IS_WIN, IS_APPLE): ... New macros.
- (get_win_string, get_apple_string): ... New functions.
-
-2017-02-23 Werner Lemberg <wl@gnu.org>
-
- [truetype] Minor improvement.
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph,
- load_truetype_glyph): Remove unnecessary tests.
-
-2017-02-23 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/internal/tttypes.h (TT_Face): s/isCFF2/is_cff2/.
-
- For orthogonality with other structure field names.
-
- Update all users.
-
-2017-02-22 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_hline): Improve code.
-
-2017-02-20 Dominik Röttsches <drott@google.com>
-
- Fix some `ttnameid.h' entries (#50313).
-
- * include/freetype/ttnameid.h:
- s/TT_MS_LANGID_SPANISH_INTERNATIONAL_SORT/TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT/,
- s/TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIA/TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN/.
-
-2017-02-20 Werner Lemberg <wl@gnu.org>
-
- [cff] Finish support for `random' operator.
-
- * src/cff/cfftypes.h (CFF_SubFontRec): Add `random' field.
-
- * src/cff/cffobjs.c: Updated.
- (cff_driver_init): Initialize random seed value.
-
- * src/cff/cffload.c (cff_random): New function.
- (cff_subfont_load): Add `face' argument.
- Update all callers.
- Initialize random number generator with a proper seed value.
- (cff_font_load): Add `face' argument.
- Update all callers.
-
- * src/cff/cffload.h: Updated.
-
- * src/cff/cf2intrp.c (CF2_FIXME): Removed.
- (cf2_interpT2CharString) <cf2_escRANDOM>: Implement opcode.
-
- * src/cff/cffgload.c (cff_decoder_parse_charstrings): Don't
- initialize random seed value.
- <cff_op_random>: Use new random seed framework.
-
-2017-02-20 Werner Lemberg <wl@gnu.org>
-
- [cff] Sanitize `initialRandomSeed'.
-
- * src/cff/cffload.c (cff_load_private_dict): Make
- `initial_random_seed' value always positive.
-
-2017-02-20 Werner Lemberg <wl@gnu.org>
-
- [cff] Introduce `random-seed' property (2/2).
-
- * src/base/ftobjs.c: Include `FT_CFF_DRIVER_H'.
- (open_face): Initialize `face->internal->random_seed'.
- (FT_Face_Properties): Handle `FT_PARAM_TAG_RANDOM_SEED'.
-
- * src/cff/cffdrivr.c (cff_property_set): Handle `random-seed'
- property.
-
-2017-02-20 Werner Lemberg <wl@gnu.org>
-
- [cff] Introduce `random-seed' property (1/2).
-
- We need this for support of the `random' operator.
-
- * include/freetype/ftcffdrv.h (FT_PARAM_TAG_RANDOM_SEED): New macro.
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New
- field `random_seed'.
-
- * src/cff/cffobjs.h (CFF_DriverRec): New field `random_seed'.
-
-2017-02-17 Werner Lemberg <wl@gnu.org>
-
- Remove clang warnings.
-
- * src/autofit/aflatin.c (af_latin_sort_blue): Add missing `static'
- keyword.
-
- * src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
- FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates):
- Initialize some variables.
-
-2017-02-16 Nikolaus Waxweiler <madigens@gmail.com>
- Werner Lemberg <wl@gnu.org>
-
- Add face property for stem darkening.
-
- * include/freetype/ftautoh.h (FT_PARAM_TAG_STEM_DARKENING): New
- macro.
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): Add
- `no_stem_darkening' field.
-
- * src/autofit/afloader.c (af_loader_load_glyph),
- src/autofit/afmodule.c (af_property_set): Updated.
-
- * src/base/ftobjs.c: Include FT_AUTOHINTER_H.
- (ft_open_face_internal): Updated.
- (FT_Face_Properties): Handle FT_PARAM_TAG_STEM_DARKENING.
-
- * src/cff/cf2ft.c (cf2_decoder_parse_charstrings): Updated.
-
- * src/cff/cffdrivr.c (cff_property_set): Updated.
-
-2017-02-16 Nikolaus Waxweiler <madigens@gmail.com>
- Werner Lemberg <wl@gnu.org>
-
- Add face property for LCD filter weights.
-
- * include/freetype/ftlcdfil.h (FT_PARAM_TAG_LCD_FILTER_WEIGHTS,
- FT_LCD_FILTER_FIVE_TAPS): New macros.
- (FT_LcdFiveTapFilter): New typedef.
-
- * include/freetype/ftobjs.h (FT_Face_InternalRec)
- [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Add `lcd_weights' field.
- (FT_Bitmap_LcdFilterFunc): Change third argument to weights array.
- (ft_lcd_filter_fir): New prototype.
- (FT_LibraryRec): Updated.
-
- * src/base/ftlcdfil.c (_ft_lcd_filter_fir): Renamed to...
- (ft_lcd_filter_fir): ... this base function.
- Updated.
- (_ft_lcd_filter_legacy): Updated.
- (FT_Library_SetLcdFilterWeights, FT_Library_SetLcdFilter): Updated.
-
- * src/base/ftobjs.c (ft_open_face_internal): Updated.
- (FT_Face_Properties): Handle FT_PARAM_TAG_LCD_FILTER_WEIGHTS.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic)
- [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Handle LCD weights from
- `FT_Face_Internal'.
-
-2017-02-14 Nikolaus Waxweiler <madigens@gmail.com>
- Werner Lemberg <wl@gnu.org>
-
- Add new function `FT_Face_Properties'.
-
- This commit provides the framework, to be filled with something
- useful in the next commits.
-
- * include/freetype/freetype.h (FT_Face_Properties): Declare.
-
- * src/base/ftobjs.c (FT_Face_Properties): New function.
-
-2017-02-13 Werner Lemberg <wl@gnu.org>
-
- [autofit] Prevent overlapping blue zones.
-
- Problem reported as
-
- https://github.com/google/fonts/issues/632
-
- The font in question (Nunito) has values 705 and 713 for the
- reference and overshoot values, respectively, of the first blue
- zone. Blue zone 2, however, has value 710 for both the reference
- and overshoot. At 12ppem, reference and overshoot of blue zone 0
- becomes 8px, while blue zone 2 becomes 9px.
-
- A peculiarity of this font is that the tops of isolated vertical
- stems like `N' have a slight overshoot also. The auto-hinter tries
- to find the nearest blue zone using the *original* coordinates. For
- vertical stems, this is value 713. For normal horizontal tops like
- in character `E', this is value 710. Since value 713 is mapped to
- 8px but value 710 to 9px, `N' and similar characters are one pixel
- higher than `E', which looks very bad.
-
- This commit sanitizes blue zones to avoid such a behaviour.
-
- * src/autofit/aflatin.c (af_latin_sort_blue): New function.
- (af_latin_metrics_init_blues): Sort blue values and remove overlaps.
-
-2017-02-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_sweep): Improve code.
-
-2017-02-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] Implement `VVAR' table support.
-
- * src/truetype/ttgxvar.h (GX_HVarTable): Renamed to...
- (GX_HVVarTable): ...This.
- (GX_Blend): Add fields for `VVAR' table handling.
- Other minor updates.
-
- * src/truetype/ttgxvar.c (ft_var_load_hvar): Renamed to...
- (ft_var_load_hvvar): ...This.
- Handle VVAR loading also (controlled by an additional parameter).
- (tt_hadvance_adjust): Renamed to...
- (tt_hvadvance_adjust): ...This.
- Handle application of advance height also (controlled by an
- additional parameter).
- (tt_hadvance_adjust, tt_vadvance_adjust): Wrappers for
- `tt_hvadvance_adjust'.
-
- * src/truetype/ttdriver.c (tt_service_metrics_variations): Updated.
-
-2017-02-05 Werner Lemberg <wl@gnu.org>
-
- [autofit] Use better blue zone characters for lowercase latin.
-
- The number of lowercase characters for computing the top flat blue
- zone value was too small (in most cases only `x' and `z'). If one
- of the two characters has a large serif, say, it can happen that
- FreeType must select between two different values, having a 50%
- chance to use the wrong one. As a result, rendering at larger PPEM
- values could yield uneven lowercase glyph heights.
-
- Problem reported by Christoph Koeberlin <christoph@koe.berlin>.
-
- * src/autofit/afblue.dat (AF_BLUE_STRING_LATIN_SMALL): Replaced
- with...
- (AF_BLUE_STRING_LATIN_SMALL_TOP, AF_BLUE_STRING_LATIN_SMALL_BOTTOM):
- ... New, extended sets.
- (AF_BLUE_STRINGSET_LATN): Updated.
-
- * src/autofit/afblue.c, scr/autofit/afblue.h: Regenerated.
-
-2017-02-04 Werner Lemberg <wl@gnu.org>
-
- Make `freetype-config' a wrapper of `pkg-config' if possible.
-
- Based on ideas taken from
-
- https://pkgs.fedoraproject.org/cgit/rpms/freetype.git/tree/freetype-multilib.patch
- https://pkgs.fedoraproject.org/cgit/rpms/freetype.git/tree/freetype-2.5.3-freetype-config-prefix.patch
-
- * builds/unix/freetype-config.in: Rewritten. Use `pkg-config' to
- set output variables if program is available.
-
- * docs/CHANGES, docs/freetype-config.1: Updated.
-
-2017-02-04 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/unix-def.in (freetype-config): Fix permissions.
-
-2017-02-03 Werner Lemberg <wl@gnu.org>
-
- * src/autofit/afglobal.c (af_face_globals_free): Erase useless code.
-
-2017-02-03 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ftgasp.h (FT_GASP_SYMMETRIC_GRIDFIT): Fix value.
-
- Reported by Behdad.
-
-2017-02-02 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix MVAR post-action handling.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=509
-
- * src/truetype/ttobjs.c (tt_size_reset): Do nothing for CFF2. This
- is important to make `tt_size_reset_iterator' (called in
- `tt_apply_mvar') always work.
-
-2017-02-02 Werner Lemberg <wl@gnu.org>
-
- Make compilation with FT_CONFIG_OPTION_PIC work again.
-
- All code committed here is guarded with `FT_CONFIG_OPTION_PIC'.
-
- * include/freetype/internal/services/svmetric.h
- (FT_DEFINE_SERVICE_METRICSVARIATIONSREC): Remove trailing semicolon.
-
- * src/autofit/aflatin.c (af_latin_hints_compute_edges,
- af_latin_hint_edges): Provide `globals' variable.
-
- * src/autofit/afloader.c (af_loader_load_glyph): Remove shadowing
- variable.
-
- * src/autofit/afmodule.c (AF_SCRIPT_CLASSES_GET,
- AF_STYLE_CLASSES_GET): Redefine.
-
- * src/autofit/aftypes.h (AF_DEFINE_WRITING_SYSTEM_CLASS): Fix typo.
-
- * src/cff/cffparse.c (CFF_FIELD_BLEND): Provide it.
-
- * src/cff/cffpic.h (CffModulePIC): Fix typo.
-
-2017-01-31 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_render_scanline): Improve code.
-
-2017-01-31 Werner Lemberg <wl@gnu.org>
-
- [cff] Provide metrics variation service interface (#50196).
-
- Only now I've got an OTF with an HVAR table for testing...
-
- The code in `ftmm.c' uses `FT_FACE_LOOKUP_SERVICE' to get the
- metrics variations interface. However, this didn't work with
- `FT_FACE_FIND_GLOBAL_SERVICE' used in `sfnt_init_face'.
-
- * src/cff/cffdrivr.c: Include FT_SERVICE_METRICS_VARIATIONS_H.
- (cff_hadvance_adjust, cff_metrics_adjust): Wrapper functions for
- metric service functions from the `truetype' module.
- (cff_service_metrics_variations): New service.
- (cff_services): Updated.
-
- * src/cff/cffpic.h (CFF_SERVICE_METRICS_VAR_GET): New macro.
- [FT_CONFIG_OPTION_PIC]: Synchronize code.
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Replace call to
- FT_FACE_FIND_GLOBAL_SERVICE with `ft_module_get_service' to always
- load the service from the `truetype' module.
-
-2017-01-31 Werner Lemberg <wl@gnu.org>
-
- Add framework to support services with 9 functions.
-
- * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC9):
- New macro.
-
-2017-01-31 Werner Lemberg <wl@gnu.org>
-
- [base] Fix error handing in MM functions.
-
- * src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
- FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates):
- Implement it.
-
-2017-01-31 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix sanity check for `gvar' table (#50184).
-
- * src/truetype/ttgxvar.c (ft_var_load_gvar): There might be missing
- variation data for some glyphs.
-
-2017-01-31 Werner Lemberg <wl@gnu.org>
-
- [autofit] Avoid uninitialized jumps (#50191).
-
- * src/autofit/afcjk.c (af_cjk_metrics_check_digits),
- src/autofit/aflatin.c (af_latin_metrics_check_digits): Initialize
- `advance'.
-
-2017-01-27 Werner Lemberg <wl@gnu.org>
-
- s/GB2312/PRC/.
-
- * include/freetype/freetype.h (FT_ENCODING_PRC): New enum value.
- (FT_ENCODING_GB2312): Deprecated.
-
- * include/freetype/ttnameid.h (TT_MS_ID_PRC): New macro.
- (TT_MS_ID_GB2312): Deprecated.
-
- * src/sfnt/sfobjs.c (sfnt_find_encoding): Updated.
-
- * docs/CHANGES: Updated.
-
-2017-01-26 Werner Lemberg <wl@gnu.org>
-
- [base] Add `FT_Get_Sfnt_LangTag' function.
-
- * include/freetype/ftsnames.h (FT_SfntLangTag): New structure.
- (FT_Get_Sfnt_LangTag): New declaration.
-
- * src/base/ftsnames.c (FT_Get_Sfnt_LangTag): New function.
-
- * docs/CHANGES: Updated.
-
-2017-01-26 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Support `name' table format 1.
-
- * include/freetype/internal/tttypes.h (TT_LangTagRec): New
- structure.
- (TT_NameTableRec): Add fields `numLangTagRecords' and `langTags'.
-
- * src/sfnt/ttload.c (tt_face_load_name): Add support for language
- tags.
- Reduce array size of name strings in case of invalid entries.
- (tt_face_free_name): Updated.
-
- * docs/CHANGES: Updated.
-
-2017-01-25 Werner Lemberg <wl@gnu.org>
-
- [sfnt] s/TT_NameEntry/TT_Name/.
-
- * include/freetype/internal/tttypes.h (TT_NameEntryRec): Renamed
- to...
- (TT_NameRec): This.
- (TT_NameTableRec): Updated.
-
- * src/base/ftsnames.c (FT_Get_Sfnt_Name): Updated.
-
- * src/sfnt/sfdriver.c (sfnt_get_ps_name): Updated.
-
- * src/sfnt/sfobjs.c (tt_name_entry_ascii_from_utf16,
- tt_name_entry_ascii_from_other): Renamed to...
- (tt_name_ascii_from_utf16, tt_name_entry_ascii_from_other): This,
- respectively.
- (TT_NameEntry_ConvertFunc): Renamed to...
- (TT_Name_ConvertFunc): This.
- (tt_face_get_name): Updated.
-
- * src/sfnt/ttload.c (tt_face_load_name, tt_face_free_name):
- Updated.
-
-2017-01-24 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix Postscript name service for symbol fonts.
-
- * src/sfnt/sfdriver.c (sfnt_get_ps_name): Accept PID/EID=3/0
- entries also.
-
-2017-01-24 Werner Lemberg <wl@gnu.org>
-
- [truetype] For OpenType 1.7: s/preferred/typographic/ (sub)family.
-
- * include/freetype/ftsnames.h
- (FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY,
- FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY): New macros.
- (FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY,
- FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY): Deprecated.
-
- * include/freetype/ttnameid.h (TT_NAME_ID_TYPOGRAPHIC_FAMILY,
- TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY): New macros.
- (TT_NAME_ID_PREFERRED_FAMILY, TT_NAME_ID_PREFERRED_SUBFAMILY):
- Deprecated.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Updated.
-
- * docs/CHANGES: Updated.
-
-2017-01-23 Werner Lemberg <wl@gnu.org>
-
- [base] Add `FT_Set_Default_Properties' (#49187).
-
- * include/freetype/ftmodapi.h: Add declaration.
-
- * src/base/ftinit.c (ft_set_default_properties): Renamed to...
- (FT_Set_Default_Properties): ... this.
- (FT_Init_FreeType): Updated.
-
- * docs/CHANGES: Updated.
-
-2017-01-23 Werner Lemberg <wl@gnu.org>
-
- [truetype] Minor updates for OpenType 1.8.1.
-
- * src/truetype/ttgxvar.h (GX_MVarTable): `axisCount' has been
- removed from the specification; it is now reserved.
-
- * src/truetype/ttgxvar.c (ft_var_load_mvar): Updated.
- (GX_FVar_Head): Remove `countSizePairs'; the corresponding data
- field in the `MVAR' table is now reserved.
- (fvar_fields): Updated.
-
-2017-01-23 Werner Lemberg <wl@gnu.org>
-
- [truetype] Avoid segfault for invalid variation data.
-
- * src/truetype/ttgxvar.c (ft_var_load_item_variation_store): Assure
- `itemCount' is not zero.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=441
-
-2017-01-20 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (TT_RunIns): Adjust loop detector limits.
-
-2017-01-17 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/ttnameid.h: Updated to OpenType 1.8.1.
-
- (TT_APPLE_ID_FULL_UNICODE): New macro.
-
- (TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC,
- TT_MS_LANGID_UPPER_SORBIAN_GERMANY,
- TT_MS_LANGID_LOWER_SORBIAN_GERMANY, TT_MS_LANGID_IRISH_IRELAND,
- TT_MS_LANGID_INUKTITUT_CANADA_LATIN, TT_MS_LANGID_BASHKIR_RUSSIA,
- TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG,
- TT_MS_LANGID_GREENLANDIC_GREENLAND, TT_MS_LANGID_MAPUDUNGUN_CHILE,
- TT_MS_LANGID_MOHAWK_MOHAWK, TT_MS_LANGID_BRETON_FRANCE,
- TT_MS_LANGID_OCCITAN_FRANCE, TT_MS_LANGID_CORSICAN_FRANCE,
- TT_MS_LANGID_ALSATIAN_FRANCE, TT_MS_LANGID_YAKUT_RUSSIA,
- TT_MS_LANGID_KICHE_GUATEMALA, TT_MS_LANGID_KINYARWANDA_RWANDA,
- TT_MS_LANGID_WOLOF_SENEGAL, TT_MS_LANGID_DARI_AFGHANISTAN): New
- macros.
-
- (TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC): Fix value.
-
- (TT_MS_LANGID_GERMAN_LIECHTENSTEIN, TT_MS_LANGID_CATALAN_CATALAN,
- TT_MS_LANGID_CHINESE_MACAO, TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT,
- TT_MS_LANGID_KOREAN_KOREA, TT_MS_LANGID_ROMANSH_SWITZERLAND,
- TT_MS_LANGID_SLOVENIAN_SLOVENIA, TT_MS_LANGID_BASQUE_BASQUE,
- TT_MS_LANGID_SETSWANA_SOUTH_AFRICA,
- TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA,
- TT_MS_LANGID_ISIZULU_SOUTH_AFRICA, TT_MS_LANGID_KAZAKH_KAZAKHSTAN,
- TT_MS_LANGID_KYRGYZ_KYRGYZSTAN, TT_MS_LANGID_KISWAHILI_KENYA,
- TT_MS_LANGID_TATAR_RUSSIA, TT_MS_LANGID_ODIA_INDIA,
- TT_MS_LANGID_MONGOLIAN_PRC, TT_MS_LANGID_TIBETAN_PRC,
- TT_MS_LANGID_WELSH_UNITED_KINGDOM, TT_MS_LANGID_GALICIAN_GALICIAN,
- TT_MS_LANGID_SINHALA_SRI_LANKA, TT_MS_LANGID_TAMAZIGHT_ALGERIA,
- TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA, TT_MS_LANGID_YI_PRC,
- TT_MS_LANGID_UIGHUR_PRC): New aliases.
-
- Remove commented out code.
-
- (TT_NAME_ID_LIGHT_BACKGROUND, TT_NAME_ID_DARK_BACKGROUND,
- TT_NAME_ID_VARIATIONS_PREFIX): New macros.
-
- (HAVE_LIMIT_ON_IDENTS): Remove macro (which was useless since many
- years), use guarded long macros by default and define short versions
- as aliases for the long ones.
-
-2017-01-15 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (tt_apply_var): Handle underline parameters
- also.
-
-2017-01-11 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (ft_open_face_internal): Improve tracing.
-
-2017-01-11 Werner Lemberg <wl@gnu.org>
-
- [truetype] Actually use metrics variation service.
-
- * src/base/ftmm.c: Include FT_SERVICE_METRICS_VARIATIONS_H.
- (ft_face_get_mvar_service): New auxiliary function to look up
- metrics variation service.
- (FT_Set_Var_Design_Coordinates, FT_Set_MM_Blend_Coordinates,
- FT_Set_Var_Blend_Coordinates): Call metrics variation service.
-
- * src/truetype/ttobjs.c (tt_face_init): Use metrics variations for
- named instances.
-
-2017-01-11 Werner Lemberg <wl@gnu.org>
-
- [truetype] Provide metrics variation service.
-
- * include/freetype/internal/services/svmetric.h
- (FT_Metrics_Adjust_Func): Reduce number of necessary parameters.
-
- * src/truetype/ttgxvar.c: Include FT_LIST_H.
- (tt_size_reset_iterator): New auxiliary function for...
- (tt_apply_var): New function.
-
- * src/truetype/ttgxvar.h: Updated.
-
- * src/truetype/ttdriver.c (tt_service_metrics_variations): Add
- `tt_apply_mvar'.
-
- * include/freetype/internal/ftserv.h (FT_ServiceCache): Add metrics
- variation service.
-
-2017-01-11 Werner Lemberg <wl@gnu.org>
-
- [truetype] Parse `MVAR' table.
-
- * src/truetype/ttgxvar.h (MVAR_TAG_XXX): New macros for MVAR tags.
- (GX_Value, GX_MVarTable): New structures.
- (GX_Blend): Add it.
-
- * src/truetype/ttgxvar.c (GX_VALUE_SIZE, GX_VALUE_CASE,
- GX_GASP_CASE): New macros.
- (ft_var_get_value_pointer): New auxiliary function to get a pointer
- to a value from various SFNT tables already stored in `TT_Face'.
- (ft_var_load_mvar): New function.
- (TT_Get_MM_Var): Call it.
- (tt_done_blend): Updated.
-
-2017-01-11 Werner Lemberg <wl@gnu.org>
-
- [truetype] More preparations for MVAR support.
-
- * src/truetype/ttobjs.c (tt_size_reset): Add argument to make
- function only recompute ascender, descender, and height.
-
- * src/truetype/ttobjs.h: Updated.
-
- * src/truetype/ttdriver.c (tt_size_select, tt_size_request):
- Updated.
-
-2017-01-09 Werner Lemberg <wl@gnu.org>
-
- [pcf] Disable long family names by default.
-
- * include/freetype/config/ftoption.h
- (PCF_CONFIG_OPTION_LONG_FAMILY_NAMES): Comment out.
-
-2017-01-09 Werner Lemberg <wl@gnu.org>
-
- [pcf] Make long family names configurable.
-
- The change from 2016-09-29 was too radical (except for people using
- the openSuSE GNU/Linux distribution). To ameliorate the situation,
- PCF_CONFIG_OPTION_LONG_FAMILY_NAMES gets introduced which controls
- the feature; if set, a new PCF property option
- `no-long-family-names' can be used to switch this feature off.
-
- * include/freetype/config/ftoption.h, devel/ftoption.h
- (PCF_CONFIG_OPTION_LONG_FAMILY_NAMES): New option.
-
- * include/freetype/ftpcfdrv.h: New header file (only containing
- comments currently, used for building the documentation).
-
- * include/freetype/config/ftheader.h (FT_PCF_DRIVER_H): New macro.
-
- * src/pcf/pcf.h (PCF_Driver): Add `no_long_family_names' field.
-
- * src/pcf/pcfdrivr.c: Include FT_SERVICE_PROPERTIES_H and
- FT_PCF_DRIVER_H.
- (pcf_property_set, pcf_property_get): New functions.
- (pcf_service_properties): New service.
- (pcf_services): Updated.
- (pcf_driver_init) [PCF_CONFIG_OPTION_LONG_FAMILY_NAMES]: Handle
- `no_long_family_names'.
-
- * src/pcf/pcfread.c (pcf_load_font): Handle `no_long_family_names'
- and PCF_CONFIG_OPTION_LONG_FAMILY_NAMES.
-
- * docs/CHANGES: Updated.
-
-2017-01-09 Werner Lemberg <wl@gnu.org>
-
- [pcf] Introduce a driver structure.
-
- To be filled later on with something useful.
-
- * src/pcf/pcf.h (PCF_Driver): New structure.
-
- * src/pcf/pcfdrivr.c (pcf_driver_init, pcf_driver_done): New dummy
- functions.
- (pcf_driver_class): Updated.
-
-2017-01-08 Werner Lemberg <wl@gnu.org>
-
- [truetype] Again some GX code shuffling.
-
- We need this later on for MVAR also.
-
- * src/truetype/ttgxvar.c (tt_hadvance_adjust): Split off computing
- an item store variation delta into...
- (ft_var_get_item_delta): ...new function.
-
-2017-01-08 Werner Lemberg <wl@gnu.org>
-
- [truetype] Adjust font variation flags for MVAR.
-
- * include/freetype/internal/tttypes.h (TT_FACE_FLAG_VAR_XXX):
- Remove all flags related to MVAR; replace it with...
- (TT_FACE_FLAG_VAR_MVAR): ...this new macro.
- (TT_Face): Remove `mvar_support' field (which was still unused).
-
-2017-01-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] More GX code shuffling.
-
- We need this later on for MVAR also.
-
- * src/truetype/ttgxvar.c (tt_done_blend): Split off handling of item
- variation store into...
- (ft_var_done_item_variation_store): ...new function.
-
-2017-01-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] More generalization of GX stuff.
-
- We need this later on for MVAR also.
-
- * src/truetype/ttgxvar.c (ft_var_load_delta_set_index_mapping): Add
- parameters for delta-set index mapping and item variation store.
- (ft_var_load_item_variation_store): Add parameter for item variation
- store.
- s/hvarData/varData/.
- Move allocation of `hvar_table' to...
- (ft_var_load_hvar): ...this function.
- Updated.
-
-2017-01-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] Some GX structure renames for generalization.
-
- We need this later on for MVAR also.
-
- * src/truetype/ttgxvar.h (GX_HVarData): Renamed to...
- (GX_ItemVarData): ...this.
- (GX_HVarRegion): Renamed to...
- (GX_VarRegion): ...this.
- (GX_HVStore): Renamed to...
- (GX_ItemVarStore): ...this.
- (GX_WidthMap): Renamed to...
- (GX_DeltaSetIdxMap): ...this.
-
- (GX_HVarTable): Updated.
-
- * src/truetype/ttgxvar.c: Updated.
-
-2017-01-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] Code shuffling.
-
- * src/truetype/ttgxvar.c (ft_var_load_hvar): Split off loading of
- item variation store and delta set index mapping into...
- (ft_var_load_item_variation_store,
- ft_var_load_delta_set_index_mapping): ...new functions.
-
-2017-01-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] Add HVAR access without advance width map.
-
- * src/truetype/ttgxvar.c (ft_var_load_hvar): Handle case where
- `offsetToAdvanceWidthMapping' is zero.
- (tt_hadvance_adjust): Implement direct deltaSet access by glyph
- index.
-
-2017-01-06 Werner Lemberg <wl@gnu.org>
-
- [pcf] Revise driver.
-
- This commit improves tracing and handling of malformed fonts. In
- particular, the changes to `pcf_get_properties' fix
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=379
-
- * src/pcf/pcfread.c (tableNames): Use long names for better
- readability.
- (pcf_read_TOC): Allow at most 9 tables.
- (pcf_get_properties): Allow at most 256 properties.
- Limit strings array length to 256 * (65536 + 1) bytes.
- Better tracing.
- (pcf_get_metric): Trace metric data.
- (pcf_get_metrics): Allow at most 65536 metrics.
- Fix comparison of `metrics->ascent' and `metrics->descent' to avoid
- potential overflow.
- Better tracing.
- (pcf_get_bitmaps): Allow at most 65536 bitmaps.
- Better tracing.
- (pcf_get_encodings, pcf_get_accel): Better tracing.
-
- * src/pcf/pcfdrivr.c (PCF_Glyph_Load): Don't trace `format' details.
- These are now shown by `pcf_get_bitmaps'.
-
-2017-01-04 Werner Lemberg <wl@gnu.org>
-
- * src/pcf/pcfdrivr.c (PCF_Face_Init): Trace compression format.
-
-2017-01-04 Werner Lemberg <wl@gnu.org>
-
- [cff] More consistency checks for pure CFFs.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=378
-
- * src/cff/cffload.c (cff_font_load): Check element number and size
- of Name and Top DICT indices.
-
-2017-01-04 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Minor tracing improvement.
-
- * src/cff/cffobjs.c (cff_face_init), src/truetype/ttobjs.c
- (tt_face_init): Indent first tracing message from SFNT driver.
-
-2017-01-03 Werner Lemberg <wl@gnu.org>
-
- [truetype] Various minor fixes.
-
- * src/truetype/ttgload.c (TT_Load_Simple_Glyph): Check instruction
- size only if we do native hinting.
- (TT_Load_Glyph): Trace returned error code.
-
- * src/truetype/ttobjs.c (tt_size_run_fpgm, tt_size_run_prep): Trace
- returned error code.
- (tt_size_ready_bytecode): Don't run `prep' table if `fpgm' table is
- invalid.
-
-2017-01-03 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Don't fail if PCLT, EBLC (and similar tables) are invalid.
-
- These tables are optional.
-
- * src/sfnt/sfobjs.c (sfnt_load_face): Implement it.
-
-2017-01-03 Werner Lemberg <wl@gnu.org>
-
- * src/cff/cffparse.c (cff_parse_num): Simplify.
-
-2017-01-03 Werner Lemberg <wl@gnu.org>
-
- Various fixes for clang's undefined behaviour sanitizer.
-
- * src/cff/cffload.c (FT_fdot14ToFixed): Fix casting.
- (cff_blend_doBlend): Don't left-shift negative numbers.
- Handle 5-byte numbers byte by byte to avoid alignment issues.
-
- * src/cff/cffparse.c (cff_parse_num): Handle 5-byte numbers byte by
- byte to avoid alignment issues.
-
- * src/cid/cidload (cid_read_subrs): Do nothing if we don't have any
- subrs.
-
- * src/psaux/t1decode.c (t1_decode_parse_charstring): Fix tracing.
-
- * src/tools/glnames.py (main): Put `DEFINE_PSTABLES' guard around
- definition of `ft_get_adobe_glyph_index'.
-
- * src/psnames/pstables.h: Regenerated.
-
- * src/psnames/psmodule.c: Include `pstables.h' twice to get both
- declaration and definition.
-
- * src/truetype/ttgxvar.c (FT_fdot14ToFixed, FT_intToFixed): Fix
- casting.
-
-2017-01-01 Werner Lemberg <wl@gnu.org>
-
- [cff] Handle multiple `blend' operators in a row correctly.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=368
-
- * src/cff/cffload.c (cff_blend_doBlend): Adjust `parser->stack'
- pointers into `subFont->blend_stack' after reallocation.
-
-2017-01-01 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Return correct number of named instances for TTCs.
-
- Without this patch, requesting information for face index N returned
- the data for face index N+1 (or index 0).
-
- * src/sfnt/sfobjs.c (sfnt_init_face): Correctly adjust `face_index'
- for negative `face_instance_index' values.
-
-2016-12-31 Werner Lemberg <wl@gnu.org>
-
- */*: Use hex numbers for errors in tracing messages.
-
-2016-12-31 Werner Lemberg <wl@gnu.org>
-
- [truetype] Check axis count in HVAR table.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=362
-
- * src/truetype/ttgxvar.c (ft_var_load_hvar): Check axis count.
- (ft_var_load_avar): Fix tracing message.
-
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2016-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/ChangeLog.29 b/freetype/ChangeLog.29
deleted file mode 100644
index 251c056e..00000000
--- a/freetype/ChangeLog.29
+++ /dev/null
@@ -1,2352 +0,0 @@
-2018-05-01 Werner Lemberg <wl@gnu.org>
-
- * Version 2.9.1 released.
- =========================
-
-
- Tag sources with `VER-2-9-1'.
-
- * docs/VERSION.TXT: Add entry for version 2.9.1.
- * docs/CHANGES: Updated.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- src/base/ftver.rc, builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.9/2.9.1/, s/29/291/.
-
- * include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.
-
- * builds/unix/configure.raw (version_info): Set to 22:1:16.
- * CMakeLists.txt (VERSION_PATCH): Set to 1.
-
- * include/freetype/ftgasp.h: Use FT_BEGIN_HEADER and FT_END_HEADER.
-
-2018-04-26 Werner Lemberg <wl@gnu.org>
-
- Another fix for handling invalid format 2 cmaps.
-
- Sigh.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8003
-
- * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid
- an endless loop.
-
-2018-04-24 Ben Wagner <bungeman@google.com>
-
- [base] Avoid undefined behaviour in lcd filtering code (#53727).
-
- * src/base/ftlcdfil.c (ft_lcd_filter_fir, _ft_lcd_filter_legacy):
- Ensure `height > 0'.
-
-2018-04-22 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftoutln.c (FT_Outline_Decompose): Improve error tracing.
-
-2018-04-22 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Fix bitmap emboldening.
-
- Bug introduced after release 2.8.
-
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer): We use
- `FT_QALLOC_MULT', which doesn't zero out the buffer. Adjust the
- bitmap copying code to take care of this fact.
-
-2018-04-22 Werner Lemberg <wl@gnu.org>
-
- Another fix for handling invalid format 2 cmaps.
-
- The previous commit was incomplete.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7928
-
- * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition to avoid
- an endless loop.
-
-2018-04-19 Werner Lemberg <wl@gnu.org
-
- [autofit] Add support for Georgian Mtavruli characters.
-
- This will be part of the forthcoming Unicode 11.0.
-
- * src/autofit/afblue.dat: Add blue zone data for Mtavruli.
- * src/autofit/afblue.c, src/autofit/afblue.h: Regenerated.
-
- * src/autofit/afscript.h: Add Mtavruli standard character.
-
-2018-04-18 Werner Lemberg <wl@gnu.org>
-
- Fix handling of invalid format 2 cmaps.
-
- The problem was introduced after the last release.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7828
-
- * src/sfnt/ttcmap.c (tt_cmap2_char_next): Avoid endless loop.
-
-2018-04-17 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflow issues.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7739
-
- * src/truetype/ttinterp.c (Ins_CEILING): Use FT_PIX_CEIL_LONG.
-
-2018-04-16 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflow issues.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7718
-
- * src/truetype/ttinterp.c (Ins_MIRP): Use ADD_LONG.
-
-2018-04-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [build] Use `info' function of make 3.81.
-
- * configure, docs/INSTALL, docs/INSTALL.CROSS, docs/INSTALL.GNU,
- docs/INSTALL.UNIX, docs/MAKEPP: Bump make version requirements.
-
- * builds/detect.mk (std_setup): Replace `echo' with `info'.
- (dos_setup): Removed.
- * builds/unix/install.mk, builds/modules.mk, builds/dos/detect.mk,
- builds/windows/detect.mk, builds/os2/detect.mk: Updated.
- * builds/newline: No longer needed.
-
-2018-04-15 Werner Lemberg <wl@gnu.org>
-
- [truetype]: Limit `SLOOP' bytecode argument to 16 bits.
-
- This fixes
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7707
-
- * src/truetype/ttinterp.c (Ins_SLOOP): Do it.
-
-2018-04-14 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflow issues.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7652
-
- * src/truetype/ttinterp.c (Ins_MDAP): Use SUB_LONG.
-
-2018-04-14 Werner Lemberg <wl@gnu.org>
-
- [autofit] Update to Unicode 11.0.0.
-
- But no support new scripts (volunteers welcomed).
-
- * src/autofit/afranges.c (af_arab_nonbase_uniranges,
- af_beng_nonbase_uniranges, af_cakm_nonbase_uniranges,
- af_deva_nonbase_uniranges, af_geor_uniranges,
- af_gujr_nonbase_uniranges, af_mlym_nonbase_uniranges,
- af_nkoo_nonbase_uniranges, af_telu_nonbase_uniranges,
- af_hani_uniranges): Add new data.
-
-2018-04-10 Nikolaus Waxweiler <madigens@gmail.com>
-
- * CMakeLists.txt, builds/cmake/FindHarfBuzz.cmake: Extensive
- modernization measures.
-
- This brings up the minimum required CMake version to 2.8.12.
-
- The installation paths follow the GNU defaults now, e.g. installing on a
- 64 bit host will place binaries into the lib64/ folder on e.g. Fedora.
-
- Symbols are hidden by default (e.g. `-fvisibility=hidden' on GCC).
-
- CMake will no longer look for a C++ compiler.
-
- Library and .so version now match the Autotools build.
-
- Comments in the build file and informational messages now use platform
- agnostic example commands.
-
- ftoption.h and ftconfig.h are written directly without a redundant `-new'
- copy.
-
- External dependencies are expressed as option()s and will turn up as such
- in cmake-gui.
-
- Internal: Properties such as dependencies and include directories are now
- privately set on the freetype library instead of globally.
-
- The CPack definitions have been cleaned up, the `make dist' has been
- removed. Source packages generated with CPack don't contain Autotools
- files and aren't used by the maintainers anyway.
-
- On Windows, src/base/ftver.rc is compiled to decorate the library with
- version and copyright information.
-
- A pkg-config file is now generated and installed.
-
-2018-04-09 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflow issues.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7453
-
- * src/truetype/ttinterp.c (Round_Super, Round_Super_45): Use
- ADD_LONG and SUB_LONG.
-
-2018-04-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [windows, wince] Clean up legacy project files.
-
- * builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/freetype.dsp: Remove per-file compile flags.
-
-2018-04-04 Werner Lemberg <wl@gnu.org>
-
- [cff, type1] Sanitize `BlueFuzz' and `BlueShift'.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7371
-
- * src/cff/cffload.c (cff_load_private_dict): Sanitize
- `priv->blue_shift' and `priv->blue_fuzz' to avoid overflows later
- on.
-
- * src/type1/t1load.c (T1_Open_Face): Ditto.
-
-2018-04-04 Ben Wagner <bungeman@google.com>
-
- * src/truetype/ttobjs.c (trick_names): Add 3 tricky fonts (#53554),
- `DFHei-Md-HK-BF', `DFKaiShu-Md-HK-BF' and `DFMing-Bd-HK-BF'.
- (tt_check_trickyness_sfnt_ids): Add checksums for 3 tricky fonts
- in above.
-
-2018-04-01 Werner Lemberg <wl@gnu.org>
-
- * builds/toplevel.mk (work): Use $(SEP).
-
- This fixes the `make refdoc' using Cygwin: $(CAT) is `type' on this
- platform, and this program only understands backslashes in paths.
-
- Reported by Nikhil Ramakrishnan <ramakrishnan.nikhil@gmail.com>.
-
-2018-03-30 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix memory leak (only if tracing is on).
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var) [FT_DEBUG_LEVEL_TRACE}: Fix
- it.
-
-2018-03-23 Ben Wagner <bungeman@google.com>
-
- [sfnt] Correctly handle missing bitmaps in sbix format (#53404).
-
- * src/sfnt/ttfsbit.c (tt_face_load_sbix_image): Fix return value.
-
-2018-03-23 Ben Wagner <bungeman@google.com>
-
- [truetype] Fix advance of empty glyphs in bitmap fonts (#53393).
-
- * src/truetype/ttgload.c (TT_Load_Glyph): Apply scaling to metrics
- for empty bitmaps.
-
-2018-03-22 Werner Lemberg <wl@gnu.org>
-
- Remove `ftlcdfil.c' and `ftfntfmt.c' from build files (#53415).
-
- builds/amiga/makefile, builds/amiga/makefile.os4,
- builds/amiga/smakefile, builds/mac/FreeType.m68k_cfm.make.txt,
- builds/mac/FreeType.m68k_far.make.txt,
- builds/mac/FreeType.ppc_carbon.make.txt,
- builds/mac/FreeType.ppc_classic.make.txt,
- builds/symbian/freetype.mmp, builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/freetype.vcxproj.filters,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj, vms_make.com: Do it.
-
-2018-03-13 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttcmap.c (tt_cmap2_validate): Fix potential numeric
- overflow.
-
-2018-03-13 Werner Lemberg <wl@gnu.org>
-
- Fix cmap format 2 handling (#53320).
-
- The patch introduced for #52646 was not correct.
-
- * src/sfnt/ttcmap.c (tt_cmap2_char_next): Adjust condition.
-
-2018-03-10 Nikolaus Waxweiler <madigens@gmail.com>
-
- * CMakeLists.txt (BASE_SRCS): Update to changes from 2018-03-05.
-
-2018-03-09 Chun-wei Fan <fanc999@yahoo.com.tw>
-
- * CMakeLists.txt [win32]: Allow MSVC DLL builds (#53287).
-
- Do not limit DLL builds to MinGW, since we already have
- `__declspec(dllexport)' directives in `ftconfig.h'.
- Also suppress more warnings for POSIX functions.
-
-2018-03-08 Hugh McMaster <hugh.mcmaster@outlook.com>
-
- Make installation of `freetype-config' optional (#53093).
-
- * builds/unix/configure.raw: Add option `--enable-freetype-config'
- and set `INSTALL_FT2_CONFIG'.
- * builds/unix/unix-def.in (INSTALL_FT2_CONFIG): Define.
- * builds/unix/install.mk (install): Handle it.
-
-2018-03-05 Werner Lemberg <wl@gnu.org>
-
- Make `ftlcdfil.c' part of the `base' module.
-
- `ftobjs.c' needs `ft_lcd_padding'.
-
- Problem reported by duhuanpeng <548708880@qq.com>.
-
- * modules.cfg (BASE_EXTENSIONS): Don't include `ftlcdfil.c'.
-
- * src/base/ftbase.c: Include `ftlcdfil.c'.
- * src/base/rules.mk (BASE_SRC): Add `ftlcdfil.c'.
- * src/base/Jamfile (_sources): Adjusted.
-
- * docs/INSTALL.ANY: Updated.
-
-2018-03-05 Werner Lemberg <wl@gnu.org>
-
- Make `ftfntfmt.c' part of the `base' module.
-
- `ftobjs.c' needs `FT_Get_Font_Format'.
-
- Problem reported by duhuanpeng <548708880@qq.com>.
-
- * modules.cfg (BASE_EXTENSIONS): Don't include `ftfntfmt.c'.
-
- * src/base/ftbase.c: Include `ftfntfmt.c'.
- * src/base/rules.mk (BASE_SRC): Add `ftfntfmt.c'.
- * src/base/Jamfile (_sources): Adjusted.
-
- * docs/INSTALL.ANY: Updated.
-
-2018-03-01 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (TT_RunIns): Fix tracing arguments.
-
-2018-02-23 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/configure.raw: Need HarfBuzz 1.3.0 or newer.
-
- Problem reported by Alan Coopersmith <alan.coopersmith@oracle.com>.
-
-2018-02-17 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Prefer `CBDT'/`CBLC' over `glyf' table (#53154).
-
-2018-02-06 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflow issues.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6027
-
- * src/truetype/ttinterp.c (Ins_MSIRP, Ins_MIAP, Ins_MIRP): Use
- SUB_LONG; avoid FT_ABS.
-
-2018-02-04 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [unix] Use -fvisibility=hidden.
-
- It is now widely recommended that ELF shared libraries hide symbols
- except those with explicit __attribute__((visibility("default"))).
- This is supported by all major compilers and should rather be an
- option in libtool.
-
- * builds/unix/configure.raw: Add -fvisibility=hidden to CFLAGS.
- * builds/unix/ftconfig.in, builds/vms/ftconfig.h,
- include/freetype/config/ftconfig.h (FT_EXPORT): Use visibility
- attribute.
-
-2018-01-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Better protection against invalid VF data.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5739
-
- Bug introduced in commit 08cd62deedefe217f2ea50e392923ce8b5bc7ac7.
-
- * src/truetype/ttgxvar.c (TT_Set_Var_Design): Always initialize
- `normalizedcoords'.
-
-2018-01-27 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttinterp.c (Ins_GETVARIATION): Avoid NULL reference.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5736
-
-2018-01-27 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (tt_set_mm_blend): Minor.
-
-2018-01-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Better trace VF instances.
-
- * src/truetype/ttgxvar.c (ft_var_to_normalized): Don't emit number
- of coordinates.
- (TT_Get_MM_Var): Trace instance indices names.
- (TT_Set_Var_Design): Updated.
-
-2018-01-27 Werner Lemberg <wl@gnu.org>
-
- [truetype] Beautify tracing of VF axis records.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Show axis records in a
- table-like manner.
-
-2018-01-26 Ben Wagner <bungeman@google.com>
-
- [truetype] Fix multiple calls of `FT_Get_MM_Var' (#52955).
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Set
- `face->blend->num_axis' in case we have to initialize the
- `face->blend'.
-
-2018-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [apinames] Anonymous version map for GNU linker.
-
- * src/tools/apinames.c (PROGRAM_VERSION): Set to 0.3.
- (OutputFormat): Add `OUTPUT_GNU_VERMAP'.
- (names_dump): Handle it.
- (usage): Updated.
- (main): Handle new command line flag `-wL'.
-
-2018-01-21 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [unix] Call libtool to clean up.
-
- * builds/unix/install.mk (clean_project_unix, distclean_project_unix):
- Use libtool.
- * builds/freetype.mk: Minor.
-
-2018-01-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftver.rc: Fix mingw-w64 compilation.
-
-2018-01-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [build] Enable VERSIONINFO resource for Cygwin/MinGW.
-
- * builds/unix/configure.raw: Check for resource compiler.
- * builds/unix/unix-cc.in: Conditionally set up resource compiler.
- * builds/freetype.mk: Add conditional rule for `ftver.rc'.
- * src/base/ftver.rc: Copyright notice and year update.
-
-2018-01-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [build] Move VERSIONINFO resource.
-
- * builds/windows/vc2010/freetype.vcxproj: Updated.
- * builds/windows/ftver.rc: Move file from here...
- * src/base/ftver.rc: ... to here.
-
-2018-01-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [build] Expand dllexport/dllimport to Cygwin/MinGW.
-
- * include/freetype/config/ftconfig.h: Respect DLL_EXPORT,
- s/_MSC_VER/_WIN32/.
- * builds/unix/ftconfig.in: Replicate here.
- * builds/vms/ftconfig.h: Replicate here.
-
-2018-01-12 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [build] Improve and document MSVC build.
-
- * include/freetype/config/ftconfig.h: Guard dllexport/dllimport
- attributes with _DLL and FT2_DLLIMPORT.
- * builds/windows/vc2010/index.html: Update documentation.
-
-2018-01-10 Steve Robinson <ssrobins@gmail.com>
-
- * CMakeLists.txt [win32]: Suppress warnings for POSIX functions.
-
-2018-01-10 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Correctly handle Flex features (#52846).
-
- * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdVMOVETO,
- cf2_cmdHMOVETO>: Do not move if doing Flex.
-
-2018-01-09 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * builds/windows/vc2010/freetype.sln: Synchronize with the project.
-
-2018-01-08 Werner Lemberg <wl@gnu.org>
-
- * Version 2.9 released.
- =======================
-
-
- Tag sources with `VER-2-9'.
-
- * docs/VERSION.TXT: Add entry for version 2.9.
-
- * README, Jamfile (RefDoc), builds/windows/vc2005/freetype.vcproj,
- builds/windows/vc2005/index.html,
- builds/windows/vc2008/freetype.vcproj,
- builds/windows/vc2008/index.html,
- builds/windows/vc2010/freetype.vcxproj,
- builds/windows/vc2010/index.html,
- builds/windows/visualc/freetype.dsp,
- builds/windows/visualc/freetype.vcproj,
- builds/windows/visualc/index.html,
- builds/windows/visualce/freetype.dsp,
- builds/windows/visualce/freetype.vcproj,
- builds/windows/visualce/index.html,
- builds/windows/ftver.rc,
- builds/wince/vc2005-ce/freetype.vcproj,
- builds/wince/vc2005-ce/index.html,
- builds/wince/vc2008-ce/freetype.vcproj,
- builds/wince/vc2008-ce/index.html: s/2.8.1/2.9/, s/281/29/.
-
- * include/freetype/freetype.h (FREETYPE_MINOR): Set to 9.
- (FREETYPE_PATCH): Set to 0.
-
- * builds/unix/configure.raw (version_info): Set to 22:0:16.
- * CMakeLists.txt (VERSION_PATCH): Set to 0.
-
-2018-01-07 Werner Lemberg <wl@gnu.org>
-
- Add check for librt, needed for `ftbench' (#52824).
-
- * builds/unix/configure.raw (LIB_CLOCK_GETTIME): Define; this will
- hold `-lrt' if necessary.
-
- * builds/unix/unix-cc.in (LIB_CLOCK_GETTIME): New variable.
-
-2018-01-07 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Fix Type 1 glyphs with too many stem hints.
-
- According to the CFF specification, charstrings can have up to 96 stem
- hints. Due to hint replacement routines in Type 1 charstrings, some
- glyphs are rejected by the Adobe engine, which implements the above
- limit. This fix turns off hinting for such glyphs.
-
- * src/psaux/pshints.c (cf2_hintmap_build): Reset the error from calling
- `cf2_hintmask_setAll' on a problematic Type 1 charstring and turn off
- hinting.
-
-2018-01-06 Werner Lemberg <wl@gnu.org>
-
- Add `FT_Done_MM_Var'.
-
- This is necessary in case the application's memory routines differ
- from FreeType. A typical example is a Python application on Windows
- that calls FreeType compiled as a DLL via the `ctypes' interface.
-
- * include/freetype/ftmm.h, src/base/ftmm.c (FT_Done_MM_Var): Declare
- and define.
-
- * docs/CHANGES: Updated.
-
-2018-01-03 Werner Lemberg <wl@gnu.org>
-
- [truetype] Round offsets of glyph components only if hinting is on.
-
- * src/truetype/ttgload.c (TT_Process_Composite_Component): Implement
- it.
-
-2018-01-03 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (ft_var_to_design): Remove dead code.
-
- This is a better fix than the previous commit, which is now
- reverted.
-
-2018-01-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Move internal LCD-related declarations.
-
- * include/freetype/ftlcdfil.h (ft_lcd_padding, ft_lcd_filter_fir):
- Move from here...
- * include/freetype/internal/ftobjs.h: ... to here.
-
-2018-01-03 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * include/freetype/config/ftconfig.h (FT_EXPORT, FT_EXPORT_DEF)
- [_MSC_VER]: Limit Visual C++ attributes.
-
-2018-01-03 Werner Lemberg <wl@gnu.org>
-
- [truetype] Make blend/design coordinate round-tripping work.
-
- Behdad reported that setting blend coordinates, then getting design
- coordinates did incorrectly return the default instance's
- coordinates.
-
- * src/truetype/ttgxvar.c (tt_set_mm_blend): Fix it.
-
-2017-12-31 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttcmap.c (tt_cmap2_char_next): Fix endless loop.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4838
-
-2017-12-31 Werner Lemberg <wl@gnu.org>
-
- Synchronize other Windows project files.
-
- * builds/windows/*: Add missing files.
-
-2017-12-31 Werner Lemberg <wl@gnu.org>
-
- Update Visual C 2010 project files.
-
- Problem reported by Hin-Tak.
-
- * builds/windows/vc2010/freetype.vcxproj: Add files `ftbdf.c' and
- `ftcid.c'.
- Sort entries.
- * builds/windows/vc2010/freetype.vcxproj.filter: Ditto.
- Fix members of `FT_MODULE' group.
-
-2017-12-30 Werner Lemberg <wl@gnu.org>
-
- * builds/vms/ftconfig.h: Synchronize with unix `ftconfig.in' file.
-
-2017-12-28 Werner Lemberg <wl@gnu.org>
-
- * builds/unix/ftconfig.in: Synchronize with main `ftconfig.h' file.
-
- Reported by Nikolaus.
-
-2017-12-27 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warnings.
-
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Make `pitch' and
- `new_pitch' unsigned.
-
- * src/base/ftpsprop.c: Include FT_INTERNAL_POSTSCRIPT_PROPS_H.
-
-2017-12-27 Werner Lemberg <wl@gnu.org>
-
- Fixes for `make multi'.
-
- * include/freetype/internal/ftpsprop.h: Use `FT_BASE_CALLBACK'.
- (ps_property_get): Harmonize declaration with corresponding
- function typedef.
-
- * include/freety[e/internal/fttrace.h: Add `trace_psprops'.
-
- * src/base/ftpsprop.c: Include necessary header files.
- (FT_COMPONENT): Define.
- (ps_property_set): Tag with `FT_BASE_CALLBACK_DEF'.
- (ps_property_get): Tag with `FT_BASE_CALLBACK_DEF'.
- Harmonize declaration with corresponding function typedef.
-
-2017-12-27 Werner Lemberg <wl@gnu.org>
-
- Provide support for intra-module callback functions.
-
- This is needed especially for `make multi' with C++.
-
- * include/freetype/config/ftconfig.h (FT_BASE_CALLBACK,
- FT_BASE_CALLBACK_DEF): New macros.
-
-2017-12-25 Ewald Hew <ewaldhew@gmail.com>
-
- Move PostScript drivers' property handlers to `base'.
-
- This reduces the amount of duplicated code across PostScript
- drivers.
-
- * src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c
- ({cff,cid,t1}_property_{get,set}): Moved to...
- * include/freetype/internal/ftpsprop.h: ...this new file.
- (ps_property_{get,set}): New functions to replace moved ones.
-
- * src/base/ftpsprop.c: New file that implements above functions.
-
- * include/freetype/internal/internal.h
- (FT_INTERNAL_POSTSCRIPT_PROPS_H): New macro.
-
- * src/cff/cffdrivr.c, src/cid/cidriver.c, src/type1/t1driver.c:
- Updated.
-
- * src/base/Jamfile, src/base/rules.mk (BASE_SRC), src/base/ftbase.c:
- Updated.
-
-2017-12-20 Werner Lemberg <wl@gnu.org>
-
- Speed up FT_Set_Var_{Design,Blend}_Coordinates if curr == new.
-
- We exit early if the current design or blend coordinates are
- identical to the new ones.
-
- * src/truetype/ttgxvar.c (tt_set_mm_blend, TT_Set_Var_Design):
- Implement it, returning internal error code -1 if there will be no
- variation change.
-
- * src/type1/t1load.c (t1_set_mm_blend): Ditto.
-
- * src/base/ftmm.c (FT_Set_Var_Design_Coordinates,
- FT_Set_MM_Blend_Coordinates, FT_Set_Var_Blend_Coordinates): Updated.
-
-2017-12-18 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix charmap type 2 iterator (#52646).
-
- The subsetted demo font of the report that exhibits the bug has a
- very unusual type 2 cmap for Unicode(!): It contains only two
- sub-headers, one for one-byte characters (covering the range 0x20 to
- 0xFA), and a second one for higher byte 0x01 (just for character
- code U+0131).
-
- Before this commit, the iterator wasn't able to correctly handle a
- sub-header for higher byte 0x01.
-
- * src/sfnt/ttcmap.c (tt_cmap2_char_next): Fix character increment
- for outer loop.
-
-2017-12-18 Matthias Clasen <matthias.clasen@gmail.com>
-
- [truetype] Fix clamping, minor tracing code beautification.
-
- * src/truetype/ttgxvar.c (ft_var_to_normalized): Trace number of
- design coordinates.
- Use clamped value.
-
-2017-12-18 Werner Lemberg <wl@gnu.org>
-
- * src/*/*: Only use `ft_' and `FT_' variants of stdc library stuff.
-
-2017-12-18 Werner Lemberg <wl@gnu.org>
-
- * src/truetype/ttgxvar.c (tt_face_vary_cvt): Add size guard (#52688).
-
-2017-12-18 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix previous commit.
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Correctly handle
- unhinted phantom points, which must be properly scaled.
-
-2017-12-18 Werner Lemberg <wl@gnu.org>
-
- [truetype] Don't apply HVAR and VVAR deltas twice (#52683).
-
- * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Always adjust
- `pp1' to `pp4', except if we have an HVAR and/or VVAR table.
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Handle
- alternative code branch identically w.r.t. presence of an HVAR
- and/or VVAR table.
-
-2017-12-17 Jonathan Kew <jfkthame@gmail.com>
-
- [truetype] Correctly handle variation font phantom points (#52683).
-
- * src/truetype/ttgxvar.c (TT_Vary_Apply_Glyph_Deltas): Fix phantom
- point indices.
-
-2017-12-17 Jonathan Kew <jfkthame@gmail.com>
-
- Fix incorrect advance width scaling (#52683).
-
- * src/base/ftadvance.c (FT_Get_Advances): Always respect the
- FT_LOAD_NO_SCALE flag if present.
-
-2017-12-16 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * builds/windows/vc2010/freetype.vcxproj: AfterBuild copy.
- * objs/.gitignore: Ignore almost everything.
-
-2017-12-11 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warning (#52640).
-
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Remove unused
- variable.
-
-2017-12-08 Azzuro <azzuro@team-mediaportal.com>
-
- * builds/windows/vc2010/freetype.vcxproj: Adjust output directory.
-
- This allows builds with different configurations in parallel.
-
-2017-12-08 Werner Lemberg <wl@gnu.org>
-
- Fix `make setup dos', second try (#52622).
-
- * builds/detect.mk (dos_setup): Don't use literal `>' character at
- all. Mixing the different escaping rules from make, dos, and
- windows is too fragile.
-
-2017-12-08 Werner Lemberg <wl@gnu.org>
-
- [docmaker] Fix code section parsing.
-
- Stuff like
-
- {
- <bla>
- }
-
- confused the parser, which incorrectly treated `<bla>' as a markup
- tag.
-
- * src/tools/docmaker/content.py (ContentProcessor::process_content):
- Apply `re_markup_tags' only outside of code sections.
-
-2017-12-08 Werner Lemberg <wl@gnu.org>
-
- New `ftdriver.h' file, covering all driver modules.
-
- This reduces redundancy and increases synergy; it also reduces the
- number of header files.
-
- * include/freetype/config/ftheader.h (FT_DRIVER_H): New macro.
- (FT_AUTOHINTER_H, FT_CFF_DRIVER_H, FT_TRUETYPE_DRIVER_H,
- FT_PCF_DRIVER_H, FT_TYPE1_DRIVER_H): Make them aliases to
- FT_DRIVER_H.
-
- * include/freetype/ftautoh.h, include/freetype/ftcffdrv.h,
- include/freetype/ftpcfdrv.h, include/freetype/ftt1drv.h,
- include/freetype/ftttdrv.h: Replaced with...
- * include/freetype/ftdriver.h: ...this new file.
- (FT_CFF_HINTING_ADOBE, FT_T1_HINTING_ADOBE): Renamed to...
- (FT_HINTING_ADOBE): ... this new macro.
- (FT_CFF_HINTING_FREETYPE, FT_T1_HINTING_FREETYPE): Renamed to...
- (FT_HINTING_FREETYPE): ... this new macro.
-
- * src/*/*: Updated accordingly.
-
-2017-12-08 Werner Lemberg <wl@gnu.org>
-
- Move `ftdriver.h' to `ftdrv.h'.
-
- * include/freetype/internal/ftdriver.h: Renamed to...
- * include/freetype/internal/ftdrv.h: ... this name.
-
- * include/freetype/internal/internal.h (FT_INTERNAL_DRIVER_H):
- Updated.
-
-2017-12-08 Werner Lemberg <wl@gnu.org>
-
- Fix access to uninitalized memory (#52613).
-
- Also reported as
-
- https://bugs.chromium.org/p/chromium/issues/detail?id=791317
-
- * src/base/ftbitmap.c (ft_bitmap_assure_buffer): If increasing the
- bitmap size needs a larger bitmap buffer, assure that the new memory
- areas are initialized also.
-
-2017-12-08 Werner Lemberg <wl@gnu.org>
-
- Fix `make setup dos' (#52622).
-
- * builds/detect.mk (dos_setup): Properly escape literal `>'
- character.
-
-2017-12-07 Werner Lemberg <wl@gnu.org>
-
- Fix C++ compilation.
-
- * src/psaux/psauxmod.h: Use FT_CALLBACK_TABLE macro where necessary.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Fix warning.
-
-2017-12-07 Werner Lemberg <wl@gnu.org>
-
- Fix `make multi'.
-
- * include/freetype/internal/fttrace.h: Remove unused tracing macros.
- s/pshalgo2/pshalgo/.
- Add `trace_cffdecode'.
- * src/pshinter/pshalgo.c (FT_COMPONENT): Updated.
-
- * src/cff/cffload.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
- * src/cff/cffobjs.c: Include FT_SERVICE_METRICS_VARIATIONS_H and
- FT_SERVICE_CFF_TABLE_LOAD_H.
-
- * src/cid/cidriver.c: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
-
- * src/psaux/cffdecode.c: Include FT_FREETYPE_H and
- FT_INTERNAL_DEBUG_H.
- (FT_COMPONENT): Define.
- * src/psaux/cffdecode.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
- * src/psaux/psauxmod.h: Include FT_INTERNAL_POSTSCRIPT_AUX_H.
- Declare `cff_builder_funcs' and `ps_builder_funcs'.
- * src/psaux/psft.c: Include `psobjs.h' and `cffdecode.h'.
- * src/psaux/psobjs.c : Include `psauxmod.h'.
-
-2017-12-07 Werner Lemberg <wl@gnu.org>
-
- * include/freetype/config/ftheader.h: Some clean-up.
-
- This commit removes documentation of deprecated macros and does some
- minor streamlining.
-
-2017-12-06 Werner Lemberg <wl@gnu.org>
-
- * builds/symbian/bld.inf: Updated.
-
-2017-12-06 Werner Lemberg <wl@gnu.org>
-
- New header file `ftparams.h' that collects all parameter tags.
-
- * include/freetype/config/ftheader.h (FT_PARAMETER_TAGS_H): New
- macro.
- (FT_TRUETYPE_UNPATENTED_H, FT_UNPATENTED_HINTING_H): Define it to
- `ftparams.h'.
-
- * include/freetype/ftautoh.h, include/freetype/ftcffdrv.h,
- include/freetype/ftincrem.h, include/freetype/ftlcdfil.h,
- include/freetype/ftsnames.h, include/freetype/ftt1drv.h: Include
- FT_PARAMETER_TAGS_H.
- Move FT_PARAM_TAG_XXX definitions to...
- * include/freetype/ftparams.h: ...this new file.
-
- * include/freetype/ttunpat.h: Remove. No longer needed.
-
-2017-12-05 Werner Lemberg <wl@gnu.org>
-
- Improve tracing messages by using singular and plural forms.
-
- * src/*/*.c: Implement it.
-
-2017-12-04 Werner Lemberg <wl@gnu.org>
-
- [truetype] Allow shared points in `cvar' table (#52532).
-
- * src/truetype/ttgxvar.c (tt_face_vary_cvt): Implement it by copying
- and adjusting the corresponding code from
- `TT_Vary_Apply_Glyph_Deltas'.
-
-2017-11-28 Werner Lemberg <wl@gnu.org>
-
- [truetype] Improving tracing of composite glyphs.
-
- * src/truetype/ttgload.c (TT_Load_Composite_Glyph)
- [FT_DEBUG_LEVEL_TRACE]: Show composite glyph information.
-
-2017-11-27 Werner Lemberg <wl@gnu.org>
-
- [type1] Allow (again) `/Encoding' with >256 elements (#52464).
-
- In version 2.6.1, this has been disallowed to better reject
- malformed fonts; however, this restriction was too strong. This
- time, we only take the first 256 elements into account, since
- encoding arrays are always accessed with a 8bit integer, according
- to the PostScript Language Reference.
-
- * src/type1/t1load.c (parse_encoding): Implement it.
-
-2017-11-27 Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
-
- Fix last commit (#52522).
-
- * builds/freetype.mk: Set `FT_OPTION_H' and `FTOPTION_FLAG'
- properly if we have `ftoption.h' in `BUILD_DIR'.
-
-2017-11-24 Werner Lemberg <wl@gnu.org>
-
- [unix] Install a massaged `ftoption.h' file (#51780).
-
- * builds/unix/configure.raw (ftoption_set, ftoption_unset): New
- auxiliary functions to construct...
- (FTOPTION_H_SED): ... this new variable.
- Apply it as a sed argument while copying `ftoption.h' to the
- `builds/unix' directory (using `AC_CONFIG_FILES').
- Simplify code of test that checks cpp's computation of bit length
- (the test previously created an empty `ftoption.h' file and deleted
- it immediately afterwards); without this change, it can happen on my
- GNU/Linux box that `configure's execution of `config.status' doesn't
- create `ftoption.h' (no idea why this happens).
-
- * builds/unix/install.mk (install): Install
- `builds/unix/ftoption.h'.
-
- * builds/unix/unix-def.in (DISTCLEAN): Updated.
-
- * builds/unix/.gitignore: Updated.
-
-2017-11-23 Tor Andersson <tor.andersson@artifex.com>
-
- Silence unused function warnings (#52465).
-
- Some static function declarations cause unused function warnings if
- certain config options are turned off via `ftoption.h'.
-
- * src/base/ftbase.h, src/base/ftrfork.c, src/sfnt/ttbdf.h,
- src/truetype/ttgxvar.h: Add #ifdef guards around these sections.
-
-2017-11-22 Ewald Hew <ewaldhew@gmail.com>
-
- * src/psaux/psft.c (cf2_setGlyphWidth): Check format before setting.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4377
-
-2017-11-22 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Fix CFF advance widths. (#52466)
-
- Glyph advance widths were being written to the new `PS_Decoder' but not
- saved to the underlying format specific decoder. This caused pure CFF
- fonts to have bad advance width.
-
- * include/freetype/internal/psaux.h (PS_Decoder): Change `glyph_width'
- field to pointer.
- Remove unused fields.
- * src/psaux/psobjs.c (ps_decoder_init): Change `glyph_width' from copy
- to reference.
- Remove unused.
- * src/psaux/psft.c (cf2_setGlyphWidth): Update code.
-
-2017-11-15 Vlad Tsyrklevich <vtsyrklevich@google.com>
-
- * include/freetype/ftrender.h: Fix `FT_Renderer_RenderFunc' type.
-
-2017-11-14 Nikolaus Waxweiler <madigens@gmail.com>
-
- Use Adobe hinting engine for `light' hinting of both CFF and Type 1.
-
- Since Ewald Hew factored the Adobe hinting engine out of the CFF
- driver code, we can now use it on Type 1 (and CID) font formats, as
- both have the same hinting philosophy.
-
- This change activates the Adobe hinter when in LIGHT mode, and
- therefore always unless explicitly asking for the auto-hinter. This
- makes LIGHT behavior consistent with CFF fonts. As of this commit,
- the hinting engine table looks as follows.
-
- LIGHT NORMAL
- -------------------------
- TrueType Auto v40
- CFF Adobe Adobe
- Type 1 Adobe Adobe
-
-2017-11-10 Yuri Levchenko <yuri_levchenko@boolat.com>
-
- * CMakeLists.txt: Add `DISABLE_FORCE_DEBUG_PREFIX' option.
-
-2017-11-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/base/ftobjs.c (FT_Load_Glyph): Relocate condition.
-
-2017-11-06 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * src/smooth/ftgrays.c (gray_set_cell): Fix uninitialized variables.
-
-2017-11-03 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Fix PostScript interpreter rewinding in Type 1 mode. (#52251)
-
- The interpreter in Type 1 mode rewinds the charstring after collecting
- all hints for building the initial hintmap (commit d52dd7f). However,
- some charstrings use `endchar' in a final subroutine call, rewinding to
- the start of that subroutine, and only a small section of the actual
- glyph is drawn.
-
- * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdENDCHAR>:
- Ensure we are on the top level charstring before rewinding.
-
-2017-11-03 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
-
- [truetype] Add more tricky fonts.
-
- See the report by Yang Yinsen.
- https://lists.gnu.org/archive/html/freetype-devel/2017-11/msg00000.html
-
- * src/truetype/ttobjs.c (trick_names): Add `DFGothic-EB',
- `DFGyoSho-Lt', `DFHSGothic-W5', `DFHSMincho-W3' and `DFHSMincho-W7'.
- (tt_check_trickyness_sfnt_ids): Add checksums for DFGothic-EB,
- DFGyoSho-Lt, DFHSGothic-W5, DFHSMincho-W3 and DFHSMincho-W7. Also
- add checksums for DLCLiShu and DLCHayBold which their family names
- were already listed but their checksums were previously unknown.
-
-2017-11-01 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Fix complex rendering at high ppem.
-
- We used to split large glyphs into horizontal bands and continue
- bisecting them still horizontally if that was not enough. This is
- guaranteed to fail when a single scanline cannot fit into the
- rendering memory pool. Now we bisect the bands vertically so that
- the smallest unit is a column of the band height, which is guranteed
- to fit into memory.
-
- * src/smooth/ftgrays.c (gray_convert_glyph): Implement it.
-
-2017-10-20 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth] Improve complex rendering at high ppem.
-
- At large sizes almost but not exactly horizontal segments can quickly
- drain the rendering pool. This patch at least avoids filling the pool
- with trivial cells. Beyond this, we can only increase the pool size.
-
- Reported, analyzed, and tested by Colin Fahey.
-
- * src/smooth/ftgrays.c (gray_set_cell): Do not record trivial cells.
-
-2017-10-20 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Improve tracing in FT_Load_Glyph, FT_*_Size.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Tag tracing messages with
- function name, glyph index, and load flags.
- (FT_Select_Metrics, FT_Request_Metrics): Remove all tracing.
- (FT_Select_Size, FT_Request_Size): Improve tracing.
-
-2017-10-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Improve tracing in FT_Render_Glyph.
-
- * src/base/ftobjs.c (FT_Render_Glyph_Internal): Add total coverage
- calculations and downgrade Netpbm dump to bitmap:7.
-
-2017-10-15 Ewald Hew <ewaldhew@gmail.com>
-
- [cff] Fix segfault on missing `psaux' (#52218)
-
- * src/cff/cffload.c (cff_done_blend): Add a check for possible nullptr.
-
- * modules.cfg: Update dependency list.
-
-2017-10-15 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base, cff] Fix MSVC warnings.
-
- * src/base/ftobjs.c (FT_New_Library): C4702: unreachable code.
- (ft_glyphslot_preset_bitmap): C4244: possible loss of data.
- * src/cff/cffload.c (cff_blend_doBlend): C4244: possible loss of data.
- Turn `sum' into unsigned.
-
-2017-10-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [base] Netpbm image tracing.
-
- * src/base/ftobjs.c (FT_Load_Glyph): Trace bitmap size.
- (FT_Render_Glyph_Internal): Trace bitmap in Netpbm format.
-
- * src/smooth/ftgrays.c (gray_sweep): Sweep remnants of span tracing.
-
-2017-10-14 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- * builds/windows/ftdebug.c (FT_Message): Print to stderr.
- * builds/wince/ftdebug.c (FT_Message): Ditto.
-
-2017-10-14 Behdad Esfahbod <behdad@behdad.org>
-
- [afshaper] Delay creating `hb_set' objects until needed.
-
- In runs on Noto Naskh Arabic, this results in 89 sets created
- instead of 340 before. Makes auto-hinter setup with HarfBuzz
- enabled 20% to 30% faster.
-
- * src/autofit/afshaper.c (af_shaper_get_coverage): Implement it.
-
-2017-10-12 Ewald Hew <ewaldhew@gmail.com>
-
- [type1, cid] Add hinting engine switch.
-
- Implement property service in `type1' and `cid' drivers to allow
- switching between FreeType or Adobe hinting engine when both are
- available.
-
- * src/cid/cidriver.c (cid_property_{set,get}, cid_services),
- src/type1/t1driver.c (t1_property_{set,get}, t1_services): Add
- Properties service.
-
- * src/cid/cidobjs.c (cid_driver_init), src/type1/t1objs.c
- (T1_Driver_Init): Add default property values.
-
-2017-10-12 Ewald Hew <ewaldhew@gmail.com>
-
- Add T1_CONFIG_OPTION_OLD_ENGINE configuration option.
-
- This controls whether the old Type 1 engine gets compiled into FreeType.
- It is disabled by default.
-
- * devel/ftoption.h, include/freetype/config/ftoption.h
- (T1_CONFIG_OPTION_OLD_ENGINE): New macro.
-
- * include/freetype/internal/psaux.h (PS_Decoder): Remove unused field.
- * include/freetype/internal/psaux.h, src/cid/cidgload.c
- (cid_load_glyph), src/psaux/psauxmod.c, src/psaux/psobjs.c
- (ps_builder_add_point), src/psaux/t1decode.c
- (t1_lookup_glyph_by_stdcharcode, t1_decoder_parse_glyph,
- t1operator_seac, t1_decoder_parse_charstrings), src/psaux/t1decode.h,
- src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Surround
- relevant code with macro.
- Minor code changes.
-
-2017-10-12 Ewald Hew <ewaldhew@gmail.com>
-
- Extract width parsing from Type 1 parser.
-
- Duplicate the fast advance width calculations from the old parser.
- This is to facilitate adding options for compiling out the old parser.
-
- * src/psaux/t1decode.{c,h} (t1_decoder_parse_metrics): New function.
- * include/freetype/internal/psaux.h (T1_Decoder_Funcs): New entry
- `parse_metrics'.
- * src/psaux/psauxmod.c: Set the new entry.
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String),
- src/cid/cidgload.c (cid_load_glyph): Separate
- conditional for selecting engine.
-
-2017-10-09 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftoutln.c (FT_Outline_Translate): Fix integer overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/chromium/issues/detail?id=772775
-
-2017-10-08 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Integer overflows.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3579
-
-2017-10-07 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Adjust behaviour of PS font names for variation fonts.
-
- * src/sfnt/sfdriver.c (sfnt_get_var_ps_name): Use a named instance's
- PS name only if no variation is applied.
-
-2017-10-07 Werner Lemberg <wl@gnu.org>
-
- [cff, truetype] Adjust behaviour of named instances.
-
- This commit completely separates the interaction between named
- instances and variation functions. In particular, resetting the
- variation returns to the current named instance (if set) and not to
- the base font.
-
- As a side effect, variation functions no longer change the named
- instance index.
-
- * src/cff/cffobjs.c (cff_face_init): Use MM service's `set_instance'
- function.
- Also apply `MVAR' table to named instances.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Add cast.
- (tt_set_mm_blend): No longer check whether requested variation
- coincides with a named instance.
- (TT_Set_Var_Design): Use current named instance for default
- coordinates.
- * src/truetype/ttobjs.c (tt_face_init): Use `TT_Set_Named_Instance'.
-
-2017-10-07 Werner Lemberg <wl@gnu.org>
-
- Make `FT_Set_Named_Instance' work.
-
- * src/cff/cffdrivr.c (cff_set_instance): New function.
- (cff_service_multi_masters): Register it.
-
- * src/truetype/ttgxvar.c (TT_Set_Named_Instance): New function.
- * src/truetype/ttgxvar.h: Updated.
- * src/truetype/ttdriver.c (tt_service_gx_multi_masters): Register
- it.
-
- * src/type1/t1load.c (T1_Reset_MM_Blend): New function.
- * src/type1/t1load.h: Updated.
- * src/type1/t1driver.c (t1_service_multi_masters): Register it.
-
-2017-10-07 Werner Lemberg <wl@gnu.org>
-
- Make `FT_FACE_FLAG_VARIATION' work.
-
- * include/freetype/internal/tttypes.h (TT_Face): Remove
- `is_default_instance'; this can be replaced with a combination of
- `FT_IS_VARIATION' and `FT_IS_INSTANCE'.
-
- * src/cff/cffdrivr.c (cff_get_advances): Updated.
-
- * src/sfnt/sfdriver.c (sfnt_get_ps_name), src/sfnt/sfobjs.c
- (sfnt_init_face): Updated.
-
- * src/truetype/ttdriver.c (tt_get_advances), src/truetype/ttgload.c
- (TT_Process_Simple_Glyph, load_truetype_glyph, IS_DEFAULT_INSTANCE),
- src/truetype/ttgxvar.c (tt_set_mm_blend): Updated.
- * src/truetype/ttgxvar.c (TT_Set_MM_Blend, TT_Set_Var_Design):
- Handle `FT_FACE_FLAG_VARIATION'.
-
- * src/type1/t1load.c (T1_Set_MM_Blend, T1_Set_MM_Design): Handle
- `FT_FACE_FLAG_VARIATION'.
-
-2017-10-07 Werner Lemberg <wl@gnu.org>
-
- New function `FT_Set_Named_Instance'.
-
- No effect yet.
-
- * src/base/ftmm.c (FT_Set_Named_Instance): New function.
-
- * include/freetype/ftmm.h: Updated.
-
-2017-10-07 Werner Lemberg <wl@gnu.org>
-
- Add macros for checking whether a font variation is active.
-
- * include/freetype/freetype.h (FT_FACE_FLAG_VARIATION,
- FT_IS_VARIATION): New macros.
- No effect yet.
-
-2017-10-07 Werner Lemberg <wl@gnu.org>
-
- Add framework for setting named instance in MM service.
-
- * include/freetype/internal/services/svmm.h (FT_Set_Instance_Func):
- New function typedef.
- (MultiMasters): Add `set_instance' member.
- (FT_DEFINE_SERVICE_MULTIMASTERSREC): Updated.
-
- * src/cff/cffdrivr.c (cff_service_multi_masters),
- src/truetype/ttdriver (tt_service_gx_multi_masters),
- src/type1/t1driver.c (t1_service_multi_masters): Updated.
-
-2017-10-07 Werner Lemberg <wl@gnu.org>
-
- [type1] Minor code shuffling.
-
- * src/type1/t1load.c (T1_Set_MM_Blend): Make it a wrapper of...
- (t1_set_mm_blend): ...this new function.
- (T1_Set_MM_Design): Use `t1_set_mm_blend'.
-
-2017-10-05 Werner Lemberg <wl@gnu.org>
-
- * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Fix integer
- overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3539
-
-2017-10-05 Werner Lemberg <wl@gnu.org>
-
- Fix compiler warnings.
-
- * src/cff/cffdrivr.c (cff_ps_get_font_extra): Avoid code that relies
- on numeric overflow.
- Add cast.
-
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Fix variable
- types, add cast.
-
-2017-10-04 John Tytgat <John.Tytgat@esko.com>
-
- [cff] Add support for `FSType'.
-
- * include/freetype/internal/cfftypes.h (CFF_FontRec): Add
- `font_extra' entry.
-
- * src/cff/cffdrivr.c (cff_ps_get_font_extra): New function to
- retrieve FSType info from the embedded PostScript data.
- (cff_service_ps_info): Register function.
-
- * src/cff/cffload.c (cff_font_done): Free `font_extra'.
-
-2017-09-30 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Signedness fixes in bitmap presetting.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3514.
-
- * src/raster/ftrend1.c (ft_raster1_render): Explicitly signed height.
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto.
- * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): Explicitly unsigned
- subtraction.
-
-2017-09-29 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Bitmap metrics presetting [2/2].
-
- * src/base/ftobjs.c (FT_Load_Glyph): Preset the bitmap metrics when
- appropriate but `FT_Render_Glyph' is not called.
- * include/freetype/freetype.h (FT_GlyphSlotRec): Document the change.
-
-2017-09-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [smooth, raster] Miscellaneous cleanups.
-
- * src/raster/ftrend1.c (ft_raster1_render): Clean up the exit.
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Reduce
- translations and clean up the exit.
- (ft_smooth_render_lcd, ft_smooth_render_lcd): Remove unused `error'.
-
-2017-09-28 Ben Wagner <bungeman@google.com>
-
- [truetype] Really, really fix #52082.
-
- * src/truetype/ttinterp.c (Ins_MDRP): Correct conditional.
-
-2017-09-28 Werner Lemberg <wl@gnu.org>
-
- * src/psaux/psintrp.c (cf2_doStems): Fix integer overflow.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3510
-
-2017-09-28 Ewald Hew <ewaldhew@gmail.com>
-
- * src/cid/cidgload.c (cid_slot_load_glyph): Fix memory leak.
-
- Reported as
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3489
-
-2017-09-28 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Bitmap metrics presetting [1/2].
-
- This mainly just extracts the code for presetting the bitmap metrics
- from the monochrome, grayscale, and LCD renderers into a separate
- function.
-
- * src/base/ftobjs.c (ft_glyphslot_preset_bitmap): New function that
- calculates prospective bitmap metrics for the given rendering mode.
- * include/freetype/internal/ftobjs.h (ft_glyphslot_preset_bitmap):
- Declare it.
-
- * src/base/ftlcdfil.c (ft_lcd_padding): New helper function that adds
- padding to CBox taking into account pecularities of LCD rendering.
- * include/freetype/ftlcdfil.h (ft_lcd_padding): Declare it.
-
- * src/raster/ftrend1.c (ft_raster1_render): Reworked to use
- `ft_glyphslot_preset_bitmap'.
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Ditto.
- (ft_smooth_render_lcd, ft_smooth_render_lcd): The pixel_mode setting
- is moved to `ft_glyphslot_preset_bitmap'.
-
-2017-09-28 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Fix compiler warning.
-
- * src/psaux/pshints.c (cf2_hintmap_dump): Add switch for tracing
- code.
-
-2017-09-27 Werner Lemberg <wl@gnu.org>
-
- * src/sfnt/ttload.c (tt_face_load_font_dir): Fix compiler warning.
-
-2017-09-25 Werner Lemberg <wl@gnu.org>
-
- [psaux] Fix compiler warnings.
-
- * src/psaux/psft.c (cf2_initLocalRegionBuffer): Remove redundant
- test.
-
- * src/psaux/psintrp.c (cf2_interpT2CharString)
- <cf2_escCALLOTHERSUBR>: Add casts.
-
- * src/psaux/psobjs.c (ps_decoder_init): Add cast.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Minor fixes.
-
- * include/freetype/internal/psaux.h, src/psaux/psobjs.{c,h}:
- Rearrange `ps_builder_init' arguments to conventional order.
-
- * src/psaux/psft.c (cf2_decoder_parse_charstrings): Add a check and
- notice for `SubFont' in Type 1 mode.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Move `psdecode' into `psobjs'.
-
- As the former only contains a single procedure, move it into
- `psobjs' for simplicity. Also change the parameter order to the
- conventional one.
-
- * src/psaux/psdecode.c (ps_decoder_init): Moved to...
- * src/psaux/psobjs.c: ...Here.
- * src/psaux/psdecode.h, src/psaux/psobjs.h: Ditto.
-
- * include/freetype/internal/psaux.h (PSAux_ServiceRec): Update
- `ps_decoder_init' function signature.
-
- * src/cff/cffgload.c, src/cid/cidgload.c, src/type1/t1gload.c:
- Update calls.
-
- * src/psaux/psaux.c, src/psaux/psauxmod.c: Update includes.
-
- * src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRV_SRC):
- Update file references.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Fix Type 1 hinting.
-
- Type 1 hinting breaks sometimes when mid-charstring hints should
- have been in the initial hintmap. This fix adds a preprocessing
- pass that reads all hints and builds the correct initial hintmap
- first, before proceeding to build the glyph outline.
-
- * src/psaux/psintrp.c (cf2_interpT2CharString): New
- `initial_map_ready' boolean flag.
- Ignore outline commands and hint changes on first pass.
- <cf2_cmdENDCHAR>: Add section to build hintmap and rewind.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Add tracing for hints.
-
- * src/psaux/pshints.c (cf2_hintmap_dump): New function.
- (cf2_hintmap_insertHint): Trace incoming and inserted hints.
- (cf2_hintmap_build): Dump hintmap before and after hint adjustment.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Minor fixes.
-
- * src/psaux/psintrp.c (cf2_interpT2CharString): Fix check for pop
- results.
- s/font->decoder/decoder/ where necessary.
- <cf2_cmdHSTEM, cf2_cmdVSTEM, cf2_escHSTEM3, cf2_escVSTEM3>: Use
- offset parameter in `cf2_doStems' instead of doing correction for
- left-sidebearing.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [cid] Use the new engine.
-
- * src/cid/cidgload.c: Update includes.
- (cid_load_glyph, cid_slot_load_glyph): Implement changes to glyph
- loading code as with `type1' module.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [cid] Add Adobe engine configuration.
-
- This is similar to what was done in the `type1' module.
-
- * src/cid/cidriver.c (t1cid_driver_class): Update declaration.
- * src/cid/cidobjs.c: Include FT_TYPE1_DRIVER_H.
- (cid_driver_init): Update code.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Change subfont synthesis for CID fonts.
-
- Change `t1_make_subfont' to take in the Private dict record as an
- argument. This is because Type 1 and CID font records in FreeType
- have this in different places.
-
- * src/psaux/psobjs.c (t1_make_subfont): Change `T1_Face' to
- `FT_Face' so that CID is also accepted.
- Take `PS_Private' as an argument and let caller figure out where the
- Private dict actually is.
- Update references.
-
- * include/freetype/internal/psaux.h, src/psaux/psobjs.h: Update
- declaration.
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Update
- call.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [type1] Switch to Adobe engine.
-
- * src/type1/t1objs.c (T1_Driver_Init): Set default to Adobe engine.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (seac).
-
- This concludes the changes needed to add Type 1 support.
-
- * src/psaux/psintrp.c: Update includes.
- (cf2_interpT2CharString) <cf2_escSEAC>: Implement this similarly to
- implied seac for CFF.
-
- * src/psaux/t1decode.c (t1_lookup_glyph_by_stdcharcode_ps): New
- function to look up the glyph index.
-
- * src/psaux/psft.c (cf2_getT1SeacComponent,
- cf2_freeT1SeacComponent): New functions to get the charstrings for
- seac components.
-
- * src/psaux/t1decode.h, src/psaux/psft.h: Update declarations.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (flex in callothersubr).
-
- * src/psaux/psintrp.c (cf2_interpT2CharString)
- <cf2_escCALLOTHERSUBR>: Fix Flex feature handling (OtherSubrs 0, 1,
- 2).
- <cf2_cmdRMOVETO>: Do not actually move the `glyphPath' while doing
- flex. This is to avoid closing the current contour.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (callothersubr).
-
- * src/psaux/psintrp.c (cf2_interpT2CharString)
- <cf2_escCALLOTHERSUBR>: Copy code from
- `t1_decoder_parse_charstrings' (in `t1decode.c').
- OtherSubr 3 (change hints) should reset the hintmask, so that the
- new hints are applied.
- Fix function calls and stack access.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (pop).
-
- * src/psaux/psintrp.c (cf2_interpT2CharString): Change how unhandled
- OtherSubr results are stored. Implement the PostScript stack using
- an array.
- <cf2_escPOP>: Ensure that the stack is not cleared after getting
- `OtherSubr' results.
- Fix stack access.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (callsubr).
-
- * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdCALLSUBR>:
- Type 1 mode.
-
- * src/psaux/psft.c (cf2_initLocalRegionBuffer): Add Type 1 mode.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (div, four-byte numbers).
-
- * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_escDIV>: Add
- Type 1 mode. Type 1 requires large integers to be followed by
- `div'; cf. `Adobe Type 1 Font Format', section 6.2.
- <op == 255>: Push Type 1 four-byte numbers as `Int' always. This is
- to ensure `div' and `callsubr' get values they can use.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (hints).
-
- * src/psaux/psintrp.c (cf2_interpT2CharString) <cf2_cmdHSTEM,
- cf2_cmdVSTEM>: Add correction for left sidebearing in Type 1 mode.
- Allow adding hints mid-charstring.
- <cf2_escVSTEM3, cf2_escHSTEM3>: Translate into equivalent commands
- for three normal stem hints. This requires some recalculation of
- stem positions.
- Correction for left sidebearing.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (hsbw, sbw).
-
- * src/psaux/psintrp.c (cf2_doStems): `hsbw' or `sbw' must be the
- first operation in a Type 1 charstring.
- (cf2_interpT2CharString): Remove unused variables.
- <cf2_cmdHMOVETO, cf2_cmdVMOVETO, cf2_cmdRMOVETO>: `hsbw' or `sbw'
- must be the first operation in a Type 1 charstring.
- <cf2_cmdHSBW, cf2_escSBW>: Fix data access and add correction for
- left sidebearing.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (setcurrentpoint).
-
- * src/psaux/psintrp.c (cf2_interpT2CharString)
- <cf2_escSETCURRENTPT>: Fix stack access.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Extend Adobe interpreter (closepath).
-
- * src/psaux/psintrp.c (cf2_interpT2CharString) <c2f_cmdCLOSEPATH>:
- Use the right builder function. We can use the `haveWidth' boolean
- already present, instead of implementing `parse_state'.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Add Type 1 operations to Adobe CFF interpreter.
-
- The following Type 1 specific ops have been added (copied from
- `t1decode'):
-
- closepath
- vstem3
- hstem3
- seac
- sbw
- callothersubr
- pop
- setcurrentpoint
- hsbw
-
- The following require a Type 1 mode, because of differences in
- specification:
-
- hstem
- vstem
- vmoveto
- callsubr
- div
- rmoveto
- hmoveto
- Numbers
-
- The subsequent commits will implement these changes and adapt
- accesses of data and objects to the new interpreter.
-
- NOTE: Will not compile in the meantime!
-
- * src/psaux/psintrp.c: Add opcodes to enum.
- (cf2_interpT2CharString): Copy relevant code over from
- `t1_decoder_parse_charstrings' (in `t1decode.c').
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [type1] Fixes for rendering.
-
- The Type 1 advance width calculation passes null for glyph slot,
- etc, which can cause null pointer access in the new interpreter.
- Fall back to the old one for now.
-
- Fix the large glyph retry code and ensure hinting and scaling flags
- are set properly.
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add a
- check for metrics_only.
- Set the `force_scaling' flag.
- (T1_Parse_Glyph): Updated.
- (T1_Load_Glyph): Add `hinting' and `scaled' flags.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Add missing objects (2/2).
-
- Synthesize a `SubFont' object for Type 1 fonts. This is used in the
- interpreter to access Private dict data, which are stored in
- different places for Type 1 and CFF. This allows the same data to
- be used in either mode.
-
- * src/psaux/psobjs.c (t1_make_subfont): New procedure to copy
- required values to a dummy `CFF_SubFont' object. This is similar to
- `cff_make_private_dict'.
- * src/psaux/psobjs.h: Add the new declaration.
-
- * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Ditto.
- Add this to the PSAux Service for future use with CID fonts.
-
- * src/type1/t1gload.c: Include FT_INTERNAL_CFF_TYPES_H.
- (T1_Parse_Glyph_And_Get_Char_String): Add the call.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Add missing objects for Type 1 (1/2).
-
- Move `CF2_Font' instance to `PS_Decoder'. This is the context for
- the interpreter and since it is currently stored in `CFF_Font', is
- unavailable in Type 1 mode.
-
- * include/freetype/internal/psaux.h (T1_Decoder, PS_Decoder): New
- `cf2_instance' field.
-
- * src/psaux/psdecode.c (ps_decoder_init): Copy `cf2_instance' to
- `PS_Decoder'.
-
- * src/psaux/t1decode.c (t1_decoder_done): Add finalization code.
-
- * src/psaux/psft.c (cf2_decoder_parse_charstrings): Update accesses.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- Allow `type1' module to use the Adobe engine.
-
- Add the callback and some conditionals to switch between the two
- engines.
-
- * include/freetype/internal/psaux.h (T1_Decoder_FuncsRec): Change
- function declarations.
- * src/psaux/psauxmod.c (T1_Decoder_FuncsRec): Register the
- callbacks.
-
- * src/psaux/psobjs.c (ps_builder_add_point): Add conditionals for
- number conversion.
-
- * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String): Add code
- to choose which renderer to use.
-
- * src/cid/cidgload.c (cid_load_glyph): Update call.
- * src/base/ftobjs.c, src/psaux/psobjs.c, src/type1/t1gload.c: Update
- includes.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [type1] Add Adobe engine configuration.
-
- Use the previously changed PS_Driver in type1 module to store
- hinting engine configuration.
-
- * include/freetype/ftt1drv.h: New file.
- Duplicate and rename config options from CFF.
- * include/freetype/config/ftheader.h (FT_TYPE1_DRIVER_H): New macro.
-
- * src/type1/t1driver.c (t1_driver_class): Update declaration.
- * src/type1/t1objs.c: Include FT_TYPE1_DRIVER_H.
- (T1_Driver_Init): Update code.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [cff] Move and rename `CFF_Driver'.
-
- This is so that we can use the same hinting engine parameters for
- Type 1.
-
- * include/freetype/internal/cffotypes.h (CFF_Driver): Rename and
- move to...
- * include/freetype/internal/psaux.h (PS_Driver): ...here.
-
- * src/cff/cffdrivr.c, src/cff/cffgload.c, src/cff/cffload.c,
- src/cff/cffobjs.c, src/cff/cffobjs.h, src/psaux/psft.c,
- src/psaux/psobjs.c: Update references.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux, type1] Reorganize object fields.
-
- Make some fields more generic, so that we can access them the same
- way regardless of Type 1 or CFF.
-
- * include/freetype/internal/psaux.h (PS_Builder): Change `TT_Face'
- to `FT_Face'.
- Remove unused fields.
-
- * src/psaux/psft.c: Update all accesses of `PS_Builder.face'.
- Add some asserts to guard against casting `T1_Face' as `TT_Face'.
-
- * src/type1/t1objs.h (T1_GlyphSlot): Reorder fields to follow
- `CFF_GlyphSlot', so that we can pretend they are the same in the
- interpreter.
-
- * src/psaux/psobjs.c (ps_builder_init, ps_builder_add_point):
- Updated with above changes.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Prepare for Type 1 mode.
-
- Add some checks for Type 1 data passing through.
-
- * src/psaux/psfont.h (CF2_Font): Add `isT1' flag.
- * src/psaux/psfont.c (cf2_font_setup): Skip the variations and blend
- code which is not applicable for Type 1.
-
- * src/psaux/psft.c (cf2_decoder_parse_charstrings): Avoid accessing
- `decoder->cff' in Type 1 mode.
- Copy `is_t1' flag to `CF2_Font'.
-
-2017-09-25 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux, cff] Use the new objects.
-
- * include/freetype/internal/psaux.h, src/psaux/psauxmod.c: Fix
- switching between new and old engines.
-
- * src/cff/cffgload.c, src/cff/cffparse.c: Update calls.
-
- * src/psaux/psblues.c, src/psaux/psfont.c, src/psaux/psfont.h,
- src/psaux/psft.c, src/psaux/psft.h, src/psaux/psintrp.c: Update all
- to use new objects.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Objects for new interpreter (part 2).
-
- Make the new objects copy over values. They are essentially wrapper
- types for the different decoders/builders.
-
- * include/freetype/internal/psaux.h: Update declarations.
- (PS_Builder): Add `is_t1' flag.
- (PS_Decoder_{Get,Free}_Glyph_Callback): Renamed to...
- (CFF_Decoder_{Get,Free}_Glyph_Callback: ... this.
- (PS_Decoder): Updated.
- Add `t1_parse_callback' member.
- (PSAux_ServiceRec): Add `ps_decoder_init' member.
-
- * src/psaux/psdecode.h, src/psaux/psobjs.h: Update declarations.
-
- * src/psaux/psdecode.c, src/psaux/psobjs.c: Implement copy with two
- modes.
-
- * src/psaux/psauxmod.c: Add builder and decoder functions to `PSAux'
- service.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Add objects for new interpreter.
-
- Introduce `PS_Decoder' and `PS_Builder' which include all fields
- from either Type 1 or CFF decoders/builders.
-
- * include/freetype/internal/psaux.h (PS_Builder, PS_Decoder): New
- structs.
-
- * src/psaux/psobjs.c, src/psaux/psobjs.h: Add `PS_Builder'
- functions.
-
- * src/psaux/psdecode.c, src/psaux/psdecode.h: New files to hold
- `PS_Decoder' initialization functions.
-
- * src/psaux/psaux.c, src/psaux/Jamfile (_sources),
- src/psaux/rules.mk (PSAUX_DRV_SRC): Updated.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Rename files.
-
- Replace the `cf2' file name prefix with `ps' as the Adobe engine
- will be used for both PostScript Types 1 and 2 (CFF) instead of just
- CFF.
-
- s/cf2/ps/ for all following.
-
- * src/psaux/cf2*: Rename files.
- * src/psaux/*: Update includes.
-
- * src/psaux/Jamfile (_sources), src/psaux/rules.mk (PSAUX_DRC_SRC,
- PSAUX_DRV_H): Update file references.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux] Minor fix.
-
- Use `MultiMasters' service in `psaux' instead of a call to `cff'.
- The project builds if CFF_CONFIG_OPTION_OLD_ENGINE is not defined.
-
- * src/psaux/cf2ft.c: Update includes.
- (cf2_getNormalizedVector): Use `mm->get_var_blend' instead of
- `cff_get_var_blend'.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux, cff] Move `cff_random' into `psaux' service.
-
- NOTE: Does not compile!
-
- Minor fix to allow both `cff' and `psaux' to use `cff_random'.
-
- * src/cff/cffload.c (cff_random): Move to...
- * src/psaux/psobjs.c: Here.
- * src/cff/cffload.h: Move corresponding declaration to
- `src/psaux/psobjs.h'.
-
- * include/freetype/internal/psaux.h (PSAux_ServiceRec): Register the
- function here...
- * src/psaux/psauxmod.c: And here.
-
- * src/cff/cffload.c, src/psaux/cf2intrp.c: Update code.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [cff] Move struct declarations to `freetype/internal'.
-
- NOTE: Does not compile!
-
- This is so that the CFF functions moved to `psaux' can access the
- same structs that they need.
-
- * src/cff/cfftypes.h: Moved to...
- * include/freetype/internal/cfftypes.h: ...Here.
-
- * src/cff/cffobjs.h: Moved the struct declarations to...
- * include/freetype/internal/cffotypes.h: ... this new file.
-
- * include/freetype/internal/internal.h (FT_INTERNAL_CFF_TYPES_H,
- FT_INTERNAL_CFF_OBJECT_TYPES_H): New macros.
-
- * src/cff/cffcmap.h, src/cff/cffdrivr.c, src/cff/cffgload.c,
- src/cff/cffgload.h, src/cff/cffload.h, src/cff/cffobjs.c,
- src/cff/cffobjs.h, src/cff/cffparse.h, src/psaux/psobjs.h,
- include/freetype/internal/psaux.h,
- include/freetype/internal/services/svcfftl.h: Update includes.
-
- * src/cff/rules.mk (CFF_DRV_H): Updated.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux, cff] Add new service for inter-module calls.
-
- NOTE: Does not compile!
-
- This is to allow CFF functions moved to `psaux' to call functions
- declared in `src/cff/cffload.h'.
-
- * include/freetype/internal/services/svcfftl.h: New file, setting up
- a `CFFLoad' service.
-
- * include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC10,
- FT_DEFINE_SERVICEDESCREC): New macros.
- (FT_SERVICE_CFF_TABLE_LOAD_H): New macro.
-
- * src/cff/cffdrivr.c, src/cff/cffpic.h: Register the new service.
-
- * src/cff/cfftypes.h (CFF_FontRec), src/psaux/cf2font.h
- (CF2_FontRec): Add service interface.
-
- * src/cff/cffobjs.c, src/psaux/cf2font.c, src/psaux/cf2ft.c,
- src/psaux/cf2intrp.c, src/psaux/cffdecode.c: Use the new service.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux, cff] Add callbacks for inter-module calls.
-
- NOTE: Does not compile!
-
- * include/freetype/internal/psaux.h: Add function pointer
- declarations.
-
- * src/psaux/cffdecode.c (cff_decoder_init): Update to take in
- callbacks.
- * src/psaux/cffdecode.h: Ditto.
-
- * src/cff/cffgload.c (cff_compute_max_advance, cff_slot_load):
- Update calls to pass in callbacks.
- * src/psaux/cf2ft.c, src/psaux/cffdecode.c: Use them.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux, cff] Create new `PSAux' service interface entries.
-
- NOTE: Does not compile!
-
- * include/freetype/internal/psaux.h: Include
- FT_INTERNAL_TRUETYPE_TYPES_H.
- (CFF_Builder_FuncsRec, CFF_Decocer_FuncsRec): New function tables.
- (CFF_Builder): Updated.
- Fix for forward declaration.
- (PSAux_ServiceRec): New field `cff_decoder_funcs'.
-
- * src/psaux/psauxmod.c (cff_builder_funcs, cff_decoder_funcs): New
- function tables.
- (PSAux_Interface): Updated.
-
- * include/freetype/internal/tttypes.h (TT_FaceRec): Add `psaux'
- service interface.
-
- * src/cff/cffgload.c, src/cff/cffobjs.c, src/cff/cffparse.c: Update
- function calls to use psaux service.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux, cff] Move CFF builder components into `psaux' module.
-
- NOTE: Does not compile!
-
- * src/cff/cffgload.c
- (cff_builder_{init,done,add_point,add_point1,add_contour,start_point,close_contour},
- cff_check_points): Move to...
- * src/psaux/psobjs.c: Here.
-
- * src/cff/cffgload.h: Move corresponding declarations to
- `src/psaux/psobjs.h'.
-
- * src/cff/cffgload.h (CFF_Builder): Move struct declaration to...
- * include/freetype/internal/psaux.h: Here.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux, cff] Move CFF decoder components into `psaux' module.
-
- NOTE: Does not compile!
-
- * src/cff/cffgload.c (CFF_Operator,
- CFF_COUNT_{CHECK_WIDTH,EXACT,CLEAR_STACK}, cff_argument_counts,
- cff_operator_seac, cff_compute_bias,
- cff_lookup_glyph_by_stdcharcode,
- cff_decoder_{parse_charstrings,init,prepare}): Move to...
- * src/psaux/cffdecode.c: This new file.
-
- * src/cff/cffgload.h: Move corresponding declarations to...
- * src/psaux/cffdecode.h: This new file.
-
- * src/cff/cffgload.h (CFF_MAX_{OPERANDS,SUBRS_CALLS,TRANS_ELEMENTS},
- CFF_Decoder_Zone, CFF_Decoder): Move declarations to...
- * include/freetype/internal/psaux.h: Here.
-
- * src/psaux/cf2ft.h: Update include.
-
- * src/psaux/psaux.c, src/psaux/rules.mk (PSAUX_DRV_SRC): Update with
- the new file.
-
-2017-09-24 Ewald Hew <ewaldhew@gmail.com>
-
- [psaux, cff] Move Adobe's engine components into `psaux' module.
-
- This is the first patch of a sequence to move the Type 2 charstring
- processing capability from the `cff' module to the `psaux' module.
-
- NOTE: Does not compile!
-
- * src/cff/cf2*: Move these files to...
- * src/psaux/cf2*: Here.
-
- * src/cff/Jamfile (_sources), src/cff/rules.mk (CFF_DRV_SRC,
- CFF_DRV_H), src/cff/cff.c, src/cff/cffgload.c: Remove file
- references.
-
- * src/psaux/Jamfile (_sources), src/psaux/rules.mk, src/psaux/psaux.c
- (PSAUX_DRV_SRC, PSAUX_DRV_H): Add file references.
-
-2017-09-24 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- Tweak per-face LCD filtering controls.
-
- Thing are simpler with a NULL-function pointer.
-
- * include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New
- pointer to the filter function.
- (FT_LibraryRec): Remove unused `lcd_filter'.
- (FT_Bitmap_LcdFilterFunc, ft_lcd_filter_fir): Move from here...
- * include/freetype/ftlcdfil.h (FT_Bitmap_LcdFilterFunc,
- ft_lcd_filter_fir): ... to here.
-
- * src/base/ftobjs.c (ft_open_face_internal): NULL-initialize the
- per-face filter.
- (FT_Face_Properties): Set it.
- * src/smooth/ftsmooth.c (ft_smooth_render_generic): Simplify.
-
- * src/base/ftlcdfil.c (ft_lcd_filter_fir, FT_Libary_SetLcdFilter):
- Minor.
-
-2017-09-24 Jonathan Kew <jfkthame@gmail.com>
-
- [sfnt] Fix `premultiply_data' (#52092).
-
- * src/sfnt/pngshim.c (premultiply_data): Don't use vector extension
- if we have less than 16 bytes of data.
-
-2017-09-24 Werner Lemberg <wl@gnu.org>
-
- [otvalid] Fix handling of ValueRecords.
-
- For GPOS pair positioning format 1 the description of ValueRecords
- in the OpenType specification (1.8.2, from today) is wrong – the
- offset has to be taken from the parent structure; in this case the
- `PairSet' table.
-
- * src/otvalid/otvgpos.c (otv_PairSet_validate): Set `extra3'.
- (otv_PairPos_validate): Adjust.
-
-2017-09-23 Werner Lemberg <wl@gnu.org>
-
- [otvalid] Handle `GSUB' and `GPOS' v1.1 tables.
-
- * src/otvalid/otvgsub.c (otv_GSUB_validate), src/otvalid/otvgpos.c
- (otv_GPOS_validate): Implement it.
-
-2017-09-23 Werner Lemberg <wl@gnu.org>
-
- [otvalid] Update common table handling to OpenType 1.8.2.
-
- * src/otvalid/otvcommn.c (otv_Device_validate): Handle
- VariationIndex subtable.
- (otv_Lookup_validate): Handle MarkFilteringSet.
-
-2017-09-23 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [build] Windows-style DLL versioning.
-
- * build/windows/ftver.rc: New VERSIONINFO resource.
- * build/windows/vc2010/freetype.vcxproj: Further improvements.
-
-2017-09-23 Ben Wagner <bungeman@google.com>
-
- [truetype] Really fix #52082.
-
- * src/truetype/ttinterp.c (Ins_MDRP): Correct conditional.
-
-2017-09-23 Werner Lemberg <wl@gnu.org>
-
- [otvalid] Handle `GDEF' v1.2 and v1.3 tables.
-
- No validation of variation stuff yet.
-
- * src/otvalid/otvgdef.c (otv_MarkGlyphSets_validate): New function.
- (otv_GDEF_validate): Implement it.
-
-2017-09-22 Werner Lemberg <wl@gnu.org>
-
- [otvalid] Handle `BASE' v1.1 table.
-
- No validation of variation stuff yet.
-
- * src/otvalid/otvbase.c (otv_BASE_validate): Implement it.
-
-2017-09-22 Werner Lemberg <wl@gnu.org>
-
- [otvalid] Macros for 32bit offset support.
-
- * src/otvalid/otvcommn.h (OTV_OPTIONAL_TABLE32,
- OTV_OPTIONAL_OFFSET32, OTV_SIZE_CHECK32): New macros.
-
-2017-09-21 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [build] Simplify Visual C++ 2010 project.
-
- * build/windows/vc2010/freetype.vcxproj: Remove fake singlethreaded
- configurations and tweak.
-
-2017-09-21 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflow (#52082).
-
- * src/truetype/ttinterp.c (Ins_MDRP): Avoid FT_ABS.
-
-2017-09-21 Werner Lemberg <wl@gnu.org>
-
- [sfnt] Fix postscript name for default instance of variation fonts.
-
- Problem reported by Behdad.
-
- * src/sfnt/sfdriver.c (sfnt_get_ps_name): Test
- `is_default_instance'.
-
-2017-09-21 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix `mmvar' array pointers, part 2.
-
- The previous commit was incomplete.
-
- * src/truetype/ttgxvar.c: Properly initialize sub-array offsets for
- `master' also.
-
-2017-09-21 Werner Lemberg <wl@gnu.org>
-
- [truetype] Fix `mmvar' array pointers.
-
- Without this change, clang's AddressSanitizer reports many runtime
- errors due to misaligned addresses.
-
- * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use multiples of pointer
- size for sub-array offsets into `mmvar'.
-
-2017-09-20 Werner Lemberg <wl@gnu.org>
-
- [truetype] Integer overflows.
-
- Changes triggered by
-
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3429
-
- * src/truetype/ttinterp.c (Ins_SHPIX, Ins_DELTAP): Use NEG_LONG.
- (Ins_MIAP): Use SUB_LONG.
-
-2017-09-19 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [build] Fix DLL builds in Visual C++ project.
-
- * build/windows/vc2010/freetype.vcxproj: Use DynamicLibrary in Debug
- and Release configurations.
- * include/freetype/config/ftconfig.h (FT_EXPORT, FT_EXPORT_DEF)
- [_DLL]: Use Visual C++ extensions.
-
-2017-09-19 John Tytgat <John.Tytgat@esko.com>
-
- [cff] Fix family name logic of pure CFF fontdata (#52056).
-
- 1. If `FamilyName' is present in the CFF font, use this for
- FT_Face's `family_name'.
- 2. Otherwise, use the face name and chop off any subset prefix.
- 3. If at this point FT_Face's `family_name' is set, use this
- together with the full name to determine the style.
- 4. Otherwise, use `CIDFontName' as FT_Face's `family_name'.
- 5. If we don't have a valid style, use "Regular".
-
- Previously, FT_Face's `family_name' entry for pure CFF fontdata
- nearly always was the fontname itself, instead of the `FamilyName'
- entry in the CFF font (assuming there is one).
-
- * src/cff/cffobjs.c (cff_face_init) [pure_cff]: Implement it.
-
-2017-09-18 Alexei Podtelezhnikov <apodtele@gmail.com>
-
- [build] Declutter Visual C++ 2010-2017 project.
-
- * build/windows/vc2010/freetype.vcxproj: Use MaxSpeed (/02)
- optimization for Release configuration throughout the project.
-
-
-----------------------------------------------------------------------------
-
-Copyright (C) 2017-2020 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.
-
-
-Local Variables:
-version-control: never
-coding: utf-8
-End:
diff --git a/freetype/Makefile b/freetype/Makefile
index f1284170..8b293550 100644
--- a/freetype/Makefile
+++ b/freetype/Makefile
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/README b/freetype/README
index 6a320df9..7a8a2dce 100644
--- a/freetype/README
+++ b/freetype/README
@@ -1,4 +1,4 @@
-FreeType 2.11.1
+FreeType 2.12.1
===============
Homepage: https://www.freetype.org
@@ -30,9 +30,9 @@ sites. Go to
and download one of the following files.
- freetype-doc-2.11.1.tar.xz
- freetype-doc-2.11.1.tar.gz
- ftdoc2111.zip
+ freetype-doc-2.12.1.tar.xz
+ freetype-doc-2.12.1.tar.gz
+ ftdoc2121.zip
To view the documentation online, go to
@@ -92,7 +92,7 @@ Enjoy!
----------------------------------------------------------------------
-Copyright (C) 2006-2021 by
+Copyright (C) 2006-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/README.git b/freetype/README.git
index ad3c74ca..258de14b 100644
--- a/freetype/README.git
+++ b/freetype/README.git
@@ -89,7 +89,7 @@ address:
----------------------------------------------------------------------
-Copyright (C) 2005-2021 by
+Copyright (C) 2005-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/autogen.sh b/freetype/autogen.sh
index 8cca7c84..b5fc1beb 100755
--- a/freetype/autogen.sh
+++ b/freetype/autogen.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (C) 2005-2021 by
+# Copyright (C) 2005-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -182,7 +182,7 @@ copy_submodule_files ()
cp $DLG_SRC_DIR/* src/dlg
}
-if test -d ".git"; then
+if test -e ".git"; then
DLG_INC_DIR=subprojects/dlg/include/dlg
DLG_SRC_DIR=subprojects/dlg/src/dlg
diff --git a/freetype/builds/amiga/README b/freetype/builds/amiga/README
index 4ec8770b..e7743552 100644
--- a/freetype/builds/amiga/README
+++ b/freetype/builds/amiga/README
@@ -1,7 +1,7 @@
README for the builds/amiga subdirectory.
-Copyright (C) 2005-2021 by
+Copyright (C) 2005-2022 by
Werner Lemberg and Detlef Wrkner.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/amiga/include/config/ftconfig.h b/freetype/builds/amiga/include/config/ftconfig.h
index 6deea6b7..211f170e 100644
--- a/freetype/builds/amiga/include/config/ftconfig.h
+++ b/freetype/builds/amiga/include/config/ftconfig.h
@@ -4,7 +4,7 @@
/* */
/* Amiga-specific configuration file (specification only). */
/* */
-/* Copyright (C) 2005-2021 by */
+/* Copyright (C) 2005-2022 by */
/* Werner Lemberg and Detlef Wrkner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/freetype/builds/amiga/include/config/ftmodule.h b/freetype/builds/amiga/include/config/ftmodule.h
index 873537ca..73e86d5b 100644
--- a/freetype/builds/amiga/include/config/ftmodule.h
+++ b/freetype/builds/amiga/include/config/ftmodule.h
@@ -4,7 +4,7 @@
/* */
/* Amiga-specific FreeType module selection. */
/* */
-/* Copyright (C) 2005-2021 by */
+/* Copyright (C) 2005-2022 by */
/* Werner Lemberg and Detlef Wrkner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/freetype/builds/amiga/makefile b/freetype/builds/amiga/makefile
index ed7c780b..5df281c0 100644
--- a/freetype/builds/amiga/makefile
+++ b/freetype/builds/amiga/makefile
@@ -5,7 +5,7 @@
#
-# Copyright (C) 2005-2021 by
+# Copyright (C) 2005-2022 by
# Werner Lemberg and Detlef Wrkner.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/amiga/makefile.os4 b/freetype/builds/amiga/makefile.os4
index 58c89208..02742ea4 100644
--- a/freetype/builds/amiga/makefile.os4
+++ b/freetype/builds/amiga/makefile.os4
@@ -4,7 +4,7 @@
#
-# Copyright (C) 2005-2021 by
+# Copyright (C) 2005-2022 by
# Werner Lemberg and Detlef Wrkner.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/amiga/smakefile b/freetype/builds/amiga/smakefile
index aaddd199..311375d0 100644
--- a/freetype/builds/amiga/smakefile
+++ b/freetype/builds/amiga/smakefile
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2005-2021 by
+# Copyright (C) 2005-2022 by
# Werner Lemberg and Detlef Wrkner.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/amiga/src/base/ftdebug.c b/freetype/builds/amiga/src/base/ftdebug.c
index dc7e968d..84e2c8ba 100644
--- a/freetype/builds/amiga/src/base/ftdebug.c
+++ b/freetype/builds/amiga/src/base/ftdebug.c
@@ -4,7 +4,7 @@
*
* Debugging and logging component for amiga (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Detlef Wuerkner.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/builds/amiga/src/base/ftsystem.c b/freetype/builds/amiga/src/base/ftsystem.c
index 5c69e3ac..ed34a779 100644
--- a/freetype/builds/amiga/src/base/ftsystem.c
+++ b/freetype/builds/amiga/src/base/ftsystem.c
@@ -4,7 +4,7 @@
/* */
/* Amiga-specific FreeType low-level system interface (body). */
/* */
-/* Copyright (C) 1996-2021 by */
+/* Copyright (C) 1996-2022 by */
/* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Wrkner. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/freetype/builds/ansi/ansi-def.mk b/freetype/builds/ansi/ansi-def.mk
index 218d5c0d..d91894c0 100644
--- a/freetype/builds/ansi/ansi-def.mk
+++ b/freetype/builds/ansi/ansi-def.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/ansi/ansi.mk b/freetype/builds/ansi/ansi.mk
index b36c64e2..96c1576d 100644
--- a/freetype/builds/ansi/ansi.mk
+++ b/freetype/builds/ansi/ansi.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/beos/beos-def.mk b/freetype/builds/beos/beos-def.mk
index d7d63b37..0b3ef609 100644
--- a/freetype/builds/beos/beos-def.mk
+++ b/freetype/builds/beos/beos-def.mk
@@ -5,7 +5,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/beos/beos.mk b/freetype/builds/beos/beos.mk
index f3e3fbbe..a5e6a82c 100644
--- a/freetype/builds/beos/beos.mk
+++ b/freetype/builds/beos/beos.mk
@@ -2,7 +2,7 @@
# FreeType 2 configuration rules for a BeOS system
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/beos/detect.mk b/freetype/builds/beos/detect.mk
index 521ecae9..7b27ff9f 100644
--- a/freetype/builds/beos/detect.mk
+++ b/freetype/builds/beos/detect.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/cmake/FindBrotliDec.cmake b/freetype/builds/cmake/FindBrotliDec.cmake
index 46356b1f..0a3d8992 100644
--- a/freetype/builds/cmake/FindBrotliDec.cmake
+++ b/freetype/builds/cmake/FindBrotliDec.cmake
@@ -1,6 +1,6 @@
# FindBrotliDec.cmake
#
-# Copyright (C) 2019-2021 by
+# Copyright (C) 2019-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# Written by Werner Lemberg <wl@gnu.org>
diff --git a/freetype/builds/cmake/iOS.cmake b/freetype/builds/cmake/iOS.cmake
index 258654d4..011e7ef0 100644
--- a/freetype/builds/cmake/iOS.cmake
+++ b/freetype/builds/cmake/iOS.cmake
@@ -1,6 +1,6 @@
# iOS.cmake
#
-# Copyright (C) 2014-2021 by
+# Copyright (C) 2014-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# Written by David Wimsey <david@wimsey.us>
diff --git a/freetype/builds/cmake/testbuild.sh b/freetype/builds/cmake/testbuild.sh
index c6c63720..312b4769 100755
--- a/freetype/builds/cmake/testbuild.sh
+++ b/freetype/builds/cmake/testbuild.sh
@@ -1,6 +1,6 @@
#!/bin/sh -e
-# Copyright (C) 2015-2021 by
+# Copyright (C) 2015-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/ansi-cc.mk b/freetype/builds/compiler/ansi-cc.mk
index e73e6fca..98cb0577 100644
--- a/freetype/builds/compiler/ansi-cc.mk
+++ b/freetype/builds/compiler/ansi-cc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/bcc-dev.mk b/freetype/builds/compiler/bcc-dev.mk
index 71804529..83ed28cf 100644
--- a/freetype/builds/compiler/bcc-dev.mk
+++ b/freetype/builds/compiler/bcc-dev.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/bcc.mk b/freetype/builds/compiler/bcc.mk
index 321db108..76b5dc21 100644
--- a/freetype/builds/compiler/bcc.mk
+++ b/freetype/builds/compiler/bcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/emx.mk b/freetype/builds/compiler/emx.mk
index b3b6047e..f7918362 100644
--- a/freetype/builds/compiler/emx.mk
+++ b/freetype/builds/compiler/emx.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2003-2021 by
+# Copyright (C) 2003-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/gcc-dev.mk b/freetype/builds/compiler/gcc-dev.mk
index f01192f7..0d1b0da7 100644
--- a/freetype/builds/compiler/gcc-dev.mk
+++ b/freetype/builds/compiler/gcc-dev.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/gcc.mk b/freetype/builds/compiler/gcc.mk
index ede20b2f..fbb12cc5 100644
--- a/freetype/builds/compiler/gcc.mk
+++ b/freetype/builds/compiler/gcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/intelc.mk b/freetype/builds/compiler/intelc.mk
index e5dcf90b..b1fdbe72 100644
--- a/freetype/builds/compiler/intelc.mk
+++ b/freetype/builds/compiler/intelc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/unix-lcc.mk b/freetype/builds/compiler/unix-lcc.mk
index 40322b4b..09da86f4 100644
--- a/freetype/builds/compiler/unix-lcc.mk
+++ b/freetype/builds/compiler/unix-lcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/visualage.mk b/freetype/builds/compiler/visualage.mk
index ebc3e48c..8c14d6f0 100644
--- a/freetype/builds/compiler/visualage.mk
+++ b/freetype/builds/compiler/visualage.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/visualc.mk b/freetype/builds/compiler/visualc.mk
index dc6998ad..2635a9fe 100644
--- a/freetype/builds/compiler/visualc.mk
+++ b/freetype/builds/compiler/visualc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/watcom.mk b/freetype/builds/compiler/watcom.mk
index c1d1b665..6484d418 100644
--- a/freetype/builds/compiler/watcom.mk
+++ b/freetype/builds/compiler/watcom.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/compiler/win-lcc.mk b/freetype/builds/compiler/win-lcc.mk
index 27fbc303..1faad494 100644
--- a/freetype/builds/compiler/win-lcc.mk
+++ b/freetype/builds/compiler/win-lcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/detect.mk b/freetype/builds/detect.mk
index 78e9e750..4068ca2a 100644
--- a/freetype/builds/detect.mk
+++ b/freetype/builds/detect.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/dos/detect.mk b/freetype/builds/dos/detect.mk
index d95a2caa..46f9a630 100644
--- a/freetype/builds/dos/detect.mk
+++ b/freetype/builds/dos/detect.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/dos/dos-def.mk b/freetype/builds/dos/dos-def.mk
index f7fbc4d6..307047da 100644
--- a/freetype/builds/dos/dos-def.mk
+++ b/freetype/builds/dos/dos-def.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/dos/dos-emx.mk b/freetype/builds/dos/dos-emx.mk
index dd994796..4ab7b6c7 100644
--- a/freetype/builds/dos/dos-emx.mk
+++ b/freetype/builds/dos/dos-emx.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2003-2021 by
+# Copyright (C) 2003-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/dos/dos-gcc.mk b/freetype/builds/dos/dos-gcc.mk
index 9abdabea..24d14a9b 100644
--- a/freetype/builds/dos/dos-gcc.mk
+++ b/freetype/builds/dos/dos-gcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/dos/dos-wat.mk b/freetype/builds/dos/dos-wat.mk
index 7ab82afe..07d54e89 100644
--- a/freetype/builds/dos/dos-wat.mk
+++ b/freetype/builds/dos/dos-wat.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2003-2021 by
+# Copyright (C) 2003-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/exports.mk b/freetype/builds/exports.mk
index 67c7c993..a3342ecb 100644
--- a/freetype/builds/exports.mk
+++ b/freetype/builds/exports.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2005-2021 by
+# Copyright (C) 2005-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/freetype.mk b/freetype/builds/freetype.mk
index bae81455..7b30c79d 100644
--- a/freetype/builds/freetype.mk
+++ b/freetype/builds/freetype.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/link_dos.mk b/freetype/builds/link_dos.mk
index 8716be51..dd97fbe7 100644
--- a/freetype/builds/link_dos.mk
+++ b/freetype/builds/link_dos.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/link_std.mk b/freetype/builds/link_std.mk
index 03f77721..d94e06d0 100644
--- a/freetype/builds/link_std.mk
+++ b/freetype/builds/link_std.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/mac/freetype-Info.plist b/freetype/builds/mac/freetype-Info.plist
index 4b5d79b8..344e5ac0 100644
--- a/freetype/builds/mac/freetype-Info.plist
+++ b/freetype/builds/mac/freetype-Info.plist
@@ -9,7 +9,7 @@
<string>English</string>
<key>CFBundleExecutable</key>
- <string>FreeType</string>
+ <string>freetype</string>
<key>CFBundleGetInfoString</key>
<string>FreeType ${PROJECT_VERSION}</string>
diff --git a/freetype/builds/mac/ftmac.c b/freetype/builds/mac/ftmac.c
index cd3f4844..f30ffc7d 100644
--- a/freetype/builds/mac/ftmac.c
+++ b/freetype/builds/mac/ftmac.c
@@ -5,7 +5,7 @@
/* Mac FOND support. Written by just@letterror.com. */
/* Heavily Fixed by mpsuzuki, George Williams and Sean McBride */
/* */
-/* Copyright (C) 1996-2021 by */
+/* Copyright (C) 1996-2022 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -97,7 +97,7 @@
#define FT_DEPRECATED_ATTRIBUTE
-#include FT_MAC_H
+#include <freetype/ftmac.h>
/* undefine blocking-macros in ftmac.h */
#undef FT_GetFile_From_Mac_Name
diff --git a/freetype/builds/meson/extract_freetype_version.py b/freetype/builds/meson/extract_freetype_version.py
index ab79fdb3..66b5bc85 100644
--- a/freetype/builds/meson/extract_freetype_version.py
+++ b/freetype/builds/meson/extract_freetype_version.py
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/meson/extract_libtool_version.py b/freetype/builds/meson/extract_libtool_version.py
index 4527f11b..580f645c 100644
--- a/freetype/builds/meson/extract_libtool_version.py
+++ b/freetype/builds/meson/extract_libtool_version.py
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/meson/generate_reference_docs.py b/freetype/builds/meson/generate_reference_docs.py
index 15d9b066..eb448063 100644
--- a/freetype/builds/meson/generate_reference_docs.py
+++ b/freetype/builds/meson/generate_reference_docs.py
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/meson/parse_modules_cfg.py b/freetype/builds/meson/parse_modules_cfg.py
index aa6e9e17..f68110cf 100644
--- a/freetype/builds/meson/parse_modules_cfg.py
+++ b/freetype/builds/meson/parse_modules_cfg.py
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -87,6 +87,7 @@ def generate_ftmodule(lists):
name = {
"raster": "ft_raster1",
"smooth": "ft_smooth",
+ "svg": "ft_svg",
}.get(module)
result += (
"FT_USE_MODULE( FT_Renderer_Class, %s_renderer_class )\n" % name
diff --git a/freetype/builds/meson/process_ftoption_h.py b/freetype/builds/meson/process_ftoption_h.py
index fe608878..d3f8bb9a 100644
--- a/freetype/builds/meson/process_ftoption_h.py
+++ b/freetype/builds/meson/process_ftoption_h.py
@@ -1,6 +1,6 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/modules.mk b/freetype/builds/modules.mk
index 33fccdf9..abbb0ef9 100644
--- a/freetype/builds/modules.mk
+++ b/freetype/builds/modules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/os2/detect.mk b/freetype/builds/os2/detect.mk
index 7b8962b1..0bb55768 100644
--- a/freetype/builds/os2/detect.mk
+++ b/freetype/builds/os2/detect.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/os2/os2-def.mk b/freetype/builds/os2/os2-def.mk
index 08aab957..4f508bb3 100644
--- a/freetype/builds/os2/os2-def.mk
+++ b/freetype/builds/os2/os2-def.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/os2/os2-dev.mk b/freetype/builds/os2/os2-dev.mk
index 40591ffe..7c35c1c4 100644
--- a/freetype/builds/os2/os2-dev.mk
+++ b/freetype/builds/os2/os2-dev.mk
@@ -5,7 +5,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/os2/os2-gcc.mk b/freetype/builds/os2/os2-gcc.mk
index 854c46df..62003f82 100644
--- a/freetype/builds/os2/os2-gcc.mk
+++ b/freetype/builds/os2/os2-gcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/symbian/bld.inf b/freetype/builds/symbian/bld.inf
index b9d000b1..6d20af91 100644
--- a/freetype/builds/symbian/bld.inf
+++ b/freetype/builds/symbian/bld.inf
@@ -2,7 +2,7 @@
// FreeType 2 project for the symbian platform
//
-// Copyright (C) 2008-2021 by
+// Copyright (C) 2008-2022 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/symbian/freetype.mmp b/freetype/builds/symbian/freetype.mmp
index fa49157a..ef3a96f1 100644
--- a/freetype/builds/symbian/freetype.mmp
+++ b/freetype/builds/symbian/freetype.mmp
@@ -2,7 +2,7 @@
// FreeType 2 makefile for the symbian platform
//
-// Copyright (C) 2008-2021 by
+// Copyright (C) 2008-2022 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/toplevel.mk b/freetype/builds/toplevel.mk
index 53b6d6fc..fb0838e9 100644
--- a/freetype/builds/toplevel.mk
+++ b/freetype/builds/toplevel.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -304,13 +304,12 @@ do-dist: distclean refdoc
cp $(CONFIG_GUESS) builds/unix
cp $(CONFIG_SUB) builds/unix
- @# Generate `ChangeLog' file with commits since previous release.
+ @# Generate `ChangeLog' file with commits since release 2.11.0
+ @# (when we stopped creating this file manually).
$(CHANGELOG_SCRIPT) \
--format='%B%n' \
--no-cluster \
- -- `git describe --tags \
- --abbrev=0 \
- $(version_tag)^`..$(version_tag) \
+ -- VER-2-11-0..$(version_tag) \
> ChangeLog
@# Remove intermediate files created by the `refdoc' target.
diff --git a/freetype/builds/unix/aclocal.m4 b/freetype/builds/unix/aclocal.m4
index 96c1cc7f..5ac1b553 100644
--- a/freetype/builds/unix/aclocal.m4
+++ b/freetype/builds/unix/aclocal.m4
@@ -14,7 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
-# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software
+# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@@ -45,7 +46,7 @@ m4_define([_LT_COPYING], [dnl
# along with this program. If not, see <http://www.gnu.org/licenses/>.
])
-# serial 58 LT_INIT
+# serial 59 LT_INIT
# LT_PREREQ(VERSION)
@@ -195,6 +196,7 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_DECL_FILECMD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
@@ -233,8 +235,8 @@ esac
ofile=libtool
can_build_shared=yes
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
+# All known linkers require a '.a' archive for static linking (except MSVC and
+# ICC, which need '.lib').
libext=a
with_gnu_ld=$lt_cv_prog_gnu_ld
@@ -736,6 +738,7 @@ _LT_CONFIG_SAVE_COMMANDS([
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
@@ -785,7 +788,7 @@ _LT_EOF
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
+ $SED '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
mv -f "$cfgfile" "$ofile" ||
@@ -1047,8 +1050,8 @@ int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
@@ -1072,17 +1075,12 @@ _LT_EOF
_lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]][[,.]]*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ darwin*)
+ case $MACOSX_DEPLOYMENT_TARGET,$host in
+ 10.[[012]],*|,*powerpc*-darwin[[5-8]]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
+ *)
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
@@ -1131,12 +1129,12 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
output_verbose_link_cmd=func_echo_all
_LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
_LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
m4_if([$1], [CXX],
[ if test yes != "$lt_cv_apple_cc_single_mod"; then
_LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
],[])
else
@@ -1250,7 +1248,8 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
# _LT_WITH_SYSROOT
# ----------------
AC_DEFUN([_LT_WITH_SYSROOT],
-[AC_MSG_CHECKING([for sysroot])
+[m4_require([_LT_DECL_SED])dnl
+AC_MSG_CHECKING([for sysroot])
AC_ARG_WITH([sysroot],
[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
[Search for dependent libraries within DIR (or the compiler's sysroot
@@ -1267,7 +1266,7 @@ case $with_sysroot in #(
fi
;; #(
/*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
@@ -1297,7 +1296,7 @@ ia64-*-hpux*)
# options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*ELF-32*)
HPUX_IA64_MODE=32
;;
@@ -1314,7 +1313,7 @@ ia64-*-hpux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
if test yes = "$lt_cv_prog_gnu_ld"; then
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
;;
@@ -1326,7 +1325,7 @@ ia64-*-hpux*)
;;
esac
else
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -1348,7 +1347,7 @@ mips64*-*linux*)
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
emul=elf
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*32-bit*)
emul="${emul}32"
;;
@@ -1356,7 +1355,7 @@ mips64*-*linux*)
emul="${emul}64"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*MSB*)
emul="${emul}btsmip"
;;
@@ -1364,7 +1363,7 @@ mips64*-*linux*)
emul="${emul}ltsmip"
;;
esac
- case `/usr/bin/file conftest.$ac_objext` in
+ case `$FILECMD conftest.$ac_objext` in
*N32*)
emul="${emul}n32"
;;
@@ -1384,14 +1383,14 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# not appear in the list.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*32-bit*)
case $host in
x86_64-*kfreebsd*-gnu)
LD="${LD-ld} -m elf_i386_fbsd"
;;
x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*x86-64*)
LD="${LD-ld} -m elf32_x86_64"
;;
@@ -1459,7 +1458,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
# options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
+ case `$FILECMD conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*)
@@ -1498,9 +1497,22 @@ need_locks=$enable_libtool_lock
m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar}
-: ${AR_FLAGS=cru}
_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+# Use ARFLAGS variable as AR's operation code to sync the variable naming with
+# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have
+# higher priority because thats what people were doing historically (setting
+# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS
+# variable obsoleted/removed.
+
+test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr}
+lt_ar_flags=$AR_FLAGS
+_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)])
+
+# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override
+# by AR_FLAGS because that was never working and AR_FLAGS is about to die.
+_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}],
+ [Flags to create an archive])
AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
[lt_cv_ar_at_file=no
@@ -1719,7 +1731,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=8192;
;;
- bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
+ bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1762,7 +1774,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
sysv5* | sco5v6* | sysv4.2uw2*)
kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'`
else
lt_cv_sys_max_cmd_len=32768
fi
@@ -2212,26 +2224,35 @@ m4_defun([_LT_CMD_STRIPLIB],
striplib=
old_striplib=
AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
+if test -z "$STRIP"; then
+ AC_MSG_RESULT([no])
else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP"; then
+ if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+ else
+ case $host_os in
+ darwin*)
+ # FIXME - insert some real tests, host_os isn't really good enough
striplib="$STRIP -x"
old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
- else
+ ;;
+ freebsd*)
+ if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
+ old_striplib="$STRIP --strip-debug"
+ striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ fi
+ ;;
+ *)
AC_MSG_RESULT([no])
- fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
+ ;;
+ esac
+ fi
fi
_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
_LT_DECL([], [striplib], [1])
@@ -2554,7 +2575,7 @@ cygwin* | mingw* | pw32* | cegcc*)
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
@@ -2564,14 +2585,14 @@ m4_if([$1], [],[
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
;;
- *,cl*)
- # Native MSVC
+ *,cl* | *,icl*)
+ # Native MSVC or ICC
libname_spec='$name'
soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
library_names_spec='$libname.dll.lib'
@@ -2590,7 +2611,7 @@ m4_if([$1], [],[
done
IFS=$lt_save_ifs
# Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
@@ -2627,7 +2648,7 @@ m4_if([$1], [],[
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
@@ -2660,7 +2681,7 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
if test -x /usr/bin/objformat; then
@@ -3459,7 +3480,7 @@ beos*)
bsdi[[45]]*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_cmd='$FILECMD -L'
lt_cv_file_magic_test_file=/shlib/libc.so
;;
@@ -3493,14 +3514,14 @@ darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | dragonfly*)
+freebsd* | dragonfly* | midnightbsd*)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
# Not sure whether the presence of OpenBSD here was a mistake.
# Let's accept both of them until this is cleared up.
lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
;;
esac
@@ -3514,7 +3535,7 @@ haiku*)
;;
hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
case $host_cpu in
ia64*)
lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
@@ -3561,7 +3582,7 @@ netbsd*)
newos6*)
lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_cmd=$FILECMD
lt_cv_file_magic_test_file=/usr/lib/libnls.so
;;
@@ -3688,13 +3709,13 @@ else
mingw*) lt_bad_file=conftest.nm/nofile ;;
*) lt_bad_file=/dev/null ;;
esac
- case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in
*$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
break 2
;;
*)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
break 2
@@ -3720,7 +3741,7 @@ else
# Let the user override the test.
else
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols -headers"
;;
@@ -3960,7 +3981,7 @@ esac
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Gets list of data symbols to import.
- lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'"
# Adjust the below global symbol transforms to fixup imported variables.
lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
@@ -3978,20 +3999,20 @@ fi
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+lt_cv_sys_global_symbol_to_cdecl="$SED -n"\
$lt_cdecl_hook\
" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\
$lt_c_name_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
# Transform an extracted symbol line into symbol name with lib prefix and
# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\
$lt_c_name_lib_hook\
" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
@@ -4015,7 +4036,7 @@ for ac_symprfx in "" "_"; do
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
# Fake it for dumpbin and say T for any non-static function,
# D for any global variable and I for any imported variable.
- # Also find C++ and __fastcall symbols from MSVC++,
+ # Also find C++ and __fastcall symbols from MSVC++ or ICC,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
@@ -4033,9 +4054,9 @@ for ac_symprfx in "" "_"; do
" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx]"
else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+ lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -4322,7 +4343,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -4405,7 +4426,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4741,7 +4762,7 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4924,7 +4945,7 @@ m4_if([$1], [CXX], [
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
@@ -4932,7 +4953,7 @@ m4_if([$1], [CXX], [
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
- cl*)
+ cl* | icl*)
_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
@@ -4989,15 +5010,15 @@ dnl Note also adjust exclude_expsyms for C++ above.
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
+ # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC)
with_gnu_ld=yes
;;
openbsd* | bitrig*)
@@ -5049,7 +5070,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
supports_anon_versioning=no
- case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
+ case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -5161,6 +5182,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
;;
interix[[3-9]]*)
@@ -5175,7 +5197,7 @@ _LT_EOF
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
@@ -5218,7 +5240,7 @@ _LT_EOF
_LT_TAGVAR(compiler_needs_object, $1)=yes
;;
esac
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C 5.9
_LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
@@ -5230,7 +5252,7 @@ _LT_EOF
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
@@ -5246,7 +5268,7 @@ _LT_EOF
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
@@ -5378,7 +5400,7 @@ _LT_EOF
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
_LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
@@ -5561,12 +5583,12 @@ _LT_EOF
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
+ # Microsoft Visual C++ or Intel C++ Compiler.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
case $cc_basename in
- cl*)
- # Native MSVC
+ cl* | icl*)
+ # Native MSVC or ICC
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=yes
@@ -5607,7 +5629,7 @@ _LT_EOF
fi'
;;
*)
- # Assume MSVC wrapper
+ # Assume MSVC and ICC wrapper
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Tell ltmain to make .lib files, not .a files.
@@ -5655,7 +5677,7 @@ _LT_EOF
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
@@ -5866,6 +5888,7 @@ _LT_EOF
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
;;
osf3*)
@@ -6632,8 +6655,8 @@ if test yes != "$_lt_caught_CXX_error"; then
cygwin* | mingw* | pw32* | cegcc*)
case $GXX,$cc_basename in
- ,cl* | no,cl*)
- # Native MSVC
+ ,cl* | no,cl* | ,icl* | no,icl*)
+ # Native MSVC or ICC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
@@ -6731,6 +6754,7 @@ if test yes != "$_lt_caught_CXX_error"; then
emximp -o $lib $output_objdir/$libname.def'
_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
;;
dgux*)
@@ -6761,7 +6785,7 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
;;
- freebsd* | dragonfly*)
+ freebsd* | dragonfly* | midnightbsd*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -6898,7 +6922,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
irix5* | irix6*)
case $cc_basename in
@@ -7038,13 +7062,13 @@ if test yes != "$_lt_caught_CXX_error"; then
_LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
echo "local: *; };" >> $output_objdir/$libname.ver~
$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
;;
*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
@@ -8182,6 +8206,14 @@ _LT_DECL([], [DLLTOOL], [1], [DLL creation program])
AC_SUBST([DLLTOOL])
])
+# _LT_DECL_FILECMD
+# ----------------
+# Check for a file(cmd) program that can be used to detect file type and magic
+m4_defun([_LT_DECL_FILECMD],
+[AC_CHECK_TOOL([FILECMD], [file], [:])
+_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types])
+])# _LD_DECL_FILECMD
+
# _LT_DECL_SED
# ------------
# Check for a fully-functional sed program, that truncates
@@ -8361,8 +8393,8 @@ _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
# Helper functions for option handling. -*- Autoconf -*-
#
-# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
-# Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free
+# Software Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
@@ -8793,7 +8825,7 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience],
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software
# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
@@ -8918,7 +8950,8 @@ m4_define([lt_dict_filter],
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
-# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation,
+# Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
@@ -8927,23 +8960,23 @@ m4_define([lt_dict_filter],
# @configure_input@
-# serial 4179 ltversion.m4
+# serial 4245 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.4.6])
-m4_define([LT_PACKAGE_REVISION], [2.4.6])
+m4_define([LT_PACKAGE_VERSION], [2.4.7])
+m4_define([LT_PACKAGE_REVISION], [2.4.7])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.6'
-macro_revision='2.4.6'
+[macro_version='2.4.7'
+macro_revision='2.4.7'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
-# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
-# Foundation, Inc.
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free
+# Software Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
diff --git a/freetype/builds/unix/configure.ac b/freetype/builds/unix/configure.ac
index d1b7f1a7..393ec3bb 100644
--- a/freetype/builds/unix/configure.ac
+++ b/freetype/builds/unix/configure.ac
@@ -2,7 +2,7 @@
#
# Process this file with autoconf to produce a configure script.
#
-# Copyright (C) 2001-2021 by
+# Copyright (C) 2001-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -11,13 +11,13 @@
# indicate that you have read the license and understand and accept it
# fully.
-AC_INIT([FreeType], [2.11.1], [freetype@nongnu.org], [freetype])
+AC_INIT([FreeType], [2.12.1], [freetype@nongnu.org], [freetype])
AC_CONFIG_SRCDIR([ftconfig.h.in])
# Don't forget to update `docs/VERSIONS.TXT'!
-version_info='24:1:18'
+version_info='24:3:18'
AC_SUBST([version_info])
ft_version=`echo $version_info | tr : .`
AC_SUBST([ft_version])
@@ -317,6 +317,12 @@ if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
AC_MSG_ERROR([external zlib support requested but library not found])
fi
+SYSTEM_ZLIB=
+if test "$have_zlib" != no; then
+ SYSTEM_ZLIB=yes
+fi
+AC_SUBST([SYSTEM_ZLIB])
+
# check for system libbz2
@@ -508,19 +514,48 @@ if test x"$with_brotli" = xyes -a "$have_brotli" = no; then
fi
-# check for librt
+# Checks for the demo programs.
#
-# We need `clock_gettime' for the `ftbench' demo program.
+# FreeType doesn't need this. However, since the demo program repository
+# doesn't come with a `configure` script of its own, we integrate the tests
+# here for simplicity.
+
+# We need `clock_gettime` from 'librt' for the `ftbench` demo program.
#
-# The code is modeled after gnulib's file `clock_time.m4', ignoring
+# The code is modeled after gnulib's file `clock_time.m4`, ignoring
# very old Solaris systems.
-
LIB_CLOCK_GETTIME=
AC_SEARCH_LIBS([clock_gettime],
[rt],
[test "$ac_cv_search_clock_gettime" = "none required" \
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
-AC_SUBST([LIB_CLOCK_GETTIME])
+
+FT_DEMO_CFLAGS=""
+FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
+
+# 'librsvg' is needed to demonstrate SVG support.
+AC_ARG_WITH([librsvg],
+ [AS_HELP_STRING([--with-librsvg=@<:@yes|no|auto@:>@],
+ [support OpenType SVG fonts in FreeType demo programs @<:@default=auto@:>@])],
+ [], [with_librsvg=auto])
+
+have_librsvg=no
+if test x"$with_librsvg" = xyes -o x"$with_librsvg" = xauto; then
+ PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
+ [have_librsvg="yes (pkg-config)"], [:])
+
+ if test "$have_librsvg" != no; then
+ FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
+ FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
+ fi
+fi
+
+if test x"$with_librsvg" = xyes -a "$have_librsvg" = no; then
+ AC_MSG_ERROR([librsvg support requested but library not found])
+fi
+
+AC_SUBST([FT_DEMO_CFLAGS])
+AC_SUBST([FT_DEMO_LDFLAGS])
# Some options handling SDKs/archs in CFLAGS should be copied
@@ -962,32 +997,32 @@ fi
# entries in Requires.private are separated by commas
-REQUIRES_PRIVATE="$zlib_reqpriv, \
- $bzip2_reqpriv, \
- $libpng_reqpriv, \
- $harfbuzz_reqpriv, \
- $brotli_reqpriv"
+PKGCONFIG_REQUIRES_PRIVATE="$zlib_reqpriv, \
+ $bzip2_reqpriv, \
+ $libpng_reqpriv, \
+ $harfbuzz_reqpriv, \
+ $brotli_reqpriv"
# beautify
-REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
- | sed -e 's/^ *//' \
- -e 's/ *$//' \
- -e 's/, */,/g' \
- -e 's/,,*/,/g' \
- -e 's/^,*//' \
- -e 's/,*$//' \
- -e 's/,/, /g'`
-
-LIBS_PRIVATE="$zlib_libspriv \
- $bzip2_libspriv \
- $libpng_libspriv \
- $harfbuzz_libspriv \
- $brotli_libspriv \
- $ft2_extra_libs"
+PKGCONFIG_REQUIRES_PRIVATE=`echo "$PKGCONFIG_REQUIRES_PRIVATE" \
+ | sed -e 's/^ *//' \
+ -e 's/ *$//' \
+ -e 's/, */,/g' \
+ -e 's/,,*/,/g' \
+ -e 's/^,*//' \
+ -e 's/,*$//' \
+ -e 's/,/, /g'`
+
+PKGCONFIG_LIBS_PRIVATE="$zlib_libspriv \
+ $bzip2_libspriv \
+ $libpng_libspriv \
+ $harfbuzz_libspriv \
+ $brotli_libspriv \
+ $ft2_extra_libs"
# beautify
-LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
- | sed -e 's/^ *//' \
- -e 's/ *$//' \
- -e 's/ */ /g'`
+PKGCONFIG_LIBS_PRIVATE=`echo "$PKGCONFIG_LIBS_PRIVATE" \
+ | sed -e 's/^ *//' \
+ -e 's/ *$//' \
+ -e 's/ */ /g'`
LIBSSTATIC_CONFIG="-lfreetype \
$zlib_libsstaticconf \
@@ -1005,10 +1040,28 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
-e 's/ *$//' \
-e 's/ */ /g'`
+# If FreeType gets installed with `--disable-shared', don't use
+# 'private' fields. `pkg-config' only looks into `.pc' files and is
+# completely agnostic to whether shared libraries are actually present
+# or not. As a consequence, the user had to specify `--static' while
+# calling `pkg-config', which configure scripts are normally not
+# prepared for.
+
+PKGCONFIG_REQUIRES=
+PKGCONFIG_LIBS='-L${libdir} -lfreetype'
+
+if test $enable_shared = "no"; then
+ PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES $PKGCONFIG_REQUIRES_PRIVATE"
+ PKGCONFIG_REQUIRES_PRIVATE=
+ PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_PRIVATE"
+ PKGCONFIG_LIBS_PRIVATE=
+fi
AC_SUBST([ftmac_c])
-AC_SUBST([REQUIRES_PRIVATE])
-AC_SUBST([LIBS_PRIVATE])
+AC_SUBST([PKGCONFIG_REQUIRES])
+AC_SUBST([PKGCONFIG_LIBS])
+AC_SUBST([PKGCONFIG_REQUIRES_PRIVATE])
+AC_SUBST([PKGCONFIG_LIBS_PRIVATE])
AC_SUBST([LIBSSTATIC_CONFIG])
AC_SUBST([hardcode_libdir_flag_spec])
diff --git a/freetype/builds/unix/configure.raw b/freetype/builds/unix/configure.raw
index f326872c..fb943fd2 100644
--- a/freetype/builds/unix/configure.raw
+++ b/freetype/builds/unix/configure.raw
@@ -2,7 +2,7 @@
#
# Process this file with autoconf to produce a configure script.
#
-# Copyright (C) 2001-2021 by
+# Copyright (C) 2001-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -17,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.h.in])
# Don't forget to update `docs/VERSIONS.TXT'!
-version_info='24:1:18'
+version_info='24:3:18'
AC_SUBST([version_info])
ft_version=`echo $version_info | tr : .`
AC_SUBST([ft_version])
@@ -317,6 +317,12 @@ if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
AC_MSG_ERROR([external zlib support requested but library not found])
fi
+SYSTEM_ZLIB=
+if test "$have_zlib" != no; then
+ SYSTEM_ZLIB=yes
+fi
+AC_SUBST([SYSTEM_ZLIB])
+
# check for system libbz2
@@ -508,19 +514,48 @@ if test x"$with_brotli" = xyes -a "$have_brotli" = no; then
fi
-# check for librt
+# Checks for the demo programs.
#
-# We need `clock_gettime' for the `ftbench' demo program.
+# FreeType doesn't need this. However, since the demo program repository
+# doesn't come with a `configure` script of its own, we integrate the tests
+# here for simplicity.
+
+# We need `clock_gettime` from 'librt' for the `ftbench` demo program.
#
-# The code is modeled after gnulib's file `clock_time.m4', ignoring
+# The code is modeled after gnulib's file `clock_time.m4`, ignoring
# very old Solaris systems.
-
LIB_CLOCK_GETTIME=
AC_SEARCH_LIBS([clock_gettime],
[rt],
[test "$ac_cv_search_clock_gettime" = "none required" \
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
-AC_SUBST([LIB_CLOCK_GETTIME])
+
+FT_DEMO_CFLAGS=""
+FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
+
+# 'librsvg' is needed to demonstrate SVG support.
+AC_ARG_WITH([librsvg],
+ [AS_HELP_STRING([--with-librsvg=@<:@yes|no|auto@:>@],
+ [support OpenType SVG fonts in FreeType demo programs @<:@default=auto@:>@])],
+ [], [with_librsvg=auto])
+
+have_librsvg=no
+if test x"$with_librsvg" = xyes -o x"$with_librsvg" = xauto; then
+ PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
+ [have_librsvg="yes (pkg-config)"], [:])
+
+ if test "$have_librsvg" != no; then
+ FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
+ FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
+ fi
+fi
+
+if test x"$with_librsvg" = xyes -a "$have_librsvg" = no; then
+ AC_MSG_ERROR([librsvg support requested but library not found])
+fi
+
+AC_SUBST([FT_DEMO_CFLAGS])
+AC_SUBST([FT_DEMO_LDFLAGS])
# Some options handling SDKs/archs in CFLAGS should be copied
@@ -962,32 +997,32 @@ fi
# entries in Requires.private are separated by commas
-REQUIRES_PRIVATE="$zlib_reqpriv, \
- $bzip2_reqpriv, \
- $libpng_reqpriv, \
- $harfbuzz_reqpriv, \
- $brotli_reqpriv"
+PKGCONFIG_REQUIRES_PRIVATE="$zlib_reqpriv, \
+ $bzip2_reqpriv, \
+ $libpng_reqpriv, \
+ $harfbuzz_reqpriv, \
+ $brotli_reqpriv"
# beautify
-REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
- | sed -e 's/^ *//' \
- -e 's/ *$//' \
- -e 's/, */,/g' \
- -e 's/,,*/,/g' \
- -e 's/^,*//' \
- -e 's/,*$//' \
- -e 's/,/, /g'`
-
-LIBS_PRIVATE="$zlib_libspriv \
- $bzip2_libspriv \
- $libpng_libspriv \
- $harfbuzz_libspriv \
- $brotli_libspriv \
- $ft2_extra_libs"
+PKGCONFIG_REQUIRES_PRIVATE=`echo "$PKGCONFIG_REQUIRES_PRIVATE" \
+ | sed -e 's/^ *//' \
+ -e 's/ *$//' \
+ -e 's/, */,/g' \
+ -e 's/,,*/,/g' \
+ -e 's/^,*//' \
+ -e 's/,*$//' \
+ -e 's/,/, /g'`
+
+PKGCONFIG_LIBS_PRIVATE="$zlib_libspriv \
+ $bzip2_libspriv \
+ $libpng_libspriv \
+ $harfbuzz_libspriv \
+ $brotli_libspriv \
+ $ft2_extra_libs"
# beautify
-LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
- | sed -e 's/^ *//' \
- -e 's/ *$//' \
- -e 's/ */ /g'`
+PKGCONFIG_LIBS_PRIVATE=`echo "$PKGCONFIG_LIBS_PRIVATE" \
+ | sed -e 's/^ *//' \
+ -e 's/ *$//' \
+ -e 's/ */ /g'`
LIBSSTATIC_CONFIG="-lfreetype \
$zlib_libsstaticconf \
@@ -1005,10 +1040,28 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
-e 's/ *$//' \
-e 's/ */ /g'`
+# If FreeType gets installed with `--disable-shared', don't use
+# 'private' fields. `pkg-config' only looks into `.pc' files and is
+# completely agnostic to whether shared libraries are actually present
+# or not. As a consequence, the user had to specify `--static' while
+# calling `pkg-config', which configure scripts are normally not
+# prepared for.
+
+PKGCONFIG_REQUIRES=
+PKGCONFIG_LIBS='-L${libdir} -lfreetype'
+
+if test $enable_shared = "no"; then
+ PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES $PKGCONFIG_REQUIRES_PRIVATE"
+ PKGCONFIG_REQUIRES_PRIVATE=
+ PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_PRIVATE"
+ PKGCONFIG_LIBS_PRIVATE=
+fi
AC_SUBST([ftmac_c])
-AC_SUBST([REQUIRES_PRIVATE])
-AC_SUBST([LIBS_PRIVATE])
+AC_SUBST([PKGCONFIG_REQUIRES])
+AC_SUBST([PKGCONFIG_LIBS])
+AC_SUBST([PKGCONFIG_REQUIRES_PRIVATE])
+AC_SUBST([PKGCONFIG_LIBS_PRIVATE])
AC_SUBST([LIBSSTATIC_CONFIG])
AC_SUBST([hardcode_libdir_flag_spec])
diff --git a/freetype/builds/unix/detect.mk b/freetype/builds/unix/detect.mk
index 862b4321..7ed58ff7 100644
--- a/freetype/builds/unix/detect.mk
+++ b/freetype/builds/unix/detect.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/unix/freetype-config.in b/freetype/builds/unix/freetype-config.in
index 4edb092d..c076bc1f 100644
--- a/freetype/builds/unix/freetype-config.in
+++ b/freetype/builds/unix/freetype-config.in
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# Copyright (C) 2000-2021 by
+# Copyright (C) 2000-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/unix/freetype2.in b/freetype/builds/unix/freetype2.in
index 2d759ecf..fe389f4b 100644
--- a/freetype/builds/unix/freetype2.in
+++ b/freetype/builds/unix/freetype2.in
@@ -7,8 +7,8 @@ Name: FreeType 2
URL: https://freetype.org
Description: A free, high-quality, and portable font engine.
Version: %ft_version%
-Requires:
-Requires.private: %REQUIRES_PRIVATE%
-Libs: -L${libdir} -lfreetype
-Libs.private: %LIBS_PRIVATE%
+Requires: %PKGCONFIG_REQUIRES%
+Requires.private: %PKGCONFIG_REQUIRES_PRIVATE%
+Libs: %PKGCONFIG_LIBS%
+Libs.private: %PKGCONFIG_LIBS_PRIVATE%
Cflags: -I${includedir}/freetype2
diff --git a/freetype/builds/unix/freetype2.m4 b/freetype/builds/unix/freetype2.m4
index 478a4221..0cafc8e8 100644
--- a/freetype/builds/unix/freetype2.m4
+++ b/freetype/builds/unix/freetype2.m4
@@ -1,7 +1,7 @@
# Configure paths for FreeType2
# Marcelo Magallon 2001-10-26, based on `gtk.m4` by Owen Taylor
#
-# Copyright (C) 2001-2021 by
+# Copyright (C) 2001-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/unix/ft-munmap.m4 b/freetype/builds/unix/ft-munmap.m4
index 275481ba..c536febb 100644
--- a/freetype/builds/unix/ft-munmap.m4
+++ b/freetype/builds/unix/ft-munmap.m4
@@ -1,6 +1,6 @@
## FreeType specific autoconf tests
#
-# Copyright (C) 2002-2021 by
+# Copyright (C) 2002-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/unix/ftconfig.h.in b/freetype/builds/unix/ftconfig.h.in
index b42fe42f..67474dce 100644
--- a/freetype/builds/unix/ftconfig.h.in
+++ b/freetype/builds/unix/ftconfig.h.in
@@ -4,7 +4,7 @@
*
* UNIX-specific configuration file (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/builds/unix/ftsystem.c b/freetype/builds/unix/ftsystem.c
index 81ed9285..4d2870b5 100644
--- a/freetype/builds/unix/ftsystem.c
+++ b/freetype/builds/unix/ftsystem.c
@@ -4,7 +4,7 @@
*
* Unix-specific FreeType low-level system interface (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/builds/unix/install.mk b/freetype/builds/unix/install.mk
index 45b761d5..0758d6e1 100644
--- a/freetype/builds/unix/install.mk
+++ b/freetype/builds/unix/install.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/unix/ltmain.sh b/freetype/builds/unix/ltmain.sh
index 0f0a2da3..2a50d7f6 100755..100644
--- a/freetype/builds/unix/ltmain.sh
+++ b/freetype/builds/unix/ltmain.sh
@@ -1,12 +1,12 @@
-#! /bin/sh
+#! /usr/bin/env sh
## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
-## by inline-source v2014-01-03.01
+## by inline-source v2019-02-19.15
-# libtool (GNU libtool) 2.4.6
+# libtool (GNU libtool) 2.4.7
# Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-# Copyright (C) 1996-2015 Free Software Foundation, Inc.
+# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -31,8 +31,8 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.4.6
-package_revision=2.4.6
+VERSION=2.4.7
+package_revision=2.4.7
## ------ ##
@@ -64,34 +64,25 @@ package_revision=2.4.6
# libraries, which are installed to $pkgauxdir.
# Set a version string for this script.
-scriptversion=2015-01-20.17; # UTC
+scriptversion=2019-02-19.15; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
-# Copyright (C) 2004-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# As a special exception to the GNU General Public License, if you distribute
-# this file as part of a program or library that is built using GNU Libtool,
-# you may include this file under the same distribution terms that you use
-# for the rest of that program.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES 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, see <http://www.gnu.org/licenses/>.
+# This is free software. There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2004-2019, 2021 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/license/MIT>, and GPL version 2 or later
+# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it. See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
-# Please report bugs or propose patches to gary@gnu.org.
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
## ------ ##
@@ -139,9 +130,12 @@ do
_G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
fi"
done
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# These NLS vars are set unconditionally (bootstrap issue #24). Unset those
+# in case the environment reset is needed later and the $save_* variant is not
+# defined (see the code above).
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
# Make sure IFS has a sensible default
sp=' '
@@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then
fi
+# func_unset VAR
+# --------------
+# Portably unset VAR.
+# In some shells, an 'unset VAR' statement leaves a non-zero return
+# status if VAR is already unset, which might be problematic if the
+# statement is used at the end of a function (thus poisoning its return
+# value) or when 'set -e' is active (causing even a spurious abort of
+# the script in this case).
+func_unset ()
+{
+ { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }
+}
+
+
+# Make sure CDPATH doesn't cause `cd` commands to output the target dir.
+func_unset CDPATH
+
+# Make sure ${,E,F}GREP behave sanely.
+func_unset GREP_OPTIONS
+
## ------------------------- ##
## Locate command utilities. ##
@@ -259,7 +273,7 @@ test -z "$SED" && {
rm -f conftest.in conftest.tmp conftest.nl conftest.out
}
- func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+ func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin"
rm -f conftest.sed
SED=$func_path_progs_result
}
@@ -295,7 +309,7 @@ test -z "$GREP" && {
rm -f conftest.in conftest.tmp conftest.nl conftest.out
}
- func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+ func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin"
GREP=$func_path_progs_result
}
@@ -360,6 +374,35 @@ sed_double_backslash="\
s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
s/\n//g"
+# require_check_ifs_backslash
+# ---------------------------
+# Check if we can use backslash as IFS='\' separator, and set
+# $check_ifs_backshlash_broken to ':' or 'false'.
+require_check_ifs_backslash=func_require_check_ifs_backslash
+func_require_check_ifs_backslash ()
+{
+ _G_save_IFS=$IFS
+ IFS='\'
+ _G_check_ifs_backshlash='a\\b'
+ for _G_i in $_G_check_ifs_backshlash
+ do
+ case $_G_i in
+ a)
+ check_ifs_backshlash_broken=false
+ ;;
+ '')
+ break
+ ;;
+ *)
+ check_ifs_backshlash_broken=:
+ break
+ ;;
+ esac
+ done
+ IFS=$_G_save_IFS
+ require_check_ifs_backslash=:
+}
+
## ----------------- ##
## Global variables. ##
@@ -580,16 +623,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then
{
$debug_cmd
- func_quote_for_eval "$2"
- eval "$1+=\\ \$func_quote_for_eval_result"
+ func_quote_arg pretty "$2"
+ eval "$1+=\\ \$func_quote_arg_result"
}'
else
func_append_quoted ()
{
$debug_cmd
- func_quote_for_eval "$2"
- eval "$1=\$$1\\ \$func_quote_for_eval_result"
+ func_quote_arg pretty "$2"
+ eval "$1=\$$1\\ \$func_quote_arg_result"
}
fi
@@ -1091,85 +1134,203 @@ func_relative_path ()
}
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-# i) func_quote_for_eval_result
-# double-quoted, suitable for a subsequent eval
-# ii) func_quote_for_eval_unquoted_result
-# has all characters that are still active within double
-# quotes backslashified.
-func_quote_for_eval ()
+# func_quote_portable EVAL ARG
+# ----------------------------
+# Internal function to portably implement func_quote_arg. Note that we still
+# keep attention to performance here so we as much as possible try to avoid
+# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
+func_quote_portable ()
{
$debug_cmd
- func_quote_for_eval_unquoted_result=
- func_quote_for_eval_result=
- while test 0 -lt $#; do
- case $1 in
- *[\\\`\"\$]*)
- _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
- *)
- _G_unquoted_arg=$1 ;;
- esac
- if test -n "$func_quote_for_eval_unquoted_result"; then
- func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
- else
- func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+ $require_check_ifs_backslash
+
+ func_quote_portable_result=$2
+
+ # one-time-loop (easy break)
+ while true
+ do
+ if $1; then
+ func_quote_portable_result=`$ECHO "$2" | $SED \
+ -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
+ break
fi
- case $_G_unquoted_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and variable expansion
- # for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- _G_quoted_arg=\"$_G_unquoted_arg\"
+ # Quote for eval.
+ case $func_quote_portable_result in
+ *[\\\`\"\$]*)
+ # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string
+ # contains the shell wildcard characters.
+ case $check_ifs_backshlash_broken$func_quote_portable_result in
+ :*|*[\[\*\?]*)
+ func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
+ | $SED "$sed_quote_subst"`
+ break
+ ;;
+ esac
+
+ func_quote_portable_old_IFS=$IFS
+ for _G_char in '\' '`' '"' '$'
+ do
+ # STATE($1) PREV($2) SEPARATOR($3)
+ set start "" ""
+ func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
+ IFS=$_G_char
+ for _G_part in $func_quote_portable_result
+ do
+ case $1 in
+ quote)
+ func_append func_quote_portable_result "$3$2"
+ set quote "$_G_part" "\\$_G_char"
+ ;;
+ start)
+ set first "" ""
+ func_quote_portable_result=
+ ;;
+ first)
+ set quote "$_G_part" ""
+ ;;
+ esac
+ done
+ done
+ IFS=$func_quote_portable_old_IFS
;;
- *)
- _G_quoted_arg=$_G_unquoted_arg
- ;;
+ *) ;;
esac
-
- if test -n "$func_quote_for_eval_result"; then
- func_append func_quote_for_eval_result " $_G_quoted_arg"
- else
- func_append func_quote_for_eval_result "$_G_quoted_arg"
- fi
- shift
+ break
done
+
+ func_quote_portable_unquoted_result=$func_quote_portable_result
+ case $func_quote_portable_result in
+ # double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and variable expansion
+ # for a subsequent eval.
+ # many bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ func_quote_portable_result=\"$func_quote_portable_result\"
+ ;;
+ esac
}
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
- $debug_cmd
+# func_quotefast_eval ARG
+# -----------------------
+# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
+# but optimized for speed. Result is stored in $func_quotefast_eval.
+if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
+ printf -v _GL_test_printf_tilde %q '~'
+ if test '\~' = "$_GL_test_printf_tilde"; then
+ func_quotefast_eval ()
+ {
+ printf -v func_quotefast_eval_result %q "$1"
+ }
+ else
+ # Broken older Bash implementations. Make those faster too if possible.
+ func_quotefast_eval ()
+ {
+ case $1 in
+ '~'*)
+ func_quote_portable false "$1"
+ func_quotefast_eval_result=$func_quote_portable_result
+ ;;
+ *)
+ printf -v func_quotefast_eval_result %q "$1"
+ ;;
+ esac
+ }
+ fi
+else
+ func_quotefast_eval ()
+ {
+ func_quote_portable false "$1"
+ func_quotefast_eval_result=$func_quote_portable_result
+ }
+fi
- case $1 in
- *[\\\`\"]*)
- _G_arg=`$ECHO "$1" | $SED \
- -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- _G_arg=$1 ;;
+
+# func_quote_arg MODEs ARG
+# ------------------------
+# Quote one ARG to be evaled later. MODEs argument may contain zero or more
+# specifiers listed below separated by ',' character. This function returns two
+# values:
+# i) func_quote_arg_result
+# double-quoted (when needed), suitable for a subsequent eval
+# ii) func_quote_arg_unquoted_result
+# has all characters that are still active within double
+# quotes backslashified. Available only if 'unquoted' is specified.
+#
+# Available modes:
+# ----------------
+# 'eval' (default)
+# - escape shell special characters
+# 'expand'
+# - the same as 'eval'; but do not quote variable references
+# 'pretty'
+# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
+# be used later in func_quote to get output like: 'echo "a b"' instead
+# of 'echo a\ b'. This is slower than default on some shells.
+# 'unquoted'
+# - produce also $func_quote_arg_unquoted_result which does not contain
+# wrapping double-quotes.
+#
+# Examples for 'func_quote_arg pretty,unquoted string':
+#
+# string | *_result | *_unquoted_result
+# ------------+-----------------------+-------------------
+# " | \" | \"
+# a b | "a b" | a b
+# "a b" | "\"a b\"" | \"a b\"
+# * | "*" | *
+# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
+#
+# Examples for 'func_quote_arg pretty,unquoted,expand string':
+#
+# string | *_result | *_unquoted_result
+# --------------+---------------------+--------------------
+# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
+func_quote_arg ()
+{
+ _G_quote_expand=false
+ case ,$1, in
+ *,expand,*)
+ _G_quote_expand=:
+ ;;
esac
- case $_G_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting and command substitution for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- _G_arg=\"$_G_arg\"
+ case ,$1, in
+ *,pretty,*|*,expand,*|*,unquoted,*)
+ func_quote_portable $_G_quote_expand "$2"
+ func_quote_arg_result=$func_quote_portable_result
+ func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
+ ;;
+ *)
+ # Faster quote-for-eval for some shells.
+ func_quotefast_eval "$2"
+ func_quote_arg_result=$func_quotefast_eval_result
;;
esac
+}
+
- func_quote_for_expand_result=$_G_arg
+# func_quote MODEs ARGs...
+# ------------------------
+# Quote all ARGs to be evaled later and join them into single command. See
+# func_quote_arg's description for more info.
+func_quote ()
+{
+ $debug_cmd
+ _G_func_quote_mode=$1 ; shift
+ func_quote_result=
+ while test 0 -lt $#; do
+ func_quote_arg "$_G_func_quote_mode" "$1"
+ if test -n "$func_quote_result"; then
+ func_append func_quote_result " $func_quote_arg_result"
+ else
+ func_append func_quote_result "$func_quote_arg_result"
+ fi
+ shift
+ done
}
@@ -1215,8 +1376,8 @@ func_show_eval ()
_G_cmd=$1
_G_fail_exp=${2-':'}
- func_quote_for_expand "$_G_cmd"
- eval "func_notquiet $func_quote_for_expand_result"
+ func_quote_arg pretty,expand "$_G_cmd"
+ eval "func_notquiet $func_quote_arg_result"
$opt_dry_run || {
eval "$_G_cmd"
@@ -1241,8 +1402,8 @@ func_show_eval_locale ()
_G_fail_exp=${2-':'}
$opt_quiet || {
- func_quote_for_expand "$_G_cmd"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$_G_cmd"
+ eval "func_echo $func_quote_arg_result"
}
$opt_dry_run || {
@@ -1369,30 +1530,26 @@ func_lt_ver ()
# End:
#! /bin/sh
-# Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
-
# A portable, pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010
-# Copyright (C) 2010-2015 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 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.
+# This is free software. There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2010-2019, 2021 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/license/MIT>, and GPL version 2 or later
+# <http://www.gnu.org/licenses/gpl-2.0.html>. You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it. See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
-# Please report bugs or propose patches to gary@gnu.org.
+# Set a version string for this script.
+scriptversion=2019-02-19.15; # UTC
## ------ ##
@@ -1415,7 +1572,7 @@ scriptversion=2014-01-07.03; # UTC
#
# In order for the '--version' option to work, you will need to have a
# suitably formatted comment like the one at the top of this file
-# starting with '# Written by ' and ending with '# warranty; '.
+# starting with '# Written by ' and ending with '# Copyright'.
#
# For '-h' and '--help' to work, you will also need a one line
# description of your script's purpose in a comment directly above the
@@ -1427,7 +1584,7 @@ scriptversion=2014-01-07.03; # UTC
# to display verbose messages only when your user has specified
# '--verbose'.
#
-# After sourcing this file, you can plug processing for additional
+# After sourcing this file, you can plug in processing for additional
# options by amending the variables from the 'Configuration' section
# below, and following the instructions in the 'Option parsing'
# section further down.
@@ -1476,8 +1633,8 @@ fatal_help="Try '\$progname --help' for more information."
## ------------------------- ##
# This section contains functions for adding, removing, and running hooks
-# to the main code. A hook is just a named list of of function, that can
-# be run in order later on.
+# in the main code. A hook is just a list of function names that can be
+# run in order later on.
# func_hookable FUNC_NAME
# -----------------------
@@ -1510,7 +1667,8 @@ func_add_hook ()
# func_remove_hook FUNC_NAME HOOK_FUNC
# ------------------------------------
-# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+# Remove HOOK_FUNC from the list of hook functions to be called by
+# FUNC_NAME.
func_remove_hook ()
{
$debug_cmd
@@ -1519,10 +1677,28 @@ func_remove_hook ()
}
+# func_propagate_result FUNC_NAME_A FUNC_NAME_B
+# ---------------------------------------------
+# If the *_result variable of FUNC_NAME_A _is set_, assign its value to
+# *_result variable of FUNC_NAME_B.
+func_propagate_result ()
+{
+ $debug_cmd
+
+ func_propagate_result_result=:
+ if eval "test \"\${${1}_result+set}\" = set"
+ then
+ eval "${2}_result=\$${1}_result"
+ else
+ func_propagate_result_result=false
+ fi
+}
+
+
# func_run_hooks FUNC_NAME [ARG]...
# ---------------------------------
# Run all hook functions registered to FUNC_NAME.
-# It is assumed that the list of hook functions contains nothing more
+# It's assumed that the list of hook functions contains nothing more
# than a whitespace-delimited list of legal shell function names, and
# no effort is wasted trying to catch shell meta-characters or preserve
# whitespace.
@@ -1532,22 +1708,19 @@ func_run_hooks ()
case " $hookable_fns " in
*" $1 "*) ;;
- *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+ *) func_fatal_error "'$1' does not support hook functions." ;;
esac
eval _G_hook_fns=\$$1_hooks; shift
for _G_hook in $_G_hook_fns; do
- eval $_G_hook '"$@"'
-
- # store returned options list back into positional
- # parameters for next 'cmd' execution.
- eval _G_hook_result=\$${_G_hook}_result
- eval set dummy "$_G_hook_result"; shift
+ func_unset "${_G_hook}_result"
+ eval $_G_hook '${1+"$@"}'
+ func_propagate_result $_G_hook func_run_hooks
+ if $func_propagate_result_result; then
+ eval set dummy "$func_run_hooks_result"; shift
+ fi
done
-
- func_quote_for_eval ${1+"$@"}
- func_run_hooks_result=$func_quote_for_eval_result
}
@@ -1557,10 +1730,18 @@ func_run_hooks ()
## --------------- ##
# In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
-# options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'. Like this:
+# full positional parameter list from your hook function. You may remove
+# or edit any options that you action, and then pass back the remaining
+# unprocessed options in '<hooked_function_name>_result', escaped
+# suitably for 'eval'.
+#
+# The '<hooked_function_name>_result' variable is automatically unset
+# before your hook gets called; for best performance, only set the
+# *_result variable when necessary (i.e. don't call the 'func_quote'
+# function unnecessarily because it can be an expensive operation on some
+# machines).
+#
+# Like this:
#
# my_options_prep ()
# {
@@ -1570,9 +1751,8 @@ func_run_hooks ()
# usage_message=$usage_message'
# -s, --silent don'\''t print informational messages
# '
-#
-# func_quote_for_eval ${1+"$@"}
-# my_options_prep_result=$func_quote_for_eval_result
+# # No change in '$@' (ignored completely by this hook). Leave
+# # my_options_prep_result variable intact.
# }
# func_add_hook func_options_prep my_options_prep
#
@@ -1581,25 +1761,36 @@ func_run_hooks ()
# {
# $debug_cmd
#
-# # Note that for efficiency, we parse as many options as we can
+# args_changed=false
+#
+# # Note that, for efficiency, we parse as many options as we can
# # recognise in a loop before passing the remainder back to the
# # caller on the first unrecognised argument we encounter.
# while test $# -gt 0; do
# opt=$1; shift
# case $opt in
-# --silent|-s) opt_silent=: ;;
+# --silent|-s) opt_silent=:
+# args_changed=:
+# ;;
# # Separate non-argument short options:
# -s*) func_split_short_opt "$_G_opt"
# set dummy "$func_split_short_opt_name" \
# "-$func_split_short_opt_arg" ${1+"$@"}
# shift
+# args_changed=:
# ;;
-# *) set dummy "$_G_opt" "$*"; shift; break ;;
+# *) # Make sure the first unrecognised option "$_G_opt"
+# # is added back to "$@" in case we need it later,
+# # if $args_changed was set to 'true'.
+# set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
# esac
# done
#
-# func_quote_for_eval ${1+"$@"}
-# my_silent_option_result=$func_quote_for_eval_result
+# # Only call 'func_quote' here if we processed at least one argument.
+# if $args_changed; then
+# func_quote eval ${1+"$@"}
+# my_silent_option_result=$func_quote_result
+# fi
# }
# func_add_hook func_parse_options my_silent_option
#
@@ -1610,17 +1801,26 @@ func_run_hooks ()
#
# $opt_silent && $opt_verbose && func_fatal_help "\
# '--silent' and '--verbose' options are mutually exclusive."
-#
-# func_quote_for_eval ${1+"$@"}
-# my_option_validation_result=$func_quote_for_eval_result
# }
# func_add_hook func_validate_options my_option_validation
#
-# You'll alse need to manually amend $usage_message to reflect the extra
+# You'll also need to manually amend $usage_message to reflect the extra
# options you parse. It's preferable to append if you can, so that
# multiple option parsing hooks can be added safely.
+# func_options_finish [ARG]...
+# ----------------------------
+# Finishing the option parse loop (call 'func_options' hooks ATM).
+func_options_finish ()
+{
+ $debug_cmd
+
+ func_run_hooks func_options ${1+"$@"}
+ func_propagate_result func_run_hooks func_options_finish
+}
+
+
# func_options [ARG]...
# ---------------------
# All the functions called inside func_options are hookable. See the
@@ -1630,17 +1830,27 @@ func_options ()
{
$debug_cmd
- func_options_prep ${1+"$@"}
- eval func_parse_options \
- ${func_options_prep_result+"$func_options_prep_result"}
- eval func_validate_options \
- ${func_parse_options_result+"$func_parse_options_result"}
+ _G_options_quoted=false
- eval func_run_hooks func_options \
- ${func_validate_options_result+"$func_validate_options_result"}
+ for my_func in options_prep parse_options validate_options options_finish
+ do
+ func_unset func_${my_func}_result
+ func_unset func_run_hooks_result
+ eval func_$my_func '${1+"$@"}'
+ func_propagate_result func_$my_func func_options
+ if $func_propagate_result_result; then
+ eval set dummy "$func_options_result"; shift
+ _G_options_quoted=:
+ fi
+ done
- # save modified positional parameters for caller
- func_options_result=$func_run_hooks_result
+ $_G_options_quoted || {
+ # As we (func_options) are top-level options-parser function and
+ # nobody quoted "$@" for us yet, we need to do it explicitly for
+ # caller.
+ func_quote eval ${1+"$@"}
+ func_options_result=$func_quote_result
+ }
}
@@ -1649,9 +1859,8 @@ func_options ()
# All initialisations required before starting the option parse loop.
# Note that when calling hook functions, we pass through the list of
# positional parameters. If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
-# modified list must be put in 'func_run_hooks_result' before
-# returning.
+# needs to propagate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before returning.
func_hookable func_options_prep
func_options_prep ()
{
@@ -1662,9 +1871,7 @@ func_options_prep ()
opt_warning_types=
func_run_hooks func_options_prep ${1+"$@"}
-
- # save modified positional parameters for caller
- func_options_prep_result=$func_run_hooks_result
+ func_propagate_result func_run_hooks func_options_prep
}
@@ -1676,25 +1883,32 @@ func_parse_options ()
{
$debug_cmd
- func_parse_options_result=
-
+ _G_parse_options_requote=false
# this just eases exit handling
while test $# -gt 0; do
# Defer to hook functions for initial option parsing, so they
# get priority in the event of reusing an option name.
func_run_hooks func_parse_options ${1+"$@"}
-
- # Adjust func_parse_options positional parameters to match
- eval set dummy "$func_run_hooks_result"; shift
+ func_propagate_result func_run_hooks func_parse_options
+ if $func_propagate_result_result; then
+ eval set dummy "$func_parse_options_result"; shift
+ # Even though we may have changed "$@", we passed the "$@" array
+ # down into the hook and it quoted it for us (because we are in
+ # this if-branch). No need to quote it again.
+ _G_parse_options_requote=false
+ fi
# Break out of the loop if we already parsed every option.
test $# -gt 0 || break
+ # We expect that one of the options parsed in this function matches
+ # and thus we remove _G_opt from "$@" and need to re-quote.
+ _G_match_parse_options=:
_G_opt=$1
shift
case $_G_opt in
--debug|-x) debug_cmd='set -x'
- func_echo "enabling shell trace mode"
+ func_echo "enabling shell trace mode" >&2
$debug_cmd
;;
@@ -1704,7 +1918,10 @@ func_parse_options ()
;;
--warnings|--warning|-W)
- test $# = 0 && func_missing_arg $_G_opt && break
+ if test $# = 0 && func_missing_arg $_G_opt; then
+ _G_parse_options_requote=:
+ break
+ fi
case " $warning_categories $1" in
*" $1 "*)
# trailing space prevents matching last $1 above
@@ -1757,15 +1974,24 @@ func_parse_options ()
shift
;;
- --) break ;;
+ --) _G_parse_options_requote=: ; break ;;
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ *) set dummy "$_G_opt" ${1+"$@"}; shift
+ _G_match_parse_options=false
+ break
+ ;;
esac
+
+ if $_G_match_parse_options; then
+ _G_parse_options_requote=:
+ fi
done
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- func_parse_options_result=$func_quote_for_eval_result
+ if $_G_parse_options_requote; then
+ # save modified positional parameters for caller
+ func_quote eval ${1+"$@"}
+ func_parse_options_result=$func_quote_result
+ fi
}
@@ -1782,12 +2008,10 @@ func_validate_options ()
test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
func_run_hooks func_validate_options ${1+"$@"}
+ func_propagate_result func_run_hooks func_validate_options
# Bail if the options were screwed!
$exit_cmd $EXIT_FAILURE
-
- # save modified positional parameters for caller
- func_validate_options_result=$func_run_hooks_result
}
@@ -1843,8 +2067,8 @@ func_missing_arg ()
# func_split_equals STRING
# ------------------------
-# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-# splitting STRING at the '=' sign.
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables
+# after splitting STRING at the '=' sign.
test -z "$_G_HAVE_XSI_OPS" \
&& (eval 'x=a/b/c;
test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
@@ -1859,8 +2083,9 @@ then
func_split_equals_lhs=${1%%=*}
func_split_equals_rhs=${1#*=}
- test "x$func_split_equals_lhs" = "x$1" \
- && func_split_equals_rhs=
+ if test "x$func_split_equals_lhs" = "x$1"; then
+ func_split_equals_rhs=
+ fi
}'
else
# ...otherwise fall back to using expr, which is often a shell builtin.
@@ -1870,7 +2095,7 @@ else
func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
func_split_equals_rhs=
- test "x$func_split_equals_lhs" = "x$1" \
+ test "x$func_split_equals_lhs=" = "x$1" \
|| func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
}
fi #func_split_equals
@@ -1896,7 +2121,7 @@ else
{
$debug_cmd
- func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+ func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'`
func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
}
fi #func_split_short_opt
@@ -1938,31 +2163,44 @@ func_usage_message ()
# func_version
# ------------
# Echo version message to standard output and exit.
+# The version message is extracted from the calling file's header
+# comments, with leading '# ' stripped:
+# 1. First display the progname and version
+# 2. Followed by the header comment line matching /^# Written by /
+# 3. Then a blank line followed by the first following line matching
+# /^# Copyright /
+# 4. Immediately followed by any lines between the previous matches,
+# except lines preceding the intervening completely blank line.
+# For example, see the header comments of this file.
func_version ()
{
$debug_cmd
printf '%s\n' "$progname $scriptversion"
$SED -n '
- /(C)/!b go
- :more
- /\./!{
- N
- s|\n# | |
- b more
- }
- :go
- /^# Written by /,/# warranty; / {
- s|^# ||
- s|^# *$||
- s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
- p
+ /^# Written by /!b
+ s|^# ||; p; n
+
+ :fwd2blnk
+ /./ {
+ n
+ b fwd2blnk
}
- /^# Written by / {
- s|^# ||
- p
+ p; n
+
+ :holdwrnt
+ s|^# ||
+ s|^# *$||
+ /^Copyright /!{
+ /./H
+ n
+ b holdwrnt
}
- /^warranty; /q' < "$progpath"
+
+ s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+ G
+ s|\(\n\)\n*|\1|g
+ p; q' < "$progpath"
exit $?
}
@@ -1972,12 +2210,12 @@ func_version ()
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
# time-stamp-time-zone: "UTC"
# End:
# Set a version string.
-scriptversion='(GNU libtool) 2.4.6'
+scriptversion='(GNU libtool) 2.4.7'
# func_echo ARG...
@@ -2068,7 +2306,7 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
- version: $progname (GNU libtool) 2.4.6
+ version: $progname (GNU libtool) 2.4.7
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
@@ -2124,7 +2362,7 @@ fi
# a configuration failure hint, and exit.
func_fatal_configuration ()
{
- func__fatal_error ${1+"$@"} \
+ func_fatal_error ${1+"$@"} \
"See the $PACKAGE documentation for more information." \
"Fatal configuration error."
}
@@ -2270,6 +2508,8 @@ libtool_options_prep ()
nonopt=
preserve_args=
+ _G_rc_lt_options_prep=:
+
# Shorthand for --mode=foo, only valid as the first argument
case $1 in
clean|clea|cle|cl)
@@ -2293,11 +2533,16 @@ libtool_options_prep ()
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
shift; set dummy --mode uninstall ${1+"$@"}; shift
;;
+ *)
+ _G_rc_lt_options_prep=false
+ ;;
esac
- # Pass back the list of options.
- func_quote_for_eval ${1+"$@"}
- libtool_options_prep_result=$func_quote_for_eval_result
+ if $_G_rc_lt_options_prep; then
+ # Pass back the list of options.
+ func_quote eval ${1+"$@"}
+ libtool_options_prep_result=$func_quote_result
+ fi
}
func_add_hook func_options_prep libtool_options_prep
@@ -2309,9 +2554,12 @@ libtool_parse_options ()
{
$debug_cmd
+ _G_rc_lt_parse_options=false
+
# Perform our own loop to consume as many options as possible in
# each iteration.
while test $# -gt 0; do
+ _G_match_lt_parse_options=:
_G_opt=$1
shift
case $_G_opt in
@@ -2386,15 +2634,20 @@ libtool_parse_options ()
func_append preserve_args " $_G_opt"
;;
- # An option not handled by this hook function:
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ # An option not handled by this hook function:
+ *) set dummy "$_G_opt" ${1+"$@"} ; shift
+ _G_match_lt_parse_options=false
+ break
+ ;;
esac
+ $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
done
-
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- libtool_parse_options_result=$func_quote_for_eval_result
+ if $_G_rc_lt_parse_options; then
+ # save modified positional parameters for caller
+ func_quote eval ${1+"$@"}
+ libtool_parse_options_result=$func_quote_result
+ fi
}
func_add_hook func_parse_options libtool_parse_options
@@ -2451,8 +2704,8 @@ libtool_validate_options ()
}
# Pass back the unparsed argument list
- func_quote_for_eval ${1+"$@"}
- libtool_validate_options_result=$func_quote_for_eval_result
+ func_quote eval ${1+"$@"}
+ libtool_validate_options_result=$func_quote_result
}
func_add_hook func_validate_options libtool_validate_options
@@ -3418,8 +3671,8 @@ func_mode_compile ()
esac
done
- func_quote_for_eval "$libobj"
- test "X$libobj" != "X$func_quote_for_eval_result" \
+ func_quote_arg pretty "$libobj"
+ test "X$libobj" != "X$func_quote_arg_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
&& func_warning "libobj name '$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" ""
@@ -3492,8 +3745,8 @@ compiler."
func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
srcfile=$func_to_tool_file_result
- func_quote_for_eval "$srcfile"
- qsrcfile=$func_quote_for_eval_result
+ func_quote_arg pretty "$srcfile"
+ qsrcfile=$func_quote_arg_result
# Only build a PIC object if we are building libtool libraries.
if test yes = "$build_libtool_libs"; then
@@ -3648,7 +3901,8 @@ This mode accepts the following additional options:
-prefer-non-pic try to build non-PIC objects only
-shared do not build a '.o' file suitable for static linking
-static only build a '.o' file suitable for static linking
- -Wc,FLAG pass FLAG directly to the compiler
+ -Wc,FLAG
+ -Xcompiler FLAG pass FLAG directly to the compiler
COMPILE-COMMAND is a command to be used in creating a 'standard' object file
from the given SOURCEFILE.
@@ -3754,6 +4008,8 @@ The following components of LINK-COMMAND are treated specially:
-weak LIBNAME declare that the target provides the LIBNAME interface
-Wc,FLAG
-Xcompiler FLAG pass linker-specific FLAG directly to the compiler
+ -Wa,FLAG
+ -Xassembler FLAG pass linker-specific FLAG directly to the assembler
-Wl,FLAG
-Xlinker FLAG pass linker-specific FLAG directly to the linker
-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
@@ -4096,8 +4352,8 @@ func_mode_install ()
case $nonopt in *shtool*) :;; *) false;; esac
then
# Aesthetically quote it.
- func_quote_for_eval "$nonopt"
- install_prog="$func_quote_for_eval_result "
+ func_quote_arg pretty "$nonopt"
+ install_prog="$func_quote_arg_result "
arg=$1
shift
else
@@ -4107,8 +4363,8 @@ func_mode_install ()
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
- func_quote_for_eval "$arg"
- func_append install_prog "$func_quote_for_eval_result"
+ func_quote_arg pretty "$arg"
+ func_append install_prog "$func_quote_arg_result"
install_shared_prog=$install_prog
case " $install_prog " in
*[\\\ /]cp\ *) install_cp=: ;;
@@ -4165,12 +4421,12 @@ func_mode_install ()
esac
# Aesthetically quote the argument.
- func_quote_for_eval "$arg"
- func_append install_prog " $func_quote_for_eval_result"
+ func_quote_arg pretty "$arg"
+ func_append install_prog " $func_quote_arg_result"
if test -n "$arg2"; then
- func_quote_for_eval "$arg2"
+ func_quote_arg pretty "$arg2"
fi
- func_append install_shared_prog " $func_quote_for_eval_result"
+ func_append install_shared_prog " $func_quote_arg_result"
done
test -z "$install_prog" && \
@@ -4181,8 +4437,8 @@ func_mode_install ()
if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else
- func_quote_for_eval "$install_override_mode"
- func_append install_shared_prog " -m $func_quote_for_eval_result"
+ func_quote_arg pretty "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_arg_result"
fi
fi
@@ -4478,8 +4734,8 @@ func_mode_install ()
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
$opt_quiet || {
- func_quote_for_expand "$relink_command"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$relink_command"
+ eval "func_echo $func_quote_arg_result"
}
if eval "$relink_command"; then :
else
@@ -5258,7 +5514,8 @@ else
if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\""
- qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+ func_quote_arg pretty "$ECHO"
+ qECHO=$func_quote_arg_result
$ECHO "\
# A function that is used when there is no print builtin or printf.
@@ -5268,7 +5525,7 @@ func_fallback_echo ()
\$1
_LTECHO_EOF'
}
- ECHO=\"$qECHO\"
+ ECHO=$qECHO
fi
# Very basic option parsing. These options are (a) specific to
@@ -6611,9 +6868,9 @@ func_mode_link ()
while test "$#" -gt 0; do
arg=$1
shift
- func_quote_for_eval "$arg"
- qarg=$func_quote_for_eval_unquoted_result
- func_append libtool_args " $func_quote_for_eval_result"
+ func_quote_arg pretty,unquoted "$arg"
+ qarg=$func_quote_arg_unquoted_result
+ func_append libtool_args " $func_quote_arg_result"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
@@ -6849,6 +7106,13 @@ func_mode_link ()
prev=
continue
;;
+ xassembler)
+ func_append compiler_flags " -Xassembler $qarg"
+ prev=
+ func_append compile_command " -Xassembler $qarg"
+ func_append finalize_command " -Xassembler $qarg"
+ continue
+ ;;
xcclinker)
func_append linker_flags " $qarg"
func_append compiler_flags " $qarg"
@@ -7019,7 +7283,7 @@ func_mode_link ()
# These systems don't actually have a C library (as such)
test X-lc = "X$arg" && continue
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
# Do not include libc due to us having libc/libc_r.
test X-lc = "X$arg" && continue
;;
@@ -7039,7 +7303,7 @@ func_mode_link ()
esac
elif test X-lc_r = "X$arg"; then
case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
@@ -7069,8 +7333,20 @@ func_mode_link ()
prev=xcompiler
continue
;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199.
+ -pthread)
+ case $host in
+ *solaris2*) ;;
+ *)
+ case "$new_inherited_linker_flags " in
+ *" $arg "*) ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+ -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
func_append compiler_flags " $arg"
func_append compile_command " $arg"
@@ -7211,9 +7487,9 @@ func_mode_link ()
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
- func_quote_for_eval "$flag"
- func_append arg " $func_quote_for_eval_result"
- func_append compiler_flags " $func_quote_for_eval_result"
+ func_quote_arg pretty "$flag"
+ func_append arg " $func_quote_arg_result"
+ func_append compiler_flags " $func_quote_arg_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
@@ -7227,16 +7503,21 @@ func_mode_link ()
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
- func_quote_for_eval "$flag"
- func_append arg " $wl$func_quote_for_eval_result"
- func_append compiler_flags " $wl$func_quote_for_eval_result"
- func_append linker_flags " $func_quote_for_eval_result"
+ func_quote_arg pretty "$flag"
+ func_append arg " $wl$func_quote_arg_result"
+ func_append compiler_flags " $wl$func_quote_arg_result"
+ func_append linker_flags " $func_quote_arg_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
+ -Xassembler)
+ prev=xassembler
+ continue
+ ;;
+
-Xcompiler)
prev=xcompiler
continue
@@ -7254,8 +7535,8 @@ func_mode_link ()
# -msg_* for osf cc
-msg_*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
;;
# Flags to be passed through unchanged, with rationale:
@@ -7272,12 +7553,17 @@ func_mode_link ()
# -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
+ # -fsanitize=* Clang/GCC memory and address sanitizer
+ # -fuse-ld=* Linker select flags for GCC
+ # -Wa,* Pass flags directly to the assembler
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+ -specs=*|-fsanitize=*|-fuse-ld=*|-Wa,*)
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
func_append compile_command " $arg"
func_append finalize_command " $arg"
func_append compiler_flags " $arg"
@@ -7298,15 +7584,15 @@ func_mode_link ()
continue
else
# Otherwise treat like 'Some other compiler flag' below
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
fi
;;
# Some other compiler flag.
-* | +*)
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
;;
*.$objext)
@@ -7426,8 +7712,8 @@ func_mode_link ()
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
- func_quote_for_eval "$arg"
- arg=$func_quote_for_eval_result
+ func_quote_arg pretty "$arg"
+ arg=$func_quote_arg_result
;;
esac # arg
@@ -8632,7 +8918,7 @@ func_mode_link ()
test CXX = "$tagname" && {
case $host_os in
linux*)
- case `$CC -V 2>&1 | sed 5q` in
+ case `$CC -V 2>&1 | $SED 5q` in
*Sun\ C*) # Sun C++ 5.9
func_suncc_cstd_abi
@@ -8805,7 +9091,7 @@ func_mode_link ()
#
case $version_type in
# correct linux to gnu/linux during the next big refactor
- darwin|freebsd-elf|linux|osf|windows|none)
+ darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
age=$number_minor
@@ -8896,7 +9182,7 @@ func_mode_link ()
versuffix=.$current.$revision
;;
- freebsd-elf)
+ freebsd-elf | midnightbsd-elf)
func_arith $current - $age
major=.$func_arith_result
versuffix=$major.$age.$revision
@@ -9122,7 +9408,7 @@ func_mode_link ()
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*)
# Do not include libc due to us having libc/libc_r.
;;
*-*-sco3.2v5* | *-*-sco5v6*)
@@ -9933,8 +10219,8 @@ EOF
for cmd in $concat_cmds; do
IFS=$save_ifs
$opt_quiet || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$cmd"
+ eval "func_echo $func_quote_arg_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
@@ -10027,8 +10313,8 @@ EOF
eval cmd=\"$cmd\"
IFS=$save_ifs
$opt_quiet || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
+ func_quote_arg expand,pretty "$cmd"
+ eval "func_echo $func_quote_arg_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
@@ -10502,12 +10788,13 @@ EOF
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ func_quote_arg pretty "$var_value"
+ relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
fi
done
- relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ func_quote eval cd "`pwd`"
+ func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)"
+ relink_command=$func_quote_arg_unquoted_result
fi
# Only actually do things if not in dry run mode.
@@ -10747,13 +11034,15 @@ EOF
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+ func_quote_arg pretty,unquoted "$var_value"
+ relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+ func_quote eval cd "`pwd`"
+ relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ func_quote_arg pretty,unquoted "$relink_command"
+ relink_command=$func_quote_arg_unquoted_result
if test yes = "$hardcode_automatic"; then
relink_command=
fi
diff --git a/freetype/builds/unix/unix-cc.in b/freetype/builds/unix/unix-cc.in
index 89be4501..d5ae4674 100644
--- a/freetype/builds/unix/unix-cc.in
+++ b/freetype/builds/unix/unix-cc.in
@@ -2,7 +2,7 @@
# FreeType 2 template for Unix-specific compiler definitions
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -106,9 +106,7 @@ endif
# Linker flags.
#
-LDFLAGS := @LDFLAGS@
-LIB_CLOCK_GETTIME := @LIB_CLOCK_GETTIME@ # for ftbench
-
+LDFLAGS := @LDFLAGS@
# export symbols
#
@@ -118,11 +116,15 @@ EXPORTS_LIST := $(OBJ_DIR)/ftexport.sym
CCexe := $(CCraw_build) # used to compile `apinames' only
-# Library linking
+# Library linking.
#
LINK_LIBRARY = $(LIBTOOL) --mode=link $(CCraw) -o $@ $(OBJECTS_LIST) \
-rpath $(libdir) -version-info $(version_info) \
$(LDFLAGS) -no-undefined \
-export-symbols $(EXPORTS_LIST)
+# For the demo programs.
+FT_DEMO_CFLAGS := @FT_DEMO_CFLAGS@
+FT_DEMO_LDFLAGS := @FT_DEMO_LDFLAGS@
+
# EOF
diff --git a/freetype/builds/unix/unix-def.in b/freetype/builds/unix/unix-def.in
index d0c758d0..8e298ac5 100644
--- a/freetype/builds/unix/unix-def.in
+++ b/freetype/builds/unix/unix-def.in
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -68,12 +68,14 @@ version_info := @version_info@
# Variables needed for `freetype-config' and `freetype.pc'.
#
-PKG_CONFIG := @PKG_CONFIG@
-REQUIRES_PRIVATE := @REQUIRES_PRIVATE@
-LIBS_PRIVATE := @LIBS_PRIVATE@
-LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
-build_libtool_libs := @build_libtool_libs@
-ft_version := @ft_version@
+PKG_CONFIG := @PKG_CONFIG@
+PKGCONFIG_REQUIRES := @PKGCONFIG_REQUIRES@
+PKGCONFIG_REQUIRES_PRIVATE := @PKGCONFIG_REQUIRES_PRIVATE@
+PKGCONFIG_LIBS := @PKGCONFIG_LIBS@
+PKGCONFIG_LIBS_PRIVATE := @PKGCONFIG_LIBS_PRIVATE@
+LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
+build_libtool_libs := @build_libtool_libs@
+ft_version := @ft_version@
# The directory where all library files are placed.
#
@@ -137,15 +139,17 @@ prefix_x := $(subst $(space),\\$(space),$(prefix))
$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
rm -f $@ $@.tmp
- sed -e 's|%REQUIRES_PRIVATE%|$(REQUIRES_PRIVATE)|' \
- -e 's|%LIBS_PRIVATE%|$(LIBS_PRIVATE)|' \
- -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
- -e 's|%exec_prefix%|$(exec_prefix_x)|' \
- -e 's|%ft_version%|$(ft_version)|' \
- -e 's|%includedir%|$(includedir_x)|' \
- -e 's|%libdir%|$(libdir_x)|' \
- -e 's|%prefix%|$(prefix_x)|' \
- $< \
+ sed -e 's|%PKGCONFIG_REQUIRES%|$(PKGCONFIG_REQUIRES)|' \
+ -e 's|%PKGCONFIG_REQUIRES_PRIVATE%|$(PKGCONFIG_REQUIRES_PRIVATE)|' \
+ -e 's|%PKGCONFIG_LIBS%|$(PKGCONFIG_LIBS)|' \
+ -e 's|%PKGCONFIG_LIBS_PRIVATE%|$(PKGCONFIG_LIBS_PRIVATE)|' \
+ -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
+ -e 's|%exec_prefix%|$(exec_prefix_x)|' \
+ -e 's|%ft_version%|$(ft_version)|' \
+ -e 's|%includedir%|$(includedir_x)|' \
+ -e 's|%libdir%|$(libdir_x)|' \
+ -e 's|%prefix%|$(prefix_x)|' \
+ $< \
> $@.tmp
chmod a-w $@.tmp
mv $@.tmp $@
diff --git a/freetype/builds/unix/unix-dev.mk b/freetype/builds/unix/unix-dev.mk
index 0b572a03..37543895 100644
--- a/freetype/builds/unix/unix-dev.mk
+++ b/freetype/builds/unix/unix-dev.mk
@@ -6,7 +6,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/unix/unix-lcc.mk b/freetype/builds/unix/unix-lcc.mk
index db57835a..0198adfd 100644
--- a/freetype/builds/unix/unix-lcc.mk
+++ b/freetype/builds/unix/unix-lcc.mk
@@ -6,7 +6,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/unix/unix.mk b/freetype/builds/unix/unix.mk
index 262fafb7..e660fafa 100644
--- a/freetype/builds/unix/unix.mk
+++ b/freetype/builds/unix/unix.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/unix/unixddef.mk b/freetype/builds/unix/unixddef.mk
index 77c2a0df..923773e0 100644
--- a/freetype/builds/unix/unixddef.mk
+++ b/freetype/builds/unix/unixddef.mk
@@ -4,7 +4,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/vms/ftconfig.h b/freetype/builds/vms/ftconfig.h
index 2445b7d7..8f5ca967 100644
--- a/freetype/builds/vms/ftconfig.h
+++ b/freetype/builds/vms/ftconfig.h
@@ -4,7 +4,7 @@
*
* VMS-specific configuration file (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/builds/vms/ftsystem.c b/freetype/builds/vms/ftsystem.c
index 31b08708..e700eac5 100644
--- a/freetype/builds/vms/ftsystem.c
+++ b/freetype/builds/vms/ftsystem.c
@@ -4,7 +4,7 @@
/* */
/* VMS-specific FreeType low-level system interface (body). */
/* */
-/* Copyright (C) 1996-2021 by */
+/* Copyright (C) 1996-2022 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/freetype/builds/wince/ftdebug.c b/freetype/builds/wince/ftdebug.c
index 9e177766..7a4fac5d 100644
--- a/freetype/builds/wince/ftdebug.c
+++ b/freetype/builds/wince/ftdebug.c
@@ -4,7 +4,7 @@
*
* Debugging and logging component for WinCE (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/builds/wince/vc2005-ce/index.html b/freetype/builds/wince/vc2005-ce/index.html
index 3e42cf99..0b711ff9 100644
--- a/freetype/builds/wince/vc2005-ce/index.html
+++ b/freetype/builds/wince/vc2005-ce/index.html
@@ -21,7 +21,7 @@ the following targets:
<li>PPC/SP WM6 (Windows Mobile 6)</li>
</ul>
-It compiles the following libraries from the FreeType 2.11.1 sources:</p>
+It compiles the following libraries from the FreeType 2.12.1 sources:</p>
<ul>
<pre>
diff --git a/freetype/builds/wince/vc2008-ce/index.html b/freetype/builds/wince/vc2008-ce/index.html
index 645675c7..23f06ba0 100644
--- a/freetype/builds/wince/vc2008-ce/index.html
+++ b/freetype/builds/wince/vc2008-ce/index.html
@@ -21,7 +21,7 @@ the following targets:
<li>PPC/SP WM6 (Windows Mobile 6)</li>
</ul>
-It compiles the following libraries from the FreeType 2.11.1 sources:</p>
+It compiles the following libraries from the FreeType 2.12.1 sources:</p>
<ul>
<pre>
diff --git a/freetype/builds/windows/detect.mk b/freetype/builds/windows/detect.mk
index 3eef47aa..759a2e64 100644
--- a/freetype/builds/windows/detect.mk
+++ b/freetype/builds/windows/detect.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/ftdebug.c b/freetype/builds/windows/ftdebug.c
index 94c22da7..a65f5446 100644
--- a/freetype/builds/windows/ftdebug.c
+++ b/freetype/builds/windows/ftdebug.c
@@ -4,7 +4,7 @@
*
* Debugging and logging component for Win32 (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -136,6 +136,8 @@
va_start( ap, fmt );
vfprintf( stderr, fmt, ap );
+#if ( defined( _WIN32_WINNT ) && _WIN32_WINNT >= 0x0400 ) || \
+ ( defined( _WIN32_WCE ) && _WIN32_WCE >= 0x0600 )
if ( IsDebuggerPresent() )
{
static char buf[1024];
@@ -144,6 +146,7 @@
vsnprintf( buf, sizeof buf, fmt, ap );
OutputDebugStringA( buf );
}
+#endif
va_end( ap );
}
@@ -159,6 +162,8 @@
va_start( ap, fmt );
vfprintf( stderr, fmt, ap );
+#if ( defined( _WIN32_WINNT ) && _WIN32_WINNT >= 0x0400 ) || \
+ ( defined( _WIN32_WCE ) && _WIN32_WCE >= 0x0600 )
if ( IsDebuggerPresent() )
{
static char buf[1024];
@@ -167,6 +172,7 @@
vsnprintf( buf, sizeof buf, fmt, ap );
OutputDebugStringA( buf );
}
+#endif
va_end( ap );
exit( EXIT_FAILURE );
diff --git a/freetype/builds/windows/ftsystem.c b/freetype/builds/windows/ftsystem.c
index 1ebadd49..6557cea1 100644
--- a/freetype/builds/windows/ftsystem.c
+++ b/freetype/builds/windows/ftsystem.c
@@ -4,7 +4,7 @@
*
* Windows-specific FreeType low-level system interface (body).
*
- * Copyright (C) 2021 by
+ * Copyright (C) 2021-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -196,19 +196,77 @@
}
-#ifdef _WIN32_WCE
+ /* non-desktop Universal Windows Platform */
+#if defined( WINAPI_FAMILY ) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
+
+#define PACK_DWORD64( hi, lo ) ( ( (DWORD64)(hi) << 32 ) | (DWORD)(lo) )
+
+#define CreateFileMapping( a, b, c, d, e, f ) \
+ CreateFileMappingFromApp( a, b, c, PACK_DWORD64( d, e ), f )
+#define MapViewOfFile( a, b, c, d, e ) \
+ MapViewOfFileFromApp( a, b, PACK_DWORD64( c, d ), e )
FT_LOCAL_DEF( HANDLE )
- CreateFileA( LPCSTR lpFileName,
- DWORD dwDesiredAccess,
- DWORD dwShareMode,
- LPSECURITY_ATTRIBUTES lpSecurityAttributes,
- DWORD dwCreationDisposition,
- DWORD dwFlagsAndAttributes,
- HANDLE hTemplateFile )
+ CreateFileA( LPCSTR lpFileName,
+ DWORD dwDesiredAccess,
+ DWORD dwShareMode,
+ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+ DWORD dwCreationDisposition,
+ DWORD dwFlagsAndAttributes,
+ HANDLE hTemplateFile )
{
- int len;
- LPWSTR lpFileNameW;
+ int len;
+ LPWSTR lpFileNameW;
+
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams = {
+ sizeof ( CREATEFILE2_EXTENDED_PARAMETERS ),
+ dwFlagsAndAttributes & 0x0000FFFF,
+ dwFlagsAndAttributes & 0xFFF00000,
+ dwFlagsAndAttributes & 0x000F0000,
+ lpSecurityAttributes,
+ hTemplateFile };
+
+
+ /* allocate memory space for converted path name */
+ len = MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
+ lpFileName, -1, NULL, 0 );
+
+ lpFileNameW = (LPWSTR)_alloca( len * sizeof ( WCHAR ) );
+
+ if ( !len || !lpFileNameW )
+ {
+ FT_ERROR(( "FT_Stream_Open: cannot convert file name to LPWSTR\n" ));
+ return INVALID_HANDLE_VALUE;
+ }
+
+ /* now it is safe to do the translation */
+ MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
+ lpFileName, -1, lpFileNameW, len );
+
+ /* open the file */
+ return CreateFile2( lpFileNameW, dwDesiredAccess, dwShareMode,
+ dwCreationDisposition, &createExParams );
+ }
+
+#endif
+
+
+#if defined( _WIN32_WCE )
+
+ /* malloc.h provides implementation of alloca()/_alloca() */
+ #include <malloc.h>
+
+ FT_LOCAL_DEF( HANDLE )
+ CreateFileA( LPCSTR lpFileName,
+ DWORD dwDesiredAccess,
+ DWORD dwShareMode,
+ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+ DWORD dwCreationDisposition,
+ DWORD dwFlagsAndAttributes,
+ HANDLE hTemplateFile )
+ {
+ int len;
+ LPWSTR lpFileNameW;
/* allocate memory space for converted path name */
@@ -233,10 +291,15 @@
dwFlagsAndAttributes, hTemplateFile );
}
+#endif
+
+
+#if defined( _WIN32_WCE ) || defined ( _WIN32_WINDOWS ) || \
+ !defined( _WIN32_WINNT ) || _WIN32_WINNT <= 0x0400
FT_LOCAL_DEF( BOOL )
- GetFileSizeEx( HANDLE hFile,
- PLARGE_INTEGER lpFileSize )
+ GetFileSizeEx( HANDLE hFile,
+ PLARGE_INTEGER lpFileSize )
{
lpFileSize->u.LowPart = GetFileSize( hFile,
(DWORD *)&lpFileSize->u.HighPart );
@@ -248,7 +311,7 @@
return TRUE;
}
-#endif /* _WIN32_WCE */
+#endif
/* documentation is in ftobjs.h */
diff --git a/freetype/builds/windows/vc2010/freetype.vcxproj b/freetype/builds/windows/vc2010/freetype.vcxproj
index 28411061..53eef596 100644
--- a/freetype/builds/windows/vc2010/freetype.vcxproj
+++ b/freetype/builds/windows/vc2010/freetype.vcxproj
@@ -485,6 +485,7 @@
<ClCompile Include="..\..\..\src\sfnt\sfnt.c" />
<ClCompile Include="..\..\..\src\smooth\smooth.c" />
<ClCompile Include="..\..\..\src\sdf\sdf.c" />
+ <ClCompile Include="..\..\..\src\svg\svg.c" />
<ClCompile Include="..\..\..\src\truetype\truetype.c" />
<ClCompile Include="..\..\..\src\type1\type1.c" />
<ClCompile Include="..\..\..\src\type42\type42.c" />
diff --git a/freetype/builds/windows/vc2010/freetype.vcxproj.filters b/freetype/builds/windows/vc2010/freetype.vcxproj.filters
index f0a075c6..08e4cdeb 100644
--- a/freetype/builds/windows/vc2010/freetype.vcxproj.filters
+++ b/freetype/builds/windows/vc2010/freetype.vcxproj.filters
@@ -68,6 +68,9 @@
<ClCompile Include="..\..\..\src\smooth\smooth.c">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\..\..\src\svg\svg.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
<ClCompile Include="..\..\..\src\truetype\truetype.c">
<Filter>Source Files</Filter>
</ClCompile>
@@ -143,4 +146,4 @@
<Filter>Source Files</Filter>
</ResourceCompile>
</ItemGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/freetype/builds/windows/vc2010/index.html b/freetype/builds/windows/vc2010/index.html
index dcb1944b..904d5e9b 100644
--- a/freetype/builds/windows/vc2010/index.html
+++ b/freetype/builds/windows/vc2010/index.html
@@ -12,7 +12,7 @@
<p>This directory contains solution and project files for
Visual&nbsp;C++&nbsp;2010 or newer, named <tt>freetype.sln</tt>,
and <tt>freetype.vcxproj</tt>. It compiles the following libraries
-from the FreeType 2.11.1 sources:</p>
+from the FreeType 2.12.1 sources:</p>
<ul>
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
diff --git a/freetype/builds/windows/visualc/freetype.vcproj b/freetype/builds/windows/visualc/freetype.vcproj
index f69bc421..85c5f1ca 100644
--- a/freetype/builds/windows/visualc/freetype.vcproj
+++ b/freetype/builds/windows/visualc/freetype.vcproj
@@ -435,9 +435,17 @@
</FileConfiguration>
</File>
<File
+ RelativePath="..\..\..\src\sdf\sdf.c"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\smooth\smooth.c"
>
</File>
+ <File
+ RelativePath="..\..\..\src\svg\svg.c"
+ >
+ </File>
<Filter
Name="FT_MODULES"
>
diff --git a/freetype/builds/windows/visualc/index.html b/freetype/builds/windows/visualc/index.html
index d0c8f2f9..fdced23d 100644
--- a/freetype/builds/windows/visualc/index.html
+++ b/freetype/builds/windows/visualc/index.html
@@ -12,7 +12,7 @@
<p>This directory contains project files <tt>freetype.dsp</tt> for
Visual C++ 6.0, and <tt>freetype.vcproj</tt> for Visual C++ 2002
through 2008, which you might need to upgrade automatically.
-It compiles the following libraries from the FreeType 2.11.1 sources:</p>
+It compiles the following libraries from the FreeType 2.12.1 sources:</p>
<ul>
<li>freetype.dll using 'Release' or 'Debug' configurations</li>
diff --git a/freetype/builds/windows/visualce/index.html b/freetype/builds/windows/visualce/index.html
index b50ef79b..579edb56 100644
--- a/freetype/builds/windows/visualce/index.html
+++ b/freetype/builds/windows/visualce/index.html
@@ -21,7 +21,7 @@ the following targets:
<li>PPC/SP WM6 (Windows Mobile 6)</li>
</ul>
-It compiles the following libraries from the FreeType 2.11.1 sources:</p>
+It compiles the following libraries from the FreeType 2.12.1 sources:</p>
<ul>
<pre>
diff --git a/freetype/builds/windows/w32-bcc.mk b/freetype/builds/windows/w32-bcc.mk
index d497dd15..b88dbac6 100644
--- a/freetype/builds/windows/w32-bcc.mk
+++ b/freetype/builds/windows/w32-bcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/w32-bccd.mk b/freetype/builds/windows/w32-bccd.mk
index 701b83d2..2be492ce 100644
--- a/freetype/builds/windows/w32-bccd.mk
+++ b/freetype/builds/windows/w32-bccd.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/w32-dev.mk b/freetype/builds/windows/w32-dev.mk
index a2f46447..a58f8247 100644
--- a/freetype/builds/windows/w32-dev.mk
+++ b/freetype/builds/windows/w32-dev.mk
@@ -5,7 +5,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/w32-gcc.mk b/freetype/builds/windows/w32-gcc.mk
index 4117453e..52b89333 100644
--- a/freetype/builds/windows/w32-gcc.mk
+++ b/freetype/builds/windows/w32-gcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/w32-icc.mk b/freetype/builds/windows/w32-icc.mk
index ebab45ef..a05a3a78 100644
--- a/freetype/builds/windows/w32-icc.mk
+++ b/freetype/builds/windows/w32-icc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/w32-intl.mk b/freetype/builds/windows/w32-intl.mk
index 0fef8d72..fb5c9609 100644
--- a/freetype/builds/windows/w32-intl.mk
+++ b/freetype/builds/windows/w32-intl.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/w32-lcc.mk b/freetype/builds/windows/w32-lcc.mk
index 7aed5b51..66de0aa5 100644
--- a/freetype/builds/windows/w32-lcc.mk
+++ b/freetype/builds/windows/w32-lcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/w32-mingw32.mk b/freetype/builds/windows/w32-mingw32.mk
index 67317788..e3b89697 100644
--- a/freetype/builds/windows/w32-mingw32.mk
+++ b/freetype/builds/windows/w32-mingw32.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/w32-vcc.mk b/freetype/builds/windows/w32-vcc.mk
index 278624f3..4a48407a 100644
--- a/freetype/builds/windows/w32-vcc.mk
+++ b/freetype/builds/windows/w32-vcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/w32-wat.mk b/freetype/builds/windows/w32-wat.mk
index df2ece36..4458b234 100644
--- a/freetype/builds/windows/w32-wat.mk
+++ b/freetype/builds/windows/w32-wat.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/builds/windows/win32-def.mk b/freetype/builds/windows/win32-def.mk
index 15bfd0cf..eb96181d 100644
--- a/freetype/builds/windows/win32-def.mk
+++ b/freetype/builds/windows/win32-def.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/devel/ft2build.h b/freetype/devel/ft2build.h
index 117532ba..92bc9e01 100644
--- a/freetype/devel/ft2build.h
+++ b/freetype/devel/ft2build.h
@@ -4,7 +4,7 @@
*
* FreeType 2 build and setup macros (development version).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/devel/ftoption.h b/freetype/devel/ftoption.h
index f92b4167..b2363d74 100644
--- a/freetype/devel/ftoption.h
+++ b/freetype/devel/ftoption.h
@@ -4,7 +4,7 @@
*
* User-selectable configuration macros (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -219,6 +219,10 @@ FT_BEGIN_HEADER
* If you use a build system like cmake or the `configure` script,
* options set by those programs have precedence, overwriting the value
* here with the configured one.
+ *
+ * If you use the GNU make build system directly (that is, without the
+ * `configure` script) and you define this macro, you also have to pass
+ * `SYSTEM_ZLIB=yes` as an argument to make.
*/
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
@@ -523,6 +527,20 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * OpenType SVG Glyph Support
+ *
+ * Setting this macro enables support for OpenType SVG glyphs. By
+ * default, FreeType can only fetch SVG documents. However, it can also
+ * render them if external rendering hook functions are plugged in at
+ * runtime.
+ *
+ * More details on the hooks can be found in file `otsvg.h`.
+ */
+#define FT_CONFIG_OPTION_SVG
+
+
+ /**************************************************************************
+ *
* Error Strings
*
* If this macro is set, `FT_Error_String` will return meaningful
@@ -1000,8 +1018,8 @@ FT_BEGIN_HEADER
#error "Invalid CFF darkening parameters!"
#endif
-FT_END_HEADER
+FT_END_HEADER
#endif /* FTOPTION_H_ */
diff --git a/freetype/docs/CHANGES b/freetype/docs/CHANGES
index 5eb8cdb9..3ad7ec43 100644
--- a/freetype/docs/CHANGES
+++ b/freetype/docs/CHANGES
@@ -1,3 +1,84 @@
+CHANGES BETWEEN 2.12.0 and 2.12.1
+
+ I. IMPORTANT BUG FIXES
+
+ - Loading CFF fonts sometimes made FreeType crash (bug introduced in
+ version 2.12.0)
+
+ - Loading a fully hinted TrueType glyph a second time (without
+ caching) sometimes yielded different rendering results if TrueType
+ hinting was active (bug introduced in version 2.12.0).
+
+ - The generation of the pkg-config file `freetype2.pc` was broken if
+ the build was done with cmake (bug introduced in version 2.12.0).
+
+
+ II. MISCELLANEOUS
+
+ - New option `--with-librsvg` for the `configure` script for better
+ FreeType demo support.
+
+ - The meson build no longer enforces both static and dynamic
+ versions of the library by default.
+
+ - The internal zlib library was updated to version 1.2.12. Note,
+ however, that FreeType is *not* affected by CVE-2018-25032 since
+ it only does decompression.
+
+
+======================================================================
+
+CHANGES BETWEEN 2.11.1 and 2.12.0
+
+ I. IMPORTANT CHANGES
+
+ - FreeType now handles OT-SVG fonts, to be controlled with
+ `FT_CONFIG_OPTION_SVG` configuration macro. By default, it can
+ only load the 'SVG ' table of an OpenType font. However, by using
+ the `svg-hooks` property of the new 'ot-svg' module it is possible
+ to register an external SVG rendering engine. The FreeType demo
+ programs have been set up to use 'librsvg' as the rendering
+ library.
+
+ This work was Moazin Khatti's GSoC 2019 project.
+
+
+ II. MISCELLANEOUS
+
+ - The handling of fonts with an 'sbix' table has been improved.
+
+ - Corrected bitmap offsets.
+
+ - A new tag `FT_PARAM_TAG_IGNORE_SBIX` for `FT_Open_Face` makes
+ FreeType ignore an 'sbix' table in a font, allowing applications
+ to access the font's outline glyphs.
+
+ - `FT_FACE_FLAG_SBIX` and `FT_FACE_FLAG_SBIX_OVERLAY` together
+ with their corresponding preprocessor macros `FT_HAS_SBIX` and
+ `FT_HAS_SBIX_OVERLAY` enable applications to treat 'sbix' tables
+ as described in the OpenType specification.
+
+ - The internal 'zlib' code has been updated to be in sync with the
+ current 'zlib' version (1.2.11).
+
+ - The previously internal load flag `FT_LOAD_SBITS_ONLY` is now
+ public.
+
+ - Some minor improvements of the building systems, in particular
+ handling of the 'zlib' library (internal vs. external).
+
+ - Support for non-desktop Universal Windows Platform.
+
+ - Various other minor bug and documentation fixes.
+
+ - The `ftdump` demo program shows more information for Type1 fonts
+ if option `-n` is given.
+
+ - `ftgrid` can now display embedded bitmap strikes.
+
+
+======================================================================
+
CHANGES BETWEEN 2.11.0 and 2.11.1
I. IMPORTANT CHANGES
@@ -5449,7 +5530,7 @@ Extensions support:
------------------------------------------------------------------------
-Copyright (C) 2000-2021 by
+Copyright (C) 2000-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/CUSTOMIZE b/freetype/docs/CUSTOMIZE
index a03f9ddd..1a750825 100644
--- a/freetype/docs/CUSTOMIZE
+++ b/freetype/docs/CUSTOMIZE
@@ -139,7 +139,7 @@ IV. Overriding default configuration and module headers
----------------------------------------------------------------------
-Copyright (C) 2003-2021 by
+Copyright (C) 2003-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/DEBUG b/freetype/docs/DEBUG
index 4f358779..fd2de134 100644
--- a/freetype/docs/DEBUG
+++ b/freetype/docs/DEBUG
@@ -297,7 +297,7 @@ to access them.
------------------------------------------------------------------------
-Copyright (C) 2002-2021 by
+Copyright (C) 2002-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/DOCGUIDE b/freetype/docs/DOCGUIDE
index 499608d5..3dbe499d 100644
--- a/freetype/docs/DOCGUIDE
+++ b/freetype/docs/DOCGUIDE
@@ -285,7 +285,7 @@ is converted to
----------------------------------------------------------------------
-Copyright (C) 2018-2021 by
+Copyright (C) 2018-2022 by
Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/INSTALL b/freetype/docs/INSTALL
index be56e02c..2a2bc5e5 100644
--- a/freetype/docs/INSTALL
+++ b/freetype/docs/INSTALL
@@ -101,7 +101,7 @@ III. Custom builds of the library
----------------------------------------------------------------------
-Copyright (C) 2000-2021 by
+Copyright (C) 2000-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/INSTALL.ANY b/freetype/docs/INSTALL.ANY
index 31366131..ceb76f5a 100644
--- a/freetype/docs/INSTALL.ANY
+++ b/freetype/docs/INSTALL.ANY
@@ -144,7 +144,7 @@ II. Support for flat-directory compilation
----------------------------------------------------------------------
-Copyright (C) 2003-2021 by
+Copyright (C) 2003-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/INSTALL.CROSS b/freetype/docs/INSTALL.CROSS
index f57b14c8..931a4d79 100644
--- a/freetype/docs/INSTALL.CROSS
+++ b/freetype/docs/INSTALL.CROSS
@@ -163,7 +163,7 @@ procedure.
----------------------------------------------------------------------
-Copyright (C) 2006-2021 by
+Copyright (C) 2006-2022 by
suzuki toshiya, David Turner, Robert Wilhelm, and Werner Lemberg.
diff --git a/freetype/docs/INSTALL.GNU b/freetype/docs/INSTALL.GNU
index a04e6fc1..5e161ad9 100644
--- a/freetype/docs/INSTALL.GNU
+++ b/freetype/docs/INSTALL.GNU
@@ -168,7 +168,7 @@ instructions in the file `INSTALL.UNIX' instead.
----------------------------------------------------------------------
-Copyright (C) 2003-2021 by
+Copyright (C) 2003-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/INSTALL.UNIX b/freetype/docs/INSTALL.UNIX
index ff4eabed..b6f63c87 100644
--- a/freetype/docs/INSTALL.UNIX
+++ b/freetype/docs/INSTALL.UNIX
@@ -126,7 +126,7 @@ or MSys on Win32:
----------------------------------------------------------------------
-Copyright (C) 2003-2021 by
+Copyright (C) 2003-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/INSTALL.VMS b/freetype/docs/INSTALL.VMS
index f0dec3bd..6cd390d9 100644
--- a/freetype/docs/INSTALL.VMS
+++ b/freetype/docs/INSTALL.VMS
@@ -49,7 +49,7 @@ V7.2-1.
------------------------------------------------------------------------
-Copyright (C) 2000-2021 by
+Copyright (C) 2000-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/LICENSE.TXT b/freetype/docs/LICENSE.TXT
deleted file mode 100644
index af5a1c50..00000000
--- a/freetype/docs/LICENSE.TXT
+++ /dev/null
@@ -1,39 +0,0 @@
-
-The FreeType 2 font engine is copyrighted work and cannot be used
-legally without a software license. In order to make this project
-usable to a vast majority of developers, we distribute it under two
-mutually exclusive open-source licenses.
-
-This means that *you* must choose *one* of the two licenses described
-below, then obey all its terms and conditions when using FreeType 2 in
-any of your projects or products.
-
- - The FreeType License, found in the file `FTL.TXT', which is similar
- to the original BSD license *with* an advertising clause that forces
- you to explicitly cite the FreeType project in your product's
- documentation. All details are in the license file. This license
- is suited to products which don't use the GNU General Public
- License.
-
- Note that this license is compatible to the GNU General Public
- License version 3, but not version 2.
-
- - The GNU General Public License version 2, found in `GPLv2.TXT' (any
- later version can be used also), for programs which already use the
- GPL. Note that the FTL is incompatible with GPLv2 due to its
- advertisement clause.
-
-The contributed BDF and PCF drivers come with a license similar to that
-of the X Window System. It is compatible to the above two licenses (see
-file src/bdf/README and src/pcf/README). The same holds for the files
-`fthash.c' and `fthash.h'; their code was part of the BDF driver in
-earlier FreeType versions.
-
-The gzip module uses the zlib license (see src/gzip/zlib.h) which too is
-compatible to the above two licenses.
-
-The MD5 checksum support (only used for debugging in development builds)
-is in the public domain.
-
-
---- end of LICENSE.TXT ---
diff --git a/freetype/docs/TODO b/freetype/docs/TODO
index ecc1efdb..623866ea 100644
--- a/freetype/docs/TODO
+++ b/freetype/docs/TODO
@@ -27,7 +27,7 @@ Other bugs have been registered at the savannah bugzilla of FreeType.
------------------------------------------------------------------------
-Copyright (C) 2001-2021 by
+Copyright (C) 2001-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/VERSIONS.TXT b/freetype/docs/VERSIONS.TXT
index afe50a4c..82dda0f2 100644
--- a/freetype/docs/VERSIONS.TXT
+++ b/freetype/docs/VERSIONS.TXT
@@ -60,6 +60,8 @@ found on _most_ systems, but not all of them:
release libtool so
-------------------------------
+ 2.12.1 24.3.18 6.18.3
+ 2.12.0 24.2.18 6.18.2
2.11.1 24.1.18 6.18.1
2.11.0 24.0.18 6.18.0
2.10.4 23.4.17 6.17.4
@@ -119,7 +121,7 @@ other release numbers.
----------------------------------------------------------------------
-Copyright (C) 2002-2021 by
+Copyright (C) 2002-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/formats.txt b/freetype/docs/formats.txt
index 1c25ac00..e0cafbaa 100644
--- a/freetype/docs/formats.txt
+++ b/freetype/docs/formats.txt
@@ -200,7 +200,7 @@ which isn't supported yet please send a mail too.
------------------------------------------------------------------------
-Copyright (C) 2004-2021 by
+Copyright (C) 2004-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/freetype-config.1 b/freetype/docs/freetype-config.1
index 8145c9f2..ca067fc3 100644
--- a/freetype/docs/freetype-config.1
+++ b/freetype/docs/freetype-config.1
@@ -1,4 +1,4 @@
-.TH FREETYPE-CONFIG 1 "December 2021" "FreeType 2.11.1"
+.TH FREETYPE-CONFIG 1 "May 2022" "FreeType 2.12.1"
.
.
.SH NAME
diff --git a/freetype/docs/oldlogs/ChangeLog.20 b/freetype/docs/oldlogs/ChangeLog.20
index 15ae8fe9..d3173240 100644
--- a/freetype/docs/oldlogs/ChangeLog.20
+++ b/freetype/docs/oldlogs/ChangeLog.20
@@ -2597,7 +2597,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2000-2021 by
+Copyright (C) 2000-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.21 b/freetype/docs/oldlogs/ChangeLog.21
index 71f9f00d..e8a36ae0 100644
--- a/freetype/docs/oldlogs/ChangeLog.21
+++ b/freetype/docs/oldlogs/ChangeLog.21
@@ -9422,7 +9422,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2002-2021 by
+Copyright (C) 2002-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.210 b/freetype/docs/oldlogs/ChangeLog.210
index eea4d27b..6139fe8d 100644
--- a/freetype/docs/oldlogs/ChangeLog.210
+++ b/freetype/docs/oldlogs/ChangeLog.210
@@ -7799,7 +7799,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2018-2021 by
+Copyright (C) 2018-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.22 b/freetype/docs/oldlogs/ChangeLog.22
index e25cafcc..e7e13604 100644
--- a/freetype/docs/oldlogs/ChangeLog.22
+++ b/freetype/docs/oldlogs/ChangeLog.22
@@ -2821,7 +2821,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2005-2021 by
+Copyright (C) 2005-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.23 b/freetype/docs/oldlogs/ChangeLog.23
index 0e32ca8e..d0792cba 100644
--- a/freetype/docs/oldlogs/ChangeLog.23
+++ b/freetype/docs/oldlogs/ChangeLog.23
@@ -7932,7 +7932,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2006-2021 by
+Copyright (C) 2006-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.24 b/freetype/docs/oldlogs/ChangeLog.24
index 9d06b0f5..aa9ca8c2 100644
--- a/freetype/docs/oldlogs/ChangeLog.24
+++ b/freetype/docs/oldlogs/ChangeLog.24
@@ -6344,7 +6344,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2010-2021 by
+Copyright (C) 2010-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.25 b/freetype/docs/oldlogs/ChangeLog.25
index 5d0371c4..a2b6a91c 100644
--- a/freetype/docs/oldlogs/ChangeLog.25
+++ b/freetype/docs/oldlogs/ChangeLog.25
@@ -5145,7 +5145,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2013-2021 by
+Copyright (C) 2013-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.26 b/freetype/docs/oldlogs/ChangeLog.26
index eb87803b..59dd6022 100644
--- a/freetype/docs/oldlogs/ChangeLog.26
+++ b/freetype/docs/oldlogs/ChangeLog.26
@@ -5695,7 +5695,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2015-2021 by
+Copyright (C) 2015-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.27 b/freetype/docs/oldlogs/ChangeLog.27
index c5fb1f9a..d35e3446 100644
--- a/freetype/docs/oldlogs/ChangeLog.27
+++ b/freetype/docs/oldlogs/ChangeLog.27
@@ -2090,7 +2090,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2016-2021 by
+Copyright (C) 2016-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.28 b/freetype/docs/oldlogs/ChangeLog.28
index d7cc2e01..8e655e4d 100644
--- a/freetype/docs/oldlogs/ChangeLog.28
+++ b/freetype/docs/oldlogs/ChangeLog.28
@@ -3120,7 +3120,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2016-2021 by
+Copyright (C) 2016-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/oldlogs/ChangeLog.29 b/freetype/docs/oldlogs/ChangeLog.29
index e668b4f0..1274085f 100644
--- a/freetype/docs/oldlogs/ChangeLog.29
+++ b/freetype/docs/oldlogs/ChangeLog.29
@@ -2336,7 +2336,7 @@
----------------------------------------------------------------------------
-Copyright (C) 2017-2021 by
+Copyright (C) 2017-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/docs/raster.txt b/freetype/docs/raster.txt
index 72d9fe28..05fbe491 100644
--- a/freetype/docs/raster.txt
+++ b/freetype/docs/raster.txt
@@ -618,7 +618,7 @@ II. Rendering Technology
------------------------------------------------------------------------
-Copyright (C) 2003-2021 by
+Copyright (C) 2003-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/docs/reference/404.html b/freetype/docs/reference/404.html
index 4c8afae1..5bf23ff8 100644
--- a/freetype/docs/reference/404.html
+++ b/freetype/docs/reference/404.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>FreeType-2.11.1 API Reference</title>
+ <title>FreeType-2.12.1 API Reference</title>
@@ -77,7 +77,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="/index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="/index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="/images/favico.ico" alt="logo">
@@ -89,7 +89,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -156,12 +156,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="/index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="/index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="/images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -537,6 +537,18 @@
<li class="md-nav__item">
+ <a href="/ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="/ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -651,6 +663,18 @@
<li class="md-nav__item">
+ <a href="/ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="/ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1076,7 +1100,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/assets/fonts/font-awesome.css b/freetype/docs/reference/assets/fonts/font-awesome.css
deleted file mode 100644
index b476b53e..00000000
--- a/freetype/docs/reference/assets/fonts/font-awesome.css
+++ /dev/null
@@ -1,4 +0,0 @@
-/*!
- * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome
- * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
- */@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url("specimen/FontAwesome.woff2") format("woff2"),url("specimen/FontAwesome.woff") format("woff"),url("specimen/FontAwesome.ttf") format("truetype")}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1,-1);-ms-transform:scale(1,-1);transform:scale(1,-1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} \ No newline at end of file
diff --git a/freetype/docs/reference/assets/fonts/material-icons.css b/freetype/docs/reference/assets/fonts/material-icons.css
deleted file mode 100644
index d23d365e..00000000
--- a/freetype/docs/reference/assets/fonts/material-icons.css
+++ /dev/null
@@ -1,13 +0,0 @@
-/*!
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy
- * of the License at:
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, SOFTWARE
- * DISTRIBUTED UNDER THE LICENSE IS DISTRIBUTED ON AN "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
- * SEE THE LICENSE FOR THE SPECIFIC LANGUAGE GOVERNING PERMISSIONS AND
- * LIMITATIONS UNDER THE LICENSE.
- */@font-face{font-family:"Material Icons";font-style:normal;font-weight:400;src:local("Material Icons"),local("MaterialIcons-Regular"),url("specimen/MaterialIcons-Regular.woff2") format("woff2"),url("specimen/MaterialIcons-Regular.woff") format("woff"),url("specimen/MaterialIcons-Regular.ttf") format("truetype")} \ No newline at end of file
diff --git a/freetype/docs/reference/assets/fonts/specimen/FontAwesome.ttf b/freetype/docs/reference/assets/fonts/specimen/FontAwesome.ttf
deleted file mode 100644
index 35acda2f..00000000
--- a/freetype/docs/reference/assets/fonts/specimen/FontAwesome.ttf
+++ /dev/null
Binary files differ
diff --git a/freetype/docs/reference/assets/fonts/specimen/FontAwesome.woff b/freetype/docs/reference/assets/fonts/specimen/FontAwesome.woff
deleted file mode 100644
index 400014a4..00000000
--- a/freetype/docs/reference/assets/fonts/specimen/FontAwesome.woff
+++ /dev/null
Binary files differ
diff --git a/freetype/docs/reference/assets/fonts/specimen/FontAwesome.woff2 b/freetype/docs/reference/assets/fonts/specimen/FontAwesome.woff2
deleted file mode 100644
index 4d13fc60..00000000
--- a/freetype/docs/reference/assets/fonts/specimen/FontAwesome.woff2
+++ /dev/null
Binary files differ
diff --git a/freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.ttf b/freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.ttf
deleted file mode 100644
index 7015564a..00000000
--- a/freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.ttf
+++ /dev/null
Binary files differ
diff --git a/freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.woff b/freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.woff
deleted file mode 100644
index b648a3ee..00000000
--- a/freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.woff
+++ /dev/null
Binary files differ
diff --git a/freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.woff2 b/freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.woff2
deleted file mode 100644
index 9fa21125..00000000
--- a/freetype/docs/reference/assets/fonts/specimen/MaterialIcons-Regular.woff2
+++ /dev/null
Binary files differ
diff --git a/freetype/docs/reference/assets/images/icons/bitbucket.1b09e088.svg b/freetype/docs/reference/assets/images/icons/bitbucket.1b09e088.svg
deleted file mode 100644
index cf58c14f..00000000
--- a/freetype/docs/reference/assets/images/icons/bitbucket.1b09e088.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="352" height="448" viewBox="0 0 352 448" id="__bitbucket"><path fill="currentColor" d="M203.75 214.75q2 15.75-12.625 25.25t-27.875 1.5q-9.75-4.25-13.375-14.5t-.125-20.5 13-14.5q9-4.5 18.125-3t16 8.875 6.875 16.875zm27.75-5.25q-3.5-26.75-28.25-41T154 165.25q-15.75 7-25.125 22.125t-8.625 32.375q1 22.75 19.375 38.75t41.375 14q22.75-2 38-21t12.5-42zM291.25 74q-5-6.75-14-11.125t-14.5-5.5T245 54.25q-72.75-11.75-141.5.5-10.75 1.75-16.5 3t-13.75 5.5T60.75 74q7.5 7 19 11.375t18.375 5.5T120 93.75Q177 101 232 94q15.75-2 22.375-3t18.125-5.375T291.25 74zm14.25 258.75q-2 6.5-3.875 19.125t-3.5 21-7.125 17.5-14.5 14.125q-21.5 12-47.375 17.875t-50.5 5.5-50.375-4.625q-11.5-2-20.375-4.5T88.75 412 70.5 401.125t-13-15.375q-6.25-24-14.25-73l1.5-4 4.5-2.25q55.75 37 126.625 37t126.875-37q5.25 1.5 6 5.75t-1.25 11.25-2 9.25zM350.75 92.5q-6.5 41.75-27.75 163.75-1.25 7.5-6.75 14t-10.875 10T291.75 288q-63 31.5-152.5 22-62-6.75-98.5-34.75-3.75-3-6.375-6.625t-4.25-8.75-2.25-8.5-1.5-9.875T25 232.75q-2.25-12.5-6.625-37.5t-7-40.375T5.5 118 0 78.5Q.75 72 4.375 66.375T12.25 57t11.25-7.5T35 43.875t12-4.625q31.25-11.5 78.25-16 94.75-9.25 169 12.5Q333 47.25 348 66.25q4 5 4.125 12.75t-1.375 13.5z"/></svg> \ No newline at end of file
diff --git a/freetype/docs/reference/assets/images/icons/github.f0b8504a.svg b/freetype/docs/reference/assets/images/icons/github.f0b8504a.svg
deleted file mode 100644
index 3d13b197..00000000
--- a/freetype/docs/reference/assets/images/icons/github.f0b8504a.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="416" height="448" viewBox="0 0 416 448" id="__github"><path fill="currentColor" d="M160 304q0 10-3.125 20.5t-10.75 19T128 352t-18.125-8.5-10.75-19T96 304t3.125-20.5 10.75-19T128 256t18.125 8.5 10.75 19T160 304zm160 0q0 10-3.125 20.5t-10.75 19T288 352t-18.125-8.5-10.75-19T256 304t3.125-20.5 10.75-19T288 256t18.125 8.5 10.75 19T320 304zm40 0q0-30-17.25-51T296 232q-10.25 0-48.75 5.25Q229.5 240 208 240t-39.25-2.75Q130.75 232 120 232q-29.5 0-46.75 21T56 304q0 22 8 38.375t20.25 25.75 30.5 15 35 7.375 37.25 1.75h42q20.5 0 37.25-1.75t35-7.375 30.5-15 20.25-25.75T360 304zm56-44q0 51.75-15.25 82.75-9.5 19.25-26.375 33.25t-35.25 21.5-42.5 11.875-42.875 5.5T212 416q-19.5 0-35.5-.75t-36.875-3.125-38.125-7.5-34.25-12.875T37 371.5t-21.5-28.75Q0 312 0 260q0-59.25 34-99-6.75-20.5-6.75-42.5 0-29 12.75-54.5 27 0 47.5 9.875t47.25 30.875Q171.5 96 212 96q37 0 70 8 26.25-20.5 46.75-30.25T376 64q12.75 25.5 12.75 54.5 0 21.75-6.75 42 34 40 34 99.5z"/></svg> \ No newline at end of file
diff --git a/freetype/docs/reference/assets/images/icons/gitlab.6dd19c00.svg b/freetype/docs/reference/assets/images/icons/gitlab.6dd19c00.svg
deleted file mode 100644
index 1d9fffa7..00000000
--- a/freetype/docs/reference/assets/images/icons/gitlab.6dd19c00.svg
+++ /dev/null
@@ -1 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500" viewBox="0 0 500 500" id="__gitlab"><path fill="currentColor" d="M93.667 473.347l90.684-279.097H2.983l90.684 279.097z" transform="translate(156.198 1.16)"/><path fill="currentColor" d="M221.333 473.345L130.649 194.25H3.557l217.776 279.095z" transform="translate(28.531 1.16)" opacity=".7"/><path fill="currentColor" d="M32 195.155L4.441 279.97a18.773 18.773 0 0 0 6.821 20.99l238.514 173.29L32 195.155z" transform="translate(.089 .256)" opacity=".5"/><path fill="currentColor" d="M2.667-84.844h127.092L75.14-252.942c-2.811-8.649-15.047-8.649-17.856 0L2.667-84.844z" transform="translate(29.422 280.256)"/><path fill="currentColor" d="M2.667 473.345L93.351 194.25h127.092L2.667 473.345z" transform="translate(247.198 1.16)" opacity=".7"/><path fill="currentColor" d="M221.334 195.155l27.559 84.815a18.772 18.772 0 0 1-6.821 20.99L3.557 474.25l217.777-279.095z" transform="translate(246.307 .256)" opacity=".5"/><path fill="currentColor" d="M130.667-84.844H3.575l54.618-168.098c2.811-8.649 15.047-8.649 17.856 0l54.618 168.098z" transform="translate(336.974 280.256)"/></svg> \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/application.c33a9706.js b/freetype/docs/reference/assets/javascripts/application.c33a9706.js
deleted file mode 100644
index 3da6d0ca..00000000
--- a/freetype/docs/reference/assets/javascripts/application.c33a9706.js
+++ /dev/null
@@ -1,60 +0,0 @@
-!function(e,t){for(var n in t)e[n]=t[n]}(window,function(n){var r={};function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=n,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=13)}([function(e,t,n){"use strict";var r={Listener:function(){function e(e,t,n){var r=this;this.els_=Array.prototype.slice.call("string"==typeof e?document.querySelectorAll(e):[].concat(e)),this.handler_="function"==typeof n?{update:n}:n,this.events_=[].concat(t),this.update_=function(e){return r.handler_.update(e)}}var t=e.prototype;return t.listen=function(){var n=this;this.els_.forEach(function(t){n.events_.forEach(function(e){t.addEventListener(e,n.update_,!1)})}),"function"==typeof this.handler_.setup&&this.handler_.setup()},t.unlisten=function(){var n=this;this.els_.forEach(function(t){n.events_.forEach(function(e){t.removeEventListener(e,n.update_)})}),"function"==typeof this.handler_.reset&&this.handler_.reset()},e}(),MatchMedia:function(e,t){this.handler_=function(e){e.matches?t.listen():t.unlisten()};var n=window.matchMedia(e);n.addListener(this.handler_),this.handler_(n)}},i={Shadow:function(){function e(e,t){var n="string"==typeof e?document.querySelector(e):e;if(!(n instanceof HTMLElement&&n.parentNode instanceof HTMLElement))throw new ReferenceError;if(this.el_=n.parentNode,!((n="string"==typeof t?document.querySelector(t):t)instanceof HTMLElement))throw new ReferenceError;this.header_=n,this.height_=0,this.active_=!1}var t=e.prototype;return t.setup=function(){for(var e=this.el_;e=e.previousElementSibling;){if(!(e instanceof HTMLElement))throw new ReferenceError;this.height_+=e.offsetHeight}this.update()},t.update=function(e){if(!e||"resize"!==e.type&&"orientationchange"!==e.type){var t=window.pageYOffset>=this.height_;t!==this.active_&&(this.header_.dataset.mdState=(this.active_=t)?"shadow":"")}else this.height_=0,this.setup()},t.reset=function(){this.header_.dataset.mdState="",this.height_=0,this.active_=!1},e}(),Title:function(){function e(e,t){var n="string"==typeof e?document.querySelector(e):e;if(!(n instanceof HTMLElement))throw new ReferenceError;if(this.el_=n,!((n="string"==typeof t?document.querySelector(t):t)instanceof HTMLHeadingElement))throw new ReferenceError;this.header_=n,this.active_=!1}var t=e.prototype;return t.setup=function(){var t=this;Array.prototype.forEach.call(this.el_.children,function(e){e.style.width=t.el_.offsetWidth-20+"px"})},t.update=function(e){var t=this,n=window.pageYOffset>=this.header_.offsetTop;n!==this.active_&&(this.el_.dataset.mdState=(this.active_=n)?"active":""),"resize"!==e.type&&"orientationchange"!==e.type||Array.prototype.forEach.call(this.el_.children,function(e){e.style.width=t.el_.offsetWidth-20+"px"})},t.reset=function(){this.el_.dataset.mdState="",this.el_.style.width="",this.active_=!1},e}()},o={Blur:function(){function e(e){this.els_="string"==typeof e?document.querySelectorAll(e):e,this.index_=0,this.offset_=window.pageYOffset,this.dir_=!1,this.anchors_=[].reduce.call(this.els_,function(e,t){var n=decodeURIComponent(t.hash);return e.concat(document.getElementById(n.substring(1))||[])},[])}var t=e.prototype;return t.setup=function(){this.update()},t.update=function(){var e=window.pageYOffset,t=this.offset_-e<0;if(this.dir_!==t&&(this.index_=this.index_=t?0:this.els_.length-1),0!==this.anchors_.length){if(this.offset_<=e)for(var n=this.index_+1;n<this.els_.length&&this.anchors_[n].offsetTop-80<=e;n++)0<n&&(this.els_[n-1].dataset.mdState="blur"),this.index_=n;else for(var r=this.index_;0<=r;r--){if(!(this.anchors_[r].offsetTop-80>e)){this.index_=r;break}0<r&&(this.els_[r-1].dataset.mdState="")}this.offset_=e,this.dir_=t}},t.reset=function(){Array.prototype.forEach.call(this.els_,function(e){e.dataset.mdState=""}),this.index_=0,this.offset_=window.pageYOffset},e}(),Collapse:function(){function e(e){var t="string"==typeof e?document.querySelector(e):e;if(!(t instanceof HTMLElement))throw new ReferenceError;this.el_=t}var t=e.prototype;return t.setup=function(){var e=this.el_.getBoundingClientRect().height;this.el_.style.display=e?"block":"none",this.el_.style.overflow=e?"visible":"hidden"},t.update=function(){var e=this,t=this.el_.getBoundingClientRect().height;this.el_.style.display="block",this.el_.style.overflow="";var r=this.el_.previousElementSibling.previousElementSibling.checked;if(r)this.el_.style.maxHeight=t+"px",requestAnimationFrame(function(){e.el_.setAttribute("data-md-state","animate"),e.el_.style.maxHeight="0px"});else{this.el_.setAttribute("data-md-state","expand"),this.el_.style.maxHeight="";var n=this.el_.getBoundingClientRect().height;this.el_.removeAttribute("data-md-state"),this.el_.style.maxHeight="0px",requestAnimationFrame(function(){e.el_.setAttribute("data-md-state","animate"),e.el_.style.maxHeight=n+"px"})}this.el_.addEventListener("transitionend",function e(t){var n=t.target;if(!(n instanceof HTMLElement))throw new ReferenceError;n.removeAttribute("data-md-state"),n.style.maxHeight="",n.style.display=r?"none":"block",n.style.overflow=r?"hidden":"visible",n.removeEventListener("transitionend",e)},!1)},t.reset=function(){this.el_.dataset.mdState="",this.el_.style.maxHeight="",this.el_.style.display="",this.el_.style.overflow=""},e}(),Scrolling:function(){function e(e){var t="string"==typeof e?document.querySelector(e):e;if(!(t instanceof HTMLElement))throw new ReferenceError;this.el_=t}var t=e.prototype;return t.setup=function(){this.el_.children[this.el_.children.length-1].style.webkitOverflowScrolling="touch";var e=this.el_.querySelectorAll("[data-md-toggle]");Array.prototype.forEach.call(e,function(e){if(!(e instanceof HTMLInputElement))throw new ReferenceError;if(e.checked){var t=e.nextElementSibling;if(!(t instanceof HTMLElement))throw new ReferenceError;for(;"NAV"!==t.tagName&&t.nextElementSibling;)t=t.nextElementSibling;if(!(e.parentNode instanceof HTMLElement&&e.parentNode.parentNode instanceof HTMLElement))throw new ReferenceError;var n=e.parentNode.parentNode,r=t.children[t.children.length-1];n.style.webkitOverflowScrolling="",r.style.webkitOverflowScrolling="touch"}})},t.update=function(e){var t=e.target;if(!(t instanceof HTMLElement))throw new ReferenceError;var n=t.nextElementSibling;if(!(n instanceof HTMLElement))throw new ReferenceError;for(;"NAV"!==n.tagName&&n.nextElementSibling;)n=n.nextElementSibling;if(!(t.parentNode instanceof HTMLElement&&t.parentNode.parentNode instanceof HTMLElement))throw new ReferenceError;var r=t.parentNode.parentNode,i=n.children[n.children.length-1];if(r.style.webkitOverflowScrolling="",i.style.webkitOverflowScrolling="",!t.checked){n.addEventListener("transitionend",function e(){n instanceof HTMLElement&&(r.style.webkitOverflowScrolling="touch",n.removeEventListener("transitionend",e))},!1)}if(t.checked){n.addEventListener("transitionend",function e(){n instanceof HTMLElement&&(i.style.webkitOverflowScrolling="touch",n.removeEventListener("transitionend",e))},!1)}},t.reset=function(){this.el_.children[1].style.webkitOverflowScrolling="";var e=this.el_.querySelectorAll("[data-md-toggle]");Array.prototype.forEach.call(e,function(e){if(!(e instanceof HTMLInputElement))throw new ReferenceError;if(e.checked){var t=e.nextElementSibling;if(!(t instanceof HTMLElement))throw new ReferenceError;for(;"NAV"!==t.tagName&&t.nextElementSibling;)t=t.nextElementSibling;if(!(e.parentNode instanceof HTMLElement&&e.parentNode.parentNode instanceof HTMLElement))throw new ReferenceError;var n=e.parentNode.parentNode,r=t.children[t.children.length-1];n.style.webkitOverflowScrolling="",r.style.webkitOverflowScrolling=""}})},e}()},a={Lock:function(){function e(e){var t="string"==typeof e?document.querySelector(e):e;if(!(t instanceof HTMLInputElement))throw new ReferenceError;if(this.el_=t,!document.body)throw new ReferenceError;this.lock_=document.body}var t=e.prototype;return t.setup=function(){this.update()},t.update=function(){var e=this;this.el_.checked?(this.offset_=window.pageYOffset,setTimeout(function(){window.scrollTo(0,0),e.el_.checked&&(e.lock_.dataset.mdState="lock")},400)):(this.lock_.dataset.mdState="",setTimeout(function(){void 0!==e.offset_&&window.scrollTo(0,e.offset_)},100))},t.reset=function(){"lock"===this.lock_.dataset.mdState&&window.scrollTo(0,this.offset_),this.lock_.dataset.mdState=""},e}(),Result:n(9).a},s={Position:function(){function e(e,t){var n="string"==typeof e?document.querySelector(e):e;if(!(n instanceof HTMLElement&&n.parentNode instanceof HTMLElement))throw new ReferenceError;if(this.el_=n,this.parent_=n.parentNode,!((n="string"==typeof t?document.querySelector(t):t)instanceof HTMLElement))throw new ReferenceError;this.header_=n,this.height_=0,this.pad_="fixed"===window.getComputedStyle(this.header_).position}var t=e.prototype;return t.setup=function(){var e=Array.prototype.reduce.call(this.parent_.children,function(e,t){return Math.max(e,t.offsetTop)},0);this.offset_=e-(this.pad_?this.header_.offsetHeight:0),this.update()},t.update=function(e){var t=window.pageYOffset,n=window.innerHeight;e&&"resize"===e.type&&this.setup();var r=this.pad_?this.header_.offsetHeight:0,i=this.parent_.offsetTop+this.parent_.offsetHeight,o=n-r-Math.max(0,this.offset_-t)-Math.max(0,t+n-i);o!==this.height_&&(this.el_.style.height=(this.height_=o)+"px"),t>=this.offset_?"lock"!==this.el_.dataset.mdState&&(this.el_.dataset.mdState="lock"):"lock"===this.el_.dataset.mdState&&(this.el_.dataset.mdState="")},t.reset=function(){this.el_.dataset.mdState="",this.el_.style.height="",this.height_=0},e}()},c=n(6),l=n.n(c);var u={Adapter:{GitHub:function(o){var e,t;function n(e){var t;t=o.call(this,e)||this;var n=/^.+github\.com\/([^/]+)\/?([^/]+)?.*$/.exec(t.base_);if(n&&3===n.length){var r=n[1],i=n[2];t.base_="https://api.github.com/users/"+r+"/repos",t.name_=i}return t}return t=o,(e=n).prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t,n.prototype.fetch_=function(){var i=this;return function n(r){return void 0===r&&(r=0),fetch(i.base_+"?per_page=100&sort=updated&page="+r).then(function(e){return e.json()}).then(function(e){if(!(e instanceof Array))return[];if(i.name_){var t=e.find(function(e){return e.name===i.name_});return t||30!==e.length?t?[i.format_(t.stargazers_count)+" Stars",i.format_(t.forks_count)+" Forks"]:[]:n(r+1)}return[e.length+" Repositories"]})}()},n}(function(){function e(e){var t="string"==typeof e?document.querySelector(e):e;if(!(t instanceof HTMLAnchorElement))throw new ReferenceError;this.el_=t,this.base_=this.el_.href,this.salt_=this.hash_(this.base_)}var t=e.prototype;return t.fetch=function(){var n=this;return new Promise(function(t){var e=l.a.getJSON(n.salt_+".cache-source");void 0!==e?t(e):n.fetch_().then(function(e){l.a.set(n.salt_+".cache-source",e,{expires:1/96}),t(e)})})},t.fetch_=function(){throw new Error("fetch_(): Not implemented")},t.format_=function(e){return 1e4<e?(e/1e3).toFixed(0)+"k":1e3<e?(e/1e3).toFixed(1)+"k":""+e},t.hash_=function(e){var t=0;if(0===e.length)return t;for(var n=0,r=e.length;n<r;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t},e}())},Repository:n(10).a},f={Toggle:function(){function e(e){var t="string"==typeof e?document.querySelector(e):e;if(!(t instanceof Node))throw new ReferenceError;this.el_=t;var n=document.querySelector("[data-md-component=header]");this.height_=n.offsetHeight,this.active_=!1}var t=e.prototype;return t.update=function(){var e=window.pageYOffset>=this.el_.children[0].offsetTop+(5-this.height_);e!==this.active_&&(this.el_.dataset.mdState=(this.active_=e)?"hidden":"")},t.reset=function(){this.el_.dataset.mdState="",this.active_=!1},e}()};t.a={Event:r,Header:i,Nav:o,Search:a,Sidebar:s,Source:u,Tabs:f}},function(t,e,n){(function(e){t.exports=e.lunr=n(24)}).call(this,n(4))},function(e,d,h){"use strict";(function(t){var e=h(8),n=setTimeout;function c(e){return Boolean(e&&void 0!==e.length)}function r(){}function o(e){if(!(this instanceof o))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],f(e,this)}function i(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,o._immediateFn(function(){var e=1===n._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(n._value)}catch(e){return void s(r.promise,e)}a(r.promise,t)}else(1===n._state?a:s)(r.promise,n._value)})):n._deferreds.push(r)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof o)return t._state=3,t._value=e,void l(t);if("function"==typeof n)return void f((r=n,i=e,function(){r.apply(i,arguments)}),t)}t._state=1,t._value=e,l(t)}catch(e){s(t,e)}var r,i}function s(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null}function u(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function f(e,t){var n=!1;try{e(function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,s(t,e))})}catch(e){if(n)return;n=!0,s(t,e)}}o.prototype.catch=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var n=new this.constructor(r);return i(this,new u(e,t,n)),n},o.prototype.finally=e.a,o.all=function(t){return new o(function(r,i){if(!c(t))return i(new TypeError("Promise.all accepts an array"));var o=Array.prototype.slice.call(t);if(0===o.length)return r([]);var a=o.length;function s(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){s(t,e)},i)}o[t]=e,0==--a&&r(o)}catch(e){i(e)}}for(var e=0;e<o.length;e++)s(e,o[e])})},o.resolve=function(t){return t&&"object"==typeof t&&t.constructor===o?t:new o(function(e){e(t)})},o.reject=function(n){return new o(function(e,t){t(n)})},o.race=function(i){return new o(function(e,t){if(!c(i))return t(new TypeError("Promise.race accepts an array"));for(var n=0,r=i.length;n<r;n++)o.resolve(i[n]).then(e,t)})},o._immediateFn="function"==typeof t&&function(e){t(e)}||function(e){n(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},d.a=o}).call(this,h(21).setImmediate)},function(e,t,n){"use strict";function r(e,t){var n=document.createElement(e);t&&Array.prototype.forEach.call(Object.keys(t),function(e){n.setAttribute(e,t[e])});for(var r=arguments.length,i=new Array(2<r?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return function t(e){Array.prototype.forEach.call(e,function(e){"string"==typeof e||"number"==typeof e?n.textContent+=e:Array.isArray(e)?t(e):void 0!==e.__html?n.innerHTML+=e.__html:e instanceof Node&&n.appendChild(e)})}(i),n}n.r(t),n.d(t,"createElement",function(){return r})},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){
-/*!
- * clipboard.js v2.0.4
- * https://zenorocha.github.io/clipboard.js
- *
- * Licensed MIT © Zeno Rocha
- */
-var r;r=function(){return function(n){var r={};function i(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=n,i.c=r,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),a=r(n(1)),s=r(n(3)),c=r(n(4));function r(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this));return n.resolveOptions(t),n.listenClick(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,s.default),o(r,[{key:"resolveOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===i(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=(0,c.default)(e,"click",function(e){return t.onClick(e)})}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return u("action",e)}},{key:"defaultTarget",value:function(e){var t=u("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return u("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach(function(e){n=n&&!!document.queryCommandSupported(e)}),n}}]),r}();function u(e,t){var n="data-clipboard-"+e;if(t.hasAttribute(n))return t.getAttribute(n)}e.exports=l},function(e,t,n){"use strict";var r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),a=n(2),s=(r=a)&&r.__esModule?r:{default:r};var c=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.resolveOptions(e),this.initSelection()}return o(t,[{key:"resolveOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,s.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,s.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var t=void 0;try{t=document.execCommand(this.action)}catch(e){t=!1}this.handleResult(t)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":i(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),t}();e.exports=c},function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),i=document.createRange();i.selectNodeContents(e),r.removeAllRanges(),r.addRange(i),t=r.toString()}return t}},function(e,t){function n(){}n.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function i(){r.off(e,i),t.apply(n,arguments)}return i._=t,this.on(e,i,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,i=n.length;r<i;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],i=[];if(r&&t)for(var o=0,a=r.length;o<a;o++)r[o].fn!==t&&r[o].fn._!==t&&i.push(r[o]);return i.length?n[e]=i:delete n[e],this}},e.exports=n},function(e,t,n){var d=n(5),h=n(6);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!d.string(t))throw new TypeError("Second argument must be a String");if(!d.fn(n))throw new TypeError("Third argument must be a Function");if(d.node(e))return u=t,f=n,(l=e).addEventListener(u,f),{destroy:function(){l.removeEventListener(u,f)}};if(d.nodeList(e))return a=e,s=t,c=n,Array.prototype.forEach.call(a,function(e){e.addEventListener(s,c)}),{destroy:function(){Array.prototype.forEach.call(a,function(e){e.removeEventListener(s,c)})}};if(d.string(e))return r=e,i=t,o=n,h(document.body,r,i,o);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var r,i,o,a,s,c,l,u,f}},function(e,n){n.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},n.nodeList=function(e){var t=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===t||"[object HTMLCollection]"===t)&&"length"in e&&(0===e.length||n.node(e[0]))},n.string=function(e){return"string"==typeof e||e instanceof String},n.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,n){var a=n(7);function o(e,t,n,r,i){var o=function(t,n,e,r){return function(e){e.delegateTarget=a(e.target,n),e.delegateTarget&&r.call(t,e)}}.apply(this,arguments);return e.addEventListener(n,o,i),{destroy:function(){e.removeEventListener(n,o,i)}}}e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,function(e){return o(e,t,n,r,i)}))}},function(e,t){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}}])},e.exports=r()},function(r,i,o){var a,s;
-/*!
- * JavaScript Cookie v2.2.1
- * https://github.com/js-cookie/js-cookie
- *
- * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
- * Released under the MIT license
- */!function(e){if(void 0===(s="function"==typeof(a=e)?a.call(i,o,i,r):a)||(r.exports=s),!0,r.exports=e(),!!0){var t=window.Cookies,n=window.Cookies=e();n.noConflict=function(){return window.Cookies=t,n}}}(function(){function s(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function l(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function e(c){function a(){}function n(e,t,n){if("undefined"!=typeof document){"number"==typeof(n=s({path:"/"},a.defaults,n)).expires&&(n.expires=new Date(1*new Date+864e5*n.expires)),n.expires=n.expires?n.expires.toUTCString():"";try{var r=JSON.stringify(t);/^[\{\[]/.test(r)&&(t=r)}catch(e){}t=c.write?c.write(t,e):encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var i="";for(var o in n)n[o]&&(i+="; "+o,!0!==n[o]&&(i+="="+n[o].split(";")[0]));return document.cookie=e+"="+t+i}}function t(e,t){if("undefined"!=typeof document){for(var n={},r=document.cookie?document.cookie.split("; "):[],i=0;i<r.length;i++){var o=r[i].split("="),a=o.slice(1).join("=");t||'"'!==a.charAt(0)||(a=a.slice(1,-1));try{var s=l(o[0]);if(a=(c.read||c)(a,s)||l(a),t)try{a=JSON.parse(a)}catch(e){}if(n[s]=a,e===s)break}catch(e){}}return e?n[e]:n}}return a.set=n,a.get=function(e){return t(e,!1)},a.getJSON=function(e){return t(e,!0)},a.remove=function(e,t){n(e,"",s(t,{expires:-1}))},a.defaults={},a.withConverter=e,a}(function(){})})},function(e,t,n){"use strict";n.r(t);var r="function"==typeof fetch?fetch.bind():function(i,o){return o=o||{},new Promise(function(e,t){var n=new XMLHttpRequest;for(var r in n.open(o.method||"get",i,!0),o.headers)n.setRequestHeader(r,o.headers[r]);function s(){var r,i=[],o=[],a={};return n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,t,n){i.push(t=t.toLowerCase()),o.push([t,n]),r=a[t],a[t]=r?r+","+n:n}),{ok:2==(n.status/100|0),status:n.status,statusText:n.statusText,url:n.responseURL,clone:s,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(n.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([n.response]))},headers:{keys:function(){return i},entries:function(){return o},get:function(e){return a[e.toLowerCase()]},has:function(e){return e.toLowerCase()in a}}}}n.withCredentials="include"==o.credentials,n.onload=function(){e(s())},n.onerror=t,n.send(o.body||null)})};t.default=r},function(e,t,n){"use strict";t.a=function(t){var n=this.constructor;return this.then(function(e){return n.resolve(t()).then(function(){return e})},function(e){return n.resolve(t()).then(function(){return n.reject(e)})})}},function(e,n,r){"use strict";(function(f){r.d(n,"a",function(){return t});var e=r(1),d=r.n(e),h=function(e){var t=document.getElementsByName("lang:"+e)[0];if(!(t instanceof HTMLMetaElement))throw new ReferenceError;return t.content},t=function(){function e(e,t){var n="string"==typeof e?document.querySelector(e):e;if(!(n instanceof HTMLElement))throw new ReferenceError;this.el_=n;var r=Array.prototype.slice.call(this.el_.children),i=r[0],o=r[1];this.data_=t,this.meta_=i,this.list_=o,this.message_={placeholder:this.meta_.textContent,none:h("search.result.none"),one:h("search.result.one"),other:h("search.result.other")};var a=h("search.tokenizer");a.length&&(d.a.tokenizer.separator=a),this.lang_=h("search.language").split(",").filter(Boolean).map(function(e){return e.trim()})}return e.prototype.update=function(e){var t,a=this;if("focus"!==e.type||this.index_){if("focus"===e.type||"keyup"===e.type){var n=e.target;if(!(n instanceof HTMLInputElement))throw new ReferenceError;if(!this.index_||n.value===this.value_)return;for(;this.list_.firstChild;)this.list_.removeChild(this.list_.firstChild);if(this.value_=n.value,0===this.value_.length)return void(this.meta_.textContent=this.message_.placeholder);var r=this.index_.query(function(t){a.value_.toLowerCase().split(" ").filter(Boolean).forEach(function(e){t.term(e,{wildcard:d.a.Query.wildcard.TRAILING})})}).reduce(function(e,t){var n=a.docs_.get(t.ref);if(n.parent){var r=n.parent.location;e.set(r,(e.get(r)||[]).concat(t))}else{var i=n.location;e.set(i,e.get(i)||[])}return e},new Map),i=(t=this.value_.trim(),t.replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")).replace(new RegExp(d.a.tokenizer.separator,"img"),"|"),s=new RegExp("(^|"+d.a.tokenizer.separator+")("+i+")","img"),c=function(e,t,n){return t+"<em>"+n+"</em>"};this.stack_=[],r.forEach(function(e,t){var n,r=a.docs_.get(t),i=f.createElement("li",{class:"md-search-result__item"},f.createElement("a",{href:r.location,title:r.title,class:"md-search-result__link",tabindex:"-1"},f.createElement("article",{class:"md-search-result__article md-search-result__article--document"},f.createElement("h1",{class:"md-search-result__title"},{__html:r.title.replace(s,c)}),r.text.length?f.createElement("p",{class:"md-search-result__teaser"},{__html:r.text.replace(s,c)}):{}))),o=e.map(function(t){return function(){var e=a.docs_.get(t.ref);i.appendChild(f.createElement("a",{href:e.location,title:e.title,class:"md-search-result__link","data-md-rel":"anchor",tabindex:"-1"},f.createElement("article",{class:"md-search-result__article"},f.createElement("h1",{class:"md-search-result__title"},{__html:e.title.replace(s,c)}),e.text.length?f.createElement("p",{class:"md-search-result__teaser"},{__html:function(e,t){var n=t;if(e.length>n){for(;" "!==e[n]&&0<--n;);return e.substring(0,n)+"..."}return e}(e.text.replace(s,c),400)}):{})))}});(n=a.stack_).push.apply(n,[function(){return a.list_.appendChild(i)}].concat(o))});var o=this.el_.parentNode;if(!(o instanceof HTMLElement))throw new ReferenceError;for(;this.stack_.length&&o.offsetHeight>=o.scrollHeight-16;)this.stack_.shift()();var l=this.list_.querySelectorAll("[data-md-rel=anchor]");switch(Array.prototype.forEach.call(l,function(r){["click","keydown"].forEach(function(n){r.addEventListener(n,function(e){if("keydown"!==n||13===e.keyCode){var t=document.querySelector("[data-md-toggle=search]");if(!(t instanceof HTMLInputElement))throw new ReferenceError;t.checked&&(t.checked=!1,t.dispatchEvent(new CustomEvent("change"))),e.preventDefault(),setTimeout(function(){document.location.href=r.href},100)}})})}),r.size){case 0:this.meta_.textContent=this.message_.none;break;case 1:this.meta_.textContent=this.message_.one;break;default:this.meta_.textContent=this.message_.other.replace("#",r.size)}}}else{var u=function(e){a.docs_=e.reduce(function(e,t){var n,r,i,o=t.location.split("#"),a=o[0],s=o[1];return t.text=(n=t.text,r=document.createTextNode(n),(i=document.createElement("p")).appendChild(r),i.innerHTML),s&&(t.parent=e.get(a),t.parent&&!t.parent.done&&(t.parent.title=t.title,t.parent.text=t.text,t.parent.done=!0)),t.text=t.text.replace(/\n/g," ").replace(/\s+/g," ").replace(/\s+([,.:;!?])/g,function(e,t){return t}),t.parent&&t.parent.title===t.title||e.set(t.location,t),e},new Map);var i=a.docs_,o=a.lang_;a.stack_=[],a.index_=d()(function(){var e,t=this,n={"search.pipeline.trimmer":d.a.trimmer,"search.pipeline.stopwords":d.a.stopWordFilter},r=Object.keys(n).reduce(function(e,t){return h(t).match(/^false$/i)||e.push(n[t]),e},[]);this.pipeline.reset(),r&&(e=this.pipeline).add.apply(e,r),1===o.length&&"en"!==o[0]&&d.a[o[0]]?this.use(d.a[o[0]]):1<o.length&&this.use(d.a.multiLanguage.apply(d.a,o)),this.field("title",{boost:10}),this.field("text"),this.ref("location"),i.forEach(function(e){return t.add(e)})});var t=a.el_.parentNode;if(!(t instanceof HTMLElement))throw new ReferenceError;t.addEventListener("scroll",function(){for(;a.stack_.length&&t.scrollTop+t.offsetHeight>=t.scrollHeight-16;)a.stack_.splice(0,10).forEach(function(e){return e()})})};setTimeout(function(){return"function"==typeof a.data_?a.data_().then(u):u(a.data_)},250)}},e}()}).call(this,r(3))},function(e,n,r){"use strict";(function(t){r.d(n,"a",function(){return e});var e=function(){function e(e){var t="string"==typeof e?document.querySelector(e):e;if(!(t instanceof HTMLElement))throw new ReferenceError;this.el_=t}return e.prototype.initialize=function(e){e.length&&this.el_.children.length&&this.el_.children[this.el_.children.length-1].appendChild(t.createElement("ul",{class:"md-source__facts"},e.map(function(e){return t.createElement("li",{class:"md-source__fact"},e)}))),this.el_.dataset.mdState="done"},e}()}).call(this,r(3))},,,function(e,n,c){"use strict";c.r(n),function(o){c.d(n,"app",function(){return t});c(14),c(15),c(16),c(17),c(18),c(19),c(20);var r=c(2),e=c(5),a=c.n(e),i=c(0);window.Promise=window.Promise||r.a;var s=function(e){var t=document.getElementsByName("lang:"+e)[0];if(!(t instanceof HTMLMetaElement))throw new ReferenceError;return t.content};var t={initialize:function(t){new i.a.Event.Listener(document,"DOMContentLoaded",function(){if(!(document.body instanceof HTMLElement))throw new ReferenceError;Modernizr.addTest("ios",function(){return!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)});var e=document.querySelectorAll("table:not([class])");if(Array.prototype.forEach.call(e,function(e){var t=o.createElement("div",{class:"md-typeset__scrollwrap"},o.createElement("div",{class:"md-typeset__table"}));e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t.children[0].appendChild(e)}),a.a.isSupported()){var t=document.querySelectorAll("pre > code");Array.prototype.forEach.call(t,function(e,t){var n="__code_"+t,r=o.createElement("button",{class:"md-clipboard",title:s("clipboard.copy"),"data-clipboard-target":"#"+n+" pre, #"+n+" code"},o.createElement("span",{class:"md-clipboard__message"})),i=e.parentNode;i.id=n,i.insertBefore(r,e)}),new a.a(".md-clipboard").on("success",function(e){var t=e.trigger.querySelector(".md-clipboard__message");if(!(t instanceof HTMLElement))throw new ReferenceError;e.clearSelection(),t.dataset.mdTimer&&clearTimeout(parseInt(t.dataset.mdTimer,10)),t.classList.add("md-clipboard__message--active"),t.innerHTML=s("clipboard.copied"),t.dataset.mdTimer=setTimeout(function(){t.classList.remove("md-clipboard__message--active"),t.dataset.mdTimer=""},2e3).toString()})}if(!Modernizr.details){var n=document.querySelectorAll("details > summary");Array.prototype.forEach.call(n,function(e){e.addEventListener("click",function(e){var t=e.target.parentNode;t.hasAttribute("open")?t.removeAttribute("open"):t.setAttribute("open","")})})}var r=function(){if(document.location.hash){var e=document.getElementById(document.location.hash.substring(1));if(!e)return;for(var t=e.parentNode;t&&!(t instanceof HTMLDetailsElement);)t=t.parentNode;if(t&&!t.open){t.open=!0;var n=location.hash;location.hash=" ",location.hash=n}}};if(window.addEventListener("hashchange",r),r(),Modernizr.ios){var i=document.querySelectorAll("[data-md-scrollfix]");Array.prototype.forEach.call(i,function(t){t.addEventListener("touchstart",function(){var e=t.scrollTop;0===e?t.scrollTop=1:e+t.offsetHeight===t.scrollHeight&&(t.scrollTop=e-1)})})}}).listen(),new i.a.Event.Listener(window,["scroll","resize","orientationchange"],new i.a.Header.Shadow("[data-md-component=container]","[data-md-component=header]")).listen(),new i.a.Event.Listener(window,["scroll","resize","orientationchange"],new i.a.Header.Title("[data-md-component=title]",".md-typeset h1")).listen(),document.querySelector("[data-md-component=hero]")&&new i.a.Event.Listener(window,["scroll","resize","orientationchange"],new i.a.Tabs.Toggle("[data-md-component=hero]")).listen(),document.querySelector("[data-md-component=tabs]")&&new i.a.Event.Listener(window,["scroll","resize","orientationchange"],new i.a.Tabs.Toggle("[data-md-component=tabs]")).listen(),new i.a.Event.MatchMedia("(min-width: 1220px)",new i.a.Event.Listener(window,["scroll","resize","orientationchange"],new i.a.Sidebar.Position("[data-md-component=navigation]","[data-md-component=header]"))),document.querySelector("[data-md-component=toc]")&&new i.a.Event.MatchMedia("(min-width: 960px)",new i.a.Event.Listener(window,["scroll","resize","orientationchange"],new i.a.Sidebar.Position("[data-md-component=toc]","[data-md-component=header]"))),new i.a.Event.MatchMedia("(min-width: 960px)",new i.a.Event.Listener(window,"scroll",new i.a.Nav.Blur("[data-md-component=toc] .md-nav__link")));var e=document.querySelectorAll("[data-md-component=collapsible]");Array.prototype.forEach.call(e,function(e){new i.a.Event.MatchMedia("(min-width: 1220px)",new i.a.Event.Listener(e.previousElementSibling,"click",new i.a.Nav.Collapse(e)))}),new i.a.Event.MatchMedia("(max-width: 1219px)",new i.a.Event.Listener("[data-md-component=navigation] [data-md-toggle]","change",new i.a.Nav.Scrolling("[data-md-component=navigation] nav"))),document.querySelector("[data-md-component=search]")&&(new i.a.Event.MatchMedia("(max-width: 959px)",new i.a.Event.Listener("[data-md-toggle=search]","change",new i.a.Search.Lock("[data-md-toggle=search]"))),new i.a.Event.Listener("[data-md-component=query]",["focus","keyup","change"],new i.a.Search.Result("[data-md-component=result]",function(){return fetch(t.url.base+"/search/search_index.json",{credentials:"same-origin"}).then(function(e){return e.json()}).then(function(e){return e.docs.map(function(e){return e.location=t.url.base+"/"+e.location,e})})})).listen(),new i.a.Event.Listener("[data-md-component=reset]","click",function(){setTimeout(function(){var e=document.querySelector("[data-md-component=query]");if(!(e instanceof HTMLInputElement))throw new ReferenceError;e.focus()},10)}).listen(),new i.a.Event.Listener("[data-md-toggle=search]","change",function(e){setTimeout(function(e){if(!(e instanceof HTMLInputElement))throw new ReferenceError;if(e.checked){var t=document.querySelector("[data-md-component=query]");if(!(t instanceof HTMLInputElement))throw new ReferenceError;t.focus()}},400,e.target)}).listen(),new i.a.Event.Listener("[data-md-component=query]","focus",function(){var e=document.querySelector("[data-md-toggle=search]");if(!(e instanceof HTMLInputElement))throw new ReferenceError;e.checked||(e.checked=!0,e.dispatchEvent(new CustomEvent("change")))}).listen(),new i.a.Event.Listener(window,"keydown",function(e){var t=document.querySelector("[data-md-toggle=search]");if(!(t instanceof HTMLInputElement))throw new ReferenceError;var n=document.querySelector("[data-md-component=query]");if(!(n instanceof HTMLInputElement))throw new ReferenceError;if(!(document.activeElement instanceof HTMLElement&&document.activeElement.isContentEditable||e.metaKey||e.ctrlKey))if(t.checked){if(13===e.keyCode){if(n===document.activeElement){e.preventDefault();var r=document.querySelector("[data-md-component=search] [href][data-md-state=active]");r instanceof HTMLLinkElement&&(window.location=r.getAttribute("href"),t.checked=!1,t.dispatchEvent(new CustomEvent("change")),n.blur())}}else if(9===e.keyCode||27===e.keyCode)t.checked=!1,t.dispatchEvent(new CustomEvent("change")),n.blur();else if(-1!==[8,37,39].indexOf(e.keyCode))n!==document.activeElement&&n.focus();else if(-1!==[38,40].indexOf(e.keyCode)){var i=e.keyCode,o=Array.prototype.slice.call(document.querySelectorAll("[data-md-component=query], [data-md-component=search] [href]")),a=o.find(function(e){if(!(e instanceof HTMLElement))throw new ReferenceError;return"active"===e.dataset.mdState});a&&(a.dataset.mdState="");var s=Math.max(0,(o.indexOf(a)+o.length+(38===i?-1:1))%o.length);return o[s]&&(o[s].dataset.mdState="active",o[s].focus()),e.preventDefault(),e.stopPropagation(),!1}}else if(document.activeElement&&!document.activeElement.form){if("TEXTAREA"===document.activeElement.tagName||"INPUT"===document.activeElement.tagName)return;70!==e.keyCode&&83!==e.keyCode||(n.focus(),e.preventDefault())}}).listen(),new i.a.Event.Listener(window,"keypress",function(){var e=document.querySelector("[data-md-toggle=search]");if(!(e instanceof HTMLInputElement))throw new ReferenceError;if(e.checked){var t=document.querySelector("[data-md-component=query]");if(!(t instanceof HTMLInputElement))throw new ReferenceError;t!==document.activeElement&&t.focus()}}).listen()),new i.a.Event.Listener(document.body,"keydown",function(e){if(9===e.keyCode){var t=document.querySelectorAll("[data-md-component=navigation] .md-nav__link[for]:not([tabindex])");Array.prototype.forEach.call(t,function(e){e.offsetHeight&&(e.tabIndex=0)})}}).listen(),new i.a.Event.Listener(document.body,"mousedown",function(){var e=document.querySelectorAll("[data-md-component=navigation] .md-nav__link[tabindex]");Array.prototype.forEach.call(e,function(e){e.removeAttribute("tabIndex")})}).listen(),document.body.addEventListener("click",function(){"tabbing"===document.body.dataset.mdState&&(document.body.dataset.mdState="")}),new i.a.Event.MatchMedia("(max-width: 959px)",new i.a.Event.Listener("[data-md-component=navigation] [href^='#']","click",function(){var e=document.querySelector("[data-md-toggle=drawer]");if(!(e instanceof HTMLInputElement))throw new ReferenceError;e.checked&&(e.checked=!1,e.dispatchEvent(new CustomEvent("change")))})),function(){var e=document.querySelector("[data-md-source]");if(!e)return r.a.resolve([]);if(!(e instanceof HTMLAnchorElement))throw new ReferenceError;switch(e.dataset.mdSource){case"github":return new i.a.Source.Adapter.GitHub(e).fetch();default:return r.a.resolve([])}}().then(function(t){var e=document.querySelectorAll("[data-md-source]");Array.prototype.forEach.call(e,function(e){new i.a.Source.Repository(e).initialize(t)})});var n=function(){var e=document.querySelectorAll("details");Array.prototype.forEach.call(e,function(e){e.setAttribute("open","")})};new i.a.Event.MatchMedia("print",{listen:n,unlisten:function(){}}),window.onbeforeprint=n}}}.call(this,c(3))},function(e,t,n){"use strict";n.p},function(e,t,n){"use strict";n.p},function(e,t,n){"use strict";n.p},function(e,t,n){"use strict"},function(e,t,n){"use strict"},function(e,t){!function(){if("undefined"!=typeof window)try{var e=new window.CustomEvent("test",{cancelable:!0});if(e.preventDefault(),!0!==e.defaultPrevented)throw new Error("Could not prevent default")}catch(e){var t=function(e,t){var n,r;return(t=t||{}).bubbles=!!t.bubbles,t.cancelable=!!t.cancelable,(n=document.createEvent("CustomEvent")).initCustomEvent(e,t.bubbles,t.cancelable,t.detail),r=n.preventDefault,n.preventDefault=function(){r.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(e){this.defaultPrevented=!0}},n};t.prototype=window.Event.prototype,window.CustomEvent=t}}()},function(e,t,n){window.fetch||(window.fetch=n(7).default||n(7))},function(e,i,o){(function(e){var t=void 0!==e&&e||"undefined"!=typeof self&&self||window,n=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}i.setTimeout=function(){return new r(n.call(setTimeout,t,arguments),clearTimeout)},i.setInterval=function(){return new r(n.call(setInterval,t,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(t,this._id)},i.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},i.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},i._unrefActive=i.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},o(22),i.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,i.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,o(4))},function(e,t,n){(function(e,p){!function(n,r){"use strict";if(!n.setImmediate){var i,o,t,a,e,s=1,c={},l=!1,u=n.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(n);f=f&&f.setTimeout?f:n,i="[object process]"==={}.toString.call(n.process)?function(e){p.nextTick(function(){h(e)})}:function(){if(n.postMessage&&!n.importScripts){var e=!0,t=n.onmessage;return n.onmessage=function(){e=!1},n.postMessage("","*"),n.onmessage=t,e}}()?(a="setImmediate$"+Math.random()+"$",e=function(e){e.source===n&&"string"==typeof e.data&&0===e.data.indexOf(a)&&h(+e.data.slice(a.length))},n.addEventListener?n.addEventListener("message",e,!1):n.attachEvent("onmessage",e),function(e){n.postMessage(a+e,"*")}):n.MessageChannel?((t=new MessageChannel).port1.onmessage=function(e){h(e.data)},function(e){t.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(o=u.documentElement,function(e){var t=u.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):function(e){setTimeout(h,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return c[s]=r,i(s),s++},f.clearImmediate=d}function d(e){delete c[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(4),n(23))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var c,l=[],u=!1,f=-1;function d(){u&&c&&(u=!1,c.length?l=c.concat(l):f=-1,l.length&&h())}function h(){if(!u){var e=s(d);u=!0;for(var t=l.length;t;){for(c=l,l=[];++f<t;)c&&c[f].run();f=-1,t=l.length}c=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new p(e,t)),1!==l.length||u||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(i,o,a){var s,c;!function(){var t,l,u,e,n,f,d,h,p,m,y,v,g,w,_,E,x,b,k,S,T,L,R,O,C,r,D=function(e){var t=new D.Builder;return t.pipeline.add(D.trimmer,D.stopWordFilter,D.stemmer),t.searchPipeline.add(D.stemmer),e.call(t,t),t.build()};D.version="2.3.8"
-/*!
- * lunr.utils
- * Copyright (C) 2019 Oliver Nightingale
- */,D.utils={},D.utils.warn=(t=this,function(e){t.console&&console.warn&&console.warn(e)}),D.utils.asString=function(e){return null==e?"":e.toString()},D.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],o=e[i];if(Array.isArray(o))t[i]=o.slice();else{if("string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o)throw new TypeError("clone is not deep and does not support nested objects");t[i]=o}}return t},D.FieldRef=function(e,t,n){this.docRef=e,this.fieldName=t,this._stringValue=n},D.FieldRef.joiner="/",D.FieldRef.fromString=function(e){var t=e.indexOf(D.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var n=e.slice(0,t),r=e.slice(t+1);return new D.FieldRef(r,n,e)},D.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+D.FieldRef.joiner+this.docRef),this._stringValue}
-/*!
- * lunr.Set
- * Copyright (C) 2019 Oliver Nightingale
- */,D.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},D.Set.complete={intersect:function(e){return e},union:function(e){return e},contains:function(){return!0}},D.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},D.Set.prototype.contains=function(e){return!!this.elements[e]},D.Set.prototype.intersect=function(e){var t,n,r,i=[];if(e===D.Set.complete)return this;if(e===D.Set.empty)return e;n=this.length<e.length?(t=this,e):(t=e,this),r=Object.keys(t.elements);for(var o=0;o<r.length;o++){var a=r[o];a in n.elements&&i.push(a)}return new D.Set(i)},D.Set.prototype.union=function(e){return e===D.Set.complete?D.Set.complete:e===D.Set.empty?this:new D.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},D.idf=function(e,t){var n=0;for(var r in e)"_index"!=r&&(n+=Object.keys(e[r]).length);var i=(t-n+.5)/(n+.5);return Math.log(1+Math.abs(i))},D.Token=function(e,t){this.str=e||"",this.metadata=t||{}},D.Token.prototype.toString=function(){return this.str},D.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},D.Token.prototype.clone=function(e){return e=e||function(e){return e},new D.Token(e(this.str,this.metadata),this.metadata)}
-/*!
- * lunr.tokenizer
- * Copyright (C) 2019 Oliver Nightingale
- */,D.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return new D.Token(D.utils.asString(e).toLowerCase(),D.utils.clone(t))});for(var n=e.toString().toLowerCase(),r=n.length,i=[],o=0,a=0;o<=r;o++){var s=o-a;if(n.charAt(o).match(D.tokenizer.separator)||o==r){if(0<s){var c=D.utils.clone(t)||{};c.position=[a,s],c.index=i.length,i.push(new D.Token(n.slice(a,o),c))}a=o+1}}return i},D.tokenizer.separator=/[\s\-]+/
-/*!
- * lunr.Pipeline
- * Copyright (C) 2019 Oliver Nightingale
- */,D.Pipeline=function(){this._stack=[]},D.Pipeline.registeredFunctions=Object.create(null),D.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&D.utils.warn("Overwriting existing registered function: "+t),e.label=t,D.Pipeline.registeredFunctions[e.label]=e},D.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||D.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},D.Pipeline.load=function(e){var n=new D.Pipeline;return e.forEach(function(e){var t=D.Pipeline.registeredFunctions[e];if(!t)throw new Error("Cannot load unregistered function: "+e);n.add(t)}),n},D.Pipeline.prototype.add=function(){Array.prototype.slice.call(arguments).forEach(function(e){D.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},D.Pipeline.prototype.after=function(e,t){D.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");n+=1,this._stack.splice(n,0,t)},D.Pipeline.prototype.before=function(e,t){D.Pipeline.warnIfFunctionNotRegistered(t);var n=this._stack.indexOf(e);if(-1==n)throw new Error("Cannot find existingFn");this._stack.splice(n,0,t)},D.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},D.Pipeline.prototype.run=function(e){for(var t=this._stack.length,n=0;n<t;n++){for(var r=this._stack[n],i=[],o=0;o<e.length;o++){var a=r(e[o],o,e);if(null!=a&&""!==a)if(Array.isArray(a))for(var s=0;s<a.length;s++)i.push(a[s]);else i.push(a)}e=i}return e},D.Pipeline.prototype.runString=function(e,t){var n=new D.Token(e,t);return this.run([n]).map(function(e){return e.toString()})},D.Pipeline.prototype.reset=function(){this._stack=[]},D.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return D.Pipeline.warnIfFunctionNotRegistered(e),e.label})}
-/*!
- * lunr.Vector
- * Copyright (C) 2019 Oliver Nightingale
- */,D.Vector=function(e){this._magnitude=0,this.elements=e||[]},D.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,n=this.elements.length/2,r=n-t,i=Math.floor(r/2),o=this.elements[2*i];1<r&&(o<e&&(t=i),e<o&&(n=i),o!=e);)r=n-t,i=t+Math.floor(r/2),o=this.elements[2*i];return o==e?2*i:e<o?2*i:o<e?2*(i+1):void 0},D.Vector.prototype.insert=function(e,t){this.upsert(e,t,function(){throw"duplicate index"})},D.Vector.prototype.upsert=function(e,t,n){this._magnitude=0;var r=this.positionForIndex(e);this.elements[r]==e?this.elements[r+1]=n(this.elements[r+1],t):this.elements.splice(r,0,e,t)},D.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,n=1;n<t;n+=2){var r=this.elements[n];e+=r*r}return this._magnitude=Math.sqrt(e)},D.Vector.prototype.dot=function(e){for(var t=0,n=this.elements,r=e.elements,i=n.length,o=r.length,a=0,s=0,c=0,l=0;c<i&&l<o;)(a=n[c])<(s=r[l])?c+=2:s<a?l+=2:a==s&&(t+=n[c+1]*r[l+1],c+=2,l+=2);return t},D.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},D.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,n=0;t<this.elements.length;t+=2,n++)e[n]=this.elements[t];return e},D.Vector.prototype.toJSON=function(){return this.elements}
-/*!
- * lunr.stemmer
- * Copyright (C) 2019 Oliver Nightingale
- * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
- */,D.stemmer=(l={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},u={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},e="[aeiouy]",n="[^aeiou][^aeiouy]*",f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),p=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),m=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,w=/.$/,_=/(at|bl|iz)$/,E=new RegExp("([^aeiouylsz])\\1$"),x=new RegExp("^"+n+e+"[^aeiouwxy]$"),b=/^(.+?[^aeiou])y$/,k=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,S=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,T=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,L=/^(.+?)(s|t)(ion)$/,R=/^(.+?)e$/,O=/ll$/,C=new RegExp("^"+n+e+"[^aeiouwxy]$"),r=function(e){var t,n,r,i,o,a,s;if(e.length<3)return e;if("y"==(r=e.substr(0,1))&&(e=r.toUpperCase()+e.substr(1)),o=y,(i=m).test(e)?e=e.replace(i,"$1$2"):o.test(e)&&(e=e.replace(o,"$1$2")),o=g,(i=v).test(e)){var c=i.exec(e);(i=f).test(c[1])&&(i=w,e=e.replace(i,""))}else if(o.test(e)){t=(c=o.exec(e))[1],(o=p).test(t)&&(a=E,s=x,(o=_).test(e=t)?e+="e":a.test(e)?(i=w,e=e.replace(i,"")):s.test(e)&&(e+="e"))}(i=b).test(e)&&(e=(t=(c=i.exec(e))[1])+"i");(i=k).test(e)&&(t=(c=i.exec(e))[1],n=c[2],(i=f).test(t)&&(e=t+l[n]));(i=S).test(e)&&(t=(c=i.exec(e))[1],n=c[2],(i=f).test(t)&&(e=t+u[n]));if(o=L,(i=T).test(e))t=(c=i.exec(e))[1],(i=d).test(t)&&(e=t);else if(o.test(e)){t=(c=o.exec(e))[1]+c[2],(o=d).test(t)&&(e=t)}(i=R).test(e)&&(t=(c=i.exec(e))[1],o=h,a=C,((i=d).test(t)||o.test(t)&&!a.test(t))&&(e=t));return o=d,(i=O).test(e)&&o.test(e)&&(i=w,e=e.replace(i,"")),"y"==r&&(e=r.toLowerCase()+e.substr(1)),e},function(e){return e.update(r)}),D.Pipeline.registerFunction(D.stemmer,"stemmer")
-/*!
- * lunr.stopWordFilter
- * Copyright (C) 2019 Oliver Nightingale
- */,D.generateStopWordFilter=function(e){var t=e.reduce(function(e,t){return e[t]=t,e},{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},D.stopWordFilter=D.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),D.Pipeline.registerFunction(D.stopWordFilter,"stopWordFilter")
-/*!
- * lunr.trimmer
- * Copyright (C) 2019 Oliver Nightingale
- */,D.trimmer=function(e){return e.update(function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")})},D.Pipeline.registerFunction(D.trimmer,"trimmer")
-/*!
- * lunr.TokenSet
- * Copyright (C) 2019 Oliver Nightingale
- */,D.TokenSet=function(){this.final=!1,this.edges={},this.id=D.TokenSet._nextId,D.TokenSet._nextId+=1},D.TokenSet._nextId=1,D.TokenSet.fromArray=function(e){for(var t=new D.TokenSet.Builder,n=0,r=e.length;n<r;n++)t.insert(e[n]);return t.finish(),t.root},D.TokenSet.fromClause=function(e){return"editDistance"in e?D.TokenSet.fromFuzzyString(e.term,e.editDistance):D.TokenSet.fromString(e.term)},D.TokenSet.fromFuzzyString=function(e,t){for(var n=new D.TokenSet,r=[{node:n,editsRemaining:t,str:e}];r.length;){var i=r.pop();if(0<i.str.length){var o,a=i.str.charAt(0);a in i.node.edges?o=i.node.edges[a]:(o=new D.TokenSet,i.node.edges[a]=o),1==i.str.length&&(o.final=!0),r.push({node:o,editsRemaining:i.editsRemaining,str:i.str.slice(1)})}if(0!=i.editsRemaining){if("*"in i.node.edges)var s=i.node.edges["*"];else{s=new D.TokenSet;i.node.edges["*"]=s}if(0==i.str.length&&(s.final=!0),r.push({node:s,editsRemaining:i.editsRemaining-1,str:i.str}),1<i.str.length&&r.push({node:i.node,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)}),1==i.str.length&&(i.node.final=!0),1<=i.str.length){if("*"in i.node.edges)var c=i.node.edges["*"];else{c=new D.TokenSet;i.node.edges["*"]=c}1==i.str.length&&(c.final=!0),r.push({node:c,editsRemaining:i.editsRemaining-1,str:i.str.slice(1)})}if(1<i.str.length){var l,u=i.str.charAt(0),f=i.str.charAt(1);f in i.node.edges?l=i.node.edges[f]:(l=new D.TokenSet,i.node.edges[f]=l),1==i.str.length&&(l.final=!0),r.push({node:l,editsRemaining:i.editsRemaining-1,str:u+i.str.slice(2)})}}}return n},D.TokenSet.fromString=function(e){for(var t=new D.TokenSet,n=t,r=0,i=e.length;r<i;r++){var o=e[r],a=r==i-1;if("*"==o)(t.edges[o]=t).final=a;else{var s=new D.TokenSet;s.final=a,t.edges[o]=s,t=s}}return n},D.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var n=t.pop(),r=Object.keys(n.node.edges),i=r.length;n.node.final&&(n.prefix.charAt(0),e.push(n.prefix));for(var o=0;o<i;o++){var a=r[o];t.push({prefix:n.prefix.concat(a),node:n.node.edges[a]})}}return e},D.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),n=t.length,r=0;r<n;r++){var i=t[r];e=e+i+this.edges[i].id}return e},D.TokenSet.prototype.intersect=function(e){for(var t=new D.TokenSet,n=void 0,r=[{qNode:e,output:t,node:this}];r.length;){n=r.pop();for(var i=Object.keys(n.qNode.edges),o=i.length,a=Object.keys(n.node.edges),s=a.length,c=0;c<o;c++)for(var l=i[c],u=0;u<s;u++){var f=a[u];if(f==l||"*"==l){var d=n.node.edges[f],h=n.qNode.edges[l],p=d.final&&h.final,m=void 0;f in n.output.edges?(m=n.output.edges[f]).final=m.final||p:((m=new D.TokenSet).final=p,n.output.edges[f]=m),r.push({qNode:h,output:m,node:d})}}}return t},D.TokenSet.Builder=function(){this.previousWord="",this.root=new D.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},D.TokenSet.Builder.prototype.insert=function(e){var t,n=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var r=0;r<e.length&&r<this.previousWord.length&&e[r]==this.previousWord[r];r++)n++;this.minimize(n),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child;for(r=n;r<e.length;r++){var i=new D.TokenSet,o=e[r];t.edges[o]=i,this.uncheckedNodes.push({parent:t,char:o,child:i}),t=i}t.final=!0,this.previousWord=e},D.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},D.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;e<=t;t--){var n=this.uncheckedNodes[t],r=n.child.toString();r in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[r]:(n.child._str=r,this.minimizedNodes[r]=n.child),this.uncheckedNodes.pop()}}
-/*!
- * lunr.Index
- * Copyright (C) 2019 Oliver Nightingale
- */,D.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},D.Index.prototype.search=function(t){return this.query(function(e){new D.QueryParser(t,e).parse()})},D.Index.prototype.query=function(e){for(var t=new D.Query(this.fields),n=Object.create(null),r=Object.create(null),i=Object.create(null),o=Object.create(null),a=Object.create(null),s=0;s<this.fields.length;s++)r[this.fields[s]]=new D.Vector;e.call(t,t);for(s=0;s<t.clauses.length;s++){var c=t.clauses[s],l=null,u=D.Set.complete;l=c.usePipeline?this.pipeline.runString(c.term,{fields:c.fields}):[c.term];for(var f=0;f<l.length;f++){var d=l[f];c.term=d;var h=D.TokenSet.fromClause(c),p=this.tokenSet.intersect(h).toArray();if(0===p.length&&c.presence===D.Query.presence.REQUIRED){for(var m=0;m<c.fields.length;m++){o[P=c.fields[m]]=D.Set.empty}break}for(var y=0;y<p.length;y++){var v=p[y],g=this.invertedIndex[v],w=g._index;for(m=0;m<c.fields.length;m++){var _=g[P=c.fields[m]],E=Object.keys(_),x=v+"/"+P,b=new D.Set(E);if(c.presence==D.Query.presence.REQUIRED&&(u=u.union(b),void 0===o[P]&&(o[P]=D.Set.complete)),c.presence!=D.Query.presence.PROHIBITED){if(r[P].upsert(w,c.boost,function(e,t){return e+t}),!i[x]){for(var k=0;k<E.length;k++){var S,T=E[k],L=new D.FieldRef(T,P),R=_[T];void 0===(S=n[L])?n[L]=new D.MatchData(v,P,R):S.add(v,P,R)}i[x]=!0}}else void 0===a[P]&&(a[P]=D.Set.empty),a[P]=a[P].union(b)}}}if(c.presence===D.Query.presence.REQUIRED)for(m=0;m<c.fields.length;m++){o[P=c.fields[m]]=o[P].intersect(u)}}var O=D.Set.complete,C=D.Set.empty;for(s=0;s<this.fields.length;s++){var P;o[P=this.fields[s]]&&(O=O.intersect(o[P])),a[P]&&(C=C.union(a[P]))}var Q=Object.keys(n),A=[],I=Object.create(null);if(t.isNegated()){Q=Object.keys(this.fieldVectors);for(s=0;s<Q.length;s++){L=Q[s];var M=D.FieldRef.fromString(L);n[L]=new D.MatchData}}for(s=0;s<Q.length;s++){var N=(M=D.FieldRef.fromString(Q[s])).docRef;if(O.contains(N)&&!C.contains(N)){var j,F=this.fieldVectors[M],H=r[M.fieldName].similarity(F);if(void 0!==(j=I[N]))j.score+=H,j.matchData.combine(n[M]);else{var q={ref:N,score:H,matchData:n[M]};I[N]=q,A.push(q)}}}return A.sort(function(e,t){return t.score-e.score})},D.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map(function(e){return[e,this.invertedIndex[e]]},this),t=Object.keys(this.fieldVectors).map(function(e){return[e,this.fieldVectors[e].toJSON()]},this);return{version:D.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},D.Index.load=function(e){var t={},n={},r=e.fieldVectors,i=Object.create(null),o=e.invertedIndex,a=new D.TokenSet.Builder,s=D.Pipeline.load(e.pipeline);e.version!=D.version&&D.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+D.version+"' does not match serialized index '"+e.version+"'");for(var c=0;c<r.length;c++){var l=(f=r[c])[0],u=f[1];n[l]=new D.Vector(u)}for(c=0;c<o.length;c++){var f,d=(f=o[c])[0],h=f[1];a.insert(d),i[d]=h}return a.finish(),t.fields=e.fields,t.fieldVectors=n,t.invertedIndex=i,t.tokenSet=a.root,t.pipeline=s,new D.Index(t)}
-/*!
- * lunr.Builder
- * Copyright (C) 2019 Oliver Nightingale
- */,D.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=D.tokenizer,this.pipeline=new D.Pipeline,this.searchPipeline=new D.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},D.Builder.prototype.ref=function(e){this._ref=e},D.Builder.prototype.field=function(e,t){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},D.Builder.prototype.b=function(e){this._b=e<0?0:1<e?1:e},D.Builder.prototype.k1=function(e){this._k1=e},D.Builder.prototype.add=function(e,t){var n=e[this._ref],r=Object.keys(this._fields);this._documents[n]=t||{},this.documentCount+=1;for(var i=0;i<r.length;i++){var o=r[i],a=this._fields[o].extractor,s=a?a(e):e[o],c=this.tokenizer(s,{fields:[o]}),l=this.pipeline.run(c),u=new D.FieldRef(n,o),f=Object.create(null);this.fieldTermFrequencies[u]=f,this.fieldLengths[u]=0,this.fieldLengths[u]+=l.length;for(var d=0;d<l.length;d++){var h=l[d];if(null==f[h]&&(f[h]=0),f[h]+=1,null==this.invertedIndex[h]){var p=Object.create(null);p._index=this.termIndex,this.termIndex+=1;for(var m=0;m<r.length;m++)p[r[m]]=Object.create(null);this.invertedIndex[h]=p}null==this.invertedIndex[h][o][n]&&(this.invertedIndex[h][o][n]=Object.create(null));for(var y=0;y<this.metadataWhitelist.length;y++){var v=this.metadataWhitelist[y],g=h.metadata[v];null==this.invertedIndex[h][o][n][v]&&(this.invertedIndex[h][o][n][v]=[]),this.invertedIndex[h][o][n][v].push(g)}}}},D.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,n={},r={},i=0;i<t;i++){var o=D.FieldRef.fromString(e[i]),a=o.fieldName;r[a]||(r[a]=0),r[a]+=1,n[a]||(n[a]=0),n[a]+=this.fieldLengths[o]}var s=Object.keys(this._fields);for(i=0;i<s.length;i++){var c=s[i];n[c]=n[c]/r[c]}this.averageFieldLength=n},D.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),n=t.length,r=Object.create(null),i=0;i<n;i++){for(var o=D.FieldRef.fromString(t[i]),a=o.fieldName,s=this.fieldLengths[o],c=new D.Vector,l=this.fieldTermFrequencies[o],u=Object.keys(l),f=u.length,d=this._fields[a].boost||1,h=this._documents[o.docRef].boost||1,p=0;p<f;p++){var m,y,v,g=u[p],w=l[g],_=this.invertedIndex[g]._index;void 0===r[g]?(m=D.idf(this.invertedIndex[g],this.documentCount),r[g]=m):m=r[g],y=m*((this._k1+1)*w)/(this._k1*(1-this._b+this._b*(s/this.averageFieldLength[a]))+w),y*=d,y*=h,v=Math.round(1e3*y)/1e3,c.insert(_,v)}e[o]=c}this.fieldVectors=e},D.Builder.prototype.createTokenSet=function(){this.tokenSet=D.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},D.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new D.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},D.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},D.MatchData=function(e,t,n){for(var r=Object.create(null),i=Object.keys(n||{}),o=0;o<i.length;o++){var a=i[o];r[a]=n[a].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=r)},D.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),n=0;n<t.length;n++){var r=t[n],i=Object.keys(e.metadata[r]);null==this.metadata[r]&&(this.metadata[r]=Object.create(null));for(var o=0;o<i.length;o++){var a=i[o],s=Object.keys(e.metadata[r][a]);null==this.metadata[r][a]&&(this.metadata[r][a]=Object.create(null));for(var c=0;c<s.length;c++){var l=s[c];null==this.metadata[r][a][l]?this.metadata[r][a][l]=e.metadata[r][a][l]:this.metadata[r][a][l]=this.metadata[r][a][l].concat(e.metadata[r][a][l])}}}},D.MatchData.prototype.add=function(e,t,n){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=n);if(t in this.metadata[e])for(var r=Object.keys(n),i=0;i<r.length;i++){var o=r[i];o in this.metadata[e][t]?this.metadata[e][t][o]=this.metadata[e][t][o].concat(n[o]):this.metadata[e][t][o]=n[o]}else this.metadata[e][t]=n},D.Query=function(e){this.clauses=[],this.allFields=e},D.Query.wildcard=new String("*"),D.Query.wildcard.NONE=0,D.Query.wildcard.LEADING=1,D.Query.wildcard.TRAILING=2,D.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},D.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=D.Query.wildcard.NONE),e.wildcard&D.Query.wildcard.LEADING&&e.term.charAt(0)!=D.Query.wildcard&&(e.term="*"+e.term),e.wildcard&D.Query.wildcard.TRAILING&&e.term.slice(-1)!=D.Query.wildcard&&(e.term=e.term+"*"),"presence"in e||(e.presence=D.Query.presence.OPTIONAL),this.clauses.push(e),this},D.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=D.Query.presence.PROHIBITED)return!1;return!0},D.Query.prototype.term=function(e,t){if(Array.isArray(e))return e.forEach(function(e){this.term(e,D.utils.clone(t))},this),this;var n=t||{};return n.term=e.toString(),this.clause(n),this},D.QueryParseError=function(e,t,n){this.name="QueryParseError",this.message=e,this.start=t,this.end=n},D.QueryParseError.prototype=new Error,D.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},D.QueryLexer.prototype.run=function(){for(var e=D.QueryLexer.lexText;e;)e=e(this)},D.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,n=this.pos,r=0;r<this.escapeCharPositions.length;r++)n=this.escapeCharPositions[r],e.push(this.str.slice(t,n)),t=n+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},D.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},D.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},D.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return D.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},D.QueryLexer.prototype.width=function(){return this.pos-this.start},D.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},D.QueryLexer.prototype.backup=function(){this.pos-=1},D.QueryLexer.prototype.acceptDigitRun=function(){for(var e,t;47<(t=(e=this.next()).charCodeAt(0))&&t<58;);e!=D.QueryLexer.EOS&&this.backup()},D.QueryLexer.prototype.more=function(){return this.pos<this.length},D.QueryLexer.EOS="EOS",D.QueryLexer.FIELD="FIELD",D.QueryLexer.TERM="TERM",D.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",D.QueryLexer.BOOST="BOOST",D.QueryLexer.PRESENCE="PRESENCE",D.QueryLexer.lexField=function(e){return e.backup(),e.emit(D.QueryLexer.FIELD),e.ignore(),D.QueryLexer.lexText},D.QueryLexer.lexTerm=function(e){if(1<e.width()&&(e.backup(),e.emit(D.QueryLexer.TERM)),e.ignore(),e.more())return D.QueryLexer.lexText},D.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(D.QueryLexer.EDIT_DISTANCE),D.QueryLexer.lexText},D.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(D.QueryLexer.BOOST),D.QueryLexer.lexText},D.QueryLexer.lexEOS=function(e){0<e.width()&&e.emit(D.QueryLexer.TERM)},D.QueryLexer.termSeparator=D.tokenizer.separator,D.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==D.QueryLexer.EOS)return D.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return D.QueryLexer.lexField;if("~"==t)return e.backup(),0<e.width()&&e.emit(D.QueryLexer.TERM),D.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),0<e.width()&&e.emit(D.QueryLexer.TERM),D.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(D.QueryLexer.PRESENCE),D.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(D.QueryLexer.PRESENCE),D.QueryLexer.lexText;if(t.match(D.QueryLexer.termSeparator))return D.QueryLexer.lexTerm}else e.escapeCharacter()}},D.QueryParser=function(e,t){this.lexer=new D.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},D.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=D.QueryParser.parseClause;e;)e=e(this);return this.query},D.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},D.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},D.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},D.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case D.QueryLexer.PRESENCE:return D.QueryParser.parsePresence;case D.QueryLexer.FIELD:return D.QueryParser.parseField;case D.QueryLexer.TERM:return D.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+t.type;throw 1<=t.str.length&&(n+=" with value '"+t.str+"'"),new D.QueryParseError(n,t.start,t.end)}},D.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=D.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=D.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+t.str+"'";throw new D.QueryParseError(n,t.start,t.end)}var r=e.peekLexeme();if(null==r){n="expecting term or field, found nothing";throw new D.QueryParseError(n,t.start,t.end)}switch(r.type){case D.QueryLexer.FIELD:return D.QueryParser.parseField;case D.QueryLexer.TERM:return D.QueryParser.parseTerm;default:n="expecting term or field, found '"+r.type+"'";throw new D.QueryParseError(n,r.start,r.end)}}},D.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var n=e.query.allFields.map(function(e){return"'"+e+"'"}).join(", "),r="unrecognised field '"+t.str+"', possible fields: "+n;throw new D.QueryParseError(r,t.start,t.end)}e.currentClause.fields=[t.str];var i=e.peekLexeme();if(null==i){r="expecting term, found nothing";throw new D.QueryParseError(r,t.start,t.end)}switch(i.type){case D.QueryLexer.TERM:return D.QueryParser.parseTerm;default:r="expecting term, found '"+i.type+"'";throw new D.QueryParseError(r,i.start,i.end)}}},D.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(null!=n)switch(n.type){case D.QueryLexer.TERM:return e.nextClause(),D.QueryParser.parseTerm;case D.QueryLexer.FIELD:return e.nextClause(),D.QueryParser.parseField;case D.QueryLexer.EDIT_DISTANCE:return D.QueryParser.parseEditDistance;case D.QueryLexer.BOOST:return D.QueryParser.parseBoost;case D.QueryLexer.PRESENCE:return e.nextClause(),D.QueryParser.parsePresence;default:var r="Unexpected lexeme type '"+n.type+"'";throw new D.QueryParseError(r,n.start,n.end)}else e.nextClause()}},D.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var n=parseInt(t.str,10);if(isNaN(n)){var r="edit distance must be numeric";throw new D.QueryParseError(r,t.start,t.end)}e.currentClause.editDistance=n;var i=e.peekLexeme();if(null!=i)switch(i.type){case D.QueryLexer.TERM:return e.nextClause(),D.QueryParser.parseTerm;case D.QueryLexer.FIELD:return e.nextClause(),D.QueryParser.parseField;case D.QueryLexer.EDIT_DISTANCE:return D.QueryParser.parseEditDistance;case D.QueryLexer.BOOST:return D.QueryParser.parseBoost;case D.QueryLexer.PRESENCE:return e.nextClause(),D.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new D.QueryParseError(r,i.start,i.end)}else e.nextClause()}},D.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var n=parseInt(t.str,10);if(isNaN(n)){var r="boost must be numeric";throw new D.QueryParseError(r,t.start,t.end)}e.currentClause.boost=n;var i=e.peekLexeme();if(null!=i)switch(i.type){case D.QueryLexer.TERM:return e.nextClause(),D.QueryParser.parseTerm;case D.QueryLexer.FIELD:return e.nextClause(),D.QueryParser.parseField;case D.QueryLexer.EDIT_DISTANCE:return D.QueryParser.parseEditDistance;case D.QueryLexer.BOOST:return D.QueryParser.parseBoost;case D.QueryLexer.PRESENCE:return e.nextClause(),D.QueryParser.parsePresence;default:r="Unexpected lexeme type '"+i.type+"'";throw new D.QueryParseError(r,i.start,i.end)}else e.nextClause()}},void 0===(c="function"==typeof(s=function(){return D})?s.call(o,a,o,i):s)||(i.exports=c)}()}])); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.ar.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.ar.js
deleted file mode 100644
index 4fc6a5d1..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.ar.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/*!
- * Lunr languages, `Arabic` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2018, Dalia Al-Shahrabi
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Kazem Taghva, Rania Elkhoury, and Jeffrey Coombs (2005)
- * Meryeme Hadni, Abdelmonaime Lachkar, and S. Alaoui Ouatik (2012)
- *
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ar=function(){this.pipeline.reset(),this.pipeline.add(e.ar.trimmer,e.ar.stopWordFilter,e.ar.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ar.stemmer))},e.ar.wordCharacters="ء-ٛٱـ",e.ar.trimmer=e.trimmerSupport.generateTrimmer(e.ar.wordCharacters),e.Pipeline.registerFunction(e.ar.trimmer,"trimmer-ar"),e.ar.stemmer=function(){var m=this;return m.result=!1,m.preRemoved=!1,m.sufRemoved=!1,m.pre={pre1:"ف ك ب و س ل ن ا ي ت",pre2:"ال لل",pre3:"بال وال فال تال كال ولل",pre4:"فبال كبال وبال وكال"},m.suf={suf1:"ه ك ت ن ا ي",suf2:"نك نه ها وك يا اه ون ين تن تم نا وا ان كم كن ني نن ما هم هن تك ته ات يه",suf3:"تين كهم نيه نهم ونه وها يهم ونا ونك وني وهم تكم تنا تها تني تهم كما كها ناه نكم هنا تان يها",suf4:"كموه ناها ونني ونهم تكما تموه تكاه كماه ناكم ناهم نيها وننا"},m.patterns=JSON.parse('{"pt43":[{"pt":[{"c":"ا","l":1}]},{"pt":[{"c":"ا,ت,ن,ي","l":0}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"و","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ل","l":2,"m":3}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ي","l":2}],"mPt":[{"c":"ف","l":0,"m":0},{"c":"ع","l":1,"m":1},{"c":"ا","l":2},{"c":"ل","l":3,"m":3}]},{"pt":[{"c":"م","l":0}]}],"pt53":[{"pt":[{"c":"ت","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":3},{"c":"ل","l":3,"m":4},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":0},{"c":"ا","l":3}],"mPt":[{"c":"ف","l":0,"m":1},{"c":"ع","l":1,"m":2},{"c":"ل","l":2,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ن","l":4}]},{"pt":[{"c":"ت","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"م","l":0},{"c":"و","l":3}]},{"pt":[{"c":"ا","l":1},{"c":"و","l":3}]},{"pt":[{"c":"و","l":1},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ي","l":3}]},{"pt":[{"c":"ا","l":2},{"c":"ن","l":3}]},{"pt":[{"c":"م","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"م","l":0},{"c":"ا","l":2}]},{"pt":[{"c":"م","l":1},{"c":"ا","l":3}]},{"pt":[{"c":"ي,ت,ا,ن","l":0},{"c":"ت","l":1}],"mPt":[{"c":"ف","l":0,"m":2},{"c":"ع","l":1,"m":3},{"c":"ا","l":2},{"c":"ل","l":3,"m":4}]},{"pt":[{"c":"ت,ي,ا,ن","l":0},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ت","l":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":2},{"c":"ي","l":3}]},{"pt":[{"c":"ا,ي,ت,ن","l":0},{"c":"ن","l":1}],"mPt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ف","l":2,"m":2},{"c":"ع","l":3,"m":3},{"c":"ا","l":4},{"c":"ل","l":5,"m":4}]},{"pt":[{"c":"ا","l":3},{"c":"ء","l":4}]}],"pt63":[{"pt":[{"c":"ا","l":0},{"c":"ت","l":2},{"c":"ا","l":4}]},{"pt":[{"c":"ا,ت,ن,ي","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ا,ن,ت,ي","l":0},{"c":"و","l":3}]},{"pt":[{"c":"م","l":0},{"c":"س","l":1},{"c":"ت","l":2}],"mPt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ف","l":3,"m":3},{"c":"ع","l":4,"m":4},{"c":"ا","l":5},{"c":"ل","l":6,"m":5}]},{"pt":[{"c":"ي","l":1},{"c":"ي","l":3},{"c":"ا","l":4},{"c":"ء","l":5}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":1},{"c":"ا","l":4}]}],"pt54":[{"pt":[{"c":"ت","l":0}]},{"pt":[{"c":"ا,ي,ت,ن","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"م","l":0}],"mPt":[{"c":"ا","l":0},{"c":"ف","l":1,"m":1},{"c":"ع","l":2,"m":2},{"c":"ل","l":3,"m":3},{"c":"ر","l":4,"m":4},{"c":"ا","l":5},{"c":"ر","l":6,"m":4}]},{"pt":[{"c":"ا","l":2}]},{"pt":[{"c":"ا","l":0},{"c":"ن","l":2}]}],"pt64":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":4}]},{"pt":[{"c":"م","l":0},{"c":"ت","l":1}]}],"pt73":[{"pt":[{"c":"ا","l":0},{"c":"س","l":1},{"c":"ت","l":2},{"c":"ا","l":5}]}],"pt75":[{"pt":[{"c":"ا","l":0},{"c":"ا","l":5}]}]}'),m.execArray=["cleanWord","removeDiacritics","cleanAlef","removeStopWords","normalizeHamzaAndAlef","removeStartWaw","removePre432","removeEndTaa","wordCheck"],m.stem=function(){var e=0;for(m.result=!1,m.preRemoved=!1,m.sufRemoved=!1;e<m.execArray.length&&1!=m.result;)m.result=m[m.execArray[e]](),e++},m.setCurrent=function(e){m.word=e},m.getCurrent=function(){return m.word},m.cleanWord=function(){var e=new RegExp("[^ء-ٛٱـ]");return m.word=m.word.replace("ـ",""),!!e.test("")},m.removeDiacritics=function(){new RegExp("[ً-ٛ]");return m.word=m.word.replace(/[\u064b-\u065b]/gi,""),!1},m.cleanAlef=function(){var e=new RegExp("[آأإٱى]");return m.word=m.word.replace(e,"ا"),!1},m.removeStopWords=function(){if(0<="، اض امين اه اها اي ا اب اجل اجمع اخ اخذ اصبح اضحى اقبل اقل اكثر الا ام اما امامك امامك امسى اما ان انا انت انتم انتما انتن انت انشا انى او اوشك اولئك اولئكم اولاء اولالك اوه اي ايا اين اينما اي ان اي اف اذ اذا اذا اذما اذن الى اليكم اليكما اليكن اليك اليك الا اما ان انما اي اياك اياكم اياكما اياكن ايانا اياه اياها اياهم اياهما اياهن اياي ايه ان ا ابتدا اثر اجل احد اخرى اخلولق اذا اربعة ارتد استحال اطار اعادة اعلنت اف اكثر اكد الالاء الالى الا الاخيرة الان الاول الاولى التى التي الثاني الثانية الذاتي الذى الذي الذين السابق الف اللائي اللاتي اللتان اللتيا اللتين اللذان اللذين اللواتي الماضي المقبل الوقت الى اليوم اما امام امس ان انبرى انقلب انه انها او اول اي ايار ايام ايضا ب بات باسم بان بخ برس بسبب بس بشكل بضع بطان بعد بعض بك بكم بكما بكن بل بلى بما بماذا بمن بن بنا به بها بي بيد بين بس بله بئس تان تانك تبدل تجاه تحول تلقاء تلك تلكم تلكما تم تينك تين ته تي ثلاثة ثم ثم ثمة ثم جعل جلل جميع جير حار حاشا حاليا حاي حتى حرى حسب حم حوالى حول حيث حيثما حين حي حبذا حتى حذار خلا خلال دون دونك ذا ذات ذاك ذانك ذان ذلك ذلكم ذلكما ذلكن ذو ذوا ذواتا ذواتي ذيت ذينك ذين ذه ذي راح رجع رويدك ريث رب زيارة سبحان سرعان سنة سنوات سوف سوى ساء ساءما شبه شخصا شرع شتان صار صباح صفر صه صه ضد ضمن طاق طالما طفق طق ظل عاد عام عاما عامة عدا عدة عدد عدم عسى عشر عشرة علق على عليك عليه عليها عل عن عند عندما عوض عين عدس عما غدا غير ف فان فلان فو فى في فيم فيما فيه فيها قال قام قبل قد قط قلما قوة كانما كاين كاي كاين كاد كان كانت كذا كذلك كرب كل كلا كلاهما كلتا كلم كليكما كليهما كلما كلا كم كما كي كيت كيف كيفما كان كخ لئن لا لات لاسيما لدن لدى لعمر لقاء لك لكم لكما لكن لكنما لكي لكيلا للامم لم لما لما لن لنا له لها لو لوكالة لولا لوما لي لست لست لستم لستما لستن لست لسن لعل لكن ليت ليس ليسا ليستا ليست ليسوا لسنا ما ماانفك مابرح مادام ماذا مازال مافتئ مايو متى مثل مذ مساء مع معاذ مقابل مكانكم مكانكما مكانكن مكانك مليار مليون مما ممن من منذ منها مه مهما من من نحن نحو نعم نفس نفسه نهاية نخ نعما نعم ها هاؤم هاك هاهنا هب هذا هذه هكذا هل هلم هلا هم هما هن هنا هناك هنالك هو هي هيا هيت هيا هؤلاء هاتان هاتين هاته هاتي هج هذا هذان هذين هذه هذي هيهات و وا واحد واضاف واضافت واكد وان واها واوضح وراءك وفي وقال وقالت وقد وقف وكان وكانت ولا ولم ومن وهو وهي ويكان وي وشكان يكون يمكن يوم ايان".split(" ").indexOf(m.word))return!0},m.normalizeHamzaAndAlef=function(){return m.word=m.word.replace("ؤ","ء"),m.word=m.word.replace("ئ","ء"),m.word=m.word.replace(/([\u0627])\1+/gi,"ا"),!1},m.removeEndTaa=function(){return!(2<m.word.length)||(m.word=m.word.replace(/[\u0627]$/,""),m.word=m.word.replace("ة",""),!1)},m.removeStartWaw=function(){return 3<m.word.length&&"و"==m.word[0]&&"و"==m.word[1]&&(m.word=m.word.slice(1)),!1},m.removePre432=function(){var e=m.word;if(7<=m.word.length){var r=new RegExp("^("+m.pre.pre4.split(" ").join("|")+")");m.word=m.word.replace(r,"")}if(m.word==e&&6<=m.word.length){var t=new RegExp("^("+m.pre.pre3.split(" ").join("|")+")");m.word=m.word.replace(t,"")}if(m.word==e&&5<=m.word.length){var c=new RegExp("^("+m.pre.pre2.split(" ").join("|")+")");m.word=m.word.replace(c,"")}return e!=m.word&&(m.preRemoved=!0),!1},m.patternCheck=function(r){for(var t=0;t<r.length;t++){for(var e=!0,c=0;c<r[t].pt.length;c++){var l=r[t].pt[c].c.split(","),o=!1;if(l.forEach(function(e){m.word[r[t].pt[c].l]==e&&(o=!0)}),!o){e=!1;break}}if(1==e){if(r[t].mPt){for(var n=[],p=0;p<r[t].mPt.length;p++)null!=r[t].mPt[p].m?n[r[t].mPt[p].l]=m.word[r[t].mPt[p].m]:n[r[t].mPt[p].l]=r[t].mPt[p].c;m.word=n.join("")}m.result=!0;break}}},m.removePre1=function(){var e=m.word;if(0==m.preRemoved&&3<m.word.length){var r=new RegExp("^("+m.pre.pre1.split(" ").join("|")+")");m.word=m.word.replace(r,"")}return e!=m.word&&(m.preRemoved=!0),!1},m.removeSuf1=function(){var e=m.word;if(0==m.sufRemoved&&3<m.word.length){var r=new RegExp("("+m.suf.suf1.split(" ").join("|")+")$");m.word=m.word.replace(r,"")}return e!=m.word&&(m.sufRemoved=!0),!1},m.removeSuf432=function(){var e=m.word;if(6<=m.word.length){var r=new RegExp("("+m.suf.suf4.split(" ").join("|")+")$");m.word=m.word.replace(r,"")}if(m.word==e&&5<=m.word.length){var t=new RegExp("("+m.suf.suf3.split(" ").join("|")+")$");m.word=m.word.replace(t,"")}if(m.word==e&&4<=m.word.length){var c=new RegExp("("+m.suf.suf2.split(" ").join("|")+")$");m.word=m.word.replace(c,"")}return e!=m.word&&(m.sufRemoved=!0),!1},m.wordCheck=function(){m.word;for(var e=[m.removeSuf432,m.removeSuf1,m.removePre1],r=0,t=!1;7<=m.word.length&&!m.result&&r<e.length;)t=7!=m.word.length||t?(e[r](),r++,!1):(m.checkPattern73(),!0);var c=[m.checkPattern63,m.removeSuf432,m.removeSuf1,m.removePre1,m.checkPattern64];for(r=0;6==m.word.length&&!m.result&&r<c.length;)c[r](),r++;var l=[m.checkPattern53,m.removeSuf432,m.removeSuf1,m.removePre1,m.checkPattern54];for(r=0;5==m.word.length&&!m.result&&r<l.length;)l[r](),r++;var o=[m.checkPattern43,m.removeSuf1,m.removePre1,m.removeSuf432];for(r=0;4==m.word.length&&!m.result&&r<o.length;)o[r](),r++;return!0},m.checkPattern43=function(){m.patternCheck(m.patterns.pt43)},m.checkPattern53=function(){m.patternCheck(m.patterns.pt53)},m.checkPattern54=function(){m.patternCheck(m.patterns.pt54)},m.checkPattern63=function(){m.patternCheck(m.patterns.pt63)},m.checkPattern64=function(){m.patternCheck(m.patterns.pt64)},m.checkPattern73=function(){m.patternCheck(m.patterns.pt73)},function(e){return"function"==typeof e.update?e.update(function(e){return m.setCurrent(e),m.stem(),m.getCurrent()}):(m.setCurrent(e),m.stem(),m.getCurrent())}}(),e.Pipeline.registerFunction(e.ar.stemmer,"stemmer-ar"),e.ar.stopWordFilter=e.generateStopWordFilter("، اض امين اه اها اي ا اب اجل اجمع اخ اخذ اصبح اضحى اقبل اقل اكثر الا ام اما امامك امامك امسى اما ان انا انت انتم انتما انتن انت انشا انى او اوشك اولئك اولئكم اولاء اولالك اوه اي ايا اين اينما اي ان اي اف اذ اذا اذا اذما اذن الى اليكم اليكما اليكن اليك اليك الا اما ان انما اي اياك اياكم اياكما اياكن ايانا اياه اياها اياهم اياهما اياهن اياي ايه ان ا ابتدا اثر اجل احد اخرى اخلولق اذا اربعة ارتد استحال اطار اعادة اعلنت اف اكثر اكد الالاء الالى الا الاخيرة الان الاول الاولى التى التي الثاني الثانية الذاتي الذى الذي الذين السابق الف اللائي اللاتي اللتان اللتيا اللتين اللذان اللذين اللواتي الماضي المقبل الوقت الى اليوم اما امام امس ان انبرى انقلب انه انها او اول اي ايار ايام ايضا ب بات باسم بان بخ برس بسبب بس بشكل بضع بطان بعد بعض بك بكم بكما بكن بل بلى بما بماذا بمن بن بنا به بها بي بيد بين بس بله بئس تان تانك تبدل تجاه تحول تلقاء تلك تلكم تلكما تم تينك تين ته تي ثلاثة ثم ثم ثمة ثم جعل جلل جميع جير حار حاشا حاليا حاي حتى حرى حسب حم حوالى حول حيث حيثما حين حي حبذا حتى حذار خلا خلال دون دونك ذا ذات ذاك ذانك ذان ذلك ذلكم ذلكما ذلكن ذو ذوا ذواتا ذواتي ذيت ذينك ذين ذه ذي راح رجع رويدك ريث رب زيارة سبحان سرعان سنة سنوات سوف سوى ساء ساءما شبه شخصا شرع شتان صار صباح صفر صه صه ضد ضمن طاق طالما طفق طق ظل عاد عام عاما عامة عدا عدة عدد عدم عسى عشر عشرة علق على عليك عليه عليها عل عن عند عندما عوض عين عدس عما غدا غير ف فان فلان فو فى في فيم فيما فيه فيها قال قام قبل قد قط قلما قوة كانما كاين كاي كاين كاد كان كانت كذا كذلك كرب كل كلا كلاهما كلتا كلم كليكما كليهما كلما كلا كم كما كي كيت كيف كيفما كان كخ لئن لا لات لاسيما لدن لدى لعمر لقاء لك لكم لكما لكن لكنما لكي لكيلا للامم لم لما لما لن لنا له لها لو لوكالة لولا لوما لي لست لست لستم لستما لستن لست لسن لعل لكن ليت ليس ليسا ليستا ليست ليسوا لسنا ما ماانفك مابرح مادام ماذا مازال مافتئ مايو متى مثل مذ مساء مع معاذ مقابل مكانكم مكانكما مكانكن مكانك مليار مليون مما ممن من منذ منها مه مهما من من نحن نحو نعم نفس نفسه نهاية نخ نعما نعم ها هاؤم هاك هاهنا هب هذا هذه هكذا هل هلم هلا هم هما هن هنا هناك هنالك هو هي هيا هيت هيا هؤلاء هاتان هاتين هاته هاتي هج هذا هذان هذين هذه هذي هيهات وا واحد واضاف واضافت واكد وان واها واوضح وراءك وفي وقال وقالت وقد وقف وكان وكانت ولا ولم ومن وهو وهي ويكان وي وشكان يكون يمكن يوم ايان".split(" ")),e.Pipeline.registerFunction(e.ar.stopWordFilter,"stopWordFilter-ar")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.da.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.da.js
deleted file mode 100644
index 88921d40..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.da.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Danish` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,m,i;e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=(r=e.stemmerSupport.Among,m=e.stemmerSupport.SnowballProgram,i=new function(){var i,t,n,s=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],o=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],u=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],c=new m;function l(){var e,r=c.limit-c.cursor;c.cursor>=t&&(e=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,c.find_among_b(o,4)?(c.bra=c.cursor,c.limit_backward=e,c.cursor=c.limit-r,c.cursor>c.limit_backward&&(c.cursor--,c.bra=c.cursor,c.slice_del())):c.limit_backward=e)}this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var e,r=c.cursor;return function(){var e,r=c.cursor+3;if(t=c.limit,0<=r&&r<=c.limit){for(i=r;;){if(e=c.cursor,c.in_grouping(d,97,248)){c.cursor=e;break}if((c.cursor=e)>=c.limit)return;c.cursor++}for(;!c.out_grouping(d,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(t=c.cursor)<i&&(t=i)}}(),c.limit_backward=r,c.cursor=c.limit,function(){var e,r;if(c.cursor>=t&&(r=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,e=c.find_among_b(s,32),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:c.in_grouping_b(u,97,229)&&c.slice_del()}}(),c.cursor=c.limit,l(),c.cursor=c.limit,function(){var e,r,i,n=c.limit-c.cursor;if(c.ket=c.cursor,c.eq_s_b(2,"st")&&(c.bra=c.cursor,c.eq_s_b(2,"ig")&&c.slice_del()),c.cursor=c.limit-n,c.cursor>=t&&(r=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,e=c.find_among_b(a,5),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del(),i=c.limit-c.cursor,l(),c.cursor=c.limit-i;break;case 2:c.slice_from("løs")}}(),c.cursor=c.limit,c.cursor>=t&&(e=c.limit_backward,c.limit_backward=t,c.ket=c.cursor,c.out_grouping_b(d,97,248)?(c.bra=c.cursor,n=c.slice_to(n),c.limit_backward=e,c.eq_v_b(n)&&c.slice_del()):c.limit_backward=e),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.de.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.de.js
deleted file mode 100644
index 73e55eb0..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.de.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `German` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var _,p,r;e.de=function(){this.pipeline.reset(),this.pipeline.add(e.de.trimmer,e.de.stopWordFilter,e.de.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.de.stemmer))},e.de.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.de.trimmer=e.trimmerSupport.generateTrimmer(e.de.wordCharacters),e.Pipeline.registerFunction(e.de.trimmer,"trimmer-de"),e.de.stemmer=(_=e.stemmerSupport.Among,p=e.stemmerSupport.SnowballProgram,r=new function(){var r,n,i,s=[new _("",-1,6),new _("U",0,2),new _("Y",0,1),new _("ä",0,3),new _("ö",0,4),new _("ü",0,5)],o=[new _("e",-1,2),new _("em",-1,1),new _("en",-1,2),new _("ern",-1,1),new _("er",-1,1),new _("s",-1,3),new _("es",5,2)],c=[new _("en",-1,1),new _("er",-1,1),new _("st",-1,2),new _("est",2,1)],u=[new _("ig",-1,1),new _("lich",-1,1)],a=[new _("end",-1,1),new _("ig",-1,2),new _("ung",-1,1),new _("lich",-1,3),new _("isch",-1,2),new _("ik",-1,2),new _("heit",-1,3),new _("keit",-1,4)],t=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32,8],d=[117,30,5],l=[117,30,4],m=new p;function h(e,r,n){return!(!m.eq_s(1,e)||(m.ket=m.cursor,!m.in_grouping(t,97,252)))&&(m.slice_from(r),m.cursor=n,!0)}function w(){for(;!m.in_grouping(t,97,252);){if(m.cursor>=m.limit)return!0;m.cursor++}for(;!m.out_grouping(t,97,252);){if(m.cursor>=m.limit)return!0;m.cursor++}return!1}function f(){return i<=m.cursor}function b(){return n<=m.cursor}this.setCurrent=function(e){m.setCurrent(e)},this.getCurrent=function(){return m.getCurrent()},this.stem=function(){var e=m.cursor;return function(){for(var e,r,n,i,s=m.cursor;;)if(e=m.cursor,m.bra=e,m.eq_s(1,"ß"))m.ket=m.cursor,m.slice_from("ss");else{if(e>=m.limit)break;m.cursor=e+1}for(m.cursor=s;;)for(r=m.cursor;;){if(n=m.cursor,m.in_grouping(t,97,252)){if(i=m.cursor,m.bra=i,h("u","U",n))break;if(m.cursor=i,h("y","Y",n))break}if(n>=m.limit)return m.cursor=r;m.cursor=n+1}}(),m.cursor=e,function(){i=m.limit,n=i;var e=m.cursor+3;0<=e&&e<=m.limit&&(r=e,w()||((i=m.cursor)<r&&(i=r),w()||(n=m.cursor)))}(),m.limit_backward=e,m.cursor=m.limit,function(){var e,r,n,i,s=m.limit-m.cursor;if(m.ket=m.cursor,(e=m.find_among_b(o,7))&&(m.bra=m.cursor,f()))switch(e){case 1:m.slice_del();break;case 2:m.slice_del(),m.ket=m.cursor,m.eq_s_b(1,"s")&&(m.bra=m.cursor,m.eq_s_b(3,"nis")&&m.slice_del());break;case 3:m.in_grouping_b(d,98,116)&&m.slice_del()}if(m.cursor=m.limit-s,m.ket=m.cursor,(e=m.find_among_b(c,4))&&(m.bra=m.cursor,f()))switch(e){case 1:m.slice_del();break;case 2:if(m.in_grouping_b(l,98,116)){var t=m.cursor-3;m.limit_backward<=t&&t<=m.limit&&(m.cursor=t,m.slice_del())}}if(m.cursor=m.limit-s,m.ket=m.cursor,(e=m.find_among_b(a,8))&&(m.bra=m.cursor,b()))switch(e){case 1:m.slice_del(),m.ket=m.cursor,m.eq_s_b(2,"ig")&&(m.bra=m.cursor,r=m.limit-m.cursor,m.eq_s_b(1,"e")||(m.cursor=m.limit-r,b()&&m.slice_del()));break;case 2:n=m.limit-m.cursor,m.eq_s_b(1,"e")||(m.cursor=m.limit-n,m.slice_del());break;case 3:if(m.slice_del(),m.ket=m.cursor,i=m.limit-m.cursor,!m.eq_s_b(2,"er")&&(m.cursor=m.limit-i,!m.eq_s_b(2,"en")))break;m.bra=m.cursor,f()&&m.slice_del();break;case 4:m.slice_del(),m.ket=m.cursor,(e=m.find_among_b(u,2))&&(m.bra=m.cursor,b()&&1==e&&m.slice_del())}}(),m.cursor=m.limit_backward,function(){for(var e,r;;){if(r=m.cursor,m.bra=r,!(e=m.find_among(s,6)))return;switch(m.ket=m.cursor,e){case 1:m.slice_from("y");break;case 2:case 5:m.slice_from("u");break;case 3:m.slice_from("a");break;case 4:m.slice_from("o");break;case 6:if(m.cursor>=m.limit)return;m.cursor++}}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return r.setCurrent(e),r.stem(),r.getCurrent()}):(r.setCurrent(e),r.stem(),r.getCurrent())}),e.Pipeline.registerFunction(e.de.stemmer,"stemmer-de"),e.de.stopWordFilter=e.generateStopWordFilter("aber alle allem allen aller alles als also am an ander andere anderem anderen anderer anderes anderm andern anderr anders auch auf aus bei bin bis bist da damit dann das dasselbe dazu daß dein deine deinem deinen deiner deines dem demselben den denn denselben der derer derselbe derselben des desselben dessen dich die dies diese dieselbe dieselben diesem diesen dieser dieses dir doch dort du durch ein eine einem einen einer eines einig einige einigem einigen einiger einiges einmal er es etwas euch euer eure eurem euren eurer eures für gegen gewesen hab habe haben hat hatte hatten hier hin hinter ich ihm ihn ihnen ihr ihre ihrem ihren ihrer ihres im in indem ins ist jede jedem jeden jeder jedes jene jenem jenen jener jenes jetzt kann kein keine keinem keinen keiner keines können könnte machen man manche manchem manchen mancher manches mein meine meinem meinen meiner meines mich mir mit muss musste nach nicht nichts noch nun nur ob oder ohne sehr sein seine seinem seinen seiner seines selbst sich sie sind so solche solchem solchen solcher solches soll sollte sondern sonst um und uns unse unsem unsen unser unses unter viel vom von vor war waren warst was weg weil weiter welche welchem welchen welcher welches wenn werde werden wie wieder will wir wird wirst wo wollen wollte während würde würden zu zum zur zwar zwischen über".split(" ")),e.Pipeline.registerFunction(e.de.stopWordFilter,"stopWordFilter-de")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.du.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.du.js
deleted file mode 100644
index e9c67299..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.du.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Dutch` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var v,q,r;console.warn('[Lunr Languages] Please use the "nl" instead of the "du". The "nl" code is the standard code for Dutch language, and "du" will be removed in the next major versions.'),e.du=function(){this.pipeline.reset(),this.pipeline.add(e.du.trimmer,e.du.stopWordFilter,e.du.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.du.stemmer))},e.du.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.du.trimmer=e.trimmerSupport.generateTrimmer(e.du.wordCharacters),e.Pipeline.registerFunction(e.du.trimmer,"trimmer-du"),e.du.stemmer=(v=e.stemmerSupport.Among,q=e.stemmerSupport.SnowballProgram,r=new function(){var r,i,u,o=[new v("",-1,6),new v("á",0,1),new v("ä",0,1),new v("é",0,2),new v("ë",0,2),new v("í",0,3),new v("ï",0,3),new v("ó",0,4),new v("ö",0,4),new v("ú",0,5),new v("ü",0,5)],n=[new v("",-1,3),new v("I",0,2),new v("Y",0,1)],t=[new v("dd",-1,-1),new v("kk",-1,-1),new v("tt",-1,-1)],c=[new v("ene",-1,2),new v("se",-1,3),new v("en",-1,2),new v("heden",2,1),new v("s",-1,3)],a=[new v("end",-1,1),new v("ig",-1,2),new v("ing",-1,1),new v("lijk",-1,3),new v("baar",-1,4),new v("bar",-1,5)],l=[new v("aa",-1,-1),new v("ee",-1,-1),new v("oo",-1,-1),new v("uu",-1,-1)],m=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],d=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],f=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],_=new q;function s(e){return(_.cursor=e)>=_.limit||(_.cursor++,!1)}function w(){for(;!_.in_grouping(m,97,232);){if(_.cursor>=_.limit)return!0;_.cursor++}for(;!_.out_grouping(m,97,232);){if(_.cursor>=_.limit)return!0;_.cursor++}return!1}function b(){return i<=_.cursor}function p(){return r<=_.cursor}function g(){var e=_.limit-_.cursor;_.find_among_b(t,3)&&(_.cursor=_.limit-e,_.ket=_.cursor,_.cursor>_.limit_backward&&(_.cursor--,_.bra=_.cursor,_.slice_del()))}function h(){var e;u=!1,_.ket=_.cursor,_.eq_s_b(1,"e")&&(_.bra=_.cursor,b()&&(e=_.limit-_.cursor,_.out_grouping_b(m,97,232)&&(_.cursor=_.limit-e,_.slice_del(),u=!0,g())))}function k(){var e;b()&&(e=_.limit-_.cursor,_.out_grouping_b(m,97,232)&&(_.cursor=_.limit-e,_.eq_s_b(3,"gem")||(_.cursor=_.limit-e,_.slice_del(),g())))}this.setCurrent=function(e){_.setCurrent(e)},this.getCurrent=function(){return _.getCurrent()},this.stem=function(){var e=_.cursor;return function(){for(var e,r,i,n=_.cursor;;){if(_.bra=_.cursor,e=_.find_among(o,11))switch(_.ket=_.cursor,e){case 1:_.slice_from("a");continue;case 2:_.slice_from("e");continue;case 3:_.slice_from("i");continue;case 4:_.slice_from("o");continue;case 5:_.slice_from("u");continue;case 6:if(_.cursor>=_.limit)break;_.cursor++;continue}break}for(_.cursor=n,_.bra=n,_.eq_s(1,"y")?(_.ket=_.cursor,_.slice_from("Y")):_.cursor=n;;)if(r=_.cursor,_.in_grouping(m,97,232)){if(i=_.cursor,_.bra=i,_.eq_s(1,"i"))_.ket=_.cursor,_.in_grouping(m,97,232)&&(_.slice_from("I"),_.cursor=r);else if(_.cursor=i,_.eq_s(1,"y"))_.ket=_.cursor,_.slice_from("Y"),_.cursor=r;else if(s(r))break}else if(s(r))break}(),_.cursor=e,i=_.limit,r=i,w()||((i=_.cursor)<3&&(i=3),w()||(r=_.cursor)),_.limit_backward=e,_.cursor=_.limit,function(){var e,r,i,n,o,t,s=_.limit-_.cursor;if(_.ket=_.cursor,e=_.find_among_b(c,5))switch(_.bra=_.cursor,e){case 1:b()&&_.slice_from("heid");break;case 2:k();break;case 3:b()&&_.out_grouping_b(f,97,232)&&_.slice_del()}if(_.cursor=_.limit-s,h(),_.cursor=_.limit-s,_.ket=_.cursor,_.eq_s_b(4,"heid")&&(_.bra=_.cursor,p()&&(r=_.limit-_.cursor,_.eq_s_b(1,"c")||(_.cursor=_.limit-r,_.slice_del(),_.ket=_.cursor,_.eq_s_b(2,"en")&&(_.bra=_.cursor,k())))),_.cursor=_.limit-s,_.ket=_.cursor,e=_.find_among_b(a,6))switch(_.bra=_.cursor,e){case 1:if(p()){if(_.slice_del(),i=_.limit-_.cursor,_.ket=_.cursor,_.eq_s_b(2,"ig")&&(_.bra=_.cursor,p()&&(n=_.limit-_.cursor,!_.eq_s_b(1,"e")))){_.cursor=_.limit-n,_.slice_del();break}_.cursor=_.limit-i,g()}break;case 2:p()&&(o=_.limit-_.cursor,_.eq_s_b(1,"e")||(_.cursor=_.limit-o,_.slice_del()));break;case 3:p()&&(_.slice_del(),h());break;case 4:p()&&_.slice_del();break;case 5:p()&&u&&_.slice_del()}_.cursor=_.limit-s,_.out_grouping_b(d,73,232)&&(t=_.limit-_.cursor,_.find_among_b(l,4)&&_.out_grouping_b(m,97,232)&&(_.cursor=_.limit-t,_.ket=_.cursor,_.cursor>_.limit_backward&&(_.cursor--,_.bra=_.cursor,_.slice_del())))}(),_.cursor=_.limit_backward,function(){for(var e;;)if(_.bra=_.cursor,e=_.find_among(n,3))switch(_.ket=_.cursor,e){case 1:_.slice_from("y");break;case 2:_.slice_from("i");break;case 3:if(_.cursor>=_.limit)return;_.cursor++}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return r.setCurrent(e),r.stem(),r.getCurrent()}):(r.setCurrent(e),r.stem(),r.getCurrent())}),e.Pipeline.registerFunction(e.du.stemmer,"stemmer-du"),e.du.stopWordFilter=e.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),e.Pipeline.registerFunction(e.du.stopWordFilter,"stopWordFilter-du")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.es.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.es.js
deleted file mode 100644
index 2918bd19..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.es.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Spanish` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,s){"function"==typeof define&&define.amd?define(s):"object"==typeof exports?module.exports=s():s()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var C,P,s;e.es=function(){this.pipeline.reset(),this.pipeline.add(e.es.trimmer,e.es.stopWordFilter,e.es.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.es.stemmer))},e.es.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.es.trimmer=e.trimmerSupport.generateTrimmer(e.es.wordCharacters),e.Pipeline.registerFunction(e.es.trimmer,"trimmer-es"),e.es.stemmer=(C=e.stemmerSupport.Among,P=e.stemmerSupport.SnowballProgram,s=new function(){var r,n,i,a=[new C("",-1,6),new C("á",0,1),new C("é",0,2),new C("í",0,3),new C("ó",0,4),new C("ú",0,5)],t=[new C("la",-1,-1),new C("sela",0,-1),new C("le",-1,-1),new C("me",-1,-1),new C("se",-1,-1),new C("lo",-1,-1),new C("selo",5,-1),new C("las",-1,-1),new C("selas",7,-1),new C("les",-1,-1),new C("los",-1,-1),new C("selos",10,-1),new C("nos",-1,-1)],o=[new C("ando",-1,6),new C("iendo",-1,6),new C("yendo",-1,7),new C("ándo",-1,2),new C("iéndo",-1,1),new C("ar",-1,6),new C("er",-1,6),new C("ir",-1,6),new C("ár",-1,3),new C("ér",-1,4),new C("ír",-1,5)],s=[new C("ic",-1,-1),new C("ad",-1,-1),new C("os",-1,-1),new C("iv",-1,1)],u=[new C("able",-1,1),new C("ible",-1,1),new C("ante",-1,1)],w=[new C("ic",-1,1),new C("abil",-1,1),new C("iv",-1,1)],c=[new C("ica",-1,1),new C("ancia",-1,2),new C("encia",-1,5),new C("adora",-1,2),new C("osa",-1,1),new C("ista",-1,1),new C("iva",-1,9),new C("anza",-1,1),new C("logía",-1,3),new C("idad",-1,8),new C("able",-1,1),new C("ible",-1,1),new C("ante",-1,2),new C("mente",-1,7),new C("amente",13,6),new C("ación",-1,2),new C("ución",-1,4),new C("ico",-1,1),new C("ismo",-1,1),new C("oso",-1,1),new C("amiento",-1,1),new C("imiento",-1,1),new C("ivo",-1,9),new C("ador",-1,2),new C("icas",-1,1),new C("ancias",-1,2),new C("encias",-1,5),new C("adoras",-1,2),new C("osas",-1,1),new C("istas",-1,1),new C("ivas",-1,9),new C("anzas",-1,1),new C("logías",-1,3),new C("idades",-1,8),new C("ables",-1,1),new C("ibles",-1,1),new C("aciones",-1,2),new C("uciones",-1,4),new C("adores",-1,2),new C("antes",-1,2),new C("icos",-1,1),new C("ismos",-1,1),new C("osos",-1,1),new C("amientos",-1,1),new C("imientos",-1,1),new C("ivos",-1,9)],m=[new C("ya",-1,1),new C("ye",-1,1),new C("yan",-1,1),new C("yen",-1,1),new C("yeron",-1,1),new C("yendo",-1,1),new C("yo",-1,1),new C("yas",-1,1),new C("yes",-1,1),new C("yais",-1,1),new C("yamos",-1,1),new C("yó",-1,1)],l=[new C("aba",-1,2),new C("ada",-1,2),new C("ida",-1,2),new C("ara",-1,2),new C("iera",-1,2),new C("ía",-1,2),new C("aría",5,2),new C("ería",5,2),new C("iría",5,2),new C("ad",-1,2),new C("ed",-1,2),new C("id",-1,2),new C("ase",-1,2),new C("iese",-1,2),new C("aste",-1,2),new C("iste",-1,2),new C("an",-1,2),new C("aban",16,2),new C("aran",16,2),new C("ieran",16,2),new C("ían",16,2),new C("arían",20,2),new C("erían",20,2),new C("irían",20,2),new C("en",-1,1),new C("asen",24,2),new C("iesen",24,2),new C("aron",-1,2),new C("ieron",-1,2),new C("arán",-1,2),new C("erán",-1,2),new C("irán",-1,2),new C("ado",-1,2),new C("ido",-1,2),new C("ando",-1,2),new C("iendo",-1,2),new C("ar",-1,2),new C("er",-1,2),new C("ir",-1,2),new C("as",-1,2),new C("abas",39,2),new C("adas",39,2),new C("idas",39,2),new C("aras",39,2),new C("ieras",39,2),new C("ías",39,2),new C("arías",45,2),new C("erías",45,2),new C("irías",45,2),new C("es",-1,1),new C("ases",49,2),new C("ieses",49,2),new C("abais",-1,2),new C("arais",-1,2),new C("ierais",-1,2),new C("íais",-1,2),new C("aríais",55,2),new C("eríais",55,2),new C("iríais",55,2),new C("aseis",-1,2),new C("ieseis",-1,2),new C("asteis",-1,2),new C("isteis",-1,2),new C("áis",-1,2),new C("éis",-1,1),new C("aréis",64,2),new C("eréis",64,2),new C("iréis",64,2),new C("ados",-1,2),new C("idos",-1,2),new C("amos",-1,2),new C("ábamos",70,2),new C("áramos",70,2),new C("iéramos",70,2),new C("íamos",70,2),new C("aríamos",74,2),new C("eríamos",74,2),new C("iríamos",74,2),new C("emos",-1,1),new C("aremos",78,2),new C("eremos",78,2),new C("iremos",78,2),new C("ásemos",78,2),new C("iésemos",78,2),new C("imos",-1,2),new C("arás",-1,2),new C("erás",-1,2),new C("irás",-1,2),new C("ís",-1,2),new C("ará",-1,2),new C("erá",-1,2),new C("irá",-1,2),new C("aré",-1,2),new C("eré",-1,2),new C("iré",-1,2),new C("ió",-1,2)],d=[new C("a",-1,1),new C("e",-1,2),new C("o",-1,1),new C("os",-1,1),new C("á",-1,1),new C("é",-1,2),new C("í",-1,1),new C("ó",-1,1)],b=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,4,10],f=new P;function _(){if(f.out_grouping(b,97,252)){for(;!f.in_grouping(b,97,252);){if(f.cursor>=f.limit)return!0;f.cursor++}return!1}return!0}function h(){var e,s=f.cursor;if(function(){if(f.in_grouping(b,97,252)){var e=f.cursor;if(_()){if(f.cursor=e,!f.in_grouping(b,97,252))return!0;for(;!f.out_grouping(b,97,252);){if(f.cursor>=f.limit)return!0;f.cursor++}}return!1}return!0}()){if(f.cursor=s,!f.out_grouping(b,97,252))return;if(e=f.cursor,_()){if(f.cursor=e,!f.in_grouping(b,97,252)||f.cursor>=f.limit)return;f.cursor++}}i=f.cursor}function v(){for(;!f.in_grouping(b,97,252);){if(f.cursor>=f.limit)return!1;f.cursor++}for(;!f.out_grouping(b,97,252);){if(f.cursor>=f.limit)return!1;f.cursor++}return!0}function p(){return i<=f.cursor}function g(){return r<=f.cursor}function k(e,s){if(!g())return!0;f.slice_del(),f.ket=f.cursor;var r=f.find_among_b(e,s);return r&&(f.bra=f.cursor,1==r&&g()&&f.slice_del()),!1}function y(e){return!g()||(f.slice_del(),f.ket=f.cursor,f.eq_s_b(2,e)&&(f.bra=f.cursor,g()&&f.slice_del()),!1)}function q(){var e;if(f.ket=f.cursor,e=f.find_among_b(c,46)){switch(f.bra=f.cursor,e){case 1:if(!g())return!1;f.slice_del();break;case 2:if(y("ic"))return!1;break;case 3:if(!g())return!1;f.slice_from("log");break;case 4:if(!g())return!1;f.slice_from("u");break;case 5:if(!g())return!1;f.slice_from("ente");break;case 6:if(!(n<=f.cursor))return!1;f.slice_del(),f.ket=f.cursor,(e=f.find_among_b(s,4))&&(f.bra=f.cursor,g()&&(f.slice_del(),1==e&&(f.ket=f.cursor,f.eq_s_b(2,"at")&&(f.bra=f.cursor,g()&&f.slice_del()))));break;case 7:if(k(u,3))return!1;break;case 8:if(k(w,3))return!1;break;case 9:if(y("at"))return!1}return!0}return!1}this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var e,s=f.cursor;return e=f.cursor,i=f.limit,r=n=i,h(),f.cursor=e,v()&&(n=f.cursor,v()&&(r=f.cursor)),f.limit_backward=s,f.cursor=f.limit,function(){var e;if(f.ket=f.cursor,f.find_among_b(t,13)&&(f.bra=f.cursor,(e=f.find_among_b(o,11))&&p()))switch(e){case 1:f.bra=f.cursor,f.slice_from("iendo");break;case 2:f.bra=f.cursor,f.slice_from("ando");break;case 3:f.bra=f.cursor,f.slice_from("ar");break;case 4:f.bra=f.cursor,f.slice_from("er");break;case 5:f.bra=f.cursor,f.slice_from("ir");break;case 6:f.slice_del();break;case 7:f.eq_s_b(1,"u")&&f.slice_del()}}(),f.cursor=f.limit,q()||(f.cursor=f.limit,function(){var e,s;if(f.cursor>=i&&(s=f.limit_backward,f.limit_backward=i,f.ket=f.cursor,e=f.find_among_b(m,12),f.limit_backward=s,e)){if(f.bra=f.cursor,1==e){if(!f.eq_s_b(1,"u"))return!1;f.slice_del()}return!0}return!1}()||(f.cursor=f.limit,function(){var e,s,r,n;if(f.cursor>=i&&(s=f.limit_backward,f.limit_backward=i,f.ket=f.cursor,e=f.find_among_b(l,96),f.limit_backward=s,e))switch(f.bra=f.cursor,e){case 1:r=f.limit-f.cursor,f.eq_s_b(1,"u")?(n=f.limit-f.cursor,f.eq_s_b(1,"g")?f.cursor=f.limit-n:f.cursor=f.limit-r):f.cursor=f.limit-r,f.bra=f.cursor;case 2:f.slice_del()}}())),f.cursor=f.limit,function(){var e,s;if(f.ket=f.cursor,e=f.find_among_b(d,8))switch(f.bra=f.cursor,e){case 1:p()&&f.slice_del();break;case 2:p()&&(f.slice_del(),f.ket=f.cursor,f.eq_s_b(1,"u")&&(f.bra=f.cursor,s=f.limit-f.cursor,f.eq_s_b(1,"g")&&(f.cursor=f.limit-s,p()&&f.slice_del())))}}(),f.cursor=f.limit_backward,function(){for(var e;;){if(f.bra=f.cursor,e=f.find_among(a,6))switch(f.ket=f.cursor,e){case 1:f.slice_from("a");continue;case 2:f.slice_from("e");continue;case 3:f.slice_from("i");continue;case 4:f.slice_from("o");continue;case 5:f.slice_from("u");continue;case 6:if(f.cursor>=f.limit)break;f.cursor++;continue}break}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return s.setCurrent(e),s.stem(),s.getCurrent()}):(s.setCurrent(e),s.stem(),s.getCurrent())}),e.Pipeline.registerFunction(e.es.stemmer,"stemmer-es"),e.es.stopWordFilter=e.generateStopWordFilter("a al algo algunas algunos ante antes como con contra cual cuando de del desde donde durante e el ella ellas ellos en entre era erais eran eras eres es esa esas ese eso esos esta estaba estabais estaban estabas estad estada estadas estado estados estamos estando estar estaremos estará estarán estarás estaré estaréis estaría estaríais estaríamos estarían estarías estas este estemos esto estos estoy estuve estuviera estuvierais estuvieran estuvieras estuvieron estuviese estuvieseis estuviesen estuvieses estuvimos estuviste estuvisteis estuviéramos estuviésemos estuvo está estábamos estáis están estás esté estéis estén estés fue fuera fuerais fueran fueras fueron fuese fueseis fuesen fueses fui fuimos fuiste fuisteis fuéramos fuésemos ha habida habidas habido habidos habiendo habremos habrá habrán habrás habré habréis habría habríais habríamos habrían habrías habéis había habíais habíamos habían habías han has hasta hay haya hayamos hayan hayas hayáis he hemos hube hubiera hubierais hubieran hubieras hubieron hubiese hubieseis hubiesen hubieses hubimos hubiste hubisteis hubiéramos hubiésemos hubo la las le les lo los me mi mis mucho muchos muy más mí mía mías mío míos nada ni no nos nosotras nosotros nuestra nuestras nuestro nuestros o os otra otras otro otros para pero poco por porque que quien quienes qué se sea seamos sean seas seremos será serán serás seré seréis sería seríais seríamos serían serías seáis sido siendo sin sobre sois somos son soy su sus suya suyas suyo suyos sí también tanto te tendremos tendrá tendrán tendrás tendré tendréis tendría tendríais tendríamos tendrían tendrías tened tenemos tenga tengamos tengan tengas tengo tengáis tenida tenidas tenido tenidos teniendo tenéis tenía teníais teníamos tenían tenías ti tiene tienen tienes todo todos tu tus tuve tuviera tuvierais tuvieran tuvieras tuvieron tuviese tuvieseis tuviesen tuvieses tuvimos tuviste tuvisteis tuviéramos tuviésemos tuvo tuya tuyas tuyo tuyos tú un una uno unos vosotras vosotros vuestra vuestras vuestro vuestros y ya yo él éramos".split(" ")),e.Pipeline.registerFunction(e.es.stopWordFilter,"stopWordFilter-es")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.fi.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.fi.js
deleted file mode 100644
index f34d10e0..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.fi.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Finnish` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(i,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():e()(i.lunr)}(this,function(){return function(i){if(void 0===i)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===i.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var v,C,e;i.fi=function(){this.pipeline.reset(),this.pipeline.add(i.fi.trimmer,i.fi.stopWordFilter,i.fi.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(i.fi.stemmer))},i.fi.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",i.fi.trimmer=i.trimmerSupport.generateTrimmer(i.fi.wordCharacters),i.Pipeline.registerFunction(i.fi.trimmer,"trimmer-fi"),i.fi.stemmer=(v=i.stemmerSupport.Among,C=i.stemmerSupport.SnowballProgram,e=new function(){var n,t,l,o,r=[new v("pa",-1,1),new v("sti",-1,2),new v("kaan",-1,1),new v("han",-1,1),new v("kin",-1,1),new v("hän",-1,1),new v("kään",-1,1),new v("ko",-1,1),new v("pä",-1,1),new v("kö",-1,1)],s=[new v("lla",-1,-1),new v("na",-1,-1),new v("ssa",-1,-1),new v("ta",-1,-1),new v("lta",3,-1),new v("sta",3,-1)],a=[new v("llä",-1,-1),new v("nä",-1,-1),new v("ssä",-1,-1),new v("tä",-1,-1),new v("ltä",3,-1),new v("stä",3,-1)],u=[new v("lle",-1,-1),new v("ine",-1,-1)],c=[new v("nsa",-1,3),new v("mme",-1,3),new v("nne",-1,3),new v("ni",-1,2),new v("si",-1,1),new v("an",-1,4),new v("en",-1,6),new v("än",-1,5),new v("nsä",-1,3)],i=[new v("aa",-1,-1),new v("ee",-1,-1),new v("ii",-1,-1),new v("oo",-1,-1),new v("uu",-1,-1),new v("ää",-1,-1),new v("öö",-1,-1)],m=[new v("a",-1,8),new v("lla",0,-1),new v("na",0,-1),new v("ssa",0,-1),new v("ta",0,-1),new v("lta",4,-1),new v("sta",4,-1),new v("tta",4,9),new v("lle",-1,-1),new v("ine",-1,-1),new v("ksi",-1,-1),new v("n",-1,7),new v("han",11,1),new v("den",11,-1,q),new v("seen",11,-1,j),new v("hen",11,2),new v("tten",11,-1,q),new v("hin",11,3),new v("siin",11,-1,q),new v("hon",11,4),new v("hän",11,5),new v("hön",11,6),new v("ä",-1,8),new v("llä",22,-1),new v("nä",22,-1),new v("ssä",22,-1),new v("tä",22,-1),new v("ltä",26,-1),new v("stä",26,-1),new v("ttä",26,9)],w=[new v("eja",-1,-1),new v("mma",-1,1),new v("imma",1,-1),new v("mpa",-1,1),new v("impa",3,-1),new v("mmi",-1,1),new v("immi",5,-1),new v("mpi",-1,1),new v("impi",7,-1),new v("ejä",-1,-1),new v("mmä",-1,1),new v("immä",10,-1),new v("mpä",-1,1),new v("impä",12,-1)],_=[new v("i",-1,-1),new v("j",-1,-1)],k=[new v("mma",-1,1),new v("imma",0,-1)],b=[17,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],e=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],f=[17,97,24,1,0,0,0,0,0,0,0,0,0,0,0,0,8,0,32],h=new C;function p(){for(var i;i=h.cursor,!h.in_grouping(d,97,246);){if((h.cursor=i)>=h.limit)return!0;h.cursor++}for(h.cursor=i;!h.out_grouping(d,97,246);){if(h.cursor>=h.limit)return!0;h.cursor++}return!1}function g(){var i,e;if(h.cursor>=o)if(e=h.limit_backward,h.limit_backward=o,h.ket=h.cursor,i=h.find_among_b(r,10)){switch(h.bra=h.cursor,h.limit_backward=e,i){case 1:if(!h.in_grouping_b(f,97,246))return;break;case 2:if(!(l<=h.cursor))return}h.slice_del()}else h.limit_backward=e}function j(){return h.find_among_b(i,7)}function q(){return h.eq_s_b(1,"i")&&h.in_grouping_b(e,97,246)}this.setCurrent=function(i){h.setCurrent(i)},this.getCurrent=function(){return h.getCurrent()},this.stem=function(){var i,e=h.cursor;return o=h.limit,l=o,p()||(o=h.cursor,p()||(l=h.cursor)),n=!1,h.limit_backward=e,h.cursor=h.limit,g(),h.cursor=h.limit,function(){var i,e,r;if(h.cursor>=o)if(e=h.limit_backward,h.limit_backward=o,h.ket=h.cursor,i=h.find_among_b(c,9))switch(h.bra=h.cursor,h.limit_backward=e,i){case 1:r=h.limit-h.cursor,h.eq_s_b(1,"k")||(h.cursor=h.limit-r,h.slice_del());break;case 2:h.slice_del(),h.ket=h.cursor,h.eq_s_b(3,"kse")&&(h.bra=h.cursor,h.slice_from("ksi"));break;case 3:h.slice_del();break;case 4:h.find_among_b(s,6)&&h.slice_del();break;case 5:h.find_among_b(a,6)&&h.slice_del();break;case 6:h.find_among_b(u,2)&&h.slice_del()}else h.limit_backward=e}(),h.cursor=h.limit,function(){var i,e,r;if(h.cursor>=o)if(e=h.limit_backward,h.limit_backward=o,h.ket=h.cursor,i=h.find_among_b(m,30)){switch(h.bra=h.cursor,h.limit_backward=e,i){case 1:if(!h.eq_s_b(1,"a"))return;break;case 2:case 9:if(!h.eq_s_b(1,"e"))return;break;case 3:if(!h.eq_s_b(1,"i"))return;break;case 4:if(!h.eq_s_b(1,"o"))return;break;case 5:if(!h.eq_s_b(1,"ä"))return;break;case 6:if(!h.eq_s_b(1,"ö"))return;break;case 7:if(r=h.limit-h.cursor,!j()&&(h.cursor=h.limit-r,!h.eq_s_b(2,"ie"))){h.cursor=h.limit-r;break}if(h.cursor=h.limit-r,h.cursor<=h.limit_backward){h.cursor=h.limit-r;break}h.cursor--,h.bra=h.cursor;break;case 8:if(!h.in_grouping_b(d,97,246)||!h.out_grouping_b(d,97,246))return}h.slice_del(),n=!0}else h.limit_backward=e}(),h.cursor=h.limit,function(){var i,e,r;if(h.cursor>=l)if(e=h.limit_backward,h.limit_backward=l,h.ket=h.cursor,i=h.find_among_b(w,14)){if(h.bra=h.cursor,h.limit_backward=e,1==i){if(r=h.limit-h.cursor,h.eq_s_b(2,"po"))return;h.cursor=h.limit-r}h.slice_del()}else h.limit_backward=e}(),h.cursor=h.limit,h.cursor=(n?h.cursor>=o&&(i=h.limit_backward,h.limit_backward=o,h.ket=h.cursor,h.find_among_b(_,2)?(h.bra=h.cursor,h.limit_backward=i,h.slice_del()):h.limit_backward=i):(h.cursor=h.limit,function(){var i,e,r,n,t,s;if(h.cursor>=o){if(e=h.limit_backward,h.limit_backward=o,h.ket=h.cursor,h.eq_s_b(1,"t")&&(h.bra=h.cursor,r=h.limit-h.cursor,h.in_grouping_b(d,97,246)&&(h.cursor=h.limit-r,h.slice_del(),h.limit_backward=e,n=h.limit-h.cursor,h.cursor>=l&&(h.cursor=l,t=h.limit_backward,h.limit_backward=h.cursor,h.cursor=h.limit-n,h.ket=h.cursor,i=h.find_among_b(k,2))))){if(h.bra=h.cursor,h.limit_backward=t,1==i){if(s=h.limit-h.cursor,h.eq_s_b(2,"po"))return;h.cursor=h.limit-s}return h.slice_del()}h.limit_backward=e}}()),h.limit),function(){var i,e,r,n;if(h.cursor>=o){for(i=h.limit_backward,h.limit_backward=o,e=h.limit-h.cursor,j()&&(h.cursor=h.limit-e,h.ket=h.cursor,h.cursor>h.limit_backward&&(h.cursor--,h.bra=h.cursor,h.slice_del())),h.cursor=h.limit-e,h.ket=h.cursor,h.in_grouping_b(b,97,228)&&(h.bra=h.cursor,h.out_grouping_b(d,97,246)&&h.slice_del()),h.cursor=h.limit-e,h.ket=h.cursor,h.eq_s_b(1,"j")&&(h.bra=h.cursor,r=h.limit-h.cursor,h.eq_s_b(1,"o")?h.slice_del():(h.cursor=h.limit-r,h.eq_s_b(1,"u")&&h.slice_del())),h.cursor=h.limit-e,h.ket=h.cursor,h.eq_s_b(1,"o")&&(h.bra=h.cursor,h.eq_s_b(1,"j")&&h.slice_del()),h.cursor=h.limit-e,h.limit_backward=i;;){if(n=h.limit-h.cursor,h.out_grouping_b(d,97,246)){h.cursor=h.limit-n;break}if(h.cursor=h.limit-n,h.cursor<=h.limit_backward)return;h.cursor--}h.ket=h.cursor,h.cursor>h.limit_backward&&(h.cursor--,h.bra=h.cursor,t=h.slice_to(),h.eq_v_b(t)&&h.slice_del())}}(),!0}},function(i){return"function"==typeof i.update?i.update(function(i){return e.setCurrent(i),e.stem(),e.getCurrent()}):(e.setCurrent(i),e.stem(),e.getCurrent())}),i.Pipeline.registerFunction(i.fi.stemmer,"stemmer-fi"),i.fi.stopWordFilter=i.generateStopWordFilter("ei eivät emme en et ette että he heidän heidät heihin heille heillä heiltä heissä heistä heitä hän häneen hänelle hänellä häneltä hänen hänessä hänestä hänet häntä itse ja johon joiden joihin joiksi joilla joille joilta joina joissa joista joita joka joksi jolla jolle jolta jona jonka jos jossa josta jota jotka kanssa keiden keihin keiksi keille keillä keiltä keinä keissä keistä keitä keneen keneksi kenelle kenellä keneltä kenen kenenä kenessä kenestä kenet ketkä ketkä ketä koska kuin kuka kun me meidän meidät meihin meille meillä meiltä meissä meistä meitä mihin miksi mikä mille millä miltä minkä minkä minua minulla minulle minulta minun minussa minusta minut minuun minä minä missä mistä mitkä mitä mukaan mutta ne niiden niihin niiksi niille niillä niiltä niin niin niinä niissä niistä niitä noiden noihin noiksi noilla noille noilta noin noina noissa noista noita nuo nyt näiden näihin näiksi näille näillä näiltä näinä näissä näistä näitä nämä ole olemme olen olet olette oli olimme olin olisi olisimme olisin olisit olisitte olisivat olit olitte olivat olla olleet ollut on ovat poikki se sekä sen siihen siinä siitä siksi sille sillä sillä siltä sinua sinulla sinulle sinulta sinun sinussa sinusta sinut sinuun sinä sinä sitä tai te teidän teidät teihin teille teillä teiltä teissä teistä teitä tuo tuohon tuoksi tuolla tuolle tuolta tuon tuona tuossa tuosta tuota tähän täksi tälle tällä tältä tämä tämän tänä tässä tästä tätä vaan vai vaikka yli".split(" ")),i.Pipeline.registerFunction(i.fi.stopWordFilter,"stopWordFilter-fi")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.fr.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.fr.js
deleted file mode 100644
index d043ec65..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.fr.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `French` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,y,s;e.fr=function(){this.pipeline.reset(),this.pipeline.add(e.fr.trimmer,e.fr.stopWordFilter,e.fr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.fr.stemmer))},e.fr.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.fr.trimmer=e.trimmerSupport.generateTrimmer(e.fr.wordCharacters),e.Pipeline.registerFunction(e.fr.trimmer,"trimmer-fr"),e.fr.stemmer=(r=e.stemmerSupport.Among,y=e.stemmerSupport.SnowballProgram,s=new function(){var s,i,t,n=[new r("col",-1,-1),new r("par",-1,-1),new r("tap",-1,-1)],u=[new r("",-1,4),new r("I",0,1),new r("U",0,2),new r("Y",0,3)],o=[new r("iqU",-1,3),new r("abl",-1,3),new r("Ièr",-1,4),new r("ièr",-1,4),new r("eus",-1,2),new r("iv",-1,1)],c=[new r("ic",-1,2),new r("abil",-1,1),new r("iv",-1,3)],a=[new r("iqUe",-1,1),new r("atrice",-1,2),new r("ance",-1,1),new r("ence",-1,5),new r("logie",-1,3),new r("able",-1,1),new r("isme",-1,1),new r("euse",-1,11),new r("iste",-1,1),new r("ive",-1,8),new r("if",-1,8),new r("usion",-1,4),new r("ation",-1,2),new r("ution",-1,4),new r("ateur",-1,2),new r("iqUes",-1,1),new r("atrices",-1,2),new r("ances",-1,1),new r("ences",-1,5),new r("logies",-1,3),new r("ables",-1,1),new r("ismes",-1,1),new r("euses",-1,11),new r("istes",-1,1),new r("ives",-1,8),new r("ifs",-1,8),new r("usions",-1,4),new r("ations",-1,2),new r("utions",-1,4),new r("ateurs",-1,2),new r("ments",-1,15),new r("ements",30,6),new r("issements",31,12),new r("ités",-1,7),new r("ment",-1,15),new r("ement",34,6),new r("issement",35,12),new r("amment",34,13),new r("emment",34,14),new r("aux",-1,10),new r("eaux",39,9),new r("eux",-1,1),new r("ité",-1,7)],l=[new r("ira",-1,1),new r("ie",-1,1),new r("isse",-1,1),new r("issante",-1,1),new r("i",-1,1),new r("irai",4,1),new r("ir",-1,1),new r("iras",-1,1),new r("ies",-1,1),new r("îmes",-1,1),new r("isses",-1,1),new r("issantes",-1,1),new r("îtes",-1,1),new r("is",-1,1),new r("irais",13,1),new r("issais",13,1),new r("irions",-1,1),new r("issions",-1,1),new r("irons",-1,1),new r("issons",-1,1),new r("issants",-1,1),new r("it",-1,1),new r("irait",21,1),new r("issait",21,1),new r("issant",-1,1),new r("iraIent",-1,1),new r("issaIent",-1,1),new r("irent",-1,1),new r("issent",-1,1),new r("iront",-1,1),new r("ît",-1,1),new r("iriez",-1,1),new r("issiez",-1,1),new r("irez",-1,1),new r("issez",-1,1)],w=[new r("a",-1,3),new r("era",0,2),new r("asse",-1,3),new r("ante",-1,3),new r("ée",-1,2),new r("ai",-1,3),new r("erai",5,2),new r("er",-1,2),new r("as",-1,3),new r("eras",8,2),new r("âmes",-1,3),new r("asses",-1,3),new r("antes",-1,3),new r("âtes",-1,3),new r("ées",-1,2),new r("ais",-1,3),new r("erais",15,2),new r("ions",-1,1),new r("erions",17,2),new r("assions",17,3),new r("erons",-1,2),new r("ants",-1,3),new r("és",-1,2),new r("ait",-1,3),new r("erait",23,2),new r("ant",-1,3),new r("aIent",-1,3),new r("eraIent",26,2),new r("èrent",-1,2),new r("assent",-1,3),new r("eront",-1,2),new r("ât",-1,3),new r("ez",-1,2),new r("iez",32,2),new r("eriez",33,2),new r("assiez",33,3),new r("erez",32,2),new r("é",-1,2)],f=[new r("e",-1,3),new r("Ière",0,2),new r("ière",0,2),new r("ion",-1,1),new r("Ier",-1,2),new r("ier",-1,2),new r("ë",-1,4)],m=[new r("ell",-1,-1),new r("eill",-1,-1),new r("enn",-1,-1),new r("onn",-1,-1),new r("ett",-1,-1)],_=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,128,130,103,8,5],b=[1,65,20,0,0,0,0,0,0,0,0,0,0,0,0,0,128],d=new y;function k(e,r,s){return!(!d.eq_s(1,e)||(d.ket=d.cursor,!d.in_grouping(_,97,251)))&&(d.slice_from(r),d.cursor=s,!0)}function p(e,r,s){return!!d.eq_s(1,e)&&(d.ket=d.cursor,d.slice_from(r),d.cursor=s,!0)}function g(){for(;!d.in_grouping(_,97,251);){if(d.cursor>=d.limit)return!0;d.cursor++}for(;!d.out_grouping(_,97,251);){if(d.cursor>=d.limit)return!0;d.cursor++}return!1}function q(){return t<=d.cursor}function v(){return i<=d.cursor}function h(){return s<=d.cursor}function z(){if(!function(){var e,r;if(d.ket=d.cursor,e=d.find_among_b(a,43)){switch(d.bra=d.cursor,e){case 1:if(!h())return!1;d.slice_del();break;case 2:if(!h())return!1;d.slice_del(),d.ket=d.cursor,d.eq_s_b(2,"ic")&&(d.bra=d.cursor,h()?d.slice_del():d.slice_from("iqU"));break;case 3:if(!h())return!1;d.slice_from("log");break;case 4:if(!h())return!1;d.slice_from("u");break;case 5:if(!h())return!1;d.slice_from("ent");break;case 6:if(!q())return!1;if(d.slice_del(),d.ket=d.cursor,e=d.find_among_b(o,6))switch(d.bra=d.cursor,e){case 1:h()&&(d.slice_del(),d.ket=d.cursor,d.eq_s_b(2,"at")&&(d.bra=d.cursor,h()&&d.slice_del()));break;case 2:h()?d.slice_del():v()&&d.slice_from("eux");break;case 3:h()&&d.slice_del();break;case 4:q()&&d.slice_from("i")}break;case 7:if(!h())return!1;if(d.slice_del(),d.ket=d.cursor,e=d.find_among_b(c,3))switch(d.bra=d.cursor,e){case 1:h()?d.slice_del():d.slice_from("abl");break;case 2:h()?d.slice_del():d.slice_from("iqU");break;case 3:h()&&d.slice_del()}break;case 8:if(!h())return!1;if(d.slice_del(),d.ket=d.cursor,d.eq_s_b(2,"at")&&(d.bra=d.cursor,h()&&(d.slice_del(),d.ket=d.cursor,d.eq_s_b(2,"ic")))){d.bra=d.cursor,h()?d.slice_del():d.slice_from("iqU");break}break;case 9:d.slice_from("eau");break;case 10:if(!v())return!1;d.slice_from("al");break;case 11:if(h())d.slice_del();else{if(!v())return!1;d.slice_from("eux")}break;case 12:if(!v()||!d.out_grouping_b(_,97,251))return!1;d.slice_del();break;case 13:return q()&&d.slice_from("ant"),!1;case 14:return q()&&d.slice_from("ent"),!1;case 15:return r=d.limit-d.cursor,d.in_grouping_b(_,97,251)&&q()&&(d.cursor=d.limit-r,d.slice_del()),!1}return!0}return!1}()&&(d.cursor=d.limit,!function(){var e,r;if(d.cursor<t)return!1;if(r=d.limit_backward,d.limit_backward=t,d.ket=d.cursor,!(e=d.find_among_b(l,35)))return d.limit_backward=r,!1;if(d.bra=d.cursor,1==e){if(!d.out_grouping_b(_,97,251))return d.limit_backward=r,!1;d.slice_del()}return d.limit_backward=r,!0}()&&(d.cursor=d.limit,!function(){var e,r,s;if(d.cursor<t)return!1;if(r=d.limit_backward,d.limit_backward=t,d.ket=d.cursor,!(e=d.find_among_b(w,38)))return d.limit_backward=r,!1;switch(d.bra=d.cursor,e){case 1:if(!h())return d.limit_backward=r,!1;d.slice_del();break;case 2:d.slice_del();break;case 3:d.slice_del(),s=d.limit-d.cursor,d.ket=d.cursor,d.eq_s_b(1,"e")?(d.bra=d.cursor,d.slice_del()):d.cursor=d.limit-s}return d.limit_backward=r,!0}())))return d.cursor=d.limit,void function(){var e,r,s,i,n=d.limit-d.cursor;if(d.ket=d.cursor,d.eq_s_b(1,"s")?(d.bra=d.cursor,r=d.limit-d.cursor,d.out_grouping_b(b,97,232)?(d.cursor=d.limit-r,d.slice_del()):d.cursor=d.limit-n):d.cursor=d.limit-n,d.cursor>=t){if(s=d.limit_backward,d.limit_backward=t,d.ket=d.cursor,e=d.find_among_b(f,7))switch(d.bra=d.cursor,e){case 1:if(h()){if(i=d.limit-d.cursor,!d.eq_s_b(1,"s")&&(d.cursor=d.limit-i,!d.eq_s_b(1,"t")))break;d.slice_del()}break;case 2:d.slice_from("i");break;case 3:d.slice_del();break;case 4:d.eq_s_b(2,"gu")&&d.slice_del()}d.limit_backward=s}}();d.cursor=d.limit,d.ket=d.cursor,d.eq_s_b(1,"Y")?(d.bra=d.cursor,d.slice_from("i")):(d.cursor=d.limit,d.eq_s_b(1,"ç")&&(d.bra=d.cursor,d.slice_from("c")))}this.setCurrent=function(e){d.setCurrent(e)},this.getCurrent=function(){return d.getCurrent()},this.stem=function(){var e,r=d.cursor;return function(){for(var e,r;;){if(e=d.cursor,d.in_grouping(_,97,251)){if(d.bra=d.cursor,r=d.cursor,k("u","U",e))continue;if(d.cursor=r,k("i","I",e))continue;if(d.cursor=r,p("y","Y",e))continue}if(d.cursor=e,!k("y","Y",d.bra=e)){if(d.cursor=e,d.eq_s(1,"q")&&(d.bra=d.cursor,p("u","U",e)))continue;if((d.cursor=e)>=d.limit)return;d.cursor++}}}(),d.cursor=r,function(){var e=d.cursor;if(t=d.limit,s=i=t,d.in_grouping(_,97,251)&&d.in_grouping(_,97,251)&&d.cursor<d.limit)d.cursor++;else if(d.cursor=e,!d.find_among(n,3)){d.cursor=e;do{if(d.cursor>=d.limit){d.cursor=t;break}d.cursor++}while(!d.in_grouping(_,97,251))}t=d.cursor,d.cursor=e,g()||(i=d.cursor,g()||(s=d.cursor))}(),d.limit_backward=r,d.cursor=d.limit,z(),d.cursor=d.limit,e=d.limit-d.cursor,d.find_among_b(m,5)&&(d.cursor=d.limit-e,d.ket=d.cursor,d.cursor>d.limit_backward&&(d.cursor--,d.bra=d.cursor,d.slice_del())),d.cursor=d.limit,function(){for(var e,r=1;d.out_grouping_b(_,97,251);)r--;if(r<=0){if(d.ket=d.cursor,e=d.limit-d.cursor,!d.eq_s_b(1,"é")&&(d.cursor=d.limit-e,!d.eq_s_b(1,"è")))return;d.bra=d.cursor,d.slice_from("e")}}(),d.cursor=d.limit_backward,function(){for(var e,r;r=d.cursor,d.bra=r,e=d.find_among(u,4);)switch(d.ket=d.cursor,e){case 1:d.slice_from("i");break;case 2:d.slice_from("u");break;case 3:d.slice_from("y");break;case 4:if(d.cursor>=d.limit)return;d.cursor++}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return s.setCurrent(e),s.stem(),s.getCurrent()}):(s.setCurrent(e),s.stem(),s.getCurrent())}),e.Pipeline.registerFunction(e.fr.stemmer,"stemmer-fr"),e.fr.stopWordFilter=e.generateStopWordFilter("ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes".split(" ")),e.Pipeline.registerFunction(e.fr.stopWordFilter,"stopWordFilter-fr")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.hu.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.hu.js
deleted file mode 100644
index bfc68db8..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.hu.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Hungarian` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var p,_,n;e.hu=function(){this.pipeline.reset(),this.pipeline.add(e.hu.trimmer,e.hu.stopWordFilter,e.hu.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.hu.stemmer))},e.hu.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.hu.trimmer=e.trimmerSupport.generateTrimmer(e.hu.wordCharacters),e.Pipeline.registerFunction(e.hu.trimmer,"trimmer-hu"),e.hu.stemmer=(p=e.stemmerSupport.Among,_=e.stemmerSupport.SnowballProgram,n=new function(){var r,i=[new p("cs",-1,-1),new p("dzs",-1,-1),new p("gy",-1,-1),new p("ly",-1,-1),new p("ny",-1,-1),new p("sz",-1,-1),new p("ty",-1,-1),new p("zs",-1,-1)],n=[new p("á",-1,1),new p("é",-1,2)],a=[new p("bb",-1,-1),new p("cc",-1,-1),new p("dd",-1,-1),new p("ff",-1,-1),new p("gg",-1,-1),new p("jj",-1,-1),new p("kk",-1,-1),new p("ll",-1,-1),new p("mm",-1,-1),new p("nn",-1,-1),new p("pp",-1,-1),new p("rr",-1,-1),new p("ccs",-1,-1),new p("ss",-1,-1),new p("zzs",-1,-1),new p("tt",-1,-1),new p("vv",-1,-1),new p("ggy",-1,-1),new p("lly",-1,-1),new p("nny",-1,-1),new p("tty",-1,-1),new p("ssz",-1,-1),new p("zz",-1,-1)],t=[new p("al",-1,1),new p("el",-1,2)],e=[new p("ba",-1,-1),new p("ra",-1,-1),new p("be",-1,-1),new p("re",-1,-1),new p("ig",-1,-1),new p("nak",-1,-1),new p("nek",-1,-1),new p("val",-1,-1),new p("vel",-1,-1),new p("ul",-1,-1),new p("nál",-1,-1),new p("nél",-1,-1),new p("ból",-1,-1),new p("ról",-1,-1),new p("tól",-1,-1),new p("bõl",-1,-1),new p("rõl",-1,-1),new p("tõl",-1,-1),new p("ül",-1,-1),new p("n",-1,-1),new p("an",19,-1),new p("ban",20,-1),new p("en",19,-1),new p("ben",22,-1),new p("képpen",22,-1),new p("on",19,-1),new p("ön",19,-1),new p("képp",-1,-1),new p("kor",-1,-1),new p("t",-1,-1),new p("at",29,-1),new p("et",29,-1),new p("ként",29,-1),new p("anként",32,-1),new p("enként",32,-1),new p("onként",32,-1),new p("ot",29,-1),new p("ért",29,-1),new p("öt",29,-1),new p("hez",-1,-1),new p("hoz",-1,-1),new p("höz",-1,-1),new p("vá",-1,-1),new p("vé",-1,-1)],s=[new p("án",-1,2),new p("én",-1,1),new p("ánként",-1,3)],c=[new p("stul",-1,2),new p("astul",0,1),new p("ástul",0,3),new p("stül",-1,2),new p("estül",3,1),new p("éstül",3,4)],w=[new p("á",-1,1),new p("é",-1,2)],o=[new p("k",-1,7),new p("ak",0,4),new p("ek",0,6),new p("ok",0,5),new p("ák",0,1),new p("ék",0,2),new p("ök",0,3)],l=[new p("éi",-1,7),new p("áéi",0,6),new p("ééi",0,5),new p("é",-1,9),new p("ké",3,4),new p("aké",4,1),new p("eké",4,1),new p("oké",4,1),new p("áké",4,3),new p("éké",4,2),new p("öké",4,1),new p("éé",3,8)],u=[new p("a",-1,18),new p("ja",0,17),new p("d",-1,16),new p("ad",2,13),new p("ed",2,13),new p("od",2,13),new p("ád",2,14),new p("éd",2,15),new p("öd",2,13),new p("e",-1,18),new p("je",9,17),new p("nk",-1,4),new p("unk",11,1),new p("ánk",11,2),new p("énk",11,3),new p("ünk",11,1),new p("uk",-1,8),new p("juk",16,7),new p("ájuk",17,5),new p("ük",-1,8),new p("jük",19,7),new p("éjük",20,6),new p("m",-1,12),new p("am",22,9),new p("em",22,9),new p("om",22,9),new p("ám",22,10),new p("ém",22,11),new p("o",-1,18),new p("á",-1,19),new p("é",-1,20)],m=[new p("id",-1,10),new p("aid",0,9),new p("jaid",1,6),new p("eid",0,9),new p("jeid",3,6),new p("áid",0,7),new p("éid",0,8),new p("i",-1,15),new p("ai",7,14),new p("jai",8,11),new p("ei",7,14),new p("jei",10,11),new p("ái",7,12),new p("éi",7,13),new p("itek",-1,24),new p("eitek",14,21),new p("jeitek",15,20),new p("éitek",14,23),new p("ik",-1,29),new p("aik",18,26),new p("jaik",19,25),new p("eik",18,26),new p("jeik",21,25),new p("áik",18,27),new p("éik",18,28),new p("ink",-1,20),new p("aink",25,17),new p("jaink",26,16),new p("eink",25,17),new p("jeink",28,16),new p("áink",25,18),new p("éink",25,19),new p("aitok",-1,21),new p("jaitok",32,20),new p("áitok",-1,22),new p("im",-1,5),new p("aim",35,4),new p("jaim",36,1),new p("eim",35,4),new p("jeim",38,1),new p("áim",35,2),new p("éim",35,3)],k=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,1,17,52,14],f=new _;function b(){return r<=f.cursor}function d(){var e=f.limit-f.cursor;return!!f.find_among_b(a,23)&&(f.cursor=f.limit-e,!0)}function g(){if(f.cursor>f.limit_backward){f.cursor--,f.ket=f.cursor;var e=f.cursor-1;f.limit_backward<=e&&e<=f.limit&&(f.cursor=e,f.bra=e,f.slice_del())}}function h(){f.ket=f.cursor,f.find_among_b(e,44)&&(f.bra=f.cursor,b()&&(f.slice_del(),function(){var e;if(f.ket=f.cursor,(e=f.find_among_b(n,2))&&(f.bra=f.cursor,b()))switch(e){case 1:f.slice_from("a");break;case 2:f.slice_from("e")}}()))}this.setCurrent=function(e){f.setCurrent(e)},this.getCurrent=function(){return f.getCurrent()},this.stem=function(){var e=f.cursor;return function(){var e,n=f.cursor;if(r=f.limit,f.in_grouping(k,97,252))for(;;){if(e=f.cursor,f.out_grouping(k,97,252))return f.cursor=e,f.find_among(i,8)||(f.cursor=e)<f.limit&&f.cursor++,r=f.cursor;if((f.cursor=e)>=f.limit)return r=e;f.cursor++}if(f.cursor=n,f.out_grouping(k,97,252)){for(;!f.in_grouping(k,97,252);){if(f.cursor>=f.limit)return;f.cursor++}r=f.cursor}}(),f.limit_backward=e,f.cursor=f.limit,function(){var e;if(f.ket=f.cursor,(e=f.find_among_b(t,2))&&(f.bra=f.cursor,b())){if((1==e||2==e)&&!d())return;f.slice_del(),g()}}(),f.cursor=f.limit,h(),f.cursor=f.limit,function(){var e;if(f.ket=f.cursor,(e=f.find_among_b(s,3))&&(f.bra=f.cursor,b()))switch(e){case 1:f.slice_from("e");break;case 2:case 3:f.slice_from("a")}}(),f.cursor=f.limit,function(){var e;if(f.ket=f.cursor,(e=f.find_among_b(c,6))&&(f.bra=f.cursor,b()))switch(e){case 1:case 2:f.slice_del();break;case 3:f.slice_from("a");break;case 4:f.slice_from("e")}}(),f.cursor=f.limit,function(){var e;if(f.ket=f.cursor,(e=f.find_among_b(w,2))&&(f.bra=f.cursor,b())){if((1==e||2==e)&&!d())return;f.slice_del(),g()}}(),f.cursor=f.limit,function(){var e;if(f.ket=f.cursor,(e=f.find_among_b(l,12))&&(f.bra=f.cursor,b()))switch(e){case 1:case 4:case 7:case 9:f.slice_del();break;case 2:case 5:case 8:f.slice_from("e");break;case 3:case 6:f.slice_from("a")}}(),f.cursor=f.limit,function(){var e;if(f.ket=f.cursor,(e=f.find_among_b(u,31))&&(f.bra=f.cursor,b()))switch(e){case 1:case 4:case 7:case 8:case 9:case 12:case 13:case 16:case 17:case 18:f.slice_del();break;case 2:case 5:case 10:case 14:case 19:f.slice_from("a");break;case 3:case 6:case 11:case 15:case 20:f.slice_from("e")}}(),f.cursor=f.limit,function(){var e;if(f.ket=f.cursor,(e=f.find_among_b(m,42))&&(f.bra=f.cursor,b()))switch(e){case 1:case 4:case 5:case 6:case 9:case 10:case 11:case 14:case 15:case 16:case 17:case 20:case 21:case 24:case 25:case 26:case 29:f.slice_del();break;case 2:case 7:case 12:case 18:case 22:case 27:f.slice_from("a");break;case 3:case 8:case 13:case 19:case 23:case 28:f.slice_from("e")}}(),f.cursor=f.limit,function(){var e;if(f.ket=f.cursor,(e=f.find_among_b(o,7))&&(f.bra=f.cursor,b()))switch(e){case 1:f.slice_from("a");break;case 2:f.slice_from("e");break;case 3:case 4:case 5:case 6:case 7:f.slice_del()}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}),e.Pipeline.registerFunction(e.hu.stemmer,"stemmer-hu"),e.hu.stopWordFilter=e.generateStopWordFilter("a abban ahhoz ahogy ahol aki akik akkor alatt amely amelyek amelyekben amelyeket amelyet amelynek ami amikor amit amolyan amíg annak arra arról az azok azon azonban azt aztán azután azzal azért be belül benne bár cikk cikkek cikkeket csak de e ebben eddig egy egyes egyetlen egyik egyre egyéb egész ehhez ekkor el ellen elsõ elég elõ elõször elõtt emilyen ennek erre ez ezek ezen ezt ezzel ezért fel felé hanem hiszen hogy hogyan igen ill ill. illetve ilyen ilyenkor ismét ison itt jobban jó jól kell kellett keressünk keresztül ki kívül között közül legalább legyen lehet lehetett lenne lenni lesz lett maga magát majd majd meg mellett mely melyek mert mi mikor milyen minden mindenki mindent mindig mint mintha mit mivel miért most már más másik még míg nagy nagyobb nagyon ne nekem neki nem nincs néha néhány nélkül olyan ott pedig persze rá s saját sem semmi sok sokat sokkal szemben szerint szinte számára talán tehát teljes tovább továbbá több ugyanis utolsó után utána vagy vagyis vagyok valaki valami valamint való van vannak vele vissza viszont volna volt voltak voltam voltunk által általában át én éppen és így õ õk õket össze úgy új újabb újra".split(" ")),e.Pipeline.registerFunction(e.hu.stopWordFilter,"stopWordFilter-hu")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.it.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.it.js
deleted file mode 100644
index 58a46fb6..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.it.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Italian` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var z,P,r;e.it=function(){this.pipeline.reset(),this.pipeline.add(e.it.trimmer,e.it.stopWordFilter,e.it.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.it.stemmer))},e.it.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.it.trimmer=e.trimmerSupport.generateTrimmer(e.it.wordCharacters),e.Pipeline.registerFunction(e.it.trimmer,"trimmer-it"),e.it.stemmer=(z=e.stemmerSupport.Among,P=e.stemmerSupport.SnowballProgram,r=new function(){var o,t,s,a=[new z("",-1,7),new z("qu",0,6),new z("á",0,1),new z("é",0,2),new z("í",0,3),new z("ó",0,4),new z("ú",0,5)],u=[new z("",-1,3),new z("I",0,1),new z("U",0,2)],c=[new z("la",-1,-1),new z("cela",0,-1),new z("gliela",0,-1),new z("mela",0,-1),new z("tela",0,-1),new z("vela",0,-1),new z("le",-1,-1),new z("cele",6,-1),new z("gliele",6,-1),new z("mele",6,-1),new z("tele",6,-1),new z("vele",6,-1),new z("ne",-1,-1),new z("cene",12,-1),new z("gliene",12,-1),new z("mene",12,-1),new z("sene",12,-1),new z("tene",12,-1),new z("vene",12,-1),new z("ci",-1,-1),new z("li",-1,-1),new z("celi",20,-1),new z("glieli",20,-1),new z("meli",20,-1),new z("teli",20,-1),new z("veli",20,-1),new z("gli",20,-1),new z("mi",-1,-1),new z("si",-1,-1),new z("ti",-1,-1),new z("vi",-1,-1),new z("lo",-1,-1),new z("celo",31,-1),new z("glielo",31,-1),new z("melo",31,-1),new z("telo",31,-1),new z("velo",31,-1)],w=[new z("ando",-1,1),new z("endo",-1,1),new z("ar",-1,2),new z("er",-1,2),new z("ir",-1,2)],r=[new z("ic",-1,-1),new z("abil",-1,-1),new z("os",-1,-1),new z("iv",-1,1)],n=[new z("ic",-1,1),new z("abil",-1,1),new z("iv",-1,1)],i=[new z("ica",-1,1),new z("logia",-1,3),new z("osa",-1,1),new z("ista",-1,1),new z("iva",-1,9),new z("anza",-1,1),new z("enza",-1,5),new z("ice",-1,1),new z("atrice",7,1),new z("iche",-1,1),new z("logie",-1,3),new z("abile",-1,1),new z("ibile",-1,1),new z("usione",-1,4),new z("azione",-1,2),new z("uzione",-1,4),new z("atore",-1,2),new z("ose",-1,1),new z("ante",-1,1),new z("mente",-1,1),new z("amente",19,7),new z("iste",-1,1),new z("ive",-1,9),new z("anze",-1,1),new z("enze",-1,5),new z("ici",-1,1),new z("atrici",25,1),new z("ichi",-1,1),new z("abili",-1,1),new z("ibili",-1,1),new z("ismi",-1,1),new z("usioni",-1,4),new z("azioni",-1,2),new z("uzioni",-1,4),new z("atori",-1,2),new z("osi",-1,1),new z("anti",-1,1),new z("amenti",-1,6),new z("imenti",-1,6),new z("isti",-1,1),new z("ivi",-1,9),new z("ico",-1,1),new z("ismo",-1,1),new z("oso",-1,1),new z("amento",-1,6),new z("imento",-1,6),new z("ivo",-1,9),new z("ità",-1,8),new z("istà",-1,1),new z("istè",-1,1),new z("istì",-1,1)],l=[new z("isca",-1,1),new z("enda",-1,1),new z("ata",-1,1),new z("ita",-1,1),new z("uta",-1,1),new z("ava",-1,1),new z("eva",-1,1),new z("iva",-1,1),new z("erebbe",-1,1),new z("irebbe",-1,1),new z("isce",-1,1),new z("ende",-1,1),new z("are",-1,1),new z("ere",-1,1),new z("ire",-1,1),new z("asse",-1,1),new z("ate",-1,1),new z("avate",16,1),new z("evate",16,1),new z("ivate",16,1),new z("ete",-1,1),new z("erete",20,1),new z("irete",20,1),new z("ite",-1,1),new z("ereste",-1,1),new z("ireste",-1,1),new z("ute",-1,1),new z("erai",-1,1),new z("irai",-1,1),new z("isci",-1,1),new z("endi",-1,1),new z("erei",-1,1),new z("irei",-1,1),new z("assi",-1,1),new z("ati",-1,1),new z("iti",-1,1),new z("eresti",-1,1),new z("iresti",-1,1),new z("uti",-1,1),new z("avi",-1,1),new z("evi",-1,1),new z("ivi",-1,1),new z("isco",-1,1),new z("ando",-1,1),new z("endo",-1,1),new z("Yamo",-1,1),new z("iamo",-1,1),new z("avamo",-1,1),new z("evamo",-1,1),new z("ivamo",-1,1),new z("eremo",-1,1),new z("iremo",-1,1),new z("assimo",-1,1),new z("ammo",-1,1),new z("emmo",-1,1),new z("eremmo",54,1),new z("iremmo",54,1),new z("immo",-1,1),new z("ano",-1,1),new z("iscano",58,1),new z("avano",58,1),new z("evano",58,1),new z("ivano",58,1),new z("eranno",-1,1),new z("iranno",-1,1),new z("ono",-1,1),new z("iscono",65,1),new z("arono",65,1),new z("erono",65,1),new z("irono",65,1),new z("erebbero",-1,1),new z("irebbero",-1,1),new z("assero",-1,1),new z("essero",-1,1),new z("issero",-1,1),new z("ato",-1,1),new z("ito",-1,1),new z("uto",-1,1),new z("avo",-1,1),new z("evo",-1,1),new z("ivo",-1,1),new z("ar",-1,1),new z("ir",-1,1),new z("erà",-1,1),new z("irà",-1,1),new z("erò",-1,1),new z("irò",-1,1)],m=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2,1],f=[17,65,0,0,0,0,0,0,0,0,0,0,0,0,0,128,128,8,2],v=[17],b=new P;function d(e,r,n){return!(!b.eq_s(1,e)||(b.ket=b.cursor,!b.in_grouping(m,97,249)))&&(b.slice_from(r),b.cursor=n,!0)}function _(e){if(b.cursor=e,!b.in_grouping(m,97,249))return!1;for(;!b.out_grouping(m,97,249);){if(b.cursor>=b.limit)return!1;b.cursor++}return!0}function g(){var e,r=b.cursor;if(!function(){if(b.in_grouping(m,97,249)){var e=b.cursor;if(b.out_grouping(m,97,249)){for(;!b.in_grouping(m,97,249);){if(b.cursor>=b.limit)return _(e);b.cursor++}return!0}return _(e)}return!1}()){if(b.cursor=r,!b.out_grouping(m,97,249))return;if(e=b.cursor,b.out_grouping(m,97,249)){for(;!b.in_grouping(m,97,249);){if(b.cursor>=b.limit)return b.cursor=e,void(b.in_grouping(m,97,249)&&b.cursor<b.limit&&b.cursor++);b.cursor++}return void(s=b.cursor)}if(b.cursor=e,!b.in_grouping(m,97,249)||b.cursor>=b.limit)return;b.cursor++}s=b.cursor}function p(){for(;!b.in_grouping(m,97,249);){if(b.cursor>=b.limit)return!1;b.cursor++}for(;!b.out_grouping(m,97,249);){if(b.cursor>=b.limit)return!1;b.cursor++}return!0}function k(){return s<=b.cursor}function h(){return o<=b.cursor}function q(){var e;if(b.ket=b.cursor,!(e=b.find_among_b(i,51)))return!1;switch(b.bra=b.cursor,e){case 1:if(!h())return!1;b.slice_del();break;case 2:if(!h())return!1;b.slice_del(),b.ket=b.cursor,b.eq_s_b(2,"ic")&&(b.bra=b.cursor,h()&&b.slice_del());break;case 3:if(!h())return!1;b.slice_from("log");break;case 4:if(!h())return!1;b.slice_from("u");break;case 5:if(!h())return!1;b.slice_from("ente");break;case 6:if(!k())return!1;b.slice_del();break;case 7:if(!(t<=b.cursor))return!1;b.slice_del(),b.ket=b.cursor,(e=b.find_among_b(r,4))&&(b.bra=b.cursor,h()&&(b.slice_del(),1==e&&(b.ket=b.cursor,b.eq_s_b(2,"at")&&(b.bra=b.cursor,h()&&b.slice_del()))));break;case 8:if(!h())return!1;b.slice_del(),b.ket=b.cursor,(e=b.find_among_b(n,3))&&(b.bra=b.cursor,1==e&&h()&&b.slice_del());break;case 9:if(!h())return!1;b.slice_del(),b.ket=b.cursor,b.eq_s_b(2,"at")&&(b.bra=b.cursor,h()&&(b.slice_del(),b.ket=b.cursor,b.eq_s_b(2,"ic")&&(b.bra=b.cursor,h()&&b.slice_del())))}return!0}function C(){var e;e=b.limit-b.cursor,b.ket=b.cursor,b.in_grouping_b(f,97,242)&&(b.bra=b.cursor,k()&&(b.slice_del(),b.ket=b.cursor,b.eq_s_b(1,"i")&&(b.bra=b.cursor,k())))?b.slice_del():b.cursor=b.limit-e,b.ket=b.cursor,b.eq_s_b(1,"h")&&(b.bra=b.cursor,b.in_grouping_b(v,99,103)&&k()&&b.slice_del())}this.setCurrent=function(e){b.setCurrent(e)},this.getCurrent=function(){return b.getCurrent()},this.stem=function(){var e,r,n,i=b.cursor;return function(){for(var e,r,n,i,o=b.cursor;;){if(b.bra=b.cursor,e=b.find_among(a,7))switch(b.ket=b.cursor,e){case 1:b.slice_from("à");continue;case 2:b.slice_from("è");continue;case 3:b.slice_from("ì");continue;case 4:b.slice_from("ò");continue;case 5:b.slice_from("ù");continue;case 6:b.slice_from("qU");continue;case 7:if(b.cursor>=b.limit)break;b.cursor++;continue}break}for(b.cursor=o;;)for(r=b.cursor;;){if(n=b.cursor,b.in_grouping(m,97,249)){if(b.bra=b.cursor,i=b.cursor,d("u","U",n))break;if(b.cursor=i,d("i","I",n))break}if(b.cursor=n,b.cursor>=b.limit)return b.cursor=r;b.cursor++}}(),b.cursor=i,e=b.cursor,s=b.limit,o=t=s,g(),b.cursor=e,p()&&(t=b.cursor,p()&&(o=b.cursor)),b.limit_backward=i,b.cursor=b.limit,function(){var e;if(b.ket=b.cursor,b.find_among_b(c,37)&&(b.bra=b.cursor,(e=b.find_among_b(w,5))&&k()))switch(e){case 1:b.slice_del();break;case 2:b.slice_from("e")}}(),b.cursor=b.limit,q()||(b.cursor=b.limit,b.cursor>=s&&(n=b.limit_backward,b.limit_backward=s,b.ket=b.cursor,(r=b.find_among_b(l,87))&&(b.bra=b.cursor,1==r&&b.slice_del()),b.limit_backward=n)),b.cursor=b.limit,C(),b.cursor=b.limit_backward,function(){for(var e;b.bra=b.cursor,e=b.find_among(u,3);)switch(b.ket=b.cursor,e){case 1:b.slice_from("i");break;case 2:b.slice_from("u");break;case 3:if(b.cursor>=b.limit)return;b.cursor++}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return r.setCurrent(e),r.stem(),r.getCurrent()}):(r.setCurrent(e),r.stem(),r.getCurrent())}),e.Pipeline.registerFunction(e.it.stemmer,"stemmer-it"),e.it.stopWordFilter=e.generateStopWordFilter("a abbia abbiamo abbiano abbiate ad agl agli ai al all alla alle allo anche avemmo avendo avesse avessero avessi avessimo aveste avesti avete aveva avevamo avevano avevate avevi avevo avrai avranno avrebbe avrebbero avrei avremmo avremo avreste avresti avrete avrà avrò avuta avute avuti avuto c che chi ci coi col come con contro cui da dagl dagli dai dal dall dalla dalle dallo degl degli dei del dell della delle dello di dov dove e ebbe ebbero ebbi ed era erano eravamo eravate eri ero essendo faccia facciamo facciano facciate faccio facemmo facendo facesse facessero facessi facessimo faceste facesti faceva facevamo facevano facevate facevi facevo fai fanno farai faranno farebbe farebbero farei faremmo faremo fareste faresti farete farà farò fece fecero feci fosse fossero fossi fossimo foste fosti fu fui fummo furono gli ha hai hanno ho i il in io l la le lei li lo loro lui ma mi mia mie miei mio ne negl negli nei nel nell nella nelle nello noi non nostra nostre nostri nostro o per perché più quale quanta quante quanti quanto quella quelle quelli quello questa queste questi questo sarai saranno sarebbe sarebbero sarei saremmo saremo sareste saresti sarete sarà sarò se sei si sia siamo siano siate siete sono sta stai stando stanno starai staranno starebbe starebbero starei staremmo staremo stareste staresti starete starà starò stava stavamo stavano stavate stavi stavo stemmo stesse stessero stessi stessimo steste stesti stette stettero stetti stia stiamo stiano stiate sto su sua sue sugl sugli sui sul sull sulla sulle sullo suo suoi ti tra tu tua tue tuo tuoi tutti tutto un una uno vi voi vostra vostre vostri vostro è".split(" ")),e.Pipeline.registerFunction(e.it.stopWordFilter,"stopWordFilter-it")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.ja.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.ja.js
deleted file mode 100644
index 715b834a..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.ja.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Japanese` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Chad Liu
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(m){if(void 0===m)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===m.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var l="2"==m.version[0];m.ja=function(){this.pipeline.reset(),this.pipeline.add(m.ja.trimmer,m.ja.stopWordFilter,m.ja.stemmer),l?this.tokenizer=m.ja.tokenizer:(m.tokenizer&&(m.tokenizer=m.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=m.ja.tokenizer))};var j=new m.TinySegmenter;m.ja.tokenizer=function(e){var r,t,i,n,o,s,p,a,u;if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return l?new m.Token(e.toLowerCase()):e.toLowerCase()});for(r=(t=e.toString().toLowerCase().replace(/^\s+/,"")).length-1;0<=r;r--)if(/\S/.test(t.charAt(r))){t=t.substring(0,r+1);break}for(o=[],i=t.length,p=a=0;a<=i;a++)if(s=a-p,t.charAt(a).match(/\s/)||a==i){if(0<s)for(n=j.segment(t.slice(p,a)).filter(function(e){return!!e}),u=p,r=0;r<n.length;r++)l?o.push(new m.Token(n[r],{position:[u,n[r].length],index:o.length})):o.push(n[r]),u+=n[r].length;p=a+1}return o},m.ja.stemmer=function(e){return e},m.Pipeline.registerFunction(m.ja.stemmer,"stemmer-ja"),m.ja.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9",m.ja.trimmer=m.trimmerSupport.generateTrimmer(m.ja.wordCharacters),m.Pipeline.registerFunction(m.ja.trimmer,"trimmer-ja"),m.ja.stopWordFilter=m.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),m.Pipeline.registerFunction(m.ja.stopWordFilter,"stopWordFilter-ja"),m.jp=m.ja,m.Pipeline.registerFunction(m.jp.stemmer,"stemmer-jp"),m.Pipeline.registerFunction(m.jp.trimmer,"trimmer-jp"),m.Pipeline.registerFunction(m.jp.stopWordFilter,"stopWordFilter-jp")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.jp.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.jp.js
deleted file mode 100644
index c055ebaf..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.jp.js
+++ /dev/null
@@ -1 +0,0 @@
-module.exports=require("./lunr.ja"); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.multi.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.multi.js
deleted file mode 100644
index b8c297ea..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.multi.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(e.lunr)}(this,function(){return function(o){o.multiLanguage=function(){for(var e=Array.prototype.slice.call(arguments),t=e.join("-"),i="",r=[],n=[],s=0;s<e.length;++s)"en"==e[s]?(i+="\\w",r.unshift(o.stopWordFilter),r.push(o.stemmer),n.push(o.stemmer)):(i+=o[e[s]].wordCharacters,o[e[s]].stopWordFilter&&r.unshift(o[e[s]].stopWordFilter),o[e[s]].stemmer&&(r.push(o[e[s]].stemmer),n.push(o[e[s]].stemmer)));var p=o.trimmerSupport.generateTrimmer(i);return o.Pipeline.registerFunction(p,"lunr-multi-trimmer-"+t),r.unshift(p),function(){this.pipeline.reset(),this.pipeline.add.apply(this.pipeline,r),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add.apply(this.searchPipeline,n))}}}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.nl.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.nl.js
deleted file mode 100644
index 19d42f44..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.nl.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Dutch` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(r,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():e()(r.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var v,q,e;r.nl=function(){this.pipeline.reset(),this.pipeline.add(r.nl.trimmer,r.nl.stopWordFilter,r.nl.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(r.nl.stemmer))},r.nl.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.nl.trimmer=r.trimmerSupport.generateTrimmer(r.nl.wordCharacters),r.Pipeline.registerFunction(r.nl.trimmer,"trimmer-nl"),r.nl.stemmer=(v=r.stemmerSupport.Among,q=r.stemmerSupport.SnowballProgram,e=new function(){var e,i,u,o=[new v("",-1,6),new v("á",0,1),new v("ä",0,1),new v("é",0,2),new v("ë",0,2),new v("í",0,3),new v("ï",0,3),new v("ó",0,4),new v("ö",0,4),new v("ú",0,5),new v("ü",0,5)],n=[new v("",-1,3),new v("I",0,2),new v("Y",0,1)],t=[new v("dd",-1,-1),new v("kk",-1,-1),new v("tt",-1,-1)],c=[new v("ene",-1,2),new v("se",-1,3),new v("en",-1,2),new v("heden",2,1),new v("s",-1,3)],a=[new v("end",-1,1),new v("ig",-1,2),new v("ing",-1,1),new v("lijk",-1,3),new v("baar",-1,4),new v("bar",-1,5)],l=[new v("aa",-1,-1),new v("ee",-1,-1),new v("oo",-1,-1),new v("uu",-1,-1)],m=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],d=[1,0,0,17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],f=[17,67,16,1,0,0,0,0,0,0,0,0,0,0,0,0,128],_=new q;function s(r){return(_.cursor=r)>=_.limit||(_.cursor++,!1)}function w(){for(;!_.in_grouping(m,97,232);){if(_.cursor>=_.limit)return!0;_.cursor++}for(;!_.out_grouping(m,97,232);){if(_.cursor>=_.limit)return!0;_.cursor++}return!1}function b(){return i<=_.cursor}function p(){return e<=_.cursor}function g(){var r=_.limit-_.cursor;_.find_among_b(t,3)&&(_.cursor=_.limit-r,_.ket=_.cursor,_.cursor>_.limit_backward&&(_.cursor--,_.bra=_.cursor,_.slice_del()))}function h(){var r;u=!1,_.ket=_.cursor,_.eq_s_b(1,"e")&&(_.bra=_.cursor,b()&&(r=_.limit-_.cursor,_.out_grouping_b(m,97,232)&&(_.cursor=_.limit-r,_.slice_del(),u=!0,g())))}function k(){var r;b()&&(r=_.limit-_.cursor,_.out_grouping_b(m,97,232)&&(_.cursor=_.limit-r,_.eq_s_b(3,"gem")||(_.cursor=_.limit-r,_.slice_del(),g())))}this.setCurrent=function(r){_.setCurrent(r)},this.getCurrent=function(){return _.getCurrent()},this.stem=function(){var r=_.cursor;return function(){for(var r,e,i,n=_.cursor;;){if(_.bra=_.cursor,r=_.find_among(o,11))switch(_.ket=_.cursor,r){case 1:_.slice_from("a");continue;case 2:_.slice_from("e");continue;case 3:_.slice_from("i");continue;case 4:_.slice_from("o");continue;case 5:_.slice_from("u");continue;case 6:if(_.cursor>=_.limit)break;_.cursor++;continue}break}for(_.cursor=n,_.bra=n,_.eq_s(1,"y")?(_.ket=_.cursor,_.slice_from("Y")):_.cursor=n;;)if(e=_.cursor,_.in_grouping(m,97,232)){if(i=_.cursor,_.bra=i,_.eq_s(1,"i"))_.ket=_.cursor,_.in_grouping(m,97,232)&&(_.slice_from("I"),_.cursor=e);else if(_.cursor=i,_.eq_s(1,"y"))_.ket=_.cursor,_.slice_from("Y"),_.cursor=e;else if(s(e))break}else if(s(e))break}(),_.cursor=r,i=_.limit,e=i,w()||((i=_.cursor)<3&&(i=3),w()||(e=_.cursor)),_.limit_backward=r,_.cursor=_.limit,function(){var r,e,i,n,o,t,s=_.limit-_.cursor;if(_.ket=_.cursor,r=_.find_among_b(c,5))switch(_.bra=_.cursor,r){case 1:b()&&_.slice_from("heid");break;case 2:k();break;case 3:b()&&_.out_grouping_b(f,97,232)&&_.slice_del()}if(_.cursor=_.limit-s,h(),_.cursor=_.limit-s,_.ket=_.cursor,_.eq_s_b(4,"heid")&&(_.bra=_.cursor,p()&&(e=_.limit-_.cursor,_.eq_s_b(1,"c")||(_.cursor=_.limit-e,_.slice_del(),_.ket=_.cursor,_.eq_s_b(2,"en")&&(_.bra=_.cursor,k())))),_.cursor=_.limit-s,_.ket=_.cursor,r=_.find_among_b(a,6))switch(_.bra=_.cursor,r){case 1:if(p()){if(_.slice_del(),i=_.limit-_.cursor,_.ket=_.cursor,_.eq_s_b(2,"ig")&&(_.bra=_.cursor,p()&&(n=_.limit-_.cursor,!_.eq_s_b(1,"e")))){_.cursor=_.limit-n,_.slice_del();break}_.cursor=_.limit-i,g()}break;case 2:p()&&(o=_.limit-_.cursor,_.eq_s_b(1,"e")||(_.cursor=_.limit-o,_.slice_del()));break;case 3:p()&&(_.slice_del(),h());break;case 4:p()&&_.slice_del();break;case 5:p()&&u&&_.slice_del()}_.cursor=_.limit-s,_.out_grouping_b(d,73,232)&&(t=_.limit-_.cursor,_.find_among_b(l,4)&&_.out_grouping_b(m,97,232)&&(_.cursor=_.limit-t,_.ket=_.cursor,_.cursor>_.limit_backward&&(_.cursor--,_.bra=_.cursor,_.slice_del())))}(),_.cursor=_.limit_backward,function(){for(var r;;)if(_.bra=_.cursor,r=_.find_among(n,3))switch(_.ket=_.cursor,r){case 1:_.slice_from("y");break;case 2:_.slice_from("i");break;case 3:if(_.cursor>=_.limit)return;_.cursor++}}(),!0}},function(r){return"function"==typeof r.update?r.update(function(r){return e.setCurrent(r),e.stem(),e.getCurrent()}):(e.setCurrent(r),e.stem(),e.getCurrent())}),r.Pipeline.registerFunction(r.nl.stemmer,"stemmer-nl"),r.nl.stopWordFilter=r.generateStopWordFilter(" aan al alles als altijd andere ben bij daar dan dat de der deze die dit doch doen door dus een eens en er ge geen geweest haar had heb hebben heeft hem het hier hij hoe hun iemand iets ik in is ja je kan kon kunnen maar me meer men met mij mijn moet na naar niet niets nog nu of om omdat onder ons ook op over reeds te tegen toch toen tot u uit uw van veel voor want waren was wat werd wezen wie wil worden wordt zal ze zelf zich zij zijn zo zonder zou".split(" ")),r.Pipeline.registerFunction(r.nl.stopWordFilter,"stopWordFilter-nl")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.no.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.no.js
deleted file mode 100644
index 031e4b20..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.no.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Norwegian` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,n,i;e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=(r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){var o,s,a=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],m=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],u=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],d=[119,125,149,1],c=new n;this.setCurrent=function(e){c.setCurrent(e)},this.getCurrent=function(){return c.getCurrent()},this.stem=function(){var e,r,n,i,t=c.cursor;return function(){var e,r=c.cursor+3;if(s=c.limit,0<=r||r<=c.limit){for(o=r;;){if(e=c.cursor,c.in_grouping(u,97,248)){c.cursor=e;break}if(e>=c.limit)return;c.cursor=e+1}for(;!c.out_grouping(u,97,248);){if(c.cursor>=c.limit)return;c.cursor++}(s=c.cursor)<o&&(s=o)}}(),c.limit_backward=t,c.cursor=c.limit,function(){var e,r,n;if(c.cursor>=s&&(r=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,e=c.find_among_b(a,29),c.limit_backward=r,e))switch(c.bra=c.cursor,e){case 1:c.slice_del();break;case 2:n=c.limit-c.cursor,c.in_grouping_b(d,98,122)?c.slice_del():(c.cursor=c.limit-n,c.eq_s_b(1,"k")&&c.out_grouping_b(u,97,248)&&c.slice_del());break;case 3:c.slice_from("er")}}(),c.cursor=c.limit,r=c.limit-c.cursor,c.cursor>=s&&(e=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,c.find_among_b(m,2)?(c.bra=c.cursor,c.limit_backward=e,c.cursor=c.limit-r,c.cursor>c.limit_backward&&(c.cursor--,c.bra=c.cursor,c.slice_del())):c.limit_backward=e),c.cursor=c.limit,c.cursor>=s&&(i=c.limit_backward,c.limit_backward=s,c.ket=c.cursor,(n=c.find_among_b(l,11))?(c.bra=c.cursor,c.limit_backward=i,1==n&&c.slice_del()):c.limit_backward=i),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.pt.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.pt.js
deleted file mode 100644
index 59e766fe..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.pt.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Portuguese` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var j,C,r;e.pt=function(){this.pipeline.reset(),this.pipeline.add(e.pt.trimmer,e.pt.stopWordFilter,e.pt.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.pt.stemmer))},e.pt.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.pt.trimmer=e.trimmerSupport.generateTrimmer(e.pt.wordCharacters),e.Pipeline.registerFunction(e.pt.trimmer,"trimmer-pt"),e.pt.stemmer=(j=e.stemmerSupport.Among,C=e.stemmerSupport.SnowballProgram,r=new function(){var s,n,i,o=[new j("",-1,3),new j("ã",0,1),new j("õ",0,2)],a=[new j("",-1,3),new j("a~",0,1),new j("o~",0,2)],r=[new j("ic",-1,-1),new j("ad",-1,-1),new j("os",-1,-1),new j("iv",-1,1)],t=[new j("ante",-1,1),new j("avel",-1,1),new j("ível",-1,1)],u=[new j("ic",-1,1),new j("abil",-1,1),new j("iv",-1,1)],w=[new j("ica",-1,1),new j("ância",-1,1),new j("ência",-1,4),new j("ira",-1,9),new j("adora",-1,1),new j("osa",-1,1),new j("ista",-1,1),new j("iva",-1,8),new j("eza",-1,1),new j("logía",-1,2),new j("idade",-1,7),new j("ante",-1,1),new j("mente",-1,6),new j("amente",12,5),new j("ável",-1,1),new j("ível",-1,1),new j("ución",-1,3),new j("ico",-1,1),new j("ismo",-1,1),new j("oso",-1,1),new j("amento",-1,1),new j("imento",-1,1),new j("ivo",-1,8),new j("aça~o",-1,1),new j("ador",-1,1),new j("icas",-1,1),new j("ências",-1,4),new j("iras",-1,9),new j("adoras",-1,1),new j("osas",-1,1),new j("istas",-1,1),new j("ivas",-1,8),new j("ezas",-1,1),new j("logías",-1,2),new j("idades",-1,7),new j("uciones",-1,3),new j("adores",-1,1),new j("antes",-1,1),new j("aço~es",-1,1),new j("icos",-1,1),new j("ismos",-1,1),new j("osos",-1,1),new j("amentos",-1,1),new j("imentos",-1,1),new j("ivos",-1,8)],m=[new j("ada",-1,1),new j("ida",-1,1),new j("ia",-1,1),new j("aria",2,1),new j("eria",2,1),new j("iria",2,1),new j("ara",-1,1),new j("era",-1,1),new j("ira",-1,1),new j("ava",-1,1),new j("asse",-1,1),new j("esse",-1,1),new j("isse",-1,1),new j("aste",-1,1),new j("este",-1,1),new j("iste",-1,1),new j("ei",-1,1),new j("arei",16,1),new j("erei",16,1),new j("irei",16,1),new j("am",-1,1),new j("iam",20,1),new j("ariam",21,1),new j("eriam",21,1),new j("iriam",21,1),new j("aram",20,1),new j("eram",20,1),new j("iram",20,1),new j("avam",20,1),new j("em",-1,1),new j("arem",29,1),new j("erem",29,1),new j("irem",29,1),new j("assem",29,1),new j("essem",29,1),new j("issem",29,1),new j("ado",-1,1),new j("ido",-1,1),new j("ando",-1,1),new j("endo",-1,1),new j("indo",-1,1),new j("ara~o",-1,1),new j("era~o",-1,1),new j("ira~o",-1,1),new j("ar",-1,1),new j("er",-1,1),new j("ir",-1,1),new j("as",-1,1),new j("adas",47,1),new j("idas",47,1),new j("ias",47,1),new j("arias",50,1),new j("erias",50,1),new j("irias",50,1),new j("aras",47,1),new j("eras",47,1),new j("iras",47,1),new j("avas",47,1),new j("es",-1,1),new j("ardes",58,1),new j("erdes",58,1),new j("irdes",58,1),new j("ares",58,1),new j("eres",58,1),new j("ires",58,1),new j("asses",58,1),new j("esses",58,1),new j("isses",58,1),new j("astes",58,1),new j("estes",58,1),new j("istes",58,1),new j("is",-1,1),new j("ais",71,1),new j("eis",71,1),new j("areis",73,1),new j("ereis",73,1),new j("ireis",73,1),new j("áreis",73,1),new j("éreis",73,1),new j("íreis",73,1),new j("ásseis",73,1),new j("ésseis",73,1),new j("ísseis",73,1),new j("áveis",73,1),new j("íeis",73,1),new j("aríeis",84,1),new j("eríeis",84,1),new j("iríeis",84,1),new j("ados",-1,1),new j("idos",-1,1),new j("amos",-1,1),new j("áramos",90,1),new j("éramos",90,1),new j("íramos",90,1),new j("ávamos",90,1),new j("íamos",90,1),new j("aríamos",95,1),new j("eríamos",95,1),new j("iríamos",95,1),new j("emos",-1,1),new j("aremos",99,1),new j("eremos",99,1),new j("iremos",99,1),new j("ássemos",99,1),new j("êssemos",99,1),new j("íssemos",99,1),new j("imos",-1,1),new j("armos",-1,1),new j("ermos",-1,1),new j("irmos",-1,1),new j("ámos",-1,1),new j("arás",-1,1),new j("erás",-1,1),new j("irás",-1,1),new j("eu",-1,1),new j("iu",-1,1),new j("ou",-1,1),new j("ará",-1,1),new j("erá",-1,1),new j("irá",-1,1)],c=[new j("a",-1,1),new j("i",-1,1),new j("o",-1,1),new j("os",-1,1),new j("á",-1,1),new j("í",-1,1),new j("ó",-1,1)],l=[new j("e",-1,1),new j("ç",-1,2),new j("é",-1,1),new j("ê",-1,1)],f=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,19,12,2],d=new C;function v(){if(d.out_grouping(f,97,250)){for(;!d.in_grouping(f,97,250);){if(d.cursor>=d.limit)return!0;d.cursor++}return!1}return!0}function p(){var e,r,s=d.cursor;if(d.in_grouping(f,97,250))if(e=d.cursor,v()){if(d.cursor=e,function(){if(d.in_grouping(f,97,250))for(;!d.out_grouping(f,97,250);){if(d.cursor>=d.limit)return!1;d.cursor++}return i=d.cursor,!0}())return}else i=d.cursor;if(d.cursor=s,d.out_grouping(f,97,250)){if(r=d.cursor,v()){if(d.cursor=r,!d.in_grouping(f,97,250)||d.cursor>=d.limit)return;d.cursor++}i=d.cursor}}function _(){for(;!d.in_grouping(f,97,250);){if(d.cursor>=d.limit)return!1;d.cursor++}for(;!d.out_grouping(f,97,250);){if(d.cursor>=d.limit)return!1;d.cursor++}return!0}function h(){return i<=d.cursor}function b(){return s<=d.cursor}function g(){var e;if(d.ket=d.cursor,!(e=d.find_among_b(w,45)))return!1;switch(d.bra=d.cursor,e){case 1:if(!b())return!1;d.slice_del();break;case 2:if(!b())return!1;d.slice_from("log");break;case 3:if(!b())return!1;d.slice_from("u");break;case 4:if(!b())return!1;d.slice_from("ente");break;case 5:if(!(n<=d.cursor))return!1;d.slice_del(),d.ket=d.cursor,(e=d.find_among_b(r,4))&&(d.bra=d.cursor,b()&&(d.slice_del(),1==e&&(d.ket=d.cursor,d.eq_s_b(2,"at")&&(d.bra=d.cursor,b()&&d.slice_del()))));break;case 6:if(!b())return!1;d.slice_del(),d.ket=d.cursor,(e=d.find_among_b(t,3))&&(d.bra=d.cursor,1==e&&b()&&d.slice_del());break;case 7:if(!b())return!1;d.slice_del(),d.ket=d.cursor,(e=d.find_among_b(u,3))&&(d.bra=d.cursor,1==e&&b()&&d.slice_del());break;case 8:if(!b())return!1;d.slice_del(),d.ket=d.cursor,d.eq_s_b(2,"at")&&(d.bra=d.cursor,b()&&d.slice_del());break;case 9:if(!h()||!d.eq_s_b(1,"e"))return!1;d.slice_from("ir")}return!0}function k(e,r){if(d.eq_s_b(1,e)){d.bra=d.cursor;var s=d.limit-d.cursor;if(d.eq_s_b(1,r))return d.cursor=d.limit-s,h()&&d.slice_del(),!1}return!0}function q(){if(!g()&&(d.cursor=d.limit,!function(){var e,r;if(d.cursor>=i){if(r=d.limit_backward,d.limit_backward=i,d.ket=d.cursor,e=d.find_among_b(m,120))return d.bra=d.cursor,1==e&&d.slice_del(),d.limit_backward=r,!0;d.limit_backward=r}return!1}()))return d.cursor=d.limit,d.ket=d.cursor,void((e=d.find_among_b(c,7))&&(d.bra=d.cursor,1==e&&h()&&d.slice_del()));var e;d.cursor=d.limit,d.ket=d.cursor,d.eq_s_b(1,"i")&&(d.bra=d.cursor,d.eq_s_b(1,"c")&&(d.cursor=d.limit,h()&&d.slice_del()))}this.setCurrent=function(e){d.setCurrent(e)},this.getCurrent=function(){return d.getCurrent()},this.stem=function(){var e,r=d.cursor;return function(){for(var e;;){if(d.bra=d.cursor,e=d.find_among(o,3))switch(d.ket=d.cursor,e){case 1:d.slice_from("a~");continue;case 2:d.slice_from("o~");continue;case 3:if(d.cursor>=d.limit)break;d.cursor++;continue}break}}(),d.cursor=r,e=d.cursor,i=d.limit,s=n=i,p(),d.cursor=e,_()&&(n=d.cursor,_()&&(s=d.cursor)),d.limit_backward=r,d.cursor=d.limit,q(),d.cursor=d.limit,function(){var e;if(d.ket=d.cursor,e=d.find_among_b(l,4))switch(d.bra=d.cursor,e){case 1:h()&&(d.slice_del(),d.ket=d.cursor,d.limit,d.cursor,k("u","g")&&k("i","c"));break;case 2:d.slice_from("c")}}(),d.cursor=d.limit_backward,function(){for(var e;;){if(d.bra=d.cursor,e=d.find_among(a,3))switch(d.ket=d.cursor,e){case 1:d.slice_from("ã");continue;case 2:d.slice_from("õ");continue;case 3:if(d.cursor>=d.limit)break;d.cursor++;continue}break}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return r.setCurrent(e),r.stem(),r.getCurrent()}):(r.setCurrent(e),r.stem(),r.getCurrent())}),e.Pipeline.registerFunction(e.pt.stemmer,"stemmer-pt"),e.pt.stopWordFilter=e.generateStopWordFilter("a ao aos aquela aquelas aquele aqueles aquilo as até com como da das de dela delas dele deles depois do dos e ela elas ele eles em entre era eram essa essas esse esses esta estamos estas estava estavam este esteja estejam estejamos estes esteve estive estivemos estiver estivera estiveram estiverem estivermos estivesse estivessem estivéramos estivéssemos estou está estávamos estão eu foi fomos for fora foram forem formos fosse fossem fui fôramos fôssemos haja hajam hajamos havemos hei houve houvemos houver houvera houveram houverei houverem houveremos houveria houveriam houvermos houverá houverão houveríamos houvesse houvessem houvéramos houvéssemos há hão isso isto já lhe lhes mais mas me mesmo meu meus minha minhas muito na nas nem no nos nossa nossas nosso nossos num numa não nós o os ou para pela pelas pelo pelos por qual quando que quem se seja sejam sejamos sem serei seremos seria seriam será serão seríamos seu seus somos sou sua suas são só também te tem temos tenha tenham tenhamos tenho terei teremos teria teriam terá terão teríamos teu teus teve tinha tinham tive tivemos tiver tivera tiveram tiverem tivermos tivesse tivessem tivéramos tivéssemos tu tua tuas tém tínhamos um uma você vocês vos à às éramos".split(" ")),e.Pipeline.registerFunction(e.pt.stopWordFilter,"stopWordFilter-pt")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.ro.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.ro.js
deleted file mode 100644
index c5ecc96c..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.ro.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Romanian` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var h,z,i;e.ro=function(){this.pipeline.reset(),this.pipeline.add(e.ro.trimmer,e.ro.stopWordFilter,e.ro.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ro.stemmer))},e.ro.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.ro.trimmer=e.trimmerSupport.generateTrimmer(e.ro.wordCharacters),e.Pipeline.registerFunction(e.ro.trimmer,"trimmer-ro"),e.ro.stemmer=(h=e.stemmerSupport.Among,z=e.stemmerSupport.SnowballProgram,i=new function(){var r,n,t,a,o=[new h("",-1,3),new h("I",0,1),new h("U",0,2)],s=[new h("ea",-1,3),new h("aţia",-1,7),new h("aua",-1,2),new h("iua",-1,4),new h("aţie",-1,7),new h("ele",-1,3),new h("ile",-1,5),new h("iile",6,4),new h("iei",-1,4),new h("atei",-1,6),new h("ii",-1,4),new h("ului",-1,1),new h("ul",-1,1),new h("elor",-1,3),new h("ilor",-1,4),new h("iilor",14,4)],c=[new h("icala",-1,4),new h("iciva",-1,4),new h("ativa",-1,5),new h("itiva",-1,6),new h("icale",-1,4),new h("aţiune",-1,5),new h("iţiune",-1,6),new h("atoare",-1,5),new h("itoare",-1,6),new h("ătoare",-1,5),new h("icitate",-1,4),new h("abilitate",-1,1),new h("ibilitate",-1,2),new h("ivitate",-1,3),new h("icive",-1,4),new h("ative",-1,5),new h("itive",-1,6),new h("icali",-1,4),new h("atori",-1,5),new h("icatori",18,4),new h("itori",-1,6),new h("ători",-1,5),new h("icitati",-1,4),new h("abilitati",-1,1),new h("ivitati",-1,3),new h("icivi",-1,4),new h("ativi",-1,5),new h("itivi",-1,6),new h("icităi",-1,4),new h("abilităi",-1,1),new h("ivităi",-1,3),new h("icităţi",-1,4),new h("abilităţi",-1,1),new h("ivităţi",-1,3),new h("ical",-1,4),new h("ator",-1,5),new h("icator",35,4),new h("itor",-1,6),new h("ător",-1,5),new h("iciv",-1,4),new h("ativ",-1,5),new h("itiv",-1,6),new h("icală",-1,4),new h("icivă",-1,4),new h("ativă",-1,5),new h("itivă",-1,6)],u=[new h("ica",-1,1),new h("abila",-1,1),new h("ibila",-1,1),new h("oasa",-1,1),new h("ata",-1,1),new h("ita",-1,1),new h("anta",-1,1),new h("ista",-1,3),new h("uta",-1,1),new h("iva",-1,1),new h("ic",-1,1),new h("ice",-1,1),new h("abile",-1,1),new h("ibile",-1,1),new h("isme",-1,3),new h("iune",-1,2),new h("oase",-1,1),new h("ate",-1,1),new h("itate",17,1),new h("ite",-1,1),new h("ante",-1,1),new h("iste",-1,3),new h("ute",-1,1),new h("ive",-1,1),new h("ici",-1,1),new h("abili",-1,1),new h("ibili",-1,1),new h("iuni",-1,2),new h("atori",-1,1),new h("osi",-1,1),new h("ati",-1,1),new h("itati",30,1),new h("iti",-1,1),new h("anti",-1,1),new h("isti",-1,3),new h("uti",-1,1),new h("işti",-1,3),new h("ivi",-1,1),new h("ităi",-1,1),new h("oşi",-1,1),new h("ităţi",-1,1),new h("abil",-1,1),new h("ibil",-1,1),new h("ism",-1,3),new h("ator",-1,1),new h("os",-1,1),new h("at",-1,1),new h("it",-1,1),new h("ant",-1,1),new h("ist",-1,3),new h("ut",-1,1),new h("iv",-1,1),new h("ică",-1,1),new h("abilă",-1,1),new h("ibilă",-1,1),new h("oasă",-1,1),new h("ată",-1,1),new h("ită",-1,1),new h("antă",-1,1),new h("istă",-1,3),new h("ută",-1,1),new h("ivă",-1,1)],w=[new h("ea",-1,1),new h("ia",-1,1),new h("esc",-1,1),new h("ăsc",-1,1),new h("ind",-1,1),new h("ând",-1,1),new h("are",-1,1),new h("ere",-1,1),new h("ire",-1,1),new h("âre",-1,1),new h("se",-1,2),new h("ase",10,1),new h("sese",10,2),new h("ise",10,1),new h("use",10,1),new h("âse",10,1),new h("eşte",-1,1),new h("ăşte",-1,1),new h("eze",-1,1),new h("ai",-1,1),new h("eai",19,1),new h("iai",19,1),new h("sei",-1,2),new h("eşti",-1,1),new h("ăşti",-1,1),new h("ui",-1,1),new h("ezi",-1,1),new h("âi",-1,1),new h("aşi",-1,1),new h("seşi",-1,2),new h("aseşi",29,1),new h("seseşi",29,2),new h("iseşi",29,1),new h("useşi",29,1),new h("âseşi",29,1),new h("işi",-1,1),new h("uşi",-1,1),new h("âşi",-1,1),new h("aţi",-1,2),new h("eaţi",38,1),new h("iaţi",38,1),new h("eţi",-1,2),new h("iţi",-1,2),new h("âţi",-1,2),new h("arăţi",-1,1),new h("serăţi",-1,2),new h("aserăţi",45,1),new h("seserăţi",45,2),new h("iserăţi",45,1),new h("userăţi",45,1),new h("âserăţi",45,1),new h("irăţi",-1,1),new h("urăţi",-1,1),new h("ârăţi",-1,1),new h("am",-1,1),new h("eam",54,1),new h("iam",54,1),new h("em",-1,2),new h("asem",57,1),new h("sesem",57,2),new h("isem",57,1),new h("usem",57,1),new h("âsem",57,1),new h("im",-1,2),new h("âm",-1,2),new h("ăm",-1,2),new h("arăm",65,1),new h("serăm",65,2),new h("aserăm",67,1),new h("seserăm",67,2),new h("iserăm",67,1),new h("userăm",67,1),new h("âserăm",67,1),new h("irăm",65,1),new h("urăm",65,1),new h("ârăm",65,1),new h("au",-1,1),new h("eau",76,1),new h("iau",76,1),new h("indu",-1,1),new h("ându",-1,1),new h("ez",-1,1),new h("ească",-1,1),new h("ară",-1,1),new h("seră",-1,2),new h("aseră",84,1),new h("seseră",84,2),new h("iseră",84,1),new h("useră",84,1),new h("âseră",84,1),new h("iră",-1,1),new h("ură",-1,1),new h("âră",-1,1),new h("ează",-1,1)],i=[new h("a",-1,1),new h("e",-1,1),new h("ie",1,1),new h("i",-1,1),new h("ă",-1,1)],m=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,2,32,0,0,4],l=new z;function f(e,i){l.eq_s(1,e)&&(l.ket=l.cursor,l.in_grouping(m,97,259)&&l.slice_from(i))}function p(){if(l.out_grouping(m,97,259)){for(;!l.in_grouping(m,97,259);){if(l.cursor>=l.limit)return!0;l.cursor++}return!1}return!0}function d(){var e,i,r=l.cursor;if(l.in_grouping(m,97,259)){if(e=l.cursor,!p())return void(a=l.cursor);if(l.cursor=e,!function(){if(l.in_grouping(m,97,259))for(;!l.out_grouping(m,97,259);){if(l.cursor>=l.limit)return!0;l.cursor++}return!1}())return void(a=l.cursor)}l.cursor=r,l.out_grouping(m,97,259)&&(i=l.cursor,p()&&(l.cursor=i,l.in_grouping(m,97,259)&&l.cursor<l.limit&&l.cursor++),a=l.cursor)}function b(){for(;!l.in_grouping(m,97,259);){if(l.cursor>=l.limit)return!1;l.cursor++}for(;!l.out_grouping(m,97,259);){if(l.cursor>=l.limit)return!1;l.cursor++}return!0}function v(){return t<=l.cursor}function _(){var e,i=l.limit-l.cursor;if(l.ket=l.cursor,(e=l.find_among_b(c,46))&&(l.bra=l.cursor,v())){switch(e){case 1:l.slice_from("abil");break;case 2:l.slice_from("ibil");break;case 3:l.slice_from("iv");break;case 4:l.slice_from("ic");break;case 5:l.slice_from("at");break;case 6:l.slice_from("it")}return r=!0,l.cursor=l.limit-i,!0}return!1}function g(){var e,i;for(r=!1;;)if(i=l.limit-l.cursor,!_()){l.cursor=l.limit-i;break}if(l.ket=l.cursor,(e=l.find_among_b(u,62))&&(l.bra=l.cursor,n<=l.cursor)){switch(e){case 1:l.slice_del();break;case 2:l.eq_s_b(1,"ţ")&&(l.bra=l.cursor,l.slice_from("t"));break;case 3:l.slice_from("ist")}r=!0}}function k(){var e;l.ket=l.cursor,(e=l.find_among_b(i,5))&&(l.bra=l.cursor,a<=l.cursor&&1==e&&l.slice_del())}this.setCurrent=function(e){l.setCurrent(e)},this.getCurrent=function(){return l.getCurrent()},this.stem=function(){var e,i=l.cursor;return function(){for(var e,i;e=l.cursor,l.in_grouping(m,97,259)&&(i=l.cursor,l.bra=i,f("u","U"),l.cursor=i,f("i","I")),l.cursor=e,!(l.cursor>=l.limit);)l.cursor++}(),l.cursor=i,e=l.cursor,a=l.limit,n=t=a,d(),l.cursor=e,b()&&(t=l.cursor,b()&&(n=l.cursor)),l.limit_backward=i,l.cursor=l.limit,function(){var e,i;if(l.ket=l.cursor,(e=l.find_among_b(s,16))&&(l.bra=l.cursor,v()))switch(e){case 1:l.slice_del();break;case 2:l.slice_from("a");break;case 3:l.slice_from("e");break;case 4:l.slice_from("i");break;case 5:i=l.limit-l.cursor,l.eq_s_b(2,"ab")||(l.cursor=l.limit-i,l.slice_from("i"));break;case 6:l.slice_from("at");break;case 7:l.slice_from("aţi")}}(),l.cursor=l.limit,g(),l.cursor=l.limit,r||(l.cursor=l.limit,function(){var e,i,r;if(l.cursor>=a){if(i=l.limit_backward,l.limit_backward=a,l.ket=l.cursor,e=l.find_among_b(w,94))switch(l.bra=l.cursor,e){case 1:if(r=l.limit-l.cursor,!l.out_grouping_b(m,97,259)&&(l.cursor=l.limit-r,!l.eq_s_b(1,"u")))break;case 2:l.slice_del()}l.limit_backward=i}}(),l.cursor=l.limit),k(),l.cursor=l.limit_backward,function(){for(var e;;){if(l.bra=l.cursor,e=l.find_among(o,3))switch(l.ket=l.cursor,e){case 1:l.slice_from("i");continue;case 2:l.slice_from("u");continue;case 3:if(l.cursor>=l.limit)break;l.cursor++;continue}break}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}),e.Pipeline.registerFunction(e.ro.stemmer,"stemmer-ro"),e.ro.stopWordFilter=e.generateStopWordFilter("acea aceasta această aceea acei aceia acel acela acele acelea acest acesta aceste acestea aceşti aceştia acolo acord acum ai aia aibă aici al ale alea altceva altcineva am ar are asemenea asta astea astăzi asupra au avea avem aveţi azi aş aşadar aţi bine bucur bună ca care caut ce cel ceva chiar cinci cine cineva contra cu cum cumva curând curînd când cât câte câtva câţi cînd cît cîte cîtva cîţi că căci cărei căror cărui către da dacă dar datorită dată dau de deci deja deoarece departe deşi din dinaintea dintr- dintre doi doilea două drept după dă ea ei el ele eram este eu eşti face fata fi fie fiecare fii fim fiu fiţi frumos fără graţie halbă iar ieri la le li lor lui lângă lîngă mai mea mei mele mereu meu mi mie mine mult multă mulţi mulţumesc mâine mîine mă ne nevoie nici nicăieri nimeni nimeri nimic nişte noastre noastră noi noroc nostru nouă noştri nu opt ori oricare orice oricine oricum oricând oricât oricînd oricît oriunde patra patru patrulea pe pentru peste pic poate pot prea prima primul prin puţin puţina puţină până pînă rog sa sale sau se spate spre sub sunt suntem sunteţi sută sînt sîntem sînteţi să săi său ta tale te timp tine toate toată tot totuşi toţi trei treia treilea tu tăi tău un una unde undeva unei uneia unele uneori unii unor unora unu unui unuia unul vi voastre voastră voi vostru vouă voştri vreme vreo vreun vă zece zero zi zice îi îl îmi împotriva în înainte înaintea încotro încât încît între întrucât întrucît îţi ăla ălea ăsta ăstea ăştia şapte şase şi ştiu ţi ţie".split(" ")),e.Pipeline.registerFunction(e.ro.stopWordFilter,"stopWordFilter-ro")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.ru.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.ru.js
deleted file mode 100644
index 104bc6e8..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.ru.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Russian` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,n){"function"==typeof define&&define.amd?define(n):"object"==typeof exports?module.exports=n():n()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var h,g,n;e.ru=function(){this.pipeline.reset(),this.pipeline.add(e.ru.trimmer,e.ru.stopWordFilter,e.ru.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ru.stemmer))},e.ru.wordCharacters="Ѐ-҄҇-ԯᴫᵸⷠ-ⷿꙀ-ꚟ︮︯",e.ru.trimmer=e.trimmerSupport.generateTrimmer(e.ru.wordCharacters),e.Pipeline.registerFunction(e.ru.trimmer,"trimmer-ru"),e.ru.stemmer=(h=e.stemmerSupport.Among,g=e.stemmerSupport.SnowballProgram,n=new function(){var n,e,r=[new h("в",-1,1),new h("ив",0,2),new h("ыв",0,2),new h("вши",-1,1),new h("ивши",3,2),new h("ывши",3,2),new h("вшись",-1,1),new h("ившись",6,2),new h("ывшись",6,2)],t=[new h("ее",-1,1),new h("ие",-1,1),new h("ое",-1,1),new h("ые",-1,1),new h("ими",-1,1),new h("ыми",-1,1),new h("ей",-1,1),new h("ий",-1,1),new h("ой",-1,1),new h("ый",-1,1),new h("ем",-1,1),new h("им",-1,1),new h("ом",-1,1),new h("ым",-1,1),new h("его",-1,1),new h("ого",-1,1),new h("ему",-1,1),new h("ому",-1,1),new h("их",-1,1),new h("ых",-1,1),new h("ею",-1,1),new h("ою",-1,1),new h("ую",-1,1),new h("юю",-1,1),new h("ая",-1,1),new h("яя",-1,1)],w=[new h("ем",-1,1),new h("нн",-1,1),new h("вш",-1,1),new h("ивш",2,2),new h("ывш",2,2),new h("щ",-1,1),new h("ющ",5,1),new h("ующ",6,2)],i=[new h("сь",-1,1),new h("ся",-1,1)],u=[new h("ла",-1,1),new h("ила",0,2),new h("ыла",0,2),new h("на",-1,1),new h("ена",3,2),new h("ете",-1,1),new h("ите",-1,2),new h("йте",-1,1),new h("ейте",7,2),new h("уйте",7,2),new h("ли",-1,1),new h("или",10,2),new h("ыли",10,2),new h("й",-1,1),new h("ей",13,2),new h("уй",13,2),new h("л",-1,1),new h("ил",16,2),new h("ыл",16,2),new h("ем",-1,1),new h("им",-1,2),new h("ым",-1,2),new h("н",-1,1),new h("ен",22,2),new h("ло",-1,1),new h("ило",24,2),new h("ыло",24,2),new h("но",-1,1),new h("ено",27,2),new h("нно",27,1),new h("ет",-1,1),new h("ует",30,2),new h("ит",-1,2),new h("ыт",-1,2),new h("ют",-1,1),new h("уют",34,2),new h("ят",-1,2),new h("ны",-1,1),new h("ены",37,2),new h("ть",-1,1),new h("ить",39,2),new h("ыть",39,2),new h("ешь",-1,1),new h("ишь",-1,2),new h("ю",-1,2),new h("ую",44,2)],s=[new h("а",-1,1),new h("ев",-1,1),new h("ов",-1,1),new h("е",-1,1),new h("ие",3,1),new h("ье",3,1),new h("и",-1,1),new h("еи",6,1),new h("ии",6,1),new h("ами",6,1),new h("ями",6,1),new h("иями",10,1),new h("й",-1,1),new h("ей",12,1),new h("ией",13,1),new h("ий",12,1),new h("ой",12,1),new h("ам",-1,1),new h("ем",-1,1),new h("ием",18,1),new h("ом",-1,1),new h("ям",-1,1),new h("иям",21,1),new h("о",-1,1),new h("у",-1,1),new h("ах",-1,1),new h("ях",-1,1),new h("иях",26,1),new h("ы",-1,1),new h("ь",-1,1),new h("ю",-1,1),new h("ию",30,1),new h("ью",30,1),new h("я",-1,1),new h("ия",33,1),new h("ья",33,1)],o=[new h("ост",-1,1),new h("ость",-1,1)],c=[new h("ейше",-1,1),new h("н",-1,2),new h("ейш",-1,1),new h("ь",-1,3)],m=[33,65,8,232],l=new g;function f(){for(;!l.in_grouping(m,1072,1103);){if(l.cursor>=l.limit)return!1;l.cursor++}return!0}function a(){for(;!l.out_grouping(m,1072,1103);){if(l.cursor>=l.limit)return!1;l.cursor++}return!0}function p(e,n){var r,t;if(l.ket=l.cursor,r=l.find_among_b(e,n)){switch(l.bra=l.cursor,r){case 1:if(t=l.limit-l.cursor,!l.eq_s_b(1,"а")&&(l.cursor=l.limit-t,!l.eq_s_b(1,"я")))return!1;case 2:l.slice_del()}return!0}return!1}function d(e,n){var r;return l.ket=l.cursor,!!(r=l.find_among_b(e,n))&&(l.bra=l.cursor,1==r&&l.slice_del(),!0)}function _(){return!!d(t,26)&&(p(w,8),!0)}function b(){var e;l.ket=l.cursor,(e=l.find_among_b(o,2))&&(l.bra=l.cursor,n<=l.cursor&&1==e&&l.slice_del())}this.setCurrent=function(e){l.setCurrent(e)},this.getCurrent=function(){return l.getCurrent()},this.stem=function(){return e=l.limit,n=e,f()&&(e=l.cursor,a()&&f()&&a()&&(n=l.cursor)),l.cursor=l.limit,!(l.cursor<e)&&(l.limit_backward=e,p(r,9)||(l.cursor=l.limit,d(i,2)||(l.cursor=l.limit),_()||(l.cursor=l.limit,p(u,46)||(l.cursor=l.limit,d(s,36)))),l.cursor=l.limit,l.ket=l.cursor,l.eq_s_b(1,"и")?(l.bra=l.cursor,l.slice_del()):l.cursor=l.limit,b(),l.cursor=l.limit,function(){var e;if(l.ket=l.cursor,e=l.find_among_b(c,4))switch(l.bra=l.cursor,e){case 1:if(l.slice_del(),l.ket=l.cursor,!l.eq_s_b(1,"н"))break;l.bra=l.cursor;case 2:if(!l.eq_s_b(1,"н"))break;case 3:l.slice_del()}}(),!0)}},function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}),e.Pipeline.registerFunction(e.ru.stemmer,"stemmer-ru"),e.ru.stopWordFilter=e.generateStopWordFilter("алло без близко более больше будем будет будете будешь будто буду будут будь бы бывает бывь был была были было быть в важная важное важные важный вам вами вас ваш ваша ваше ваши вверх вдали вдруг ведь везде весь вниз внизу во вокруг вон восемнадцатый восемнадцать восемь восьмой вот впрочем времени время все всегда всего всем всеми всему всех всею всю всюду вся всё второй вы г где говорил говорит год года году да давно даже далеко дальше даром два двадцатый двадцать две двенадцатый двенадцать двух девятнадцатый девятнадцать девятый девять действительно дел день десятый десять для до довольно долго должно другая другие других друго другое другой е его ее ей ему если есть еще ещё ею её ж же жизнь за занят занята занято заняты затем зато зачем здесь значит и из или им именно иметь ими имя иногда их к каждая каждое каждые каждый кажется как какая какой кем когда кого ком кому конечно которая которого которой которые который которых кроме кругом кто куда лет ли лишь лучше люди м мало между меля менее меньше меня миллионов мимо мира мне много многочисленная многочисленное многочисленные многочисленный мной мною мог могут мож может можно можхо мои мой мор мочь моя моё мы на наверху над надо назад наиболее наконец нам нами нас начала наш наша наше наши не него недавно недалеко нее ней нельзя нем немного нему непрерывно нередко несколько нет нею неё ни нибудь ниже низко никогда никуда ними них ничего но ну нужно нх о об оба обычно один одиннадцатый одиннадцать однажды однако одного одной около он она они оно опять особенно от отовсюду отсюда очень первый перед по под пожалуйста позже пока пор пора после посреди потом потому почему почти прекрасно при про просто против процентов пятнадцатый пятнадцать пятый пять раз разве рано раньше рядом с сам сама сами самим самими самих само самого самой самом самому саму свое своего своей свои своих свою сеаой себе себя сегодня седьмой сейчас семнадцатый семнадцать семь сих сказал сказала сказать сколько слишком сначала снова со собой собою совсем спасибо стал суть т та так такая также такие такое такой там твой твоя твоё те тебе тебя тем теми теперь тех то тобой тобою тогда того тоже только том тому тот тою третий три тринадцатый тринадцать ту туда тут ты тысяч у уж уже уметь хорошо хотеть хоть хотя хочешь часто чаще чего человек чем чему через четвертый четыре четырнадцатый четырнадцать что чтоб чтобы чуть шестнадцатый шестнадцать шестой шесть эта эти этим этими этих это этого этой этом этому этот эту я \ufeffа".split(" ")),e.Pipeline.registerFunction(e.ru.stopWordFilter,"stopWordFilter-ru")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.stemmer.support.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.stemmer.support.js
deleted file mode 100644
index ae2c66aa..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.stemmer.support.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/*!
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var b;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(r){b=r,this.cursor=0,this.limit=r.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var r=b;return b=null,r},in_grouping:function(r,t,i){if(this.cursor<this.limit){var s=b.charCodeAt(this.cursor);if(s<=i&&t<=s&&r[(s-=t)>>3]&1<<(7&s))return this.cursor++,!0}return!1},in_grouping_b:function(r,t,i){if(this.cursor>this.limit_backward){var s=b.charCodeAt(this.cursor-1);if(s<=i&&t<=s&&r[(s-=t)>>3]&1<<(7&s))return this.cursor--,!0}return!1},out_grouping:function(r,t,i){if(this.cursor<this.limit){var s=b.charCodeAt(this.cursor);if(i<s||s<t)return this.cursor++,!0;if(!(r[(s-=t)>>3]&1<<(7&s)))return this.cursor++,!0}return!1},out_grouping_b:function(r,t,i){if(this.cursor>this.limit_backward){var s=b.charCodeAt(this.cursor-1);if(i<s||s<t)return this.cursor--,!0;if(!(r[(s-=t)>>3]&1<<(7&s)))return this.cursor--,!0}return!1},eq_s:function(r,t){if(this.limit-this.cursor<r)return!1;for(var i=0;i<r;i++)if(b.charCodeAt(this.cursor+i)!=t.charCodeAt(i))return!1;return this.cursor+=r,!0},eq_s_b:function(r,t){if(this.cursor-this.limit_backward<r)return!1;for(var i=0;i<r;i++)if(b.charCodeAt(this.cursor-r+i)!=t.charCodeAt(i))return!1;return this.cursor-=r,!0},find_among:function(r,t){for(var i=0,s=t,e=this.cursor,n=this.limit,u=0,o=0,h=!1;;){for(var c=i+(s-i>>1),a=0,f=u<o?u:o,l=r[c],_=f;_<l.s_size;_++){if(e+f==n){a=-1;break}if(a=b.charCodeAt(e+f)-l.s[_])break;f++}if(a<0?(s=c,o=f):(i=c,u=f),s-i<=1){if(0<i||s==i||h)break;h=!0}}for(;;){if(u>=(l=r[i]).s_size){if(this.cursor=e+l.s_size,!l.method)return l.result;var m=l.method();if(this.cursor=e+l.s_size,m)return l.result}if((i=l.substring_i)<0)return 0}},find_among_b:function(r,t){for(var i=0,s=t,e=this.cursor,n=this.limit_backward,u=0,o=0,h=!1;;){for(var c=i+(s-i>>1),a=0,f=u<o?u:o,l=(_=r[c]).s_size-1-f;0<=l;l--){if(e-f==n){a=-1;break}if(a=b.charCodeAt(e-1-f)-_.s[l])break;f++}if(a<0?(s=c,o=f):(i=c,u=f),s-i<=1){if(0<i||s==i||h)break;h=!0}}for(;;){var _;if(u>=(_=r[i]).s_size){if(this.cursor=e-_.s_size,!_.method)return _.result;var m=_.method();if(this.cursor=e-_.s_size,m)return _.result}if((i=_.substring_i)<0)return 0}},replace_s:function(r,t,i){var s=i.length-(t-r);return b=b.substring(0,r)+i+b.substring(t),this.limit+=s,this.cursor>=t?this.cursor+=s:this.cursor>r&&(this.cursor=r),s},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>b.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),b.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.sv.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.sv.js
deleted file mode 100644
index a46a4e70..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.sv.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Swedish` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r,l,n;e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=(r=e.stemmerSupport.Among,l=e.stemmerSupport.SnowballProgram,n=new function(){var n,t,i=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],s=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],a=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],o=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],u=[119,127,149],m=new l;this.setCurrent=function(e){m.setCurrent(e)},this.getCurrent=function(){return m.getCurrent()},this.stem=function(){var e,r=m.cursor;return function(){var e,r=m.cursor+3;if(t=m.limit,0<=r||r<=m.limit){for(n=r;;){if(e=m.cursor,m.in_grouping(o,97,246)){m.cursor=e;break}if(m.cursor=e,m.cursor>=m.limit)return;m.cursor++}for(;!m.out_grouping(o,97,246);){if(m.cursor>=m.limit)return;m.cursor++}(t=m.cursor)<n&&(t=n)}}(),m.limit_backward=r,m.cursor=m.limit,function(){var e,r=m.limit_backward;if(m.cursor>=t&&(m.limit_backward=t,m.cursor=m.limit,m.ket=m.cursor,e=m.find_among_b(i,37),m.limit_backward=r,e))switch(m.bra=m.cursor,e){case 1:m.slice_del();break;case 2:m.in_grouping_b(u,98,121)&&m.slice_del()}}(),m.cursor=m.limit,e=m.limit_backward,m.cursor>=t&&(m.limit_backward=t,m.cursor=m.limit,m.find_among_b(s,7)&&(m.cursor=m.limit,m.ket=m.cursor,m.cursor>m.limit_backward&&(m.bra=--m.cursor,m.slice_del())),m.limit_backward=e),m.cursor=m.limit,function(){var e,r;if(m.cursor>=t){if(r=m.limit_backward,m.limit_backward=t,m.cursor=m.limit,m.ket=m.cursor,e=m.find_among_b(a,5))switch(m.bra=m.cursor,e){case 1:m.slice_del();break;case 2:m.slice_from("lös");break;case 3:m.slice_from("full")}m.limit_backward=r}}(),!0}},function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.th.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.th.js
deleted file mode 100644
index 7f9887f7..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.th.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Thai` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2017, Keerati Thiwanruk
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(t){if(void 0===t)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===t.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var i="2"==t.version[0];t.th=function(){this.pipeline.reset(),this.pipeline.add(t.th.trimmer),i?this.tokenizer=t.th.tokenizer:(t.tokenizer&&(t.tokenizer=t.th.tokenizer),this.tokenizerFn&&(this.tokenizerFn=t.th.tokenizer))},t.th.wordCharacters="[฀-๿]",t.th.trimmer=t.trimmerSupport.generateTrimmer(t.th.wordCharacters),t.Pipeline.registerFunction(t.th.trimmer,"trimmer-th");var n=t.wordcut;n.init(),t.th.tokenizer=function(e){if(!arguments.length||null==e||null==e)return[];if(Array.isArray(e))return e.map(function(e){return i?new t.Token(e):e});var r=e.toString().replace(/^\s+/,"");return n.cut(r).split("|")}}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.tr.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.tr.js
deleted file mode 100644
index 64ba95cb..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.tr.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Turkish` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2014, Mihai Valentin
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(r,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(r.lunr)}(this,function(){return function(r){if(void 0===r)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===r.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var mr,dr,i;r.tr=function(){this.pipeline.reset(),this.pipeline.add(r.tr.trimmer,r.tr.stopWordFilter,r.tr.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(r.tr.stemmer))},r.tr.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",r.tr.trimmer=r.trimmerSupport.generateTrimmer(r.tr.wordCharacters),r.Pipeline.registerFunction(r.tr.trimmer,"trimmer-tr"),r.tr.stemmer=(mr=r.stemmerSupport.Among,dr=r.stemmerSupport.SnowballProgram,i=new function(){var t,r=[new mr("m",-1,-1),new mr("n",-1,-1),new mr("miz",-1,-1),new mr("niz",-1,-1),new mr("muz",-1,-1),new mr("nuz",-1,-1),new mr("müz",-1,-1),new mr("nüz",-1,-1),new mr("mız",-1,-1),new mr("nız",-1,-1)],i=[new mr("leri",-1,-1),new mr("ları",-1,-1)],e=[new mr("ni",-1,-1),new mr("nu",-1,-1),new mr("nü",-1,-1),new mr("nı",-1,-1)],n=[new mr("in",-1,-1),new mr("un",-1,-1),new mr("ün",-1,-1),new mr("ın",-1,-1)],u=[new mr("a",-1,-1),new mr("e",-1,-1)],o=[new mr("na",-1,-1),new mr("ne",-1,-1)],s=[new mr("da",-1,-1),new mr("ta",-1,-1),new mr("de",-1,-1),new mr("te",-1,-1)],c=[new mr("nda",-1,-1),new mr("nde",-1,-1)],l=[new mr("dan",-1,-1),new mr("tan",-1,-1),new mr("den",-1,-1),new mr("ten",-1,-1)],a=[new mr("ndan",-1,-1),new mr("nden",-1,-1)],m=[new mr("la",-1,-1),new mr("le",-1,-1)],d=[new mr("ca",-1,-1),new mr("ce",-1,-1)],f=[new mr("im",-1,-1),new mr("um",-1,-1),new mr("üm",-1,-1),new mr("ım",-1,-1)],b=[new mr("sin",-1,-1),new mr("sun",-1,-1),new mr("sün",-1,-1),new mr("sın",-1,-1)],w=[new mr("iz",-1,-1),new mr("uz",-1,-1),new mr("üz",-1,-1),new mr("ız",-1,-1)],_=[new mr("siniz",-1,-1),new mr("sunuz",-1,-1),new mr("sünüz",-1,-1),new mr("sınız",-1,-1)],k=[new mr("lar",-1,-1),new mr("ler",-1,-1)],p=[new mr("niz",-1,-1),new mr("nuz",-1,-1),new mr("nüz",-1,-1),new mr("nız",-1,-1)],g=[new mr("dir",-1,-1),new mr("tir",-1,-1),new mr("dur",-1,-1),new mr("tur",-1,-1),new mr("dür",-1,-1),new mr("tür",-1,-1),new mr("dır",-1,-1),new mr("tır",-1,-1)],y=[new mr("casına",-1,-1),new mr("cesine",-1,-1)],z=[new mr("di",-1,-1),new mr("ti",-1,-1),new mr("dik",-1,-1),new mr("tik",-1,-1),new mr("duk",-1,-1),new mr("tuk",-1,-1),new mr("dük",-1,-1),new mr("tük",-1,-1),new mr("dık",-1,-1),new mr("tık",-1,-1),new mr("dim",-1,-1),new mr("tim",-1,-1),new mr("dum",-1,-1),new mr("tum",-1,-1),new mr("düm",-1,-1),new mr("tüm",-1,-1),new mr("dım",-1,-1),new mr("tım",-1,-1),new mr("din",-1,-1),new mr("tin",-1,-1),new mr("dun",-1,-1),new mr("tun",-1,-1),new mr("dün",-1,-1),new mr("tün",-1,-1),new mr("dın",-1,-1),new mr("tın",-1,-1),new mr("du",-1,-1),new mr("tu",-1,-1),new mr("dü",-1,-1),new mr("tü",-1,-1),new mr("dı",-1,-1),new mr("tı",-1,-1)],h=[new mr("sa",-1,-1),new mr("se",-1,-1),new mr("sak",-1,-1),new mr("sek",-1,-1),new mr("sam",-1,-1),new mr("sem",-1,-1),new mr("san",-1,-1),new mr("sen",-1,-1)],v=[new mr("miş",-1,-1),new mr("muş",-1,-1),new mr("müş",-1,-1),new mr("mış",-1,-1)],q=[new mr("b",-1,1),new mr("c",-1,2),new mr("d",-1,3),new mr("ğ",-1,4)],C=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,8,0,0,0,0,0,0,1],P=[1,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,1],F=[65],S=[65],W=[["a",[1,64,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],97,305],["e",[17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,130],101,252],["ı",[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],97,305],["i",[17],101,105],["o",F,111,117],["ö",S,246,252],["u",F,111,117]],L=new dr;function x(r,i,e){for(;;){var n=L.limit-L.cursor;if(L.in_grouping_b(r,i,e)){L.cursor=L.limit-n;break}if(L.cursor=L.limit-n,L.cursor<=L.limit_backward)return!1;L.cursor--}return!0}function A(){var r,i;r=L.limit-L.cursor,x(C,97,305);for(var e=0;e<W.length;e++){i=L.limit-L.cursor;var n=W[e];if(L.eq_s_b(1,n[0])&&x(n[1],n[2],n[3]))return L.cursor=L.limit-r,!0;L.cursor=L.limit-i}return L.cursor=L.limit-i,!(!L.eq_s_b(1,"ü")||!x(S,246,252))&&(L.cursor=L.limit-r,!0)}function E(r,i){var e,n=L.limit-L.cursor;return r()&&(L.cursor=L.limit-n,L.cursor>L.limit_backward&&(L.cursor--,e=L.limit-L.cursor,i()))?(L.cursor=L.limit-e,!0):(L.cursor=L.limit-n,r()?(L.cursor=L.limit-n,!1):(L.cursor=L.limit-n,!(L.cursor<=L.limit_backward)&&(L.cursor--,!!i()&&(L.cursor=L.limit-n,!0))))}function j(r){return E(r,function(){return L.in_grouping_b(C,97,305)})}function T(){return j(function(){return L.eq_s_b(1,"n")})}function Z(){return j(function(){return L.eq_s_b(1,"y")})}function B(){return L.find_among_b(r,10)&&E(function(){return L.in_grouping_b(P,105,305)},function(){return L.out_grouping_b(C,97,305)})}function D(){return A()&&L.in_grouping_b(P,105,305)&&j(function(){return L.eq_s_b(1,"s")})}function G(){return L.find_among_b(i,2)}function H(){return A()&&L.find_among_b(n,4)&&T()}function I(){return A()&&L.find_among_b(s,4)}function J(){return A()&&L.find_among_b(c,2)}function K(){return A()&&L.find_among_b(f,4)&&Z()}function M(){return A()&&L.find_among_b(b,4)}function N(){return A()&&L.find_among_b(w,4)&&Z()}function O(){return L.find_among_b(_,4)}function Q(){return A()&&L.find_among_b(k,2)}function R(){return A()&&L.find_among_b(g,8)}function U(){return A()&&L.find_among_b(z,32)&&Z()}function V(){return L.find_among_b(h,8)&&Z()}function X(){return A()&&L.find_among_b(v,4)&&Z()}function Y(){var r=L.limit-L.cursor;return!(X()||(L.cursor=L.limit-r,U()||(L.cursor=L.limit-r,V()||(L.cursor=L.limit-r,L.eq_s_b(3,"ken")&&Z()))))}function $(){if(L.find_among_b(y,2)){var r=L.limit-L.cursor;if(O()||(L.cursor=L.limit-r,Q()||(L.cursor=L.limit-r,K()||(L.cursor=L.limit-r,M()||(L.cursor=L.limit-r,N()||(L.cursor=L.limit-r))))),X())return!1}return!0}function rr(){if(!A()||!L.find_among_b(p,4))return!0;var r=L.limit-L.cursor;return!U()&&(L.cursor=L.limit-r,!V())}function ir(){var r,i,e,n=L.limit-L.cursor;if(L.ket=L.cursor,t=!0,Y()&&(L.cursor=L.limit-n,$()&&(L.cursor=L.limit-n,function(){if(Q()){L.bra=L.cursor,L.slice_del();var r=L.limit-L.cursor;return L.ket=L.cursor,R()||(L.cursor=L.limit-r,U()||(L.cursor=L.limit-r,V()||(L.cursor=L.limit-r,X()||(L.cursor=L.limit-r)))),t=!1}return!0}()&&(L.cursor=L.limit-n,rr()&&(L.cursor=L.limit-n,e=L.limit-L.cursor,!(O()||(L.cursor=L.limit-e,N()||(L.cursor=L.limit-e,M()||(L.cursor=L.limit-e,K()))))||(L.bra=L.cursor,L.slice_del(),i=L.limit-L.cursor,L.ket=L.cursor,X()||(L.cursor=L.limit-i),0)))))){if(L.cursor=L.limit-n,!R())return;L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,r=L.limit-L.cursor,O()||(L.cursor=L.limit-r,Q()||(L.cursor=L.limit-r,K()||(L.cursor=L.limit-r,M()||(L.cursor=L.limit-r,N()||(L.cursor=L.limit-r))))),X()||(L.cursor=L.limit-r)}L.bra=L.cursor,L.slice_del()}function er(){var r,i,e,n;if(L.ket=L.cursor,L.eq_s_b(2,"ki")){if(r=L.limit-L.cursor,I())return L.bra=L.cursor,L.slice_del(),i=L.limit-L.cursor,L.ket=L.cursor,Q()?(L.bra=L.cursor,L.slice_del(),er()):(L.cursor=L.limit-i,B()&&(L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,Q()&&(L.bra=L.cursor,L.slice_del(),er()))),!0;if(L.cursor=L.limit-r,H()){if(L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,e=L.limit-L.cursor,G())L.bra=L.cursor,L.slice_del();else{if(L.cursor=L.limit-e,L.ket=L.cursor,!B()&&(L.cursor=L.limit-e,!D()&&(L.cursor=L.limit-e,!er())))return!0;L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,Q()&&(L.bra=L.cursor,L.slice_del(),er())}return!0}if(L.cursor=L.limit-r,J()){if(n=L.limit-L.cursor,G())L.bra=L.cursor,L.slice_del();else if(L.cursor=L.limit-n,D())L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,Q()&&(L.bra=L.cursor,L.slice_del(),er());else if(L.cursor=L.limit-n,!er())return!1;return!0}}return!1}function nr(r){if(L.ket=L.cursor,!J()&&(L.cursor=L.limit-r,!A()||!L.find_among_b(o,2)))return!1;var i=L.limit-L.cursor;if(G())L.bra=L.cursor,L.slice_del();else if(L.cursor=L.limit-i,D())L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,Q()&&(L.bra=L.cursor,L.slice_del(),er());else if(L.cursor=L.limit-i,!er())return!1;return!0}function tr(r){if(L.ket=L.cursor,!(A()&&L.find_among_b(a,2)||(L.cursor=L.limit-r,A()&&L.find_among_b(e,4))))return!1;var i=L.limit-L.cursor;return!(!D()&&(L.cursor=L.limit-i,!G()))&&(L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,Q()&&(L.bra=L.cursor,L.slice_del(),er()),!0)}function ur(){var r,i=L.limit-L.cursor;return L.ket=L.cursor,!!(H()||(L.cursor=L.limit-i,A()&&L.find_among_b(m,2)&&Z()))&&(L.bra=L.cursor,L.slice_del(),r=L.limit-L.cursor,L.ket=L.cursor,!(!Q()||(L.bra=L.cursor,L.slice_del(),!er()))||(L.cursor=L.limit-r,L.ket=L.cursor,(B()||(L.cursor=L.limit-r,D()||(L.cursor=L.limit-r,er())))&&(L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,Q()&&(L.bra=L.cursor,L.slice_del(),er())),!0))}function or(){var r,i,e=L.limit-L.cursor;if(L.ket=L.cursor,!(I()||(L.cursor=L.limit-e,A()&&L.in_grouping_b(P,105,305)&&Z()||(L.cursor=L.limit-e,A()&&L.find_among_b(u,2)&&Z()))))return!1;if(L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,r=L.limit-L.cursor,B())L.bra=L.cursor,L.slice_del(),i=L.limit-L.cursor,L.ket=L.cursor,Q()||(L.cursor=L.limit-i);else if(L.cursor=L.limit-r,!Q())return!0;return L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,er(),!0}function sr(){var r,i,e=L.limit-L.cursor;if(L.ket=L.cursor,Q())return L.bra=L.cursor,L.slice_del(),void er();if(L.cursor=L.limit-e,L.ket=L.cursor,A()&&L.find_among_b(d,2)&&T())if(L.bra=L.cursor,L.slice_del(),r=L.limit-L.cursor,L.ket=L.cursor,G())L.bra=L.cursor,L.slice_del();else{if(L.cursor=L.limit-r,L.ket=L.cursor,!B()&&(L.cursor=L.limit-r,!D())){if(L.cursor=L.limit-r,L.ket=L.cursor,!Q())return;if(L.bra=L.cursor,L.slice_del(),!er())return}L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,Q()&&(L.bra=L.cursor,L.slice_del(),er())}else if(L.cursor=L.limit-e,!nr(e)&&(L.cursor=L.limit-e,!tr(e))){if(L.cursor=L.limit-e,L.ket=L.cursor,A()&&L.find_among_b(l,4))return L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,i=L.limit-L.cursor,void(B()?(L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,Q()&&(L.bra=L.cursor,L.slice_del(),er())):(L.cursor=L.limit-i,Q()?(L.bra=L.cursor,L.slice_del()):L.cursor=L.limit-i,er()));if(L.cursor=L.limit-e,!ur()){if(L.cursor=L.limit-e,G())return L.bra=L.cursor,void L.slice_del();L.cursor=L.limit-e,er()||(L.cursor=L.limit-e,or()||(L.cursor=L.limit-e,L.ket=L.cursor,(B()||(L.cursor=L.limit-e,D()))&&(L.bra=L.cursor,L.slice_del(),L.ket=L.cursor,Q()&&(L.bra=L.cursor,L.slice_del(),er()))))}}}function cr(r,i,e){if(L.cursor=L.limit-r,function(){for(;;){var r=L.limit-L.cursor;if(L.in_grouping_b(C,97,305)){L.cursor=L.limit-r;break}if(L.cursor=L.limit-r,L.cursor<=L.limit_backward)return!1;L.cursor--}return!0}()){var n=L.limit-L.cursor;if(!L.eq_s_b(1,i)&&(L.cursor=L.limit-n,!L.eq_s_b(1,e)))return!0;L.cursor=L.limit-r;var t=L.cursor;return L.insert(L.cursor,L.cursor,e),L.cursor=t,!1}return!0}function lr(r,i,e){for(;!L.eq_s(i,e);){if(L.cursor>=L.limit)return!0;L.cursor++}return i!=L.limit||(L.cursor=r,!1)}function ar(){var r,i,e=L.cursor;return!(!lr(r=L.cursor,2,"ad")||!lr(L.cursor=r,5,"soyad"))&&(L.limit_backward=e,L.cursor=L.limit,i=L.limit-L.cursor,(L.eq_s_b(1,"d")||(L.cursor=L.limit-i,L.eq_s_b(1,"g")))&&cr(i,"a","ı")&&cr(i,"e","i")&&cr(i,"o","u")&&cr(i,"ö","ü"),L.cursor=L.limit,function(){var r;if(L.ket=L.cursor,r=L.find_among_b(q,4))switch(L.bra=L.cursor,r){case 1:L.slice_from("p");break;case 2:L.slice_from("ç");break;case 3:L.slice_from("t");break;case 4:L.slice_from("k")}}(),!0)}this.setCurrent=function(r){L.setCurrent(r)},this.getCurrent=function(){return L.getCurrent()},this.stem=function(){return!!(function(){for(var r,i=L.cursor,e=2;;){for(r=L.cursor;!L.in_grouping(C,97,305);){if(L.cursor>=L.limit)return L.cursor=r,!(0<e||(L.cursor=i,0));L.cursor++}e--}}()&&(L.limit_backward=L.cursor,L.cursor=L.limit,ir(),L.cursor=L.limit,t&&(sr(),L.cursor=L.limit_backward,ar())))}},function(r){return"function"==typeof r.update?r.update(function(r){return i.setCurrent(r),i.stem(),i.getCurrent()}):(i.setCurrent(r),i.stem(),i.getCurrent())}),r.Pipeline.registerFunction(r.tr.stemmer,"stemmer-tr"),r.tr.stopWordFilter=r.generateStopWordFilter("acaba altmış altı ama ancak arada aslında ayrıca bana bazı belki ben benden beni benim beri beş bile bin bir biri birkaç birkez birçok birşey birşeyi biz bizden bize bizi bizim bu buna bunda bundan bunlar bunları bunların bunu bunun burada böyle böylece da daha dahi de defa değil diye diğer doksan dokuz dolayı dolayısıyla dört edecek eden ederek edilecek ediliyor edilmesi ediyor elli en etmesi etti ettiği ettiğini eğer gibi göre halen hangi hatta hem henüz hep hepsi her herhangi herkesin hiç hiçbir iki ile ilgili ise itibaren itibariyle için işte kadar karşın katrilyon kendi kendilerine kendini kendisi kendisine kendisini kez ki kim kimden kime kimi kimse kırk milyar milyon mu mü mı nasıl ne neden nedenle nerde nerede nereye niye niçin o olan olarak oldu olduklarını olduğu olduğunu olmadı olmadığı olmak olması olmayan olmaz olsa olsun olup olur olursa oluyor on ona ondan onlar onlardan onları onların onu onun otuz oysa pek rağmen sadece sanki sekiz seksen sen senden seni senin siz sizden sizi sizin tarafından trilyon tüm var vardı ve veya ya yani yapacak yapmak yaptı yaptıkları yaptığı yaptığını yapılan yapılması yapıyor yedi yerine yetmiş yine yirmi yoksa yüz zaten çok çünkü öyle üzere üç şey şeyden şeyi şeyler şu şuna şunda şundan şunları şunu şöyle".split(" ")),r.Pipeline.registerFunction(r.tr.stopWordFilter,"stopWordFilter-tr")}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/lunr/lunr.vi.js b/freetype/docs/reference/assets/javascripts/lunr/lunr.vi.js
deleted file mode 100644
index 111bc002..00000000
--- a/freetype/docs/reference/assets/javascripts/lunr/lunr.vi.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/*!
- * Lunr languages, `Vietnamese` language
- * https://github.com/MihaiValentin/lunr-languages
- *
- * Copyright 2017, Keerati Thiwanruk
- * http://www.mozilla.org/MPL/
- */
-/*!
- * based on
- * Snowball JavaScript Library v0.3
- * http://code.google.com/p/urim/
- * http://snowball.tartarus.org/
- *
- * Copyright 2010, Oleg Mazko
- * http://www.mozilla.org/MPL/
- */
-!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.vi=function(){this.pipeline.reset(),this.pipeline.add(e.vi.stopWordFilter,e.vi.trimmer)},e.vi.wordCharacters="[A-Za-ẓ̀͐́͑̉̃̓ÂâÊêÔôĂ-ăĐ-đƠ-ơƯ-ư]",e.vi.trimmer=e.trimmerSupport.generateTrimmer(e.vi.wordCharacters),e.Pipeline.registerFunction(e.vi.trimmer,"trimmer-vi"),e.vi.stopWordFilter=e.generateStopWordFilter("là cái nhưng mà".split(" "))}}); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/javascripts/modernizr.86422ebf.js b/freetype/docs/reference/assets/javascripts/modernizr.86422ebf.js
deleted file mode 100644
index 4ab44d72..00000000
--- a/freetype/docs/reference/assets/javascripts/modernizr.86422ebf.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(e,t){for(var n in t)e[n]=t[n]}(window,function(n){var r={};function o(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=n,o.c=r,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)o.d(n,r,function(e){return t[e]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=11)}({11:function(e,t,n){"use strict";n.r(t);n(12)},12:function(e,t){var n;(function(i,d,p){function y(e,t){return typeof e===t}function s(e){var t=S.className,n=c._config.classPrefix||"";if(b&&(t=t.baseVal),c._config.enableJSClass){var r=new RegExp("(^|\\s)"+n+"no-js(\\s|$)");t=t.replace(r,"$1"+n+"js$2")}c._config.enableClasses&&(0<e.length&&(t+=" "+n+e.join(" "+n)),b?S.className.baseVal=t:S.className=t)}function a(e,t){if("object"==typeof e)for(var n in e)v(e,n)&&a(n,e[n]);else{var r=(e=e.toLowerCase()).split("."),o=c[r[0]];if(2===r.length&&(o=o[r[1]]),void 0!==o)return c;t="function"==typeof t?t():t,1===r.length?c[r[0]]=t:(!c[r[0]]||c[r[0]]instanceof Boolean||(c[r[0]]=new Boolean(c[r[0]])),c[r[0]][r[1]]=t),s([(t&&!1!==t?"":"no-")+r.join("-")]),c._trigger(e,t)}return c}function m(){return"function"!=typeof d.createElement?d.createElement(arguments[0]):b?d.createElementNS.call(d,"http://www.w3.org/2000/svg",arguments[0]):d.createElement.apply(d,arguments)}function o(e,t,n,r){var o,i,s,a,l,u="modernizr",f=m("div"),c=((l=d.body)||((l=m(b?"svg":"body")).fake=!0),l);if(parseInt(n,10))for(;n--;)(s=m("div")).id=r?r[n]:u+(n+1),f.appendChild(s);return(o=m("style")).type="text/css",o.id="s"+u,(c.fake?c:f).appendChild(o),c.appendChild(f),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(d.createTextNode(e)),f.id=u,c.fake&&(c.style.background="",c.style.overflow="hidden",a=S.style.overflow,S.style.overflow="hidden",S.appendChild(c)),i=t(f,e),c.fake?(c.parentNode.removeChild(c),S.style.overflow=a,S.offsetHeight):f.parentNode.removeChild(f),!!i}function l(e){return e.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()}).replace(/^ms-/,"-ms-")}function h(e,t){var n=e.length;if("CSS"in i&&"supports"in i.CSS){for(;n--;)if(i.CSS.supports(l(e[n]),t))return!0;return!1}if("CSSSupportsRule"in i){for(var r=[];n--;)r.push("("+l(e[n])+":"+t+")");return o("@supports ("+(r=r.join(" or "))+") { #modernizr { position: absolute; } }",function(e){return"absolute"===function(e,t,n){var r;if("getComputedStyle"in i){r=getComputedStyle.call(i,e,t);var o=i.console;null!==r?n&&(r=r.getPropertyValue(n)):o&&o[o.error?"error":"log"].call(o,"getComputedStyle returning null, its possible modernizr test results are inaccurate")}else r=!t&&e.currentStyle&&e.currentStyle[n];return r}(e,null,"position")})}return p}function u(e,t){return function(){return e.apply(t,arguments)}}function r(e,t,n,r,o){var i=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+w.join(i+" ")+i).split(" ");return y(t,"string")||y(t,"undefined")?function(e,t,n,r){function o(){s&&(delete T.style,delete T.modElem)}if(r=!y(r,"undefined")&&r,!y(n,"undefined")){var i=h(e,n);if(!y(i,"undefined"))return i}for(var s,a,l,u,f,c=["modernizr","tspan","samp"];!T.style&&c.length;)s=!0,T.modElem=m(c.shift()),T.style=T.modElem.style;for(l=e.length,a=0;a<l;a++)if(u=e[a],f=T.style[u],!!~(""+u).indexOf("-")&&(u=u.replace(/([a-z])-([a-z])/g,function(e,t,n){return t+n.toUpperCase()}).replace(/^-/,"")),T.style[u]!==p){if(r||y(n,"undefined"))return o(),"pfx"!==t||u;try{T.style[u]=n}catch(e){}if(T.style[u]!==f)return o(),"pfx"!==t||u}return o(),!1}(s,t,r,o):function(e,t,n){var r;for(var o in e)if(e[o]in t)return!1===n?e[o]:y(r=t[e[o]],"function")?u(r,n||t):r;return!1}(s=(e+" "+P.join(i+" ")+i).split(" "),t,n)}function e(e,t,n){return r(e,p,p,t,n)}var f=[],t={_version:"3.8.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){f.push({name:e,fn:t,options:n})},addAsyncTest:function(e){f.push({name:null,fn:e})}},c=function(){};c.prototype=t,c=new c;var v,n,g=[],S=d.documentElement,b="svg"===S.nodeName.toLowerCase();v=y(n={}.hasOwnProperty,"undefined")||y(n.call,"undefined")?function(e,t){return t in e&&y(e.constructor.prototype[t],"undefined")}:function(e,t){return n.call(e,t)},t._l={},t.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),c.hasOwnProperty(e)&&setTimeout(function(){c._trigger(e,c[e])},0)},t._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e;for(e=0;e<n.length;e++)(0,n[e])(t)},0),delete this._l[e]}},c._q.push(function(){t.addTest=a}),c.addTest("json","JSON"in i&&"parse"in JSON&&"stringify"in JSON),c.addTest("svg",!!d.createElementNS&&!!d.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect);var C=t.testStyles=o;c.addTest("checked",function(){return C("#modernizr {position:absolute} #modernizr input {margin-left:10px} #modernizr :checked {margin-left:20px;display:block}",function(e){var t=m("input");return t.setAttribute("type","checkbox"),t.setAttribute("checked","checked"),e.appendChild(t),20===t.offsetLeft})}),c.addTest("target",function(){var e=i.document;if(!("querySelectorAll"in e))return!1;try{return e.querySelectorAll(":target"),!0}catch(e){return!1}}),c.addTest("dataset",function(){var e=m("div");return e.setAttribute("data-a-b","c"),!(!e.dataset||"c"!==e.dataset.aB)}),c.addTest("details",function(){var t,n=m("details");return"open"in n&&(C("#modernizr details{display:block}",function(e){e.appendChild(n),n.innerHTML="<summary>a</summary>b",t=n.offsetHeight,n.open=!0,t=t!==n.offsetHeight}),t)}),c.addTest("fetch","fetch"in i);var _="Moz O ms Webkit",w=t._config.usePrefixes?_.split(" "):[];t._cssomPrefixes=w;var x={elem:m("modernizr")};c._q.push(function(){delete x.elem});var T={style:x.elem.style};c._q.unshift(function(){delete T.style});var P=t._config.usePrefixes?_.toLowerCase().split(" "):[];t._domPrefixes=P,t.testAllProps=r,t.testAllProps=e;var j="CSS"in i&&"supports"in i.CSS,O="supportsCSS"in i;c.addTest("supports",j||O),c.addTest("csstransforms3d",function(){return!!e("perspective","1px",!0)}),function(){var e,t,n,r,o,i;for(var s in f)if(f.hasOwnProperty(s)){if(e=[],(t=f[s]).name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;n<t.options.aliases.length;n++)e.push(t.options.aliases[n].toLowerCase());for(r=y(t.fn,"function")?t.fn():t.fn,o=0;o<e.length;o++)1===(i=e[o].split(".")).length?c[i[0]]=r:(c[i[0]]&&(!c[i[0]]||c[i[0]]instanceof Boolean)||(c[i[0]]=new Boolean(c[i[0]])),c[i[0]][i[1]]=r),g.push((r?"":"no-")+i.join("-"))}}(),s(g),delete t.addTest,delete t.addAsyncTest;for(var z=0;z<c._q.length;z++)c._q[z]();i.Modernizr=c})(n=window,document),e.exports=n.Modernizr}})); \ No newline at end of file
diff --git a/freetype/docs/reference/assets/stylesheets/application-palette.a8b3c06d.css b/freetype/docs/reference/assets/stylesheets/application-palette.a8b3c06d.css
deleted file mode 100644
index e07df058..00000000
--- a/freetype/docs/reference/assets/stylesheets/application-palette.a8b3c06d.css
+++ /dev/null
@@ -1 +0,0 @@
-button[data-md-color-accent],button[data-md-color-primary]{width:6.5rem;margin-bottom:.2rem;padding:1.2rem .4rem .2rem;-webkit-transition:background-color .25s,opacity .25s;transition:background-color .25s,opacity .25s;border-radius:.1rem;color:#fff;font-size:.64rem;text-align:left;cursor:pointer}button[data-md-color-accent]:hover,button[data-md-color-primary]:hover{opacity:.75}button[data-md-color-primary=red]{background-color:#ef5350}[data-md-color-primary=red] .md-typeset a{color:#ef5350}[data-md-color-primary=red] .md-header,[data-md-color-primary=red] .md-hero{background-color:#ef5350}[data-md-color-primary=red] .md-nav__link--active,[data-md-color-primary=red] .md-nav__link:active{color:#ef5350}[data-md-color-primary=red] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=pink]{background-color:#e91e63}[data-md-color-primary=pink] .md-typeset a{color:#e91e63}[data-md-color-primary=pink] .md-header,[data-md-color-primary=pink] .md-hero{background-color:#e91e63}[data-md-color-primary=pink] .md-nav__link--active,[data-md-color-primary=pink] .md-nav__link:active{color:#e91e63}[data-md-color-primary=pink] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=purple]{background-color:#ab47bc}[data-md-color-primary=purple] .md-typeset a{color:#ab47bc}[data-md-color-primary=purple] .md-header,[data-md-color-primary=purple] .md-hero{background-color:#ab47bc}[data-md-color-primary=purple] .md-nav__link--active,[data-md-color-primary=purple] .md-nav__link:active{color:#ab47bc}[data-md-color-primary=purple] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=deep-purple]{background-color:#7e57c2}[data-md-color-primary=deep-purple] .md-typeset a{color:#7e57c2}[data-md-color-primary=deep-purple] .md-header,[data-md-color-primary=deep-purple] .md-hero{background-color:#7e57c2}[data-md-color-primary=deep-purple] .md-nav__link--active,[data-md-color-primary=deep-purple] .md-nav__link:active{color:#7e57c2}[data-md-color-primary=deep-purple] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=indigo]{background-color:#3f51b5}[data-md-color-primary=indigo] .md-typeset a{color:#3f51b5}[data-md-color-primary=indigo] .md-header,[data-md-color-primary=indigo] .md-hero{background-color:#3f51b5}[data-md-color-primary=indigo] .md-nav__link--active,[data-md-color-primary=indigo] .md-nav__link:active{color:#3f51b5}[data-md-color-primary=indigo] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=blue]{background-color:#2196f3}[data-md-color-primary=blue] .md-typeset a{color:#2196f3}[data-md-color-primary=blue] .md-header,[data-md-color-primary=blue] .md-hero{background-color:#2196f3}[data-md-color-primary=blue] .md-nav__link--active,[data-md-color-primary=blue] .md-nav__link:active{color:#2196f3}[data-md-color-primary=blue] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=light-blue]{background-color:#03a9f4}[data-md-color-primary=light-blue] .md-typeset a{color:#03a9f4}[data-md-color-primary=light-blue] .md-header,[data-md-color-primary=light-blue] .md-hero{background-color:#03a9f4}[data-md-color-primary=light-blue] .md-nav__link--active,[data-md-color-primary=light-blue] .md-nav__link:active{color:#03a9f4}[data-md-color-primary=light-blue] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=cyan]{background-color:#00bcd4}[data-md-color-primary=cyan] .md-typeset a{color:#00bcd4}[data-md-color-primary=cyan] .md-header,[data-md-color-primary=cyan] .md-hero{background-color:#00bcd4}[data-md-color-primary=cyan] .md-nav__link--active,[data-md-color-primary=cyan] .md-nav__link:active{color:#00bcd4}[data-md-color-primary=cyan] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=teal]{background-color:#009688}[data-md-color-primary=teal] .md-typeset a{color:#009688}[data-md-color-primary=teal] .md-header,[data-md-color-primary=teal] .md-hero{background-color:#009688}[data-md-color-primary=teal] .md-nav__link--active,[data-md-color-primary=teal] .md-nav__link:active{color:#009688}[data-md-color-primary=teal] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=green]{background-color:#4caf50}[data-md-color-primary=green] .md-typeset a{color:#4caf50}[data-md-color-primary=green] .md-header,[data-md-color-primary=green] .md-hero{background-color:#4caf50}[data-md-color-primary=green] .md-nav__link--active,[data-md-color-primary=green] .md-nav__link:active{color:#4caf50}[data-md-color-primary=green] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=light-green]{background-color:#7cb342}[data-md-color-primary=light-green] .md-typeset a{color:#7cb342}[data-md-color-primary=light-green] .md-header,[data-md-color-primary=light-green] .md-hero{background-color:#7cb342}[data-md-color-primary=light-green] .md-nav__link--active,[data-md-color-primary=light-green] .md-nav__link:active{color:#7cb342}[data-md-color-primary=light-green] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=lime]{background-color:#c0ca33}[data-md-color-primary=lime] .md-typeset a{color:#c0ca33}[data-md-color-primary=lime] .md-header,[data-md-color-primary=lime] .md-hero{background-color:#c0ca33}[data-md-color-primary=lime] .md-nav__link--active,[data-md-color-primary=lime] .md-nav__link:active{color:#c0ca33}[data-md-color-primary=lime] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=yellow]{background-color:#f9a825}[data-md-color-primary=yellow] .md-typeset a{color:#f9a825}[data-md-color-primary=yellow] .md-header,[data-md-color-primary=yellow] .md-hero{background-color:#f9a825}[data-md-color-primary=yellow] .md-nav__link--active,[data-md-color-primary=yellow] .md-nav__link:active{color:#f9a825}[data-md-color-primary=yellow] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=amber]{background-color:#ffa000}[data-md-color-primary=amber] .md-typeset a{color:#ffa000}[data-md-color-primary=amber] .md-header,[data-md-color-primary=amber] .md-hero{background-color:#ffa000}[data-md-color-primary=amber] .md-nav__link--active,[data-md-color-primary=amber] .md-nav__link:active{color:#ffa000}[data-md-color-primary=amber] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=orange]{background-color:#fb8c00}[data-md-color-primary=orange] .md-typeset a{color:#fb8c00}[data-md-color-primary=orange] .md-header,[data-md-color-primary=orange] .md-hero{background-color:#fb8c00}[data-md-color-primary=orange] .md-nav__link--active,[data-md-color-primary=orange] .md-nav__link:active{color:#fb8c00}[data-md-color-primary=orange] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=deep-orange]{background-color:#ff7043}[data-md-color-primary=deep-orange] .md-typeset a{color:#ff7043}[data-md-color-primary=deep-orange] .md-header,[data-md-color-primary=deep-orange] .md-hero{background-color:#ff7043}[data-md-color-primary=deep-orange] .md-nav__link--active,[data-md-color-primary=deep-orange] .md-nav__link:active{color:#ff7043}[data-md-color-primary=deep-orange] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=brown]{background-color:#795548}[data-md-color-primary=brown] .md-typeset a{color:#795548}[data-md-color-primary=brown] .md-header,[data-md-color-primary=brown] .md-hero{background-color:#795548}[data-md-color-primary=brown] .md-nav__link--active,[data-md-color-primary=brown] .md-nav__link:active{color:#795548}[data-md-color-primary=brown] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=grey]{background-color:#757575}[data-md-color-primary=grey] .md-typeset a{color:#757575}[data-md-color-primary=grey] .md-header,[data-md-color-primary=grey] .md-hero{background-color:#757575}[data-md-color-primary=grey] .md-nav__link--active,[data-md-color-primary=grey] .md-nav__link:active{color:#757575}[data-md-color-primary=grey] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=blue-grey]{background-color:#546e7a}[data-md-color-primary=blue-grey] .md-typeset a{color:#546e7a}[data-md-color-primary=blue-grey] .md-header,[data-md-color-primary=blue-grey] .md-hero{background-color:#546e7a}[data-md-color-primary=blue-grey] .md-nav__link--active,[data-md-color-primary=blue-grey] .md-nav__link:active{color:#546e7a}[data-md-color-primary=blue-grey] .md-nav__item--nested>.md-nav__link{color:inherit}button[data-md-color-primary=white]{box-shadow:inset 0 0 .05rem rgba(0,0,0,.54)}[data-md-color-primary=white] .md-header,[data-md-color-primary=white] .md-hero,button[data-md-color-primary=white]{background-color:#fff;color:rgba(0,0,0,.87)}[data-md-color-primary=white] .md-hero--expand{border-bottom:.05rem solid rgba(0,0,0,.07)}[data-md-color-primary=black] .md-header,[data-md-color-primary=black] .md-hero,button[data-md-color-primary=black]{background-color:#000}button[data-md-color-accent=red]{background-color:#ff1744}[data-md-color-accent=red] .md-typeset a:active,[data-md-color-accent=red] .md-typeset a:hover{color:#ff1744}[data-md-color-accent=red] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=red] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ff1744}[data-md-color-accent=red] .md-nav__link:focus,[data-md-color-accent=red] .md-nav__link:hover,[data-md-color-accent=red] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=red] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=red] .md-typeset .md-clipboard:active:before,[data-md-color-accent=red] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=red] .md-typeset [id] .headerlink:focus,[data-md-color-accent=red] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=red] .md-typeset [id]:target .headerlink{color:#ff1744}[data-md-color-accent=red] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff1744}[data-md-color-accent=red] .md-search-result__link:hover,[data-md-color-accent=red] .md-search-result__link[data-md-state=active]{background-color:rgba(255,23,68,.1)}[data-md-color-accent=red] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff1744}[data-md-color-accent=red] .md-source-file:hover:before{background-color:#ff1744}button[data-md-color-accent=pink]{background-color:#f50057}[data-md-color-accent=pink] .md-typeset a:active,[data-md-color-accent=pink] .md-typeset a:hover{color:#f50057}[data-md-color-accent=pink] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=pink] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#f50057}[data-md-color-accent=pink] .md-nav__link:focus,[data-md-color-accent=pink] .md-nav__link:hover,[data-md-color-accent=pink] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=pink] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=pink] .md-typeset .md-clipboard:active:before,[data-md-color-accent=pink] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=pink] .md-typeset [id] .headerlink:focus,[data-md-color-accent=pink] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=pink] .md-typeset [id]:target .headerlink{color:#f50057}[data-md-color-accent=pink] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#f50057}[data-md-color-accent=pink] .md-search-result__link:hover,[data-md-color-accent=pink] .md-search-result__link[data-md-state=active]{background-color:rgba(245,0,87,.1)}[data-md-color-accent=pink] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#f50057}[data-md-color-accent=pink] .md-source-file:hover:before{background-color:#f50057}button[data-md-color-accent=purple]{background-color:#e040fb}[data-md-color-accent=purple] .md-typeset a:active,[data-md-color-accent=purple] .md-typeset a:hover{color:#e040fb}[data-md-color-accent=purple] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=purple] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#e040fb}[data-md-color-accent=purple] .md-nav__link:focus,[data-md-color-accent=purple] .md-nav__link:hover,[data-md-color-accent=purple] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=purple] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=purple] .md-typeset .md-clipboard:active:before,[data-md-color-accent=purple] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=purple] .md-typeset [id] .headerlink:focus,[data-md-color-accent=purple] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=purple] .md-typeset [id]:target .headerlink{color:#e040fb}[data-md-color-accent=purple] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#e040fb}[data-md-color-accent=purple] .md-search-result__link:hover,[data-md-color-accent=purple] .md-search-result__link[data-md-state=active]{background-color:rgba(224,64,251,.1)}[data-md-color-accent=purple] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#e040fb}[data-md-color-accent=purple] .md-source-file:hover:before{background-color:#e040fb}button[data-md-color-accent=deep-purple]{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-typeset a:active,[data-md-color-accent=deep-purple] .md-typeset a:hover{color:#7c4dff}[data-md-color-accent=deep-purple] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=deep-purple] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-nav__link:focus,[data-md-color-accent=deep-purple] .md-nav__link:hover,[data-md-color-accent=deep-purple] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=deep-purple] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=deep-purple] .md-typeset .md-clipboard:active:before,[data-md-color-accent=deep-purple] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=deep-purple] .md-typeset [id] .headerlink:focus,[data-md-color-accent=deep-purple] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=deep-purple] .md-typeset [id]:target .headerlink{color:#7c4dff}[data-md-color-accent=deep-purple] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-search-result__link:hover,[data-md-color-accent=deep-purple] .md-search-result__link[data-md-state=active]{background-color:rgba(124,77,255,.1)}[data-md-color-accent=deep-purple] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#7c4dff}[data-md-color-accent=deep-purple] .md-source-file:hover:before{background-color:#7c4dff}button[data-md-color-accent=indigo]{background-color:#536dfe}[data-md-color-accent=indigo] .md-typeset a:active,[data-md-color-accent=indigo] .md-typeset a:hover{color:#536dfe}[data-md-color-accent=indigo] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=indigo] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}[data-md-color-accent=indigo] .md-nav__link:focus,[data-md-color-accent=indigo] .md-nav__link:hover,[data-md-color-accent=indigo] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=indigo] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=indigo] .md-typeset .md-clipboard:active:before,[data-md-color-accent=indigo] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=indigo] .md-typeset [id] .headerlink:focus,[data-md-color-accent=indigo] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=indigo] .md-typeset [id]:target .headerlink{color:#536dfe}[data-md-color-accent=indigo] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}[data-md-color-accent=indigo] .md-search-result__link:hover,[data-md-color-accent=indigo] .md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}[data-md-color-accent=indigo] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}[data-md-color-accent=indigo] .md-source-file:hover:before{background-color:#536dfe}button[data-md-color-accent=blue]{background-color:#448aff}[data-md-color-accent=blue] .md-typeset a:active,[data-md-color-accent=blue] .md-typeset a:hover{color:#448aff}[data-md-color-accent=blue] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=blue] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#448aff}[data-md-color-accent=blue] .md-nav__link:focus,[data-md-color-accent=blue] .md-nav__link:hover,[data-md-color-accent=blue] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=blue] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=blue] .md-typeset .md-clipboard:active:before,[data-md-color-accent=blue] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=blue] .md-typeset [id] .headerlink:focus,[data-md-color-accent=blue] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=blue] .md-typeset [id]:target .headerlink{color:#448aff}[data-md-color-accent=blue] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#448aff}[data-md-color-accent=blue] .md-search-result__link:hover,[data-md-color-accent=blue] .md-search-result__link[data-md-state=active]{background-color:rgba(68,138,255,.1)}[data-md-color-accent=blue] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#448aff}[data-md-color-accent=blue] .md-source-file:hover:before{background-color:#448aff}button[data-md-color-accent=light-blue]{background-color:#0091ea}[data-md-color-accent=light-blue] .md-typeset a:active,[data-md-color-accent=light-blue] .md-typeset a:hover{color:#0091ea}[data-md-color-accent=light-blue] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=light-blue] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#0091ea}[data-md-color-accent=light-blue] .md-nav__link:focus,[data-md-color-accent=light-blue] .md-nav__link:hover,[data-md-color-accent=light-blue] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=light-blue] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=light-blue] .md-typeset .md-clipboard:active:before,[data-md-color-accent=light-blue] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=light-blue] .md-typeset [id] .headerlink:focus,[data-md-color-accent=light-blue] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=light-blue] .md-typeset [id]:target .headerlink{color:#0091ea}[data-md-color-accent=light-blue] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#0091ea}[data-md-color-accent=light-blue] .md-search-result__link:hover,[data-md-color-accent=light-blue] .md-search-result__link[data-md-state=active]{background-color:rgba(0,145,234,.1)}[data-md-color-accent=light-blue] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#0091ea}[data-md-color-accent=light-blue] .md-source-file:hover:before{background-color:#0091ea}button[data-md-color-accent=cyan]{background-color:#00b8d4}[data-md-color-accent=cyan] .md-typeset a:active,[data-md-color-accent=cyan] .md-typeset a:hover{color:#00b8d4}[data-md-color-accent=cyan] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=cyan] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#00b8d4}[data-md-color-accent=cyan] .md-nav__link:focus,[data-md-color-accent=cyan] .md-nav__link:hover,[data-md-color-accent=cyan] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=cyan] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=cyan] .md-typeset .md-clipboard:active:before,[data-md-color-accent=cyan] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=cyan] .md-typeset [id] .headerlink:focus,[data-md-color-accent=cyan] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=cyan] .md-typeset [id]:target .headerlink{color:#00b8d4}[data-md-color-accent=cyan] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00b8d4}[data-md-color-accent=cyan] .md-search-result__link:hover,[data-md-color-accent=cyan] .md-search-result__link[data-md-state=active]{background-color:rgba(0,184,212,.1)}[data-md-color-accent=cyan] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00b8d4}[data-md-color-accent=cyan] .md-source-file:hover:before{background-color:#00b8d4}button[data-md-color-accent=teal]{background-color:#00bfa5}[data-md-color-accent=teal] .md-typeset a:active,[data-md-color-accent=teal] .md-typeset a:hover{color:#00bfa5}[data-md-color-accent=teal] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=teal] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#00bfa5}[data-md-color-accent=teal] .md-nav__link:focus,[data-md-color-accent=teal] .md-nav__link:hover,[data-md-color-accent=teal] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=teal] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=teal] .md-typeset .md-clipboard:active:before,[data-md-color-accent=teal] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=teal] .md-typeset [id] .headerlink:focus,[data-md-color-accent=teal] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=teal] .md-typeset [id]:target .headerlink{color:#00bfa5}[data-md-color-accent=teal] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00bfa5}[data-md-color-accent=teal] .md-search-result__link:hover,[data-md-color-accent=teal] .md-search-result__link[data-md-state=active]{background-color:rgba(0,191,165,.1)}[data-md-color-accent=teal] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00bfa5}[data-md-color-accent=teal] .md-source-file:hover:before{background-color:#00bfa5}button[data-md-color-accent=green]{background-color:#00c853}[data-md-color-accent=green] .md-typeset a:active,[data-md-color-accent=green] .md-typeset a:hover{color:#00c853}[data-md-color-accent=green] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=green] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#00c853}[data-md-color-accent=green] .md-nav__link:focus,[data-md-color-accent=green] .md-nav__link:hover,[data-md-color-accent=green] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=green] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=green] .md-typeset .md-clipboard:active:before,[data-md-color-accent=green] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=green] .md-typeset [id] .headerlink:focus,[data-md-color-accent=green] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=green] .md-typeset [id]:target .headerlink{color:#00c853}[data-md-color-accent=green] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00c853}[data-md-color-accent=green] .md-search-result__link:hover,[data-md-color-accent=green] .md-search-result__link[data-md-state=active]{background-color:rgba(0,200,83,.1)}[data-md-color-accent=green] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#00c853}[data-md-color-accent=green] .md-source-file:hover:before{background-color:#00c853}button[data-md-color-accent=light-green]{background-color:#64dd17}[data-md-color-accent=light-green] .md-typeset a:active,[data-md-color-accent=light-green] .md-typeset a:hover{color:#64dd17}[data-md-color-accent=light-green] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=light-green] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#64dd17}[data-md-color-accent=light-green] .md-nav__link:focus,[data-md-color-accent=light-green] .md-nav__link:hover,[data-md-color-accent=light-green] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=light-green] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=light-green] .md-typeset .md-clipboard:active:before,[data-md-color-accent=light-green] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=light-green] .md-typeset [id] .headerlink:focus,[data-md-color-accent=light-green] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=light-green] .md-typeset [id]:target .headerlink{color:#64dd17}[data-md-color-accent=light-green] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#64dd17}[data-md-color-accent=light-green] .md-search-result__link:hover,[data-md-color-accent=light-green] .md-search-result__link[data-md-state=active]{background-color:rgba(100,221,23,.1)}[data-md-color-accent=light-green] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#64dd17}[data-md-color-accent=light-green] .md-source-file:hover:before{background-color:#64dd17}button[data-md-color-accent=lime]{background-color:#aeea00}[data-md-color-accent=lime] .md-typeset a:active,[data-md-color-accent=lime] .md-typeset a:hover{color:#aeea00}[data-md-color-accent=lime] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=lime] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#aeea00}[data-md-color-accent=lime] .md-nav__link:focus,[data-md-color-accent=lime] .md-nav__link:hover,[data-md-color-accent=lime] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=lime] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=lime] .md-typeset .md-clipboard:active:before,[data-md-color-accent=lime] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=lime] .md-typeset [id] .headerlink:focus,[data-md-color-accent=lime] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=lime] .md-typeset [id]:target .headerlink{color:#aeea00}[data-md-color-accent=lime] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#aeea00}[data-md-color-accent=lime] .md-search-result__link:hover,[data-md-color-accent=lime] .md-search-result__link[data-md-state=active]{background-color:rgba(174,234,0,.1)}[data-md-color-accent=lime] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#aeea00}[data-md-color-accent=lime] .md-source-file:hover:before{background-color:#aeea00}button[data-md-color-accent=yellow]{background-color:#ffd600}[data-md-color-accent=yellow] .md-typeset a:active,[data-md-color-accent=yellow] .md-typeset a:hover{color:#ffd600}[data-md-color-accent=yellow] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=yellow] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ffd600}[data-md-color-accent=yellow] .md-nav__link:focus,[data-md-color-accent=yellow] .md-nav__link:hover,[data-md-color-accent=yellow] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=yellow] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=yellow] .md-typeset .md-clipboard:active:before,[data-md-color-accent=yellow] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=yellow] .md-typeset [id] .headerlink:focus,[data-md-color-accent=yellow] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=yellow] .md-typeset [id]:target .headerlink{color:#ffd600}[data-md-color-accent=yellow] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffd600}[data-md-color-accent=yellow] .md-search-result__link:hover,[data-md-color-accent=yellow] .md-search-result__link[data-md-state=active]{background-color:rgba(255,214,0,.1)}[data-md-color-accent=yellow] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffd600}[data-md-color-accent=yellow] .md-source-file:hover:before{background-color:#ffd600}button[data-md-color-accent=amber]{background-color:#ffab00}[data-md-color-accent=amber] .md-typeset a:active,[data-md-color-accent=amber] .md-typeset a:hover{color:#ffab00}[data-md-color-accent=amber] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=amber] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ffab00}[data-md-color-accent=amber] .md-nav__link:focus,[data-md-color-accent=amber] .md-nav__link:hover,[data-md-color-accent=amber] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=amber] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=amber] .md-typeset .md-clipboard:active:before,[data-md-color-accent=amber] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=amber] .md-typeset [id] .headerlink:focus,[data-md-color-accent=amber] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=amber] .md-typeset [id]:target .headerlink{color:#ffab00}[data-md-color-accent=amber] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffab00}[data-md-color-accent=amber] .md-search-result__link:hover,[data-md-color-accent=amber] .md-search-result__link[data-md-state=active]{background-color:rgba(255,171,0,.1)}[data-md-color-accent=amber] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ffab00}[data-md-color-accent=amber] .md-source-file:hover:before{background-color:#ffab00}button[data-md-color-accent=orange]{background-color:#ff9100}[data-md-color-accent=orange] .md-typeset a:active,[data-md-color-accent=orange] .md-typeset a:hover{color:#ff9100}[data-md-color-accent=orange] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=orange] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ff9100}[data-md-color-accent=orange] .md-nav__link:focus,[data-md-color-accent=orange] .md-nav__link:hover,[data-md-color-accent=orange] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=orange] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=orange] .md-typeset .md-clipboard:active:before,[data-md-color-accent=orange] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=orange] .md-typeset [id] .headerlink:focus,[data-md-color-accent=orange] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=orange] .md-typeset [id]:target .headerlink{color:#ff9100}[data-md-color-accent=orange] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff9100}[data-md-color-accent=orange] .md-search-result__link:hover,[data-md-color-accent=orange] .md-search-result__link[data-md-state=active]{background-color:rgba(255,145,0,.1)}[data-md-color-accent=orange] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff9100}[data-md-color-accent=orange] .md-source-file:hover:before{background-color:#ff9100}button[data-md-color-accent=deep-orange]{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-typeset a:active,[data-md-color-accent=deep-orange] .md-typeset a:hover{color:#ff6e40}[data-md-color-accent=deep-orange] .md-typeset .codehilite pre::-webkit-scrollbar-thumb:hover,[data-md-color-accent=deep-orange] .md-typeset pre code::-webkit-scrollbar-thumb:hover{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-nav__link:focus,[data-md-color-accent=deep-orange] .md-nav__link:hover,[data-md-color-accent=deep-orange] .md-typeset .footnote li:hover .footnote-backref:hover,[data-md-color-accent=deep-orange] .md-typeset .footnote li:target .footnote-backref,[data-md-color-accent=deep-orange] .md-typeset .md-clipboard:active:before,[data-md-color-accent=deep-orange] .md-typeset .md-clipboard:hover:before,[data-md-color-accent=deep-orange] .md-typeset [id] .headerlink:focus,[data-md-color-accent=deep-orange] .md-typeset [id]:hover .headerlink:hover,[data-md-color-accent=deep-orange] .md-typeset [id]:target .headerlink{color:#ff6e40}[data-md-color-accent=deep-orange] .md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-search-result__link:hover,[data-md-color-accent=deep-orange] .md-search-result__link[data-md-state=active]{background-color:rgba(255,110,64,.1)}[data-md-color-accent=deep-orange] .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#ff6e40}[data-md-color-accent=deep-orange] .md-source-file:hover:before{background-color:#ff6e40}@media only screen and (max-width:59.9375em){[data-md-color-primary=red] .md-nav__source{background-color:rgba(190,66,64,.9675)}[data-md-color-primary=pink] .md-nav__source{background-color:rgba(185,24,79,.9675)}[data-md-color-primary=purple] .md-nav__source{background-color:rgba(136,57,150,.9675)}[data-md-color-primary=deep-purple] .md-nav__source{background-color:rgba(100,69,154,.9675)}[data-md-color-primary=indigo] .md-nav__source{background-color:rgba(50,64,144,.9675)}[data-md-color-primary=blue] .md-nav__source{background-color:rgba(26,119,193,.9675)}[data-md-color-primary=light-blue] .md-nav__source{background-color:rgba(2,134,194,.9675)}[data-md-color-primary=cyan] .md-nav__source{background-color:rgba(0,150,169,.9675)}[data-md-color-primary=teal] .md-nav__source{background-color:rgba(0,119,108,.9675)}[data-md-color-primary=green] .md-nav__source{background-color:rgba(60,139,64,.9675)}[data-md-color-primary=light-green] .md-nav__source{background-color:rgba(99,142,53,.9675)}[data-md-color-primary=lime] .md-nav__source{background-color:rgba(153,161,41,.9675)}[data-md-color-primary=yellow] .md-nav__source{background-color:rgba(198,134,29,.9675)}[data-md-color-primary=amber] .md-nav__source{background-color:rgba(203,127,0,.9675)}[data-md-color-primary=orange] .md-nav__source{background-color:rgba(200,111,0,.9675)}[data-md-color-primary=deep-orange] .md-nav__source{background-color:rgba(203,89,53,.9675)}[data-md-color-primary=brown] .md-nav__source{background-color:rgba(96,68,57,.9675)}[data-md-color-primary=grey] .md-nav__source{background-color:rgba(93,93,93,.9675)}[data-md-color-primary=blue-grey] .md-nav__source{background-color:rgba(67,88,97,.9675)}[data-md-color-primary=white] .md-nav__source{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.87)}[data-md-color-primary=black] .md-nav__source{background-color:#404040}}@media only screen and (max-width:76.1875em){html [data-md-color-primary=red] .md-nav--primary .md-nav__title--site{background-color:#ef5350}html [data-md-color-primary=pink] .md-nav--primary .md-nav__title--site{background-color:#e91e63}html [data-md-color-primary=purple] .md-nav--primary .md-nav__title--site{background-color:#ab47bc}html [data-md-color-primary=deep-purple] .md-nav--primary .md-nav__title--site{background-color:#7e57c2}html [data-md-color-primary=indigo] .md-nav--primary .md-nav__title--site{background-color:#3f51b5}html [data-md-color-primary=blue] .md-nav--primary .md-nav__title--site{background-color:#2196f3}html [data-md-color-primary=light-blue] .md-nav--primary .md-nav__title--site{background-color:#03a9f4}html [data-md-color-primary=cyan] .md-nav--primary .md-nav__title--site{background-color:#00bcd4}html [data-md-color-primary=teal] .md-nav--primary .md-nav__title--site{background-color:#009688}html [data-md-color-primary=green] .md-nav--primary .md-nav__title--site{background-color:#4caf50}html [data-md-color-primary=light-green] .md-nav--primary .md-nav__title--site{background-color:#7cb342}html [data-md-color-primary=lime] .md-nav--primary .md-nav__title--site{background-color:#c0ca33}html [data-md-color-primary=yellow] .md-nav--primary .md-nav__title--site{background-color:#f9a825}html [data-md-color-primary=amber] .md-nav--primary .md-nav__title--site{background-color:#ffa000}html [data-md-color-primary=orange] .md-nav--primary .md-nav__title--site{background-color:#fb8c00}html [data-md-color-primary=deep-orange] .md-nav--primary .md-nav__title--site{background-color:#ff7043}html [data-md-color-primary=brown] .md-nav--primary .md-nav__title--site{background-color:#795548}html [data-md-color-primary=grey] .md-nav--primary .md-nav__title--site{background-color:#757575}html [data-md-color-primary=blue-grey] .md-nav--primary .md-nav__title--site{background-color:#546e7a}html [data-md-color-primary=white] .md-nav--primary .md-nav__title--site{background-color:#fff;color:rgba(0,0,0,.87)}[data-md-color-primary=white] .md-hero{border-bottom:.05rem solid rgba(0,0,0,.07)}html [data-md-color-primary=black] .md-nav--primary .md-nav__title--site{background-color:#000}}@media only screen and (min-width:76.25em){[data-md-color-primary=red] .md-tabs{background-color:#ef5350}[data-md-color-primary=pink] .md-tabs{background-color:#e91e63}[data-md-color-primary=purple] .md-tabs{background-color:#ab47bc}[data-md-color-primary=deep-purple] .md-tabs{background-color:#7e57c2}[data-md-color-primary=indigo] .md-tabs{background-color:#3f51b5}[data-md-color-primary=blue] .md-tabs{background-color:#2196f3}[data-md-color-primary=light-blue] .md-tabs{background-color:#03a9f4}[data-md-color-primary=cyan] .md-tabs{background-color:#00bcd4}[data-md-color-primary=teal] .md-tabs{background-color:#009688}[data-md-color-primary=green] .md-tabs{background-color:#4caf50}[data-md-color-primary=light-green] .md-tabs{background-color:#7cb342}[data-md-color-primary=lime] .md-tabs{background-color:#c0ca33}[data-md-color-primary=yellow] .md-tabs{background-color:#f9a825}[data-md-color-primary=amber] .md-tabs{background-color:#ffa000}[data-md-color-primary=orange] .md-tabs{background-color:#fb8c00}[data-md-color-primary=deep-orange] .md-tabs{background-color:#ff7043}[data-md-color-primary=brown] .md-tabs{background-color:#795548}[data-md-color-primary=grey] .md-tabs{background-color:#757575}[data-md-color-primary=blue-grey] .md-tabs{background-color:#546e7a}[data-md-color-primary=white] .md-tabs{border-bottom:.05rem solid rgba(0,0,0,.07);background-color:#fff;color:rgba(0,0,0,.87)}[data-md-color-primary=black] .md-tabs{background-color:#000}}@media only screen and (min-width:60em){[data-md-color-primary=white] .md-search__input{background-color:rgba(0,0,0,.07)}[data-md-color-primary=white] .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-color-primary=white] .md-search__input::-moz-placeholder{color:rgba(0,0,0,.54)}[data-md-color-primary=white] .md-search__input:-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-color-primary=white] .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-color-primary=white] .md-search__input::placeholder{color:rgba(0,0,0,.54)}[data-md-color-primary=black] .md-search__input{background-color:hsla(0,0%,100%,.3)}} \ No newline at end of file
diff --git a/freetype/docs/reference/assets/stylesheets/application.adb8469c.css b/freetype/docs/reference/assets/stylesheets/application.adb8469c.css
deleted file mode 100644
index 93b3daba..00000000
--- a/freetype/docs/reference/assets/stylesheets/application.adb8469c.css
+++ /dev/null
@@ -1 +0,0 @@
-html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}html{-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}body{margin:0}hr{overflow:visible;box-sizing:content-box}a{-webkit-text-decoration-skip:objects}a,button,input,label{-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}small,sub,sup{font-size:80%}sub,sup{position:relative;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}table{border-collapse:separate;border-spacing:0}td,th{font-weight:400;vertical-align:top}button{margin:0;padding:0;border:0;outline-style:none;background:transparent;font-size:inherit}input{border:0;outline:0}.md-clipboard:before,.md-icon,.md-nav__button,.md-nav__link:after,.md-nav__title:before,.md-search-result__article--document:before,.md-source-file:before,.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset .critic.comment:before,.md-typeset .footnote-backref,.md-typeset .task-list-control .task-list-indicator:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before,.md-typeset summary:after{font-family:Material Icons;font-style:normal;font-variant:normal;font-weight:400;line-height:1;text-transform:none;white-space:nowrap;word-wrap:normal;direction:ltr}.md-content__icon,.md-footer-nav__button,.md-header-nav__button,.md-nav__button,.md-nav__title:before,.md-search-result__article--document:before{display:inline-block;margin:.2rem;padding:.4rem;font-size:1.2rem;cursor:pointer}.md-icon--arrow-back:before{content:""}.md-icon--arrow-forward:before{content:""}.md-icon--menu:before{content:""}.md-icon--search:before{content:""}[dir=rtl] .md-icon--arrow-back:before{content:""}[dir=rtl] .md-icon--arrow-forward:before{content:""}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body,input{color:rgba(0,0,0,.87);font-feature-settings:"kern","liga";font-family:Helvetica Neue,Helvetica,Arial,sans-serif}code,kbd,pre{color:rgba(0,0,0,.87);font-feature-settings:"kern";font-family:Courier New,Courier,monospace}.md-typeset{font-size:.8rem;line-height:1.6;-webkit-print-color-adjust:exact}.md-typeset blockquote,.md-typeset ol,.md-typeset p,.md-typeset ul{margin:1em 0}.md-typeset h1{margin:0 0 2rem;color:rgba(0,0,0,.54);font-size:1.5625rem;line-height:1.3}.md-typeset h1,.md-typeset h2{font-weight:300;letter-spacing:-.01em}.md-typeset h2{margin:2rem 0 .8rem;font-size:1.25rem;line-height:1.4}.md-typeset h3{margin:1.6rem 0 .8rem;font-size:1rem;font-weight:400;letter-spacing:-.01em;line-height:1.5}.md-typeset h2+h3{margin-top:.8rem}.md-typeset h4{font-size:.8rem}.md-typeset h4,.md-typeset h5,.md-typeset h6{margin:.8rem 0;font-weight:700;letter-spacing:-.01em}.md-typeset h5,.md-typeset h6{color:rgba(0,0,0,.54);font-size:.64rem}.md-typeset h5{text-transform:uppercase}.md-typeset hr{margin:1.5em 0;border-bottom:.05rem dotted rgba(0,0,0,.26)}.md-typeset a{color:#3f51b5;word-break:break-word}.md-typeset a,.md-typeset a:before{-webkit-transition:color .125s;transition:color .125s}.md-typeset a:active,.md-typeset a:hover{color:#536dfe}.md-typeset code,.md-typeset pre{background-color:hsla(0,0%,92.5%,.5);color:#37474f;font-size:85%;direction:ltr}.md-typeset code{margin:0 .29412em;padding:.07353em 0;border-radius:.1rem;box-shadow:.29412em 0 0 hsla(0,0%,92.5%,.5),-.29412em 0 0 hsla(0,0%,92.5%,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset h1 code,.md-typeset h2 code,.md-typeset h3 code,.md-typeset h4 code,.md-typeset h5 code,.md-typeset h6 code{margin:0;background-color:transparent;box-shadow:none}.md-typeset a>code{margin:inherit;padding:inherit;border-radius:initial;background-color:inherit;color:inherit;box-shadow:none}.md-typeset pre{position:relative;margin:1em 0;border-radius:.1rem;line-height:1.4;-webkit-overflow-scrolling:touch}.md-typeset pre>code{display:block;margin:0;padding:.525rem .6rem;background-color:transparent;font-size:inherit;box-shadow:none;-webkit-box-decoration-break:slice;box-decoration-break:slice;overflow:auto}.md-typeset pre>code::-webkit-scrollbar{width:.2rem;height:.2rem}.md-typeset pre>code::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-typeset pre>code::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-typeset kbd{padding:0 .29412em;border-radius:.15rem;border:.05rem solid #c9c9c9;border-bottom-color:#bcbcbc;background-color:#fcfcfc;color:#555;font-size:85%;box-shadow:0 .05rem 0 #b0b0b0;word-break:break-word}.md-typeset mark{margin:0 .25em;padding:.0625em 0;border-radius:.1rem;background-color:rgba(255,235,59,.5);box-shadow:.25em 0 0 rgba(255,235,59,.5),-.25em 0 0 rgba(255,235,59,.5);word-break:break-word;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset abbr{border-bottom:.05rem dotted rgba(0,0,0,.54);text-decoration:none;cursor:help}.md-typeset small{opacity:.75}.md-typeset sub,.md-typeset sup{margin-left:.07812em}[dir=rtl] .md-typeset sub,[dir=rtl] .md-typeset sup{margin-right:.07812em;margin-left:0}.md-typeset blockquote{padding-left:.6rem;border-left:.2rem solid rgba(0,0,0,.26);color:rgba(0,0,0,.54)}[dir=rtl] .md-typeset blockquote{padding-right:.6rem;padding-left:0;border-right:.2rem solid rgba(0,0,0,.26);border-left:initial}.md-typeset ul{list-style-type:disc}.md-typeset ol,.md-typeset ul{margin-left:.625em;padding:0}[dir=rtl] .md-typeset ol,[dir=rtl] .md-typeset ul{margin-right:.625em;margin-left:0}.md-typeset ol ol,.md-typeset ul ol{list-style-type:lower-alpha}.md-typeset ol ol ol,.md-typeset ul ol ol{list-style-type:lower-roman}.md-typeset ol li,.md-typeset ul li{margin-bottom:.5em;margin-left:1.25em}[dir=rtl] .md-typeset ol li,[dir=rtl] .md-typeset ul li{margin-right:1.25em;margin-left:0}.md-typeset ol li blockquote,.md-typeset ol li p,.md-typeset ul li blockquote,.md-typeset ul li p{margin:.5em 0}.md-typeset ol li:last-child,.md-typeset ul li:last-child{margin-bottom:0}.md-typeset ol li ol,.md-typeset ol li ul,.md-typeset ul li ol,.md-typeset ul li ul{margin:.5em 0 .5em .625em}[dir=rtl] .md-typeset ol li ol,[dir=rtl] .md-typeset ol li ul,[dir=rtl] .md-typeset ul li ol,[dir=rtl] .md-typeset ul li ul{margin-right:.625em;margin-left:0}.md-typeset dd{margin:1em 0 1em 1.875em}[dir=rtl] .md-typeset dd{margin-right:1.875em;margin-left:0}.md-typeset iframe,.md-typeset img,.md-typeset svg{max-width:100%}.md-typeset table:not([class]){box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);display:inline-block;max-width:100%;border-radius:.1rem;font-size:.64rem;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset table:not([class])+*{margin-top:1.5em}.md-typeset table:not([class]) td:not([align]),.md-typeset table:not([class]) th:not([align]){text-align:left}[dir=rtl] .md-typeset table:not([class]) td:not([align]),[dir=rtl] .md-typeset table:not([class]) th:not([align]){text-align:right}.md-typeset table:not([class]) th{min-width:5rem;padding:.6rem .8rem;background-color:rgba(0,0,0,.54);color:#fff;vertical-align:top}.md-typeset table:not([class]) td{padding:.6rem .8rem;border-top:.05rem solid rgba(0,0,0,.07);vertical-align:top}.md-typeset table:not([class]) tr{-webkit-transition:background-color .125s;transition:background-color .125s}.md-typeset table:not([class]) tr:hover{background-color:rgba(0,0,0,.035);box-shadow:inset 0 .05rem 0 #fff}.md-typeset table:not([class]) tr:first-child td{border-top:0}.md-typeset table:not([class]) a{word-break:normal}.md-typeset__scrollwrap{margin:1em -.8rem;overflow-x:auto;-webkit-overflow-scrolling:touch}.md-typeset .md-typeset__table{display:inline-block;margin-bottom:.5em;padding:0 .8rem}.md-typeset .md-typeset__table table{display:table;width:100%;margin:0;overflow:hidden}html{font-size:125%;overflow-x:hidden}body,html{height:100%}body{position:relative;font-size:.5rem}hr{display:block;height:.05rem;padding:0;border:0}.md-svg{display:none}.md-grid{max-width:61rem;margin-right:auto;margin-left:auto}.md-container,.md-main{overflow:auto}.md-container{display:table;width:100%;height:100%;padding-top:2.4rem;table-layout:fixed}.md-main{display:table-row;height:100%}.md-main__inner{height:100%;padding-top:1.5rem;padding-bottom:.05rem}.md-toggle{display:none}.md-overlay{position:fixed;top:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);opacity:0;z-index:3}.md-flex{display:table}.md-flex__cell{display:table-cell;position:relative;vertical-align:top}.md-flex__cell--shrink{width:0}.md-flex__cell--stretch{display:table;width:100%;table-layout:fixed}.md-flex__ellipsis{display:table-cell;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-skip{position:fixed;width:.05rem;height:.05rem;margin:.5rem;padding:.3rem .5rem;-webkit-transform:translateY(.4rem);transform:translateY(.4rem);border-radius:.1rem;background-color:rgba(0,0,0,.87);color:#fff;font-size:.64rem;opacity:0;overflow:hidden}.md-skip:focus{width:auto;height:auto;clip:auto;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;z-index:10}@page{margin:25mm}.md-clipboard{position:absolute;top:.3rem;right:.3rem;width:1.4rem;height:1.4rem;border-radius:.1rem;font-size:.8rem;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-clipboard:before{-webkit-transition:color .25s,opacity .25s;transition:color .25s,opacity .25s;color:rgba(0,0,0,.07);content:"\E14D"}.codehilite:hover .md-clipboard:before,.md-typeset .highlight:hover .md-clipboard:before,pre:hover .md-clipboard:before{color:rgba(0,0,0,.54)}.md-clipboard:focus:before,.md-clipboard:hover:before{color:#536dfe}.md-clipboard__message{display:block;position:absolute;top:0;right:1.7rem;padding:.3rem .5rem;-webkit-transform:translateX(.4rem);transform:translateX(.4rem);-webkit-transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s;transition:transform .25s cubic-bezier(.9,.1,.9,0),opacity .175s,-webkit-transform .25s cubic-bezier(.9,.1,.9,0);border-radius:.1rem;background-color:rgba(0,0,0,.54);color:#fff;font-size:.64rem;white-space:nowrap;opacity:0;pointer-events:none}.md-clipboard__message--active{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .175s 75ms,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1;pointer-events:auto}.md-clipboard__message:before{content:attr(aria-label)}.md-clipboard__message:after{display:block;position:absolute;top:50%;right:-.2rem;width:0;margin-top:-.2rem;border-color:transparent rgba(0,0,0,.54);border-style:solid;border-width:.2rem 0 .2rem .2rem;content:""}.md-content__inner{margin:0 .8rem 1.2rem;padding-top:.6rem}.md-content__inner:before{display:block;height:.4rem;content:""}.md-content__inner>:last-child{margin-bottom:0}.md-content__icon{position:relative;margin:.4rem 0;padding:0;float:right}.md-typeset .md-content__icon{color:rgba(0,0,0,.26)}.md-header{position:fixed;top:0;right:0;left:0;height:2.4rem;-webkit-transition:background-color .25s,color .25s;transition:background-color .25s,color .25s;background-color:#3f51b5;color:#fff;box-shadow:none;z-index:2;-webkit-backface-visibility:hidden;backface-visibility:hidden}.no-js .md-header{-webkit-transition:none;transition:none;box-shadow:none}.md-header[data-md-state=shadow]{-webkit-transition:background-color .25s,color .25s,box-shadow .25s;transition:background-color .25s,color .25s,box-shadow .25s;box-shadow:0 0 .2rem rgba(0,0,0,.1),0 .2rem .4rem rgba(0,0,0,.2)}.md-header-nav{padding:0 .2rem}.md-header-nav__button{position:relative;-webkit-transition:opacity .25s;transition:opacity .25s;z-index:1}.md-header-nav__button:hover{opacity:.7}.md-header-nav__button.md-logo *{display:block}.no-js .md-header-nav__button.md-icon--search{display:none}.md-header-nav__topic{display:block;position:absolute;-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(1.25rem);transform:translateX(1.25rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(-1.25rem);transform:translateX(-1.25rem)}.no-js .md-header-nav__topic{position:static}.no-js .md-header-nav__topic+.md-header-nav__topic{display:none}.md-header-nav__title{padding:0 1rem;font-size:.9rem;line-height:2.4rem}.md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(-1.25rem);transform:translateX(-1.25rem);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s;transition:transform .4s cubic-bezier(1,.7,.1,.1),opacity .15s,-webkit-transform .4s cubic-bezier(1,.7,.1,.1);opacity:0;z-index:-1;pointer-events:none}[dir=rtl] .md-header-nav__title[data-md-state=active] .md-header-nav__topic{-webkit-transform:translateX(1.25rem);transform:translateX(1.25rem)}.md-header-nav__title[data-md-state=active] .md-header-nav__topic+.md-header-nav__topic{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:1;z-index:0;pointer-events:auto}.md-header-nav__source{display:none}.md-hero{-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;font-size:1rem;overflow:hidden}.md-hero__inner{margin-top:1rem;padding:.8rem .8rem .4rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);-webkit-transition-delay:.1s;transition-delay:.1s}[data-md-state=hidden] .md-hero__inner{pointer-events:none;-webkit-transform:translateY(.625rem);transform:translateY(.625rem);-webkit-transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:opacity .1s 0s,-webkit-transform 0s .4s;transition:transform 0s .4s,opacity .1s 0s;transition:transform 0s .4s,opacity .1s 0s,-webkit-transform 0s .4s;opacity:0}.md-hero--expand .md-hero__inner{margin-bottom:1.2rem}.md-footer-nav{background-color:rgba(0,0,0,.87);color:#fff}.md-footer-nav__inner{padding:.2rem;overflow:auto}.md-footer-nav__link{padding-top:1.4rem;padding-bottom:.4rem;-webkit-transition:opacity .25s;transition:opacity .25s}.md-footer-nav__link:hover{opacity:.7}.md-footer-nav__link--prev{width:25%;float:left}[dir=rtl] .md-footer-nav__link--prev{float:right}.md-footer-nav__link--next{width:75%;float:right;text-align:right}[dir=rtl] .md-footer-nav__link--next{float:left;text-align:left}.md-footer-nav__button{-webkit-transition:background .25s;transition:background .25s}.md-footer-nav__title{position:relative;padding:0 1rem;font-size:.9rem;line-height:2.4rem}.md-footer-nav__direction{position:absolute;right:0;left:0;margin-top:-1rem;padding:0 1rem;color:hsla(0,0%,100%,.7);font-size:.75rem}.md-footer-meta{background-color:rgba(0,0,0,.895)}.md-footer-meta__inner{padding:.2rem;overflow:auto}html .md-footer-meta.md-typeset a{color:hsla(0,0%,100%,.7)}html .md-footer-meta.md-typeset a:focus,html .md-footer-meta.md-typeset a:hover{color:#fff}.md-footer-copyright{margin:0 .6rem;padding:.4rem 0;color:hsla(0,0%,100%,.3);font-size:.64rem}.md-footer-copyright__highlight{color:hsla(0,0%,100%,.7)}.md-footer-social{margin:0 .4rem;padding:.2rem 0 .6rem}.md-footer-social__link{display:inline-block;width:1.6rem;height:1.6rem;font-size:.8rem;text-align:center}.md-footer-social__link:before{line-height:1.9}.md-nav{font-size:.7rem;line-height:1.3}.md-nav__title{display:block;padding:0 .6rem;font-weight:700;text-overflow:ellipsis;overflow:hidden}.md-nav__title:before{display:none;content:"\E5C4"}[dir=rtl] .md-nav__title:before{content:"\E5C8"}.md-nav__title .md-nav__button{display:none}.md-nav__list{margin:0;padding:0;list-style:none}.md-nav__item{padding:0 .6rem}.md-nav__item:last-child{padding-bottom:.6rem}.md-nav__item .md-nav__item{padding-right:0}[dir=rtl] .md-nav__item .md-nav__item{padding-right:.6rem;padding-left:0}.md-nav__item .md-nav__item:last-child{padding-bottom:0}.md-nav__button img{width:100%;height:auto}.md-nav__link{display:block;margin-top:.625em;-webkit-transition:color .125s;transition:color .125s;text-overflow:ellipsis;cursor:pointer;overflow:hidden}.md-nav__item--nested>.md-nav__link:after{content:"\E313"}html .md-nav__link[for=__toc],html .md-nav__link[for=__toc]+.md-nav__link:after,html .md-nav__link[for=__toc]~.md-nav{display:none}.md-nav__link[data-md-state=blur]{color:rgba(0,0,0,.54)}.md-nav__link--active,.md-nav__link:active{color:#3f51b5}.md-nav__item--nested>.md-nav__link{color:inherit}.md-nav__link:focus,.md-nav__link:hover{color:#536dfe}.md-nav__source,.no-js .md-search{display:none}.md-search__overlay{opacity:0;z-index:1}.md-search__form{position:relative}.md-search__input{position:relative;padding:0 2.2rem 0 3.6rem;text-overflow:ellipsis;z-index:2}[dir=rtl] .md-search__input{padding:0 3.6rem 0 2.2rem}.md-search__input::-webkit-input-placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-moz-placeholder{-moz-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input:-ms-input-placeholder{-ms-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-ms-input-placeholder{-ms-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::placeholder{-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1);transition:color .25s cubic-bezier(.1,.7,.1,1)}.md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}.md-search__input::-moz-placeholder{color:rgba(0,0,0,.54)}.md-search__input:-ms-input-placeholder{color:rgba(0,0,0,.54)}.md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}.md-search__input::placeholder,.md-search__input~.md-search__icon{color:rgba(0,0,0,.54)}.md-search__input::-ms-clear{display:none}.md-search__icon{position:absolute;-webkit-transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:color .25s cubic-bezier(.1,.7,.1,1),opacity .25s;font-size:1.2rem;cursor:pointer;z-index:2}.md-search__icon:hover{opacity:.7}.md-search__icon[for=__search]{top:.3rem;left:.5rem}[dir=rtl] .md-search__icon[for=__search]{right:.5rem;left:auto}.md-search__icon[for=__search]:before{content:"\E8B6"}.md-search__icon[type=reset]{top:.3rem;right:.5rem;-webkit-transform:scale(.125);transform:scale(.125);-webkit-transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s;transition:transform .15s cubic-bezier(.1,.7,.1,1),opacity .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1);opacity:0}[dir=rtl] .md-search__icon[type=reset]{right:auto;left:.5rem}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]{-webkit-transform:scale(1);transform:scale(1);opacity:1}[data-md-toggle=search]:checked~.md-header .md-search__input:valid~.md-search__icon[type=reset]:hover{opacity:.7}.md-search__output{position:absolute;width:100%;border-radius:0 0 .1rem .1rem;overflow:hidden;z-index:1}.md-search__scrollwrap{height:100%;background-color:#fff;box-shadow:inset 0 .05rem 0 rgba(0,0,0,.07);overflow-y:auto;-webkit-overflow-scrolling:touch}.md-search-result{color:rgba(0,0,0,.87);word-break:break-word}.md-search-result__meta{padding:0 .8rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-size:.64rem;line-height:1.8rem}.md-search-result__list{margin:0;padding:0;border-top:.05rem solid rgba(0,0,0,.07);list-style:none}.md-search-result__item{box-shadow:0 -.05rem 0 rgba(0,0,0,.07)}.md-search-result__link{display:block;-webkit-transition:background .25s;transition:background .25s;outline:0;overflow:hidden}.md-search-result__link:hover,.md-search-result__link[data-md-state=active]{background-color:rgba(83,109,254,.1)}.md-search-result__link:hover .md-search-result__article:before,.md-search-result__link[data-md-state=active] .md-search-result__article:before{opacity:.7}.md-search-result__link:last-child .md-search-result__teaser{margin-bottom:.6rem}.md-search-result__article{position:relative;padding:0 .8rem;overflow:auto}.md-search-result__article--document:before{position:absolute;left:0;margin:.1rem;-webkit-transition:opacity .25s;transition:opacity .25s;color:rgba(0,0,0,.54);content:"\E880"}[dir=rtl] .md-search-result__article--document:before{right:0;left:auto}.md-search-result__article--document .md-search-result__title{margin:.55rem 0;font-size:.8rem;font-weight:400;line-height:1.4}.md-search-result__title{margin:.5em 0;font-size:.64rem;font-weight:700;line-height:1.4}.md-search-result__teaser{display:-webkit-box;max-height:1.65rem;margin:.5em 0;color:rgba(0,0,0,.54);font-size:.64rem;line-height:1.4;text-overflow:ellipsis;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2}.md-search-result em{font-style:normal;font-weight:700;text-decoration:underline}.md-sidebar{position:absolute;width:12.1rem;padding:1.2rem 0;overflow:hidden}.md-sidebar[data-md-state=lock]{position:fixed;top:2.4rem}.md-sidebar--secondary{display:none}.md-sidebar__scrollwrap{max-height:100%;margin:0 .2rem;overflow-y:auto;-webkit-backface-visibility:hidden;backface-visibility:hidden}.md-sidebar__scrollwrap::-webkit-scrollbar{width:.2rem;height:.2rem}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}@-webkit-keyframes md-source__facts--done{0%{height:0}to{height:.65rem}}@keyframes md-source__facts--done{0%{height:0}to{height:.65rem}}@-webkit-keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes md-source__fact--done{0%{-webkit-transform:translateY(100%);transform:translateY(100%);opacity:0}50%{opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.md-source{display:block;padding-right:.6rem;-webkit-transition:opacity .25s;transition:opacity .25s;font-size:.65rem;line-height:1.2;white-space:nowrap}[dir=rtl] .md-source{padding-right:0;padding-left:.6rem}.md-source:hover{opacity:.7}.md-source:after,.md-source__icon{display:inline-block;height:2.4rem;content:"";vertical-align:middle}.md-source__icon{width:2.4rem}.md-source__icon svg{width:1.2rem;height:1.2rem;margin-top:.6rem;margin-left:.6rem}[dir=rtl] .md-source__icon svg{margin-right:.6rem;margin-left:0}.md-source__icon+.md-source__repository{margin-left:-2rem;padding-left:2rem}[dir=rtl] .md-source__icon+.md-source__repository{margin-right:-2rem;margin-left:0;padding-right:2rem;padding-left:0}.md-source__repository{display:inline-block;max-width:100%;margin-left:.6rem;font-weight:700;text-overflow:ellipsis;overflow:hidden;vertical-align:middle}.md-source__facts{margin:0;padding:0;font-size:.55rem;font-weight:700;list-style-type:none;opacity:.75;overflow:hidden}[data-md-state=done] .md-source__facts{-webkit-animation:md-source__facts--done .25s ease-in;animation:md-source__facts--done .25s ease-in}.md-source__fact{float:left}[dir=rtl] .md-source__fact{float:right}[data-md-state=done] .md-source__fact{-webkit-animation:md-source__fact--done .4s ease-out;animation:md-source__fact--done .4s ease-out}.md-source__fact:before{margin:0 .1rem;content:"\00B7"}.md-source__fact:first-child:before{display:none}.md-source-file{display:inline-block;margin:1em .5em 1em 0;padding-right:.25rem;border-radius:.1rem;background-color:rgba(0,0,0,.07);font-size:.64rem;list-style-type:none;cursor:pointer;overflow:hidden}.md-source-file:before{display:inline-block;margin-right:.25rem;padding:.25rem;background-color:rgba(0,0,0,.26);color:#fff;font-size:.8rem;content:"\E86F";vertical-align:middle}html .md-source-file{-webkit-transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1);transition:background .4s,color .4s,box-shadow .4s cubic-bezier(.4,0,.2,1)}html .md-source-file:before{-webkit-transition:inherit;transition:inherit}html body .md-typeset .md-source-file{color:rgba(0,0,0,.54)}.md-source-file:hover{box-shadow:0 0 8px rgba(0,0,0,.18),0 8px 16px rgba(0,0,0,.36)}.md-source-file:hover:before{background-color:#536dfe}.md-tabs{width:100%;-webkit-transition:background .25s;transition:background .25s;background-color:#3f51b5;color:#fff;overflow:auto}.md-tabs__list{margin:0 0 0 .2rem;padding:0;list-style:none;white-space:nowrap}.md-tabs__item{display:inline-block;height:2.4rem;padding-right:.6rem;padding-left:.6rem}.md-tabs__link{display:block;margin-top:.8rem;-webkit-transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s;transition:transform .4s cubic-bezier(.1,.7,.1,1),opacity .25s,-webkit-transform .4s cubic-bezier(.1,.7,.1,1);font-size:.7rem;opacity:.7}.md-tabs__link--active,.md-tabs__link:hover{color:inherit;opacity:1}.md-tabs__item:nth-child(2) .md-tabs__link{-webkit-transition-delay:.02s;transition-delay:.02s}.md-tabs__item:nth-child(3) .md-tabs__link{-webkit-transition-delay:.04s;transition-delay:.04s}.md-tabs__item:nth-child(4) .md-tabs__link{-webkit-transition-delay:.06s;transition-delay:.06s}.md-tabs__item:nth-child(5) .md-tabs__link{-webkit-transition-delay:.08s;transition-delay:.08s}.md-tabs__item:nth-child(6) .md-tabs__link{-webkit-transition-delay:.1s;transition-delay:.1s}.md-tabs__item:nth-child(7) .md-tabs__link{-webkit-transition-delay:.12s;transition-delay:.12s}.md-tabs__item:nth-child(8) .md-tabs__link{-webkit-transition-delay:.14s;transition-delay:.14s}.md-tabs__item:nth-child(9) .md-tabs__link{-webkit-transition-delay:.16s;transition-delay:.16s}.md-tabs__item:nth-child(10) .md-tabs__link{-webkit-transition-delay:.18s;transition-delay:.18s}.md-tabs__item:nth-child(11) .md-tabs__link{-webkit-transition-delay:.2s;transition-delay:.2s}.md-tabs__item:nth-child(12) .md-tabs__link{-webkit-transition-delay:.22s;transition-delay:.22s}.md-tabs__item:nth-child(13) .md-tabs__link{-webkit-transition-delay:.24s;transition-delay:.24s}.md-tabs__item:nth-child(14) .md-tabs__link{-webkit-transition-delay:.26s;transition-delay:.26s}.md-tabs__item:nth-child(15) .md-tabs__link{-webkit-transition-delay:.28s;transition-delay:.28s}.md-tabs__item:nth-child(16) .md-tabs__link{-webkit-transition-delay:.3s;transition-delay:.3s}.md-tabs[data-md-state=hidden]{pointer-events:none}.md-tabs[data-md-state=hidden] .md-tabs__link{-webkit-transform:translateY(50%);transform:translateY(50%);-webkit-transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,opacity .1s,-webkit-transform 0s .4s;transition:color .25s,transform 0s .4s,opacity .1s;transition:color .25s,transform 0s .4s,opacity .1s,-webkit-transform 0s .4s;opacity:0}.md-typeset .admonition,.md-typeset details{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12),0 3px 1px -2px rgba(0,0,0,.2);position:relative;margin:1.5625em 0;padding:0 .6rem;border-left:.2rem solid #448aff;border-radius:.1rem;font-size:.64rem;overflow:auto}[dir=rtl] .md-typeset .admonition,[dir=rtl] .md-typeset details{border-right:.2rem solid #448aff;border-left:none}html .md-typeset .admonition>:last-child,html .md-typeset details>:last-child{margin-bottom:.6rem}.md-typeset .admonition .admonition,.md-typeset .admonition details,.md-typeset details .admonition,.md-typeset details details{margin:1em 0}.md-typeset .admonition>.admonition-title,.md-typeset .admonition>summary,.md-typeset details>.admonition-title,.md-typeset details>summary{margin:0 -.6rem;padding:.4rem .6rem .4rem 2rem;border-bottom:.05rem solid rgba(68,138,255,.1);background-color:rgba(68,138,255,.1);font-weight:700}[dir=rtl] .md-typeset .admonition>.admonition-title,[dir=rtl] .md-typeset .admonition>summary,[dir=rtl] .md-typeset details>.admonition-title,[dir=rtl] .md-typeset details>summary{padding:.4rem 2rem .4rem .6rem}.md-typeset .admonition>.admonition-title:last-child,.md-typeset .admonition>summary:last-child,.md-typeset details>.admonition-title:last-child,.md-typeset details>summary:last-child{margin-bottom:0}.md-typeset .admonition>.admonition-title:before,.md-typeset .admonition>summary:before,.md-typeset details>.admonition-title:before,.md-typeset details>summary:before{position:absolute;left:.6rem;color:#448aff;font-size:1rem;content:"\E3C9"}[dir=rtl] .md-typeset .admonition>.admonition-title:before,[dir=rtl] .md-typeset .admonition>summary:before,[dir=rtl] .md-typeset details>.admonition-title:before,[dir=rtl] .md-typeset details>summary:before{right:.6rem;left:auto}.md-typeset .admonition.abstract,.md-typeset .admonition.summary,.md-typeset .admonition.tldr,.md-typeset details.abstract,.md-typeset details.summary,.md-typeset details.tldr{border-left-color:#00b0ff}[dir=rtl] .md-typeset .admonition.abstract,[dir=rtl] .md-typeset .admonition.summary,[dir=rtl] .md-typeset .admonition.tldr,[dir=rtl] .md-typeset details.abstract,[dir=rtl] .md-typeset details.summary,[dir=rtl] .md-typeset details.tldr{border-right-color:#00b0ff}.md-typeset .admonition.abstract>.admonition-title,.md-typeset .admonition.abstract>summary,.md-typeset .admonition.summary>.admonition-title,.md-typeset .admonition.summary>summary,.md-typeset .admonition.tldr>.admonition-title,.md-typeset .admonition.tldr>summary,.md-typeset details.abstract>.admonition-title,.md-typeset details.abstract>summary,.md-typeset details.summary>.admonition-title,.md-typeset details.summary>summary,.md-typeset details.tldr>.admonition-title,.md-typeset details.tldr>summary{border-bottom-color:rgba(0,176,255,.1);background-color:rgba(0,176,255,.1)}.md-typeset .admonition.abstract>.admonition-title:before,.md-typeset .admonition.abstract>summary:before,.md-typeset .admonition.summary>.admonition-title:before,.md-typeset .admonition.summary>summary:before,.md-typeset .admonition.tldr>.admonition-title:before,.md-typeset .admonition.tldr>summary:before,.md-typeset details.abstract>.admonition-title:before,.md-typeset details.abstract>summary:before,.md-typeset details.summary>.admonition-title:before,.md-typeset details.summary>summary:before,.md-typeset details.tldr>.admonition-title:before,.md-typeset details.tldr>summary:before{color:#00b0ff;content:""}.md-typeset .admonition.info,.md-typeset .admonition.todo,.md-typeset details.info,.md-typeset details.todo{border-left-color:#00b8d4}[dir=rtl] .md-typeset .admonition.info,[dir=rtl] .md-typeset .admonition.todo,[dir=rtl] .md-typeset details.info,[dir=rtl] .md-typeset details.todo{border-right-color:#00b8d4}.md-typeset .admonition.info>.admonition-title,.md-typeset .admonition.info>summary,.md-typeset .admonition.todo>.admonition-title,.md-typeset .admonition.todo>summary,.md-typeset details.info>.admonition-title,.md-typeset details.info>summary,.md-typeset details.todo>.admonition-title,.md-typeset details.todo>summary{border-bottom-color:rgba(0,184,212,.1);background-color:rgba(0,184,212,.1)}.md-typeset .admonition.info>.admonition-title:before,.md-typeset .admonition.info>summary:before,.md-typeset .admonition.todo>.admonition-title:before,.md-typeset .admonition.todo>summary:before,.md-typeset details.info>.admonition-title:before,.md-typeset details.info>summary:before,.md-typeset details.todo>.admonition-title:before,.md-typeset details.todo>summary:before{color:#00b8d4;content:""}.md-typeset .admonition.hint,.md-typeset .admonition.important,.md-typeset .admonition.tip,.md-typeset details.hint,.md-typeset details.important,.md-typeset details.tip{border-left-color:#00bfa5}[dir=rtl] .md-typeset .admonition.hint,[dir=rtl] .md-typeset .admonition.important,[dir=rtl] .md-typeset .admonition.tip,[dir=rtl] .md-typeset details.hint,[dir=rtl] .md-typeset details.important,[dir=rtl] .md-typeset details.tip{border-right-color:#00bfa5}.md-typeset .admonition.hint>.admonition-title,.md-typeset .admonition.hint>summary,.md-typeset .admonition.important>.admonition-title,.md-typeset .admonition.important>summary,.md-typeset .admonition.tip>.admonition-title,.md-typeset .admonition.tip>summary,.md-typeset details.hint>.admonition-title,.md-typeset details.hint>summary,.md-typeset details.important>.admonition-title,.md-typeset details.important>summary,.md-typeset details.tip>.admonition-title,.md-typeset details.tip>summary{border-bottom-color:rgba(0,191,165,.1);background-color:rgba(0,191,165,.1)}.md-typeset .admonition.hint>.admonition-title:before,.md-typeset .admonition.hint>summary:before,.md-typeset .admonition.important>.admonition-title:before,.md-typeset .admonition.important>summary:before,.md-typeset .admonition.tip>.admonition-title:before,.md-typeset .admonition.tip>summary:before,.md-typeset details.hint>.admonition-title:before,.md-typeset details.hint>summary:before,.md-typeset details.important>.admonition-title:before,.md-typeset details.important>summary:before,.md-typeset details.tip>.admonition-title:before,.md-typeset details.tip>summary:before{color:#00bfa5;content:""}.md-typeset .admonition.check,.md-typeset .admonition.done,.md-typeset .admonition.success,.md-typeset details.check,.md-typeset details.done,.md-typeset details.success{border-left-color:#00c853}[dir=rtl] .md-typeset .admonition.check,[dir=rtl] .md-typeset .admonition.done,[dir=rtl] .md-typeset .admonition.success,[dir=rtl] .md-typeset details.check,[dir=rtl] .md-typeset details.done,[dir=rtl] .md-typeset details.success{border-right-color:#00c853}.md-typeset .admonition.check>.admonition-title,.md-typeset .admonition.check>summary,.md-typeset .admonition.done>.admonition-title,.md-typeset .admonition.done>summary,.md-typeset .admonition.success>.admonition-title,.md-typeset .admonition.success>summary,.md-typeset details.check>.admonition-title,.md-typeset details.check>summary,.md-typeset details.done>.admonition-title,.md-typeset details.done>summary,.md-typeset details.success>.admonition-title,.md-typeset details.success>summary{border-bottom-color:rgba(0,200,83,.1);background-color:rgba(0,200,83,.1)}.md-typeset .admonition.check>.admonition-title:before,.md-typeset .admonition.check>summary:before,.md-typeset .admonition.done>.admonition-title:before,.md-typeset .admonition.done>summary:before,.md-typeset .admonition.success>.admonition-title:before,.md-typeset .admonition.success>summary:before,.md-typeset details.check>.admonition-title:before,.md-typeset details.check>summary:before,.md-typeset details.done>.admonition-title:before,.md-typeset details.done>summary:before,.md-typeset details.success>.admonition-title:before,.md-typeset details.success>summary:before{color:#00c853;content:""}.md-typeset .admonition.faq,.md-typeset .admonition.help,.md-typeset .admonition.question,.md-typeset details.faq,.md-typeset details.help,.md-typeset details.question{border-left-color:#64dd17}[dir=rtl] .md-typeset .admonition.faq,[dir=rtl] .md-typeset .admonition.help,[dir=rtl] .md-typeset .admonition.question,[dir=rtl] .md-typeset details.faq,[dir=rtl] .md-typeset details.help,[dir=rtl] .md-typeset details.question{border-right-color:#64dd17}.md-typeset .admonition.faq>.admonition-title,.md-typeset .admonition.faq>summary,.md-typeset .admonition.help>.admonition-title,.md-typeset .admonition.help>summary,.md-typeset .admonition.question>.admonition-title,.md-typeset .admonition.question>summary,.md-typeset details.faq>.admonition-title,.md-typeset details.faq>summary,.md-typeset details.help>.admonition-title,.md-typeset details.help>summary,.md-typeset details.question>.admonition-title,.md-typeset details.question>summary{border-bottom-color:rgba(100,221,23,.1);background-color:rgba(100,221,23,.1)}.md-typeset .admonition.faq>.admonition-title:before,.md-typeset .admonition.faq>summary:before,.md-typeset .admonition.help>.admonition-title:before,.md-typeset .admonition.help>summary:before,.md-typeset .admonition.question>.admonition-title:before,.md-typeset .admonition.question>summary:before,.md-typeset details.faq>.admonition-title:before,.md-typeset details.faq>summary:before,.md-typeset details.help>.admonition-title:before,.md-typeset details.help>summary:before,.md-typeset details.question>.admonition-title:before,.md-typeset details.question>summary:before{color:#64dd17;content:""}.md-typeset .admonition.attention,.md-typeset .admonition.caution,.md-typeset .admonition.warning,.md-typeset details.attention,.md-typeset details.caution,.md-typeset details.warning{border-left-color:#ff9100}[dir=rtl] .md-typeset .admonition.attention,[dir=rtl] .md-typeset .admonition.caution,[dir=rtl] .md-typeset .admonition.warning,[dir=rtl] .md-typeset details.attention,[dir=rtl] .md-typeset details.caution,[dir=rtl] .md-typeset details.warning{border-right-color:#ff9100}.md-typeset .admonition.attention>.admonition-title,.md-typeset .admonition.attention>summary,.md-typeset .admonition.caution>.admonition-title,.md-typeset .admonition.caution>summary,.md-typeset .admonition.warning>.admonition-title,.md-typeset .admonition.warning>summary,.md-typeset details.attention>.admonition-title,.md-typeset details.attention>summary,.md-typeset details.caution>.admonition-title,.md-typeset details.caution>summary,.md-typeset details.warning>.admonition-title,.md-typeset details.warning>summary{border-bottom-color:rgba(255,145,0,.1);background-color:rgba(255,145,0,.1)}.md-typeset .admonition.attention>.admonition-title:before,.md-typeset .admonition.attention>summary:before,.md-typeset .admonition.caution>.admonition-title:before,.md-typeset .admonition.caution>summary:before,.md-typeset .admonition.warning>.admonition-title:before,.md-typeset .admonition.warning>summary:before,.md-typeset details.attention>.admonition-title:before,.md-typeset details.attention>summary:before,.md-typeset details.caution>.admonition-title:before,.md-typeset details.caution>summary:before,.md-typeset details.warning>.admonition-title:before,.md-typeset details.warning>summary:before{color:#ff9100;content:""}.md-typeset .admonition.fail,.md-typeset .admonition.failure,.md-typeset .admonition.missing,.md-typeset details.fail,.md-typeset details.failure,.md-typeset details.missing{border-left-color:#ff5252}[dir=rtl] .md-typeset .admonition.fail,[dir=rtl] .md-typeset .admonition.failure,[dir=rtl] .md-typeset .admonition.missing,[dir=rtl] .md-typeset details.fail,[dir=rtl] .md-typeset details.failure,[dir=rtl] .md-typeset details.missing{border-right-color:#ff5252}.md-typeset .admonition.fail>.admonition-title,.md-typeset .admonition.fail>summary,.md-typeset .admonition.failure>.admonition-title,.md-typeset .admonition.failure>summary,.md-typeset .admonition.missing>.admonition-title,.md-typeset .admonition.missing>summary,.md-typeset details.fail>.admonition-title,.md-typeset details.fail>summary,.md-typeset details.failure>.admonition-title,.md-typeset details.failure>summary,.md-typeset details.missing>.admonition-title,.md-typeset details.missing>summary{border-bottom-color:rgba(255,82,82,.1);background-color:rgba(255,82,82,.1)}.md-typeset .admonition.fail>.admonition-title:before,.md-typeset .admonition.fail>summary:before,.md-typeset .admonition.failure>.admonition-title:before,.md-typeset .admonition.failure>summary:before,.md-typeset .admonition.missing>.admonition-title:before,.md-typeset .admonition.missing>summary:before,.md-typeset details.fail>.admonition-title:before,.md-typeset details.fail>summary:before,.md-typeset details.failure>.admonition-title:before,.md-typeset details.failure>summary:before,.md-typeset details.missing>.admonition-title:before,.md-typeset details.missing>summary:before{color:#ff5252;content:""}.md-typeset .admonition.danger,.md-typeset .admonition.error,.md-typeset details.danger,.md-typeset details.error{border-left-color:#ff1744}[dir=rtl] .md-typeset .admonition.danger,[dir=rtl] .md-typeset .admonition.error,[dir=rtl] .md-typeset details.danger,[dir=rtl] .md-typeset details.error{border-right-color:#ff1744}.md-typeset .admonition.danger>.admonition-title,.md-typeset .admonition.danger>summary,.md-typeset .admonition.error>.admonition-title,.md-typeset .admonition.error>summary,.md-typeset details.danger>.admonition-title,.md-typeset details.danger>summary,.md-typeset details.error>.admonition-title,.md-typeset details.error>summary{border-bottom-color:rgba(255,23,68,.1);background-color:rgba(255,23,68,.1)}.md-typeset .admonition.danger>.admonition-title:before,.md-typeset .admonition.danger>summary:before,.md-typeset .admonition.error>.admonition-title:before,.md-typeset .admonition.error>summary:before,.md-typeset details.danger>.admonition-title:before,.md-typeset details.danger>summary:before,.md-typeset details.error>.admonition-title:before,.md-typeset details.error>summary:before{color:#ff1744;content:""}.md-typeset .admonition.bug,.md-typeset details.bug{border-left-color:#f50057}[dir=rtl] .md-typeset .admonition.bug,[dir=rtl] .md-typeset details.bug{border-right-color:#f50057}.md-typeset .admonition.bug>.admonition-title,.md-typeset .admonition.bug>summary,.md-typeset details.bug>.admonition-title,.md-typeset details.bug>summary{border-bottom-color:rgba(245,0,87,.1);background-color:rgba(245,0,87,.1)}.md-typeset .admonition.bug>.admonition-title:before,.md-typeset .admonition.bug>summary:before,.md-typeset details.bug>.admonition-title:before,.md-typeset details.bug>summary:before{color:#f50057;content:""}.md-typeset .admonition.example,.md-typeset details.example{border-left-color:#651fff}[dir=rtl] .md-typeset .admonition.example,[dir=rtl] .md-typeset details.example{border-right-color:#651fff}.md-typeset .admonition.example>.admonition-title,.md-typeset .admonition.example>summary,.md-typeset details.example>.admonition-title,.md-typeset details.example>summary{border-bottom-color:rgba(101,31,255,.1);background-color:rgba(101,31,255,.1)}.md-typeset .admonition.example>.admonition-title:before,.md-typeset .admonition.example>summary:before,.md-typeset details.example>.admonition-title:before,.md-typeset details.example>summary:before{color:#651fff;content:""}.md-typeset .admonition.cite,.md-typeset .admonition.quote,.md-typeset details.cite,.md-typeset details.quote{border-left-color:#9e9e9e}[dir=rtl] .md-typeset .admonition.cite,[dir=rtl] .md-typeset .admonition.quote,[dir=rtl] .md-typeset details.cite,[dir=rtl] .md-typeset details.quote{border-right-color:#9e9e9e}.md-typeset .admonition.cite>.admonition-title,.md-typeset .admonition.cite>summary,.md-typeset .admonition.quote>.admonition-title,.md-typeset .admonition.quote>summary,.md-typeset details.cite>.admonition-title,.md-typeset details.cite>summary,.md-typeset details.quote>.admonition-title,.md-typeset details.quote>summary{border-bottom-color:hsla(0,0%,62%,.1);background-color:hsla(0,0%,62%,.1)}.md-typeset .admonition.cite>.admonition-title:before,.md-typeset .admonition.cite>summary:before,.md-typeset .admonition.quote>.admonition-title:before,.md-typeset .admonition.quote>summary:before,.md-typeset details.cite>.admonition-title:before,.md-typeset details.cite>summary:before,.md-typeset details.quote>.admonition-title:before,.md-typeset details.quote>summary:before{color:#9e9e9e;content:""}.codehilite .o,.codehilite .ow,.md-typeset .highlight .o,.md-typeset .highlight .ow{color:inherit}.codehilite .ge,.md-typeset .highlight .ge{color:#000}.codehilite .gr,.md-typeset .highlight .gr{color:#a00}.codehilite .gh,.md-typeset .highlight .gh{color:#999}.codehilite .go,.md-typeset .highlight .go{color:#888}.codehilite .gp,.md-typeset .highlight .gp{color:#555}.codehilite .gs,.md-typeset .highlight .gs{color:inherit}.codehilite .gu,.md-typeset .highlight .gu{color:#aaa}.codehilite .gt,.md-typeset .highlight .gt{color:#a00}.codehilite .gd,.md-typeset .highlight .gd{background-color:#fdd}.codehilite .gi,.md-typeset .highlight .gi{background-color:#dfd}.codehilite .k,.md-typeset .highlight .k{color:#3b78e7}.codehilite .kc,.md-typeset .highlight .kc{color:#a71d5d}.codehilite .kd,.codehilite .kn,.md-typeset .highlight .kd,.md-typeset .highlight .kn{color:#3b78e7}.codehilite .kp,.md-typeset .highlight .kp{color:#a71d5d}.codehilite .kr,.codehilite .kt,.md-typeset .highlight .kr,.md-typeset .highlight .kt{color:#3e61a2}.codehilite .c,.codehilite .cm,.md-typeset .highlight .c,.md-typeset .highlight .cm{color:#999}.codehilite .cp,.md-typeset .highlight .cp{color:#666}.codehilite .c1,.codehilite .ch,.codehilite .cs,.md-typeset .highlight .c1,.md-typeset .highlight .ch,.md-typeset .highlight .cs{color:#999}.codehilite .na,.codehilite .nb,.md-typeset .highlight .na,.md-typeset .highlight .nb{color:#c2185b}.codehilite .bp,.md-typeset .highlight .bp{color:#3e61a2}.codehilite .nc,.md-typeset .highlight .nc{color:#c2185b}.codehilite .no,.md-typeset .highlight .no{color:#3e61a2}.codehilite .nd,.codehilite .ni,.md-typeset .highlight .nd,.md-typeset .highlight .ni{color:#666}.codehilite .ne,.codehilite .nf,.md-typeset .highlight .ne,.md-typeset .highlight .nf{color:#c2185b}.codehilite .nl,.md-typeset .highlight .nl{color:#3b5179}.codehilite .nn,.md-typeset .highlight .nn{color:#ec407a}.codehilite .nt,.md-typeset .highlight .nt{color:#3b78e7}.codehilite .nv,.codehilite .vc,.codehilite .vg,.codehilite .vi,.md-typeset .highlight .nv,.md-typeset .highlight .vc,.md-typeset .highlight .vg,.md-typeset .highlight .vi{color:#3e61a2}.codehilite .nx,.md-typeset .highlight .nx{color:#ec407a}.codehilite .il,.codehilite .m,.codehilite .mf,.codehilite .mh,.codehilite .mi,.codehilite .mo,.md-typeset .highlight .il,.md-typeset .highlight .m,.md-typeset .highlight .mf,.md-typeset .highlight .mh,.md-typeset .highlight .mi,.md-typeset .highlight .mo{color:#e74c3c}.codehilite .s,.codehilite .sb,.codehilite .sc,.md-typeset .highlight .s,.md-typeset .highlight .sb,.md-typeset .highlight .sc{color:#0d904f}.codehilite .sd,.md-typeset .highlight .sd{color:#999}.codehilite .s2,.md-typeset .highlight .s2{color:#0d904f}.codehilite .se,.codehilite .sh,.codehilite .si,.codehilite .sx,.md-typeset .highlight .se,.md-typeset .highlight .sh,.md-typeset .highlight .si,.md-typeset .highlight .sx{color:#183691}.codehilite .sr,.md-typeset .highlight .sr{color:#009926}.codehilite .s1,.codehilite .ss,.md-typeset .highlight .s1,.md-typeset .highlight .ss{color:#0d904f}.codehilite .err,.md-typeset .highlight .err{color:#a61717}.codehilite .w,.md-typeset .highlight .w{color:transparent}.codehilite .hll,.md-typeset .highlight .hll{display:block;margin:0 -.6rem;padding:0 .6rem;background-color:rgba(255,235,59,.5)}.md-typeset .codehilitetable,.md-typeset .highlighttable{display:block;overflow:hidden}.md-typeset .codehilitetable tbody,.md-typeset .codehilitetable td,.md-typeset .highlighttable tbody,.md-typeset .highlighttable td{display:block;padding:0}.md-typeset .codehilitetable tr,.md-typeset .highlighttable tr{display:-webkit-box;display:flex}.md-typeset .codehilitetable .linenodiv,.md-typeset .codehilitetable pre,.md-typeset .highlighttable .linenodiv,.md-typeset .highlighttable pre{margin:0;border-radius:0}.md-typeset .codehilitetable .linenodiv,.md-typeset .highlighttable .linenodiv{padding:.525rem .6rem}.md-typeset .codehilitetable .linenos,.md-typeset .highlighttable .linenos{background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.26);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.md-typeset .codehilitetable .linenos pre,.md-typeset .highlighttable .linenos pre{background-color:transparent;color:inherit;text-align:right}.md-typeset .codehilitetable .code,.md-typeset .highlighttable .code{-webkit-box-flex:1;flex:1;overflow:hidden}.md-typeset>.codehilitetable,.md-typeset>.highlighttable{margin:1em 0;border-radius:.2em}.md-typeset [id^="fnref:"]{display:inline-block}.md-typeset [id^="fnref:"]:target{margin-top:-3.8rem;padding-top:3.8rem;pointer-events:none}.md-typeset [id^="fn:"]:before{display:none;height:0;content:""}.md-typeset [id^="fn:"]:target:before{display:block;margin-top:-3.5rem;padding-top:3.5rem;pointer-events:none}.md-typeset .footnote{color:rgba(0,0,0,.54);font-size:.64rem}.md-typeset .footnote ol{margin-left:0}.md-typeset .footnote li{-webkit-transition:color .25s;transition:color .25s}.md-typeset .footnote li:target{color:rgba(0,0,0,.87)}.md-typeset .footnote li :first-child{margin-top:0}.md-typeset .footnote li:hover .footnote-backref,.md-typeset .footnote li:target .footnote-backref{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}.md-typeset .footnote li:hover .footnote-backref:hover,.md-typeset .footnote li:target .footnote-backref{color:#536dfe}.md-typeset .footnote-ref{display:inline-block;pointer-events:auto}.md-typeset .footnote-ref:before{display:inline;margin:0 .2em;border-left:.05rem solid rgba(0,0,0,.26);font-size:1.25em;content:"";vertical-align:-.25rem}.md-typeset .footnote-backref{display:inline-block;-webkit-transform:translateX(.25rem);transform:translateX(.25rem);-webkit-transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:color .25s,opacity .125s .125s,-webkit-transform .25s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s;transition:transform .25s .125s,color .25s,opacity .125s .125s,-webkit-transform .25s .125s;color:rgba(0,0,0,.26);font-size:0;opacity:0;vertical-align:text-bottom}[dir=rtl] .md-typeset .footnote-backref{-webkit-transform:translateX(-.25rem);transform:translateX(-.25rem)}.md-typeset .footnote-backref:before{display:inline-block;font-size:.8rem;content:"\E31B"}[dir=rtl] .md-typeset .footnote-backref:before{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.md-typeset .headerlink{display:inline-block;margin-left:.5rem;-webkit-transform:translateY(.25rem);transform:translateY(.25rem);-webkit-transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:color .25s,opacity .125s .25s,-webkit-transform .25s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s;transition:transform .25s .25s,color .25s,opacity .125s .25s,-webkit-transform .25s .25s;opacity:0}[dir=rtl] .md-typeset .headerlink{margin-right:.5rem;margin-left:0}html body .md-typeset .headerlink{color:rgba(0,0,0,.26)}.md-typeset h1[id]:before{display:block;margin-top:-9px;padding-top:9px;content:""}.md-typeset h1[id]:target:before{margin-top:-3.45rem;padding-top:3.45rem}.md-typeset h1[id] .headerlink:focus,.md-typeset h1[id]:hover .headerlink,.md-typeset h1[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h1[id] .headerlink:focus,.md-typeset h1[id]:hover .headerlink:hover,.md-typeset h1[id]:target .headerlink{color:#536dfe}.md-typeset h2[id]:before{display:block;margin-top:-8px;padding-top:8px;content:""}.md-typeset h2[id]:target:before{margin-top:-3.4rem;padding-top:3.4rem}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink,.md-typeset h2[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h2[id] .headerlink:focus,.md-typeset h2[id]:hover .headerlink:hover,.md-typeset h2[id]:target .headerlink{color:#536dfe}.md-typeset h3[id]:before{display:block;margin-top:-9px;padding-top:9px;content:""}.md-typeset h3[id]:target:before{margin-top:-3.45rem;padding-top:3.45rem}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink,.md-typeset h3[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h3[id] .headerlink:focus,.md-typeset h3[id]:hover .headerlink:hover,.md-typeset h3[id]:target .headerlink{color:#536dfe}.md-typeset h4[id]:before{display:block;margin-top:-9px;padding-top:9px;content:""}.md-typeset h4[id]:target:before{margin-top:-3.45rem;padding-top:3.45rem}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink,.md-typeset h4[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h4[id] .headerlink:focus,.md-typeset h4[id]:hover .headerlink:hover,.md-typeset h4[id]:target .headerlink{color:#536dfe}.md-typeset h5[id]:before{display:block;margin-top:-11px;padding-top:11px;content:""}.md-typeset h5[id]:target:before{margin-top:-3.55rem;padding-top:3.55rem}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink,.md-typeset h5[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h5[id] .headerlink:focus,.md-typeset h5[id]:hover .headerlink:hover,.md-typeset h5[id]:target .headerlink{color:#536dfe}.md-typeset h6[id]:before{display:block;margin-top:-11px;padding-top:11px;content:""}.md-typeset h6[id]:target:before{margin-top:-3.55rem;padding-top:3.55rem}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink,.md-typeset h6[id]:target .headerlink{-webkit-transform:translate(0);transform:translate(0);opacity:1}.md-typeset h6[id] .headerlink:focus,.md-typeset h6[id]:hover .headerlink:hover,.md-typeset h6[id]:target .headerlink{color:#536dfe}.md-typeset .MJXc-display{margin:.75em 0;padding:.75em 0;overflow:auto;-webkit-overflow-scrolling:touch}.md-typeset .MathJax_CHTML{outline:0}.md-typeset .critic.comment,.md-typeset del.critic,.md-typeset ins.critic{margin:0 .25em;padding:.0625em 0;border-radius:.1rem;-webkit-box-decoration-break:clone;box-decoration-break:clone}.md-typeset del.critic{background-color:#fdd;box-shadow:.25em 0 0 #fdd,-.25em 0 0 #fdd}.md-typeset ins.critic{background-color:#dfd;box-shadow:.25em 0 0 #dfd,-.25em 0 0 #dfd}.md-typeset .critic.comment{background-color:hsla(0,0%,92.5%,.5);color:#37474f;box-shadow:.25em 0 0 hsla(0,0%,92.5%,.5),-.25em 0 0 hsla(0,0%,92.5%,.5)}.md-typeset .critic.comment:before{padding-right:.125em;color:rgba(0,0,0,.26);content:"\E0B7";vertical-align:-.125em}.md-typeset .critic.block{display:block;margin:1em 0;padding-right:.8rem;padding-left:.8rem;box-shadow:none}.md-typeset .critic.block :first-child{margin-top:.5em}.md-typeset .critic.block :last-child{margin-bottom:.5em}.md-typeset details{display:block;padding-top:0}.md-typeset details[open]>summary:after{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.md-typeset details:not([open]){padding-bottom:0}.md-typeset details:not([open])>summary{border-bottom:none}.md-typeset details summary{padding-right:2rem}[dir=rtl] .md-typeset details summary{padding-left:2rem}.no-details .md-typeset details:not([open])>*{display:none}.no-details .md-typeset details:not([open]) summary{display:block}.md-typeset summary{display:block;outline:none;cursor:pointer}.md-typeset summary::-webkit-details-marker{display:none}.md-typeset summary:after{position:absolute;top:.4rem;right:.6rem;color:rgba(0,0,0,.26);font-size:1rem;content:"\E313"}[dir=rtl] .md-typeset summary:after{right:auto;left:.6rem}.md-typeset .emojione,.md-typeset .gemoji,.md-typeset .twemoji{width:1rem;vertical-align:text-top}.md-typeset code.codehilite,.md-typeset code.highlight{margin:0 .29412em;padding:.07353em 0}.md-typeset .superfences-content{display:none;-webkit-box-ordinal-group:100;order:99;width:100%;background-color:#fff}.md-typeset .superfences-content pre{margin:0;border-radius:0}.md-typeset .superfences-tabs{display:-webkit-box;display:flex;position:relative;flex-wrap:wrap;margin:1em 0;border:.05rem solid rgba(0,0,0,.07);border-radius:.2em}.md-typeset .superfences-tabs>input{display:none}.md-typeset .superfences-tabs>input:checked+label{font-weight:700}.md-typeset .superfences-tabs>input:checked+label+.superfences-content{display:block}.md-typeset .superfences-tabs>label{width:auto;padding:.6rem;-webkit-transition:color .125s;transition:color .125s;font-size:.64rem;cursor:pointer}html .md-typeset .superfences-tabs>label:hover{color:#536dfe}.md-typeset .task-list-item{position:relative;list-style-type:none}.md-typeset .task-list-item [type=checkbox]{position:absolute;top:.45em;left:-2em}[dir=rtl] .md-typeset .task-list-item [type=checkbox]{right:-2em;left:auto}.md-typeset .task-list-control .task-list-indicator:before{position:absolute;top:.15em;left:-1.25em;color:rgba(0,0,0,.26);font-size:1.25em;content:"\E835";vertical-align:-.25em}[dir=rtl] .md-typeset .task-list-control .task-list-indicator:before{right:-1.25em;left:auto}.md-typeset .task-list-control [type=checkbox]:checked+.task-list-indicator:before{content:"\E834"}.md-typeset .task-list-control [type=checkbox]{opacity:0;z-index:-1}@media print{.md-typeset a:after{color:rgba(0,0,0,.54);content:" [" attr(href) "]"}.md-typeset code,.md-typeset pre{white-space:pre-wrap}.md-typeset code{box-shadow:none;-webkit-box-decoration-break:initial;box-decoration-break:slice}.md-clipboard,.md-content__icon,.md-footer,.md-header,.md-sidebar,.md-tabs,.md-typeset .headerlink{display:none}}@media only screen and (max-width:44.9375em){.md-typeset>pre{margin:1em -.8rem;border-radius:0}.md-typeset>pre>code{padding:.525rem .8rem}.md-footer-nav__link--prev .md-footer-nav__title{display:none}.md-search-result__teaser{max-height:2.5rem;-webkit-line-clamp:3}.codehilite .hll,.md-typeset .highlight .hll{margin:0 -.8rem;padding:0 .8rem}.md-typeset>.codehilite,.md-typeset>.highlight{margin:1em -.8rem}.md-typeset>.codehilite code,.md-typeset>.highlight code{padding:.525rem .8rem}.md-typeset>.codehilitetable,.md-typeset>.highlighttable{margin:1em -.8rem;border-radius:0}.md-typeset>.codehilitetable .linenodiv,.md-typeset>.highlighttable .linenodiv{padding:.5rem .8rem}.md-typeset>p>.MJXc-display{margin:.75em -.8rem;padding:.25em .8rem}.md-typeset>.superfences-tabs{margin:1em -.8rem;border:0;border-top:.05rem solid rgba(0,0,0,.07);border-radius:0}.md-typeset>.superfences-tabs code{padding:.525rem .8rem}.md-typeset>.superfences-tabs input:first-child+label{margin-left:.2rem}}@media only screen and (min-width:100em){html{font-size:137.5%}}@media only screen and (min-width:125em){html{font-size:150%}}@media only screen and (max-width:59.9375em){body[data-md-state=lock]{overflow:hidden}.ios body[data-md-state=lock] .md-container{display:none}html .md-nav__link[for=__toc]{display:block;padding-right:2.4rem}html .md-nav__link[for=__toc]:after{color:inherit;content:"\E8DE"}html .md-nav__link[for=__toc]+.md-nav__link{display:none}html .md-nav__link[for=__toc]~.md-nav{display:-webkit-box;display:flex}html [dir=rtl] .md-nav__link{padding-right:.8rem;padding-left:2.4rem}.md-nav__source{display:block;padding:0 .2rem;background-color:rgba(50,64,144,.9675);color:#fff}.md-search__overlay{position:absolute;top:.2rem;left:.2rem;width:1.8rem;height:1.8rem;-webkit-transform-origin:center;transform-origin:center;-webkit-transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:opacity .2s .2s,-webkit-transform .3s .1s;transition:transform .3s .1s,opacity .2s .2s;transition:transform .3s .1s,opacity .2s .2s,-webkit-transform .3s .1s;border-radius:1rem;background-color:#fff;overflow:hidden;pointer-events:none}[dir=rtl] .md-search__overlay{right:.2rem;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transition:opacity .1s,-webkit-transform .4s;transition:opacity .1s,-webkit-transform .4s;transition:transform .4s,opacity .1s;transition:transform .4s,opacity .1s,-webkit-transform .4s;opacity:1}.md-search__inner{position:fixed;top:0;left:100%;width:100%;height:100%;-webkit-transform:translateX(5%);transform:translateX(5%);-webkit-transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s;transition:right 0s .3s,left 0s .3s,transform .15s cubic-bezier(.4,0,.2,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.4,0,.2,1) .15s;opacity:0;z-index:2}[data-md-toggle=search]:checked~.md-header .md-search__inner{left:0;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s;transition:right 0s 0s,left 0s 0s,transform .15s cubic-bezier(.1,.7,.1,1) .15s,opacity .15s .15s,-webkit-transform .15s cubic-bezier(.1,.7,.1,1) .15s;opacity:1}[dir=rtl] [data-md-toggle=search]:checked~.md-header .md-search__inner{right:0;left:auto}html [dir=rtl] .md-search__inner{right:100%;left:auto;-webkit-transform:translateX(-5%);transform:translateX(-5%)}.md-search__input{width:100%;height:2.4rem;font-size:.9rem}.md-search__icon[for=__search]{top:.6rem;left:.8rem}.md-search__icon[for=__search][for=__search]:before{content:"\E5C4"}[dir=rtl] .md-search__icon[for=__search][for=__search]:before{content:"\E5C8"}.md-search__icon[type=reset]{top:.6rem;right:.8rem}.md-search__output{top:2.4rem;bottom:0}.md-search-result__article--document:before{display:none}}@media only screen and (max-width:76.1875em){[data-md-toggle=drawer]:checked~.md-overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-header-nav__button.md-icon--home,.md-header-nav__button.md-logo{display:none}.md-hero__inner{margin-top:2.4rem;margin-bottom:1.2rem}.md-nav{background-color:#fff}.md-nav--primary,.md-nav--primary .md-nav{display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;height:100%;z-index:1}.md-nav--primary .md-nav__item,.md-nav--primary .md-nav__title{font-size:.8rem;line-height:1.5}html .md-nav--primary .md-nav__title{position:relative;height:5.6rem;padding:3rem .8rem .2rem;background-color:rgba(0,0,0,.07);color:rgba(0,0,0,.54);font-weight:400;line-height:2.4rem;white-space:nowrap;cursor:pointer}html .md-nav--primary .md-nav__title:before{display:block;position:absolute;top:.2rem;left:.2rem;width:2rem;height:2rem;color:rgba(0,0,0,.54)}html .md-nav--primary .md-nav__title~.md-nav__list{background-color:#fff;box-shadow:inset 0 .05rem 0 rgba(0,0,0,.07)}html .md-nav--primary .md-nav__title~.md-nav__list>.md-nav__item:first-child{border-top:0}html .md-nav--primary .md-nav__title--site{position:relative;background-color:#3f51b5;color:#fff}html .md-nav--primary .md-nav__title--site .md-nav__button{display:block;position:absolute;top:.2rem;left:.2rem;width:3.2rem;height:3.2rem;font-size:2.4rem}html .md-nav--primary .md-nav__title--site:before{display:none}html [dir=rtl] .md-nav--primary .md-nav__title--site .md-nav__button,html [dir=rtl] .md-nav--primary .md-nav__title:before{right:.2rem;left:auto}.md-nav--primary .md-nav__list{-webkit-box-flex:1;flex:1;overflow-y:auto}.md-nav--primary .md-nav__item{padding:0;border-top:.05rem solid rgba(0,0,0,.07)}[dir=rtl] .md-nav--primary .md-nav__item{padding:0}.md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:2.4rem}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link{padding-right:.8rem;padding-left:2.4rem}.md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E315"}[dir=rtl] .md-nav--primary .md-nav__item--nested>.md-nav__link:after{content:"\E314"}.md-nav--primary .md-nav__link{position:relative;margin-top:0;padding:.6rem .8rem}.md-nav--primary .md-nav__link:after{position:absolute;top:50%;right:.6rem;margin-top:-.6rem;color:inherit;font-size:1.2rem}[dir=rtl] .md-nav--primary .md-nav__link:after{right:auto;left:.6rem}.md-nav--primary .md-nav--secondary .md-nav__link{position:static}.md-nav--primary .md-nav--secondary .md-nav{position:static;background-color:transparent}.md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-left:1.4rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav__link{padding-right:1.4rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-left:2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav__link{padding-right:2rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-left:2.6rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav__link{padding-right:2.6rem;padding-left:0}.md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-left:3.2rem}[dir=rtl] .md-nav--primary .md-nav--secondary .md-nav .md-nav .md-nav .md-nav .md-nav__link{padding-right:3.2rem;padding-left:0}.md-nav__toggle~.md-nav{display:-webkit-box;display:flex;-webkit-transform:translateX(100%);transform:translateX(100%);-webkit-transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s;transition:transform .25s cubic-bezier(.8,0,.6,1),opacity .125s .05s,-webkit-transform .25s cubic-bezier(.8,0,.6,1);opacity:0}[dir=rtl] .md-nav__toggle~.md-nav{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.no-csstransforms3d .md-nav__toggle~.md-nav{display:none}.md-nav__toggle:checked~.md-nav{-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s;transition:transform .25s cubic-bezier(.4,0,.2,1),opacity .125s .125s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);opacity:1}.no-csstransforms3d .md-nav__toggle:checked~.md-nav{display:-webkit-box;display:flex}.md-sidebar--primary{position:fixed;top:0;left:-12.1rem;width:12.1rem;height:100%;-webkit-transform:translateX(0);transform:translateX(0);-webkit-transition:box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s;transition:transform .25s cubic-bezier(.4,0,.2,1),box-shadow .25s,-webkit-transform .25s cubic-bezier(.4,0,.2,1);background-color:#fff;z-index:3}[dir=rtl] .md-sidebar--primary{right:-12.1rem;left:auto}.no-csstransforms3d .md-sidebar--primary{display:none}[data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{box-shadow:0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12),0 5px 5px -3px rgba(0,0,0,.4);-webkit-transform:translateX(12.1rem);transform:translateX(12.1rem)}[dir=rtl] [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{-webkit-transform:translateX(-12.1rem);transform:translateX(-12.1rem)}.no-csstransforms3d [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary{display:block}.md-sidebar--primary .md-sidebar__scrollwrap{overflow:hidden;position:absolute;top:0;right:0;bottom:0;left:0;margin:0}.md-tabs{display:none}}@media only screen and (min-width:60em){.md-content{margin-right:12.1rem}[dir=rtl] .md-content{margin-right:0;margin-left:12.1rem}.md-header-nav__button.md-icon--search{display:none}.md-header-nav__source{display:block;width:11.7rem;max-width:11.7rem;padding-right:.6rem}[dir=rtl] .md-header-nav__source{padding-right:0;padding-left:.6rem}.md-search{padding:.2rem}.md-search__overlay{position:fixed;top:0;left:0;width:0;height:0;-webkit-transition:width 0s .25s,height 0s .25s,opacity .25s;transition:width 0s .25s,height 0s .25s,opacity .25s;background-color:rgba(0,0,0,.54);cursor:pointer}[dir=rtl] .md-search__overlay{right:0;left:auto}[data-md-toggle=search]:checked~.md-header .md-search__overlay{width:100%;height:100%;-webkit-transition:width 0s,height 0s,opacity .25s;transition:width 0s,height 0s,opacity .25s;opacity:1}.md-search__inner{position:relative;width:11.5rem;margin-right:.8rem;padding:.1rem 0;float:right;-webkit-transition:width .25s cubic-bezier(.1,.7,.1,1);transition:width .25s cubic-bezier(.1,.7,.1,1)}[dir=rtl] .md-search__inner{margin-right:0;margin-left:.8rem;float:left}.md-search__form,.md-search__input{border-radius:.1rem}.md-search__input{width:100%;height:1.8rem;padding-left:2.2rem;-webkit-transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);transition:background-color .25s cubic-bezier(.1,.7,.1,1),color .25s cubic-bezier(.1,.7,.1,1);background-color:rgba(0,0,0,.26);color:inherit;font-size:.8rem}[dir=rtl] .md-search__input{padding-right:2.2rem}.md-search__input+.md-search__icon{color:inherit}.md-search__input::-webkit-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::-moz-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::-ms-input-placeholder{color:hsla(0,0%,100%,.7)}.md-search__input::placeholder{color:hsla(0,0%,100%,.7)}.md-search__input:hover{background-color:hsla(0,0%,100%,.12)}[data-md-toggle=search]:checked~.md-header .md-search__input{border-radius:.1rem .1rem 0 0;background-color:#fff;color:rgba(0,0,0,.87);text-overflow:clip}[data-md-toggle=search]:checked~.md-header .md-search__input::-webkit-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input::-moz-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input:-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input::-ms-input-placeholder{color:rgba(0,0,0,.54)}[data-md-toggle=search]:checked~.md-header .md-search__input+.md-search__icon,[data-md-toggle=search]:checked~.md-header .md-search__input::placeholder{color:rgba(0,0,0,.54)}.md-search__output{top:1.9rem;-webkit-transition:opacity .4s;transition:opacity .4s;opacity:0}[data-md-toggle=search]:checked~.md-header .md-search__output{box-shadow:0 6px 10px 0 rgba(0,0,0,.14),0 1px 18px 0 rgba(0,0,0,.12),0 3px 5px -1px rgba(0,0,0,.4);opacity:1}.md-search__scrollwrap{max-height:0}[data-md-toggle=search]:checked~.md-header .md-search__scrollwrap{max-height:75vh}.md-search__scrollwrap::-webkit-scrollbar{width:.2rem;height:.2rem}.md-search__scrollwrap::-webkit-scrollbar-thumb{background-color:rgba(0,0,0,.26)}.md-search__scrollwrap::-webkit-scrollbar-thumb:hover{background-color:#536dfe}.md-search-result__meta{padding-left:2.2rem}[dir=rtl] .md-search-result__meta{padding-right:2.2rem;padding-left:0}.md-search-result__article{padding-left:2.2rem}[dir=rtl] .md-search-result__article{padding-right:2.2rem;padding-left:.8rem}.md-sidebar--secondary{display:block;margin-left:100%;-webkit-transform:translate(-100%);transform:translate(-100%)}[dir=rtl] .md-sidebar--secondary{margin-right:100%;margin-left:0;-webkit-transform:translate(100%);transform:translate(100%)}}@media only screen and (min-width:76.25em){.md-content{margin-left:12.1rem}[dir=rtl] .md-content{margin-right:12.1rem}.md-content__inner{margin-right:1.2rem;margin-left:1.2rem}.md-header-nav__button.md-icon--menu{display:none}.md-nav[data-md-state=animate]{-webkit-transition:max-height .25s cubic-bezier(.86,0,.07,1);transition:max-height .25s cubic-bezier(.86,0,.07,1)}.md-nav__toggle~.md-nav{max-height:0;overflow:hidden}.no-js .md-nav__toggle~.md-nav{display:none}.md-nav[data-md-state=expand],.md-nav__toggle:checked~.md-nav{max-height:100%}.no-js .md-nav[data-md-state=expand],.no-js .md-nav__toggle:checked~.md-nav{display:block}.md-nav__item--nested>.md-nav>.md-nav__title{display:none}.md-nav__item--nested>.md-nav__link:after{display:inline-block;-webkit-transform-origin:.45em .45em;transform-origin:.45em .45em;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;vertical-align:-.125em}.js .md-nav__item--nested>.md-nav__link:after{-webkit-transition:-webkit-transform .4s;transition:-webkit-transform .4s;transition:transform .4s;transition:transform .4s,-webkit-transform .4s}.md-nav__item--nested .md-nav__toggle:checked~.md-nav__link:after{-webkit-transform:rotateX(180deg);transform:rotateX(180deg)}.md-search__inner{margin-right:1.2rem}[dir=rtl] .md-search__inner{margin-left:1.2rem}.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:34.4rem}.md-sidebar--secondary{margin-left:61rem}[dir=rtl] .md-sidebar--secondary{margin-right:61rem;margin-left:0}.md-tabs~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{font-size:0;visibility:hidden}.md-tabs--active~.md-main .md-nav--primary .md-nav__title{display:block;padding:0}.md-tabs--active~.md-main .md-nav--primary .md-nav__title--site{display:none}.no-js .md-tabs--active~.md-main .md-nav--primary .md-nav{display:block}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item{font-size:0;visibility:hidden}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested{display:none;font-size:.7rem;overflow:auto;visibility:visible}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--nested>.md-nav__link{display:none}.md-tabs--active~.md-main .md-nav--primary>.md-nav__list>.md-nav__item--active{display:block}.md-tabs--active~.md-main .md-nav[data-md-level="1"]{max-height:none;overflow:visible}.md-tabs--active~.md-main .md-nav[data-md-level="1"]>.md-nav__list>.md-nav__item{padding-left:0}.md-tabs--active~.md-main .md-nav[data-md-level="1"] .md-nav .md-nav__title{display:none}}@media only screen and (min-width:45em){.md-footer-nav__link{width:50%}.md-footer-copyright{max-width:75%;float:left}[dir=rtl] .md-footer-copyright{float:right}.md-footer-social{padding:.6rem 0;float:right}[dir=rtl] .md-footer-social{float:left}}@media only screen and (max-width:29.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(45);transform:scale(45)}}@media only screen and (min-width:30em) and (max-width:44.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(60);transform:scale(60)}}@media only screen and (min-width:45em) and (max-width:59.9375em){[data-md-toggle=search]:checked~.md-header .md-search__overlay{-webkit-transform:scale(75);transform:scale(75)}}@media only screen and (min-width:60em) and (max-width:76.1875em){.md-search__scrollwrap,[data-md-toggle=search]:checked~.md-header .md-search__inner{width:23.4rem}.md-search-result__teaser{max-height:2.5rem;-webkit-line-clamp:3}} \ No newline at end of file
diff --git a/freetype/docs/reference/ft2-auto_hinter.html b/freetype/docs/reference/ft2-auto_hinter.html
index 2ccc6ce9..321b7f7f 100644
--- a/freetype/docs/reference/ft2-auto_hinter.html
+++ b/freetype/docs/reference/ft2-auto_hinter.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>The auto-hinter - FreeType-2.11.1 API Reference</title>
+ <title>The auto-hinter - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -698,6 +710,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1203,7 +1227,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-base_interface.html b/freetype/docs/reference/ft2-base_interface.html
index 91925f18..58e977ec 100644
--- a/freetype/docs/reference/ft2-base_interface.html
+++ b/freetype/docs/reference/ft2-base_interface.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Base Interface - FreeType-2.11.1 API Reference</title>
+ <title>Base Interface - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -467,6 +467,27 @@
</li>
<li class="md-nav__item">
+ <a href="#ft_has_svg" class="md-nav__link">
+ FT_HAS_SVG
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_has_sbix" class="md-nav__link">
+ FT_HAS_SBIX
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_has_sbix_overlay" class="md-nav__link">
+ FT_HAS_SBIX_OVERLAY
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#ft_is_sfnt" class="md-nav__link">
FT_IS_SFNT
</a>
@@ -1144,6 +1165,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -1258,6 +1291,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1793,6 +1838,27 @@
</li>
<li class="md-nav__item">
+ <a href="#ft_has_svg" class="md-nav__link">
+ FT_HAS_SVG
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_has_sbix" class="md-nav__link">
+ FT_HAS_SBIX
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_has_sbix_overlay" class="md-nav__link">
+ FT_HAS_SBIX_OVERLAY
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#ft_is_sfnt" class="md-nav__link">
FT_IS_SFNT
</a>
@@ -2303,8 +2369,8 @@
<p>A handle to an object that models a face scaled to a given character size.</p>
<h4>note</h4>
-<p>An <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> has one <em>active</em> <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> object that is used by functions like <code><a href="ft2-base_interface.html#ft_load_glyph">FT_Load_Glyph</a></code> to determine the scaling transformation that in turn is used to load and hint glyphs and metrics.</p>
-<p>You can use <code><a href="ft2-base_interface.html#ft_set_char_size">FT_Set_Char_Size</a></code>, <code><a href="ft2-base_interface.html#ft_set_pixel_sizes">FT_Set_Pixel_Sizes</a></code>, <code><a href="ft2-base_interface.html#ft_request_size">FT_Request_Size</a></code> or even <code><a href="ft2-base_interface.html#ft_select_size">FT_Select_Size</a></code> to change the content (i.e., the scaling values) of the active <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code>.</p>
+<p>An <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code> has one <em>active</em> <code>FT_Size</code> object that is used by functions like <code><a href="ft2-base_interface.html#ft_load_glyph">FT_Load_Glyph</a></code> to determine the scaling transformation that in turn is used to load and hint glyphs and metrics.</p>
+<p>A newly created <code>FT_Size</code> object contains only meaningless zero values. You must use <code><a href="ft2-base_interface.html#ft_set_char_size">FT_Set_Char_Size</a></code>, <code><a href="ft2-base_interface.html#ft_set_pixel_sizes">FT_Set_Pixel_Sizes</a></code>, <code><a href="ft2-base_interface.html#ft_request_size">FT_Request_Size</a></code> or even <code><a href="ft2-base_interface.html#ft_select_size">FT_Select_Size</a></code> to change the content (i.e., the scaling values) of the active <code>FT_Size</code>. Otherwise, the scaling and hinting will not be performed.</p>
<p>You can use <code><a href="ft2-sizes_management.html#ft_new_size">FT_New_Size</a></code> to create additional size objects for a given <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code>, but they won't be used by other functions until you activate it through <code><a href="ft2-sizes_management.html#ft_activate_size">FT_Activate_Size</a></code>. Only one size can be activated at any given time per face.</p>
<h4>also</h4>
@@ -2720,6 +2786,93 @@
<p>A macro that returns true whenever a face object contains some multiple masters. The functions provided by <code><a href="ft2-header_file_macros.html#ft_multiple_masters_h">FT_MULTIPLE_MASTERS_H</a></code> are then available to choose the exact design you want.</p>
<hr>
+<h2 id="ft_has_svg">FT_HAS_SVG<a class="headerlink" href="#ft_has_svg" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
+<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <b>FT_HAS_SVG</b>( face ) \
+ ( !!( (face)-&gt;face_flags &amp; <a href="ft2-base_interface.html#ft_face_flag_svg">FT_FACE_FLAG_SVG</a> ) )
+</code></pre></div>
+
+<p>A macro that returns true whenever a face object contains an &lsquo;SVG&nbsp;&rsquo; OpenType table.</p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+<h2 id="ft_has_sbix">FT_HAS_SBIX<a class="headerlink" href="#ft_has_sbix" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
+<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <b>FT_HAS_SBIX</b>( face ) \
+ ( !!( (face)-&gt;face_flags &amp; <a href="ft2-base_interface.html#ft_face_flag_sbix">FT_FACE_FLAG_SBIX</a> ) )
+</code></pre></div>
+
+<p>A macro that returns true whenever a face object contains an &lsquo;sbix&rsquo; OpenType table <em>and</em> outline glyphs.</p>
+<p>Currently, FreeType only supports bitmap glyphs in PNG format for this table (i.e., JPEG and TIFF formats are unsupported, as are Apple-specific formats not part of the OpenType specification).</p>
+<h4>note</h4>
+
+<p>For backward compatibility, a font with an &lsquo;sbix&rsquo; table is treated as a bitmap-only face. Using <code><a href="ft2-base_interface.html#ft_open_face">FT_Open_Face</a></code> with <code><a href="ft2-parameter_tags.html#ft_param_tag_ignore_sbix">FT_PARAM_TAG_IGNORE_SBIX</a></code>, an application can switch off &lsquo;sbix&rsquo; handling so that the face is treated as an ordinary outline font with scalable outlines.</p>
+<p>Here is some pseudo code that roughly illustrates how to implement &lsquo;sbix&rsquo; handling according to the OpenType specification.
+<div class="highlight"><pre><span></span><code> if ( FT_HAS_SBIX( face ) )
+ {
+ // open font as a scalable one without sbix handling
+ FT_Face face2;
+ FT_Parameter param = { FT_PARAM_TAG_IGNORE_SBIX, NULL };
+ FT_Open_Args args = { FT_OPEN_PARAMS | ...,
+ ...,
+ 1, &amp;param };
+
+
+ FT_Open_Face( library, &amp;args, 0, &amp;face2 );
+
+ &lt;sort `face-&gt;available_size` as necessary into
+ `preferred_sizes`[*]&gt;
+
+ for ( i = 0; i &lt; face-&gt;num_fixed_sizes; i++ )
+ {
+ size = preferred_sizes[i].size;
+
+ error = FT_Set_Pixel_Sizes( face, size, size );
+ &lt;error handling omitted&gt;
+
+ // check whether we have a glyph in a bitmap strike
+ error = FT_Load_Glyph( face,
+ glyph_index,
+ FT_LOAD_SBITS_ONLY |
+ FT_LOAD_BITMAP_METRICS_ONLY );
+ if ( error == FT_Err_Invalid_Argument )
+ continue;
+ else if ( error )
+ &lt;other error handling omitted&gt;
+ else
+ break;
+ }
+
+ if ( i != face-&gt;num_fixed_sizes )
+ &lt;load embedded bitmap with `FT_Load_Glyph`,
+ scale it, display it, etc.&gt;
+
+ if ( i == face-&gt;num_fixed_sizes ||
+ FT_HAS_SBIX_OVERLAY( face ) )
+ &lt;use `face2` to load outline glyph with `FT_Load_Glyph`,
+ scale it, display it on top of the bitmap, etc.&gt;
+ }
+</code></pre></div></p>
+<p>[*] Assuming a target value of 400dpi and available strike sizes 100, 200, 300, and 400dpi, a possible order might be [400, 200, 300, 100]: scaling 200dpi to 400dpi usually gives better results than scaling 300dpi to 400dpi; it is also much faster. However, scaling 100dpi to 400dpi can yield a too pixelated result, thus the preference might be 300dpi over 100dpi.</p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+<h2 id="ft_has_sbix_overlay">FT_HAS_SBIX_OVERLAY<a class="headerlink" href="#ft_has_sbix_overlay" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
+<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <b>FT_HAS_SBIX_OVERLAY</b>( face ) \
+ ( !!( (face)-&gt;face_flags &amp; <a href="ft2-base_interface.html#ft_face_flag_sbix_overlay">FT_FACE_FLAG_SBIX_OVERLAY</a> ) )
+</code></pre></div>
+
+<p>A macro that returns true whenever a face object contains an &lsquo;sbix&rsquo; OpenType table with bit&nbsp;1 in its <code>flags</code> field set, instructing the application to overlay the bitmap strike with the corresponding outline glyph. See <code><a href="ft2-base_interface.html#ft_has_sbix">FT_HAS_SBIX</a></code> for pseudo code how to use it.</p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
<h2 id="ft_is_sfnt">FT_IS_SFNT<a class="headerlink" href="#ft_is_sfnt" title="Permanent link">&para;</a></h2>
<p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <b>FT_IS_SFNT</b>( face ) \
@@ -3786,7 +3939,7 @@
<p>Although drivers may select the bitmap strike matching the request, you should not rely on this if you intend to select a particular bitmap strike. Use <code><a href="ft2-base_interface.html#ft_select_size">FT_Select_Size</a></code> instead in that case.</p>
<p>The relation between the requested size and the resulting glyph size is dependent entirely on how the size is defined in the source face. The font designer chooses the final size of each glyph relative to this size. For more information refer to &lsquo;<a href="https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html">https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html</a>&rsquo;.</p>
-<p>Contrary to <code><a href="ft2-base_interface.html#ft_set_char_size">FT_Set_Char_Size</a></code>, this function doesn't have special code to normalize zero-valued widths, heights, or resolutions (which lead to errors in most cases).</p>
+<p>Contrary to <code><a href="ft2-base_interface.html#ft_set_char_size">FT_Set_Char_Size</a></code>, this function doesn't have special code to normalize zero-valued widths, heights, or resolutions, which are treated as <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_SCALE</a></code>.</p>
<p>Don't use this function if you are using the FreeType cache API.</p>
<hr>
@@ -3997,7 +4150,7 @@
<p>The index of the glyph in the font file. For CID-keyed fonts (either in PS or in CFF format) this argument specifies the CID value.</p>
</td></tr>
<tr><td class="val" id="load_flags">load_flags</td><td class="desc">
-<p>A flag indicating what to load for this glyph. The <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_XXX</a></code> 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).</p>
+<p>A flag indicating what to load for this glyph. The <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_XXX</a></code> flags 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).</p>
</td></tr>
</table>
@@ -4006,7 +4159,7 @@
<p>FreeType error code. 0&nbsp;means success.</p>
<h4>note</h4>
-<p>The loaded glyph may be transformed. See <code><a href="ft2-base_interface.html#ft_set_transform">FT_Set_Transform</a></code> for the details.</p>
+<p>For proper scaling and hinting, the active <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> object owned by the face has to be meaningfully initialized by calling <code><a href="ft2-base_interface.html#ft_set_char_size">FT_Set_Char_Size</a></code> before this function, for example. The loaded glyph may be transformed. See <code><a href="ft2-base_interface.html#ft_set_transform">FT_Set_Transform</a></code> for the details.</p>
<p>For subsetted CID-keyed fonts, <code>FT_Err_Invalid_Argument</code> is returned for invalid CID values (this is, for CID values that don't have a corresponding glyph in the font). See the discussion of the <code><a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_CID_KEYED</a></code> flag for more details.</p>
<p>If you receive <code>FT_Err_Glyph_Too_Big</code>, try getting the glyph outline at EM size, then scale it manually and fill it as a graphics operation.</p>
<hr>
@@ -4203,7 +4356,7 @@
<table class="fields">
<tr><td class="val" id="render_mode">render_mode</td><td class="desc">
<p>The render mode used to render the glyph image into a bitmap. See <code><a href="ft2-base_interface.html#ft_render_mode">FT_Render_Mode</a></code> for a list of possible values.</p>
-<p>If <code><a href="ft2-base_interface.html#ft_render_mode">FT_RENDER_MODE_NORMAL</a></code> is used, a previous call of <code><a href="ft2-base_interface.html#ft_load_glyph">FT_Load_Glyph</a></code> with flag <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_COLOR</a></code> makes FT_Render_Glyph provide a default blending of colored glyph layers associated with the current glyph slot (provided the font contains such layers) instead of rendering the glyph slot's outline. This is an experimental feature; see <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_COLOR</a></code> for more information.</p>
+<p>If <code><a href="ft2-base_interface.html#ft_render_mode">FT_RENDER_MODE_NORMAL</a></code> is used, a previous call of <code><a href="ft2-base_interface.html#ft_load_glyph">FT_Load_Glyph</a></code> with flag <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_COLOR</a></code> makes <code>FT_Render_Glyph</code> provide a default blending of colored glyph layers associated with the current glyph slot (provided the font contains such layers) instead of rendering the glyph slot's outline. This is an experimental feature; see <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_COLOR</a></code> for more information.</p>
</td></tr>
</table>
@@ -4212,7 +4365,6 @@
<p>FreeType error code. 0&nbsp;means success.</p>
<h4>note</h4>
-<p>To get meaningful results, font scaling values must be set with functions like <code><a href="ft2-base_interface.html#ft_set_char_size">FT_Set_Char_Size</a></code> before calling <code>FT_Render_Glyph</code>.</p>
<p>When FreeType outputs a bitmap of a glyph, it really outputs an alpha coverage map. If a pixel is completely covered by a filled-in outline, the bitmap contains 0xFF at that pixel, meaning that 0xFF/0xFF fraction of that pixel is covered, meaning the pixel is 100% black (or 0% bright). If a pixel is only 50% covered (value 0x80), the pixel is made 50% black (50% bright or a middle shade of grey). 0% covered means 0% black (100% bright or white).</p>
<p>On high-DPI screens like on smartphones and tablets, the pixels are so small that their chance of being completely covered and therefore completely black are fairly good. On the low-DPI screens, however, the situation is different. The pixels are too large for most of the details of a glyph and shades of gray are the norm rather than the exception.</p>
<p>This is relevant because all our screens have a second problem: they are not linear. 1&nbsp;+&nbsp;1 is not&nbsp;2. Twice the value does not result in twice the brightness. When a pixel is only 50% covered, the coverage map says 50% black, and this translates to a pixel value of 128 when you use 8&nbsp;bits per channel (0-255). However, this does not translate to 50% brightness for that pixel on our sRGB and gamma&nbsp;2.2 screens. Due to their non-linearity, they dwell longer in the darks and only a pixel value of about 186 results in 50% brightness &ndash; 128 ends up too dark on both bright and dark backgrounds. The net result is that dark text looks burnt-out, pixely and blotchy on bright background, bright text too frail on dark backgrounds, and colored text on colored background (for example, red on green) seems to have dark halos or &lsquo;dirt&rsquo; around it. The situation is especially ugly for diagonal stems like in &lsquo;w&rsquo; glyph shapes where the quality of FreeType's anti-aliasing depends on the correct display of grays. On high-DPI screens where smaller, fully black pixels reign supreme, this doesn't matter, but on our low-DPI screens with all the gray shades, it does. 0% and 100% brightness are the same things in linear and non-linear space, just all the shades in-between aren't.</p>
@@ -4310,6 +4462,32 @@ for pixel in buffer
// Store `sd` in a buffer or use as required.
}
</code></pre></div></p>
+<p>FreeType has two rasterizers for generating SDF, namely:</p>
+<ol>
+<li>
+<p><code>sdf</code> for generating SDF directly from glyph's outline, and</p>
+</li>
+<li>
+<p><code>bsdf</code> for generating SDF from rasterized bitmaps.</p>
+</li>
+</ol>
+<p>Depending on the glyph type (i.e., outline or bitmap), one of the two rasterizers is chosen at runtime and used for generating SDFs. To force the use of <code>bsdf</code> you should render the glyph with any of the FreeType's other rendering modes (e.g., <code>FT_RENDER_MODE_NORMAL</code>) and then re-render with <code>FT_RENDER_MODE_SDF</code>.</p>
+<p>There are some issues with stability and possible failures of the SDF renderers (specifically <code>sdf</code>).</p>
+<ol>
+<li>
+<p>The <code>sdf</code> rasterizer is sensitive to really small features (e.g., sharp turns that are less than 1&nbsp;pixel) and imperfections in the glyph's outline, causing artifacts in the final output.</p>
+</li>
+<li>
+<p>The <code>sdf</code> rasterizer has limited support for handling intersecting contours and <em>cannot</em> handle self-intersecting contours whatsoever. Self-intersection happens when a single connected contour intersect itself at some point; having these in your font definitely pose a problem to the rasterizer and cause artifacts, too.</p>
+</li>
+<li>
+<p>Generating SDF for really small glyphs may result in undesirable output; the pixel grid (which stores distance information) becomes too coarse.</p>
+</li>
+<li>
+<p>Since the output buffer is normalized, precision at smaller spreads is greater than precision at larger spread values because the output range of [0..255] gets mapped to a smaller SDF range. A spread of&nbsp;2 should be sufficient in most cases.</p>
+</li>
+</ol>
+<p>Points (1) and (2) can be avoided by using the <code>bsdf</code> rasterizer, which is more stable than the <code>sdf</code> rasterizer in general.</p>
<hr>
<h2 id="ft_get_kerning">FT_Get_Kerning<a class="headerlink" href="#ft_get_kerning" title="Permanent link">&para;</a></h2>
@@ -4729,6 +4907,9 @@ for pixel in buffer
#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_face_flag_tricky">FT_FACE_FLAG_TRICKY</a> ( 1L &lt;&lt; 13 )
#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_face_flag_color">FT_FACE_FLAG_COLOR</a> ( 1L &lt;&lt; 14 )
#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_face_flag_variation">FT_FACE_FLAG_VARIATION</a> ( 1L &lt;&lt; 15 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_face_flag_svg">FT_FACE_FLAG_SVG</a> ( 1L &lt;&lt; 16 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_face_flag_sbix">FT_FACE_FLAG_SBIX</a> ( 1L &lt;&lt; 17 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_face_flag_sbix_overlay">FT_FACE_FLAG_SBIX_OVERLAY</a> ( 1L &lt;&lt; 18 )
</code></pre></div>
<p>A list of bit flags used in the <code>face_flags</code> field of the <code><a href="ft2-base_interface.html#ft_facerec">FT_FaceRec</a></code> structure. They inform client applications of properties of the corresponding face.</p>
@@ -4786,6 +4967,15 @@ for pixel in buffer
<tr><td class="val" id="ft_face_flag_variation">FT_FACE_FLAG_VARIATION</td><td class="desc">
<p>[Since 2.9] Set if the current face (or named instance) has been altered with <code><a href="ft2-multiple_masters.html#ft_set_mm_design_coordinates">FT_Set_MM_Design_Coordinates</a></code>, <code><a href="ft2-multiple_masters.html#ft_set_var_design_coordinates">FT_Set_Var_Design_Coordinates</a></code>, or <code><a href="ft2-multiple_masters.html#ft_set_var_blend_coordinates">FT_Set_Var_Blend_Coordinates</a></code>. This flag is unset by a call to <code><a href="ft2-multiple_masters.html#ft_set_named_instance">FT_Set_Named_Instance</a></code>.</p>
</td></tr>
+<tr><td class="val" id="ft_face_flag_svg">FT_FACE_FLAG_SVG</td><td class="desc">
+<p>[Since 2.12] The face has an &lsquo;SVG&nbsp;&rsquo; OpenType table.</p>
+</td></tr>
+<tr><td class="val" id="ft_face_flag_sbix">FT_FACE_FLAG_SBIX</td><td class="desc">
+<p>[Since 2.12] The face has an &lsquo;sbix&rsquo; OpenType table <em>and</em> outlines. For such fonts, <code><a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_SCALABLE</a></code> is not set by default to retain backward compatibility.</p>
+</td></tr>
+<tr><td class="val" id="ft_face_flag_sbix_overlay">FT_FACE_FLAG_SBIX_OVERLAY</td><td class="desc">
+<p>[Since 2.12] The face has an &lsquo;sbix&rsquo; OpenType table where outlines should be drawn on top of bitmap strikes.</p>
+</td></tr>
</table>
<hr>
@@ -4858,19 +5048,20 @@ for pixel in buffer
<h2 id="ft_load_xxx">FT_LOAD_XXX<a class="headerlink" href="#ft_load_xxx" title="Permanent link">&para;</a></h2>
<p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_default">FT_LOAD_DEFAULT</a> 0x0
-#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_no_scale">FT_LOAD_NO_SCALE</a> ( 1L &lt;&lt; 0 )
-#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_no_hinting">FT_LOAD_NO_HINTING</a> ( 1L &lt;&lt; 1 )
-#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_render">FT_LOAD_RENDER</a> ( 1L &lt;&lt; 2 )
-#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_no_bitmap">FT_LOAD_NO_BITMAP</a> ( 1L &lt;&lt; 3 )
-#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_vertical_layout">FT_LOAD_VERTICAL_LAYOUT</a> ( 1L &lt;&lt; 4 )
-#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_force_autohint">FT_LOAD_FORCE_AUTOHINT</a> ( 1L &lt;&lt; 5 )
-#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_crop_bitmap">FT_LOAD_CROP_BITMAP</a> ( 1L &lt;&lt; 6 )
-#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_pedantic">FT_LOAD_PEDANTIC</a> ( 1L &lt;&lt; 7 )
-#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_ignore_global_advance_width">FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH</a> ( 1L &lt;&lt; 9 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_no_scale">FT_LOAD_NO_SCALE</a> ( 1L &lt;&lt; 0 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_no_hinting">FT_LOAD_NO_HINTING</a> ( 1L &lt;&lt; 1 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_render">FT_LOAD_RENDER</a> ( 1L &lt;&lt; 2 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_no_bitmap">FT_LOAD_NO_BITMAP</a> ( 1L &lt;&lt; 3 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_vertical_layout">FT_LOAD_VERTICAL_LAYOUT</a> ( 1L &lt;&lt; 4 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_force_autohint">FT_LOAD_FORCE_AUTOHINT</a> ( 1L &lt;&lt; 5 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_crop_bitmap">FT_LOAD_CROP_BITMAP</a> ( 1L &lt;&lt; 6 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_pedantic">FT_LOAD_PEDANTIC</a> ( 1L &lt;&lt; 7 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_ignore_global_advance_width">FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH</a> ( 1L &lt;&lt; 9 )
#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_no_recurse">FT_LOAD_NO_RECURSE</a> ( 1L &lt;&lt; 10 )
#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_ignore_transform">FT_LOAD_IGNORE_TRANSFORM</a> ( 1L &lt;&lt; 11 )
#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_monochrome">FT_LOAD_MONOCHROME</a> ( 1L &lt;&lt; 12 )
#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_linear_design">FT_LOAD_LINEAR_DESIGN</a> ( 1L &lt;&lt; 13 )
+#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_sbits_only">FT_LOAD_SBITS_ONLY</a> ( 1L &lt;&lt; 14 )
#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_no_autohint">FT_LOAD_NO_AUTOHINT</a> ( 1L &lt;&lt; 15 )
/* Bits 16-19 are used by `FT_LOAD_TARGET_` */
#<span class="keyword">define</span> <a href="ft2-base_interface.html#ft_load_color">FT_LOAD_COLOR</a> ( 1L &lt;&lt; 20 )
@@ -4892,7 +5083,7 @@ for pixel in buffer
<p>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.</p>
</td></tr>
<tr><td class="val" id="ft_load_no_scale">FT_LOAD_NO_SCALE</td><td class="desc">
-<p>Don't scale the loaded outline glyph but keep it in font units.</p>
+<p>Don't scale the loaded outline glyph but keep it in font units. This flag is also assumed if <code><a href="ft2-base_interface.html#ft_size">FT_Size</a></code> owned by the face was not properly initialized.</p>
<p>This flag implies <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_HINTING</a></code> and <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_BITMAP</a></code>, and unsets <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_RENDER</a></code>.</p>
<p>If the font is &lsquo;tricky&rsquo; (see <code><a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_TRICKY</a></code> for more), using <code>FT_LOAD_NO_SCALE</code> usually yields meaningless outlines because the subglyphs must be scaled and positioned with hinting instructions. This can be solved by loading the font without <code>FT_LOAD_NO_SCALE</code> and setting the character size to <code>font-&gt;units_per_EM</code>.</p>
</td></tr>
@@ -4908,6 +5099,10 @@ for pixel in buffer
<p>Ignore bitmap strikes when loading. Bitmap-only fonts ignore this flag.</p>
<p><code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_SCALE</a></code> always sets this flag.</p>
</td></tr>
+<tr><td class="val" id="ft_load_sbits_only">FT_LOAD_SBITS_ONLY</td><td class="desc">
+<p>[Since 2.12] This is the opposite of <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_BITMAP</a></code>, more or less: <code><a href="ft2-base_interface.html#ft_load_glyph">FT_Load_Glyph</a></code> returns <code>FT_Err_Invalid_Argument</code> if the face contains a bitmap strike for the given size (or the strike selected by <code><a href="ft2-base_interface.html#ft_select_size">FT_Select_Size</a></code>) but there is no glyph in the strike.</p>
+<p>Note that this load flag was part of FreeType since version 2.0.6 but previously tagged as internal.</p>
+</td></tr>
<tr><td class="val" id="ft_load_vertical_layout">FT_LOAD_VERTICAL_LAYOUT</td><td class="desc">
<p>Load the glyph for vertical text layout. In particular, the <code>advance</code> value in the <code><a href="ft2-base_interface.html#ft_glyphslotrec">FT_GlyphSlotRec</a></code> structure is set to the <code>vertAdvance</code> value of the <code>metrics</code> field.</p>
<p>In case <code><a href="ft2-base_interface.html#ft_has_vertical">FT_HAS_VERTICAL</a></code> doesn't return true, you shouldn't use this flag currently. Reason is that in this case vertical metrics get synthesized, and those values are not always consistent across various font formats.</p>
@@ -4938,9 +5133,10 @@ for pixel in buffer
<p>Disable the auto-hinter. See also the note below.</p>
</td></tr>
<tr><td class="val" id="ft_load_color">FT_LOAD_COLOR</td><td class="desc">
-<p>Load colored glyphs. There are slight differences depending on the font format.</p>
-<p>[Since 2.5] Load embedded color bitmap images. The resulting color bitmaps, if available, will have the <code><a href="ft2-basic_types.html#ft_pixel_mode">FT_PIXEL_MODE_BGRA</a></code> format, with pre-multiplied color channels. If the flag is not set and color bitmaps are found, they are converted to 256-level gray bitmaps, using the <code><a href="ft2-basic_types.html#ft_pixel_mode">FT_PIXEL_MODE_GRAY</a></code> format.</p>
-<p>[Since 2.10, experimental] If the glyph index contains an entry in the face's &lsquo;COLR&rsquo; table with a &lsquo;CPAL&rsquo; palette table (as defined in the OpenType specification), make <code><a href="ft2-base_interface.html#ft_render_glyph">FT_Render_Glyph</a></code> provide a default blending of the color glyph layers associated with the glyph index, using the same bitmap format as embedded color bitmap images. This is mainly for convenience; for full control of color layers use <code><a href="ft2-layer_management.html#ft_get_color_glyph_layer">FT_Get_Color_Glyph_Layer</a></code> and FreeType's color functions like <code><a href="ft2-color_management.html#ft_palette_select">FT_Palette_Select</a></code> instead of setting <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_COLOR</a></code> for rendering so that the client application can handle blending by itself.</p>
+<p>Load colored glyphs. FreeType searches in the following order; there are slight differences depending on the font format.</p>
+<p>[Since 2.5] Load embedded color bitmap images (provided <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_BITMAP</a></code> is not set). The resulting color bitmaps, if available, have the <code><a href="ft2-basic_types.html#ft_pixel_mode">FT_PIXEL_MODE_BGRA</a></code> format, with pre-multiplied color channels. If the flag is not set and color bitmaps are found, they are converted to 256-level gray bitmaps, using the <code><a href="ft2-basic_types.html#ft_pixel_mode">FT_PIXEL_MODE_GRAY</a></code> format.</p>
+<p>[Since 2.12] If the glyph index maps to an entry in the face's &lsquo;SVG&nbsp;&rsquo; table, load the associated SVG document from this table and set the <code>format</code> field of <code><a href="ft2-base_interface.html#ft_glyphslotrec">FT_GlyphSlotRec</a></code> to <code><a href="ft2-basic_types.html#ft_glyph_format">FT_GLYPH_FORMAT_SVG</a></code>. Note that FreeType itself can't render SVG documents; however, the library provides hooks to seamlessly integrate an external renderer. See sections &lsquo;<a href="ft2-ot_svg_driver.html#ot_svg_driver">The SVG driver</a>&rsquo; and &lsquo;<a href="ft2-svg_fonts.html#svg_fonts">OpenType SVG Fonts</a>&rsquo; for more.</p>
+<p>[Since 2.10, experimental] If the glyph index maps to an entry in the face's &lsquo;COLR&rsquo; table with a &lsquo;CPAL&rsquo; palette table (as defined in the OpenType specification), make <code><a href="ft2-base_interface.html#ft_render_glyph">FT_Render_Glyph</a></code> provide a default blending of the color glyph layers associated with the glyph index, using the same bitmap format as embedded color bitmap images. This is mainly for convenience and works only for glyphs in &lsquo;COLR&rsquo; v0 tables (or glyphs in &lsquo;COLR&rsquo; v1 tables that exclusively use v0 features). For full control of color layers use <code><a href="ft2-layer_management.html#ft_get_color_glyph_layer">FT_Get_Color_Glyph_Layer</a></code> and FreeType's color functions like <code><a href="ft2-color_management.html#ft_palette_select">FT_Palette_Select</a></code> instead of setting <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_COLOR</a></code> for rendering so that the client application can handle blending by itself.</p>
</td></tr>
<tr><td class="val" id="ft_load_compute_metrics">FT_LOAD_COMPUTE_METRICS</td><td class="desc">
<p>[Since 2.6.1] Compute glyph metrics from the glyph data, without the use of bundled metrics tables (for example, the &lsquo;hdmx&rsquo; table in TrueType fonts). This flag is mainly used by font validating or font editing applications, which need to ignore, verify, or edit those tables.</p>
@@ -5157,7 +5353,7 @@ for pixel in buffer
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-basic_types.html b/freetype/docs/reference/ft2-basic_types.html
index a6eab97d..c0d625cf 100644
--- a/freetype/docs/reference/ft2-basic_types.html
+++ b/freetype/docs/reference/ft2-basic_types.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Basic Data Types - FreeType-2.11.1 API Reference</title>
+ <title>Basic Data Types - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -864,6 +864,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -978,6 +990,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -2220,7 +2244,8 @@
<a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_composite">FT_GLYPH_FORMAT_COMPOSITE</a>, 'c', 'o', 'm', 'p' ),
<a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_bitmap">FT_GLYPH_FORMAT_BITMAP</a>, 'b', 'i', 't', 's' ),
<a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_outline">FT_GLYPH_FORMAT_OUTLINE</a>, 'o', 'u', 't', 'l' ),
- <a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_plotter">FT_GLYPH_FORMAT_PLOTTER</a>, 'p', 'l', 'o', 't' )
+ <a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_plotter">FT_GLYPH_FORMAT_PLOTTER</a>, 'p', 'l', 'o', 't' ),
+ <a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_svg">FT_GLYPH_FORMAT_SVG</a>, 'S', 'V', 'G', ' ' )
} <b>FT_Glyph_Format</b>;
@@ -2252,6 +2277,9 @@
<tr><td class="val" id="ft_glyph_format_plotter">FT_GLYPH_FORMAT_PLOTTER</td><td class="desc">
<p>The glyph image is a vectorial path with no inside and outside contours. Some Type&nbsp;1 fonts, like those in the Hershey family, contain glyphs in this format. These are described as <code><a href="ft2-outline_processing.html#ft_outline">FT_Outline</a></code>, but FreeType isn't currently capable of rendering them correctly.</p>
</td></tr>
+<tr><td class="val" id="ft_glyph_format_svg">FT_GLYPH_FORMAT_SVG</td><td class="desc">
+<p>[Since 2.12] The glyph is represented by an SVG document in the &lsquo;SVG&nbsp;&rsquo; table.</p>
+</td></tr>
</table>
<hr>
@@ -2333,7 +2361,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-bdf_fonts.html b/freetype/docs/reference/ft2-bdf_fonts.html
index a55d06be..f6212550 100644
--- a/freetype/docs/reference/ft2-bdf_fonts.html
+++ b/freetype/docs/reference/ft2-bdf_fonts.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>BDF and PCF Files - FreeType-2.11.1 API Reference</title>
+ <title>BDF and PCF Files - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -619,6 +619,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -733,6 +745,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1414,7 +1438,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-bitmap_handling.html b/freetype/docs/reference/ft2-bitmap_handling.html
index 189ef5e6..f09e7e4b 100644
--- a/freetype/docs/reference/ft2-bitmap_handling.html
+++ b/freetype/docs/reference/ft2-bitmap_handling.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Bitmap Handling - FreeType-2.11.1 API Reference</title>
+ <title>Bitmap Handling - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1539,7 +1563,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-bzip2.html b/freetype/docs/reference/ft2-bzip2.html
index 8d0eb93b..d74938b5 100644
--- a/freetype/docs/reference/ft2-bzip2.html
+++ b/freetype/docs/reference/ft2-bzip2.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>BZIP2 Streams - FreeType-2.11.1 API Reference</title>
+ <title>BZIP2 Streams - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1244,7 +1268,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-cache_subsystem.html b/freetype/docs/reference/ft2-cache_subsystem.html
index 27113424..56bbbb6a 100644
--- a/freetype/docs/reference/ft2-cache_subsystem.html
+++ b/freetype/docs/reference/ft2-cache_subsystem.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Cache Sub-System - FreeType-2.11.1 API Reference</title>
+ <title>Cache Sub-System - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -2359,7 +2383,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-cff_driver.html b/freetype/docs/reference/ft2-cff_driver.html
index 2988d170..b9564209 100644
--- a/freetype/docs/reference/ft2-cff_driver.html
+++ b/freetype/docs/reference/ft2-cff_driver.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>The CFF driver - FreeType-2.11.1 API Reference</title>
+ <title>The CFF driver - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -698,6 +710,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1211,7 +1235,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-cid_fonts.html b/freetype/docs/reference/ft2-cid_fonts.html
index d44150c4..8fbc9441 100644
--- a/freetype/docs/reference/ft2-cid_fonts.html
+++ b/freetype/docs/reference/ft2-cid_fonts.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>CID Fonts - FreeType-2.11.1 API Reference</title>
+ <title>CID Fonts - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -605,6 +605,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -719,6 +731,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1353,7 +1377,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-color_management.html b/freetype/docs/reference/ft2-color_management.html
index fff03ef2..b6d578d3 100644
--- a/freetype/docs/reference/ft2-color_management.html
+++ b/freetype/docs/reference/ft2-color_management.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Glyph Color Management - FreeType-2.11.1 API Reference</title>
+ <title>Glyph Color Management - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -626,6 +626,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -740,6 +752,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1494,7 +1518,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-computations.html b/freetype/docs/reference/ft2-computations.html
index 829bf284..f5f917e2 100644
--- a/freetype/docs/reference/ft2-computations.html
+++ b/freetype/docs/reference/ft2-computations.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Computations - FreeType-2.11.1 API Reference</title>
+ <title>Computations - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -2025,7 +2049,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-debugging_apis.html b/freetype/docs/reference/ft2-debugging_apis.html
index 7567faa4..bfa7f93d 100644
--- a/freetype/docs/reference/ft2-debugging_apis.html
+++ b/freetype/docs/reference/ft2-debugging_apis.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>External Debugging APIs - FreeType-2.11.1 API Reference</title>
+ <title>External Debugging APIs - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1371,7 +1395,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-error_code_values.html b/freetype/docs/reference/ft2-error_code_values.html
index 8650712a..c76d29b9 100644
--- a/freetype/docs/reference/ft2-error_code_values.html
+++ b/freetype/docs/reference/ft2-error_code_values.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Error Code Values - FreeType-2.11.1 API Reference</title>
+ <title>Error Code Values - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1210,6 +1234,8 @@
"too many hints" )
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
"invalid pixel size" )
+ FT_ERRORDEF_( Invalid_SVG_Document, 0x18,
+ "invalid SVG document" )
/* handle errors */
@@ -1343,6 +1369,8 @@
"found FDEF or IDEF opcode in glyf bytecode" )
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
"missing bitmap in strike" )
+ FT_ERRORDEF_( Missing_SVG_Hooks, 0x9E,
+ "SVG hooks have not been set" )
/* CFF, CID, and Type 1 errors */
@@ -1439,7 +1467,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-error_enumerations.html b/freetype/docs/reference/ft2-error_enumerations.html
index 216f8213..3d6424db 100644
--- a/freetype/docs/reference/ft2-error_enumerations.html
+++ b/freetype/docs/reference/ft2-error_enumerations.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Error Enumerations - FreeType-2.11.1 API Reference</title>
+ <title>Error Enumerations - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1276,7 +1300,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-font_formats.html b/freetype/docs/reference/ft2-font_formats.html
index 76a75c36..aab9499d 100644
--- a/freetype/docs/reference/ft2-font_formats.html
+++ b/freetype/docs/reference/ft2-font_formats.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Font Formats - FreeType-2.11.1 API Reference</title>
+ <title>Font Formats - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
+
+ <li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
@@ -705,6 +717,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1205,7 +1229,7 @@
<nav class="md-footer__inner md-grid" aria-label="Footer">
- <a href="ft2-winfnt_fonts.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: Window FNT Files" rel="prev">
+ <a href="ft2-svg_fonts.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: OpenType SVG Fonts" rel="prev">
<div class="md-footer__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
@@ -1214,7 +1238,7 @@
<span class="md-footer__direction">
Previous
</span>
- Window FNT Files
+ OpenType SVG Fonts
</div>
</div>
</a>
@@ -1242,7 +1266,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-gasp_table.html b/freetype/docs/reference/ft2-gasp_table.html
index c8a29fea..bf0cc8e6 100644
--- a/freetype/docs/reference/ft2-gasp_table.html
+++ b/freetype/docs/reference/ft2-gasp_table.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Gasp Table - FreeType-2.11.1 API Reference</title>
+ <title>Gasp Table - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -544,6 +544,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -712,6 +724,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1295,7 +1319,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-glyph_management.html b/freetype/docs/reference/ft2-glyph_management.html
index ef68dd78..1fc7d813 100644
--- a/freetype/docs/reference/ft2-glyph_management.html
+++ b/freetype/docs/reference/ft2-glyph_management.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Glyph Management - FreeType-2.11.1 API Reference</title>
+ <title>Glyph Management - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -452,6 +452,20 @@
</li>
<li class="md-nav__item">
+ <a href="#ft_svgglyph" class="md-nav__link">
+ FT_SvgGlyph
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_svgglyphrec" class="md-nav__link">
+ FT_SvgGlyphRec
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#ft_new_glyph" class="md-nav__link">
FT_New_Glyph
</a>
@@ -682,6 +696,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -796,6 +822,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1268,6 +1306,20 @@
</li>
<li class="md-nav__item">
+ <a href="#ft_svgglyph" class="md-nav__link">
+ FT_SvgGlyph
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_svgglyphrec" class="md-nav__link">
+ FT_SvgGlyphRec
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#ft_new_glyph" class="md-nav__link">
FT_New_Glyph
</a>
@@ -1388,7 +1440,7 @@
<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_BitmapGlyphRec_* <b>FT_BitmapGlyph</b>;
</code></pre></div>
-<p>A handle to an object used to model a bitmap glyph image. This is a sub-class of <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>, and a pointer to <code><a href="ft2-glyph_management.html#ft_bitmapglyphrec">FT_BitmapGlyphRec</a></code>.</p>
+<p>A handle to an object used to model a bitmap glyph image. This is a &lsquo;sub-class&rsquo; of <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>, and a pointer to <code><a href="ft2-glyph_management.html#ft_bitmapglyphrec">FT_BitmapGlyphRec</a></code>.</p>
<hr>
<h2 id="ft_bitmapglyphrec">FT_BitmapGlyphRec<a class="headerlink" href="#ft_bitmapglyphrec" title="Permanent link">&para;</a></h2>
@@ -1407,7 +1459,7 @@
<h4>fields</h4>
<table class="fields">
<tr><td class="val" id="root">root</td><td class="desc">
-<p>The root <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> fields.</p>
+<p>The root fields of <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>.</p>
</td></tr>
<tr><td class="val" id="left">left</td><td class="desc">
<p>The left-side bearing, i.e., the horizontal distance from the current pen position to the left border of the glyph bitmap.</p>
@@ -1431,7 +1483,7 @@
<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_OutlineGlyphRec_* <b>FT_OutlineGlyph</b>;
</code></pre></div>
-<p>A handle to an object used to model an outline glyph image. This is a sub-class of <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>, and a pointer to <code><a href="ft2-glyph_management.html#ft_outlineglyphrec">FT_OutlineGlyphRec</a></code>.</p>
+<p>A handle to an object used to model an outline glyph image. This is a &lsquo;sub-class&rsquo; of <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>, and a pointer to <code><a href="ft2-glyph_management.html#ft_outlineglyphrec">FT_OutlineGlyphRec</a></code>.</p>
<hr>
<h2 id="ft_outlineglyphrec">FT_OutlineGlyphRec<a class="headerlink" href="#ft_outlineglyphrec" title="Permanent link">&para;</a></h2>
@@ -1462,6 +1514,80 @@
<p>The outline's tables are always owned by the object and are destroyed with it.</p>
<hr>
+<h2 id="ft_svgglyph">FT_SvgGlyph<a class="headerlink" href="#ft_svgglyph" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
+<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_SvgGlyphRec_* <b>FT_SvgGlyph</b>;
+</code></pre></div>
+
+<p>A handle to an object used to model an SVG glyph. This is a &lsquo;sub-class&rsquo; of <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>, and a pointer to <code><a href="ft2-glyph_management.html#ft_svgglyphrec">FT_SvgGlyphRec</a></code>.</p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+<h2 id="ft_svgglyphrec">FT_SvgGlyphRec<a class="headerlink" href="#ft_svgglyphrec" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
+<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_SvgGlyphRec_
+ {
+ <a href="ft2-glyph_management.html#ft_glyphrec">FT_GlyphRec</a> root;
+
+ <a href="ft2-basic_types.html#ft_byte">FT_Byte</a>* svg_document;
+ <a href="ft2-basic_types.html#ft_ulong">FT_ULong</a> svg_document_length;
+
+ <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> glyph_index;
+
+ <a href="ft2-base_interface.html#ft_size_metrics">FT_Size_Metrics</a> metrics;
+ <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> units_per_EM;
+
+ <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> start_glyph_id;
+ <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> end_glyph_id;
+
+ <a href="ft2-basic_types.html#ft_matrix">FT_Matrix</a> transform;
+ <a href="ft2-basic_types.html#ft_vector">FT_Vector</a> delta;
+
+ } <b>FT_SvgGlyphRec</b>;
+</code></pre></div>
+
+<p>A structure used for OT-SVG glyphs. This is a &lsquo;sub-class&rsquo; of <code><a href="ft2-glyph_management.html#ft_glyphrec">FT_GlyphRec</a></code>.</p>
+<h4>fields</h4>
+<table class="fields">
+<tr><td class="val" id="root">root</td><td class="desc">
+<p>The root <code><a href="ft2-glyph_management.html#ft_glyphrec">FT_GlyphRec</a></code> fields.</p>
+</td></tr>
+<tr><td class="val" id="svg_document">svg_document</td><td class="desc">
+<p>A pointer to the SVG document.</p>
+</td></tr>
+<tr><td class="val" id="svg_document_length">svg_document_length</td><td class="desc">
+<p>The length of <code>svg_document</code>.</p>
+</td></tr>
+<tr><td class="val" id="glyph_index">glyph_index</td><td class="desc">
+<p>The index of the glyph to be rendered.</p>
+</td></tr>
+<tr><td class="val" id="metrics">metrics</td><td class="desc">
+<p>A metrics object storing the size information.</p>
+</td></tr>
+<tr><td class="val" id="units_per_em">units_per_EM</td><td class="desc">
+<p>The size of the EM square.</p>
+</td></tr>
+<tr><td class="val" id="start_glyph_id">start_glyph_id</td><td class="desc">
+<p>The first glyph ID in the glyph range covered by this document.</p>
+</td></tr>
+<tr><td class="val" id="end_glyph_id">end_glyph_id</td><td class="desc">
+<p>The last glyph ID in the glyph range covered by this document.</p>
+</td></tr>
+<tr><td class="val" id="transform">transform</td><td class="desc">
+<p>A 2x2 transformation matrix to apply to the glyph while rendering it.</p>
+</td></tr>
+<tr><td class="val" id="delta">delta</td><td class="desc">
+<p>Translation to apply to the glyph while rendering.</p>
+</td></tr>
+</table>
+
+<h4>note</h4>
+
+<p>The Glyph Management API requires <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> or its &lsquo;sub-class&rsquo; to have all the information needed to completely define the glyph's rendering. Outline-based glyphs can directly apply transformations to the outline but this is not possible for an SVG document that hasn't been parsed. Therefore, the transformation is stored along with the document. In the absence of a &lsquo;ViewBox&rsquo; or &lsquo;Width&rsquo;/'Height' attribute, the size of the ViewPort should be assumed to be &lsquo;units_per_EM&rsquo;.</p>
+<hr>
+
<h2 id="ft_new_glyph">FT_New_Glyph<a class="headerlink" href="#ft_new_glyph" title="Permanent link">&para;</a></h2>
<p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
<div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
@@ -1714,7 +1840,7 @@
<p>This function does nothing if the glyph format isn't scalable.</p>
<p>The glyph image is translated with the <code>origin</code> vector before rendering.</p>
-<p>The first parameter is a pointer to an <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> handle, that will be <em>replaced</em> by this function (with newly allocated data). Typically, you would use (omitting error handling):
+<p>The first parameter is a pointer to an <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> handle that will be <em>replaced</em> by this function (with newly allocated data). Typically, you would do something like the following (omitting error handling).
<div class="highlight"><pre><span></span><code> FT_Glyph glyph;
FT_BitmapGlyph glyph_bitmap;
@@ -1729,7 +1855,7 @@
if ( glyph-&gt;format != FT_GLYPH_FORMAT_BITMAP )
{
error = FT_Glyph_To_Bitmap( &amp;glyph, FT_RENDER_MODE_NORMAL,
- 0, 1 );
+ 0, 1 );
if ( error ) // `glyph&#39; unchanged
...
}
@@ -1743,7 +1869,7 @@
// discard glyph image (bitmap or not)
FT_Done_Glyph( glyph );
</code></pre></div></p>
-<p>Here is another example, again without error handling:
+<p>Here is another example, again without error handling.
<div class="highlight"><pre><span></span><code> FT_Glyph glyphs[MAX_GLYPHS]
@@ -1849,7 +1975,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-glyph_stroker.html b/freetype/docs/reference/ft2-glyph_stroker.html
index 1481b2dc..0cf3e61b 100644
--- a/freetype/docs/reference/ft2-glyph_stroker.html
+++ b/freetype/docs/reference/ft2-glyph_stroker.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Glyph Stroker - FreeType-2.11.1 API Reference</title>
+ <title>Glyph Stroker - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -2111,7 +2135,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-glyph_variants.html b/freetype/docs/reference/ft2-glyph_variants.html
index 887d7de1..9e58746b 100644
--- a/freetype/docs/reference/ft2-glyph_variants.html
+++ b/freetype/docs/reference/ft2-glyph_variants.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Unicode Variation Sequences - FreeType-2.11.1 API Reference</title>
+ <title>Unicode Variation Sequences - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -619,6 +619,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -733,6 +745,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1427,7 +1451,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-gx_validation.html b/freetype/docs/reference/ft2-gx_validation.html
index f3d6530a..1fce97d4 100644
--- a/freetype/docs/reference/ft2-gx_validation.html
+++ b/freetype/docs/reference/ft2-gx_validation.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>TrueTypeGX/AAT Validation - FreeType-2.11.1 API Reference</title>
+ <title>TrueTypeGX/AAT Validation - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1515,7 +1539,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-gzip.html b/freetype/docs/reference/ft2-gzip.html
index 85d17bbe..f896cfe3 100644
--- a/freetype/docs/reference/ft2-gzip.html
+++ b/freetype/docs/reference/ft2-gzip.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>GZIP Streams - FreeType-2.11.1 API Reference</title>
+ <title>GZIP Streams - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1307,7 +1331,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-header_file_macros.html b/freetype/docs/reference/ft2-header_file_macros.html
index 75941abc..a2fa9692 100644
--- a/freetype/docs/reference/ft2-header_file_macros.html
+++ b/freetype/docs/reference/ft2-header_file_macros.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Header File Macros - FreeType-2.11.1 API Reference</title>
+ <title>Header File Macros - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -788,6 +788,13 @@
</li>
+ <li class="md-nav__item">
+ <a href="#ft_otsvg_h" class="md-nav__link">
+ FT_OTSVG_H
+ </a>
+
+</li>
+
</ul>
</nav>
@@ -927,6 +934,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -1041,6 +1060,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1813,6 +1844,13 @@
</li>
+ <li class="md-nav__item">
+ <a href="#ft_otsvg_h" class="md-nav__link">
+ FT_OTSVG_H
+ </a>
+
+</li>
+
</ul>
</nav>
@@ -2204,6 +2242,13 @@
<p>A macro used in <code>#include</code> statements to name the file containing the FreeType&nbsp;2 API which handles the OpenType &lsquo;CPAL&rsquo; table.</p>
<hr>
+
+<h2 id="ft_otsvg_h">FT_OTSVG_H<a class="headerlink" href="#ft_otsvg_h" title="Permanent link">&para;</a></h2>
+<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <b>FT_OTSVG_H</b> &lt;freetype/otsvg.h&gt;
+</code></pre></div>
+
+<p>A macro used in <code>#include</code> statements to name the file containing the FreeType&nbsp;2 API which handles the OpenType &lsquo;SVG&nbsp;&rsquo; glyphs.</p>
+<hr>
@@ -2260,7 +2305,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-header_inclusion.html b/freetype/docs/reference/ft2-header_inclusion.html
index dc91b1f3..95c8d1bb 100644
--- a/freetype/docs/reference/ft2-header_inclusion.html
+++ b/freetype/docs/reference/ft2-header_inclusion.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>FreeType's header inclusion scheme - FreeType-2.11.1 API Reference</title>
+ <title>FreeType's header inclusion scheme - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -584,6 +584,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -698,6 +710,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1206,7 +1230,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-incremental.html b/freetype/docs/reference/ft2-incremental.html
index 67b4751a..da2d3407 100644
--- a/freetype/docs/reference/ft2-incremental.html
+++ b/freetype/docs/reference/ft2-incremental.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Incremental Loading - FreeType-2.11.1 API Reference</title>
+ <title>Incremental Loading - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1545,7 +1569,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-index.html b/freetype/docs/reference/ft2-index.html
index 6994cd18..6ab9f352 100644
--- a/freetype/docs/reference/ft2-index.html
+++ b/freetype/docs/reference/ft2-index.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Index - FreeType-2.11.1 API Reference</title>
+ <title>Index - FreeType-2.12.1 API Reference</title>
@@ -71,7 +71,7 @@
<div data-md-component="skip">
- <a href="#freetype-2111-api-reference" class="md-skip">
+ <a href="#freetype-2121-api-reference" class="md-skip">
Skip to content
</a>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -297,6 +297,13 @@
</li>
<li class="md-nav__item">
+ <a href="#s" class="md-nav__link">
+ S
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#t" class="md-nav__link">
T
</a>
@@ -659,6 +666,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -773,6 +792,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1266,6 +1297,13 @@
</li>
<li class="md-nav__item">
+ <a href="#s" class="md-nav__link">
+ S
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#t" class="md-nav__link">
T
</a>
@@ -1294,7 +1332,7 @@
<p><a href="https://www.freetype.org">FreeType</a> &raquo; <a href="../">Docs</a> &raquo; Global Index</p>
<hr />
-<h1 id="freetype-2111-api-reference">FreeType-2.11.1 API Reference<a class="headerlink" href="#freetype-2111-api-reference" title="Permanent link">&para;</a></h1>
+<h1 id="freetype-2121-api-reference">FreeType-2.12.1 API Reference<a class="headerlink" href="#freetype-2121-api-reference" title="Permanent link">&para;</a></h1>
<h3 id="b">B<a class="headerlink" href="#b" title="Permanent link">&para;</a></h3>
<p><a href="ft2-bdf_fonts.html#bdf_property">BDF_Property</a><br />
<a href="ft2-bdf_fonts.html#bdf_propertytype">BDF_PROPERTY_TYPE_ATOM</a><br />
@@ -1440,8 +1478,11 @@
<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_HORIZONTAL</a><br />
<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_KERNING</a><br />
<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_MULTIPLE_MASTERS</a><br />
+<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_SBIX</a><br />
+<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_SBIX_OVERLAY</a><br />
<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_SCALABLE</a><br />
<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_SFNT</a><br />
+<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_SVG</a><br />
<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_TRICKY</a><br />
<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_VARIATION</a><br />
<a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_VERTICAL</a><br />
@@ -1545,6 +1586,7 @@
<a href="ft2-basic_types.html#ft_glyph_format">FT_GLYPH_FORMAT_NONE</a><br />
<a href="ft2-basic_types.html#ft_glyph_format">FT_GLYPH_FORMAT_OUTLINE</a><br />
<a href="ft2-basic_types.html#ft_glyph_format">FT_GLYPH_FORMAT_PLOTTER</a><br />
+<a href="ft2-basic_types.html#ft_glyph_format">FT_GLYPH_FORMAT_SVG</a><br />
<a href="ft2-glyph_management.html#ft_glyph_get_cbox">FT_Glyph_Get_CBox</a><br />
<a href="ft2-header_file_macros.html#ft_glyph_h">FT_GLYPH_H</a><br />
<a href="ft2-base_interface.html#ft_glyph_metrics">FT_Glyph_Metrics</a><br />
@@ -1567,6 +1609,9 @@
<a href="ft2-base_interface.html#ft_has_kerning">FT_HAS_KERNING</a><br />
<a href="ft2-base_interface.html#ft_has_multiple_masters">FT_HAS_MULTIPLE_MASTERS</a><br />
<a href="ft2-type1_tables.html#ft_has_ps_glyph_names">FT_Has_PS_Glyph_Names</a><br />
+<a href="ft2-base_interface.html#ft_has_sbix">FT_HAS_SBIX</a><br />
+<a href="ft2-base_interface.html#ft_has_sbix_overlay">FT_HAS_SBIX_OVERLAY</a><br />
+<a href="ft2-base_interface.html#ft_has_svg">FT_HAS_SVG</a><br />
<a href="ft2-base_interface.html#ft_has_vertical">FT_HAS_VERTICAL</a><br />
<a href="ft2-properties.html#ft_hinting_xxx">FT_HINTING_ADOBE</a><br />
<a href="ft2-properties.html#ft_hinting_xxx">FT_HINTING_FREETYPE</a><br />
@@ -1646,6 +1691,7 @@
<a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_SCALE</a><br />
<a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_PEDANTIC</a><br />
<a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_RENDER</a><br />
+<a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_SBITS_ONLY</a><br />
<a href="ft2-truetype_tables.html#ft_load_sfnt_table">FT_Load_Sfnt_Table</a><br />
<a href="ft2-base_interface.html#ft_load_target_xxx">FT_LOAD_TARGET_LCD</a><br />
<a href="ft2-base_interface.html#ft_load_target_xxx">FT_LOAD_TARGET_LCD_V</a><br />
@@ -1705,6 +1751,7 @@
<a href="ft2-outline_processing.html#ft_orientation">FT_ORIENTATION_NONE</a><br />
<a href="ft2-outline_processing.html#ft_orientation">FT_ORIENTATION_POSTSCRIPT</a><br />
<a href="ft2-outline_processing.html#ft_orientation">FT_ORIENTATION_TRUETYPE</a><br />
+<a href="ft2-header_file_macros.html#ft_otsvg_h">FT_OTSVG_H</a><br />
<a href="ft2-outline_processing.html#ft_outline">FT_Outline</a><br />
<a href="ft2-outline_processing.html#ft_outline_check">FT_Outline_Check</a><br />
<a href="ft2-outline_processing.html#ft_outline_conictofunc">FT_Outline_ConicToFunc</a><br />
@@ -1764,6 +1811,7 @@
<a href="ft2-color_management.html#ft_palette_select">FT_Palette_Select</a><br />
<a href="ft2-color_management.html#ft_palette_set_foreground_color">FT_Palette_Set_Foreground_Color</a><br />
<a href="ft2-color_management.html#ft_palette_xxx">FT_PALETTE_XXX</a><br />
+<a href="ft2-parameter_tags.html#ft_param_tag_ignore_sbix">FT_PARAM_TAG_IGNORE_SBIX</a><br />
<a href="ft2-parameter_tags.html#ft_param_tag_ignore_typographic_family">FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY</a><br />
<a href="ft2-parameter_tags.html#ft_param_tag_ignore_typographic_subfamily">FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY</a><br />
<a href="ft2-parameter_tags.html#ft_param_tag_incremental">FT_PARAM_TAG_INCREMENTAL</a><br />
@@ -1920,6 +1968,10 @@
<a href="ft2-base_interface.html#ft_subglyph_flag_xxx">FT_SUBGLYPH_FLAG_USE_MY_METRICS</a><br />
<a href="ft2-base_interface.html#ft_subglyph_flag_xxx">FT_SUBGLYPH_FLAG_XXX</a><br />
<a href="ft2-base_interface.html#ft_subglyph_flag_xxx">FT_SUBGLYPH_FLAG_XY_SCALE</a><br />
+<a href="ft2-svg_fonts.html#ft_svg_document">FT_SVG_Document</a><br />
+<a href="ft2-svg_fonts.html#ft_svg_documentrec">FT_SVG_DocumentRec</a><br />
+<a href="ft2-glyph_management.html#ft_svgglyph">FT_SvgGlyph</a><br />
+<a href="ft2-glyph_management.html#ft_svgglyphrec">FT_SvgGlyphRec</a><br />
<a href="ft2-header_file_macros.html#ft_synthesis_h">FT_SYNTHESIS_H</a><br />
<a href="ft2-header_file_macros.html#ft_system_h">FT_SYSTEM_H</a><br />
<a href="ft2-basic_types.html#ft_tag">FT_Tag</a><br />
@@ -2098,6 +2150,13 @@
<a href="ft2-type1_tables.html#ps_privaterec">PS_PrivateRec</a> </p>
<h3 id="r">R<a class="headerlink" href="#r" title="Permanent link">&para;</a></h3>
<p><a href="ft2-properties.html#random-seed">random-seed</a> </p>
+<h3 id="s">S<a class="headerlink" href="#s" title="Permanent link">&para;</a></h3>
+<p><a href="ft2-properties.html#svg-hooks">svg-hooks</a><br />
+<a href="ft2-svg_fonts.html#svg_lib_free_func">SVG_Lib_Free_Func</a><br />
+<a href="ft2-svg_fonts.html#svg_lib_init_func">SVG_Lib_Init_Func</a><br />
+<a href="ft2-svg_fonts.html#svg_lib_preset_slot_func">SVG_Lib_Preset_Slot_Func</a><br />
+<a href="ft2-svg_fonts.html#svg_lib_render_func">SVG_Lib_Render_Func</a><br />
+<a href="ft2-svg_fonts.html#svg_rendererhooks">SVG_RendererHooks</a> </p>
<h3 id="t">T<a class="headerlink" href="#t" title="Permanent link">&para;</a></h3>
<p><a href="ft2-type1_tables.html#t1_blend_flags">T1_BLEND_BLUE_SCALE</a><br />
<a href="ft2-type1_tables.html#t1_blend_flags">T1_BLEND_BLUE_SHIFT</a><br />
@@ -2174,7 +2233,7 @@
<h3 id="w">W<a class="headerlink" href="#w" title="Permanent link">&para;</a></h3>
<p><a href="ft2-properties.html#warping">warping</a> </p>
<hr />
-<div class="timestamp">generated on Thu Dec 2 12:36:11 2021 UTC</div>
+<div class="timestamp">generated on Sun May 1 05:24:59 2022 UTC</div>
@@ -2231,7 +2290,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-layer_management.html b/freetype/docs/reference/ft2-layer_management.html
index 7fb91a8f..648ea113 100644
--- a/freetype/docs/reference/ft2-layer_management.html
+++ b/freetype/docs/reference/ft2-layer_management.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Glyph Layer Management - FreeType-2.11.1 API Reference</title>
+ <title>Glyph Layer Management - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -808,6 +808,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -922,6 +934,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1760,13 +1784,13 @@
<h4>fields</h4>
<table class="fields">
<tr><td class="val" id="num_color_stops">num_color_stops</td><td class="desc">
-<p>The number of color stops for the requested glyph index. Set by <code><a href="ft2-layer_management.html#ft_get_colorline_stops">FT_Get_Colorline_Stops</a></code>.</p>
+<p>The number of color stops for the requested glyph index. Set by <code><a href="ft2-layer_management.html#ft_get_paint">FT_Get_Paint</a></code>.</p>
</td></tr>
<tr><td class="val" id="current_color_stop">current_color_stop</td><td class="desc">
<p>The current color stop. Set by <code><a href="ft2-layer_management.html#ft_get_colorline_stops">FT_Get_Colorline_Stops</a></code>.</p>
</td></tr>
<tr><td class="val" id="p">p</td><td class="desc">
-<p>An opaque pointer into &lsquo;COLR&rsquo; table data. The caller must set this to <code>NULL</code> before the first call of <code><a href="ft2-layer_management.html#ft_get_colorline_stops">FT_Get_Colorline_Stops</a></code>.</p>
+<p>An opaque pointer into &lsquo;COLR&rsquo; table data. Set by <code><a href="ft2-layer_management.html#ft_get_paint">FT_Get_Paint</a></code>. Updated by <code><a href="ft2-layer_management.html#ft_get_colorline_stops">FT_Get_Colorline_Stops</a></code>.</p>
</td></tr>
</table>
@@ -2741,7 +2765,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-lcd_rendering.html b/freetype/docs/reference/ft2-lcd_rendering.html
index 399bdc05..6973672e 100644
--- a/freetype/docs/reference/ft2-lcd_rendering.html
+++ b/freetype/docs/reference/ft2-lcd_rendering.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Subpixel Rendering - FreeType-2.11.1 API Reference</title>
+ <title>Subpixel Rendering - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -658,6 +670,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1448,7 +1472,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-list_processing.html b/freetype/docs/reference/ft2-list_processing.html
index a6b2a95e..8c5065bc 100644
--- a/freetype/docs/reference/ft2-list_processing.html
+++ b/freetype/docs/reference/ft2-list_processing.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>List Processing - FreeType-2.11.1 API Reference</title>
+ <title>List Processing - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1657,7 +1681,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-lzw.html b/freetype/docs/reference/ft2-lzw.html
index b2698521..f4782f96 100644
--- a/freetype/docs/reference/ft2-lzw.html
+++ b/freetype/docs/reference/ft2-lzw.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>LZW Streams - FreeType-2.11.1 API Reference</title>
+ <title>LZW Streams - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1244,7 +1268,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-mac_specific.html b/freetype/docs/reference/ft2-mac_specific.html
index c386c7ba..777cc29d 100644
--- a/freetype/docs/reference/ft2-mac_specific.html
+++ b/freetype/docs/reference/ft2-mac_specific.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Mac Specific Interface - FreeType-2.11.1 API Reference</title>
+ <title>Mac Specific Interface - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -626,6 +626,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -740,6 +752,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1516,7 +1540,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-module_management.html b/freetype/docs/reference/ft2-module_management.html
index 4bf7cbdf..19038641 100644
--- a/freetype/docs/reference/ft2-module_management.html
+++ b/freetype/docs/reference/ft2-module_management.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Module Management - FreeType-2.11.1 API Reference</title>
+ <title>Module Management - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -2207,7 +2231,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-multiple_masters.html b/freetype/docs/reference/ft2-multiple_masters.html
index bac1a3e7..e1a3ec18 100644
--- a/freetype/docs/reference/ft2-multiple_masters.html
+++ b/freetype/docs/reference/ft2-multiple_masters.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Multiple Masters - FreeType-2.11.1 API Reference</title>
+ <title>Multiple Masters - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -724,6 +724,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -838,6 +850,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1426,6 +1450,7 @@
<h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">&para;</a></h2>
<p>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.</p>
<p>Besides Adobe MM fonts, the interface supports Apple's TrueType GX and OpenType variation fonts. Some of the routines only work with Adobe MM fonts, others will work with all three types. They are similar enough that a consistent interface makes sense.</p>
+<p>For Adobe MM fonts, macro <code><a href="ft2-base_interface.html#ft_is_sfnt">FT_IS_SFNT</a></code> returns false. For GX and OpenType variation fonts, it returns true.</p>
<h2 id="ft_mm_axis">FT_MM_Axis<a class="headerlink" href="#ft_mm_axis" title="Permanent link">&para;</a></h2>
<p>Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h).</p>
<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_MM_Axis_
@@ -2086,7 +2111,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-ot_svg_driver.html b/freetype/docs/reference/ft2-ot_svg_driver.html
new file mode 100644
index 00000000..2859b67f
--- /dev/null
+++ b/freetype/docs/reference/ft2-ot_svg_driver.html
@@ -0,0 +1,1256 @@
+
+<!doctype html>
+<html lang="en" class="no-js">
+ <head>
+
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width,initial-scale=1">
+
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
+
+
+
+ <meta name="author" content="FreeType Contributors">
+
+
+ <link rel="icon" href="images/favico.ico">
+ <meta name="generator" content="mkdocs-1.2.1, mkdocs-material-7.1.9">
+
+
+
+ <title>The SVG driver - FreeType-2.12.1 API Reference</title>
+
+
+
+ <link rel="stylesheet" href="assets/stylesheets/main.ca7ac06f.min.css">
+
+
+ <link rel="stylesheet" href="assets/stylesheets/palette.f1a3b89f.min.css">
+
+
+
+ <meta name="theme-color" content="#4cae4f">
+
+
+
+
+
+
+
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif:300,400,400i,700%7CRoboto+Mono&display=fallback">
+ <style>:root{--md-text-font-family:"Noto Serif";--md-code-font-family:"Roboto Mono"}</style>
+
+
+
+
+ <link rel="stylesheet" href="stylesheets/extra.css">
+
+
+
+
+
+
+
+ </head>
+
+
+
+
+
+
+
+ <body dir="ltr" data-md-color-scheme="" data-md-color-primary="green" data-md-color-accent="green">
+
+
+ <script>function __prefix(e){return new URL(".",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script>
+
+ <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
+ <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
+ <label class="md-overlay" for="__drawer"></label>
+ <div data-md-component="skip">
+
+
+ <a href="#the-svg-driver" class="md-skip">
+ Skip to content
+ </a>
+
+ </div>
+ <div data-md-component="announce">
+
+ </div>
+
+ <header class="md-header" data-md-component="header">
+ <nav class="md-header__inner md-grid" aria-label="Header">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
+
+ <img src="images/favico.ico" alt="logo">
+
+ </a>
+ <label class="md-header__button md-icon" for="__drawer">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
+ </label>
+ <div class="md-header__title" data-md-component="header-title">
+ <div class="md-header__ellipsis">
+ <div class="md-header__topic">
+ <span class="md-ellipsis">
+ FreeType-2.12.1 API Reference
+ </span>
+ </div>
+ <div class="md-header__topic" data-md-component="header-topic">
+ <span class="md-ellipsis">
+
+ The SVG driver
+
+ </span>
+ </div>
+ </div>
+ </div>
+
+
+
+ <label class="md-header__button md-icon" for="__search">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
+ </label>
+
+<div class="md-search" data-md-component="search" role="dialog">
+ <label class="md-search__overlay" for="__search"></label>
+ <div class="md-search__inner" role="search">
+ <form class="md-search__form" name="search">
+ <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
+ <label class="md-search__icon md-icon" for="__search">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
+ </label>
+ <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
+ </button>
+ </form>
+ <div class="md-search__output">
+ <div class="md-search__scrollwrap" data-md-scrollfix>
+ <div class="md-search-result" data-md-component="search-result">
+ <div class="md-search-result__meta">
+ Initializing search
+ </div>
+ <ol class="md-search-result__list"></ol>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+ </nav>
+</header>
+
+ <div class="md-container" data-md-component="container">
+
+
+
+
+ <main class="md-main" data-md-component="main">
+ <div class="md-main__inner md-grid">
+
+
+
+ <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+
+<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
+ <label class="md-nav__title" for="__drawer">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
+
+ <img src="images/favico.ico" alt="logo">
+
+ </a>
+ FreeType-2.12.1 API Reference
+ </label>
+
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="index.html" class="md-nav__link">
+ TOC
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-index.html" class="md-nav__link">
+ Index
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
+
+ <label class="md-nav__link" for="__nav_3">
+ General Remarks
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="General Remarks" data-md-level="1">
+ <label class="md-nav__title" for="__nav_3">
+ <span class="md-nav__icon md-icon"></span>
+ General Remarks
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-preamble.html" class="md-nav__link">
+ Preamble
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-header_inclusion.html" class="md-nav__link">
+ FreeType's header inclusion scheme
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-user_allocation.html" class="md-nav__link">
+ User allocation
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
+
+ <label class="md-nav__link" for="__nav_4">
+ Core API
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Core API" data-md-level="1">
+ <label class="md-nav__title" for="__nav_4">
+ <span class="md-nav__icon md-icon"></span>
+ Core API
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-version.html" class="md-nav__link">
+ FreeType Version
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-basic_types.html" class="md-nav__link">
+ Basic Data Types
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-base_interface.html" class="md-nav__link">
+ Base Interface
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-glyph_variants.html" class="md-nav__link">
+ Unicode Variation Sequences
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-color_management.html" class="md-nav__link">
+ Glyph Color Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-layer_management.html" class="md-nav__link">
+ Glyph Layer Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-glyph_management.html" class="md-nav__link">
+ Glyph Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-mac_specific.html" class="md-nav__link">
+ Mac Specific Interface
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-sizes_management.html" class="md-nav__link">
+ Size Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-header_file_macros.html" class="md-nav__link">
+ Header File Macros
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
+
+ <label class="md-nav__link" for="__nav_5">
+ Format-Specific API
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Format-Specific API" data-md-level="1">
+ <label class="md-nav__title" for="__nav_5">
+ <span class="md-nav__icon md-icon"></span>
+ Format-Specific API
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-multiple_masters.html" class="md-nav__link">
+ Multiple Masters
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-truetype_tables.html" class="md-nav__link">
+ TrueType Tables
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-type1_tables.html" class="md-nav__link">
+ Type 1 Tables
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-sfnt_names.html" class="md-nav__link">
+ SFNT Names
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-bdf_fonts.html" class="md-nav__link">
+ BDF and PCF Files
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-cid_fonts.html" class="md-nav__link">
+ CID Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-pfr_fonts.html" class="md-nav__link">
+ PFR Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-winfnt_fonts.html" class="md-nav__link">
+ Window FNT Files
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-font_formats.html" class="md-nav__link">
+ Font Formats
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-gasp_table.html" class="md-nav__link">
+ Gasp Table
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" checked>
+
+ <label class="md-nav__link" for="__nav_6">
+ Controlling FreeType Modules
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Controlling FreeType Modules" data-md-level="1">
+ <label class="md-nav__title" for="__nav_6">
+ <span class="md-nav__icon md-icon"></span>
+ Controlling FreeType Modules
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-auto_hinter.html" class="md-nav__link">
+ The auto-hinter
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-cff_driver.html" class="md-nav__link">
+ The CFF driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-t1_cid_driver.html" class="md-nav__link">
+ The Type 1 and CID drivers
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-tt_driver.html" class="md-nav__link">
+ The TrueType driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-pcf_driver.html" class="md-nav__link">
+ The PCF driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active">
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
+
+
+
+
+
+ <label class="md-nav__link md-nav__link--active" for="__toc">
+ The SVG driver
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link md-nav__link--active">
+ The SVG driver
+ </a>
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#synopsis" class="md-nav__link">
+ Synopsis
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-properties.html" class="md-nav__link">
+ Driver properties
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-parameter_tags.html" class="md-nav__link">
+ Parameter Tags
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-lcd_rendering.html" class="md-nav__link">
+ Subpixel Rendering
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
+
+ <label class="md-nav__link" for="__nav_7">
+ Cache Sub-System
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Cache Sub-System" data-md-level="1">
+ <label class="md-nav__title" for="__nav_7">
+ <span class="md-nav__icon md-icon"></span>
+ Cache Sub-System
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-cache_subsystem.html" class="md-nav__link">
+ Cache Sub-System
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8" type="checkbox" id="__nav_8" >
+
+ <label class="md-nav__link" for="__nav_8">
+ Support API
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Support API" data-md-level="1">
+ <label class="md-nav__title" for="__nav_8">
+ <span class="md-nav__icon md-icon"></span>
+ Support API
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-computations.html" class="md-nav__link">
+ Computations
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-list_processing.html" class="md-nav__link">
+ List Processing
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-outline_processing.html" class="md-nav__link">
+ Outline Processing
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-quick_advance.html" class="md-nav__link">
+ Quick retrieval of advance values
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-bitmap_handling.html" class="md-nav__link">
+ Bitmap Handling
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-raster.html" class="md-nav__link">
+ Scanline Converter
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-glyph_stroker.html" class="md-nav__link">
+ Glyph Stroker
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-system_interface.html" class="md-nav__link">
+ System Interface
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-module_management.html" class="md-nav__link">
+ Module Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-gzip.html" class="md-nav__link">
+ GZIP Streams
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-lzw.html" class="md-nav__link">
+ LZW Streams
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-bzip2.html" class="md-nav__link">
+ BZIP2 Streams
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-debugging_apis.html" class="md-nav__link">
+ External Debugging APIs
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_9" type="checkbox" id="__nav_9" >
+
+ <label class="md-nav__link" for="__nav_9">
+ Error Codes
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Error Codes" data-md-level="1">
+ <label class="md-nav__title" for="__nav_9">
+ <span class="md-nav__icon md-icon"></span>
+ Error Codes
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-error_enumerations.html" class="md-nav__link">
+ Error Enumerations
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-error_code_values.html" class="md-nav__link">
+ Error Code Values
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_10" type="checkbox" id="__nav_10" >
+
+ <label class="md-nav__link" for="__nav_10">
+ Miscellaneous
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Miscellaneous" data-md-level="1">
+ <label class="md-nav__title" for="__nav_10">
+ <span class="md-nav__icon md-icon"></span>
+ Miscellaneous
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-gx_validation.html" class="md-nav__link">
+ TrueTypeGX/AAT Validation
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-incremental.html" class="md-nav__link">
+ Incremental Loading
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-truetype_engine.html" class="md-nav__link">
+ The TrueType Engine
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-ot_validation.html" class="md-nav__link">
+ OpenType Validation
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+ </ul>
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#synopsis" class="md-nav__link">
+ Synopsis
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+ <div class="md-content" data-md-component="content">
+ <article class="md-content__inner md-typeset">
+
+
+
+ <p><a href="https://www.freetype.org">FreeType</a> &raquo; <a href="../">Docs</a> &raquo; <a href="index.html#controlling-freetype-modules">Controlling FreeType Modules</a> &raquo; The SVG driver</p>
+<hr />
+<h1 id="the-svg-driver">The SVG driver<a class="headerlink" href="#the-svg-driver" title="Permanent link">&para;</a></h1>
+<h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">&para;</a></h2>
+<p>By default, FreeType can only load the &lsquo;SVG&nbsp;&rsquo; table of OpenType fonts if configuration macro <code>FT_CONFIG_OPTION_SVG</code> is defined. To make it render SVG glyphs, an external SVG rendering library is needed. All details on the interface between FreeType and the external library via function hooks can be found in section &lsquo;<a href="ft2-svg_fonts.html#svg_fonts">OpenType SVG Fonts</a>&rsquo;.</p>
+<p>The OT-SVG driver's module name is &lsquo;ot-svg&rsquo;; it supports a single property called <code><a href="ft2-properties.html#svg-hooks">svg-hooks</a></code>, documented below in the &lsquo;<a href="ft2-properties.html#properties">Driver properties</a>&rsquo; section.</p>
+
+
+
+
+
+
+
+ </article>
+ </div>
+ </div>
+
+ </main>
+
+
+<footer class="md-footer">
+
+ <nav class="md-footer__inner md-grid" aria-label="Footer">
+
+
+ <a href="ft2-pcf_driver.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: The PCF driver" rel="prev">
+ <div class="md-footer__button md-icon">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
+ </div>
+ <div class="md-footer__title">
+ <div class="md-ellipsis">
+ <span class="md-footer__direction">
+ Previous
+ </span>
+ The PCF driver
+ </div>
+ </div>
+ </a>
+
+
+
+ <a href="ft2-properties.html" class="md-footer__link md-footer__link--next" aria-label="Next: Driver properties" rel="next">
+ <div class="md-footer__title">
+ <div class="md-ellipsis">
+ <span class="md-footer__direction">
+ Next
+ </span>
+ Driver properties
+ </div>
+ </div>
+ <div class="md-footer__button md-icon">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
+ </div>
+ </a>
+
+ </nav>
+
+ <div class="md-footer-meta md-typeset">
+ <div class="md-footer-meta__inner md-grid">
+ <div class="md-footer-copyright">
+
+ <div class="md-footer-copyright__highlight">
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ </div>
+
+ Made with
+ <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
+ Material for MkDocs
+ </a>
+
+ </div>
+
+ </div>
+ </div>
+</footer>
+
+ </div>
+ <div class="md-dialog" data-md-component="dialog">
+ <div class="md-dialog__inner md-typeset"></div>
+ </div>
+ <script id="__config" type="application/json">{"base": ".", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "assets/javascripts/workers/search.477d984a.min.js", "version": null}</script>
+
+
+ <script src="assets/javascripts/bundle.82b56eb2.min.js"></script>
+
+ <script src="javascripts/extra.js"></script>
+
+
+ </body>
+</html> \ No newline at end of file
diff --git a/freetype/docs/reference/ft2-ot_validation.html b/freetype/docs/reference/ft2-ot_validation.html
index 4e2a6893..f887bd96 100644
--- a/freetype/docs/reference/ft2-ot_validation.html
+++ b/freetype/docs/reference/ft2-ot_validation.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>OpenType Validation - FreeType-2.11.1 API Reference</title>
+ <title>OpenType Validation - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1346,7 +1370,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-outline_processing.html b/freetype/docs/reference/ft2-outline_processing.html
index a04a20da..0030a472 100644
--- a/freetype/docs/reference/ft2-outline_processing.html
+++ b/freetype/docs/reference/ft2-outline_processing.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Outline Processing - FreeType-2.11.1 API Reference</title>
+ <title>Outline Processing - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1915,7 +1939,7 @@
<p>FreeType error code. 0&nbsp;means success.</p>
<h4>note</h4>
-<p>A contour that contains a single point only is represented by a &lsquo;move to&rsquo; operation followed by &lsquo;line to&rsquo; to the same point. In most cases, it is best to filter this out before using the outline for stroking purposes (otherwise it would result in a visible dot when round caps are used).</p>
+<p>Degenerate contours, segments, and Bezier arcs may be reported. In most cases, it is best to filter these out before using the outline for stroking or other path modification purposes (which may cause degenerate segments to become non-degenrate and visible, like when stroke caps are used or the path is otherwise outset). Some glyph outlines may contain deliberate degenerate single points for mark attachement.</p>
<p>Similarly, the function returns success for an empty outline also (doing nothing, this is, not calling any emitter); if necessary, you should filter this out, too.</p>
<hr>
@@ -2189,7 +2213,7 @@
<p>If set, turn pixels on for &lsquo;stubs&rsquo;, otherwise exclude them. Ignored if <code><a href="ft2-outline_processing.html#ft_outline_xxx">FT_OUTLINE_IGNORE_DROPOUTS</a></code> is set. See below for more information.</p>
</td></tr>
<tr><td class="val" id="ft_outline_overlap">FT_OUTLINE_OVERLAP</td><td class="desc">
-<p>This flag indicates that this outline contains overlapping contrours and the anti-aliased renderer should perform oversampling to mitigate possible artifacts. This flag should <em>not</em> be set for well designed glyphs without overlaps because it quadruples the rendering time.</p>
+<p>[Since 2.10.3] This flag indicates that this outline contains overlapping contours and the anti-aliased renderer should perform oversampling to mitigate possible artifacts. This flag should <em>not</em> be set for well designed glyphs without overlaps because it quadruples the rendering time.</p>
</td></tr>
<tr><td class="val" id="ft_outline_high_precision">FT_OUTLINE_HIGH_PRECISION</td><td class="desc">
<p>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.</p>
@@ -2261,7 +2285,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-parameter_tags.html b/freetype/docs/reference/ft2-parameter_tags.html
index 940d8f28..5e095f8c 100644
--- a/freetype/docs/reference/ft2-parameter_tags.html
+++ b/freetype/docs/reference/ft2-parameter_tags.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Parameter Tags - FreeType-2.11.1 API Reference</title>
+ <title>Parameter Tags - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -658,6 +670,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -731,6 +755,13 @@
</li>
<li class="md-nav__item">
+ <a href="#ft_param_tag_ignore_sbix" class="md-nav__link">
+ FT_PARAM_TAG_IGNORE_SBIX
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#ft_param_tag_lcd_filter_weights" class="md-nav__link">
FT_PARAM_TAG_LCD_FILTER_WEIGHTS
</a>
@@ -1198,6 +1229,13 @@
</li>
<li class="md-nav__item">
+ <a href="#ft_param_tag_ignore_sbix" class="md-nav__link">
+ FT_PARAM_TAG_IGNORE_SBIX
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#ft_param_tag_lcd_filter_weights" class="md-nav__link">
FT_PARAM_TAG_LCD_FILTER_WEIGHTS
</a>
@@ -1283,6 +1321,14 @@
<p>An <code><a href="ft2-base_interface.html#ft_parameter">FT_Parameter</a></code> tag to be used with <code><a href="ft2-base_interface.html#ft_open_face">FT_Open_Face</a></code> to indicate incremental glyph loading.</p>
<hr>
+<h2 id="ft_param_tag_ignore_sbix">FT_PARAM_TAG_IGNORE_SBIX<a class="headerlink" href="#ft_param_tag_ignore_sbix" title="Permanent link">&para;</a></h2>
+<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <b>FT_PARAM_TAG_IGNORE_SBIX</b> \
+ <a href="ft2-basic_types.html#ft_make_tag">FT_MAKE_TAG</a>( 'i', 's', 'b', 'x' )
+</code></pre></div>
+
+<p>A tag for <code><a href="ft2-base_interface.html#ft_parameter">FT_Parameter</a></code> to make <code><a href="ft2-base_interface.html#ft_open_face">FT_Open_Face</a></code> ignore an &lsquo;sbix&rsquo; table while loading a font. Use this if <code><a href="ft2-base_interface.html#ft_face_flag_xxx">FT_FACE_FLAG_SBIX</a></code> is set and you want to access the outline glyphs in the font.</p>
+<hr>
+
<h2 id="ft_param_tag_lcd_filter_weights">FT_PARAM_TAG_LCD_FILTER_WEIGHTS<a class="headerlink" href="#ft_param_tag_lcd_filter_weights" title="Permanent link">&para;</a></h2>
<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <b>FT_PARAM_TAG_LCD_FILTER_WEIGHTS</b> \
<a href="ft2-basic_types.html#ft_make_tag">FT_MAKE_TAG</a>( 'l', 'c', 'd', 'f' )
@@ -1381,7 +1427,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-pcf_driver.html b/freetype/docs/reference/ft2-pcf_driver.html
index 4a208d17..fe5e5674 100644
--- a/freetype/docs/reference/ft2-pcf_driver.html
+++ b/freetype/docs/reference/ft2-pcf_driver.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>The PCF driver - FreeType-2.11.1 API Reference</title>
+ <title>The PCF driver - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -698,6 +710,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1181,13 +1205,13 @@
- <a href="ft2-properties.html" class="md-footer__link md-footer__link--next" aria-label="Next: Driver properties" rel="next">
+ <a href="ft2-ot_svg_driver.html" class="md-footer__link md-footer__link--next" aria-label="Next: The SVG driver" rel="next">
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
Next
</span>
- Driver properties
+ The SVG driver
</div>
</div>
<div class="md-footer__button md-icon">
@@ -1202,7 +1226,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-pfr_fonts.html b/freetype/docs/reference/ft2-pfr_fonts.html
index 65d60dee..79e422e8 100644
--- a/freetype/docs/reference/ft2-pfr_fonts.html
+++ b/freetype/docs/reference/ft2-pfr_fonts.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>PFR Fonts - FreeType-2.11.1 API Reference</title>
+ <title>PFR Fonts - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -605,6 +605,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -719,6 +731,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1357,7 +1381,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-preamble.html b/freetype/docs/reference/ft2-preamble.html
index 92d09bf1..a8b05d75 100644
--- a/freetype/docs/reference/ft2-preamble.html
+++ b/freetype/docs/reference/ft2-preamble.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Preamble - FreeType-2.11.1 API Reference</title>
+ <title>Preamble - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -584,6 +584,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -698,6 +710,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1203,7 +1227,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-properties.html b/freetype/docs/reference/ft2-properties.html
index f420a3f2..9d9f6c4e 100644
--- a/freetype/docs/reference/ft2-properties.html
+++ b/freetype/docs/reference/ft2-properties.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Driver properties - FreeType-2.11.1 API Reference</title>
+ <title>Driver properties - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
+
+ <li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
@@ -754,6 +778,13 @@
</li>
<li class="md-nav__item">
+ <a href="#svg-hooks" class="md-nav__link">
+ svg-hooks
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#glyph-to-script-map" class="md-nav__link">
glyph-to-script-map
</a>
@@ -1296,6 +1327,13 @@
</li>
<li class="md-nav__item">
+ <a href="#svg-hooks" class="md-nav__link">
+ svg-hooks
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
<a href="#glyph-to-script-map" class="md-nav__link">
glyph-to-script-map
</a>
@@ -1616,6 +1654,29 @@
<p>2.5</p>
<hr>
+<h2 id="svg-hooks">svg-hooks<a class="headerlink" href="#svg-hooks" title="Permanent link">&para;</a></h2>
+<p>Set up the interface between FreeType and an extern SVG rendering library like &lsquo;librsvg&rsquo;. All details on the function hooks can be found in section &lsquo;<a href="ft2-svg_fonts.html#svg_fonts">OpenType SVG Fonts</a>&rsquo;.</p>
+<h4>example</h4>
+
+<p>The following example code expects that the four hook functions <code>svg_*</code> are defined elsewhere. Error handling is omitted, too.
+<div class="highlight"><pre><span></span><code> FT_Library library;
+ SVG_RendererHooks hooks = {
+ (SVG_Lib_Init_Func)svg_init,
+ (SVG_Lib_Free_Func)svg_free,
+ (SVG_Lib_Render_Func)svg_render,
+ (SVG_Lib_Preset_Slot_Func)svg_preset_slot };
+
+
+ FT_Init_FreeType( &amp;library );
+
+ FT_Property_Set( library, &quot;ot-svg&quot;,
+ &quot;svg-hooks&quot;, &amp;hooks );
+</code></pre></div></p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
<h2 id="glyph-to-script-map">glyph-to-script-map<a class="headerlink" href="#glyph-to-script-map" title="Permanent link">&para;</a></h2>
<p><strong>Experimental only</strong></p>
<p>The auto-hinter provides various script modules to hint glyphs. Examples of supported scripts are Latin or CJK. Before a glyph is auto-hinted, the Unicode character map of the font gets examined, and the script is then determined based on Unicode character ranges, see below.</p>
@@ -1880,7 +1941,7 @@
<nav class="md-footer__inner md-grid" aria-label="Footer">
- <a href="ft2-pcf_driver.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: The PCF driver" rel="prev">
+ <a href="ft2-ot_svg_driver.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: The SVG driver" rel="prev">
<div class="md-footer__button md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
</div>
@@ -1889,7 +1950,7 @@
<span class="md-footer__direction">
Previous
</span>
- The PCF driver
+ The SVG driver
</div>
</div>
</a>
@@ -1917,7 +1978,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-quick_advance.html b/freetype/docs/reference/ft2-quick_advance.html
index 66b3207a..4d1b3e35 100644
--- a/freetype/docs/reference/ft2-quick_advance.html
+++ b/freetype/docs/reference/ft2-quick_advance.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Quick retrieval of advance values - FreeType-2.11.1 API Reference</title>
+ <title>Quick retrieval of advance values - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1338,7 +1362,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-raster.html b/freetype/docs/reference/ft2-raster.html
index be8095a9..f0f7788a 100644
--- a/freetype/docs/reference/ft2-raster.html
+++ b/freetype/docs/reference/ft2-raster.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Scanline Converter - FreeType-2.11.1 API Reference</title>
+ <title>Scanline Converter - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1750,7 +1774,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-sfnt_names.html b/freetype/docs/reference/ft2-sfnt_names.html
index 37a2bca0..8e62650d 100644
--- a/freetype/docs/reference/ft2-sfnt_names.html
+++ b/freetype/docs/reference/ft2-sfnt_names.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>SFNT Names - FreeType-2.11.1 API Reference</title>
+ <title>SFNT Names - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -619,6 +619,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -733,6 +745,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1443,7 +1467,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-sizes_management.html b/freetype/docs/reference/ft2-sizes_management.html
index bc59234c..c8653297 100644
--- a/freetype/docs/reference/ft2-sizes_management.html
+++ b/freetype/docs/reference/ft2-sizes_management.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Size Management - FreeType-2.11.1 API Reference</title>
+ <title>Size Management - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -605,6 +605,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -719,6 +731,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1317,7 +1341,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-svg_fonts.html b/freetype/docs/reference/ft2-svg_fonts.html
new file mode 100644
index 00000000..32b1f52b
--- /dev/null
+++ b/freetype/docs/reference/ft2-svg_fonts.html
@@ -0,0 +1,1582 @@
+
+<!doctype html>
+<html lang="en" class="no-js">
+ <head>
+
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width,initial-scale=1">
+
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
+
+
+
+ <meta name="author" content="FreeType Contributors">
+
+
+ <link rel="icon" href="images/favico.ico">
+ <meta name="generator" content="mkdocs-1.2.1, mkdocs-material-7.1.9">
+
+
+
+ <title>OpenType SVG Fonts - FreeType-2.12.1 API Reference</title>
+
+
+
+ <link rel="stylesheet" href="assets/stylesheets/main.ca7ac06f.min.css">
+
+
+ <link rel="stylesheet" href="assets/stylesheets/palette.f1a3b89f.min.css">
+
+
+
+ <meta name="theme-color" content="#4cae4f">
+
+
+
+
+
+
+
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif:300,400,400i,700%7CRoboto+Mono&display=fallback">
+ <style>:root{--md-text-font-family:"Noto Serif";--md-code-font-family:"Roboto Mono"}</style>
+
+
+
+
+ <link rel="stylesheet" href="stylesheets/extra.css">
+
+
+
+
+
+
+
+ </head>
+
+
+
+
+
+
+
+ <body dir="ltr" data-md-color-scheme="" data-md-color-primary="green" data-md-color-accent="green">
+
+
+ <script>function __prefix(e){return new URL(".",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script>
+
+ <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
+ <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
+ <label class="md-overlay" for="__drawer"></label>
+ <div data-md-component="skip">
+
+
+ <a href="#opentype-svg-fonts" class="md-skip">
+ Skip to content
+ </a>
+
+ </div>
+ <div data-md-component="announce">
+
+ </div>
+
+ <header class="md-header" data-md-component="header">
+ <nav class="md-header__inner md-grid" aria-label="Header">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
+
+ <img src="images/favico.ico" alt="logo">
+
+ </a>
+ <label class="md-header__button md-icon" for="__drawer">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
+ </label>
+ <div class="md-header__title" data-md-component="header-title">
+ <div class="md-header__ellipsis">
+ <div class="md-header__topic">
+ <span class="md-ellipsis">
+ FreeType-2.12.1 API Reference
+ </span>
+ </div>
+ <div class="md-header__topic" data-md-component="header-topic">
+ <span class="md-ellipsis">
+
+ OpenType SVG Fonts
+
+ </span>
+ </div>
+ </div>
+ </div>
+
+
+
+ <label class="md-header__button md-icon" for="__search">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
+ </label>
+
+<div class="md-search" data-md-component="search" role="dialog">
+ <label class="md-search__overlay" for="__search"></label>
+ <div class="md-search__inner" role="search">
+ <form class="md-search__form" name="search">
+ <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
+ <label class="md-search__icon md-icon" for="__search">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
+ </label>
+ <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
+ </button>
+ </form>
+ <div class="md-search__output">
+ <div class="md-search__scrollwrap" data-md-scrollfix>
+ <div class="md-search-result" data-md-component="search-result">
+ <div class="md-search-result__meta">
+ Initializing search
+ </div>
+ <ol class="md-search-result__list"></ol>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+ </nav>
+</header>
+
+ <div class="md-container" data-md-component="container">
+
+
+
+
+ <main class="md-main" data-md-component="main">
+ <div class="md-main__inner md-grid">
+
+
+
+ <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+
+
+<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
+ <label class="md-nav__title" for="__drawer">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
+
+ <img src="images/favico.ico" alt="logo">
+
+ </a>
+ FreeType-2.12.1 API Reference
+ </label>
+
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="index.html" class="md-nav__link">
+ TOC
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-index.html" class="md-nav__link">
+ Index
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
+
+ <label class="md-nav__link" for="__nav_3">
+ General Remarks
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="General Remarks" data-md-level="1">
+ <label class="md-nav__title" for="__nav_3">
+ <span class="md-nav__icon md-icon"></span>
+ General Remarks
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-preamble.html" class="md-nav__link">
+ Preamble
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-header_inclusion.html" class="md-nav__link">
+ FreeType's header inclusion scheme
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-user_allocation.html" class="md-nav__link">
+ User allocation
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
+
+ <label class="md-nav__link" for="__nav_4">
+ Core API
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Core API" data-md-level="1">
+ <label class="md-nav__title" for="__nav_4">
+ <span class="md-nav__icon md-icon"></span>
+ Core API
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-version.html" class="md-nav__link">
+ FreeType Version
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-basic_types.html" class="md-nav__link">
+ Basic Data Types
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-base_interface.html" class="md-nav__link">
+ Base Interface
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-glyph_variants.html" class="md-nav__link">
+ Unicode Variation Sequences
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-color_management.html" class="md-nav__link">
+ Glyph Color Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-layer_management.html" class="md-nav__link">
+ Glyph Layer Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-glyph_management.html" class="md-nav__link">
+ Glyph Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-mac_specific.html" class="md-nav__link">
+ Mac Specific Interface
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-sizes_management.html" class="md-nav__link">
+ Size Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-header_file_macros.html" class="md-nav__link">
+ Header File Macros
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" checked>
+
+ <label class="md-nav__link" for="__nav_5">
+ Format-Specific API
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Format-Specific API" data-md-level="1">
+ <label class="md-nav__title" for="__nav_5">
+ <span class="md-nav__icon md-icon"></span>
+ Format-Specific API
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-multiple_masters.html" class="md-nav__link">
+ Multiple Masters
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-truetype_tables.html" class="md-nav__link">
+ TrueType Tables
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-type1_tables.html" class="md-nav__link">
+ Type 1 Tables
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-sfnt_names.html" class="md-nav__link">
+ SFNT Names
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-bdf_fonts.html" class="md-nav__link">
+ BDF and PCF Files
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-cid_fonts.html" class="md-nav__link">
+ CID Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-pfr_fonts.html" class="md-nav__link">
+ PFR Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-winfnt_fonts.html" class="md-nav__link">
+ Window FNT Files
+ </a>
+ </li>
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--active">
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
+
+
+
+
+
+ <label class="md-nav__link md-nav__link--active" for="__toc">
+ OpenType SVG Fonts
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+
+ <a href="ft2-svg_fonts.html" class="md-nav__link md-nav__link--active">
+ OpenType SVG Fonts
+ </a>
+
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#synopsis" class="md-nav__link">
+ Synopsis
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_lib_init_func" class="md-nav__link">
+ SVG_Lib_Init_Func
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_lib_free_func" class="md-nav__link">
+ SVG_Lib_Free_Func
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_lib_render_func" class="md-nav__link">
+ SVG_Lib_Render_Func
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_lib_preset_slot_func" class="md-nav__link">
+ SVG_Lib_Preset_Slot_Func
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_rendererhooks" class="md-nav__link">
+ SVG_RendererHooks
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_svg_documentrec" class="md-nav__link">
+ FT_SVG_DocumentRec
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_svg_document" class="md-nav__link">
+ FT_SVG_Document
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-font_formats.html" class="md-nav__link">
+ Font Formats
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-gasp_table.html" class="md-nav__link">
+ Gasp Table
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
+
+ <label class="md-nav__link" for="__nav_6">
+ Controlling FreeType Modules
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Controlling FreeType Modules" data-md-level="1">
+ <label class="md-nav__title" for="__nav_6">
+ <span class="md-nav__icon md-icon"></span>
+ Controlling FreeType Modules
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-auto_hinter.html" class="md-nav__link">
+ The auto-hinter
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-cff_driver.html" class="md-nav__link">
+ The CFF driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-t1_cid_driver.html" class="md-nav__link">
+ The Type 1 and CID drivers
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-tt_driver.html" class="md-nav__link">
+ The TrueType driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-pcf_driver.html" class="md-nav__link">
+ The PCF driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-properties.html" class="md-nav__link">
+ Driver properties
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-parameter_tags.html" class="md-nav__link">
+ Parameter Tags
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-lcd_rendering.html" class="md-nav__link">
+ Subpixel Rendering
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
+
+ <label class="md-nav__link" for="__nav_7">
+ Cache Sub-System
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Cache Sub-System" data-md-level="1">
+ <label class="md-nav__title" for="__nav_7">
+ <span class="md-nav__icon md-icon"></span>
+ Cache Sub-System
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-cache_subsystem.html" class="md-nav__link">
+ Cache Sub-System
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8" type="checkbox" id="__nav_8" >
+
+ <label class="md-nav__link" for="__nav_8">
+ Support API
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Support API" data-md-level="1">
+ <label class="md-nav__title" for="__nav_8">
+ <span class="md-nav__icon md-icon"></span>
+ Support API
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-computations.html" class="md-nav__link">
+ Computations
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-list_processing.html" class="md-nav__link">
+ List Processing
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-outline_processing.html" class="md-nav__link">
+ Outline Processing
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-quick_advance.html" class="md-nav__link">
+ Quick retrieval of advance values
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-bitmap_handling.html" class="md-nav__link">
+ Bitmap Handling
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-raster.html" class="md-nav__link">
+ Scanline Converter
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-glyph_stroker.html" class="md-nav__link">
+ Glyph Stroker
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-system_interface.html" class="md-nav__link">
+ System Interface
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-module_management.html" class="md-nav__link">
+ Module Management
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-gzip.html" class="md-nav__link">
+ GZIP Streams
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-lzw.html" class="md-nav__link">
+ LZW Streams
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-bzip2.html" class="md-nav__link">
+ BZIP2 Streams
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-debugging_apis.html" class="md-nav__link">
+ External Debugging APIs
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_9" type="checkbox" id="__nav_9" >
+
+ <label class="md-nav__link" for="__nav_9">
+ Error Codes
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Error Codes" data-md-level="1">
+ <label class="md-nav__title" for="__nav_9">
+ <span class="md-nav__icon md-icon"></span>
+ Error Codes
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-error_enumerations.html" class="md-nav__link">
+ Error Enumerations
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-error_code_values.html" class="md-nav__link">
+ Error Code Values
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+
+
+
+
+
+
+
+
+ <li class="md-nav__item md-nav__item--nested">
+
+
+ <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_10" type="checkbox" id="__nav_10" >
+
+ <label class="md-nav__link" for="__nav_10">
+ Miscellaneous
+ <span class="md-nav__icon md-icon"></span>
+ </label>
+ <nav class="md-nav" aria-label="Miscellaneous" data-md-level="1">
+ <label class="md-nav__title" for="__nav_10">
+ <span class="md-nav__icon md-icon"></span>
+ Miscellaneous
+ </label>
+ <ul class="md-nav__list" data-md-scrollfix>
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-gx_validation.html" class="md-nav__link">
+ TrueTypeGX/AAT Validation
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-incremental.html" class="md-nav__link">
+ Incremental Loading
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-truetype_engine.html" class="md-nav__link">
+ The TrueType Engine
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
+ <a href="ft2-ot_validation.html" class="md-nav__link">
+ OpenType Validation
+ </a>
+ </li>
+
+
+
+ </ul>
+ </nav>
+ </li>
+
+
+
+ </ul>
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+
+ <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
+ <div class="md-sidebar__scrollwrap">
+ <div class="md-sidebar__inner">
+
+<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
+
+
+
+
+
+
+ <label class="md-nav__title" for="__toc">
+ <span class="md-nav__icon md-icon"></span>
+ Table of contents
+ </label>
+ <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
+
+ <li class="md-nav__item">
+ <a href="#synopsis" class="md-nav__link">
+ Synopsis
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_lib_init_func" class="md-nav__link">
+ SVG_Lib_Init_Func
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_lib_free_func" class="md-nav__link">
+ SVG_Lib_Free_Func
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_lib_render_func" class="md-nav__link">
+ SVG_Lib_Render_Func
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_lib_preset_slot_func" class="md-nav__link">
+ SVG_Lib_Preset_Slot_Func
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#svg_rendererhooks" class="md-nav__link">
+ SVG_RendererHooks
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_svg_documentrec" class="md-nav__link">
+ FT_SVG_DocumentRec
+ </a>
+
+</li>
+
+ <li class="md-nav__item">
+ <a href="#ft_svg_document" class="md-nav__link">
+ FT_SVG_Document
+ </a>
+
+</li>
+
+ </ul>
+
+</nav>
+ </div>
+ </div>
+ </div>
+
+
+ <div class="md-content" data-md-component="content">
+ <article class="md-content__inner md-typeset">
+
+
+
+ <p><a href="https://www.freetype.org">FreeType</a> &raquo; <a href="../">Docs</a> &raquo; <a href="index.html#format-specific-api">Format-Specific API</a> &raquo; OpenType SVG Fonts</p>
+<hr />
+<h1 id="opentype-svg-fonts">OpenType SVG Fonts<a class="headerlink" href="#opentype-svg-fonts" title="Permanent link">&para;</a></h1>
+<h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">&para;</a></h2>
+<p>This section describes the four hooks necessary to render SVG &lsquo;documents&rsquo; that are contained in an OpenType font's &lsquo;SVG&nbsp;&rsquo; table.</p>
+<p>For more information on the implementation, see our standard hooks based on &lsquo;librsvg&rsquo; in the <a href="https://gitlab.freedesktop.org/freetype/freetype-demos">FreeType Demo Programs</a> repository.</p>
+<h2 id="svg_lib_init_func">SVG_Lib_Init_Func<a class="headerlink" href="#svg_lib_init_func" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_OTSVG_H (freetype/otsvg.h).</p>
+<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <a href="ft2-basic_types.html#ft_error">FT_Error</a>
+ (*<b>SVG_Lib_Init_Func</b>)( <a href="ft2-basic_types.html#ft_pointer">FT_Pointer</a> *data_pointer );
+</code></pre></div>
+
+<p>A callback that is called when the first OT-SVG glyph is rendered in the lifetime of an <code><a href="ft2-base_interface.html#ft_library">FT_Library</a></code> object. In a typical implementation, one would want to allocate a structure and point the <code>data_pointer</code> to it and perform any library initializations that might be needed.</p>
+<h4>inout</h4>
+<table class="fields">
+<tr><td class="val" id="data_pointer">data_pointer</td><td class="desc">
+<p>The SVG rendering module stores a pointer variable that can be used by clients to store any data that needs to be shared across different hooks. <code>data_pointer</code> is essentially a pointer to that pointer such that it can be written to as well as read from.</p>
+</td></tr>
+</table>
+
+<h4>return</h4>
+
+<p>FreeType error code. 0 means success.</p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+<h2 id="svg_lib_free_func">SVG_Lib_Free_Func<a class="headerlink" href="#svg_lib_free_func" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_OTSVG_H (freetype/otsvg.h).</p>
+<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">void</span>
+ (*<b>SVG_Lib_Free_Func</b>)( <a href="ft2-basic_types.html#ft_pointer">FT_Pointer</a> *data_pointer );
+</code></pre></div>
+
+<p>A callback that is called when the <code>ot-svg</code> module is being freed. It is only called if the init hook was called earlier. This means that neither the init nor the free hook is called if no OT-SVG glyph is rendered.</p>
+<p>In a typical implementation, one would want to free any state structure that was allocated in the init hook and perform any library-related closure that might be needed.</p>
+<h4>inout</h4>
+<table class="fields">
+<tr><td class="val" id="data_pointer">data_pointer</td><td class="desc">
+<p>The SVG rendering module stores a pointer variable that can be used by clients to store any data that needs to be shared across different hooks. <code>data_pointer</code> is essentially a pointer to that pointer such that it can be written to as well as read from.</p>
+</td></tr>
+</table>
+
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+<h2 id="svg_lib_render_func">SVG_Lib_Render_Func<a class="headerlink" href="#svg_lib_render_func" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_OTSVG_H (freetype/otsvg.h).</p>
+<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <a href="ft2-basic_types.html#ft_error">FT_Error</a>
+ (*<b>SVG_Lib_Render_Func</b>)( <a href="ft2-base_interface.html#ft_glyphslot">FT_GlyphSlot</a> slot,
+ <a href="ft2-basic_types.html#ft_pointer">FT_Pointer</a> *data_pointer );
+</code></pre></div>
+
+<p>A callback that is called to render an OT-SVG glyph. This callback hook is called right after the preset hook <code><a href="ft2-svg_fonts.html#svg_lib_preset_slot_func">SVG_Lib_Preset_Slot_Func</a></code> has been called with <code>cache</code> set to <code>TRUE</code>. The data necessary to render is available through the handle <code><a href="ft2-svg_fonts.html#ft_svg_document">FT_SVG_Document</a></code>, which is set in the <code>other</code> field of <code><a href="ft2-base_interface.html#ft_glyphslotrec">FT_GlyphSlotRec</a></code>.</p>
+<p>The render hook is expected to render the SVG glyph to the bitmap buffer that is allocated already at <code>slot-&gt;bitmap.buffer</code>. It also sets the <code>num_grays</code> value as well as <code>slot-&gt;format</code>.</p>
+<h4>input</h4>
+<table class="fields">
+<tr><td class="val" id="slot">slot</td><td class="desc">
+<p>The slot to render.</p>
+</td></tr>
+</table>
+
+<h4>inout</h4>
+<table class="fields">
+<tr><td class="val" id="data_pointer">data_pointer</td><td class="desc">
+<p>The SVG rendering module stores a pointer variable that can be used by clients to store any data that needs to be shared across different hooks. <code>data_pointer</code> is essentially a pointer to that pointer such that it can be written to as well as read from.</p>
+</td></tr>
+</table>
+
+<h4>return</h4>
+
+<p>FreeType error code. 0 means success.</p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+<h2 id="svg_lib_preset_slot_func">SVG_Lib_Preset_Slot_Func<a class="headerlink" href="#svg_lib_preset_slot_func" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_OTSVG_H (freetype/otsvg.h).</p>
+<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <a href="ft2-basic_types.html#ft_error">FT_Error</a>
+ (*<b>SVG_Lib_Preset_Slot_Func</b>)( <a href="ft2-base_interface.html#ft_glyphslot">FT_GlyphSlot</a> slot,
+ <a href="ft2-basic_types.html#ft_bool">FT_Bool</a> cache,
+ <a href="ft2-basic_types.html#ft_pointer">FT_Pointer</a> *state );
+</code></pre></div>
+
+<p>A callback that is called to preset the glyph slot. It is called from two places.</p>
+<ol>
+<li>
+<p>When <code>FT_Load_Glyph</code> needs to preset the glyph slot.</p>
+</li>
+<li>
+<p>Right before the <code>svg</code> module calls the render callback hook.</p>
+</li>
+</ol>
+<p>When it is the former, the argument <code>cache</code> is set to <code>FALSE</code>. When it is the latter, the argument <code>cache</code> is set to <code>TRUE</code>. This distinction has been made because many calculations that are necessary for presetting a glyph slot are the same needed later for the render callback hook. Thus, if <code>cache</code> is <code>TRUE</code>, the hook can <em>cache</em> those calculations in a memory block referenced by the state pointer.</p>
+<p>This hook is expected to preset the slot by setting parameters such as <code>bitmap_left</code>, <code>bitmap_top</code>, <code>width</code>, <code>rows</code>, <code>pitch</code>, and <code>pixel_mode</code>. It is also expected to set all the metrics for the slot including the vertical advance if it is not already set. Typically, fonts have horizontal advances but not vertical ones. If those are available, they had already been set, otherwise they have to be estimated and set manually. The hook must take into account the transformations that have been set, and translate the transformation matrices into the SVG coordinate system, as the original matrix is intended for the TTF/CFF coordinate system.</p>
+<h4>input</h4>
+<table class="fields">
+<tr><td class="val" id="slot">slot</td><td class="desc">
+<p>The glyph slot that has the SVG document loaded.</p>
+</td></tr>
+<tr><td class="val" id="cache">cache</td><td class="desc">
+<p>See description.</p>
+</td></tr>
+</table>
+
+<h4>inout</h4>
+<table class="fields">
+<tr><td class="val" id="data_pointer">data_pointer</td><td class="desc">
+<p>The SVG rendering module stores a pointer variable that can be used by clients to store any data that needs to be shared across different hooks. <code>data_pointer</code> is essentially a pointer to that pointer such that it can be written to as well as read from.</p>
+</td></tr>
+</table>
+
+<h4>return</h4>
+
+<p>FreeType error code. 0 means success.</p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+<h2 id="svg_rendererhooks">SVG_RendererHooks<a class="headerlink" href="#svg_rendererhooks" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_OTSVG_H (freetype/otsvg.h).</p>
+<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> SVG_RendererHooks_
+ {
+ <a href="ft2-svg_fonts.html#svg_lib_init_func">SVG_Lib_Init_Func</a> init_svg;
+ <a href="ft2-svg_fonts.html#svg_lib_free_func">SVG_Lib_Free_Func</a> free_svg;
+ <a href="ft2-svg_fonts.html#svg_lib_render_func">SVG_Lib_Render_Func</a> render_svg;
+
+ <a href="ft2-svg_fonts.html#svg_lib_preset_slot_func">SVG_Lib_Preset_Slot_Func</a> preset_slot;
+
+ } <b>SVG_RendererHooks</b>;
+</code></pre></div>
+
+<p>A structure that stores the four hooks needed to render OT-SVG glyphs properly. The structure is publicly used to set the hooks via the <code><a href="ft2-properties.html#svg-hooks">svg-hooks</a></code> driver property.</p>
+<p>The behavior of each hook is described in its documentation. One thing to note is that the preset hook and the render hook often need to do the same operations; therefore, it's better to cache the intermediate data in a state structure to avoid calculating it twice. For example, in the preset hook one can draw the glyph on a recorder surface and later create a bitmap surface from it in the render hook.</p>
+<p>All four hooks must be non-NULL.</p>
+<h4>fields</h4>
+<table class="fields">
+<tr><td class="val" id="init_svg">init_svg</td><td class="desc">
+<p>The initialization hook.</p>
+</td></tr>
+<tr><td class="val" id="free_svg">free_svg</td><td class="desc">
+<p>The cleanup hook.</p>
+</td></tr>
+<tr><td class="val" id="render_hook">render_hook</td><td class="desc">
+<p>The render hook.</p>
+</td></tr>
+<tr><td class="val" id="preset_slot">preset_slot</td><td class="desc">
+<p>The preset hook.</p>
+</td></tr>
+</table>
+
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+<h2 id="ft_svg_documentrec">FT_SVG_DocumentRec<a class="headerlink" href="#ft_svg_documentrec" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_OTSVG_H (freetype/otsvg.h).</p>
+<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_SVG_DocumentRec_
+ {
+ <a href="ft2-basic_types.html#ft_byte">FT_Byte</a>* svg_document;
+ <a href="ft2-basic_types.html#ft_ulong">FT_ULong</a> svg_document_length;
+
+ <a href="ft2-base_interface.html#ft_size_metrics">FT_Size_Metrics</a> metrics;
+ <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> units_per_EM;
+
+ <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> start_glyph_id;
+ <a href="ft2-basic_types.html#ft_ushort">FT_UShort</a> end_glyph_id;
+
+ <a href="ft2-basic_types.html#ft_matrix">FT_Matrix</a> transform;
+ <a href="ft2-basic_types.html#ft_vector">FT_Vector</a> delta;
+
+ } <b>FT_SVG_DocumentRec</b>;
+</code></pre></div>
+
+<p>A structure that models one SVG document.</p>
+<h4>fields</h4>
+<table class="fields">
+<tr><td class="val" id="svg_document">svg_document</td><td class="desc">
+<p>A pointer to the SVG document.</p>
+</td></tr>
+<tr><td class="val" id="svg_document_length">svg_document_length</td><td class="desc">
+<p>The length of <code>svg_document</code>.</p>
+</td></tr>
+<tr><td class="val" id="metrics">metrics</td><td class="desc">
+<p>A metrics object storing the size information.</p>
+</td></tr>
+<tr><td class="val" id="units_per_em">units_per_EM</td><td class="desc">
+<p>The size of the EM square.</p>
+</td></tr>
+<tr><td class="val" id="start_glyph_id">start_glyph_id</td><td class="desc">
+<p>The first glyph ID in the glyph range covered by this document.</p>
+</td></tr>
+<tr><td class="val" id="end_glyph_id">end_glyph_id</td><td class="desc">
+<p>The last glyph ID in the glyph range covered by this document.</p>
+</td></tr>
+<tr><td class="val" id="transform">transform</td><td class="desc">
+<p>A 2x2 transformation matrix to apply to the glyph while rendering it.</p>
+</td></tr>
+<tr><td class="val" id="delta">delta</td><td class="desc">
+<p>The translation to apply to the glyph while rendering.</p>
+</td></tr>
+</table>
+
+<h4>note</h4>
+
+<p>When an <code><a href="ft2-base_interface.html#ft_glyphslot">FT_GlyphSlot</a></code> object <code>slot</code> is passed down to a renderer, the renderer can only access the <code>metrics</code> and <code>units_per_EM</code> fields via <code>slot-&gt;face</code>. However, when <code><a href="ft2-glyph_management.html#ft_glyph_to_bitmap">FT_Glyph_To_Bitmap</a></code> sets up a dummy object, it has no way to set a <code>face</code> object. Thus, metrics information and <code>units_per_EM</code> (which is necessary for OT-SVG) has to be stored separately.</p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+<h2 id="ft_svg_document">FT_SVG_Document<a class="headerlink" href="#ft_svg_document" title="Permanent link">&para;</a></h2>
+<p>Defined in FT_OTSVG_H (freetype/otsvg.h).</p>
+<div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_SVG_DocumentRec_* <b>FT_SVG_Document</b>;
+
+
+FT_END_HEADER
+
+#<span class="keyword">endif</span> /* OTSVG_H_ */
+
+
+/* END */
+</code></pre></div>
+
+<p>A handle to an <code><a href="ft2-svg_fonts.html#ft_svg_documentrec">FT_SVG_DocumentRec</a></code> object.</p>
+<h4>since</h4>
+
+<p>2.12</p>
+<hr>
+
+
+
+
+
+
+
+ </article>
+ </div>
+ </div>
+
+ </main>
+
+
+<footer class="md-footer">
+
+ <nav class="md-footer__inner md-grid" aria-label="Footer">
+
+
+ <a href="ft2-winfnt_fonts.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: Window FNT Files" rel="prev">
+ <div class="md-footer__button md-icon">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
+ </div>
+ <div class="md-footer__title">
+ <div class="md-ellipsis">
+ <span class="md-footer__direction">
+ Previous
+ </span>
+ Window FNT Files
+ </div>
+ </div>
+ </a>
+
+
+
+ <a href="ft2-font_formats.html" class="md-footer__link md-footer__link--next" aria-label="Next: Font Formats" rel="next">
+ <div class="md-footer__title">
+ <div class="md-ellipsis">
+ <span class="md-footer__direction">
+ Next
+ </span>
+ Font Formats
+ </div>
+ </div>
+ <div class="md-footer__button md-icon">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
+ </div>
+ </a>
+
+ </nav>
+
+ <div class="md-footer-meta md-typeset">
+ <div class="md-footer-meta__inner md-grid">
+ <div class="md-footer-copyright">
+
+ <div class="md-footer-copyright__highlight">
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ </div>
+
+ Made with
+ <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
+ Material for MkDocs
+ </a>
+
+ </div>
+
+ </div>
+ </div>
+</footer>
+
+ </div>
+ <div class="md-dialog" data-md-component="dialog">
+ <div class="md-dialog__inner md-typeset"></div>
+ </div>
+ <script id="__config" type="application/json">{"base": ".", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "assets/javascripts/workers/search.477d984a.min.js", "version": null}</script>
+
+
+ <script src="assets/javascripts/bundle.82b56eb2.min.js"></script>
+
+ <script src="javascripts/extra.js"></script>
+
+
+ </body>
+</html> \ No newline at end of file
diff --git a/freetype/docs/reference/ft2-system_interface.html b/freetype/docs/reference/ft2-system_interface.html
index c6d07495..49e85501 100644
--- a/freetype/docs/reference/ft2-system_interface.html
+++ b/freetype/docs/reference/ft2-system_interface.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>System Interface - FreeType-2.11.1 API Reference</title>
+ <title>System Interface - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1587,7 +1611,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-t1_cid_driver.html b/freetype/docs/reference/ft2-t1_cid_driver.html
index 47857132..ee5a9a8e 100644
--- a/freetype/docs/reference/ft2-t1_cid_driver.html
+++ b/freetype/docs/reference/ft2-t1_cid_driver.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>The Type 1 and CID drivers - FreeType-2.11.1 API Reference</title>
+ <title>The Type 1 and CID drivers - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -698,6 +710,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1205,7 +1229,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-truetype_engine.html b/freetype/docs/reference/ft2-truetype_engine.html
index ad5ddaa8..47a14951 100644
--- a/freetype/docs/reference/ft2-truetype_engine.html
+++ b/freetype/docs/reference/ft2-truetype_engine.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>The TrueType Engine - FreeType-2.11.1 API Reference</title>
+ <title>The TrueType Engine - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -656,6 +668,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1280,7 +1304,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-truetype_tables.html b/freetype/docs/reference/ft2-truetype_tables.html
index 71c02f62..8992bc68 100644
--- a/freetype/docs/reference/ft2-truetype_tables.html
+++ b/freetype/docs/reference/ft2-truetype_tables.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>TrueType Tables - FreeType-2.11.1 API Reference</title>
+ <title>TrueType Tables - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -752,6 +752,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -866,6 +878,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -3185,7 +3209,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-tt_driver.html b/freetype/docs/reference/ft2-tt_driver.html
index 915bc432..493bbc42 100644
--- a/freetype/docs/reference/ft2-tt_driver.html
+++ b/freetype/docs/reference/ft2-tt_driver.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>The TrueType driver - FreeType-2.11.1 API Reference</title>
+ <title>The TrueType driver - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -542,6 +542,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -698,6 +710,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1144,10 +1168,9 @@
<hr />
<h1 id="the-truetype-driver">The TrueType driver<a class="headerlink" href="#the-truetype-driver" title="Permanent link">&para;</a></h1>
<h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">&para;</a></h2>
-<p>While FreeType's TrueType driver doesn't expose API functions by itself, it is possible to control its behaviour with <code><a href="ft2-module_management.html#ft_property_set">FT_Property_Set</a></code> and <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code>. The following lists the available properties together with the necessary macros and structures.</p>
-<p>The TrueType driver's module name is &lsquo;truetype&rsquo;.</p>
-<p>A single property <code><a href="ft2-properties.html#interpreter-version">interpreter-version</a></code> is available, as documented in the &lsquo;<a href="ft2-properties.html#properties">Driver properties</a>&rsquo; section.</p>
-<p>We start with a list of definitions, kindly provided by Greg Hitchcock.</p>
+<p>While FreeType's TrueType driver doesn't expose API functions by itself, it is possible to control its behaviour with <code><a href="ft2-module_management.html#ft_property_set">FT_Property_Set</a></code> and <code><a href="ft2-module_management.html#ft_property_get">FT_Property_Get</a></code>.</p>
+<p>The TrueType driver's module name is &lsquo;truetype&rsquo;; a single property <code><a href="ft2-properties.html#interpreter-version">interpreter-version</a></code> is available, as documented in the &lsquo;<a href="ft2-properties.html#properties">Driver properties</a>&rsquo; section.</p>
+<p>To help understand the differences between interpreter versions, we introduce a list of definitions, kindly provided by Greg Hitchcock.</p>
<p><em>Bi-Level Rendering</em></p>
<p>Monochromatic rendering, exclusively used in the early days of TrueType by both Apple and Microsoft. Microsoft's GDI interface supported hinting of the right-side bearing point, such that the advance width could be non-linear. Most often this was done to achieve some level of glyph symmetry. To enable reasonable performance (e.g., not having to run hinting on all glyphs just to get the widths) there was a bit in the head table indicating if the side bearing was hinted, and additional tables, &lsquo;hdmx&rsquo; and &lsquo;LTSH&rsquo;, to cache hinting widths across multiple sizes and device aspect ratios.</p>
<p><em>Font Smoothing</em></p>
@@ -1218,7 +1241,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-type1_tables.html b/freetype/docs/reference/ft2-type1_tables.html
index 459ece99..9dff3e67 100644
--- a/freetype/docs/reference/ft2-type1_tables.html
+++ b/freetype/docs/reference/ft2-type1_tables.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Type 1 Tables - FreeType-2.11.1 API Reference</title>
+ <title>Type 1 Tables - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -717,6 +717,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -831,6 +843,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1609,7 +1633,7 @@
<h4>output</h4>
<table class="fields">
<tr><td class="val" id="afont_info">afont_info</td><td class="desc">
-<p>Output font info structure pointer.</p>
+<p>A pointer to a <code><a href="ft2-type1_tables.html#ps_fontinforec">PS_FontInfoRec</a></code> object.</p>
</td></tr>
</table>
@@ -1619,7 +1643,14 @@
<h4>note</h4>
<p>String pointers within the <code><a href="ft2-type1_tables.html#ps_fontinforec">PS_FontInfoRec</a></code> structure are owned by the face and don't need to be freed by the caller. Missing entries in the font's FontInfo dictionary are represented by <code>NULL</code> pointers.</p>
-<p>If the font's format is not PostScript-based, this function will return the <code>FT_Err_Invalid_Argument</code> error code.</p>
+<p>The following font formats support this feature: &lsquo;Type&nbsp;1&rsquo;, &lsquo;Type&nbsp;42&rsquo;, &lsquo;CFF&rsquo;, &lsquo;CID&nbsp;Type&nbsp;1&rsquo;. For other font formats this function returns the <code>FT_Err_Invalid_Argument</code> error code.</p>
+<h4>example</h4>
+<div class="highlight"><pre><span></span><code> PS_FontInfoRec font_info;
+
+
+ error = FT_Get_PS_Font_Info( face, &amp;font_info );
+ ...
+</code></pre></div>
<hr>
<h2 id="ft_get_ps_font_private">FT_Get_PS_Font_Private<a class="headerlink" href="#ft_get_ps_font_private" title="Permanent link">&para;</a></h2>
@@ -1640,7 +1671,7 @@
<h4>output</h4>
<table class="fields">
<tr><td class="val" id="afont_private">afont_private</td><td class="desc">
-<p>Output private dictionary structure pointer.</p>
+<p>A pointer to a <code><a href="ft2-type1_tables.html#ps_privaterec">PS_PrivateRec</a></code> object.</p>
</td></tr>
</table>
@@ -1650,7 +1681,14 @@
<h4>note</h4>
<p>The string pointers within the <code><a href="ft2-type1_tables.html#ps_privaterec">PS_PrivateRec</a></code> structure are owned by the face and don't need to be freed by the caller.</p>
-<p>If the font's format is not PostScript-based, this function returns the <code>FT_Err_Invalid_Argument</code> error code.</p>
+<p>Only the &lsquo;Type&nbsp;1&rsquo; font format supports this feature. For other font formats this function returns the <code>FT_Err_Invalid_Argument</code> error code.</p>
+<h4>example</h4>
+<div class="highlight"><pre><span></span><code> PS_PrivateRec font_private;
+
+
+ error = FT_Get_PS_Font_Private( face, &amp;font_private );
+ ...
+</code></pre></div>
<hr>
<h2 id="ft_get_ps_font_value">FT_Get_PS_Font_Value<a class="headerlink" href="#ft_get_ps_font_value" title="Permanent link">&para;</a></h2>
@@ -2136,7 +2174,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-user_allocation.html b/freetype/docs/reference/ft2-user_allocation.html
index 5c534f9d..f9b9cb17 100644
--- a/freetype/docs/reference/ft2-user_allocation.html
+++ b/freetype/docs/reference/ft2-user_allocation.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>User allocation - FreeType-2.11.1 API Reference</title>
+ <title>User allocation - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -584,6 +584,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -698,6 +710,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1201,7 +1225,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-version.html b/freetype/docs/reference/ft2-version.html
index 5bd973c9..6e7e9868 100644
--- a/freetype/docs/reference/ft2-version.html
+++ b/freetype/docs/reference/ft2-version.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>FreeType Version - FreeType-2.11.1 API Reference</title>
+ <title>FreeType Version - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -612,6 +612,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -726,6 +738,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1294,7 +1318,7 @@
<h2 id="freetype_xxx">FREETYPE_XXX<a class="headerlink" href="#freetype_xxx" title="Permanent link">&para;</a></h2>
<p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
<div class = "codehilite"><pre><code>#<span class="keyword">define</span> <a href="ft2-version.html#freetype_major">FREETYPE_MAJOR</a> 2
-#<span class="keyword">define</span> <a href="ft2-version.html#freetype_minor">FREETYPE_MINOR</a> 11
+#<span class="keyword">define</span> <a href="ft2-version.html#freetype_minor">FREETYPE_MINOR</a> 12
#<span class="keyword">define</span> <a href="ft2-version.html#freetype_patch">FREETYPE_PATCH</a> 1
</code></pre></div>
@@ -1372,7 +1396,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/ft2-winfnt_fonts.html b/freetype/docs/reference/ft2-winfnt_fonts.html
index 91b57f22..0502b8a8 100644
--- a/freetype/docs/reference/ft2-winfnt_fonts.html
+++ b/freetype/docs/reference/ft2-winfnt_fonts.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>Window FNT Files - FreeType-2.11.1 API Reference</title>
+ <title>Window FNT Files - FreeType-2.12.1 API Reference</title>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -612,6 +612,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -726,6 +738,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1413,13 +1437,13 @@
- <a href="ft2-font_formats.html" class="md-footer__link md-footer__link--next" aria-label="Next: Font Formats" rel="next">
+ <a href="ft2-svg_fonts.html" class="md-footer__link md-footer__link--next" aria-label="Next: OpenType SVG Fonts" rel="next">
<div class="md-footer__title">
<div class="md-ellipsis">
<span class="md-footer__direction">
Next
</span>
- Font Formats
+ OpenType SVG Fonts
</div>
</div>
<div class="md-footer__button md-icon">
@@ -1434,7 +1458,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/index.html b/freetype/docs/reference/index.html
index 3d84b130..85511eda 100644
--- a/freetype/docs/reference/index.html
+++ b/freetype/docs/reference/index.html
@@ -6,7 +6,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
- <meta name="description" content="API Reference Documentation for FreeType-2.11.1">
+ <meta name="description" content="API Reference Documentation for FreeType-2.12.1">
@@ -18,7 +18,7 @@
- <title>FreeType-2.11.1 API Reference</title>
+ <title>FreeType-2.12.1 API Reference</title>
@@ -71,7 +71,7 @@
<div data-md-component="skip">
- <a href="#freetype-2111-api-reference" class="md-skip">
+ <a href="#freetype-2121-api-reference" class="md-skip">
Skip to content
</a>
@@ -82,7 +82,7 @@
<header class="md-header" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
@@ -94,7 +94,7 @@
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
@@ -161,12 +161,12 @@
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
- <a href="index.html" title="FreeType-2.11.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.1 API Reference" data-md-component="logo">
+ <a href="index.html" title="FreeType-2.12.1 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.12.1 API Reference" data-md-component="logo">
<img src="images/favico.ico" alt="logo">
</a>
- FreeType-2.11.1 API Reference
+ FreeType-2.12.1 API Reference
</label>
<ul class="md-nav__list" data-md-scrollfix>
@@ -552,6 +552,18 @@
<li class="md-nav__item">
+ <a href="ft2-svg_fonts.html" class="md-nav__link">
+ OpenType SVG Fonts
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-font_formats.html" class="md-nav__link">
Font Formats
</a>
@@ -666,6 +678,18 @@
<li class="md-nav__item">
+ <a href="ft2-ot_svg_driver.html" class="md-nav__link">
+ The SVG driver
+ </a>
+ </li>
+
+
+
+
+
+
+
+ <li class="md-nav__item">
<a href="ft2-properties.html" class="md-nav__link">
Driver properties
</a>
@@ -1095,7 +1119,7 @@
<p><a href="https://www.freetype.org">FreeType</a> &raquo; <a href="../">Docs</a> &raquo; Table of Contents</p>
<hr />
-<h1 id="freetype-2111-api-reference">FreeType-2.11.1 API Reference<a class="headerlink" href="#freetype-2111-api-reference" title="Permanent link">&para;</a></h1>
+<h1 id="freetype-2121-api-reference">FreeType-2.12.1 API Reference<a class="headerlink" href="#freetype-2121-api-reference" title="Permanent link">&para;</a></h1>
<h1 id="table-of-contents">Table of Contents<a class="headerlink" href="#table-of-contents" title="Permanent link">&para;</a></h1>
<h2 id="general-remarks">General Remarks<a class="headerlink" href="#general-remarks" title="Permanent link">&para;</a></h2>
<table class="toc">
@@ -1168,6 +1192,9 @@
<tr><td class="link"><a href="ft2-winfnt_fonts.html">Window FNT Files</a></td><td class="desc">
<p>Windows FNT-specific API.</p>
</td></tr>
+<tr><td class="link"><a href="ft2-svg_fonts.html">OpenType SVG Fonts</a></td><td class="desc">
+<p>OT-SVG API between FreeType and an external SVG rendering library.</p>
+</td></tr>
<tr><td class="link"><a href="ft2-font_formats.html">Font Formats</a></td><td class="desc">
<p>Getting the font format.</p>
</td></tr>
@@ -1192,6 +1219,9 @@
<tr><td class="link"><a href="ft2-pcf_driver.html">The PCF driver</a></td><td class="desc">
<p>Controlling the PCF driver module.</p>
</td></tr>
+<tr><td class="link"><a href="ft2-ot_svg_driver.html">The SVG driver</a></td><td class="desc">
+<p>Controlling the external rendering of OT-SVG glyphs.</p>
+</td></tr>
<tr><td class="link"><a href="ft2-properties.html">Driver properties</a></td><td class="desc">
<p>Controlling driver modules.</p>
</td></tr>
@@ -1276,7 +1306,7 @@
</table>
<h2 id="global-index"><a href="ft2-index.html">Global Index</a><a class="headerlink" href="#global-index" title="Permanent link">&para;</a></h2>
<hr />
-<div class="timestamp">generated on Thu Dec 2 12:36:11 2021 UTC</div>
+<div class="timestamp">generated on Sun May 1 05:24:59 2022 UTC</div>
@@ -1318,7 +1348,7 @@
<div class="md-footer-copyright">
<div class="md-footer-copyright__highlight">
- Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
+ Copyright 2022 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
</div>
Made with
diff --git a/freetype/docs/reference/search/search_index.json b/freetype/docs/reference/search/search_index.json
index fb54b4e0..851342c9 100644
--- a/freetype/docs/reference/search/search_index.json
+++ b/freetype/docs/reference/search/search_index.json
@@ -1 +1 @@
-{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"index.html","text":"FreeType \u00bb Docs \u00bb Table of Contents FreeType-2.11.1 API Reference \u00b6 Table of Contents \u00b6 General Remarks \u00b6 Preamble What FreeType is and isn't FreeType's header inclusion scheme How client applications should include FreeType header files. User allocation How client applications should allocate FreeType data structures. Core API \u00b6 FreeType Version Functions and macros related to FreeType versions. Basic Data Types The basic data types defined by the library. Base Interface The FreeType 2 base font interface. Unicode Variation Sequences The FreeType 2 interface to Unicode Variation Sequences (UVS), using the SFNT cmap format 14. Glyph Color Management Retrieving and manipulating OpenType's \u2018CPAL\u2019 table data. Glyph Layer Management Retrieving and manipulating OpenType's \u2018COLR\u2019 table data. Glyph Management Generic interface to manage individual glyph data. Mac Specific Interface Only available on the Macintosh. Size Management Managing multiple sizes per face. Header File Macros Macro definitions used to #include specific header files. Format-Specific API \u00b6 Multiple Masters How to manage Multiple Masters fonts. TrueType Tables TrueType-specific table types and functions. Type 1 Tables Type 1-specific font tables. SFNT Names Access the names embedded in TrueType and OpenType files. BDF and PCF Files BDF and PCF specific API. CID Fonts CID-keyed font-specific API. PFR Fonts PFR/TrueDoc-specific API. Window FNT Files Windows FNT-specific API. Font Formats Getting the font format. Gasp Table Retrieving TrueType \u2018gasp\u2019 table entries. Controlling FreeType Modules \u00b6 The auto-hinter Controlling the auto-hinting module. The CFF driver Controlling the CFF driver module. The Type 1 and CID drivers Controlling the Type 1 and CID driver modules. The TrueType driver Controlling the TrueType driver module. The PCF driver Controlling the PCF driver module. Driver properties Controlling driver modules. Parameter Tags Macros for driver property and font loading parameter tags. Subpixel Rendering API to control subpixel rendering. Cache Sub-System \u00b6 Cache Sub-System How to cache face, size, and glyph data with FreeType 2. Support API \u00b6 Computations Crunching fixed numbers and vectors. List Processing Simple management of lists. Outline Processing Functions to create, transform, and render vectorial glyph images. Quick retrieval of advance values Retrieve horizontal and vertical advance values without processing glyph outlines, if possible. Bitmap Handling Handling FT_Bitmap objects. Scanline Converter How vectorial outlines are converted into bitmaps and pixmaps. Glyph Stroker Generating bordered and stroked glyphs. System Interface How FreeType manages memory and i/o. Module Management How to add, upgrade, remove, and control modules from FreeType. GZIP Streams Using gzip-compressed font files. LZW Streams Using LZW-compressed font files. BZIP2 Streams Using bzip2-compressed font files. External Debugging APIs Public APIs to control the FT_DEBUG_LOGGING macro. Error Codes \u00b6 Error Enumerations How to handle errors and error strings. Error Code Values All possible error codes returned by FreeType functions. Miscellaneous \u00b6 TrueTypeGX/AAT Validation An API to validate TrueTypeGX/AAT tables. Incremental Loading Custom Glyph Loading. The TrueType Engine TrueType bytecode support. OpenType Validation An API to validate OpenType tables. Global Index \u00b6 generated on Thu Dec 2 12:36:11 2021 UTC","title":"TOC"},{"location":"index.html#freetype-2111-api-reference","text":"","title":"FreeType-2.11.1 API Reference"},{"location":"index.html#table-of-contents","text":"","title":"Table of Contents"},{"location":"index.html#general-remarks","text":"Preamble What FreeType is and isn't FreeType's header inclusion scheme How client applications should include FreeType header files. User allocation How client applications should allocate FreeType data structures.","title":"General Remarks"},{"location":"index.html#core-api","text":"FreeType Version Functions and macros related to FreeType versions. Basic Data Types The basic data types defined by the library. Base Interface The FreeType 2 base font interface. Unicode Variation Sequences The FreeType 2 interface to Unicode Variation Sequences (UVS), using the SFNT cmap format 14. Glyph Color Management Retrieving and manipulating OpenType's \u2018CPAL\u2019 table data. Glyph Layer Management Retrieving and manipulating OpenType's \u2018COLR\u2019 table data. Glyph Management Generic interface to manage individual glyph data. Mac Specific Interface Only available on the Macintosh. Size Management Managing multiple sizes per face. Header File Macros Macro definitions used to #include specific header files.","title":"Core API"},{"location":"index.html#format-specific-api","text":"Multiple Masters How to manage Multiple Masters fonts. TrueType Tables TrueType-specific table types and functions. Type 1 Tables Type 1-specific font tables. SFNT Names Access the names embedded in TrueType and OpenType files. BDF and PCF Files BDF and PCF specific API. CID Fonts CID-keyed font-specific API. PFR Fonts PFR/TrueDoc-specific API. Window FNT Files Windows FNT-specific API. Font Formats Getting the font format. Gasp Table Retrieving TrueType \u2018gasp\u2019 table entries.","title":"Format-Specific API"},{"location":"index.html#controlling-freetype-modules","text":"The auto-hinter Controlling the auto-hinting module. The CFF driver Controlling the CFF driver module. The Type 1 and CID drivers Controlling the Type 1 and CID driver modules. The TrueType driver Controlling the TrueType driver module. The PCF driver Controlling the PCF driver module. Driver properties Controlling driver modules. Parameter Tags Macros for driver property and font loading parameter tags. Subpixel Rendering API to control subpixel rendering.","title":"Controlling FreeType Modules"},{"location":"index.html#cache-sub-system","text":"Cache Sub-System How to cache face, size, and glyph data with FreeType 2.","title":"Cache Sub-System"},{"location":"index.html#support-api","text":"Computations Crunching fixed numbers and vectors. List Processing Simple management of lists. Outline Processing Functions to create, transform, and render vectorial glyph images. Quick retrieval of advance values Retrieve horizontal and vertical advance values without processing glyph outlines, if possible. Bitmap Handling Handling FT_Bitmap objects. Scanline Converter How vectorial outlines are converted into bitmaps and pixmaps. Glyph Stroker Generating bordered and stroked glyphs. System Interface How FreeType manages memory and i/o. Module Management How to add, upgrade, remove, and control modules from FreeType. GZIP Streams Using gzip-compressed font files. LZW Streams Using LZW-compressed font files. BZIP2 Streams Using bzip2-compressed font files. External Debugging APIs Public APIs to control the FT_DEBUG_LOGGING macro.","title":"Support API"},{"location":"index.html#error-codes","text":"Error Enumerations How to handle errors and error strings. Error Code Values All possible error codes returned by FreeType functions.","title":"Error Codes"},{"location":"index.html#miscellaneous","text":"TrueTypeGX/AAT Validation An API to validate TrueTypeGX/AAT tables. Incremental Loading Custom Glyph Loading. The TrueType Engine TrueType bytecode support. OpenType Validation An API to validate OpenType tables.","title":"Miscellaneous"},{"location":"index.html#global-index","text":"generated on Thu Dec 2 12:36:11 2021 UTC","title":"Global Index"},{"location":"ft2-auto_hinter.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The auto-hinter The auto-hinter \u00b6 Synopsis \u00b6 While FreeType's auto-hinter doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The following lists the available properties together with the necessary macros and structures. Note that the auto-hinter's module name is \u2018autofitter\u2019 for historical reasons. Available properties are increase-x-height , no-stem-darkening (experimental), darkening-parameters (experimental), glyph-to-script-map (experimental), fallback-script (experimental), and default-script (experimental), as documented in the \u2018 Driver properties \u2019 section.","title":"The auto-hinter"},{"location":"ft2-auto_hinter.html#the-auto-hinter","text":"","title":"The auto-hinter"},{"location":"ft2-auto_hinter.html#synopsis","text":"While FreeType's auto-hinter doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The following lists the available properties together with the necessary macros and structures. Note that the auto-hinter's module name is \u2018autofitter\u2019 for historical reasons. Available properties are increase-x-height , no-stem-darkening (experimental), darkening-parameters (experimental), glyph-to-script-map (experimental), fallback-script (experimental), and default-script (experimental), as documented in the \u2018 Driver properties \u2019 section.","title":"Synopsis"},{"location":"ft2-base_interface.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Base Interface Base Interface \u00b6 Synopsis \u00b6 This section describes the most important public high-level API functions of FreeType 2. FT_Library \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_LibraryRec_ * FT_Library ; A handle to a FreeType library instance. Each \u2018library\u2019 is completely independent from the others; it is the \u2018root\u2019 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 ). [Since 2.5.6] In multi-threaded applications it is easiest to use one FT_Library object per thread. In case this is too cumbersome, a single FT_Library object across threads is possible also, as long as a mutex lock is used around FT_New_Face and FT_Done_Face . note Library objects are normally created by FT_Init_FreeType , and destroyed with FT_Done_FreeType . If you need reference-counting (cf. FT_Reference_Library ), use FT_New_Library and FT_Done_Library . FT_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_FaceRec_* FT_Face ; A handle to a typographic face object. A face object models a given typeface, in a given style. note A 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 filepath or a custom input stream. Use FT_Done_Face to destroy it (along with its slot and sizes). An FT_Face object can only be safely used from one thread at a time. Similarly, creation and destruction of FT_Face with the same FT_Library object can only be done from one thread at a time. On the other hand, functions like FT_Load_Glyph and its siblings are thread-safe and do not need the lock to be held as long as the same FT_Face object is not used from multiple threads at the same time. also See FT_FaceRec for the publicly accessible fields of a given face object. FT_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_SizeRec_* FT_Size ; A handle to an object that models a face scaled to a given character size. note An FT_Face has one active FT_Size object that is used by functions like FT_Load_Glyph to determine the scaling transformation that in turn is used to load and hint glyphs and metrics. You can use FT_Set_Char_Size , FT_Set_Pixel_Sizes , FT_Request_Size or even FT_Select_Size to change the content (i.e., the scaling values) of the active FT_Size . You can use FT_New_Size to create additional size objects for a given FT_Face , but they won't be used by other functions until you activate it through FT_Activate_Size . Only one size can be activated at any given time per face. also See FT_SizeRec for the publicly accessible fields of a given size object. FT_GlyphSlot \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_GlyphSlotRec_* FT_GlyphSlot ; A handle to a given \u2018glyph slot\u2019. A slot is a container that can hold any 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 See FT_GlyphSlotRec for the publicly accessible glyph fields. FT_CharMap \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_CharMapRec_* FT_CharMap ; A handle to a character map (usually abbreviated to \u2018charmap\u2019). 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 \u2018active\u2019, providing the data 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. If there is no Unicode charmap, FreeType doesn't set an \u2018active\u2019 charmap. also See FT_CharMapRec for the publicly accessible fields of a given character map. FT_Encoding \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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_SJIS , 's', 'j', 'i', 's' ), FT_ENC_TAG ( FT_ENCODING_PRC , 'g', 'b', ' ', ' ' ), FT_ENC_TAG ( FT_ENCODING_BIG5 , 'b', 'i', 'g', '5' ), FT_ENC_TAG ( FT_ENCODING_WANSUNG , 'w', 'a', 'n', 's' ), FT_ENC_TAG ( FT_ENCODING_JOHAB , 'j', 'o', 'h', 'a' ), /* for backward compatibility */ FT_ENCODING_GB2312 = FT_ENCODING_PRC , FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS , FT_ENCODING_MS_GB2312 = FT_ENCODING_PRC , FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5 , FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG , FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB , 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 ; /* these constants are deprecated; use the corresponding ` FT_Encoding ` */ /* values instead */ # 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_SJIS # define ft_encoding_gb2312 FT_ENCODING_PRC # define ft_encoding_big5 FT_ENCODING_BIG5 # define ft_encoding_wansung FT_ENCODING_WANSUNG # define ft_encoding_johab FT_ENCODING_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 An enumeration to specify character sets supported by charmaps. Used in the FT_Select_Charmap API function. note Despite the name, this enumeration lists specific character repertories (i.e., charsets), and not text encoding methods (e.g., UTF-8, UTF-16, etc.). Other encodings might be defined in the future. values FT_ENCODING_NONE The encoding value 0 is reserved for all formats except BDF, PCF, and Windows FNT; see below for more information. FT_ENCODING_UNICODE 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. For example, if you want to access Unicode value U+1F028 (and the font contains it), use value 0x1F028 as the input value for FT_Get_Char_Index . FT_ENCODING_MS_SYMBOL Microsoft Symbol encoding, used to encode mathematical symbols and wingdings. For more information, see \u2018 https://www.microsoft.com/typography/otspec/recom.htm#non-standard-symbol-fonts \u2019, \u2018 http://www.kostis.net/charsets/symbol.htm \u2019, and \u2018 http://www.kostis.net/charsets/wingding.htm \u2019. This encoding uses character codes from the PUA (Private Unicode Area) in the range U+F020-U+F0FF. FT_ENCODING_SJIS Shift JIS encoding for Japanese. More info at \u2018 https://en.wikipedia.org/wiki/Shift_JIS \u2019. See note on multi-byte encodings below. FT_ENCODING_PRC Corresponds to encoding systems mainly for Simplified Chinese as used in People's Republic of China (PRC). The encoding layout is based on GB 2312 and its supersets GBK and GB 18030. FT_ENCODING_BIG5 Corresponds to an encoding system for Traditional Chinese as used in Taiwan and Hong Kong. FT_ENCODING_WANSUNG Corresponds to the Korean encoding system known as Extended Wansung (MS Windows code page 949). For more information see \u2018 https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit949.txt \u2019. FT_ENCODING_JOHAB The Korean standard character set (KS C 5601-1992), which corresponds to MS Windows code page 1361. This character set includes all possible Hangul character combinations. 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 Adobe Standard encoding, as found in Type 1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes. FT_ENCODING_ADOBE_EXPERT 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 Apple roman encoding. Many TrueType and OpenType fonts contain a charmap for this 8-bit encoding, since older versions of Mac OS are able to use it. FT_ENCODING_OLD_LATIN_2 This value is deprecated and was neither used nor reported by FreeType. Don't use or test for it. FT_ENCODING_MS_SJIS Same as FT_ENCODING_SJIS. Deprecated. FT_ENCODING_MS_GB2312 Same as FT_ENCODING_PRC. Deprecated. FT_ENCODING_MS_BIG5 Same as FT_ENCODING_BIG5. Deprecated. FT_ENCODING_MS_WANSUNG Same as FT_ENCODING_WANSUNG. Deprecated. FT_ENCODING_MS_JOHAB Same as FT_ENCODING_JOHAB. Deprecated. note When loading a font, FreeType makes a Unicode charmap active if possible (either if the font provides such a charmap, or if FreeType can synthesize one from PostScript glyph name dictionaries; in either case, the charmap is tagged with FT_ENCODING_UNICODE ). If such a charmap is synthesized, it is placed at the first position of the charmap array. All other encodings are considered legacy and tagged only if explicitly defined in the font file. Otherwise, FT_ENCODING_NONE is used. FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap is neither Unicode nor ISO-8859-1 (otherwise it is set to FT_ENCODING_UNICODE ). Use FT_Get_BDF_Charset_ID to find out which encoding is really present. If, for example, the cs_registry field is \u2018KOI8\u2019 and the cs_encoding field is \u2018R\u2019, the font is encoded in KOI8-R. FT_ENCODING_NONE is always set (with a single exception) by the winfonts driver. Use FT_Get_WinFNT_Header and examine the charset field of the FT_WinFNT_HeaderRec structure to find out which encoding is really present. For example, FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for Russian). FT_ENCODING_NONE is set if platform_id is TT_PLATFORM_MACINTOSH and encoding_id is not TT_MAC_ID_ROMAN (otherwise it is set to FT_ENCODING_APPLE_ROMAN ). If platform_id is TT_PLATFORM_MACINTOSH , use the function FT_Get_CMap_Language_ID to query the Mac language ID that may be needed to be able to distinguish Apple encoding variants. See https://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt to get an idea how to do that. Basically, if the language ID is 0, don't use it, otherwise subtract 1 from the language ID. Then examine encoding_id . If, for example, encoding_id is TT_MAC_ID_ROMAN and the language ID (minus 1) is TT_MAC_LANGID_GREEK , it is the Greek encoding, not Roman. TT_MAC_ID_ARABIC with TT_MAC_LANGID_FARSI means the Farsi variant the Arabic encoding. FT_ENC_TAG \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # ifndef FT_ENC_TAG # define FT_ENC_TAG ( value, a, b, c, d ) \\ value = ( ( FT_STATIC_BYTE_CAST( FT_UInt32 , a ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( FT_UInt32 , b ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( FT_UInt32 , c ) << 8 ) | \\ FT_STATIC_BYTE_CAST( FT_UInt32 , d ) ) # endif /* FT_ENC_TAG */ This macro converts four-letter tags into an unsigned long. It is used to define \u2018encoding\u2019 identifiers (see FT_Encoding ). note Since many 16-bit compilers don't like 32-bit 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. FT_FaceRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 member variables (down to `underline_thickness`) */ /*# are only relevant to scalable outlines; cf. @ FT_Bitmap_Size */ /*# for bitmap fonts. */ 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; /* face-specific auto-hinter data */ void * extensions; /* unused */ FT_Face_Internal internal; /*@private end */ } FT_FaceRec ; FreeType root face class structure. A face object models a typeface in a font file. fields num_faces The number of faces in the font file. Some font formats can have multiple faces in a single font file. face_index This field holds two different values. Bits 0-15 are the index of the face in the font file (starting with value 0). They are set to 0 if there is only one face in the font file. [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation fonts only, holding the named instance index for the current face index (starting with value 1; value 0 indicates font access without a named instance). For non-variation fonts, bits 16-30 are ignored. If we have the third named instance of face 4, say, face_index is set to 0x00030004. Bit 31 is always zero (this is, face_index is always a positive value). [Since 2.9] Changing the design coordinates with FT_Set_Var_Design_Coordinates or FT_Set_Var_Blend_Coordinates does not influence the named instance index value (only FT_Set_Named_Instance does that). face_flags A set of bit flags that give important information about the face; see FT_FACE_FLAG_XXX for the details. style_flags The lower 16 bits contain a set of bit flags indicating the style of the face; see FT_STYLE_FLAG_XXX for the details. [Since 2.6.1] Bits 16-30 hold the number of named instances available for the current face if we have a GX or OpenType variation (sub)font. Bit 31 is always zero (this is, style_flags is always a positive value). Note that a variation font has always at least one named instance, namely the default instance. num_glyphs The number of glyphs in the face. If the face is scalable and has sbits (see num_fixed_sizes ), it is set to the number of outline glyphs. For CID-keyed fonts (not in an SFNT wrapper) this value gives the highest CID used in the font. family_name The face's family name. This is an ASCII string, usually in English, that describes the typeface's family (like \u2018Times New Roman\u2019, \u2018Bodoni\u2019, \u2018Garamond\u2019, 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. Can be NULL (e.g., in fonts embedded in a PDF file). In case the font doesn't provide a specific family name entry, FreeType tries to synthesize one, deriving it from other name entries. style_name The face's style name. This is an ASCII string, usually in English, that describes the typeface's style (like \u2018Italic\u2019, \u2018Bold\u2019, \u2018Condensed\u2019, 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 and Unicode versions of this string. Applications should use the format-specific interface to access them. num_fixed_sizes The number of bitmap strikes in the face. Even if the face is scalable, there might still be bitmap strikes, which are called \u2018sbits\u2019 in that case. available_sizes An array of FT_Bitmap_Size for all bitmap strikes in the face. It is set to NULL if there is no bitmap strike. Note that FreeType tries to sanitize the strike data since they are sometimes sloppy or incorrect, but this can easily fail. num_charmaps The number of charmaps in the face. charmaps An array of the charmaps of the face. 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 \u2018maximum ascender\u2019, and bbox.yMin as the \u2018minimum descender\u2019. Only relevant for scalable formats. Note that the bounding box might be off by (at least) one pixel for hinted fonts. See FT_Size_Metrics for further discussion. Note that the bounding box does not vary in OpenType variable fonts and should only be used in relation to the default instance. units_per_EM The number of font units per EM square for this face. This is typically 2048 for TrueType fonts, and 1000 for Type 1 fonts. Only relevant for scalable formats. ascender The typographic ascender of the face, expressed in font units. For font formats not having this information, it is set to bbox.yMax . Only relevant for scalable formats. descender The typographic descender of the face, expressed in font units. For font formats not having this information, it is set to bbox.yMin . Note that this field is negative for values below the baseline. Only relevant for scalable formats. height This value is the vertical distance between two consecutive baselines, expressed in font units. It is always positive. Only relevant for scalable formats. If you want the global glyph height, use ascender - descender . max_advance_width The maximum 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 maximum advance height, in font units, for all glyphs in this face. This is only relevant for vertical layouts, and is set to 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 is 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). size The current active size for this face. charmap The current active charmap for this face. note Fields may be changed after a call to FT_Attach_File or FT_Attach_Stream . For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: ascender , descender , height , underline_position , and underline_thickness . Especially for TrueType fonts see also the documentation for FT_Size_Metrics . FT_HAS_HORIZONTAL \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_HORIZONTAL ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL ) ) 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. FT_HAS_VERTICAL \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_VERTICAL ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_VERTICAL ) ) A macro that returns true whenever a face object contains real vertical metrics (and not only synthesized ones). FT_HAS_KERNING \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_KERNING ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_KERNING ) ) A macro that returns true whenever a face object contains kerning data that can be accessed with FT_Get_Kerning . FT_HAS_FIXED_SIZES \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_FIXED_SIZES ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) ) A macro that returns true whenever a face object contains some embedded bitmaps. See the available_sizes field of the FT_FaceRec structure. FT_HAS_GLYPH_NAMES \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_GLYPH_NAMES ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) ) A macro that returns true whenever a face object contains some glyph names that can be accessed through FT_Get_Glyph_Name . FT_HAS_COLOR \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_COLOR ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_COLOR ) ) A macro that returns true whenever a face object contains tables for color glyphs. since 2.5.1 FT_HAS_MULTIPLE_MASTERS \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_MULTIPLE_MASTERS ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) ) 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. FT_IS_SFNT \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_SFNT ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SFNT ) ) 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. FT_IS_SCALABLE \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_SCALABLE ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SCALABLE ) ) A macro that returns true whenever a face object contains a scalable font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF, and PFR font formats). FT_IS_FIXED_WIDTH \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_FIXED_WIDTH ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) ) A macro that returns true whenever a face object contains a font face that contains fixed-width (or \u2018monospace\u2019, \u2018fixed-pitch\u2019, etc.) glyphs. FT_IS_CID_KEYED \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_CID_KEYED ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_CID_KEYED ) ) A macro that returns true whenever a face object contains a CID-keyed font. See the discussion of FT_FACE_FLAG_CID_KEYED for more details. If this macro is true, all functions defined in FT_CID_H are available. FT_IS_TRICKY \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_TRICKY ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_TRICKY ) ) A macro that returns true whenever a face represents a \u2018tricky\u2019 font. See the discussion of FT_FACE_FLAG_TRICKY for more details. FT_IS_NAMED_INSTANCE \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_NAMED_INSTANCE ( face ) \\ ( !!( (face)->face_index & 0x7FFF0000L ) ) A macro that returns true whenever a face object is a named instance of a GX or OpenType variation font. [Since 2.9] Changing the design coordinates with FT_Set_Var_Design_Coordinates or FT_Set_Var_Blend_Coordinates does not influence the return value of this macro (only FT_Set_Named_Instance does that). since 2.7 FT_IS_VARIATION \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_VARIATION ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_VARIATION ) ) A macro that returns true whenever a face object has been altered by FT_Set_MM_Design_Coordinates , FT_Set_Var_Design_Coordinates , or FT_Set_Var_Blend_Coordinates . since 2.9 FT_SizeRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ; FreeType root size class structure. A size object models a face object at a given size. fields face Handle to the parent face object. generic A typeless pointer, 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. FT_Size_Metrics \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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; /* scaling values used to convert font */ FT_Fixed y_scale; /* units to 26.6 fractional pixels */ 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 ; The size metrics structure gives the metrics of a size object. fields x_ppem The width of the scaled EM square in pixels, hence the term \u2018ppem\u2019 (pixels per EM). It is also referred to as \u2018nominal width\u2019. y_ppem The height of the scaled EM square in pixels, hence the term \u2018ppem\u2019 (pixels per EM). It is also referred to as \u2018nominal height\u2019. x_scale A 16.16 fractional scaling value to convert horizontal metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats. y_scale A 16.16 fractional scaling value to convert vertical metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats. ascender The ascender in 26.6 fractional pixels, rounded up to an integer value. See FT_FaceRec for the details. descender The descender in 26.6 fractional pixels, rounded down to an integer value. See FT_FaceRec for the details. height The height in 26.6 fractional pixels, rounded to an integer value. See FT_FaceRec for the details. max_advance The maximum advance width in 26.6 fractional pixels, rounded to an integer value. See FT_FaceRec for the details. note The scaling values, if relevant, are determined first during a size changing operation. The remaining fields are then set by the driver. For scalable formats, they are usually set to scaled values of the corresponding fields in FT_FaceRec . Some values like ascender or descender are rounded for historical reasons; more precise values (for outline fonts) can be derived by scaling the corresponding FT_FaceRec values manually, with code similar to the following. scaled_ascender = FT_MulFix( face->ascender, size_metrics->y_scale ); Note that due to glyph hinting and the selected rendering mode these values are usually not exact; consequently, they must be treated as unreliable with an error margin of at least one pixel! Indeed, the only way to get the exact metrics is to render all glyphs. As this would be a definite performance hit, it is up to client applications to perform such computations. The FT_Size_Metrics structure is valid for bitmap fonts also. TrueType fonts with native bytecode hinting All applications that handle TrueType fonts with native hinting must be aware that TTFs expect different rounding of vertical font dimensions. The application has to cater for this, especially if it wants to rely on a TTF's vertical data (for example, to properly align box characters vertically). Only the application knows in advance that it is going to use native hinting for TTFs! FreeType, on the other hand, selects the hinting mode not at the time of creating an FT_Size object but much later, namely while calling FT_Load_Glyph . Here is some pseudo code that illustrates a possible solution. font_format = FT_Get_Font_Format( face ); if ( !strcmp( font_format, \"TrueType\" ) && do_native_bytecode_hinting ) { ascender = ROUND( FT_MulFix( face->ascender, size_metrics->y_scale ) ); descender = ROUND( FT_MulFix( face->descender, size_metrics->y_scale ) ); } else { ascender = size_metrics->ascender; descender = size_metrics->descender; } height = size_metrics->height; max_advance = size_metrics->max_advance; FT_GlyphSlotRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_GlyphSlotRec_ { FT_Library library; FT_Face face; FT_GlyphSlot next; FT_UInt glyph_index; /* new in 2.10; was reserved previously */ 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; FT_Pos lsb_delta; FT_Pos rsb_delta; void * other; FT_Slot_Internal internal; } FT_GlyphSlotRec ; FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format. 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. glyph_index [Since 2.10] The glyph index passed as an argument to FT_Load_Glyph while initializing the glyph slot. generic A typeless pointer 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 The advance width of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless FT_LOAD_LINEAR_DESIGN is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs. linearVertAdvance The advance height of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless FT_LOAD_LINEAR_DESIGN is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs. advance This shorthand is, depending on FT_LOAD_IGNORE_TRANSFORM , the transformed (hinted) advance width for the glyph, in 26.6 fractional pixel format. As specified with FT_LOAD_VERTICAL_LAYOUT , it uses either the horiAdvance or the vertAdvance value of metrics field. format This field indicates the format of the image contained in the glyph slot. Typically FT_GLYPH_FORMAT_BITMAP , FT_GLYPH_FORMAT_OUTLINE , or FT_GLYPH_FORMAT_COMPOSITE , but other values are possible. bitmap This field is used as a bitmap descriptor. 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 The bitmap's left bearing expressed in integer pixels. bitmap_top The bitmap's top bearing expressed in integer pixels. 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_FORMAT_OUTLINE . Once a glyph is loaded, outline can be transformed, distorted, emboldened, etc. However, it must not be freed. [Since 2.10.1] If FT_LOAD_NO_SCALE is set, outline coordinates of OpenType variation fonts for a selected instance are internally handled as 26.6 fractional font units but returned as (rounded) integers, as expected. To get unrounded font units, don't use FT_LOAD_NO_SCALE but load the glyph with FT_LOAD_NO_HINTING and scale it, using the font's units_per_EM value as the ppem. num_subglyphs The number of subglyphs in a composite glyph. This field 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. Currently internal to FreeType. 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; it is currently internal to FreeType. control_len This is the length in bytes of the control data. Currently internal to FreeType. other Reserved. lsb_delta The difference between hinted and unhinted left side bearing while auto-hinting is active. Zero otherwise. rsb_delta The difference between hinted and unhinted right side bearing while auto-hinting is active. Zero otherwise. 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., an outline glyph for TrueType and Type 1 formats). [Since 2.9] The prospective bitmap metrics are calculated according to FT_LOAD_TARGET_XXX and other flags even for the outline glyph, even if FT_LOAD_RENDER is not set. This image can later be converted into a bitmap by calling FT_Render_Glyph . This function searches 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 converting 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 . Here is a small pseudo code fragment that shows how to use lsb_delta and rsb_delta to do fractional positioning of glyphs: FT_GlyphSlot slot = face->glyph; FT_Pos origin_x = 0; for all glyphs do <load glyph with `FT_Load_Glyph'> FT_Outline_Translate( slot->outline, origin_x & 63, 0 ); <save glyph image, or render glyph, or ...> <compute kern between current and next glyph and add it to `origin_x'> origin_x += slot->advance.x; origin_x += slot->lsb_delta - slot->rsb_delta; endfor Here is another small pseudo code fragment that shows how to use lsb_delta and rsb_delta to improve integer positioning of glyphs: FT_GlyphSlot slot = face->glyph; FT_Pos origin_x = 0; FT_Pos prev_rsb_delta = 0; for all glyphs do <compute kern between current and previous glyph and add it to `origin_x'> <load glyph with `FT_Load_Glyph'> if ( prev_rsb_delta - slot->lsb_delta > 32 ) origin_x -= 64; else if ( prev_rsb_delta - slot->lsb_delta < -31 ) origin_x += 64; prev_rsb_delta = slot->rsb_delta; <save glyph image, or render glyph, or ...> origin_x += slot->advance.x; endfor If you use strong auto-hinting, you must apply these delta values! Otherwise you will experience far too large inter-glyph spacing at small rendering sizes in most cases. Note that it doesn't harm to use the above code for other hinting modes also, since the delta values are zero then. FT_Glyph_Metrics \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Glyph_Metrics_ { FT_Pos width; FT_Pos height; FT_Pos horiBearingX; FT_Pos horiBearingY; FT_Pos horiAdvance; FT_Pos vertBearingX; FT_Pos vertBearingY; FT_Pos vertAdvance; } FT_Glyph_Metrics ; A structure to model the metrics of a single glyph. The values are expressed in 26.6 fractional pixel format; if the flag FT_LOAD_NO_SCALE has been used while loading the glyph, values are expressed in font units instead. fields width The glyph's width. height The glyph's height. horiBearingX Left side bearing for horizontal layout. horiBearingY Top side bearing for horizontal layout. horiAdvance Advance width for horizontal layout. vertBearingX Left side bearing for vertical layout. vertBearingY Top side bearing for vertical layout. Larger positive values mean further below the vertical glyph origin. vertAdvance Advance height for vertical layout. Positive values mean the glyph has a positive advance downward. note If not disabled with FT_LOAD_NO_HINTING , the values represent dimensions of the hinted glyph (in case hinting is applicable). Stroking a glyph with an outside border does not increase horiAdvance or vertAdvance ; you have to manually adjust these values to account for the added width and height. FreeType doesn't use the \u2018VORG\u2019 table data for CFF fonts because it doesn't have an interface to quickly retrieve the glyph height. The y coordinate of the vertical origin can be simply computed as vertBearingY + height after loading a glyph. FT_SubGlyph \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_SubGlyphRec_* FT_SubGlyph ; 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. You can however retrieve subglyph information with FT_Get_SubGlyph_Info . FT_Bitmap_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Bitmap_Size_ { FT_Short height; FT_Short width; FT_Pos size; FT_Pos x_ppem; FT_Pos y_ppem; } FT_Bitmap_Size ; This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It is used for the available_sizes field of FT_Face . fields height The vertical distance, in pixels, between two consecutive baselines. It is always positive. width The average width, in pixels, of all glyphs in the strike. size The nominal size of the strike in 26.6 fractional points. This field is not very useful. x_ppem The horizontal ppem (nominal width) in 26.6 fractional pixels. y_ppem The vertical ppem (nominal height) in 26.6 fractional pixels. note Windows FNT: The nominal size given in a FNT font is not reliable. If the driver finds it incorrect, it sets size to some calculated values, and x_ppem and y_ppem to the pixel width and height given in the font, respectively. TrueType embedded bitmaps: size , width , and height values are not contained in the bitmap strike itself. They are computed from the global font parameters. FT_Init_FreeType \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Init_FreeType ( FT_Library *alibrary ); Initialize 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. note In case you want to provide your own memory allocating routines, use FT_New_Library instead, followed by a call to FT_Add_Default_Modules (or a series of calls to FT_Add_Module ) and FT_Set_Default_Properties . See the documentation of FT_Library and FT_Face for multi-threading issues. If you need reference-counting (cf. FT_Reference_Library ), use FT_New_Library and FT_Done_Library . If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is set, this function reads the FREETYPE_PROPERTIES environment variable to control driver properties. See section \u2018 Driver properties \u2019 for more. FT_Done_FreeType \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Done_FreeType ( FT_Library library ); Destroy a given FreeType library object and all of its children, including resources, drivers, faces, sizes, etc. input library A handle to the target library object. return FreeType error code. 0 means success. FT_New_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_New_Face ( FT_Library library, const char * filepathname, FT_Long face_index, FT_Face *aface ); Call FT_Open_Face to open a font by its pathname. inout library A handle to the library resource. input pathname A path to the font file. face_index See FT_Open_Face for a detailed description of this parameter. output aface A handle to a new face object. If face_index is greater than or equal to zero, it must be non- NULL . return FreeType error code. 0 means success. note The pathname string should be recognizable as such by a standard fopen call on your system; in particular, this means that pathname must not contain null bytes. If that is not sufficient to address all file name possibilities (for example, to handle wide character file names on Windows in UTF-16 encoding) you might use FT_Open_Face to pass a memory array or a stream object instead. Use FT_Done_Face to destroy the created FT_Face object (along with its slot and sizes). FT_Done_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Done_Face ( FT_Face face ); Discard 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. note See the discussion of reference counters in the description of FT_Reference_Face . FT_Reference_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Reference_Face ( FT_Face face ); A counter gets initialized to 1 at the time an FT_Face structure is created. This function increments the counter. FT_Done_Face then only destroys a face if the counter is 1, otherwise it simply decrements the counter. This function helps in managing life-cycles of structures that reference FT_Face objects. input face A handle to a target face object. return FreeType error code. 0 means success. since 2.4.2 FT_New_Memory_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Call FT_Open_Face to open a font that has been 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 See FT_Open_Face for a detailed description of this parameter. output aface A handle to a new face object. If face_index is greater than or equal to zero, it must be non- NULL . return FreeType error code. 0 means success. note You must not deallocate the memory before calling FT_Done_Face . FT_Face_Properties \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Face_Properties ( FT_Face face, FT_UInt num_properties, FT_Parameter * properties ); Set or override certain (library or module-wide) properties on a face-by-face basis. Useful for finer-grained control and avoiding locks on shared structures (threads can modify their own faces as they see fit). Contrary to FT_Property_Set , this function uses FT_Parameter so that you can pass multiple properties to the target face in one call. Note that only a subset of the available properties can be controlled. FT_PARAM_TAG_STEM_DARKENING (stem darkening, corresponding to the property no-stem-darkening provided by the \u2018autofit\u2019, \u2018cff\u2019, \u2018type1\u2019, and \u2018t1cid\u2019 modules; see no-stem-darkening ). FT_PARAM_TAG_LCD_FILTER_WEIGHTS (LCD filter weights, corresponding to function FT_Library_SetLcdFilterWeights ). FT_PARAM_TAG_RANDOM_SEED (seed value for the CFF, Type 1, and CID \u2018random\u2019 operator, corresponding to the random-seed property provided by the \u2018cff\u2019, \u2018type1\u2019, and \u2018t1cid\u2019 modules; see random-seed ). Pass NULL as data in FT_Parameter for a given tag to reset the option and use the library or module default again. input face A handle to the source face object. num_properties The number of properties that follow. properties A handle to an FT_Parameter array with num_properties elements. return FreeType error code. 0 means success. example Here is an example that sets three properties. You must define FT_CONFIG_OPTION_SUBPIXEL_RENDERING to make the LCD filter examples work. FT_Parameter property1; FT_Bool darken_stems = 1; FT_Parameter property2; FT_LcdFiveTapFilter custom_weight = { 0x11, 0x44, 0x56, 0x44, 0x11 }; FT_Parameter property3; FT_Int32 random_seed = 314159265; FT_Parameter properties[3] = { property1, property2, property3 }; property1.tag = FT_PARAM_TAG_STEM_DARKENING; property1.data = &darken_stems; property2.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS; property2.data = custom_weight; property3.tag = FT_PARAM_TAG_RANDOM_SEED; property3.data = &random_seed; FT_Face_Properties( face, 3, properties ); The next example resets a single property to its default value. FT_Parameter property; property.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS; property.data = NULL; FT_Face_Properties( face, 1, &property ); since 2.8 FT_Open_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Open_Face ( FT_Library library, const FT_Open_Args * args, FT_Long face_index, FT_Face *aface ); Create a face object from a given resource described by FT_Open_Args . inout library A handle to the library resource. input args A pointer to an FT_Open_Args structure that must be filled by the caller. face_index This field holds two different values. Bits 0-15 are the index of the face in the font file (starting with value 0). Set it to 0 if there is only one face in the font file. [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation fonts only, specifying the named instance index for the current face index (starting with value 1; value 0 makes FreeType ignore named instances). For non-variation fonts, bits 16-30 are ignored. Assuming that you want to access the third named instance in face 4, face_index should be set to 0x00030004. If you want to access face 4 without variation handling, simply set face_index to value 4. FT_Open_Face and its siblings can be used to quickly check whether the font format of a given font resource is supported by FreeType. In general, if the face_index argument is negative, the function's return value is 0 if the font format is recognized, or non-zero otherwise. The function allocates a more or less empty face handle in *aface (if aface isn't NULL ); the only two useful fields in this special case are face->num_faces and face->style_flags . For any negative value of face_index , face->num_faces gives the number of faces within the font file. For the negative value \u2018-(N+1)\u2019 (with \u2018N\u2019 a non-negative 16-bit value), bits 16-30 in face->style_flags give the number of named instances in face \u2018N\u2019 if we have a variation font (or zero otherwise). After examination, the returned FT_Face structure should be deallocated with a call to FT_Done_Face . output aface A handle to a new face object. If face_index is greater than or equal to zero, it must be non- NULL . return FreeType error code. 0 means success. note Unlike FreeType 1.x, this function automatically creates a glyph slot for the face object that can be accessed directly through face->glyph . Each new face object created with this function also owns a default FT_Size object, accessible as face->size . One FT_Library instance can have multiple face objects, this is, FT_Open_Face and its siblings can be called multiple times using the same library argument. See the discussion of reference counters in the description of FT_Reference_Face . If FT_OPEN_STREAM is set in args->flags , the stream in args->stream is automatically closed before this function returns any error (including FT_Err_Invalid_Argument ). example To loop over all faces, use code similar to the following snippet (omitting the error handling). ... FT_Face face; FT_Long i, num_faces; error = FT_Open_Face( library, args, -1, &face ); if ( error ) { ... } num_faces = face->num_faces; FT_Done_Face( face ); for ( i = 0; i < num_faces; i++ ) { ... error = FT_Open_Face( library, args, i, &face ); ... FT_Done_Face( face ); ... } To loop over all valid values for face_index , use something similar to the following snippet, again without error handling. The code accesses all faces immediately (thus only a single call of FT_Open_Face within the do-loop), with and without named instances. ... FT_Face face; FT_Long num_faces = 0; FT_Long num_instances = 0; FT_Long face_idx = 0; FT_Long instance_idx = 0; do { FT_Long id = ( instance_idx << 16 ) + face_idx; error = FT_Open_Face( library, args, id, &face ); if ( error ) { ... } num_faces = face->num_faces; num_instances = face->style_flags >> 16; ... FT_Done_Face( face ); if ( instance_idx < num_instances ) instance_idx++; else { face_idx++; instance_idx = 0; } } while ( face_idx < num_faces ) FT_Open_Args \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Open_Args_ { FT_UInt 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 ; A structure to indicate how to open a new font file or 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, which must be a C string (i.e., no null bytes except at the very end). The pointer is not owned by FreeType. 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 for opening the face. If set to NULL , FreeType tries 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 : If the FT_OPEN_MEMORY bit is set, assume that this is a memory file of memory_size bytes, located at memory_address . The data are not copied, and the client is responsible for releasing and destroying them after the corresponding call to FT_Done_Face . 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 none of the above bits are set or if multiple are set at the same time, the flags are invalid and FT_Open_Face fails. If the FT_OPEN_DRIVER bit is set, FT_Open_Face only tries 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 is used. They are ignored otherwise. Ideally, both the pathname and params fields should be tagged as \u2018const\u2019; this is missing for API backward compatibility. In other words, applications should treat them as read-only. FT_Parameter \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Parameter_ { FT_ULong tag; FT_Pointer data; } FT_Parameter ; A simple structure to pass more or less generic parameters to FT_Open_Face and FT_Face_Properties . fields tag A four-byte identification tag. data A pointer to the parameter data. note The ID and function of parameters are driver-specific. See section \u2018 Parameter Tags \u2019 for more information. FT_Attach_File \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Attach_File ( FT_Face face, const char * filepathname ); Call FT_Attach_Stream to attach a file. inout face The target face object. input filepathname The pathname. return FreeType error code. 0 means success. FT_Attach_Stream \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Attach_Stream ( FT_Face face, FT_Open_Args * parameters ); \u2018Attach\u2019 data to a face object. Normally, this is used to read additional information for the face object. For example, you can attach an AFM file that comes with a Type 1 font to get the kerning values and other metrics. inout face The target face object. input parameters A pointer to FT_Open_Args that must be filled by the caller. return FreeType error code. 0 means success. note The meaning of the \u2018attach\u2019 (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 or stream attachments. FT_Set_Char_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Call FT_Request_Size to request the nominal size (in points). inout face A handle to a target face object. input char_width The nominal width, in 26.6 fractional points. char_height The nominal height, in 26.6 fractional points. horz_resolution The horizontal resolution in dpi. vert_resolution The vertical resolution in dpi. return FreeType error code. 0 means success. note While this function allows fractional points as input values, the resulting ppem value for the given resolution is always rounded to the nearest integer. If either the character width or height is zero, it is set equal to the other value. If either the horizontal or vertical resolution is zero, it is set equal to the other value. A character width or height smaller than 1pt is set to 1pt; if both resolution values are zero, they are set to 72dpi. Don't use this function if you are using the FreeType cache API. FT_Set_Pixel_Sizes \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Set_Pixel_Sizes ( FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height ); Call FT_Request_Size to request the nominal size (in pixels). inout face A handle to the target face object. input pixel_width The nominal width, in pixels. pixel_height The nominal height, in pixels. return FreeType error code. 0 means success. note You should not rely on the resulting glyphs matching or being constrained to this pixel size. Refer to FT_Request_Size to understand how requested sizes relate to actual sizes. Don't use this function if you are using the FreeType cache API. FT_Request_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Request_Size ( FT_Face face, FT_Size_Request req ); Resize the scale of the active FT_Size object in a face. inout face A handle to a target face object. input req A pointer to a FT_Size_RequestRec . return FreeType error code. 0 means success. note Although drivers may select the bitmap strike matching the request, you should not rely on this if you intend to select a particular bitmap strike. Use FT_Select_Size instead in that case. The relation between the requested size and the resulting glyph size is dependent entirely on how the size is defined in the source face. The font designer chooses the final size of each glyph relative to this size. For more information refer to \u2018 https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html \u2019. Contrary to FT_Set_Char_Size , this function doesn't have special code to normalize zero-valued widths, heights, or resolutions (which lead to errors in most cases). Don't use this function if you are using the FreeType cache API. FT_Select_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Select_Size ( FT_Face face, FT_Int strike_index ); Select a bitmap strike. To be more precise, this function sets the scaling factors of the active FT_Size object in a face so that bitmaps from this particular strike are taken by FT_Load_Glyph and friends. inout face A handle to a target face object. input strike_index The index of the bitmap strike in the available_sizes field of FT_FaceRec structure. return FreeType error code. 0 means success. note For bitmaps embedded in outline fonts it is common that only a subset of the available glyphs at a given ppem value is available. FreeType silently uses outlines if there is no bitmap for a given glyph index. For GX and OpenType variation fonts, a bitmap strike makes sense only if the default instance is active (this is, no glyph variation takes place); otherwise, FreeType simply ignores bitmap strikes. The same is true for all named instances that are different from the default instance. Don't use this function if you are using the FreeType cache API. FT_Size_Request_Type \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef enum FT_Size_Request_Type_ { FT_SIZE_REQUEST_TYPE_NOMINAL , FT_SIZE_REQUEST_TYPE_REAL_DIM , FT_SIZE_REQUEST_TYPE_BBOX , FT_SIZE_REQUEST_TYPE_CELL , FT_SIZE_REQUEST_TYPE_SCALES , FT_SIZE_REQUEST_TYPE_MAX } FT_Size_Request_Type ; An enumeration type that lists the supported size request types, i.e., what input size (in font units) maps to the requested output size (in pixels, as computed from the arguments of FT_Size_Request ). values FT_SIZE_REQUEST_TYPE_NOMINAL The nominal size. The units_per_EM field of FT_FaceRec is used to determine both scaling values. This is the standard scaling found in most applications. In particular, use this size request type for TrueType fonts if they provide optical scaling or something similar. Note, however, that units_per_EM is a rather abstract value which bears no relation to the actual size of the glyphs in a font. FT_SIZE_REQUEST_TYPE_REAL_DIM The real dimension. The sum of the ascender and (minus of) the descender fields of FT_FaceRec is used to determine both scaling values. FT_SIZE_REQUEST_TYPE_BBOX The font bounding box. The width and height of the bbox field of FT_FaceRec are used to determine the horizontal and vertical scaling value, respectively. FT_SIZE_REQUEST_TYPE_CELL The max_advance_width field of FT_FaceRec is used to determine the horizontal scaling value; the vertical scaling value is determined the same way as FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling values are set to the smaller one. This type is useful if you want to specify the font size for, say, a window of a given dimension and 80x24 cells. FT_SIZE_REQUEST_TYPE_SCALES Specify the scaling values directly. note The above descriptions only apply to scalable formats. For bitmap formats, the behaviour is up to the driver. See the note section of FT_Size_Metrics if you wonder how size requesting relates to scaling values. FT_Size_RequestRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_RequestRec_ { FT_Size_Request_Type type; FT_Long width; FT_Long height; FT_UInt horiResolution; FT_UInt vertResolution; } FT_Size_RequestRec ; A structure to model a size request. fields type See FT_Size_Request_Type . width The desired width, given as a 26.6 fractional point value (with 72pt = 1in). height The desired height, given as a 26.6 fractional point value (with 72pt = 1in). horiResolution The horizontal resolution (dpi, i.e., pixels per inch). If set to zero, width is treated as a 26.6 fractional pixel value, which gets internally rounded to an integer. vertResolution The vertical resolution (dpi, i.e., pixels per inch). If set to zero, height is treated as a 26.6 fractional pixel value, which gets internally rounded to an integer. note If width is zero, the horizontal scaling value is set equal to the vertical scaling value, and vice versa. If type is FT_SIZE_REQUEST_TYPE_SCALES , width and height are interpreted directly as 16.16 fractional scaling values, without any further modification, and both horiResolution and vertResolution are ignored. FT_Size_Request \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_RequestRec_ * FT_Size_Request ; A handle to a size request structure. FT_Set_Transform \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Set_Transform ( FT_Face face, FT_Matrix * matrix, FT_Vector * delta ); Set the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph . inout face A handle to the source face object. input matrix A pointer to the transformation's 2x2 matrix. Use NULL for the identity matrix. delta A pointer to the translation vector. Use NULL for the null vector. note This function is provided as a convenience, but keep in mind that FT_Matrix coefficients are only 16.16 fixed-point values, which can limit the accuracy of the results. Using floating-point computations to perform the transform directly in client code instead will always yield better numbers. 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_Size or FT_Set_Pixel_Sizes . Note that this also transforms the face.glyph.advance field, but not the values in face.glyph.metrics . FT_Get_Transform \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Get_Transform ( FT_Face face, FT_Matrix * matrix, FT_Vector * delta ); Return the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph . See FT_Set_Transform for more details. input face A handle to the source face object. output matrix A pointer to a transformation's 2x2 matrix. Set this to NULL if you are not interested in the value. delta A pointer a translation vector. Set this to NULL if you are not interested in the value. since 2.11 FT_Load_Glyph \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Load_Glyph ( FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags ); Load a glyph into the glyph slot of a face object. inout face A handle to the target face object where the glyph is loaded. input glyph_index The index of the glyph in the font file. For CID-keyed fonts (either in PS or in CFF format) this argument specifies the CID value. load_flags A flag indicating what to load for this glyph. The FT_LOAD_XXX constants can be used to control the 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 The loaded glyph may be transformed. See FT_Set_Transform for the details. For subsetted CID-keyed fonts, FT_Err_Invalid_Argument is returned for invalid CID values (this is, for CID values that don't have a corresponding glyph in the font). See the discussion of the FT_FACE_FLAG_CID_KEYED flag for more details. If you receive FT_Err_Glyph_Too_Big , try getting the glyph outline at EM size, then scale it manually and fill it as a graphics operation. FT_Get_Char_Index \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Get_Char_Index ( FT_Face face, FT_ULong charcode ); Return the glyph index of a given character code. This function uses the currently selected charmap to do the mapping. input face A handle to the source face object. charcode The character code. return The glyph index. 0 means \u2018undefined character code\u2019. note If you use FreeType to manipulate the contents of font files directly, be aware that the glyph index returned by this function doesn't always correspond to the internal indices used within the file. This is done to ensure that value 0 always corresponds to the \u2018missing glyph\u2019. If the first glyph is not named \u2018.notdef\u2019, then for Type 1 and Type 42 fonts, \u2018.notdef\u2019 will be moved into the glyph ID 0 position, and whatever was there will be moved to the position \u2018.notdef\u2019 had. For Type 1 fonts, if there is no \u2018.notdef\u2019 glyph at all, then one will be created at index 0 and whatever was there will be moved to the last index \u2013 Type 42 fonts are considered invalid under this condition. FT_Get_First_Char \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_ULong ) FT_Get_First_Char ( FT_Face face, FT_UInt *agindex ); Return the first character code in the current charmap of a given face, together with its 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 together with FT_Get_Next_Char 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 ); } Be aware that character codes can have values up to 0xFFFFFFFF; this might happen for non-Unicode or malformed cmaps. However, even with regular Unicode encoding, so-called \u2018last resort fonts\u2019 (using SFNT cmap format 13, see function FT_Get_CMap_Format ) normally have entries for all Unicode characters up to 0x1FFFFF, which can cause a lot of iterations. Note that *agindex is set to 0 if the charmap is empty. The result itself can be 0 in two cases: if the charmap is empty or if the value 0 is the first valid character code. FT_Get_Next_Char \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_ULong ) FT_Get_Next_Char ( FT_Face face, FT_ULong char_code, FT_UInt *agindex ); 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 next 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 over all character codes available in a given charmap. See the note for that function for a simple code example. Note that *agindex is set to 0 when there are no more codes in the charmap. FT_Get_Name_Index \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Get_Name_Index ( FT_Face face, const FT_String * glyph_name ); Return the glyph index of a given glyph name. input face A handle to the source face object. glyph_name The glyph name. return The glyph index. 0 means \u2018undefined character code\u2019. FT_Load_Char \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Load_Char ( FT_Face face, FT_ULong char_code, FT_Int32 load_flags ); Load a glyph into the glyph slot of a face object, accessed by its character code. inout face A handle to a target face object where the glyph is 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 This function simply calls FT_Get_Char_Index and FT_Load_Glyph . Many fonts contain glyphs that can't be loaded by this function since its glyph indices are not listed in any of the font's charmaps. If no active cmap is set up (i.e., face->charmap is zero), the call to FT_Get_Char_Index is omitted, and the function behaves identically to FT_Load_Glyph . FT_LOAD_TARGET_MODE \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_TARGET_MODE ( x ) \\ FT_STATIC_CAST( FT_Render_Mode , ( (x) >> 16 ) & 15 ) Return the FT_Render_Mode corresponding to a given FT_LOAD_TARGET_XXX value. FT_Render_Glyph \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Render_Glyph ( FT_GlyphSlot slot, FT_Render_Mode render_mode ); Convert a given glyph image to a bitmap. It does so by inspecting the glyph image format, finding the relevant renderer, and invoking it. inout slot A handle to the glyph slot containing the image to convert. input render_mode The render mode used to render the glyph image into a bitmap. See FT_Render_Mode for a list of possible values. If FT_RENDER_MODE_NORMAL is used, a previous call of FT_Load_Glyph with flag FT_LOAD_COLOR makes FT_Render_Glyph provide a default blending of colored glyph layers associated with the current glyph slot (provided the font contains such layers) instead of rendering the glyph slot's outline. This is an experimental feature; see FT_LOAD_COLOR for more information. return FreeType error code. 0 means success. note To get meaningful results, font scaling values must be set with functions like FT_Set_Char_Size before calling FT_Render_Glyph . When FreeType outputs a bitmap of a glyph, it really outputs an alpha coverage map. If a pixel is completely covered by a filled-in outline, the bitmap contains 0xFF at that pixel, meaning that 0xFF/0xFF fraction of that pixel is covered, meaning the pixel is 100% black (or 0% bright). If a pixel is only 50% covered (value 0x80), the pixel is made 50% black (50% bright or a middle shade of grey). 0% covered means 0% black (100% bright or white). On high-DPI screens like on smartphones and tablets, the pixels are so small that their chance of being completely covered and therefore completely black are fairly good. On the low-DPI screens, however, the situation is different. The pixels are too large for most of the details of a glyph and shades of gray are the norm rather than the exception. This is relevant because all our screens have a second problem: they are not linear. 1 + 1 is not 2. Twice the value does not result in twice the brightness. When a pixel is only 50% covered, the coverage map says 50% black, and this translates to a pixel value of 128 when you use 8 bits per channel (0-255). However, this does not translate to 50% brightness for that pixel on our sRGB and gamma 2.2 screens. Due to their non-linearity, they dwell longer in the darks and only a pixel value of about 186 results in 50% brightness \u2013 128 ends up too dark on both bright and dark backgrounds. The net result is that dark text looks burnt-out, pixely and blotchy on bright background, bright text too frail on dark backgrounds, and colored text on colored background (for example, red on green) seems to have dark halos or \u2018dirt\u2019 around it. The situation is especially ugly for diagonal stems like in \u2018w\u2019 glyph shapes where the quality of FreeType's anti-aliasing depends on the correct display of grays. On high-DPI screens where smaller, fully black pixels reign supreme, this doesn't matter, but on our low-DPI screens with all the gray shades, it does. 0% and 100% brightness are the same things in linear and non-linear space, just all the shades in-between aren't. The blending function for placing text over a background is dst = alpha * src + (1 - alpha) * dst , which is known as the OVER operator. To correctly composite an anti-aliased pixel of a glyph onto a surface, take the foreground and background colors (e.g., in sRGB space) and apply gamma to get them in a linear space, use OVER to blend the two linear colors using the glyph pixel as the alpha value (remember, the glyph bitmap is an alpha coverage bitmap), and apply inverse gamma to the blended pixel and write it back to the image. Internal testing at Adobe found that a target inverse gamma of 1.8 for step 3 gives good results across a wide range of displays with an sRGB gamma curve or a similar one. This process can cost performance. There is an approximation that does not need to know about the background color; see https://bel.fi/alankila/lcd/ and https://bel.fi/alankila/lcd/alpcor.html for details. ATTENTION : Linear blending is even more important when dealing with subpixel-rendered glyphs to prevent color-fringing! A subpixel-rendered glyph must first be filtered with a filter that gives equal weight to the three color primaries and does not exceed a sum of 0x100, see section \u2018 Subpixel Rendering \u2019. Then the only difference to gray linear blending is that subpixel-rendered linear blending is done 3 times per pixel: red foreground subpixel to red background subpixel and so on for green and blue. FT_Render_Mode \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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_SDF , FT_RENDER_MODE_MAX } FT_Render_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Render_Mode ` values instead */ # define ft_render_mode_normal FT_RENDER_MODE_NORMAL # define ft_render_mode_mono FT_RENDER_MODE_MONO Render modes supported by FreeType 2. Each mode corresponds to a specific type of scanline conversion performed on the outline. For bitmap fonts and embedded bitmaps the bitmap->pixel_mode field in the FT_GlyphSlotRec structure gives the format of the returned bitmap. All modes except FT_RENDER_MODE_MONO use 256 levels of opacity, indicating pixel coverage. Use linear alpha blending and gamma correction to correctly render non-monochrome glyph bitmaps onto a surface; see FT_Render_Glyph . The FT_RENDER_MODE_SDF is a special render mode that uses up to 256 distance values, indicating the signed distance from the grid position to the nearest outline. values FT_RENDER_MODE_NORMAL Default render mode; it corresponds to 8-bit anti-aliased bitmaps. FT_RENDER_MODE_LIGHT This is equivalent to FT_RENDER_MODE_NORMAL . It is only defined as a separate value because render modes are also used indirectly to define hinting algorithm selectors. See FT_LOAD_TARGET_XXX for details. FT_RENDER_MODE_MONO This mode corresponds to 1-bit bitmaps (with 2 levels of opacity). FT_RENDER_MODE_LCD This mode corresponds to horizontal RGB and BGR subpixel 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. FT_RENDER_MODE_LCD_V This mode corresponds to vertical RGB and BGR subpixel 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. FT_RENDER_MODE_SDF This mode corresponds to 8-bit, single-channel signed distance field (SDF) bitmaps. Each pixel in the SDF grid is the value from the pixel's position to the nearest glyph's outline. The distances are calculated from the center of the pixel and are positive if they are filled by the outline (i.e., inside the outline) and negative otherwise. Check the note below on how to convert the output values to usable data. note The selected render mode only affects vector glyphs of a font. Embedded bitmaps often have a different pixel mode like FT_PIXEL_MODE_MONO . You can use FT_Bitmap_Convert to transform them into 8-bit pixmaps. For FT_RENDER_MODE_SDF the output bitmap buffer contains normalized distances that are packed into unsigned 8-bit values. To get pixel values in floating point representation use the following pseudo-C code for the conversion. // Load glyph and render using FT_RENDER_MODE_SDF, // then use the output buffer as follows. ... FT_Byte buffer = glyph->bitmap->buffer; for pixel in buffer { // `sd` is the signed distance and `spread` is the current spread; // the default spread is 2 and can be changed. float sd = (float)pixel - 128.0f; // Convert to pixel values. sd = ( sd / 128.0f ) * spread; // Store `sd` in a buffer or use as required. } FT_Get_Kerning \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Return the kerning vector between two glyphs of the 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 and dimension of the returned kerning vector. output akerning The kerning vector. This is either in font units, fractional pixels (26.6 format), or pixels 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 \u2013 they can be implemented through format-specific interfaces. Kerning for OpenType fonts implemented in a \u2018GPOS\u2019 table is not supported; use FT_HAS_KERNING to find out whether a font has data that can be extracted with FT_Get_Kerning . FT_Kerning_Mode \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef enum FT_Kerning_Mode_ { FT_KERNING_DEFAULT = 0, FT_KERNING_UNFITTED , FT_KERNING_UNSCALED } FT_Kerning_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Kerning_Mode ` values instead */ # define ft_kerning_default FT_KERNING_DEFAULT # define ft_kerning_unfitted FT_KERNING_UNFITTED # define ft_kerning_unscaled FT_KERNING_UNSCALED An enumeration to specify the format of kerning values returned by FT_Get_Kerning . values FT_KERNING_DEFAULT Return grid-fitted kerning distances in 26.6 fractional pixels. FT_KERNING_UNFITTED Return un-grid-fitted kerning distances in 26.6 fractional pixels. FT_KERNING_UNSCALED Return the kerning vector in original font units. note FT_KERNING_DEFAULT returns full pixel values; it also makes FreeType heuristically scale down kerning distances at small ppem values so that they don't become too big. Both FT_KERNING_DEFAULT and FT_KERNING_UNFITTED use the current horizontal scaling factor (as set e.g. with FT_Set_Char_Size ) to convert font units to pixels. FT_Get_Track_Kerning \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_Track_Kerning ( FT_Face face, FT_Fixed point_size, FT_Int degree, FT_Fixed * akerning ); Return the track kerning for a given face object at a given size. input face A handle to a source face object. point_size The point size in 16.16 fractional points. degree The degree of tightness. Increasingly negative values represent tighter track kerning, while increasingly positive values represent looser track kerning. Value zero means no track kerning. output akerning The kerning in 16.16 fractional points, to be uniformly applied between all glyphs. return FreeType error code. 0 means success. note Currently, only the Type 1 font driver supports track kerning, using data from AFM files (if attached with FT_Attach_File or FT_Attach_Stream ). Only very few AFM files come with track kerning data; please refer to Adobe's AFM specification for more details. FT_Get_Glyph_Name \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_Glyph_Name ( FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max ); Retrieve the ASCII name of a given glyph in a face. This only works for those faces where FT_HAS_GLYPH_NAMES (face) returns 1. input face A handle to a source face object. glyph_index The glyph index. buffer_max The maximum number of bytes available in the buffer. output buffer A pointer to a target buffer where the name is 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 is 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. Be aware that FreeType reorders glyph indices internally so that glyph index 0 always corresponds to the \u2018missing glyph\u2019 (called \u2018.notdef\u2019). This function always returns an error if the config macro FT_CONFIG_OPTION_NO_GLYPH_NAMES is not defined in ftoption.h . FT_Get_Postscript_Name \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( const char * ) FT_Get_Postscript_Name ( FT_Face face ); Retrieve the ASCII PostScript name of a given face, if available. This only works with PostScript, TrueType, and OpenType fonts. input face A handle to the source face object. return A pointer to the face's PostScript name. NULL if unavailable. note The returned pointer is owned by the face and is destroyed with it. For variation fonts, this string changes if you select a different instance, and you have to call FT_Get_PostScript_Name again to retrieve it. FreeType follows Adobe TechNote #5902, \u2018Generating PostScript Names for Fonts Using OpenType Font Variations\u2019. https://download.macromedia.com/pub/developer/opentype/tech-notes/5902.AdobePSNameGeneration.html [Since 2.9] Special PostScript names for named instances are only returned if the named instance is set with FT_Set_Named_Instance (and the font has corresponding entries in its \u2018fvar\u2019 table). If FT_IS_VARIATION returns true, the algorithmically derived PostScript name is provided, not looking up special entries for named instances. FT_CharMapRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_CharMapRec_ { FT_Face face; FT_Encoding encoding; FT_UShort platform_id; FT_UShort encoding_id; } FT_CharMapRec ; 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 gets emulated for other formats. encoding_id A platform-specific encoding number. This also comes from the TrueType specification and gets emulated similarly. FT_Select_Charmap \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Select_Charmap ( FT_Face face, FT_Encoding encoding ); Select 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 encoding. return FreeType error code. 0 means success. note This function returns an error if no charmap in the face corresponds to the encoding queried here. Because many fonts contain more than a single cmap for Unicode encoding, this function has some special code to select the one that covers Unicode best (\u2018best\u2019 in the sense that a UCS-4 cmap is preferred to a UCS-2 cmap). It is thus preferable to FT_Set_Charmap in this case. FT_Set_Charmap \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Set_Charmap ( FT_Face face, FT_CharMap charmap ); Select a given charmap for character code to glyph index mapping. 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 returns an error if the charmap is not part of the face (i.e., if it is not listed in the face->charmaps table). It also fails if an OpenType type 14 charmap is selected (which doesn't map character codes to glyph indices at all). FT_Get_Charmap_Index \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Int ) FT_Get_Charmap_Index ( FT_CharMap charmap ); Retrieve index of a given charmap. input charmap A handle to a charmap. return The index into the array of character maps within the face to which charmap belongs. If an error occurs, -1 is returned. FT_Get_FSType_Flags \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UShort ) FT_Get_FSType_Flags ( FT_Face face ); Return the fsType flags for a font. input face A handle to the source face object. return The fsType flags, see FT_FSTYPE_XXX . note Use this function rather than directly reading the fs_type field in the PS_FontInfoRec structure, which is only guaranteed to return the correct results for Type 1 fonts. since 2.3.8 FT_Get_SubGlyph_Info \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_SubGlyph_Info ( FT_GlyphSlot glyph, FT_UInt sub_index, FT_Int *p_index, FT_UInt *p_flags, FT_Int *p_arg1, FT_Int *p_arg2, FT_Matrix *p_transform ); Retrieve a description of a given subglyph. Only use it if glyph->format is FT_GLYPH_FORMAT_COMPOSITE ; an error is returned otherwise. input glyph The source glyph slot. sub_index The index of the subglyph. Must be less than glyph->num_subglyphs . output p_index The glyph index of the subglyph. p_flags The subglyph flags, see FT_SUBGLYPH_FLAG_XXX . p_arg1 The subglyph's first argument (if any). p_arg2 The subglyph's second argument (if any). p_transform The subglyph transformation (if any). return FreeType error code. 0 means success. note The values of *p_arg1 , *p_arg2 , and *p_transform must be interpreted depending on the flags returned in *p_flags . See the OpenType specification for details. https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description FT_Face_Internal \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Face_InternalRec_* FT_Face_Internal ; An opaque handle to an FT_Face_InternalRec structure that models the 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. FT_Size_Internal \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_InternalRec_* FT_Size_Internal ; An opaque handle to an FT_Size_InternalRec structure, used to model private data of a given FT_Size object. FT_Slot_Internal \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Slot_InternalRec_* FT_Slot_Internal ; An opaque handle to an FT_Slot_InternalRec structure, used to model private data of a given FT_GlyphSlot object. FT_FACE_FLAG_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # 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 ) # define FT_FACE_FLAG_HINTER ( 1L << 11 ) # define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) # define FT_FACE_FLAG_TRICKY ( 1L << 13 ) # define FT_FACE_FLAG_COLOR ( 1L << 14 ) # define FT_FACE_FLAG_VARIATION ( 1L << 15 ) 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 The face contains outline glyphs. Note that a face can contain bitmap strikes also, i.e., a face can have both this flag and FT_FACE_FLAG_FIXED_SIZES set. FT_FACE_FLAG_FIXED_SIZES The face contains bitmap strikes. See also the num_fixed_sizes and available_sizes fields of FT_FaceRec . FT_FACE_FLAG_FIXED_WIDTH The face contains fixed-width characters (like Courier, Lucida, MonoType, etc.). FT_FACE_FLAG_SFNT The face uses the SFNT storage scheme. For now, this means TrueType and OpenType. FT_FACE_FLAG_HORIZONTAL The face contains horizontal glyph metrics. This should be set for all common formats. FT_FACE_FLAG_VERTICAL The face contains vertical glyph metrics. This is only available in some formats, not all of them. FT_FACE_FLAG_KERNING The face contains kerning information. If set, the kerning distance can be retrieved using the function FT_Get_Kerning . Otherwise the function always return the vector (0,0). Note that FreeType doesn't handle kerning data from the SFNT \u2018GPOS\u2019 table (as present in many OpenType fonts). FT_FACE_FLAG_FAST_GLYPHS THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. FT_FACE_FLAG_MULTIPLE_MASTERS The face contains multiple masters and is capable of interpolating between them. Supported formats are Adobe MM, TrueType GX, and OpenType variation fonts. See section \u2018 Multiple Masters \u2019 for API details. FT_FACE_FLAG_GLYPH_NAMES The face contains glyph names, which can be retrieved using FT_Get_Glyph_Name . Note that some TrueType fonts contain broken glyph name tables. Use the function FT_Has_PS_Glyph_Names 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. FT_FACE_FLAG_HINTER The font driver has a hinting machine of its own. For example, with TrueType fonts, it makes sense to use data from the SFNT \u2018gasp\u2019 table only if the native TrueType hinting engine (with the bytecode interpreter) is available and active. FT_FACE_FLAG_CID_KEYED The face is CID-keyed. In that case, the face is not accessed by glyph indices but by CID values. For subsetted CID-keyed fonts this has the consequence that not all index values are a valid argument to FT_Load_Glyph . Only the CID values for which corresponding glyphs in the subsetted font exist make FT_Load_Glyph return successfully; in all other cases you get an FT_Err_Invalid_Argument error. Note that CID-keyed fonts that are in an SFNT wrapper (this is, all OpenType/CFF fonts) don't have this flag set since the glyphs are accessed in the normal way (using contiguous indices); the \u2018CID-ness\u2019 isn't visible to the application. FT_FACE_FLAG_TRICKY The face is \u2018tricky\u2019, this is, it always needs the font format's native hinting engine to get a reasonable result. A typical example is the old Chinese font mingli.ttf (but not mingliu.ttc ) that uses TrueType bytecode instructions to move and scale all of its subglyphs. It is not possible to auto-hint such fonts using FT_LOAD_FORCE_AUTOHINT ; it will also ignore FT_LOAD_NO_HINTING . You have to set both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT to really disable hinting; however, you probably never want this except for demonstration purposes. Currently, there are about a dozen TrueType fonts in the list of tricky fonts; they are hard-coded in file ttobjs.c . FT_FACE_FLAG_COLOR [Since 2.5.1] The face has color glyph tables. See FT_LOAD_COLOR for more information. FT_FACE_FLAG_VARIATION [Since 2.9] Set if the current face (or named instance) has been altered with FT_Set_MM_Design_Coordinates , FT_Set_Var_Design_Coordinates , or FT_Set_Var_Blend_Coordinates . This flag is unset by a call to FT_Set_Named_Instance . FT_STYLE_FLAG_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) # define FT_STYLE_FLAG_BOLD ( 1 << 1 ) A list of bit flags to indicate the style of a given face. These are used in the style_flags field of FT_FaceRec . values FT_STYLE_FLAG_ITALIC The face style is italic or oblique. FT_STYLE_FLAG_BOLD The face is bold. note The style information as provided by FreeType is very basic. More details are beyond the scope and should be done on a higher level (for example, by analyzing various fields of the \u2018OS/2\u2019 table in SFNT based fonts). FT_OPEN_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_OPEN_MEMORY 0x1 # define FT_OPEN_STREAM 0x2 # define FT_OPEN_PATHNAME 0x4 # define FT_OPEN_DRIVER 0x8 # define FT_OPEN_PARAMS 0x10 /* these constants are deprecated; use the corresponding ` FT_OPEN_XXX ` */ /* values instead */ # 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 A list of bit field constants used within the flags field of the FT_Open_Args structure. values 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 and params fields. note The FT_OPEN_MEMORY , FT_OPEN_STREAM , and FT_OPEN_PATHNAME flags are mutually exclusive. FT_LOAD_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_DEFAULT 0x0 # define FT_LOAD_NO_SCALE ( 1L << 0 ) # define FT_LOAD_NO_HINTING ( 1L << 1 ) # define FT_LOAD_RENDER ( 1L << 2 ) # define FT_LOAD_NO_BITMAP ( 1L << 3 ) # define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 ) # define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 ) # define FT_LOAD_CROP_BITMAP ( 1L << 6 ) # define FT_LOAD_PEDANTIC ( 1L << 7 ) # define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 ) # define FT_LOAD_NO_RECURSE ( 1L << 10 ) # define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 ) # define FT_LOAD_MONOCHROME ( 1L << 12 ) # define FT_LOAD_LINEAR_DESIGN ( 1L << 13 ) # define FT_LOAD_NO_AUTOHINT ( 1L << 15 ) /* Bits 16-19 are used by `FT_LOAD_TARGET_` */ # define FT_LOAD_COLOR ( 1L << 20 ) # define FT_LOAD_COMPUTE_METRICS ( 1L << 21 ) # define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 ) A list of bit field constants for 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 as the default glyph load operation. In this case, the following happens: 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). If no embedded bitmap is searched for or found, FreeType looks for a scalable outline. If one is found, it is loaded from the font file, scaled to device pixels, then \u2018hinted\u2019 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 loaded outline glyph but keep it in font units. This flag implies FT_LOAD_NO_HINTING and FT_LOAD_NO_BITMAP , and unsets FT_LOAD_RENDER . If the font is \u2018tricky\u2019 (see FT_FACE_FLAG_TRICKY for more), using FT_LOAD_NO_SCALE usually yields meaningless outlines because the subglyphs must be scaled and positioned with hinting instructions. This can be solved by loading the font without FT_LOAD_NO_SCALE and setting the character size to font->units_per_EM . FT_LOAD_NO_HINTING Disable hinting. This generally generates \u2018blurrier\u2019 bitmap glyphs when the glyph are rendered in any of the anti-aliased modes. See also the note below. This flag is implied by FT_LOAD_NO_SCALE . FT_LOAD_RENDER Call FT_Render_Glyph after the glyph is loaded. By default, the glyph is rendered in FT_RENDER_MODE_NORMAL mode. This can be overridden by FT_LOAD_TARGET_XXX or FT_LOAD_MONOCHROME . This flag is unset by FT_LOAD_NO_SCALE . FT_LOAD_NO_BITMAP Ignore bitmap strikes when loading. Bitmap-only fonts ignore this flag. FT_LOAD_NO_SCALE always sets this flag. FT_LOAD_VERTICAL_LAYOUT Load the glyph for vertical text layout. In particular, the advance value in the FT_GlyphSlotRec structure is set to the vertAdvance value of the metrics field. In case FT_HAS_VERTICAL doesn't return true, you shouldn't use this flag currently. Reason is that in this case vertical metrics get synthesized, and those values are not always consistent across various font formats. FT_LOAD_FORCE_AUTOHINT Prefer the auto-hinter over the font's native hinter. See also the note below. FT_LOAD_PEDANTIC Make the font driver perform pedantic verifications during glyph loading and hinting. This is mostly used to detect broken glyphs in fonts. By default, FreeType tries to handle broken fonts also. In particular, errors from the TrueType bytecode engine are not passed to the application if this flag is not set; this might result in partially hinted or distorted glyphs in case a glyph's bytecode is buggy. FT_LOAD_NO_RECURSE Don't load composite glyphs recursively. Instead, the font driver fills the num_subglyph and subglyphs values of the glyph slot; it also sets glyph->format to FT_GLYPH_FORMAT_COMPOSITE . The description of subglyphs can then be accessed with FT_Get_SubGlyph_Info . Don't use this flag for retrieving metrics information since some font drivers only return rudimentary data. This flag implies FT_LOAD_NO_SCALE and FT_LOAD_IGNORE_TRANSFORM . FT_LOAD_IGNORE_TRANSFORM Ignore the transform matrix set by FT_Set_Transform . FT_LOAD_MONOCHROME This flag is used with FT_LOAD_RENDER to indicate that you want to render an outline glyph to a 1-bit monochrome bitmap glyph, with 8 pixels packed into each byte of the bitmap data. Note that this has no effect on the hinting algorithm used. You should rather use FT_LOAD_TARGET_MONO so that the monochrome-optimized hinting algorithm is used. FT_LOAD_LINEAR_DESIGN Keep linearHoriAdvance and linearVertAdvance fields of FT_GlyphSlotRec in font units. See FT_GlyphSlotRec for details. FT_LOAD_NO_AUTOHINT Disable the auto-hinter. See also the note below. FT_LOAD_COLOR Load colored glyphs. There are slight differences depending on the font format. [Since 2.5] Load embedded color bitmap images. The resulting color bitmaps, if available, will have the FT_PIXEL_MODE_BGRA format, with pre-multiplied color channels. If the flag is not set and color bitmaps are found, they are converted to 256-level gray bitmaps, using the FT_PIXEL_MODE_GRAY format. [Since 2.10, experimental] If the glyph index contains an entry in the face's \u2018COLR\u2019 table with a \u2018CPAL\u2019 palette table (as defined in the OpenType specification), make FT_Render_Glyph provide a default blending of the color glyph layers associated with the glyph index, using the same bitmap format as embedded color bitmap images. This is mainly for convenience; for full control of color layers use FT_Get_Color_Glyph_Layer and FreeType's color functions like FT_Palette_Select instead of setting FT_LOAD_COLOR for rendering so that the client application can handle blending by itself. FT_LOAD_COMPUTE_METRICS [Since 2.6.1] Compute glyph metrics from the glyph data, without the use of bundled metrics tables (for example, the \u2018hdmx\u2019 table in TrueType fonts). This flag is mainly used by font validating or font editing applications, which need to ignore, verify, or edit those tables. Currently, this flag is only implemented for TrueType fonts. FT_LOAD_BITMAP_METRICS_ONLY [Since 2.7.1] Request loading of the metrics and bitmap image information of a (possibly embedded) bitmap glyph without allocating or copying the bitmap image data itself. No effect if the target glyph is not a bitmap image. This flag unsets FT_LOAD_RENDER . FT_LOAD_CROP_BITMAP Ignored. Deprecated. FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH Ignored. Deprecated. note By default, hinting is enabled and the font's native hinter (see FT_FACE_FLAG_HINTER ) is preferred over the auto-hinter. You can disable hinting by setting FT_LOAD_NO_HINTING or change the precedence by setting FT_LOAD_FORCE_AUTOHINT . You can also set FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be used at all. See the description of FT_FACE_FLAG_TRICKY for a special exception (affecting only a handful of Asian fonts). Besides deciding which hinter to use, you can also decide which hinting algorithm to use. See FT_LOAD_TARGET_XXX for details. Note that the auto-hinter needs a valid Unicode cmap (either a native one or synthesized by FreeType) for producing correct results. If a font provides an incorrect mapping (for example, assigning the character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a mathematical integral sign), the auto-hinter might produce useless results. FT_LOAD_TARGET_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_TARGET_( x ) ( FT_STATIC_CAST( FT_Int32 , (x) & 15 ) << 16 ) # 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 ) A list of values to select a specific hinting algorithm for the hinter. You should OR one of these values to your load_flags when calling FT_Load_Glyph . Note that a font's native hinters may ignore the hinting algorithm you have specified (e.g., the TrueType bytecode interpreter). You can set FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used. values FT_LOAD_TARGET_NORMAL The default hinting algorithm, optimized for standard gray-level rendering. For monochrome output, use FT_LOAD_TARGET_MONO instead. FT_LOAD_TARGET_LIGHT A lighter hinting algorithm for gray-level modes. Many generated glyphs are fuzzier but better resemble their original shape. This is achieved by snapping glyphs to the pixel grid only vertically (Y-axis), as is done by FreeType's new CFF engine or Microsoft's ClearType font renderer. This preserves inter-glyph spacing in horizontal text. The snapping is done either by the native font driver, if the driver itself and the font support it, or by the auto-hinter. Advance widths are rounded to integer values; however, using the lsb_delta and rsb_delta fields of FT_GlyphSlotRec , it is possible to get fractional advance widths for subpixel positioning (which is recommended to use). If configuration option AF_CONFIG_OPTION_TT_SIZE_METRICS is active, TrueType-like metrics are used to make this mode behave similarly as in unpatched FreeType versions between 2.4.6 and 2.7.1 (inclusive). FT_LOAD_TARGET_MONO Strong hinting algorithm that should only be used for monochrome output. The result is probably unpleasant if the glyph is rendered in non-monochrome modes. Note that for outline fonts only the TrueType font driver has proper monochrome hinting support, provided the TTFs contain hints for B/W rendering (which most fonts no longer provide). If these conditions are not met it is very likely that you get ugly results at smaller sizes. FT_LOAD_TARGET_LCD A variant of FT_LOAD_TARGET_LIGHT optimized for horizontally decimated LCD displays. FT_LOAD_TARGET_LCD_V A variant of FT_LOAD_TARGET_NORMAL optimized for vertically decimated LCD displays. note You should use only one of the FT_LOAD_TARGET_XXX values in your load_flags . They can't be ORed. If FT_LOAD_RENDER is also set, the glyph is rendered in the corresponding mode (i.e., the mode that matches the used algorithm best). An exception is FT_LOAD_TARGET_MONO since it implies FT_LOAD_MONOCHROME . You can use a hinting algorithm that doesn't correspond to the same rendering mode. As an example, it is possible to use the \u2018light\u2019 hinting algorithm and have the results rendered in horizontal LCD pixel mode, with code like FT_Load_Glyph( face, glyph_index, load_flags | FT_LOAD_TARGET_LIGHT ); FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); In general, you should stick with one rendering mode. For example, switching between FT_LOAD_TARGET_NORMAL and FT_LOAD_TARGET_MONO enforces a lot of recomputation for TrueType fonts, which is slow. Another reason is caching: Selecting a different mode usually causes changes in both the outlines and the rasterized bitmaps; it is thus necessary to empty the cache after a mode switch to avoid false hits. FT_SUBGLYPH_FLAG_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 # define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 # define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 # define FT_SUBGLYPH_FLAG_SCALE 8 # define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 # define FT_SUBGLYPH_FLAG_2X2 0x80 # define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 A list of constants describing subglyphs. Please refer to the \u2018glyf\u2019 table description in the OpenType specification for the meaning of the various flags (which get synthesized for non-OpenType subglyphs). https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description values FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID FT_SUBGLYPH_FLAG_SCALE FT_SUBGLYPH_FLAG_XY_SCALE FT_SUBGLYPH_FLAG_2X2 FT_SUBGLYPH_FLAG_USE_MY_METRICS FT_FSTYPE_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000 # define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002 # define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004 # define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008 # define FT_FSTYPE_NO_SUBSETTING 0x0100 # define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200 A list of bit flags used in the fsType field of the OS/2 table in a TrueType or OpenType font and the FSType entry in a PostScript font. These bit flags are returned by FT_Get_FSType_Flags ; they inform client applications of embedding and subsetting restrictions associated with a font. See https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf for more details. values FT_FSTYPE_INSTALLABLE_EMBEDDING Fonts with no fsType bit set may be embedded and permanently installed on the remote system by an application. FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING Fonts that have only this bit set must not be modified, embedded or exchanged in any manner without first obtaining permission of the font software copyright owner. FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING The font may be embedded and temporarily loaded on the remote system. Documents containing Preview & Print fonts must be opened \u2018read-only\u2019; no edits can be applied to the document. FT_FSTYPE_EDITABLE_EMBEDDING The font may be embedded but must only be installed temporarily on other systems. In contrast to Preview & Print fonts, documents containing editable fonts may be opened for reading, editing is permitted, and changes may be saved. FT_FSTYPE_NO_SUBSETTING The font may not be subsetted prior to embedding. FT_FSTYPE_BITMAP_EMBEDDING_ONLY Only bitmaps contained in the font may be embedded; no outline data may be embedded. If there are no bitmaps available in the font, then the font is unembeddable. note The flags are ORed together, thus more than a single value can be returned. While the fsType flags can indicate that a font may be embedded, a license with the font vendor may be separately required to use the font in this way. FT_HAS_FAST_GLYPHS \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_FAST_GLYPHS ( face ) 0 Deprecated.","title":"Base Interface"},{"location":"ft2-base_interface.html#base-interface","text":"","title":"Base Interface"},{"location":"ft2-base_interface.html#synopsis","text":"This section describes the most important public high-level API functions of FreeType 2.","title":"Synopsis"},{"location":"ft2-base_interface.html#ft_library","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_LibraryRec_ * FT_Library ; A handle to a FreeType library instance. Each \u2018library\u2019 is completely independent from the others; it is the \u2018root\u2019 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 ). [Since 2.5.6] In multi-threaded applications it is easiest to use one FT_Library object per thread. In case this is too cumbersome, a single FT_Library object across threads is possible also, as long as a mutex lock is used around FT_New_Face and FT_Done_Face .","title":"FT_Library"},{"location":"ft2-base_interface.html#ft_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_FaceRec_* FT_Face ; A handle to a typographic face object. A face object models a given typeface, in a given style.","title":"FT_Face"},{"location":"ft2-base_interface.html#ft_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_SizeRec_* FT_Size ; A handle to an object that models a face scaled to a given character size.","title":"FT_Size"},{"location":"ft2-base_interface.html#ft_glyphslot","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_GlyphSlotRec_* FT_GlyphSlot ; A handle to a given \u2018glyph slot\u2019. A slot is a container that can hold any 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.","title":"FT_GlyphSlot"},{"location":"ft2-base_interface.html#ft_charmap","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_CharMapRec_* FT_CharMap ; A handle to a character map (usually abbreviated to \u2018charmap\u2019). 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 \u2018active\u2019, providing the data 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.","title":"FT_CharMap"},{"location":"ft2-base_interface.html#ft_encoding","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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_SJIS , 's', 'j', 'i', 's' ), FT_ENC_TAG ( FT_ENCODING_PRC , 'g', 'b', ' ', ' ' ), FT_ENC_TAG ( FT_ENCODING_BIG5 , 'b', 'i', 'g', '5' ), FT_ENC_TAG ( FT_ENCODING_WANSUNG , 'w', 'a', 'n', 's' ), FT_ENC_TAG ( FT_ENCODING_JOHAB , 'j', 'o', 'h', 'a' ), /* for backward compatibility */ FT_ENCODING_GB2312 = FT_ENCODING_PRC , FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS , FT_ENCODING_MS_GB2312 = FT_ENCODING_PRC , FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5 , FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG , FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB , 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 ; /* these constants are deprecated; use the corresponding ` FT_Encoding ` */ /* values instead */ # 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_SJIS # define ft_encoding_gb2312 FT_ENCODING_PRC # define ft_encoding_big5 FT_ENCODING_BIG5 # define ft_encoding_wansung FT_ENCODING_WANSUNG # define ft_encoding_johab FT_ENCODING_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 An enumeration to specify character sets supported by charmaps. Used in the FT_Select_Charmap API function.","title":"FT_Encoding"},{"location":"ft2-base_interface.html#ft_enc_tag","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # ifndef FT_ENC_TAG # define FT_ENC_TAG ( value, a, b, c, d ) \\ value = ( ( FT_STATIC_BYTE_CAST( FT_UInt32 , a ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( FT_UInt32 , b ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( FT_UInt32 , c ) << 8 ) | \\ FT_STATIC_BYTE_CAST( FT_UInt32 , d ) ) # endif /* FT_ENC_TAG */ This macro converts four-letter tags into an unsigned long. It is used to define \u2018encoding\u2019 identifiers (see FT_Encoding ).","title":"FT_ENC_TAG"},{"location":"ft2-base_interface.html#ft_facerec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 member variables (down to `underline_thickness`) */ /*# are only relevant to scalable outlines; cf. @ FT_Bitmap_Size */ /*# for bitmap fonts. */ 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; /* face-specific auto-hinter data */ void * extensions; /* unused */ FT_Face_Internal internal; /*@private end */ } FT_FaceRec ; FreeType root face class structure. A face object models a typeface in a font file.","title":"FT_FaceRec"},{"location":"ft2-base_interface.html#ft_has_horizontal","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_HORIZONTAL ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL ) ) A macro that returns true whenever a face object contains horizontal metrics (this is true for all font formats though).","title":"FT_HAS_HORIZONTAL"},{"location":"ft2-base_interface.html#ft_has_vertical","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_VERTICAL ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_VERTICAL ) ) A macro that returns true whenever a face object contains real vertical metrics (and not only synthesized ones).","title":"FT_HAS_VERTICAL"},{"location":"ft2-base_interface.html#ft_has_kerning","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_KERNING ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_KERNING ) ) A macro that returns true whenever a face object contains kerning data that can be accessed with FT_Get_Kerning .","title":"FT_HAS_KERNING"},{"location":"ft2-base_interface.html#ft_has_fixed_sizes","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_FIXED_SIZES ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) ) A macro that returns true whenever a face object contains some embedded bitmaps. See the available_sizes field of the FT_FaceRec structure.","title":"FT_HAS_FIXED_SIZES"},{"location":"ft2-base_interface.html#ft_has_glyph_names","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_GLYPH_NAMES ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) ) A macro that returns true whenever a face object contains some glyph names that can be accessed through FT_Get_Glyph_Name .","title":"FT_HAS_GLYPH_NAMES"},{"location":"ft2-base_interface.html#ft_has_color","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_COLOR ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_COLOR ) ) A macro that returns true whenever a face object contains tables for color glyphs.","title":"FT_HAS_COLOR"},{"location":"ft2-base_interface.html#ft_has_multiple_masters","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_MULTIPLE_MASTERS ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) ) 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.","title":"FT_HAS_MULTIPLE_MASTERS"},{"location":"ft2-base_interface.html#ft_is_sfnt","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_SFNT ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SFNT ) ) 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.","title":"FT_IS_SFNT"},{"location":"ft2-base_interface.html#ft_is_scalable","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_SCALABLE ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SCALABLE ) ) A macro that returns true whenever a face object contains a scalable font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF, and PFR font formats).","title":"FT_IS_SCALABLE"},{"location":"ft2-base_interface.html#ft_is_fixed_width","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_FIXED_WIDTH ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) ) A macro that returns true whenever a face object contains a font face that contains fixed-width (or \u2018monospace\u2019, \u2018fixed-pitch\u2019, etc.) glyphs.","title":"FT_IS_FIXED_WIDTH"},{"location":"ft2-base_interface.html#ft_is_cid_keyed","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_CID_KEYED ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_CID_KEYED ) ) A macro that returns true whenever a face object contains a CID-keyed font. See the discussion of FT_FACE_FLAG_CID_KEYED for more details. If this macro is true, all functions defined in FT_CID_H are available.","title":"FT_IS_CID_KEYED"},{"location":"ft2-base_interface.html#ft_is_tricky","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_TRICKY ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_TRICKY ) ) A macro that returns true whenever a face represents a \u2018tricky\u2019 font. See the discussion of FT_FACE_FLAG_TRICKY for more details.","title":"FT_IS_TRICKY"},{"location":"ft2-base_interface.html#ft_is_named_instance","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_NAMED_INSTANCE ( face ) \\ ( !!( (face)->face_index & 0x7FFF0000L ) ) A macro that returns true whenever a face object is a named instance of a GX or OpenType variation font. [Since 2.9] Changing the design coordinates with FT_Set_Var_Design_Coordinates or FT_Set_Var_Blend_Coordinates does not influence the return value of this macro (only FT_Set_Named_Instance does that).","title":"FT_IS_NAMED_INSTANCE"},{"location":"ft2-base_interface.html#ft_is_variation","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_VARIATION ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_VARIATION ) ) A macro that returns true whenever a face object has been altered by FT_Set_MM_Design_Coordinates , FT_Set_Var_Design_Coordinates , or FT_Set_Var_Blend_Coordinates .","title":"FT_IS_VARIATION"},{"location":"ft2-base_interface.html#ft_sizerec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ; FreeType root size class structure. A size object models a face object at a given size.","title":"FT_SizeRec"},{"location":"ft2-base_interface.html#ft_size_metrics","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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; /* scaling values used to convert font */ FT_Fixed y_scale; /* units to 26.6 fractional pixels */ 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 ; The size metrics structure gives the metrics of a size object.","title":"FT_Size_Metrics"},{"location":"ft2-base_interface.html#ft_glyphslotrec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_GlyphSlotRec_ { FT_Library library; FT_Face face; FT_GlyphSlot next; FT_UInt glyph_index; /* new in 2.10; was reserved previously */ 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; FT_Pos lsb_delta; FT_Pos rsb_delta; void * other; FT_Slot_Internal internal; } FT_GlyphSlotRec ; FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format.","title":"FT_GlyphSlotRec"},{"location":"ft2-base_interface.html#ft_glyph_metrics","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Glyph_Metrics_ { FT_Pos width; FT_Pos height; FT_Pos horiBearingX; FT_Pos horiBearingY; FT_Pos horiAdvance; FT_Pos vertBearingX; FT_Pos vertBearingY; FT_Pos vertAdvance; } FT_Glyph_Metrics ; A structure to model the metrics of a single glyph. The values are expressed in 26.6 fractional pixel format; if the flag FT_LOAD_NO_SCALE has been used while loading the glyph, values are expressed in font units instead.","title":"FT_Glyph_Metrics"},{"location":"ft2-base_interface.html#ft_subglyph","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_SubGlyphRec_* FT_SubGlyph ; The subglyph structure is an internal object used to describe subglyphs (for example, in the case of composites).","title":"FT_SubGlyph"},{"location":"ft2-base_interface.html#ft_bitmap_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Bitmap_Size_ { FT_Short height; FT_Short width; FT_Pos size; FT_Pos x_ppem; FT_Pos y_ppem; } FT_Bitmap_Size ; This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It is used for the available_sizes field of FT_Face .","title":"FT_Bitmap_Size"},{"location":"ft2-base_interface.html#ft_init_freetype","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Init_FreeType ( FT_Library *alibrary ); Initialize a new FreeType library object. The set of modules that are registered by this function is determined at build time.","title":"FT_Init_FreeType"},{"location":"ft2-base_interface.html#ft_done_freetype","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Done_FreeType ( FT_Library library ); Destroy a given FreeType library object and all of its children, including resources, drivers, faces, sizes, etc.","title":"FT_Done_FreeType"},{"location":"ft2-base_interface.html#ft_new_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_New_Face ( FT_Library library, const char * filepathname, FT_Long face_index, FT_Face *aface ); Call FT_Open_Face to open a font by its pathname.","title":"FT_New_Face"},{"location":"ft2-base_interface.html#ft_done_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Done_Face ( FT_Face face ); Discard a given face object, as well as all of its child slots and sizes.","title":"FT_Done_Face"},{"location":"ft2-base_interface.html#ft_reference_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Reference_Face ( FT_Face face ); A counter gets initialized to 1 at the time an FT_Face structure is created. This function increments the counter. FT_Done_Face then only destroys a face if the counter is 1, otherwise it simply decrements the counter. This function helps in managing life-cycles of structures that reference FT_Face objects.","title":"FT_Reference_Face"},{"location":"ft2-base_interface.html#ft_new_memory_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Call FT_Open_Face to open a font that has been loaded into memory.","title":"FT_New_Memory_Face"},{"location":"ft2-base_interface.html#ft_face_properties","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Face_Properties ( FT_Face face, FT_UInt num_properties, FT_Parameter * properties ); Set or override certain (library or module-wide) properties on a face-by-face basis. Useful for finer-grained control and avoiding locks on shared structures (threads can modify their own faces as they see fit). Contrary to FT_Property_Set , this function uses FT_Parameter so that you can pass multiple properties to the target face in one call. Note that only a subset of the available properties can be controlled. FT_PARAM_TAG_STEM_DARKENING (stem darkening, corresponding to the property no-stem-darkening provided by the \u2018autofit\u2019, \u2018cff\u2019, \u2018type1\u2019, and \u2018t1cid\u2019 modules; see no-stem-darkening ). FT_PARAM_TAG_LCD_FILTER_WEIGHTS (LCD filter weights, corresponding to function FT_Library_SetLcdFilterWeights ). FT_PARAM_TAG_RANDOM_SEED (seed value for the CFF, Type 1, and CID \u2018random\u2019 operator, corresponding to the random-seed property provided by the \u2018cff\u2019, \u2018type1\u2019, and \u2018t1cid\u2019 modules; see random-seed ). Pass NULL as data in FT_Parameter for a given tag to reset the option and use the library or module default again.","title":"FT_Face_Properties"},{"location":"ft2-base_interface.html#ft_open_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Open_Face ( FT_Library library, const FT_Open_Args * args, FT_Long face_index, FT_Face *aface ); Create a face object from a given resource described by FT_Open_Args .","title":"FT_Open_Face"},{"location":"ft2-base_interface.html#ft_open_args","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Open_Args_ { FT_UInt 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 ; A structure to indicate how to open a new font file or stream. A pointer to such a structure can be used as a parameter for the functions FT_Open_Face and FT_Attach_Stream .","title":"FT_Open_Args"},{"location":"ft2-base_interface.html#ft_parameter","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Parameter_ { FT_ULong tag; FT_Pointer data; } FT_Parameter ; A simple structure to pass more or less generic parameters to FT_Open_Face and FT_Face_Properties .","title":"FT_Parameter"},{"location":"ft2-base_interface.html#ft_attach_file","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Attach_File ( FT_Face face, const char * filepathname ); Call FT_Attach_Stream to attach a file.","title":"FT_Attach_File"},{"location":"ft2-base_interface.html#ft_attach_stream","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Attach_Stream ( FT_Face face, FT_Open_Args * parameters ); \u2018Attach\u2019 data to a face object. Normally, this is used to read additional information for the face object. For example, you can attach an AFM file that comes with a Type 1 font to get the kerning values and other metrics.","title":"FT_Attach_Stream"},{"location":"ft2-base_interface.html#ft_set_char_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Call FT_Request_Size to request the nominal size (in points).","title":"FT_Set_Char_Size"},{"location":"ft2-base_interface.html#ft_set_pixel_sizes","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Set_Pixel_Sizes ( FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height ); Call FT_Request_Size to request the nominal size (in pixels).","title":"FT_Set_Pixel_Sizes"},{"location":"ft2-base_interface.html#ft_request_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Request_Size ( FT_Face face, FT_Size_Request req ); Resize the scale of the active FT_Size object in a face.","title":"FT_Request_Size"},{"location":"ft2-base_interface.html#ft_select_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Select_Size ( FT_Face face, FT_Int strike_index ); Select a bitmap strike. To be more precise, this function sets the scaling factors of the active FT_Size object in a face so that bitmaps from this particular strike are taken by FT_Load_Glyph and friends.","title":"FT_Select_Size"},{"location":"ft2-base_interface.html#ft_size_request_type","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef enum FT_Size_Request_Type_ { FT_SIZE_REQUEST_TYPE_NOMINAL , FT_SIZE_REQUEST_TYPE_REAL_DIM , FT_SIZE_REQUEST_TYPE_BBOX , FT_SIZE_REQUEST_TYPE_CELL , FT_SIZE_REQUEST_TYPE_SCALES , FT_SIZE_REQUEST_TYPE_MAX } FT_Size_Request_Type ; An enumeration type that lists the supported size request types, i.e., what input size (in font units) maps to the requested output size (in pixels, as computed from the arguments of FT_Size_Request ).","title":"FT_Size_Request_Type"},{"location":"ft2-base_interface.html#ft_size_requestrec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_RequestRec_ { FT_Size_Request_Type type; FT_Long width; FT_Long height; FT_UInt horiResolution; FT_UInt vertResolution; } FT_Size_RequestRec ; A structure to model a size request.","title":"FT_Size_RequestRec"},{"location":"ft2-base_interface.html#ft_size_request","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_RequestRec_ * FT_Size_Request ; A handle to a size request structure.","title":"FT_Size_Request"},{"location":"ft2-base_interface.html#ft_set_transform","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Set_Transform ( FT_Face face, FT_Matrix * matrix, FT_Vector * delta ); Set the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph .","title":"FT_Set_Transform"},{"location":"ft2-base_interface.html#ft_get_transform","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Get_Transform ( FT_Face face, FT_Matrix * matrix, FT_Vector * delta ); Return the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph . See FT_Set_Transform for more details.","title":"FT_Get_Transform"},{"location":"ft2-base_interface.html#ft_load_glyph","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Load_Glyph ( FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags ); Load a glyph into the glyph slot of a face object.","title":"FT_Load_Glyph"},{"location":"ft2-base_interface.html#ft_get_char_index","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Get_Char_Index ( FT_Face face, FT_ULong charcode ); Return the glyph index of a given character code. This function uses the currently selected charmap to do the mapping.","title":"FT_Get_Char_Index"},{"location":"ft2-base_interface.html#ft_get_first_char","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_ULong ) FT_Get_First_Char ( FT_Face face, FT_UInt *agindex ); Return the first character code in the current charmap of a given face, together with its corresponding glyph index.","title":"FT_Get_First_Char"},{"location":"ft2-base_interface.html#ft_get_next_char","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_ULong ) FT_Get_Next_Char ( FT_Face face, FT_ULong char_code, FT_UInt *agindex ); 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.","title":"FT_Get_Next_Char"},{"location":"ft2-base_interface.html#ft_get_name_index","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Get_Name_Index ( FT_Face face, const FT_String * glyph_name ); Return the glyph index of a given glyph name.","title":"FT_Get_Name_Index"},{"location":"ft2-base_interface.html#ft_load_char","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Load_Char ( FT_Face face, FT_ULong char_code, FT_Int32 load_flags ); Load a glyph into the glyph slot of a face object, accessed by its character code.","title":"FT_Load_Char"},{"location":"ft2-base_interface.html#ft_load_target_mode","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_TARGET_MODE ( x ) \\ FT_STATIC_CAST( FT_Render_Mode , ( (x) >> 16 ) & 15 ) Return the FT_Render_Mode corresponding to a given FT_LOAD_TARGET_XXX value.","title":"FT_LOAD_TARGET_MODE"},{"location":"ft2-base_interface.html#ft_render_glyph","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Render_Glyph ( FT_GlyphSlot slot, FT_Render_Mode render_mode ); Convert a given glyph image to a bitmap. It does so by inspecting the glyph image format, finding the relevant renderer, and invoking it.","title":"FT_Render_Glyph"},{"location":"ft2-base_interface.html#ft_render_mode","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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_SDF , FT_RENDER_MODE_MAX } FT_Render_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Render_Mode ` values instead */ # define ft_render_mode_normal FT_RENDER_MODE_NORMAL # define ft_render_mode_mono FT_RENDER_MODE_MONO Render modes supported by FreeType 2. Each mode corresponds to a specific type of scanline conversion performed on the outline. For bitmap fonts and embedded bitmaps the bitmap->pixel_mode field in the FT_GlyphSlotRec structure gives the format of the returned bitmap. All modes except FT_RENDER_MODE_MONO use 256 levels of opacity, indicating pixel coverage. Use linear alpha blending and gamma correction to correctly render non-monochrome glyph bitmaps onto a surface; see FT_Render_Glyph . The FT_RENDER_MODE_SDF is a special render mode that uses up to 256 distance values, indicating the signed distance from the grid position to the nearest outline.","title":"FT_Render_Mode"},{"location":"ft2-base_interface.html#ft_get_kerning","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Return the kerning vector between two glyphs of the same face.","title":"FT_Get_Kerning"},{"location":"ft2-base_interface.html#ft_kerning_mode","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef enum FT_Kerning_Mode_ { FT_KERNING_DEFAULT = 0, FT_KERNING_UNFITTED , FT_KERNING_UNSCALED } FT_Kerning_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Kerning_Mode ` values instead */ # define ft_kerning_default FT_KERNING_DEFAULT # define ft_kerning_unfitted FT_KERNING_UNFITTED # define ft_kerning_unscaled FT_KERNING_UNSCALED An enumeration to specify the format of kerning values returned by FT_Get_Kerning .","title":"FT_Kerning_Mode"},{"location":"ft2-base_interface.html#ft_get_track_kerning","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_Track_Kerning ( FT_Face face, FT_Fixed point_size, FT_Int degree, FT_Fixed * akerning ); Return the track kerning for a given face object at a given size.","title":"FT_Get_Track_Kerning"},{"location":"ft2-base_interface.html#ft_get_glyph_name","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_Glyph_Name ( FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max ); Retrieve the ASCII name of a given glyph in a face. This only works for those faces where FT_HAS_GLYPH_NAMES (face) returns 1.","title":"FT_Get_Glyph_Name"},{"location":"ft2-base_interface.html#ft_get_postscript_name","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( const char * ) FT_Get_Postscript_Name ( FT_Face face ); Retrieve the ASCII PostScript name of a given face, if available. This only works with PostScript, TrueType, and OpenType fonts.","title":"FT_Get_Postscript_Name"},{"location":"ft2-base_interface.html#ft_charmaprec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_CharMapRec_ { FT_Face face; FT_Encoding encoding; FT_UShort platform_id; FT_UShort encoding_id; } FT_CharMapRec ; The base charmap structure.","title":"FT_CharMapRec"},{"location":"ft2-base_interface.html#ft_select_charmap","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Select_Charmap ( FT_Face face, FT_Encoding encoding ); Select a given charmap by its encoding tag (as listed in freetype.h ).","title":"FT_Select_Charmap"},{"location":"ft2-base_interface.html#ft_set_charmap","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Set_Charmap ( FT_Face face, FT_CharMap charmap ); Select a given charmap for character code to glyph index mapping.","title":"FT_Set_Charmap"},{"location":"ft2-base_interface.html#ft_get_charmap_index","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Int ) FT_Get_Charmap_Index ( FT_CharMap charmap ); Retrieve index of a given charmap.","title":"FT_Get_Charmap_Index"},{"location":"ft2-base_interface.html#ft_get_fstype_flags","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UShort ) FT_Get_FSType_Flags ( FT_Face face ); Return the fsType flags for a font.","title":"FT_Get_FSType_Flags"},{"location":"ft2-base_interface.html#ft_get_subglyph_info","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_SubGlyph_Info ( FT_GlyphSlot glyph, FT_UInt sub_index, FT_Int *p_index, FT_UInt *p_flags, FT_Int *p_arg1, FT_Int *p_arg2, FT_Matrix *p_transform ); Retrieve a description of a given subglyph. Only use it if glyph->format is FT_GLYPH_FORMAT_COMPOSITE ; an error is returned otherwise.","title":"FT_Get_SubGlyph_Info"},{"location":"ft2-base_interface.html#ft_face_internal","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Face_InternalRec_* FT_Face_Internal ; An opaque handle to an FT_Face_InternalRec structure that models the 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.","title":"FT_Face_Internal"},{"location":"ft2-base_interface.html#ft_size_internal","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_InternalRec_* FT_Size_Internal ; An opaque handle to an FT_Size_InternalRec structure, used to model private data of a given FT_Size object.","title":"FT_Size_Internal"},{"location":"ft2-base_interface.html#ft_slot_internal","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Slot_InternalRec_* FT_Slot_Internal ; An opaque handle to an FT_Slot_InternalRec structure, used to model private data of a given FT_GlyphSlot object.","title":"FT_Slot_Internal"},{"location":"ft2-base_interface.html#ft_face_flag_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # 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 ) # define FT_FACE_FLAG_HINTER ( 1L << 11 ) # define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) # define FT_FACE_FLAG_TRICKY ( 1L << 13 ) # define FT_FACE_FLAG_COLOR ( 1L << 14 ) # define FT_FACE_FLAG_VARIATION ( 1L << 15 ) 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.","title":"FT_FACE_FLAG_XXX"},{"location":"ft2-base_interface.html#ft_style_flag_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) # define FT_STYLE_FLAG_BOLD ( 1 << 1 ) A list of bit flags to indicate the style of a given face. These are used in the style_flags field of FT_FaceRec .","title":"FT_STYLE_FLAG_XXX"},{"location":"ft2-base_interface.html#ft_open_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_OPEN_MEMORY 0x1 # define FT_OPEN_STREAM 0x2 # define FT_OPEN_PATHNAME 0x4 # define FT_OPEN_DRIVER 0x8 # define FT_OPEN_PARAMS 0x10 /* these constants are deprecated; use the corresponding ` FT_OPEN_XXX ` */ /* values instead */ # 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 A list of bit field constants used within the flags field of the FT_Open_Args structure.","title":"FT_OPEN_XXX"},{"location":"ft2-base_interface.html#ft_load_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_DEFAULT 0x0 # define FT_LOAD_NO_SCALE ( 1L << 0 ) # define FT_LOAD_NO_HINTING ( 1L << 1 ) # define FT_LOAD_RENDER ( 1L << 2 ) # define FT_LOAD_NO_BITMAP ( 1L << 3 ) # define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 ) # define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 ) # define FT_LOAD_CROP_BITMAP ( 1L << 6 ) # define FT_LOAD_PEDANTIC ( 1L << 7 ) # define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 ) # define FT_LOAD_NO_RECURSE ( 1L << 10 ) # define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 ) # define FT_LOAD_MONOCHROME ( 1L << 12 ) # define FT_LOAD_LINEAR_DESIGN ( 1L << 13 ) # define FT_LOAD_NO_AUTOHINT ( 1L << 15 ) /* Bits 16-19 are used by `FT_LOAD_TARGET_` */ # define FT_LOAD_COLOR ( 1L << 20 ) # define FT_LOAD_COMPUTE_METRICS ( 1L << 21 ) # define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 ) A list of bit field constants for FT_Load_Glyph to indicate what kind of operations to perform during glyph loading.","title":"FT_LOAD_XXX"},{"location":"ft2-base_interface.html#ft_load_target_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_TARGET_( x ) ( FT_STATIC_CAST( FT_Int32 , (x) & 15 ) << 16 ) # 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 ) A list of values to select a specific hinting algorithm for the hinter. You should OR one of these values to your load_flags when calling FT_Load_Glyph . Note that a font's native hinters may ignore the hinting algorithm you have specified (e.g., the TrueType bytecode interpreter). You can set FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.","title":"FT_LOAD_TARGET_XXX"},{"location":"ft2-base_interface.html#ft_subglyph_flag_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 # define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 # define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 # define FT_SUBGLYPH_FLAG_SCALE 8 # define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 # define FT_SUBGLYPH_FLAG_2X2 0x80 # define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 A list of constants describing subglyphs. Please refer to the \u2018glyf\u2019 table description in the OpenType specification for the meaning of the various flags (which get synthesized for non-OpenType subglyphs). https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description","title":"FT_SUBGLYPH_FLAG_XXX"},{"location":"ft2-base_interface.html#ft_fstype_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000 # define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002 # define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004 # define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008 # define FT_FSTYPE_NO_SUBSETTING 0x0100 # define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200 A list of bit flags used in the fsType field of the OS/2 table in a TrueType or OpenType font and the FSType entry in a PostScript font. These bit flags are returned by FT_Get_FSType_Flags ; they inform client applications of embedding and subsetting restrictions associated with a font. See https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf for more details.","title":"FT_FSTYPE_XXX"},{"location":"ft2-base_interface.html#ft_has_fast_glyphs","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_FAST_GLYPHS ( face ) 0 Deprecated.","title":"FT_HAS_FAST_GLYPHS"},{"location":"ft2-basic_types.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Basic Data Types Basic Data Types \u00b6 Synopsis \u00b6 This section contains the basic data types defined by FreeType 2, ranging from simple scalar types to bitmap descriptors. More font-specific structures are defined in a different section. FT_Byte \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned char FT_Byte ; A simple typedef for the unsigned char type. FT_Bytes \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef const FT_Byte * FT_Bytes ; A typedef for constant memory areas. FT_Char \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed char FT_Char ; A simple typedef for the signed char type. FT_Int \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed int FT_Int ; A typedef for the int type. FT_UInt \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned int FT_UInt ; A typedef for the unsigned int type. FT_Int16 \u00b6 typedef signed short FT_Int16 ; A typedef for a 16bit signed integer type. FT_UInt16 \u00b6 typedef unsigned short FT_UInt16 ; A typedef for a 16bit unsigned integer type. FT_Int32 \u00b6 typedef signed XXX FT_Int32 ; A typedef for a 32bit signed integer type. The size depends on the configuration. FT_UInt32 \u00b6 typedef unsigned XXX FT_UInt32 ; FT_Int64 \u00b6 typedef signed XXX FT_Int64 ; FT_UInt64 \u00b6 typedef unsigned XXX FT_UInt64 ; FT_Short \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_Short ; A typedef for signed short. FT_UShort \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned short FT_UShort ; A typedef for unsigned short. FT_Long \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_Long ; A typedef for signed long. FT_ULong \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned long FT_ULong ; A typedef for unsigned long. FT_Bool \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned char FT_Bool ; A typedef of unsigned char, used for simple booleans. As usual, values 1 and 0 represent true and false, respectively. FT_Offset \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef size_t FT_Offset ; This is equivalent to the ANSI C size_t type, i.e., the largest unsigned integer type used to express a file size or position, or a memory block size. FT_PtrDist \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef ft_ptrdiff_t FT_PtrDist ; This is equivalent to the ANSI C ptrdiff_t type, i.e., the largest signed integer type used to express the distance between two pointers. FT_String \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef char FT_String ; A simple typedef for the char type, usually used for strings. FT_Tag \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef FT_UInt32 FT_Tag ; A typedef for 32-bit tags (as used in the SFNT format). FT_Error \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef int FT_Error ; The FreeType error code type. A value of 0 is always interpreted as a successful operation. FT_Fixed \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_Fixed ; This type is used to store 16.16 fixed-point values, like scaling values or matrix coefficients. FT_Pointer \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef void * FT_Pointer ; A simple typedef for a typeless pointer. FT_Pos \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef signed long FT_Pos ; The type FT_Pos is used to store vectorial coordinates. Depending on the context, these can represent distances in integer font units, or 16.16, or 26.6 fixed-point pixel coordinates. FT_Vector \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Vector_ { FT_Pos x; FT_Pos y; } FT_Vector ; 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. FT_BBox \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_BBox_ { FT_Pos xMin, yMin; FT_Pos xMax, yMax; } FT_BBox ; 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). note The bounding box is specified with the coordinates of the lower left and the upper right corner. In PostScript, those values are often called (llx,lly) and (urx,ury), respectively. If yMin is negative, this value gives the glyph's descender. Otherwise, the glyph doesn't descend below the baseline. Similarly, if ymax is positive, this value gives the glyph's ascender. xMin gives the horizontal distance from the glyph's origin to the left edge of the glyph's bounding box. If xMin is negative, the glyph extends to the left of the origin. FT_Matrix \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Matrix_ { FT_Fixed xx, xy; FT_Fixed yx, yy; } FT_Matrix ; A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is: x' = x*xx + y*xy y' = x*yx + y*yy fields xx Matrix coefficient. xy Matrix coefficient. yx Matrix coefficient. yy Matrix coefficient. FT_FWord \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_FWord ; /* distance in FUnits */ A signed 16-bit integer used to store a distance in original font units. FT_UFWord \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned short FT_UFWord ; /* unsigned distance */ An unsigned 16-bit integer used to store a distance in original font units. FT_F2Dot14 \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_F2Dot14 ; A signed 2.14 fixed-point type used for unit vectors. FT_UnitVector \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_UnitVector_ { FT_F2Dot14 x; FT_F2Dot14 y; } FT_UnitVector ; A simple structure used to store a 2D vector unit vector. Uses FT_F2Dot14 types. fields x Horizontal coordinate. y Vertical coordinate. FT_F26Dot6 \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_F26Dot6 ; A signed 26.6 fixed-point type used for vectorial pixel coordinates. FT_Data \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Data_ { const FT_Byte * pointer; FT_UInt length; } FT_Data ; Read-only binary data represented as a pointer and a length. fields pointer The data. length The length of the data in bytes. FT_MAKE_TAG \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). # define FT_MAKE_TAG ( _x1, _x2, _x3, _x4 ) \\ ( ( FT_STATIC_BYTE_CAST( FT_Tag , _x1 ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( FT_Tag , _x2 ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( FT_Tag , _x3 ) << 8 ) | \\ FT_STATIC_BYTE_CAST( FT_Tag , _x4 ) ) This macro converts four-letter tags that are used to label TrueType tables into an FT_Tag type, to be used within FreeType. note The produced values must be 32-bit integers. Don't redefine this macro. FT_Generic \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Generic_ { void * data; FT_Generic_Finalizer finalizer; } FT_Generic ; Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might want to associate a glyph cache to a given size object. Some FreeType object contains a generic field, of type FT_Generic , which usage is left to client applications and font servers. It can be used to store a pointer to client-specific data, as well as the address of a \u2018finalizer\u2019 function, which will be called by FreeType when the object is destroyed (for example, the previous client example would put the address of the glyph cache destructor in the finalizer field). fields data A typeless pointer to any client-specified data. This field is completely ignored by the FreeType library. finalizer A pointer to a \u2018generic finalizer\u2019 function, which will be called when the object is destroyed. If this field is set to NULL , no code will be called. FT_Generic_Finalizer \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef void (* FT_Generic_Finalizer )( void * object ); Describe a function used to destroy the \u2018client\u2019 data of any FreeType object. See the description of the FT_Generic type for details of usage. input The address of the FreeType object that is under finalization. Its client data is accessed through its generic field. FT_Bitmap \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Bitmap_ { unsigned int rows; unsigned int width; int pitch; unsigned char * buffer; unsigned short num_grays; unsigned char pixel_mode; unsigned char palette_mode; void * palette; } FT_Bitmap ; 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 \u2018down\u2019 flow, and negative when it has an \u2018up\u2019 flow. In all cases, the pitch is an offset to add to a bitmap pointer in order to go down one row. Note that \u2018padding\u2019 means the alignment of a bitmap to a byte border, and FreeType functions normally align to the smallest possible integer value. For the B/W rasterizer, pitch is always an even number. To change the pitch of a bitmap (say, to make it a multiple of 4), use FT_Bitmap_Convert . Alternatively, you might use callback functions to directly render to the application's surface; see the file example2.cpp in the tutorial for a demonstration. 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. See FT_Pixel_Mode for possible values. palette_mode This field is intended for paletted pixel modes; it indicates how the palette is stored. Not used currently. palette A typeless pointer to the bitmap palette; this field is intended for paletted pixel modes. Not used currently. FT_Pixel_Mode \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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_BGRA , FT_PIXEL_MODE_MAX /* do not remove */ } FT_Pixel_Mode ; /* these constants are deprecated; use the corresponding ` FT_Pixel_Mode ` */ /* values instead. */ # 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 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 \u2018gray\u2019 levels is stored in the num_grays field of the FT_Bitmap structure (it generally is 256). FT_PIXEL_MODE_GRAY2 A 2-bit per 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 per pixel bitmap, representing 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, representing RGB or BGR decimated glyph images used for display on LCD displays; the bitmap is three times wider than the original glyph image. See also FT_RENDER_MODE_LCD . FT_PIXEL_MODE_LCD_V An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on rotated LCD displays; the bitmap is three times taller than the original glyph image. See also FT_RENDER_MODE_LCD_V . FT_PIXEL_MODE_BGRA [Since 2.5] An image with four 8-bit channels per pixel, representing a color image (such as emoticons) with alpha channel. For each pixel, the format is BGRA, which means, the blue channel comes first in memory. The color channels are pre-multiplied and in the sRGB colorspace. For example, full red at half-translucent opacity will be represented as \u201800,00,80,80\u2019, not \u201800,00,FF,80\u2019. See also FT_LOAD_COLOR . FT_Glyph_Format \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; /* these constants are deprecated; use the corresponding */ /* ` FT_Glyph_Format ` values instead. */ # 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 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. FT_GLYPH_FORMAT_COMPOSITE The glyph image is a composite of several other images. This format is only used with FT_LOAD_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 vectorial 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 and 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. FT_IMAGE_TAG \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). # ifndef FT_IMAGE_TAG # define FT_IMAGE_TAG ( value, _x1, _x2, _x3, _x4 ) \\ value = ( ( FT_STATIC_BYTE_CAST( unsigned long , _x1 ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( unsigned long , _x2 ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( unsigned long , _x3 ) << 8 ) | \\ FT_STATIC_BYTE_CAST( unsigned long , _x4 ) ) # endif /* FT_IMAGE_TAG */ This macro converts four-letter tags to an unsigned long type. note Since many 16-bit compilers don't like 32-bit 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.","title":"Basic Data Types"},{"location":"ft2-basic_types.html#basic-data-types","text":"","title":"Basic Data Types"},{"location":"ft2-basic_types.html#synopsis","text":"This section contains the basic data types defined by FreeType 2, ranging from simple scalar types to bitmap descriptors. More font-specific structures are defined in a different section.","title":"Synopsis"},{"location":"ft2-basic_types.html#ft_byte","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned char FT_Byte ; A simple typedef for the unsigned char type.","title":"FT_Byte"},{"location":"ft2-basic_types.html#ft_bytes","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef const FT_Byte * FT_Bytes ; A typedef for constant memory areas.","title":"FT_Bytes"},{"location":"ft2-basic_types.html#ft_char","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed char FT_Char ; A simple typedef for the signed char type.","title":"FT_Char"},{"location":"ft2-basic_types.html#ft_int","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed int FT_Int ; A typedef for the int type.","title":"FT_Int"},{"location":"ft2-basic_types.html#ft_uint","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned int FT_UInt ; A typedef for the unsigned int type.","title":"FT_UInt"},{"location":"ft2-basic_types.html#ft_int16","text":"typedef signed short FT_Int16 ; A typedef for a 16bit signed integer type.","title":"FT_Int16"},{"location":"ft2-basic_types.html#ft_uint16","text":"typedef unsigned short FT_UInt16 ; A typedef for a 16bit unsigned integer type.","title":"FT_UInt16"},{"location":"ft2-basic_types.html#ft_int32","text":"typedef signed XXX FT_Int32 ; A typedef for a 32bit signed integer type. The size depends on the configuration.","title":"FT_Int32"},{"location":"ft2-basic_types.html#ft_uint32","text":"typedef unsigned XXX FT_UInt32 ;","title":"FT_UInt32"},{"location":"ft2-basic_types.html#ft_int64","text":"typedef signed XXX FT_Int64 ;","title":"FT_Int64"},{"location":"ft2-basic_types.html#ft_uint64","text":"typedef unsigned XXX FT_UInt64 ;","title":"FT_UInt64"},{"location":"ft2-basic_types.html#ft_short","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_Short ; A typedef for signed short.","title":"FT_Short"},{"location":"ft2-basic_types.html#ft_ushort","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned short FT_UShort ; A typedef for unsigned short.","title":"FT_UShort"},{"location":"ft2-basic_types.html#ft_long","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_Long ; A typedef for signed long.","title":"FT_Long"},{"location":"ft2-basic_types.html#ft_ulong","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned long FT_ULong ; A typedef for unsigned long.","title":"FT_ULong"},{"location":"ft2-basic_types.html#ft_bool","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned char FT_Bool ; A typedef of unsigned char, used for simple booleans. As usual, values 1 and 0 represent true and false, respectively.","title":"FT_Bool"},{"location":"ft2-basic_types.html#ft_offset","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef size_t FT_Offset ; This is equivalent to the ANSI C size_t type, i.e., the largest unsigned integer type used to express a file size or position, or a memory block size.","title":"FT_Offset"},{"location":"ft2-basic_types.html#ft_ptrdist","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef ft_ptrdiff_t FT_PtrDist ; This is equivalent to the ANSI C ptrdiff_t type, i.e., the largest signed integer type used to express the distance between two pointers.","title":"FT_PtrDist"},{"location":"ft2-basic_types.html#ft_string","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef char FT_String ; A simple typedef for the char type, usually used for strings.","title":"FT_String"},{"location":"ft2-basic_types.html#ft_tag","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef FT_UInt32 FT_Tag ; A typedef for 32-bit tags (as used in the SFNT format).","title":"FT_Tag"},{"location":"ft2-basic_types.html#ft_error","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef int FT_Error ; The FreeType error code type. A value of 0 is always interpreted as a successful operation.","title":"FT_Error"},{"location":"ft2-basic_types.html#ft_fixed","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_Fixed ; This type is used to store 16.16 fixed-point values, like scaling values or matrix coefficients.","title":"FT_Fixed"},{"location":"ft2-basic_types.html#ft_pointer","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef void * FT_Pointer ; A simple typedef for a typeless pointer.","title":"FT_Pointer"},{"location":"ft2-basic_types.html#ft_pos","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef signed long FT_Pos ; The type FT_Pos is used to store vectorial coordinates. Depending on the context, these can represent distances in integer font units, or 16.16, or 26.6 fixed-point pixel coordinates.","title":"FT_Pos"},{"location":"ft2-basic_types.html#ft_vector","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Vector_ { FT_Pos x; FT_Pos y; } FT_Vector ; A simple structure used to store a 2D vector; coordinates are of the FT_Pos type.","title":"FT_Vector"},{"location":"ft2-basic_types.html#ft_bbox","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_BBox_ { FT_Pos xMin, yMin; FT_Pos xMax, yMax; } FT_BBox ; A structure used to hold an outline's bounding box, i.e., the coordinates of its extrema in the horizontal and vertical directions.","title":"FT_BBox"},{"location":"ft2-basic_types.html#ft_matrix","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Matrix_ { FT_Fixed xx, xy; FT_Fixed yx, yy; } FT_Matrix ; A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is: x' = x*xx + y*xy y' = x*yx + y*yy","title":"FT_Matrix"},{"location":"ft2-basic_types.html#ft_fword","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_FWord ; /* distance in FUnits */ A signed 16-bit integer used to store a distance in original font units.","title":"FT_FWord"},{"location":"ft2-basic_types.html#ft_ufword","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned short FT_UFWord ; /* unsigned distance */ An unsigned 16-bit integer used to store a distance in original font units.","title":"FT_UFWord"},{"location":"ft2-basic_types.html#ft_f2dot14","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_F2Dot14 ; A signed 2.14 fixed-point type used for unit vectors.","title":"FT_F2Dot14"},{"location":"ft2-basic_types.html#ft_unitvector","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_UnitVector_ { FT_F2Dot14 x; FT_F2Dot14 y; } FT_UnitVector ; A simple structure used to store a 2D vector unit vector. Uses FT_F2Dot14 types.","title":"FT_UnitVector"},{"location":"ft2-basic_types.html#ft_f26dot6","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_F26Dot6 ; A signed 26.6 fixed-point type used for vectorial pixel coordinates.","title":"FT_F26Dot6"},{"location":"ft2-basic_types.html#ft_data","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Data_ { const FT_Byte * pointer; FT_UInt length; } FT_Data ; Read-only binary data represented as a pointer and a length.","title":"FT_Data"},{"location":"ft2-basic_types.html#ft_make_tag","text":"Defined in FT_TYPES_H (freetype/fttypes.h). # define FT_MAKE_TAG ( _x1, _x2, _x3, _x4 ) \\ ( ( FT_STATIC_BYTE_CAST( FT_Tag , _x1 ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( FT_Tag , _x2 ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( FT_Tag , _x3 ) << 8 ) | \\ FT_STATIC_BYTE_CAST( FT_Tag , _x4 ) ) This macro converts four-letter tags that are used to label TrueType tables into an FT_Tag type, to be used within FreeType.","title":"FT_MAKE_TAG"},{"location":"ft2-basic_types.html#ft_generic","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Generic_ { void * data; FT_Generic_Finalizer finalizer; } FT_Generic ; Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might want to associate a glyph cache to a given size object. Some FreeType object contains a generic field, of type FT_Generic , which usage is left to client applications and font servers. It can be used to store a pointer to client-specific data, as well as the address of a \u2018finalizer\u2019 function, which will be called by FreeType when the object is destroyed (for example, the previous client example would put the address of the glyph cache destructor in the finalizer field).","title":"FT_Generic"},{"location":"ft2-basic_types.html#ft_generic_finalizer","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef void (* FT_Generic_Finalizer )( void * object ); Describe a function used to destroy the \u2018client\u2019 data of any FreeType object. See the description of the FT_Generic type for details of usage.","title":"FT_Generic_Finalizer"},{"location":"ft2-basic_types.html#ft_bitmap","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Bitmap_ { unsigned int rows; unsigned int width; int pitch; unsigned char * buffer; unsigned short num_grays; unsigned char pixel_mode; unsigned char palette_mode; void * palette; } FT_Bitmap ; 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.","title":"FT_Bitmap"},{"location":"ft2-basic_types.html#ft_pixel_mode","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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_BGRA , FT_PIXEL_MODE_MAX /* do not remove */ } FT_Pixel_Mode ; /* these constants are deprecated; use the corresponding ` FT_Pixel_Mode ` */ /* values instead. */ # 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 An enumeration type used to describe the format of pixels in a given bitmap. Note that additional formats may be added in the future.","title":"FT_Pixel_Mode"},{"location":"ft2-basic_types.html#ft_glyph_format","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; /* these constants are deprecated; use the corresponding */ /* ` FT_Glyph_Format ` values instead. */ # 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 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.","title":"FT_Glyph_Format"},{"location":"ft2-basic_types.html#ft_image_tag","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). # ifndef FT_IMAGE_TAG # define FT_IMAGE_TAG ( value, _x1, _x2, _x3, _x4 ) \\ value = ( ( FT_STATIC_BYTE_CAST( unsigned long , _x1 ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( unsigned long , _x2 ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( unsigned long , _x3 ) << 8 ) | \\ FT_STATIC_BYTE_CAST( unsigned long , _x4 ) ) # endif /* FT_IMAGE_TAG */ This macro converts four-letter tags to an unsigned long type.","title":"FT_IMAGE_TAG"},{"location":"ft2-bdf_fonts.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb BDF and PCF Files BDF and PCF Files \u00b6 Synopsis \u00b6 This section contains the declaration of functions specific to BDF and PCF fonts. BDF_PropertyType \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). typedef enum BDF_PropertyType_ { BDF_PROPERTY_TYPE_NONE = 0, BDF_PROPERTY_TYPE_ATOM = 1, BDF_PROPERTY_TYPE_INTEGER = 2, BDF_PROPERTY_TYPE_CARDINAL = 3 } BDF_PropertyType ; A list of BDF property types. values BDF_PROPERTY_TYPE_NONE Value 0 is used to indicate a missing property. BDF_PROPERTY_TYPE_ATOM Property is a string atom. BDF_PROPERTY_TYPE_INTEGER Property is a 32-bit signed integer. BDF_PROPERTY_TYPE_CARDINAL Property is a 32-bit unsigned integer. BDF_Property \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). typedef struct BDF_PropertyRec_* BDF_Property ; A handle to a BDF_PropertyRec structure to model a given BDF/PCF property. BDF_PropertyRec \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). typedef struct BDF_PropertyRec_ { BDF_PropertyType type; union { const char * atom; FT_Int32 integer; FT_UInt32 cardinal; } u; } BDF_PropertyRec ; This structure models a given BDF/PCF property. fields type The property type. u.atom The atom string, if type is BDF_PROPERTY_TYPE_ATOM . May be NULL , indicating an empty string. u.integer A signed integer, if type is BDF_PROPERTY_TYPE_INTEGER . u.cardinal An unsigned integer, if type is BDF_PROPERTY_TYPE_CARDINAL . FT_Get_BDF_Charset_ID \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). FT_EXPORT( FT_Error ) FT_Get_BDF_Charset_ID ( FT_Face face, const char * *acharset_encoding, const char * *acharset_registry ); Retrieve a BDF font character set identity, according to the BDF specification. input face A handle to the 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 error code. 0 means success. note This function only works with BDF faces, returning an error otherwise. FT_Get_BDF_Property \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). FT_EXPORT( FT_Error ) FT_Get_BDF_Property ( FT_Face face, const char * prop_name, BDF_PropertyRec *aproperty ); Retrieve a BDF property from a BDF or PCF font file. input face A handle to the input face. name The property name. output aproperty The property. return FreeType error code. 0 means success. note This function works with BDF and PCF fonts. It returns an error otherwise. It also returns an error if the property is not in the font. A \u2018property\u2019 is a either key-value pair within the STARTPROPERTIES \u2026 ENDPROPERTIES block of a BDF font or a key-value pair from the info->props array within a FontRec structure of a PCF font. Integer properties are always stored as \u2018signed\u2019 within PCF fonts; consequently, BDF_PROPERTY_TYPE_CARDINAL is a possible return value for BDF fonts only. In case of error, aproperty->type is always set to BDF_PROPERTY_TYPE_NONE .","title":"BDF and PCF Files"},{"location":"ft2-bdf_fonts.html#bdf-and-pcf-files","text":"","title":"BDF and PCF Files"},{"location":"ft2-bdf_fonts.html#synopsis","text":"This section contains the declaration of functions specific to BDF and PCF fonts.","title":"Synopsis"},{"location":"ft2-bdf_fonts.html#bdf_propertytype","text":"Defined in FT_BDF_H (freetype/ftbdf.h). typedef enum BDF_PropertyType_ { BDF_PROPERTY_TYPE_NONE = 0, BDF_PROPERTY_TYPE_ATOM = 1, BDF_PROPERTY_TYPE_INTEGER = 2, BDF_PROPERTY_TYPE_CARDINAL = 3 } BDF_PropertyType ; A list of BDF property types.","title":"BDF_PropertyType"},{"location":"ft2-bdf_fonts.html#bdf_property","text":"Defined in FT_BDF_H (freetype/ftbdf.h). typedef struct BDF_PropertyRec_* BDF_Property ; A handle to a BDF_PropertyRec structure to model a given BDF/PCF property.","title":"BDF_Property"},{"location":"ft2-bdf_fonts.html#bdf_propertyrec","text":"Defined in FT_BDF_H (freetype/ftbdf.h). typedef struct BDF_PropertyRec_ { BDF_PropertyType type; union { const char * atom; FT_Int32 integer; FT_UInt32 cardinal; } u; } BDF_PropertyRec ; This structure models a given BDF/PCF property.","title":"BDF_PropertyRec"},{"location":"ft2-bdf_fonts.html#ft_get_bdf_charset_id","text":"Defined in FT_BDF_H (freetype/ftbdf.h). FT_EXPORT( FT_Error ) FT_Get_BDF_Charset_ID ( FT_Face face, const char * *acharset_encoding, const char * *acharset_registry ); Retrieve a BDF font character set identity, according to the BDF specification.","title":"FT_Get_BDF_Charset_ID"},{"location":"ft2-bdf_fonts.html#ft_get_bdf_property","text":"Defined in FT_BDF_H (freetype/ftbdf.h). FT_EXPORT( FT_Error ) FT_Get_BDF_Property ( FT_Face face, const char * prop_name, BDF_PropertyRec *aproperty ); Retrieve a BDF property from a BDF or PCF font file.","title":"FT_Get_BDF_Property"},{"location":"ft2-bitmap_handling.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Bitmap Handling Bitmap Handling \u00b6 Synopsis \u00b6 This section contains functions for handling FT_Bitmap objects, automatically adjusting the target's bitmap buffer size as needed. Note that none of the functions changes the bitmap's \u2018flow\u2019 (as indicated by the sign of the pitch field in FT_Bitmap ). To set the flow, assign an appropriate positive or negative value to the pitch field of the target FT_Bitmap object after calling FT_Bitmap_Init but before calling any of the other functions described here. FT_Bitmap_Init \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( void ) FT_Bitmap_Init ( FT_Bitmap *abitmap ); /* deprecated */ FT_EXPORT( void ) FT_Bitmap_New( FT_Bitmap *abitmap ); Initialize a pointer to an FT_Bitmap structure. inout abitmap A pointer to the bitmap structure. note A deprecated name for the same function is FT_Bitmap_New . FT_Bitmap_Copy \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Copy ( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target ); Copy a bitmap into another one. input library A handle to a library object. source A handle to the source bitmap. output target A handle to the target bitmap. return FreeType error code. 0 means success. note source->buffer and target->buffer must neither be equal nor overlap. FT_Bitmap_Embolden \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Embolden ( FT_Library library, FT_Bitmap * bitmap, FT_Pos xStrength, FT_Pos yStrength ); Embolden a bitmap. The new bitmap will be about xStrength pixels wider and yStrength pixels higher. The left and bottom borders are kept unchanged. input library A handle to a library object. xStrength How strong the glyph is emboldened horizontally. Expressed in 26.6 pixel format. yStrength How strong the glyph is emboldened vertically. Expressed in 26.6 pixel format. inout bitmap A handle to the target bitmap. return FreeType error code. 0 means success. note The current implementation restricts xStrength to be less than or equal to 8 if bitmap is of pixel_mode FT_PIXEL_MODE_MONO . If you want to embolden the bitmap owned by a FT_GlyphSlotRec , you should call FT_GlyphSlot_Own_Bitmap on the slot first. Bitmaps in FT_PIXEL_MODE_GRAY2 and FT_PIXEL_MODE_GRAY @ format are converted to FT_PIXEL_MODE_GRAY format (i.e., 8bpp). FT_Bitmap_Convert \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Convert ( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target, FT_Int alignment ); Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to a bitmap object with depth 8bpp, making the number of used bytes per line (a.k.a. the \u2018pitch\u2019) a multiple of alignment . input library A handle to a library object. source The source bitmap. alignment The pitch of the bitmap is a multiple of this argument. Common values are 1, 2, or 4. output target The target bitmap. return FreeType error code. 0 means success. note It is possible to call FT_Bitmap_Convert multiple times without calling FT_Bitmap_Done (the memory is simply reallocated). Use FT_Bitmap_Done to finally remove the bitmap object. The library argument is taken to have access to FreeType's memory handling functions. source->buffer and target->buffer must neither be equal nor overlap. FT_Bitmap_Blend \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Blend ( FT_Library library, const FT_Bitmap * source, const FT_Vector source_offset, FT_Bitmap * target, FT_Vector *atarget_offset, FT_Color color ); Blend a bitmap onto another bitmap, using a given color. input library A handle to a library object. source The source bitmap, which can have any FT_Pixel_Mode format. source_offset The offset vector to the upper left corner of the source bitmap in 26.6 pixel format. It should represent an integer offset; the function will set the lowest six bits to zero to enforce that. color The color used to draw source onto target . inout target A handle to an FT_Bitmap object. It should be either initialized as empty with a call to FT_Bitmap_Init , or it should be of type FT_PIXEL_MODE_BGRA . atarget_offset The offset vector to the upper left corner of the target bitmap in 26.6 pixel format. It should represent an integer offset; the function will set the lowest six bits to zero to enforce that. return FreeType error code. 0 means success. note This function doesn't perform clipping. The bitmap in target gets allocated or reallocated as needed; the vector atarget_offset is updated accordingly. In case of allocation or reallocation, the bitmap's pitch is set to 4 * width . Both source and target must have the same bitmap flow (as indicated by the sign of the pitch field). source->buffer and target->buffer must neither be equal nor overlap. since 2.10 FT_GlyphSlot_Own_Bitmap \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_GlyphSlot_Own_Bitmap ( FT_GlyphSlot slot ); Make sure that a glyph slot owns slot->bitmap . input slot The glyph slot. return FreeType error code. 0 means success. note This function is to be used in combination with FT_Bitmap_Embolden . FT_Bitmap_Done \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Done ( FT_Library library, FT_Bitmap *bitmap ); Destroy a bitmap object initialized with FT_Bitmap_Init . input library A handle to a library object. bitmap The bitmap object to be freed. return FreeType error code. 0 means success. note The library argument is taken to have access to FreeType's memory handling functions.","title":"Bitmap Handling"},{"location":"ft2-bitmap_handling.html#bitmap-handling","text":"","title":"Bitmap Handling"},{"location":"ft2-bitmap_handling.html#synopsis","text":"This section contains functions for handling FT_Bitmap objects, automatically adjusting the target's bitmap buffer size as needed. Note that none of the functions changes the bitmap's \u2018flow\u2019 (as indicated by the sign of the pitch field in FT_Bitmap ). To set the flow, assign an appropriate positive or negative value to the pitch field of the target FT_Bitmap object after calling FT_Bitmap_Init but before calling any of the other functions described here.","title":"Synopsis"},{"location":"ft2-bitmap_handling.html#ft_bitmap_init","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( void ) FT_Bitmap_Init ( FT_Bitmap *abitmap ); /* deprecated */ FT_EXPORT( void ) FT_Bitmap_New( FT_Bitmap *abitmap ); Initialize a pointer to an FT_Bitmap structure.","title":"FT_Bitmap_Init"},{"location":"ft2-bitmap_handling.html#ft_bitmap_copy","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Copy ( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target ); Copy a bitmap into another one.","title":"FT_Bitmap_Copy"},{"location":"ft2-bitmap_handling.html#ft_bitmap_embolden","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Embolden ( FT_Library library, FT_Bitmap * bitmap, FT_Pos xStrength, FT_Pos yStrength ); Embolden a bitmap. The new bitmap will be about xStrength pixels wider and yStrength pixels higher. The left and bottom borders are kept unchanged.","title":"FT_Bitmap_Embolden"},{"location":"ft2-bitmap_handling.html#ft_bitmap_convert","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Convert ( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target, FT_Int alignment ); Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to a bitmap object with depth 8bpp, making the number of used bytes per line (a.k.a. the \u2018pitch\u2019) a multiple of alignment .","title":"FT_Bitmap_Convert"},{"location":"ft2-bitmap_handling.html#ft_bitmap_blend","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Blend ( FT_Library library, const FT_Bitmap * source, const FT_Vector source_offset, FT_Bitmap * target, FT_Vector *atarget_offset, FT_Color color ); Blend a bitmap onto another bitmap, using a given color.","title":"FT_Bitmap_Blend"},{"location":"ft2-bitmap_handling.html#ft_glyphslot_own_bitmap","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_GlyphSlot_Own_Bitmap ( FT_GlyphSlot slot ); Make sure that a glyph slot owns slot->bitmap .","title":"FT_GlyphSlot_Own_Bitmap"},{"location":"ft2-bitmap_handling.html#ft_bitmap_done","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Done ( FT_Library library, FT_Bitmap *bitmap ); Destroy a bitmap object initialized with FT_Bitmap_Init .","title":"FT_Bitmap_Done"},{"location":"ft2-bzip2.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb BZIP2 Streams BZIP2 Streams \u00b6 Synopsis \u00b6 In certain builds of the library, bzip2 compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a bzip2 compressed stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of Bzip2-specific functions. FT_Stream_OpenBzip2 \u00b6 Defined in FT_BZIP2_H (freetype/ftbzip2.h). FT_EXPORT( FT_Error ) FT_Stream_OpenBzip2 ( FT_Stream stream, FT_Stream source ); Open a new stream to parse bzip2-compressed font files. This is mainly used to support the compressed *.pcf.bz2 fonts that come with XFree86. input stream The target embedding stream. source The source stream. return FreeType error code. 0 means success. note The source stream must be opened before calling this function. Calling the internal function FT_Stream_Close on the new stream will not call FT_Stream_Close on the source stream. None of the stream objects will be released to the heap. This function may return FT_Err_Unimplemented_Feature if your build of FreeType was not compiled with bzip2 support.","title":"BZIP2 Streams"},{"location":"ft2-bzip2.html#bzip2-streams","text":"","title":"BZIP2 Streams"},{"location":"ft2-bzip2.html#synopsis","text":"In certain builds of the library, bzip2 compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a bzip2 compressed stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of Bzip2-specific functions.","title":"Synopsis"},{"location":"ft2-bzip2.html#ft_stream_openbzip2","text":"Defined in FT_BZIP2_H (freetype/ftbzip2.h). FT_EXPORT( FT_Error ) FT_Stream_OpenBzip2 ( FT_Stream stream, FT_Stream source ); Open a new stream to parse bzip2-compressed font files. This is mainly used to support the compressed *.pcf.bz2 fonts that come with XFree86.","title":"FT_Stream_OpenBzip2"},{"location":"ft2-cache_subsystem.html","text":"FreeType \u00bb Docs \u00bb Cache Sub-System \u00bb Cache Sub-System Cache Sub-System \u00b6 Synopsis \u00b6 This section describes the FreeType 2 cache sub-system, which is used to limit the number of concurrently opened FT_Face and FT_Size objects, as well as caching information like character maps and glyph images while limiting their maximum memory usage. Note that all types and functions begin with the FTC_ prefix. The cache is highly portable and thus doesn't know anything about the fonts installed on your system, or how to access them. This implies the following scheme: First, available or installed font faces are uniquely identified by FTC_FaceID values, provided to the cache by the client. Note that the cache only stores and compares these values, and doesn't try to interpret them in any way. Second, the cache calls, only when needed, a client-provided function to convert an FTC_FaceID into a new FT_Face object. The latter is then completely managed by the cache, including its termination through FT_Done_Face . To monitor termination of face objects, the finalizer callback in the generic field of the FT_Face object can be used, which might also be used to store the FTC_FaceID of the face. Clients are free to map face IDs to anything else. The most simple usage is to associate them to a (pathname,face_index) pair that is used to call FT_New_Face . However, more complex schemes are also possible. Note that for the cache to work correctly, the face ID values must be persistent , which means that the contents they point to should not change at runtime, or that their value should not become invalid. If this is unavoidable (e.g., when a font is uninstalled at runtime), you should call FTC_Manager_RemoveFaceID as soon as possible, to let the cache get rid of any references to the old FTC_FaceID it may keep internally. Failure to do so will lead to incorrect behaviour or even crashes. To use the cache, start with calling FTC_Manager_New to create a new FTC_Manager object, which models a single cache instance. You can then look up FT_Face and FT_Size objects with FTC_Manager_LookupFace and FTC_Manager_LookupSize , respectively. If you want to use the charmap caching, call FTC_CMapCache_New , then later use FTC_CMapCache_Lookup to perform the equivalent of FT_Get_Char_Index , only much faster. If you want to use the FT_Glyph caching, call FTC_ImageCache_New , then later use FTC_ImageCache_Lookup to retrieve the corresponding FT_Glyph objects from the cache. If you need lots of small bitmaps, it is much more memory efficient to call FTC_SBitCache_New followed by FTC_SBitCache_Lookup . This returns FTC_SBitRec structures, which are used to store small bitmaps directly. (A small bitmap is one whose metrics and dimensions all fit into 8-bit integers). We hope to also provide a kerning cache in the near future. FTC_Manager \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ManagerRec_* FTC_Manager ; This object corresponds to one instance of the cache-subsystem. It is used to cache one or more FT_Face objects, along with corresponding FT_Size objects. The manager intentionally limits the total number of opened FT_Face and FT_Size objects to control memory usage. See the max_faces and max_sizes parameters of FTC_Manager_New . The manager is also used to cache \u2018nodes\u2019 of various types while limiting their total memory usage. All limitations are enforced by keeping lists of managed objects in most-recently-used order, and flushing old nodes to make room for new ones. FTC_FaceID \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef FT_Pointer FTC_FaceID ; An opaque pointer type that is used to identity face objects. The contents of such objects is application-dependent. These pointers are typically used to point to a user-defined structure containing a font file path, and face index. note Never use NULL as a valid FTC_FaceID . Face IDs are passed by the client to the cache manager that calls, when needed, the FTC_Face_Requester to translate them into new FT_Face objects. If the content of a given face ID changes at runtime, or if the value becomes invalid (e.g., when uninstalling a font), you should immediately call FTC_Manager_RemoveFaceID before any other cache function. Failure to do so will result in incorrect behaviour or even memory leaks and crashes. FTC_Face_Requester \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef FT_Error (* FTC_Face_Requester )( FTC_FaceID face_id, FT_Library library, FT_Pointer req_data, FT_Face * aface ); A callback function provided by client applications. It is used by the cache manager to translate a given FTC_FaceID into a new valid FT_Face object, on demand. input face_id The face ID to resolve. library A handle to a FreeType library object. req_data Application-provided request data (see note below). output aface A new FT_Face handle. return FreeType error code. 0 means success. note The third parameter req_data is the same as the one passed by the client when FTC_Manager_New is called. 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 ! FTC_Manager_New \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). 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 ); Create a new cache manager. input library The parent FreeType library handle to use. max_faces Maximum number of opened FT_Face objects managed by this cache instance. Use 0 for defaults. max_sizes Maximum number of opened FT_Size objects managed by this cache instance. Use 0 for defaults. max_bytes Maximum number of bytes to use for cached data nodes. Use 0 for defaults. Note that this value does not account for managed FT_Face and FT_Size objects. 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. FTC_Manager_Reset \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_Reset ( FTC_Manager manager ); Empty 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. FTC_Manager_Done \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_Done ( FTC_Manager manager ); Destroy a given manager after emptying it. input manager A handle to the target cache manager object. FTC_Manager_LookupFace \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_Manager_LookupFace ( FTC_Manager manager, FTC_FaceID face_id, FT_Face *aface ); Retrieve 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 \u2018font size\u2019, use FTC_Manager_LookupSize instead. Never change the face's transformation matrix (i.e., never call the FT_Set_Transform function) on a returned face! If you need to transform glyphs, do it yourself after glyph loading. When you perform a lookup, out-of-memory errors are detected within the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed. If a lookup fails with FT_Err_Out_Of_Memory the cache has already been completely flushed, and still no memory was available for the operation. FTC_Manager_LookupSize \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_Manager_LookupSize ( FTC_Manager manager, FTC_Scaler scaler, FT_Size *asize ); Retrieve the FT_Size object that corresponds to a given FTC_ScalerRec pointer through a cache manager. input manager A handle to the cache manager. scaler A scaler handle. output asize A handle to the size object. return FreeType error code. 0 means success. note The returned FT_Size object is always owned by the manager. You should never try to discard it by yourself. You can access the parent FT_Face object simply as size->face if you need it. Note that this object is also owned by the manager. note When you perform a lookup, out-of-memory errors are detected within the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed. If a lookup fails with FT_Err_Out_Of_Memory the cache has already been completely flushed, and still no memory is available for the operation. FTC_Manager_RemoveFaceID \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_RemoveFaceID ( FTC_Manager manager, FTC_FaceID face_id ); A special function used to indicate to the cache manager that a given FTC_FaceID is no longer valid, either because its content changed, or because it was deallocated or uninstalled. input manager The cache manager handle. face_id The FTC_FaceID to be removed. note This function flushes all nodes from the cache corresponding to this face_id , with the exception of nodes with a non-null reference count. Such nodes are however modified internally so as to never appear in later lookups with the same face_id value, and to be immediately destroyed when released by all their users. FTC_Node \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_NodeRec_* FTC_Node ; 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 look up nodes, you have the ability to \u2018acquire\u2019 them, i.e., to increment their reference count. This will prevent the node from being flushed out of the cache until you explicitly \u2018release\u2019 it (see FTC_Node_Unref ). See also FTC_SBitCache_Lookup and FTC_ImageCache_Lookup . FTC_Node_Unref \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Node_Unref ( FTC_Node node, FTC_Manager manager ); 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. FTC_ImageCache \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageCacheRec_* FTC_ImageCache ; A handle to a glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold. FTC_ImageCache_New \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_New ( FTC_Manager manager, FTC_ImageCache *acache ); Create 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. FTC_ImageCache_Lookup \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_Lookup ( FTC_ImageCache cache, FTC_ImageType type, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); Retrieve 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 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 \u2018release\u2019 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! FTC_SBit \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_SBitRec_* FTC_SBit ; A handle to a small bitmap descriptor. See the FTC_SBitRec structure for details. FTC_SBitCache \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_SBitCacheRec_* FTC_SBitCache ; 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 . FTC_SBitCache_New \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_New ( FTC_Manager manager, FTC_SBitCache *acache ); Create 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. FTC_SBitCache_Lookup \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_Lookup ( FTC_SBitCache cache, FTC_ImageType type, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); Look up a given small glyph bitmap in a given sbit cache and \u2018lock\u2019 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 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 \u2018release\u2019 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! FTC_CMapCache \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_CMapCacheRec_* FTC_CMapCache ; An opaque handle used to model a charmap cache. This cache is to hold character codes -> glyph indices mappings. FTC_CMapCache_New \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_CMapCache_New ( FTC_Manager manager, FTC_CMapCache *acache ); Create a new charmap cache. input manager A handle to the cache manager. output acache A new cache handle. NULL in case of error. return FreeType error code. 0 means success. note Like all other caches, this one will be destroyed with the cache manager. FTC_CMapCache_Lookup \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_UInt ) FTC_CMapCache_Lookup ( FTC_CMapCache cache, FTC_FaceID face_id, FT_Int cmap_index, FT_UInt32 char_code ); Translate a character code into a glyph index, using the charmap cache. input cache A charmap cache handle. face_id The source face ID. cmap_index The index of the charmap in the source face. Any negative value means to use the cache FT_Face 's default charmap. char_code The character code (in the corresponding charmap). return Glyph index. 0 means \u2018no glyph\u2019. FTC_ScalerRec \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ScalerRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int pixel; FT_UInt x_res; FT_UInt y_res; } FTC_ScalerRec ; A structure used to describe a given character size in either pixels or points to the cache manager. See FTC_Manager_LookupSize . fields face_id The source face ID. width The character width. height The character height. pixel A Boolean. If 1, the width and height fields are interpreted as integer pixel character sizes. Otherwise, they are expressed as 1/64th of points. x_res Only used when pixel is value 0 to indicate the horizontal resolution in dpi. y_res Only used when pixel is value 0 to indicate the vertical resolution in dpi. note This type is mainly used to retrieve FT_Size objects through the cache manager. FTC_Scaler \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ScalerRec_* FTC_Scaler ; A handle to an FTC_ScalerRec structure. FTC_ImageTypeRec \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageTypeRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int32 flags; } FTC_ImageTypeRec ; A structure used to model the type of images in a glyph cache. fields face_id The face ID. width The width in pixels. height The height in pixels. flags The load flags, as in FT_Load_Glyph . FTC_ImageType \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageTypeRec_* FTC_ImageType ; A handle to an FTC_ImageTypeRec structure. FTC_ImageCache_LookupScaler \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_LookupScaler ( FTC_ImageCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); A variant of FTC_ImageCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size. input cache A handle to the source glyph image cache. scaler A pointer to a scaler descriptor. load_flags The corresponding load flags. 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 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 \u2018release\u2019 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! Calls to FT_Set_Char_Size and friends have no effect on cached glyphs; you should always use the FreeType cache API instead. FTC_SBitRec \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). 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 ; 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. \u2018left side bearing\u2019, or \u2018lsb\u2019). top The vertical distance from the pen position (on the baseline) to the upper bitmap border (a.k.a. \u2018top side bearing\u2019). 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. FTC_SBitCache_LookupScaler \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_LookupScaler ( FTC_SBitCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); A variant of FTC_SBitCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size. input cache A handle to the source sbit cache. scaler A pointer to the scaler descriptor. load_flags The corresponding load flags. gindex The glyph index. output sbit A handle to a small bitmap descriptor. anode Used to return the address 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 \u2018release\u2019 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!","title":"Cache Sub-System"},{"location":"ft2-cache_subsystem.html#cache-sub-system","text":"","title":"Cache Sub-System"},{"location":"ft2-cache_subsystem.html#synopsis","text":"This section describes the FreeType 2 cache sub-system, which is used to limit the number of concurrently opened FT_Face and FT_Size objects, as well as caching information like character maps and glyph images while limiting their maximum memory usage. Note that all types and functions begin with the FTC_ prefix. The cache is highly portable and thus doesn't know anything about the fonts installed on your system, or how to access them. This implies the following scheme: First, available or installed font faces are uniquely identified by FTC_FaceID values, provided to the cache by the client. Note that the cache only stores and compares these values, and doesn't try to interpret them in any way. Second, the cache calls, only when needed, a client-provided function to convert an FTC_FaceID into a new FT_Face object. The latter is then completely managed by the cache, including its termination through FT_Done_Face . To monitor termination of face objects, the finalizer callback in the generic field of the FT_Face object can be used, which might also be used to store the FTC_FaceID of the face. Clients are free to map face IDs to anything else. The most simple usage is to associate them to a (pathname,face_index) pair that is used to call FT_New_Face . However, more complex schemes are also possible. Note that for the cache to work correctly, the face ID values must be persistent , which means that the contents they point to should not change at runtime, or that their value should not become invalid. If this is unavoidable (e.g., when a font is uninstalled at runtime), you should call FTC_Manager_RemoveFaceID as soon as possible, to let the cache get rid of any references to the old FTC_FaceID it may keep internally. Failure to do so will lead to incorrect behaviour or even crashes. To use the cache, start with calling FTC_Manager_New to create a new FTC_Manager object, which models a single cache instance. You can then look up FT_Face and FT_Size objects with FTC_Manager_LookupFace and FTC_Manager_LookupSize , respectively. If you want to use the charmap caching, call FTC_CMapCache_New , then later use FTC_CMapCache_Lookup to perform the equivalent of FT_Get_Char_Index , only much faster. If you want to use the FT_Glyph caching, call FTC_ImageCache_New , then later use FTC_ImageCache_Lookup to retrieve the corresponding FT_Glyph objects from the cache. If you need lots of small bitmaps, it is much more memory efficient to call FTC_SBitCache_New followed by FTC_SBitCache_Lookup . This returns FTC_SBitRec structures, which are used to store small bitmaps directly. (A small bitmap is one whose metrics and dimensions all fit into 8-bit integers). We hope to also provide a kerning cache in the near future.","title":"Synopsis"},{"location":"ft2-cache_subsystem.html#ftc_manager","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ManagerRec_* FTC_Manager ; This object corresponds to one instance of the cache-subsystem. It is used to cache one or more FT_Face objects, along with corresponding FT_Size objects. The manager intentionally limits the total number of opened FT_Face and FT_Size objects to control memory usage. See the max_faces and max_sizes parameters of FTC_Manager_New . The manager is also used to cache \u2018nodes\u2019 of various types while limiting their total memory usage. All limitations are enforced by keeping lists of managed objects in most-recently-used order, and flushing old nodes to make room for new ones.","title":"FTC_Manager"},{"location":"ft2-cache_subsystem.html#ftc_faceid","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef FT_Pointer FTC_FaceID ; An opaque pointer type that is used to identity face objects. The contents of such objects is application-dependent. These pointers are typically used to point to a user-defined structure containing a font file path, and face index.","title":"FTC_FaceID"},{"location":"ft2-cache_subsystem.html#ftc_face_requester","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef FT_Error (* FTC_Face_Requester )( FTC_FaceID face_id, FT_Library library, FT_Pointer req_data, FT_Face * aface ); A callback function provided by client applications. It is used by the cache manager to translate a given FTC_FaceID into a new valid FT_Face object, on demand.","title":"FTC_Face_Requester"},{"location":"ft2-cache_subsystem.html#ftc_manager_new","text":"Defined in FT_CACHE_H (freetype/ftcache.h). 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 ); Create a new cache manager.","title":"FTC_Manager_New"},{"location":"ft2-cache_subsystem.html#ftc_manager_reset","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_Reset ( FTC_Manager manager ); Empty a given cache manager. This simply gets rid of all the currently cached FT_Face and FT_Size objects within the manager.","title":"FTC_Manager_Reset"},{"location":"ft2-cache_subsystem.html#ftc_manager_done","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_Done ( FTC_Manager manager ); Destroy a given manager after emptying it.","title":"FTC_Manager_Done"},{"location":"ft2-cache_subsystem.html#ftc_manager_lookupface","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_Manager_LookupFace ( FTC_Manager manager, FTC_FaceID face_id, FT_Face *aface ); Retrieve the FT_Face object that corresponds to a given face ID through a cache manager.","title":"FTC_Manager_LookupFace"},{"location":"ft2-cache_subsystem.html#ftc_manager_lookupsize","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_Manager_LookupSize ( FTC_Manager manager, FTC_Scaler scaler, FT_Size *asize ); Retrieve the FT_Size object that corresponds to a given FTC_ScalerRec pointer through a cache manager.","title":"FTC_Manager_LookupSize"},{"location":"ft2-cache_subsystem.html#ftc_manager_removefaceid","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_RemoveFaceID ( FTC_Manager manager, FTC_FaceID face_id ); A special function used to indicate to the cache manager that a given FTC_FaceID is no longer valid, either because its content changed, or because it was deallocated or uninstalled.","title":"FTC_Manager_RemoveFaceID"},{"location":"ft2-cache_subsystem.html#ftc_node","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_NodeRec_* FTC_Node ; 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 look up nodes, you have the ability to \u2018acquire\u2019 them, i.e., to increment their reference count. This will prevent the node from being flushed out of the cache until you explicitly \u2018release\u2019 it (see FTC_Node_Unref ). See also FTC_SBitCache_Lookup and FTC_ImageCache_Lookup .","title":"FTC_Node"},{"location":"ft2-cache_subsystem.html#ftc_node_unref","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Node_Unref ( FTC_Node node, FTC_Manager manager ); Decrement a cache node's internal reference count. When the count reaches 0, it is not destroyed but becomes eligible for subsequent cache flushes.","title":"FTC_Node_Unref"},{"location":"ft2-cache_subsystem.html#ftc_imagecache","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageCacheRec_* FTC_ImageCache ; A handle to a glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold.","title":"FTC_ImageCache"},{"location":"ft2-cache_subsystem.html#ftc_imagecache_new","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_New ( FTC_Manager manager, FTC_ImageCache *acache ); Create a new glyph image cache.","title":"FTC_ImageCache_New"},{"location":"ft2-cache_subsystem.html#ftc_imagecache_lookup","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_Lookup ( FTC_ImageCache cache, FTC_ImageType type, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); Retrieve a given glyph image from a glyph image cache.","title":"FTC_ImageCache_Lookup"},{"location":"ft2-cache_subsystem.html#ftc_sbit","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_SBitRec_* FTC_SBit ; A handle to a small bitmap descriptor. See the FTC_SBitRec structure for details.","title":"FTC_SBit"},{"location":"ft2-cache_subsystem.html#ftc_sbitcache","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_SBitCacheRec_* FTC_SBitCache ; 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 .","title":"FTC_SBitCache"},{"location":"ft2-cache_subsystem.html#ftc_sbitcache_new","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_New ( FTC_Manager manager, FTC_SBitCache *acache ); Create a new cache to store small glyph bitmaps.","title":"FTC_SBitCache_New"},{"location":"ft2-cache_subsystem.html#ftc_sbitcache_lookup","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_Lookup ( FTC_SBitCache cache, FTC_ImageType type, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); Look up a given small glyph bitmap in a given sbit cache and \u2018lock\u2019 it to prevent its flushing from the cache until needed.","title":"FTC_SBitCache_Lookup"},{"location":"ft2-cache_subsystem.html#ftc_cmapcache","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_CMapCacheRec_* FTC_CMapCache ; An opaque handle used to model a charmap cache. This cache is to hold character codes -> glyph indices mappings.","title":"FTC_CMapCache"},{"location":"ft2-cache_subsystem.html#ftc_cmapcache_new","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_CMapCache_New ( FTC_Manager manager, FTC_CMapCache *acache ); Create a new charmap cache.","title":"FTC_CMapCache_New"},{"location":"ft2-cache_subsystem.html#ftc_cmapcache_lookup","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_UInt ) FTC_CMapCache_Lookup ( FTC_CMapCache cache, FTC_FaceID face_id, FT_Int cmap_index, FT_UInt32 char_code ); Translate a character code into a glyph index, using the charmap cache.","title":"FTC_CMapCache_Lookup"},{"location":"ft2-cache_subsystem.html#ftc_scalerrec","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ScalerRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int pixel; FT_UInt x_res; FT_UInt y_res; } FTC_ScalerRec ; A structure used to describe a given character size in either pixels or points to the cache manager. See FTC_Manager_LookupSize .","title":"FTC_ScalerRec"},{"location":"ft2-cache_subsystem.html#ftc_scaler","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ScalerRec_* FTC_Scaler ; A handle to an FTC_ScalerRec structure.","title":"FTC_Scaler"},{"location":"ft2-cache_subsystem.html#ftc_imagetyperec","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageTypeRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int32 flags; } FTC_ImageTypeRec ; A structure used to model the type of images in a glyph cache.","title":"FTC_ImageTypeRec"},{"location":"ft2-cache_subsystem.html#ftc_imagetype","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageTypeRec_* FTC_ImageType ; A handle to an FTC_ImageTypeRec structure.","title":"FTC_ImageType"},{"location":"ft2-cache_subsystem.html#ftc_imagecache_lookupscaler","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_LookupScaler ( FTC_ImageCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); A variant of FTC_ImageCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size.","title":"FTC_ImageCache_LookupScaler"},{"location":"ft2-cache_subsystem.html#ftc_sbitrec","text":"Defined in FT_CACHE_H (freetype/ftcache.h). 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 ; A very compact structure used to describe a small glyph bitmap.","title":"FTC_SBitRec"},{"location":"ft2-cache_subsystem.html#ftc_sbitcache_lookupscaler","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_LookupScaler ( FTC_SBitCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); A variant of FTC_SBitCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size.","title":"FTC_SBitCache_LookupScaler"},{"location":"ft2-cff_driver.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The CFF driver The CFF driver \u00b6 Synopsis \u00b6 While FreeType's CFF driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The CFF driver's module name is \u2018cff\u2019. Available properties are hinting-engine , no-stem-darkening , darkening-parameters , and random-seed , as documented in the \u2018 Driver properties \u2019 section. Hinting and anti-aliasing principles of the new engine The rasterizer is positioning horizontal features (e.g., ascender height & x-height, or crossbars) on the pixel grid and minimizing the amount of anti-aliasing applied to them, while placing vertical features (vertical stems) on the pixel grid without hinting, thus representing the stem position and weight accurately. Sometimes the vertical stems may be only partially black. In this context, \u2018anti-aliasing\u2019 means that stems are not positioned exactly on pixel borders, causing a fuzzy appearance. There are two principles behind this approach. 1) No hinting in the horizontal direction: Unlike \u2018superhinted\u2019 TrueType, which changes glyph widths to accommodate regular inter-glyph spacing, Adobe's approach is \u2018faithful to the design\u2019 in representing both the glyph width and the inter-glyph spacing designed for the font. This makes the screen display as close as it can be to the result one would get with infinite resolution, while preserving what is considered the key characteristics of each glyph. Note that the distances between unhinted and grid-fitted positions at small sizes are comparable to kerning values and thus would be noticeable (and distracting) while reading if hinting were applied. One of the reasons to not hint horizontally is anti-aliasing for LCD screens: The pixel geometry of modern displays supplies three vertical subpixels as the eye moves horizontally across each visible pixel. On devices where we can be certain this characteristic is present a rasterizer can take advantage of the subpixels to add increments of weight. In Western writing systems this turns out to be the more critical direction anyway; the weights and spacing of vertical stems (see above) are central to Armenian, Cyrillic, Greek, and Latin type designs. Even when the rasterizer uses greyscale anti-aliasing instead of color (a necessary compromise when one doesn't know the screen characteristics), the unhinted vertical features preserve the design's weight and spacing much better than aliased type would. 2) Alignment in the vertical direction: Weights and spacing along the y axis are less critical; what is much more important is the visual alignment of related features (like cap-height and x-height). The sense of alignment for these is enhanced by the sharpness of grid-fit edges, while the cruder vertical resolution (full pixels instead of \u2153 pixels) is less of a problem. On the technical side, horizontal alignment zones for ascender, x-height, and other important height values (traditionally called \u2018blue zones\u2019) as defined in the font are positioned independently, each being rounded to the nearest pixel edge, taking care of overshoot suppression at small sizes, stem darkening, and scaling. Hstems (this is, hint values defined in the font to help align horizontal features) that fall within a blue zone are said to be \u2018captured\u2019 and are aligned to that zone. Uncaptured stems are moved in one of four ways, top edge up or down, bottom edge up or down. Unless there are conflicting hstems, the smallest movement is taken to minimize distortion.","title":"The CFF driver"},{"location":"ft2-cff_driver.html#the-cff-driver","text":"","title":"The CFF driver"},{"location":"ft2-cff_driver.html#synopsis","text":"While FreeType's CFF driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The CFF driver's module name is \u2018cff\u2019. Available properties are hinting-engine , no-stem-darkening , darkening-parameters , and random-seed , as documented in the \u2018 Driver properties \u2019 section. Hinting and anti-aliasing principles of the new engine The rasterizer is positioning horizontal features (e.g., ascender height & x-height, or crossbars) on the pixel grid and minimizing the amount of anti-aliasing applied to them, while placing vertical features (vertical stems) on the pixel grid without hinting, thus representing the stem position and weight accurately. Sometimes the vertical stems may be only partially black. In this context, \u2018anti-aliasing\u2019 means that stems are not positioned exactly on pixel borders, causing a fuzzy appearance. There are two principles behind this approach. 1) No hinting in the horizontal direction: Unlike \u2018superhinted\u2019 TrueType, which changes glyph widths to accommodate regular inter-glyph spacing, Adobe's approach is \u2018faithful to the design\u2019 in representing both the glyph width and the inter-glyph spacing designed for the font. This makes the screen display as close as it can be to the result one would get with infinite resolution, while preserving what is considered the key characteristics of each glyph. Note that the distances between unhinted and grid-fitted positions at small sizes are comparable to kerning values and thus would be noticeable (and distracting) while reading if hinting were applied. One of the reasons to not hint horizontally is anti-aliasing for LCD screens: The pixel geometry of modern displays supplies three vertical subpixels as the eye moves horizontally across each visible pixel. On devices where we can be certain this characteristic is present a rasterizer can take advantage of the subpixels to add increments of weight. In Western writing systems this turns out to be the more critical direction anyway; the weights and spacing of vertical stems (see above) are central to Armenian, Cyrillic, Greek, and Latin type designs. Even when the rasterizer uses greyscale anti-aliasing instead of color (a necessary compromise when one doesn't know the screen characteristics), the unhinted vertical features preserve the design's weight and spacing much better than aliased type would. 2) Alignment in the vertical direction: Weights and spacing along the y axis are less critical; what is much more important is the visual alignment of related features (like cap-height and x-height). The sense of alignment for these is enhanced by the sharpness of grid-fit edges, while the cruder vertical resolution (full pixels instead of \u2153 pixels) is less of a problem. On the technical side, horizontal alignment zones for ascender, x-height, and other important height values (traditionally called \u2018blue zones\u2019) as defined in the font are positioned independently, each being rounded to the nearest pixel edge, taking care of overshoot suppression at small sizes, stem darkening, and scaling. Hstems (this is, hint values defined in the font to help align horizontal features) that fall within a blue zone are said to be \u2018captured\u2019 and are aligned to that zone. Uncaptured stems are moved in one of four ways, top edge up or down, bottom edge up or down. Unless there are conflicting hstems, the smallest movement is taken to minimize distortion.","title":"Synopsis"},{"location":"ft2-cid_fonts.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb CID Fonts CID Fonts \u00b6 Synopsis \u00b6 This section contains the declaration of CID-keyed font-specific functions. FT_Get_CID_Registry_Ordering_Supplement \u00b6 Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_Registry_Ordering_Supplement ( FT_Face face, const char * *registry, const char * *ordering, FT_Int *supplement ); Retrieve the Registry/Ordering/Supplement triple (also known as the \"R/O/S\") from a CID-keyed font. input face A handle to the input face. output registry The registry, as a C string, owned by the face. ordering The ordering, as a C string, owned by the face. supplement The supplement. return FreeType error code. 0 means success. note This function only works with CID faces, returning an error otherwise. since 2.3.6 FT_Get_CID_Is_Internally_CID_Keyed \u00b6 Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_Is_Internally_CID_Keyed ( FT_Face face, FT_Bool *is_cid ); Retrieve the type of the input face, CID keyed or not. In contrast to the FT_IS_CID_KEYED macro this function returns successfully also for CID-keyed fonts in an SFNT wrapper. input face A handle to the input face. output is_cid The type of the face as an FT_Bool . return FreeType error code. 0 means success. note This function only works with CID faces and OpenType fonts, returning an error otherwise. since 2.3.9 FT_Get_CID_From_Glyph_Index \u00b6 Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_From_Glyph_Index ( FT_Face face, FT_UInt glyph_index, FT_UInt *cid ); Retrieve the CID of the input glyph index. input face A handle to the input face. glyph_index The input glyph index. output cid The CID as an FT_UInt . return FreeType error code. 0 means success. note This function only works with CID faces and OpenType fonts, returning an error otherwise. since 2.3.9","title":"CID Fonts"},{"location":"ft2-cid_fonts.html#cid-fonts","text":"","title":"CID Fonts"},{"location":"ft2-cid_fonts.html#synopsis","text":"This section contains the declaration of CID-keyed font-specific functions.","title":"Synopsis"},{"location":"ft2-cid_fonts.html#ft_get_cid_registry_ordering_supplement","text":"Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_Registry_Ordering_Supplement ( FT_Face face, const char * *registry, const char * *ordering, FT_Int *supplement ); Retrieve the Registry/Ordering/Supplement triple (also known as the \"R/O/S\") from a CID-keyed font.","title":"FT_Get_CID_Registry_Ordering_Supplement"},{"location":"ft2-cid_fonts.html#ft_get_cid_is_internally_cid_keyed","text":"Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_Is_Internally_CID_Keyed ( FT_Face face, FT_Bool *is_cid ); Retrieve the type of the input face, CID keyed or not. In contrast to the FT_IS_CID_KEYED macro this function returns successfully also for CID-keyed fonts in an SFNT wrapper.","title":"FT_Get_CID_Is_Internally_CID_Keyed"},{"location":"ft2-cid_fonts.html#ft_get_cid_from_glyph_index","text":"Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_From_Glyph_Index ( FT_Face face, FT_UInt glyph_index, FT_UInt *cid ); Retrieve the CID of the input glyph index.","title":"FT_Get_CID_From_Glyph_Index"},{"location":"ft2-color_management.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Glyph Color Management Glyph Color Management \u00b6 Synopsis \u00b6 The functions described here allow access and manipulation of color palette entries in OpenType's \u2018CPAL\u2019 tables. FT_Color \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Color_ { FT_Byte blue; FT_Byte green; FT_Byte red; FT_Byte alpha; } FT_Color ; This structure models a BGRA color value of a \u2018CPAL\u2019 palette entry. The used color space is sRGB; the colors are not pre-multiplied, and alpha values must be explicitly set. fields blue Blue value. green Green value. red Red value. alpha Alpha value, giving the red, green, and blue color's opacity. since 2.10 FT_PALETTE_XXX \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). # define FT_PALETTE_FOR_LIGHT_BACKGROUND 0x01 # define FT_PALETTE_FOR_DARK_BACKGROUND 0x02 A list of bit field constants used in the palette_flags array of the FT_Palette_Data structure to indicate for which background a palette with a given index is usable. values FT_PALETTE_FOR_LIGHT_BACKGROUND The palette is appropriate to use when displaying the font on a light background such as white. FT_PALETTE_FOR_DARK_BACKGROUND The palette is appropriate to use when displaying the font on a dark background such as black. since 2.10 FT_Palette_Data \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Palette_Data_ { FT_UShort num_palettes; const FT_UShort * palette_name_ids; const FT_UShort * palette_flags; FT_UShort num_palette_entries; const FT_UShort * palette_entry_name_ids; } FT_Palette_Data ; This structure holds the data of the \u2018CPAL\u2019 table. fields num_palettes The number of palettes. palette_name_ids An optional read-only array of palette name IDs with num_palettes elements, corresponding to entries like \u2018dark\u2019 or \u2018light\u2019 in the font's \u2018name\u2019 table. An empty name ID in the \u2018CPAL\u2019 table gets represented as value 0xFFFF. NULL if the font's \u2018CPAL\u2019 table doesn't contain appropriate data. palette_flags An optional read-only array of palette flags with num_palettes elements. Possible values are an ORed combination of FT_PALETTE_FOR_LIGHT_BACKGROUND and FT_PALETTE_FOR_DARK_BACKGROUND . NULL if the font's \u2018CPAL\u2019 table doesn't contain appropriate data. num_palette_entries The number of entries in a single palette. All palettes have the same size. palette_entry_name_ids An optional read-only array of palette entry name IDs with num_palette_entries . In each palette, entries with the same index have the same function. For example, index 0 might correspond to string \u2018outline\u2019 in the font's \u2018name\u2019 table to indicate that this palette entry is used for outlines, index 1 might correspond to \u2018fill\u2019 to indicate the filling color palette entry, etc. An empty entry name ID in the \u2018CPAL\u2019 table gets represented as value 0xFFFF. NULL if the font's \u2018CPAL\u2019 table doesn't contain appropriate data. note Use function FT_Get_Sfnt_Name to map name IDs and entry name IDs to name strings. Use function FT_Palette_Select to get the colors associated with a palette entry. since 2.10 FT_Palette_Data_Get \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Data_Get ( FT_Face face, FT_Palette_Data *apalette ); Retrieve the face's color palette data. input face The source face handle. output apalette A pointer to an FT_Palette_Data structure. return FreeType error code. 0 means success. note All arrays in the returned FT_Palette_Data structure are read-only. This function always returns an error if the config macro TT_CONFIG_OPTION_COLOR_LAYERS is not defined in ftoption.h . since 2.10 FT_Palette_Select \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Select ( FT_Face face, FT_UShort palette_index, FT_Color * *apalette ); This function has two purposes. (1) It activates a palette for rendering color glyphs, and (2) it retrieves all (unmodified) color entries of this palette. This function returns a read-write array, which means that a calling application can modify the palette entries on demand. A corollary of (2) is that calling the function, then modifying some values, then calling the function again with the same arguments resets all color entries to the original \u2018CPAL\u2019 values; all user modifications are lost. input face The source face handle. palette_index The palette index. output apalette An array of color entries for a palette with index palette_index , having num_palette_entries elements (as found in the FT_Palette_Data structure). If apalette is set to NULL , no array gets returned (and no color entries can be modified). In case the font doesn't support color palettes, NULL is returned. return FreeType error code. 0 means success. note The array pointed to by apalette_entries is owned and managed by FreeType. This function always returns an error if the config macro TT_CONFIG_OPTION_COLOR_LAYERS is not defined in ftoption.h . since 2.10 FT_Palette_Set_Foreground_Color \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Set_Foreground_Color ( FT_Face face, FT_Color foreground_color ); \u2018COLR\u2019 uses palette index 0xFFFF to indicate a \u2018text foreground color\u2019. This function sets this value. input face The source face handle. foreground_color An FT_Color structure to define the text foreground color. return FreeType error code. 0 means success. note If this function isn't called, the text foreground color is set to white opaque (BGRA value 0xFFFFFFFF) if FT_PALETTE_FOR_DARK_BACKGROUND is present for the current palette, and black opaque (BGRA value 0x000000FF) otherwise, including the case that no palette types are available in the \u2018CPAL\u2019 table. This function always returns an error if the config macro TT_CONFIG_OPTION_COLOR_LAYERS is not defined in ftoption.h . since 2.10","title":"Glyph Color Management"},{"location":"ft2-color_management.html#glyph-color-management","text":"","title":"Glyph Color Management"},{"location":"ft2-color_management.html#synopsis","text":"The functions described here allow access and manipulation of color palette entries in OpenType's \u2018CPAL\u2019 tables.","title":"Synopsis"},{"location":"ft2-color_management.html#ft_color","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Color_ { FT_Byte blue; FT_Byte green; FT_Byte red; FT_Byte alpha; } FT_Color ; This structure models a BGRA color value of a \u2018CPAL\u2019 palette entry. The used color space is sRGB; the colors are not pre-multiplied, and alpha values must be explicitly set.","title":"FT_Color"},{"location":"ft2-color_management.html#ft_palette_xxx","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). # define FT_PALETTE_FOR_LIGHT_BACKGROUND 0x01 # define FT_PALETTE_FOR_DARK_BACKGROUND 0x02 A list of bit field constants used in the palette_flags array of the FT_Palette_Data structure to indicate for which background a palette with a given index is usable.","title":"FT_PALETTE_XXX"},{"location":"ft2-color_management.html#ft_palette_data","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Palette_Data_ { FT_UShort num_palettes; const FT_UShort * palette_name_ids; const FT_UShort * palette_flags; FT_UShort num_palette_entries; const FT_UShort * palette_entry_name_ids; } FT_Palette_Data ; This structure holds the data of the \u2018CPAL\u2019 table.","title":"FT_Palette_Data"},{"location":"ft2-color_management.html#ft_palette_data_get","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Data_Get ( FT_Face face, FT_Palette_Data *apalette ); Retrieve the face's color palette data.","title":"FT_Palette_Data_Get"},{"location":"ft2-color_management.html#ft_palette_select","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Select ( FT_Face face, FT_UShort palette_index, FT_Color * *apalette ); This function has two purposes. (1) It activates a palette for rendering color glyphs, and (2) it retrieves all (unmodified) color entries of this palette. This function returns a read-write array, which means that a calling application can modify the palette entries on demand. A corollary of (2) is that calling the function, then modifying some values, then calling the function again with the same arguments resets all color entries to the original \u2018CPAL\u2019 values; all user modifications are lost.","title":"FT_Palette_Select"},{"location":"ft2-color_management.html#ft_palette_set_foreground_color","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Set_Foreground_Color ( FT_Face face, FT_Color foreground_color ); \u2018COLR\u2019 uses palette index 0xFFFF to indicate a \u2018text foreground color\u2019. This function sets this value.","title":"FT_Palette_Set_Foreground_Color"},{"location":"ft2-computations.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Computations Computations \u00b6 Synopsis \u00b6 This section contains various functions used to perform computations on 16.16 fixed-float numbers or 2d vectors. Attention : Most arithmetic functions take FT_Long as arguments. For historical reasons, FreeType was designed under the assumption that FT_Long is a 32-bit integer; results can thus be undefined if the arguments don't fit into 32 bits. FT_MulDiv \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_MulDiv ( FT_Long a, FT_Long b, FT_Long c ); Compute (a*b)/c with maximum accuracy, using 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 \u2018MaxInt\u2019 or \u2018MinInt\u2019 depending on the signs of a and b . FT_MulFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_MulFix ( FT_Long a, FT_Long b ); Compute (a*b)/0x10000 with maximum accuracy. Its main use is to multiply a given value by a 16.16 fixed-point 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_DivFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_DivFix ( FT_Long a, FT_Long b ); Compute (a*0x10000)/b with maximum accuracy. Its main use is to divide a given value by a 16.16 fixed-point factor. input a The numerator. b The denominator. Use a 16.16 factor here. return The result of (a*0x10000)/b . FT_RoundFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_RoundFix ( FT_Fixed a ); Round a 16.16 fixed number. input a The number to be rounded. return a rounded to the nearest 16.16 fixed integer, halfway cases away from zero. note The function uses wrap-around arithmetic. FT_CeilFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_CeilFix ( FT_Fixed a ); Compute the smallest following integer of a 16.16 fixed number. input a The number for which the ceiling function is to be computed. return a rounded towards plus infinity. note The function uses wrap-around arithmetic. FT_FloorFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_FloorFix ( FT_Fixed a ); Compute the largest previous integer of a 16.16 fixed number. input a The number for which the floor function is to be computed. return a rounded towards minus infinity. FT_Vector_Transform \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Vector_Transform ( FT_Vector * vector, const FT_Matrix * matrix ); Transform 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_Matrix_Multiply \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Matrix_Multiply ( const FT_Matrix * a, FT_Matrix * b ); Perform 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. Since the function uses wrap-around arithmetic, results become meaningless if the arguments are very large. FT_Matrix_Invert \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Matrix_Invert ( FT_Matrix * matrix ); Invert a 2x2 matrix. Return 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_Angle \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). typedef FT_Fixed FT_Angle ; This type is used to model angle values in FreeType. Note that the angle is a 16.16 fixed-point value expressed in degrees. FT_ANGLE_PI \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI ( 180L << 16 ) The angle pi expressed in FT_Angle units. FT_ANGLE_2PI \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) The angle 2*pi expressed in FT_Angle units. FT_ANGLE_PI2 \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) The angle pi/2 expressed in FT_Angle units. FT_ANGLE_PI4 \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) The angle pi/4 expressed in FT_Angle units. FT_Sin \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Sin ( FT_Angle angle ); Return the sinus of a given angle in fixed-point format. input angle The input angle. return The sinus value. note If you need both the sinus and cosinus for a given angle, use the function FT_Vector_Unit . FT_Cos \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Cos ( FT_Angle angle ); Return the cosinus of a given angle in fixed-point format. input angle The input angle. return The cosinus value. note If you need both the sinus and cosinus for a given angle, use the function FT_Vector_Unit . FT_Tan \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Tan ( FT_Angle angle ); Return the tangent of a given angle in fixed-point format. input angle The input angle. return The tangent value. FT_Atan2 \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Angle ) FT_Atan2 ( FT_Fixed x, FT_Fixed y ); Return the arc-tangent corresponding to a given vector (x,y) in the 2d plane. input x The horizontal vector coordinate. y The vertical vector coordinate. return The arc-tangent value (i.e. angle). FT_Angle_Diff \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Angle ) FT_Angle_Diff ( FT_Angle angle1, FT_Angle angle2 ); Return the difference between two angles. The result is always constrained to the ]-PI..PI] interval. input angle1 First angle. angle2 Second angle. return Constrained value of angle2-angle1 . FT_Vector_Unit \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Unit ( FT_Vector * vec, FT_Angle angle ); Return the unit vector corresponding to a given angle. After the call, the value of vec.x will be cos(angle) , and the value of vec.y will be sin(angle) . This function is useful to retrieve both the sinus and cosinus of a given angle quickly. output vec The address of target vector. input angle The input angle. FT_Vector_Rotate \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Rotate ( FT_Vector * vec, FT_Angle angle ); Rotate a vector by a given angle. inout vec The address of target vector. input angle The input angle. FT_Vector_Length \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Vector_Length ( FT_Vector * vec ); Return the length of a given vector. input vec The address of target vector. return The vector length, expressed in the same units that the original vector coordinates. FT_Vector_Polarize \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Polarize ( FT_Vector * vec, FT_Fixed *length, FT_Angle *angle ); Compute both the length and angle of a given vector. input vec The address of source vector. output length The vector length. angle The vector angle. FT_Vector_From_Polar \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_From_Polar ( FT_Vector * vec, FT_Fixed length, FT_Angle angle ); Compute vector coordinates from a length and angle. output vec The address of source vector. input length The vector length. angle The vector angle.","title":"Computations"},{"location":"ft2-computations.html#computations","text":"","title":"Computations"},{"location":"ft2-computations.html#synopsis","text":"This section contains various functions used to perform computations on 16.16 fixed-float numbers or 2d vectors. Attention : Most arithmetic functions take FT_Long as arguments. For historical reasons, FreeType was designed under the assumption that FT_Long is a 32-bit integer; results can thus be undefined if the arguments don't fit into 32 bits.","title":"Synopsis"},{"location":"ft2-computations.html#ft_muldiv","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_MulDiv ( FT_Long a, FT_Long b, FT_Long c ); Compute (a*b)/c with maximum accuracy, using 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.","title":"FT_MulDiv"},{"location":"ft2-computations.html#ft_mulfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_MulFix ( FT_Long a, FT_Long b ); Compute (a*b)/0x10000 with maximum accuracy. Its main use is to multiply a given value by a 16.16 fixed-point factor.","title":"FT_MulFix"},{"location":"ft2-computations.html#ft_divfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_DivFix ( FT_Long a, FT_Long b ); Compute (a*0x10000)/b with maximum accuracy. Its main use is to divide a given value by a 16.16 fixed-point factor.","title":"FT_DivFix"},{"location":"ft2-computations.html#ft_roundfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_RoundFix ( FT_Fixed a ); Round a 16.16 fixed number.","title":"FT_RoundFix"},{"location":"ft2-computations.html#ft_ceilfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_CeilFix ( FT_Fixed a ); Compute the smallest following integer of a 16.16 fixed number.","title":"FT_CeilFix"},{"location":"ft2-computations.html#ft_floorfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_FloorFix ( FT_Fixed a ); Compute the largest previous integer of a 16.16 fixed number.","title":"FT_FloorFix"},{"location":"ft2-computations.html#ft_vector_transform","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Vector_Transform ( FT_Vector * vector, const FT_Matrix * matrix ); Transform a single vector through a 2x2 matrix.","title":"FT_Vector_Transform"},{"location":"ft2-computations.html#ft_matrix_multiply","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Matrix_Multiply ( const FT_Matrix * a, FT_Matrix * b ); Perform the matrix operation b = a*b .","title":"FT_Matrix_Multiply"},{"location":"ft2-computations.html#ft_matrix_invert","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Matrix_Invert ( FT_Matrix * matrix ); Invert a 2x2 matrix. Return an error if it can't be inverted.","title":"FT_Matrix_Invert"},{"location":"ft2-computations.html#ft_angle","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). typedef FT_Fixed FT_Angle ; This type is used to model angle values in FreeType. Note that the angle is a 16.16 fixed-point value expressed in degrees.","title":"FT_Angle"},{"location":"ft2-computations.html#ft_angle_pi","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI ( 180L << 16 ) The angle pi expressed in FT_Angle units.","title":"FT_ANGLE_PI"},{"location":"ft2-computations.html#ft_angle_2pi","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) The angle 2*pi expressed in FT_Angle units.","title":"FT_ANGLE_2PI"},{"location":"ft2-computations.html#ft_angle_pi2","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) The angle pi/2 expressed in FT_Angle units.","title":"FT_ANGLE_PI2"},{"location":"ft2-computations.html#ft_angle_pi4","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) The angle pi/4 expressed in FT_Angle units.","title":"FT_ANGLE_PI4"},{"location":"ft2-computations.html#ft_sin","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Sin ( FT_Angle angle ); Return the sinus of a given angle in fixed-point format.","title":"FT_Sin"},{"location":"ft2-computations.html#ft_cos","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Cos ( FT_Angle angle ); Return the cosinus of a given angle in fixed-point format.","title":"FT_Cos"},{"location":"ft2-computations.html#ft_tan","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Tan ( FT_Angle angle ); Return the tangent of a given angle in fixed-point format.","title":"FT_Tan"},{"location":"ft2-computations.html#ft_atan2","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Angle ) FT_Atan2 ( FT_Fixed x, FT_Fixed y ); Return the arc-tangent corresponding to a given vector (x,y) in the 2d plane.","title":"FT_Atan2"},{"location":"ft2-computations.html#ft_angle_diff","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Angle ) FT_Angle_Diff ( FT_Angle angle1, FT_Angle angle2 ); Return the difference between two angles. The result is always constrained to the ]-PI..PI] interval.","title":"FT_Angle_Diff"},{"location":"ft2-computations.html#ft_vector_unit","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Unit ( FT_Vector * vec, FT_Angle angle ); Return the unit vector corresponding to a given angle. After the call, the value of vec.x will be cos(angle) , and the value of vec.y will be sin(angle) . This function is useful to retrieve both the sinus and cosinus of a given angle quickly.","title":"FT_Vector_Unit"},{"location":"ft2-computations.html#ft_vector_rotate","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Rotate ( FT_Vector * vec, FT_Angle angle ); Rotate a vector by a given angle.","title":"FT_Vector_Rotate"},{"location":"ft2-computations.html#ft_vector_length","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Vector_Length ( FT_Vector * vec ); Return the length of a given vector.","title":"FT_Vector_Length"},{"location":"ft2-computations.html#ft_vector_polarize","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Polarize ( FT_Vector * vec, FT_Fixed *length, FT_Angle *angle ); Compute both the length and angle of a given vector.","title":"FT_Vector_Polarize"},{"location":"ft2-computations.html#ft_vector_from_polar","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_From_Polar ( FT_Vector * vec, FT_Fixed length, FT_Angle angle ); Compute vector coordinates from a length and angle.","title":"FT_Vector_From_Polar"},{"location":"ft2-debugging_apis.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb External Debugging APIs External Debugging APIs \u00b6 Synopsis \u00b6 This section contains the declarations of public functions that enables fine control of what the FT_DEBUG_LOGGING macro outputs. FT_Trace_Set_Level \u00b6 FT_EXPORT( void ) FT_Trace_Set_Level ( const char * tracing_level ); Change the levels of tracing components of FreeType at run time. input tracing_level New tracing value. example The following call makes FreeType trace everything but the \u2018memory\u2019 component. FT_Trace_Set_Level( \"any:7 memory:0 ); note This function does nothing if compilation option FT_DEBUG_LOGGING isn't set. since 2.11 FT_Trace_Set_Default_Level \u00b6 FT_EXPORT( void ) FT_Trace_Set_Default_Level ( void ); Reset tracing value of FreeType's components to the default value (i.e., to the value of the FT2_DEBUG environment value or to NULL if FT2_DEBUG is not set). note This function does nothing if compilation option FT_DEBUG_LOGGING isn't set. since 2.11 FT_Custom_Log_Handler \u00b6 typedef void (* FT_Custom_Log_Handler )( const char * ft_component, const char * fmt, va_list args ); A function typedef that is used to handle the logging of tracing and debug messages on a file system. input ft_component The name of FT_COMPONENT from which the current debug or error message is produced. fmt Actual debug or tracing message. args Arguments of debug or tracing messages. since 2.11 FT_Set_Log_Handler \u00b6 FT_EXPORT( void ) FT_Set_Log_Handler ( FT_Custom_Log_Handler handler ); A function to set a custom log handler. input handler New logging function. note This function does nothing if compilation option FT_DEBUG_LOGGING isn't set. since 2.11 FT_Set_Default_Log_Handler \u00b6 FT_EXPORT( void ) FT_Set_Default_Log_Handler ( void ); A function to undo the effect of FT_Set_Log_Handler , resetting the log handler to FreeType's built-in version. note This function does nothing if compilation option FT_DEBUG_LOGGING isn't set. since 2.11","title":"External Debugging APIs"},{"location":"ft2-debugging_apis.html#external-debugging-apis","text":"","title":"External Debugging APIs"},{"location":"ft2-debugging_apis.html#synopsis","text":"This section contains the declarations of public functions that enables fine control of what the FT_DEBUG_LOGGING macro outputs.","title":"Synopsis"},{"location":"ft2-debugging_apis.html#ft_trace_set_level","text":"FT_EXPORT( void ) FT_Trace_Set_Level ( const char * tracing_level ); Change the levels of tracing components of FreeType at run time.","title":"FT_Trace_Set_Level"},{"location":"ft2-debugging_apis.html#ft_trace_set_default_level","text":"FT_EXPORT( void ) FT_Trace_Set_Default_Level ( void ); Reset tracing value of FreeType's components to the default value (i.e., to the value of the FT2_DEBUG environment value or to NULL if FT2_DEBUG is not set).","title":"FT_Trace_Set_Default_Level"},{"location":"ft2-debugging_apis.html#ft_custom_log_handler","text":"typedef void (* FT_Custom_Log_Handler )( const char * ft_component, const char * fmt, va_list args ); A function typedef that is used to handle the logging of tracing and debug messages on a file system.","title":"FT_Custom_Log_Handler"},{"location":"ft2-debugging_apis.html#ft_set_log_handler","text":"FT_EXPORT( void ) FT_Set_Log_Handler ( FT_Custom_Log_Handler handler ); A function to set a custom log handler.","title":"FT_Set_Log_Handler"},{"location":"ft2-debugging_apis.html#ft_set_default_log_handler","text":"FT_EXPORT( void ) FT_Set_Default_Log_Handler ( void ); A function to undo the effect of FT_Set_Log_Handler , resetting the log handler to FreeType's built-in version.","title":"FT_Set_Default_Log_Handler"},{"location":"ft2-error_code_values.html","text":"FreeType \u00bb Docs \u00bb Error Codes \u00bb Error Code Values Error Code Values \u00b6 Synopsis \u00b6 The list below is taken verbatim from the file fterrdef.h (loaded automatically by including FT_FREETYPE_H ). The first argument of the FT_ERROR_DEF_ macro is the error label; by default, the prefix FT_Err_ gets added so that you get error names like FT_Err_Cannot_Open_Resource . The second argument is the error code, and the last argument an error string, which is not used by FreeType. Within your application you should only use error names and never its numeric values! The latter might (and actually do) change in forthcoming FreeType versions. Macro FT_NOERRORDEF_ defines FT_Err_Ok , which is always zero. See the \u2018Error Enumerations\u2019 subsection how to automatically generate a list of error strings. FT_Err_XXX \u00b6 /* 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\" ) FT_ERRORDEF_( Array_Too_Large, 0x0A, \"array allocation size too large\" ) FT_ERRORDEF_( Missing_Module, 0x0B, \"missing module\" ) FT_ERRORDEF_( Missing_Property, 0x0C, \"missing property\" ) /* 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\" ) FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C, \"found FDEF or IDEF opcode in glyf bytecode\" ) FT_ERRORDEF_( Missing_Bitmap, 0x9D, \"missing bitmap in strike\" ) /* CFF, CID, and Type 1 errors */ FT_ERRORDEF_( Syntax_Error, 0xA0, \"opcode syntax error\" ) FT_ERRORDEF_( Stack_Underflow, 0xA1, \"argument stack underflow\" ) FT_ERRORDEF_( Ignore, 0xA2, \"ignore\" ) FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \"no Unicode glyph name found\" ) FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \"glyph too big for hinting\" ) /* 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_Fontboundingbox_Field, 0xB3, \"`FONTBOUNDINGBOX' field missing\" ) FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \"`CHARS' field missing\" ) FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \"`STARTCHAR' field missing\" ) FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \"`ENCODING' field missing\" ) FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \"`BBX' field missing\" ) FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \"`BBX' too big\" ) FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \"Font header corrupted or missing fields\" ) FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \"Font glyphs corrupted or missing fields\" )","title":"Error Code Values"},{"location":"ft2-error_code_values.html#error-code-values","text":"","title":"Error Code Values"},{"location":"ft2-error_code_values.html#synopsis","text":"The list below is taken verbatim from the file fterrdef.h (loaded automatically by including FT_FREETYPE_H ). The first argument of the FT_ERROR_DEF_ macro is the error label; by default, the prefix FT_Err_ gets added so that you get error names like FT_Err_Cannot_Open_Resource . The second argument is the error code, and the last argument an error string, which is not used by FreeType. Within your application you should only use error names and never its numeric values! The latter might (and actually do) change in forthcoming FreeType versions. Macro FT_NOERRORDEF_ defines FT_Err_Ok , which is always zero. See the \u2018Error Enumerations\u2019 subsection how to automatically generate a list of error strings.","title":"Synopsis"},{"location":"ft2-error_code_values.html#ft_err_xxx","text":"/* 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\" ) FT_ERRORDEF_( Array_Too_Large, 0x0A, \"array allocation size too large\" ) FT_ERRORDEF_( Missing_Module, 0x0B, \"missing module\" ) FT_ERRORDEF_( Missing_Property, 0x0C, \"missing property\" ) /* 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\" ) FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C, \"found FDEF or IDEF opcode in glyf bytecode\" ) FT_ERRORDEF_( Missing_Bitmap, 0x9D, \"missing bitmap in strike\" ) /* CFF, CID, and Type 1 errors */ FT_ERRORDEF_( Syntax_Error, 0xA0, \"opcode syntax error\" ) FT_ERRORDEF_( Stack_Underflow, 0xA1, \"argument stack underflow\" ) FT_ERRORDEF_( Ignore, 0xA2, \"ignore\" ) FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \"no Unicode glyph name found\" ) FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \"glyph too big for hinting\" ) /* 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_Fontboundingbox_Field, 0xB3, \"`FONTBOUNDINGBOX' field missing\" ) FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \"`CHARS' field missing\" ) FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \"`STARTCHAR' field missing\" ) FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \"`ENCODING' field missing\" ) FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \"`BBX' field missing\" ) FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \"`BBX' too big\" ) FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \"Font header corrupted or missing fields\" ) FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \"Font glyphs corrupted or missing fields\" )","title":"FT_Err_XXX"},{"location":"ft2-error_enumerations.html","text":"FreeType \u00bb Docs \u00bb Error Codes \u00bb Error Enumerations Error Enumerations \u00b6 Synopsis \u00b6 The header file fterrors.h (which is automatically included by freetype.h defines the handling of FreeType's enumeration constants. It can also be used to generate error message strings with a small macro trick explained below. Error Formats The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be defined in ftoption.h in order to make the higher byte indicate the module where the error has happened (this is not compatible with standard builds of FreeType 2, however). See the file ftmoderr.h for more details. Error Message Strings Error definitions are set up with special macros that allow client applications to build a table of error message strings. 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. FT_ERROR_DEF( e, v, s ) This macro is called to define one single error. \u2018e\u2019 is the error code identifier (e.g., Invalid_Argument ), \u2018v\u2019 is the error's numerical value, and \u2018s\u2019 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, NULL } }; const struct { int err_code; const char* err_msg; } ft_errors[] = #include <freetype/fterrors.h> An alternative to using an array is a switch statement. #undef FTERRORS_H_ #define FT_ERROR_START_LIST switch ( error_code ) { #define FT_ERRORDEF( e, v, s ) case v: return s; #define FT_ERROR_END_LIST } If you use FT_CONFIG_OPTION_USE_MODULE_ERRORS , error_code should be replaced with FT_ERROR_BASE(error_code) in the last example. FT_Error_String \u00b6 Defined in FT_ERRORS_H (freetype/fterrors.h). FT_EXPORT( const char * ) FT_Error_String ( FT_Error error_code ); Retrieve the description of a valid FreeType error code. input error_code A valid FreeType error code. return A C string or NULL , if any error occurred. note FreeType has to be compiled with FT_CONFIG_OPTION_ERROR_STRINGS or FT_DEBUG_LEVEL_ERROR to get meaningful descriptions. \u2018error_string\u2019 will be NULL otherwise. Module identification will be ignored: strcmp ( FT_Error_String ( FT_Err_Unknown_File_Format ), FT_Error_String ( BDF_Err_Unknown_File_Format ) ) == 0 ;","title":"Error Enumerations"},{"location":"ft2-error_enumerations.html#error-enumerations","text":"","title":"Error Enumerations"},{"location":"ft2-error_enumerations.html#synopsis","text":"The header file fterrors.h (which is automatically included by freetype.h defines the handling of FreeType's enumeration constants. It can also be used to generate error message strings with a small macro trick explained below. Error Formats The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be defined in ftoption.h in order to make the higher byte indicate the module where the error has happened (this is not compatible with standard builds of FreeType 2, however). See the file ftmoderr.h for more details. Error Message Strings Error definitions are set up with special macros that allow client applications to build a table of error message strings. 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. FT_ERROR_DEF( e, v, s ) This macro is called to define one single error. \u2018e\u2019 is the error code identifier (e.g., Invalid_Argument ), \u2018v\u2019 is the error's numerical value, and \u2018s\u2019 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, NULL } }; const struct { int err_code; const char* err_msg; } ft_errors[] = #include <freetype/fterrors.h> An alternative to using an array is a switch statement. #undef FTERRORS_H_ #define FT_ERROR_START_LIST switch ( error_code ) { #define FT_ERRORDEF( e, v, s ) case v: return s; #define FT_ERROR_END_LIST } If you use FT_CONFIG_OPTION_USE_MODULE_ERRORS , error_code should be replaced with FT_ERROR_BASE(error_code) in the last example.","title":"Synopsis"},{"location":"ft2-error_enumerations.html#ft_error_string","text":"Defined in FT_ERRORS_H (freetype/fterrors.h). FT_EXPORT( const char * ) FT_Error_String ( FT_Error error_code ); Retrieve the description of a valid FreeType error code.","title":"FT_Error_String"},{"location":"ft2-font_formats.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Font Formats Font Formats \u00b6 Synopsis \u00b6 The single function in this section can be used to get the font format. Note that this information is not needed normally; however, there are special cases (like in PDF devices) where it is important to differentiate, in spite of FreeType's uniform API. FT_Get_Font_Format \u00b6 Defined in FT_FONT_FORMATS_H (freetype/ftfntfmt.h). FT_EXPORT( const char * ) FT_Get_Font_Format ( FT_Face face ); /* deprecated */ FT_EXPORT( const char * ) FT_Get_X11_Font_Format( FT_Face face ); Return a string describing the format of a given face. Possible values are \u2018TrueType\u2019, \u2018Type 1\u2019, \u2018BDF\u2019, \u2018PCF\u2019, \u2018Type 42\u2019, \u2018CID Type 1\u2019, \u2018CFF\u2019, \u2018PFR\u2019, and \u2018Windows FNT\u2019. The return value is suitable to be used as an X11 FONT_PROPERTY. input face Input face handle. return Font format string. NULL in case of error. note A deprecated name for the same function is FT_Get_X11_Font_Format .","title":"Font Formats"},{"location":"ft2-font_formats.html#font-formats","text":"","title":"Font Formats"},{"location":"ft2-font_formats.html#synopsis","text":"The single function in this section can be used to get the font format. Note that this information is not needed normally; however, there are special cases (like in PDF devices) where it is important to differentiate, in spite of FreeType's uniform API.","title":"Synopsis"},{"location":"ft2-font_formats.html#ft_get_font_format","text":"Defined in FT_FONT_FORMATS_H (freetype/ftfntfmt.h). FT_EXPORT( const char * ) FT_Get_Font_Format ( FT_Face face ); /* deprecated */ FT_EXPORT( const char * ) FT_Get_X11_Font_Format( FT_Face face ); Return a string describing the format of a given face. Possible values are \u2018TrueType\u2019, \u2018Type 1\u2019, \u2018BDF\u2019, \u2018PCF\u2019, \u2018Type 42\u2019, \u2018CID Type 1\u2019, \u2018CFF\u2019, \u2018PFR\u2019, and \u2018Windows FNT\u2019. The return value is suitable to be used as an X11 FONT_PROPERTY.","title":"FT_Get_Font_Format"},{"location":"ft2-gasp_table.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Gasp Table Gasp Table \u00b6 Synopsis \u00b6 The function FT_Get_Gasp can be used to query a TrueType or OpenType font for specific entries in its \u2018gasp\u2019 table, if any. This is mainly useful when implementing native TrueType hinting with the bytecode interpreter to duplicate the Windows text rendering results. FT_GASP_XXX \u00b6 Defined in FT_GASP_H (freetype/ftgasp.h). # define FT_GASP_NO_TABLE -1 # define FT_GASP_DO_GRIDFIT 0x01 # define FT_GASP_DO_GRAY 0x02 # define FT_GASP_SYMMETRIC_GRIDFIT 0x04 # define FT_GASP_SYMMETRIC_SMOOTHING 0x08 A list of values and/or bit-flags returned by the FT_Get_Gasp function. values FT_GASP_NO_TABLE This special value means that there is no GASP table in this face. It is up to the client to decide what to do. FT_GASP_DO_GRIDFIT Grid-fitting and hinting should be performed at the specified ppem. This really means TrueType bytecode interpretation. If this bit is not set, no hinting gets applied. FT_GASP_DO_GRAY Anti-aliased rendering should be performed at the specified ppem. If not set, do monochrome rendering. FT_GASP_SYMMETRIC_SMOOTHING If set, smoothing along multiple axes must be used with ClearType. FT_GASP_SYMMETRIC_GRIDFIT Grid-fitting must be used with ClearType's symmetric smoothing. note The bit-flags FT_GASP_DO_GRIDFIT and FT_GASP_DO_GRAY are to be used for standard font rasterization only. Independently of that, FT_GASP_SYMMETRIC_SMOOTHING and FT_GASP_SYMMETRIC_GRIDFIT are to be used if ClearType is enabled (and FT_GASP_DO_GRIDFIT and FT_GASP_DO_GRAY are consequently ignored). \u2018ClearType\u2019 is Microsoft's implementation of LCD rendering, partly protected by patents. since 2.3.0 FT_Get_Gasp \u00b6 Defined in FT_GASP_H (freetype/ftgasp.h). FT_EXPORT( FT_Int ) FT_Get_Gasp ( FT_Face face, FT_UInt ppem ); For a TrueType or OpenType font file, return the rasterizer behaviour flags from the font's \u2018gasp\u2019 table corresponding to a given character pixel size. input face The source face handle. ppem The vertical character pixel size. return Bit flags (see FT_GASP_XXX ), or FT_GASP_NO_TABLE if there is no \u2018gasp\u2019 table in the face. note If you want to use the MM functionality of OpenType variation fonts (i.e., using FT_Set_Var_Design_Coordinates and friends), call this function after setting an instance since the return values can change. since 2.3.0","title":"Gasp Table"},{"location":"ft2-gasp_table.html#gasp-table","text":"","title":"Gasp Table"},{"location":"ft2-gasp_table.html#synopsis","text":"The function FT_Get_Gasp can be used to query a TrueType or OpenType font for specific entries in its \u2018gasp\u2019 table, if any. This is mainly useful when implementing native TrueType hinting with the bytecode interpreter to duplicate the Windows text rendering results.","title":"Synopsis"},{"location":"ft2-gasp_table.html#ft_gasp_xxx","text":"Defined in FT_GASP_H (freetype/ftgasp.h). # define FT_GASP_NO_TABLE -1 # define FT_GASP_DO_GRIDFIT 0x01 # define FT_GASP_DO_GRAY 0x02 # define FT_GASP_SYMMETRIC_GRIDFIT 0x04 # define FT_GASP_SYMMETRIC_SMOOTHING 0x08 A list of values and/or bit-flags returned by the FT_Get_Gasp function.","title":"FT_GASP_XXX"},{"location":"ft2-gasp_table.html#ft_get_gasp","text":"Defined in FT_GASP_H (freetype/ftgasp.h). FT_EXPORT( FT_Int ) FT_Get_Gasp ( FT_Face face, FT_UInt ppem ); For a TrueType or OpenType font file, return the rasterizer behaviour flags from the font's \u2018gasp\u2019 table corresponding to a given character pixel size.","title":"FT_Get_Gasp"},{"location":"ft2-glyph_management.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Glyph Management Glyph Management \u00b6 Synopsis \u00b6 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. These objects are detached from FT_Face , contrary to FT_GlyphSlot . FT_Glyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_GlyphRec_* FT_Glyph ; 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 . FT_GlyphRec \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_GlyphRec_ { FT_Library library; const FT_Glyph_Class* clazz; FT_Glyph_Format format; FT_Vector advance; } FT_GlyphRec ; The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed-point 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. FT_BitmapGlyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph ; 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 . FT_BitmapGlyphRec \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_BitmapGlyphRec_ { FT_GlyphRec root; FT_Int left; FT_Int top; FT_Bitmap bitmap; } FT_BitmapGlyphRec ; A structure used for bitmap glyph images. This really is a \u2018sub-class\u2019 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 an 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 FT_BitmapGlyph and is thus created and destroyed with it. FT_OutlineGlyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph ; 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 . FT_OutlineGlyphRec \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_OutlineGlyphRec_ { FT_GlyphRec root; FT_Outline outline; } FT_OutlineGlyphRec ; A structure used for outline (vectorial) glyph images. This really is a \u2018sub-class\u2019 of FT_GlyphRec . fields root The root FT_Glyph fields. outline A descriptor for the outline. note You can typecast an 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. FT_New_Glyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_New_Glyph ( FT_Library library, FT_Glyph_Format format, FT_Glyph *aglyph ); A function used to create a new empty glyph image. Note that the created FT_Glyph object must be released with FT_Done_Glyph . input library A handle to the FreeType library object. format The format of the glyph's image. output aglyph A handle to the glyph object. return FreeType error code. 0 means success. since 2.10 FT_Get_Glyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Get_Glyph ( FT_GlyphSlot slot, FT_Glyph *aglyph ); A function used to extract a glyph image from a slot. Note that the created FT_Glyph object must be released with FT_Done_Glyph . input slot A handle to the source glyph slot. output aglyph A handle to the glyph object. return FreeType error code. 0 means success. note Because *aglyph->advance.x and *aglyph->advance.y are 16.16 fixed-point numbers, slot->advance.x and slot->advance.y (which are in 26.6 fixed-point format) must be in the range ]-32768;32768[. FT_Glyph_Copy \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_Copy ( FT_Glyph source, FT_Glyph *target ); A function used to copy a glyph image. Note that the created FT_Glyph object must be released with FT_Done_Glyph . input source A handle to the source glyph object. output target A handle to the target glyph object. 0 in case of error. return FreeType error code. 0 means success. FT_Glyph_Transform \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_Transform ( FT_Glyph glyph, const FT_Matrix * matrix, const FT_Vector * delta ); Transform 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 (if not 0, the glyph format is not scalable). note The 2x2 transformation matrix is also applied to the glyph's advance vector. FT_Glyph_BBox_Mode \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef enum FT_Glyph_BBox_Mode_ { FT_GLYPH_BBOX_UNSCALED = 0, FT_GLYPH_BBOX_SUBPIXELS = 0, FT_GLYPH_BBOX_GRIDFIT = 1, FT_GLYPH_BBOX_TRUNCATE = 2, FT_GLYPH_BBOX_PIXELS = 3 } FT_Glyph_BBox_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Glyph_BBox_Mode ` values instead */ # define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED # define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS # define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT # define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE # define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS The mode how the values of FT_Glyph_Get_CBox are returned. values FT_GLYPH_BBOX_UNSCALED Return unscaled font units. FT_GLYPH_BBOX_SUBPIXELS Return unfitted 26.6 coordinates. FT_GLYPH_BBOX_GRIDFIT Return grid-fitted 26.6 coordinates. FT_GLYPH_BBOX_TRUNCATE Return coordinates in integer pixels. FT_GLYPH_BBOX_PIXELS Return grid-fitted pixel coordinates. FT_Glyph_Get_CBox \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Glyph_Get_CBox ( FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox ); Return a glyph's \u2018control box\u2019. 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 that 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 \u2018ftbbox\u2019 component, which is dedicated to this single task. input glyph A handle to the source glyph object. mode The mode that 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 in 26.6 pixel format. The value FT_GLYPH_BBOX_SUBPIXELS is another name for this constant. If the font is tricky and the glyph has been loaded with FT_LOAD_NO_SCALE , the resulting CBox is meaningless. To get reasonable values for the CBox it is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting the CBox, which can be eventually converted back to font units. 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 . FT_Glyph_To_Bitmap \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_To_Bitmap ( FT_Glyph * the_glyph, FT_Render_Mode render_mode, const FT_Vector * origin, FT_Bool destroy ); Convert 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 describes 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 This function does nothing if the glyph format isn't scalable. The glyph image is translated with the origin vector before rendering. The first parameter is a pointer to an FT_Glyph handle, that will be replaced by this function (with newly allocated data). 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_DEFAULT ); // extract glyph image error = FT_Get_Glyph( face->glyph, &glyph ); // convert to a bitmap (default render mode + destroying old) if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) { error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, 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 ); Here is another example, again without error handling: FT_Glyph glyphs[MAX_GLYPHS] ... for ( idx = 0; i < MAX_GLYPHS; i++ ) error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || FT_Get_Glyph ( face->glyph, &glyphs[idx] ); ... for ( idx = 0; i < MAX_GLYPHS; i++ ) { FT_Glyph bitmap = glyphs[idx]; ... // after this call, `bitmap' no longer points into // the `glyphs' array (and the old value isn't destroyed) FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); ... FT_Done_Glyph( bitmap ); } ... for ( idx = 0; i < MAX_GLYPHS; i++ ) FT_Done_Glyph( glyphs[idx] ); FT_Done_Glyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Done_Glyph ( FT_Glyph glyph ); Destroy a given glyph. input glyph A handle to the target glyph object.","title":"Glyph Management"},{"location":"ft2-glyph_management.html#glyph-management","text":"","title":"Glyph Management"},{"location":"ft2-glyph_management.html#synopsis","text":"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. These objects are detached from FT_Face , contrary to FT_GlyphSlot .","title":"Synopsis"},{"location":"ft2-glyph_management.html#ft_glyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_GlyphRec_* FT_Glyph ; 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.","title":"FT_Glyph"},{"location":"ft2-glyph_management.html#ft_glyphrec","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_GlyphRec_ { FT_Library library; const FT_Glyph_Class* clazz; FT_Glyph_Format format; FT_Vector advance; } FT_GlyphRec ; The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed-point format.","title":"FT_GlyphRec"},{"location":"ft2-glyph_management.html#ft_bitmapglyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph ; 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 .","title":"FT_BitmapGlyph"},{"location":"ft2-glyph_management.html#ft_bitmapglyphrec","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_BitmapGlyphRec_ { FT_GlyphRec root; FT_Int left; FT_Int top; FT_Bitmap bitmap; } FT_BitmapGlyphRec ; A structure used for bitmap glyph images. This really is a \u2018sub-class\u2019 of FT_GlyphRec .","title":"FT_BitmapGlyphRec"},{"location":"ft2-glyph_management.html#ft_outlineglyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph ; 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 .","title":"FT_OutlineGlyph"},{"location":"ft2-glyph_management.html#ft_outlineglyphrec","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_OutlineGlyphRec_ { FT_GlyphRec root; FT_Outline outline; } FT_OutlineGlyphRec ; A structure used for outline (vectorial) glyph images. This really is a \u2018sub-class\u2019 of FT_GlyphRec .","title":"FT_OutlineGlyphRec"},{"location":"ft2-glyph_management.html#ft_new_glyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_New_Glyph ( FT_Library library, FT_Glyph_Format format, FT_Glyph *aglyph ); A function used to create a new empty glyph image. Note that the created FT_Glyph object must be released with FT_Done_Glyph .","title":"FT_New_Glyph"},{"location":"ft2-glyph_management.html#ft_get_glyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Get_Glyph ( FT_GlyphSlot slot, FT_Glyph *aglyph ); A function used to extract a glyph image from a slot. Note that the created FT_Glyph object must be released with FT_Done_Glyph .","title":"FT_Get_Glyph"},{"location":"ft2-glyph_management.html#ft_glyph_copy","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_Copy ( FT_Glyph source, FT_Glyph *target ); A function used to copy a glyph image. Note that the created FT_Glyph object must be released with FT_Done_Glyph .","title":"FT_Glyph_Copy"},{"location":"ft2-glyph_management.html#ft_glyph_transform","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_Transform ( FT_Glyph glyph, const FT_Matrix * matrix, const FT_Vector * delta ); Transform a glyph image if its format is scalable.","title":"FT_Glyph_Transform"},{"location":"ft2-glyph_management.html#ft_glyph_bbox_mode","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef enum FT_Glyph_BBox_Mode_ { FT_GLYPH_BBOX_UNSCALED = 0, FT_GLYPH_BBOX_SUBPIXELS = 0, FT_GLYPH_BBOX_GRIDFIT = 1, FT_GLYPH_BBOX_TRUNCATE = 2, FT_GLYPH_BBOX_PIXELS = 3 } FT_Glyph_BBox_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Glyph_BBox_Mode ` values instead */ # define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED # define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS # define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT # define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE # define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS The mode how the values of FT_Glyph_Get_CBox are returned.","title":"FT_Glyph_BBox_Mode"},{"location":"ft2-glyph_management.html#ft_glyph_get_cbox","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Glyph_Get_CBox ( FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox ); Return a glyph's \u2018control box\u2019. 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 that 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 \u2018ftbbox\u2019 component, which is dedicated to this single task.","title":"FT_Glyph_Get_CBox"},{"location":"ft2-glyph_management.html#ft_glyph_to_bitmap","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_To_Bitmap ( FT_Glyph * the_glyph, FT_Render_Mode render_mode, const FT_Vector * origin, FT_Bool destroy ); Convert a given glyph object to a bitmap glyph object.","title":"FT_Glyph_To_Bitmap"},{"location":"ft2-glyph_management.html#ft_done_glyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Done_Glyph ( FT_Glyph glyph ); Destroy a given glyph.","title":"FT_Done_Glyph"},{"location":"ft2-glyph_stroker.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Glyph Stroker Glyph Stroker \u00b6 Synopsis \u00b6 This component generates stroked outlines of a given vectorial glyph. It also allows you to retrieve the \u2018outside\u2019 and/or the \u2018inside\u2019 borders of the stroke. This can be useful to generate \u2018bordered\u2019 glyph, i.e., glyphs displayed with a colored (and anti-aliased) border around their shape. FT_Stroker \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). typedef struct FT_StrokerRec_* FT_Stroker ; Opaque handle to a path stroker object. FT_Stroker_LineJoin \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_Stroker_LineJoin_ { FT_STROKER_LINEJOIN_ROUND = 0, FT_STROKER_LINEJOIN_BEVEL = 1, FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE , FT_STROKER_LINEJOIN_MITER_FIXED = 3 } FT_Stroker_LineJoin ; These values determine how two joining lines are rendered in a stroker. values FT_STROKER_LINEJOIN_ROUND Used to render rounded line joins. Circular arcs are used to join two lines smoothly. FT_STROKER_LINEJOIN_BEVEL Used to render beveled line joins. The outer corner of the joined lines is filled by enclosing the triangular region of the corner with a straight line between the outer corners of each stroke. FT_STROKER_LINEJOIN_MITER_FIXED Used to render mitered line joins, with fixed bevels if the miter limit is exceeded. The outer edges of the strokes for the two segments are extended until they meet at an angle. A bevel join (see above) is used if the segments meet at too sharp an angle and the outer edges meet beyond a distance corresponding to the meter limit. This prevents long spikes being created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter line join as used in PostScript and PDF. FT_STROKER_LINEJOIN_MITER_VARIABLE FT_STROKER_LINEJOIN_MITER Used to render mitered line joins, with variable bevels if the miter limit is exceeded. The intersection of the strokes is clipped perpendicularly to the bisector, at a distance corresponding to the miter limit. This prevents long spikes being created. FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias for FT_STROKER_LINEJOIN_MITER_VARIABLE , retained for backward compatibility. FT_Stroker_LineCap \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_Stroker_LineCap_ { FT_STROKER_LINECAP_BUTT = 0, FT_STROKER_LINECAP_ROUND , FT_STROKER_LINECAP_SQUARE } FT_Stroker_LineCap ; These values determine how the end of opened sub-paths are rendered in a stroke. values FT_STROKER_LINECAP_BUTT The end of lines is rendered as a full stop on the last point itself. FT_STROKER_LINECAP_ROUND The end of lines is rendered as a half-circle around the last point. FT_STROKER_LINECAP_SQUARE The end of lines is rendered as a square around the last point. FT_StrokerBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_StrokerBorder_ { FT_STROKER_BORDER_LEFT = 0, FT_STROKER_BORDER_RIGHT } FT_StrokerBorder ; These values are used to select a given stroke border in FT_Stroker_GetBorderCounts and FT_Stroker_ExportBorder . values FT_STROKER_BORDER_LEFT Select the left border, relative to the drawing direction. FT_STROKER_BORDER_RIGHT Select the right border, relative to the drawing direction. note Applications are generally interested in the \u2018inside\u2019 and \u2018outside\u2019 borders. However, there is no direct mapping between these and the \u2018left\u2019 and \u2018right\u2019 ones, since this really depends on the glyph's drawing orientation, which varies between font formats. You can however use FT_Outline_GetInsideBorder and FT_Outline_GetOutsideBorder to get these. FT_Outline_GetInsideBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetInsideBorder ( FT_Outline * outline ); Retrieve the FT_StrokerBorder value corresponding to the \u2018inside\u2019 borders of a given outline. input outline The source outline handle. return The border index. FT_STROKER_BORDER_RIGHT for empty or invalid outlines. FT_Outline_GetOutsideBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetOutsideBorder ( FT_Outline * outline ); Retrieve the FT_StrokerBorder value corresponding to the \u2018outside\u2019 borders of a given outline. input outline The source outline handle. return The border index. FT_STROKER_BORDER_LEFT for empty or invalid outlines. FT_Glyph_Stroke \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Glyph_Stroke ( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool destroy ); Stroke a given outline glyph object with a given stroker. inout pglyph Source glyph handle on input, new glyph handle on output. input stroker A stroker handle. destroy A Boolean. If 1, the source glyph object is destroyed on success. return FreeType error code. 0 means success. note The source glyph is untouched in case of error. Adding stroke may yield a significantly wider and taller glyph depending on how large of a radius was used to stroke the glyph. You may need to manually adjust horizontal and vertical advance amounts to account for this added size. FT_Glyph_StrokeBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Glyph_StrokeBorder ( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool inside, FT_Bool destroy ); Stroke a given outline glyph object with a given stroker, but only return either its inside or outside border. inout pglyph Source glyph handle on input, new glyph handle on output. input stroker A stroker handle. inside A Boolean. If 1, return the inside border, otherwise the outside border. destroy A Boolean. If 1, the source glyph object is destroyed on success. return FreeType error code. 0 means success. note The source glyph is untouched in case of error. Adding stroke may yield a significantly wider and taller glyph depending on how large of a radius was used to stroke the glyph. You may need to manually adjust horizontal and vertical advance amounts to account for this added size. FT_Stroker_New \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_New ( FT_Library library, FT_Stroker *astroker ); Create a new stroker object. input library FreeType library handle. output astroker A new stroker object handle. NULL in case of error. return FreeType error code. 0 means success. FT_Stroker_Set \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Set ( FT_Stroker stroker, FT_Fixed radius, FT_Stroker_LineCap line_cap, FT_Stroker_LineJoin line_join, FT_Fixed miter_limit ); Reset a stroker object's attributes. input stroker The target stroker handle. radius The border radius. line_cap The line cap style. line_join The line join style. miter_limit The maximum reciprocal sine of half-angle at the miter join, expressed as 16.16 fixed point value. note The radius is expressed in the same units as the outline coordinates. The miter_limit multiplied by the radius gives the maximum size of a miter spike, at which it is clipped for FT_STROKER_LINEJOIN_MITER_VARIABLE or replaced with a bevel join for FT_STROKER_LINEJOIN_MITER_FIXED . This function calls FT_Stroker_Rewind automatically. FT_Stroker_Rewind \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Rewind ( FT_Stroker stroker ); Reset a stroker object without changing its attributes. You should call this function before beginning a new series of calls to FT_Stroker_BeginSubPath or FT_Stroker_EndSubPath . input stroker The target stroker handle. FT_Stroker_ParseOutline \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_ParseOutline ( FT_Stroker stroker, FT_Outline * outline, FT_Bool opened ); A convenience function used to parse a whole outline with the stroker. The resulting outline(s) can be retrieved later by functions like FT_Stroker_GetCounts and FT_Stroker_Export . input stroker The target stroker handle. outline The source outline. opened A boolean. If 1, the outline is treated as an open path instead of a closed one. return FreeType error code. 0 means success. note If opened is 0 (the default), the outline is treated as a closed path, and the stroker generates two distinct \u2018border\u2019 outlines. If opened is 1, the outline is processed as an open path, and the stroker generates a single \u2018stroke\u2019 outline. This function calls FT_Stroker_Rewind automatically. FT_Stroker_Done \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Done ( FT_Stroker stroker ); Destroy a stroker object. input stroker A stroker handle. Can be NULL . FT_Stroker_BeginSubPath \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_BeginSubPath ( FT_Stroker stroker, FT_Vector * to, FT_Bool open ); Start a new sub-path in the stroker. input stroker The target stroker handle. to A pointer to the start vector. open A boolean. If 1, the sub-path is treated as an open one. return FreeType error code. 0 means success. note This function is useful when you need to stroke a path that is not stored as an FT_Outline object. FT_Stroker_EndSubPath \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_EndSubPath ( FT_Stroker stroker ); Close the current sub-path in the stroker. input stroker The target stroker handle. return FreeType error code. 0 means success. note You should call this function after FT_Stroker_BeginSubPath . If the subpath was not \u2018opened\u2019, this function \u2018draws\u2019 a single line segment to the start position when needed. FT_Stroker_LineTo \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_LineTo ( FT_Stroker stroker, FT_Vector * to ); \u2018Draw\u2019 a single line segment in the stroker's current sub-path, from the last position. input stroker The target stroker handle. to A pointer to the destination point. return FreeType error code. 0 means success. note You should call this function between FT_Stroker_BeginSubPath and FT_Stroker_EndSubPath . FT_Stroker_ConicTo \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_ConicTo ( FT_Stroker stroker, FT_Vector * control, FT_Vector * to ); \u2018Draw\u2019 a single quadratic Bezier in the stroker's current sub-path, from the last position. input stroker The target stroker handle. control A pointer to a Bezier control point. to A pointer to the destination point. return FreeType error code. 0 means success. note You should call this function between FT_Stroker_BeginSubPath and FT_Stroker_EndSubPath . FT_Stroker_CubicTo \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_CubicTo ( FT_Stroker stroker, FT_Vector * control1, FT_Vector * control2, FT_Vector * to ); \u2018Draw\u2019 a single cubic Bezier in the stroker's current sub-path, from the last position. input stroker The target stroker handle. control1 A pointer to the first Bezier control point. control2 A pointer to second Bezier control point. to A pointer to the destination point. return FreeType error code. 0 means success. note You should call this function between FT_Stroker_BeginSubPath and FT_Stroker_EndSubPath . FT_Stroker_GetBorderCounts \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_GetBorderCounts ( FT_Stroker stroker, FT_StrokerBorder border, FT_UInt *anum_points, FT_UInt *anum_contours ); Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export one of the \u2018border\u2019 or \u2018stroke\u2019 outlines generated by the stroker. input stroker The target stroker handle. border The border index. output anum_points The number of points. anum_contours The number of contours. return FreeType error code. 0 means success. note When an outline, or a sub-path, is \u2018closed\u2019, the stroker generates two independent \u2018border\u2019 outlines, named \u2018left\u2019 and \u2018right\u2019. When the outline, or a sub-path, is \u2018opened\u2019, the stroker merges the \u2018border\u2019 outlines with caps. The \u2018left\u2019 border receives all points, while the \u2018right\u2019 border becomes empty. Use the function FT_Stroker_GetCounts instead if you want to retrieve the counts associated to both borders. FT_Stroker_ExportBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_ExportBorder ( FT_Stroker stroker, FT_StrokerBorder border, FT_Outline * outline ); Call this function after FT_Stroker_GetBorderCounts to export the corresponding border to your own FT_Outline structure. Note that this function appends the border points and contours to your outline, but does not try to resize its arrays. input stroker The target stroker handle. border The border index. outline The target outline handle. note Always call this function after FT_Stroker_GetBorderCounts to get sure that there is enough room in your FT_Outline object to receive all new data. When an outline, or a sub-path, is \u2018closed\u2019, the stroker generates two independent \u2018border\u2019 outlines, named \u2018left\u2019 and \u2018right\u2019. When the outline, or a sub-path, is \u2018opened\u2019, the stroker merges the \u2018border\u2019 outlines with caps. The \u2018left\u2019 border receives all points, while the \u2018right\u2019 border becomes empty. Use the function FT_Stroker_Export instead if you want to retrieve all borders at once. FT_Stroker_GetCounts \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_GetCounts ( FT_Stroker stroker, FT_UInt *anum_points, FT_UInt *anum_contours ); Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export all points/borders from the stroked outline/path. input stroker The target stroker handle. output anum_points The number of points. anum_contours The number of contours. return FreeType error code. 0 means success. FT_Stroker_Export \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Export ( FT_Stroker stroker, FT_Outline * outline ); Call this function after FT_Stroker_GetBorderCounts to export all borders to your own FT_Outline structure. Note that this function appends the border points and contours to your outline, but does not try to resize its arrays. input stroker The target stroker handle. outline The target outline handle.","title":"Glyph Stroker"},{"location":"ft2-glyph_stroker.html#glyph-stroker","text":"","title":"Glyph Stroker"},{"location":"ft2-glyph_stroker.html#synopsis","text":"This component generates stroked outlines of a given vectorial glyph. It also allows you to retrieve the \u2018outside\u2019 and/or the \u2018inside\u2019 borders of the stroke. This can be useful to generate \u2018bordered\u2019 glyph, i.e., glyphs displayed with a colored (and anti-aliased) border around their shape.","title":"Synopsis"},{"location":"ft2-glyph_stroker.html#ft_stroker","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). typedef struct FT_StrokerRec_* FT_Stroker ; Opaque handle to a path stroker object.","title":"FT_Stroker"},{"location":"ft2-glyph_stroker.html#ft_stroker_linejoin","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_Stroker_LineJoin_ { FT_STROKER_LINEJOIN_ROUND = 0, FT_STROKER_LINEJOIN_BEVEL = 1, FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE , FT_STROKER_LINEJOIN_MITER_FIXED = 3 } FT_Stroker_LineJoin ; These values determine how two joining lines are rendered in a stroker.","title":"FT_Stroker_LineJoin"},{"location":"ft2-glyph_stroker.html#ft_stroker_linecap","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_Stroker_LineCap_ { FT_STROKER_LINECAP_BUTT = 0, FT_STROKER_LINECAP_ROUND , FT_STROKER_LINECAP_SQUARE } FT_Stroker_LineCap ; These values determine how the end of opened sub-paths are rendered in a stroke.","title":"FT_Stroker_LineCap"},{"location":"ft2-glyph_stroker.html#ft_strokerborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_StrokerBorder_ { FT_STROKER_BORDER_LEFT = 0, FT_STROKER_BORDER_RIGHT } FT_StrokerBorder ; These values are used to select a given stroke border in FT_Stroker_GetBorderCounts and FT_Stroker_ExportBorder .","title":"FT_StrokerBorder"},{"location":"ft2-glyph_stroker.html#ft_outline_getinsideborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetInsideBorder ( FT_Outline * outline ); Retrieve the FT_StrokerBorder value corresponding to the \u2018inside\u2019 borders of a given outline.","title":"FT_Outline_GetInsideBorder"},{"location":"ft2-glyph_stroker.html#ft_outline_getoutsideborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetOutsideBorder ( FT_Outline * outline ); Retrieve the FT_StrokerBorder value corresponding to the \u2018outside\u2019 borders of a given outline.","title":"FT_Outline_GetOutsideBorder"},{"location":"ft2-glyph_stroker.html#ft_glyph_stroke","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Glyph_Stroke ( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool destroy ); Stroke a given outline glyph object with a given stroker.","title":"FT_Glyph_Stroke"},{"location":"ft2-glyph_stroker.html#ft_glyph_strokeborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Glyph_StrokeBorder ( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool inside, FT_Bool destroy ); Stroke a given outline glyph object with a given stroker, but only return either its inside or outside border.","title":"FT_Glyph_StrokeBorder"},{"location":"ft2-glyph_stroker.html#ft_stroker_new","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_New ( FT_Library library, FT_Stroker *astroker ); Create a new stroker object.","title":"FT_Stroker_New"},{"location":"ft2-glyph_stroker.html#ft_stroker_set","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Set ( FT_Stroker stroker, FT_Fixed radius, FT_Stroker_LineCap line_cap, FT_Stroker_LineJoin line_join, FT_Fixed miter_limit ); Reset a stroker object's attributes.","title":"FT_Stroker_Set"},{"location":"ft2-glyph_stroker.html#ft_stroker_rewind","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Rewind ( FT_Stroker stroker ); Reset a stroker object without changing its attributes. You should call this function before beginning a new series of calls to FT_Stroker_BeginSubPath or FT_Stroker_EndSubPath .","title":"FT_Stroker_Rewind"},{"location":"ft2-glyph_stroker.html#ft_stroker_parseoutline","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_ParseOutline ( FT_Stroker stroker, FT_Outline * outline, FT_Bool opened ); A convenience function used to parse a whole outline with the stroker. The resulting outline(s) can be retrieved later by functions like FT_Stroker_GetCounts and FT_Stroker_Export .","title":"FT_Stroker_ParseOutline"},{"location":"ft2-glyph_stroker.html#ft_stroker_done","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Done ( FT_Stroker stroker ); Destroy a stroker object.","title":"FT_Stroker_Done"},{"location":"ft2-glyph_stroker.html#ft_stroker_beginsubpath","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_BeginSubPath ( FT_Stroker stroker, FT_Vector * to, FT_Bool open ); Start a new sub-path in the stroker.","title":"FT_Stroker_BeginSubPath"},{"location":"ft2-glyph_stroker.html#ft_stroker_endsubpath","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_EndSubPath ( FT_Stroker stroker ); Close the current sub-path in the stroker.","title":"FT_Stroker_EndSubPath"},{"location":"ft2-glyph_stroker.html#ft_stroker_lineto","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_LineTo ( FT_Stroker stroker, FT_Vector * to ); \u2018Draw\u2019 a single line segment in the stroker's current sub-path, from the last position.","title":"FT_Stroker_LineTo"},{"location":"ft2-glyph_stroker.html#ft_stroker_conicto","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_ConicTo ( FT_Stroker stroker, FT_Vector * control, FT_Vector * to ); \u2018Draw\u2019 a single quadratic Bezier in the stroker's current sub-path, from the last position.","title":"FT_Stroker_ConicTo"},{"location":"ft2-glyph_stroker.html#ft_stroker_cubicto","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_CubicTo ( FT_Stroker stroker, FT_Vector * control1, FT_Vector * control2, FT_Vector * to ); \u2018Draw\u2019 a single cubic Bezier in the stroker's current sub-path, from the last position.","title":"FT_Stroker_CubicTo"},{"location":"ft2-glyph_stroker.html#ft_stroker_getbordercounts","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_GetBorderCounts ( FT_Stroker stroker, FT_StrokerBorder border, FT_UInt *anum_points, FT_UInt *anum_contours ); Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export one of the \u2018border\u2019 or \u2018stroke\u2019 outlines generated by the stroker.","title":"FT_Stroker_GetBorderCounts"},{"location":"ft2-glyph_stroker.html#ft_stroker_exportborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_ExportBorder ( FT_Stroker stroker, FT_StrokerBorder border, FT_Outline * outline ); Call this function after FT_Stroker_GetBorderCounts to export the corresponding border to your own FT_Outline structure. Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.","title":"FT_Stroker_ExportBorder"},{"location":"ft2-glyph_stroker.html#ft_stroker_getcounts","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_GetCounts ( FT_Stroker stroker, FT_UInt *anum_points, FT_UInt *anum_contours ); Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export all points/borders from the stroked outline/path.","title":"FT_Stroker_GetCounts"},{"location":"ft2-glyph_stroker.html#ft_stroker_export","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Export ( FT_Stroker stroker, FT_Outline * outline ); Call this function after FT_Stroker_GetBorderCounts to export all borders to your own FT_Outline structure. Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.","title":"FT_Stroker_Export"},{"location":"ft2-glyph_variants.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Unicode Variation Sequences Unicode Variation Sequences \u00b6 Synopsis \u00b6 Many characters, especially for CJK scripts, have variant forms. They are a sort of grey area somewhere between being totally irrelevant and semantically distinct; for this reason, the Unicode consortium decided to introduce Variation Sequences (VS), consisting of a Unicode base character and a variation selector instead of further extending the already huge number of characters. Unicode maintains two different sets, namely \u2018Standardized Variation Sequences\u2019 and registered \u2018Ideographic Variation Sequences\u2019 (IVS), collected in the \u2018Ideographic Variation Database\u2019 (IVD). https://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt https://unicode.org/reports/tr37/ https://unicode.org/ivd/ To date (January 2017), the character with the most ideographic variations is U+9089, having 32 such IVS. Three Mongolian Variation Selectors have the values U+180B-U+180D; 256 generic Variation Selectors are encoded in the ranges U+FE00-U+FE0F and U+E0100-U+E01EF. IVS currently use Variation Selectors from the range U+E0100-U+E01EF only. A VS consists of the base character value followed by a single Variation Selector. For example, to get the first variation of U+9089, you have to write the character sequence U+9089 U+E0100 . Adobe and MS decided to support both standardized and ideographic VS with a new cmap subtable (format 14). It is an odd subtable because it is not a mapping of input code points to glyphs, but contains lists of all variations supported by the font. A variation may be either \u2018default\u2019 or \u2018non-default\u2019 for a given font. A default variation is the one you will get for that code point if you look it up in the standard Unicode cmap. A non-default variation is a different glyph. FT_Face_GetCharVariantIndex \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Face_GetCharVariantIndex ( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); Return the glyph index of a given character code as modified by the variation selector. input face A handle to the source face object. charcode The character code point in Unicode. variantSelector The Unicode code point of the variation selector. return The glyph index. 0 means either \u2018undefined character code\u2019, or \u2018undefined selector code\u2019, or \u2018no variation selector cmap subtable\u2019, or \u2018current CharMap is not Unicode\u2019. note If you use FreeType to manipulate the contents of font files directly, be aware that the glyph index returned by this function doesn't always correspond to the internal indices used within the file. This is done to ensure that value 0 always corresponds to the \u2018missing glyph\u2019. This function is only meaningful if a) the font has a variation selector cmap sub table, and b) the current charmap has a Unicode encoding. since 2.3.6 FT_Face_GetCharVariantIsDefault \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Int ) FT_Face_GetCharVariantIsDefault ( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); Check whether this variation of this Unicode character is the one to be found in the charmap. input face A handle to the source face object. charcode The character codepoint in Unicode. variantSelector The Unicode codepoint of the variation selector. return 1 if found in the standard (Unicode) cmap, 0 if found in the variation selector cmap, or -1 if it is not a variation. note This function is only meaningful if the font has a variation selector cmap subtable. since 2.3.6 FT_Face_GetVariantSelectors \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetVariantSelectors ( FT_Face face ); Return a zero-terminated list of Unicode variation selectors found in the font. input face A handle to the source face object. return A pointer to an array of selector code points, or NULL if there is no valid variation selector cmap subtable. note The last item in the array is 0; the array is owned by the FT_Face object but can be overwritten or released on the next call to a FreeType function. since 2.3.6 FT_Face_GetVariantsOfChar \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetVariantsOfChar ( FT_Face face, FT_ULong charcode ); Return a zero-terminated list of Unicode variation selectors found for the specified character code. input face A handle to the source face object. charcode The character codepoint in Unicode. return A pointer to an array of variation selector code points that are active for the given character, or NULL if the corresponding list is empty. note The last item in the array is 0; the array is owned by the FT_Face object but can be overwritten or released on the next call to a FreeType function. since 2.3.6 FT_Face_GetCharsOfVariant \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetCharsOfVariant ( FT_Face face, FT_ULong variantSelector ); Return a zero-terminated list of Unicode character codes found for the specified variation selector. input face A handle to the source face object. variantSelector The variation selector code point in Unicode. return A list of all the code points that are specified by this selector (both default and non-default codes are returned) or NULL if there is no valid cmap or the variation selector is invalid. note The last item in the array is 0; the array is owned by the FT_Face object but can be overwritten or released on the next call to a FreeType function. since 2.3.6","title":"Unicode Variation Sequences"},{"location":"ft2-glyph_variants.html#unicode-variation-sequences","text":"","title":"Unicode Variation Sequences"},{"location":"ft2-glyph_variants.html#synopsis","text":"Many characters, especially for CJK scripts, have variant forms. They are a sort of grey area somewhere between being totally irrelevant and semantically distinct; for this reason, the Unicode consortium decided to introduce Variation Sequences (VS), consisting of a Unicode base character and a variation selector instead of further extending the already huge number of characters. Unicode maintains two different sets, namely \u2018Standardized Variation Sequences\u2019 and registered \u2018Ideographic Variation Sequences\u2019 (IVS), collected in the \u2018Ideographic Variation Database\u2019 (IVD). https://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt https://unicode.org/reports/tr37/ https://unicode.org/ivd/ To date (January 2017), the character with the most ideographic variations is U+9089, having 32 such IVS. Three Mongolian Variation Selectors have the values U+180B-U+180D; 256 generic Variation Selectors are encoded in the ranges U+FE00-U+FE0F and U+E0100-U+E01EF. IVS currently use Variation Selectors from the range U+E0100-U+E01EF only. A VS consists of the base character value followed by a single Variation Selector. For example, to get the first variation of U+9089, you have to write the character sequence U+9089 U+E0100 . Adobe and MS decided to support both standardized and ideographic VS with a new cmap subtable (format 14). It is an odd subtable because it is not a mapping of input code points to glyphs, but contains lists of all variations supported by the font. A variation may be either \u2018default\u2019 or \u2018non-default\u2019 for a given font. A default variation is the one you will get for that code point if you look it up in the standard Unicode cmap. A non-default variation is a different glyph.","title":"Synopsis"},{"location":"ft2-glyph_variants.html#ft_face_getcharvariantindex","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Face_GetCharVariantIndex ( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); Return the glyph index of a given character code as modified by the variation selector.","title":"FT_Face_GetCharVariantIndex"},{"location":"ft2-glyph_variants.html#ft_face_getcharvariantisdefault","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Int ) FT_Face_GetCharVariantIsDefault ( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); Check whether this variation of this Unicode character is the one to be found in the charmap.","title":"FT_Face_GetCharVariantIsDefault"},{"location":"ft2-glyph_variants.html#ft_face_getvariantselectors","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetVariantSelectors ( FT_Face face ); Return a zero-terminated list of Unicode variation selectors found in the font.","title":"FT_Face_GetVariantSelectors"},{"location":"ft2-glyph_variants.html#ft_face_getvariantsofchar","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetVariantsOfChar ( FT_Face face, FT_ULong charcode ); Return a zero-terminated list of Unicode variation selectors found for the specified character code.","title":"FT_Face_GetVariantsOfChar"},{"location":"ft2-glyph_variants.html#ft_face_getcharsofvariant","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetCharsOfVariant ( FT_Face face, FT_ULong variantSelector ); Return a zero-terminated list of Unicode character codes found for the specified variation selector.","title":"FT_Face_GetCharsOfVariant"},{"location":"ft2-gx_validation.html","text":"FreeType \u00bb Docs \u00bb Miscellaneous \u00bb TrueTypeGX/AAT Validation TrueTypeGX/AAT Validation \u00b6 Synopsis \u00b6 This section contains the declaration of functions to validate some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop, lcar). FT_TrueTypeGX_Validate \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( FT_Error ) FT_TrueTypeGX_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes tables[ FT_VALIDATE_GX_LENGTH ], FT_UInt table_length ); Validate various TrueTypeGX tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming). input face A handle to the input face. validation_flags A bit field that specifies the tables to be validated. See FT_VALIDATE_GXXXX for possible values. table_length The size of the tables array. Normally, FT_VALIDATE_GX_LENGTH should be passed. output tables The array where all validated sfnt tables are stored. The array itself must be allocated by a client. return FreeType error code. 0 means success. note This function only works with TrueTypeGX fonts, returning an error otherwise. After use, the application should deallocate the buffers pointed to by each tables element, by calling FT_TrueTypeGX_Free . A NULL value indicates that the table either doesn't exist in the font, the application hasn't asked for validation, or the validator doesn't have the ability to validate the sfnt table. FT_TrueTypeGX_Free \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( void ) FT_TrueTypeGX_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by TrueTypeGX validator. input face A handle to the input face. table The pointer to the buffer allocated by FT_TrueTypeGX_Validate . note This function must be used to free the buffer allocated by FT_TrueTypeGX_Validate only. FT_ClassicKern_Validate \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( FT_Error ) FT_ClassicKern_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes *ckern_table ); Validate classic (16-bit format) kern table to assure that the offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming). The \u2018kern\u2019 table validator in FT_TrueTypeGX_Validate deals with both the new 32-bit format and the classic 16-bit format, while FT_ClassicKern_Validate only supports the classic 16-bit format. input face A handle to the input face. validation_flags A bit field that specifies the dialect to be validated. See FT_VALIDATE_CKERNXXX for possible values. output ckern_table A pointer to the kern table. return FreeType error code. 0 means success. note After use, the application should deallocate the buffers pointed to by ckern_table , by calling FT_ClassicKern_Free . A NULL value indicates that the table doesn't exist in the font. FT_ClassicKern_Free \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( void ) FT_ClassicKern_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by classic Kern validator. input face A handle to the input face. table The pointer to the buffer that is allocated by FT_ClassicKern_Validate . note This function must be used to free the buffer allocated by FT_ClassicKern_Validate only. FT_VALIDATE_GX_LENGTH \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 ) The number of tables checked in this module. Use it as a parameter for the table-length argument of function FT_TrueTypeGX_Validate . FT_VALIDATE_GXXXX \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) # define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) # define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx ) # define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln ) # define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just ) # define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern ) # define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd ) # define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak ) # define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop ) # define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar ) # define FT_VALIDATE_GX ( FT_VALIDATE_feat | \\ FT_VALIDATE_mort | \\ FT_VALIDATE_morx | \\ FT_VALIDATE_bsln | \\ FT_VALIDATE_just | \\ FT_VALIDATE_kern | \\ FT_VALIDATE_opbd | \\ FT_VALIDATE_trak | \\ FT_VALIDATE_prop | \\ FT_VALIDATE_lcar ) A list of bit-field constants used with FT_TrueTypeGX_Validate to indicate which TrueTypeGX/AAT Type tables should be validated. values FT_VALIDATE_feat Validate \u2018feat\u2019 table. FT_VALIDATE_mort Validate \u2018mort\u2019 table. FT_VALIDATE_morx Validate \u2018morx\u2019 table. FT_VALIDATE_bsln Validate \u2018bsln\u2019 table. FT_VALIDATE_just Validate \u2018just\u2019 table. FT_VALIDATE_kern Validate \u2018kern\u2019 table. FT_VALIDATE_opbd Validate \u2018opbd\u2019 table. FT_VALIDATE_trak Validate \u2018trak\u2019 table. FT_VALIDATE_prop Validate \u2018prop\u2019 table. FT_VALIDATE_lcar Validate \u2018lcar\u2019 table. FT_VALIDATE_GX Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop and lcar). FT_VALIDATE_CKERNXXX \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) # define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) # define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) A list of bit-field constants used with FT_ClassicKern_Validate to indicate the classic kern dialect or dialects. If the selected type doesn't fit, FT_ClassicKern_Validate regards the table as invalid. values FT_VALIDATE_MS Handle the \u2018kern\u2019 table as a classic Microsoft kern table. FT_VALIDATE_APPLE Handle the \u2018kern\u2019 table as a classic Apple kern table. FT_VALIDATE_CKERN Handle the \u2018kern\u2019 as either classic Apple or Microsoft kern table.","title":"TrueTypeGX/AAT Validation"},{"location":"ft2-gx_validation.html#truetypegxaat-validation","text":"","title":"TrueTypeGX/AAT Validation"},{"location":"ft2-gx_validation.html#synopsis","text":"This section contains the declaration of functions to validate some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop, lcar).","title":"Synopsis"},{"location":"ft2-gx_validation.html#ft_truetypegx_validate","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( FT_Error ) FT_TrueTypeGX_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes tables[ FT_VALIDATE_GX_LENGTH ], FT_UInt table_length ); Validate various TrueTypeGX tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming).","title":"FT_TrueTypeGX_Validate"},{"location":"ft2-gx_validation.html#ft_truetypegx_free","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( void ) FT_TrueTypeGX_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by TrueTypeGX validator.","title":"FT_TrueTypeGX_Free"},{"location":"ft2-gx_validation.html#ft_classickern_validate","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( FT_Error ) FT_ClassicKern_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes *ckern_table ); Validate classic (16-bit format) kern table to assure that the offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming). The \u2018kern\u2019 table validator in FT_TrueTypeGX_Validate deals with both the new 32-bit format and the classic 16-bit format, while FT_ClassicKern_Validate only supports the classic 16-bit format.","title":"FT_ClassicKern_Validate"},{"location":"ft2-gx_validation.html#ft_classickern_free","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( void ) FT_ClassicKern_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by classic Kern validator.","title":"FT_ClassicKern_Free"},{"location":"ft2-gx_validation.html#ft_validate_gx_length","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 ) The number of tables checked in this module. Use it as a parameter for the table-length argument of function FT_TrueTypeGX_Validate .","title":"FT_VALIDATE_GX_LENGTH"},{"location":"ft2-gx_validation.html#ft_validate_gxxxx","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) # define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) # define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx ) # define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln ) # define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just ) # define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern ) # define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd ) # define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak ) # define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop ) # define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar ) # define FT_VALIDATE_GX ( FT_VALIDATE_feat | \\ FT_VALIDATE_mort | \\ FT_VALIDATE_morx | \\ FT_VALIDATE_bsln | \\ FT_VALIDATE_just | \\ FT_VALIDATE_kern | \\ FT_VALIDATE_opbd | \\ FT_VALIDATE_trak | \\ FT_VALIDATE_prop | \\ FT_VALIDATE_lcar ) A list of bit-field constants used with FT_TrueTypeGX_Validate to indicate which TrueTypeGX/AAT Type tables should be validated.","title":"FT_VALIDATE_GXXXX"},{"location":"ft2-gx_validation.html#ft_validate_ckernxxx","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) # define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) # define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) A list of bit-field constants used with FT_ClassicKern_Validate to indicate the classic kern dialect or dialects. If the selected type doesn't fit, FT_ClassicKern_Validate regards the table as invalid.","title":"FT_VALIDATE_CKERNXXX"},{"location":"ft2-gzip.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb GZIP Streams GZIP Streams \u00b6 Synopsis \u00b6 In certain builds of the library, gzip compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a gzipped stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of Gzip-specific functions. FT_Stream_OpenGzip \u00b6 Defined in FT_GZIP_H (freetype/ftgzip.h). FT_EXPORT( FT_Error ) FT_Stream_OpenGzip ( FT_Stream stream, FT_Stream source ); 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 The target embedding stream. source The source stream. return FreeType error code. 0 means success. note The source stream must be opened before calling this function. Calling the internal function FT_Stream_Close on the new stream will not call FT_Stream_Close on the source stream. None of the stream objects will be released to the heap. This function may return FT_Err_Unimplemented_Feature if your build of FreeType was not compiled with zlib support. FT_Gzip_Uncompress \u00b6 Defined in FT_GZIP_H (freetype/ftgzip.h). FT_EXPORT( FT_Error ) FT_Gzip_Uncompress ( FT_Memory memory, FT_Byte * output, FT_ULong * output_len, const FT_Byte * input, FT_ULong input_len ); Decompress a zipped input buffer into an output buffer. This function is modeled after zlib's uncompress function. input memory A FreeType memory handle. input The input buffer. input_len The length of the input buffer. output output The output buffer. inout output_len Before calling the function, this is the total size of the output buffer, which must be large enough to hold the entire uncompressed data (so the size of the uncompressed data must be known in advance). After calling the function, output_len is the size of the used data in output . return FreeType error code. 0 means success. note This function may return FT_Err_Unimplemented_Feature if your build of FreeType was not compiled with zlib support. since 2.5.1","title":"GZIP Streams"},{"location":"ft2-gzip.html#gzip-streams","text":"","title":"GZIP Streams"},{"location":"ft2-gzip.html#synopsis","text":"In certain builds of the library, gzip compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a gzipped stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of Gzip-specific functions.","title":"Synopsis"},{"location":"ft2-gzip.html#ft_stream_opengzip","text":"Defined in FT_GZIP_H (freetype/ftgzip.h). FT_EXPORT( FT_Error ) FT_Stream_OpenGzip ( FT_Stream stream, FT_Stream source ); 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.","title":"FT_Stream_OpenGzip"},{"location":"ft2-gzip.html#ft_gzip_uncompress","text":"Defined in FT_GZIP_H (freetype/ftgzip.h). FT_EXPORT( FT_Error ) FT_Gzip_Uncompress ( FT_Memory memory, FT_Byte * output, FT_ULong * output_len, const FT_Byte * input, FT_ULong input_len ); Decompress a zipped input buffer into an output buffer. This function is modeled after zlib's uncompress function.","title":"FT_Gzip_Uncompress"},{"location":"ft2-header_file_macros.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Header File Macros Header File Macros \u00b6 Synopsis \u00b6 In addition to the normal scheme of including header files like #include <freetype/freetype.h> #include <freetype/ftmm.h> #include <freetype/ftglyph.h> it is possible to used named macros instead. They can be used directly in #include statements as in #include FT_FREETYPE_H #include FT_MULTIPLE_MASTERS_H #include FT_GLYPH_H These macros were introduced to overcome the infamous 8.3 naming rule required by DOS (and FT_MULTIPLE_MASTERS_H is a lot more meaningful than ftmm.h ). FT_CONFIG_CONFIG_H \u00b6 # ifndef FT_CONFIG_CONFIG_H # define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h> # endif A macro used in #include statements to name the file containing FreeType 2 configuration data. FT_CONFIG_STANDARD_LIBRARY_H \u00b6 # ifndef FT_CONFIG_STANDARD_LIBRARY_H # define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> # endif A macro used in #include statements to name the file containing FreeType 2 interface to the standard C library functions. FT_CONFIG_OPTIONS_H \u00b6 # ifndef FT_CONFIG_OPTIONS_H # define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> # endif A macro used in #include statements to name the file containing FreeType 2 project-specific configuration options. FT_CONFIG_MODULES_H \u00b6 # ifndef FT_CONFIG_MODULES_H # define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h> # endif 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 . FT_FREETYPE_H \u00b6 # define FT_FREETYPE_H <freetype/freetype.h> A macro used in #include statements to name the file containing the base FreeType 2 API. FT_ERRORS_H \u00b6 # define FT_ERRORS_H <freetype/fterrors.h> 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 . FT_MODULE_ERRORS_H \u00b6 # define FT_MODULE_ERRORS_H <freetype/ftmoderr.h> A macro used in #include statements to name the file containing the list of FreeType 2 module error offsets (and messages). FT_SYSTEM_H \u00b6 # define FT_SYSTEM_H <freetype/ftsystem.h> 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 . FT_IMAGE_H \u00b6 # define FT_IMAGE_H <freetype/ftimage.h> A macro used in #include statements to name the file containing type definitions related to glyph images (i.e., bitmaps, outlines, scan-converter parameters). It is included by FT_FREETYPE_H . FT_TYPES_H \u00b6 # define FT_TYPES_H <freetype/fttypes.h> 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 . FT_LIST_H \u00b6 # define FT_LIST_H <freetype/ftlist.h> 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.) FT_OUTLINE_H \u00b6 # define FT_OUTLINE_H <freetype/ftoutln.h> A macro used in #include statements to name the file containing the scalable outline management API of FreeType 2. FT_SIZES_H \u00b6 # define FT_SIZES_H <freetype/ftsizes.h> A macro used in #include statements to name the file containing the API which manages multiple FT_Size objects per face. FT_MODULE_H \u00b6 # define FT_MODULE_H <freetype/ftmodapi.h> A macro used in #include statements to name the file containing the module management API of FreeType 2. FT_RENDER_H \u00b6 # define FT_RENDER_H <freetype/ftrender.h> A macro used in #include statements to name the file containing the renderer module management API of FreeType 2. FT_DRIVER_H \u00b6 # define FT_DRIVER_H <freetype/ftdriver.h> A macro used in #include statements to name the file containing structures and macros related to the driver modules. FT_AUTOHINTER_H \u00b6 # define FT_AUTOHINTER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the auto-hinting module. Deprecated since version 2.9; use FT_DRIVER_H instead. FT_CFF_DRIVER_H \u00b6 # define FT_CFF_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the CFF driver module. Deprecated since version 2.9; use FT_DRIVER_H instead. FT_TRUETYPE_DRIVER_H \u00b6 # define FT_TRUETYPE_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the TrueType driver module. Deprecated since version 2.9; use FT_DRIVER_H instead. FT_PCF_DRIVER_H \u00b6 # define FT_PCF_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the PCF driver module. Deprecated since version 2.9; use FT_DRIVER_H instead. FT_TYPE1_TABLES_H \u00b6 # define FT_TYPE1_TABLES_H <freetype/t1tables.h> A macro used in #include statements to name the file containing the types and API specific to the Type 1 format. FT_TRUETYPE_IDS_H \u00b6 # define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> A macro used in #include statements to name the file containing the enumeration values which identify name strings, languages, encodings, etc. This file really contains a large set of constant macro definitions, taken from the TrueType and OpenType specifications. FT_TRUETYPE_TABLES_H \u00b6 # define FT_TRUETYPE_TABLES_H <freetype/tttables.h> A macro used in #include statements to name the file containing the types and API specific to the TrueType (as well as OpenType) format. FT_TRUETYPE_TAGS_H \u00b6 # define FT_TRUETYPE_TAGS_H <freetype/tttags.h> A macro used in #include statements to name the file containing the definitions of TrueType four-byte \u2018tags\u2019 which identify blocks in SFNT-based font formats (i.e., TrueType and OpenType). FT_BDF_H \u00b6 # define FT_BDF_H <freetype/ftbdf.h> A macro used in #include statements to name the file containing the definitions of an API which accesses BDF-specific strings from a face. FT_CID_H \u00b6 # define FT_CID_H <freetype/ftcid.h> A macro used in #include statements to name the file containing the definitions of an API which access CID font information from a face. FT_GZIP_H \u00b6 # define FT_GZIP_H <freetype/ftgzip.h> A macro used in #include statements to name the file containing the definitions of an API which supports gzip-compressed files. FT_LZW_H \u00b6 # define FT_LZW_H <freetype/ftlzw.h> A macro used in #include statements to name the file containing the definitions of an API which supports LZW-compressed files. FT_BZIP2_H \u00b6 # define FT_BZIP2_H <freetype/ftbzip2.h> A macro used in #include statements to name the file containing the definitions of an API which supports bzip2-compressed files. FT_WINFONTS_H \u00b6 # define FT_WINFONTS_H <freetype/ftwinfnt.h> A macro used in #include statements to name the file containing the definitions of an API which supports Windows FNT files. FT_GLYPH_H \u00b6 # define FT_GLYPH_H <freetype/ftglyph.h> A macro used in #include statements to name the file containing the API of the optional glyph management component. FT_BITMAP_H \u00b6 # define FT_BITMAP_H <freetype/ftbitmap.h> A macro used in #include statements to name the file containing the API of the optional bitmap conversion component. FT_BBOX_H \u00b6 # define FT_BBOX_H <freetype/ftbbox.h> A macro used in #include statements to name the file containing the API of the optional exact bounding box computation routines. FT_CACHE_H \u00b6 # define FT_CACHE_H <freetype/ftcache.h> A macro used in #include statements to name the file containing the API of the optional FreeType 2 cache sub-system. FT_MAC_H \u00b6 # define FT_MAC_H <freetype/ftmac.h> 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). FT_MULTIPLE_MASTERS_H \u00b6 # define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> A macro used in #include statements to name the file containing the optional multiple-masters management API of FreeType 2. FT_SFNT_NAMES_H \u00b6 # define FT_SFNT_NAMES_H <freetype/ftsnames.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which accesses embedded \u2018name\u2019 strings in SFNT-based font formats (i.e., TrueType and OpenType). FT_OPENTYPE_VALIDATE_H \u00b6 # define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which validates OpenType tables (\u2018BASE\u2019, \u2018GDEF\u2019, \u2018GPOS\u2019, \u2018GSUB\u2019, \u2018JSTF\u2019). FT_GX_VALIDATE_H \u00b6 # define FT_GX_VALIDATE_H <freetype/ftgxval.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which validates TrueTypeGX/AAT tables (\u2018feat\u2019, \u2018mort\u2019, \u2018morx\u2019, \u2018bsln\u2019, \u2018just\u2019, \u2018kern\u2019, \u2018opbd\u2019, \u2018trak\u2019, \u2018prop\u2019). FT_PFR_H \u00b6 # define FT_PFR_H <freetype/ftpfr.h> A macro used in #include statements to name the file containing the FreeType 2 API which accesses PFR-specific data. FT_STROKER_H \u00b6 # define FT_STROKER_H <freetype/ftstroke.h> A macro used in #include statements to name the file containing the FreeType 2 API which provides functions to stroke outline paths. FT_SYNTHESIS_H \u00b6 # define FT_SYNTHESIS_H <freetype/ftsynth.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs artificial obliquing and emboldening. FT_FONT_FORMATS_H \u00b6 # define FT_FONT_FORMATS_H <freetype/ftfntfmt.h> /* deprecated */ # define FT_XFREE86_H FT_FONT_FORMATS_H A macro used in #include statements to name the file containing the FreeType 2 API which provides functions specific to font formats. FT_TRIGONOMETRY_H \u00b6 # define FT_TRIGONOMETRY_H <freetype/fttrigon.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs trigonometric computations (e.g., cosines and arc tangents). FT_LCD_FILTER_H \u00b6 # define FT_LCD_FILTER_H <freetype/ftlcdfil.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering. FT_INCREMENTAL_H \u00b6 # define FT_INCREMENTAL_H <freetype/ftincrem.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs incremental glyph loading. FT_GASP_H \u00b6 # define FT_GASP_H <freetype/ftgasp.h> A macro used in #include statements to name the file containing the FreeType 2 API which returns entries from the TrueType GASP table. FT_ADVANCES_H \u00b6 # define FT_ADVANCES_H <freetype/ftadvanc.h> A macro used in #include statements to name the file containing the FreeType 2 API which returns individual and ranged glyph advances. FT_COLOR_H \u00b6 # define FT_COLOR_H <freetype/ftcolor.h> A macro used in #include statements to name the file containing the FreeType 2 API which handles the OpenType \u2018CPAL\u2019 table.","title":"Header File Macros"},{"location":"ft2-header_file_macros.html#header-file-macros","text":"","title":"Header File Macros"},{"location":"ft2-header_file_macros.html#synopsis","text":"In addition to the normal scheme of including header files like #include <freetype/freetype.h> #include <freetype/ftmm.h> #include <freetype/ftglyph.h> it is possible to used named macros instead. They can be used directly in #include statements as in #include FT_FREETYPE_H #include FT_MULTIPLE_MASTERS_H #include FT_GLYPH_H These macros were introduced to overcome the infamous 8.3 naming rule required by DOS (and FT_MULTIPLE_MASTERS_H is a lot more meaningful than ftmm.h ).","title":"Synopsis"},{"location":"ft2-header_file_macros.html#ft_config_config_h","text":"# ifndef FT_CONFIG_CONFIG_H # define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h> # endif A macro used in #include statements to name the file containing FreeType 2 configuration data.","title":"FT_CONFIG_CONFIG_H"},{"location":"ft2-header_file_macros.html#ft_config_standard_library_h","text":"# ifndef FT_CONFIG_STANDARD_LIBRARY_H # define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> # endif A macro used in #include statements to name the file containing FreeType 2 interface to the standard C library functions.","title":"FT_CONFIG_STANDARD_LIBRARY_H"},{"location":"ft2-header_file_macros.html#ft_config_options_h","text":"# ifndef FT_CONFIG_OPTIONS_H # define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> # endif A macro used in #include statements to name the file containing FreeType 2 project-specific configuration options.","title":"FT_CONFIG_OPTIONS_H"},{"location":"ft2-header_file_macros.html#ft_config_modules_h","text":"# ifndef FT_CONFIG_MODULES_H # define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h> # endif 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 .","title":"FT_CONFIG_MODULES_H"},{"location":"ft2-header_file_macros.html#ft_freetype_h","text":"# define FT_FREETYPE_H <freetype/freetype.h> A macro used in #include statements to name the file containing the base FreeType 2 API.","title":"FT_FREETYPE_H"},{"location":"ft2-header_file_macros.html#ft_errors_h","text":"# define FT_ERRORS_H <freetype/fterrors.h> 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 .","title":"FT_ERRORS_H"},{"location":"ft2-header_file_macros.html#ft_module_errors_h","text":"# define FT_MODULE_ERRORS_H <freetype/ftmoderr.h> A macro used in #include statements to name the file containing the list of FreeType 2 module error offsets (and messages).","title":"FT_MODULE_ERRORS_H"},{"location":"ft2-header_file_macros.html#ft_system_h","text":"# define FT_SYSTEM_H <freetype/ftsystem.h> 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 .","title":"FT_SYSTEM_H"},{"location":"ft2-header_file_macros.html#ft_image_h","text":"# define FT_IMAGE_H <freetype/ftimage.h> A macro used in #include statements to name the file containing type definitions related to glyph images (i.e., bitmaps, outlines, scan-converter parameters). It is included by FT_FREETYPE_H .","title":"FT_IMAGE_H"},{"location":"ft2-header_file_macros.html#ft_types_h","text":"# define FT_TYPES_H <freetype/fttypes.h> 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 .","title":"FT_TYPES_H"},{"location":"ft2-header_file_macros.html#ft_list_h","text":"# define FT_LIST_H <freetype/ftlist.h> 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.)","title":"FT_LIST_H"},{"location":"ft2-header_file_macros.html#ft_outline_h","text":"# define FT_OUTLINE_H <freetype/ftoutln.h> A macro used in #include statements to name the file containing the scalable outline management API of FreeType 2.","title":"FT_OUTLINE_H"},{"location":"ft2-header_file_macros.html#ft_sizes_h","text":"# define FT_SIZES_H <freetype/ftsizes.h> A macro used in #include statements to name the file containing the API which manages multiple FT_Size objects per face.","title":"FT_SIZES_H"},{"location":"ft2-header_file_macros.html#ft_module_h","text":"# define FT_MODULE_H <freetype/ftmodapi.h> A macro used in #include statements to name the file containing the module management API of FreeType 2.","title":"FT_MODULE_H"},{"location":"ft2-header_file_macros.html#ft_render_h","text":"# define FT_RENDER_H <freetype/ftrender.h> A macro used in #include statements to name the file containing the renderer module management API of FreeType 2.","title":"FT_RENDER_H"},{"location":"ft2-header_file_macros.html#ft_driver_h","text":"# define FT_DRIVER_H <freetype/ftdriver.h> A macro used in #include statements to name the file containing structures and macros related to the driver modules.","title":"FT_DRIVER_H"},{"location":"ft2-header_file_macros.html#ft_autohinter_h","text":"# define FT_AUTOHINTER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the auto-hinting module. Deprecated since version 2.9; use FT_DRIVER_H instead.","title":"FT_AUTOHINTER_H"},{"location":"ft2-header_file_macros.html#ft_cff_driver_h","text":"# define FT_CFF_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the CFF driver module. Deprecated since version 2.9; use FT_DRIVER_H instead.","title":"FT_CFF_DRIVER_H"},{"location":"ft2-header_file_macros.html#ft_truetype_driver_h","text":"# define FT_TRUETYPE_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the TrueType driver module. Deprecated since version 2.9; use FT_DRIVER_H instead.","title":"FT_TRUETYPE_DRIVER_H"},{"location":"ft2-header_file_macros.html#ft_pcf_driver_h","text":"# define FT_PCF_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the PCF driver module. Deprecated since version 2.9; use FT_DRIVER_H instead.","title":"FT_PCF_DRIVER_H"},{"location":"ft2-header_file_macros.html#ft_type1_tables_h","text":"# define FT_TYPE1_TABLES_H <freetype/t1tables.h> A macro used in #include statements to name the file containing the types and API specific to the Type 1 format.","title":"FT_TYPE1_TABLES_H"},{"location":"ft2-header_file_macros.html#ft_truetype_ids_h","text":"# define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> A macro used in #include statements to name the file containing the enumeration values which identify name strings, languages, encodings, etc. This file really contains a large set of constant macro definitions, taken from the TrueType and OpenType specifications.","title":"FT_TRUETYPE_IDS_H"},{"location":"ft2-header_file_macros.html#ft_truetype_tables_h","text":"# define FT_TRUETYPE_TABLES_H <freetype/tttables.h> A macro used in #include statements to name the file containing the types and API specific to the TrueType (as well as OpenType) format.","title":"FT_TRUETYPE_TABLES_H"},{"location":"ft2-header_file_macros.html#ft_truetype_tags_h","text":"# define FT_TRUETYPE_TAGS_H <freetype/tttags.h> A macro used in #include statements to name the file containing the definitions of TrueType four-byte \u2018tags\u2019 which identify blocks in SFNT-based font formats (i.e., TrueType and OpenType).","title":"FT_TRUETYPE_TAGS_H"},{"location":"ft2-header_file_macros.html#ft_bdf_h","text":"# define FT_BDF_H <freetype/ftbdf.h> A macro used in #include statements to name the file containing the definitions of an API which accesses BDF-specific strings from a face.","title":"FT_BDF_H"},{"location":"ft2-header_file_macros.html#ft_cid_h","text":"# define FT_CID_H <freetype/ftcid.h> A macro used in #include statements to name the file containing the definitions of an API which access CID font information from a face.","title":"FT_CID_H"},{"location":"ft2-header_file_macros.html#ft_gzip_h","text":"# define FT_GZIP_H <freetype/ftgzip.h> A macro used in #include statements to name the file containing the definitions of an API which supports gzip-compressed files.","title":"FT_GZIP_H"},{"location":"ft2-header_file_macros.html#ft_lzw_h","text":"# define FT_LZW_H <freetype/ftlzw.h> A macro used in #include statements to name the file containing the definitions of an API which supports LZW-compressed files.","title":"FT_LZW_H"},{"location":"ft2-header_file_macros.html#ft_bzip2_h","text":"# define FT_BZIP2_H <freetype/ftbzip2.h> A macro used in #include statements to name the file containing the definitions of an API which supports bzip2-compressed files.","title":"FT_BZIP2_H"},{"location":"ft2-header_file_macros.html#ft_winfonts_h","text":"# define FT_WINFONTS_H <freetype/ftwinfnt.h> A macro used in #include statements to name the file containing the definitions of an API which supports Windows FNT files.","title":"FT_WINFONTS_H"},{"location":"ft2-header_file_macros.html#ft_glyph_h","text":"# define FT_GLYPH_H <freetype/ftglyph.h> A macro used in #include statements to name the file containing the API of the optional glyph management component.","title":"FT_GLYPH_H"},{"location":"ft2-header_file_macros.html#ft_bitmap_h","text":"# define FT_BITMAP_H <freetype/ftbitmap.h> A macro used in #include statements to name the file containing the API of the optional bitmap conversion component.","title":"FT_BITMAP_H"},{"location":"ft2-header_file_macros.html#ft_bbox_h","text":"# define FT_BBOX_H <freetype/ftbbox.h> A macro used in #include statements to name the file containing the API of the optional exact bounding box computation routines.","title":"FT_BBOX_H"},{"location":"ft2-header_file_macros.html#ft_cache_h","text":"# define FT_CACHE_H <freetype/ftcache.h> A macro used in #include statements to name the file containing the API of the optional FreeType 2 cache sub-system.","title":"FT_CACHE_H"},{"location":"ft2-header_file_macros.html#ft_mac_h","text":"# define FT_MAC_H <freetype/ftmac.h> 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).","title":"FT_MAC_H"},{"location":"ft2-header_file_macros.html#ft_multiple_masters_h","text":"# define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> A macro used in #include statements to name the file containing the optional multiple-masters management API of FreeType 2.","title":"FT_MULTIPLE_MASTERS_H"},{"location":"ft2-header_file_macros.html#ft_sfnt_names_h","text":"# define FT_SFNT_NAMES_H <freetype/ftsnames.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which accesses embedded \u2018name\u2019 strings in SFNT-based font formats (i.e., TrueType and OpenType).","title":"FT_SFNT_NAMES_H"},{"location":"ft2-header_file_macros.html#ft_opentype_validate_h","text":"# define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which validates OpenType tables (\u2018BASE\u2019, \u2018GDEF\u2019, \u2018GPOS\u2019, \u2018GSUB\u2019, \u2018JSTF\u2019).","title":"FT_OPENTYPE_VALIDATE_H"},{"location":"ft2-header_file_macros.html#ft_gx_validate_h","text":"# define FT_GX_VALIDATE_H <freetype/ftgxval.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which validates TrueTypeGX/AAT tables (\u2018feat\u2019, \u2018mort\u2019, \u2018morx\u2019, \u2018bsln\u2019, \u2018just\u2019, \u2018kern\u2019, \u2018opbd\u2019, \u2018trak\u2019, \u2018prop\u2019).","title":"FT_GX_VALIDATE_H"},{"location":"ft2-header_file_macros.html#ft_pfr_h","text":"# define FT_PFR_H <freetype/ftpfr.h> A macro used in #include statements to name the file containing the FreeType 2 API which accesses PFR-specific data.","title":"FT_PFR_H"},{"location":"ft2-header_file_macros.html#ft_stroker_h","text":"# define FT_STROKER_H <freetype/ftstroke.h> A macro used in #include statements to name the file containing the FreeType 2 API which provides functions to stroke outline paths.","title":"FT_STROKER_H"},{"location":"ft2-header_file_macros.html#ft_synthesis_h","text":"# define FT_SYNTHESIS_H <freetype/ftsynth.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs artificial obliquing and emboldening.","title":"FT_SYNTHESIS_H"},{"location":"ft2-header_file_macros.html#ft_font_formats_h","text":"# define FT_FONT_FORMATS_H <freetype/ftfntfmt.h> /* deprecated */ # define FT_XFREE86_H FT_FONT_FORMATS_H A macro used in #include statements to name the file containing the FreeType 2 API which provides functions specific to font formats.","title":"FT_FONT_FORMATS_H"},{"location":"ft2-header_file_macros.html#ft_trigonometry_h","text":"# define FT_TRIGONOMETRY_H <freetype/fttrigon.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs trigonometric computations (e.g., cosines and arc tangents).","title":"FT_TRIGONOMETRY_H"},{"location":"ft2-header_file_macros.html#ft_lcd_filter_h","text":"# define FT_LCD_FILTER_H <freetype/ftlcdfil.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering.","title":"FT_LCD_FILTER_H"},{"location":"ft2-header_file_macros.html#ft_incremental_h","text":"# define FT_INCREMENTAL_H <freetype/ftincrem.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs incremental glyph loading.","title":"FT_INCREMENTAL_H"},{"location":"ft2-header_file_macros.html#ft_gasp_h","text":"# define FT_GASP_H <freetype/ftgasp.h> A macro used in #include statements to name the file containing the FreeType 2 API which returns entries from the TrueType GASP table.","title":"FT_GASP_H"},{"location":"ft2-header_file_macros.html#ft_advances_h","text":"# define FT_ADVANCES_H <freetype/ftadvanc.h> A macro used in #include statements to name the file containing the FreeType 2 API which returns individual and ranged glyph advances.","title":"FT_ADVANCES_H"},{"location":"ft2-header_file_macros.html#ft_color_h","text":"# define FT_COLOR_H <freetype/ftcolor.h> A macro used in #include statements to name the file containing the FreeType 2 API which handles the OpenType \u2018CPAL\u2019 table.","title":"FT_COLOR_H"},{"location":"ft2-header_inclusion.html","text":"FreeType \u00bb Docs \u00bb General Remarks \u00bb FreeType's header inclusion scheme FreeType's header inclusion scheme \u00b6 Synopsis \u00b6 To be as flexible as possible (and for historical reasons), you must load file ft2build.h first before other header files, for example #include <ft2build.h> #include <freetype/freetype.h> #include <freetype/ftoutln.h>","title":"FreeType's header inclusion scheme"},{"location":"ft2-header_inclusion.html#freetypes-header-inclusion-scheme","text":"","title":"FreeType's header inclusion scheme"},{"location":"ft2-header_inclusion.html#synopsis","text":"To be as flexible as possible (and for historical reasons), you must load file ft2build.h first before other header files, for example #include <ft2build.h> #include <freetype/freetype.h> #include <freetype/ftoutln.h>","title":"Synopsis"},{"location":"ft2-incremental.html","text":"FreeType \u00bb Docs \u00bb Miscellaneous \u00bb Incremental Loading Incremental Loading \u00b6 Synopsis \u00b6 This section contains various functions used to perform so-called \u2018incremental\u2019 glyph loading. This is a mode where all glyphs loaded from a given FT_Face are provided by the client application. Apart from that, all other tables are loaded normally from the font file. This mode is useful when FreeType is used within another engine, e.g., a PostScript Imaging Processor. To enable this mode, you must use FT_Open_Face , passing an FT_Parameter with the FT_PARAM_TAG_INCREMENTAL tag and an FT_Incremental_Interface value. See the comments for FT_Incremental_InterfaceRec for an example. FT_Incremental \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_IncrementalRec_* FT_Incremental ; An opaque type describing a user-provided object used to implement \u2018incremental\u2019 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. FT_Incremental_MetricsRec \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_MetricsRec_ { FT_Long bearing_x; FT_Long bearing_y; FT_Long advance; FT_Long advance_v; /* since 2.3.12 */ } FT_Incremental_MetricsRec ; 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 Horizontal component of glyph advance, in font units. advance_v Vertical component of 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 . FT_Incremental_Metrics \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics ; A handle to an FT_Incremental_MetricsRec structure. FT_Incremental_GetGlyphDataFunc \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Error (* FT_Incremental_GetGlyphDataFunc )( FT_Incremental incremental, FT_UInt glyph_index, FT_Data * adata ); 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 \u2018glyf\u2019 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 successfully 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. FT_Incremental_FreeGlyphDataFunc \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef void (* FT_Incremental_FreeGlyphDataFunc )( FT_Incremental incremental, FT_Data * data ); 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). FT_Incremental_GetGlyphMetricsFunc \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Error (* FT_Incremental_GetGlyphMetricsFunc ) ( FT_Incremental incremental, FT_UInt glyph_index, FT_Bool vertical, FT_Incremental_MetricsRec *ametrics ); A function used to retrieve the basic metrics of a given glyph index before accessing its data. This allows for handling font types such as PCL XL Format 1, Class 2 downloaded TrueType fonts, where the glyph metrics ( hmtx and vmtx tables) are permitted to be omitted from the font, and the relevant metrics included in the header of the glyph outline data. Importantly, this is not intended to allow custom glyph metrics (for example, Postscript Metrics dictionaries), because that conflicts with the requirements of outline hinting. Such custom metrics must be handled separately, by the calling application. 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. ametrics This parameter is used for both input and output. The original glyph metrics, if any, in font units. If metrics are not available all the values must be set to zero. output ametrics The glyph metrics in font units. FT_Incremental_FuncsRec \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). 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 ; A table of functions for accessing fonts that load data incrementally. Used in FT_Incremental_InterfaceRec . 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 require it. FT_Incremental_InterfaceRec \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_InterfaceRec_ { const FT_Incremental_FuncsRec * funcs; FT_Incremental object; } FT_Incremental_InterfaceRec ; 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_PATHNAME | FT_OPEN_PARAMS; open_args.pathname = my_font_pathname; open_args.num_params = 1; open_args.params = &parameter; // we use one optional argument // open the font error = FT_Open_Face( library, &open_args, index, &face ); ... FT_Incremental_Interface \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Incremental_InterfaceRec * FT_Incremental_Interface ; A pointer to an FT_Incremental_InterfaceRec structure.","title":"Incremental Loading"},{"location":"ft2-incremental.html#incremental-loading","text":"","title":"Incremental Loading"},{"location":"ft2-incremental.html#synopsis","text":"This section contains various functions used to perform so-called \u2018incremental\u2019 glyph loading. This is a mode where all glyphs loaded from a given FT_Face are provided by the client application. Apart from that, all other tables are loaded normally from the font file. This mode is useful when FreeType is used within another engine, e.g., a PostScript Imaging Processor. To enable this mode, you must use FT_Open_Face , passing an FT_Parameter with the FT_PARAM_TAG_INCREMENTAL tag and an FT_Incremental_Interface value. See the comments for FT_Incremental_InterfaceRec for an example.","title":"Synopsis"},{"location":"ft2-incremental.html#ft_incremental","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_IncrementalRec_* FT_Incremental ; An opaque type describing a user-provided object used to implement \u2018incremental\u2019 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.","title":"FT_Incremental"},{"location":"ft2-incremental.html#ft_incremental_metricsrec","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_MetricsRec_ { FT_Long bearing_x; FT_Long bearing_y; FT_Long advance; FT_Long advance_v; /* since 2.3.12 */ } FT_Incremental_MetricsRec ; A small structure used to contain the basic glyph metrics returned by the FT_Incremental_GetGlyphMetricsFunc method.","title":"FT_Incremental_MetricsRec"},{"location":"ft2-incremental.html#ft_incremental_metrics","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics ; A handle to an FT_Incremental_MetricsRec structure.","title":"FT_Incremental_Metrics"},{"location":"ft2-incremental.html#ft_incremental_getglyphdatafunc","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Error (* FT_Incremental_GetGlyphDataFunc )( FT_Incremental incremental, FT_UInt glyph_index, FT_Data * adata ); 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 \u2018glyf\u2019 table. For PostScript formats, it must correspond to the unencrypted charstring bytes, without any lenIV header. It is undefined for any other format.","title":"FT_Incremental_GetGlyphDataFunc"},{"location":"ft2-incremental.html#ft_incremental_freeglyphdatafunc","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef void (* FT_Incremental_FreeGlyphDataFunc )( FT_Incremental incremental, FT_Data * data ); A function used to release the glyph data bytes returned by a successful call to FT_Incremental_GetGlyphDataFunc .","title":"FT_Incremental_FreeGlyphDataFunc"},{"location":"ft2-incremental.html#ft_incremental_getglyphmetricsfunc","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Error (* FT_Incremental_GetGlyphMetricsFunc ) ( FT_Incremental incremental, FT_UInt glyph_index, FT_Bool vertical, FT_Incremental_MetricsRec *ametrics ); A function used to retrieve the basic metrics of a given glyph index before accessing its data. This allows for handling font types such as PCL XL Format 1, Class 2 downloaded TrueType fonts, where the glyph metrics ( hmtx and vmtx tables) are permitted to be omitted from the font, and the relevant metrics included in the header of the glyph outline data. Importantly, this is not intended to allow custom glyph metrics (for example, Postscript Metrics dictionaries), because that conflicts with the requirements of outline hinting. Such custom metrics must be handled separately, by the calling application.","title":"FT_Incremental_GetGlyphMetricsFunc"},{"location":"ft2-incremental.html#ft_incremental_funcsrec","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). 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 ; A table of functions for accessing fonts that load data incrementally. Used in FT_Incremental_InterfaceRec .","title":"FT_Incremental_FuncsRec"},{"location":"ft2-incremental.html#ft_incremental_interfacerec","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_InterfaceRec_ { const FT_Incremental_FuncsRec * funcs; FT_Incremental object; } FT_Incremental_InterfaceRec ; 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_PATHNAME | FT_OPEN_PARAMS; open_args.pathname = my_font_pathname; open_args.num_params = 1; open_args.params = &parameter; // we use one optional argument // open the font error = FT_Open_Face( library, &open_args, index, &face ); ...","title":"FT_Incremental_InterfaceRec"},{"location":"ft2-incremental.html#ft_incremental_interface","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Incremental_InterfaceRec * FT_Incremental_Interface ; A pointer to an FT_Incremental_InterfaceRec structure.","title":"FT_Incremental_Interface"},{"location":"ft2-index.html","text":"FreeType \u00bb Docs \u00bb Global Index FreeType-2.11.1 API Reference \u00b6 B \u00b6 BDF_Property BDF_PROPERTY_TYPE_ATOM BDF_PROPERTY_TYPE_CARDINAL BDF_PROPERTY_TYPE_INTEGER BDF_PROPERTY_TYPE_NONE BDF_PropertyRec BDF_PropertyType C \u00b6 CID_FaceDict CID_FaceDictRec CID_FaceInfo CID_FaceInfoRec CID_FontDict CID_Info D \u00b6 darkening-parameters default-script F \u00b6 fallback-script FREETYPE_MAJOR FREETYPE_MINOR FREETYPE_PATCH FREETYPE_XXX FT_Activate_Size FT_Add_Default_Modules FT_Add_Module FT_ADVANCE_FLAG_FAST_ONLY FT_ADVANCES_H FT_Affine23 FT_Alloc_Func FT_Angle FT_ANGLE_2PI FT_Angle_Diff FT_ANGLE_PI FT_ANGLE_PI2 FT_ANGLE_PI4 FT_Atan2 FT_Attach_File FT_Attach_Stream FT_AUTOHINTER_H FT_AUTOHINTER_SCRIPT_CJK FT_AUTOHINTER_SCRIPT_INDIC FT_AUTOHINTER_SCRIPT_LATIN FT_AUTOHINTER_SCRIPT_NONE FT_AUTOHINTER_SCRIPT_XXX FT_BBox FT_BBOX_H FT_BDF_H FT_Bitmap FT_Bitmap_Blend FT_Bitmap_Convert FT_Bitmap_Copy FT_Bitmap_Done FT_Bitmap_Embolden FT_BITMAP_H FT_Bitmap_Init FT_Bitmap_Size FT_BitmapGlyph FT_BitmapGlyphRec FT_Bool FT_Byte FT_Bytes FT_BZIP2_H FT_CACHE_H FT_CeilFix FT_CFF_DRIVER_H FT_Char FT_CharMap FT_CharMapRec FT_CID_H FT_ClassicKern_Free FT_ClassicKern_Validate FT_ClipBox FT_Color FT_COLOR_H FT_COLOR_INCLUDE_ROOT_TRANSFORM FT_COLOR_NO_ROOT_TRANSFORM FT_Color_Root_Transform FT_ColorIndex FT_ColorLine FT_ColorStop FT_ColorStopIterator FT_COLR_Paint FT_Composite_Mode FT_CONFIG_CONFIG_H FT_CONFIG_MODULES_H FT_CONFIG_OPTIONS_H FT_CONFIG_STANDARD_LIBRARY_H FT_Cos FT_Custom_Log_Handler FT_Data FT_DEBUG_HOOK_TRUETYPE FT_DEBUG_HOOK_XXX FT_DebugHook_Func FT_DivFix FT_Done_Face FT_Done_FreeType FT_Done_Glyph FT_Done_Library FT_Done_MM_Var FT_Done_Size FT_Driver FT_DRIVER_H FT_ENC_TAG FT_Encoding FT_ENCODING_ADOBE_CUSTOM FT_ENCODING_ADOBE_EXPERT FT_ENCODING_ADOBE_LATIN_1 FT_ENCODING_ADOBE_STANDARD FT_ENCODING_APPLE_ROMAN FT_ENCODING_BIG5 FT_ENCODING_JOHAB FT_ENCODING_MS_BIG5 FT_ENCODING_MS_GB2312 FT_ENCODING_MS_JOHAB FT_ENCODING_MS_SJIS FT_ENCODING_MS_SYMBOL FT_ENCODING_MS_WANSUNG FT_ENCODING_NONE FT_ENCODING_OLD_LATIN_2 FT_ENCODING_PRC FT_ENCODING_SJIS FT_ENCODING_UNICODE FT_ENCODING_WANSUNG FT_Err_XXX FT_Error FT_Error_String FT_ERRORS_H FT_F26Dot6 FT_F2Dot14 FT_Face FT_Face_CheckTrueTypePatents FT_FACE_DRIVER_NAME FT_FACE_FLAG_CID_KEYED FT_FACE_FLAG_COLOR FT_FACE_FLAG_EXTERNAL_STREAM FT_FACE_FLAG_FAST_GLYPHS FT_FACE_FLAG_FIXED_SIZES FT_FACE_FLAG_FIXED_WIDTH FT_FACE_FLAG_GLYPH_NAMES FT_FACE_FLAG_HINTER FT_FACE_FLAG_HORIZONTAL FT_FACE_FLAG_KERNING FT_FACE_FLAG_MULTIPLE_MASTERS FT_FACE_FLAG_SCALABLE FT_FACE_FLAG_SFNT FT_FACE_FLAG_TRICKY FT_FACE_FLAG_VARIATION FT_FACE_FLAG_VERTICAL FT_FACE_FLAG_XXX FT_Face_GetCharsOfVariant FT_Face_GetCharVariantIndex FT_Face_GetCharVariantIsDefault FT_Face_GetVariantSelectors FT_Face_GetVariantsOfChar FT_Face_Internal FT_Face_Properties FT_Face_SetUnpatentedHinting FT_FaceRec FT_Fixed FT_FloorFix FT_FONT_FORMATS_H FT_Free_Func FT_FREETYPE_H FT_FSTYPE_BITMAP_EMBEDDING_ONLY FT_FSTYPE_EDITABLE_EMBEDDING FT_FSTYPE_INSTALLABLE_EMBEDDING FT_FSTYPE_NO_SUBSETTING FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING FT_FSTYPE_XXX FT_FWord FT_GASP_DO_GRAY FT_GASP_DO_GRIDFIT FT_GASP_H FT_GASP_NO_TABLE FT_GASP_SYMMETRIC_GRIDFIT FT_GASP_SYMMETRIC_SMOOTHING FT_GASP_XXX FT_Generic FT_Generic_Finalizer FT_Get_Advance FT_Get_Advances FT_Get_BDF_Charset_ID FT_Get_BDF_Property FT_Get_Char_Index FT_Get_Charmap_Index FT_Get_CID_From_Glyph_Index FT_Get_CID_Is_Internally_CID_Keyed FT_Get_CID_Registry_Ordering_Supplement FT_Get_CMap_Format FT_Get_CMap_Language_ID FT_Get_Color_Glyph_ClipBox FT_Get_Color_Glyph_Layer FT_Get_Color_Glyph_Paint FT_Get_Colorline_Stops FT_Get_First_Char FT_Get_Font_Format FT_Get_FSType_Flags FT_Get_Gasp FT_Get_Glyph FT_Get_Glyph_Name FT_Get_Kerning FT_Get_MM_Blend_Coordinates FT_Get_MM_Var FT_Get_MM_WeightVector FT_Get_Module FT_Get_Multi_Master FT_Get_Name_Index FT_Get_Next_Char FT_Get_Paint FT_Get_Paint_Layers FT_Get_PFR_Advance FT_Get_PFR_Kerning FT_Get_PFR_Metrics FT_Get_Postscript_Name FT_Get_PS_Font_Info FT_Get_PS_Font_Private FT_Get_PS_Font_Value FT_Get_Renderer FT_Get_Sfnt_LangTag FT_Get_Sfnt_Name FT_Get_Sfnt_Name_Count FT_Get_Sfnt_Table FT_Get_SubGlyph_Info FT_Get_Track_Kerning FT_Get_Transform FT_Get_TrueType_Engine_Type FT_Get_Var_Axis_Flags FT_Get_Var_Blend_Coordinates FT_Get_Var_Design_Coordinates FT_Get_WinFNT_Header FT_GetFile_From_Mac_ATS_Name FT_GetFile_From_Mac_Name FT_GetFilePath_From_Mac_ATS_Name FT_Glyph FT_GLYPH_BBOX_GRIDFIT FT_Glyph_BBox_Mode FT_GLYPH_BBOX_PIXELS FT_GLYPH_BBOX_SUBPIXELS FT_GLYPH_BBOX_TRUNCATE FT_GLYPH_BBOX_UNSCALED FT_Glyph_Copy FT_Glyph_Format FT_GLYPH_FORMAT_BITMAP FT_GLYPH_FORMAT_COMPOSITE FT_GLYPH_FORMAT_NONE FT_GLYPH_FORMAT_OUTLINE FT_GLYPH_FORMAT_PLOTTER FT_Glyph_Get_CBox FT_GLYPH_H FT_Glyph_Metrics FT_Glyph_Stroke FT_Glyph_StrokeBorder FT_Glyph_To_Bitmap FT_Glyph_Transform FT_GlyphRec FT_GlyphSlot FT_GlyphSlot_Own_Bitmap FT_GlyphSlotRec FT_GX_VALIDATE_H FT_GZIP_H FT_Gzip_Uncompress FT_HAS_COLOR FT_HAS_FAST_GLYPHS FT_HAS_FIXED_SIZES FT_HAS_GLYPH_NAMES FT_HAS_HORIZONTAL FT_HAS_KERNING FT_HAS_MULTIPLE_MASTERS FT_Has_PS_Glyph_Names FT_HAS_VERTICAL FT_HINTING_ADOBE FT_HINTING_FREETYPE FT_HINTING_XXX FT_IMAGE_H FT_IMAGE_TAG FT_Incremental FT_Incremental_FreeGlyphDataFunc FT_Incremental_FuncsRec FT_Incremental_GetGlyphDataFunc FT_Incremental_GetGlyphMetricsFunc FT_INCREMENTAL_H FT_Incremental_Interface FT_Incremental_InterfaceRec FT_Incremental_Metrics FT_Incremental_MetricsRec FT_Init_FreeType FT_Int FT_Int16 FT_Int32 FT_Int64 FT_IS_CID_KEYED FT_IS_FIXED_WIDTH FT_IS_NAMED_INSTANCE FT_IS_SCALABLE FT_IS_SFNT FT_IS_TRICKY FT_IS_VARIATION FT_KERNING_DEFAULT FT_Kerning_Mode FT_KERNING_UNFITTED FT_KERNING_UNSCALED FT_LayerIterator FT_LCD_FILTER_DEFAULT FT_LCD_FILTER_H FT_LCD_FILTER_LEGACY FT_LCD_FILTER_LEGACY1 FT_LCD_FILTER_LIGHT FT_LCD_FILTER_NONE FT_LcdFilter FT_LcdFiveTapFilter FT_Library FT_Library_SetLcdFilter FT_Library_SetLcdFilterWeights FT_Library_SetLcdGeometry FT_Library_Version FT_List FT_List_Add FT_List_Destructor FT_List_Finalize FT_List_Find FT_LIST_H FT_List_Insert FT_List_Iterate FT_List_Iterator FT_List_Remove FT_List_Up FT_ListNode FT_ListNodeRec FT_ListRec FT_LOAD_BITMAP_METRICS_ONLY FT_Load_Char FT_LOAD_COLOR FT_LOAD_COMPUTE_METRICS FT_LOAD_CROP_BITMAP FT_LOAD_DEFAULT FT_LOAD_FORCE_AUTOHINT FT_Load_Glyph FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH FT_LOAD_IGNORE_TRANSFORM FT_LOAD_LINEAR_DESIGN FT_LOAD_MONOCHROME FT_LOAD_NO_AUTOHINT FT_LOAD_NO_BITMAP FT_LOAD_NO_HINTING FT_LOAD_NO_RECURSE FT_LOAD_NO_SCALE FT_LOAD_PEDANTIC FT_LOAD_RENDER FT_Load_Sfnt_Table FT_LOAD_TARGET_LCD FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_MODE FT_LOAD_TARGET_MONO FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_XXX FT_LOAD_VERTICAL_LAYOUT FT_LOAD_XXX FT_Long FT_LZW_H FT_MAC_H FT_MAKE_TAG FT_Matrix FT_Matrix_Invert FT_Matrix_Multiply FT_Memory FT_MemoryRec FT_MM_Axis FT_MM_Var FT_Module FT_Module_Class FT_Module_Constructor FT_Module_Destructor FT_MODULE_ERRORS_H FT_MODULE_H FT_Module_Requester FT_MulDiv FT_MulFix FT_Multi_Master FT_MULTIPLE_MASTERS_H FT_New_Face FT_New_Face_From_FOND FT_New_Face_From_FSRef FT_New_Face_From_FSSpec FT_New_Glyph FT_New_Library FT_New_Memory_Face FT_New_Size FT_Offset FT_OpaquePaint FT_Open_Args FT_OPEN_DRIVER FT_Open_Face FT_OPEN_MEMORY FT_OPEN_PARAMS FT_OPEN_PATHNAME FT_OPEN_STREAM FT_OPEN_XXX FT_OpenType_Free FT_OpenType_Validate FT_OPENTYPE_VALIDATE_H FT_Orientation FT_ORIENTATION_FILL_LEFT FT_ORIENTATION_FILL_RIGHT FT_ORIENTATION_NONE FT_ORIENTATION_POSTSCRIPT FT_ORIENTATION_TRUETYPE FT_Outline FT_Outline_Check FT_Outline_ConicToFunc FT_Outline_Copy FT_Outline_CubicToFunc FT_Outline_Decompose FT_Outline_Done FT_Outline_Embolden FT_Outline_EmboldenXY FT_OUTLINE_EVEN_ODD_FILL FT_Outline_Funcs FT_Outline_Get_BBox FT_Outline_Get_Bitmap FT_Outline_Get_CBox FT_Outline_Get_Orientation FT_Outline_GetInsideBorder FT_Outline_GetOutsideBorder FT_OUTLINE_H FT_OUTLINE_HIGH_PRECISION FT_OUTLINE_IGNORE_DROPOUTS FT_OUTLINE_INCLUDE_STUBS FT_Outline_LineToFunc FT_Outline_MoveToFunc FT_Outline_New FT_OUTLINE_NONE FT_OUTLINE_OVERLAP FT_OUTLINE_OWNER FT_Outline_Render FT_Outline_Reverse FT_OUTLINE_REVERSE_FILL FT_OUTLINE_SINGLE_PASS FT_OUTLINE_SMART_DROPOUTS FT_Outline_Transform FT_Outline_Translate FT_OUTLINE_XXX FT_OutlineGlyph FT_OutlineGlyphRec FT_PaintColrGlyph FT_PaintColrLayers FT_PaintComposite FT_PaintExtend FT_PaintFormat FT_PaintGlyph FT_PaintLinearGradient FT_PaintRadialGradient FT_PaintRotate FT_PaintScale FT_PaintSkew FT_PaintSolid FT_PaintSweepGradient FT_PaintTransform FT_PaintTranslate FT_Palette_Data FT_Palette_Data_Get FT_PALETTE_FOR_DARK_BACKGROUND FT_PALETTE_FOR_LIGHT_BACKGROUND FT_Palette_Select FT_Palette_Set_Foreground_Color FT_PALETTE_XXX FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY FT_PARAM_TAG_INCREMENTAL FT_PARAM_TAG_LCD_FILTER_WEIGHTS FT_PARAM_TAG_RANDOM_SEED FT_PARAM_TAG_STEM_DARKENING FT_PARAM_TAG_UNPATENTED_HINTING FT_Parameter FT_PCF_DRIVER_H FT_PFR_H FT_Pixel_Mode FT_PIXEL_MODE_BGRA FT_PIXEL_MODE_GRAY FT_PIXEL_MODE_GRAY2 FT_PIXEL_MODE_GRAY4 FT_PIXEL_MODE_LCD FT_PIXEL_MODE_LCD_V FT_PIXEL_MODE_MONO FT_PIXEL_MODE_NONE FT_Pointer FT_Pos FT_Prop_GlyphToScriptMap FT_Prop_IncreaseXHeight FT_Property_Get FT_Property_Set FT_PtrDist FT_Raster FT_Raster_BitSet_Func FT_Raster_BitTest_Func FT_Raster_DoneFunc FT_RASTER_FLAG_AA FT_RASTER_FLAG_CLIP FT_RASTER_FLAG_DEFAULT FT_RASTER_FLAG_DIRECT FT_RASTER_FLAG_SDF FT_RASTER_FLAG_XXX FT_Raster_Funcs FT_Raster_NewFunc FT_Raster_Params FT_Raster_RenderFunc FT_Raster_ResetFunc FT_Raster_SetModeFunc FT_Realloc_Func FT_Reference_Face FT_Reference_Library FT_Remove_Module FT_Render_Glyph FT_RENDER_H FT_Render_Mode FT_RENDER_MODE_LCD FT_RENDER_MODE_LCD_V FT_RENDER_MODE_LIGHT FT_RENDER_MODE_MONO FT_RENDER_MODE_NORMAL FT_RENDER_MODE_SDF FT_Renderer FT_Renderer_Class FT_Request_Size FT_RoundFix FT_Select_Charmap FT_Select_Size FT_Set_Char_Size FT_Set_Charmap FT_Set_Debug_Hook FT_Set_Default_Log_Handler FT_Set_Default_Properties FT_Set_Log_Handler FT_Set_MM_Blend_Coordinates FT_Set_MM_Design_Coordinates FT_Set_MM_WeightVector FT_Set_Named_Instance FT_Set_Pixel_Sizes FT_Set_Renderer FT_Set_Transform FT_Set_Var_Blend_Coordinates FT_Set_Var_Design_Coordinates FT_SFNT_HEAD FT_SFNT_HHEA FT_SFNT_MAXP FT_SFNT_NAMES_H FT_SFNT_OS2 FT_SFNT_PCLT FT_SFNT_POST FT_Sfnt_Table_Info FT_Sfnt_Tag FT_SFNT_VHEA FT_SfntLangTag FT_SfntName FT_Short FT_Sin FT_Size FT_Size_Internal FT_Size_Metrics FT_Size_Request FT_Size_Request_Type FT_SIZE_REQUEST_TYPE_BBOX FT_SIZE_REQUEST_TYPE_CELL FT_SIZE_REQUEST_TYPE_NOMINAL FT_SIZE_REQUEST_TYPE_REAL_DIM FT_SIZE_REQUEST_TYPE_SCALES FT_Size_RequestRec FT_SizeRec FT_SIZES_H FT_Slot_Internal FT_Span FT_SpanFunc FT_Stream FT_Stream_CloseFunc FT_Stream_IoFunc FT_Stream_OpenBzip2 FT_Stream_OpenGzip FT_Stream_OpenLZW FT_StreamDesc FT_StreamRec FT_String FT_Stroker FT_Stroker_BeginSubPath FT_STROKER_BORDER_LEFT FT_STROKER_BORDER_RIGHT FT_Stroker_ConicTo FT_Stroker_CubicTo FT_Stroker_Done FT_Stroker_EndSubPath FT_Stroker_Export FT_Stroker_ExportBorder FT_Stroker_GetBorderCounts FT_Stroker_GetCounts FT_STROKER_H FT_Stroker_LineCap FT_STROKER_LINECAP_BUTT FT_STROKER_LINECAP_ROUND FT_STROKER_LINECAP_SQUARE FT_Stroker_LineJoin FT_STROKER_LINEJOIN_BEVEL FT_STROKER_LINEJOIN_MITER FT_STROKER_LINEJOIN_MITER_FIXED FT_STROKER_LINEJOIN_MITER_VARIABLE FT_STROKER_LINEJOIN_ROUND FT_Stroker_LineTo FT_Stroker_New FT_Stroker_ParseOutline FT_Stroker_Rewind FT_Stroker_Set FT_StrokerBorder FT_STYLE_FLAG_BOLD FT_STYLE_FLAG_ITALIC FT_STYLE_FLAG_XXX FT_SubGlyph FT_SUBGLYPH_FLAG_2X2 FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID FT_SUBGLYPH_FLAG_SCALE FT_SUBGLYPH_FLAG_USE_MY_METRICS FT_SUBGLYPH_FLAG_XXX FT_SUBGLYPH_FLAG_XY_SCALE FT_SYNTHESIS_H FT_SYSTEM_H FT_Tag FT_Tan FT_Trace_Set_Default_Level FT_Trace_Set_Level FT_TRIGONOMETRY_H FT_TRUETYPE_DRIVER_H FT_TRUETYPE_ENGINE_TYPE_NONE FT_TRUETYPE_ENGINE_TYPE_PATENTED FT_TRUETYPE_ENGINE_TYPE_UNPATENTED FT_TRUETYPE_IDS_H FT_TRUETYPE_TABLES_H FT_TRUETYPE_TAGS_H FT_TrueTypeEngineType FT_TrueTypeGX_Free FT_TrueTypeGX_Validate FT_TYPE1_TABLES_H FT_TYPES_H FT_UFWord FT_UInt FT_UInt16 FT_UInt32 FT_UInt64 FT_ULong FT_UnitVector FT_UShort FT_VALIDATE_APPLE FT_VALIDATE_BASE FT_VALIDATE_bsln FT_VALIDATE_CKERN FT_VALIDATE_CKERNXXX FT_VALIDATE_feat FT_VALIDATE_GDEF FT_VALIDATE_GPOS FT_VALIDATE_GSUB FT_VALIDATE_GX FT_VALIDATE_GX_LENGTH FT_VALIDATE_GXXXX FT_VALIDATE_JSTF FT_VALIDATE_just FT_VALIDATE_kern FT_VALIDATE_lcar FT_VALIDATE_MATH FT_VALIDATE_mort FT_VALIDATE_morx FT_VALIDATE_MS FT_VALIDATE_opbd FT_VALIDATE_OT FT_VALIDATE_OTXXX FT_VALIDATE_prop FT_VALIDATE_trak FT_Var_Axis FT_VAR_AXIS_FLAG_HIDDEN FT_VAR_AXIS_FLAG_XXX FT_Var_Named_Style FT_Vector FT_Vector_From_Polar FT_Vector_Length FT_Vector_Polarize FT_Vector_Rotate FT_Vector_Transform FT_Vector_Unit FT_WinFNT_Header FT_WinFNT_HeaderRec FT_WinFNT_ID_CP1250 FT_WinFNT_ID_CP1251 FT_WinFNT_ID_CP1252 FT_WinFNT_ID_CP1253 FT_WinFNT_ID_CP1254 FT_WinFNT_ID_CP1255 FT_WinFNT_ID_CP1256 FT_WinFNT_ID_CP1257 FT_WinFNT_ID_CP1258 FT_WinFNT_ID_CP1361 FT_WinFNT_ID_CP874 FT_WinFNT_ID_CP932 FT_WinFNT_ID_CP936 FT_WinFNT_ID_CP949 FT_WinFNT_ID_CP950 FT_WinFNT_ID_DEFAULT FT_WinFNT_ID_MAC FT_WinFNT_ID_OEM FT_WinFNT_ID_SYMBOL FT_WinFNT_ID_XXX FT_WINFONTS_H FTC_CMapCache FTC_CMapCache_Lookup FTC_CMapCache_New FTC_Face_Requester FTC_FaceID FTC_ImageCache FTC_ImageCache_Lookup FTC_ImageCache_LookupScaler FTC_ImageCache_New FTC_ImageType FTC_ImageTypeRec FTC_Manager FTC_Manager_Done FTC_Manager_LookupFace FTC_Manager_LookupSize FTC_Manager_New FTC_Manager_RemoveFaceID FTC_Manager_Reset FTC_Node FTC_Node_Unref FTC_SBit FTC_SBitCache FTC_SBitCache_Lookup FTC_SBitCache_LookupScaler FTC_SBitCache_New FTC_SBitRec FTC_Scaler FTC_ScalerRec G \u00b6 glyph-to-script-map H \u00b6 hinting-engine I \u00b6 increase-x-height interpreter-version N \u00b6 no-long-family-names no-stem-darkening P \u00b6 PS_DICT_BLUE_FUZZ PS_DICT_BLUE_SCALE PS_DICT_BLUE_SHIFT PS_DICT_BLUE_VALUE PS_DICT_CHAR_STRING PS_DICT_CHAR_STRING_KEY PS_DICT_ENCODING_ENTRY PS_DICT_ENCODING_TYPE PS_DICT_FAMILY_BLUE PS_DICT_FAMILY_NAME PS_DICT_FAMILY_OTHER_BLUE PS_DICT_FONT_BBOX PS_DICT_FONT_MATRIX PS_DICT_FONT_NAME PS_DICT_FONT_TYPE PS_DICT_FORCE_BOLD PS_DICT_FS_TYPE PS_DICT_FULL_NAME PS_DICT_IS_FIXED_PITCH PS_DICT_ITALIC_ANGLE PS_Dict_Keys PS_DICT_LANGUAGE_GROUP PS_DICT_LEN_IV PS_DICT_MIN_FEATURE PS_DICT_NOTICE PS_DICT_NUM_BLUE_VALUES PS_DICT_NUM_CHAR_STRINGS PS_DICT_NUM_FAMILY_BLUES PS_DICT_NUM_FAMILY_OTHER_BLUES PS_DICT_NUM_OTHER_BLUES PS_DICT_NUM_STEM_SNAP_H PS_DICT_NUM_STEM_SNAP_V PS_DICT_NUM_SUBRS PS_DICT_OTHER_BLUE PS_DICT_PAINT_TYPE PS_DICT_PASSWORD PS_DICT_RND_STEM_UP PS_DICT_STD_HW PS_DICT_STD_VW PS_DICT_STEM_SNAP_H PS_DICT_STEM_SNAP_V PS_DICT_SUBR PS_DICT_UNDERLINE_POSITION PS_DICT_UNDERLINE_THICKNESS PS_DICT_UNIQUE_ID PS_DICT_VERSION PS_DICT_WEIGHT PS_FontInfo PS_FontInfoRec PS_Private PS_PrivateRec R \u00b6 random-seed T \u00b6 T1_BLEND_BLUE_SCALE T1_BLEND_BLUE_SHIFT T1_BLEND_BLUE_VALUES T1_BLEND_FAMILY_BLUES T1_BLEND_FAMILY_OTHER_BLUES T1_Blend_Flags T1_BLEND_FORCE_BOLD T1_BLEND_ITALIC_ANGLE T1_BLEND_OTHER_BLUES T1_BLEND_STANDARD_HEIGHT T1_BLEND_STANDARD_WIDTH T1_BLEND_STEM_SNAP_HEIGHTS T1_BLEND_STEM_SNAP_WIDTHS T1_BLEND_UNDERLINE_POSITION T1_BLEND_UNDERLINE_THICKNESS T1_ENCODING_TYPE_ARRAY T1_ENCODING_TYPE_EXPERT T1_ENCODING_TYPE_ISOLATIN1 T1_ENCODING_TYPE_NONE T1_ENCODING_TYPE_STANDARD T1_EncodingType T1_FontInfo T1_Private TT_ADOBE_ID_CUSTOM TT_ADOBE_ID_EXPERT TT_ADOBE_ID_LATIN_1 TT_ADOBE_ID_STANDARD TT_ADOBE_ID_XXX TT_APPLE_ID_DEFAULT TT_APPLE_ID_FULL_UNICODE TT_APPLE_ID_ISO_10646 TT_APPLE_ID_UNICODE_1_1 TT_APPLE_ID_UNICODE_2_0 TT_APPLE_ID_UNICODE_32 TT_APPLE_ID_VARIANT_SELECTOR TT_APPLE_ID_XXX TT_Header TT_HoriHeader TT_INTERPRETER_VERSION_35 TT_INTERPRETER_VERSION_38 TT_INTERPRETER_VERSION_40 TT_INTERPRETER_VERSION_XXX TT_ISO_ID_10646 TT_ISO_ID_7BIT_ASCII TT_ISO_ID_8859_1 TT_ISO_ID_XXX TT_MAC_ID_XXX TT_MAC_LANGID_XXX TT_MaxProfile TT_MS_ID_BIG_5 TT_MS_ID_JOHAB TT_MS_ID_PRC TT_MS_ID_SJIS TT_MS_ID_SYMBOL_CS TT_MS_ID_UCS_4 TT_MS_ID_UNICODE_CS TT_MS_ID_WANSUNG TT_MS_ID_XXX TT_MS_LANGID_XXX TT_NAME_ID_XXX TT_OS2 TT_PCLT TT_PLATFORM_ADOBE TT_PLATFORM_APPLE_UNICODE TT_PLATFORM_CUSTOM TT_PLATFORM_ISO TT_PLATFORM_MACINTOSH TT_PLATFORM_MICROSOFT TT_PLATFORM_XXX TT_Postscript TT_UCR_XXX TT_VertHeader W \u00b6 warping generated on Thu Dec 2 12:36:11 2021 UTC","title":"Index"},{"location":"ft2-index.html#freetype-2111-api-reference","text":"","title":"FreeType-2.11.1 API Reference"},{"location":"ft2-index.html#b","text":"BDF_Property BDF_PROPERTY_TYPE_ATOM BDF_PROPERTY_TYPE_CARDINAL BDF_PROPERTY_TYPE_INTEGER BDF_PROPERTY_TYPE_NONE BDF_PropertyRec BDF_PropertyType","title":"B"},{"location":"ft2-index.html#c","text":"CID_FaceDict CID_FaceDictRec CID_FaceInfo CID_FaceInfoRec CID_FontDict CID_Info","title":"C"},{"location":"ft2-index.html#d","text":"darkening-parameters default-script","title":"D"},{"location":"ft2-index.html#f","text":"fallback-script FREETYPE_MAJOR FREETYPE_MINOR FREETYPE_PATCH FREETYPE_XXX FT_Activate_Size FT_Add_Default_Modules FT_Add_Module FT_ADVANCE_FLAG_FAST_ONLY FT_ADVANCES_H FT_Affine23 FT_Alloc_Func FT_Angle FT_ANGLE_2PI FT_Angle_Diff FT_ANGLE_PI FT_ANGLE_PI2 FT_ANGLE_PI4 FT_Atan2 FT_Attach_File FT_Attach_Stream FT_AUTOHINTER_H FT_AUTOHINTER_SCRIPT_CJK FT_AUTOHINTER_SCRIPT_INDIC FT_AUTOHINTER_SCRIPT_LATIN FT_AUTOHINTER_SCRIPT_NONE FT_AUTOHINTER_SCRIPT_XXX FT_BBox FT_BBOX_H FT_BDF_H FT_Bitmap FT_Bitmap_Blend FT_Bitmap_Convert FT_Bitmap_Copy FT_Bitmap_Done FT_Bitmap_Embolden FT_BITMAP_H FT_Bitmap_Init FT_Bitmap_Size FT_BitmapGlyph FT_BitmapGlyphRec FT_Bool FT_Byte FT_Bytes FT_BZIP2_H FT_CACHE_H FT_CeilFix FT_CFF_DRIVER_H FT_Char FT_CharMap FT_CharMapRec FT_CID_H FT_ClassicKern_Free FT_ClassicKern_Validate FT_ClipBox FT_Color FT_COLOR_H FT_COLOR_INCLUDE_ROOT_TRANSFORM FT_COLOR_NO_ROOT_TRANSFORM FT_Color_Root_Transform FT_ColorIndex FT_ColorLine FT_ColorStop FT_ColorStopIterator FT_COLR_Paint FT_Composite_Mode FT_CONFIG_CONFIG_H FT_CONFIG_MODULES_H FT_CONFIG_OPTIONS_H FT_CONFIG_STANDARD_LIBRARY_H FT_Cos FT_Custom_Log_Handler FT_Data FT_DEBUG_HOOK_TRUETYPE FT_DEBUG_HOOK_XXX FT_DebugHook_Func FT_DivFix FT_Done_Face FT_Done_FreeType FT_Done_Glyph FT_Done_Library FT_Done_MM_Var FT_Done_Size FT_Driver FT_DRIVER_H FT_ENC_TAG FT_Encoding FT_ENCODING_ADOBE_CUSTOM FT_ENCODING_ADOBE_EXPERT FT_ENCODING_ADOBE_LATIN_1 FT_ENCODING_ADOBE_STANDARD FT_ENCODING_APPLE_ROMAN FT_ENCODING_BIG5 FT_ENCODING_JOHAB FT_ENCODING_MS_BIG5 FT_ENCODING_MS_GB2312 FT_ENCODING_MS_JOHAB FT_ENCODING_MS_SJIS FT_ENCODING_MS_SYMBOL FT_ENCODING_MS_WANSUNG FT_ENCODING_NONE FT_ENCODING_OLD_LATIN_2 FT_ENCODING_PRC FT_ENCODING_SJIS FT_ENCODING_UNICODE FT_ENCODING_WANSUNG FT_Err_XXX FT_Error FT_Error_String FT_ERRORS_H FT_F26Dot6 FT_F2Dot14 FT_Face FT_Face_CheckTrueTypePatents FT_FACE_DRIVER_NAME FT_FACE_FLAG_CID_KEYED FT_FACE_FLAG_COLOR FT_FACE_FLAG_EXTERNAL_STREAM FT_FACE_FLAG_FAST_GLYPHS FT_FACE_FLAG_FIXED_SIZES FT_FACE_FLAG_FIXED_WIDTH FT_FACE_FLAG_GLYPH_NAMES FT_FACE_FLAG_HINTER FT_FACE_FLAG_HORIZONTAL FT_FACE_FLAG_KERNING FT_FACE_FLAG_MULTIPLE_MASTERS FT_FACE_FLAG_SCALABLE FT_FACE_FLAG_SFNT FT_FACE_FLAG_TRICKY FT_FACE_FLAG_VARIATION FT_FACE_FLAG_VERTICAL FT_FACE_FLAG_XXX FT_Face_GetCharsOfVariant FT_Face_GetCharVariantIndex FT_Face_GetCharVariantIsDefault FT_Face_GetVariantSelectors FT_Face_GetVariantsOfChar FT_Face_Internal FT_Face_Properties FT_Face_SetUnpatentedHinting FT_FaceRec FT_Fixed FT_FloorFix FT_FONT_FORMATS_H FT_Free_Func FT_FREETYPE_H FT_FSTYPE_BITMAP_EMBEDDING_ONLY FT_FSTYPE_EDITABLE_EMBEDDING FT_FSTYPE_INSTALLABLE_EMBEDDING FT_FSTYPE_NO_SUBSETTING FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING FT_FSTYPE_XXX FT_FWord FT_GASP_DO_GRAY FT_GASP_DO_GRIDFIT FT_GASP_H FT_GASP_NO_TABLE FT_GASP_SYMMETRIC_GRIDFIT FT_GASP_SYMMETRIC_SMOOTHING FT_GASP_XXX FT_Generic FT_Generic_Finalizer FT_Get_Advance FT_Get_Advances FT_Get_BDF_Charset_ID FT_Get_BDF_Property FT_Get_Char_Index FT_Get_Charmap_Index FT_Get_CID_From_Glyph_Index FT_Get_CID_Is_Internally_CID_Keyed FT_Get_CID_Registry_Ordering_Supplement FT_Get_CMap_Format FT_Get_CMap_Language_ID FT_Get_Color_Glyph_ClipBox FT_Get_Color_Glyph_Layer FT_Get_Color_Glyph_Paint FT_Get_Colorline_Stops FT_Get_First_Char FT_Get_Font_Format FT_Get_FSType_Flags FT_Get_Gasp FT_Get_Glyph FT_Get_Glyph_Name FT_Get_Kerning FT_Get_MM_Blend_Coordinates FT_Get_MM_Var FT_Get_MM_WeightVector FT_Get_Module FT_Get_Multi_Master FT_Get_Name_Index FT_Get_Next_Char FT_Get_Paint FT_Get_Paint_Layers FT_Get_PFR_Advance FT_Get_PFR_Kerning FT_Get_PFR_Metrics FT_Get_Postscript_Name FT_Get_PS_Font_Info FT_Get_PS_Font_Private FT_Get_PS_Font_Value FT_Get_Renderer FT_Get_Sfnt_LangTag FT_Get_Sfnt_Name FT_Get_Sfnt_Name_Count FT_Get_Sfnt_Table FT_Get_SubGlyph_Info FT_Get_Track_Kerning FT_Get_Transform FT_Get_TrueType_Engine_Type FT_Get_Var_Axis_Flags FT_Get_Var_Blend_Coordinates FT_Get_Var_Design_Coordinates FT_Get_WinFNT_Header FT_GetFile_From_Mac_ATS_Name FT_GetFile_From_Mac_Name FT_GetFilePath_From_Mac_ATS_Name FT_Glyph FT_GLYPH_BBOX_GRIDFIT FT_Glyph_BBox_Mode FT_GLYPH_BBOX_PIXELS FT_GLYPH_BBOX_SUBPIXELS FT_GLYPH_BBOX_TRUNCATE FT_GLYPH_BBOX_UNSCALED FT_Glyph_Copy FT_Glyph_Format FT_GLYPH_FORMAT_BITMAP FT_GLYPH_FORMAT_COMPOSITE FT_GLYPH_FORMAT_NONE FT_GLYPH_FORMAT_OUTLINE FT_GLYPH_FORMAT_PLOTTER FT_Glyph_Get_CBox FT_GLYPH_H FT_Glyph_Metrics FT_Glyph_Stroke FT_Glyph_StrokeBorder FT_Glyph_To_Bitmap FT_Glyph_Transform FT_GlyphRec FT_GlyphSlot FT_GlyphSlot_Own_Bitmap FT_GlyphSlotRec FT_GX_VALIDATE_H FT_GZIP_H FT_Gzip_Uncompress FT_HAS_COLOR FT_HAS_FAST_GLYPHS FT_HAS_FIXED_SIZES FT_HAS_GLYPH_NAMES FT_HAS_HORIZONTAL FT_HAS_KERNING FT_HAS_MULTIPLE_MASTERS FT_Has_PS_Glyph_Names FT_HAS_VERTICAL FT_HINTING_ADOBE FT_HINTING_FREETYPE FT_HINTING_XXX FT_IMAGE_H FT_IMAGE_TAG FT_Incremental FT_Incremental_FreeGlyphDataFunc FT_Incremental_FuncsRec FT_Incremental_GetGlyphDataFunc FT_Incremental_GetGlyphMetricsFunc FT_INCREMENTAL_H FT_Incremental_Interface FT_Incremental_InterfaceRec FT_Incremental_Metrics FT_Incremental_MetricsRec FT_Init_FreeType FT_Int FT_Int16 FT_Int32 FT_Int64 FT_IS_CID_KEYED FT_IS_FIXED_WIDTH FT_IS_NAMED_INSTANCE FT_IS_SCALABLE FT_IS_SFNT FT_IS_TRICKY FT_IS_VARIATION FT_KERNING_DEFAULT FT_Kerning_Mode FT_KERNING_UNFITTED FT_KERNING_UNSCALED FT_LayerIterator FT_LCD_FILTER_DEFAULT FT_LCD_FILTER_H FT_LCD_FILTER_LEGACY FT_LCD_FILTER_LEGACY1 FT_LCD_FILTER_LIGHT FT_LCD_FILTER_NONE FT_LcdFilter FT_LcdFiveTapFilter FT_Library FT_Library_SetLcdFilter FT_Library_SetLcdFilterWeights FT_Library_SetLcdGeometry FT_Library_Version FT_List FT_List_Add FT_List_Destructor FT_List_Finalize FT_List_Find FT_LIST_H FT_List_Insert FT_List_Iterate FT_List_Iterator FT_List_Remove FT_List_Up FT_ListNode FT_ListNodeRec FT_ListRec FT_LOAD_BITMAP_METRICS_ONLY FT_Load_Char FT_LOAD_COLOR FT_LOAD_COMPUTE_METRICS FT_LOAD_CROP_BITMAP FT_LOAD_DEFAULT FT_LOAD_FORCE_AUTOHINT FT_Load_Glyph FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH FT_LOAD_IGNORE_TRANSFORM FT_LOAD_LINEAR_DESIGN FT_LOAD_MONOCHROME FT_LOAD_NO_AUTOHINT FT_LOAD_NO_BITMAP FT_LOAD_NO_HINTING FT_LOAD_NO_RECURSE FT_LOAD_NO_SCALE FT_LOAD_PEDANTIC FT_LOAD_RENDER FT_Load_Sfnt_Table FT_LOAD_TARGET_LCD FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_MODE FT_LOAD_TARGET_MONO FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_XXX FT_LOAD_VERTICAL_LAYOUT FT_LOAD_XXX FT_Long FT_LZW_H FT_MAC_H FT_MAKE_TAG FT_Matrix FT_Matrix_Invert FT_Matrix_Multiply FT_Memory FT_MemoryRec FT_MM_Axis FT_MM_Var FT_Module FT_Module_Class FT_Module_Constructor FT_Module_Destructor FT_MODULE_ERRORS_H FT_MODULE_H FT_Module_Requester FT_MulDiv FT_MulFix FT_Multi_Master FT_MULTIPLE_MASTERS_H FT_New_Face FT_New_Face_From_FOND FT_New_Face_From_FSRef FT_New_Face_From_FSSpec FT_New_Glyph FT_New_Library FT_New_Memory_Face FT_New_Size FT_Offset FT_OpaquePaint FT_Open_Args FT_OPEN_DRIVER FT_Open_Face FT_OPEN_MEMORY FT_OPEN_PARAMS FT_OPEN_PATHNAME FT_OPEN_STREAM FT_OPEN_XXX FT_OpenType_Free FT_OpenType_Validate FT_OPENTYPE_VALIDATE_H FT_Orientation FT_ORIENTATION_FILL_LEFT FT_ORIENTATION_FILL_RIGHT FT_ORIENTATION_NONE FT_ORIENTATION_POSTSCRIPT FT_ORIENTATION_TRUETYPE FT_Outline FT_Outline_Check FT_Outline_ConicToFunc FT_Outline_Copy FT_Outline_CubicToFunc FT_Outline_Decompose FT_Outline_Done FT_Outline_Embolden FT_Outline_EmboldenXY FT_OUTLINE_EVEN_ODD_FILL FT_Outline_Funcs FT_Outline_Get_BBox FT_Outline_Get_Bitmap FT_Outline_Get_CBox FT_Outline_Get_Orientation FT_Outline_GetInsideBorder FT_Outline_GetOutsideBorder FT_OUTLINE_H FT_OUTLINE_HIGH_PRECISION FT_OUTLINE_IGNORE_DROPOUTS FT_OUTLINE_INCLUDE_STUBS FT_Outline_LineToFunc FT_Outline_MoveToFunc FT_Outline_New FT_OUTLINE_NONE FT_OUTLINE_OVERLAP FT_OUTLINE_OWNER FT_Outline_Render FT_Outline_Reverse FT_OUTLINE_REVERSE_FILL FT_OUTLINE_SINGLE_PASS FT_OUTLINE_SMART_DROPOUTS FT_Outline_Transform FT_Outline_Translate FT_OUTLINE_XXX FT_OutlineGlyph FT_OutlineGlyphRec FT_PaintColrGlyph FT_PaintColrLayers FT_PaintComposite FT_PaintExtend FT_PaintFormat FT_PaintGlyph FT_PaintLinearGradient FT_PaintRadialGradient FT_PaintRotate FT_PaintScale FT_PaintSkew FT_PaintSolid FT_PaintSweepGradient FT_PaintTransform FT_PaintTranslate FT_Palette_Data FT_Palette_Data_Get FT_PALETTE_FOR_DARK_BACKGROUND FT_PALETTE_FOR_LIGHT_BACKGROUND FT_Palette_Select FT_Palette_Set_Foreground_Color FT_PALETTE_XXX FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY FT_PARAM_TAG_INCREMENTAL FT_PARAM_TAG_LCD_FILTER_WEIGHTS FT_PARAM_TAG_RANDOM_SEED FT_PARAM_TAG_STEM_DARKENING FT_PARAM_TAG_UNPATENTED_HINTING FT_Parameter FT_PCF_DRIVER_H FT_PFR_H FT_Pixel_Mode FT_PIXEL_MODE_BGRA FT_PIXEL_MODE_GRAY FT_PIXEL_MODE_GRAY2 FT_PIXEL_MODE_GRAY4 FT_PIXEL_MODE_LCD FT_PIXEL_MODE_LCD_V FT_PIXEL_MODE_MONO FT_PIXEL_MODE_NONE FT_Pointer FT_Pos FT_Prop_GlyphToScriptMap FT_Prop_IncreaseXHeight FT_Property_Get FT_Property_Set FT_PtrDist FT_Raster FT_Raster_BitSet_Func FT_Raster_BitTest_Func FT_Raster_DoneFunc FT_RASTER_FLAG_AA FT_RASTER_FLAG_CLIP FT_RASTER_FLAG_DEFAULT FT_RASTER_FLAG_DIRECT FT_RASTER_FLAG_SDF FT_RASTER_FLAG_XXX FT_Raster_Funcs FT_Raster_NewFunc FT_Raster_Params FT_Raster_RenderFunc FT_Raster_ResetFunc FT_Raster_SetModeFunc FT_Realloc_Func FT_Reference_Face FT_Reference_Library FT_Remove_Module FT_Render_Glyph FT_RENDER_H FT_Render_Mode FT_RENDER_MODE_LCD FT_RENDER_MODE_LCD_V FT_RENDER_MODE_LIGHT FT_RENDER_MODE_MONO FT_RENDER_MODE_NORMAL FT_RENDER_MODE_SDF FT_Renderer FT_Renderer_Class FT_Request_Size FT_RoundFix FT_Select_Charmap FT_Select_Size FT_Set_Char_Size FT_Set_Charmap FT_Set_Debug_Hook FT_Set_Default_Log_Handler FT_Set_Default_Properties FT_Set_Log_Handler FT_Set_MM_Blend_Coordinates FT_Set_MM_Design_Coordinates FT_Set_MM_WeightVector FT_Set_Named_Instance FT_Set_Pixel_Sizes FT_Set_Renderer FT_Set_Transform FT_Set_Var_Blend_Coordinates FT_Set_Var_Design_Coordinates FT_SFNT_HEAD FT_SFNT_HHEA FT_SFNT_MAXP FT_SFNT_NAMES_H FT_SFNT_OS2 FT_SFNT_PCLT FT_SFNT_POST FT_Sfnt_Table_Info FT_Sfnt_Tag FT_SFNT_VHEA FT_SfntLangTag FT_SfntName FT_Short FT_Sin FT_Size FT_Size_Internal FT_Size_Metrics FT_Size_Request FT_Size_Request_Type FT_SIZE_REQUEST_TYPE_BBOX FT_SIZE_REQUEST_TYPE_CELL FT_SIZE_REQUEST_TYPE_NOMINAL FT_SIZE_REQUEST_TYPE_REAL_DIM FT_SIZE_REQUEST_TYPE_SCALES FT_Size_RequestRec FT_SizeRec FT_SIZES_H FT_Slot_Internal FT_Span FT_SpanFunc FT_Stream FT_Stream_CloseFunc FT_Stream_IoFunc FT_Stream_OpenBzip2 FT_Stream_OpenGzip FT_Stream_OpenLZW FT_StreamDesc FT_StreamRec FT_String FT_Stroker FT_Stroker_BeginSubPath FT_STROKER_BORDER_LEFT FT_STROKER_BORDER_RIGHT FT_Stroker_ConicTo FT_Stroker_CubicTo FT_Stroker_Done FT_Stroker_EndSubPath FT_Stroker_Export FT_Stroker_ExportBorder FT_Stroker_GetBorderCounts FT_Stroker_GetCounts FT_STROKER_H FT_Stroker_LineCap FT_STROKER_LINECAP_BUTT FT_STROKER_LINECAP_ROUND FT_STROKER_LINECAP_SQUARE FT_Stroker_LineJoin FT_STROKER_LINEJOIN_BEVEL FT_STROKER_LINEJOIN_MITER FT_STROKER_LINEJOIN_MITER_FIXED FT_STROKER_LINEJOIN_MITER_VARIABLE FT_STROKER_LINEJOIN_ROUND FT_Stroker_LineTo FT_Stroker_New FT_Stroker_ParseOutline FT_Stroker_Rewind FT_Stroker_Set FT_StrokerBorder FT_STYLE_FLAG_BOLD FT_STYLE_FLAG_ITALIC FT_STYLE_FLAG_XXX FT_SubGlyph FT_SUBGLYPH_FLAG_2X2 FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID FT_SUBGLYPH_FLAG_SCALE FT_SUBGLYPH_FLAG_USE_MY_METRICS FT_SUBGLYPH_FLAG_XXX FT_SUBGLYPH_FLAG_XY_SCALE FT_SYNTHESIS_H FT_SYSTEM_H FT_Tag FT_Tan FT_Trace_Set_Default_Level FT_Trace_Set_Level FT_TRIGONOMETRY_H FT_TRUETYPE_DRIVER_H FT_TRUETYPE_ENGINE_TYPE_NONE FT_TRUETYPE_ENGINE_TYPE_PATENTED FT_TRUETYPE_ENGINE_TYPE_UNPATENTED FT_TRUETYPE_IDS_H FT_TRUETYPE_TABLES_H FT_TRUETYPE_TAGS_H FT_TrueTypeEngineType FT_TrueTypeGX_Free FT_TrueTypeGX_Validate FT_TYPE1_TABLES_H FT_TYPES_H FT_UFWord FT_UInt FT_UInt16 FT_UInt32 FT_UInt64 FT_ULong FT_UnitVector FT_UShort FT_VALIDATE_APPLE FT_VALIDATE_BASE FT_VALIDATE_bsln FT_VALIDATE_CKERN FT_VALIDATE_CKERNXXX FT_VALIDATE_feat FT_VALIDATE_GDEF FT_VALIDATE_GPOS FT_VALIDATE_GSUB FT_VALIDATE_GX FT_VALIDATE_GX_LENGTH FT_VALIDATE_GXXXX FT_VALIDATE_JSTF FT_VALIDATE_just FT_VALIDATE_kern FT_VALIDATE_lcar FT_VALIDATE_MATH FT_VALIDATE_mort FT_VALIDATE_morx FT_VALIDATE_MS FT_VALIDATE_opbd FT_VALIDATE_OT FT_VALIDATE_OTXXX FT_VALIDATE_prop FT_VALIDATE_trak FT_Var_Axis FT_VAR_AXIS_FLAG_HIDDEN FT_VAR_AXIS_FLAG_XXX FT_Var_Named_Style FT_Vector FT_Vector_From_Polar FT_Vector_Length FT_Vector_Polarize FT_Vector_Rotate FT_Vector_Transform FT_Vector_Unit FT_WinFNT_Header FT_WinFNT_HeaderRec FT_WinFNT_ID_CP1250 FT_WinFNT_ID_CP1251 FT_WinFNT_ID_CP1252 FT_WinFNT_ID_CP1253 FT_WinFNT_ID_CP1254 FT_WinFNT_ID_CP1255 FT_WinFNT_ID_CP1256 FT_WinFNT_ID_CP1257 FT_WinFNT_ID_CP1258 FT_WinFNT_ID_CP1361 FT_WinFNT_ID_CP874 FT_WinFNT_ID_CP932 FT_WinFNT_ID_CP936 FT_WinFNT_ID_CP949 FT_WinFNT_ID_CP950 FT_WinFNT_ID_DEFAULT FT_WinFNT_ID_MAC FT_WinFNT_ID_OEM FT_WinFNT_ID_SYMBOL FT_WinFNT_ID_XXX FT_WINFONTS_H FTC_CMapCache FTC_CMapCache_Lookup FTC_CMapCache_New FTC_Face_Requester FTC_FaceID FTC_ImageCache FTC_ImageCache_Lookup FTC_ImageCache_LookupScaler FTC_ImageCache_New FTC_ImageType FTC_ImageTypeRec FTC_Manager FTC_Manager_Done FTC_Manager_LookupFace FTC_Manager_LookupSize FTC_Manager_New FTC_Manager_RemoveFaceID FTC_Manager_Reset FTC_Node FTC_Node_Unref FTC_SBit FTC_SBitCache FTC_SBitCache_Lookup FTC_SBitCache_LookupScaler FTC_SBitCache_New FTC_SBitRec FTC_Scaler FTC_ScalerRec","title":"F"},{"location":"ft2-index.html#g","text":"glyph-to-script-map","title":"G"},{"location":"ft2-index.html#h","text":"hinting-engine","title":"H"},{"location":"ft2-index.html#i","text":"increase-x-height interpreter-version","title":"I"},{"location":"ft2-index.html#n","text":"no-long-family-names no-stem-darkening","title":"N"},{"location":"ft2-index.html#p","text":"PS_DICT_BLUE_FUZZ PS_DICT_BLUE_SCALE PS_DICT_BLUE_SHIFT PS_DICT_BLUE_VALUE PS_DICT_CHAR_STRING PS_DICT_CHAR_STRING_KEY PS_DICT_ENCODING_ENTRY PS_DICT_ENCODING_TYPE PS_DICT_FAMILY_BLUE PS_DICT_FAMILY_NAME PS_DICT_FAMILY_OTHER_BLUE PS_DICT_FONT_BBOX PS_DICT_FONT_MATRIX PS_DICT_FONT_NAME PS_DICT_FONT_TYPE PS_DICT_FORCE_BOLD PS_DICT_FS_TYPE PS_DICT_FULL_NAME PS_DICT_IS_FIXED_PITCH PS_DICT_ITALIC_ANGLE PS_Dict_Keys PS_DICT_LANGUAGE_GROUP PS_DICT_LEN_IV PS_DICT_MIN_FEATURE PS_DICT_NOTICE PS_DICT_NUM_BLUE_VALUES PS_DICT_NUM_CHAR_STRINGS PS_DICT_NUM_FAMILY_BLUES PS_DICT_NUM_FAMILY_OTHER_BLUES PS_DICT_NUM_OTHER_BLUES PS_DICT_NUM_STEM_SNAP_H PS_DICT_NUM_STEM_SNAP_V PS_DICT_NUM_SUBRS PS_DICT_OTHER_BLUE PS_DICT_PAINT_TYPE PS_DICT_PASSWORD PS_DICT_RND_STEM_UP PS_DICT_STD_HW PS_DICT_STD_VW PS_DICT_STEM_SNAP_H PS_DICT_STEM_SNAP_V PS_DICT_SUBR PS_DICT_UNDERLINE_POSITION PS_DICT_UNDERLINE_THICKNESS PS_DICT_UNIQUE_ID PS_DICT_VERSION PS_DICT_WEIGHT PS_FontInfo PS_FontInfoRec PS_Private PS_PrivateRec","title":"P"},{"location":"ft2-index.html#r","text":"random-seed","title":"R"},{"location":"ft2-index.html#t","text":"T1_BLEND_BLUE_SCALE T1_BLEND_BLUE_SHIFT T1_BLEND_BLUE_VALUES T1_BLEND_FAMILY_BLUES T1_BLEND_FAMILY_OTHER_BLUES T1_Blend_Flags T1_BLEND_FORCE_BOLD T1_BLEND_ITALIC_ANGLE T1_BLEND_OTHER_BLUES T1_BLEND_STANDARD_HEIGHT T1_BLEND_STANDARD_WIDTH T1_BLEND_STEM_SNAP_HEIGHTS T1_BLEND_STEM_SNAP_WIDTHS T1_BLEND_UNDERLINE_POSITION T1_BLEND_UNDERLINE_THICKNESS T1_ENCODING_TYPE_ARRAY T1_ENCODING_TYPE_EXPERT T1_ENCODING_TYPE_ISOLATIN1 T1_ENCODING_TYPE_NONE T1_ENCODING_TYPE_STANDARD T1_EncodingType T1_FontInfo T1_Private TT_ADOBE_ID_CUSTOM TT_ADOBE_ID_EXPERT TT_ADOBE_ID_LATIN_1 TT_ADOBE_ID_STANDARD TT_ADOBE_ID_XXX TT_APPLE_ID_DEFAULT TT_APPLE_ID_FULL_UNICODE TT_APPLE_ID_ISO_10646 TT_APPLE_ID_UNICODE_1_1 TT_APPLE_ID_UNICODE_2_0 TT_APPLE_ID_UNICODE_32 TT_APPLE_ID_VARIANT_SELECTOR TT_APPLE_ID_XXX TT_Header TT_HoriHeader TT_INTERPRETER_VERSION_35 TT_INTERPRETER_VERSION_38 TT_INTERPRETER_VERSION_40 TT_INTERPRETER_VERSION_XXX TT_ISO_ID_10646 TT_ISO_ID_7BIT_ASCII TT_ISO_ID_8859_1 TT_ISO_ID_XXX TT_MAC_ID_XXX TT_MAC_LANGID_XXX TT_MaxProfile TT_MS_ID_BIG_5 TT_MS_ID_JOHAB TT_MS_ID_PRC TT_MS_ID_SJIS TT_MS_ID_SYMBOL_CS TT_MS_ID_UCS_4 TT_MS_ID_UNICODE_CS TT_MS_ID_WANSUNG TT_MS_ID_XXX TT_MS_LANGID_XXX TT_NAME_ID_XXX TT_OS2 TT_PCLT TT_PLATFORM_ADOBE TT_PLATFORM_APPLE_UNICODE TT_PLATFORM_CUSTOM TT_PLATFORM_ISO TT_PLATFORM_MACINTOSH TT_PLATFORM_MICROSOFT TT_PLATFORM_XXX TT_Postscript TT_UCR_XXX TT_VertHeader","title":"T"},{"location":"ft2-index.html#w","text":"warping generated on Thu Dec 2 12:36:11 2021 UTC","title":"W"},{"location":"ft2-layer_management.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Glyph Layer Management Glyph Layer Management \u00b6 Synopsis \u00b6 The functions described here allow access of colored glyph layer data in OpenType's \u2018COLR\u2019 tables. FT_LayerIterator \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_LayerIterator_ { FT_UInt num_layers; FT_UInt layer; FT_Byte * p; } FT_LayerIterator ; This iterator object is needed for FT_Get_Color_Glyph_Layer . fields num_layers The number of glyph layers for the requested glyph index. Will be set by FT_Get_Color_Glyph_Layer . layer The current layer. Will be set by FT_Get_Color_Glyph_Layer . p An opaque pointer into \u2018COLR\u2019 table data. The caller must set this to NULL before the first call of FT_Get_Color_Glyph_Layer . FT_Get_Color_Glyph_Layer \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_Layer ( FT_Face face, FT_UInt base_glyph, FT_UInt *aglyph_index, FT_UInt *acolor_index, FT_LayerIterator * iterator ); This is an interface to the \u2018COLR\u2019 table in OpenType fonts to iteratively retrieve the colored glyph layers associated with the current glyph slot. https://docs.microsoft.com/en-us/typography/opentype/spec/colr The glyph layer data for a given glyph index, if present, provides an alternative, multi-color glyph representation: Instead of rendering the outline or bitmap with the given glyph index, glyphs with the indices and colors returned by this function are rendered layer by layer. The returned elements are ordered in the z direction from bottom to top; the 'n'th element should be rendered with the associated palette color and blended on top of the already rendered layers (elements 0, 1, \u2026, n-1). input face A handle to the parent face object. base_glyph The glyph index the colored glyph layers are associated with. inout iterator An FT_LayerIterator object. For the first call you should set iterator->p to NULL . For all following calls, simply use the same object again. output aglyph_index The glyph index of the current layer. acolor_index The color index into the font face's color palette of the current layer. The value 0xFFFF is special; it doesn't reference a palette entry but indicates that the text foreground color should be used instead (to be set up by the application outside of FreeType). The color palette can be retrieved with FT_Palette_Select . return Value 1 if everything is OK. If there are no more layers (or if there are no layers at all), value 0 gets returned. In case of an error, value 0 is returned also. note This function is necessary if you want to handle glyph layers by yourself. In particular, functions that operate with FT_GlyphRec objects (like FT_Get_Glyph or FT_Glyph_To_Bitmap ) don't have access to this information. Note that FT_Render_Glyph is able to handle colored glyph layers automatically if the FT_LOAD_COLOR flag is passed to a previous call to FT_Load_Glyph . [This is an experimental feature.] example FT_Color* palette; FT_LayerIterator iterator; FT_Bool have_layers; FT_UInt layer_glyph_index; FT_UInt layer_color_index; error = FT_Palette_Select( face, palette_index, &palette ); if ( error ) palette = NULL; iterator.p = NULL; have_layers = FT_Get_Color_Glyph_Layer( face, glyph_index, &layer_glyph_index, &layer_color_index, &iterator ); if ( palette && have_layers ) { do { FT_Color layer_color; if ( layer_color_index == 0xFFFF ) layer_color = text_foreground_color; else layer_color = palette[layer_color_index]; // Load and render glyph `layer_glyph_index', then // blend resulting pixmap (using color `layer_color') // with previously created pixmaps. } while ( FT_Get_Color_Glyph_Layer( face, glyph_index, &layer_glyph_index, &layer_color_index, &iterator ) ); } FT_PaintFormat \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_PaintFormat_ { FT_COLR_PAINTFORMAT_COLR_LAYERS = 1, FT_COLR_PAINTFORMAT_SOLID = 2, FT_COLR_PAINTFORMAT_LINEAR_GRADIENT = 4, FT_COLR_PAINTFORMAT_RADIAL_GRADIENT = 6, FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 8, FT_COLR_PAINTFORMAT_GLYPH = 10, FT_COLR_PAINTFORMAT_COLR_GLYPH = 11, FT_COLR_PAINTFORMAT_TRANSFORM = 12, FT_COLR_PAINTFORMAT_TRANSLATE = 14, FT_COLR_PAINTFORMAT_SCALE = 16, FT_COLR_PAINTFORMAT_ROTATE = 24, FT_COLR_PAINTFORMAT_SKEW = 28, FT_COLR_PAINTFORMAT_COMPOSITE = 32, FT_COLR_PAINT_FORMAT_MAX = 33, FT_COLR_PAINTFORMAT_UNSUPPORTED = 255 } FT_PaintFormat ; Enumeration describing the different paint format types of the v1 extensions to the \u2018COLR\u2019 table, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The enumeration values losely correspond with the format numbers of the specification: FreeType always returns a fully specified \u2018Paint\u2019 structure for the \u2018Transform\u2019, \u2018Translate\u2019, \u2018Scale\u2019, \u2018Rotate\u2019, and \u2018Skew\u2019 table types even though the specification has different formats depending on whether or not a center is specified, whether the scale is uniform in x and y direction or not, etc. Also, only non-variable format identifiers are listed in this enumeration; as soon as support for variable \u2018COLR\u2019 v1 fonts is implemented, interpolation is performed dependent on axis coordinates, which are configured on the FT_Face through FT_Set_Var_Design_Coordinates . This implies that always static, readily interpolated values are returned in the \u2018Paint\u2019 structures. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ColorStopIterator \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorStopIterator_ { FT_UInt num_color_stops; FT_UInt current_color_stop; FT_Byte * p; } FT_ColorStopIterator ; This iterator object is needed for FT_Get_Colorline_Stops . It keeps state while iterating over the stops of an FT_ColorLine , representing the ColorLine struct of the v1 extensions to \u2018COLR\u2019, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. fields num_color_stops The number of color stops for the requested glyph index. Set by FT_Get_Colorline_Stops . current_color_stop The current color stop. Set by FT_Get_Colorline_Stops . p An opaque pointer into \u2018COLR\u2019 table data. The caller must set this to NULL before the first call of FT_Get_Colorline_Stops . since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ColorIndex \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorIndex_ { FT_UInt16 palette_index; FT_F2Dot14 alpha; } FT_ColorIndex ; A structure representing a ColorIndex value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. fields palette_index The palette index into a \u2018CPAL\u2019 palette. alpha Alpha transparency value multiplied with the value from \u2018CPAL\u2019. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ColorStop \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorStop_ { FT_F2Dot14 stop_offset; FT_ColorIndex color; } FT_ColorStop ; A structure representing a ColorStop value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. fields stop_offset The stop offset between 0 and 1 along the gradient. color The color information for this stop, see FT_ColorIndex . since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintExtend \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_PaintExtend_ { FT_COLR_PAINT_EXTEND_PAD = 0, FT_COLR_PAINT_EXTEND_REPEAT = 1, FT_COLR_PAINT_EXTEND_REFLECT = 2 } FT_PaintExtend ; An enumeration representing the \u2018Extend\u2019 mode of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. It describes how the gradient fill continues at the other boundaries. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ColorLine \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorLine_ { FT_PaintExtend extend; FT_ColorStopIterator color_stop_iterator; } FT_ColorLine ; A structure representing a ColorLine value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. It describes a list of color stops along the defined gradient. fields extend The extend mode at the outer boundaries, see FT_PaintExtend . color_stop_iterator The FT_ColorStopIterator used to enumerate and retrieve the actual FT_ColorStop 's. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Affine23 \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Affine_23_ { FT_Fixed xx, xy, dx; FT_Fixed yx, yy, dy; } FT_Affine23 ; A structure used to store a 2x3 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is x' = x*xx + y*xy + dx y' = x*yx + y*yy + dy fields xx Matrix coefficient. xy Matrix coefficient. dx x translation. yx Matrix coefficient. yy Matrix coefficient. dy y translation. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Composite_Mode \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_Composite_Mode_ { FT_COLR_COMPOSITE_CLEAR = 0, FT_COLR_COMPOSITE_SRC = 1, FT_COLR_COMPOSITE_DEST = 2, FT_COLR_COMPOSITE_SRC_OVER = 3, FT_COLR_COMPOSITE_DEST_OVER = 4, FT_COLR_COMPOSITE_SRC_IN = 5, FT_COLR_COMPOSITE_DEST_IN = 6, FT_COLR_COMPOSITE_SRC_OUT = 7, FT_COLR_COMPOSITE_DEST_OUT = 8, FT_COLR_COMPOSITE_SRC_ATOP = 9, FT_COLR_COMPOSITE_DEST_ATOP = 10, FT_COLR_COMPOSITE_XOR = 11, FT_COLR_COMPOSITE_PLUS = 12, FT_COLR_COMPOSITE_SCREEN = 13, FT_COLR_COMPOSITE_OVERLAY = 14, FT_COLR_COMPOSITE_DARKEN = 15, FT_COLR_COMPOSITE_LIGHTEN = 16, FT_COLR_COMPOSITE_COLOR_DODGE = 17, FT_COLR_COMPOSITE_COLOR_BURN = 18, FT_COLR_COMPOSITE_HARD_LIGHT = 19, FT_COLR_COMPOSITE_SOFT_LIGHT = 20, FT_COLR_COMPOSITE_DIFFERENCE = 21, FT_COLR_COMPOSITE_EXCLUSION = 22, FT_COLR_COMPOSITE_MULTIPLY = 23, FT_COLR_COMPOSITE_HSL_HUE = 24, FT_COLR_COMPOSITE_HSL_SATURATION = 25, FT_COLR_COMPOSITE_HSL_COLOR = 26, FT_COLR_COMPOSITE_HSL_LUMINOSITY = 27, FT_COLR_COMPOSITE_MAX = 28 } FT_Composite_Mode ; An enumeration listing the \u2018COLR\u2019 v1 composite modes used in FT_PaintComposite . For more details on each paint mode, see \u2018 https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators \u2019. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_OpaquePaint \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Opaque_Paint_ { FT_Byte * p; FT_Bool insert_root_transform; } FT_OpaquePaint ; A structure representing an offset to a Paint value stored in any of the paint tables of a \u2018COLR\u2019 v1 font. Compare Offset<24> there. When \u2018COLR\u2019 v1 paint tables represented by FreeType objects such as FT_PaintColrLayers , FT_PaintComposite , or FT_PaintTransform reference downstream nested paint tables, we do not immediately retrieve them but encapsulate their location in this type. Use FT_Get_Paint to retrieve the actual FT_COLR_Paint object that describes the details of the respective paint table. fields p An internal offset to a Paint table, needs to be set to NULL before passing this struct as an argument to FT_Get_Paint . insert_root_transform An internal boolean to track whether an initial root transform is to be provided. Do not set this value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintColrLayers \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintColrLayers_ { FT_LayerIterator layer_iterator; } FT_PaintColrLayers ; A structure representing a PaintColrLayers table of a \u2018COLR\u2019 v1 font. This table describes a set of layers that are to be composited with composite mode FT_COLR_COMPOSITE_SRC_OVER . The return value of this function is an FT_LayerIterator initialized so that it can be used with FT_Get_Paint_Layers to retrieve the FT_OpaquePaint objects as references to each layer. fields layer_iterator The layer iterator that describes the layers of this paint. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintSolid \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSolid_ { FT_ColorIndex color; } FT_PaintSolid ; A structure representing a PaintSolid value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. Using a PaintSolid value means that the glyph layer filled with this paint is solid-colored and does not contain a gradient. fields color The color information for this solid paint, see FT_ColorIndex . since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintLinearGradient \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintLinearGradient_ { FT_ColorLine colorline; /* TODO: Potentially expose those as x0, y0 etc. */ FT_Vector p0; FT_Vector p1; FT_Vector p2; } FT_PaintLinearGradient ; A structure representing a PaintLinearGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled with a linear gradient. fields colorline The FT_ColorLine information for this paint, i.e., the list of color stops along the gradient. p0 The starting point of the gradient definition in font units represented as a 16.16 fixed-point FT_Vector . p1 The end point of the gradient definition in font units represented as a 16.16 fixed-point FT_Vector . p2 Optional point p2 to rotate the gradient in font units represented as a 16.16 fixed-point FT_Vector . Otherwise equal to p0. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintRadialGradient \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintRadialGradient_ { FT_ColorLine colorline; FT_Vector c0; FT_Pos r0; FT_Vector c1; FT_Pos r1; } FT_PaintRadialGradient ; A structure representing a PaintRadialGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled filled with a radial gradient. fields colorline The FT_ColorLine information for this paint, i.e., the list of color stops along the gradient. c0 The center of the starting point of the radial gradient in font units represented as a 16.16 fixed-point FT_Vector . r0 The radius of the starting circle of the radial gradient in font units represented as a 16.16 fixed-point value. c1 The center of the end point of the radial gradient in font units represented as a 16.16 fixed-point FT_Vector . r1 The radius of the end circle of the radial gradient in font units represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintSweepGradient \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSweepGradient_ { FT_ColorLine colorline; FT_Vector center; FT_Fixed start_angle; FT_Fixed end_angle; } FT_PaintSweepGradient ; A structure representing a PaintSweepGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled with a sweep gradient from start_angle to end_angle . fields colorline The FT_ColorLine information for this paint, i.e., the list of color stops along the gradient. center The center of the sweep gradient in font units represented as a vector of 16.16 fixed-point values. start_angle The start angle of the sweep gradient in 16.16 fixed-point format specifying degrees divided by 180.0 (as in the spec). Multiply by 180.0f to receive degrees value. Values are given counter-clockwise, starting from the (positive) y axis. end_angle The end angle of the sweep gradient in 16.16 fixed-point format specifying degrees divided by 180.0 (as in the spec). Multiply by 180.0f to receive degrees value. Values are given counter-clockwise, starting from the (positive) y axis. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintGlyph \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintGlyph_ { FT_OpaquePaint paint; FT_UInt glyphID; } FT_PaintGlyph ; A structure representing a \u2018COLR\u2019 v1 PaintGlyph paint table. fields paint An opaque paint object pointing to a Paint table that serves as the fill for the glyph ID. glyphID The glyph ID from the \u2018glyf\u2019 table, which serves as the contour information that is filled with paint. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintColrGlyph \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintColrGlyph_ { FT_UInt glyphID; } FT_PaintColrGlyph ; A structure representing a \u2018COLR\u2019 v1 PaintColorGlyph paint table. fields glyphID The glyph ID from the BaseGlyphV1List table that is drawn for this paint. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintTransform \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintTransform_ { FT_OpaquePaint paint; FT_Affine23 affine; } FT_PaintTransform ; A structure representing a \u2018COLR\u2019 v1 PaintTransform paint table. fields paint An opaque paint that is subject to being transformed. affine A 2x3 transformation matrix in FT_Affine23 format containing 16.16 fixed-point values. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintTranslate \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintTranslate_ { FT_OpaquePaint paint; FT_Fixed dx; FT_Fixed dy; } FT_PaintTranslate ; A structure representing a \u2018COLR\u2019 v1 PaintTranslate paint table. Used for translating downstream paints by a given x and y delta. fields paint An FT_OpaquePaint object referencing the paint that is to be rotated. dx Translation in x direction in font units represented as a 16.16 fixed-point value. dy Translation in y direction in font units represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintScale \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintScale_ { FT_OpaquePaint paint; FT_Fixed scale_x; FT_Fixed scale_y; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintScale ; A structure representing all of the \u2018COLR\u2019 v1 \u2018PaintScale*\u2019 paint tables. Used for scaling downstream paints by a given x and y scale, with a given center. This structure is used for all \u2018PaintScale*\u2019 types that are part of specification; fields of this structure are filled accordingly. If there is a center, the center values are set, otherwise they are set to the zero coordinate. If the source font file has \u2018PaintScaleUniform*\u2019 set, the scale values are set accordingly to the same value. fields paint An FT_OpaquePaint object referencing the paint that is to be scaled. scale_x Scale factor in x direction represented as a 16.16 fixed-point value. scale_y Scale factor in y direction represented as a 16.16 fixed-point value. center_x x coordinate of center point to scale from represented as a 16.16 fixed-point value. center_y y coordinate of center point to scale from represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward-compatibility of both the API and ABI. FT_PaintRotate \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintRotate_ { FT_OpaquePaint paint; FT_Fixed angle; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintRotate ; A structure representing a \u2018COLR\u2019 v1 PaintRotate paint table. Used for rotating downstream paints with a given center and angle. fields paint An FT_OpaquePaint object referencing the paint that is to be rotated. angle The rotation angle that is to be applied in degrees divided by 180.0 (as in the spec) represented as a 16.16 fixed-point value. Multiply by 180.0f to receive degrees value. center_x The x coordinate of the pivot point of the rotation in font units) represented as a 16.16 fixed-point value. center_y The y coordinate of the pivot point of the rotation in font units represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintSkew \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSkew_ { FT_OpaquePaint paint; FT_Fixed x_skew_angle; FT_Fixed y_skew_angle; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintSkew ; A structure representing a \u2018COLR\u2019 v1 PaintSkew paint table. Used for skewing or shearing downstream paints by a given center and angle. fields paint An FT_OpaquePaint object referencing the paint that is to be skewed. x_skew_angle The skewing angle in x direction in degrees divided by 180.0 (as in the spec) represented as a 16.16 fixed-point value. Multiply by 180.0f to receive degrees. y_skew_angle The skewing angle in y direction in degrees divided by 180.0 (as in the spec) represented as a 16.16 fixed-point value. Multiply by 180.0f to receive degrees. center_x The x coordinate of the pivot point of the skew in font units represented as a 16.16 fixed-point value. center_y The y coordinate of the pivot point of the skew in font units represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintComposite \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintComposite_ { FT_OpaquePaint source_paint; FT_Composite_Mode composite_mode; FT_OpaquePaint backdrop_paint; } FT_PaintComposite ; A structure representing a \u2018COLR'v1 PaintComposite paint table. Used for compositing two paints in a 'COLR\u2019 v1 directed acycling graph. fields source_paint An FT_OpaquePaint object referencing the source that is to be composited. composite_mode An FT_Composite_Mode enum value determining the composition operation. backdrop_paint An FT_OpaquePaint object referencing the backdrop paint that source_paint is composited onto. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_COLR_Paint \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_COLR_Paint_ { FT_PaintFormat format; union { FT_PaintColrLayers colr_layers; FT_PaintGlyph glyph; FT_PaintSolid solid; FT_PaintLinearGradient linear_gradient; FT_PaintRadialGradient radial_gradient; FT_PaintSweepGradient sweep_gradient; FT_PaintTransform transform; FT_PaintTranslate translate; FT_PaintScale scale; FT_PaintRotate rotate; FT_PaintSkew skew; FT_PaintComposite composite; FT_PaintColrGlyph colr_glyph; } u; } FT_COLR_Paint ; A union object representing format and details of a paint table of a \u2018COLR\u2019 v1 font, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. Use FT_Get_Paint to retrieve a FT_COLR_Paint for an FT_OpaquePaint object. fields format The gradient format for this Paint structure. u Union of all paint table types: FT_PaintColrLayers FT_PaintGlyph FT_PaintSolid FT_PaintLinearGradient FT_PaintRadialGradient FT_PaintSweepGradient FT_PaintTransform FT_PaintTranslate FT_PaintRotate FT_PaintSkew FT_PaintComposite * FT_PaintColrGlyph since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Color_Root_Transform \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_Color_Root_Transform_ { FT_COLOR_INCLUDE_ROOT_TRANSFORM , FT_COLOR_NO_ROOT_TRANSFORM , FT_COLOR_ROOT_TRANSFORM_MAX } FT_Color_Root_Transform ; An enumeration to specify whether FT_Get_Color_Glyph_Paint is to return a root transform to configure the client's graphics context matrix. values FT_COLOR_INCLUDE_ROOT_TRANSFORM Do include the root transform as the initial FT_COLR_Paint object. FT_COLOR_NO_ROOT_TRANSFORM Do not output an initial root transform. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ClipBox \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ClipBox_ { FT_Vector bottom_left; FT_Vector top_left; FT_Vector top_right; FT_Vector bottom_right; } FT_ClipBox ; A structure representing a \u2018COLR\u2019 v1 \u2018ClipBox\u2019 table. \u2018COLR\u2019 v1 glyphs may optionally define a clip box for aiding allocation or defining a maximum drawable region. Use FT_Get_Color_Glyph_ClipBox to retrieve it. fields bottom_left The bottom left corner of the clip box as an FT_Vector with fixed-point coordinates in 26.6 format. top_left The top left corner of the clip box as an FT_Vector with fixed-point coordinates in 26.6 format. top_right The top right corner of the clip box as an FT_Vector with fixed-point coordinates in 26.6 format. bottom_right The bottom right corner of the clip box as an FT_Vector with fixed-point coordinates in 26.6 format. since 2.12 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Color_Glyph_Paint \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_Paint ( FT_Face face, FT_UInt base_glyph, FT_Color_Root_Transform root_transform, FT_OpaquePaint * paint ); This is the starting point and interface to color gradient information in a \u2018COLR\u2019 v1 table in OpenType fonts to recursively retrieve the paint tables for the directed acyclic graph of a colored glyph, given a glyph ID. https://github.com/googlefonts/colr-gradients-spec In a \u2018COLR\u2019 v1 font, each color glyph defines a directed acyclic graph of nested paint tables, such as PaintGlyph , PaintSolid , PaintLinearGradient , PaintRadialGradient , and so on. Using this function and specifying a glyph ID, one retrieves the root paint table for this glyph ID. This function allows control whether an initial root transform is returned to configure scaling, transform, and translation correctly on the client's graphics context. The initial root transform is computed and returned according to the values configured for FT_Size and FT_Set_Transform on the FT_Face object, see below for details of the root_transform parameter. This has implications for a client \u2018COLR\u2019 v1 implementation: When this function returns an initially computed root transform, at the time of executing the FT_PaintGlyph operation, the contours should be retrieved using FT_Load_Glyph at unscaled, untransformed size. This is because the root transform applied to the graphics context will take care of correct scaling. Alternatively, to allow hinting of contours, at the time of executing FT_Load_Glyph , the current graphics context transformation matrix can be decomposed into a scaling matrix and a remainder, and FT_Load_Glyph can be used to retrieve the contours at scaled size. Care must then be taken to blit or clip to the graphics context with taking this remainder transformation into account. input face A handle to the parent face object. base_glyph The glyph index for which to retrieve the root paint table. root_transform Specifies whether an initially computed root is returned by the FT_PaintTransform operation to account for the activated size (see FT_Activate_Size ) and the configured transform and translate (see FT_Set_Transform ). This root transform is returned before nodes of the glyph graph of the font are returned. Subsequent FT_COLR_Paint structures contain unscaled and untransformed values. The inserted root transform enables the client application to apply an initial transform to its graphics context. When executing subsequent FT_COLR_Paint operations, values from FT_COLR_Paint operations will ultimately be correctly scaled because of the root transform applied to the graphics context. Use FT_COLOR_INCLUDE_ROOT_TRANSFORM to include the root transform, use FT_COLOR_NO_ROOT_TRANSFORM to not include it. The latter may be useful when traversing the \u2018COLR\u2019 v1 glyph graph and reaching a FT_PaintColrGlyph . When recursing into FT_PaintColrGlyph and painting that inline, no additional root transform is needed as it has already been applied to the graphics context at the beginning of drawing this glyph. output paint The FT_OpaquePaint object that references the actual paint table. The respective actual FT_COLR_Paint object is retrieved via FT_Get_Paint . return Value 1 if everything is OK. If no color glyph is found, or the root paint could not be retrieved, value 0 gets returned. In case of an error, value 0 is returned also. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Color_Glyph_ClipBox \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_ClipBox ( FT_Face face, FT_UInt base_glyph, FT_ClipBox * clip_box ); Search for a \u2018COLR\u2019 v1 clip box for the specified base_glyph and fill the clip_box parameter with the \u2018COLR\u2019 v1 \u2018ClipBox\u2019 information if one is found. input face A handle to the parent face object. base_glyph The glyph index for which to retrieve the clip box. output clip_box The clip box for the requested base_glyph if one is found. The clip box is computed taking scale and transformations configured on the FT_Face into account. FT_ClipBox contains FT_Vector values in 26.6 format. return Value 1 if a clip box is found. If no clip box is found or an error occured, value 0 is returned. note To retrieve the clip box in font units, reset scale to units-per-em and remove transforms configured using FT_Set_Transform . since 2.12 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Paint_Layers \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Paint_Layers ( FT_Face face, FT_LayerIterator * iterator, FT_OpaquePaint * paint ); Access the layers of a PaintColrLayers table. If the root paint of a color glyph, or a nested paint of a \u2018COLR\u2019 glyph is a PaintColrLayers table, this function retrieves the layers of the PaintColrLayers table. The FT_PaintColrLayers object contains an FT_LayerIterator , which is used here to iterate over the layers. Each layer is returned as an FT_OpaquePaint object, which then can be used with FT_Get_Paint to retrieve the actual paint object. input face A handle to the parent face object. inout iterator The FT_LayerIterator from an FT_PaintColrLayers object, for which the layers are to be retrieved. The internal state of the iterator is incremented after one call to this function for retrieving one layer. output paint The FT_OpaquePaint object that references the actual paint table. The respective actual FT_COLR_Paint object is retrieved via FT_Get_Paint . return Value 1 if everything is OK. Value 0 gets returned when the paint object can not be retrieved or any other error occurs. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Colorline_Stops \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Colorline_Stops ( FT_Face face, FT_ColorStop * color_stop, FT_ColorStopIterator * iterator ); This is an interface to color gradient information in a \u2018COLR\u2019 v1 table in OpenType fonts to iteratively retrieve the gradient and solid fill information for colored glyph layers for a specified glyph ID. https://github.com/googlefonts/colr-gradients-spec input face A handle to the parent face object. inout iterator The retrieved FT_ColorStopIterator , configured on an FT_ColorLine , which in turn got retrieved via paint information in FT_PaintLinearGradient or FT_PaintRadialGradient . output color_stop Color index and alpha value for the retrieved color stop. return Value 1 if everything is OK. If there are no more color stops, value 0 gets returned. In case of an error, value 0 is returned also. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Paint \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Paint ( FT_Face face, FT_OpaquePaint opaque_paint, FT_COLR_Paint * paint ); Access the details of a paint using an FT_OpaquePaint opaque paint object, which internally stores the offset to the respective Paint object in the \u2018COLR\u2019 table. input face A handle to the parent face object. opaque_paint The opaque paint object for which the underlying FT_COLR_Paint data is to be retrieved. output paint The specific FT_COLR_Paint object containing information coming from one of the font's Paint* tables. return Value 1 if everything is OK. Value 0 if no details can be found for this paint or any other error occured. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI.","title":"Glyph Layer Management"},{"location":"ft2-layer_management.html#glyph-layer-management","text":"","title":"Glyph Layer Management"},{"location":"ft2-layer_management.html#synopsis","text":"The functions described here allow access of colored glyph layer data in OpenType's \u2018COLR\u2019 tables.","title":"Synopsis"},{"location":"ft2-layer_management.html#ft_layeriterator","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_LayerIterator_ { FT_UInt num_layers; FT_UInt layer; FT_Byte * p; } FT_LayerIterator ; This iterator object is needed for FT_Get_Color_Glyph_Layer .","title":"FT_LayerIterator"},{"location":"ft2-layer_management.html#ft_get_color_glyph_layer","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_Layer ( FT_Face face, FT_UInt base_glyph, FT_UInt *aglyph_index, FT_UInt *acolor_index, FT_LayerIterator * iterator ); This is an interface to the \u2018COLR\u2019 table in OpenType fonts to iteratively retrieve the colored glyph layers associated with the current glyph slot. https://docs.microsoft.com/en-us/typography/opentype/spec/colr The glyph layer data for a given glyph index, if present, provides an alternative, multi-color glyph representation: Instead of rendering the outline or bitmap with the given glyph index, glyphs with the indices and colors returned by this function are rendered layer by layer. The returned elements are ordered in the z direction from bottom to top; the 'n'th element should be rendered with the associated palette color and blended on top of the already rendered layers (elements 0, 1, \u2026, n-1).","title":"FT_Get_Color_Glyph_Layer"},{"location":"ft2-layer_management.html#ft_paintformat","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_PaintFormat_ { FT_COLR_PAINTFORMAT_COLR_LAYERS = 1, FT_COLR_PAINTFORMAT_SOLID = 2, FT_COLR_PAINTFORMAT_LINEAR_GRADIENT = 4, FT_COLR_PAINTFORMAT_RADIAL_GRADIENT = 6, FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 8, FT_COLR_PAINTFORMAT_GLYPH = 10, FT_COLR_PAINTFORMAT_COLR_GLYPH = 11, FT_COLR_PAINTFORMAT_TRANSFORM = 12, FT_COLR_PAINTFORMAT_TRANSLATE = 14, FT_COLR_PAINTFORMAT_SCALE = 16, FT_COLR_PAINTFORMAT_ROTATE = 24, FT_COLR_PAINTFORMAT_SKEW = 28, FT_COLR_PAINTFORMAT_COMPOSITE = 32, FT_COLR_PAINT_FORMAT_MAX = 33, FT_COLR_PAINTFORMAT_UNSUPPORTED = 255 } FT_PaintFormat ; Enumeration describing the different paint format types of the v1 extensions to the \u2018COLR\u2019 table, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The enumeration values losely correspond with the format numbers of the specification: FreeType always returns a fully specified \u2018Paint\u2019 structure for the \u2018Transform\u2019, \u2018Translate\u2019, \u2018Scale\u2019, \u2018Rotate\u2019, and \u2018Skew\u2019 table types even though the specification has different formats depending on whether or not a center is specified, whether the scale is uniform in x and y direction or not, etc. Also, only non-variable format identifiers are listed in this enumeration; as soon as support for variable \u2018COLR\u2019 v1 fonts is implemented, interpolation is performed dependent on axis coordinates, which are configured on the FT_Face through FT_Set_Var_Design_Coordinates . This implies that always static, readily interpolated values are returned in the \u2018Paint\u2019 structures.","title":"FT_PaintFormat"},{"location":"ft2-layer_management.html#ft_colorstopiterator","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorStopIterator_ { FT_UInt num_color_stops; FT_UInt current_color_stop; FT_Byte * p; } FT_ColorStopIterator ; This iterator object is needed for FT_Get_Colorline_Stops . It keeps state while iterating over the stops of an FT_ColorLine , representing the ColorLine struct of the v1 extensions to \u2018COLR\u2019, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019.","title":"FT_ColorStopIterator"},{"location":"ft2-layer_management.html#ft_colorindex","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorIndex_ { FT_UInt16 palette_index; FT_F2Dot14 alpha; } FT_ColorIndex ; A structure representing a ColorIndex value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019.","title":"FT_ColorIndex"},{"location":"ft2-layer_management.html#ft_colorstop","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorStop_ { FT_F2Dot14 stop_offset; FT_ColorIndex color; } FT_ColorStop ; A structure representing a ColorStop value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019.","title":"FT_ColorStop"},{"location":"ft2-layer_management.html#ft_paintextend","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_PaintExtend_ { FT_COLR_PAINT_EXTEND_PAD = 0, FT_COLR_PAINT_EXTEND_REPEAT = 1, FT_COLR_PAINT_EXTEND_REFLECT = 2 } FT_PaintExtend ; An enumeration representing the \u2018Extend\u2019 mode of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. It describes how the gradient fill continues at the other boundaries.","title":"FT_PaintExtend"},{"location":"ft2-layer_management.html#ft_colorline","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorLine_ { FT_PaintExtend extend; FT_ColorStopIterator color_stop_iterator; } FT_ColorLine ; A structure representing a ColorLine value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. It describes a list of color stops along the defined gradient.","title":"FT_ColorLine"},{"location":"ft2-layer_management.html#ft_affine23","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Affine_23_ { FT_Fixed xx, xy, dx; FT_Fixed yx, yy, dy; } FT_Affine23 ; A structure used to store a 2x3 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is x' = x*xx + y*xy + dx y' = x*yx + y*yy + dy","title":"FT_Affine23"},{"location":"ft2-layer_management.html#ft_composite_mode","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_Composite_Mode_ { FT_COLR_COMPOSITE_CLEAR = 0, FT_COLR_COMPOSITE_SRC = 1, FT_COLR_COMPOSITE_DEST = 2, FT_COLR_COMPOSITE_SRC_OVER = 3, FT_COLR_COMPOSITE_DEST_OVER = 4, FT_COLR_COMPOSITE_SRC_IN = 5, FT_COLR_COMPOSITE_DEST_IN = 6, FT_COLR_COMPOSITE_SRC_OUT = 7, FT_COLR_COMPOSITE_DEST_OUT = 8, FT_COLR_COMPOSITE_SRC_ATOP = 9, FT_COLR_COMPOSITE_DEST_ATOP = 10, FT_COLR_COMPOSITE_XOR = 11, FT_COLR_COMPOSITE_PLUS = 12, FT_COLR_COMPOSITE_SCREEN = 13, FT_COLR_COMPOSITE_OVERLAY = 14, FT_COLR_COMPOSITE_DARKEN = 15, FT_COLR_COMPOSITE_LIGHTEN = 16, FT_COLR_COMPOSITE_COLOR_DODGE = 17, FT_COLR_COMPOSITE_COLOR_BURN = 18, FT_COLR_COMPOSITE_HARD_LIGHT = 19, FT_COLR_COMPOSITE_SOFT_LIGHT = 20, FT_COLR_COMPOSITE_DIFFERENCE = 21, FT_COLR_COMPOSITE_EXCLUSION = 22, FT_COLR_COMPOSITE_MULTIPLY = 23, FT_COLR_COMPOSITE_HSL_HUE = 24, FT_COLR_COMPOSITE_HSL_SATURATION = 25, FT_COLR_COMPOSITE_HSL_COLOR = 26, FT_COLR_COMPOSITE_HSL_LUMINOSITY = 27, FT_COLR_COMPOSITE_MAX = 28 } FT_Composite_Mode ; An enumeration listing the \u2018COLR\u2019 v1 composite modes used in FT_PaintComposite . For more details on each paint mode, see \u2018 https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators \u2019.","title":"FT_Composite_Mode"},{"location":"ft2-layer_management.html#ft_opaquepaint","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Opaque_Paint_ { FT_Byte * p; FT_Bool insert_root_transform; } FT_OpaquePaint ; A structure representing an offset to a Paint value stored in any of the paint tables of a \u2018COLR\u2019 v1 font. Compare Offset<24> there. When \u2018COLR\u2019 v1 paint tables represented by FreeType objects such as FT_PaintColrLayers , FT_PaintComposite , or FT_PaintTransform reference downstream nested paint tables, we do not immediately retrieve them but encapsulate their location in this type. Use FT_Get_Paint to retrieve the actual FT_COLR_Paint object that describes the details of the respective paint table.","title":"FT_OpaquePaint"},{"location":"ft2-layer_management.html#ft_paintcolrlayers","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintColrLayers_ { FT_LayerIterator layer_iterator; } FT_PaintColrLayers ; A structure representing a PaintColrLayers table of a \u2018COLR\u2019 v1 font. This table describes a set of layers that are to be composited with composite mode FT_COLR_COMPOSITE_SRC_OVER . The return value of this function is an FT_LayerIterator initialized so that it can be used with FT_Get_Paint_Layers to retrieve the FT_OpaquePaint objects as references to each layer.","title":"FT_PaintColrLayers"},{"location":"ft2-layer_management.html#ft_paintsolid","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSolid_ { FT_ColorIndex color; } FT_PaintSolid ; A structure representing a PaintSolid value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. Using a PaintSolid value means that the glyph layer filled with this paint is solid-colored and does not contain a gradient.","title":"FT_PaintSolid"},{"location":"ft2-layer_management.html#ft_paintlineargradient","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintLinearGradient_ { FT_ColorLine colorline; /* TODO: Potentially expose those as x0, y0 etc. */ FT_Vector p0; FT_Vector p1; FT_Vector p2; } FT_PaintLinearGradient ; A structure representing a PaintLinearGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled with a linear gradient.","title":"FT_PaintLinearGradient"},{"location":"ft2-layer_management.html#ft_paintradialgradient","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintRadialGradient_ { FT_ColorLine colorline; FT_Vector c0; FT_Pos r0; FT_Vector c1; FT_Pos r1; } FT_PaintRadialGradient ; A structure representing a PaintRadialGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled filled with a radial gradient.","title":"FT_PaintRadialGradient"},{"location":"ft2-layer_management.html#ft_paintsweepgradient","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSweepGradient_ { FT_ColorLine colorline; FT_Vector center; FT_Fixed start_angle; FT_Fixed end_angle; } FT_PaintSweepGradient ; A structure representing a PaintSweepGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled with a sweep gradient from start_angle to end_angle .","title":"FT_PaintSweepGradient"},{"location":"ft2-layer_management.html#ft_paintglyph","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintGlyph_ { FT_OpaquePaint paint; FT_UInt glyphID; } FT_PaintGlyph ; A structure representing a \u2018COLR\u2019 v1 PaintGlyph paint table.","title":"FT_PaintGlyph"},{"location":"ft2-layer_management.html#ft_paintcolrglyph","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintColrGlyph_ { FT_UInt glyphID; } FT_PaintColrGlyph ; A structure representing a \u2018COLR\u2019 v1 PaintColorGlyph paint table.","title":"FT_PaintColrGlyph"},{"location":"ft2-layer_management.html#ft_painttransform","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintTransform_ { FT_OpaquePaint paint; FT_Affine23 affine; } FT_PaintTransform ; A structure representing a \u2018COLR\u2019 v1 PaintTransform paint table.","title":"FT_PaintTransform"},{"location":"ft2-layer_management.html#ft_painttranslate","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintTranslate_ { FT_OpaquePaint paint; FT_Fixed dx; FT_Fixed dy; } FT_PaintTranslate ; A structure representing a \u2018COLR\u2019 v1 PaintTranslate paint table. Used for translating downstream paints by a given x and y delta.","title":"FT_PaintTranslate"},{"location":"ft2-layer_management.html#ft_paintscale","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintScale_ { FT_OpaquePaint paint; FT_Fixed scale_x; FT_Fixed scale_y; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintScale ; A structure representing all of the \u2018COLR\u2019 v1 \u2018PaintScale*\u2019 paint tables. Used for scaling downstream paints by a given x and y scale, with a given center. This structure is used for all \u2018PaintScale*\u2019 types that are part of specification; fields of this structure are filled accordingly. If there is a center, the center values are set, otherwise they are set to the zero coordinate. If the source font file has \u2018PaintScaleUniform*\u2019 set, the scale values are set accordingly to the same value.","title":"FT_PaintScale"},{"location":"ft2-layer_management.html#ft_paintrotate","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintRotate_ { FT_OpaquePaint paint; FT_Fixed angle; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintRotate ; A structure representing a \u2018COLR\u2019 v1 PaintRotate paint table. Used for rotating downstream paints with a given center and angle.","title":"FT_PaintRotate"},{"location":"ft2-layer_management.html#ft_paintskew","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSkew_ { FT_OpaquePaint paint; FT_Fixed x_skew_angle; FT_Fixed y_skew_angle; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintSkew ; A structure representing a \u2018COLR\u2019 v1 PaintSkew paint table. Used for skewing or shearing downstream paints by a given center and angle.","title":"FT_PaintSkew"},{"location":"ft2-layer_management.html#ft_paintcomposite","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintComposite_ { FT_OpaquePaint source_paint; FT_Composite_Mode composite_mode; FT_OpaquePaint backdrop_paint; } FT_PaintComposite ; A structure representing a \u2018COLR'v1 PaintComposite paint table. Used for compositing two paints in a 'COLR\u2019 v1 directed acycling graph.","title":"FT_PaintComposite"},{"location":"ft2-layer_management.html#ft_colr_paint","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_COLR_Paint_ { FT_PaintFormat format; union { FT_PaintColrLayers colr_layers; FT_PaintGlyph glyph; FT_PaintSolid solid; FT_PaintLinearGradient linear_gradient; FT_PaintRadialGradient radial_gradient; FT_PaintSweepGradient sweep_gradient; FT_PaintTransform transform; FT_PaintTranslate translate; FT_PaintScale scale; FT_PaintRotate rotate; FT_PaintSkew skew; FT_PaintComposite composite; FT_PaintColrGlyph colr_glyph; } u; } FT_COLR_Paint ; A union object representing format and details of a paint table of a \u2018COLR\u2019 v1 font, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. Use FT_Get_Paint to retrieve a FT_COLR_Paint for an FT_OpaquePaint object.","title":"FT_COLR_Paint"},{"location":"ft2-layer_management.html#ft_color_root_transform","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_Color_Root_Transform_ { FT_COLOR_INCLUDE_ROOT_TRANSFORM , FT_COLOR_NO_ROOT_TRANSFORM , FT_COLOR_ROOT_TRANSFORM_MAX } FT_Color_Root_Transform ; An enumeration to specify whether FT_Get_Color_Glyph_Paint is to return a root transform to configure the client's graphics context matrix.","title":"FT_Color_Root_Transform"},{"location":"ft2-layer_management.html#ft_clipbox","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ClipBox_ { FT_Vector bottom_left; FT_Vector top_left; FT_Vector top_right; FT_Vector bottom_right; } FT_ClipBox ; A structure representing a \u2018COLR\u2019 v1 \u2018ClipBox\u2019 table. \u2018COLR\u2019 v1 glyphs may optionally define a clip box for aiding allocation or defining a maximum drawable region. Use FT_Get_Color_Glyph_ClipBox to retrieve it.","title":"FT_ClipBox"},{"location":"ft2-layer_management.html#ft_get_color_glyph_paint","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_Paint ( FT_Face face, FT_UInt base_glyph, FT_Color_Root_Transform root_transform, FT_OpaquePaint * paint ); This is the starting point and interface to color gradient information in a \u2018COLR\u2019 v1 table in OpenType fonts to recursively retrieve the paint tables for the directed acyclic graph of a colored glyph, given a glyph ID. https://github.com/googlefonts/colr-gradients-spec In a \u2018COLR\u2019 v1 font, each color glyph defines a directed acyclic graph of nested paint tables, such as PaintGlyph , PaintSolid , PaintLinearGradient , PaintRadialGradient , and so on. Using this function and specifying a glyph ID, one retrieves the root paint table for this glyph ID. This function allows control whether an initial root transform is returned to configure scaling, transform, and translation correctly on the client's graphics context. The initial root transform is computed and returned according to the values configured for FT_Size and FT_Set_Transform on the FT_Face object, see below for details of the root_transform parameter. This has implications for a client \u2018COLR\u2019 v1 implementation: When this function returns an initially computed root transform, at the time of executing the FT_PaintGlyph operation, the contours should be retrieved using FT_Load_Glyph at unscaled, untransformed size. This is because the root transform applied to the graphics context will take care of correct scaling. Alternatively, to allow hinting of contours, at the time of executing FT_Load_Glyph , the current graphics context transformation matrix can be decomposed into a scaling matrix and a remainder, and FT_Load_Glyph can be used to retrieve the contours at scaled size. Care must then be taken to blit or clip to the graphics context with taking this remainder transformation into account.","title":"FT_Get_Color_Glyph_Paint"},{"location":"ft2-layer_management.html#ft_get_color_glyph_clipbox","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_ClipBox ( FT_Face face, FT_UInt base_glyph, FT_ClipBox * clip_box ); Search for a \u2018COLR\u2019 v1 clip box for the specified base_glyph and fill the clip_box parameter with the \u2018COLR\u2019 v1 \u2018ClipBox\u2019 information if one is found.","title":"FT_Get_Color_Glyph_ClipBox"},{"location":"ft2-layer_management.html#ft_get_paint_layers","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Paint_Layers ( FT_Face face, FT_LayerIterator * iterator, FT_OpaquePaint * paint ); Access the layers of a PaintColrLayers table. If the root paint of a color glyph, or a nested paint of a \u2018COLR\u2019 glyph is a PaintColrLayers table, this function retrieves the layers of the PaintColrLayers table. The FT_PaintColrLayers object contains an FT_LayerIterator , which is used here to iterate over the layers. Each layer is returned as an FT_OpaquePaint object, which then can be used with FT_Get_Paint to retrieve the actual paint object.","title":"FT_Get_Paint_Layers"},{"location":"ft2-layer_management.html#ft_get_colorline_stops","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Colorline_Stops ( FT_Face face, FT_ColorStop * color_stop, FT_ColorStopIterator * iterator ); This is an interface to color gradient information in a \u2018COLR\u2019 v1 table in OpenType fonts to iteratively retrieve the gradient and solid fill information for colored glyph layers for a specified glyph ID. https://github.com/googlefonts/colr-gradients-spec","title":"FT_Get_Colorline_Stops"},{"location":"ft2-layer_management.html#ft_get_paint","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Paint ( FT_Face face, FT_OpaquePaint opaque_paint, FT_COLR_Paint * paint ); Access the details of a paint using an FT_OpaquePaint opaque paint object, which internally stores the offset to the respective Paint object in the \u2018COLR\u2019 table.","title":"FT_Get_Paint"},{"location":"ft2-lcd_rendering.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb Subpixel Rendering Subpixel Rendering \u00b6 Synopsis \u00b6 FreeType provides two alternative subpixel rendering technologies. Should you define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your ftoption.h file, this enables ClearType-style rendering. Otherwise, Harmony LCD rendering is enabled. These technologies are controlled differently and API described below, although always available, performs its function when appropriate method is enabled and does nothing otherwise. ClearType-style LCD rendering exploits the color-striped structure of LCD pixels, increasing the available resolution in the direction of the stripe (usually horizontal RGB) by a factor of 3. Using the subpixel coverages unfiltered can create severe color fringes especially when rendering thin features. Indeed, to produce black-on-white text, the nearby color subpixels must be dimmed evenly. Therefore, an equalizing 5-tap FIR filter should be applied to subpixel coverages regardless of pixel boundaries and should have these properties: It should be symmetrical, like { a, b, c, b, a }, to avoid any shifts in appearance. It should be color-balanced, meaning a + b = c, to reduce color fringes by distributing the computed coverage for one subpixel to all subpixels equally. It should be normalized, meaning 2a + 2b + c = 1.0 to maintain overall brightness. Boxy 3-tap filter {0, \u2153, \u2153, \u2153, 0} is sharper but is less forgiving of non-ideal gamma curves of a screen (and viewing angles), beveled filters are fuzzier but more tolerant. Use the FT_Library_SetLcdFilter or FT_Library_SetLcdFilterWeights API to specify a low-pass filter, which is then applied to subpixel-rendered bitmaps generated through FT_Render_Glyph . Harmony LCD rendering is suitable to panels with any regular subpixel structure, not just monitors with 3 color striped subpixels, as long as the color subpixels have fixed positions relative to the pixel center. In this case, each color channel can be rendered separately after shifting the outline opposite to the subpixel shift so that the coverage maps are aligned. This method is immune to color fringes because the shifts do not change integral coverage. The subpixel geometry must be specified by xy-coordinates for each subpixel. By convention they may come in the RGB order: {{-\u2153, 0}, {0, 0}, {\u2153, 0}} for standard RGB striped panel or {{-\u2159, \u00bc}, {-\u2159, -\u00bc}, {\u2153, 0}} for a certain PenTile panel. Use the FT_Library_SetLcdGeometry API to specify subpixel positions. If one follows the RGB order convention, the same order applies to the resulting FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V bitmaps. Note, however, that the coordinate frame for the latter must be rotated clockwise. Harmony with default LCD geometry is equivalent to ClearType with light filter. As a result of ClearType filtering or Harmony shifts, the resulting dimensions of LCD bitmaps can be slightly wider or taller than the dimensions the original outline with regard to the pixel grid. For example, for FT_RENDER_MODE_LCD , the filter adds 2 subpixels to the left, and 2 subpixels to the right. The bitmap offset values are adjusted accordingly, so clients shouldn't need to modify their layout and glyph positioning code when enabling the filter. The ClearType and Harmony rendering is applicable to glyph bitmaps rendered through FT_Render_Glyph , FT_Load_Glyph , FT_Load_Char , and FT_Glyph_To_Bitmap , when FT_RENDER_MODE_LCD or FT_RENDER_MODE_LCD_V is specified. This API does not control FT_Outline_Render and FT_Outline_Get_Bitmap . The described algorithms can completely remove color artefacts when combined with gamma-corrected alpha blending in linear space. Each of the 3 alpha values (subpixels) must by independently used to blend one color channel. That is, red alpha blends the red channel of the text color with the red channel of the background pixel. FT_LcdFilter \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). typedef enum FT_LcdFilter_ { FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_LIGHT = 2, FT_LCD_FILTER_LEGACY1 = 3, FT_LCD_FILTER_LEGACY = 16, FT_LCD_FILTER_MAX /* do not remove */ } FT_LcdFilter ; A list of values to identify various types of LCD filters. values FT_LCD_FILTER_NONE Do not perform filtering. When used with subpixel rendering, this results in sometimes severe color fringes. FT_LCD_FILTER_DEFAULT This is a beveled, normalized, and color-balanced five-tap filter with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256th units. FT_LCD_FILTER_LIGHT this is a boxy, normalized, and color-balanced three-tap filter with weights of [0x00 0x55 0x56 0x55 0x00] in 1/256th units. FT_LCD_FILTER_LEGACY FT_LCD_FILTER_LEGACY1 This filter corresponds to the original libXft color filter. It provides high contrast output but can exhibit really bad color fringes if glyphs are not extremely well hinted to the pixel grid. This filter is only provided for comparison purposes, and might be disabled or stay unsupported in the future. The second value is provided for compatibility with FontConfig, which historically used different enumeration, sometimes incorrectly forwarded to FreeType. since 2.3.0 ( FT_LCD_FILTER_LEGACY1 since 2.6.2) FT_Library_SetLcdFilter \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdFilter ( FT_Library library, FT_LcdFilter filter ); This function is used to change filter applied to LCD decimated bitmaps, like the ones used when calling FT_Render_Glyph with FT_RENDER_MODE_LCD or FT_RENDER_MODE_LCD_V . input library A handle to the target library instance. filter The filter type. You can use FT_LCD_FILTER_NONE here to disable this feature, or FT_LCD_FILTER_DEFAULT to use a default filter that should work well on most LCD screens. return FreeType error code. 0 means success. note Since 2.10.3 the LCD filtering is enabled with FT_LCD_FILTER_DEFAULT . It is no longer necessary to call this function explicitly except to choose a different filter or disable filtering altogether with FT_LCD_FILTER_NONE . This function does nothing but returns FT_Err_Unimplemented_Feature if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library. since 2.3.0 FT_Library_SetLcdFilterWeights \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdFilterWeights ( FT_Library library, unsigned char *weights ); This function can be used to enable LCD filter with custom weights, instead of using presets in FT_Library_SetLcdFilter . input library A handle to the target library instance. weights A pointer to an array; the function copies the first five bytes and uses them to specify the filter weights in 1/256th units. return FreeType error code. 0 means success. note This function does nothing but returns FT_Err_Unimplemented_Feature if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library. LCD filter weights can also be set per face using FT_Face_Properties with FT_PARAM_TAG_LCD_FILTER_WEIGHTS . since 2.4.0 FT_LcdFiveTapFilter \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). # define FT_LCD_FILTER_FIVE_TAPS 5 typedef FT_Byte FT_LcdFiveTapFilter [FT_LCD_FILTER_FIVE_TAPS]; A typedef for passing the five LCD filter weights to FT_Face_Properties within an FT_Parameter structure. since 2.8 FT_Library_SetLcdGeometry \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdGeometry ( FT_Library library, FT_Vector sub[3] ); This function can be used to modify default positions of color subpixels, which controls Harmony LCD rendering. input library A handle to the target library instance. sub A pointer to an array of 3 vectors in 26.6 fractional pixel format; the function modifies the default values, see the note below. return FreeType error code. 0 means success. note Subpixel geometry examples: {{-21, 0}, {0, 0}, {21, 0}} is the default, corresponding to 3 color stripes shifted by a third of a pixel. This could be an RGB panel. {{21, 0}, {0, 0}, {-21, 0}} looks the same as the default but can specify a BGR panel instead, while keeping the bitmap in the same RGB888 format. {{0, 21}, {0, 0}, {0, -21}} is the vertical RGB, but the bitmap stays RGB888 as a result. {{-11, 16}, {-11, -16}, {22, 0}} is a certain PenTile arrangement. This function does nothing and returns FT_Err_Unimplemented_Feature in the context of ClearType-style subpixel rendering when FT_CONFIG_OPTION_SUBPIXEL_RENDERING is defined in your build of the library. since 2.10.0","title":"Subpixel Rendering"},{"location":"ft2-lcd_rendering.html#subpixel-rendering","text":"","title":"Subpixel Rendering"},{"location":"ft2-lcd_rendering.html#synopsis","text":"FreeType provides two alternative subpixel rendering technologies. Should you define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your ftoption.h file, this enables ClearType-style rendering. Otherwise, Harmony LCD rendering is enabled. These technologies are controlled differently and API described below, although always available, performs its function when appropriate method is enabled and does nothing otherwise. ClearType-style LCD rendering exploits the color-striped structure of LCD pixels, increasing the available resolution in the direction of the stripe (usually horizontal RGB) by a factor of 3. Using the subpixel coverages unfiltered can create severe color fringes especially when rendering thin features. Indeed, to produce black-on-white text, the nearby color subpixels must be dimmed evenly. Therefore, an equalizing 5-tap FIR filter should be applied to subpixel coverages regardless of pixel boundaries and should have these properties: It should be symmetrical, like { a, b, c, b, a }, to avoid any shifts in appearance. It should be color-balanced, meaning a + b = c, to reduce color fringes by distributing the computed coverage for one subpixel to all subpixels equally. It should be normalized, meaning 2a + 2b + c = 1.0 to maintain overall brightness. Boxy 3-tap filter {0, \u2153, \u2153, \u2153, 0} is sharper but is less forgiving of non-ideal gamma curves of a screen (and viewing angles), beveled filters are fuzzier but more tolerant. Use the FT_Library_SetLcdFilter or FT_Library_SetLcdFilterWeights API to specify a low-pass filter, which is then applied to subpixel-rendered bitmaps generated through FT_Render_Glyph . Harmony LCD rendering is suitable to panels with any regular subpixel structure, not just monitors with 3 color striped subpixels, as long as the color subpixels have fixed positions relative to the pixel center. In this case, each color channel can be rendered separately after shifting the outline opposite to the subpixel shift so that the coverage maps are aligned. This method is immune to color fringes because the shifts do not change integral coverage. The subpixel geometry must be specified by xy-coordinates for each subpixel. By convention they may come in the RGB order: {{-\u2153, 0}, {0, 0}, {\u2153, 0}} for standard RGB striped panel or {{-\u2159, \u00bc}, {-\u2159, -\u00bc}, {\u2153, 0}} for a certain PenTile panel. Use the FT_Library_SetLcdGeometry API to specify subpixel positions. If one follows the RGB order convention, the same order applies to the resulting FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V bitmaps. Note, however, that the coordinate frame for the latter must be rotated clockwise. Harmony with default LCD geometry is equivalent to ClearType with light filter. As a result of ClearType filtering or Harmony shifts, the resulting dimensions of LCD bitmaps can be slightly wider or taller than the dimensions the original outline with regard to the pixel grid. For example, for FT_RENDER_MODE_LCD , the filter adds 2 subpixels to the left, and 2 subpixels to the right. The bitmap offset values are adjusted accordingly, so clients shouldn't need to modify their layout and glyph positioning code when enabling the filter. The ClearType and Harmony rendering is applicable to glyph bitmaps rendered through FT_Render_Glyph , FT_Load_Glyph , FT_Load_Char , and FT_Glyph_To_Bitmap , when FT_RENDER_MODE_LCD or FT_RENDER_MODE_LCD_V is specified. This API does not control FT_Outline_Render and FT_Outline_Get_Bitmap . The described algorithms can completely remove color artefacts when combined with gamma-corrected alpha blending in linear space. Each of the 3 alpha values (subpixels) must by independently used to blend one color channel. That is, red alpha blends the red channel of the text color with the red channel of the background pixel.","title":"Synopsis"},{"location":"ft2-lcd_rendering.html#ft_lcdfilter","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). typedef enum FT_LcdFilter_ { FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_LIGHT = 2, FT_LCD_FILTER_LEGACY1 = 3, FT_LCD_FILTER_LEGACY = 16, FT_LCD_FILTER_MAX /* do not remove */ } FT_LcdFilter ; A list of values to identify various types of LCD filters.","title":"FT_LcdFilter"},{"location":"ft2-lcd_rendering.html#ft_library_setlcdfilter","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdFilter ( FT_Library library, FT_LcdFilter filter ); This function is used to change filter applied to LCD decimated bitmaps, like the ones used when calling FT_Render_Glyph with FT_RENDER_MODE_LCD or FT_RENDER_MODE_LCD_V .","title":"FT_Library_SetLcdFilter"},{"location":"ft2-lcd_rendering.html#ft_library_setlcdfilterweights","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdFilterWeights ( FT_Library library, unsigned char *weights ); This function can be used to enable LCD filter with custom weights, instead of using presets in FT_Library_SetLcdFilter .","title":"FT_Library_SetLcdFilterWeights"},{"location":"ft2-lcd_rendering.html#ft_lcdfivetapfilter","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). # define FT_LCD_FILTER_FIVE_TAPS 5 typedef FT_Byte FT_LcdFiveTapFilter [FT_LCD_FILTER_FIVE_TAPS]; A typedef for passing the five LCD filter weights to FT_Face_Properties within an FT_Parameter structure.","title":"FT_LcdFiveTapFilter"},{"location":"ft2-lcd_rendering.html#ft_library_setlcdgeometry","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdGeometry ( FT_Library library, FT_Vector sub[3] ); This function can be used to modify default positions of color subpixels, which controls Harmony LCD rendering.","title":"FT_Library_SetLcdGeometry"},{"location":"ft2-list_processing.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb List Processing List Processing \u00b6 Synopsis \u00b6 This section contains various definitions related to list processing using doubly-linked nodes. FT_List \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListRec_* FT_List ; A handle to a list record (see FT_ListRec ). FT_ListNode \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListNodeRec_* FT_ListNode ; Many elements and objects in FreeType are listed through an FT_List record (see FT_ListRec ). As its name suggests, an FT_ListNode is a handle to a single list element. FT_ListRec \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListRec_ { FT_ListNode head; FT_ListNode tail; } FT_ListRec ; A structure used to hold a simple doubly-linked list. These are used in many parts of FreeType. fields head The head (first element) of doubly-linked list. tail The tail (last element) of doubly-linked list. FT_ListNodeRec \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListNodeRec_ { FT_ListNode prev; FT_ListNode next; void * data; } FT_ListNodeRec ; A structure used to hold a single list element. fields prev The previous element in the list. NULL if first. next The next element in the list. NULL if last. data A typeless pointer to the listed object. FT_List_Add \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Add ( FT_List list, FT_ListNode node ); Append an element to the end of a list. inout list A pointer to the parent list. node The node to append. FT_List_Insert \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Insert ( FT_List list, FT_ListNode node ); Insert an element at the head of a list. inout list A pointer to parent list. node The node to insert. FT_List_Find \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( FT_ListNode ) FT_List_Find ( FT_List list, void * data ); Find 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_List_Remove \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Remove ( FT_List list, FT_ListNode node ); Remove 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_List_Up \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Up ( FT_List list, FT_ListNode node ); Move 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_List_Iterate \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( FT_Error ) FT_List_Iterate ( FT_List list, FT_List_Iterator iterator, void * user ); Parse 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 iterator function, called on each node of the list. user A user-supplied field that is passed as the second argument to the iterator. return The result (a FreeType error code) of the last iterator call. FT_List_Iterator \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). typedef FT_Error (* FT_List_Iterator )( FT_ListNode node, void * user ); An FT_List iterator function that 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. FT_List_Finalize \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Finalize ( FT_List list, FT_List_Destructor destroy, FT_Memory memory, void * user ); Destroy 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. Set this to NULL if not needed. memory The current memory object that handles deallocation. user A user-supplied field that is passed as the last argument to the destructor. note This function expects that all nodes added by FT_List_Add or FT_List_Insert have been dynamically allocated. FT_List_Destructor \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). typedef void (* FT_List_Destructor )( FT_Memory memory, void * data, void * user ); An FT_List iterator function that 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.","title":"List Processing"},{"location":"ft2-list_processing.html#list-processing","text":"","title":"List Processing"},{"location":"ft2-list_processing.html#synopsis","text":"This section contains various definitions related to list processing using doubly-linked nodes.","title":"Synopsis"},{"location":"ft2-list_processing.html#ft_list","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListRec_* FT_List ; A handle to a list record (see FT_ListRec ).","title":"FT_List"},{"location":"ft2-list_processing.html#ft_listnode","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListNodeRec_* FT_ListNode ; Many elements and objects in FreeType are listed through an FT_List record (see FT_ListRec ). As its name suggests, an FT_ListNode is a handle to a single list element.","title":"FT_ListNode"},{"location":"ft2-list_processing.html#ft_listrec","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListRec_ { FT_ListNode head; FT_ListNode tail; } FT_ListRec ; A structure used to hold a simple doubly-linked list. These are used in many parts of FreeType.","title":"FT_ListRec"},{"location":"ft2-list_processing.html#ft_listnoderec","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListNodeRec_ { FT_ListNode prev; FT_ListNode next; void * data; } FT_ListNodeRec ; A structure used to hold a single list element.","title":"FT_ListNodeRec"},{"location":"ft2-list_processing.html#ft_list_add","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Add ( FT_List list, FT_ListNode node ); Append an element to the end of a list.","title":"FT_List_Add"},{"location":"ft2-list_processing.html#ft_list_insert","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Insert ( FT_List list, FT_ListNode node ); Insert an element at the head of a list.","title":"FT_List_Insert"},{"location":"ft2-list_processing.html#ft_list_find","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( FT_ListNode ) FT_List_Find ( FT_List list, void * data ); Find the list node for a given listed object.","title":"FT_List_Find"},{"location":"ft2-list_processing.html#ft_list_remove","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Remove ( FT_List list, FT_ListNode node ); Remove a node from a list. This function doesn't check whether the node is in the list!","title":"FT_List_Remove"},{"location":"ft2-list_processing.html#ft_list_up","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Up ( FT_List list, FT_ListNode node ); Move a node to the head/top of a list. Used to maintain LRU lists.","title":"FT_List_Up"},{"location":"ft2-list_processing.html#ft_list_iterate","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( FT_Error ) FT_List_Iterate ( FT_List list, FT_List_Iterator iterator, void * user ); Parse 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.","title":"FT_List_Iterate"},{"location":"ft2-list_processing.html#ft_list_iterator","text":"Defined in FT_LIST_H (freetype/ftlist.h). typedef FT_Error (* FT_List_Iterator )( FT_ListNode node, void * user ); An FT_List iterator function that is called during a list parse by FT_List_Iterate .","title":"FT_List_Iterator"},{"location":"ft2-list_processing.html#ft_list_finalize","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Finalize ( FT_List list, FT_List_Destructor destroy, FT_Memory memory, void * user ); Destroy all elements in the list as well as the list itself.","title":"FT_List_Finalize"},{"location":"ft2-list_processing.html#ft_list_destructor","text":"Defined in FT_LIST_H (freetype/ftlist.h). typedef void (* FT_List_Destructor )( FT_Memory memory, void * data, void * user ); An FT_List iterator function that is called during a list finalization by FT_List_Finalize to destroy all elements in a given list.","title":"FT_List_Destructor"},{"location":"ft2-lzw.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb LZW Streams LZW Streams \u00b6 Synopsis \u00b6 In certain builds of the library, LZW compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a LZW stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of LZW-specific functions. FT_Stream_OpenLZW \u00b6 Defined in FT_LZW_H (freetype/ftlzw.h). FT_EXPORT( FT_Error ) FT_Stream_OpenLZW ( FT_Stream stream, FT_Stream source ); Open a new stream to parse LZW-compressed font files. This is mainly used to support the compressed *.pcf.Z fonts that come with XFree86. input stream The target embedding stream. source The source stream. return FreeType error code. 0 means success. note The source stream must be opened before calling this function. Calling the internal function FT_Stream_Close on the new stream will not call FT_Stream_Close on the source stream. None of the stream objects will be released to the heap. This function may return FT_Err_Unimplemented_Feature if your build of FreeType was not compiled with LZW support.","title":"LZW Streams"},{"location":"ft2-lzw.html#lzw-streams","text":"","title":"LZW Streams"},{"location":"ft2-lzw.html#synopsis","text":"In certain builds of the library, LZW compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a LZW stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of LZW-specific functions.","title":"Synopsis"},{"location":"ft2-lzw.html#ft_stream_openlzw","text":"Defined in FT_LZW_H (freetype/ftlzw.h). FT_EXPORT( FT_Error ) FT_Stream_OpenLZW ( FT_Stream stream, FT_Stream source ); Open a new stream to parse LZW-compressed font files. This is mainly used to support the compressed *.pcf.Z fonts that come with XFree86.","title":"FT_Stream_OpenLZW"},{"location":"ft2-mac_specific.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Mac Specific Interface Mac Specific Interface \u00b6 Synopsis \u00b6 The following definitions are only available if FreeType is compiled on a Macintosh. FT_New_Face_From_FOND \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FOND ( FT_Library library, Handle fond, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a FOND resource. inout library A handle to the library resource. input fond A FOND resource. face_index Only supported for the -1 \u2018sanity check\u2019 special case. output aface A handle to a new face object. return FreeType error code. 0 means success. example This function can be used to create FT_Face objects from fonts that are installed in the system as follows. fond = GetResource( 'FOND', fontName ); error = FT_New_Face_From_FOND( library, fond, 0, &face ); FT_GetFile_From_Mac_Name \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_Name ( const char * fontName, FSSpec* pathSpec, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return an FSSpec for the disk file containing the named font. input fontName Mac OS name of the font (e.g., Times New Roman Bold). output pathSpec FSSpec to the file. For passing to FT_New_Face_From_FSSpec . face_index Index of the face. For passing to FT_New_Face_From_FSSpec . return FreeType error code. 0 means success. FT_GetFile_From_Mac_ATS_Name \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_ATS_Name ( const char * fontName, FSSpec* pathSpec, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return an FSSpec for the disk file containing the named font. input fontName Mac OS name of the font in ATS framework. output pathSpec FSSpec to the file. For passing to FT_New_Face_From_FSSpec . face_index Index of the face. For passing to FT_New_Face_From_FSSpec . return FreeType error code. 0 means success. FT_GetFilePath_From_Mac_ATS_Name \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFilePath_From_Mac_ATS_Name ( const char * fontName, UInt8* path, UInt32 maxPathSize, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return a pathname of the disk file and face index for given font name that is handled by ATS framework. input fontName Mac OS name of the font in ATS framework. output path Buffer to store pathname of the file. For passing to FT_New_Face . The client must allocate this buffer before calling this function. maxPathSize Lengths of the buffer path that client allocated. face_index Index of the face. For passing to FT_New_Face . return FreeType error code. 0 means success. FT_New_Face_From_FSSpec \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FSSpec ( FT_Library library, const FSSpec *spec, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a given resource and typeface index using an FSSpec to the font file. inout library A handle to the library resource. input spec FSSpec to the font file. face_index The index of the face within the resource. The first face has index 0. output aface A handle to a new face object. return FreeType error code. 0 means success. note FT_New_Face_From_FSSpec is identical to FT_New_Face except it accepts an FSSpec instead of a path. FT_New_Face_From_FSRef \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FSRef ( FT_Library library, const FSRef *ref, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a given resource and typeface index using an FSRef to the font file. inout library A handle to the library resource. input spec FSRef to the font file. face_index The index of the face within the resource. The first face has index 0. output aface A handle to a new face object. return FreeType error code. 0 means success. note FT_New_Face_From_FSRef is identical to FT_New_Face except it accepts an FSRef instead of a path.","title":"Mac Specific Interface"},{"location":"ft2-mac_specific.html#mac-specific-interface","text":"","title":"Mac Specific Interface"},{"location":"ft2-mac_specific.html#synopsis","text":"The following definitions are only available if FreeType is compiled on a Macintosh.","title":"Synopsis"},{"location":"ft2-mac_specific.html#ft_new_face_from_fond","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FOND ( FT_Library library, Handle fond, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a FOND resource.","title":"FT_New_Face_From_FOND"},{"location":"ft2-mac_specific.html#ft_getfile_from_mac_name","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_Name ( const char * fontName, FSSpec* pathSpec, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return an FSSpec for the disk file containing the named font.","title":"FT_GetFile_From_Mac_Name"},{"location":"ft2-mac_specific.html#ft_getfile_from_mac_ats_name","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_ATS_Name ( const char * fontName, FSSpec* pathSpec, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return an FSSpec for the disk file containing the named font.","title":"FT_GetFile_From_Mac_ATS_Name"},{"location":"ft2-mac_specific.html#ft_getfilepath_from_mac_ats_name","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFilePath_From_Mac_ATS_Name ( const char * fontName, UInt8* path, UInt32 maxPathSize, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return a pathname of the disk file and face index for given font name that is handled by ATS framework.","title":"FT_GetFilePath_From_Mac_ATS_Name"},{"location":"ft2-mac_specific.html#ft_new_face_from_fsspec","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FSSpec ( FT_Library library, const FSSpec *spec, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a given resource and typeface index using an FSSpec to the font file.","title":"FT_New_Face_From_FSSpec"},{"location":"ft2-mac_specific.html#ft_new_face_from_fsref","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FSRef ( FT_Library library, const FSRef *ref, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a given resource and typeface index using an FSRef to the font file.","title":"FT_New_Face_From_FSRef"},{"location":"ft2-module_management.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Module Management Module Management \u00b6 Synopsis \u00b6 The definitions below are used to manage modules within FreeType. Internal and external modules can be added, upgraded, and removed at runtime. For example, an alternative renderer or proprietary font driver can be registered and prioritized. Additionally, some module properties can also be controlled. Here is a list of existing values of the module_name field in the FT_Module_Class structure. autofitter bdf cff gxvalid otvalid pcf pfr psaux pshinter psnames raster1 sfnt smooth truetype type1 type42 t1cid winfonts Note that the FreeType Cache sub-system is not a FreeType module. FT_Module \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_ModuleRec_* FT_Module ; A handle to a given FreeType module object. A module can be a font driver, a renderer, or anything else that provides services to the former. FT_Module_Constructor \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Error (* FT_Module_Constructor )( FT_Module module ); A function used to initialize (not create) a new module object. input module The module to initialize. FT_Module_Destructor \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef void (* FT_Module_Destructor )( FT_Module module ); A function used to finalize (not destroy) a given module object. input module The module to finalize. FT_Module_Requester \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Module_Interface (* FT_Module_Requester )( FT_Module module, const char * name ); A function used to query a given module for a specific interface. input module The module to be searched. name The name of the interface in the module. FT_Module_Class \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). 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 ; The module class descriptor. While being a public structure necessary for FreeType's module bookkeeping, most of the fields are essentially internal, not to be used directly by an application. 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, as a 16.16 fixed number (major.minor). Starts at version 2.0, i.e., 0x20000. module_interface A typeless pointer to a structure (which varies between different modules) that holds the module's interface functions. This is essentially what get_interface returns. module_init The initializing function. module_done The finalizing function. get_interface The interface requesting function. FT_Add_Module \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Add_Module ( FT_Library library, const FT_Module_Class * clazz ); Add 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_Get_Module \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Module ) FT_Get_Module ( FT_Library library, const char * module_name ); Find 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 FreeType's internal modules aren't documented very well, and you should look up the source code for details. FT_Remove_Module \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Remove_Module ( FT_Library library, FT_Module module ); Remove 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_Add_Default_Modules \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Add_Default_Modules ( FT_Library library ); Add 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_FACE_DRIVER_NAME \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). # define FT_FACE_DRIVER_NAME ( face ) \\ ( ( *FT_REINTERPRET_CAST( FT_Module_Class **, \\ ( face )->driver ) )->module_name ) A macro that retrieves the name of a font driver from a face object. note The font driver name is a valid module_name for FT_Property_Set and FT_Property_Get . This is not the same as FT_Get_Font_Format . since 2.11 FT_Property_Set \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Property_Set ( FT_Library library, const FT_String * module_name, const FT_String * property_name, const void * value ); Set a property for a given module. input library A handle to the library the module is part of. module_name The module name. property_name The property name. Properties are described in section \u2018 Driver properties \u2019. Note that only a few modules have properties. value A generic pointer to a variable or structure that gives the new value of the property. The exact definition of value is dependent on the property; see section \u2018 Driver properties \u2019. return FreeType error code. 0 means success. note If module_name isn't a valid module name, or property_name doesn't specify a valid property, or if value doesn't represent a valid value for the given property, an error is returned. The following example sets property \u2018bar\u2019 (a simple integer) in module \u2018foo\u2019 to value 1. FT_UInt bar; bar = 1; FT_Property_Set( library, \"foo\", \"bar\", &bar ); Note that the FreeType Cache sub-system doesn't recognize module property changes. To avoid glyph lookup confusion within the cache you should call FTC_Manager_Reset to completely flush the cache if a module property gets changed after FTC_Manager_New has been called. It is not possible to set properties of the FreeType Cache sub-system itself with FT_Property_Set; use ?FTC_Property_Set? instead. since 2.4.11 FT_Property_Get \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Property_Get ( FT_Library library, const FT_String * module_name, const FT_String * property_name, void * value ); Get a module's property value. input library A handle to the library the module is part of. module_name The module name. property_name The property name. Properties are described in section \u2018 Driver properties \u2019. inout value A generic pointer to a variable or structure that gives the value of the property. The exact definition of value is dependent on the property; see section \u2018 Driver properties \u2019. return FreeType error code. 0 means success. note If module_name isn't a valid module name, or property_name doesn't specify a valid property, or if value doesn't represent a valid value for the given property, an error is returned. The following example gets property \u2018baz\u2019 (a range) in module \u2018foo\u2019. typedef range_ { FT_Int32 min; FT_Int32 max; } range; range baz; FT_Property_Get( library, \"foo\", \"baz\", &baz ); It is not possible to retrieve properties of the FreeType Cache sub-system with FT_Property_Get; use ?FTC_Property_Get? instead. since 2.4.11 FT_Set_Default_Properties \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Set_Default_Properties ( FT_Library library ); If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is set, this function reads the FREETYPE_PROPERTIES environment variable to control driver properties. See section \u2018 Driver properties \u2019 for more. If the compilation option is not set, this function does nothing. FREETYPE_PROPERTIES has the following syntax form (broken here into multiple lines for better readability). <optional whitespace> <module-name1> ':' <property-name1> '=' <property-value1> <whitespace> <module-name2> ':' <property-name2> '=' <property-value2> ... Example: FREETYPE_PROPERTIES=truetype:interpreter-version=35 \\ cff:no-stem-darkening=0 inout library A handle to a new library object. since 2.8 FT_New_Library \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_New_Library ( FT_Memory memory, FT_Library *alibrary ); 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. Note, however, that the used FT_Memory structure is expected to remain valid for the life of the FT_Library object. Normally, you would call this function (followed by a call to FT_Add_Default_Modules or a series of calls to FT_Add_Module , and a call to FT_Set_Default_Properties ) instead of FT_Init_FreeType to initialize the FreeType library. Don't use FT_Done_FreeType but FT_Done_Library to destroy a library instance. 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. note See the discussion of reference counters in the description of FT_Reference_Library . FT_Done_Library \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Done_Library ( FT_Library library ); Discard 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. note See the discussion of reference counters in the description of FT_Reference_Library . FT_Reference_Library \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Reference_Library ( FT_Library library ); A counter gets initialized to 1 at the time an FT_Library structure is created. This function increments the counter. FT_Done_Library then only destroys a library if the counter is 1, otherwise it simply decrements the counter. This function helps in managing life-cycles of structures that reference FT_Library objects. input library A handle to a target library object. return FreeType error code. 0 means success. since 2.4.2 FT_Renderer \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_RendererRec_* FT_Renderer ; A handle to a given FreeType renderer. A renderer is a module in charge of converting a glyph's outline image to a bitmap. It supports a single glyph image format, and one or more target surface depths. FT_Renderer_Class \u00b6 Defined in FT_RENDER_H (freetype/ftrender.h). typedef struct FT_Renderer_Class_ { FT_Module_Class root; FT_Glyph_Format glyph_format; FT_Renderer_RenderFunc render_glyph; FT_Renderer_TransformFunc transform_glyph; FT_Renderer_GetCBoxFunc get_glyph_cbox; FT_Renderer_SetModeFunc set_mode; FT_Raster_Funcs * raster_class; } FT_Renderer_Class ; The renderer module class descriptor. fields root The root FT_Module_Class fields. glyph_format The glyph image format this renderer handles. render_glyph A method used to render the image that is in a given glyph slot into a bitmap. transform_glyph A method used to transform the image that is in a given glyph slot. get_glyph_cbox A method used to access the glyph's cbox. set_mode A method used to pass additional parameters. raster_class For FT_GLYPH_FORMAT_OUTLINE renderers only. This is a pointer to its raster's class. FT_Get_Renderer \u00b6 Defined in FT_RENDER_H (freetype/ftrender.h). FT_EXPORT( FT_Renderer ) FT_Get_Renderer ( FT_Library library, FT_Glyph_Format format ); Retrieve the current renderer for a given glyph format. input library A handle to the library object. format The glyph format. return A renderer handle. 0 if none found. 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. To add a new renderer, simply use FT_Add_Module . To retrieve a renderer by its name, use FT_Get_Module . FT_Set_Renderer \u00b6 Defined in FT_RENDER_H (freetype/ftrender.h). FT_EXPORT( FT_Error ) FT_Set_Renderer ( FT_Library library, FT_Renderer renderer, FT_UInt num_params, FT_Parameter * parameters ); Set the current renderer to use, and set additional mode. inout library A handle to the library object. input renderer A handle to the renderer object. num_params The number of additional parameters. parameters Additional parameters. return FreeType error code. 0 means success. note In case of success, the renderer will be used to convert glyph images in the renderer's known format into bitmaps. This doesn't change the current renderer for other formats. Currently, no FreeType renderer module uses parameters ; you should thus always pass NULL as the value. FT_Set_Debug_Hook \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Set_Debug_Hook ( FT_Library library, FT_UInt hook_index, FT_DebugHook_Func debug_hook ); Set a debug hook function for debugging the interpreter of a font format. While this is a public API function, an application needs access to FreeType's internal header files to do something useful. Have a look at the source code of the ttdebug FreeType demo program for an example of its usage. inout library A handle to the library object. input hook_index The index of the debug hook. You should use defined enumeration macros like FT_DEBUG_HOOK_TRUETYPE . debug_hook The function used to debug the interpreter. note Currently, four debug hook slots are available, but only one (for the TrueType interpreter) is defined. FT_Driver \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_DriverRec_* FT_Driver ; A handle to a given FreeType font driver object. A font driver is a module capable of creating faces from font files. FT_DebugHook_Func \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Error (* FT_DebugHook_Func )( void * arg ); A drop-in replacement (or rather a wrapper) for the bytecode or charstring interpreter's main loop function. Its job is essentially to activate debug mode to enforce single-stepping, to call the main loop function to interpret the next opcode, and to show the changed context to the user. An example for such a main loop function is TT_RunIns (declared in FreeType's internal header file src/truetype/ttinterp.h ). Have a look at the source code of the ttdebug FreeType demo program for an example of a drop-in replacement. inout arg A typeless pointer, to be cast to the main loop function's data structure (which depends on the font module). For TrueType fonts it is bytecode interpreter's execution context, TT_ExecContext , which is declared in FreeType's internal header file tttypes.h . FT_DEBUG_HOOK_XXX \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). # define FT_DEBUG_HOOK_TRUETYPE 0 A list of named debug hook indices. values FT_DEBUG_HOOK_TRUETYPE This hook index identifies the TrueType bytecode debugger.","title":"Module Management"},{"location":"ft2-module_management.html#module-management","text":"","title":"Module Management"},{"location":"ft2-module_management.html#synopsis","text":"The definitions below are used to manage modules within FreeType. Internal and external modules can be added, upgraded, and removed at runtime. For example, an alternative renderer or proprietary font driver can be registered and prioritized. Additionally, some module properties can also be controlled. Here is a list of existing values of the module_name field in the FT_Module_Class structure. autofitter bdf cff gxvalid otvalid pcf pfr psaux pshinter psnames raster1 sfnt smooth truetype type1 type42 t1cid winfonts Note that the FreeType Cache sub-system is not a FreeType module.","title":"Synopsis"},{"location":"ft2-module_management.html#ft_module","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_ModuleRec_* FT_Module ; A handle to a given FreeType module object. A module can be a font driver, a renderer, or anything else that provides services to the former.","title":"FT_Module"},{"location":"ft2-module_management.html#ft_module_constructor","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Error (* FT_Module_Constructor )( FT_Module module ); A function used to initialize (not create) a new module object.","title":"FT_Module_Constructor"},{"location":"ft2-module_management.html#ft_module_destructor","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef void (* FT_Module_Destructor )( FT_Module module ); A function used to finalize (not destroy) a given module object.","title":"FT_Module_Destructor"},{"location":"ft2-module_management.html#ft_module_requester","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Module_Interface (* FT_Module_Requester )( FT_Module module, const char * name ); A function used to query a given module for a specific interface.","title":"FT_Module_Requester"},{"location":"ft2-module_management.html#ft_module_class","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). 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 ; The module class descriptor. While being a public structure necessary for FreeType's module bookkeeping, most of the fields are essentially internal, not to be used directly by an application.","title":"FT_Module_Class"},{"location":"ft2-module_management.html#ft_add_module","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Add_Module ( FT_Library library, const FT_Module_Class * clazz ); Add a new module to a given library instance.","title":"FT_Add_Module"},{"location":"ft2-module_management.html#ft_get_module","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Module ) FT_Get_Module ( FT_Library library, const char * module_name ); Find a module by its name.","title":"FT_Get_Module"},{"location":"ft2-module_management.html#ft_remove_module","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Remove_Module ( FT_Library library, FT_Module module ); Remove a given module from a library instance.","title":"FT_Remove_Module"},{"location":"ft2-module_management.html#ft_add_default_modules","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Add_Default_Modules ( FT_Library library ); Add 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).","title":"FT_Add_Default_Modules"},{"location":"ft2-module_management.html#ft_face_driver_name","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). # define FT_FACE_DRIVER_NAME ( face ) \\ ( ( *FT_REINTERPRET_CAST( FT_Module_Class **, \\ ( face )->driver ) )->module_name ) A macro that retrieves the name of a font driver from a face object.","title":"FT_FACE_DRIVER_NAME"},{"location":"ft2-module_management.html#ft_property_set","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Property_Set ( FT_Library library, const FT_String * module_name, const FT_String * property_name, const void * value ); Set a property for a given module.","title":"FT_Property_Set"},{"location":"ft2-module_management.html#ft_property_get","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Property_Get ( FT_Library library, const FT_String * module_name, const FT_String * property_name, void * value ); Get a module's property value.","title":"FT_Property_Get"},{"location":"ft2-module_management.html#ft_set_default_properties","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Set_Default_Properties ( FT_Library library ); If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is set, this function reads the FREETYPE_PROPERTIES environment variable to control driver properties. See section \u2018 Driver properties \u2019 for more. If the compilation option is not set, this function does nothing. FREETYPE_PROPERTIES has the following syntax form (broken here into multiple lines for better readability). <optional whitespace> <module-name1> ':' <property-name1> '=' <property-value1> <whitespace> <module-name2> ':' <property-name2> '=' <property-value2> ... Example: FREETYPE_PROPERTIES=truetype:interpreter-version=35 \\ cff:no-stem-darkening=0","title":"FT_Set_Default_Properties"},{"location":"ft2-module_management.html#ft_new_library","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_New_Library ( FT_Memory memory, FT_Library *alibrary ); 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. Note, however, that the used FT_Memory structure is expected to remain valid for the life of the FT_Library object. Normally, you would call this function (followed by a call to FT_Add_Default_Modules or a series of calls to FT_Add_Module , and a call to FT_Set_Default_Properties ) instead of FT_Init_FreeType to initialize the FreeType library. Don't use FT_Done_FreeType but FT_Done_Library to destroy a library instance.","title":"FT_New_Library"},{"location":"ft2-module_management.html#ft_done_library","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Done_Library ( FT_Library library ); Discard a given library object. This closes all drivers and discards all resource objects.","title":"FT_Done_Library"},{"location":"ft2-module_management.html#ft_reference_library","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Reference_Library ( FT_Library library ); A counter gets initialized to 1 at the time an FT_Library structure is created. This function increments the counter. FT_Done_Library then only destroys a library if the counter is 1, otherwise it simply decrements the counter. This function helps in managing life-cycles of structures that reference FT_Library objects.","title":"FT_Reference_Library"},{"location":"ft2-module_management.html#ft_renderer","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_RendererRec_* FT_Renderer ; A handle to a given FreeType renderer. A renderer is a module in charge of converting a glyph's outline image to a bitmap. It supports a single glyph image format, and one or more target surface depths.","title":"FT_Renderer"},{"location":"ft2-module_management.html#ft_renderer_class","text":"Defined in FT_RENDER_H (freetype/ftrender.h). typedef struct FT_Renderer_Class_ { FT_Module_Class root; FT_Glyph_Format glyph_format; FT_Renderer_RenderFunc render_glyph; FT_Renderer_TransformFunc transform_glyph; FT_Renderer_GetCBoxFunc get_glyph_cbox; FT_Renderer_SetModeFunc set_mode; FT_Raster_Funcs * raster_class; } FT_Renderer_Class ; The renderer module class descriptor.","title":"FT_Renderer_Class"},{"location":"ft2-module_management.html#ft_get_renderer","text":"Defined in FT_RENDER_H (freetype/ftrender.h). FT_EXPORT( FT_Renderer ) FT_Get_Renderer ( FT_Library library, FT_Glyph_Format format ); Retrieve the current renderer for a given glyph format.","title":"FT_Get_Renderer"},{"location":"ft2-module_management.html#ft_set_renderer","text":"Defined in FT_RENDER_H (freetype/ftrender.h). FT_EXPORT( FT_Error ) FT_Set_Renderer ( FT_Library library, FT_Renderer renderer, FT_UInt num_params, FT_Parameter * parameters ); Set the current renderer to use, and set additional mode.","title":"FT_Set_Renderer"},{"location":"ft2-module_management.html#ft_set_debug_hook","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Set_Debug_Hook ( FT_Library library, FT_UInt hook_index, FT_DebugHook_Func debug_hook ); Set a debug hook function for debugging the interpreter of a font format. While this is a public API function, an application needs access to FreeType's internal header files to do something useful. Have a look at the source code of the ttdebug FreeType demo program for an example of its usage.","title":"FT_Set_Debug_Hook"},{"location":"ft2-module_management.html#ft_driver","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_DriverRec_* FT_Driver ; A handle to a given FreeType font driver object. A font driver is a module capable of creating faces from font files.","title":"FT_Driver"},{"location":"ft2-module_management.html#ft_debughook_func","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Error (* FT_DebugHook_Func )( void * arg ); A drop-in replacement (or rather a wrapper) for the bytecode or charstring interpreter's main loop function. Its job is essentially to activate debug mode to enforce single-stepping, to call the main loop function to interpret the next opcode, and to show the changed context to the user. An example for such a main loop function is TT_RunIns (declared in FreeType's internal header file src/truetype/ttinterp.h ). Have a look at the source code of the ttdebug FreeType demo program for an example of a drop-in replacement.","title":"FT_DebugHook_Func"},{"location":"ft2-module_management.html#ft_debug_hook_xxx","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). # define FT_DEBUG_HOOK_TRUETYPE 0 A list of named debug hook indices.","title":"FT_DEBUG_HOOK_XXX"},{"location":"ft2-multiple_masters.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Multiple Masters Multiple Masters \u00b6 Synopsis \u00b6 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. Besides Adobe MM fonts, the interface supports Apple's TrueType GX and OpenType variation fonts. Some of the routines only work with Adobe MM fonts, others will work with all three types. They are similar enough that a consistent interface makes sense. FT_MM_Axis \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_MM_Axis_ { FT_String * name; FT_Long minimum; FT_Long maximum; } FT_MM_Axis ; A structure to model a given axis in design space for Multiple Masters fonts. This structure can't be used for TrueType GX or OpenType variation fonts. fields name The axis's name. minimum The axis's minimum design coordinate. maximum The axis's maximum design coordinate. FT_Multi_Master \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Multi_Master_ { FT_UInt num_axis; FT_UInt num_designs; FT_MM_Axis axis[T1_MAX_MM_AXIS]; } FT_Multi_Master ; A structure to model the axes and space of a Multiple Masters font. This structure can't be used for TrueType GX or OpenType variation fonts. fields num_axis Number of axes. Cannot exceed 4. num_designs Number of designs; should be 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. FT_Var_Axis \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Var_Axis_ { FT_String * name; FT_Fixed minimum; FT_Fixed def; FT_Fixed maximum; FT_ULong tag; FT_UInt strid; } FT_Var_Axis ; A structure to model a given axis in design space for Multiple Masters, TrueType GX, and OpenType variation fonts. fields name The axis's name. Not always meaningful for TrueType GX or OpenType variation fonts. minimum The axis's minimum design coordinate. def The axis's default design coordinate. FreeType computes meaningful default values for Adobe MM fonts. maximum The axis's maximum design coordinate. tag The axis's tag (the equivalent to \u2018name\u2019 for TrueType GX and OpenType variation fonts). FreeType provides default values for Adobe MM fonts if possible. strid The axis name entry in the font's \u2018name\u2019 table. This is another (and often better) version of the \u2018name\u2019 field for TrueType GX or OpenType variation fonts. Not meaningful for Adobe MM fonts. note The fields minimum , def , and maximum are 16.16 fractional values for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the values are integers. FT_Var_Named_Style \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Var_Named_Style_ { FT_Fixed * coords; FT_UInt strid; FT_UInt psid; /* since 2.7.1 */ } FT_Var_Named_Style ; A structure to model a named instance in a TrueType GX or OpenType variation font. This structure can't be used for Adobe MM fonts. fields coords The design coordinates for this instance. This is an array with one entry for each axis. strid The entry in \u2018name\u2019 table identifying this instance. psid The entry in \u2018name\u2019 table identifying a PostScript name for this instance. Value 0xFFFF indicates a missing entry. FT_MM_Var \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_MM_Var_ { FT_UInt num_axis; FT_UInt num_designs; FT_UInt num_namedstyles; FT_Var_Axis * axis; FT_Var_Named_Style * namedstyle; } FT_MM_Var ; A structure to model the axes and space of an Adobe MM, TrueType GX, or OpenType variation font. Some fields are specific to one format and not to the others. fields num_axis The number of axes. The maximum value is 4 for Adobe MM fonts; no limit in TrueType GX or OpenType variation fonts. num_designs The number of designs; should be normally 2^num_axis for Adobe MM fonts. Not meaningful for TrueType GX or OpenType variation fonts (where every glyph could have a different number of designs). num_namedstyles The number of named styles; a \u2018named style\u2019 is a tuple of design coordinates that has a string ID (in the \u2018name\u2019 table) associated with it. The font can tell the user that, for example, [Weight=1.5,Width=1.1] is \u2018Bold\u2019. Another name for \u2018named style\u2019 is \u2018named instance\u2019. For Adobe Multiple Masters fonts, this value is always zero because the format does not support named styles. axis An axis descriptor table. TrueType GX and OpenType variation fonts contain slightly more data than Adobe MM fonts. Memory management of this pointer is done internally by FreeType. namedstyle A named style (instance) table. Only meaningful for TrueType GX and OpenType variation fonts. Memory management of this pointer is done internally by FreeType. FT_Get_Multi_Master \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Multi_Master ( FT_Face face, FT_Multi_Master *amaster ); Retrieve a variation descriptor of a given Adobe MM font. This function can't be used with TrueType GX or OpenType variation fonts. input face A handle to the source face. output amaster The Multiple Masters descriptor. return FreeType error code. 0 means success. FT_Get_MM_Var \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_Var ( FT_Face face, FT_MM_Var * *amaster ); Retrieve a variation descriptor for a given font. This function works with all supported variation formats. input face A handle to the source face. output amaster The variation descriptor. Allocates a data structure, which the user must deallocate with a call to FT_Done_MM_Var after use. return FreeType error code. 0 means success. FT_Done_MM_Var \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Done_MM_Var ( FT_Library library, FT_MM_Var *amaster ); Free the memory allocated by FT_Get_MM_Var . input library A handle of the face's parent library object that was used in the call to FT_Get_MM_Var to create amaster . return FreeType error code. 0 means success. FT_Set_MM_Design_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Long * coords ); For Adobe MM fonts, choose an interpolated font design through design coordinates. This function can't be used with TrueType GX or OpenType variation fonts. inout face A handle to the source face. input num_coords The number of available design coordinates. If it is larger than the number of axes, ignore the excess values. If it is smaller than the number of axes, use default values for the remaining axes. coords An array of design coordinates. return FreeType error code. 0 means success. note [Since 2.8.1] To reset all axes to the default values, call the function with num_coords set to zero and coords set to NULL . [Since 2.9] If num_coords is larger than zero, this function sets the FT_FACE_FLAG_VARIATION bit in FT_Face 's face_flags field (i.e., FT_IS_VARIATION will return true). If num_coords is zero, this bit flag gets unset. FT_Set_Var_Design_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Var_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Choose an interpolated font design through design coordinates. This function works with all supported variation formats. inout face A handle to the source face. input num_coords The number of available design coordinates. If it is larger than the number of axes, ignore the excess values. If it is smaller than the number of axes, use default values for the remaining axes. coords An array of design coordinates. return FreeType error code. 0 means success. note [Since 2.8.1] To reset all axes to the default values, call the function with num_coords set to zero and coords set to NULL . [Since 2.9] \u2018Default values\u2019 means the currently selected named instance (or the base font if no named instance is selected). [Since 2.9] If num_coords is larger than zero, this function sets the FT_FACE_FLAG_VARIATION bit in FT_Face 's face_flags field (i.e., FT_IS_VARIATION will return true). If num_coords is zero, this bit flag gets unset. FT_Get_Var_Design_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Get the design coordinates of the currently selected interpolated font. This function works with all supported variation formats. input face A handle to the source face. num_coords The number of design coordinates to retrieve. If it is larger than the number of axes, set the excess values to 0. output coords The design coordinates array. return FreeType error code. 0 means success. since 2.7.1 FT_Set_MM_Blend_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Choose an interpolated font design through normalized blend coordinates. This function works with all supported variation formats. inout face A handle to the source face. input num_coords The number of available design coordinates. If it is larger than the number of axes, ignore the excess values. If it is smaller than the number of axes, use default values for the remaining axes. coords The design coordinates array (each element must be between 0 and 1.0 for Adobe MM fonts, and between -1.0 and 1.0 for TrueType GX and OpenType variation fonts). return FreeType error code. 0 means success. note [Since 2.8.1] To reset all axes to the default values, call the function with num_coords set to zero and coords set to NULL . [Since 2.9] \u2018Default values\u2019 means the currently selected named instance (or the base font if no named instance is selected). [Since 2.9] If num_coords is larger than zero, this function sets the FT_FACE_FLAG_VARIATION bit in FT_Face 's face_flags field (i.e., FT_IS_VARIATION will return true). If num_coords is zero, this bit flag gets unset. FT_Get_MM_Blend_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Get the normalized blend coordinates of the currently selected interpolated font. This function works with all supported variation formats. input face A handle to the source face. num_coords The number of normalized blend coordinates to retrieve. If it is larger than the number of axes, set the excess values to 0.5 for Adobe MM fonts, and to 0 for TrueType GX and OpenType variation fonts. output coords The normalized blend coordinates array. return FreeType error code. 0 means success. since 2.7.1 FT_Set_Var_Blend_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Var_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); This is another name of FT_Set_MM_Blend_Coordinates . FT_Get_Var_Blend_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); This is another name of FT_Get_MM_Blend_Coordinates . since 2.7.1 FT_Set_MM_WeightVector \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_WeightVector ( FT_Face face, FT_UInt len, FT_Fixed * weightvector ); For Adobe MM fonts, choose an interpolated font design by directly setting the weight vector. This function can't be used with TrueType GX or OpenType variation fonts. inout face A handle to the source face. input len The length of the weight vector array. If it is larger than the number of designs, the extra values are ignored. If it is less than the number of designs, the remaining values are set to zero. weightvector An array representing the weight vector. return FreeType error code. 0 means success. note Adobe Multiple Master fonts limit the number of designs, and thus the length of the weight vector to 16. If len is zero and weightvector is NULL , the weight vector array is reset to the default values. The Adobe documentation also states that the values in the WeightVector array must total 1.0 \u00b1 0.001. In practice this does not seem to be enforced, so is not enforced here, either. since 2.10 FT_Get_MM_WeightVector \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_WeightVector ( FT_Face face, FT_UInt * len, FT_Fixed * weightvector ); For Adobe MM fonts, retrieve the current weight vector of the font. This function can't be used with TrueType GX or OpenType variation fonts. inout face A handle to the source face. len A pointer to the size of the array to be filled. If the size of the array is less than the number of designs, FT_Err_Invalid_Argument is returned, and len is set to the required size (the number of designs). If the size of the array is greater than the number of designs, the remaining entries are set to 0. On successful completion, len is set to the number of designs (i.e., the number of values written to the array). output weightvector An array to be filled. return FreeType error code. 0 means success. note Adobe Multiple Master fonts limit the number of designs, and thus the length of the WeightVector to 16. since 2.10 FT_VAR_AXIS_FLAG_XXX \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). # define FT_VAR_AXIS_FLAG_HIDDEN 1 A list of bit flags used in the return value of FT_Get_Var_Axis_Flags . values FT_VAR_AXIS_FLAG_HIDDEN The variation axis should not be exposed to user interfaces. since 2.8.1 FT_Get_Var_Axis_Flags \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Axis_Flags ( FT_MM_Var * master, FT_UInt axis_index, FT_UInt * flags ); Get the \u2018flags\u2019 field of an OpenType Variation Axis Record. Not meaningful for Adobe MM fonts ( *flags is always zero). input master The variation descriptor. axis_index The index of the requested variation axis. output flags The \u2018flags\u2019 field. See FT_VAR_AXIS_FLAG_XXX for possible values. return FreeType error code. 0 means success. since 2.8.1 FT_Set_Named_Instance \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Named_Instance ( FT_Face face, FT_UInt instance_index ); Set or change the current named instance. input face A handle to the source face. instance_index The index of the requested instance, starting with value 1. If set to value 0, FreeType switches to font access without a named instance. return FreeType error code. 0 means success. note The function uses the value of instance_index to set bits 16-30 of the face's face_index field. It also resets any variation applied to the font, and the FT_FACE_FLAG_VARIATION bit of the face's face_flags field gets reset to zero (i.e., FT_IS_VARIATION will return false). For Adobe MM fonts (which don't have named instances) this function simply resets the current face to the default instance. since 2.9","title":"Multiple Masters"},{"location":"ft2-multiple_masters.html#multiple-masters","text":"","title":"Multiple Masters"},{"location":"ft2-multiple_masters.html#synopsis","text":"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. Besides Adobe MM fonts, the interface supports Apple's TrueType GX and OpenType variation fonts. Some of the routines only work with Adobe MM fonts, others will work with all three types. They are similar enough that a consistent interface makes sense.","title":"Synopsis"},{"location":"ft2-multiple_masters.html#ft_mm_axis","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_MM_Axis_ { FT_String * name; FT_Long minimum; FT_Long maximum; } FT_MM_Axis ; A structure to model a given axis in design space for Multiple Masters fonts. This structure can't be used for TrueType GX or OpenType variation fonts.","title":"FT_MM_Axis"},{"location":"ft2-multiple_masters.html#ft_multi_master","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Multi_Master_ { FT_UInt num_axis; FT_UInt num_designs; FT_MM_Axis axis[T1_MAX_MM_AXIS]; } FT_Multi_Master ; A structure to model the axes and space of a Multiple Masters font. This structure can't be used for TrueType GX or OpenType variation fonts.","title":"FT_Multi_Master"},{"location":"ft2-multiple_masters.html#ft_var_axis","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Var_Axis_ { FT_String * name; FT_Fixed minimum; FT_Fixed def; FT_Fixed maximum; FT_ULong tag; FT_UInt strid; } FT_Var_Axis ; A structure to model a given axis in design space for Multiple Masters, TrueType GX, and OpenType variation fonts.","title":"FT_Var_Axis"},{"location":"ft2-multiple_masters.html#ft_var_named_style","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Var_Named_Style_ { FT_Fixed * coords; FT_UInt strid; FT_UInt psid; /* since 2.7.1 */ } FT_Var_Named_Style ; A structure to model a named instance in a TrueType GX or OpenType variation font. This structure can't be used for Adobe MM fonts.","title":"FT_Var_Named_Style"},{"location":"ft2-multiple_masters.html#ft_mm_var","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_MM_Var_ { FT_UInt num_axis; FT_UInt num_designs; FT_UInt num_namedstyles; FT_Var_Axis * axis; FT_Var_Named_Style * namedstyle; } FT_MM_Var ; A structure to model the axes and space of an Adobe MM, TrueType GX, or OpenType variation font. Some fields are specific to one format and not to the others.","title":"FT_MM_Var"},{"location":"ft2-multiple_masters.html#ft_get_multi_master","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Multi_Master ( FT_Face face, FT_Multi_Master *amaster ); Retrieve a variation descriptor of a given Adobe MM font. This function can't be used with TrueType GX or OpenType variation fonts.","title":"FT_Get_Multi_Master"},{"location":"ft2-multiple_masters.html#ft_get_mm_var","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_Var ( FT_Face face, FT_MM_Var * *amaster ); Retrieve a variation descriptor for a given font. This function works with all supported variation formats.","title":"FT_Get_MM_Var"},{"location":"ft2-multiple_masters.html#ft_done_mm_var","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Done_MM_Var ( FT_Library library, FT_MM_Var *amaster ); Free the memory allocated by FT_Get_MM_Var .","title":"FT_Done_MM_Var"},{"location":"ft2-multiple_masters.html#ft_set_mm_design_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Long * coords ); For Adobe MM fonts, choose an interpolated font design through design coordinates. This function can't be used with TrueType GX or OpenType variation fonts.","title":"FT_Set_MM_Design_Coordinates"},{"location":"ft2-multiple_masters.html#ft_set_var_design_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Var_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Choose an interpolated font design through design coordinates. This function works with all supported variation formats.","title":"FT_Set_Var_Design_Coordinates"},{"location":"ft2-multiple_masters.html#ft_get_var_design_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Get the design coordinates of the currently selected interpolated font. This function works with all supported variation formats.","title":"FT_Get_Var_Design_Coordinates"},{"location":"ft2-multiple_masters.html#ft_set_mm_blend_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Choose an interpolated font design through normalized blend coordinates. This function works with all supported variation formats.","title":"FT_Set_MM_Blend_Coordinates"},{"location":"ft2-multiple_masters.html#ft_get_mm_blend_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Get the normalized blend coordinates of the currently selected interpolated font. This function works with all supported variation formats.","title":"FT_Get_MM_Blend_Coordinates"},{"location":"ft2-multiple_masters.html#ft_set_var_blend_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Var_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); This is another name of FT_Set_MM_Blend_Coordinates .","title":"FT_Set_Var_Blend_Coordinates"},{"location":"ft2-multiple_masters.html#ft_get_var_blend_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); This is another name of FT_Get_MM_Blend_Coordinates .","title":"FT_Get_Var_Blend_Coordinates"},{"location":"ft2-multiple_masters.html#ft_set_mm_weightvector","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_WeightVector ( FT_Face face, FT_UInt len, FT_Fixed * weightvector ); For Adobe MM fonts, choose an interpolated font design by directly setting the weight vector. This function can't be used with TrueType GX or OpenType variation fonts.","title":"FT_Set_MM_WeightVector"},{"location":"ft2-multiple_masters.html#ft_get_mm_weightvector","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_WeightVector ( FT_Face face, FT_UInt * len, FT_Fixed * weightvector ); For Adobe MM fonts, retrieve the current weight vector of the font. This function can't be used with TrueType GX or OpenType variation fonts.","title":"FT_Get_MM_WeightVector"},{"location":"ft2-multiple_masters.html#ft_var_axis_flag_xxx","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). # define FT_VAR_AXIS_FLAG_HIDDEN 1 A list of bit flags used in the return value of FT_Get_Var_Axis_Flags .","title":"FT_VAR_AXIS_FLAG_XXX"},{"location":"ft2-multiple_masters.html#ft_get_var_axis_flags","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Axis_Flags ( FT_MM_Var * master, FT_UInt axis_index, FT_UInt * flags ); Get the \u2018flags\u2019 field of an OpenType Variation Axis Record. Not meaningful for Adobe MM fonts ( *flags is always zero).","title":"FT_Get_Var_Axis_Flags"},{"location":"ft2-multiple_masters.html#ft_set_named_instance","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Named_Instance ( FT_Face face, FT_UInt instance_index ); Set or change the current named instance.","title":"FT_Set_Named_Instance"},{"location":"ft2-ot_validation.html","text":"FreeType \u00bb Docs \u00bb Miscellaneous \u00bb OpenType Validation OpenType Validation \u00b6 Synopsis \u00b6 This section contains the declaration of functions to validate some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). FT_OpenType_Validate \u00b6 Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). FT_EXPORT( FT_Error ) FT_OpenType_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes *BASE_table, FT_Bytes *GDEF_table, FT_Bytes *GPOS_table, FT_Bytes *GSUB_table, FT_Bytes *JSTF_table ); Validate various OpenType tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming). input face A handle to the input face. validation_flags A bit field that specifies the tables to be validated. See FT_VALIDATE_OTXXX for possible values. output BASE_table A pointer to the BASE table. GDEF_table A pointer to the GDEF table. GPOS_table A pointer to the GPOS table. GSUB_table A pointer to the GSUB table. JSTF_table A pointer to the JSTF table. return FreeType error code. 0 means success. note This function only works with OpenType fonts, returning an error otherwise. After use, the application should deallocate the five tables with FT_OpenType_Free . A NULL value indicates that the table either doesn't exist in the font, or the application hasn't asked for validation. FT_OpenType_Free \u00b6 Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). FT_EXPORT( void ) FT_OpenType_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by OpenType validator. input face A handle to the input face. table The pointer to the buffer that is allocated by FT_OpenType_Validate . note This function must be used to free the buffer allocated by FT_OpenType_Validate only. FT_VALIDATE_OTXXX \u00b6 Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). # define FT_VALIDATE_BASE 0x0100 # define FT_VALIDATE_GDEF 0x0200 # define FT_VALIDATE_GPOS 0x0400 # define FT_VALIDATE_GSUB 0x0800 # define FT_VALIDATE_JSTF 0x1000 # define FT_VALIDATE_MATH 0x2000 # define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \\ FT_VALIDATE_GDEF | \\ FT_VALIDATE_GPOS | \\ FT_VALIDATE_GSUB | \\ FT_VALIDATE_JSTF | \\ FT_VALIDATE_MATH ) A list of bit-field constants used with FT_OpenType_Validate to indicate which OpenType tables should be validated. values FT_VALIDATE_BASE Validate BASE table. FT_VALIDATE_GDEF Validate GDEF table. FT_VALIDATE_GPOS Validate GPOS table. FT_VALIDATE_GSUB Validate GSUB table. FT_VALIDATE_JSTF Validate JSTF table. FT_VALIDATE_MATH Validate MATH table. FT_VALIDATE_OT Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).","title":"OpenType Validation"},{"location":"ft2-ot_validation.html#opentype-validation","text":"","title":"OpenType Validation"},{"location":"ft2-ot_validation.html#synopsis","text":"This section contains the declaration of functions to validate some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).","title":"Synopsis"},{"location":"ft2-ot_validation.html#ft_opentype_validate","text":"Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). FT_EXPORT( FT_Error ) FT_OpenType_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes *BASE_table, FT_Bytes *GDEF_table, FT_Bytes *GPOS_table, FT_Bytes *GSUB_table, FT_Bytes *JSTF_table ); Validate various OpenType tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming).","title":"FT_OpenType_Validate"},{"location":"ft2-ot_validation.html#ft_opentype_free","text":"Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). FT_EXPORT( void ) FT_OpenType_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by OpenType validator.","title":"FT_OpenType_Free"},{"location":"ft2-ot_validation.html#ft_validate_otxxx","text":"Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). # define FT_VALIDATE_BASE 0x0100 # define FT_VALIDATE_GDEF 0x0200 # define FT_VALIDATE_GPOS 0x0400 # define FT_VALIDATE_GSUB 0x0800 # define FT_VALIDATE_JSTF 0x1000 # define FT_VALIDATE_MATH 0x2000 # define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \\ FT_VALIDATE_GDEF | \\ FT_VALIDATE_GPOS | \\ FT_VALIDATE_GSUB | \\ FT_VALIDATE_JSTF | \\ FT_VALIDATE_MATH ) A list of bit-field constants used with FT_OpenType_Validate to indicate which OpenType tables should be validated.","title":"FT_VALIDATE_OTXXX"},{"location":"ft2-outline_processing.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Outline Processing Outline Processing \u00b6 Synopsis \u00b6 This section contains routines used to create and destroy scalable glyph images known as \u2018outlines\u2019. These can also be measured, transformed, and converted into bitmaps and pixmaps. FT_Outline \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; 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 \u2018off\u2019 the curve, i.e., a Bezier control point, while it is \u2018on\u2019 if set. Bit 1 is meaningful for \u2018off\u2019 points only. If set, it indicates a third-order Bezier arc control point; and a second-order control point if unset. If bit 2 is set, bits 5-7 contain the drop-out mode (as defined in the OpenType specification; the value is the same as the argument to the \u2018SCANMODE\u2019 instruction). Bits 3 and 4 are reserved for internal purposes. 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 \u20180\u2019 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_XXX . note The B/W rasterizer only checks bit 2 in the tags array for the first point of each contour. The drop-out mode as given with FT_OUTLINE_IGNORE_DROPOUTS , FT_OUTLINE_SMART_DROPOUTS , and FT_OUTLINE_INCLUDE_STUBS in flags is then overridden. FT_Outline_New \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_New ( FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline ); Create 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 maximum number of points within the outline. Must be smaller than or equal to 0xFFFF (65535). numContours The maximum number of contours within the outline. This value must be in the range 0 to numPoints . output anoutline A handle to the new outline. 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_Outline_Done \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Done ( FT_Library library, FT_Outline * outline ); Destroy 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 \u2018owner\u2019 field is not set, only the outline descriptor will be released. FT_Outline_Copy \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Copy ( const FT_Outline * source, FT_Outline *target ); Copy 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_Outline_Translate \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Translate ( const FT_Outline * outline, FT_Pos xOffset, FT_Pos yOffset ); Apply 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_Outline_Transform \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Transform ( const FT_Outline * outline, const FT_Matrix * matrix ); Apply 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_Outline_Embolden \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Embolden ( FT_Outline * outline, FT_Pos strength ); Embolden an outline. The new outline will be at most 4 times strength pixels wider and higher. You may think of the left and bottom borders as unchanged. Negative strength values to reduce the outline thickness are possible also. inout outline A handle to the target outline. input strength How strong the glyph is emboldened. Expressed in 26.6 pixel format. return FreeType error code. 0 means success. note The used algorithm to increase or decrease the thickness of the glyph doesn't change the number of points; this means that certain situations like acute angles or intersections are sometimes handled incorrectly. If you need \u2018better\u2019 metrics values you should call FT_Outline_Get_CBox or FT_Outline_Get_BBox . To get meaningful results, font scaling values must be set with functions like FT_Set_Char_Size before calling FT_Render_Glyph. example FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) FT_Outline_Embolden( &face->glyph->outline, strength ); FT_Outline_EmboldenXY \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_EmboldenXY ( FT_Outline * outline, FT_Pos xstrength, FT_Pos ystrength ); Embolden an outline. The new outline will be xstrength pixels wider and ystrength pixels higher. Otherwise, it is similar to FT_Outline_Embolden , which uses the same strength in both directions. since 2.4.10 FT_Outline_Reverse \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Reverse ( FT_Outline * outline ); Reverse 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 function 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_Outline_Check \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Check ( FT_Outline * outline ); Check the contents of an outline descriptor. input outline A handle to a source outline. return FreeType error code. 0 means success. note An empty outline, or an outline with a single point only is also valid. FT_Outline_Get_CBox \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Get_CBox ( const FT_Outline * outline, FT_BBox *acbox ); Return an outline's \u2018control box\u2019. 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 that 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 \u2018ftbbox\u2019 component, which is dedicated to this single task. input outline A pointer to the source outline descriptor. output acbox The outline's control box. note See FT_Glyph_Get_CBox for a discussion of tricky fonts. FT_Outline_Get_BBox \u00b6 Defined in FT_BBOX_H (freetype/ftbbox.h). FT_EXPORT( FT_Error ) FT_Outline_Get_BBox ( FT_Outline * outline, FT_BBox *abbox ); Compute the exact bounding box of an outline. This is slower than computing the control box. However, it uses an advanced algorithm that returns very quickly when the two boxes coincide. Otherwise, the outline Bezier arcs are traversed 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. note If the font is tricky and the glyph has been loaded with FT_LOAD_NO_SCALE , the resulting BBox is meaningless. To get reasonable values for the BBox it is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting the BBox, which can be eventually converted back to font units. FT_Outline_Get_Bitmap \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Get_Bitmap ( FT_Library library, FT_Outline * outline, const FT_Bitmap *abitmap ); Render 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. inout 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! Consequently, the various fields in abitmap should be set accordingly. It will use the raster corresponding to the default glyph format. The value of the num_grays field in abitmap is ignored. If you select the gray-level rasterizer, and you want less than 256 gray levels, you have to use FT_Outline_Render directly. FT_Outline_Render \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Render ( FT_Library library, FT_Outline * outline, FT_Raster_Params * params ); Render an outline within a bitmap using the current scan-convert. input library A handle to a FreeType library object. outline A pointer to the source outline descriptor. inout params A pointer to an FT_Raster_Params structure used to describe the rendering operation. return FreeType error code. 0 means success. note This advanced function uses FT_Raster_Params as an argument. The field params.source will be set to outline before the scan converter is called, which means that the value you give to it is actually ignored. Either params.target must point to preallocated bitmap, or FT_RASTER_FLAG_DIRECT must be set in params.flags allowing FreeType rasterizer to be used for direct composition, translucency, etc. See FT_Raster_Params for more details. FT_Outline_Decompose \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Decompose ( FT_Outline * outline, const FT_Outline_Funcs * func_interface, void * user ); Walk over an outline's structure to decompose it into individual segments and Bezier arcs. This function also emits \u2018move to\u2019 operations to indicate the start of new contours in the outline. input outline A pointer to the source target. func_interface A table of \u2018emitters\u2019, i.e., function pointers called during decomposition to indicate path operations. inout user A typeless pointer that 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 success. note A contour that contains a single point only is represented by a \u2018move to\u2019 operation followed by \u2018line to\u2019 to the same point. In most cases, it is best to filter this out before using the outline for stroking purposes (otherwise it would result in a visible dot when round caps are used). Similarly, the function returns success for an empty outline also (doing nothing, this is, not calling any emitter); if necessary, you should filter this out, too. FT_Outline_Funcs \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; A structure to hold various function pointers used during outline decomposition in order to emit segments, conic, and cubic Beziers. fields move_to The \u2018move to\u2019 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' = (y << shift) - delta Set the values of shift and delta to 0 to get the original point coordinates. FT_Outline_MoveToFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_MoveToFunc )( const FT_Vector * to, void * user ); # define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc A function pointer type used to describe the signature of a \u2018move to\u2019 function during outline walking/decomposition. A \u2018move to\u2019 is emitted to start a new contour in an outline. input to A pointer to the target point of the \u2018move to\u2019. user A typeless pointer, which is passed from the caller of the decomposition function. return Error code. 0 means success. FT_Outline_LineToFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_LineToFunc )( const FT_Vector * to, void * user ); # define FT_Outline_LineTo_Func FT_Outline_LineToFunc A function pointer type used to describe the signature of a \u2018line to\u2019 function during outline walking/decomposition. A \u2018line to\u2019 is emitted to indicate a segment in the outline. input to A pointer to the target point of the \u2018line to\u2019. user A typeless pointer, which is passed from the caller of the decomposition function. return Error code. 0 means success. FT_Outline_ConicToFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_ConicToFunc )( const FT_Vector * control, const FT_Vector * to, void * user ); # define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc A function pointer type used to describe the signature of a \u2018conic to\u2019 function during outline walking or decomposition. A \u2018conic to\u2019 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. FT_Outline_CubicToFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_CubicToFunc )( const FT_Vector * control1, const FT_Vector * control2, const FT_Vector * to, void * user ); # define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc A function pointer type used to describe the signature of a \u2018cubic to\u2019 function during outline walking or decomposition. A \u2018cubic to\u2019 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. FT_Orientation \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). typedef enum FT_Orientation_ { FT_ORIENTATION_TRUETYPE = 0, FT_ORIENTATION_POSTSCRIPT = 1, FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE , FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT , FT_ORIENTATION_NONE } FT_Orientation ; A list of values used to describe an outline's contour orientation. The TrueType and PostScript specifications use different conventions to determine whether outline contours should be filled or unfilled. values FT_ORIENTATION_TRUETYPE According to the TrueType specification, clockwise contours must be filled, and counter-clockwise ones must be unfilled. FT_ORIENTATION_POSTSCRIPT According to the PostScript specification, counter-clockwise contours must be filled, and clockwise ones must be unfilled. FT_ORIENTATION_FILL_RIGHT This is identical to FT_ORIENTATION_TRUETYPE , but is used to remember that in TrueType, everything that is to the right of the drawing direction of a contour must be filled. FT_ORIENTATION_FILL_LEFT This is identical to FT_ORIENTATION_POSTSCRIPT , but is used to remember that in PostScript, everything that is to the left of the drawing direction of a contour must be filled. FT_ORIENTATION_NONE The orientation cannot be determined. That is, different parts of the glyph have different orientation. FT_Outline_Get_Orientation \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Orientation ) FT_Outline_Get_Orientation ( FT_Outline * outline ); This function analyzes a glyph outline and tries to compute its fill orientation (see FT_Orientation ). This is done by integrating the total area covered by the outline. The positive integral corresponds to the clockwise orientation and FT_ORIENTATION_POSTSCRIPT is returned. The negative integral corresponds to the counter-clockwise orientation and FT_ORIENTATION_TRUETYPE is returned. Note that this will return FT_ORIENTATION_TRUETYPE for empty outlines. input outline A handle to the source outline. return The orientation. FT_OUTLINE_XXX \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). # define FT_OUTLINE_NONE 0x0 # define FT_OUTLINE_OWNER 0x1 # define FT_OUTLINE_EVEN_ODD_FILL 0x2 # define FT_OUTLINE_REVERSE_FILL 0x4 # define FT_OUTLINE_IGNORE_DROPOUTS 0x8 # define FT_OUTLINE_SMART_DROPOUTS 0x10 # define FT_OUTLINE_INCLUDE_STUBS 0x20 # define FT_OUTLINE_OVERLAP 0x40 # define FT_OUTLINE_HIGH_PRECISION 0x100 # define FT_OUTLINE_SINGLE_PASS 0x200 /* these constants are deprecated; use the corresponding */ /* ` FT_OUTLINE_XXX ` values instead */ # 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 A list of bit-field constants used for the flags in an outline's 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 , and contours ) are \u2018owned\u2019 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 rasterizer). 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. 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. See below for more information. FT_OUTLINE_SMART_DROPOUTS Select smart dropout control. If unset, use simple dropout control. Ignored if FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more information. FT_OUTLINE_INCLUDE_STUBS If set, turn pixels on for \u2018stubs\u2019, otherwise exclude them. Ignored if FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more information. FT_OUTLINE_OVERLAP This flag indicates that this outline contains overlapping contrours and the anti-aliased renderer should perform oversampling to mitigate possible artifacts. This flag should not be set for well designed glyphs without overlaps because it quadruples the rendering time. FT_OUTLINE_HIGH_PRECISION This flag indicates that the scan-line converter should try to 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. note The flags FT_OUTLINE_IGNORE_DROPOUTS , FT_OUTLINE_SMART_DROPOUTS , and FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth rasterizer. There exists a second mechanism to pass the drop-out mode to the B/W rasterizer; see the tags field in FT_Outline . Please refer to the description of the \u2018SCANTYPE\u2019 instruction in the OpenType specification (in file ttinst1.doc ) how simple drop-outs, smart drop-outs, and stubs are defined.","title":"Outline Processing"},{"location":"ft2-outline_processing.html#outline-processing","text":"","title":"Outline Processing"},{"location":"ft2-outline_processing.html#synopsis","text":"This section contains routines used to create and destroy scalable glyph images known as \u2018outlines\u2019. These can also be measured, transformed, and converted into bitmaps and pixmaps.","title":"Synopsis"},{"location":"ft2-outline_processing.html#ft_outline","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; This structure is used to describe an outline to the scan-line converter.","title":"FT_Outline"},{"location":"ft2-outline_processing.html#ft_outline_new","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_New ( FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline ); Create a new outline of a given size.","title":"FT_Outline_New"},{"location":"ft2-outline_processing.html#ft_outline_done","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Done ( FT_Library library, FT_Outline * outline ); Destroy an outline created with FT_Outline_New .","title":"FT_Outline_Done"},{"location":"ft2-outline_processing.html#ft_outline_copy","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Copy ( const FT_Outline * source, FT_Outline *target ); Copy an outline into another one. Both objects must have the same sizes (number of points & number of contours) when this function is called.","title":"FT_Outline_Copy"},{"location":"ft2-outline_processing.html#ft_outline_translate","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Translate ( const FT_Outline * outline, FT_Pos xOffset, FT_Pos yOffset ); Apply a simple translation to the points of an outline.","title":"FT_Outline_Translate"},{"location":"ft2-outline_processing.html#ft_outline_transform","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Transform ( const FT_Outline * outline, const FT_Matrix * matrix ); Apply a simple 2x2 matrix to all of an outline's points. Useful for applying rotations, slanting, flipping, etc.","title":"FT_Outline_Transform"},{"location":"ft2-outline_processing.html#ft_outline_embolden","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Embolden ( FT_Outline * outline, FT_Pos strength ); Embolden an outline. The new outline will be at most 4 times strength pixels wider and higher. You may think of the left and bottom borders as unchanged. Negative strength values to reduce the outline thickness are possible also.","title":"FT_Outline_Embolden"},{"location":"ft2-outline_processing.html#ft_outline_emboldenxy","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_EmboldenXY ( FT_Outline * outline, FT_Pos xstrength, FT_Pos ystrength ); Embolden an outline. The new outline will be xstrength pixels wider and ystrength pixels higher. Otherwise, it is similar to FT_Outline_Embolden , which uses the same strength in both directions.","title":"FT_Outline_EmboldenXY"},{"location":"ft2-outline_processing.html#ft_outline_reverse","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Reverse ( FT_Outline * outline ); Reverse the drawing direction of an outline. This is used to ensure consistent fill conventions for mirrored glyphs.","title":"FT_Outline_Reverse"},{"location":"ft2-outline_processing.html#ft_outline_check","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Check ( FT_Outline * outline ); Check the contents of an outline descriptor.","title":"FT_Outline_Check"},{"location":"ft2-outline_processing.html#ft_outline_get_cbox","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Get_CBox ( const FT_Outline * outline, FT_BBox *acbox ); Return an outline's \u2018control box\u2019. 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 that 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 \u2018ftbbox\u2019 component, which is dedicated to this single task.","title":"FT_Outline_Get_CBox"},{"location":"ft2-outline_processing.html#ft_outline_get_bbox","text":"Defined in FT_BBOX_H (freetype/ftbbox.h). FT_EXPORT( FT_Error ) FT_Outline_Get_BBox ( FT_Outline * outline, FT_BBox *abbox ); Compute the exact bounding box of an outline. This is slower than computing the control box. However, it uses an advanced algorithm that returns very quickly when the two boxes coincide. Otherwise, the outline Bezier arcs are traversed to extract their extrema.","title":"FT_Outline_Get_BBox"},{"location":"ft2-outline_processing.html#ft_outline_get_bitmap","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Get_Bitmap ( FT_Library library, FT_Outline * outline, const FT_Bitmap *abitmap ); Render an outline within a bitmap. The outline's image is simply OR-ed to the target bitmap.","title":"FT_Outline_Get_Bitmap"},{"location":"ft2-outline_processing.html#ft_outline_render","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Render ( FT_Library library, FT_Outline * outline, FT_Raster_Params * params ); Render an outline within a bitmap using the current scan-convert.","title":"FT_Outline_Render"},{"location":"ft2-outline_processing.html#ft_outline_decompose","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Decompose ( FT_Outline * outline, const FT_Outline_Funcs * func_interface, void * user ); Walk over an outline's structure to decompose it into individual segments and Bezier arcs. This function also emits \u2018move to\u2019 operations to indicate the start of new contours in the outline.","title":"FT_Outline_Decompose"},{"location":"ft2-outline_processing.html#ft_outline_funcs","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; A structure to hold various function pointers used during outline decomposition in order to emit segments, conic, and cubic Beziers.","title":"FT_Outline_Funcs"},{"location":"ft2-outline_processing.html#ft_outline_movetofunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_MoveToFunc )( const FT_Vector * to, void * user ); # define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc A function pointer type used to describe the signature of a \u2018move to\u2019 function during outline walking/decomposition. A \u2018move to\u2019 is emitted to start a new contour in an outline.","title":"FT_Outline_MoveToFunc"},{"location":"ft2-outline_processing.html#ft_outline_linetofunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_LineToFunc )( const FT_Vector * to, void * user ); # define FT_Outline_LineTo_Func FT_Outline_LineToFunc A function pointer type used to describe the signature of a \u2018line to\u2019 function during outline walking/decomposition. A \u2018line to\u2019 is emitted to indicate a segment in the outline.","title":"FT_Outline_LineToFunc"},{"location":"ft2-outline_processing.html#ft_outline_conictofunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_ConicToFunc )( const FT_Vector * control, const FT_Vector * to, void * user ); # define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc A function pointer type used to describe the signature of a \u2018conic to\u2019 function during outline walking or decomposition. A \u2018conic to\u2019 is emitted to indicate a second-order Bezier arc in the outline.","title":"FT_Outline_ConicToFunc"},{"location":"ft2-outline_processing.html#ft_outline_cubictofunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_CubicToFunc )( const FT_Vector * control1, const FT_Vector * control2, const FT_Vector * to, void * user ); # define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc A function pointer type used to describe the signature of a \u2018cubic to\u2019 function during outline walking or decomposition. A \u2018cubic to\u2019 is emitted to indicate a third-order Bezier arc.","title":"FT_Outline_CubicToFunc"},{"location":"ft2-outline_processing.html#ft_orientation","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). typedef enum FT_Orientation_ { FT_ORIENTATION_TRUETYPE = 0, FT_ORIENTATION_POSTSCRIPT = 1, FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE , FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT , FT_ORIENTATION_NONE } FT_Orientation ; A list of values used to describe an outline's contour orientation. The TrueType and PostScript specifications use different conventions to determine whether outline contours should be filled or unfilled.","title":"FT_Orientation"},{"location":"ft2-outline_processing.html#ft_outline_get_orientation","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Orientation ) FT_Outline_Get_Orientation ( FT_Outline * outline ); This function analyzes a glyph outline and tries to compute its fill orientation (see FT_Orientation ). This is done by integrating the total area covered by the outline. The positive integral corresponds to the clockwise orientation and FT_ORIENTATION_POSTSCRIPT is returned. The negative integral corresponds to the counter-clockwise orientation and FT_ORIENTATION_TRUETYPE is returned. Note that this will return FT_ORIENTATION_TRUETYPE for empty outlines.","title":"FT_Outline_Get_Orientation"},{"location":"ft2-outline_processing.html#ft_outline_xxx","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). # define FT_OUTLINE_NONE 0x0 # define FT_OUTLINE_OWNER 0x1 # define FT_OUTLINE_EVEN_ODD_FILL 0x2 # define FT_OUTLINE_REVERSE_FILL 0x4 # define FT_OUTLINE_IGNORE_DROPOUTS 0x8 # define FT_OUTLINE_SMART_DROPOUTS 0x10 # define FT_OUTLINE_INCLUDE_STUBS 0x20 # define FT_OUTLINE_OVERLAP 0x40 # define FT_OUTLINE_HIGH_PRECISION 0x100 # define FT_OUTLINE_SINGLE_PASS 0x200 /* these constants are deprecated; use the corresponding */ /* ` FT_OUTLINE_XXX ` values instead */ # 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 A list of bit-field constants used for the flags in an outline's flags field.","title":"FT_OUTLINE_XXX"},{"location":"ft2-parameter_tags.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb Parameter Tags Parameter Tags \u00b6 Synopsis \u00b6 This section contains macros for the FT_Parameter structure that are used with various functions to activate some special functionality or different behaviour of various components of FreeType. FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \u00b6 # define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \\ FT_MAKE_TAG ( 'i', 'g', 'p', 'f' ) /* this constant is deprecated */ # define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \\ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY A tag for FT_Parameter to make FT_Open_Face ignore typographic family names in the \u2018name\u2019 table (introduced in OpenType version 1.4). Use this for backward compatibility with legacy systems that have a four-faces-per-family restriction. since 2.8 FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \u00b6 # define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \\ FT_MAKE_TAG ( 'i', 'g', 'p', 's' ) /* this constant is deprecated */ # define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \\ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY A tag for FT_Parameter to make FT_Open_Face ignore typographic subfamily names in the \u2018name\u2019 table (introduced in OpenType version 1.4). Use this for backward compatibility with legacy systems that have a four-faces-per-family restriction. since 2.8 FT_PARAM_TAG_INCREMENTAL \u00b6 # define FT_PARAM_TAG_INCREMENTAL \\ FT_MAKE_TAG ( 'i', 'n', 'c', 'r' ) An FT_Parameter tag to be used with FT_Open_Face to indicate incremental glyph loading. FT_PARAM_TAG_LCD_FILTER_WEIGHTS \u00b6 # define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \\ FT_MAKE_TAG ( 'l', 'c', 'd', 'f' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding argument specifies the five LCD filter weights for a given face (if using FT_LOAD_TARGET_LCD , for example), overriding the global default values or the values set up with FT_Library_SetLcdFilterWeights . since 2.8 FT_PARAM_TAG_RANDOM_SEED \u00b6 # define FT_PARAM_TAG_RANDOM_SEED \\ FT_MAKE_TAG ( 's', 'e', 'e', 'd' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding 32bit signed integer argument overrides the font driver's random seed value with a face-specific one; see random-seed . since 2.8 FT_PARAM_TAG_STEM_DARKENING \u00b6 # define FT_PARAM_TAG_STEM_DARKENING \\ FT_MAKE_TAG ( 'd', 'a', 'r', 'k' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding Boolean argument specifies whether to apply stem darkening, overriding the global default values or the values set up with FT_Property_Set (see no-stem-darkening ). This is a passive setting that only takes effect if the font driver or autohinter honors it, which the CFF, Type 1, and CID drivers always do, but the autohinter only in \u2018light\u2019 hinting mode (as of version 2.9). since 2.8 FT_PARAM_TAG_UNPATENTED_HINTING \u00b6 # define FT_PARAM_TAG_UNPATENTED_HINTING \\ FT_MAKE_TAG ( 'u', 'n', 'p', 'a' ) Deprecated, no effect. Previously: A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face .","title":"Parameter Tags"},{"location":"ft2-parameter_tags.html#parameter-tags","text":"","title":"Parameter Tags"},{"location":"ft2-parameter_tags.html#synopsis","text":"This section contains macros for the FT_Parameter structure that are used with various functions to activate some special functionality or different behaviour of various components of FreeType.","title":"Synopsis"},{"location":"ft2-parameter_tags.html#ft_param_tag_ignore_typographic_family","text":"# define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \\ FT_MAKE_TAG ( 'i', 'g', 'p', 'f' ) /* this constant is deprecated */ # define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \\ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY A tag for FT_Parameter to make FT_Open_Face ignore typographic family names in the \u2018name\u2019 table (introduced in OpenType version 1.4). Use this for backward compatibility with legacy systems that have a four-faces-per-family restriction.","title":"FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY"},{"location":"ft2-parameter_tags.html#ft_param_tag_ignore_typographic_subfamily","text":"# define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \\ FT_MAKE_TAG ( 'i', 'g', 'p', 's' ) /* this constant is deprecated */ # define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \\ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY A tag for FT_Parameter to make FT_Open_Face ignore typographic subfamily names in the \u2018name\u2019 table (introduced in OpenType version 1.4). Use this for backward compatibility with legacy systems that have a four-faces-per-family restriction.","title":"FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY"},{"location":"ft2-parameter_tags.html#ft_param_tag_incremental","text":"# define FT_PARAM_TAG_INCREMENTAL \\ FT_MAKE_TAG ( 'i', 'n', 'c', 'r' ) An FT_Parameter tag to be used with FT_Open_Face to indicate incremental glyph loading.","title":"FT_PARAM_TAG_INCREMENTAL"},{"location":"ft2-parameter_tags.html#ft_param_tag_lcd_filter_weights","text":"# define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \\ FT_MAKE_TAG ( 'l', 'c', 'd', 'f' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding argument specifies the five LCD filter weights for a given face (if using FT_LOAD_TARGET_LCD , for example), overriding the global default values or the values set up with FT_Library_SetLcdFilterWeights .","title":"FT_PARAM_TAG_LCD_FILTER_WEIGHTS"},{"location":"ft2-parameter_tags.html#ft_param_tag_random_seed","text":"# define FT_PARAM_TAG_RANDOM_SEED \\ FT_MAKE_TAG ( 's', 'e', 'e', 'd' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding 32bit signed integer argument overrides the font driver's random seed value with a face-specific one; see random-seed .","title":"FT_PARAM_TAG_RANDOM_SEED"},{"location":"ft2-parameter_tags.html#ft_param_tag_stem_darkening","text":"# define FT_PARAM_TAG_STEM_DARKENING \\ FT_MAKE_TAG ( 'd', 'a', 'r', 'k' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding Boolean argument specifies whether to apply stem darkening, overriding the global default values or the values set up with FT_Property_Set (see no-stem-darkening ). This is a passive setting that only takes effect if the font driver or autohinter honors it, which the CFF, Type 1, and CID drivers always do, but the autohinter only in \u2018light\u2019 hinting mode (as of version 2.9).","title":"FT_PARAM_TAG_STEM_DARKENING"},{"location":"ft2-parameter_tags.html#ft_param_tag_unpatented_hinting","text":"# define FT_PARAM_TAG_UNPATENTED_HINTING \\ FT_MAKE_TAG ( 'u', 'n', 'p', 'a' ) Deprecated, no effect. Previously: A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face .","title":"FT_PARAM_TAG_UNPATENTED_HINTING"},{"location":"ft2-pcf_driver.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The PCF driver The PCF driver \u00b6 Synopsis \u00b6 While FreeType's PCF driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . Right now, there is a single property no-long-family-names available if FreeType is compiled with PCF_CONFIG_OPTION_LONG_FAMILY_NAMES. The PCF driver's module name is \u2018pcf\u2019.","title":"The PCF driver"},{"location":"ft2-pcf_driver.html#the-pcf-driver","text":"","title":"The PCF driver"},{"location":"ft2-pcf_driver.html#synopsis","text":"While FreeType's PCF driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . Right now, there is a single property no-long-family-names available if FreeType is compiled with PCF_CONFIG_OPTION_LONG_FAMILY_NAMES. The PCF driver's module name is \u2018pcf\u2019.","title":"Synopsis"},{"location":"ft2-pfr_fonts.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb PFR Fonts PFR Fonts \u00b6 Synopsis \u00b6 This section contains the declaration of PFR-specific functions. FT_Get_PFR_Metrics \u00b6 Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Metrics ( FT_Face face, FT_UInt *aoutline_resolution, FT_UInt *ametrics_resolution, FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale ); Return the outline and metrics resolutions of a given PFR face. input face Handle to the input face. It can be a non-PFR face. output aoutline_resolution Outline resolution. This is equivalent to face->units_per_EM for non-PFR fonts. Optional (parameter can be NULL ). ametrics_resolution Metrics resolution. This is equivalent to outline_resolution for non-PFR fonts. Optional (parameter can be NULL ). ametrics_x_scale A 16.16 fixed-point number used to scale distance expressed in metrics units to device subpixels. This is equivalent to face->size->x_scale , but for metrics only. Optional (parameter can be NULL ). ametrics_y_scale Same as ametrics_x_scale but for the vertical direction. optional (parameter can be NULL ). return FreeType error code. 0 means success. note If the input face is not a PFR, this function will return an error. However, in all cases, it will return valid values. FT_Get_PFR_Kerning \u00b6 Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Kerning ( FT_Face face, FT_UInt left, FT_UInt right, FT_Vector *avector ); Return the kerning pair corresponding to two glyphs in a PFR face. The distance is expressed in metrics units, unlike the result of FT_Get_Kerning . input face A handle to the input face. left Index of the left glyph. right Index of the right glyph. output avector A kerning vector. return FreeType error code. 0 means success. note This function always return distances in original PFR metrics units. This is unlike FT_Get_Kerning with the FT_KERNING_UNSCALED mode, which always returns distances converted to outline units. You can use the value of the x_scale and y_scale parameters returned by FT_Get_PFR_Metrics to scale these to device subpixels. FT_Get_PFR_Advance \u00b6 Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Advance ( FT_Face face, FT_UInt gindex, FT_Pos *aadvance ); Return a given glyph advance, expressed in original metrics units, from a PFR font. input face A handle to the input face. gindex The glyph index. output aadvance The glyph advance in metrics units. return FreeType error code. 0 means success. note You can use the x_scale or y_scale results of FT_Get_PFR_Metrics to convert the advance to device subpixels (i.e., 1/64 th of pixels).","title":"PFR Fonts"},{"location":"ft2-pfr_fonts.html#pfr-fonts","text":"","title":"PFR Fonts"},{"location":"ft2-pfr_fonts.html#synopsis","text":"This section contains the declaration of PFR-specific functions.","title":"Synopsis"},{"location":"ft2-pfr_fonts.html#ft_get_pfr_metrics","text":"Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Metrics ( FT_Face face, FT_UInt *aoutline_resolution, FT_UInt *ametrics_resolution, FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale ); Return the outline and metrics resolutions of a given PFR face.","title":"FT_Get_PFR_Metrics"},{"location":"ft2-pfr_fonts.html#ft_get_pfr_kerning","text":"Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Kerning ( FT_Face face, FT_UInt left, FT_UInt right, FT_Vector *avector ); Return the kerning pair corresponding to two glyphs in a PFR face. The distance is expressed in metrics units, unlike the result of FT_Get_Kerning .","title":"FT_Get_PFR_Kerning"},{"location":"ft2-pfr_fonts.html#ft_get_pfr_advance","text":"Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Advance ( FT_Face face, FT_UInt gindex, FT_Pos *aadvance ); Return a given glyph advance, expressed in original metrics units, from a PFR font.","title":"FT_Get_PFR_Advance"},{"location":"ft2-preamble.html","text":"FreeType \u00bb Docs \u00bb General Remarks \u00bb Preamble Preamble \u00b6 Synopsis \u00b6 FreeType is a library that provides access to glyphs in font files. It scales the glyph images and their metrics to a requested size, and it rasterizes the glyph images to produce pixel or subpixel alpha coverage bitmaps. Note that FreeType is not a text layout engine. You have to use higher-level libraries like HarfBuzz, Pango, or ICU for that. Note also that FreeType does not perform alpha blending or compositing the resulting bitmaps or pixmaps by itself. Use your favourite graphics library (for example, Cairo or Skia) to further process FreeType's output.","title":"Preamble"},{"location":"ft2-preamble.html#preamble","text":"","title":"Preamble"},{"location":"ft2-preamble.html#synopsis","text":"FreeType is a library that provides access to glyphs in font files. It scales the glyph images and their metrics to a requested size, and it rasterizes the glyph images to produce pixel or subpixel alpha coverage bitmaps. Note that FreeType is not a text layout engine. You have to use higher-level libraries like HarfBuzz, Pango, or ICU for that. Note also that FreeType does not perform alpha blending or compositing the resulting bitmaps or pixmaps by itself. Use your favourite graphics library (for example, Cairo or Skia) to further process FreeType's output.","title":"Synopsis"},{"location":"ft2-properties.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb Driver properties Driver properties \u00b6 Synopsis \u00b6 Driver modules can be controlled by setting and unsetting properties, using the functions FT_Property_Set and FT_Property_Get . This section documents the available properties, together with auxiliary macros and structures. FT_HINTING_XXX \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). # define FT_HINTING_FREETYPE 0 # define FT_HINTING_ADOBE 1 /* these constants (introduced in 2.4.12) are deprecated */ # define FT_CFF_HINTING_FREETYPE FT_HINTING_FREETYPE # define FT_CFF_HINTING_ADOBE FT_HINTING_ADOBE A list of constants used for the hinting-engine property to select the hinting engine for CFF, Type 1, and CID fonts. values FT_HINTING_FREETYPE Use the old FreeType hinting engine. FT_HINTING_ADOBE Use the hinting engine contributed by Adobe. since 2.9 hinting-engine \u00b6 Thanks to Adobe, which contributed a new hinting (and parsing) engine, an application can select between \u2018freetype\u2019 and \u2018adobe\u2019 if compiled with CFF_CONFIG_OPTION_OLD_ENGINE . If this configuration macro isn't defined, \u2018hinting-engine\u2019 does nothing. The same holds for the Type 1 and CID modules if compiled with T1_CONFIG_OPTION_OLD_ENGINE . For the \u2018cff\u2019 module, the default engine is \u2018adobe\u2019. For both the \u2018type1\u2019 and \u2018t1cid\u2019 modules, the default engine is \u2018adobe\u2019, too. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable (using values \u2018adobe\u2019 or \u2018freetype\u2019). example The following example code demonstrates how to select Adobe's hinting engine for the \u2018cff\u2019 module (omitting the error handling). FT_Library library; FT_UInt hinting_engine = FT_HINTING_ADOBE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"cff\", \"hinting-engine\", &hinting_engine ); since 2.4.12 (for \u2018cff\u2019 module) 2.9 (for \u2018type1\u2019 and \u2018t1cid\u2019 modules) no-stem-darkening \u00b6 All glyphs that pass through the auto-hinter will be emboldened unless this property is set to TRUE. The same is true for the CFF, Type 1, and CID font modules if the \u2018Adobe\u2019 engine is selected (which is the default). Stem darkening emboldens glyphs at smaller sizes to make them more readable on common low-DPI screens when using linear alpha blending and gamma correction, see FT_Render_Glyph . When not using linear alpha blending and gamma correction, glyphs will appear heavy and fuzzy! Gamma correction essentially lightens fonts since shades of grey are shifted to higher pixel values (= higher brightness) to match the original intention to the reality of our screens. The side-effect is that glyphs \u2018thin out\u2019. Mac OS X and Adobe's proprietary font rendering library implement a counter-measure: stem darkening at smaller sizes where shades of gray dominate. By emboldening a glyph slightly in relation to its pixel size, individual pixels get higher coverage of filled-in outlines and are therefore \u2018blacker\u2019. This counteracts the \u2018thinning out\u2019 of glyphs, making text remain readable at smaller sizes. For the auto-hinter, stem-darkening is experimental currently and thus switched off by default (this is, no-stem-darkening is set to TRUE by default). Total consistency with the CFF driver is not achieved right now because the emboldening method differs and glyphs must be scaled down on the Y-axis to keep outline points inside their precomputed blue zones. The smaller the size (especially 9ppem and down), the higher the loss of emboldening versus the CFF driver. Note that stem darkening is never applied if FT_LOAD_NO_SCALE is set. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable (using values 1 and 0 for \u2018on\u2019 and \u2018off\u2019, respectively). It can also be set per face using FT_Face_Properties with FT_PARAM_TAG_STEM_DARKENING . example FT_Library library; FT_Bool no_stem_darkening = TRUE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"cff\", \"no-stem-darkening\", &no_stem_darkening ); since 2.4.12 (for \u2018cff\u2019 module) 2.6.2 (for \u2018autofitter\u2019 module) 2.9 (for \u2018type1\u2019 and \u2018t1cid\u2019 modules) darkening-parameters \u00b6 By default, the Adobe hinting engine, as used by the CFF, Type 1, and CID font drivers, darkens stems as follows (if the no-stem-darkening property isn't set): stem width <= 0.5px: darkening amount = 0.4px stem width = 1px: darkening amount = 0.275px stem width = 1.667px: darkening amount = 0.275px stem width >= 2.333px: darkening amount = 0px and piecewise linear in-between. At configuration time, these four control points can be set with the macro CFF_CONFIG_OPTION_DARKENING_PARAMETERS ; the CFF, Type 1, and CID drivers share these values. At runtime, the control points can be changed using the darkening-parameters property (see the example below that demonstrates this for the Type 1 driver). The x values give the stem width, and the y values the darkening amount. The unit is 1000 th of pixels. All coordinate values must be positive; the x values must be monotonically increasing; the y values must be monotonically decreasing and smaller than or equal to 500 (corresponding to half a pixel); the slope of each linear piece must be shallower than -1 (e.g., -.4). The auto-hinter provides this property, too, as an experimental feature. See no-stem-darkening for more. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable, using eight comma-separated integers without spaces. Here the above example, using \\ to break the line for readability. FREETYPE_PROPERTIES=\\ type1:darkening-parameters=500,300,1000,200,1500,100,2000,0 example FT_Library library; FT_Int darken_params[8] = { 500, 300, // x1, y1 1000, 200, // x2, y2 1500, 100, // x3, y3 2000, 0 }; // x4, y4 FT_Init_FreeType( &library ); FT_Property_Set( library, \"type1\", \"darkening-parameters\", darken_params ); since 2.5.1 (for \u2018cff\u2019 module) 2.6.2 (for \u2018autofitter\u2019 module) 2.9 (for \u2018type1\u2019 and \u2018t1cid\u2019 modules) random-seed \u00b6 By default, the seed value for the CFF \u2018random\u2019 operator and the similar \u20180 28 callothersubr pop\u2019 command for the Type 1 and CID drivers is set to a random value. However, mainly for debugging purposes, it is often necessary to use a known value as a seed so that the pseudo-random number sequences generated by \u2018random\u2019 are repeatable. The random-seed property does that. Its argument is a signed 32bit integer; if the value is zero or negative, the seed given by the intitialRandomSeed private DICT operator in a CFF file gets used (or a default value if there is no such operator). If the value is positive, use it instead of initialRandomSeed , which is consequently ignored. note This property can be set via the FREETYPE_PROPERTIES environment variable. It can also be set per face using FT_Face_Properties with FT_PARAM_TAG_RANDOM_SEED . since 2.8 (for \u2018cff\u2019 module) 2.9 (for \u2018type1\u2019 and \u2018t1cid\u2019 modules) no-long-family-names \u00b6 If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling FreeType, the PCF driver constructs long family names. There are many PCF fonts just called \u2018Fixed\u2019 which look completely different, and which have nothing to do with each other. When selecting \u2018Fixed\u2019 in KDE or Gnome one gets results that appear rather random, the style changes often if one changes the size and one cannot select some fonts at all. The improve this situation, the PCF module prepends the foundry name (plus a space) to the family name. It also checks whether there are \u2018wide\u2019 characters; all put together, family names like \u2018Sony Fixed\u2019 or \u2018Misc Fixed Wide\u2019 are constructed. If no-long-family-names is set, this feature gets switched off. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable (using values 1 and 0 for \u2018on\u2019 and \u2018off\u2019, respectively). example FT_Library library; FT_Bool no_long_family_names = TRUE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"pcf\", \"no-long-family-names\", &no_long_family_names ); since 2.8 TT_INTERPRETER_VERSION_XXX \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). # define TT_INTERPRETER_VERSION_35 35 # define TT_INTERPRETER_VERSION_38 38 # define TT_INTERPRETER_VERSION_40 40 A list of constants used for the interpreter-version property to select the hinting engine for Truetype fonts. The numeric value in the constant names represents the version number as returned by the \u2018GETINFO\u2019 bytecode instruction. values TT_INTERPRETER_VERSION_35 Version 35 corresponds to MS rasterizer v.1.7 as used e.g. in Windows 98; only grayscale and B/W rasterizing is supported. TT_INTERPRETER_VERSION_38 Version 38 corresponds to MS rasterizer v.1.9; it is roughly equivalent to the hinting provided by DirectWrite ClearType (as can be found, for example, in the Internet Explorer 9 running on Windows 7). It is used in FreeType to select the \u2018Infinality\u2019 subpixel hinting code. The code may be removed in a future version. TT_INTERPRETER_VERSION_40 Version 40 corresponds to MS rasterizer v.2.1; it is roughly equivalent to the hinting provided by DirectWrite ClearType (as can be found, for example, in Microsoft's Edge Browser on Windows 10). It is used in FreeType to select the \u2018minimal\u2019 subpixel hinting code, a stripped-down and higher performance version of the \u2018Infinality\u2019 code. note This property controls the behaviour of the bytecode interpreter and thus how outlines get hinted. It does not control how glyph get rasterized! In particular, it does not control subpixel color filtering. If FreeType has not been compiled with the configuration option TT_CONFIG_OPTION_SUBPIXEL_HINTING , selecting version 38 or 40 causes an FT_Err_Unimplemented_Feature error. Depending on the graphics framework, Microsoft uses different bytecode and rendering engines. As a consequence, the version numbers returned by a call to the \u2018GETINFO\u2019 bytecode instruction are more convoluted than desired. Here are two tables that try to shed some light on the possible values for the MS rasterizer engine, together with the additional features introduced by it. GETINFO framework version feature ------------------------------------------------------------------- 3 GDI (Win 3.1), v1.0 16-bit, first version TrueImage 33 GDI (Win NT 3.1), v1.5 32-bit HP Laserjet 34 GDI (Win 95) v1.6 font smoothing, new SCANTYPE opcode 35 GDI (Win 98/2000) v1.7 (UN)SCALED_COMPONENT_OFFSET bits in composite glyphs 36 MGDI (Win CE 2) v1.6+ classic ClearType 37 GDI (XP and later), v1.8 ClearType GDI+ old (before Vista) 38 GDI+ old (Vista, Win 7), v1.9 subpixel ClearType, WPF Y-direction ClearType, additional error checking 39 DWrite (before Win 8) v2.0 subpixel ClearType flags in GETINFO opcode, bug fixes 40 GDI+ (after Win 7), v2.1 Y-direction ClearType flag DWrite (Win 8) in GETINFO opcode, Gray ClearType The \u2018version\u2019 field gives a rough orientation only, since some applications provided certain features much earlier (as an example, Microsoft Reader used subpixel and Y-direction ClearType already in Windows 2000). Similarly, updates to a given framework might include improved hinting support. version sampling rendering comment x y x y -------------------------------------------------------------- v1.0 normal normal B/W B/W bi-level v1.6 high high gray gray grayscale v1.8 high normal color-filter B/W (GDI) ClearType v1.9 high high color-filter gray Color ClearType v2.1 high normal gray B/W Gray ClearType v2.1 high high gray gray Gray ClearType Color and Gray ClearType are the two available variants of \u2018Y-direction ClearType\u2019, meaning grayscale rasterization along the Y-direction; the name used in the TrueType specification for this feature is \u2018symmetric smoothing\u2019. \u2018Classic ClearType\u2019 is the original algorithm used before introducing a modified version in Win XP. Another name for v1.6's grayscale rendering is \u2018font smoothing\u2019, and \u2018Color ClearType\u2019 is sometimes also called \u2018DWrite ClearType\u2019. To differentiate between today's Color ClearType and the earlier ClearType variant with B/W rendering along the vertical axis, the latter is sometimes called \u2018GDI ClearType\u2019. \u2018Normal\u2019 and \u2018high\u2019 sampling describe the (virtual) resolution to access the rasterized outline after the hinting process. \u2018Normal\u2019 means 1 sample per grid line (i.e., B/W). In the current Microsoft implementation, \u2018high\u2019 means an extra virtual resolution of 16x16 (or 16x1) grid lines per pixel for bytecode instructions like \u2018MIRP\u2019. After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid lines for color filtering if Color ClearType is activated. Note that \u2018Gray ClearType\u2019 is essentially the same as v1.6's grayscale rendering. However, the GETINFO instruction handles it differently: v1.6 returns bit 12 (hinting for grayscale), while v2.1 returns bits 13 (hinting for ClearType), 18 (symmetrical smoothing), and 19 (Gray ClearType). Also, this mode respects bits 2 and 3 for the version 1 gasp table exclusively (like Color ClearType), while v1.6 only respects the values of version 0 (bits 0 and 1). Keep in mind that the features of the above interpreter versions might not map exactly to FreeType features or behavior because it is a fundamentally different library with different internals. interpreter-version \u00b6 Currently, three versions are available, two representing the bytecode interpreter with subpixel hinting support (old \u2018Infinality\u2019 code and new stripped-down and higher performance \u2018minimal\u2019 code) and one without, respectively. The default is subpixel support if TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support otherwise (since it isn't available then). If subpixel hinting is on, many TrueType bytecode instructions behave differently compared to B/W or grayscale rendering (except if \u2018native ClearType\u2019 is selected by the font). Microsoft's main idea is to render at a much increased horizontal resolution, then sampling down the created output to subpixel precision. However, many older fonts are not suited to this and must be specially taken care of by applying (hardcoded) tweaks in Microsoft's interpreter. Details on subpixel hinting and some of the necessary tweaks can be found in Greg Hitchcock's whitepaper at \u2018 https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx \u2019. Note that FreeType currently doesn't really \u2018subpixel hint\u2019 (6x1, 6x2, or 6x5 supersampling) like discussed in the paper. Depending on the chosen interpreter, it simply ignores instructions on vertical stems to arrive at very similar results. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable (using values \u201835\u2019, \u201838\u2019, or \u201840\u2019). example The following example code demonstrates how to deactivate subpixel hinting (omitting the error handling). FT_Library library; FT_Face face; FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35; FT_Init_FreeType( &library ); FT_Property_Set( library, \"truetype\", \"interpreter-version\", &interpreter_version ); since 2.5 glyph-to-script-map \u00b6 Experimental only The auto-hinter provides various script modules to hint glyphs. Examples of supported scripts are Latin or CJK. Before a glyph is auto-hinted, the Unicode character map of the font gets examined, and the script is then determined based on Unicode character ranges, see below. OpenType fonts, however, often provide much more glyphs than character codes (small caps, superscripts, ligatures, swashes, etc.), to be controlled by so-called \u2018features\u2019. Handling OpenType features can be quite complicated and thus needs a separate library on top of FreeType. The mapping between glyph indices and scripts (in the auto-hinter sense, see the FT_AUTOHINTER_SCRIPT_XXX values) is stored as an array with num_glyphs elements, as found in the font's FT_Face structure. The glyph-to-script-map property returns a pointer to this array, which can be modified as needed. Note that the modification should happen before the first glyph gets processed by the auto-hinter so that the global analysis of the font shapes actually uses the modified mapping. example The following example code demonstrates how to access it (omitting the error handling). FT_Library library; FT_Face face; FT_Prop_GlyphToScriptMap prop; FT_Init_FreeType( &library ); FT_New_Face( library, \"foo.ttf\", 0, &face ); prop.face = face; FT_Property_Get( library, \"autofitter\", \"glyph-to-script-map\", &prop ); // adjust `prop.map' as needed right here FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT ); since 2.4.11 FT_AUTOHINTER_SCRIPT_XXX \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). # define FT_AUTOHINTER_SCRIPT_NONE 0 # define FT_AUTOHINTER_SCRIPT_LATIN 1 # define FT_AUTOHINTER_SCRIPT_CJK 2 # define FT_AUTOHINTER_SCRIPT_INDIC 3 Experimental only A list of constants used for the glyph-to-script-map property to specify the script submodule the auto-hinter should use for hinting a particular glyph. values FT_AUTOHINTER_SCRIPT_NONE Don't auto-hint this glyph. FT_AUTOHINTER_SCRIPT_LATIN Apply the latin auto-hinter. For the auto-hinter, \u2018latin\u2019 is a very broad term, including Cyrillic and Greek also since characters from those scripts share the same design constraints. By default, characters from the following Unicode ranges are assigned to this submodule. U+0020 - U+007F // Basic Latin (no control characters) U+00A0 - U+00FF // Latin-1 Supplement (no control characters) U+0100 - U+017F // Latin Extended-A U+0180 - U+024F // Latin Extended-B U+0250 - U+02AF // IPA Extensions U+02B0 - U+02FF // Spacing Modifier Letters U+0300 - U+036F // Combining Diacritical Marks U+0370 - U+03FF // Greek and Coptic U+0400 - U+04FF // Cyrillic U+0500 - U+052F // Cyrillic Supplement U+1D00 - U+1D7F // Phonetic Extensions U+1D80 - U+1DBF // Phonetic Extensions Supplement U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement U+1E00 - U+1EFF // Latin Extended Additional U+1F00 - U+1FFF // Greek Extended U+2000 - U+206F // General Punctuation U+2070 - U+209F // Superscripts and Subscripts U+20A0 - U+20CF // Currency Symbols U+2150 - U+218F // Number Forms U+2460 - U+24FF // Enclosed Alphanumerics U+2C60 - U+2C7F // Latin Extended-C U+2DE0 - U+2DFF // Cyrillic Extended-A U+2E00 - U+2E7F // Supplemental Punctuation U+A640 - U+A69F // Cyrillic Extended-B U+A720 - U+A7FF // Latin Extended-D U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures) U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement FT_AUTOHINTER_SCRIPT_CJK Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old Vietnamese, and some other scripts. By default, characters from the following Unicode ranges are assigned to this submodule. U+1100 - U+11FF // Hangul Jamo U+2E80 - U+2EFF // CJK Radicals Supplement U+2F00 - U+2FDF // Kangxi Radicals U+2FF0 - U+2FFF // Ideographic Description Characters U+3000 - U+303F // CJK Symbols and Punctuation U+3040 - U+309F // Hiragana U+30A0 - U+30FF // Katakana U+3100 - U+312F // Bopomofo U+3130 - U+318F // Hangul Compatibility Jamo U+3190 - U+319F // Kanbun U+31A0 - U+31BF // Bopomofo Extended U+31C0 - U+31EF // CJK Strokes U+31F0 - U+31FF // Katakana Phonetic Extensions U+3200 - U+32FF // Enclosed CJK Letters and Months U+3300 - U+33FF // CJK Compatibility U+3400 - U+4DBF // CJK Unified Ideographs Extension A U+4DC0 - U+4DFF // Yijing Hexagram Symbols U+4E00 - U+9FFF // CJK Unified Ideographs U+A960 - U+A97F // Hangul Jamo Extended-A U+AC00 - U+D7AF // Hangul Syllables U+D7B0 - U+D7FF // Hangul Jamo Extended-B U+F900 - U+FAFF // CJK Compatibility Ideographs U+FE10 - U+FE1F // Vertical forms U+FE30 - U+FE4F // CJK Compatibility Forms U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms U+1B000 - U+1B0FF // Kana Supplement U+1D300 - U+1D35F // Tai Xuan Hing Symbols U+1F200 - U+1F2FF // Enclosed Ideographic Supplement U+20000 - U+2A6DF // CJK Unified Ideographs Extension B U+2A700 - U+2B73F // CJK Unified Ideographs Extension C U+2B740 - U+2B81F // CJK Unified Ideographs Extension D U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement FT_AUTOHINTER_SCRIPT_INDIC Apply the indic auto-hinter, covering all major scripts from the Indian sub-continent and some other related scripts like Thai, Lao, or Tibetan. By default, characters from the following Unicode ranges are assigned to this submodule. U+0900 - U+0DFF // Indic Range U+0F00 - U+0FFF // Tibetan U+1900 - U+194F // Limbu U+1B80 - U+1BBF // Sundanese U+A800 - U+A82F // Syloti Nagri U+ABC0 - U+ABFF // Meetei Mayek U+11800 - U+118DF // Sharada Note that currently Indic support is rudimentary only, missing blue zone support. since 2.4.11 FT_Prop_GlyphToScriptMap \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). typedef struct FT_Prop_GlyphToScriptMap_ { FT_Face face; FT_UShort * map; } FT_Prop_GlyphToScriptMap ; Experimental only The data exchange structure for the glyph-to-script-map property. since 2.4.11 fallback-script \u00b6 Experimental only If no auto-hinter script module can be assigned to a glyph, a fallback script gets assigned to it (see also the glyph-to-script-map property). By default, this is FT_AUTOHINTER_SCRIPT_CJK . Using the fallback-script property, this fallback value can be changed. note This property can be used with FT_Property_Get also. It's important to use the right timing for changing this value: The creation of the glyph-to-script map that eventually uses the fallback script value gets triggered either by setting or reading a face-specific property like glyph-to-script-map , or by auto-hinting any glyph from that face. In particular, if you have already created an FT_Face structure but not loaded any glyph (using the auto-hinter), a change of the fallback script will affect this face. example FT_Library library; FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"autofitter\", \"fallback-script\", &fallback_script ); since 2.4.11 default-script \u00b6 Experimental only If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make the HarfBuzz library access OpenType features for getting better glyph coverages, this property sets the (auto-fitter) script to be used for the default (OpenType) script data of a font's GSUB table. Features for the default script are intended for all scripts not explicitly handled in GSUB; an example is a \u2018dlig\u2019 feature, containing the combination of the characters \u2018T\u2019, \u2018E\u2019, and \u2018L\u2019 to form a \u2018TEL\u2019 ligature. By default, this is FT_AUTOHINTER_SCRIPT_LATIN . Using the default-script property, this default value can be changed. note This property can be used with FT_Property_Get also. It's important to use the right timing for changing this value: The creation of the glyph-to-script map that eventually uses the default script value gets triggered either by setting or reading a face-specific property like glyph-to-script-map , or by auto-hinting any glyph from that face. In particular, if you have already created an FT_Face structure but not loaded any glyph (using the auto-hinter), a change of the default script will affect this face. example FT_Library library; FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"autofitter\", \"default-script\", &default_script ); since 2.5.3 increase-x-height \u00b6 For ppem values in the range 6 <= ppem <= increase-x-height , round up the font's x height much more often than normally. If the value is set to 0, which is the default, this feature is switched off. Use this property to improve the legibility of small font sizes if necessary. note This property can be used with FT_Property_Get also. Set this value right after calling FT_Set_Char_Size , but before loading any glyph (using the auto-hinter). example FT_Library library; FT_Face face; FT_Prop_IncreaseXHeight prop; FT_Init_FreeType( &library ); FT_New_Face( library, \"foo.ttf\", 0, &face ); FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 ); prop.face = face; prop.limit = 14; FT_Property_Set( library, \"autofitter\", \"increase-x-height\", &prop ); since 2.4.11 FT_Prop_IncreaseXHeight \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). typedef struct FT_Prop_IncreaseXHeight_ { FT_Face face; FT_UInt limit; } FT_Prop_IncreaseXHeight ; The data exchange structure for the increase-x-height property. warping \u00b6 Obsolete This property was always experimental and probably never worked correctly. It was entirely removed from the FreeType 2 sources. This entry is only here for historical reference. Warping only worked in \u2018normal\u2019 auto-hinting mode replacing it. The idea of the code was to slightly scale and shift a glyph along the non-hinted dimension (which is usually the horizontal axis) so that as much of its segments were aligned (more or less) to the grid. To find out a glyph's optimal scaling and shifting value, various parameter combinations were tried and scored. since 2.6","title":"Driver properties"},{"location":"ft2-properties.html#driver-properties","text":"","title":"Driver properties"},{"location":"ft2-properties.html#synopsis","text":"Driver modules can be controlled by setting and unsetting properties, using the functions FT_Property_Set and FT_Property_Get . This section documents the available properties, together with auxiliary macros and structures.","title":"Synopsis"},{"location":"ft2-properties.html#ft_hinting_xxx","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). # define FT_HINTING_FREETYPE 0 # define FT_HINTING_ADOBE 1 /* these constants (introduced in 2.4.12) are deprecated */ # define FT_CFF_HINTING_FREETYPE FT_HINTING_FREETYPE # define FT_CFF_HINTING_ADOBE FT_HINTING_ADOBE A list of constants used for the hinting-engine property to select the hinting engine for CFF, Type 1, and CID fonts.","title":"FT_HINTING_XXX"},{"location":"ft2-properties.html#hinting-engine","text":"Thanks to Adobe, which contributed a new hinting (and parsing) engine, an application can select between \u2018freetype\u2019 and \u2018adobe\u2019 if compiled with CFF_CONFIG_OPTION_OLD_ENGINE . If this configuration macro isn't defined, \u2018hinting-engine\u2019 does nothing. The same holds for the Type 1 and CID modules if compiled with T1_CONFIG_OPTION_OLD_ENGINE . For the \u2018cff\u2019 module, the default engine is \u2018adobe\u2019. For both the \u2018type1\u2019 and \u2018t1cid\u2019 modules, the default engine is \u2018adobe\u2019, too.","title":"hinting-engine"},{"location":"ft2-properties.html#no-stem-darkening","text":"All glyphs that pass through the auto-hinter will be emboldened unless this property is set to TRUE. The same is true for the CFF, Type 1, and CID font modules if the \u2018Adobe\u2019 engine is selected (which is the default). Stem darkening emboldens glyphs at smaller sizes to make them more readable on common low-DPI screens when using linear alpha blending and gamma correction, see FT_Render_Glyph . When not using linear alpha blending and gamma correction, glyphs will appear heavy and fuzzy! Gamma correction essentially lightens fonts since shades of grey are shifted to higher pixel values (= higher brightness) to match the original intention to the reality of our screens. The side-effect is that glyphs \u2018thin out\u2019. Mac OS X and Adobe's proprietary font rendering library implement a counter-measure: stem darkening at smaller sizes where shades of gray dominate. By emboldening a glyph slightly in relation to its pixel size, individual pixels get higher coverage of filled-in outlines and are therefore \u2018blacker\u2019. This counteracts the \u2018thinning out\u2019 of glyphs, making text remain readable at smaller sizes. For the auto-hinter, stem-darkening is experimental currently and thus switched off by default (this is, no-stem-darkening is set to TRUE by default). Total consistency with the CFF driver is not achieved right now because the emboldening method differs and glyphs must be scaled down on the Y-axis to keep outline points inside their precomputed blue zones. The smaller the size (especially 9ppem and down), the higher the loss of emboldening versus the CFF driver. Note that stem darkening is never applied if FT_LOAD_NO_SCALE is set.","title":"no-stem-darkening"},{"location":"ft2-properties.html#darkening-parameters","text":"By default, the Adobe hinting engine, as used by the CFF, Type 1, and CID font drivers, darkens stems as follows (if the no-stem-darkening property isn't set): stem width <= 0.5px: darkening amount = 0.4px stem width = 1px: darkening amount = 0.275px stem width = 1.667px: darkening amount = 0.275px stem width >= 2.333px: darkening amount = 0px and piecewise linear in-between. At configuration time, these four control points can be set with the macro CFF_CONFIG_OPTION_DARKENING_PARAMETERS ; the CFF, Type 1, and CID drivers share these values. At runtime, the control points can be changed using the darkening-parameters property (see the example below that demonstrates this for the Type 1 driver). The x values give the stem width, and the y values the darkening amount. The unit is 1000 th of pixels. All coordinate values must be positive; the x values must be monotonically increasing; the y values must be monotonically decreasing and smaller than or equal to 500 (corresponding to half a pixel); the slope of each linear piece must be shallower than -1 (e.g., -.4). The auto-hinter provides this property, too, as an experimental feature. See no-stem-darkening for more.","title":"darkening-parameters"},{"location":"ft2-properties.html#random-seed","text":"By default, the seed value for the CFF \u2018random\u2019 operator and the similar \u20180 28 callothersubr pop\u2019 command for the Type 1 and CID drivers is set to a random value. However, mainly for debugging purposes, it is often necessary to use a known value as a seed so that the pseudo-random number sequences generated by \u2018random\u2019 are repeatable. The random-seed property does that. Its argument is a signed 32bit integer; if the value is zero or negative, the seed given by the intitialRandomSeed private DICT operator in a CFF file gets used (or a default value if there is no such operator). If the value is positive, use it instead of initialRandomSeed , which is consequently ignored.","title":"random-seed"},{"location":"ft2-properties.html#no-long-family-names","text":"If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling FreeType, the PCF driver constructs long family names. There are many PCF fonts just called \u2018Fixed\u2019 which look completely different, and which have nothing to do with each other. When selecting \u2018Fixed\u2019 in KDE or Gnome one gets results that appear rather random, the style changes often if one changes the size and one cannot select some fonts at all. The improve this situation, the PCF module prepends the foundry name (plus a space) to the family name. It also checks whether there are \u2018wide\u2019 characters; all put together, family names like \u2018Sony Fixed\u2019 or \u2018Misc Fixed Wide\u2019 are constructed. If no-long-family-names is set, this feature gets switched off.","title":"no-long-family-names"},{"location":"ft2-properties.html#tt_interpreter_version_xxx","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). # define TT_INTERPRETER_VERSION_35 35 # define TT_INTERPRETER_VERSION_38 38 # define TT_INTERPRETER_VERSION_40 40 A list of constants used for the interpreter-version property to select the hinting engine for Truetype fonts. The numeric value in the constant names represents the version number as returned by the \u2018GETINFO\u2019 bytecode instruction.","title":"TT_INTERPRETER_VERSION_XXX"},{"location":"ft2-properties.html#interpreter-version","text":"Currently, three versions are available, two representing the bytecode interpreter with subpixel hinting support (old \u2018Infinality\u2019 code and new stripped-down and higher performance \u2018minimal\u2019 code) and one without, respectively. The default is subpixel support if TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support otherwise (since it isn't available then). If subpixel hinting is on, many TrueType bytecode instructions behave differently compared to B/W or grayscale rendering (except if \u2018native ClearType\u2019 is selected by the font). Microsoft's main idea is to render at a much increased horizontal resolution, then sampling down the created output to subpixel precision. However, many older fonts are not suited to this and must be specially taken care of by applying (hardcoded) tweaks in Microsoft's interpreter. Details on subpixel hinting and some of the necessary tweaks can be found in Greg Hitchcock's whitepaper at \u2018 https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx \u2019. Note that FreeType currently doesn't really \u2018subpixel hint\u2019 (6x1, 6x2, or 6x5 supersampling) like discussed in the paper. Depending on the chosen interpreter, it simply ignores instructions on vertical stems to arrive at very similar results.","title":"interpreter-version"},{"location":"ft2-properties.html#glyph-to-script-map","text":"Experimental only The auto-hinter provides various script modules to hint glyphs. Examples of supported scripts are Latin or CJK. Before a glyph is auto-hinted, the Unicode character map of the font gets examined, and the script is then determined based on Unicode character ranges, see below. OpenType fonts, however, often provide much more glyphs than character codes (small caps, superscripts, ligatures, swashes, etc.), to be controlled by so-called \u2018features\u2019. Handling OpenType features can be quite complicated and thus needs a separate library on top of FreeType. The mapping between glyph indices and scripts (in the auto-hinter sense, see the FT_AUTOHINTER_SCRIPT_XXX values) is stored as an array with num_glyphs elements, as found in the font's FT_Face structure. The glyph-to-script-map property returns a pointer to this array, which can be modified as needed. Note that the modification should happen before the first glyph gets processed by the auto-hinter so that the global analysis of the font shapes actually uses the modified mapping.","title":"glyph-to-script-map"},{"location":"ft2-properties.html#ft_autohinter_script_xxx","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). # define FT_AUTOHINTER_SCRIPT_NONE 0 # define FT_AUTOHINTER_SCRIPT_LATIN 1 # define FT_AUTOHINTER_SCRIPT_CJK 2 # define FT_AUTOHINTER_SCRIPT_INDIC 3 Experimental only A list of constants used for the glyph-to-script-map property to specify the script submodule the auto-hinter should use for hinting a particular glyph.","title":"FT_AUTOHINTER_SCRIPT_XXX"},{"location":"ft2-properties.html#ft_prop_glyphtoscriptmap","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). typedef struct FT_Prop_GlyphToScriptMap_ { FT_Face face; FT_UShort * map; } FT_Prop_GlyphToScriptMap ; Experimental only The data exchange structure for the glyph-to-script-map property.","title":"FT_Prop_GlyphToScriptMap"},{"location":"ft2-properties.html#fallback-script","text":"Experimental only If no auto-hinter script module can be assigned to a glyph, a fallback script gets assigned to it (see also the glyph-to-script-map property). By default, this is FT_AUTOHINTER_SCRIPT_CJK . Using the fallback-script property, this fallback value can be changed.","title":"fallback-script"},{"location":"ft2-properties.html#default-script","text":"Experimental only If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make the HarfBuzz library access OpenType features for getting better glyph coverages, this property sets the (auto-fitter) script to be used for the default (OpenType) script data of a font's GSUB table. Features for the default script are intended for all scripts not explicitly handled in GSUB; an example is a \u2018dlig\u2019 feature, containing the combination of the characters \u2018T\u2019, \u2018E\u2019, and \u2018L\u2019 to form a \u2018TEL\u2019 ligature. By default, this is FT_AUTOHINTER_SCRIPT_LATIN . Using the default-script property, this default value can be changed.","title":"default-script"},{"location":"ft2-properties.html#increase-x-height","text":"For ppem values in the range 6 <= ppem <= increase-x-height , round up the font's x height much more often than normally. If the value is set to 0, which is the default, this feature is switched off. Use this property to improve the legibility of small font sizes if necessary.","title":"increase-x-height"},{"location":"ft2-properties.html#ft_prop_increasexheight","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). typedef struct FT_Prop_IncreaseXHeight_ { FT_Face face; FT_UInt limit; } FT_Prop_IncreaseXHeight ; The data exchange structure for the increase-x-height property.","title":"FT_Prop_IncreaseXHeight"},{"location":"ft2-properties.html#warping","text":"Obsolete This property was always experimental and probably never worked correctly. It was entirely removed from the FreeType 2 sources. This entry is only here for historical reference. Warping only worked in \u2018normal\u2019 auto-hinting mode replacing it. The idea of the code was to slightly scale and shift a glyph along the non-hinted dimension (which is usually the horizontal axis) so that as much of its segments were aligned (more or less) to the grid. To find out a glyph's optimal scaling and shifting value, various parameter combinations were tried and scored.","title":"warping"},{"location":"ft2-quick_advance.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Quick retrieval of advance values Quick retrieval of advance values \u00b6 Synopsis \u00b6 This section contains functions to quickly extract advance values without handling glyph outlines, if possible. FT_Get_Advance \u00b6 Defined in FT_ADVANCES_H (freetype/ftadvanc.h). FT_EXPORT( FT_Error ) FT_Get_Advance ( FT_Face face, FT_UInt gindex, FT_Int32 load_flags, FT_Fixed *padvance ); Retrieve the advance value of a given glyph outline in an FT_Face . input face The source FT_Face handle. gindex The glyph index. load_flags A set of bit flags similar to those used when calling FT_Load_Glyph , used to determine what kind of advances you need. output padvance The advance value. If scaling is performed (based on the value of load_flags ), the advance value is in 16.16 format. Otherwise, it is in font units. If FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance corresponding to a vertical layout. Otherwise, it is the horizontal advance in a horizontal layout. return FreeType error code. 0 means success. note This function may fail if you use FT_ADVANCE_FLAG_FAST_ONLY and if the corresponding font backend doesn't have a quick way to retrieve the advances. A scaled advance is returned in 16.16 format but isn't transformed by the affine transformation specified by FT_Set_Transform . FT_Get_Advances \u00b6 Defined in FT_ADVANCES_H (freetype/ftadvanc.h). FT_EXPORT( FT_Error ) FT_Get_Advances ( FT_Face face, FT_UInt start, FT_UInt count, FT_Int32 load_flags, FT_Fixed *padvances ); Retrieve the advance values of several glyph outlines in an FT_Face . input face The source FT_Face handle. start The first glyph index. count The number of advance values you want to retrieve. load_flags A set of bit flags similar to those used when calling FT_Load_Glyph . output padvance The advance values. This array, to be provided by the caller, must contain at least count elements. If scaling is performed (based on the value of load_flags ), the advance values are in 16.16 format. Otherwise, they are in font units. If FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances corresponding to a vertical layout. Otherwise, they are the horizontal advances in a horizontal layout. return FreeType error code. 0 means success. note This function may fail if you use FT_ADVANCE_FLAG_FAST_ONLY and if the corresponding font backend doesn't have a quick way to retrieve the advances. Scaled advances are returned in 16.16 format but aren't transformed by the affine transformation specified by FT_Set_Transform . FT_ADVANCE_FLAG_FAST_ONLY \u00b6 Defined in FT_ADVANCES_H (freetype/ftadvanc.h). # define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L A bit-flag to be OR-ed with the flags parameter of the FT_Get_Advance and FT_Get_Advances functions. If set, it indicates that you want these functions to fail if the corresponding hinting mode or font driver doesn't allow for very quick advance computation. Typically, glyphs that are either unscaled, unhinted, bitmapped, or light-hinted can have their advance width computed very quickly. Normal and bytecode hinted modes that require loading, scaling, and hinting of the glyph outline, are extremely slow by comparison.","title":"Quick retrieval of advance values"},{"location":"ft2-quick_advance.html#quick-retrieval-of-advance-values","text":"","title":"Quick retrieval of advance values"},{"location":"ft2-quick_advance.html#synopsis","text":"This section contains functions to quickly extract advance values without handling glyph outlines, if possible.","title":"Synopsis"},{"location":"ft2-quick_advance.html#ft_get_advance","text":"Defined in FT_ADVANCES_H (freetype/ftadvanc.h). FT_EXPORT( FT_Error ) FT_Get_Advance ( FT_Face face, FT_UInt gindex, FT_Int32 load_flags, FT_Fixed *padvance ); Retrieve the advance value of a given glyph outline in an FT_Face .","title":"FT_Get_Advance"},{"location":"ft2-quick_advance.html#ft_get_advances","text":"Defined in FT_ADVANCES_H (freetype/ftadvanc.h). FT_EXPORT( FT_Error ) FT_Get_Advances ( FT_Face face, FT_UInt start, FT_UInt count, FT_Int32 load_flags, FT_Fixed *padvances ); Retrieve the advance values of several glyph outlines in an FT_Face .","title":"FT_Get_Advances"},{"location":"ft2-quick_advance.html#ft_advance_flag_fast_only","text":"Defined in FT_ADVANCES_H (freetype/ftadvanc.h). # define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L A bit-flag to be OR-ed with the flags parameter of the FT_Get_Advance and FT_Get_Advances functions. If set, it indicates that you want these functions to fail if the corresponding hinting mode or font driver doesn't allow for very quick advance computation. Typically, glyphs that are either unscaled, unhinted, bitmapped, or light-hinted can have their advance width computed very quickly. Normal and bytecode hinted modes that require loading, scaling, and hinting of the glyph outline, are extremely slow by comparison.","title":"FT_ADVANCE_FLAG_FAST_ONLY"},{"location":"ft2-raster.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Scanline Converter Scanline Converter \u00b6 Synopsis \u00b6 A raster or a rasterizer is a scan converter in charge of producing a pixel coverage bitmap that can be used as an alpha channel when compositing a glyph with a background. FreeType comes with two rasterizers: bilevel raster1 and anti-aliased smooth are two separate modules. They are usually called from the high-level FT_Load_Glyph or FT_Render_Glyph functions and produce the entire coverage bitmap at once, while staying largely invisible to users. Instead of working with complete coverage bitmaps, it is also possible to intercept consecutive pixel runs on the same scanline with the same coverage, called spans , and process them individually. Only the smooth rasterizer permits this when calling FT_Outline_Render with FT_Raster_Params as described below. Working with either complete bitmaps or spans it is important to think of them as colorless coverage objects suitable as alpha channels to blend arbitrary colors with a background. For best results, it is recommended to use gamma correction, too. This section also describes the public API needed to set up alternative FT_Renderer modules. FT_Span \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Span_ { short x; unsigned short len; unsigned char coverage; } FT_Span ; A structure to model a single span of consecutive pixels when rendering an 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). note This structure is used by the span drawing callback type named FT_SpanFunc that takes the y coordinate of the span as a parameter. The anti-aliased rasterizer produces coverage values from 0 to 255, this is, from completely transparent to completely opaque. FT_SpanFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_SpanFunc )( int y, int count, const FT_Span * spans, void * user ); # define FT_Raster_Span_Func FT_SpanFunc A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the pixel spans on each scan line. input y The scanline's upward 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 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 using alpha compositing. It can also be used for oversampling and averaging. FT_Raster_Params \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Raster_Params_ { const FT_Bitmap * target; const void * source; int flags; FT_SpanFunc gray_spans; FT_SpanFunc black_spans; /* unused */ FT_Raster_BitTest_Func bit_test; /* unused */ FT_Raster_BitSet_Func bit_set; /* unused */ void * user; FT_BBox clip_box; } FT_Raster_Params ; A structure to hold the parameters used by a raster's render function, passed as an argument to FT_Outline_Render . 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 Unused. bit_test Unused. bit_set Unused. user User-supplied data that is passed to each drawing callback. clip_box An optional span clipping box expressed in integer pixels (not in 26.6 fixed-point units). note The FT_RASTER_FLAG_AA bit flag must be set in the flags to generate an anti-aliased glyph bitmap, otherwise a monochrome bitmap is generated. The target should have appropriate pixel mode and its dimensions define the clipping region. If both FT_RASTER_FLAG_AA and FT_RASTER_FLAG_DIRECT bit flags are set in flags , the raster calls an FT_SpanFunc callback gray_spans with user data as an argument ignoring target . This allows direct composition over a pre-existing user surface to perform the span drawing and composition. To optionally clip the spans, set the FT_RASTER_FLAG_CLIP flag and clip_box . The monochrome raster does not support the direct mode. The gray-level rasterizer always uses 256 gray levels. If you want fewer gray levels, you have to use FT_RASTER_FLAG_DIRECT and reduce the levels in the callback function. FT_RASTER_FLAG_XXX \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). # define FT_RASTER_FLAG_DEFAULT 0x0 # define FT_RASTER_FLAG_AA 0x1 # define FT_RASTER_FLAG_DIRECT 0x2 # define FT_RASTER_FLAG_CLIP 0x4 # define FT_RASTER_FLAG_SDF 0x8 /* these constants are deprecated; use the corresponding */ /* ` FT_RASTER_FLAG_XXX ` values instead */ # 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 A list of bit flag constants 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 and the output will be clipped to its size. 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. Otherwise, the clip_box is effectively set to the bounding box and all spans are generated. FT_RASTER_FLAG_SDF This flag is set to indicate that a signed distance field glyph image should be generated. This is only used while rendering with the FT_RENDER_MODE_SDF render mode. FT_Raster \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_RasterRec_* FT_Raster ; An opaque handle (pointer) to a raster object. Each object can be used independently to convert an outline into a bitmap or pixmap. note In FreeType 2, all rasters are now encapsulated within specific FT_Renderer modules and only used in their context. FT_Raster_NewFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_NewFunc )( void * memory, FT_Raster * raster ); # define FT_Raster_New_Func FT_Raster_NewFunc 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 an FT_Memory object, i.e., a handle to the standard FreeType memory allocator. However, this field can be completely ignored by a given raster implementation. FT_Raster_DoneFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_DoneFunc )( FT_Raster raster ); # define FT_Raster_Done_Func FT_Raster_DoneFunc A function used to destroy a given raster object. input raster A handle to the raster object. FT_Raster_ResetFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_ResetFunc )( FT_Raster raster, unsigned char * pool_base, unsigned long pool_size ); # define FT_Raster_Reset_Func FT_Raster_ResetFunc FreeType used to provide an area of memory called the \u2018render pool\u2019 available to all registered rasterizers. This was not thread safe, however, and now FreeType never allocates this pool. This function is called after a new raster object is created. input raster A handle to the new raster object. pool_base Previously, the address in memory of the render pool. Set this to NULL . pool_size Previously, the size in bytes of the render pool. Set this to 0. note Rasterizers should rely on dynamic or stack allocation if they want to (a handle to the memory allocator is passed to the rasterizer constructor). FT_Raster_SetModeFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_SetModeFunc )( FT_Raster raster, unsigned long mode, void * args ); # define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc 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 \u2018features\u2019 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. FT_Raster_RenderFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_RenderFunc )( FT_Raster raster, const FT_Raster_Params * params ); # define FT_Raster_Render_Func FT_Raster_RenderFunc Invoke 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 an 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. FT_Raster_Funcs \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; 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. FT_Raster_BitTest_Func \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_BitTest_Func )( int y, int x, void * user ); Deprecated, unimplemented. FT_Raster_BitSet_Func \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_BitSet_Func )( int y, int x, void * user ); Deprecated, unimplemented.","title":"Scanline Converter"},{"location":"ft2-raster.html#scanline-converter","text":"","title":"Scanline Converter"},{"location":"ft2-raster.html#synopsis","text":"A raster or a rasterizer is a scan converter in charge of producing a pixel coverage bitmap that can be used as an alpha channel when compositing a glyph with a background. FreeType comes with two rasterizers: bilevel raster1 and anti-aliased smooth are two separate modules. They are usually called from the high-level FT_Load_Glyph or FT_Render_Glyph functions and produce the entire coverage bitmap at once, while staying largely invisible to users. Instead of working with complete coverage bitmaps, it is also possible to intercept consecutive pixel runs on the same scanline with the same coverage, called spans , and process them individually. Only the smooth rasterizer permits this when calling FT_Outline_Render with FT_Raster_Params as described below. Working with either complete bitmaps or spans it is important to think of them as colorless coverage objects suitable as alpha channels to blend arbitrary colors with a background. For best results, it is recommended to use gamma correction, too. This section also describes the public API needed to set up alternative FT_Renderer modules.","title":"Synopsis"},{"location":"ft2-raster.html#ft_span","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Span_ { short x; unsigned short len; unsigned char coverage; } FT_Span ; A structure to model a single span of consecutive pixels when rendering an anti-aliased bitmap.","title":"FT_Span"},{"location":"ft2-raster.html#ft_spanfunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_SpanFunc )( int y, int count, const FT_Span * spans, void * user ); # define FT_Raster_Span_Func FT_SpanFunc A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the pixel spans on each scan line.","title":"FT_SpanFunc"},{"location":"ft2-raster.html#ft_raster_params","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Raster_Params_ { const FT_Bitmap * target; const void * source; int flags; FT_SpanFunc gray_spans; FT_SpanFunc black_spans; /* unused */ FT_Raster_BitTest_Func bit_test; /* unused */ FT_Raster_BitSet_Func bit_set; /* unused */ void * user; FT_BBox clip_box; } FT_Raster_Params ; A structure to hold the parameters used by a raster's render function, passed as an argument to FT_Outline_Render .","title":"FT_Raster_Params"},{"location":"ft2-raster.html#ft_raster_flag_xxx","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). # define FT_RASTER_FLAG_DEFAULT 0x0 # define FT_RASTER_FLAG_AA 0x1 # define FT_RASTER_FLAG_DIRECT 0x2 # define FT_RASTER_FLAG_CLIP 0x4 # define FT_RASTER_FLAG_SDF 0x8 /* these constants are deprecated; use the corresponding */ /* ` FT_RASTER_FLAG_XXX ` values instead */ # 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 A list of bit flag constants as used in the flags field of a FT_Raster_Params structure.","title":"FT_RASTER_FLAG_XXX"},{"location":"ft2-raster.html#ft_raster","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_RasterRec_* FT_Raster ; An opaque handle (pointer) to a raster object. Each object can be used independently to convert an outline into a bitmap or pixmap.","title":"FT_Raster"},{"location":"ft2-raster.html#ft_raster_newfunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_NewFunc )( void * memory, FT_Raster * raster ); # define FT_Raster_New_Func FT_Raster_NewFunc A function used to create a new raster object.","title":"FT_Raster_NewFunc"},{"location":"ft2-raster.html#ft_raster_donefunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_DoneFunc )( FT_Raster raster ); # define FT_Raster_Done_Func FT_Raster_DoneFunc A function used to destroy a given raster object.","title":"FT_Raster_DoneFunc"},{"location":"ft2-raster.html#ft_raster_resetfunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_ResetFunc )( FT_Raster raster, unsigned char * pool_base, unsigned long pool_size ); # define FT_Raster_Reset_Func FT_Raster_ResetFunc FreeType used to provide an area of memory called the \u2018render pool\u2019 available to all registered rasterizers. This was not thread safe, however, and now FreeType never allocates this pool. This function is called after a new raster object is created.","title":"FT_Raster_ResetFunc"},{"location":"ft2-raster.html#ft_raster_setmodefunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_SetModeFunc )( FT_Raster raster, unsigned long mode, void * args ); # define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc 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 \u2018features\u2019 in a given raster module.","title":"FT_Raster_SetModeFunc"},{"location":"ft2-raster.html#ft_raster_renderfunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_RenderFunc )( FT_Raster raster, const FT_Raster_Params * params ); # define FT_Raster_Render_Func FT_Raster_RenderFunc Invoke a given raster to scan-convert a given glyph image into a target bitmap.","title":"FT_Raster_RenderFunc"},{"location":"ft2-raster.html#ft_raster_funcs","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; A structure used to describe a given raster class to the library.","title":"FT_Raster_Funcs"},{"location":"ft2-raster.html#ft_raster_bittest_func","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_BitTest_Func )( int y, int x, void * user ); Deprecated, unimplemented.","title":"FT_Raster_BitTest_Func"},{"location":"ft2-raster.html#ft_raster_bitset_func","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_BitSet_Func )( int y, int x, void * user ); Deprecated, unimplemented.","title":"FT_Raster_BitSet_Func"},{"location":"ft2-sfnt_names.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb SFNT Names SFNT Names \u00b6 Synopsis \u00b6 The TrueType and OpenType specifications allow the inclusion of a special names table (\u2018name\u2019) in font files. This table contains textual (and internationalized) information regarding the font, like family name, copyright, version, etc. The definitions below are used to access them if available. Note that this has nothing to do with glyph names! FT_SfntName \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). typedef struct FT_SfntName_ { FT_UShort platform_id; FT_UShort encoding_id; FT_UShort language_id; FT_UShort name_id; FT_Byte * string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntName ; A structure used to model an SFNT \u2018name\u2019 table entry. fields platform_id The platform ID for string . See TT_PLATFORM_XXX for possible values. encoding_id The encoding ID for string . See TT_APPLE_ID_XXX , TT_MAC_ID_XXX , TT_ISO_ID_XXX , TT_MS_ID_XXX , and TT_ADOBE_ID_XXX for possible values. language_id The language ID for string . See TT_MAC_LANGID_XXX and TT_MS_LANGID_XXX for possible values. Registered OpenType values for language_id are always smaller than 0x8000; values equal or larger than 0x8000 usually indicate a language tag string (introduced in OpenType version 1.6). Use function FT_Get_Sfnt_LangTag with language_id as its argument to retrieve the associated language tag. name_id An identifier for string . See TT_NAME_ID_XXX for possible values. string The \u2018name\u2019 string. Note that its format differs depending on the (platform,encoding) pair, being either a string of bytes (without a terminating NULL byte) or containing UTF-16BE entities. string_len The length of string in bytes. note Please refer to the TrueType or OpenType specification for more details. FT_Get_Sfnt_Name_Count \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_UInt ) FT_Get_Sfnt_Name_Count ( FT_Face face ); Retrieve the number of name strings in the SFNT \u2018name\u2019 table. input face A handle to the source face. return The number of strings in the \u2018name\u2019 table. note This function always returns an error if the config macro TT_CONFIG_OPTION_SFNT_NAMES is not defined in ftoption.h . FT_Get_Sfnt_Name \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_Error ) FT_Get_Sfnt_Name ( FT_Face face, FT_UInt idx, FT_SfntName *aname ); Retrieve a string of the SFNT \u2018name\u2019 table for a given index. input face A handle to the source face. idx The index of the \u2018name\u2019 string. output aname The indexed FT_SfntName structure. return FreeType error code. 0 means success. note The string array returned in the aname structure is not null-terminated. Note that you don't have to deallocate string by yourself; FreeType takes care of it if you call FT_Done_Face . Use FT_Get_Sfnt_Name_Count to get the total number of available \u2018name\u2019 table entries, then do a loop until you get the right platform, encoding, and name ID. \u2018name\u2019 table format 1 entries can use language tags also, see FT_Get_Sfnt_LangTag . This function always returns an error if the config macro TT_CONFIG_OPTION_SFNT_NAMES is not defined in ftoption.h . FT_SfntLangTag \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). typedef struct FT_SfntLangTag_ { FT_Byte * string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntLangTag ; A structure to model a language tag entry from an SFNT \u2018name\u2019 table. fields string The language tag string, encoded in UTF-16BE (without trailing NULL bytes). string_len The length of string in bytes . note Please refer to the TrueType or OpenType specification for more details. since 2.8 FT_Get_Sfnt_LangTag \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_Error ) FT_Get_Sfnt_LangTag ( FT_Face face, FT_UInt langID, FT_SfntLangTag *alangTag ); Retrieve the language tag associated with a language ID of an SFNT \u2018name\u2019 table entry. input face A handle to the source face. langID The language ID, as returned by FT_Get_Sfnt_Name . This is always a value larger than 0x8000. output alangTag The language tag associated with the \u2018name\u2019 table entry's language ID. return FreeType error code. 0 means success. note The string array returned in the alangTag structure is not null-terminated. Note that you don't have to deallocate string by yourself; FreeType takes care of it if you call FT_Done_Face . Only \u2018name\u2019 table format 1 supports language tags. For format 0 tables, this function always returns FT_Err_Invalid_Table. For invalid format 1 language ID values, FT_Err_Invalid_Argument is returned. This function always returns an error if the config macro TT_CONFIG_OPTION_SFNT_NAMES is not defined in ftoption.h . since 2.8","title":"SFNT Names"},{"location":"ft2-sfnt_names.html#sfnt-names","text":"","title":"SFNT Names"},{"location":"ft2-sfnt_names.html#synopsis","text":"The TrueType and OpenType specifications allow the inclusion of a special names table (\u2018name\u2019) in font files. This table contains textual (and internationalized) information regarding the font, like family name, copyright, version, etc. The definitions below are used to access them if available. Note that this has nothing to do with glyph names!","title":"Synopsis"},{"location":"ft2-sfnt_names.html#ft_sfntname","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). typedef struct FT_SfntName_ { FT_UShort platform_id; FT_UShort encoding_id; FT_UShort language_id; FT_UShort name_id; FT_Byte * string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntName ; A structure used to model an SFNT \u2018name\u2019 table entry.","title":"FT_SfntName"},{"location":"ft2-sfnt_names.html#ft_get_sfnt_name_count","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_UInt ) FT_Get_Sfnt_Name_Count ( FT_Face face ); Retrieve the number of name strings in the SFNT \u2018name\u2019 table.","title":"FT_Get_Sfnt_Name_Count"},{"location":"ft2-sfnt_names.html#ft_get_sfnt_name","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_Error ) FT_Get_Sfnt_Name ( FT_Face face, FT_UInt idx, FT_SfntName *aname ); Retrieve a string of the SFNT \u2018name\u2019 table for a given index.","title":"FT_Get_Sfnt_Name"},{"location":"ft2-sfnt_names.html#ft_sfntlangtag","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). typedef struct FT_SfntLangTag_ { FT_Byte * string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntLangTag ; A structure to model a language tag entry from an SFNT \u2018name\u2019 table.","title":"FT_SfntLangTag"},{"location":"ft2-sfnt_names.html#ft_get_sfnt_langtag","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_Error ) FT_Get_Sfnt_LangTag ( FT_Face face, FT_UInt langID, FT_SfntLangTag *alangTag ); Retrieve the language tag associated with a language ID of an SFNT \u2018name\u2019 table entry.","title":"FT_Get_Sfnt_LangTag"},{"location":"ft2-sizes_management.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Size Management Size Management \u00b6 Synopsis \u00b6 When creating a new face object (e.g., with FT_New_Face ), an FT_Size object is automatically created and used to store all pixel-size dependent information, available in the face->size field. It is however possible to create more sizes for a given face, mostly in order to manage several character pixel sizes of the same font family and style. See FT_New_Size and FT_Done_Size . Note that FT_Set_Pixel_Sizes and FT_Set_Char_Size only modify the contents of the current \u2018active\u2019 size; you thus need to use FT_Activate_Size to change it. 99% of applications won't need the functions provided here, especially if they use the caching sub-system, so be cautious when using these. FT_New_Size \u00b6 Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_New_Size ( FT_Face face, FT_Size * size ); Create a new size object from a given face object. input face A handle to a parent face object. output asize A handle to a new size object. return FreeType error code. 0 means success. note You need to call FT_Activate_Size in order to select the new size for upcoming calls to FT_Set_Pixel_Sizes , FT_Set_Char_Size , FT_Load_Glyph , FT_Load_Char , etc. FT_Done_Size \u00b6 Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_Done_Size ( FT_Size size ); Discard a given size object. Note that FT_Done_Face automatically discards all size objects allocated with FT_New_Size . input size A handle to a target size object. return FreeType error code. 0 means success. FT_Activate_Size \u00b6 Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_Activate_Size ( FT_Size size ); Even though it is possible to create several size objects for a given face (see FT_New_Size for details), functions like FT_Load_Glyph or FT_Load_Char only use the one that has been activated last to determine the \u2018current character pixel size\u2019. This function can be used to \u2018activate\u2019 a previously created size object. input size A handle to a target size object. return FreeType error code. 0 means success. note If face is the size's parent face object, this function changes the value of face->size to the input size handle.","title":"Size Management"},{"location":"ft2-sizes_management.html#size-management","text":"","title":"Size Management"},{"location":"ft2-sizes_management.html#synopsis","text":"When creating a new face object (e.g., with FT_New_Face ), an FT_Size object is automatically created and used to store all pixel-size dependent information, available in the face->size field. It is however possible to create more sizes for a given face, mostly in order to manage several character pixel sizes of the same font family and style. See FT_New_Size and FT_Done_Size . Note that FT_Set_Pixel_Sizes and FT_Set_Char_Size only modify the contents of the current \u2018active\u2019 size; you thus need to use FT_Activate_Size to change it. 99% of applications won't need the functions provided here, especially if they use the caching sub-system, so be cautious when using these.","title":"Synopsis"},{"location":"ft2-sizes_management.html#ft_new_size","text":"Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_New_Size ( FT_Face face, FT_Size * size ); Create a new size object from a given face object.","title":"FT_New_Size"},{"location":"ft2-sizes_management.html#ft_done_size","text":"Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_Done_Size ( FT_Size size ); Discard a given size object. Note that FT_Done_Face automatically discards all size objects allocated with FT_New_Size .","title":"FT_Done_Size"},{"location":"ft2-sizes_management.html#ft_activate_size","text":"Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_Activate_Size ( FT_Size size ); Even though it is possible to create several size objects for a given face (see FT_New_Size for details), functions like FT_Load_Glyph or FT_Load_Char only use the one that has been activated last to determine the \u2018current character pixel size\u2019. This function can be used to \u2018activate\u2019 a previously created size object.","title":"FT_Activate_Size"},{"location":"ft2-system_interface.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb System Interface System Interface \u00b6 Synopsis \u00b6 This section contains various definitions related to memory management and i/o access. You need to understand this information if you want to use a custom memory manager or you own i/o streams. FT_Memory \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_MemoryRec_* FT_Memory ; A handle to a given memory manager object, defined with an FT_MemoryRec structure. FT_Alloc_Func \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void * (* FT_Alloc_Func )( FT_Memory memory, long size ); A function used to allocate size bytes from memory . input memory A handle to the source memory manager. size The size in bytes to allocate. return Address of new memory block. 0 in case of failure. FT_Free_Func \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void (* FT_Free_Func )( FT_Memory memory, void * block ); A function used to release a given block of memory. input memory A handle to the source memory manager. block The address of the target memory block. FT_Realloc_Func \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void * (* FT_Realloc_Func )( FT_Memory memory, long cur_size, long new_size, void * block ); A function used to re-allocate a given block of memory. input memory A handle to the source memory manager. cur_size The block's current size in bytes. new_size The block's requested new size. block The block's current address. return New block address. 0 in case of memory shortage. note In case of error, the old block must still be available. FT_MemoryRec \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). struct FT_MemoryRec_ { void * user; FT_Alloc_Func alloc; FT_Free_Func free; FT_Realloc_Func realloc; }; A structure used to describe a given memory manager to FreeType 2. fields user A generic typeless pointer for user data. alloc A pointer type to an allocation function. free A pointer type to an memory freeing function. realloc A pointer type to a reallocation function. FT_Stream \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_StreamRec_* FT_Stream ; A handle to an input stream. also See FT_StreamRec for the publicly accessible fields of a given stream object. FT_StreamDesc \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef union FT_StreamDesc_ { long value; void * pointer; } FT_StreamDesc ; A union type used to store either a long or a pointer. This is used to store a file descriptor or a FILE* in an input stream. FT_Stream_IoFunc \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef unsigned long (* FT_Stream_IoFunc )( FT_Stream stream, unsigned long offset, unsigned char * buffer, unsigned long count ); A function used to seek and read data from a given input stream. input stream A handle to the source stream. offset The offset of read in stream (always from start). buffer The address of the read buffer. count The number of bytes to read from the stream. return The number of bytes effectively read by the stream. note This function might be called to perform a seek or skip operation with a count of 0. A non-zero return value then indicates an error. FT_Stream_CloseFunc \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void (* FT_Stream_CloseFunc )( FT_Stream stream ); A function used to close a given input stream. input stream A handle to the target stream. FT_StreamRec \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_StreamRec_ { unsigned char * base; unsigned long size; unsigned long pos; FT_StreamDesc descriptor; FT_StreamDesc pathname; FT_Stream_IoFunc read; FT_Stream_CloseFunc close; FT_Memory memory; unsigned char * cursor; unsigned char * limit; } FT_StreamRec ; A structure used to describe an input stream. input base For memory-based streams, this is the address of the first stream byte in memory. This field should always be set to NULL for disk-based streams. size The stream size in bytes. In case of compressed streams where the size is unknown before actually doing the decompression, the value is set to 0x7FFFFFFF. (Note that this size value can occur for normal streams also; it is thus just a hint.) pos The current position within the stream. descriptor This field is a union that can hold an integer or a pointer. It is used by stream implementations to store file descriptors or FILE* pointers. pathname This field is completely ignored by FreeType. However, it is often useful during debugging to use it to store the stream's filename (where available). read The stream's input function. close The stream's close function. memory The memory manager to use to preload frames. This is set internally by FreeType and shouldn't be touched by stream implementations. cursor This field is set and used internally by FreeType when parsing frames. In particular, the FT_GET_XXX macros use this instead of the pos field. limit This field is set and used internally by FreeType when parsing frames.","title":"System Interface"},{"location":"ft2-system_interface.html#system-interface","text":"","title":"System Interface"},{"location":"ft2-system_interface.html#synopsis","text":"This section contains various definitions related to memory management and i/o access. You need to understand this information if you want to use a custom memory manager or you own i/o streams.","title":"Synopsis"},{"location":"ft2-system_interface.html#ft_memory","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_MemoryRec_* FT_Memory ; A handle to a given memory manager object, defined with an FT_MemoryRec structure.","title":"FT_Memory"},{"location":"ft2-system_interface.html#ft_alloc_func","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void * (* FT_Alloc_Func )( FT_Memory memory, long size ); A function used to allocate size bytes from memory .","title":"FT_Alloc_Func"},{"location":"ft2-system_interface.html#ft_free_func","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void (* FT_Free_Func )( FT_Memory memory, void * block ); A function used to release a given block of memory.","title":"FT_Free_Func"},{"location":"ft2-system_interface.html#ft_realloc_func","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void * (* FT_Realloc_Func )( FT_Memory memory, long cur_size, long new_size, void * block ); A function used to re-allocate a given block of memory.","title":"FT_Realloc_Func"},{"location":"ft2-system_interface.html#ft_memoryrec","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). struct FT_MemoryRec_ { void * user; FT_Alloc_Func alloc; FT_Free_Func free; FT_Realloc_Func realloc; }; A structure used to describe a given memory manager to FreeType 2.","title":"FT_MemoryRec"},{"location":"ft2-system_interface.html#ft_stream","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_StreamRec_* FT_Stream ; A handle to an input stream.","title":"FT_Stream"},{"location":"ft2-system_interface.html#ft_streamdesc","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef union FT_StreamDesc_ { long value; void * pointer; } FT_StreamDesc ; A union type used to store either a long or a pointer. This is used to store a file descriptor or a FILE* in an input stream.","title":"FT_StreamDesc"},{"location":"ft2-system_interface.html#ft_stream_iofunc","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef unsigned long (* FT_Stream_IoFunc )( FT_Stream stream, unsigned long offset, unsigned char * buffer, unsigned long count ); A function used to seek and read data from a given input stream.","title":"FT_Stream_IoFunc"},{"location":"ft2-system_interface.html#ft_stream_closefunc","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void (* FT_Stream_CloseFunc )( FT_Stream stream ); A function used to close a given input stream.","title":"FT_Stream_CloseFunc"},{"location":"ft2-system_interface.html#ft_streamrec","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_StreamRec_ { unsigned char * base; unsigned long size; unsigned long pos; FT_StreamDesc descriptor; FT_StreamDesc pathname; FT_Stream_IoFunc read; FT_Stream_CloseFunc close; FT_Memory memory; unsigned char * cursor; unsigned char * limit; } FT_StreamRec ; A structure used to describe an input stream.","title":"FT_StreamRec"},{"location":"ft2-t1_cid_driver.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The Type 1 and CID drivers The Type 1 and CID drivers \u00b6 Synopsis \u00b6 It is possible to control the behaviour of FreeType's Type 1 and Type 1 CID drivers with FT_Property_Set and FT_Property_Get . Behind the scenes, both drivers use the Adobe CFF engine for hinting; however, the used properties must be specified separately. The Type 1 driver's module name is \u2018type1\u2019; the CID driver's module name is \u2018t1cid\u2019. Available properties are hinting-engine , no-stem-darkening , darkening-parameters , and random-seed , as documented in the \u2018 Driver properties \u2019 section. Please see the \u2018 The CFF driver \u2019 section for more details on the new hinting engine.","title":"The Type 1 and CID drivers"},{"location":"ft2-t1_cid_driver.html#the-type-1-and-cid-drivers","text":"","title":"The Type 1 and CID drivers"},{"location":"ft2-t1_cid_driver.html#synopsis","text":"It is possible to control the behaviour of FreeType's Type 1 and Type 1 CID drivers with FT_Property_Set and FT_Property_Get . Behind the scenes, both drivers use the Adobe CFF engine for hinting; however, the used properties must be specified separately. The Type 1 driver's module name is \u2018type1\u2019; the CID driver's module name is \u2018t1cid\u2019. Available properties are hinting-engine , no-stem-darkening , darkening-parameters , and random-seed , as documented in the \u2018 Driver properties \u2019 section. Please see the \u2018 The CFF driver \u2019 section for more details on the new hinting engine.","title":"Synopsis"},{"location":"ft2-truetype_engine.html","text":"FreeType \u00bb Docs \u00bb Miscellaneous \u00bb The TrueType Engine The TrueType Engine \u00b6 Synopsis \u00b6 This section contains a function used to query the level of TrueType bytecode support compiled in this version of the library. FT_TrueTypeEngineType \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef enum FT_TrueTypeEngineType_ { FT_TRUETYPE_ENGINE_TYPE_NONE = 0, FT_TRUETYPE_ENGINE_TYPE_UNPATENTED , FT_TRUETYPE_ENGINE_TYPE_PATENTED } FT_TrueTypeEngineType ; A list of values describing which kind of TrueType bytecode engine is implemented in a given FT_Library instance. It is used by the FT_Get_TrueType_Engine_Type function. values FT_TRUETYPE_ENGINE_TYPE_NONE The library doesn't implement any kind of bytecode interpreter. FT_TRUETYPE_ENGINE_TYPE_UNPATENTED Deprecated and removed. FT_TRUETYPE_ENGINE_TYPE_PATENTED The library implements a bytecode interpreter that covers the full instruction set of the TrueType virtual machine (this was governed by patents until May 2010, hence the name). since 2.2 FT_Get_TrueType_Engine_Type \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_TrueTypeEngineType ) FT_Get_TrueType_Engine_Type ( FT_Library library ); Return an FT_TrueTypeEngineType value to indicate which level of the TrueType virtual machine a given library instance supports. input library A library instance. return A value indicating which level is supported. since 2.2","title":"The TrueType Engine"},{"location":"ft2-truetype_engine.html#the-truetype-engine","text":"","title":"The TrueType Engine"},{"location":"ft2-truetype_engine.html#synopsis","text":"This section contains a function used to query the level of TrueType bytecode support compiled in this version of the library.","title":"Synopsis"},{"location":"ft2-truetype_engine.html#ft_truetypeenginetype","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef enum FT_TrueTypeEngineType_ { FT_TRUETYPE_ENGINE_TYPE_NONE = 0, FT_TRUETYPE_ENGINE_TYPE_UNPATENTED , FT_TRUETYPE_ENGINE_TYPE_PATENTED } FT_TrueTypeEngineType ; A list of values describing which kind of TrueType bytecode engine is implemented in a given FT_Library instance. It is used by the FT_Get_TrueType_Engine_Type function.","title":"FT_TrueTypeEngineType"},{"location":"ft2-truetype_engine.html#ft_get_truetype_engine_type","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_TrueTypeEngineType ) FT_Get_TrueType_Engine_Type ( FT_Library library ); Return an FT_TrueTypeEngineType value to indicate which level of the TrueType virtual machine a given library instance supports.","title":"FT_Get_TrueType_Engine_Type"},{"location":"ft2-truetype_tables.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb TrueType Tables TrueType Tables \u00b6 Synopsis \u00b6 This section contains definitions of some basic tables specific to TrueType and OpenType as well as some routines used to access and process them. TT_Header \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_Header_ { FT_Fixed Table_Version; FT_Fixed Font_Revision; FT_Long CheckSum_Adjust; FT_Long Magic_Number; FT_UShort Flags; FT_UShort Units_Per_EM; FT_ULong Created [2]; FT_ULong Modified[2]; FT_Short xMin; FT_Short yMin; FT_Short xMax; FT_Short yMax; FT_UShort Mac_Style; FT_UShort Lowest_Rec_PPEM; FT_Short Font_Direction; FT_Short Index_To_Loc_Format; FT_Short Glyph_Data_Format; } TT_Header ; A structure to model a TrueType font header table. All fields follow the OpenType specification. The 64-bit timestamps are stored in two-element arrays Created and Modified , first the upper then the lower 32 bits. TT_HoriHeader \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_HoriHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Width_Max; /* advance width maximum */ FT_Short min_Left_Side_Bearing; /* minimum left-sb */ FT_Short min_Right_Side_Bearing; /* minimum right-sb */ FT_Short xMax_Extent; /* xmax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_HMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* 'hmtx' table. */ void * long_metrics; void * short_metrics; } TT_HoriHeader ; A structure to model a TrueType horizontal header, the \u2018hhea\u2019 table, as well as the corresponding horizontal metrics table, \u2018hmtx\u2019. fields Version The table version. Ascender The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font. This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII). You should use the sTypoAscender field of the \u2018OS/2\u2019 table instead if you want the correct one. Descender The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative. This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII). You should use the sTypoDescender field of the \u2018OS/2\u2019 table instead if you want the correct one. Line_Gap The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font. advance_Width_Max This field is the maximum of all advance widths found in the font. It can be used to compute the maximum width of an arbitrary string of text. min_Left_Side_Bearing The minimum left side bearing of all glyphs within the font. min_Right_Side_Bearing The minimum right side bearing of all glyphs within the font. xMax_Extent The maximum horizontal extent (i.e., the \u2018width\u2019 of a glyph's bounding box) for all glyphs in the font. caret_Slope_Rise The rise coefficient of the cursor's slope of the cursor (slope=rise/run). caret_Slope_Run The run coefficient of the cursor's slope. caret_Offset The cursor's offset for slanted fonts. Reserved 8 reserved bytes. metric_Data_Format Always 0. number_Of_HMetrics Number of HMetrics entries in the \u2018hmtx\u2019 table \u2013 this value can be smaller than the total number of glyphs in the font. long_metrics A pointer into the \u2018hmtx\u2019 table. short_metrics A pointer into the \u2018hmtx\u2019 table. note For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: caret_Slope_Rise , caret_Slope_Run , and caret_Offset . TT_VertHeader \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_VertHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Height_Max; /* advance height maximum */ FT_Short min_Top_Side_Bearing; /* minimum top-sb */ FT_Short min_Bottom_Side_Bearing; /* minimum bottom-sb */ FT_Short yMax_Extent; /* ymax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_VMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* 'vmtx' table. */ void * long_metrics; void * short_metrics; } TT_VertHeader ; A structure used to model a TrueType vertical header, the \u2018vhea\u2019 table, as well as the corresponding vertical metrics table, \u2018vmtx\u2019. fields Version The table version. Ascender The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font. This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII). You should use the sTypoAscender field of the \u2018OS/2\u2019 table instead if you want the correct one. Descender The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative. This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII). You should use the sTypoDescender field of the \u2018OS/2\u2019 table instead if you want the correct one. Line_Gap The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font. advance_Height_Max This field is the maximum of all advance heights found in the font. It can be used to compute the maximum height of an arbitrary string of text. min_Top_Side_Bearing The minimum top side bearing of all glyphs within the font. min_Bottom_Side_Bearing The minimum bottom side bearing of all glyphs within the font. yMax_Extent The maximum vertical extent (i.e., the \u2018height\u2019 of a glyph's bounding box) for all glyphs in the font. caret_Slope_Rise The rise coefficient of the cursor's slope of the cursor (slope=rise/run). caret_Slope_Run The run coefficient of the cursor's slope. caret_Offset The cursor's offset for slanted fonts. Reserved 8 reserved bytes. metric_Data_Format Always 0. number_Of_VMetrics Number of VMetrics entries in the \u2018vmtx\u2019 table \u2013 this value can be smaller than the total number of glyphs in the font. long_metrics A pointer into the \u2018vmtx\u2019 table. short_metrics A pointer into the \u2018vmtx\u2019 table. note For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: Ascender , Descender , Line_Gap , caret_Slope_Rise , caret_Slope_Run , and caret_Offset . TT_OS2 \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_OS2_ { FT_UShort version; /* 0x0001 - more or 0xFFFF */ FT_Short xAvgCharWidth; FT_UShort usWeightClass; FT_UShort usWidthClass; FT_UShort fsType; FT_Short ySubscriptXSize; FT_Short ySubscriptYSize; FT_Short ySubscriptXOffset; FT_Short ySubscriptYOffset; FT_Short ySuperscriptXSize; FT_Short ySuperscriptYSize; FT_Short ySuperscriptXOffset; FT_Short ySuperscriptYOffset; FT_Short yStrikeoutSize; FT_Short yStrikeoutPosition; FT_Short sFamilyClass; FT_Byte panose[10]; FT_ULong ulUnicodeRange1; /* Bits 0-31 */ FT_ULong ulUnicodeRange2; /* Bits 32-63 */ FT_ULong ulUnicodeRange3; /* Bits 64-95 */ FT_ULong ulUnicodeRange4; /* Bits 96-127 */ FT_Char achVendID[4]; FT_UShort fsSelection; FT_UShort usFirstCharIndex; FT_UShort usLastCharIndex; FT_Short sTypoAscender; FT_Short sTypoDescender; FT_Short sTypoLineGap; FT_UShort usWinAscent; FT_UShort usWinDescent; /* only version 1 and higher: */ FT_ULong ulCodePageRange1; /* Bits 0-31 */ FT_ULong ulCodePageRange2; /* Bits 32-63 */ /* only version 2 and higher: */ FT_Short sxHeight; FT_Short sCapHeight; FT_UShort usDefaultChar; FT_UShort usBreakChar; FT_UShort usMaxContext; /* only version 5 and higher: */ FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */ FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */ } TT_OS2 ; A structure to model a TrueType \u2018OS/2\u2019 table. All fields comply to the OpenType specification. Note that we now support old Mac fonts that do not include an \u2018OS/2\u2019 table. In this case, the version field is always set to 0xFFFF. note For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: sCapHeight , sTypoAscender , sTypoDescender , sTypoLineGap , sxHeight , usWinAscent , usWinDescent , yStrikeoutPosition , yStrikeoutSize , ySubscriptXOffset , ySubScriptXSize , ySubscriptYOffset , ySubscriptYSize , ySuperscriptXOffset , ySuperscriptXSize , ySuperscriptYOffset , and ySuperscriptYSize . Possible values for bits in the ulUnicodeRangeX fields are given by the TT_UCR_XXX macros. TT_Postscript \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_Postscript_ { FT_Fixed FormatType; FT_Fixed italicAngle; FT_Short underlinePosition; FT_Short underlineThickness; FT_ULong isFixedPitch; FT_ULong minMemType42; FT_ULong maxMemType42; FT_ULong minMemType1; FT_ULong maxMemType1; /* Glyph names follow in the 'post' table, but we don't */ /* load them by default. */ } TT_Postscript ; A structure to model a TrueType \u2018post\u2019 table. All fields comply to the OpenType specification. This structure does not reference a font's PostScript glyph names; use FT_Get_Glyph_Name to retrieve them. note For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: underlinePosition and underlineThickness . TT_PCLT \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_PCLT_ { FT_Fixed Version; FT_ULong FontNumber; FT_UShort Pitch; FT_UShort xHeight; FT_UShort Style; FT_UShort TypeFamily; FT_UShort CapHeight; FT_UShort SymbolSet; FT_Char TypeFace[16]; FT_Char CharacterComplement[8]; FT_Char FileName[6]; FT_Char StrokeWeight; FT_Char WidthType; FT_Byte SerifStyle; FT_Byte Reserved; } TT_PCLT ; A structure to model a TrueType \u2018PCLT\u2019 table. All fields comply to the OpenType specification. TT_MaxProfile \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_MaxProfile_ { FT_Fixed version; FT_UShort numGlyphs; FT_UShort maxPoints; FT_UShort maxContours; FT_UShort maxCompositePoints; FT_UShort maxCompositeContours; FT_UShort maxZones; FT_UShort maxTwilightPoints; FT_UShort maxStorage; FT_UShort maxFunctionDefs; FT_UShort maxInstructionDefs; FT_UShort maxStackElements; FT_UShort maxSizeOfInstructions; FT_UShort maxComponentElements; FT_UShort maxComponentDepth; } TT_MaxProfile ; The maximum profile (\u2018maxp\u2019) table contains many max values, which can be used to pre-allocate arrays for speeding up glyph loading and hinting. fields version The version number. numGlyphs The number of glyphs in this TrueType font. maxPoints The maximum number of points in a non-composite TrueType glyph. See also maxCompositePoints . maxContours The maximum number of contours in a non-composite TrueType glyph. See also maxCompositeContours . maxCompositePoints The maximum number of points in a composite TrueType glyph. See also maxPoints . maxCompositeContours The maximum number of contours in a composite TrueType glyph. See also maxContours . maxZones The maximum number of zones used for glyph hinting. maxTwilightPoints The maximum number of points in the twilight zone used for glyph hinting. maxStorage The maximum number of elements in the storage area used for glyph hinting. maxFunctionDefs The maximum number of function definitions in the TrueType bytecode for this font. maxInstructionDefs The maximum number of instruction definitions in the TrueType bytecode for this font. maxStackElements The maximum number of stack elements used during bytecode interpretation. maxSizeOfInstructions The maximum number of TrueType opcodes used for glyph hinting. maxComponentElements The maximum number of simple (i.e., non-composite) glyphs in a composite glyph. maxComponentDepth The maximum nesting depth of composite glyphs. note This structure is only used during font loading. FT_Sfnt_Tag \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef enum FT_Sfnt_Tag_ { FT_SFNT_HEAD , FT_SFNT_MAXP , FT_SFNT_OS2 , FT_SFNT_HHEA , FT_SFNT_VHEA , FT_SFNT_POST , FT_SFNT_PCLT , FT_SFNT_MAX } FT_Sfnt_Tag ; /* these constants are deprecated; use the corresponding ` FT_Sfnt_Tag ` */ /* values instead */ # define ft_sfnt_head FT_SFNT_HEAD # define ft_sfnt_maxp FT_SFNT_MAXP # define ft_sfnt_os2 FT_SFNT_OS2 # define ft_sfnt_hhea FT_SFNT_HHEA # define ft_sfnt_vhea FT_SFNT_VHEA # define ft_sfnt_post FT_SFNT_POST # define ft_sfnt_pclt FT_SFNT_PCLT An enumeration to specify indices of SFNT tables loaded and parsed by FreeType during initialization of an SFNT font. Used in the FT_Get_Sfnt_Table API function. values FT_SFNT_HEAD To access the font's TT_Header structure. FT_SFNT_MAXP To access the font's TT_MaxProfile structure. FT_SFNT_OS2 To access the font's TT_OS2 structure. FT_SFNT_HHEA To access the font's TT_HoriHeader structure. FT_SFNT_VHEA To access the font's TT_VertHeader structure. FT_SFNT_POST To access the font's TT_Postscript structure. FT_SFNT_PCLT To access the font's TT_PCLT structure. FT_Get_Sfnt_Table \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( void * ) FT_Get_Sfnt_Table ( FT_Face face, FT_Sfnt_Tag tag ); Return a pointer to a given SFNT table stored within a face. input face A handle to the source. tag The index of the SFNT table. return A type-less pointer to the table. This will be NULL in case of error, or if the corresponding table was not found OR loaded from the file. Use a typecast according to tag to access the structure elements. note The table is owned by the face object and disappears with it. This function is only useful to access SFNT tables that are loaded by the sfnt, truetype, and opentype drivers. See FT_Sfnt_Tag for a list. example Here is an example demonstrating access to the \u2018vhea\u2019 table. TT_VertHeader* vert_header; vert_header = (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); FT_Load_Sfnt_Table \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Error ) FT_Load_Sfnt_Table ( FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte * buffer, FT_ULong * length ); Load any SFNT font table into client memory. input face A handle to the source face. tag The four-byte tag of the table to load. Use value 0 if you want to access the whole font file. Otherwise, you can use one of the definitions found in the FT_TRUETYPE_TAGS_H file, or forge a new one with FT_MAKE_TAG . offset The starting offset in the table (or file if tag == 0). output buffer The target buffer address. The client must ensure that the memory array is big enough to hold the data. inout length If the length parameter is NULL , try to load the whole table. Return an error code if it fails. Else, if *length is 0, exit immediately while returning the table's (or file) full size in it. Else the number of bytes to read from the table or file, from the starting offset. return FreeType error code. 0 means success. note If you need to determine the table's length you should first call this function with *length set to 0, as in the following example: FT_ULong length = 0; error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); if ( error ) { ... table does not exist ... } buffer = malloc( length ); if ( buffer == NULL ) { ... not enough memory ... } error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); if ( error ) { ... could not load table ... } Note that structures like TT_Header or TT_OS2 can't be used with this function; they are limited to FT_Get_Sfnt_Table . Reason is that those structures depend on the processor architecture, with varying size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian). FT_Sfnt_Table_Info \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Error ) FT_Sfnt_Table_Info ( FT_Face face, FT_UInt table_index, FT_ULong *tag, FT_ULong *length ); Return information on an SFNT table. input face A handle to the source face. table_index The index of an SFNT table. The function returns FT_Err_Table_Missing for an invalid value. inout tag The name tag of the SFNT table. If the value is NULL , table_index is ignored, and length returns the number of SFNT tables in the font. output length The length of the SFNT table (or the number of SFNT tables, depending on tag ). return FreeType error code. 0 means success. note While parsing fonts, FreeType handles SFNT tables with length zero as missing. FT_Get_CMap_Language_ID \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_ULong ) FT_Get_CMap_Language_ID ( FT_CharMap charmap ); Return cmap language ID as specified in the OpenType standard. Definitions of language ID values are in file FT_TRUETYPE_IDS_H . input charmap The target charmap. return The language ID of charmap . If charmap doesn't belong to an SFNT face, just return 0 as the default value. For a format 14 cmap (to access Unicode IVS), the return value is 0xFFFFFFFF. FT_Get_CMap_Format \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Long ) FT_Get_CMap_Format ( FT_CharMap charmap ); Return the format of an SFNT \u2018cmap\u2019 table. input charmap The target charmap. return The format of charmap . If charmap doesn't belong to an SFNT face, return -1. FT_PARAM_TAG_UNPATENTED_HINTING \u00b6 # define FT_PARAM_TAG_UNPATENTED_HINTING \\ FT_MAKE_TAG ( 'u', 'n', 'p', 'a' ) Deprecated, no effect. Previously: A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face . TT_PLATFORM_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_PLATFORM_APPLE_UNICODE 0 # define TT_PLATFORM_MACINTOSH 1 # define TT_PLATFORM_ISO 2 /* deprecated */ # define TT_PLATFORM_MICROSOFT 3 # define TT_PLATFORM_CUSTOM 4 # define TT_PLATFORM_ADOBE 7 /* artificial */ A list of valid values for the platform_id identifier code in FT_CharMapRec and FT_SfntName structures. values TT_PLATFORM_APPLE_UNICODE Used by Apple to indicate a Unicode character map and/or name entry. See TT_APPLE_ID_XXX for corresponding encoding_id values. Note that name entries in this format are coded as big-endian UCS-2 character codes only . TT_PLATFORM_MACINTOSH Used by Apple to indicate a MacOS-specific charmap and/or name entry. See TT_MAC_ID_XXX for corresponding encoding_id values. Note that most TrueType fonts contain an Apple roman charmap to be usable on MacOS systems (even if they contain a Microsoft charmap as well). TT_PLATFORM_ISO This value was used to specify ISO/IEC 10646 charmaps. It is however now deprecated. See TT_ISO_ID_XXX for a list of corresponding encoding_id values. TT_PLATFORM_MICROSOFT Used by Microsoft to indicate Windows-specific charmaps. See TT_MS_ID_XXX for a list of corresponding encoding_id values. Note that most fonts contain a Unicode charmap using ( TT_PLATFORM_MICROSOFT , TT_MS_ID_UNICODE_CS ). TT_PLATFORM_CUSTOM Used to indicate application-specific charmaps. TT_PLATFORM_ADOBE This value isn't part of any font format specification, but is used by FreeType to report Adobe-specific charmaps in an FT_CharMapRec structure. See TT_ADOBE_ID_XXX . TT_APPLE_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ # define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ # define TT_APPLE_ID_ISO_10646 2 /* deprecated */ # define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ # define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ # define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */ # define TT_APPLE_ID_FULL_UNICODE 6 /* used with type 13 cmaps */ A list of valid values for the encoding_id for TT_PLATFORM_APPLE_UNICODE charmaps and name entries. values TT_APPLE_ID_DEFAULT Unicode version 1.0. TT_APPLE_ID_UNICODE_1_1 Unicode 1.1; specifies Hangul characters starting at U+34xx. TT_APPLE_ID_ISO_10646 Deprecated (identical to preceding). TT_APPLE_ID_UNICODE_2_0 Unicode 2.0 and beyond (UTF-16 BMP only). TT_APPLE_ID_UNICODE_32 Unicode 3.1 and beyond, using UTF-32. TT_APPLE_ID_VARIANT_SELECTOR From Adobe, not Apple. Not a normal cmap. Specifies variations on a real cmap. TT_APPLE_ID_FULL_UNICODE Used for fallback fonts that provide complete Unicode coverage with a type 13 cmap. TT_MAC_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MAC_ID_ROMAN 0 # define TT_MAC_ID_JAPANESE 1 # define TT_MAC_ID_TRADITIONAL_CHINESE 2 # define TT_MAC_ID_KOREAN 3 # define TT_MAC_ID_ARABIC 4 # define TT_MAC_ID_HEBREW 5 # define TT_MAC_ID_GREEK 6 # define TT_MAC_ID_RUSSIAN 7 # define TT_MAC_ID_RSYMBOL 8 # define TT_MAC_ID_DEVANAGARI 9 # define TT_MAC_ID_GURMUKHI 10 # define TT_MAC_ID_GUJARATI 11 # define TT_MAC_ID_ORIYA 12 # define TT_MAC_ID_BENGALI 13 # define TT_MAC_ID_TAMIL 14 # define TT_MAC_ID_TELUGU 15 # define TT_MAC_ID_KANNADA 16 # define TT_MAC_ID_MALAYALAM 17 # define TT_MAC_ID_SINHALESE 18 # define TT_MAC_ID_BURMESE 19 # define TT_MAC_ID_KHMER 20 # define TT_MAC_ID_THAI 21 # define TT_MAC_ID_LAOTIAN 22 # define TT_MAC_ID_GEORGIAN 23 # define TT_MAC_ID_ARMENIAN 24 # define TT_MAC_ID_MALDIVIAN 25 # define TT_MAC_ID_SIMPLIFIED_CHINESE 25 # define TT_MAC_ID_TIBETAN 26 # define TT_MAC_ID_MONGOLIAN 27 # define TT_MAC_ID_GEEZ 28 # define TT_MAC_ID_SLAVIC 29 # define TT_MAC_ID_VIETNAMESE 30 # define TT_MAC_ID_SINDHI 31 # define TT_MAC_ID_UNINTERP 32 A list of valid values for the encoding_id for TT_PLATFORM_MACINTOSH charmaps and name entries. TT_ISO_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_ISO_ID_7BIT_ASCII 0 # define TT_ISO_ID_10646 1 # define TT_ISO_ID_8859_1 2 A list of valid values for the encoding_id for TT_PLATFORM_ISO charmaps and name entries. Their use is now deprecated. values TT_ISO_ID_7BIT_ASCII ASCII. TT_ISO_ID_10646 ISO/10646. TT_ISO_ID_8859_1 Also known as Latin-1. TT_MS_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MS_ID_SYMBOL_CS 0 # define TT_MS_ID_UNICODE_CS 1 # define TT_MS_ID_SJIS 2 # define TT_MS_ID_PRC 3 # define TT_MS_ID_BIG_5 4 # define TT_MS_ID_WANSUNG 5 # define TT_MS_ID_JOHAB 6 # define TT_MS_ID_UCS_4 10 /* this value is deprecated */ # define TT_MS_ID_GB2312 TT_MS_ID_PRC A list of valid values for the encoding_id for TT_PLATFORM_MICROSOFT charmaps and name entries. values TT_MS_ID_SYMBOL_CS Microsoft symbol encoding. See FT_ENCODING_MS_SYMBOL . TT_MS_ID_UNICODE_CS Microsoft WGL4 charmap, matching Unicode. See FT_ENCODING_UNICODE . TT_MS_ID_SJIS Shift JIS Japanese encoding. See FT_ENCODING_SJIS . TT_MS_ID_PRC Chinese encodings as used in the People's Republic of China (PRC). This means the encodings GB 2312 and its supersets GBK and GB 18030. See FT_ENCODING_PRC . TT_MS_ID_BIG_5 Traditional Chinese as used in Taiwan and Hong Kong. See FT_ENCODING_BIG5 . TT_MS_ID_WANSUNG Korean Extended Wansung encoding. See FT_ENCODING_WANSUNG . TT_MS_ID_JOHAB Korean Johab encoding. See FT_ENCODING_JOHAB . TT_MS_ID_UCS_4 UCS-4 or UTF-32 charmaps. This has been added to the OpenType specification version 1.4 (mid-2001). TT_ADOBE_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_ADOBE_ID_STANDARD 0 # define TT_ADOBE_ID_EXPERT 1 # define TT_ADOBE_ID_CUSTOM 2 # define TT_ADOBE_ID_LATIN_1 3 A list of valid values for the encoding_id for TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension! values TT_ADOBE_ID_STANDARD Adobe standard encoding. TT_ADOBE_ID_EXPERT Adobe expert encoding. TT_ADOBE_ID_CUSTOM Adobe custom encoding. TT_ADOBE_ID_LATIN_1 Adobe Latin 1 encoding. TT_MAC_LANGID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MAC_LANGID_ENGLISH 0 # define TT_MAC_LANGID_FRENCH 1 # define TT_MAC_LANGID_GERMAN 2 # define TT_MAC_LANGID_ITALIAN 3 # define TT_MAC_LANGID_DUTCH 4 # define TT_MAC_LANGID_SWEDISH 5 # define TT_MAC_LANGID_SPANISH 6 # define TT_MAC_LANGID_DANISH 7 # define TT_MAC_LANGID_PORTUGUESE 8 # define TT_MAC_LANGID_NORWEGIAN 9 # define TT_MAC_LANGID_HEBREW 10 # define TT_MAC_LANGID_JAPANESE 11 # define TT_MAC_LANGID_ARABIC 12 # define TT_MAC_LANGID_FINNISH 13 # define TT_MAC_LANGID_GREEK 14 # define TT_MAC_LANGID_ICELANDIC 15 # define TT_MAC_LANGID_MALTESE 16 # define TT_MAC_LANGID_TURKISH 17 # define TT_MAC_LANGID_CROATIAN 18 # define TT_MAC_LANGID_CHINESE_TRADITIONAL 19 # define TT_MAC_LANGID_URDU 20 # define TT_MAC_LANGID_HINDI 21 # define TT_MAC_LANGID_THAI 22 # define TT_MAC_LANGID_KOREAN 23 # define TT_MAC_LANGID_LITHUANIAN 24 # define TT_MAC_LANGID_POLISH 25 # define TT_MAC_LANGID_HUNGARIAN 26 # define TT_MAC_LANGID_ESTONIAN 27 # define TT_MAC_LANGID_LETTISH 28 # define TT_MAC_LANGID_SAAMISK 29 # define TT_MAC_LANGID_FAEROESE 30 # define TT_MAC_LANGID_FARSI 31 # define TT_MAC_LANGID_RUSSIAN 32 # define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33 # define TT_MAC_LANGID_FLEMISH 34 # define TT_MAC_LANGID_IRISH 35 # define TT_MAC_LANGID_ALBANIAN 36 # define TT_MAC_LANGID_ROMANIAN 37 # define TT_MAC_LANGID_CZECH 38 # define TT_MAC_LANGID_SLOVAK 39 # define TT_MAC_LANGID_SLOVENIAN 40 # define TT_MAC_LANGID_YIDDISH 41 # define TT_MAC_LANGID_SERBIAN 42 # define TT_MAC_LANGID_MACEDONIAN 43 # define TT_MAC_LANGID_BULGARIAN 44 # define TT_MAC_LANGID_UKRAINIAN 45 # define TT_MAC_LANGID_BYELORUSSIAN 46 # define TT_MAC_LANGID_UZBEK 47 # define TT_MAC_LANGID_KAZAKH 48 # define TT_MAC_LANGID_AZERBAIJANI 49 # define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49 # define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50 # define TT_MAC_LANGID_ARMENIAN 51 # define TT_MAC_LANGID_GEORGIAN 52 # define TT_MAC_LANGID_MOLDAVIAN 53 # define TT_MAC_LANGID_KIRGHIZ 54 # define TT_MAC_LANGID_TAJIKI 55 # define TT_MAC_LANGID_TURKMEN 56 # define TT_MAC_LANGID_MONGOLIAN 57 # define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57 # define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58 # define TT_MAC_LANGID_PASHTO 59 # define TT_MAC_LANGID_KURDISH 60 # define TT_MAC_LANGID_KASHMIRI 61 # define TT_MAC_LANGID_SINDHI 62 # define TT_MAC_LANGID_TIBETAN 63 # define TT_MAC_LANGID_NEPALI 64 # define TT_MAC_LANGID_SANSKRIT 65 # define TT_MAC_LANGID_MARATHI 66 # define TT_MAC_LANGID_BENGALI 67 # define TT_MAC_LANGID_ASSAMESE 68 # define TT_MAC_LANGID_GUJARATI 69 # define TT_MAC_LANGID_PUNJABI 70 # define TT_MAC_LANGID_ORIYA 71 # define TT_MAC_LANGID_MALAYALAM 72 # define TT_MAC_LANGID_KANNADA 73 # define TT_MAC_LANGID_TAMIL 74 # define TT_MAC_LANGID_TELUGU 75 # define TT_MAC_LANGID_SINHALESE 76 # define TT_MAC_LANGID_BURMESE 77 # define TT_MAC_LANGID_KHMER 78 # define TT_MAC_LANGID_LAO 79 # define TT_MAC_LANGID_VIETNAMESE 80 # define TT_MAC_LANGID_INDONESIAN 81 # define TT_MAC_LANGID_TAGALOG 82 # define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83 # define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84 # define TT_MAC_LANGID_AMHARIC 85 # define TT_MAC_LANGID_TIGRINYA 86 # define TT_MAC_LANGID_GALLA 87 # define TT_MAC_LANGID_SOMALI 88 # define TT_MAC_LANGID_SWAHILI 89 # define TT_MAC_LANGID_RUANDA 90 # define TT_MAC_LANGID_RUNDI 91 # define TT_MAC_LANGID_CHEWA 92 # define TT_MAC_LANGID_MALAGASY 93 # define TT_MAC_LANGID_ESPERANTO 94 # define TT_MAC_LANGID_WELSH 128 # define TT_MAC_LANGID_BASQUE 129 # define TT_MAC_LANGID_CATALAN 130 # define TT_MAC_LANGID_LATIN 131 # define TT_MAC_LANGID_QUECHUA 132 # define TT_MAC_LANGID_GUARANI 133 # define TT_MAC_LANGID_AYMARA 134 # define TT_MAC_LANGID_TATAR 135 # define TT_MAC_LANGID_UIGHUR 136 # define TT_MAC_LANGID_DZONGKHA 137 # define TT_MAC_LANGID_JAVANESE 138 # define TT_MAC_LANGID_SUNDANESE 139 /* The following codes are new as of 2000-03-10 */ # define TT_MAC_LANGID_GALICIAN 140 # define TT_MAC_LANGID_AFRIKAANS 141 # define TT_MAC_LANGID_BRETON 142 # define TT_MAC_LANGID_INUKTITUT 143 # define TT_MAC_LANGID_SCOTTISH_GAELIC 144 # define TT_MAC_LANGID_MANX_GAELIC 145 # define TT_MAC_LANGID_IRISH_GAELIC 146 # define TT_MAC_LANGID_TONGAN 147 # define TT_MAC_LANGID_GREEK_POLYTONIC 148 # define TT_MAC_LANGID_GREELANDIC 149 # define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 Possible values of the language identifier field in the name records of the SFNT \u2018name\u2019 table if the \u2018platform\u2019 identifier code is TT_PLATFORM_MACINTOSH . These values are also used as return values for function FT_Get_CMap_Language_ID . The canonical source for Apple's IDs is https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html TT_MS_LANGID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 # define TT_MS_LANGID_ARABIC_IRAQ 0x0801 # define TT_MS_LANGID_ARABIC_EGYPT 0x0C01 # define TT_MS_LANGID_ARABIC_LIBYA 0x1001 # define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 # define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 # define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01 # define TT_MS_LANGID_ARABIC_OMAN 0x2001 # define TT_MS_LANGID_ARABIC_YEMEN 0x2401 # define TT_MS_LANGID_ARABIC_SYRIA 0x2801 # define TT_MS_LANGID_ARABIC_JORDAN 0x2C01 # define TT_MS_LANGID_ARABIC_LEBANON 0x3001 # define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 # define TT_MS_LANGID_ARABIC_UAE 0x3801 # define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01 # define TT_MS_LANGID_ARABIC_QATAR 0x4001 # define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 # define TT_MS_LANGID_CATALAN_CATALAN 0x0403 # define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 # define TT_MS_LANGID_CHINESE_PRC 0x0804 # define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04 # define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 # define TT_MS_LANGID_CHINESE_MACAO 0x1404 # define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 # define TT_MS_LANGID_DANISH_DENMARK 0x0406 # define TT_MS_LANGID_GERMAN_GERMANY 0x0407 # define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 # define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07 # define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 # define TT_MS_LANGID_GERMAN_LIECHTENSTEIN 0x1407 # define TT_MS_LANGID_GREEK_GREECE 0x0408 # define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 # define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 # define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09 # define TT_MS_LANGID_ENGLISH_CANADA 0x1009 # define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 # define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 # define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09 # define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 # define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 # define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 # define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09 # define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 # define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 # define TT_MS_LANGID_ENGLISH_INDIA 0x4009 # define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 # define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 # define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A # define TT_MS_LANGID_SPANISH_MEXICO 0x080A # define TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT 0x0C0A # define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A # define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A # define TT_MS_LANGID_SPANISH_PANAMA 0x180A # define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A # define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A # define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A # define TT_MS_LANGID_SPANISH_PERU 0x280A # define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A # define TT_MS_LANGID_SPANISH_ECUADOR 0x300A # define TT_MS_LANGID_SPANISH_CHILE 0x340A # define TT_MS_LANGID_SPANISH_URUGUAY 0x380A # define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A # define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A # define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A # define TT_MS_LANGID_SPANISH_HONDURAS 0x480A # define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A # define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A # define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A # define TT_MS_LANGID_FINNISH_FINLAND 0x040B # define TT_MS_LANGID_FRENCH_FRANCE 0x040C # define TT_MS_LANGID_FRENCH_BELGIUM 0x080C # define TT_MS_LANGID_FRENCH_CANADA 0x0C0C # define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C # define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C # define TT_MS_LANGID_FRENCH_MONACO 0x180C # define TT_MS_LANGID_HEBREW_ISRAEL 0x040D # define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E # define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F # define TT_MS_LANGID_ITALIAN_ITALY 0x0410 # define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 # define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 # define TT_MS_LANGID_KOREAN_KOREA 0x0412 # define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413 # define TT_MS_LANGID_DUTCH_BELGIUM 0x0813 # define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414 # define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814 # define TT_MS_LANGID_POLISH_POLAND 0x0415 # define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416 # define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816 # define TT_MS_LANGID_ROMANSH_SWITZERLAND 0x0417 # define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418 # define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 # define TT_MS_LANGID_CROATIAN_CROATIA 0x041A # define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A # define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A # define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A # define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A # define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A # define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x1C1A # define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC 0x201A # define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B # define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C # define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D # define TT_MS_LANGID_SWEDISH_FINLAND 0x081D # define TT_MS_LANGID_THAI_THAILAND 0x041E # define TT_MS_LANGID_TURKISH_TURKEY 0x041F # define TT_MS_LANGID_URDU_PAKISTAN 0x0420 # define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 # define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422 # define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423 # define TT_MS_LANGID_SLOVENIAN_SLOVENIA 0x0424 # define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425 # define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 # define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 # define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 # define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A # define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B # define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C # define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C # define TT_MS_LANGID_BASQUE_BASQUE 0x042D # define TT_MS_LANGID_UPPER_SORBIAN_GERMANY 0x042E # define TT_MS_LANGID_LOWER_SORBIAN_GERMANY 0x082E # define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F # define TT_MS_LANGID_SETSWANA_SOUTH_AFRICA 0x0432 # define TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA 0x0434 # define TT_MS_LANGID_ISIZULU_SOUTH_AFRICA 0x0435 # define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436 # define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 # define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 # define TT_MS_LANGID_HINDI_INDIA 0x0439 # define TT_MS_LANGID_MALTESE_MALTA 0x043A # define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B # define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B # define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B # define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B # define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B # define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B # define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B # define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B # define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B # define TT_MS_LANGID_IRISH_IRELAND 0x083C # define TT_MS_LANGID_MALAY_MALAYSIA 0x043E # define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E # define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F # define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic */ 0x0440 # define TT_MS_LANGID_KISWAHILI_KENYA 0x0441 # define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 # define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443 # define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843 # define TT_MS_LANGID_TATAR_RUSSIA 0x0444 # define TT_MS_LANGID_BENGALI_INDIA 0x0445 # define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 # define TT_MS_LANGID_PUNJABI_INDIA 0x0446 # define TT_MS_LANGID_GUJARATI_INDIA 0x0447 # define TT_MS_LANGID_ODIA_INDIA 0x0448 # define TT_MS_LANGID_TAMIL_INDIA 0x0449 # define TT_MS_LANGID_TELUGU_INDIA 0x044A # define TT_MS_LANGID_KANNADA_INDIA 0x044B # define TT_MS_LANGID_MALAYALAM_INDIA 0x044C # define TT_MS_LANGID_ASSAMESE_INDIA 0x044D # define TT_MS_LANGID_MARATHI_INDIA 0x044E # define TT_MS_LANGID_SANSKRIT_INDIA 0x044F # define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 # define TT_MS_LANGID_MONGOLIAN_PRC 0x0850 # define TT_MS_LANGID_TIBETAN_PRC 0x0451 # define TT_MS_LANGID_WELSH_UNITED_KINGDOM 0x0452 # define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 # define TT_MS_LANGID_LAO_LAOS 0x0454 # define TT_MS_LANGID_GALICIAN_GALICIAN 0x0456 # define TT_MS_LANGID_KONKANI_INDIA 0x0457 # define TT_MS_LANGID_SYRIAC_SYRIA 0x045A # define TT_MS_LANGID_SINHALA_SRI_LANKA 0x045B # define TT_MS_LANGID_INUKTITUT_CANADA 0x045D # define TT_MS_LANGID_INUKTITUT_CANADA_LATIN 0x085D # define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E # define TT_MS_LANGID_TAMAZIGHT_ALGERIA 0x085F # define TT_MS_LANGID_NEPALI_NEPAL 0x0461 # define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 # define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 # define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464 # define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465 # define TT_MS_LANGID_HAUSA_NIGERIA 0x0468 # define TT_MS_LANGID_YORUBA_NIGERIA 0x046A # define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B # define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B # define TT_MS_LANGID_QUECHUA_PERU 0x0C6B # define TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA 0x046C # define TT_MS_LANGID_BASHKIR_RUSSIA 0x046D # define TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG 0x046E # define TT_MS_LANGID_GREENLANDIC_GREENLAND 0x046F # define TT_MS_LANGID_IGBO_NIGERIA 0x0470 # define TT_MS_LANGID_YI_PRC 0x0478 # define TT_MS_LANGID_MAPUDUNGUN_CHILE 0x047A # define TT_MS_LANGID_MOHAWK_MOHAWK 0x047C # define TT_MS_LANGID_BRETON_FRANCE 0x047E # define TT_MS_LANGID_UIGHUR_PRC 0x0480 # define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481 # define TT_MS_LANGID_OCCITAN_FRANCE 0x0482 # define TT_MS_LANGID_CORSICAN_FRANCE 0x0483 # define TT_MS_LANGID_ALSATIAN_FRANCE 0x0484 # define TT_MS_LANGID_YAKUT_RUSSIA 0x0485 # define TT_MS_LANGID_KICHE_GUATEMALA 0x0486 # define TT_MS_LANGID_KINYARWANDA_RWANDA 0x0487 # define TT_MS_LANGID_WOLOF_SENEGAL 0x0488 # define TT_MS_LANGID_DARI_AFGHANISTAN 0x048C Possible values of the language identifier field in the name records of the SFNT \u2018name\u2019 table if the \u2018platform\u2019 identifier code is TT_PLATFORM_MICROSOFT . These values are also used as return values for function FT_Get_CMap_Language_ID . The canonical source for Microsoft's IDs is https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings , however, we only provide macros for language identifiers present in the OpenType specification: Microsoft has abandoned the concept of LCIDs (language code identifiers), and format 1 of the \u2018name\u2019 table provides a better mechanism for languages not covered here. More legacy values not listed in the reference can be found in the FT_TRUETYPE_IDS_H header file. TT_NAME_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_NAME_ID_COPYRIGHT 0 # define TT_NAME_ID_FONT_FAMILY 1 # define TT_NAME_ID_FONT_SUBFAMILY 2 # define TT_NAME_ID_UNIQUE_ID 3 # define TT_NAME_ID_FULL_NAME 4 # define TT_NAME_ID_VERSION_STRING 5 # define TT_NAME_ID_PS_NAME 6 # define TT_NAME_ID_TRADEMARK 7 /* the following values are from the OpenType spec */ # define TT_NAME_ID_MANUFACTURER 8 # define TT_NAME_ID_DESIGNER 9 # define TT_NAME_ID_DESCRIPTION 10 # define TT_NAME_ID_VENDOR_URL 11 # define TT_NAME_ID_DESIGNER_URL 12 # define TT_NAME_ID_LICENSE 13 # define TT_NAME_ID_LICENSE_URL 14 /* number 15 is reserved */ # define TT_NAME_ID_TYPOGRAPHIC_FAMILY 16 # define TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY 17 # define TT_NAME_ID_MAC_FULL_NAME 18 /* The following code is new as of 2000-01-21 */ # define TT_NAME_ID_SAMPLE_TEXT 19 /* This is new in OpenType 1.3 */ # define TT_NAME_ID_CID_FINDFONT_NAME 20 /* This is new in OpenType 1.5 */ # define TT_NAME_ID_WWS_FAMILY 21 # define TT_NAME_ID_WWS_SUBFAMILY 22 /* This is new in OpenType 1.7 */ # define TT_NAME_ID_LIGHT_BACKGROUND 23 # define TT_NAME_ID_DARK_BACKGROUND 24 /* This is new in OpenType 1.8 */ # define TT_NAME_ID_VARIATIONS_PREFIX 25 /* these two values are deprecated */ # define TT_NAME_ID_PREFERRED_FAMILY TT_NAME_ID_TYPOGRAPHIC_FAMILY # define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY Possible values of the \u2018name\u2019 identifier field in the name records of an SFNT \u2018name\u2019 table. These values are platform independent. TT_UCR_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). /* ulUnicodeRange1 */ /* --------------- */ /* Bit 0 Basic Latin */ # define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ /* Bit 1 C1 Controls and Latin-1 Supplement */ # define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ /* Bit 2 Latin Extended-A */ # define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ /* Bit 3 Latin Extended-B */ # define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ /* Bit 4 IPA Extensions */ /* Phonetic Extensions */ /* Phonetic Extensions Supplement */ # define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ /* U+1D00-U+1D7F */ /* U+1D80-U+1DBF */ /* Bit 5 Spacing Modifier Letters */ /* Modifier Tone Letters */ # define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ /* U+A700-U+A71F */ /* Bit 6 Combining Diacritical Marks */ /* Combining Diacritical Marks Supplement */ # define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */ /* U+1DC0-U+1DFF */ /* Bit 7 Greek and Coptic */ # define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ /* Bit 8 Coptic */ # define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */ /* Bit 9 Cyrillic */ /* Cyrillic Supplement */ /* Cyrillic Extended-A */ /* Cyrillic Extended-B */ # define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ /* U+0500-U+052F */ /* U+2DE0-U+2DFF */ /* U+A640-U+A69F */ /* Bit 10 Armenian */ # define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ /* Bit 11 Hebrew */ # define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ /* Bit 12 Vai */ # define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */ /* Bit 13 Arabic */ /* Arabic Supplement */ # define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ /* U+0750-U+077F */ /* Bit 14 NKo */ # define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */ /* Bit 15 Devanagari */ # define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ /* Bit 16 Bengali */ # define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */ /* Bit 17 Gurmukhi */ # define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */ /* Bit 18 Gujarati */ # define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */ /* Bit 19 Oriya */ # define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */ /* Bit 20 Tamil */ # define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */ /* Bit 21 Telugu */ # define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */ /* Bit 22 Kannada */ # define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */ /* Bit 23 Malayalam */ # define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */ /* Bit 24 Thai */ # define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ /* Bit 25 Lao */ # define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ /* Bit 26 Georgian */ /* Georgian Supplement */ # define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ /* U+2D00-U+2D2F */ /* Bit 27 Balinese */ # define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */ /* Bit 28 Hangul Jamo */ # define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ /* Bit 29 Latin Extended Additional */ /* Latin Extended-C */ /* Latin Extended-D */ # define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ /* U+2C60-U+2C7F */ /* U+A720-U+A7FF */ /* Bit 30 Greek Extended */ # define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ /* Bit 31 General Punctuation */ /* Supplemental Punctuation */ # define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ /* U+2E00-U+2E7F */ /* ulUnicodeRange2 */ /* --------------- */ /* Bit 32 Superscripts And Subscripts */ # define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ /* Bit 33 Currency Symbols */ # define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ /* Bit 34 Combining Diacritical Marks For Symbols */ # define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\ (1L << 2) /* U+20D0-U+20FF */ /* Bit 35 Letterlike Symbols */ # define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ /* Bit 36 Number Forms */ # define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ /* Bit 37 Arrows */ /* Supplemental Arrows-A */ /* Supplemental Arrows-B */ /* Miscellaneous Symbols and Arrows */ # define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ /* U+27F0-U+27FF */ /* U+2900-U+297F */ /* U+2B00-U+2BFF */ /* Bit 38 Mathematical Operators */ /* Supplemental Mathematical Operators */ /* Miscellaneous Mathematical Symbols-A */ /* Miscellaneous Mathematical Symbols-B */ # define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ /* U+2A00-U+2AFF */ /* U+27C0-U+27EF */ /* U+2980-U+29FF */ /* Bit 39 Miscellaneous Technical */ # define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ /* Bit 40 Control Pictures */ # define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */ /* Bit 41 Optical Character Recognition */ # define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */ /* Bit 42 Enclosed Alphanumerics */ # define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */ /* Bit 43 Box Drawing */ # define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */ /* Bit 44 Block Elements */ # define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */ /* Bit 45 Geometric Shapes */ # define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */ /* Bit 46 Miscellaneous Symbols */ # define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ /* Bit 47 Dingbats */ # define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ /* Bit 48 CJK Symbols and Punctuation */ # define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ /* Bit 49 Hiragana */ # define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ /* Bit 50 Katakana */ /* Katakana Phonetic Extensions */ # define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ /* U+31F0-U+31FF */ /* Bit 51 Bopomofo */ /* Bopomofo Extended */ # define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ /* U+31A0-U+31BF */ /* Bit 52 Hangul Compatibility Jamo */ # define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ /* Bit 53 Phags-Pa */ # define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */ # define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */ # define TT_UCR_PHAGSPA /* Bit 54 Enclosed CJK Letters and Months */ # define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ /* Bit 55 CJK Compatibility */ # define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ /* Bit 56 Hangul Syllables */ # define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ /* Bit 57 High Surrogates */ /* High Private Use Surrogates */ /* Low Surrogates */ /* According to OpenType specs v.1.3+, */ /* setting bit 57 implies that there is */ /* at least one codepoint beyond the */ /* Basic Multilingual Plane that is */ /* supported by this font. So it really */ /* means >= U+10000. */ # define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ /* U+DB80-U+DBFF */ /* U+DC00-U+DFFF */ # define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES /* Bit 58 Phoenician */ # define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/ /* Bit 59 CJK Unified Ideographs */ /* CJK Radicals Supplement */ /* Kangxi Radicals */ /* Ideographic Description Characters */ /* CJK Unified Ideographs Extension A */ /* CJK Unified Ideographs Extension B */ /* Kanbun */ # define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ /* U+2E80-U+2EFF */ /* U+2F00-U+2FDF */ /* U+2FF0-U+2FFF */ /* U+3400-U+4DB5 */ /*U+20000-U+2A6DF*/ /* U+3190-U+319F */ /* Bit 60 Private Use */ # define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ /* Bit 61 CJK Strokes */ /* CJK Compatibility Ideographs */ /* CJK Compatibility Ideographs Supplement */ # define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */ /* U+F900-U+FAFF */ /*U+2F800-U+2FA1F*/ /* Bit 62 Alphabetic Presentation Forms */ # define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ /* Bit 63 Arabic Presentation Forms-A */ # define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */ /* ulUnicodeRange3 */ /* --------------- */ /* Bit 64 Combining Half Marks */ # define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ /* Bit 65 Vertical forms */ /* CJK Compatibility Forms */ # define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */ /* U+FE30-U+FE4F */ /* Bit 66 Small Form Variants */ # define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ /* Bit 67 Arabic Presentation Forms-B */ # define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */ /* Bit 68 Halfwidth and Fullwidth Forms */ # define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ /* Bit 69 Specials */ # define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ /* Bit 70 Tibetan */ # define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ /* Bit 71 Syriac */ # define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ /* Bit 72 Thaana */ # define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */ /* Bit 73 Sinhala */ # define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ /* Bit 74 Myanmar */ # define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ /* Bit 75 Ethiopic */ /* Ethiopic Supplement */ /* Ethiopic Extended */ # define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ /* U+1380-U+139F */ /* U+2D80-U+2DDF */ /* Bit 76 Cherokee */ # define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ /* Bit 77 Unified Canadian Aboriginal Syllabics */ # define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ /* Bit 78 Ogham */ # define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ /* Bit 79 Runic */ # define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ /* Bit 80 Khmer */ /* Khmer Symbols */ # define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ /* U+19E0-U+19FF */ /* Bit 81 Mongolian */ # define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ /* Bit 82 Braille Patterns */ # define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ /* Bit 83 Yi Syllables */ /* Yi Radicals */ # define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ /* U+A490-U+A4CF */ /* Bit 84 Tagalog */ /* Hanunoo */ /* Buhid */ /* Tagbanwa */ # define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ /* U+1720-U+173F */ /* U+1740-U+175F */ /* U+1760-U+177F */ /* Bit 85 Old Italic */ # define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ /* Bit 86 Gothic */ # define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ /* Bit 87 Deseret */ # define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ /* Bit 88 Byzantine Musical Symbols */ /* Musical Symbols */ /* Ancient Greek Musical Notation */ # define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ /*U+1D100-U+1D1FF*/ /*U+1D200-U+1D24F*/ /* Bit 89 Mathematical Alphanumeric Symbols */ # define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ /* Bit 90 Private Use (plane 15) */ /* Private Use (plane 16) */ # define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ /*U+100000-U+10FFFD*/ /* Bit 91 Variation Selectors */ /* Variation Selectors Supplement */ # define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ /*U+E0100-U+E01EF*/ /* Bit 92 Tags */ # define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ /* Bit 93 Limbu */ # define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */ /* Bit 94 Tai Le */ # define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */ /* Bit 95 New Tai Lue */ # define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */ /* ulUnicodeRange4 */ /* --------------- */ /* Bit 96 Buginese */ # define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */ /* Bit 97 Glagolitic */ # define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */ /* Bit 98 Tifinagh */ # define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */ /* Bit 99 Yijing Hexagram Symbols */ # define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */ /* Bit 100 Syloti Nagri */ # define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */ /* Bit 101 Linear B Syllabary */ /* Linear B Ideograms */ /* Aegean Numbers */ # define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/ /*U+10080-U+100FF*/ /*U+10100-U+1013F*/ /* Bit 102 Ancient Greek Numbers */ # define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/ /* Bit 103 Ugaritic */ # define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/ /* Bit 104 Old Persian */ # define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/ /* Bit 105 Shavian */ # define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/ /* Bit 106 Osmanya */ # define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/ /* Bit 107 Cypriot Syllabary */ # define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/ /* Bit 108 Kharoshthi */ # define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/ /* Bit 109 Tai Xuan Jing Symbols */ # define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/ /* Bit 110 Cuneiform */ /* Cuneiform Numbers and Punctuation */ # define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/ /*U+12400-U+1247F*/ /* Bit 111 Counting Rod Numerals */ # define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/ /* Bit 112 Sundanese */ # define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */ /* Bit 113 Lepcha */ # define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */ /* Bit 114 Ol Chiki */ # define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */ /* Bit 115 Saurashtra */ # define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */ /* Bit 116 Kayah Li */ # define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */ /* Bit 117 Rejang */ # define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */ /* Bit 118 Cham */ # define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */ /* Bit 119 Ancient Symbols */ # define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/ /* Bit 120 Phaistos Disc */ # define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/ /* Bit 121 Carian */ /* Lycian */ /* Lydian */ # define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/ /*U+10280-U+1029F*/ /*U+10920-U+1093F*/ /* Bit 122 Domino Tiles */ /* Mahjong Tiles */ # define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/ /*U+1F000-U+1F02F*/ /* Bit 123-127 Reserved for process-internal usage */ Possible bit mask values for the ulUnicodeRangeX fields in an SFNT \u2018OS/2\u2019 table.","title":"TrueType Tables"},{"location":"ft2-truetype_tables.html#truetype-tables","text":"","title":"TrueType Tables"},{"location":"ft2-truetype_tables.html#synopsis","text":"This section contains definitions of some basic tables specific to TrueType and OpenType as well as some routines used to access and process them.","title":"Synopsis"},{"location":"ft2-truetype_tables.html#tt_header","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_Header_ { FT_Fixed Table_Version; FT_Fixed Font_Revision; FT_Long CheckSum_Adjust; FT_Long Magic_Number; FT_UShort Flags; FT_UShort Units_Per_EM; FT_ULong Created [2]; FT_ULong Modified[2]; FT_Short xMin; FT_Short yMin; FT_Short xMax; FT_Short yMax; FT_UShort Mac_Style; FT_UShort Lowest_Rec_PPEM; FT_Short Font_Direction; FT_Short Index_To_Loc_Format; FT_Short Glyph_Data_Format; } TT_Header ; A structure to model a TrueType font header table. All fields follow the OpenType specification. The 64-bit timestamps are stored in two-element arrays Created and Modified , first the upper then the lower 32 bits.","title":"TT_Header"},{"location":"ft2-truetype_tables.html#tt_horiheader","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_HoriHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Width_Max; /* advance width maximum */ FT_Short min_Left_Side_Bearing; /* minimum left-sb */ FT_Short min_Right_Side_Bearing; /* minimum right-sb */ FT_Short xMax_Extent; /* xmax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_HMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* 'hmtx' table. */ void * long_metrics; void * short_metrics; } TT_HoriHeader ; A structure to model a TrueType horizontal header, the \u2018hhea\u2019 table, as well as the corresponding horizontal metrics table, \u2018hmtx\u2019.","title":"TT_HoriHeader"},{"location":"ft2-truetype_tables.html#tt_vertheader","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_VertHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Height_Max; /* advance height maximum */ FT_Short min_Top_Side_Bearing; /* minimum top-sb */ FT_Short min_Bottom_Side_Bearing; /* minimum bottom-sb */ FT_Short yMax_Extent; /* ymax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_VMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* 'vmtx' table. */ void * long_metrics; void * short_metrics; } TT_VertHeader ; A structure used to model a TrueType vertical header, the \u2018vhea\u2019 table, as well as the corresponding vertical metrics table, \u2018vmtx\u2019.","title":"TT_VertHeader"},{"location":"ft2-truetype_tables.html#tt_os2","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_OS2_ { FT_UShort version; /* 0x0001 - more or 0xFFFF */ FT_Short xAvgCharWidth; FT_UShort usWeightClass; FT_UShort usWidthClass; FT_UShort fsType; FT_Short ySubscriptXSize; FT_Short ySubscriptYSize; FT_Short ySubscriptXOffset; FT_Short ySubscriptYOffset; FT_Short ySuperscriptXSize; FT_Short ySuperscriptYSize; FT_Short ySuperscriptXOffset; FT_Short ySuperscriptYOffset; FT_Short yStrikeoutSize; FT_Short yStrikeoutPosition; FT_Short sFamilyClass; FT_Byte panose[10]; FT_ULong ulUnicodeRange1; /* Bits 0-31 */ FT_ULong ulUnicodeRange2; /* Bits 32-63 */ FT_ULong ulUnicodeRange3; /* Bits 64-95 */ FT_ULong ulUnicodeRange4; /* Bits 96-127 */ FT_Char achVendID[4]; FT_UShort fsSelection; FT_UShort usFirstCharIndex; FT_UShort usLastCharIndex; FT_Short sTypoAscender; FT_Short sTypoDescender; FT_Short sTypoLineGap; FT_UShort usWinAscent; FT_UShort usWinDescent; /* only version 1 and higher: */ FT_ULong ulCodePageRange1; /* Bits 0-31 */ FT_ULong ulCodePageRange2; /* Bits 32-63 */ /* only version 2 and higher: */ FT_Short sxHeight; FT_Short sCapHeight; FT_UShort usDefaultChar; FT_UShort usBreakChar; FT_UShort usMaxContext; /* only version 5 and higher: */ FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */ FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */ } TT_OS2 ; A structure to model a TrueType \u2018OS/2\u2019 table. All fields comply to the OpenType specification. Note that we now support old Mac fonts that do not include an \u2018OS/2\u2019 table. In this case, the version field is always set to 0xFFFF.","title":"TT_OS2"},{"location":"ft2-truetype_tables.html#tt_postscript","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_Postscript_ { FT_Fixed FormatType; FT_Fixed italicAngle; FT_Short underlinePosition; FT_Short underlineThickness; FT_ULong isFixedPitch; FT_ULong minMemType42; FT_ULong maxMemType42; FT_ULong minMemType1; FT_ULong maxMemType1; /* Glyph names follow in the 'post' table, but we don't */ /* load them by default. */ } TT_Postscript ; A structure to model a TrueType \u2018post\u2019 table. All fields comply to the OpenType specification. This structure does not reference a font's PostScript glyph names; use FT_Get_Glyph_Name to retrieve them.","title":"TT_Postscript"},{"location":"ft2-truetype_tables.html#tt_pclt","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_PCLT_ { FT_Fixed Version; FT_ULong FontNumber; FT_UShort Pitch; FT_UShort xHeight; FT_UShort Style; FT_UShort TypeFamily; FT_UShort CapHeight; FT_UShort SymbolSet; FT_Char TypeFace[16]; FT_Char CharacterComplement[8]; FT_Char FileName[6]; FT_Char StrokeWeight; FT_Char WidthType; FT_Byte SerifStyle; FT_Byte Reserved; } TT_PCLT ; A structure to model a TrueType \u2018PCLT\u2019 table. All fields comply to the OpenType specification.","title":"TT_PCLT"},{"location":"ft2-truetype_tables.html#tt_maxprofile","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_MaxProfile_ { FT_Fixed version; FT_UShort numGlyphs; FT_UShort maxPoints; FT_UShort maxContours; FT_UShort maxCompositePoints; FT_UShort maxCompositeContours; FT_UShort maxZones; FT_UShort maxTwilightPoints; FT_UShort maxStorage; FT_UShort maxFunctionDefs; FT_UShort maxInstructionDefs; FT_UShort maxStackElements; FT_UShort maxSizeOfInstructions; FT_UShort maxComponentElements; FT_UShort maxComponentDepth; } TT_MaxProfile ; The maximum profile (\u2018maxp\u2019) table contains many max values, which can be used to pre-allocate arrays for speeding up glyph loading and hinting.","title":"TT_MaxProfile"},{"location":"ft2-truetype_tables.html#ft_sfnt_tag","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef enum FT_Sfnt_Tag_ { FT_SFNT_HEAD , FT_SFNT_MAXP , FT_SFNT_OS2 , FT_SFNT_HHEA , FT_SFNT_VHEA , FT_SFNT_POST , FT_SFNT_PCLT , FT_SFNT_MAX } FT_Sfnt_Tag ; /* these constants are deprecated; use the corresponding ` FT_Sfnt_Tag ` */ /* values instead */ # define ft_sfnt_head FT_SFNT_HEAD # define ft_sfnt_maxp FT_SFNT_MAXP # define ft_sfnt_os2 FT_SFNT_OS2 # define ft_sfnt_hhea FT_SFNT_HHEA # define ft_sfnt_vhea FT_SFNT_VHEA # define ft_sfnt_post FT_SFNT_POST # define ft_sfnt_pclt FT_SFNT_PCLT An enumeration to specify indices of SFNT tables loaded and parsed by FreeType during initialization of an SFNT font. Used in the FT_Get_Sfnt_Table API function.","title":"FT_Sfnt_Tag"},{"location":"ft2-truetype_tables.html#ft_get_sfnt_table","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( void * ) FT_Get_Sfnt_Table ( FT_Face face, FT_Sfnt_Tag tag ); Return a pointer to a given SFNT table stored within a face.","title":"FT_Get_Sfnt_Table"},{"location":"ft2-truetype_tables.html#ft_load_sfnt_table","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Error ) FT_Load_Sfnt_Table ( FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte * buffer, FT_ULong * length ); Load any SFNT font table into client memory.","title":"FT_Load_Sfnt_Table"},{"location":"ft2-truetype_tables.html#ft_sfnt_table_info","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Error ) FT_Sfnt_Table_Info ( FT_Face face, FT_UInt table_index, FT_ULong *tag, FT_ULong *length ); Return information on an SFNT table.","title":"FT_Sfnt_Table_Info"},{"location":"ft2-truetype_tables.html#ft_get_cmap_language_id","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_ULong ) FT_Get_CMap_Language_ID ( FT_CharMap charmap ); Return cmap language ID as specified in the OpenType standard. Definitions of language ID values are in file FT_TRUETYPE_IDS_H .","title":"FT_Get_CMap_Language_ID"},{"location":"ft2-truetype_tables.html#ft_get_cmap_format","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Long ) FT_Get_CMap_Format ( FT_CharMap charmap ); Return the format of an SFNT \u2018cmap\u2019 table.","title":"FT_Get_CMap_Format"},{"location":"ft2-truetype_tables.html#ft_param_tag_unpatented_hinting","text":"# define FT_PARAM_TAG_UNPATENTED_HINTING \\ FT_MAKE_TAG ( 'u', 'n', 'p', 'a' ) Deprecated, no effect. Previously: A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face .","title":"FT_PARAM_TAG_UNPATENTED_HINTING"},{"location":"ft2-truetype_tables.html#tt_platform_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_PLATFORM_APPLE_UNICODE 0 # define TT_PLATFORM_MACINTOSH 1 # define TT_PLATFORM_ISO 2 /* deprecated */ # define TT_PLATFORM_MICROSOFT 3 # define TT_PLATFORM_CUSTOM 4 # define TT_PLATFORM_ADOBE 7 /* artificial */ A list of valid values for the platform_id identifier code in FT_CharMapRec and FT_SfntName structures.","title":"TT_PLATFORM_XXX"},{"location":"ft2-truetype_tables.html#tt_apple_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ # define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ # define TT_APPLE_ID_ISO_10646 2 /* deprecated */ # define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ # define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ # define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */ # define TT_APPLE_ID_FULL_UNICODE 6 /* used with type 13 cmaps */ A list of valid values for the encoding_id for TT_PLATFORM_APPLE_UNICODE charmaps and name entries.","title":"TT_APPLE_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_mac_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MAC_ID_ROMAN 0 # define TT_MAC_ID_JAPANESE 1 # define TT_MAC_ID_TRADITIONAL_CHINESE 2 # define TT_MAC_ID_KOREAN 3 # define TT_MAC_ID_ARABIC 4 # define TT_MAC_ID_HEBREW 5 # define TT_MAC_ID_GREEK 6 # define TT_MAC_ID_RUSSIAN 7 # define TT_MAC_ID_RSYMBOL 8 # define TT_MAC_ID_DEVANAGARI 9 # define TT_MAC_ID_GURMUKHI 10 # define TT_MAC_ID_GUJARATI 11 # define TT_MAC_ID_ORIYA 12 # define TT_MAC_ID_BENGALI 13 # define TT_MAC_ID_TAMIL 14 # define TT_MAC_ID_TELUGU 15 # define TT_MAC_ID_KANNADA 16 # define TT_MAC_ID_MALAYALAM 17 # define TT_MAC_ID_SINHALESE 18 # define TT_MAC_ID_BURMESE 19 # define TT_MAC_ID_KHMER 20 # define TT_MAC_ID_THAI 21 # define TT_MAC_ID_LAOTIAN 22 # define TT_MAC_ID_GEORGIAN 23 # define TT_MAC_ID_ARMENIAN 24 # define TT_MAC_ID_MALDIVIAN 25 # define TT_MAC_ID_SIMPLIFIED_CHINESE 25 # define TT_MAC_ID_TIBETAN 26 # define TT_MAC_ID_MONGOLIAN 27 # define TT_MAC_ID_GEEZ 28 # define TT_MAC_ID_SLAVIC 29 # define TT_MAC_ID_VIETNAMESE 30 # define TT_MAC_ID_SINDHI 31 # define TT_MAC_ID_UNINTERP 32 A list of valid values for the encoding_id for TT_PLATFORM_MACINTOSH charmaps and name entries.","title":"TT_MAC_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_iso_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_ISO_ID_7BIT_ASCII 0 # define TT_ISO_ID_10646 1 # define TT_ISO_ID_8859_1 2 A list of valid values for the encoding_id for TT_PLATFORM_ISO charmaps and name entries. Their use is now deprecated.","title":"TT_ISO_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_ms_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MS_ID_SYMBOL_CS 0 # define TT_MS_ID_UNICODE_CS 1 # define TT_MS_ID_SJIS 2 # define TT_MS_ID_PRC 3 # define TT_MS_ID_BIG_5 4 # define TT_MS_ID_WANSUNG 5 # define TT_MS_ID_JOHAB 6 # define TT_MS_ID_UCS_4 10 /* this value is deprecated */ # define TT_MS_ID_GB2312 TT_MS_ID_PRC A list of valid values for the encoding_id for TT_PLATFORM_MICROSOFT charmaps and name entries.","title":"TT_MS_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_adobe_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_ADOBE_ID_STANDARD 0 # define TT_ADOBE_ID_EXPERT 1 # define TT_ADOBE_ID_CUSTOM 2 # define TT_ADOBE_ID_LATIN_1 3 A list of valid values for the encoding_id for TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!","title":"TT_ADOBE_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_mac_langid_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MAC_LANGID_ENGLISH 0 # define TT_MAC_LANGID_FRENCH 1 # define TT_MAC_LANGID_GERMAN 2 # define TT_MAC_LANGID_ITALIAN 3 # define TT_MAC_LANGID_DUTCH 4 # define TT_MAC_LANGID_SWEDISH 5 # define TT_MAC_LANGID_SPANISH 6 # define TT_MAC_LANGID_DANISH 7 # define TT_MAC_LANGID_PORTUGUESE 8 # define TT_MAC_LANGID_NORWEGIAN 9 # define TT_MAC_LANGID_HEBREW 10 # define TT_MAC_LANGID_JAPANESE 11 # define TT_MAC_LANGID_ARABIC 12 # define TT_MAC_LANGID_FINNISH 13 # define TT_MAC_LANGID_GREEK 14 # define TT_MAC_LANGID_ICELANDIC 15 # define TT_MAC_LANGID_MALTESE 16 # define TT_MAC_LANGID_TURKISH 17 # define TT_MAC_LANGID_CROATIAN 18 # define TT_MAC_LANGID_CHINESE_TRADITIONAL 19 # define TT_MAC_LANGID_URDU 20 # define TT_MAC_LANGID_HINDI 21 # define TT_MAC_LANGID_THAI 22 # define TT_MAC_LANGID_KOREAN 23 # define TT_MAC_LANGID_LITHUANIAN 24 # define TT_MAC_LANGID_POLISH 25 # define TT_MAC_LANGID_HUNGARIAN 26 # define TT_MAC_LANGID_ESTONIAN 27 # define TT_MAC_LANGID_LETTISH 28 # define TT_MAC_LANGID_SAAMISK 29 # define TT_MAC_LANGID_FAEROESE 30 # define TT_MAC_LANGID_FARSI 31 # define TT_MAC_LANGID_RUSSIAN 32 # define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33 # define TT_MAC_LANGID_FLEMISH 34 # define TT_MAC_LANGID_IRISH 35 # define TT_MAC_LANGID_ALBANIAN 36 # define TT_MAC_LANGID_ROMANIAN 37 # define TT_MAC_LANGID_CZECH 38 # define TT_MAC_LANGID_SLOVAK 39 # define TT_MAC_LANGID_SLOVENIAN 40 # define TT_MAC_LANGID_YIDDISH 41 # define TT_MAC_LANGID_SERBIAN 42 # define TT_MAC_LANGID_MACEDONIAN 43 # define TT_MAC_LANGID_BULGARIAN 44 # define TT_MAC_LANGID_UKRAINIAN 45 # define TT_MAC_LANGID_BYELORUSSIAN 46 # define TT_MAC_LANGID_UZBEK 47 # define TT_MAC_LANGID_KAZAKH 48 # define TT_MAC_LANGID_AZERBAIJANI 49 # define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49 # define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50 # define TT_MAC_LANGID_ARMENIAN 51 # define TT_MAC_LANGID_GEORGIAN 52 # define TT_MAC_LANGID_MOLDAVIAN 53 # define TT_MAC_LANGID_KIRGHIZ 54 # define TT_MAC_LANGID_TAJIKI 55 # define TT_MAC_LANGID_TURKMEN 56 # define TT_MAC_LANGID_MONGOLIAN 57 # define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57 # define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58 # define TT_MAC_LANGID_PASHTO 59 # define TT_MAC_LANGID_KURDISH 60 # define TT_MAC_LANGID_KASHMIRI 61 # define TT_MAC_LANGID_SINDHI 62 # define TT_MAC_LANGID_TIBETAN 63 # define TT_MAC_LANGID_NEPALI 64 # define TT_MAC_LANGID_SANSKRIT 65 # define TT_MAC_LANGID_MARATHI 66 # define TT_MAC_LANGID_BENGALI 67 # define TT_MAC_LANGID_ASSAMESE 68 # define TT_MAC_LANGID_GUJARATI 69 # define TT_MAC_LANGID_PUNJABI 70 # define TT_MAC_LANGID_ORIYA 71 # define TT_MAC_LANGID_MALAYALAM 72 # define TT_MAC_LANGID_KANNADA 73 # define TT_MAC_LANGID_TAMIL 74 # define TT_MAC_LANGID_TELUGU 75 # define TT_MAC_LANGID_SINHALESE 76 # define TT_MAC_LANGID_BURMESE 77 # define TT_MAC_LANGID_KHMER 78 # define TT_MAC_LANGID_LAO 79 # define TT_MAC_LANGID_VIETNAMESE 80 # define TT_MAC_LANGID_INDONESIAN 81 # define TT_MAC_LANGID_TAGALOG 82 # define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83 # define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84 # define TT_MAC_LANGID_AMHARIC 85 # define TT_MAC_LANGID_TIGRINYA 86 # define TT_MAC_LANGID_GALLA 87 # define TT_MAC_LANGID_SOMALI 88 # define TT_MAC_LANGID_SWAHILI 89 # define TT_MAC_LANGID_RUANDA 90 # define TT_MAC_LANGID_RUNDI 91 # define TT_MAC_LANGID_CHEWA 92 # define TT_MAC_LANGID_MALAGASY 93 # define TT_MAC_LANGID_ESPERANTO 94 # define TT_MAC_LANGID_WELSH 128 # define TT_MAC_LANGID_BASQUE 129 # define TT_MAC_LANGID_CATALAN 130 # define TT_MAC_LANGID_LATIN 131 # define TT_MAC_LANGID_QUECHUA 132 # define TT_MAC_LANGID_GUARANI 133 # define TT_MAC_LANGID_AYMARA 134 # define TT_MAC_LANGID_TATAR 135 # define TT_MAC_LANGID_UIGHUR 136 # define TT_MAC_LANGID_DZONGKHA 137 # define TT_MAC_LANGID_JAVANESE 138 # define TT_MAC_LANGID_SUNDANESE 139 /* The following codes are new as of 2000-03-10 */ # define TT_MAC_LANGID_GALICIAN 140 # define TT_MAC_LANGID_AFRIKAANS 141 # define TT_MAC_LANGID_BRETON 142 # define TT_MAC_LANGID_INUKTITUT 143 # define TT_MAC_LANGID_SCOTTISH_GAELIC 144 # define TT_MAC_LANGID_MANX_GAELIC 145 # define TT_MAC_LANGID_IRISH_GAELIC 146 # define TT_MAC_LANGID_TONGAN 147 # define TT_MAC_LANGID_GREEK_POLYTONIC 148 # define TT_MAC_LANGID_GREELANDIC 149 # define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 Possible values of the language identifier field in the name records of the SFNT \u2018name\u2019 table if the \u2018platform\u2019 identifier code is TT_PLATFORM_MACINTOSH . These values are also used as return values for function FT_Get_CMap_Language_ID . The canonical source for Apple's IDs is https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html","title":"TT_MAC_LANGID_XXX"},{"location":"ft2-truetype_tables.html#tt_ms_langid_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 # define TT_MS_LANGID_ARABIC_IRAQ 0x0801 # define TT_MS_LANGID_ARABIC_EGYPT 0x0C01 # define TT_MS_LANGID_ARABIC_LIBYA 0x1001 # define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 # define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 # define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01 # define TT_MS_LANGID_ARABIC_OMAN 0x2001 # define TT_MS_LANGID_ARABIC_YEMEN 0x2401 # define TT_MS_LANGID_ARABIC_SYRIA 0x2801 # define TT_MS_LANGID_ARABIC_JORDAN 0x2C01 # define TT_MS_LANGID_ARABIC_LEBANON 0x3001 # define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 # define TT_MS_LANGID_ARABIC_UAE 0x3801 # define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01 # define TT_MS_LANGID_ARABIC_QATAR 0x4001 # define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 # define TT_MS_LANGID_CATALAN_CATALAN 0x0403 # define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 # define TT_MS_LANGID_CHINESE_PRC 0x0804 # define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04 # define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 # define TT_MS_LANGID_CHINESE_MACAO 0x1404 # define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 # define TT_MS_LANGID_DANISH_DENMARK 0x0406 # define TT_MS_LANGID_GERMAN_GERMANY 0x0407 # define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 # define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07 # define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 # define TT_MS_LANGID_GERMAN_LIECHTENSTEIN 0x1407 # define TT_MS_LANGID_GREEK_GREECE 0x0408 # define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 # define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 # define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09 # define TT_MS_LANGID_ENGLISH_CANADA 0x1009 # define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 # define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 # define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09 # define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 # define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 # define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 # define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09 # define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 # define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 # define TT_MS_LANGID_ENGLISH_INDIA 0x4009 # define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 # define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 # define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A # define TT_MS_LANGID_SPANISH_MEXICO 0x080A # define TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT 0x0C0A # define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A # define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A # define TT_MS_LANGID_SPANISH_PANAMA 0x180A # define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A # define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A # define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A # define TT_MS_LANGID_SPANISH_PERU 0x280A # define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A # define TT_MS_LANGID_SPANISH_ECUADOR 0x300A # define TT_MS_LANGID_SPANISH_CHILE 0x340A # define TT_MS_LANGID_SPANISH_URUGUAY 0x380A # define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A # define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A # define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A # define TT_MS_LANGID_SPANISH_HONDURAS 0x480A # define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A # define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A # define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A # define TT_MS_LANGID_FINNISH_FINLAND 0x040B # define TT_MS_LANGID_FRENCH_FRANCE 0x040C # define TT_MS_LANGID_FRENCH_BELGIUM 0x080C # define TT_MS_LANGID_FRENCH_CANADA 0x0C0C # define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C # define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C # define TT_MS_LANGID_FRENCH_MONACO 0x180C # define TT_MS_LANGID_HEBREW_ISRAEL 0x040D # define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E # define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F # define TT_MS_LANGID_ITALIAN_ITALY 0x0410 # define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 # define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 # define TT_MS_LANGID_KOREAN_KOREA 0x0412 # define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413 # define TT_MS_LANGID_DUTCH_BELGIUM 0x0813 # define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414 # define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814 # define TT_MS_LANGID_POLISH_POLAND 0x0415 # define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416 # define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816 # define TT_MS_LANGID_ROMANSH_SWITZERLAND 0x0417 # define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418 # define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 # define TT_MS_LANGID_CROATIAN_CROATIA 0x041A # define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A # define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A # define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A # define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A # define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A # define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x1C1A # define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC 0x201A # define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B # define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C # define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D # define TT_MS_LANGID_SWEDISH_FINLAND 0x081D # define TT_MS_LANGID_THAI_THAILAND 0x041E # define TT_MS_LANGID_TURKISH_TURKEY 0x041F # define TT_MS_LANGID_URDU_PAKISTAN 0x0420 # define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 # define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422 # define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423 # define TT_MS_LANGID_SLOVENIAN_SLOVENIA 0x0424 # define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425 # define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 # define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 # define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 # define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A # define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B # define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C # define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C # define TT_MS_LANGID_BASQUE_BASQUE 0x042D # define TT_MS_LANGID_UPPER_SORBIAN_GERMANY 0x042E # define TT_MS_LANGID_LOWER_SORBIAN_GERMANY 0x082E # define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F # define TT_MS_LANGID_SETSWANA_SOUTH_AFRICA 0x0432 # define TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA 0x0434 # define TT_MS_LANGID_ISIZULU_SOUTH_AFRICA 0x0435 # define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436 # define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 # define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 # define TT_MS_LANGID_HINDI_INDIA 0x0439 # define TT_MS_LANGID_MALTESE_MALTA 0x043A # define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B # define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B # define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B # define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B # define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B # define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B # define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B # define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B # define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B # define TT_MS_LANGID_IRISH_IRELAND 0x083C # define TT_MS_LANGID_MALAY_MALAYSIA 0x043E # define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E # define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F # define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic */ 0x0440 # define TT_MS_LANGID_KISWAHILI_KENYA 0x0441 # define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 # define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443 # define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843 # define TT_MS_LANGID_TATAR_RUSSIA 0x0444 # define TT_MS_LANGID_BENGALI_INDIA 0x0445 # define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 # define TT_MS_LANGID_PUNJABI_INDIA 0x0446 # define TT_MS_LANGID_GUJARATI_INDIA 0x0447 # define TT_MS_LANGID_ODIA_INDIA 0x0448 # define TT_MS_LANGID_TAMIL_INDIA 0x0449 # define TT_MS_LANGID_TELUGU_INDIA 0x044A # define TT_MS_LANGID_KANNADA_INDIA 0x044B # define TT_MS_LANGID_MALAYALAM_INDIA 0x044C # define TT_MS_LANGID_ASSAMESE_INDIA 0x044D # define TT_MS_LANGID_MARATHI_INDIA 0x044E # define TT_MS_LANGID_SANSKRIT_INDIA 0x044F # define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 # define TT_MS_LANGID_MONGOLIAN_PRC 0x0850 # define TT_MS_LANGID_TIBETAN_PRC 0x0451 # define TT_MS_LANGID_WELSH_UNITED_KINGDOM 0x0452 # define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 # define TT_MS_LANGID_LAO_LAOS 0x0454 # define TT_MS_LANGID_GALICIAN_GALICIAN 0x0456 # define TT_MS_LANGID_KONKANI_INDIA 0x0457 # define TT_MS_LANGID_SYRIAC_SYRIA 0x045A # define TT_MS_LANGID_SINHALA_SRI_LANKA 0x045B # define TT_MS_LANGID_INUKTITUT_CANADA 0x045D # define TT_MS_LANGID_INUKTITUT_CANADA_LATIN 0x085D # define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E # define TT_MS_LANGID_TAMAZIGHT_ALGERIA 0x085F # define TT_MS_LANGID_NEPALI_NEPAL 0x0461 # define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 # define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 # define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464 # define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465 # define TT_MS_LANGID_HAUSA_NIGERIA 0x0468 # define TT_MS_LANGID_YORUBA_NIGERIA 0x046A # define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B # define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B # define TT_MS_LANGID_QUECHUA_PERU 0x0C6B # define TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA 0x046C # define TT_MS_LANGID_BASHKIR_RUSSIA 0x046D # define TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG 0x046E # define TT_MS_LANGID_GREENLANDIC_GREENLAND 0x046F # define TT_MS_LANGID_IGBO_NIGERIA 0x0470 # define TT_MS_LANGID_YI_PRC 0x0478 # define TT_MS_LANGID_MAPUDUNGUN_CHILE 0x047A # define TT_MS_LANGID_MOHAWK_MOHAWK 0x047C # define TT_MS_LANGID_BRETON_FRANCE 0x047E # define TT_MS_LANGID_UIGHUR_PRC 0x0480 # define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481 # define TT_MS_LANGID_OCCITAN_FRANCE 0x0482 # define TT_MS_LANGID_CORSICAN_FRANCE 0x0483 # define TT_MS_LANGID_ALSATIAN_FRANCE 0x0484 # define TT_MS_LANGID_YAKUT_RUSSIA 0x0485 # define TT_MS_LANGID_KICHE_GUATEMALA 0x0486 # define TT_MS_LANGID_KINYARWANDA_RWANDA 0x0487 # define TT_MS_LANGID_WOLOF_SENEGAL 0x0488 # define TT_MS_LANGID_DARI_AFGHANISTAN 0x048C Possible values of the language identifier field in the name records of the SFNT \u2018name\u2019 table if the \u2018platform\u2019 identifier code is TT_PLATFORM_MICROSOFT . These values are also used as return values for function FT_Get_CMap_Language_ID . The canonical source for Microsoft's IDs is https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings , however, we only provide macros for language identifiers present in the OpenType specification: Microsoft has abandoned the concept of LCIDs (language code identifiers), and format 1 of the \u2018name\u2019 table provides a better mechanism for languages not covered here. More legacy values not listed in the reference can be found in the FT_TRUETYPE_IDS_H header file.","title":"TT_MS_LANGID_XXX"},{"location":"ft2-truetype_tables.html#tt_name_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_NAME_ID_COPYRIGHT 0 # define TT_NAME_ID_FONT_FAMILY 1 # define TT_NAME_ID_FONT_SUBFAMILY 2 # define TT_NAME_ID_UNIQUE_ID 3 # define TT_NAME_ID_FULL_NAME 4 # define TT_NAME_ID_VERSION_STRING 5 # define TT_NAME_ID_PS_NAME 6 # define TT_NAME_ID_TRADEMARK 7 /* the following values are from the OpenType spec */ # define TT_NAME_ID_MANUFACTURER 8 # define TT_NAME_ID_DESIGNER 9 # define TT_NAME_ID_DESCRIPTION 10 # define TT_NAME_ID_VENDOR_URL 11 # define TT_NAME_ID_DESIGNER_URL 12 # define TT_NAME_ID_LICENSE 13 # define TT_NAME_ID_LICENSE_URL 14 /* number 15 is reserved */ # define TT_NAME_ID_TYPOGRAPHIC_FAMILY 16 # define TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY 17 # define TT_NAME_ID_MAC_FULL_NAME 18 /* The following code is new as of 2000-01-21 */ # define TT_NAME_ID_SAMPLE_TEXT 19 /* This is new in OpenType 1.3 */ # define TT_NAME_ID_CID_FINDFONT_NAME 20 /* This is new in OpenType 1.5 */ # define TT_NAME_ID_WWS_FAMILY 21 # define TT_NAME_ID_WWS_SUBFAMILY 22 /* This is new in OpenType 1.7 */ # define TT_NAME_ID_LIGHT_BACKGROUND 23 # define TT_NAME_ID_DARK_BACKGROUND 24 /* This is new in OpenType 1.8 */ # define TT_NAME_ID_VARIATIONS_PREFIX 25 /* these two values are deprecated */ # define TT_NAME_ID_PREFERRED_FAMILY TT_NAME_ID_TYPOGRAPHIC_FAMILY # define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY Possible values of the \u2018name\u2019 identifier field in the name records of an SFNT \u2018name\u2019 table. These values are platform independent.","title":"TT_NAME_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_ucr_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). /* ulUnicodeRange1 */ /* --------------- */ /* Bit 0 Basic Latin */ # define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ /* Bit 1 C1 Controls and Latin-1 Supplement */ # define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ /* Bit 2 Latin Extended-A */ # define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ /* Bit 3 Latin Extended-B */ # define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ /* Bit 4 IPA Extensions */ /* Phonetic Extensions */ /* Phonetic Extensions Supplement */ # define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ /* U+1D00-U+1D7F */ /* U+1D80-U+1DBF */ /* Bit 5 Spacing Modifier Letters */ /* Modifier Tone Letters */ # define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ /* U+A700-U+A71F */ /* Bit 6 Combining Diacritical Marks */ /* Combining Diacritical Marks Supplement */ # define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */ /* U+1DC0-U+1DFF */ /* Bit 7 Greek and Coptic */ # define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ /* Bit 8 Coptic */ # define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */ /* Bit 9 Cyrillic */ /* Cyrillic Supplement */ /* Cyrillic Extended-A */ /* Cyrillic Extended-B */ # define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ /* U+0500-U+052F */ /* U+2DE0-U+2DFF */ /* U+A640-U+A69F */ /* Bit 10 Armenian */ # define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ /* Bit 11 Hebrew */ # define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ /* Bit 12 Vai */ # define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */ /* Bit 13 Arabic */ /* Arabic Supplement */ # define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ /* U+0750-U+077F */ /* Bit 14 NKo */ # define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */ /* Bit 15 Devanagari */ # define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ /* Bit 16 Bengali */ # define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */ /* Bit 17 Gurmukhi */ # define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */ /* Bit 18 Gujarati */ # define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */ /* Bit 19 Oriya */ # define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */ /* Bit 20 Tamil */ # define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */ /* Bit 21 Telugu */ # define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */ /* Bit 22 Kannada */ # define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */ /* Bit 23 Malayalam */ # define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */ /* Bit 24 Thai */ # define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ /* Bit 25 Lao */ # define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ /* Bit 26 Georgian */ /* Georgian Supplement */ # define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ /* U+2D00-U+2D2F */ /* Bit 27 Balinese */ # define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */ /* Bit 28 Hangul Jamo */ # define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ /* Bit 29 Latin Extended Additional */ /* Latin Extended-C */ /* Latin Extended-D */ # define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ /* U+2C60-U+2C7F */ /* U+A720-U+A7FF */ /* Bit 30 Greek Extended */ # define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ /* Bit 31 General Punctuation */ /* Supplemental Punctuation */ # define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ /* U+2E00-U+2E7F */ /* ulUnicodeRange2 */ /* --------------- */ /* Bit 32 Superscripts And Subscripts */ # define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ /* Bit 33 Currency Symbols */ # define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ /* Bit 34 Combining Diacritical Marks For Symbols */ # define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\ (1L << 2) /* U+20D0-U+20FF */ /* Bit 35 Letterlike Symbols */ # define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ /* Bit 36 Number Forms */ # define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ /* Bit 37 Arrows */ /* Supplemental Arrows-A */ /* Supplemental Arrows-B */ /* Miscellaneous Symbols and Arrows */ # define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ /* U+27F0-U+27FF */ /* U+2900-U+297F */ /* U+2B00-U+2BFF */ /* Bit 38 Mathematical Operators */ /* Supplemental Mathematical Operators */ /* Miscellaneous Mathematical Symbols-A */ /* Miscellaneous Mathematical Symbols-B */ # define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ /* U+2A00-U+2AFF */ /* U+27C0-U+27EF */ /* U+2980-U+29FF */ /* Bit 39 Miscellaneous Technical */ # define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ /* Bit 40 Control Pictures */ # define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */ /* Bit 41 Optical Character Recognition */ # define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */ /* Bit 42 Enclosed Alphanumerics */ # define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */ /* Bit 43 Box Drawing */ # define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */ /* Bit 44 Block Elements */ # define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */ /* Bit 45 Geometric Shapes */ # define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */ /* Bit 46 Miscellaneous Symbols */ # define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ /* Bit 47 Dingbats */ # define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ /* Bit 48 CJK Symbols and Punctuation */ # define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ /* Bit 49 Hiragana */ # define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ /* Bit 50 Katakana */ /* Katakana Phonetic Extensions */ # define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ /* U+31F0-U+31FF */ /* Bit 51 Bopomofo */ /* Bopomofo Extended */ # define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ /* U+31A0-U+31BF */ /* Bit 52 Hangul Compatibility Jamo */ # define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ /* Bit 53 Phags-Pa */ # define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */ # define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */ # define TT_UCR_PHAGSPA /* Bit 54 Enclosed CJK Letters and Months */ # define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ /* Bit 55 CJK Compatibility */ # define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ /* Bit 56 Hangul Syllables */ # define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ /* Bit 57 High Surrogates */ /* High Private Use Surrogates */ /* Low Surrogates */ /* According to OpenType specs v.1.3+, */ /* setting bit 57 implies that there is */ /* at least one codepoint beyond the */ /* Basic Multilingual Plane that is */ /* supported by this font. So it really */ /* means >= U+10000. */ # define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ /* U+DB80-U+DBFF */ /* U+DC00-U+DFFF */ # define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES /* Bit 58 Phoenician */ # define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/ /* Bit 59 CJK Unified Ideographs */ /* CJK Radicals Supplement */ /* Kangxi Radicals */ /* Ideographic Description Characters */ /* CJK Unified Ideographs Extension A */ /* CJK Unified Ideographs Extension B */ /* Kanbun */ # define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ /* U+2E80-U+2EFF */ /* U+2F00-U+2FDF */ /* U+2FF0-U+2FFF */ /* U+3400-U+4DB5 */ /*U+20000-U+2A6DF*/ /* U+3190-U+319F */ /* Bit 60 Private Use */ # define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ /* Bit 61 CJK Strokes */ /* CJK Compatibility Ideographs */ /* CJK Compatibility Ideographs Supplement */ # define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */ /* U+F900-U+FAFF */ /*U+2F800-U+2FA1F*/ /* Bit 62 Alphabetic Presentation Forms */ # define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ /* Bit 63 Arabic Presentation Forms-A */ # define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */ /* ulUnicodeRange3 */ /* --------------- */ /* Bit 64 Combining Half Marks */ # define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ /* Bit 65 Vertical forms */ /* CJK Compatibility Forms */ # define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */ /* U+FE30-U+FE4F */ /* Bit 66 Small Form Variants */ # define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ /* Bit 67 Arabic Presentation Forms-B */ # define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */ /* Bit 68 Halfwidth and Fullwidth Forms */ # define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ /* Bit 69 Specials */ # define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ /* Bit 70 Tibetan */ # define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ /* Bit 71 Syriac */ # define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ /* Bit 72 Thaana */ # define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */ /* Bit 73 Sinhala */ # define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ /* Bit 74 Myanmar */ # define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ /* Bit 75 Ethiopic */ /* Ethiopic Supplement */ /* Ethiopic Extended */ # define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ /* U+1380-U+139F */ /* U+2D80-U+2DDF */ /* Bit 76 Cherokee */ # define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ /* Bit 77 Unified Canadian Aboriginal Syllabics */ # define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ /* Bit 78 Ogham */ # define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ /* Bit 79 Runic */ # define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ /* Bit 80 Khmer */ /* Khmer Symbols */ # define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ /* U+19E0-U+19FF */ /* Bit 81 Mongolian */ # define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ /* Bit 82 Braille Patterns */ # define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ /* Bit 83 Yi Syllables */ /* Yi Radicals */ # define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ /* U+A490-U+A4CF */ /* Bit 84 Tagalog */ /* Hanunoo */ /* Buhid */ /* Tagbanwa */ # define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ /* U+1720-U+173F */ /* U+1740-U+175F */ /* U+1760-U+177F */ /* Bit 85 Old Italic */ # define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ /* Bit 86 Gothic */ # define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ /* Bit 87 Deseret */ # define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ /* Bit 88 Byzantine Musical Symbols */ /* Musical Symbols */ /* Ancient Greek Musical Notation */ # define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ /*U+1D100-U+1D1FF*/ /*U+1D200-U+1D24F*/ /* Bit 89 Mathematical Alphanumeric Symbols */ # define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ /* Bit 90 Private Use (plane 15) */ /* Private Use (plane 16) */ # define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ /*U+100000-U+10FFFD*/ /* Bit 91 Variation Selectors */ /* Variation Selectors Supplement */ # define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ /*U+E0100-U+E01EF*/ /* Bit 92 Tags */ # define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ /* Bit 93 Limbu */ # define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */ /* Bit 94 Tai Le */ # define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */ /* Bit 95 New Tai Lue */ # define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */ /* ulUnicodeRange4 */ /* --------------- */ /* Bit 96 Buginese */ # define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */ /* Bit 97 Glagolitic */ # define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */ /* Bit 98 Tifinagh */ # define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */ /* Bit 99 Yijing Hexagram Symbols */ # define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */ /* Bit 100 Syloti Nagri */ # define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */ /* Bit 101 Linear B Syllabary */ /* Linear B Ideograms */ /* Aegean Numbers */ # define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/ /*U+10080-U+100FF*/ /*U+10100-U+1013F*/ /* Bit 102 Ancient Greek Numbers */ # define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/ /* Bit 103 Ugaritic */ # define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/ /* Bit 104 Old Persian */ # define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/ /* Bit 105 Shavian */ # define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/ /* Bit 106 Osmanya */ # define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/ /* Bit 107 Cypriot Syllabary */ # define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/ /* Bit 108 Kharoshthi */ # define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/ /* Bit 109 Tai Xuan Jing Symbols */ # define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/ /* Bit 110 Cuneiform */ /* Cuneiform Numbers and Punctuation */ # define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/ /*U+12400-U+1247F*/ /* Bit 111 Counting Rod Numerals */ # define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/ /* Bit 112 Sundanese */ # define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */ /* Bit 113 Lepcha */ # define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */ /* Bit 114 Ol Chiki */ # define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */ /* Bit 115 Saurashtra */ # define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */ /* Bit 116 Kayah Li */ # define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */ /* Bit 117 Rejang */ # define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */ /* Bit 118 Cham */ # define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */ /* Bit 119 Ancient Symbols */ # define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/ /* Bit 120 Phaistos Disc */ # define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/ /* Bit 121 Carian */ /* Lycian */ /* Lydian */ # define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/ /*U+10280-U+1029F*/ /*U+10920-U+1093F*/ /* Bit 122 Domino Tiles */ /* Mahjong Tiles */ # define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/ /*U+1F000-U+1F02F*/ /* Bit 123-127 Reserved for process-internal usage */ Possible bit mask values for the ulUnicodeRangeX fields in an SFNT \u2018OS/2\u2019 table.","title":"TT_UCR_XXX"},{"location":"ft2-tt_driver.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The TrueType driver The TrueType driver \u00b6 Synopsis \u00b6 While FreeType's TrueType driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The following lists the available properties together with the necessary macros and structures. The TrueType driver's module name is \u2018truetype\u2019. A single property interpreter-version is available, as documented in the \u2018 Driver properties \u2019 section. We start with a list of definitions, kindly provided by Greg Hitchcock. Bi-Level Rendering Monochromatic rendering, exclusively used in the early days of TrueType by both Apple and Microsoft. Microsoft's GDI interface supported hinting of the right-side bearing point, such that the advance width could be non-linear. Most often this was done to achieve some level of glyph symmetry. To enable reasonable performance (e.g., not having to run hinting on all glyphs just to get the widths) there was a bit in the head table indicating if the side bearing was hinted, and additional tables, \u2018hdmx\u2019 and \u2018LTSH\u2019, to cache hinting widths across multiple sizes and device aspect ratios. Font Smoothing Microsoft's GDI implementation of anti-aliasing. Not traditional anti-aliasing as the outlines were hinted before the sampling. The widths matched the bi-level rendering. ClearType Rendering Technique that uses physical subpixels to improve rendering on LCD (and other) displays. Because of the higher resolution, many methods of improving symmetry in glyphs through hinting the right-side bearing were no longer necessary. This lead to what GDI calls \u2018natural widths\u2019 ClearType, see http://rastertragedy.com/RTRCh4.htm#Sec21 . Since hinting has extra resolution, most non-linearity went away, but it is still possible for hints to change the advance widths in this mode. ClearType Compatible Widths One of the earliest challenges with ClearType was allowing the implementation in GDI to be selected without requiring all UI and documents to reflow. To address this, a compatible method of rendering ClearType was added where the font hints are executed once to determine the width in bi-level rendering, and then re-run in ClearType, with the difference in widths being absorbed in the font hints for ClearType (mostly in the white space of hints); see http://rastertragedy.com/RTRCh4.htm#Sec20 . Somewhat by definition, compatible width ClearType allows for non-linear widths, but only when the bi-level version has non-linear widths. ClearType Subpixel Positioning One of the nice benefits of ClearType is the ability to more crisply display fractional widths; unfortunately, the GDI model of integer bitmaps did not support this. However, the WPF and Direct Write frameworks do support fractional widths. DWrite calls this \u2018natural mode\u2019, not to be confused with GDI's \u2018natural widths\u2019. Subpixel positioning, in the current implementation of Direct Write, unfortunately does not support hinted advance widths, see http://rastertragedy.com/RTRCh4.htm#Sec22 . Note that the TrueType interpreter fully allows the advance width to be adjusted in this mode, just the DWrite client will ignore those changes. ClearType Backward Compatibility This is a set of exceptions made in the TrueType interpreter to minimize hinting techniques that were problematic with the extra resolution of ClearType; see http://rastertragedy.com/RTRCh4.htm#Sec1 and https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx . This technique is not to be confused with ClearType compatible widths. ClearType backward compatibility has no direct impact on changing advance widths, but there might be an indirect impact on disabling some deltas. This could be worked around in backward compatibility mode. Native ClearType Mode (Not to be confused with \u2018natural widths\u2019.) This mode removes all the exceptions in the TrueType interpreter when running with ClearType. Any issues on widths would still apply, though.","title":"The TrueType driver"},{"location":"ft2-tt_driver.html#the-truetype-driver","text":"","title":"The TrueType driver"},{"location":"ft2-tt_driver.html#synopsis","text":"While FreeType's TrueType driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The following lists the available properties together with the necessary macros and structures. The TrueType driver's module name is \u2018truetype\u2019. A single property interpreter-version is available, as documented in the \u2018 Driver properties \u2019 section. We start with a list of definitions, kindly provided by Greg Hitchcock. Bi-Level Rendering Monochromatic rendering, exclusively used in the early days of TrueType by both Apple and Microsoft. Microsoft's GDI interface supported hinting of the right-side bearing point, such that the advance width could be non-linear. Most often this was done to achieve some level of glyph symmetry. To enable reasonable performance (e.g., not having to run hinting on all glyphs just to get the widths) there was a bit in the head table indicating if the side bearing was hinted, and additional tables, \u2018hdmx\u2019 and \u2018LTSH\u2019, to cache hinting widths across multiple sizes and device aspect ratios. Font Smoothing Microsoft's GDI implementation of anti-aliasing. Not traditional anti-aliasing as the outlines were hinted before the sampling. The widths matched the bi-level rendering. ClearType Rendering Technique that uses physical subpixels to improve rendering on LCD (and other) displays. Because of the higher resolution, many methods of improving symmetry in glyphs through hinting the right-side bearing were no longer necessary. This lead to what GDI calls \u2018natural widths\u2019 ClearType, see http://rastertragedy.com/RTRCh4.htm#Sec21 . Since hinting has extra resolution, most non-linearity went away, but it is still possible for hints to change the advance widths in this mode. ClearType Compatible Widths One of the earliest challenges with ClearType was allowing the implementation in GDI to be selected without requiring all UI and documents to reflow. To address this, a compatible method of rendering ClearType was added where the font hints are executed once to determine the width in bi-level rendering, and then re-run in ClearType, with the difference in widths being absorbed in the font hints for ClearType (mostly in the white space of hints); see http://rastertragedy.com/RTRCh4.htm#Sec20 . Somewhat by definition, compatible width ClearType allows for non-linear widths, but only when the bi-level version has non-linear widths. ClearType Subpixel Positioning One of the nice benefits of ClearType is the ability to more crisply display fractional widths; unfortunately, the GDI model of integer bitmaps did not support this. However, the WPF and Direct Write frameworks do support fractional widths. DWrite calls this \u2018natural mode\u2019, not to be confused with GDI's \u2018natural widths\u2019. Subpixel positioning, in the current implementation of Direct Write, unfortunately does not support hinted advance widths, see http://rastertragedy.com/RTRCh4.htm#Sec22 . Note that the TrueType interpreter fully allows the advance width to be adjusted in this mode, just the DWrite client will ignore those changes. ClearType Backward Compatibility This is a set of exceptions made in the TrueType interpreter to minimize hinting techniques that were problematic with the extra resolution of ClearType; see http://rastertragedy.com/RTRCh4.htm#Sec1 and https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx . This technique is not to be confused with ClearType compatible widths. ClearType backward compatibility has no direct impact on changing advance widths, but there might be an indirect impact on disabling some deltas. This could be worked around in backward compatibility mode. Native ClearType Mode (Not to be confused with \u2018natural widths\u2019.) This mode removes all the exceptions in the TrueType interpreter when running with ClearType. Any issues on widths would still apply, though.","title":"Synopsis"},{"location":"ft2-type1_tables.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Type 1 Tables Type 1 Tables \u00b6 Synopsis \u00b6 This section contains the definition of Type 1-specific tables, including structures related to other PostScript font formats. PS_FontInfoRec \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_FontInfoRec_ { FT_String * version; FT_String * notice; FT_String * full_name; FT_String * family_name; FT_String * weight; FT_Long italic_angle; FT_Bool is_fixed_pitch; FT_Short underline_position; FT_UShort underline_thickness; } PS_FontInfoRec ; A structure used to model a Type 1 or Type 2 FontInfo dictionary. Note that for Multiple Master fonts, each instance has its own FontInfo dictionary. PS_FontInfo \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_FontInfoRec_* PS_FontInfo ; A handle to a PS_FontInfoRec structure. PS_PrivateRec \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_PrivateRec_ { FT_Int unique_id; FT_Int lenIV; FT_Byte num_blue_values; FT_Byte num_other_blues; FT_Byte num_family_blues; FT_Byte num_family_other_blues; FT_Short blue_values[14]; FT_Short other_blues[10]; FT_Short family_blues [14]; FT_Short family_other_blues[10]; FT_Fixed blue_scale; FT_Int blue_shift; FT_Int blue_fuzz; FT_UShort standard_width[1]; FT_UShort standard_height[1]; FT_Byte num_snap_widths; FT_Byte num_snap_heights; FT_Bool force_bold; FT_Bool round_stem_up; FT_Short snap_widths [13]; /* including std width */ FT_Short snap_heights[13]; /* including std height */ FT_Fixed expansion_factor; FT_Long language_group; FT_Long password; FT_Short min_feature[2]; } PS_PrivateRec ; A structure used to model a Type 1 or Type 2 private dictionary. Note that for Multiple Master fonts, each instance has its own Private dictionary. PS_Private \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_PrivateRec_* PS_Private ; A handle to a PS_PrivateRec structure. CID_FaceDictRec \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceDictRec_ { PS_PrivateRec private_dict; FT_UInt len_buildchar; FT_Fixed forcebold_threshold; FT_Pos stroke_width; FT_Fixed expansion_factor; /* this is a duplicate of */ /* `private_dict->expansion_factor' */ FT_Byte paint_type; FT_Byte font_type; FT_Matrix font_matrix; FT_Vector font_offset; FT_UInt num_subrs; FT_ULong subrmap_offset; FT_UInt sd_bytes; } CID_FaceDictRec ; A structure used to represent data in a CID top-level dictionary. In most cases, they are part of the font's \u2018/FDArray\u2019 array. Within a CID font file, such (internal) subfont dictionaries are enclosed by \u2018%ADOBeginFontDict\u2019 and \u2018%ADOEndFontDict\u2019 comments. Note that CID_FaceDictRec misses a field for the \u2018/FontName\u2019 keyword, specifying the subfont's name (the top-level font name is given by the \u2018/CIDFontName\u2019 keyword). This is an oversight, but it doesn't limit the \u2018cid\u2019 font module's functionality because FreeType neither needs this entry nor gives access to CID subfonts. CID_FaceDict \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceDictRec_* CID_FaceDict ; A handle to a CID_FaceDictRec structure. CID_FaceInfoRec \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceInfoRec_ { FT_String * cid_font_name; FT_Fixed cid_version; FT_Int cid_font_type; FT_String * registry; FT_String * ordering; FT_Int supplement; PS_FontInfoRec font_info; FT_BBox font_bbox; FT_ULong uid_base; FT_Int num_xuid; FT_ULong xuid[16]; FT_ULong cidmap_offset; FT_UInt fd_bytes; FT_UInt gd_bytes; FT_ULong cid_count; FT_UInt num_dicts; CID_FaceDict font_dicts; FT_ULong data_offset; } CID_FaceInfoRec ; A structure used to represent CID Face information. CID_FaceInfo \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceInfoRec_* CID_FaceInfo ; A handle to a CID_FaceInfoRec structure. FT_Has_PS_Glyph_Names \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Int ) FT_Has_PS_Glyph_Names ( FT_Face face ); Return true if a given face provides reliable PostScript glyph names. This is similar to using the FT_HAS_GLYPH_NAMES macro, except that certain fonts (mostly TrueType) contain incorrect glyph name tables. When this function returns true, the caller is sure that the glyph names returned by FT_Get_Glyph_Name are reliable. input face face handle return Boolean. True if glyph names are reliable. FT_Get_PS_Font_Info \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Error ) FT_Get_PS_Font_Info ( FT_Face face, PS_FontInfo afont_info ); Retrieve the PS_FontInfoRec structure corresponding to a given PostScript font. input face PostScript face handle. output afont_info Output font info structure pointer. return FreeType error code. 0 means success. note String pointers within the PS_FontInfoRec structure are owned by the face and don't need to be freed by the caller. Missing entries in the font's FontInfo dictionary are represented by NULL pointers. If the font's format is not PostScript-based, this function will return the FT_Err_Invalid_Argument error code. FT_Get_PS_Font_Private \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Error ) FT_Get_PS_Font_Private ( FT_Face face, PS_Private afont_private ); Retrieve the PS_PrivateRec structure corresponding to a given PostScript font. input face PostScript face handle. output afont_private Output private dictionary structure pointer. return FreeType error code. 0 means success. note The string pointers within the PS_PrivateRec structure are owned by the face and don't need to be freed by the caller. If the font's format is not PostScript-based, this function returns the FT_Err_Invalid_Argument error code. FT_Get_PS_Font_Value \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Long ) FT_Get_PS_Font_Value ( FT_Face face, PS_Dict_Keys key, FT_UInt idx, void *value, FT_Long value_len ); Retrieve the value for the supplied key from a PostScript font. input face PostScript face handle. key An enumeration value representing the dictionary key to retrieve. idx For array values, this specifies the index to be returned. value A pointer to memory into which to write the value. valen_len The size, in bytes, of the memory supplied for the value. output value The value matching the above key, if it exists. return The amount of memory (in bytes) required to hold the requested value (if it exists, -1 otherwise). note The values returned are not pointers into the internal structures of the face, but are \u2018fresh\u2019 copies, so that the memory containing them belongs to the calling application. This also enforces the \u2018read-only\u2019 nature of these values, i.e., this function cannot be used to manipulate the face. value is a void pointer because the values returned can be of various types. If either value is NULL or value_len is too small, just the required memory size for the requested entry is returned. The idx parameter is used, not only to retrieve elements of, for example, the FontMatrix or FontBBox, but also to retrieve name keys from the CharStrings dictionary, and the charstrings themselves. It is ignored for atomic values. PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To get the value as in the font stream, you need to divide by 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale). IMPORTANT: Only key/value pairs read by the FreeType interpreter can be retrieved. So, for example, PostScript procedures such as NP, ND, and RD are not available. Arbitrary keys are, obviously, not be available either. If the font's format is not PostScript-based, this function returns the FT_Err_Invalid_Argument error code. since 2.4.8 T1_Blend_Flags \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum T1_Blend_Flags_ { /* required fields in a FontInfo blend dictionary */ T1_BLEND_UNDERLINE_POSITION = 0, T1_BLEND_UNDERLINE_THICKNESS , T1_BLEND_ITALIC_ANGLE , /* required fields in a Private blend dictionary */ T1_BLEND_BLUE_VALUES , T1_BLEND_OTHER_BLUES , T1_BLEND_STANDARD_WIDTH , T1_BLEND_STANDARD_HEIGHT , T1_BLEND_STEM_SNAP_WIDTHS , T1_BLEND_STEM_SNAP_HEIGHTS , T1_BLEND_BLUE_SCALE , T1_BLEND_BLUE_SHIFT , T1_BLEND_FAMILY_BLUES , T1_BLEND_FAMILY_OTHER_BLUES , T1_BLEND_FORCE_BOLD , T1_BLEND_MAX /* do not remove */ } T1_Blend_Flags ; /* these constants are deprecated; use the corresponding */ /* ` T1_Blend_Flags ` values instead */ # define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION # define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS # define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE # define t1_blend_blue_values T1_BLEND_BLUE_VALUES # define t1_blend_other_blues T1_BLEND_OTHER_BLUES # define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH # define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT # define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS # define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS # define t1_blend_blue_scale T1_BLEND_BLUE_SCALE # define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT # define t1_blend_family_blues T1_BLEND_FAMILY_BLUES # define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES # define t1_blend_force_bold T1_BLEND_FORCE_BOLD # define t1_blend_max T1_BLEND_MAX A set of flags used to indicate which fields are present in a given blend dictionary (font info or private). Used to support Multiple Masters fonts. values T1_BLEND_UNDERLINE_POSITION T1_BLEND_UNDERLINE_THICKNESS T1_BLEND_ITALIC_ANGLE T1_BLEND_BLUE_VALUES T1_BLEND_OTHER_BLUES T1_BLEND_STANDARD_WIDTH T1_BLEND_STANDARD_HEIGHT T1_BLEND_STEM_SNAP_WIDTHS T1_BLEND_STEM_SNAP_HEIGHTS T1_BLEND_BLUE_SCALE T1_BLEND_BLUE_SHIFT T1_BLEND_FAMILY_BLUES T1_BLEND_FAMILY_OTHER_BLUES T1_BLEND_FORCE_BOLD T1_EncodingType \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum T1_EncodingType_ { T1_ENCODING_TYPE_NONE = 0, T1_ENCODING_TYPE_ARRAY , T1_ENCODING_TYPE_STANDARD , T1_ENCODING_TYPE_ISOLATIN1 , T1_ENCODING_TYPE_EXPERT } T1_EncodingType ; An enumeration describing the \u2018Encoding\u2019 entry in a Type 1 dictionary. values T1_ENCODING_TYPE_NONE T1_ENCODING_TYPE_ARRAY T1_ENCODING_TYPE_STANDARD T1_ENCODING_TYPE_ISOLATIN1 T1_ENCODING_TYPE_EXPERT since 2.4.8 PS_Dict_Keys \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum PS_Dict_Keys_ { /* conventionally in the font dictionary */ PS_DICT_FONT_TYPE , /* FT_Byte */ PS_DICT_FONT_MATRIX , /* FT_Fixed */ PS_DICT_FONT_BBOX , /* FT_Fixed */ PS_DICT_PAINT_TYPE , /* FT_Byte */ PS_DICT_FONT_NAME , /* FT_String * */ PS_DICT_UNIQUE_ID , /* FT_Int */ PS_DICT_NUM_CHAR_STRINGS , /* FT_Int */ PS_DICT_CHAR_STRING_KEY , /* FT_String * */ PS_DICT_CHAR_STRING , /* FT_String * */ PS_DICT_ENCODING_TYPE , /* T1_EncodingType */ PS_DICT_ENCODING_ENTRY , /* FT_String * */ /* conventionally in the font Private dictionary */ PS_DICT_NUM_SUBRS , /* FT_Int */ PS_DICT_SUBR , /* FT_String * */ PS_DICT_STD_HW , /* FT_UShort */ PS_DICT_STD_VW , /* FT_UShort */ PS_DICT_NUM_BLUE_VALUES , /* FT_Byte */ PS_DICT_BLUE_VALUE , /* FT_Short */ PS_DICT_BLUE_FUZZ , /* FT_Int */ PS_DICT_NUM_OTHER_BLUES , /* FT_Byte */ PS_DICT_OTHER_BLUE , /* FT_Short */ PS_DICT_NUM_FAMILY_BLUES , /* FT_Byte */ PS_DICT_FAMILY_BLUE , /* FT_Short */ PS_DICT_NUM_FAMILY_OTHER_BLUES , /* FT_Byte */ PS_DICT_FAMILY_OTHER_BLUE , /* FT_Short */ PS_DICT_BLUE_SCALE , /* FT_Fixed */ PS_DICT_BLUE_SHIFT , /* FT_Int */ PS_DICT_NUM_STEM_SNAP_H , /* FT_Byte */ PS_DICT_STEM_SNAP_H , /* FT_Short */ PS_DICT_NUM_STEM_SNAP_V , /* FT_Byte */ PS_DICT_STEM_SNAP_V , /* FT_Short */ PS_DICT_FORCE_BOLD , /* FT_Bool */ PS_DICT_RND_STEM_UP , /* FT_Bool */ PS_DICT_MIN_FEATURE , /* FT_Short */ PS_DICT_LEN_IV , /* FT_Int */ PS_DICT_PASSWORD , /* FT_Long */ PS_DICT_LANGUAGE_GROUP , /* FT_Long */ /* conventionally in the font FontInfo dictionary */ PS_DICT_VERSION , /* FT_String * */ PS_DICT_NOTICE , /* FT_String * */ PS_DICT_FULL_NAME , /* FT_String * */ PS_DICT_FAMILY_NAME , /* FT_String * */ PS_DICT_WEIGHT , /* FT_String * */ PS_DICT_IS_FIXED_PITCH , /* FT_Bool */ PS_DICT_UNDERLINE_POSITION , /* FT_Short */ PS_DICT_UNDERLINE_THICKNESS , /* FT_UShort */ PS_DICT_FS_TYPE , /* FT_UShort */ PS_DICT_ITALIC_ANGLE , /* FT_Long */ PS_DICT_MAX = PS_DICT_ITALIC_ANGLE } PS_Dict_Keys ; An enumeration used in calls to FT_Get_PS_Font_Value to identify the Type 1 dictionary entry to retrieve. values PS_DICT_FONT_TYPE PS_DICT_FONT_MATRIX PS_DICT_FONT_BBOX PS_DICT_PAINT_TYPE PS_DICT_FONT_NAME PS_DICT_UNIQUE_ID PS_DICT_NUM_CHAR_STRINGS PS_DICT_CHAR_STRING_KEY PS_DICT_CHAR_STRING PS_DICT_ENCODING_TYPE PS_DICT_ENCODING_ENTRY PS_DICT_NUM_SUBRS PS_DICT_SUBR PS_DICT_STD_HW PS_DICT_STD_VW PS_DICT_NUM_BLUE_VALUES PS_DICT_BLUE_VALUE PS_DICT_BLUE_FUZZ PS_DICT_NUM_OTHER_BLUES PS_DICT_OTHER_BLUE PS_DICT_NUM_FAMILY_BLUES PS_DICT_FAMILY_BLUE PS_DICT_NUM_FAMILY_OTHER_BLUES PS_DICT_FAMILY_OTHER_BLUE PS_DICT_BLUE_SCALE PS_DICT_BLUE_SHIFT PS_DICT_NUM_STEM_SNAP_H PS_DICT_STEM_SNAP_H PS_DICT_NUM_STEM_SNAP_V PS_DICT_STEM_SNAP_V PS_DICT_FORCE_BOLD PS_DICT_RND_STEM_UP PS_DICT_MIN_FEATURE PS_DICT_LEN_IV PS_DICT_PASSWORD PS_DICT_LANGUAGE_GROUP PS_DICT_VERSION PS_DICT_NOTICE PS_DICT_FULL_NAME PS_DICT_FAMILY_NAME PS_DICT_WEIGHT PS_DICT_IS_FIXED_PITCH PS_DICT_UNDERLINE_POSITION PS_DICT_UNDERLINE_THICKNESS PS_DICT_FS_TYPE PS_DICT_ITALIC_ANGLE since 2.4.8 T1_FontInfo \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef PS_FontInfoRec T1_FontInfo ; This type is equivalent to PS_FontInfoRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType. T1_Private \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef PS_PrivateRec T1_Private ; This type is equivalent to PS_PrivateRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType. CID_FontDict \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef CID_FaceDictRec CID_FontDict ; This type is equivalent to CID_FaceDictRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType. CID_Info \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef CID_FaceInfoRec CID_Info ; This type is equivalent to CID_FaceInfoRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"Type 1 Tables"},{"location":"ft2-type1_tables.html#type-1-tables","text":"","title":"Type 1 Tables"},{"location":"ft2-type1_tables.html#synopsis","text":"This section contains the definition of Type 1-specific tables, including structures related to other PostScript font formats.","title":"Synopsis"},{"location":"ft2-type1_tables.html#ps_fontinforec","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_FontInfoRec_ { FT_String * version; FT_String * notice; FT_String * full_name; FT_String * family_name; FT_String * weight; FT_Long italic_angle; FT_Bool is_fixed_pitch; FT_Short underline_position; FT_UShort underline_thickness; } PS_FontInfoRec ; A structure used to model a Type 1 or Type 2 FontInfo dictionary. Note that for Multiple Master fonts, each instance has its own FontInfo dictionary.","title":"PS_FontInfoRec"},{"location":"ft2-type1_tables.html#ps_fontinfo","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_FontInfoRec_* PS_FontInfo ; A handle to a PS_FontInfoRec structure.","title":"PS_FontInfo"},{"location":"ft2-type1_tables.html#ps_privaterec","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_PrivateRec_ { FT_Int unique_id; FT_Int lenIV; FT_Byte num_blue_values; FT_Byte num_other_blues; FT_Byte num_family_blues; FT_Byte num_family_other_blues; FT_Short blue_values[14]; FT_Short other_blues[10]; FT_Short family_blues [14]; FT_Short family_other_blues[10]; FT_Fixed blue_scale; FT_Int blue_shift; FT_Int blue_fuzz; FT_UShort standard_width[1]; FT_UShort standard_height[1]; FT_Byte num_snap_widths; FT_Byte num_snap_heights; FT_Bool force_bold; FT_Bool round_stem_up; FT_Short snap_widths [13]; /* including std width */ FT_Short snap_heights[13]; /* including std height */ FT_Fixed expansion_factor; FT_Long language_group; FT_Long password; FT_Short min_feature[2]; } PS_PrivateRec ; A structure used to model a Type 1 or Type 2 private dictionary. Note that for Multiple Master fonts, each instance has its own Private dictionary.","title":"PS_PrivateRec"},{"location":"ft2-type1_tables.html#ps_private","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_PrivateRec_* PS_Private ; A handle to a PS_PrivateRec structure.","title":"PS_Private"},{"location":"ft2-type1_tables.html#cid_facedictrec","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceDictRec_ { PS_PrivateRec private_dict; FT_UInt len_buildchar; FT_Fixed forcebold_threshold; FT_Pos stroke_width; FT_Fixed expansion_factor; /* this is a duplicate of */ /* `private_dict->expansion_factor' */ FT_Byte paint_type; FT_Byte font_type; FT_Matrix font_matrix; FT_Vector font_offset; FT_UInt num_subrs; FT_ULong subrmap_offset; FT_UInt sd_bytes; } CID_FaceDictRec ; A structure used to represent data in a CID top-level dictionary. In most cases, they are part of the font's \u2018/FDArray\u2019 array. Within a CID font file, such (internal) subfont dictionaries are enclosed by \u2018%ADOBeginFontDict\u2019 and \u2018%ADOEndFontDict\u2019 comments. Note that CID_FaceDictRec misses a field for the \u2018/FontName\u2019 keyword, specifying the subfont's name (the top-level font name is given by the \u2018/CIDFontName\u2019 keyword). This is an oversight, but it doesn't limit the \u2018cid\u2019 font module's functionality because FreeType neither needs this entry nor gives access to CID subfonts.","title":"CID_FaceDictRec"},{"location":"ft2-type1_tables.html#cid_facedict","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceDictRec_* CID_FaceDict ; A handle to a CID_FaceDictRec structure.","title":"CID_FaceDict"},{"location":"ft2-type1_tables.html#cid_faceinforec","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceInfoRec_ { FT_String * cid_font_name; FT_Fixed cid_version; FT_Int cid_font_type; FT_String * registry; FT_String * ordering; FT_Int supplement; PS_FontInfoRec font_info; FT_BBox font_bbox; FT_ULong uid_base; FT_Int num_xuid; FT_ULong xuid[16]; FT_ULong cidmap_offset; FT_UInt fd_bytes; FT_UInt gd_bytes; FT_ULong cid_count; FT_UInt num_dicts; CID_FaceDict font_dicts; FT_ULong data_offset; } CID_FaceInfoRec ; A structure used to represent CID Face information.","title":"CID_FaceInfoRec"},{"location":"ft2-type1_tables.html#cid_faceinfo","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceInfoRec_* CID_FaceInfo ; A handle to a CID_FaceInfoRec structure.","title":"CID_FaceInfo"},{"location":"ft2-type1_tables.html#ft_has_ps_glyph_names","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Int ) FT_Has_PS_Glyph_Names ( FT_Face face ); Return true if a given face provides reliable PostScript glyph names. This is similar to using the FT_HAS_GLYPH_NAMES macro, except that certain fonts (mostly TrueType) contain incorrect glyph name tables. When this function returns true, the caller is sure that the glyph names returned by FT_Get_Glyph_Name are reliable.","title":"FT_Has_PS_Glyph_Names"},{"location":"ft2-type1_tables.html#ft_get_ps_font_info","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Error ) FT_Get_PS_Font_Info ( FT_Face face, PS_FontInfo afont_info ); Retrieve the PS_FontInfoRec structure corresponding to a given PostScript font.","title":"FT_Get_PS_Font_Info"},{"location":"ft2-type1_tables.html#ft_get_ps_font_private","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Error ) FT_Get_PS_Font_Private ( FT_Face face, PS_Private afont_private ); Retrieve the PS_PrivateRec structure corresponding to a given PostScript font.","title":"FT_Get_PS_Font_Private"},{"location":"ft2-type1_tables.html#ft_get_ps_font_value","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Long ) FT_Get_PS_Font_Value ( FT_Face face, PS_Dict_Keys key, FT_UInt idx, void *value, FT_Long value_len ); Retrieve the value for the supplied key from a PostScript font.","title":"FT_Get_PS_Font_Value"},{"location":"ft2-type1_tables.html#t1_blend_flags","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum T1_Blend_Flags_ { /* required fields in a FontInfo blend dictionary */ T1_BLEND_UNDERLINE_POSITION = 0, T1_BLEND_UNDERLINE_THICKNESS , T1_BLEND_ITALIC_ANGLE , /* required fields in a Private blend dictionary */ T1_BLEND_BLUE_VALUES , T1_BLEND_OTHER_BLUES , T1_BLEND_STANDARD_WIDTH , T1_BLEND_STANDARD_HEIGHT , T1_BLEND_STEM_SNAP_WIDTHS , T1_BLEND_STEM_SNAP_HEIGHTS , T1_BLEND_BLUE_SCALE , T1_BLEND_BLUE_SHIFT , T1_BLEND_FAMILY_BLUES , T1_BLEND_FAMILY_OTHER_BLUES , T1_BLEND_FORCE_BOLD , T1_BLEND_MAX /* do not remove */ } T1_Blend_Flags ; /* these constants are deprecated; use the corresponding */ /* ` T1_Blend_Flags ` values instead */ # define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION # define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS # define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE # define t1_blend_blue_values T1_BLEND_BLUE_VALUES # define t1_blend_other_blues T1_BLEND_OTHER_BLUES # define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH # define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT # define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS # define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS # define t1_blend_blue_scale T1_BLEND_BLUE_SCALE # define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT # define t1_blend_family_blues T1_BLEND_FAMILY_BLUES # define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES # define t1_blend_force_bold T1_BLEND_FORCE_BOLD # define t1_blend_max T1_BLEND_MAX A set of flags used to indicate which fields are present in a given blend dictionary (font info or private). Used to support Multiple Masters fonts.","title":"T1_Blend_Flags"},{"location":"ft2-type1_tables.html#t1_encodingtype","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum T1_EncodingType_ { T1_ENCODING_TYPE_NONE = 0, T1_ENCODING_TYPE_ARRAY , T1_ENCODING_TYPE_STANDARD , T1_ENCODING_TYPE_ISOLATIN1 , T1_ENCODING_TYPE_EXPERT } T1_EncodingType ; An enumeration describing the \u2018Encoding\u2019 entry in a Type 1 dictionary.","title":"T1_EncodingType"},{"location":"ft2-type1_tables.html#ps_dict_keys","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum PS_Dict_Keys_ { /* conventionally in the font dictionary */ PS_DICT_FONT_TYPE , /* FT_Byte */ PS_DICT_FONT_MATRIX , /* FT_Fixed */ PS_DICT_FONT_BBOX , /* FT_Fixed */ PS_DICT_PAINT_TYPE , /* FT_Byte */ PS_DICT_FONT_NAME , /* FT_String * */ PS_DICT_UNIQUE_ID , /* FT_Int */ PS_DICT_NUM_CHAR_STRINGS , /* FT_Int */ PS_DICT_CHAR_STRING_KEY , /* FT_String * */ PS_DICT_CHAR_STRING , /* FT_String * */ PS_DICT_ENCODING_TYPE , /* T1_EncodingType */ PS_DICT_ENCODING_ENTRY , /* FT_String * */ /* conventionally in the font Private dictionary */ PS_DICT_NUM_SUBRS , /* FT_Int */ PS_DICT_SUBR , /* FT_String * */ PS_DICT_STD_HW , /* FT_UShort */ PS_DICT_STD_VW , /* FT_UShort */ PS_DICT_NUM_BLUE_VALUES , /* FT_Byte */ PS_DICT_BLUE_VALUE , /* FT_Short */ PS_DICT_BLUE_FUZZ , /* FT_Int */ PS_DICT_NUM_OTHER_BLUES , /* FT_Byte */ PS_DICT_OTHER_BLUE , /* FT_Short */ PS_DICT_NUM_FAMILY_BLUES , /* FT_Byte */ PS_DICT_FAMILY_BLUE , /* FT_Short */ PS_DICT_NUM_FAMILY_OTHER_BLUES , /* FT_Byte */ PS_DICT_FAMILY_OTHER_BLUE , /* FT_Short */ PS_DICT_BLUE_SCALE , /* FT_Fixed */ PS_DICT_BLUE_SHIFT , /* FT_Int */ PS_DICT_NUM_STEM_SNAP_H , /* FT_Byte */ PS_DICT_STEM_SNAP_H , /* FT_Short */ PS_DICT_NUM_STEM_SNAP_V , /* FT_Byte */ PS_DICT_STEM_SNAP_V , /* FT_Short */ PS_DICT_FORCE_BOLD , /* FT_Bool */ PS_DICT_RND_STEM_UP , /* FT_Bool */ PS_DICT_MIN_FEATURE , /* FT_Short */ PS_DICT_LEN_IV , /* FT_Int */ PS_DICT_PASSWORD , /* FT_Long */ PS_DICT_LANGUAGE_GROUP , /* FT_Long */ /* conventionally in the font FontInfo dictionary */ PS_DICT_VERSION , /* FT_String * */ PS_DICT_NOTICE , /* FT_String * */ PS_DICT_FULL_NAME , /* FT_String * */ PS_DICT_FAMILY_NAME , /* FT_String * */ PS_DICT_WEIGHT , /* FT_String * */ PS_DICT_IS_FIXED_PITCH , /* FT_Bool */ PS_DICT_UNDERLINE_POSITION , /* FT_Short */ PS_DICT_UNDERLINE_THICKNESS , /* FT_UShort */ PS_DICT_FS_TYPE , /* FT_UShort */ PS_DICT_ITALIC_ANGLE , /* FT_Long */ PS_DICT_MAX = PS_DICT_ITALIC_ANGLE } PS_Dict_Keys ; An enumeration used in calls to FT_Get_PS_Font_Value to identify the Type 1 dictionary entry to retrieve.","title":"PS_Dict_Keys"},{"location":"ft2-type1_tables.html#t1_fontinfo","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef PS_FontInfoRec T1_FontInfo ; This type is equivalent to PS_FontInfoRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"T1_FontInfo"},{"location":"ft2-type1_tables.html#t1_private","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef PS_PrivateRec T1_Private ; This type is equivalent to PS_PrivateRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"T1_Private"},{"location":"ft2-type1_tables.html#cid_fontdict","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef CID_FaceDictRec CID_FontDict ; This type is equivalent to CID_FaceDictRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"CID_FontDict"},{"location":"ft2-type1_tables.html#cid_info","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef CID_FaceInfoRec CID_Info ; This type is equivalent to CID_FaceInfoRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"CID_Info"},{"location":"ft2-user_allocation.html","text":"FreeType \u00bb Docs \u00bb General Remarks \u00bb User allocation User allocation \u00b6 Synopsis \u00b6 FreeType assumes that structures allocated by the user and passed as arguments are zeroed out except for the actual data. In other words, it is recommended to use calloc (or variants of it) instead of malloc for allocation.","title":"User allocation"},{"location":"ft2-user_allocation.html#user-allocation","text":"","title":"User allocation"},{"location":"ft2-user_allocation.html#synopsis","text":"FreeType assumes that structures allocated by the user and passed as arguments are zeroed out except for the actual data. In other words, it is recommended to use calloc (or variants of it) instead of malloc for allocation.","title":"Synopsis"},{"location":"ft2-version.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb FreeType Version FreeType Version \u00b6 Synopsis \u00b6 Note that those functions and macros are of limited use because even a new release of FreeType with only documentation changes increases the version number. FT_Library_Version \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Library_Version ( FT_Library library, FT_Int *amajor, FT_Int *aminor, FT_Int *apatch ); Return the version of the FreeType library being used. This is useful when dynamically linking to the library, since one cannot use the macros FREETYPE_MAJOR , FREETYPE_MINOR , and 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_Face_CheckTrueTypePatents \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Bool ) FT_Face_CheckTrueTypePatents ( FT_Face face ); Deprecated, does nothing. input face A face handle. return Always returns false. note Since May 2010, TrueType hinting is no longer patented. since 2.3.5 FT_Face_SetUnpatentedHinting \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Bool ) FT_Face_SetUnpatentedHinting ( FT_Face face, FT_Bool value ); Deprecated, does nothing. input face A face handle. value New boolean setting. return Always returns false. note Since May 2010, TrueType hinting is no longer patented. since 2.3.5 FREETYPE_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FREETYPE_MAJOR 2 # define FREETYPE_MINOR 11 # define FREETYPE_PATCH 1 These three macros identify the FreeType source code version. Use FT_Library_Version to access them at runtime. values FREETYPE_MAJOR The major version number. FREETYPE_MINOR The minor version number. FREETYPE_PATCH The patch level. note The version number of FreeType if built as a dynamic link library with the \u2018libtool\u2019 package is not controlled by these three macros.","title":"FreeType Version"},{"location":"ft2-version.html#freetype-version","text":"","title":"FreeType Version"},{"location":"ft2-version.html#synopsis","text":"Note that those functions and macros are of limited use because even a new release of FreeType with only documentation changes increases the version number.","title":"Synopsis"},{"location":"ft2-version.html#ft_library_version","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Library_Version ( FT_Library library, FT_Int *amajor, FT_Int *aminor, FT_Int *apatch ); Return the version of the FreeType library being used. This is useful when dynamically linking to the library, since one cannot use the macros FREETYPE_MAJOR , FREETYPE_MINOR , and FREETYPE_PATCH .","title":"FT_Library_Version"},{"location":"ft2-version.html#ft_face_checktruetypepatents","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Bool ) FT_Face_CheckTrueTypePatents ( FT_Face face ); Deprecated, does nothing.","title":"FT_Face_CheckTrueTypePatents"},{"location":"ft2-version.html#ft_face_setunpatentedhinting","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Bool ) FT_Face_SetUnpatentedHinting ( FT_Face face, FT_Bool value ); Deprecated, does nothing.","title":"FT_Face_SetUnpatentedHinting"},{"location":"ft2-version.html#freetype_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FREETYPE_MAJOR 2 # define FREETYPE_MINOR 11 # define FREETYPE_PATCH 1 These three macros identify the FreeType source code version. Use FT_Library_Version to access them at runtime.","title":"FREETYPE_XXX"},{"location":"ft2-winfnt_fonts.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Window FNT Files Window FNT Files \u00b6 Synopsis \u00b6 This section contains the declaration of Windows FNT-specific functions. FT_WinFNT_ID_XXX \u00b6 Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). # define FT_WinFNT_ID_CP1252 0 # define FT_WinFNT_ID_DEFAULT 1 # define FT_WinFNT_ID_SYMBOL 2 # define FT_WinFNT_ID_MAC 77 # define FT_WinFNT_ID_CP932 128 # define FT_WinFNT_ID_CP949 129 # define FT_WinFNT_ID_CP1361 130 # define FT_WinFNT_ID_CP936 134 # define FT_WinFNT_ID_CP950 136 # define FT_WinFNT_ID_CP1253 161 # define FT_WinFNT_ID_CP1254 162 # define FT_WinFNT_ID_CP1258 163 # define FT_WinFNT_ID_CP1255 177 # define FT_WinFNT_ID_CP1256 178 # define FT_WinFNT_ID_CP1257 186 # define FT_WinFNT_ID_CP1251 204 # define FT_WinFNT_ID_CP874 222 # define FT_WinFNT_ID_CP1250 238 # define FT_WinFNT_ID_OEM 255 A list of valid values for the charset byte in FT_WinFNT_HeaderRec . Exact mapping tables for the various \u2018cpXXXX\u2019 encodings (except for \u2018cp1361\u2019) can be found at \u2018 ftp://ftp.unicode.org/Public/ \u2019 in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. \u2018cp1361\u2019 is roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT . values FT_WinFNT_ID_DEFAULT This is used for font enumeration and font creation as a \u2018don't care\u2019 value. Valid font files don't contain this value. When querying for information about the character set of the font that is currently selected into a specified device context, this return value (of the related Windows API) simply denotes failure. FT_WinFNT_ID_SYMBOL There is no known mapping table available. FT_WinFNT_ID_MAC Mac Roman encoding. FT_WinFNT_ID_OEM From Michael Poettgen <michael@poettgen.de>: The \u2018Windows Font Mapping\u2019 article says that FT_WinFNT_ID_OEM is used for the charset of vector fonts, like modern.fon , roman.fon , and script.fon on Windows. The \u2018CreateFont\u2019 documentation says: The FT_WinFNT_ID_OEM value specifies a character set that is operating-system dependent. The \u2018IFIMETRICS\u2019 documentation from the \u2018Windows Driver Development Kit\u2019 says: This font supports an OEM-specific character set. The OEM character set is system dependent. In general OEM, as opposed to ANSI (i.e., \u2018cp1252\u2019), denotes the second default codepage that most international versions of Windows have. It is one of the OEM codepages from https://docs.microsoft.com/en-us/windows/desktop/intl/code-page-identifiers , and is used for the \u2018DOS boxes\u2019, to support legacy applications. A German Windows version for example usually uses ANSI codepage 1252 and OEM codepage 850. FT_WinFNT_ID_CP874 A superset of Thai TIS 620 and ISO 8859-11. FT_WinFNT_ID_CP932 A superset of Japanese Shift-JIS (with minor deviations). FT_WinFNT_ID_CP936 A superset of simplified Chinese GB 2312-1980 (with different ordering and minor deviations). FT_WinFNT_ID_CP949 A superset of Korean Hangul KS C 5601-1987 (with different ordering and minor deviations). FT_WinFNT_ID_CP950 A superset of traditional Chinese Big 5 ETen (with different ordering and minor deviations). FT_WinFNT_ID_CP1250 A superset of East European ISO 8859-2 (with slightly different ordering). FT_WinFNT_ID_CP1251 A superset of Russian ISO 8859-5 (with different ordering). FT_WinFNT_ID_CP1252 ANSI encoding. A superset of ISO 8859-1. FT_WinFNT_ID_CP1253 A superset of Greek ISO 8859-7 (with minor modifications). FT_WinFNT_ID_CP1254 A superset of Turkish ISO 8859-9. FT_WinFNT_ID_CP1255 A superset of Hebrew ISO 8859-8 (with some modifications). FT_WinFNT_ID_CP1256 A superset of Arabic ISO 8859-6 (with different ordering). FT_WinFNT_ID_CP1257 A superset of Baltic ISO 8859-13 (with some deviations). FT_WinFNT_ID_CP1258 For Vietnamese. This encoding doesn't cover all necessary characters. FT_WinFNT_ID_CP1361 Korean (Johab). FT_WinFNT_HeaderRec \u00b6 Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). typedef struct FT_WinFNT_HeaderRec_ { FT_UShort version; FT_ULong file_size; FT_Byte copyright[60]; FT_UShort file_type; FT_UShort nominal_point_size; FT_UShort vertical_resolution; FT_UShort horizontal_resolution; FT_UShort ascent; FT_UShort internal_leading; FT_UShort external_leading; FT_Byte italic; FT_Byte underline; FT_Byte strike_out; FT_UShort weight; FT_Byte charset; FT_UShort pixel_width; FT_UShort pixel_height; FT_Byte pitch_and_family; FT_UShort avg_width; FT_UShort max_width; FT_Byte first_char; FT_Byte last_char; FT_Byte default_char; FT_Byte break_char; FT_UShort bytes_per_row; FT_ULong device_offset; FT_ULong face_name_offset; FT_ULong bits_pointer; FT_ULong bits_offset; FT_Byte reserved; FT_ULong flags; FT_UShort A_space; FT_UShort B_space; FT_UShort C_space; FT_UShort color_table_offset; FT_ULong reserved1[4]; } FT_WinFNT_HeaderRec ; Windows FNT Header info. FT_WinFNT_Header \u00b6 Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header ; A handle to an FT_WinFNT_HeaderRec structure. FT_Get_WinFNT_Header \u00b6 Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). FT_EXPORT( FT_Error ) FT_Get_WinFNT_Header ( FT_Face face, FT_WinFNT_HeaderRec *aheader ); Retrieve a Windows FNT font info header. input face A handle to the input face. output aheader The WinFNT header. return FreeType error code. 0 means success. note This function only works with Windows FNT faces, returning an error otherwise.","title":"Window FNT Files"},{"location":"ft2-winfnt_fonts.html#window-fnt-files","text":"","title":"Window FNT Files"},{"location":"ft2-winfnt_fonts.html#synopsis","text":"This section contains the declaration of Windows FNT-specific functions.","title":"Synopsis"},{"location":"ft2-winfnt_fonts.html#ft_winfnt_id_xxx","text":"Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). # define FT_WinFNT_ID_CP1252 0 # define FT_WinFNT_ID_DEFAULT 1 # define FT_WinFNT_ID_SYMBOL 2 # define FT_WinFNT_ID_MAC 77 # define FT_WinFNT_ID_CP932 128 # define FT_WinFNT_ID_CP949 129 # define FT_WinFNT_ID_CP1361 130 # define FT_WinFNT_ID_CP936 134 # define FT_WinFNT_ID_CP950 136 # define FT_WinFNT_ID_CP1253 161 # define FT_WinFNT_ID_CP1254 162 # define FT_WinFNT_ID_CP1258 163 # define FT_WinFNT_ID_CP1255 177 # define FT_WinFNT_ID_CP1256 178 # define FT_WinFNT_ID_CP1257 186 # define FT_WinFNT_ID_CP1251 204 # define FT_WinFNT_ID_CP874 222 # define FT_WinFNT_ID_CP1250 238 # define FT_WinFNT_ID_OEM 255 A list of valid values for the charset byte in FT_WinFNT_HeaderRec . Exact mapping tables for the various \u2018cpXXXX\u2019 encodings (except for \u2018cp1361\u2019) can be found at \u2018 ftp://ftp.unicode.org/Public/ \u2019 in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. \u2018cp1361\u2019 is roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT .","title":"FT_WinFNT_ID_XXX"},{"location":"ft2-winfnt_fonts.html#ft_winfnt_headerrec","text":"Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). typedef struct FT_WinFNT_HeaderRec_ { FT_UShort version; FT_ULong file_size; FT_Byte copyright[60]; FT_UShort file_type; FT_UShort nominal_point_size; FT_UShort vertical_resolution; FT_UShort horizontal_resolution; FT_UShort ascent; FT_UShort internal_leading; FT_UShort external_leading; FT_Byte italic; FT_Byte underline; FT_Byte strike_out; FT_UShort weight; FT_Byte charset; FT_UShort pixel_width; FT_UShort pixel_height; FT_Byte pitch_and_family; FT_UShort avg_width; FT_UShort max_width; FT_Byte first_char; FT_Byte last_char; FT_Byte default_char; FT_Byte break_char; FT_UShort bytes_per_row; FT_ULong device_offset; FT_ULong face_name_offset; FT_ULong bits_pointer; FT_ULong bits_offset; FT_Byte reserved; FT_ULong flags; FT_UShort A_space; FT_UShort B_space; FT_UShort C_space; FT_UShort color_table_offset; FT_ULong reserved1[4]; } FT_WinFNT_HeaderRec ; Windows FNT Header info.","title":"FT_WinFNT_HeaderRec"},{"location":"ft2-winfnt_fonts.html#ft_winfnt_header","text":"Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header ; A handle to an FT_WinFNT_HeaderRec structure.","title":"FT_WinFNT_Header"},{"location":"ft2-winfnt_fonts.html#ft_get_winfnt_header","text":"Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). FT_EXPORT( FT_Error ) FT_Get_WinFNT_Header ( FT_Face face, FT_WinFNT_HeaderRec *aheader ); Retrieve a Windows FNT font info header.","title":"FT_Get_WinFNT_Header"}]} \ No newline at end of file
+{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"index.html","text":"FreeType \u00bb Docs \u00bb Table of Contents FreeType-2.12.1 API Reference \u00b6 Table of Contents \u00b6 General Remarks \u00b6 Preamble What FreeType is and isn't FreeType's header inclusion scheme How client applications should include FreeType header files. User allocation How client applications should allocate FreeType data structures. Core API \u00b6 FreeType Version Functions and macros related to FreeType versions. Basic Data Types The basic data types defined by the library. Base Interface The FreeType 2 base font interface. Unicode Variation Sequences The FreeType 2 interface to Unicode Variation Sequences (UVS), using the SFNT cmap format 14. Glyph Color Management Retrieving and manipulating OpenType's \u2018CPAL\u2019 table data. Glyph Layer Management Retrieving and manipulating OpenType's \u2018COLR\u2019 table data. Glyph Management Generic interface to manage individual glyph data. Mac Specific Interface Only available on the Macintosh. Size Management Managing multiple sizes per face. Header File Macros Macro definitions used to #include specific header files. Format-Specific API \u00b6 Multiple Masters How to manage Multiple Masters fonts. TrueType Tables TrueType-specific table types and functions. Type 1 Tables Type 1-specific font tables. SFNT Names Access the names embedded in TrueType and OpenType files. BDF and PCF Files BDF and PCF specific API. CID Fonts CID-keyed font-specific API. PFR Fonts PFR/TrueDoc-specific API. Window FNT Files Windows FNT-specific API. OpenType SVG Fonts OT-SVG API between FreeType and an external SVG rendering library. Font Formats Getting the font format. Gasp Table Retrieving TrueType \u2018gasp\u2019 table entries. Controlling FreeType Modules \u00b6 The auto-hinter Controlling the auto-hinting module. The CFF driver Controlling the CFF driver module. The Type 1 and CID drivers Controlling the Type 1 and CID driver modules. The TrueType driver Controlling the TrueType driver module. The PCF driver Controlling the PCF driver module. The SVG driver Controlling the external rendering of OT-SVG glyphs. Driver properties Controlling driver modules. Parameter Tags Macros for driver property and font loading parameter tags. Subpixel Rendering API to control subpixel rendering. Cache Sub-System \u00b6 Cache Sub-System How to cache face, size, and glyph data with FreeType 2. Support API \u00b6 Computations Crunching fixed numbers and vectors. List Processing Simple management of lists. Outline Processing Functions to create, transform, and render vectorial glyph images. Quick retrieval of advance values Retrieve horizontal and vertical advance values without processing glyph outlines, if possible. Bitmap Handling Handling FT_Bitmap objects. Scanline Converter How vectorial outlines are converted into bitmaps and pixmaps. Glyph Stroker Generating bordered and stroked glyphs. System Interface How FreeType manages memory and i/o. Module Management How to add, upgrade, remove, and control modules from FreeType. GZIP Streams Using gzip-compressed font files. LZW Streams Using LZW-compressed font files. BZIP2 Streams Using bzip2-compressed font files. External Debugging APIs Public APIs to control the FT_DEBUG_LOGGING macro. Error Codes \u00b6 Error Enumerations How to handle errors and error strings. Error Code Values All possible error codes returned by FreeType functions. Miscellaneous \u00b6 TrueTypeGX/AAT Validation An API to validate TrueTypeGX/AAT tables. Incremental Loading Custom Glyph Loading. The TrueType Engine TrueType bytecode support. OpenType Validation An API to validate OpenType tables. Global Index \u00b6 generated on Sun May 1 05:24:59 2022 UTC","title":"TOC"},{"location":"index.html#freetype-2121-api-reference","text":"","title":"FreeType-2.12.1 API Reference"},{"location":"index.html#table-of-contents","text":"","title":"Table of Contents"},{"location":"index.html#general-remarks","text":"Preamble What FreeType is and isn't FreeType's header inclusion scheme How client applications should include FreeType header files. User allocation How client applications should allocate FreeType data structures.","title":"General Remarks"},{"location":"index.html#core-api","text":"FreeType Version Functions and macros related to FreeType versions. Basic Data Types The basic data types defined by the library. Base Interface The FreeType 2 base font interface. Unicode Variation Sequences The FreeType 2 interface to Unicode Variation Sequences (UVS), using the SFNT cmap format 14. Glyph Color Management Retrieving and manipulating OpenType's \u2018CPAL\u2019 table data. Glyph Layer Management Retrieving and manipulating OpenType's \u2018COLR\u2019 table data. Glyph Management Generic interface to manage individual glyph data. Mac Specific Interface Only available on the Macintosh. Size Management Managing multiple sizes per face. Header File Macros Macro definitions used to #include specific header files.","title":"Core API"},{"location":"index.html#format-specific-api","text":"Multiple Masters How to manage Multiple Masters fonts. TrueType Tables TrueType-specific table types and functions. Type 1 Tables Type 1-specific font tables. SFNT Names Access the names embedded in TrueType and OpenType files. BDF and PCF Files BDF and PCF specific API. CID Fonts CID-keyed font-specific API. PFR Fonts PFR/TrueDoc-specific API. Window FNT Files Windows FNT-specific API. OpenType SVG Fonts OT-SVG API between FreeType and an external SVG rendering library. Font Formats Getting the font format. Gasp Table Retrieving TrueType \u2018gasp\u2019 table entries.","title":"Format-Specific API"},{"location":"index.html#controlling-freetype-modules","text":"The auto-hinter Controlling the auto-hinting module. The CFF driver Controlling the CFF driver module. The Type 1 and CID drivers Controlling the Type 1 and CID driver modules. The TrueType driver Controlling the TrueType driver module. The PCF driver Controlling the PCF driver module. The SVG driver Controlling the external rendering of OT-SVG glyphs. Driver properties Controlling driver modules. Parameter Tags Macros for driver property and font loading parameter tags. Subpixel Rendering API to control subpixel rendering.","title":"Controlling FreeType Modules"},{"location":"index.html#cache-sub-system","text":"Cache Sub-System How to cache face, size, and glyph data with FreeType 2.","title":"Cache Sub-System"},{"location":"index.html#support-api","text":"Computations Crunching fixed numbers and vectors. List Processing Simple management of lists. Outline Processing Functions to create, transform, and render vectorial glyph images. Quick retrieval of advance values Retrieve horizontal and vertical advance values without processing glyph outlines, if possible. Bitmap Handling Handling FT_Bitmap objects. Scanline Converter How vectorial outlines are converted into bitmaps and pixmaps. Glyph Stroker Generating bordered and stroked glyphs. System Interface How FreeType manages memory and i/o. Module Management How to add, upgrade, remove, and control modules from FreeType. GZIP Streams Using gzip-compressed font files. LZW Streams Using LZW-compressed font files. BZIP2 Streams Using bzip2-compressed font files. External Debugging APIs Public APIs to control the FT_DEBUG_LOGGING macro.","title":"Support API"},{"location":"index.html#error-codes","text":"Error Enumerations How to handle errors and error strings. Error Code Values All possible error codes returned by FreeType functions.","title":"Error Codes"},{"location":"index.html#miscellaneous","text":"TrueTypeGX/AAT Validation An API to validate TrueTypeGX/AAT tables. Incremental Loading Custom Glyph Loading. The TrueType Engine TrueType bytecode support. OpenType Validation An API to validate OpenType tables.","title":"Miscellaneous"},{"location":"index.html#global-index","text":"generated on Sun May 1 05:24:59 2022 UTC","title":"Global Index"},{"location":"ft2-auto_hinter.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The auto-hinter The auto-hinter \u00b6 Synopsis \u00b6 While FreeType's auto-hinter doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The following lists the available properties together with the necessary macros and structures. Note that the auto-hinter's module name is \u2018autofitter\u2019 for historical reasons. Available properties are increase-x-height , no-stem-darkening (experimental), darkening-parameters (experimental), glyph-to-script-map (experimental), fallback-script (experimental), and default-script (experimental), as documented in the \u2018 Driver properties \u2019 section.","title":"The auto-hinter"},{"location":"ft2-auto_hinter.html#the-auto-hinter","text":"","title":"The auto-hinter"},{"location":"ft2-auto_hinter.html#synopsis","text":"While FreeType's auto-hinter doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The following lists the available properties together with the necessary macros and structures. Note that the auto-hinter's module name is \u2018autofitter\u2019 for historical reasons. Available properties are increase-x-height , no-stem-darkening (experimental), darkening-parameters (experimental), glyph-to-script-map (experimental), fallback-script (experimental), and default-script (experimental), as documented in the \u2018 Driver properties \u2019 section.","title":"Synopsis"},{"location":"ft2-base_interface.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Base Interface Base Interface \u00b6 Synopsis \u00b6 This section describes the most important public high-level API functions of FreeType 2. FT_Library \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_LibraryRec_ * FT_Library ; A handle to a FreeType library instance. Each \u2018library\u2019 is completely independent from the others; it is the \u2018root\u2019 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 ). [Since 2.5.6] In multi-threaded applications it is easiest to use one FT_Library object per thread. In case this is too cumbersome, a single FT_Library object across threads is possible also, as long as a mutex lock is used around FT_New_Face and FT_Done_Face . note Library objects are normally created by FT_Init_FreeType , and destroyed with FT_Done_FreeType . If you need reference-counting (cf. FT_Reference_Library ), use FT_New_Library and FT_Done_Library . FT_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_FaceRec_* FT_Face ; A handle to a typographic face object. A face object models a given typeface, in a given style. note A 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 filepath or a custom input stream. Use FT_Done_Face to destroy it (along with its slot and sizes). An FT_Face object can only be safely used from one thread at a time. Similarly, creation and destruction of FT_Face with the same FT_Library object can only be done from one thread at a time. On the other hand, functions like FT_Load_Glyph and its siblings are thread-safe and do not need the lock to be held as long as the same FT_Face object is not used from multiple threads at the same time. also See FT_FaceRec for the publicly accessible fields of a given face object. FT_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_SizeRec_* FT_Size ; A handle to an object that models a face scaled to a given character size. note An FT_Face has one active FT_Size object that is used by functions like FT_Load_Glyph to determine the scaling transformation that in turn is used to load and hint glyphs and metrics. A newly created FT_Size object contains only meaningless zero values. You must use FT_Set_Char_Size , FT_Set_Pixel_Sizes , FT_Request_Size or even FT_Select_Size to change the content (i.e., the scaling values) of the active FT_Size . Otherwise, the scaling and hinting will not be performed. You can use FT_New_Size to create additional size objects for a given FT_Face , but they won't be used by other functions until you activate it through FT_Activate_Size . Only one size can be activated at any given time per face. also See FT_SizeRec for the publicly accessible fields of a given size object. FT_GlyphSlot \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_GlyphSlotRec_* FT_GlyphSlot ; A handle to a given \u2018glyph slot\u2019. A slot is a container that can hold any 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 See FT_GlyphSlotRec for the publicly accessible glyph fields. FT_CharMap \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_CharMapRec_* FT_CharMap ; A handle to a character map (usually abbreviated to \u2018charmap\u2019). 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 \u2018active\u2019, providing the data 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. If there is no Unicode charmap, FreeType doesn't set an \u2018active\u2019 charmap. also See FT_CharMapRec for the publicly accessible fields of a given character map. FT_Encoding \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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_SJIS , 's', 'j', 'i', 's' ), FT_ENC_TAG ( FT_ENCODING_PRC , 'g', 'b', ' ', ' ' ), FT_ENC_TAG ( FT_ENCODING_BIG5 , 'b', 'i', 'g', '5' ), FT_ENC_TAG ( FT_ENCODING_WANSUNG , 'w', 'a', 'n', 's' ), FT_ENC_TAG ( FT_ENCODING_JOHAB , 'j', 'o', 'h', 'a' ), /* for backward compatibility */ FT_ENCODING_GB2312 = FT_ENCODING_PRC , FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS , FT_ENCODING_MS_GB2312 = FT_ENCODING_PRC , FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5 , FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG , FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB , 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 ; /* these constants are deprecated; use the corresponding ` FT_Encoding ` */ /* values instead */ # 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_SJIS # define ft_encoding_gb2312 FT_ENCODING_PRC # define ft_encoding_big5 FT_ENCODING_BIG5 # define ft_encoding_wansung FT_ENCODING_WANSUNG # define ft_encoding_johab FT_ENCODING_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 An enumeration to specify character sets supported by charmaps. Used in the FT_Select_Charmap API function. note Despite the name, this enumeration lists specific character repertories (i.e., charsets), and not text encoding methods (e.g., UTF-8, UTF-16, etc.). Other encodings might be defined in the future. values FT_ENCODING_NONE The encoding value 0 is reserved for all formats except BDF, PCF, and Windows FNT; see below for more information. FT_ENCODING_UNICODE 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. For example, if you want to access Unicode value U+1F028 (and the font contains it), use value 0x1F028 as the input value for FT_Get_Char_Index . FT_ENCODING_MS_SYMBOL Microsoft Symbol encoding, used to encode mathematical symbols and wingdings. For more information, see \u2018 https://www.microsoft.com/typography/otspec/recom.htm#non-standard-symbol-fonts \u2019, \u2018 http://www.kostis.net/charsets/symbol.htm \u2019, and \u2018 http://www.kostis.net/charsets/wingding.htm \u2019. This encoding uses character codes from the PUA (Private Unicode Area) in the range U+F020-U+F0FF. FT_ENCODING_SJIS Shift JIS encoding for Japanese. More info at \u2018 https://en.wikipedia.org/wiki/Shift_JIS \u2019. See note on multi-byte encodings below. FT_ENCODING_PRC Corresponds to encoding systems mainly for Simplified Chinese as used in People's Republic of China (PRC). The encoding layout is based on GB 2312 and its supersets GBK and GB 18030. FT_ENCODING_BIG5 Corresponds to an encoding system for Traditional Chinese as used in Taiwan and Hong Kong. FT_ENCODING_WANSUNG Corresponds to the Korean encoding system known as Extended Wansung (MS Windows code page 949). For more information see \u2018 https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit949.txt \u2019. FT_ENCODING_JOHAB The Korean standard character set (KS C 5601-1992), which corresponds to MS Windows code page 1361. This character set includes all possible Hangul character combinations. 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 Adobe Standard encoding, as found in Type 1, CFF, and OpenType/CFF fonts. It is limited to 256 character codes. FT_ENCODING_ADOBE_EXPERT 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 Apple roman encoding. Many TrueType and OpenType fonts contain a charmap for this 8-bit encoding, since older versions of Mac OS are able to use it. FT_ENCODING_OLD_LATIN_2 This value is deprecated and was neither used nor reported by FreeType. Don't use or test for it. FT_ENCODING_MS_SJIS Same as FT_ENCODING_SJIS. Deprecated. FT_ENCODING_MS_GB2312 Same as FT_ENCODING_PRC. Deprecated. FT_ENCODING_MS_BIG5 Same as FT_ENCODING_BIG5. Deprecated. FT_ENCODING_MS_WANSUNG Same as FT_ENCODING_WANSUNG. Deprecated. FT_ENCODING_MS_JOHAB Same as FT_ENCODING_JOHAB. Deprecated. note When loading a font, FreeType makes a Unicode charmap active if possible (either if the font provides such a charmap, or if FreeType can synthesize one from PostScript glyph name dictionaries; in either case, the charmap is tagged with FT_ENCODING_UNICODE ). If such a charmap is synthesized, it is placed at the first position of the charmap array. All other encodings are considered legacy and tagged only if explicitly defined in the font file. Otherwise, FT_ENCODING_NONE is used. FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap is neither Unicode nor ISO-8859-1 (otherwise it is set to FT_ENCODING_UNICODE ). Use FT_Get_BDF_Charset_ID to find out which encoding is really present. If, for example, the cs_registry field is \u2018KOI8\u2019 and the cs_encoding field is \u2018R\u2019, the font is encoded in KOI8-R. FT_ENCODING_NONE is always set (with a single exception) by the winfonts driver. Use FT_Get_WinFNT_Header and examine the charset field of the FT_WinFNT_HeaderRec structure to find out which encoding is really present. For example, FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for Russian). FT_ENCODING_NONE is set if platform_id is TT_PLATFORM_MACINTOSH and encoding_id is not TT_MAC_ID_ROMAN (otherwise it is set to FT_ENCODING_APPLE_ROMAN ). If platform_id is TT_PLATFORM_MACINTOSH , use the function FT_Get_CMap_Language_ID to query the Mac language ID that may be needed to be able to distinguish Apple encoding variants. See https://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/Readme.txt to get an idea how to do that. Basically, if the language ID is 0, don't use it, otherwise subtract 1 from the language ID. Then examine encoding_id . If, for example, encoding_id is TT_MAC_ID_ROMAN and the language ID (minus 1) is TT_MAC_LANGID_GREEK , it is the Greek encoding, not Roman. TT_MAC_ID_ARABIC with TT_MAC_LANGID_FARSI means the Farsi variant the Arabic encoding. FT_ENC_TAG \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # ifndef FT_ENC_TAG # define FT_ENC_TAG ( value, a, b, c, d ) \\ value = ( ( FT_STATIC_BYTE_CAST( FT_UInt32 , a ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( FT_UInt32 , b ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( FT_UInt32 , c ) << 8 ) | \\ FT_STATIC_BYTE_CAST( FT_UInt32 , d ) ) # endif /* FT_ENC_TAG */ This macro converts four-letter tags into an unsigned long. It is used to define \u2018encoding\u2019 identifiers (see FT_Encoding ). note Since many 16-bit compilers don't like 32-bit 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. FT_FaceRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 member variables (down to `underline_thickness`) */ /*# are only relevant to scalable outlines; cf. @ FT_Bitmap_Size */ /*# for bitmap fonts. */ 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; /* face-specific auto-hinter data */ void * extensions; /* unused */ FT_Face_Internal internal; /*@private end */ } FT_FaceRec ; FreeType root face class structure. A face object models a typeface in a font file. fields num_faces The number of faces in the font file. Some font formats can have multiple faces in a single font file. face_index This field holds two different values. Bits 0-15 are the index of the face in the font file (starting with value 0). They are set to 0 if there is only one face in the font file. [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation fonts only, holding the named instance index for the current face index (starting with value 1; value 0 indicates font access without a named instance). For non-variation fonts, bits 16-30 are ignored. If we have the third named instance of face 4, say, face_index is set to 0x00030004. Bit 31 is always zero (this is, face_index is always a positive value). [Since 2.9] Changing the design coordinates with FT_Set_Var_Design_Coordinates or FT_Set_Var_Blend_Coordinates does not influence the named instance index value (only FT_Set_Named_Instance does that). face_flags A set of bit flags that give important information about the face; see FT_FACE_FLAG_XXX for the details. style_flags The lower 16 bits contain a set of bit flags indicating the style of the face; see FT_STYLE_FLAG_XXX for the details. [Since 2.6.1] Bits 16-30 hold the number of named instances available for the current face if we have a GX or OpenType variation (sub)font. Bit 31 is always zero (this is, style_flags is always a positive value). Note that a variation font has always at least one named instance, namely the default instance. num_glyphs The number of glyphs in the face. If the face is scalable and has sbits (see num_fixed_sizes ), it is set to the number of outline glyphs. For CID-keyed fonts (not in an SFNT wrapper) this value gives the highest CID used in the font. family_name The face's family name. This is an ASCII string, usually in English, that describes the typeface's family (like \u2018Times New Roman\u2019, \u2018Bodoni\u2019, \u2018Garamond\u2019, 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. Can be NULL (e.g., in fonts embedded in a PDF file). In case the font doesn't provide a specific family name entry, FreeType tries to synthesize one, deriving it from other name entries. style_name The face's style name. This is an ASCII string, usually in English, that describes the typeface's style (like \u2018Italic\u2019, \u2018Bold\u2019, \u2018Condensed\u2019, 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 and Unicode versions of this string. Applications should use the format-specific interface to access them. num_fixed_sizes The number of bitmap strikes in the face. Even if the face is scalable, there might still be bitmap strikes, which are called \u2018sbits\u2019 in that case. available_sizes An array of FT_Bitmap_Size for all bitmap strikes in the face. It is set to NULL if there is no bitmap strike. Note that FreeType tries to sanitize the strike data since they are sometimes sloppy or incorrect, but this can easily fail. num_charmaps The number of charmaps in the face. charmaps An array of the charmaps of the face. 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 \u2018maximum ascender\u2019, and bbox.yMin as the \u2018minimum descender\u2019. Only relevant for scalable formats. Note that the bounding box might be off by (at least) one pixel for hinted fonts. See FT_Size_Metrics for further discussion. Note that the bounding box does not vary in OpenType variable fonts and should only be used in relation to the default instance. units_per_EM The number of font units per EM square for this face. This is typically 2048 for TrueType fonts, and 1000 for Type 1 fonts. Only relevant for scalable formats. ascender The typographic ascender of the face, expressed in font units. For font formats not having this information, it is set to bbox.yMax . Only relevant for scalable formats. descender The typographic descender of the face, expressed in font units. For font formats not having this information, it is set to bbox.yMin . Note that this field is negative for values below the baseline. Only relevant for scalable formats. height This value is the vertical distance between two consecutive baselines, expressed in font units. It is always positive. Only relevant for scalable formats. If you want the global glyph height, use ascender - descender . max_advance_width The maximum 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 maximum advance height, in font units, for all glyphs in this face. This is only relevant for vertical layouts, and is set to 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 is 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). size The current active size for this face. charmap The current active charmap for this face. note Fields may be changed after a call to FT_Attach_File or FT_Attach_Stream . For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: ascender , descender , height , underline_position , and underline_thickness . Especially for TrueType fonts see also the documentation for FT_Size_Metrics . FT_HAS_HORIZONTAL \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_HORIZONTAL ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL ) ) 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. FT_HAS_VERTICAL \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_VERTICAL ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_VERTICAL ) ) A macro that returns true whenever a face object contains real vertical metrics (and not only synthesized ones). FT_HAS_KERNING \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_KERNING ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_KERNING ) ) A macro that returns true whenever a face object contains kerning data that can be accessed with FT_Get_Kerning . FT_HAS_FIXED_SIZES \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_FIXED_SIZES ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) ) A macro that returns true whenever a face object contains some embedded bitmaps. See the available_sizes field of the FT_FaceRec structure. FT_HAS_GLYPH_NAMES \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_GLYPH_NAMES ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) ) A macro that returns true whenever a face object contains some glyph names that can be accessed through FT_Get_Glyph_Name . FT_HAS_COLOR \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_COLOR ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_COLOR ) ) A macro that returns true whenever a face object contains tables for color glyphs. since 2.5.1 FT_HAS_MULTIPLE_MASTERS \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_MULTIPLE_MASTERS ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) ) 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. FT_HAS_SVG \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_SVG ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SVG ) ) A macro that returns true whenever a face object contains an \u2018SVG \u2019 OpenType table. since 2.12 FT_HAS_SBIX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_SBIX ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SBIX ) ) A macro that returns true whenever a face object contains an \u2018sbix\u2019 OpenType table and outline glyphs. Currently, FreeType only supports bitmap glyphs in PNG format for this table (i.e., JPEG and TIFF formats are unsupported, as are Apple-specific formats not part of the OpenType specification). note For backward compatibility, a font with an \u2018sbix\u2019 table is treated as a bitmap-only face. Using FT_Open_Face with FT_PARAM_TAG_IGNORE_SBIX , an application can switch off \u2018sbix\u2019 handling so that the face is treated as an ordinary outline font with scalable outlines. Here is some pseudo code that roughly illustrates how to implement \u2018sbix\u2019 handling according to the OpenType specification. if ( FT_HAS_SBIX( face ) ) { // open font as a scalable one without sbix handling FT_Face face2; FT_Parameter param = { FT_PARAM_TAG_IGNORE_SBIX, NULL }; FT_Open_Args args = { FT_OPEN_PARAMS | ..., ..., 1, &param }; FT_Open_Face( library, &args, 0, &face2 ); <sort `face->available_size` as necessary into `preferred_sizes`[*]> for ( i = 0; i < face->num_fixed_sizes; i++ ) { size = preferred_sizes[i].size; error = FT_Set_Pixel_Sizes( face, size, size ); <error handling omitted> // check whether we have a glyph in a bitmap strike error = FT_Load_Glyph( face, glyph_index, FT_LOAD_SBITS_ONLY | FT_LOAD_BITMAP_METRICS_ONLY ); if ( error == FT_Err_Invalid_Argument ) continue; else if ( error ) <other error handling omitted> else break; } if ( i != face->num_fixed_sizes ) <load embedded bitmap with `FT_Load_Glyph`, scale it, display it, etc.> if ( i == face->num_fixed_sizes || FT_HAS_SBIX_OVERLAY( face ) ) <use `face2` to load outline glyph with `FT_Load_Glyph`, scale it, display it on top of the bitmap, etc.> } [*] Assuming a target value of 400dpi and available strike sizes 100, 200, 300, and 400dpi, a possible order might be [400, 200, 300, 100]: scaling 200dpi to 400dpi usually gives better results than scaling 300dpi to 400dpi; it is also much faster. However, scaling 100dpi to 400dpi can yield a too pixelated result, thus the preference might be 300dpi over 100dpi. since 2.12 FT_HAS_SBIX_OVERLAY \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_SBIX_OVERLAY ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SBIX_OVERLAY ) ) A macro that returns true whenever a face object contains an \u2018sbix\u2019 OpenType table with bit 1 in its flags field set, instructing the application to overlay the bitmap strike with the corresponding outline glyph. See FT_HAS_SBIX for pseudo code how to use it. since 2.12 FT_IS_SFNT \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_SFNT ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SFNT ) ) 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. FT_IS_SCALABLE \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_SCALABLE ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SCALABLE ) ) A macro that returns true whenever a face object contains a scalable font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF, and PFR font formats). FT_IS_FIXED_WIDTH \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_FIXED_WIDTH ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) ) A macro that returns true whenever a face object contains a font face that contains fixed-width (or \u2018monospace\u2019, \u2018fixed-pitch\u2019, etc.) glyphs. FT_IS_CID_KEYED \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_CID_KEYED ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_CID_KEYED ) ) A macro that returns true whenever a face object contains a CID-keyed font. See the discussion of FT_FACE_FLAG_CID_KEYED for more details. If this macro is true, all functions defined in FT_CID_H are available. FT_IS_TRICKY \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_TRICKY ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_TRICKY ) ) A macro that returns true whenever a face represents a \u2018tricky\u2019 font. See the discussion of FT_FACE_FLAG_TRICKY for more details. FT_IS_NAMED_INSTANCE \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_NAMED_INSTANCE ( face ) \\ ( !!( (face)->face_index & 0x7FFF0000L ) ) A macro that returns true whenever a face object is a named instance of a GX or OpenType variation font. [Since 2.9] Changing the design coordinates with FT_Set_Var_Design_Coordinates or FT_Set_Var_Blend_Coordinates does not influence the return value of this macro (only FT_Set_Named_Instance does that). since 2.7 FT_IS_VARIATION \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_VARIATION ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_VARIATION ) ) A macro that returns true whenever a face object has been altered by FT_Set_MM_Design_Coordinates , FT_Set_Var_Design_Coordinates , or FT_Set_Var_Blend_Coordinates . since 2.9 FT_SizeRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ; FreeType root size class structure. A size object models a face object at a given size. fields face Handle to the parent face object. generic A typeless pointer, 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. FT_Size_Metrics \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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; /* scaling values used to convert font */ FT_Fixed y_scale; /* units to 26.6 fractional pixels */ 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 ; The size metrics structure gives the metrics of a size object. fields x_ppem The width of the scaled EM square in pixels, hence the term \u2018ppem\u2019 (pixels per EM). It is also referred to as \u2018nominal width\u2019. y_ppem The height of the scaled EM square in pixels, hence the term \u2018ppem\u2019 (pixels per EM). It is also referred to as \u2018nominal height\u2019. x_scale A 16.16 fractional scaling value to convert horizontal metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats. y_scale A 16.16 fractional scaling value to convert vertical metrics from font units to 26.6 fractional pixels. Only relevant for scalable font formats. ascender The ascender in 26.6 fractional pixels, rounded up to an integer value. See FT_FaceRec for the details. descender The descender in 26.6 fractional pixels, rounded down to an integer value. See FT_FaceRec for the details. height The height in 26.6 fractional pixels, rounded to an integer value. See FT_FaceRec for the details. max_advance The maximum advance width in 26.6 fractional pixels, rounded to an integer value. See FT_FaceRec for the details. note The scaling values, if relevant, are determined first during a size changing operation. The remaining fields are then set by the driver. For scalable formats, they are usually set to scaled values of the corresponding fields in FT_FaceRec . Some values like ascender or descender are rounded for historical reasons; more precise values (for outline fonts) can be derived by scaling the corresponding FT_FaceRec values manually, with code similar to the following. scaled_ascender = FT_MulFix( face->ascender, size_metrics->y_scale ); Note that due to glyph hinting and the selected rendering mode these values are usually not exact; consequently, they must be treated as unreliable with an error margin of at least one pixel! Indeed, the only way to get the exact metrics is to render all glyphs. As this would be a definite performance hit, it is up to client applications to perform such computations. The FT_Size_Metrics structure is valid for bitmap fonts also. TrueType fonts with native bytecode hinting All applications that handle TrueType fonts with native hinting must be aware that TTFs expect different rounding of vertical font dimensions. The application has to cater for this, especially if it wants to rely on a TTF's vertical data (for example, to properly align box characters vertically). Only the application knows in advance that it is going to use native hinting for TTFs! FreeType, on the other hand, selects the hinting mode not at the time of creating an FT_Size object but much later, namely while calling FT_Load_Glyph . Here is some pseudo code that illustrates a possible solution. font_format = FT_Get_Font_Format( face ); if ( !strcmp( font_format, \"TrueType\" ) && do_native_bytecode_hinting ) { ascender = ROUND( FT_MulFix( face->ascender, size_metrics->y_scale ) ); descender = ROUND( FT_MulFix( face->descender, size_metrics->y_scale ) ); } else { ascender = size_metrics->ascender; descender = size_metrics->descender; } height = size_metrics->height; max_advance = size_metrics->max_advance; FT_GlyphSlotRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_GlyphSlotRec_ { FT_Library library; FT_Face face; FT_GlyphSlot next; FT_UInt glyph_index; /* new in 2.10; was reserved previously */ 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; FT_Pos lsb_delta; FT_Pos rsb_delta; void * other; FT_Slot_Internal internal; } FT_GlyphSlotRec ; FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format. 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. glyph_index [Since 2.10] The glyph index passed as an argument to FT_Load_Glyph while initializing the glyph slot. generic A typeless pointer 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 The advance width of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless FT_LOAD_LINEAR_DESIGN is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs. linearVertAdvance The advance height of the unhinted glyph. Its value is expressed in 16.16 fractional pixels, unless FT_LOAD_LINEAR_DESIGN is set when loading the glyph. This field can be important to perform correct WYSIWYG layout. Only relevant for outline glyphs. advance This shorthand is, depending on FT_LOAD_IGNORE_TRANSFORM , the transformed (hinted) advance width for the glyph, in 26.6 fractional pixel format. As specified with FT_LOAD_VERTICAL_LAYOUT , it uses either the horiAdvance or the vertAdvance value of metrics field. format This field indicates the format of the image contained in the glyph slot. Typically FT_GLYPH_FORMAT_BITMAP , FT_GLYPH_FORMAT_OUTLINE , or FT_GLYPH_FORMAT_COMPOSITE , but other values are possible. bitmap This field is used as a bitmap descriptor. 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 The bitmap's left bearing expressed in integer pixels. bitmap_top The bitmap's top bearing expressed in integer pixels. 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_FORMAT_OUTLINE . Once a glyph is loaded, outline can be transformed, distorted, emboldened, etc. However, it must not be freed. [Since 2.10.1] If FT_LOAD_NO_SCALE is set, outline coordinates of OpenType variation fonts for a selected instance are internally handled as 26.6 fractional font units but returned as (rounded) integers, as expected. To get unrounded font units, don't use FT_LOAD_NO_SCALE but load the glyph with FT_LOAD_NO_HINTING and scale it, using the font's units_per_EM value as the ppem. num_subglyphs The number of subglyphs in a composite glyph. This field 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. Currently internal to FreeType. 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; it is currently internal to FreeType. control_len This is the length in bytes of the control data. Currently internal to FreeType. other Reserved. lsb_delta The difference between hinted and unhinted left side bearing while auto-hinting is active. Zero otherwise. rsb_delta The difference between hinted and unhinted right side bearing while auto-hinting is active. Zero otherwise. 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., an outline glyph for TrueType and Type 1 formats). [Since 2.9] The prospective bitmap metrics are calculated according to FT_LOAD_TARGET_XXX and other flags even for the outline glyph, even if FT_LOAD_RENDER is not set. This image can later be converted into a bitmap by calling FT_Render_Glyph . This function searches 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 converting 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 . Here is a small pseudo code fragment that shows how to use lsb_delta and rsb_delta to do fractional positioning of glyphs: FT_GlyphSlot slot = face->glyph; FT_Pos origin_x = 0; for all glyphs do <load glyph with `FT_Load_Glyph'> FT_Outline_Translate( slot->outline, origin_x & 63, 0 ); <save glyph image, or render glyph, or ...> <compute kern between current and next glyph and add it to `origin_x'> origin_x += slot->advance.x; origin_x += slot->lsb_delta - slot->rsb_delta; endfor Here is another small pseudo code fragment that shows how to use lsb_delta and rsb_delta to improve integer positioning of glyphs: FT_GlyphSlot slot = face->glyph; FT_Pos origin_x = 0; FT_Pos prev_rsb_delta = 0; for all glyphs do <compute kern between current and previous glyph and add it to `origin_x'> <load glyph with `FT_Load_Glyph'> if ( prev_rsb_delta - slot->lsb_delta > 32 ) origin_x -= 64; else if ( prev_rsb_delta - slot->lsb_delta < -31 ) origin_x += 64; prev_rsb_delta = slot->rsb_delta; <save glyph image, or render glyph, or ...> origin_x += slot->advance.x; endfor If you use strong auto-hinting, you must apply these delta values! Otherwise you will experience far too large inter-glyph spacing at small rendering sizes in most cases. Note that it doesn't harm to use the above code for other hinting modes also, since the delta values are zero then. FT_Glyph_Metrics \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Glyph_Metrics_ { FT_Pos width; FT_Pos height; FT_Pos horiBearingX; FT_Pos horiBearingY; FT_Pos horiAdvance; FT_Pos vertBearingX; FT_Pos vertBearingY; FT_Pos vertAdvance; } FT_Glyph_Metrics ; A structure to model the metrics of a single glyph. The values are expressed in 26.6 fractional pixel format; if the flag FT_LOAD_NO_SCALE has been used while loading the glyph, values are expressed in font units instead. fields width The glyph's width. height The glyph's height. horiBearingX Left side bearing for horizontal layout. horiBearingY Top side bearing for horizontal layout. horiAdvance Advance width for horizontal layout. vertBearingX Left side bearing for vertical layout. vertBearingY Top side bearing for vertical layout. Larger positive values mean further below the vertical glyph origin. vertAdvance Advance height for vertical layout. Positive values mean the glyph has a positive advance downward. note If not disabled with FT_LOAD_NO_HINTING , the values represent dimensions of the hinted glyph (in case hinting is applicable). Stroking a glyph with an outside border does not increase horiAdvance or vertAdvance ; you have to manually adjust these values to account for the added width and height. FreeType doesn't use the \u2018VORG\u2019 table data for CFF fonts because it doesn't have an interface to quickly retrieve the glyph height. The y coordinate of the vertical origin can be simply computed as vertBearingY + height after loading a glyph. FT_SubGlyph \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_SubGlyphRec_* FT_SubGlyph ; 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. You can however retrieve subglyph information with FT_Get_SubGlyph_Info . FT_Bitmap_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Bitmap_Size_ { FT_Short height; FT_Short width; FT_Pos size; FT_Pos x_ppem; FT_Pos y_ppem; } FT_Bitmap_Size ; This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It is used for the available_sizes field of FT_Face . fields height The vertical distance, in pixels, between two consecutive baselines. It is always positive. width The average width, in pixels, of all glyphs in the strike. size The nominal size of the strike in 26.6 fractional points. This field is not very useful. x_ppem The horizontal ppem (nominal width) in 26.6 fractional pixels. y_ppem The vertical ppem (nominal height) in 26.6 fractional pixels. note Windows FNT: The nominal size given in a FNT font is not reliable. If the driver finds it incorrect, it sets size to some calculated values, and x_ppem and y_ppem to the pixel width and height given in the font, respectively. TrueType embedded bitmaps: size , width , and height values are not contained in the bitmap strike itself. They are computed from the global font parameters. FT_Init_FreeType \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Init_FreeType ( FT_Library *alibrary ); Initialize 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. note In case you want to provide your own memory allocating routines, use FT_New_Library instead, followed by a call to FT_Add_Default_Modules (or a series of calls to FT_Add_Module ) and FT_Set_Default_Properties . See the documentation of FT_Library and FT_Face for multi-threading issues. If you need reference-counting (cf. FT_Reference_Library ), use FT_New_Library and FT_Done_Library . If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is set, this function reads the FREETYPE_PROPERTIES environment variable to control driver properties. See section \u2018 Driver properties \u2019 for more. FT_Done_FreeType \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Done_FreeType ( FT_Library library ); Destroy a given FreeType library object and all of its children, including resources, drivers, faces, sizes, etc. input library A handle to the target library object. return FreeType error code. 0 means success. FT_New_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_New_Face ( FT_Library library, const char * filepathname, FT_Long face_index, FT_Face *aface ); Call FT_Open_Face to open a font by its pathname. inout library A handle to the library resource. input pathname A path to the font file. face_index See FT_Open_Face for a detailed description of this parameter. output aface A handle to a new face object. If face_index is greater than or equal to zero, it must be non- NULL . return FreeType error code. 0 means success. note The pathname string should be recognizable as such by a standard fopen call on your system; in particular, this means that pathname must not contain null bytes. If that is not sufficient to address all file name possibilities (for example, to handle wide character file names on Windows in UTF-16 encoding) you might use FT_Open_Face to pass a memory array or a stream object instead. Use FT_Done_Face to destroy the created FT_Face object (along with its slot and sizes). FT_Done_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Done_Face ( FT_Face face ); Discard 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. note See the discussion of reference counters in the description of FT_Reference_Face . FT_Reference_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Reference_Face ( FT_Face face ); A counter gets initialized to 1 at the time an FT_Face structure is created. This function increments the counter. FT_Done_Face then only destroys a face if the counter is 1, otherwise it simply decrements the counter. This function helps in managing life-cycles of structures that reference FT_Face objects. input face A handle to a target face object. return FreeType error code. 0 means success. since 2.4.2 FT_New_Memory_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Call FT_Open_Face to open a font that has been 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 See FT_Open_Face for a detailed description of this parameter. output aface A handle to a new face object. If face_index is greater than or equal to zero, it must be non- NULL . return FreeType error code. 0 means success. note You must not deallocate the memory before calling FT_Done_Face . FT_Face_Properties \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Face_Properties ( FT_Face face, FT_UInt num_properties, FT_Parameter * properties ); Set or override certain (library or module-wide) properties on a face-by-face basis. Useful for finer-grained control and avoiding locks on shared structures (threads can modify their own faces as they see fit). Contrary to FT_Property_Set , this function uses FT_Parameter so that you can pass multiple properties to the target face in one call. Note that only a subset of the available properties can be controlled. FT_PARAM_TAG_STEM_DARKENING (stem darkening, corresponding to the property no-stem-darkening provided by the \u2018autofit\u2019, \u2018cff\u2019, \u2018type1\u2019, and \u2018t1cid\u2019 modules; see no-stem-darkening ). FT_PARAM_TAG_LCD_FILTER_WEIGHTS (LCD filter weights, corresponding to function FT_Library_SetLcdFilterWeights ). FT_PARAM_TAG_RANDOM_SEED (seed value for the CFF, Type 1, and CID \u2018random\u2019 operator, corresponding to the random-seed property provided by the \u2018cff\u2019, \u2018type1\u2019, and \u2018t1cid\u2019 modules; see random-seed ). Pass NULL as data in FT_Parameter for a given tag to reset the option and use the library or module default again. input face A handle to the source face object. num_properties The number of properties that follow. properties A handle to an FT_Parameter array with num_properties elements. return FreeType error code. 0 means success. example Here is an example that sets three properties. You must define FT_CONFIG_OPTION_SUBPIXEL_RENDERING to make the LCD filter examples work. FT_Parameter property1; FT_Bool darken_stems = 1; FT_Parameter property2; FT_LcdFiveTapFilter custom_weight = { 0x11, 0x44, 0x56, 0x44, 0x11 }; FT_Parameter property3; FT_Int32 random_seed = 314159265; FT_Parameter properties[3] = { property1, property2, property3 }; property1.tag = FT_PARAM_TAG_STEM_DARKENING; property1.data = &darken_stems; property2.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS; property2.data = custom_weight; property3.tag = FT_PARAM_TAG_RANDOM_SEED; property3.data = &random_seed; FT_Face_Properties( face, 3, properties ); The next example resets a single property to its default value. FT_Parameter property; property.tag = FT_PARAM_TAG_LCD_FILTER_WEIGHTS; property.data = NULL; FT_Face_Properties( face, 1, &property ); since 2.8 FT_Open_Face \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Open_Face ( FT_Library library, const FT_Open_Args * args, FT_Long face_index, FT_Face *aface ); Create a face object from a given resource described by FT_Open_Args . inout library A handle to the library resource. input args A pointer to an FT_Open_Args structure that must be filled by the caller. face_index This field holds two different values. Bits 0-15 are the index of the face in the font file (starting with value 0). Set it to 0 if there is only one face in the font file. [Since 2.6.1] Bits 16-30 are relevant to GX and OpenType variation fonts only, specifying the named instance index for the current face index (starting with value 1; value 0 makes FreeType ignore named instances). For non-variation fonts, bits 16-30 are ignored. Assuming that you want to access the third named instance in face 4, face_index should be set to 0x00030004. If you want to access face 4 without variation handling, simply set face_index to value 4. FT_Open_Face and its siblings can be used to quickly check whether the font format of a given font resource is supported by FreeType. In general, if the face_index argument is negative, the function's return value is 0 if the font format is recognized, or non-zero otherwise. The function allocates a more or less empty face handle in *aface (if aface isn't NULL ); the only two useful fields in this special case are face->num_faces and face->style_flags . For any negative value of face_index , face->num_faces gives the number of faces within the font file. For the negative value \u2018-(N+1)\u2019 (with \u2018N\u2019 a non-negative 16-bit value), bits 16-30 in face->style_flags give the number of named instances in face \u2018N\u2019 if we have a variation font (or zero otherwise). After examination, the returned FT_Face structure should be deallocated with a call to FT_Done_Face . output aface A handle to a new face object. If face_index is greater than or equal to zero, it must be non- NULL . return FreeType error code. 0 means success. note Unlike FreeType 1.x, this function automatically creates a glyph slot for the face object that can be accessed directly through face->glyph . Each new face object created with this function also owns a default FT_Size object, accessible as face->size . One FT_Library instance can have multiple face objects, this is, FT_Open_Face and its siblings can be called multiple times using the same library argument. See the discussion of reference counters in the description of FT_Reference_Face . If FT_OPEN_STREAM is set in args->flags , the stream in args->stream is automatically closed before this function returns any error (including FT_Err_Invalid_Argument ). example To loop over all faces, use code similar to the following snippet (omitting the error handling). ... FT_Face face; FT_Long i, num_faces; error = FT_Open_Face( library, args, -1, &face ); if ( error ) { ... } num_faces = face->num_faces; FT_Done_Face( face ); for ( i = 0; i < num_faces; i++ ) { ... error = FT_Open_Face( library, args, i, &face ); ... FT_Done_Face( face ); ... } To loop over all valid values for face_index , use something similar to the following snippet, again without error handling. The code accesses all faces immediately (thus only a single call of FT_Open_Face within the do-loop), with and without named instances. ... FT_Face face; FT_Long num_faces = 0; FT_Long num_instances = 0; FT_Long face_idx = 0; FT_Long instance_idx = 0; do { FT_Long id = ( instance_idx << 16 ) + face_idx; error = FT_Open_Face( library, args, id, &face ); if ( error ) { ... } num_faces = face->num_faces; num_instances = face->style_flags >> 16; ... FT_Done_Face( face ); if ( instance_idx < num_instances ) instance_idx++; else { face_idx++; instance_idx = 0; } } while ( face_idx < num_faces ) FT_Open_Args \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Open_Args_ { FT_UInt 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 ; A structure to indicate how to open a new font file or 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, which must be a C string (i.e., no null bytes except at the very end). The pointer is not owned by FreeType. 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 for opening the face. If set to NULL , FreeType tries 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 : If the FT_OPEN_MEMORY bit is set, assume that this is a memory file of memory_size bytes, located at memory_address . The data are not copied, and the client is responsible for releasing and destroying them after the corresponding call to FT_Done_Face . 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 none of the above bits are set or if multiple are set at the same time, the flags are invalid and FT_Open_Face fails. If the FT_OPEN_DRIVER bit is set, FT_Open_Face only tries 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 is used. They are ignored otherwise. Ideally, both the pathname and params fields should be tagged as \u2018const\u2019; this is missing for API backward compatibility. In other words, applications should treat them as read-only. FT_Parameter \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Parameter_ { FT_ULong tag; FT_Pointer data; } FT_Parameter ; A simple structure to pass more or less generic parameters to FT_Open_Face and FT_Face_Properties . fields tag A four-byte identification tag. data A pointer to the parameter data. note The ID and function of parameters are driver-specific. See section \u2018 Parameter Tags \u2019 for more information. FT_Attach_File \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Attach_File ( FT_Face face, const char * filepathname ); Call FT_Attach_Stream to attach a file. inout face The target face object. input filepathname The pathname. return FreeType error code. 0 means success. FT_Attach_Stream \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Attach_Stream ( FT_Face face, FT_Open_Args * parameters ); \u2018Attach\u2019 data to a face object. Normally, this is used to read additional information for the face object. For example, you can attach an AFM file that comes with a Type 1 font to get the kerning values and other metrics. inout face The target face object. input parameters A pointer to FT_Open_Args that must be filled by the caller. return FreeType error code. 0 means success. note The meaning of the \u2018attach\u2019 (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 or stream attachments. FT_Set_Char_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Call FT_Request_Size to request the nominal size (in points). inout face A handle to a target face object. input char_width The nominal width, in 26.6 fractional points. char_height The nominal height, in 26.6 fractional points. horz_resolution The horizontal resolution in dpi. vert_resolution The vertical resolution in dpi. return FreeType error code. 0 means success. note While this function allows fractional points as input values, the resulting ppem value for the given resolution is always rounded to the nearest integer. If either the character width or height is zero, it is set equal to the other value. If either the horizontal or vertical resolution is zero, it is set equal to the other value. A character width or height smaller than 1pt is set to 1pt; if both resolution values are zero, they are set to 72dpi. Don't use this function if you are using the FreeType cache API. FT_Set_Pixel_Sizes \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Set_Pixel_Sizes ( FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height ); Call FT_Request_Size to request the nominal size (in pixels). inout face A handle to the target face object. input pixel_width The nominal width, in pixels. pixel_height The nominal height, in pixels. return FreeType error code. 0 means success. note You should not rely on the resulting glyphs matching or being constrained to this pixel size. Refer to FT_Request_Size to understand how requested sizes relate to actual sizes. Don't use this function if you are using the FreeType cache API. FT_Request_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Request_Size ( FT_Face face, FT_Size_Request req ); Resize the scale of the active FT_Size object in a face. inout face A handle to a target face object. input req A pointer to a FT_Size_RequestRec . return FreeType error code. 0 means success. note Although drivers may select the bitmap strike matching the request, you should not rely on this if you intend to select a particular bitmap strike. Use FT_Select_Size instead in that case. The relation between the requested size and the resulting glyph size is dependent entirely on how the size is defined in the source face. The font designer chooses the final size of each glyph relative to this size. For more information refer to \u2018 https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html \u2019. Contrary to FT_Set_Char_Size , this function doesn't have special code to normalize zero-valued widths, heights, or resolutions, which are treated as FT_LOAD_NO_SCALE . Don't use this function if you are using the FreeType cache API. FT_Select_Size \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Select_Size ( FT_Face face, FT_Int strike_index ); Select a bitmap strike. To be more precise, this function sets the scaling factors of the active FT_Size object in a face so that bitmaps from this particular strike are taken by FT_Load_Glyph and friends. inout face A handle to a target face object. input strike_index The index of the bitmap strike in the available_sizes field of FT_FaceRec structure. return FreeType error code. 0 means success. note For bitmaps embedded in outline fonts it is common that only a subset of the available glyphs at a given ppem value is available. FreeType silently uses outlines if there is no bitmap for a given glyph index. For GX and OpenType variation fonts, a bitmap strike makes sense only if the default instance is active (this is, no glyph variation takes place); otherwise, FreeType simply ignores bitmap strikes. The same is true for all named instances that are different from the default instance. Don't use this function if you are using the FreeType cache API. FT_Size_Request_Type \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef enum FT_Size_Request_Type_ { FT_SIZE_REQUEST_TYPE_NOMINAL , FT_SIZE_REQUEST_TYPE_REAL_DIM , FT_SIZE_REQUEST_TYPE_BBOX , FT_SIZE_REQUEST_TYPE_CELL , FT_SIZE_REQUEST_TYPE_SCALES , FT_SIZE_REQUEST_TYPE_MAX } FT_Size_Request_Type ; An enumeration type that lists the supported size request types, i.e., what input size (in font units) maps to the requested output size (in pixels, as computed from the arguments of FT_Size_Request ). values FT_SIZE_REQUEST_TYPE_NOMINAL The nominal size. The units_per_EM field of FT_FaceRec is used to determine both scaling values. This is the standard scaling found in most applications. In particular, use this size request type for TrueType fonts if they provide optical scaling or something similar. Note, however, that units_per_EM is a rather abstract value which bears no relation to the actual size of the glyphs in a font. FT_SIZE_REQUEST_TYPE_REAL_DIM The real dimension. The sum of the ascender and (minus of) the descender fields of FT_FaceRec is used to determine both scaling values. FT_SIZE_REQUEST_TYPE_BBOX The font bounding box. The width and height of the bbox field of FT_FaceRec are used to determine the horizontal and vertical scaling value, respectively. FT_SIZE_REQUEST_TYPE_CELL The max_advance_width field of FT_FaceRec is used to determine the horizontal scaling value; the vertical scaling value is determined the same way as FT_SIZE_REQUEST_TYPE_REAL_DIM does. Finally, both scaling values are set to the smaller one. This type is useful if you want to specify the font size for, say, a window of a given dimension and 80x24 cells. FT_SIZE_REQUEST_TYPE_SCALES Specify the scaling values directly. note The above descriptions only apply to scalable formats. For bitmap formats, the behaviour is up to the driver. See the note section of FT_Size_Metrics if you wonder how size requesting relates to scaling values. FT_Size_RequestRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_RequestRec_ { FT_Size_Request_Type type; FT_Long width; FT_Long height; FT_UInt horiResolution; FT_UInt vertResolution; } FT_Size_RequestRec ; A structure to model a size request. fields type See FT_Size_Request_Type . width The desired width, given as a 26.6 fractional point value (with 72pt = 1in). height The desired height, given as a 26.6 fractional point value (with 72pt = 1in). horiResolution The horizontal resolution (dpi, i.e., pixels per inch). If set to zero, width is treated as a 26.6 fractional pixel value, which gets internally rounded to an integer. vertResolution The vertical resolution (dpi, i.e., pixels per inch). If set to zero, height is treated as a 26.6 fractional pixel value, which gets internally rounded to an integer. note If width is zero, the horizontal scaling value is set equal to the vertical scaling value, and vice versa. If type is FT_SIZE_REQUEST_TYPE_SCALES , width and height are interpreted directly as 16.16 fractional scaling values, without any further modification, and both horiResolution and vertResolution are ignored. FT_Size_Request \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_RequestRec_ * FT_Size_Request ; A handle to a size request structure. FT_Set_Transform \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Set_Transform ( FT_Face face, FT_Matrix * matrix, FT_Vector * delta ); Set the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph . inout face A handle to the source face object. input matrix A pointer to the transformation's 2x2 matrix. Use NULL for the identity matrix. delta A pointer to the translation vector. Use NULL for the null vector. note This function is provided as a convenience, but keep in mind that FT_Matrix coefficients are only 16.16 fixed-point values, which can limit the accuracy of the results. Using floating-point computations to perform the transform directly in client code instead will always yield better numbers. 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_Size or FT_Set_Pixel_Sizes . Note that this also transforms the face.glyph.advance field, but not the values in face.glyph.metrics . FT_Get_Transform \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Get_Transform ( FT_Face face, FT_Matrix * matrix, FT_Vector * delta ); Return the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph . See FT_Set_Transform for more details. input face A handle to the source face object. output matrix A pointer to a transformation's 2x2 matrix. Set this to NULL if you are not interested in the value. delta A pointer a translation vector. Set this to NULL if you are not interested in the value. since 2.11 FT_Load_Glyph \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Load_Glyph ( FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags ); Load a glyph into the glyph slot of a face object. inout face A handle to the target face object where the glyph is loaded. input glyph_index The index of the glyph in the font file. For CID-keyed fonts (either in PS or in CFF format) this argument specifies the CID value. load_flags A flag indicating what to load for this glyph. The FT_LOAD_XXX flags 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 For proper scaling and hinting, the active FT_Size object owned by the face has to be meaningfully initialized by calling FT_Set_Char_Size before this function, for example. The loaded glyph may be transformed. See FT_Set_Transform for the details. For subsetted CID-keyed fonts, FT_Err_Invalid_Argument is returned for invalid CID values (this is, for CID values that don't have a corresponding glyph in the font). See the discussion of the FT_FACE_FLAG_CID_KEYED flag for more details. If you receive FT_Err_Glyph_Too_Big , try getting the glyph outline at EM size, then scale it manually and fill it as a graphics operation. FT_Get_Char_Index \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Get_Char_Index ( FT_Face face, FT_ULong charcode ); Return the glyph index of a given character code. This function uses the currently selected charmap to do the mapping. input face A handle to the source face object. charcode The character code. return The glyph index. 0 means \u2018undefined character code\u2019. note If you use FreeType to manipulate the contents of font files directly, be aware that the glyph index returned by this function doesn't always correspond to the internal indices used within the file. This is done to ensure that value 0 always corresponds to the \u2018missing glyph\u2019. If the first glyph is not named \u2018.notdef\u2019, then for Type 1 and Type 42 fonts, \u2018.notdef\u2019 will be moved into the glyph ID 0 position, and whatever was there will be moved to the position \u2018.notdef\u2019 had. For Type 1 fonts, if there is no \u2018.notdef\u2019 glyph at all, then one will be created at index 0 and whatever was there will be moved to the last index \u2013 Type 42 fonts are considered invalid under this condition. FT_Get_First_Char \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_ULong ) FT_Get_First_Char ( FT_Face face, FT_UInt *agindex ); Return the first character code in the current charmap of a given face, together with its 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 together with FT_Get_Next_Char 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 ); } Be aware that character codes can have values up to 0xFFFFFFFF; this might happen for non-Unicode or malformed cmaps. However, even with regular Unicode encoding, so-called \u2018last resort fonts\u2019 (using SFNT cmap format 13, see function FT_Get_CMap_Format ) normally have entries for all Unicode characters up to 0x1FFFFF, which can cause a lot of iterations. Note that *agindex is set to 0 if the charmap is empty. The result itself can be 0 in two cases: if the charmap is empty or if the value 0 is the first valid character code. FT_Get_Next_Char \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_ULong ) FT_Get_Next_Char ( FT_Face face, FT_ULong char_code, FT_UInt *agindex ); 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 next 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 over all character codes available in a given charmap. See the note for that function for a simple code example. Note that *agindex is set to 0 when there are no more codes in the charmap. FT_Get_Name_Index \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Get_Name_Index ( FT_Face face, const FT_String * glyph_name ); Return the glyph index of a given glyph name. input face A handle to the source face object. glyph_name The glyph name. return The glyph index. 0 means \u2018undefined character code\u2019. FT_Load_Char \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Load_Char ( FT_Face face, FT_ULong char_code, FT_Int32 load_flags ); Load a glyph into the glyph slot of a face object, accessed by its character code. inout face A handle to a target face object where the glyph is 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 This function simply calls FT_Get_Char_Index and FT_Load_Glyph . Many fonts contain glyphs that can't be loaded by this function since its glyph indices are not listed in any of the font's charmaps. If no active cmap is set up (i.e., face->charmap is zero), the call to FT_Get_Char_Index is omitted, and the function behaves identically to FT_Load_Glyph . FT_LOAD_TARGET_MODE \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_TARGET_MODE ( x ) \\ FT_STATIC_CAST( FT_Render_Mode , ( (x) >> 16 ) & 15 ) Return the FT_Render_Mode corresponding to a given FT_LOAD_TARGET_XXX value. FT_Render_Glyph \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Render_Glyph ( FT_GlyphSlot slot, FT_Render_Mode render_mode ); Convert a given glyph image to a bitmap. It does so by inspecting the glyph image format, finding the relevant renderer, and invoking it. inout slot A handle to the glyph slot containing the image to convert. input render_mode The render mode used to render the glyph image into a bitmap. See FT_Render_Mode for a list of possible values. If FT_RENDER_MODE_NORMAL is used, a previous call of FT_Load_Glyph with flag FT_LOAD_COLOR makes FT_Render_Glyph provide a default blending of colored glyph layers associated with the current glyph slot (provided the font contains such layers) instead of rendering the glyph slot's outline. This is an experimental feature; see FT_LOAD_COLOR for more information. return FreeType error code. 0 means success. note When FreeType outputs a bitmap of a glyph, it really outputs an alpha coverage map. If a pixel is completely covered by a filled-in outline, the bitmap contains 0xFF at that pixel, meaning that 0xFF/0xFF fraction of that pixel is covered, meaning the pixel is 100% black (or 0% bright). If a pixel is only 50% covered (value 0x80), the pixel is made 50% black (50% bright or a middle shade of grey). 0% covered means 0% black (100% bright or white). On high-DPI screens like on smartphones and tablets, the pixels are so small that their chance of being completely covered and therefore completely black are fairly good. On the low-DPI screens, however, the situation is different. The pixels are too large for most of the details of a glyph and shades of gray are the norm rather than the exception. This is relevant because all our screens have a second problem: they are not linear. 1 + 1 is not 2. Twice the value does not result in twice the brightness. When a pixel is only 50% covered, the coverage map says 50% black, and this translates to a pixel value of 128 when you use 8 bits per channel (0-255). However, this does not translate to 50% brightness for that pixel on our sRGB and gamma 2.2 screens. Due to their non-linearity, they dwell longer in the darks and only a pixel value of about 186 results in 50% brightness \u2013 128 ends up too dark on both bright and dark backgrounds. The net result is that dark text looks burnt-out, pixely and blotchy on bright background, bright text too frail on dark backgrounds, and colored text on colored background (for example, red on green) seems to have dark halos or \u2018dirt\u2019 around it. The situation is especially ugly for diagonal stems like in \u2018w\u2019 glyph shapes where the quality of FreeType's anti-aliasing depends on the correct display of grays. On high-DPI screens where smaller, fully black pixels reign supreme, this doesn't matter, but on our low-DPI screens with all the gray shades, it does. 0% and 100% brightness are the same things in linear and non-linear space, just all the shades in-between aren't. The blending function for placing text over a background is dst = alpha * src + (1 - alpha) * dst , which is known as the OVER operator. To correctly composite an anti-aliased pixel of a glyph onto a surface, take the foreground and background colors (e.g., in sRGB space) and apply gamma to get them in a linear space, use OVER to blend the two linear colors using the glyph pixel as the alpha value (remember, the glyph bitmap is an alpha coverage bitmap), and apply inverse gamma to the blended pixel and write it back to the image. Internal testing at Adobe found that a target inverse gamma of 1.8 for step 3 gives good results across a wide range of displays with an sRGB gamma curve or a similar one. This process can cost performance. There is an approximation that does not need to know about the background color; see https://bel.fi/alankila/lcd/ and https://bel.fi/alankila/lcd/alpcor.html for details. ATTENTION : Linear blending is even more important when dealing with subpixel-rendered glyphs to prevent color-fringing! A subpixel-rendered glyph must first be filtered with a filter that gives equal weight to the three color primaries and does not exceed a sum of 0x100, see section \u2018 Subpixel Rendering \u2019. Then the only difference to gray linear blending is that subpixel-rendered linear blending is done 3 times per pixel: red foreground subpixel to red background subpixel and so on for green and blue. FT_Render_Mode \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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_SDF , FT_RENDER_MODE_MAX } FT_Render_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Render_Mode ` values instead */ # define ft_render_mode_normal FT_RENDER_MODE_NORMAL # define ft_render_mode_mono FT_RENDER_MODE_MONO Render modes supported by FreeType 2. Each mode corresponds to a specific type of scanline conversion performed on the outline. For bitmap fonts and embedded bitmaps the bitmap->pixel_mode field in the FT_GlyphSlotRec structure gives the format of the returned bitmap. All modes except FT_RENDER_MODE_MONO use 256 levels of opacity, indicating pixel coverage. Use linear alpha blending and gamma correction to correctly render non-monochrome glyph bitmaps onto a surface; see FT_Render_Glyph . The FT_RENDER_MODE_SDF is a special render mode that uses up to 256 distance values, indicating the signed distance from the grid position to the nearest outline. values FT_RENDER_MODE_NORMAL Default render mode; it corresponds to 8-bit anti-aliased bitmaps. FT_RENDER_MODE_LIGHT This is equivalent to FT_RENDER_MODE_NORMAL . It is only defined as a separate value because render modes are also used indirectly to define hinting algorithm selectors. See FT_LOAD_TARGET_XXX for details. FT_RENDER_MODE_MONO This mode corresponds to 1-bit bitmaps (with 2 levels of opacity). FT_RENDER_MODE_LCD This mode corresponds to horizontal RGB and BGR subpixel 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. FT_RENDER_MODE_LCD_V This mode corresponds to vertical RGB and BGR subpixel 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. FT_RENDER_MODE_SDF This mode corresponds to 8-bit, single-channel signed distance field (SDF) bitmaps. Each pixel in the SDF grid is the value from the pixel's position to the nearest glyph's outline. The distances are calculated from the center of the pixel and are positive if they are filled by the outline (i.e., inside the outline) and negative otherwise. Check the note below on how to convert the output values to usable data. note The selected render mode only affects vector glyphs of a font. Embedded bitmaps often have a different pixel mode like FT_PIXEL_MODE_MONO . You can use FT_Bitmap_Convert to transform them into 8-bit pixmaps. For FT_RENDER_MODE_SDF the output bitmap buffer contains normalized distances that are packed into unsigned 8-bit values. To get pixel values in floating point representation use the following pseudo-C code for the conversion. // Load glyph and render using FT_RENDER_MODE_SDF, // then use the output buffer as follows. ... FT_Byte buffer = glyph->bitmap->buffer; for pixel in buffer { // `sd` is the signed distance and `spread` is the current spread; // the default spread is 2 and can be changed. float sd = (float)pixel - 128.0f; // Convert to pixel values. sd = ( sd / 128.0f ) * spread; // Store `sd` in a buffer or use as required. } FreeType has two rasterizers for generating SDF, namely: sdf for generating SDF directly from glyph's outline, and bsdf for generating SDF from rasterized bitmaps. Depending on the glyph type (i.e., outline or bitmap), one of the two rasterizers is chosen at runtime and used for generating SDFs. To force the use of bsdf you should render the glyph with any of the FreeType's other rendering modes (e.g., FT_RENDER_MODE_NORMAL ) and then re-render with FT_RENDER_MODE_SDF . There are some issues with stability and possible failures of the SDF renderers (specifically sdf ). The sdf rasterizer is sensitive to really small features (e.g., sharp turns that are less than 1 pixel) and imperfections in the glyph's outline, causing artifacts in the final output. The sdf rasterizer has limited support for handling intersecting contours and cannot handle self-intersecting contours whatsoever. Self-intersection happens when a single connected contour intersect itself at some point; having these in your font definitely pose a problem to the rasterizer and cause artifacts, too. Generating SDF for really small glyphs may result in undesirable output; the pixel grid (which stores distance information) becomes too coarse. Since the output buffer is normalized, precision at smaller spreads is greater than precision at larger spread values because the output range of [0..255] gets mapped to a smaller SDF range. A spread of 2 should be sufficient in most cases. Points (1) and (2) can be avoided by using the bsdf rasterizer, which is more stable than the sdf rasterizer in general. FT_Get_Kerning \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Return the kerning vector between two glyphs of the 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 and dimension of the returned kerning vector. output akerning The kerning vector. This is either in font units, fractional pixels (26.6 format), or pixels 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 \u2013 they can be implemented through format-specific interfaces. Kerning for OpenType fonts implemented in a \u2018GPOS\u2019 table is not supported; use FT_HAS_KERNING to find out whether a font has data that can be extracted with FT_Get_Kerning . FT_Kerning_Mode \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef enum FT_Kerning_Mode_ { FT_KERNING_DEFAULT = 0, FT_KERNING_UNFITTED , FT_KERNING_UNSCALED } FT_Kerning_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Kerning_Mode ` values instead */ # define ft_kerning_default FT_KERNING_DEFAULT # define ft_kerning_unfitted FT_KERNING_UNFITTED # define ft_kerning_unscaled FT_KERNING_UNSCALED An enumeration to specify the format of kerning values returned by FT_Get_Kerning . values FT_KERNING_DEFAULT Return grid-fitted kerning distances in 26.6 fractional pixels. FT_KERNING_UNFITTED Return un-grid-fitted kerning distances in 26.6 fractional pixels. FT_KERNING_UNSCALED Return the kerning vector in original font units. note FT_KERNING_DEFAULT returns full pixel values; it also makes FreeType heuristically scale down kerning distances at small ppem values so that they don't become too big. Both FT_KERNING_DEFAULT and FT_KERNING_UNFITTED use the current horizontal scaling factor (as set e.g. with FT_Set_Char_Size ) to convert font units to pixels. FT_Get_Track_Kerning \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_Track_Kerning ( FT_Face face, FT_Fixed point_size, FT_Int degree, FT_Fixed * akerning ); Return the track kerning for a given face object at a given size. input face A handle to a source face object. point_size The point size in 16.16 fractional points. degree The degree of tightness. Increasingly negative values represent tighter track kerning, while increasingly positive values represent looser track kerning. Value zero means no track kerning. output akerning The kerning in 16.16 fractional points, to be uniformly applied between all glyphs. return FreeType error code. 0 means success. note Currently, only the Type 1 font driver supports track kerning, using data from AFM files (if attached with FT_Attach_File or FT_Attach_Stream ). Only very few AFM files come with track kerning data; please refer to Adobe's AFM specification for more details. FT_Get_Glyph_Name \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_Glyph_Name ( FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max ); Retrieve the ASCII name of a given glyph in a face. This only works for those faces where FT_HAS_GLYPH_NAMES (face) returns 1. input face A handle to a source face object. glyph_index The glyph index. buffer_max The maximum number of bytes available in the buffer. output buffer A pointer to a target buffer where the name is 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 is 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. Be aware that FreeType reorders glyph indices internally so that glyph index 0 always corresponds to the \u2018missing glyph\u2019 (called \u2018.notdef\u2019). This function always returns an error if the config macro FT_CONFIG_OPTION_NO_GLYPH_NAMES is not defined in ftoption.h . FT_Get_Postscript_Name \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( const char * ) FT_Get_Postscript_Name ( FT_Face face ); Retrieve the ASCII PostScript name of a given face, if available. This only works with PostScript, TrueType, and OpenType fonts. input face A handle to the source face object. return A pointer to the face's PostScript name. NULL if unavailable. note The returned pointer is owned by the face and is destroyed with it. For variation fonts, this string changes if you select a different instance, and you have to call FT_Get_PostScript_Name again to retrieve it. FreeType follows Adobe TechNote #5902, \u2018Generating PostScript Names for Fonts Using OpenType Font Variations\u2019. https://download.macromedia.com/pub/developer/opentype/tech-notes/5902.AdobePSNameGeneration.html [Since 2.9] Special PostScript names for named instances are only returned if the named instance is set with FT_Set_Named_Instance (and the font has corresponding entries in its \u2018fvar\u2019 table). If FT_IS_VARIATION returns true, the algorithmically derived PostScript name is provided, not looking up special entries for named instances. FT_CharMapRec \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_CharMapRec_ { FT_Face face; FT_Encoding encoding; FT_UShort platform_id; FT_UShort encoding_id; } FT_CharMapRec ; 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 gets emulated for other formats. encoding_id A platform-specific encoding number. This also comes from the TrueType specification and gets emulated similarly. FT_Select_Charmap \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Select_Charmap ( FT_Face face, FT_Encoding encoding ); Select 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 encoding. return FreeType error code. 0 means success. note This function returns an error if no charmap in the face corresponds to the encoding queried here. Because many fonts contain more than a single cmap for Unicode encoding, this function has some special code to select the one that covers Unicode best (\u2018best\u2019 in the sense that a UCS-4 cmap is preferred to a UCS-2 cmap). It is thus preferable to FT_Set_Charmap in this case. FT_Set_Charmap \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Set_Charmap ( FT_Face face, FT_CharMap charmap ); Select a given charmap for character code to glyph index mapping. 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 returns an error if the charmap is not part of the face (i.e., if it is not listed in the face->charmaps table). It also fails if an OpenType type 14 charmap is selected (which doesn't map character codes to glyph indices at all). FT_Get_Charmap_Index \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Int ) FT_Get_Charmap_Index ( FT_CharMap charmap ); Retrieve index of a given charmap. input charmap A handle to a charmap. return The index into the array of character maps within the face to which charmap belongs. If an error occurs, -1 is returned. FT_Get_FSType_Flags \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UShort ) FT_Get_FSType_Flags ( FT_Face face ); Return the fsType flags for a font. input face A handle to the source face object. return The fsType flags, see FT_FSTYPE_XXX . note Use this function rather than directly reading the fs_type field in the PS_FontInfoRec structure, which is only guaranteed to return the correct results for Type 1 fonts. since 2.3.8 FT_Get_SubGlyph_Info \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_SubGlyph_Info ( FT_GlyphSlot glyph, FT_UInt sub_index, FT_Int *p_index, FT_UInt *p_flags, FT_Int *p_arg1, FT_Int *p_arg2, FT_Matrix *p_transform ); Retrieve a description of a given subglyph. Only use it if glyph->format is FT_GLYPH_FORMAT_COMPOSITE ; an error is returned otherwise. input glyph The source glyph slot. sub_index The index of the subglyph. Must be less than glyph->num_subglyphs . output p_index The glyph index of the subglyph. p_flags The subglyph flags, see FT_SUBGLYPH_FLAG_XXX . p_arg1 The subglyph's first argument (if any). p_arg2 The subglyph's second argument (if any). p_transform The subglyph transformation (if any). return FreeType error code. 0 means success. note The values of *p_arg1 , *p_arg2 , and *p_transform must be interpreted depending on the flags returned in *p_flags . See the OpenType specification for details. https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description FT_Face_Internal \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Face_InternalRec_* FT_Face_Internal ; An opaque handle to an FT_Face_InternalRec structure that models the 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. FT_Size_Internal \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_InternalRec_* FT_Size_Internal ; An opaque handle to an FT_Size_InternalRec structure, used to model private data of a given FT_Size object. FT_Slot_Internal \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Slot_InternalRec_* FT_Slot_Internal ; An opaque handle to an FT_Slot_InternalRec structure, used to model private data of a given FT_GlyphSlot object. FT_FACE_FLAG_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # 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 ) # define FT_FACE_FLAG_HINTER ( 1L << 11 ) # define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) # define FT_FACE_FLAG_TRICKY ( 1L << 13 ) # define FT_FACE_FLAG_COLOR ( 1L << 14 ) # define FT_FACE_FLAG_VARIATION ( 1L << 15 ) # define FT_FACE_FLAG_SVG ( 1L << 16 ) # define FT_FACE_FLAG_SBIX ( 1L << 17 ) # define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 ) 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 The face contains outline glyphs. Note that a face can contain bitmap strikes also, i.e., a face can have both this flag and FT_FACE_FLAG_FIXED_SIZES set. FT_FACE_FLAG_FIXED_SIZES The face contains bitmap strikes. See also the num_fixed_sizes and available_sizes fields of FT_FaceRec . FT_FACE_FLAG_FIXED_WIDTH The face contains fixed-width characters (like Courier, Lucida, MonoType, etc.). FT_FACE_FLAG_SFNT The face uses the SFNT storage scheme. For now, this means TrueType and OpenType. FT_FACE_FLAG_HORIZONTAL The face contains horizontal glyph metrics. This should be set for all common formats. FT_FACE_FLAG_VERTICAL The face contains vertical glyph metrics. This is only available in some formats, not all of them. FT_FACE_FLAG_KERNING The face contains kerning information. If set, the kerning distance can be retrieved using the function FT_Get_Kerning . Otherwise the function always return the vector (0,0). Note that FreeType doesn't handle kerning data from the SFNT \u2018GPOS\u2019 table (as present in many OpenType fonts). FT_FACE_FLAG_FAST_GLYPHS THIS FLAG IS DEPRECATED. DO NOT USE OR TEST IT. FT_FACE_FLAG_MULTIPLE_MASTERS The face contains multiple masters and is capable of interpolating between them. Supported formats are Adobe MM, TrueType GX, and OpenType variation fonts. See section \u2018 Multiple Masters \u2019 for API details. FT_FACE_FLAG_GLYPH_NAMES The face contains glyph names, which can be retrieved using FT_Get_Glyph_Name . Note that some TrueType fonts contain broken glyph name tables. Use the function FT_Has_PS_Glyph_Names 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. FT_FACE_FLAG_HINTER The font driver has a hinting machine of its own. For example, with TrueType fonts, it makes sense to use data from the SFNT \u2018gasp\u2019 table only if the native TrueType hinting engine (with the bytecode interpreter) is available and active. FT_FACE_FLAG_CID_KEYED The face is CID-keyed. In that case, the face is not accessed by glyph indices but by CID values. For subsetted CID-keyed fonts this has the consequence that not all index values are a valid argument to FT_Load_Glyph . Only the CID values for which corresponding glyphs in the subsetted font exist make FT_Load_Glyph return successfully; in all other cases you get an FT_Err_Invalid_Argument error. Note that CID-keyed fonts that are in an SFNT wrapper (this is, all OpenType/CFF fonts) don't have this flag set since the glyphs are accessed in the normal way (using contiguous indices); the \u2018CID-ness\u2019 isn't visible to the application. FT_FACE_FLAG_TRICKY The face is \u2018tricky\u2019, this is, it always needs the font format's native hinting engine to get a reasonable result. A typical example is the old Chinese font mingli.ttf (but not mingliu.ttc ) that uses TrueType bytecode instructions to move and scale all of its subglyphs. It is not possible to auto-hint such fonts using FT_LOAD_FORCE_AUTOHINT ; it will also ignore FT_LOAD_NO_HINTING . You have to set both FT_LOAD_NO_HINTING and FT_LOAD_NO_AUTOHINT to really disable hinting; however, you probably never want this except for demonstration purposes. Currently, there are about a dozen TrueType fonts in the list of tricky fonts; they are hard-coded in file ttobjs.c . FT_FACE_FLAG_COLOR [Since 2.5.1] The face has color glyph tables. See FT_LOAD_COLOR for more information. FT_FACE_FLAG_VARIATION [Since 2.9] Set if the current face (or named instance) has been altered with FT_Set_MM_Design_Coordinates , FT_Set_Var_Design_Coordinates , or FT_Set_Var_Blend_Coordinates . This flag is unset by a call to FT_Set_Named_Instance . FT_FACE_FLAG_SVG [Since 2.12] The face has an \u2018SVG \u2019 OpenType table. FT_FACE_FLAG_SBIX [Since 2.12] The face has an \u2018sbix\u2019 OpenType table and outlines. For such fonts, FT_FACE_FLAG_SCALABLE is not set by default to retain backward compatibility. FT_FACE_FLAG_SBIX_OVERLAY [Since 2.12] The face has an \u2018sbix\u2019 OpenType table where outlines should be drawn on top of bitmap strikes. FT_STYLE_FLAG_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) # define FT_STYLE_FLAG_BOLD ( 1 << 1 ) A list of bit flags to indicate the style of a given face. These are used in the style_flags field of FT_FaceRec . values FT_STYLE_FLAG_ITALIC The face style is italic or oblique. FT_STYLE_FLAG_BOLD The face is bold. note The style information as provided by FreeType is very basic. More details are beyond the scope and should be done on a higher level (for example, by analyzing various fields of the \u2018OS/2\u2019 table in SFNT based fonts). FT_OPEN_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_OPEN_MEMORY 0x1 # define FT_OPEN_STREAM 0x2 # define FT_OPEN_PATHNAME 0x4 # define FT_OPEN_DRIVER 0x8 # define FT_OPEN_PARAMS 0x10 /* these constants are deprecated; use the corresponding ` FT_OPEN_XXX ` */ /* values instead */ # 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 A list of bit field constants used within the flags field of the FT_Open_Args structure. values 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 and params fields. note The FT_OPEN_MEMORY , FT_OPEN_STREAM , and FT_OPEN_PATHNAME flags are mutually exclusive. FT_LOAD_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_DEFAULT 0x0 # define FT_LOAD_NO_SCALE ( 1L << 0 ) # define FT_LOAD_NO_HINTING ( 1L << 1 ) # define FT_LOAD_RENDER ( 1L << 2 ) # define FT_LOAD_NO_BITMAP ( 1L << 3 ) # define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 ) # define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 ) # define FT_LOAD_CROP_BITMAP ( 1L << 6 ) # define FT_LOAD_PEDANTIC ( 1L << 7 ) # define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 ) # define FT_LOAD_NO_RECURSE ( 1L << 10 ) # define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 ) # define FT_LOAD_MONOCHROME ( 1L << 12 ) # define FT_LOAD_LINEAR_DESIGN ( 1L << 13 ) # define FT_LOAD_SBITS_ONLY ( 1L << 14 ) # define FT_LOAD_NO_AUTOHINT ( 1L << 15 ) /* Bits 16-19 are used by `FT_LOAD_TARGET_` */ # define FT_LOAD_COLOR ( 1L << 20 ) # define FT_LOAD_COMPUTE_METRICS ( 1L << 21 ) # define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 ) A list of bit field constants for 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 as the default glyph load operation. In this case, the following happens: 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). If no embedded bitmap is searched for or found, FreeType looks for a scalable outline. If one is found, it is loaded from the font file, scaled to device pixels, then \u2018hinted\u2019 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 loaded outline glyph but keep it in font units. This flag is also assumed if FT_Size owned by the face was not properly initialized. This flag implies FT_LOAD_NO_HINTING and FT_LOAD_NO_BITMAP , and unsets FT_LOAD_RENDER . If the font is \u2018tricky\u2019 (see FT_FACE_FLAG_TRICKY for more), using FT_LOAD_NO_SCALE usually yields meaningless outlines because the subglyphs must be scaled and positioned with hinting instructions. This can be solved by loading the font without FT_LOAD_NO_SCALE and setting the character size to font->units_per_EM . FT_LOAD_NO_HINTING Disable hinting. This generally generates \u2018blurrier\u2019 bitmap glyphs when the glyph are rendered in any of the anti-aliased modes. See also the note below. This flag is implied by FT_LOAD_NO_SCALE . FT_LOAD_RENDER Call FT_Render_Glyph after the glyph is loaded. By default, the glyph is rendered in FT_RENDER_MODE_NORMAL mode. This can be overridden by FT_LOAD_TARGET_XXX or FT_LOAD_MONOCHROME . This flag is unset by FT_LOAD_NO_SCALE . FT_LOAD_NO_BITMAP Ignore bitmap strikes when loading. Bitmap-only fonts ignore this flag. FT_LOAD_NO_SCALE always sets this flag. FT_LOAD_SBITS_ONLY [Since 2.12] This is the opposite of FT_LOAD_NO_BITMAP , more or less: FT_Load_Glyph returns FT_Err_Invalid_Argument if the face contains a bitmap strike for the given size (or the strike selected by FT_Select_Size ) but there is no glyph in the strike. Note that this load flag was part of FreeType since version 2.0.6 but previously tagged as internal. FT_LOAD_VERTICAL_LAYOUT Load the glyph for vertical text layout. In particular, the advance value in the FT_GlyphSlotRec structure is set to the vertAdvance value of the metrics field. In case FT_HAS_VERTICAL doesn't return true, you shouldn't use this flag currently. Reason is that in this case vertical metrics get synthesized, and those values are not always consistent across various font formats. FT_LOAD_FORCE_AUTOHINT Prefer the auto-hinter over the font's native hinter. See also the note below. FT_LOAD_PEDANTIC Make the font driver perform pedantic verifications during glyph loading and hinting. This is mostly used to detect broken glyphs in fonts. By default, FreeType tries to handle broken fonts also. In particular, errors from the TrueType bytecode engine are not passed to the application if this flag is not set; this might result in partially hinted or distorted glyphs in case a glyph's bytecode is buggy. FT_LOAD_NO_RECURSE Don't load composite glyphs recursively. Instead, the font driver fills the num_subglyph and subglyphs values of the glyph slot; it also sets glyph->format to FT_GLYPH_FORMAT_COMPOSITE . The description of subglyphs can then be accessed with FT_Get_SubGlyph_Info . Don't use this flag for retrieving metrics information since some font drivers only return rudimentary data. This flag implies FT_LOAD_NO_SCALE and FT_LOAD_IGNORE_TRANSFORM . FT_LOAD_IGNORE_TRANSFORM Ignore the transform matrix set by FT_Set_Transform . FT_LOAD_MONOCHROME This flag is used with FT_LOAD_RENDER to indicate that you want to render an outline glyph to a 1-bit monochrome bitmap glyph, with 8 pixels packed into each byte of the bitmap data. Note that this has no effect on the hinting algorithm used. You should rather use FT_LOAD_TARGET_MONO so that the monochrome-optimized hinting algorithm is used. FT_LOAD_LINEAR_DESIGN Keep linearHoriAdvance and linearVertAdvance fields of FT_GlyphSlotRec in font units. See FT_GlyphSlotRec for details. FT_LOAD_NO_AUTOHINT Disable the auto-hinter. See also the note below. FT_LOAD_COLOR Load colored glyphs. FreeType searches in the following order; there are slight differences depending on the font format. [Since 2.5] Load embedded color bitmap images (provided FT_LOAD_NO_BITMAP is not set). The resulting color bitmaps, if available, have the FT_PIXEL_MODE_BGRA format, with pre-multiplied color channels. If the flag is not set and color bitmaps are found, they are converted to 256-level gray bitmaps, using the FT_PIXEL_MODE_GRAY format. [Since 2.12] If the glyph index maps to an entry in the face's \u2018SVG \u2019 table, load the associated SVG document from this table and set the format field of FT_GlyphSlotRec to FT_GLYPH_FORMAT_SVG . Note that FreeType itself can't render SVG documents; however, the library provides hooks to seamlessly integrate an external renderer. See sections \u2018 The SVG driver \u2019 and \u2018 OpenType SVG Fonts \u2019 for more. [Since 2.10, experimental] If the glyph index maps to an entry in the face's \u2018COLR\u2019 table with a \u2018CPAL\u2019 palette table (as defined in the OpenType specification), make FT_Render_Glyph provide a default blending of the color glyph layers associated with the glyph index, using the same bitmap format as embedded color bitmap images. This is mainly for convenience and works only for glyphs in \u2018COLR\u2019 v0 tables (or glyphs in \u2018COLR\u2019 v1 tables that exclusively use v0 features). For full control of color layers use FT_Get_Color_Glyph_Layer and FreeType's color functions like FT_Palette_Select instead of setting FT_LOAD_COLOR for rendering so that the client application can handle blending by itself. FT_LOAD_COMPUTE_METRICS [Since 2.6.1] Compute glyph metrics from the glyph data, without the use of bundled metrics tables (for example, the \u2018hdmx\u2019 table in TrueType fonts). This flag is mainly used by font validating or font editing applications, which need to ignore, verify, or edit those tables. Currently, this flag is only implemented for TrueType fonts. FT_LOAD_BITMAP_METRICS_ONLY [Since 2.7.1] Request loading of the metrics and bitmap image information of a (possibly embedded) bitmap glyph without allocating or copying the bitmap image data itself. No effect if the target glyph is not a bitmap image. This flag unsets FT_LOAD_RENDER . FT_LOAD_CROP_BITMAP Ignored. Deprecated. FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH Ignored. Deprecated. note By default, hinting is enabled and the font's native hinter (see FT_FACE_FLAG_HINTER ) is preferred over the auto-hinter. You can disable hinting by setting FT_LOAD_NO_HINTING or change the precedence by setting FT_LOAD_FORCE_AUTOHINT . You can also set FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be used at all. See the description of FT_FACE_FLAG_TRICKY for a special exception (affecting only a handful of Asian fonts). Besides deciding which hinter to use, you can also decide which hinting algorithm to use. See FT_LOAD_TARGET_XXX for details. Note that the auto-hinter needs a valid Unicode cmap (either a native one or synthesized by FreeType) for producing correct results. If a font provides an incorrect mapping (for example, assigning the character code U+005A, LATIN CAPITAL LETTER Z, to a glyph depicting a mathematical integral sign), the auto-hinter might produce useless results. FT_LOAD_TARGET_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_TARGET_( x ) ( FT_STATIC_CAST( FT_Int32 , (x) & 15 ) << 16 ) # 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 ) A list of values to select a specific hinting algorithm for the hinter. You should OR one of these values to your load_flags when calling FT_Load_Glyph . Note that a font's native hinters may ignore the hinting algorithm you have specified (e.g., the TrueType bytecode interpreter). You can set FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used. values FT_LOAD_TARGET_NORMAL The default hinting algorithm, optimized for standard gray-level rendering. For monochrome output, use FT_LOAD_TARGET_MONO instead. FT_LOAD_TARGET_LIGHT A lighter hinting algorithm for gray-level modes. Many generated glyphs are fuzzier but better resemble their original shape. This is achieved by snapping glyphs to the pixel grid only vertically (Y-axis), as is done by FreeType's new CFF engine or Microsoft's ClearType font renderer. This preserves inter-glyph spacing in horizontal text. The snapping is done either by the native font driver, if the driver itself and the font support it, or by the auto-hinter. Advance widths are rounded to integer values; however, using the lsb_delta and rsb_delta fields of FT_GlyphSlotRec , it is possible to get fractional advance widths for subpixel positioning (which is recommended to use). If configuration option AF_CONFIG_OPTION_TT_SIZE_METRICS is active, TrueType-like metrics are used to make this mode behave similarly as in unpatched FreeType versions between 2.4.6 and 2.7.1 (inclusive). FT_LOAD_TARGET_MONO Strong hinting algorithm that should only be used for monochrome output. The result is probably unpleasant if the glyph is rendered in non-monochrome modes. Note that for outline fonts only the TrueType font driver has proper monochrome hinting support, provided the TTFs contain hints for B/W rendering (which most fonts no longer provide). If these conditions are not met it is very likely that you get ugly results at smaller sizes. FT_LOAD_TARGET_LCD A variant of FT_LOAD_TARGET_LIGHT optimized for horizontally decimated LCD displays. FT_LOAD_TARGET_LCD_V A variant of FT_LOAD_TARGET_NORMAL optimized for vertically decimated LCD displays. note You should use only one of the FT_LOAD_TARGET_XXX values in your load_flags . They can't be ORed. If FT_LOAD_RENDER is also set, the glyph is rendered in the corresponding mode (i.e., the mode that matches the used algorithm best). An exception is FT_LOAD_TARGET_MONO since it implies FT_LOAD_MONOCHROME . You can use a hinting algorithm that doesn't correspond to the same rendering mode. As an example, it is possible to use the \u2018light\u2019 hinting algorithm and have the results rendered in horizontal LCD pixel mode, with code like FT_Load_Glyph( face, glyph_index, load_flags | FT_LOAD_TARGET_LIGHT ); FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD ); In general, you should stick with one rendering mode. For example, switching between FT_LOAD_TARGET_NORMAL and FT_LOAD_TARGET_MONO enforces a lot of recomputation for TrueType fonts, which is slow. Another reason is caching: Selecting a different mode usually causes changes in both the outlines and the rasterized bitmaps; it is thus necessary to empty the cache after a mode switch to avoid false hits. FT_SUBGLYPH_FLAG_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 # define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 # define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 # define FT_SUBGLYPH_FLAG_SCALE 8 # define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 # define FT_SUBGLYPH_FLAG_2X2 0x80 # define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 A list of constants describing subglyphs. Please refer to the \u2018glyf\u2019 table description in the OpenType specification for the meaning of the various flags (which get synthesized for non-OpenType subglyphs). https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description values FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID FT_SUBGLYPH_FLAG_SCALE FT_SUBGLYPH_FLAG_XY_SCALE FT_SUBGLYPH_FLAG_2X2 FT_SUBGLYPH_FLAG_USE_MY_METRICS FT_FSTYPE_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000 # define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002 # define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004 # define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008 # define FT_FSTYPE_NO_SUBSETTING 0x0100 # define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200 A list of bit flags used in the fsType field of the OS/2 table in a TrueType or OpenType font and the FSType entry in a PostScript font. These bit flags are returned by FT_Get_FSType_Flags ; they inform client applications of embedding and subsetting restrictions associated with a font. See https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf for more details. values FT_FSTYPE_INSTALLABLE_EMBEDDING Fonts with no fsType bit set may be embedded and permanently installed on the remote system by an application. FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING Fonts that have only this bit set must not be modified, embedded or exchanged in any manner without first obtaining permission of the font software copyright owner. FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING The font may be embedded and temporarily loaded on the remote system. Documents containing Preview & Print fonts must be opened \u2018read-only\u2019; no edits can be applied to the document. FT_FSTYPE_EDITABLE_EMBEDDING The font may be embedded but must only be installed temporarily on other systems. In contrast to Preview & Print fonts, documents containing editable fonts may be opened for reading, editing is permitted, and changes may be saved. FT_FSTYPE_NO_SUBSETTING The font may not be subsetted prior to embedding. FT_FSTYPE_BITMAP_EMBEDDING_ONLY Only bitmaps contained in the font may be embedded; no outline data may be embedded. If there are no bitmaps available in the font, then the font is unembeddable. note The flags are ORed together, thus more than a single value can be returned. While the fsType flags can indicate that a font may be embedded, a license with the font vendor may be separately required to use the font in this way. FT_HAS_FAST_GLYPHS \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_FAST_GLYPHS ( face ) 0 Deprecated.","title":"Base Interface"},{"location":"ft2-base_interface.html#base-interface","text":"","title":"Base Interface"},{"location":"ft2-base_interface.html#synopsis","text":"This section describes the most important public high-level API functions of FreeType 2.","title":"Synopsis"},{"location":"ft2-base_interface.html#ft_library","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_LibraryRec_ * FT_Library ; A handle to a FreeType library instance. Each \u2018library\u2019 is completely independent from the others; it is the \u2018root\u2019 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 ). [Since 2.5.6] In multi-threaded applications it is easiest to use one FT_Library object per thread. In case this is too cumbersome, a single FT_Library object across threads is possible also, as long as a mutex lock is used around FT_New_Face and FT_Done_Face .","title":"FT_Library"},{"location":"ft2-base_interface.html#ft_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_FaceRec_* FT_Face ; A handle to a typographic face object. A face object models a given typeface, in a given style.","title":"FT_Face"},{"location":"ft2-base_interface.html#ft_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_SizeRec_* FT_Size ; A handle to an object that models a face scaled to a given character size.","title":"FT_Size"},{"location":"ft2-base_interface.html#ft_glyphslot","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_GlyphSlotRec_* FT_GlyphSlot ; A handle to a given \u2018glyph slot\u2019. A slot is a container that can hold any 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.","title":"FT_GlyphSlot"},{"location":"ft2-base_interface.html#ft_charmap","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_CharMapRec_* FT_CharMap ; A handle to a character map (usually abbreviated to \u2018charmap\u2019). 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 \u2018active\u2019, providing the data 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.","title":"FT_CharMap"},{"location":"ft2-base_interface.html#ft_encoding","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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_SJIS , 's', 'j', 'i', 's' ), FT_ENC_TAG ( FT_ENCODING_PRC , 'g', 'b', ' ', ' ' ), FT_ENC_TAG ( FT_ENCODING_BIG5 , 'b', 'i', 'g', '5' ), FT_ENC_TAG ( FT_ENCODING_WANSUNG , 'w', 'a', 'n', 's' ), FT_ENC_TAG ( FT_ENCODING_JOHAB , 'j', 'o', 'h', 'a' ), /* for backward compatibility */ FT_ENCODING_GB2312 = FT_ENCODING_PRC , FT_ENCODING_MS_SJIS = FT_ENCODING_SJIS , FT_ENCODING_MS_GB2312 = FT_ENCODING_PRC , FT_ENCODING_MS_BIG5 = FT_ENCODING_BIG5 , FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG , FT_ENCODING_MS_JOHAB = FT_ENCODING_JOHAB , 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 ; /* these constants are deprecated; use the corresponding ` FT_Encoding ` */ /* values instead */ # 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_SJIS # define ft_encoding_gb2312 FT_ENCODING_PRC # define ft_encoding_big5 FT_ENCODING_BIG5 # define ft_encoding_wansung FT_ENCODING_WANSUNG # define ft_encoding_johab FT_ENCODING_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 An enumeration to specify character sets supported by charmaps. Used in the FT_Select_Charmap API function.","title":"FT_Encoding"},{"location":"ft2-base_interface.html#ft_enc_tag","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # ifndef FT_ENC_TAG # define FT_ENC_TAG ( value, a, b, c, d ) \\ value = ( ( FT_STATIC_BYTE_CAST( FT_UInt32 , a ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( FT_UInt32 , b ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( FT_UInt32 , c ) << 8 ) | \\ FT_STATIC_BYTE_CAST( FT_UInt32 , d ) ) # endif /* FT_ENC_TAG */ This macro converts four-letter tags into an unsigned long. It is used to define \u2018encoding\u2019 identifiers (see FT_Encoding ).","title":"FT_ENC_TAG"},{"location":"ft2-base_interface.html#ft_facerec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 member variables (down to `underline_thickness`) */ /*# are only relevant to scalable outlines; cf. @ FT_Bitmap_Size */ /*# for bitmap fonts. */ 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; /* face-specific auto-hinter data */ void * extensions; /* unused */ FT_Face_Internal internal; /*@private end */ } FT_FaceRec ; FreeType root face class structure. A face object models a typeface in a font file.","title":"FT_FaceRec"},{"location":"ft2-base_interface.html#ft_has_horizontal","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_HORIZONTAL ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_HORIZONTAL ) ) A macro that returns true whenever a face object contains horizontal metrics (this is true for all font formats though).","title":"FT_HAS_HORIZONTAL"},{"location":"ft2-base_interface.html#ft_has_vertical","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_VERTICAL ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_VERTICAL ) ) A macro that returns true whenever a face object contains real vertical metrics (and not only synthesized ones).","title":"FT_HAS_VERTICAL"},{"location":"ft2-base_interface.html#ft_has_kerning","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_KERNING ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_KERNING ) ) A macro that returns true whenever a face object contains kerning data that can be accessed with FT_Get_Kerning .","title":"FT_HAS_KERNING"},{"location":"ft2-base_interface.html#ft_has_fixed_sizes","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_FIXED_SIZES ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_SIZES ) ) A macro that returns true whenever a face object contains some embedded bitmaps. See the available_sizes field of the FT_FaceRec structure.","title":"FT_HAS_FIXED_SIZES"},{"location":"ft2-base_interface.html#ft_has_glyph_names","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_GLYPH_NAMES ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_GLYPH_NAMES ) ) A macro that returns true whenever a face object contains some glyph names that can be accessed through FT_Get_Glyph_Name .","title":"FT_HAS_GLYPH_NAMES"},{"location":"ft2-base_interface.html#ft_has_color","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_COLOR ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_COLOR ) ) A macro that returns true whenever a face object contains tables for color glyphs.","title":"FT_HAS_COLOR"},{"location":"ft2-base_interface.html#ft_has_multiple_masters","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_MULTIPLE_MASTERS ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS ) ) 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.","title":"FT_HAS_MULTIPLE_MASTERS"},{"location":"ft2-base_interface.html#ft_has_svg","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_SVG ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SVG ) ) A macro that returns true whenever a face object contains an \u2018SVG \u2019 OpenType table.","title":"FT_HAS_SVG"},{"location":"ft2-base_interface.html#ft_has_sbix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_SBIX ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SBIX ) ) A macro that returns true whenever a face object contains an \u2018sbix\u2019 OpenType table and outline glyphs. Currently, FreeType only supports bitmap glyphs in PNG format for this table (i.e., JPEG and TIFF formats are unsupported, as are Apple-specific formats not part of the OpenType specification).","title":"FT_HAS_SBIX"},{"location":"ft2-base_interface.html#ft_has_sbix_overlay","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_SBIX_OVERLAY ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SBIX_OVERLAY ) ) A macro that returns true whenever a face object contains an \u2018sbix\u2019 OpenType table with bit 1 in its flags field set, instructing the application to overlay the bitmap strike with the corresponding outline glyph. See FT_HAS_SBIX for pseudo code how to use it.","title":"FT_HAS_SBIX_OVERLAY"},{"location":"ft2-base_interface.html#ft_is_sfnt","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_SFNT ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SFNT ) ) 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.","title":"FT_IS_SFNT"},{"location":"ft2-base_interface.html#ft_is_scalable","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_SCALABLE ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_SCALABLE ) ) A macro that returns true whenever a face object contains a scalable font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF, and PFR font formats).","title":"FT_IS_SCALABLE"},{"location":"ft2-base_interface.html#ft_is_fixed_width","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_FIXED_WIDTH ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_FIXED_WIDTH ) ) A macro that returns true whenever a face object contains a font face that contains fixed-width (or \u2018monospace\u2019, \u2018fixed-pitch\u2019, etc.) glyphs.","title":"FT_IS_FIXED_WIDTH"},{"location":"ft2-base_interface.html#ft_is_cid_keyed","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_CID_KEYED ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_CID_KEYED ) ) A macro that returns true whenever a face object contains a CID-keyed font. See the discussion of FT_FACE_FLAG_CID_KEYED for more details. If this macro is true, all functions defined in FT_CID_H are available.","title":"FT_IS_CID_KEYED"},{"location":"ft2-base_interface.html#ft_is_tricky","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_TRICKY ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_TRICKY ) ) A macro that returns true whenever a face represents a \u2018tricky\u2019 font. See the discussion of FT_FACE_FLAG_TRICKY for more details.","title":"FT_IS_TRICKY"},{"location":"ft2-base_interface.html#ft_is_named_instance","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_NAMED_INSTANCE ( face ) \\ ( !!( (face)->face_index & 0x7FFF0000L ) ) A macro that returns true whenever a face object is a named instance of a GX or OpenType variation font. [Since 2.9] Changing the design coordinates with FT_Set_Var_Design_Coordinates or FT_Set_Var_Blend_Coordinates does not influence the return value of this macro (only FT_Set_Named_Instance does that).","title":"FT_IS_NAMED_INSTANCE"},{"location":"ft2-base_interface.html#ft_is_variation","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_IS_VARIATION ( face ) \\ ( !!( (face)->face_flags & FT_FACE_FLAG_VARIATION ) ) A macro that returns true whenever a face object has been altered by FT_Set_MM_Design_Coordinates , FT_Set_Var_Design_Coordinates , or FT_Set_Var_Blend_Coordinates .","title":"FT_IS_VARIATION"},{"location":"ft2-base_interface.html#ft_sizerec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ; FreeType root size class structure. A size object models a face object at a given size.","title":"FT_SizeRec"},{"location":"ft2-base_interface.html#ft_size_metrics","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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; /* scaling values used to convert font */ FT_Fixed y_scale; /* units to 26.6 fractional pixels */ 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 ; The size metrics structure gives the metrics of a size object.","title":"FT_Size_Metrics"},{"location":"ft2-base_interface.html#ft_glyphslotrec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_GlyphSlotRec_ { FT_Library library; FT_Face face; FT_GlyphSlot next; FT_UInt glyph_index; /* new in 2.10; was reserved previously */ 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; FT_Pos lsb_delta; FT_Pos rsb_delta; void * other; FT_Slot_Internal internal; } FT_GlyphSlotRec ; FreeType root glyph slot class structure. A glyph slot is a container where individual glyphs can be loaded, be they in outline or bitmap format.","title":"FT_GlyphSlotRec"},{"location":"ft2-base_interface.html#ft_glyph_metrics","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Glyph_Metrics_ { FT_Pos width; FT_Pos height; FT_Pos horiBearingX; FT_Pos horiBearingY; FT_Pos horiAdvance; FT_Pos vertBearingX; FT_Pos vertBearingY; FT_Pos vertAdvance; } FT_Glyph_Metrics ; A structure to model the metrics of a single glyph. The values are expressed in 26.6 fractional pixel format; if the flag FT_LOAD_NO_SCALE has been used while loading the glyph, values are expressed in font units instead.","title":"FT_Glyph_Metrics"},{"location":"ft2-base_interface.html#ft_subglyph","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_SubGlyphRec_* FT_SubGlyph ; The subglyph structure is an internal object used to describe subglyphs (for example, in the case of composites).","title":"FT_SubGlyph"},{"location":"ft2-base_interface.html#ft_bitmap_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Bitmap_Size_ { FT_Short height; FT_Short width; FT_Pos size; FT_Pos x_ppem; FT_Pos y_ppem; } FT_Bitmap_Size ; This structure models the metrics of a bitmap strike (i.e., a set of glyphs for a given point size and resolution) in a bitmap font. It is used for the available_sizes field of FT_Face .","title":"FT_Bitmap_Size"},{"location":"ft2-base_interface.html#ft_init_freetype","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Init_FreeType ( FT_Library *alibrary ); Initialize a new FreeType library object. The set of modules that are registered by this function is determined at build time.","title":"FT_Init_FreeType"},{"location":"ft2-base_interface.html#ft_done_freetype","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Done_FreeType ( FT_Library library ); Destroy a given FreeType library object and all of its children, including resources, drivers, faces, sizes, etc.","title":"FT_Done_FreeType"},{"location":"ft2-base_interface.html#ft_new_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_New_Face ( FT_Library library, const char * filepathname, FT_Long face_index, FT_Face *aface ); Call FT_Open_Face to open a font by its pathname.","title":"FT_New_Face"},{"location":"ft2-base_interface.html#ft_done_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Done_Face ( FT_Face face ); Discard a given face object, as well as all of its child slots and sizes.","title":"FT_Done_Face"},{"location":"ft2-base_interface.html#ft_reference_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Reference_Face ( FT_Face face ); A counter gets initialized to 1 at the time an FT_Face structure is created. This function increments the counter. FT_Done_Face then only destroys a face if the counter is 1, otherwise it simply decrements the counter. This function helps in managing life-cycles of structures that reference FT_Face objects.","title":"FT_Reference_Face"},{"location":"ft2-base_interface.html#ft_new_memory_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Call FT_Open_Face to open a font that has been loaded into memory.","title":"FT_New_Memory_Face"},{"location":"ft2-base_interface.html#ft_face_properties","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Face_Properties ( FT_Face face, FT_UInt num_properties, FT_Parameter * properties ); Set or override certain (library or module-wide) properties on a face-by-face basis. Useful for finer-grained control and avoiding locks on shared structures (threads can modify their own faces as they see fit). Contrary to FT_Property_Set , this function uses FT_Parameter so that you can pass multiple properties to the target face in one call. Note that only a subset of the available properties can be controlled. FT_PARAM_TAG_STEM_DARKENING (stem darkening, corresponding to the property no-stem-darkening provided by the \u2018autofit\u2019, \u2018cff\u2019, \u2018type1\u2019, and \u2018t1cid\u2019 modules; see no-stem-darkening ). FT_PARAM_TAG_LCD_FILTER_WEIGHTS (LCD filter weights, corresponding to function FT_Library_SetLcdFilterWeights ). FT_PARAM_TAG_RANDOM_SEED (seed value for the CFF, Type 1, and CID \u2018random\u2019 operator, corresponding to the random-seed property provided by the \u2018cff\u2019, \u2018type1\u2019, and \u2018t1cid\u2019 modules; see random-seed ). Pass NULL as data in FT_Parameter for a given tag to reset the option and use the library or module default again.","title":"FT_Face_Properties"},{"location":"ft2-base_interface.html#ft_open_face","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Open_Face ( FT_Library library, const FT_Open_Args * args, FT_Long face_index, FT_Face *aface ); Create a face object from a given resource described by FT_Open_Args .","title":"FT_Open_Face"},{"location":"ft2-base_interface.html#ft_open_args","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Open_Args_ { FT_UInt 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 ; A structure to indicate how to open a new font file or stream. A pointer to such a structure can be used as a parameter for the functions FT_Open_Face and FT_Attach_Stream .","title":"FT_Open_Args"},{"location":"ft2-base_interface.html#ft_parameter","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Parameter_ { FT_ULong tag; FT_Pointer data; } FT_Parameter ; A simple structure to pass more or less generic parameters to FT_Open_Face and FT_Face_Properties .","title":"FT_Parameter"},{"location":"ft2-base_interface.html#ft_attach_file","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Attach_File ( FT_Face face, const char * filepathname ); Call FT_Attach_Stream to attach a file.","title":"FT_Attach_File"},{"location":"ft2-base_interface.html#ft_attach_stream","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Attach_Stream ( FT_Face face, FT_Open_Args * parameters ); \u2018Attach\u2019 data to a face object. Normally, this is used to read additional information for the face object. For example, you can attach an AFM file that comes with a Type 1 font to get the kerning values and other metrics.","title":"FT_Attach_Stream"},{"location":"ft2-base_interface.html#ft_set_char_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Call FT_Request_Size to request the nominal size (in points).","title":"FT_Set_Char_Size"},{"location":"ft2-base_interface.html#ft_set_pixel_sizes","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Set_Pixel_Sizes ( FT_Face face, FT_UInt pixel_width, FT_UInt pixel_height ); Call FT_Request_Size to request the nominal size (in pixels).","title":"FT_Set_Pixel_Sizes"},{"location":"ft2-base_interface.html#ft_request_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Request_Size ( FT_Face face, FT_Size_Request req ); Resize the scale of the active FT_Size object in a face.","title":"FT_Request_Size"},{"location":"ft2-base_interface.html#ft_select_size","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Select_Size ( FT_Face face, FT_Int strike_index ); Select a bitmap strike. To be more precise, this function sets the scaling factors of the active FT_Size object in a face so that bitmaps from this particular strike are taken by FT_Load_Glyph and friends.","title":"FT_Select_Size"},{"location":"ft2-base_interface.html#ft_size_request_type","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef enum FT_Size_Request_Type_ { FT_SIZE_REQUEST_TYPE_NOMINAL , FT_SIZE_REQUEST_TYPE_REAL_DIM , FT_SIZE_REQUEST_TYPE_BBOX , FT_SIZE_REQUEST_TYPE_CELL , FT_SIZE_REQUEST_TYPE_SCALES , FT_SIZE_REQUEST_TYPE_MAX } FT_Size_Request_Type ; An enumeration type that lists the supported size request types, i.e., what input size (in font units) maps to the requested output size (in pixels, as computed from the arguments of FT_Size_Request ).","title":"FT_Size_Request_Type"},{"location":"ft2-base_interface.html#ft_size_requestrec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_RequestRec_ { FT_Size_Request_Type type; FT_Long width; FT_Long height; FT_UInt horiResolution; FT_UInt vertResolution; } FT_Size_RequestRec ; A structure to model a size request.","title":"FT_Size_RequestRec"},{"location":"ft2-base_interface.html#ft_size_request","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_RequestRec_ * FT_Size_Request ; A handle to a size request structure.","title":"FT_Size_Request"},{"location":"ft2-base_interface.html#ft_set_transform","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Set_Transform ( FT_Face face, FT_Matrix * matrix, FT_Vector * delta ); Set the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph .","title":"FT_Set_Transform"},{"location":"ft2-base_interface.html#ft_get_transform","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Get_Transform ( FT_Face face, FT_Matrix * matrix, FT_Vector * delta ); Return the transformation that is applied to glyph images when they are loaded into a glyph slot through FT_Load_Glyph . See FT_Set_Transform for more details.","title":"FT_Get_Transform"},{"location":"ft2-base_interface.html#ft_load_glyph","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Load_Glyph ( FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags ); Load a glyph into the glyph slot of a face object.","title":"FT_Load_Glyph"},{"location":"ft2-base_interface.html#ft_get_char_index","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Get_Char_Index ( FT_Face face, FT_ULong charcode ); Return the glyph index of a given character code. This function uses the currently selected charmap to do the mapping.","title":"FT_Get_Char_Index"},{"location":"ft2-base_interface.html#ft_get_first_char","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_ULong ) FT_Get_First_Char ( FT_Face face, FT_UInt *agindex ); Return the first character code in the current charmap of a given face, together with its corresponding glyph index.","title":"FT_Get_First_Char"},{"location":"ft2-base_interface.html#ft_get_next_char","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_ULong ) FT_Get_Next_Char ( FT_Face face, FT_ULong char_code, FT_UInt *agindex ); 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.","title":"FT_Get_Next_Char"},{"location":"ft2-base_interface.html#ft_get_name_index","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Get_Name_Index ( FT_Face face, const FT_String * glyph_name ); Return the glyph index of a given glyph name.","title":"FT_Get_Name_Index"},{"location":"ft2-base_interface.html#ft_load_char","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Load_Char ( FT_Face face, FT_ULong char_code, FT_Int32 load_flags ); Load a glyph into the glyph slot of a face object, accessed by its character code.","title":"FT_Load_Char"},{"location":"ft2-base_interface.html#ft_load_target_mode","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_TARGET_MODE ( x ) \\ FT_STATIC_CAST( FT_Render_Mode , ( (x) >> 16 ) & 15 ) Return the FT_Render_Mode corresponding to a given FT_LOAD_TARGET_XXX value.","title":"FT_LOAD_TARGET_MODE"},{"location":"ft2-base_interface.html#ft_render_glyph","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Render_Glyph ( FT_GlyphSlot slot, FT_Render_Mode render_mode ); Convert a given glyph image to a bitmap. It does so by inspecting the glyph image format, finding the relevant renderer, and invoking it.","title":"FT_Render_Glyph"},{"location":"ft2-base_interface.html#ft_render_mode","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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_SDF , FT_RENDER_MODE_MAX } FT_Render_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Render_Mode ` values instead */ # define ft_render_mode_normal FT_RENDER_MODE_NORMAL # define ft_render_mode_mono FT_RENDER_MODE_MONO Render modes supported by FreeType 2. Each mode corresponds to a specific type of scanline conversion performed on the outline. For bitmap fonts and embedded bitmaps the bitmap->pixel_mode field in the FT_GlyphSlotRec structure gives the format of the returned bitmap. All modes except FT_RENDER_MODE_MONO use 256 levels of opacity, indicating pixel coverage. Use linear alpha blending and gamma correction to correctly render non-monochrome glyph bitmaps onto a surface; see FT_Render_Glyph . The FT_RENDER_MODE_SDF is a special render mode that uses up to 256 distance values, indicating the signed distance from the grid position to the nearest outline.","title":"FT_Render_Mode"},{"location":"ft2-base_interface.html#ft_get_kerning","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). 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 ); Return the kerning vector between two glyphs of the same face.","title":"FT_Get_Kerning"},{"location":"ft2-base_interface.html#ft_kerning_mode","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef enum FT_Kerning_Mode_ { FT_KERNING_DEFAULT = 0, FT_KERNING_UNFITTED , FT_KERNING_UNSCALED } FT_Kerning_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Kerning_Mode ` values instead */ # define ft_kerning_default FT_KERNING_DEFAULT # define ft_kerning_unfitted FT_KERNING_UNFITTED # define ft_kerning_unscaled FT_KERNING_UNSCALED An enumeration to specify the format of kerning values returned by FT_Get_Kerning .","title":"FT_Kerning_Mode"},{"location":"ft2-base_interface.html#ft_get_track_kerning","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_Track_Kerning ( FT_Face face, FT_Fixed point_size, FT_Int degree, FT_Fixed * akerning ); Return the track kerning for a given face object at a given size.","title":"FT_Get_Track_Kerning"},{"location":"ft2-base_interface.html#ft_get_glyph_name","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_Glyph_Name ( FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max ); Retrieve the ASCII name of a given glyph in a face. This only works for those faces where FT_HAS_GLYPH_NAMES (face) returns 1.","title":"FT_Get_Glyph_Name"},{"location":"ft2-base_interface.html#ft_get_postscript_name","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( const char * ) FT_Get_Postscript_Name ( FT_Face face ); Retrieve the ASCII PostScript name of a given face, if available. This only works with PostScript, TrueType, and OpenType fonts.","title":"FT_Get_Postscript_Name"},{"location":"ft2-base_interface.html#ft_charmaprec","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_CharMapRec_ { FT_Face face; FT_Encoding encoding; FT_UShort platform_id; FT_UShort encoding_id; } FT_CharMapRec ; The base charmap structure.","title":"FT_CharMapRec"},{"location":"ft2-base_interface.html#ft_select_charmap","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Select_Charmap ( FT_Face face, FT_Encoding encoding ); Select a given charmap by its encoding tag (as listed in freetype.h ).","title":"FT_Select_Charmap"},{"location":"ft2-base_interface.html#ft_set_charmap","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Set_Charmap ( FT_Face face, FT_CharMap charmap ); Select a given charmap for character code to glyph index mapping.","title":"FT_Set_Charmap"},{"location":"ft2-base_interface.html#ft_get_charmap_index","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Int ) FT_Get_Charmap_Index ( FT_CharMap charmap ); Retrieve index of a given charmap.","title":"FT_Get_Charmap_Index"},{"location":"ft2-base_interface.html#ft_get_fstype_flags","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UShort ) FT_Get_FSType_Flags ( FT_Face face ); Return the fsType flags for a font.","title":"FT_Get_FSType_Flags"},{"location":"ft2-base_interface.html#ft_get_subglyph_info","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Error ) FT_Get_SubGlyph_Info ( FT_GlyphSlot glyph, FT_UInt sub_index, FT_Int *p_index, FT_UInt *p_flags, FT_Int *p_arg1, FT_Int *p_arg2, FT_Matrix *p_transform ); Retrieve a description of a given subglyph. Only use it if glyph->format is FT_GLYPH_FORMAT_COMPOSITE ; an error is returned otherwise.","title":"FT_Get_SubGlyph_Info"},{"location":"ft2-base_interface.html#ft_face_internal","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Face_InternalRec_* FT_Face_Internal ; An opaque handle to an FT_Face_InternalRec structure that models the 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.","title":"FT_Face_Internal"},{"location":"ft2-base_interface.html#ft_size_internal","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Size_InternalRec_* FT_Size_Internal ; An opaque handle to an FT_Size_InternalRec structure, used to model private data of a given FT_Size object.","title":"FT_Size_Internal"},{"location":"ft2-base_interface.html#ft_slot_internal","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_Slot_InternalRec_* FT_Slot_Internal ; An opaque handle to an FT_Slot_InternalRec structure, used to model private data of a given FT_GlyphSlot object.","title":"FT_Slot_Internal"},{"location":"ft2-base_interface.html#ft_face_flag_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # 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 ) # define FT_FACE_FLAG_HINTER ( 1L << 11 ) # define FT_FACE_FLAG_CID_KEYED ( 1L << 12 ) # define FT_FACE_FLAG_TRICKY ( 1L << 13 ) # define FT_FACE_FLAG_COLOR ( 1L << 14 ) # define FT_FACE_FLAG_VARIATION ( 1L << 15 ) # define FT_FACE_FLAG_SVG ( 1L << 16 ) # define FT_FACE_FLAG_SBIX ( 1L << 17 ) # define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 ) 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.","title":"FT_FACE_FLAG_XXX"},{"location":"ft2-base_interface.html#ft_style_flag_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_STYLE_FLAG_ITALIC ( 1 << 0 ) # define FT_STYLE_FLAG_BOLD ( 1 << 1 ) A list of bit flags to indicate the style of a given face. These are used in the style_flags field of FT_FaceRec .","title":"FT_STYLE_FLAG_XXX"},{"location":"ft2-base_interface.html#ft_open_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_OPEN_MEMORY 0x1 # define FT_OPEN_STREAM 0x2 # define FT_OPEN_PATHNAME 0x4 # define FT_OPEN_DRIVER 0x8 # define FT_OPEN_PARAMS 0x10 /* these constants are deprecated; use the corresponding ` FT_OPEN_XXX ` */ /* values instead */ # 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 A list of bit field constants used within the flags field of the FT_Open_Args structure.","title":"FT_OPEN_XXX"},{"location":"ft2-base_interface.html#ft_load_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_DEFAULT 0x0 # define FT_LOAD_NO_SCALE ( 1L << 0 ) # define FT_LOAD_NO_HINTING ( 1L << 1 ) # define FT_LOAD_RENDER ( 1L << 2 ) # define FT_LOAD_NO_BITMAP ( 1L << 3 ) # define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 ) # define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 ) # define FT_LOAD_CROP_BITMAP ( 1L << 6 ) # define FT_LOAD_PEDANTIC ( 1L << 7 ) # define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 ) # define FT_LOAD_NO_RECURSE ( 1L << 10 ) # define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 ) # define FT_LOAD_MONOCHROME ( 1L << 12 ) # define FT_LOAD_LINEAR_DESIGN ( 1L << 13 ) # define FT_LOAD_SBITS_ONLY ( 1L << 14 ) # define FT_LOAD_NO_AUTOHINT ( 1L << 15 ) /* Bits 16-19 are used by `FT_LOAD_TARGET_` */ # define FT_LOAD_COLOR ( 1L << 20 ) # define FT_LOAD_COMPUTE_METRICS ( 1L << 21 ) # define FT_LOAD_BITMAP_METRICS_ONLY ( 1L << 22 ) A list of bit field constants for FT_Load_Glyph to indicate what kind of operations to perform during glyph loading.","title":"FT_LOAD_XXX"},{"location":"ft2-base_interface.html#ft_load_target_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_LOAD_TARGET_( x ) ( FT_STATIC_CAST( FT_Int32 , (x) & 15 ) << 16 ) # 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 ) A list of values to select a specific hinting algorithm for the hinter. You should OR one of these values to your load_flags when calling FT_Load_Glyph . Note that a font's native hinters may ignore the hinting algorithm you have specified (e.g., the TrueType bytecode interpreter). You can set FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.","title":"FT_LOAD_TARGET_XXX"},{"location":"ft2-base_interface.html#ft_subglyph_flag_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1 # define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2 # define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4 # define FT_SUBGLYPH_FLAG_SCALE 8 # define FT_SUBGLYPH_FLAG_XY_SCALE 0x40 # define FT_SUBGLYPH_FLAG_2X2 0x80 # define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200 A list of constants describing subglyphs. Please refer to the \u2018glyf\u2019 table description in the OpenType specification for the meaning of the various flags (which get synthesized for non-OpenType subglyphs). https://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description","title":"FT_SUBGLYPH_FLAG_XXX"},{"location":"ft2-base_interface.html#ft_fstype_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_FSTYPE_INSTALLABLE_EMBEDDING 0x0000 # define FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING 0x0002 # define FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING 0x0004 # define FT_FSTYPE_EDITABLE_EMBEDDING 0x0008 # define FT_FSTYPE_NO_SUBSETTING 0x0100 # define FT_FSTYPE_BITMAP_EMBEDDING_ONLY 0x0200 A list of bit flags used in the fsType field of the OS/2 table in a TrueType or OpenType font and the FSType entry in a PostScript font. These bit flags are returned by FT_Get_FSType_Flags ; they inform client applications of embedding and subsetting restrictions associated with a font. See https://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/FontPolicies.pdf for more details.","title":"FT_FSTYPE_XXX"},{"location":"ft2-base_interface.html#ft_has_fast_glyphs","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FT_HAS_FAST_GLYPHS ( face ) 0 Deprecated.","title":"FT_HAS_FAST_GLYPHS"},{"location":"ft2-basic_types.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Basic Data Types Basic Data Types \u00b6 Synopsis \u00b6 This section contains the basic data types defined by FreeType 2, ranging from simple scalar types to bitmap descriptors. More font-specific structures are defined in a different section. FT_Byte \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned char FT_Byte ; A simple typedef for the unsigned char type. FT_Bytes \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef const FT_Byte * FT_Bytes ; A typedef for constant memory areas. FT_Char \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed char FT_Char ; A simple typedef for the signed char type. FT_Int \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed int FT_Int ; A typedef for the int type. FT_UInt \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned int FT_UInt ; A typedef for the unsigned int type. FT_Int16 \u00b6 typedef signed short FT_Int16 ; A typedef for a 16bit signed integer type. FT_UInt16 \u00b6 typedef unsigned short FT_UInt16 ; A typedef for a 16bit unsigned integer type. FT_Int32 \u00b6 typedef signed XXX FT_Int32 ; A typedef for a 32bit signed integer type. The size depends on the configuration. FT_UInt32 \u00b6 typedef unsigned XXX FT_UInt32 ; FT_Int64 \u00b6 typedef signed XXX FT_Int64 ; FT_UInt64 \u00b6 typedef unsigned XXX FT_UInt64 ; FT_Short \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_Short ; A typedef for signed short. FT_UShort \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned short FT_UShort ; A typedef for unsigned short. FT_Long \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_Long ; A typedef for signed long. FT_ULong \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned long FT_ULong ; A typedef for unsigned long. FT_Bool \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned char FT_Bool ; A typedef of unsigned char, used for simple booleans. As usual, values 1 and 0 represent true and false, respectively. FT_Offset \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef size_t FT_Offset ; This is equivalent to the ANSI C size_t type, i.e., the largest unsigned integer type used to express a file size or position, or a memory block size. FT_PtrDist \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef ft_ptrdiff_t FT_PtrDist ; This is equivalent to the ANSI C ptrdiff_t type, i.e., the largest signed integer type used to express the distance between two pointers. FT_String \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef char FT_String ; A simple typedef for the char type, usually used for strings. FT_Tag \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef FT_UInt32 FT_Tag ; A typedef for 32-bit tags (as used in the SFNT format). FT_Error \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef int FT_Error ; The FreeType error code type. A value of 0 is always interpreted as a successful operation. FT_Fixed \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_Fixed ; This type is used to store 16.16 fixed-point values, like scaling values or matrix coefficients. FT_Pointer \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef void * FT_Pointer ; A simple typedef for a typeless pointer. FT_Pos \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef signed long FT_Pos ; The type FT_Pos is used to store vectorial coordinates. Depending on the context, these can represent distances in integer font units, or 16.16, or 26.6 fixed-point pixel coordinates. FT_Vector \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Vector_ { FT_Pos x; FT_Pos y; } FT_Vector ; 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. FT_BBox \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_BBox_ { FT_Pos xMin, yMin; FT_Pos xMax, yMax; } FT_BBox ; 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). note The bounding box is specified with the coordinates of the lower left and the upper right corner. In PostScript, those values are often called (llx,lly) and (urx,ury), respectively. If yMin is negative, this value gives the glyph's descender. Otherwise, the glyph doesn't descend below the baseline. Similarly, if ymax is positive, this value gives the glyph's ascender. xMin gives the horizontal distance from the glyph's origin to the left edge of the glyph's bounding box. If xMin is negative, the glyph extends to the left of the origin. FT_Matrix \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Matrix_ { FT_Fixed xx, xy; FT_Fixed yx, yy; } FT_Matrix ; A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is: x' = x*xx + y*xy y' = x*yx + y*yy fields xx Matrix coefficient. xy Matrix coefficient. yx Matrix coefficient. yy Matrix coefficient. FT_FWord \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_FWord ; /* distance in FUnits */ A signed 16-bit integer used to store a distance in original font units. FT_UFWord \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned short FT_UFWord ; /* unsigned distance */ An unsigned 16-bit integer used to store a distance in original font units. FT_F2Dot14 \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_F2Dot14 ; A signed 2.14 fixed-point type used for unit vectors. FT_UnitVector \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_UnitVector_ { FT_F2Dot14 x; FT_F2Dot14 y; } FT_UnitVector ; A simple structure used to store a 2D vector unit vector. Uses FT_F2Dot14 types. fields x Horizontal coordinate. y Vertical coordinate. FT_F26Dot6 \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_F26Dot6 ; A signed 26.6 fixed-point type used for vectorial pixel coordinates. FT_Data \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Data_ { const FT_Byte * pointer; FT_UInt length; } FT_Data ; Read-only binary data represented as a pointer and a length. fields pointer The data. length The length of the data in bytes. FT_MAKE_TAG \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). # define FT_MAKE_TAG ( _x1, _x2, _x3, _x4 ) \\ ( ( FT_STATIC_BYTE_CAST( FT_Tag , _x1 ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( FT_Tag , _x2 ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( FT_Tag , _x3 ) << 8 ) | \\ FT_STATIC_BYTE_CAST( FT_Tag , _x4 ) ) This macro converts four-letter tags that are used to label TrueType tables into an FT_Tag type, to be used within FreeType. note The produced values must be 32-bit integers. Don't redefine this macro. FT_Generic \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Generic_ { void * data; FT_Generic_Finalizer finalizer; } FT_Generic ; Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might want to associate a glyph cache to a given size object. Some FreeType object contains a generic field, of type FT_Generic , which usage is left to client applications and font servers. It can be used to store a pointer to client-specific data, as well as the address of a \u2018finalizer\u2019 function, which will be called by FreeType when the object is destroyed (for example, the previous client example would put the address of the glyph cache destructor in the finalizer field). fields data A typeless pointer to any client-specified data. This field is completely ignored by the FreeType library. finalizer A pointer to a \u2018generic finalizer\u2019 function, which will be called when the object is destroyed. If this field is set to NULL , no code will be called. FT_Generic_Finalizer \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef void (* FT_Generic_Finalizer )( void * object ); Describe a function used to destroy the \u2018client\u2019 data of any FreeType object. See the description of the FT_Generic type for details of usage. input The address of the FreeType object that is under finalization. Its client data is accessed through its generic field. FT_Bitmap \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Bitmap_ { unsigned int rows; unsigned int width; int pitch; unsigned char * buffer; unsigned short num_grays; unsigned char pixel_mode; unsigned char palette_mode; void * palette; } FT_Bitmap ; 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 \u2018down\u2019 flow, and negative when it has an \u2018up\u2019 flow. In all cases, the pitch is an offset to add to a bitmap pointer in order to go down one row. Note that \u2018padding\u2019 means the alignment of a bitmap to a byte border, and FreeType functions normally align to the smallest possible integer value. For the B/W rasterizer, pitch is always an even number. To change the pitch of a bitmap (say, to make it a multiple of 4), use FT_Bitmap_Convert . Alternatively, you might use callback functions to directly render to the application's surface; see the file example2.cpp in the tutorial for a demonstration. 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. See FT_Pixel_Mode for possible values. palette_mode This field is intended for paletted pixel modes; it indicates how the palette is stored. Not used currently. palette A typeless pointer to the bitmap palette; this field is intended for paletted pixel modes. Not used currently. FT_Pixel_Mode \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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_BGRA , FT_PIXEL_MODE_MAX /* do not remove */ } FT_Pixel_Mode ; /* these constants are deprecated; use the corresponding ` FT_Pixel_Mode ` */ /* values instead. */ # 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 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 \u2018gray\u2019 levels is stored in the num_grays field of the FT_Bitmap structure (it generally is 256). FT_PIXEL_MODE_GRAY2 A 2-bit per 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 per pixel bitmap, representing 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, representing RGB or BGR decimated glyph images used for display on LCD displays; the bitmap is three times wider than the original glyph image. See also FT_RENDER_MODE_LCD . FT_PIXEL_MODE_LCD_V An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on rotated LCD displays; the bitmap is three times taller than the original glyph image. See also FT_RENDER_MODE_LCD_V . FT_PIXEL_MODE_BGRA [Since 2.5] An image with four 8-bit channels per pixel, representing a color image (such as emoticons) with alpha channel. For each pixel, the format is BGRA, which means, the blue channel comes first in memory. The color channels are pre-multiplied and in the sRGB colorspace. For example, full red at half-translucent opacity will be represented as \u201800,00,80,80\u2019, not \u201800,00,FF,80\u2019. See also FT_LOAD_COLOR . FT_Glyph_Format \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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_IMAGE_TAG ( FT_GLYPH_FORMAT_SVG , 'S', 'V', 'G', ' ' ) } FT_Glyph_Format ; /* these constants are deprecated; use the corresponding */ /* ` FT_Glyph_Format ` values instead. */ # 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 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. FT_GLYPH_FORMAT_COMPOSITE The glyph image is a composite of several other images. This format is only used with FT_LOAD_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 vectorial 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 and 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. FT_GLYPH_FORMAT_SVG [Since 2.12] The glyph is represented by an SVG document in the \u2018SVG \u2019 table. FT_IMAGE_TAG \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). # ifndef FT_IMAGE_TAG # define FT_IMAGE_TAG ( value, _x1, _x2, _x3, _x4 ) \\ value = ( ( FT_STATIC_BYTE_CAST( unsigned long , _x1 ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( unsigned long , _x2 ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( unsigned long , _x3 ) << 8 ) | \\ FT_STATIC_BYTE_CAST( unsigned long , _x4 ) ) # endif /* FT_IMAGE_TAG */ This macro converts four-letter tags to an unsigned long type. note Since many 16-bit compilers don't like 32-bit 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.","title":"Basic Data Types"},{"location":"ft2-basic_types.html#basic-data-types","text":"","title":"Basic Data Types"},{"location":"ft2-basic_types.html#synopsis","text":"This section contains the basic data types defined by FreeType 2, ranging from simple scalar types to bitmap descriptors. More font-specific structures are defined in a different section.","title":"Synopsis"},{"location":"ft2-basic_types.html#ft_byte","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned char FT_Byte ; A simple typedef for the unsigned char type.","title":"FT_Byte"},{"location":"ft2-basic_types.html#ft_bytes","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef const FT_Byte * FT_Bytes ; A typedef for constant memory areas.","title":"FT_Bytes"},{"location":"ft2-basic_types.html#ft_char","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed char FT_Char ; A simple typedef for the signed char type.","title":"FT_Char"},{"location":"ft2-basic_types.html#ft_int","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed int FT_Int ; A typedef for the int type.","title":"FT_Int"},{"location":"ft2-basic_types.html#ft_uint","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned int FT_UInt ; A typedef for the unsigned int type.","title":"FT_UInt"},{"location":"ft2-basic_types.html#ft_int16","text":"typedef signed short FT_Int16 ; A typedef for a 16bit signed integer type.","title":"FT_Int16"},{"location":"ft2-basic_types.html#ft_uint16","text":"typedef unsigned short FT_UInt16 ; A typedef for a 16bit unsigned integer type.","title":"FT_UInt16"},{"location":"ft2-basic_types.html#ft_int32","text":"typedef signed XXX FT_Int32 ; A typedef for a 32bit signed integer type. The size depends on the configuration.","title":"FT_Int32"},{"location":"ft2-basic_types.html#ft_uint32","text":"typedef unsigned XXX FT_UInt32 ;","title":"FT_UInt32"},{"location":"ft2-basic_types.html#ft_int64","text":"typedef signed XXX FT_Int64 ;","title":"FT_Int64"},{"location":"ft2-basic_types.html#ft_uint64","text":"typedef unsigned XXX FT_UInt64 ;","title":"FT_UInt64"},{"location":"ft2-basic_types.html#ft_short","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_Short ; A typedef for signed short.","title":"FT_Short"},{"location":"ft2-basic_types.html#ft_ushort","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned short FT_UShort ; A typedef for unsigned short.","title":"FT_UShort"},{"location":"ft2-basic_types.html#ft_long","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_Long ; A typedef for signed long.","title":"FT_Long"},{"location":"ft2-basic_types.html#ft_ulong","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned long FT_ULong ; A typedef for unsigned long.","title":"FT_ULong"},{"location":"ft2-basic_types.html#ft_bool","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned char FT_Bool ; A typedef of unsigned char, used for simple booleans. As usual, values 1 and 0 represent true and false, respectively.","title":"FT_Bool"},{"location":"ft2-basic_types.html#ft_offset","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef size_t FT_Offset ; This is equivalent to the ANSI C size_t type, i.e., the largest unsigned integer type used to express a file size or position, or a memory block size.","title":"FT_Offset"},{"location":"ft2-basic_types.html#ft_ptrdist","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef ft_ptrdiff_t FT_PtrDist ; This is equivalent to the ANSI C ptrdiff_t type, i.e., the largest signed integer type used to express the distance between two pointers.","title":"FT_PtrDist"},{"location":"ft2-basic_types.html#ft_string","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef char FT_String ; A simple typedef for the char type, usually used for strings.","title":"FT_String"},{"location":"ft2-basic_types.html#ft_tag","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef FT_UInt32 FT_Tag ; A typedef for 32-bit tags (as used in the SFNT format).","title":"FT_Tag"},{"location":"ft2-basic_types.html#ft_error","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef int FT_Error ; The FreeType error code type. A value of 0 is always interpreted as a successful operation.","title":"FT_Error"},{"location":"ft2-basic_types.html#ft_fixed","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_Fixed ; This type is used to store 16.16 fixed-point values, like scaling values or matrix coefficients.","title":"FT_Fixed"},{"location":"ft2-basic_types.html#ft_pointer","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef void * FT_Pointer ; A simple typedef for a typeless pointer.","title":"FT_Pointer"},{"location":"ft2-basic_types.html#ft_pos","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef signed long FT_Pos ; The type FT_Pos is used to store vectorial coordinates. Depending on the context, these can represent distances in integer font units, or 16.16, or 26.6 fixed-point pixel coordinates.","title":"FT_Pos"},{"location":"ft2-basic_types.html#ft_vector","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Vector_ { FT_Pos x; FT_Pos y; } FT_Vector ; A simple structure used to store a 2D vector; coordinates are of the FT_Pos type.","title":"FT_Vector"},{"location":"ft2-basic_types.html#ft_bbox","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_BBox_ { FT_Pos xMin, yMin; FT_Pos xMax, yMax; } FT_BBox ; A structure used to hold an outline's bounding box, i.e., the coordinates of its extrema in the horizontal and vertical directions.","title":"FT_BBox"},{"location":"ft2-basic_types.html#ft_matrix","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Matrix_ { FT_Fixed xx, xy; FT_Fixed yx, yy; } FT_Matrix ; A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is: x' = x*xx + y*xy y' = x*yx + y*yy","title":"FT_Matrix"},{"location":"ft2-basic_types.html#ft_fword","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_FWord ; /* distance in FUnits */ A signed 16-bit integer used to store a distance in original font units.","title":"FT_FWord"},{"location":"ft2-basic_types.html#ft_ufword","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef unsigned short FT_UFWord ; /* unsigned distance */ An unsigned 16-bit integer used to store a distance in original font units.","title":"FT_UFWord"},{"location":"ft2-basic_types.html#ft_f2dot14","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed short FT_F2Dot14 ; A signed 2.14 fixed-point type used for unit vectors.","title":"FT_F2Dot14"},{"location":"ft2-basic_types.html#ft_unitvector","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_UnitVector_ { FT_F2Dot14 x; FT_F2Dot14 y; } FT_UnitVector ; A simple structure used to store a 2D vector unit vector. Uses FT_F2Dot14 types.","title":"FT_UnitVector"},{"location":"ft2-basic_types.html#ft_f26dot6","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef signed long FT_F26Dot6 ; A signed 26.6 fixed-point type used for vectorial pixel coordinates.","title":"FT_F26Dot6"},{"location":"ft2-basic_types.html#ft_data","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Data_ { const FT_Byte * pointer; FT_UInt length; } FT_Data ; Read-only binary data represented as a pointer and a length.","title":"FT_Data"},{"location":"ft2-basic_types.html#ft_make_tag","text":"Defined in FT_TYPES_H (freetype/fttypes.h). # define FT_MAKE_TAG ( _x1, _x2, _x3, _x4 ) \\ ( ( FT_STATIC_BYTE_CAST( FT_Tag , _x1 ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( FT_Tag , _x2 ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( FT_Tag , _x3 ) << 8 ) | \\ FT_STATIC_BYTE_CAST( FT_Tag , _x4 ) ) This macro converts four-letter tags that are used to label TrueType tables into an FT_Tag type, to be used within FreeType.","title":"FT_MAKE_TAG"},{"location":"ft2-basic_types.html#ft_generic","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_Generic_ { void * data; FT_Generic_Finalizer finalizer; } FT_Generic ; Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might want to associate a glyph cache to a given size object. Some FreeType object contains a generic field, of type FT_Generic , which usage is left to client applications and font servers. It can be used to store a pointer to client-specific data, as well as the address of a \u2018finalizer\u2019 function, which will be called by FreeType when the object is destroyed (for example, the previous client example would put the address of the glyph cache destructor in the finalizer field).","title":"FT_Generic"},{"location":"ft2-basic_types.html#ft_generic_finalizer","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef void (* FT_Generic_Finalizer )( void * object ); Describe a function used to destroy the \u2018client\u2019 data of any FreeType object. See the description of the FT_Generic type for details of usage.","title":"FT_Generic_Finalizer"},{"location":"ft2-basic_types.html#ft_bitmap","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Bitmap_ { unsigned int rows; unsigned int width; int pitch; unsigned char * buffer; unsigned short num_grays; unsigned char pixel_mode; unsigned char palette_mode; void * palette; } FT_Bitmap ; 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.","title":"FT_Bitmap"},{"location":"ft2-basic_types.html#ft_pixel_mode","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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_BGRA , FT_PIXEL_MODE_MAX /* do not remove */ } FT_Pixel_Mode ; /* these constants are deprecated; use the corresponding ` FT_Pixel_Mode ` */ /* values instead. */ # 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 An enumeration type used to describe the format of pixels in a given bitmap. Note that additional formats may be added in the future.","title":"FT_Pixel_Mode"},{"location":"ft2-basic_types.html#ft_glyph_format","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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_IMAGE_TAG ( FT_GLYPH_FORMAT_SVG , 'S', 'V', 'G', ' ' ) } FT_Glyph_Format ; /* these constants are deprecated; use the corresponding */ /* ` FT_Glyph_Format ` values instead. */ # 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 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.","title":"FT_Glyph_Format"},{"location":"ft2-basic_types.html#ft_image_tag","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). # ifndef FT_IMAGE_TAG # define FT_IMAGE_TAG ( value, _x1, _x2, _x3, _x4 ) \\ value = ( ( FT_STATIC_BYTE_CAST( unsigned long , _x1 ) << 24 ) | \\ ( FT_STATIC_BYTE_CAST( unsigned long , _x2 ) << 16 ) | \\ ( FT_STATIC_BYTE_CAST( unsigned long , _x3 ) << 8 ) | \\ FT_STATIC_BYTE_CAST( unsigned long , _x4 ) ) # endif /* FT_IMAGE_TAG */ This macro converts four-letter tags to an unsigned long type.","title":"FT_IMAGE_TAG"},{"location":"ft2-bdf_fonts.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb BDF and PCF Files BDF and PCF Files \u00b6 Synopsis \u00b6 This section contains the declaration of functions specific to BDF and PCF fonts. BDF_PropertyType \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). typedef enum BDF_PropertyType_ { BDF_PROPERTY_TYPE_NONE = 0, BDF_PROPERTY_TYPE_ATOM = 1, BDF_PROPERTY_TYPE_INTEGER = 2, BDF_PROPERTY_TYPE_CARDINAL = 3 } BDF_PropertyType ; A list of BDF property types. values BDF_PROPERTY_TYPE_NONE Value 0 is used to indicate a missing property. BDF_PROPERTY_TYPE_ATOM Property is a string atom. BDF_PROPERTY_TYPE_INTEGER Property is a 32-bit signed integer. BDF_PROPERTY_TYPE_CARDINAL Property is a 32-bit unsigned integer. BDF_Property \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). typedef struct BDF_PropertyRec_* BDF_Property ; A handle to a BDF_PropertyRec structure to model a given BDF/PCF property. BDF_PropertyRec \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). typedef struct BDF_PropertyRec_ { BDF_PropertyType type; union { const char * atom; FT_Int32 integer; FT_UInt32 cardinal; } u; } BDF_PropertyRec ; This structure models a given BDF/PCF property. fields type The property type. u.atom The atom string, if type is BDF_PROPERTY_TYPE_ATOM . May be NULL , indicating an empty string. u.integer A signed integer, if type is BDF_PROPERTY_TYPE_INTEGER . u.cardinal An unsigned integer, if type is BDF_PROPERTY_TYPE_CARDINAL . FT_Get_BDF_Charset_ID \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). FT_EXPORT( FT_Error ) FT_Get_BDF_Charset_ID ( FT_Face face, const char * *acharset_encoding, const char * *acharset_registry ); Retrieve a BDF font character set identity, according to the BDF specification. input face A handle to the 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 error code. 0 means success. note This function only works with BDF faces, returning an error otherwise. FT_Get_BDF_Property \u00b6 Defined in FT_BDF_H (freetype/ftbdf.h). FT_EXPORT( FT_Error ) FT_Get_BDF_Property ( FT_Face face, const char * prop_name, BDF_PropertyRec *aproperty ); Retrieve a BDF property from a BDF or PCF font file. input face A handle to the input face. name The property name. output aproperty The property. return FreeType error code. 0 means success. note This function works with BDF and PCF fonts. It returns an error otherwise. It also returns an error if the property is not in the font. A \u2018property\u2019 is a either key-value pair within the STARTPROPERTIES \u2026 ENDPROPERTIES block of a BDF font or a key-value pair from the info->props array within a FontRec structure of a PCF font. Integer properties are always stored as \u2018signed\u2019 within PCF fonts; consequently, BDF_PROPERTY_TYPE_CARDINAL is a possible return value for BDF fonts only. In case of error, aproperty->type is always set to BDF_PROPERTY_TYPE_NONE .","title":"BDF and PCF Files"},{"location":"ft2-bdf_fonts.html#bdf-and-pcf-files","text":"","title":"BDF and PCF Files"},{"location":"ft2-bdf_fonts.html#synopsis","text":"This section contains the declaration of functions specific to BDF and PCF fonts.","title":"Synopsis"},{"location":"ft2-bdf_fonts.html#bdf_propertytype","text":"Defined in FT_BDF_H (freetype/ftbdf.h). typedef enum BDF_PropertyType_ { BDF_PROPERTY_TYPE_NONE = 0, BDF_PROPERTY_TYPE_ATOM = 1, BDF_PROPERTY_TYPE_INTEGER = 2, BDF_PROPERTY_TYPE_CARDINAL = 3 } BDF_PropertyType ; A list of BDF property types.","title":"BDF_PropertyType"},{"location":"ft2-bdf_fonts.html#bdf_property","text":"Defined in FT_BDF_H (freetype/ftbdf.h). typedef struct BDF_PropertyRec_* BDF_Property ; A handle to a BDF_PropertyRec structure to model a given BDF/PCF property.","title":"BDF_Property"},{"location":"ft2-bdf_fonts.html#bdf_propertyrec","text":"Defined in FT_BDF_H (freetype/ftbdf.h). typedef struct BDF_PropertyRec_ { BDF_PropertyType type; union { const char * atom; FT_Int32 integer; FT_UInt32 cardinal; } u; } BDF_PropertyRec ; This structure models a given BDF/PCF property.","title":"BDF_PropertyRec"},{"location":"ft2-bdf_fonts.html#ft_get_bdf_charset_id","text":"Defined in FT_BDF_H (freetype/ftbdf.h). FT_EXPORT( FT_Error ) FT_Get_BDF_Charset_ID ( FT_Face face, const char * *acharset_encoding, const char * *acharset_registry ); Retrieve a BDF font character set identity, according to the BDF specification.","title":"FT_Get_BDF_Charset_ID"},{"location":"ft2-bdf_fonts.html#ft_get_bdf_property","text":"Defined in FT_BDF_H (freetype/ftbdf.h). FT_EXPORT( FT_Error ) FT_Get_BDF_Property ( FT_Face face, const char * prop_name, BDF_PropertyRec *aproperty ); Retrieve a BDF property from a BDF or PCF font file.","title":"FT_Get_BDF_Property"},{"location":"ft2-bitmap_handling.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Bitmap Handling Bitmap Handling \u00b6 Synopsis \u00b6 This section contains functions for handling FT_Bitmap objects, automatically adjusting the target's bitmap buffer size as needed. Note that none of the functions changes the bitmap's \u2018flow\u2019 (as indicated by the sign of the pitch field in FT_Bitmap ). To set the flow, assign an appropriate positive or negative value to the pitch field of the target FT_Bitmap object after calling FT_Bitmap_Init but before calling any of the other functions described here. FT_Bitmap_Init \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( void ) FT_Bitmap_Init ( FT_Bitmap *abitmap ); /* deprecated */ FT_EXPORT( void ) FT_Bitmap_New( FT_Bitmap *abitmap ); Initialize a pointer to an FT_Bitmap structure. inout abitmap A pointer to the bitmap structure. note A deprecated name for the same function is FT_Bitmap_New . FT_Bitmap_Copy \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Copy ( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target ); Copy a bitmap into another one. input library A handle to a library object. source A handle to the source bitmap. output target A handle to the target bitmap. return FreeType error code. 0 means success. note source->buffer and target->buffer must neither be equal nor overlap. FT_Bitmap_Embolden \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Embolden ( FT_Library library, FT_Bitmap * bitmap, FT_Pos xStrength, FT_Pos yStrength ); Embolden a bitmap. The new bitmap will be about xStrength pixels wider and yStrength pixels higher. The left and bottom borders are kept unchanged. input library A handle to a library object. xStrength How strong the glyph is emboldened horizontally. Expressed in 26.6 pixel format. yStrength How strong the glyph is emboldened vertically. Expressed in 26.6 pixel format. inout bitmap A handle to the target bitmap. return FreeType error code. 0 means success. note The current implementation restricts xStrength to be less than or equal to 8 if bitmap is of pixel_mode FT_PIXEL_MODE_MONO . If you want to embolden the bitmap owned by a FT_GlyphSlotRec , you should call FT_GlyphSlot_Own_Bitmap on the slot first. Bitmaps in FT_PIXEL_MODE_GRAY2 and FT_PIXEL_MODE_GRAY @ format are converted to FT_PIXEL_MODE_GRAY format (i.e., 8bpp). FT_Bitmap_Convert \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Convert ( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target, FT_Int alignment ); Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to a bitmap object with depth 8bpp, making the number of used bytes per line (a.k.a. the \u2018pitch\u2019) a multiple of alignment . input library A handle to a library object. source The source bitmap. alignment The pitch of the bitmap is a multiple of this argument. Common values are 1, 2, or 4. output target The target bitmap. return FreeType error code. 0 means success. note It is possible to call FT_Bitmap_Convert multiple times without calling FT_Bitmap_Done (the memory is simply reallocated). Use FT_Bitmap_Done to finally remove the bitmap object. The library argument is taken to have access to FreeType's memory handling functions. source->buffer and target->buffer must neither be equal nor overlap. FT_Bitmap_Blend \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Blend ( FT_Library library, const FT_Bitmap * source, const FT_Vector source_offset, FT_Bitmap * target, FT_Vector *atarget_offset, FT_Color color ); Blend a bitmap onto another bitmap, using a given color. input library A handle to a library object. source The source bitmap, which can have any FT_Pixel_Mode format. source_offset The offset vector to the upper left corner of the source bitmap in 26.6 pixel format. It should represent an integer offset; the function will set the lowest six bits to zero to enforce that. color The color used to draw source onto target . inout target A handle to an FT_Bitmap object. It should be either initialized as empty with a call to FT_Bitmap_Init , or it should be of type FT_PIXEL_MODE_BGRA . atarget_offset The offset vector to the upper left corner of the target bitmap in 26.6 pixel format. It should represent an integer offset; the function will set the lowest six bits to zero to enforce that. return FreeType error code. 0 means success. note This function doesn't perform clipping. The bitmap in target gets allocated or reallocated as needed; the vector atarget_offset is updated accordingly. In case of allocation or reallocation, the bitmap's pitch is set to 4 * width . Both source and target must have the same bitmap flow (as indicated by the sign of the pitch field). source->buffer and target->buffer must neither be equal nor overlap. since 2.10 FT_GlyphSlot_Own_Bitmap \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_GlyphSlot_Own_Bitmap ( FT_GlyphSlot slot ); Make sure that a glyph slot owns slot->bitmap . input slot The glyph slot. return FreeType error code. 0 means success. note This function is to be used in combination with FT_Bitmap_Embolden . FT_Bitmap_Done \u00b6 Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Done ( FT_Library library, FT_Bitmap *bitmap ); Destroy a bitmap object initialized with FT_Bitmap_Init . input library A handle to a library object. bitmap The bitmap object to be freed. return FreeType error code. 0 means success. note The library argument is taken to have access to FreeType's memory handling functions.","title":"Bitmap Handling"},{"location":"ft2-bitmap_handling.html#bitmap-handling","text":"","title":"Bitmap Handling"},{"location":"ft2-bitmap_handling.html#synopsis","text":"This section contains functions for handling FT_Bitmap objects, automatically adjusting the target's bitmap buffer size as needed. Note that none of the functions changes the bitmap's \u2018flow\u2019 (as indicated by the sign of the pitch field in FT_Bitmap ). To set the flow, assign an appropriate positive or negative value to the pitch field of the target FT_Bitmap object after calling FT_Bitmap_Init but before calling any of the other functions described here.","title":"Synopsis"},{"location":"ft2-bitmap_handling.html#ft_bitmap_init","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( void ) FT_Bitmap_Init ( FT_Bitmap *abitmap ); /* deprecated */ FT_EXPORT( void ) FT_Bitmap_New( FT_Bitmap *abitmap ); Initialize a pointer to an FT_Bitmap structure.","title":"FT_Bitmap_Init"},{"location":"ft2-bitmap_handling.html#ft_bitmap_copy","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Copy ( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target ); Copy a bitmap into another one.","title":"FT_Bitmap_Copy"},{"location":"ft2-bitmap_handling.html#ft_bitmap_embolden","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Embolden ( FT_Library library, FT_Bitmap * bitmap, FT_Pos xStrength, FT_Pos yStrength ); Embolden a bitmap. The new bitmap will be about xStrength pixels wider and yStrength pixels higher. The left and bottom borders are kept unchanged.","title":"FT_Bitmap_Embolden"},{"location":"ft2-bitmap_handling.html#ft_bitmap_convert","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Convert ( FT_Library library, const FT_Bitmap *source, FT_Bitmap *target, FT_Int alignment ); Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, 8bpp or 32bpp to a bitmap object with depth 8bpp, making the number of used bytes per line (a.k.a. the \u2018pitch\u2019) a multiple of alignment .","title":"FT_Bitmap_Convert"},{"location":"ft2-bitmap_handling.html#ft_bitmap_blend","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Blend ( FT_Library library, const FT_Bitmap * source, const FT_Vector source_offset, FT_Bitmap * target, FT_Vector *atarget_offset, FT_Color color ); Blend a bitmap onto another bitmap, using a given color.","title":"FT_Bitmap_Blend"},{"location":"ft2-bitmap_handling.html#ft_glyphslot_own_bitmap","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_GlyphSlot_Own_Bitmap ( FT_GlyphSlot slot ); Make sure that a glyph slot owns slot->bitmap .","title":"FT_GlyphSlot_Own_Bitmap"},{"location":"ft2-bitmap_handling.html#ft_bitmap_done","text":"Defined in FT_BITMAP_H (freetype/ftbitmap.h). FT_EXPORT( FT_Error ) FT_Bitmap_Done ( FT_Library library, FT_Bitmap *bitmap ); Destroy a bitmap object initialized with FT_Bitmap_Init .","title":"FT_Bitmap_Done"},{"location":"ft2-bzip2.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb BZIP2 Streams BZIP2 Streams \u00b6 Synopsis \u00b6 In certain builds of the library, bzip2 compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a bzip2 compressed stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of Bzip2-specific functions. FT_Stream_OpenBzip2 \u00b6 Defined in FT_BZIP2_H (freetype/ftbzip2.h). FT_EXPORT( FT_Error ) FT_Stream_OpenBzip2 ( FT_Stream stream, FT_Stream source ); Open a new stream to parse bzip2-compressed font files. This is mainly used to support the compressed *.pcf.bz2 fonts that come with XFree86. input stream The target embedding stream. source The source stream. return FreeType error code. 0 means success. note The source stream must be opened before calling this function. Calling the internal function FT_Stream_Close on the new stream will not call FT_Stream_Close on the source stream. None of the stream objects will be released to the heap. This function may return FT_Err_Unimplemented_Feature if your build of FreeType was not compiled with bzip2 support.","title":"BZIP2 Streams"},{"location":"ft2-bzip2.html#bzip2-streams","text":"","title":"BZIP2 Streams"},{"location":"ft2-bzip2.html#synopsis","text":"In certain builds of the library, bzip2 compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a bzip2 compressed stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of Bzip2-specific functions.","title":"Synopsis"},{"location":"ft2-bzip2.html#ft_stream_openbzip2","text":"Defined in FT_BZIP2_H (freetype/ftbzip2.h). FT_EXPORT( FT_Error ) FT_Stream_OpenBzip2 ( FT_Stream stream, FT_Stream source ); Open a new stream to parse bzip2-compressed font files. This is mainly used to support the compressed *.pcf.bz2 fonts that come with XFree86.","title":"FT_Stream_OpenBzip2"},{"location":"ft2-cache_subsystem.html","text":"FreeType \u00bb Docs \u00bb Cache Sub-System \u00bb Cache Sub-System Cache Sub-System \u00b6 Synopsis \u00b6 This section describes the FreeType 2 cache sub-system, which is used to limit the number of concurrently opened FT_Face and FT_Size objects, as well as caching information like character maps and glyph images while limiting their maximum memory usage. Note that all types and functions begin with the FTC_ prefix. The cache is highly portable and thus doesn't know anything about the fonts installed on your system, or how to access them. This implies the following scheme: First, available or installed font faces are uniquely identified by FTC_FaceID values, provided to the cache by the client. Note that the cache only stores and compares these values, and doesn't try to interpret them in any way. Second, the cache calls, only when needed, a client-provided function to convert an FTC_FaceID into a new FT_Face object. The latter is then completely managed by the cache, including its termination through FT_Done_Face . To monitor termination of face objects, the finalizer callback in the generic field of the FT_Face object can be used, which might also be used to store the FTC_FaceID of the face. Clients are free to map face IDs to anything else. The most simple usage is to associate them to a (pathname,face_index) pair that is used to call FT_New_Face . However, more complex schemes are also possible. Note that for the cache to work correctly, the face ID values must be persistent , which means that the contents they point to should not change at runtime, or that their value should not become invalid. If this is unavoidable (e.g., when a font is uninstalled at runtime), you should call FTC_Manager_RemoveFaceID as soon as possible, to let the cache get rid of any references to the old FTC_FaceID it may keep internally. Failure to do so will lead to incorrect behaviour or even crashes. To use the cache, start with calling FTC_Manager_New to create a new FTC_Manager object, which models a single cache instance. You can then look up FT_Face and FT_Size objects with FTC_Manager_LookupFace and FTC_Manager_LookupSize , respectively. If you want to use the charmap caching, call FTC_CMapCache_New , then later use FTC_CMapCache_Lookup to perform the equivalent of FT_Get_Char_Index , only much faster. If you want to use the FT_Glyph caching, call FTC_ImageCache_New , then later use FTC_ImageCache_Lookup to retrieve the corresponding FT_Glyph objects from the cache. If you need lots of small bitmaps, it is much more memory efficient to call FTC_SBitCache_New followed by FTC_SBitCache_Lookup . This returns FTC_SBitRec structures, which are used to store small bitmaps directly. (A small bitmap is one whose metrics and dimensions all fit into 8-bit integers). We hope to also provide a kerning cache in the near future. FTC_Manager \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ManagerRec_* FTC_Manager ; This object corresponds to one instance of the cache-subsystem. It is used to cache one or more FT_Face objects, along with corresponding FT_Size objects. The manager intentionally limits the total number of opened FT_Face and FT_Size objects to control memory usage. See the max_faces and max_sizes parameters of FTC_Manager_New . The manager is also used to cache \u2018nodes\u2019 of various types while limiting their total memory usage. All limitations are enforced by keeping lists of managed objects in most-recently-used order, and flushing old nodes to make room for new ones. FTC_FaceID \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef FT_Pointer FTC_FaceID ; An opaque pointer type that is used to identity face objects. The contents of such objects is application-dependent. These pointers are typically used to point to a user-defined structure containing a font file path, and face index. note Never use NULL as a valid FTC_FaceID . Face IDs are passed by the client to the cache manager that calls, when needed, the FTC_Face_Requester to translate them into new FT_Face objects. If the content of a given face ID changes at runtime, or if the value becomes invalid (e.g., when uninstalling a font), you should immediately call FTC_Manager_RemoveFaceID before any other cache function. Failure to do so will result in incorrect behaviour or even memory leaks and crashes. FTC_Face_Requester \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef FT_Error (* FTC_Face_Requester )( FTC_FaceID face_id, FT_Library library, FT_Pointer req_data, FT_Face * aface ); A callback function provided by client applications. It is used by the cache manager to translate a given FTC_FaceID into a new valid FT_Face object, on demand. input face_id The face ID to resolve. library A handle to a FreeType library object. req_data Application-provided request data (see note below). output aface A new FT_Face handle. return FreeType error code. 0 means success. note The third parameter req_data is the same as the one passed by the client when FTC_Manager_New is called. 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 ! FTC_Manager_New \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). 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 ); Create a new cache manager. input library The parent FreeType library handle to use. max_faces Maximum number of opened FT_Face objects managed by this cache instance. Use 0 for defaults. max_sizes Maximum number of opened FT_Size objects managed by this cache instance. Use 0 for defaults. max_bytes Maximum number of bytes to use for cached data nodes. Use 0 for defaults. Note that this value does not account for managed FT_Face and FT_Size objects. 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. FTC_Manager_Reset \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_Reset ( FTC_Manager manager ); Empty 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. FTC_Manager_Done \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_Done ( FTC_Manager manager ); Destroy a given manager after emptying it. input manager A handle to the target cache manager object. FTC_Manager_LookupFace \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_Manager_LookupFace ( FTC_Manager manager, FTC_FaceID face_id, FT_Face *aface ); Retrieve 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 \u2018font size\u2019, use FTC_Manager_LookupSize instead. Never change the face's transformation matrix (i.e., never call the FT_Set_Transform function) on a returned face! If you need to transform glyphs, do it yourself after glyph loading. When you perform a lookup, out-of-memory errors are detected within the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed. If a lookup fails with FT_Err_Out_Of_Memory the cache has already been completely flushed, and still no memory was available for the operation. FTC_Manager_LookupSize \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_Manager_LookupSize ( FTC_Manager manager, FTC_Scaler scaler, FT_Size *asize ); Retrieve the FT_Size object that corresponds to a given FTC_ScalerRec pointer through a cache manager. input manager A handle to the cache manager. scaler A scaler handle. output asize A handle to the size object. return FreeType error code. 0 means success. note The returned FT_Size object is always owned by the manager. You should never try to discard it by yourself. You can access the parent FT_Face object simply as size->face if you need it. Note that this object is also owned by the manager. note When you perform a lookup, out-of-memory errors are detected within the lookup and force incremental flushes of the cache until enough memory is released for the lookup to succeed. If a lookup fails with FT_Err_Out_Of_Memory the cache has already been completely flushed, and still no memory is available for the operation. FTC_Manager_RemoveFaceID \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_RemoveFaceID ( FTC_Manager manager, FTC_FaceID face_id ); A special function used to indicate to the cache manager that a given FTC_FaceID is no longer valid, either because its content changed, or because it was deallocated or uninstalled. input manager The cache manager handle. face_id The FTC_FaceID to be removed. note This function flushes all nodes from the cache corresponding to this face_id , with the exception of nodes with a non-null reference count. Such nodes are however modified internally so as to never appear in later lookups with the same face_id value, and to be immediately destroyed when released by all their users. FTC_Node \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_NodeRec_* FTC_Node ; 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 look up nodes, you have the ability to \u2018acquire\u2019 them, i.e., to increment their reference count. This will prevent the node from being flushed out of the cache until you explicitly \u2018release\u2019 it (see FTC_Node_Unref ). See also FTC_SBitCache_Lookup and FTC_ImageCache_Lookup . FTC_Node_Unref \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Node_Unref ( FTC_Node node, FTC_Manager manager ); 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. FTC_ImageCache \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageCacheRec_* FTC_ImageCache ; A handle to a glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold. FTC_ImageCache_New \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_New ( FTC_Manager manager, FTC_ImageCache *acache ); Create 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. FTC_ImageCache_Lookup \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_Lookup ( FTC_ImageCache cache, FTC_ImageType type, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); Retrieve 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 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 \u2018release\u2019 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! FTC_SBit \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_SBitRec_* FTC_SBit ; A handle to a small bitmap descriptor. See the FTC_SBitRec structure for details. FTC_SBitCache \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_SBitCacheRec_* FTC_SBitCache ; 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 . FTC_SBitCache_New \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_New ( FTC_Manager manager, FTC_SBitCache *acache ); Create 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. FTC_SBitCache_Lookup \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_Lookup ( FTC_SBitCache cache, FTC_ImageType type, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); Look up a given small glyph bitmap in a given sbit cache and \u2018lock\u2019 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 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 \u2018release\u2019 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! FTC_CMapCache \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_CMapCacheRec_* FTC_CMapCache ; An opaque handle used to model a charmap cache. This cache is to hold character codes -> glyph indices mappings. FTC_CMapCache_New \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_CMapCache_New ( FTC_Manager manager, FTC_CMapCache *acache ); Create a new charmap cache. input manager A handle to the cache manager. output acache A new cache handle. NULL in case of error. return FreeType error code. 0 means success. note Like all other caches, this one will be destroyed with the cache manager. FTC_CMapCache_Lookup \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_UInt ) FTC_CMapCache_Lookup ( FTC_CMapCache cache, FTC_FaceID face_id, FT_Int cmap_index, FT_UInt32 char_code ); Translate a character code into a glyph index, using the charmap cache. input cache A charmap cache handle. face_id The source face ID. cmap_index The index of the charmap in the source face. Any negative value means to use the cache FT_Face 's default charmap. char_code The character code (in the corresponding charmap). return Glyph index. 0 means \u2018no glyph\u2019. FTC_ScalerRec \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ScalerRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int pixel; FT_UInt x_res; FT_UInt y_res; } FTC_ScalerRec ; A structure used to describe a given character size in either pixels or points to the cache manager. See FTC_Manager_LookupSize . fields face_id The source face ID. width The character width. height The character height. pixel A Boolean. If 1, the width and height fields are interpreted as integer pixel character sizes. Otherwise, they are expressed as 1/64th of points. x_res Only used when pixel is value 0 to indicate the horizontal resolution in dpi. y_res Only used when pixel is value 0 to indicate the vertical resolution in dpi. note This type is mainly used to retrieve FT_Size objects through the cache manager. FTC_Scaler \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ScalerRec_* FTC_Scaler ; A handle to an FTC_ScalerRec structure. FTC_ImageTypeRec \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageTypeRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int32 flags; } FTC_ImageTypeRec ; A structure used to model the type of images in a glyph cache. fields face_id The face ID. width The width in pixels. height The height in pixels. flags The load flags, as in FT_Load_Glyph . FTC_ImageType \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageTypeRec_* FTC_ImageType ; A handle to an FTC_ImageTypeRec structure. FTC_ImageCache_LookupScaler \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_LookupScaler ( FTC_ImageCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); A variant of FTC_ImageCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size. input cache A handle to the source glyph image cache. scaler A pointer to a scaler descriptor. load_flags The corresponding load flags. 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 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 \u2018release\u2019 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! Calls to FT_Set_Char_Size and friends have no effect on cached glyphs; you should always use the FreeType cache API instead. FTC_SBitRec \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). 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 ; 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. \u2018left side bearing\u2019, or \u2018lsb\u2019). top The vertical distance from the pen position (on the baseline) to the upper bitmap border (a.k.a. \u2018top side bearing\u2019). 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. FTC_SBitCache_LookupScaler \u00b6 Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_LookupScaler ( FTC_SBitCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); A variant of FTC_SBitCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size. input cache A handle to the source sbit cache. scaler A pointer to the scaler descriptor. load_flags The corresponding load flags. gindex The glyph index. output sbit A handle to a small bitmap descriptor. anode Used to return the address 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 \u2018release\u2019 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!","title":"Cache Sub-System"},{"location":"ft2-cache_subsystem.html#cache-sub-system","text":"","title":"Cache Sub-System"},{"location":"ft2-cache_subsystem.html#synopsis","text":"This section describes the FreeType 2 cache sub-system, which is used to limit the number of concurrently opened FT_Face and FT_Size objects, as well as caching information like character maps and glyph images while limiting their maximum memory usage. Note that all types and functions begin with the FTC_ prefix. The cache is highly portable and thus doesn't know anything about the fonts installed on your system, or how to access them. This implies the following scheme: First, available or installed font faces are uniquely identified by FTC_FaceID values, provided to the cache by the client. Note that the cache only stores and compares these values, and doesn't try to interpret them in any way. Second, the cache calls, only when needed, a client-provided function to convert an FTC_FaceID into a new FT_Face object. The latter is then completely managed by the cache, including its termination through FT_Done_Face . To monitor termination of face objects, the finalizer callback in the generic field of the FT_Face object can be used, which might also be used to store the FTC_FaceID of the face. Clients are free to map face IDs to anything else. The most simple usage is to associate them to a (pathname,face_index) pair that is used to call FT_New_Face . However, more complex schemes are also possible. Note that for the cache to work correctly, the face ID values must be persistent , which means that the contents they point to should not change at runtime, or that their value should not become invalid. If this is unavoidable (e.g., when a font is uninstalled at runtime), you should call FTC_Manager_RemoveFaceID as soon as possible, to let the cache get rid of any references to the old FTC_FaceID it may keep internally. Failure to do so will lead to incorrect behaviour or even crashes. To use the cache, start with calling FTC_Manager_New to create a new FTC_Manager object, which models a single cache instance. You can then look up FT_Face and FT_Size objects with FTC_Manager_LookupFace and FTC_Manager_LookupSize , respectively. If you want to use the charmap caching, call FTC_CMapCache_New , then later use FTC_CMapCache_Lookup to perform the equivalent of FT_Get_Char_Index , only much faster. If you want to use the FT_Glyph caching, call FTC_ImageCache_New , then later use FTC_ImageCache_Lookup to retrieve the corresponding FT_Glyph objects from the cache. If you need lots of small bitmaps, it is much more memory efficient to call FTC_SBitCache_New followed by FTC_SBitCache_Lookup . This returns FTC_SBitRec structures, which are used to store small bitmaps directly. (A small bitmap is one whose metrics and dimensions all fit into 8-bit integers). We hope to also provide a kerning cache in the near future.","title":"Synopsis"},{"location":"ft2-cache_subsystem.html#ftc_manager","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ManagerRec_* FTC_Manager ; This object corresponds to one instance of the cache-subsystem. It is used to cache one or more FT_Face objects, along with corresponding FT_Size objects. The manager intentionally limits the total number of opened FT_Face and FT_Size objects to control memory usage. See the max_faces and max_sizes parameters of FTC_Manager_New . The manager is also used to cache \u2018nodes\u2019 of various types while limiting their total memory usage. All limitations are enforced by keeping lists of managed objects in most-recently-used order, and flushing old nodes to make room for new ones.","title":"FTC_Manager"},{"location":"ft2-cache_subsystem.html#ftc_faceid","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef FT_Pointer FTC_FaceID ; An opaque pointer type that is used to identity face objects. The contents of such objects is application-dependent. These pointers are typically used to point to a user-defined structure containing a font file path, and face index.","title":"FTC_FaceID"},{"location":"ft2-cache_subsystem.html#ftc_face_requester","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef FT_Error (* FTC_Face_Requester )( FTC_FaceID face_id, FT_Library library, FT_Pointer req_data, FT_Face * aface ); A callback function provided by client applications. It is used by the cache manager to translate a given FTC_FaceID into a new valid FT_Face object, on demand.","title":"FTC_Face_Requester"},{"location":"ft2-cache_subsystem.html#ftc_manager_new","text":"Defined in FT_CACHE_H (freetype/ftcache.h). 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 ); Create a new cache manager.","title":"FTC_Manager_New"},{"location":"ft2-cache_subsystem.html#ftc_manager_reset","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_Reset ( FTC_Manager manager ); Empty a given cache manager. This simply gets rid of all the currently cached FT_Face and FT_Size objects within the manager.","title":"FTC_Manager_Reset"},{"location":"ft2-cache_subsystem.html#ftc_manager_done","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_Done ( FTC_Manager manager ); Destroy a given manager after emptying it.","title":"FTC_Manager_Done"},{"location":"ft2-cache_subsystem.html#ftc_manager_lookupface","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_Manager_LookupFace ( FTC_Manager manager, FTC_FaceID face_id, FT_Face *aface ); Retrieve the FT_Face object that corresponds to a given face ID through a cache manager.","title":"FTC_Manager_LookupFace"},{"location":"ft2-cache_subsystem.html#ftc_manager_lookupsize","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_Manager_LookupSize ( FTC_Manager manager, FTC_Scaler scaler, FT_Size *asize ); Retrieve the FT_Size object that corresponds to a given FTC_ScalerRec pointer through a cache manager.","title":"FTC_Manager_LookupSize"},{"location":"ft2-cache_subsystem.html#ftc_manager_removefaceid","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Manager_RemoveFaceID ( FTC_Manager manager, FTC_FaceID face_id ); A special function used to indicate to the cache manager that a given FTC_FaceID is no longer valid, either because its content changed, or because it was deallocated or uninstalled.","title":"FTC_Manager_RemoveFaceID"},{"location":"ft2-cache_subsystem.html#ftc_node","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_NodeRec_* FTC_Node ; 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 look up nodes, you have the ability to \u2018acquire\u2019 them, i.e., to increment their reference count. This will prevent the node from being flushed out of the cache until you explicitly \u2018release\u2019 it (see FTC_Node_Unref ). See also FTC_SBitCache_Lookup and FTC_ImageCache_Lookup .","title":"FTC_Node"},{"location":"ft2-cache_subsystem.html#ftc_node_unref","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( void ) FTC_Node_Unref ( FTC_Node node, FTC_Manager manager ); Decrement a cache node's internal reference count. When the count reaches 0, it is not destroyed but becomes eligible for subsequent cache flushes.","title":"FTC_Node_Unref"},{"location":"ft2-cache_subsystem.html#ftc_imagecache","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageCacheRec_* FTC_ImageCache ; A handle to a glyph image cache object. They are designed to hold many distinct glyph images while not exceeding a certain memory threshold.","title":"FTC_ImageCache"},{"location":"ft2-cache_subsystem.html#ftc_imagecache_new","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_New ( FTC_Manager manager, FTC_ImageCache *acache ); Create a new glyph image cache.","title":"FTC_ImageCache_New"},{"location":"ft2-cache_subsystem.html#ftc_imagecache_lookup","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_Lookup ( FTC_ImageCache cache, FTC_ImageType type, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); Retrieve a given glyph image from a glyph image cache.","title":"FTC_ImageCache_Lookup"},{"location":"ft2-cache_subsystem.html#ftc_sbit","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_SBitRec_* FTC_SBit ; A handle to a small bitmap descriptor. See the FTC_SBitRec structure for details.","title":"FTC_SBit"},{"location":"ft2-cache_subsystem.html#ftc_sbitcache","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_SBitCacheRec_* FTC_SBitCache ; 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 .","title":"FTC_SBitCache"},{"location":"ft2-cache_subsystem.html#ftc_sbitcache_new","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_New ( FTC_Manager manager, FTC_SBitCache *acache ); Create a new cache to store small glyph bitmaps.","title":"FTC_SBitCache_New"},{"location":"ft2-cache_subsystem.html#ftc_sbitcache_lookup","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_Lookup ( FTC_SBitCache cache, FTC_ImageType type, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); Look up a given small glyph bitmap in a given sbit cache and \u2018lock\u2019 it to prevent its flushing from the cache until needed.","title":"FTC_SBitCache_Lookup"},{"location":"ft2-cache_subsystem.html#ftc_cmapcache","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_CMapCacheRec_* FTC_CMapCache ; An opaque handle used to model a charmap cache. This cache is to hold character codes -> glyph indices mappings.","title":"FTC_CMapCache"},{"location":"ft2-cache_subsystem.html#ftc_cmapcache_new","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_CMapCache_New ( FTC_Manager manager, FTC_CMapCache *acache ); Create a new charmap cache.","title":"FTC_CMapCache_New"},{"location":"ft2-cache_subsystem.html#ftc_cmapcache_lookup","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_UInt ) FTC_CMapCache_Lookup ( FTC_CMapCache cache, FTC_FaceID face_id, FT_Int cmap_index, FT_UInt32 char_code ); Translate a character code into a glyph index, using the charmap cache.","title":"FTC_CMapCache_Lookup"},{"location":"ft2-cache_subsystem.html#ftc_scalerrec","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ScalerRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int pixel; FT_UInt x_res; FT_UInt y_res; } FTC_ScalerRec ; A structure used to describe a given character size in either pixels or points to the cache manager. See FTC_Manager_LookupSize .","title":"FTC_ScalerRec"},{"location":"ft2-cache_subsystem.html#ftc_scaler","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ScalerRec_* FTC_Scaler ; A handle to an FTC_ScalerRec structure.","title":"FTC_Scaler"},{"location":"ft2-cache_subsystem.html#ftc_imagetyperec","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageTypeRec_ { FTC_FaceID face_id; FT_UInt width; FT_UInt height; FT_Int32 flags; } FTC_ImageTypeRec ; A structure used to model the type of images in a glyph cache.","title":"FTC_ImageTypeRec"},{"location":"ft2-cache_subsystem.html#ftc_imagetype","text":"Defined in FT_CACHE_H (freetype/ftcache.h). typedef struct FTC_ImageTypeRec_* FTC_ImageType ; A handle to an FTC_ImageTypeRec structure.","title":"FTC_ImageType"},{"location":"ft2-cache_subsystem.html#ftc_imagecache_lookupscaler","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_ImageCache_LookupScaler ( FTC_ImageCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FT_Glyph *aglyph, FTC_Node *anode ); A variant of FTC_ImageCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size.","title":"FTC_ImageCache_LookupScaler"},{"location":"ft2-cache_subsystem.html#ftc_sbitrec","text":"Defined in FT_CACHE_H (freetype/ftcache.h). 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 ; A very compact structure used to describe a small glyph bitmap.","title":"FTC_SBitRec"},{"location":"ft2-cache_subsystem.html#ftc_sbitcache_lookupscaler","text":"Defined in FT_CACHE_H (freetype/ftcache.h). FT_EXPORT( FT_Error ) FTC_SBitCache_LookupScaler ( FTC_SBitCache cache, FTC_Scaler scaler, FT_ULong load_flags, FT_UInt gindex, FTC_SBit *sbit, FTC_Node *anode ); A variant of FTC_SBitCache_Lookup that uses an FTC_ScalerRec to specify the face ID and its size.","title":"FTC_SBitCache_LookupScaler"},{"location":"ft2-cff_driver.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The CFF driver The CFF driver \u00b6 Synopsis \u00b6 While FreeType's CFF driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The CFF driver's module name is \u2018cff\u2019. Available properties are hinting-engine , no-stem-darkening , darkening-parameters , and random-seed , as documented in the \u2018 Driver properties \u2019 section. Hinting and anti-aliasing principles of the new engine The rasterizer is positioning horizontal features (e.g., ascender height & x-height, or crossbars) on the pixel grid and minimizing the amount of anti-aliasing applied to them, while placing vertical features (vertical stems) on the pixel grid without hinting, thus representing the stem position and weight accurately. Sometimes the vertical stems may be only partially black. In this context, \u2018anti-aliasing\u2019 means that stems are not positioned exactly on pixel borders, causing a fuzzy appearance. There are two principles behind this approach. 1) No hinting in the horizontal direction: Unlike \u2018superhinted\u2019 TrueType, which changes glyph widths to accommodate regular inter-glyph spacing, Adobe's approach is \u2018faithful to the design\u2019 in representing both the glyph width and the inter-glyph spacing designed for the font. This makes the screen display as close as it can be to the result one would get with infinite resolution, while preserving what is considered the key characteristics of each glyph. Note that the distances between unhinted and grid-fitted positions at small sizes are comparable to kerning values and thus would be noticeable (and distracting) while reading if hinting were applied. One of the reasons to not hint horizontally is anti-aliasing for LCD screens: The pixel geometry of modern displays supplies three vertical subpixels as the eye moves horizontally across each visible pixel. On devices where we can be certain this characteristic is present a rasterizer can take advantage of the subpixels to add increments of weight. In Western writing systems this turns out to be the more critical direction anyway; the weights and spacing of vertical stems (see above) are central to Armenian, Cyrillic, Greek, and Latin type designs. Even when the rasterizer uses greyscale anti-aliasing instead of color (a necessary compromise when one doesn't know the screen characteristics), the unhinted vertical features preserve the design's weight and spacing much better than aliased type would. 2) Alignment in the vertical direction: Weights and spacing along the y axis are less critical; what is much more important is the visual alignment of related features (like cap-height and x-height). The sense of alignment for these is enhanced by the sharpness of grid-fit edges, while the cruder vertical resolution (full pixels instead of \u2153 pixels) is less of a problem. On the technical side, horizontal alignment zones for ascender, x-height, and other important height values (traditionally called \u2018blue zones\u2019) as defined in the font are positioned independently, each being rounded to the nearest pixel edge, taking care of overshoot suppression at small sizes, stem darkening, and scaling. Hstems (this is, hint values defined in the font to help align horizontal features) that fall within a blue zone are said to be \u2018captured\u2019 and are aligned to that zone. Uncaptured stems are moved in one of four ways, top edge up or down, bottom edge up or down. Unless there are conflicting hstems, the smallest movement is taken to minimize distortion.","title":"The CFF driver"},{"location":"ft2-cff_driver.html#the-cff-driver","text":"","title":"The CFF driver"},{"location":"ft2-cff_driver.html#synopsis","text":"While FreeType's CFF driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The CFF driver's module name is \u2018cff\u2019. Available properties are hinting-engine , no-stem-darkening , darkening-parameters , and random-seed , as documented in the \u2018 Driver properties \u2019 section. Hinting and anti-aliasing principles of the new engine The rasterizer is positioning horizontal features (e.g., ascender height & x-height, or crossbars) on the pixel grid and minimizing the amount of anti-aliasing applied to them, while placing vertical features (vertical stems) on the pixel grid without hinting, thus representing the stem position and weight accurately. Sometimes the vertical stems may be only partially black. In this context, \u2018anti-aliasing\u2019 means that stems are not positioned exactly on pixel borders, causing a fuzzy appearance. There are two principles behind this approach. 1) No hinting in the horizontal direction: Unlike \u2018superhinted\u2019 TrueType, which changes glyph widths to accommodate regular inter-glyph spacing, Adobe's approach is \u2018faithful to the design\u2019 in representing both the glyph width and the inter-glyph spacing designed for the font. This makes the screen display as close as it can be to the result one would get with infinite resolution, while preserving what is considered the key characteristics of each glyph. Note that the distances between unhinted and grid-fitted positions at small sizes are comparable to kerning values and thus would be noticeable (and distracting) while reading if hinting were applied. One of the reasons to not hint horizontally is anti-aliasing for LCD screens: The pixel geometry of modern displays supplies three vertical subpixels as the eye moves horizontally across each visible pixel. On devices where we can be certain this characteristic is present a rasterizer can take advantage of the subpixels to add increments of weight. In Western writing systems this turns out to be the more critical direction anyway; the weights and spacing of vertical stems (see above) are central to Armenian, Cyrillic, Greek, and Latin type designs. Even when the rasterizer uses greyscale anti-aliasing instead of color (a necessary compromise when one doesn't know the screen characteristics), the unhinted vertical features preserve the design's weight and spacing much better than aliased type would. 2) Alignment in the vertical direction: Weights and spacing along the y axis are less critical; what is much more important is the visual alignment of related features (like cap-height and x-height). The sense of alignment for these is enhanced by the sharpness of grid-fit edges, while the cruder vertical resolution (full pixels instead of \u2153 pixels) is less of a problem. On the technical side, horizontal alignment zones for ascender, x-height, and other important height values (traditionally called \u2018blue zones\u2019) as defined in the font are positioned independently, each being rounded to the nearest pixel edge, taking care of overshoot suppression at small sizes, stem darkening, and scaling. Hstems (this is, hint values defined in the font to help align horizontal features) that fall within a blue zone are said to be \u2018captured\u2019 and are aligned to that zone. Uncaptured stems are moved in one of four ways, top edge up or down, bottom edge up or down. Unless there are conflicting hstems, the smallest movement is taken to minimize distortion.","title":"Synopsis"},{"location":"ft2-cid_fonts.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb CID Fonts CID Fonts \u00b6 Synopsis \u00b6 This section contains the declaration of CID-keyed font-specific functions. FT_Get_CID_Registry_Ordering_Supplement \u00b6 Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_Registry_Ordering_Supplement ( FT_Face face, const char * *registry, const char * *ordering, FT_Int *supplement ); Retrieve the Registry/Ordering/Supplement triple (also known as the \"R/O/S\") from a CID-keyed font. input face A handle to the input face. output registry The registry, as a C string, owned by the face. ordering The ordering, as a C string, owned by the face. supplement The supplement. return FreeType error code. 0 means success. note This function only works with CID faces, returning an error otherwise. since 2.3.6 FT_Get_CID_Is_Internally_CID_Keyed \u00b6 Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_Is_Internally_CID_Keyed ( FT_Face face, FT_Bool *is_cid ); Retrieve the type of the input face, CID keyed or not. In contrast to the FT_IS_CID_KEYED macro this function returns successfully also for CID-keyed fonts in an SFNT wrapper. input face A handle to the input face. output is_cid The type of the face as an FT_Bool . return FreeType error code. 0 means success. note This function only works with CID faces and OpenType fonts, returning an error otherwise. since 2.3.9 FT_Get_CID_From_Glyph_Index \u00b6 Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_From_Glyph_Index ( FT_Face face, FT_UInt glyph_index, FT_UInt *cid ); Retrieve the CID of the input glyph index. input face A handle to the input face. glyph_index The input glyph index. output cid The CID as an FT_UInt . return FreeType error code. 0 means success. note This function only works with CID faces and OpenType fonts, returning an error otherwise. since 2.3.9","title":"CID Fonts"},{"location":"ft2-cid_fonts.html#cid-fonts","text":"","title":"CID Fonts"},{"location":"ft2-cid_fonts.html#synopsis","text":"This section contains the declaration of CID-keyed font-specific functions.","title":"Synopsis"},{"location":"ft2-cid_fonts.html#ft_get_cid_registry_ordering_supplement","text":"Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_Registry_Ordering_Supplement ( FT_Face face, const char * *registry, const char * *ordering, FT_Int *supplement ); Retrieve the Registry/Ordering/Supplement triple (also known as the \"R/O/S\") from a CID-keyed font.","title":"FT_Get_CID_Registry_Ordering_Supplement"},{"location":"ft2-cid_fonts.html#ft_get_cid_is_internally_cid_keyed","text":"Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_Is_Internally_CID_Keyed ( FT_Face face, FT_Bool *is_cid ); Retrieve the type of the input face, CID keyed or not. In contrast to the FT_IS_CID_KEYED macro this function returns successfully also for CID-keyed fonts in an SFNT wrapper.","title":"FT_Get_CID_Is_Internally_CID_Keyed"},{"location":"ft2-cid_fonts.html#ft_get_cid_from_glyph_index","text":"Defined in FT_CID_H (freetype/ftcid.h). FT_EXPORT( FT_Error ) FT_Get_CID_From_Glyph_Index ( FT_Face face, FT_UInt glyph_index, FT_UInt *cid ); Retrieve the CID of the input glyph index.","title":"FT_Get_CID_From_Glyph_Index"},{"location":"ft2-color_management.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Glyph Color Management Glyph Color Management \u00b6 Synopsis \u00b6 The functions described here allow access and manipulation of color palette entries in OpenType's \u2018CPAL\u2019 tables. FT_Color \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Color_ { FT_Byte blue; FT_Byte green; FT_Byte red; FT_Byte alpha; } FT_Color ; This structure models a BGRA color value of a \u2018CPAL\u2019 palette entry. The used color space is sRGB; the colors are not pre-multiplied, and alpha values must be explicitly set. fields blue Blue value. green Green value. red Red value. alpha Alpha value, giving the red, green, and blue color's opacity. since 2.10 FT_PALETTE_XXX \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). # define FT_PALETTE_FOR_LIGHT_BACKGROUND 0x01 # define FT_PALETTE_FOR_DARK_BACKGROUND 0x02 A list of bit field constants used in the palette_flags array of the FT_Palette_Data structure to indicate for which background a palette with a given index is usable. values FT_PALETTE_FOR_LIGHT_BACKGROUND The palette is appropriate to use when displaying the font on a light background such as white. FT_PALETTE_FOR_DARK_BACKGROUND The palette is appropriate to use when displaying the font on a dark background such as black. since 2.10 FT_Palette_Data \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Palette_Data_ { FT_UShort num_palettes; const FT_UShort * palette_name_ids; const FT_UShort * palette_flags; FT_UShort num_palette_entries; const FT_UShort * palette_entry_name_ids; } FT_Palette_Data ; This structure holds the data of the \u2018CPAL\u2019 table. fields num_palettes The number of palettes. palette_name_ids An optional read-only array of palette name IDs with num_palettes elements, corresponding to entries like \u2018dark\u2019 or \u2018light\u2019 in the font's \u2018name\u2019 table. An empty name ID in the \u2018CPAL\u2019 table gets represented as value 0xFFFF. NULL if the font's \u2018CPAL\u2019 table doesn't contain appropriate data. palette_flags An optional read-only array of palette flags with num_palettes elements. Possible values are an ORed combination of FT_PALETTE_FOR_LIGHT_BACKGROUND and FT_PALETTE_FOR_DARK_BACKGROUND . NULL if the font's \u2018CPAL\u2019 table doesn't contain appropriate data. num_palette_entries The number of entries in a single palette. All palettes have the same size. palette_entry_name_ids An optional read-only array of palette entry name IDs with num_palette_entries . In each palette, entries with the same index have the same function. For example, index 0 might correspond to string \u2018outline\u2019 in the font's \u2018name\u2019 table to indicate that this palette entry is used for outlines, index 1 might correspond to \u2018fill\u2019 to indicate the filling color palette entry, etc. An empty entry name ID in the \u2018CPAL\u2019 table gets represented as value 0xFFFF. NULL if the font's \u2018CPAL\u2019 table doesn't contain appropriate data. note Use function FT_Get_Sfnt_Name to map name IDs and entry name IDs to name strings. Use function FT_Palette_Select to get the colors associated with a palette entry. since 2.10 FT_Palette_Data_Get \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Data_Get ( FT_Face face, FT_Palette_Data *apalette ); Retrieve the face's color palette data. input face The source face handle. output apalette A pointer to an FT_Palette_Data structure. return FreeType error code. 0 means success. note All arrays in the returned FT_Palette_Data structure are read-only. This function always returns an error if the config macro TT_CONFIG_OPTION_COLOR_LAYERS is not defined in ftoption.h . since 2.10 FT_Palette_Select \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Select ( FT_Face face, FT_UShort palette_index, FT_Color * *apalette ); This function has two purposes. (1) It activates a palette for rendering color glyphs, and (2) it retrieves all (unmodified) color entries of this palette. This function returns a read-write array, which means that a calling application can modify the palette entries on demand. A corollary of (2) is that calling the function, then modifying some values, then calling the function again with the same arguments resets all color entries to the original \u2018CPAL\u2019 values; all user modifications are lost. input face The source face handle. palette_index The palette index. output apalette An array of color entries for a palette with index palette_index , having num_palette_entries elements (as found in the FT_Palette_Data structure). If apalette is set to NULL , no array gets returned (and no color entries can be modified). In case the font doesn't support color palettes, NULL is returned. return FreeType error code. 0 means success. note The array pointed to by apalette_entries is owned and managed by FreeType. This function always returns an error if the config macro TT_CONFIG_OPTION_COLOR_LAYERS is not defined in ftoption.h . since 2.10 FT_Palette_Set_Foreground_Color \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Set_Foreground_Color ( FT_Face face, FT_Color foreground_color ); \u2018COLR\u2019 uses palette index 0xFFFF to indicate a \u2018text foreground color\u2019. This function sets this value. input face The source face handle. foreground_color An FT_Color structure to define the text foreground color. return FreeType error code. 0 means success. note If this function isn't called, the text foreground color is set to white opaque (BGRA value 0xFFFFFFFF) if FT_PALETTE_FOR_DARK_BACKGROUND is present for the current palette, and black opaque (BGRA value 0x000000FF) otherwise, including the case that no palette types are available in the \u2018CPAL\u2019 table. This function always returns an error if the config macro TT_CONFIG_OPTION_COLOR_LAYERS is not defined in ftoption.h . since 2.10","title":"Glyph Color Management"},{"location":"ft2-color_management.html#glyph-color-management","text":"","title":"Glyph Color Management"},{"location":"ft2-color_management.html#synopsis","text":"The functions described here allow access and manipulation of color palette entries in OpenType's \u2018CPAL\u2019 tables.","title":"Synopsis"},{"location":"ft2-color_management.html#ft_color","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Color_ { FT_Byte blue; FT_Byte green; FT_Byte red; FT_Byte alpha; } FT_Color ; This structure models a BGRA color value of a \u2018CPAL\u2019 palette entry. The used color space is sRGB; the colors are not pre-multiplied, and alpha values must be explicitly set.","title":"FT_Color"},{"location":"ft2-color_management.html#ft_palette_xxx","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). # define FT_PALETTE_FOR_LIGHT_BACKGROUND 0x01 # define FT_PALETTE_FOR_DARK_BACKGROUND 0x02 A list of bit field constants used in the palette_flags array of the FT_Palette_Data structure to indicate for which background a palette with a given index is usable.","title":"FT_PALETTE_XXX"},{"location":"ft2-color_management.html#ft_palette_data","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Palette_Data_ { FT_UShort num_palettes; const FT_UShort * palette_name_ids; const FT_UShort * palette_flags; FT_UShort num_palette_entries; const FT_UShort * palette_entry_name_ids; } FT_Palette_Data ; This structure holds the data of the \u2018CPAL\u2019 table.","title":"FT_Palette_Data"},{"location":"ft2-color_management.html#ft_palette_data_get","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Data_Get ( FT_Face face, FT_Palette_Data *apalette ); Retrieve the face's color palette data.","title":"FT_Palette_Data_Get"},{"location":"ft2-color_management.html#ft_palette_select","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Select ( FT_Face face, FT_UShort palette_index, FT_Color * *apalette ); This function has two purposes. (1) It activates a palette for rendering color glyphs, and (2) it retrieves all (unmodified) color entries of this palette. This function returns a read-write array, which means that a calling application can modify the palette entries on demand. A corollary of (2) is that calling the function, then modifying some values, then calling the function again with the same arguments resets all color entries to the original \u2018CPAL\u2019 values; all user modifications are lost.","title":"FT_Palette_Select"},{"location":"ft2-color_management.html#ft_palette_set_foreground_color","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Error ) FT_Palette_Set_Foreground_Color ( FT_Face face, FT_Color foreground_color ); \u2018COLR\u2019 uses palette index 0xFFFF to indicate a \u2018text foreground color\u2019. This function sets this value.","title":"FT_Palette_Set_Foreground_Color"},{"location":"ft2-computations.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Computations Computations \u00b6 Synopsis \u00b6 This section contains various functions used to perform computations on 16.16 fixed-float numbers or 2d vectors. Attention : Most arithmetic functions take FT_Long as arguments. For historical reasons, FreeType was designed under the assumption that FT_Long is a 32-bit integer; results can thus be undefined if the arguments don't fit into 32 bits. FT_MulDiv \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_MulDiv ( FT_Long a, FT_Long b, FT_Long c ); Compute (a*b)/c with maximum accuracy, using 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 \u2018MaxInt\u2019 or \u2018MinInt\u2019 depending on the signs of a and b . FT_MulFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_MulFix ( FT_Long a, FT_Long b ); Compute (a*b)/0x10000 with maximum accuracy. Its main use is to multiply a given value by a 16.16 fixed-point 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_DivFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_DivFix ( FT_Long a, FT_Long b ); Compute (a*0x10000)/b with maximum accuracy. Its main use is to divide a given value by a 16.16 fixed-point factor. input a The numerator. b The denominator. Use a 16.16 factor here. return The result of (a*0x10000)/b . FT_RoundFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_RoundFix ( FT_Fixed a ); Round a 16.16 fixed number. input a The number to be rounded. return a rounded to the nearest 16.16 fixed integer, halfway cases away from zero. note The function uses wrap-around arithmetic. FT_CeilFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_CeilFix ( FT_Fixed a ); Compute the smallest following integer of a 16.16 fixed number. input a The number for which the ceiling function is to be computed. return a rounded towards plus infinity. note The function uses wrap-around arithmetic. FT_FloorFix \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_FloorFix ( FT_Fixed a ); Compute the largest previous integer of a 16.16 fixed number. input a The number for which the floor function is to be computed. return a rounded towards minus infinity. FT_Vector_Transform \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Vector_Transform ( FT_Vector * vector, const FT_Matrix * matrix ); Transform 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_Matrix_Multiply \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Matrix_Multiply ( const FT_Matrix * a, FT_Matrix * b ); Perform 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. Since the function uses wrap-around arithmetic, results become meaningless if the arguments are very large. FT_Matrix_Invert \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Matrix_Invert ( FT_Matrix * matrix ); Invert a 2x2 matrix. Return 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_Angle \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). typedef FT_Fixed FT_Angle ; This type is used to model angle values in FreeType. Note that the angle is a 16.16 fixed-point value expressed in degrees. FT_ANGLE_PI \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI ( 180L << 16 ) The angle pi expressed in FT_Angle units. FT_ANGLE_2PI \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) The angle 2*pi expressed in FT_Angle units. FT_ANGLE_PI2 \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) The angle pi/2 expressed in FT_Angle units. FT_ANGLE_PI4 \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) The angle pi/4 expressed in FT_Angle units. FT_Sin \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Sin ( FT_Angle angle ); Return the sinus of a given angle in fixed-point format. input angle The input angle. return The sinus value. note If you need both the sinus and cosinus for a given angle, use the function FT_Vector_Unit . FT_Cos \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Cos ( FT_Angle angle ); Return the cosinus of a given angle in fixed-point format. input angle The input angle. return The cosinus value. note If you need both the sinus and cosinus for a given angle, use the function FT_Vector_Unit . FT_Tan \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Tan ( FT_Angle angle ); Return the tangent of a given angle in fixed-point format. input angle The input angle. return The tangent value. FT_Atan2 \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Angle ) FT_Atan2 ( FT_Fixed x, FT_Fixed y ); Return the arc-tangent corresponding to a given vector (x,y) in the 2d plane. input x The horizontal vector coordinate. y The vertical vector coordinate. return The arc-tangent value (i.e. angle). FT_Angle_Diff \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Angle ) FT_Angle_Diff ( FT_Angle angle1, FT_Angle angle2 ); Return the difference between two angles. The result is always constrained to the ]-PI..PI] interval. input angle1 First angle. angle2 Second angle. return Constrained value of angle2-angle1 . FT_Vector_Unit \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Unit ( FT_Vector * vec, FT_Angle angle ); Return the unit vector corresponding to a given angle. After the call, the value of vec.x will be cos(angle) , and the value of vec.y will be sin(angle) . This function is useful to retrieve both the sinus and cosinus of a given angle quickly. output vec The address of target vector. input angle The input angle. FT_Vector_Rotate \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Rotate ( FT_Vector * vec, FT_Angle angle ); Rotate a vector by a given angle. inout vec The address of target vector. input angle The input angle. FT_Vector_Length \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Vector_Length ( FT_Vector * vec ); Return the length of a given vector. input vec The address of target vector. return The vector length, expressed in the same units that the original vector coordinates. FT_Vector_Polarize \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Polarize ( FT_Vector * vec, FT_Fixed *length, FT_Angle *angle ); Compute both the length and angle of a given vector. input vec The address of source vector. output length The vector length. angle The vector angle. FT_Vector_From_Polar \u00b6 Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_From_Polar ( FT_Vector * vec, FT_Fixed length, FT_Angle angle ); Compute vector coordinates from a length and angle. output vec The address of source vector. input length The vector length. angle The vector angle.","title":"Computations"},{"location":"ft2-computations.html#computations","text":"","title":"Computations"},{"location":"ft2-computations.html#synopsis","text":"This section contains various functions used to perform computations on 16.16 fixed-float numbers or 2d vectors. Attention : Most arithmetic functions take FT_Long as arguments. For historical reasons, FreeType was designed under the assumption that FT_Long is a 32-bit integer; results can thus be undefined if the arguments don't fit into 32 bits.","title":"Synopsis"},{"location":"ft2-computations.html#ft_muldiv","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_MulDiv ( FT_Long a, FT_Long b, FT_Long c ); Compute (a*b)/c with maximum accuracy, using 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.","title":"FT_MulDiv"},{"location":"ft2-computations.html#ft_mulfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_MulFix ( FT_Long a, FT_Long b ); Compute (a*b)/0x10000 with maximum accuracy. Its main use is to multiply a given value by a 16.16 fixed-point factor.","title":"FT_MulFix"},{"location":"ft2-computations.html#ft_divfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Long ) FT_DivFix ( FT_Long a, FT_Long b ); Compute (a*0x10000)/b with maximum accuracy. Its main use is to divide a given value by a 16.16 fixed-point factor.","title":"FT_DivFix"},{"location":"ft2-computations.html#ft_roundfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_RoundFix ( FT_Fixed a ); Round a 16.16 fixed number.","title":"FT_RoundFix"},{"location":"ft2-computations.html#ft_ceilfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_CeilFix ( FT_Fixed a ); Compute the smallest following integer of a 16.16 fixed number.","title":"FT_CeilFix"},{"location":"ft2-computations.html#ft_floorfix","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Fixed ) FT_FloorFix ( FT_Fixed a ); Compute the largest previous integer of a 16.16 fixed number.","title":"FT_FloorFix"},{"location":"ft2-computations.html#ft_vector_transform","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Vector_Transform ( FT_Vector * vector, const FT_Matrix * matrix ); Transform a single vector through a 2x2 matrix.","title":"FT_Vector_Transform"},{"location":"ft2-computations.html#ft_matrix_multiply","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Matrix_Multiply ( const FT_Matrix * a, FT_Matrix * b ); Perform the matrix operation b = a*b .","title":"FT_Matrix_Multiply"},{"location":"ft2-computations.html#ft_matrix_invert","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Matrix_Invert ( FT_Matrix * matrix ); Invert a 2x2 matrix. Return an error if it can't be inverted.","title":"FT_Matrix_Invert"},{"location":"ft2-computations.html#ft_angle","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). typedef FT_Fixed FT_Angle ; This type is used to model angle values in FreeType. Note that the angle is a 16.16 fixed-point value expressed in degrees.","title":"FT_Angle"},{"location":"ft2-computations.html#ft_angle_pi","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI ( 180L << 16 ) The angle pi expressed in FT_Angle units.","title":"FT_ANGLE_PI"},{"location":"ft2-computations.html#ft_angle_2pi","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_2PI ( FT_ANGLE_PI * 2 ) The angle 2*pi expressed in FT_Angle units.","title":"FT_ANGLE_2PI"},{"location":"ft2-computations.html#ft_angle_pi2","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI2 ( FT_ANGLE_PI / 2 ) The angle pi/2 expressed in FT_Angle units.","title":"FT_ANGLE_PI2"},{"location":"ft2-computations.html#ft_angle_pi4","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). # define FT_ANGLE_PI4 ( FT_ANGLE_PI / 4 ) The angle pi/4 expressed in FT_Angle units.","title":"FT_ANGLE_PI4"},{"location":"ft2-computations.html#ft_sin","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Sin ( FT_Angle angle ); Return the sinus of a given angle in fixed-point format.","title":"FT_Sin"},{"location":"ft2-computations.html#ft_cos","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Cos ( FT_Angle angle ); Return the cosinus of a given angle in fixed-point format.","title":"FT_Cos"},{"location":"ft2-computations.html#ft_tan","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Tan ( FT_Angle angle ); Return the tangent of a given angle in fixed-point format.","title":"FT_Tan"},{"location":"ft2-computations.html#ft_atan2","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Angle ) FT_Atan2 ( FT_Fixed x, FT_Fixed y ); Return the arc-tangent corresponding to a given vector (x,y) in the 2d plane.","title":"FT_Atan2"},{"location":"ft2-computations.html#ft_angle_diff","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Angle ) FT_Angle_Diff ( FT_Angle angle1, FT_Angle angle2 ); Return the difference between two angles. The result is always constrained to the ]-PI..PI] interval.","title":"FT_Angle_Diff"},{"location":"ft2-computations.html#ft_vector_unit","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Unit ( FT_Vector * vec, FT_Angle angle ); Return the unit vector corresponding to a given angle. After the call, the value of vec.x will be cos(angle) , and the value of vec.y will be sin(angle) . This function is useful to retrieve both the sinus and cosinus of a given angle quickly.","title":"FT_Vector_Unit"},{"location":"ft2-computations.html#ft_vector_rotate","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Rotate ( FT_Vector * vec, FT_Angle angle ); Rotate a vector by a given angle.","title":"FT_Vector_Rotate"},{"location":"ft2-computations.html#ft_vector_length","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( FT_Fixed ) FT_Vector_Length ( FT_Vector * vec ); Return the length of a given vector.","title":"FT_Vector_Length"},{"location":"ft2-computations.html#ft_vector_polarize","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_Polarize ( FT_Vector * vec, FT_Fixed *length, FT_Angle *angle ); Compute both the length and angle of a given vector.","title":"FT_Vector_Polarize"},{"location":"ft2-computations.html#ft_vector_from_polar","text":"Defined in FT_TRIGONOMETRY_H (freetype/fttrigon.h). FT_EXPORT( void ) FT_Vector_From_Polar ( FT_Vector * vec, FT_Fixed length, FT_Angle angle ); Compute vector coordinates from a length and angle.","title":"FT_Vector_From_Polar"},{"location":"ft2-debugging_apis.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb External Debugging APIs External Debugging APIs \u00b6 Synopsis \u00b6 This section contains the declarations of public functions that enables fine control of what the FT_DEBUG_LOGGING macro outputs. FT_Trace_Set_Level \u00b6 FT_EXPORT( void ) FT_Trace_Set_Level ( const char * tracing_level ); Change the levels of tracing components of FreeType at run time. input tracing_level New tracing value. example The following call makes FreeType trace everything but the \u2018memory\u2019 component. FT_Trace_Set_Level( \"any:7 memory:0 ); note This function does nothing if compilation option FT_DEBUG_LOGGING isn't set. since 2.11 FT_Trace_Set_Default_Level \u00b6 FT_EXPORT( void ) FT_Trace_Set_Default_Level ( void ); Reset tracing value of FreeType's components to the default value (i.e., to the value of the FT2_DEBUG environment value or to NULL if FT2_DEBUG is not set). note This function does nothing if compilation option FT_DEBUG_LOGGING isn't set. since 2.11 FT_Custom_Log_Handler \u00b6 typedef void (* FT_Custom_Log_Handler )( const char * ft_component, const char * fmt, va_list args ); A function typedef that is used to handle the logging of tracing and debug messages on a file system. input ft_component The name of FT_COMPONENT from which the current debug or error message is produced. fmt Actual debug or tracing message. args Arguments of debug or tracing messages. since 2.11 FT_Set_Log_Handler \u00b6 FT_EXPORT( void ) FT_Set_Log_Handler ( FT_Custom_Log_Handler handler ); A function to set a custom log handler. input handler New logging function. note This function does nothing if compilation option FT_DEBUG_LOGGING isn't set. since 2.11 FT_Set_Default_Log_Handler \u00b6 FT_EXPORT( void ) FT_Set_Default_Log_Handler ( void ); A function to undo the effect of FT_Set_Log_Handler , resetting the log handler to FreeType's built-in version. note This function does nothing if compilation option FT_DEBUG_LOGGING isn't set. since 2.11","title":"External Debugging APIs"},{"location":"ft2-debugging_apis.html#external-debugging-apis","text":"","title":"External Debugging APIs"},{"location":"ft2-debugging_apis.html#synopsis","text":"This section contains the declarations of public functions that enables fine control of what the FT_DEBUG_LOGGING macro outputs.","title":"Synopsis"},{"location":"ft2-debugging_apis.html#ft_trace_set_level","text":"FT_EXPORT( void ) FT_Trace_Set_Level ( const char * tracing_level ); Change the levels of tracing components of FreeType at run time.","title":"FT_Trace_Set_Level"},{"location":"ft2-debugging_apis.html#ft_trace_set_default_level","text":"FT_EXPORT( void ) FT_Trace_Set_Default_Level ( void ); Reset tracing value of FreeType's components to the default value (i.e., to the value of the FT2_DEBUG environment value or to NULL if FT2_DEBUG is not set).","title":"FT_Trace_Set_Default_Level"},{"location":"ft2-debugging_apis.html#ft_custom_log_handler","text":"typedef void (* FT_Custom_Log_Handler )( const char * ft_component, const char * fmt, va_list args ); A function typedef that is used to handle the logging of tracing and debug messages on a file system.","title":"FT_Custom_Log_Handler"},{"location":"ft2-debugging_apis.html#ft_set_log_handler","text":"FT_EXPORT( void ) FT_Set_Log_Handler ( FT_Custom_Log_Handler handler ); A function to set a custom log handler.","title":"FT_Set_Log_Handler"},{"location":"ft2-debugging_apis.html#ft_set_default_log_handler","text":"FT_EXPORT( void ) FT_Set_Default_Log_Handler ( void ); A function to undo the effect of FT_Set_Log_Handler , resetting the log handler to FreeType's built-in version.","title":"FT_Set_Default_Log_Handler"},{"location":"ft2-error_code_values.html","text":"FreeType \u00bb Docs \u00bb Error Codes \u00bb Error Code Values Error Code Values \u00b6 Synopsis \u00b6 The list below is taken verbatim from the file fterrdef.h (loaded automatically by including FT_FREETYPE_H ). The first argument of the FT_ERROR_DEF_ macro is the error label; by default, the prefix FT_Err_ gets added so that you get error names like FT_Err_Cannot_Open_Resource . The second argument is the error code, and the last argument an error string, which is not used by FreeType. Within your application you should only use error names and never its numeric values! The latter might (and actually do) change in forthcoming FreeType versions. Macro FT_NOERRORDEF_ defines FT_Err_Ok , which is always zero. See the \u2018Error Enumerations\u2019 subsection how to automatically generate a list of error strings. FT_Err_XXX \u00b6 /* 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\" ) FT_ERRORDEF_( Array_Too_Large, 0x0A, \"array allocation size too large\" ) FT_ERRORDEF_( Missing_Module, 0x0B, \"missing module\" ) FT_ERRORDEF_( Missing_Property, 0x0C, \"missing property\" ) /* 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\" ) FT_ERRORDEF_( Invalid_SVG_Document, 0x18, \"invalid SVG document\" ) /* 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\" ) FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C, \"found FDEF or IDEF opcode in glyf bytecode\" ) FT_ERRORDEF_( Missing_Bitmap, 0x9D, \"missing bitmap in strike\" ) FT_ERRORDEF_( Missing_SVG_Hooks, 0x9E, \"SVG hooks have not been set\" ) /* CFF, CID, and Type 1 errors */ FT_ERRORDEF_( Syntax_Error, 0xA0, \"opcode syntax error\" ) FT_ERRORDEF_( Stack_Underflow, 0xA1, \"argument stack underflow\" ) FT_ERRORDEF_( Ignore, 0xA2, \"ignore\" ) FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \"no Unicode glyph name found\" ) FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \"glyph too big for hinting\" ) /* 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_Fontboundingbox_Field, 0xB3, \"`FONTBOUNDINGBOX' field missing\" ) FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \"`CHARS' field missing\" ) FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \"`STARTCHAR' field missing\" ) FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \"`ENCODING' field missing\" ) FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \"`BBX' field missing\" ) FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \"`BBX' too big\" ) FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \"Font header corrupted or missing fields\" ) FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \"Font glyphs corrupted or missing fields\" )","title":"Error Code Values"},{"location":"ft2-error_code_values.html#error-code-values","text":"","title":"Error Code Values"},{"location":"ft2-error_code_values.html#synopsis","text":"The list below is taken verbatim from the file fterrdef.h (loaded automatically by including FT_FREETYPE_H ). The first argument of the FT_ERROR_DEF_ macro is the error label; by default, the prefix FT_Err_ gets added so that you get error names like FT_Err_Cannot_Open_Resource . The second argument is the error code, and the last argument an error string, which is not used by FreeType. Within your application you should only use error names and never its numeric values! The latter might (and actually do) change in forthcoming FreeType versions. Macro FT_NOERRORDEF_ defines FT_Err_Ok , which is always zero. See the \u2018Error Enumerations\u2019 subsection how to automatically generate a list of error strings.","title":"Synopsis"},{"location":"ft2-error_code_values.html#ft_err_xxx","text":"/* 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\" ) FT_ERRORDEF_( Array_Too_Large, 0x0A, \"array allocation size too large\" ) FT_ERRORDEF_( Missing_Module, 0x0B, \"missing module\" ) FT_ERRORDEF_( Missing_Property, 0x0C, \"missing property\" ) /* 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\" ) FT_ERRORDEF_( Invalid_SVG_Document, 0x18, \"invalid SVG document\" ) /* 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\" ) FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C, \"found FDEF or IDEF opcode in glyf bytecode\" ) FT_ERRORDEF_( Missing_Bitmap, 0x9D, \"missing bitmap in strike\" ) FT_ERRORDEF_( Missing_SVG_Hooks, 0x9E, \"SVG hooks have not been set\" ) /* CFF, CID, and Type 1 errors */ FT_ERRORDEF_( Syntax_Error, 0xA0, \"opcode syntax error\" ) FT_ERRORDEF_( Stack_Underflow, 0xA1, \"argument stack underflow\" ) FT_ERRORDEF_( Ignore, 0xA2, \"ignore\" ) FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3, \"no Unicode glyph name found\" ) FT_ERRORDEF_( Glyph_Too_Big, 0xA4, \"glyph too big for hinting\" ) /* 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_Fontboundingbox_Field, 0xB3, \"`FONTBOUNDINGBOX' field missing\" ) FT_ERRORDEF_( Missing_Chars_Field, 0xB4, \"`CHARS' field missing\" ) FT_ERRORDEF_( Missing_Startchar_Field, 0xB5, \"`STARTCHAR' field missing\" ) FT_ERRORDEF_( Missing_Encoding_Field, 0xB6, \"`ENCODING' field missing\" ) FT_ERRORDEF_( Missing_Bbx_Field, 0xB7, \"`BBX' field missing\" ) FT_ERRORDEF_( Bbx_Too_Big, 0xB8, \"`BBX' too big\" ) FT_ERRORDEF_( Corrupted_Font_Header, 0xB9, \"Font header corrupted or missing fields\" ) FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA, \"Font glyphs corrupted or missing fields\" )","title":"FT_Err_XXX"},{"location":"ft2-error_enumerations.html","text":"FreeType \u00bb Docs \u00bb Error Codes \u00bb Error Enumerations Error Enumerations \u00b6 Synopsis \u00b6 The header file fterrors.h (which is automatically included by freetype.h defines the handling of FreeType's enumeration constants. It can also be used to generate error message strings with a small macro trick explained below. Error Formats The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be defined in ftoption.h in order to make the higher byte indicate the module where the error has happened (this is not compatible with standard builds of FreeType 2, however). See the file ftmoderr.h for more details. Error Message Strings Error definitions are set up with special macros that allow client applications to build a table of error message strings. 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. FT_ERROR_DEF( e, v, s ) This macro is called to define one single error. \u2018e\u2019 is the error code identifier (e.g., Invalid_Argument ), \u2018v\u2019 is the error's numerical value, and \u2018s\u2019 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, NULL } }; const struct { int err_code; const char* err_msg; } ft_errors[] = #include <freetype/fterrors.h> An alternative to using an array is a switch statement. #undef FTERRORS_H_ #define FT_ERROR_START_LIST switch ( error_code ) { #define FT_ERRORDEF( e, v, s ) case v: return s; #define FT_ERROR_END_LIST } If you use FT_CONFIG_OPTION_USE_MODULE_ERRORS , error_code should be replaced with FT_ERROR_BASE(error_code) in the last example. FT_Error_String \u00b6 Defined in FT_ERRORS_H (freetype/fterrors.h). FT_EXPORT( const char * ) FT_Error_String ( FT_Error error_code ); Retrieve the description of a valid FreeType error code. input error_code A valid FreeType error code. return A C string or NULL , if any error occurred. note FreeType has to be compiled with FT_CONFIG_OPTION_ERROR_STRINGS or FT_DEBUG_LEVEL_ERROR to get meaningful descriptions. \u2018error_string\u2019 will be NULL otherwise. Module identification will be ignored: strcmp ( FT_Error_String ( FT_Err_Unknown_File_Format ), FT_Error_String ( BDF_Err_Unknown_File_Format ) ) == 0 ;","title":"Error Enumerations"},{"location":"ft2-error_enumerations.html#error-enumerations","text":"","title":"Error Enumerations"},{"location":"ft2-error_enumerations.html#synopsis","text":"The header file fterrors.h (which is automatically included by freetype.h defines the handling of FreeType's enumeration constants. It can also be used to generate error message strings with a small macro trick explained below. Error Formats The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be defined in ftoption.h in order to make the higher byte indicate the module where the error has happened (this is not compatible with standard builds of FreeType 2, however). See the file ftmoderr.h for more details. Error Message Strings Error definitions are set up with special macros that allow client applications to build a table of error message strings. 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. FT_ERROR_DEF( e, v, s ) This macro is called to define one single error. \u2018e\u2019 is the error code identifier (e.g., Invalid_Argument ), \u2018v\u2019 is the error's numerical value, and \u2018s\u2019 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, NULL } }; const struct { int err_code; const char* err_msg; } ft_errors[] = #include <freetype/fterrors.h> An alternative to using an array is a switch statement. #undef FTERRORS_H_ #define FT_ERROR_START_LIST switch ( error_code ) { #define FT_ERRORDEF( e, v, s ) case v: return s; #define FT_ERROR_END_LIST } If you use FT_CONFIG_OPTION_USE_MODULE_ERRORS , error_code should be replaced with FT_ERROR_BASE(error_code) in the last example.","title":"Synopsis"},{"location":"ft2-error_enumerations.html#ft_error_string","text":"Defined in FT_ERRORS_H (freetype/fterrors.h). FT_EXPORT( const char * ) FT_Error_String ( FT_Error error_code ); Retrieve the description of a valid FreeType error code.","title":"FT_Error_String"},{"location":"ft2-font_formats.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Font Formats Font Formats \u00b6 Synopsis \u00b6 The single function in this section can be used to get the font format. Note that this information is not needed normally; however, there are special cases (like in PDF devices) where it is important to differentiate, in spite of FreeType's uniform API. FT_Get_Font_Format \u00b6 Defined in FT_FONT_FORMATS_H (freetype/ftfntfmt.h). FT_EXPORT( const char * ) FT_Get_Font_Format ( FT_Face face ); /* deprecated */ FT_EXPORT( const char * ) FT_Get_X11_Font_Format( FT_Face face ); Return a string describing the format of a given face. Possible values are \u2018TrueType\u2019, \u2018Type 1\u2019, \u2018BDF\u2019, \u2018PCF\u2019, \u2018Type 42\u2019, \u2018CID Type 1\u2019, \u2018CFF\u2019, \u2018PFR\u2019, and \u2018Windows FNT\u2019. The return value is suitable to be used as an X11 FONT_PROPERTY. input face Input face handle. return Font format string. NULL in case of error. note A deprecated name for the same function is FT_Get_X11_Font_Format .","title":"Font Formats"},{"location":"ft2-font_formats.html#font-formats","text":"","title":"Font Formats"},{"location":"ft2-font_formats.html#synopsis","text":"The single function in this section can be used to get the font format. Note that this information is not needed normally; however, there are special cases (like in PDF devices) where it is important to differentiate, in spite of FreeType's uniform API.","title":"Synopsis"},{"location":"ft2-font_formats.html#ft_get_font_format","text":"Defined in FT_FONT_FORMATS_H (freetype/ftfntfmt.h). FT_EXPORT( const char * ) FT_Get_Font_Format ( FT_Face face ); /* deprecated */ FT_EXPORT( const char * ) FT_Get_X11_Font_Format( FT_Face face ); Return a string describing the format of a given face. Possible values are \u2018TrueType\u2019, \u2018Type 1\u2019, \u2018BDF\u2019, \u2018PCF\u2019, \u2018Type 42\u2019, \u2018CID Type 1\u2019, \u2018CFF\u2019, \u2018PFR\u2019, and \u2018Windows FNT\u2019. The return value is suitable to be used as an X11 FONT_PROPERTY.","title":"FT_Get_Font_Format"},{"location":"ft2-gasp_table.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Gasp Table Gasp Table \u00b6 Synopsis \u00b6 The function FT_Get_Gasp can be used to query a TrueType or OpenType font for specific entries in its \u2018gasp\u2019 table, if any. This is mainly useful when implementing native TrueType hinting with the bytecode interpreter to duplicate the Windows text rendering results. FT_GASP_XXX \u00b6 Defined in FT_GASP_H (freetype/ftgasp.h). # define FT_GASP_NO_TABLE -1 # define FT_GASP_DO_GRIDFIT 0x01 # define FT_GASP_DO_GRAY 0x02 # define FT_GASP_SYMMETRIC_GRIDFIT 0x04 # define FT_GASP_SYMMETRIC_SMOOTHING 0x08 A list of values and/or bit-flags returned by the FT_Get_Gasp function. values FT_GASP_NO_TABLE This special value means that there is no GASP table in this face. It is up to the client to decide what to do. FT_GASP_DO_GRIDFIT Grid-fitting and hinting should be performed at the specified ppem. This really means TrueType bytecode interpretation. If this bit is not set, no hinting gets applied. FT_GASP_DO_GRAY Anti-aliased rendering should be performed at the specified ppem. If not set, do monochrome rendering. FT_GASP_SYMMETRIC_SMOOTHING If set, smoothing along multiple axes must be used with ClearType. FT_GASP_SYMMETRIC_GRIDFIT Grid-fitting must be used with ClearType's symmetric smoothing. note The bit-flags FT_GASP_DO_GRIDFIT and FT_GASP_DO_GRAY are to be used for standard font rasterization only. Independently of that, FT_GASP_SYMMETRIC_SMOOTHING and FT_GASP_SYMMETRIC_GRIDFIT are to be used if ClearType is enabled (and FT_GASP_DO_GRIDFIT and FT_GASP_DO_GRAY are consequently ignored). \u2018ClearType\u2019 is Microsoft's implementation of LCD rendering, partly protected by patents. since 2.3.0 FT_Get_Gasp \u00b6 Defined in FT_GASP_H (freetype/ftgasp.h). FT_EXPORT( FT_Int ) FT_Get_Gasp ( FT_Face face, FT_UInt ppem ); For a TrueType or OpenType font file, return the rasterizer behaviour flags from the font's \u2018gasp\u2019 table corresponding to a given character pixel size. input face The source face handle. ppem The vertical character pixel size. return Bit flags (see FT_GASP_XXX ), or FT_GASP_NO_TABLE if there is no \u2018gasp\u2019 table in the face. note If you want to use the MM functionality of OpenType variation fonts (i.e., using FT_Set_Var_Design_Coordinates and friends), call this function after setting an instance since the return values can change. since 2.3.0","title":"Gasp Table"},{"location":"ft2-gasp_table.html#gasp-table","text":"","title":"Gasp Table"},{"location":"ft2-gasp_table.html#synopsis","text":"The function FT_Get_Gasp can be used to query a TrueType or OpenType font for specific entries in its \u2018gasp\u2019 table, if any. This is mainly useful when implementing native TrueType hinting with the bytecode interpreter to duplicate the Windows text rendering results.","title":"Synopsis"},{"location":"ft2-gasp_table.html#ft_gasp_xxx","text":"Defined in FT_GASP_H (freetype/ftgasp.h). # define FT_GASP_NO_TABLE -1 # define FT_GASP_DO_GRIDFIT 0x01 # define FT_GASP_DO_GRAY 0x02 # define FT_GASP_SYMMETRIC_GRIDFIT 0x04 # define FT_GASP_SYMMETRIC_SMOOTHING 0x08 A list of values and/or bit-flags returned by the FT_Get_Gasp function.","title":"FT_GASP_XXX"},{"location":"ft2-gasp_table.html#ft_get_gasp","text":"Defined in FT_GASP_H (freetype/ftgasp.h). FT_EXPORT( FT_Int ) FT_Get_Gasp ( FT_Face face, FT_UInt ppem ); For a TrueType or OpenType font file, return the rasterizer behaviour flags from the font's \u2018gasp\u2019 table corresponding to a given character pixel size.","title":"FT_Get_Gasp"},{"location":"ft2-glyph_management.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Glyph Management Glyph Management \u00b6 Synopsis \u00b6 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. These objects are detached from FT_Face , contrary to FT_GlyphSlot . FT_Glyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_GlyphRec_* FT_Glyph ; 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 . FT_GlyphRec \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_GlyphRec_ { FT_Library library; const FT_Glyph_Class* clazz; FT_Glyph_Format format; FT_Vector advance; } FT_GlyphRec ; The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed-point 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. FT_BitmapGlyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph ; A handle to an object used to model a bitmap glyph image. This is a \u2018sub-class\u2019 of FT_Glyph , and a pointer to FT_BitmapGlyphRec . FT_BitmapGlyphRec \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_BitmapGlyphRec_ { FT_GlyphRec root; FT_Int left; FT_Int top; FT_Bitmap bitmap; } FT_BitmapGlyphRec ; A structure used for bitmap glyph images. This really is a \u2018sub-class\u2019 of FT_GlyphRec . fields root The root fields of FT_Glyph . 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 an 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 FT_BitmapGlyph and is thus created and destroyed with it. FT_OutlineGlyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph ; A handle to an object used to model an outline glyph image. This is a \u2018sub-class\u2019 of FT_Glyph , and a pointer to FT_OutlineGlyphRec . FT_OutlineGlyphRec \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_OutlineGlyphRec_ { FT_GlyphRec root; FT_Outline outline; } FT_OutlineGlyphRec ; A structure used for outline (vectorial) glyph images. This really is a \u2018sub-class\u2019 of FT_GlyphRec . fields root The root FT_Glyph fields. outline A descriptor for the outline. note You can typecast an 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. FT_SvgGlyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_SvgGlyphRec_* FT_SvgGlyph ; A handle to an object used to model an SVG glyph. This is a \u2018sub-class\u2019 of FT_Glyph , and a pointer to FT_SvgGlyphRec . since 2.12 FT_SvgGlyphRec \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_SvgGlyphRec_ { FT_GlyphRec root; FT_Byte * svg_document; FT_ULong svg_document_length; FT_UInt glyph_index; FT_Size_Metrics metrics; FT_UShort units_per_EM; FT_UShort start_glyph_id; FT_UShort end_glyph_id; FT_Matrix transform; FT_Vector delta; } FT_SvgGlyphRec ; A structure used for OT-SVG glyphs. This is a \u2018sub-class\u2019 of FT_GlyphRec . fields root The root FT_GlyphRec fields. svg_document A pointer to the SVG document. svg_document_length The length of svg_document . glyph_index The index of the glyph to be rendered. metrics A metrics object storing the size information. units_per_EM The size of the EM square. start_glyph_id The first glyph ID in the glyph range covered by this document. end_glyph_id The last glyph ID in the glyph range covered by this document. transform A 2x2 transformation matrix to apply to the glyph while rendering it. delta Translation to apply to the glyph while rendering. note The Glyph Management API requires FT_Glyph or its \u2018sub-class\u2019 to have all the information needed to completely define the glyph's rendering. Outline-based glyphs can directly apply transformations to the outline but this is not possible for an SVG document that hasn't been parsed. Therefore, the transformation is stored along with the document. In the absence of a \u2018ViewBox\u2019 or \u2018Width\u2019/'Height' attribute, the size of the ViewPort should be assumed to be \u2018units_per_EM\u2019. FT_New_Glyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_New_Glyph ( FT_Library library, FT_Glyph_Format format, FT_Glyph *aglyph ); A function used to create a new empty glyph image. Note that the created FT_Glyph object must be released with FT_Done_Glyph . input library A handle to the FreeType library object. format The format of the glyph's image. output aglyph A handle to the glyph object. return FreeType error code. 0 means success. since 2.10 FT_Get_Glyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Get_Glyph ( FT_GlyphSlot slot, FT_Glyph *aglyph ); A function used to extract a glyph image from a slot. Note that the created FT_Glyph object must be released with FT_Done_Glyph . input slot A handle to the source glyph slot. output aglyph A handle to the glyph object. return FreeType error code. 0 means success. note Because *aglyph->advance.x and *aglyph->advance.y are 16.16 fixed-point numbers, slot->advance.x and slot->advance.y (which are in 26.6 fixed-point format) must be in the range ]-32768;32768[. FT_Glyph_Copy \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_Copy ( FT_Glyph source, FT_Glyph *target ); A function used to copy a glyph image. Note that the created FT_Glyph object must be released with FT_Done_Glyph . input source A handle to the source glyph object. output target A handle to the target glyph object. 0 in case of error. return FreeType error code. 0 means success. FT_Glyph_Transform \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_Transform ( FT_Glyph glyph, const FT_Matrix * matrix, const FT_Vector * delta ); Transform 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 (if not 0, the glyph format is not scalable). note The 2x2 transformation matrix is also applied to the glyph's advance vector. FT_Glyph_BBox_Mode \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef enum FT_Glyph_BBox_Mode_ { FT_GLYPH_BBOX_UNSCALED = 0, FT_GLYPH_BBOX_SUBPIXELS = 0, FT_GLYPH_BBOX_GRIDFIT = 1, FT_GLYPH_BBOX_TRUNCATE = 2, FT_GLYPH_BBOX_PIXELS = 3 } FT_Glyph_BBox_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Glyph_BBox_Mode ` values instead */ # define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED # define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS # define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT # define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE # define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS The mode how the values of FT_Glyph_Get_CBox are returned. values FT_GLYPH_BBOX_UNSCALED Return unscaled font units. FT_GLYPH_BBOX_SUBPIXELS Return unfitted 26.6 coordinates. FT_GLYPH_BBOX_GRIDFIT Return grid-fitted 26.6 coordinates. FT_GLYPH_BBOX_TRUNCATE Return coordinates in integer pixels. FT_GLYPH_BBOX_PIXELS Return grid-fitted pixel coordinates. FT_Glyph_Get_CBox \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Glyph_Get_CBox ( FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox ); Return a glyph's \u2018control box\u2019. 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 that 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 \u2018ftbbox\u2019 component, which is dedicated to this single task. input glyph A handle to the source glyph object. mode The mode that 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 in 26.6 pixel format. The value FT_GLYPH_BBOX_SUBPIXELS is another name for this constant. If the font is tricky and the glyph has been loaded with FT_LOAD_NO_SCALE , the resulting CBox is meaningless. To get reasonable values for the CBox it is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting the CBox, which can be eventually converted back to font units. 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 . FT_Glyph_To_Bitmap \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_To_Bitmap ( FT_Glyph * the_glyph, FT_Render_Mode render_mode, const FT_Vector * origin, FT_Bool destroy ); Convert 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 describes 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 This function does nothing if the glyph format isn't scalable. The glyph image is translated with the origin vector before rendering. The first parameter is a pointer to an FT_Glyph handle that will be replaced by this function (with newly allocated data). Typically, you would do something like the following (omitting error handling). FT_Glyph glyph; FT_BitmapGlyph glyph_bitmap; // load glyph error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAULT ); // extract glyph image error = FT_Get_Glyph( face->glyph, &glyph ); // convert to a bitmap (default render mode + destroying old) if ( glyph->format != FT_GLYPH_FORMAT_BITMAP ) { error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL, 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 ); Here is another example, again without error handling. FT_Glyph glyphs[MAX_GLYPHS] ... for ( idx = 0; i < MAX_GLYPHS; i++ ) error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) || FT_Get_Glyph ( face->glyph, &glyphs[idx] ); ... for ( idx = 0; i < MAX_GLYPHS; i++ ) { FT_Glyph bitmap = glyphs[idx]; ... // after this call, `bitmap' no longer points into // the `glyphs' array (and the old value isn't destroyed) FT_Glyph_To_Bitmap( &bitmap, FT_RENDER_MODE_MONO, 0, 0 ); ... FT_Done_Glyph( bitmap ); } ... for ( idx = 0; i < MAX_GLYPHS; i++ ) FT_Done_Glyph( glyphs[idx] ); FT_Done_Glyph \u00b6 Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Done_Glyph ( FT_Glyph glyph ); Destroy a given glyph. input glyph A handle to the target glyph object.","title":"Glyph Management"},{"location":"ft2-glyph_management.html#glyph-management","text":"","title":"Glyph Management"},{"location":"ft2-glyph_management.html#synopsis","text":"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. These objects are detached from FT_Face , contrary to FT_GlyphSlot .","title":"Synopsis"},{"location":"ft2-glyph_management.html#ft_glyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_GlyphRec_* FT_Glyph ; 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.","title":"FT_Glyph"},{"location":"ft2-glyph_management.html#ft_glyphrec","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_GlyphRec_ { FT_Library library; const FT_Glyph_Class* clazz; FT_Glyph_Format format; FT_Vector advance; } FT_GlyphRec ; The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed-point format.","title":"FT_GlyphRec"},{"location":"ft2-glyph_management.html#ft_bitmapglyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph ; A handle to an object used to model a bitmap glyph image. This is a \u2018sub-class\u2019 of FT_Glyph , and a pointer to FT_BitmapGlyphRec .","title":"FT_BitmapGlyph"},{"location":"ft2-glyph_management.html#ft_bitmapglyphrec","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_BitmapGlyphRec_ { FT_GlyphRec root; FT_Int left; FT_Int top; FT_Bitmap bitmap; } FT_BitmapGlyphRec ; A structure used for bitmap glyph images. This really is a \u2018sub-class\u2019 of FT_GlyphRec .","title":"FT_BitmapGlyphRec"},{"location":"ft2-glyph_management.html#ft_outlineglyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph ; A handle to an object used to model an outline glyph image. This is a \u2018sub-class\u2019 of FT_Glyph , and a pointer to FT_OutlineGlyphRec .","title":"FT_OutlineGlyph"},{"location":"ft2-glyph_management.html#ft_outlineglyphrec","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_OutlineGlyphRec_ { FT_GlyphRec root; FT_Outline outline; } FT_OutlineGlyphRec ; A structure used for outline (vectorial) glyph images. This really is a \u2018sub-class\u2019 of FT_GlyphRec .","title":"FT_OutlineGlyphRec"},{"location":"ft2-glyph_management.html#ft_svgglyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_SvgGlyphRec_* FT_SvgGlyph ; A handle to an object used to model an SVG glyph. This is a \u2018sub-class\u2019 of FT_Glyph , and a pointer to FT_SvgGlyphRec .","title":"FT_SvgGlyph"},{"location":"ft2-glyph_management.html#ft_svgglyphrec","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef struct FT_SvgGlyphRec_ { FT_GlyphRec root; FT_Byte * svg_document; FT_ULong svg_document_length; FT_UInt glyph_index; FT_Size_Metrics metrics; FT_UShort units_per_EM; FT_UShort start_glyph_id; FT_UShort end_glyph_id; FT_Matrix transform; FT_Vector delta; } FT_SvgGlyphRec ; A structure used for OT-SVG glyphs. This is a \u2018sub-class\u2019 of FT_GlyphRec .","title":"FT_SvgGlyphRec"},{"location":"ft2-glyph_management.html#ft_new_glyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_New_Glyph ( FT_Library library, FT_Glyph_Format format, FT_Glyph *aglyph ); A function used to create a new empty glyph image. Note that the created FT_Glyph object must be released with FT_Done_Glyph .","title":"FT_New_Glyph"},{"location":"ft2-glyph_management.html#ft_get_glyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Get_Glyph ( FT_GlyphSlot slot, FT_Glyph *aglyph ); A function used to extract a glyph image from a slot. Note that the created FT_Glyph object must be released with FT_Done_Glyph .","title":"FT_Get_Glyph"},{"location":"ft2-glyph_management.html#ft_glyph_copy","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_Copy ( FT_Glyph source, FT_Glyph *target ); A function used to copy a glyph image. Note that the created FT_Glyph object must be released with FT_Done_Glyph .","title":"FT_Glyph_Copy"},{"location":"ft2-glyph_management.html#ft_glyph_transform","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_Transform ( FT_Glyph glyph, const FT_Matrix * matrix, const FT_Vector * delta ); Transform a glyph image if its format is scalable.","title":"FT_Glyph_Transform"},{"location":"ft2-glyph_management.html#ft_glyph_bbox_mode","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). typedef enum FT_Glyph_BBox_Mode_ { FT_GLYPH_BBOX_UNSCALED = 0, FT_GLYPH_BBOX_SUBPIXELS = 0, FT_GLYPH_BBOX_GRIDFIT = 1, FT_GLYPH_BBOX_TRUNCATE = 2, FT_GLYPH_BBOX_PIXELS = 3 } FT_Glyph_BBox_Mode ; /* these constants are deprecated; use the corresponding */ /* ` FT_Glyph_BBox_Mode ` values instead */ # define ft_glyph_bbox_unscaled FT_GLYPH_BBOX_UNSCALED # define ft_glyph_bbox_subpixels FT_GLYPH_BBOX_SUBPIXELS # define ft_glyph_bbox_gridfit FT_GLYPH_BBOX_GRIDFIT # define ft_glyph_bbox_truncate FT_GLYPH_BBOX_TRUNCATE # define ft_glyph_bbox_pixels FT_GLYPH_BBOX_PIXELS The mode how the values of FT_Glyph_Get_CBox are returned.","title":"FT_Glyph_BBox_Mode"},{"location":"ft2-glyph_management.html#ft_glyph_get_cbox","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Glyph_Get_CBox ( FT_Glyph glyph, FT_UInt bbox_mode, FT_BBox *acbox ); Return a glyph's \u2018control box\u2019. 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 that 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 \u2018ftbbox\u2019 component, which is dedicated to this single task.","title":"FT_Glyph_Get_CBox"},{"location":"ft2-glyph_management.html#ft_glyph_to_bitmap","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( FT_Error ) FT_Glyph_To_Bitmap ( FT_Glyph * the_glyph, FT_Render_Mode render_mode, const FT_Vector * origin, FT_Bool destroy ); Convert a given glyph object to a bitmap glyph object.","title":"FT_Glyph_To_Bitmap"},{"location":"ft2-glyph_management.html#ft_done_glyph","text":"Defined in FT_GLYPH_H (freetype/ftglyph.h). FT_EXPORT( void ) FT_Done_Glyph ( FT_Glyph glyph ); Destroy a given glyph.","title":"FT_Done_Glyph"},{"location":"ft2-glyph_stroker.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Glyph Stroker Glyph Stroker \u00b6 Synopsis \u00b6 This component generates stroked outlines of a given vectorial glyph. It also allows you to retrieve the \u2018outside\u2019 and/or the \u2018inside\u2019 borders of the stroke. This can be useful to generate \u2018bordered\u2019 glyph, i.e., glyphs displayed with a colored (and anti-aliased) border around their shape. FT_Stroker \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). typedef struct FT_StrokerRec_* FT_Stroker ; Opaque handle to a path stroker object. FT_Stroker_LineJoin \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_Stroker_LineJoin_ { FT_STROKER_LINEJOIN_ROUND = 0, FT_STROKER_LINEJOIN_BEVEL = 1, FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE , FT_STROKER_LINEJOIN_MITER_FIXED = 3 } FT_Stroker_LineJoin ; These values determine how two joining lines are rendered in a stroker. values FT_STROKER_LINEJOIN_ROUND Used to render rounded line joins. Circular arcs are used to join two lines smoothly. FT_STROKER_LINEJOIN_BEVEL Used to render beveled line joins. The outer corner of the joined lines is filled by enclosing the triangular region of the corner with a straight line between the outer corners of each stroke. FT_STROKER_LINEJOIN_MITER_FIXED Used to render mitered line joins, with fixed bevels if the miter limit is exceeded. The outer edges of the strokes for the two segments are extended until they meet at an angle. A bevel join (see above) is used if the segments meet at too sharp an angle and the outer edges meet beyond a distance corresponding to the meter limit. This prevents long spikes being created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter line join as used in PostScript and PDF. FT_STROKER_LINEJOIN_MITER_VARIABLE FT_STROKER_LINEJOIN_MITER Used to render mitered line joins, with variable bevels if the miter limit is exceeded. The intersection of the strokes is clipped perpendicularly to the bisector, at a distance corresponding to the miter limit. This prevents long spikes being created. FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias for FT_STROKER_LINEJOIN_MITER_VARIABLE , retained for backward compatibility. FT_Stroker_LineCap \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_Stroker_LineCap_ { FT_STROKER_LINECAP_BUTT = 0, FT_STROKER_LINECAP_ROUND , FT_STROKER_LINECAP_SQUARE } FT_Stroker_LineCap ; These values determine how the end of opened sub-paths are rendered in a stroke. values FT_STROKER_LINECAP_BUTT The end of lines is rendered as a full stop on the last point itself. FT_STROKER_LINECAP_ROUND The end of lines is rendered as a half-circle around the last point. FT_STROKER_LINECAP_SQUARE The end of lines is rendered as a square around the last point. FT_StrokerBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_StrokerBorder_ { FT_STROKER_BORDER_LEFT = 0, FT_STROKER_BORDER_RIGHT } FT_StrokerBorder ; These values are used to select a given stroke border in FT_Stroker_GetBorderCounts and FT_Stroker_ExportBorder . values FT_STROKER_BORDER_LEFT Select the left border, relative to the drawing direction. FT_STROKER_BORDER_RIGHT Select the right border, relative to the drawing direction. note Applications are generally interested in the \u2018inside\u2019 and \u2018outside\u2019 borders. However, there is no direct mapping between these and the \u2018left\u2019 and \u2018right\u2019 ones, since this really depends on the glyph's drawing orientation, which varies between font formats. You can however use FT_Outline_GetInsideBorder and FT_Outline_GetOutsideBorder to get these. FT_Outline_GetInsideBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetInsideBorder ( FT_Outline * outline ); Retrieve the FT_StrokerBorder value corresponding to the \u2018inside\u2019 borders of a given outline. input outline The source outline handle. return The border index. FT_STROKER_BORDER_RIGHT for empty or invalid outlines. FT_Outline_GetOutsideBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetOutsideBorder ( FT_Outline * outline ); Retrieve the FT_StrokerBorder value corresponding to the \u2018outside\u2019 borders of a given outline. input outline The source outline handle. return The border index. FT_STROKER_BORDER_LEFT for empty or invalid outlines. FT_Glyph_Stroke \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Glyph_Stroke ( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool destroy ); Stroke a given outline glyph object with a given stroker. inout pglyph Source glyph handle on input, new glyph handle on output. input stroker A stroker handle. destroy A Boolean. If 1, the source glyph object is destroyed on success. return FreeType error code. 0 means success. note The source glyph is untouched in case of error. Adding stroke may yield a significantly wider and taller glyph depending on how large of a radius was used to stroke the glyph. You may need to manually adjust horizontal and vertical advance amounts to account for this added size. FT_Glyph_StrokeBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Glyph_StrokeBorder ( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool inside, FT_Bool destroy ); Stroke a given outline glyph object with a given stroker, but only return either its inside or outside border. inout pglyph Source glyph handle on input, new glyph handle on output. input stroker A stroker handle. inside A Boolean. If 1, return the inside border, otherwise the outside border. destroy A Boolean. If 1, the source glyph object is destroyed on success. return FreeType error code. 0 means success. note The source glyph is untouched in case of error. Adding stroke may yield a significantly wider and taller glyph depending on how large of a radius was used to stroke the glyph. You may need to manually adjust horizontal and vertical advance amounts to account for this added size. FT_Stroker_New \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_New ( FT_Library library, FT_Stroker *astroker ); Create a new stroker object. input library FreeType library handle. output astroker A new stroker object handle. NULL in case of error. return FreeType error code. 0 means success. FT_Stroker_Set \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Set ( FT_Stroker stroker, FT_Fixed radius, FT_Stroker_LineCap line_cap, FT_Stroker_LineJoin line_join, FT_Fixed miter_limit ); Reset a stroker object's attributes. input stroker The target stroker handle. radius The border radius. line_cap The line cap style. line_join The line join style. miter_limit The maximum reciprocal sine of half-angle at the miter join, expressed as 16.16 fixed point value. note The radius is expressed in the same units as the outline coordinates. The miter_limit multiplied by the radius gives the maximum size of a miter spike, at which it is clipped for FT_STROKER_LINEJOIN_MITER_VARIABLE or replaced with a bevel join for FT_STROKER_LINEJOIN_MITER_FIXED . This function calls FT_Stroker_Rewind automatically. FT_Stroker_Rewind \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Rewind ( FT_Stroker stroker ); Reset a stroker object without changing its attributes. You should call this function before beginning a new series of calls to FT_Stroker_BeginSubPath or FT_Stroker_EndSubPath . input stroker The target stroker handle. FT_Stroker_ParseOutline \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_ParseOutline ( FT_Stroker stroker, FT_Outline * outline, FT_Bool opened ); A convenience function used to parse a whole outline with the stroker. The resulting outline(s) can be retrieved later by functions like FT_Stroker_GetCounts and FT_Stroker_Export . input stroker The target stroker handle. outline The source outline. opened A boolean. If 1, the outline is treated as an open path instead of a closed one. return FreeType error code. 0 means success. note If opened is 0 (the default), the outline is treated as a closed path, and the stroker generates two distinct \u2018border\u2019 outlines. If opened is 1, the outline is processed as an open path, and the stroker generates a single \u2018stroke\u2019 outline. This function calls FT_Stroker_Rewind automatically. FT_Stroker_Done \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Done ( FT_Stroker stroker ); Destroy a stroker object. input stroker A stroker handle. Can be NULL . FT_Stroker_BeginSubPath \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_BeginSubPath ( FT_Stroker stroker, FT_Vector * to, FT_Bool open ); Start a new sub-path in the stroker. input stroker The target stroker handle. to A pointer to the start vector. open A boolean. If 1, the sub-path is treated as an open one. return FreeType error code. 0 means success. note This function is useful when you need to stroke a path that is not stored as an FT_Outline object. FT_Stroker_EndSubPath \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_EndSubPath ( FT_Stroker stroker ); Close the current sub-path in the stroker. input stroker The target stroker handle. return FreeType error code. 0 means success. note You should call this function after FT_Stroker_BeginSubPath . If the subpath was not \u2018opened\u2019, this function \u2018draws\u2019 a single line segment to the start position when needed. FT_Stroker_LineTo \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_LineTo ( FT_Stroker stroker, FT_Vector * to ); \u2018Draw\u2019 a single line segment in the stroker's current sub-path, from the last position. input stroker The target stroker handle. to A pointer to the destination point. return FreeType error code. 0 means success. note You should call this function between FT_Stroker_BeginSubPath and FT_Stroker_EndSubPath . FT_Stroker_ConicTo \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_ConicTo ( FT_Stroker stroker, FT_Vector * control, FT_Vector * to ); \u2018Draw\u2019 a single quadratic Bezier in the stroker's current sub-path, from the last position. input stroker The target stroker handle. control A pointer to a Bezier control point. to A pointer to the destination point. return FreeType error code. 0 means success. note You should call this function between FT_Stroker_BeginSubPath and FT_Stroker_EndSubPath . FT_Stroker_CubicTo \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_CubicTo ( FT_Stroker stroker, FT_Vector * control1, FT_Vector * control2, FT_Vector * to ); \u2018Draw\u2019 a single cubic Bezier in the stroker's current sub-path, from the last position. input stroker The target stroker handle. control1 A pointer to the first Bezier control point. control2 A pointer to second Bezier control point. to A pointer to the destination point. return FreeType error code. 0 means success. note You should call this function between FT_Stroker_BeginSubPath and FT_Stroker_EndSubPath . FT_Stroker_GetBorderCounts \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_GetBorderCounts ( FT_Stroker stroker, FT_StrokerBorder border, FT_UInt *anum_points, FT_UInt *anum_contours ); Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export one of the \u2018border\u2019 or \u2018stroke\u2019 outlines generated by the stroker. input stroker The target stroker handle. border The border index. output anum_points The number of points. anum_contours The number of contours. return FreeType error code. 0 means success. note When an outline, or a sub-path, is \u2018closed\u2019, the stroker generates two independent \u2018border\u2019 outlines, named \u2018left\u2019 and \u2018right\u2019. When the outline, or a sub-path, is \u2018opened\u2019, the stroker merges the \u2018border\u2019 outlines with caps. The \u2018left\u2019 border receives all points, while the \u2018right\u2019 border becomes empty. Use the function FT_Stroker_GetCounts instead if you want to retrieve the counts associated to both borders. FT_Stroker_ExportBorder \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_ExportBorder ( FT_Stroker stroker, FT_StrokerBorder border, FT_Outline * outline ); Call this function after FT_Stroker_GetBorderCounts to export the corresponding border to your own FT_Outline structure. Note that this function appends the border points and contours to your outline, but does not try to resize its arrays. input stroker The target stroker handle. border The border index. outline The target outline handle. note Always call this function after FT_Stroker_GetBorderCounts to get sure that there is enough room in your FT_Outline object to receive all new data. When an outline, or a sub-path, is \u2018closed\u2019, the stroker generates two independent \u2018border\u2019 outlines, named \u2018left\u2019 and \u2018right\u2019. When the outline, or a sub-path, is \u2018opened\u2019, the stroker merges the \u2018border\u2019 outlines with caps. The \u2018left\u2019 border receives all points, while the \u2018right\u2019 border becomes empty. Use the function FT_Stroker_Export instead if you want to retrieve all borders at once. FT_Stroker_GetCounts \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_GetCounts ( FT_Stroker stroker, FT_UInt *anum_points, FT_UInt *anum_contours ); Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export all points/borders from the stroked outline/path. input stroker The target stroker handle. output anum_points The number of points. anum_contours The number of contours. return FreeType error code. 0 means success. FT_Stroker_Export \u00b6 Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Export ( FT_Stroker stroker, FT_Outline * outline ); Call this function after FT_Stroker_GetBorderCounts to export all borders to your own FT_Outline structure. Note that this function appends the border points and contours to your outline, but does not try to resize its arrays. input stroker The target stroker handle. outline The target outline handle.","title":"Glyph Stroker"},{"location":"ft2-glyph_stroker.html#glyph-stroker","text":"","title":"Glyph Stroker"},{"location":"ft2-glyph_stroker.html#synopsis","text":"This component generates stroked outlines of a given vectorial glyph. It also allows you to retrieve the \u2018outside\u2019 and/or the \u2018inside\u2019 borders of the stroke. This can be useful to generate \u2018bordered\u2019 glyph, i.e., glyphs displayed with a colored (and anti-aliased) border around their shape.","title":"Synopsis"},{"location":"ft2-glyph_stroker.html#ft_stroker","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). typedef struct FT_StrokerRec_* FT_Stroker ; Opaque handle to a path stroker object.","title":"FT_Stroker"},{"location":"ft2-glyph_stroker.html#ft_stroker_linejoin","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_Stroker_LineJoin_ { FT_STROKER_LINEJOIN_ROUND = 0, FT_STROKER_LINEJOIN_BEVEL = 1, FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE , FT_STROKER_LINEJOIN_MITER_FIXED = 3 } FT_Stroker_LineJoin ; These values determine how two joining lines are rendered in a stroker.","title":"FT_Stroker_LineJoin"},{"location":"ft2-glyph_stroker.html#ft_stroker_linecap","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_Stroker_LineCap_ { FT_STROKER_LINECAP_BUTT = 0, FT_STROKER_LINECAP_ROUND , FT_STROKER_LINECAP_SQUARE } FT_Stroker_LineCap ; These values determine how the end of opened sub-paths are rendered in a stroke.","title":"FT_Stroker_LineCap"},{"location":"ft2-glyph_stroker.html#ft_strokerborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). typedef enum FT_StrokerBorder_ { FT_STROKER_BORDER_LEFT = 0, FT_STROKER_BORDER_RIGHT } FT_StrokerBorder ; These values are used to select a given stroke border in FT_Stroker_GetBorderCounts and FT_Stroker_ExportBorder .","title":"FT_StrokerBorder"},{"location":"ft2-glyph_stroker.html#ft_outline_getinsideborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetInsideBorder ( FT_Outline * outline ); Retrieve the FT_StrokerBorder value corresponding to the \u2018inside\u2019 borders of a given outline.","title":"FT_Outline_GetInsideBorder"},{"location":"ft2-glyph_stroker.html#ft_outline_getoutsideborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_StrokerBorder ) FT_Outline_GetOutsideBorder ( FT_Outline * outline ); Retrieve the FT_StrokerBorder value corresponding to the \u2018outside\u2019 borders of a given outline.","title":"FT_Outline_GetOutsideBorder"},{"location":"ft2-glyph_stroker.html#ft_glyph_stroke","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Glyph_Stroke ( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool destroy ); Stroke a given outline glyph object with a given stroker.","title":"FT_Glyph_Stroke"},{"location":"ft2-glyph_stroker.html#ft_glyph_strokeborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Glyph_StrokeBorder ( FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool inside, FT_Bool destroy ); Stroke a given outline glyph object with a given stroker, but only return either its inside or outside border.","title":"FT_Glyph_StrokeBorder"},{"location":"ft2-glyph_stroker.html#ft_stroker_new","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_New ( FT_Library library, FT_Stroker *astroker ); Create a new stroker object.","title":"FT_Stroker_New"},{"location":"ft2-glyph_stroker.html#ft_stroker_set","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Set ( FT_Stroker stroker, FT_Fixed radius, FT_Stroker_LineCap line_cap, FT_Stroker_LineJoin line_join, FT_Fixed miter_limit ); Reset a stroker object's attributes.","title":"FT_Stroker_Set"},{"location":"ft2-glyph_stroker.html#ft_stroker_rewind","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Rewind ( FT_Stroker stroker ); Reset a stroker object without changing its attributes. You should call this function before beginning a new series of calls to FT_Stroker_BeginSubPath or FT_Stroker_EndSubPath .","title":"FT_Stroker_Rewind"},{"location":"ft2-glyph_stroker.html#ft_stroker_parseoutline","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_ParseOutline ( FT_Stroker stroker, FT_Outline * outline, FT_Bool opened ); A convenience function used to parse a whole outline with the stroker. The resulting outline(s) can be retrieved later by functions like FT_Stroker_GetCounts and FT_Stroker_Export .","title":"FT_Stroker_ParseOutline"},{"location":"ft2-glyph_stroker.html#ft_stroker_done","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Done ( FT_Stroker stroker ); Destroy a stroker object.","title":"FT_Stroker_Done"},{"location":"ft2-glyph_stroker.html#ft_stroker_beginsubpath","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_BeginSubPath ( FT_Stroker stroker, FT_Vector * to, FT_Bool open ); Start a new sub-path in the stroker.","title":"FT_Stroker_BeginSubPath"},{"location":"ft2-glyph_stroker.html#ft_stroker_endsubpath","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_EndSubPath ( FT_Stroker stroker ); Close the current sub-path in the stroker.","title":"FT_Stroker_EndSubPath"},{"location":"ft2-glyph_stroker.html#ft_stroker_lineto","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_LineTo ( FT_Stroker stroker, FT_Vector * to ); \u2018Draw\u2019 a single line segment in the stroker's current sub-path, from the last position.","title":"FT_Stroker_LineTo"},{"location":"ft2-glyph_stroker.html#ft_stroker_conicto","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_ConicTo ( FT_Stroker stroker, FT_Vector * control, FT_Vector * to ); \u2018Draw\u2019 a single quadratic Bezier in the stroker's current sub-path, from the last position.","title":"FT_Stroker_ConicTo"},{"location":"ft2-glyph_stroker.html#ft_stroker_cubicto","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_CubicTo ( FT_Stroker stroker, FT_Vector * control1, FT_Vector * control2, FT_Vector * to ); \u2018Draw\u2019 a single cubic Bezier in the stroker's current sub-path, from the last position.","title":"FT_Stroker_CubicTo"},{"location":"ft2-glyph_stroker.html#ft_stroker_getbordercounts","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_GetBorderCounts ( FT_Stroker stroker, FT_StrokerBorder border, FT_UInt *anum_points, FT_UInt *anum_contours ); Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export one of the \u2018border\u2019 or \u2018stroke\u2019 outlines generated by the stroker.","title":"FT_Stroker_GetBorderCounts"},{"location":"ft2-glyph_stroker.html#ft_stroker_exportborder","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_ExportBorder ( FT_Stroker stroker, FT_StrokerBorder border, FT_Outline * outline ); Call this function after FT_Stroker_GetBorderCounts to export the corresponding border to your own FT_Outline structure. Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.","title":"FT_Stroker_ExportBorder"},{"location":"ft2-glyph_stroker.html#ft_stroker_getcounts","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( FT_Error ) FT_Stroker_GetCounts ( FT_Stroker stroker, FT_UInt *anum_points, FT_UInt *anum_contours ); Call this function once you have finished parsing your paths with the stroker. It returns the number of points and contours necessary to export all points/borders from the stroked outline/path.","title":"FT_Stroker_GetCounts"},{"location":"ft2-glyph_stroker.html#ft_stroker_export","text":"Defined in FT_STROKER_H (freetype/ftstroke.h). FT_EXPORT( void ) FT_Stroker_Export ( FT_Stroker stroker, FT_Outline * outline ); Call this function after FT_Stroker_GetBorderCounts to export all borders to your own FT_Outline structure. Note that this function appends the border points and contours to your outline, but does not try to resize its arrays.","title":"FT_Stroker_Export"},{"location":"ft2-glyph_variants.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Unicode Variation Sequences Unicode Variation Sequences \u00b6 Synopsis \u00b6 Many characters, especially for CJK scripts, have variant forms. They are a sort of grey area somewhere between being totally irrelevant and semantically distinct; for this reason, the Unicode consortium decided to introduce Variation Sequences (VS), consisting of a Unicode base character and a variation selector instead of further extending the already huge number of characters. Unicode maintains two different sets, namely \u2018Standardized Variation Sequences\u2019 and registered \u2018Ideographic Variation Sequences\u2019 (IVS), collected in the \u2018Ideographic Variation Database\u2019 (IVD). https://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt https://unicode.org/reports/tr37/ https://unicode.org/ivd/ To date (January 2017), the character with the most ideographic variations is U+9089, having 32 such IVS. Three Mongolian Variation Selectors have the values U+180B-U+180D; 256 generic Variation Selectors are encoded in the ranges U+FE00-U+FE0F and U+E0100-U+E01EF. IVS currently use Variation Selectors from the range U+E0100-U+E01EF only. A VS consists of the base character value followed by a single Variation Selector. For example, to get the first variation of U+9089, you have to write the character sequence U+9089 U+E0100 . Adobe and MS decided to support both standardized and ideographic VS with a new cmap subtable (format 14). It is an odd subtable because it is not a mapping of input code points to glyphs, but contains lists of all variations supported by the font. A variation may be either \u2018default\u2019 or \u2018non-default\u2019 for a given font. A default variation is the one you will get for that code point if you look it up in the standard Unicode cmap. A non-default variation is a different glyph. FT_Face_GetCharVariantIndex \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Face_GetCharVariantIndex ( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); Return the glyph index of a given character code as modified by the variation selector. input face A handle to the source face object. charcode The character code point in Unicode. variantSelector The Unicode code point of the variation selector. return The glyph index. 0 means either \u2018undefined character code\u2019, or \u2018undefined selector code\u2019, or \u2018no variation selector cmap subtable\u2019, or \u2018current CharMap is not Unicode\u2019. note If you use FreeType to manipulate the contents of font files directly, be aware that the glyph index returned by this function doesn't always correspond to the internal indices used within the file. This is done to ensure that value 0 always corresponds to the \u2018missing glyph\u2019. This function is only meaningful if a) the font has a variation selector cmap sub table, and b) the current charmap has a Unicode encoding. since 2.3.6 FT_Face_GetCharVariantIsDefault \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Int ) FT_Face_GetCharVariantIsDefault ( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); Check whether this variation of this Unicode character is the one to be found in the charmap. input face A handle to the source face object. charcode The character codepoint in Unicode. variantSelector The Unicode codepoint of the variation selector. return 1 if found in the standard (Unicode) cmap, 0 if found in the variation selector cmap, or -1 if it is not a variation. note This function is only meaningful if the font has a variation selector cmap subtable. since 2.3.6 FT_Face_GetVariantSelectors \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetVariantSelectors ( FT_Face face ); Return a zero-terminated list of Unicode variation selectors found in the font. input face A handle to the source face object. return A pointer to an array of selector code points, or NULL if there is no valid variation selector cmap subtable. note The last item in the array is 0; the array is owned by the FT_Face object but can be overwritten or released on the next call to a FreeType function. since 2.3.6 FT_Face_GetVariantsOfChar \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetVariantsOfChar ( FT_Face face, FT_ULong charcode ); Return a zero-terminated list of Unicode variation selectors found for the specified character code. input face A handle to the source face object. charcode The character codepoint in Unicode. return A pointer to an array of variation selector code points that are active for the given character, or NULL if the corresponding list is empty. note The last item in the array is 0; the array is owned by the FT_Face object but can be overwritten or released on the next call to a FreeType function. since 2.3.6 FT_Face_GetCharsOfVariant \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetCharsOfVariant ( FT_Face face, FT_ULong variantSelector ); Return a zero-terminated list of Unicode character codes found for the specified variation selector. input face A handle to the source face object. variantSelector The variation selector code point in Unicode. return A list of all the code points that are specified by this selector (both default and non-default codes are returned) or NULL if there is no valid cmap or the variation selector is invalid. note The last item in the array is 0; the array is owned by the FT_Face object but can be overwritten or released on the next call to a FreeType function. since 2.3.6","title":"Unicode Variation Sequences"},{"location":"ft2-glyph_variants.html#unicode-variation-sequences","text":"","title":"Unicode Variation Sequences"},{"location":"ft2-glyph_variants.html#synopsis","text":"Many characters, especially for CJK scripts, have variant forms. They are a sort of grey area somewhere between being totally irrelevant and semantically distinct; for this reason, the Unicode consortium decided to introduce Variation Sequences (VS), consisting of a Unicode base character and a variation selector instead of further extending the already huge number of characters. Unicode maintains two different sets, namely \u2018Standardized Variation Sequences\u2019 and registered \u2018Ideographic Variation Sequences\u2019 (IVS), collected in the \u2018Ideographic Variation Database\u2019 (IVD). https://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt https://unicode.org/reports/tr37/ https://unicode.org/ivd/ To date (January 2017), the character with the most ideographic variations is U+9089, having 32 such IVS. Three Mongolian Variation Selectors have the values U+180B-U+180D; 256 generic Variation Selectors are encoded in the ranges U+FE00-U+FE0F and U+E0100-U+E01EF. IVS currently use Variation Selectors from the range U+E0100-U+E01EF only. A VS consists of the base character value followed by a single Variation Selector. For example, to get the first variation of U+9089, you have to write the character sequence U+9089 U+E0100 . Adobe and MS decided to support both standardized and ideographic VS with a new cmap subtable (format 14). It is an odd subtable because it is not a mapping of input code points to glyphs, but contains lists of all variations supported by the font. A variation may be either \u2018default\u2019 or \u2018non-default\u2019 for a given font. A default variation is the one you will get for that code point if you look it up in the standard Unicode cmap. A non-default variation is a different glyph.","title":"Synopsis"},{"location":"ft2-glyph_variants.html#ft_face_getcharvariantindex","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt ) FT_Face_GetCharVariantIndex ( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); Return the glyph index of a given character code as modified by the variation selector.","title":"FT_Face_GetCharVariantIndex"},{"location":"ft2-glyph_variants.html#ft_face_getcharvariantisdefault","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Int ) FT_Face_GetCharVariantIsDefault ( FT_Face face, FT_ULong charcode, FT_ULong variantSelector ); Check whether this variation of this Unicode character is the one to be found in the charmap.","title":"FT_Face_GetCharVariantIsDefault"},{"location":"ft2-glyph_variants.html#ft_face_getvariantselectors","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetVariantSelectors ( FT_Face face ); Return a zero-terminated list of Unicode variation selectors found in the font.","title":"FT_Face_GetVariantSelectors"},{"location":"ft2-glyph_variants.html#ft_face_getvariantsofchar","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetVariantsOfChar ( FT_Face face, FT_ULong charcode ); Return a zero-terminated list of Unicode variation selectors found for the specified character code.","title":"FT_Face_GetVariantsOfChar"},{"location":"ft2-glyph_variants.html#ft_face_getcharsofvariant","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_UInt32 * ) FT_Face_GetCharsOfVariant ( FT_Face face, FT_ULong variantSelector ); Return a zero-terminated list of Unicode character codes found for the specified variation selector.","title":"FT_Face_GetCharsOfVariant"},{"location":"ft2-gx_validation.html","text":"FreeType \u00bb Docs \u00bb Miscellaneous \u00bb TrueTypeGX/AAT Validation TrueTypeGX/AAT Validation \u00b6 Synopsis \u00b6 This section contains the declaration of functions to validate some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop, lcar). FT_TrueTypeGX_Validate \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( FT_Error ) FT_TrueTypeGX_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes tables[ FT_VALIDATE_GX_LENGTH ], FT_UInt table_length ); Validate various TrueTypeGX tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming). input face A handle to the input face. validation_flags A bit field that specifies the tables to be validated. See FT_VALIDATE_GXXXX for possible values. table_length The size of the tables array. Normally, FT_VALIDATE_GX_LENGTH should be passed. output tables The array where all validated sfnt tables are stored. The array itself must be allocated by a client. return FreeType error code. 0 means success. note This function only works with TrueTypeGX fonts, returning an error otherwise. After use, the application should deallocate the buffers pointed to by each tables element, by calling FT_TrueTypeGX_Free . A NULL value indicates that the table either doesn't exist in the font, the application hasn't asked for validation, or the validator doesn't have the ability to validate the sfnt table. FT_TrueTypeGX_Free \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( void ) FT_TrueTypeGX_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by TrueTypeGX validator. input face A handle to the input face. table The pointer to the buffer allocated by FT_TrueTypeGX_Validate . note This function must be used to free the buffer allocated by FT_TrueTypeGX_Validate only. FT_ClassicKern_Validate \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( FT_Error ) FT_ClassicKern_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes *ckern_table ); Validate classic (16-bit format) kern table to assure that the offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming). The \u2018kern\u2019 table validator in FT_TrueTypeGX_Validate deals with both the new 32-bit format and the classic 16-bit format, while FT_ClassicKern_Validate only supports the classic 16-bit format. input face A handle to the input face. validation_flags A bit field that specifies the dialect to be validated. See FT_VALIDATE_CKERNXXX for possible values. output ckern_table A pointer to the kern table. return FreeType error code. 0 means success. note After use, the application should deallocate the buffers pointed to by ckern_table , by calling FT_ClassicKern_Free . A NULL value indicates that the table doesn't exist in the font. FT_ClassicKern_Free \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( void ) FT_ClassicKern_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by classic Kern validator. input face A handle to the input face. table The pointer to the buffer that is allocated by FT_ClassicKern_Validate . note This function must be used to free the buffer allocated by FT_ClassicKern_Validate only. FT_VALIDATE_GX_LENGTH \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 ) The number of tables checked in this module. Use it as a parameter for the table-length argument of function FT_TrueTypeGX_Validate . FT_VALIDATE_GXXXX \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) # define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) # define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx ) # define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln ) # define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just ) # define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern ) # define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd ) # define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak ) # define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop ) # define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar ) # define FT_VALIDATE_GX ( FT_VALIDATE_feat | \\ FT_VALIDATE_mort | \\ FT_VALIDATE_morx | \\ FT_VALIDATE_bsln | \\ FT_VALIDATE_just | \\ FT_VALIDATE_kern | \\ FT_VALIDATE_opbd | \\ FT_VALIDATE_trak | \\ FT_VALIDATE_prop | \\ FT_VALIDATE_lcar ) A list of bit-field constants used with FT_TrueTypeGX_Validate to indicate which TrueTypeGX/AAT Type tables should be validated. values FT_VALIDATE_feat Validate \u2018feat\u2019 table. FT_VALIDATE_mort Validate \u2018mort\u2019 table. FT_VALIDATE_morx Validate \u2018morx\u2019 table. FT_VALIDATE_bsln Validate \u2018bsln\u2019 table. FT_VALIDATE_just Validate \u2018just\u2019 table. FT_VALIDATE_kern Validate \u2018kern\u2019 table. FT_VALIDATE_opbd Validate \u2018opbd\u2019 table. FT_VALIDATE_trak Validate \u2018trak\u2019 table. FT_VALIDATE_prop Validate \u2018prop\u2019 table. FT_VALIDATE_lcar Validate \u2018lcar\u2019 table. FT_VALIDATE_GX Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop and lcar). FT_VALIDATE_CKERNXXX \u00b6 Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) # define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) # define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) A list of bit-field constants used with FT_ClassicKern_Validate to indicate the classic kern dialect or dialects. If the selected type doesn't fit, FT_ClassicKern_Validate regards the table as invalid. values FT_VALIDATE_MS Handle the \u2018kern\u2019 table as a classic Microsoft kern table. FT_VALIDATE_APPLE Handle the \u2018kern\u2019 table as a classic Apple kern table. FT_VALIDATE_CKERN Handle the \u2018kern\u2019 as either classic Apple or Microsoft kern table.","title":"TrueTypeGX/AAT Validation"},{"location":"ft2-gx_validation.html#truetypegxaat-validation","text":"","title":"TrueTypeGX/AAT Validation"},{"location":"ft2-gx_validation.html#synopsis","text":"This section contains the declaration of functions to validate some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd, trak, prop, lcar).","title":"Synopsis"},{"location":"ft2-gx_validation.html#ft_truetypegx_validate","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( FT_Error ) FT_TrueTypeGX_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes tables[ FT_VALIDATE_GX_LENGTH ], FT_UInt table_length ); Validate various TrueTypeGX tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming).","title":"FT_TrueTypeGX_Validate"},{"location":"ft2-gx_validation.html#ft_truetypegx_free","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( void ) FT_TrueTypeGX_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by TrueTypeGX validator.","title":"FT_TrueTypeGX_Free"},{"location":"ft2-gx_validation.html#ft_classickern_validate","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( FT_Error ) FT_ClassicKern_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes *ckern_table ); Validate classic (16-bit format) kern table to assure that the offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming). The \u2018kern\u2019 table validator in FT_TrueTypeGX_Validate deals with both the new 32-bit format and the classic 16-bit format, while FT_ClassicKern_Validate only supports the classic 16-bit format.","title":"FT_ClassicKern_Validate"},{"location":"ft2-gx_validation.html#ft_classickern_free","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). FT_EXPORT( void ) FT_ClassicKern_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by classic Kern validator.","title":"FT_ClassicKern_Free"},{"location":"ft2-gx_validation.html#ft_validate_gx_length","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_GX_LENGTH ( FT_VALIDATE_GX_LAST_INDEX + 1 ) The number of tables checked in this module. Use it as a parameter for the table-length argument of function FT_TrueTypeGX_Validate .","title":"FT_VALIDATE_GX_LENGTH"},{"location":"ft2-gx_validation.html#ft_validate_gxxxx","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_feat FT_VALIDATE_GX_BITFIELD( feat ) # define FT_VALIDATE_mort FT_VALIDATE_GX_BITFIELD( mort ) # define FT_VALIDATE_morx FT_VALIDATE_GX_BITFIELD( morx ) # define FT_VALIDATE_bsln FT_VALIDATE_GX_BITFIELD( bsln ) # define FT_VALIDATE_just FT_VALIDATE_GX_BITFIELD( just ) # define FT_VALIDATE_kern FT_VALIDATE_GX_BITFIELD( kern ) # define FT_VALIDATE_opbd FT_VALIDATE_GX_BITFIELD( opbd ) # define FT_VALIDATE_trak FT_VALIDATE_GX_BITFIELD( trak ) # define FT_VALIDATE_prop FT_VALIDATE_GX_BITFIELD( prop ) # define FT_VALIDATE_lcar FT_VALIDATE_GX_BITFIELD( lcar ) # define FT_VALIDATE_GX ( FT_VALIDATE_feat | \\ FT_VALIDATE_mort | \\ FT_VALIDATE_morx | \\ FT_VALIDATE_bsln | \\ FT_VALIDATE_just | \\ FT_VALIDATE_kern | \\ FT_VALIDATE_opbd | \\ FT_VALIDATE_trak | \\ FT_VALIDATE_prop | \\ FT_VALIDATE_lcar ) A list of bit-field constants used with FT_TrueTypeGX_Validate to indicate which TrueTypeGX/AAT Type tables should be validated.","title":"FT_VALIDATE_GXXXX"},{"location":"ft2-gx_validation.html#ft_validate_ckernxxx","text":"Defined in FT_GX_VALIDATE_H (freetype/ftgxval.h). # define FT_VALIDATE_MS ( FT_VALIDATE_GX_START << 0 ) # define FT_VALIDATE_APPLE ( FT_VALIDATE_GX_START << 1 ) # define FT_VALIDATE_CKERN ( FT_VALIDATE_MS | FT_VALIDATE_APPLE ) A list of bit-field constants used with FT_ClassicKern_Validate to indicate the classic kern dialect or dialects. If the selected type doesn't fit, FT_ClassicKern_Validate regards the table as invalid.","title":"FT_VALIDATE_CKERNXXX"},{"location":"ft2-gzip.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb GZIP Streams GZIP Streams \u00b6 Synopsis \u00b6 In certain builds of the library, gzip compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a gzipped stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of Gzip-specific functions. FT_Stream_OpenGzip \u00b6 Defined in FT_GZIP_H (freetype/ftgzip.h). FT_EXPORT( FT_Error ) FT_Stream_OpenGzip ( FT_Stream stream, FT_Stream source ); 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 The target embedding stream. source The source stream. return FreeType error code. 0 means success. note The source stream must be opened before calling this function. Calling the internal function FT_Stream_Close on the new stream will not call FT_Stream_Close on the source stream. None of the stream objects will be released to the heap. This function may return FT_Err_Unimplemented_Feature if your build of FreeType was not compiled with zlib support. FT_Gzip_Uncompress \u00b6 Defined in FT_GZIP_H (freetype/ftgzip.h). FT_EXPORT( FT_Error ) FT_Gzip_Uncompress ( FT_Memory memory, FT_Byte * output, FT_ULong * output_len, const FT_Byte * input, FT_ULong input_len ); Decompress a zipped input buffer into an output buffer. This function is modeled after zlib's uncompress function. input memory A FreeType memory handle. input The input buffer. input_len The length of the input buffer. output output The output buffer. inout output_len Before calling the function, this is the total size of the output buffer, which must be large enough to hold the entire uncompressed data (so the size of the uncompressed data must be known in advance). After calling the function, output_len is the size of the used data in output . return FreeType error code. 0 means success. note This function may return FT_Err_Unimplemented_Feature if your build of FreeType was not compiled with zlib support. since 2.5.1","title":"GZIP Streams"},{"location":"ft2-gzip.html#gzip-streams","text":"","title":"GZIP Streams"},{"location":"ft2-gzip.html#synopsis","text":"In certain builds of the library, gzip compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a gzipped stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of Gzip-specific functions.","title":"Synopsis"},{"location":"ft2-gzip.html#ft_stream_opengzip","text":"Defined in FT_GZIP_H (freetype/ftgzip.h). FT_EXPORT( FT_Error ) FT_Stream_OpenGzip ( FT_Stream stream, FT_Stream source ); 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.","title":"FT_Stream_OpenGzip"},{"location":"ft2-gzip.html#ft_gzip_uncompress","text":"Defined in FT_GZIP_H (freetype/ftgzip.h). FT_EXPORT( FT_Error ) FT_Gzip_Uncompress ( FT_Memory memory, FT_Byte * output, FT_ULong * output_len, const FT_Byte * input, FT_ULong input_len ); Decompress a zipped input buffer into an output buffer. This function is modeled after zlib's uncompress function.","title":"FT_Gzip_Uncompress"},{"location":"ft2-header_file_macros.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Header File Macros Header File Macros \u00b6 Synopsis \u00b6 In addition to the normal scheme of including header files like #include <freetype/freetype.h> #include <freetype/ftmm.h> #include <freetype/ftglyph.h> it is possible to used named macros instead. They can be used directly in #include statements as in #include FT_FREETYPE_H #include FT_MULTIPLE_MASTERS_H #include FT_GLYPH_H These macros were introduced to overcome the infamous 8.3 naming rule required by DOS (and FT_MULTIPLE_MASTERS_H is a lot more meaningful than ftmm.h ). FT_CONFIG_CONFIG_H \u00b6 # ifndef FT_CONFIG_CONFIG_H # define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h> # endif A macro used in #include statements to name the file containing FreeType 2 configuration data. FT_CONFIG_STANDARD_LIBRARY_H \u00b6 # ifndef FT_CONFIG_STANDARD_LIBRARY_H # define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> # endif A macro used in #include statements to name the file containing FreeType 2 interface to the standard C library functions. FT_CONFIG_OPTIONS_H \u00b6 # ifndef FT_CONFIG_OPTIONS_H # define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> # endif A macro used in #include statements to name the file containing FreeType 2 project-specific configuration options. FT_CONFIG_MODULES_H \u00b6 # ifndef FT_CONFIG_MODULES_H # define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h> # endif 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 . FT_FREETYPE_H \u00b6 # define FT_FREETYPE_H <freetype/freetype.h> A macro used in #include statements to name the file containing the base FreeType 2 API. FT_ERRORS_H \u00b6 # define FT_ERRORS_H <freetype/fterrors.h> 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 . FT_MODULE_ERRORS_H \u00b6 # define FT_MODULE_ERRORS_H <freetype/ftmoderr.h> A macro used in #include statements to name the file containing the list of FreeType 2 module error offsets (and messages). FT_SYSTEM_H \u00b6 # define FT_SYSTEM_H <freetype/ftsystem.h> 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 . FT_IMAGE_H \u00b6 # define FT_IMAGE_H <freetype/ftimage.h> A macro used in #include statements to name the file containing type definitions related to glyph images (i.e., bitmaps, outlines, scan-converter parameters). It is included by FT_FREETYPE_H . FT_TYPES_H \u00b6 # define FT_TYPES_H <freetype/fttypes.h> 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 . FT_LIST_H \u00b6 # define FT_LIST_H <freetype/ftlist.h> 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.) FT_OUTLINE_H \u00b6 # define FT_OUTLINE_H <freetype/ftoutln.h> A macro used in #include statements to name the file containing the scalable outline management API of FreeType 2. FT_SIZES_H \u00b6 # define FT_SIZES_H <freetype/ftsizes.h> A macro used in #include statements to name the file containing the API which manages multiple FT_Size objects per face. FT_MODULE_H \u00b6 # define FT_MODULE_H <freetype/ftmodapi.h> A macro used in #include statements to name the file containing the module management API of FreeType 2. FT_RENDER_H \u00b6 # define FT_RENDER_H <freetype/ftrender.h> A macro used in #include statements to name the file containing the renderer module management API of FreeType 2. FT_DRIVER_H \u00b6 # define FT_DRIVER_H <freetype/ftdriver.h> A macro used in #include statements to name the file containing structures and macros related to the driver modules. FT_AUTOHINTER_H \u00b6 # define FT_AUTOHINTER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the auto-hinting module. Deprecated since version 2.9; use FT_DRIVER_H instead. FT_CFF_DRIVER_H \u00b6 # define FT_CFF_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the CFF driver module. Deprecated since version 2.9; use FT_DRIVER_H instead. FT_TRUETYPE_DRIVER_H \u00b6 # define FT_TRUETYPE_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the TrueType driver module. Deprecated since version 2.9; use FT_DRIVER_H instead. FT_PCF_DRIVER_H \u00b6 # define FT_PCF_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the PCF driver module. Deprecated since version 2.9; use FT_DRIVER_H instead. FT_TYPE1_TABLES_H \u00b6 # define FT_TYPE1_TABLES_H <freetype/t1tables.h> A macro used in #include statements to name the file containing the types and API specific to the Type 1 format. FT_TRUETYPE_IDS_H \u00b6 # define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> A macro used in #include statements to name the file containing the enumeration values which identify name strings, languages, encodings, etc. This file really contains a large set of constant macro definitions, taken from the TrueType and OpenType specifications. FT_TRUETYPE_TABLES_H \u00b6 # define FT_TRUETYPE_TABLES_H <freetype/tttables.h> A macro used in #include statements to name the file containing the types and API specific to the TrueType (as well as OpenType) format. FT_TRUETYPE_TAGS_H \u00b6 # define FT_TRUETYPE_TAGS_H <freetype/tttags.h> A macro used in #include statements to name the file containing the definitions of TrueType four-byte \u2018tags\u2019 which identify blocks in SFNT-based font formats (i.e., TrueType and OpenType). FT_BDF_H \u00b6 # define FT_BDF_H <freetype/ftbdf.h> A macro used in #include statements to name the file containing the definitions of an API which accesses BDF-specific strings from a face. FT_CID_H \u00b6 # define FT_CID_H <freetype/ftcid.h> A macro used in #include statements to name the file containing the definitions of an API which access CID font information from a face. FT_GZIP_H \u00b6 # define FT_GZIP_H <freetype/ftgzip.h> A macro used in #include statements to name the file containing the definitions of an API which supports gzip-compressed files. FT_LZW_H \u00b6 # define FT_LZW_H <freetype/ftlzw.h> A macro used in #include statements to name the file containing the definitions of an API which supports LZW-compressed files. FT_BZIP2_H \u00b6 # define FT_BZIP2_H <freetype/ftbzip2.h> A macro used in #include statements to name the file containing the definitions of an API which supports bzip2-compressed files. FT_WINFONTS_H \u00b6 # define FT_WINFONTS_H <freetype/ftwinfnt.h> A macro used in #include statements to name the file containing the definitions of an API which supports Windows FNT files. FT_GLYPH_H \u00b6 # define FT_GLYPH_H <freetype/ftglyph.h> A macro used in #include statements to name the file containing the API of the optional glyph management component. FT_BITMAP_H \u00b6 # define FT_BITMAP_H <freetype/ftbitmap.h> A macro used in #include statements to name the file containing the API of the optional bitmap conversion component. FT_BBOX_H \u00b6 # define FT_BBOX_H <freetype/ftbbox.h> A macro used in #include statements to name the file containing the API of the optional exact bounding box computation routines. FT_CACHE_H \u00b6 # define FT_CACHE_H <freetype/ftcache.h> A macro used in #include statements to name the file containing the API of the optional FreeType 2 cache sub-system. FT_MAC_H \u00b6 # define FT_MAC_H <freetype/ftmac.h> 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). FT_MULTIPLE_MASTERS_H \u00b6 # define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> A macro used in #include statements to name the file containing the optional multiple-masters management API of FreeType 2. FT_SFNT_NAMES_H \u00b6 # define FT_SFNT_NAMES_H <freetype/ftsnames.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which accesses embedded \u2018name\u2019 strings in SFNT-based font formats (i.e., TrueType and OpenType). FT_OPENTYPE_VALIDATE_H \u00b6 # define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which validates OpenType tables (\u2018BASE\u2019, \u2018GDEF\u2019, \u2018GPOS\u2019, \u2018GSUB\u2019, \u2018JSTF\u2019). FT_GX_VALIDATE_H \u00b6 # define FT_GX_VALIDATE_H <freetype/ftgxval.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which validates TrueTypeGX/AAT tables (\u2018feat\u2019, \u2018mort\u2019, \u2018morx\u2019, \u2018bsln\u2019, \u2018just\u2019, \u2018kern\u2019, \u2018opbd\u2019, \u2018trak\u2019, \u2018prop\u2019). FT_PFR_H \u00b6 # define FT_PFR_H <freetype/ftpfr.h> A macro used in #include statements to name the file containing the FreeType 2 API which accesses PFR-specific data. FT_STROKER_H \u00b6 # define FT_STROKER_H <freetype/ftstroke.h> A macro used in #include statements to name the file containing the FreeType 2 API which provides functions to stroke outline paths. FT_SYNTHESIS_H \u00b6 # define FT_SYNTHESIS_H <freetype/ftsynth.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs artificial obliquing and emboldening. FT_FONT_FORMATS_H \u00b6 # define FT_FONT_FORMATS_H <freetype/ftfntfmt.h> /* deprecated */ # define FT_XFREE86_H FT_FONT_FORMATS_H A macro used in #include statements to name the file containing the FreeType 2 API which provides functions specific to font formats. FT_TRIGONOMETRY_H \u00b6 # define FT_TRIGONOMETRY_H <freetype/fttrigon.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs trigonometric computations (e.g., cosines and arc tangents). FT_LCD_FILTER_H \u00b6 # define FT_LCD_FILTER_H <freetype/ftlcdfil.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering. FT_INCREMENTAL_H \u00b6 # define FT_INCREMENTAL_H <freetype/ftincrem.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs incremental glyph loading. FT_GASP_H \u00b6 # define FT_GASP_H <freetype/ftgasp.h> A macro used in #include statements to name the file containing the FreeType 2 API which returns entries from the TrueType GASP table. FT_ADVANCES_H \u00b6 # define FT_ADVANCES_H <freetype/ftadvanc.h> A macro used in #include statements to name the file containing the FreeType 2 API which returns individual and ranged glyph advances. FT_COLOR_H \u00b6 # define FT_COLOR_H <freetype/ftcolor.h> A macro used in #include statements to name the file containing the FreeType 2 API which handles the OpenType \u2018CPAL\u2019 table. FT_OTSVG_H \u00b6 # define FT_OTSVG_H <freetype/otsvg.h> A macro used in #include statements to name the file containing the FreeType 2 API which handles the OpenType \u2018SVG \u2019 glyphs.","title":"Header File Macros"},{"location":"ft2-header_file_macros.html#header-file-macros","text":"","title":"Header File Macros"},{"location":"ft2-header_file_macros.html#synopsis","text":"In addition to the normal scheme of including header files like #include <freetype/freetype.h> #include <freetype/ftmm.h> #include <freetype/ftglyph.h> it is possible to used named macros instead. They can be used directly in #include statements as in #include FT_FREETYPE_H #include FT_MULTIPLE_MASTERS_H #include FT_GLYPH_H These macros were introduced to overcome the infamous 8.3 naming rule required by DOS (and FT_MULTIPLE_MASTERS_H is a lot more meaningful than ftmm.h ).","title":"Synopsis"},{"location":"ft2-header_file_macros.html#ft_config_config_h","text":"# ifndef FT_CONFIG_CONFIG_H # define FT_CONFIG_CONFIG_H <freetype/config/ftconfig.h> # endif A macro used in #include statements to name the file containing FreeType 2 configuration data.","title":"FT_CONFIG_CONFIG_H"},{"location":"ft2-header_file_macros.html#ft_config_standard_library_h","text":"# ifndef FT_CONFIG_STANDARD_LIBRARY_H # define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h> # endif A macro used in #include statements to name the file containing FreeType 2 interface to the standard C library functions.","title":"FT_CONFIG_STANDARD_LIBRARY_H"},{"location":"ft2-header_file_macros.html#ft_config_options_h","text":"# ifndef FT_CONFIG_OPTIONS_H # define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h> # endif A macro used in #include statements to name the file containing FreeType 2 project-specific configuration options.","title":"FT_CONFIG_OPTIONS_H"},{"location":"ft2-header_file_macros.html#ft_config_modules_h","text":"# ifndef FT_CONFIG_MODULES_H # define FT_CONFIG_MODULES_H <freetype/config/ftmodule.h> # endif 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 .","title":"FT_CONFIG_MODULES_H"},{"location":"ft2-header_file_macros.html#ft_freetype_h","text":"# define FT_FREETYPE_H <freetype/freetype.h> A macro used in #include statements to name the file containing the base FreeType 2 API.","title":"FT_FREETYPE_H"},{"location":"ft2-header_file_macros.html#ft_errors_h","text":"# define FT_ERRORS_H <freetype/fterrors.h> 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 .","title":"FT_ERRORS_H"},{"location":"ft2-header_file_macros.html#ft_module_errors_h","text":"# define FT_MODULE_ERRORS_H <freetype/ftmoderr.h> A macro used in #include statements to name the file containing the list of FreeType 2 module error offsets (and messages).","title":"FT_MODULE_ERRORS_H"},{"location":"ft2-header_file_macros.html#ft_system_h","text":"# define FT_SYSTEM_H <freetype/ftsystem.h> 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 .","title":"FT_SYSTEM_H"},{"location":"ft2-header_file_macros.html#ft_image_h","text":"# define FT_IMAGE_H <freetype/ftimage.h> A macro used in #include statements to name the file containing type definitions related to glyph images (i.e., bitmaps, outlines, scan-converter parameters). It is included by FT_FREETYPE_H .","title":"FT_IMAGE_H"},{"location":"ft2-header_file_macros.html#ft_types_h","text":"# define FT_TYPES_H <freetype/fttypes.h> 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 .","title":"FT_TYPES_H"},{"location":"ft2-header_file_macros.html#ft_list_h","text":"# define FT_LIST_H <freetype/ftlist.h> 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.)","title":"FT_LIST_H"},{"location":"ft2-header_file_macros.html#ft_outline_h","text":"# define FT_OUTLINE_H <freetype/ftoutln.h> A macro used in #include statements to name the file containing the scalable outline management API of FreeType 2.","title":"FT_OUTLINE_H"},{"location":"ft2-header_file_macros.html#ft_sizes_h","text":"# define FT_SIZES_H <freetype/ftsizes.h> A macro used in #include statements to name the file containing the API which manages multiple FT_Size objects per face.","title":"FT_SIZES_H"},{"location":"ft2-header_file_macros.html#ft_module_h","text":"# define FT_MODULE_H <freetype/ftmodapi.h> A macro used in #include statements to name the file containing the module management API of FreeType 2.","title":"FT_MODULE_H"},{"location":"ft2-header_file_macros.html#ft_render_h","text":"# define FT_RENDER_H <freetype/ftrender.h> A macro used in #include statements to name the file containing the renderer module management API of FreeType 2.","title":"FT_RENDER_H"},{"location":"ft2-header_file_macros.html#ft_driver_h","text":"# define FT_DRIVER_H <freetype/ftdriver.h> A macro used in #include statements to name the file containing structures and macros related to the driver modules.","title":"FT_DRIVER_H"},{"location":"ft2-header_file_macros.html#ft_autohinter_h","text":"# define FT_AUTOHINTER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the auto-hinting module. Deprecated since version 2.9; use FT_DRIVER_H instead.","title":"FT_AUTOHINTER_H"},{"location":"ft2-header_file_macros.html#ft_cff_driver_h","text":"# define FT_CFF_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the CFF driver module. Deprecated since version 2.9; use FT_DRIVER_H instead.","title":"FT_CFF_DRIVER_H"},{"location":"ft2-header_file_macros.html#ft_truetype_driver_h","text":"# define FT_TRUETYPE_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the TrueType driver module. Deprecated since version 2.9; use FT_DRIVER_H instead.","title":"FT_TRUETYPE_DRIVER_H"},{"location":"ft2-header_file_macros.html#ft_pcf_driver_h","text":"# define FT_PCF_DRIVER_H FT_DRIVER_H A macro used in #include statements to name the file containing structures and macros related to the PCF driver module. Deprecated since version 2.9; use FT_DRIVER_H instead.","title":"FT_PCF_DRIVER_H"},{"location":"ft2-header_file_macros.html#ft_type1_tables_h","text":"# define FT_TYPE1_TABLES_H <freetype/t1tables.h> A macro used in #include statements to name the file containing the types and API specific to the Type 1 format.","title":"FT_TYPE1_TABLES_H"},{"location":"ft2-header_file_macros.html#ft_truetype_ids_h","text":"# define FT_TRUETYPE_IDS_H <freetype/ttnameid.h> A macro used in #include statements to name the file containing the enumeration values which identify name strings, languages, encodings, etc. This file really contains a large set of constant macro definitions, taken from the TrueType and OpenType specifications.","title":"FT_TRUETYPE_IDS_H"},{"location":"ft2-header_file_macros.html#ft_truetype_tables_h","text":"# define FT_TRUETYPE_TABLES_H <freetype/tttables.h> A macro used in #include statements to name the file containing the types and API specific to the TrueType (as well as OpenType) format.","title":"FT_TRUETYPE_TABLES_H"},{"location":"ft2-header_file_macros.html#ft_truetype_tags_h","text":"# define FT_TRUETYPE_TAGS_H <freetype/tttags.h> A macro used in #include statements to name the file containing the definitions of TrueType four-byte \u2018tags\u2019 which identify blocks in SFNT-based font formats (i.e., TrueType and OpenType).","title":"FT_TRUETYPE_TAGS_H"},{"location":"ft2-header_file_macros.html#ft_bdf_h","text":"# define FT_BDF_H <freetype/ftbdf.h> A macro used in #include statements to name the file containing the definitions of an API which accesses BDF-specific strings from a face.","title":"FT_BDF_H"},{"location":"ft2-header_file_macros.html#ft_cid_h","text":"# define FT_CID_H <freetype/ftcid.h> A macro used in #include statements to name the file containing the definitions of an API which access CID font information from a face.","title":"FT_CID_H"},{"location":"ft2-header_file_macros.html#ft_gzip_h","text":"# define FT_GZIP_H <freetype/ftgzip.h> A macro used in #include statements to name the file containing the definitions of an API which supports gzip-compressed files.","title":"FT_GZIP_H"},{"location":"ft2-header_file_macros.html#ft_lzw_h","text":"# define FT_LZW_H <freetype/ftlzw.h> A macro used in #include statements to name the file containing the definitions of an API which supports LZW-compressed files.","title":"FT_LZW_H"},{"location":"ft2-header_file_macros.html#ft_bzip2_h","text":"# define FT_BZIP2_H <freetype/ftbzip2.h> A macro used in #include statements to name the file containing the definitions of an API which supports bzip2-compressed files.","title":"FT_BZIP2_H"},{"location":"ft2-header_file_macros.html#ft_winfonts_h","text":"# define FT_WINFONTS_H <freetype/ftwinfnt.h> A macro used in #include statements to name the file containing the definitions of an API which supports Windows FNT files.","title":"FT_WINFONTS_H"},{"location":"ft2-header_file_macros.html#ft_glyph_h","text":"# define FT_GLYPH_H <freetype/ftglyph.h> A macro used in #include statements to name the file containing the API of the optional glyph management component.","title":"FT_GLYPH_H"},{"location":"ft2-header_file_macros.html#ft_bitmap_h","text":"# define FT_BITMAP_H <freetype/ftbitmap.h> A macro used in #include statements to name the file containing the API of the optional bitmap conversion component.","title":"FT_BITMAP_H"},{"location":"ft2-header_file_macros.html#ft_bbox_h","text":"# define FT_BBOX_H <freetype/ftbbox.h> A macro used in #include statements to name the file containing the API of the optional exact bounding box computation routines.","title":"FT_BBOX_H"},{"location":"ft2-header_file_macros.html#ft_cache_h","text":"# define FT_CACHE_H <freetype/ftcache.h> A macro used in #include statements to name the file containing the API of the optional FreeType 2 cache sub-system.","title":"FT_CACHE_H"},{"location":"ft2-header_file_macros.html#ft_mac_h","text":"# define FT_MAC_H <freetype/ftmac.h> 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).","title":"FT_MAC_H"},{"location":"ft2-header_file_macros.html#ft_multiple_masters_h","text":"# define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h> A macro used in #include statements to name the file containing the optional multiple-masters management API of FreeType 2.","title":"FT_MULTIPLE_MASTERS_H"},{"location":"ft2-header_file_macros.html#ft_sfnt_names_h","text":"# define FT_SFNT_NAMES_H <freetype/ftsnames.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which accesses embedded \u2018name\u2019 strings in SFNT-based font formats (i.e., TrueType and OpenType).","title":"FT_SFNT_NAMES_H"},{"location":"ft2-header_file_macros.html#ft_opentype_validate_h","text":"# define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which validates OpenType tables (\u2018BASE\u2019, \u2018GDEF\u2019, \u2018GPOS\u2019, \u2018GSUB\u2019, \u2018JSTF\u2019).","title":"FT_OPENTYPE_VALIDATE_H"},{"location":"ft2-header_file_macros.html#ft_gx_validate_h","text":"# define FT_GX_VALIDATE_H <freetype/ftgxval.h> A macro used in #include statements to name the file containing the optional FreeType 2 API which validates TrueTypeGX/AAT tables (\u2018feat\u2019, \u2018mort\u2019, \u2018morx\u2019, \u2018bsln\u2019, \u2018just\u2019, \u2018kern\u2019, \u2018opbd\u2019, \u2018trak\u2019, \u2018prop\u2019).","title":"FT_GX_VALIDATE_H"},{"location":"ft2-header_file_macros.html#ft_pfr_h","text":"# define FT_PFR_H <freetype/ftpfr.h> A macro used in #include statements to name the file containing the FreeType 2 API which accesses PFR-specific data.","title":"FT_PFR_H"},{"location":"ft2-header_file_macros.html#ft_stroker_h","text":"# define FT_STROKER_H <freetype/ftstroke.h> A macro used in #include statements to name the file containing the FreeType 2 API which provides functions to stroke outline paths.","title":"FT_STROKER_H"},{"location":"ft2-header_file_macros.html#ft_synthesis_h","text":"# define FT_SYNTHESIS_H <freetype/ftsynth.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs artificial obliquing and emboldening.","title":"FT_SYNTHESIS_H"},{"location":"ft2-header_file_macros.html#ft_font_formats_h","text":"# define FT_FONT_FORMATS_H <freetype/ftfntfmt.h> /* deprecated */ # define FT_XFREE86_H FT_FONT_FORMATS_H A macro used in #include statements to name the file containing the FreeType 2 API which provides functions specific to font formats.","title":"FT_FONT_FORMATS_H"},{"location":"ft2-header_file_macros.html#ft_trigonometry_h","text":"# define FT_TRIGONOMETRY_H <freetype/fttrigon.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs trigonometric computations (e.g., cosines and arc tangents).","title":"FT_TRIGONOMETRY_H"},{"location":"ft2-header_file_macros.html#ft_lcd_filter_h","text":"# define FT_LCD_FILTER_H <freetype/ftlcdfil.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs color filtering for subpixel rendering.","title":"FT_LCD_FILTER_H"},{"location":"ft2-header_file_macros.html#ft_incremental_h","text":"# define FT_INCREMENTAL_H <freetype/ftincrem.h> A macro used in #include statements to name the file containing the FreeType 2 API which performs incremental glyph loading.","title":"FT_INCREMENTAL_H"},{"location":"ft2-header_file_macros.html#ft_gasp_h","text":"# define FT_GASP_H <freetype/ftgasp.h> A macro used in #include statements to name the file containing the FreeType 2 API which returns entries from the TrueType GASP table.","title":"FT_GASP_H"},{"location":"ft2-header_file_macros.html#ft_advances_h","text":"# define FT_ADVANCES_H <freetype/ftadvanc.h> A macro used in #include statements to name the file containing the FreeType 2 API which returns individual and ranged glyph advances.","title":"FT_ADVANCES_H"},{"location":"ft2-header_file_macros.html#ft_color_h","text":"# define FT_COLOR_H <freetype/ftcolor.h> A macro used in #include statements to name the file containing the FreeType 2 API which handles the OpenType \u2018CPAL\u2019 table.","title":"FT_COLOR_H"},{"location":"ft2-header_file_macros.html#ft_otsvg_h","text":"# define FT_OTSVG_H <freetype/otsvg.h> A macro used in #include statements to name the file containing the FreeType 2 API which handles the OpenType \u2018SVG \u2019 glyphs.","title":"FT_OTSVG_H"},{"location":"ft2-header_inclusion.html","text":"FreeType \u00bb Docs \u00bb General Remarks \u00bb FreeType's header inclusion scheme FreeType's header inclusion scheme \u00b6 Synopsis \u00b6 To be as flexible as possible (and for historical reasons), you must load file ft2build.h first before other header files, for example #include <ft2build.h> #include <freetype/freetype.h> #include <freetype/ftoutln.h>","title":"FreeType's header inclusion scheme"},{"location":"ft2-header_inclusion.html#freetypes-header-inclusion-scheme","text":"","title":"FreeType's header inclusion scheme"},{"location":"ft2-header_inclusion.html#synopsis","text":"To be as flexible as possible (and for historical reasons), you must load file ft2build.h first before other header files, for example #include <ft2build.h> #include <freetype/freetype.h> #include <freetype/ftoutln.h>","title":"Synopsis"},{"location":"ft2-incremental.html","text":"FreeType \u00bb Docs \u00bb Miscellaneous \u00bb Incremental Loading Incremental Loading \u00b6 Synopsis \u00b6 This section contains various functions used to perform so-called \u2018incremental\u2019 glyph loading. This is a mode where all glyphs loaded from a given FT_Face are provided by the client application. Apart from that, all other tables are loaded normally from the font file. This mode is useful when FreeType is used within another engine, e.g., a PostScript Imaging Processor. To enable this mode, you must use FT_Open_Face , passing an FT_Parameter with the FT_PARAM_TAG_INCREMENTAL tag and an FT_Incremental_Interface value. See the comments for FT_Incremental_InterfaceRec for an example. FT_Incremental \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_IncrementalRec_* FT_Incremental ; An opaque type describing a user-provided object used to implement \u2018incremental\u2019 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. FT_Incremental_MetricsRec \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_MetricsRec_ { FT_Long bearing_x; FT_Long bearing_y; FT_Long advance; FT_Long advance_v; /* since 2.3.12 */ } FT_Incremental_MetricsRec ; 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 Horizontal component of glyph advance, in font units. advance_v Vertical component of 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 . FT_Incremental_Metrics \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics ; A handle to an FT_Incremental_MetricsRec structure. FT_Incremental_GetGlyphDataFunc \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Error (* FT_Incremental_GetGlyphDataFunc )( FT_Incremental incremental, FT_UInt glyph_index, FT_Data * adata ); 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 \u2018glyf\u2019 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 successfully 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. FT_Incremental_FreeGlyphDataFunc \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef void (* FT_Incremental_FreeGlyphDataFunc )( FT_Incremental incremental, FT_Data * data ); 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). FT_Incremental_GetGlyphMetricsFunc \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Error (* FT_Incremental_GetGlyphMetricsFunc ) ( FT_Incremental incremental, FT_UInt glyph_index, FT_Bool vertical, FT_Incremental_MetricsRec *ametrics ); A function used to retrieve the basic metrics of a given glyph index before accessing its data. This allows for handling font types such as PCL XL Format 1, Class 2 downloaded TrueType fonts, where the glyph metrics ( hmtx and vmtx tables) are permitted to be omitted from the font, and the relevant metrics included in the header of the glyph outline data. Importantly, this is not intended to allow custom glyph metrics (for example, Postscript Metrics dictionaries), because that conflicts with the requirements of outline hinting. Such custom metrics must be handled separately, by the calling application. 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. ametrics This parameter is used for both input and output. The original glyph metrics, if any, in font units. If metrics are not available all the values must be set to zero. output ametrics The glyph metrics in font units. FT_Incremental_FuncsRec \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). 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 ; A table of functions for accessing fonts that load data incrementally. Used in FT_Incremental_InterfaceRec . 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 require it. FT_Incremental_InterfaceRec \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_InterfaceRec_ { const FT_Incremental_FuncsRec * funcs; FT_Incremental object; } FT_Incremental_InterfaceRec ; 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_PATHNAME | FT_OPEN_PARAMS; open_args.pathname = my_font_pathname; open_args.num_params = 1; open_args.params = &parameter; // we use one optional argument // open the font error = FT_Open_Face( library, &open_args, index, &face ); ... FT_Incremental_Interface \u00b6 Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Incremental_InterfaceRec * FT_Incremental_Interface ; A pointer to an FT_Incremental_InterfaceRec structure.","title":"Incremental Loading"},{"location":"ft2-incremental.html#incremental-loading","text":"","title":"Incremental Loading"},{"location":"ft2-incremental.html#synopsis","text":"This section contains various functions used to perform so-called \u2018incremental\u2019 glyph loading. This is a mode where all glyphs loaded from a given FT_Face are provided by the client application. Apart from that, all other tables are loaded normally from the font file. This mode is useful when FreeType is used within another engine, e.g., a PostScript Imaging Processor. To enable this mode, you must use FT_Open_Face , passing an FT_Parameter with the FT_PARAM_TAG_INCREMENTAL tag and an FT_Incremental_Interface value. See the comments for FT_Incremental_InterfaceRec for an example.","title":"Synopsis"},{"location":"ft2-incremental.html#ft_incremental","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_IncrementalRec_* FT_Incremental ; An opaque type describing a user-provided object used to implement \u2018incremental\u2019 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.","title":"FT_Incremental"},{"location":"ft2-incremental.html#ft_incremental_metricsrec","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_MetricsRec_ { FT_Long bearing_x; FT_Long bearing_y; FT_Long advance; FT_Long advance_v; /* since 2.3.12 */ } FT_Incremental_MetricsRec ; A small structure used to contain the basic glyph metrics returned by the FT_Incremental_GetGlyphMetricsFunc method.","title":"FT_Incremental_MetricsRec"},{"location":"ft2-incremental.html#ft_incremental_metrics","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_MetricsRec_* FT_Incremental_Metrics ; A handle to an FT_Incremental_MetricsRec structure.","title":"FT_Incremental_Metrics"},{"location":"ft2-incremental.html#ft_incremental_getglyphdatafunc","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Error (* FT_Incremental_GetGlyphDataFunc )( FT_Incremental incremental, FT_UInt glyph_index, FT_Data * adata ); 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 \u2018glyf\u2019 table. For PostScript formats, it must correspond to the unencrypted charstring bytes, without any lenIV header. It is undefined for any other format.","title":"FT_Incremental_GetGlyphDataFunc"},{"location":"ft2-incremental.html#ft_incremental_freeglyphdatafunc","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef void (* FT_Incremental_FreeGlyphDataFunc )( FT_Incremental incremental, FT_Data * data ); A function used to release the glyph data bytes returned by a successful call to FT_Incremental_GetGlyphDataFunc .","title":"FT_Incremental_FreeGlyphDataFunc"},{"location":"ft2-incremental.html#ft_incremental_getglyphmetricsfunc","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Error (* FT_Incremental_GetGlyphMetricsFunc ) ( FT_Incremental incremental, FT_UInt glyph_index, FT_Bool vertical, FT_Incremental_MetricsRec *ametrics ); A function used to retrieve the basic metrics of a given glyph index before accessing its data. This allows for handling font types such as PCL XL Format 1, Class 2 downloaded TrueType fonts, where the glyph metrics ( hmtx and vmtx tables) are permitted to be omitted from the font, and the relevant metrics included in the header of the glyph outline data. Importantly, this is not intended to allow custom glyph metrics (for example, Postscript Metrics dictionaries), because that conflicts with the requirements of outline hinting. Such custom metrics must be handled separately, by the calling application.","title":"FT_Incremental_GetGlyphMetricsFunc"},{"location":"ft2-incremental.html#ft_incremental_funcsrec","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). 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 ; A table of functions for accessing fonts that load data incrementally. Used in FT_Incremental_InterfaceRec .","title":"FT_Incremental_FuncsRec"},{"location":"ft2-incremental.html#ft_incremental_interfacerec","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef struct FT_Incremental_InterfaceRec_ { const FT_Incremental_FuncsRec * funcs; FT_Incremental object; } FT_Incremental_InterfaceRec ; 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_PATHNAME | FT_OPEN_PARAMS; open_args.pathname = my_font_pathname; open_args.num_params = 1; open_args.params = &parameter; // we use one optional argument // open the font error = FT_Open_Face( library, &open_args, index, &face ); ...","title":"FT_Incremental_InterfaceRec"},{"location":"ft2-incremental.html#ft_incremental_interface","text":"Defined in FT_INCREMENTAL_H (freetype/ftincrem.h). typedef FT_Incremental_InterfaceRec * FT_Incremental_Interface ; A pointer to an FT_Incremental_InterfaceRec structure.","title":"FT_Incremental_Interface"},{"location":"ft2-index.html","text":"FreeType \u00bb Docs \u00bb Global Index FreeType-2.12.1 API Reference \u00b6 B \u00b6 BDF_Property BDF_PROPERTY_TYPE_ATOM BDF_PROPERTY_TYPE_CARDINAL BDF_PROPERTY_TYPE_INTEGER BDF_PROPERTY_TYPE_NONE BDF_PropertyRec BDF_PropertyType C \u00b6 CID_FaceDict CID_FaceDictRec CID_FaceInfo CID_FaceInfoRec CID_FontDict CID_Info D \u00b6 darkening-parameters default-script F \u00b6 fallback-script FREETYPE_MAJOR FREETYPE_MINOR FREETYPE_PATCH FREETYPE_XXX FT_Activate_Size FT_Add_Default_Modules FT_Add_Module FT_ADVANCE_FLAG_FAST_ONLY FT_ADVANCES_H FT_Affine23 FT_Alloc_Func FT_Angle FT_ANGLE_2PI FT_Angle_Diff FT_ANGLE_PI FT_ANGLE_PI2 FT_ANGLE_PI4 FT_Atan2 FT_Attach_File FT_Attach_Stream FT_AUTOHINTER_H FT_AUTOHINTER_SCRIPT_CJK FT_AUTOHINTER_SCRIPT_INDIC FT_AUTOHINTER_SCRIPT_LATIN FT_AUTOHINTER_SCRIPT_NONE FT_AUTOHINTER_SCRIPT_XXX FT_BBox FT_BBOX_H FT_BDF_H FT_Bitmap FT_Bitmap_Blend FT_Bitmap_Convert FT_Bitmap_Copy FT_Bitmap_Done FT_Bitmap_Embolden FT_BITMAP_H FT_Bitmap_Init FT_Bitmap_Size FT_BitmapGlyph FT_BitmapGlyphRec FT_Bool FT_Byte FT_Bytes FT_BZIP2_H FT_CACHE_H FT_CeilFix FT_CFF_DRIVER_H FT_Char FT_CharMap FT_CharMapRec FT_CID_H FT_ClassicKern_Free FT_ClassicKern_Validate FT_ClipBox FT_Color FT_COLOR_H FT_COLOR_INCLUDE_ROOT_TRANSFORM FT_COLOR_NO_ROOT_TRANSFORM FT_Color_Root_Transform FT_ColorIndex FT_ColorLine FT_ColorStop FT_ColorStopIterator FT_COLR_Paint FT_Composite_Mode FT_CONFIG_CONFIG_H FT_CONFIG_MODULES_H FT_CONFIG_OPTIONS_H FT_CONFIG_STANDARD_LIBRARY_H FT_Cos FT_Custom_Log_Handler FT_Data FT_DEBUG_HOOK_TRUETYPE FT_DEBUG_HOOK_XXX FT_DebugHook_Func FT_DivFix FT_Done_Face FT_Done_FreeType FT_Done_Glyph FT_Done_Library FT_Done_MM_Var FT_Done_Size FT_Driver FT_DRIVER_H FT_ENC_TAG FT_Encoding FT_ENCODING_ADOBE_CUSTOM FT_ENCODING_ADOBE_EXPERT FT_ENCODING_ADOBE_LATIN_1 FT_ENCODING_ADOBE_STANDARD FT_ENCODING_APPLE_ROMAN FT_ENCODING_BIG5 FT_ENCODING_JOHAB FT_ENCODING_MS_BIG5 FT_ENCODING_MS_GB2312 FT_ENCODING_MS_JOHAB FT_ENCODING_MS_SJIS FT_ENCODING_MS_SYMBOL FT_ENCODING_MS_WANSUNG FT_ENCODING_NONE FT_ENCODING_OLD_LATIN_2 FT_ENCODING_PRC FT_ENCODING_SJIS FT_ENCODING_UNICODE FT_ENCODING_WANSUNG FT_Err_XXX FT_Error FT_Error_String FT_ERRORS_H FT_F26Dot6 FT_F2Dot14 FT_Face FT_Face_CheckTrueTypePatents FT_FACE_DRIVER_NAME FT_FACE_FLAG_CID_KEYED FT_FACE_FLAG_COLOR FT_FACE_FLAG_EXTERNAL_STREAM FT_FACE_FLAG_FAST_GLYPHS FT_FACE_FLAG_FIXED_SIZES FT_FACE_FLAG_FIXED_WIDTH FT_FACE_FLAG_GLYPH_NAMES FT_FACE_FLAG_HINTER FT_FACE_FLAG_HORIZONTAL FT_FACE_FLAG_KERNING FT_FACE_FLAG_MULTIPLE_MASTERS FT_FACE_FLAG_SBIX FT_FACE_FLAG_SBIX_OVERLAY FT_FACE_FLAG_SCALABLE FT_FACE_FLAG_SFNT FT_FACE_FLAG_SVG FT_FACE_FLAG_TRICKY FT_FACE_FLAG_VARIATION FT_FACE_FLAG_VERTICAL FT_FACE_FLAG_XXX FT_Face_GetCharsOfVariant FT_Face_GetCharVariantIndex FT_Face_GetCharVariantIsDefault FT_Face_GetVariantSelectors FT_Face_GetVariantsOfChar FT_Face_Internal FT_Face_Properties FT_Face_SetUnpatentedHinting FT_FaceRec FT_Fixed FT_FloorFix FT_FONT_FORMATS_H FT_Free_Func FT_FREETYPE_H FT_FSTYPE_BITMAP_EMBEDDING_ONLY FT_FSTYPE_EDITABLE_EMBEDDING FT_FSTYPE_INSTALLABLE_EMBEDDING FT_FSTYPE_NO_SUBSETTING FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING FT_FSTYPE_XXX FT_FWord FT_GASP_DO_GRAY FT_GASP_DO_GRIDFIT FT_GASP_H FT_GASP_NO_TABLE FT_GASP_SYMMETRIC_GRIDFIT FT_GASP_SYMMETRIC_SMOOTHING FT_GASP_XXX FT_Generic FT_Generic_Finalizer FT_Get_Advance FT_Get_Advances FT_Get_BDF_Charset_ID FT_Get_BDF_Property FT_Get_Char_Index FT_Get_Charmap_Index FT_Get_CID_From_Glyph_Index FT_Get_CID_Is_Internally_CID_Keyed FT_Get_CID_Registry_Ordering_Supplement FT_Get_CMap_Format FT_Get_CMap_Language_ID FT_Get_Color_Glyph_ClipBox FT_Get_Color_Glyph_Layer FT_Get_Color_Glyph_Paint FT_Get_Colorline_Stops FT_Get_First_Char FT_Get_Font_Format FT_Get_FSType_Flags FT_Get_Gasp FT_Get_Glyph FT_Get_Glyph_Name FT_Get_Kerning FT_Get_MM_Blend_Coordinates FT_Get_MM_Var FT_Get_MM_WeightVector FT_Get_Module FT_Get_Multi_Master FT_Get_Name_Index FT_Get_Next_Char FT_Get_Paint FT_Get_Paint_Layers FT_Get_PFR_Advance FT_Get_PFR_Kerning FT_Get_PFR_Metrics FT_Get_Postscript_Name FT_Get_PS_Font_Info FT_Get_PS_Font_Private FT_Get_PS_Font_Value FT_Get_Renderer FT_Get_Sfnt_LangTag FT_Get_Sfnt_Name FT_Get_Sfnt_Name_Count FT_Get_Sfnt_Table FT_Get_SubGlyph_Info FT_Get_Track_Kerning FT_Get_Transform FT_Get_TrueType_Engine_Type FT_Get_Var_Axis_Flags FT_Get_Var_Blend_Coordinates FT_Get_Var_Design_Coordinates FT_Get_WinFNT_Header FT_GetFile_From_Mac_ATS_Name FT_GetFile_From_Mac_Name FT_GetFilePath_From_Mac_ATS_Name FT_Glyph FT_GLYPH_BBOX_GRIDFIT FT_Glyph_BBox_Mode FT_GLYPH_BBOX_PIXELS FT_GLYPH_BBOX_SUBPIXELS FT_GLYPH_BBOX_TRUNCATE FT_GLYPH_BBOX_UNSCALED FT_Glyph_Copy FT_Glyph_Format FT_GLYPH_FORMAT_BITMAP FT_GLYPH_FORMAT_COMPOSITE FT_GLYPH_FORMAT_NONE FT_GLYPH_FORMAT_OUTLINE FT_GLYPH_FORMAT_PLOTTER FT_GLYPH_FORMAT_SVG FT_Glyph_Get_CBox FT_GLYPH_H FT_Glyph_Metrics FT_Glyph_Stroke FT_Glyph_StrokeBorder FT_Glyph_To_Bitmap FT_Glyph_Transform FT_GlyphRec FT_GlyphSlot FT_GlyphSlot_Own_Bitmap FT_GlyphSlotRec FT_GX_VALIDATE_H FT_GZIP_H FT_Gzip_Uncompress FT_HAS_COLOR FT_HAS_FAST_GLYPHS FT_HAS_FIXED_SIZES FT_HAS_GLYPH_NAMES FT_HAS_HORIZONTAL FT_HAS_KERNING FT_HAS_MULTIPLE_MASTERS FT_Has_PS_Glyph_Names FT_HAS_SBIX FT_HAS_SBIX_OVERLAY FT_HAS_SVG FT_HAS_VERTICAL FT_HINTING_ADOBE FT_HINTING_FREETYPE FT_HINTING_XXX FT_IMAGE_H FT_IMAGE_TAG FT_Incremental FT_Incremental_FreeGlyphDataFunc FT_Incremental_FuncsRec FT_Incremental_GetGlyphDataFunc FT_Incremental_GetGlyphMetricsFunc FT_INCREMENTAL_H FT_Incremental_Interface FT_Incremental_InterfaceRec FT_Incremental_Metrics FT_Incremental_MetricsRec FT_Init_FreeType FT_Int FT_Int16 FT_Int32 FT_Int64 FT_IS_CID_KEYED FT_IS_FIXED_WIDTH FT_IS_NAMED_INSTANCE FT_IS_SCALABLE FT_IS_SFNT FT_IS_TRICKY FT_IS_VARIATION FT_KERNING_DEFAULT FT_Kerning_Mode FT_KERNING_UNFITTED FT_KERNING_UNSCALED FT_LayerIterator FT_LCD_FILTER_DEFAULT FT_LCD_FILTER_H FT_LCD_FILTER_LEGACY FT_LCD_FILTER_LEGACY1 FT_LCD_FILTER_LIGHT FT_LCD_FILTER_NONE FT_LcdFilter FT_LcdFiveTapFilter FT_Library FT_Library_SetLcdFilter FT_Library_SetLcdFilterWeights FT_Library_SetLcdGeometry FT_Library_Version FT_List FT_List_Add FT_List_Destructor FT_List_Finalize FT_List_Find FT_LIST_H FT_List_Insert FT_List_Iterate FT_List_Iterator FT_List_Remove FT_List_Up FT_ListNode FT_ListNodeRec FT_ListRec FT_LOAD_BITMAP_METRICS_ONLY FT_Load_Char FT_LOAD_COLOR FT_LOAD_COMPUTE_METRICS FT_LOAD_CROP_BITMAP FT_LOAD_DEFAULT FT_LOAD_FORCE_AUTOHINT FT_Load_Glyph FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH FT_LOAD_IGNORE_TRANSFORM FT_LOAD_LINEAR_DESIGN FT_LOAD_MONOCHROME FT_LOAD_NO_AUTOHINT FT_LOAD_NO_BITMAP FT_LOAD_NO_HINTING FT_LOAD_NO_RECURSE FT_LOAD_NO_SCALE FT_LOAD_PEDANTIC FT_LOAD_RENDER FT_LOAD_SBITS_ONLY FT_Load_Sfnt_Table FT_LOAD_TARGET_LCD FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_MODE FT_LOAD_TARGET_MONO FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_XXX FT_LOAD_VERTICAL_LAYOUT FT_LOAD_XXX FT_Long FT_LZW_H FT_MAC_H FT_MAKE_TAG FT_Matrix FT_Matrix_Invert FT_Matrix_Multiply FT_Memory FT_MemoryRec FT_MM_Axis FT_MM_Var FT_Module FT_Module_Class FT_Module_Constructor FT_Module_Destructor FT_MODULE_ERRORS_H FT_MODULE_H FT_Module_Requester FT_MulDiv FT_MulFix FT_Multi_Master FT_MULTIPLE_MASTERS_H FT_New_Face FT_New_Face_From_FOND FT_New_Face_From_FSRef FT_New_Face_From_FSSpec FT_New_Glyph FT_New_Library FT_New_Memory_Face FT_New_Size FT_Offset FT_OpaquePaint FT_Open_Args FT_OPEN_DRIVER FT_Open_Face FT_OPEN_MEMORY FT_OPEN_PARAMS FT_OPEN_PATHNAME FT_OPEN_STREAM FT_OPEN_XXX FT_OpenType_Free FT_OpenType_Validate FT_OPENTYPE_VALIDATE_H FT_Orientation FT_ORIENTATION_FILL_LEFT FT_ORIENTATION_FILL_RIGHT FT_ORIENTATION_NONE FT_ORIENTATION_POSTSCRIPT FT_ORIENTATION_TRUETYPE FT_OTSVG_H FT_Outline FT_Outline_Check FT_Outline_ConicToFunc FT_Outline_Copy FT_Outline_CubicToFunc FT_Outline_Decompose FT_Outline_Done FT_Outline_Embolden FT_Outline_EmboldenXY FT_OUTLINE_EVEN_ODD_FILL FT_Outline_Funcs FT_Outline_Get_BBox FT_Outline_Get_Bitmap FT_Outline_Get_CBox FT_Outline_Get_Orientation FT_Outline_GetInsideBorder FT_Outline_GetOutsideBorder FT_OUTLINE_H FT_OUTLINE_HIGH_PRECISION FT_OUTLINE_IGNORE_DROPOUTS FT_OUTLINE_INCLUDE_STUBS FT_Outline_LineToFunc FT_Outline_MoveToFunc FT_Outline_New FT_OUTLINE_NONE FT_OUTLINE_OVERLAP FT_OUTLINE_OWNER FT_Outline_Render FT_Outline_Reverse FT_OUTLINE_REVERSE_FILL FT_OUTLINE_SINGLE_PASS FT_OUTLINE_SMART_DROPOUTS FT_Outline_Transform FT_Outline_Translate FT_OUTLINE_XXX FT_OutlineGlyph FT_OutlineGlyphRec FT_PaintColrGlyph FT_PaintColrLayers FT_PaintComposite FT_PaintExtend FT_PaintFormat FT_PaintGlyph FT_PaintLinearGradient FT_PaintRadialGradient FT_PaintRotate FT_PaintScale FT_PaintSkew FT_PaintSolid FT_PaintSweepGradient FT_PaintTransform FT_PaintTranslate FT_Palette_Data FT_Palette_Data_Get FT_PALETTE_FOR_DARK_BACKGROUND FT_PALETTE_FOR_LIGHT_BACKGROUND FT_Palette_Select FT_Palette_Set_Foreground_Color FT_PALETTE_XXX FT_PARAM_TAG_IGNORE_SBIX FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY FT_PARAM_TAG_INCREMENTAL FT_PARAM_TAG_LCD_FILTER_WEIGHTS FT_PARAM_TAG_RANDOM_SEED FT_PARAM_TAG_STEM_DARKENING FT_PARAM_TAG_UNPATENTED_HINTING FT_Parameter FT_PCF_DRIVER_H FT_PFR_H FT_Pixel_Mode FT_PIXEL_MODE_BGRA FT_PIXEL_MODE_GRAY FT_PIXEL_MODE_GRAY2 FT_PIXEL_MODE_GRAY4 FT_PIXEL_MODE_LCD FT_PIXEL_MODE_LCD_V FT_PIXEL_MODE_MONO FT_PIXEL_MODE_NONE FT_Pointer FT_Pos FT_Prop_GlyphToScriptMap FT_Prop_IncreaseXHeight FT_Property_Get FT_Property_Set FT_PtrDist FT_Raster FT_Raster_BitSet_Func FT_Raster_BitTest_Func FT_Raster_DoneFunc FT_RASTER_FLAG_AA FT_RASTER_FLAG_CLIP FT_RASTER_FLAG_DEFAULT FT_RASTER_FLAG_DIRECT FT_RASTER_FLAG_SDF FT_RASTER_FLAG_XXX FT_Raster_Funcs FT_Raster_NewFunc FT_Raster_Params FT_Raster_RenderFunc FT_Raster_ResetFunc FT_Raster_SetModeFunc FT_Realloc_Func FT_Reference_Face FT_Reference_Library FT_Remove_Module FT_Render_Glyph FT_RENDER_H FT_Render_Mode FT_RENDER_MODE_LCD FT_RENDER_MODE_LCD_V FT_RENDER_MODE_LIGHT FT_RENDER_MODE_MONO FT_RENDER_MODE_NORMAL FT_RENDER_MODE_SDF FT_Renderer FT_Renderer_Class FT_Request_Size FT_RoundFix FT_Select_Charmap FT_Select_Size FT_Set_Char_Size FT_Set_Charmap FT_Set_Debug_Hook FT_Set_Default_Log_Handler FT_Set_Default_Properties FT_Set_Log_Handler FT_Set_MM_Blend_Coordinates FT_Set_MM_Design_Coordinates FT_Set_MM_WeightVector FT_Set_Named_Instance FT_Set_Pixel_Sizes FT_Set_Renderer FT_Set_Transform FT_Set_Var_Blend_Coordinates FT_Set_Var_Design_Coordinates FT_SFNT_HEAD FT_SFNT_HHEA FT_SFNT_MAXP FT_SFNT_NAMES_H FT_SFNT_OS2 FT_SFNT_PCLT FT_SFNT_POST FT_Sfnt_Table_Info FT_Sfnt_Tag FT_SFNT_VHEA FT_SfntLangTag FT_SfntName FT_Short FT_Sin FT_Size FT_Size_Internal FT_Size_Metrics FT_Size_Request FT_Size_Request_Type FT_SIZE_REQUEST_TYPE_BBOX FT_SIZE_REQUEST_TYPE_CELL FT_SIZE_REQUEST_TYPE_NOMINAL FT_SIZE_REQUEST_TYPE_REAL_DIM FT_SIZE_REQUEST_TYPE_SCALES FT_Size_RequestRec FT_SizeRec FT_SIZES_H FT_Slot_Internal FT_Span FT_SpanFunc FT_Stream FT_Stream_CloseFunc FT_Stream_IoFunc FT_Stream_OpenBzip2 FT_Stream_OpenGzip FT_Stream_OpenLZW FT_StreamDesc FT_StreamRec FT_String FT_Stroker FT_Stroker_BeginSubPath FT_STROKER_BORDER_LEFT FT_STROKER_BORDER_RIGHT FT_Stroker_ConicTo FT_Stroker_CubicTo FT_Stroker_Done FT_Stroker_EndSubPath FT_Stroker_Export FT_Stroker_ExportBorder FT_Stroker_GetBorderCounts FT_Stroker_GetCounts FT_STROKER_H FT_Stroker_LineCap FT_STROKER_LINECAP_BUTT FT_STROKER_LINECAP_ROUND FT_STROKER_LINECAP_SQUARE FT_Stroker_LineJoin FT_STROKER_LINEJOIN_BEVEL FT_STROKER_LINEJOIN_MITER FT_STROKER_LINEJOIN_MITER_FIXED FT_STROKER_LINEJOIN_MITER_VARIABLE FT_STROKER_LINEJOIN_ROUND FT_Stroker_LineTo FT_Stroker_New FT_Stroker_ParseOutline FT_Stroker_Rewind FT_Stroker_Set FT_StrokerBorder FT_STYLE_FLAG_BOLD FT_STYLE_FLAG_ITALIC FT_STYLE_FLAG_XXX FT_SubGlyph FT_SUBGLYPH_FLAG_2X2 FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID FT_SUBGLYPH_FLAG_SCALE FT_SUBGLYPH_FLAG_USE_MY_METRICS FT_SUBGLYPH_FLAG_XXX FT_SUBGLYPH_FLAG_XY_SCALE FT_SVG_Document FT_SVG_DocumentRec FT_SvgGlyph FT_SvgGlyphRec FT_SYNTHESIS_H FT_SYSTEM_H FT_Tag FT_Tan FT_Trace_Set_Default_Level FT_Trace_Set_Level FT_TRIGONOMETRY_H FT_TRUETYPE_DRIVER_H FT_TRUETYPE_ENGINE_TYPE_NONE FT_TRUETYPE_ENGINE_TYPE_PATENTED FT_TRUETYPE_ENGINE_TYPE_UNPATENTED FT_TRUETYPE_IDS_H FT_TRUETYPE_TABLES_H FT_TRUETYPE_TAGS_H FT_TrueTypeEngineType FT_TrueTypeGX_Free FT_TrueTypeGX_Validate FT_TYPE1_TABLES_H FT_TYPES_H FT_UFWord FT_UInt FT_UInt16 FT_UInt32 FT_UInt64 FT_ULong FT_UnitVector FT_UShort FT_VALIDATE_APPLE FT_VALIDATE_BASE FT_VALIDATE_bsln FT_VALIDATE_CKERN FT_VALIDATE_CKERNXXX FT_VALIDATE_feat FT_VALIDATE_GDEF FT_VALIDATE_GPOS FT_VALIDATE_GSUB FT_VALIDATE_GX FT_VALIDATE_GX_LENGTH FT_VALIDATE_GXXXX FT_VALIDATE_JSTF FT_VALIDATE_just FT_VALIDATE_kern FT_VALIDATE_lcar FT_VALIDATE_MATH FT_VALIDATE_mort FT_VALIDATE_morx FT_VALIDATE_MS FT_VALIDATE_opbd FT_VALIDATE_OT FT_VALIDATE_OTXXX FT_VALIDATE_prop FT_VALIDATE_trak FT_Var_Axis FT_VAR_AXIS_FLAG_HIDDEN FT_VAR_AXIS_FLAG_XXX FT_Var_Named_Style FT_Vector FT_Vector_From_Polar FT_Vector_Length FT_Vector_Polarize FT_Vector_Rotate FT_Vector_Transform FT_Vector_Unit FT_WinFNT_Header FT_WinFNT_HeaderRec FT_WinFNT_ID_CP1250 FT_WinFNT_ID_CP1251 FT_WinFNT_ID_CP1252 FT_WinFNT_ID_CP1253 FT_WinFNT_ID_CP1254 FT_WinFNT_ID_CP1255 FT_WinFNT_ID_CP1256 FT_WinFNT_ID_CP1257 FT_WinFNT_ID_CP1258 FT_WinFNT_ID_CP1361 FT_WinFNT_ID_CP874 FT_WinFNT_ID_CP932 FT_WinFNT_ID_CP936 FT_WinFNT_ID_CP949 FT_WinFNT_ID_CP950 FT_WinFNT_ID_DEFAULT FT_WinFNT_ID_MAC FT_WinFNT_ID_OEM FT_WinFNT_ID_SYMBOL FT_WinFNT_ID_XXX FT_WINFONTS_H FTC_CMapCache FTC_CMapCache_Lookup FTC_CMapCache_New FTC_Face_Requester FTC_FaceID FTC_ImageCache FTC_ImageCache_Lookup FTC_ImageCache_LookupScaler FTC_ImageCache_New FTC_ImageType FTC_ImageTypeRec FTC_Manager FTC_Manager_Done FTC_Manager_LookupFace FTC_Manager_LookupSize FTC_Manager_New FTC_Manager_RemoveFaceID FTC_Manager_Reset FTC_Node FTC_Node_Unref FTC_SBit FTC_SBitCache FTC_SBitCache_Lookup FTC_SBitCache_LookupScaler FTC_SBitCache_New FTC_SBitRec FTC_Scaler FTC_ScalerRec G \u00b6 glyph-to-script-map H \u00b6 hinting-engine I \u00b6 increase-x-height interpreter-version N \u00b6 no-long-family-names no-stem-darkening P \u00b6 PS_DICT_BLUE_FUZZ PS_DICT_BLUE_SCALE PS_DICT_BLUE_SHIFT PS_DICT_BLUE_VALUE PS_DICT_CHAR_STRING PS_DICT_CHAR_STRING_KEY PS_DICT_ENCODING_ENTRY PS_DICT_ENCODING_TYPE PS_DICT_FAMILY_BLUE PS_DICT_FAMILY_NAME PS_DICT_FAMILY_OTHER_BLUE PS_DICT_FONT_BBOX PS_DICT_FONT_MATRIX PS_DICT_FONT_NAME PS_DICT_FONT_TYPE PS_DICT_FORCE_BOLD PS_DICT_FS_TYPE PS_DICT_FULL_NAME PS_DICT_IS_FIXED_PITCH PS_DICT_ITALIC_ANGLE PS_Dict_Keys PS_DICT_LANGUAGE_GROUP PS_DICT_LEN_IV PS_DICT_MIN_FEATURE PS_DICT_NOTICE PS_DICT_NUM_BLUE_VALUES PS_DICT_NUM_CHAR_STRINGS PS_DICT_NUM_FAMILY_BLUES PS_DICT_NUM_FAMILY_OTHER_BLUES PS_DICT_NUM_OTHER_BLUES PS_DICT_NUM_STEM_SNAP_H PS_DICT_NUM_STEM_SNAP_V PS_DICT_NUM_SUBRS PS_DICT_OTHER_BLUE PS_DICT_PAINT_TYPE PS_DICT_PASSWORD PS_DICT_RND_STEM_UP PS_DICT_STD_HW PS_DICT_STD_VW PS_DICT_STEM_SNAP_H PS_DICT_STEM_SNAP_V PS_DICT_SUBR PS_DICT_UNDERLINE_POSITION PS_DICT_UNDERLINE_THICKNESS PS_DICT_UNIQUE_ID PS_DICT_VERSION PS_DICT_WEIGHT PS_FontInfo PS_FontInfoRec PS_Private PS_PrivateRec R \u00b6 random-seed S \u00b6 svg-hooks SVG_Lib_Free_Func SVG_Lib_Init_Func SVG_Lib_Preset_Slot_Func SVG_Lib_Render_Func SVG_RendererHooks T \u00b6 T1_BLEND_BLUE_SCALE T1_BLEND_BLUE_SHIFT T1_BLEND_BLUE_VALUES T1_BLEND_FAMILY_BLUES T1_BLEND_FAMILY_OTHER_BLUES T1_Blend_Flags T1_BLEND_FORCE_BOLD T1_BLEND_ITALIC_ANGLE T1_BLEND_OTHER_BLUES T1_BLEND_STANDARD_HEIGHT T1_BLEND_STANDARD_WIDTH T1_BLEND_STEM_SNAP_HEIGHTS T1_BLEND_STEM_SNAP_WIDTHS T1_BLEND_UNDERLINE_POSITION T1_BLEND_UNDERLINE_THICKNESS T1_ENCODING_TYPE_ARRAY T1_ENCODING_TYPE_EXPERT T1_ENCODING_TYPE_ISOLATIN1 T1_ENCODING_TYPE_NONE T1_ENCODING_TYPE_STANDARD T1_EncodingType T1_FontInfo T1_Private TT_ADOBE_ID_CUSTOM TT_ADOBE_ID_EXPERT TT_ADOBE_ID_LATIN_1 TT_ADOBE_ID_STANDARD TT_ADOBE_ID_XXX TT_APPLE_ID_DEFAULT TT_APPLE_ID_FULL_UNICODE TT_APPLE_ID_ISO_10646 TT_APPLE_ID_UNICODE_1_1 TT_APPLE_ID_UNICODE_2_0 TT_APPLE_ID_UNICODE_32 TT_APPLE_ID_VARIANT_SELECTOR TT_APPLE_ID_XXX TT_Header TT_HoriHeader TT_INTERPRETER_VERSION_35 TT_INTERPRETER_VERSION_38 TT_INTERPRETER_VERSION_40 TT_INTERPRETER_VERSION_XXX TT_ISO_ID_10646 TT_ISO_ID_7BIT_ASCII TT_ISO_ID_8859_1 TT_ISO_ID_XXX TT_MAC_ID_XXX TT_MAC_LANGID_XXX TT_MaxProfile TT_MS_ID_BIG_5 TT_MS_ID_JOHAB TT_MS_ID_PRC TT_MS_ID_SJIS TT_MS_ID_SYMBOL_CS TT_MS_ID_UCS_4 TT_MS_ID_UNICODE_CS TT_MS_ID_WANSUNG TT_MS_ID_XXX TT_MS_LANGID_XXX TT_NAME_ID_XXX TT_OS2 TT_PCLT TT_PLATFORM_ADOBE TT_PLATFORM_APPLE_UNICODE TT_PLATFORM_CUSTOM TT_PLATFORM_ISO TT_PLATFORM_MACINTOSH TT_PLATFORM_MICROSOFT TT_PLATFORM_XXX TT_Postscript TT_UCR_XXX TT_VertHeader W \u00b6 warping generated on Sun May 1 05:24:59 2022 UTC","title":"Index"},{"location":"ft2-index.html#freetype-2121-api-reference","text":"","title":"FreeType-2.12.1 API Reference"},{"location":"ft2-index.html#b","text":"BDF_Property BDF_PROPERTY_TYPE_ATOM BDF_PROPERTY_TYPE_CARDINAL BDF_PROPERTY_TYPE_INTEGER BDF_PROPERTY_TYPE_NONE BDF_PropertyRec BDF_PropertyType","title":"B"},{"location":"ft2-index.html#c","text":"CID_FaceDict CID_FaceDictRec CID_FaceInfo CID_FaceInfoRec CID_FontDict CID_Info","title":"C"},{"location":"ft2-index.html#d","text":"darkening-parameters default-script","title":"D"},{"location":"ft2-index.html#f","text":"fallback-script FREETYPE_MAJOR FREETYPE_MINOR FREETYPE_PATCH FREETYPE_XXX FT_Activate_Size FT_Add_Default_Modules FT_Add_Module FT_ADVANCE_FLAG_FAST_ONLY FT_ADVANCES_H FT_Affine23 FT_Alloc_Func FT_Angle FT_ANGLE_2PI FT_Angle_Diff FT_ANGLE_PI FT_ANGLE_PI2 FT_ANGLE_PI4 FT_Atan2 FT_Attach_File FT_Attach_Stream FT_AUTOHINTER_H FT_AUTOHINTER_SCRIPT_CJK FT_AUTOHINTER_SCRIPT_INDIC FT_AUTOHINTER_SCRIPT_LATIN FT_AUTOHINTER_SCRIPT_NONE FT_AUTOHINTER_SCRIPT_XXX FT_BBox FT_BBOX_H FT_BDF_H FT_Bitmap FT_Bitmap_Blend FT_Bitmap_Convert FT_Bitmap_Copy FT_Bitmap_Done FT_Bitmap_Embolden FT_BITMAP_H FT_Bitmap_Init FT_Bitmap_Size FT_BitmapGlyph FT_BitmapGlyphRec FT_Bool FT_Byte FT_Bytes FT_BZIP2_H FT_CACHE_H FT_CeilFix FT_CFF_DRIVER_H FT_Char FT_CharMap FT_CharMapRec FT_CID_H FT_ClassicKern_Free FT_ClassicKern_Validate FT_ClipBox FT_Color FT_COLOR_H FT_COLOR_INCLUDE_ROOT_TRANSFORM FT_COLOR_NO_ROOT_TRANSFORM FT_Color_Root_Transform FT_ColorIndex FT_ColorLine FT_ColorStop FT_ColorStopIterator FT_COLR_Paint FT_Composite_Mode FT_CONFIG_CONFIG_H FT_CONFIG_MODULES_H FT_CONFIG_OPTIONS_H FT_CONFIG_STANDARD_LIBRARY_H FT_Cos FT_Custom_Log_Handler FT_Data FT_DEBUG_HOOK_TRUETYPE FT_DEBUG_HOOK_XXX FT_DebugHook_Func FT_DivFix FT_Done_Face FT_Done_FreeType FT_Done_Glyph FT_Done_Library FT_Done_MM_Var FT_Done_Size FT_Driver FT_DRIVER_H FT_ENC_TAG FT_Encoding FT_ENCODING_ADOBE_CUSTOM FT_ENCODING_ADOBE_EXPERT FT_ENCODING_ADOBE_LATIN_1 FT_ENCODING_ADOBE_STANDARD FT_ENCODING_APPLE_ROMAN FT_ENCODING_BIG5 FT_ENCODING_JOHAB FT_ENCODING_MS_BIG5 FT_ENCODING_MS_GB2312 FT_ENCODING_MS_JOHAB FT_ENCODING_MS_SJIS FT_ENCODING_MS_SYMBOL FT_ENCODING_MS_WANSUNG FT_ENCODING_NONE FT_ENCODING_OLD_LATIN_2 FT_ENCODING_PRC FT_ENCODING_SJIS FT_ENCODING_UNICODE FT_ENCODING_WANSUNG FT_Err_XXX FT_Error FT_Error_String FT_ERRORS_H FT_F26Dot6 FT_F2Dot14 FT_Face FT_Face_CheckTrueTypePatents FT_FACE_DRIVER_NAME FT_FACE_FLAG_CID_KEYED FT_FACE_FLAG_COLOR FT_FACE_FLAG_EXTERNAL_STREAM FT_FACE_FLAG_FAST_GLYPHS FT_FACE_FLAG_FIXED_SIZES FT_FACE_FLAG_FIXED_WIDTH FT_FACE_FLAG_GLYPH_NAMES FT_FACE_FLAG_HINTER FT_FACE_FLAG_HORIZONTAL FT_FACE_FLAG_KERNING FT_FACE_FLAG_MULTIPLE_MASTERS FT_FACE_FLAG_SBIX FT_FACE_FLAG_SBIX_OVERLAY FT_FACE_FLAG_SCALABLE FT_FACE_FLAG_SFNT FT_FACE_FLAG_SVG FT_FACE_FLAG_TRICKY FT_FACE_FLAG_VARIATION FT_FACE_FLAG_VERTICAL FT_FACE_FLAG_XXX FT_Face_GetCharsOfVariant FT_Face_GetCharVariantIndex FT_Face_GetCharVariantIsDefault FT_Face_GetVariantSelectors FT_Face_GetVariantsOfChar FT_Face_Internal FT_Face_Properties FT_Face_SetUnpatentedHinting FT_FaceRec FT_Fixed FT_FloorFix FT_FONT_FORMATS_H FT_Free_Func FT_FREETYPE_H FT_FSTYPE_BITMAP_EMBEDDING_ONLY FT_FSTYPE_EDITABLE_EMBEDDING FT_FSTYPE_INSTALLABLE_EMBEDDING FT_FSTYPE_NO_SUBSETTING FT_FSTYPE_PREVIEW_AND_PRINT_EMBEDDING FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING FT_FSTYPE_XXX FT_FWord FT_GASP_DO_GRAY FT_GASP_DO_GRIDFIT FT_GASP_H FT_GASP_NO_TABLE FT_GASP_SYMMETRIC_GRIDFIT FT_GASP_SYMMETRIC_SMOOTHING FT_GASP_XXX FT_Generic FT_Generic_Finalizer FT_Get_Advance FT_Get_Advances FT_Get_BDF_Charset_ID FT_Get_BDF_Property FT_Get_Char_Index FT_Get_Charmap_Index FT_Get_CID_From_Glyph_Index FT_Get_CID_Is_Internally_CID_Keyed FT_Get_CID_Registry_Ordering_Supplement FT_Get_CMap_Format FT_Get_CMap_Language_ID FT_Get_Color_Glyph_ClipBox FT_Get_Color_Glyph_Layer FT_Get_Color_Glyph_Paint FT_Get_Colorline_Stops FT_Get_First_Char FT_Get_Font_Format FT_Get_FSType_Flags FT_Get_Gasp FT_Get_Glyph FT_Get_Glyph_Name FT_Get_Kerning FT_Get_MM_Blend_Coordinates FT_Get_MM_Var FT_Get_MM_WeightVector FT_Get_Module FT_Get_Multi_Master FT_Get_Name_Index FT_Get_Next_Char FT_Get_Paint FT_Get_Paint_Layers FT_Get_PFR_Advance FT_Get_PFR_Kerning FT_Get_PFR_Metrics FT_Get_Postscript_Name FT_Get_PS_Font_Info FT_Get_PS_Font_Private FT_Get_PS_Font_Value FT_Get_Renderer FT_Get_Sfnt_LangTag FT_Get_Sfnt_Name FT_Get_Sfnt_Name_Count FT_Get_Sfnt_Table FT_Get_SubGlyph_Info FT_Get_Track_Kerning FT_Get_Transform FT_Get_TrueType_Engine_Type FT_Get_Var_Axis_Flags FT_Get_Var_Blend_Coordinates FT_Get_Var_Design_Coordinates FT_Get_WinFNT_Header FT_GetFile_From_Mac_ATS_Name FT_GetFile_From_Mac_Name FT_GetFilePath_From_Mac_ATS_Name FT_Glyph FT_GLYPH_BBOX_GRIDFIT FT_Glyph_BBox_Mode FT_GLYPH_BBOX_PIXELS FT_GLYPH_BBOX_SUBPIXELS FT_GLYPH_BBOX_TRUNCATE FT_GLYPH_BBOX_UNSCALED FT_Glyph_Copy FT_Glyph_Format FT_GLYPH_FORMAT_BITMAP FT_GLYPH_FORMAT_COMPOSITE FT_GLYPH_FORMAT_NONE FT_GLYPH_FORMAT_OUTLINE FT_GLYPH_FORMAT_PLOTTER FT_GLYPH_FORMAT_SVG FT_Glyph_Get_CBox FT_GLYPH_H FT_Glyph_Metrics FT_Glyph_Stroke FT_Glyph_StrokeBorder FT_Glyph_To_Bitmap FT_Glyph_Transform FT_GlyphRec FT_GlyphSlot FT_GlyphSlot_Own_Bitmap FT_GlyphSlotRec FT_GX_VALIDATE_H FT_GZIP_H FT_Gzip_Uncompress FT_HAS_COLOR FT_HAS_FAST_GLYPHS FT_HAS_FIXED_SIZES FT_HAS_GLYPH_NAMES FT_HAS_HORIZONTAL FT_HAS_KERNING FT_HAS_MULTIPLE_MASTERS FT_Has_PS_Glyph_Names FT_HAS_SBIX FT_HAS_SBIX_OVERLAY FT_HAS_SVG FT_HAS_VERTICAL FT_HINTING_ADOBE FT_HINTING_FREETYPE FT_HINTING_XXX FT_IMAGE_H FT_IMAGE_TAG FT_Incremental FT_Incremental_FreeGlyphDataFunc FT_Incremental_FuncsRec FT_Incremental_GetGlyphDataFunc FT_Incremental_GetGlyphMetricsFunc FT_INCREMENTAL_H FT_Incremental_Interface FT_Incremental_InterfaceRec FT_Incremental_Metrics FT_Incremental_MetricsRec FT_Init_FreeType FT_Int FT_Int16 FT_Int32 FT_Int64 FT_IS_CID_KEYED FT_IS_FIXED_WIDTH FT_IS_NAMED_INSTANCE FT_IS_SCALABLE FT_IS_SFNT FT_IS_TRICKY FT_IS_VARIATION FT_KERNING_DEFAULT FT_Kerning_Mode FT_KERNING_UNFITTED FT_KERNING_UNSCALED FT_LayerIterator FT_LCD_FILTER_DEFAULT FT_LCD_FILTER_H FT_LCD_FILTER_LEGACY FT_LCD_FILTER_LEGACY1 FT_LCD_FILTER_LIGHT FT_LCD_FILTER_NONE FT_LcdFilter FT_LcdFiveTapFilter FT_Library FT_Library_SetLcdFilter FT_Library_SetLcdFilterWeights FT_Library_SetLcdGeometry FT_Library_Version FT_List FT_List_Add FT_List_Destructor FT_List_Finalize FT_List_Find FT_LIST_H FT_List_Insert FT_List_Iterate FT_List_Iterator FT_List_Remove FT_List_Up FT_ListNode FT_ListNodeRec FT_ListRec FT_LOAD_BITMAP_METRICS_ONLY FT_Load_Char FT_LOAD_COLOR FT_LOAD_COMPUTE_METRICS FT_LOAD_CROP_BITMAP FT_LOAD_DEFAULT FT_LOAD_FORCE_AUTOHINT FT_Load_Glyph FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH FT_LOAD_IGNORE_TRANSFORM FT_LOAD_LINEAR_DESIGN FT_LOAD_MONOCHROME FT_LOAD_NO_AUTOHINT FT_LOAD_NO_BITMAP FT_LOAD_NO_HINTING FT_LOAD_NO_RECURSE FT_LOAD_NO_SCALE FT_LOAD_PEDANTIC FT_LOAD_RENDER FT_LOAD_SBITS_ONLY FT_Load_Sfnt_Table FT_LOAD_TARGET_LCD FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_MODE FT_LOAD_TARGET_MONO FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_XXX FT_LOAD_VERTICAL_LAYOUT FT_LOAD_XXX FT_Long FT_LZW_H FT_MAC_H FT_MAKE_TAG FT_Matrix FT_Matrix_Invert FT_Matrix_Multiply FT_Memory FT_MemoryRec FT_MM_Axis FT_MM_Var FT_Module FT_Module_Class FT_Module_Constructor FT_Module_Destructor FT_MODULE_ERRORS_H FT_MODULE_H FT_Module_Requester FT_MulDiv FT_MulFix FT_Multi_Master FT_MULTIPLE_MASTERS_H FT_New_Face FT_New_Face_From_FOND FT_New_Face_From_FSRef FT_New_Face_From_FSSpec FT_New_Glyph FT_New_Library FT_New_Memory_Face FT_New_Size FT_Offset FT_OpaquePaint FT_Open_Args FT_OPEN_DRIVER FT_Open_Face FT_OPEN_MEMORY FT_OPEN_PARAMS FT_OPEN_PATHNAME FT_OPEN_STREAM FT_OPEN_XXX FT_OpenType_Free FT_OpenType_Validate FT_OPENTYPE_VALIDATE_H FT_Orientation FT_ORIENTATION_FILL_LEFT FT_ORIENTATION_FILL_RIGHT FT_ORIENTATION_NONE FT_ORIENTATION_POSTSCRIPT FT_ORIENTATION_TRUETYPE FT_OTSVG_H FT_Outline FT_Outline_Check FT_Outline_ConicToFunc FT_Outline_Copy FT_Outline_CubicToFunc FT_Outline_Decompose FT_Outline_Done FT_Outline_Embolden FT_Outline_EmboldenXY FT_OUTLINE_EVEN_ODD_FILL FT_Outline_Funcs FT_Outline_Get_BBox FT_Outline_Get_Bitmap FT_Outline_Get_CBox FT_Outline_Get_Orientation FT_Outline_GetInsideBorder FT_Outline_GetOutsideBorder FT_OUTLINE_H FT_OUTLINE_HIGH_PRECISION FT_OUTLINE_IGNORE_DROPOUTS FT_OUTLINE_INCLUDE_STUBS FT_Outline_LineToFunc FT_Outline_MoveToFunc FT_Outline_New FT_OUTLINE_NONE FT_OUTLINE_OVERLAP FT_OUTLINE_OWNER FT_Outline_Render FT_Outline_Reverse FT_OUTLINE_REVERSE_FILL FT_OUTLINE_SINGLE_PASS FT_OUTLINE_SMART_DROPOUTS FT_Outline_Transform FT_Outline_Translate FT_OUTLINE_XXX FT_OutlineGlyph FT_OutlineGlyphRec FT_PaintColrGlyph FT_PaintColrLayers FT_PaintComposite FT_PaintExtend FT_PaintFormat FT_PaintGlyph FT_PaintLinearGradient FT_PaintRadialGradient FT_PaintRotate FT_PaintScale FT_PaintSkew FT_PaintSolid FT_PaintSweepGradient FT_PaintTransform FT_PaintTranslate FT_Palette_Data FT_Palette_Data_Get FT_PALETTE_FOR_DARK_BACKGROUND FT_PALETTE_FOR_LIGHT_BACKGROUND FT_Palette_Select FT_Palette_Set_Foreground_Color FT_PALETTE_XXX FT_PARAM_TAG_IGNORE_SBIX FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY FT_PARAM_TAG_INCREMENTAL FT_PARAM_TAG_LCD_FILTER_WEIGHTS FT_PARAM_TAG_RANDOM_SEED FT_PARAM_TAG_STEM_DARKENING FT_PARAM_TAG_UNPATENTED_HINTING FT_Parameter FT_PCF_DRIVER_H FT_PFR_H FT_Pixel_Mode FT_PIXEL_MODE_BGRA FT_PIXEL_MODE_GRAY FT_PIXEL_MODE_GRAY2 FT_PIXEL_MODE_GRAY4 FT_PIXEL_MODE_LCD FT_PIXEL_MODE_LCD_V FT_PIXEL_MODE_MONO FT_PIXEL_MODE_NONE FT_Pointer FT_Pos FT_Prop_GlyphToScriptMap FT_Prop_IncreaseXHeight FT_Property_Get FT_Property_Set FT_PtrDist FT_Raster FT_Raster_BitSet_Func FT_Raster_BitTest_Func FT_Raster_DoneFunc FT_RASTER_FLAG_AA FT_RASTER_FLAG_CLIP FT_RASTER_FLAG_DEFAULT FT_RASTER_FLAG_DIRECT FT_RASTER_FLAG_SDF FT_RASTER_FLAG_XXX FT_Raster_Funcs FT_Raster_NewFunc FT_Raster_Params FT_Raster_RenderFunc FT_Raster_ResetFunc FT_Raster_SetModeFunc FT_Realloc_Func FT_Reference_Face FT_Reference_Library FT_Remove_Module FT_Render_Glyph FT_RENDER_H FT_Render_Mode FT_RENDER_MODE_LCD FT_RENDER_MODE_LCD_V FT_RENDER_MODE_LIGHT FT_RENDER_MODE_MONO FT_RENDER_MODE_NORMAL FT_RENDER_MODE_SDF FT_Renderer FT_Renderer_Class FT_Request_Size FT_RoundFix FT_Select_Charmap FT_Select_Size FT_Set_Char_Size FT_Set_Charmap FT_Set_Debug_Hook FT_Set_Default_Log_Handler FT_Set_Default_Properties FT_Set_Log_Handler FT_Set_MM_Blend_Coordinates FT_Set_MM_Design_Coordinates FT_Set_MM_WeightVector FT_Set_Named_Instance FT_Set_Pixel_Sizes FT_Set_Renderer FT_Set_Transform FT_Set_Var_Blend_Coordinates FT_Set_Var_Design_Coordinates FT_SFNT_HEAD FT_SFNT_HHEA FT_SFNT_MAXP FT_SFNT_NAMES_H FT_SFNT_OS2 FT_SFNT_PCLT FT_SFNT_POST FT_Sfnt_Table_Info FT_Sfnt_Tag FT_SFNT_VHEA FT_SfntLangTag FT_SfntName FT_Short FT_Sin FT_Size FT_Size_Internal FT_Size_Metrics FT_Size_Request FT_Size_Request_Type FT_SIZE_REQUEST_TYPE_BBOX FT_SIZE_REQUEST_TYPE_CELL FT_SIZE_REQUEST_TYPE_NOMINAL FT_SIZE_REQUEST_TYPE_REAL_DIM FT_SIZE_REQUEST_TYPE_SCALES FT_Size_RequestRec FT_SizeRec FT_SIZES_H FT_Slot_Internal FT_Span FT_SpanFunc FT_Stream FT_Stream_CloseFunc FT_Stream_IoFunc FT_Stream_OpenBzip2 FT_Stream_OpenGzip FT_Stream_OpenLZW FT_StreamDesc FT_StreamRec FT_String FT_Stroker FT_Stroker_BeginSubPath FT_STROKER_BORDER_LEFT FT_STROKER_BORDER_RIGHT FT_Stroker_ConicTo FT_Stroker_CubicTo FT_Stroker_Done FT_Stroker_EndSubPath FT_Stroker_Export FT_Stroker_ExportBorder FT_Stroker_GetBorderCounts FT_Stroker_GetCounts FT_STROKER_H FT_Stroker_LineCap FT_STROKER_LINECAP_BUTT FT_STROKER_LINECAP_ROUND FT_STROKER_LINECAP_SQUARE FT_Stroker_LineJoin FT_STROKER_LINEJOIN_BEVEL FT_STROKER_LINEJOIN_MITER FT_STROKER_LINEJOIN_MITER_FIXED FT_STROKER_LINEJOIN_MITER_VARIABLE FT_STROKER_LINEJOIN_ROUND FT_Stroker_LineTo FT_Stroker_New FT_Stroker_ParseOutline FT_Stroker_Rewind FT_Stroker_Set FT_StrokerBorder FT_STYLE_FLAG_BOLD FT_STYLE_FLAG_ITALIC FT_STYLE_FLAG_XXX FT_SubGlyph FT_SUBGLYPH_FLAG_2X2 FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID FT_SUBGLYPH_FLAG_SCALE FT_SUBGLYPH_FLAG_USE_MY_METRICS FT_SUBGLYPH_FLAG_XXX FT_SUBGLYPH_FLAG_XY_SCALE FT_SVG_Document FT_SVG_DocumentRec FT_SvgGlyph FT_SvgGlyphRec FT_SYNTHESIS_H FT_SYSTEM_H FT_Tag FT_Tan FT_Trace_Set_Default_Level FT_Trace_Set_Level FT_TRIGONOMETRY_H FT_TRUETYPE_DRIVER_H FT_TRUETYPE_ENGINE_TYPE_NONE FT_TRUETYPE_ENGINE_TYPE_PATENTED FT_TRUETYPE_ENGINE_TYPE_UNPATENTED FT_TRUETYPE_IDS_H FT_TRUETYPE_TABLES_H FT_TRUETYPE_TAGS_H FT_TrueTypeEngineType FT_TrueTypeGX_Free FT_TrueTypeGX_Validate FT_TYPE1_TABLES_H FT_TYPES_H FT_UFWord FT_UInt FT_UInt16 FT_UInt32 FT_UInt64 FT_ULong FT_UnitVector FT_UShort FT_VALIDATE_APPLE FT_VALIDATE_BASE FT_VALIDATE_bsln FT_VALIDATE_CKERN FT_VALIDATE_CKERNXXX FT_VALIDATE_feat FT_VALIDATE_GDEF FT_VALIDATE_GPOS FT_VALIDATE_GSUB FT_VALIDATE_GX FT_VALIDATE_GX_LENGTH FT_VALIDATE_GXXXX FT_VALIDATE_JSTF FT_VALIDATE_just FT_VALIDATE_kern FT_VALIDATE_lcar FT_VALIDATE_MATH FT_VALIDATE_mort FT_VALIDATE_morx FT_VALIDATE_MS FT_VALIDATE_opbd FT_VALIDATE_OT FT_VALIDATE_OTXXX FT_VALIDATE_prop FT_VALIDATE_trak FT_Var_Axis FT_VAR_AXIS_FLAG_HIDDEN FT_VAR_AXIS_FLAG_XXX FT_Var_Named_Style FT_Vector FT_Vector_From_Polar FT_Vector_Length FT_Vector_Polarize FT_Vector_Rotate FT_Vector_Transform FT_Vector_Unit FT_WinFNT_Header FT_WinFNT_HeaderRec FT_WinFNT_ID_CP1250 FT_WinFNT_ID_CP1251 FT_WinFNT_ID_CP1252 FT_WinFNT_ID_CP1253 FT_WinFNT_ID_CP1254 FT_WinFNT_ID_CP1255 FT_WinFNT_ID_CP1256 FT_WinFNT_ID_CP1257 FT_WinFNT_ID_CP1258 FT_WinFNT_ID_CP1361 FT_WinFNT_ID_CP874 FT_WinFNT_ID_CP932 FT_WinFNT_ID_CP936 FT_WinFNT_ID_CP949 FT_WinFNT_ID_CP950 FT_WinFNT_ID_DEFAULT FT_WinFNT_ID_MAC FT_WinFNT_ID_OEM FT_WinFNT_ID_SYMBOL FT_WinFNT_ID_XXX FT_WINFONTS_H FTC_CMapCache FTC_CMapCache_Lookup FTC_CMapCache_New FTC_Face_Requester FTC_FaceID FTC_ImageCache FTC_ImageCache_Lookup FTC_ImageCache_LookupScaler FTC_ImageCache_New FTC_ImageType FTC_ImageTypeRec FTC_Manager FTC_Manager_Done FTC_Manager_LookupFace FTC_Manager_LookupSize FTC_Manager_New FTC_Manager_RemoveFaceID FTC_Manager_Reset FTC_Node FTC_Node_Unref FTC_SBit FTC_SBitCache FTC_SBitCache_Lookup FTC_SBitCache_LookupScaler FTC_SBitCache_New FTC_SBitRec FTC_Scaler FTC_ScalerRec","title":"F"},{"location":"ft2-index.html#g","text":"glyph-to-script-map","title":"G"},{"location":"ft2-index.html#h","text":"hinting-engine","title":"H"},{"location":"ft2-index.html#i","text":"increase-x-height interpreter-version","title":"I"},{"location":"ft2-index.html#n","text":"no-long-family-names no-stem-darkening","title":"N"},{"location":"ft2-index.html#p","text":"PS_DICT_BLUE_FUZZ PS_DICT_BLUE_SCALE PS_DICT_BLUE_SHIFT PS_DICT_BLUE_VALUE PS_DICT_CHAR_STRING PS_DICT_CHAR_STRING_KEY PS_DICT_ENCODING_ENTRY PS_DICT_ENCODING_TYPE PS_DICT_FAMILY_BLUE PS_DICT_FAMILY_NAME PS_DICT_FAMILY_OTHER_BLUE PS_DICT_FONT_BBOX PS_DICT_FONT_MATRIX PS_DICT_FONT_NAME PS_DICT_FONT_TYPE PS_DICT_FORCE_BOLD PS_DICT_FS_TYPE PS_DICT_FULL_NAME PS_DICT_IS_FIXED_PITCH PS_DICT_ITALIC_ANGLE PS_Dict_Keys PS_DICT_LANGUAGE_GROUP PS_DICT_LEN_IV PS_DICT_MIN_FEATURE PS_DICT_NOTICE PS_DICT_NUM_BLUE_VALUES PS_DICT_NUM_CHAR_STRINGS PS_DICT_NUM_FAMILY_BLUES PS_DICT_NUM_FAMILY_OTHER_BLUES PS_DICT_NUM_OTHER_BLUES PS_DICT_NUM_STEM_SNAP_H PS_DICT_NUM_STEM_SNAP_V PS_DICT_NUM_SUBRS PS_DICT_OTHER_BLUE PS_DICT_PAINT_TYPE PS_DICT_PASSWORD PS_DICT_RND_STEM_UP PS_DICT_STD_HW PS_DICT_STD_VW PS_DICT_STEM_SNAP_H PS_DICT_STEM_SNAP_V PS_DICT_SUBR PS_DICT_UNDERLINE_POSITION PS_DICT_UNDERLINE_THICKNESS PS_DICT_UNIQUE_ID PS_DICT_VERSION PS_DICT_WEIGHT PS_FontInfo PS_FontInfoRec PS_Private PS_PrivateRec","title":"P"},{"location":"ft2-index.html#r","text":"random-seed","title":"R"},{"location":"ft2-index.html#s","text":"svg-hooks SVG_Lib_Free_Func SVG_Lib_Init_Func SVG_Lib_Preset_Slot_Func SVG_Lib_Render_Func SVG_RendererHooks","title":"S"},{"location":"ft2-index.html#t","text":"T1_BLEND_BLUE_SCALE T1_BLEND_BLUE_SHIFT T1_BLEND_BLUE_VALUES T1_BLEND_FAMILY_BLUES T1_BLEND_FAMILY_OTHER_BLUES T1_Blend_Flags T1_BLEND_FORCE_BOLD T1_BLEND_ITALIC_ANGLE T1_BLEND_OTHER_BLUES T1_BLEND_STANDARD_HEIGHT T1_BLEND_STANDARD_WIDTH T1_BLEND_STEM_SNAP_HEIGHTS T1_BLEND_STEM_SNAP_WIDTHS T1_BLEND_UNDERLINE_POSITION T1_BLEND_UNDERLINE_THICKNESS T1_ENCODING_TYPE_ARRAY T1_ENCODING_TYPE_EXPERT T1_ENCODING_TYPE_ISOLATIN1 T1_ENCODING_TYPE_NONE T1_ENCODING_TYPE_STANDARD T1_EncodingType T1_FontInfo T1_Private TT_ADOBE_ID_CUSTOM TT_ADOBE_ID_EXPERT TT_ADOBE_ID_LATIN_1 TT_ADOBE_ID_STANDARD TT_ADOBE_ID_XXX TT_APPLE_ID_DEFAULT TT_APPLE_ID_FULL_UNICODE TT_APPLE_ID_ISO_10646 TT_APPLE_ID_UNICODE_1_1 TT_APPLE_ID_UNICODE_2_0 TT_APPLE_ID_UNICODE_32 TT_APPLE_ID_VARIANT_SELECTOR TT_APPLE_ID_XXX TT_Header TT_HoriHeader TT_INTERPRETER_VERSION_35 TT_INTERPRETER_VERSION_38 TT_INTERPRETER_VERSION_40 TT_INTERPRETER_VERSION_XXX TT_ISO_ID_10646 TT_ISO_ID_7BIT_ASCII TT_ISO_ID_8859_1 TT_ISO_ID_XXX TT_MAC_ID_XXX TT_MAC_LANGID_XXX TT_MaxProfile TT_MS_ID_BIG_5 TT_MS_ID_JOHAB TT_MS_ID_PRC TT_MS_ID_SJIS TT_MS_ID_SYMBOL_CS TT_MS_ID_UCS_4 TT_MS_ID_UNICODE_CS TT_MS_ID_WANSUNG TT_MS_ID_XXX TT_MS_LANGID_XXX TT_NAME_ID_XXX TT_OS2 TT_PCLT TT_PLATFORM_ADOBE TT_PLATFORM_APPLE_UNICODE TT_PLATFORM_CUSTOM TT_PLATFORM_ISO TT_PLATFORM_MACINTOSH TT_PLATFORM_MICROSOFT TT_PLATFORM_XXX TT_Postscript TT_UCR_XXX TT_VertHeader","title":"T"},{"location":"ft2-index.html#w","text":"warping generated on Sun May 1 05:24:59 2022 UTC","title":"W"},{"location":"ft2-layer_management.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Glyph Layer Management Glyph Layer Management \u00b6 Synopsis \u00b6 The functions described here allow access of colored glyph layer data in OpenType's \u2018COLR\u2019 tables. FT_LayerIterator \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_LayerIterator_ { FT_UInt num_layers; FT_UInt layer; FT_Byte * p; } FT_LayerIterator ; This iterator object is needed for FT_Get_Color_Glyph_Layer . fields num_layers The number of glyph layers for the requested glyph index. Will be set by FT_Get_Color_Glyph_Layer . layer The current layer. Will be set by FT_Get_Color_Glyph_Layer . p An opaque pointer into \u2018COLR\u2019 table data. The caller must set this to NULL before the first call of FT_Get_Color_Glyph_Layer . FT_Get_Color_Glyph_Layer \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_Layer ( FT_Face face, FT_UInt base_glyph, FT_UInt *aglyph_index, FT_UInt *acolor_index, FT_LayerIterator * iterator ); This is an interface to the \u2018COLR\u2019 table in OpenType fonts to iteratively retrieve the colored glyph layers associated with the current glyph slot. https://docs.microsoft.com/en-us/typography/opentype/spec/colr The glyph layer data for a given glyph index, if present, provides an alternative, multi-color glyph representation: Instead of rendering the outline or bitmap with the given glyph index, glyphs with the indices and colors returned by this function are rendered layer by layer. The returned elements are ordered in the z direction from bottom to top; the 'n'th element should be rendered with the associated palette color and blended on top of the already rendered layers (elements 0, 1, \u2026, n-1). input face A handle to the parent face object. base_glyph The glyph index the colored glyph layers are associated with. inout iterator An FT_LayerIterator object. For the first call you should set iterator->p to NULL . For all following calls, simply use the same object again. output aglyph_index The glyph index of the current layer. acolor_index The color index into the font face's color palette of the current layer. The value 0xFFFF is special; it doesn't reference a palette entry but indicates that the text foreground color should be used instead (to be set up by the application outside of FreeType). The color palette can be retrieved with FT_Palette_Select . return Value 1 if everything is OK. If there are no more layers (or if there are no layers at all), value 0 gets returned. In case of an error, value 0 is returned also. note This function is necessary if you want to handle glyph layers by yourself. In particular, functions that operate with FT_GlyphRec objects (like FT_Get_Glyph or FT_Glyph_To_Bitmap ) don't have access to this information. Note that FT_Render_Glyph is able to handle colored glyph layers automatically if the FT_LOAD_COLOR flag is passed to a previous call to FT_Load_Glyph . [This is an experimental feature.] example FT_Color* palette; FT_LayerIterator iterator; FT_Bool have_layers; FT_UInt layer_glyph_index; FT_UInt layer_color_index; error = FT_Palette_Select( face, palette_index, &palette ); if ( error ) palette = NULL; iterator.p = NULL; have_layers = FT_Get_Color_Glyph_Layer( face, glyph_index, &layer_glyph_index, &layer_color_index, &iterator ); if ( palette && have_layers ) { do { FT_Color layer_color; if ( layer_color_index == 0xFFFF ) layer_color = text_foreground_color; else layer_color = palette[layer_color_index]; // Load and render glyph `layer_glyph_index', then // blend resulting pixmap (using color `layer_color') // with previously created pixmaps. } while ( FT_Get_Color_Glyph_Layer( face, glyph_index, &layer_glyph_index, &layer_color_index, &iterator ) ); } FT_PaintFormat \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_PaintFormat_ { FT_COLR_PAINTFORMAT_COLR_LAYERS = 1, FT_COLR_PAINTFORMAT_SOLID = 2, FT_COLR_PAINTFORMAT_LINEAR_GRADIENT = 4, FT_COLR_PAINTFORMAT_RADIAL_GRADIENT = 6, FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 8, FT_COLR_PAINTFORMAT_GLYPH = 10, FT_COLR_PAINTFORMAT_COLR_GLYPH = 11, FT_COLR_PAINTFORMAT_TRANSFORM = 12, FT_COLR_PAINTFORMAT_TRANSLATE = 14, FT_COLR_PAINTFORMAT_SCALE = 16, FT_COLR_PAINTFORMAT_ROTATE = 24, FT_COLR_PAINTFORMAT_SKEW = 28, FT_COLR_PAINTFORMAT_COMPOSITE = 32, FT_COLR_PAINT_FORMAT_MAX = 33, FT_COLR_PAINTFORMAT_UNSUPPORTED = 255 } FT_PaintFormat ; Enumeration describing the different paint format types of the v1 extensions to the \u2018COLR\u2019 table, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The enumeration values losely correspond with the format numbers of the specification: FreeType always returns a fully specified \u2018Paint\u2019 structure for the \u2018Transform\u2019, \u2018Translate\u2019, \u2018Scale\u2019, \u2018Rotate\u2019, and \u2018Skew\u2019 table types even though the specification has different formats depending on whether or not a center is specified, whether the scale is uniform in x and y direction or not, etc. Also, only non-variable format identifiers are listed in this enumeration; as soon as support for variable \u2018COLR\u2019 v1 fonts is implemented, interpolation is performed dependent on axis coordinates, which are configured on the FT_Face through FT_Set_Var_Design_Coordinates . This implies that always static, readily interpolated values are returned in the \u2018Paint\u2019 structures. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ColorStopIterator \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorStopIterator_ { FT_UInt num_color_stops; FT_UInt current_color_stop; FT_Byte * p; } FT_ColorStopIterator ; This iterator object is needed for FT_Get_Colorline_Stops . It keeps state while iterating over the stops of an FT_ColorLine , representing the ColorLine struct of the v1 extensions to \u2018COLR\u2019, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. fields num_color_stops The number of color stops for the requested glyph index. Set by FT_Get_Paint . current_color_stop The current color stop. Set by FT_Get_Colorline_Stops . p An opaque pointer into \u2018COLR\u2019 table data. Set by FT_Get_Paint . Updated by FT_Get_Colorline_Stops . since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ColorIndex \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorIndex_ { FT_UInt16 palette_index; FT_F2Dot14 alpha; } FT_ColorIndex ; A structure representing a ColorIndex value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. fields palette_index The palette index into a \u2018CPAL\u2019 palette. alpha Alpha transparency value multiplied with the value from \u2018CPAL\u2019. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ColorStop \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorStop_ { FT_F2Dot14 stop_offset; FT_ColorIndex color; } FT_ColorStop ; A structure representing a ColorStop value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. fields stop_offset The stop offset between 0 and 1 along the gradient. color The color information for this stop, see FT_ColorIndex . since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintExtend \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_PaintExtend_ { FT_COLR_PAINT_EXTEND_PAD = 0, FT_COLR_PAINT_EXTEND_REPEAT = 1, FT_COLR_PAINT_EXTEND_REFLECT = 2 } FT_PaintExtend ; An enumeration representing the \u2018Extend\u2019 mode of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. It describes how the gradient fill continues at the other boundaries. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ColorLine \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorLine_ { FT_PaintExtend extend; FT_ColorStopIterator color_stop_iterator; } FT_ColorLine ; A structure representing a ColorLine value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. It describes a list of color stops along the defined gradient. fields extend The extend mode at the outer boundaries, see FT_PaintExtend . color_stop_iterator The FT_ColorStopIterator used to enumerate and retrieve the actual FT_ColorStop 's. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Affine23 \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Affine_23_ { FT_Fixed xx, xy, dx; FT_Fixed yx, yy, dy; } FT_Affine23 ; A structure used to store a 2x3 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is x' = x*xx + y*xy + dx y' = x*yx + y*yy + dy fields xx Matrix coefficient. xy Matrix coefficient. dx x translation. yx Matrix coefficient. yy Matrix coefficient. dy y translation. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Composite_Mode \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_Composite_Mode_ { FT_COLR_COMPOSITE_CLEAR = 0, FT_COLR_COMPOSITE_SRC = 1, FT_COLR_COMPOSITE_DEST = 2, FT_COLR_COMPOSITE_SRC_OVER = 3, FT_COLR_COMPOSITE_DEST_OVER = 4, FT_COLR_COMPOSITE_SRC_IN = 5, FT_COLR_COMPOSITE_DEST_IN = 6, FT_COLR_COMPOSITE_SRC_OUT = 7, FT_COLR_COMPOSITE_DEST_OUT = 8, FT_COLR_COMPOSITE_SRC_ATOP = 9, FT_COLR_COMPOSITE_DEST_ATOP = 10, FT_COLR_COMPOSITE_XOR = 11, FT_COLR_COMPOSITE_PLUS = 12, FT_COLR_COMPOSITE_SCREEN = 13, FT_COLR_COMPOSITE_OVERLAY = 14, FT_COLR_COMPOSITE_DARKEN = 15, FT_COLR_COMPOSITE_LIGHTEN = 16, FT_COLR_COMPOSITE_COLOR_DODGE = 17, FT_COLR_COMPOSITE_COLOR_BURN = 18, FT_COLR_COMPOSITE_HARD_LIGHT = 19, FT_COLR_COMPOSITE_SOFT_LIGHT = 20, FT_COLR_COMPOSITE_DIFFERENCE = 21, FT_COLR_COMPOSITE_EXCLUSION = 22, FT_COLR_COMPOSITE_MULTIPLY = 23, FT_COLR_COMPOSITE_HSL_HUE = 24, FT_COLR_COMPOSITE_HSL_SATURATION = 25, FT_COLR_COMPOSITE_HSL_COLOR = 26, FT_COLR_COMPOSITE_HSL_LUMINOSITY = 27, FT_COLR_COMPOSITE_MAX = 28 } FT_Composite_Mode ; An enumeration listing the \u2018COLR\u2019 v1 composite modes used in FT_PaintComposite . For more details on each paint mode, see \u2018 https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators \u2019. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_OpaquePaint \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Opaque_Paint_ { FT_Byte * p; FT_Bool insert_root_transform; } FT_OpaquePaint ; A structure representing an offset to a Paint value stored in any of the paint tables of a \u2018COLR\u2019 v1 font. Compare Offset<24> there. When \u2018COLR\u2019 v1 paint tables represented by FreeType objects such as FT_PaintColrLayers , FT_PaintComposite , or FT_PaintTransform reference downstream nested paint tables, we do not immediately retrieve them but encapsulate their location in this type. Use FT_Get_Paint to retrieve the actual FT_COLR_Paint object that describes the details of the respective paint table. fields p An internal offset to a Paint table, needs to be set to NULL before passing this struct as an argument to FT_Get_Paint . insert_root_transform An internal boolean to track whether an initial root transform is to be provided. Do not set this value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintColrLayers \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintColrLayers_ { FT_LayerIterator layer_iterator; } FT_PaintColrLayers ; A structure representing a PaintColrLayers table of a \u2018COLR\u2019 v1 font. This table describes a set of layers that are to be composited with composite mode FT_COLR_COMPOSITE_SRC_OVER . The return value of this function is an FT_LayerIterator initialized so that it can be used with FT_Get_Paint_Layers to retrieve the FT_OpaquePaint objects as references to each layer. fields layer_iterator The layer iterator that describes the layers of this paint. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintSolid \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSolid_ { FT_ColorIndex color; } FT_PaintSolid ; A structure representing a PaintSolid value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. Using a PaintSolid value means that the glyph layer filled with this paint is solid-colored and does not contain a gradient. fields color The color information for this solid paint, see FT_ColorIndex . since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintLinearGradient \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintLinearGradient_ { FT_ColorLine colorline; /* TODO: Potentially expose those as x0, y0 etc. */ FT_Vector p0; FT_Vector p1; FT_Vector p2; } FT_PaintLinearGradient ; A structure representing a PaintLinearGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled with a linear gradient. fields colorline The FT_ColorLine information for this paint, i.e., the list of color stops along the gradient. p0 The starting point of the gradient definition in font units represented as a 16.16 fixed-point FT_Vector . p1 The end point of the gradient definition in font units represented as a 16.16 fixed-point FT_Vector . p2 Optional point p2 to rotate the gradient in font units represented as a 16.16 fixed-point FT_Vector . Otherwise equal to p0. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintRadialGradient \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintRadialGradient_ { FT_ColorLine colorline; FT_Vector c0; FT_Pos r0; FT_Vector c1; FT_Pos r1; } FT_PaintRadialGradient ; A structure representing a PaintRadialGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled filled with a radial gradient. fields colorline The FT_ColorLine information for this paint, i.e., the list of color stops along the gradient. c0 The center of the starting point of the radial gradient in font units represented as a 16.16 fixed-point FT_Vector . r0 The radius of the starting circle of the radial gradient in font units represented as a 16.16 fixed-point value. c1 The center of the end point of the radial gradient in font units represented as a 16.16 fixed-point FT_Vector . r1 The radius of the end circle of the radial gradient in font units represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintSweepGradient \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSweepGradient_ { FT_ColorLine colorline; FT_Vector center; FT_Fixed start_angle; FT_Fixed end_angle; } FT_PaintSweepGradient ; A structure representing a PaintSweepGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled with a sweep gradient from start_angle to end_angle . fields colorline The FT_ColorLine information for this paint, i.e., the list of color stops along the gradient. center The center of the sweep gradient in font units represented as a vector of 16.16 fixed-point values. start_angle The start angle of the sweep gradient in 16.16 fixed-point format specifying degrees divided by 180.0 (as in the spec). Multiply by 180.0f to receive degrees value. Values are given counter-clockwise, starting from the (positive) y axis. end_angle The end angle of the sweep gradient in 16.16 fixed-point format specifying degrees divided by 180.0 (as in the spec). Multiply by 180.0f to receive degrees value. Values are given counter-clockwise, starting from the (positive) y axis. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintGlyph \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintGlyph_ { FT_OpaquePaint paint; FT_UInt glyphID; } FT_PaintGlyph ; A structure representing a \u2018COLR\u2019 v1 PaintGlyph paint table. fields paint An opaque paint object pointing to a Paint table that serves as the fill for the glyph ID. glyphID The glyph ID from the \u2018glyf\u2019 table, which serves as the contour information that is filled with paint. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintColrGlyph \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintColrGlyph_ { FT_UInt glyphID; } FT_PaintColrGlyph ; A structure representing a \u2018COLR\u2019 v1 PaintColorGlyph paint table. fields glyphID The glyph ID from the BaseGlyphV1List table that is drawn for this paint. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintTransform \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintTransform_ { FT_OpaquePaint paint; FT_Affine23 affine; } FT_PaintTransform ; A structure representing a \u2018COLR\u2019 v1 PaintTransform paint table. fields paint An opaque paint that is subject to being transformed. affine A 2x3 transformation matrix in FT_Affine23 format containing 16.16 fixed-point values. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintTranslate \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintTranslate_ { FT_OpaquePaint paint; FT_Fixed dx; FT_Fixed dy; } FT_PaintTranslate ; A structure representing a \u2018COLR\u2019 v1 PaintTranslate paint table. Used for translating downstream paints by a given x and y delta. fields paint An FT_OpaquePaint object referencing the paint that is to be rotated. dx Translation in x direction in font units represented as a 16.16 fixed-point value. dy Translation in y direction in font units represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintScale \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintScale_ { FT_OpaquePaint paint; FT_Fixed scale_x; FT_Fixed scale_y; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintScale ; A structure representing all of the \u2018COLR\u2019 v1 \u2018PaintScale*\u2019 paint tables. Used for scaling downstream paints by a given x and y scale, with a given center. This structure is used for all \u2018PaintScale*\u2019 types that are part of specification; fields of this structure are filled accordingly. If there is a center, the center values are set, otherwise they are set to the zero coordinate. If the source font file has \u2018PaintScaleUniform*\u2019 set, the scale values are set accordingly to the same value. fields paint An FT_OpaquePaint object referencing the paint that is to be scaled. scale_x Scale factor in x direction represented as a 16.16 fixed-point value. scale_y Scale factor in y direction represented as a 16.16 fixed-point value. center_x x coordinate of center point to scale from represented as a 16.16 fixed-point value. center_y y coordinate of center point to scale from represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward-compatibility of both the API and ABI. FT_PaintRotate \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintRotate_ { FT_OpaquePaint paint; FT_Fixed angle; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintRotate ; A structure representing a \u2018COLR\u2019 v1 PaintRotate paint table. Used for rotating downstream paints with a given center and angle. fields paint An FT_OpaquePaint object referencing the paint that is to be rotated. angle The rotation angle that is to be applied in degrees divided by 180.0 (as in the spec) represented as a 16.16 fixed-point value. Multiply by 180.0f to receive degrees value. center_x The x coordinate of the pivot point of the rotation in font units) represented as a 16.16 fixed-point value. center_y The y coordinate of the pivot point of the rotation in font units represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintSkew \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSkew_ { FT_OpaquePaint paint; FT_Fixed x_skew_angle; FT_Fixed y_skew_angle; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintSkew ; A structure representing a \u2018COLR\u2019 v1 PaintSkew paint table. Used for skewing or shearing downstream paints by a given center and angle. fields paint An FT_OpaquePaint object referencing the paint that is to be skewed. x_skew_angle The skewing angle in x direction in degrees divided by 180.0 (as in the spec) represented as a 16.16 fixed-point value. Multiply by 180.0f to receive degrees. y_skew_angle The skewing angle in y direction in degrees divided by 180.0 (as in the spec) represented as a 16.16 fixed-point value. Multiply by 180.0f to receive degrees. center_x The x coordinate of the pivot point of the skew in font units represented as a 16.16 fixed-point value. center_y The y coordinate of the pivot point of the skew in font units represented as a 16.16 fixed-point value. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_PaintComposite \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintComposite_ { FT_OpaquePaint source_paint; FT_Composite_Mode composite_mode; FT_OpaquePaint backdrop_paint; } FT_PaintComposite ; A structure representing a \u2018COLR'v1 PaintComposite paint table. Used for compositing two paints in a 'COLR\u2019 v1 directed acycling graph. fields source_paint An FT_OpaquePaint object referencing the source that is to be composited. composite_mode An FT_Composite_Mode enum value determining the composition operation. backdrop_paint An FT_OpaquePaint object referencing the backdrop paint that source_paint is composited onto. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_COLR_Paint \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_COLR_Paint_ { FT_PaintFormat format; union { FT_PaintColrLayers colr_layers; FT_PaintGlyph glyph; FT_PaintSolid solid; FT_PaintLinearGradient linear_gradient; FT_PaintRadialGradient radial_gradient; FT_PaintSweepGradient sweep_gradient; FT_PaintTransform transform; FT_PaintTranslate translate; FT_PaintScale scale; FT_PaintRotate rotate; FT_PaintSkew skew; FT_PaintComposite composite; FT_PaintColrGlyph colr_glyph; } u; } FT_COLR_Paint ; A union object representing format and details of a paint table of a \u2018COLR\u2019 v1 font, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. Use FT_Get_Paint to retrieve a FT_COLR_Paint for an FT_OpaquePaint object. fields format The gradient format for this Paint structure. u Union of all paint table types: FT_PaintColrLayers FT_PaintGlyph FT_PaintSolid FT_PaintLinearGradient FT_PaintRadialGradient FT_PaintSweepGradient FT_PaintTransform FT_PaintTranslate FT_PaintRotate FT_PaintSkew FT_PaintComposite * FT_PaintColrGlyph since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Color_Root_Transform \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_Color_Root_Transform_ { FT_COLOR_INCLUDE_ROOT_TRANSFORM , FT_COLOR_NO_ROOT_TRANSFORM , FT_COLOR_ROOT_TRANSFORM_MAX } FT_Color_Root_Transform ; An enumeration to specify whether FT_Get_Color_Glyph_Paint is to return a root transform to configure the client's graphics context matrix. values FT_COLOR_INCLUDE_ROOT_TRANSFORM Do include the root transform as the initial FT_COLR_Paint object. FT_COLOR_NO_ROOT_TRANSFORM Do not output an initial root transform. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_ClipBox \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ClipBox_ { FT_Vector bottom_left; FT_Vector top_left; FT_Vector top_right; FT_Vector bottom_right; } FT_ClipBox ; A structure representing a \u2018COLR\u2019 v1 \u2018ClipBox\u2019 table. \u2018COLR\u2019 v1 glyphs may optionally define a clip box for aiding allocation or defining a maximum drawable region. Use FT_Get_Color_Glyph_ClipBox to retrieve it. fields bottom_left The bottom left corner of the clip box as an FT_Vector with fixed-point coordinates in 26.6 format. top_left The top left corner of the clip box as an FT_Vector with fixed-point coordinates in 26.6 format. top_right The top right corner of the clip box as an FT_Vector with fixed-point coordinates in 26.6 format. bottom_right The bottom right corner of the clip box as an FT_Vector with fixed-point coordinates in 26.6 format. since 2.12 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Color_Glyph_Paint \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_Paint ( FT_Face face, FT_UInt base_glyph, FT_Color_Root_Transform root_transform, FT_OpaquePaint * paint ); This is the starting point and interface to color gradient information in a \u2018COLR\u2019 v1 table in OpenType fonts to recursively retrieve the paint tables for the directed acyclic graph of a colored glyph, given a glyph ID. https://github.com/googlefonts/colr-gradients-spec In a \u2018COLR\u2019 v1 font, each color glyph defines a directed acyclic graph of nested paint tables, such as PaintGlyph , PaintSolid , PaintLinearGradient , PaintRadialGradient , and so on. Using this function and specifying a glyph ID, one retrieves the root paint table for this glyph ID. This function allows control whether an initial root transform is returned to configure scaling, transform, and translation correctly on the client's graphics context. The initial root transform is computed and returned according to the values configured for FT_Size and FT_Set_Transform on the FT_Face object, see below for details of the root_transform parameter. This has implications for a client \u2018COLR\u2019 v1 implementation: When this function returns an initially computed root transform, at the time of executing the FT_PaintGlyph operation, the contours should be retrieved using FT_Load_Glyph at unscaled, untransformed size. This is because the root transform applied to the graphics context will take care of correct scaling. Alternatively, to allow hinting of contours, at the time of executing FT_Load_Glyph , the current graphics context transformation matrix can be decomposed into a scaling matrix and a remainder, and FT_Load_Glyph can be used to retrieve the contours at scaled size. Care must then be taken to blit or clip to the graphics context with taking this remainder transformation into account. input face A handle to the parent face object. base_glyph The glyph index for which to retrieve the root paint table. root_transform Specifies whether an initially computed root is returned by the FT_PaintTransform operation to account for the activated size (see FT_Activate_Size ) and the configured transform and translate (see FT_Set_Transform ). This root transform is returned before nodes of the glyph graph of the font are returned. Subsequent FT_COLR_Paint structures contain unscaled and untransformed values. The inserted root transform enables the client application to apply an initial transform to its graphics context. When executing subsequent FT_COLR_Paint operations, values from FT_COLR_Paint operations will ultimately be correctly scaled because of the root transform applied to the graphics context. Use FT_COLOR_INCLUDE_ROOT_TRANSFORM to include the root transform, use FT_COLOR_NO_ROOT_TRANSFORM to not include it. The latter may be useful when traversing the \u2018COLR\u2019 v1 glyph graph and reaching a FT_PaintColrGlyph . When recursing into FT_PaintColrGlyph and painting that inline, no additional root transform is needed as it has already been applied to the graphics context at the beginning of drawing this glyph. output paint The FT_OpaquePaint object that references the actual paint table. The respective actual FT_COLR_Paint object is retrieved via FT_Get_Paint . return Value 1 if everything is OK. If no color glyph is found, or the root paint could not be retrieved, value 0 gets returned. In case of an error, value 0 is returned also. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Color_Glyph_ClipBox \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_ClipBox ( FT_Face face, FT_UInt base_glyph, FT_ClipBox * clip_box ); Search for a \u2018COLR\u2019 v1 clip box for the specified base_glyph and fill the clip_box parameter with the \u2018COLR\u2019 v1 \u2018ClipBox\u2019 information if one is found. input face A handle to the parent face object. base_glyph The glyph index for which to retrieve the clip box. output clip_box The clip box for the requested base_glyph if one is found. The clip box is computed taking scale and transformations configured on the FT_Face into account. FT_ClipBox contains FT_Vector values in 26.6 format. return Value 1 if a clip box is found. If no clip box is found or an error occured, value 0 is returned. note To retrieve the clip box in font units, reset scale to units-per-em and remove transforms configured using FT_Set_Transform . since 2.12 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Paint_Layers \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Paint_Layers ( FT_Face face, FT_LayerIterator * iterator, FT_OpaquePaint * paint ); Access the layers of a PaintColrLayers table. If the root paint of a color glyph, or a nested paint of a \u2018COLR\u2019 glyph is a PaintColrLayers table, this function retrieves the layers of the PaintColrLayers table. The FT_PaintColrLayers object contains an FT_LayerIterator , which is used here to iterate over the layers. Each layer is returned as an FT_OpaquePaint object, which then can be used with FT_Get_Paint to retrieve the actual paint object. input face A handle to the parent face object. inout iterator The FT_LayerIterator from an FT_PaintColrLayers object, for which the layers are to be retrieved. The internal state of the iterator is incremented after one call to this function for retrieving one layer. output paint The FT_OpaquePaint object that references the actual paint table. The respective actual FT_COLR_Paint object is retrieved via FT_Get_Paint . return Value 1 if everything is OK. Value 0 gets returned when the paint object can not be retrieved or any other error occurs. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Colorline_Stops \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Colorline_Stops ( FT_Face face, FT_ColorStop * color_stop, FT_ColorStopIterator * iterator ); This is an interface to color gradient information in a \u2018COLR\u2019 v1 table in OpenType fonts to iteratively retrieve the gradient and solid fill information for colored glyph layers for a specified glyph ID. https://github.com/googlefonts/colr-gradients-spec input face A handle to the parent face object. inout iterator The retrieved FT_ColorStopIterator , configured on an FT_ColorLine , which in turn got retrieved via paint information in FT_PaintLinearGradient or FT_PaintRadialGradient . output color_stop Color index and alpha value for the retrieved color stop. return Value 1 if everything is OK. If there are no more color stops, value 0 gets returned. In case of an error, value 0 is returned also. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI. FT_Get_Paint \u00b6 Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Paint ( FT_Face face, FT_OpaquePaint opaque_paint, FT_COLR_Paint * paint ); Access the details of a paint using an FT_OpaquePaint opaque paint object, which internally stores the offset to the respective Paint object in the \u2018COLR\u2019 table. input face A handle to the parent face object. opaque_paint The opaque paint object for which the underlying FT_COLR_Paint data is to be retrieved. output paint The specific FT_COLR_Paint object containing information coming from one of the font's Paint* tables. return Value 1 if everything is OK. Value 0 if no details can be found for this paint or any other error occured. since 2.11 \u2013 currently experimental only! There might be changes without retaining backward compatibility of both the API and ABI.","title":"Glyph Layer Management"},{"location":"ft2-layer_management.html#glyph-layer-management","text":"","title":"Glyph Layer Management"},{"location":"ft2-layer_management.html#synopsis","text":"The functions described here allow access of colored glyph layer data in OpenType's \u2018COLR\u2019 tables.","title":"Synopsis"},{"location":"ft2-layer_management.html#ft_layeriterator","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_LayerIterator_ { FT_UInt num_layers; FT_UInt layer; FT_Byte * p; } FT_LayerIterator ; This iterator object is needed for FT_Get_Color_Glyph_Layer .","title":"FT_LayerIterator"},{"location":"ft2-layer_management.html#ft_get_color_glyph_layer","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_Layer ( FT_Face face, FT_UInt base_glyph, FT_UInt *aglyph_index, FT_UInt *acolor_index, FT_LayerIterator * iterator ); This is an interface to the \u2018COLR\u2019 table in OpenType fonts to iteratively retrieve the colored glyph layers associated with the current glyph slot. https://docs.microsoft.com/en-us/typography/opentype/spec/colr The glyph layer data for a given glyph index, if present, provides an alternative, multi-color glyph representation: Instead of rendering the outline or bitmap with the given glyph index, glyphs with the indices and colors returned by this function are rendered layer by layer. The returned elements are ordered in the z direction from bottom to top; the 'n'th element should be rendered with the associated palette color and blended on top of the already rendered layers (elements 0, 1, \u2026, n-1).","title":"FT_Get_Color_Glyph_Layer"},{"location":"ft2-layer_management.html#ft_paintformat","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_PaintFormat_ { FT_COLR_PAINTFORMAT_COLR_LAYERS = 1, FT_COLR_PAINTFORMAT_SOLID = 2, FT_COLR_PAINTFORMAT_LINEAR_GRADIENT = 4, FT_COLR_PAINTFORMAT_RADIAL_GRADIENT = 6, FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 8, FT_COLR_PAINTFORMAT_GLYPH = 10, FT_COLR_PAINTFORMAT_COLR_GLYPH = 11, FT_COLR_PAINTFORMAT_TRANSFORM = 12, FT_COLR_PAINTFORMAT_TRANSLATE = 14, FT_COLR_PAINTFORMAT_SCALE = 16, FT_COLR_PAINTFORMAT_ROTATE = 24, FT_COLR_PAINTFORMAT_SKEW = 28, FT_COLR_PAINTFORMAT_COMPOSITE = 32, FT_COLR_PAINT_FORMAT_MAX = 33, FT_COLR_PAINTFORMAT_UNSUPPORTED = 255 } FT_PaintFormat ; Enumeration describing the different paint format types of the v1 extensions to the \u2018COLR\u2019 table, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The enumeration values losely correspond with the format numbers of the specification: FreeType always returns a fully specified \u2018Paint\u2019 structure for the \u2018Transform\u2019, \u2018Translate\u2019, \u2018Scale\u2019, \u2018Rotate\u2019, and \u2018Skew\u2019 table types even though the specification has different formats depending on whether or not a center is specified, whether the scale is uniform in x and y direction or not, etc. Also, only non-variable format identifiers are listed in this enumeration; as soon as support for variable \u2018COLR\u2019 v1 fonts is implemented, interpolation is performed dependent on axis coordinates, which are configured on the FT_Face through FT_Set_Var_Design_Coordinates . This implies that always static, readily interpolated values are returned in the \u2018Paint\u2019 structures.","title":"FT_PaintFormat"},{"location":"ft2-layer_management.html#ft_colorstopiterator","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorStopIterator_ { FT_UInt num_color_stops; FT_UInt current_color_stop; FT_Byte * p; } FT_ColorStopIterator ; This iterator object is needed for FT_Get_Colorline_Stops . It keeps state while iterating over the stops of an FT_ColorLine , representing the ColorLine struct of the v1 extensions to \u2018COLR\u2019, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019.","title":"FT_ColorStopIterator"},{"location":"ft2-layer_management.html#ft_colorindex","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorIndex_ { FT_UInt16 palette_index; FT_F2Dot14 alpha; } FT_ColorIndex ; A structure representing a ColorIndex value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019.","title":"FT_ColorIndex"},{"location":"ft2-layer_management.html#ft_colorstop","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorStop_ { FT_F2Dot14 stop_offset; FT_ColorIndex color; } FT_ColorStop ; A structure representing a ColorStop value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019.","title":"FT_ColorStop"},{"location":"ft2-layer_management.html#ft_paintextend","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_PaintExtend_ { FT_COLR_PAINT_EXTEND_PAD = 0, FT_COLR_PAINT_EXTEND_REPEAT = 1, FT_COLR_PAINT_EXTEND_REFLECT = 2 } FT_PaintExtend ; An enumeration representing the \u2018Extend\u2019 mode of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. It describes how the gradient fill continues at the other boundaries.","title":"FT_PaintExtend"},{"location":"ft2-layer_management.html#ft_colorline","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ColorLine_ { FT_PaintExtend extend; FT_ColorStopIterator color_stop_iterator; } FT_ColorLine ; A structure representing a ColorLine value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. It describes a list of color stops along the defined gradient.","title":"FT_ColorLine"},{"location":"ft2-layer_management.html#ft_affine23","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Affine_23_ { FT_Fixed xx, xy, dx; FT_Fixed yx, yy, dy; } FT_Affine23 ; A structure used to store a 2x3 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is x' = x*xx + y*xy + dx y' = x*yx + y*yy + dy","title":"FT_Affine23"},{"location":"ft2-layer_management.html#ft_composite_mode","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_Composite_Mode_ { FT_COLR_COMPOSITE_CLEAR = 0, FT_COLR_COMPOSITE_SRC = 1, FT_COLR_COMPOSITE_DEST = 2, FT_COLR_COMPOSITE_SRC_OVER = 3, FT_COLR_COMPOSITE_DEST_OVER = 4, FT_COLR_COMPOSITE_SRC_IN = 5, FT_COLR_COMPOSITE_DEST_IN = 6, FT_COLR_COMPOSITE_SRC_OUT = 7, FT_COLR_COMPOSITE_DEST_OUT = 8, FT_COLR_COMPOSITE_SRC_ATOP = 9, FT_COLR_COMPOSITE_DEST_ATOP = 10, FT_COLR_COMPOSITE_XOR = 11, FT_COLR_COMPOSITE_PLUS = 12, FT_COLR_COMPOSITE_SCREEN = 13, FT_COLR_COMPOSITE_OVERLAY = 14, FT_COLR_COMPOSITE_DARKEN = 15, FT_COLR_COMPOSITE_LIGHTEN = 16, FT_COLR_COMPOSITE_COLOR_DODGE = 17, FT_COLR_COMPOSITE_COLOR_BURN = 18, FT_COLR_COMPOSITE_HARD_LIGHT = 19, FT_COLR_COMPOSITE_SOFT_LIGHT = 20, FT_COLR_COMPOSITE_DIFFERENCE = 21, FT_COLR_COMPOSITE_EXCLUSION = 22, FT_COLR_COMPOSITE_MULTIPLY = 23, FT_COLR_COMPOSITE_HSL_HUE = 24, FT_COLR_COMPOSITE_HSL_SATURATION = 25, FT_COLR_COMPOSITE_HSL_COLOR = 26, FT_COLR_COMPOSITE_HSL_LUMINOSITY = 27, FT_COLR_COMPOSITE_MAX = 28 } FT_Composite_Mode ; An enumeration listing the \u2018COLR\u2019 v1 composite modes used in FT_PaintComposite . For more details on each paint mode, see \u2018 https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators \u2019.","title":"FT_Composite_Mode"},{"location":"ft2-layer_management.html#ft_opaquepaint","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_Opaque_Paint_ { FT_Byte * p; FT_Bool insert_root_transform; } FT_OpaquePaint ; A structure representing an offset to a Paint value stored in any of the paint tables of a \u2018COLR\u2019 v1 font. Compare Offset<24> there. When \u2018COLR\u2019 v1 paint tables represented by FreeType objects such as FT_PaintColrLayers , FT_PaintComposite , or FT_PaintTransform reference downstream nested paint tables, we do not immediately retrieve them but encapsulate their location in this type. Use FT_Get_Paint to retrieve the actual FT_COLR_Paint object that describes the details of the respective paint table.","title":"FT_OpaquePaint"},{"location":"ft2-layer_management.html#ft_paintcolrlayers","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintColrLayers_ { FT_LayerIterator layer_iterator; } FT_PaintColrLayers ; A structure representing a PaintColrLayers table of a \u2018COLR\u2019 v1 font. This table describes a set of layers that are to be composited with composite mode FT_COLR_COMPOSITE_SRC_OVER . The return value of this function is an FT_LayerIterator initialized so that it can be used with FT_Get_Paint_Layers to retrieve the FT_OpaquePaint objects as references to each layer.","title":"FT_PaintColrLayers"},{"location":"ft2-layer_management.html#ft_paintsolid","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSolid_ { FT_ColorIndex color; } FT_PaintSolid ; A structure representing a PaintSolid value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. Using a PaintSolid value means that the glyph layer filled with this paint is solid-colored and does not contain a gradient.","title":"FT_PaintSolid"},{"location":"ft2-layer_management.html#ft_paintlineargradient","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintLinearGradient_ { FT_ColorLine colorline; /* TODO: Potentially expose those as x0, y0 etc. */ FT_Vector p0; FT_Vector p1; FT_Vector p2; } FT_PaintLinearGradient ; A structure representing a PaintLinearGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled with a linear gradient.","title":"FT_PaintLinearGradient"},{"location":"ft2-layer_management.html#ft_paintradialgradient","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintRadialGradient_ { FT_ColorLine colorline; FT_Vector c0; FT_Pos r0; FT_Vector c1; FT_Pos r1; } FT_PaintRadialGradient ; A structure representing a PaintRadialGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled filled with a radial gradient.","title":"FT_PaintRadialGradient"},{"location":"ft2-layer_management.html#ft_paintsweepgradient","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSweepGradient_ { FT_ColorLine colorline; FT_Vector center; FT_Fixed start_angle; FT_Fixed end_angle; } FT_PaintSweepGradient ; A structure representing a PaintSweepGradient value of the \u2018COLR\u2019 v1 extensions, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. The glyph layer filled with this paint is drawn filled with a sweep gradient from start_angle to end_angle .","title":"FT_PaintSweepGradient"},{"location":"ft2-layer_management.html#ft_paintglyph","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintGlyph_ { FT_OpaquePaint paint; FT_UInt glyphID; } FT_PaintGlyph ; A structure representing a \u2018COLR\u2019 v1 PaintGlyph paint table.","title":"FT_PaintGlyph"},{"location":"ft2-layer_management.html#ft_paintcolrglyph","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintColrGlyph_ { FT_UInt glyphID; } FT_PaintColrGlyph ; A structure representing a \u2018COLR\u2019 v1 PaintColorGlyph paint table.","title":"FT_PaintColrGlyph"},{"location":"ft2-layer_management.html#ft_painttransform","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintTransform_ { FT_OpaquePaint paint; FT_Affine23 affine; } FT_PaintTransform ; A structure representing a \u2018COLR\u2019 v1 PaintTransform paint table.","title":"FT_PaintTransform"},{"location":"ft2-layer_management.html#ft_painttranslate","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintTranslate_ { FT_OpaquePaint paint; FT_Fixed dx; FT_Fixed dy; } FT_PaintTranslate ; A structure representing a \u2018COLR\u2019 v1 PaintTranslate paint table. Used for translating downstream paints by a given x and y delta.","title":"FT_PaintTranslate"},{"location":"ft2-layer_management.html#ft_paintscale","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintScale_ { FT_OpaquePaint paint; FT_Fixed scale_x; FT_Fixed scale_y; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintScale ; A structure representing all of the \u2018COLR\u2019 v1 \u2018PaintScale*\u2019 paint tables. Used for scaling downstream paints by a given x and y scale, with a given center. This structure is used for all \u2018PaintScale*\u2019 types that are part of specification; fields of this structure are filled accordingly. If there is a center, the center values are set, otherwise they are set to the zero coordinate. If the source font file has \u2018PaintScaleUniform*\u2019 set, the scale values are set accordingly to the same value.","title":"FT_PaintScale"},{"location":"ft2-layer_management.html#ft_paintrotate","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintRotate_ { FT_OpaquePaint paint; FT_Fixed angle; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintRotate ; A structure representing a \u2018COLR\u2019 v1 PaintRotate paint table. Used for rotating downstream paints with a given center and angle.","title":"FT_PaintRotate"},{"location":"ft2-layer_management.html#ft_paintskew","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintSkew_ { FT_OpaquePaint paint; FT_Fixed x_skew_angle; FT_Fixed y_skew_angle; FT_Fixed center_x; FT_Fixed center_y; } FT_PaintSkew ; A structure representing a \u2018COLR\u2019 v1 PaintSkew paint table. Used for skewing or shearing downstream paints by a given center and angle.","title":"FT_PaintSkew"},{"location":"ft2-layer_management.html#ft_paintcomposite","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_PaintComposite_ { FT_OpaquePaint source_paint; FT_Composite_Mode composite_mode; FT_OpaquePaint backdrop_paint; } FT_PaintComposite ; A structure representing a \u2018COLR'v1 PaintComposite paint table. Used for compositing two paints in a 'COLR\u2019 v1 directed acycling graph.","title":"FT_PaintComposite"},{"location":"ft2-layer_management.html#ft_colr_paint","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_COLR_Paint_ { FT_PaintFormat format; union { FT_PaintColrLayers colr_layers; FT_PaintGlyph glyph; FT_PaintSolid solid; FT_PaintLinearGradient linear_gradient; FT_PaintRadialGradient radial_gradient; FT_PaintSweepGradient sweep_gradient; FT_PaintTransform transform; FT_PaintTranslate translate; FT_PaintScale scale; FT_PaintRotate rotate; FT_PaintSkew skew; FT_PaintComposite composite; FT_PaintColrGlyph colr_glyph; } u; } FT_COLR_Paint ; A union object representing format and details of a paint table of a \u2018COLR\u2019 v1 font, see \u2018 https://github.com/googlefonts/colr-gradients-spec \u2019. Use FT_Get_Paint to retrieve a FT_COLR_Paint for an FT_OpaquePaint object.","title":"FT_COLR_Paint"},{"location":"ft2-layer_management.html#ft_color_root_transform","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef enum FT_Color_Root_Transform_ { FT_COLOR_INCLUDE_ROOT_TRANSFORM , FT_COLOR_NO_ROOT_TRANSFORM , FT_COLOR_ROOT_TRANSFORM_MAX } FT_Color_Root_Transform ; An enumeration to specify whether FT_Get_Color_Glyph_Paint is to return a root transform to configure the client's graphics context matrix.","title":"FT_Color_Root_Transform"},{"location":"ft2-layer_management.html#ft_clipbox","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). typedef struct FT_ClipBox_ { FT_Vector bottom_left; FT_Vector top_left; FT_Vector top_right; FT_Vector bottom_right; } FT_ClipBox ; A structure representing a \u2018COLR\u2019 v1 \u2018ClipBox\u2019 table. \u2018COLR\u2019 v1 glyphs may optionally define a clip box for aiding allocation or defining a maximum drawable region. Use FT_Get_Color_Glyph_ClipBox to retrieve it.","title":"FT_ClipBox"},{"location":"ft2-layer_management.html#ft_get_color_glyph_paint","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_Paint ( FT_Face face, FT_UInt base_glyph, FT_Color_Root_Transform root_transform, FT_OpaquePaint * paint ); This is the starting point and interface to color gradient information in a \u2018COLR\u2019 v1 table in OpenType fonts to recursively retrieve the paint tables for the directed acyclic graph of a colored glyph, given a glyph ID. https://github.com/googlefonts/colr-gradients-spec In a \u2018COLR\u2019 v1 font, each color glyph defines a directed acyclic graph of nested paint tables, such as PaintGlyph , PaintSolid , PaintLinearGradient , PaintRadialGradient , and so on. Using this function and specifying a glyph ID, one retrieves the root paint table for this glyph ID. This function allows control whether an initial root transform is returned to configure scaling, transform, and translation correctly on the client's graphics context. The initial root transform is computed and returned according to the values configured for FT_Size and FT_Set_Transform on the FT_Face object, see below for details of the root_transform parameter. This has implications for a client \u2018COLR\u2019 v1 implementation: When this function returns an initially computed root transform, at the time of executing the FT_PaintGlyph operation, the contours should be retrieved using FT_Load_Glyph at unscaled, untransformed size. This is because the root transform applied to the graphics context will take care of correct scaling. Alternatively, to allow hinting of contours, at the time of executing FT_Load_Glyph , the current graphics context transformation matrix can be decomposed into a scaling matrix and a remainder, and FT_Load_Glyph can be used to retrieve the contours at scaled size. Care must then be taken to blit or clip to the graphics context with taking this remainder transformation into account.","title":"FT_Get_Color_Glyph_Paint"},{"location":"ft2-layer_management.html#ft_get_color_glyph_clipbox","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Color_Glyph_ClipBox ( FT_Face face, FT_UInt base_glyph, FT_ClipBox * clip_box ); Search for a \u2018COLR\u2019 v1 clip box for the specified base_glyph and fill the clip_box parameter with the \u2018COLR\u2019 v1 \u2018ClipBox\u2019 information if one is found.","title":"FT_Get_Color_Glyph_ClipBox"},{"location":"ft2-layer_management.html#ft_get_paint_layers","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Paint_Layers ( FT_Face face, FT_LayerIterator * iterator, FT_OpaquePaint * paint ); Access the layers of a PaintColrLayers table. If the root paint of a color glyph, or a nested paint of a \u2018COLR\u2019 glyph is a PaintColrLayers table, this function retrieves the layers of the PaintColrLayers table. The FT_PaintColrLayers object contains an FT_LayerIterator , which is used here to iterate over the layers. Each layer is returned as an FT_OpaquePaint object, which then can be used with FT_Get_Paint to retrieve the actual paint object.","title":"FT_Get_Paint_Layers"},{"location":"ft2-layer_management.html#ft_get_colorline_stops","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Colorline_Stops ( FT_Face face, FT_ColorStop * color_stop, FT_ColorStopIterator * iterator ); This is an interface to color gradient information in a \u2018COLR\u2019 v1 table in OpenType fonts to iteratively retrieve the gradient and solid fill information for colored glyph layers for a specified glyph ID. https://github.com/googlefonts/colr-gradients-spec","title":"FT_Get_Colorline_Stops"},{"location":"ft2-layer_management.html#ft_get_paint","text":"Defined in FT_COLOR_H (freetype/ftcolor.h). FT_EXPORT( FT_Bool ) FT_Get_Paint ( FT_Face face, FT_OpaquePaint opaque_paint, FT_COLR_Paint * paint ); Access the details of a paint using an FT_OpaquePaint opaque paint object, which internally stores the offset to the respective Paint object in the \u2018COLR\u2019 table.","title":"FT_Get_Paint"},{"location":"ft2-lcd_rendering.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb Subpixel Rendering Subpixel Rendering \u00b6 Synopsis \u00b6 FreeType provides two alternative subpixel rendering technologies. Should you define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your ftoption.h file, this enables ClearType-style rendering. Otherwise, Harmony LCD rendering is enabled. These technologies are controlled differently and API described below, although always available, performs its function when appropriate method is enabled and does nothing otherwise. ClearType-style LCD rendering exploits the color-striped structure of LCD pixels, increasing the available resolution in the direction of the stripe (usually horizontal RGB) by a factor of 3. Using the subpixel coverages unfiltered can create severe color fringes especially when rendering thin features. Indeed, to produce black-on-white text, the nearby color subpixels must be dimmed evenly. Therefore, an equalizing 5-tap FIR filter should be applied to subpixel coverages regardless of pixel boundaries and should have these properties: It should be symmetrical, like { a, b, c, b, a }, to avoid any shifts in appearance. It should be color-balanced, meaning a + b = c, to reduce color fringes by distributing the computed coverage for one subpixel to all subpixels equally. It should be normalized, meaning 2a + 2b + c = 1.0 to maintain overall brightness. Boxy 3-tap filter {0, \u2153, \u2153, \u2153, 0} is sharper but is less forgiving of non-ideal gamma curves of a screen (and viewing angles), beveled filters are fuzzier but more tolerant. Use the FT_Library_SetLcdFilter or FT_Library_SetLcdFilterWeights API to specify a low-pass filter, which is then applied to subpixel-rendered bitmaps generated through FT_Render_Glyph . Harmony LCD rendering is suitable to panels with any regular subpixel structure, not just monitors with 3 color striped subpixels, as long as the color subpixels have fixed positions relative to the pixel center. In this case, each color channel can be rendered separately after shifting the outline opposite to the subpixel shift so that the coverage maps are aligned. This method is immune to color fringes because the shifts do not change integral coverage. The subpixel geometry must be specified by xy-coordinates for each subpixel. By convention they may come in the RGB order: {{-\u2153, 0}, {0, 0}, {\u2153, 0}} for standard RGB striped panel or {{-\u2159, \u00bc}, {-\u2159, -\u00bc}, {\u2153, 0}} for a certain PenTile panel. Use the FT_Library_SetLcdGeometry API to specify subpixel positions. If one follows the RGB order convention, the same order applies to the resulting FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V bitmaps. Note, however, that the coordinate frame for the latter must be rotated clockwise. Harmony with default LCD geometry is equivalent to ClearType with light filter. As a result of ClearType filtering or Harmony shifts, the resulting dimensions of LCD bitmaps can be slightly wider or taller than the dimensions the original outline with regard to the pixel grid. For example, for FT_RENDER_MODE_LCD , the filter adds 2 subpixels to the left, and 2 subpixels to the right. The bitmap offset values are adjusted accordingly, so clients shouldn't need to modify their layout and glyph positioning code when enabling the filter. The ClearType and Harmony rendering is applicable to glyph bitmaps rendered through FT_Render_Glyph , FT_Load_Glyph , FT_Load_Char , and FT_Glyph_To_Bitmap , when FT_RENDER_MODE_LCD or FT_RENDER_MODE_LCD_V is specified. This API does not control FT_Outline_Render and FT_Outline_Get_Bitmap . The described algorithms can completely remove color artefacts when combined with gamma-corrected alpha blending in linear space. Each of the 3 alpha values (subpixels) must by independently used to blend one color channel. That is, red alpha blends the red channel of the text color with the red channel of the background pixel. FT_LcdFilter \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). typedef enum FT_LcdFilter_ { FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_LIGHT = 2, FT_LCD_FILTER_LEGACY1 = 3, FT_LCD_FILTER_LEGACY = 16, FT_LCD_FILTER_MAX /* do not remove */ } FT_LcdFilter ; A list of values to identify various types of LCD filters. values FT_LCD_FILTER_NONE Do not perform filtering. When used with subpixel rendering, this results in sometimes severe color fringes. FT_LCD_FILTER_DEFAULT This is a beveled, normalized, and color-balanced five-tap filter with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256th units. FT_LCD_FILTER_LIGHT this is a boxy, normalized, and color-balanced three-tap filter with weights of [0x00 0x55 0x56 0x55 0x00] in 1/256th units. FT_LCD_FILTER_LEGACY FT_LCD_FILTER_LEGACY1 This filter corresponds to the original libXft color filter. It provides high contrast output but can exhibit really bad color fringes if glyphs are not extremely well hinted to the pixel grid. This filter is only provided for comparison purposes, and might be disabled or stay unsupported in the future. The second value is provided for compatibility with FontConfig, which historically used different enumeration, sometimes incorrectly forwarded to FreeType. since 2.3.0 ( FT_LCD_FILTER_LEGACY1 since 2.6.2) FT_Library_SetLcdFilter \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdFilter ( FT_Library library, FT_LcdFilter filter ); This function is used to change filter applied to LCD decimated bitmaps, like the ones used when calling FT_Render_Glyph with FT_RENDER_MODE_LCD or FT_RENDER_MODE_LCD_V . input library A handle to the target library instance. filter The filter type. You can use FT_LCD_FILTER_NONE here to disable this feature, or FT_LCD_FILTER_DEFAULT to use a default filter that should work well on most LCD screens. return FreeType error code. 0 means success. note Since 2.10.3 the LCD filtering is enabled with FT_LCD_FILTER_DEFAULT . It is no longer necessary to call this function explicitly except to choose a different filter or disable filtering altogether with FT_LCD_FILTER_NONE . This function does nothing but returns FT_Err_Unimplemented_Feature if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library. since 2.3.0 FT_Library_SetLcdFilterWeights \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdFilterWeights ( FT_Library library, unsigned char *weights ); This function can be used to enable LCD filter with custom weights, instead of using presets in FT_Library_SetLcdFilter . input library A handle to the target library instance. weights A pointer to an array; the function copies the first five bytes and uses them to specify the filter weights in 1/256th units. return FreeType error code. 0 means success. note This function does nothing but returns FT_Err_Unimplemented_Feature if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library. LCD filter weights can also be set per face using FT_Face_Properties with FT_PARAM_TAG_LCD_FILTER_WEIGHTS . since 2.4.0 FT_LcdFiveTapFilter \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). # define FT_LCD_FILTER_FIVE_TAPS 5 typedef FT_Byte FT_LcdFiveTapFilter [FT_LCD_FILTER_FIVE_TAPS]; A typedef for passing the five LCD filter weights to FT_Face_Properties within an FT_Parameter structure. since 2.8 FT_Library_SetLcdGeometry \u00b6 Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdGeometry ( FT_Library library, FT_Vector sub[3] ); This function can be used to modify default positions of color subpixels, which controls Harmony LCD rendering. input library A handle to the target library instance. sub A pointer to an array of 3 vectors in 26.6 fractional pixel format; the function modifies the default values, see the note below. return FreeType error code. 0 means success. note Subpixel geometry examples: {{-21, 0}, {0, 0}, {21, 0}} is the default, corresponding to 3 color stripes shifted by a third of a pixel. This could be an RGB panel. {{21, 0}, {0, 0}, {-21, 0}} looks the same as the default but can specify a BGR panel instead, while keeping the bitmap in the same RGB888 format. {{0, 21}, {0, 0}, {0, -21}} is the vertical RGB, but the bitmap stays RGB888 as a result. {{-11, 16}, {-11, -16}, {22, 0}} is a certain PenTile arrangement. This function does nothing and returns FT_Err_Unimplemented_Feature in the context of ClearType-style subpixel rendering when FT_CONFIG_OPTION_SUBPIXEL_RENDERING is defined in your build of the library. since 2.10.0","title":"Subpixel Rendering"},{"location":"ft2-lcd_rendering.html#subpixel-rendering","text":"","title":"Subpixel Rendering"},{"location":"ft2-lcd_rendering.html#synopsis","text":"FreeType provides two alternative subpixel rendering technologies. Should you define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your ftoption.h file, this enables ClearType-style rendering. Otherwise, Harmony LCD rendering is enabled. These technologies are controlled differently and API described below, although always available, performs its function when appropriate method is enabled and does nothing otherwise. ClearType-style LCD rendering exploits the color-striped structure of LCD pixels, increasing the available resolution in the direction of the stripe (usually horizontal RGB) by a factor of 3. Using the subpixel coverages unfiltered can create severe color fringes especially when rendering thin features. Indeed, to produce black-on-white text, the nearby color subpixels must be dimmed evenly. Therefore, an equalizing 5-tap FIR filter should be applied to subpixel coverages regardless of pixel boundaries and should have these properties: It should be symmetrical, like { a, b, c, b, a }, to avoid any shifts in appearance. It should be color-balanced, meaning a + b = c, to reduce color fringes by distributing the computed coverage for one subpixel to all subpixels equally. It should be normalized, meaning 2a + 2b + c = 1.0 to maintain overall brightness. Boxy 3-tap filter {0, \u2153, \u2153, \u2153, 0} is sharper but is less forgiving of non-ideal gamma curves of a screen (and viewing angles), beveled filters are fuzzier but more tolerant. Use the FT_Library_SetLcdFilter or FT_Library_SetLcdFilterWeights API to specify a low-pass filter, which is then applied to subpixel-rendered bitmaps generated through FT_Render_Glyph . Harmony LCD rendering is suitable to panels with any regular subpixel structure, not just monitors with 3 color striped subpixels, as long as the color subpixels have fixed positions relative to the pixel center. In this case, each color channel can be rendered separately after shifting the outline opposite to the subpixel shift so that the coverage maps are aligned. This method is immune to color fringes because the shifts do not change integral coverage. The subpixel geometry must be specified by xy-coordinates for each subpixel. By convention they may come in the RGB order: {{-\u2153, 0}, {0, 0}, {\u2153, 0}} for standard RGB striped panel or {{-\u2159, \u00bc}, {-\u2159, -\u00bc}, {\u2153, 0}} for a certain PenTile panel. Use the FT_Library_SetLcdGeometry API to specify subpixel positions. If one follows the RGB order convention, the same order applies to the resulting FT_PIXEL_MODE_LCD and FT_PIXEL_MODE_LCD_V bitmaps. Note, however, that the coordinate frame for the latter must be rotated clockwise. Harmony with default LCD geometry is equivalent to ClearType with light filter. As a result of ClearType filtering or Harmony shifts, the resulting dimensions of LCD bitmaps can be slightly wider or taller than the dimensions the original outline with regard to the pixel grid. For example, for FT_RENDER_MODE_LCD , the filter adds 2 subpixels to the left, and 2 subpixels to the right. The bitmap offset values are adjusted accordingly, so clients shouldn't need to modify their layout and glyph positioning code when enabling the filter. The ClearType and Harmony rendering is applicable to glyph bitmaps rendered through FT_Render_Glyph , FT_Load_Glyph , FT_Load_Char , and FT_Glyph_To_Bitmap , when FT_RENDER_MODE_LCD or FT_RENDER_MODE_LCD_V is specified. This API does not control FT_Outline_Render and FT_Outline_Get_Bitmap . The described algorithms can completely remove color artefacts when combined with gamma-corrected alpha blending in linear space. Each of the 3 alpha values (subpixels) must by independently used to blend one color channel. That is, red alpha blends the red channel of the text color with the red channel of the background pixel.","title":"Synopsis"},{"location":"ft2-lcd_rendering.html#ft_lcdfilter","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). typedef enum FT_LcdFilter_ { FT_LCD_FILTER_NONE = 0, FT_LCD_FILTER_DEFAULT = 1, FT_LCD_FILTER_LIGHT = 2, FT_LCD_FILTER_LEGACY1 = 3, FT_LCD_FILTER_LEGACY = 16, FT_LCD_FILTER_MAX /* do not remove */ } FT_LcdFilter ; A list of values to identify various types of LCD filters.","title":"FT_LcdFilter"},{"location":"ft2-lcd_rendering.html#ft_library_setlcdfilter","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdFilter ( FT_Library library, FT_LcdFilter filter ); This function is used to change filter applied to LCD decimated bitmaps, like the ones used when calling FT_Render_Glyph with FT_RENDER_MODE_LCD or FT_RENDER_MODE_LCD_V .","title":"FT_Library_SetLcdFilter"},{"location":"ft2-lcd_rendering.html#ft_library_setlcdfilterweights","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdFilterWeights ( FT_Library library, unsigned char *weights ); This function can be used to enable LCD filter with custom weights, instead of using presets in FT_Library_SetLcdFilter .","title":"FT_Library_SetLcdFilterWeights"},{"location":"ft2-lcd_rendering.html#ft_lcdfivetapfilter","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). # define FT_LCD_FILTER_FIVE_TAPS 5 typedef FT_Byte FT_LcdFiveTapFilter [FT_LCD_FILTER_FIVE_TAPS]; A typedef for passing the five LCD filter weights to FT_Face_Properties within an FT_Parameter structure.","title":"FT_LcdFiveTapFilter"},{"location":"ft2-lcd_rendering.html#ft_library_setlcdgeometry","text":"Defined in FT_LCD_FILTER_H (freetype/ftlcdfil.h). FT_EXPORT( FT_Error ) FT_Library_SetLcdGeometry ( FT_Library library, FT_Vector sub[3] ); This function can be used to modify default positions of color subpixels, which controls Harmony LCD rendering.","title":"FT_Library_SetLcdGeometry"},{"location":"ft2-list_processing.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb List Processing List Processing \u00b6 Synopsis \u00b6 This section contains various definitions related to list processing using doubly-linked nodes. FT_List \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListRec_* FT_List ; A handle to a list record (see FT_ListRec ). FT_ListNode \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListNodeRec_* FT_ListNode ; Many elements and objects in FreeType are listed through an FT_List record (see FT_ListRec ). As its name suggests, an FT_ListNode is a handle to a single list element. FT_ListRec \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListRec_ { FT_ListNode head; FT_ListNode tail; } FT_ListRec ; A structure used to hold a simple doubly-linked list. These are used in many parts of FreeType. fields head The head (first element) of doubly-linked list. tail The tail (last element) of doubly-linked list. FT_ListNodeRec \u00b6 Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListNodeRec_ { FT_ListNode prev; FT_ListNode next; void * data; } FT_ListNodeRec ; A structure used to hold a single list element. fields prev The previous element in the list. NULL if first. next The next element in the list. NULL if last. data A typeless pointer to the listed object. FT_List_Add \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Add ( FT_List list, FT_ListNode node ); Append an element to the end of a list. inout list A pointer to the parent list. node The node to append. FT_List_Insert \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Insert ( FT_List list, FT_ListNode node ); Insert an element at the head of a list. inout list A pointer to parent list. node The node to insert. FT_List_Find \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( FT_ListNode ) FT_List_Find ( FT_List list, void * data ); Find 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_List_Remove \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Remove ( FT_List list, FT_ListNode node ); Remove 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_List_Up \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Up ( FT_List list, FT_ListNode node ); Move 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_List_Iterate \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( FT_Error ) FT_List_Iterate ( FT_List list, FT_List_Iterator iterator, void * user ); Parse 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 iterator function, called on each node of the list. user A user-supplied field that is passed as the second argument to the iterator. return The result (a FreeType error code) of the last iterator call. FT_List_Iterator \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). typedef FT_Error (* FT_List_Iterator )( FT_ListNode node, void * user ); An FT_List iterator function that 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. FT_List_Finalize \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Finalize ( FT_List list, FT_List_Destructor destroy, FT_Memory memory, void * user ); Destroy 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. Set this to NULL if not needed. memory The current memory object that handles deallocation. user A user-supplied field that is passed as the last argument to the destructor. note This function expects that all nodes added by FT_List_Add or FT_List_Insert have been dynamically allocated. FT_List_Destructor \u00b6 Defined in FT_LIST_H (freetype/ftlist.h). typedef void (* FT_List_Destructor )( FT_Memory memory, void * data, void * user ); An FT_List iterator function that 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.","title":"List Processing"},{"location":"ft2-list_processing.html#list-processing","text":"","title":"List Processing"},{"location":"ft2-list_processing.html#synopsis","text":"This section contains various definitions related to list processing using doubly-linked nodes.","title":"Synopsis"},{"location":"ft2-list_processing.html#ft_list","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListRec_* FT_List ; A handle to a list record (see FT_ListRec ).","title":"FT_List"},{"location":"ft2-list_processing.html#ft_listnode","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListNodeRec_* FT_ListNode ; Many elements and objects in FreeType are listed through an FT_List record (see FT_ListRec ). As its name suggests, an FT_ListNode is a handle to a single list element.","title":"FT_ListNode"},{"location":"ft2-list_processing.html#ft_listrec","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListRec_ { FT_ListNode head; FT_ListNode tail; } FT_ListRec ; A structure used to hold a simple doubly-linked list. These are used in many parts of FreeType.","title":"FT_ListRec"},{"location":"ft2-list_processing.html#ft_listnoderec","text":"Defined in FT_TYPES_H (freetype/fttypes.h). typedef struct FT_ListNodeRec_ { FT_ListNode prev; FT_ListNode next; void * data; } FT_ListNodeRec ; A structure used to hold a single list element.","title":"FT_ListNodeRec"},{"location":"ft2-list_processing.html#ft_list_add","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Add ( FT_List list, FT_ListNode node ); Append an element to the end of a list.","title":"FT_List_Add"},{"location":"ft2-list_processing.html#ft_list_insert","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Insert ( FT_List list, FT_ListNode node ); Insert an element at the head of a list.","title":"FT_List_Insert"},{"location":"ft2-list_processing.html#ft_list_find","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( FT_ListNode ) FT_List_Find ( FT_List list, void * data ); Find the list node for a given listed object.","title":"FT_List_Find"},{"location":"ft2-list_processing.html#ft_list_remove","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Remove ( FT_List list, FT_ListNode node ); Remove a node from a list. This function doesn't check whether the node is in the list!","title":"FT_List_Remove"},{"location":"ft2-list_processing.html#ft_list_up","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Up ( FT_List list, FT_ListNode node ); Move a node to the head/top of a list. Used to maintain LRU lists.","title":"FT_List_Up"},{"location":"ft2-list_processing.html#ft_list_iterate","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( FT_Error ) FT_List_Iterate ( FT_List list, FT_List_Iterator iterator, void * user ); Parse 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.","title":"FT_List_Iterate"},{"location":"ft2-list_processing.html#ft_list_iterator","text":"Defined in FT_LIST_H (freetype/ftlist.h). typedef FT_Error (* FT_List_Iterator )( FT_ListNode node, void * user ); An FT_List iterator function that is called during a list parse by FT_List_Iterate .","title":"FT_List_Iterator"},{"location":"ft2-list_processing.html#ft_list_finalize","text":"Defined in FT_LIST_H (freetype/ftlist.h). FT_EXPORT( void ) FT_List_Finalize ( FT_List list, FT_List_Destructor destroy, FT_Memory memory, void * user ); Destroy all elements in the list as well as the list itself.","title":"FT_List_Finalize"},{"location":"ft2-list_processing.html#ft_list_destructor","text":"Defined in FT_LIST_H (freetype/ftlist.h). typedef void (* FT_List_Destructor )( FT_Memory memory, void * data, void * user ); An FT_List iterator function that is called during a list finalization by FT_List_Finalize to destroy all elements in a given list.","title":"FT_List_Destructor"},{"location":"ft2-lzw.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb LZW Streams LZW Streams \u00b6 Synopsis \u00b6 In certain builds of the library, LZW compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a LZW stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of LZW-specific functions. FT_Stream_OpenLZW \u00b6 Defined in FT_LZW_H (freetype/ftlzw.h). FT_EXPORT( FT_Error ) FT_Stream_OpenLZW ( FT_Stream stream, FT_Stream source ); Open a new stream to parse LZW-compressed font files. This is mainly used to support the compressed *.pcf.Z fonts that come with XFree86. input stream The target embedding stream. source The source stream. return FreeType error code. 0 means success. note The source stream must be opened before calling this function. Calling the internal function FT_Stream_Close on the new stream will not call FT_Stream_Close on the source stream. None of the stream objects will be released to the heap. This function may return FT_Err_Unimplemented_Feature if your build of FreeType was not compiled with LZW support.","title":"LZW Streams"},{"location":"ft2-lzw.html#lzw-streams","text":"","title":"LZW Streams"},{"location":"ft2-lzw.html#synopsis","text":"In certain builds of the library, LZW compression recognition is automatically handled when calling FT_New_Face or FT_Open_Face . This means that if no font driver is capable of handling the raw compressed file, the library will try to open a LZW stream from it and re-open the face with it. The stream implementation is very basic and resets the decompression process each time seeking backwards is needed within the stream, which significantly undermines the performance. This section contains the declaration of LZW-specific functions.","title":"Synopsis"},{"location":"ft2-lzw.html#ft_stream_openlzw","text":"Defined in FT_LZW_H (freetype/ftlzw.h). FT_EXPORT( FT_Error ) FT_Stream_OpenLZW ( FT_Stream stream, FT_Stream source ); Open a new stream to parse LZW-compressed font files. This is mainly used to support the compressed *.pcf.Z fonts that come with XFree86.","title":"FT_Stream_OpenLZW"},{"location":"ft2-mac_specific.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Mac Specific Interface Mac Specific Interface \u00b6 Synopsis \u00b6 The following definitions are only available if FreeType is compiled on a Macintosh. FT_New_Face_From_FOND \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FOND ( FT_Library library, Handle fond, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a FOND resource. inout library A handle to the library resource. input fond A FOND resource. face_index Only supported for the -1 \u2018sanity check\u2019 special case. output aface A handle to a new face object. return FreeType error code. 0 means success. example This function can be used to create FT_Face objects from fonts that are installed in the system as follows. fond = GetResource( 'FOND', fontName ); error = FT_New_Face_From_FOND( library, fond, 0, &face ); FT_GetFile_From_Mac_Name \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_Name ( const char * fontName, FSSpec* pathSpec, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return an FSSpec for the disk file containing the named font. input fontName Mac OS name of the font (e.g., Times New Roman Bold). output pathSpec FSSpec to the file. For passing to FT_New_Face_From_FSSpec . face_index Index of the face. For passing to FT_New_Face_From_FSSpec . return FreeType error code. 0 means success. FT_GetFile_From_Mac_ATS_Name \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_ATS_Name ( const char * fontName, FSSpec* pathSpec, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return an FSSpec for the disk file containing the named font. input fontName Mac OS name of the font in ATS framework. output pathSpec FSSpec to the file. For passing to FT_New_Face_From_FSSpec . face_index Index of the face. For passing to FT_New_Face_From_FSSpec . return FreeType error code. 0 means success. FT_GetFilePath_From_Mac_ATS_Name \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFilePath_From_Mac_ATS_Name ( const char * fontName, UInt8* path, UInt32 maxPathSize, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return a pathname of the disk file and face index for given font name that is handled by ATS framework. input fontName Mac OS name of the font in ATS framework. output path Buffer to store pathname of the file. For passing to FT_New_Face . The client must allocate this buffer before calling this function. maxPathSize Lengths of the buffer path that client allocated. face_index Index of the face. For passing to FT_New_Face . return FreeType error code. 0 means success. FT_New_Face_From_FSSpec \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FSSpec ( FT_Library library, const FSSpec *spec, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a given resource and typeface index using an FSSpec to the font file. inout library A handle to the library resource. input spec FSSpec to the font file. face_index The index of the face within the resource. The first face has index 0. output aface A handle to a new face object. return FreeType error code. 0 means success. note FT_New_Face_From_FSSpec is identical to FT_New_Face except it accepts an FSSpec instead of a path. FT_New_Face_From_FSRef \u00b6 Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FSRef ( FT_Library library, const FSRef *ref, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a given resource and typeface index using an FSRef to the font file. inout library A handle to the library resource. input spec FSRef to the font file. face_index The index of the face within the resource. The first face has index 0. output aface A handle to a new face object. return FreeType error code. 0 means success. note FT_New_Face_From_FSRef is identical to FT_New_Face except it accepts an FSRef instead of a path.","title":"Mac Specific Interface"},{"location":"ft2-mac_specific.html#mac-specific-interface","text":"","title":"Mac Specific Interface"},{"location":"ft2-mac_specific.html#synopsis","text":"The following definitions are only available if FreeType is compiled on a Macintosh.","title":"Synopsis"},{"location":"ft2-mac_specific.html#ft_new_face_from_fond","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FOND ( FT_Library library, Handle fond, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a FOND resource.","title":"FT_New_Face_From_FOND"},{"location":"ft2-mac_specific.html#ft_getfile_from_mac_name","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_Name ( const char * fontName, FSSpec* pathSpec, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return an FSSpec for the disk file containing the named font.","title":"FT_GetFile_From_Mac_Name"},{"location":"ft2-mac_specific.html#ft_getfile_from_mac_ats_name","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFile_From_Mac_ATS_Name ( const char * fontName, FSSpec* pathSpec, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return an FSSpec for the disk file containing the named font.","title":"FT_GetFile_From_Mac_ATS_Name"},{"location":"ft2-mac_specific.html#ft_getfilepath_from_mac_ats_name","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_GetFilePath_From_Mac_ATS_Name ( const char * fontName, UInt8* path, UInt32 maxPathSize, FT_Long * face_index ) FT_DEPRECATED_ATTRIBUTE; Return a pathname of the disk file and face index for given font name that is handled by ATS framework.","title":"FT_GetFilePath_From_Mac_ATS_Name"},{"location":"ft2-mac_specific.html#ft_new_face_from_fsspec","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FSSpec ( FT_Library library, const FSSpec *spec, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a given resource and typeface index using an FSSpec to the font file.","title":"FT_New_Face_From_FSSpec"},{"location":"ft2-mac_specific.html#ft_new_face_from_fsref","text":"Defined in FT_MAC_H (freetype/ftmac.h). FT_EXPORT( FT_Error ) FT_New_Face_From_FSRef ( FT_Library library, const FSRef *ref, FT_Long face_index, FT_Face *aface ) FT_DEPRECATED_ATTRIBUTE; Create a new face object from a given resource and typeface index using an FSRef to the font file.","title":"FT_New_Face_From_FSRef"},{"location":"ft2-module_management.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Module Management Module Management \u00b6 Synopsis \u00b6 The definitions below are used to manage modules within FreeType. Internal and external modules can be added, upgraded, and removed at runtime. For example, an alternative renderer or proprietary font driver can be registered and prioritized. Additionally, some module properties can also be controlled. Here is a list of existing values of the module_name field in the FT_Module_Class structure. autofitter bdf cff gxvalid otvalid pcf pfr psaux pshinter psnames raster1 sfnt smooth truetype type1 type42 t1cid winfonts Note that the FreeType Cache sub-system is not a FreeType module. FT_Module \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_ModuleRec_* FT_Module ; A handle to a given FreeType module object. A module can be a font driver, a renderer, or anything else that provides services to the former. FT_Module_Constructor \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Error (* FT_Module_Constructor )( FT_Module module ); A function used to initialize (not create) a new module object. input module The module to initialize. FT_Module_Destructor \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef void (* FT_Module_Destructor )( FT_Module module ); A function used to finalize (not destroy) a given module object. input module The module to finalize. FT_Module_Requester \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Module_Interface (* FT_Module_Requester )( FT_Module module, const char * name ); A function used to query a given module for a specific interface. input module The module to be searched. name The name of the interface in the module. FT_Module_Class \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). 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 ; The module class descriptor. While being a public structure necessary for FreeType's module bookkeeping, most of the fields are essentially internal, not to be used directly by an application. 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, as a 16.16 fixed number (major.minor). Starts at version 2.0, i.e., 0x20000. module_interface A typeless pointer to a structure (which varies between different modules) that holds the module's interface functions. This is essentially what get_interface returns. module_init The initializing function. module_done The finalizing function. get_interface The interface requesting function. FT_Add_Module \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Add_Module ( FT_Library library, const FT_Module_Class * clazz ); Add 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_Get_Module \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Module ) FT_Get_Module ( FT_Library library, const char * module_name ); Find 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 FreeType's internal modules aren't documented very well, and you should look up the source code for details. FT_Remove_Module \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Remove_Module ( FT_Library library, FT_Module module ); Remove 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_Add_Default_Modules \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Add_Default_Modules ( FT_Library library ); Add 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_FACE_DRIVER_NAME \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). # define FT_FACE_DRIVER_NAME ( face ) \\ ( ( *FT_REINTERPRET_CAST( FT_Module_Class **, \\ ( face )->driver ) )->module_name ) A macro that retrieves the name of a font driver from a face object. note The font driver name is a valid module_name for FT_Property_Set and FT_Property_Get . This is not the same as FT_Get_Font_Format . since 2.11 FT_Property_Set \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Property_Set ( FT_Library library, const FT_String * module_name, const FT_String * property_name, const void * value ); Set a property for a given module. input library A handle to the library the module is part of. module_name The module name. property_name The property name. Properties are described in section \u2018 Driver properties \u2019. Note that only a few modules have properties. value A generic pointer to a variable or structure that gives the new value of the property. The exact definition of value is dependent on the property; see section \u2018 Driver properties \u2019. return FreeType error code. 0 means success. note If module_name isn't a valid module name, or property_name doesn't specify a valid property, or if value doesn't represent a valid value for the given property, an error is returned. The following example sets property \u2018bar\u2019 (a simple integer) in module \u2018foo\u2019 to value 1. FT_UInt bar; bar = 1; FT_Property_Set( library, \"foo\", \"bar\", &bar ); Note that the FreeType Cache sub-system doesn't recognize module property changes. To avoid glyph lookup confusion within the cache you should call FTC_Manager_Reset to completely flush the cache if a module property gets changed after FTC_Manager_New has been called. It is not possible to set properties of the FreeType Cache sub-system itself with FT_Property_Set; use ?FTC_Property_Set? instead. since 2.4.11 FT_Property_Get \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Property_Get ( FT_Library library, const FT_String * module_name, const FT_String * property_name, void * value ); Get a module's property value. input library A handle to the library the module is part of. module_name The module name. property_name The property name. Properties are described in section \u2018 Driver properties \u2019. inout value A generic pointer to a variable or structure that gives the value of the property. The exact definition of value is dependent on the property; see section \u2018 Driver properties \u2019. return FreeType error code. 0 means success. note If module_name isn't a valid module name, or property_name doesn't specify a valid property, or if value doesn't represent a valid value for the given property, an error is returned. The following example gets property \u2018baz\u2019 (a range) in module \u2018foo\u2019. typedef range_ { FT_Int32 min; FT_Int32 max; } range; range baz; FT_Property_Get( library, \"foo\", \"baz\", &baz ); It is not possible to retrieve properties of the FreeType Cache sub-system with FT_Property_Get; use ?FTC_Property_Get? instead. since 2.4.11 FT_Set_Default_Properties \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Set_Default_Properties ( FT_Library library ); If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is set, this function reads the FREETYPE_PROPERTIES environment variable to control driver properties. See section \u2018 Driver properties \u2019 for more. If the compilation option is not set, this function does nothing. FREETYPE_PROPERTIES has the following syntax form (broken here into multiple lines for better readability). <optional whitespace> <module-name1> ':' <property-name1> '=' <property-value1> <whitespace> <module-name2> ':' <property-name2> '=' <property-value2> ... Example: FREETYPE_PROPERTIES=truetype:interpreter-version=35 \\ cff:no-stem-darkening=0 inout library A handle to a new library object. since 2.8 FT_New_Library \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_New_Library ( FT_Memory memory, FT_Library *alibrary ); 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. Note, however, that the used FT_Memory structure is expected to remain valid for the life of the FT_Library object. Normally, you would call this function (followed by a call to FT_Add_Default_Modules or a series of calls to FT_Add_Module , and a call to FT_Set_Default_Properties ) instead of FT_Init_FreeType to initialize the FreeType library. Don't use FT_Done_FreeType but FT_Done_Library to destroy a library instance. 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. note See the discussion of reference counters in the description of FT_Reference_Library . FT_Done_Library \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Done_Library ( FT_Library library ); Discard 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. note See the discussion of reference counters in the description of FT_Reference_Library . FT_Reference_Library \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Reference_Library ( FT_Library library ); A counter gets initialized to 1 at the time an FT_Library structure is created. This function increments the counter. FT_Done_Library then only destroys a library if the counter is 1, otherwise it simply decrements the counter. This function helps in managing life-cycles of structures that reference FT_Library objects. input library A handle to a target library object. return FreeType error code. 0 means success. since 2.4.2 FT_Renderer \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_RendererRec_* FT_Renderer ; A handle to a given FreeType renderer. A renderer is a module in charge of converting a glyph's outline image to a bitmap. It supports a single glyph image format, and one or more target surface depths. FT_Renderer_Class \u00b6 Defined in FT_RENDER_H (freetype/ftrender.h). typedef struct FT_Renderer_Class_ { FT_Module_Class root; FT_Glyph_Format glyph_format; FT_Renderer_RenderFunc render_glyph; FT_Renderer_TransformFunc transform_glyph; FT_Renderer_GetCBoxFunc get_glyph_cbox; FT_Renderer_SetModeFunc set_mode; FT_Raster_Funcs * raster_class; } FT_Renderer_Class ; The renderer module class descriptor. fields root The root FT_Module_Class fields. glyph_format The glyph image format this renderer handles. render_glyph A method used to render the image that is in a given glyph slot into a bitmap. transform_glyph A method used to transform the image that is in a given glyph slot. get_glyph_cbox A method used to access the glyph's cbox. set_mode A method used to pass additional parameters. raster_class For FT_GLYPH_FORMAT_OUTLINE renderers only. This is a pointer to its raster's class. FT_Get_Renderer \u00b6 Defined in FT_RENDER_H (freetype/ftrender.h). FT_EXPORT( FT_Renderer ) FT_Get_Renderer ( FT_Library library, FT_Glyph_Format format ); Retrieve the current renderer for a given glyph format. input library A handle to the library object. format The glyph format. return A renderer handle. 0 if none found. 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. To add a new renderer, simply use FT_Add_Module . To retrieve a renderer by its name, use FT_Get_Module . FT_Set_Renderer \u00b6 Defined in FT_RENDER_H (freetype/ftrender.h). FT_EXPORT( FT_Error ) FT_Set_Renderer ( FT_Library library, FT_Renderer renderer, FT_UInt num_params, FT_Parameter * parameters ); Set the current renderer to use, and set additional mode. inout library A handle to the library object. input renderer A handle to the renderer object. num_params The number of additional parameters. parameters Additional parameters. return FreeType error code. 0 means success. note In case of success, the renderer will be used to convert glyph images in the renderer's known format into bitmaps. This doesn't change the current renderer for other formats. Currently, no FreeType renderer module uses parameters ; you should thus always pass NULL as the value. FT_Set_Debug_Hook \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Set_Debug_Hook ( FT_Library library, FT_UInt hook_index, FT_DebugHook_Func debug_hook ); Set a debug hook function for debugging the interpreter of a font format. While this is a public API function, an application needs access to FreeType's internal header files to do something useful. Have a look at the source code of the ttdebug FreeType demo program for an example of its usage. inout library A handle to the library object. input hook_index The index of the debug hook. You should use defined enumeration macros like FT_DEBUG_HOOK_TRUETYPE . debug_hook The function used to debug the interpreter. note Currently, four debug hook slots are available, but only one (for the TrueType interpreter) is defined. FT_Driver \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_DriverRec_* FT_Driver ; A handle to a given FreeType font driver object. A font driver is a module capable of creating faces from font files. FT_DebugHook_Func \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Error (* FT_DebugHook_Func )( void * arg ); A drop-in replacement (or rather a wrapper) for the bytecode or charstring interpreter's main loop function. Its job is essentially to activate debug mode to enforce single-stepping, to call the main loop function to interpret the next opcode, and to show the changed context to the user. An example for such a main loop function is TT_RunIns (declared in FreeType's internal header file src/truetype/ttinterp.h ). Have a look at the source code of the ttdebug FreeType demo program for an example of a drop-in replacement. inout arg A typeless pointer, to be cast to the main loop function's data structure (which depends on the font module). For TrueType fonts it is bytecode interpreter's execution context, TT_ExecContext , which is declared in FreeType's internal header file tttypes.h . FT_DEBUG_HOOK_XXX \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). # define FT_DEBUG_HOOK_TRUETYPE 0 A list of named debug hook indices. values FT_DEBUG_HOOK_TRUETYPE This hook index identifies the TrueType bytecode debugger.","title":"Module Management"},{"location":"ft2-module_management.html#module-management","text":"","title":"Module Management"},{"location":"ft2-module_management.html#synopsis","text":"The definitions below are used to manage modules within FreeType. Internal and external modules can be added, upgraded, and removed at runtime. For example, an alternative renderer or proprietary font driver can be registered and prioritized. Additionally, some module properties can also be controlled. Here is a list of existing values of the module_name field in the FT_Module_Class structure. autofitter bdf cff gxvalid otvalid pcf pfr psaux pshinter psnames raster1 sfnt smooth truetype type1 type42 t1cid winfonts Note that the FreeType Cache sub-system is not a FreeType module.","title":"Synopsis"},{"location":"ft2-module_management.html#ft_module","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_ModuleRec_* FT_Module ; A handle to a given FreeType module object. A module can be a font driver, a renderer, or anything else that provides services to the former.","title":"FT_Module"},{"location":"ft2-module_management.html#ft_module_constructor","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Error (* FT_Module_Constructor )( FT_Module module ); A function used to initialize (not create) a new module object.","title":"FT_Module_Constructor"},{"location":"ft2-module_management.html#ft_module_destructor","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef void (* FT_Module_Destructor )( FT_Module module ); A function used to finalize (not destroy) a given module object.","title":"FT_Module_Destructor"},{"location":"ft2-module_management.html#ft_module_requester","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Module_Interface (* FT_Module_Requester )( FT_Module module, const char * name ); A function used to query a given module for a specific interface.","title":"FT_Module_Requester"},{"location":"ft2-module_management.html#ft_module_class","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). 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 ; The module class descriptor. While being a public structure necessary for FreeType's module bookkeeping, most of the fields are essentially internal, not to be used directly by an application.","title":"FT_Module_Class"},{"location":"ft2-module_management.html#ft_add_module","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Add_Module ( FT_Library library, const FT_Module_Class * clazz ); Add a new module to a given library instance.","title":"FT_Add_Module"},{"location":"ft2-module_management.html#ft_get_module","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Module ) FT_Get_Module ( FT_Library library, const char * module_name ); Find a module by its name.","title":"FT_Get_Module"},{"location":"ft2-module_management.html#ft_remove_module","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Remove_Module ( FT_Library library, FT_Module module ); Remove a given module from a library instance.","title":"FT_Remove_Module"},{"location":"ft2-module_management.html#ft_add_default_modules","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Add_Default_Modules ( FT_Library library ); Add 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).","title":"FT_Add_Default_Modules"},{"location":"ft2-module_management.html#ft_face_driver_name","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). # define FT_FACE_DRIVER_NAME ( face ) \\ ( ( *FT_REINTERPRET_CAST( FT_Module_Class **, \\ ( face )->driver ) )->module_name ) A macro that retrieves the name of a font driver from a face object.","title":"FT_FACE_DRIVER_NAME"},{"location":"ft2-module_management.html#ft_property_set","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Property_Set ( FT_Library library, const FT_String * module_name, const FT_String * property_name, const void * value ); Set a property for a given module.","title":"FT_Property_Set"},{"location":"ft2-module_management.html#ft_property_get","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Property_Get ( FT_Library library, const FT_String * module_name, const FT_String * property_name, void * value ); Get a module's property value.","title":"FT_Property_Get"},{"location":"ft2-module_management.html#ft_set_default_properties","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Set_Default_Properties ( FT_Library library ); If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is set, this function reads the FREETYPE_PROPERTIES environment variable to control driver properties. See section \u2018 Driver properties \u2019 for more. If the compilation option is not set, this function does nothing. FREETYPE_PROPERTIES has the following syntax form (broken here into multiple lines for better readability). <optional whitespace> <module-name1> ':' <property-name1> '=' <property-value1> <whitespace> <module-name2> ':' <property-name2> '=' <property-value2> ... Example: FREETYPE_PROPERTIES=truetype:interpreter-version=35 \\ cff:no-stem-darkening=0","title":"FT_Set_Default_Properties"},{"location":"ft2-module_management.html#ft_new_library","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_New_Library ( FT_Memory memory, FT_Library *alibrary ); 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. Note, however, that the used FT_Memory structure is expected to remain valid for the life of the FT_Library object. Normally, you would call this function (followed by a call to FT_Add_Default_Modules or a series of calls to FT_Add_Module , and a call to FT_Set_Default_Properties ) instead of FT_Init_FreeType to initialize the FreeType library. Don't use FT_Done_FreeType but FT_Done_Library to destroy a library instance.","title":"FT_New_Library"},{"location":"ft2-module_management.html#ft_done_library","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Done_Library ( FT_Library library ); Discard a given library object. This closes all drivers and discards all resource objects.","title":"FT_Done_Library"},{"location":"ft2-module_management.html#ft_reference_library","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_Error ) FT_Reference_Library ( FT_Library library ); A counter gets initialized to 1 at the time an FT_Library structure is created. This function increments the counter. FT_Done_Library then only destroys a library if the counter is 1, otherwise it simply decrements the counter. This function helps in managing life-cycles of structures that reference FT_Library objects.","title":"FT_Reference_Library"},{"location":"ft2-module_management.html#ft_renderer","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_RendererRec_* FT_Renderer ; A handle to a given FreeType renderer. A renderer is a module in charge of converting a glyph's outline image to a bitmap. It supports a single glyph image format, and one or more target surface depths.","title":"FT_Renderer"},{"location":"ft2-module_management.html#ft_renderer_class","text":"Defined in FT_RENDER_H (freetype/ftrender.h). typedef struct FT_Renderer_Class_ { FT_Module_Class root; FT_Glyph_Format glyph_format; FT_Renderer_RenderFunc render_glyph; FT_Renderer_TransformFunc transform_glyph; FT_Renderer_GetCBoxFunc get_glyph_cbox; FT_Renderer_SetModeFunc set_mode; FT_Raster_Funcs * raster_class; } FT_Renderer_Class ; The renderer module class descriptor.","title":"FT_Renderer_Class"},{"location":"ft2-module_management.html#ft_get_renderer","text":"Defined in FT_RENDER_H (freetype/ftrender.h). FT_EXPORT( FT_Renderer ) FT_Get_Renderer ( FT_Library library, FT_Glyph_Format format ); Retrieve the current renderer for a given glyph format.","title":"FT_Get_Renderer"},{"location":"ft2-module_management.html#ft_set_renderer","text":"Defined in FT_RENDER_H (freetype/ftrender.h). FT_EXPORT( FT_Error ) FT_Set_Renderer ( FT_Library library, FT_Renderer renderer, FT_UInt num_params, FT_Parameter * parameters ); Set the current renderer to use, and set additional mode.","title":"FT_Set_Renderer"},{"location":"ft2-module_management.html#ft_set_debug_hook","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( void ) FT_Set_Debug_Hook ( FT_Library library, FT_UInt hook_index, FT_DebugHook_Func debug_hook ); Set a debug hook function for debugging the interpreter of a font format. While this is a public API function, an application needs access to FreeType's internal header files to do something useful. Have a look at the source code of the ttdebug FreeType demo program for an example of its usage.","title":"FT_Set_Debug_Hook"},{"location":"ft2-module_management.html#ft_driver","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). typedef struct FT_DriverRec_* FT_Driver ; A handle to a given FreeType font driver object. A font driver is a module capable of creating faces from font files.","title":"FT_Driver"},{"location":"ft2-module_management.html#ft_debughook_func","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef FT_Error (* FT_DebugHook_Func )( void * arg ); A drop-in replacement (or rather a wrapper) for the bytecode or charstring interpreter's main loop function. Its job is essentially to activate debug mode to enforce single-stepping, to call the main loop function to interpret the next opcode, and to show the changed context to the user. An example for such a main loop function is TT_RunIns (declared in FreeType's internal header file src/truetype/ttinterp.h ). Have a look at the source code of the ttdebug FreeType demo program for an example of a drop-in replacement.","title":"FT_DebugHook_Func"},{"location":"ft2-module_management.html#ft_debug_hook_xxx","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). # define FT_DEBUG_HOOK_TRUETYPE 0 A list of named debug hook indices.","title":"FT_DEBUG_HOOK_XXX"},{"location":"ft2-multiple_masters.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Multiple Masters Multiple Masters \u00b6 Synopsis \u00b6 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. Besides Adobe MM fonts, the interface supports Apple's TrueType GX and OpenType variation fonts. Some of the routines only work with Adobe MM fonts, others will work with all three types. They are similar enough that a consistent interface makes sense. For Adobe MM fonts, macro FT_IS_SFNT returns false. For GX and OpenType variation fonts, it returns true. FT_MM_Axis \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_MM_Axis_ { FT_String * name; FT_Long minimum; FT_Long maximum; } FT_MM_Axis ; A structure to model a given axis in design space for Multiple Masters fonts. This structure can't be used for TrueType GX or OpenType variation fonts. fields name The axis's name. minimum The axis's minimum design coordinate. maximum The axis's maximum design coordinate. FT_Multi_Master \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Multi_Master_ { FT_UInt num_axis; FT_UInt num_designs; FT_MM_Axis axis[T1_MAX_MM_AXIS]; } FT_Multi_Master ; A structure to model the axes and space of a Multiple Masters font. This structure can't be used for TrueType GX or OpenType variation fonts. fields num_axis Number of axes. Cannot exceed 4. num_designs Number of designs; should be 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. FT_Var_Axis \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Var_Axis_ { FT_String * name; FT_Fixed minimum; FT_Fixed def; FT_Fixed maximum; FT_ULong tag; FT_UInt strid; } FT_Var_Axis ; A structure to model a given axis in design space for Multiple Masters, TrueType GX, and OpenType variation fonts. fields name The axis's name. Not always meaningful for TrueType GX or OpenType variation fonts. minimum The axis's minimum design coordinate. def The axis's default design coordinate. FreeType computes meaningful default values for Adobe MM fonts. maximum The axis's maximum design coordinate. tag The axis's tag (the equivalent to \u2018name\u2019 for TrueType GX and OpenType variation fonts). FreeType provides default values for Adobe MM fonts if possible. strid The axis name entry in the font's \u2018name\u2019 table. This is another (and often better) version of the \u2018name\u2019 field for TrueType GX or OpenType variation fonts. Not meaningful for Adobe MM fonts. note The fields minimum , def , and maximum are 16.16 fractional values for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the values are integers. FT_Var_Named_Style \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Var_Named_Style_ { FT_Fixed * coords; FT_UInt strid; FT_UInt psid; /* since 2.7.1 */ } FT_Var_Named_Style ; A structure to model a named instance in a TrueType GX or OpenType variation font. This structure can't be used for Adobe MM fonts. fields coords The design coordinates for this instance. This is an array with one entry for each axis. strid The entry in \u2018name\u2019 table identifying this instance. psid The entry in \u2018name\u2019 table identifying a PostScript name for this instance. Value 0xFFFF indicates a missing entry. FT_MM_Var \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_MM_Var_ { FT_UInt num_axis; FT_UInt num_designs; FT_UInt num_namedstyles; FT_Var_Axis * axis; FT_Var_Named_Style * namedstyle; } FT_MM_Var ; A structure to model the axes and space of an Adobe MM, TrueType GX, or OpenType variation font. Some fields are specific to one format and not to the others. fields num_axis The number of axes. The maximum value is 4 for Adobe MM fonts; no limit in TrueType GX or OpenType variation fonts. num_designs The number of designs; should be normally 2^num_axis for Adobe MM fonts. Not meaningful for TrueType GX or OpenType variation fonts (where every glyph could have a different number of designs). num_namedstyles The number of named styles; a \u2018named style\u2019 is a tuple of design coordinates that has a string ID (in the \u2018name\u2019 table) associated with it. The font can tell the user that, for example, [Weight=1.5,Width=1.1] is \u2018Bold\u2019. Another name for \u2018named style\u2019 is \u2018named instance\u2019. For Adobe Multiple Masters fonts, this value is always zero because the format does not support named styles. axis An axis descriptor table. TrueType GX and OpenType variation fonts contain slightly more data than Adobe MM fonts. Memory management of this pointer is done internally by FreeType. namedstyle A named style (instance) table. Only meaningful for TrueType GX and OpenType variation fonts. Memory management of this pointer is done internally by FreeType. FT_Get_Multi_Master \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Multi_Master ( FT_Face face, FT_Multi_Master *amaster ); Retrieve a variation descriptor of a given Adobe MM font. This function can't be used with TrueType GX or OpenType variation fonts. input face A handle to the source face. output amaster The Multiple Masters descriptor. return FreeType error code. 0 means success. FT_Get_MM_Var \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_Var ( FT_Face face, FT_MM_Var * *amaster ); Retrieve a variation descriptor for a given font. This function works with all supported variation formats. input face A handle to the source face. output amaster The variation descriptor. Allocates a data structure, which the user must deallocate with a call to FT_Done_MM_Var after use. return FreeType error code. 0 means success. FT_Done_MM_Var \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Done_MM_Var ( FT_Library library, FT_MM_Var *amaster ); Free the memory allocated by FT_Get_MM_Var . input library A handle of the face's parent library object that was used in the call to FT_Get_MM_Var to create amaster . return FreeType error code. 0 means success. FT_Set_MM_Design_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Long * coords ); For Adobe MM fonts, choose an interpolated font design through design coordinates. This function can't be used with TrueType GX or OpenType variation fonts. inout face A handle to the source face. input num_coords The number of available design coordinates. If it is larger than the number of axes, ignore the excess values. If it is smaller than the number of axes, use default values for the remaining axes. coords An array of design coordinates. return FreeType error code. 0 means success. note [Since 2.8.1] To reset all axes to the default values, call the function with num_coords set to zero and coords set to NULL . [Since 2.9] If num_coords is larger than zero, this function sets the FT_FACE_FLAG_VARIATION bit in FT_Face 's face_flags field (i.e., FT_IS_VARIATION will return true). If num_coords is zero, this bit flag gets unset. FT_Set_Var_Design_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Var_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Choose an interpolated font design through design coordinates. This function works with all supported variation formats. inout face A handle to the source face. input num_coords The number of available design coordinates. If it is larger than the number of axes, ignore the excess values. If it is smaller than the number of axes, use default values for the remaining axes. coords An array of design coordinates. return FreeType error code. 0 means success. note [Since 2.8.1] To reset all axes to the default values, call the function with num_coords set to zero and coords set to NULL . [Since 2.9] \u2018Default values\u2019 means the currently selected named instance (or the base font if no named instance is selected). [Since 2.9] If num_coords is larger than zero, this function sets the FT_FACE_FLAG_VARIATION bit in FT_Face 's face_flags field (i.e., FT_IS_VARIATION will return true). If num_coords is zero, this bit flag gets unset. FT_Get_Var_Design_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Get the design coordinates of the currently selected interpolated font. This function works with all supported variation formats. input face A handle to the source face. num_coords The number of design coordinates to retrieve. If it is larger than the number of axes, set the excess values to 0. output coords The design coordinates array. return FreeType error code. 0 means success. since 2.7.1 FT_Set_MM_Blend_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Choose an interpolated font design through normalized blend coordinates. This function works with all supported variation formats. inout face A handle to the source face. input num_coords The number of available design coordinates. If it is larger than the number of axes, ignore the excess values. If it is smaller than the number of axes, use default values for the remaining axes. coords The design coordinates array (each element must be between 0 and 1.0 for Adobe MM fonts, and between -1.0 and 1.0 for TrueType GX and OpenType variation fonts). return FreeType error code. 0 means success. note [Since 2.8.1] To reset all axes to the default values, call the function with num_coords set to zero and coords set to NULL . [Since 2.9] \u2018Default values\u2019 means the currently selected named instance (or the base font if no named instance is selected). [Since 2.9] If num_coords is larger than zero, this function sets the FT_FACE_FLAG_VARIATION bit in FT_Face 's face_flags field (i.e., FT_IS_VARIATION will return true). If num_coords is zero, this bit flag gets unset. FT_Get_MM_Blend_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Get the normalized blend coordinates of the currently selected interpolated font. This function works with all supported variation formats. input face A handle to the source face. num_coords The number of normalized blend coordinates to retrieve. If it is larger than the number of axes, set the excess values to 0.5 for Adobe MM fonts, and to 0 for TrueType GX and OpenType variation fonts. output coords The normalized blend coordinates array. return FreeType error code. 0 means success. since 2.7.1 FT_Set_Var_Blend_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Var_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); This is another name of FT_Set_MM_Blend_Coordinates . FT_Get_Var_Blend_Coordinates \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); This is another name of FT_Get_MM_Blend_Coordinates . since 2.7.1 FT_Set_MM_WeightVector \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_WeightVector ( FT_Face face, FT_UInt len, FT_Fixed * weightvector ); For Adobe MM fonts, choose an interpolated font design by directly setting the weight vector. This function can't be used with TrueType GX or OpenType variation fonts. inout face A handle to the source face. input len The length of the weight vector array. If it is larger than the number of designs, the extra values are ignored. If it is less than the number of designs, the remaining values are set to zero. weightvector An array representing the weight vector. return FreeType error code. 0 means success. note Adobe Multiple Master fonts limit the number of designs, and thus the length of the weight vector to 16. If len is zero and weightvector is NULL , the weight vector array is reset to the default values. The Adobe documentation also states that the values in the WeightVector array must total 1.0 \u00b1 0.001. In practice this does not seem to be enforced, so is not enforced here, either. since 2.10 FT_Get_MM_WeightVector \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_WeightVector ( FT_Face face, FT_UInt * len, FT_Fixed * weightvector ); For Adobe MM fonts, retrieve the current weight vector of the font. This function can't be used with TrueType GX or OpenType variation fonts. inout face A handle to the source face. len A pointer to the size of the array to be filled. If the size of the array is less than the number of designs, FT_Err_Invalid_Argument is returned, and len is set to the required size (the number of designs). If the size of the array is greater than the number of designs, the remaining entries are set to 0. On successful completion, len is set to the number of designs (i.e., the number of values written to the array). output weightvector An array to be filled. return FreeType error code. 0 means success. note Adobe Multiple Master fonts limit the number of designs, and thus the length of the WeightVector to 16. since 2.10 FT_VAR_AXIS_FLAG_XXX \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). # define FT_VAR_AXIS_FLAG_HIDDEN 1 A list of bit flags used in the return value of FT_Get_Var_Axis_Flags . values FT_VAR_AXIS_FLAG_HIDDEN The variation axis should not be exposed to user interfaces. since 2.8.1 FT_Get_Var_Axis_Flags \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Axis_Flags ( FT_MM_Var * master, FT_UInt axis_index, FT_UInt * flags ); Get the \u2018flags\u2019 field of an OpenType Variation Axis Record. Not meaningful for Adobe MM fonts ( *flags is always zero). input master The variation descriptor. axis_index The index of the requested variation axis. output flags The \u2018flags\u2019 field. See FT_VAR_AXIS_FLAG_XXX for possible values. return FreeType error code. 0 means success. since 2.8.1 FT_Set_Named_Instance \u00b6 Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Named_Instance ( FT_Face face, FT_UInt instance_index ); Set or change the current named instance. input face A handle to the source face. instance_index The index of the requested instance, starting with value 1. If set to value 0, FreeType switches to font access without a named instance. return FreeType error code. 0 means success. note The function uses the value of instance_index to set bits 16-30 of the face's face_index field. It also resets any variation applied to the font, and the FT_FACE_FLAG_VARIATION bit of the face's face_flags field gets reset to zero (i.e., FT_IS_VARIATION will return false). For Adobe MM fonts (which don't have named instances) this function simply resets the current face to the default instance. since 2.9","title":"Multiple Masters"},{"location":"ft2-multiple_masters.html#multiple-masters","text":"","title":"Multiple Masters"},{"location":"ft2-multiple_masters.html#synopsis","text":"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. Besides Adobe MM fonts, the interface supports Apple's TrueType GX and OpenType variation fonts. Some of the routines only work with Adobe MM fonts, others will work with all three types. They are similar enough that a consistent interface makes sense. For Adobe MM fonts, macro FT_IS_SFNT returns false. For GX and OpenType variation fonts, it returns true.","title":"Synopsis"},{"location":"ft2-multiple_masters.html#ft_mm_axis","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_MM_Axis_ { FT_String * name; FT_Long minimum; FT_Long maximum; } FT_MM_Axis ; A structure to model a given axis in design space for Multiple Masters fonts. This structure can't be used for TrueType GX or OpenType variation fonts.","title":"FT_MM_Axis"},{"location":"ft2-multiple_masters.html#ft_multi_master","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Multi_Master_ { FT_UInt num_axis; FT_UInt num_designs; FT_MM_Axis axis[T1_MAX_MM_AXIS]; } FT_Multi_Master ; A structure to model the axes and space of a Multiple Masters font. This structure can't be used for TrueType GX or OpenType variation fonts.","title":"FT_Multi_Master"},{"location":"ft2-multiple_masters.html#ft_var_axis","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Var_Axis_ { FT_String * name; FT_Fixed minimum; FT_Fixed def; FT_Fixed maximum; FT_ULong tag; FT_UInt strid; } FT_Var_Axis ; A structure to model a given axis in design space for Multiple Masters, TrueType GX, and OpenType variation fonts.","title":"FT_Var_Axis"},{"location":"ft2-multiple_masters.html#ft_var_named_style","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_Var_Named_Style_ { FT_Fixed * coords; FT_UInt strid; FT_UInt psid; /* since 2.7.1 */ } FT_Var_Named_Style ; A structure to model a named instance in a TrueType GX or OpenType variation font. This structure can't be used for Adobe MM fonts.","title":"FT_Var_Named_Style"},{"location":"ft2-multiple_masters.html#ft_mm_var","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). typedef struct FT_MM_Var_ { FT_UInt num_axis; FT_UInt num_designs; FT_UInt num_namedstyles; FT_Var_Axis * axis; FT_Var_Named_Style * namedstyle; } FT_MM_Var ; A structure to model the axes and space of an Adobe MM, TrueType GX, or OpenType variation font. Some fields are specific to one format and not to the others.","title":"FT_MM_Var"},{"location":"ft2-multiple_masters.html#ft_get_multi_master","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Multi_Master ( FT_Face face, FT_Multi_Master *amaster ); Retrieve a variation descriptor of a given Adobe MM font. This function can't be used with TrueType GX or OpenType variation fonts.","title":"FT_Get_Multi_Master"},{"location":"ft2-multiple_masters.html#ft_get_mm_var","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_Var ( FT_Face face, FT_MM_Var * *amaster ); Retrieve a variation descriptor for a given font. This function works with all supported variation formats.","title":"FT_Get_MM_Var"},{"location":"ft2-multiple_masters.html#ft_done_mm_var","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Done_MM_Var ( FT_Library library, FT_MM_Var *amaster ); Free the memory allocated by FT_Get_MM_Var .","title":"FT_Done_MM_Var"},{"location":"ft2-multiple_masters.html#ft_set_mm_design_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Long * coords ); For Adobe MM fonts, choose an interpolated font design through design coordinates. This function can't be used with TrueType GX or OpenType variation fonts.","title":"FT_Set_MM_Design_Coordinates"},{"location":"ft2-multiple_masters.html#ft_set_var_design_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Var_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Choose an interpolated font design through design coordinates. This function works with all supported variation formats.","title":"FT_Set_Var_Design_Coordinates"},{"location":"ft2-multiple_masters.html#ft_get_var_design_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Design_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Get the design coordinates of the currently selected interpolated font. This function works with all supported variation formats.","title":"FT_Get_Var_Design_Coordinates"},{"location":"ft2-multiple_masters.html#ft_set_mm_blend_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Choose an interpolated font design through normalized blend coordinates. This function works with all supported variation formats.","title":"FT_Set_MM_Blend_Coordinates"},{"location":"ft2-multiple_masters.html#ft_get_mm_blend_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); Get the normalized blend coordinates of the currently selected interpolated font. This function works with all supported variation formats.","title":"FT_Get_MM_Blend_Coordinates"},{"location":"ft2-multiple_masters.html#ft_set_var_blend_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Var_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); This is another name of FT_Set_MM_Blend_Coordinates .","title":"FT_Set_Var_Blend_Coordinates"},{"location":"ft2-multiple_masters.html#ft_get_var_blend_coordinates","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Blend_Coordinates ( FT_Face face, FT_UInt num_coords, FT_Fixed * coords ); This is another name of FT_Get_MM_Blend_Coordinates .","title":"FT_Get_Var_Blend_Coordinates"},{"location":"ft2-multiple_masters.html#ft_set_mm_weightvector","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_MM_WeightVector ( FT_Face face, FT_UInt len, FT_Fixed * weightvector ); For Adobe MM fonts, choose an interpolated font design by directly setting the weight vector. This function can't be used with TrueType GX or OpenType variation fonts.","title":"FT_Set_MM_WeightVector"},{"location":"ft2-multiple_masters.html#ft_get_mm_weightvector","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_MM_WeightVector ( FT_Face face, FT_UInt * len, FT_Fixed * weightvector ); For Adobe MM fonts, retrieve the current weight vector of the font. This function can't be used with TrueType GX or OpenType variation fonts.","title":"FT_Get_MM_WeightVector"},{"location":"ft2-multiple_masters.html#ft_var_axis_flag_xxx","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). # define FT_VAR_AXIS_FLAG_HIDDEN 1 A list of bit flags used in the return value of FT_Get_Var_Axis_Flags .","title":"FT_VAR_AXIS_FLAG_XXX"},{"location":"ft2-multiple_masters.html#ft_get_var_axis_flags","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Get_Var_Axis_Flags ( FT_MM_Var * master, FT_UInt axis_index, FT_UInt * flags ); Get the \u2018flags\u2019 field of an OpenType Variation Axis Record. Not meaningful for Adobe MM fonts ( *flags is always zero).","title":"FT_Get_Var_Axis_Flags"},{"location":"ft2-multiple_masters.html#ft_set_named_instance","text":"Defined in FT_MULTIPLE_MASTERS_H (freetype/ftmm.h). FT_EXPORT( FT_Error ) FT_Set_Named_Instance ( FT_Face face, FT_UInt instance_index ); Set or change the current named instance.","title":"FT_Set_Named_Instance"},{"location":"ft2-ot_svg_driver.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The SVG driver The SVG driver \u00b6 Synopsis \u00b6 By default, FreeType can only load the \u2018SVG \u2019 table of OpenType fonts if configuration macro FT_CONFIG_OPTION_SVG is defined. To make it render SVG glyphs, an external SVG rendering library is needed. All details on the interface between FreeType and the external library via function hooks can be found in section \u2018 OpenType SVG Fonts \u2019. The OT-SVG driver's module name is \u2018ot-svg\u2019; it supports a single property called svg-hooks , documented below in the \u2018 Driver properties \u2019 section.","title":"The SVG driver"},{"location":"ft2-ot_svg_driver.html#the-svg-driver","text":"","title":"The SVG driver"},{"location":"ft2-ot_svg_driver.html#synopsis","text":"By default, FreeType can only load the \u2018SVG \u2019 table of OpenType fonts if configuration macro FT_CONFIG_OPTION_SVG is defined. To make it render SVG glyphs, an external SVG rendering library is needed. All details on the interface between FreeType and the external library via function hooks can be found in section \u2018 OpenType SVG Fonts \u2019. The OT-SVG driver's module name is \u2018ot-svg\u2019; it supports a single property called svg-hooks , documented below in the \u2018 Driver properties \u2019 section.","title":"Synopsis"},{"location":"ft2-ot_validation.html","text":"FreeType \u00bb Docs \u00bb Miscellaneous \u00bb OpenType Validation OpenType Validation \u00b6 Synopsis \u00b6 This section contains the declaration of functions to validate some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH). FT_OpenType_Validate \u00b6 Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). FT_EXPORT( FT_Error ) FT_OpenType_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes *BASE_table, FT_Bytes *GDEF_table, FT_Bytes *GPOS_table, FT_Bytes *GSUB_table, FT_Bytes *JSTF_table ); Validate various OpenType tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming). input face A handle to the input face. validation_flags A bit field that specifies the tables to be validated. See FT_VALIDATE_OTXXX for possible values. output BASE_table A pointer to the BASE table. GDEF_table A pointer to the GDEF table. GPOS_table A pointer to the GPOS table. GSUB_table A pointer to the GSUB table. JSTF_table A pointer to the JSTF table. return FreeType error code. 0 means success. note This function only works with OpenType fonts, returning an error otherwise. After use, the application should deallocate the five tables with FT_OpenType_Free . A NULL value indicates that the table either doesn't exist in the font, or the application hasn't asked for validation. FT_OpenType_Free \u00b6 Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). FT_EXPORT( void ) FT_OpenType_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by OpenType validator. input face A handle to the input face. table The pointer to the buffer that is allocated by FT_OpenType_Validate . note This function must be used to free the buffer allocated by FT_OpenType_Validate only. FT_VALIDATE_OTXXX \u00b6 Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). # define FT_VALIDATE_BASE 0x0100 # define FT_VALIDATE_GDEF 0x0200 # define FT_VALIDATE_GPOS 0x0400 # define FT_VALIDATE_GSUB 0x0800 # define FT_VALIDATE_JSTF 0x1000 # define FT_VALIDATE_MATH 0x2000 # define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \\ FT_VALIDATE_GDEF | \\ FT_VALIDATE_GPOS | \\ FT_VALIDATE_GSUB | \\ FT_VALIDATE_JSTF | \\ FT_VALIDATE_MATH ) A list of bit-field constants used with FT_OpenType_Validate to indicate which OpenType tables should be validated. values FT_VALIDATE_BASE Validate BASE table. FT_VALIDATE_GDEF Validate GDEF table. FT_VALIDATE_GPOS Validate GPOS table. FT_VALIDATE_GSUB Validate GSUB table. FT_VALIDATE_JSTF Validate JSTF table. FT_VALIDATE_MATH Validate MATH table. FT_VALIDATE_OT Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).","title":"OpenType Validation"},{"location":"ft2-ot_validation.html#opentype-validation","text":"","title":"OpenType Validation"},{"location":"ft2-ot_validation.html#synopsis","text":"This section contains the declaration of functions to validate some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).","title":"Synopsis"},{"location":"ft2-ot_validation.html#ft_opentype_validate","text":"Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). FT_EXPORT( FT_Error ) FT_OpenType_Validate ( FT_Face face, FT_UInt validation_flags, FT_Bytes *BASE_table, FT_Bytes *GDEF_table, FT_Bytes *GPOS_table, FT_Bytes *GSUB_table, FT_Bytes *JSTF_table ); Validate various OpenType tables to assure that all offsets and indices are valid. The idea is that a higher-level library that actually does the text layout can access those tables without error checking (which can be quite time consuming).","title":"FT_OpenType_Validate"},{"location":"ft2-ot_validation.html#ft_opentype_free","text":"Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). FT_EXPORT( void ) FT_OpenType_Free ( FT_Face face, FT_Bytes table ); Free the buffer allocated by OpenType validator.","title":"FT_OpenType_Free"},{"location":"ft2-ot_validation.html#ft_validate_otxxx","text":"Defined in FT_OPENTYPE_VALIDATE_H (freetype/ftotval.h). # define FT_VALIDATE_BASE 0x0100 # define FT_VALIDATE_GDEF 0x0200 # define FT_VALIDATE_GPOS 0x0400 # define FT_VALIDATE_GSUB 0x0800 # define FT_VALIDATE_JSTF 0x1000 # define FT_VALIDATE_MATH 0x2000 # define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \\ FT_VALIDATE_GDEF | \\ FT_VALIDATE_GPOS | \\ FT_VALIDATE_GSUB | \\ FT_VALIDATE_JSTF | \\ FT_VALIDATE_MATH ) A list of bit-field constants used with FT_OpenType_Validate to indicate which OpenType tables should be validated.","title":"FT_VALIDATE_OTXXX"},{"location":"ft2-outline_processing.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Outline Processing Outline Processing \u00b6 Synopsis \u00b6 This section contains routines used to create and destroy scalable glyph images known as \u2018outlines\u2019. These can also be measured, transformed, and converted into bitmaps and pixmaps. FT_Outline \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; 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 \u2018off\u2019 the curve, i.e., a Bezier control point, while it is \u2018on\u2019 if set. Bit 1 is meaningful for \u2018off\u2019 points only. If set, it indicates a third-order Bezier arc control point; and a second-order control point if unset. If bit 2 is set, bits 5-7 contain the drop-out mode (as defined in the OpenType specification; the value is the same as the argument to the \u2018SCANMODE\u2019 instruction). Bits 3 and 4 are reserved for internal purposes. 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 \u20180\u2019 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_XXX . note The B/W rasterizer only checks bit 2 in the tags array for the first point of each contour. The drop-out mode as given with FT_OUTLINE_IGNORE_DROPOUTS , FT_OUTLINE_SMART_DROPOUTS , and FT_OUTLINE_INCLUDE_STUBS in flags is then overridden. FT_Outline_New \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_New ( FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline ); Create 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 maximum number of points within the outline. Must be smaller than or equal to 0xFFFF (65535). numContours The maximum number of contours within the outline. This value must be in the range 0 to numPoints . output anoutline A handle to the new outline. 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_Outline_Done \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Done ( FT_Library library, FT_Outline * outline ); Destroy 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 \u2018owner\u2019 field is not set, only the outline descriptor will be released. FT_Outline_Copy \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Copy ( const FT_Outline * source, FT_Outline *target ); Copy 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_Outline_Translate \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Translate ( const FT_Outline * outline, FT_Pos xOffset, FT_Pos yOffset ); Apply 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_Outline_Transform \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Transform ( const FT_Outline * outline, const FT_Matrix * matrix ); Apply 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_Outline_Embolden \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Embolden ( FT_Outline * outline, FT_Pos strength ); Embolden an outline. The new outline will be at most 4 times strength pixels wider and higher. You may think of the left and bottom borders as unchanged. Negative strength values to reduce the outline thickness are possible also. inout outline A handle to the target outline. input strength How strong the glyph is emboldened. Expressed in 26.6 pixel format. return FreeType error code. 0 means success. note The used algorithm to increase or decrease the thickness of the glyph doesn't change the number of points; this means that certain situations like acute angles or intersections are sometimes handled incorrectly. If you need \u2018better\u2019 metrics values you should call FT_Outline_Get_CBox or FT_Outline_Get_BBox . To get meaningful results, font scaling values must be set with functions like FT_Set_Char_Size before calling FT_Render_Glyph. example FT_Load_Glyph( face, index, FT_LOAD_DEFAULT ); if ( face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ) FT_Outline_Embolden( &face->glyph->outline, strength ); FT_Outline_EmboldenXY \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_EmboldenXY ( FT_Outline * outline, FT_Pos xstrength, FT_Pos ystrength ); Embolden an outline. The new outline will be xstrength pixels wider and ystrength pixels higher. Otherwise, it is similar to FT_Outline_Embolden , which uses the same strength in both directions. since 2.4.10 FT_Outline_Reverse \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Reverse ( FT_Outline * outline ); Reverse 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 function 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_Outline_Check \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Check ( FT_Outline * outline ); Check the contents of an outline descriptor. input outline A handle to a source outline. return FreeType error code. 0 means success. note An empty outline, or an outline with a single point only is also valid. FT_Outline_Get_CBox \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Get_CBox ( const FT_Outline * outline, FT_BBox *acbox ); Return an outline's \u2018control box\u2019. 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 that 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 \u2018ftbbox\u2019 component, which is dedicated to this single task. input outline A pointer to the source outline descriptor. output acbox The outline's control box. note See FT_Glyph_Get_CBox for a discussion of tricky fonts. FT_Outline_Get_BBox \u00b6 Defined in FT_BBOX_H (freetype/ftbbox.h). FT_EXPORT( FT_Error ) FT_Outline_Get_BBox ( FT_Outline * outline, FT_BBox *abbox ); Compute the exact bounding box of an outline. This is slower than computing the control box. However, it uses an advanced algorithm that returns very quickly when the two boxes coincide. Otherwise, the outline Bezier arcs are traversed 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. note If the font is tricky and the glyph has been loaded with FT_LOAD_NO_SCALE , the resulting BBox is meaningless. To get reasonable values for the BBox it is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting the BBox, which can be eventually converted back to font units. FT_Outline_Get_Bitmap \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Get_Bitmap ( FT_Library library, FT_Outline * outline, const FT_Bitmap *abitmap ); Render 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. inout 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! Consequently, the various fields in abitmap should be set accordingly. It will use the raster corresponding to the default glyph format. The value of the num_grays field in abitmap is ignored. If you select the gray-level rasterizer, and you want less than 256 gray levels, you have to use FT_Outline_Render directly. FT_Outline_Render \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Render ( FT_Library library, FT_Outline * outline, FT_Raster_Params * params ); Render an outline within a bitmap using the current scan-convert. input library A handle to a FreeType library object. outline A pointer to the source outline descriptor. inout params A pointer to an FT_Raster_Params structure used to describe the rendering operation. return FreeType error code. 0 means success. note This advanced function uses FT_Raster_Params as an argument. The field params.source will be set to outline before the scan converter is called, which means that the value you give to it is actually ignored. Either params.target must point to preallocated bitmap, or FT_RASTER_FLAG_DIRECT must be set in params.flags allowing FreeType rasterizer to be used for direct composition, translucency, etc. See FT_Raster_Params for more details. FT_Outline_Decompose \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Decompose ( FT_Outline * outline, const FT_Outline_Funcs * func_interface, void * user ); Walk over an outline's structure to decompose it into individual segments and Bezier arcs. This function also emits \u2018move to\u2019 operations to indicate the start of new contours in the outline. input outline A pointer to the source target. func_interface A table of \u2018emitters\u2019, i.e., function pointers called during decomposition to indicate path operations. inout user A typeless pointer that 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 success. note Degenerate contours, segments, and Bezier arcs may be reported. In most cases, it is best to filter these out before using the outline for stroking or other path modification purposes (which may cause degenerate segments to become non-degenrate and visible, like when stroke caps are used or the path is otherwise outset). Some glyph outlines may contain deliberate degenerate single points for mark attachement. Similarly, the function returns success for an empty outline also (doing nothing, this is, not calling any emitter); if necessary, you should filter this out, too. FT_Outline_Funcs \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; A structure to hold various function pointers used during outline decomposition in order to emit segments, conic, and cubic Beziers. fields move_to The \u2018move to\u2019 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' = (y << shift) - delta Set the values of shift and delta to 0 to get the original point coordinates. FT_Outline_MoveToFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_MoveToFunc )( const FT_Vector * to, void * user ); # define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc A function pointer type used to describe the signature of a \u2018move to\u2019 function during outline walking/decomposition. A \u2018move to\u2019 is emitted to start a new contour in an outline. input to A pointer to the target point of the \u2018move to\u2019. user A typeless pointer, which is passed from the caller of the decomposition function. return Error code. 0 means success. FT_Outline_LineToFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_LineToFunc )( const FT_Vector * to, void * user ); # define FT_Outline_LineTo_Func FT_Outline_LineToFunc A function pointer type used to describe the signature of a \u2018line to\u2019 function during outline walking/decomposition. A \u2018line to\u2019 is emitted to indicate a segment in the outline. input to A pointer to the target point of the \u2018line to\u2019. user A typeless pointer, which is passed from the caller of the decomposition function. return Error code. 0 means success. FT_Outline_ConicToFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_ConicToFunc )( const FT_Vector * control, const FT_Vector * to, void * user ); # define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc A function pointer type used to describe the signature of a \u2018conic to\u2019 function during outline walking or decomposition. A \u2018conic to\u2019 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. FT_Outline_CubicToFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_CubicToFunc )( const FT_Vector * control1, const FT_Vector * control2, const FT_Vector * to, void * user ); # define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc A function pointer type used to describe the signature of a \u2018cubic to\u2019 function during outline walking or decomposition. A \u2018cubic to\u2019 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. FT_Orientation \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). typedef enum FT_Orientation_ { FT_ORIENTATION_TRUETYPE = 0, FT_ORIENTATION_POSTSCRIPT = 1, FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE , FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT , FT_ORIENTATION_NONE } FT_Orientation ; A list of values used to describe an outline's contour orientation. The TrueType and PostScript specifications use different conventions to determine whether outline contours should be filled or unfilled. values FT_ORIENTATION_TRUETYPE According to the TrueType specification, clockwise contours must be filled, and counter-clockwise ones must be unfilled. FT_ORIENTATION_POSTSCRIPT According to the PostScript specification, counter-clockwise contours must be filled, and clockwise ones must be unfilled. FT_ORIENTATION_FILL_RIGHT This is identical to FT_ORIENTATION_TRUETYPE , but is used to remember that in TrueType, everything that is to the right of the drawing direction of a contour must be filled. FT_ORIENTATION_FILL_LEFT This is identical to FT_ORIENTATION_POSTSCRIPT , but is used to remember that in PostScript, everything that is to the left of the drawing direction of a contour must be filled. FT_ORIENTATION_NONE The orientation cannot be determined. That is, different parts of the glyph have different orientation. FT_Outline_Get_Orientation \u00b6 Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Orientation ) FT_Outline_Get_Orientation ( FT_Outline * outline ); This function analyzes a glyph outline and tries to compute its fill orientation (see FT_Orientation ). This is done by integrating the total area covered by the outline. The positive integral corresponds to the clockwise orientation and FT_ORIENTATION_POSTSCRIPT is returned. The negative integral corresponds to the counter-clockwise orientation and FT_ORIENTATION_TRUETYPE is returned. Note that this will return FT_ORIENTATION_TRUETYPE for empty outlines. input outline A handle to the source outline. return The orientation. FT_OUTLINE_XXX \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). # define FT_OUTLINE_NONE 0x0 # define FT_OUTLINE_OWNER 0x1 # define FT_OUTLINE_EVEN_ODD_FILL 0x2 # define FT_OUTLINE_REVERSE_FILL 0x4 # define FT_OUTLINE_IGNORE_DROPOUTS 0x8 # define FT_OUTLINE_SMART_DROPOUTS 0x10 # define FT_OUTLINE_INCLUDE_STUBS 0x20 # define FT_OUTLINE_OVERLAP 0x40 # define FT_OUTLINE_HIGH_PRECISION 0x100 # define FT_OUTLINE_SINGLE_PASS 0x200 /* these constants are deprecated; use the corresponding */ /* ` FT_OUTLINE_XXX ` values instead */ # 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 A list of bit-field constants used for the flags in an outline's 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 , and contours ) are \u2018owned\u2019 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 rasterizer). 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. 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. See below for more information. FT_OUTLINE_SMART_DROPOUTS Select smart dropout control. If unset, use simple dropout control. Ignored if FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more information. FT_OUTLINE_INCLUDE_STUBS If set, turn pixels on for \u2018stubs\u2019, otherwise exclude them. Ignored if FT_OUTLINE_IGNORE_DROPOUTS is set. See below for more information. FT_OUTLINE_OVERLAP [Since 2.10.3] This flag indicates that this outline contains overlapping contours and the anti-aliased renderer should perform oversampling to mitigate possible artifacts. This flag should not be set for well designed glyphs without overlaps because it quadruples the rendering time. 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. note The flags FT_OUTLINE_IGNORE_DROPOUTS , FT_OUTLINE_SMART_DROPOUTS , and FT_OUTLINE_INCLUDE_STUBS are ignored by the smooth rasterizer. There exists a second mechanism to pass the drop-out mode to the B/W rasterizer; see the tags field in FT_Outline . Please refer to the description of the \u2018SCANTYPE\u2019 instruction in the OpenType specification (in file ttinst1.doc ) how simple drop-outs, smart drop-outs, and stubs are defined.","title":"Outline Processing"},{"location":"ft2-outline_processing.html#outline-processing","text":"","title":"Outline Processing"},{"location":"ft2-outline_processing.html#synopsis","text":"This section contains routines used to create and destroy scalable glyph images known as \u2018outlines\u2019. These can also be measured, transformed, and converted into bitmaps and pixmaps.","title":"Synopsis"},{"location":"ft2-outline_processing.html#ft_outline","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; This structure is used to describe an outline to the scan-line converter.","title":"FT_Outline"},{"location":"ft2-outline_processing.html#ft_outline_new","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_New ( FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline ); Create a new outline of a given size.","title":"FT_Outline_New"},{"location":"ft2-outline_processing.html#ft_outline_done","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Done ( FT_Library library, FT_Outline * outline ); Destroy an outline created with FT_Outline_New .","title":"FT_Outline_Done"},{"location":"ft2-outline_processing.html#ft_outline_copy","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Copy ( const FT_Outline * source, FT_Outline *target ); Copy an outline into another one. Both objects must have the same sizes (number of points & number of contours) when this function is called.","title":"FT_Outline_Copy"},{"location":"ft2-outline_processing.html#ft_outline_translate","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Translate ( const FT_Outline * outline, FT_Pos xOffset, FT_Pos yOffset ); Apply a simple translation to the points of an outline.","title":"FT_Outline_Translate"},{"location":"ft2-outline_processing.html#ft_outline_transform","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Transform ( const FT_Outline * outline, const FT_Matrix * matrix ); Apply a simple 2x2 matrix to all of an outline's points. Useful for applying rotations, slanting, flipping, etc.","title":"FT_Outline_Transform"},{"location":"ft2-outline_processing.html#ft_outline_embolden","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Embolden ( FT_Outline * outline, FT_Pos strength ); Embolden an outline. The new outline will be at most 4 times strength pixels wider and higher. You may think of the left and bottom borders as unchanged. Negative strength values to reduce the outline thickness are possible also.","title":"FT_Outline_Embolden"},{"location":"ft2-outline_processing.html#ft_outline_emboldenxy","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_EmboldenXY ( FT_Outline * outline, FT_Pos xstrength, FT_Pos ystrength ); Embolden an outline. The new outline will be xstrength pixels wider and ystrength pixels higher. Otherwise, it is similar to FT_Outline_Embolden , which uses the same strength in both directions.","title":"FT_Outline_EmboldenXY"},{"location":"ft2-outline_processing.html#ft_outline_reverse","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Reverse ( FT_Outline * outline ); Reverse the drawing direction of an outline. This is used to ensure consistent fill conventions for mirrored glyphs.","title":"FT_Outline_Reverse"},{"location":"ft2-outline_processing.html#ft_outline_check","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Check ( FT_Outline * outline ); Check the contents of an outline descriptor.","title":"FT_Outline_Check"},{"location":"ft2-outline_processing.html#ft_outline_get_cbox","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( void ) FT_Outline_Get_CBox ( const FT_Outline * outline, FT_BBox *acbox ); Return an outline's \u2018control box\u2019. 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 that 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 \u2018ftbbox\u2019 component, which is dedicated to this single task.","title":"FT_Outline_Get_CBox"},{"location":"ft2-outline_processing.html#ft_outline_get_bbox","text":"Defined in FT_BBOX_H (freetype/ftbbox.h). FT_EXPORT( FT_Error ) FT_Outline_Get_BBox ( FT_Outline * outline, FT_BBox *abbox ); Compute the exact bounding box of an outline. This is slower than computing the control box. However, it uses an advanced algorithm that returns very quickly when the two boxes coincide. Otherwise, the outline Bezier arcs are traversed to extract their extrema.","title":"FT_Outline_Get_BBox"},{"location":"ft2-outline_processing.html#ft_outline_get_bitmap","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Get_Bitmap ( FT_Library library, FT_Outline * outline, const FT_Bitmap *abitmap ); Render an outline within a bitmap. The outline's image is simply OR-ed to the target bitmap.","title":"FT_Outline_Get_Bitmap"},{"location":"ft2-outline_processing.html#ft_outline_render","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Render ( FT_Library library, FT_Outline * outline, FT_Raster_Params * params ); Render an outline within a bitmap using the current scan-convert.","title":"FT_Outline_Render"},{"location":"ft2-outline_processing.html#ft_outline_decompose","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Error ) FT_Outline_Decompose ( FT_Outline * outline, const FT_Outline_Funcs * func_interface, void * user ); Walk over an outline's structure to decompose it into individual segments and Bezier arcs. This function also emits \u2018move to\u2019 operations to indicate the start of new contours in the outline.","title":"FT_Outline_Decompose"},{"location":"ft2-outline_processing.html#ft_outline_funcs","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; A structure to hold various function pointers used during outline decomposition in order to emit segments, conic, and cubic Beziers.","title":"FT_Outline_Funcs"},{"location":"ft2-outline_processing.html#ft_outline_movetofunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_MoveToFunc )( const FT_Vector * to, void * user ); # define FT_Outline_MoveTo_Func FT_Outline_MoveToFunc A function pointer type used to describe the signature of a \u2018move to\u2019 function during outline walking/decomposition. A \u2018move to\u2019 is emitted to start a new contour in an outline.","title":"FT_Outline_MoveToFunc"},{"location":"ft2-outline_processing.html#ft_outline_linetofunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_LineToFunc )( const FT_Vector * to, void * user ); # define FT_Outline_LineTo_Func FT_Outline_LineToFunc A function pointer type used to describe the signature of a \u2018line to\u2019 function during outline walking/decomposition. A \u2018line to\u2019 is emitted to indicate a segment in the outline.","title":"FT_Outline_LineToFunc"},{"location":"ft2-outline_processing.html#ft_outline_conictofunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_ConicToFunc )( const FT_Vector * control, const FT_Vector * to, void * user ); # define FT_Outline_ConicTo_Func FT_Outline_ConicToFunc A function pointer type used to describe the signature of a \u2018conic to\u2019 function during outline walking or decomposition. A \u2018conic to\u2019 is emitted to indicate a second-order Bezier arc in the outline.","title":"FT_Outline_ConicToFunc"},{"location":"ft2-outline_processing.html#ft_outline_cubictofunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Outline_CubicToFunc )( const FT_Vector * control1, const FT_Vector * control2, const FT_Vector * to, void * user ); # define FT_Outline_CubicTo_Func FT_Outline_CubicToFunc A function pointer type used to describe the signature of a \u2018cubic to\u2019 function during outline walking or decomposition. A \u2018cubic to\u2019 is emitted to indicate a third-order Bezier arc.","title":"FT_Outline_CubicToFunc"},{"location":"ft2-outline_processing.html#ft_orientation","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). typedef enum FT_Orientation_ { FT_ORIENTATION_TRUETYPE = 0, FT_ORIENTATION_POSTSCRIPT = 1, FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE , FT_ORIENTATION_FILL_LEFT = FT_ORIENTATION_POSTSCRIPT , FT_ORIENTATION_NONE } FT_Orientation ; A list of values used to describe an outline's contour orientation. The TrueType and PostScript specifications use different conventions to determine whether outline contours should be filled or unfilled.","title":"FT_Orientation"},{"location":"ft2-outline_processing.html#ft_outline_get_orientation","text":"Defined in FT_OUTLINE_H (freetype/ftoutln.h). FT_EXPORT( FT_Orientation ) FT_Outline_Get_Orientation ( FT_Outline * outline ); This function analyzes a glyph outline and tries to compute its fill orientation (see FT_Orientation ). This is done by integrating the total area covered by the outline. The positive integral corresponds to the clockwise orientation and FT_ORIENTATION_POSTSCRIPT is returned. The negative integral corresponds to the counter-clockwise orientation and FT_ORIENTATION_TRUETYPE is returned. Note that this will return FT_ORIENTATION_TRUETYPE for empty outlines.","title":"FT_Outline_Get_Orientation"},{"location":"ft2-outline_processing.html#ft_outline_xxx","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). # define FT_OUTLINE_NONE 0x0 # define FT_OUTLINE_OWNER 0x1 # define FT_OUTLINE_EVEN_ODD_FILL 0x2 # define FT_OUTLINE_REVERSE_FILL 0x4 # define FT_OUTLINE_IGNORE_DROPOUTS 0x8 # define FT_OUTLINE_SMART_DROPOUTS 0x10 # define FT_OUTLINE_INCLUDE_STUBS 0x20 # define FT_OUTLINE_OVERLAP 0x40 # define FT_OUTLINE_HIGH_PRECISION 0x100 # define FT_OUTLINE_SINGLE_PASS 0x200 /* these constants are deprecated; use the corresponding */ /* ` FT_OUTLINE_XXX ` values instead */ # 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 A list of bit-field constants used for the flags in an outline's flags field.","title":"FT_OUTLINE_XXX"},{"location":"ft2-parameter_tags.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb Parameter Tags Parameter Tags \u00b6 Synopsis \u00b6 This section contains macros for the FT_Parameter structure that are used with various functions to activate some special functionality or different behaviour of various components of FreeType. FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \u00b6 # define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \\ FT_MAKE_TAG ( 'i', 'g', 'p', 'f' ) /* this constant is deprecated */ # define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \\ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY A tag for FT_Parameter to make FT_Open_Face ignore typographic family names in the \u2018name\u2019 table (introduced in OpenType version 1.4). Use this for backward compatibility with legacy systems that have a four-faces-per-family restriction. since 2.8 FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \u00b6 # define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \\ FT_MAKE_TAG ( 'i', 'g', 'p', 's' ) /* this constant is deprecated */ # define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \\ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY A tag for FT_Parameter to make FT_Open_Face ignore typographic subfamily names in the \u2018name\u2019 table (introduced in OpenType version 1.4). Use this for backward compatibility with legacy systems that have a four-faces-per-family restriction. since 2.8 FT_PARAM_TAG_INCREMENTAL \u00b6 # define FT_PARAM_TAG_INCREMENTAL \\ FT_MAKE_TAG ( 'i', 'n', 'c', 'r' ) An FT_Parameter tag to be used with FT_Open_Face to indicate incremental glyph loading. FT_PARAM_TAG_IGNORE_SBIX \u00b6 # define FT_PARAM_TAG_IGNORE_SBIX \\ FT_MAKE_TAG ( 'i', 's', 'b', 'x' ) A tag for FT_Parameter to make FT_Open_Face ignore an \u2018sbix\u2019 table while loading a font. Use this if FT_FACE_FLAG_SBIX is set and you want to access the outline glyphs in the font. FT_PARAM_TAG_LCD_FILTER_WEIGHTS \u00b6 # define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \\ FT_MAKE_TAG ( 'l', 'c', 'd', 'f' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding argument specifies the five LCD filter weights for a given face (if using FT_LOAD_TARGET_LCD , for example), overriding the global default values or the values set up with FT_Library_SetLcdFilterWeights . since 2.8 FT_PARAM_TAG_RANDOM_SEED \u00b6 # define FT_PARAM_TAG_RANDOM_SEED \\ FT_MAKE_TAG ( 's', 'e', 'e', 'd' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding 32bit signed integer argument overrides the font driver's random seed value with a face-specific one; see random-seed . since 2.8 FT_PARAM_TAG_STEM_DARKENING \u00b6 # define FT_PARAM_TAG_STEM_DARKENING \\ FT_MAKE_TAG ( 'd', 'a', 'r', 'k' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding Boolean argument specifies whether to apply stem darkening, overriding the global default values or the values set up with FT_Property_Set (see no-stem-darkening ). This is a passive setting that only takes effect if the font driver or autohinter honors it, which the CFF, Type 1, and CID drivers always do, but the autohinter only in \u2018light\u2019 hinting mode (as of version 2.9). since 2.8 FT_PARAM_TAG_UNPATENTED_HINTING \u00b6 # define FT_PARAM_TAG_UNPATENTED_HINTING \\ FT_MAKE_TAG ( 'u', 'n', 'p', 'a' ) Deprecated, no effect. Previously: A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face .","title":"Parameter Tags"},{"location":"ft2-parameter_tags.html#parameter-tags","text":"","title":"Parameter Tags"},{"location":"ft2-parameter_tags.html#synopsis","text":"This section contains macros for the FT_Parameter structure that are used with various functions to activate some special functionality or different behaviour of various components of FreeType.","title":"Synopsis"},{"location":"ft2-parameter_tags.html#ft_param_tag_ignore_typographic_family","text":"# define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY \\ FT_MAKE_TAG ( 'i', 'g', 'p', 'f' ) /* this constant is deprecated */ # define FT_PARAM_TAG_IGNORE_PREFERRED_FAMILY \\ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY A tag for FT_Parameter to make FT_Open_Face ignore typographic family names in the \u2018name\u2019 table (introduced in OpenType version 1.4). Use this for backward compatibility with legacy systems that have a four-faces-per-family restriction.","title":"FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_FAMILY"},{"location":"ft2-parameter_tags.html#ft_param_tag_ignore_typographic_subfamily","text":"# define FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY \\ FT_MAKE_TAG ( 'i', 'g', 'p', 's' ) /* this constant is deprecated */ # define FT_PARAM_TAG_IGNORE_PREFERRED_SUBFAMILY \\ FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY A tag for FT_Parameter to make FT_Open_Face ignore typographic subfamily names in the \u2018name\u2019 table (introduced in OpenType version 1.4). Use this for backward compatibility with legacy systems that have a four-faces-per-family restriction.","title":"FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY"},{"location":"ft2-parameter_tags.html#ft_param_tag_incremental","text":"# define FT_PARAM_TAG_INCREMENTAL \\ FT_MAKE_TAG ( 'i', 'n', 'c', 'r' ) An FT_Parameter tag to be used with FT_Open_Face to indicate incremental glyph loading.","title":"FT_PARAM_TAG_INCREMENTAL"},{"location":"ft2-parameter_tags.html#ft_param_tag_ignore_sbix","text":"# define FT_PARAM_TAG_IGNORE_SBIX \\ FT_MAKE_TAG ( 'i', 's', 'b', 'x' ) A tag for FT_Parameter to make FT_Open_Face ignore an \u2018sbix\u2019 table while loading a font. Use this if FT_FACE_FLAG_SBIX is set and you want to access the outline glyphs in the font.","title":"FT_PARAM_TAG_IGNORE_SBIX"},{"location":"ft2-parameter_tags.html#ft_param_tag_lcd_filter_weights","text":"# define FT_PARAM_TAG_LCD_FILTER_WEIGHTS \\ FT_MAKE_TAG ( 'l', 'c', 'd', 'f' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding argument specifies the five LCD filter weights for a given face (if using FT_LOAD_TARGET_LCD , for example), overriding the global default values or the values set up with FT_Library_SetLcdFilterWeights .","title":"FT_PARAM_TAG_LCD_FILTER_WEIGHTS"},{"location":"ft2-parameter_tags.html#ft_param_tag_random_seed","text":"# define FT_PARAM_TAG_RANDOM_SEED \\ FT_MAKE_TAG ( 's', 'e', 'e', 'd' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding 32bit signed integer argument overrides the font driver's random seed value with a face-specific one; see random-seed .","title":"FT_PARAM_TAG_RANDOM_SEED"},{"location":"ft2-parameter_tags.html#ft_param_tag_stem_darkening","text":"# define FT_PARAM_TAG_STEM_DARKENING \\ FT_MAKE_TAG ( 'd', 'a', 'r', 'k' ) An FT_Parameter tag to be used with FT_Face_Properties . The corresponding Boolean argument specifies whether to apply stem darkening, overriding the global default values or the values set up with FT_Property_Set (see no-stem-darkening ). This is a passive setting that only takes effect if the font driver or autohinter honors it, which the CFF, Type 1, and CID drivers always do, but the autohinter only in \u2018light\u2019 hinting mode (as of version 2.9).","title":"FT_PARAM_TAG_STEM_DARKENING"},{"location":"ft2-parameter_tags.html#ft_param_tag_unpatented_hinting","text":"# define FT_PARAM_TAG_UNPATENTED_HINTING \\ FT_MAKE_TAG ( 'u', 'n', 'p', 'a' ) Deprecated, no effect. Previously: A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face .","title":"FT_PARAM_TAG_UNPATENTED_HINTING"},{"location":"ft2-pcf_driver.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The PCF driver The PCF driver \u00b6 Synopsis \u00b6 While FreeType's PCF driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . Right now, there is a single property no-long-family-names available if FreeType is compiled with PCF_CONFIG_OPTION_LONG_FAMILY_NAMES. The PCF driver's module name is \u2018pcf\u2019.","title":"The PCF driver"},{"location":"ft2-pcf_driver.html#the-pcf-driver","text":"","title":"The PCF driver"},{"location":"ft2-pcf_driver.html#synopsis","text":"While FreeType's PCF driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . Right now, there is a single property no-long-family-names available if FreeType is compiled with PCF_CONFIG_OPTION_LONG_FAMILY_NAMES. The PCF driver's module name is \u2018pcf\u2019.","title":"Synopsis"},{"location":"ft2-pfr_fonts.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb PFR Fonts PFR Fonts \u00b6 Synopsis \u00b6 This section contains the declaration of PFR-specific functions. FT_Get_PFR_Metrics \u00b6 Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Metrics ( FT_Face face, FT_UInt *aoutline_resolution, FT_UInt *ametrics_resolution, FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale ); Return the outline and metrics resolutions of a given PFR face. input face Handle to the input face. It can be a non-PFR face. output aoutline_resolution Outline resolution. This is equivalent to face->units_per_EM for non-PFR fonts. Optional (parameter can be NULL ). ametrics_resolution Metrics resolution. This is equivalent to outline_resolution for non-PFR fonts. Optional (parameter can be NULL ). ametrics_x_scale A 16.16 fixed-point number used to scale distance expressed in metrics units to device subpixels. This is equivalent to face->size->x_scale , but for metrics only. Optional (parameter can be NULL ). ametrics_y_scale Same as ametrics_x_scale but for the vertical direction. optional (parameter can be NULL ). return FreeType error code. 0 means success. note If the input face is not a PFR, this function will return an error. However, in all cases, it will return valid values. FT_Get_PFR_Kerning \u00b6 Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Kerning ( FT_Face face, FT_UInt left, FT_UInt right, FT_Vector *avector ); Return the kerning pair corresponding to two glyphs in a PFR face. The distance is expressed in metrics units, unlike the result of FT_Get_Kerning . input face A handle to the input face. left Index of the left glyph. right Index of the right glyph. output avector A kerning vector. return FreeType error code. 0 means success. note This function always return distances in original PFR metrics units. This is unlike FT_Get_Kerning with the FT_KERNING_UNSCALED mode, which always returns distances converted to outline units. You can use the value of the x_scale and y_scale parameters returned by FT_Get_PFR_Metrics to scale these to device subpixels. FT_Get_PFR_Advance \u00b6 Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Advance ( FT_Face face, FT_UInt gindex, FT_Pos *aadvance ); Return a given glyph advance, expressed in original metrics units, from a PFR font. input face A handle to the input face. gindex The glyph index. output aadvance The glyph advance in metrics units. return FreeType error code. 0 means success. note You can use the x_scale or y_scale results of FT_Get_PFR_Metrics to convert the advance to device subpixels (i.e., 1/64 th of pixels).","title":"PFR Fonts"},{"location":"ft2-pfr_fonts.html#pfr-fonts","text":"","title":"PFR Fonts"},{"location":"ft2-pfr_fonts.html#synopsis","text":"This section contains the declaration of PFR-specific functions.","title":"Synopsis"},{"location":"ft2-pfr_fonts.html#ft_get_pfr_metrics","text":"Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Metrics ( FT_Face face, FT_UInt *aoutline_resolution, FT_UInt *ametrics_resolution, FT_Fixed *ametrics_x_scale, FT_Fixed *ametrics_y_scale ); Return the outline and metrics resolutions of a given PFR face.","title":"FT_Get_PFR_Metrics"},{"location":"ft2-pfr_fonts.html#ft_get_pfr_kerning","text":"Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Kerning ( FT_Face face, FT_UInt left, FT_UInt right, FT_Vector *avector ); Return the kerning pair corresponding to two glyphs in a PFR face. The distance is expressed in metrics units, unlike the result of FT_Get_Kerning .","title":"FT_Get_PFR_Kerning"},{"location":"ft2-pfr_fonts.html#ft_get_pfr_advance","text":"Defined in FT_PFR_H (freetype/ftpfr.h). FT_EXPORT( FT_Error ) FT_Get_PFR_Advance ( FT_Face face, FT_UInt gindex, FT_Pos *aadvance ); Return a given glyph advance, expressed in original metrics units, from a PFR font.","title":"FT_Get_PFR_Advance"},{"location":"ft2-preamble.html","text":"FreeType \u00bb Docs \u00bb General Remarks \u00bb Preamble Preamble \u00b6 Synopsis \u00b6 FreeType is a library that provides access to glyphs in font files. It scales the glyph images and their metrics to a requested size, and it rasterizes the glyph images to produce pixel or subpixel alpha coverage bitmaps. Note that FreeType is not a text layout engine. You have to use higher-level libraries like HarfBuzz, Pango, or ICU for that. Note also that FreeType does not perform alpha blending or compositing the resulting bitmaps or pixmaps by itself. Use your favourite graphics library (for example, Cairo or Skia) to further process FreeType's output.","title":"Preamble"},{"location":"ft2-preamble.html#preamble","text":"","title":"Preamble"},{"location":"ft2-preamble.html#synopsis","text":"FreeType is a library that provides access to glyphs in font files. It scales the glyph images and their metrics to a requested size, and it rasterizes the glyph images to produce pixel or subpixel alpha coverage bitmaps. Note that FreeType is not a text layout engine. You have to use higher-level libraries like HarfBuzz, Pango, or ICU for that. Note also that FreeType does not perform alpha blending or compositing the resulting bitmaps or pixmaps by itself. Use your favourite graphics library (for example, Cairo or Skia) to further process FreeType's output.","title":"Synopsis"},{"location":"ft2-properties.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb Driver properties Driver properties \u00b6 Synopsis \u00b6 Driver modules can be controlled by setting and unsetting properties, using the functions FT_Property_Set and FT_Property_Get . This section documents the available properties, together with auxiliary macros and structures. FT_HINTING_XXX \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). # define FT_HINTING_FREETYPE 0 # define FT_HINTING_ADOBE 1 /* these constants (introduced in 2.4.12) are deprecated */ # define FT_CFF_HINTING_FREETYPE FT_HINTING_FREETYPE # define FT_CFF_HINTING_ADOBE FT_HINTING_ADOBE A list of constants used for the hinting-engine property to select the hinting engine for CFF, Type 1, and CID fonts. values FT_HINTING_FREETYPE Use the old FreeType hinting engine. FT_HINTING_ADOBE Use the hinting engine contributed by Adobe. since 2.9 hinting-engine \u00b6 Thanks to Adobe, which contributed a new hinting (and parsing) engine, an application can select between \u2018freetype\u2019 and \u2018adobe\u2019 if compiled with CFF_CONFIG_OPTION_OLD_ENGINE . If this configuration macro isn't defined, \u2018hinting-engine\u2019 does nothing. The same holds for the Type 1 and CID modules if compiled with T1_CONFIG_OPTION_OLD_ENGINE . For the \u2018cff\u2019 module, the default engine is \u2018adobe\u2019. For both the \u2018type1\u2019 and \u2018t1cid\u2019 modules, the default engine is \u2018adobe\u2019, too. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable (using values \u2018adobe\u2019 or \u2018freetype\u2019). example The following example code demonstrates how to select Adobe's hinting engine for the \u2018cff\u2019 module (omitting the error handling). FT_Library library; FT_UInt hinting_engine = FT_HINTING_ADOBE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"cff\", \"hinting-engine\", &hinting_engine ); since 2.4.12 (for \u2018cff\u2019 module) 2.9 (for \u2018type1\u2019 and \u2018t1cid\u2019 modules) no-stem-darkening \u00b6 All glyphs that pass through the auto-hinter will be emboldened unless this property is set to TRUE. The same is true for the CFF, Type 1, and CID font modules if the \u2018Adobe\u2019 engine is selected (which is the default). Stem darkening emboldens glyphs at smaller sizes to make them more readable on common low-DPI screens when using linear alpha blending and gamma correction, see FT_Render_Glyph . When not using linear alpha blending and gamma correction, glyphs will appear heavy and fuzzy! Gamma correction essentially lightens fonts since shades of grey are shifted to higher pixel values (= higher brightness) to match the original intention to the reality of our screens. The side-effect is that glyphs \u2018thin out\u2019. Mac OS X and Adobe's proprietary font rendering library implement a counter-measure: stem darkening at smaller sizes where shades of gray dominate. By emboldening a glyph slightly in relation to its pixel size, individual pixels get higher coverage of filled-in outlines and are therefore \u2018blacker\u2019. This counteracts the \u2018thinning out\u2019 of glyphs, making text remain readable at smaller sizes. For the auto-hinter, stem-darkening is experimental currently and thus switched off by default (this is, no-stem-darkening is set to TRUE by default). Total consistency with the CFF driver is not achieved right now because the emboldening method differs and glyphs must be scaled down on the Y-axis to keep outline points inside their precomputed blue zones. The smaller the size (especially 9ppem and down), the higher the loss of emboldening versus the CFF driver. Note that stem darkening is never applied if FT_LOAD_NO_SCALE is set. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable (using values 1 and 0 for \u2018on\u2019 and \u2018off\u2019, respectively). It can also be set per face using FT_Face_Properties with FT_PARAM_TAG_STEM_DARKENING . example FT_Library library; FT_Bool no_stem_darkening = TRUE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"cff\", \"no-stem-darkening\", &no_stem_darkening ); since 2.4.12 (for \u2018cff\u2019 module) 2.6.2 (for \u2018autofitter\u2019 module) 2.9 (for \u2018type1\u2019 and \u2018t1cid\u2019 modules) darkening-parameters \u00b6 By default, the Adobe hinting engine, as used by the CFF, Type 1, and CID font drivers, darkens stems as follows (if the no-stem-darkening property isn't set): stem width <= 0.5px: darkening amount = 0.4px stem width = 1px: darkening amount = 0.275px stem width = 1.667px: darkening amount = 0.275px stem width >= 2.333px: darkening amount = 0px and piecewise linear in-between. At configuration time, these four control points can be set with the macro CFF_CONFIG_OPTION_DARKENING_PARAMETERS ; the CFF, Type 1, and CID drivers share these values. At runtime, the control points can be changed using the darkening-parameters property (see the example below that demonstrates this for the Type 1 driver). The x values give the stem width, and the y values the darkening amount. The unit is 1000 th of pixels. All coordinate values must be positive; the x values must be monotonically increasing; the y values must be monotonically decreasing and smaller than or equal to 500 (corresponding to half a pixel); the slope of each linear piece must be shallower than -1 (e.g., -.4). The auto-hinter provides this property, too, as an experimental feature. See no-stem-darkening for more. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable, using eight comma-separated integers without spaces. Here the above example, using \\ to break the line for readability. FREETYPE_PROPERTIES=\\ type1:darkening-parameters=500,300,1000,200,1500,100,2000,0 example FT_Library library; FT_Int darken_params[8] = { 500, 300, // x1, y1 1000, 200, // x2, y2 1500, 100, // x3, y3 2000, 0 }; // x4, y4 FT_Init_FreeType( &library ); FT_Property_Set( library, \"type1\", \"darkening-parameters\", darken_params ); since 2.5.1 (for \u2018cff\u2019 module) 2.6.2 (for \u2018autofitter\u2019 module) 2.9 (for \u2018type1\u2019 and \u2018t1cid\u2019 modules) random-seed \u00b6 By default, the seed value for the CFF \u2018random\u2019 operator and the similar \u20180 28 callothersubr pop\u2019 command for the Type 1 and CID drivers is set to a random value. However, mainly for debugging purposes, it is often necessary to use a known value as a seed so that the pseudo-random number sequences generated by \u2018random\u2019 are repeatable. The random-seed property does that. Its argument is a signed 32bit integer; if the value is zero or negative, the seed given by the intitialRandomSeed private DICT operator in a CFF file gets used (or a default value if there is no such operator). If the value is positive, use it instead of initialRandomSeed , which is consequently ignored. note This property can be set via the FREETYPE_PROPERTIES environment variable. It can also be set per face using FT_Face_Properties with FT_PARAM_TAG_RANDOM_SEED . since 2.8 (for \u2018cff\u2019 module) 2.9 (for \u2018type1\u2019 and \u2018t1cid\u2019 modules) no-long-family-names \u00b6 If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling FreeType, the PCF driver constructs long family names. There are many PCF fonts just called \u2018Fixed\u2019 which look completely different, and which have nothing to do with each other. When selecting \u2018Fixed\u2019 in KDE or Gnome one gets results that appear rather random, the style changes often if one changes the size and one cannot select some fonts at all. The improve this situation, the PCF module prepends the foundry name (plus a space) to the family name. It also checks whether there are \u2018wide\u2019 characters; all put together, family names like \u2018Sony Fixed\u2019 or \u2018Misc Fixed Wide\u2019 are constructed. If no-long-family-names is set, this feature gets switched off. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable (using values 1 and 0 for \u2018on\u2019 and \u2018off\u2019, respectively). example FT_Library library; FT_Bool no_long_family_names = TRUE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"pcf\", \"no-long-family-names\", &no_long_family_names ); since 2.8 TT_INTERPRETER_VERSION_XXX \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). # define TT_INTERPRETER_VERSION_35 35 # define TT_INTERPRETER_VERSION_38 38 # define TT_INTERPRETER_VERSION_40 40 A list of constants used for the interpreter-version property to select the hinting engine for Truetype fonts. The numeric value in the constant names represents the version number as returned by the \u2018GETINFO\u2019 bytecode instruction. values TT_INTERPRETER_VERSION_35 Version 35 corresponds to MS rasterizer v.1.7 as used e.g. in Windows 98; only grayscale and B/W rasterizing is supported. TT_INTERPRETER_VERSION_38 Version 38 corresponds to MS rasterizer v.1.9; it is roughly equivalent to the hinting provided by DirectWrite ClearType (as can be found, for example, in the Internet Explorer 9 running on Windows 7). It is used in FreeType to select the \u2018Infinality\u2019 subpixel hinting code. The code may be removed in a future version. TT_INTERPRETER_VERSION_40 Version 40 corresponds to MS rasterizer v.2.1; it is roughly equivalent to the hinting provided by DirectWrite ClearType (as can be found, for example, in Microsoft's Edge Browser on Windows 10). It is used in FreeType to select the \u2018minimal\u2019 subpixel hinting code, a stripped-down and higher performance version of the \u2018Infinality\u2019 code. note This property controls the behaviour of the bytecode interpreter and thus how outlines get hinted. It does not control how glyph get rasterized! In particular, it does not control subpixel color filtering. If FreeType has not been compiled with the configuration option TT_CONFIG_OPTION_SUBPIXEL_HINTING , selecting version 38 or 40 causes an FT_Err_Unimplemented_Feature error. Depending on the graphics framework, Microsoft uses different bytecode and rendering engines. As a consequence, the version numbers returned by a call to the \u2018GETINFO\u2019 bytecode instruction are more convoluted than desired. Here are two tables that try to shed some light on the possible values for the MS rasterizer engine, together with the additional features introduced by it. GETINFO framework version feature ------------------------------------------------------------------- 3 GDI (Win 3.1), v1.0 16-bit, first version TrueImage 33 GDI (Win NT 3.1), v1.5 32-bit HP Laserjet 34 GDI (Win 95) v1.6 font smoothing, new SCANTYPE opcode 35 GDI (Win 98/2000) v1.7 (UN)SCALED_COMPONENT_OFFSET bits in composite glyphs 36 MGDI (Win CE 2) v1.6+ classic ClearType 37 GDI (XP and later), v1.8 ClearType GDI+ old (before Vista) 38 GDI+ old (Vista, Win 7), v1.9 subpixel ClearType, WPF Y-direction ClearType, additional error checking 39 DWrite (before Win 8) v2.0 subpixel ClearType flags in GETINFO opcode, bug fixes 40 GDI+ (after Win 7), v2.1 Y-direction ClearType flag DWrite (Win 8) in GETINFO opcode, Gray ClearType The \u2018version\u2019 field gives a rough orientation only, since some applications provided certain features much earlier (as an example, Microsoft Reader used subpixel and Y-direction ClearType already in Windows 2000). Similarly, updates to a given framework might include improved hinting support. version sampling rendering comment x y x y -------------------------------------------------------------- v1.0 normal normal B/W B/W bi-level v1.6 high high gray gray grayscale v1.8 high normal color-filter B/W (GDI) ClearType v1.9 high high color-filter gray Color ClearType v2.1 high normal gray B/W Gray ClearType v2.1 high high gray gray Gray ClearType Color and Gray ClearType are the two available variants of \u2018Y-direction ClearType\u2019, meaning grayscale rasterization along the Y-direction; the name used in the TrueType specification for this feature is \u2018symmetric smoothing\u2019. \u2018Classic ClearType\u2019 is the original algorithm used before introducing a modified version in Win XP. Another name for v1.6's grayscale rendering is \u2018font smoothing\u2019, and \u2018Color ClearType\u2019 is sometimes also called \u2018DWrite ClearType\u2019. To differentiate between today's Color ClearType and the earlier ClearType variant with B/W rendering along the vertical axis, the latter is sometimes called \u2018GDI ClearType\u2019. \u2018Normal\u2019 and \u2018high\u2019 sampling describe the (virtual) resolution to access the rasterized outline after the hinting process. \u2018Normal\u2019 means 1 sample per grid line (i.e., B/W). In the current Microsoft implementation, \u2018high\u2019 means an extra virtual resolution of 16x16 (or 16x1) grid lines per pixel for bytecode instructions like \u2018MIRP\u2019. After hinting, these 16 grid lines are mapped to 6x5 (or 6x1) grid lines for color filtering if Color ClearType is activated. Note that \u2018Gray ClearType\u2019 is essentially the same as v1.6's grayscale rendering. However, the GETINFO instruction handles it differently: v1.6 returns bit 12 (hinting for grayscale), while v2.1 returns bits 13 (hinting for ClearType), 18 (symmetrical smoothing), and 19 (Gray ClearType). Also, this mode respects bits 2 and 3 for the version 1 gasp table exclusively (like Color ClearType), while v1.6 only respects the values of version 0 (bits 0 and 1). Keep in mind that the features of the above interpreter versions might not map exactly to FreeType features or behavior because it is a fundamentally different library with different internals. interpreter-version \u00b6 Currently, three versions are available, two representing the bytecode interpreter with subpixel hinting support (old \u2018Infinality\u2019 code and new stripped-down and higher performance \u2018minimal\u2019 code) and one without, respectively. The default is subpixel support if TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support otherwise (since it isn't available then). If subpixel hinting is on, many TrueType bytecode instructions behave differently compared to B/W or grayscale rendering (except if \u2018native ClearType\u2019 is selected by the font). Microsoft's main idea is to render at a much increased horizontal resolution, then sampling down the created output to subpixel precision. However, many older fonts are not suited to this and must be specially taken care of by applying (hardcoded) tweaks in Microsoft's interpreter. Details on subpixel hinting and some of the necessary tweaks can be found in Greg Hitchcock's whitepaper at \u2018 https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx \u2019. Note that FreeType currently doesn't really \u2018subpixel hint\u2019 (6x1, 6x2, or 6x5 supersampling) like discussed in the paper. Depending on the chosen interpreter, it simply ignores instructions on vertical stems to arrive at very similar results. note This property can be used with FT_Property_Get also. This property can be set via the FREETYPE_PROPERTIES environment variable (using values \u201835\u2019, \u201838\u2019, or \u201840\u2019). example The following example code demonstrates how to deactivate subpixel hinting (omitting the error handling). FT_Library library; FT_Face face; FT_UInt interpreter_version = TT_INTERPRETER_VERSION_35; FT_Init_FreeType( &library ); FT_Property_Set( library, \"truetype\", \"interpreter-version\", &interpreter_version ); since 2.5 svg-hooks \u00b6 Set up the interface between FreeType and an extern SVG rendering library like \u2018librsvg\u2019. All details on the function hooks can be found in section \u2018 OpenType SVG Fonts \u2019. example The following example code expects that the four hook functions svg_* are defined elsewhere. Error handling is omitted, too. FT_Library library; SVG_RendererHooks hooks = { (SVG_Lib_Init_Func)svg_init, (SVG_Lib_Free_Func)svg_free, (SVG_Lib_Render_Func)svg_render, (SVG_Lib_Preset_Slot_Func)svg_preset_slot }; FT_Init_FreeType( &library ); FT_Property_Set( library, \"ot-svg\", \"svg-hooks\", &hooks ); since 2.12 glyph-to-script-map \u00b6 Experimental only The auto-hinter provides various script modules to hint glyphs. Examples of supported scripts are Latin or CJK. Before a glyph is auto-hinted, the Unicode character map of the font gets examined, and the script is then determined based on Unicode character ranges, see below. OpenType fonts, however, often provide much more glyphs than character codes (small caps, superscripts, ligatures, swashes, etc.), to be controlled by so-called \u2018features\u2019. Handling OpenType features can be quite complicated and thus needs a separate library on top of FreeType. The mapping between glyph indices and scripts (in the auto-hinter sense, see the FT_AUTOHINTER_SCRIPT_XXX values) is stored as an array with num_glyphs elements, as found in the font's FT_Face structure. The glyph-to-script-map property returns a pointer to this array, which can be modified as needed. Note that the modification should happen before the first glyph gets processed by the auto-hinter so that the global analysis of the font shapes actually uses the modified mapping. example The following example code demonstrates how to access it (omitting the error handling). FT_Library library; FT_Face face; FT_Prop_GlyphToScriptMap prop; FT_Init_FreeType( &library ); FT_New_Face( library, \"foo.ttf\", 0, &face ); prop.face = face; FT_Property_Get( library, \"autofitter\", \"glyph-to-script-map\", &prop ); // adjust `prop.map' as needed right here FT_Load_Glyph( face, ..., FT_LOAD_FORCE_AUTOHINT ); since 2.4.11 FT_AUTOHINTER_SCRIPT_XXX \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). # define FT_AUTOHINTER_SCRIPT_NONE 0 # define FT_AUTOHINTER_SCRIPT_LATIN 1 # define FT_AUTOHINTER_SCRIPT_CJK 2 # define FT_AUTOHINTER_SCRIPT_INDIC 3 Experimental only A list of constants used for the glyph-to-script-map property to specify the script submodule the auto-hinter should use for hinting a particular glyph. values FT_AUTOHINTER_SCRIPT_NONE Don't auto-hint this glyph. FT_AUTOHINTER_SCRIPT_LATIN Apply the latin auto-hinter. For the auto-hinter, \u2018latin\u2019 is a very broad term, including Cyrillic and Greek also since characters from those scripts share the same design constraints. By default, characters from the following Unicode ranges are assigned to this submodule. U+0020 - U+007F // Basic Latin (no control characters) U+00A0 - U+00FF // Latin-1 Supplement (no control characters) U+0100 - U+017F // Latin Extended-A U+0180 - U+024F // Latin Extended-B U+0250 - U+02AF // IPA Extensions U+02B0 - U+02FF // Spacing Modifier Letters U+0300 - U+036F // Combining Diacritical Marks U+0370 - U+03FF // Greek and Coptic U+0400 - U+04FF // Cyrillic U+0500 - U+052F // Cyrillic Supplement U+1D00 - U+1D7F // Phonetic Extensions U+1D80 - U+1DBF // Phonetic Extensions Supplement U+1DC0 - U+1DFF // Combining Diacritical Marks Supplement U+1E00 - U+1EFF // Latin Extended Additional U+1F00 - U+1FFF // Greek Extended U+2000 - U+206F // General Punctuation U+2070 - U+209F // Superscripts and Subscripts U+20A0 - U+20CF // Currency Symbols U+2150 - U+218F // Number Forms U+2460 - U+24FF // Enclosed Alphanumerics U+2C60 - U+2C7F // Latin Extended-C U+2DE0 - U+2DFF // Cyrillic Extended-A U+2E00 - U+2E7F // Supplemental Punctuation U+A640 - U+A69F // Cyrillic Extended-B U+A720 - U+A7FF // Latin Extended-D U+FB00 - U+FB06 // Alphab. Present. Forms (Latin Ligatures) U+1D400 - U+1D7FF // Mathematical Alphanumeric Symbols U+1F100 - U+1F1FF // Enclosed Alphanumeric Supplement FT_AUTOHINTER_SCRIPT_CJK Apply the CJK auto-hinter, covering Chinese, Japanese, Korean, old Vietnamese, and some other scripts. By default, characters from the following Unicode ranges are assigned to this submodule. U+1100 - U+11FF // Hangul Jamo U+2E80 - U+2EFF // CJK Radicals Supplement U+2F00 - U+2FDF // Kangxi Radicals U+2FF0 - U+2FFF // Ideographic Description Characters U+3000 - U+303F // CJK Symbols and Punctuation U+3040 - U+309F // Hiragana U+30A0 - U+30FF // Katakana U+3100 - U+312F // Bopomofo U+3130 - U+318F // Hangul Compatibility Jamo U+3190 - U+319F // Kanbun U+31A0 - U+31BF // Bopomofo Extended U+31C0 - U+31EF // CJK Strokes U+31F0 - U+31FF // Katakana Phonetic Extensions U+3200 - U+32FF // Enclosed CJK Letters and Months U+3300 - U+33FF // CJK Compatibility U+3400 - U+4DBF // CJK Unified Ideographs Extension A U+4DC0 - U+4DFF // Yijing Hexagram Symbols U+4E00 - U+9FFF // CJK Unified Ideographs U+A960 - U+A97F // Hangul Jamo Extended-A U+AC00 - U+D7AF // Hangul Syllables U+D7B0 - U+D7FF // Hangul Jamo Extended-B U+F900 - U+FAFF // CJK Compatibility Ideographs U+FE10 - U+FE1F // Vertical forms U+FE30 - U+FE4F // CJK Compatibility Forms U+FF00 - U+FFEF // Halfwidth and Fullwidth Forms U+1B000 - U+1B0FF // Kana Supplement U+1D300 - U+1D35F // Tai Xuan Hing Symbols U+1F200 - U+1F2FF // Enclosed Ideographic Supplement U+20000 - U+2A6DF // CJK Unified Ideographs Extension B U+2A700 - U+2B73F // CJK Unified Ideographs Extension C U+2B740 - U+2B81F // CJK Unified Ideographs Extension D U+2F800 - U+2FA1F // CJK Compatibility Ideographs Supplement FT_AUTOHINTER_SCRIPT_INDIC Apply the indic auto-hinter, covering all major scripts from the Indian sub-continent and some other related scripts like Thai, Lao, or Tibetan. By default, characters from the following Unicode ranges are assigned to this submodule. U+0900 - U+0DFF // Indic Range U+0F00 - U+0FFF // Tibetan U+1900 - U+194F // Limbu U+1B80 - U+1BBF // Sundanese U+A800 - U+A82F // Syloti Nagri U+ABC0 - U+ABFF // Meetei Mayek U+11800 - U+118DF // Sharada Note that currently Indic support is rudimentary only, missing blue zone support. since 2.4.11 FT_Prop_GlyphToScriptMap \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). typedef struct FT_Prop_GlyphToScriptMap_ { FT_Face face; FT_UShort * map; } FT_Prop_GlyphToScriptMap ; Experimental only The data exchange structure for the glyph-to-script-map property. since 2.4.11 fallback-script \u00b6 Experimental only If no auto-hinter script module can be assigned to a glyph, a fallback script gets assigned to it (see also the glyph-to-script-map property). By default, this is FT_AUTOHINTER_SCRIPT_CJK . Using the fallback-script property, this fallback value can be changed. note This property can be used with FT_Property_Get also. It's important to use the right timing for changing this value: The creation of the glyph-to-script map that eventually uses the fallback script value gets triggered either by setting or reading a face-specific property like glyph-to-script-map , or by auto-hinting any glyph from that face. In particular, if you have already created an FT_Face structure but not loaded any glyph (using the auto-hinter), a change of the fallback script will affect this face. example FT_Library library; FT_UInt fallback_script = FT_AUTOHINTER_SCRIPT_NONE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"autofitter\", \"fallback-script\", &fallback_script ); since 2.4.11 default-script \u00b6 Experimental only If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make the HarfBuzz library access OpenType features for getting better glyph coverages, this property sets the (auto-fitter) script to be used for the default (OpenType) script data of a font's GSUB table. Features for the default script are intended for all scripts not explicitly handled in GSUB; an example is a \u2018dlig\u2019 feature, containing the combination of the characters \u2018T\u2019, \u2018E\u2019, and \u2018L\u2019 to form a \u2018TEL\u2019 ligature. By default, this is FT_AUTOHINTER_SCRIPT_LATIN . Using the default-script property, this default value can be changed. note This property can be used with FT_Property_Get also. It's important to use the right timing for changing this value: The creation of the glyph-to-script map that eventually uses the default script value gets triggered either by setting or reading a face-specific property like glyph-to-script-map , or by auto-hinting any glyph from that face. In particular, if you have already created an FT_Face structure but not loaded any glyph (using the auto-hinter), a change of the default script will affect this face. example FT_Library library; FT_UInt default_script = FT_AUTOHINTER_SCRIPT_NONE; FT_Init_FreeType( &library ); FT_Property_Set( library, \"autofitter\", \"default-script\", &default_script ); since 2.5.3 increase-x-height \u00b6 For ppem values in the range 6 <= ppem <= increase-x-height , round up the font's x height much more often than normally. If the value is set to 0, which is the default, this feature is switched off. Use this property to improve the legibility of small font sizes if necessary. note This property can be used with FT_Property_Get also. Set this value right after calling FT_Set_Char_Size , but before loading any glyph (using the auto-hinter). example FT_Library library; FT_Face face; FT_Prop_IncreaseXHeight prop; FT_Init_FreeType( &library ); FT_New_Face( library, \"foo.ttf\", 0, &face ); FT_Set_Char_Size( face, 10 * 64, 0, 72, 0 ); prop.face = face; prop.limit = 14; FT_Property_Set( library, \"autofitter\", \"increase-x-height\", &prop ); since 2.4.11 FT_Prop_IncreaseXHeight \u00b6 Defined in FT_DRIVER_H (freetype/ftdriver.h). typedef struct FT_Prop_IncreaseXHeight_ { FT_Face face; FT_UInt limit; } FT_Prop_IncreaseXHeight ; The data exchange structure for the increase-x-height property. warping \u00b6 Obsolete This property was always experimental and probably never worked correctly. It was entirely removed from the FreeType 2 sources. This entry is only here for historical reference. Warping only worked in \u2018normal\u2019 auto-hinting mode replacing it. The idea of the code was to slightly scale and shift a glyph along the non-hinted dimension (which is usually the horizontal axis) so that as much of its segments were aligned (more or less) to the grid. To find out a glyph's optimal scaling and shifting value, various parameter combinations were tried and scored. since 2.6","title":"Driver properties"},{"location":"ft2-properties.html#driver-properties","text":"","title":"Driver properties"},{"location":"ft2-properties.html#synopsis","text":"Driver modules can be controlled by setting and unsetting properties, using the functions FT_Property_Set and FT_Property_Get . This section documents the available properties, together with auxiliary macros and structures.","title":"Synopsis"},{"location":"ft2-properties.html#ft_hinting_xxx","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). # define FT_HINTING_FREETYPE 0 # define FT_HINTING_ADOBE 1 /* these constants (introduced in 2.4.12) are deprecated */ # define FT_CFF_HINTING_FREETYPE FT_HINTING_FREETYPE # define FT_CFF_HINTING_ADOBE FT_HINTING_ADOBE A list of constants used for the hinting-engine property to select the hinting engine for CFF, Type 1, and CID fonts.","title":"FT_HINTING_XXX"},{"location":"ft2-properties.html#hinting-engine","text":"Thanks to Adobe, which contributed a new hinting (and parsing) engine, an application can select between \u2018freetype\u2019 and \u2018adobe\u2019 if compiled with CFF_CONFIG_OPTION_OLD_ENGINE . If this configuration macro isn't defined, \u2018hinting-engine\u2019 does nothing. The same holds for the Type 1 and CID modules if compiled with T1_CONFIG_OPTION_OLD_ENGINE . For the \u2018cff\u2019 module, the default engine is \u2018adobe\u2019. For both the \u2018type1\u2019 and \u2018t1cid\u2019 modules, the default engine is \u2018adobe\u2019, too.","title":"hinting-engine"},{"location":"ft2-properties.html#no-stem-darkening","text":"All glyphs that pass through the auto-hinter will be emboldened unless this property is set to TRUE. The same is true for the CFF, Type 1, and CID font modules if the \u2018Adobe\u2019 engine is selected (which is the default). Stem darkening emboldens glyphs at smaller sizes to make them more readable on common low-DPI screens when using linear alpha blending and gamma correction, see FT_Render_Glyph . When not using linear alpha blending and gamma correction, glyphs will appear heavy and fuzzy! Gamma correction essentially lightens fonts since shades of grey are shifted to higher pixel values (= higher brightness) to match the original intention to the reality of our screens. The side-effect is that glyphs \u2018thin out\u2019. Mac OS X and Adobe's proprietary font rendering library implement a counter-measure: stem darkening at smaller sizes where shades of gray dominate. By emboldening a glyph slightly in relation to its pixel size, individual pixels get higher coverage of filled-in outlines and are therefore \u2018blacker\u2019. This counteracts the \u2018thinning out\u2019 of glyphs, making text remain readable at smaller sizes. For the auto-hinter, stem-darkening is experimental currently and thus switched off by default (this is, no-stem-darkening is set to TRUE by default). Total consistency with the CFF driver is not achieved right now because the emboldening method differs and glyphs must be scaled down on the Y-axis to keep outline points inside their precomputed blue zones. The smaller the size (especially 9ppem and down), the higher the loss of emboldening versus the CFF driver. Note that stem darkening is never applied if FT_LOAD_NO_SCALE is set.","title":"no-stem-darkening"},{"location":"ft2-properties.html#darkening-parameters","text":"By default, the Adobe hinting engine, as used by the CFF, Type 1, and CID font drivers, darkens stems as follows (if the no-stem-darkening property isn't set): stem width <= 0.5px: darkening amount = 0.4px stem width = 1px: darkening amount = 0.275px stem width = 1.667px: darkening amount = 0.275px stem width >= 2.333px: darkening amount = 0px and piecewise linear in-between. At configuration time, these four control points can be set with the macro CFF_CONFIG_OPTION_DARKENING_PARAMETERS ; the CFF, Type 1, and CID drivers share these values. At runtime, the control points can be changed using the darkening-parameters property (see the example below that demonstrates this for the Type 1 driver). The x values give the stem width, and the y values the darkening amount. The unit is 1000 th of pixels. All coordinate values must be positive; the x values must be monotonically increasing; the y values must be monotonically decreasing and smaller than or equal to 500 (corresponding to half a pixel); the slope of each linear piece must be shallower than -1 (e.g., -.4). The auto-hinter provides this property, too, as an experimental feature. See no-stem-darkening for more.","title":"darkening-parameters"},{"location":"ft2-properties.html#random-seed","text":"By default, the seed value for the CFF \u2018random\u2019 operator and the similar \u20180 28 callothersubr pop\u2019 command for the Type 1 and CID drivers is set to a random value. However, mainly for debugging purposes, it is often necessary to use a known value as a seed so that the pseudo-random number sequences generated by \u2018random\u2019 are repeatable. The random-seed property does that. Its argument is a signed 32bit integer; if the value is zero or negative, the seed given by the intitialRandomSeed private DICT operator in a CFF file gets used (or a default value if there is no such operator). If the value is positive, use it instead of initialRandomSeed , which is consequently ignored.","title":"random-seed"},{"location":"ft2-properties.html#no-long-family-names","text":"If PCF_CONFIG_OPTION_LONG_FAMILY_NAMES is active while compiling FreeType, the PCF driver constructs long family names. There are many PCF fonts just called \u2018Fixed\u2019 which look completely different, and which have nothing to do with each other. When selecting \u2018Fixed\u2019 in KDE or Gnome one gets results that appear rather random, the style changes often if one changes the size and one cannot select some fonts at all. The improve this situation, the PCF module prepends the foundry name (plus a space) to the family name. It also checks whether there are \u2018wide\u2019 characters; all put together, family names like \u2018Sony Fixed\u2019 or \u2018Misc Fixed Wide\u2019 are constructed. If no-long-family-names is set, this feature gets switched off.","title":"no-long-family-names"},{"location":"ft2-properties.html#tt_interpreter_version_xxx","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). # define TT_INTERPRETER_VERSION_35 35 # define TT_INTERPRETER_VERSION_38 38 # define TT_INTERPRETER_VERSION_40 40 A list of constants used for the interpreter-version property to select the hinting engine for Truetype fonts. The numeric value in the constant names represents the version number as returned by the \u2018GETINFO\u2019 bytecode instruction.","title":"TT_INTERPRETER_VERSION_XXX"},{"location":"ft2-properties.html#interpreter-version","text":"Currently, three versions are available, two representing the bytecode interpreter with subpixel hinting support (old \u2018Infinality\u2019 code and new stripped-down and higher performance \u2018minimal\u2019 code) and one without, respectively. The default is subpixel support if TT_CONFIG_OPTION_SUBPIXEL_HINTING is defined, and no subpixel support otherwise (since it isn't available then). If subpixel hinting is on, many TrueType bytecode instructions behave differently compared to B/W or grayscale rendering (except if \u2018native ClearType\u2019 is selected by the font). Microsoft's main idea is to render at a much increased horizontal resolution, then sampling down the created output to subpixel precision. However, many older fonts are not suited to this and must be specially taken care of by applying (hardcoded) tweaks in Microsoft's interpreter. Details on subpixel hinting and some of the necessary tweaks can be found in Greg Hitchcock's whitepaper at \u2018 https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx \u2019. Note that FreeType currently doesn't really \u2018subpixel hint\u2019 (6x1, 6x2, or 6x5 supersampling) like discussed in the paper. Depending on the chosen interpreter, it simply ignores instructions on vertical stems to arrive at very similar results.","title":"interpreter-version"},{"location":"ft2-properties.html#svg-hooks","text":"Set up the interface between FreeType and an extern SVG rendering library like \u2018librsvg\u2019. All details on the function hooks can be found in section \u2018 OpenType SVG Fonts \u2019.","title":"svg-hooks"},{"location":"ft2-properties.html#glyph-to-script-map","text":"Experimental only The auto-hinter provides various script modules to hint glyphs. Examples of supported scripts are Latin or CJK. Before a glyph is auto-hinted, the Unicode character map of the font gets examined, and the script is then determined based on Unicode character ranges, see below. OpenType fonts, however, often provide much more glyphs than character codes (small caps, superscripts, ligatures, swashes, etc.), to be controlled by so-called \u2018features\u2019. Handling OpenType features can be quite complicated and thus needs a separate library on top of FreeType. The mapping between glyph indices and scripts (in the auto-hinter sense, see the FT_AUTOHINTER_SCRIPT_XXX values) is stored as an array with num_glyphs elements, as found in the font's FT_Face structure. The glyph-to-script-map property returns a pointer to this array, which can be modified as needed. Note that the modification should happen before the first glyph gets processed by the auto-hinter so that the global analysis of the font shapes actually uses the modified mapping.","title":"glyph-to-script-map"},{"location":"ft2-properties.html#ft_autohinter_script_xxx","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). # define FT_AUTOHINTER_SCRIPT_NONE 0 # define FT_AUTOHINTER_SCRIPT_LATIN 1 # define FT_AUTOHINTER_SCRIPT_CJK 2 # define FT_AUTOHINTER_SCRIPT_INDIC 3 Experimental only A list of constants used for the glyph-to-script-map property to specify the script submodule the auto-hinter should use for hinting a particular glyph.","title":"FT_AUTOHINTER_SCRIPT_XXX"},{"location":"ft2-properties.html#ft_prop_glyphtoscriptmap","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). typedef struct FT_Prop_GlyphToScriptMap_ { FT_Face face; FT_UShort * map; } FT_Prop_GlyphToScriptMap ; Experimental only The data exchange structure for the glyph-to-script-map property.","title":"FT_Prop_GlyphToScriptMap"},{"location":"ft2-properties.html#fallback-script","text":"Experimental only If no auto-hinter script module can be assigned to a glyph, a fallback script gets assigned to it (see also the glyph-to-script-map property). By default, this is FT_AUTOHINTER_SCRIPT_CJK . Using the fallback-script property, this fallback value can be changed.","title":"fallback-script"},{"location":"ft2-properties.html#default-script","text":"Experimental only If FreeType gets compiled with FT_CONFIG_OPTION_USE_HARFBUZZ to make the HarfBuzz library access OpenType features for getting better glyph coverages, this property sets the (auto-fitter) script to be used for the default (OpenType) script data of a font's GSUB table. Features for the default script are intended for all scripts not explicitly handled in GSUB; an example is a \u2018dlig\u2019 feature, containing the combination of the characters \u2018T\u2019, \u2018E\u2019, and \u2018L\u2019 to form a \u2018TEL\u2019 ligature. By default, this is FT_AUTOHINTER_SCRIPT_LATIN . Using the default-script property, this default value can be changed.","title":"default-script"},{"location":"ft2-properties.html#increase-x-height","text":"For ppem values in the range 6 <= ppem <= increase-x-height , round up the font's x height much more often than normally. If the value is set to 0, which is the default, this feature is switched off. Use this property to improve the legibility of small font sizes if necessary.","title":"increase-x-height"},{"location":"ft2-properties.html#ft_prop_increasexheight","text":"Defined in FT_DRIVER_H (freetype/ftdriver.h). typedef struct FT_Prop_IncreaseXHeight_ { FT_Face face; FT_UInt limit; } FT_Prop_IncreaseXHeight ; The data exchange structure for the increase-x-height property.","title":"FT_Prop_IncreaseXHeight"},{"location":"ft2-properties.html#warping","text":"Obsolete This property was always experimental and probably never worked correctly. It was entirely removed from the FreeType 2 sources. This entry is only here for historical reference. Warping only worked in \u2018normal\u2019 auto-hinting mode replacing it. The idea of the code was to slightly scale and shift a glyph along the non-hinted dimension (which is usually the horizontal axis) so that as much of its segments were aligned (more or less) to the grid. To find out a glyph's optimal scaling and shifting value, various parameter combinations were tried and scored.","title":"warping"},{"location":"ft2-quick_advance.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Quick retrieval of advance values Quick retrieval of advance values \u00b6 Synopsis \u00b6 This section contains functions to quickly extract advance values without handling glyph outlines, if possible. FT_Get_Advance \u00b6 Defined in FT_ADVANCES_H (freetype/ftadvanc.h). FT_EXPORT( FT_Error ) FT_Get_Advance ( FT_Face face, FT_UInt gindex, FT_Int32 load_flags, FT_Fixed *padvance ); Retrieve the advance value of a given glyph outline in an FT_Face . input face The source FT_Face handle. gindex The glyph index. load_flags A set of bit flags similar to those used when calling FT_Load_Glyph , used to determine what kind of advances you need. output padvance The advance value. If scaling is performed (based on the value of load_flags ), the advance value is in 16.16 format. Otherwise, it is in font units. If FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance corresponding to a vertical layout. Otherwise, it is the horizontal advance in a horizontal layout. return FreeType error code. 0 means success. note This function may fail if you use FT_ADVANCE_FLAG_FAST_ONLY and if the corresponding font backend doesn't have a quick way to retrieve the advances. A scaled advance is returned in 16.16 format but isn't transformed by the affine transformation specified by FT_Set_Transform . FT_Get_Advances \u00b6 Defined in FT_ADVANCES_H (freetype/ftadvanc.h). FT_EXPORT( FT_Error ) FT_Get_Advances ( FT_Face face, FT_UInt start, FT_UInt count, FT_Int32 load_flags, FT_Fixed *padvances ); Retrieve the advance values of several glyph outlines in an FT_Face . input face The source FT_Face handle. start The first glyph index. count The number of advance values you want to retrieve. load_flags A set of bit flags similar to those used when calling FT_Load_Glyph . output padvance The advance values. This array, to be provided by the caller, must contain at least count elements. If scaling is performed (based on the value of load_flags ), the advance values are in 16.16 format. Otherwise, they are in font units. If FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances corresponding to a vertical layout. Otherwise, they are the horizontal advances in a horizontal layout. return FreeType error code. 0 means success. note This function may fail if you use FT_ADVANCE_FLAG_FAST_ONLY and if the corresponding font backend doesn't have a quick way to retrieve the advances. Scaled advances are returned in 16.16 format but aren't transformed by the affine transformation specified by FT_Set_Transform . FT_ADVANCE_FLAG_FAST_ONLY \u00b6 Defined in FT_ADVANCES_H (freetype/ftadvanc.h). # define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L A bit-flag to be OR-ed with the flags parameter of the FT_Get_Advance and FT_Get_Advances functions. If set, it indicates that you want these functions to fail if the corresponding hinting mode or font driver doesn't allow for very quick advance computation. Typically, glyphs that are either unscaled, unhinted, bitmapped, or light-hinted can have their advance width computed very quickly. Normal and bytecode hinted modes that require loading, scaling, and hinting of the glyph outline, are extremely slow by comparison.","title":"Quick retrieval of advance values"},{"location":"ft2-quick_advance.html#quick-retrieval-of-advance-values","text":"","title":"Quick retrieval of advance values"},{"location":"ft2-quick_advance.html#synopsis","text":"This section contains functions to quickly extract advance values without handling glyph outlines, if possible.","title":"Synopsis"},{"location":"ft2-quick_advance.html#ft_get_advance","text":"Defined in FT_ADVANCES_H (freetype/ftadvanc.h). FT_EXPORT( FT_Error ) FT_Get_Advance ( FT_Face face, FT_UInt gindex, FT_Int32 load_flags, FT_Fixed *padvance ); Retrieve the advance value of a given glyph outline in an FT_Face .","title":"FT_Get_Advance"},{"location":"ft2-quick_advance.html#ft_get_advances","text":"Defined in FT_ADVANCES_H (freetype/ftadvanc.h). FT_EXPORT( FT_Error ) FT_Get_Advances ( FT_Face face, FT_UInt start, FT_UInt count, FT_Int32 load_flags, FT_Fixed *padvances ); Retrieve the advance values of several glyph outlines in an FT_Face .","title":"FT_Get_Advances"},{"location":"ft2-quick_advance.html#ft_advance_flag_fast_only","text":"Defined in FT_ADVANCES_H (freetype/ftadvanc.h). # define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L A bit-flag to be OR-ed with the flags parameter of the FT_Get_Advance and FT_Get_Advances functions. If set, it indicates that you want these functions to fail if the corresponding hinting mode or font driver doesn't allow for very quick advance computation. Typically, glyphs that are either unscaled, unhinted, bitmapped, or light-hinted can have their advance width computed very quickly. Normal and bytecode hinted modes that require loading, scaling, and hinting of the glyph outline, are extremely slow by comparison.","title":"FT_ADVANCE_FLAG_FAST_ONLY"},{"location":"ft2-raster.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb Scanline Converter Scanline Converter \u00b6 Synopsis \u00b6 A raster or a rasterizer is a scan converter in charge of producing a pixel coverage bitmap that can be used as an alpha channel when compositing a glyph with a background. FreeType comes with two rasterizers: bilevel raster1 and anti-aliased smooth are two separate modules. They are usually called from the high-level FT_Load_Glyph or FT_Render_Glyph functions and produce the entire coverage bitmap at once, while staying largely invisible to users. Instead of working with complete coverage bitmaps, it is also possible to intercept consecutive pixel runs on the same scanline with the same coverage, called spans , and process them individually. Only the smooth rasterizer permits this when calling FT_Outline_Render with FT_Raster_Params as described below. Working with either complete bitmaps or spans it is important to think of them as colorless coverage objects suitable as alpha channels to blend arbitrary colors with a background. For best results, it is recommended to use gamma correction, too. This section also describes the public API needed to set up alternative FT_Renderer modules. FT_Span \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Span_ { short x; unsigned short len; unsigned char coverage; } FT_Span ; A structure to model a single span of consecutive pixels when rendering an 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). note This structure is used by the span drawing callback type named FT_SpanFunc that takes the y coordinate of the span as a parameter. The anti-aliased rasterizer produces coverage values from 0 to 255, this is, from completely transparent to completely opaque. FT_SpanFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_SpanFunc )( int y, int count, const FT_Span * spans, void * user ); # define FT_Raster_Span_Func FT_SpanFunc A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the pixel spans on each scan line. input y The scanline's upward 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 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 using alpha compositing. It can also be used for oversampling and averaging. FT_Raster_Params \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Raster_Params_ { const FT_Bitmap * target; const void * source; int flags; FT_SpanFunc gray_spans; FT_SpanFunc black_spans; /* unused */ FT_Raster_BitTest_Func bit_test; /* unused */ FT_Raster_BitSet_Func bit_set; /* unused */ void * user; FT_BBox clip_box; } FT_Raster_Params ; A structure to hold the parameters used by a raster's render function, passed as an argument to FT_Outline_Render . 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 Unused. bit_test Unused. bit_set Unused. user User-supplied data that is passed to each drawing callback. clip_box An optional span clipping box expressed in integer pixels (not in 26.6 fixed-point units). note The FT_RASTER_FLAG_AA bit flag must be set in the flags to generate an anti-aliased glyph bitmap, otherwise a monochrome bitmap is generated. The target should have appropriate pixel mode and its dimensions define the clipping region. If both FT_RASTER_FLAG_AA and FT_RASTER_FLAG_DIRECT bit flags are set in flags , the raster calls an FT_SpanFunc callback gray_spans with user data as an argument ignoring target . This allows direct composition over a pre-existing user surface to perform the span drawing and composition. To optionally clip the spans, set the FT_RASTER_FLAG_CLIP flag and clip_box . The monochrome raster does not support the direct mode. The gray-level rasterizer always uses 256 gray levels. If you want fewer gray levels, you have to use FT_RASTER_FLAG_DIRECT and reduce the levels in the callback function. FT_RASTER_FLAG_XXX \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). # define FT_RASTER_FLAG_DEFAULT 0x0 # define FT_RASTER_FLAG_AA 0x1 # define FT_RASTER_FLAG_DIRECT 0x2 # define FT_RASTER_FLAG_CLIP 0x4 # define FT_RASTER_FLAG_SDF 0x8 /* these constants are deprecated; use the corresponding */ /* ` FT_RASTER_FLAG_XXX ` values instead */ # 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 A list of bit flag constants 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 and the output will be clipped to its size. 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. Otherwise, the clip_box is effectively set to the bounding box and all spans are generated. FT_RASTER_FLAG_SDF This flag is set to indicate that a signed distance field glyph image should be generated. This is only used while rendering with the FT_RENDER_MODE_SDF render mode. FT_Raster \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_RasterRec_* FT_Raster ; An opaque handle (pointer) to a raster object. Each object can be used independently to convert an outline into a bitmap or pixmap. note In FreeType 2, all rasters are now encapsulated within specific FT_Renderer modules and only used in their context. FT_Raster_NewFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_NewFunc )( void * memory, FT_Raster * raster ); # define FT_Raster_New_Func FT_Raster_NewFunc 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 an FT_Memory object, i.e., a handle to the standard FreeType memory allocator. However, this field can be completely ignored by a given raster implementation. FT_Raster_DoneFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_DoneFunc )( FT_Raster raster ); # define FT_Raster_Done_Func FT_Raster_DoneFunc A function used to destroy a given raster object. input raster A handle to the raster object. FT_Raster_ResetFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_ResetFunc )( FT_Raster raster, unsigned char * pool_base, unsigned long pool_size ); # define FT_Raster_Reset_Func FT_Raster_ResetFunc FreeType used to provide an area of memory called the \u2018render pool\u2019 available to all registered rasterizers. This was not thread safe, however, and now FreeType never allocates this pool. This function is called after a new raster object is created. input raster A handle to the new raster object. pool_base Previously, the address in memory of the render pool. Set this to NULL . pool_size Previously, the size in bytes of the render pool. Set this to 0. note Rasterizers should rely on dynamic or stack allocation if they want to (a handle to the memory allocator is passed to the rasterizer constructor). FT_Raster_SetModeFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_SetModeFunc )( FT_Raster raster, unsigned long mode, void * args ); # define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc 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 \u2018features\u2019 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. FT_Raster_RenderFunc \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_RenderFunc )( FT_Raster raster, const FT_Raster_Params * params ); # define FT_Raster_Render_Func FT_Raster_RenderFunc Invoke 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 an 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. FT_Raster_Funcs \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; 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. FT_Raster_BitTest_Func \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_BitTest_Func )( int y, int x, void * user ); Deprecated, unimplemented. FT_Raster_BitSet_Func \u00b6 Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_BitSet_Func )( int y, int x, void * user ); Deprecated, unimplemented.","title":"Scanline Converter"},{"location":"ft2-raster.html#scanline-converter","text":"","title":"Scanline Converter"},{"location":"ft2-raster.html#synopsis","text":"A raster or a rasterizer is a scan converter in charge of producing a pixel coverage bitmap that can be used as an alpha channel when compositing a glyph with a background. FreeType comes with two rasterizers: bilevel raster1 and anti-aliased smooth are two separate modules. They are usually called from the high-level FT_Load_Glyph or FT_Render_Glyph functions and produce the entire coverage bitmap at once, while staying largely invisible to users. Instead of working with complete coverage bitmaps, it is also possible to intercept consecutive pixel runs on the same scanline with the same coverage, called spans , and process them individually. Only the smooth rasterizer permits this when calling FT_Outline_Render with FT_Raster_Params as described below. Working with either complete bitmaps or spans it is important to think of them as colorless coverage objects suitable as alpha channels to blend arbitrary colors with a background. For best results, it is recommended to use gamma correction, too. This section also describes the public API needed to set up alternative FT_Renderer modules.","title":"Synopsis"},{"location":"ft2-raster.html#ft_span","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Span_ { short x; unsigned short len; unsigned char coverage; } FT_Span ; A structure to model a single span of consecutive pixels when rendering an anti-aliased bitmap.","title":"FT_Span"},{"location":"ft2-raster.html#ft_spanfunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_SpanFunc )( int y, int count, const FT_Span * spans, void * user ); # define FT_Raster_Span_Func FT_SpanFunc A function used as a call-back by the anti-aliased renderer in order to let client applications draw themselves the pixel spans on each scan line.","title":"FT_SpanFunc"},{"location":"ft2-raster.html#ft_raster_params","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_Raster_Params_ { const FT_Bitmap * target; const void * source; int flags; FT_SpanFunc gray_spans; FT_SpanFunc black_spans; /* unused */ FT_Raster_BitTest_Func bit_test; /* unused */ FT_Raster_BitSet_Func bit_set; /* unused */ void * user; FT_BBox clip_box; } FT_Raster_Params ; A structure to hold the parameters used by a raster's render function, passed as an argument to FT_Outline_Render .","title":"FT_Raster_Params"},{"location":"ft2-raster.html#ft_raster_flag_xxx","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). # define FT_RASTER_FLAG_DEFAULT 0x0 # define FT_RASTER_FLAG_AA 0x1 # define FT_RASTER_FLAG_DIRECT 0x2 # define FT_RASTER_FLAG_CLIP 0x4 # define FT_RASTER_FLAG_SDF 0x8 /* these constants are deprecated; use the corresponding */ /* ` FT_RASTER_FLAG_XXX ` values instead */ # 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 A list of bit flag constants as used in the flags field of a FT_Raster_Params structure.","title":"FT_RASTER_FLAG_XXX"},{"location":"ft2-raster.html#ft_raster","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef struct FT_RasterRec_* FT_Raster ; An opaque handle (pointer) to a raster object. Each object can be used independently to convert an outline into a bitmap or pixmap.","title":"FT_Raster"},{"location":"ft2-raster.html#ft_raster_newfunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_NewFunc )( void * memory, FT_Raster * raster ); # define FT_Raster_New_Func FT_Raster_NewFunc A function used to create a new raster object.","title":"FT_Raster_NewFunc"},{"location":"ft2-raster.html#ft_raster_donefunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_DoneFunc )( FT_Raster raster ); # define FT_Raster_Done_Func FT_Raster_DoneFunc A function used to destroy a given raster object.","title":"FT_Raster_DoneFunc"},{"location":"ft2-raster.html#ft_raster_resetfunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_ResetFunc )( FT_Raster raster, unsigned char * pool_base, unsigned long pool_size ); # define FT_Raster_Reset_Func FT_Raster_ResetFunc FreeType used to provide an area of memory called the \u2018render pool\u2019 available to all registered rasterizers. This was not thread safe, however, and now FreeType never allocates this pool. This function is called after a new raster object is created.","title":"FT_Raster_ResetFunc"},{"location":"ft2-raster.html#ft_raster_setmodefunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_SetModeFunc )( FT_Raster raster, unsigned long mode, void * args ); # define FT_Raster_Set_Mode_Func FT_Raster_SetModeFunc 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 \u2018features\u2019 in a given raster module.","title":"FT_Raster_SetModeFunc"},{"location":"ft2-raster.html#ft_raster_renderfunc","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_RenderFunc )( FT_Raster raster, const FT_Raster_Params * params ); # define FT_Raster_Render_Func FT_Raster_RenderFunc Invoke a given raster to scan-convert a given glyph image into a target bitmap.","title":"FT_Raster_RenderFunc"},{"location":"ft2-raster.html#ft_raster_funcs","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). 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 ; A structure used to describe a given raster class to the library.","title":"FT_Raster_Funcs"},{"location":"ft2-raster.html#ft_raster_bittest_func","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef int (* FT_Raster_BitTest_Func )( int y, int x, void * user ); Deprecated, unimplemented.","title":"FT_Raster_BitTest_Func"},{"location":"ft2-raster.html#ft_raster_bitset_func","text":"Defined in FT_IMAGE_H (freetype/ftimage.h). typedef void (* FT_Raster_BitSet_Func )( int y, int x, void * user ); Deprecated, unimplemented.","title":"FT_Raster_BitSet_Func"},{"location":"ft2-sfnt_names.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb SFNT Names SFNT Names \u00b6 Synopsis \u00b6 The TrueType and OpenType specifications allow the inclusion of a special names table (\u2018name\u2019) in font files. This table contains textual (and internationalized) information regarding the font, like family name, copyright, version, etc. The definitions below are used to access them if available. Note that this has nothing to do with glyph names! FT_SfntName \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). typedef struct FT_SfntName_ { FT_UShort platform_id; FT_UShort encoding_id; FT_UShort language_id; FT_UShort name_id; FT_Byte * string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntName ; A structure used to model an SFNT \u2018name\u2019 table entry. fields platform_id The platform ID for string . See TT_PLATFORM_XXX for possible values. encoding_id The encoding ID for string . See TT_APPLE_ID_XXX , TT_MAC_ID_XXX , TT_ISO_ID_XXX , TT_MS_ID_XXX , and TT_ADOBE_ID_XXX for possible values. language_id The language ID for string . See TT_MAC_LANGID_XXX and TT_MS_LANGID_XXX for possible values. Registered OpenType values for language_id are always smaller than 0x8000; values equal or larger than 0x8000 usually indicate a language tag string (introduced in OpenType version 1.6). Use function FT_Get_Sfnt_LangTag with language_id as its argument to retrieve the associated language tag. name_id An identifier for string . See TT_NAME_ID_XXX for possible values. string The \u2018name\u2019 string. Note that its format differs depending on the (platform,encoding) pair, being either a string of bytes (without a terminating NULL byte) or containing UTF-16BE entities. string_len The length of string in bytes. note Please refer to the TrueType or OpenType specification for more details. FT_Get_Sfnt_Name_Count \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_UInt ) FT_Get_Sfnt_Name_Count ( FT_Face face ); Retrieve the number of name strings in the SFNT \u2018name\u2019 table. input face A handle to the source face. return The number of strings in the \u2018name\u2019 table. note This function always returns an error if the config macro TT_CONFIG_OPTION_SFNT_NAMES is not defined in ftoption.h . FT_Get_Sfnt_Name \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_Error ) FT_Get_Sfnt_Name ( FT_Face face, FT_UInt idx, FT_SfntName *aname ); Retrieve a string of the SFNT \u2018name\u2019 table for a given index. input face A handle to the source face. idx The index of the \u2018name\u2019 string. output aname The indexed FT_SfntName structure. return FreeType error code. 0 means success. note The string array returned in the aname structure is not null-terminated. Note that you don't have to deallocate string by yourself; FreeType takes care of it if you call FT_Done_Face . Use FT_Get_Sfnt_Name_Count to get the total number of available \u2018name\u2019 table entries, then do a loop until you get the right platform, encoding, and name ID. \u2018name\u2019 table format 1 entries can use language tags also, see FT_Get_Sfnt_LangTag . This function always returns an error if the config macro TT_CONFIG_OPTION_SFNT_NAMES is not defined in ftoption.h . FT_SfntLangTag \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). typedef struct FT_SfntLangTag_ { FT_Byte * string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntLangTag ; A structure to model a language tag entry from an SFNT \u2018name\u2019 table. fields string The language tag string, encoded in UTF-16BE (without trailing NULL bytes). string_len The length of string in bytes . note Please refer to the TrueType or OpenType specification for more details. since 2.8 FT_Get_Sfnt_LangTag \u00b6 Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_Error ) FT_Get_Sfnt_LangTag ( FT_Face face, FT_UInt langID, FT_SfntLangTag *alangTag ); Retrieve the language tag associated with a language ID of an SFNT \u2018name\u2019 table entry. input face A handle to the source face. langID The language ID, as returned by FT_Get_Sfnt_Name . This is always a value larger than 0x8000. output alangTag The language tag associated with the \u2018name\u2019 table entry's language ID. return FreeType error code. 0 means success. note The string array returned in the alangTag structure is not null-terminated. Note that you don't have to deallocate string by yourself; FreeType takes care of it if you call FT_Done_Face . Only \u2018name\u2019 table format 1 supports language tags. For format 0 tables, this function always returns FT_Err_Invalid_Table. For invalid format 1 language ID values, FT_Err_Invalid_Argument is returned. This function always returns an error if the config macro TT_CONFIG_OPTION_SFNT_NAMES is not defined in ftoption.h . since 2.8","title":"SFNT Names"},{"location":"ft2-sfnt_names.html#sfnt-names","text":"","title":"SFNT Names"},{"location":"ft2-sfnt_names.html#synopsis","text":"The TrueType and OpenType specifications allow the inclusion of a special names table (\u2018name\u2019) in font files. This table contains textual (and internationalized) information regarding the font, like family name, copyright, version, etc. The definitions below are used to access them if available. Note that this has nothing to do with glyph names!","title":"Synopsis"},{"location":"ft2-sfnt_names.html#ft_sfntname","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). typedef struct FT_SfntName_ { FT_UShort platform_id; FT_UShort encoding_id; FT_UShort language_id; FT_UShort name_id; FT_Byte * string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntName ; A structure used to model an SFNT \u2018name\u2019 table entry.","title":"FT_SfntName"},{"location":"ft2-sfnt_names.html#ft_get_sfnt_name_count","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_UInt ) FT_Get_Sfnt_Name_Count ( FT_Face face ); Retrieve the number of name strings in the SFNT \u2018name\u2019 table.","title":"FT_Get_Sfnt_Name_Count"},{"location":"ft2-sfnt_names.html#ft_get_sfnt_name","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_Error ) FT_Get_Sfnt_Name ( FT_Face face, FT_UInt idx, FT_SfntName *aname ); Retrieve a string of the SFNT \u2018name\u2019 table for a given index.","title":"FT_Get_Sfnt_Name"},{"location":"ft2-sfnt_names.html#ft_sfntlangtag","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). typedef struct FT_SfntLangTag_ { FT_Byte * string; /* this string is *not* null-terminated! */ FT_UInt string_len; /* in bytes */ } FT_SfntLangTag ; A structure to model a language tag entry from an SFNT \u2018name\u2019 table.","title":"FT_SfntLangTag"},{"location":"ft2-sfnt_names.html#ft_get_sfnt_langtag","text":"Defined in FT_SFNT_NAMES_H (freetype/ftsnames.h). FT_EXPORT( FT_Error ) FT_Get_Sfnt_LangTag ( FT_Face face, FT_UInt langID, FT_SfntLangTag *alangTag ); Retrieve the language tag associated with a language ID of an SFNT \u2018name\u2019 table entry.","title":"FT_Get_Sfnt_LangTag"},{"location":"ft2-sizes_management.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb Size Management Size Management \u00b6 Synopsis \u00b6 When creating a new face object (e.g., with FT_New_Face ), an FT_Size object is automatically created and used to store all pixel-size dependent information, available in the face->size field. It is however possible to create more sizes for a given face, mostly in order to manage several character pixel sizes of the same font family and style. See FT_New_Size and FT_Done_Size . Note that FT_Set_Pixel_Sizes and FT_Set_Char_Size only modify the contents of the current \u2018active\u2019 size; you thus need to use FT_Activate_Size to change it. 99% of applications won't need the functions provided here, especially if they use the caching sub-system, so be cautious when using these. FT_New_Size \u00b6 Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_New_Size ( FT_Face face, FT_Size * size ); Create a new size object from a given face object. input face A handle to a parent face object. output asize A handle to a new size object. return FreeType error code. 0 means success. note You need to call FT_Activate_Size in order to select the new size for upcoming calls to FT_Set_Pixel_Sizes , FT_Set_Char_Size , FT_Load_Glyph , FT_Load_Char , etc. FT_Done_Size \u00b6 Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_Done_Size ( FT_Size size ); Discard a given size object. Note that FT_Done_Face automatically discards all size objects allocated with FT_New_Size . input size A handle to a target size object. return FreeType error code. 0 means success. FT_Activate_Size \u00b6 Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_Activate_Size ( FT_Size size ); Even though it is possible to create several size objects for a given face (see FT_New_Size for details), functions like FT_Load_Glyph or FT_Load_Char only use the one that has been activated last to determine the \u2018current character pixel size\u2019. This function can be used to \u2018activate\u2019 a previously created size object. input size A handle to a target size object. return FreeType error code. 0 means success. note If face is the size's parent face object, this function changes the value of face->size to the input size handle.","title":"Size Management"},{"location":"ft2-sizes_management.html#size-management","text":"","title":"Size Management"},{"location":"ft2-sizes_management.html#synopsis","text":"When creating a new face object (e.g., with FT_New_Face ), an FT_Size object is automatically created and used to store all pixel-size dependent information, available in the face->size field. It is however possible to create more sizes for a given face, mostly in order to manage several character pixel sizes of the same font family and style. See FT_New_Size and FT_Done_Size . Note that FT_Set_Pixel_Sizes and FT_Set_Char_Size only modify the contents of the current \u2018active\u2019 size; you thus need to use FT_Activate_Size to change it. 99% of applications won't need the functions provided here, especially if they use the caching sub-system, so be cautious when using these.","title":"Synopsis"},{"location":"ft2-sizes_management.html#ft_new_size","text":"Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_New_Size ( FT_Face face, FT_Size * size ); Create a new size object from a given face object.","title":"FT_New_Size"},{"location":"ft2-sizes_management.html#ft_done_size","text":"Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_Done_Size ( FT_Size size ); Discard a given size object. Note that FT_Done_Face automatically discards all size objects allocated with FT_New_Size .","title":"FT_Done_Size"},{"location":"ft2-sizes_management.html#ft_activate_size","text":"Defined in FT_SIZES_H (freetype/ftsizes.h). FT_EXPORT( FT_Error ) FT_Activate_Size ( FT_Size size ); Even though it is possible to create several size objects for a given face (see FT_New_Size for details), functions like FT_Load_Glyph or FT_Load_Char only use the one that has been activated last to determine the \u2018current character pixel size\u2019. This function can be used to \u2018activate\u2019 a previously created size object.","title":"FT_Activate_Size"},{"location":"ft2-svg_fonts.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb OpenType SVG Fonts OpenType SVG Fonts \u00b6 Synopsis \u00b6 This section describes the four hooks necessary to render SVG \u2018documents\u2019 that are contained in an OpenType font's \u2018SVG \u2019 table. For more information on the implementation, see our standard hooks based on \u2018librsvg\u2019 in the FreeType Demo Programs repository. SVG_Lib_Init_Func \u00b6 Defined in FT_OTSVG_H (freetype/otsvg.h). typedef FT_Error (* SVG_Lib_Init_Func )( FT_Pointer *data_pointer ); A callback that is called when the first OT-SVG glyph is rendered in the lifetime of an FT_Library object. In a typical implementation, one would want to allocate a structure and point the data_pointer to it and perform any library initializations that might be needed. inout data_pointer The SVG rendering module stores a pointer variable that can be used by clients to store any data that needs to be shared across different hooks. data_pointer is essentially a pointer to that pointer such that it can be written to as well as read from. return FreeType error code. 0 means success. since 2.12 SVG_Lib_Free_Func \u00b6 Defined in FT_OTSVG_H (freetype/otsvg.h). typedef void (* SVG_Lib_Free_Func )( FT_Pointer *data_pointer ); A callback that is called when the ot-svg module is being freed. It is only called if the init hook was called earlier. This means that neither the init nor the free hook is called if no OT-SVG glyph is rendered. In a typical implementation, one would want to free any state structure that was allocated in the init hook and perform any library-related closure that might be needed. inout data_pointer The SVG rendering module stores a pointer variable that can be used by clients to store any data that needs to be shared across different hooks. data_pointer is essentially a pointer to that pointer such that it can be written to as well as read from. since 2.12 SVG_Lib_Render_Func \u00b6 Defined in FT_OTSVG_H (freetype/otsvg.h). typedef FT_Error (* SVG_Lib_Render_Func )( FT_GlyphSlot slot, FT_Pointer *data_pointer ); A callback that is called to render an OT-SVG glyph. This callback hook is called right after the preset hook SVG_Lib_Preset_Slot_Func has been called with cache set to TRUE . The data necessary to render is available through the handle FT_SVG_Document , which is set in the other field of FT_GlyphSlotRec . The render hook is expected to render the SVG glyph to the bitmap buffer that is allocated already at slot->bitmap.buffer . It also sets the num_grays value as well as slot->format . input slot The slot to render. inout data_pointer The SVG rendering module stores a pointer variable that can be used by clients to store any data that needs to be shared across different hooks. data_pointer is essentially a pointer to that pointer such that it can be written to as well as read from. return FreeType error code. 0 means success. since 2.12 SVG_Lib_Preset_Slot_Func \u00b6 Defined in FT_OTSVG_H (freetype/otsvg.h). typedef FT_Error (* SVG_Lib_Preset_Slot_Func )( FT_GlyphSlot slot, FT_Bool cache, FT_Pointer *state ); A callback that is called to preset the glyph slot. It is called from two places. When FT_Load_Glyph needs to preset the glyph slot. Right before the svg module calls the render callback hook. When it is the former, the argument cache is set to FALSE . When it is the latter, the argument cache is set to TRUE . This distinction has been made because many calculations that are necessary for presetting a glyph slot are the same needed later for the render callback hook. Thus, if cache is TRUE , the hook can cache those calculations in a memory block referenced by the state pointer. This hook is expected to preset the slot by setting parameters such as bitmap_left , bitmap_top , width , rows , pitch , and pixel_mode . It is also expected to set all the metrics for the slot including the vertical advance if it is not already set. Typically, fonts have horizontal advances but not vertical ones. If those are available, they had already been set, otherwise they have to be estimated and set manually. The hook must take into account the transformations that have been set, and translate the transformation matrices into the SVG coordinate system, as the original matrix is intended for the TTF/CFF coordinate system. input slot The glyph slot that has the SVG document loaded. cache See description. inout data_pointer The SVG rendering module stores a pointer variable that can be used by clients to store any data that needs to be shared across different hooks. data_pointer is essentially a pointer to that pointer such that it can be written to as well as read from. return FreeType error code. 0 means success. since 2.12 SVG_RendererHooks \u00b6 Defined in FT_OTSVG_H (freetype/otsvg.h). typedef struct SVG_RendererHooks_ { SVG_Lib_Init_Func init_svg; SVG_Lib_Free_Func free_svg; SVG_Lib_Render_Func render_svg; SVG_Lib_Preset_Slot_Func preset_slot; } SVG_RendererHooks ; A structure that stores the four hooks needed to render OT-SVG glyphs properly. The structure is publicly used to set the hooks via the svg-hooks driver property. The behavior of each hook is described in its documentation. One thing to note is that the preset hook and the render hook often need to do the same operations; therefore, it's better to cache the intermediate data in a state structure to avoid calculating it twice. For example, in the preset hook one can draw the glyph on a recorder surface and later create a bitmap surface from it in the render hook. All four hooks must be non-NULL. fields init_svg The initialization hook. free_svg The cleanup hook. render_hook The render hook. preset_slot The preset hook. since 2.12 FT_SVG_DocumentRec \u00b6 Defined in FT_OTSVG_H (freetype/otsvg.h). typedef struct FT_SVG_DocumentRec_ { FT_Byte * svg_document; FT_ULong svg_document_length; FT_Size_Metrics metrics; FT_UShort units_per_EM; FT_UShort start_glyph_id; FT_UShort end_glyph_id; FT_Matrix transform; FT_Vector delta; } FT_SVG_DocumentRec ; A structure that models one SVG document. fields svg_document A pointer to the SVG document. svg_document_length The length of svg_document . metrics A metrics object storing the size information. units_per_EM The size of the EM square. start_glyph_id The first glyph ID in the glyph range covered by this document. end_glyph_id The last glyph ID in the glyph range covered by this document. transform A 2x2 transformation matrix to apply to the glyph while rendering it. delta The translation to apply to the glyph while rendering. note When an FT_GlyphSlot object slot is passed down to a renderer, the renderer can only access the metrics and units_per_EM fields via slot->face . However, when FT_Glyph_To_Bitmap sets up a dummy object, it has no way to set a face object. Thus, metrics information and units_per_EM (which is necessary for OT-SVG) has to be stored separately. since 2.12 FT_SVG_Document \u00b6 Defined in FT_OTSVG_H (freetype/otsvg.h). typedef struct FT_SVG_DocumentRec_* FT_SVG_Document ; FT_END_HEADER # endif /* OTSVG_H_ */ /* END */ A handle to an FT_SVG_DocumentRec object. since 2.12","title":"OpenType SVG Fonts"},{"location":"ft2-svg_fonts.html#opentype-svg-fonts","text":"","title":"OpenType SVG Fonts"},{"location":"ft2-svg_fonts.html#synopsis","text":"This section describes the four hooks necessary to render SVG \u2018documents\u2019 that are contained in an OpenType font's \u2018SVG \u2019 table. For more information on the implementation, see our standard hooks based on \u2018librsvg\u2019 in the FreeType Demo Programs repository.","title":"Synopsis"},{"location":"ft2-svg_fonts.html#svg_lib_init_func","text":"Defined in FT_OTSVG_H (freetype/otsvg.h). typedef FT_Error (* SVG_Lib_Init_Func )( FT_Pointer *data_pointer ); A callback that is called when the first OT-SVG glyph is rendered in the lifetime of an FT_Library object. In a typical implementation, one would want to allocate a structure and point the data_pointer to it and perform any library initializations that might be needed.","title":"SVG_Lib_Init_Func"},{"location":"ft2-svg_fonts.html#svg_lib_free_func","text":"Defined in FT_OTSVG_H (freetype/otsvg.h). typedef void (* SVG_Lib_Free_Func )( FT_Pointer *data_pointer ); A callback that is called when the ot-svg module is being freed. It is only called if the init hook was called earlier. This means that neither the init nor the free hook is called if no OT-SVG glyph is rendered. In a typical implementation, one would want to free any state structure that was allocated in the init hook and perform any library-related closure that might be needed.","title":"SVG_Lib_Free_Func"},{"location":"ft2-svg_fonts.html#svg_lib_render_func","text":"Defined in FT_OTSVG_H (freetype/otsvg.h). typedef FT_Error (* SVG_Lib_Render_Func )( FT_GlyphSlot slot, FT_Pointer *data_pointer ); A callback that is called to render an OT-SVG glyph. This callback hook is called right after the preset hook SVG_Lib_Preset_Slot_Func has been called with cache set to TRUE . The data necessary to render is available through the handle FT_SVG_Document , which is set in the other field of FT_GlyphSlotRec . The render hook is expected to render the SVG glyph to the bitmap buffer that is allocated already at slot->bitmap.buffer . It also sets the num_grays value as well as slot->format .","title":"SVG_Lib_Render_Func"},{"location":"ft2-svg_fonts.html#svg_lib_preset_slot_func","text":"Defined in FT_OTSVG_H (freetype/otsvg.h). typedef FT_Error (* SVG_Lib_Preset_Slot_Func )( FT_GlyphSlot slot, FT_Bool cache, FT_Pointer *state ); A callback that is called to preset the glyph slot. It is called from two places. When FT_Load_Glyph needs to preset the glyph slot. Right before the svg module calls the render callback hook. When it is the former, the argument cache is set to FALSE . When it is the latter, the argument cache is set to TRUE . This distinction has been made because many calculations that are necessary for presetting a glyph slot are the same needed later for the render callback hook. Thus, if cache is TRUE , the hook can cache those calculations in a memory block referenced by the state pointer. This hook is expected to preset the slot by setting parameters such as bitmap_left , bitmap_top , width , rows , pitch , and pixel_mode . It is also expected to set all the metrics for the slot including the vertical advance if it is not already set. Typically, fonts have horizontal advances but not vertical ones. If those are available, they had already been set, otherwise they have to be estimated and set manually. The hook must take into account the transformations that have been set, and translate the transformation matrices into the SVG coordinate system, as the original matrix is intended for the TTF/CFF coordinate system.","title":"SVG_Lib_Preset_Slot_Func"},{"location":"ft2-svg_fonts.html#svg_rendererhooks","text":"Defined in FT_OTSVG_H (freetype/otsvg.h). typedef struct SVG_RendererHooks_ { SVG_Lib_Init_Func init_svg; SVG_Lib_Free_Func free_svg; SVG_Lib_Render_Func render_svg; SVG_Lib_Preset_Slot_Func preset_slot; } SVG_RendererHooks ; A structure that stores the four hooks needed to render OT-SVG glyphs properly. The structure is publicly used to set the hooks via the svg-hooks driver property. The behavior of each hook is described in its documentation. One thing to note is that the preset hook and the render hook often need to do the same operations; therefore, it's better to cache the intermediate data in a state structure to avoid calculating it twice. For example, in the preset hook one can draw the glyph on a recorder surface and later create a bitmap surface from it in the render hook. All four hooks must be non-NULL.","title":"SVG_RendererHooks"},{"location":"ft2-svg_fonts.html#ft_svg_documentrec","text":"Defined in FT_OTSVG_H (freetype/otsvg.h). typedef struct FT_SVG_DocumentRec_ { FT_Byte * svg_document; FT_ULong svg_document_length; FT_Size_Metrics metrics; FT_UShort units_per_EM; FT_UShort start_glyph_id; FT_UShort end_glyph_id; FT_Matrix transform; FT_Vector delta; } FT_SVG_DocumentRec ; A structure that models one SVG document.","title":"FT_SVG_DocumentRec"},{"location":"ft2-svg_fonts.html#ft_svg_document","text":"Defined in FT_OTSVG_H (freetype/otsvg.h). typedef struct FT_SVG_DocumentRec_* FT_SVG_Document ; FT_END_HEADER # endif /* OTSVG_H_ */ /* END */ A handle to an FT_SVG_DocumentRec object.","title":"FT_SVG_Document"},{"location":"ft2-system_interface.html","text":"FreeType \u00bb Docs \u00bb Support API \u00bb System Interface System Interface \u00b6 Synopsis \u00b6 This section contains various definitions related to memory management and i/o access. You need to understand this information if you want to use a custom memory manager or you own i/o streams. FT_Memory \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_MemoryRec_* FT_Memory ; A handle to a given memory manager object, defined with an FT_MemoryRec structure. FT_Alloc_Func \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void * (* FT_Alloc_Func )( FT_Memory memory, long size ); A function used to allocate size bytes from memory . input memory A handle to the source memory manager. size The size in bytes to allocate. return Address of new memory block. 0 in case of failure. FT_Free_Func \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void (* FT_Free_Func )( FT_Memory memory, void * block ); A function used to release a given block of memory. input memory A handle to the source memory manager. block The address of the target memory block. FT_Realloc_Func \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void * (* FT_Realloc_Func )( FT_Memory memory, long cur_size, long new_size, void * block ); A function used to re-allocate a given block of memory. input memory A handle to the source memory manager. cur_size The block's current size in bytes. new_size The block's requested new size. block The block's current address. return New block address. 0 in case of memory shortage. note In case of error, the old block must still be available. FT_MemoryRec \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). struct FT_MemoryRec_ { void * user; FT_Alloc_Func alloc; FT_Free_Func free; FT_Realloc_Func realloc; }; A structure used to describe a given memory manager to FreeType 2. fields user A generic typeless pointer for user data. alloc A pointer type to an allocation function. free A pointer type to an memory freeing function. realloc A pointer type to a reallocation function. FT_Stream \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_StreamRec_* FT_Stream ; A handle to an input stream. also See FT_StreamRec for the publicly accessible fields of a given stream object. FT_StreamDesc \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef union FT_StreamDesc_ { long value; void * pointer; } FT_StreamDesc ; A union type used to store either a long or a pointer. This is used to store a file descriptor or a FILE* in an input stream. FT_Stream_IoFunc \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef unsigned long (* FT_Stream_IoFunc )( FT_Stream stream, unsigned long offset, unsigned char * buffer, unsigned long count ); A function used to seek and read data from a given input stream. input stream A handle to the source stream. offset The offset of read in stream (always from start). buffer The address of the read buffer. count The number of bytes to read from the stream. return The number of bytes effectively read by the stream. note This function might be called to perform a seek or skip operation with a count of 0. A non-zero return value then indicates an error. FT_Stream_CloseFunc \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void (* FT_Stream_CloseFunc )( FT_Stream stream ); A function used to close a given input stream. input stream A handle to the target stream. FT_StreamRec \u00b6 Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_StreamRec_ { unsigned char * base; unsigned long size; unsigned long pos; FT_StreamDesc descriptor; FT_StreamDesc pathname; FT_Stream_IoFunc read; FT_Stream_CloseFunc close; FT_Memory memory; unsigned char * cursor; unsigned char * limit; } FT_StreamRec ; A structure used to describe an input stream. input base For memory-based streams, this is the address of the first stream byte in memory. This field should always be set to NULL for disk-based streams. size The stream size in bytes. In case of compressed streams where the size is unknown before actually doing the decompression, the value is set to 0x7FFFFFFF. (Note that this size value can occur for normal streams also; it is thus just a hint.) pos The current position within the stream. descriptor This field is a union that can hold an integer or a pointer. It is used by stream implementations to store file descriptors or FILE* pointers. pathname This field is completely ignored by FreeType. However, it is often useful during debugging to use it to store the stream's filename (where available). read The stream's input function. close The stream's close function. memory The memory manager to use to preload frames. This is set internally by FreeType and shouldn't be touched by stream implementations. cursor This field is set and used internally by FreeType when parsing frames. In particular, the FT_GET_XXX macros use this instead of the pos field. limit This field is set and used internally by FreeType when parsing frames.","title":"System Interface"},{"location":"ft2-system_interface.html#system-interface","text":"","title":"System Interface"},{"location":"ft2-system_interface.html#synopsis","text":"This section contains various definitions related to memory management and i/o access. You need to understand this information if you want to use a custom memory manager or you own i/o streams.","title":"Synopsis"},{"location":"ft2-system_interface.html#ft_memory","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_MemoryRec_* FT_Memory ; A handle to a given memory manager object, defined with an FT_MemoryRec structure.","title":"FT_Memory"},{"location":"ft2-system_interface.html#ft_alloc_func","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void * (* FT_Alloc_Func )( FT_Memory memory, long size ); A function used to allocate size bytes from memory .","title":"FT_Alloc_Func"},{"location":"ft2-system_interface.html#ft_free_func","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void (* FT_Free_Func )( FT_Memory memory, void * block ); A function used to release a given block of memory.","title":"FT_Free_Func"},{"location":"ft2-system_interface.html#ft_realloc_func","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void * (* FT_Realloc_Func )( FT_Memory memory, long cur_size, long new_size, void * block ); A function used to re-allocate a given block of memory.","title":"FT_Realloc_Func"},{"location":"ft2-system_interface.html#ft_memoryrec","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). struct FT_MemoryRec_ { void * user; FT_Alloc_Func alloc; FT_Free_Func free; FT_Realloc_Func realloc; }; A structure used to describe a given memory manager to FreeType 2.","title":"FT_MemoryRec"},{"location":"ft2-system_interface.html#ft_stream","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_StreamRec_* FT_Stream ; A handle to an input stream.","title":"FT_Stream"},{"location":"ft2-system_interface.html#ft_streamdesc","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef union FT_StreamDesc_ { long value; void * pointer; } FT_StreamDesc ; A union type used to store either a long or a pointer. This is used to store a file descriptor or a FILE* in an input stream.","title":"FT_StreamDesc"},{"location":"ft2-system_interface.html#ft_stream_iofunc","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef unsigned long (* FT_Stream_IoFunc )( FT_Stream stream, unsigned long offset, unsigned char * buffer, unsigned long count ); A function used to seek and read data from a given input stream.","title":"FT_Stream_IoFunc"},{"location":"ft2-system_interface.html#ft_stream_closefunc","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef void (* FT_Stream_CloseFunc )( FT_Stream stream ); A function used to close a given input stream.","title":"FT_Stream_CloseFunc"},{"location":"ft2-system_interface.html#ft_streamrec","text":"Defined in FT_SYSTEM_H (freetype/ftsystem.h). typedef struct FT_StreamRec_ { unsigned char * base; unsigned long size; unsigned long pos; FT_StreamDesc descriptor; FT_StreamDesc pathname; FT_Stream_IoFunc read; FT_Stream_CloseFunc close; FT_Memory memory; unsigned char * cursor; unsigned char * limit; } FT_StreamRec ; A structure used to describe an input stream.","title":"FT_StreamRec"},{"location":"ft2-t1_cid_driver.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The Type 1 and CID drivers The Type 1 and CID drivers \u00b6 Synopsis \u00b6 It is possible to control the behaviour of FreeType's Type 1 and Type 1 CID drivers with FT_Property_Set and FT_Property_Get . Behind the scenes, both drivers use the Adobe CFF engine for hinting; however, the used properties must be specified separately. The Type 1 driver's module name is \u2018type1\u2019; the CID driver's module name is \u2018t1cid\u2019. Available properties are hinting-engine , no-stem-darkening , darkening-parameters , and random-seed , as documented in the \u2018 Driver properties \u2019 section. Please see the \u2018 The CFF driver \u2019 section for more details on the new hinting engine.","title":"The Type 1 and CID drivers"},{"location":"ft2-t1_cid_driver.html#the-type-1-and-cid-drivers","text":"","title":"The Type 1 and CID drivers"},{"location":"ft2-t1_cid_driver.html#synopsis","text":"It is possible to control the behaviour of FreeType's Type 1 and Type 1 CID drivers with FT_Property_Set and FT_Property_Get . Behind the scenes, both drivers use the Adobe CFF engine for hinting; however, the used properties must be specified separately. The Type 1 driver's module name is \u2018type1\u2019; the CID driver's module name is \u2018t1cid\u2019. Available properties are hinting-engine , no-stem-darkening , darkening-parameters , and random-seed , as documented in the \u2018 Driver properties \u2019 section. Please see the \u2018 The CFF driver \u2019 section for more details on the new hinting engine.","title":"Synopsis"},{"location":"ft2-truetype_engine.html","text":"FreeType \u00bb Docs \u00bb Miscellaneous \u00bb The TrueType Engine The TrueType Engine \u00b6 Synopsis \u00b6 This section contains a function used to query the level of TrueType bytecode support compiled in this version of the library. FT_TrueTypeEngineType \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef enum FT_TrueTypeEngineType_ { FT_TRUETYPE_ENGINE_TYPE_NONE = 0, FT_TRUETYPE_ENGINE_TYPE_UNPATENTED , FT_TRUETYPE_ENGINE_TYPE_PATENTED } FT_TrueTypeEngineType ; A list of values describing which kind of TrueType bytecode engine is implemented in a given FT_Library instance. It is used by the FT_Get_TrueType_Engine_Type function. values FT_TRUETYPE_ENGINE_TYPE_NONE The library doesn't implement any kind of bytecode interpreter. FT_TRUETYPE_ENGINE_TYPE_UNPATENTED Deprecated and removed. FT_TRUETYPE_ENGINE_TYPE_PATENTED The library implements a bytecode interpreter that covers the full instruction set of the TrueType virtual machine (this was governed by patents until May 2010, hence the name). since 2.2 FT_Get_TrueType_Engine_Type \u00b6 Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_TrueTypeEngineType ) FT_Get_TrueType_Engine_Type ( FT_Library library ); Return an FT_TrueTypeEngineType value to indicate which level of the TrueType virtual machine a given library instance supports. input library A library instance. return A value indicating which level is supported. since 2.2","title":"The TrueType Engine"},{"location":"ft2-truetype_engine.html#the-truetype-engine","text":"","title":"The TrueType Engine"},{"location":"ft2-truetype_engine.html#synopsis","text":"This section contains a function used to query the level of TrueType bytecode support compiled in this version of the library.","title":"Synopsis"},{"location":"ft2-truetype_engine.html#ft_truetypeenginetype","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). typedef enum FT_TrueTypeEngineType_ { FT_TRUETYPE_ENGINE_TYPE_NONE = 0, FT_TRUETYPE_ENGINE_TYPE_UNPATENTED , FT_TRUETYPE_ENGINE_TYPE_PATENTED } FT_TrueTypeEngineType ; A list of values describing which kind of TrueType bytecode engine is implemented in a given FT_Library instance. It is used by the FT_Get_TrueType_Engine_Type function.","title":"FT_TrueTypeEngineType"},{"location":"ft2-truetype_engine.html#ft_get_truetype_engine_type","text":"Defined in FT_MODULE_H (freetype/ftmodapi.h). FT_EXPORT( FT_TrueTypeEngineType ) FT_Get_TrueType_Engine_Type ( FT_Library library ); Return an FT_TrueTypeEngineType value to indicate which level of the TrueType virtual machine a given library instance supports.","title":"FT_Get_TrueType_Engine_Type"},{"location":"ft2-truetype_tables.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb TrueType Tables TrueType Tables \u00b6 Synopsis \u00b6 This section contains definitions of some basic tables specific to TrueType and OpenType as well as some routines used to access and process them. TT_Header \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_Header_ { FT_Fixed Table_Version; FT_Fixed Font_Revision; FT_Long CheckSum_Adjust; FT_Long Magic_Number; FT_UShort Flags; FT_UShort Units_Per_EM; FT_ULong Created [2]; FT_ULong Modified[2]; FT_Short xMin; FT_Short yMin; FT_Short xMax; FT_Short yMax; FT_UShort Mac_Style; FT_UShort Lowest_Rec_PPEM; FT_Short Font_Direction; FT_Short Index_To_Loc_Format; FT_Short Glyph_Data_Format; } TT_Header ; A structure to model a TrueType font header table. All fields follow the OpenType specification. The 64-bit timestamps are stored in two-element arrays Created and Modified , first the upper then the lower 32 bits. TT_HoriHeader \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_HoriHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Width_Max; /* advance width maximum */ FT_Short min_Left_Side_Bearing; /* minimum left-sb */ FT_Short min_Right_Side_Bearing; /* minimum right-sb */ FT_Short xMax_Extent; /* xmax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_HMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* 'hmtx' table. */ void * long_metrics; void * short_metrics; } TT_HoriHeader ; A structure to model a TrueType horizontal header, the \u2018hhea\u2019 table, as well as the corresponding horizontal metrics table, \u2018hmtx\u2019. fields Version The table version. Ascender The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font. This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII). You should use the sTypoAscender field of the \u2018OS/2\u2019 table instead if you want the correct one. Descender The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative. This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII). You should use the sTypoDescender field of the \u2018OS/2\u2019 table instead if you want the correct one. Line_Gap The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font. advance_Width_Max This field is the maximum of all advance widths found in the font. It can be used to compute the maximum width of an arbitrary string of text. min_Left_Side_Bearing The minimum left side bearing of all glyphs within the font. min_Right_Side_Bearing The minimum right side bearing of all glyphs within the font. xMax_Extent The maximum horizontal extent (i.e., the \u2018width\u2019 of a glyph's bounding box) for all glyphs in the font. caret_Slope_Rise The rise coefficient of the cursor's slope of the cursor (slope=rise/run). caret_Slope_Run The run coefficient of the cursor's slope. caret_Offset The cursor's offset for slanted fonts. Reserved 8 reserved bytes. metric_Data_Format Always 0. number_Of_HMetrics Number of HMetrics entries in the \u2018hmtx\u2019 table \u2013 this value can be smaller than the total number of glyphs in the font. long_metrics A pointer into the \u2018hmtx\u2019 table. short_metrics A pointer into the \u2018hmtx\u2019 table. note For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: caret_Slope_Rise , caret_Slope_Run , and caret_Offset . TT_VertHeader \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_VertHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Height_Max; /* advance height maximum */ FT_Short min_Top_Side_Bearing; /* minimum top-sb */ FT_Short min_Bottom_Side_Bearing; /* minimum bottom-sb */ FT_Short yMax_Extent; /* ymax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_VMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* 'vmtx' table. */ void * long_metrics; void * short_metrics; } TT_VertHeader ; A structure used to model a TrueType vertical header, the \u2018vhea\u2019 table, as well as the corresponding vertical metrics table, \u2018vmtx\u2019. fields Version The table version. Ascender The font's ascender, i.e., the distance from the baseline to the top-most of all glyph points found in the font. This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII). You should use the sTypoAscender field of the \u2018OS/2\u2019 table instead if you want the correct one. Descender The font's descender, i.e., the distance from the baseline to the bottom-most of all glyph points found in the font. It is negative. This value is invalid in many fonts, as it is usually set by the font designer, and often reflects only a portion of the glyphs found in the font (maybe ASCII). You should use the sTypoDescender field of the \u2018OS/2\u2019 table instead if you want the correct one. Line_Gap The font's line gap, i.e., the distance to add to the ascender and descender to get the BTB, i.e., the baseline-to-baseline distance for the font. advance_Height_Max This field is the maximum of all advance heights found in the font. It can be used to compute the maximum height of an arbitrary string of text. min_Top_Side_Bearing The minimum top side bearing of all glyphs within the font. min_Bottom_Side_Bearing The minimum bottom side bearing of all glyphs within the font. yMax_Extent The maximum vertical extent (i.e., the \u2018height\u2019 of a glyph's bounding box) for all glyphs in the font. caret_Slope_Rise The rise coefficient of the cursor's slope of the cursor (slope=rise/run). caret_Slope_Run The run coefficient of the cursor's slope. caret_Offset The cursor's offset for slanted fonts. Reserved 8 reserved bytes. metric_Data_Format Always 0. number_Of_VMetrics Number of VMetrics entries in the \u2018vmtx\u2019 table \u2013 this value can be smaller than the total number of glyphs in the font. long_metrics A pointer into the \u2018vmtx\u2019 table. short_metrics A pointer into the \u2018vmtx\u2019 table. note For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: Ascender , Descender , Line_Gap , caret_Slope_Rise , caret_Slope_Run , and caret_Offset . TT_OS2 \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_OS2_ { FT_UShort version; /* 0x0001 - more or 0xFFFF */ FT_Short xAvgCharWidth; FT_UShort usWeightClass; FT_UShort usWidthClass; FT_UShort fsType; FT_Short ySubscriptXSize; FT_Short ySubscriptYSize; FT_Short ySubscriptXOffset; FT_Short ySubscriptYOffset; FT_Short ySuperscriptXSize; FT_Short ySuperscriptYSize; FT_Short ySuperscriptXOffset; FT_Short ySuperscriptYOffset; FT_Short yStrikeoutSize; FT_Short yStrikeoutPosition; FT_Short sFamilyClass; FT_Byte panose[10]; FT_ULong ulUnicodeRange1; /* Bits 0-31 */ FT_ULong ulUnicodeRange2; /* Bits 32-63 */ FT_ULong ulUnicodeRange3; /* Bits 64-95 */ FT_ULong ulUnicodeRange4; /* Bits 96-127 */ FT_Char achVendID[4]; FT_UShort fsSelection; FT_UShort usFirstCharIndex; FT_UShort usLastCharIndex; FT_Short sTypoAscender; FT_Short sTypoDescender; FT_Short sTypoLineGap; FT_UShort usWinAscent; FT_UShort usWinDescent; /* only version 1 and higher: */ FT_ULong ulCodePageRange1; /* Bits 0-31 */ FT_ULong ulCodePageRange2; /* Bits 32-63 */ /* only version 2 and higher: */ FT_Short sxHeight; FT_Short sCapHeight; FT_UShort usDefaultChar; FT_UShort usBreakChar; FT_UShort usMaxContext; /* only version 5 and higher: */ FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */ FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */ } TT_OS2 ; A structure to model a TrueType \u2018OS/2\u2019 table. All fields comply to the OpenType specification. Note that we now support old Mac fonts that do not include an \u2018OS/2\u2019 table. In this case, the version field is always set to 0xFFFF. note For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: sCapHeight , sTypoAscender , sTypoDescender , sTypoLineGap , sxHeight , usWinAscent , usWinDescent , yStrikeoutPosition , yStrikeoutSize , ySubscriptXOffset , ySubScriptXSize , ySubscriptYOffset , ySubscriptYSize , ySuperscriptXOffset , ySuperscriptXSize , ySuperscriptYOffset , and ySuperscriptYSize . Possible values for bits in the ulUnicodeRangeX fields are given by the TT_UCR_XXX macros. TT_Postscript \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_Postscript_ { FT_Fixed FormatType; FT_Fixed italicAngle; FT_Short underlinePosition; FT_Short underlineThickness; FT_ULong isFixedPitch; FT_ULong minMemType42; FT_ULong maxMemType42; FT_ULong minMemType1; FT_ULong maxMemType1; /* Glyph names follow in the 'post' table, but we don't */ /* load them by default. */ } TT_Postscript ; A structure to model a TrueType \u2018post\u2019 table. All fields comply to the OpenType specification. This structure does not reference a font's PostScript glyph names; use FT_Get_Glyph_Name to retrieve them. note For an OpenType variation font, the values of the following fields can change after a call to FT_Set_Var_Design_Coordinates (and friends) if the font contains an \u2018MVAR\u2019 table: underlinePosition and underlineThickness . TT_PCLT \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_PCLT_ { FT_Fixed Version; FT_ULong FontNumber; FT_UShort Pitch; FT_UShort xHeight; FT_UShort Style; FT_UShort TypeFamily; FT_UShort CapHeight; FT_UShort SymbolSet; FT_Char TypeFace[16]; FT_Char CharacterComplement[8]; FT_Char FileName[6]; FT_Char StrokeWeight; FT_Char WidthType; FT_Byte SerifStyle; FT_Byte Reserved; } TT_PCLT ; A structure to model a TrueType \u2018PCLT\u2019 table. All fields comply to the OpenType specification. TT_MaxProfile \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_MaxProfile_ { FT_Fixed version; FT_UShort numGlyphs; FT_UShort maxPoints; FT_UShort maxContours; FT_UShort maxCompositePoints; FT_UShort maxCompositeContours; FT_UShort maxZones; FT_UShort maxTwilightPoints; FT_UShort maxStorage; FT_UShort maxFunctionDefs; FT_UShort maxInstructionDefs; FT_UShort maxStackElements; FT_UShort maxSizeOfInstructions; FT_UShort maxComponentElements; FT_UShort maxComponentDepth; } TT_MaxProfile ; The maximum profile (\u2018maxp\u2019) table contains many max values, which can be used to pre-allocate arrays for speeding up glyph loading and hinting. fields version The version number. numGlyphs The number of glyphs in this TrueType font. maxPoints The maximum number of points in a non-composite TrueType glyph. See also maxCompositePoints . maxContours The maximum number of contours in a non-composite TrueType glyph. See also maxCompositeContours . maxCompositePoints The maximum number of points in a composite TrueType glyph. See also maxPoints . maxCompositeContours The maximum number of contours in a composite TrueType glyph. See also maxContours . maxZones The maximum number of zones used for glyph hinting. maxTwilightPoints The maximum number of points in the twilight zone used for glyph hinting. maxStorage The maximum number of elements in the storage area used for glyph hinting. maxFunctionDefs The maximum number of function definitions in the TrueType bytecode for this font. maxInstructionDefs The maximum number of instruction definitions in the TrueType bytecode for this font. maxStackElements The maximum number of stack elements used during bytecode interpretation. maxSizeOfInstructions The maximum number of TrueType opcodes used for glyph hinting. maxComponentElements The maximum number of simple (i.e., non-composite) glyphs in a composite glyph. maxComponentDepth The maximum nesting depth of composite glyphs. note This structure is only used during font loading. FT_Sfnt_Tag \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef enum FT_Sfnt_Tag_ { FT_SFNT_HEAD , FT_SFNT_MAXP , FT_SFNT_OS2 , FT_SFNT_HHEA , FT_SFNT_VHEA , FT_SFNT_POST , FT_SFNT_PCLT , FT_SFNT_MAX } FT_Sfnt_Tag ; /* these constants are deprecated; use the corresponding ` FT_Sfnt_Tag ` */ /* values instead */ # define ft_sfnt_head FT_SFNT_HEAD # define ft_sfnt_maxp FT_SFNT_MAXP # define ft_sfnt_os2 FT_SFNT_OS2 # define ft_sfnt_hhea FT_SFNT_HHEA # define ft_sfnt_vhea FT_SFNT_VHEA # define ft_sfnt_post FT_SFNT_POST # define ft_sfnt_pclt FT_SFNT_PCLT An enumeration to specify indices of SFNT tables loaded and parsed by FreeType during initialization of an SFNT font. Used in the FT_Get_Sfnt_Table API function. values FT_SFNT_HEAD To access the font's TT_Header structure. FT_SFNT_MAXP To access the font's TT_MaxProfile structure. FT_SFNT_OS2 To access the font's TT_OS2 structure. FT_SFNT_HHEA To access the font's TT_HoriHeader structure. FT_SFNT_VHEA To access the font's TT_VertHeader structure. FT_SFNT_POST To access the font's TT_Postscript structure. FT_SFNT_PCLT To access the font's TT_PCLT structure. FT_Get_Sfnt_Table \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( void * ) FT_Get_Sfnt_Table ( FT_Face face, FT_Sfnt_Tag tag ); Return a pointer to a given SFNT table stored within a face. input face A handle to the source. tag The index of the SFNT table. return A type-less pointer to the table. This will be NULL in case of error, or if the corresponding table was not found OR loaded from the file. Use a typecast according to tag to access the structure elements. note The table is owned by the face object and disappears with it. This function is only useful to access SFNT tables that are loaded by the sfnt, truetype, and opentype drivers. See FT_Sfnt_Tag for a list. example Here is an example demonstrating access to the \u2018vhea\u2019 table. TT_VertHeader* vert_header; vert_header = (TT_VertHeader*)FT_Get_Sfnt_Table( face, FT_SFNT_VHEA ); FT_Load_Sfnt_Table \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Error ) FT_Load_Sfnt_Table ( FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte * buffer, FT_ULong * length ); Load any SFNT font table into client memory. input face A handle to the source face. tag The four-byte tag of the table to load. Use value 0 if you want to access the whole font file. Otherwise, you can use one of the definitions found in the FT_TRUETYPE_TAGS_H file, or forge a new one with FT_MAKE_TAG . offset The starting offset in the table (or file if tag == 0). output buffer The target buffer address. The client must ensure that the memory array is big enough to hold the data. inout length If the length parameter is NULL , try to load the whole table. Return an error code if it fails. Else, if *length is 0, exit immediately while returning the table's (or file) full size in it. Else the number of bytes to read from the table or file, from the starting offset. return FreeType error code. 0 means success. note If you need to determine the table's length you should first call this function with *length set to 0, as in the following example: FT_ULong length = 0; error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); if ( error ) { ... table does not exist ... } buffer = malloc( length ); if ( buffer == NULL ) { ... not enough memory ... } error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); if ( error ) { ... could not load table ... } Note that structures like TT_Header or TT_OS2 can't be used with this function; they are limited to FT_Get_Sfnt_Table . Reason is that those structures depend on the processor architecture, with varying size (e.g. 32bit vs. 64bit) or order (big endian vs. little endian). FT_Sfnt_Table_Info \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Error ) FT_Sfnt_Table_Info ( FT_Face face, FT_UInt table_index, FT_ULong *tag, FT_ULong *length ); Return information on an SFNT table. input face A handle to the source face. table_index The index of an SFNT table. The function returns FT_Err_Table_Missing for an invalid value. inout tag The name tag of the SFNT table. If the value is NULL , table_index is ignored, and length returns the number of SFNT tables in the font. output length The length of the SFNT table (or the number of SFNT tables, depending on tag ). return FreeType error code. 0 means success. note While parsing fonts, FreeType handles SFNT tables with length zero as missing. FT_Get_CMap_Language_ID \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_ULong ) FT_Get_CMap_Language_ID ( FT_CharMap charmap ); Return cmap language ID as specified in the OpenType standard. Definitions of language ID values are in file FT_TRUETYPE_IDS_H . input charmap The target charmap. return The language ID of charmap . If charmap doesn't belong to an SFNT face, just return 0 as the default value. For a format 14 cmap (to access Unicode IVS), the return value is 0xFFFFFFFF. FT_Get_CMap_Format \u00b6 Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Long ) FT_Get_CMap_Format ( FT_CharMap charmap ); Return the format of an SFNT \u2018cmap\u2019 table. input charmap The target charmap. return The format of charmap . If charmap doesn't belong to an SFNT face, return -1. FT_PARAM_TAG_UNPATENTED_HINTING \u00b6 # define FT_PARAM_TAG_UNPATENTED_HINTING \\ FT_MAKE_TAG ( 'u', 'n', 'p', 'a' ) Deprecated, no effect. Previously: A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face . TT_PLATFORM_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_PLATFORM_APPLE_UNICODE 0 # define TT_PLATFORM_MACINTOSH 1 # define TT_PLATFORM_ISO 2 /* deprecated */ # define TT_PLATFORM_MICROSOFT 3 # define TT_PLATFORM_CUSTOM 4 # define TT_PLATFORM_ADOBE 7 /* artificial */ A list of valid values for the platform_id identifier code in FT_CharMapRec and FT_SfntName structures. values TT_PLATFORM_APPLE_UNICODE Used by Apple to indicate a Unicode character map and/or name entry. See TT_APPLE_ID_XXX for corresponding encoding_id values. Note that name entries in this format are coded as big-endian UCS-2 character codes only . TT_PLATFORM_MACINTOSH Used by Apple to indicate a MacOS-specific charmap and/or name entry. See TT_MAC_ID_XXX for corresponding encoding_id values. Note that most TrueType fonts contain an Apple roman charmap to be usable on MacOS systems (even if they contain a Microsoft charmap as well). TT_PLATFORM_ISO This value was used to specify ISO/IEC 10646 charmaps. It is however now deprecated. See TT_ISO_ID_XXX for a list of corresponding encoding_id values. TT_PLATFORM_MICROSOFT Used by Microsoft to indicate Windows-specific charmaps. See TT_MS_ID_XXX for a list of corresponding encoding_id values. Note that most fonts contain a Unicode charmap using ( TT_PLATFORM_MICROSOFT , TT_MS_ID_UNICODE_CS ). TT_PLATFORM_CUSTOM Used to indicate application-specific charmaps. TT_PLATFORM_ADOBE This value isn't part of any font format specification, but is used by FreeType to report Adobe-specific charmaps in an FT_CharMapRec structure. See TT_ADOBE_ID_XXX . TT_APPLE_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ # define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ # define TT_APPLE_ID_ISO_10646 2 /* deprecated */ # define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ # define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ # define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */ # define TT_APPLE_ID_FULL_UNICODE 6 /* used with type 13 cmaps */ A list of valid values for the encoding_id for TT_PLATFORM_APPLE_UNICODE charmaps and name entries. values TT_APPLE_ID_DEFAULT Unicode version 1.0. TT_APPLE_ID_UNICODE_1_1 Unicode 1.1; specifies Hangul characters starting at U+34xx. TT_APPLE_ID_ISO_10646 Deprecated (identical to preceding). TT_APPLE_ID_UNICODE_2_0 Unicode 2.0 and beyond (UTF-16 BMP only). TT_APPLE_ID_UNICODE_32 Unicode 3.1 and beyond, using UTF-32. TT_APPLE_ID_VARIANT_SELECTOR From Adobe, not Apple. Not a normal cmap. Specifies variations on a real cmap. TT_APPLE_ID_FULL_UNICODE Used for fallback fonts that provide complete Unicode coverage with a type 13 cmap. TT_MAC_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MAC_ID_ROMAN 0 # define TT_MAC_ID_JAPANESE 1 # define TT_MAC_ID_TRADITIONAL_CHINESE 2 # define TT_MAC_ID_KOREAN 3 # define TT_MAC_ID_ARABIC 4 # define TT_MAC_ID_HEBREW 5 # define TT_MAC_ID_GREEK 6 # define TT_MAC_ID_RUSSIAN 7 # define TT_MAC_ID_RSYMBOL 8 # define TT_MAC_ID_DEVANAGARI 9 # define TT_MAC_ID_GURMUKHI 10 # define TT_MAC_ID_GUJARATI 11 # define TT_MAC_ID_ORIYA 12 # define TT_MAC_ID_BENGALI 13 # define TT_MAC_ID_TAMIL 14 # define TT_MAC_ID_TELUGU 15 # define TT_MAC_ID_KANNADA 16 # define TT_MAC_ID_MALAYALAM 17 # define TT_MAC_ID_SINHALESE 18 # define TT_MAC_ID_BURMESE 19 # define TT_MAC_ID_KHMER 20 # define TT_MAC_ID_THAI 21 # define TT_MAC_ID_LAOTIAN 22 # define TT_MAC_ID_GEORGIAN 23 # define TT_MAC_ID_ARMENIAN 24 # define TT_MAC_ID_MALDIVIAN 25 # define TT_MAC_ID_SIMPLIFIED_CHINESE 25 # define TT_MAC_ID_TIBETAN 26 # define TT_MAC_ID_MONGOLIAN 27 # define TT_MAC_ID_GEEZ 28 # define TT_MAC_ID_SLAVIC 29 # define TT_MAC_ID_VIETNAMESE 30 # define TT_MAC_ID_SINDHI 31 # define TT_MAC_ID_UNINTERP 32 A list of valid values for the encoding_id for TT_PLATFORM_MACINTOSH charmaps and name entries. TT_ISO_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_ISO_ID_7BIT_ASCII 0 # define TT_ISO_ID_10646 1 # define TT_ISO_ID_8859_1 2 A list of valid values for the encoding_id for TT_PLATFORM_ISO charmaps and name entries. Their use is now deprecated. values TT_ISO_ID_7BIT_ASCII ASCII. TT_ISO_ID_10646 ISO/10646. TT_ISO_ID_8859_1 Also known as Latin-1. TT_MS_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MS_ID_SYMBOL_CS 0 # define TT_MS_ID_UNICODE_CS 1 # define TT_MS_ID_SJIS 2 # define TT_MS_ID_PRC 3 # define TT_MS_ID_BIG_5 4 # define TT_MS_ID_WANSUNG 5 # define TT_MS_ID_JOHAB 6 # define TT_MS_ID_UCS_4 10 /* this value is deprecated */ # define TT_MS_ID_GB2312 TT_MS_ID_PRC A list of valid values for the encoding_id for TT_PLATFORM_MICROSOFT charmaps and name entries. values TT_MS_ID_SYMBOL_CS Microsoft symbol encoding. See FT_ENCODING_MS_SYMBOL . TT_MS_ID_UNICODE_CS Microsoft WGL4 charmap, matching Unicode. See FT_ENCODING_UNICODE . TT_MS_ID_SJIS Shift JIS Japanese encoding. See FT_ENCODING_SJIS . TT_MS_ID_PRC Chinese encodings as used in the People's Republic of China (PRC). This means the encodings GB 2312 and its supersets GBK and GB 18030. See FT_ENCODING_PRC . TT_MS_ID_BIG_5 Traditional Chinese as used in Taiwan and Hong Kong. See FT_ENCODING_BIG5 . TT_MS_ID_WANSUNG Korean Extended Wansung encoding. See FT_ENCODING_WANSUNG . TT_MS_ID_JOHAB Korean Johab encoding. See FT_ENCODING_JOHAB . TT_MS_ID_UCS_4 UCS-4 or UTF-32 charmaps. This has been added to the OpenType specification version 1.4 (mid-2001). TT_ADOBE_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_ADOBE_ID_STANDARD 0 # define TT_ADOBE_ID_EXPERT 1 # define TT_ADOBE_ID_CUSTOM 2 # define TT_ADOBE_ID_LATIN_1 3 A list of valid values for the encoding_id for TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension! values TT_ADOBE_ID_STANDARD Adobe standard encoding. TT_ADOBE_ID_EXPERT Adobe expert encoding. TT_ADOBE_ID_CUSTOM Adobe custom encoding. TT_ADOBE_ID_LATIN_1 Adobe Latin 1 encoding. TT_MAC_LANGID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MAC_LANGID_ENGLISH 0 # define TT_MAC_LANGID_FRENCH 1 # define TT_MAC_LANGID_GERMAN 2 # define TT_MAC_LANGID_ITALIAN 3 # define TT_MAC_LANGID_DUTCH 4 # define TT_MAC_LANGID_SWEDISH 5 # define TT_MAC_LANGID_SPANISH 6 # define TT_MAC_LANGID_DANISH 7 # define TT_MAC_LANGID_PORTUGUESE 8 # define TT_MAC_LANGID_NORWEGIAN 9 # define TT_MAC_LANGID_HEBREW 10 # define TT_MAC_LANGID_JAPANESE 11 # define TT_MAC_LANGID_ARABIC 12 # define TT_MAC_LANGID_FINNISH 13 # define TT_MAC_LANGID_GREEK 14 # define TT_MAC_LANGID_ICELANDIC 15 # define TT_MAC_LANGID_MALTESE 16 # define TT_MAC_LANGID_TURKISH 17 # define TT_MAC_LANGID_CROATIAN 18 # define TT_MAC_LANGID_CHINESE_TRADITIONAL 19 # define TT_MAC_LANGID_URDU 20 # define TT_MAC_LANGID_HINDI 21 # define TT_MAC_LANGID_THAI 22 # define TT_MAC_LANGID_KOREAN 23 # define TT_MAC_LANGID_LITHUANIAN 24 # define TT_MAC_LANGID_POLISH 25 # define TT_MAC_LANGID_HUNGARIAN 26 # define TT_MAC_LANGID_ESTONIAN 27 # define TT_MAC_LANGID_LETTISH 28 # define TT_MAC_LANGID_SAAMISK 29 # define TT_MAC_LANGID_FAEROESE 30 # define TT_MAC_LANGID_FARSI 31 # define TT_MAC_LANGID_RUSSIAN 32 # define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33 # define TT_MAC_LANGID_FLEMISH 34 # define TT_MAC_LANGID_IRISH 35 # define TT_MAC_LANGID_ALBANIAN 36 # define TT_MAC_LANGID_ROMANIAN 37 # define TT_MAC_LANGID_CZECH 38 # define TT_MAC_LANGID_SLOVAK 39 # define TT_MAC_LANGID_SLOVENIAN 40 # define TT_MAC_LANGID_YIDDISH 41 # define TT_MAC_LANGID_SERBIAN 42 # define TT_MAC_LANGID_MACEDONIAN 43 # define TT_MAC_LANGID_BULGARIAN 44 # define TT_MAC_LANGID_UKRAINIAN 45 # define TT_MAC_LANGID_BYELORUSSIAN 46 # define TT_MAC_LANGID_UZBEK 47 # define TT_MAC_LANGID_KAZAKH 48 # define TT_MAC_LANGID_AZERBAIJANI 49 # define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49 # define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50 # define TT_MAC_LANGID_ARMENIAN 51 # define TT_MAC_LANGID_GEORGIAN 52 # define TT_MAC_LANGID_MOLDAVIAN 53 # define TT_MAC_LANGID_KIRGHIZ 54 # define TT_MAC_LANGID_TAJIKI 55 # define TT_MAC_LANGID_TURKMEN 56 # define TT_MAC_LANGID_MONGOLIAN 57 # define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57 # define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58 # define TT_MAC_LANGID_PASHTO 59 # define TT_MAC_LANGID_KURDISH 60 # define TT_MAC_LANGID_KASHMIRI 61 # define TT_MAC_LANGID_SINDHI 62 # define TT_MAC_LANGID_TIBETAN 63 # define TT_MAC_LANGID_NEPALI 64 # define TT_MAC_LANGID_SANSKRIT 65 # define TT_MAC_LANGID_MARATHI 66 # define TT_MAC_LANGID_BENGALI 67 # define TT_MAC_LANGID_ASSAMESE 68 # define TT_MAC_LANGID_GUJARATI 69 # define TT_MAC_LANGID_PUNJABI 70 # define TT_MAC_LANGID_ORIYA 71 # define TT_MAC_LANGID_MALAYALAM 72 # define TT_MAC_LANGID_KANNADA 73 # define TT_MAC_LANGID_TAMIL 74 # define TT_MAC_LANGID_TELUGU 75 # define TT_MAC_LANGID_SINHALESE 76 # define TT_MAC_LANGID_BURMESE 77 # define TT_MAC_LANGID_KHMER 78 # define TT_MAC_LANGID_LAO 79 # define TT_MAC_LANGID_VIETNAMESE 80 # define TT_MAC_LANGID_INDONESIAN 81 # define TT_MAC_LANGID_TAGALOG 82 # define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83 # define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84 # define TT_MAC_LANGID_AMHARIC 85 # define TT_MAC_LANGID_TIGRINYA 86 # define TT_MAC_LANGID_GALLA 87 # define TT_MAC_LANGID_SOMALI 88 # define TT_MAC_LANGID_SWAHILI 89 # define TT_MAC_LANGID_RUANDA 90 # define TT_MAC_LANGID_RUNDI 91 # define TT_MAC_LANGID_CHEWA 92 # define TT_MAC_LANGID_MALAGASY 93 # define TT_MAC_LANGID_ESPERANTO 94 # define TT_MAC_LANGID_WELSH 128 # define TT_MAC_LANGID_BASQUE 129 # define TT_MAC_LANGID_CATALAN 130 # define TT_MAC_LANGID_LATIN 131 # define TT_MAC_LANGID_QUECHUA 132 # define TT_MAC_LANGID_GUARANI 133 # define TT_MAC_LANGID_AYMARA 134 # define TT_MAC_LANGID_TATAR 135 # define TT_MAC_LANGID_UIGHUR 136 # define TT_MAC_LANGID_DZONGKHA 137 # define TT_MAC_LANGID_JAVANESE 138 # define TT_MAC_LANGID_SUNDANESE 139 /* The following codes are new as of 2000-03-10 */ # define TT_MAC_LANGID_GALICIAN 140 # define TT_MAC_LANGID_AFRIKAANS 141 # define TT_MAC_LANGID_BRETON 142 # define TT_MAC_LANGID_INUKTITUT 143 # define TT_MAC_LANGID_SCOTTISH_GAELIC 144 # define TT_MAC_LANGID_MANX_GAELIC 145 # define TT_MAC_LANGID_IRISH_GAELIC 146 # define TT_MAC_LANGID_TONGAN 147 # define TT_MAC_LANGID_GREEK_POLYTONIC 148 # define TT_MAC_LANGID_GREELANDIC 149 # define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 Possible values of the language identifier field in the name records of the SFNT \u2018name\u2019 table if the \u2018platform\u2019 identifier code is TT_PLATFORM_MACINTOSH . These values are also used as return values for function FT_Get_CMap_Language_ID . The canonical source for Apple's IDs is https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html TT_MS_LANGID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 # define TT_MS_LANGID_ARABIC_IRAQ 0x0801 # define TT_MS_LANGID_ARABIC_EGYPT 0x0C01 # define TT_MS_LANGID_ARABIC_LIBYA 0x1001 # define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 # define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 # define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01 # define TT_MS_LANGID_ARABIC_OMAN 0x2001 # define TT_MS_LANGID_ARABIC_YEMEN 0x2401 # define TT_MS_LANGID_ARABIC_SYRIA 0x2801 # define TT_MS_LANGID_ARABIC_JORDAN 0x2C01 # define TT_MS_LANGID_ARABIC_LEBANON 0x3001 # define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 # define TT_MS_LANGID_ARABIC_UAE 0x3801 # define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01 # define TT_MS_LANGID_ARABIC_QATAR 0x4001 # define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 # define TT_MS_LANGID_CATALAN_CATALAN 0x0403 # define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 # define TT_MS_LANGID_CHINESE_PRC 0x0804 # define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04 # define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 # define TT_MS_LANGID_CHINESE_MACAO 0x1404 # define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 # define TT_MS_LANGID_DANISH_DENMARK 0x0406 # define TT_MS_LANGID_GERMAN_GERMANY 0x0407 # define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 # define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07 # define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 # define TT_MS_LANGID_GERMAN_LIECHTENSTEIN 0x1407 # define TT_MS_LANGID_GREEK_GREECE 0x0408 # define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 # define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 # define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09 # define TT_MS_LANGID_ENGLISH_CANADA 0x1009 # define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 # define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 # define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09 # define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 # define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 # define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 # define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09 # define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 # define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 # define TT_MS_LANGID_ENGLISH_INDIA 0x4009 # define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 # define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 # define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A # define TT_MS_LANGID_SPANISH_MEXICO 0x080A # define TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT 0x0C0A # define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A # define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A # define TT_MS_LANGID_SPANISH_PANAMA 0x180A # define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A # define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A # define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A # define TT_MS_LANGID_SPANISH_PERU 0x280A # define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A # define TT_MS_LANGID_SPANISH_ECUADOR 0x300A # define TT_MS_LANGID_SPANISH_CHILE 0x340A # define TT_MS_LANGID_SPANISH_URUGUAY 0x380A # define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A # define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A # define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A # define TT_MS_LANGID_SPANISH_HONDURAS 0x480A # define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A # define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A # define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A # define TT_MS_LANGID_FINNISH_FINLAND 0x040B # define TT_MS_LANGID_FRENCH_FRANCE 0x040C # define TT_MS_LANGID_FRENCH_BELGIUM 0x080C # define TT_MS_LANGID_FRENCH_CANADA 0x0C0C # define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C # define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C # define TT_MS_LANGID_FRENCH_MONACO 0x180C # define TT_MS_LANGID_HEBREW_ISRAEL 0x040D # define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E # define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F # define TT_MS_LANGID_ITALIAN_ITALY 0x0410 # define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 # define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 # define TT_MS_LANGID_KOREAN_KOREA 0x0412 # define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413 # define TT_MS_LANGID_DUTCH_BELGIUM 0x0813 # define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414 # define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814 # define TT_MS_LANGID_POLISH_POLAND 0x0415 # define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416 # define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816 # define TT_MS_LANGID_ROMANSH_SWITZERLAND 0x0417 # define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418 # define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 # define TT_MS_LANGID_CROATIAN_CROATIA 0x041A # define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A # define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A # define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A # define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A # define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A # define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x1C1A # define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC 0x201A # define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B # define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C # define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D # define TT_MS_LANGID_SWEDISH_FINLAND 0x081D # define TT_MS_LANGID_THAI_THAILAND 0x041E # define TT_MS_LANGID_TURKISH_TURKEY 0x041F # define TT_MS_LANGID_URDU_PAKISTAN 0x0420 # define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 # define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422 # define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423 # define TT_MS_LANGID_SLOVENIAN_SLOVENIA 0x0424 # define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425 # define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 # define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 # define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 # define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A # define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B # define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C # define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C # define TT_MS_LANGID_BASQUE_BASQUE 0x042D # define TT_MS_LANGID_UPPER_SORBIAN_GERMANY 0x042E # define TT_MS_LANGID_LOWER_SORBIAN_GERMANY 0x082E # define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F # define TT_MS_LANGID_SETSWANA_SOUTH_AFRICA 0x0432 # define TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA 0x0434 # define TT_MS_LANGID_ISIZULU_SOUTH_AFRICA 0x0435 # define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436 # define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 # define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 # define TT_MS_LANGID_HINDI_INDIA 0x0439 # define TT_MS_LANGID_MALTESE_MALTA 0x043A # define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B # define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B # define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B # define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B # define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B # define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B # define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B # define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B # define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B # define TT_MS_LANGID_IRISH_IRELAND 0x083C # define TT_MS_LANGID_MALAY_MALAYSIA 0x043E # define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E # define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F # define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic */ 0x0440 # define TT_MS_LANGID_KISWAHILI_KENYA 0x0441 # define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 # define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443 # define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843 # define TT_MS_LANGID_TATAR_RUSSIA 0x0444 # define TT_MS_LANGID_BENGALI_INDIA 0x0445 # define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 # define TT_MS_LANGID_PUNJABI_INDIA 0x0446 # define TT_MS_LANGID_GUJARATI_INDIA 0x0447 # define TT_MS_LANGID_ODIA_INDIA 0x0448 # define TT_MS_LANGID_TAMIL_INDIA 0x0449 # define TT_MS_LANGID_TELUGU_INDIA 0x044A # define TT_MS_LANGID_KANNADA_INDIA 0x044B # define TT_MS_LANGID_MALAYALAM_INDIA 0x044C # define TT_MS_LANGID_ASSAMESE_INDIA 0x044D # define TT_MS_LANGID_MARATHI_INDIA 0x044E # define TT_MS_LANGID_SANSKRIT_INDIA 0x044F # define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 # define TT_MS_LANGID_MONGOLIAN_PRC 0x0850 # define TT_MS_LANGID_TIBETAN_PRC 0x0451 # define TT_MS_LANGID_WELSH_UNITED_KINGDOM 0x0452 # define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 # define TT_MS_LANGID_LAO_LAOS 0x0454 # define TT_MS_LANGID_GALICIAN_GALICIAN 0x0456 # define TT_MS_LANGID_KONKANI_INDIA 0x0457 # define TT_MS_LANGID_SYRIAC_SYRIA 0x045A # define TT_MS_LANGID_SINHALA_SRI_LANKA 0x045B # define TT_MS_LANGID_INUKTITUT_CANADA 0x045D # define TT_MS_LANGID_INUKTITUT_CANADA_LATIN 0x085D # define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E # define TT_MS_LANGID_TAMAZIGHT_ALGERIA 0x085F # define TT_MS_LANGID_NEPALI_NEPAL 0x0461 # define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 # define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 # define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464 # define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465 # define TT_MS_LANGID_HAUSA_NIGERIA 0x0468 # define TT_MS_LANGID_YORUBA_NIGERIA 0x046A # define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B # define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B # define TT_MS_LANGID_QUECHUA_PERU 0x0C6B # define TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA 0x046C # define TT_MS_LANGID_BASHKIR_RUSSIA 0x046D # define TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG 0x046E # define TT_MS_LANGID_GREENLANDIC_GREENLAND 0x046F # define TT_MS_LANGID_IGBO_NIGERIA 0x0470 # define TT_MS_LANGID_YI_PRC 0x0478 # define TT_MS_LANGID_MAPUDUNGUN_CHILE 0x047A # define TT_MS_LANGID_MOHAWK_MOHAWK 0x047C # define TT_MS_LANGID_BRETON_FRANCE 0x047E # define TT_MS_LANGID_UIGHUR_PRC 0x0480 # define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481 # define TT_MS_LANGID_OCCITAN_FRANCE 0x0482 # define TT_MS_LANGID_CORSICAN_FRANCE 0x0483 # define TT_MS_LANGID_ALSATIAN_FRANCE 0x0484 # define TT_MS_LANGID_YAKUT_RUSSIA 0x0485 # define TT_MS_LANGID_KICHE_GUATEMALA 0x0486 # define TT_MS_LANGID_KINYARWANDA_RWANDA 0x0487 # define TT_MS_LANGID_WOLOF_SENEGAL 0x0488 # define TT_MS_LANGID_DARI_AFGHANISTAN 0x048C Possible values of the language identifier field in the name records of the SFNT \u2018name\u2019 table if the \u2018platform\u2019 identifier code is TT_PLATFORM_MICROSOFT . These values are also used as return values for function FT_Get_CMap_Language_ID . The canonical source for Microsoft's IDs is https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings , however, we only provide macros for language identifiers present in the OpenType specification: Microsoft has abandoned the concept of LCIDs (language code identifiers), and format 1 of the \u2018name\u2019 table provides a better mechanism for languages not covered here. More legacy values not listed in the reference can be found in the FT_TRUETYPE_IDS_H header file. TT_NAME_ID_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_NAME_ID_COPYRIGHT 0 # define TT_NAME_ID_FONT_FAMILY 1 # define TT_NAME_ID_FONT_SUBFAMILY 2 # define TT_NAME_ID_UNIQUE_ID 3 # define TT_NAME_ID_FULL_NAME 4 # define TT_NAME_ID_VERSION_STRING 5 # define TT_NAME_ID_PS_NAME 6 # define TT_NAME_ID_TRADEMARK 7 /* the following values are from the OpenType spec */ # define TT_NAME_ID_MANUFACTURER 8 # define TT_NAME_ID_DESIGNER 9 # define TT_NAME_ID_DESCRIPTION 10 # define TT_NAME_ID_VENDOR_URL 11 # define TT_NAME_ID_DESIGNER_URL 12 # define TT_NAME_ID_LICENSE 13 # define TT_NAME_ID_LICENSE_URL 14 /* number 15 is reserved */ # define TT_NAME_ID_TYPOGRAPHIC_FAMILY 16 # define TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY 17 # define TT_NAME_ID_MAC_FULL_NAME 18 /* The following code is new as of 2000-01-21 */ # define TT_NAME_ID_SAMPLE_TEXT 19 /* This is new in OpenType 1.3 */ # define TT_NAME_ID_CID_FINDFONT_NAME 20 /* This is new in OpenType 1.5 */ # define TT_NAME_ID_WWS_FAMILY 21 # define TT_NAME_ID_WWS_SUBFAMILY 22 /* This is new in OpenType 1.7 */ # define TT_NAME_ID_LIGHT_BACKGROUND 23 # define TT_NAME_ID_DARK_BACKGROUND 24 /* This is new in OpenType 1.8 */ # define TT_NAME_ID_VARIATIONS_PREFIX 25 /* these two values are deprecated */ # define TT_NAME_ID_PREFERRED_FAMILY TT_NAME_ID_TYPOGRAPHIC_FAMILY # define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY Possible values of the \u2018name\u2019 identifier field in the name records of an SFNT \u2018name\u2019 table. These values are platform independent. TT_UCR_XXX \u00b6 Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). /* ulUnicodeRange1 */ /* --------------- */ /* Bit 0 Basic Latin */ # define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ /* Bit 1 C1 Controls and Latin-1 Supplement */ # define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ /* Bit 2 Latin Extended-A */ # define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ /* Bit 3 Latin Extended-B */ # define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ /* Bit 4 IPA Extensions */ /* Phonetic Extensions */ /* Phonetic Extensions Supplement */ # define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ /* U+1D00-U+1D7F */ /* U+1D80-U+1DBF */ /* Bit 5 Spacing Modifier Letters */ /* Modifier Tone Letters */ # define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ /* U+A700-U+A71F */ /* Bit 6 Combining Diacritical Marks */ /* Combining Diacritical Marks Supplement */ # define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */ /* U+1DC0-U+1DFF */ /* Bit 7 Greek and Coptic */ # define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ /* Bit 8 Coptic */ # define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */ /* Bit 9 Cyrillic */ /* Cyrillic Supplement */ /* Cyrillic Extended-A */ /* Cyrillic Extended-B */ # define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ /* U+0500-U+052F */ /* U+2DE0-U+2DFF */ /* U+A640-U+A69F */ /* Bit 10 Armenian */ # define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ /* Bit 11 Hebrew */ # define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ /* Bit 12 Vai */ # define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */ /* Bit 13 Arabic */ /* Arabic Supplement */ # define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ /* U+0750-U+077F */ /* Bit 14 NKo */ # define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */ /* Bit 15 Devanagari */ # define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ /* Bit 16 Bengali */ # define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */ /* Bit 17 Gurmukhi */ # define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */ /* Bit 18 Gujarati */ # define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */ /* Bit 19 Oriya */ # define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */ /* Bit 20 Tamil */ # define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */ /* Bit 21 Telugu */ # define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */ /* Bit 22 Kannada */ # define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */ /* Bit 23 Malayalam */ # define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */ /* Bit 24 Thai */ # define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ /* Bit 25 Lao */ # define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ /* Bit 26 Georgian */ /* Georgian Supplement */ # define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ /* U+2D00-U+2D2F */ /* Bit 27 Balinese */ # define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */ /* Bit 28 Hangul Jamo */ # define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ /* Bit 29 Latin Extended Additional */ /* Latin Extended-C */ /* Latin Extended-D */ # define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ /* U+2C60-U+2C7F */ /* U+A720-U+A7FF */ /* Bit 30 Greek Extended */ # define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ /* Bit 31 General Punctuation */ /* Supplemental Punctuation */ # define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ /* U+2E00-U+2E7F */ /* ulUnicodeRange2 */ /* --------------- */ /* Bit 32 Superscripts And Subscripts */ # define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ /* Bit 33 Currency Symbols */ # define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ /* Bit 34 Combining Diacritical Marks For Symbols */ # define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\ (1L << 2) /* U+20D0-U+20FF */ /* Bit 35 Letterlike Symbols */ # define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ /* Bit 36 Number Forms */ # define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ /* Bit 37 Arrows */ /* Supplemental Arrows-A */ /* Supplemental Arrows-B */ /* Miscellaneous Symbols and Arrows */ # define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ /* U+27F0-U+27FF */ /* U+2900-U+297F */ /* U+2B00-U+2BFF */ /* Bit 38 Mathematical Operators */ /* Supplemental Mathematical Operators */ /* Miscellaneous Mathematical Symbols-A */ /* Miscellaneous Mathematical Symbols-B */ # define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ /* U+2A00-U+2AFF */ /* U+27C0-U+27EF */ /* U+2980-U+29FF */ /* Bit 39 Miscellaneous Technical */ # define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ /* Bit 40 Control Pictures */ # define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */ /* Bit 41 Optical Character Recognition */ # define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */ /* Bit 42 Enclosed Alphanumerics */ # define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */ /* Bit 43 Box Drawing */ # define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */ /* Bit 44 Block Elements */ # define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */ /* Bit 45 Geometric Shapes */ # define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */ /* Bit 46 Miscellaneous Symbols */ # define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ /* Bit 47 Dingbats */ # define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ /* Bit 48 CJK Symbols and Punctuation */ # define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ /* Bit 49 Hiragana */ # define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ /* Bit 50 Katakana */ /* Katakana Phonetic Extensions */ # define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ /* U+31F0-U+31FF */ /* Bit 51 Bopomofo */ /* Bopomofo Extended */ # define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ /* U+31A0-U+31BF */ /* Bit 52 Hangul Compatibility Jamo */ # define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ /* Bit 53 Phags-Pa */ # define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */ # define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */ # define TT_UCR_PHAGSPA /* Bit 54 Enclosed CJK Letters and Months */ # define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ /* Bit 55 CJK Compatibility */ # define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ /* Bit 56 Hangul Syllables */ # define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ /* Bit 57 High Surrogates */ /* High Private Use Surrogates */ /* Low Surrogates */ /* According to OpenType specs v.1.3+, */ /* setting bit 57 implies that there is */ /* at least one codepoint beyond the */ /* Basic Multilingual Plane that is */ /* supported by this font. So it really */ /* means >= U+10000. */ # define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ /* U+DB80-U+DBFF */ /* U+DC00-U+DFFF */ # define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES /* Bit 58 Phoenician */ # define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/ /* Bit 59 CJK Unified Ideographs */ /* CJK Radicals Supplement */ /* Kangxi Radicals */ /* Ideographic Description Characters */ /* CJK Unified Ideographs Extension A */ /* CJK Unified Ideographs Extension B */ /* Kanbun */ # define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ /* U+2E80-U+2EFF */ /* U+2F00-U+2FDF */ /* U+2FF0-U+2FFF */ /* U+3400-U+4DB5 */ /*U+20000-U+2A6DF*/ /* U+3190-U+319F */ /* Bit 60 Private Use */ # define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ /* Bit 61 CJK Strokes */ /* CJK Compatibility Ideographs */ /* CJK Compatibility Ideographs Supplement */ # define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */ /* U+F900-U+FAFF */ /*U+2F800-U+2FA1F*/ /* Bit 62 Alphabetic Presentation Forms */ # define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ /* Bit 63 Arabic Presentation Forms-A */ # define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */ /* ulUnicodeRange3 */ /* --------------- */ /* Bit 64 Combining Half Marks */ # define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ /* Bit 65 Vertical forms */ /* CJK Compatibility Forms */ # define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */ /* U+FE30-U+FE4F */ /* Bit 66 Small Form Variants */ # define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ /* Bit 67 Arabic Presentation Forms-B */ # define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */ /* Bit 68 Halfwidth and Fullwidth Forms */ # define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ /* Bit 69 Specials */ # define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ /* Bit 70 Tibetan */ # define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ /* Bit 71 Syriac */ # define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ /* Bit 72 Thaana */ # define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */ /* Bit 73 Sinhala */ # define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ /* Bit 74 Myanmar */ # define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ /* Bit 75 Ethiopic */ /* Ethiopic Supplement */ /* Ethiopic Extended */ # define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ /* U+1380-U+139F */ /* U+2D80-U+2DDF */ /* Bit 76 Cherokee */ # define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ /* Bit 77 Unified Canadian Aboriginal Syllabics */ # define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ /* Bit 78 Ogham */ # define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ /* Bit 79 Runic */ # define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ /* Bit 80 Khmer */ /* Khmer Symbols */ # define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ /* U+19E0-U+19FF */ /* Bit 81 Mongolian */ # define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ /* Bit 82 Braille Patterns */ # define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ /* Bit 83 Yi Syllables */ /* Yi Radicals */ # define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ /* U+A490-U+A4CF */ /* Bit 84 Tagalog */ /* Hanunoo */ /* Buhid */ /* Tagbanwa */ # define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ /* U+1720-U+173F */ /* U+1740-U+175F */ /* U+1760-U+177F */ /* Bit 85 Old Italic */ # define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ /* Bit 86 Gothic */ # define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ /* Bit 87 Deseret */ # define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ /* Bit 88 Byzantine Musical Symbols */ /* Musical Symbols */ /* Ancient Greek Musical Notation */ # define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ /*U+1D100-U+1D1FF*/ /*U+1D200-U+1D24F*/ /* Bit 89 Mathematical Alphanumeric Symbols */ # define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ /* Bit 90 Private Use (plane 15) */ /* Private Use (plane 16) */ # define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ /*U+100000-U+10FFFD*/ /* Bit 91 Variation Selectors */ /* Variation Selectors Supplement */ # define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ /*U+E0100-U+E01EF*/ /* Bit 92 Tags */ # define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ /* Bit 93 Limbu */ # define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */ /* Bit 94 Tai Le */ # define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */ /* Bit 95 New Tai Lue */ # define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */ /* ulUnicodeRange4 */ /* --------------- */ /* Bit 96 Buginese */ # define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */ /* Bit 97 Glagolitic */ # define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */ /* Bit 98 Tifinagh */ # define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */ /* Bit 99 Yijing Hexagram Symbols */ # define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */ /* Bit 100 Syloti Nagri */ # define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */ /* Bit 101 Linear B Syllabary */ /* Linear B Ideograms */ /* Aegean Numbers */ # define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/ /*U+10080-U+100FF*/ /*U+10100-U+1013F*/ /* Bit 102 Ancient Greek Numbers */ # define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/ /* Bit 103 Ugaritic */ # define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/ /* Bit 104 Old Persian */ # define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/ /* Bit 105 Shavian */ # define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/ /* Bit 106 Osmanya */ # define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/ /* Bit 107 Cypriot Syllabary */ # define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/ /* Bit 108 Kharoshthi */ # define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/ /* Bit 109 Tai Xuan Jing Symbols */ # define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/ /* Bit 110 Cuneiform */ /* Cuneiform Numbers and Punctuation */ # define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/ /*U+12400-U+1247F*/ /* Bit 111 Counting Rod Numerals */ # define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/ /* Bit 112 Sundanese */ # define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */ /* Bit 113 Lepcha */ # define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */ /* Bit 114 Ol Chiki */ # define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */ /* Bit 115 Saurashtra */ # define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */ /* Bit 116 Kayah Li */ # define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */ /* Bit 117 Rejang */ # define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */ /* Bit 118 Cham */ # define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */ /* Bit 119 Ancient Symbols */ # define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/ /* Bit 120 Phaistos Disc */ # define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/ /* Bit 121 Carian */ /* Lycian */ /* Lydian */ # define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/ /*U+10280-U+1029F*/ /*U+10920-U+1093F*/ /* Bit 122 Domino Tiles */ /* Mahjong Tiles */ # define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/ /*U+1F000-U+1F02F*/ /* Bit 123-127 Reserved for process-internal usage */ Possible bit mask values for the ulUnicodeRangeX fields in an SFNT \u2018OS/2\u2019 table.","title":"TrueType Tables"},{"location":"ft2-truetype_tables.html#truetype-tables","text":"","title":"TrueType Tables"},{"location":"ft2-truetype_tables.html#synopsis","text":"This section contains definitions of some basic tables specific to TrueType and OpenType as well as some routines used to access and process them.","title":"Synopsis"},{"location":"ft2-truetype_tables.html#tt_header","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_Header_ { FT_Fixed Table_Version; FT_Fixed Font_Revision; FT_Long CheckSum_Adjust; FT_Long Magic_Number; FT_UShort Flags; FT_UShort Units_Per_EM; FT_ULong Created [2]; FT_ULong Modified[2]; FT_Short xMin; FT_Short yMin; FT_Short xMax; FT_Short yMax; FT_UShort Mac_Style; FT_UShort Lowest_Rec_PPEM; FT_Short Font_Direction; FT_Short Index_To_Loc_Format; FT_Short Glyph_Data_Format; } TT_Header ; A structure to model a TrueType font header table. All fields follow the OpenType specification. The 64-bit timestamps are stored in two-element arrays Created and Modified , first the upper then the lower 32 bits.","title":"TT_Header"},{"location":"ft2-truetype_tables.html#tt_horiheader","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_HoriHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Width_Max; /* advance width maximum */ FT_Short min_Left_Side_Bearing; /* minimum left-sb */ FT_Short min_Right_Side_Bearing; /* minimum right-sb */ FT_Short xMax_Extent; /* xmax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_HMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* 'hmtx' table. */ void * long_metrics; void * short_metrics; } TT_HoriHeader ; A structure to model a TrueType horizontal header, the \u2018hhea\u2019 table, as well as the corresponding horizontal metrics table, \u2018hmtx\u2019.","title":"TT_HoriHeader"},{"location":"ft2-truetype_tables.html#tt_vertheader","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_VertHeader_ { FT_Fixed Version; FT_Short Ascender; FT_Short Descender; FT_Short Line_Gap; FT_UShort advance_Height_Max; /* advance height maximum */ FT_Short min_Top_Side_Bearing; /* minimum top-sb */ FT_Short min_Bottom_Side_Bearing; /* minimum bottom-sb */ FT_Short yMax_Extent; /* ymax extents */ FT_Short caret_Slope_Rise; FT_Short caret_Slope_Run; FT_Short caret_Offset; FT_Short Reserved[4]; FT_Short metric_Data_Format; FT_UShort number_Of_VMetrics; /* The following fields are not defined by the OpenType specification */ /* but they are used to connect the metrics header to the relevant */ /* 'vmtx' table. */ void * long_metrics; void * short_metrics; } TT_VertHeader ; A structure used to model a TrueType vertical header, the \u2018vhea\u2019 table, as well as the corresponding vertical metrics table, \u2018vmtx\u2019.","title":"TT_VertHeader"},{"location":"ft2-truetype_tables.html#tt_os2","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_OS2_ { FT_UShort version; /* 0x0001 - more or 0xFFFF */ FT_Short xAvgCharWidth; FT_UShort usWeightClass; FT_UShort usWidthClass; FT_UShort fsType; FT_Short ySubscriptXSize; FT_Short ySubscriptYSize; FT_Short ySubscriptXOffset; FT_Short ySubscriptYOffset; FT_Short ySuperscriptXSize; FT_Short ySuperscriptYSize; FT_Short ySuperscriptXOffset; FT_Short ySuperscriptYOffset; FT_Short yStrikeoutSize; FT_Short yStrikeoutPosition; FT_Short sFamilyClass; FT_Byte panose[10]; FT_ULong ulUnicodeRange1; /* Bits 0-31 */ FT_ULong ulUnicodeRange2; /* Bits 32-63 */ FT_ULong ulUnicodeRange3; /* Bits 64-95 */ FT_ULong ulUnicodeRange4; /* Bits 96-127 */ FT_Char achVendID[4]; FT_UShort fsSelection; FT_UShort usFirstCharIndex; FT_UShort usLastCharIndex; FT_Short sTypoAscender; FT_Short sTypoDescender; FT_Short sTypoLineGap; FT_UShort usWinAscent; FT_UShort usWinDescent; /* only version 1 and higher: */ FT_ULong ulCodePageRange1; /* Bits 0-31 */ FT_ULong ulCodePageRange2; /* Bits 32-63 */ /* only version 2 and higher: */ FT_Short sxHeight; FT_Short sCapHeight; FT_UShort usDefaultChar; FT_UShort usBreakChar; FT_UShort usMaxContext; /* only version 5 and higher: */ FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */ FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */ } TT_OS2 ; A structure to model a TrueType \u2018OS/2\u2019 table. All fields comply to the OpenType specification. Note that we now support old Mac fonts that do not include an \u2018OS/2\u2019 table. In this case, the version field is always set to 0xFFFF.","title":"TT_OS2"},{"location":"ft2-truetype_tables.html#tt_postscript","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_Postscript_ { FT_Fixed FormatType; FT_Fixed italicAngle; FT_Short underlinePosition; FT_Short underlineThickness; FT_ULong isFixedPitch; FT_ULong minMemType42; FT_ULong maxMemType42; FT_ULong minMemType1; FT_ULong maxMemType1; /* Glyph names follow in the 'post' table, but we don't */ /* load them by default. */ } TT_Postscript ; A structure to model a TrueType \u2018post\u2019 table. All fields comply to the OpenType specification. This structure does not reference a font's PostScript glyph names; use FT_Get_Glyph_Name to retrieve them.","title":"TT_Postscript"},{"location":"ft2-truetype_tables.html#tt_pclt","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_PCLT_ { FT_Fixed Version; FT_ULong FontNumber; FT_UShort Pitch; FT_UShort xHeight; FT_UShort Style; FT_UShort TypeFamily; FT_UShort CapHeight; FT_UShort SymbolSet; FT_Char TypeFace[16]; FT_Char CharacterComplement[8]; FT_Char FileName[6]; FT_Char StrokeWeight; FT_Char WidthType; FT_Byte SerifStyle; FT_Byte Reserved; } TT_PCLT ; A structure to model a TrueType \u2018PCLT\u2019 table. All fields comply to the OpenType specification.","title":"TT_PCLT"},{"location":"ft2-truetype_tables.html#tt_maxprofile","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef struct TT_MaxProfile_ { FT_Fixed version; FT_UShort numGlyphs; FT_UShort maxPoints; FT_UShort maxContours; FT_UShort maxCompositePoints; FT_UShort maxCompositeContours; FT_UShort maxZones; FT_UShort maxTwilightPoints; FT_UShort maxStorage; FT_UShort maxFunctionDefs; FT_UShort maxInstructionDefs; FT_UShort maxStackElements; FT_UShort maxSizeOfInstructions; FT_UShort maxComponentElements; FT_UShort maxComponentDepth; } TT_MaxProfile ; The maximum profile (\u2018maxp\u2019) table contains many max values, which can be used to pre-allocate arrays for speeding up glyph loading and hinting.","title":"TT_MaxProfile"},{"location":"ft2-truetype_tables.html#ft_sfnt_tag","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). typedef enum FT_Sfnt_Tag_ { FT_SFNT_HEAD , FT_SFNT_MAXP , FT_SFNT_OS2 , FT_SFNT_HHEA , FT_SFNT_VHEA , FT_SFNT_POST , FT_SFNT_PCLT , FT_SFNT_MAX } FT_Sfnt_Tag ; /* these constants are deprecated; use the corresponding ` FT_Sfnt_Tag ` */ /* values instead */ # define ft_sfnt_head FT_SFNT_HEAD # define ft_sfnt_maxp FT_SFNT_MAXP # define ft_sfnt_os2 FT_SFNT_OS2 # define ft_sfnt_hhea FT_SFNT_HHEA # define ft_sfnt_vhea FT_SFNT_VHEA # define ft_sfnt_post FT_SFNT_POST # define ft_sfnt_pclt FT_SFNT_PCLT An enumeration to specify indices of SFNT tables loaded and parsed by FreeType during initialization of an SFNT font. Used in the FT_Get_Sfnt_Table API function.","title":"FT_Sfnt_Tag"},{"location":"ft2-truetype_tables.html#ft_get_sfnt_table","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( void * ) FT_Get_Sfnt_Table ( FT_Face face, FT_Sfnt_Tag tag ); Return a pointer to a given SFNT table stored within a face.","title":"FT_Get_Sfnt_Table"},{"location":"ft2-truetype_tables.html#ft_load_sfnt_table","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Error ) FT_Load_Sfnt_Table ( FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte * buffer, FT_ULong * length ); Load any SFNT font table into client memory.","title":"FT_Load_Sfnt_Table"},{"location":"ft2-truetype_tables.html#ft_sfnt_table_info","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Error ) FT_Sfnt_Table_Info ( FT_Face face, FT_UInt table_index, FT_ULong *tag, FT_ULong *length ); Return information on an SFNT table.","title":"FT_Sfnt_Table_Info"},{"location":"ft2-truetype_tables.html#ft_get_cmap_language_id","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_ULong ) FT_Get_CMap_Language_ID ( FT_CharMap charmap ); Return cmap language ID as specified in the OpenType standard. Definitions of language ID values are in file FT_TRUETYPE_IDS_H .","title":"FT_Get_CMap_Language_ID"},{"location":"ft2-truetype_tables.html#ft_get_cmap_format","text":"Defined in FT_TRUETYPE_TABLES_H (freetype/tttables.h). FT_EXPORT( FT_Long ) FT_Get_CMap_Format ( FT_CharMap charmap ); Return the format of an SFNT \u2018cmap\u2019 table.","title":"FT_Get_CMap_Format"},{"location":"ft2-truetype_tables.html#ft_param_tag_unpatented_hinting","text":"# define FT_PARAM_TAG_UNPATENTED_HINTING \\ FT_MAKE_TAG ( 'u', 'n', 'p', 'a' ) Deprecated, no effect. Previously: A constant used as the tag of an FT_Parameter structure to indicate that unpatented methods only should be used by the TrueType bytecode interpreter for a typeface opened by FT_Open_Face .","title":"FT_PARAM_TAG_UNPATENTED_HINTING"},{"location":"ft2-truetype_tables.html#tt_platform_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_PLATFORM_APPLE_UNICODE 0 # define TT_PLATFORM_MACINTOSH 1 # define TT_PLATFORM_ISO 2 /* deprecated */ # define TT_PLATFORM_MICROSOFT 3 # define TT_PLATFORM_CUSTOM 4 # define TT_PLATFORM_ADOBE 7 /* artificial */ A list of valid values for the platform_id identifier code in FT_CharMapRec and FT_SfntName structures.","title":"TT_PLATFORM_XXX"},{"location":"ft2-truetype_tables.html#tt_apple_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_APPLE_ID_DEFAULT 0 /* Unicode 1.0 */ # define TT_APPLE_ID_UNICODE_1_1 1 /* specify Hangul at U+34xx */ # define TT_APPLE_ID_ISO_10646 2 /* deprecated */ # define TT_APPLE_ID_UNICODE_2_0 3 /* or later */ # define TT_APPLE_ID_UNICODE_32 4 /* 2.0 or later, full repertoire */ # define TT_APPLE_ID_VARIANT_SELECTOR 5 /* variation selector data */ # define TT_APPLE_ID_FULL_UNICODE 6 /* used with type 13 cmaps */ A list of valid values for the encoding_id for TT_PLATFORM_APPLE_UNICODE charmaps and name entries.","title":"TT_APPLE_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_mac_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MAC_ID_ROMAN 0 # define TT_MAC_ID_JAPANESE 1 # define TT_MAC_ID_TRADITIONAL_CHINESE 2 # define TT_MAC_ID_KOREAN 3 # define TT_MAC_ID_ARABIC 4 # define TT_MAC_ID_HEBREW 5 # define TT_MAC_ID_GREEK 6 # define TT_MAC_ID_RUSSIAN 7 # define TT_MAC_ID_RSYMBOL 8 # define TT_MAC_ID_DEVANAGARI 9 # define TT_MAC_ID_GURMUKHI 10 # define TT_MAC_ID_GUJARATI 11 # define TT_MAC_ID_ORIYA 12 # define TT_MAC_ID_BENGALI 13 # define TT_MAC_ID_TAMIL 14 # define TT_MAC_ID_TELUGU 15 # define TT_MAC_ID_KANNADA 16 # define TT_MAC_ID_MALAYALAM 17 # define TT_MAC_ID_SINHALESE 18 # define TT_MAC_ID_BURMESE 19 # define TT_MAC_ID_KHMER 20 # define TT_MAC_ID_THAI 21 # define TT_MAC_ID_LAOTIAN 22 # define TT_MAC_ID_GEORGIAN 23 # define TT_MAC_ID_ARMENIAN 24 # define TT_MAC_ID_MALDIVIAN 25 # define TT_MAC_ID_SIMPLIFIED_CHINESE 25 # define TT_MAC_ID_TIBETAN 26 # define TT_MAC_ID_MONGOLIAN 27 # define TT_MAC_ID_GEEZ 28 # define TT_MAC_ID_SLAVIC 29 # define TT_MAC_ID_VIETNAMESE 30 # define TT_MAC_ID_SINDHI 31 # define TT_MAC_ID_UNINTERP 32 A list of valid values for the encoding_id for TT_PLATFORM_MACINTOSH charmaps and name entries.","title":"TT_MAC_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_iso_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_ISO_ID_7BIT_ASCII 0 # define TT_ISO_ID_10646 1 # define TT_ISO_ID_8859_1 2 A list of valid values for the encoding_id for TT_PLATFORM_ISO charmaps and name entries. Their use is now deprecated.","title":"TT_ISO_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_ms_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MS_ID_SYMBOL_CS 0 # define TT_MS_ID_UNICODE_CS 1 # define TT_MS_ID_SJIS 2 # define TT_MS_ID_PRC 3 # define TT_MS_ID_BIG_5 4 # define TT_MS_ID_WANSUNG 5 # define TT_MS_ID_JOHAB 6 # define TT_MS_ID_UCS_4 10 /* this value is deprecated */ # define TT_MS_ID_GB2312 TT_MS_ID_PRC A list of valid values for the encoding_id for TT_PLATFORM_MICROSOFT charmaps and name entries.","title":"TT_MS_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_adobe_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_ADOBE_ID_STANDARD 0 # define TT_ADOBE_ID_EXPERT 1 # define TT_ADOBE_ID_CUSTOM 2 # define TT_ADOBE_ID_LATIN_1 3 A list of valid values for the encoding_id for TT_PLATFORM_ADOBE charmaps. This is a FreeType-specific extension!","title":"TT_ADOBE_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_mac_langid_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MAC_LANGID_ENGLISH 0 # define TT_MAC_LANGID_FRENCH 1 # define TT_MAC_LANGID_GERMAN 2 # define TT_MAC_LANGID_ITALIAN 3 # define TT_MAC_LANGID_DUTCH 4 # define TT_MAC_LANGID_SWEDISH 5 # define TT_MAC_LANGID_SPANISH 6 # define TT_MAC_LANGID_DANISH 7 # define TT_MAC_LANGID_PORTUGUESE 8 # define TT_MAC_LANGID_NORWEGIAN 9 # define TT_MAC_LANGID_HEBREW 10 # define TT_MAC_LANGID_JAPANESE 11 # define TT_MAC_LANGID_ARABIC 12 # define TT_MAC_LANGID_FINNISH 13 # define TT_MAC_LANGID_GREEK 14 # define TT_MAC_LANGID_ICELANDIC 15 # define TT_MAC_LANGID_MALTESE 16 # define TT_MAC_LANGID_TURKISH 17 # define TT_MAC_LANGID_CROATIAN 18 # define TT_MAC_LANGID_CHINESE_TRADITIONAL 19 # define TT_MAC_LANGID_URDU 20 # define TT_MAC_LANGID_HINDI 21 # define TT_MAC_LANGID_THAI 22 # define TT_MAC_LANGID_KOREAN 23 # define TT_MAC_LANGID_LITHUANIAN 24 # define TT_MAC_LANGID_POLISH 25 # define TT_MAC_LANGID_HUNGARIAN 26 # define TT_MAC_LANGID_ESTONIAN 27 # define TT_MAC_LANGID_LETTISH 28 # define TT_MAC_LANGID_SAAMISK 29 # define TT_MAC_LANGID_FAEROESE 30 # define TT_MAC_LANGID_FARSI 31 # define TT_MAC_LANGID_RUSSIAN 32 # define TT_MAC_LANGID_CHINESE_SIMPLIFIED 33 # define TT_MAC_LANGID_FLEMISH 34 # define TT_MAC_LANGID_IRISH 35 # define TT_MAC_LANGID_ALBANIAN 36 # define TT_MAC_LANGID_ROMANIAN 37 # define TT_MAC_LANGID_CZECH 38 # define TT_MAC_LANGID_SLOVAK 39 # define TT_MAC_LANGID_SLOVENIAN 40 # define TT_MAC_LANGID_YIDDISH 41 # define TT_MAC_LANGID_SERBIAN 42 # define TT_MAC_LANGID_MACEDONIAN 43 # define TT_MAC_LANGID_BULGARIAN 44 # define TT_MAC_LANGID_UKRAINIAN 45 # define TT_MAC_LANGID_BYELORUSSIAN 46 # define TT_MAC_LANGID_UZBEK 47 # define TT_MAC_LANGID_KAZAKH 48 # define TT_MAC_LANGID_AZERBAIJANI 49 # define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT 49 # define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT 50 # define TT_MAC_LANGID_ARMENIAN 51 # define TT_MAC_LANGID_GEORGIAN 52 # define TT_MAC_LANGID_MOLDAVIAN 53 # define TT_MAC_LANGID_KIRGHIZ 54 # define TT_MAC_LANGID_TAJIKI 55 # define TT_MAC_LANGID_TURKMEN 56 # define TT_MAC_LANGID_MONGOLIAN 57 # define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT 57 # define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT 58 # define TT_MAC_LANGID_PASHTO 59 # define TT_MAC_LANGID_KURDISH 60 # define TT_MAC_LANGID_KASHMIRI 61 # define TT_MAC_LANGID_SINDHI 62 # define TT_MAC_LANGID_TIBETAN 63 # define TT_MAC_LANGID_NEPALI 64 # define TT_MAC_LANGID_SANSKRIT 65 # define TT_MAC_LANGID_MARATHI 66 # define TT_MAC_LANGID_BENGALI 67 # define TT_MAC_LANGID_ASSAMESE 68 # define TT_MAC_LANGID_GUJARATI 69 # define TT_MAC_LANGID_PUNJABI 70 # define TT_MAC_LANGID_ORIYA 71 # define TT_MAC_LANGID_MALAYALAM 72 # define TT_MAC_LANGID_KANNADA 73 # define TT_MAC_LANGID_TAMIL 74 # define TT_MAC_LANGID_TELUGU 75 # define TT_MAC_LANGID_SINHALESE 76 # define TT_MAC_LANGID_BURMESE 77 # define TT_MAC_LANGID_KHMER 78 # define TT_MAC_LANGID_LAO 79 # define TT_MAC_LANGID_VIETNAMESE 80 # define TT_MAC_LANGID_INDONESIAN 81 # define TT_MAC_LANGID_TAGALOG 82 # define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT 83 # define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT 84 # define TT_MAC_LANGID_AMHARIC 85 # define TT_MAC_LANGID_TIGRINYA 86 # define TT_MAC_LANGID_GALLA 87 # define TT_MAC_LANGID_SOMALI 88 # define TT_MAC_LANGID_SWAHILI 89 # define TT_MAC_LANGID_RUANDA 90 # define TT_MAC_LANGID_RUNDI 91 # define TT_MAC_LANGID_CHEWA 92 # define TT_MAC_LANGID_MALAGASY 93 # define TT_MAC_LANGID_ESPERANTO 94 # define TT_MAC_LANGID_WELSH 128 # define TT_MAC_LANGID_BASQUE 129 # define TT_MAC_LANGID_CATALAN 130 # define TT_MAC_LANGID_LATIN 131 # define TT_MAC_LANGID_QUECHUA 132 # define TT_MAC_LANGID_GUARANI 133 # define TT_MAC_LANGID_AYMARA 134 # define TT_MAC_LANGID_TATAR 135 # define TT_MAC_LANGID_UIGHUR 136 # define TT_MAC_LANGID_DZONGKHA 137 # define TT_MAC_LANGID_JAVANESE 138 # define TT_MAC_LANGID_SUNDANESE 139 /* The following codes are new as of 2000-03-10 */ # define TT_MAC_LANGID_GALICIAN 140 # define TT_MAC_LANGID_AFRIKAANS 141 # define TT_MAC_LANGID_BRETON 142 # define TT_MAC_LANGID_INUKTITUT 143 # define TT_MAC_LANGID_SCOTTISH_GAELIC 144 # define TT_MAC_LANGID_MANX_GAELIC 145 # define TT_MAC_LANGID_IRISH_GAELIC 146 # define TT_MAC_LANGID_TONGAN 147 # define TT_MAC_LANGID_GREEK_POLYTONIC 148 # define TT_MAC_LANGID_GREELANDIC 149 # define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT 150 Possible values of the language identifier field in the name records of the SFNT \u2018name\u2019 table if the \u2018platform\u2019 identifier code is TT_PLATFORM_MACINTOSH . These values are also used as return values for function FT_Get_CMap_Language_ID . The canonical source for Apple's IDs is https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html","title":"TT_MAC_LANGID_XXX"},{"location":"ft2-truetype_tables.html#tt_ms_langid_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_MS_LANGID_ARABIC_SAUDI_ARABIA 0x0401 # define TT_MS_LANGID_ARABIC_IRAQ 0x0801 # define TT_MS_LANGID_ARABIC_EGYPT 0x0C01 # define TT_MS_LANGID_ARABIC_LIBYA 0x1001 # define TT_MS_LANGID_ARABIC_ALGERIA 0x1401 # define TT_MS_LANGID_ARABIC_MOROCCO 0x1801 # define TT_MS_LANGID_ARABIC_TUNISIA 0x1C01 # define TT_MS_LANGID_ARABIC_OMAN 0x2001 # define TT_MS_LANGID_ARABIC_YEMEN 0x2401 # define TT_MS_LANGID_ARABIC_SYRIA 0x2801 # define TT_MS_LANGID_ARABIC_JORDAN 0x2C01 # define TT_MS_LANGID_ARABIC_LEBANON 0x3001 # define TT_MS_LANGID_ARABIC_KUWAIT 0x3401 # define TT_MS_LANGID_ARABIC_UAE 0x3801 # define TT_MS_LANGID_ARABIC_BAHRAIN 0x3C01 # define TT_MS_LANGID_ARABIC_QATAR 0x4001 # define TT_MS_LANGID_BULGARIAN_BULGARIA 0x0402 # define TT_MS_LANGID_CATALAN_CATALAN 0x0403 # define TT_MS_LANGID_CHINESE_TAIWAN 0x0404 # define TT_MS_LANGID_CHINESE_PRC 0x0804 # define TT_MS_LANGID_CHINESE_HONG_KONG 0x0C04 # define TT_MS_LANGID_CHINESE_SINGAPORE 0x1004 # define TT_MS_LANGID_CHINESE_MACAO 0x1404 # define TT_MS_LANGID_CZECH_CZECH_REPUBLIC 0x0405 # define TT_MS_LANGID_DANISH_DENMARK 0x0406 # define TT_MS_LANGID_GERMAN_GERMANY 0x0407 # define TT_MS_LANGID_GERMAN_SWITZERLAND 0x0807 # define TT_MS_LANGID_GERMAN_AUSTRIA 0x0C07 # define TT_MS_LANGID_GERMAN_LUXEMBOURG 0x1007 # define TT_MS_LANGID_GERMAN_LIECHTENSTEIN 0x1407 # define TT_MS_LANGID_GREEK_GREECE 0x0408 # define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 # define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM 0x0809 # define TT_MS_LANGID_ENGLISH_AUSTRALIA 0x0C09 # define TT_MS_LANGID_ENGLISH_CANADA 0x1009 # define TT_MS_LANGID_ENGLISH_NEW_ZEALAND 0x1409 # define TT_MS_LANGID_ENGLISH_IRELAND 0x1809 # define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA 0x1C09 # define TT_MS_LANGID_ENGLISH_JAMAICA 0x2009 # define TT_MS_LANGID_ENGLISH_CARIBBEAN 0x2409 # define TT_MS_LANGID_ENGLISH_BELIZE 0x2809 # define TT_MS_LANGID_ENGLISH_TRINIDAD 0x2C09 # define TT_MS_LANGID_ENGLISH_ZIMBABWE 0x3009 # define TT_MS_LANGID_ENGLISH_PHILIPPINES 0x3409 # define TT_MS_LANGID_ENGLISH_INDIA 0x4009 # define TT_MS_LANGID_ENGLISH_MALAYSIA 0x4409 # define TT_MS_LANGID_ENGLISH_SINGAPORE 0x4809 # define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT 0x040A # define TT_MS_LANGID_SPANISH_MEXICO 0x080A # define TT_MS_LANGID_SPANISH_SPAIN_MODERN_SORT 0x0C0A # define TT_MS_LANGID_SPANISH_GUATEMALA 0x100A # define TT_MS_LANGID_SPANISH_COSTA_RICA 0x140A # define TT_MS_LANGID_SPANISH_PANAMA 0x180A # define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC 0x1C0A # define TT_MS_LANGID_SPANISH_VENEZUELA 0x200A # define TT_MS_LANGID_SPANISH_COLOMBIA 0x240A # define TT_MS_LANGID_SPANISH_PERU 0x280A # define TT_MS_LANGID_SPANISH_ARGENTINA 0x2C0A # define TT_MS_LANGID_SPANISH_ECUADOR 0x300A # define TT_MS_LANGID_SPANISH_CHILE 0x340A # define TT_MS_LANGID_SPANISH_URUGUAY 0x380A # define TT_MS_LANGID_SPANISH_PARAGUAY 0x3C0A # define TT_MS_LANGID_SPANISH_BOLIVIA 0x400A # define TT_MS_LANGID_SPANISH_EL_SALVADOR 0x440A # define TT_MS_LANGID_SPANISH_HONDURAS 0x480A # define TT_MS_LANGID_SPANISH_NICARAGUA 0x4C0A # define TT_MS_LANGID_SPANISH_PUERTO_RICO 0x500A # define TT_MS_LANGID_SPANISH_UNITED_STATES 0x540A # define TT_MS_LANGID_FINNISH_FINLAND 0x040B # define TT_MS_LANGID_FRENCH_FRANCE 0x040C # define TT_MS_LANGID_FRENCH_BELGIUM 0x080C # define TT_MS_LANGID_FRENCH_CANADA 0x0C0C # define TT_MS_LANGID_FRENCH_SWITZERLAND 0x100C # define TT_MS_LANGID_FRENCH_LUXEMBOURG 0x140C # define TT_MS_LANGID_FRENCH_MONACO 0x180C # define TT_MS_LANGID_HEBREW_ISRAEL 0x040D # define TT_MS_LANGID_HUNGARIAN_HUNGARY 0x040E # define TT_MS_LANGID_ICELANDIC_ICELAND 0x040F # define TT_MS_LANGID_ITALIAN_ITALY 0x0410 # define TT_MS_LANGID_ITALIAN_SWITZERLAND 0x0810 # define TT_MS_LANGID_JAPANESE_JAPAN 0x0411 # define TT_MS_LANGID_KOREAN_KOREA 0x0412 # define TT_MS_LANGID_DUTCH_NETHERLANDS 0x0413 # define TT_MS_LANGID_DUTCH_BELGIUM 0x0813 # define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL 0x0414 # define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK 0x0814 # define TT_MS_LANGID_POLISH_POLAND 0x0415 # define TT_MS_LANGID_PORTUGUESE_BRAZIL 0x0416 # define TT_MS_LANGID_PORTUGUESE_PORTUGAL 0x0816 # define TT_MS_LANGID_ROMANSH_SWITZERLAND 0x0417 # define TT_MS_LANGID_ROMANIAN_ROMANIA 0x0418 # define TT_MS_LANGID_RUSSIAN_RUSSIA 0x0419 # define TT_MS_LANGID_CROATIAN_CROATIA 0x041A # define TT_MS_LANGID_SERBIAN_SERBIA_LATIN 0x081A # define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC 0x0C1A # define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA 0x101A # define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA 0x141A # define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN 0x181A # define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC 0x1C1A # define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZ_CYRILLIC 0x201A # define TT_MS_LANGID_SLOVAK_SLOVAKIA 0x041B # define TT_MS_LANGID_ALBANIAN_ALBANIA 0x041C # define TT_MS_LANGID_SWEDISH_SWEDEN 0x041D # define TT_MS_LANGID_SWEDISH_FINLAND 0x081D # define TT_MS_LANGID_THAI_THAILAND 0x041E # define TT_MS_LANGID_TURKISH_TURKEY 0x041F # define TT_MS_LANGID_URDU_PAKISTAN 0x0420 # define TT_MS_LANGID_INDONESIAN_INDONESIA 0x0421 # define TT_MS_LANGID_UKRAINIAN_UKRAINE 0x0422 # define TT_MS_LANGID_BELARUSIAN_BELARUS 0x0423 # define TT_MS_LANGID_SLOVENIAN_SLOVENIA 0x0424 # define TT_MS_LANGID_ESTONIAN_ESTONIA 0x0425 # define TT_MS_LANGID_LATVIAN_LATVIA 0x0426 # define TT_MS_LANGID_LITHUANIAN_LITHUANIA 0x0427 # define TT_MS_LANGID_TAJIK_TAJIKISTAN 0x0428 # define TT_MS_LANGID_VIETNAMESE_VIET_NAM 0x042A # define TT_MS_LANGID_ARMENIAN_ARMENIA 0x042B # define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN 0x042C # define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC 0x082C # define TT_MS_LANGID_BASQUE_BASQUE 0x042D # define TT_MS_LANGID_UPPER_SORBIAN_GERMANY 0x042E # define TT_MS_LANGID_LOWER_SORBIAN_GERMANY 0x082E # define TT_MS_LANGID_MACEDONIAN_MACEDONIA 0x042F # define TT_MS_LANGID_SETSWANA_SOUTH_AFRICA 0x0432 # define TT_MS_LANGID_ISIXHOSA_SOUTH_AFRICA 0x0434 # define TT_MS_LANGID_ISIZULU_SOUTH_AFRICA 0x0435 # define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA 0x0436 # define TT_MS_LANGID_GEORGIAN_GEORGIA 0x0437 # define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS 0x0438 # define TT_MS_LANGID_HINDI_INDIA 0x0439 # define TT_MS_LANGID_MALTESE_MALTA 0x043A # define TT_MS_LANGID_SAMI_NORTHERN_NORWAY 0x043B # define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN 0x083B # define TT_MS_LANGID_SAMI_NORTHERN_FINLAND 0x0C3B # define TT_MS_LANGID_SAMI_LULE_NORWAY 0x103B # define TT_MS_LANGID_SAMI_LULE_SWEDEN 0x143B # define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY 0x183B # define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN 0x1C3B # define TT_MS_LANGID_SAMI_SKOLT_FINLAND 0x203B # define TT_MS_LANGID_SAMI_INARI_FINLAND 0x243B # define TT_MS_LANGID_IRISH_IRELAND 0x083C # define TT_MS_LANGID_MALAY_MALAYSIA 0x043E # define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E # define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F # define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic */ 0x0440 # define TT_MS_LANGID_KISWAHILI_KENYA 0x0441 # define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442 # define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443 # define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC 0x0843 # define TT_MS_LANGID_TATAR_RUSSIA 0x0444 # define TT_MS_LANGID_BENGALI_INDIA 0x0445 # define TT_MS_LANGID_BENGALI_BANGLADESH 0x0845 # define TT_MS_LANGID_PUNJABI_INDIA 0x0446 # define TT_MS_LANGID_GUJARATI_INDIA 0x0447 # define TT_MS_LANGID_ODIA_INDIA 0x0448 # define TT_MS_LANGID_TAMIL_INDIA 0x0449 # define TT_MS_LANGID_TELUGU_INDIA 0x044A # define TT_MS_LANGID_KANNADA_INDIA 0x044B # define TT_MS_LANGID_MALAYALAM_INDIA 0x044C # define TT_MS_LANGID_ASSAMESE_INDIA 0x044D # define TT_MS_LANGID_MARATHI_INDIA 0x044E # define TT_MS_LANGID_SANSKRIT_INDIA 0x044F # define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450 # define TT_MS_LANGID_MONGOLIAN_PRC 0x0850 # define TT_MS_LANGID_TIBETAN_PRC 0x0451 # define TT_MS_LANGID_WELSH_UNITED_KINGDOM 0x0452 # define TT_MS_LANGID_KHMER_CAMBODIA 0x0453 # define TT_MS_LANGID_LAO_LAOS 0x0454 # define TT_MS_LANGID_GALICIAN_GALICIAN 0x0456 # define TT_MS_LANGID_KONKANI_INDIA 0x0457 # define TT_MS_LANGID_SYRIAC_SYRIA 0x045A # define TT_MS_LANGID_SINHALA_SRI_LANKA 0x045B # define TT_MS_LANGID_INUKTITUT_CANADA 0x045D # define TT_MS_LANGID_INUKTITUT_CANADA_LATIN 0x085D # define TT_MS_LANGID_AMHARIC_ETHIOPIA 0x045E # define TT_MS_LANGID_TAMAZIGHT_ALGERIA 0x085F # define TT_MS_LANGID_NEPALI_NEPAL 0x0461 # define TT_MS_LANGID_FRISIAN_NETHERLANDS 0x0462 # define TT_MS_LANGID_PASHTO_AFGHANISTAN 0x0463 # define TT_MS_LANGID_FILIPINO_PHILIPPINES 0x0464 # define TT_MS_LANGID_DHIVEHI_MALDIVES 0x0465 # define TT_MS_LANGID_HAUSA_NIGERIA 0x0468 # define TT_MS_LANGID_YORUBA_NIGERIA 0x046A # define TT_MS_LANGID_QUECHUA_BOLIVIA 0x046B # define TT_MS_LANGID_QUECHUA_ECUADOR 0x086B # define TT_MS_LANGID_QUECHUA_PERU 0x0C6B # define TT_MS_LANGID_SESOTHO_SA_LEBOA_SOUTH_AFRICA 0x046C # define TT_MS_LANGID_BASHKIR_RUSSIA 0x046D # define TT_MS_LANGID_LUXEMBOURGISH_LUXEMBOURG 0x046E # define TT_MS_LANGID_GREENLANDIC_GREENLAND 0x046F # define TT_MS_LANGID_IGBO_NIGERIA 0x0470 # define TT_MS_LANGID_YI_PRC 0x0478 # define TT_MS_LANGID_MAPUDUNGUN_CHILE 0x047A # define TT_MS_LANGID_MOHAWK_MOHAWK 0x047C # define TT_MS_LANGID_BRETON_FRANCE 0x047E # define TT_MS_LANGID_UIGHUR_PRC 0x0480 # define TT_MS_LANGID_MAORI_NEW_ZEALAND 0x0481 # define TT_MS_LANGID_OCCITAN_FRANCE 0x0482 # define TT_MS_LANGID_CORSICAN_FRANCE 0x0483 # define TT_MS_LANGID_ALSATIAN_FRANCE 0x0484 # define TT_MS_LANGID_YAKUT_RUSSIA 0x0485 # define TT_MS_LANGID_KICHE_GUATEMALA 0x0486 # define TT_MS_LANGID_KINYARWANDA_RWANDA 0x0487 # define TT_MS_LANGID_WOLOF_SENEGAL 0x0488 # define TT_MS_LANGID_DARI_AFGHANISTAN 0x048C Possible values of the language identifier field in the name records of the SFNT \u2018name\u2019 table if the \u2018platform\u2019 identifier code is TT_PLATFORM_MICROSOFT . These values are also used as return values for function FT_Get_CMap_Language_ID . The canonical source for Microsoft's IDs is https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings , however, we only provide macros for language identifiers present in the OpenType specification: Microsoft has abandoned the concept of LCIDs (language code identifiers), and format 1 of the \u2018name\u2019 table provides a better mechanism for languages not covered here. More legacy values not listed in the reference can be found in the FT_TRUETYPE_IDS_H header file.","title":"TT_MS_LANGID_XXX"},{"location":"ft2-truetype_tables.html#tt_name_id_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). # define TT_NAME_ID_COPYRIGHT 0 # define TT_NAME_ID_FONT_FAMILY 1 # define TT_NAME_ID_FONT_SUBFAMILY 2 # define TT_NAME_ID_UNIQUE_ID 3 # define TT_NAME_ID_FULL_NAME 4 # define TT_NAME_ID_VERSION_STRING 5 # define TT_NAME_ID_PS_NAME 6 # define TT_NAME_ID_TRADEMARK 7 /* the following values are from the OpenType spec */ # define TT_NAME_ID_MANUFACTURER 8 # define TT_NAME_ID_DESIGNER 9 # define TT_NAME_ID_DESCRIPTION 10 # define TT_NAME_ID_VENDOR_URL 11 # define TT_NAME_ID_DESIGNER_URL 12 # define TT_NAME_ID_LICENSE 13 # define TT_NAME_ID_LICENSE_URL 14 /* number 15 is reserved */ # define TT_NAME_ID_TYPOGRAPHIC_FAMILY 16 # define TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY 17 # define TT_NAME_ID_MAC_FULL_NAME 18 /* The following code is new as of 2000-01-21 */ # define TT_NAME_ID_SAMPLE_TEXT 19 /* This is new in OpenType 1.3 */ # define TT_NAME_ID_CID_FINDFONT_NAME 20 /* This is new in OpenType 1.5 */ # define TT_NAME_ID_WWS_FAMILY 21 # define TT_NAME_ID_WWS_SUBFAMILY 22 /* This is new in OpenType 1.7 */ # define TT_NAME_ID_LIGHT_BACKGROUND 23 # define TT_NAME_ID_DARK_BACKGROUND 24 /* This is new in OpenType 1.8 */ # define TT_NAME_ID_VARIATIONS_PREFIX 25 /* these two values are deprecated */ # define TT_NAME_ID_PREFERRED_FAMILY TT_NAME_ID_TYPOGRAPHIC_FAMILY # define TT_NAME_ID_PREFERRED_SUBFAMILY TT_NAME_ID_TYPOGRAPHIC_SUBFAMILY Possible values of the \u2018name\u2019 identifier field in the name records of an SFNT \u2018name\u2019 table. These values are platform independent.","title":"TT_NAME_ID_XXX"},{"location":"ft2-truetype_tables.html#tt_ucr_xxx","text":"Defined in FT_TRUETYPE_IDS_H (freetype/ttnameid.h). /* ulUnicodeRange1 */ /* --------------- */ /* Bit 0 Basic Latin */ # define TT_UCR_BASIC_LATIN (1L << 0) /* U+0020-U+007E */ /* Bit 1 C1 Controls and Latin-1 Supplement */ # define TT_UCR_LATIN1_SUPPLEMENT (1L << 1) /* U+0080-U+00FF */ /* Bit 2 Latin Extended-A */ # define TT_UCR_LATIN_EXTENDED_A (1L << 2) /* U+0100-U+017F */ /* Bit 3 Latin Extended-B */ # define TT_UCR_LATIN_EXTENDED_B (1L << 3) /* U+0180-U+024F */ /* Bit 4 IPA Extensions */ /* Phonetic Extensions */ /* Phonetic Extensions Supplement */ # define TT_UCR_IPA_EXTENSIONS (1L << 4) /* U+0250-U+02AF */ /* U+1D00-U+1D7F */ /* U+1D80-U+1DBF */ /* Bit 5 Spacing Modifier Letters */ /* Modifier Tone Letters */ # define TT_UCR_SPACING_MODIFIER (1L << 5) /* U+02B0-U+02FF */ /* U+A700-U+A71F */ /* Bit 6 Combining Diacritical Marks */ /* Combining Diacritical Marks Supplement */ # define TT_UCR_COMBINING_DIACRITICAL_MARKS (1L << 6) /* U+0300-U+036F */ /* U+1DC0-U+1DFF */ /* Bit 7 Greek and Coptic */ # define TT_UCR_GREEK (1L << 7) /* U+0370-U+03FF */ /* Bit 8 Coptic */ # define TT_UCR_COPTIC (1L << 8) /* U+2C80-U+2CFF */ /* Bit 9 Cyrillic */ /* Cyrillic Supplement */ /* Cyrillic Extended-A */ /* Cyrillic Extended-B */ # define TT_UCR_CYRILLIC (1L << 9) /* U+0400-U+04FF */ /* U+0500-U+052F */ /* U+2DE0-U+2DFF */ /* U+A640-U+A69F */ /* Bit 10 Armenian */ # define TT_UCR_ARMENIAN (1L << 10) /* U+0530-U+058F */ /* Bit 11 Hebrew */ # define TT_UCR_HEBREW (1L << 11) /* U+0590-U+05FF */ /* Bit 12 Vai */ # define TT_UCR_VAI (1L << 12) /* U+A500-U+A63F */ /* Bit 13 Arabic */ /* Arabic Supplement */ # define TT_UCR_ARABIC (1L << 13) /* U+0600-U+06FF */ /* U+0750-U+077F */ /* Bit 14 NKo */ # define TT_UCR_NKO (1L << 14) /* U+07C0-U+07FF */ /* Bit 15 Devanagari */ # define TT_UCR_DEVANAGARI (1L << 15) /* U+0900-U+097F */ /* Bit 16 Bengali */ # define TT_UCR_BENGALI (1L << 16) /* U+0980-U+09FF */ /* Bit 17 Gurmukhi */ # define TT_UCR_GURMUKHI (1L << 17) /* U+0A00-U+0A7F */ /* Bit 18 Gujarati */ # define TT_UCR_GUJARATI (1L << 18) /* U+0A80-U+0AFF */ /* Bit 19 Oriya */ # define TT_UCR_ORIYA (1L << 19) /* U+0B00-U+0B7F */ /* Bit 20 Tamil */ # define TT_UCR_TAMIL (1L << 20) /* U+0B80-U+0BFF */ /* Bit 21 Telugu */ # define TT_UCR_TELUGU (1L << 21) /* U+0C00-U+0C7F */ /* Bit 22 Kannada */ # define TT_UCR_KANNADA (1L << 22) /* U+0C80-U+0CFF */ /* Bit 23 Malayalam */ # define TT_UCR_MALAYALAM (1L << 23) /* U+0D00-U+0D7F */ /* Bit 24 Thai */ # define TT_UCR_THAI (1L << 24) /* U+0E00-U+0E7F */ /* Bit 25 Lao */ # define TT_UCR_LAO (1L << 25) /* U+0E80-U+0EFF */ /* Bit 26 Georgian */ /* Georgian Supplement */ # define TT_UCR_GEORGIAN (1L << 26) /* U+10A0-U+10FF */ /* U+2D00-U+2D2F */ /* Bit 27 Balinese */ # define TT_UCR_BALINESE (1L << 27) /* U+1B00-U+1B7F */ /* Bit 28 Hangul Jamo */ # define TT_UCR_HANGUL_JAMO (1L << 28) /* U+1100-U+11FF */ /* Bit 29 Latin Extended Additional */ /* Latin Extended-C */ /* Latin Extended-D */ # define TT_UCR_LATIN_EXTENDED_ADDITIONAL (1L << 29) /* U+1E00-U+1EFF */ /* U+2C60-U+2C7F */ /* U+A720-U+A7FF */ /* Bit 30 Greek Extended */ # define TT_UCR_GREEK_EXTENDED (1L << 30) /* U+1F00-U+1FFF */ /* Bit 31 General Punctuation */ /* Supplemental Punctuation */ # define TT_UCR_GENERAL_PUNCTUATION (1L << 31) /* U+2000-U+206F */ /* U+2E00-U+2E7F */ /* ulUnicodeRange2 */ /* --------------- */ /* Bit 32 Superscripts And Subscripts */ # define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS (1L << 0) /* U+2070-U+209F */ /* Bit 33 Currency Symbols */ # define TT_UCR_CURRENCY_SYMBOLS (1L << 1) /* U+20A0-U+20CF */ /* Bit 34 Combining Diacritical Marks For Symbols */ # define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\ (1L << 2) /* U+20D0-U+20FF */ /* Bit 35 Letterlike Symbols */ # define TT_UCR_LETTERLIKE_SYMBOLS (1L << 3) /* U+2100-U+214F */ /* Bit 36 Number Forms */ # define TT_UCR_NUMBER_FORMS (1L << 4) /* U+2150-U+218F */ /* Bit 37 Arrows */ /* Supplemental Arrows-A */ /* Supplemental Arrows-B */ /* Miscellaneous Symbols and Arrows */ # define TT_UCR_ARROWS (1L << 5) /* U+2190-U+21FF */ /* U+27F0-U+27FF */ /* U+2900-U+297F */ /* U+2B00-U+2BFF */ /* Bit 38 Mathematical Operators */ /* Supplemental Mathematical Operators */ /* Miscellaneous Mathematical Symbols-A */ /* Miscellaneous Mathematical Symbols-B */ # define TT_UCR_MATHEMATICAL_OPERATORS (1L << 6) /* U+2200-U+22FF */ /* U+2A00-U+2AFF */ /* U+27C0-U+27EF */ /* U+2980-U+29FF */ /* Bit 39 Miscellaneous Technical */ # define TT_UCR_MISCELLANEOUS_TECHNICAL (1L << 7) /* U+2300-U+23FF */ /* Bit 40 Control Pictures */ # define TT_UCR_CONTROL_PICTURES (1L << 8) /* U+2400-U+243F */ /* Bit 41 Optical Character Recognition */ # define TT_UCR_OCR (1L << 9) /* U+2440-U+245F */ /* Bit 42 Enclosed Alphanumerics */ # define TT_UCR_ENCLOSED_ALPHANUMERICS (1L << 10) /* U+2460-U+24FF */ /* Bit 43 Box Drawing */ # define TT_UCR_BOX_DRAWING (1L << 11) /* U+2500-U+257F */ /* Bit 44 Block Elements */ # define TT_UCR_BLOCK_ELEMENTS (1L << 12) /* U+2580-U+259F */ /* Bit 45 Geometric Shapes */ # define TT_UCR_GEOMETRIC_SHAPES (1L << 13) /* U+25A0-U+25FF */ /* Bit 46 Miscellaneous Symbols */ # define TT_UCR_MISCELLANEOUS_SYMBOLS (1L << 14) /* U+2600-U+26FF */ /* Bit 47 Dingbats */ # define TT_UCR_DINGBATS (1L << 15) /* U+2700-U+27BF */ /* Bit 48 CJK Symbols and Punctuation */ # define TT_UCR_CJK_SYMBOLS (1L << 16) /* U+3000-U+303F */ /* Bit 49 Hiragana */ # define TT_UCR_HIRAGANA (1L << 17) /* U+3040-U+309F */ /* Bit 50 Katakana */ /* Katakana Phonetic Extensions */ # define TT_UCR_KATAKANA (1L << 18) /* U+30A0-U+30FF */ /* U+31F0-U+31FF */ /* Bit 51 Bopomofo */ /* Bopomofo Extended */ # define TT_UCR_BOPOMOFO (1L << 19) /* U+3100-U+312F */ /* U+31A0-U+31BF */ /* Bit 52 Hangul Compatibility Jamo */ # define TT_UCR_HANGUL_COMPATIBILITY_JAMO (1L << 20) /* U+3130-U+318F */ /* Bit 53 Phags-Pa */ # define TT_UCR_CJK_MISC (1L << 21) /* U+A840-U+A87F */ # define TT_UCR_KANBUN TT_UCR_CJK_MISC /* deprecated */ # define TT_UCR_PHAGSPA /* Bit 54 Enclosed CJK Letters and Months */ # define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS (1L << 22) /* U+3200-U+32FF */ /* Bit 55 CJK Compatibility */ # define TT_UCR_CJK_COMPATIBILITY (1L << 23) /* U+3300-U+33FF */ /* Bit 56 Hangul Syllables */ # define TT_UCR_HANGUL (1L << 24) /* U+AC00-U+D7A3 */ /* Bit 57 High Surrogates */ /* High Private Use Surrogates */ /* Low Surrogates */ /* According to OpenType specs v.1.3+, */ /* setting bit 57 implies that there is */ /* at least one codepoint beyond the */ /* Basic Multilingual Plane that is */ /* supported by this font. So it really */ /* means >= U+10000. */ # define TT_UCR_SURROGATES (1L << 25) /* U+D800-U+DB7F */ /* U+DB80-U+DBFF */ /* U+DC00-U+DFFF */ # define TT_UCR_NON_PLANE_0 TT_UCR_SURROGATES /* Bit 58 Phoenician */ # define TT_UCR_PHOENICIAN (1L << 26) /*U+10900-U+1091F*/ /* Bit 59 CJK Unified Ideographs */ /* CJK Radicals Supplement */ /* Kangxi Radicals */ /* Ideographic Description Characters */ /* CJK Unified Ideographs Extension A */ /* CJK Unified Ideographs Extension B */ /* Kanbun */ # define TT_UCR_CJK_UNIFIED_IDEOGRAPHS (1L << 27) /* U+4E00-U+9FFF */ /* U+2E80-U+2EFF */ /* U+2F00-U+2FDF */ /* U+2FF0-U+2FFF */ /* U+3400-U+4DB5 */ /*U+20000-U+2A6DF*/ /* U+3190-U+319F */ /* Bit 60 Private Use */ # define TT_UCR_PRIVATE_USE (1L << 28) /* U+E000-U+F8FF */ /* Bit 61 CJK Strokes */ /* CJK Compatibility Ideographs */ /* CJK Compatibility Ideographs Supplement */ # define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS (1L << 29) /* U+31C0-U+31EF */ /* U+F900-U+FAFF */ /*U+2F800-U+2FA1F*/ /* Bit 62 Alphabetic Presentation Forms */ # define TT_UCR_ALPHABETIC_PRESENTATION_FORMS (1L << 30) /* U+FB00-U+FB4F */ /* Bit 63 Arabic Presentation Forms-A */ # define TT_UCR_ARABIC_PRESENTATION_FORMS_A (1L << 31) /* U+FB50-U+FDFF */ /* ulUnicodeRange3 */ /* --------------- */ /* Bit 64 Combining Half Marks */ # define TT_UCR_COMBINING_HALF_MARKS (1L << 0) /* U+FE20-U+FE2F */ /* Bit 65 Vertical forms */ /* CJK Compatibility Forms */ # define TT_UCR_CJK_COMPATIBILITY_FORMS (1L << 1) /* U+FE10-U+FE1F */ /* U+FE30-U+FE4F */ /* Bit 66 Small Form Variants */ # define TT_UCR_SMALL_FORM_VARIANTS (1L << 2) /* U+FE50-U+FE6F */ /* Bit 67 Arabic Presentation Forms-B */ # define TT_UCR_ARABIC_PRESENTATION_FORMS_B (1L << 3) /* U+FE70-U+FEFE */ /* Bit 68 Halfwidth and Fullwidth Forms */ # define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS (1L << 4) /* U+FF00-U+FFEF */ /* Bit 69 Specials */ # define TT_UCR_SPECIALS (1L << 5) /* U+FFF0-U+FFFD */ /* Bit 70 Tibetan */ # define TT_UCR_TIBETAN (1L << 6) /* U+0F00-U+0FFF */ /* Bit 71 Syriac */ # define TT_UCR_SYRIAC (1L << 7) /* U+0700-U+074F */ /* Bit 72 Thaana */ # define TT_UCR_THAANA (1L << 8) /* U+0780-U+07BF */ /* Bit 73 Sinhala */ # define TT_UCR_SINHALA (1L << 9) /* U+0D80-U+0DFF */ /* Bit 74 Myanmar */ # define TT_UCR_MYANMAR (1L << 10) /* U+1000-U+109F */ /* Bit 75 Ethiopic */ /* Ethiopic Supplement */ /* Ethiopic Extended */ # define TT_UCR_ETHIOPIC (1L << 11) /* U+1200-U+137F */ /* U+1380-U+139F */ /* U+2D80-U+2DDF */ /* Bit 76 Cherokee */ # define TT_UCR_CHEROKEE (1L << 12) /* U+13A0-U+13FF */ /* Bit 77 Unified Canadian Aboriginal Syllabics */ # define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS (1L << 13) /* U+1400-U+167F */ /* Bit 78 Ogham */ # define TT_UCR_OGHAM (1L << 14) /* U+1680-U+169F */ /* Bit 79 Runic */ # define TT_UCR_RUNIC (1L << 15) /* U+16A0-U+16FF */ /* Bit 80 Khmer */ /* Khmer Symbols */ # define TT_UCR_KHMER (1L << 16) /* U+1780-U+17FF */ /* U+19E0-U+19FF */ /* Bit 81 Mongolian */ # define TT_UCR_MONGOLIAN (1L << 17) /* U+1800-U+18AF */ /* Bit 82 Braille Patterns */ # define TT_UCR_BRAILLE (1L << 18) /* U+2800-U+28FF */ /* Bit 83 Yi Syllables */ /* Yi Radicals */ # define TT_UCR_YI (1L << 19) /* U+A000-U+A48F */ /* U+A490-U+A4CF */ /* Bit 84 Tagalog */ /* Hanunoo */ /* Buhid */ /* Tagbanwa */ # define TT_UCR_PHILIPPINE (1L << 20) /* U+1700-U+171F */ /* U+1720-U+173F */ /* U+1740-U+175F */ /* U+1760-U+177F */ /* Bit 85 Old Italic */ # define TT_UCR_OLD_ITALIC (1L << 21) /*U+10300-U+1032F*/ /* Bit 86 Gothic */ # define TT_UCR_GOTHIC (1L << 22) /*U+10330-U+1034F*/ /* Bit 87 Deseret */ # define TT_UCR_DESERET (1L << 23) /*U+10400-U+1044F*/ /* Bit 88 Byzantine Musical Symbols */ /* Musical Symbols */ /* Ancient Greek Musical Notation */ # define TT_UCR_MUSICAL_SYMBOLS (1L << 24) /*U+1D000-U+1D0FF*/ /*U+1D100-U+1D1FF*/ /*U+1D200-U+1D24F*/ /* Bit 89 Mathematical Alphanumeric Symbols */ # define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS (1L << 25) /*U+1D400-U+1D7FF*/ /* Bit 90 Private Use (plane 15) */ /* Private Use (plane 16) */ # define TT_UCR_PRIVATE_USE_SUPPLEMENTARY (1L << 26) /*U+F0000-U+FFFFD*/ /*U+100000-U+10FFFD*/ /* Bit 91 Variation Selectors */ /* Variation Selectors Supplement */ # define TT_UCR_VARIATION_SELECTORS (1L << 27) /* U+FE00-U+FE0F */ /*U+E0100-U+E01EF*/ /* Bit 92 Tags */ # define TT_UCR_TAGS (1L << 28) /*U+E0000-U+E007F*/ /* Bit 93 Limbu */ # define TT_UCR_LIMBU (1L << 29) /* U+1900-U+194F */ /* Bit 94 Tai Le */ # define TT_UCR_TAI_LE (1L << 30) /* U+1950-U+197F */ /* Bit 95 New Tai Lue */ # define TT_UCR_NEW_TAI_LUE (1L << 31) /* U+1980-U+19DF */ /* ulUnicodeRange4 */ /* --------------- */ /* Bit 96 Buginese */ # define TT_UCR_BUGINESE (1L << 0) /* U+1A00-U+1A1F */ /* Bit 97 Glagolitic */ # define TT_UCR_GLAGOLITIC (1L << 1) /* U+2C00-U+2C5F */ /* Bit 98 Tifinagh */ # define TT_UCR_TIFINAGH (1L << 2) /* U+2D30-U+2D7F */ /* Bit 99 Yijing Hexagram Symbols */ # define TT_UCR_YIJING (1L << 3) /* U+4DC0-U+4DFF */ /* Bit 100 Syloti Nagri */ # define TT_UCR_SYLOTI_NAGRI (1L << 4) /* U+A800-U+A82F */ /* Bit 101 Linear B Syllabary */ /* Linear B Ideograms */ /* Aegean Numbers */ # define TT_UCR_LINEAR_B (1L << 5) /*U+10000-U+1007F*/ /*U+10080-U+100FF*/ /*U+10100-U+1013F*/ /* Bit 102 Ancient Greek Numbers */ # define TT_UCR_ANCIENT_GREEK_NUMBERS (1L << 6) /*U+10140-U+1018F*/ /* Bit 103 Ugaritic */ # define TT_UCR_UGARITIC (1L << 7) /*U+10380-U+1039F*/ /* Bit 104 Old Persian */ # define TT_UCR_OLD_PERSIAN (1L << 8) /*U+103A0-U+103DF*/ /* Bit 105 Shavian */ # define TT_UCR_SHAVIAN (1L << 9) /*U+10450-U+1047F*/ /* Bit 106 Osmanya */ # define TT_UCR_OSMANYA (1L << 10) /*U+10480-U+104AF*/ /* Bit 107 Cypriot Syllabary */ # define TT_UCR_CYPRIOT_SYLLABARY (1L << 11) /*U+10800-U+1083F*/ /* Bit 108 Kharoshthi */ # define TT_UCR_KHAROSHTHI (1L << 12) /*U+10A00-U+10A5F*/ /* Bit 109 Tai Xuan Jing Symbols */ # define TT_UCR_TAI_XUAN_JING (1L << 13) /*U+1D300-U+1D35F*/ /* Bit 110 Cuneiform */ /* Cuneiform Numbers and Punctuation */ # define TT_UCR_CUNEIFORM (1L << 14) /*U+12000-U+123FF*/ /*U+12400-U+1247F*/ /* Bit 111 Counting Rod Numerals */ # define TT_UCR_COUNTING_ROD_NUMERALS (1L << 15) /*U+1D360-U+1D37F*/ /* Bit 112 Sundanese */ # define TT_UCR_SUNDANESE (1L << 16) /* U+1B80-U+1BBF */ /* Bit 113 Lepcha */ # define TT_UCR_LEPCHA (1L << 17) /* U+1C00-U+1C4F */ /* Bit 114 Ol Chiki */ # define TT_UCR_OL_CHIKI (1L << 18) /* U+1C50-U+1C7F */ /* Bit 115 Saurashtra */ # define TT_UCR_SAURASHTRA (1L << 19) /* U+A880-U+A8DF */ /* Bit 116 Kayah Li */ # define TT_UCR_KAYAH_LI (1L << 20) /* U+A900-U+A92F */ /* Bit 117 Rejang */ # define TT_UCR_REJANG (1L << 21) /* U+A930-U+A95F */ /* Bit 118 Cham */ # define TT_UCR_CHAM (1L << 22) /* U+AA00-U+AA5F */ /* Bit 119 Ancient Symbols */ # define TT_UCR_ANCIENT_SYMBOLS (1L << 23) /*U+10190-U+101CF*/ /* Bit 120 Phaistos Disc */ # define TT_UCR_PHAISTOS_DISC (1L << 24) /*U+101D0-U+101FF*/ /* Bit 121 Carian */ /* Lycian */ /* Lydian */ # define TT_UCR_OLD_ANATOLIAN (1L << 25) /*U+102A0-U+102DF*/ /*U+10280-U+1029F*/ /*U+10920-U+1093F*/ /* Bit 122 Domino Tiles */ /* Mahjong Tiles */ # define TT_UCR_GAME_TILES (1L << 26) /*U+1F030-U+1F09F*/ /*U+1F000-U+1F02F*/ /* Bit 123-127 Reserved for process-internal usage */ Possible bit mask values for the ulUnicodeRangeX fields in an SFNT \u2018OS/2\u2019 table.","title":"TT_UCR_XXX"},{"location":"ft2-tt_driver.html","text":"FreeType \u00bb Docs \u00bb Controlling FreeType Modules \u00bb The TrueType driver The TrueType driver \u00b6 Synopsis \u00b6 While FreeType's TrueType driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The TrueType driver's module name is \u2018truetype\u2019; a single property interpreter-version is available, as documented in the \u2018 Driver properties \u2019 section. To help understand the differences between interpreter versions, we introduce a list of definitions, kindly provided by Greg Hitchcock. Bi-Level Rendering Monochromatic rendering, exclusively used in the early days of TrueType by both Apple and Microsoft. Microsoft's GDI interface supported hinting of the right-side bearing point, such that the advance width could be non-linear. Most often this was done to achieve some level of glyph symmetry. To enable reasonable performance (e.g., not having to run hinting on all glyphs just to get the widths) there was a bit in the head table indicating if the side bearing was hinted, and additional tables, \u2018hdmx\u2019 and \u2018LTSH\u2019, to cache hinting widths across multiple sizes and device aspect ratios. Font Smoothing Microsoft's GDI implementation of anti-aliasing. Not traditional anti-aliasing as the outlines were hinted before the sampling. The widths matched the bi-level rendering. ClearType Rendering Technique that uses physical subpixels to improve rendering on LCD (and other) displays. Because of the higher resolution, many methods of improving symmetry in glyphs through hinting the right-side bearing were no longer necessary. This lead to what GDI calls \u2018natural widths\u2019 ClearType, see http://rastertragedy.com/RTRCh4.htm#Sec21 . Since hinting has extra resolution, most non-linearity went away, but it is still possible for hints to change the advance widths in this mode. ClearType Compatible Widths One of the earliest challenges with ClearType was allowing the implementation in GDI to be selected without requiring all UI and documents to reflow. To address this, a compatible method of rendering ClearType was added where the font hints are executed once to determine the width in bi-level rendering, and then re-run in ClearType, with the difference in widths being absorbed in the font hints for ClearType (mostly in the white space of hints); see http://rastertragedy.com/RTRCh4.htm#Sec20 . Somewhat by definition, compatible width ClearType allows for non-linear widths, but only when the bi-level version has non-linear widths. ClearType Subpixel Positioning One of the nice benefits of ClearType is the ability to more crisply display fractional widths; unfortunately, the GDI model of integer bitmaps did not support this. However, the WPF and Direct Write frameworks do support fractional widths. DWrite calls this \u2018natural mode\u2019, not to be confused with GDI's \u2018natural widths\u2019. Subpixel positioning, in the current implementation of Direct Write, unfortunately does not support hinted advance widths, see http://rastertragedy.com/RTRCh4.htm#Sec22 . Note that the TrueType interpreter fully allows the advance width to be adjusted in this mode, just the DWrite client will ignore those changes. ClearType Backward Compatibility This is a set of exceptions made in the TrueType interpreter to minimize hinting techniques that were problematic with the extra resolution of ClearType; see http://rastertragedy.com/RTRCh4.htm#Sec1 and https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx . This technique is not to be confused with ClearType compatible widths. ClearType backward compatibility has no direct impact on changing advance widths, but there might be an indirect impact on disabling some deltas. This could be worked around in backward compatibility mode. Native ClearType Mode (Not to be confused with \u2018natural widths\u2019.) This mode removes all the exceptions in the TrueType interpreter when running with ClearType. Any issues on widths would still apply, though.","title":"The TrueType driver"},{"location":"ft2-tt_driver.html#the-truetype-driver","text":"","title":"The TrueType driver"},{"location":"ft2-tt_driver.html#synopsis","text":"While FreeType's TrueType driver doesn't expose API functions by itself, it is possible to control its behaviour with FT_Property_Set and FT_Property_Get . The TrueType driver's module name is \u2018truetype\u2019; a single property interpreter-version is available, as documented in the \u2018 Driver properties \u2019 section. To help understand the differences between interpreter versions, we introduce a list of definitions, kindly provided by Greg Hitchcock. Bi-Level Rendering Monochromatic rendering, exclusively used in the early days of TrueType by both Apple and Microsoft. Microsoft's GDI interface supported hinting of the right-side bearing point, such that the advance width could be non-linear. Most often this was done to achieve some level of glyph symmetry. To enable reasonable performance (e.g., not having to run hinting on all glyphs just to get the widths) there was a bit in the head table indicating if the side bearing was hinted, and additional tables, \u2018hdmx\u2019 and \u2018LTSH\u2019, to cache hinting widths across multiple sizes and device aspect ratios. Font Smoothing Microsoft's GDI implementation of anti-aliasing. Not traditional anti-aliasing as the outlines were hinted before the sampling. The widths matched the bi-level rendering. ClearType Rendering Technique that uses physical subpixels to improve rendering on LCD (and other) displays. Because of the higher resolution, many methods of improving symmetry in glyphs through hinting the right-side bearing were no longer necessary. This lead to what GDI calls \u2018natural widths\u2019 ClearType, see http://rastertragedy.com/RTRCh4.htm#Sec21 . Since hinting has extra resolution, most non-linearity went away, but it is still possible for hints to change the advance widths in this mode. ClearType Compatible Widths One of the earliest challenges with ClearType was allowing the implementation in GDI to be selected without requiring all UI and documents to reflow. To address this, a compatible method of rendering ClearType was added where the font hints are executed once to determine the width in bi-level rendering, and then re-run in ClearType, with the difference in widths being absorbed in the font hints for ClearType (mostly in the white space of hints); see http://rastertragedy.com/RTRCh4.htm#Sec20 . Somewhat by definition, compatible width ClearType allows for non-linear widths, but only when the bi-level version has non-linear widths. ClearType Subpixel Positioning One of the nice benefits of ClearType is the ability to more crisply display fractional widths; unfortunately, the GDI model of integer bitmaps did not support this. However, the WPF and Direct Write frameworks do support fractional widths. DWrite calls this \u2018natural mode\u2019, not to be confused with GDI's \u2018natural widths\u2019. Subpixel positioning, in the current implementation of Direct Write, unfortunately does not support hinted advance widths, see http://rastertragedy.com/RTRCh4.htm#Sec22 . Note that the TrueType interpreter fully allows the advance width to be adjusted in this mode, just the DWrite client will ignore those changes. ClearType Backward Compatibility This is a set of exceptions made in the TrueType interpreter to minimize hinting techniques that were problematic with the extra resolution of ClearType; see http://rastertragedy.com/RTRCh4.htm#Sec1 and https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx . This technique is not to be confused with ClearType compatible widths. ClearType backward compatibility has no direct impact on changing advance widths, but there might be an indirect impact on disabling some deltas. This could be worked around in backward compatibility mode. Native ClearType Mode (Not to be confused with \u2018natural widths\u2019.) This mode removes all the exceptions in the TrueType interpreter when running with ClearType. Any issues on widths would still apply, though.","title":"Synopsis"},{"location":"ft2-type1_tables.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Type 1 Tables Type 1 Tables \u00b6 Synopsis \u00b6 This section contains the definition of Type 1-specific tables, including structures related to other PostScript font formats. PS_FontInfoRec \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_FontInfoRec_ { FT_String * version; FT_String * notice; FT_String * full_name; FT_String * family_name; FT_String * weight; FT_Long italic_angle; FT_Bool is_fixed_pitch; FT_Short underline_position; FT_UShort underline_thickness; } PS_FontInfoRec ; A structure used to model a Type 1 or Type 2 FontInfo dictionary. Note that for Multiple Master fonts, each instance has its own FontInfo dictionary. PS_FontInfo \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_FontInfoRec_* PS_FontInfo ; A handle to a PS_FontInfoRec structure. PS_PrivateRec \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_PrivateRec_ { FT_Int unique_id; FT_Int lenIV; FT_Byte num_blue_values; FT_Byte num_other_blues; FT_Byte num_family_blues; FT_Byte num_family_other_blues; FT_Short blue_values[14]; FT_Short other_blues[10]; FT_Short family_blues [14]; FT_Short family_other_blues[10]; FT_Fixed blue_scale; FT_Int blue_shift; FT_Int blue_fuzz; FT_UShort standard_width[1]; FT_UShort standard_height[1]; FT_Byte num_snap_widths; FT_Byte num_snap_heights; FT_Bool force_bold; FT_Bool round_stem_up; FT_Short snap_widths [13]; /* including std width */ FT_Short snap_heights[13]; /* including std height */ FT_Fixed expansion_factor; FT_Long language_group; FT_Long password; FT_Short min_feature[2]; } PS_PrivateRec ; A structure used to model a Type 1 or Type 2 private dictionary. Note that for Multiple Master fonts, each instance has its own Private dictionary. PS_Private \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_PrivateRec_* PS_Private ; A handle to a PS_PrivateRec structure. CID_FaceDictRec \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceDictRec_ { PS_PrivateRec private_dict; FT_UInt len_buildchar; FT_Fixed forcebold_threshold; FT_Pos stroke_width; FT_Fixed expansion_factor; /* this is a duplicate of */ /* `private_dict->expansion_factor' */ FT_Byte paint_type; FT_Byte font_type; FT_Matrix font_matrix; FT_Vector font_offset; FT_UInt num_subrs; FT_ULong subrmap_offset; FT_UInt sd_bytes; } CID_FaceDictRec ; A structure used to represent data in a CID top-level dictionary. In most cases, they are part of the font's \u2018/FDArray\u2019 array. Within a CID font file, such (internal) subfont dictionaries are enclosed by \u2018%ADOBeginFontDict\u2019 and \u2018%ADOEndFontDict\u2019 comments. Note that CID_FaceDictRec misses a field for the \u2018/FontName\u2019 keyword, specifying the subfont's name (the top-level font name is given by the \u2018/CIDFontName\u2019 keyword). This is an oversight, but it doesn't limit the \u2018cid\u2019 font module's functionality because FreeType neither needs this entry nor gives access to CID subfonts. CID_FaceDict \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceDictRec_* CID_FaceDict ; A handle to a CID_FaceDictRec structure. CID_FaceInfoRec \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceInfoRec_ { FT_String * cid_font_name; FT_Fixed cid_version; FT_Int cid_font_type; FT_String * registry; FT_String * ordering; FT_Int supplement; PS_FontInfoRec font_info; FT_BBox font_bbox; FT_ULong uid_base; FT_Int num_xuid; FT_ULong xuid[16]; FT_ULong cidmap_offset; FT_UInt fd_bytes; FT_UInt gd_bytes; FT_ULong cid_count; FT_UInt num_dicts; CID_FaceDict font_dicts; FT_ULong data_offset; } CID_FaceInfoRec ; A structure used to represent CID Face information. CID_FaceInfo \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceInfoRec_* CID_FaceInfo ; A handle to a CID_FaceInfoRec structure. FT_Has_PS_Glyph_Names \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Int ) FT_Has_PS_Glyph_Names ( FT_Face face ); Return true if a given face provides reliable PostScript glyph names. This is similar to using the FT_HAS_GLYPH_NAMES macro, except that certain fonts (mostly TrueType) contain incorrect glyph name tables. When this function returns true, the caller is sure that the glyph names returned by FT_Get_Glyph_Name are reliable. input face face handle return Boolean. True if glyph names are reliable. FT_Get_PS_Font_Info \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Error ) FT_Get_PS_Font_Info ( FT_Face face, PS_FontInfo afont_info ); Retrieve the PS_FontInfoRec structure corresponding to a given PostScript font. input face PostScript face handle. output afont_info A pointer to a PS_FontInfoRec object. return FreeType error code. 0 means success. note String pointers within the PS_FontInfoRec structure are owned by the face and don't need to be freed by the caller. Missing entries in the font's FontInfo dictionary are represented by NULL pointers. The following font formats support this feature: \u2018Type 1\u2019, \u2018Type 42\u2019, \u2018CFF\u2019, \u2018CID Type 1\u2019. For other font formats this function returns the FT_Err_Invalid_Argument error code. example PS_FontInfoRec font_info; error = FT_Get_PS_Font_Info( face, &font_info ); ... FT_Get_PS_Font_Private \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Error ) FT_Get_PS_Font_Private ( FT_Face face, PS_Private afont_private ); Retrieve the PS_PrivateRec structure corresponding to a given PostScript font. input face PostScript face handle. output afont_private A pointer to a PS_PrivateRec object. return FreeType error code. 0 means success. note The string pointers within the PS_PrivateRec structure are owned by the face and don't need to be freed by the caller. Only the \u2018Type 1\u2019 font format supports this feature. For other font formats this function returns the FT_Err_Invalid_Argument error code. example PS_PrivateRec font_private; error = FT_Get_PS_Font_Private( face, &font_private ); ... FT_Get_PS_Font_Value \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Long ) FT_Get_PS_Font_Value ( FT_Face face, PS_Dict_Keys key, FT_UInt idx, void *value, FT_Long value_len ); Retrieve the value for the supplied key from a PostScript font. input face PostScript face handle. key An enumeration value representing the dictionary key to retrieve. idx For array values, this specifies the index to be returned. value A pointer to memory into which to write the value. valen_len The size, in bytes, of the memory supplied for the value. output value The value matching the above key, if it exists. return The amount of memory (in bytes) required to hold the requested value (if it exists, -1 otherwise). note The values returned are not pointers into the internal structures of the face, but are \u2018fresh\u2019 copies, so that the memory containing them belongs to the calling application. This also enforces the \u2018read-only\u2019 nature of these values, i.e., this function cannot be used to manipulate the face. value is a void pointer because the values returned can be of various types. If either value is NULL or value_len is too small, just the required memory size for the requested entry is returned. The idx parameter is used, not only to retrieve elements of, for example, the FontMatrix or FontBBox, but also to retrieve name keys from the CharStrings dictionary, and the charstrings themselves. It is ignored for atomic values. PS_DICT_BLUE_SCALE returns a value that is scaled up by 1000. To get the value as in the font stream, you need to divide by 65536000.0 (to remove the FT_Fixed scale, and the x1000 scale). IMPORTANT: Only key/value pairs read by the FreeType interpreter can be retrieved. So, for example, PostScript procedures such as NP, ND, and RD are not available. Arbitrary keys are, obviously, not be available either. If the font's format is not PostScript-based, this function returns the FT_Err_Invalid_Argument error code. since 2.4.8 T1_Blend_Flags \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum T1_Blend_Flags_ { /* required fields in a FontInfo blend dictionary */ T1_BLEND_UNDERLINE_POSITION = 0, T1_BLEND_UNDERLINE_THICKNESS , T1_BLEND_ITALIC_ANGLE , /* required fields in a Private blend dictionary */ T1_BLEND_BLUE_VALUES , T1_BLEND_OTHER_BLUES , T1_BLEND_STANDARD_WIDTH , T1_BLEND_STANDARD_HEIGHT , T1_BLEND_STEM_SNAP_WIDTHS , T1_BLEND_STEM_SNAP_HEIGHTS , T1_BLEND_BLUE_SCALE , T1_BLEND_BLUE_SHIFT , T1_BLEND_FAMILY_BLUES , T1_BLEND_FAMILY_OTHER_BLUES , T1_BLEND_FORCE_BOLD , T1_BLEND_MAX /* do not remove */ } T1_Blend_Flags ; /* these constants are deprecated; use the corresponding */ /* ` T1_Blend_Flags ` values instead */ # define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION # define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS # define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE # define t1_blend_blue_values T1_BLEND_BLUE_VALUES # define t1_blend_other_blues T1_BLEND_OTHER_BLUES # define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH # define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT # define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS # define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS # define t1_blend_blue_scale T1_BLEND_BLUE_SCALE # define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT # define t1_blend_family_blues T1_BLEND_FAMILY_BLUES # define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES # define t1_blend_force_bold T1_BLEND_FORCE_BOLD # define t1_blend_max T1_BLEND_MAX A set of flags used to indicate which fields are present in a given blend dictionary (font info or private). Used to support Multiple Masters fonts. values T1_BLEND_UNDERLINE_POSITION T1_BLEND_UNDERLINE_THICKNESS T1_BLEND_ITALIC_ANGLE T1_BLEND_BLUE_VALUES T1_BLEND_OTHER_BLUES T1_BLEND_STANDARD_WIDTH T1_BLEND_STANDARD_HEIGHT T1_BLEND_STEM_SNAP_WIDTHS T1_BLEND_STEM_SNAP_HEIGHTS T1_BLEND_BLUE_SCALE T1_BLEND_BLUE_SHIFT T1_BLEND_FAMILY_BLUES T1_BLEND_FAMILY_OTHER_BLUES T1_BLEND_FORCE_BOLD T1_EncodingType \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum T1_EncodingType_ { T1_ENCODING_TYPE_NONE = 0, T1_ENCODING_TYPE_ARRAY , T1_ENCODING_TYPE_STANDARD , T1_ENCODING_TYPE_ISOLATIN1 , T1_ENCODING_TYPE_EXPERT } T1_EncodingType ; An enumeration describing the \u2018Encoding\u2019 entry in a Type 1 dictionary. values T1_ENCODING_TYPE_NONE T1_ENCODING_TYPE_ARRAY T1_ENCODING_TYPE_STANDARD T1_ENCODING_TYPE_ISOLATIN1 T1_ENCODING_TYPE_EXPERT since 2.4.8 PS_Dict_Keys \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum PS_Dict_Keys_ { /* conventionally in the font dictionary */ PS_DICT_FONT_TYPE , /* FT_Byte */ PS_DICT_FONT_MATRIX , /* FT_Fixed */ PS_DICT_FONT_BBOX , /* FT_Fixed */ PS_DICT_PAINT_TYPE , /* FT_Byte */ PS_DICT_FONT_NAME , /* FT_String * */ PS_DICT_UNIQUE_ID , /* FT_Int */ PS_DICT_NUM_CHAR_STRINGS , /* FT_Int */ PS_DICT_CHAR_STRING_KEY , /* FT_String * */ PS_DICT_CHAR_STRING , /* FT_String * */ PS_DICT_ENCODING_TYPE , /* T1_EncodingType */ PS_DICT_ENCODING_ENTRY , /* FT_String * */ /* conventionally in the font Private dictionary */ PS_DICT_NUM_SUBRS , /* FT_Int */ PS_DICT_SUBR , /* FT_String * */ PS_DICT_STD_HW , /* FT_UShort */ PS_DICT_STD_VW , /* FT_UShort */ PS_DICT_NUM_BLUE_VALUES , /* FT_Byte */ PS_DICT_BLUE_VALUE , /* FT_Short */ PS_DICT_BLUE_FUZZ , /* FT_Int */ PS_DICT_NUM_OTHER_BLUES , /* FT_Byte */ PS_DICT_OTHER_BLUE , /* FT_Short */ PS_DICT_NUM_FAMILY_BLUES , /* FT_Byte */ PS_DICT_FAMILY_BLUE , /* FT_Short */ PS_DICT_NUM_FAMILY_OTHER_BLUES , /* FT_Byte */ PS_DICT_FAMILY_OTHER_BLUE , /* FT_Short */ PS_DICT_BLUE_SCALE , /* FT_Fixed */ PS_DICT_BLUE_SHIFT , /* FT_Int */ PS_DICT_NUM_STEM_SNAP_H , /* FT_Byte */ PS_DICT_STEM_SNAP_H , /* FT_Short */ PS_DICT_NUM_STEM_SNAP_V , /* FT_Byte */ PS_DICT_STEM_SNAP_V , /* FT_Short */ PS_DICT_FORCE_BOLD , /* FT_Bool */ PS_DICT_RND_STEM_UP , /* FT_Bool */ PS_DICT_MIN_FEATURE , /* FT_Short */ PS_DICT_LEN_IV , /* FT_Int */ PS_DICT_PASSWORD , /* FT_Long */ PS_DICT_LANGUAGE_GROUP , /* FT_Long */ /* conventionally in the font FontInfo dictionary */ PS_DICT_VERSION , /* FT_String * */ PS_DICT_NOTICE , /* FT_String * */ PS_DICT_FULL_NAME , /* FT_String * */ PS_DICT_FAMILY_NAME , /* FT_String * */ PS_DICT_WEIGHT , /* FT_String * */ PS_DICT_IS_FIXED_PITCH , /* FT_Bool */ PS_DICT_UNDERLINE_POSITION , /* FT_Short */ PS_DICT_UNDERLINE_THICKNESS , /* FT_UShort */ PS_DICT_FS_TYPE , /* FT_UShort */ PS_DICT_ITALIC_ANGLE , /* FT_Long */ PS_DICT_MAX = PS_DICT_ITALIC_ANGLE } PS_Dict_Keys ; An enumeration used in calls to FT_Get_PS_Font_Value to identify the Type 1 dictionary entry to retrieve. values PS_DICT_FONT_TYPE PS_DICT_FONT_MATRIX PS_DICT_FONT_BBOX PS_DICT_PAINT_TYPE PS_DICT_FONT_NAME PS_DICT_UNIQUE_ID PS_DICT_NUM_CHAR_STRINGS PS_DICT_CHAR_STRING_KEY PS_DICT_CHAR_STRING PS_DICT_ENCODING_TYPE PS_DICT_ENCODING_ENTRY PS_DICT_NUM_SUBRS PS_DICT_SUBR PS_DICT_STD_HW PS_DICT_STD_VW PS_DICT_NUM_BLUE_VALUES PS_DICT_BLUE_VALUE PS_DICT_BLUE_FUZZ PS_DICT_NUM_OTHER_BLUES PS_DICT_OTHER_BLUE PS_DICT_NUM_FAMILY_BLUES PS_DICT_FAMILY_BLUE PS_DICT_NUM_FAMILY_OTHER_BLUES PS_DICT_FAMILY_OTHER_BLUE PS_DICT_BLUE_SCALE PS_DICT_BLUE_SHIFT PS_DICT_NUM_STEM_SNAP_H PS_DICT_STEM_SNAP_H PS_DICT_NUM_STEM_SNAP_V PS_DICT_STEM_SNAP_V PS_DICT_FORCE_BOLD PS_DICT_RND_STEM_UP PS_DICT_MIN_FEATURE PS_DICT_LEN_IV PS_DICT_PASSWORD PS_DICT_LANGUAGE_GROUP PS_DICT_VERSION PS_DICT_NOTICE PS_DICT_FULL_NAME PS_DICT_FAMILY_NAME PS_DICT_WEIGHT PS_DICT_IS_FIXED_PITCH PS_DICT_UNDERLINE_POSITION PS_DICT_UNDERLINE_THICKNESS PS_DICT_FS_TYPE PS_DICT_ITALIC_ANGLE since 2.4.8 T1_FontInfo \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef PS_FontInfoRec T1_FontInfo ; This type is equivalent to PS_FontInfoRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType. T1_Private \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef PS_PrivateRec T1_Private ; This type is equivalent to PS_PrivateRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType. CID_FontDict \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef CID_FaceDictRec CID_FontDict ; This type is equivalent to CID_FaceDictRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType. CID_Info \u00b6 Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef CID_FaceInfoRec CID_Info ; This type is equivalent to CID_FaceInfoRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"Type 1 Tables"},{"location":"ft2-type1_tables.html#type-1-tables","text":"","title":"Type 1 Tables"},{"location":"ft2-type1_tables.html#synopsis","text":"This section contains the definition of Type 1-specific tables, including structures related to other PostScript font formats.","title":"Synopsis"},{"location":"ft2-type1_tables.html#ps_fontinforec","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_FontInfoRec_ { FT_String * version; FT_String * notice; FT_String * full_name; FT_String * family_name; FT_String * weight; FT_Long italic_angle; FT_Bool is_fixed_pitch; FT_Short underline_position; FT_UShort underline_thickness; } PS_FontInfoRec ; A structure used to model a Type 1 or Type 2 FontInfo dictionary. Note that for Multiple Master fonts, each instance has its own FontInfo dictionary.","title":"PS_FontInfoRec"},{"location":"ft2-type1_tables.html#ps_fontinfo","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_FontInfoRec_* PS_FontInfo ; A handle to a PS_FontInfoRec structure.","title":"PS_FontInfo"},{"location":"ft2-type1_tables.html#ps_privaterec","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_PrivateRec_ { FT_Int unique_id; FT_Int lenIV; FT_Byte num_blue_values; FT_Byte num_other_blues; FT_Byte num_family_blues; FT_Byte num_family_other_blues; FT_Short blue_values[14]; FT_Short other_blues[10]; FT_Short family_blues [14]; FT_Short family_other_blues[10]; FT_Fixed blue_scale; FT_Int blue_shift; FT_Int blue_fuzz; FT_UShort standard_width[1]; FT_UShort standard_height[1]; FT_Byte num_snap_widths; FT_Byte num_snap_heights; FT_Bool force_bold; FT_Bool round_stem_up; FT_Short snap_widths [13]; /* including std width */ FT_Short snap_heights[13]; /* including std height */ FT_Fixed expansion_factor; FT_Long language_group; FT_Long password; FT_Short min_feature[2]; } PS_PrivateRec ; A structure used to model a Type 1 or Type 2 private dictionary. Note that for Multiple Master fonts, each instance has its own Private dictionary.","title":"PS_PrivateRec"},{"location":"ft2-type1_tables.html#ps_private","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct PS_PrivateRec_* PS_Private ; A handle to a PS_PrivateRec structure.","title":"PS_Private"},{"location":"ft2-type1_tables.html#cid_facedictrec","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceDictRec_ { PS_PrivateRec private_dict; FT_UInt len_buildchar; FT_Fixed forcebold_threshold; FT_Pos stroke_width; FT_Fixed expansion_factor; /* this is a duplicate of */ /* `private_dict->expansion_factor' */ FT_Byte paint_type; FT_Byte font_type; FT_Matrix font_matrix; FT_Vector font_offset; FT_UInt num_subrs; FT_ULong subrmap_offset; FT_UInt sd_bytes; } CID_FaceDictRec ; A structure used to represent data in a CID top-level dictionary. In most cases, they are part of the font's \u2018/FDArray\u2019 array. Within a CID font file, such (internal) subfont dictionaries are enclosed by \u2018%ADOBeginFontDict\u2019 and \u2018%ADOEndFontDict\u2019 comments. Note that CID_FaceDictRec misses a field for the \u2018/FontName\u2019 keyword, specifying the subfont's name (the top-level font name is given by the \u2018/CIDFontName\u2019 keyword). This is an oversight, but it doesn't limit the \u2018cid\u2019 font module's functionality because FreeType neither needs this entry nor gives access to CID subfonts.","title":"CID_FaceDictRec"},{"location":"ft2-type1_tables.html#cid_facedict","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceDictRec_* CID_FaceDict ; A handle to a CID_FaceDictRec structure.","title":"CID_FaceDict"},{"location":"ft2-type1_tables.html#cid_faceinforec","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceInfoRec_ { FT_String * cid_font_name; FT_Fixed cid_version; FT_Int cid_font_type; FT_String * registry; FT_String * ordering; FT_Int supplement; PS_FontInfoRec font_info; FT_BBox font_bbox; FT_ULong uid_base; FT_Int num_xuid; FT_ULong xuid[16]; FT_ULong cidmap_offset; FT_UInt fd_bytes; FT_UInt gd_bytes; FT_ULong cid_count; FT_UInt num_dicts; CID_FaceDict font_dicts; FT_ULong data_offset; } CID_FaceInfoRec ; A structure used to represent CID Face information.","title":"CID_FaceInfoRec"},{"location":"ft2-type1_tables.html#cid_faceinfo","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef struct CID_FaceInfoRec_* CID_FaceInfo ; A handle to a CID_FaceInfoRec structure.","title":"CID_FaceInfo"},{"location":"ft2-type1_tables.html#ft_has_ps_glyph_names","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Int ) FT_Has_PS_Glyph_Names ( FT_Face face ); Return true if a given face provides reliable PostScript glyph names. This is similar to using the FT_HAS_GLYPH_NAMES macro, except that certain fonts (mostly TrueType) contain incorrect glyph name tables. When this function returns true, the caller is sure that the glyph names returned by FT_Get_Glyph_Name are reliable.","title":"FT_Has_PS_Glyph_Names"},{"location":"ft2-type1_tables.html#ft_get_ps_font_info","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Error ) FT_Get_PS_Font_Info ( FT_Face face, PS_FontInfo afont_info ); Retrieve the PS_FontInfoRec structure corresponding to a given PostScript font.","title":"FT_Get_PS_Font_Info"},{"location":"ft2-type1_tables.html#ft_get_ps_font_private","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Error ) FT_Get_PS_Font_Private ( FT_Face face, PS_Private afont_private ); Retrieve the PS_PrivateRec structure corresponding to a given PostScript font.","title":"FT_Get_PS_Font_Private"},{"location":"ft2-type1_tables.html#ft_get_ps_font_value","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). FT_EXPORT( FT_Long ) FT_Get_PS_Font_Value ( FT_Face face, PS_Dict_Keys key, FT_UInt idx, void *value, FT_Long value_len ); Retrieve the value for the supplied key from a PostScript font.","title":"FT_Get_PS_Font_Value"},{"location":"ft2-type1_tables.html#t1_blend_flags","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum T1_Blend_Flags_ { /* required fields in a FontInfo blend dictionary */ T1_BLEND_UNDERLINE_POSITION = 0, T1_BLEND_UNDERLINE_THICKNESS , T1_BLEND_ITALIC_ANGLE , /* required fields in a Private blend dictionary */ T1_BLEND_BLUE_VALUES , T1_BLEND_OTHER_BLUES , T1_BLEND_STANDARD_WIDTH , T1_BLEND_STANDARD_HEIGHT , T1_BLEND_STEM_SNAP_WIDTHS , T1_BLEND_STEM_SNAP_HEIGHTS , T1_BLEND_BLUE_SCALE , T1_BLEND_BLUE_SHIFT , T1_BLEND_FAMILY_BLUES , T1_BLEND_FAMILY_OTHER_BLUES , T1_BLEND_FORCE_BOLD , T1_BLEND_MAX /* do not remove */ } T1_Blend_Flags ; /* these constants are deprecated; use the corresponding */ /* ` T1_Blend_Flags ` values instead */ # define t1_blend_underline_position T1_BLEND_UNDERLINE_POSITION # define t1_blend_underline_thickness T1_BLEND_UNDERLINE_THICKNESS # define t1_blend_italic_angle T1_BLEND_ITALIC_ANGLE # define t1_blend_blue_values T1_BLEND_BLUE_VALUES # define t1_blend_other_blues T1_BLEND_OTHER_BLUES # define t1_blend_standard_widths T1_BLEND_STANDARD_WIDTH # define t1_blend_standard_height T1_BLEND_STANDARD_HEIGHT # define t1_blend_stem_snap_widths T1_BLEND_STEM_SNAP_WIDTHS # define t1_blend_stem_snap_heights T1_BLEND_STEM_SNAP_HEIGHTS # define t1_blend_blue_scale T1_BLEND_BLUE_SCALE # define t1_blend_blue_shift T1_BLEND_BLUE_SHIFT # define t1_blend_family_blues T1_BLEND_FAMILY_BLUES # define t1_blend_family_other_blues T1_BLEND_FAMILY_OTHER_BLUES # define t1_blend_force_bold T1_BLEND_FORCE_BOLD # define t1_blend_max T1_BLEND_MAX A set of flags used to indicate which fields are present in a given blend dictionary (font info or private). Used to support Multiple Masters fonts.","title":"T1_Blend_Flags"},{"location":"ft2-type1_tables.html#t1_encodingtype","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum T1_EncodingType_ { T1_ENCODING_TYPE_NONE = 0, T1_ENCODING_TYPE_ARRAY , T1_ENCODING_TYPE_STANDARD , T1_ENCODING_TYPE_ISOLATIN1 , T1_ENCODING_TYPE_EXPERT } T1_EncodingType ; An enumeration describing the \u2018Encoding\u2019 entry in a Type 1 dictionary.","title":"T1_EncodingType"},{"location":"ft2-type1_tables.html#ps_dict_keys","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef enum PS_Dict_Keys_ { /* conventionally in the font dictionary */ PS_DICT_FONT_TYPE , /* FT_Byte */ PS_DICT_FONT_MATRIX , /* FT_Fixed */ PS_DICT_FONT_BBOX , /* FT_Fixed */ PS_DICT_PAINT_TYPE , /* FT_Byte */ PS_DICT_FONT_NAME , /* FT_String * */ PS_DICT_UNIQUE_ID , /* FT_Int */ PS_DICT_NUM_CHAR_STRINGS , /* FT_Int */ PS_DICT_CHAR_STRING_KEY , /* FT_String * */ PS_DICT_CHAR_STRING , /* FT_String * */ PS_DICT_ENCODING_TYPE , /* T1_EncodingType */ PS_DICT_ENCODING_ENTRY , /* FT_String * */ /* conventionally in the font Private dictionary */ PS_DICT_NUM_SUBRS , /* FT_Int */ PS_DICT_SUBR , /* FT_String * */ PS_DICT_STD_HW , /* FT_UShort */ PS_DICT_STD_VW , /* FT_UShort */ PS_DICT_NUM_BLUE_VALUES , /* FT_Byte */ PS_DICT_BLUE_VALUE , /* FT_Short */ PS_DICT_BLUE_FUZZ , /* FT_Int */ PS_DICT_NUM_OTHER_BLUES , /* FT_Byte */ PS_DICT_OTHER_BLUE , /* FT_Short */ PS_DICT_NUM_FAMILY_BLUES , /* FT_Byte */ PS_DICT_FAMILY_BLUE , /* FT_Short */ PS_DICT_NUM_FAMILY_OTHER_BLUES , /* FT_Byte */ PS_DICT_FAMILY_OTHER_BLUE , /* FT_Short */ PS_DICT_BLUE_SCALE , /* FT_Fixed */ PS_DICT_BLUE_SHIFT , /* FT_Int */ PS_DICT_NUM_STEM_SNAP_H , /* FT_Byte */ PS_DICT_STEM_SNAP_H , /* FT_Short */ PS_DICT_NUM_STEM_SNAP_V , /* FT_Byte */ PS_DICT_STEM_SNAP_V , /* FT_Short */ PS_DICT_FORCE_BOLD , /* FT_Bool */ PS_DICT_RND_STEM_UP , /* FT_Bool */ PS_DICT_MIN_FEATURE , /* FT_Short */ PS_DICT_LEN_IV , /* FT_Int */ PS_DICT_PASSWORD , /* FT_Long */ PS_DICT_LANGUAGE_GROUP , /* FT_Long */ /* conventionally in the font FontInfo dictionary */ PS_DICT_VERSION , /* FT_String * */ PS_DICT_NOTICE , /* FT_String * */ PS_DICT_FULL_NAME , /* FT_String * */ PS_DICT_FAMILY_NAME , /* FT_String * */ PS_DICT_WEIGHT , /* FT_String * */ PS_DICT_IS_FIXED_PITCH , /* FT_Bool */ PS_DICT_UNDERLINE_POSITION , /* FT_Short */ PS_DICT_UNDERLINE_THICKNESS , /* FT_UShort */ PS_DICT_FS_TYPE , /* FT_UShort */ PS_DICT_ITALIC_ANGLE , /* FT_Long */ PS_DICT_MAX = PS_DICT_ITALIC_ANGLE } PS_Dict_Keys ; An enumeration used in calls to FT_Get_PS_Font_Value to identify the Type 1 dictionary entry to retrieve.","title":"PS_Dict_Keys"},{"location":"ft2-type1_tables.html#t1_fontinfo","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef PS_FontInfoRec T1_FontInfo ; This type is equivalent to PS_FontInfoRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"T1_FontInfo"},{"location":"ft2-type1_tables.html#t1_private","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef PS_PrivateRec T1_Private ; This type is equivalent to PS_PrivateRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"T1_Private"},{"location":"ft2-type1_tables.html#cid_fontdict","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef CID_FaceDictRec CID_FontDict ; This type is equivalent to CID_FaceDictRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"CID_FontDict"},{"location":"ft2-type1_tables.html#cid_info","text":"Defined in FT_TYPE1_TABLES_H (freetype/t1tables.h). typedef CID_FaceInfoRec CID_Info ; This type is equivalent to CID_FaceInfoRec . It is deprecated but kept to maintain source compatibility between various versions of FreeType.","title":"CID_Info"},{"location":"ft2-user_allocation.html","text":"FreeType \u00bb Docs \u00bb General Remarks \u00bb User allocation User allocation \u00b6 Synopsis \u00b6 FreeType assumes that structures allocated by the user and passed as arguments are zeroed out except for the actual data. In other words, it is recommended to use calloc (or variants of it) instead of malloc for allocation.","title":"User allocation"},{"location":"ft2-user_allocation.html#user-allocation","text":"","title":"User allocation"},{"location":"ft2-user_allocation.html#synopsis","text":"FreeType assumes that structures allocated by the user and passed as arguments are zeroed out except for the actual data. In other words, it is recommended to use calloc (or variants of it) instead of malloc for allocation.","title":"Synopsis"},{"location":"ft2-version.html","text":"FreeType \u00bb Docs \u00bb Core API \u00bb FreeType Version FreeType Version \u00b6 Synopsis \u00b6 Note that those functions and macros are of limited use because even a new release of FreeType with only documentation changes increases the version number. FT_Library_Version \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Library_Version ( FT_Library library, FT_Int *amajor, FT_Int *aminor, FT_Int *apatch ); Return the version of the FreeType library being used. This is useful when dynamically linking to the library, since one cannot use the macros FREETYPE_MAJOR , FREETYPE_MINOR , and 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_Face_CheckTrueTypePatents \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Bool ) FT_Face_CheckTrueTypePatents ( FT_Face face ); Deprecated, does nothing. input face A face handle. return Always returns false. note Since May 2010, TrueType hinting is no longer patented. since 2.3.5 FT_Face_SetUnpatentedHinting \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Bool ) FT_Face_SetUnpatentedHinting ( FT_Face face, FT_Bool value ); Deprecated, does nothing. input face A face handle. value New boolean setting. return Always returns false. note Since May 2010, TrueType hinting is no longer patented. since 2.3.5 FREETYPE_XXX \u00b6 Defined in FT_FREETYPE_H (freetype/freetype.h). # define FREETYPE_MAJOR 2 # define FREETYPE_MINOR 12 # define FREETYPE_PATCH 1 These three macros identify the FreeType source code version. Use FT_Library_Version to access them at runtime. values FREETYPE_MAJOR The major version number. FREETYPE_MINOR The minor version number. FREETYPE_PATCH The patch level. note The version number of FreeType if built as a dynamic link library with the \u2018libtool\u2019 package is not controlled by these three macros.","title":"FreeType Version"},{"location":"ft2-version.html#freetype-version","text":"","title":"FreeType Version"},{"location":"ft2-version.html#synopsis","text":"Note that those functions and macros are of limited use because even a new release of FreeType with only documentation changes increases the version number.","title":"Synopsis"},{"location":"ft2-version.html#ft_library_version","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( void ) FT_Library_Version ( FT_Library library, FT_Int *amajor, FT_Int *aminor, FT_Int *apatch ); Return the version of the FreeType library being used. This is useful when dynamically linking to the library, since one cannot use the macros FREETYPE_MAJOR , FREETYPE_MINOR , and FREETYPE_PATCH .","title":"FT_Library_Version"},{"location":"ft2-version.html#ft_face_checktruetypepatents","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Bool ) FT_Face_CheckTrueTypePatents ( FT_Face face ); Deprecated, does nothing.","title":"FT_Face_CheckTrueTypePatents"},{"location":"ft2-version.html#ft_face_setunpatentedhinting","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). FT_EXPORT( FT_Bool ) FT_Face_SetUnpatentedHinting ( FT_Face face, FT_Bool value ); Deprecated, does nothing.","title":"FT_Face_SetUnpatentedHinting"},{"location":"ft2-version.html#freetype_xxx","text":"Defined in FT_FREETYPE_H (freetype/freetype.h). # define FREETYPE_MAJOR 2 # define FREETYPE_MINOR 12 # define FREETYPE_PATCH 1 These three macros identify the FreeType source code version. Use FT_Library_Version to access them at runtime.","title":"FREETYPE_XXX"},{"location":"ft2-winfnt_fonts.html","text":"FreeType \u00bb Docs \u00bb Format-Specific API \u00bb Window FNT Files Window FNT Files \u00b6 Synopsis \u00b6 This section contains the declaration of Windows FNT-specific functions. FT_WinFNT_ID_XXX \u00b6 Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). # define FT_WinFNT_ID_CP1252 0 # define FT_WinFNT_ID_DEFAULT 1 # define FT_WinFNT_ID_SYMBOL 2 # define FT_WinFNT_ID_MAC 77 # define FT_WinFNT_ID_CP932 128 # define FT_WinFNT_ID_CP949 129 # define FT_WinFNT_ID_CP1361 130 # define FT_WinFNT_ID_CP936 134 # define FT_WinFNT_ID_CP950 136 # define FT_WinFNT_ID_CP1253 161 # define FT_WinFNT_ID_CP1254 162 # define FT_WinFNT_ID_CP1258 163 # define FT_WinFNT_ID_CP1255 177 # define FT_WinFNT_ID_CP1256 178 # define FT_WinFNT_ID_CP1257 186 # define FT_WinFNT_ID_CP1251 204 # define FT_WinFNT_ID_CP874 222 # define FT_WinFNT_ID_CP1250 238 # define FT_WinFNT_ID_OEM 255 A list of valid values for the charset byte in FT_WinFNT_HeaderRec . Exact mapping tables for the various \u2018cpXXXX\u2019 encodings (except for \u2018cp1361\u2019) can be found at \u2018 ftp://ftp.unicode.org/Public/ \u2019 in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. \u2018cp1361\u2019 is roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT . values FT_WinFNT_ID_DEFAULT This is used for font enumeration and font creation as a \u2018don't care\u2019 value. Valid font files don't contain this value. When querying for information about the character set of the font that is currently selected into a specified device context, this return value (of the related Windows API) simply denotes failure. FT_WinFNT_ID_SYMBOL There is no known mapping table available. FT_WinFNT_ID_MAC Mac Roman encoding. FT_WinFNT_ID_OEM From Michael Poettgen <michael@poettgen.de>: The \u2018Windows Font Mapping\u2019 article says that FT_WinFNT_ID_OEM is used for the charset of vector fonts, like modern.fon , roman.fon , and script.fon on Windows. The \u2018CreateFont\u2019 documentation says: The FT_WinFNT_ID_OEM value specifies a character set that is operating-system dependent. The \u2018IFIMETRICS\u2019 documentation from the \u2018Windows Driver Development Kit\u2019 says: This font supports an OEM-specific character set. The OEM character set is system dependent. In general OEM, as opposed to ANSI (i.e., \u2018cp1252\u2019), denotes the second default codepage that most international versions of Windows have. It is one of the OEM codepages from https://docs.microsoft.com/en-us/windows/desktop/intl/code-page-identifiers , and is used for the \u2018DOS boxes\u2019, to support legacy applications. A German Windows version for example usually uses ANSI codepage 1252 and OEM codepage 850. FT_WinFNT_ID_CP874 A superset of Thai TIS 620 and ISO 8859-11. FT_WinFNT_ID_CP932 A superset of Japanese Shift-JIS (with minor deviations). FT_WinFNT_ID_CP936 A superset of simplified Chinese GB 2312-1980 (with different ordering and minor deviations). FT_WinFNT_ID_CP949 A superset of Korean Hangul KS C 5601-1987 (with different ordering and minor deviations). FT_WinFNT_ID_CP950 A superset of traditional Chinese Big 5 ETen (with different ordering and minor deviations). FT_WinFNT_ID_CP1250 A superset of East European ISO 8859-2 (with slightly different ordering). FT_WinFNT_ID_CP1251 A superset of Russian ISO 8859-5 (with different ordering). FT_WinFNT_ID_CP1252 ANSI encoding. A superset of ISO 8859-1. FT_WinFNT_ID_CP1253 A superset of Greek ISO 8859-7 (with minor modifications). FT_WinFNT_ID_CP1254 A superset of Turkish ISO 8859-9. FT_WinFNT_ID_CP1255 A superset of Hebrew ISO 8859-8 (with some modifications). FT_WinFNT_ID_CP1256 A superset of Arabic ISO 8859-6 (with different ordering). FT_WinFNT_ID_CP1257 A superset of Baltic ISO 8859-13 (with some deviations). FT_WinFNT_ID_CP1258 For Vietnamese. This encoding doesn't cover all necessary characters. FT_WinFNT_ID_CP1361 Korean (Johab). FT_WinFNT_HeaderRec \u00b6 Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). typedef struct FT_WinFNT_HeaderRec_ { FT_UShort version; FT_ULong file_size; FT_Byte copyright[60]; FT_UShort file_type; FT_UShort nominal_point_size; FT_UShort vertical_resolution; FT_UShort horizontal_resolution; FT_UShort ascent; FT_UShort internal_leading; FT_UShort external_leading; FT_Byte italic; FT_Byte underline; FT_Byte strike_out; FT_UShort weight; FT_Byte charset; FT_UShort pixel_width; FT_UShort pixel_height; FT_Byte pitch_and_family; FT_UShort avg_width; FT_UShort max_width; FT_Byte first_char; FT_Byte last_char; FT_Byte default_char; FT_Byte break_char; FT_UShort bytes_per_row; FT_ULong device_offset; FT_ULong face_name_offset; FT_ULong bits_pointer; FT_ULong bits_offset; FT_Byte reserved; FT_ULong flags; FT_UShort A_space; FT_UShort B_space; FT_UShort C_space; FT_UShort color_table_offset; FT_ULong reserved1[4]; } FT_WinFNT_HeaderRec ; Windows FNT Header info. FT_WinFNT_Header \u00b6 Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header ; A handle to an FT_WinFNT_HeaderRec structure. FT_Get_WinFNT_Header \u00b6 Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). FT_EXPORT( FT_Error ) FT_Get_WinFNT_Header ( FT_Face face, FT_WinFNT_HeaderRec *aheader ); Retrieve a Windows FNT font info header. input face A handle to the input face. output aheader The WinFNT header. return FreeType error code. 0 means success. note This function only works with Windows FNT faces, returning an error otherwise.","title":"Window FNT Files"},{"location":"ft2-winfnt_fonts.html#window-fnt-files","text":"","title":"Window FNT Files"},{"location":"ft2-winfnt_fonts.html#synopsis","text":"This section contains the declaration of Windows FNT-specific functions.","title":"Synopsis"},{"location":"ft2-winfnt_fonts.html#ft_winfnt_id_xxx","text":"Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). # define FT_WinFNT_ID_CP1252 0 # define FT_WinFNT_ID_DEFAULT 1 # define FT_WinFNT_ID_SYMBOL 2 # define FT_WinFNT_ID_MAC 77 # define FT_WinFNT_ID_CP932 128 # define FT_WinFNT_ID_CP949 129 # define FT_WinFNT_ID_CP1361 130 # define FT_WinFNT_ID_CP936 134 # define FT_WinFNT_ID_CP950 136 # define FT_WinFNT_ID_CP1253 161 # define FT_WinFNT_ID_CP1254 162 # define FT_WinFNT_ID_CP1258 163 # define FT_WinFNT_ID_CP1255 177 # define FT_WinFNT_ID_CP1256 178 # define FT_WinFNT_ID_CP1257 186 # define FT_WinFNT_ID_CP1251 204 # define FT_WinFNT_ID_CP874 222 # define FT_WinFNT_ID_CP1250 238 # define FT_WinFNT_ID_OEM 255 A list of valid values for the charset byte in FT_WinFNT_HeaderRec . Exact mapping tables for the various \u2018cpXXXX\u2019 encodings (except for \u2018cp1361\u2019) can be found at \u2018 ftp://ftp.unicode.org/Public/ \u2019 in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory. \u2018cp1361\u2019 is roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT .","title":"FT_WinFNT_ID_XXX"},{"location":"ft2-winfnt_fonts.html#ft_winfnt_headerrec","text":"Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). typedef struct FT_WinFNT_HeaderRec_ { FT_UShort version; FT_ULong file_size; FT_Byte copyright[60]; FT_UShort file_type; FT_UShort nominal_point_size; FT_UShort vertical_resolution; FT_UShort horizontal_resolution; FT_UShort ascent; FT_UShort internal_leading; FT_UShort external_leading; FT_Byte italic; FT_Byte underline; FT_Byte strike_out; FT_UShort weight; FT_Byte charset; FT_UShort pixel_width; FT_UShort pixel_height; FT_Byte pitch_and_family; FT_UShort avg_width; FT_UShort max_width; FT_Byte first_char; FT_Byte last_char; FT_Byte default_char; FT_Byte break_char; FT_UShort bytes_per_row; FT_ULong device_offset; FT_ULong face_name_offset; FT_ULong bits_pointer; FT_ULong bits_offset; FT_Byte reserved; FT_ULong flags; FT_UShort A_space; FT_UShort B_space; FT_UShort C_space; FT_UShort color_table_offset; FT_ULong reserved1[4]; } FT_WinFNT_HeaderRec ; Windows FNT Header info.","title":"FT_WinFNT_HeaderRec"},{"location":"ft2-winfnt_fonts.html#ft_winfnt_header","text":"Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). typedef struct FT_WinFNT_HeaderRec_* FT_WinFNT_Header ; A handle to an FT_WinFNT_HeaderRec structure.","title":"FT_WinFNT_Header"},{"location":"ft2-winfnt_fonts.html#ft_get_winfnt_header","text":"Defined in FT_WINFONTS_H (freetype/ftwinfnt.h). FT_EXPORT( FT_Error ) FT_Get_WinFNT_Header ( FT_Face face, FT_WinFNT_HeaderRec *aheader ); Retrieve a Windows FNT font info header.","title":"FT_Get_WinFNT_Header"}]} \ No newline at end of file
diff --git a/freetype/docs/reference/sitemap.xml b/freetype/docs/reference/sitemap.xml
index 5a8744f2..6e8b295b 100644
--- a/freetype/docs/reference/sitemap.xml
+++ b/freetype/docs/reference/sitemap.xml
@@ -2,267 +2,277 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>None</loc>
- <lastmod>2021-12-02</lastmod>
+ <lastmod>2022-05-01</lastmod>
+ <changefreq>daily</changefreq>
+ </url>
+ <url>
+ <loc>None</loc>
+ <lastmod>2022-05-01</lastmod>
+ <changefreq>daily</changefreq>
+ </url>
+ <url>
+ <loc>None</loc>
+ <lastmod>2022-05-01</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset> \ No newline at end of file
diff --git a/freetype/docs/reference/sitemap.xml.gz b/freetype/docs/reference/sitemap.xml.gz
index c6128b6d..4546f377 100644
--- a/freetype/docs/reference/sitemap.xml.gz
+++ b/freetype/docs/reference/sitemap.xml.gz
Binary files differ
diff --git a/freetype/docs/release b/freetype/docs/release
index 05f730f9..d9cff679 100644
--- a/freetype/docs/release
+++ b/freetype/docs/release
@@ -27,11 +27,15 @@ How to prepare a new release
make distclean; make devel CC=g++; make multi CC=g++
sh autogen.sh
- make distclean; ./configure; make
make distclean; ./configure CC=g++; make
in the cloned repository to test compilation with both gcc and g++.
+ Note that it is normally not necessary to test standard C
+ compilation with the `configure`, `meson`, and `cmake` build tools
+ since this is done by the CI process of 'gitlab.freetype.org' for
+ every commit.
+
. Test C++ compilation for 'freetype-demos' too (using `git clone` as
above).
@@ -73,13 +77,14 @@ How to prepare a new release
#!/bin/sh
- VERSION=2.10.4
+ VERSION=2.12.0
SAVANNAH_USER=wl
SOURCEFORGE_USER=wlemb
+ GPG_KEY_ID=BE6C3AAC63AD8E3F
#####################################################################
- GPG='/usr/bin/gpg --batch --no-tty'
+ GPG="/usr/bin/gpg --batch --no-tty --local-user $GPG_KEY_ID"
version=`echo $VERSION | sed "s/\\.//g"`
@@ -177,11 +182,15 @@ How to prepare a new release
'freetype-web' repository.
. Announce new release on 'freetype-announce@nongnu.org' and to
- relevant newsgroups.
+ relevant newsgroups. The text should include
+
+ - SHA256 checksums of all files,
+ - instructions how to verify the bundles using the `.sig` file data,
+ - the PGP public key used to sign the archives.
----------------------------------------------------------------------
-Copyright (C) 2003-2021 by
+Copyright (C) 2003-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/config/ftconfig.h b/freetype/include/freetype/config/ftconfig.h
index 65effcbe..c696e900 100644
--- a/freetype/include/freetype/config/ftconfig.h
+++ b/freetype/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
*
* ANSI-specific configuration file (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/config/ftheader.h b/freetype/include/freetype/config/ftheader.h
index e46d314e..a8c6833d 100644
--- a/freetype/include/freetype/config/ftheader.h
+++ b/freetype/include/freetype/config/ftheader.h
@@ -4,7 +4,7 @@
*
* Build macros of the FreeType 2 library.
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -777,6 +777,18 @@
#define FT_COLOR_H <freetype/ftcolor.h>
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_OTSVG_H
+ *
+ * @description:
+ * A macro used in `#include` statements to name the file containing the
+ * FreeType~2 API which handles the OpenType 'SVG~' glyphs.
+ */
+#define FT_OTSVG_H <freetype/otsvg.h>
+
+
/* */
/* These header files don't need to be included by the user. */
diff --git a/freetype/include/freetype/config/ftmodule.h b/freetype/include/freetype/config/ftmodule.h
index d4ba3f78..b315baba 100644
--- a/freetype/include/freetype/config/ftmodule.h
+++ b/freetype/include/freetype/config/ftmodule.h
@@ -28,5 +28,6 @@ FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class )
+FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class )
/* EOF */
diff --git a/freetype/include/freetype/config/ftoption.h b/freetype/include/freetype/config/ftoption.h
index 4227fd37..c5bde243 100644
--- a/freetype/include/freetype/config/ftoption.h
+++ b/freetype/include/freetype/config/ftoption.h
@@ -4,7 +4,7 @@
*
* User-selectable configuration macros (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -219,6 +219,10 @@ FT_BEGIN_HEADER
* If you use a build system like cmake or the `configure` script,
* options set by those programs have precedence, overwriting the value
* here with the configured one.
+ *
+ * If you use the GNU make build system directly (that is, without the
+ * `configure` script) and you define this macro, you also have to pass
+ * `SYSTEM_ZLIB=yes` as an argument to make.
*/
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
@@ -525,6 +529,20 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * OpenType SVG Glyph Support
+ *
+ * Setting this macro enables support for OpenType SVG glyphs. By
+ * default, FreeType can only fetch SVG documents. However, it can also
+ * render them if external rendering hook functions are plugged in at
+ * runtime.
+ *
+ * More details on the hooks can be found in file `otsvg.h`.
+ */
+#define FT_CONFIG_OPTION_SVG
+
+
+ /**************************************************************************
+ *
* Error Strings
*
* If this macro is set, `FT_Error_String` will return meaningful
@@ -1002,8 +1020,8 @@ FT_BEGIN_HEADER
#error "Invalid CFF darkening parameters!"
#endif
-FT_END_HEADER
+FT_END_HEADER
#endif /* FTOPTION_H_ */
diff --git a/freetype/include/freetype/config/ftstdlib.h b/freetype/include/freetype/config/ftstdlib.h
index 6ee412a0..7958c2a5 100644
--- a/freetype/include/freetype/config/ftstdlib.h
+++ b/freetype/include/freetype/config/ftstdlib.h
@@ -5,7 +5,7 @@
* ANSI-specific library and header configuration file (specification
* only).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/config/integer-types.h b/freetype/include/freetype/config/integer-types.h
index 5ef09f19..d9d2638d 100644
--- a/freetype/include/freetype/config/integer-types.h
+++ b/freetype/include/freetype/config/integer-types.h
@@ -4,7 +4,7 @@
*
* FreeType integer types definitions.
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -221,9 +221,10 @@
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
-#elif defined( __WATCOMC__ ) /* Watcom C++ */
+#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1100 /* Watcom C++ */
- /* Watcom doesn't provide 64-bit data types */
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
diff --git a/freetype/include/freetype/config/mac-support.h b/freetype/include/freetype/config/mac-support.h
index ef58d8b3..e42c9fe4 100644
--- a/freetype/include/freetype/config/mac-support.h
+++ b/freetype/include/freetype/config/mac-support.h
@@ -4,7 +4,7 @@
*
* Mac/OS X support configuration header.
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/config/public-macros.h b/freetype/include/freetype/config/public-macros.h
index 9fbb3274..273972d1 100644
--- a/freetype/include/freetype/config/public-macros.h
+++ b/freetype/include/freetype/config/public-macros.h
@@ -4,7 +4,7 @@
*
* Define a set of compiler macros used in public FreeType headers.
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -101,8 +101,9 @@ FT_BEGIN_HEADER
* functions are exported with C linkage, even when the header is included
* by a C++ source file.
*/
+#ifndef FT_EXPORT
#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
-
+#endif
/*
* `FT_UNUSED` indicates that a given parameter is not used -- this is
diff --git a/freetype/include/freetype/freetype.h b/freetype/include/freetype/freetype.h
index f6c66b94..aa1a4fe3 100644
--- a/freetype/include/freetype/freetype.h
+++ b/freetype/include/freetype/freetype.h
@@ -4,7 +4,7 @@
*
* FreeType high-level API and common types (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -153,6 +153,9 @@ FT_BEGIN_HEADER
* FT_FACE_FLAG_GLYPH_NAMES
* FT_FACE_FLAG_EXTERNAL_STREAM
* FT_FACE_FLAG_HINTER
+ * FT_FACE_FLAG_SVG
+ * FT_FACE_FLAG_SBIX
+ * FT_FACE_FLAG_SBIX_OVERLAY
*
* FT_HAS_HORIZONTAL
* FT_HAS_VERTICAL
@@ -161,6 +164,9 @@ FT_BEGIN_HEADER
* FT_HAS_GLYPH_NAMES
* FT_HAS_COLOR
* FT_HAS_MULTIPLE_MASTERS
+ * FT_HAS_SVG
+ * FT_HAS_SBIX
+ * FT_HAS_SBIX_OVERLAY
*
* FT_IS_SFNT
* FT_IS_SCALABLE
@@ -225,6 +231,7 @@ FT_BEGIN_HEADER
* FT_LOAD_NO_SCALE
* FT_LOAD_NO_HINTING
* FT_LOAD_NO_BITMAP
+ * FT_LOAD_SBITS_ONLY
* FT_LOAD_NO_AUTOHINT
* FT_LOAD_COLOR
*
@@ -522,13 +529,15 @@ FT_BEGIN_HEADER
* size.
*
* @note:
- * An @FT_Face has one _active_ @FT_Size object that is used by functions
- * like @FT_Load_Glyph to determine the scaling transformation that in
- * turn is used to load and hint glyphs and metrics.
+ * An @FT_Face has one _active_ `FT_Size` object that is used by
+ * functions like @FT_Load_Glyph to determine the scaling transformation
+ * that in turn is used to load and hint glyphs and metrics.
*
- * You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, @FT_Request_Size
+ * A newly created `FT_Size` object contains only meaningless zero values.
+ * You must use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, @FT_Request_Size
* or even @FT_Select_Size to change the content (i.e., the scaling
- * values) of the active @FT_Size.
+ * values) of the active `FT_Size`. Otherwise, the scaling and hinting
+ * will not be performed.
*
* You can use @FT_New_Size to create additional size objects for a given
* @FT_Face, but they won't be used by other functions until you activate
@@ -1228,6 +1237,19 @@ FT_BEGIN_HEADER
* altered with @FT_Set_MM_Design_Coordinates,
* @FT_Set_Var_Design_Coordinates, or @FT_Set_Var_Blend_Coordinates.
* This flag is unset by a call to @FT_Set_Named_Instance.
+ *
+ * FT_FACE_FLAG_SVG ::
+ * [Since 2.12] The face has an 'SVG~' OpenType table.
+ *
+ * FT_FACE_FLAG_SBIX ::
+ * [Since 2.12] The face has an 'sbix' OpenType table *and* outlines.
+ * For such fonts, @FT_FACE_FLAG_SCALABLE is not set by default to
+ * retain backward compatibility.
+ *
+ * FT_FACE_FLAG_SBIX_OVERLAY ::
+ * [Since 2.12] The face has an 'sbix' OpenType table where outlines
+ * should be drawn on top of bitmap strikes.
+ *
*/
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
@@ -1245,6 +1267,9 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
#define FT_FACE_FLAG_COLOR ( 1L << 14 )
#define FT_FACE_FLAG_VARIATION ( 1L << 15 )
+#define FT_FACE_FLAG_SVG ( 1L << 16 )
+#define FT_FACE_FLAG_SBIX ( 1L << 17 )
+#define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 )
/**************************************************************************
@@ -1487,6 +1512,124 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @macro:
+ * FT_HAS_SVG
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains an 'SVG~'
+ * OpenType table.
+ *
+ * @since:
+ * 2.12
+ */
+#define FT_HAS_SVG( face ) \
+ ( !!( (face)->face_flags & FT_FACE_FLAG_SVG ) )
+
+
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_HAS_SBIX
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains an 'sbix'
+ * OpenType table *and* outline glyphs.
+ *
+ * Currently, FreeType only supports bitmap glyphs in PNG format for this
+ * table (i.e., JPEG and TIFF formats are unsupported, as are
+ * Apple-specific formats not part of the OpenType specification).
+ *
+ * @note:
+ * For backward compatibility, a font with an 'sbix' table is treated as
+ * a bitmap-only face. Using @FT_Open_Face with
+ * @FT_PARAM_TAG_IGNORE_SBIX, an application can switch off 'sbix'
+ * handling so that the face is treated as an ordinary outline font with
+ * scalable outlines.
+ *
+ * Here is some pseudo code that roughly illustrates how to implement
+ * 'sbix' handling according to the OpenType specification.
+ *
+ * ```
+ * if ( FT_HAS_SBIX( face ) )
+ * {
+ * // open font as a scalable one without sbix handling
+ * FT_Face face2;
+ * FT_Parameter param = { FT_PARAM_TAG_IGNORE_SBIX, NULL };
+ * FT_Open_Args args = { FT_OPEN_PARAMS | ...,
+ * ...,
+ * 1, &param };
+ *
+ *
+ * FT_Open_Face( library, &args, 0, &face2 );
+ *
+ * <sort `face->available_size` as necessary into
+ * `preferred_sizes`[*]>
+ *
+ * for ( i = 0; i < face->num_fixed_sizes; i++ )
+ * {
+ * size = preferred_sizes[i].size;
+ *
+ * error = FT_Set_Pixel_Sizes( face, size, size );
+ * <error handling omitted>
+ *
+ * // check whether we have a glyph in a bitmap strike
+ * error = FT_Load_Glyph( face,
+ * glyph_index,
+ * FT_LOAD_SBITS_ONLY |
+ * FT_LOAD_BITMAP_METRICS_ONLY );
+ * if ( error == FT_Err_Invalid_Argument )
+ * continue;
+ * else if ( error )
+ * <other error handling omitted>
+ * else
+ * break;
+ * }
+ *
+ * if ( i != face->num_fixed_sizes )
+ * <load embedded bitmap with `FT_Load_Glyph`,
+ * scale it, display it, etc.>
+ *
+ * if ( i == face->num_fixed_sizes ||
+ * FT_HAS_SBIX_OVERLAY( face ) )
+ * <use `face2` to load outline glyph with `FT_Load_Glyph`,
+ * scale it, display it on top of the bitmap, etc.>
+ * }
+ * ```
+ *
+ * [*] Assuming a target value of 400dpi and available strike sizes 100,
+ * 200, 300, and 400dpi, a possible order might be [400, 200, 300, 100]:
+ * scaling 200dpi to 400dpi usually gives better results than scaling
+ * 300dpi to 400dpi; it is also much faster. However, scaling 100dpi to
+ * 400dpi can yield a too pixelated result, thus the preference might be
+ * 300dpi over 100dpi.
+ *
+ * @since:
+ * 2.12
+ */
+#define FT_HAS_SBIX( face ) \
+ ( !!( (face)->face_flags & FT_FACE_FLAG_SBIX ) )
+
+
+ /**************************************************************************
+ *
+ * @macro:
+ * FT_HAS_SBIX_OVERLAY
+ *
+ * @description:
+ * A macro that returns true whenever a face object contains an 'sbix'
+ * OpenType table with bit~1 in its `flags` field set, instructing the
+ * application to overlay the bitmap strike with the corresponding
+ * outline glyph. See @FT_HAS_SBIX for pseudo code how to use it.
+ *
+ * @since:
+ * 2.12
+ */
+#define FT_HAS_SBIX_OVERLAY( face ) \
+ ( !!( (face)->face_flags & FT_FACE_FLAG_SBIX_OVERLAY ) )
+
+
+ /**************************************************************************
+ *
* @enum:
* FT_STYLE_FLAG_XXX
*
@@ -2702,8 +2845,8 @@ FT_BEGIN_HEADER
* 'https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'.
*
* Contrary to @FT_Set_Char_Size, this function doesn't have special code
- * to normalize zero-valued widths, heights, or resolutions (which lead
- * to errors in most cases).
+ * to normalize zero-valued widths, heights, or resolutions, which are
+ * treated as @FT_LOAD_NO_SCALE.
*
* Don't use this function if you are using the FreeType cache API.
*/
@@ -2819,7 +2962,7 @@ FT_BEGIN_HEADER
*
* 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.,
+ * flags 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).
*
@@ -2827,8 +2970,10 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * The loaded glyph may be transformed. See @FT_Set_Transform for the
- * details.
+ * For proper scaling and hinting, the active @FT_Size object owned by
+ * the face has to be meaningfully initialized by calling
+ * @FT_Set_Char_Size before this function, for example. The loaded
+ * glyph may be transformed. See @FT_Set_Transform for the details.
*
* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument` is returned
* for invalid CID values (this is, for CID values that don't have a
@@ -2918,6 +3063,8 @@ FT_BEGIN_HEADER
*
* FT_LOAD_NO_SCALE ::
* Don't scale the loaded outline glyph but keep it in font units.
+ * This flag is also assumed if @FT_Size owned by the face was not
+ * properly initialized.
*
* This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
* unsets @FT_LOAD_RENDER.
@@ -2948,6 +3095,15 @@ FT_BEGIN_HEADER
*
* @FT_LOAD_NO_SCALE always sets this flag.
*
+ * FT_LOAD_SBITS_ONLY ::
+ * [Since 2.12] This is the opposite of @FT_LOAD_NO_BITMAP, more or
+ * less: @FT_Load_Glyph returns `FT_Err_Invalid_Argument` if the face
+ * contains a bitmap strike for the given size (or the strike selected
+ * by @FT_Select_Size) but there is no glyph in the strike.
+ *
+ * Note that this load flag was part of FreeType since version 2.0.6
+ * but previously tagged as internal.
+ *
* FT_LOAD_VERTICAL_LAYOUT ::
* Load the glyph for vertical text layout. In particular, the
* `advance` value in the @FT_GlyphSlotRec structure is set to the
@@ -3004,21 +3160,31 @@ FT_BEGIN_HEADER
* Disable the auto-hinter. See also the note below.
*
* FT_LOAD_COLOR ::
- * Load colored glyphs. There are slight differences depending on the
- * font format.
- *
- * [Since 2.5] Load embedded color bitmap images. The resulting color
- * bitmaps, if available, will have the @FT_PIXEL_MODE_BGRA format,
- * with pre-multiplied color channels. If the flag is not set and
- * color bitmaps are found, they are converted to 256-level gray
- * bitmaps, using the @FT_PIXEL_MODE_GRAY format.
- *
- * [Since 2.10, experimental] If the glyph index contains an entry in
+ * Load colored glyphs. FreeType searches in the following order;
+ * there are slight differences depending on the font format.
+ *
+ * [Since 2.5] Load embedded color bitmap images (provided
+ * @FT_LOAD_NO_BITMAP is not set). The resulting color bitmaps, if
+ * available, have the @FT_PIXEL_MODE_BGRA format, with pre-multiplied
+ * color channels. If the flag is not set and color bitmaps are found,
+ * they are converted to 256-level gray bitmaps, using the
+ * @FT_PIXEL_MODE_GRAY format.
+ *
+ * [Since 2.12] If the glyph index maps to an entry in the face's
+ * 'SVG~' table, load the associated SVG document from this table and
+ * set the `format` field of @FT_GlyphSlotRec to @FT_GLYPH_FORMAT_SVG.
+ * Note that FreeType itself can't render SVG documents; however, the
+ * library provides hooks to seamlessly integrate an external renderer.
+ * See sections @ot_svg_driver and @svg_fonts for more.
+ *
+ * [Since 2.10, experimental] If the glyph index maps to an entry in
* the face's 'COLR' table with a 'CPAL' palette table (as defined in
* the OpenType specification), make @FT_Render_Glyph provide a default
* blending of the color glyph layers associated with the glyph index,
* using the same bitmap format as embedded color bitmap images. This
- * is mainly for convenience; for full control of color layers use
+ * is mainly for convenience and works only for glyphs in 'COLR' v0
+ * tables (or glyphs in 'COLR' v1 tables that exclusively use v0
+ * features). For full control of color layers use
* @FT_Get_Color_Glyph_Layer and FreeType's color functions like
* @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering
* so that the client application can handle blending by itself.
@@ -3069,19 +3235,20 @@ FT_BEGIN_HEADER
*
*/
#define FT_LOAD_DEFAULT 0x0
-#define FT_LOAD_NO_SCALE ( 1L << 0 )
-#define FT_LOAD_NO_HINTING ( 1L << 1 )
-#define FT_LOAD_RENDER ( 1L << 2 )
-#define FT_LOAD_NO_BITMAP ( 1L << 3 )
-#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
-#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
-#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
-#define FT_LOAD_PEDANTIC ( 1L << 7 )
-#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
+#define FT_LOAD_NO_SCALE ( 1L << 0 )
+#define FT_LOAD_NO_HINTING ( 1L << 1 )
+#define FT_LOAD_RENDER ( 1L << 2 )
+#define FT_LOAD_NO_BITMAP ( 1L << 3 )
+#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
+#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
+#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
+#define FT_LOAD_PEDANTIC ( 1L << 7 )
+#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
#define FT_LOAD_NO_RECURSE ( 1L << 10 )
#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
#define FT_LOAD_MONOCHROME ( 1L << 12 )
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
+#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
/* Bits 16-19 are used by `FT_LOAD_TARGET_` */
#define FT_LOAD_COLOR ( 1L << 20 )
@@ -3091,8 +3258,8 @@ FT_BEGIN_HEADER
/* */
/* used internally only by certain font drivers */
-#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
-#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
+#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
+#define FT_LOAD_SVG_ONLY ( 1L << 23 )
/**************************************************************************
@@ -3370,6 +3537,44 @@ FT_BEGIN_HEADER
* }
*
* ```
+ *
+ * FreeType has two rasterizers for generating SDF, namely:
+ *
+ * 1. `sdf` for generating SDF directly from glyph's outline, and
+ *
+ * 2. `bsdf` for generating SDF from rasterized bitmaps.
+ *
+ * Depending on the glyph type (i.e., outline or bitmap), one of the two
+ * rasterizers is chosen at runtime and used for generating SDFs. To
+ * force the use of `bsdf` you should render the glyph with any of the
+ * FreeType's other rendering modes (e.g., `FT_RENDER_MODE_NORMAL`) and
+ * then re-render with `FT_RENDER_MODE_SDF`.
+ *
+ * There are some issues with stability and possible failures of the SDF
+ * renderers (specifically `sdf`).
+ *
+ * 1. The `sdf` rasterizer is sensitive to really small features (e.g.,
+ * sharp turns that are less than 1~pixel) and imperfections in the
+ * glyph's outline, causing artifacts in the final output.
+ *
+ * 2. The `sdf` rasterizer has limited support for handling intersecting
+ * contours and *cannot* handle self-intersecting contours whatsoever.
+ * Self-intersection happens when a single connected contour intersect
+ * itself at some point; having these in your font definitely pose a
+ * problem to the rasterizer and cause artifacts, too.
+ *
+ * 3. Generating SDF for really small glyphs may result in undesirable
+ * output; the pixel grid (which stores distance information) becomes
+ * too coarse.
+ *
+ * 4. Since the output buffer is normalized, precision at smaller spreads
+ * is greater than precision at larger spread values because the
+ * output range of [0..255] gets mapped to a smaller SDF range. A
+ * spread of~2 should be sufficient in most cases.
+ *
+ * Points (1) and (2) can be avoided by using the `bsdf` rasterizer,
+ * which is more stable than the `sdf` rasterizer in general.
+ *
*/
typedef enum FT_Render_Mode_
{
@@ -3410,7 +3615,7 @@ FT_BEGIN_HEADER
* @FT_Render_Mode for a list of possible values.
*
* If @FT_RENDER_MODE_NORMAL is used, a previous call of @FT_Load_Glyph
- * with flag @FT_LOAD_COLOR makes FT_Render_Glyph provide a default
+ * with flag @FT_LOAD_COLOR makes `FT_Render_Glyph` provide a default
* blending of colored glyph layers associated with the current glyph
* slot (provided the font contains such layers) instead of rendering
* the glyph slot's outline. This is an experimental feature; see
@@ -3420,9 +3625,6 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * To get meaningful results, font scaling values must be set with
- * functions like @FT_Set_Char_Size before calling `FT_Render_Glyph`.
- *
* When FreeType outputs a bitmap of a glyph, it really outputs an alpha
* coverage map. If a pixel is completely covered by a filled-in
* outline, the bitmap contains 0xFF at that pixel, meaning that
@@ -4739,7 +4941,7 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
-#define FREETYPE_MINOR 11
+#define FREETYPE_MINOR 12
#define FREETYPE_PATCH 1
diff --git a/freetype/include/freetype/ftadvanc.h b/freetype/include/freetype/ftadvanc.h
index 3a13bd3d..8ce48466 100644
--- a/freetype/include/freetype/ftadvanc.h
+++ b/freetype/include/freetype/ftadvanc.h
@@ -4,7 +4,7 @@
*
* Quick computation of advance widths (specification only).
*
- * Copyright (C) 2008-2021 by
+ * Copyright (C) 2008-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftbbox.h b/freetype/include/freetype/ftbbox.h
index 713aedb1..768478f3 100644
--- a/freetype/include/freetype/ftbbox.h
+++ b/freetype/include/freetype/ftbbox.h
@@ -4,7 +4,7 @@
*
* FreeType exact bbox computation (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftbdf.h b/freetype/include/freetype/ftbdf.h
index c4285064..04d6094f 100644
--- a/freetype/include/freetype/ftbdf.h
+++ b/freetype/include/freetype/ftbdf.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing BDF-specific strings (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftbitmap.h b/freetype/include/freetype/ftbitmap.h
index 11c45b0e..c3462dad 100644
--- a/freetype/include/freetype/ftbitmap.h
+++ b/freetype/include/freetype/ftbitmap.h
@@ -4,7 +4,7 @@
*
* FreeType utility functions for bitmaps (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftbzip2.h b/freetype/include/freetype/ftbzip2.h
index afd2a82a..c8530580 100644
--- a/freetype/include/freetype/ftbzip2.h
+++ b/freetype/include/freetype/ftbzip2.h
@@ -4,7 +4,7 @@
*
* Bzip2-compressed stream support.
*
- * Copyright (C) 2010-2021 by
+ * Copyright (C) 2010-2022 by
* Joel Klinghed.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftcache.h b/freetype/include/freetype/ftcache.h
index 70399a32..ecbbd7b8 100644
--- a/freetype/include/freetype/ftcache.h
+++ b/freetype/include/freetype/ftcache.h
@@ -4,7 +4,7 @@
*
* FreeType Cache subsystem (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftchapters.h b/freetype/include/freetype/ftchapters.h
index 4f32cc88..6a9733ad 100644
--- a/freetype/include/freetype/ftchapters.h
+++ b/freetype/include/freetype/ftchapters.h
@@ -62,6 +62,7 @@
* cid_fonts
* pfr_fonts
* winfnt_fonts
+ * svg_fonts
* font_formats
* gasp_table
*
@@ -82,6 +83,7 @@
* t1_cid_driver
* tt_driver
* pcf_driver
+ * ot_svg_driver
* properties
* parameter_tags
* lcd_rendering
diff --git a/freetype/include/freetype/ftcid.h b/freetype/include/freetype/ftcid.h
index 9a415bd9..d8010838 100644
--- a/freetype/include/freetype/ftcid.h
+++ b/freetype/include/freetype/ftcid.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing CID font information (specification).
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* Dereg Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftcolor.h b/freetype/include/freetype/ftcolor.h
index 08dbac0c..3edaee4e 100644
--- a/freetype/include/freetype/ftcolor.h
+++ b/freetype/include/freetype/ftcolor.h
@@ -4,7 +4,7 @@
*
* FreeType's glyph color management (specification).
*
- * Copyright (C) 2018-2021 by
+ * Copyright (C) 2018-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -528,14 +528,14 @@ FT_BEGIN_HEADER
* @fields:
* num_color_stops ::
* The number of color stops for the requested glyph index. Set by
- * @FT_Get_Colorline_Stops.
+ * @FT_Get_Paint.
*
* current_color_stop ::
* The current color stop. Set by @FT_Get_Colorline_Stops.
*
* p ::
- * An opaque pointer into 'COLR' table data. The caller must set this
- * to `NULL` before the first call of @FT_Get_Colorline_Stops.
+ * An opaque pointer into 'COLR' table data. Set by @FT_Get_Paint.
+ * Updated by @FT_Get_Colorline_Stops.
*
* @since:
* 2.11 -- **currently experimental only!** There might be changes
diff --git a/freetype/include/freetype/ftdriver.h b/freetype/include/freetype/ftdriver.h
index 49366390..0dc91e8b 100644
--- a/freetype/include/freetype/ftdriver.h
+++ b/freetype/include/freetype/ftdriver.h
@@ -4,7 +4,7 @@
*
* FreeType API for controlling driver modules (specification only).
*
- * Copyright (C) 2017-2021 by
+ * Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -212,16 +212,14 @@ FT_BEGIN_HEADER
* @description:
* While FreeType's TrueType driver doesn't expose API functions by
* itself, it is possible to control its behaviour with @FT_Property_Set
- * and @FT_Property_Get. The following lists the available properties
- * together with the necessary macros and structures.
- *
- * The TrueType driver's module name is 'truetype'.
+ * and @FT_Property_Get.
*
- * A single property @interpreter-version is available, as documented in
- * the @properties section.
+ * The TrueType driver's module name is 'truetype'; a single property
+ * @interpreter-version is available, as documented in the @properties
+ * section.
*
- * We start with a list of definitions, kindly provided by Greg
- * Hitchcock.
+ * To help understand the differences between interpreter versions, we
+ * introduce a list of definitions, kindly provided by Greg Hitchcock.
*
* _Bi-Level Rendering_
*
@@ -303,6 +301,31 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
+ * ot_svg_driver
+ *
+ * @title:
+ * The SVG driver
+ *
+ * @abstract:
+ * Controlling the external rendering of OT-SVG glyphs.
+ *
+ * @description:
+ * By default, FreeType can only load the 'SVG~' table of OpenType fonts
+ * if configuration macro `FT_CONFIG_OPTION_SVG` is defined. To make it
+ * render SVG glyphs, an external SVG rendering library is needed. All
+ * details on the interface between FreeType and the external library
+ * via function hooks can be found in section @svg_fonts.
+ *
+ * The OT-SVG driver's module name is 'ot-svg'; it supports a single
+ * property called @svg-hooks, documented below in the @properties
+ * section.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @section:
* properties
*
* @title:
@@ -801,6 +824,40 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @property:
+ * svg-hooks
+ *
+ * @description:
+ * Set up the interface between FreeType and an extern SVG rendering
+ * library like 'librsvg'. All details on the function hooks can be
+ * found in section @svg_fonts.
+ *
+ * @example:
+ * The following example code expects that the four hook functions
+ * `svg_*` are defined elsewhere. Error handling is omitted, too.
+ *
+ * ```
+ * FT_Library library;
+ * SVG_RendererHooks hooks = {
+ * (SVG_Lib_Init_Func)svg_init,
+ * (SVG_Lib_Free_Func)svg_free,
+ * (SVG_Lib_Render_Func)svg_render,
+ * (SVG_Lib_Preset_Slot_Func)svg_preset_slot };
+ *
+ *
+ * FT_Init_FreeType( &library );
+ *
+ * FT_Property_Set( library, "ot-svg",
+ * "svg-hooks", &hooks );
+ * ```
+ *
+ * @since:
+ * 2.12
+ */
+
+
+ /**************************************************************************
+ *
+ * @property:
* glyph-to-script-map
*
* @description:
diff --git a/freetype/include/freetype/fterrdef.h b/freetype/include/freetype/fterrdef.h
index 6e9c4ccb..a3acfce4 100644
--- a/freetype/include/freetype/fterrdef.h
+++ b/freetype/include/freetype/fterrdef.h
@@ -4,7 +4,7 @@
*
* FreeType error codes (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -101,6 +101,8 @@
"too many hints" )
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
"invalid pixel size" )
+ FT_ERRORDEF_( Invalid_SVG_Document, 0x18,
+ "invalid SVG document" )
/* handle errors */
@@ -234,6 +236,8 @@
"found FDEF or IDEF opcode in glyf bytecode" )
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
"missing bitmap in strike" )
+ FT_ERRORDEF_( Missing_SVG_Hooks, 0x9E,
+ "SVG hooks have not been set" )
/* CFF, CID, and Type 1 errors */
diff --git a/freetype/include/freetype/fterrors.h b/freetype/include/freetype/fterrors.h
index 151941dd..ff1b375d 100644
--- a/freetype/include/freetype/fterrors.h
+++ b/freetype/include/freetype/fterrors.h
@@ -4,7 +4,7 @@
*
* FreeType error code handling (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftfntfmt.h b/freetype/include/freetype/ftfntfmt.h
index 8e68a4a3..77d55357 100644
--- a/freetype/include/freetype/ftfntfmt.h
+++ b/freetype/include/freetype/ftfntfmt.h
@@ -4,7 +4,7 @@
*
* Support functions for font formats.
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftgasp.h b/freetype/include/freetype/ftgasp.h
index 76c45eb3..d4ab9b32 100644
--- a/freetype/include/freetype/ftgasp.h
+++ b/freetype/include/freetype/ftgasp.h
@@ -4,7 +4,7 @@
*
* Access of TrueType's 'gasp' table (specification).
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftglyph.h b/freetype/include/freetype/ftglyph.h
index 26b32ed6..6b77bd3d 100644
--- a/freetype/include/freetype/ftglyph.h
+++ b/freetype/include/freetype/ftglyph.h
@@ -4,7 +4,7 @@
*
* FreeType convenience functions to handle glyphs (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -126,7 +126,7 @@ FT_BEGIN_HEADER
*
* @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.
+ * 'sub-class' of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.
*/
typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
@@ -142,7 +142,7 @@ FT_BEGIN_HEADER
*
* @fields:
* root ::
- * The root @FT_Glyph fields.
+ * The root fields of @FT_Glyph.
*
* left ::
* The left-side bearing, i.e., the horizontal distance from the
@@ -181,7 +181,7 @@ FT_BEGIN_HEADER
*
* @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.
+ * 'sub-class' of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec.
*/
typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
@@ -224,6 +224,92 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @type:
+ * FT_SvgGlyph
+ *
+ * @description:
+ * A handle to an object used to model an SVG glyph. This is a
+ * 'sub-class' of @FT_Glyph, and a pointer to @FT_SvgGlyphRec.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef struct FT_SvgGlyphRec_* FT_SvgGlyph;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_SvgGlyphRec
+ *
+ * @description:
+ * A structure used for OT-SVG glyphs. This is a 'sub-class' of
+ * @FT_GlyphRec.
+ *
+ * @fields:
+ * root ::
+ * The root @FT_GlyphRec fields.
+ *
+ * svg_document ::
+ * A pointer to the SVG document.
+ *
+ * svg_document_length ::
+ * The length of `svg_document`.
+ *
+ * glyph_index ::
+ * The index of the glyph to be rendered.
+ *
+ * metrics ::
+ * A metrics object storing the size information.
+ *
+ * units_per_EM ::
+ * The size of the EM square.
+ *
+ * start_glyph_id ::
+ * The first glyph ID in the glyph range covered by this document.
+ *
+ * end_glyph_id ::
+ * The last glyph ID in the glyph range covered by this document.
+ *
+ * transform ::
+ * A 2x2 transformation matrix to apply to the glyph while rendering
+ * it.
+ *
+ * delta ::
+ * Translation to apply to the glyph while rendering.
+ *
+ * @note:
+ * The Glyph Management API requires @FT_Glyph or its 'sub-class' to have
+ * all the information needed to completely define the glyph's rendering.
+ * Outline-based glyphs can directly apply transformations to the outline
+ * but this is not possible for an SVG document that hasn't been parsed.
+ * Therefore, the transformation is stored along with the document. In
+ * the absence of a 'ViewBox' or 'Width'/'Height' attribute, the size of
+ * the ViewPort should be assumed to be 'units_per_EM'.
+ */
+ typedef struct FT_SvgGlyphRec_
+ {
+ FT_GlyphRec root;
+
+ FT_Byte* svg_document;
+ FT_ULong svg_document_length;
+
+ FT_UInt glyph_index;
+
+ FT_Size_Metrics metrics;
+ FT_UShort units_per_EM;
+
+ FT_UShort start_glyph_id;
+ FT_UShort end_glyph_id;
+
+ FT_Matrix transform;
+ FT_Vector delta;
+
+ } FT_SvgGlyphRec;
+
+
+ /**************************************************************************
+ *
* @function:
* FT_New_Glyph
*
@@ -498,9 +584,9 @@ FT_BEGIN_HEADER
* The glyph image is translated with the `origin` vector before
* rendering.
*
- * The first parameter is a pointer to an @FT_Glyph handle, that will be
+ * The first parameter is a pointer to an @FT_Glyph handle that will be
* _replaced_ by this function (with newly allocated data). Typically,
- * you would use (omitting error handling):
+ * you would do something like the following (omitting error handling).
*
* ```
* FT_Glyph glyph;
@@ -517,7 +603,7 @@ FT_BEGIN_HEADER
* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )
* {
* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,
- * 0, 1 );
+ * 0, 1 );
* if ( error ) // `glyph' unchanged
* ...
* }
@@ -532,7 +618,7 @@ FT_BEGIN_HEADER
* FT_Done_Glyph( glyph );
* ```
*
- * Here is another example, again without error handling:
+ * Here is another example, again without error handling.
*
* ```
* FT_Glyph glyphs[MAX_GLYPHS]
diff --git a/freetype/include/freetype/ftgxval.h b/freetype/include/freetype/ftgxval.h
index 21bbbde2..2d3f382a 100644
--- a/freetype/include/freetype/ftgxval.h
+++ b/freetype/include/freetype/ftgxval.h
@@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* Masatake YAMATO, Redhat K.K,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/include/freetype/ftgzip.h b/freetype/include/freetype/ftgzip.h
index ba82baba..0880290f 100644
--- a/freetype/include/freetype/ftgzip.h
+++ b/freetype/include/freetype/ftgzip.h
@@ -4,7 +4,7 @@
*
* Gzip-compressed stream support.
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftimage.h b/freetype/include/freetype/ftimage.h
index 88533b84..7f2d721c 100644
--- a/freetype/include/freetype/ftimage.h
+++ b/freetype/include/freetype/ftimage.h
@@ -5,7 +5,7 @@
* FreeType glyph image formats and default raster interface
* (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -401,11 +401,11 @@ FT_BEGIN_HEADER
* information.
*
* FT_OUTLINE_OVERLAP ::
- * This flag indicates that this outline contains overlapping contrours
- * and the anti-aliased renderer should perform oversampling to
- * mitigate possible artifacts. This flag should _not_ be set for
- * well designed glyphs without overlaps because it quadruples the
- * rendering time.
+ * [Since 2.10.3] This flag indicates that this outline contains
+ * overlapping contours and the anti-aliased renderer should perform
+ * oversampling to mitigate possible artifacts. This flag should _not_
+ * be set for well designed glyphs without overlaps because it quadruples
+ * the rendering time.
*
* FT_OUTLINE_HIGH_PRECISION ::
* This flag indicates that the scan-line converter should try to
@@ -741,6 +741,10 @@ FT_BEGIN_HEADER
* 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.
+ *
+ * FT_GLYPH_FORMAT_SVG ::
+ * [Since 2.12] The glyph is represented by an SVG document in the
+ * 'SVG~' table.
*/
typedef enum FT_Glyph_Format_
{
@@ -749,7 +753,8 @@ FT_BEGIN_HEADER
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_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' ),
+ FT_IMAGE_TAG( FT_GLYPH_FORMAT_SVG, 'S', 'V', 'G', ' ' )
} FT_Glyph_Format;
diff --git a/freetype/include/freetype/ftincrem.h b/freetype/include/freetype/ftincrem.h
index 229b947b..3b3d93c2 100644
--- a/freetype/include/freetype/ftincrem.h
+++ b/freetype/include/freetype/ftincrem.h
@@ -4,7 +4,7 @@
*
* FreeType incremental loading (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftlcdfil.h b/freetype/include/freetype/ftlcdfil.h
index 18e25441..c767c6cb 100644
--- a/freetype/include/freetype/ftlcdfil.h
+++ b/freetype/include/freetype/ftlcdfil.h
@@ -5,7 +5,7 @@
* FreeType API for color filtering of subpixel bitmap glyphs
* (specification).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftlist.h b/freetype/include/freetype/ftlist.h
index 55f01597..4dca2bf1 100644
--- a/freetype/include/freetype/ftlist.h
+++ b/freetype/include/freetype/ftlist.h
@@ -4,7 +4,7 @@
*
* Generic list support for FreeType (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftlogging.h b/freetype/include/freetype/ftlogging.h
index a558b85f..7213dc30 100644
--- a/freetype/include/freetype/ftlogging.h
+++ b/freetype/include/freetype/ftlogging.h
@@ -4,7 +4,7 @@
*
* Additional debugging APIs.
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftlzw.h b/freetype/include/freetype/ftlzw.h
index fce1c9c4..3d7cfd52 100644
--- a/freetype/include/freetype/ftlzw.h
+++ b/freetype/include/freetype/ftlzw.h
@@ -4,7 +4,7 @@
*
* LZW-compressed stream support.
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftmac.h b/freetype/include/freetype/ftmac.h
index 607af9b5..3dd61d0f 100644
--- a/freetype/include/freetype/ftmac.h
+++ b/freetype/include/freetype/ftmac.h
@@ -4,7 +4,7 @@
*
* Additional Mac-specific API.
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftmm.h b/freetype/include/freetype/ftmm.h
index 32579e99..c74ce618 100644
--- a/freetype/include/freetype/ftmm.h
+++ b/freetype/include/freetype/ftmm.h
@@ -4,7 +4,7 @@
*
* FreeType Multiple Master font interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -47,6 +47,9 @@ FT_BEGIN_HEADER
* MM fonts, others will work with all three types. They are similar
* enough that a consistent interface makes sense.
*
+ * For Adobe MM fonts, macro @FT_IS_SFNT returns false. For GX and
+ * OpenType variation fonts, it returns true.
+ *
*/
diff --git a/freetype/include/freetype/ftmodapi.h b/freetype/include/freetype/ftmodapi.h
index b77d356d..b78db724 100644
--- a/freetype/include/freetype/ftmodapi.h
+++ b/freetype/include/freetype/ftmodapi.h
@@ -4,7 +4,7 @@
*
* FreeType modules public interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftmoderr.h b/freetype/include/freetype/ftmoderr.h
index b417cd5a..88d29177 100644
--- a/freetype/include/freetype/ftmoderr.h
+++ b/freetype/include/freetype/ftmoderr.h
@@ -4,7 +4,7 @@
*
* FreeType module error offsets (specification).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftotval.h b/freetype/include/freetype/ftotval.h
index 00f97278..172fcf24 100644
--- a/freetype/include/freetype/ftotval.h
+++ b/freetype/include/freetype/ftotval.h
@@ -4,7 +4,7 @@
*
* FreeType API for validating OpenType tables (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftoutln.h b/freetype/include/freetype/ftoutln.h
index 6bb5f809..46ebf937 100644
--- a/freetype/include/freetype/ftoutln.h
+++ b/freetype/include/freetype/ftoutln.h
@@ -5,7 +5,7 @@
* Support for the FT_Outline type used to store glyph shapes of
* most scalable font formats (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -109,11 +109,13 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * A contour that contains a single point only is represented by a 'move
- * to' operation followed by 'line to' to the same point. In most cases,
- * it is best to filter this out before using the outline for stroking
- * purposes (otherwise it would result in a visible dot when round caps
- * are used).
+ * Degenerate contours, segments, and Bezier arcs may be reported. In
+ * most cases, it is best to filter these out before using the outline
+ * for stroking or other path modification purposes (which may cause
+ * degenerate segments to become non-degenrate and visible, like when
+ * stroke caps are used or the path is otherwise outset). Some glyph
+ * outlines may contain deliberate degenerate single points for mark
+ * attachement.
*
* Similarly, the function returns success for an empty outline also
* (doing nothing, this is, not calling any emitter); if necessary, you
diff --git a/freetype/include/freetype/ftparams.h b/freetype/include/freetype/ftparams.h
index 04a3f441..72080f39 100644
--- a/freetype/include/freetype/ftparams.h
+++ b/freetype/include/freetype/ftparams.h
@@ -4,7 +4,7 @@
*
* FreeType API for possible FT_Parameter tags (specification only).
*
- * Copyright (C) 2017-2021 by
+ * Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -115,6 +115,21 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @enum:
+ * FT_PARAM_TAG_IGNORE_SBIX
+ *
+ * @description:
+ * A tag for @FT_Parameter to make @FT_Open_Face ignore an 'sbix' table
+ * while loading a font. Use this if @FT_FACE_FLAG_SBIX is set and you
+ * want to access the outline glyphs in the font.
+ *
+ */
+#define FT_PARAM_TAG_IGNORE_SBIX \
+ FT_MAKE_TAG( 'i', 's', 'b', 'x' )
+
+
+ /**************************************************************************
+ *
+ * @enum:
* FT_PARAM_TAG_LCD_FILTER_WEIGHTS
*
* @description:
diff --git a/freetype/include/freetype/ftpfr.h b/freetype/include/freetype/ftpfr.h
index fbdb14c2..428e3270 100644
--- a/freetype/include/freetype/ftpfr.h
+++ b/freetype/include/freetype/ftpfr.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing PFR-specific data (specification only).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftrender.h b/freetype/include/freetype/ftrender.h
index 48d489d4..0fab3f8c 100644
--- a/freetype/include/freetype/ftrender.h
+++ b/freetype/include/freetype/ftrender.h
@@ -4,7 +4,7 @@
*
* FreeType renderer modules public interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftsizes.h b/freetype/include/freetype/ftsizes.h
index 22366393..e30938d8 100644
--- a/freetype/include/freetype/ftsizes.h
+++ b/freetype/include/freetype/ftsizes.h
@@ -4,7 +4,7 @@
*
* FreeType size objects management (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftsnames.h b/freetype/include/freetype/ftsnames.h
index c7f6581c..384096a5 100644
--- a/freetype/include/freetype/ftsnames.h
+++ b/freetype/include/freetype/ftsnames.h
@@ -7,7 +7,7 @@
*
* This is _not_ used to retrieve glyph names!
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftstroke.h b/freetype/include/freetype/ftstroke.h
index 88b2a8a4..12c006d3 100644
--- a/freetype/include/freetype/ftstroke.h
+++ b/freetype/include/freetype/ftstroke.h
@@ -4,7 +4,7 @@
*
* FreeType path stroker (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftsynth.h b/freetype/include/freetype/ftsynth.h
index 861dcb5a..afc40b1d 100644
--- a/freetype/include/freetype/ftsynth.h
+++ b/freetype/include/freetype/ftsynth.h
@@ -5,7 +5,7 @@
* FreeType synthesizing code for emboldening and slanting
* (specification).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftsystem.h b/freetype/include/freetype/ftsystem.h
index e5abb85a..5f8aec7b 100644
--- a/freetype/include/freetype/ftsystem.h
+++ b/freetype/include/freetype/ftsystem.h
@@ -4,7 +4,7 @@
*
* FreeType low-level system interface definition (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/fttrigon.h b/freetype/include/freetype/fttrigon.h
index dbe7b0d3..4e8d871d 100644
--- a/freetype/include/freetype/fttrigon.h
+++ b/freetype/include/freetype/fttrigon.h
@@ -4,7 +4,7 @@
*
* FreeType trigonometric functions (specification).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/fttypes.h b/freetype/include/freetype/fttypes.h
index 699bd003..29f32fbb 100644
--- a/freetype/include/freetype/fttypes.h
+++ b/freetype/include/freetype/fttypes.h
@@ -4,7 +4,7 @@
*
* FreeType simple types definitions (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/ftwinfnt.h b/freetype/include/freetype/ftwinfnt.h
index f30f447d..294f85ae 100644
--- a/freetype/include/freetype/ftwinfnt.h
+++ b/freetype/include/freetype/ftwinfnt.h
@@ -4,7 +4,7 @@
*
* FreeType API for accessing Windows fnt-specific data.
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/autohint.h b/freetype/include/freetype/internal/autohint.h
index 01585f5e..aedf4898 100644
--- a/freetype/include/freetype/internal/autohint.h
+++ b/freetype/include/freetype/internal/autohint.h
@@ -4,7 +4,7 @@
*
* High-level 'autohint' module-specific interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/cffotypes.h b/freetype/include/freetype/internal/cffotypes.h
index a91dd556..700f586c 100644
--- a/freetype/include/freetype/internal/cffotypes.h
+++ b/freetype/include/freetype/internal/cffotypes.h
@@ -4,7 +4,7 @@
*
* Basic OpenType/CFF object type definitions (specification).
*
- * Copyright (C) 2017-2021 by
+ * Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/cfftypes.h b/freetype/include/freetype/internal/cfftypes.h
index 99e8d413..23d26c1b 100644
--- a/freetype/include/freetype/internal/cfftypes.h
+++ b/freetype/include/freetype/internal/cfftypes.h
@@ -5,7 +5,7 @@
* Basic OpenType/CFF type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/compiler-macros.h b/freetype/include/freetype/internal/compiler-macros.h
index d8b61b3d..4c3b2ffe 100644
--- a/freetype/include/freetype/internal/compiler-macros.h
+++ b/freetype/include/freetype/internal/compiler-macros.h
@@ -4,7 +4,7 @@
*
* Compiler-specific macro definitions used internally by FreeType.
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -259,7 +259,9 @@ FT_BEGIN_HEADER
*/
/* See `freetype/config/compiler_macros.h` for the `FT_EXPORT` definition */
+#ifndef FT_EXPORT_DEF
#define FT_EXPORT_DEF( x ) FT_FUNCTION_DEFINITION( x )
+#endif
/*
* The following macros are needed to compile the library with a
@@ -299,10 +301,12 @@ FT_BEGIN_HEADER
#define FT_CALLBACK_DEF( x ) static x
#endif
-#if defined( __i386__ )
+#if defined( __GNUC__ ) && defined( __i386__ )
#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x ) __attribute__(( cdecl ))
-#elif defined( _M_IX86 )
+#elif defined( _MSC_VER ) && defined( _M_IX86 )
#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x ) __cdecl
+#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1240
+#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x ) __watcall
#else
#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x )
#endif
diff --git a/freetype/include/freetype/internal/ftcalc.h b/freetype/include/freetype/internal/ftcalc.h
index f88e0553..e6a87db9 100644
--- a/freetype/include/freetype/internal/ftcalc.h
+++ b/freetype/include/freetype/internal/ftcalc.h
@@ -4,7 +4,7 @@
*
* Arithmetic computations (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -408,6 +408,19 @@ FT_BEGIN_HEADER
#endif
+#elif defined( __WATCOMC__ ) && defined( __386__ )
+
+ extern __inline FT_Int32
+ FT_MSB_i386( FT_UInt32 x );
+
+#pragma aux FT_MSB_i386 = \
+ "bsr eax, eax" \
+ parm [eax] nomemory \
+ value [eax] \
+ modify exact [eax] nomemory;
+
+#define FT_MSB( x ) FT_MSB_i386( x )
+
#elif defined( __DECC ) || defined( __DECCXX )
#include <builtins.h>
diff --git a/freetype/include/freetype/internal/ftdebug.h b/freetype/include/freetype/internal/ftdebug.h
index 5e8d9294..f05b1395 100644
--- a/freetype/include/freetype/internal/ftdebug.h
+++ b/freetype/include/freetype/internal/ftdebug.h
@@ -4,7 +4,7 @@
*
* Debugging and logging component (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/ftdrv.h b/freetype/include/freetype/internal/ftdrv.h
index 0db323d5..9459a9a1 100644
--- a/freetype/include/freetype/internal/ftdrv.h
+++ b/freetype/include/freetype/internal/ftdrv.h
@@ -4,7 +4,7 @@
*
* FreeType internal font driver interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/ftgloadr.h b/freetype/include/freetype/internal/ftgloadr.h
index fea931c3..f73b6631 100644
--- a/freetype/include/freetype/internal/ftgloadr.h
+++ b/freetype/include/freetype/internal/ftgloadr.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph loader (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/ftmemory.h b/freetype/include/freetype/internal/ftmemory.h
index e20d9496..10d753aa 100644
--- a/freetype/include/freetype/internal/ftmemory.h
+++ b/freetype/include/freetype/internal/ftmemory.h
@@ -4,7 +4,7 @@
*
* The FreeType memory management macros (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/ftobjs.h b/freetype/include/freetype/internal/ftobjs.h
index e52a26aa..1c779cea 100644
--- a/freetype/include/freetype/internal/ftobjs.h
+++ b/freetype/include/freetype/internal/ftobjs.h
@@ -4,7 +4,7 @@
*
* The FreeType private base classes (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -418,7 +418,8 @@ FT_BEGIN_HEADER
* initializing the glyph slot.
*/
-#define FT_GLYPH_OWN_BITMAP 0x1U
+#define FT_GLYPH_OWN_BITMAP 0x1U
+#define FT_GLYPH_OWN_GZIP_SVG 0x2U
typedef struct FT_Slot_InternalRec_
{
diff --git a/freetype/include/freetype/internal/ftpsprop.h b/freetype/include/freetype/internal/ftpsprop.h
index d94d0d7e..47373211 100644
--- a/freetype/include/freetype/internal/ftpsprop.h
+++ b/freetype/include/freetype/internal/ftpsprop.h
@@ -4,7 +4,7 @@
*
* Get and set properties of PostScript drivers (specification).
*
- * Copyright (C) 2017-2021 by
+ * Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/ftrfork.h b/freetype/include/freetype/internal/ftrfork.h
index 1c56d6ce..165e67f2 100644
--- a/freetype/include/freetype/internal/ftrfork.h
+++ b/freetype/include/freetype/internal/ftrfork.h
@@ -4,7 +4,7 @@
*
* Embedded resource forks accessor (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* Masatake YAMATO and Redhat K.K.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/ftserv.h b/freetype/include/freetype/internal/ftserv.h
index fa82c31f..78996d9c 100644
--- a/freetype/include/freetype/internal/ftserv.h
+++ b/freetype/include/freetype/internal/ftserv.h
@@ -4,7 +4,7 @@
*
* The FreeType services (specification only).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/ftstream.h b/freetype/include/freetype/internal/ftstream.h
index 7f3af120..aa51fe5a 100644
--- a/freetype/include/freetype/internal/ftstream.h
+++ b/freetype/include/freetype/internal/ftstream.h
@@ -4,7 +4,7 @@
*
* Stream handling (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/fttrace.h b/freetype/include/freetype/internal/fttrace.h
index 3307556b..43c6a871 100644
--- a/freetype/include/freetype/internal/fttrace.h
+++ b/freetype/include/freetype/internal/fttrace.h
@@ -4,7 +4,7 @@
*
* Tracing handling (specification only).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -49,6 +49,9 @@ FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
+ /* ot-svg module */
+FT_TRACE_DEF( otsvg ) /* OT-SVG renderer (ftsvg.c) */
+
/* cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
@@ -61,6 +64,7 @@ FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */
FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */
+FT_TRACE_DEF( ttsvg ) /* OpenType SVG table (ttsvg.c) */
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
diff --git a/freetype/include/freetype/internal/ftvalid.h b/freetype/include/freetype/internal/ftvalid.h
index 7bdfa62f..171c2cb6 100644
--- a/freetype/include/freetype/internal/ftvalid.h
+++ b/freetype/include/freetype/internal/ftvalid.h
@@ -4,7 +4,7 @@
*
* FreeType validation support (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/psaux.h b/freetype/include/freetype/internal/psaux.h
index 6c6399aa..48ec1df9 100644
--- a/freetype/include/freetype/internal/psaux.h
+++ b/freetype/include/freetype/internal/psaux.h
@@ -5,7 +5,7 @@
* Auxiliary functions and data structures related to PostScript fonts
* (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/pshints.h b/freetype/include/freetype/internal/pshints.h
index 9dbb0776..5de83e45 100644
--- a/freetype/include/freetype/internal/pshints.h
+++ b/freetype/include/freetype/internal/pshints.h
@@ -6,7 +6,7 @@
* recorders (specification only). These are used to support native
* T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svbdf.h b/freetype/include/freetype/internal/services/svbdf.h
index 879aa613..06e3b531 100644
--- a/freetype/include/freetype/internal/services/svbdf.h
+++ b/freetype/include/freetype/internal/services/svbdf.h
@@ -4,7 +4,7 @@
*
* The FreeType BDF services (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svcfftl.h b/freetype/include/freetype/internal/services/svcfftl.h
index f6424e42..1dea6bcd 100644
--- a/freetype/include/freetype/internal/services/svcfftl.h
+++ b/freetype/include/freetype/internal/services/svcfftl.h
@@ -4,7 +4,7 @@
*
* The FreeType CFF tables loader service (specification).
*
- * Copyright (C) 2017-2021 by
+ * Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svcid.h b/freetype/include/freetype/internal/services/svcid.h
index 7ef5afd0..acf9178d 100644
--- a/freetype/include/freetype/internal/services/svcid.h
+++ b/freetype/include/freetype/internal/services/svcid.h
@@ -4,7 +4,7 @@
*
* The FreeType CID font services (specification).
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* Derek Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svfntfmt.h b/freetype/include/freetype/internal/services/svfntfmt.h
index cc87fc12..a7280319 100644
--- a/freetype/include/freetype/internal/services/svfntfmt.h
+++ b/freetype/include/freetype/internal/services/svfntfmt.h
@@ -4,7 +4,7 @@
*
* The FreeType font format service (specification only).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svgldict.h b/freetype/include/freetype/internal/services/svgldict.h
index 4256f14a..489021d8 100644
--- a/freetype/include/freetype/internal/services/svgldict.h
+++ b/freetype/include/freetype/internal/services/svgldict.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph dictionary services (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svgxval.h b/freetype/include/freetype/internal/services/svgxval.h
index f36d5560..59ae411b 100644
--- a/freetype/include/freetype/internal/services/svgxval.h
+++ b/freetype/include/freetype/internal/services/svgxval.h
@@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/include/freetype/internal/services/svkern.h b/freetype/include/freetype/internal/services/svkern.h
index 99dc2d97..c567acad 100644
--- a/freetype/include/freetype/internal/services/svkern.h
+++ b/freetype/include/freetype/internal/services/svkern.h
@@ -4,7 +4,7 @@
*
* The FreeType Kerning service (specification).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svmetric.h b/freetype/include/freetype/internal/services/svmetric.h
index b9c95a7c..7accdc46 100644
--- a/freetype/include/freetype/internal/services/svmetric.h
+++ b/freetype/include/freetype/internal/services/svmetric.h
@@ -4,7 +4,7 @@
*
* The FreeType services for metrics variations (specification).
*
- * Copyright (C) 2016-2021 by
+ * Copyright (C) 2016-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svmm.h b/freetype/include/freetype/internal/services/svmm.h
index 8eac3a3f..c6394890 100644
--- a/freetype/include/freetype/internal/services/svmm.h
+++ b/freetype/include/freetype/internal/services/svmm.h
@@ -4,7 +4,7 @@
*
* The FreeType Multiple Masters and GX var services (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svotval.h b/freetype/include/freetype/internal/services/svotval.h
index 7afb49e8..3c72d1f8 100644
--- a/freetype/include/freetype/internal/services/svotval.h
+++ b/freetype/include/freetype/internal/services/svotval.h
@@ -4,7 +4,7 @@
*
* The FreeType OpenType validation service (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svpfr.h b/freetype/include/freetype/internal/services/svpfr.h
index 98442bf8..bde0ed35 100644
--- a/freetype/include/freetype/internal/services/svpfr.h
+++ b/freetype/include/freetype/internal/services/svpfr.h
@@ -4,7 +4,7 @@
*
* Internal PFR service functions (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svpostnm.h b/freetype/include/freetype/internal/services/svpostnm.h
index 5a25c5a5..05f6291e 100644
--- a/freetype/include/freetype/internal/services/svpostnm.h
+++ b/freetype/include/freetype/internal/services/svpostnm.h
@@ -4,7 +4,7 @@
*
* The FreeType PostScript name services (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svprop.h b/freetype/include/freetype/internal/services/svprop.h
index 9b71000c..29c56864 100644
--- a/freetype/include/freetype/internal/services/svprop.h
+++ b/freetype/include/freetype/internal/services/svprop.h
@@ -4,7 +4,7 @@
*
* The FreeType property service (specification).
*
- * Copyright (C) 2012-2021 by
+ * Copyright (C) 2012-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svpscmap.h b/freetype/include/freetype/internal/services/svpscmap.h
index 346f5e2a..7d586587 100644
--- a/freetype/include/freetype/internal/services/svpscmap.h
+++ b/freetype/include/freetype/internal/services/svpscmap.h
@@ -4,7 +4,7 @@
*
* The FreeType PostScript charmap service (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svpsinfo.h b/freetype/include/freetype/internal/services/svpsinfo.h
index 49aa4d56..6e45f327 100644
--- a/freetype/include/freetype/internal/services/svpsinfo.h
+++ b/freetype/include/freetype/internal/services/svpsinfo.h
@@ -4,7 +4,7 @@
*
* The FreeType PostScript info service (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svsfnt.h b/freetype/include/freetype/internal/services/svsfnt.h
index 4306cbc1..03938a56 100644
--- a/freetype/include/freetype/internal/services/svsfnt.h
+++ b/freetype/include/freetype/internal/services/svsfnt.h
@@ -4,7 +4,7 @@
*
* The FreeType SFNT table loading service (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svttcmap.h b/freetype/include/freetype/internal/services/svttcmap.h
index 775b6bcf..a0b1bbd2 100644
--- a/freetype/include/freetype/internal/services/svttcmap.h
+++ b/freetype/include/freetype/internal/services/svttcmap.h
@@ -4,7 +4,7 @@
*
* The FreeType TrueType/sfnt cmap extra information service.
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* Masatake YAMATO, Redhat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/include/freetype/internal/services/svtteng.h b/freetype/include/freetype/internal/services/svtteng.h
index 96493428..f8396eb0 100644
--- a/freetype/include/freetype/internal/services/svtteng.h
+++ b/freetype/include/freetype/internal/services/svtteng.h
@@ -4,7 +4,7 @@
*
* The FreeType TrueType engine query service (specification).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svttglyf.h b/freetype/include/freetype/internal/services/svttglyf.h
index 4268467b..982630c0 100644
--- a/freetype/include/freetype/internal/services/svttglyf.h
+++ b/freetype/include/freetype/internal/services/svttglyf.h
@@ -4,7 +4,7 @@
*
* The FreeType TrueType glyph service.
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* David Turner.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/services/svwinfnt.h b/freetype/include/freetype/internal/services/svwinfnt.h
index aa70aa44..950f4a88 100644
--- a/freetype/include/freetype/internal/services/svwinfnt.h
+++ b/freetype/include/freetype/internal/services/svwinfnt.h
@@ -4,7 +4,7 @@
*
* The FreeType Windows FNT/FONT service (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/sfnt.h b/freetype/include/freetype/internal/sfnt.h
index bf4c7e09..c67b47e8 100644
--- a/freetype/include/freetype/internal/sfnt.h
+++ b/freetype/include/freetype/internal/sfnt.h
@@ -4,7 +4,7 @@
*
* High-level 'sfnt' driver interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -314,6 +314,33 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @functype:
+ * TT_Load_Svg_Doc_Func
+ *
+ * @description:
+ * Scan the SVG document list to find the document containing the glyph
+ * that has the ID 'glyph*XXX*', where *XXX* is the value of
+ * `glyph_index` as a decimal integer.
+ *
+ * @inout:
+ * glyph ::
+ * The glyph slot from which pointers to the SVG document list is to be
+ * grabbed. The results are stored back in the slot.
+ *
+ * @input:
+ * glyph_index ::
+ * The index of the glyph that is to be looked up.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ */
+ typedef FT_Error
+ (*TT_Load_Svg_Doc_Func)( FT_GlyphSlot glyph,
+ FT_UInt glyph_index );
+
+
+ /**************************************************************************
+ *
+ * @functype:
* TT_Set_SBit_Strike_Func
*
* @description:
@@ -946,6 +973,11 @@ FT_BEGIN_HEADER
TT_Get_Name_Func get_name;
TT_Get_Name_ID_Func get_name_id;
+ /* OpenType SVG Support */
+ TT_Load_Table_Func load_svg;
+ TT_Free_Table_Func free_svg;
+ TT_Load_Svg_Doc_Func load_svg_doc;
+
} SFNT_Interface;
@@ -997,7 +1029,10 @@ FT_BEGIN_HEADER
colr_blend_, \
get_metrics_, \
get_name_, \
- get_name_id_ ) \
+ get_name_id_, \
+ load_svg_, \
+ free_svg_, \
+ load_svg_doc_ ) \
static const SFNT_Interface class_ = \
{ \
goto_table_, \
@@ -1042,7 +1077,10 @@ FT_BEGIN_HEADER
colr_blend_, \
get_metrics_, \
get_name_, \
- get_name_id_ \
+ get_name_id_, \
+ load_svg_, \
+ free_svg_, \
+ load_svg_doc_ \
};
diff --git a/freetype/include/freetype/internal/svginterface.h b/freetype/include/freetype/internal/svginterface.h
new file mode 100644
index 00000000..1b325e5e
--- /dev/null
+++ b/freetype/include/freetype/internal/svginterface.h
@@ -0,0 +1,46 @@
+/****************************************************************************
+ *
+ * svginterface.h
+ *
+ * Interface of ot-svg module (specification only).
+ *
+ * Copyright (C) 2022 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * 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 SVGINTERFACE_H_
+#define SVGINTERFACE_H_
+
+#include <ft2build.h>
+#include <freetype/otsvg.h>
+
+
+FT_BEGIN_HEADER
+
+ typedef FT_Error
+ (*Preset_Bitmap_Func)( FT_Module module,
+ FT_GlyphSlot slot,
+ FT_Bool cache );
+
+ typedef struct SVG_Interface_
+ {
+ Preset_Bitmap_Func preset_slot;
+
+ } SVG_Interface;
+
+ typedef SVG_Interface* SVG_Service;
+
+FT_END_HEADER
+
+#endif /* SVGINTERFACE_H_ */
+
+
+/* END */
diff --git a/freetype/include/freetype/internal/t1types.h b/freetype/include/freetype/internal/t1types.h
index 023c5d08..b6a3de14 100644
--- a/freetype/include/freetype/internal/t1types.h
+++ b/freetype/include/freetype/internal/t1types.h
@@ -5,7 +5,7 @@
* Basic Type1/Type2 type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/internal/tttypes.h b/freetype/include/freetype/internal/tttypes.h
index 651131c8..df719387 100644
--- a/freetype/include/freetype/internal/tttypes.h
+++ b/freetype/include/freetype/internal/tttypes.h
@@ -5,7 +5,7 @@
* Basic SFNT/TrueType type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -1390,8 +1390,8 @@ FT_BEGIN_HEADER
* hdmx_record_size ::
* The size of a single hdmx record.
*
- * hdmx_record_sizes ::
- * An array holding the ppem sizes available in the 'hdmx' table.
+ * hdmx_records ::
+ * A array of pointers to the 'hdmx' table records sorted by ppem.
*
* sbit_table ::
* A pointer to the font's embedded bitmap location table.
@@ -1605,7 +1605,7 @@ FT_BEGIN_HEADER
FT_ULong hdmx_table_size;
FT_UInt hdmx_record_count;
FT_ULong hdmx_record_size;
- FT_Byte* hdmx_record_sizes;
+ FT_Byte** hdmx_records;
FT_Byte* sbit_table;
FT_ULong sbit_table_size;
@@ -1644,6 +1644,9 @@ FT_BEGIN_HEADER
void* cpal;
void* colr;
+ /* since 2.12 */
+ void* svg;
+
} TT_FaceRec;
@@ -1769,6 +1772,9 @@ FT_BEGIN_HEADER
/* since version 2.6.2 */
FT_ListRec composites;
+ /* since version 2.11.2 */
+ FT_Byte* widthp;
+
} TT_LoaderRec;
diff --git a/freetype/include/freetype/internal/wofftypes.h b/freetype/include/freetype/internal/wofftypes.h
index c460107c..94804fa7 100644
--- a/freetype/include/freetype/internal/wofftypes.h
+++ b/freetype/include/freetype/internal/wofftypes.h
@@ -5,7 +5,7 @@
* Basic WOFF/WOFF2 type definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/otsvg.h b/freetype/include/freetype/otsvg.h
new file mode 100644
index 00000000..2caadfde
--- /dev/null
+++ b/freetype/include/freetype/otsvg.h
@@ -0,0 +1,336 @@
+/****************************************************************************
+ *
+ * otsvg.h
+ *
+ * Interface for OT-SVG support related things (specification).
+ *
+ * Copyright (C) 2022 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * 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 OTSVG_H_
+#define OTSVG_H_
+
+#include <freetype/freetype.h>
+
+#ifdef FREETYPE_H
+#error "freetype.h of FreeType 1 has been loaded!"
+#error "Please fix the directory search order for header files"
+#error "so that freetype.h of FreeType 2 is found first."
+#endif
+
+
+FT_BEGIN_HEADER
+
+
+ /**************************************************************************
+ *
+ * @section:
+ * svg_fonts
+ *
+ * @title:
+ * OpenType SVG Fonts
+ *
+ * @abstract:
+ * OT-SVG API between FreeType and an external SVG rendering library.
+ *
+ * @description:
+ * This section describes the four hooks necessary to render SVG
+ * 'documents' that are contained in an OpenType font's 'SVG~' table.
+ *
+ * For more information on the implementation, see our standard hooks
+ * based on 'librsvg' in the [FreeType Demo
+ * Programs](https://gitlab.freedesktop.org/freetype/freetype-demos)
+ * repository.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * SVG_Lib_Init_Func
+ *
+ * @description:
+ * A callback that is called when the first OT-SVG glyph is rendered in
+ * the lifetime of an @FT_Library object. In a typical implementation,
+ * one would want to allocate a structure and point the `data_pointer`
+ * to it and perform any library initializations that might be needed.
+ *
+ * @inout:
+ * data_pointer ::
+ * The SVG rendering module stores a pointer variable that can be used
+ * by clients to store any data that needs to be shared across
+ * different hooks. `data_pointer` is essentially a pointer to that
+ * pointer such that it can be written to as well as read from.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef FT_Error
+ (*SVG_Lib_Init_Func)( FT_Pointer *data_pointer );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * SVG_Lib_Free_Func
+ *
+ * @description:
+ * A callback that is called when the `ot-svg` module is being freed.
+ * It is only called if the init hook was called earlier. This means
+ * that neither the init nor the free hook is called if no OT-SVG glyph
+ * is rendered.
+ *
+ * In a typical implementation, one would want to free any state
+ * structure that was allocated in the init hook and perform any
+ * library-related closure that might be needed.
+ *
+ * @inout:
+ * data_pointer ::
+ * The SVG rendering module stores a pointer variable that can be used
+ * by clients to store any data that needs to be shared across
+ * different hooks. `data_pointer` is essentially a pointer to that
+ * pointer such that it can be written to as well as read from.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef void
+ (*SVG_Lib_Free_Func)( FT_Pointer *data_pointer );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * SVG_Lib_Render_Func
+ *
+ * @description:
+ * A callback that is called to render an OT-SVG glyph. This callback
+ * hook is called right after the preset hook @SVG_Lib_Preset_Slot_Func
+ * has been called with `cache` set to `TRUE`. The data necessary to
+ * render is available through the handle @FT_SVG_Document, which is set
+ * in the `other` field of @FT_GlyphSlotRec.
+ *
+ * The render hook is expected to render the SVG glyph to the bitmap
+ * buffer that is allocated already at `slot->bitmap.buffer`. It also
+ * sets the `num_grays` value as well as `slot->format`.
+ *
+ * @input:
+ * slot ::
+ * The slot to render.
+ *
+ * @inout:
+ * data_pointer ::
+ * The SVG rendering module stores a pointer variable that can be used
+ * by clients to store any data that needs to be shared across
+ * different hooks. `data_pointer` is essentially a pointer to that
+ * pointer such that it can be written to as well as read from.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef FT_Error
+ (*SVG_Lib_Render_Func)( FT_GlyphSlot slot,
+ FT_Pointer *data_pointer );
+
+
+ /**************************************************************************
+ *
+ * @functype:
+ * SVG_Lib_Preset_Slot_Func
+ *
+ * @description:
+ * A callback that is called to preset the glyph slot. It is called from
+ * two places.
+ *
+ * 1. When `FT_Load_Glyph` needs to preset the glyph slot.
+ *
+ * 2. Right before the `svg` module calls the render callback hook.
+ *
+ * When it is the former, the argument `cache` is set to `FALSE`. When
+ * it is the latter, the argument `cache` is set to `TRUE`. This
+ * distinction has been made because many calculations that are necessary
+ * for presetting a glyph slot are the same needed later for the render
+ * callback hook. Thus, if `cache` is `TRUE`, the hook can _cache_ those
+ * calculations in a memory block referenced by the state pointer.
+ *
+ * This hook is expected to preset the slot by setting parameters such as
+ * `bitmap_left`, `bitmap_top`, `width`, `rows`, `pitch`, and
+ * `pixel_mode`. It is also expected to set all the metrics for the slot
+ * including the vertical advance if it is not already set. Typically,
+ * fonts have horizontal advances but not vertical ones. If those are
+ * available, they had already been set, otherwise they have to be
+ * estimated and set manually. The hook must take into account the
+ * transformations that have been set, and translate the transformation
+ * matrices into the SVG coordinate system, as the original matrix is
+ * intended for the TTF/CFF coordinate system.
+ *
+ * @input:
+ * slot ::
+ * The glyph slot that has the SVG document loaded.
+ *
+ * cache ::
+ * See description.
+ *
+ * @inout:
+ * data_pointer ::
+ * The SVG rendering module stores a pointer variable that can be used
+ * by clients to store any data that needs to be shared across
+ * different hooks. `data_pointer` is essentially a pointer to that
+ * pointer such that it can be written to as well as read from.
+ *
+ * @return:
+ * FreeType error code. 0 means success.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef FT_Error
+ (*SVG_Lib_Preset_Slot_Func)( FT_GlyphSlot slot,
+ FT_Bool cache,
+ FT_Pointer *state );
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * SVG_RendererHooks
+ *
+ * @description:
+ * A structure that stores the four hooks needed to render OT-SVG glyphs
+ * properly. The structure is publicly used to set the hooks via the
+ * @svg-hooks driver property.
+ *
+ * The behavior of each hook is described in its documentation. One
+ * thing to note is that the preset hook and the render hook often need
+ * to do the same operations; therefore, it's better to cache the
+ * intermediate data in a state structure to avoid calculating it twice.
+ * For example, in the preset hook one can draw the glyph on a recorder
+ * surface and later create a bitmap surface from it in the render hook.
+ *
+ * All four hooks must be non-NULL.
+ *
+ * @fields:
+ * init_svg ::
+ * The initialization hook.
+ *
+ * free_svg ::
+ * The cleanup hook.
+ *
+ * render_hook ::
+ * The render hook.
+ *
+ * preset_slot ::
+ * The preset hook.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef struct SVG_RendererHooks_
+ {
+ SVG_Lib_Init_Func init_svg;
+ SVG_Lib_Free_Func free_svg;
+ SVG_Lib_Render_Func render_svg;
+
+ SVG_Lib_Preset_Slot_Func preset_slot;
+
+ } SVG_RendererHooks;
+
+
+ /**************************************************************************
+ *
+ * @struct:
+ * FT_SVG_DocumentRec
+ *
+ * @description:
+ * A structure that models one SVG document.
+ *
+ * @fields:
+ * svg_document ::
+ * A pointer to the SVG document.
+ *
+ * svg_document_length ::
+ * The length of `svg_document`.
+ *
+ * metrics ::
+ * A metrics object storing the size information.
+ *
+ * units_per_EM ::
+ * The size of the EM square.
+ *
+ * start_glyph_id ::
+ * The first glyph ID in the glyph range covered by this document.
+ *
+ * end_glyph_id ::
+ * The last glyph ID in the glyph range covered by this document.
+ *
+ * transform ::
+ * A 2x2 transformation matrix to apply to the glyph while rendering
+ * it.
+ *
+ * delta ::
+ * The translation to apply to the glyph while rendering.
+ *
+ * @note:
+ * When an @FT_GlyphSlot object `slot` is passed down to a renderer, the
+ * renderer can only access the `metrics` and `units_per_EM` fields via
+ * `slot->face`. However, when @FT_Glyph_To_Bitmap sets up a dummy
+ * object, it has no way to set a `face` object. Thus, metrics
+ * information and `units_per_EM` (which is necessary for OT-SVG) has to
+ * be stored separately.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef struct FT_SVG_DocumentRec_
+ {
+ FT_Byte* svg_document;
+ FT_ULong svg_document_length;
+
+ FT_Size_Metrics metrics;
+ FT_UShort units_per_EM;
+
+ FT_UShort start_glyph_id;
+ FT_UShort end_glyph_id;
+
+ FT_Matrix transform;
+ FT_Vector delta;
+
+ } FT_SVG_DocumentRec;
+
+
+ /**************************************************************************
+ *
+ * @type:
+ * FT_SVG_Document
+ *
+ * @description:
+ * A handle to an @FT_SVG_DocumentRec object.
+ *
+ * @since:
+ * 2.12
+ */
+ typedef struct FT_SVG_DocumentRec_* FT_SVG_Document;
+
+
+FT_END_HEADER
+
+#endif /* OTSVG_H_ */
+
+
+/* END */
diff --git a/freetype/include/freetype/t1tables.h b/freetype/include/freetype/t1tables.h
index a5f6ae72..4068b204 100644
--- a/freetype/include/freetype/t1tables.h
+++ b/freetype/include/freetype/t1tables.h
@@ -5,7 +5,7 @@
* Basic Type 1/Type 2 tables definitions and interface (specification
* only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -453,22 +453,22 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
- * FT_Has_PS_Glyph_Names
+ * FT_Has_PS_Glyph_Names
*
* @description:
- * Return true if a given face provides reliable PostScript glyph names.
- * This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
- * certain fonts (mostly TrueType) contain incorrect glyph name tables.
+ * Return true if a given face provides reliable PostScript glyph names.
+ * This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
+ * certain fonts (mostly TrueType) contain incorrect glyph name tables.
*
- * When this function returns true, the caller is sure that the glyph
- * names returned by @FT_Get_Glyph_Name are reliable.
+ * When this function returns true, the caller is sure that the glyph
+ * names returned by @FT_Get_Glyph_Name are reliable.
*
* @input:
- * face ::
- * face handle
+ * face ::
+ * face handle
*
* @return:
- * Boolean. True if glyph names are reliable.
+ * Boolean. True if glyph names are reliable.
*
*/
FT_EXPORT( FT_Int )
@@ -478,30 +478,40 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
- * FT_Get_PS_Font_Info
+ * FT_Get_PS_Font_Info
*
* @description:
- * Retrieve the @PS_FontInfoRec structure corresponding to a given
- * PostScript font.
+ * Retrieve the @PS_FontInfoRec structure corresponding to a given
+ * PostScript font.
*
* @input:
- * face ::
- * PostScript face handle.
+ * face ::
+ * PostScript face handle.
*
* @output:
- * afont_info ::
- * Output font info structure pointer.
+ * afont_info ::
+ * A pointer to a @PS_FontInfoRec object.
*
* @return:
- * FreeType error code. 0~means success.
+ * FreeType error code. 0~means success.
*
* @note:
- * String pointers within the @PS_FontInfoRec structure are owned by the
- * face and don't need to be freed by the caller. Missing entries in
- * the font's FontInfo dictionary are represented by `NULL` pointers.
+ * String pointers within the @PS_FontInfoRec structure are owned by the
+ * face and don't need to be freed by the caller. Missing entries in the
+ * font's FontInfo dictionary are represented by `NULL` pointers.
+ *
+ * The following font formats support this feature: 'Type~1', 'Type~42',
+ * 'CFF', 'CID~Type~1'. For other font formats this function returns the
+ * `FT_Err_Invalid_Argument` error code.
*
- * If the font's format is not PostScript-based, this function will
- * return the `FT_Err_Invalid_Argument` error code.
+ * @example:
+ * ```
+ * PS_FontInfoRec font_info;
+ *
+ *
+ * error = FT_Get_PS_Font_Info( face, &font_info );
+ * ...
+ * ```
*
*/
FT_EXPORT( FT_Error )
@@ -512,29 +522,39 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
- * FT_Get_PS_Font_Private
+ * FT_Get_PS_Font_Private
*
* @description:
- * Retrieve the @PS_PrivateRec structure corresponding to a given
- * PostScript font.
+ * Retrieve the @PS_PrivateRec structure corresponding to a given
+ * PostScript font.
*
* @input:
- * face ::
- * PostScript face handle.
+ * face ::
+ * PostScript face handle.
*
* @output:
- * afont_private ::
- * Output private dictionary structure pointer.
+ * afont_private ::
+ * A pointer to a @PS_PrivateRec object.
*
* @return:
- * FreeType error code. 0~means success.
+ * FreeType error code. 0~means success.
*
* @note:
- * The string pointers within the @PS_PrivateRec structure are owned by
- * the face and don't need to be freed by the caller.
+ * The string pointers within the @PS_PrivateRec structure are owned by
+ * the face and don't need to be freed by the caller.
*
- * If the font's format is not PostScript-based, this function returns
- * the `FT_Err_Invalid_Argument` error code.
+ * Only the 'Type~1' font format supports this feature. For other font
+ * formats this function returns the `FT_Err_Invalid_Argument` error
+ * code.
+ *
+ * @example:
+ * ```
+ * PS_PrivateRec font_private;
+ *
+ *
+ * error = FT_Get_PS_Font_Private( face, &font_private );
+ * ...
+ * ```
*
*/
FT_EXPORT( FT_Error )
@@ -693,67 +713,67 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
- * FT_Get_PS_Font_Value
+ * FT_Get_PS_Font_Value
*
* @description:
- * Retrieve the value for the supplied key from a PostScript font.
+ * Retrieve the value for the supplied key from a PostScript font.
*
* @input:
- * face ::
- * PostScript face handle.
+ * face ::
+ * PostScript face handle.
*
- * key ::
- * An enumeration value representing the dictionary key to retrieve.
+ * key ::
+ * An enumeration value representing the dictionary key to retrieve.
*
- * idx ::
- * For array values, this specifies the index to be returned.
+ * idx ::
+ * For array values, this specifies the index to be returned.
*
- * value ::
- * A pointer to memory into which to write the value.
+ * value ::
+ * A pointer to memory into which to write the value.
*
- * valen_len ::
- * The size, in bytes, of the memory supplied for the value.
+ * valen_len ::
+ * The size, in bytes, of the memory supplied for the value.
*
* @output:
- * value ::
- * The value matching the above key, if it exists.
+ * value ::
+ * The value matching the above key, if it exists.
*
* @return:
- * The amount of memory (in bytes) required to hold the requested value
- * (if it exists, -1 otherwise).
+ * The amount of memory (in bytes) required to hold the requested value
+ * (if it exists, -1 otherwise).
*
* @note:
- * The values returned are not pointers into the internal structures of
- * the face, but are 'fresh' copies, so that the memory containing them
- * belongs to the calling application. This also enforces the
- * 'read-only' nature of these values, i.e., this function cannot be
- * used to manipulate the face.
+ * The values returned are not pointers into the internal structures of
+ * the face, but are 'fresh' copies, so that the memory containing them
+ * belongs to the calling application. This also enforces the
+ * 'read-only' nature of these values, i.e., this function cannot be
+ * used to manipulate the face.
*
- * `value` is a void pointer because the values returned can be of
- * various types.
+ * `value` is a void pointer because the values returned can be of
+ * various types.
*
- * If either `value` is `NULL` or `value_len` is too small, just the
- * required memory size for the requested entry is returned.
+ * If either `value` is `NULL` or `value_len` is too small, just the
+ * required memory size for the requested entry is returned.
*
- * The `idx` parameter is used, not only to retrieve elements of, for
- * example, the FontMatrix or FontBBox, but also to retrieve name keys
- * from the CharStrings dictionary, and the charstrings themselves. It
- * is ignored for atomic values.
+ * The `idx` parameter is used, not only to retrieve elements of, for
+ * example, the FontMatrix or FontBBox, but also to retrieve name keys
+ * from the CharStrings dictionary, and the charstrings themselves. It
+ * is ignored for atomic values.
*
- * `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
- * get the value as in the font stream, you need to divide by 65536000.0
- * (to remove the FT_Fixed scale, and the x1000 scale).
+ * `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
+ * get the value as in the font stream, you need to divide by 65536000.0
+ * (to remove the FT_Fixed scale, and the x1000 scale).
*
- * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
- * be retrieved. So, for example, PostScript procedures such as NP, ND,
- * and RD are not available. Arbitrary keys are, obviously, not be
- * available either.
+ * IMPORTANT: Only key/value pairs read by the FreeType interpreter can
+ * be retrieved. So, for example, PostScript procedures such as NP, ND,
+ * and RD are not available. Arbitrary keys are, obviously, not be
+ * available either.
*
- * If the font's format is not PostScript-based, this function returns
- * the `FT_Err_Invalid_Argument` error code.
+ * If the font's format is not PostScript-based, this function returns
+ * the `FT_Err_Invalid_Argument` error code.
*
* @since:
- * 2.4.8
+ * 2.4.8
*
*/
FT_EXPORT( FT_Long )
diff --git a/freetype/include/freetype/ttnameid.h b/freetype/include/freetype/ttnameid.h
index a09950f5..37b505a0 100644
--- a/freetype/include/freetype/ttnameid.h
+++ b/freetype/include/freetype/ttnameid.h
@@ -4,7 +4,7 @@
*
* TrueType name ID definitions (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/tttables.h b/freetype/include/freetype/tttables.h
index c33d9905..21664df7 100644
--- a/freetype/include/freetype/tttables.h
+++ b/freetype/include/freetype/tttables.h
@@ -5,7 +5,7 @@
* Basic SFNT/TrueType tables definitions and interface
* (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/include/freetype/tttags.h b/freetype/include/freetype/tttags.h
index 47ccc6dd..8b807641 100644
--- a/freetype/include/freetype/tttags.h
+++ b/freetype/include/freetype/tttags.h
@@ -4,7 +4,7 @@
*
* Tags for TrueType and OpenType tables (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -95,6 +95,7 @@ FT_BEGIN_HEADER
#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
+#define TTAG_SVG FT_MAKE_TAG( 'S', 'V', 'G', ' ' )
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
diff --git a/freetype/include/ft2build.h b/freetype/include/ft2build.h
index 62686b1b..2543ac43 100644
--- a/freetype/include/ft2build.h
+++ b/freetype/include/ft2build.h
@@ -4,7 +4,7 @@
*
* FreeType 2 build and setup macros.
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/meson.build b/freetype/meson.build
index 9998848d..a066325b 100644
--- a/freetype/meson.build
+++ b/freetype/meson.build
@@ -2,7 +2,7 @@
# Meson project file for FreeType 2
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -25,9 +25,9 @@
project('freetype2', 'c',
meson_version: '>= 0.55.0',
- default_options: ['default_library=both'],
version: run_command('builds/meson/extract_freetype_version.py',
- 'include/freetype/freetype.h').stdout().strip(),
+ 'include/freetype/freetype.h',
+ check: true).stdout().strip(),
)
@@ -35,17 +35,18 @@ project('freetype2', 'c',
# variable; we thus use an external command to have this functionality
# with older versions, too.
-python = import('python')
-python_exe = python.find_installation(required: true)
+python_exe = find_program('python3')
ft2_so_version = run_command(python_exe,
files('builds/meson/extract_libtool_version.py'),
'--soversion',
- files('builds/unix/configure.raw')).stdout().strip()
+ files('builds/unix/configure.raw'),
+ check: true).stdout().strip()
ft2_pkgconfig_version = run_command(python_exe,
files('builds/meson/extract_libtool_version.py'),
- files('builds/unix/configure.raw')).stdout().strip()
+ files('builds/unix/configure.raw'),
+ check: true).stdout().strip()
ft2_includes = include_directories('include')
@@ -70,7 +71,8 @@ ft2_sources = [ftmodule_h]
ft_main_modules = run_command(python_exe,
files('builds/meson/parse_modules_cfg.py'),
'--format=main-modules',
- files('modules.cfg')).stdout().strip().split()
+ files('modules.cfg'),
+ check: true).stdout().strip().split()
ft2_sources += files([
'src/base/ftbase.c',
@@ -91,7 +93,8 @@ endforeach
ft_aux_modules = run_command(python_exe,
files('builds/meson/parse_modules_cfg.py'),
'--format=aux-modules',
- files('modules.cfg')).stdout().strip().split()
+ files('modules.cfg'),
+ check: true).stdout().strip().split()
foreach auxmod: ft_aux_modules
source = auxmod
@@ -117,7 +120,8 @@ endforeach
base_extensions = run_command(python_exe,
files('builds/meson/parse_modules_cfg.py'),
'--format=base-extensions-list',
- files('modules.cfg')).stdout().split()
+ files('modules.cfg'),
+ check: true).stdout().split()
foreach ext: base_extensions
ft2_sources += files('src/base/' + ext)
@@ -167,6 +171,7 @@ ft2_public_headers = files([
'include/freetype/fttrigon.h',
'include/freetype/fttypes.h',
'include/freetype/ftwinfnt.h',
+ 'include/freetype/otsvg.h',
'include/freetype/t1tables.h',
'include/freetype/ttnameid.h',
'include/freetype/tttables.h',
@@ -262,15 +267,49 @@ ftoption_command = process_header_command
# external GZip support
-zlib_dep = dependency('zlib',
- required: get_option('zlib'),
- fallback: 'zlib')
+zlib_option = get_option('zlib')
-if zlib_dep.found()
- ftoption_command += ['--enable=FT_CONFIG_OPTION_SYSTEM_ZLIB']
+# Backwards-compatible aliases.
+if zlib_option == 'disabled'
+ zlib_option = 'none'
+elif zlib_option == 'enabled'
+ zlib_option = 'auto'
+endif
+
+if zlib_option == 'auto'
+ # First try to find a system installation, otherwise fall back to
+ # the subproject.
+ zlib_dep = dependency('zlib',
+ required: false)
+ if zlib_dep.found()
+ zlib_option = 'system'
+ else
+ zlib_option = 'external'
+ endif
+endif
+
+if zlib_option == 'none'
+ ftoption_command += [ '--disable=FT_CONFIG_OPTION_USE_ZLIB' ]
+elif zlib_option == 'internal'
+ ftoption_command += [ '--enable=FT_CONFIG_OPTION_USE_ZLIB' ]
+elif zlib_option == 'external'
+ ftoption_command += [ '--enable=FT_CONFIG_OPTION_USE_ZLIB' ]
+ zlib_project = subproject('zlib',
+ required: true,
+ default_options: 'default_library=static')
+ zlib_dep = zlib_project.get_variable('zlib_dep')
+ ft2_deps += [zlib_dep]
+elif zlib_option == 'system'
+ zlib_dep = dependency('zlib',
+ required: true)
+ assert(zlib_dep.found(), 'Could not find system zlib installation!')
+ ftoption_command += [
+ '--enable=FT_CONFIG_OPTION_USE_ZLIB',
+ '--enable=FT_CONFIG_OPTION_SYSTEM_ZLIB',
+ ]
ft2_deps += [zlib_dep]
else
- ftoption_command += ['--disable=FT_CONFIG_OPTION_SYSTEM_ZLIB']
+ assert(false, 'Invalid zlib option ' + zlib_option)
endif
# BZip2 support
@@ -417,7 +456,7 @@ gen_docs = custom_target('freetype2 reference documentation',
summary({'OS': host_machine.system(),
}, section: 'Operating System')
-summary({'Zlib': zlib_dep.found() ? 'external' : 'internal',
+summary({'Zlib': zlib_option,
'Bzip2': bzip2_dep.found() ? 'yes' : 'no',
'Png': libpng_dep.found() ? 'yes' : 'no',
'Harfbuzz': harfbuzz_dep.found() ? 'yes' : 'no',
diff --git a/freetype/meson_options.txt b/freetype/meson_options.txt
index 375eb714..8ea62517 100644
--- a/freetype/meson_options.txt
+++ b/freetype/meson_options.txt
@@ -2,7 +2,7 @@
# meson_options.txt
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -46,8 +46,10 @@ option('tests',
description: 'Enable FreeType unit and regression tests')
option('zlib',
- type: 'feature',
- value: 'auto',
+ type: 'combo',
+ choices: [ 'auto', 'none',
+ 'internal', 'external', 'system',
+ 'disabled', 'enabled' ],
description: 'Support reading gzip-compressed font files')
# EOF
diff --git a/freetype/modules.cfg b/freetype/modules.cfg
index 30f7fac4..aded92e5 100644
--- a/freetype/modules.cfg
+++ b/freetype/modules.cfg
@@ -1,6 +1,6 @@
# modules.cfg
#
-# Copyright (C) 2005-2021 by
+# Copyright (C) 2005-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -99,6 +99,9 @@ RASTER_MODULES += smooth
# Monochrome rasterizer.
RASTER_MODULES += raster
+# OT-SVG.
+RASTER_MODULES += svg
+
# Signed distance field rasterizer.
RASTER_MODULES += sdf
diff --git a/freetype/src/autofit/afangles.c b/freetype/src/autofit/afangles.c
deleted file mode 100644
index a2d45eb7..00000000
--- a/freetype/src/autofit/afangles.c
+++ /dev/null
@@ -1,285 +0,0 @@
-/****************************************************************************
- *
- * afangles.c
- *
- * Routines used to compute vector angles with limited accuracy
- * and very high speed. It also contains sorting routines (body).
- *
- * Copyright (C) 2003-2020 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.
- *
- */
-
-
-#include "aftypes.h"
-
-
- /*
- * We are not using `af_angle_atan' anymore, but we keep the source
- * code below just in case...
- */
-
-
-#if 0
-
-
- /*
- * The trick here is to realize that we don't need a very accurate angle
- * approximation. We are going to use the result of `af_angle_atan' to
- * only compare the sign of angle differences, or check whether its
- * magnitude is very small.
- *
- * The approximation
- *
- * dy * PI / (|dx|+|dy|)
- *
- * should be enough, and much faster to compute.
- */
- FT_LOCAL_DEF( AF_Angle )
- af_angle_atan( FT_Fixed dx,
- FT_Fixed dy )
- {
- AF_Angle angle;
- FT_Fixed ax = dx;
- FT_Fixed ay = dy;
-
-
- if ( ax < 0 )
- ax = -ax;
- if ( ay < 0 )
- ay = -ay;
-
- ax += ay;
-
- if ( ax == 0 )
- angle = 0;
- else
- {
- angle = ( AF_ANGLE_PI2 * dy ) / ( ax + ay );
- if ( dx < 0 )
- {
- if ( angle >= 0 )
- angle = AF_ANGLE_PI - angle;
- else
- angle = -AF_ANGLE_PI - angle;
- }
- }
-
- return angle;
- }
-
-
-#elif 0
-
-
- /* the following table has been automatically generated with */
- /* the `mather.py' Python script */
-
-#define AF_ATAN_BITS 8
-
- static const FT_Byte af_arctan[1L << AF_ATAN_BITS] =
- {
- 0, 0, 1, 1, 1, 2, 2, 2,
- 3, 3, 3, 3, 4, 4, 4, 5,
- 5, 5, 6, 6, 6, 7, 7, 7,
- 8, 8, 8, 9, 9, 9, 10, 10,
- 10, 10, 11, 11, 11, 12, 12, 12,
- 13, 13, 13, 14, 14, 14, 14, 15,
- 15, 15, 16, 16, 16, 17, 17, 17,
- 18, 18, 18, 18, 19, 19, 19, 20,
- 20, 20, 21, 21, 21, 21, 22, 22,
- 22, 23, 23, 23, 24, 24, 24, 24,
- 25, 25, 25, 26, 26, 26, 26, 27,
- 27, 27, 28, 28, 28, 28, 29, 29,
- 29, 30, 30, 30, 30, 31, 31, 31,
- 31, 32, 32, 32, 33, 33, 33, 33,
- 34, 34, 34, 34, 35, 35, 35, 35,
- 36, 36, 36, 36, 37, 37, 37, 38,
- 38, 38, 38, 39, 39, 39, 39, 40,
- 40, 40, 40, 41, 41, 41, 41, 42,
- 42, 42, 42, 42, 43, 43, 43, 43,
- 44, 44, 44, 44, 45, 45, 45, 45,
- 46, 46, 46, 46, 46, 47, 47, 47,
- 47, 48, 48, 48, 48, 48, 49, 49,
- 49, 49, 50, 50, 50, 50, 50, 51,
- 51, 51, 51, 51, 52, 52, 52, 52,
- 52, 53, 53, 53, 53, 53, 54, 54,
- 54, 54, 54, 55, 55, 55, 55, 55,
- 56, 56, 56, 56, 56, 57, 57, 57,
- 57, 57, 57, 58, 58, 58, 58, 58,
- 59, 59, 59, 59, 59, 59, 60, 60,
- 60, 60, 60, 61, 61, 61, 61, 61,
- 61, 62, 62, 62, 62, 62, 62, 63,
- 63, 63, 63, 63, 63, 64, 64, 64
- };
-
-
- FT_LOCAL_DEF( AF_Angle )
- af_angle_atan( FT_Fixed dx,
- FT_Fixed dy )
- {
- AF_Angle angle;
-
-
- /* check trivial cases */
- if ( dy == 0 )
- {
- angle = 0;
- if ( dx < 0 )
- angle = AF_ANGLE_PI;
- return angle;
- }
- else if ( dx == 0 )
- {
- angle = AF_ANGLE_PI2;
- if ( dy < 0 )
- angle = -AF_ANGLE_PI2;
- return angle;
- }
-
- angle = 0;
- if ( dx < 0 )
- {
- dx = -dx;
- dy = -dy;
- angle = AF_ANGLE_PI;
- }
-
- if ( dy < 0 )
- {
- FT_Pos tmp;
-
-
- tmp = dx;
- dx = -dy;
- dy = tmp;
- angle -= AF_ANGLE_PI2;
- }
-
- if ( dx == 0 && dy == 0 )
- return 0;
-
- if ( dx == dy )
- angle += AF_ANGLE_PI4;
- else if ( dx > dy )
- angle += af_arctan[FT_DivFix( dy, dx ) >> ( 16 - AF_ATAN_BITS )];
- else
- angle += AF_ANGLE_PI2 -
- af_arctan[FT_DivFix( dx, dy ) >> ( 16 - AF_ATAN_BITS )];
-
- if ( angle > AF_ANGLE_PI )
- angle -= AF_ANGLE_2PI;
-
- return angle;
- }
-
-
-#endif /* 0 */
-
-
- FT_LOCAL_DEF( void )
- af_sort_pos( FT_UInt count,
- FT_Pos* table )
- {
- FT_UInt i, j;
- FT_Pos swap;
-
-
- for ( i = 1; i < count; i++ )
- {
- for ( j = i; j > 0; j-- )
- {
- if ( table[j] >= table[j - 1] )
- break;
-
- swap = table[j];
- table[j] = table[j - 1];
- table[j - 1] = swap;
- }
- }
- }
-
-
- FT_LOCAL_DEF( void )
- af_sort_and_quantize_widths( FT_UInt* count,
- AF_Width table,
- FT_Pos threshold )
- {
- FT_UInt i, j;
- FT_UInt cur_idx;
- FT_Pos cur_val;
- FT_Pos sum;
- AF_WidthRec swap;
-
-
- if ( *count == 1 )
- return;
-
- /* sort */
- for ( i = 1; i < *count; i++ )
- {
- for ( j = i; j > 0; j-- )
- {
- if ( table[j].org >= table[j - 1].org )
- break;
-
- swap = table[j];
- table[j] = table[j - 1];
- table[j - 1] = swap;
- }
- }
-
- cur_idx = 0;
- cur_val = table[cur_idx].org;
-
- /* compute and use mean values for clusters not larger than */
- /* `threshold'; this is very primitive and might not yield */
- /* the best result, but normally, using reference character */
- /* `o', `*count' is 2, so the code below is fully sufficient */
- for ( i = 1; i < *count; i++ )
- {
- if ( table[i].org - cur_val > threshold ||
- i == *count - 1 )
- {
- sum = 0;
-
- /* fix loop for end of array */
- if ( table[i].org - cur_val <= threshold &&
- i == *count - 1 )
- i++;
-
- for ( j = cur_idx; j < i; j++ )
- {
- sum += table[j].org;
- table[j].org = 0;
- }
- table[cur_idx].org = sum / (FT_Pos)j;
-
- if ( i < *count - 1 )
- {
- cur_idx = i + 1;
- cur_val = table[cur_idx].org;
- }
- }
- }
-
- cur_idx = 1;
-
- /* compress array to remove zero values */
- for ( i = 1; i < *count; i++ )
- {
- if ( table[i].org )
- table[cur_idx++] = table[i];
- }
-
- *count = cur_idx;
- }
-
-
-/* END */
diff --git a/freetype/src/autofit/afangles.h b/freetype/src/autofit/afangles.h
deleted file mode 100644
index 18d7dae3..00000000
--- a/freetype/src/autofit/afangles.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * afangles.h
- *
- * This is a dummy file, used to please the build system. It is never
- * included by the auto-fitter sources.
- *
- */
diff --git a/freetype/src/autofit/afblue.c b/freetype/src/autofit/afblue.c
index c9e8045c..b986eb4a 100644
--- a/freetype/src/autofit/afblue.c
+++ b/freetype/src/autofit/afblue.c
@@ -7,7 +7,7 @@
*
* Auto-fitter data for blue strings (body).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afblue.cin b/freetype/src/autofit/afblue.cin
index 071e80b0..f7e27ad8 100644
--- a/freetype/src/autofit/afblue.cin
+++ b/freetype/src/autofit/afblue.cin
@@ -4,7 +4,7 @@
*
* Auto-fitter data for blue strings (body).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afblue.dat b/freetype/src/autofit/afblue.dat
index 1aa9b26d..201acc4f 100644
--- a/freetype/src/autofit/afblue.dat
+++ b/freetype/src/autofit/afblue.dat
@@ -2,7 +2,7 @@
//
// Auto-fitter data for blue strings.
//
-// Copyright (C) 2013-2021 by
+// Copyright (C) 2013-2022 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afblue.h b/freetype/src/autofit/afblue.h
index 311c9e3a..0e56abb9 100644
--- a/freetype/src/autofit/afblue.h
+++ b/freetype/src/autofit/afblue.h
@@ -7,7 +7,7 @@
*
* Auto-fitter data for blue strings (specification).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afblue.hin b/freetype/src/autofit/afblue.hin
index 51869149..f9fd5aa3 100644
--- a/freetype/src/autofit/afblue.hin
+++ b/freetype/src/autofit/afblue.hin
@@ -4,7 +4,7 @@
*
* Auto-fitter data for blue strings (specification).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afcjk.c b/freetype/src/autofit/afcjk.c
index 7e46b6b1..1853a17f 100644
--- a/freetype/src/autofit/afcjk.c
+++ b/freetype/src/autofit/afcjk.c
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for CJK writing system (body).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -843,7 +843,7 @@
{
AF_AxisHints axis = &hints->axis[dim];
AF_Segment segments = axis->segments;
- AF_Segment segment_limit = segments + axis->num_segments;
+ AF_Segment segment_limit = FT_OFFSET( segments, axis->num_segments );
AF_Direction major_dir = axis->major_dir;
AF_Segment seg1, seg2;
FT_Pos len_threshold;
@@ -1005,7 +1005,7 @@
AF_CJKAxis laxis = &((AF_CJKMetrics)hints->metrics)->axis[dim];
AF_Segment segments = axis->segments;
- AF_Segment segment_limit = segments + axis->num_segments;
+ AF_Segment segment_limit = FT_OFFSET( segments, axis->num_segments );
AF_Segment seg;
FT_Fixed scale;
@@ -1153,7 +1153,7 @@
*/
{
AF_Edge edges = axis->edges;
- AF_Edge edge_limit = edges + axis->num_edges;
+ AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
AF_Edge edge;
@@ -1291,7 +1291,7 @@
{
AF_AxisHints axis = &hints->axis[dim];
AF_Edge edge = axis->edges;
- AF_Edge edge_limit = edge + axis->num_edges;
+ AF_Edge edge_limit = FT_OFFSET( edge, axis->num_edges );
AF_CJKAxis cjk = &metrics->axis[dim];
FT_Fixed scale = cjk->scale;
FT_Pos best_dist0; /* initial threshold */
@@ -1798,7 +1798,7 @@
{
AF_AxisHints axis = &hints->axis[dim];
AF_Edge edges = axis->edges;
- AF_Edge edge_limit = edges + axis->num_edges;
+ AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
FT_PtrDist n_edges;
AF_Edge edge;
AF_Edge anchor = NULL;
@@ -2177,7 +2177,7 @@
{
AF_AxisHints axis = & hints->axis[dim];
AF_Edge edges = axis->edges;
- AF_Edge edge_limit = edges + axis->num_edges;
+ AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
AF_Edge edge;
FT_Bool snapping;
diff --git a/freetype/src/autofit/afcjk.h b/freetype/src/autofit/afcjk.h
index 58aa298d..bf948bce 100644
--- a/freetype/src/autofit/afcjk.h
+++ b/freetype/src/autofit/afcjk.h
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for CJK writing system (specification).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afcover.h b/freetype/src/autofit/afcover.h
index c7ae1e9a..be71fe39 100644
--- a/freetype/src/autofit/afcover.h
+++ b/freetype/src/autofit/afcover.h
@@ -4,7 +4,7 @@
*
* Auto-fitter coverages (specification only).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afdummy.c b/freetype/src/autofit/afdummy.c
index a36b56f7..5fdbfcfd 100644
--- a/freetype/src/autofit/afdummy.c
+++ b/freetype/src/autofit/afdummy.c
@@ -5,7 +5,7 @@
* Auto-fitter dummy routines to be used if no hinting should be
* performed (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afdummy.h b/freetype/src/autofit/afdummy.h
index b58849fe..4dddbd52 100644
--- a/freetype/src/autofit/afdummy.h
+++ b/freetype/src/autofit/afdummy.h
@@ -5,7 +5,7 @@
* Auto-fitter dummy routines to be used if no hinting should be
* performed (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/aferrors.h b/freetype/src/autofit/aferrors.h
index 09bed663..d31b1a9c 100644
--- a/freetype/src/autofit/aferrors.h
+++ b/freetype/src/autofit/aferrors.h
@@ -4,7 +4,7 @@
*
* Autofitter error codes (specification only).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afglobal.c b/freetype/src/autofit/afglobal.c
index b805b3b0..87a3fbfb 100644
--- a/freetype/src/autofit/afglobal.c
+++ b/freetype/src/autofit/afglobal.c
@@ -4,7 +4,7 @@
*
* Auto-fitter routines to compute global hinting values (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -337,11 +337,13 @@
/* we allocate an AF_FaceGlobals structure together */
/* with the glyph_styles array */
- if ( FT_ALLOC( globals,
- sizeof ( *globals ) +
- (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
+ if ( FT_QALLOC( globals,
+ sizeof ( *globals ) +
+ (FT_ULong)face->num_glyphs * sizeof ( FT_UShort ) ) )
goto Exit;
+ FT_ZERO( &globals->metrics );
+
globals->face = face;
globals->glyph_count = face->num_glyphs;
/* right after the globals structure come the glyph styles */
diff --git a/freetype/src/autofit/afglobal.h b/freetype/src/autofit/afglobal.h
index cd97e716..f7ebf8d5 100644
--- a/freetype/src/autofit/afglobal.h
+++ b/freetype/src/autofit/afglobal.h
@@ -5,7 +5,7 @@
* Auto-fitter routines to compute global hinting values
* (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afhints.c b/freetype/src/autofit/afhints.c
index 5506afda..ae7d1052 100644
--- a/freetype/src/autofit/afhints.c
+++ b/freetype/src/autofit/afhints.c
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -1316,7 +1316,7 @@
{
AF_AxisHints axis = & hints->axis[dim];
AF_Segment segments = axis->segments;
- AF_Segment segment_limit = segments + axis->num_segments;
+ AF_Segment segment_limit = FT_OFFSET( segments, axis->num_segments );
AF_Segment seg;
@@ -1393,7 +1393,7 @@
AF_Point point_limit = points + hints->num_points;
AF_AxisHints axis = &hints->axis[dim];
AF_Edge edges = axis->edges;
- AF_Edge edge_limit = edges + axis->num_edges;
+ AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
FT_UInt touch_flag;
diff --git a/freetype/src/autofit/afhints.h b/freetype/src/autofit/afhints.h
index 38d2847d..96001cd8 100644
--- a/freetype/src/autofit/afhints.h
+++ b/freetype/src/autofit/afhints.h
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afindic.c b/freetype/src/autofit/afindic.c
index 064c300e..5bf0b5f9 100644
--- a/freetype/src/autofit/afindic.c
+++ b/freetype/src/autofit/afindic.c
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for Indic writing system (body).
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afindic.h b/freetype/src/autofit/afindic.h
index 3e467241..59ae11a6 100644
--- a/freetype/src/autofit/afindic.h
+++ b/freetype/src/autofit/afindic.h
@@ -5,7 +5,7 @@
* Auto-fitter hinting routines for Indic writing system
* (specification).
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/aflatin.c b/freetype/src/autofit/aflatin.c
index 5e81d771..bed0ccee 100644
--- a/freetype/src/autofit/aflatin.c
+++ b/freetype/src/autofit/aflatin.c
@@ -4,7 +4,7 @@
*
* Auto-fitter hinting routines for latin writing system (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -200,7 +200,7 @@
(AF_Dimension)dim );
seg = axhints->segments;
- limit = seg + axhints->num_segments;
+ limit = FT_OFFSET( seg, axhints->num_segments );
for ( ; seg < limit; seg++ )
{
@@ -1989,7 +1989,7 @@
{
AF_AxisHints axis = &hints->axis[dim];
AF_Segment segments = axis->segments;
- AF_Segment segment_limit = segments + axis->num_segments;
+ AF_Segment segment_limit = FT_OFFSET( segments, axis->num_segments );
FT_Pos len_threshold, len_score, dist_score, max_width;
AF_Segment seg1, seg2;
@@ -2134,7 +2134,7 @@
FT_Bool top_to_bottom_hinting = 0;
AF_Segment segments = axis->segments;
- AF_Segment segment_limit = segments + axis->num_segments;
+ AF_Segment segment_limit = FT_OFFSET( segments, axis->num_segments );
AF_Segment seg;
#if 0
@@ -2500,7 +2500,7 @@
{
AF_AxisHints axis = &hints->axis[AF_DIMENSION_VERT];
AF_Edge edge = axis->edges;
- AF_Edge edge_limit = edge + axis->num_edges;
+ AF_Edge edge_limit = FT_OFFSET( edge, axis->num_edges );
AF_LatinAxis latin = &metrics->axis[AF_DIMENSION_VERT];
FT_Fixed scale = latin->scale;
@@ -2993,7 +2993,7 @@
{
AF_AxisHints axis = &hints->axis[dim];
AF_Edge edges = axis->edges;
- AF_Edge edge_limit = edges + axis->num_edges;
+ AF_Edge edge_limit = FT_OFFSET( edges, axis->num_edges );
FT_PtrDist n_edges;
AF_Edge edge;
AF_Edge anchor = NULL;
diff --git a/freetype/src/autofit/aflatin.h b/freetype/src/autofit/aflatin.h
index d6b919ef..facc6634 100644
--- a/freetype/src/autofit/aflatin.h
+++ b/freetype/src/autofit/aflatin.h
@@ -5,7 +5,7 @@
* Auto-fitter hinting routines for latin writing system
* (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/aflatin2.c b/freetype/src/autofit/aflatin2.c
deleted file mode 100644
index 902f3982..00000000
--- a/freetype/src/autofit/aflatin2.c
+++ /dev/null
@@ -1,2428 +0,0 @@
-/* ATTENTION: This file doesn't compile. It is only here as a reference */
-/* of an alternative latin hinting algorithm that was always */
-/* marked as experimental. */
-
-
-/****************************************************************************
- *
- * aflatin2.c
- *
- * Auto-fitter hinting routines for latin writing system (body).
- *
- * Copyright (C) 2003-2020 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.
- *
- */
-
-
-#include <freetype/ftadvanc.h>
-
-
-#ifdef FT_OPTION_AUTOFIT2
-
-#include "afglobal.h"
-#include "aflatin.h"
-#include "aflatin2.h"
-#include "aferrors.h"
-
-
-#ifdef AF_CONFIG_OPTION_USE_WARPER
-#include "afwarp.h"
-#endif
-
-
- /**************************************************************************
- *
- * The macro FT_COMPONENT is used in trace mode. It is an implicit
- * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
- * messages during execution.
- */
-#undef FT_COMPONENT
-#define FT_COMPONENT aflatin2
-
-
- FT_LOCAL_DEF( FT_Error )
- af_latin2_hints_compute_segments( AF_GlyphHints hints,
- AF_Dimension dim );
-
- FT_LOCAL_DEF( void )
- af_latin2_hints_link_segments( AF_GlyphHints hints,
- AF_Dimension dim );
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** L A T I N G L O B A L M E T R I C S *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- FT_LOCAL_DEF( void )
- af_latin2_metrics_init_widths( AF_LatinMetrics metrics,
- FT_Face face )
- {
- /* scan the array of segments in each direction */
- AF_GlyphHintsRec hints[1];
-
-
- af_glyph_hints_init( hints, face->memory );
-
- metrics->axis[AF_DIMENSION_HORZ].width_count = 0;
- metrics->axis[AF_DIMENSION_VERT].width_count = 0;
-
- {
- FT_Error error;
- FT_UInt glyph_index;
- int dim;
- AF_LatinMetricsRec dummy[1];
- AF_Scaler scaler = &dummy->root.scaler;
-
-
- glyph_index = FT_Get_Char_Index(
- face,
- metrics->root.style_class->standard_char );
- if ( glyph_index == 0 )
- goto Exit;
-
- error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
- if ( error || face->glyph->outline.n_points <= 0 )
- goto Exit;
-
- FT_ZERO( dummy );
-
- dummy->units_per_em = metrics->units_per_em;
- scaler->x_scale = scaler->y_scale = 0x10000L;
- scaler->x_delta = scaler->y_delta = 0;
- scaler->face = face;
- scaler->render_mode = FT_RENDER_MODE_NORMAL;
- scaler->flags = 0;
-
- af_glyph_hints_rescale( hints, (AF_StyleMetrics)dummy );
-
- error = af_glyph_hints_reload( hints, &face->glyph->outline );
- if ( error )
- goto Exit;
-
- for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
- {
- AF_LatinAxis axis = &metrics->axis[dim];
- AF_AxisHints axhints = &hints->axis[dim];
- AF_Segment seg, limit, link;
- FT_UInt num_widths = 0;
-
-
- error = af_latin2_hints_compute_segments( hints,
- (AF_Dimension)dim );
- if ( error )
- goto Exit;
-
- af_latin2_hints_link_segments( hints,
- (AF_Dimension)dim );
-
- seg = axhints->segments;
- limit = seg + axhints->num_segments;
-
- for ( ; seg < limit; seg++ )
- {
- link = seg->link;
-
- /* we only consider stem segments there! */
- if ( link && link->link == seg && link > seg )
- {
- FT_Pos dist;
-
-
- dist = seg->pos - link->pos;
- if ( dist < 0 )
- dist = -dist;
-
- if ( num_widths < AF_LATIN_MAX_WIDTHS )
- axis->widths[num_widths++].org = dist;
- }
- }
-
- af_sort_widths( num_widths, axis->widths );
- axis->width_count = num_widths;
- }
-
- Exit:
- for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
- {
- AF_LatinAxis axis = &metrics->axis[dim];
- FT_Pos stdw;
-
-
- stdw = ( axis->width_count > 0 )
- ? axis->widths[0].org
- : AF_LATIN_CONSTANT( metrics, 50 );
-
- /* let's try 20% of the smallest width */
- axis->edge_distance_threshold = stdw / 5;
- axis->standard_width = stdw;
- axis->extra_light = 0;
- }
- }
-
- af_glyph_hints_done( hints );
- }
-
-
-
-#define AF_LATIN_MAX_TEST_CHARACTERS 12
-
-
- static const char af_latin2_blue_chars[AF_LATIN_MAX_BLUES]
- [AF_LATIN_MAX_TEST_CHARACTERS+1] =
- {
- "THEZOCQS",
- "HEZLOCUS",
- "fijkdbh",
- "xzroesc",
- "xzroesc",
- "pqgjy"
- };
-
-
- static void
- af_latin2_metrics_init_blues( AF_LatinMetrics metrics,
- FT_Face face )
- {
- FT_Pos flats [AF_LATIN_MAX_TEST_CHARACTERS];
- FT_Pos rounds[AF_LATIN_MAX_TEST_CHARACTERS];
- FT_Int num_flats;
- FT_Int num_rounds;
- FT_Int bb;
- AF_LatinBlue blue;
- FT_Error error;
- AF_LatinAxis axis = &metrics->axis[AF_DIMENSION_VERT];
- FT_GlyphSlot glyph = face->glyph;
-
-
- /* we compute the blues simply by loading each character from the */
- /* 'af_latin2_blue_chars[blues]' string, then compute its top-most or */
- /* bottom-most points (depending on `AF_IS_TOP_BLUE') */
-
- FT_TRACE5(( "blue zones computation\n"
- "======================\n\n" ));
-
- for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )
- {
- const char* p = af_latin2_blue_chars[bb];
- const char* limit = p + AF_LATIN_MAX_TEST_CHARACTERS;
- FT_Pos* blue_ref;
- FT_Pos* blue_shoot;
-
-
- FT_TRACE5(( "blue zone %d:\n", bb ));
-
- num_flats = 0;
- num_rounds = 0;
-
- for ( ; p < limit && *p; p++ )
- {
- FT_UInt glyph_index;
- FT_Int best_point, best_y, best_first, best_last;
- FT_Vector* points;
- FT_Bool round;
-
-
- /* load the character in the face -- skip unknown or empty ones */
- glyph_index = FT_Get_Char_Index( face, (FT_UInt)*p );
- if ( glyph_index == 0 )
- continue;
-
- error = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_SCALE );
- if ( error || glyph->outline.n_points <= 0 )
- continue;
-
- /* now compute min or max point indices and coordinates */
- points = glyph->outline.points;
- best_point = -1;
- best_y = 0; /* make compiler happy */
- best_first = 0; /* ditto */
- best_last = 0; /* ditto */
-
- {
- FT_Int nn;
- FT_Int first = 0;
- FT_Int last = -1;
-
-
- for ( nn = 0; nn < glyph->outline.n_contours; first = last+1, nn++ )
- {
- FT_Int old_best_point = best_point;
- FT_Int pp;
-
-
- last = glyph->outline.contours[nn];
-
- /* Avoid single-point contours since they are never rasterized. */
- /* In some fonts, they correspond to mark attachment points */
- /* which are way outside of the glyph's real outline. */
- if ( last <= first )
- continue;
-
- if ( AF_LATIN_IS_TOP_BLUE( bb ) )
- {
- for ( pp = first; pp <= last; pp++ )
- if ( best_point < 0 || points[pp].y > best_y )
- {
- best_point = pp;
- best_y = points[pp].y;
- }
- }
- else
- {
- for ( pp = first; pp <= last; pp++ )
- if ( best_point < 0 || points[pp].y < best_y )
- {
- best_point = pp;
- best_y = points[pp].y;
- }
- }
-
- if ( best_point != old_best_point )
- {
- best_first = first;
- best_last = last;
- }
- }
- FT_TRACE5(( " %c %d", *p, best_y ));
- }
-
- /* now check whether the point belongs to a straight or round */
- /* segment; we first need to find in which contour the extremum */
- /* lies, then inspect its previous and next points */
- if ( best_point >= 0 )
- {
- FT_Pos best_x = points[best_point].x;
- FT_Int start, end, prev, next;
- FT_Pos dist;
-
-
- /* now look for the previous and next points that are not on the */
- /* same Y coordinate. Threshold the `closeness'... */
- start = end = best_point;
-
- do
- {
- prev = start - 1;
- if ( prev < best_first )
- prev = best_last;
-
- dist = FT_ABS( points[prev].y - best_y );
- /* accept a small distance or a small angle (both values are */
- /* heuristic; value 20 corresponds to approx. 2.9 degrees) */
- if ( dist > 5 )
- if ( FT_ABS( points[prev].x - best_x ) <= 20 * dist )
- break;
-
- start = prev;
-
- } while ( start != best_point );
-
- do
- {
- next = end + 1;
- if ( next > best_last )
- next = best_first;
-
- dist = FT_ABS( points[next].y - best_y );
- if ( dist > 5 )
- if ( FT_ABS( points[next].x - best_x ) <= 20 * dist )
- break;
-
- end = next;
-
- } while ( end != best_point );
-
- /* now, set the `round' flag depending on the segment's kind */
- round = FT_BOOL(
- FT_CURVE_TAG( glyph->outline.tags[start] ) != FT_CURVE_TAG_ON ||
- FT_CURVE_TAG( glyph->outline.tags[ end ] ) != FT_CURVE_TAG_ON );
-
- FT_TRACE5(( " (%s)\n", round ? "round" : "flat" ));
- }
-
- if ( round )
- rounds[num_rounds++] = best_y;
- else
- flats[num_flats++] = best_y;
- }
-
- if ( num_flats == 0 && num_rounds == 0 )
- {
- /*
- * we couldn't find a single glyph to compute this blue zone,
- * we will simply ignore it then
- */
- FT_TRACE5(( " empty\n" ));
- continue;
- }
-
- /* we have computed the contents of the `rounds' and `flats' tables, */
- /* now determine the reference and overshoot position of the blue -- */
- /* we simply take the median value after a simple sort */
- af_sort_pos( num_rounds, rounds );
- af_sort_pos( num_flats, flats );
-
- blue = & axis->blues[axis->blue_count];
- blue_ref = & blue->ref.org;
- blue_shoot = & blue->shoot.org;
-
- axis->blue_count++;
-
- if ( num_flats == 0 )
- {
- *blue_ref =
- *blue_shoot = rounds[num_rounds / 2];
- }
- else if ( num_rounds == 0 )
- {
- *blue_ref =
- *blue_shoot = flats[num_flats / 2];
- }
- else
- {
- *blue_ref = flats[num_flats / 2];
- *blue_shoot = rounds[num_rounds / 2];
- }
-
- /* there are sometimes problems: if the overshoot position of top */
- /* zones is under its reference position, or the opposite for bottom */
- /* zones. We must thus check everything there and correct the errors */
- if ( *blue_shoot != *blue_ref )
- {
- FT_Pos ref = *blue_ref;
- FT_Pos shoot = *blue_shoot;
- FT_Bool over_ref = FT_BOOL( shoot > ref );
-
-
- if ( AF_LATIN_IS_TOP_BLUE( bb ) ^ over_ref )
- {
- *blue_ref =
- *blue_shoot = ( shoot + ref ) / 2;
-
- FT_TRACE5(( " [overshoot smaller than reference,"
- " taking mean value]\n" ));
- }
- }
-
- blue->flags = 0;
- if ( AF_LATIN_IS_TOP_BLUE( bb ) )
- blue->flags |= AF_LATIN_BLUE_TOP;
-
- /*
- * The following flag is used later to adjust the y and x scales
- * in order to optimize the pixel grid alignment of the top of small
- * letters.
- */
- if ( AF_LATIN_IS_X_HEIGHT_BLUE( bb ) )
- blue->flags |= AF_LATIN_BLUE_ADJUSTMENT;
-
- FT_TRACE5(( " -> reference = %ld\n"
- " overshoot = %ld\n",
- *blue_ref, *blue_shoot ));
- }
-
- return;
- }
-
-
- FT_LOCAL_DEF( void )
- af_latin2_metrics_check_digits( AF_LatinMetrics metrics,
- FT_Face face )
- {
- FT_UInt i;
- FT_Bool started = 0, same_width = 1;
- FT_Fixed advance, old_advance = 0;
-
-
- /* check whether all ASCII digits have the same advance width; */
- /* digit `0' is 0x30 in all supported charmaps */
- for ( i = 0x30; i <= 0x39; i++ )
- {
- FT_UInt glyph_index;
-
-
- glyph_index = FT_Get_Char_Index( face, i );
- if ( glyph_index == 0 )
- continue;
-
- if ( FT_Get_Advance( face, glyph_index,
- FT_LOAD_NO_SCALE |
- FT_LOAD_NO_HINTING |
- FT_LOAD_IGNORE_TRANSFORM,
- &advance ) )
- continue;
-
- if ( started )
- {
- if ( advance != old_advance )
- {
- same_width = 0;
- break;
- }
- }
- else
- {
- old_advance = advance;
- started = 1;
- }
- }
-
- metrics->root.digits_have_same_width = same_width;
- }
-
-
- FT_LOCAL_DEF( FT_Error )
- af_latin2_metrics_init( AF_LatinMetrics metrics,
- FT_Face face )
- {
- FT_Error error = FT_Err_Ok;
- FT_CharMap oldmap = face->charmap;
- FT_UInt ee;
-
- static const FT_Encoding latin_encodings[] =
- {
- FT_ENCODING_UNICODE,
- FT_ENCODING_APPLE_ROMAN,
- FT_ENCODING_ADOBE_STANDARD,
- FT_ENCODING_ADOBE_LATIN_1,
- FT_ENCODING_NONE /* end of list */
- };
-
-
- metrics->units_per_em = face->units_per_EM;
-
- /* do we have a latin charmap in there? */
- for ( ee = 0; latin_encodings[ee] != FT_ENCODING_NONE; ee++ )
- {
- error = FT_Select_Charmap( face, latin_encodings[ee] );
- if ( !error )
- break;
- }
-
- if ( !error )
- {
- af_latin2_metrics_init_widths( metrics, face );
- af_latin2_metrics_init_blues( metrics, face );
- af_latin2_metrics_check_digits( metrics, face );
- }
-
- FT_Set_Charmap( face, oldmap );
- return FT_Err_Ok;
- }
-
-
- static void
- af_latin2_metrics_scale_dim( AF_LatinMetrics metrics,
- AF_Scaler scaler,
- AF_Dimension dim )
- {
- FT_Fixed scale;
- FT_Pos delta;
- AF_LatinAxis axis;
- FT_UInt nn;
-
-
- if ( dim == AF_DIMENSION_HORZ )
- {
- scale = scaler->x_scale;
- delta = scaler->x_delta;
- }
- else
- {
- scale = scaler->y_scale;
- delta = scaler->y_delta;
- }
-
- axis = &metrics->axis[dim];
-
- if ( axis->org_scale == scale && axis->org_delta == delta )
- return;
-
- axis->org_scale = scale;
- axis->org_delta = delta;
-
- /*
- * correct Y scale to optimize the alignment of the top of small
- * letters to the pixel grid
- */
- if ( dim == AF_DIMENSION_VERT )
- {
- AF_LatinAxis vaxis = &metrics->axis[AF_DIMENSION_VERT];
- AF_LatinBlue blue = NULL;
-
-
- for ( nn = 0; nn < vaxis->blue_count; nn++ )
- {
- if ( vaxis->blues[nn].flags & AF_LATIN_BLUE_ADJUSTMENT )
- {
- blue = &vaxis->blues[nn];
- break;
- }
- }
-
- if ( blue )
- {
- FT_Pos scaled;
- FT_Pos threshold;
- FT_Pos fitted;
- FT_UInt limit;
- FT_UInt ppem;
-
-
- scaled = FT_MulFix( blue->shoot.org, scaler->y_scale );
- ppem = metrics->root.scaler.face->size->metrics.x_ppem;
- limit = metrics->root.globals->increase_x_height;
- threshold = 40;
-
- /* if the `increase-x-height' property is active, */
- /* we round up much more often */
- if ( limit &&
- ppem <= limit &&
- ppem >= AF_PROP_INCREASE_X_HEIGHT_MIN )
- threshold = 52;
-
- fitted = ( scaled + threshold ) & ~63;
-
-#if 1
- if ( scaled != fitted )
- {
- scale = FT_MulDiv( scale, fitted, scaled );
- FT_TRACE5(( "== scaled x-top = %.2g"
- " fitted = %.2g, scaling = %.4g\n",
- scaled / 64.0, fitted / 64.0,
- ( fitted * 1.0 ) / scaled ));
- }
-#endif
- }
- }
-
- axis->scale = scale;
- axis->delta = delta;
-
- if ( dim == AF_DIMENSION_HORZ )
- {
- metrics->root.scaler.x_scale = scale;
- metrics->root.scaler.x_delta = delta;
- }
- else
- {
- metrics->root.scaler.y_scale = scale;
- metrics->root.scaler.y_delta = delta;
- }
-
- /* scale the standard widths */
- for ( nn = 0; nn < axis->width_count; nn++ )
- {
- AF_Width width = axis->widths + nn;
-
-
- width->cur = FT_MulFix( width->org, scale );
- width->fit = width->cur;
- }
-
- /* an extra-light axis corresponds to a standard width that is */
- /* smaller than 5/8 pixels */
- axis->extra_light =
- FT_BOOL( FT_MulFix( axis->standard_width, scale ) < 32 + 8 );
-
- if ( dim == AF_DIMENSION_VERT )
- {
- /* scale the blue zones */
- for ( nn = 0; nn < axis->blue_count; nn++ )
- {
- AF_LatinBlue blue = &axis->blues[nn];
- FT_Pos dist;
-
-
- blue->ref.cur = FT_MulFix( blue->ref.org, scale ) + delta;
- blue->ref.fit = blue->ref.cur;
- blue->shoot.cur = FT_MulFix( blue->shoot.org, scale ) + delta;
- blue->shoot.fit = blue->shoot.cur;
- blue->flags &= ~AF_LATIN_BLUE_ACTIVE;
-
- /* a blue zone is only active if it is less than 3/4 pixels tall */
- dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );
- if ( dist <= 48 && dist >= -48 )
- {
- FT_Pos delta1, delta2;
-
- delta1 = blue->shoot.org - blue->ref.org;
- delta2 = delta1;
- if ( delta1 < 0 )
- delta2 = -delta2;
-
- delta2 = FT_MulFix( delta2, scale );
-
- if ( delta2 < 32 )
- delta2 = 0;
- else if ( delta2 < 64 )
- delta2 = 32 + ( ( ( delta2 - 32 ) + 16 ) & ~31 );
- else
- delta2 = FT_PIX_ROUND( delta2 );
-
- if ( delta1 < 0 )
- delta2 = -delta2;
-
- blue->ref.fit = FT_PIX_ROUND( blue->ref.cur );
- blue->shoot.fit = blue->ref.fit + delta2;
-
- FT_TRACE5(( ">> activating blue zone %d:"
- " ref.cur=%.2g ref.fit=%.2g"
- " shoot.cur=%.2g shoot.fit=%.2g\n",
- nn, blue->ref.cur / 64.0, blue->ref.fit / 64.0,
- blue->shoot.cur / 64.0, blue->shoot.fit / 64.0 ));
-
- blue->flags |= AF_LATIN_BLUE_ACTIVE;
- }
- }
- }
- }
-
-
- FT_LOCAL_DEF( void )
- af_latin2_metrics_scale( AF_LatinMetrics metrics,
- AF_Scaler scaler )
- {
- metrics->root.scaler.render_mode = scaler->render_mode;
- metrics->root.scaler.face = scaler->face;
- metrics->root.scaler.flags = scaler->flags;
-
- af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_HORZ );
- af_latin2_metrics_scale_dim( metrics, scaler, AF_DIMENSION_VERT );
- }
-
-
- /* Extract standard_width from writing system/script specific */
- /* metrics class. */
-
- FT_LOCAL_DEF( void )
- af_latin2_get_standard_widths( AF_LatinMetrics metrics,
- FT_Pos* stdHW,
- FT_Pos* stdVW )
- {
- if ( stdHW )
- *stdHW = metrics->axis[AF_DIMENSION_VERT].standard_width;
-
- if ( stdVW )
- *stdVW = metrics->axis[AF_DIMENSION_HORZ].standard_width;
- }
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** L A T I N G L Y P H A N A L Y S I S *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
-#define SORT_SEGMENTS
-
- FT_LOCAL_DEF( FT_Error )
- af_latin2_hints_compute_segments( AF_GlyphHints hints,
- AF_Dimension dim )
- {
- AF_AxisHints axis = &hints->axis[dim];
- FT_Memory memory = hints->memory;
- FT_Error error = FT_Err_Ok;
- AF_Segment segment = NULL;
- AF_SegmentRec seg0;
- AF_Point* contour = hints->contours;
- AF_Point* contour_limit = contour + hints->num_contours;
- AF_Direction major_dir, segment_dir;
-
-
- FT_ZERO( &seg0 );
- seg0.score = 32000;
- seg0.flags = AF_EDGE_NORMAL;
-
- major_dir = (AF_Direction)FT_ABS( axis->major_dir );
- segment_dir = major_dir;
-
- axis->num_segments = 0;
-
- /* set up (u,v) in each point */
- if ( dim == AF_DIMENSION_HORZ )
- {
- AF_Point point = hints->points;
- AF_Point limit = point + hints->num_points;
-
-
- for ( ; point < limit; point++ )
- {
- point->u = point->fx;
- point->v = point->fy;
- }
- }
- else
- {
- AF_Point point = hints->points;
- AF_Point limit = point + hints->num_points;
-
-
- for ( ; point < limit; point++ )
- {
- point->u = point->fy;
- point->v = point->fx;
- }
- }
-
- /* do each contour separately */
- for ( ; contour < contour_limit; contour++ )
- {
- AF_Point point = contour[0];
- AF_Point start = point;
- AF_Point last = point->prev;
-
-
- if ( point == last ) /* skip singletons -- just in case */
- continue;
-
- /* already on an edge ?, backtrack to find its start */
- if ( FT_ABS( point->in_dir ) == major_dir )
- {
- point = point->prev;
-
- while ( point->in_dir == start->in_dir )
- point = point->prev;
- }
- else /* otherwise, find first segment start, if any */
- {
- while ( FT_ABS( point->out_dir ) != major_dir )
- {
- point = point->next;
-
- if ( point == start )
- goto NextContour;
- }
- }
-
- start = point;
-
- for (;;)
- {
- AF_Point first;
- FT_Pos min_u, min_v, max_u, max_v;
-
- /* we're at the start of a new segment */
- FT_ASSERT( FT_ABS( point->out_dir ) == major_dir &&
- point->in_dir != point->out_dir );
- first = point;
-
- min_u = max_u = point->u;
- min_v = max_v = point->v;
-
- point = point->next;
-
- while ( point->out_dir == first->out_dir )
- {
- point = point->next;
-
- if ( point->u < min_u )
- min_u = point->u;
-
- if ( point->u > max_u )
- max_u = point->u;
- }
-
- if ( point->v < min_v )
- min_v = point->v;
-
- if ( point->v > max_v )
- max_v = point->v;
-
- /* record new segment */
- error = af_axis_hints_new_segment( axis, memory, &segment );
- if ( error )
- goto Exit;
-
- segment[0] = seg0;
- segment->dir = first->out_dir;
- segment->first = first;
- segment->last = point;
- segment->pos = (FT_Short)( ( min_u + max_u ) >> 1 );
- segment->min_coord = (FT_Short) min_v;
- segment->max_coord = (FT_Short) max_v;
- segment->height = (FT_Short)( max_v - min_v );
-
- /* a segment is round if it doesn't have successive */
- /* on-curve points. */
- {
- AF_Point pt = first;
- AF_Point last = point;
- FT_UInt f0 = pt->flags & AF_FLAG_CONTROL;
- FT_UInt f1;
-
-
- segment->flags &= ~AF_EDGE_ROUND;
-
- for ( ; pt != last; f0 = f1 )
- {
- pt = pt->next;
- f1 = pt->flags & AF_FLAG_CONTROL;
-
- if ( !f0 && !f1 )
- break;
-
- if ( pt == last )
- segment->flags |= AF_EDGE_ROUND;
- }
- }
-
- /* this can happen in the case of a degenerate contour
- * e.g. a 2-point vertical contour
- */
- if ( point == start )
- break;
-
- /* jump to the start of the next segment, if any */
- while ( FT_ABS( point->out_dir ) != major_dir )
- {
- point = point->next;
-
- if ( point == start )
- goto NextContour;
- }
- }
-
- NextContour:
- ;
- } /* contours */
-
- /* now slightly increase the height of segments when this makes */
- /* sense -- this is used to better detect and ignore serifs */
- {
- AF_Segment segments = axis->segments;
- AF_Segment segments_end = segments + axis->num_segments;
-
-
- for ( segment = segments; segment < segments_end; segment++ )
- {
- AF_Point first = segment->first;
- AF_Point last = segment->last;
- AF_Point p;
- FT_Pos first_v = first->v;
- FT_Pos last_v = last->v;
-
-
- if ( first_v < last_v )
- {
- p = first->prev;
- if ( p->v < first_v )
- segment->height = (FT_Short)( segment->height +
- ( ( first_v - p->v ) >> 1 ) );
-
- p = last->next;
- if ( p->v > last_v )
- segment->height = (FT_Short)( segment->height +
- ( ( p->v - last_v ) >> 1 ) );
- }
- else
- {
- p = first->prev;
- if ( p->v > first_v )
- segment->height = (FT_Short)( segment->height +
- ( ( p->v - first_v ) >> 1 ) );
-
- p = last->next;
- if ( p->v < last_v )
- segment->height = (FT_Short)( segment->height +
- ( ( last_v - p->v ) >> 1 ) );
- }
- }
- }
-
-#ifdef AF_SORT_SEGMENTS
- /* place all segments with a negative direction to the start
- * of the array, used to speed up segment linking later...
- */
- {
- AF_Segment segments = axis->segments;
- FT_UInt count = axis->num_segments;
- FT_UInt ii, jj;
-
- for ( ii = 0; ii < count; ii++ )
- {
- if ( segments[ii].dir > 0 )
- {
- for ( jj = ii + 1; jj < count; jj++ )
- {
- if ( segments[jj].dir < 0 )
- {
- AF_SegmentRec tmp;
-
-
- tmp = segments[ii];
- segments[ii] = segments[jj];
- segments[jj] = tmp;
-
- break;
- }
- }
-
- if ( jj == count )
- break;
- }
- }
- axis->mid_segments = ii;
- }
-#endif
-
- Exit:
- return error;
- }
-
-
- FT_LOCAL_DEF( void )
- af_latin2_hints_link_segments( AF_GlyphHints hints,
- AF_Dimension dim )
- {
- AF_AxisHints axis = &hints->axis[dim];
- AF_Segment segments = axis->segments;
- AF_Segment segment_limit = segments + axis->num_segments;
-#ifdef AF_SORT_SEGMENTS
- AF_Segment segment_mid = segments + axis->mid_segments;
-#endif
- FT_Pos len_threshold, len_score;
- AF_Segment seg1, seg2;
-
-
- len_threshold = AF_LATIN_CONSTANT( hints->metrics, 8 );
- if ( len_threshold == 0 )
- len_threshold = 1;
-
- len_score = AF_LATIN_CONSTANT( hints->metrics, 6000 );
-
-#ifdef AF_SORT_SEGMENTS
- for ( seg1 = segments; seg1 < segment_mid; seg1++ )
- {
- if ( seg1->dir != axis->major_dir )
- continue;
-
- for ( seg2 = segment_mid; seg2 < segment_limit; seg2++ )
-#else
- /* now compare each segment to the others */
- for ( seg1 = segments; seg1 < segment_limit; seg1++ )
- {
- if ( seg1->dir != axis->major_dir )
- continue;
-
- for ( seg2 = segments; seg2 < segment_limit; seg2++ )
- if ( seg1->dir + seg2->dir == 0 && seg2->pos > seg1->pos )
-#endif
- {
- FT_Pos pos1 = seg1->pos;
- FT_Pos pos2 = seg2->pos;
- FT_Pos dist = pos2 - pos1;
-
-
- if ( dist < 0 )
- continue;
-
- {
- FT_Pos min = seg1->min_coord;
- FT_Pos max = seg1->max_coord;
- FT_Pos len, score;
-
-
- if ( min < seg2->min_coord )
- min = seg2->min_coord;
-
- if ( max > seg2->max_coord )
- max = seg2->max_coord;
-
- len = max - min;
- if ( len >= len_threshold )
- {
- score = dist + len_score / len;
- if ( score < seg1->score )
- {
- seg1->score = score;
- seg1->link = seg2;
- }
-
- if ( score < seg2->score )
- {
- seg2->score = score;
- seg2->link = seg1;
- }
- }
- }
- }
- }
-#if 0
- }
-#endif
-
- /* now, compute the `serif' segments */
- for ( seg1 = segments; seg1 < segment_limit; seg1++ )
- {
- seg2 = seg1->link;
-
- if ( seg2 )
- {
- if ( seg2->link != seg1 )
- {
- seg1->link = NULL;
- seg1->serif = seg2->link;
- }
- }
- }
- }
-
-
- FT_LOCAL_DEF( FT_Error )
- af_latin2_hints_compute_edges( AF_GlyphHints hints,
- AF_Dimension dim )
- {
- AF_AxisHints axis = &hints->axis[dim];
- FT_Error error = FT_Err_Ok;
- FT_Memory memory = hints->memory;
- AF_LatinAxis laxis = &((AF_LatinMetrics)hints->metrics)->axis[dim];
-
- AF_Segment segments = axis->segments;
- AF_Segment segment_limit = segments + axis->num_segments;
- AF_Segment seg;
-
- AF_Direction up_dir;
- FT_Fixed scale;
- FT_Pos edge_distance_threshold;
- FT_Pos segment_length_threshold;
-
-
- axis->num_edges = 0;
-
- scale = ( dim == AF_DIMENSION_HORZ ) ? hints->x_scale
- : hints->y_scale;
-
- up_dir = ( dim == AF_DIMENSION_HORZ ) ? AF_DIR_UP
- : AF_DIR_RIGHT;
-
- /*
- * We want to ignore very small (mostly serif) segments, we do that
- * by ignoring those that whose length is less than a given fraction
- * of the standard width. If there is no standard width, we ignore
- * those that are less than a given size in pixels
- *
- * also, unlink serif segments that are linked to segments farther
- * than 50% of the standard width
- */
- if ( dim == AF_DIMENSION_HORZ )
- {
- if ( laxis->width_count > 0 )
- segment_length_threshold = ( laxis->standard_width * 10 ) >> 4;
- else
- segment_length_threshold = FT_DivFix( 64, hints->y_scale );
- }
- else
- segment_length_threshold = 0;
-
- /**********************************************************************
- *
- * We will begin by generating a sorted table of edges for the
- * current direction. To do so, we simply scan each segment and try
- * to find an edge in our table that corresponds to its position.
- *
- * If no edge is found, we create and insert a new edge in the
- * sorted table. Otherwise, we simply add the segment to the edge's
- * list which will be processed in the second step to compute the
- * edge's properties.
- *
- * Note that the edges table is sorted along the segment/edge
- * position.
- *
- */
-
- edge_distance_threshold = FT_MulFix( laxis->edge_distance_threshold,
- scale );
- if ( edge_distance_threshold > 64 / 4 )
- edge_distance_threshold = 64 / 4;
-
- edge_distance_threshold = FT_DivFix( edge_distance_threshold,
- scale );
-
- for ( seg = segments; seg < segment_limit; seg++ )
- {
- AF_Edge found = NULL;
- FT_Int ee;
-
-
- if ( seg->height < segment_length_threshold )
- continue;
-
- /* A special case for serif edges: If they are smaller than */
- /* 1.5 pixels we ignore them. */
- if ( seg->serif )
- {
- FT_Pos dist = seg->serif->pos - seg->pos;
-
-
- if ( dist < 0 )
- dist = -dist;
-
- if ( dist >= laxis->standard_width >> 1 )
- {
- /* unlink this serif, it is too distant from its reference stem */
- seg->serif = NULL;
- }
- else if ( 2*seg->height < 3 * segment_length_threshold )
- continue;
- }
-
- /* look for an edge corresponding to the segment */
- for ( ee = 0; ee < axis->num_edges; ee++ )
- {
- AF_Edge edge = axis->edges + ee;
- FT_Pos dist;
-
-
- dist = seg->pos - edge->fpos;
- if ( dist < 0 )
- dist = -dist;
-
- if ( dist < edge_distance_threshold && edge->dir == seg->dir )
- {
- found = edge;
- break;
- }
- }
-
- if ( !found )
- {
- AF_Edge edge;
-
-
- /* insert a new edge in the list and */
- /* sort according to the position */
- error = af_axis_hints_new_edge( axis, seg->pos, seg->dir, 0,
- memory, &edge );
- if ( error )
- goto Exit;
-
- /* add the segment to the new edge's list */
- FT_ZERO( edge );
-
- edge->first = seg;
- edge->last = seg;
- edge->dir = seg->dir;
- edge->fpos = seg->pos;
- edge->opos = FT_MulFix( seg->pos, scale );
- edge->pos = edge->opos;
- seg->edge_next = seg;
- }
- else
- {
- /* if an edge was found, simply add the segment to the edge's */
- /* list */
- seg->edge_next = found->first;
- found->last->edge_next = seg;
- found->last = seg;
- }
- }
-
-
- /**********************************************************************
- *
- * Good, we will now compute each edge's properties according to
- * segments found on its position. Basically, these are:
- *
- * - edge's main direction
- * - stem edge, serif edge or both (which defaults to stem then)
- * - rounded edge, straight or both (which defaults to straight)
- * - link for edge
- *
- */
-
- /* first of all, set the `edge' field in each segment -- this is */
- /* required in order to compute edge links */
-
- /*
- * Note that removing this loop and setting the `edge' field of each
- * segment directly in the code above slows down execution speed for
- * some reasons on platforms like the Sun.
- */
- {
- AF_Edge edges = axis->edges;
- AF_Edge edge_limit = edges + axis->num_edges;
- AF_Edge edge;
-
-
- for ( edge = edges; edge < edge_limit; edge++ )
- {
- seg = edge->first;
- if ( seg )
- do
- {
- seg->edge = edge;
- seg = seg->edge_next;
-
- } while ( seg != edge->first );
- }
-
- /* now, compute each edge properties */
- for ( edge = edges; edge < edge_limit; edge++ )
- {
- FT_Int is_round = 0; /* does it contain round segments? */
- FT_Int is_straight = 0; /* does it contain straight segments? */
-#if 0
- FT_Pos ups = 0; /* number of upwards segments */
- FT_Pos downs = 0; /* number of downwards segments */
-#endif
-
-
- seg = edge->first;
-
- do
- {
- FT_Bool is_serif;
-
-
- /* check for roundness of segment */
- if ( seg->flags & AF_EDGE_ROUND )
- is_round++;
- else
- is_straight++;
-
-#if 0
- /* check for segment direction */
- if ( seg->dir == up_dir )
- ups += seg->max_coord-seg->min_coord;
- else
- downs += seg->max_coord-seg->min_coord;
-#endif
-
- /* check for links -- if seg->serif is set, then seg->link must */
- /* be ignored */
- is_serif = FT_BOOL( seg->serif &&
- seg->serif->edge &&
- seg->serif->edge != edge );
-
- if ( ( seg->link && seg->link->edge ) || is_serif )
- {
- AF_Edge edge2;
- AF_Segment seg2;
-
-
- edge2 = edge->link;
- seg2 = seg->link;
-
- if ( is_serif )
- {
- seg2 = seg->serif;
- edge2 = edge->serif;
- }
-
- if ( edge2 )
- {
- FT_Pos edge_delta;
- FT_Pos seg_delta;
-
-
- edge_delta = edge->fpos - edge2->fpos;
- if ( edge_delta < 0 )
- edge_delta = -edge_delta;
-
- seg_delta = seg->pos - seg2->pos;
- if ( seg_delta < 0 )
- seg_delta = -seg_delta;
-
- if ( seg_delta < edge_delta )
- edge2 = seg2->edge;
- }
- else
- edge2 = seg2->edge;
-
- if ( is_serif )
- {
- edge->serif = edge2;
- edge2->flags |= AF_EDGE_SERIF;
- }
- else
- edge->link = edge2;
- }
-
- seg = seg->edge_next;
-
- } while ( seg != edge->first );
-
- /* set the round/straight flags */
- edge->flags = AF_EDGE_NORMAL;
-
- if ( is_round > 0 && is_round >= is_straight )
- edge->flags |= AF_EDGE_ROUND;
-
-#if 0
- /* set the edge's main direction */
- edge->dir = AF_DIR_NONE;
-
- if ( ups > downs )
- edge->dir = (FT_Char)up_dir;
-
- else if ( ups < downs )
- edge->dir = (FT_Char)-up_dir;
-
- else if ( ups == downs )
- edge->dir = 0; /* both up and down! */
-#endif
-
- /* gets rid of serifs if link is set */
- /* XXX: This gets rid of many unpleasant artefacts! */
- /* Example: the `c' in cour.pfa at size 13 */
-
- if ( edge->serif && edge->link )
- edge->serif = NULL;
- }
- }
-
- Exit:
- return error;
- }
-
-
- FT_LOCAL_DEF( FT_Error )
- af_latin2_hints_detect_features( AF_GlyphHints hints,
- AF_Dimension dim )
- {
- FT_Error error;
-
-
- error = af_latin2_hints_compute_segments( hints, dim );
- if ( !error )
- {
- af_latin2_hints_link_segments( hints, dim );
-
- error = af_latin2_hints_compute_edges( hints, dim );
- }
- return error;
- }
-
-
- static void
- af_latin2_hints_compute_blue_edges( AF_GlyphHints hints,
- AF_LatinMetrics metrics )
- {
- AF_AxisHints axis = &hints->axis[AF_DIMENSION_VERT];
- AF_Edge edge = axis->edges;
- AF_Edge edge_limit = edge + axis->num_edges;
- AF_LatinAxis latin = &metrics->axis[AF_DIMENSION_VERT];
- FT_Fixed scale = latin->scale;
- FT_Pos best_dist0; /* initial threshold */
-
-
- /* compute the initial threshold as a fraction of the EM size */
- best_dist0 = FT_MulFix( metrics->units_per_em / 40, scale );
-
- if ( best_dist0 > 64 / 2 )
- best_dist0 = 64 / 2;
-
- /* compute which blue zones are active, i.e. have their scaled */
- /* size < 3/4 pixels */
-
- /* for each horizontal edge search the blue zone which is closest */
- for ( ; edge < edge_limit; edge++ )
- {
- FT_Int bb;
- AF_Width best_blue = NULL;
- FT_Pos best_dist = best_dist0;
-
- for ( bb = 0; bb < AF_LATIN_BLUE_MAX; bb++ )
- {
- AF_LatinBlue blue = latin->blues + bb;
- FT_Bool is_top_blue, is_major_dir;
-
-
- /* skip inactive blue zones (i.e., those that are too small) */
- if ( !( blue->flags & AF_LATIN_BLUE_ACTIVE ) )
- continue;
-
- /* if it is a top zone, check for right edges -- if it is a bottom */
- /* zone, check for left edges */
- /* */
- /* of course, that's for TrueType */
- is_top_blue = (FT_Byte)( ( blue->flags & AF_LATIN_BLUE_TOP ) != 0 );
- is_major_dir = FT_BOOL( edge->dir == axis->major_dir );
-
- /* if it is a top zone, the edge must be against the major */
- /* direction; if it is a bottom zone, it must be in the major */
- /* direction */
- if ( is_top_blue ^ is_major_dir )
- {
- FT_Pos dist;
- AF_Width compare;
-
-
- /* if it's a rounded edge, compare it to the overshoot position */
- /* if it's a flat edge, compare it to the reference position */
- if ( edge->flags & AF_EDGE_ROUND )
- compare = &blue->shoot;
- else
- compare = &blue->ref;
-
- dist = edge->fpos - compare->org;
- if ( dist < 0 )
- dist = -dist;
-
- dist = FT_MulFix( dist, scale );
- if ( dist < best_dist )
- {
- best_dist = dist;
- best_blue = compare;
- }
-
-#if 0
- /* now, compare it to the overshoot position if the edge is */
- /* rounded, and if the edge is over the reference position of a */
- /* top zone, or under the reference position of a bottom zone */
- if ( edge->flags & AF_EDGE_ROUND && dist != 0 )
- {
- FT_Bool is_under_ref = FT_BOOL( edge->fpos < blue->ref.org );
-
-
- if ( is_top_blue ^ is_under_ref )
- {
- blue = latin->blues + bb;
- dist = edge->fpos - blue->shoot.org;
- if ( dist < 0 )
- dist = -dist;
-
- dist = FT_MulFix( dist, scale );
- if ( dist < best_dist )
- {
- best_dist = dist;
- best_blue = & blue->shoot;
- }
- }
- }
-#endif
- }
- }
-
- if ( best_blue )
- edge->blue_edge = best_blue;
- }
- }
-
-
- static FT_Error
- af_latin2_hints_init( AF_GlyphHints hints,
- AF_LatinMetrics metrics )
- {
- FT_Render_Mode mode;
- FT_UInt32 scaler_flags, other_flags;
- FT_Face face = metrics->root.scaler.face;
-
-
- af_glyph_hints_rescale( hints, (AF_StyleMetrics)metrics );
-
- /*
- * correct x_scale and y_scale if needed, since they may have
- * been modified `af_latin2_metrics_scale_dim' above
- */
- hints->x_scale = metrics->axis[AF_DIMENSION_HORZ].scale;
- hints->x_delta = metrics->axis[AF_DIMENSION_HORZ].delta;
- hints->y_scale = metrics->axis[AF_DIMENSION_VERT].scale;
- hints->y_delta = metrics->axis[AF_DIMENSION_VERT].delta;
-
- /* compute flags depending on render mode, etc. */
- mode = metrics->root.scaler.render_mode;
-
-#if 0 /* #ifdef AF_CONFIG_OPTION_USE_WARPER */
- if ( mode == FT_RENDER_MODE_LCD || mode == FT_RENDER_MODE_LCD_V )
- metrics->root.scaler.render_mode = mode = FT_RENDER_MODE_NORMAL;
-#endif
-
- scaler_flags = hints->scaler_flags;
- other_flags = 0;
-
- /*
- * We snap the width of vertical stems for the monochrome and
- * horizontal LCD rendering targets only.
- */
- if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD )
- other_flags |= AF_LATIN_HINTS_HORZ_SNAP;
-
- /*
- * We snap the width of horizontal stems for the monochrome and
- * vertical LCD rendering targets only.
- */
- if ( mode == FT_RENDER_MODE_MONO || mode == FT_RENDER_MODE_LCD_V )
- other_flags |= AF_LATIN_HINTS_VERT_SNAP;
-
- /*
- * We adjust stems to full pixels unless in `light' or `lcd' mode.
- */
- if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
- other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
-
- if ( mode == FT_RENDER_MODE_MONO )
- other_flags |= AF_LATIN_HINTS_MONO;
-
- /*
- * In `light' or `lcd' mode we disable horizontal hinting completely.
- * We also do it if the face is italic.
- */
- if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
- ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
- scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
-
-#ifdef AF_CONFIG_OPTION_USE_WARPER
- /* get (global) warper flag */
- if ( !metrics->root.globals->module->warping )
- scaler_flags |= AF_SCALER_FLAG_NO_WARPER;
-#endif
-
- hints->scaler_flags = scaler_flags;
- hints->other_flags = other_flags;
-
- return 0;
- }
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** L A T I N G L Y P H G R I D - F I T T I N G *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
- /* snap a given width in scaled coordinates to one of the */
- /* current standard widths */
-
- static FT_Pos
- af_latin2_snap_width( AF_Width widths,
- FT_UInt count,
- FT_Pos width )
- {
- FT_UInt n;
- FT_Pos best = 64 + 32 + 2;
- FT_Pos reference = width;
- FT_Pos scaled;
-
-
- for ( n = 0; n < count; n++ )
- {
- FT_Pos w;
- FT_Pos dist;
-
-
- w = widths[n].cur;
- dist = width - w;
- if ( dist < 0 )
- dist = -dist;
- if ( dist < best )
- {
- best = dist;
- reference = w;
- }
- }
-
- scaled = FT_PIX_ROUND( reference );
-
- if ( width >= reference )
- {
- if ( width < scaled + 48 )
- width = reference;
- }
- else
- {
- if ( width > scaled - 48 )
- width = reference;
- }
-
- return width;
- }
-
-
- /* compute the snapped width of a given stem */
-
- static FT_Pos
- af_latin2_compute_stem_width( AF_GlyphHints hints,
- AF_Dimension dim,
- FT_Pos width,
- FT_UInt base_flags,
- FT_UInt stem_flags )
- {
- AF_LatinMetrics metrics = (AF_LatinMetrics) hints->metrics;
- AF_LatinAxis axis = & metrics->axis[dim];
- FT_Pos dist = width;
- FT_Int sign = 0;
- FT_Int vertical = ( dim == AF_DIMENSION_VERT );
-
- FT_UNUSED( base_flags );
-
-
- if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||
- axis->extra_light )
- return width;
-
- if ( dist < 0 )
- {
- dist = -width;
- sign = 1;
- }
-
- if ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||
- ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) )
- {
- /* smooth hinting process: very lightly quantize the stem width */
-
- /* leave the widths of serifs alone */
-
- if ( ( stem_flags & AF_EDGE_SERIF ) && vertical && ( dist < 3 * 64 ) )
- goto Done_Width;
-
-#if 0
- else if ( ( base_flags & AF_EDGE_ROUND ) )
- {
- if ( dist < 80 )
- dist = 64;
- }
- else if ( dist < 56 )
- dist = 56;
-#endif
- if ( axis->width_count > 0 )
- {
- FT_Pos delta;
-
-
- /* compare to standard width */
- if ( axis->width_count > 0 )
- {
- delta = dist - axis->widths[0].cur;
-
- if ( delta < 0 )
- delta = -delta;
-
- if ( delta < 40 )
- {
- dist = axis->widths[0].cur;
- if ( dist < 48 )
- dist = 48;
-
- goto Done_Width;
- }
- }
-
- if ( dist < 3 * 64 )
- {
- delta = dist & 63;
- dist &= -64;
-
- if ( delta < 10 )
- dist += delta;
-
- else if ( delta < 32 )
- dist += 10;
-
- else if ( delta < 54 )
- dist += 54;
-
- else
- dist += delta;
- }
- else
- dist = ( dist + 32 ) & ~63;
- }
- }
- else
- {
- /* strong hinting process: snap the stem width to integer pixels */
- FT_Pos org_dist = dist;
-
-
- dist = af_latin2_snap_width( axis->widths, axis->width_count, dist );
-
- if ( vertical )
- {
- /* in the case of vertical hinting, always round */
- /* the stem heights to integer pixels */
-
- if ( dist >= 64 )
- dist = ( dist + 16 ) & ~63;
- else
- dist = 64;
- }
- else
- {
- if ( AF_LATIN_HINTS_DO_MONO( hints ) )
- {
- /* monochrome horizontal hinting: snap widths to integer pixels */
- /* with a different threshold */
-
- if ( dist < 64 )
- dist = 64;
- else
- dist = ( dist + 32 ) & ~63;
- }
- else
- {
- /* for horizontal anti-aliased hinting, we adopt a more subtle */
- /* approach: we strengthen small stems, round stems whose size */
- /* is between 1 and 2 pixels to an integer, otherwise nothing */
-
- if ( dist < 48 )
- dist = ( dist + 64 ) >> 1;
-
- else if ( dist < 128 )
- {
- /* We only round to an integer width if the corresponding */
- /* distortion is less than 1/4 pixel. Otherwise this */
- /* makes everything worse since the diagonals, which are */
- /* not hinted, appear a lot bolder or thinner than the */
- /* vertical stems. */
-
- FT_Int delta;
-
-
- dist = ( dist + 22 ) & ~63;
- delta = dist - org_dist;
- if ( delta < 0 )
- delta = -delta;
-
- if ( delta >= 16 )
- {
- dist = org_dist;
- if ( dist < 48 )
- dist = ( dist + 64 ) >> 1;
- }
- }
- else
- /* round otherwise to prevent color fringes in LCD mode */
- dist = ( dist + 32 ) & ~63;
- }
- }
- }
-
- Done_Width:
- if ( sign )
- dist = -dist;
-
- return dist;
- }
-
-
- /* align one stem edge relative to the previous stem edge */
-
- static void
- af_latin2_align_linked_edge( AF_GlyphHints hints,
- AF_Dimension dim,
- AF_Edge base_edge,
- AF_Edge stem_edge )
- {
- FT_Pos dist = stem_edge->opos - base_edge->opos;
-
- FT_Pos fitted_width = af_latin2_compute_stem_width( hints, dim, dist,
- base_edge->flags,
- stem_edge->flags );
-
-
- stem_edge->pos = base_edge->pos + fitted_width;
-
- FT_TRACE5(( "LINK: edge %d (opos=%.2f) linked to (%.2f), "
- "dist was %.2f, now %.2f\n",
- stem_edge-hints->axis[dim].edges, stem_edge->opos / 64.0,
- stem_edge->pos / 64.0, dist / 64.0, fitted_width / 64.0 ));
- }
-
-
- static void
- af_latin2_align_serif_edge( AF_GlyphHints hints,
- AF_Edge base,
- AF_Edge serif )
- {
- FT_UNUSED( hints );
-
- serif->pos = base->pos + ( serif->opos - base->opos );
- }
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** E D G E H I N T I N G ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- static void
- af_latin2_hint_edges( AF_GlyphHints hints,
- AF_Dimension dim )
- {
- AF_AxisHints axis = &hints->axis[dim];
- AF_Edge edges = axis->edges;
- AF_Edge edge_limit = edges + axis->num_edges;
- AF_Edge edge;
- AF_Edge anchor = NULL;
- FT_Int has_serifs = 0;
- FT_Pos anchor_drift = 0;
-
-
-
- FT_TRACE5(( "==== hinting %s edges =====\n",
- dim == AF_DIMENSION_HORZ ? "vertical" : "horizontal" ));
-
- /* we begin by aligning all stems relative to the blue zone */
- /* if needed -- that's only for horizontal edges */
-
- if ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_BLUES( hints ) )
- {
- for ( edge = edges; edge < edge_limit; edge++ )
- {
- AF_Width blue;
- AF_Edge edge1, edge2;
-
-
- if ( edge->flags & AF_EDGE_DONE )
- continue;
-
- blue = edge->blue_edge;
- edge1 = NULL;
- edge2 = edge->link;
-
- if ( blue )
- {
- edge1 = edge;
- }
- else if ( edge2 && edge2->blue_edge )
- {
- blue = edge2->blue_edge;
- edge1 = edge2;
- edge2 = edge;
- }
-
- if ( !edge1 )
- continue;
-
- FT_TRACE5(( "BLUE: edge %d (opos=%.2f) snapped to (%.2f), "
- "was (%.2f)\n",
- edge1-edges, edge1->opos / 64.0, blue->fit / 64.0,
- edge1->pos / 64.0 ));
-
- edge1->pos = blue->fit;
- edge1->flags |= AF_EDGE_DONE;
-
- if ( edge2 && !edge2->blue_edge )
- {
- af_latin2_align_linked_edge( hints, dim, edge1, edge2 );
- edge2->flags |= AF_EDGE_DONE;
- }
-
- if ( !anchor )
- {
- anchor = edge;
-
- anchor_drift = ( anchor->pos - anchor->opos );
- if ( edge2 )
- anchor_drift = ( anchor_drift +
- ( edge2->pos - edge2->opos ) ) >> 1;
- }
- }
- }
-
- /* now we will align all stem edges, trying to maintain the */
- /* relative order of stems in the glyph */
- for ( edge = edges; edge < edge_limit; edge++ )
- {
- AF_Edge edge2;
-
-
- if ( edge->flags & AF_EDGE_DONE )
- continue;
-
- /* skip all non-stem edges */
- edge2 = edge->link;
- if ( !edge2 )
- {
- has_serifs++;
- continue;
- }
-
- /* now align the stem */
-
- /* this should not happen, but it's better to be safe */
- if ( edge2->blue_edge )
- {
- FT_TRACE5(( "ASSERTION FAILED for edge %d\n", edge2-edges ));
-
- af_latin2_align_linked_edge( hints, dim, edge2, edge );
- edge->flags |= AF_EDGE_DONE;
- continue;
- }
-
- if ( !anchor )
- {
- FT_Pos org_len, org_center, cur_len;
- FT_Pos cur_pos1, error1, error2, u_off, d_off;
-
-
- org_len = edge2->opos - edge->opos;
- cur_len = af_latin2_compute_stem_width( hints, dim, org_len,
- edge->flags,
- edge2->flags );
- if ( cur_len <= 64 )
- u_off = d_off = 32;
- else
- {
- u_off = 38;
- d_off = 26;
- }
-
- if ( cur_len < 96 )
- {
- org_center = edge->opos + ( org_len >> 1 );
-
- cur_pos1 = FT_PIX_ROUND( org_center );
-
- error1 = org_center - ( cur_pos1 - u_off );
- if ( error1 < 0 )
- error1 = -error1;
-
- error2 = org_center - ( cur_pos1 + d_off );
- if ( error2 < 0 )
- error2 = -error2;
-
- if ( error1 < error2 )
- cur_pos1 -= u_off;
- else
- cur_pos1 += d_off;
-
- edge->pos = cur_pos1 - cur_len / 2;
- edge2->pos = edge->pos + cur_len;
- }
- else
- edge->pos = FT_PIX_ROUND( edge->opos );
-
- FT_TRACE5(( "ANCHOR: edge %d (opos=%.2f) and %d (opos=%.2f)"
- " snapped to (%.2f) (%.2f)\n",
- edge-edges, edge->opos / 64.0,
- edge2-edges, edge2->opos / 64.0,
- edge->pos / 64.0, edge2->pos / 64.0 ));
- anchor = edge;
-
- edge->flags |= AF_EDGE_DONE;
-
- af_latin2_align_linked_edge( hints, dim, edge, edge2 );
-
- edge2->flags |= AF_EDGE_DONE;
-
- anchor_drift = ( ( anchor->pos - anchor->opos ) +
- ( edge2->pos - edge2->opos ) ) >> 1;
-
- FT_TRACE5(( "DRIFT: %.2f\n", anchor_drift/64.0 ));
- }
- else
- {
- FT_Pos org_pos, org_len, org_center, cur_center, cur_len;
- FT_Pos org_left, org_right;
-
-
- org_pos = edge->opos + anchor_drift;
- org_len = edge2->opos - edge->opos;
- org_center = org_pos + ( org_len >> 1 );
-
- cur_len = af_latin2_compute_stem_width( hints, dim, org_len,
- edge->flags,
- edge2->flags );
-
- org_left = org_pos + ( ( org_len - cur_len ) >> 1 );
- org_right = org_pos + ( ( org_len + cur_len ) >> 1 );
-
- FT_TRACE5(( "ALIGN: left=%.2f right=%.2f ",
- org_left / 64.0, org_right / 64.0 ));
- cur_center = org_center;
-
- if ( edge2->flags & AF_EDGE_DONE )
- {
- FT_TRACE5(( "\n" ));
- edge->pos = edge2->pos - cur_len;
- }
- else
- {
- /* we want to compare several displacement, and choose
- * the one that increases fitness while minimizing
- * distortion as well
- */
- FT_Pos displacements[6], scores[6], org, fit, delta;
- FT_UInt count = 0;
-
- /* note: don't even try to fit tiny stems */
- if ( cur_len < 32 )
- {
- FT_TRACE5(( "tiny stem\n" ));
- goto AlignStem;
- }
-
- /* if the span is within a single pixel, don't touch it */
- if ( FT_PIX_FLOOR( org_left ) == FT_PIX_CEIL( org_right ) )
- {
- FT_TRACE5(( "single pixel stem\n" ));
- goto AlignStem;
- }
-
- if ( cur_len <= 96 )
- {
- /* we want to avoid the absolute worst case which is
- * when the left and right edges of the span each represent
- * about 50% of the gray. we'd better want to change this
- * to 25/75%, since this is much more pleasant to the eye with
- * very acceptable distortion
- */
- FT_Pos frac_left = org_left & 63;
- FT_Pos frac_right = org_right & 63;
-
- if ( frac_left >= 22 && frac_left <= 42 &&
- frac_right >= 22 && frac_right <= 42 )
- {
- org = frac_left;
- fit = ( org <= 32 ) ? 16 : 48;
- delta = FT_ABS( fit - org );
- displacements[count] = fit - org;
- scores[count++] = delta;
- FT_TRACE5(( "dispA=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
-
- org = frac_right;
- fit = ( org <= 32 ) ? 16 : 48;
- delta = FT_ABS( fit - org );
- displacements[count] = fit - org;
- scores[count++] = delta;
- FT_TRACE5(( "dispB=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
- }
- }
-
- /* snapping the left edge to the grid */
- org = org_left;
- fit = FT_PIX_ROUND( org );
- delta = FT_ABS( fit - org );
- displacements[count] = fit - org;
- scores[count++] = delta;
- FT_TRACE5(( "dispC=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
-
- /* snapping the right edge to the grid */
- org = org_right;
- fit = FT_PIX_ROUND( org );
- delta = FT_ABS( fit - org );
- displacements[count] = fit - org;
- scores[count++] = delta;
- FT_TRACE5(( "dispD=%.2f (%d) ", ( fit - org ) / 64.0, delta ));
-
- /* now find the best displacement */
- {
- FT_Pos best_score = scores[0];
- FT_Pos best_disp = displacements[0];
- FT_UInt nn;
-
- for ( nn = 1; nn < count; nn++ )
- {
- if ( scores[nn] < best_score )
- {
- best_score = scores[nn];
- best_disp = displacements[nn];
- }
- }
-
- cur_center = org_center + best_disp;
- }
- FT_TRACE5(( "\n" ));
- }
-
- AlignStem:
- edge->pos = cur_center - ( cur_len >> 1 );
- edge2->pos = edge->pos + cur_len;
-
- FT_TRACE5(( "STEM1: %d (opos=%.2f) to %d (opos=%.2f)"
- " snapped to (%.2f) and (%.2f),"
- " org_len=%.2f cur_len=%.2f\n",
- edge-edges, edge->opos / 64.0,
- edge2-edges, edge2->opos / 64.0,
- edge->pos / 64.0, edge2->pos / 64.0,
- org_len / 64.0, cur_len / 64.0 ));
-
- edge->flags |= AF_EDGE_DONE;
- edge2->flags |= AF_EDGE_DONE;
-
- if ( edge > edges && edge->pos < edge[-1].pos )
- {
- FT_TRACE5(( "BOUND: %d (pos=%.2f) to (%.2f)\n",
- edge-edges, edge->pos / 64.0, edge[-1].pos / 64.0 ));
- edge->pos = edge[-1].pos;
- }
- }
- }
-
- /* make sure that lowercase m's maintain their symmetry */
-
- /* In general, lowercase m's have six vertical edges if they are sans */
- /* serif, or twelve if they are with serifs. This implementation is */
- /* based on that assumption, and seems to work very well with most */
- /* faces. However, if for a certain face this assumption is not */
- /* true, the m is just rendered like before. In addition, any stem */
- /* correction will only be applied to symmetrical glyphs (even if the */
- /* glyph is not an m), so the potential for unwanted distortion is */
- /* relatively low. */
-
- /* We don't handle horizontal edges since we can't easily assure that */
- /* the third (lowest) stem aligns with the base line; it might end up */
- /* one pixel higher or lower. */
-
-#if 0
- {
- FT_Int n_edges = edge_limit - edges;
-
-
- if ( dim == AF_DIMENSION_HORZ && ( n_edges == 6 || n_edges == 12 ) )
- {
- AF_Edge edge1, edge2, edge3;
- FT_Pos dist1, dist2, span, delta;
-
-
- if ( n_edges == 6 )
- {
- edge1 = edges;
- edge2 = edges + 2;
- edge3 = edges + 4;
- }
- else
- {
- edge1 = edges + 1;
- edge2 = edges + 5;
- edge3 = edges + 9;
- }
-
- dist1 = edge2->opos - edge1->opos;
- dist2 = edge3->opos - edge2->opos;
-
- span = dist1 - dist2;
- if ( span < 0 )
- span = -span;
-
- if ( span < 8 )
- {
- delta = edge3->pos - ( 2 * edge2->pos - edge1->pos );
- edge3->pos -= delta;
- if ( edge3->link )
- edge3->link->pos -= delta;
-
- /* move the serifs along with the stem */
- if ( n_edges == 12 )
- {
- ( edges + 8 )->pos -= delta;
- ( edges + 11 )->pos -= delta;
- }
-
- edge3->flags |= AF_EDGE_DONE;
- if ( edge3->link )
- edge3->link->flags |= AF_EDGE_DONE;
- }
- }
- }
-#endif
-
- if ( has_serifs || !anchor )
- {
- /*
- * now hint the remaining edges (serifs and single) in order
- * to complete our processing
- */
- for ( edge = edges; edge < edge_limit; edge++ )
- {
- FT_Pos delta;
-
-
- if ( edge->flags & AF_EDGE_DONE )
- continue;
-
- delta = 1000;
-
- if ( edge->serif )
- {
- delta = edge->serif->opos - edge->opos;
- if ( delta < 0 )
- delta = -delta;
- }
-
- if ( delta < 64 + 16 )
- {
- af_latin2_align_serif_edge( hints, edge->serif, edge );
- FT_TRACE5(( "SERIF: edge %d (opos=%.2f) serif to %d (opos=%.2f)"
- " aligned to (%.2f)\n",
- edge-edges, edge->opos / 64.0,
- edge->serif - edges, edge->serif->opos / 64.0,
- edge->pos / 64.0 ));
- }
- else if ( !anchor )
- {
- FT_TRACE5(( "SERIF_ANCHOR: edge %d (opos=%.2f)"
- " snapped to (%.2f)\n",
- edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
- edge->pos = FT_PIX_ROUND( edge->opos );
- anchor = edge;
- }
- else
- {
- AF_Edge before, after;
-
-
- for ( before = edge - 1; before >= edges; before-- )
- if ( before->flags & AF_EDGE_DONE )
- break;
-
- for ( after = edge + 1; after < edge_limit; after++ )
- if ( after->flags & AF_EDGE_DONE )
- break;
-
- if ( before >= edges && before < edge &&
- after < edge_limit && after > edge )
- {
- if ( after->opos == before->opos )
- edge->pos = before->pos;
- else
- edge->pos = before->pos +
- FT_MulDiv( edge->opos - before->opos,
- after->pos - before->pos,
- after->opos - before->opos );
- FT_TRACE5(( "SERIF_LINK1: edge %d (opos=%.2f) snapped to (%.2f)"
- " from %d (opos=%.2f)\n",
- edge-edges, edge->opos / 64.0, edge->pos / 64.0,
- before - edges, before->opos / 64.0 ));
- }
- else
- {
- edge->pos = anchor->pos +
- ( ( edge->opos - anchor->opos + 16 ) & ~31 );
-
- FT_TRACE5(( "SERIF_LINK2: edge %d (opos=%.2f)"
- " snapped to (%.2f)\n",
- edge-edges, edge->opos / 64.0, edge->pos / 64.0 ));
- }
- }
-
- edge->flags |= AF_EDGE_DONE;
-
- if ( edge > edges && edge->pos < edge[-1].pos )
- edge->pos = edge[-1].pos;
-
- if ( edge + 1 < edge_limit &&
- edge[1].flags & AF_EDGE_DONE &&
- edge->pos > edge[1].pos )
- edge->pos = edge[1].pos;
- }
- }
- }
-
-
- static FT_Error
- af_latin2_hints_apply( FT_UInt glyph_index,
- AF_GlyphHints hints,
- FT_Outline* outline,
- AF_LatinMetrics metrics )
- {
- FT_Error error;
- int dim;
-
- FT_UNUSED( glyph_index );
-
-
- error = af_glyph_hints_reload( hints, outline );
- if ( error )
- goto Exit;
-
- /* analyze glyph outline */
- if ( AF_HINTS_DO_HORIZONTAL( hints ) )
- {
- error = af_latin2_hints_detect_features( hints, AF_DIMENSION_HORZ );
- if ( error )
- goto Exit;
- }
-
- if ( AF_HINTS_DO_VERTICAL( hints ) )
- {
- error = af_latin2_hints_detect_features( hints, AF_DIMENSION_VERT );
- if ( error )
- goto Exit;
-
- af_latin2_hints_compute_blue_edges( hints, metrics );
- }
-
- /* grid-fit the outline */
- for ( dim = 0; dim < AF_DIMENSION_MAX; dim++ )
- {
-#ifdef AF_CONFIG_OPTION_USE_WARPER
- if ( dim == AF_DIMENSION_HORZ &&
- metrics->root.scaler.render_mode == FT_RENDER_MODE_NORMAL &&
- AF_HINTS_DO_WARP( hints ) )
- {
- AF_WarperRec warper;
- FT_Fixed scale;
- FT_Pos delta;
-
-
- af_warper_compute( &warper, hints, dim, &scale, &delta );
- af_glyph_hints_scale_dim( hints, dim, scale, delta );
- continue;
- }
-#endif /* AF_CONFIG_OPTION_USE_WARPER */
-
- if ( ( dim == AF_DIMENSION_HORZ && AF_HINTS_DO_HORIZONTAL( hints ) ) ||
- ( dim == AF_DIMENSION_VERT && AF_HINTS_DO_VERTICAL( hints ) ) )
- {
- af_latin2_hint_edges( hints, (AF_Dimension)dim );
- af_glyph_hints_align_edge_points( hints, (AF_Dimension)dim );
- af_glyph_hints_align_strong_points( hints, (AF_Dimension)dim );
- af_glyph_hints_align_weak_points( hints, (AF_Dimension)dim );
- }
- }
- af_glyph_hints_save( hints, outline );
-
- Exit:
- return error;
- }
-
-
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** L A T I N S C R I P T C L A S S *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
-
-
- AF_DEFINE_WRITING_SYSTEM_CLASS(
- af_latin2_writing_system_class,
-
- AF_WRITING_SYSTEM_LATIN2,
-
- sizeof ( AF_LatinMetricsRec ),
-
- (AF_WritingSystem_InitMetricsFunc) af_latin2_metrics_init, /* style_metrics_init */
- (AF_WritingSystem_ScaleMetricsFunc)af_latin2_metrics_scale, /* style_metrics_scale */
- (AF_WritingSystem_DoneMetricsFunc) NULL, /* style_metrics_done */
- (AF_WritingSystem_GetStdWidthsFunc)af_latin2_get_standard_widths, /* style_metrics_getstdw */
-
- (AF_WritingSystem_InitHintsFunc) af_latin2_hints_init, /* style_hints_init */
- (AF_WritingSystem_ApplyHintsFunc) af_latin2_hints_apply /* style_hints_apply */
- )
-
-#else /* !FT_OPTION_AUTOFIT2 */
-
- /* ANSI C doesn't like empty source files */
- typedef int _af_latin2_dummy;
-
-#endif /* !FT_OPTION_AUTOFIT2 */
-
-
-/* END */
diff --git a/freetype/src/autofit/aflatin2.h b/freetype/src/autofit/aflatin2.h
deleted file mode 100644
index c2aebc49..00000000
--- a/freetype/src/autofit/aflatin2.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ATTENTION: This file doesn't compile. It is only here as a reference */
-/* of an alternative latin hinting algorithm that was always */
-/* marked as experimental. */
-
-
-/****************************************************************************
- *
- * aflatin2.h
- *
- * Auto-fitter hinting routines for latin writing system
- * (specification).
- *
- * Copyright (C) 2003-2020 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 AFLATIN2_H_
-#define AFLATIN2_H_
-
-#include "afhints.h"
-
-
-FT_BEGIN_HEADER
-
-
- /* the `latin' writing system */
-
- AF_DECLARE_WRITING_SYSTEM_CLASS( af_latin2_writing_system_class )
-
-
-/* */
-
-FT_END_HEADER
-
-#endif /* AFLATIN_H_ */
-
-
-/* END */
diff --git a/freetype/src/autofit/afloader.c b/freetype/src/autofit/afloader.c
index a06d49ad..e55183a5 100644
--- a/freetype/src/autofit/afloader.c
+++ b/freetype/src/autofit/afloader.c
@@ -4,7 +4,7 @@
*
* Auto-fitter glyph loading routines (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afloader.h b/freetype/src/autofit/afloader.h
index b4936a87..b345e463 100644
--- a/freetype/src/autofit/afloader.h
+++ b/freetype/src/autofit/afloader.h
@@ -4,7 +4,7 @@
*
* Auto-fitter glyph loading routines (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afmodule.c b/freetype/src/autofit/afmodule.c
index 76f9b373..1b14ae68 100644
--- a/freetype/src/autofit/afmodule.c
+++ b/freetype/src/autofit/afmodule.c
@@ -4,7 +4,7 @@
*
* Auto-fitter module implementation (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afmodule.h b/freetype/src/autofit/afmodule.h
index c5bd4682..1d1bfaf5 100644
--- a/freetype/src/autofit/afmodule.h
+++ b/freetype/src/autofit/afmodule.h
@@ -4,7 +4,7 @@
*
* Auto-fitter module implementation (specification).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afranges.c b/freetype/src/autofit/afranges.c
index e06f182d..2de1991a 100644
--- a/freetype/src/autofit/afranges.c
+++ b/freetype/src/autofit/afranges.c
@@ -4,7 +4,7 @@
*
* Auto-fitter Unicode script ranges (body).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afranges.h b/freetype/src/autofit/afranges.h
index 841d630a..acd01faf 100644
--- a/freetype/src/autofit/afranges.h
+++ b/freetype/src/autofit/afranges.h
@@ -4,7 +4,7 @@
*
* Auto-fitter Unicode script ranges (specification).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afscript.h b/freetype/src/autofit/afscript.h
index af78d573..172b5980 100644
--- a/freetype/src/autofit/afscript.h
+++ b/freetype/src/autofit/afscript.h
@@ -4,7 +4,7 @@
*
* Auto-fitter scripts (specification only).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afshaper.c b/freetype/src/autofit/afshaper.c
index 5d078937..298480d8 100644
--- a/freetype/src/autofit/afshaper.c
+++ b/freetype/src/autofit/afshaper.c
@@ -4,7 +4,7 @@
*
* HarfBuzz interface for accessing OpenType features (body).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afshaper.h b/freetype/src/autofit/afshaper.h
index cf3f8134..558f03bd 100644
--- a/freetype/src/autofit/afshaper.h
+++ b/freetype/src/autofit/afshaper.h
@@ -4,7 +4,7 @@
*
* HarfBuzz interface for accessing OpenType features (specification).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afstyles.h b/freetype/src/autofit/afstyles.h
index 64c808c5..9080b9fb 100644
--- a/freetype/src/autofit/afstyles.h
+++ b/freetype/src/autofit/afstyles.h
@@ -4,7 +4,7 @@
*
* Auto-fitter styles (specification only).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/aftypes.h b/freetype/src/autofit/aftypes.h
index 1d792b94..754aad7b 100644
--- a/freetype/src/autofit/aftypes.h
+++ b/freetype/src/autofit/aftypes.h
@@ -4,7 +4,7 @@
*
* Auto-fitter types (specification only).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afwarp.c b/freetype/src/autofit/afwarp.c
deleted file mode 100644
index 808280df..00000000
--- a/freetype/src/autofit/afwarp.c
+++ /dev/null
@@ -1,373 +0,0 @@
-/****************************************************************************
- *
- * afwarp.c
- *
- * Auto-fitter warping algorithm (body).
- *
- * Copyright (C) 2006-2020 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.
- *
- */
-
-
- /*
- * The idea of the warping code is to slightly scale and shift a glyph
- * within a single dimension so that as much of its segments are aligned
- * (more or less) on the grid. To find out the optimal scaling and
- * shifting value, various parameter combinations are tried and scored.
- */
-
-#include "afwarp.h"
-
-#ifdef AF_CONFIG_OPTION_USE_WARPER
-
- /**************************************************************************
- *
- * The macro FT_COMPONENT is used in trace mode. It is an implicit
- * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
- * messages during execution.
- */
-#undef FT_COMPONENT
-#define FT_COMPONENT afwarp
-
-
- /* The weights cover the range 0/64 - 63/64 of a pixel. Obviously, */
- /* values around a half pixel (which means exactly between two grid */
- /* lines) gets the worst weight. */
-#if 1
- static const AF_WarpScore
- af_warper_weights[64] =
- {
- 35, 32, 30, 25, 20, 15, 12, 10, 5, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, -1, -2, -5, -8,-10,-10,-20,-20,-30,-30,
-
- -30,-30,-20,-20,-10,-10, -8, -5, -2, -1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 5, 10, 12, 15, 20, 25, 30, 32,
- };
-#else
- static const AF_WarpScore
- af_warper_weights[64] =
- {
- 30, 20, 10, 5, 4, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, -1, -2, -2, -5, -5,-10,-10,-15,-20,
-
- -20,-15,-15,-10,-10, -5, -5, -2, -2, -1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 4, 5, 10, 20,
- };
-#endif
-
-
- /* Score segments for a given `scale' and `delta' in the range */
- /* `xx1' to `xx2', and store the best result in `warper'. If */
- /* the new best score is equal to the old one, prefer the */
- /* value with a smaller distortion (around `base_distort'). */
-
- static void
- af_warper_compute_line_best( AF_Warper warper,
- FT_Fixed scale,
- FT_Pos delta,
- FT_Pos xx1,
- FT_Pos xx2,
- AF_WarpScore base_distort,
- AF_Segment segments,
- FT_Int num_segments )
- {
- FT_Int idx_min, idx_max, idx0;
- FT_Int nn;
- AF_WarpScore scores[65];
-
-
- for ( nn = 0; nn < 65; nn++ )
- scores[nn] = 0;
-
- idx0 = xx1 - warper->t1;
-
- /* compute minimum and maximum indices */
- {
- FT_Pos xx1min = warper->x1min;
- FT_Pos xx1max = warper->x1max;
- FT_Pos w = xx2 - xx1;
-
-
- if ( xx1min + w < warper->x2min )
- xx1min = warper->x2min - w;
-
- if ( xx1max + w > warper->x2max )
- xx1max = warper->x2max - w;
-
- idx_min = xx1min - warper->t1;
- idx_max = xx1max - warper->t1;
-
- if ( idx_min < 0 || idx_min > idx_max || idx_max > 64 )
- {
- FT_TRACE5(( "invalid indices:\n"
- " min=%d max=%d, xx1=%ld xx2=%ld,\n"
- " x1min=%ld x1max=%ld, x2min=%ld x2max=%ld\n",
- idx_min, idx_max, xx1, xx2,
- warper->x1min, warper->x1max,
- warper->x2min, warper->x2max ));
- return;
- }
- }
-
- for ( nn = 0; nn < num_segments; nn++ )
- {
- FT_Pos len = segments[nn].max_coord - segments[nn].min_coord;
- FT_Pos y0 = FT_MulFix( segments[nn].pos, scale ) + delta;
- FT_Pos y = y0 + ( idx_min - idx0 );
- FT_Int idx;
-
-
- /* score the length of the segments for the given range */
- for ( idx = idx_min; idx <= idx_max; idx++, y++ )
- scores[idx] += af_warper_weights[y & 63] * len;
- }
-
- /* find best score */
- {
- FT_Int idx;
-
-
- for ( idx = idx_min; idx <= idx_max; idx++ )
- {
- AF_WarpScore score = scores[idx];
- AF_WarpScore distort = base_distort + ( idx - idx0 );
-
-
- if ( score > warper->best_score ||
- ( score == warper->best_score &&
- distort < warper->best_distort ) )
- {
- warper->best_score = score;
- warper->best_distort = distort;
- warper->best_scale = scale;
- warper->best_delta = delta + ( idx - idx0 );
- }
- }
- }
- }
-
-
- /* Compute optimal scaling and delta values for a given glyph and */
- /* dimension. */
-
- FT_LOCAL_DEF( void )
- af_warper_compute( AF_Warper warper,
- AF_GlyphHints hints,
- AF_Dimension dim,
- FT_Fixed *a_scale,
- FT_Pos *a_delta )
- {
- AF_AxisHints axis;
- AF_Point points;
-
- FT_Fixed org_scale;
- FT_Pos org_delta;
-
- FT_Int nn, num_points, num_segments;
- FT_Int X1, X2;
- FT_Int w;
-
- AF_WarpScore base_distort;
- AF_Segment segments;
-
-
- /* get original scaling transformation */
- if ( dim == AF_DIMENSION_VERT )
- {
- org_scale = hints->y_scale;
- org_delta = hints->y_delta;
- }
- else
- {
- org_scale = hints->x_scale;
- org_delta = hints->x_delta;
- }
-
- warper->best_scale = org_scale;
- warper->best_delta = org_delta;
- warper->best_score = FT_INT_MIN;
- warper->best_distort = 0;
-
- axis = &hints->axis[dim];
- segments = axis->segments;
- num_segments = axis->num_segments;
- points = hints->points;
- num_points = hints->num_points;
-
- *a_scale = org_scale;
- *a_delta = org_delta;
-
- /* get X1 and X2, minimum and maximum in original coordinates */
- if ( num_segments < 1 )
- return;
-
-#if 1
- X1 = X2 = points[0].fx;
- for ( nn = 1; nn < num_points; nn++ )
- {
- FT_Int X = points[nn].fx;
-
-
- if ( X < X1 )
- X1 = X;
- if ( X > X2 )
- X2 = X;
- }
-#else
- X1 = X2 = segments[0].pos;
- for ( nn = 1; nn < num_segments; nn++ )
- {
- FT_Int X = segments[nn].pos;
-
-
- if ( X < X1 )
- X1 = X;
- if ( X > X2 )
- X2 = X;
- }
-#endif
-
- if ( X1 >= X2 )
- return;
-
- warper->x1 = FT_MulFix( X1, org_scale ) + org_delta;
- warper->x2 = FT_MulFix( X2, org_scale ) + org_delta;
-
- warper->t1 = AF_WARPER_FLOOR( warper->x1 );
- warper->t2 = AF_WARPER_CEIL( warper->x2 );
-
- /* examine a half pixel wide range around the maximum coordinates */
- warper->x1min = warper->x1 & ~31;
- warper->x1max = warper->x1min + 32;
- warper->x2min = warper->x2 & ~31;
- warper->x2max = warper->x2min + 32;
-
- if ( warper->x1max > warper->x2 )
- warper->x1max = warper->x2;
-
- if ( warper->x2min < warper->x1 )
- warper->x2min = warper->x1;
-
- warper->w0 = warper->x2 - warper->x1;
-
- if ( warper->w0 <= 64 )
- {
- warper->x1max = warper->x1;
- warper->x2min = warper->x2;
- }
-
- /* examine (at most) a pixel wide range around the natural width */
- warper->wmin = warper->x2min - warper->x1max;
- warper->wmax = warper->x2max - warper->x1min;
-
-#if 1
- /* some heuristics to reduce the number of widths to be examined */
- {
- int margin = 16;
-
-
- if ( warper->w0 <= 128 )
- {
- margin = 8;
- if ( warper->w0 <= 96 )
- margin = 4;
- }
-
- if ( warper->wmin < warper->w0 - margin )
- warper->wmin = warper->w0 - margin;
-
- if ( warper->wmax > warper->w0 + margin )
- warper->wmax = warper->w0 + margin;
- }
-
- if ( warper->wmin < warper->w0 * 3 / 4 )
- warper->wmin = warper->w0 * 3 / 4;
-
- if ( warper->wmax > warper->w0 * 5 / 4 )
- warper->wmax = warper->w0 * 5 / 4;
-#else
- /* no scaling, just translation */
- warper->wmin = warper->wmax = warper->w0;
-#endif
-
- for ( w = warper->wmin; w <= warper->wmax; w++ )
- {
- FT_Fixed new_scale;
- FT_Pos new_delta;
- FT_Pos xx1, xx2;
-
-
- /* compute min and max positions for given width, */
- /* assuring that they stay within the coordinate ranges */
- xx1 = warper->x1;
- xx2 = warper->x2;
- if ( w >= warper->w0 )
- {
- xx1 -= w - warper->w0;
- if ( xx1 < warper->x1min )
- {
- xx2 += warper->x1min - xx1;
- xx1 = warper->x1min;
- }
- }
- else
- {
- xx1 -= w - warper->w0;
- if ( xx1 > warper->x1max )
- {
- xx2 -= xx1 - warper->x1max;
- xx1 = warper->x1max;
- }
- }
-
- if ( xx1 < warper->x1 )
- base_distort = warper->x1 - xx1;
- else
- base_distort = xx1 - warper->x1;
-
- if ( xx2 < warper->x2 )
- base_distort += warper->x2 - xx2;
- else
- base_distort += xx2 - warper->x2;
-
- /* give base distortion a greater weight while scoring */
- base_distort *= 10;
-
- new_scale = org_scale + FT_DivFix( w - warper->w0, X2 - X1 );
- new_delta = xx1 - FT_MulFix( X1, new_scale );
-
- af_warper_compute_line_best( warper, new_scale, new_delta, xx1, xx2,
- base_distort,
- segments, num_segments );
- }
-
- {
- FT_Fixed best_scale = warper->best_scale;
- FT_Pos best_delta = warper->best_delta;
-
-
- hints->xmin_delta = FT_MulFix( X1, best_scale - org_scale )
- + best_delta;
- hints->xmax_delta = FT_MulFix( X2, best_scale - org_scale )
- + best_delta;
-
- *a_scale = best_scale;
- *a_delta = best_delta;
- }
- }
-
-#else /* !AF_CONFIG_OPTION_USE_WARPER */
-
- /* ANSI C doesn't like empty source files */
- typedef int _af_warp_dummy;
-
-#endif /* !AF_CONFIG_OPTION_USE_WARPER */
-
-/* END */
diff --git a/freetype/src/autofit/afwarp.h b/freetype/src/autofit/afwarp.h
deleted file mode 100644
index cdea23e7..00000000
--- a/freetype/src/autofit/afwarp.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/****************************************************************************
- *
- * afwarp.h
- *
- * Auto-fitter warping algorithm (specification).
- *
- * Copyright (C) 2006-2020 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 AFWARP_H_
-#define AFWARP_H_
-
-#include "afhints.h"
-
-FT_BEGIN_HEADER
-
-#define AF_WARPER_SCALE
-
-#define AF_WARPER_FLOOR( x ) ( (x) & ~FT_TYPEOF( x )63 )
-#define AF_WARPER_CEIL( x ) AF_WARPER_FLOOR( (x) + 63 )
-
-
- typedef FT_Int32 AF_WarpScore;
-
- typedef struct AF_WarperRec_
- {
- FT_Pos x1, x2;
- FT_Pos t1, t2;
- FT_Pos x1min, x1max;
- FT_Pos x2min, x2max;
- FT_Pos w0, wmin, wmax;
-
- FT_Fixed best_scale;
- FT_Pos best_delta;
- AF_WarpScore best_score;
- AF_WarpScore best_distort;
-
- } AF_WarperRec, *AF_Warper;
-
-
-#ifdef AF_CONFIG_OPTION_USE_WARPER
- FT_LOCAL( void )
- af_warper_compute( AF_Warper warper,
- AF_GlyphHints hints,
- AF_Dimension dim,
- FT_Fixed *a_scale,
- FT_Pos *a_delta );
-#endif
-
-
-FT_END_HEADER
-
-
-#endif /* AFWARP_H_ */
-
-
-/* END */
diff --git a/freetype/src/autofit/afwrtsys.h b/freetype/src/autofit/afwrtsys.h
deleted file mode 100644
index 3990633d..00000000
--- a/freetype/src/autofit/afwrtsys.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/****************************************************************************
- *
- * afwrtsys.h
- *
- * Auto-fitter writing systems (specification only).
- *
- * Copyright (C) 2013-2020 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 AFWRTSYS_H_
-#define AFWRTSYS_H_
-
- /* Since preprocessor directives can't create other preprocessor */
- /* directives, we have to include the header files manually. */
-
-#include "afdummy.h"
-#include "aflatin.h"
-#include "afcjk.h"
-#include "afindic.h"
-#ifdef FT_OPTION_AUTOFIT2
-#include "aflatin2.h"
-#endif
-
-#endif /* AFWRTSYS_H_ */
-
-
- /* The following part can be included multiple times. */
- /* Define `WRITING_SYSTEM' as needed. */
-
-
- /* Add new writing systems here. The arguments are the writing system */
- /* name in lowercase and uppercase, respectively. */
-
- WRITING_SYSTEM( dummy, DUMMY )
- WRITING_SYSTEM( latin, LATIN )
- WRITING_SYSTEM( cjk, CJK )
- WRITING_SYSTEM( indic, INDIC )
-#ifdef FT_OPTION_AUTOFIT2
- WRITING_SYSTEM( latin2, LATIN2 )
-#endif
-
-
-/* END */
diff --git a/freetype/src/autofit/afws-decl.h b/freetype/src/autofit/afws-decl.h
index c10dd57e..c93845ef 100644
--- a/freetype/src/autofit/afws-decl.h
+++ b/freetype/src/autofit/afws-decl.h
@@ -4,7 +4,7 @@
*
* Auto-fitter writing system declarations (specification only).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/afws-iter.h b/freetype/src/autofit/afws-iter.h
index 55714203..9cda3509 100644
--- a/freetype/src/autofit/afws-iter.h
+++ b/freetype/src/autofit/afws-iter.h
@@ -4,7 +4,7 @@
*
* Auto-fitter writing systems iterator (specification only).
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/autofit.c b/freetype/src/autofit/autofit.c
index 7e692b4d..3d78a9b3 100644
--- a/freetype/src/autofit/autofit.c
+++ b/freetype/src/autofit/autofit.c
@@ -4,7 +4,7 @@
*
* Auto-fitter module (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/autofit/module.mk b/freetype/src/autofit/module.mk
index fab3a6bd..1d7eda30 100644
--- a/freetype/src/autofit/module.mk
+++ b/freetype/src/autofit/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2003-2021 by
+# Copyright (C) 2003-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/autofit/rules.mk b/freetype/src/autofit/rules.mk
index 499c0e08..11ef6071 100644
--- a/freetype/src/autofit/rules.mk
+++ b/freetype/src/autofit/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2003-2021 by
+# Copyright (C) 2003-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/base/ftadvanc.c b/freetype/src/base/ftadvanc.c
index f20b9928..fc6b4288 100644
--- a/freetype/src/base/ftadvanc.c
+++ b/freetype/src/base/ftadvanc.c
@@ -4,7 +4,7 @@
*
* Quick computation of advance widths (body).
*
- * Copyright (C) 2008-2021 by
+ * Copyright (C) 2008-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftbase.c b/freetype/src/base/ftbase.c
index 7366bc46..cd105689 100644
--- a/freetype/src/base/ftbase.c
+++ b/freetype/src/base/ftbase.c
@@ -4,7 +4,7 @@
*
* Single object library component (body only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftbase.h b/freetype/src/base/ftbase.h
index 963ff93d..f873566f 100644
--- a/freetype/src/base/ftbase.h
+++ b/freetype/src/base/ftbase.h
@@ -4,7 +4,7 @@
*
* Private functions used in the `base' module (specification).
*
- * Copyright (C) 2008-2021 by
+ * Copyright (C) 2008-2022 by
* David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.
*
* This file is part of the FreeType project, and may only be used,
@@ -28,6 +28,7 @@ FT_BEGIN_HEADER
FT_DECLARE_GLYPH( ft_bitmap_glyph_class )
FT_DECLARE_GLYPH( ft_outline_glyph_class )
+ FT_DECLARE_GLYPH( ft_svg_glyph_class )
#ifdef FT_CONFIG_OPTION_MAC_FONTS
diff --git a/freetype/src/base/ftbbox.c b/freetype/src/base/ftbbox.c
index 4db29cbf..30aedf78 100644
--- a/freetype/src/base/ftbbox.c
+++ b/freetype/src/base/ftbbox.c
@@ -4,7 +4,7 @@
*
* FreeType bbox computation (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
diff --git a/freetype/src/base/ftbdf.c b/freetype/src/base/ftbdf.c
index f93ca8eb..4f22113d 100644
--- a/freetype/src/base/ftbdf.c
+++ b/freetype/src/base/ftbdf.c
@@ -4,7 +4,7 @@
*
* FreeType API for accessing BDF-specific strings (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftbitmap.c b/freetype/src/base/ftbitmap.c
index 2146d3e3..7825895a 100644
--- a/freetype/src/base/ftbitmap.c
+++ b/freetype/src/base/ftbitmap.c
@@ -4,7 +4,7 @@
*
* FreeType utility functions for bitmaps (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -480,7 +480,7 @@
* A gamma of 2.2 is fair to assume. And then, we need to
* undo the premultiplication too.
*
- * https://accessibility.kde.org/hsl-adjusted.php
+ * http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html#SideNotes
*
* We do the computation with integers only, applying a gamma of 2.0.
* We guarantee 32-bit arithmetic to avoid overflow but the resulting
@@ -488,9 +488,9 @@
*
*/
- l = ( 4732UL /* 0.0722 * 65536 */ * bgra[0] * bgra[0] +
- 46871UL /* 0.7152 * 65536 */ * bgra[1] * bgra[1] +
- 13933UL /* 0.2126 * 65536 */ * bgra[2] * bgra[2] ) >> 16;
+ l = ( 4731UL /* 0.072186 * 65536 */ * bgra[0] * bgra[0] +
+ 46868UL /* 0.715158 * 65536 */ * bgra[1] * bgra[1] +
+ 13937UL /* 0.212656 * 65536 */ * bgra[2] * bgra[2] ) >> 16;
/*
* Final transparency can be determined as follows.
diff --git a/freetype/src/base/ftcalc.c b/freetype/src/base/ftcalc.c
index 9df8e401..6c1e7fbd 100644
--- a/freetype/src/base/ftcalc.c
+++ b/freetype/src/base/ftcalc.c
@@ -4,7 +4,7 @@
*
* Arithmetic computations (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftcid.c b/freetype/src/base/ftcid.c
index 216ee2b3..b882ca3d 100644
--- a/freetype/src/base/ftcid.c
+++ b/freetype/src/base/ftcid.c
@@ -4,7 +4,7 @@
*
* FreeType API for accessing CID font information.
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* Derek Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftcolor.c b/freetype/src/base/ftcolor.c
index 3ef3256b..0edf379b 100644
--- a/freetype/src/base/ftcolor.c
+++ b/freetype/src/base/ftcolor.c
@@ -4,7 +4,7 @@
*
* FreeType's glyph color management (body).
*
- * Copyright (C) 2018-2021 by
+ * Copyright (C) 2018-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftdbgmem.c b/freetype/src/base/ftdbgmem.c
index 4f5c1e76..1df83c40 100644
--- a/freetype/src/base/ftdbgmem.c
+++ b/freetype/src/base/ftdbgmem.c
@@ -4,7 +4,7 @@
*
* Memory debugger (body).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftdebug.c b/freetype/src/base/ftdebug.c
index 34857913..648fff44 100644
--- a/freetype/src/base/ftdebug.c
+++ b/freetype/src/base/ftdebug.c
@@ -4,7 +4,7 @@
*
* Debugging and logging component (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/fterrors.c b/freetype/src/base/fterrors.c
index 14649268..5846fefc 100644
--- a/freetype/src/base/fterrors.c
+++ b/freetype/src/base/fterrors.c
@@ -4,7 +4,7 @@
*
* FreeType API for error code handling.
*
- * Copyright (C) 2018-2021 by
+ * Copyright (C) 2018-2022 by
* Armin Hasitzka, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftfntfmt.c b/freetype/src/base/ftfntfmt.c
index 4e1b8301..e69c1e06 100644
--- a/freetype/src/base/ftfntfmt.c
+++ b/freetype/src/base/ftfntfmt.c
@@ -4,7 +4,7 @@
*
* FreeType utility file for font formats (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftfstype.c b/freetype/src/base/ftfstype.c
index 57e904d6..009d58c5 100644
--- a/freetype/src/base/ftfstype.c
+++ b/freetype/src/base/ftfstype.c
@@ -4,7 +4,7 @@
*
* FreeType utility file to access FSType data (body).
*
- * Copyright (C) 2008-2021 by
+ * Copyright (C) 2008-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftgasp.c b/freetype/src/base/ftgasp.c
index b744f0a4..7567e307 100644
--- a/freetype/src/base/ftgasp.c
+++ b/freetype/src/base/ftgasp.c
@@ -4,7 +4,7 @@
*
* Access of TrueType's `gasp' table (body).
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftgloadr.c b/freetype/src/base/ftgloadr.c
index 83ce0660..90cc09c0 100644
--- a/freetype/src/base/ftgloadr.c
+++ b/freetype/src/base/ftgloadr.c
@@ -4,7 +4,7 @@
*
* The FreeType glyph loader (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
@@ -217,7 +217,7 @@
error = FT_GlyphLoader_CreateExtra( loader );
if ( error )
- return error;
+ goto Exit;
/* check points & tags */
new_max = (FT_UInt)base->n_points + (FT_UInt)current->n_points +
@@ -229,7 +229,10 @@
new_max = FT_PAD_CEIL( new_max, 8 );
if ( new_max > FT_OUTLINE_POINTS_MAX )
- return FT_THROW( Array_Too_Large );
+ {
+ error = FT_THROW( Array_Too_Large );
+ goto Exit;
+ }
if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
FT_RENEW_ARRAY( base->tags, old_max, new_max ) )
@@ -254,7 +257,7 @@
error = FT_GlyphLoader_CreateExtra( loader );
if ( error )
- return error;
+ goto Exit;
/* check contours */
old_max = loader->max_contours;
@@ -265,7 +268,10 @@
new_max = FT_PAD_CEIL( new_max, 4 );
if ( new_max > FT_OUTLINE_CONTOURS_MAX )
- return FT_THROW( Array_Too_Large );
+ {
+ error = FT_THROW( Array_Too_Large );
+ goto Exit;
+ }
if ( FT_RENEW_ARRAY( base->contours, old_max, new_max ) )
goto Exit;
diff --git a/freetype/src/base/ftglyph.c b/freetype/src/base/ftglyph.c
index e2c6f73f..571dca1a 100644
--- a/freetype/src/base/ftglyph.c
+++ b/freetype/src/base/ftglyph.c
@@ -4,7 +4,7 @@
*
* FreeType convenience functions to handle glyphs (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -34,6 +34,7 @@
#include <freetype/ftoutln.h>
#include <freetype/ftbitmap.h>
#include <freetype/internal/ftobjs.h>
+#include <freetype/otsvg.h>
#include "ftbase.h"
@@ -277,6 +278,240 @@
)
+#ifdef FT_CONFIG_OPTION_SVG
+
+ /*************************************************************************/
+ /*************************************************************************/
+ /**** ****/
+ /**** FT_SvgGlyph support ****/
+ /**** ****/
+ /*************************************************************************/
+ /*************************************************************************/
+
+
+ FT_CALLBACK_DEF( FT_Error )
+ ft_svg_glyph_init( FT_Glyph svg_glyph,
+ FT_GlyphSlot slot )
+ {
+ FT_ULong doc_length;
+ FT_SVG_Document document;
+ FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph;
+
+ FT_Error error = FT_Err_Ok;
+ FT_Memory memory = FT_GLYPH( glyph )->library->memory;
+
+
+ if ( slot->format != FT_GLYPH_FORMAT_SVG )
+ {
+ error = FT_THROW( Invalid_Glyph_Format );
+ goto Exit;
+ }
+
+ if ( slot->other == NULL )
+ {
+ error = FT_THROW( Invalid_Slot_Handle );
+ goto Exit;
+ }
+
+ document = (FT_SVG_Document)slot->other;
+
+ if ( document->svg_document_length == 0 )
+ {
+ error = FT_THROW( Invalid_Slot_Handle );
+ goto Exit;
+ }
+
+ /* allocate a new document */
+ doc_length = document->svg_document_length;
+ if ( FT_QALLOC( glyph->svg_document, doc_length ) )
+ goto Exit;
+ glyph->svg_document_length = doc_length;
+
+ glyph->glyph_index = slot->glyph_index;
+
+ glyph->metrics = document->metrics;
+ glyph->units_per_EM = document->units_per_EM;
+
+ glyph->start_glyph_id = document->start_glyph_id;
+ glyph->end_glyph_id = document->end_glyph_id;
+
+ glyph->transform = document->transform;
+ glyph->delta = document->delta;
+
+ /* copy the document into glyph */
+ FT_MEM_COPY( glyph->svg_document, document->svg_document, doc_length );
+
+ Exit:
+ return error;
+ }
+
+
+ FT_CALLBACK_DEF( void )
+ ft_svg_glyph_done( FT_Glyph svg_glyph )
+ {
+ FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph;
+ FT_Memory memory = svg_glyph->library->memory;
+
+
+ /* just free the memory */
+ FT_FREE( glyph->svg_document );
+ }
+
+
+ FT_CALLBACK_DEF( FT_Error )
+ ft_svg_glyph_copy( FT_Glyph svg_source,
+ FT_Glyph svg_target )
+ {
+ FT_SvgGlyph source = (FT_SvgGlyph)svg_source;
+ FT_SvgGlyph target = (FT_SvgGlyph)svg_target;
+
+ FT_Error error = FT_Err_Ok;
+ FT_Memory memory = FT_GLYPH( source )->library->memory;
+
+
+ if ( svg_source->format != FT_GLYPH_FORMAT_SVG )
+ {
+ error = FT_THROW( Invalid_Glyph_Format );
+ goto Exit;
+ }
+
+ if ( source->svg_document_length == 0 )
+ {
+ error = FT_THROW( Invalid_Slot_Handle );
+ goto Exit;
+ }
+
+ target->glyph_index = source->glyph_index;
+
+ target->svg_document_length = source->svg_document_length;
+
+ target->metrics = source->metrics;
+ target->units_per_EM = source->units_per_EM;
+
+ target->start_glyph_id = source->start_glyph_id;
+ target->end_glyph_id = source->end_glyph_id;
+
+ target->transform = source->transform;
+ target->delta = source->delta;
+
+ /* allocate space for the SVG document */
+ if ( FT_QALLOC( target->svg_document, target->svg_document_length ) )
+ goto Exit;
+
+ /* copy the document */
+ FT_MEM_COPY( target->svg_document,
+ source->svg_document,
+ target->svg_document_length );
+
+ Exit:
+ return error;
+ }
+
+
+ FT_CALLBACK_DEF( void )
+ ft_svg_glyph_transform( FT_Glyph svg_glyph,
+ const FT_Matrix* _matrix,
+ const FT_Vector* _delta )
+ {
+ FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph;
+ FT_Matrix* matrix = (FT_Matrix*)_matrix;
+ FT_Vector* delta = (FT_Vector*)_delta;
+
+ FT_Matrix tmp_matrix;
+ FT_Vector tmp_delta;
+
+ FT_Matrix a, b;
+ FT_Pos x, y;
+
+
+ if ( !matrix )
+ {
+ tmp_matrix.xx = 0x10000;
+ tmp_matrix.xy = 0;
+ tmp_matrix.yx = 0;
+ tmp_matrix.yy = 0x10000;
+
+ matrix = &tmp_matrix;
+ }
+
+ if ( !delta )
+ {
+ tmp_delta.x = 0;
+ tmp_delta.y = 0;
+
+ delta = &tmp_delta;
+ }
+
+ a = glyph->transform;
+ b = *matrix;
+ FT_Matrix_Multiply( &b, &a );
+
+ x = ADD_LONG( ADD_LONG( FT_MulFix( matrix->xx, glyph->delta.x ),
+ FT_MulFix( matrix->xy, glyph->delta.y ) ),
+ delta->x );
+ y = ADD_LONG( ADD_LONG( FT_MulFix( matrix->yx, glyph->delta.x ),
+ FT_MulFix( matrix->yy, glyph->delta.y ) ),
+ delta->y );
+
+ glyph->delta.x = x;
+ glyph->delta.y = y;
+
+ glyph->transform = a;
+ }
+
+
+ FT_CALLBACK_DEF( FT_Error )
+ ft_svg_glyph_prepare( FT_Glyph svg_glyph,
+ FT_GlyphSlot slot )
+ {
+ FT_SvgGlyph glyph = (FT_SvgGlyph)svg_glyph;
+
+ FT_Error error = FT_Err_Ok;
+ FT_Memory memory = svg_glyph->library->memory;
+
+ FT_SVG_Document document = NULL;
+
+
+ if ( FT_NEW( document ) )
+ return error;
+
+ document->svg_document = glyph->svg_document;
+ document->svg_document_length = glyph->svg_document_length;
+
+ document->metrics = glyph->metrics;
+ document->units_per_EM = glyph->units_per_EM;
+
+ document->start_glyph_id = glyph->start_glyph_id;
+ document->end_glyph_id = glyph->end_glyph_id;
+
+ document->transform = glyph->transform;
+ document->delta = glyph->delta;
+
+ slot->format = FT_GLYPH_FORMAT_SVG;
+ slot->glyph_index = glyph->glyph_index;
+ slot->other = document;
+
+ return error;
+ }
+
+
+ FT_DEFINE_GLYPH(
+ ft_svg_glyph_class,
+
+ sizeof ( FT_SvgGlyphRec ),
+ FT_GLYPH_FORMAT_SVG,
+
+ ft_svg_glyph_init, /* FT_Glyph_InitFunc glyph_init */
+ ft_svg_glyph_done, /* FT_Glyph_DoneFunc glyph_done */
+ ft_svg_glyph_copy, /* FT_Glyph_CopyFunc glyph_copy */
+ ft_svg_glyph_transform, /* FT_Glyph_TransformFunc glyph_transform */
+ NULL, /* FT_Glyph_GetBBoxFunc glyph_bbox */
+ ft_svg_glyph_prepare /* FT_Glyph_PrepareFunc glyph_prepare */
+ )
+
+#endif /* FT_CONFIG_OPTION_SVG */
+
+
/*************************************************************************/
/*************************************************************************/
/**** ****/
@@ -377,6 +612,12 @@
else if ( format == FT_GLYPH_FORMAT_OUTLINE )
clazz = &ft_outline_glyph_class;
+#ifdef FT_CONFIG_OPTION_SVG
+ /* if it is an SVG glyph */
+ else if ( format == FT_GLYPH_FORMAT_SVG )
+ clazz = &ft_svg_glyph_class;
+#endif
+
else
{
/* try to find a renderer that supports the glyph image format */
@@ -595,6 +836,16 @@
if ( !error )
error = FT_Render_Glyph_Internal( glyph->library, &dummy, render_mode );
+#ifdef FT_CONFIG_OPTION_SVG
+ if ( clazz == &ft_svg_glyph_class )
+ {
+ FT_Memory memory = library->memory;
+
+
+ FT_FREE( dummy.other );
+ }
+#endif
+
#if 1
if ( !destroy && origin )
{
diff --git a/freetype/src/base/ftgxval.c b/freetype/src/base/ftgxval.c
index e9567f77..5598a11c 100644
--- a/freetype/src/base/ftgxval.c
+++ b/freetype/src/base/ftgxval.c
@@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* Masatake YAMATO, Redhat K.K,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/base/fthash.c b/freetype/src/base/fthash.c
index 449b03a5..313bbbb4 100644
--- a/freetype/src/base/fthash.c
+++ b/freetype/src/base/fthash.c
@@ -243,7 +243,7 @@
nn = *bp;
if ( !nn )
{
- if ( FT_NEW( nn ) )
+ if ( FT_QNEW( nn ) )
goto Exit;
*bp = nn;
diff --git a/freetype/src/base/ftinit.c b/freetype/src/base/ftinit.c
index a2d2b933..0f29a601 100644
--- a/freetype/src/base/ftinit.c
+++ b/freetype/src/base/ftinit.c
@@ -4,7 +4,7 @@
*
* FreeType initialization layer (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftlcdfil.c b/freetype/src/base/ftlcdfil.c
index 488b913e..e72f6d66 100644
--- a/freetype/src/base/ftlcdfil.c
+++ b/freetype/src/base/ftlcdfil.c
@@ -4,7 +4,7 @@
*
* FreeType API for color filtering of subpixel bitmap glyphs (body).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftmac.c b/freetype/src/base/ftmac.c
index 36a86097..21f1894a 100644
--- a/freetype/src/base/ftmac.c
+++ b/freetype/src/base/ftmac.c
@@ -8,7 +8,7 @@
* This file is for Mac OS X only; see builds/mac/ftoldmac.c for
* classic platforms built by MPW.
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -105,7 +105,7 @@
/* Don't want warnings about our own use of deprecated functions. */
#define FT_DEPRECATED_ATTRIBUTE
-#include FT_MAC_H
+#include <freetype/ftmac.h>
#ifndef kATSOptionFlagsUnRestrictedScope /* since Mac OS X 10.1 */
#define kATSOptionFlagsUnRestrictedScope kATSOptionFlagsDefault
@@ -314,7 +314,7 @@
NULL, NULL, NULL ) )
return ( OSType ) 0;
- return ((FInfo *)(info.finderInfo))->fdType;
+ return ( (FInfo *)( info.finderInfo ) )->fdType;
}
@@ -462,7 +462,7 @@
if ( ps_name_len != 0 )
{
- ft_memcpy(ps_name, names[0] + 1, ps_name_len);
+ ft_memcpy( ps_name, names[0] + 1, ps_name_len );
ps_name[ps_name_len] = 0;
}
if ( style->indexes[face_index] > 1 &&
diff --git a/freetype/src/base/ftmm.c b/freetype/src/base/ftmm.c
index fc5d4ecc..dbbd87c9 100644
--- a/freetype/src/base/ftmm.c
+++ b/freetype/src/base/ftmm.c
@@ -4,7 +4,7 @@
*
* Multiple Master font support (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftobjs.c b/freetype/src/base/ftobjs.c
index 883f1a89..5eb4122a 100644
--- a/freetype/src/base/ftobjs.c
+++ b/freetype/src/base/ftobjs.c
@@ -4,7 +4,7 @@
*
* The FreeType private base classes (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -19,6 +19,7 @@
#include <freetype/ftlist.h>
#include <freetype/ftoutln.h>
#include <freetype/ftfntfmt.h>
+#include <freetype/otsvg.h>
#include <freetype/internal/ftvalid.h>
#include <freetype/internal/ftobjs.h>
@@ -27,6 +28,7 @@
#include <freetype/internal/ftstream.h>
#include <freetype/internal/sfnt.h> /* for SFNT_Load_Table_Func */
#include <freetype/internal/psaux.h> /* for PS_Driver */
+#include <freetype/internal/svginterface.h>
#include <freetype/tttables.h>
#include <freetype/tttags.h>
@@ -328,6 +330,19 @@
if ( !error && clazz->init_slot )
error = clazz->init_slot( slot );
+#ifdef FT_CONFIG_OPTION_SVG
+ /* if SVG table exists, allocate the space in `slot->other` */
+ if ( slot->face->face_flags & FT_FACE_FLAG_SVG )
+ {
+ FT_SVG_Document document = NULL;
+
+
+ if ( FT_NEW( document ) )
+ goto Exit;
+ slot->other = document;
+ }
+#endif
+
Exit:
return error;
}
@@ -372,7 +387,18 @@
FT_Pos width, height, pitch;
- if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
+ if ( slot->format == FT_GLYPH_FORMAT_SVG )
+ {
+ FT_Module module;
+ SVG_Service svg_service;
+
+
+ module = FT_Get_Module( slot->library, "ot-svg" );
+ svg_service = (SVG_Service)module->clazz->module_interface;
+
+ return (FT_Bool)svg_service->preset_slot( module, slot, FALSE );
+ }
+ else if ( slot->format != FT_GLYPH_FORMAT_OUTLINE )
return 1;
if ( origin )
@@ -564,8 +590,27 @@
slot->subglyphs = NULL;
slot->control_data = NULL;
slot->control_len = 0;
- slot->other = NULL;
- slot->format = FT_GLYPH_FORMAT_NONE;
+
+#ifndef FT_CONFIG_OPTION_SVG
+ slot->other = NULL;
+#else
+ if ( !( slot->face->face_flags & FT_FACE_FLAG_SVG ) )
+ slot->other = NULL;
+ else
+ {
+ if ( slot->internal->flags & FT_GLYPH_OWN_GZIP_SVG )
+ {
+ FT_Memory memory = slot->face->memory;
+ FT_SVG_Document doc = (FT_SVG_Document)slot->other;
+
+
+ FT_FREE( doc->svg_document );
+ slot->internal->load_flags &= ~FT_GLYPH_OWN_GZIP_SVG;
+ }
+ }
+#endif
+
+ slot->format = FT_GLYPH_FORMAT_NONE;
slot->linearHoriAdvance = 0;
slot->linearVertAdvance = 0;
@@ -583,6 +628,24 @@
FT_Driver_Class clazz = driver->clazz;
FT_Memory memory = driver->root.memory;
+#ifdef FT_CONFIG_OPTION_SVG
+ if ( slot->face->face_flags & FT_FACE_FLAG_SVG )
+ {
+ /* free memory in case SVG was there */
+ /* `slot->internal` might be NULL in out-of-memory situations. */
+ if ( slot->internal && slot->internal->flags & FT_GLYPH_OWN_GZIP_SVG )
+ {
+ FT_SVG_Document doc = (FT_SVG_Document)slot->other;
+
+
+ FT_FREE( doc->svg_document );
+
+ slot->internal->flags &= ~FT_GLYPH_OWN_GZIP_SVG;
+ }
+
+ FT_FREE( slot->other );
+ }
+#endif
if ( clazz->done_slot )
clazz->done_slot( slot );
@@ -858,6 +921,11 @@
library = driver->root.library;
hinter = library->auto_hinter;
+ /* undefined scale means no scale */
+ if ( face->size->metrics.x_ppem == 0 ||
+ face->size->metrics.y_ppem == 0 )
+ load_flags |= FT_LOAD_NO_SCALE;
+
/* resolve load flags dependencies */
if ( load_flags & FT_LOAD_NO_RECURSE )
@@ -947,11 +1015,21 @@
FT_AutoHinter_Interface hinting;
- /* try to load embedded bitmaps first if available */
- /* */
- /* XXX: This is really a temporary hack that should disappear */
- /* promptly with FreeType 2.1! */
- /* */
+ /* XXX: The use of the `FT_LOAD_XXX_ONLY` flags is not very */
+ /* elegant. */
+
+ /* try to load SVG documents if available */
+ if ( FT_HAS_SVG( face ) )
+ {
+ error = driver->clazz->load_glyph( slot, face->size,
+ glyph_index,
+ load_flags | FT_LOAD_SVG_ONLY );
+
+ if ( !error && slot->format == FT_GLYPH_FORMAT_SVG )
+ goto Load_Ok;
+ }
+
+ /* try to load embedded bitmaps if available */
if ( FT_HAS_FIXED_SIZES( face ) &&
( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
{
@@ -1597,7 +1675,6 @@
FT_FREE( stream->base );
stream->size = 0;
- stream->base = NULL;
stream->close = NULL;
}
@@ -2451,6 +2528,16 @@
#endif
+ /* only use lower 31 bits together with sign bit */
+ if ( face_index > 0 )
+ face_index &= 0x7FFFFFFFL;
+ else
+ {
+ face_index = -face_index;
+ face_index &= 0x7FFFFFFFL;
+ face_index = -face_index;
+ }
+
#ifdef FT_DEBUG_LEVEL_TRACE
FT_TRACE3(( "FT_Open_Face: " ));
if ( face_index < 0 )
@@ -3323,6 +3410,9 @@
if ( !face )
return FT_THROW( Invalid_Face_Handle );
+ if ( !face->size )
+ return FT_THROW( Invalid_Size_Handle );
+
if ( !req || req->width < 0 || req->height < 0 ||
req->type >= FT_SIZE_REQUEST_TYPE_MAX )
return FT_THROW( Invalid_Argument );
@@ -4474,7 +4564,7 @@
render->glyph_format = clazz->glyph_format;
/* allocate raster object if needed */
- if ( clazz->raster_class->raster_new )
+ if ( clazz->raster_class && clazz->raster_class->raster_new )
{
error = clazz->raster_class->raster_new( memory, &render->raster );
if ( error )
@@ -4484,6 +4574,11 @@
render->render = clazz->render_glyph;
}
+#ifdef FT_CONFIG_OPTION_SVG
+ if ( clazz->glyph_format == FT_GLYPH_FORMAT_SVG )
+ render->render = clazz->render_glyph;
+#endif
+
/* add to list */
node->data = module;
FT_List_Add( &library->renderers, node );
@@ -5729,7 +5824,7 @@
SFNT_Service sfnt;
- if ( !face || !paint || !paint )
+ if ( !face || !paint )
return 0;
if ( !FT_IS_SFNT( face ) )
diff --git a/freetype/src/base/ftotval.c b/freetype/src/base/ftotval.c
index 0f748d00..f336e962 100644
--- a/freetype/src/base/ftotval.c
+++ b/freetype/src/base/ftotval.c
@@ -4,7 +4,7 @@
*
* FreeType API for validating OpenType tables (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftoutln.c b/freetype/src/base/ftoutln.c
index 98c6ca16..624df03a 100644
--- a/freetype/src/base/ftoutln.c
+++ b/freetype/src/base/ftoutln.c
@@ -4,7 +4,7 @@
*
* FreeType outline management (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftpatent.c b/freetype/src/base/ftpatent.c
index cd192d33..353ed2b5 100644
--- a/freetype/src/base/ftpatent.c
+++ b/freetype/src/base/ftpatent.c
@@ -5,7 +5,7 @@
* FreeType API for checking patented TrueType bytecode instructions
* (body). Obsolete, retained for backward compatibility.
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* David Turner.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftpfr.c b/freetype/src/base/ftpfr.c
index 5afd5a18..9e748f06 100644
--- a/freetype/src/base/ftpfr.c
+++ b/freetype/src/base/ftpfr.c
@@ -4,7 +4,7 @@
*
* FreeType API for accessing PFR-specific data (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftpsprop.c b/freetype/src/base/ftpsprop.c
index 3655ae97..81fcee08 100644
--- a/freetype/src/base/ftpsprop.c
+++ b/freetype/src/base/ftpsprop.c
@@ -5,7 +5,7 @@
* Get and set properties of PostScript drivers (body).
* See `ftdriver.h' for available properties.
*
- * Copyright (C) 2017-2021 by
+ * Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftrfork.c b/freetype/src/base/ftrfork.c
index cb7e94dd..356998d3 100644
--- a/freetype/src/base/ftrfork.c
+++ b/freetype/src/base/ftrfork.c
@@ -4,7 +4,7 @@
*
* Embedded resource forks accessor (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* Masatake YAMATO and Redhat K.K.
*
* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are
@@ -402,17 +402,17 @@
FT_Long *result_offset );
- CONST_FT_RFORK_RULE_ARRAY_BEGIN(ft_raccess_guess_table,
- ft_raccess_guess_rec)
- CONST_FT_RFORK_RULE_ARRAY_ENTRY(apple_double, apple_double)
- CONST_FT_RFORK_RULE_ARRAY_ENTRY(apple_single, apple_single)
- CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_ufs_export, darwin_ufs_export)
- CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_newvfs, darwin_newvfs)
- CONST_FT_RFORK_RULE_ARRAY_ENTRY(darwin_hfsplus, darwin_hfsplus)
- CONST_FT_RFORK_RULE_ARRAY_ENTRY(vfat, vfat)
- CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_cap, linux_cap)
- CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_double, linux_double)
- CONST_FT_RFORK_RULE_ARRAY_ENTRY(linux_netatalk, linux_netatalk)
+ CONST_FT_RFORK_RULE_ARRAY_BEGIN( ft_raccess_guess_table,
+ ft_raccess_guess_rec )
+ CONST_FT_RFORK_RULE_ARRAY_ENTRY( apple_double, apple_double )
+ CONST_FT_RFORK_RULE_ARRAY_ENTRY( apple_single, apple_single )
+ CONST_FT_RFORK_RULE_ARRAY_ENTRY( darwin_ufs_export, darwin_ufs_export )
+ CONST_FT_RFORK_RULE_ARRAY_ENTRY( darwin_newvfs, darwin_newvfs )
+ CONST_FT_RFORK_RULE_ARRAY_ENTRY( darwin_hfsplus, darwin_hfsplus )
+ CONST_FT_RFORK_RULE_ARRAY_ENTRY( vfat, vfat )
+ CONST_FT_RFORK_RULE_ARRAY_ENTRY( linux_cap, linux_cap )
+ CONST_FT_RFORK_RULE_ARRAY_ENTRY( linux_double, linux_double )
+ CONST_FT_RFORK_RULE_ARRAY_ENTRY( linux_netatalk, linux_netatalk )
CONST_FT_RFORK_RULE_ARRAY_END
@@ -868,9 +868,7 @@
const char* tmp;
const char* slash;
size_t new_length;
- FT_Error error = FT_Err_Ok;
-
- FT_UNUSED( error );
+ FT_Error error;
new_length = ft_strlen( original_name ) + ft_strlen( insertion );
diff --git a/freetype/src/base/ftsnames.c b/freetype/src/base/ftsnames.c
index 44dba666..3bf20c38 100644
--- a/freetype/src/base/ftsnames.c
+++ b/freetype/src/base/ftsnames.c
@@ -7,7 +7,7 @@
*
* This is _not_ used to retrieve glyph names!
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftstream.c b/freetype/src/base/ftstream.c
index 5992998b..cc926565 100644
--- a/freetype/src/base/ftstream.c
+++ b/freetype/src/base/ftstream.c
@@ -4,7 +4,7 @@
*
* I/O stream support (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftstroke.c b/freetype/src/base/ftstroke.c
index 37e96494..aa983f94 100644
--- a/freetype/src/base/ftstroke.c
+++ b/freetype/src/base/ftstroke.c
@@ -4,7 +4,7 @@
*
* FreeType path stroker (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftsynth.c b/freetype/src/base/ftsynth.c
index 73565b13..10bbe0df 100644
--- a/freetype/src/base/ftsynth.c
+++ b/freetype/src/base/ftsynth.c
@@ -4,7 +4,7 @@
*
* FreeType synthesizing code for emboldening and slanting (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftsystem.c b/freetype/src/base/ftsystem.c
index 9beb7e24..d8826b23 100644
--- a/freetype/src/base/ftsystem.c
+++ b/freetype/src/base/ftsystem.c
@@ -4,7 +4,7 @@
*
* ANSI-specific FreeType low-level system interface (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/fttrigon.c b/freetype/src/base/fttrigon.c
index 0ca6d781..6964edb0 100644
--- a/freetype/src/base/fttrigon.c
+++ b/freetype/src/base/fttrigon.c
@@ -4,7 +4,7 @@
*
* FreeType trigonometric functions (body).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/fttype1.c b/freetype/src/base/fttype1.c
index 0d0afbce..de3d5a48 100644
--- a/freetype/src/base/fttype1.c
+++ b/freetype/src/base/fttype1.c
@@ -4,7 +4,7 @@
*
* FreeType utility file for PS names support (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftutil.c b/freetype/src/base/ftutil.c
index 3142faee..5a913825 100644
--- a/freetype/src/base/ftutil.c
+++ b/freetype/src/base/ftutil.c
@@ -4,7 +4,7 @@
*
* FreeType utility file for memory and list management (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/ftver.rc b/freetype/src/base/ftver.rc
index a3d05b37..eb6090ec 100644
--- a/freetype/src/base/ftver.rc
+++ b/freetype/src/base/ftver.rc
@@ -4,7 +4,7 @@
/* */
/* FreeType VERSIONINFO resource for Windows DLLs. */
/* */
-/* Copyright (C) 2018-2021 by */
+/* Copyright (C) 2018-2022 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -18,8 +18,8 @@
#include<windows.h>
-#define FT_VERSION 2,11,1,0
-#define FT_VERSION_STR "2.11.1"
+#define FT_VERSION 2,12,1,0
+#define FT_VERSION_STR "2.12.1"
VS_VERSION_INFO VERSIONINFO
FILEVERSION FT_VERSION
@@ -45,7 +45,7 @@ BEGIN
VALUE "FileVersion", FT_VERSION_STR
VALUE "ProductName", "FreeType"
VALUE "ProductVersion", FT_VERSION_STR
- VALUE "LegalCopyright", "\251 2000-2021 The FreeType Project www.freetype.org. All rights reserved."
+ VALUE "LegalCopyright", "\251 2000-2022 The FreeType Project www.freetype.org. All rights reserved."
VALUE "InternalName", "freetype"
VALUE "OriginalFilename", FT_FILENAME
END
diff --git a/freetype/src/base/ftwinfnt.c b/freetype/src/base/ftwinfnt.c
index 98f197af..193f7fa0 100644
--- a/freetype/src/base/ftwinfnt.c
+++ b/freetype/src/base/ftwinfnt.c
@@ -4,7 +4,7 @@
*
* FreeType API for accessing Windows FNT specific info (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/base/rules.mk b/freetype/src/base/rules.mk
index 53289aee..9a224b14 100644
--- a/freetype/src/base/rules.mk
+++ b/freetype/src/base/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/bdf/README b/freetype/src/bdf/README
index 996ac2d2..d7cb8c14 100644
--- a/freetype/src/bdf/README
+++ b/freetype/src/bdf/README
@@ -13,7 +13,7 @@ This code implements a BDF driver for the FreeType library, following the
Adobe Specification V 2.2. The specification of the BDF font format is
available from Adobe's web site:
- https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5005.BDF_Spec.pdf
+ https://adobe-type-tools.github.io/font-tech-notes/pdfs/5005.BDF_Spec.pdf
Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
They do not define vertical metrics, because the X Consortium BDF
@@ -23,6 +23,10 @@ specification has removed them.
Encodings
*********
+[This section is out of date, retained for historical reasons. BDF
+ properties can be retrieved with `FT_Get_BDF_Property`, character set ID
+ values with `FT_Get_BDF_Charset_ID`.]
+
The variety of encodings that accompanies bdf fonts appears to encompass the
small set defined in freetype.h. On the other hand, two properties that
specify encoding and registry are usually defined in bdf fonts.
diff --git a/freetype/src/bdf/bdflib.c b/freetype/src/bdf/bdflib.c
index b65c8a2f..6603148a 100644
--- a/freetype/src/bdf/bdflib.c
+++ b/freetype/src/bdf/bdflib.c
@@ -613,7 +613,7 @@
if ( FT_QREALLOC( buf, buf_size, new_size ) )
goto Exit;
- cursor = (ptrdiff_t)buf_size;
+ cursor = avail;
buf_size = new_size;
}
else
@@ -623,7 +623,6 @@
FT_MEM_MOVE( buf, buf + start, bytes );
cursor = bytes;
- avail -= bytes;
start = 0;
}
refill = 1;
@@ -1175,7 +1174,6 @@
font->props_size + 1 ) )
goto Exit;
- fp = font->props + font->props_size;
font->props_size++;
}
@@ -1537,8 +1535,6 @@
/* kept. */
FT_FREE( p->glyph_name );
}
-
- p->glyph_name = NULL;
}
/* Clear the flags that might be added when width and height are */
@@ -1953,7 +1949,7 @@
}
}
- if ( FT_ALLOC( p->font->internal, sizeof ( FT_HashRec ) ) )
+ if ( FT_QALLOC( p->font->internal, sizeof ( FT_HashRec ) ) )
goto Exit;
error = ft_hash_str_init( (FT_Hash)p->font->internal, memory );
if ( error )
diff --git a/freetype/src/bzip2/ftbzip2.c b/freetype/src/bzip2/ftbzip2.c
index 296cea08..ab2da7e6 100644
--- a/freetype/src/bzip2/ftbzip2.c
+++ b/freetype/src/bzip2/ftbzip2.c
@@ -8,7 +8,7 @@
* parse compressed PCF fonts, as found with many X11 server
* distributions.
*
- * Copyright (C) 2010-2021 by
+ * Copyright (C) 2010-2022 by
* Joel Klinghed.
*
* based on `src/gzip/ftgzip.c'
@@ -57,8 +57,9 @@
/* it is better to use FreeType memory routines instead of raw
'malloc/free' */
- typedef void *(* alloc_func)(void*, int, int);
- typedef void (* free_func)(void*, void*);
+ typedef void* (*alloc_func)( void*, int, int );
+ typedef void (*free_func) ( void*, void* );
+
static void*
ft_bzip2_alloc( FT_Memory memory,
@@ -102,10 +103,11 @@
FT_Byte input[FT_BZIP2_BUFFER_SIZE]; /* input read buffer */
- FT_Byte buffer[FT_BZIP2_BUFFER_SIZE]; /* output buffer */
- FT_ULong pos; /* position in output */
+ FT_Byte buffer[FT_BZIP2_BUFFER_SIZE]; /* output buffer */
+ FT_ULong pos; /* position in output */
FT_Byte* cursor;
FT_Byte* limit;
+ FT_Bool reset; /* reset before next read */
} FT_BZip2FileRec, *FT_BZip2File;
@@ -153,6 +155,7 @@
zip->limit = zip->buffer + FT_BZIP2_BUFFER_SIZE;
zip->cursor = zip->limit;
zip->pos = 0;
+ zip->reset = 0;
/* check .bz2 header */
{
@@ -228,6 +231,7 @@
zip->limit = zip->buffer + FT_BZIP2_BUFFER_SIZE;
zip->cursor = zip->limit;
zip->pos = 0;
+ zip->reset = 0;
BZ2_bzDecompressInit( bzstream, 0, 0 );
}
@@ -302,18 +306,23 @@
err = BZ2_bzDecompress( bzstream );
- if ( err == BZ_STREAM_END )
+ if ( err != BZ_OK )
{
- zip->limit = (FT_Byte*)bzstream->next_out;
- if ( zip->limit == zip->cursor )
- error = FT_THROW( Invalid_Stream_Operation );
- break;
- }
- else if ( err != BZ_OK )
- {
- zip->limit = zip->cursor;
- error = FT_THROW( Invalid_Stream_Operation );
- break;
+ zip->reset = 1;
+
+ if ( err == BZ_STREAM_END )
+ {
+ zip->limit = (FT_Byte*)bzstream->next_out;
+ if ( zip->limit == zip->cursor )
+ error = FT_THROW( Invalid_Stream_Operation );
+ break;
+ }
+ else
+ {
+ zip->limit = zip->cursor;
+ error = FT_THROW( Invalid_Stream_Operation );
+ break;
+ }
}
}
@@ -363,9 +372,9 @@
FT_Error error;
- /* Reset inflate stream if we're seeking backwards. */
- /* Yes, that is not too efficient, but it saves memory :-) */
- if ( pos < zip->pos )
+ /* Reset inflate stream if seeking backwards or bzip reported an error. */
+ /* Yes, that is not too efficient, but it saves memory :-) */
+ if ( pos < zip->pos || zip->reset )
{
error = ft_bzip2_file_reset( zip );
if ( error )
diff --git a/freetype/src/bzip2/rules.mk b/freetype/src/bzip2/rules.mk
index e584277b..93a820c8 100644
--- a/freetype/src/bzip2/rules.mk
+++ b/freetype/src/bzip2/rules.mk
@@ -2,7 +2,7 @@
# FreeType 2 BZIP2 support configuration rules
#
-# Copyright (C) 2010-2021 by
+# Copyright (C) 2010-2022 by
# Joel Klinghed.
#
# based on `src/lzw/rules.mk'
diff --git a/freetype/src/cache/ftcache.c b/freetype/src/cache/ftcache.c
index ddd3e43c..e26b44a7 100644
--- a/freetype/src/cache/ftcache.c
+++ b/freetype/src/cache/ftcache.c
@@ -4,7 +4,7 @@
*
* The FreeType Caching sub-system (body only).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cache/ftcbasic.c b/freetype/src/cache/ftcbasic.c
index 1760c5fb..635b17d0 100644
--- a/freetype/src/cache/ftcbasic.c
+++ b/freetype/src/cache/ftcbasic.c
@@ -4,7 +4,7 @@
*
* The FreeType basic cache interface (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -26,6 +26,7 @@
#include "ftccback.h"
#include "ftcerror.h"
+#undef FT_COMPONENT
#define FT_COMPONENT cache
@@ -182,7 +183,8 @@
if ( !error )
{
if ( face->glyph->format == FT_GLYPH_FORMAT_BITMAP ||
- face->glyph->format == FT_GLYPH_FORMAT_OUTLINE )
+ face->glyph->format == FT_GLYPH_FORMAT_OUTLINE ||
+ face->glyph->format == FT_GLYPH_FORMAT_SVG )
{
/* ok, copy it */
FT_Glyph glyph;
diff --git a/freetype/src/cache/ftccache.c b/freetype/src/cache/ftccache.c
index 5bbf3292..ab4ad2fa 100644
--- a/freetype/src/cache/ftccache.c
+++ b/freetype/src/cache/ftccache.c
@@ -4,7 +4,7 @@
*
* The FreeType internal cache interface (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cache/ftccache.h b/freetype/src/cache/ftccache.h
index 4849b923..ae0ae8b1 100644
--- a/freetype/src/cache/ftccache.h
+++ b/freetype/src/cache/ftccache.h
@@ -4,7 +4,7 @@
*
* FreeType internal cache interface (specification).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -210,7 +210,7 @@ FT_BEGIN_HEADER
#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
FT_BEGIN_STMNT \
FTC_Node *_bucket, *_pnode, _node; \
- FTC_Cache _cache = FTC_CACHE(cache); \
+ FTC_Cache _cache = FTC_CACHE( cache ); \
FT_Offset _hash = (FT_Offset)(hash); \
FTC_Node_CompareFunc _nodcomp = (FTC_Node_CompareFunc)(nodecmp); \
FT_Bool _list_changed = FALSE; \
diff --git a/freetype/src/cache/ftccback.h b/freetype/src/cache/ftccback.h
index 8185fe37..ba01af2e 100644
--- a/freetype/src/cache/ftccback.h
+++ b/freetype/src/cache/ftccback.h
@@ -4,7 +4,7 @@
*
* Callback functions of the caching sub-system (specification only).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cache/ftccmap.c b/freetype/src/cache/ftccmap.c
index 40b449b9..0ee1834e 100644
--- a/freetype/src/cache/ftccmap.c
+++ b/freetype/src/cache/ftccmap.c
@@ -4,7 +4,7 @@
*
* FreeType CharMap cache (body)
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -116,7 +116,7 @@
FT_UInt nn;
- if ( !FT_NEW( node ) )
+ if ( !FT_QNEW( node ) )
{
node->face_id = query->face_id;
node->cmap_index = query->cmap_index;
diff --git a/freetype/src/cache/ftcerror.h b/freetype/src/cache/ftcerror.h
index 2c6faf65..44e74d36 100644
--- a/freetype/src/cache/ftcerror.h
+++ b/freetype/src/cache/ftcerror.h
@@ -4,7 +4,7 @@
*
* Caching sub-system error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cache/ftcglyph.c b/freetype/src/cache/ftcglyph.c
index 52771c7a..f826c8dd 100644
--- a/freetype/src/cache/ftcglyph.c
+++ b/freetype/src/cache/ftcglyph.c
@@ -4,7 +4,7 @@
*
* FreeType Glyph Image (FT_Glyph) cache (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cache/ftcglyph.h b/freetype/src/cache/ftcglyph.h
index cf00cdc7..cbb80777 100644
--- a/freetype/src/cache/ftcglyph.h
+++ b/freetype/src/cache/ftcglyph.h
@@ -4,7 +4,7 @@
*
* FreeType abstract glyph cache (specification).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -140,8 +140,8 @@ FT_BEGIN_HEADER
} FTC_FamilyRec, *FTC_Family;
-#define FTC_FAMILY(x) ( (FTC_Family)(x) )
-#define FTC_FAMILY_P(x) ( (FTC_Family*)(x) )
+#define FTC_FAMILY( x ) ( (FTC_Family)(x) )
+#define FTC_FAMILY_P( x ) ( (FTC_Family*)(x) )
typedef struct FTC_GNodeRec_
@@ -245,7 +245,7 @@ FT_BEGIN_HEADER
#define FTC_GCACHE_CLASS( x ) ((FTC_GCacheClass)(x))
#define FTC_CACHE_GCACHE_CLASS( x ) \
- FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )
+ FTC_GCACHE_CLASS( FTC_CACHE( x )->org_class )
#define FTC_CACHE_FAMILY_CLASS( x ) \
( (FTC_MruListClass)FTC_CACHE_GCACHE_CLASS( x )->family_class )
diff --git a/freetype/src/cache/ftcimage.c b/freetype/src/cache/ftcimage.c
index 3f12a654..39ce61a5 100644
--- a/freetype/src/cache/ftcimage.c
+++ b/freetype/src/cache/ftcimage.c
@@ -4,7 +4,7 @@
*
* FreeType Image cache (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -64,7 +64,7 @@
FTC_INode inode = NULL;
- if ( !FT_NEW( inode ) )
+ if ( !FT_QNEW( inode ) )
{
FTC_GNode gnode = FTC_GNODE( inode );
FTC_Family family = gquery->family;
@@ -74,6 +74,7 @@
/* initialize its inner fields */
FTC_GNode_Init( gnode, gindex, family );
+ inode->glyph = NULL;
/* we will now load the glyph image */
error = clazz->family_load_glyph( family, gindex, cache,
diff --git a/freetype/src/cache/ftcimage.h b/freetype/src/cache/ftcimage.h
index 8b28d6f0..55270a43 100644
--- a/freetype/src/cache/ftcimage.h
+++ b/freetype/src/cache/ftcimage.h
@@ -4,7 +4,7 @@
*
* FreeType Generic Image cache (specification)
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -51,8 +51,8 @@ FT_BEGIN_HEADER
} FTC_INodeRec, *FTC_INode;
#define FTC_INODE( x ) ( (FTC_INode)( x ) )
-#define FTC_INODE_GINDEX( x ) FTC_GNODE(x)->gindex
-#define FTC_INODE_FAMILY( x ) FTC_GNODE(x)->family
+#define FTC_INODE_GINDEX( x ) FTC_GNODE( x )->gindex
+#define FTC_INODE_FAMILY( x ) FTC_GNODE( x )->family
typedef FT_Error
(*FTC_IFamily_LoadGlyphFunc)( FTC_Family family,
@@ -72,7 +72,7 @@ FT_BEGIN_HEADER
#define FTC_IFAMILY_CLASS( x ) ((FTC_IFamilyClass)(x))
#define FTC_CACHE_IFAMILY_CLASS( x ) \
- FTC_IFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS(x)->family_class )
+ FTC_IFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS( x )->family_class )
/* can be used as a @FTC_Node_FreeFunc */
diff --git a/freetype/src/cache/ftcmanag.c b/freetype/src/cache/ftcmanag.c
index 512de8a3..49f037aa 100644
--- a/freetype/src/cache/ftcmanag.c
+++ b/freetype/src/cache/ftcmanag.c
@@ -4,7 +4,7 @@
*
* FreeType Cache Manager (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cache/ftcmanag.h b/freetype/src/cache/ftcmanag.h
index 99aa9263..5c67af30 100644
--- a/freetype/src/cache/ftcmanag.h
+++ b/freetype/src/cache/ftcmanag.h
@@ -4,7 +4,7 @@
*
* FreeType Cache Manager (specification).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cache/ftcmru.c b/freetype/src/cache/ftcmru.c
index 2cac6f9d..6a14ae36 100644
--- a/freetype/src/cache/ftcmru.c
+++ b/freetype/src/cache/ftcmru.c
@@ -4,7 +4,7 @@
*
* FreeType MRU support (body).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -262,7 +262,9 @@
if ( list->clazz.node_done )
list->clazz.node_done( node, list->data );
}
- else if ( FT_QALLOC( node, list->clazz.node_size ) )
+
+ /* zero new node in case of node_init failure */
+ else if ( FT_ALLOC( node, list->clazz.node_size ) )
goto Exit;
error = list->clazz.node_init( node, key, list->data );
diff --git a/freetype/src/cache/ftcmru.h b/freetype/src/cache/ftcmru.h
index 6befde30..4fcadef4 100644
--- a/freetype/src/cache/ftcmru.h
+++ b/freetype/src/cache/ftcmru.h
@@ -4,7 +4,7 @@
*
* Simple MRU list-cache (specification).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cache/ftcsbits.c b/freetype/src/cache/ftcsbits.c
index 362999fc..4a8b1963 100644
--- a/freetype/src/cache/ftcsbits.c
+++ b/freetype/src/cache/ftcsbits.c
@@ -4,7 +4,7 @@
*
* FreeType sbits manager (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -171,7 +171,7 @@
sbit->xadvance = (FT_Char)xadvance;
sbit->yadvance = (FT_Char)yadvance;
sbit->format = (FT_Byte)bitmap->pixel_mode;
- sbit->max_grays = (FT_Byte)(bitmap->num_grays - 1);
+ sbit->max_grays = (FT_Byte)( bitmap->num_grays - 1 );
if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
@@ -233,7 +233,7 @@
goto Exit;
}
- if ( !FT_NEW( snode ) )
+ if ( !FT_QNEW( snode ) )
{
FT_UInt count, start;
@@ -248,7 +248,9 @@
snode->count = count;
for ( node_count = 0; node_count < count; node_count++ )
{
- snode->sbits[node_count].width = 255;
+ snode->sbits[node_count].width = 255;
+ snode->sbits[node_count].height = 0;
+ snode->sbits[node_count].buffer = NULL;
}
error = ftc_snode_load( snode,
diff --git a/freetype/src/cache/ftcsbits.h b/freetype/src/cache/ftcsbits.h
index 9f2d5fb3..8f100704 100644
--- a/freetype/src/cache/ftcsbits.h
+++ b/freetype/src/cache/ftcsbits.h
@@ -4,7 +4,7 @@
*
* A small-bitmap cache (specification).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -61,7 +61,7 @@ FT_BEGIN_HEADER
typedef const FTC_SFamilyClassRec* FTC_SFamilyClass;
-#define FTC_SFAMILY_CLASS( x ) ((FTC_SFamilyClass)(x))
+#define FTC_SFAMILY_CLASS( x ) ( (FTC_SFamilyClass)(x) )
#define FTC_CACHE_SFAMILY_CLASS( x ) \
FTC_SFAMILY_CLASS( FTC_CACHE_GCACHE_CLASS( x )->family_class )
diff --git a/freetype/src/cache/rules.mk b/freetype/src/cache/rules.mk
index 0abd216a..778e19e5 100644
--- a/freetype/src/cache/rules.mk
+++ b/freetype/src/cache/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2000-2021 by
+# Copyright (C) 2000-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/cff/cff.c b/freetype/src/cff/cff.c
index c2ffea3d..1ac0beb0 100644
--- a/freetype/src/cff/cff.c
+++ b/freetype/src/cff/cff.c
@@ -4,7 +4,7 @@
*
* FreeType OpenType driver component (body only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cffcmap.c b/freetype/src/cff/cffcmap.c
index ff1aae69..2d667a72 100644
--- a/freetype/src/cff/cffcmap.c
+++ b/freetype/src/cff/cffcmap.c
@@ -4,7 +4,7 @@
*
* CFF character mapping table (cmap) support (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -81,7 +81,7 @@
if ( char_code < 255 )
{
- FT_UInt code = (FT_UInt)(char_code + 1);
+ FT_UInt code = (FT_UInt)( char_code + 1 );
for (;;)
diff --git a/freetype/src/cff/cffcmap.h b/freetype/src/cff/cffcmap.h
index 221e255a..2818d3c6 100644
--- a/freetype/src/cff/cffcmap.h
+++ b/freetype/src/cff/cffcmap.h
@@ -4,7 +4,7 @@
*
* CFF character mapping table (cmap) support (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cffdrivr.c b/freetype/src/cff/cffdrivr.c
index 59210f37..d945afdf 100644
--- a/freetype/src/cff/cffdrivr.c
+++ b/freetype/src/cff/cffdrivr.c
@@ -4,7 +4,7 @@
*
* OpenType font driver implementation (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cffdrivr.h b/freetype/src/cff/cffdrivr.h
index fce92bbb..a312003b 100644
--- a/freetype/src/cff/cffdrivr.h
+++ b/freetype/src/cff/cffdrivr.h
@@ -4,7 +4,7 @@
*
* High-level OpenType driver interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cfferrs.h b/freetype/src/cff/cfferrs.h
index b507ec8b..90d32897 100644
--- a/freetype/src/cff/cfferrs.h
+++ b/freetype/src/cff/cfferrs.h
@@ -4,7 +4,7 @@
*
* CFF error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cffgload.c b/freetype/src/cff/cffgload.c
index 97e8f9c1..7586b886 100644
--- a/freetype/src/cff/cffgload.c
+++ b/freetype/src/cff/cffgload.c
@@ -4,7 +4,7 @@
*
* OpenType Glyph Loader (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -29,6 +29,14 @@
#include "cfferrs.h"
+#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
+#define IS_DEFAULT_INSTANCE( _face ) \
+ ( !( FT_IS_NAMED_INSTANCE( _face ) || \
+ FT_IS_VARIATION( _face ) ) )
+#else
+#define IS_DEFAULT_INSTANCE( _face ) 1
+#endif
+
/**************************************************************************
*
@@ -67,7 +75,7 @@
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
{
- CFF_Font cff = (CFF_Font)(face->extra.data);
+ CFF_Font cff = (CFF_Font)( face->extra.data );
return cff_index_access_element( &cff->charstrings_index, glyph_index,
@@ -103,7 +111,7 @@
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
{
- CFF_Font cff = (CFF_Font)(face->extra.data);
+ CFF_Font cff = (CFF_Font)( face->extra.data );
cff_index_forget_element( &cff->charstrings_index, pointer );
@@ -255,8 +263,8 @@
if ( size->strike_index != 0xFFFFFFFFUL &&
- sfnt->load_eblc &&
- ( load_flags & FT_LOAD_NO_BITMAP ) == 0 )
+ ( load_flags & FT_LOAD_NO_BITMAP ) == 0 &&
+ IS_DEFAULT_INSTANCE( size->root.face ) )
{
TT_SBit_MetricsRec metrics;
@@ -346,6 +354,76 @@
if ( load_flags & FT_LOAD_SBITS_ONLY )
return FT_THROW( Invalid_Argument );
+#ifdef FT_CONFIG_OPTION_SVG
+ /* check for OT-SVG */
+ if ( ( load_flags & FT_LOAD_COLOR ) &&
+ ( (TT_Face)glyph->root.face )->svg )
+ {
+ /*
+ * We load the SVG document and try to grab the advances from the
+ * table. For the bearings we rely on the presetting hook to do that.
+ */
+
+ FT_Short dummy;
+ FT_UShort advanceX;
+ FT_UShort advanceY;
+ SFNT_Service sfnt;
+
+
+ if ( size && (size->root.metrics.x_ppem < 1 ||
+ size->root.metrics.y_ppem < 1 ) )
+ {
+ error = FT_THROW( Invalid_Size_Handle );
+ return error;
+ }
+
+ FT_TRACE3(( "Trying to load SVG glyph\n" ));
+
+ sfnt = (SFNT_Service)((TT_Face)glyph->root.face)->sfnt;
+ error = sfnt->load_svg_doc( (FT_GlyphSlot)glyph, glyph_index );
+ if ( !error )
+ {
+ FT_TRACE3(( "Successfully loaded SVG glyph\n" ));
+
+ glyph->root.format = FT_GLYPH_FORMAT_SVG;
+
+ /*
+ * If horizontal or vertical advances are not present in the table,
+ * this is a problem with the font since the standard requires them.
+ * However, we are graceful and calculate the values by ourselves
+ * for the vertical case.
+ */
+ sfnt->get_metrics( face,
+ FALSE,
+ glyph_index,
+ &dummy,
+ &advanceX );
+ sfnt->get_metrics( face,
+ TRUE,
+ glyph_index,
+ &dummy,
+ &advanceY );
+
+ advanceX =
+ (FT_UShort)FT_MulDiv( advanceX,
+ glyph->root.face->size->metrics.x_ppem,
+ glyph->root.face->units_per_EM );
+ advanceY =
+ (FT_UShort)FT_MulDiv( advanceY,
+ glyph->root.face->size->metrics.y_ppem,
+ glyph->root.face->units_per_EM );
+
+ glyph->root.metrics.horiAdvance = advanceX << 6;
+ glyph->root.metrics.vertAdvance = advanceY << 6;
+
+ return error;
+ }
+
+ FT_TRACE3(( "Failed to load SVG glyph\n" ));
+ }
+
+#endif /* FT_CONFIG_OPTION_SVG */
+
/* if we have a CID subfont, use its matrix (which has already */
/* been multiplied with the root matrix) */
diff --git a/freetype/src/cff/cffgload.h b/freetype/src/cff/cffgload.h
index d0d6a6fa..33616b96 100644
--- a/freetype/src/cff/cffgload.h
+++ b/freetype/src/cff/cffgload.h
@@ -4,7 +4,7 @@
*
* OpenType Glyph Loader (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cffload.c b/freetype/src/cff/cffload.c
index 3c3f6fe5..d6f8a101 100644
--- a/freetype/src/cff/cffload.c
+++ b/freetype/src/cff/cffload.c
@@ -4,7 +4,7 @@
*
* OpenType and CFF data/program tables loader (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cffload.h b/freetype/src/cff/cffload.h
index 20f9296c..a3cc642b 100644
--- a/freetype/src/cff/cffload.h
+++ b/freetype/src/cff/cffload.h
@@ -4,7 +4,7 @@
*
* OpenType & CFF data/program tables loader (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cffobjs.c b/freetype/src/cff/cffobjs.c
index 3a4d47db..fa42accb 100644
--- a/freetype/src/cff/cffobjs.c
+++ b/freetype/src/cff/cffobjs.c
@@ -4,7 +4,7 @@
*
* OpenType objects manager (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -411,9 +411,7 @@
FT_String* result;
- (void)FT_STRDUP( result, source );
-
- FT_UNUSED( error );
+ FT_MEM_STRDUP( result, source );
return result;
}
diff --git a/freetype/src/cff/cffobjs.h b/freetype/src/cff/cffobjs.h
index 149a8a2f..d48c1cde 100644
--- a/freetype/src/cff/cffobjs.h
+++ b/freetype/src/cff/cffobjs.h
@@ -4,7 +4,7 @@
*
* OpenType objects manager (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cffparse.c b/freetype/src/cff/cffparse.c
index dde55e95..2536a218 100644
--- a/freetype/src/cff/cffparse.c
+++ b/freetype/src/cff/cffparse.c
@@ -4,7 +4,7 @@
*
* CFF token stream parser (body)
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cffparse.h b/freetype/src/cff/cffparse.h
index a28ab522..55b6fe6e 100644
--- a/freetype/src/cff/cffparse.h
+++ b/freetype/src/cff/cffparse.h
@@ -4,7 +4,7 @@
*
* CFF token stream parser (specification)
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/cfftoken.h b/freetype/src/cff/cfftoken.h
index eef30690..15237de9 100644
--- a/freetype/src/cff/cfftoken.h
+++ b/freetype/src/cff/cfftoken.h
@@ -4,7 +4,7 @@
*
* CFF token definitions (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cff/module.mk b/freetype/src/cff/module.mk
index cfa444d8..eb122717 100644
--- a/freetype/src/cff/module.mk
+++ b/freetype/src/cff/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/cff/rules.mk b/freetype/src/cff/rules.mk
index e54614ff..569a84c7 100644
--- a/freetype/src/cff/rules.mk
+++ b/freetype/src/cff/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/cid/ciderrs.h b/freetype/src/cid/ciderrs.h
index 2d762d9e..d07da5a0 100644
--- a/freetype/src/cid/ciderrs.h
+++ b/freetype/src/cid/ciderrs.h
@@ -4,7 +4,7 @@
*
* CID error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidgload.c b/freetype/src/cid/cidgload.c
index a46d063d..24d37d32 100644
--- a/freetype/src/cid/cidgload.c
+++ b/freetype/src/cid/cidgload.c
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 Glyph Loader (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidgload.h b/freetype/src/cid/cidgload.h
index 8b515efa..c06bb29d 100644
--- a/freetype/src/cid/cidgload.h
+++ b/freetype/src/cid/cidgload.h
@@ -4,7 +4,7 @@
*
* OpenType Glyph Loader (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidload.c b/freetype/src/cid/cidload.c
index 496219de..fe8fa1ab 100644
--- a/freetype/src/cid/cidload.c
+++ b/freetype/src/cid/cidload.c
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 font loader (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidload.h b/freetype/src/cid/cidload.h
index ee1d4865..90ced928 100644
--- a/freetype/src/cid/cidload.h
+++ b/freetype/src/cid/cidload.h
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 font loader (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidobjs.c b/freetype/src/cid/cidobjs.c
index e3c29c22..c39de636 100644
--- a/freetype/src/cid/cidobjs.c
+++ b/freetype/src/cid/cidobjs.c
@@ -4,7 +4,7 @@
*
* CID objects manager (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidobjs.h b/freetype/src/cid/cidobjs.h
index 32f59cbc..fd76a1cb 100644
--- a/freetype/src/cid/cidobjs.h
+++ b/freetype/src/cid/cidobjs.h
@@ -4,7 +4,7 @@
*
* CID objects manager (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidparse.c b/freetype/src/cid/cidparse.c
index 852c9b6b..cfc82056 100644
--- a/freetype/src/cid/cidparse.c
+++ b/freetype/src/cid/cidparse.c
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 parser (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidparse.h b/freetype/src/cid/cidparse.h
index fbc437bc..ba363f78 100644
--- a/freetype/src/cid/cidparse.h
+++ b/freetype/src/cid/cidparse.h
@@ -4,7 +4,7 @@
*
* CID-keyed Type1 parser (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidriver.c b/freetype/src/cid/cidriver.c
index a0898dfa..a63c0106 100644
--- a/freetype/src/cid/cidriver.c
+++ b/freetype/src/cid/cidriver.c
@@ -4,7 +4,7 @@
*
* CID driver interface (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidriver.h b/freetype/src/cid/cidriver.h
index 3ff5f78e..5073b7a8 100644
--- a/freetype/src/cid/cidriver.h
+++ b/freetype/src/cid/cidriver.h
@@ -4,7 +4,7 @@
*
* High-level CID driver interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/cidtoken.h b/freetype/src/cid/cidtoken.h
index 84c82580..7640137e 100644
--- a/freetype/src/cid/cidtoken.h
+++ b/freetype/src/cid/cidtoken.h
@@ -4,7 +4,7 @@
*
* CID token definitions (specification only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/cid/module.mk b/freetype/src/cid/module.mk
index 2e16262b..d4beef80 100644
--- a/freetype/src/cid/module.mk
+++ b/freetype/src/cid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/cid/rules.mk b/freetype/src/cid/rules.mk
index 933b2daf..7ed85291 100644
--- a/freetype/src/cid/rules.mk
+++ b/freetype/src/cid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/cid/type1cid.c b/freetype/src/cid/type1cid.c
index 5405ecff..b32c2613 100644
--- a/freetype/src/cid/type1cid.c
+++ b/freetype/src/cid/type1cid.c
@@ -4,7 +4,7 @@
*
* FreeType OpenType driver component (body only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/dlg/dlgwrap.c b/freetype/src/dlg/dlgwrap.c
index e0b9a8d2..b149b794 100644
--- a/freetype/src/dlg/dlgwrap.c
+++ b/freetype/src/dlg/dlgwrap.c
@@ -4,7 +4,7 @@
*
* Wrapper file for the 'dlg' library (body only)
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/dlg/rules.mk b/freetype/src/dlg/rules.mk
index a56dee6c..0afa5d7a 100644
--- a/freetype/src/dlg/rules.mk
+++ b/freetype/src/dlg/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/gxvalid/README b/freetype/src/gxvalid/README
index 7fb02962..921b3ac9 100644
--- a/freetype/src/gxvalid/README
+++ b/freetype/src/gxvalid/README
@@ -518,7 +518,7 @@ gxvalid: TrueType GX validator
------------------------------------------------------------------------
-Copyright (C) 2004-2021 by
+Copyright (C) 2004-2022 by
suzuki toshiya, Masatake YAMATO, Red hat K.K.,
David Turner, Robert Wilhelm, and Werner Lemberg.
diff --git a/freetype/src/gxvalid/gxvalid.c b/freetype/src/gxvalid/gxvalid.c
index 309d5174..9f380337 100644
--- a/freetype/src/gxvalid/gxvalid.c
+++ b/freetype/src/gxvalid/gxvalid.c
@@ -4,7 +4,7 @@
*
* FreeType validator for TrueTypeGX/AAT tables (body only).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvalid.h b/freetype/src/gxvalid/gxvalid.h
index 2c41c286..170fde34 100644
--- a/freetype/src/gxvalid/gxvalid.h
+++ b/freetype/src/gxvalid/gxvalid.h
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT table validation (specification only).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvbsln.c b/freetype/src/gxvalid/gxvbsln.c
index af69cb51..9784d18c 100644
--- a/freetype/src/gxvalid/gxvbsln.c
+++ b/freetype/src/gxvalid/gxvbsln.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT bsln table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvcommn.c b/freetype/src/gxvalid/gxvcommn.c
index 18e42b0c..999cba4e 100644
--- a/freetype/src/gxvalid/gxvcommn.c
+++ b/freetype/src/gxvalid/gxvcommn.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT common tables validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
@@ -1033,7 +1033,7 @@
GXV_NAME_ENTER( "StateArray" );
GXV_TRACE(( "parse %d bytes by stateSize=%d maxClassID=%d\n",
- (int)(*length_p), stateSize, (int)(maxClassID) ));
+ (int)( *length_p ), stateSize, (int)maxClassID ));
/*
* 2 states are predefined and must be described in StateArray:
@@ -1418,7 +1418,7 @@
GXV_NAME_ENTER( "XStateArray" );
GXV_TRACE(( "parse % 3d bytes by stateSize=% 3d maxClassID=% 3d\n",
- (int)(*length_p), (int)stateSize, (int)(maxClassID) ));
+ (int)( *length_p ), (int)stateSize, (int)maxClassID ));
/*
* 2 states are predefined and must be described:
diff --git a/freetype/src/gxvalid/gxvcommn.h b/freetype/src/gxvalid/gxvcommn.h
index b79b6411..794cf0a4 100644
--- a/freetype/src/gxvalid/gxvcommn.h
+++ b/freetype/src/gxvalid/gxvcommn.h
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT common tables validation (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxverror.h b/freetype/src/gxvalid/gxverror.h
index d20d3956..8d2faac8 100644
--- a/freetype/src/gxvalid/gxverror.h
+++ b/freetype/src/gxvalid/gxverror.h
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT validation module error codes (specification only).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvfeat.c b/freetype/src/gxvalid/gxvfeat.c
index 0a8e2f20..77200564 100644
--- a/freetype/src/gxvalid/gxvfeat.c
+++ b/freetype/src/gxvalid/gxvfeat.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT feat table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvfeat.h b/freetype/src/gxvalid/gxvfeat.h
index f6d28fa7..3deeb521 100644
--- a/freetype/src/gxvalid/gxvfeat.h
+++ b/freetype/src/gxvalid/gxvfeat.h
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT feat table validation (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvfgen.c b/freetype/src/gxvalid/gxvfgen.c
index b47cd0f7..57f11a84 100644
--- a/freetype/src/gxvalid/gxvfgen.c
+++ b/freetype/src/gxvalid/gxvfgen.c
@@ -5,7 +5,7 @@
* Generate feature registry data for gxv `feat' validator.
* This program is derived from gxfeatreg.c in gxlayout.
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* Masatake YAMATO and Redhat K.K.
*
* This file may only be used,
diff --git a/freetype/src/gxvalid/gxvjust.c b/freetype/src/gxvalid/gxvjust.c
index ec289b8e..6af2c79c 100644
--- a/freetype/src/gxvalid/gxvjust.c
+++ b/freetype/src/gxvalid/gxvjust.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT just table validation (body).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvkern.c b/freetype/src/gxvalid/gxvkern.c
index 542e8bc0..f0804e37 100644
--- a/freetype/src/gxvalid/gxvkern.c
+++ b/freetype/src/gxvalid/gxvkern.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT kern table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvlcar.c b/freetype/src/gxvalid/gxvlcar.c
index 9db839ba..be6e491f 100644
--- a/freetype/src/gxvalid/gxvlcar.c
+++ b/freetype/src/gxvalid/gxvlcar.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT lcar table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmod.c b/freetype/src/gxvalid/gxvmod.c
index 1a11426c..8c505dd2 100644
--- a/freetype/src/gxvalid/gxvmod.c
+++ b/freetype/src/gxvalid/gxvmod.c
@@ -4,7 +4,7 @@
*
* FreeType's TrueTypeGX/AAT validation module implementation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmod.h b/freetype/src/gxvalid/gxvmod.h
index 90e0c10a..1758d4c8 100644
--- a/freetype/src/gxvalid/gxvmod.h
+++ b/freetype/src/gxvalid/gxvmod.h
@@ -5,7 +5,7 @@
* FreeType's TrueTypeGX/AAT validation module implementation
* (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmort.c b/freetype/src/gxvalid/gxvmort.c
index d0db7f4d..01a77d6a 100644
--- a/freetype/src/gxvalid/gxvmort.c
+++ b/freetype/src/gxvalid/gxvmort.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT mort table validation (body).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmort.h b/freetype/src/gxvalid/gxvmort.h
index de5ab4ef..1a1d8961 100644
--- a/freetype/src/gxvalid/gxvmort.h
+++ b/freetype/src/gxvalid/gxvmort.h
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT common definition for mort table (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmort0.c b/freetype/src/gxvalid/gxvmort0.c
index 0c695aa4..fa6c7368 100644
--- a/freetype/src/gxvalid/gxvmort0.c
+++ b/freetype/src/gxvalid/gxvmort0.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT mort table validation
* body for type0 (Indic Script Rearrangement) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmort1.c b/freetype/src/gxvalid/gxvmort1.c
index 0af22362..170acee2 100644
--- a/freetype/src/gxvalid/gxvmort1.c
+++ b/freetype/src/gxvalid/gxvmort1.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT mort table validation
* body for type1 (Contextual Substitution) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmort2.c b/freetype/src/gxvalid/gxvmort2.c
index 73f418ea..faf44674 100644
--- a/freetype/src/gxvalid/gxvmort2.c
+++ b/freetype/src/gxvalid/gxvmort2.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT mort table validation
* body for type2 (Ligature Substitution) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmort4.c b/freetype/src/gxvalid/gxvmort4.c
index 1b0dd3ed..12555da8 100644
--- a/freetype/src/gxvalid/gxvmort4.c
+++ b/freetype/src/gxvalid/gxvmort4.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT mort table validation
* body for type4 (Non-Contextual Glyph Substitution) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmort5.c b/freetype/src/gxvalid/gxvmort5.c
index cfbf3120..48caac43 100644
--- a/freetype/src/gxvalid/gxvmort5.c
+++ b/freetype/src/gxvalid/gxvmort5.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT mort table validation
* body for type5 (Contextual Glyph Insertion) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmorx.c b/freetype/src/gxvalid/gxvmorx.c
index babff518..4b848b1e 100644
--- a/freetype/src/gxvalid/gxvmorx.c
+++ b/freetype/src/gxvalid/gxvmorx.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT morx table validation (body).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmorx.h b/freetype/src/gxvalid/gxvmorx.h
index f155f184..a849d573 100644
--- a/freetype/src/gxvalid/gxvmorx.h
+++ b/freetype/src/gxvalid/gxvmorx.h
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT common definition for morx table (specification).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmorx0.c b/freetype/src/gxvalid/gxvmorx0.c
index e93cea9c..7eb27d14 100644
--- a/freetype/src/gxvalid/gxvmorx0.c
+++ b/freetype/src/gxvalid/gxvmorx0.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT morx table validation
* body for type0 (Indic Script Rearrangement) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmorx1.c b/freetype/src/gxvalid/gxvmorx1.c
index d380f8d1..6ffbf151 100644
--- a/freetype/src/gxvalid/gxvmorx1.c
+++ b/freetype/src/gxvalid/gxvmorx1.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT morx table validation
* body for type1 (Contextual Substitution) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmorx2.c b/freetype/src/gxvalid/gxvmorx2.c
index e7e008f0..eb79e9b4 100644
--- a/freetype/src/gxvalid/gxvmorx2.c
+++ b/freetype/src/gxvalid/gxvmorx2.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT morx table validation
* body for type2 (Ligature Substitution) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmorx4.c b/freetype/src/gxvalid/gxvmorx4.c
index e632e8d4..30c602cb 100644
--- a/freetype/src/gxvalid/gxvmorx4.c
+++ b/freetype/src/gxvalid/gxvmorx4.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT morx table validation
* body for "morx" type4 (Non-Contextual Glyph Substitution) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvmorx5.c b/freetype/src/gxvalid/gxvmorx5.c
index 5ad33976..afdef05a 100644
--- a/freetype/src/gxvalid/gxvmorx5.c
+++ b/freetype/src/gxvalid/gxvmorx5.c
@@ -5,7 +5,7 @@
* TrueTypeGX/AAT morx table validation
* body for type5 (Contextual Glyph Insertion) subtable.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvopbd.c b/freetype/src/gxvalid/gxvopbd.c
index 7a2feab4..a6b04a4b 100644
--- a/freetype/src/gxvalid/gxvopbd.c
+++ b/freetype/src/gxvalid/gxvopbd.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT opbd table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvprop.c b/freetype/src/gxvalid/gxvprop.c
index 98cd3688..bf1ed112 100644
--- a/freetype/src/gxvalid/gxvprop.c
+++ b/freetype/src/gxvalid/gxvprop.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT prop table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/gxvtrak.c b/freetype/src/gxvalid/gxvtrak.c
index c1ed9287..93ac3e76 100644
--- a/freetype/src/gxvalid/gxvtrak.c
+++ b/freetype/src/gxvalid/gxvtrak.c
@@ -4,7 +4,7 @@
*
* TrueTypeGX/AAT trak table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
diff --git a/freetype/src/gxvalid/module.mk b/freetype/src/gxvalid/module.mk
index efb9c929..7635587c 100644
--- a/freetype/src/gxvalid/module.mk
+++ b/freetype/src/gxvalid/module.mk
@@ -2,7 +2,7 @@
# FreeType 2 gxvalid module definition
#
-# Copyright (C) 2004-2021 by
+# Copyright (C) 2004-2022 by
# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
diff --git a/freetype/src/gxvalid/rules.mk b/freetype/src/gxvalid/rules.mk
index 8e0b4534..cc103b27 100644
--- a/freetype/src/gxvalid/rules.mk
+++ b/freetype/src/gxvalid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2004-2021 by
+# Copyright (C) 2004-2022 by
# suzuki toshiya, Masatake YAMATO, Red Hat K.K.,
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
diff --git a/freetype/src/gzip/README.freetype b/freetype/src/gzip/README.freetype
new file mode 100644
index 00000000..493b8071
--- /dev/null
+++ b/freetype/src/gzip/README.freetype
@@ -0,0 +1,22 @@
+Name: zlib
+Short Name: zlib
+URL: http://zlib.net/
+Version: 1.2.12
+License: see `zlib.h`
+
+Description:
+"A massively spiffy yet delicately unobtrusive compression library."
+
+'zlib' is a free, general-purpose, legally unencumbered lossless
+data-compression library. 'zlib' implements the "deflate" compression
+algorithm described by RFC 1951, which combines the LZ77 (Lempel-Ziv)
+algorithm with Huffman coding. zlib also implements the zlib (RFC 1950) and
+gzip (RFC 1952) wrapper formats.
+
+Local Modifications:
+The files in this directory have been prepared as follows.
+
+ - Take the unmodified source code files from the zlib distribution that are
+ included by `ftgzip.c`.
+ - Run zlib's `zlib2ansi` script on all `.c` files.
+ - Apply the diff file(s) in the `patches` folder.
diff --git a/freetype/src/gzip/adler32.c b/freetype/src/gzip/adler32.c
index c53f9dd1..aa032e1d 100644
--- a/freetype/src/gzip/adler32.c
+++ b/freetype/src/gzip/adler32.c
@@ -1,48 +1,192 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
- * Copyright (C) 1995-2002 Mark Adler
+ * Copyright (C) 1995-2011, 2016 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
-#include "zlib.h"
+#include "zutil.h"
-#define BASE 65521L /* largest prime smaller than 65536 */
+#ifndef Z_FREETYPE
+local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
+#endif
+
+#define BASE 65521U /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
-#define DO1(buf,i) {s1 += buf[i]; s2 += s1;}
+#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;}
#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
#define DO16(buf) DO8(buf,0); DO8(buf,8);
+/* use NO_DIVIDE if your processor does not do division in hardware --
+ try it both ways to see which is faster */
+#ifdef NO_DIVIDE
+/* note that this assumes BASE is 65521, where 65536 % 65521 == 15
+ (thank you to John Reiser for pointing this out) */
+# define CHOP(a) \
+ do { \
+ unsigned long tmp = a >> 16; \
+ a &= 0xffffUL; \
+ a += (tmp << 4) - tmp; \
+ } while (0)
+# define MOD28(a) \
+ do { \
+ CHOP(a); \
+ if (a >= BASE) a -= BASE; \
+ } while (0)
+# define MOD(a) \
+ do { \
+ CHOP(a); \
+ MOD28(a); \
+ } while (0)
+# define MOD63(a) \
+ do { /* this assumes a is not negative */ \
+ z_off64_t tmp = a >> 32; \
+ a &= 0xffffffffL; \
+ a += (tmp << 8) - (tmp << 5) + tmp; \
+ tmp = a >> 16; \
+ a &= 0xffffL; \
+ a += (tmp << 4) - tmp; \
+ tmp = a >> 16; \
+ a &= 0xffffL; \
+ a += (tmp << 4) - tmp; \
+ if (a >= BASE) a -= BASE; \
+ } while (0)
+#else
+# define MOD(a) a %= BASE
+# define MOD28(a) a %= BASE
+# define MOD63(a) a %= BASE
+#endif
+
/* ========================================================================= */
-ZEXPORT(uLong) adler32( /* adler, buf, len) */
+uLong ZEXPORT adler32_z(
uLong adler,
const Bytef *buf,
- uInt len )
+ z_size_t len)
{
- unsigned long s1 = adler & 0xffff;
- unsigned long s2 = (adler >> 16) & 0xffff;
- int k;
+ unsigned long sum2;
+ unsigned n;
+
+ /* split Adler-32 into component sums */
+ sum2 = (adler >> 16) & 0xffff;
+ adler &= 0xffff;
+
+ /* in case user likes doing a byte at a time, keep it fast */
+ if (len == 1) {
+ adler += buf[0];
+ if (adler >= BASE)
+ adler -= BASE;
+ sum2 += adler;
+ if (sum2 >= BASE)
+ sum2 -= BASE;
+ return adler | (sum2 << 16);
+ }
- if (buf == Z_NULL) return 1L;
+ /* initial Adler-32 value (deferred check for len == 1 speed) */
+ if (buf == Z_NULL)
+ return 1L;
- while (len > 0) {
- k = len < NMAX ? len : NMAX;
- len -= k;
- while (k >= 16) {
+ /* in case short lengths are provided, keep it somewhat fast */
+ if (len < 16) {
+ while (len--) {
+ adler += *buf++;
+ sum2 += adler;
+ }
+ if (adler >= BASE)
+ adler -= BASE;
+ MOD28(sum2); /* only added so many BASE's */
+ return adler | (sum2 << 16);
+ }
+
+ /* do length NMAX blocks -- requires just one modulo operation */
+ while (len >= NMAX) {
+ len -= NMAX;
+ n = NMAX / 16; /* NMAX is divisible by 16 */
+ do {
+ DO16(buf); /* 16 sums unrolled */
+ buf += 16;
+ } while (--n);
+ MOD(adler);
+ MOD(sum2);
+ }
+
+ /* do remaining bytes (less than NMAX, still just one modulo) */
+ if (len) { /* avoid modulos if none remaining */
+ while (len >= 16) {
+ len -= 16;
DO16(buf);
buf += 16;
- k -= 16;
}
- if (k != 0) do {
- s1 += *buf++;
- s2 += s1;
- } while (--k);
- s1 %= BASE;
- s2 %= BASE;
+ while (len--) {
+ adler += *buf++;
+ sum2 += adler;
+ }
+ MOD(adler);
+ MOD(sum2);
}
- return (s2 << 16) | s1;
+
+ /* return recombined sums */
+ return adler | (sum2 << 16);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT adler32(
+ uLong adler,
+ const Bytef *buf,
+ uInt len)
+{
+ return adler32_z(adler, buf, len);
+}
+
+#ifndef Z_FREETYPE
+
+/* ========================================================================= */
+local uLong adler32_combine_(
+ uLong adler1,
+ uLong adler2,
+ z_off64_t len2)
+{
+ unsigned long sum1;
+ unsigned long sum2;
+ unsigned rem;
+
+ /* for negative len, return invalid adler32 as a clue for debugging */
+ if (len2 < 0)
+ return 0xffffffffUL;
+
+ /* the derivation of this formula is left as an exercise for the reader */
+ MOD63(len2); /* assumes len2 >= 0 */
+ rem = (unsigned)len2;
+ sum1 = adler1 & 0xffff;
+ sum2 = rem * sum1;
+ MOD(sum2);
+ sum1 += (adler2 & 0xffff) + BASE - 1;
+ sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
+ if (sum1 >= BASE) sum1 -= BASE;
+ if (sum1 >= BASE) sum1 -= BASE;
+ if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1);
+ if (sum2 >= BASE) sum2 -= BASE;
+ return sum1 | (sum2 << 16);
}
+
+/* ========================================================================= */
+uLong ZEXPORT adler32_combine(
+ uLong adler1,
+ uLong adler2,
+ z_off_t len2)
+{
+ return adler32_combine_(adler1, adler2, len2);
+}
+
+uLong ZEXPORT adler32_combine64(
+ uLong adler1,
+ uLong adler2,
+ z_off64_t len2)
+{
+ return adler32_combine_(adler1, adler2, len2);
+}
+
+#endif /* !Z_FREETYPE */
diff --git a/freetype/src/gzip/crc32.c b/freetype/src/gzip/crc32.c
new file mode 100644
index 00000000..2ddc32d1
--- /dev/null
+++ b/freetype/src/gzip/crc32.c
@@ -0,0 +1,1116 @@
+/* crc32.c -- compute the CRC-32 of a data stream
+ * Copyright (C) 1995-2022 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ *
+ * This interleaved implementation of a CRC makes use of pipelined multiple
+ * arithmetic-logic units, commonly found in modern CPU cores. It is due to
+ * Kadatch and Jenkins (2010). See doc/crc-doc.1.0.pdf in this distribution.
+ */
+
+/* @(#) $Id$ */
+
+/*
+ Note on the use of DYNAMIC_CRC_TABLE: there is no mutex or semaphore
+ protection on the static variables used to control the first-use generation
+ of the crc tables. Therefore, if you #define DYNAMIC_CRC_TABLE, you should
+ first call get_crc_table() to initialize the tables before allowing more than
+ one thread to use crc32().
+
+ MAKECRCH can be #defined to write out crc32.h. A main() routine is also
+ produced, so that this one source file can be compiled to an executable.
+ */
+
+#ifdef MAKECRCH
+# include <stdio.h>
+# ifndef DYNAMIC_CRC_TABLE
+# define DYNAMIC_CRC_TABLE
+# endif /* !DYNAMIC_CRC_TABLE */
+#endif /* MAKECRCH */
+
+#include "zutil.h" /* for Z_U4, Z_U8, z_crc_t, and FAR definitions */
+
+ /*
+ A CRC of a message is computed on N braids of words in the message, where
+ each word consists of W bytes (4 or 8). If N is 3, for example, then three
+ running sparse CRCs are calculated respectively on each braid, at these
+ indices in the array of words: 0, 3, 6, ..., 1, 4, 7, ..., and 2, 5, 8, ...
+ This is done starting at a word boundary, and continues until as many blocks
+ of N * W bytes as are available have been processed. The results are combined
+ into a single CRC at the end. For this code, N must be in the range 1..6 and
+ W must be 4 or 8. The upper limit on N can be increased if desired by adding
+ more #if blocks, extending the patterns apparent in the code. In addition,
+ crc32.h would need to be regenerated, if the maximum N value is increased.
+
+ N and W are chosen empirically by benchmarking the execution time on a given
+ processor. The choices for N and W below were based on testing on Intel Kaby
+ Lake i7, AMD Ryzen 7, ARM Cortex-A57, Sparc64-VII, PowerPC POWER9, and MIPS64
+ Octeon II processors. The Intel, AMD, and ARM processors were all fastest
+ with N=5, W=8. The Sparc, PowerPC, and MIPS64 were all fastest at N=5, W=4.
+ They were all tested with either gcc or clang, all using the -O3 optimization
+ level. Your mileage may vary.
+ */
+
+/* Define N */
+#ifdef Z_TESTN
+# define N Z_TESTN
+#else
+# define N 5
+#endif
+#if N < 1 || N > 6
+# error N must be in 1..6
+#endif
+
+/*
+ z_crc_t must be at least 32 bits. z_word_t must be at least as long as
+ z_crc_t. It is assumed here that z_word_t is either 32 bits or 64 bits, and
+ that bytes are eight bits.
+ */
+
+/*
+ Define W and the associated z_word_t type. If W is not defined, then a
+ braided calculation is not used, and the associated tables and code are not
+ compiled.
+ */
+#ifdef Z_TESTW
+# if Z_TESTW-1 != -1
+# define W Z_TESTW
+# endif
+#else
+# ifdef MAKECRCH
+# define W 8 /* required for MAKECRCH */
+# else
+# if defined(__x86_64__) || defined(__aarch64__)
+# define W 8
+# else
+# define W 4
+# endif
+# endif
+#endif
+#ifdef W
+# if W == 8 && defined(Z_U8)
+ typedef Z_U8 z_word_t;
+# elif defined(Z_U4)
+# undef W
+# define W 4
+ typedef Z_U4 z_word_t;
+# else
+# undef W
+# endif
+#endif
+
+/* Local functions. */
+local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
+local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
+
+/* If available, use the ARM processor CRC32 instruction. */
+#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
+# define ARMCRC32
+#endif
+
+#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
+/*
+ Swap the bytes in a z_word_t to convert between little and big endian. Any
+ self-respecting compiler will optimize this to a single machine byte-swap
+ instruction, if one is available. This assumes that word_t is either 32 bits
+ or 64 bits.
+ */
+local z_word_t byte_swap(
+ z_word_t word)
+{
+# if W == 8
+ return
+ (word & 0xff00000000000000) >> 56 |
+ (word & 0xff000000000000) >> 40 |
+ (word & 0xff0000000000) >> 24 |
+ (word & 0xff00000000) >> 8 |
+ (word & 0xff000000) << 8 |
+ (word & 0xff0000) << 24 |
+ (word & 0xff00) << 40 |
+ (word & 0xff) << 56;
+# else /* W == 4 */
+ return
+ (word & 0xff000000) >> 24 |
+ (word & 0xff0000) >> 8 |
+ (word & 0xff00) << 8 |
+ (word & 0xff) << 24;
+# endif
+}
+#endif
+
+/* CRC polynomial. */
+#define POLY 0xedb88320 /* p(x) reflected, with x^32 implied */
+
+#ifdef DYNAMIC_CRC_TABLE
+
+local z_crc_t FAR crc_table[256];
+local z_crc_t FAR x2n_table[32];
+local void make_crc_table OF((void));
+#ifdef W
+ local z_word_t FAR crc_big_table[256];
+ local z_crc_t FAR crc_braid_table[W][256];
+ local z_word_t FAR crc_braid_big_table[W][256];
+ local void braid OF((z_crc_t [][256], z_word_t [][256], int, int));
+#endif
+#ifdef MAKECRCH
+ local void write_table OF((FILE *, const z_crc_t FAR *, int));
+ local void write_table32hi OF((FILE *, const z_word_t FAR *, int));
+ local void write_table64 OF((FILE *, const z_word_t FAR *, int));
+#endif /* MAKECRCH */
+
+/*
+ Define a once() function depending on the availability of atomics. If this is
+ compiled with DYNAMIC_CRC_TABLE defined, and if CRCs will be computed in
+ multiple threads, and if atomics are not available, then get_crc_table() must
+ be called to initialize the tables and must return before any threads are
+ allowed to compute or combine CRCs.
+ */
+
+/* Definition of once functionality. */
+typedef struct once_s once_t;
+local void once OF((once_t *, void (*)(void)));
+
+/* Check for the availability of atomics. */
+#if defined(__STDC__) && __STDC_VERSION__ >= 201112L && \
+ !defined(__STDC_NO_ATOMICS__)
+
+#include <stdatomic.h>
+
+/* Structure for once(), which must be initialized with ONCE_INIT. */
+struct once_s {
+ atomic_flag begun;
+ atomic_int done;
+};
+#define ONCE_INIT {ATOMIC_FLAG_INIT, 0}
+
+/*
+ Run the provided init() function exactly once, even if multiple threads
+ invoke once() at the same time. The state must be a once_t initialized with
+ ONCE_INIT.
+ */
+local void once(state, init)
+ once_t *state;
+ void (*init)(void);
+{
+ if (!atomic_load(&state->done)) {
+ if (atomic_flag_test_and_set(&state->begun))
+ while (!atomic_load(&state->done))
+ ;
+ else {
+ init();
+ atomic_store(&state->done, 1);
+ }
+ }
+}
+
+#else /* no atomics */
+
+/* Structure for once(), which must be initialized with ONCE_INIT. */
+struct once_s {
+ volatile int begun;
+ volatile int done;
+};
+#define ONCE_INIT {0, 0}
+
+/* Test and set. Alas, not atomic, but tries to minimize the period of
+ vulnerability. */
+local int test_and_set OF((int volatile *));
+local int test_and_set(
+ int volatile *flag)
+{
+ int was;
+
+ was = *flag;
+ *flag = 1;
+ return was;
+}
+
+/* Run the provided init() function once. This is not thread-safe. */
+local void once(state, init)
+ once_t *state;
+ void (*init)(void);
+{
+ if (!state->done) {
+ if (test_and_set(&state->begun))
+ while (!state->done)
+ ;
+ else {
+ init();
+ state->done = 1;
+ }
+ }
+}
+
+#endif
+
+/* State for once(). */
+local once_t made = ONCE_INIT;
+
+/*
+ Generate tables for a byte-wise 32-bit CRC calculation on the polynomial:
+ x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1.
+
+ Polynomials over GF(2) are represented in binary, one bit per coefficient,
+ with the lowest powers in the most significant bit. Then adding polynomials
+ is just exclusive-or, and multiplying a polynomial by x is a right shift by
+ one. If we call the above polynomial p, and represent a byte as the
+ polynomial q, also with the lowest power in the most significant bit (so the
+ byte 0xb1 is the polynomial x^7+x^3+x^2+1), then the CRC is (q*x^32) mod p,
+ where a mod b means the remainder after dividing a by b.
+
+ This calculation is done using the shift-register method of multiplying and
+ taking the remainder. The register is initialized to zero, and for each
+ incoming bit, x^32 is added mod p to the register if the bit is a one (where
+ x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by x
+ (which is shifting right by one and adding x^32 mod p if the bit shifted out
+ is a one). We start with the highest power (least significant bit) of q and
+ repeat for all eight bits of q.
+
+ The table is simply the CRC of all possible eight bit values. This is all the
+ information needed to generate CRCs on data a byte at a time for all
+ combinations of CRC register values and incoming bytes.
+ */
+
+local void make_crc_table()
+{
+ unsigned i, j, n;
+ z_crc_t p;
+
+ /* initialize the CRC of bytes tables */
+ for (i = 0; i < 256; i++) {
+ p = i;
+ for (j = 0; j < 8; j++)
+ p = p & 1 ? (p >> 1) ^ POLY : p >> 1;
+ crc_table[i] = p;
+#ifdef W
+ crc_big_table[i] = byte_swap(p);
+#endif
+ }
+
+ /* initialize the x^2^n mod p(x) table */
+ p = (z_crc_t)1 << 30; /* x^1 */
+ x2n_table[0] = p;
+ for (n = 1; n < 32; n++)
+ x2n_table[n] = p = multmodp(p, p);
+
+#ifdef W
+ /* initialize the braiding tables -- needs x2n_table[] */
+ braid(crc_braid_table, crc_braid_big_table, N, W);
+#endif
+
+#ifdef MAKECRCH
+ {
+ /*
+ The crc32.h header file contains tables for both 32-bit and 64-bit
+ z_word_t's, and so requires a 64-bit type be available. In that case,
+ z_word_t must be defined to be 64-bits. This code then also generates
+ and writes out the tables for the case that z_word_t is 32 bits.
+ */
+#if !defined(W) || W != 8
+# error Need a 64-bit integer type in order to generate crc32.h.
+#endif
+ FILE *out;
+ int k, n;
+ z_crc_t ltl[8][256];
+ z_word_t big[8][256];
+
+ out = fopen("crc32.h", "w");
+ if (out == NULL) return;
+
+ /* write out little-endian CRC table to crc32.h */
+ fprintf(out,
+ "/* crc32.h -- tables for rapid CRC calculation\n"
+ " * Generated automatically by crc32.c\n */\n"
+ "\n"
+ "local const z_crc_t FAR crc_table[] = {\n"
+ " ");
+ write_table(out, crc_table, 256);
+ fprintf(out,
+ "};\n");
+
+ /* write out big-endian CRC table for 64-bit z_word_t to crc32.h */
+ fprintf(out,
+ "\n"
+ "#ifdef W\n"
+ "\n"
+ "#if W == 8\n"
+ "\n"
+ "local const z_word_t FAR crc_big_table[] = {\n"
+ " ");
+ write_table64(out, crc_big_table, 256);
+ fprintf(out,
+ "};\n");
+
+ /* write out big-endian CRC table for 32-bit z_word_t to crc32.h */
+ fprintf(out,
+ "\n"
+ "#else /* W == 4 */\n"
+ "\n"
+ "local const z_word_t FAR crc_big_table[] = {\n"
+ " ");
+ write_table32hi(out, crc_big_table, 256);
+ fprintf(out,
+ "};\n"
+ "\n"
+ "#endif\n");
+
+ /* write out braid tables for each value of N */
+ for (n = 1; n <= 6; n++) {
+ fprintf(out,
+ "\n"
+ "#if N == %d\n", n);
+
+ /* compute braid tables for this N and 64-bit word_t */
+ braid(ltl, big, n, 8);
+
+ /* write out braid tables for 64-bit z_word_t to crc32.h */
+ fprintf(out,
+ "\n"
+ "#if W == 8\n"
+ "\n"
+ "local const z_crc_t FAR crc_braid_table[][256] = {\n");
+ for (k = 0; k < 8; k++) {
+ fprintf(out, " {");
+ write_table(out, ltl[k], 256);
+ fprintf(out, "}%s", k < 7 ? ",\n" : "");
+ }
+ fprintf(out,
+ "};\n"
+ "\n"
+ "local const z_word_t FAR crc_braid_big_table[][256] = {\n");
+ for (k = 0; k < 8; k++) {
+ fprintf(out, " {");
+ write_table64(out, big[k], 256);
+ fprintf(out, "}%s", k < 7 ? ",\n" : "");
+ }
+ fprintf(out,
+ "};\n");
+
+ /* compute braid tables for this N and 32-bit word_t */
+ braid(ltl, big, n, 4);
+
+ /* write out braid tables for 32-bit z_word_t to crc32.h */
+ fprintf(out,
+ "\n"
+ "#else /* W == 4 */\n"
+ "\n"
+ "local const z_crc_t FAR crc_braid_table[][256] = {\n");
+ for (k = 0; k < 4; k++) {
+ fprintf(out, " {");
+ write_table(out, ltl[k], 256);
+ fprintf(out, "}%s", k < 3 ? ",\n" : "");
+ }
+ fprintf(out,
+ "};\n"
+ "\n"
+ "local const z_word_t FAR crc_braid_big_table[][256] = {\n");
+ for (k = 0; k < 4; k++) {
+ fprintf(out, " {");
+ write_table32hi(out, big[k], 256);
+ fprintf(out, "}%s", k < 3 ? ",\n" : "");
+ }
+ fprintf(out,
+ "};\n"
+ "\n"
+ "#endif\n"
+ "\n"
+ "#endif\n");
+ }
+ fprintf(out,
+ "\n"
+ "#endif\n");
+
+ /* write out zeros operator table to crc32.h */
+ fprintf(out,
+ "\n"
+ "local const z_crc_t FAR x2n_table[] = {\n"
+ " ");
+ write_table(out, x2n_table, 32);
+ fprintf(out,
+ "};\n");
+ fclose(out);
+ }
+#endif /* MAKECRCH */
+}
+
+#ifdef MAKECRCH
+
+/*
+ Write the 32-bit values in table[0..k-1] to out, five per line in
+ hexadecimal separated by commas.
+ */
+local void write_table(
+ FILE *out,
+ const z_crc_t FAR *table,
+ int k)
+{
+ int n;
+
+ for (n = 0; n < k; n++)
+ fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ",
+ (unsigned long)(table[n]),
+ n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", "));
+}
+
+/*
+ Write the high 32-bits of each value in table[0..k-1] to out, five per line
+ in hexadecimal separated by commas.
+ */
+local void write_table32hi(
+ FILE *out,
+ const z_word_t FAR *table,
+ int k)
+{
+ int n;
+
+ for (n = 0; n < k; n++)
+ fprintf(out, "%s0x%08lx%s", n == 0 || n % 5 ? "" : " ",
+ (unsigned long)(table[n] >> 32),
+ n == k - 1 ? "" : (n % 5 == 4 ? ",\n" : ", "));
+}
+
+/*
+ Write the 64-bit values in table[0..k-1] to out, three per line in
+ hexadecimal separated by commas. This assumes that if there is a 64-bit
+ type, then there is also a long long integer type, and it is at least 64
+ bits. If not, then the type cast and format string can be adjusted
+ accordingly.
+ */
+local void write_table64(
+ FILE *out,
+ const z_word_t FAR *table,
+ int k)
+{
+ int n;
+
+ for (n = 0; n < k; n++)
+ fprintf(out, "%s0x%016llx%s", n == 0 || n % 3 ? "" : " ",
+ (unsigned long long)(table[n]),
+ n == k - 1 ? "" : (n % 3 == 2 ? ",\n" : ", "));
+}
+
+/* Actually do the deed. */
+int main()
+{
+ make_crc_table();
+ return 0;
+}
+
+#endif /* MAKECRCH */
+
+#ifdef W
+/*
+ Generate the little and big-endian braid tables for the given n and z_word_t
+ size w. Each array must have room for w blocks of 256 elements.
+ */
+local void braid(ltl, big, n, w)
+ z_crc_t ltl[][256];
+ z_word_t big[][256];
+ int n;
+ int w;
+{
+ int k;
+ z_crc_t i, p, q;
+ for (k = 0; k < w; k++) {
+ p = x2nmodp((n * w + 3 - k) << 3, 0);
+ ltl[k][0] = 0;
+ big[w - 1 - k][0] = 0;
+ for (i = 1; i < 256; i++) {
+ ltl[k][i] = q = multmodp(i << 24, p);
+ big[w - 1 - k][i] = byte_swap(q);
+ }
+ }
+}
+#endif
+
+#else /* !DYNAMIC_CRC_TABLE */
+/* ========================================================================
+ * Tables for byte-wise and braided CRC-32 calculations, and a table of powers
+ * of x for combining CRC-32s, all made by make_crc_table().
+ */
+#include "crc32.h"
+#endif /* DYNAMIC_CRC_TABLE */
+
+/* ========================================================================
+ * Routines used for CRC calculation. Some are also required for the table
+ * generation above.
+ */
+
+/*
+ Return a(x) multiplied by b(x) modulo p(x), where p(x) is the CRC polynomial,
+ reflected. For speed, this requires that a not be zero.
+ */
+local z_crc_t multmodp(
+ z_crc_t a,
+ z_crc_t b)
+{
+ z_crc_t m, p;
+
+ m = (z_crc_t)1 << 31;
+ p = 0;
+ for (;;) {
+ if (a & m) {
+ p ^= b;
+ if ((a & (m - 1)) == 0)
+ break;
+ }
+ m >>= 1;
+ b = b & 1 ? (b >> 1) ^ POLY : b >> 1;
+ }
+ return p;
+}
+
+/*
+ Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been
+ initialized.
+ */
+local z_crc_t x2nmodp(
+ z_off64_t n,
+ unsigned k)
+{
+ z_crc_t p;
+
+ p = (z_crc_t)1 << 31; /* x^0 == 1 */
+ while (n) {
+ if (n & 1)
+ p = multmodp(x2n_table[k & 31], p);
+ n >>= 1;
+ k++;
+ }
+ return p;
+}
+
+/* =========================================================================
+ * This function can be used by asm versions of crc32(), and to force the
+ * generation of the CRC tables in a threaded application.
+ */
+const z_crc_t FAR * ZEXPORT get_crc_table()
+{
+#ifdef DYNAMIC_CRC_TABLE
+ once(&made, make_crc_table);
+#endif /* DYNAMIC_CRC_TABLE */
+ return (const z_crc_t FAR *)crc_table;
+}
+
+/* =========================================================================
+ * Use ARM machine instructions if available. This will compute the CRC about
+ * ten times faster than the braided calculation. This code does not check for
+ * the presence of the CRC instruction at run time. __ARM_FEATURE_CRC32 will
+ * only be defined if the compilation specifies an ARM processor architecture
+ * that has the instructions. For example, compiling with -march=armv8.1-a or
+ * -march=armv8-a+crc, or -march=native if the compile machine has the crc32
+ * instructions.
+ */
+#ifdef ARMCRC32
+
+/*
+ Constants empirically determined to maximize speed. These values are from
+ measurements on a Cortex-A57. Your mileage may vary.
+ */
+#define Z_BATCH 3990 /* number of words in a batch */
+#define Z_BATCH_ZEROS 0xa10d3d0c /* computed from Z_BATCH = 3990 */
+#define Z_BATCH_MIN 800 /* fewest words in a final batch */
+
+unsigned long ZEXPORT crc32_z(
+ unsigned long crc,
+ const unsigned char FAR *buf,
+ z_size_t len)
+{
+ z_crc_t val;
+ z_word_t crc1, crc2;
+ const z_word_t *word;
+ z_word_t val0, val1, val2;
+ z_size_t last, last2, i;
+ z_size_t num;
+
+ /* Return initial CRC, if requested. */
+ if (buf == Z_NULL) return 0;
+
+#ifdef DYNAMIC_CRC_TABLE
+ once(&made, make_crc_table);
+#endif /* DYNAMIC_CRC_TABLE */
+
+ /* Pre-condition the CRC */
+ crc ^= 0xffffffff;
+
+ /* Compute the CRC up to a word boundary. */
+ while (len && ((z_size_t)buf & 7) != 0) {
+ len--;
+ val = *buf++;
+ __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val));
+ }
+
+ /* Prepare to compute the CRC on full 64-bit words word[0..num-1]. */
+ word = (z_word_t const *)buf;
+ num = len >> 3;
+ len &= 7;
+
+ /* Do three interleaved CRCs to realize the throughput of one crc32x
+ instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
+ CRCs are combined into a single CRC after each set of batches. */
+ while (num >= 3 * Z_BATCH) {
+ crc1 = 0;
+ crc2 = 0;
+ for (i = 0; i < Z_BATCH; i++) {
+ val0 = word[i];
+ val1 = word[i + Z_BATCH];
+ val2 = word[i + 2 * Z_BATCH];
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0));
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1));
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2));
+ }
+ word += 3 * Z_BATCH;
+ num -= 3 * Z_BATCH;
+ crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc1;
+ crc = multmodp(Z_BATCH_ZEROS, crc) ^ crc2;
+ }
+
+ /* Do one last smaller batch with the remaining words, if there are enough
+ to pay for the combination of CRCs. */
+ last = num / 3;
+ if (last >= Z_BATCH_MIN) {
+ last2 = last << 1;
+ crc1 = 0;
+ crc2 = 0;
+ for (i = 0; i < last; i++) {
+ val0 = word[i];
+ val1 = word[i + last];
+ val2 = word[i + last2];
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0));
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc1) : "r"(val1));
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc2) : "r"(val2));
+ }
+ word += 3 * last;
+ num -= 3 * last;
+ val = x2nmodp(last, 6);
+ crc = multmodp(val, crc) ^ crc1;
+ crc = multmodp(val, crc) ^ crc2;
+ }
+
+ /* Compute the CRC on any remaining words. */
+ for (i = 0; i < num; i++) {
+ val0 = word[i];
+ __asm__ volatile("crc32x %w0, %w0, %x1" : "+r"(crc) : "r"(val0));
+ }
+ word += num;
+
+ /* Complete the CRC on any remaining bytes. */
+ buf = (const unsigned char FAR *)word;
+ while (len) {
+ len--;
+ val = *buf++;
+ __asm__ volatile("crc32b %w0, %w0, %w1" : "+r"(crc) : "r"(val));
+ }
+
+ /* Return the CRC, post-conditioned. */
+ return crc ^ 0xffffffff;
+}
+
+#else
+
+#ifdef W
+
+/*
+ Return the CRC of the W bytes in the word_t data, taking the
+ least-significant byte of the word as the first byte of data, without any pre
+ or post conditioning. This is used to combine the CRCs of each braid.
+ */
+local z_crc_t crc_word(
+ z_word_t data)
+{
+ int k;
+ for (k = 0; k < W; k++)
+ data = (data >> 8) ^ crc_table[data & 0xff];
+ return (z_crc_t)data;
+}
+
+local z_word_t crc_word_big(
+ z_word_t data)
+{
+ int k;
+ for (k = 0; k < W; k++)
+ data = (data << 8) ^
+ crc_big_table[(data >> ((W - 1) << 3)) & 0xff];
+ return data;
+}
+
+#endif
+
+/* ========================================================================= */
+unsigned long ZEXPORT crc32_z(
+ unsigned long crc,
+ const unsigned char FAR *buf,
+ z_size_t len)
+{
+ /* Return initial CRC, if requested. */
+ if (buf == Z_NULL) return 0;
+
+#ifdef DYNAMIC_CRC_TABLE
+ once(&made, make_crc_table);
+#endif /* DYNAMIC_CRC_TABLE */
+
+ /* Pre-condition the CRC */
+ crc ^= 0xffffffff;
+
+#ifdef W
+
+ /* If provided enough bytes, do a braided CRC calculation. */
+ if (len >= N * W + W - 1) {
+ z_size_t blks;
+ z_word_t const *words;
+ unsigned endian;
+ int k;
+
+ /* Compute the CRC up to a z_word_t boundary. */
+ while (len && ((z_size_t)buf & (W - 1)) != 0) {
+ len--;
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ }
+
+ /* Compute the CRC on as many N z_word_t blocks as are available. */
+ blks = len / (N * W);
+ len -= blks * N * W;
+ words = (z_word_t const *)buf;
+
+ /* Do endian check at execution time instead of compile time, since ARM
+ processors can change the endianess at execution time. If the
+ compiler knows what the endianess will be, it can optimize out the
+ check and the unused branch. */
+ endian = 1;
+ if (*(unsigned char *)&endian) {
+ /* Little endian. */
+
+ z_crc_t crc0;
+ z_word_t word0;
+#if N > 1
+ z_crc_t crc1;
+ z_word_t word1;
+#if N > 2
+ z_crc_t crc2;
+ z_word_t word2;
+#if N > 3
+ z_crc_t crc3;
+ z_word_t word3;
+#if N > 4
+ z_crc_t crc4;
+ z_word_t word4;
+#if N > 5
+ z_crc_t crc5;
+ z_word_t word5;
+#endif
+#endif
+#endif
+#endif
+#endif
+
+ /* Initialize the CRC for each braid. */
+ crc0 = crc;
+#if N > 1
+ crc1 = 0;
+#if N > 2
+ crc2 = 0;
+#if N > 3
+ crc3 = 0;
+#if N > 4
+ crc4 = 0;
+#if N > 5
+ crc5 = 0;
+#endif
+#endif
+#endif
+#endif
+#endif
+
+ /*
+ Process the first blks-1 blocks, computing the CRCs on each braid
+ independently.
+ */
+ while (--blks) {
+ /* Load the word for each braid into registers. */
+ word0 = crc0 ^ words[0];
+#if N > 1
+ word1 = crc1 ^ words[1];
+#if N > 2
+ word2 = crc2 ^ words[2];
+#if N > 3
+ word3 = crc3 ^ words[3];
+#if N > 4
+ word4 = crc4 ^ words[4];
+#if N > 5
+ word5 = crc5 ^ words[5];
+#endif
+#endif
+#endif
+#endif
+#endif
+ words += N;
+
+ /* Compute and update the CRC for each word. The loop should
+ get unrolled. */
+ crc0 = crc_braid_table[0][word0 & 0xff];
+#if N > 1
+ crc1 = crc_braid_table[0][word1 & 0xff];
+#if N > 2
+ crc2 = crc_braid_table[0][word2 & 0xff];
+#if N > 3
+ crc3 = crc_braid_table[0][word3 & 0xff];
+#if N > 4
+ crc4 = crc_braid_table[0][word4 & 0xff];
+#if N > 5
+ crc5 = crc_braid_table[0][word5 & 0xff];
+#endif
+#endif
+#endif
+#endif
+#endif
+ for (k = 1; k < W; k++) {
+ crc0 ^= crc_braid_table[k][(word0 >> (k << 3)) & 0xff];
+#if N > 1
+ crc1 ^= crc_braid_table[k][(word1 >> (k << 3)) & 0xff];
+#if N > 2
+ crc2 ^= crc_braid_table[k][(word2 >> (k << 3)) & 0xff];
+#if N > 3
+ crc3 ^= crc_braid_table[k][(word3 >> (k << 3)) & 0xff];
+#if N > 4
+ crc4 ^= crc_braid_table[k][(word4 >> (k << 3)) & 0xff];
+#if N > 5
+ crc5 ^= crc_braid_table[k][(word5 >> (k << 3)) & 0xff];
+#endif
+#endif
+#endif
+#endif
+#endif
+ }
+ }
+
+ /*
+ Process the last block, combining the CRCs of the N braids at the
+ same time.
+ */
+ crc = crc_word(crc0 ^ words[0]);
+#if N > 1
+ crc = crc_word(crc1 ^ words[1] ^ crc);
+#if N > 2
+ crc = crc_word(crc2 ^ words[2] ^ crc);
+#if N > 3
+ crc = crc_word(crc3 ^ words[3] ^ crc);
+#if N > 4
+ crc = crc_word(crc4 ^ words[4] ^ crc);
+#if N > 5
+ crc = crc_word(crc5 ^ words[5] ^ crc);
+#endif
+#endif
+#endif
+#endif
+#endif
+ words += N;
+ }
+ else {
+ /* Big endian. */
+
+ z_word_t crc0, word0, comb;
+#if N > 1
+ z_word_t crc1, word1;
+#if N > 2
+ z_word_t crc2, word2;
+#if N > 3
+ z_word_t crc3, word3;
+#if N > 4
+ z_word_t crc4, word4;
+#if N > 5
+ z_word_t crc5, word5;
+#endif
+#endif
+#endif
+#endif
+#endif
+
+ /* Initialize the CRC for each braid. */
+ crc0 = byte_swap(crc);
+#if N > 1
+ crc1 = 0;
+#if N > 2
+ crc2 = 0;
+#if N > 3
+ crc3 = 0;
+#if N > 4
+ crc4 = 0;
+#if N > 5
+ crc5 = 0;
+#endif
+#endif
+#endif
+#endif
+#endif
+
+ /*
+ Process the first blks-1 blocks, computing the CRCs on each braid
+ independently.
+ */
+ while (--blks) {
+ /* Load the word for each braid into registers. */
+ word0 = crc0 ^ words[0];
+#if N > 1
+ word1 = crc1 ^ words[1];
+#if N > 2
+ word2 = crc2 ^ words[2];
+#if N > 3
+ word3 = crc3 ^ words[3];
+#if N > 4
+ word4 = crc4 ^ words[4];
+#if N > 5
+ word5 = crc5 ^ words[5];
+#endif
+#endif
+#endif
+#endif
+#endif
+ words += N;
+
+ /* Compute and update the CRC for each word. The loop should
+ get unrolled. */
+ crc0 = crc_braid_big_table[0][word0 & 0xff];
+#if N > 1
+ crc1 = crc_braid_big_table[0][word1 & 0xff];
+#if N > 2
+ crc2 = crc_braid_big_table[0][word2 & 0xff];
+#if N > 3
+ crc3 = crc_braid_big_table[0][word3 & 0xff];
+#if N > 4
+ crc4 = crc_braid_big_table[0][word4 & 0xff];
+#if N > 5
+ crc5 = crc_braid_big_table[0][word5 & 0xff];
+#endif
+#endif
+#endif
+#endif
+#endif
+ for (k = 1; k < W; k++) {
+ crc0 ^= crc_braid_big_table[k][(word0 >> (k << 3)) & 0xff];
+#if N > 1
+ crc1 ^= crc_braid_big_table[k][(word1 >> (k << 3)) & 0xff];
+#if N > 2
+ crc2 ^= crc_braid_big_table[k][(word2 >> (k << 3)) & 0xff];
+#if N > 3
+ crc3 ^= crc_braid_big_table[k][(word3 >> (k << 3)) & 0xff];
+#if N > 4
+ crc4 ^= crc_braid_big_table[k][(word4 >> (k << 3)) & 0xff];
+#if N > 5
+ crc5 ^= crc_braid_big_table[k][(word5 >> (k << 3)) & 0xff];
+#endif
+#endif
+#endif
+#endif
+#endif
+ }
+ }
+
+ /*
+ Process the last block, combining the CRCs of the N braids at the
+ same time.
+ */
+ comb = crc_word_big(crc0 ^ words[0]);
+#if N > 1
+ comb = crc_word_big(crc1 ^ words[1] ^ comb);
+#if N > 2
+ comb = crc_word_big(crc2 ^ words[2] ^ comb);
+#if N > 3
+ comb = crc_word_big(crc3 ^ words[3] ^ comb);
+#if N > 4
+ comb = crc_word_big(crc4 ^ words[4] ^ comb);
+#if N > 5
+ comb = crc_word_big(crc5 ^ words[5] ^ comb);
+#endif
+#endif
+#endif
+#endif
+#endif
+ words += N;
+ crc = byte_swap(comb);
+ }
+
+ /*
+ Update the pointer to the remaining bytes to process.
+ */
+ buf = (unsigned char const *)words;
+ }
+
+#endif /* W */
+
+ /* Complete the computation of the CRC on any remaining bytes. */
+ while (len >= 8) {
+ len -= 8;
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ }
+ while (len) {
+ len--;
+ crc = (crc >> 8) ^ crc_table[(crc ^ *buf++) & 0xff];
+ }
+
+ /* Return the CRC, post-conditioned. */
+ return crc ^ 0xffffffff;
+}
+
+#endif
+
+/* ========================================================================= */
+unsigned long ZEXPORT crc32(
+ unsigned long crc,
+ const unsigned char FAR *buf,
+ uInt len)
+{
+ return crc32_z(crc, buf, len);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine64(
+ uLong crc1,
+ uLong crc2,
+ z_off64_t len2)
+{
+#ifdef DYNAMIC_CRC_TABLE
+ once(&made, make_crc_table);
+#endif /* DYNAMIC_CRC_TABLE */
+ return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine(
+ uLong crc1,
+ uLong crc2,
+ z_off_t len2)
+{
+ return crc32_combine64(crc1, crc2, len2);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine_gen64(
+ z_off64_t len2)
+{
+#ifdef DYNAMIC_CRC_TABLE
+ once(&made, make_crc_table);
+#endif /* DYNAMIC_CRC_TABLE */
+ return x2nmodp(len2, 3);
+}
+
+/* ========================================================================= */
+uLong ZEXPORT crc32_combine_gen(
+ z_off_t len2)
+{
+ return crc32_combine_gen64(len2);
+}
+
+/* ========================================================================= */
+uLong crc32_combine_op(
+ uLong crc1,
+ uLong crc2,
+ uLong op)
+{
+ return multmodp(op, crc1) ^ crc2;
+}
diff --git a/freetype/src/gzip/crc32.h b/freetype/src/gzip/crc32.h
new file mode 100644
index 00000000..137df68d
--- /dev/null
+++ b/freetype/src/gzip/crc32.h
@@ -0,0 +1,9446 @@
+/* crc32.h -- tables for rapid CRC calculation
+ * Generated automatically by crc32.c
+ */
+
+local const z_crc_t FAR crc_table[] = {
+ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
+ 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
+ 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
+ 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
+ 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+ 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
+ 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
+ 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
+ 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
+ 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
+ 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
+ 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
+ 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
+ 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+ 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
+ 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
+ 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
+ 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
+ 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
+ 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
+ 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
+ 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
+ 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+ 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
+ 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
+ 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
+ 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
+ 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
+ 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
+ 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
+ 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
+ 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+ 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
+ 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
+ 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
+ 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
+ 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
+ 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
+ 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
+ 0x2d02ef8d};
+
+#ifdef W
+
+#if W == 8
+
+local const z_word_t FAR crc_big_table[] = {
+ 0x0000000000000000, 0x9630077700000000, 0x2c610eee00000000,
+ 0xba51099900000000, 0x19c46d0700000000, 0x8ff46a7000000000,
+ 0x35a563e900000000, 0xa395649e00000000, 0x3288db0e00000000,
+ 0xa4b8dc7900000000, 0x1ee9d5e000000000, 0x88d9d29700000000,
+ 0x2b4cb60900000000, 0xbd7cb17e00000000, 0x072db8e700000000,
+ 0x911dbf9000000000, 0x6410b71d00000000, 0xf220b06a00000000,
+ 0x4871b9f300000000, 0xde41be8400000000, 0x7dd4da1a00000000,
+ 0xebe4dd6d00000000, 0x51b5d4f400000000, 0xc785d38300000000,
+ 0x56986c1300000000, 0xc0a86b6400000000, 0x7af962fd00000000,
+ 0xecc9658a00000000, 0x4f5c011400000000, 0xd96c066300000000,
+ 0x633d0ffa00000000, 0xf50d088d00000000, 0xc8206e3b00000000,
+ 0x5e10694c00000000, 0xe44160d500000000, 0x727167a200000000,
+ 0xd1e4033c00000000, 0x47d4044b00000000, 0xfd850dd200000000,
+ 0x6bb50aa500000000, 0xfaa8b53500000000, 0x6c98b24200000000,
+ 0xd6c9bbdb00000000, 0x40f9bcac00000000, 0xe36cd83200000000,
+ 0x755cdf4500000000, 0xcf0dd6dc00000000, 0x593dd1ab00000000,
+ 0xac30d92600000000, 0x3a00de5100000000, 0x8051d7c800000000,
+ 0x1661d0bf00000000, 0xb5f4b42100000000, 0x23c4b35600000000,
+ 0x9995bacf00000000, 0x0fa5bdb800000000, 0x9eb8022800000000,
+ 0x0888055f00000000, 0xb2d90cc600000000, 0x24e90bb100000000,
+ 0x877c6f2f00000000, 0x114c685800000000, 0xab1d61c100000000,
+ 0x3d2d66b600000000, 0x9041dc7600000000, 0x0671db0100000000,
+ 0xbc20d29800000000, 0x2a10d5ef00000000, 0x8985b17100000000,
+ 0x1fb5b60600000000, 0xa5e4bf9f00000000, 0x33d4b8e800000000,
+ 0xa2c9077800000000, 0x34f9000f00000000, 0x8ea8099600000000,
+ 0x18980ee100000000, 0xbb0d6a7f00000000, 0x2d3d6d0800000000,
+ 0x976c649100000000, 0x015c63e600000000, 0xf4516b6b00000000,
+ 0x62616c1c00000000, 0xd830658500000000, 0x4e0062f200000000,
+ 0xed95066c00000000, 0x7ba5011b00000000, 0xc1f4088200000000,
+ 0x57c40ff500000000, 0xc6d9b06500000000, 0x50e9b71200000000,
+ 0xeab8be8b00000000, 0x7c88b9fc00000000, 0xdf1ddd6200000000,
+ 0x492dda1500000000, 0xf37cd38c00000000, 0x654cd4fb00000000,
+ 0x5861b24d00000000, 0xce51b53a00000000, 0x7400bca300000000,
+ 0xe230bbd400000000, 0x41a5df4a00000000, 0xd795d83d00000000,
+ 0x6dc4d1a400000000, 0xfbf4d6d300000000, 0x6ae9694300000000,
+ 0xfcd96e3400000000, 0x468867ad00000000, 0xd0b860da00000000,
+ 0x732d044400000000, 0xe51d033300000000, 0x5f4c0aaa00000000,
+ 0xc97c0ddd00000000, 0x3c71055000000000, 0xaa41022700000000,
+ 0x10100bbe00000000, 0x86200cc900000000, 0x25b5685700000000,
+ 0xb3856f2000000000, 0x09d466b900000000, 0x9fe461ce00000000,
+ 0x0ef9de5e00000000, 0x98c9d92900000000, 0x2298d0b000000000,
+ 0xb4a8d7c700000000, 0x173db35900000000, 0x810db42e00000000,
+ 0x3b5cbdb700000000, 0xad6cbac000000000, 0x2083b8ed00000000,
+ 0xb6b3bf9a00000000, 0x0ce2b60300000000, 0x9ad2b17400000000,
+ 0x3947d5ea00000000, 0xaf77d29d00000000, 0x1526db0400000000,
+ 0x8316dc7300000000, 0x120b63e300000000, 0x843b649400000000,
+ 0x3e6a6d0d00000000, 0xa85a6a7a00000000, 0x0bcf0ee400000000,
+ 0x9dff099300000000, 0x27ae000a00000000, 0xb19e077d00000000,
+ 0x44930ff000000000, 0xd2a3088700000000, 0x68f2011e00000000,
+ 0xfec2066900000000, 0x5d5762f700000000, 0xcb67658000000000,
+ 0x71366c1900000000, 0xe7066b6e00000000, 0x761bd4fe00000000,
+ 0xe02bd38900000000, 0x5a7ada1000000000, 0xcc4add6700000000,
+ 0x6fdfb9f900000000, 0xf9efbe8e00000000, 0x43beb71700000000,
+ 0xd58eb06000000000, 0xe8a3d6d600000000, 0x7e93d1a100000000,
+ 0xc4c2d83800000000, 0x52f2df4f00000000, 0xf167bbd100000000,
+ 0x6757bca600000000, 0xdd06b53f00000000, 0x4b36b24800000000,
+ 0xda2b0dd800000000, 0x4c1b0aaf00000000, 0xf64a033600000000,
+ 0x607a044100000000, 0xc3ef60df00000000, 0x55df67a800000000,
+ 0xef8e6e3100000000, 0x79be694600000000, 0x8cb361cb00000000,
+ 0x1a8366bc00000000, 0xa0d26f2500000000, 0x36e2685200000000,
+ 0x95770ccc00000000, 0x03470bbb00000000, 0xb916022200000000,
+ 0x2f26055500000000, 0xbe3bbac500000000, 0x280bbdb200000000,
+ 0x925ab42b00000000, 0x046ab35c00000000, 0xa7ffd7c200000000,
+ 0x31cfd0b500000000, 0x8b9ed92c00000000, 0x1daede5b00000000,
+ 0xb0c2649b00000000, 0x26f263ec00000000, 0x9ca36a7500000000,
+ 0x0a936d0200000000, 0xa906099c00000000, 0x3f360eeb00000000,
+ 0x8567077200000000, 0x1357000500000000, 0x824abf9500000000,
+ 0x147ab8e200000000, 0xae2bb17b00000000, 0x381bb60c00000000,
+ 0x9b8ed29200000000, 0x0dbed5e500000000, 0xb7efdc7c00000000,
+ 0x21dfdb0b00000000, 0xd4d2d38600000000, 0x42e2d4f100000000,
+ 0xf8b3dd6800000000, 0x6e83da1f00000000, 0xcd16be8100000000,
+ 0x5b26b9f600000000, 0xe177b06f00000000, 0x7747b71800000000,
+ 0xe65a088800000000, 0x706a0fff00000000, 0xca3b066600000000,
+ 0x5c0b011100000000, 0xff9e658f00000000, 0x69ae62f800000000,
+ 0xd3ff6b6100000000, 0x45cf6c1600000000, 0x78e20aa000000000,
+ 0xeed20dd700000000, 0x5483044e00000000, 0xc2b3033900000000,
+ 0x612667a700000000, 0xf71660d000000000, 0x4d47694900000000,
+ 0xdb776e3e00000000, 0x4a6ad1ae00000000, 0xdc5ad6d900000000,
+ 0x660bdf4000000000, 0xf03bd83700000000, 0x53aebca900000000,
+ 0xc59ebbde00000000, 0x7fcfb24700000000, 0xe9ffb53000000000,
+ 0x1cf2bdbd00000000, 0x8ac2baca00000000, 0x3093b35300000000,
+ 0xa6a3b42400000000, 0x0536d0ba00000000, 0x9306d7cd00000000,
+ 0x2957de5400000000, 0xbf67d92300000000, 0x2e7a66b300000000,
+ 0xb84a61c400000000, 0x021b685d00000000, 0x942b6f2a00000000,
+ 0x37be0bb400000000, 0xa18e0cc300000000, 0x1bdf055a00000000,
+ 0x8def022d00000000};
+
+#else /* W == 4 */
+
+local const z_word_t FAR crc_big_table[] = {
+ 0x00000000, 0x96300777, 0x2c610eee, 0xba510999, 0x19c46d07,
+ 0x8ff46a70, 0x35a563e9, 0xa395649e, 0x3288db0e, 0xa4b8dc79,
+ 0x1ee9d5e0, 0x88d9d297, 0x2b4cb609, 0xbd7cb17e, 0x072db8e7,
+ 0x911dbf90, 0x6410b71d, 0xf220b06a, 0x4871b9f3, 0xde41be84,
+ 0x7dd4da1a, 0xebe4dd6d, 0x51b5d4f4, 0xc785d383, 0x56986c13,
+ 0xc0a86b64, 0x7af962fd, 0xecc9658a, 0x4f5c0114, 0xd96c0663,
+ 0x633d0ffa, 0xf50d088d, 0xc8206e3b, 0x5e10694c, 0xe44160d5,
+ 0x727167a2, 0xd1e4033c, 0x47d4044b, 0xfd850dd2, 0x6bb50aa5,
+ 0xfaa8b535, 0x6c98b242, 0xd6c9bbdb, 0x40f9bcac, 0xe36cd832,
+ 0x755cdf45, 0xcf0dd6dc, 0x593dd1ab, 0xac30d926, 0x3a00de51,
+ 0x8051d7c8, 0x1661d0bf, 0xb5f4b421, 0x23c4b356, 0x9995bacf,
+ 0x0fa5bdb8, 0x9eb80228, 0x0888055f, 0xb2d90cc6, 0x24e90bb1,
+ 0x877c6f2f, 0x114c6858, 0xab1d61c1, 0x3d2d66b6, 0x9041dc76,
+ 0x0671db01, 0xbc20d298, 0x2a10d5ef, 0x8985b171, 0x1fb5b606,
+ 0xa5e4bf9f, 0x33d4b8e8, 0xa2c90778, 0x34f9000f, 0x8ea80996,
+ 0x18980ee1, 0xbb0d6a7f, 0x2d3d6d08, 0x976c6491, 0x015c63e6,
+ 0xf4516b6b, 0x62616c1c, 0xd8306585, 0x4e0062f2, 0xed95066c,
+ 0x7ba5011b, 0xc1f40882, 0x57c40ff5, 0xc6d9b065, 0x50e9b712,
+ 0xeab8be8b, 0x7c88b9fc, 0xdf1ddd62, 0x492dda15, 0xf37cd38c,
+ 0x654cd4fb, 0x5861b24d, 0xce51b53a, 0x7400bca3, 0xe230bbd4,
+ 0x41a5df4a, 0xd795d83d, 0x6dc4d1a4, 0xfbf4d6d3, 0x6ae96943,
+ 0xfcd96e34, 0x468867ad, 0xd0b860da, 0x732d0444, 0xe51d0333,
+ 0x5f4c0aaa, 0xc97c0ddd, 0x3c710550, 0xaa410227, 0x10100bbe,
+ 0x86200cc9, 0x25b56857, 0xb3856f20, 0x09d466b9, 0x9fe461ce,
+ 0x0ef9de5e, 0x98c9d929, 0x2298d0b0, 0xb4a8d7c7, 0x173db359,
+ 0x810db42e, 0x3b5cbdb7, 0xad6cbac0, 0x2083b8ed, 0xb6b3bf9a,
+ 0x0ce2b603, 0x9ad2b174, 0x3947d5ea, 0xaf77d29d, 0x1526db04,
+ 0x8316dc73, 0x120b63e3, 0x843b6494, 0x3e6a6d0d, 0xa85a6a7a,
+ 0x0bcf0ee4, 0x9dff0993, 0x27ae000a, 0xb19e077d, 0x44930ff0,
+ 0xd2a30887, 0x68f2011e, 0xfec20669, 0x5d5762f7, 0xcb676580,
+ 0x71366c19, 0xe7066b6e, 0x761bd4fe, 0xe02bd389, 0x5a7ada10,
+ 0xcc4add67, 0x6fdfb9f9, 0xf9efbe8e, 0x43beb717, 0xd58eb060,
+ 0xe8a3d6d6, 0x7e93d1a1, 0xc4c2d838, 0x52f2df4f, 0xf167bbd1,
+ 0x6757bca6, 0xdd06b53f, 0x4b36b248, 0xda2b0dd8, 0x4c1b0aaf,
+ 0xf64a0336, 0x607a0441, 0xc3ef60df, 0x55df67a8, 0xef8e6e31,
+ 0x79be6946, 0x8cb361cb, 0x1a8366bc, 0xa0d26f25, 0x36e26852,
+ 0x95770ccc, 0x03470bbb, 0xb9160222, 0x2f260555, 0xbe3bbac5,
+ 0x280bbdb2, 0x925ab42b, 0x046ab35c, 0xa7ffd7c2, 0x31cfd0b5,
+ 0x8b9ed92c, 0x1daede5b, 0xb0c2649b, 0x26f263ec, 0x9ca36a75,
+ 0x0a936d02, 0xa906099c, 0x3f360eeb, 0x85670772, 0x13570005,
+ 0x824abf95, 0x147ab8e2, 0xae2bb17b, 0x381bb60c, 0x9b8ed292,
+ 0x0dbed5e5, 0xb7efdc7c, 0x21dfdb0b, 0xd4d2d386, 0x42e2d4f1,
+ 0xf8b3dd68, 0x6e83da1f, 0xcd16be81, 0x5b26b9f6, 0xe177b06f,
+ 0x7747b718, 0xe65a0888, 0x706a0fff, 0xca3b0666, 0x5c0b0111,
+ 0xff9e658f, 0x69ae62f8, 0xd3ff6b61, 0x45cf6c16, 0x78e20aa0,
+ 0xeed20dd7, 0x5483044e, 0xc2b30339, 0x612667a7, 0xf71660d0,
+ 0x4d476949, 0xdb776e3e, 0x4a6ad1ae, 0xdc5ad6d9, 0x660bdf40,
+ 0xf03bd837, 0x53aebca9, 0xc59ebbde, 0x7fcfb247, 0xe9ffb530,
+ 0x1cf2bdbd, 0x8ac2baca, 0x3093b353, 0xa6a3b424, 0x0536d0ba,
+ 0x9306d7cd, 0x2957de54, 0xbf67d923, 0x2e7a66b3, 0xb84a61c4,
+ 0x021b685d, 0x942b6f2a, 0x37be0bb4, 0xa18e0cc3, 0x1bdf055a,
+ 0x8def022d};
+
+#endif
+
+#if N == 1
+
+#if W == 8
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0xccaa009e, 0x4225077d, 0x8e8f07e3, 0x844a0efa,
+ 0x48e00e64, 0xc66f0987, 0x0ac50919, 0xd3e51bb5, 0x1f4f1b2b,
+ 0x91c01cc8, 0x5d6a1c56, 0x57af154f, 0x9b0515d1, 0x158a1232,
+ 0xd92012ac, 0x7cbb312b, 0xb01131b5, 0x3e9e3656, 0xf23436c8,
+ 0xf8f13fd1, 0x345b3f4f, 0xbad438ac, 0x767e3832, 0xaf5e2a9e,
+ 0x63f42a00, 0xed7b2de3, 0x21d12d7d, 0x2b142464, 0xe7be24fa,
+ 0x69312319, 0xa59b2387, 0xf9766256, 0x35dc62c8, 0xbb53652b,
+ 0x77f965b5, 0x7d3c6cac, 0xb1966c32, 0x3f196bd1, 0xf3b36b4f,
+ 0x2a9379e3, 0xe639797d, 0x68b67e9e, 0xa41c7e00, 0xaed97719,
+ 0x62737787, 0xecfc7064, 0x205670fa, 0x85cd537d, 0x496753e3,
+ 0xc7e85400, 0x0b42549e, 0x01875d87, 0xcd2d5d19, 0x43a25afa,
+ 0x8f085a64, 0x562848c8, 0x9a824856, 0x140d4fb5, 0xd8a74f2b,
+ 0xd2624632, 0x1ec846ac, 0x9047414f, 0x5ced41d1, 0x299dc2ed,
+ 0xe537c273, 0x6bb8c590, 0xa712c50e, 0xadd7cc17, 0x617dcc89,
+ 0xeff2cb6a, 0x2358cbf4, 0xfa78d958, 0x36d2d9c6, 0xb85dde25,
+ 0x74f7debb, 0x7e32d7a2, 0xb298d73c, 0x3c17d0df, 0xf0bdd041,
+ 0x5526f3c6, 0x998cf358, 0x1703f4bb, 0xdba9f425, 0xd16cfd3c,
+ 0x1dc6fda2, 0x9349fa41, 0x5fe3fadf, 0x86c3e873, 0x4a69e8ed,
+ 0xc4e6ef0e, 0x084cef90, 0x0289e689, 0xce23e617, 0x40ace1f4,
+ 0x8c06e16a, 0xd0eba0bb, 0x1c41a025, 0x92cea7c6, 0x5e64a758,
+ 0x54a1ae41, 0x980baedf, 0x1684a93c, 0xda2ea9a2, 0x030ebb0e,
+ 0xcfa4bb90, 0x412bbc73, 0x8d81bced, 0x8744b5f4, 0x4beeb56a,
+ 0xc561b289, 0x09cbb217, 0xac509190, 0x60fa910e, 0xee7596ed,
+ 0x22df9673, 0x281a9f6a, 0xe4b09ff4, 0x6a3f9817, 0xa6959889,
+ 0x7fb58a25, 0xb31f8abb, 0x3d908d58, 0xf13a8dc6, 0xfbff84df,
+ 0x37558441, 0xb9da83a2, 0x7570833c, 0x533b85da, 0x9f918544,
+ 0x111e82a7, 0xddb48239, 0xd7718b20, 0x1bdb8bbe, 0x95548c5d,
+ 0x59fe8cc3, 0x80de9e6f, 0x4c749ef1, 0xc2fb9912, 0x0e51998c,
+ 0x04949095, 0xc83e900b, 0x46b197e8, 0x8a1b9776, 0x2f80b4f1,
+ 0xe32ab46f, 0x6da5b38c, 0xa10fb312, 0xabcaba0b, 0x6760ba95,
+ 0xe9efbd76, 0x2545bde8, 0xfc65af44, 0x30cfafda, 0xbe40a839,
+ 0x72eaa8a7, 0x782fa1be, 0xb485a120, 0x3a0aa6c3, 0xf6a0a65d,
+ 0xaa4de78c, 0x66e7e712, 0xe868e0f1, 0x24c2e06f, 0x2e07e976,
+ 0xe2ade9e8, 0x6c22ee0b, 0xa088ee95, 0x79a8fc39, 0xb502fca7,
+ 0x3b8dfb44, 0xf727fbda, 0xfde2f2c3, 0x3148f25d, 0xbfc7f5be,
+ 0x736df520, 0xd6f6d6a7, 0x1a5cd639, 0x94d3d1da, 0x5879d144,
+ 0x52bcd85d, 0x9e16d8c3, 0x1099df20, 0xdc33dfbe, 0x0513cd12,
+ 0xc9b9cd8c, 0x4736ca6f, 0x8b9ccaf1, 0x8159c3e8, 0x4df3c376,
+ 0xc37cc495, 0x0fd6c40b, 0x7aa64737, 0xb60c47a9, 0x3883404a,
+ 0xf42940d4, 0xfeec49cd, 0x32464953, 0xbcc94eb0, 0x70634e2e,
+ 0xa9435c82, 0x65e95c1c, 0xeb665bff, 0x27cc5b61, 0x2d095278,
+ 0xe1a352e6, 0x6f2c5505, 0xa386559b, 0x061d761c, 0xcab77682,
+ 0x44387161, 0x889271ff, 0x825778e6, 0x4efd7878, 0xc0727f9b,
+ 0x0cd87f05, 0xd5f86da9, 0x19526d37, 0x97dd6ad4, 0x5b776a4a,
+ 0x51b26353, 0x9d1863cd, 0x1397642e, 0xdf3d64b0, 0x83d02561,
+ 0x4f7a25ff, 0xc1f5221c, 0x0d5f2282, 0x079a2b9b, 0xcb302b05,
+ 0x45bf2ce6, 0x89152c78, 0x50353ed4, 0x9c9f3e4a, 0x121039a9,
+ 0xdeba3937, 0xd47f302e, 0x18d530b0, 0x965a3753, 0x5af037cd,
+ 0xff6b144a, 0x33c114d4, 0xbd4e1337, 0x71e413a9, 0x7b211ab0,
+ 0xb78b1a2e, 0x39041dcd, 0xf5ae1d53, 0x2c8e0fff, 0xe0240f61,
+ 0x6eab0882, 0xa201081c, 0xa8c40105, 0x646e019b, 0xeae10678,
+ 0x264b06e6},
+ {0x00000000, 0xa6770bb4, 0x979f1129, 0x31e81a9d, 0xf44f2413,
+ 0x52382fa7, 0x63d0353a, 0xc5a73e8e, 0x33ef4e67, 0x959845d3,
+ 0xa4705f4e, 0x020754fa, 0xc7a06a74, 0x61d761c0, 0x503f7b5d,
+ 0xf64870e9, 0x67de9cce, 0xc1a9977a, 0xf0418de7, 0x56368653,
+ 0x9391b8dd, 0x35e6b369, 0x040ea9f4, 0xa279a240, 0x5431d2a9,
+ 0xf246d91d, 0xc3aec380, 0x65d9c834, 0xa07ef6ba, 0x0609fd0e,
+ 0x37e1e793, 0x9196ec27, 0xcfbd399c, 0x69ca3228, 0x582228b5,
+ 0xfe552301, 0x3bf21d8f, 0x9d85163b, 0xac6d0ca6, 0x0a1a0712,
+ 0xfc5277fb, 0x5a257c4f, 0x6bcd66d2, 0xcdba6d66, 0x081d53e8,
+ 0xae6a585c, 0x9f8242c1, 0x39f54975, 0xa863a552, 0x0e14aee6,
+ 0x3ffcb47b, 0x998bbfcf, 0x5c2c8141, 0xfa5b8af5, 0xcbb39068,
+ 0x6dc49bdc, 0x9b8ceb35, 0x3dfbe081, 0x0c13fa1c, 0xaa64f1a8,
+ 0x6fc3cf26, 0xc9b4c492, 0xf85cde0f, 0x5e2bd5bb, 0x440b7579,
+ 0xe27c7ecd, 0xd3946450, 0x75e36fe4, 0xb044516a, 0x16335ade,
+ 0x27db4043, 0x81ac4bf7, 0x77e43b1e, 0xd19330aa, 0xe07b2a37,
+ 0x460c2183, 0x83ab1f0d, 0x25dc14b9, 0x14340e24, 0xb2430590,
+ 0x23d5e9b7, 0x85a2e203, 0xb44af89e, 0x123df32a, 0xd79acda4,
+ 0x71edc610, 0x4005dc8d, 0xe672d739, 0x103aa7d0, 0xb64dac64,
+ 0x87a5b6f9, 0x21d2bd4d, 0xe47583c3, 0x42028877, 0x73ea92ea,
+ 0xd59d995e, 0x8bb64ce5, 0x2dc14751, 0x1c295dcc, 0xba5e5678,
+ 0x7ff968f6, 0xd98e6342, 0xe86679df, 0x4e11726b, 0xb8590282,
+ 0x1e2e0936, 0x2fc613ab, 0x89b1181f, 0x4c162691, 0xea612d25,
+ 0xdb8937b8, 0x7dfe3c0c, 0xec68d02b, 0x4a1fdb9f, 0x7bf7c102,
+ 0xdd80cab6, 0x1827f438, 0xbe50ff8c, 0x8fb8e511, 0x29cfeea5,
+ 0xdf879e4c, 0x79f095f8, 0x48188f65, 0xee6f84d1, 0x2bc8ba5f,
+ 0x8dbfb1eb, 0xbc57ab76, 0x1a20a0c2, 0x8816eaf2, 0x2e61e146,
+ 0x1f89fbdb, 0xb9fef06f, 0x7c59cee1, 0xda2ec555, 0xebc6dfc8,
+ 0x4db1d47c, 0xbbf9a495, 0x1d8eaf21, 0x2c66b5bc, 0x8a11be08,
+ 0x4fb68086, 0xe9c18b32, 0xd82991af, 0x7e5e9a1b, 0xefc8763c,
+ 0x49bf7d88, 0x78576715, 0xde206ca1, 0x1b87522f, 0xbdf0599b,
+ 0x8c184306, 0x2a6f48b2, 0xdc27385b, 0x7a5033ef, 0x4bb82972,
+ 0xedcf22c6, 0x28681c48, 0x8e1f17fc, 0xbff70d61, 0x198006d5,
+ 0x47abd36e, 0xe1dcd8da, 0xd034c247, 0x7643c9f3, 0xb3e4f77d,
+ 0x1593fcc9, 0x247be654, 0x820cede0, 0x74449d09, 0xd23396bd,
+ 0xe3db8c20, 0x45ac8794, 0x800bb91a, 0x267cb2ae, 0x1794a833,
+ 0xb1e3a387, 0x20754fa0, 0x86024414, 0xb7ea5e89, 0x119d553d,
+ 0xd43a6bb3, 0x724d6007, 0x43a57a9a, 0xe5d2712e, 0x139a01c7,
+ 0xb5ed0a73, 0x840510ee, 0x22721b5a, 0xe7d525d4, 0x41a22e60,
+ 0x704a34fd, 0xd63d3f49, 0xcc1d9f8b, 0x6a6a943f, 0x5b828ea2,
+ 0xfdf58516, 0x3852bb98, 0x9e25b02c, 0xafcdaab1, 0x09baa105,
+ 0xfff2d1ec, 0x5985da58, 0x686dc0c5, 0xce1acb71, 0x0bbdf5ff,
+ 0xadcafe4b, 0x9c22e4d6, 0x3a55ef62, 0xabc30345, 0x0db408f1,
+ 0x3c5c126c, 0x9a2b19d8, 0x5f8c2756, 0xf9fb2ce2, 0xc813367f,
+ 0x6e643dcb, 0x982c4d22, 0x3e5b4696, 0x0fb35c0b, 0xa9c457bf,
+ 0x6c636931, 0xca146285, 0xfbfc7818, 0x5d8b73ac, 0x03a0a617,
+ 0xa5d7ada3, 0x943fb73e, 0x3248bc8a, 0xf7ef8204, 0x519889b0,
+ 0x6070932d, 0xc6079899, 0x304fe870, 0x9638e3c4, 0xa7d0f959,
+ 0x01a7f2ed, 0xc400cc63, 0x6277c7d7, 0x539fdd4a, 0xf5e8d6fe,
+ 0x647e3ad9, 0xc209316d, 0xf3e12bf0, 0x55962044, 0x90311eca,
+ 0x3646157e, 0x07ae0fe3, 0xa1d90457, 0x579174be, 0xf1e67f0a,
+ 0xc00e6597, 0x66796e23, 0xa3de50ad, 0x05a95b19, 0x34414184,
+ 0x92364a30},
+ {0x00000000, 0xcb5cd3a5, 0x4dc8a10b, 0x869472ae, 0x9b914216,
+ 0x50cd91b3, 0xd659e31d, 0x1d0530b8, 0xec53826d, 0x270f51c8,
+ 0xa19b2366, 0x6ac7f0c3, 0x77c2c07b, 0xbc9e13de, 0x3a0a6170,
+ 0xf156b2d5, 0x03d6029b, 0xc88ad13e, 0x4e1ea390, 0x85427035,
+ 0x9847408d, 0x531b9328, 0xd58fe186, 0x1ed33223, 0xef8580f6,
+ 0x24d95353, 0xa24d21fd, 0x6911f258, 0x7414c2e0, 0xbf481145,
+ 0x39dc63eb, 0xf280b04e, 0x07ac0536, 0xccf0d693, 0x4a64a43d,
+ 0x81387798, 0x9c3d4720, 0x57619485, 0xd1f5e62b, 0x1aa9358e,
+ 0xebff875b, 0x20a354fe, 0xa6372650, 0x6d6bf5f5, 0x706ec54d,
+ 0xbb3216e8, 0x3da66446, 0xf6fab7e3, 0x047a07ad, 0xcf26d408,
+ 0x49b2a6a6, 0x82ee7503, 0x9feb45bb, 0x54b7961e, 0xd223e4b0,
+ 0x197f3715, 0xe82985c0, 0x23755665, 0xa5e124cb, 0x6ebdf76e,
+ 0x73b8c7d6, 0xb8e41473, 0x3e7066dd, 0xf52cb578, 0x0f580a6c,
+ 0xc404d9c9, 0x4290ab67, 0x89cc78c2, 0x94c9487a, 0x5f959bdf,
+ 0xd901e971, 0x125d3ad4, 0xe30b8801, 0x28575ba4, 0xaec3290a,
+ 0x659ffaaf, 0x789aca17, 0xb3c619b2, 0x35526b1c, 0xfe0eb8b9,
+ 0x0c8e08f7, 0xc7d2db52, 0x4146a9fc, 0x8a1a7a59, 0x971f4ae1,
+ 0x5c439944, 0xdad7ebea, 0x118b384f, 0xe0dd8a9a, 0x2b81593f,
+ 0xad152b91, 0x6649f834, 0x7b4cc88c, 0xb0101b29, 0x36846987,
+ 0xfdd8ba22, 0x08f40f5a, 0xc3a8dcff, 0x453cae51, 0x8e607df4,
+ 0x93654d4c, 0x58399ee9, 0xdeadec47, 0x15f13fe2, 0xe4a78d37,
+ 0x2ffb5e92, 0xa96f2c3c, 0x6233ff99, 0x7f36cf21, 0xb46a1c84,
+ 0x32fe6e2a, 0xf9a2bd8f, 0x0b220dc1, 0xc07ede64, 0x46eaacca,
+ 0x8db67f6f, 0x90b34fd7, 0x5bef9c72, 0xdd7beedc, 0x16273d79,
+ 0xe7718fac, 0x2c2d5c09, 0xaab92ea7, 0x61e5fd02, 0x7ce0cdba,
+ 0xb7bc1e1f, 0x31286cb1, 0xfa74bf14, 0x1eb014d8, 0xd5ecc77d,
+ 0x5378b5d3, 0x98246676, 0x852156ce, 0x4e7d856b, 0xc8e9f7c5,
+ 0x03b52460, 0xf2e396b5, 0x39bf4510, 0xbf2b37be, 0x7477e41b,
+ 0x6972d4a3, 0xa22e0706, 0x24ba75a8, 0xefe6a60d, 0x1d661643,
+ 0xd63ac5e6, 0x50aeb748, 0x9bf264ed, 0x86f75455, 0x4dab87f0,
+ 0xcb3ff55e, 0x006326fb, 0xf135942e, 0x3a69478b, 0xbcfd3525,
+ 0x77a1e680, 0x6aa4d638, 0xa1f8059d, 0x276c7733, 0xec30a496,
+ 0x191c11ee, 0xd240c24b, 0x54d4b0e5, 0x9f886340, 0x828d53f8,
+ 0x49d1805d, 0xcf45f2f3, 0x04192156, 0xf54f9383, 0x3e134026,
+ 0xb8873288, 0x73dbe12d, 0x6eded195, 0xa5820230, 0x2316709e,
+ 0xe84aa33b, 0x1aca1375, 0xd196c0d0, 0x5702b27e, 0x9c5e61db,
+ 0x815b5163, 0x4a0782c6, 0xcc93f068, 0x07cf23cd, 0xf6999118,
+ 0x3dc542bd, 0xbb513013, 0x700de3b6, 0x6d08d30e, 0xa65400ab,
+ 0x20c07205, 0xeb9ca1a0, 0x11e81eb4, 0xdab4cd11, 0x5c20bfbf,
+ 0x977c6c1a, 0x8a795ca2, 0x41258f07, 0xc7b1fda9, 0x0ced2e0c,
+ 0xfdbb9cd9, 0x36e74f7c, 0xb0733dd2, 0x7b2fee77, 0x662adecf,
+ 0xad760d6a, 0x2be27fc4, 0xe0beac61, 0x123e1c2f, 0xd962cf8a,
+ 0x5ff6bd24, 0x94aa6e81, 0x89af5e39, 0x42f38d9c, 0xc467ff32,
+ 0x0f3b2c97, 0xfe6d9e42, 0x35314de7, 0xb3a53f49, 0x78f9ecec,
+ 0x65fcdc54, 0xaea00ff1, 0x28347d5f, 0xe368aefa, 0x16441b82,
+ 0xdd18c827, 0x5b8cba89, 0x90d0692c, 0x8dd55994, 0x46898a31,
+ 0xc01df89f, 0x0b412b3a, 0xfa1799ef, 0x314b4a4a, 0xb7df38e4,
+ 0x7c83eb41, 0x6186dbf9, 0xaada085c, 0x2c4e7af2, 0xe712a957,
+ 0x15921919, 0xdececabc, 0x585ab812, 0x93066bb7, 0x8e035b0f,
+ 0x455f88aa, 0xc3cbfa04, 0x089729a1, 0xf9c19b74, 0x329d48d1,
+ 0xb4093a7f, 0x7f55e9da, 0x6250d962, 0xa90c0ac7, 0x2f987869,
+ 0xe4c4abcc},
+ {0x00000000, 0x3d6029b0, 0x7ac05360, 0x47a07ad0, 0xf580a6c0,
+ 0xc8e08f70, 0x8f40f5a0, 0xb220dc10, 0x30704bc1, 0x0d106271,
+ 0x4ab018a1, 0x77d03111, 0xc5f0ed01, 0xf890c4b1, 0xbf30be61,
+ 0x825097d1, 0x60e09782, 0x5d80be32, 0x1a20c4e2, 0x2740ed52,
+ 0x95603142, 0xa80018f2, 0xefa06222, 0xd2c04b92, 0x5090dc43,
+ 0x6df0f5f3, 0x2a508f23, 0x1730a693, 0xa5107a83, 0x98705333,
+ 0xdfd029e3, 0xe2b00053, 0xc1c12f04, 0xfca106b4, 0xbb017c64,
+ 0x866155d4, 0x344189c4, 0x0921a074, 0x4e81daa4, 0x73e1f314,
+ 0xf1b164c5, 0xccd14d75, 0x8b7137a5, 0xb6111e15, 0x0431c205,
+ 0x3951ebb5, 0x7ef19165, 0x4391b8d5, 0xa121b886, 0x9c419136,
+ 0xdbe1ebe6, 0xe681c256, 0x54a11e46, 0x69c137f6, 0x2e614d26,
+ 0x13016496, 0x9151f347, 0xac31daf7, 0xeb91a027, 0xd6f18997,
+ 0x64d15587, 0x59b17c37, 0x1e1106e7, 0x23712f57, 0x58f35849,
+ 0x659371f9, 0x22330b29, 0x1f532299, 0xad73fe89, 0x9013d739,
+ 0xd7b3ade9, 0xead38459, 0x68831388, 0x55e33a38, 0x124340e8,
+ 0x2f236958, 0x9d03b548, 0xa0639cf8, 0xe7c3e628, 0xdaa3cf98,
+ 0x3813cfcb, 0x0573e67b, 0x42d39cab, 0x7fb3b51b, 0xcd93690b,
+ 0xf0f340bb, 0xb7533a6b, 0x8a3313db, 0x0863840a, 0x3503adba,
+ 0x72a3d76a, 0x4fc3feda, 0xfde322ca, 0xc0830b7a, 0x872371aa,
+ 0xba43581a, 0x9932774d, 0xa4525efd, 0xe3f2242d, 0xde920d9d,
+ 0x6cb2d18d, 0x51d2f83d, 0x167282ed, 0x2b12ab5d, 0xa9423c8c,
+ 0x9422153c, 0xd3826fec, 0xeee2465c, 0x5cc29a4c, 0x61a2b3fc,
+ 0x2602c92c, 0x1b62e09c, 0xf9d2e0cf, 0xc4b2c97f, 0x8312b3af,
+ 0xbe729a1f, 0x0c52460f, 0x31326fbf, 0x7692156f, 0x4bf23cdf,
+ 0xc9a2ab0e, 0xf4c282be, 0xb362f86e, 0x8e02d1de, 0x3c220dce,
+ 0x0142247e, 0x46e25eae, 0x7b82771e, 0xb1e6b092, 0x8c869922,
+ 0xcb26e3f2, 0xf646ca42, 0x44661652, 0x79063fe2, 0x3ea64532,
+ 0x03c66c82, 0x8196fb53, 0xbcf6d2e3, 0xfb56a833, 0xc6368183,
+ 0x74165d93, 0x49767423, 0x0ed60ef3, 0x33b62743, 0xd1062710,
+ 0xec660ea0, 0xabc67470, 0x96a65dc0, 0x248681d0, 0x19e6a860,
+ 0x5e46d2b0, 0x6326fb00, 0xe1766cd1, 0xdc164561, 0x9bb63fb1,
+ 0xa6d61601, 0x14f6ca11, 0x2996e3a1, 0x6e369971, 0x5356b0c1,
+ 0x70279f96, 0x4d47b626, 0x0ae7ccf6, 0x3787e546, 0x85a73956,
+ 0xb8c710e6, 0xff676a36, 0xc2074386, 0x4057d457, 0x7d37fde7,
+ 0x3a978737, 0x07f7ae87, 0xb5d77297, 0x88b75b27, 0xcf1721f7,
+ 0xf2770847, 0x10c70814, 0x2da721a4, 0x6a075b74, 0x576772c4,
+ 0xe547aed4, 0xd8278764, 0x9f87fdb4, 0xa2e7d404, 0x20b743d5,
+ 0x1dd76a65, 0x5a7710b5, 0x67173905, 0xd537e515, 0xe857cca5,
+ 0xaff7b675, 0x92979fc5, 0xe915e8db, 0xd475c16b, 0x93d5bbbb,
+ 0xaeb5920b, 0x1c954e1b, 0x21f567ab, 0x66551d7b, 0x5b3534cb,
+ 0xd965a31a, 0xe4058aaa, 0xa3a5f07a, 0x9ec5d9ca, 0x2ce505da,
+ 0x11852c6a, 0x562556ba, 0x6b457f0a, 0x89f57f59, 0xb49556e9,
+ 0xf3352c39, 0xce550589, 0x7c75d999, 0x4115f029, 0x06b58af9,
+ 0x3bd5a349, 0xb9853498, 0x84e51d28, 0xc34567f8, 0xfe254e48,
+ 0x4c059258, 0x7165bbe8, 0x36c5c138, 0x0ba5e888, 0x28d4c7df,
+ 0x15b4ee6f, 0x521494bf, 0x6f74bd0f, 0xdd54611f, 0xe03448af,
+ 0xa794327f, 0x9af41bcf, 0x18a48c1e, 0x25c4a5ae, 0x6264df7e,
+ 0x5f04f6ce, 0xed242ade, 0xd044036e, 0x97e479be, 0xaa84500e,
+ 0x4834505d, 0x755479ed, 0x32f4033d, 0x0f942a8d, 0xbdb4f69d,
+ 0x80d4df2d, 0xc774a5fd, 0xfa148c4d, 0x78441b9c, 0x4524322c,
+ 0x028448fc, 0x3fe4614c, 0x8dc4bd5c, 0xb0a494ec, 0xf704ee3c,
+ 0xca64c78c},
+ {0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, 0x8f629757,
+ 0x37def032, 0x256b5fdc, 0x9dd738b9, 0xc5b428ef, 0x7d084f8a,
+ 0x6fbde064, 0xd7018701, 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733,
+ 0x58631056, 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871,
+ 0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, 0x95ad7f70,
+ 0x2d111815, 0x3fa4b7fb, 0x8718d09e, 0x1acfe827, 0xa2738f42,
+ 0xb0c620ac, 0x087a47c9, 0xa032af3e, 0x188ec85b, 0x0a3b67b5,
+ 0xb28700d0, 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787,
+ 0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, 0xeae41086,
+ 0x525877e3, 0x40edd80d, 0xf851bf68, 0xf02bf8a1, 0x48979fc4,
+ 0x5a22302a, 0xe29e574f, 0x7f496ff6, 0xc7f50893, 0xd540a77d,
+ 0x6dfcc018, 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0,
+ 0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, 0x9b14583d,
+ 0x23a83f58, 0x311d90b6, 0x89a1f7d3, 0x1476cf6a, 0xaccaa80f,
+ 0xbe7f07e1, 0x06c36084, 0x5ea070d2, 0xe61c17b7, 0xf4a9b859,
+ 0x4c15df3c, 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b,
+ 0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, 0x446f98f5,
+ 0xfcd3ff90, 0xee66507e, 0x56da371b, 0x0eb9274d, 0xb6054028,
+ 0xa4b0efc6, 0x1c0c88a3, 0x81dbb01a, 0x3967d77f, 0x2bd27891,
+ 0x936e1ff4, 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed,
+ 0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, 0xfe92dfec,
+ 0x462eb889, 0x549b1767, 0xec277002, 0x71f048bb, 0xc94c2fde,
+ 0xdbf98030, 0x6345e755, 0x6b3fa09c, 0xd383c7f9, 0xc1366817,
+ 0x798a0f72, 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825,
+ 0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, 0x21e91f24,
+ 0x99557841, 0x8be0d7af, 0x335cb0ca, 0xed59b63b, 0x55e5d15e,
+ 0x47507eb0, 0xffec19d5, 0x623b216c, 0xda874609, 0xc832e9e7,
+ 0x708e8e82, 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a,
+ 0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, 0xbd40e1a4,
+ 0x05fc86c1, 0x1749292f, 0xaff54e4a, 0x322276f3, 0x8a9e1196,
+ 0x982bbe78, 0x2097d91d, 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0,
+ 0x6a4166a5, 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2,
+ 0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, 0xc2098e52,
+ 0x7ab5e937, 0x680046d9, 0xd0bc21bc, 0x88df31ea, 0x3063568f,
+ 0x22d6f961, 0x9a6a9e04, 0x07bda6bd, 0xbf01c1d8, 0xadb46e36,
+ 0x15080953, 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174,
+ 0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, 0xd8c66675,
+ 0x607a0110, 0x72cfaefe, 0xca73c99b, 0x57a4f122, 0xef189647,
+ 0xfdad39a9, 0x45115ecc, 0x764dee06, 0xcef18963, 0xdc44268d,
+ 0x64f841e8, 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf,
+ 0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, 0x3c9b51be,
+ 0x842736db, 0x96929935, 0x2e2efe50, 0x2654b999, 0x9ee8defc,
+ 0x8c5d7112, 0x34e11677, 0xa9362ece, 0x118a49ab, 0x033fe645,
+ 0xbb838120, 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98,
+ 0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, 0xd67f4138,
+ 0x6ec3265d, 0x7c7689b3, 0xc4caeed6, 0x591dd66f, 0xe1a1b10a,
+ 0xf3141ee4, 0x4ba87981, 0x13cb69d7, 0xab770eb2, 0xb9c2a15c,
+ 0x017ec639, 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e,
+ 0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, 0x090481f0,
+ 0xb1b8e695, 0xa30d497b, 0x1bb12e1e, 0x43d23e48, 0xfb6e592d,
+ 0xe9dbf6c3, 0x516791a6, 0xccb0a91f, 0x740cce7a, 0x66b96194,
+ 0xde0506f1},
+ {0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, 0x0709a8dc,
+ 0x06cbc2eb, 0x048d7cb2, 0x054f1685, 0x0e1351b8, 0x0fd13b8f,
+ 0x0d9785d6, 0x0c55efe1, 0x091af964, 0x08d89353, 0x0a9e2d0a,
+ 0x0b5c473d, 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29,
+ 0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, 0x1235f2c8,
+ 0x13f798ff, 0x11b126a6, 0x10734c91, 0x153c5a14, 0x14fe3023,
+ 0x16b88e7a, 0x177ae44d, 0x384d46e0, 0x398f2cd7, 0x3bc9928e,
+ 0x3a0bf8b9, 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065,
+ 0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, 0x3157bf84,
+ 0x3095d5b3, 0x32d36bea, 0x331101dd, 0x246be590, 0x25a98fa7,
+ 0x27ef31fe, 0x262d5bc9, 0x23624d4c, 0x22a0277b, 0x20e69922,
+ 0x2124f315, 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71,
+ 0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, 0x709a8dc0,
+ 0x7158e7f7, 0x731e59ae, 0x72dc3399, 0x7793251c, 0x76514f2b,
+ 0x7417f172, 0x75d59b45, 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816,
+ 0x7ccf6221, 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd,
+ 0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, 0x6bb5866c,
+ 0x6a77ec5b, 0x68315202, 0x69f33835, 0x62af7f08, 0x636d153f,
+ 0x612bab66, 0x60e9c151, 0x65a6d7d4, 0x6464bde3, 0x662203ba,
+ 0x67e0698d, 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579,
+ 0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, 0x46c49a98,
+ 0x4706f0af, 0x45404ef6, 0x448224c1, 0x41cd3244, 0x400f5873,
+ 0x4249e62a, 0x438b8c1d, 0x54f16850, 0x55330267, 0x5775bc3e,
+ 0x56b7d609, 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5,
+ 0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, 0x5deb9134,
+ 0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, 0xe1351b80, 0xe0f771b7,
+ 0xe2b1cfee, 0xe373a5d9, 0xe63cb35c, 0xe7fed96b, 0xe5b86732,
+ 0xe47a0d05, 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461,
+ 0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, 0xfd13b8f0,
+ 0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, 0xfa1a102c, 0xfbd87a1b,
+ 0xf99ec442, 0xf85cae75, 0xf300e948, 0xf2c2837f, 0xf0843d26,
+ 0xf1465711, 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd,
+ 0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, 0xde71f5bc,
+ 0xdfb39f8b, 0xddf521d2, 0xdc374be5, 0xd76b0cd8, 0xd6a966ef,
+ 0xd4efd8b6, 0xd52db281, 0xd062a404, 0xd1a0ce33, 0xd3e6706a,
+ 0xd2241a5d, 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049,
+ 0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, 0xcb4dafa8,
+ 0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, 0xcc440774, 0xcd866d43,
+ 0xcfc0d31a, 0xce02b92d, 0x91af9640, 0x906dfc77, 0x922b422e,
+ 0x93e92819, 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5,
+ 0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, 0x98b56f24,
+ 0x99770513, 0x9b31bb4a, 0x9af3d17d, 0x8d893530, 0x8c4b5f07,
+ 0x8e0de15e, 0x8fcf8b69, 0x8a809dec, 0x8b42f7db, 0x89044982,
+ 0x88c623b5, 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1,
+ 0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, 0xa9e2d0a0,
+ 0xa820ba97, 0xaa6604ce, 0xaba46ef9, 0xaeeb787c, 0xaf29124b,
+ 0xad6fac12, 0xacadc625, 0xa7f18118, 0xa633eb2f, 0xa4755576,
+ 0xa5b73f41, 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d,
+ 0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, 0xb2cddb0c,
+ 0xb30fb13b, 0xb1490f62, 0xb08b6555, 0xbbd72268, 0xba15485f,
+ 0xb853f606, 0xb9919c31, 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda,
+ 0xbe9834ed},
+ {0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, 0x646cc504,
+ 0x7d77f445, 0x565aa786, 0x4f4196c7, 0xc8d98a08, 0xd1c2bb49,
+ 0xfaefe88a, 0xe3f4d9cb, 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e,
+ 0x87981ccf, 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192,
+ 0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, 0x821b9859,
+ 0x9b00a918, 0xb02dfadb, 0xa936cb9a, 0xe6775d5d, 0xff6c6c1c,
+ 0xd4413fdf, 0xcd5a0e9e, 0x958424a2, 0x8c9f15e3, 0xa7b24620,
+ 0xbea97761, 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265,
+ 0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, 0x39316bae,
+ 0x202a5aef, 0x0b07092c, 0x121c386d, 0xdf4636f3, 0xc65d07b2,
+ 0xed705471, 0xf46b6530, 0xbb2af3f7, 0xa231c2b6, 0x891c9175,
+ 0x9007a034, 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38,
+ 0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, 0xf0794f05,
+ 0xe9627e44, 0xc24f2d87, 0xdb541cc6, 0x94158a01, 0x8d0ebb40,
+ 0xa623e883, 0xbf38d9c2, 0x38a0c50d, 0x21bbf44c, 0x0a96a78f,
+ 0x138d96ce, 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca,
+ 0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, 0xded79850,
+ 0xc7cca911, 0xece1fad2, 0xf5facb93, 0x7262d75c, 0x6b79e61d,
+ 0x4054b5de, 0x594f849f, 0x160e1258, 0x0f152319, 0x243870da,
+ 0x3d23419b, 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864,
+ 0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, 0xad24e1af,
+ 0xb43fd0ee, 0x9f12832d, 0x8609b26c, 0xc94824ab, 0xd05315ea,
+ 0xfb7e4629, 0xe2657768, 0x2f3f79f6, 0x362448b7, 0x1d091b74,
+ 0x04122a35, 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31,
+ 0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, 0x838a36fa,
+ 0x9a9107bb, 0xb1bc5478, 0xa8a76539, 0x3b83984b, 0x2298a90a,
+ 0x09b5fac9, 0x10aecb88, 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd,
+ 0x74c20e8c, 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180,
+ 0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, 0x71418a1a,
+ 0x685abb5b, 0x4377e898, 0x5a6cd9d9, 0x152d4f1e, 0x0c367e5f,
+ 0x271b2d9c, 0x3e001cdd, 0xb9980012, 0xa0833153, 0x8bae6290,
+ 0x92b553d1, 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5,
+ 0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, 0xca6b79ed,
+ 0xd37048ac, 0xf85d1b6f, 0xe1462a2e, 0x66de36e1, 0x7fc507a0,
+ 0x54e85463, 0x4df36522, 0x02b2f3e5, 0x1ba9c2a4, 0x30849167,
+ 0x299fa026, 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b,
+ 0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, 0x2c1c24b0,
+ 0x350715f1, 0x1e2a4632, 0x07317773, 0x4870e1b4, 0x516bd0f5,
+ 0x7a468336, 0x635db277, 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc,
+ 0xe0d7848d, 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189,
+ 0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, 0x674f9842,
+ 0x7e54a903, 0x5579fac0, 0x4c62cb81, 0x8138c51f, 0x9823f45e,
+ 0xb30ea79d, 0xaa1596dc, 0xe554001b, 0xfc4f315a, 0xd7626299,
+ 0xce7953d8, 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4,
+ 0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, 0x5e7ef3ec,
+ 0x4765c2ad, 0x6c48916e, 0x7553a02f, 0x3a1236e8, 0x230907a9,
+ 0x0824546a, 0x113f652b, 0x96a779e4, 0x8fbc48a5, 0xa4911b66,
+ 0xbd8a2a27, 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23,
+ 0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, 0x70d024b9,
+ 0x69cb15f8, 0x42e6463b, 0x5bfd777a, 0xdc656bb5, 0xc57e5af4,
+ 0xee530937, 0xf7483876, 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33,
+ 0x9324fd72},
+ {0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
+ 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
+ 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
+ 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
+ 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+ 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
+ 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
+ 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
+ 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
+ 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
+ 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
+ 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
+ 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
+ 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+ 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
+ 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
+ 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
+ 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
+ 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
+ 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
+ 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
+ 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
+ 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+ 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
+ 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
+ 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
+ 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
+ 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
+ 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
+ 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
+ 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
+ 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+ 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
+ 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
+ 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
+ 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
+ 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
+ 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
+ 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
+ 0x2d02ef8d}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x0000000000000000, 0x9630077700000000, 0x2c610eee00000000,
+ 0xba51099900000000, 0x19c46d0700000000, 0x8ff46a7000000000,
+ 0x35a563e900000000, 0xa395649e00000000, 0x3288db0e00000000,
+ 0xa4b8dc7900000000, 0x1ee9d5e000000000, 0x88d9d29700000000,
+ 0x2b4cb60900000000, 0xbd7cb17e00000000, 0x072db8e700000000,
+ 0x911dbf9000000000, 0x6410b71d00000000, 0xf220b06a00000000,
+ 0x4871b9f300000000, 0xde41be8400000000, 0x7dd4da1a00000000,
+ 0xebe4dd6d00000000, 0x51b5d4f400000000, 0xc785d38300000000,
+ 0x56986c1300000000, 0xc0a86b6400000000, 0x7af962fd00000000,
+ 0xecc9658a00000000, 0x4f5c011400000000, 0xd96c066300000000,
+ 0x633d0ffa00000000, 0xf50d088d00000000, 0xc8206e3b00000000,
+ 0x5e10694c00000000, 0xe44160d500000000, 0x727167a200000000,
+ 0xd1e4033c00000000, 0x47d4044b00000000, 0xfd850dd200000000,
+ 0x6bb50aa500000000, 0xfaa8b53500000000, 0x6c98b24200000000,
+ 0xd6c9bbdb00000000, 0x40f9bcac00000000, 0xe36cd83200000000,
+ 0x755cdf4500000000, 0xcf0dd6dc00000000, 0x593dd1ab00000000,
+ 0xac30d92600000000, 0x3a00de5100000000, 0x8051d7c800000000,
+ 0x1661d0bf00000000, 0xb5f4b42100000000, 0x23c4b35600000000,
+ 0x9995bacf00000000, 0x0fa5bdb800000000, 0x9eb8022800000000,
+ 0x0888055f00000000, 0xb2d90cc600000000, 0x24e90bb100000000,
+ 0x877c6f2f00000000, 0x114c685800000000, 0xab1d61c100000000,
+ 0x3d2d66b600000000, 0x9041dc7600000000, 0x0671db0100000000,
+ 0xbc20d29800000000, 0x2a10d5ef00000000, 0x8985b17100000000,
+ 0x1fb5b60600000000, 0xa5e4bf9f00000000, 0x33d4b8e800000000,
+ 0xa2c9077800000000, 0x34f9000f00000000, 0x8ea8099600000000,
+ 0x18980ee100000000, 0xbb0d6a7f00000000, 0x2d3d6d0800000000,
+ 0x976c649100000000, 0x015c63e600000000, 0xf4516b6b00000000,
+ 0x62616c1c00000000, 0xd830658500000000, 0x4e0062f200000000,
+ 0xed95066c00000000, 0x7ba5011b00000000, 0xc1f4088200000000,
+ 0x57c40ff500000000, 0xc6d9b06500000000, 0x50e9b71200000000,
+ 0xeab8be8b00000000, 0x7c88b9fc00000000, 0xdf1ddd6200000000,
+ 0x492dda1500000000, 0xf37cd38c00000000, 0x654cd4fb00000000,
+ 0x5861b24d00000000, 0xce51b53a00000000, 0x7400bca300000000,
+ 0xe230bbd400000000, 0x41a5df4a00000000, 0xd795d83d00000000,
+ 0x6dc4d1a400000000, 0xfbf4d6d300000000, 0x6ae9694300000000,
+ 0xfcd96e3400000000, 0x468867ad00000000, 0xd0b860da00000000,
+ 0x732d044400000000, 0xe51d033300000000, 0x5f4c0aaa00000000,
+ 0xc97c0ddd00000000, 0x3c71055000000000, 0xaa41022700000000,
+ 0x10100bbe00000000, 0x86200cc900000000, 0x25b5685700000000,
+ 0xb3856f2000000000, 0x09d466b900000000, 0x9fe461ce00000000,
+ 0x0ef9de5e00000000, 0x98c9d92900000000, 0x2298d0b000000000,
+ 0xb4a8d7c700000000, 0x173db35900000000, 0x810db42e00000000,
+ 0x3b5cbdb700000000, 0xad6cbac000000000, 0x2083b8ed00000000,
+ 0xb6b3bf9a00000000, 0x0ce2b60300000000, 0x9ad2b17400000000,
+ 0x3947d5ea00000000, 0xaf77d29d00000000, 0x1526db0400000000,
+ 0x8316dc7300000000, 0x120b63e300000000, 0x843b649400000000,
+ 0x3e6a6d0d00000000, 0xa85a6a7a00000000, 0x0bcf0ee400000000,
+ 0x9dff099300000000, 0x27ae000a00000000, 0xb19e077d00000000,
+ 0x44930ff000000000, 0xd2a3088700000000, 0x68f2011e00000000,
+ 0xfec2066900000000, 0x5d5762f700000000, 0xcb67658000000000,
+ 0x71366c1900000000, 0xe7066b6e00000000, 0x761bd4fe00000000,
+ 0xe02bd38900000000, 0x5a7ada1000000000, 0xcc4add6700000000,
+ 0x6fdfb9f900000000, 0xf9efbe8e00000000, 0x43beb71700000000,
+ 0xd58eb06000000000, 0xe8a3d6d600000000, 0x7e93d1a100000000,
+ 0xc4c2d83800000000, 0x52f2df4f00000000, 0xf167bbd100000000,
+ 0x6757bca600000000, 0xdd06b53f00000000, 0x4b36b24800000000,
+ 0xda2b0dd800000000, 0x4c1b0aaf00000000, 0xf64a033600000000,
+ 0x607a044100000000, 0xc3ef60df00000000, 0x55df67a800000000,
+ 0xef8e6e3100000000, 0x79be694600000000, 0x8cb361cb00000000,
+ 0x1a8366bc00000000, 0xa0d26f2500000000, 0x36e2685200000000,
+ 0x95770ccc00000000, 0x03470bbb00000000, 0xb916022200000000,
+ 0x2f26055500000000, 0xbe3bbac500000000, 0x280bbdb200000000,
+ 0x925ab42b00000000, 0x046ab35c00000000, 0xa7ffd7c200000000,
+ 0x31cfd0b500000000, 0x8b9ed92c00000000, 0x1daede5b00000000,
+ 0xb0c2649b00000000, 0x26f263ec00000000, 0x9ca36a7500000000,
+ 0x0a936d0200000000, 0xa906099c00000000, 0x3f360eeb00000000,
+ 0x8567077200000000, 0x1357000500000000, 0x824abf9500000000,
+ 0x147ab8e200000000, 0xae2bb17b00000000, 0x381bb60c00000000,
+ 0x9b8ed29200000000, 0x0dbed5e500000000, 0xb7efdc7c00000000,
+ 0x21dfdb0b00000000, 0xd4d2d38600000000, 0x42e2d4f100000000,
+ 0xf8b3dd6800000000, 0x6e83da1f00000000, 0xcd16be8100000000,
+ 0x5b26b9f600000000, 0xe177b06f00000000, 0x7747b71800000000,
+ 0xe65a088800000000, 0x706a0fff00000000, 0xca3b066600000000,
+ 0x5c0b011100000000, 0xff9e658f00000000, 0x69ae62f800000000,
+ 0xd3ff6b6100000000, 0x45cf6c1600000000, 0x78e20aa000000000,
+ 0xeed20dd700000000, 0x5483044e00000000, 0xc2b3033900000000,
+ 0x612667a700000000, 0xf71660d000000000, 0x4d47694900000000,
+ 0xdb776e3e00000000, 0x4a6ad1ae00000000, 0xdc5ad6d900000000,
+ 0x660bdf4000000000, 0xf03bd83700000000, 0x53aebca900000000,
+ 0xc59ebbde00000000, 0x7fcfb24700000000, 0xe9ffb53000000000,
+ 0x1cf2bdbd00000000, 0x8ac2baca00000000, 0x3093b35300000000,
+ 0xa6a3b42400000000, 0x0536d0ba00000000, 0x9306d7cd00000000,
+ 0x2957de5400000000, 0xbf67d92300000000, 0x2e7a66b300000000,
+ 0xb84a61c400000000, 0x021b685d00000000, 0x942b6f2a00000000,
+ 0x37be0bb400000000, 0xa18e0cc300000000, 0x1bdf055a00000000,
+ 0x8def022d00000000},
+ {0x0000000000000000, 0x41311b1900000000, 0x8262363200000000,
+ 0xc3532d2b00000000, 0x04c56c6400000000, 0x45f4777d00000000,
+ 0x86a75a5600000000, 0xc796414f00000000, 0x088ad9c800000000,
+ 0x49bbc2d100000000, 0x8ae8effa00000000, 0xcbd9f4e300000000,
+ 0x0c4fb5ac00000000, 0x4d7eaeb500000000, 0x8e2d839e00000000,
+ 0xcf1c988700000000, 0x5112c24a00000000, 0x1023d95300000000,
+ 0xd370f47800000000, 0x9241ef6100000000, 0x55d7ae2e00000000,
+ 0x14e6b53700000000, 0xd7b5981c00000000, 0x9684830500000000,
+ 0x59981b8200000000, 0x18a9009b00000000, 0xdbfa2db000000000,
+ 0x9acb36a900000000, 0x5d5d77e600000000, 0x1c6c6cff00000000,
+ 0xdf3f41d400000000, 0x9e0e5acd00000000, 0xa224849500000000,
+ 0xe3159f8c00000000, 0x2046b2a700000000, 0x6177a9be00000000,
+ 0xa6e1e8f100000000, 0xe7d0f3e800000000, 0x2483dec300000000,
+ 0x65b2c5da00000000, 0xaaae5d5d00000000, 0xeb9f464400000000,
+ 0x28cc6b6f00000000, 0x69fd707600000000, 0xae6b313900000000,
+ 0xef5a2a2000000000, 0x2c09070b00000000, 0x6d381c1200000000,
+ 0xf33646df00000000, 0xb2075dc600000000, 0x715470ed00000000,
+ 0x30656bf400000000, 0xf7f32abb00000000, 0xb6c231a200000000,
+ 0x75911c8900000000, 0x34a0079000000000, 0xfbbc9f1700000000,
+ 0xba8d840e00000000, 0x79dea92500000000, 0x38efb23c00000000,
+ 0xff79f37300000000, 0xbe48e86a00000000, 0x7d1bc54100000000,
+ 0x3c2ade5800000000, 0x054f79f000000000, 0x447e62e900000000,
+ 0x872d4fc200000000, 0xc61c54db00000000, 0x018a159400000000,
+ 0x40bb0e8d00000000, 0x83e823a600000000, 0xc2d938bf00000000,
+ 0x0dc5a03800000000, 0x4cf4bb2100000000, 0x8fa7960a00000000,
+ 0xce968d1300000000, 0x0900cc5c00000000, 0x4831d74500000000,
+ 0x8b62fa6e00000000, 0xca53e17700000000, 0x545dbbba00000000,
+ 0x156ca0a300000000, 0xd63f8d8800000000, 0x970e969100000000,
+ 0x5098d7de00000000, 0x11a9ccc700000000, 0xd2fae1ec00000000,
+ 0x93cbfaf500000000, 0x5cd7627200000000, 0x1de6796b00000000,
+ 0xdeb5544000000000, 0x9f844f5900000000, 0x58120e1600000000,
+ 0x1923150f00000000, 0xda70382400000000, 0x9b41233d00000000,
+ 0xa76bfd6500000000, 0xe65ae67c00000000, 0x2509cb5700000000,
+ 0x6438d04e00000000, 0xa3ae910100000000, 0xe29f8a1800000000,
+ 0x21cca73300000000, 0x60fdbc2a00000000, 0xafe124ad00000000,
+ 0xeed03fb400000000, 0x2d83129f00000000, 0x6cb2098600000000,
+ 0xab2448c900000000, 0xea1553d000000000, 0x29467efb00000000,
+ 0x687765e200000000, 0xf6793f2f00000000, 0xb748243600000000,
+ 0x741b091d00000000, 0x352a120400000000, 0xf2bc534b00000000,
+ 0xb38d485200000000, 0x70de657900000000, 0x31ef7e6000000000,
+ 0xfef3e6e700000000, 0xbfc2fdfe00000000, 0x7c91d0d500000000,
+ 0x3da0cbcc00000000, 0xfa368a8300000000, 0xbb07919a00000000,
+ 0x7854bcb100000000, 0x3965a7a800000000, 0x4b98833b00000000,
+ 0x0aa9982200000000, 0xc9fab50900000000, 0x88cbae1000000000,
+ 0x4f5def5f00000000, 0x0e6cf44600000000, 0xcd3fd96d00000000,
+ 0x8c0ec27400000000, 0x43125af300000000, 0x022341ea00000000,
+ 0xc1706cc100000000, 0x804177d800000000, 0x47d7369700000000,
+ 0x06e62d8e00000000, 0xc5b500a500000000, 0x84841bbc00000000,
+ 0x1a8a417100000000, 0x5bbb5a6800000000, 0x98e8774300000000,
+ 0xd9d96c5a00000000, 0x1e4f2d1500000000, 0x5f7e360c00000000,
+ 0x9c2d1b2700000000, 0xdd1c003e00000000, 0x120098b900000000,
+ 0x533183a000000000, 0x9062ae8b00000000, 0xd153b59200000000,
+ 0x16c5f4dd00000000, 0x57f4efc400000000, 0x94a7c2ef00000000,
+ 0xd596d9f600000000, 0xe9bc07ae00000000, 0xa88d1cb700000000,
+ 0x6bde319c00000000, 0x2aef2a8500000000, 0xed796bca00000000,
+ 0xac4870d300000000, 0x6f1b5df800000000, 0x2e2a46e100000000,
+ 0xe136de6600000000, 0xa007c57f00000000, 0x6354e85400000000,
+ 0x2265f34d00000000, 0xe5f3b20200000000, 0xa4c2a91b00000000,
+ 0x6791843000000000, 0x26a09f2900000000, 0xb8aec5e400000000,
+ 0xf99fdefd00000000, 0x3accf3d600000000, 0x7bfde8cf00000000,
+ 0xbc6ba98000000000, 0xfd5ab29900000000, 0x3e099fb200000000,
+ 0x7f3884ab00000000, 0xb0241c2c00000000, 0xf115073500000000,
+ 0x32462a1e00000000, 0x7377310700000000, 0xb4e1704800000000,
+ 0xf5d06b5100000000, 0x3683467a00000000, 0x77b25d6300000000,
+ 0x4ed7facb00000000, 0x0fe6e1d200000000, 0xccb5ccf900000000,
+ 0x8d84d7e000000000, 0x4a1296af00000000, 0x0b238db600000000,
+ 0xc870a09d00000000, 0x8941bb8400000000, 0x465d230300000000,
+ 0x076c381a00000000, 0xc43f153100000000, 0x850e0e2800000000,
+ 0x42984f6700000000, 0x03a9547e00000000, 0xc0fa795500000000,
+ 0x81cb624c00000000, 0x1fc5388100000000, 0x5ef4239800000000,
+ 0x9da70eb300000000, 0xdc9615aa00000000, 0x1b0054e500000000,
+ 0x5a314ffc00000000, 0x996262d700000000, 0xd85379ce00000000,
+ 0x174fe14900000000, 0x567efa5000000000, 0x952dd77b00000000,
+ 0xd41ccc6200000000, 0x138a8d2d00000000, 0x52bb963400000000,
+ 0x91e8bb1f00000000, 0xd0d9a00600000000, 0xecf37e5e00000000,
+ 0xadc2654700000000, 0x6e91486c00000000, 0x2fa0537500000000,
+ 0xe836123a00000000, 0xa907092300000000, 0x6a54240800000000,
+ 0x2b653f1100000000, 0xe479a79600000000, 0xa548bc8f00000000,
+ 0x661b91a400000000, 0x272a8abd00000000, 0xe0bccbf200000000,
+ 0xa18dd0eb00000000, 0x62defdc000000000, 0x23efe6d900000000,
+ 0xbde1bc1400000000, 0xfcd0a70d00000000, 0x3f838a2600000000,
+ 0x7eb2913f00000000, 0xb924d07000000000, 0xf815cb6900000000,
+ 0x3b46e64200000000, 0x7a77fd5b00000000, 0xb56b65dc00000000,
+ 0xf45a7ec500000000, 0x370953ee00000000, 0x763848f700000000,
+ 0xb1ae09b800000000, 0xf09f12a100000000, 0x33cc3f8a00000000,
+ 0x72fd249300000000},
+ {0x0000000000000000, 0x376ac20100000000, 0x6ed4840300000000,
+ 0x59be460200000000, 0xdca8090700000000, 0xebc2cb0600000000,
+ 0xb27c8d0400000000, 0x85164f0500000000, 0xb851130e00000000,
+ 0x8f3bd10f00000000, 0xd685970d00000000, 0xe1ef550c00000000,
+ 0x64f91a0900000000, 0x5393d80800000000, 0x0a2d9e0a00000000,
+ 0x3d475c0b00000000, 0x70a3261c00000000, 0x47c9e41d00000000,
+ 0x1e77a21f00000000, 0x291d601e00000000, 0xac0b2f1b00000000,
+ 0x9b61ed1a00000000, 0xc2dfab1800000000, 0xf5b5691900000000,
+ 0xc8f2351200000000, 0xff98f71300000000, 0xa626b11100000000,
+ 0x914c731000000000, 0x145a3c1500000000, 0x2330fe1400000000,
+ 0x7a8eb81600000000, 0x4de47a1700000000, 0xe0464d3800000000,
+ 0xd72c8f3900000000, 0x8e92c93b00000000, 0xb9f80b3a00000000,
+ 0x3cee443f00000000, 0x0b84863e00000000, 0x523ac03c00000000,
+ 0x6550023d00000000, 0x58175e3600000000, 0x6f7d9c3700000000,
+ 0x36c3da3500000000, 0x01a9183400000000, 0x84bf573100000000,
+ 0xb3d5953000000000, 0xea6bd33200000000, 0xdd01113300000000,
+ 0x90e56b2400000000, 0xa78fa92500000000, 0xfe31ef2700000000,
+ 0xc95b2d2600000000, 0x4c4d622300000000, 0x7b27a02200000000,
+ 0x2299e62000000000, 0x15f3242100000000, 0x28b4782a00000000,
+ 0x1fdeba2b00000000, 0x4660fc2900000000, 0x710a3e2800000000,
+ 0xf41c712d00000000, 0xc376b32c00000000, 0x9ac8f52e00000000,
+ 0xada2372f00000000, 0xc08d9a7000000000, 0xf7e7587100000000,
+ 0xae591e7300000000, 0x9933dc7200000000, 0x1c25937700000000,
+ 0x2b4f517600000000, 0x72f1177400000000, 0x459bd57500000000,
+ 0x78dc897e00000000, 0x4fb64b7f00000000, 0x16080d7d00000000,
+ 0x2162cf7c00000000, 0xa474807900000000, 0x931e427800000000,
+ 0xcaa0047a00000000, 0xfdcac67b00000000, 0xb02ebc6c00000000,
+ 0x87447e6d00000000, 0xdefa386f00000000, 0xe990fa6e00000000,
+ 0x6c86b56b00000000, 0x5bec776a00000000, 0x0252316800000000,
+ 0x3538f36900000000, 0x087faf6200000000, 0x3f156d6300000000,
+ 0x66ab2b6100000000, 0x51c1e96000000000, 0xd4d7a66500000000,
+ 0xe3bd646400000000, 0xba03226600000000, 0x8d69e06700000000,
+ 0x20cbd74800000000, 0x17a1154900000000, 0x4e1f534b00000000,
+ 0x7975914a00000000, 0xfc63de4f00000000, 0xcb091c4e00000000,
+ 0x92b75a4c00000000, 0xa5dd984d00000000, 0x989ac44600000000,
+ 0xaff0064700000000, 0xf64e404500000000, 0xc124824400000000,
+ 0x4432cd4100000000, 0x73580f4000000000, 0x2ae6494200000000,
+ 0x1d8c8b4300000000, 0x5068f15400000000, 0x6702335500000000,
+ 0x3ebc755700000000, 0x09d6b75600000000, 0x8cc0f85300000000,
+ 0xbbaa3a5200000000, 0xe2147c5000000000, 0xd57ebe5100000000,
+ 0xe839e25a00000000, 0xdf53205b00000000, 0x86ed665900000000,
+ 0xb187a45800000000, 0x3491eb5d00000000, 0x03fb295c00000000,
+ 0x5a456f5e00000000, 0x6d2fad5f00000000, 0x801b35e100000000,
+ 0xb771f7e000000000, 0xeecfb1e200000000, 0xd9a573e300000000,
+ 0x5cb33ce600000000, 0x6bd9fee700000000, 0x3267b8e500000000,
+ 0x050d7ae400000000, 0x384a26ef00000000, 0x0f20e4ee00000000,
+ 0x569ea2ec00000000, 0x61f460ed00000000, 0xe4e22fe800000000,
+ 0xd388ede900000000, 0x8a36abeb00000000, 0xbd5c69ea00000000,
+ 0xf0b813fd00000000, 0xc7d2d1fc00000000, 0x9e6c97fe00000000,
+ 0xa90655ff00000000, 0x2c101afa00000000, 0x1b7ad8fb00000000,
+ 0x42c49ef900000000, 0x75ae5cf800000000, 0x48e900f300000000,
+ 0x7f83c2f200000000, 0x263d84f000000000, 0x115746f100000000,
+ 0x944109f400000000, 0xa32bcbf500000000, 0xfa958df700000000,
+ 0xcdff4ff600000000, 0x605d78d900000000, 0x5737bad800000000,
+ 0x0e89fcda00000000, 0x39e33edb00000000, 0xbcf571de00000000,
+ 0x8b9fb3df00000000, 0xd221f5dd00000000, 0xe54b37dc00000000,
+ 0xd80c6bd700000000, 0xef66a9d600000000, 0xb6d8efd400000000,
+ 0x81b22dd500000000, 0x04a462d000000000, 0x33cea0d100000000,
+ 0x6a70e6d300000000, 0x5d1a24d200000000, 0x10fe5ec500000000,
+ 0x27949cc400000000, 0x7e2adac600000000, 0x494018c700000000,
+ 0xcc5657c200000000, 0xfb3c95c300000000, 0xa282d3c100000000,
+ 0x95e811c000000000, 0xa8af4dcb00000000, 0x9fc58fca00000000,
+ 0xc67bc9c800000000, 0xf1110bc900000000, 0x740744cc00000000,
+ 0x436d86cd00000000, 0x1ad3c0cf00000000, 0x2db902ce00000000,
+ 0x4096af9100000000, 0x77fc6d9000000000, 0x2e422b9200000000,
+ 0x1928e99300000000, 0x9c3ea69600000000, 0xab54649700000000,
+ 0xf2ea229500000000, 0xc580e09400000000, 0xf8c7bc9f00000000,
+ 0xcfad7e9e00000000, 0x9613389c00000000, 0xa179fa9d00000000,
+ 0x246fb59800000000, 0x1305779900000000, 0x4abb319b00000000,
+ 0x7dd1f39a00000000, 0x3035898d00000000, 0x075f4b8c00000000,
+ 0x5ee10d8e00000000, 0x698bcf8f00000000, 0xec9d808a00000000,
+ 0xdbf7428b00000000, 0x8249048900000000, 0xb523c68800000000,
+ 0x88649a8300000000, 0xbf0e588200000000, 0xe6b01e8000000000,
+ 0xd1dadc8100000000, 0x54cc938400000000, 0x63a6518500000000,
+ 0x3a18178700000000, 0x0d72d58600000000, 0xa0d0e2a900000000,
+ 0x97ba20a800000000, 0xce0466aa00000000, 0xf96ea4ab00000000,
+ 0x7c78ebae00000000, 0x4b1229af00000000, 0x12ac6fad00000000,
+ 0x25c6adac00000000, 0x1881f1a700000000, 0x2feb33a600000000,
+ 0x765575a400000000, 0x413fb7a500000000, 0xc429f8a000000000,
+ 0xf3433aa100000000, 0xaafd7ca300000000, 0x9d97bea200000000,
+ 0xd073c4b500000000, 0xe71906b400000000, 0xbea740b600000000,
+ 0x89cd82b700000000, 0x0cdbcdb200000000, 0x3bb10fb300000000,
+ 0x620f49b100000000, 0x55658bb000000000, 0x6822d7bb00000000,
+ 0x5f4815ba00000000, 0x06f653b800000000, 0x319c91b900000000,
+ 0xb48adebc00000000, 0x83e01cbd00000000, 0xda5e5abf00000000,
+ 0xed3498be00000000},
+ {0x0000000000000000, 0x6567bcb800000000, 0x8bc809aa00000000,
+ 0xeeafb51200000000, 0x5797628f00000000, 0x32f0de3700000000,
+ 0xdc5f6b2500000000, 0xb938d79d00000000, 0xef28b4c500000000,
+ 0x8a4f087d00000000, 0x64e0bd6f00000000, 0x018701d700000000,
+ 0xb8bfd64a00000000, 0xddd86af200000000, 0x3377dfe000000000,
+ 0x5610635800000000, 0x9f57195000000000, 0xfa30a5e800000000,
+ 0x149f10fa00000000, 0x71f8ac4200000000, 0xc8c07bdf00000000,
+ 0xada7c76700000000, 0x4308727500000000, 0x266fcecd00000000,
+ 0x707fad9500000000, 0x1518112d00000000, 0xfbb7a43f00000000,
+ 0x9ed0188700000000, 0x27e8cf1a00000000, 0x428f73a200000000,
+ 0xac20c6b000000000, 0xc9477a0800000000, 0x3eaf32a000000000,
+ 0x5bc88e1800000000, 0xb5673b0a00000000, 0xd00087b200000000,
+ 0x6938502f00000000, 0x0c5fec9700000000, 0xe2f0598500000000,
+ 0x8797e53d00000000, 0xd187866500000000, 0xb4e03add00000000,
+ 0x5a4f8fcf00000000, 0x3f28337700000000, 0x8610e4ea00000000,
+ 0xe377585200000000, 0x0dd8ed4000000000, 0x68bf51f800000000,
+ 0xa1f82bf000000000, 0xc49f974800000000, 0x2a30225a00000000,
+ 0x4f579ee200000000, 0xf66f497f00000000, 0x9308f5c700000000,
+ 0x7da740d500000000, 0x18c0fc6d00000000, 0x4ed09f3500000000,
+ 0x2bb7238d00000000, 0xc518969f00000000, 0xa07f2a2700000000,
+ 0x1947fdba00000000, 0x7c20410200000000, 0x928ff41000000000,
+ 0xf7e848a800000000, 0x3d58149b00000000, 0x583fa82300000000,
+ 0xb6901d3100000000, 0xd3f7a18900000000, 0x6acf761400000000,
+ 0x0fa8caac00000000, 0xe1077fbe00000000, 0x8460c30600000000,
+ 0xd270a05e00000000, 0xb7171ce600000000, 0x59b8a9f400000000,
+ 0x3cdf154c00000000, 0x85e7c2d100000000, 0xe0807e6900000000,
+ 0x0e2fcb7b00000000, 0x6b4877c300000000, 0xa20f0dcb00000000,
+ 0xc768b17300000000, 0x29c7046100000000, 0x4ca0b8d900000000,
+ 0xf5986f4400000000, 0x90ffd3fc00000000, 0x7e5066ee00000000,
+ 0x1b37da5600000000, 0x4d27b90e00000000, 0x284005b600000000,
+ 0xc6efb0a400000000, 0xa3880c1c00000000, 0x1ab0db8100000000,
+ 0x7fd7673900000000, 0x9178d22b00000000, 0xf41f6e9300000000,
+ 0x03f7263b00000000, 0x66909a8300000000, 0x883f2f9100000000,
+ 0xed58932900000000, 0x546044b400000000, 0x3107f80c00000000,
+ 0xdfa84d1e00000000, 0xbacff1a600000000, 0xecdf92fe00000000,
+ 0x89b82e4600000000, 0x67179b5400000000, 0x027027ec00000000,
+ 0xbb48f07100000000, 0xde2f4cc900000000, 0x3080f9db00000000,
+ 0x55e7456300000000, 0x9ca03f6b00000000, 0xf9c783d300000000,
+ 0x176836c100000000, 0x720f8a7900000000, 0xcb375de400000000,
+ 0xae50e15c00000000, 0x40ff544e00000000, 0x2598e8f600000000,
+ 0x73888bae00000000, 0x16ef371600000000, 0xf840820400000000,
+ 0x9d273ebc00000000, 0x241fe92100000000, 0x4178559900000000,
+ 0xafd7e08b00000000, 0xcab05c3300000000, 0x3bb659ed00000000,
+ 0x5ed1e55500000000, 0xb07e504700000000, 0xd519ecff00000000,
+ 0x6c213b6200000000, 0x094687da00000000, 0xe7e932c800000000,
+ 0x828e8e7000000000, 0xd49eed2800000000, 0xb1f9519000000000,
+ 0x5f56e48200000000, 0x3a31583a00000000, 0x83098fa700000000,
+ 0xe66e331f00000000, 0x08c1860d00000000, 0x6da63ab500000000,
+ 0xa4e140bd00000000, 0xc186fc0500000000, 0x2f29491700000000,
+ 0x4a4ef5af00000000, 0xf376223200000000, 0x96119e8a00000000,
+ 0x78be2b9800000000, 0x1dd9972000000000, 0x4bc9f47800000000,
+ 0x2eae48c000000000, 0xc001fdd200000000, 0xa566416a00000000,
+ 0x1c5e96f700000000, 0x79392a4f00000000, 0x97969f5d00000000,
+ 0xf2f123e500000000, 0x05196b4d00000000, 0x607ed7f500000000,
+ 0x8ed162e700000000, 0xebb6de5f00000000, 0x528e09c200000000,
+ 0x37e9b57a00000000, 0xd946006800000000, 0xbc21bcd000000000,
+ 0xea31df8800000000, 0x8f56633000000000, 0x61f9d62200000000,
+ 0x049e6a9a00000000, 0xbda6bd0700000000, 0xd8c101bf00000000,
+ 0x366eb4ad00000000, 0x5309081500000000, 0x9a4e721d00000000,
+ 0xff29cea500000000, 0x11867bb700000000, 0x74e1c70f00000000,
+ 0xcdd9109200000000, 0xa8beac2a00000000, 0x4611193800000000,
+ 0x2376a58000000000, 0x7566c6d800000000, 0x10017a6000000000,
+ 0xfeaecf7200000000, 0x9bc973ca00000000, 0x22f1a45700000000,
+ 0x479618ef00000000, 0xa939adfd00000000, 0xcc5e114500000000,
+ 0x06ee4d7600000000, 0x6389f1ce00000000, 0x8d2644dc00000000,
+ 0xe841f86400000000, 0x51792ff900000000, 0x341e934100000000,
+ 0xdab1265300000000, 0xbfd69aeb00000000, 0xe9c6f9b300000000,
+ 0x8ca1450b00000000, 0x620ef01900000000, 0x07694ca100000000,
+ 0xbe519b3c00000000, 0xdb36278400000000, 0x3599929600000000,
+ 0x50fe2e2e00000000, 0x99b9542600000000, 0xfcdee89e00000000,
+ 0x12715d8c00000000, 0x7716e13400000000, 0xce2e36a900000000,
+ 0xab498a1100000000, 0x45e63f0300000000, 0x208183bb00000000,
+ 0x7691e0e300000000, 0x13f65c5b00000000, 0xfd59e94900000000,
+ 0x983e55f100000000, 0x2106826c00000000, 0x44613ed400000000,
+ 0xaace8bc600000000, 0xcfa9377e00000000, 0x38417fd600000000,
+ 0x5d26c36e00000000, 0xb389767c00000000, 0xd6eecac400000000,
+ 0x6fd61d5900000000, 0x0ab1a1e100000000, 0xe41e14f300000000,
+ 0x8179a84b00000000, 0xd769cb1300000000, 0xb20e77ab00000000,
+ 0x5ca1c2b900000000, 0x39c67e0100000000, 0x80fea99c00000000,
+ 0xe599152400000000, 0x0b36a03600000000, 0x6e511c8e00000000,
+ 0xa716668600000000, 0xc271da3e00000000, 0x2cde6f2c00000000,
+ 0x49b9d39400000000, 0xf081040900000000, 0x95e6b8b100000000,
+ 0x7b490da300000000, 0x1e2eb11b00000000, 0x483ed24300000000,
+ 0x2d596efb00000000, 0xc3f6dbe900000000, 0xa691675100000000,
+ 0x1fa9b0cc00000000, 0x7ace0c7400000000, 0x9461b96600000000,
+ 0xf10605de00000000},
+ {0x0000000000000000, 0xb029603d00000000, 0x6053c07a00000000,
+ 0xd07aa04700000000, 0xc0a680f500000000, 0x708fe0c800000000,
+ 0xa0f5408f00000000, 0x10dc20b200000000, 0xc14b703000000000,
+ 0x7162100d00000000, 0xa118b04a00000000, 0x1131d07700000000,
+ 0x01edf0c500000000, 0xb1c490f800000000, 0x61be30bf00000000,
+ 0xd197508200000000, 0x8297e06000000000, 0x32be805d00000000,
+ 0xe2c4201a00000000, 0x52ed402700000000, 0x4231609500000000,
+ 0xf21800a800000000, 0x2262a0ef00000000, 0x924bc0d200000000,
+ 0x43dc905000000000, 0xf3f5f06d00000000, 0x238f502a00000000,
+ 0x93a6301700000000, 0x837a10a500000000, 0x3353709800000000,
+ 0xe329d0df00000000, 0x5300b0e200000000, 0x042fc1c100000000,
+ 0xb406a1fc00000000, 0x647c01bb00000000, 0xd455618600000000,
+ 0xc489413400000000, 0x74a0210900000000, 0xa4da814e00000000,
+ 0x14f3e17300000000, 0xc564b1f100000000, 0x754dd1cc00000000,
+ 0xa537718b00000000, 0x151e11b600000000, 0x05c2310400000000,
+ 0xb5eb513900000000, 0x6591f17e00000000, 0xd5b8914300000000,
+ 0x86b821a100000000, 0x3691419c00000000, 0xe6ebe1db00000000,
+ 0x56c281e600000000, 0x461ea15400000000, 0xf637c16900000000,
+ 0x264d612e00000000, 0x9664011300000000, 0x47f3519100000000,
+ 0xf7da31ac00000000, 0x27a091eb00000000, 0x9789f1d600000000,
+ 0x8755d16400000000, 0x377cb15900000000, 0xe706111e00000000,
+ 0x572f712300000000, 0x4958f35800000000, 0xf971936500000000,
+ 0x290b332200000000, 0x9922531f00000000, 0x89fe73ad00000000,
+ 0x39d7139000000000, 0xe9adb3d700000000, 0x5984d3ea00000000,
+ 0x8813836800000000, 0x383ae35500000000, 0xe840431200000000,
+ 0x5869232f00000000, 0x48b5039d00000000, 0xf89c63a000000000,
+ 0x28e6c3e700000000, 0x98cfa3da00000000, 0xcbcf133800000000,
+ 0x7be6730500000000, 0xab9cd34200000000, 0x1bb5b37f00000000,
+ 0x0b6993cd00000000, 0xbb40f3f000000000, 0x6b3a53b700000000,
+ 0xdb13338a00000000, 0x0a84630800000000, 0xbaad033500000000,
+ 0x6ad7a37200000000, 0xdafec34f00000000, 0xca22e3fd00000000,
+ 0x7a0b83c000000000, 0xaa71238700000000, 0x1a5843ba00000000,
+ 0x4d77329900000000, 0xfd5e52a400000000, 0x2d24f2e300000000,
+ 0x9d0d92de00000000, 0x8dd1b26c00000000, 0x3df8d25100000000,
+ 0xed82721600000000, 0x5dab122b00000000, 0x8c3c42a900000000,
+ 0x3c15229400000000, 0xec6f82d300000000, 0x5c46e2ee00000000,
+ 0x4c9ac25c00000000, 0xfcb3a26100000000, 0x2cc9022600000000,
+ 0x9ce0621b00000000, 0xcfe0d2f900000000, 0x7fc9b2c400000000,
+ 0xafb3128300000000, 0x1f9a72be00000000, 0x0f46520c00000000,
+ 0xbf6f323100000000, 0x6f15927600000000, 0xdf3cf24b00000000,
+ 0x0eaba2c900000000, 0xbe82c2f400000000, 0x6ef862b300000000,
+ 0xded1028e00000000, 0xce0d223c00000000, 0x7e24420100000000,
+ 0xae5ee24600000000, 0x1e77827b00000000, 0x92b0e6b100000000,
+ 0x2299868c00000000, 0xf2e326cb00000000, 0x42ca46f600000000,
+ 0x5216664400000000, 0xe23f067900000000, 0x3245a63e00000000,
+ 0x826cc60300000000, 0x53fb968100000000, 0xe3d2f6bc00000000,
+ 0x33a856fb00000000, 0x838136c600000000, 0x935d167400000000,
+ 0x2374764900000000, 0xf30ed60e00000000, 0x4327b63300000000,
+ 0x102706d100000000, 0xa00e66ec00000000, 0x7074c6ab00000000,
+ 0xc05da69600000000, 0xd081862400000000, 0x60a8e61900000000,
+ 0xb0d2465e00000000, 0x00fb266300000000, 0xd16c76e100000000,
+ 0x614516dc00000000, 0xb13fb69b00000000, 0x0116d6a600000000,
+ 0x11caf61400000000, 0xa1e3962900000000, 0x7199366e00000000,
+ 0xc1b0565300000000, 0x969f277000000000, 0x26b6474d00000000,
+ 0xf6cce70a00000000, 0x46e5873700000000, 0x5639a78500000000,
+ 0xe610c7b800000000, 0x366a67ff00000000, 0x864307c200000000,
+ 0x57d4574000000000, 0xe7fd377d00000000, 0x3787973a00000000,
+ 0x87aef70700000000, 0x9772d7b500000000, 0x275bb78800000000,
+ 0xf72117cf00000000, 0x470877f200000000, 0x1408c71000000000,
+ 0xa421a72d00000000, 0x745b076a00000000, 0xc472675700000000,
+ 0xd4ae47e500000000, 0x648727d800000000, 0xb4fd879f00000000,
+ 0x04d4e7a200000000, 0xd543b72000000000, 0x656ad71d00000000,
+ 0xb510775a00000000, 0x0539176700000000, 0x15e537d500000000,
+ 0xa5cc57e800000000, 0x75b6f7af00000000, 0xc59f979200000000,
+ 0xdbe815e900000000, 0x6bc175d400000000, 0xbbbbd59300000000,
+ 0x0b92b5ae00000000, 0x1b4e951c00000000, 0xab67f52100000000,
+ 0x7b1d556600000000, 0xcb34355b00000000, 0x1aa365d900000000,
+ 0xaa8a05e400000000, 0x7af0a5a300000000, 0xcad9c59e00000000,
+ 0xda05e52c00000000, 0x6a2c851100000000, 0xba56255600000000,
+ 0x0a7f456b00000000, 0x597ff58900000000, 0xe95695b400000000,
+ 0x392c35f300000000, 0x890555ce00000000, 0x99d9757c00000000,
+ 0x29f0154100000000, 0xf98ab50600000000, 0x49a3d53b00000000,
+ 0x983485b900000000, 0x281de58400000000, 0xf86745c300000000,
+ 0x484e25fe00000000, 0x5892054c00000000, 0xe8bb657100000000,
+ 0x38c1c53600000000, 0x88e8a50b00000000, 0xdfc7d42800000000,
+ 0x6feeb41500000000, 0xbf94145200000000, 0x0fbd746f00000000,
+ 0x1f6154dd00000000, 0xaf4834e000000000, 0x7f3294a700000000,
+ 0xcf1bf49a00000000, 0x1e8ca41800000000, 0xaea5c42500000000,
+ 0x7edf646200000000, 0xcef6045f00000000, 0xde2a24ed00000000,
+ 0x6e0344d000000000, 0xbe79e49700000000, 0x0e5084aa00000000,
+ 0x5d50344800000000, 0xed79547500000000, 0x3d03f43200000000,
+ 0x8d2a940f00000000, 0x9df6b4bd00000000, 0x2ddfd48000000000,
+ 0xfda574c700000000, 0x4d8c14fa00000000, 0x9c1b447800000000,
+ 0x2c32244500000000, 0xfc48840200000000, 0x4c61e43f00000000,
+ 0x5cbdc48d00000000, 0xec94a4b000000000, 0x3cee04f700000000,
+ 0x8cc764ca00000000},
+ {0x0000000000000000, 0xa5d35ccb00000000, 0x0ba1c84d00000000,
+ 0xae72948600000000, 0x1642919b00000000, 0xb391cd5000000000,
+ 0x1de359d600000000, 0xb830051d00000000, 0x6d8253ec00000000,
+ 0xc8510f2700000000, 0x66239ba100000000, 0xc3f0c76a00000000,
+ 0x7bc0c27700000000, 0xde139ebc00000000, 0x70610a3a00000000,
+ 0xd5b256f100000000, 0x9b02d60300000000, 0x3ed18ac800000000,
+ 0x90a31e4e00000000, 0x3570428500000000, 0x8d40479800000000,
+ 0x28931b5300000000, 0x86e18fd500000000, 0x2332d31e00000000,
+ 0xf68085ef00000000, 0x5353d92400000000, 0xfd214da200000000,
+ 0x58f2116900000000, 0xe0c2147400000000, 0x451148bf00000000,
+ 0xeb63dc3900000000, 0x4eb080f200000000, 0x3605ac0700000000,
+ 0x93d6f0cc00000000, 0x3da4644a00000000, 0x9877388100000000,
+ 0x20473d9c00000000, 0x8594615700000000, 0x2be6f5d100000000,
+ 0x8e35a91a00000000, 0x5b87ffeb00000000, 0xfe54a32000000000,
+ 0x502637a600000000, 0xf5f56b6d00000000, 0x4dc56e7000000000,
+ 0xe81632bb00000000, 0x4664a63d00000000, 0xe3b7faf600000000,
+ 0xad077a0400000000, 0x08d426cf00000000, 0xa6a6b24900000000,
+ 0x0375ee8200000000, 0xbb45eb9f00000000, 0x1e96b75400000000,
+ 0xb0e423d200000000, 0x15377f1900000000, 0xc08529e800000000,
+ 0x6556752300000000, 0xcb24e1a500000000, 0x6ef7bd6e00000000,
+ 0xd6c7b87300000000, 0x7314e4b800000000, 0xdd66703e00000000,
+ 0x78b52cf500000000, 0x6c0a580f00000000, 0xc9d904c400000000,
+ 0x67ab904200000000, 0xc278cc8900000000, 0x7a48c99400000000,
+ 0xdf9b955f00000000, 0x71e901d900000000, 0xd43a5d1200000000,
+ 0x01880be300000000, 0xa45b572800000000, 0x0a29c3ae00000000,
+ 0xaffa9f6500000000, 0x17ca9a7800000000, 0xb219c6b300000000,
+ 0x1c6b523500000000, 0xb9b80efe00000000, 0xf7088e0c00000000,
+ 0x52dbd2c700000000, 0xfca9464100000000, 0x597a1a8a00000000,
+ 0xe14a1f9700000000, 0x4499435c00000000, 0xeaebd7da00000000,
+ 0x4f388b1100000000, 0x9a8adde000000000, 0x3f59812b00000000,
+ 0x912b15ad00000000, 0x34f8496600000000, 0x8cc84c7b00000000,
+ 0x291b10b000000000, 0x8769843600000000, 0x22bad8fd00000000,
+ 0x5a0ff40800000000, 0xffdca8c300000000, 0x51ae3c4500000000,
+ 0xf47d608e00000000, 0x4c4d659300000000, 0xe99e395800000000,
+ 0x47ecadde00000000, 0xe23ff11500000000, 0x378da7e400000000,
+ 0x925efb2f00000000, 0x3c2c6fa900000000, 0x99ff336200000000,
+ 0x21cf367f00000000, 0x841c6ab400000000, 0x2a6efe3200000000,
+ 0x8fbda2f900000000, 0xc10d220b00000000, 0x64de7ec000000000,
+ 0xcaacea4600000000, 0x6f7fb68d00000000, 0xd74fb39000000000,
+ 0x729cef5b00000000, 0xdcee7bdd00000000, 0x793d271600000000,
+ 0xac8f71e700000000, 0x095c2d2c00000000, 0xa72eb9aa00000000,
+ 0x02fde56100000000, 0xbacde07c00000000, 0x1f1ebcb700000000,
+ 0xb16c283100000000, 0x14bf74fa00000000, 0xd814b01e00000000,
+ 0x7dc7ecd500000000, 0xd3b5785300000000, 0x7666249800000000,
+ 0xce56218500000000, 0x6b857d4e00000000, 0xc5f7e9c800000000,
+ 0x6024b50300000000, 0xb596e3f200000000, 0x1045bf3900000000,
+ 0xbe372bbf00000000, 0x1be4777400000000, 0xa3d4726900000000,
+ 0x06072ea200000000, 0xa875ba2400000000, 0x0da6e6ef00000000,
+ 0x4316661d00000000, 0xe6c53ad600000000, 0x48b7ae5000000000,
+ 0xed64f29b00000000, 0x5554f78600000000, 0xf087ab4d00000000,
+ 0x5ef53fcb00000000, 0xfb26630000000000, 0x2e9435f100000000,
+ 0x8b47693a00000000, 0x2535fdbc00000000, 0x80e6a17700000000,
+ 0x38d6a46a00000000, 0x9d05f8a100000000, 0x33776c2700000000,
+ 0x96a430ec00000000, 0xee111c1900000000, 0x4bc240d200000000,
+ 0xe5b0d45400000000, 0x4063889f00000000, 0xf8538d8200000000,
+ 0x5d80d14900000000, 0xf3f245cf00000000, 0x5621190400000000,
+ 0x83934ff500000000, 0x2640133e00000000, 0x883287b800000000,
+ 0x2de1db7300000000, 0x95d1de6e00000000, 0x300282a500000000,
+ 0x9e70162300000000, 0x3ba34ae800000000, 0x7513ca1a00000000,
+ 0xd0c096d100000000, 0x7eb2025700000000, 0xdb615e9c00000000,
+ 0x63515b8100000000, 0xc682074a00000000, 0x68f093cc00000000,
+ 0xcd23cf0700000000, 0x189199f600000000, 0xbd42c53d00000000,
+ 0x133051bb00000000, 0xb6e30d7000000000, 0x0ed3086d00000000,
+ 0xab0054a600000000, 0x0572c02000000000, 0xa0a19ceb00000000,
+ 0xb41ee81100000000, 0x11cdb4da00000000, 0xbfbf205c00000000,
+ 0x1a6c7c9700000000, 0xa25c798a00000000, 0x078f254100000000,
+ 0xa9fdb1c700000000, 0x0c2eed0c00000000, 0xd99cbbfd00000000,
+ 0x7c4fe73600000000, 0xd23d73b000000000, 0x77ee2f7b00000000,
+ 0xcfde2a6600000000, 0x6a0d76ad00000000, 0xc47fe22b00000000,
+ 0x61acbee000000000, 0x2f1c3e1200000000, 0x8acf62d900000000,
+ 0x24bdf65f00000000, 0x816eaa9400000000, 0x395eaf8900000000,
+ 0x9c8df34200000000, 0x32ff67c400000000, 0x972c3b0f00000000,
+ 0x429e6dfe00000000, 0xe74d313500000000, 0x493fa5b300000000,
+ 0xececf97800000000, 0x54dcfc6500000000, 0xf10fa0ae00000000,
+ 0x5f7d342800000000, 0xfaae68e300000000, 0x821b441600000000,
+ 0x27c818dd00000000, 0x89ba8c5b00000000, 0x2c69d09000000000,
+ 0x9459d58d00000000, 0x318a894600000000, 0x9ff81dc000000000,
+ 0x3a2b410b00000000, 0xef9917fa00000000, 0x4a4a4b3100000000,
+ 0xe438dfb700000000, 0x41eb837c00000000, 0xf9db866100000000,
+ 0x5c08daaa00000000, 0xf27a4e2c00000000, 0x57a912e700000000,
+ 0x1919921500000000, 0xbccacede00000000, 0x12b85a5800000000,
+ 0xb76b069300000000, 0x0f5b038e00000000, 0xaa885f4500000000,
+ 0x04facbc300000000, 0xa129970800000000, 0x749bc1f900000000,
+ 0xd1489d3200000000, 0x7f3a09b400000000, 0xdae9557f00000000,
+ 0x62d9506200000000, 0xc70a0ca900000000, 0x6978982f00000000,
+ 0xccabc4e400000000},
+ {0x0000000000000000, 0xb40b77a600000000, 0x29119f9700000000,
+ 0x9d1ae83100000000, 0x13244ff400000000, 0xa72f385200000000,
+ 0x3a35d06300000000, 0x8e3ea7c500000000, 0x674eef3300000000,
+ 0xd345989500000000, 0x4e5f70a400000000, 0xfa54070200000000,
+ 0x746aa0c700000000, 0xc061d76100000000, 0x5d7b3f5000000000,
+ 0xe97048f600000000, 0xce9cde6700000000, 0x7a97a9c100000000,
+ 0xe78d41f000000000, 0x5386365600000000, 0xddb8919300000000,
+ 0x69b3e63500000000, 0xf4a90e0400000000, 0x40a279a200000000,
+ 0xa9d2315400000000, 0x1dd946f200000000, 0x80c3aec300000000,
+ 0x34c8d96500000000, 0xbaf67ea000000000, 0x0efd090600000000,
+ 0x93e7e13700000000, 0x27ec969100000000, 0x9c39bdcf00000000,
+ 0x2832ca6900000000, 0xb528225800000000, 0x012355fe00000000,
+ 0x8f1df23b00000000, 0x3b16859d00000000, 0xa60c6dac00000000,
+ 0x12071a0a00000000, 0xfb7752fc00000000, 0x4f7c255a00000000,
+ 0xd266cd6b00000000, 0x666dbacd00000000, 0xe8531d0800000000,
+ 0x5c586aae00000000, 0xc142829f00000000, 0x7549f53900000000,
+ 0x52a563a800000000, 0xe6ae140e00000000, 0x7bb4fc3f00000000,
+ 0xcfbf8b9900000000, 0x41812c5c00000000, 0xf58a5bfa00000000,
+ 0x6890b3cb00000000, 0xdc9bc46d00000000, 0x35eb8c9b00000000,
+ 0x81e0fb3d00000000, 0x1cfa130c00000000, 0xa8f164aa00000000,
+ 0x26cfc36f00000000, 0x92c4b4c900000000, 0x0fde5cf800000000,
+ 0xbbd52b5e00000000, 0x79750b4400000000, 0xcd7e7ce200000000,
+ 0x506494d300000000, 0xe46fe37500000000, 0x6a5144b000000000,
+ 0xde5a331600000000, 0x4340db2700000000, 0xf74bac8100000000,
+ 0x1e3be47700000000, 0xaa3093d100000000, 0x372a7be000000000,
+ 0x83210c4600000000, 0x0d1fab8300000000, 0xb914dc2500000000,
+ 0x240e341400000000, 0x900543b200000000, 0xb7e9d52300000000,
+ 0x03e2a28500000000, 0x9ef84ab400000000, 0x2af33d1200000000,
+ 0xa4cd9ad700000000, 0x10c6ed7100000000, 0x8ddc054000000000,
+ 0x39d772e600000000, 0xd0a73a1000000000, 0x64ac4db600000000,
+ 0xf9b6a58700000000, 0x4dbdd22100000000, 0xc38375e400000000,
+ 0x7788024200000000, 0xea92ea7300000000, 0x5e999dd500000000,
+ 0xe54cb68b00000000, 0x5147c12d00000000, 0xcc5d291c00000000,
+ 0x78565eba00000000, 0xf668f97f00000000, 0x42638ed900000000,
+ 0xdf7966e800000000, 0x6b72114e00000000, 0x820259b800000000,
+ 0x36092e1e00000000, 0xab13c62f00000000, 0x1f18b18900000000,
+ 0x9126164c00000000, 0x252d61ea00000000, 0xb83789db00000000,
+ 0x0c3cfe7d00000000, 0x2bd068ec00000000, 0x9fdb1f4a00000000,
+ 0x02c1f77b00000000, 0xb6ca80dd00000000, 0x38f4271800000000,
+ 0x8cff50be00000000, 0x11e5b88f00000000, 0xa5eecf2900000000,
+ 0x4c9e87df00000000, 0xf895f07900000000, 0x658f184800000000,
+ 0xd1846fee00000000, 0x5fbac82b00000000, 0xebb1bf8d00000000,
+ 0x76ab57bc00000000, 0xc2a0201a00000000, 0xf2ea168800000000,
+ 0x46e1612e00000000, 0xdbfb891f00000000, 0x6ff0feb900000000,
+ 0xe1ce597c00000000, 0x55c52eda00000000, 0xc8dfc6eb00000000,
+ 0x7cd4b14d00000000, 0x95a4f9bb00000000, 0x21af8e1d00000000,
+ 0xbcb5662c00000000, 0x08be118a00000000, 0x8680b64f00000000,
+ 0x328bc1e900000000, 0xaf9129d800000000, 0x1b9a5e7e00000000,
+ 0x3c76c8ef00000000, 0x887dbf4900000000, 0x1567577800000000,
+ 0xa16c20de00000000, 0x2f52871b00000000, 0x9b59f0bd00000000,
+ 0x0643188c00000000, 0xb2486f2a00000000, 0x5b3827dc00000000,
+ 0xef33507a00000000, 0x7229b84b00000000, 0xc622cfed00000000,
+ 0x481c682800000000, 0xfc171f8e00000000, 0x610df7bf00000000,
+ 0xd506801900000000, 0x6ed3ab4700000000, 0xdad8dce100000000,
+ 0x47c234d000000000, 0xf3c9437600000000, 0x7df7e4b300000000,
+ 0xc9fc931500000000, 0x54e67b2400000000, 0xe0ed0c8200000000,
+ 0x099d447400000000, 0xbd9633d200000000, 0x208cdbe300000000,
+ 0x9487ac4500000000, 0x1ab90b8000000000, 0xaeb27c2600000000,
+ 0x33a8941700000000, 0x87a3e3b100000000, 0xa04f752000000000,
+ 0x1444028600000000, 0x895eeab700000000, 0x3d559d1100000000,
+ 0xb36b3ad400000000, 0x07604d7200000000, 0x9a7aa54300000000,
+ 0x2e71d2e500000000, 0xc7019a1300000000, 0x730aedb500000000,
+ 0xee10058400000000, 0x5a1b722200000000, 0xd425d5e700000000,
+ 0x602ea24100000000, 0xfd344a7000000000, 0x493f3dd600000000,
+ 0x8b9f1dcc00000000, 0x3f946a6a00000000, 0xa28e825b00000000,
+ 0x1685f5fd00000000, 0x98bb523800000000, 0x2cb0259e00000000,
+ 0xb1aacdaf00000000, 0x05a1ba0900000000, 0xecd1f2ff00000000,
+ 0x58da855900000000, 0xc5c06d6800000000, 0x71cb1ace00000000,
+ 0xfff5bd0b00000000, 0x4bfecaad00000000, 0xd6e4229c00000000,
+ 0x62ef553a00000000, 0x4503c3ab00000000, 0xf108b40d00000000,
+ 0x6c125c3c00000000, 0xd8192b9a00000000, 0x56278c5f00000000,
+ 0xe22cfbf900000000, 0x7f3613c800000000, 0xcb3d646e00000000,
+ 0x224d2c9800000000, 0x96465b3e00000000, 0x0b5cb30f00000000,
+ 0xbf57c4a900000000, 0x3169636c00000000, 0x856214ca00000000,
+ 0x1878fcfb00000000, 0xac738b5d00000000, 0x17a6a00300000000,
+ 0xa3add7a500000000, 0x3eb73f9400000000, 0x8abc483200000000,
+ 0x0482eff700000000, 0xb089985100000000, 0x2d93706000000000,
+ 0x999807c600000000, 0x70e84f3000000000, 0xc4e3389600000000,
+ 0x59f9d0a700000000, 0xedf2a70100000000, 0x63cc00c400000000,
+ 0xd7c7776200000000, 0x4add9f5300000000, 0xfed6e8f500000000,
+ 0xd93a7e6400000000, 0x6d3109c200000000, 0xf02be1f300000000,
+ 0x4420965500000000, 0xca1e319000000000, 0x7e15463600000000,
+ 0xe30fae0700000000, 0x5704d9a100000000, 0xbe74915700000000,
+ 0x0a7fe6f100000000, 0x97650ec000000000, 0x236e796600000000,
+ 0xad50dea300000000, 0x195ba90500000000, 0x8441413400000000,
+ 0x304a369200000000},
+ {0x0000000000000000, 0x9e00aacc00000000, 0x7d07254200000000,
+ 0xe3078f8e00000000, 0xfa0e4a8400000000, 0x640ee04800000000,
+ 0x87096fc600000000, 0x1909c50a00000000, 0xb51be5d300000000,
+ 0x2b1b4f1f00000000, 0xc81cc09100000000, 0x561c6a5d00000000,
+ 0x4f15af5700000000, 0xd115059b00000000, 0x32128a1500000000,
+ 0xac1220d900000000, 0x2b31bb7c00000000, 0xb53111b000000000,
+ 0x56369e3e00000000, 0xc83634f200000000, 0xd13ff1f800000000,
+ 0x4f3f5b3400000000, 0xac38d4ba00000000, 0x32387e7600000000,
+ 0x9e2a5eaf00000000, 0x002af46300000000, 0xe32d7bed00000000,
+ 0x7d2dd12100000000, 0x6424142b00000000, 0xfa24bee700000000,
+ 0x1923316900000000, 0x87239ba500000000, 0x566276f900000000,
+ 0xc862dc3500000000, 0x2b6553bb00000000, 0xb565f97700000000,
+ 0xac6c3c7d00000000, 0x326c96b100000000, 0xd16b193f00000000,
+ 0x4f6bb3f300000000, 0xe379932a00000000, 0x7d7939e600000000,
+ 0x9e7eb66800000000, 0x007e1ca400000000, 0x1977d9ae00000000,
+ 0x8777736200000000, 0x6470fcec00000000, 0xfa70562000000000,
+ 0x7d53cd8500000000, 0xe353674900000000, 0x0054e8c700000000,
+ 0x9e54420b00000000, 0x875d870100000000, 0x195d2dcd00000000,
+ 0xfa5aa24300000000, 0x645a088f00000000, 0xc848285600000000,
+ 0x5648829a00000000, 0xb54f0d1400000000, 0x2b4fa7d800000000,
+ 0x324662d200000000, 0xac46c81e00000000, 0x4f41479000000000,
+ 0xd141ed5c00000000, 0xedc29d2900000000, 0x73c237e500000000,
+ 0x90c5b86b00000000, 0x0ec512a700000000, 0x17ccd7ad00000000,
+ 0x89cc7d6100000000, 0x6acbf2ef00000000, 0xf4cb582300000000,
+ 0x58d978fa00000000, 0xc6d9d23600000000, 0x25de5db800000000,
+ 0xbbdef77400000000, 0xa2d7327e00000000, 0x3cd798b200000000,
+ 0xdfd0173c00000000, 0x41d0bdf000000000, 0xc6f3265500000000,
+ 0x58f38c9900000000, 0xbbf4031700000000, 0x25f4a9db00000000,
+ 0x3cfd6cd100000000, 0xa2fdc61d00000000, 0x41fa499300000000,
+ 0xdffae35f00000000, 0x73e8c38600000000, 0xede8694a00000000,
+ 0x0eefe6c400000000, 0x90ef4c0800000000, 0x89e6890200000000,
+ 0x17e623ce00000000, 0xf4e1ac4000000000, 0x6ae1068c00000000,
+ 0xbba0ebd000000000, 0x25a0411c00000000, 0xc6a7ce9200000000,
+ 0x58a7645e00000000, 0x41aea15400000000, 0xdfae0b9800000000,
+ 0x3ca9841600000000, 0xa2a92eda00000000, 0x0ebb0e0300000000,
+ 0x90bba4cf00000000, 0x73bc2b4100000000, 0xedbc818d00000000,
+ 0xf4b5448700000000, 0x6ab5ee4b00000000, 0x89b261c500000000,
+ 0x17b2cb0900000000, 0x909150ac00000000, 0x0e91fa6000000000,
+ 0xed9675ee00000000, 0x7396df2200000000, 0x6a9f1a2800000000,
+ 0xf49fb0e400000000, 0x17983f6a00000000, 0x899895a600000000,
+ 0x258ab57f00000000, 0xbb8a1fb300000000, 0x588d903d00000000,
+ 0xc68d3af100000000, 0xdf84fffb00000000, 0x4184553700000000,
+ 0xa283dab900000000, 0x3c83707500000000, 0xda853b5300000000,
+ 0x4485919f00000000, 0xa7821e1100000000, 0x3982b4dd00000000,
+ 0x208b71d700000000, 0xbe8bdb1b00000000, 0x5d8c549500000000,
+ 0xc38cfe5900000000, 0x6f9ede8000000000, 0xf19e744c00000000,
+ 0x1299fbc200000000, 0x8c99510e00000000, 0x9590940400000000,
+ 0x0b903ec800000000, 0xe897b14600000000, 0x76971b8a00000000,
+ 0xf1b4802f00000000, 0x6fb42ae300000000, 0x8cb3a56d00000000,
+ 0x12b30fa100000000, 0x0bbacaab00000000, 0x95ba606700000000,
+ 0x76bdefe900000000, 0xe8bd452500000000, 0x44af65fc00000000,
+ 0xdaafcf3000000000, 0x39a840be00000000, 0xa7a8ea7200000000,
+ 0xbea12f7800000000, 0x20a185b400000000, 0xc3a60a3a00000000,
+ 0x5da6a0f600000000, 0x8ce74daa00000000, 0x12e7e76600000000,
+ 0xf1e068e800000000, 0x6fe0c22400000000, 0x76e9072e00000000,
+ 0xe8e9ade200000000, 0x0bee226c00000000, 0x95ee88a000000000,
+ 0x39fca87900000000, 0xa7fc02b500000000, 0x44fb8d3b00000000,
+ 0xdafb27f700000000, 0xc3f2e2fd00000000, 0x5df2483100000000,
+ 0xbef5c7bf00000000, 0x20f56d7300000000, 0xa7d6f6d600000000,
+ 0x39d65c1a00000000, 0xdad1d39400000000, 0x44d1795800000000,
+ 0x5dd8bc5200000000, 0xc3d8169e00000000, 0x20df991000000000,
+ 0xbedf33dc00000000, 0x12cd130500000000, 0x8ccdb9c900000000,
+ 0x6fca364700000000, 0xf1ca9c8b00000000, 0xe8c3598100000000,
+ 0x76c3f34d00000000, 0x95c47cc300000000, 0x0bc4d60f00000000,
+ 0x3747a67a00000000, 0xa9470cb600000000, 0x4a40833800000000,
+ 0xd44029f400000000, 0xcd49ecfe00000000, 0x5349463200000000,
+ 0xb04ec9bc00000000, 0x2e4e637000000000, 0x825c43a900000000,
+ 0x1c5ce96500000000, 0xff5b66eb00000000, 0x615bcc2700000000,
+ 0x7852092d00000000, 0xe652a3e100000000, 0x05552c6f00000000,
+ 0x9b5586a300000000, 0x1c761d0600000000, 0x8276b7ca00000000,
+ 0x6171384400000000, 0xff71928800000000, 0xe678578200000000,
+ 0x7878fd4e00000000, 0x9b7f72c000000000, 0x057fd80c00000000,
+ 0xa96df8d500000000, 0x376d521900000000, 0xd46add9700000000,
+ 0x4a6a775b00000000, 0x5363b25100000000, 0xcd63189d00000000,
+ 0x2e64971300000000, 0xb0643ddf00000000, 0x6125d08300000000,
+ 0xff257a4f00000000, 0x1c22f5c100000000, 0x82225f0d00000000,
+ 0x9b2b9a0700000000, 0x052b30cb00000000, 0xe62cbf4500000000,
+ 0x782c158900000000, 0xd43e355000000000, 0x4a3e9f9c00000000,
+ 0xa939101200000000, 0x3739bade00000000, 0x2e307fd400000000,
+ 0xb030d51800000000, 0x53375a9600000000, 0xcd37f05a00000000,
+ 0x4a146bff00000000, 0xd414c13300000000, 0x37134ebd00000000,
+ 0xa913e47100000000, 0xb01a217b00000000, 0x2e1a8bb700000000,
+ 0xcd1d043900000000, 0x531daef500000000, 0xff0f8e2c00000000,
+ 0x610f24e000000000, 0x8208ab6e00000000, 0x1c0801a200000000,
+ 0x0501c4a800000000, 0x9b016e6400000000, 0x7806e1ea00000000,
+ 0xe6064b2600000000}};
+
+#else /* W == 4 */
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, 0x8f629757,
+ 0x37def032, 0x256b5fdc, 0x9dd738b9, 0xc5b428ef, 0x7d084f8a,
+ 0x6fbde064, 0xd7018701, 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733,
+ 0x58631056, 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871,
+ 0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, 0x95ad7f70,
+ 0x2d111815, 0x3fa4b7fb, 0x8718d09e, 0x1acfe827, 0xa2738f42,
+ 0xb0c620ac, 0x087a47c9, 0xa032af3e, 0x188ec85b, 0x0a3b67b5,
+ 0xb28700d0, 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787,
+ 0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, 0xeae41086,
+ 0x525877e3, 0x40edd80d, 0xf851bf68, 0xf02bf8a1, 0x48979fc4,
+ 0x5a22302a, 0xe29e574f, 0x7f496ff6, 0xc7f50893, 0xd540a77d,
+ 0x6dfcc018, 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0,
+ 0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, 0x9b14583d,
+ 0x23a83f58, 0x311d90b6, 0x89a1f7d3, 0x1476cf6a, 0xaccaa80f,
+ 0xbe7f07e1, 0x06c36084, 0x5ea070d2, 0xe61c17b7, 0xf4a9b859,
+ 0x4c15df3c, 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b,
+ 0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, 0x446f98f5,
+ 0xfcd3ff90, 0xee66507e, 0x56da371b, 0x0eb9274d, 0xb6054028,
+ 0xa4b0efc6, 0x1c0c88a3, 0x81dbb01a, 0x3967d77f, 0x2bd27891,
+ 0x936e1ff4, 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed,
+ 0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, 0xfe92dfec,
+ 0x462eb889, 0x549b1767, 0xec277002, 0x71f048bb, 0xc94c2fde,
+ 0xdbf98030, 0x6345e755, 0x6b3fa09c, 0xd383c7f9, 0xc1366817,
+ 0x798a0f72, 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825,
+ 0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, 0x21e91f24,
+ 0x99557841, 0x8be0d7af, 0x335cb0ca, 0xed59b63b, 0x55e5d15e,
+ 0x47507eb0, 0xffec19d5, 0x623b216c, 0xda874609, 0xc832e9e7,
+ 0x708e8e82, 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a,
+ 0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, 0xbd40e1a4,
+ 0x05fc86c1, 0x1749292f, 0xaff54e4a, 0x322276f3, 0x8a9e1196,
+ 0x982bbe78, 0x2097d91d, 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0,
+ 0x6a4166a5, 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2,
+ 0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, 0xc2098e52,
+ 0x7ab5e937, 0x680046d9, 0xd0bc21bc, 0x88df31ea, 0x3063568f,
+ 0x22d6f961, 0x9a6a9e04, 0x07bda6bd, 0xbf01c1d8, 0xadb46e36,
+ 0x15080953, 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174,
+ 0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, 0xd8c66675,
+ 0x607a0110, 0x72cfaefe, 0xca73c99b, 0x57a4f122, 0xef189647,
+ 0xfdad39a9, 0x45115ecc, 0x764dee06, 0xcef18963, 0xdc44268d,
+ 0x64f841e8, 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf,
+ 0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, 0x3c9b51be,
+ 0x842736db, 0x96929935, 0x2e2efe50, 0x2654b999, 0x9ee8defc,
+ 0x8c5d7112, 0x34e11677, 0xa9362ece, 0x118a49ab, 0x033fe645,
+ 0xbb838120, 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98,
+ 0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, 0xd67f4138,
+ 0x6ec3265d, 0x7c7689b3, 0xc4caeed6, 0x591dd66f, 0xe1a1b10a,
+ 0xf3141ee4, 0x4ba87981, 0x13cb69d7, 0xab770eb2, 0xb9c2a15c,
+ 0x017ec639, 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e,
+ 0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, 0x090481f0,
+ 0xb1b8e695, 0xa30d497b, 0x1bb12e1e, 0x43d23e48, 0xfb6e592d,
+ 0xe9dbf6c3, 0x516791a6, 0xccb0a91f, 0x740cce7a, 0x66b96194,
+ 0xde0506f1},
+ {0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, 0x0709a8dc,
+ 0x06cbc2eb, 0x048d7cb2, 0x054f1685, 0x0e1351b8, 0x0fd13b8f,
+ 0x0d9785d6, 0x0c55efe1, 0x091af964, 0x08d89353, 0x0a9e2d0a,
+ 0x0b5c473d, 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29,
+ 0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, 0x1235f2c8,
+ 0x13f798ff, 0x11b126a6, 0x10734c91, 0x153c5a14, 0x14fe3023,
+ 0x16b88e7a, 0x177ae44d, 0x384d46e0, 0x398f2cd7, 0x3bc9928e,
+ 0x3a0bf8b9, 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065,
+ 0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, 0x3157bf84,
+ 0x3095d5b3, 0x32d36bea, 0x331101dd, 0x246be590, 0x25a98fa7,
+ 0x27ef31fe, 0x262d5bc9, 0x23624d4c, 0x22a0277b, 0x20e69922,
+ 0x2124f315, 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71,
+ 0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, 0x709a8dc0,
+ 0x7158e7f7, 0x731e59ae, 0x72dc3399, 0x7793251c, 0x76514f2b,
+ 0x7417f172, 0x75d59b45, 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816,
+ 0x7ccf6221, 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd,
+ 0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, 0x6bb5866c,
+ 0x6a77ec5b, 0x68315202, 0x69f33835, 0x62af7f08, 0x636d153f,
+ 0x612bab66, 0x60e9c151, 0x65a6d7d4, 0x6464bde3, 0x662203ba,
+ 0x67e0698d, 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579,
+ 0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, 0x46c49a98,
+ 0x4706f0af, 0x45404ef6, 0x448224c1, 0x41cd3244, 0x400f5873,
+ 0x4249e62a, 0x438b8c1d, 0x54f16850, 0x55330267, 0x5775bc3e,
+ 0x56b7d609, 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5,
+ 0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, 0x5deb9134,
+ 0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, 0xe1351b80, 0xe0f771b7,
+ 0xe2b1cfee, 0xe373a5d9, 0xe63cb35c, 0xe7fed96b, 0xe5b86732,
+ 0xe47a0d05, 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461,
+ 0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, 0xfd13b8f0,
+ 0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, 0xfa1a102c, 0xfbd87a1b,
+ 0xf99ec442, 0xf85cae75, 0xf300e948, 0xf2c2837f, 0xf0843d26,
+ 0xf1465711, 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd,
+ 0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, 0xde71f5bc,
+ 0xdfb39f8b, 0xddf521d2, 0xdc374be5, 0xd76b0cd8, 0xd6a966ef,
+ 0xd4efd8b6, 0xd52db281, 0xd062a404, 0xd1a0ce33, 0xd3e6706a,
+ 0xd2241a5d, 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049,
+ 0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, 0xcb4dafa8,
+ 0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, 0xcc440774, 0xcd866d43,
+ 0xcfc0d31a, 0xce02b92d, 0x91af9640, 0x906dfc77, 0x922b422e,
+ 0x93e92819, 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5,
+ 0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, 0x98b56f24,
+ 0x99770513, 0x9b31bb4a, 0x9af3d17d, 0x8d893530, 0x8c4b5f07,
+ 0x8e0de15e, 0x8fcf8b69, 0x8a809dec, 0x8b42f7db, 0x89044982,
+ 0x88c623b5, 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1,
+ 0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, 0xa9e2d0a0,
+ 0xa820ba97, 0xaa6604ce, 0xaba46ef9, 0xaeeb787c, 0xaf29124b,
+ 0xad6fac12, 0xacadc625, 0xa7f18118, 0xa633eb2f, 0xa4755576,
+ 0xa5b73f41, 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d,
+ 0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, 0xb2cddb0c,
+ 0xb30fb13b, 0xb1490f62, 0xb08b6555, 0xbbd72268, 0xba15485f,
+ 0xb853f606, 0xb9919c31, 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda,
+ 0xbe9834ed},
+ {0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, 0x646cc504,
+ 0x7d77f445, 0x565aa786, 0x4f4196c7, 0xc8d98a08, 0xd1c2bb49,
+ 0xfaefe88a, 0xe3f4d9cb, 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e,
+ 0x87981ccf, 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192,
+ 0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, 0x821b9859,
+ 0x9b00a918, 0xb02dfadb, 0xa936cb9a, 0xe6775d5d, 0xff6c6c1c,
+ 0xd4413fdf, 0xcd5a0e9e, 0x958424a2, 0x8c9f15e3, 0xa7b24620,
+ 0xbea97761, 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265,
+ 0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, 0x39316bae,
+ 0x202a5aef, 0x0b07092c, 0x121c386d, 0xdf4636f3, 0xc65d07b2,
+ 0xed705471, 0xf46b6530, 0xbb2af3f7, 0xa231c2b6, 0x891c9175,
+ 0x9007a034, 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38,
+ 0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, 0xf0794f05,
+ 0xe9627e44, 0xc24f2d87, 0xdb541cc6, 0x94158a01, 0x8d0ebb40,
+ 0xa623e883, 0xbf38d9c2, 0x38a0c50d, 0x21bbf44c, 0x0a96a78f,
+ 0x138d96ce, 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca,
+ 0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, 0xded79850,
+ 0xc7cca911, 0xece1fad2, 0xf5facb93, 0x7262d75c, 0x6b79e61d,
+ 0x4054b5de, 0x594f849f, 0x160e1258, 0x0f152319, 0x243870da,
+ 0x3d23419b, 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864,
+ 0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, 0xad24e1af,
+ 0xb43fd0ee, 0x9f12832d, 0x8609b26c, 0xc94824ab, 0xd05315ea,
+ 0xfb7e4629, 0xe2657768, 0x2f3f79f6, 0x362448b7, 0x1d091b74,
+ 0x04122a35, 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31,
+ 0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, 0x838a36fa,
+ 0x9a9107bb, 0xb1bc5478, 0xa8a76539, 0x3b83984b, 0x2298a90a,
+ 0x09b5fac9, 0x10aecb88, 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd,
+ 0x74c20e8c, 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180,
+ 0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, 0x71418a1a,
+ 0x685abb5b, 0x4377e898, 0x5a6cd9d9, 0x152d4f1e, 0x0c367e5f,
+ 0x271b2d9c, 0x3e001cdd, 0xb9980012, 0xa0833153, 0x8bae6290,
+ 0x92b553d1, 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5,
+ 0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, 0xca6b79ed,
+ 0xd37048ac, 0xf85d1b6f, 0xe1462a2e, 0x66de36e1, 0x7fc507a0,
+ 0x54e85463, 0x4df36522, 0x02b2f3e5, 0x1ba9c2a4, 0x30849167,
+ 0x299fa026, 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b,
+ 0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, 0x2c1c24b0,
+ 0x350715f1, 0x1e2a4632, 0x07317773, 0x4870e1b4, 0x516bd0f5,
+ 0x7a468336, 0x635db277, 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc,
+ 0xe0d7848d, 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189,
+ 0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, 0x674f9842,
+ 0x7e54a903, 0x5579fac0, 0x4c62cb81, 0x8138c51f, 0x9823f45e,
+ 0xb30ea79d, 0xaa1596dc, 0xe554001b, 0xfc4f315a, 0xd7626299,
+ 0xce7953d8, 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4,
+ 0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, 0x5e7ef3ec,
+ 0x4765c2ad, 0x6c48916e, 0x7553a02f, 0x3a1236e8, 0x230907a9,
+ 0x0824546a, 0x113f652b, 0x96a779e4, 0x8fbc48a5, 0xa4911b66,
+ 0xbd8a2a27, 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23,
+ 0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, 0x70d024b9,
+ 0x69cb15f8, 0x42e6463b, 0x5bfd777a, 0xdc656bb5, 0xc57e5af4,
+ 0xee530937, 0xf7483876, 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33,
+ 0x9324fd72},
+ {0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419,
+ 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4,
+ 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07,
+ 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
+ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856,
+ 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9,
+ 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4,
+ 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
+ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3,
+ 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a,
+ 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599,
+ 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
+ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190,
+ 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f,
+ 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e,
+ 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
+ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed,
+ 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950,
+ 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3,
+ 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
+ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a,
+ 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5,
+ 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010,
+ 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
+ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17,
+ 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6,
+ 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615,
+ 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
+ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344,
+ 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb,
+ 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a,
+ 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
+ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1,
+ 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c,
+ 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef,
+ 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
+ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe,
+ 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31,
+ 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c,
+ 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
+ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b,
+ 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242,
+ 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1,
+ 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
+ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278,
+ 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7,
+ 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66,
+ 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
+ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605,
+ 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8,
+ 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b,
+ 0x2d02ef8d}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x00000000, 0x96300777, 0x2c610eee, 0xba510999, 0x19c46d07,
+ 0x8ff46a70, 0x35a563e9, 0xa395649e, 0x3288db0e, 0xa4b8dc79,
+ 0x1ee9d5e0, 0x88d9d297, 0x2b4cb609, 0xbd7cb17e, 0x072db8e7,
+ 0x911dbf90, 0x6410b71d, 0xf220b06a, 0x4871b9f3, 0xde41be84,
+ 0x7dd4da1a, 0xebe4dd6d, 0x51b5d4f4, 0xc785d383, 0x56986c13,
+ 0xc0a86b64, 0x7af962fd, 0xecc9658a, 0x4f5c0114, 0xd96c0663,
+ 0x633d0ffa, 0xf50d088d, 0xc8206e3b, 0x5e10694c, 0xe44160d5,
+ 0x727167a2, 0xd1e4033c, 0x47d4044b, 0xfd850dd2, 0x6bb50aa5,
+ 0xfaa8b535, 0x6c98b242, 0xd6c9bbdb, 0x40f9bcac, 0xe36cd832,
+ 0x755cdf45, 0xcf0dd6dc, 0x593dd1ab, 0xac30d926, 0x3a00de51,
+ 0x8051d7c8, 0x1661d0bf, 0xb5f4b421, 0x23c4b356, 0x9995bacf,
+ 0x0fa5bdb8, 0x9eb80228, 0x0888055f, 0xb2d90cc6, 0x24e90bb1,
+ 0x877c6f2f, 0x114c6858, 0xab1d61c1, 0x3d2d66b6, 0x9041dc76,
+ 0x0671db01, 0xbc20d298, 0x2a10d5ef, 0x8985b171, 0x1fb5b606,
+ 0xa5e4bf9f, 0x33d4b8e8, 0xa2c90778, 0x34f9000f, 0x8ea80996,
+ 0x18980ee1, 0xbb0d6a7f, 0x2d3d6d08, 0x976c6491, 0x015c63e6,
+ 0xf4516b6b, 0x62616c1c, 0xd8306585, 0x4e0062f2, 0xed95066c,
+ 0x7ba5011b, 0xc1f40882, 0x57c40ff5, 0xc6d9b065, 0x50e9b712,
+ 0xeab8be8b, 0x7c88b9fc, 0xdf1ddd62, 0x492dda15, 0xf37cd38c,
+ 0x654cd4fb, 0x5861b24d, 0xce51b53a, 0x7400bca3, 0xe230bbd4,
+ 0x41a5df4a, 0xd795d83d, 0x6dc4d1a4, 0xfbf4d6d3, 0x6ae96943,
+ 0xfcd96e34, 0x468867ad, 0xd0b860da, 0x732d0444, 0xe51d0333,
+ 0x5f4c0aaa, 0xc97c0ddd, 0x3c710550, 0xaa410227, 0x10100bbe,
+ 0x86200cc9, 0x25b56857, 0xb3856f20, 0x09d466b9, 0x9fe461ce,
+ 0x0ef9de5e, 0x98c9d929, 0x2298d0b0, 0xb4a8d7c7, 0x173db359,
+ 0x810db42e, 0x3b5cbdb7, 0xad6cbac0, 0x2083b8ed, 0xb6b3bf9a,
+ 0x0ce2b603, 0x9ad2b174, 0x3947d5ea, 0xaf77d29d, 0x1526db04,
+ 0x8316dc73, 0x120b63e3, 0x843b6494, 0x3e6a6d0d, 0xa85a6a7a,
+ 0x0bcf0ee4, 0x9dff0993, 0x27ae000a, 0xb19e077d, 0x44930ff0,
+ 0xd2a30887, 0x68f2011e, 0xfec20669, 0x5d5762f7, 0xcb676580,
+ 0x71366c19, 0xe7066b6e, 0x761bd4fe, 0xe02bd389, 0x5a7ada10,
+ 0xcc4add67, 0x6fdfb9f9, 0xf9efbe8e, 0x43beb717, 0xd58eb060,
+ 0xe8a3d6d6, 0x7e93d1a1, 0xc4c2d838, 0x52f2df4f, 0xf167bbd1,
+ 0x6757bca6, 0xdd06b53f, 0x4b36b248, 0xda2b0dd8, 0x4c1b0aaf,
+ 0xf64a0336, 0x607a0441, 0xc3ef60df, 0x55df67a8, 0xef8e6e31,
+ 0x79be6946, 0x8cb361cb, 0x1a8366bc, 0xa0d26f25, 0x36e26852,
+ 0x95770ccc, 0x03470bbb, 0xb9160222, 0x2f260555, 0xbe3bbac5,
+ 0x280bbdb2, 0x925ab42b, 0x046ab35c, 0xa7ffd7c2, 0x31cfd0b5,
+ 0x8b9ed92c, 0x1daede5b, 0xb0c2649b, 0x26f263ec, 0x9ca36a75,
+ 0x0a936d02, 0xa906099c, 0x3f360eeb, 0x85670772, 0x13570005,
+ 0x824abf95, 0x147ab8e2, 0xae2bb17b, 0x381bb60c, 0x9b8ed292,
+ 0x0dbed5e5, 0xb7efdc7c, 0x21dfdb0b, 0xd4d2d386, 0x42e2d4f1,
+ 0xf8b3dd68, 0x6e83da1f, 0xcd16be81, 0x5b26b9f6, 0xe177b06f,
+ 0x7747b718, 0xe65a0888, 0x706a0fff, 0xca3b0666, 0x5c0b0111,
+ 0xff9e658f, 0x69ae62f8, 0xd3ff6b61, 0x45cf6c16, 0x78e20aa0,
+ 0xeed20dd7, 0x5483044e, 0xc2b30339, 0x612667a7, 0xf71660d0,
+ 0x4d476949, 0xdb776e3e, 0x4a6ad1ae, 0xdc5ad6d9, 0x660bdf40,
+ 0xf03bd837, 0x53aebca9, 0xc59ebbde, 0x7fcfb247, 0xe9ffb530,
+ 0x1cf2bdbd, 0x8ac2baca, 0x3093b353, 0xa6a3b424, 0x0536d0ba,
+ 0x9306d7cd, 0x2957de54, 0xbf67d923, 0x2e7a66b3, 0xb84a61c4,
+ 0x021b685d, 0x942b6f2a, 0x37be0bb4, 0xa18e0cc3, 0x1bdf055a,
+ 0x8def022d},
+ {0x00000000, 0x41311b19, 0x82623632, 0xc3532d2b, 0x04c56c64,
+ 0x45f4777d, 0x86a75a56, 0xc796414f, 0x088ad9c8, 0x49bbc2d1,
+ 0x8ae8effa, 0xcbd9f4e3, 0x0c4fb5ac, 0x4d7eaeb5, 0x8e2d839e,
+ 0xcf1c9887, 0x5112c24a, 0x1023d953, 0xd370f478, 0x9241ef61,
+ 0x55d7ae2e, 0x14e6b537, 0xd7b5981c, 0x96848305, 0x59981b82,
+ 0x18a9009b, 0xdbfa2db0, 0x9acb36a9, 0x5d5d77e6, 0x1c6c6cff,
+ 0xdf3f41d4, 0x9e0e5acd, 0xa2248495, 0xe3159f8c, 0x2046b2a7,
+ 0x6177a9be, 0xa6e1e8f1, 0xe7d0f3e8, 0x2483dec3, 0x65b2c5da,
+ 0xaaae5d5d, 0xeb9f4644, 0x28cc6b6f, 0x69fd7076, 0xae6b3139,
+ 0xef5a2a20, 0x2c09070b, 0x6d381c12, 0xf33646df, 0xb2075dc6,
+ 0x715470ed, 0x30656bf4, 0xf7f32abb, 0xb6c231a2, 0x75911c89,
+ 0x34a00790, 0xfbbc9f17, 0xba8d840e, 0x79dea925, 0x38efb23c,
+ 0xff79f373, 0xbe48e86a, 0x7d1bc541, 0x3c2ade58, 0x054f79f0,
+ 0x447e62e9, 0x872d4fc2, 0xc61c54db, 0x018a1594, 0x40bb0e8d,
+ 0x83e823a6, 0xc2d938bf, 0x0dc5a038, 0x4cf4bb21, 0x8fa7960a,
+ 0xce968d13, 0x0900cc5c, 0x4831d745, 0x8b62fa6e, 0xca53e177,
+ 0x545dbbba, 0x156ca0a3, 0xd63f8d88, 0x970e9691, 0x5098d7de,
+ 0x11a9ccc7, 0xd2fae1ec, 0x93cbfaf5, 0x5cd76272, 0x1de6796b,
+ 0xdeb55440, 0x9f844f59, 0x58120e16, 0x1923150f, 0xda703824,
+ 0x9b41233d, 0xa76bfd65, 0xe65ae67c, 0x2509cb57, 0x6438d04e,
+ 0xa3ae9101, 0xe29f8a18, 0x21cca733, 0x60fdbc2a, 0xafe124ad,
+ 0xeed03fb4, 0x2d83129f, 0x6cb20986, 0xab2448c9, 0xea1553d0,
+ 0x29467efb, 0x687765e2, 0xf6793f2f, 0xb7482436, 0x741b091d,
+ 0x352a1204, 0xf2bc534b, 0xb38d4852, 0x70de6579, 0x31ef7e60,
+ 0xfef3e6e7, 0xbfc2fdfe, 0x7c91d0d5, 0x3da0cbcc, 0xfa368a83,
+ 0xbb07919a, 0x7854bcb1, 0x3965a7a8, 0x4b98833b, 0x0aa99822,
+ 0xc9fab509, 0x88cbae10, 0x4f5def5f, 0x0e6cf446, 0xcd3fd96d,
+ 0x8c0ec274, 0x43125af3, 0x022341ea, 0xc1706cc1, 0x804177d8,
+ 0x47d73697, 0x06e62d8e, 0xc5b500a5, 0x84841bbc, 0x1a8a4171,
+ 0x5bbb5a68, 0x98e87743, 0xd9d96c5a, 0x1e4f2d15, 0x5f7e360c,
+ 0x9c2d1b27, 0xdd1c003e, 0x120098b9, 0x533183a0, 0x9062ae8b,
+ 0xd153b592, 0x16c5f4dd, 0x57f4efc4, 0x94a7c2ef, 0xd596d9f6,
+ 0xe9bc07ae, 0xa88d1cb7, 0x6bde319c, 0x2aef2a85, 0xed796bca,
+ 0xac4870d3, 0x6f1b5df8, 0x2e2a46e1, 0xe136de66, 0xa007c57f,
+ 0x6354e854, 0x2265f34d, 0xe5f3b202, 0xa4c2a91b, 0x67918430,
+ 0x26a09f29, 0xb8aec5e4, 0xf99fdefd, 0x3accf3d6, 0x7bfde8cf,
+ 0xbc6ba980, 0xfd5ab299, 0x3e099fb2, 0x7f3884ab, 0xb0241c2c,
+ 0xf1150735, 0x32462a1e, 0x73773107, 0xb4e17048, 0xf5d06b51,
+ 0x3683467a, 0x77b25d63, 0x4ed7facb, 0x0fe6e1d2, 0xccb5ccf9,
+ 0x8d84d7e0, 0x4a1296af, 0x0b238db6, 0xc870a09d, 0x8941bb84,
+ 0x465d2303, 0x076c381a, 0xc43f1531, 0x850e0e28, 0x42984f67,
+ 0x03a9547e, 0xc0fa7955, 0x81cb624c, 0x1fc53881, 0x5ef42398,
+ 0x9da70eb3, 0xdc9615aa, 0x1b0054e5, 0x5a314ffc, 0x996262d7,
+ 0xd85379ce, 0x174fe149, 0x567efa50, 0x952dd77b, 0xd41ccc62,
+ 0x138a8d2d, 0x52bb9634, 0x91e8bb1f, 0xd0d9a006, 0xecf37e5e,
+ 0xadc26547, 0x6e91486c, 0x2fa05375, 0xe836123a, 0xa9070923,
+ 0x6a542408, 0x2b653f11, 0xe479a796, 0xa548bc8f, 0x661b91a4,
+ 0x272a8abd, 0xe0bccbf2, 0xa18dd0eb, 0x62defdc0, 0x23efe6d9,
+ 0xbde1bc14, 0xfcd0a70d, 0x3f838a26, 0x7eb2913f, 0xb924d070,
+ 0xf815cb69, 0x3b46e642, 0x7a77fd5b, 0xb56b65dc, 0xf45a7ec5,
+ 0x370953ee, 0x763848f7, 0xb1ae09b8, 0xf09f12a1, 0x33cc3f8a,
+ 0x72fd2493},
+ {0x00000000, 0x376ac201, 0x6ed48403, 0x59be4602, 0xdca80907,
+ 0xebc2cb06, 0xb27c8d04, 0x85164f05, 0xb851130e, 0x8f3bd10f,
+ 0xd685970d, 0xe1ef550c, 0x64f91a09, 0x5393d808, 0x0a2d9e0a,
+ 0x3d475c0b, 0x70a3261c, 0x47c9e41d, 0x1e77a21f, 0x291d601e,
+ 0xac0b2f1b, 0x9b61ed1a, 0xc2dfab18, 0xf5b56919, 0xc8f23512,
+ 0xff98f713, 0xa626b111, 0x914c7310, 0x145a3c15, 0x2330fe14,
+ 0x7a8eb816, 0x4de47a17, 0xe0464d38, 0xd72c8f39, 0x8e92c93b,
+ 0xb9f80b3a, 0x3cee443f, 0x0b84863e, 0x523ac03c, 0x6550023d,
+ 0x58175e36, 0x6f7d9c37, 0x36c3da35, 0x01a91834, 0x84bf5731,
+ 0xb3d59530, 0xea6bd332, 0xdd011133, 0x90e56b24, 0xa78fa925,
+ 0xfe31ef27, 0xc95b2d26, 0x4c4d6223, 0x7b27a022, 0x2299e620,
+ 0x15f32421, 0x28b4782a, 0x1fdeba2b, 0x4660fc29, 0x710a3e28,
+ 0xf41c712d, 0xc376b32c, 0x9ac8f52e, 0xada2372f, 0xc08d9a70,
+ 0xf7e75871, 0xae591e73, 0x9933dc72, 0x1c259377, 0x2b4f5176,
+ 0x72f11774, 0x459bd575, 0x78dc897e, 0x4fb64b7f, 0x16080d7d,
+ 0x2162cf7c, 0xa4748079, 0x931e4278, 0xcaa0047a, 0xfdcac67b,
+ 0xb02ebc6c, 0x87447e6d, 0xdefa386f, 0xe990fa6e, 0x6c86b56b,
+ 0x5bec776a, 0x02523168, 0x3538f369, 0x087faf62, 0x3f156d63,
+ 0x66ab2b61, 0x51c1e960, 0xd4d7a665, 0xe3bd6464, 0xba032266,
+ 0x8d69e067, 0x20cbd748, 0x17a11549, 0x4e1f534b, 0x7975914a,
+ 0xfc63de4f, 0xcb091c4e, 0x92b75a4c, 0xa5dd984d, 0x989ac446,
+ 0xaff00647, 0xf64e4045, 0xc1248244, 0x4432cd41, 0x73580f40,
+ 0x2ae64942, 0x1d8c8b43, 0x5068f154, 0x67023355, 0x3ebc7557,
+ 0x09d6b756, 0x8cc0f853, 0xbbaa3a52, 0xe2147c50, 0xd57ebe51,
+ 0xe839e25a, 0xdf53205b, 0x86ed6659, 0xb187a458, 0x3491eb5d,
+ 0x03fb295c, 0x5a456f5e, 0x6d2fad5f, 0x801b35e1, 0xb771f7e0,
+ 0xeecfb1e2, 0xd9a573e3, 0x5cb33ce6, 0x6bd9fee7, 0x3267b8e5,
+ 0x050d7ae4, 0x384a26ef, 0x0f20e4ee, 0x569ea2ec, 0x61f460ed,
+ 0xe4e22fe8, 0xd388ede9, 0x8a36abeb, 0xbd5c69ea, 0xf0b813fd,
+ 0xc7d2d1fc, 0x9e6c97fe, 0xa90655ff, 0x2c101afa, 0x1b7ad8fb,
+ 0x42c49ef9, 0x75ae5cf8, 0x48e900f3, 0x7f83c2f2, 0x263d84f0,
+ 0x115746f1, 0x944109f4, 0xa32bcbf5, 0xfa958df7, 0xcdff4ff6,
+ 0x605d78d9, 0x5737bad8, 0x0e89fcda, 0x39e33edb, 0xbcf571de,
+ 0x8b9fb3df, 0xd221f5dd, 0xe54b37dc, 0xd80c6bd7, 0xef66a9d6,
+ 0xb6d8efd4, 0x81b22dd5, 0x04a462d0, 0x33cea0d1, 0x6a70e6d3,
+ 0x5d1a24d2, 0x10fe5ec5, 0x27949cc4, 0x7e2adac6, 0x494018c7,
+ 0xcc5657c2, 0xfb3c95c3, 0xa282d3c1, 0x95e811c0, 0xa8af4dcb,
+ 0x9fc58fca, 0xc67bc9c8, 0xf1110bc9, 0x740744cc, 0x436d86cd,
+ 0x1ad3c0cf, 0x2db902ce, 0x4096af91, 0x77fc6d90, 0x2e422b92,
+ 0x1928e993, 0x9c3ea696, 0xab546497, 0xf2ea2295, 0xc580e094,
+ 0xf8c7bc9f, 0xcfad7e9e, 0x9613389c, 0xa179fa9d, 0x246fb598,
+ 0x13057799, 0x4abb319b, 0x7dd1f39a, 0x3035898d, 0x075f4b8c,
+ 0x5ee10d8e, 0x698bcf8f, 0xec9d808a, 0xdbf7428b, 0x82490489,
+ 0xb523c688, 0x88649a83, 0xbf0e5882, 0xe6b01e80, 0xd1dadc81,
+ 0x54cc9384, 0x63a65185, 0x3a181787, 0x0d72d586, 0xa0d0e2a9,
+ 0x97ba20a8, 0xce0466aa, 0xf96ea4ab, 0x7c78ebae, 0x4b1229af,
+ 0x12ac6fad, 0x25c6adac, 0x1881f1a7, 0x2feb33a6, 0x765575a4,
+ 0x413fb7a5, 0xc429f8a0, 0xf3433aa1, 0xaafd7ca3, 0x9d97bea2,
+ 0xd073c4b5, 0xe71906b4, 0xbea740b6, 0x89cd82b7, 0x0cdbcdb2,
+ 0x3bb10fb3, 0x620f49b1, 0x55658bb0, 0x6822d7bb, 0x5f4815ba,
+ 0x06f653b8, 0x319c91b9, 0xb48adebc, 0x83e01cbd, 0xda5e5abf,
+ 0xed3498be},
+ {0x00000000, 0x6567bcb8, 0x8bc809aa, 0xeeafb512, 0x5797628f,
+ 0x32f0de37, 0xdc5f6b25, 0xb938d79d, 0xef28b4c5, 0x8a4f087d,
+ 0x64e0bd6f, 0x018701d7, 0xb8bfd64a, 0xddd86af2, 0x3377dfe0,
+ 0x56106358, 0x9f571950, 0xfa30a5e8, 0x149f10fa, 0x71f8ac42,
+ 0xc8c07bdf, 0xada7c767, 0x43087275, 0x266fcecd, 0x707fad95,
+ 0x1518112d, 0xfbb7a43f, 0x9ed01887, 0x27e8cf1a, 0x428f73a2,
+ 0xac20c6b0, 0xc9477a08, 0x3eaf32a0, 0x5bc88e18, 0xb5673b0a,
+ 0xd00087b2, 0x6938502f, 0x0c5fec97, 0xe2f05985, 0x8797e53d,
+ 0xd1878665, 0xb4e03add, 0x5a4f8fcf, 0x3f283377, 0x8610e4ea,
+ 0xe3775852, 0x0dd8ed40, 0x68bf51f8, 0xa1f82bf0, 0xc49f9748,
+ 0x2a30225a, 0x4f579ee2, 0xf66f497f, 0x9308f5c7, 0x7da740d5,
+ 0x18c0fc6d, 0x4ed09f35, 0x2bb7238d, 0xc518969f, 0xa07f2a27,
+ 0x1947fdba, 0x7c204102, 0x928ff410, 0xf7e848a8, 0x3d58149b,
+ 0x583fa823, 0xb6901d31, 0xd3f7a189, 0x6acf7614, 0x0fa8caac,
+ 0xe1077fbe, 0x8460c306, 0xd270a05e, 0xb7171ce6, 0x59b8a9f4,
+ 0x3cdf154c, 0x85e7c2d1, 0xe0807e69, 0x0e2fcb7b, 0x6b4877c3,
+ 0xa20f0dcb, 0xc768b173, 0x29c70461, 0x4ca0b8d9, 0xf5986f44,
+ 0x90ffd3fc, 0x7e5066ee, 0x1b37da56, 0x4d27b90e, 0x284005b6,
+ 0xc6efb0a4, 0xa3880c1c, 0x1ab0db81, 0x7fd76739, 0x9178d22b,
+ 0xf41f6e93, 0x03f7263b, 0x66909a83, 0x883f2f91, 0xed589329,
+ 0x546044b4, 0x3107f80c, 0xdfa84d1e, 0xbacff1a6, 0xecdf92fe,
+ 0x89b82e46, 0x67179b54, 0x027027ec, 0xbb48f071, 0xde2f4cc9,
+ 0x3080f9db, 0x55e74563, 0x9ca03f6b, 0xf9c783d3, 0x176836c1,
+ 0x720f8a79, 0xcb375de4, 0xae50e15c, 0x40ff544e, 0x2598e8f6,
+ 0x73888bae, 0x16ef3716, 0xf8408204, 0x9d273ebc, 0x241fe921,
+ 0x41785599, 0xafd7e08b, 0xcab05c33, 0x3bb659ed, 0x5ed1e555,
+ 0xb07e5047, 0xd519ecff, 0x6c213b62, 0x094687da, 0xe7e932c8,
+ 0x828e8e70, 0xd49eed28, 0xb1f95190, 0x5f56e482, 0x3a31583a,
+ 0x83098fa7, 0xe66e331f, 0x08c1860d, 0x6da63ab5, 0xa4e140bd,
+ 0xc186fc05, 0x2f294917, 0x4a4ef5af, 0xf3762232, 0x96119e8a,
+ 0x78be2b98, 0x1dd99720, 0x4bc9f478, 0x2eae48c0, 0xc001fdd2,
+ 0xa566416a, 0x1c5e96f7, 0x79392a4f, 0x97969f5d, 0xf2f123e5,
+ 0x05196b4d, 0x607ed7f5, 0x8ed162e7, 0xebb6de5f, 0x528e09c2,
+ 0x37e9b57a, 0xd9460068, 0xbc21bcd0, 0xea31df88, 0x8f566330,
+ 0x61f9d622, 0x049e6a9a, 0xbda6bd07, 0xd8c101bf, 0x366eb4ad,
+ 0x53090815, 0x9a4e721d, 0xff29cea5, 0x11867bb7, 0x74e1c70f,
+ 0xcdd91092, 0xa8beac2a, 0x46111938, 0x2376a580, 0x7566c6d8,
+ 0x10017a60, 0xfeaecf72, 0x9bc973ca, 0x22f1a457, 0x479618ef,
+ 0xa939adfd, 0xcc5e1145, 0x06ee4d76, 0x6389f1ce, 0x8d2644dc,
+ 0xe841f864, 0x51792ff9, 0x341e9341, 0xdab12653, 0xbfd69aeb,
+ 0xe9c6f9b3, 0x8ca1450b, 0x620ef019, 0x07694ca1, 0xbe519b3c,
+ 0xdb362784, 0x35999296, 0x50fe2e2e, 0x99b95426, 0xfcdee89e,
+ 0x12715d8c, 0x7716e134, 0xce2e36a9, 0xab498a11, 0x45e63f03,
+ 0x208183bb, 0x7691e0e3, 0x13f65c5b, 0xfd59e949, 0x983e55f1,
+ 0x2106826c, 0x44613ed4, 0xaace8bc6, 0xcfa9377e, 0x38417fd6,
+ 0x5d26c36e, 0xb389767c, 0xd6eecac4, 0x6fd61d59, 0x0ab1a1e1,
+ 0xe41e14f3, 0x8179a84b, 0xd769cb13, 0xb20e77ab, 0x5ca1c2b9,
+ 0x39c67e01, 0x80fea99c, 0xe5991524, 0x0b36a036, 0x6e511c8e,
+ 0xa7166686, 0xc271da3e, 0x2cde6f2c, 0x49b9d394, 0xf0810409,
+ 0x95e6b8b1, 0x7b490da3, 0x1e2eb11b, 0x483ed243, 0x2d596efb,
+ 0xc3f6dbe9, 0xa6916751, 0x1fa9b0cc, 0x7ace0c74, 0x9461b966,
+ 0xf10605de}};
+
+#endif
+
+#endif
+
+#if N == 2
+
+#if W == 8
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0xae689191, 0x87a02563, 0x29c8b4f2, 0xd4314c87,
+ 0x7a59dd16, 0x539169e4, 0xfdf9f875, 0x73139f4f, 0xdd7b0ede,
+ 0xf4b3ba2c, 0x5adb2bbd, 0xa722d3c8, 0x094a4259, 0x2082f6ab,
+ 0x8eea673a, 0xe6273e9e, 0x484faf0f, 0x61871bfd, 0xcfef8a6c,
+ 0x32167219, 0x9c7ee388, 0xb5b6577a, 0x1bdec6eb, 0x9534a1d1,
+ 0x3b5c3040, 0x129484b2, 0xbcfc1523, 0x4105ed56, 0xef6d7cc7,
+ 0xc6a5c835, 0x68cd59a4, 0x173f7b7d, 0xb957eaec, 0x909f5e1e,
+ 0x3ef7cf8f, 0xc30e37fa, 0x6d66a66b, 0x44ae1299, 0xeac68308,
+ 0x642ce432, 0xca4475a3, 0xe38cc151, 0x4de450c0, 0xb01da8b5,
+ 0x1e753924, 0x37bd8dd6, 0x99d51c47, 0xf11845e3, 0x5f70d472,
+ 0x76b86080, 0xd8d0f111, 0x25290964, 0x8b4198f5, 0xa2892c07,
+ 0x0ce1bd96, 0x820bdaac, 0x2c634b3d, 0x05abffcf, 0xabc36e5e,
+ 0x563a962b, 0xf85207ba, 0xd19ab348, 0x7ff222d9, 0x2e7ef6fa,
+ 0x8016676b, 0xa9ded399, 0x07b64208, 0xfa4fba7d, 0x54272bec,
+ 0x7def9f1e, 0xd3870e8f, 0x5d6d69b5, 0xf305f824, 0xdacd4cd6,
+ 0x74a5dd47, 0x895c2532, 0x2734b4a3, 0x0efc0051, 0xa09491c0,
+ 0xc859c864, 0x663159f5, 0x4ff9ed07, 0xe1917c96, 0x1c6884e3,
+ 0xb2001572, 0x9bc8a180, 0x35a03011, 0xbb4a572b, 0x1522c6ba,
+ 0x3cea7248, 0x9282e3d9, 0x6f7b1bac, 0xc1138a3d, 0xe8db3ecf,
+ 0x46b3af5e, 0x39418d87, 0x97291c16, 0xbee1a8e4, 0x10893975,
+ 0xed70c100, 0x43185091, 0x6ad0e463, 0xc4b875f2, 0x4a5212c8,
+ 0xe43a8359, 0xcdf237ab, 0x639aa63a, 0x9e635e4f, 0x300bcfde,
+ 0x19c37b2c, 0xb7abeabd, 0xdf66b319, 0x710e2288, 0x58c6967a,
+ 0xf6ae07eb, 0x0b57ff9e, 0xa53f6e0f, 0x8cf7dafd, 0x229f4b6c,
+ 0xac752c56, 0x021dbdc7, 0x2bd50935, 0x85bd98a4, 0x784460d1,
+ 0xd62cf140, 0xffe445b2, 0x518cd423, 0x5cfdedf4, 0xf2957c65,
+ 0xdb5dc897, 0x75355906, 0x88cca173, 0x26a430e2, 0x0f6c8410,
+ 0xa1041581, 0x2fee72bb, 0x8186e32a, 0xa84e57d8, 0x0626c649,
+ 0xfbdf3e3c, 0x55b7afad, 0x7c7f1b5f, 0xd2178ace, 0xbadad36a,
+ 0x14b242fb, 0x3d7af609, 0x93126798, 0x6eeb9fed, 0xc0830e7c,
+ 0xe94bba8e, 0x47232b1f, 0xc9c94c25, 0x67a1ddb4, 0x4e696946,
+ 0xe001f8d7, 0x1df800a2, 0xb3909133, 0x9a5825c1, 0x3430b450,
+ 0x4bc29689, 0xe5aa0718, 0xcc62b3ea, 0x620a227b, 0x9ff3da0e,
+ 0x319b4b9f, 0x1853ff6d, 0xb63b6efc, 0x38d109c6, 0x96b99857,
+ 0xbf712ca5, 0x1119bd34, 0xece04541, 0x4288d4d0, 0x6b406022,
+ 0xc528f1b3, 0xade5a817, 0x038d3986, 0x2a458d74, 0x842d1ce5,
+ 0x79d4e490, 0xd7bc7501, 0xfe74c1f3, 0x501c5062, 0xdef63758,
+ 0x709ea6c9, 0x5956123b, 0xf73e83aa, 0x0ac77bdf, 0xa4afea4e,
+ 0x8d675ebc, 0x230fcf2d, 0x72831b0e, 0xdceb8a9f, 0xf5233e6d,
+ 0x5b4baffc, 0xa6b25789, 0x08dac618, 0x211272ea, 0x8f7ae37b,
+ 0x01908441, 0xaff815d0, 0x8630a122, 0x285830b3, 0xd5a1c8c6,
+ 0x7bc95957, 0x5201eda5, 0xfc697c34, 0x94a42590, 0x3accb401,
+ 0x130400f3, 0xbd6c9162, 0x40956917, 0xeefdf886, 0xc7354c74,
+ 0x695ddde5, 0xe7b7badf, 0x49df2b4e, 0x60179fbc, 0xce7f0e2d,
+ 0x3386f658, 0x9dee67c9, 0xb426d33b, 0x1a4e42aa, 0x65bc6073,
+ 0xcbd4f1e2, 0xe21c4510, 0x4c74d481, 0xb18d2cf4, 0x1fe5bd65,
+ 0x362d0997, 0x98459806, 0x16afff3c, 0xb8c76ead, 0x910fda5f,
+ 0x3f674bce, 0xc29eb3bb, 0x6cf6222a, 0x453e96d8, 0xeb560749,
+ 0x839b5eed, 0x2df3cf7c, 0x043b7b8e, 0xaa53ea1f, 0x57aa126a,
+ 0xf9c283fb, 0xd00a3709, 0x7e62a698, 0xf088c1a2, 0x5ee05033,
+ 0x7728e4c1, 0xd9407550, 0x24b98d25, 0x8ad11cb4, 0xa319a846,
+ 0x0d7139d7},
+ {0x00000000, 0xb9fbdbe8, 0xa886b191, 0x117d6a79, 0x8a7c6563,
+ 0x3387be8b, 0x22fad4f2, 0x9b010f1a, 0xcf89cc87, 0x7672176f,
+ 0x670f7d16, 0xdef4a6fe, 0x45f5a9e4, 0xfc0e720c, 0xed731875,
+ 0x5488c39d, 0x44629f4f, 0xfd9944a7, 0xece42ede, 0x551ff536,
+ 0xce1efa2c, 0x77e521c4, 0x66984bbd, 0xdf639055, 0x8beb53c8,
+ 0x32108820, 0x236de259, 0x9a9639b1, 0x019736ab, 0xb86ced43,
+ 0xa911873a, 0x10ea5cd2, 0x88c53e9e, 0x313ee576, 0x20438f0f,
+ 0x99b854e7, 0x02b95bfd, 0xbb428015, 0xaa3fea6c, 0x13c43184,
+ 0x474cf219, 0xfeb729f1, 0xefca4388, 0x56319860, 0xcd30977a,
+ 0x74cb4c92, 0x65b626eb, 0xdc4dfd03, 0xcca7a1d1, 0x755c7a39,
+ 0x64211040, 0xdddacba8, 0x46dbc4b2, 0xff201f5a, 0xee5d7523,
+ 0x57a6aecb, 0x032e6d56, 0xbad5b6be, 0xaba8dcc7, 0x1253072f,
+ 0x89520835, 0x30a9d3dd, 0x21d4b9a4, 0x982f624c, 0xcafb7b7d,
+ 0x7300a095, 0x627dcaec, 0xdb861104, 0x40871e1e, 0xf97cc5f6,
+ 0xe801af8f, 0x51fa7467, 0x0572b7fa, 0xbc896c12, 0xadf4066b,
+ 0x140fdd83, 0x8f0ed299, 0x36f50971, 0x27886308, 0x9e73b8e0,
+ 0x8e99e432, 0x37623fda, 0x261f55a3, 0x9fe48e4b, 0x04e58151,
+ 0xbd1e5ab9, 0xac6330c0, 0x1598eb28, 0x411028b5, 0xf8ebf35d,
+ 0xe9969924, 0x506d42cc, 0xcb6c4dd6, 0x7297963e, 0x63eafc47,
+ 0xda1127af, 0x423e45e3, 0xfbc59e0b, 0xeab8f472, 0x53432f9a,
+ 0xc8422080, 0x71b9fb68, 0x60c49111, 0xd93f4af9, 0x8db78964,
+ 0x344c528c, 0x253138f5, 0x9ccae31d, 0x07cbec07, 0xbe3037ef,
+ 0xaf4d5d96, 0x16b6867e, 0x065cdaac, 0xbfa70144, 0xaeda6b3d,
+ 0x1721b0d5, 0x8c20bfcf, 0x35db6427, 0x24a60e5e, 0x9d5dd5b6,
+ 0xc9d5162b, 0x702ecdc3, 0x6153a7ba, 0xd8a87c52, 0x43a97348,
+ 0xfa52a8a0, 0xeb2fc2d9, 0x52d41931, 0x4e87f0bb, 0xf77c2b53,
+ 0xe601412a, 0x5ffa9ac2, 0xc4fb95d8, 0x7d004e30, 0x6c7d2449,
+ 0xd586ffa1, 0x810e3c3c, 0x38f5e7d4, 0x29888dad, 0x90735645,
+ 0x0b72595f, 0xb28982b7, 0xa3f4e8ce, 0x1a0f3326, 0x0ae56ff4,
+ 0xb31eb41c, 0xa263de65, 0x1b98058d, 0x80990a97, 0x3962d17f,
+ 0x281fbb06, 0x91e460ee, 0xc56ca373, 0x7c97789b, 0x6dea12e2,
+ 0xd411c90a, 0x4f10c610, 0xf6eb1df8, 0xe7967781, 0x5e6dac69,
+ 0xc642ce25, 0x7fb915cd, 0x6ec47fb4, 0xd73fa45c, 0x4c3eab46,
+ 0xf5c570ae, 0xe4b81ad7, 0x5d43c13f, 0x09cb02a2, 0xb030d94a,
+ 0xa14db333, 0x18b668db, 0x83b767c1, 0x3a4cbc29, 0x2b31d650,
+ 0x92ca0db8, 0x8220516a, 0x3bdb8a82, 0x2aa6e0fb, 0x935d3b13,
+ 0x085c3409, 0xb1a7efe1, 0xa0da8598, 0x19215e70, 0x4da99ded,
+ 0xf4524605, 0xe52f2c7c, 0x5cd4f794, 0xc7d5f88e, 0x7e2e2366,
+ 0x6f53491f, 0xd6a892f7, 0x847c8bc6, 0x3d87502e, 0x2cfa3a57,
+ 0x9501e1bf, 0x0e00eea5, 0xb7fb354d, 0xa6865f34, 0x1f7d84dc,
+ 0x4bf54741, 0xf20e9ca9, 0xe373f6d0, 0x5a882d38, 0xc1892222,
+ 0x7872f9ca, 0x690f93b3, 0xd0f4485b, 0xc01e1489, 0x79e5cf61,
+ 0x6898a518, 0xd1637ef0, 0x4a6271ea, 0xf399aa02, 0xe2e4c07b,
+ 0x5b1f1b93, 0x0f97d80e, 0xb66c03e6, 0xa711699f, 0x1eeab277,
+ 0x85ebbd6d, 0x3c106685, 0x2d6d0cfc, 0x9496d714, 0x0cb9b558,
+ 0xb5426eb0, 0xa43f04c9, 0x1dc4df21, 0x86c5d03b, 0x3f3e0bd3,
+ 0x2e4361aa, 0x97b8ba42, 0xc33079df, 0x7acba237, 0x6bb6c84e,
+ 0xd24d13a6, 0x494c1cbc, 0xf0b7c754, 0xe1caad2d, 0x583176c5,
+ 0x48db2a17, 0xf120f1ff, 0xe05d9b86, 0x59a6406e, 0xc2a74f74,
+ 0x7b5c949c, 0x6a21fee5, 0xd3da250d, 0x8752e690, 0x3ea93d78,
+ 0x2fd45701, 0x962f8ce9, 0x0d2e83f3, 0xb4d5581b, 0xa5a83262,
+ 0x1c53e98a},
+ {0x00000000, 0x9d0fe176, 0xe16ec4ad, 0x7c6125db, 0x19ac8f1b,
+ 0x84a36e6d, 0xf8c24bb6, 0x65cdaac0, 0x33591e36, 0xae56ff40,
+ 0xd237da9b, 0x4f383bed, 0x2af5912d, 0xb7fa705b, 0xcb9b5580,
+ 0x5694b4f6, 0x66b23c6c, 0xfbbddd1a, 0x87dcf8c1, 0x1ad319b7,
+ 0x7f1eb377, 0xe2115201, 0x9e7077da, 0x037f96ac, 0x55eb225a,
+ 0xc8e4c32c, 0xb485e6f7, 0x298a0781, 0x4c47ad41, 0xd1484c37,
+ 0xad2969ec, 0x3026889a, 0xcd6478d8, 0x506b99ae, 0x2c0abc75,
+ 0xb1055d03, 0xd4c8f7c3, 0x49c716b5, 0x35a6336e, 0xa8a9d218,
+ 0xfe3d66ee, 0x63328798, 0x1f53a243, 0x825c4335, 0xe791e9f5,
+ 0x7a9e0883, 0x06ff2d58, 0x9bf0cc2e, 0xabd644b4, 0x36d9a5c2,
+ 0x4ab88019, 0xd7b7616f, 0xb27acbaf, 0x2f752ad9, 0x53140f02,
+ 0xce1bee74, 0x988f5a82, 0x0580bbf4, 0x79e19e2f, 0xe4ee7f59,
+ 0x8123d599, 0x1c2c34ef, 0x604d1134, 0xfd42f042, 0x41b9f7f1,
+ 0xdcb61687, 0xa0d7335c, 0x3dd8d22a, 0x581578ea, 0xc51a999c,
+ 0xb97bbc47, 0x24745d31, 0x72e0e9c7, 0xefef08b1, 0x938e2d6a,
+ 0x0e81cc1c, 0x6b4c66dc, 0xf64387aa, 0x8a22a271, 0x172d4307,
+ 0x270bcb9d, 0xba042aeb, 0xc6650f30, 0x5b6aee46, 0x3ea74486,
+ 0xa3a8a5f0, 0xdfc9802b, 0x42c6615d, 0x1452d5ab, 0x895d34dd,
+ 0xf53c1106, 0x6833f070, 0x0dfe5ab0, 0x90f1bbc6, 0xec909e1d,
+ 0x719f7f6b, 0x8cdd8f29, 0x11d26e5f, 0x6db34b84, 0xf0bcaaf2,
+ 0x95710032, 0x087ee144, 0x741fc49f, 0xe91025e9, 0xbf84911f,
+ 0x228b7069, 0x5eea55b2, 0xc3e5b4c4, 0xa6281e04, 0x3b27ff72,
+ 0x4746daa9, 0xda493bdf, 0xea6fb345, 0x77605233, 0x0b0177e8,
+ 0x960e969e, 0xf3c33c5e, 0x6eccdd28, 0x12adf8f3, 0x8fa21985,
+ 0xd936ad73, 0x44394c05, 0x385869de, 0xa55788a8, 0xc09a2268,
+ 0x5d95c31e, 0x21f4e6c5, 0xbcfb07b3, 0x8373efe2, 0x1e7c0e94,
+ 0x621d2b4f, 0xff12ca39, 0x9adf60f9, 0x07d0818f, 0x7bb1a454,
+ 0xe6be4522, 0xb02af1d4, 0x2d2510a2, 0x51443579, 0xcc4bd40f,
+ 0xa9867ecf, 0x34899fb9, 0x48e8ba62, 0xd5e75b14, 0xe5c1d38e,
+ 0x78ce32f8, 0x04af1723, 0x99a0f655, 0xfc6d5c95, 0x6162bde3,
+ 0x1d039838, 0x800c794e, 0xd698cdb8, 0x4b972cce, 0x37f60915,
+ 0xaaf9e863, 0xcf3442a3, 0x523ba3d5, 0x2e5a860e, 0xb3556778,
+ 0x4e17973a, 0xd318764c, 0xaf795397, 0x3276b2e1, 0x57bb1821,
+ 0xcab4f957, 0xb6d5dc8c, 0x2bda3dfa, 0x7d4e890c, 0xe041687a,
+ 0x9c204da1, 0x012facd7, 0x64e20617, 0xf9ede761, 0x858cc2ba,
+ 0x188323cc, 0x28a5ab56, 0xb5aa4a20, 0xc9cb6ffb, 0x54c48e8d,
+ 0x3109244d, 0xac06c53b, 0xd067e0e0, 0x4d680196, 0x1bfcb560,
+ 0x86f35416, 0xfa9271cd, 0x679d90bb, 0x02503a7b, 0x9f5fdb0d,
+ 0xe33efed6, 0x7e311fa0, 0xc2ca1813, 0x5fc5f965, 0x23a4dcbe,
+ 0xbeab3dc8, 0xdb669708, 0x4669767e, 0x3a0853a5, 0xa707b2d3,
+ 0xf1930625, 0x6c9ce753, 0x10fdc288, 0x8df223fe, 0xe83f893e,
+ 0x75306848, 0x09514d93, 0x945eace5, 0xa478247f, 0x3977c509,
+ 0x4516e0d2, 0xd81901a4, 0xbdd4ab64, 0x20db4a12, 0x5cba6fc9,
+ 0xc1b58ebf, 0x97213a49, 0x0a2edb3f, 0x764ffee4, 0xeb401f92,
+ 0x8e8db552, 0x13825424, 0x6fe371ff, 0xf2ec9089, 0x0fae60cb,
+ 0x92a181bd, 0xeec0a466, 0x73cf4510, 0x1602efd0, 0x8b0d0ea6,
+ 0xf76c2b7d, 0x6a63ca0b, 0x3cf77efd, 0xa1f89f8b, 0xdd99ba50,
+ 0x40965b26, 0x255bf1e6, 0xb8541090, 0xc435354b, 0x593ad43d,
+ 0x691c5ca7, 0xf413bdd1, 0x8872980a, 0x157d797c, 0x70b0d3bc,
+ 0xedbf32ca, 0x91de1711, 0x0cd1f667, 0x5a454291, 0xc74aa3e7,
+ 0xbb2b863c, 0x2624674a, 0x43e9cd8a, 0xdee62cfc, 0xa2870927,
+ 0x3f88e851},
+ {0x00000000, 0xdd96d985, 0x605cb54b, 0xbdca6cce, 0xc0b96a96,
+ 0x1d2fb313, 0xa0e5dfdd, 0x7d730658, 0x5a03d36d, 0x87950ae8,
+ 0x3a5f6626, 0xe7c9bfa3, 0x9abab9fb, 0x472c607e, 0xfae60cb0,
+ 0x2770d535, 0xb407a6da, 0x69917f5f, 0xd45b1391, 0x09cdca14,
+ 0x74becc4c, 0xa92815c9, 0x14e27907, 0xc974a082, 0xee0475b7,
+ 0x3392ac32, 0x8e58c0fc, 0x53ce1979, 0x2ebd1f21, 0xf32bc6a4,
+ 0x4ee1aa6a, 0x937773ef, 0xb37e4bf5, 0x6ee89270, 0xd322febe,
+ 0x0eb4273b, 0x73c72163, 0xae51f8e6, 0x139b9428, 0xce0d4dad,
+ 0xe97d9898, 0x34eb411d, 0x89212dd3, 0x54b7f456, 0x29c4f20e,
+ 0xf4522b8b, 0x49984745, 0x940e9ec0, 0x0779ed2f, 0xdaef34aa,
+ 0x67255864, 0xbab381e1, 0xc7c087b9, 0x1a565e3c, 0xa79c32f2,
+ 0x7a0aeb77, 0x5d7a3e42, 0x80ece7c7, 0x3d268b09, 0xe0b0528c,
+ 0x9dc354d4, 0x40558d51, 0xfd9fe19f, 0x2009381a, 0xbd8d91ab,
+ 0x601b482e, 0xddd124e0, 0x0047fd65, 0x7d34fb3d, 0xa0a222b8,
+ 0x1d684e76, 0xc0fe97f3, 0xe78e42c6, 0x3a189b43, 0x87d2f78d,
+ 0x5a442e08, 0x27372850, 0xfaa1f1d5, 0x476b9d1b, 0x9afd449e,
+ 0x098a3771, 0xd41ceef4, 0x69d6823a, 0xb4405bbf, 0xc9335de7,
+ 0x14a58462, 0xa96fe8ac, 0x74f93129, 0x5389e41c, 0x8e1f3d99,
+ 0x33d55157, 0xee4388d2, 0x93308e8a, 0x4ea6570f, 0xf36c3bc1,
+ 0x2efae244, 0x0ef3da5e, 0xd36503db, 0x6eaf6f15, 0xb339b690,
+ 0xce4ab0c8, 0x13dc694d, 0xae160583, 0x7380dc06, 0x54f00933,
+ 0x8966d0b6, 0x34acbc78, 0xe93a65fd, 0x944963a5, 0x49dfba20,
+ 0xf415d6ee, 0x29830f6b, 0xbaf47c84, 0x6762a501, 0xdaa8c9cf,
+ 0x073e104a, 0x7a4d1612, 0xa7dbcf97, 0x1a11a359, 0xc7877adc,
+ 0xe0f7afe9, 0x3d61766c, 0x80ab1aa2, 0x5d3dc327, 0x204ec57f,
+ 0xfdd81cfa, 0x40127034, 0x9d84a9b1, 0xa06a2517, 0x7dfcfc92,
+ 0xc036905c, 0x1da049d9, 0x60d34f81, 0xbd459604, 0x008ffaca,
+ 0xdd19234f, 0xfa69f67a, 0x27ff2fff, 0x9a354331, 0x47a39ab4,
+ 0x3ad09cec, 0xe7464569, 0x5a8c29a7, 0x871af022, 0x146d83cd,
+ 0xc9fb5a48, 0x74313686, 0xa9a7ef03, 0xd4d4e95b, 0x094230de,
+ 0xb4885c10, 0x691e8595, 0x4e6e50a0, 0x93f88925, 0x2e32e5eb,
+ 0xf3a43c6e, 0x8ed73a36, 0x5341e3b3, 0xee8b8f7d, 0x331d56f8,
+ 0x13146ee2, 0xce82b767, 0x7348dba9, 0xaede022c, 0xd3ad0474,
+ 0x0e3bddf1, 0xb3f1b13f, 0x6e6768ba, 0x4917bd8f, 0x9481640a,
+ 0x294b08c4, 0xf4ddd141, 0x89aed719, 0x54380e9c, 0xe9f26252,
+ 0x3464bbd7, 0xa713c838, 0x7a8511bd, 0xc74f7d73, 0x1ad9a4f6,
+ 0x67aaa2ae, 0xba3c7b2b, 0x07f617e5, 0xda60ce60, 0xfd101b55,
+ 0x2086c2d0, 0x9d4cae1e, 0x40da779b, 0x3da971c3, 0xe03fa846,
+ 0x5df5c488, 0x80631d0d, 0x1de7b4bc, 0xc0716d39, 0x7dbb01f7,
+ 0xa02dd872, 0xdd5ede2a, 0x00c807af, 0xbd026b61, 0x6094b2e4,
+ 0x47e467d1, 0x9a72be54, 0x27b8d29a, 0xfa2e0b1f, 0x875d0d47,
+ 0x5acbd4c2, 0xe701b80c, 0x3a976189, 0xa9e01266, 0x7476cbe3,
+ 0xc9bca72d, 0x142a7ea8, 0x695978f0, 0xb4cfa175, 0x0905cdbb,
+ 0xd493143e, 0xf3e3c10b, 0x2e75188e, 0x93bf7440, 0x4e29adc5,
+ 0x335aab9d, 0xeecc7218, 0x53061ed6, 0x8e90c753, 0xae99ff49,
+ 0x730f26cc, 0xcec54a02, 0x13539387, 0x6e2095df, 0xb3b64c5a,
+ 0x0e7c2094, 0xd3eaf911, 0xf49a2c24, 0x290cf5a1, 0x94c6996f,
+ 0x495040ea, 0x342346b2, 0xe9b59f37, 0x547ff3f9, 0x89e92a7c,
+ 0x1a9e5993, 0xc7088016, 0x7ac2ecd8, 0xa754355d, 0xda273305,
+ 0x07b1ea80, 0xba7b864e, 0x67ed5fcb, 0x409d8afe, 0x9d0b537b,
+ 0x20c13fb5, 0xfd57e630, 0x8024e068, 0x5db239ed, 0xe0785523,
+ 0x3dee8ca6},
+ {0x00000000, 0x9ba54c6f, 0xec3b9e9f, 0x779ed2f0, 0x03063b7f,
+ 0x98a37710, 0xef3da5e0, 0x7498e98f, 0x060c76fe, 0x9da93a91,
+ 0xea37e861, 0x7192a40e, 0x050a4d81, 0x9eaf01ee, 0xe931d31e,
+ 0x72949f71, 0x0c18edfc, 0x97bda193, 0xe0237363, 0x7b863f0c,
+ 0x0f1ed683, 0x94bb9aec, 0xe325481c, 0x78800473, 0x0a149b02,
+ 0x91b1d76d, 0xe62f059d, 0x7d8a49f2, 0x0912a07d, 0x92b7ec12,
+ 0xe5293ee2, 0x7e8c728d, 0x1831dbf8, 0x83949797, 0xf40a4567,
+ 0x6faf0908, 0x1b37e087, 0x8092ace8, 0xf70c7e18, 0x6ca93277,
+ 0x1e3dad06, 0x8598e169, 0xf2063399, 0x69a37ff6, 0x1d3b9679,
+ 0x869eda16, 0xf10008e6, 0x6aa54489, 0x14293604, 0x8f8c7a6b,
+ 0xf812a89b, 0x63b7e4f4, 0x172f0d7b, 0x8c8a4114, 0xfb1493e4,
+ 0x60b1df8b, 0x122540fa, 0x89800c95, 0xfe1ede65, 0x65bb920a,
+ 0x11237b85, 0x8a8637ea, 0xfd18e51a, 0x66bda975, 0x3063b7f0,
+ 0xabc6fb9f, 0xdc58296f, 0x47fd6500, 0x33658c8f, 0xa8c0c0e0,
+ 0xdf5e1210, 0x44fb5e7f, 0x366fc10e, 0xadca8d61, 0xda545f91,
+ 0x41f113fe, 0x3569fa71, 0xaeccb61e, 0xd95264ee, 0x42f72881,
+ 0x3c7b5a0c, 0xa7de1663, 0xd040c493, 0x4be588fc, 0x3f7d6173,
+ 0xa4d82d1c, 0xd346ffec, 0x48e3b383, 0x3a772cf2, 0xa1d2609d,
+ 0xd64cb26d, 0x4de9fe02, 0x3971178d, 0xa2d45be2, 0xd54a8912,
+ 0x4eefc57d, 0x28526c08, 0xb3f72067, 0xc469f297, 0x5fccbef8,
+ 0x2b545777, 0xb0f11b18, 0xc76fc9e8, 0x5cca8587, 0x2e5e1af6,
+ 0xb5fb5699, 0xc2658469, 0x59c0c806, 0x2d582189, 0xb6fd6de6,
+ 0xc163bf16, 0x5ac6f379, 0x244a81f4, 0xbfefcd9b, 0xc8711f6b,
+ 0x53d45304, 0x274cba8b, 0xbce9f6e4, 0xcb772414, 0x50d2687b,
+ 0x2246f70a, 0xb9e3bb65, 0xce7d6995, 0x55d825fa, 0x2140cc75,
+ 0xbae5801a, 0xcd7b52ea, 0x56de1e85, 0x60c76fe0, 0xfb62238f,
+ 0x8cfcf17f, 0x1759bd10, 0x63c1549f, 0xf86418f0, 0x8ffaca00,
+ 0x145f866f, 0x66cb191e, 0xfd6e5571, 0x8af08781, 0x1155cbee,
+ 0x65cd2261, 0xfe686e0e, 0x89f6bcfe, 0x1253f091, 0x6cdf821c,
+ 0xf77ace73, 0x80e41c83, 0x1b4150ec, 0x6fd9b963, 0xf47cf50c,
+ 0x83e227fc, 0x18476b93, 0x6ad3f4e2, 0xf176b88d, 0x86e86a7d,
+ 0x1d4d2612, 0x69d5cf9d, 0xf27083f2, 0x85ee5102, 0x1e4b1d6d,
+ 0x78f6b418, 0xe353f877, 0x94cd2a87, 0x0f6866e8, 0x7bf08f67,
+ 0xe055c308, 0x97cb11f8, 0x0c6e5d97, 0x7efac2e6, 0xe55f8e89,
+ 0x92c15c79, 0x09641016, 0x7dfcf999, 0xe659b5f6, 0x91c76706,
+ 0x0a622b69, 0x74ee59e4, 0xef4b158b, 0x98d5c77b, 0x03708b14,
+ 0x77e8629b, 0xec4d2ef4, 0x9bd3fc04, 0x0076b06b, 0x72e22f1a,
+ 0xe9476375, 0x9ed9b185, 0x057cfdea, 0x71e41465, 0xea41580a,
+ 0x9ddf8afa, 0x067ac695, 0x50a4d810, 0xcb01947f, 0xbc9f468f,
+ 0x273a0ae0, 0x53a2e36f, 0xc807af00, 0xbf997df0, 0x243c319f,
+ 0x56a8aeee, 0xcd0de281, 0xba933071, 0x21367c1e, 0x55ae9591,
+ 0xce0bd9fe, 0xb9950b0e, 0x22304761, 0x5cbc35ec, 0xc7197983,
+ 0xb087ab73, 0x2b22e71c, 0x5fba0e93, 0xc41f42fc, 0xb381900c,
+ 0x2824dc63, 0x5ab04312, 0xc1150f7d, 0xb68bdd8d, 0x2d2e91e2,
+ 0x59b6786d, 0xc2133402, 0xb58de6f2, 0x2e28aa9d, 0x489503e8,
+ 0xd3304f87, 0xa4ae9d77, 0x3f0bd118, 0x4b933897, 0xd03674f8,
+ 0xa7a8a608, 0x3c0dea67, 0x4e997516, 0xd53c3979, 0xa2a2eb89,
+ 0x3907a7e6, 0x4d9f4e69, 0xd63a0206, 0xa1a4d0f6, 0x3a019c99,
+ 0x448dee14, 0xdf28a27b, 0xa8b6708b, 0x33133ce4, 0x478bd56b,
+ 0xdc2e9904, 0xabb04bf4, 0x3015079b, 0x428198ea, 0xd924d485,
+ 0xaeba0675, 0x351f4a1a, 0x4187a395, 0xda22effa, 0xadbc3d0a,
+ 0x36197165},
+ {0x00000000, 0xc18edfc0, 0x586cb9c1, 0x99e26601, 0xb0d97382,
+ 0x7157ac42, 0xe8b5ca43, 0x293b1583, 0xbac3e145, 0x7b4d3e85,
+ 0xe2af5884, 0x23218744, 0x0a1a92c7, 0xcb944d07, 0x52762b06,
+ 0x93f8f4c6, 0xaef6c4cb, 0x6f781b0b, 0xf69a7d0a, 0x3714a2ca,
+ 0x1e2fb749, 0xdfa16889, 0x46430e88, 0x87cdd148, 0x1435258e,
+ 0xd5bbfa4e, 0x4c599c4f, 0x8dd7438f, 0xa4ec560c, 0x656289cc,
+ 0xfc80efcd, 0x3d0e300d, 0x869c8fd7, 0x47125017, 0xdef03616,
+ 0x1f7ee9d6, 0x3645fc55, 0xf7cb2395, 0x6e294594, 0xafa79a54,
+ 0x3c5f6e92, 0xfdd1b152, 0x6433d753, 0xa5bd0893, 0x8c861d10,
+ 0x4d08c2d0, 0xd4eaa4d1, 0x15647b11, 0x286a4b1c, 0xe9e494dc,
+ 0x7006f2dd, 0xb1882d1d, 0x98b3389e, 0x593de75e, 0xc0df815f,
+ 0x01515e9f, 0x92a9aa59, 0x53277599, 0xcac51398, 0x0b4bcc58,
+ 0x2270d9db, 0xe3fe061b, 0x7a1c601a, 0xbb92bfda, 0xd64819ef,
+ 0x17c6c62f, 0x8e24a02e, 0x4faa7fee, 0x66916a6d, 0xa71fb5ad,
+ 0x3efdd3ac, 0xff730c6c, 0x6c8bf8aa, 0xad05276a, 0x34e7416b,
+ 0xf5699eab, 0xdc528b28, 0x1ddc54e8, 0x843e32e9, 0x45b0ed29,
+ 0x78bedd24, 0xb93002e4, 0x20d264e5, 0xe15cbb25, 0xc867aea6,
+ 0x09e97166, 0x900b1767, 0x5185c8a7, 0xc27d3c61, 0x03f3e3a1,
+ 0x9a1185a0, 0x5b9f5a60, 0x72a44fe3, 0xb32a9023, 0x2ac8f622,
+ 0xeb4629e2, 0x50d49638, 0x915a49f8, 0x08b82ff9, 0xc936f039,
+ 0xe00de5ba, 0x21833a7a, 0xb8615c7b, 0x79ef83bb, 0xea17777d,
+ 0x2b99a8bd, 0xb27bcebc, 0x73f5117c, 0x5ace04ff, 0x9b40db3f,
+ 0x02a2bd3e, 0xc32c62fe, 0xfe2252f3, 0x3fac8d33, 0xa64eeb32,
+ 0x67c034f2, 0x4efb2171, 0x8f75feb1, 0x169798b0, 0xd7194770,
+ 0x44e1b3b6, 0x856f6c76, 0x1c8d0a77, 0xdd03d5b7, 0xf438c034,
+ 0x35b61ff4, 0xac5479f5, 0x6ddaa635, 0x77e1359f, 0xb66fea5f,
+ 0x2f8d8c5e, 0xee03539e, 0xc738461d, 0x06b699dd, 0x9f54ffdc,
+ 0x5eda201c, 0xcd22d4da, 0x0cac0b1a, 0x954e6d1b, 0x54c0b2db,
+ 0x7dfba758, 0xbc757898, 0x25971e99, 0xe419c159, 0xd917f154,
+ 0x18992e94, 0x817b4895, 0x40f59755, 0x69ce82d6, 0xa8405d16,
+ 0x31a23b17, 0xf02ce4d7, 0x63d41011, 0xa25acfd1, 0x3bb8a9d0,
+ 0xfa367610, 0xd30d6393, 0x1283bc53, 0x8b61da52, 0x4aef0592,
+ 0xf17dba48, 0x30f36588, 0xa9110389, 0x689fdc49, 0x41a4c9ca,
+ 0x802a160a, 0x19c8700b, 0xd846afcb, 0x4bbe5b0d, 0x8a3084cd,
+ 0x13d2e2cc, 0xd25c3d0c, 0xfb67288f, 0x3ae9f74f, 0xa30b914e,
+ 0x62854e8e, 0x5f8b7e83, 0x9e05a143, 0x07e7c742, 0xc6691882,
+ 0xef520d01, 0x2edcd2c1, 0xb73eb4c0, 0x76b06b00, 0xe5489fc6,
+ 0x24c64006, 0xbd242607, 0x7caaf9c7, 0x5591ec44, 0x941f3384,
+ 0x0dfd5585, 0xcc738a45, 0xa1a92c70, 0x6027f3b0, 0xf9c595b1,
+ 0x384b4a71, 0x11705ff2, 0xd0fe8032, 0x491ce633, 0x889239f3,
+ 0x1b6acd35, 0xdae412f5, 0x430674f4, 0x8288ab34, 0xabb3beb7,
+ 0x6a3d6177, 0xf3df0776, 0x3251d8b6, 0x0f5fe8bb, 0xced1377b,
+ 0x5733517a, 0x96bd8eba, 0xbf869b39, 0x7e0844f9, 0xe7ea22f8,
+ 0x2664fd38, 0xb59c09fe, 0x7412d63e, 0xedf0b03f, 0x2c7e6fff,
+ 0x05457a7c, 0xc4cba5bc, 0x5d29c3bd, 0x9ca71c7d, 0x2735a3a7,
+ 0xe6bb7c67, 0x7f591a66, 0xbed7c5a6, 0x97ecd025, 0x56620fe5,
+ 0xcf8069e4, 0x0e0eb624, 0x9df642e2, 0x5c789d22, 0xc59afb23,
+ 0x041424e3, 0x2d2f3160, 0xeca1eea0, 0x754388a1, 0xb4cd5761,
+ 0x89c3676c, 0x484db8ac, 0xd1afdead, 0x1021016d, 0x391a14ee,
+ 0xf894cb2e, 0x6176ad2f, 0xa0f872ef, 0x33008629, 0xf28e59e9,
+ 0x6b6c3fe8, 0xaae2e028, 0x83d9f5ab, 0x42572a6b, 0xdbb54c6a,
+ 0x1a3b93aa},
+ {0x00000000, 0xefc26b3e, 0x04f5d03d, 0xeb37bb03, 0x09eba07a,
+ 0xe629cb44, 0x0d1e7047, 0xe2dc1b79, 0x13d740f4, 0xfc152bca,
+ 0x172290c9, 0xf8e0fbf7, 0x1a3ce08e, 0xf5fe8bb0, 0x1ec930b3,
+ 0xf10b5b8d, 0x27ae81e8, 0xc86cead6, 0x235b51d5, 0xcc993aeb,
+ 0x2e452192, 0xc1874aac, 0x2ab0f1af, 0xc5729a91, 0x3479c11c,
+ 0xdbbbaa22, 0x308c1121, 0xdf4e7a1f, 0x3d926166, 0xd2500a58,
+ 0x3967b15b, 0xd6a5da65, 0x4f5d03d0, 0xa09f68ee, 0x4ba8d3ed,
+ 0xa46ab8d3, 0x46b6a3aa, 0xa974c894, 0x42437397, 0xad8118a9,
+ 0x5c8a4324, 0xb348281a, 0x587f9319, 0xb7bdf827, 0x5561e35e,
+ 0xbaa38860, 0x51943363, 0xbe56585d, 0x68f38238, 0x8731e906,
+ 0x6c065205, 0x83c4393b, 0x61182242, 0x8eda497c, 0x65edf27f,
+ 0x8a2f9941, 0x7b24c2cc, 0x94e6a9f2, 0x7fd112f1, 0x901379cf,
+ 0x72cf62b6, 0x9d0d0988, 0x763ab28b, 0x99f8d9b5, 0x9eba07a0,
+ 0x71786c9e, 0x9a4fd79d, 0x758dbca3, 0x9751a7da, 0x7893cce4,
+ 0x93a477e7, 0x7c661cd9, 0x8d6d4754, 0x62af2c6a, 0x89989769,
+ 0x665afc57, 0x8486e72e, 0x6b448c10, 0x80733713, 0x6fb15c2d,
+ 0xb9148648, 0x56d6ed76, 0xbde15675, 0x52233d4b, 0xb0ff2632,
+ 0x5f3d4d0c, 0xb40af60f, 0x5bc89d31, 0xaac3c6bc, 0x4501ad82,
+ 0xae361681, 0x41f47dbf, 0xa32866c6, 0x4cea0df8, 0xa7ddb6fb,
+ 0x481fddc5, 0xd1e70470, 0x3e256f4e, 0xd512d44d, 0x3ad0bf73,
+ 0xd80ca40a, 0x37cecf34, 0xdcf97437, 0x333b1f09, 0xc2304484,
+ 0x2df22fba, 0xc6c594b9, 0x2907ff87, 0xcbdbe4fe, 0x24198fc0,
+ 0xcf2e34c3, 0x20ec5ffd, 0xf6498598, 0x198beea6, 0xf2bc55a5,
+ 0x1d7e3e9b, 0xffa225e2, 0x10604edc, 0xfb57f5df, 0x14959ee1,
+ 0xe59ec56c, 0x0a5cae52, 0xe16b1551, 0x0ea97e6f, 0xec756516,
+ 0x03b70e28, 0xe880b52b, 0x0742de15, 0xe6050901, 0x09c7623f,
+ 0xe2f0d93c, 0x0d32b202, 0xefeea97b, 0x002cc245, 0xeb1b7946,
+ 0x04d91278, 0xf5d249f5, 0x1a1022cb, 0xf12799c8, 0x1ee5f2f6,
+ 0xfc39e98f, 0x13fb82b1, 0xf8cc39b2, 0x170e528c, 0xc1ab88e9,
+ 0x2e69e3d7, 0xc55e58d4, 0x2a9c33ea, 0xc8402893, 0x278243ad,
+ 0xccb5f8ae, 0x23779390, 0xd27cc81d, 0x3dbea323, 0xd6891820,
+ 0x394b731e, 0xdb976867, 0x34550359, 0xdf62b85a, 0x30a0d364,
+ 0xa9580ad1, 0x469a61ef, 0xadaddaec, 0x426fb1d2, 0xa0b3aaab,
+ 0x4f71c195, 0xa4467a96, 0x4b8411a8, 0xba8f4a25, 0x554d211b,
+ 0xbe7a9a18, 0x51b8f126, 0xb364ea5f, 0x5ca68161, 0xb7913a62,
+ 0x5853515c, 0x8ef68b39, 0x6134e007, 0x8a035b04, 0x65c1303a,
+ 0x871d2b43, 0x68df407d, 0x83e8fb7e, 0x6c2a9040, 0x9d21cbcd,
+ 0x72e3a0f3, 0x99d41bf0, 0x761670ce, 0x94ca6bb7, 0x7b080089,
+ 0x903fbb8a, 0x7ffdd0b4, 0x78bf0ea1, 0x977d659f, 0x7c4ade9c,
+ 0x9388b5a2, 0x7154aedb, 0x9e96c5e5, 0x75a17ee6, 0x9a6315d8,
+ 0x6b684e55, 0x84aa256b, 0x6f9d9e68, 0x805ff556, 0x6283ee2f,
+ 0x8d418511, 0x66763e12, 0x89b4552c, 0x5f118f49, 0xb0d3e477,
+ 0x5be45f74, 0xb426344a, 0x56fa2f33, 0xb938440d, 0x520fff0e,
+ 0xbdcd9430, 0x4cc6cfbd, 0xa304a483, 0x48331f80, 0xa7f174be,
+ 0x452d6fc7, 0xaaef04f9, 0x41d8bffa, 0xae1ad4c4, 0x37e20d71,
+ 0xd820664f, 0x3317dd4c, 0xdcd5b672, 0x3e09ad0b, 0xd1cbc635,
+ 0x3afc7d36, 0xd53e1608, 0x24354d85, 0xcbf726bb, 0x20c09db8,
+ 0xcf02f686, 0x2ddeedff, 0xc21c86c1, 0x292b3dc2, 0xc6e956fc,
+ 0x104c8c99, 0xff8ee7a7, 0x14b95ca4, 0xfb7b379a, 0x19a72ce3,
+ 0xf66547dd, 0x1d52fcde, 0xf29097e0, 0x039bcc6d, 0xec59a753,
+ 0x076e1c50, 0xe8ac776e, 0x0a706c17, 0xe5b20729, 0x0e85bc2a,
+ 0xe147d714},
+ {0x00000000, 0x177b1443, 0x2ef62886, 0x398d3cc5, 0x5dec510c,
+ 0x4a97454f, 0x731a798a, 0x64616dc9, 0xbbd8a218, 0xaca3b65b,
+ 0x952e8a9e, 0x82559edd, 0xe634f314, 0xf14fe757, 0xc8c2db92,
+ 0xdfb9cfd1, 0xacc04271, 0xbbbb5632, 0x82366af7, 0x954d7eb4,
+ 0xf12c137d, 0xe657073e, 0xdfda3bfb, 0xc8a12fb8, 0x1718e069,
+ 0x0063f42a, 0x39eec8ef, 0x2e95dcac, 0x4af4b165, 0x5d8fa526,
+ 0x640299e3, 0x73798da0, 0x82f182a3, 0x958a96e0, 0xac07aa25,
+ 0xbb7cbe66, 0xdf1dd3af, 0xc866c7ec, 0xf1ebfb29, 0xe690ef6a,
+ 0x392920bb, 0x2e5234f8, 0x17df083d, 0x00a41c7e, 0x64c571b7,
+ 0x73be65f4, 0x4a335931, 0x5d484d72, 0x2e31c0d2, 0x394ad491,
+ 0x00c7e854, 0x17bcfc17, 0x73dd91de, 0x64a6859d, 0x5d2bb958,
+ 0x4a50ad1b, 0x95e962ca, 0x82927689, 0xbb1f4a4c, 0xac645e0f,
+ 0xc80533c6, 0xdf7e2785, 0xe6f31b40, 0xf1880f03, 0xde920307,
+ 0xc9e91744, 0xf0642b81, 0xe71f3fc2, 0x837e520b, 0x94054648,
+ 0xad887a8d, 0xbaf36ece, 0x654aa11f, 0x7231b55c, 0x4bbc8999,
+ 0x5cc79dda, 0x38a6f013, 0x2fdde450, 0x1650d895, 0x012bccd6,
+ 0x72524176, 0x65295535, 0x5ca469f0, 0x4bdf7db3, 0x2fbe107a,
+ 0x38c50439, 0x014838fc, 0x16332cbf, 0xc98ae36e, 0xdef1f72d,
+ 0xe77ccbe8, 0xf007dfab, 0x9466b262, 0x831da621, 0xba909ae4,
+ 0xadeb8ea7, 0x5c6381a4, 0x4b1895e7, 0x7295a922, 0x65eebd61,
+ 0x018fd0a8, 0x16f4c4eb, 0x2f79f82e, 0x3802ec6d, 0xe7bb23bc,
+ 0xf0c037ff, 0xc94d0b3a, 0xde361f79, 0xba5772b0, 0xad2c66f3,
+ 0x94a15a36, 0x83da4e75, 0xf0a3c3d5, 0xe7d8d796, 0xde55eb53,
+ 0xc92eff10, 0xad4f92d9, 0xba34869a, 0x83b9ba5f, 0x94c2ae1c,
+ 0x4b7b61cd, 0x5c00758e, 0x658d494b, 0x72f65d08, 0x169730c1,
+ 0x01ec2482, 0x38611847, 0x2f1a0c04, 0x6655004f, 0x712e140c,
+ 0x48a328c9, 0x5fd83c8a, 0x3bb95143, 0x2cc24500, 0x154f79c5,
+ 0x02346d86, 0xdd8da257, 0xcaf6b614, 0xf37b8ad1, 0xe4009e92,
+ 0x8061f35b, 0x971ae718, 0xae97dbdd, 0xb9eccf9e, 0xca95423e,
+ 0xddee567d, 0xe4636ab8, 0xf3187efb, 0x97791332, 0x80020771,
+ 0xb98f3bb4, 0xaef42ff7, 0x714de026, 0x6636f465, 0x5fbbc8a0,
+ 0x48c0dce3, 0x2ca1b12a, 0x3bdaa569, 0x025799ac, 0x152c8def,
+ 0xe4a482ec, 0xf3df96af, 0xca52aa6a, 0xdd29be29, 0xb948d3e0,
+ 0xae33c7a3, 0x97befb66, 0x80c5ef25, 0x5f7c20f4, 0x480734b7,
+ 0x718a0872, 0x66f11c31, 0x029071f8, 0x15eb65bb, 0x2c66597e,
+ 0x3b1d4d3d, 0x4864c09d, 0x5f1fd4de, 0x6692e81b, 0x71e9fc58,
+ 0x15889191, 0x02f385d2, 0x3b7eb917, 0x2c05ad54, 0xf3bc6285,
+ 0xe4c776c6, 0xdd4a4a03, 0xca315e40, 0xae503389, 0xb92b27ca,
+ 0x80a61b0f, 0x97dd0f4c, 0xb8c70348, 0xafbc170b, 0x96312bce,
+ 0x814a3f8d, 0xe52b5244, 0xf2504607, 0xcbdd7ac2, 0xdca66e81,
+ 0x031fa150, 0x1464b513, 0x2de989d6, 0x3a929d95, 0x5ef3f05c,
+ 0x4988e41f, 0x7005d8da, 0x677ecc99, 0x14074139, 0x037c557a,
+ 0x3af169bf, 0x2d8a7dfc, 0x49eb1035, 0x5e900476, 0x671d38b3,
+ 0x70662cf0, 0xafdfe321, 0xb8a4f762, 0x8129cba7, 0x9652dfe4,
+ 0xf233b22d, 0xe548a66e, 0xdcc59aab, 0xcbbe8ee8, 0x3a3681eb,
+ 0x2d4d95a8, 0x14c0a96d, 0x03bbbd2e, 0x67dad0e7, 0x70a1c4a4,
+ 0x492cf861, 0x5e57ec22, 0x81ee23f3, 0x969537b0, 0xaf180b75,
+ 0xb8631f36, 0xdc0272ff, 0xcb7966bc, 0xf2f45a79, 0xe58f4e3a,
+ 0x96f6c39a, 0x818dd7d9, 0xb800eb1c, 0xaf7bff5f, 0xcb1a9296,
+ 0xdc6186d5, 0xe5ecba10, 0xf297ae53, 0x2d2e6182, 0x3a5575c1,
+ 0x03d84904, 0x14a35d47, 0x70c2308e, 0x67b924cd, 0x5e341808,
+ 0x494f0c4b}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x0000000000000000, 0x43147b1700000000, 0x8628f62e00000000,
+ 0xc53c8d3900000000, 0x0c51ec5d00000000, 0x4f45974a00000000,
+ 0x8a791a7300000000, 0xc96d616400000000, 0x18a2d8bb00000000,
+ 0x5bb6a3ac00000000, 0x9e8a2e9500000000, 0xdd9e558200000000,
+ 0x14f334e600000000, 0x57e74ff100000000, 0x92dbc2c800000000,
+ 0xd1cfb9df00000000, 0x7142c0ac00000000, 0x3256bbbb00000000,
+ 0xf76a368200000000, 0xb47e4d9500000000, 0x7d132cf100000000,
+ 0x3e0757e600000000, 0xfb3bdadf00000000, 0xb82fa1c800000000,
+ 0x69e0181700000000, 0x2af4630000000000, 0xefc8ee3900000000,
+ 0xacdc952e00000000, 0x65b1f44a00000000, 0x26a58f5d00000000,
+ 0xe399026400000000, 0xa08d797300000000, 0xa382f18200000000,
+ 0xe0968a9500000000, 0x25aa07ac00000000, 0x66be7cbb00000000,
+ 0xafd31ddf00000000, 0xecc766c800000000, 0x29fbebf100000000,
+ 0x6aef90e600000000, 0xbb20293900000000, 0xf834522e00000000,
+ 0x3d08df1700000000, 0x7e1ca40000000000, 0xb771c56400000000,
+ 0xf465be7300000000, 0x3159334a00000000, 0x724d485d00000000,
+ 0xd2c0312e00000000, 0x91d44a3900000000, 0x54e8c70000000000,
+ 0x17fcbc1700000000, 0xde91dd7300000000, 0x9d85a66400000000,
+ 0x58b92b5d00000000, 0x1bad504a00000000, 0xca62e99500000000,
+ 0x8976928200000000, 0x4c4a1fbb00000000, 0x0f5e64ac00000000,
+ 0xc63305c800000000, 0x85277edf00000000, 0x401bf3e600000000,
+ 0x030f88f100000000, 0x070392de00000000, 0x4417e9c900000000,
+ 0x812b64f000000000, 0xc23f1fe700000000, 0x0b527e8300000000,
+ 0x4846059400000000, 0x8d7a88ad00000000, 0xce6ef3ba00000000,
+ 0x1fa14a6500000000, 0x5cb5317200000000, 0x9989bc4b00000000,
+ 0xda9dc75c00000000, 0x13f0a63800000000, 0x50e4dd2f00000000,
+ 0x95d8501600000000, 0xd6cc2b0100000000, 0x7641527200000000,
+ 0x3555296500000000, 0xf069a45c00000000, 0xb37ddf4b00000000,
+ 0x7a10be2f00000000, 0x3904c53800000000, 0xfc38480100000000,
+ 0xbf2c331600000000, 0x6ee38ac900000000, 0x2df7f1de00000000,
+ 0xe8cb7ce700000000, 0xabdf07f000000000, 0x62b2669400000000,
+ 0x21a61d8300000000, 0xe49a90ba00000000, 0xa78eebad00000000,
+ 0xa481635c00000000, 0xe795184b00000000, 0x22a9957200000000,
+ 0x61bdee6500000000, 0xa8d08f0100000000, 0xebc4f41600000000,
+ 0x2ef8792f00000000, 0x6dec023800000000, 0xbc23bbe700000000,
+ 0xff37c0f000000000, 0x3a0b4dc900000000, 0x791f36de00000000,
+ 0xb07257ba00000000, 0xf3662cad00000000, 0x365aa19400000000,
+ 0x754eda8300000000, 0xd5c3a3f000000000, 0x96d7d8e700000000,
+ 0x53eb55de00000000, 0x10ff2ec900000000, 0xd9924fad00000000,
+ 0x9a8634ba00000000, 0x5fbab98300000000, 0x1caec29400000000,
+ 0xcd617b4b00000000, 0x8e75005c00000000, 0x4b498d6500000000,
+ 0x085df67200000000, 0xc130971600000000, 0x8224ec0100000000,
+ 0x4718613800000000, 0x040c1a2f00000000, 0x4f00556600000000,
+ 0x0c142e7100000000, 0xc928a34800000000, 0x8a3cd85f00000000,
+ 0x4351b93b00000000, 0x0045c22c00000000, 0xc5794f1500000000,
+ 0x866d340200000000, 0x57a28ddd00000000, 0x14b6f6ca00000000,
+ 0xd18a7bf300000000, 0x929e00e400000000, 0x5bf3618000000000,
+ 0x18e71a9700000000, 0xdddb97ae00000000, 0x9ecfecb900000000,
+ 0x3e4295ca00000000, 0x7d56eedd00000000, 0xb86a63e400000000,
+ 0xfb7e18f300000000, 0x3213799700000000, 0x7107028000000000,
+ 0xb43b8fb900000000, 0xf72ff4ae00000000, 0x26e04d7100000000,
+ 0x65f4366600000000, 0xa0c8bb5f00000000, 0xe3dcc04800000000,
+ 0x2ab1a12c00000000, 0x69a5da3b00000000, 0xac99570200000000,
+ 0xef8d2c1500000000, 0xec82a4e400000000, 0xaf96dff300000000,
+ 0x6aaa52ca00000000, 0x29be29dd00000000, 0xe0d348b900000000,
+ 0xa3c733ae00000000, 0x66fbbe9700000000, 0x25efc58000000000,
+ 0xf4207c5f00000000, 0xb734074800000000, 0x72088a7100000000,
+ 0x311cf16600000000, 0xf871900200000000, 0xbb65eb1500000000,
+ 0x7e59662c00000000, 0x3d4d1d3b00000000, 0x9dc0644800000000,
+ 0xded41f5f00000000, 0x1be8926600000000, 0x58fce97100000000,
+ 0x9191881500000000, 0xd285f30200000000, 0x17b97e3b00000000,
+ 0x54ad052c00000000, 0x8562bcf300000000, 0xc676c7e400000000,
+ 0x034a4add00000000, 0x405e31ca00000000, 0x893350ae00000000,
+ 0xca272bb900000000, 0x0f1ba68000000000, 0x4c0fdd9700000000,
+ 0x4803c7b800000000, 0x0b17bcaf00000000, 0xce2b319600000000,
+ 0x8d3f4a8100000000, 0x44522be500000000, 0x074650f200000000,
+ 0xc27addcb00000000, 0x816ea6dc00000000, 0x50a11f0300000000,
+ 0x13b5641400000000, 0xd689e92d00000000, 0x959d923a00000000,
+ 0x5cf0f35e00000000, 0x1fe4884900000000, 0xdad8057000000000,
+ 0x99cc7e6700000000, 0x3941071400000000, 0x7a557c0300000000,
+ 0xbf69f13a00000000, 0xfc7d8a2d00000000, 0x3510eb4900000000,
+ 0x7604905e00000000, 0xb3381d6700000000, 0xf02c667000000000,
+ 0x21e3dfaf00000000, 0x62f7a4b800000000, 0xa7cb298100000000,
+ 0xe4df529600000000, 0x2db233f200000000, 0x6ea648e500000000,
+ 0xab9ac5dc00000000, 0xe88ebecb00000000, 0xeb81363a00000000,
+ 0xa8954d2d00000000, 0x6da9c01400000000, 0x2ebdbb0300000000,
+ 0xe7d0da6700000000, 0xa4c4a17000000000, 0x61f82c4900000000,
+ 0x22ec575e00000000, 0xf323ee8100000000, 0xb037959600000000,
+ 0x750b18af00000000, 0x361f63b800000000, 0xff7202dc00000000,
+ 0xbc6679cb00000000, 0x795af4f200000000, 0x3a4e8fe500000000,
+ 0x9ac3f69600000000, 0xd9d78d8100000000, 0x1ceb00b800000000,
+ 0x5fff7baf00000000, 0x96921acb00000000, 0xd58661dc00000000,
+ 0x10baece500000000, 0x53ae97f200000000, 0x82612e2d00000000,
+ 0xc175553a00000000, 0x0449d80300000000, 0x475da31400000000,
+ 0x8e30c27000000000, 0xcd24b96700000000, 0x0818345e00000000,
+ 0x4b0c4f4900000000},
+ {0x0000000000000000, 0x3e6bc2ef00000000, 0x3dd0f50400000000,
+ 0x03bb37eb00000000, 0x7aa0eb0900000000, 0x44cb29e600000000,
+ 0x47701e0d00000000, 0x791bdce200000000, 0xf440d71300000000,
+ 0xca2b15fc00000000, 0xc990221700000000, 0xf7fbe0f800000000,
+ 0x8ee03c1a00000000, 0xb08bfef500000000, 0xb330c91e00000000,
+ 0x8d5b0bf100000000, 0xe881ae2700000000, 0xd6ea6cc800000000,
+ 0xd5515b2300000000, 0xeb3a99cc00000000, 0x9221452e00000000,
+ 0xac4a87c100000000, 0xaff1b02a00000000, 0x919a72c500000000,
+ 0x1cc1793400000000, 0x22aabbdb00000000, 0x21118c3000000000,
+ 0x1f7a4edf00000000, 0x6661923d00000000, 0x580a50d200000000,
+ 0x5bb1673900000000, 0x65daa5d600000000, 0xd0035d4f00000000,
+ 0xee689fa000000000, 0xedd3a84b00000000, 0xd3b86aa400000000,
+ 0xaaa3b64600000000, 0x94c874a900000000, 0x9773434200000000,
+ 0xa91881ad00000000, 0x24438a5c00000000, 0x1a2848b300000000,
+ 0x19937f5800000000, 0x27f8bdb700000000, 0x5ee3615500000000,
+ 0x6088a3ba00000000, 0x6333945100000000, 0x5d5856be00000000,
+ 0x3882f36800000000, 0x06e9318700000000, 0x0552066c00000000,
+ 0x3b39c48300000000, 0x4222186100000000, 0x7c49da8e00000000,
+ 0x7ff2ed6500000000, 0x41992f8a00000000, 0xccc2247b00000000,
+ 0xf2a9e69400000000, 0xf112d17f00000000, 0xcf79139000000000,
+ 0xb662cf7200000000, 0x88090d9d00000000, 0x8bb23a7600000000,
+ 0xb5d9f89900000000, 0xa007ba9e00000000, 0x9e6c787100000000,
+ 0x9dd74f9a00000000, 0xa3bc8d7500000000, 0xdaa7519700000000,
+ 0xe4cc937800000000, 0xe777a49300000000, 0xd91c667c00000000,
+ 0x54476d8d00000000, 0x6a2caf6200000000, 0x6997988900000000,
+ 0x57fc5a6600000000, 0x2ee7868400000000, 0x108c446b00000000,
+ 0x1337738000000000, 0x2d5cb16f00000000, 0x488614b900000000,
+ 0x76edd65600000000, 0x7556e1bd00000000, 0x4b3d235200000000,
+ 0x3226ffb000000000, 0x0c4d3d5f00000000, 0x0ff60ab400000000,
+ 0x319dc85b00000000, 0xbcc6c3aa00000000, 0x82ad014500000000,
+ 0x811636ae00000000, 0xbf7df44100000000, 0xc66628a300000000,
+ 0xf80dea4c00000000, 0xfbb6dda700000000, 0xc5dd1f4800000000,
+ 0x7004e7d100000000, 0x4e6f253e00000000, 0x4dd412d500000000,
+ 0x73bfd03a00000000, 0x0aa40cd800000000, 0x34cfce3700000000,
+ 0x3774f9dc00000000, 0x091f3b3300000000, 0x844430c200000000,
+ 0xba2ff22d00000000, 0xb994c5c600000000, 0x87ff072900000000,
+ 0xfee4dbcb00000000, 0xc08f192400000000, 0xc3342ecf00000000,
+ 0xfd5fec2000000000, 0x988549f600000000, 0xa6ee8b1900000000,
+ 0xa555bcf200000000, 0x9b3e7e1d00000000, 0xe225a2ff00000000,
+ 0xdc4e601000000000, 0xdff557fb00000000, 0xe19e951400000000,
+ 0x6cc59ee500000000, 0x52ae5c0a00000000, 0x51156be100000000,
+ 0x6f7ea90e00000000, 0x166575ec00000000, 0x280eb70300000000,
+ 0x2bb580e800000000, 0x15de420700000000, 0x010905e600000000,
+ 0x3f62c70900000000, 0x3cd9f0e200000000, 0x02b2320d00000000,
+ 0x7ba9eeef00000000, 0x45c22c0000000000, 0x46791beb00000000,
+ 0x7812d90400000000, 0xf549d2f500000000, 0xcb22101a00000000,
+ 0xc89927f100000000, 0xf6f2e51e00000000, 0x8fe939fc00000000,
+ 0xb182fb1300000000, 0xb239ccf800000000, 0x8c520e1700000000,
+ 0xe988abc100000000, 0xd7e3692e00000000, 0xd4585ec500000000,
+ 0xea339c2a00000000, 0x932840c800000000, 0xad43822700000000,
+ 0xaef8b5cc00000000, 0x9093772300000000, 0x1dc87cd200000000,
+ 0x23a3be3d00000000, 0x201889d600000000, 0x1e734b3900000000,
+ 0x676897db00000000, 0x5903553400000000, 0x5ab862df00000000,
+ 0x64d3a03000000000, 0xd10a58a900000000, 0xef619a4600000000,
+ 0xecdaadad00000000, 0xd2b16f4200000000, 0xabaab3a000000000,
+ 0x95c1714f00000000, 0x967a46a400000000, 0xa811844b00000000,
+ 0x254a8fba00000000, 0x1b214d5500000000, 0x189a7abe00000000,
+ 0x26f1b85100000000, 0x5fea64b300000000, 0x6181a65c00000000,
+ 0x623a91b700000000, 0x5c51535800000000, 0x398bf68e00000000,
+ 0x07e0346100000000, 0x045b038a00000000, 0x3a30c16500000000,
+ 0x432b1d8700000000, 0x7d40df6800000000, 0x7efbe88300000000,
+ 0x40902a6c00000000, 0xcdcb219d00000000, 0xf3a0e37200000000,
+ 0xf01bd49900000000, 0xce70167600000000, 0xb76bca9400000000,
+ 0x8900087b00000000, 0x8abb3f9000000000, 0xb4d0fd7f00000000,
+ 0xa10ebf7800000000, 0x9f657d9700000000, 0x9cde4a7c00000000,
+ 0xa2b5889300000000, 0xdbae547100000000, 0xe5c5969e00000000,
+ 0xe67ea17500000000, 0xd815639a00000000, 0x554e686b00000000,
+ 0x6b25aa8400000000, 0x689e9d6f00000000, 0x56f55f8000000000,
+ 0x2fee836200000000, 0x1185418d00000000, 0x123e766600000000,
+ 0x2c55b48900000000, 0x498f115f00000000, 0x77e4d3b000000000,
+ 0x745fe45b00000000, 0x4a3426b400000000, 0x332ffa5600000000,
+ 0x0d4438b900000000, 0x0eff0f5200000000, 0x3094cdbd00000000,
+ 0xbdcfc64c00000000, 0x83a404a300000000, 0x801f334800000000,
+ 0xbe74f1a700000000, 0xc76f2d4500000000, 0xf904efaa00000000,
+ 0xfabfd84100000000, 0xc4d41aae00000000, 0x710de23700000000,
+ 0x4f6620d800000000, 0x4cdd173300000000, 0x72b6d5dc00000000,
+ 0x0bad093e00000000, 0x35c6cbd100000000, 0x367dfc3a00000000,
+ 0x08163ed500000000, 0x854d352400000000, 0xbb26f7cb00000000,
+ 0xb89dc02000000000, 0x86f602cf00000000, 0xffedde2d00000000,
+ 0xc1861cc200000000, 0xc23d2b2900000000, 0xfc56e9c600000000,
+ 0x998c4c1000000000, 0xa7e78eff00000000, 0xa45cb91400000000,
+ 0x9a377bfb00000000, 0xe32ca71900000000, 0xdd4765f600000000,
+ 0xdefc521d00000000, 0xe09790f200000000, 0x6dcc9b0300000000,
+ 0x53a759ec00000000, 0x501c6e0700000000, 0x6e77ace800000000,
+ 0x176c700a00000000, 0x2907b2e500000000, 0x2abc850e00000000,
+ 0x14d747e100000000},
+ {0x0000000000000000, 0xc0df8ec100000000, 0xc1b96c5800000000,
+ 0x0166e29900000000, 0x8273d9b000000000, 0x42ac577100000000,
+ 0x43cab5e800000000, 0x83153b2900000000, 0x45e1c3ba00000000,
+ 0x853e4d7b00000000, 0x8458afe200000000, 0x4487212300000000,
+ 0xc7921a0a00000000, 0x074d94cb00000000, 0x062b765200000000,
+ 0xc6f4f89300000000, 0xcbc4f6ae00000000, 0x0b1b786f00000000,
+ 0x0a7d9af600000000, 0xcaa2143700000000, 0x49b72f1e00000000,
+ 0x8968a1df00000000, 0x880e434600000000, 0x48d1cd8700000000,
+ 0x8e25351400000000, 0x4efabbd500000000, 0x4f9c594c00000000,
+ 0x8f43d78d00000000, 0x0c56eca400000000, 0xcc89626500000000,
+ 0xcdef80fc00000000, 0x0d300e3d00000000, 0xd78f9c8600000000,
+ 0x1750124700000000, 0x1636f0de00000000, 0xd6e97e1f00000000,
+ 0x55fc453600000000, 0x9523cbf700000000, 0x9445296e00000000,
+ 0x549aa7af00000000, 0x926e5f3c00000000, 0x52b1d1fd00000000,
+ 0x53d7336400000000, 0x9308bda500000000, 0x101d868c00000000,
+ 0xd0c2084d00000000, 0xd1a4ead400000000, 0x117b641500000000,
+ 0x1c4b6a2800000000, 0xdc94e4e900000000, 0xddf2067000000000,
+ 0x1d2d88b100000000, 0x9e38b39800000000, 0x5ee73d5900000000,
+ 0x5f81dfc000000000, 0x9f5e510100000000, 0x59aaa99200000000,
+ 0x9975275300000000, 0x9813c5ca00000000, 0x58cc4b0b00000000,
+ 0xdbd9702200000000, 0x1b06fee300000000, 0x1a601c7a00000000,
+ 0xdabf92bb00000000, 0xef1948d600000000, 0x2fc6c61700000000,
+ 0x2ea0248e00000000, 0xee7faa4f00000000, 0x6d6a916600000000,
+ 0xadb51fa700000000, 0xacd3fd3e00000000, 0x6c0c73ff00000000,
+ 0xaaf88b6c00000000, 0x6a2705ad00000000, 0x6b41e73400000000,
+ 0xab9e69f500000000, 0x288b52dc00000000, 0xe854dc1d00000000,
+ 0xe9323e8400000000, 0x29edb04500000000, 0x24ddbe7800000000,
+ 0xe40230b900000000, 0xe564d22000000000, 0x25bb5ce100000000,
+ 0xa6ae67c800000000, 0x6671e90900000000, 0x67170b9000000000,
+ 0xa7c8855100000000, 0x613c7dc200000000, 0xa1e3f30300000000,
+ 0xa085119a00000000, 0x605a9f5b00000000, 0xe34fa47200000000,
+ 0x23902ab300000000, 0x22f6c82a00000000, 0xe22946eb00000000,
+ 0x3896d45000000000, 0xf8495a9100000000, 0xf92fb80800000000,
+ 0x39f036c900000000, 0xbae50de000000000, 0x7a3a832100000000,
+ 0x7b5c61b800000000, 0xbb83ef7900000000, 0x7d7717ea00000000,
+ 0xbda8992b00000000, 0xbcce7bb200000000, 0x7c11f57300000000,
+ 0xff04ce5a00000000, 0x3fdb409b00000000, 0x3ebda20200000000,
+ 0xfe622cc300000000, 0xf35222fe00000000, 0x338dac3f00000000,
+ 0x32eb4ea600000000, 0xf234c06700000000, 0x7121fb4e00000000,
+ 0xb1fe758f00000000, 0xb098971600000000, 0x704719d700000000,
+ 0xb6b3e14400000000, 0x766c6f8500000000, 0x770a8d1c00000000,
+ 0xb7d503dd00000000, 0x34c038f400000000, 0xf41fb63500000000,
+ 0xf57954ac00000000, 0x35a6da6d00000000, 0x9f35e17700000000,
+ 0x5fea6fb600000000, 0x5e8c8d2f00000000, 0x9e5303ee00000000,
+ 0x1d4638c700000000, 0xdd99b60600000000, 0xdcff549f00000000,
+ 0x1c20da5e00000000, 0xdad422cd00000000, 0x1a0bac0c00000000,
+ 0x1b6d4e9500000000, 0xdbb2c05400000000, 0x58a7fb7d00000000,
+ 0x987875bc00000000, 0x991e972500000000, 0x59c119e400000000,
+ 0x54f117d900000000, 0x942e991800000000, 0x95487b8100000000,
+ 0x5597f54000000000, 0xd682ce6900000000, 0x165d40a800000000,
+ 0x173ba23100000000, 0xd7e42cf000000000, 0x1110d46300000000,
+ 0xd1cf5aa200000000, 0xd0a9b83b00000000, 0x107636fa00000000,
+ 0x93630dd300000000, 0x53bc831200000000, 0x52da618b00000000,
+ 0x9205ef4a00000000, 0x48ba7df100000000, 0x8865f33000000000,
+ 0x890311a900000000, 0x49dc9f6800000000, 0xcac9a44100000000,
+ 0x0a162a8000000000, 0x0b70c81900000000, 0xcbaf46d800000000,
+ 0x0d5bbe4b00000000, 0xcd84308a00000000, 0xcce2d21300000000,
+ 0x0c3d5cd200000000, 0x8f2867fb00000000, 0x4ff7e93a00000000,
+ 0x4e910ba300000000, 0x8e4e856200000000, 0x837e8b5f00000000,
+ 0x43a1059e00000000, 0x42c7e70700000000, 0x821869c600000000,
+ 0x010d52ef00000000, 0xc1d2dc2e00000000, 0xc0b43eb700000000,
+ 0x006bb07600000000, 0xc69f48e500000000, 0x0640c62400000000,
+ 0x072624bd00000000, 0xc7f9aa7c00000000, 0x44ec915500000000,
+ 0x84331f9400000000, 0x8555fd0d00000000, 0x458a73cc00000000,
+ 0x702ca9a100000000, 0xb0f3276000000000, 0xb195c5f900000000,
+ 0x714a4b3800000000, 0xf25f701100000000, 0x3280fed000000000,
+ 0x33e61c4900000000, 0xf339928800000000, 0x35cd6a1b00000000,
+ 0xf512e4da00000000, 0xf474064300000000, 0x34ab888200000000,
+ 0xb7beb3ab00000000, 0x77613d6a00000000, 0x7607dff300000000,
+ 0xb6d8513200000000, 0xbbe85f0f00000000, 0x7b37d1ce00000000,
+ 0x7a51335700000000, 0xba8ebd9600000000, 0x399b86bf00000000,
+ 0xf944087e00000000, 0xf822eae700000000, 0x38fd642600000000,
+ 0xfe099cb500000000, 0x3ed6127400000000, 0x3fb0f0ed00000000,
+ 0xff6f7e2c00000000, 0x7c7a450500000000, 0xbca5cbc400000000,
+ 0xbdc3295d00000000, 0x7d1ca79c00000000, 0xa7a3352700000000,
+ 0x677cbbe600000000, 0x661a597f00000000, 0xa6c5d7be00000000,
+ 0x25d0ec9700000000, 0xe50f625600000000, 0xe46980cf00000000,
+ 0x24b60e0e00000000, 0xe242f69d00000000, 0x229d785c00000000,
+ 0x23fb9ac500000000, 0xe324140400000000, 0x60312f2d00000000,
+ 0xa0eea1ec00000000, 0xa188437500000000, 0x6157cdb400000000,
+ 0x6c67c38900000000, 0xacb84d4800000000, 0xaddeafd100000000,
+ 0x6d01211000000000, 0xee141a3900000000, 0x2ecb94f800000000,
+ 0x2fad766100000000, 0xef72f8a000000000, 0x2986003300000000,
+ 0xe9598ef200000000, 0xe83f6c6b00000000, 0x28e0e2aa00000000,
+ 0xabf5d98300000000, 0x6b2a574200000000, 0x6a4cb5db00000000,
+ 0xaa933b1a00000000},
+ {0x0000000000000000, 0x6f4ca59b00000000, 0x9f9e3bec00000000,
+ 0xf0d29e7700000000, 0x7f3b060300000000, 0x1077a39800000000,
+ 0xe0a53def00000000, 0x8fe9987400000000, 0xfe760c0600000000,
+ 0x913aa99d00000000, 0x61e837ea00000000, 0x0ea4927100000000,
+ 0x814d0a0500000000, 0xee01af9e00000000, 0x1ed331e900000000,
+ 0x719f947200000000, 0xfced180c00000000, 0x93a1bd9700000000,
+ 0x637323e000000000, 0x0c3f867b00000000, 0x83d61e0f00000000,
+ 0xec9abb9400000000, 0x1c4825e300000000, 0x7304807800000000,
+ 0x029b140a00000000, 0x6dd7b19100000000, 0x9d052fe600000000,
+ 0xf2498a7d00000000, 0x7da0120900000000, 0x12ecb79200000000,
+ 0xe23e29e500000000, 0x8d728c7e00000000, 0xf8db311800000000,
+ 0x9797948300000000, 0x67450af400000000, 0x0809af6f00000000,
+ 0x87e0371b00000000, 0xe8ac928000000000, 0x187e0cf700000000,
+ 0x7732a96c00000000, 0x06ad3d1e00000000, 0x69e1988500000000,
+ 0x993306f200000000, 0xf67fa36900000000, 0x79963b1d00000000,
+ 0x16da9e8600000000, 0xe60800f100000000, 0x8944a56a00000000,
+ 0x0436291400000000, 0x6b7a8c8f00000000, 0x9ba812f800000000,
+ 0xf4e4b76300000000, 0x7b0d2f1700000000, 0x14418a8c00000000,
+ 0xe49314fb00000000, 0x8bdfb16000000000, 0xfa40251200000000,
+ 0x950c808900000000, 0x65de1efe00000000, 0x0a92bb6500000000,
+ 0x857b231100000000, 0xea37868a00000000, 0x1ae518fd00000000,
+ 0x75a9bd6600000000, 0xf0b7633000000000, 0x9ffbc6ab00000000,
+ 0x6f2958dc00000000, 0x0065fd4700000000, 0x8f8c653300000000,
+ 0xe0c0c0a800000000, 0x10125edf00000000, 0x7f5efb4400000000,
+ 0x0ec16f3600000000, 0x618dcaad00000000, 0x915f54da00000000,
+ 0xfe13f14100000000, 0x71fa693500000000, 0x1eb6ccae00000000,
+ 0xee6452d900000000, 0x8128f74200000000, 0x0c5a7b3c00000000,
+ 0x6316dea700000000, 0x93c440d000000000, 0xfc88e54b00000000,
+ 0x73617d3f00000000, 0x1c2dd8a400000000, 0xecff46d300000000,
+ 0x83b3e34800000000, 0xf22c773a00000000, 0x9d60d2a100000000,
+ 0x6db24cd600000000, 0x02fee94d00000000, 0x8d17713900000000,
+ 0xe25bd4a200000000, 0x12894ad500000000, 0x7dc5ef4e00000000,
+ 0x086c522800000000, 0x6720f7b300000000, 0x97f269c400000000,
+ 0xf8becc5f00000000, 0x7757542b00000000, 0x181bf1b000000000,
+ 0xe8c96fc700000000, 0x8785ca5c00000000, 0xf61a5e2e00000000,
+ 0x9956fbb500000000, 0x698465c200000000, 0x06c8c05900000000,
+ 0x8921582d00000000, 0xe66dfdb600000000, 0x16bf63c100000000,
+ 0x79f3c65a00000000, 0xf4814a2400000000, 0x9bcdefbf00000000,
+ 0x6b1f71c800000000, 0x0453d45300000000, 0x8bba4c2700000000,
+ 0xe4f6e9bc00000000, 0x142477cb00000000, 0x7b68d25000000000,
+ 0x0af7462200000000, 0x65bbe3b900000000, 0x95697dce00000000,
+ 0xfa25d85500000000, 0x75cc402100000000, 0x1a80e5ba00000000,
+ 0xea527bcd00000000, 0x851ede5600000000, 0xe06fc76000000000,
+ 0x8f2362fb00000000, 0x7ff1fc8c00000000, 0x10bd591700000000,
+ 0x9f54c16300000000, 0xf01864f800000000, 0x00cafa8f00000000,
+ 0x6f865f1400000000, 0x1e19cb6600000000, 0x71556efd00000000,
+ 0x8187f08a00000000, 0xeecb551100000000, 0x6122cd6500000000,
+ 0x0e6e68fe00000000, 0xfebcf68900000000, 0x91f0531200000000,
+ 0x1c82df6c00000000, 0x73ce7af700000000, 0x831ce48000000000,
+ 0xec50411b00000000, 0x63b9d96f00000000, 0x0cf57cf400000000,
+ 0xfc27e28300000000, 0x936b471800000000, 0xe2f4d36a00000000,
+ 0x8db876f100000000, 0x7d6ae88600000000, 0x12264d1d00000000,
+ 0x9dcfd56900000000, 0xf28370f200000000, 0x0251ee8500000000,
+ 0x6d1d4b1e00000000, 0x18b4f67800000000, 0x77f853e300000000,
+ 0x872acd9400000000, 0xe866680f00000000, 0x678ff07b00000000,
+ 0x08c355e000000000, 0xf811cb9700000000, 0x975d6e0c00000000,
+ 0xe6c2fa7e00000000, 0x898e5fe500000000, 0x795cc19200000000,
+ 0x1610640900000000, 0x99f9fc7d00000000, 0xf6b559e600000000,
+ 0x0667c79100000000, 0x692b620a00000000, 0xe459ee7400000000,
+ 0x8b154bef00000000, 0x7bc7d59800000000, 0x148b700300000000,
+ 0x9b62e87700000000, 0xf42e4dec00000000, 0x04fcd39b00000000,
+ 0x6bb0760000000000, 0x1a2fe27200000000, 0x756347e900000000,
+ 0x85b1d99e00000000, 0xeafd7c0500000000, 0x6514e47100000000,
+ 0x0a5841ea00000000, 0xfa8adf9d00000000, 0x95c67a0600000000,
+ 0x10d8a45000000000, 0x7f9401cb00000000, 0x8f469fbc00000000,
+ 0xe00a3a2700000000, 0x6fe3a25300000000, 0x00af07c800000000,
+ 0xf07d99bf00000000, 0x9f313c2400000000, 0xeeaea85600000000,
+ 0x81e20dcd00000000, 0x713093ba00000000, 0x1e7c362100000000,
+ 0x9195ae5500000000, 0xfed90bce00000000, 0x0e0b95b900000000,
+ 0x6147302200000000, 0xec35bc5c00000000, 0x837919c700000000,
+ 0x73ab87b000000000, 0x1ce7222b00000000, 0x930eba5f00000000,
+ 0xfc421fc400000000, 0x0c9081b300000000, 0x63dc242800000000,
+ 0x1243b05a00000000, 0x7d0f15c100000000, 0x8ddd8bb600000000,
+ 0xe2912e2d00000000, 0x6d78b65900000000, 0x023413c200000000,
+ 0xf2e68db500000000, 0x9daa282e00000000, 0xe803954800000000,
+ 0x874f30d300000000, 0x779daea400000000, 0x18d10b3f00000000,
+ 0x9738934b00000000, 0xf87436d000000000, 0x08a6a8a700000000,
+ 0x67ea0d3c00000000, 0x1675994e00000000, 0x79393cd500000000,
+ 0x89eba2a200000000, 0xe6a7073900000000, 0x694e9f4d00000000,
+ 0x06023ad600000000, 0xf6d0a4a100000000, 0x999c013a00000000,
+ 0x14ee8d4400000000, 0x7ba228df00000000, 0x8b70b6a800000000,
+ 0xe43c133300000000, 0x6bd58b4700000000, 0x04992edc00000000,
+ 0xf44bb0ab00000000, 0x9b07153000000000, 0xea98814200000000,
+ 0x85d424d900000000, 0x7506baae00000000, 0x1a4a1f3500000000,
+ 0x95a3874100000000, 0xfaef22da00000000, 0x0a3dbcad00000000,
+ 0x6571193600000000},
+ {0x0000000000000000, 0x85d996dd00000000, 0x4bb55c6000000000,
+ 0xce6ccabd00000000, 0x966ab9c000000000, 0x13b32f1d00000000,
+ 0xdddfe5a000000000, 0x5806737d00000000, 0x6dd3035a00000000,
+ 0xe80a958700000000, 0x26665f3a00000000, 0xa3bfc9e700000000,
+ 0xfbb9ba9a00000000, 0x7e602c4700000000, 0xb00ce6fa00000000,
+ 0x35d5702700000000, 0xdaa607b400000000, 0x5f7f916900000000,
+ 0x91135bd400000000, 0x14cacd0900000000, 0x4cccbe7400000000,
+ 0xc91528a900000000, 0x0779e21400000000, 0x82a074c900000000,
+ 0xb77504ee00000000, 0x32ac923300000000, 0xfcc0588e00000000,
+ 0x7919ce5300000000, 0x211fbd2e00000000, 0xa4c62bf300000000,
+ 0x6aaae14e00000000, 0xef73779300000000, 0xf54b7eb300000000,
+ 0x7092e86e00000000, 0xbefe22d300000000, 0x3b27b40e00000000,
+ 0x6321c77300000000, 0xe6f851ae00000000, 0x28949b1300000000,
+ 0xad4d0dce00000000, 0x98987de900000000, 0x1d41eb3400000000,
+ 0xd32d218900000000, 0x56f4b75400000000, 0x0ef2c42900000000,
+ 0x8b2b52f400000000, 0x4547984900000000, 0xc09e0e9400000000,
+ 0x2fed790700000000, 0xaa34efda00000000, 0x6458256700000000,
+ 0xe181b3ba00000000, 0xb987c0c700000000, 0x3c5e561a00000000,
+ 0xf2329ca700000000, 0x77eb0a7a00000000, 0x423e7a5d00000000,
+ 0xc7e7ec8000000000, 0x098b263d00000000, 0x8c52b0e000000000,
+ 0xd454c39d00000000, 0x518d554000000000, 0x9fe19ffd00000000,
+ 0x1a38092000000000, 0xab918dbd00000000, 0x2e481b6000000000,
+ 0xe024d1dd00000000, 0x65fd470000000000, 0x3dfb347d00000000,
+ 0xb822a2a000000000, 0x764e681d00000000, 0xf397fec000000000,
+ 0xc6428ee700000000, 0x439b183a00000000, 0x8df7d28700000000,
+ 0x082e445a00000000, 0x5028372700000000, 0xd5f1a1fa00000000,
+ 0x1b9d6b4700000000, 0x9e44fd9a00000000, 0x71378a0900000000,
+ 0xf4ee1cd400000000, 0x3a82d66900000000, 0xbf5b40b400000000,
+ 0xe75d33c900000000, 0x6284a51400000000, 0xace86fa900000000,
+ 0x2931f97400000000, 0x1ce4895300000000, 0x993d1f8e00000000,
+ 0x5751d53300000000, 0xd28843ee00000000, 0x8a8e309300000000,
+ 0x0f57a64e00000000, 0xc13b6cf300000000, 0x44e2fa2e00000000,
+ 0x5edaf30e00000000, 0xdb0365d300000000, 0x156faf6e00000000,
+ 0x90b639b300000000, 0xc8b04ace00000000, 0x4d69dc1300000000,
+ 0x830516ae00000000, 0x06dc807300000000, 0x3309f05400000000,
+ 0xb6d0668900000000, 0x78bcac3400000000, 0xfd653ae900000000,
+ 0xa563499400000000, 0x20badf4900000000, 0xeed615f400000000,
+ 0x6b0f832900000000, 0x847cf4ba00000000, 0x01a5626700000000,
+ 0xcfc9a8da00000000, 0x4a103e0700000000, 0x12164d7a00000000,
+ 0x97cfdba700000000, 0x59a3111a00000000, 0xdc7a87c700000000,
+ 0xe9aff7e000000000, 0x6c76613d00000000, 0xa21aab8000000000,
+ 0x27c33d5d00000000, 0x7fc54e2000000000, 0xfa1cd8fd00000000,
+ 0x3470124000000000, 0xb1a9849d00000000, 0x17256aa000000000,
+ 0x92fcfc7d00000000, 0x5c9036c000000000, 0xd949a01d00000000,
+ 0x814fd36000000000, 0x049645bd00000000, 0xcafa8f0000000000,
+ 0x4f2319dd00000000, 0x7af669fa00000000, 0xff2fff2700000000,
+ 0x3143359a00000000, 0xb49aa34700000000, 0xec9cd03a00000000,
+ 0x694546e700000000, 0xa7298c5a00000000, 0x22f01a8700000000,
+ 0xcd836d1400000000, 0x485afbc900000000, 0x8636317400000000,
+ 0x03efa7a900000000, 0x5be9d4d400000000, 0xde30420900000000,
+ 0x105c88b400000000, 0x95851e6900000000, 0xa0506e4e00000000,
+ 0x2589f89300000000, 0xebe5322e00000000, 0x6e3ca4f300000000,
+ 0x363ad78e00000000, 0xb3e3415300000000, 0x7d8f8bee00000000,
+ 0xf8561d3300000000, 0xe26e141300000000, 0x67b782ce00000000,
+ 0xa9db487300000000, 0x2c02deae00000000, 0x7404add300000000,
+ 0xf1dd3b0e00000000, 0x3fb1f1b300000000, 0xba68676e00000000,
+ 0x8fbd174900000000, 0x0a64819400000000, 0xc4084b2900000000,
+ 0x41d1ddf400000000, 0x19d7ae8900000000, 0x9c0e385400000000,
+ 0x5262f2e900000000, 0xd7bb643400000000, 0x38c813a700000000,
+ 0xbd11857a00000000, 0x737d4fc700000000, 0xf6a4d91a00000000,
+ 0xaea2aa6700000000, 0x2b7b3cba00000000, 0xe517f60700000000,
+ 0x60ce60da00000000, 0x551b10fd00000000, 0xd0c2862000000000,
+ 0x1eae4c9d00000000, 0x9b77da4000000000, 0xc371a93d00000000,
+ 0x46a83fe000000000, 0x88c4f55d00000000, 0x0d1d638000000000,
+ 0xbcb4e71d00000000, 0x396d71c000000000, 0xf701bb7d00000000,
+ 0x72d82da000000000, 0x2ade5edd00000000, 0xaf07c80000000000,
+ 0x616b02bd00000000, 0xe4b2946000000000, 0xd167e44700000000,
+ 0x54be729a00000000, 0x9ad2b82700000000, 0x1f0b2efa00000000,
+ 0x470d5d8700000000, 0xc2d4cb5a00000000, 0x0cb801e700000000,
+ 0x8961973a00000000, 0x6612e0a900000000, 0xe3cb767400000000,
+ 0x2da7bcc900000000, 0xa87e2a1400000000, 0xf078596900000000,
+ 0x75a1cfb400000000, 0xbbcd050900000000, 0x3e1493d400000000,
+ 0x0bc1e3f300000000, 0x8e18752e00000000, 0x4074bf9300000000,
+ 0xc5ad294e00000000, 0x9dab5a3300000000, 0x1872ccee00000000,
+ 0xd61e065300000000, 0x53c7908e00000000, 0x49ff99ae00000000,
+ 0xcc260f7300000000, 0x024ac5ce00000000, 0x8793531300000000,
+ 0xdf95206e00000000, 0x5a4cb6b300000000, 0x94207c0e00000000,
+ 0x11f9ead300000000, 0x242c9af400000000, 0xa1f50c2900000000,
+ 0x6f99c69400000000, 0xea40504900000000, 0xb246233400000000,
+ 0x379fb5e900000000, 0xf9f37f5400000000, 0x7c2ae98900000000,
+ 0x93599e1a00000000, 0x168008c700000000, 0xd8ecc27a00000000,
+ 0x5d3554a700000000, 0x053327da00000000, 0x80eab10700000000,
+ 0x4e867bba00000000, 0xcb5fed6700000000, 0xfe8a9d4000000000,
+ 0x7b530b9d00000000, 0xb53fc12000000000, 0x30e657fd00000000,
+ 0x68e0248000000000, 0xed39b25d00000000, 0x235578e000000000,
+ 0xa68cee3d00000000},
+ {0x0000000000000000, 0x76e10f9d00000000, 0xadc46ee100000000,
+ 0xdb25617c00000000, 0x1b8fac1900000000, 0x6d6ea38400000000,
+ 0xb64bc2f800000000, 0xc0aacd6500000000, 0x361e593300000000,
+ 0x40ff56ae00000000, 0x9bda37d200000000, 0xed3b384f00000000,
+ 0x2d91f52a00000000, 0x5b70fab700000000, 0x80559bcb00000000,
+ 0xf6b4945600000000, 0x6c3cb26600000000, 0x1addbdfb00000000,
+ 0xc1f8dc8700000000, 0xb719d31a00000000, 0x77b31e7f00000000,
+ 0x015211e200000000, 0xda77709e00000000, 0xac967f0300000000,
+ 0x5a22eb5500000000, 0x2cc3e4c800000000, 0xf7e685b400000000,
+ 0x81078a2900000000, 0x41ad474c00000000, 0x374c48d100000000,
+ 0xec6929ad00000000, 0x9a88263000000000, 0xd87864cd00000000,
+ 0xae996b5000000000, 0x75bc0a2c00000000, 0x035d05b100000000,
+ 0xc3f7c8d400000000, 0xb516c74900000000, 0x6e33a63500000000,
+ 0x18d2a9a800000000, 0xee663dfe00000000, 0x9887326300000000,
+ 0x43a2531f00000000, 0x35435c8200000000, 0xf5e991e700000000,
+ 0x83089e7a00000000, 0x582dff0600000000, 0x2eccf09b00000000,
+ 0xb444d6ab00000000, 0xc2a5d93600000000, 0x1980b84a00000000,
+ 0x6f61b7d700000000, 0xafcb7ab200000000, 0xd92a752f00000000,
+ 0x020f145300000000, 0x74ee1bce00000000, 0x825a8f9800000000,
+ 0xf4bb800500000000, 0x2f9ee17900000000, 0x597feee400000000,
+ 0x99d5238100000000, 0xef342c1c00000000, 0x34114d6000000000,
+ 0x42f042fd00000000, 0xf1f7b94100000000, 0x8716b6dc00000000,
+ 0x5c33d7a000000000, 0x2ad2d83d00000000, 0xea78155800000000,
+ 0x9c991ac500000000, 0x47bc7bb900000000, 0x315d742400000000,
+ 0xc7e9e07200000000, 0xb108efef00000000, 0x6a2d8e9300000000,
+ 0x1ccc810e00000000, 0xdc664c6b00000000, 0xaa8743f600000000,
+ 0x71a2228a00000000, 0x07432d1700000000, 0x9dcb0b2700000000,
+ 0xeb2a04ba00000000, 0x300f65c600000000, 0x46ee6a5b00000000,
+ 0x8644a73e00000000, 0xf0a5a8a300000000, 0x2b80c9df00000000,
+ 0x5d61c64200000000, 0xabd5521400000000, 0xdd345d8900000000,
+ 0x06113cf500000000, 0x70f0336800000000, 0xb05afe0d00000000,
+ 0xc6bbf19000000000, 0x1d9e90ec00000000, 0x6b7f9f7100000000,
+ 0x298fdd8c00000000, 0x5f6ed21100000000, 0x844bb36d00000000,
+ 0xf2aabcf000000000, 0x3200719500000000, 0x44e17e0800000000,
+ 0x9fc41f7400000000, 0xe92510e900000000, 0x1f9184bf00000000,
+ 0x69708b2200000000, 0xb255ea5e00000000, 0xc4b4e5c300000000,
+ 0x041e28a600000000, 0x72ff273b00000000, 0xa9da464700000000,
+ 0xdf3b49da00000000, 0x45b36fea00000000, 0x3352607700000000,
+ 0xe877010b00000000, 0x9e960e9600000000, 0x5e3cc3f300000000,
+ 0x28ddcc6e00000000, 0xf3f8ad1200000000, 0x8519a28f00000000,
+ 0x73ad36d900000000, 0x054c394400000000, 0xde69583800000000,
+ 0xa88857a500000000, 0x68229ac000000000, 0x1ec3955d00000000,
+ 0xc5e6f42100000000, 0xb307fbbc00000000, 0xe2ef738300000000,
+ 0x940e7c1e00000000, 0x4f2b1d6200000000, 0x39ca12ff00000000,
+ 0xf960df9a00000000, 0x8f81d00700000000, 0x54a4b17b00000000,
+ 0x2245bee600000000, 0xd4f12ab000000000, 0xa210252d00000000,
+ 0x7935445100000000, 0x0fd44bcc00000000, 0xcf7e86a900000000,
+ 0xb99f893400000000, 0x62bae84800000000, 0x145be7d500000000,
+ 0x8ed3c1e500000000, 0xf832ce7800000000, 0x2317af0400000000,
+ 0x55f6a09900000000, 0x955c6dfc00000000, 0xe3bd626100000000,
+ 0x3898031d00000000, 0x4e790c8000000000, 0xb8cd98d600000000,
+ 0xce2c974b00000000, 0x1509f63700000000, 0x63e8f9aa00000000,
+ 0xa34234cf00000000, 0xd5a33b5200000000, 0x0e865a2e00000000,
+ 0x786755b300000000, 0x3a97174e00000000, 0x4c7618d300000000,
+ 0x975379af00000000, 0xe1b2763200000000, 0x2118bb5700000000,
+ 0x57f9b4ca00000000, 0x8cdcd5b600000000, 0xfa3dda2b00000000,
+ 0x0c894e7d00000000, 0x7a6841e000000000, 0xa14d209c00000000,
+ 0xd7ac2f0100000000, 0x1706e26400000000, 0x61e7edf900000000,
+ 0xbac28c8500000000, 0xcc23831800000000, 0x56aba52800000000,
+ 0x204aaab500000000, 0xfb6fcbc900000000, 0x8d8ec45400000000,
+ 0x4d24093100000000, 0x3bc506ac00000000, 0xe0e067d000000000,
+ 0x9601684d00000000, 0x60b5fc1b00000000, 0x1654f38600000000,
+ 0xcd7192fa00000000, 0xbb909d6700000000, 0x7b3a500200000000,
+ 0x0ddb5f9f00000000, 0xd6fe3ee300000000, 0xa01f317e00000000,
+ 0x1318cac200000000, 0x65f9c55f00000000, 0xbedca42300000000,
+ 0xc83dabbe00000000, 0x089766db00000000, 0x7e76694600000000,
+ 0xa553083a00000000, 0xd3b207a700000000, 0x250693f100000000,
+ 0x53e79c6c00000000, 0x88c2fd1000000000, 0xfe23f28d00000000,
+ 0x3e893fe800000000, 0x4868307500000000, 0x934d510900000000,
+ 0xe5ac5e9400000000, 0x7f2478a400000000, 0x09c5773900000000,
+ 0xd2e0164500000000, 0xa40119d800000000, 0x64abd4bd00000000,
+ 0x124adb2000000000, 0xc96fba5c00000000, 0xbf8eb5c100000000,
+ 0x493a219700000000, 0x3fdb2e0a00000000, 0xe4fe4f7600000000,
+ 0x921f40eb00000000, 0x52b58d8e00000000, 0x2454821300000000,
+ 0xff71e36f00000000, 0x8990ecf200000000, 0xcb60ae0f00000000,
+ 0xbd81a19200000000, 0x66a4c0ee00000000, 0x1045cf7300000000,
+ 0xd0ef021600000000, 0xa60e0d8b00000000, 0x7d2b6cf700000000,
+ 0x0bca636a00000000, 0xfd7ef73c00000000, 0x8b9ff8a100000000,
+ 0x50ba99dd00000000, 0x265b964000000000, 0xe6f15b2500000000,
+ 0x901054b800000000, 0x4b3535c400000000, 0x3dd43a5900000000,
+ 0xa75c1c6900000000, 0xd1bd13f400000000, 0x0a98728800000000,
+ 0x7c797d1500000000, 0xbcd3b07000000000, 0xca32bfed00000000,
+ 0x1117de9100000000, 0x67f6d10c00000000, 0x9142455a00000000,
+ 0xe7a34ac700000000, 0x3c862bbb00000000, 0x4a67242600000000,
+ 0x8acde94300000000, 0xfc2ce6de00000000, 0x270987a200000000,
+ 0x51e8883f00000000},
+ {0x0000000000000000, 0xe8dbfbb900000000, 0x91b186a800000000,
+ 0x796a7d1100000000, 0x63657c8a00000000, 0x8bbe873300000000,
+ 0xf2d4fa2200000000, 0x1a0f019b00000000, 0x87cc89cf00000000,
+ 0x6f17727600000000, 0x167d0f6700000000, 0xfea6f4de00000000,
+ 0xe4a9f54500000000, 0x0c720efc00000000, 0x751873ed00000000,
+ 0x9dc3885400000000, 0x4f9f624400000000, 0xa74499fd00000000,
+ 0xde2ee4ec00000000, 0x36f51f5500000000, 0x2cfa1ece00000000,
+ 0xc421e57700000000, 0xbd4b986600000000, 0x559063df00000000,
+ 0xc853eb8b00000000, 0x2088103200000000, 0x59e26d2300000000,
+ 0xb139969a00000000, 0xab36970100000000, 0x43ed6cb800000000,
+ 0x3a8711a900000000, 0xd25cea1000000000, 0x9e3ec58800000000,
+ 0x76e53e3100000000, 0x0f8f432000000000, 0xe754b89900000000,
+ 0xfd5bb90200000000, 0x158042bb00000000, 0x6cea3faa00000000,
+ 0x8431c41300000000, 0x19f24c4700000000, 0xf129b7fe00000000,
+ 0x8843caef00000000, 0x6098315600000000, 0x7a9730cd00000000,
+ 0x924ccb7400000000, 0xeb26b66500000000, 0x03fd4ddc00000000,
+ 0xd1a1a7cc00000000, 0x397a5c7500000000, 0x4010216400000000,
+ 0xa8cbdadd00000000, 0xb2c4db4600000000, 0x5a1f20ff00000000,
+ 0x23755dee00000000, 0xcbaea65700000000, 0x566d2e0300000000,
+ 0xbeb6d5ba00000000, 0xc7dca8ab00000000, 0x2f07531200000000,
+ 0x3508528900000000, 0xddd3a93000000000, 0xa4b9d42100000000,
+ 0x4c622f9800000000, 0x7d7bfbca00000000, 0x95a0007300000000,
+ 0xecca7d6200000000, 0x041186db00000000, 0x1e1e874000000000,
+ 0xf6c57cf900000000, 0x8faf01e800000000, 0x6774fa5100000000,
+ 0xfab7720500000000, 0x126c89bc00000000, 0x6b06f4ad00000000,
+ 0x83dd0f1400000000, 0x99d20e8f00000000, 0x7109f53600000000,
+ 0x0863882700000000, 0xe0b8739e00000000, 0x32e4998e00000000,
+ 0xda3f623700000000, 0xa3551f2600000000, 0x4b8ee49f00000000,
+ 0x5181e50400000000, 0xb95a1ebd00000000, 0xc03063ac00000000,
+ 0x28eb981500000000, 0xb528104100000000, 0x5df3ebf800000000,
+ 0x249996e900000000, 0xcc426d5000000000, 0xd64d6ccb00000000,
+ 0x3e96977200000000, 0x47fcea6300000000, 0xaf2711da00000000,
+ 0xe3453e4200000000, 0x0b9ec5fb00000000, 0x72f4b8ea00000000,
+ 0x9a2f435300000000, 0x802042c800000000, 0x68fbb97100000000,
+ 0x1191c46000000000, 0xf94a3fd900000000, 0x6489b78d00000000,
+ 0x8c524c3400000000, 0xf538312500000000, 0x1de3ca9c00000000,
+ 0x07eccb0700000000, 0xef3730be00000000, 0x965d4daf00000000,
+ 0x7e86b61600000000, 0xacda5c0600000000, 0x4401a7bf00000000,
+ 0x3d6bdaae00000000, 0xd5b0211700000000, 0xcfbf208c00000000,
+ 0x2764db3500000000, 0x5e0ea62400000000, 0xb6d55d9d00000000,
+ 0x2b16d5c900000000, 0xc3cd2e7000000000, 0xbaa7536100000000,
+ 0x527ca8d800000000, 0x4873a94300000000, 0xa0a852fa00000000,
+ 0xd9c22feb00000000, 0x3119d45200000000, 0xbbf0874e00000000,
+ 0x532b7cf700000000, 0x2a4101e600000000, 0xc29afa5f00000000,
+ 0xd895fbc400000000, 0x304e007d00000000, 0x49247d6c00000000,
+ 0xa1ff86d500000000, 0x3c3c0e8100000000, 0xd4e7f53800000000,
+ 0xad8d882900000000, 0x4556739000000000, 0x5f59720b00000000,
+ 0xb78289b200000000, 0xcee8f4a300000000, 0x26330f1a00000000,
+ 0xf46fe50a00000000, 0x1cb41eb300000000, 0x65de63a200000000,
+ 0x8d05981b00000000, 0x970a998000000000, 0x7fd1623900000000,
+ 0x06bb1f2800000000, 0xee60e49100000000, 0x73a36cc500000000,
+ 0x9b78977c00000000, 0xe212ea6d00000000, 0x0ac911d400000000,
+ 0x10c6104f00000000, 0xf81debf600000000, 0x817796e700000000,
+ 0x69ac6d5e00000000, 0x25ce42c600000000, 0xcd15b97f00000000,
+ 0xb47fc46e00000000, 0x5ca43fd700000000, 0x46ab3e4c00000000,
+ 0xae70c5f500000000, 0xd71ab8e400000000, 0x3fc1435d00000000,
+ 0xa202cb0900000000, 0x4ad930b000000000, 0x33b34da100000000,
+ 0xdb68b61800000000, 0xc167b78300000000, 0x29bc4c3a00000000,
+ 0x50d6312b00000000, 0xb80dca9200000000, 0x6a51208200000000,
+ 0x828adb3b00000000, 0xfbe0a62a00000000, 0x133b5d9300000000,
+ 0x09345c0800000000, 0xe1efa7b100000000, 0x9885daa000000000,
+ 0x705e211900000000, 0xed9da94d00000000, 0x054652f400000000,
+ 0x7c2c2fe500000000, 0x94f7d45c00000000, 0x8ef8d5c700000000,
+ 0x66232e7e00000000, 0x1f49536f00000000, 0xf792a8d600000000,
+ 0xc68b7c8400000000, 0x2e50873d00000000, 0x573afa2c00000000,
+ 0xbfe1019500000000, 0xa5ee000e00000000, 0x4d35fbb700000000,
+ 0x345f86a600000000, 0xdc847d1f00000000, 0x4147f54b00000000,
+ 0xa99c0ef200000000, 0xd0f673e300000000, 0x382d885a00000000,
+ 0x222289c100000000, 0xcaf9727800000000, 0xb3930f6900000000,
+ 0x5b48f4d000000000, 0x89141ec000000000, 0x61cfe57900000000,
+ 0x18a5986800000000, 0xf07e63d100000000, 0xea71624a00000000,
+ 0x02aa99f300000000, 0x7bc0e4e200000000, 0x931b1f5b00000000,
+ 0x0ed8970f00000000, 0xe6036cb600000000, 0x9f6911a700000000,
+ 0x77b2ea1e00000000, 0x6dbdeb8500000000, 0x8566103c00000000,
+ 0xfc0c6d2d00000000, 0x14d7969400000000, 0x58b5b90c00000000,
+ 0xb06e42b500000000, 0xc9043fa400000000, 0x21dfc41d00000000,
+ 0x3bd0c58600000000, 0xd30b3e3f00000000, 0xaa61432e00000000,
+ 0x42bab89700000000, 0xdf7930c300000000, 0x37a2cb7a00000000,
+ 0x4ec8b66b00000000, 0xa6134dd200000000, 0xbc1c4c4900000000,
+ 0x54c7b7f000000000, 0x2dadcae100000000, 0xc576315800000000,
+ 0x172adb4800000000, 0xfff120f100000000, 0x869b5de000000000,
+ 0x6e40a65900000000, 0x744fa7c200000000, 0x9c945c7b00000000,
+ 0xe5fe216a00000000, 0x0d25dad300000000, 0x90e6528700000000,
+ 0x783da93e00000000, 0x0157d42f00000000, 0xe98c2f9600000000,
+ 0xf3832e0d00000000, 0x1b58d5b400000000, 0x6232a8a500000000,
+ 0x8ae9531c00000000},
+ {0x0000000000000000, 0x919168ae00000000, 0x6325a08700000000,
+ 0xf2b4c82900000000, 0x874c31d400000000, 0x16dd597a00000000,
+ 0xe469915300000000, 0x75f8f9fd00000000, 0x4f9f137300000000,
+ 0xde0e7bdd00000000, 0x2cbab3f400000000, 0xbd2bdb5a00000000,
+ 0xc8d322a700000000, 0x59424a0900000000, 0xabf6822000000000,
+ 0x3a67ea8e00000000, 0x9e3e27e600000000, 0x0faf4f4800000000,
+ 0xfd1b876100000000, 0x6c8aefcf00000000, 0x1972163200000000,
+ 0x88e37e9c00000000, 0x7a57b6b500000000, 0xebc6de1b00000000,
+ 0xd1a1349500000000, 0x40305c3b00000000, 0xb284941200000000,
+ 0x2315fcbc00000000, 0x56ed054100000000, 0xc77c6def00000000,
+ 0x35c8a5c600000000, 0xa459cd6800000000, 0x7d7b3f1700000000,
+ 0xecea57b900000000, 0x1e5e9f9000000000, 0x8fcff73e00000000,
+ 0xfa370ec300000000, 0x6ba6666d00000000, 0x9912ae4400000000,
+ 0x0883c6ea00000000, 0x32e42c6400000000, 0xa37544ca00000000,
+ 0x51c18ce300000000, 0xc050e44d00000000, 0xb5a81db000000000,
+ 0x2439751e00000000, 0xd68dbd3700000000, 0x471cd59900000000,
+ 0xe34518f100000000, 0x72d4705f00000000, 0x8060b87600000000,
+ 0x11f1d0d800000000, 0x6409292500000000, 0xf598418b00000000,
+ 0x072c89a200000000, 0x96bde10c00000000, 0xacda0b8200000000,
+ 0x3d4b632c00000000, 0xcfffab0500000000, 0x5e6ec3ab00000000,
+ 0x2b963a5600000000, 0xba0752f800000000, 0x48b39ad100000000,
+ 0xd922f27f00000000, 0xfaf67e2e00000000, 0x6b67168000000000,
+ 0x99d3dea900000000, 0x0842b60700000000, 0x7dba4ffa00000000,
+ 0xec2b275400000000, 0x1e9fef7d00000000, 0x8f0e87d300000000,
+ 0xb5696d5d00000000, 0x24f805f300000000, 0xd64ccdda00000000,
+ 0x47dda57400000000, 0x32255c8900000000, 0xa3b4342700000000,
+ 0x5100fc0e00000000, 0xc09194a000000000, 0x64c859c800000000,
+ 0xf559316600000000, 0x07edf94f00000000, 0x967c91e100000000,
+ 0xe384681c00000000, 0x721500b200000000, 0x80a1c89b00000000,
+ 0x1130a03500000000, 0x2b574abb00000000, 0xbac6221500000000,
+ 0x4872ea3c00000000, 0xd9e3829200000000, 0xac1b7b6f00000000,
+ 0x3d8a13c100000000, 0xcf3edbe800000000, 0x5eafb34600000000,
+ 0x878d413900000000, 0x161c299700000000, 0xe4a8e1be00000000,
+ 0x7539891000000000, 0x00c170ed00000000, 0x9150184300000000,
+ 0x63e4d06a00000000, 0xf275b8c400000000, 0xc812524a00000000,
+ 0x59833ae400000000, 0xab37f2cd00000000, 0x3aa69a6300000000,
+ 0x4f5e639e00000000, 0xdecf0b3000000000, 0x2c7bc31900000000,
+ 0xbdeaabb700000000, 0x19b366df00000000, 0x88220e7100000000,
+ 0x7a96c65800000000, 0xeb07aef600000000, 0x9eff570b00000000,
+ 0x0f6e3fa500000000, 0xfddaf78c00000000, 0x6c4b9f2200000000,
+ 0x562c75ac00000000, 0xc7bd1d0200000000, 0x3509d52b00000000,
+ 0xa498bd8500000000, 0xd160447800000000, 0x40f12cd600000000,
+ 0xb245e4ff00000000, 0x23d48c5100000000, 0xf4edfd5c00000000,
+ 0x657c95f200000000, 0x97c85ddb00000000, 0x0659357500000000,
+ 0x73a1cc8800000000, 0xe230a42600000000, 0x10846c0f00000000,
+ 0x811504a100000000, 0xbb72ee2f00000000, 0x2ae3868100000000,
+ 0xd8574ea800000000, 0x49c6260600000000, 0x3c3edffb00000000,
+ 0xadafb75500000000, 0x5f1b7f7c00000000, 0xce8a17d200000000,
+ 0x6ad3daba00000000, 0xfb42b21400000000, 0x09f67a3d00000000,
+ 0x9867129300000000, 0xed9feb6e00000000, 0x7c0e83c000000000,
+ 0x8eba4be900000000, 0x1f2b234700000000, 0x254cc9c900000000,
+ 0xb4dda16700000000, 0x4669694e00000000, 0xd7f801e000000000,
+ 0xa200f81d00000000, 0x339190b300000000, 0xc125589a00000000,
+ 0x50b4303400000000, 0x8996c24b00000000, 0x1807aae500000000,
+ 0xeab362cc00000000, 0x7b220a6200000000, 0x0edaf39f00000000,
+ 0x9f4b9b3100000000, 0x6dff531800000000, 0xfc6e3bb600000000,
+ 0xc609d13800000000, 0x5798b99600000000, 0xa52c71bf00000000,
+ 0x34bd191100000000, 0x4145e0ec00000000, 0xd0d4884200000000,
+ 0x2260406b00000000, 0xb3f128c500000000, 0x17a8e5ad00000000,
+ 0x86398d0300000000, 0x748d452a00000000, 0xe51c2d8400000000,
+ 0x90e4d47900000000, 0x0175bcd700000000, 0xf3c174fe00000000,
+ 0x62501c5000000000, 0x5837f6de00000000, 0xc9a69e7000000000,
+ 0x3b12565900000000, 0xaa833ef700000000, 0xdf7bc70a00000000,
+ 0x4eeaafa400000000, 0xbc5e678d00000000, 0x2dcf0f2300000000,
+ 0x0e1b837200000000, 0x9f8aebdc00000000, 0x6d3e23f500000000,
+ 0xfcaf4b5b00000000, 0x8957b2a600000000, 0x18c6da0800000000,
+ 0xea72122100000000, 0x7be37a8f00000000, 0x4184900100000000,
+ 0xd015f8af00000000, 0x22a1308600000000, 0xb330582800000000,
+ 0xc6c8a1d500000000, 0x5759c97b00000000, 0xa5ed015200000000,
+ 0x347c69fc00000000, 0x9025a49400000000, 0x01b4cc3a00000000,
+ 0xf300041300000000, 0x62916cbd00000000, 0x1769954000000000,
+ 0x86f8fdee00000000, 0x744c35c700000000, 0xe5dd5d6900000000,
+ 0xdfbab7e700000000, 0x4e2bdf4900000000, 0xbc9f176000000000,
+ 0x2d0e7fce00000000, 0x58f6863300000000, 0xc967ee9d00000000,
+ 0x3bd326b400000000, 0xaa424e1a00000000, 0x7360bc6500000000,
+ 0xe2f1d4cb00000000, 0x10451ce200000000, 0x81d4744c00000000,
+ 0xf42c8db100000000, 0x65bde51f00000000, 0x97092d3600000000,
+ 0x0698459800000000, 0x3cffaf1600000000, 0xad6ec7b800000000,
+ 0x5fda0f9100000000, 0xce4b673f00000000, 0xbbb39ec200000000,
+ 0x2a22f66c00000000, 0xd8963e4500000000, 0x490756eb00000000,
+ 0xed5e9b8300000000, 0x7ccff32d00000000, 0x8e7b3b0400000000,
+ 0x1fea53aa00000000, 0x6a12aa5700000000, 0xfb83c2f900000000,
+ 0x09370ad000000000, 0x98a6627e00000000, 0xa2c188f000000000,
+ 0x3350e05e00000000, 0xc1e4287700000000, 0x507540d900000000,
+ 0x258db92400000000, 0xb41cd18a00000000, 0x46a819a300000000,
+ 0xd739710d00000000}};
+
+#else /* W == 4 */
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0xccaa009e, 0x4225077d, 0x8e8f07e3, 0x844a0efa,
+ 0x48e00e64, 0xc66f0987, 0x0ac50919, 0xd3e51bb5, 0x1f4f1b2b,
+ 0x91c01cc8, 0x5d6a1c56, 0x57af154f, 0x9b0515d1, 0x158a1232,
+ 0xd92012ac, 0x7cbb312b, 0xb01131b5, 0x3e9e3656, 0xf23436c8,
+ 0xf8f13fd1, 0x345b3f4f, 0xbad438ac, 0x767e3832, 0xaf5e2a9e,
+ 0x63f42a00, 0xed7b2de3, 0x21d12d7d, 0x2b142464, 0xe7be24fa,
+ 0x69312319, 0xa59b2387, 0xf9766256, 0x35dc62c8, 0xbb53652b,
+ 0x77f965b5, 0x7d3c6cac, 0xb1966c32, 0x3f196bd1, 0xf3b36b4f,
+ 0x2a9379e3, 0xe639797d, 0x68b67e9e, 0xa41c7e00, 0xaed97719,
+ 0x62737787, 0xecfc7064, 0x205670fa, 0x85cd537d, 0x496753e3,
+ 0xc7e85400, 0x0b42549e, 0x01875d87, 0xcd2d5d19, 0x43a25afa,
+ 0x8f085a64, 0x562848c8, 0x9a824856, 0x140d4fb5, 0xd8a74f2b,
+ 0xd2624632, 0x1ec846ac, 0x9047414f, 0x5ced41d1, 0x299dc2ed,
+ 0xe537c273, 0x6bb8c590, 0xa712c50e, 0xadd7cc17, 0x617dcc89,
+ 0xeff2cb6a, 0x2358cbf4, 0xfa78d958, 0x36d2d9c6, 0xb85dde25,
+ 0x74f7debb, 0x7e32d7a2, 0xb298d73c, 0x3c17d0df, 0xf0bdd041,
+ 0x5526f3c6, 0x998cf358, 0x1703f4bb, 0xdba9f425, 0xd16cfd3c,
+ 0x1dc6fda2, 0x9349fa41, 0x5fe3fadf, 0x86c3e873, 0x4a69e8ed,
+ 0xc4e6ef0e, 0x084cef90, 0x0289e689, 0xce23e617, 0x40ace1f4,
+ 0x8c06e16a, 0xd0eba0bb, 0x1c41a025, 0x92cea7c6, 0x5e64a758,
+ 0x54a1ae41, 0x980baedf, 0x1684a93c, 0xda2ea9a2, 0x030ebb0e,
+ 0xcfa4bb90, 0x412bbc73, 0x8d81bced, 0x8744b5f4, 0x4beeb56a,
+ 0xc561b289, 0x09cbb217, 0xac509190, 0x60fa910e, 0xee7596ed,
+ 0x22df9673, 0x281a9f6a, 0xe4b09ff4, 0x6a3f9817, 0xa6959889,
+ 0x7fb58a25, 0xb31f8abb, 0x3d908d58, 0xf13a8dc6, 0xfbff84df,
+ 0x37558441, 0xb9da83a2, 0x7570833c, 0x533b85da, 0x9f918544,
+ 0x111e82a7, 0xddb48239, 0xd7718b20, 0x1bdb8bbe, 0x95548c5d,
+ 0x59fe8cc3, 0x80de9e6f, 0x4c749ef1, 0xc2fb9912, 0x0e51998c,
+ 0x04949095, 0xc83e900b, 0x46b197e8, 0x8a1b9776, 0x2f80b4f1,
+ 0xe32ab46f, 0x6da5b38c, 0xa10fb312, 0xabcaba0b, 0x6760ba95,
+ 0xe9efbd76, 0x2545bde8, 0xfc65af44, 0x30cfafda, 0xbe40a839,
+ 0x72eaa8a7, 0x782fa1be, 0xb485a120, 0x3a0aa6c3, 0xf6a0a65d,
+ 0xaa4de78c, 0x66e7e712, 0xe868e0f1, 0x24c2e06f, 0x2e07e976,
+ 0xe2ade9e8, 0x6c22ee0b, 0xa088ee95, 0x79a8fc39, 0xb502fca7,
+ 0x3b8dfb44, 0xf727fbda, 0xfde2f2c3, 0x3148f25d, 0xbfc7f5be,
+ 0x736df520, 0xd6f6d6a7, 0x1a5cd639, 0x94d3d1da, 0x5879d144,
+ 0x52bcd85d, 0x9e16d8c3, 0x1099df20, 0xdc33dfbe, 0x0513cd12,
+ 0xc9b9cd8c, 0x4736ca6f, 0x8b9ccaf1, 0x8159c3e8, 0x4df3c376,
+ 0xc37cc495, 0x0fd6c40b, 0x7aa64737, 0xb60c47a9, 0x3883404a,
+ 0xf42940d4, 0xfeec49cd, 0x32464953, 0xbcc94eb0, 0x70634e2e,
+ 0xa9435c82, 0x65e95c1c, 0xeb665bff, 0x27cc5b61, 0x2d095278,
+ 0xe1a352e6, 0x6f2c5505, 0xa386559b, 0x061d761c, 0xcab77682,
+ 0x44387161, 0x889271ff, 0x825778e6, 0x4efd7878, 0xc0727f9b,
+ 0x0cd87f05, 0xd5f86da9, 0x19526d37, 0x97dd6ad4, 0x5b776a4a,
+ 0x51b26353, 0x9d1863cd, 0x1397642e, 0xdf3d64b0, 0x83d02561,
+ 0x4f7a25ff, 0xc1f5221c, 0x0d5f2282, 0x079a2b9b, 0xcb302b05,
+ 0x45bf2ce6, 0x89152c78, 0x50353ed4, 0x9c9f3e4a, 0x121039a9,
+ 0xdeba3937, 0xd47f302e, 0x18d530b0, 0x965a3753, 0x5af037cd,
+ 0xff6b144a, 0x33c114d4, 0xbd4e1337, 0x71e413a9, 0x7b211ab0,
+ 0xb78b1a2e, 0x39041dcd, 0xf5ae1d53, 0x2c8e0fff, 0xe0240f61,
+ 0x6eab0882, 0xa201081c, 0xa8c40105, 0x646e019b, 0xeae10678,
+ 0x264b06e6},
+ {0x00000000, 0xa6770bb4, 0x979f1129, 0x31e81a9d, 0xf44f2413,
+ 0x52382fa7, 0x63d0353a, 0xc5a73e8e, 0x33ef4e67, 0x959845d3,
+ 0xa4705f4e, 0x020754fa, 0xc7a06a74, 0x61d761c0, 0x503f7b5d,
+ 0xf64870e9, 0x67de9cce, 0xc1a9977a, 0xf0418de7, 0x56368653,
+ 0x9391b8dd, 0x35e6b369, 0x040ea9f4, 0xa279a240, 0x5431d2a9,
+ 0xf246d91d, 0xc3aec380, 0x65d9c834, 0xa07ef6ba, 0x0609fd0e,
+ 0x37e1e793, 0x9196ec27, 0xcfbd399c, 0x69ca3228, 0x582228b5,
+ 0xfe552301, 0x3bf21d8f, 0x9d85163b, 0xac6d0ca6, 0x0a1a0712,
+ 0xfc5277fb, 0x5a257c4f, 0x6bcd66d2, 0xcdba6d66, 0x081d53e8,
+ 0xae6a585c, 0x9f8242c1, 0x39f54975, 0xa863a552, 0x0e14aee6,
+ 0x3ffcb47b, 0x998bbfcf, 0x5c2c8141, 0xfa5b8af5, 0xcbb39068,
+ 0x6dc49bdc, 0x9b8ceb35, 0x3dfbe081, 0x0c13fa1c, 0xaa64f1a8,
+ 0x6fc3cf26, 0xc9b4c492, 0xf85cde0f, 0x5e2bd5bb, 0x440b7579,
+ 0xe27c7ecd, 0xd3946450, 0x75e36fe4, 0xb044516a, 0x16335ade,
+ 0x27db4043, 0x81ac4bf7, 0x77e43b1e, 0xd19330aa, 0xe07b2a37,
+ 0x460c2183, 0x83ab1f0d, 0x25dc14b9, 0x14340e24, 0xb2430590,
+ 0x23d5e9b7, 0x85a2e203, 0xb44af89e, 0x123df32a, 0xd79acda4,
+ 0x71edc610, 0x4005dc8d, 0xe672d739, 0x103aa7d0, 0xb64dac64,
+ 0x87a5b6f9, 0x21d2bd4d, 0xe47583c3, 0x42028877, 0x73ea92ea,
+ 0xd59d995e, 0x8bb64ce5, 0x2dc14751, 0x1c295dcc, 0xba5e5678,
+ 0x7ff968f6, 0xd98e6342, 0xe86679df, 0x4e11726b, 0xb8590282,
+ 0x1e2e0936, 0x2fc613ab, 0x89b1181f, 0x4c162691, 0xea612d25,
+ 0xdb8937b8, 0x7dfe3c0c, 0xec68d02b, 0x4a1fdb9f, 0x7bf7c102,
+ 0xdd80cab6, 0x1827f438, 0xbe50ff8c, 0x8fb8e511, 0x29cfeea5,
+ 0xdf879e4c, 0x79f095f8, 0x48188f65, 0xee6f84d1, 0x2bc8ba5f,
+ 0x8dbfb1eb, 0xbc57ab76, 0x1a20a0c2, 0x8816eaf2, 0x2e61e146,
+ 0x1f89fbdb, 0xb9fef06f, 0x7c59cee1, 0xda2ec555, 0xebc6dfc8,
+ 0x4db1d47c, 0xbbf9a495, 0x1d8eaf21, 0x2c66b5bc, 0x8a11be08,
+ 0x4fb68086, 0xe9c18b32, 0xd82991af, 0x7e5e9a1b, 0xefc8763c,
+ 0x49bf7d88, 0x78576715, 0xde206ca1, 0x1b87522f, 0xbdf0599b,
+ 0x8c184306, 0x2a6f48b2, 0xdc27385b, 0x7a5033ef, 0x4bb82972,
+ 0xedcf22c6, 0x28681c48, 0x8e1f17fc, 0xbff70d61, 0x198006d5,
+ 0x47abd36e, 0xe1dcd8da, 0xd034c247, 0x7643c9f3, 0xb3e4f77d,
+ 0x1593fcc9, 0x247be654, 0x820cede0, 0x74449d09, 0xd23396bd,
+ 0xe3db8c20, 0x45ac8794, 0x800bb91a, 0x267cb2ae, 0x1794a833,
+ 0xb1e3a387, 0x20754fa0, 0x86024414, 0xb7ea5e89, 0x119d553d,
+ 0xd43a6bb3, 0x724d6007, 0x43a57a9a, 0xe5d2712e, 0x139a01c7,
+ 0xb5ed0a73, 0x840510ee, 0x22721b5a, 0xe7d525d4, 0x41a22e60,
+ 0x704a34fd, 0xd63d3f49, 0xcc1d9f8b, 0x6a6a943f, 0x5b828ea2,
+ 0xfdf58516, 0x3852bb98, 0x9e25b02c, 0xafcdaab1, 0x09baa105,
+ 0xfff2d1ec, 0x5985da58, 0x686dc0c5, 0xce1acb71, 0x0bbdf5ff,
+ 0xadcafe4b, 0x9c22e4d6, 0x3a55ef62, 0xabc30345, 0x0db408f1,
+ 0x3c5c126c, 0x9a2b19d8, 0x5f8c2756, 0xf9fb2ce2, 0xc813367f,
+ 0x6e643dcb, 0x982c4d22, 0x3e5b4696, 0x0fb35c0b, 0xa9c457bf,
+ 0x6c636931, 0xca146285, 0xfbfc7818, 0x5d8b73ac, 0x03a0a617,
+ 0xa5d7ada3, 0x943fb73e, 0x3248bc8a, 0xf7ef8204, 0x519889b0,
+ 0x6070932d, 0xc6079899, 0x304fe870, 0x9638e3c4, 0xa7d0f959,
+ 0x01a7f2ed, 0xc400cc63, 0x6277c7d7, 0x539fdd4a, 0xf5e8d6fe,
+ 0x647e3ad9, 0xc209316d, 0xf3e12bf0, 0x55962044, 0x90311eca,
+ 0x3646157e, 0x07ae0fe3, 0xa1d90457, 0x579174be, 0xf1e67f0a,
+ 0xc00e6597, 0x66796e23, 0xa3de50ad, 0x05a95b19, 0x34414184,
+ 0x92364a30},
+ {0x00000000, 0xcb5cd3a5, 0x4dc8a10b, 0x869472ae, 0x9b914216,
+ 0x50cd91b3, 0xd659e31d, 0x1d0530b8, 0xec53826d, 0x270f51c8,
+ 0xa19b2366, 0x6ac7f0c3, 0x77c2c07b, 0xbc9e13de, 0x3a0a6170,
+ 0xf156b2d5, 0x03d6029b, 0xc88ad13e, 0x4e1ea390, 0x85427035,
+ 0x9847408d, 0x531b9328, 0xd58fe186, 0x1ed33223, 0xef8580f6,
+ 0x24d95353, 0xa24d21fd, 0x6911f258, 0x7414c2e0, 0xbf481145,
+ 0x39dc63eb, 0xf280b04e, 0x07ac0536, 0xccf0d693, 0x4a64a43d,
+ 0x81387798, 0x9c3d4720, 0x57619485, 0xd1f5e62b, 0x1aa9358e,
+ 0xebff875b, 0x20a354fe, 0xa6372650, 0x6d6bf5f5, 0x706ec54d,
+ 0xbb3216e8, 0x3da66446, 0xf6fab7e3, 0x047a07ad, 0xcf26d408,
+ 0x49b2a6a6, 0x82ee7503, 0x9feb45bb, 0x54b7961e, 0xd223e4b0,
+ 0x197f3715, 0xe82985c0, 0x23755665, 0xa5e124cb, 0x6ebdf76e,
+ 0x73b8c7d6, 0xb8e41473, 0x3e7066dd, 0xf52cb578, 0x0f580a6c,
+ 0xc404d9c9, 0x4290ab67, 0x89cc78c2, 0x94c9487a, 0x5f959bdf,
+ 0xd901e971, 0x125d3ad4, 0xe30b8801, 0x28575ba4, 0xaec3290a,
+ 0x659ffaaf, 0x789aca17, 0xb3c619b2, 0x35526b1c, 0xfe0eb8b9,
+ 0x0c8e08f7, 0xc7d2db52, 0x4146a9fc, 0x8a1a7a59, 0x971f4ae1,
+ 0x5c439944, 0xdad7ebea, 0x118b384f, 0xe0dd8a9a, 0x2b81593f,
+ 0xad152b91, 0x6649f834, 0x7b4cc88c, 0xb0101b29, 0x36846987,
+ 0xfdd8ba22, 0x08f40f5a, 0xc3a8dcff, 0x453cae51, 0x8e607df4,
+ 0x93654d4c, 0x58399ee9, 0xdeadec47, 0x15f13fe2, 0xe4a78d37,
+ 0x2ffb5e92, 0xa96f2c3c, 0x6233ff99, 0x7f36cf21, 0xb46a1c84,
+ 0x32fe6e2a, 0xf9a2bd8f, 0x0b220dc1, 0xc07ede64, 0x46eaacca,
+ 0x8db67f6f, 0x90b34fd7, 0x5bef9c72, 0xdd7beedc, 0x16273d79,
+ 0xe7718fac, 0x2c2d5c09, 0xaab92ea7, 0x61e5fd02, 0x7ce0cdba,
+ 0xb7bc1e1f, 0x31286cb1, 0xfa74bf14, 0x1eb014d8, 0xd5ecc77d,
+ 0x5378b5d3, 0x98246676, 0x852156ce, 0x4e7d856b, 0xc8e9f7c5,
+ 0x03b52460, 0xf2e396b5, 0x39bf4510, 0xbf2b37be, 0x7477e41b,
+ 0x6972d4a3, 0xa22e0706, 0x24ba75a8, 0xefe6a60d, 0x1d661643,
+ 0xd63ac5e6, 0x50aeb748, 0x9bf264ed, 0x86f75455, 0x4dab87f0,
+ 0xcb3ff55e, 0x006326fb, 0xf135942e, 0x3a69478b, 0xbcfd3525,
+ 0x77a1e680, 0x6aa4d638, 0xa1f8059d, 0x276c7733, 0xec30a496,
+ 0x191c11ee, 0xd240c24b, 0x54d4b0e5, 0x9f886340, 0x828d53f8,
+ 0x49d1805d, 0xcf45f2f3, 0x04192156, 0xf54f9383, 0x3e134026,
+ 0xb8873288, 0x73dbe12d, 0x6eded195, 0xa5820230, 0x2316709e,
+ 0xe84aa33b, 0x1aca1375, 0xd196c0d0, 0x5702b27e, 0x9c5e61db,
+ 0x815b5163, 0x4a0782c6, 0xcc93f068, 0x07cf23cd, 0xf6999118,
+ 0x3dc542bd, 0xbb513013, 0x700de3b6, 0x6d08d30e, 0xa65400ab,
+ 0x20c07205, 0xeb9ca1a0, 0x11e81eb4, 0xdab4cd11, 0x5c20bfbf,
+ 0x977c6c1a, 0x8a795ca2, 0x41258f07, 0xc7b1fda9, 0x0ced2e0c,
+ 0xfdbb9cd9, 0x36e74f7c, 0xb0733dd2, 0x7b2fee77, 0x662adecf,
+ 0xad760d6a, 0x2be27fc4, 0xe0beac61, 0x123e1c2f, 0xd962cf8a,
+ 0x5ff6bd24, 0x94aa6e81, 0x89af5e39, 0x42f38d9c, 0xc467ff32,
+ 0x0f3b2c97, 0xfe6d9e42, 0x35314de7, 0xb3a53f49, 0x78f9ecec,
+ 0x65fcdc54, 0xaea00ff1, 0x28347d5f, 0xe368aefa, 0x16441b82,
+ 0xdd18c827, 0x5b8cba89, 0x90d0692c, 0x8dd55994, 0x46898a31,
+ 0xc01df89f, 0x0b412b3a, 0xfa1799ef, 0x314b4a4a, 0xb7df38e4,
+ 0x7c83eb41, 0x6186dbf9, 0xaada085c, 0x2c4e7af2, 0xe712a957,
+ 0x15921919, 0xdececabc, 0x585ab812, 0x93066bb7, 0x8e035b0f,
+ 0x455f88aa, 0xc3cbfa04, 0x089729a1, 0xf9c19b74, 0x329d48d1,
+ 0xb4093a7f, 0x7f55e9da, 0x6250d962, 0xa90c0ac7, 0x2f987869,
+ 0xe4c4abcc},
+ {0x00000000, 0x3d6029b0, 0x7ac05360, 0x47a07ad0, 0xf580a6c0,
+ 0xc8e08f70, 0x8f40f5a0, 0xb220dc10, 0x30704bc1, 0x0d106271,
+ 0x4ab018a1, 0x77d03111, 0xc5f0ed01, 0xf890c4b1, 0xbf30be61,
+ 0x825097d1, 0x60e09782, 0x5d80be32, 0x1a20c4e2, 0x2740ed52,
+ 0x95603142, 0xa80018f2, 0xefa06222, 0xd2c04b92, 0x5090dc43,
+ 0x6df0f5f3, 0x2a508f23, 0x1730a693, 0xa5107a83, 0x98705333,
+ 0xdfd029e3, 0xe2b00053, 0xc1c12f04, 0xfca106b4, 0xbb017c64,
+ 0x866155d4, 0x344189c4, 0x0921a074, 0x4e81daa4, 0x73e1f314,
+ 0xf1b164c5, 0xccd14d75, 0x8b7137a5, 0xb6111e15, 0x0431c205,
+ 0x3951ebb5, 0x7ef19165, 0x4391b8d5, 0xa121b886, 0x9c419136,
+ 0xdbe1ebe6, 0xe681c256, 0x54a11e46, 0x69c137f6, 0x2e614d26,
+ 0x13016496, 0x9151f347, 0xac31daf7, 0xeb91a027, 0xd6f18997,
+ 0x64d15587, 0x59b17c37, 0x1e1106e7, 0x23712f57, 0x58f35849,
+ 0x659371f9, 0x22330b29, 0x1f532299, 0xad73fe89, 0x9013d739,
+ 0xd7b3ade9, 0xead38459, 0x68831388, 0x55e33a38, 0x124340e8,
+ 0x2f236958, 0x9d03b548, 0xa0639cf8, 0xe7c3e628, 0xdaa3cf98,
+ 0x3813cfcb, 0x0573e67b, 0x42d39cab, 0x7fb3b51b, 0xcd93690b,
+ 0xf0f340bb, 0xb7533a6b, 0x8a3313db, 0x0863840a, 0x3503adba,
+ 0x72a3d76a, 0x4fc3feda, 0xfde322ca, 0xc0830b7a, 0x872371aa,
+ 0xba43581a, 0x9932774d, 0xa4525efd, 0xe3f2242d, 0xde920d9d,
+ 0x6cb2d18d, 0x51d2f83d, 0x167282ed, 0x2b12ab5d, 0xa9423c8c,
+ 0x9422153c, 0xd3826fec, 0xeee2465c, 0x5cc29a4c, 0x61a2b3fc,
+ 0x2602c92c, 0x1b62e09c, 0xf9d2e0cf, 0xc4b2c97f, 0x8312b3af,
+ 0xbe729a1f, 0x0c52460f, 0x31326fbf, 0x7692156f, 0x4bf23cdf,
+ 0xc9a2ab0e, 0xf4c282be, 0xb362f86e, 0x8e02d1de, 0x3c220dce,
+ 0x0142247e, 0x46e25eae, 0x7b82771e, 0xb1e6b092, 0x8c869922,
+ 0xcb26e3f2, 0xf646ca42, 0x44661652, 0x79063fe2, 0x3ea64532,
+ 0x03c66c82, 0x8196fb53, 0xbcf6d2e3, 0xfb56a833, 0xc6368183,
+ 0x74165d93, 0x49767423, 0x0ed60ef3, 0x33b62743, 0xd1062710,
+ 0xec660ea0, 0xabc67470, 0x96a65dc0, 0x248681d0, 0x19e6a860,
+ 0x5e46d2b0, 0x6326fb00, 0xe1766cd1, 0xdc164561, 0x9bb63fb1,
+ 0xa6d61601, 0x14f6ca11, 0x2996e3a1, 0x6e369971, 0x5356b0c1,
+ 0x70279f96, 0x4d47b626, 0x0ae7ccf6, 0x3787e546, 0x85a73956,
+ 0xb8c710e6, 0xff676a36, 0xc2074386, 0x4057d457, 0x7d37fde7,
+ 0x3a978737, 0x07f7ae87, 0xb5d77297, 0x88b75b27, 0xcf1721f7,
+ 0xf2770847, 0x10c70814, 0x2da721a4, 0x6a075b74, 0x576772c4,
+ 0xe547aed4, 0xd8278764, 0x9f87fdb4, 0xa2e7d404, 0x20b743d5,
+ 0x1dd76a65, 0x5a7710b5, 0x67173905, 0xd537e515, 0xe857cca5,
+ 0xaff7b675, 0x92979fc5, 0xe915e8db, 0xd475c16b, 0x93d5bbbb,
+ 0xaeb5920b, 0x1c954e1b, 0x21f567ab, 0x66551d7b, 0x5b3534cb,
+ 0xd965a31a, 0xe4058aaa, 0xa3a5f07a, 0x9ec5d9ca, 0x2ce505da,
+ 0x11852c6a, 0x562556ba, 0x6b457f0a, 0x89f57f59, 0xb49556e9,
+ 0xf3352c39, 0xce550589, 0x7c75d999, 0x4115f029, 0x06b58af9,
+ 0x3bd5a349, 0xb9853498, 0x84e51d28, 0xc34567f8, 0xfe254e48,
+ 0x4c059258, 0x7165bbe8, 0x36c5c138, 0x0ba5e888, 0x28d4c7df,
+ 0x15b4ee6f, 0x521494bf, 0x6f74bd0f, 0xdd54611f, 0xe03448af,
+ 0xa794327f, 0x9af41bcf, 0x18a48c1e, 0x25c4a5ae, 0x6264df7e,
+ 0x5f04f6ce, 0xed242ade, 0xd044036e, 0x97e479be, 0xaa84500e,
+ 0x4834505d, 0x755479ed, 0x32f4033d, 0x0f942a8d, 0xbdb4f69d,
+ 0x80d4df2d, 0xc774a5fd, 0xfa148c4d, 0x78441b9c, 0x4524322c,
+ 0x028448fc, 0x3fe4614c, 0x8dc4bd5c, 0xb0a494ec, 0xf704ee3c,
+ 0xca64c78c}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x00000000, 0xb029603d, 0x6053c07a, 0xd07aa047, 0xc0a680f5,
+ 0x708fe0c8, 0xa0f5408f, 0x10dc20b2, 0xc14b7030, 0x7162100d,
+ 0xa118b04a, 0x1131d077, 0x01edf0c5, 0xb1c490f8, 0x61be30bf,
+ 0xd1975082, 0x8297e060, 0x32be805d, 0xe2c4201a, 0x52ed4027,
+ 0x42316095, 0xf21800a8, 0x2262a0ef, 0x924bc0d2, 0x43dc9050,
+ 0xf3f5f06d, 0x238f502a, 0x93a63017, 0x837a10a5, 0x33537098,
+ 0xe329d0df, 0x5300b0e2, 0x042fc1c1, 0xb406a1fc, 0x647c01bb,
+ 0xd4556186, 0xc4894134, 0x74a02109, 0xa4da814e, 0x14f3e173,
+ 0xc564b1f1, 0x754dd1cc, 0xa537718b, 0x151e11b6, 0x05c23104,
+ 0xb5eb5139, 0x6591f17e, 0xd5b89143, 0x86b821a1, 0x3691419c,
+ 0xe6ebe1db, 0x56c281e6, 0x461ea154, 0xf637c169, 0x264d612e,
+ 0x96640113, 0x47f35191, 0xf7da31ac, 0x27a091eb, 0x9789f1d6,
+ 0x8755d164, 0x377cb159, 0xe706111e, 0x572f7123, 0x4958f358,
+ 0xf9719365, 0x290b3322, 0x9922531f, 0x89fe73ad, 0x39d71390,
+ 0xe9adb3d7, 0x5984d3ea, 0x88138368, 0x383ae355, 0xe8404312,
+ 0x5869232f, 0x48b5039d, 0xf89c63a0, 0x28e6c3e7, 0x98cfa3da,
+ 0xcbcf1338, 0x7be67305, 0xab9cd342, 0x1bb5b37f, 0x0b6993cd,
+ 0xbb40f3f0, 0x6b3a53b7, 0xdb13338a, 0x0a846308, 0xbaad0335,
+ 0x6ad7a372, 0xdafec34f, 0xca22e3fd, 0x7a0b83c0, 0xaa712387,
+ 0x1a5843ba, 0x4d773299, 0xfd5e52a4, 0x2d24f2e3, 0x9d0d92de,
+ 0x8dd1b26c, 0x3df8d251, 0xed827216, 0x5dab122b, 0x8c3c42a9,
+ 0x3c152294, 0xec6f82d3, 0x5c46e2ee, 0x4c9ac25c, 0xfcb3a261,
+ 0x2cc90226, 0x9ce0621b, 0xcfe0d2f9, 0x7fc9b2c4, 0xafb31283,
+ 0x1f9a72be, 0x0f46520c, 0xbf6f3231, 0x6f159276, 0xdf3cf24b,
+ 0x0eaba2c9, 0xbe82c2f4, 0x6ef862b3, 0xded1028e, 0xce0d223c,
+ 0x7e244201, 0xae5ee246, 0x1e77827b, 0x92b0e6b1, 0x2299868c,
+ 0xf2e326cb, 0x42ca46f6, 0x52166644, 0xe23f0679, 0x3245a63e,
+ 0x826cc603, 0x53fb9681, 0xe3d2f6bc, 0x33a856fb, 0x838136c6,
+ 0x935d1674, 0x23747649, 0xf30ed60e, 0x4327b633, 0x102706d1,
+ 0xa00e66ec, 0x7074c6ab, 0xc05da696, 0xd0818624, 0x60a8e619,
+ 0xb0d2465e, 0x00fb2663, 0xd16c76e1, 0x614516dc, 0xb13fb69b,
+ 0x0116d6a6, 0x11caf614, 0xa1e39629, 0x7199366e, 0xc1b05653,
+ 0x969f2770, 0x26b6474d, 0xf6cce70a, 0x46e58737, 0x5639a785,
+ 0xe610c7b8, 0x366a67ff, 0x864307c2, 0x57d45740, 0xe7fd377d,
+ 0x3787973a, 0x87aef707, 0x9772d7b5, 0x275bb788, 0xf72117cf,
+ 0x470877f2, 0x1408c710, 0xa421a72d, 0x745b076a, 0xc4726757,
+ 0xd4ae47e5, 0x648727d8, 0xb4fd879f, 0x04d4e7a2, 0xd543b720,
+ 0x656ad71d, 0xb510775a, 0x05391767, 0x15e537d5, 0xa5cc57e8,
+ 0x75b6f7af, 0xc59f9792, 0xdbe815e9, 0x6bc175d4, 0xbbbbd593,
+ 0x0b92b5ae, 0x1b4e951c, 0xab67f521, 0x7b1d5566, 0xcb34355b,
+ 0x1aa365d9, 0xaa8a05e4, 0x7af0a5a3, 0xcad9c59e, 0xda05e52c,
+ 0x6a2c8511, 0xba562556, 0x0a7f456b, 0x597ff589, 0xe95695b4,
+ 0x392c35f3, 0x890555ce, 0x99d9757c, 0x29f01541, 0xf98ab506,
+ 0x49a3d53b, 0x983485b9, 0x281de584, 0xf86745c3, 0x484e25fe,
+ 0x5892054c, 0xe8bb6571, 0x38c1c536, 0x88e8a50b, 0xdfc7d428,
+ 0x6feeb415, 0xbf941452, 0x0fbd746f, 0x1f6154dd, 0xaf4834e0,
+ 0x7f3294a7, 0xcf1bf49a, 0x1e8ca418, 0xaea5c425, 0x7edf6462,
+ 0xcef6045f, 0xde2a24ed, 0x6e0344d0, 0xbe79e497, 0x0e5084aa,
+ 0x5d503448, 0xed795475, 0x3d03f432, 0x8d2a940f, 0x9df6b4bd,
+ 0x2ddfd480, 0xfda574c7, 0x4d8c14fa, 0x9c1b4478, 0x2c322445,
+ 0xfc488402, 0x4c61e43f, 0x5cbdc48d, 0xec94a4b0, 0x3cee04f7,
+ 0x8cc764ca},
+ {0x00000000, 0xa5d35ccb, 0x0ba1c84d, 0xae729486, 0x1642919b,
+ 0xb391cd50, 0x1de359d6, 0xb830051d, 0x6d8253ec, 0xc8510f27,
+ 0x66239ba1, 0xc3f0c76a, 0x7bc0c277, 0xde139ebc, 0x70610a3a,
+ 0xd5b256f1, 0x9b02d603, 0x3ed18ac8, 0x90a31e4e, 0x35704285,
+ 0x8d404798, 0x28931b53, 0x86e18fd5, 0x2332d31e, 0xf68085ef,
+ 0x5353d924, 0xfd214da2, 0x58f21169, 0xe0c21474, 0x451148bf,
+ 0xeb63dc39, 0x4eb080f2, 0x3605ac07, 0x93d6f0cc, 0x3da4644a,
+ 0x98773881, 0x20473d9c, 0x85946157, 0x2be6f5d1, 0x8e35a91a,
+ 0x5b87ffeb, 0xfe54a320, 0x502637a6, 0xf5f56b6d, 0x4dc56e70,
+ 0xe81632bb, 0x4664a63d, 0xe3b7faf6, 0xad077a04, 0x08d426cf,
+ 0xa6a6b249, 0x0375ee82, 0xbb45eb9f, 0x1e96b754, 0xb0e423d2,
+ 0x15377f19, 0xc08529e8, 0x65567523, 0xcb24e1a5, 0x6ef7bd6e,
+ 0xd6c7b873, 0x7314e4b8, 0xdd66703e, 0x78b52cf5, 0x6c0a580f,
+ 0xc9d904c4, 0x67ab9042, 0xc278cc89, 0x7a48c994, 0xdf9b955f,
+ 0x71e901d9, 0xd43a5d12, 0x01880be3, 0xa45b5728, 0x0a29c3ae,
+ 0xaffa9f65, 0x17ca9a78, 0xb219c6b3, 0x1c6b5235, 0xb9b80efe,
+ 0xf7088e0c, 0x52dbd2c7, 0xfca94641, 0x597a1a8a, 0xe14a1f97,
+ 0x4499435c, 0xeaebd7da, 0x4f388b11, 0x9a8adde0, 0x3f59812b,
+ 0x912b15ad, 0x34f84966, 0x8cc84c7b, 0x291b10b0, 0x87698436,
+ 0x22bad8fd, 0x5a0ff408, 0xffdca8c3, 0x51ae3c45, 0xf47d608e,
+ 0x4c4d6593, 0xe99e3958, 0x47ecadde, 0xe23ff115, 0x378da7e4,
+ 0x925efb2f, 0x3c2c6fa9, 0x99ff3362, 0x21cf367f, 0x841c6ab4,
+ 0x2a6efe32, 0x8fbda2f9, 0xc10d220b, 0x64de7ec0, 0xcaacea46,
+ 0x6f7fb68d, 0xd74fb390, 0x729cef5b, 0xdcee7bdd, 0x793d2716,
+ 0xac8f71e7, 0x095c2d2c, 0xa72eb9aa, 0x02fde561, 0xbacde07c,
+ 0x1f1ebcb7, 0xb16c2831, 0x14bf74fa, 0xd814b01e, 0x7dc7ecd5,
+ 0xd3b57853, 0x76662498, 0xce562185, 0x6b857d4e, 0xc5f7e9c8,
+ 0x6024b503, 0xb596e3f2, 0x1045bf39, 0xbe372bbf, 0x1be47774,
+ 0xa3d47269, 0x06072ea2, 0xa875ba24, 0x0da6e6ef, 0x4316661d,
+ 0xe6c53ad6, 0x48b7ae50, 0xed64f29b, 0x5554f786, 0xf087ab4d,
+ 0x5ef53fcb, 0xfb266300, 0x2e9435f1, 0x8b47693a, 0x2535fdbc,
+ 0x80e6a177, 0x38d6a46a, 0x9d05f8a1, 0x33776c27, 0x96a430ec,
+ 0xee111c19, 0x4bc240d2, 0xe5b0d454, 0x4063889f, 0xf8538d82,
+ 0x5d80d149, 0xf3f245cf, 0x56211904, 0x83934ff5, 0x2640133e,
+ 0x883287b8, 0x2de1db73, 0x95d1de6e, 0x300282a5, 0x9e701623,
+ 0x3ba34ae8, 0x7513ca1a, 0xd0c096d1, 0x7eb20257, 0xdb615e9c,
+ 0x63515b81, 0xc682074a, 0x68f093cc, 0xcd23cf07, 0x189199f6,
+ 0xbd42c53d, 0x133051bb, 0xb6e30d70, 0x0ed3086d, 0xab0054a6,
+ 0x0572c020, 0xa0a19ceb, 0xb41ee811, 0x11cdb4da, 0xbfbf205c,
+ 0x1a6c7c97, 0xa25c798a, 0x078f2541, 0xa9fdb1c7, 0x0c2eed0c,
+ 0xd99cbbfd, 0x7c4fe736, 0xd23d73b0, 0x77ee2f7b, 0xcfde2a66,
+ 0x6a0d76ad, 0xc47fe22b, 0x61acbee0, 0x2f1c3e12, 0x8acf62d9,
+ 0x24bdf65f, 0x816eaa94, 0x395eaf89, 0x9c8df342, 0x32ff67c4,
+ 0x972c3b0f, 0x429e6dfe, 0xe74d3135, 0x493fa5b3, 0xececf978,
+ 0x54dcfc65, 0xf10fa0ae, 0x5f7d3428, 0xfaae68e3, 0x821b4416,
+ 0x27c818dd, 0x89ba8c5b, 0x2c69d090, 0x9459d58d, 0x318a8946,
+ 0x9ff81dc0, 0x3a2b410b, 0xef9917fa, 0x4a4a4b31, 0xe438dfb7,
+ 0x41eb837c, 0xf9db8661, 0x5c08daaa, 0xf27a4e2c, 0x57a912e7,
+ 0x19199215, 0xbccacede, 0x12b85a58, 0xb76b0693, 0x0f5b038e,
+ 0xaa885f45, 0x04facbc3, 0xa1299708, 0x749bc1f9, 0xd1489d32,
+ 0x7f3a09b4, 0xdae9557f, 0x62d95062, 0xc70a0ca9, 0x6978982f,
+ 0xccabc4e4},
+ {0x00000000, 0xb40b77a6, 0x29119f97, 0x9d1ae831, 0x13244ff4,
+ 0xa72f3852, 0x3a35d063, 0x8e3ea7c5, 0x674eef33, 0xd3459895,
+ 0x4e5f70a4, 0xfa540702, 0x746aa0c7, 0xc061d761, 0x5d7b3f50,
+ 0xe97048f6, 0xce9cde67, 0x7a97a9c1, 0xe78d41f0, 0x53863656,
+ 0xddb89193, 0x69b3e635, 0xf4a90e04, 0x40a279a2, 0xa9d23154,
+ 0x1dd946f2, 0x80c3aec3, 0x34c8d965, 0xbaf67ea0, 0x0efd0906,
+ 0x93e7e137, 0x27ec9691, 0x9c39bdcf, 0x2832ca69, 0xb5282258,
+ 0x012355fe, 0x8f1df23b, 0x3b16859d, 0xa60c6dac, 0x12071a0a,
+ 0xfb7752fc, 0x4f7c255a, 0xd266cd6b, 0x666dbacd, 0xe8531d08,
+ 0x5c586aae, 0xc142829f, 0x7549f539, 0x52a563a8, 0xe6ae140e,
+ 0x7bb4fc3f, 0xcfbf8b99, 0x41812c5c, 0xf58a5bfa, 0x6890b3cb,
+ 0xdc9bc46d, 0x35eb8c9b, 0x81e0fb3d, 0x1cfa130c, 0xa8f164aa,
+ 0x26cfc36f, 0x92c4b4c9, 0x0fde5cf8, 0xbbd52b5e, 0x79750b44,
+ 0xcd7e7ce2, 0x506494d3, 0xe46fe375, 0x6a5144b0, 0xde5a3316,
+ 0x4340db27, 0xf74bac81, 0x1e3be477, 0xaa3093d1, 0x372a7be0,
+ 0x83210c46, 0x0d1fab83, 0xb914dc25, 0x240e3414, 0x900543b2,
+ 0xb7e9d523, 0x03e2a285, 0x9ef84ab4, 0x2af33d12, 0xa4cd9ad7,
+ 0x10c6ed71, 0x8ddc0540, 0x39d772e6, 0xd0a73a10, 0x64ac4db6,
+ 0xf9b6a587, 0x4dbdd221, 0xc38375e4, 0x77880242, 0xea92ea73,
+ 0x5e999dd5, 0xe54cb68b, 0x5147c12d, 0xcc5d291c, 0x78565eba,
+ 0xf668f97f, 0x42638ed9, 0xdf7966e8, 0x6b72114e, 0x820259b8,
+ 0x36092e1e, 0xab13c62f, 0x1f18b189, 0x9126164c, 0x252d61ea,
+ 0xb83789db, 0x0c3cfe7d, 0x2bd068ec, 0x9fdb1f4a, 0x02c1f77b,
+ 0xb6ca80dd, 0x38f42718, 0x8cff50be, 0x11e5b88f, 0xa5eecf29,
+ 0x4c9e87df, 0xf895f079, 0x658f1848, 0xd1846fee, 0x5fbac82b,
+ 0xebb1bf8d, 0x76ab57bc, 0xc2a0201a, 0xf2ea1688, 0x46e1612e,
+ 0xdbfb891f, 0x6ff0feb9, 0xe1ce597c, 0x55c52eda, 0xc8dfc6eb,
+ 0x7cd4b14d, 0x95a4f9bb, 0x21af8e1d, 0xbcb5662c, 0x08be118a,
+ 0x8680b64f, 0x328bc1e9, 0xaf9129d8, 0x1b9a5e7e, 0x3c76c8ef,
+ 0x887dbf49, 0x15675778, 0xa16c20de, 0x2f52871b, 0x9b59f0bd,
+ 0x0643188c, 0xb2486f2a, 0x5b3827dc, 0xef33507a, 0x7229b84b,
+ 0xc622cfed, 0x481c6828, 0xfc171f8e, 0x610df7bf, 0xd5068019,
+ 0x6ed3ab47, 0xdad8dce1, 0x47c234d0, 0xf3c94376, 0x7df7e4b3,
+ 0xc9fc9315, 0x54e67b24, 0xe0ed0c82, 0x099d4474, 0xbd9633d2,
+ 0x208cdbe3, 0x9487ac45, 0x1ab90b80, 0xaeb27c26, 0x33a89417,
+ 0x87a3e3b1, 0xa04f7520, 0x14440286, 0x895eeab7, 0x3d559d11,
+ 0xb36b3ad4, 0x07604d72, 0x9a7aa543, 0x2e71d2e5, 0xc7019a13,
+ 0x730aedb5, 0xee100584, 0x5a1b7222, 0xd425d5e7, 0x602ea241,
+ 0xfd344a70, 0x493f3dd6, 0x8b9f1dcc, 0x3f946a6a, 0xa28e825b,
+ 0x1685f5fd, 0x98bb5238, 0x2cb0259e, 0xb1aacdaf, 0x05a1ba09,
+ 0xecd1f2ff, 0x58da8559, 0xc5c06d68, 0x71cb1ace, 0xfff5bd0b,
+ 0x4bfecaad, 0xd6e4229c, 0x62ef553a, 0x4503c3ab, 0xf108b40d,
+ 0x6c125c3c, 0xd8192b9a, 0x56278c5f, 0xe22cfbf9, 0x7f3613c8,
+ 0xcb3d646e, 0x224d2c98, 0x96465b3e, 0x0b5cb30f, 0xbf57c4a9,
+ 0x3169636c, 0x856214ca, 0x1878fcfb, 0xac738b5d, 0x17a6a003,
+ 0xa3add7a5, 0x3eb73f94, 0x8abc4832, 0x0482eff7, 0xb0899851,
+ 0x2d937060, 0x999807c6, 0x70e84f30, 0xc4e33896, 0x59f9d0a7,
+ 0xedf2a701, 0x63cc00c4, 0xd7c77762, 0x4add9f53, 0xfed6e8f5,
+ 0xd93a7e64, 0x6d3109c2, 0xf02be1f3, 0x44209655, 0xca1e3190,
+ 0x7e154636, 0xe30fae07, 0x5704d9a1, 0xbe749157, 0x0a7fe6f1,
+ 0x97650ec0, 0x236e7966, 0xad50dea3, 0x195ba905, 0x84414134,
+ 0x304a3692},
+ {0x00000000, 0x9e00aacc, 0x7d072542, 0xe3078f8e, 0xfa0e4a84,
+ 0x640ee048, 0x87096fc6, 0x1909c50a, 0xb51be5d3, 0x2b1b4f1f,
+ 0xc81cc091, 0x561c6a5d, 0x4f15af57, 0xd115059b, 0x32128a15,
+ 0xac1220d9, 0x2b31bb7c, 0xb53111b0, 0x56369e3e, 0xc83634f2,
+ 0xd13ff1f8, 0x4f3f5b34, 0xac38d4ba, 0x32387e76, 0x9e2a5eaf,
+ 0x002af463, 0xe32d7bed, 0x7d2dd121, 0x6424142b, 0xfa24bee7,
+ 0x19233169, 0x87239ba5, 0x566276f9, 0xc862dc35, 0x2b6553bb,
+ 0xb565f977, 0xac6c3c7d, 0x326c96b1, 0xd16b193f, 0x4f6bb3f3,
+ 0xe379932a, 0x7d7939e6, 0x9e7eb668, 0x007e1ca4, 0x1977d9ae,
+ 0x87777362, 0x6470fcec, 0xfa705620, 0x7d53cd85, 0xe3536749,
+ 0x0054e8c7, 0x9e54420b, 0x875d8701, 0x195d2dcd, 0xfa5aa243,
+ 0x645a088f, 0xc8482856, 0x5648829a, 0xb54f0d14, 0x2b4fa7d8,
+ 0x324662d2, 0xac46c81e, 0x4f414790, 0xd141ed5c, 0xedc29d29,
+ 0x73c237e5, 0x90c5b86b, 0x0ec512a7, 0x17ccd7ad, 0x89cc7d61,
+ 0x6acbf2ef, 0xf4cb5823, 0x58d978fa, 0xc6d9d236, 0x25de5db8,
+ 0xbbdef774, 0xa2d7327e, 0x3cd798b2, 0xdfd0173c, 0x41d0bdf0,
+ 0xc6f32655, 0x58f38c99, 0xbbf40317, 0x25f4a9db, 0x3cfd6cd1,
+ 0xa2fdc61d, 0x41fa4993, 0xdffae35f, 0x73e8c386, 0xede8694a,
+ 0x0eefe6c4, 0x90ef4c08, 0x89e68902, 0x17e623ce, 0xf4e1ac40,
+ 0x6ae1068c, 0xbba0ebd0, 0x25a0411c, 0xc6a7ce92, 0x58a7645e,
+ 0x41aea154, 0xdfae0b98, 0x3ca98416, 0xa2a92eda, 0x0ebb0e03,
+ 0x90bba4cf, 0x73bc2b41, 0xedbc818d, 0xf4b54487, 0x6ab5ee4b,
+ 0x89b261c5, 0x17b2cb09, 0x909150ac, 0x0e91fa60, 0xed9675ee,
+ 0x7396df22, 0x6a9f1a28, 0xf49fb0e4, 0x17983f6a, 0x899895a6,
+ 0x258ab57f, 0xbb8a1fb3, 0x588d903d, 0xc68d3af1, 0xdf84fffb,
+ 0x41845537, 0xa283dab9, 0x3c837075, 0xda853b53, 0x4485919f,
+ 0xa7821e11, 0x3982b4dd, 0x208b71d7, 0xbe8bdb1b, 0x5d8c5495,
+ 0xc38cfe59, 0x6f9ede80, 0xf19e744c, 0x1299fbc2, 0x8c99510e,
+ 0x95909404, 0x0b903ec8, 0xe897b146, 0x76971b8a, 0xf1b4802f,
+ 0x6fb42ae3, 0x8cb3a56d, 0x12b30fa1, 0x0bbacaab, 0x95ba6067,
+ 0x76bdefe9, 0xe8bd4525, 0x44af65fc, 0xdaafcf30, 0x39a840be,
+ 0xa7a8ea72, 0xbea12f78, 0x20a185b4, 0xc3a60a3a, 0x5da6a0f6,
+ 0x8ce74daa, 0x12e7e766, 0xf1e068e8, 0x6fe0c224, 0x76e9072e,
+ 0xe8e9ade2, 0x0bee226c, 0x95ee88a0, 0x39fca879, 0xa7fc02b5,
+ 0x44fb8d3b, 0xdafb27f7, 0xc3f2e2fd, 0x5df24831, 0xbef5c7bf,
+ 0x20f56d73, 0xa7d6f6d6, 0x39d65c1a, 0xdad1d394, 0x44d17958,
+ 0x5dd8bc52, 0xc3d8169e, 0x20df9910, 0xbedf33dc, 0x12cd1305,
+ 0x8ccdb9c9, 0x6fca3647, 0xf1ca9c8b, 0xe8c35981, 0x76c3f34d,
+ 0x95c47cc3, 0x0bc4d60f, 0x3747a67a, 0xa9470cb6, 0x4a408338,
+ 0xd44029f4, 0xcd49ecfe, 0x53494632, 0xb04ec9bc, 0x2e4e6370,
+ 0x825c43a9, 0x1c5ce965, 0xff5b66eb, 0x615bcc27, 0x7852092d,
+ 0xe652a3e1, 0x05552c6f, 0x9b5586a3, 0x1c761d06, 0x8276b7ca,
+ 0x61713844, 0xff719288, 0xe6785782, 0x7878fd4e, 0x9b7f72c0,
+ 0x057fd80c, 0xa96df8d5, 0x376d5219, 0xd46add97, 0x4a6a775b,
+ 0x5363b251, 0xcd63189d, 0x2e649713, 0xb0643ddf, 0x6125d083,
+ 0xff257a4f, 0x1c22f5c1, 0x82225f0d, 0x9b2b9a07, 0x052b30cb,
+ 0xe62cbf45, 0x782c1589, 0xd43e3550, 0x4a3e9f9c, 0xa9391012,
+ 0x3739bade, 0x2e307fd4, 0xb030d518, 0x53375a96, 0xcd37f05a,
+ 0x4a146bff, 0xd414c133, 0x37134ebd, 0xa913e471, 0xb01a217b,
+ 0x2e1a8bb7, 0xcd1d0439, 0x531daef5, 0xff0f8e2c, 0x610f24e0,
+ 0x8208ab6e, 0x1c0801a2, 0x0501c4a8, 0x9b016e64, 0x7806e1ea,
+ 0xe6064b26}};
+
+#endif
+
+#endif
+
+#if N == 3
+
+#if W == 8
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0x81256527, 0xd93bcc0f, 0x581ea928, 0x69069e5f,
+ 0xe823fb78, 0xb03d5250, 0x31183777, 0xd20d3cbe, 0x53285999,
+ 0x0b36f0b1, 0x8a139596, 0xbb0ba2e1, 0x3a2ec7c6, 0x62306eee,
+ 0xe3150bc9, 0x7f6b7f3d, 0xfe4e1a1a, 0xa650b332, 0x2775d615,
+ 0x166de162, 0x97488445, 0xcf562d6d, 0x4e73484a, 0xad664383,
+ 0x2c4326a4, 0x745d8f8c, 0xf578eaab, 0xc460dddc, 0x4545b8fb,
+ 0x1d5b11d3, 0x9c7e74f4, 0xfed6fe7a, 0x7ff39b5d, 0x27ed3275,
+ 0xa6c85752, 0x97d06025, 0x16f50502, 0x4eebac2a, 0xcfcec90d,
+ 0x2cdbc2c4, 0xadfea7e3, 0xf5e00ecb, 0x74c56bec, 0x45dd5c9b,
+ 0xc4f839bc, 0x9ce69094, 0x1dc3f5b3, 0x81bd8147, 0x0098e460,
+ 0x58864d48, 0xd9a3286f, 0xe8bb1f18, 0x699e7a3f, 0x3180d317,
+ 0xb0a5b630, 0x53b0bdf9, 0xd295d8de, 0x8a8b71f6, 0x0bae14d1,
+ 0x3ab623a6, 0xbb934681, 0xe38defa9, 0x62a88a8e, 0x26dcfab5,
+ 0xa7f99f92, 0xffe736ba, 0x7ec2539d, 0x4fda64ea, 0xceff01cd,
+ 0x96e1a8e5, 0x17c4cdc2, 0xf4d1c60b, 0x75f4a32c, 0x2dea0a04,
+ 0xaccf6f23, 0x9dd75854, 0x1cf23d73, 0x44ec945b, 0xc5c9f17c,
+ 0x59b78588, 0xd892e0af, 0x808c4987, 0x01a92ca0, 0x30b11bd7,
+ 0xb1947ef0, 0xe98ad7d8, 0x68afb2ff, 0x8bbab936, 0x0a9fdc11,
+ 0x52817539, 0xd3a4101e, 0xe2bc2769, 0x6399424e, 0x3b87eb66,
+ 0xbaa28e41, 0xd80a04cf, 0x592f61e8, 0x0131c8c0, 0x8014ade7,
+ 0xb10c9a90, 0x3029ffb7, 0x6837569f, 0xe91233b8, 0x0a073871,
+ 0x8b225d56, 0xd33cf47e, 0x52199159, 0x6301a62e, 0xe224c309,
+ 0xba3a6a21, 0x3b1f0f06, 0xa7617bf2, 0x26441ed5, 0x7e5ab7fd,
+ 0xff7fd2da, 0xce67e5ad, 0x4f42808a, 0x175c29a2, 0x96794c85,
+ 0x756c474c, 0xf449226b, 0xac578b43, 0x2d72ee64, 0x1c6ad913,
+ 0x9d4fbc34, 0xc551151c, 0x4474703b, 0x4db9f56a, 0xcc9c904d,
+ 0x94823965, 0x15a75c42, 0x24bf6b35, 0xa59a0e12, 0xfd84a73a,
+ 0x7ca1c21d, 0x9fb4c9d4, 0x1e91acf3, 0x468f05db, 0xc7aa60fc,
+ 0xf6b2578b, 0x779732ac, 0x2f899b84, 0xaeacfea3, 0x32d28a57,
+ 0xb3f7ef70, 0xebe94658, 0x6acc237f, 0x5bd41408, 0xdaf1712f,
+ 0x82efd807, 0x03cabd20, 0xe0dfb6e9, 0x61fad3ce, 0x39e47ae6,
+ 0xb8c11fc1, 0x89d928b6, 0x08fc4d91, 0x50e2e4b9, 0xd1c7819e,
+ 0xb36f0b10, 0x324a6e37, 0x6a54c71f, 0xeb71a238, 0xda69954f,
+ 0x5b4cf068, 0x03525940, 0x82773c67, 0x616237ae, 0xe0475289,
+ 0xb859fba1, 0x397c9e86, 0x0864a9f1, 0x8941ccd6, 0xd15f65fe,
+ 0x507a00d9, 0xcc04742d, 0x4d21110a, 0x153fb822, 0x941add05,
+ 0xa502ea72, 0x24278f55, 0x7c39267d, 0xfd1c435a, 0x1e094893,
+ 0x9f2c2db4, 0xc732849c, 0x4617e1bb, 0x770fd6cc, 0xf62ab3eb,
+ 0xae341ac3, 0x2f117fe4, 0x6b650fdf, 0xea406af8, 0xb25ec3d0,
+ 0x337ba6f7, 0x02639180, 0x8346f4a7, 0xdb585d8f, 0x5a7d38a8,
+ 0xb9683361, 0x384d5646, 0x6053ff6e, 0xe1769a49, 0xd06ead3e,
+ 0x514bc819, 0x09556131, 0x88700416, 0x140e70e2, 0x952b15c5,
+ 0xcd35bced, 0x4c10d9ca, 0x7d08eebd, 0xfc2d8b9a, 0xa43322b2,
+ 0x25164795, 0xc6034c5c, 0x4726297b, 0x1f388053, 0x9e1de574,
+ 0xaf05d203, 0x2e20b724, 0x763e1e0c, 0xf71b7b2b, 0x95b3f1a5,
+ 0x14969482, 0x4c883daa, 0xcdad588d, 0xfcb56ffa, 0x7d900add,
+ 0x258ea3f5, 0xa4abc6d2, 0x47becd1b, 0xc69ba83c, 0x9e850114,
+ 0x1fa06433, 0x2eb85344, 0xaf9d3663, 0xf7839f4b, 0x76a6fa6c,
+ 0xead88e98, 0x6bfdebbf, 0x33e34297, 0xb2c627b0, 0x83de10c7,
+ 0x02fb75e0, 0x5ae5dcc8, 0xdbc0b9ef, 0x38d5b226, 0xb9f0d701,
+ 0xe1ee7e29, 0x60cb1b0e, 0x51d32c79, 0xd0f6495e, 0x88e8e076,
+ 0x09cd8551},
+ {0x00000000, 0x9b73ead4, 0xed96d3e9, 0x76e5393d, 0x005ca193,
+ 0x9b2f4b47, 0xedca727a, 0x76b998ae, 0x00b94326, 0x9bcaa9f2,
+ 0xed2f90cf, 0x765c7a1b, 0x00e5e2b5, 0x9b960861, 0xed73315c,
+ 0x7600db88, 0x0172864c, 0x9a016c98, 0xece455a5, 0x7797bf71,
+ 0x012e27df, 0x9a5dcd0b, 0xecb8f436, 0x77cb1ee2, 0x01cbc56a,
+ 0x9ab82fbe, 0xec5d1683, 0x772efc57, 0x019764f9, 0x9ae48e2d,
+ 0xec01b710, 0x77725dc4, 0x02e50c98, 0x9996e64c, 0xef73df71,
+ 0x740035a5, 0x02b9ad0b, 0x99ca47df, 0xef2f7ee2, 0x745c9436,
+ 0x025c4fbe, 0x992fa56a, 0xefca9c57, 0x74b97683, 0x0200ee2d,
+ 0x997304f9, 0xef963dc4, 0x74e5d710, 0x03978ad4, 0x98e46000,
+ 0xee01593d, 0x7572b3e9, 0x03cb2b47, 0x98b8c193, 0xee5df8ae,
+ 0x752e127a, 0x032ec9f2, 0x985d2326, 0xeeb81a1b, 0x75cbf0cf,
+ 0x03726861, 0x980182b5, 0xeee4bb88, 0x7597515c, 0x05ca1930,
+ 0x9eb9f3e4, 0xe85ccad9, 0x732f200d, 0x0596b8a3, 0x9ee55277,
+ 0xe8006b4a, 0x7373819e, 0x05735a16, 0x9e00b0c2, 0xe8e589ff,
+ 0x7396632b, 0x052ffb85, 0x9e5c1151, 0xe8b9286c, 0x73cac2b8,
+ 0x04b89f7c, 0x9fcb75a8, 0xe92e4c95, 0x725da641, 0x04e43eef,
+ 0x9f97d43b, 0xe972ed06, 0x720107d2, 0x0401dc5a, 0x9f72368e,
+ 0xe9970fb3, 0x72e4e567, 0x045d7dc9, 0x9f2e971d, 0xe9cbae20,
+ 0x72b844f4, 0x072f15a8, 0x9c5cff7c, 0xeab9c641, 0x71ca2c95,
+ 0x0773b43b, 0x9c005eef, 0xeae567d2, 0x71968d06, 0x0796568e,
+ 0x9ce5bc5a, 0xea008567, 0x71736fb3, 0x07caf71d, 0x9cb91dc9,
+ 0xea5c24f4, 0x712fce20, 0x065d93e4, 0x9d2e7930, 0xebcb400d,
+ 0x70b8aad9, 0x06013277, 0x9d72d8a3, 0xeb97e19e, 0x70e40b4a,
+ 0x06e4d0c2, 0x9d973a16, 0xeb72032b, 0x7001e9ff, 0x06b87151,
+ 0x9dcb9b85, 0xeb2ea2b8, 0x705d486c, 0x0b943260, 0x90e7d8b4,
+ 0xe602e189, 0x7d710b5d, 0x0bc893f3, 0x90bb7927, 0xe65e401a,
+ 0x7d2daace, 0x0b2d7146, 0x905e9b92, 0xe6bba2af, 0x7dc8487b,
+ 0x0b71d0d5, 0x90023a01, 0xe6e7033c, 0x7d94e9e8, 0x0ae6b42c,
+ 0x91955ef8, 0xe77067c5, 0x7c038d11, 0x0aba15bf, 0x91c9ff6b,
+ 0xe72cc656, 0x7c5f2c82, 0x0a5ff70a, 0x912c1dde, 0xe7c924e3,
+ 0x7cbace37, 0x0a035699, 0x9170bc4d, 0xe7958570, 0x7ce66fa4,
+ 0x09713ef8, 0x9202d42c, 0xe4e7ed11, 0x7f9407c5, 0x092d9f6b,
+ 0x925e75bf, 0xe4bb4c82, 0x7fc8a656, 0x09c87dde, 0x92bb970a,
+ 0xe45eae37, 0x7f2d44e3, 0x0994dc4d, 0x92e73699, 0xe4020fa4,
+ 0x7f71e570, 0x0803b8b4, 0x93705260, 0xe5956b5d, 0x7ee68189,
+ 0x085f1927, 0x932cf3f3, 0xe5c9cace, 0x7eba201a, 0x08bafb92,
+ 0x93c91146, 0xe52c287b, 0x7e5fc2af, 0x08e65a01, 0x9395b0d5,
+ 0xe57089e8, 0x7e03633c, 0x0e5e2b50, 0x952dc184, 0xe3c8f8b9,
+ 0x78bb126d, 0x0e028ac3, 0x95716017, 0xe394592a, 0x78e7b3fe,
+ 0x0ee76876, 0x959482a2, 0xe371bb9f, 0x7802514b, 0x0ebbc9e5,
+ 0x95c82331, 0xe32d1a0c, 0x785ef0d8, 0x0f2cad1c, 0x945f47c8,
+ 0xe2ba7ef5, 0x79c99421, 0x0f700c8f, 0x9403e65b, 0xe2e6df66,
+ 0x799535b2, 0x0f95ee3a, 0x94e604ee, 0xe2033dd3, 0x7970d707,
+ 0x0fc94fa9, 0x94baa57d, 0xe25f9c40, 0x792c7694, 0x0cbb27c8,
+ 0x97c8cd1c, 0xe12df421, 0x7a5e1ef5, 0x0ce7865b, 0x97946c8f,
+ 0xe17155b2, 0x7a02bf66, 0x0c0264ee, 0x97718e3a, 0xe194b707,
+ 0x7ae75dd3, 0x0c5ec57d, 0x972d2fa9, 0xe1c81694, 0x7abbfc40,
+ 0x0dc9a184, 0x96ba4b50, 0xe05f726d, 0x7b2c98b9, 0x0d950017,
+ 0x96e6eac3, 0xe003d3fe, 0x7b70392a, 0x0d70e2a2, 0x96030876,
+ 0xe0e6314b, 0x7b95db9f, 0x0d2c4331, 0x965fa9e5, 0xe0ba90d8,
+ 0x7bc97a0c},
+ {0x00000000, 0x172864c0, 0x2e50c980, 0x3978ad40, 0x5ca19300,
+ 0x4b89f7c0, 0x72f15a80, 0x65d93e40, 0xb9432600, 0xae6b42c0,
+ 0x9713ef80, 0x803b8b40, 0xe5e2b500, 0xf2cad1c0, 0xcbb27c80,
+ 0xdc9a1840, 0xa9f74a41, 0xbedf2e81, 0x87a783c1, 0x908fe701,
+ 0xf556d941, 0xe27ebd81, 0xdb0610c1, 0xcc2e7401, 0x10b46c41,
+ 0x079c0881, 0x3ee4a5c1, 0x29ccc101, 0x4c15ff41, 0x5b3d9b81,
+ 0x624536c1, 0x756d5201, 0x889f92c3, 0x9fb7f603, 0xa6cf5b43,
+ 0xb1e73f83, 0xd43e01c3, 0xc3166503, 0xfa6ec843, 0xed46ac83,
+ 0x31dcb4c3, 0x26f4d003, 0x1f8c7d43, 0x08a41983, 0x6d7d27c3,
+ 0x7a554303, 0x432dee43, 0x54058a83, 0x2168d882, 0x3640bc42,
+ 0x0f381102, 0x181075c2, 0x7dc94b82, 0x6ae12f42, 0x53998202,
+ 0x44b1e6c2, 0x982bfe82, 0x8f039a42, 0xb67b3702, 0xa15353c2,
+ 0xc48a6d82, 0xd3a20942, 0xeadaa402, 0xfdf2c0c2, 0xca4e23c7,
+ 0xdd664707, 0xe41eea47, 0xf3368e87, 0x96efb0c7, 0x81c7d407,
+ 0xb8bf7947, 0xaf971d87, 0x730d05c7, 0x64256107, 0x5d5dcc47,
+ 0x4a75a887, 0x2fac96c7, 0x3884f207, 0x01fc5f47, 0x16d43b87,
+ 0x63b96986, 0x74910d46, 0x4de9a006, 0x5ac1c4c6, 0x3f18fa86,
+ 0x28309e46, 0x11483306, 0x066057c6, 0xdafa4f86, 0xcdd22b46,
+ 0xf4aa8606, 0xe382e2c6, 0x865bdc86, 0x9173b846, 0xa80b1506,
+ 0xbf2371c6, 0x42d1b104, 0x55f9d5c4, 0x6c817884, 0x7ba91c44,
+ 0x1e702204, 0x095846c4, 0x3020eb84, 0x27088f44, 0xfb929704,
+ 0xecbaf3c4, 0xd5c25e84, 0xc2ea3a44, 0xa7330404, 0xb01b60c4,
+ 0x8963cd84, 0x9e4ba944, 0xeb26fb45, 0xfc0e9f85, 0xc57632c5,
+ 0xd25e5605, 0xb7876845, 0xa0af0c85, 0x99d7a1c5, 0x8effc505,
+ 0x5265dd45, 0x454db985, 0x7c3514c5, 0x6b1d7005, 0x0ec44e45,
+ 0x19ec2a85, 0x209487c5, 0x37bce305, 0x4fed41cf, 0x58c5250f,
+ 0x61bd884f, 0x7695ec8f, 0x134cd2cf, 0x0464b60f, 0x3d1c1b4f,
+ 0x2a347f8f, 0xf6ae67cf, 0xe186030f, 0xd8feae4f, 0xcfd6ca8f,
+ 0xaa0ff4cf, 0xbd27900f, 0x845f3d4f, 0x9377598f, 0xe61a0b8e,
+ 0xf1326f4e, 0xc84ac20e, 0xdf62a6ce, 0xbabb988e, 0xad93fc4e,
+ 0x94eb510e, 0x83c335ce, 0x5f592d8e, 0x4871494e, 0x7109e40e,
+ 0x662180ce, 0x03f8be8e, 0x14d0da4e, 0x2da8770e, 0x3a8013ce,
+ 0xc772d30c, 0xd05ab7cc, 0xe9221a8c, 0xfe0a7e4c, 0x9bd3400c,
+ 0x8cfb24cc, 0xb583898c, 0xa2abed4c, 0x7e31f50c, 0x691991cc,
+ 0x50613c8c, 0x4749584c, 0x2290660c, 0x35b802cc, 0x0cc0af8c,
+ 0x1be8cb4c, 0x6e85994d, 0x79adfd8d, 0x40d550cd, 0x57fd340d,
+ 0x32240a4d, 0x250c6e8d, 0x1c74c3cd, 0x0b5ca70d, 0xd7c6bf4d,
+ 0xc0eedb8d, 0xf99676cd, 0xeebe120d, 0x8b672c4d, 0x9c4f488d,
+ 0xa537e5cd, 0xb21f810d, 0x85a36208, 0x928b06c8, 0xabf3ab88,
+ 0xbcdbcf48, 0xd902f108, 0xce2a95c8, 0xf7523888, 0xe07a5c48,
+ 0x3ce04408, 0x2bc820c8, 0x12b08d88, 0x0598e948, 0x6041d708,
+ 0x7769b3c8, 0x4e111e88, 0x59397a48, 0x2c542849, 0x3b7c4c89,
+ 0x0204e1c9, 0x152c8509, 0x70f5bb49, 0x67dddf89, 0x5ea572c9,
+ 0x498d1609, 0x95170e49, 0x823f6a89, 0xbb47c7c9, 0xac6fa309,
+ 0xc9b69d49, 0xde9ef989, 0xe7e654c9, 0xf0ce3009, 0x0d3cf0cb,
+ 0x1a14940b, 0x236c394b, 0x34445d8b, 0x519d63cb, 0x46b5070b,
+ 0x7fcdaa4b, 0x68e5ce8b, 0xb47fd6cb, 0xa357b20b, 0x9a2f1f4b,
+ 0x8d077b8b, 0xe8de45cb, 0xfff6210b, 0xc68e8c4b, 0xd1a6e88b,
+ 0xa4cbba8a, 0xb3e3de4a, 0x8a9b730a, 0x9db317ca, 0xf86a298a,
+ 0xef424d4a, 0xd63ae00a, 0xc11284ca, 0x1d889c8a, 0x0aa0f84a,
+ 0x33d8550a, 0x24f031ca, 0x41290f8a, 0x56016b4a, 0x6f79c60a,
+ 0x7851a2ca},
+ {0x00000000, 0x9fda839e, 0xe4c4017d, 0x7b1e82e3, 0x12f904bb,
+ 0x8d238725, 0xf63d05c6, 0x69e78658, 0x25f20976, 0xba288ae8,
+ 0xc136080b, 0x5eec8b95, 0x370b0dcd, 0xa8d18e53, 0xd3cf0cb0,
+ 0x4c158f2e, 0x4be412ec, 0xd43e9172, 0xaf201391, 0x30fa900f,
+ 0x591d1657, 0xc6c795c9, 0xbdd9172a, 0x220394b4, 0x6e161b9a,
+ 0xf1cc9804, 0x8ad21ae7, 0x15089979, 0x7cef1f21, 0xe3359cbf,
+ 0x982b1e5c, 0x07f19dc2, 0x97c825d8, 0x0812a646, 0x730c24a5,
+ 0xecd6a73b, 0x85312163, 0x1aeba2fd, 0x61f5201e, 0xfe2fa380,
+ 0xb23a2cae, 0x2de0af30, 0x56fe2dd3, 0xc924ae4d, 0xa0c32815,
+ 0x3f19ab8b, 0x44072968, 0xdbddaaf6, 0xdc2c3734, 0x43f6b4aa,
+ 0x38e83649, 0xa732b5d7, 0xced5338f, 0x510fb011, 0x2a1132f2,
+ 0xb5cbb16c, 0xf9de3e42, 0x6604bddc, 0x1d1a3f3f, 0x82c0bca1,
+ 0xeb273af9, 0x74fdb967, 0x0fe33b84, 0x9039b81a, 0xf4e14df1,
+ 0x6b3bce6f, 0x10254c8c, 0x8fffcf12, 0xe618494a, 0x79c2cad4,
+ 0x02dc4837, 0x9d06cba9, 0xd1134487, 0x4ec9c719, 0x35d745fa,
+ 0xaa0dc664, 0xc3ea403c, 0x5c30c3a2, 0x272e4141, 0xb8f4c2df,
+ 0xbf055f1d, 0x20dfdc83, 0x5bc15e60, 0xc41bddfe, 0xadfc5ba6,
+ 0x3226d838, 0x49385adb, 0xd6e2d945, 0x9af7566b, 0x052dd5f5,
+ 0x7e335716, 0xe1e9d488, 0x880e52d0, 0x17d4d14e, 0x6cca53ad,
+ 0xf310d033, 0x63296829, 0xfcf3ebb7, 0x87ed6954, 0x1837eaca,
+ 0x71d06c92, 0xee0aef0c, 0x95146def, 0x0aceee71, 0x46db615f,
+ 0xd901e2c1, 0xa21f6022, 0x3dc5e3bc, 0x542265e4, 0xcbf8e67a,
+ 0xb0e66499, 0x2f3ce707, 0x28cd7ac5, 0xb717f95b, 0xcc097bb8,
+ 0x53d3f826, 0x3a347e7e, 0xa5eefde0, 0xdef07f03, 0x412afc9d,
+ 0x0d3f73b3, 0x92e5f02d, 0xe9fb72ce, 0x7621f150, 0x1fc67708,
+ 0x801cf496, 0xfb027675, 0x64d8f5eb, 0x32b39da3, 0xad691e3d,
+ 0xd6779cde, 0x49ad1f40, 0x204a9918, 0xbf901a86, 0xc48e9865,
+ 0x5b541bfb, 0x174194d5, 0x889b174b, 0xf38595a8, 0x6c5f1636,
+ 0x05b8906e, 0x9a6213f0, 0xe17c9113, 0x7ea6128d, 0x79578f4f,
+ 0xe68d0cd1, 0x9d938e32, 0x02490dac, 0x6bae8bf4, 0xf474086a,
+ 0x8f6a8a89, 0x10b00917, 0x5ca58639, 0xc37f05a7, 0xb8618744,
+ 0x27bb04da, 0x4e5c8282, 0xd186011c, 0xaa9883ff, 0x35420061,
+ 0xa57bb87b, 0x3aa13be5, 0x41bfb906, 0xde653a98, 0xb782bcc0,
+ 0x28583f5e, 0x5346bdbd, 0xcc9c3e23, 0x8089b10d, 0x1f533293,
+ 0x644db070, 0xfb9733ee, 0x9270b5b6, 0x0daa3628, 0x76b4b4cb,
+ 0xe96e3755, 0xee9faa97, 0x71452909, 0x0a5babea, 0x95812874,
+ 0xfc66ae2c, 0x63bc2db2, 0x18a2af51, 0x87782ccf, 0xcb6da3e1,
+ 0x54b7207f, 0x2fa9a29c, 0xb0732102, 0xd994a75a, 0x464e24c4,
+ 0x3d50a627, 0xa28a25b9, 0xc652d052, 0x598853cc, 0x2296d12f,
+ 0xbd4c52b1, 0xd4abd4e9, 0x4b715777, 0x306fd594, 0xafb5560a,
+ 0xe3a0d924, 0x7c7a5aba, 0x0764d859, 0x98be5bc7, 0xf159dd9f,
+ 0x6e835e01, 0x159ddce2, 0x8a475f7c, 0x8db6c2be, 0x126c4120,
+ 0x6972c3c3, 0xf6a8405d, 0x9f4fc605, 0x0095459b, 0x7b8bc778,
+ 0xe45144e6, 0xa844cbc8, 0x379e4856, 0x4c80cab5, 0xd35a492b,
+ 0xbabdcf73, 0x25674ced, 0x5e79ce0e, 0xc1a34d90, 0x519af58a,
+ 0xce407614, 0xb55ef4f7, 0x2a847769, 0x4363f131, 0xdcb972af,
+ 0xa7a7f04c, 0x387d73d2, 0x7468fcfc, 0xebb27f62, 0x90acfd81,
+ 0x0f767e1f, 0x6691f847, 0xf94b7bd9, 0x8255f93a, 0x1d8f7aa4,
+ 0x1a7ee766, 0x85a464f8, 0xfebae61b, 0x61606585, 0x0887e3dd,
+ 0x975d6043, 0xec43e2a0, 0x7399613e, 0x3f8cee10, 0xa0566d8e,
+ 0xdb48ef6d, 0x44926cf3, 0x2d75eaab, 0xb2af6935, 0xc9b1ebd6,
+ 0x566b6848},
+ {0x00000000, 0x65673b46, 0xcace768c, 0xafa94dca, 0x4eedeb59,
+ 0x2b8ad01f, 0x84239dd5, 0xe144a693, 0x9ddbd6b2, 0xf8bcedf4,
+ 0x5715a03e, 0x32729b78, 0xd3363deb, 0xb65106ad, 0x19f84b67,
+ 0x7c9f7021, 0xe0c6ab25, 0x85a19063, 0x2a08dda9, 0x4f6fe6ef,
+ 0xae2b407c, 0xcb4c7b3a, 0x64e536f0, 0x01820db6, 0x7d1d7d97,
+ 0x187a46d1, 0xb7d30b1b, 0xd2b4305d, 0x33f096ce, 0x5697ad88,
+ 0xf93ee042, 0x9c59db04, 0x1afc500b, 0x7f9b6b4d, 0xd0322687,
+ 0xb5551dc1, 0x5411bb52, 0x31768014, 0x9edfcdde, 0xfbb8f698,
+ 0x872786b9, 0xe240bdff, 0x4de9f035, 0x288ecb73, 0xc9ca6de0,
+ 0xacad56a6, 0x03041b6c, 0x6663202a, 0xfa3afb2e, 0x9f5dc068,
+ 0x30f48da2, 0x5593b6e4, 0xb4d71077, 0xd1b02b31, 0x7e1966fb,
+ 0x1b7e5dbd, 0x67e12d9c, 0x028616da, 0xad2f5b10, 0xc8486056,
+ 0x290cc6c5, 0x4c6bfd83, 0xe3c2b049, 0x86a58b0f, 0x35f8a016,
+ 0x509f9b50, 0xff36d69a, 0x9a51eddc, 0x7b154b4f, 0x1e727009,
+ 0xb1db3dc3, 0xd4bc0685, 0xa82376a4, 0xcd444de2, 0x62ed0028,
+ 0x078a3b6e, 0xe6ce9dfd, 0x83a9a6bb, 0x2c00eb71, 0x4967d037,
+ 0xd53e0b33, 0xb0593075, 0x1ff07dbf, 0x7a9746f9, 0x9bd3e06a,
+ 0xfeb4db2c, 0x511d96e6, 0x347aada0, 0x48e5dd81, 0x2d82e6c7,
+ 0x822bab0d, 0xe74c904b, 0x060836d8, 0x636f0d9e, 0xccc64054,
+ 0xa9a17b12, 0x2f04f01d, 0x4a63cb5b, 0xe5ca8691, 0x80adbdd7,
+ 0x61e91b44, 0x048e2002, 0xab276dc8, 0xce40568e, 0xb2df26af,
+ 0xd7b81de9, 0x78115023, 0x1d766b65, 0xfc32cdf6, 0x9955f6b0,
+ 0x36fcbb7a, 0x539b803c, 0xcfc25b38, 0xaaa5607e, 0x050c2db4,
+ 0x606b16f2, 0x812fb061, 0xe4488b27, 0x4be1c6ed, 0x2e86fdab,
+ 0x52198d8a, 0x377eb6cc, 0x98d7fb06, 0xfdb0c040, 0x1cf466d3,
+ 0x79935d95, 0xd63a105f, 0xb35d2b19, 0x6bf1402c, 0x0e967b6a,
+ 0xa13f36a0, 0xc4580de6, 0x251cab75, 0x407b9033, 0xefd2ddf9,
+ 0x8ab5e6bf, 0xf62a969e, 0x934dadd8, 0x3ce4e012, 0x5983db54,
+ 0xb8c77dc7, 0xdda04681, 0x72090b4b, 0x176e300d, 0x8b37eb09,
+ 0xee50d04f, 0x41f99d85, 0x249ea6c3, 0xc5da0050, 0xa0bd3b16,
+ 0x0f1476dc, 0x6a734d9a, 0x16ec3dbb, 0x738b06fd, 0xdc224b37,
+ 0xb9457071, 0x5801d6e2, 0x3d66eda4, 0x92cfa06e, 0xf7a89b28,
+ 0x710d1027, 0x146a2b61, 0xbbc366ab, 0xdea45ded, 0x3fe0fb7e,
+ 0x5a87c038, 0xf52e8df2, 0x9049b6b4, 0xecd6c695, 0x89b1fdd3,
+ 0x2618b019, 0x437f8b5f, 0xa23b2dcc, 0xc75c168a, 0x68f55b40,
+ 0x0d926006, 0x91cbbb02, 0xf4ac8044, 0x5b05cd8e, 0x3e62f6c8,
+ 0xdf26505b, 0xba416b1d, 0x15e826d7, 0x708f1d91, 0x0c106db0,
+ 0x697756f6, 0xc6de1b3c, 0xa3b9207a, 0x42fd86e9, 0x279abdaf,
+ 0x8833f065, 0xed54cb23, 0x5e09e03a, 0x3b6edb7c, 0x94c796b6,
+ 0xf1a0adf0, 0x10e40b63, 0x75833025, 0xda2a7def, 0xbf4d46a9,
+ 0xc3d23688, 0xa6b50dce, 0x091c4004, 0x6c7b7b42, 0x8d3fddd1,
+ 0xe858e697, 0x47f1ab5d, 0x2296901b, 0xbecf4b1f, 0xdba87059,
+ 0x74013d93, 0x116606d5, 0xf022a046, 0x95459b00, 0x3aecd6ca,
+ 0x5f8bed8c, 0x23149dad, 0x4673a6eb, 0xe9daeb21, 0x8cbdd067,
+ 0x6df976f4, 0x089e4db2, 0xa7370078, 0xc2503b3e, 0x44f5b031,
+ 0x21928b77, 0x8e3bc6bd, 0xeb5cfdfb, 0x0a185b68, 0x6f7f602e,
+ 0xc0d62de4, 0xa5b116a2, 0xd92e6683, 0xbc495dc5, 0x13e0100f,
+ 0x76872b49, 0x97c38dda, 0xf2a4b69c, 0x5d0dfb56, 0x386ac010,
+ 0xa4331b14, 0xc1542052, 0x6efd6d98, 0x0b9a56de, 0xeadef04d,
+ 0x8fb9cb0b, 0x201086c1, 0x4577bd87, 0x39e8cda6, 0x5c8ff6e0,
+ 0xf326bb2a, 0x9641806c, 0x770526ff, 0x12621db9, 0xbdcb5073,
+ 0xd8ac6b35},
+ {0x00000000, 0xd7e28058, 0x74b406f1, 0xa35686a9, 0xe9680de2,
+ 0x3e8a8dba, 0x9ddc0b13, 0x4a3e8b4b, 0x09a11d85, 0xde439ddd,
+ 0x7d151b74, 0xaaf79b2c, 0xe0c91067, 0x372b903f, 0x947d1696,
+ 0x439f96ce, 0x13423b0a, 0xc4a0bb52, 0x67f63dfb, 0xb014bda3,
+ 0xfa2a36e8, 0x2dc8b6b0, 0x8e9e3019, 0x597cb041, 0x1ae3268f,
+ 0xcd01a6d7, 0x6e57207e, 0xb9b5a026, 0xf38b2b6d, 0x2469ab35,
+ 0x873f2d9c, 0x50ddadc4, 0x26847614, 0xf166f64c, 0x523070e5,
+ 0x85d2f0bd, 0xcfec7bf6, 0x180efbae, 0xbb587d07, 0x6cbafd5f,
+ 0x2f256b91, 0xf8c7ebc9, 0x5b916d60, 0x8c73ed38, 0xc64d6673,
+ 0x11afe62b, 0xb2f96082, 0x651be0da, 0x35c64d1e, 0xe224cd46,
+ 0x41724bef, 0x9690cbb7, 0xdcae40fc, 0x0b4cc0a4, 0xa81a460d,
+ 0x7ff8c655, 0x3c67509b, 0xeb85d0c3, 0x48d3566a, 0x9f31d632,
+ 0xd50f5d79, 0x02eddd21, 0xa1bb5b88, 0x7659dbd0, 0x4d08ec28,
+ 0x9aea6c70, 0x39bcead9, 0xee5e6a81, 0xa460e1ca, 0x73826192,
+ 0xd0d4e73b, 0x07366763, 0x44a9f1ad, 0x934b71f5, 0x301df75c,
+ 0xe7ff7704, 0xadc1fc4f, 0x7a237c17, 0xd975fabe, 0x0e977ae6,
+ 0x5e4ad722, 0x89a8577a, 0x2afed1d3, 0xfd1c518b, 0xb722dac0,
+ 0x60c05a98, 0xc396dc31, 0x14745c69, 0x57ebcaa7, 0x80094aff,
+ 0x235fcc56, 0xf4bd4c0e, 0xbe83c745, 0x6961471d, 0xca37c1b4,
+ 0x1dd541ec, 0x6b8c9a3c, 0xbc6e1a64, 0x1f389ccd, 0xc8da1c95,
+ 0x82e497de, 0x55061786, 0xf650912f, 0x21b21177, 0x622d87b9,
+ 0xb5cf07e1, 0x16998148, 0xc17b0110, 0x8b458a5b, 0x5ca70a03,
+ 0xfff18caa, 0x28130cf2, 0x78cea136, 0xaf2c216e, 0x0c7aa7c7,
+ 0xdb98279f, 0x91a6acd4, 0x46442c8c, 0xe512aa25, 0x32f02a7d,
+ 0x716fbcb3, 0xa68d3ceb, 0x05dbba42, 0xd2393a1a, 0x9807b151,
+ 0x4fe53109, 0xecb3b7a0, 0x3b5137f8, 0x9a11d850, 0x4df35808,
+ 0xeea5dea1, 0x39475ef9, 0x7379d5b2, 0xa49b55ea, 0x07cdd343,
+ 0xd02f531b, 0x93b0c5d5, 0x4452458d, 0xe704c324, 0x30e6437c,
+ 0x7ad8c837, 0xad3a486f, 0x0e6ccec6, 0xd98e4e9e, 0x8953e35a,
+ 0x5eb16302, 0xfde7e5ab, 0x2a0565f3, 0x603beeb8, 0xb7d96ee0,
+ 0x148fe849, 0xc36d6811, 0x80f2fedf, 0x57107e87, 0xf446f82e,
+ 0x23a47876, 0x699af33d, 0xbe787365, 0x1d2ef5cc, 0xcacc7594,
+ 0xbc95ae44, 0x6b772e1c, 0xc821a8b5, 0x1fc328ed, 0x55fda3a6,
+ 0x821f23fe, 0x2149a557, 0xf6ab250f, 0xb534b3c1, 0x62d63399,
+ 0xc180b530, 0x16623568, 0x5c5cbe23, 0x8bbe3e7b, 0x28e8b8d2,
+ 0xff0a388a, 0xafd7954e, 0x78351516, 0xdb6393bf, 0x0c8113e7,
+ 0x46bf98ac, 0x915d18f4, 0x320b9e5d, 0xe5e91e05, 0xa67688cb,
+ 0x71940893, 0xd2c28e3a, 0x05200e62, 0x4f1e8529, 0x98fc0571,
+ 0x3baa83d8, 0xec480380, 0xd7193478, 0x00fbb420, 0xa3ad3289,
+ 0x744fb2d1, 0x3e71399a, 0xe993b9c2, 0x4ac53f6b, 0x9d27bf33,
+ 0xdeb829fd, 0x095aa9a5, 0xaa0c2f0c, 0x7deeaf54, 0x37d0241f,
+ 0xe032a447, 0x436422ee, 0x9486a2b6, 0xc45b0f72, 0x13b98f2a,
+ 0xb0ef0983, 0x670d89db, 0x2d330290, 0xfad182c8, 0x59870461,
+ 0x8e658439, 0xcdfa12f7, 0x1a1892af, 0xb94e1406, 0x6eac945e,
+ 0x24921f15, 0xf3709f4d, 0x502619e4, 0x87c499bc, 0xf19d426c,
+ 0x267fc234, 0x8529449d, 0x52cbc4c5, 0x18f54f8e, 0xcf17cfd6,
+ 0x6c41497f, 0xbba3c927, 0xf83c5fe9, 0x2fdedfb1, 0x8c885918,
+ 0x5b6ad940, 0x1154520b, 0xc6b6d253, 0x65e054fa, 0xb202d4a2,
+ 0xe2df7966, 0x353df93e, 0x966b7f97, 0x4189ffcf, 0x0bb77484,
+ 0xdc55f4dc, 0x7f037275, 0xa8e1f22d, 0xeb7e64e3, 0x3c9ce4bb,
+ 0x9fca6212, 0x4828e24a, 0x02166901, 0xd5f4e959, 0x76a26ff0,
+ 0xa140efa8},
+ {0x00000000, 0xef52b6e1, 0x05d46b83, 0xea86dd62, 0x0ba8d706,
+ 0xe4fa61e7, 0x0e7cbc85, 0xe12e0a64, 0x1751ae0c, 0xf80318ed,
+ 0x1285c58f, 0xfdd7736e, 0x1cf9790a, 0xf3abcfeb, 0x192d1289,
+ 0xf67fa468, 0x2ea35c18, 0xc1f1eaf9, 0x2b77379b, 0xc425817a,
+ 0x250b8b1e, 0xca593dff, 0x20dfe09d, 0xcf8d567c, 0x39f2f214,
+ 0xd6a044f5, 0x3c269997, 0xd3742f76, 0x325a2512, 0xdd0893f3,
+ 0x378e4e91, 0xd8dcf870, 0x5d46b830, 0xb2140ed1, 0x5892d3b3,
+ 0xb7c06552, 0x56ee6f36, 0xb9bcd9d7, 0x533a04b5, 0xbc68b254,
+ 0x4a17163c, 0xa545a0dd, 0x4fc37dbf, 0xa091cb5e, 0x41bfc13a,
+ 0xaeed77db, 0x446baab9, 0xab391c58, 0x73e5e428, 0x9cb752c9,
+ 0x76318fab, 0x9963394a, 0x784d332e, 0x971f85cf, 0x7d9958ad,
+ 0x92cbee4c, 0x64b44a24, 0x8be6fcc5, 0x616021a7, 0x8e329746,
+ 0x6f1c9d22, 0x804e2bc3, 0x6ac8f6a1, 0x859a4040, 0xba8d7060,
+ 0x55dfc681, 0xbf591be3, 0x500bad02, 0xb125a766, 0x5e771187,
+ 0xb4f1cce5, 0x5ba37a04, 0xaddcde6c, 0x428e688d, 0xa808b5ef,
+ 0x475a030e, 0xa674096a, 0x4926bf8b, 0xa3a062e9, 0x4cf2d408,
+ 0x942e2c78, 0x7b7c9a99, 0x91fa47fb, 0x7ea8f11a, 0x9f86fb7e,
+ 0x70d44d9f, 0x9a5290fd, 0x7500261c, 0x837f8274, 0x6c2d3495,
+ 0x86abe9f7, 0x69f95f16, 0x88d75572, 0x6785e393, 0x8d033ef1,
+ 0x62518810, 0xe7cbc850, 0x08997eb1, 0xe21fa3d3, 0x0d4d1532,
+ 0xec631f56, 0x0331a9b7, 0xe9b774d5, 0x06e5c234, 0xf09a665c,
+ 0x1fc8d0bd, 0xf54e0ddf, 0x1a1cbb3e, 0xfb32b15a, 0x146007bb,
+ 0xfee6dad9, 0x11b46c38, 0xc9689448, 0x263a22a9, 0xccbcffcb,
+ 0x23ee492a, 0xc2c0434e, 0x2d92f5af, 0xc71428cd, 0x28469e2c,
+ 0xde393a44, 0x316b8ca5, 0xdbed51c7, 0x34bfe726, 0xd591ed42,
+ 0x3ac35ba3, 0xd04586c1, 0x3f173020, 0xae6be681, 0x41395060,
+ 0xabbf8d02, 0x44ed3be3, 0xa5c33187, 0x4a918766, 0xa0175a04,
+ 0x4f45ece5, 0xb93a488d, 0x5668fe6c, 0xbcee230e, 0x53bc95ef,
+ 0xb2929f8b, 0x5dc0296a, 0xb746f408, 0x581442e9, 0x80c8ba99,
+ 0x6f9a0c78, 0x851cd11a, 0x6a4e67fb, 0x8b606d9f, 0x6432db7e,
+ 0x8eb4061c, 0x61e6b0fd, 0x97991495, 0x78cba274, 0x924d7f16,
+ 0x7d1fc9f7, 0x9c31c393, 0x73637572, 0x99e5a810, 0x76b71ef1,
+ 0xf32d5eb1, 0x1c7fe850, 0xf6f93532, 0x19ab83d3, 0xf88589b7,
+ 0x17d73f56, 0xfd51e234, 0x120354d5, 0xe47cf0bd, 0x0b2e465c,
+ 0xe1a89b3e, 0x0efa2ddf, 0xefd427bb, 0x0086915a, 0xea004c38,
+ 0x0552fad9, 0xdd8e02a9, 0x32dcb448, 0xd85a692a, 0x3708dfcb,
+ 0xd626d5af, 0x3974634e, 0xd3f2be2c, 0x3ca008cd, 0xcadfaca5,
+ 0x258d1a44, 0xcf0bc726, 0x205971c7, 0xc1777ba3, 0x2e25cd42,
+ 0xc4a31020, 0x2bf1a6c1, 0x14e696e1, 0xfbb42000, 0x1132fd62,
+ 0xfe604b83, 0x1f4e41e7, 0xf01cf706, 0x1a9a2a64, 0xf5c89c85,
+ 0x03b738ed, 0xece58e0c, 0x0663536e, 0xe931e58f, 0x081fefeb,
+ 0xe74d590a, 0x0dcb8468, 0xe2993289, 0x3a45caf9, 0xd5177c18,
+ 0x3f91a17a, 0xd0c3179b, 0x31ed1dff, 0xdebfab1e, 0x3439767c,
+ 0xdb6bc09d, 0x2d1464f5, 0xc246d214, 0x28c00f76, 0xc792b997,
+ 0x26bcb3f3, 0xc9ee0512, 0x2368d870, 0xcc3a6e91, 0x49a02ed1,
+ 0xa6f29830, 0x4c744552, 0xa326f3b3, 0x4208f9d7, 0xad5a4f36,
+ 0x47dc9254, 0xa88e24b5, 0x5ef180dd, 0xb1a3363c, 0x5b25eb5e,
+ 0xb4775dbf, 0x555957db, 0xba0be13a, 0x508d3c58, 0xbfdf8ab9,
+ 0x670372c9, 0x8851c428, 0x62d7194a, 0x8d85afab, 0x6caba5cf,
+ 0x83f9132e, 0x697fce4c, 0x862d78ad, 0x7052dcc5, 0x9f006a24,
+ 0x7586b746, 0x9ad401a7, 0x7bfa0bc3, 0x94a8bd22, 0x7e2e6040,
+ 0x917cd6a1},
+ {0x00000000, 0x87a6cb43, 0xd43c90c7, 0x539a5b84, 0x730827cf,
+ 0xf4aeec8c, 0xa734b708, 0x20927c4b, 0xe6104f9e, 0x61b684dd,
+ 0x322cdf59, 0xb58a141a, 0x95186851, 0x12bea312, 0x4124f896,
+ 0xc68233d5, 0x1751997d, 0x90f7523e, 0xc36d09ba, 0x44cbc2f9,
+ 0x6459beb2, 0xe3ff75f1, 0xb0652e75, 0x37c3e536, 0xf141d6e3,
+ 0x76e71da0, 0x257d4624, 0xa2db8d67, 0x8249f12c, 0x05ef3a6f,
+ 0x567561eb, 0xd1d3aaa8, 0x2ea332fa, 0xa905f9b9, 0xfa9fa23d,
+ 0x7d39697e, 0x5dab1535, 0xda0dde76, 0x899785f2, 0x0e314eb1,
+ 0xc8b37d64, 0x4f15b627, 0x1c8feda3, 0x9b2926e0, 0xbbbb5aab,
+ 0x3c1d91e8, 0x6f87ca6c, 0xe821012f, 0x39f2ab87, 0xbe5460c4,
+ 0xedce3b40, 0x6a68f003, 0x4afa8c48, 0xcd5c470b, 0x9ec61c8f,
+ 0x1960d7cc, 0xdfe2e419, 0x58442f5a, 0x0bde74de, 0x8c78bf9d,
+ 0xaceac3d6, 0x2b4c0895, 0x78d65311, 0xff709852, 0x5d4665f4,
+ 0xdae0aeb7, 0x897af533, 0x0edc3e70, 0x2e4e423b, 0xa9e88978,
+ 0xfa72d2fc, 0x7dd419bf, 0xbb562a6a, 0x3cf0e129, 0x6f6abaad,
+ 0xe8cc71ee, 0xc85e0da5, 0x4ff8c6e6, 0x1c629d62, 0x9bc45621,
+ 0x4a17fc89, 0xcdb137ca, 0x9e2b6c4e, 0x198da70d, 0x391fdb46,
+ 0xbeb91005, 0xed234b81, 0x6a8580c2, 0xac07b317, 0x2ba17854,
+ 0x783b23d0, 0xff9de893, 0xdf0f94d8, 0x58a95f9b, 0x0b33041f,
+ 0x8c95cf5c, 0x73e5570e, 0xf4439c4d, 0xa7d9c7c9, 0x207f0c8a,
+ 0x00ed70c1, 0x874bbb82, 0xd4d1e006, 0x53772b45, 0x95f51890,
+ 0x1253d3d3, 0x41c98857, 0xc66f4314, 0xe6fd3f5f, 0x615bf41c,
+ 0x32c1af98, 0xb56764db, 0x64b4ce73, 0xe3120530, 0xb0885eb4,
+ 0x372e95f7, 0x17bce9bc, 0x901a22ff, 0xc380797b, 0x4426b238,
+ 0x82a481ed, 0x05024aae, 0x5698112a, 0xd13eda69, 0xf1aca622,
+ 0x760a6d61, 0x259036e5, 0xa236fda6, 0xba8ccbe8, 0x3d2a00ab,
+ 0x6eb05b2f, 0xe916906c, 0xc984ec27, 0x4e222764, 0x1db87ce0,
+ 0x9a1eb7a3, 0x5c9c8476, 0xdb3a4f35, 0x88a014b1, 0x0f06dff2,
+ 0x2f94a3b9, 0xa83268fa, 0xfba8337e, 0x7c0ef83d, 0xaddd5295,
+ 0x2a7b99d6, 0x79e1c252, 0xfe470911, 0xded5755a, 0x5973be19,
+ 0x0ae9e59d, 0x8d4f2ede, 0x4bcd1d0b, 0xcc6bd648, 0x9ff18dcc,
+ 0x1857468f, 0x38c53ac4, 0xbf63f187, 0xecf9aa03, 0x6b5f6140,
+ 0x942ff912, 0x13893251, 0x401369d5, 0xc7b5a296, 0xe727dedd,
+ 0x6081159e, 0x331b4e1a, 0xb4bd8559, 0x723fb68c, 0xf5997dcf,
+ 0xa603264b, 0x21a5ed08, 0x01379143, 0x86915a00, 0xd50b0184,
+ 0x52adcac7, 0x837e606f, 0x04d8ab2c, 0x5742f0a8, 0xd0e43beb,
+ 0xf07647a0, 0x77d08ce3, 0x244ad767, 0xa3ec1c24, 0x656e2ff1,
+ 0xe2c8e4b2, 0xb152bf36, 0x36f47475, 0x1666083e, 0x91c0c37d,
+ 0xc25a98f9, 0x45fc53ba, 0xe7caae1c, 0x606c655f, 0x33f63edb,
+ 0xb450f598, 0x94c289d3, 0x13644290, 0x40fe1914, 0xc758d257,
+ 0x01dae182, 0x867c2ac1, 0xd5e67145, 0x5240ba06, 0x72d2c64d,
+ 0xf5740d0e, 0xa6ee568a, 0x21489dc9, 0xf09b3761, 0x773dfc22,
+ 0x24a7a7a6, 0xa3016ce5, 0x839310ae, 0x0435dbed, 0x57af8069,
+ 0xd0094b2a, 0x168b78ff, 0x912db3bc, 0xc2b7e838, 0x4511237b,
+ 0x65835f30, 0xe2259473, 0xb1bfcff7, 0x361904b4, 0xc9699ce6,
+ 0x4ecf57a5, 0x1d550c21, 0x9af3c762, 0xba61bb29, 0x3dc7706a,
+ 0x6e5d2bee, 0xe9fbe0ad, 0x2f79d378, 0xa8df183b, 0xfb4543bf,
+ 0x7ce388fc, 0x5c71f4b7, 0xdbd73ff4, 0x884d6470, 0x0febaf33,
+ 0xde38059b, 0x599eced8, 0x0a04955c, 0x8da25e1f, 0xad302254,
+ 0x2a96e917, 0x790cb293, 0xfeaa79d0, 0x38284a05, 0xbf8e8146,
+ 0xec14dac2, 0x6bb21181, 0x4b206dca, 0xcc86a689, 0x9f1cfd0d,
+ 0x18ba364e}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x0000000000000000, 0x43cba68700000000, 0xc7903cd400000000,
+ 0x845b9a5300000000, 0xcf27087300000000, 0x8cecaef400000000,
+ 0x08b734a700000000, 0x4b7c922000000000, 0x9e4f10e600000000,
+ 0xdd84b66100000000, 0x59df2c3200000000, 0x1a148ab500000000,
+ 0x5168189500000000, 0x12a3be1200000000, 0x96f8244100000000,
+ 0xd53382c600000000, 0x7d99511700000000, 0x3e52f79000000000,
+ 0xba096dc300000000, 0xf9c2cb4400000000, 0xb2be596400000000,
+ 0xf175ffe300000000, 0x752e65b000000000, 0x36e5c33700000000,
+ 0xe3d641f100000000, 0xa01de77600000000, 0x24467d2500000000,
+ 0x678ddba200000000, 0x2cf1498200000000, 0x6f3aef0500000000,
+ 0xeb61755600000000, 0xa8aad3d100000000, 0xfa32a32e00000000,
+ 0xb9f905a900000000, 0x3da29ffa00000000, 0x7e69397d00000000,
+ 0x3515ab5d00000000, 0x76de0dda00000000, 0xf285978900000000,
+ 0xb14e310e00000000, 0x647db3c800000000, 0x27b6154f00000000,
+ 0xa3ed8f1c00000000, 0xe026299b00000000, 0xab5abbbb00000000,
+ 0xe8911d3c00000000, 0x6cca876f00000000, 0x2f0121e800000000,
+ 0x87abf23900000000, 0xc46054be00000000, 0x403bceed00000000,
+ 0x03f0686a00000000, 0x488cfa4a00000000, 0x0b475ccd00000000,
+ 0x8f1cc69e00000000, 0xccd7601900000000, 0x19e4e2df00000000,
+ 0x5a2f445800000000, 0xde74de0b00000000, 0x9dbf788c00000000,
+ 0xd6c3eaac00000000, 0x95084c2b00000000, 0x1153d67800000000,
+ 0x529870ff00000000, 0xf465465d00000000, 0xb7aee0da00000000,
+ 0x33f57a8900000000, 0x703edc0e00000000, 0x3b424e2e00000000,
+ 0x7889e8a900000000, 0xfcd272fa00000000, 0xbf19d47d00000000,
+ 0x6a2a56bb00000000, 0x29e1f03c00000000, 0xadba6a6f00000000,
+ 0xee71cce800000000, 0xa50d5ec800000000, 0xe6c6f84f00000000,
+ 0x629d621c00000000, 0x2156c49b00000000, 0x89fc174a00000000,
+ 0xca37b1cd00000000, 0x4e6c2b9e00000000, 0x0da78d1900000000,
+ 0x46db1f3900000000, 0x0510b9be00000000, 0x814b23ed00000000,
+ 0xc280856a00000000, 0x17b307ac00000000, 0x5478a12b00000000,
+ 0xd0233b7800000000, 0x93e89dff00000000, 0xd8940fdf00000000,
+ 0x9b5fa95800000000, 0x1f04330b00000000, 0x5ccf958c00000000,
+ 0x0e57e57300000000, 0x4d9c43f400000000, 0xc9c7d9a700000000,
+ 0x8a0c7f2000000000, 0xc170ed0000000000, 0x82bb4b8700000000,
+ 0x06e0d1d400000000, 0x452b775300000000, 0x9018f59500000000,
+ 0xd3d3531200000000, 0x5788c94100000000, 0x14436fc600000000,
+ 0x5f3ffde600000000, 0x1cf45b6100000000, 0x98afc13200000000,
+ 0xdb6467b500000000, 0x73ceb46400000000, 0x300512e300000000,
+ 0xb45e88b000000000, 0xf7952e3700000000, 0xbce9bc1700000000,
+ 0xff221a9000000000, 0x7b7980c300000000, 0x38b2264400000000,
+ 0xed81a48200000000, 0xae4a020500000000, 0x2a11985600000000,
+ 0x69da3ed100000000, 0x22a6acf100000000, 0x616d0a7600000000,
+ 0xe536902500000000, 0xa6fd36a200000000, 0xe8cb8cba00000000,
+ 0xab002a3d00000000, 0x2f5bb06e00000000, 0x6c9016e900000000,
+ 0x27ec84c900000000, 0x6427224e00000000, 0xe07cb81d00000000,
+ 0xa3b71e9a00000000, 0x76849c5c00000000, 0x354f3adb00000000,
+ 0xb114a08800000000, 0xf2df060f00000000, 0xb9a3942f00000000,
+ 0xfa6832a800000000, 0x7e33a8fb00000000, 0x3df80e7c00000000,
+ 0x9552ddad00000000, 0xd6997b2a00000000, 0x52c2e17900000000,
+ 0x110947fe00000000, 0x5a75d5de00000000, 0x19be735900000000,
+ 0x9de5e90a00000000, 0xde2e4f8d00000000, 0x0b1dcd4b00000000,
+ 0x48d66bcc00000000, 0xcc8df19f00000000, 0x8f46571800000000,
+ 0xc43ac53800000000, 0x87f163bf00000000, 0x03aaf9ec00000000,
+ 0x40615f6b00000000, 0x12f92f9400000000, 0x5132891300000000,
+ 0xd569134000000000, 0x96a2b5c700000000, 0xddde27e700000000,
+ 0x9e15816000000000, 0x1a4e1b3300000000, 0x5985bdb400000000,
+ 0x8cb63f7200000000, 0xcf7d99f500000000, 0x4b2603a600000000,
+ 0x08eda52100000000, 0x4391370100000000, 0x005a918600000000,
+ 0x84010bd500000000, 0xc7caad5200000000, 0x6f607e8300000000,
+ 0x2cabd80400000000, 0xa8f0425700000000, 0xeb3be4d000000000,
+ 0xa04776f000000000, 0xe38cd07700000000, 0x67d74a2400000000,
+ 0x241ceca300000000, 0xf12f6e6500000000, 0xb2e4c8e200000000,
+ 0x36bf52b100000000, 0x7574f43600000000, 0x3e08661600000000,
+ 0x7dc3c09100000000, 0xf9985ac200000000, 0xba53fc4500000000,
+ 0x1caecae700000000, 0x5f656c6000000000, 0xdb3ef63300000000,
+ 0x98f550b400000000, 0xd389c29400000000, 0x9042641300000000,
+ 0x1419fe4000000000, 0x57d258c700000000, 0x82e1da0100000000,
+ 0xc12a7c8600000000, 0x4571e6d500000000, 0x06ba405200000000,
+ 0x4dc6d27200000000, 0x0e0d74f500000000, 0x8a56eea600000000,
+ 0xc99d482100000000, 0x61379bf000000000, 0x22fc3d7700000000,
+ 0xa6a7a72400000000, 0xe56c01a300000000, 0xae10938300000000,
+ 0xeddb350400000000, 0x6980af5700000000, 0x2a4b09d000000000,
+ 0xff788b1600000000, 0xbcb32d9100000000, 0x38e8b7c200000000,
+ 0x7b23114500000000, 0x305f836500000000, 0x739425e200000000,
+ 0xf7cfbfb100000000, 0xb404193600000000, 0xe69c69c900000000,
+ 0xa557cf4e00000000, 0x210c551d00000000, 0x62c7f39a00000000,
+ 0x29bb61ba00000000, 0x6a70c73d00000000, 0xee2b5d6e00000000,
+ 0xade0fbe900000000, 0x78d3792f00000000, 0x3b18dfa800000000,
+ 0xbf4345fb00000000, 0xfc88e37c00000000, 0xb7f4715c00000000,
+ 0xf43fd7db00000000, 0x70644d8800000000, 0x33afeb0f00000000,
+ 0x9b0538de00000000, 0xd8ce9e5900000000, 0x5c95040a00000000,
+ 0x1f5ea28d00000000, 0x542230ad00000000, 0x17e9962a00000000,
+ 0x93b20c7900000000, 0xd079aafe00000000, 0x054a283800000000,
+ 0x46818ebf00000000, 0xc2da14ec00000000, 0x8111b26b00000000,
+ 0xca6d204b00000000, 0x89a686cc00000000, 0x0dfd1c9f00000000,
+ 0x4e36ba1800000000},
+ {0x0000000000000000, 0xe1b652ef00000000, 0x836bd40500000000,
+ 0x62dd86ea00000000, 0x06d7a80b00000000, 0xe761fae400000000,
+ 0x85bc7c0e00000000, 0x640a2ee100000000, 0x0cae511700000000,
+ 0xed1803f800000000, 0x8fc5851200000000, 0x6e73d7fd00000000,
+ 0x0a79f91c00000000, 0xebcfabf300000000, 0x89122d1900000000,
+ 0x68a47ff600000000, 0x185ca32e00000000, 0xf9eaf1c100000000,
+ 0x9b37772b00000000, 0x7a8125c400000000, 0x1e8b0b2500000000,
+ 0xff3d59ca00000000, 0x9de0df2000000000, 0x7c568dcf00000000,
+ 0x14f2f23900000000, 0xf544a0d600000000, 0x9799263c00000000,
+ 0x762f74d300000000, 0x12255a3200000000, 0xf39308dd00000000,
+ 0x914e8e3700000000, 0x70f8dcd800000000, 0x30b8465d00000000,
+ 0xd10e14b200000000, 0xb3d3925800000000, 0x5265c0b700000000,
+ 0x366fee5600000000, 0xd7d9bcb900000000, 0xb5043a5300000000,
+ 0x54b268bc00000000, 0x3c16174a00000000, 0xdda045a500000000,
+ 0xbf7dc34f00000000, 0x5ecb91a000000000, 0x3ac1bf4100000000,
+ 0xdb77edae00000000, 0xb9aa6b4400000000, 0x581c39ab00000000,
+ 0x28e4e57300000000, 0xc952b79c00000000, 0xab8f317600000000,
+ 0x4a39639900000000, 0x2e334d7800000000, 0xcf851f9700000000,
+ 0xad58997d00000000, 0x4ceecb9200000000, 0x244ab46400000000,
+ 0xc5fce68b00000000, 0xa721606100000000, 0x4697328e00000000,
+ 0x229d1c6f00000000, 0xc32b4e8000000000, 0xa1f6c86a00000000,
+ 0x40409a8500000000, 0x60708dba00000000, 0x81c6df5500000000,
+ 0xe31b59bf00000000, 0x02ad0b5000000000, 0x66a725b100000000,
+ 0x8711775e00000000, 0xe5ccf1b400000000, 0x047aa35b00000000,
+ 0x6cdedcad00000000, 0x8d688e4200000000, 0xefb508a800000000,
+ 0x0e035a4700000000, 0x6a0974a600000000, 0x8bbf264900000000,
+ 0xe962a0a300000000, 0x08d4f24c00000000, 0x782c2e9400000000,
+ 0x999a7c7b00000000, 0xfb47fa9100000000, 0x1af1a87e00000000,
+ 0x7efb869f00000000, 0x9f4dd47000000000, 0xfd90529a00000000,
+ 0x1c26007500000000, 0x74827f8300000000, 0x95342d6c00000000,
+ 0xf7e9ab8600000000, 0x165ff96900000000, 0x7255d78800000000,
+ 0x93e3856700000000, 0xf13e038d00000000, 0x1088516200000000,
+ 0x50c8cbe700000000, 0xb17e990800000000, 0xd3a31fe200000000,
+ 0x32154d0d00000000, 0x561f63ec00000000, 0xb7a9310300000000,
+ 0xd574b7e900000000, 0x34c2e50600000000, 0x5c669af000000000,
+ 0xbdd0c81f00000000, 0xdf0d4ef500000000, 0x3ebb1c1a00000000,
+ 0x5ab132fb00000000, 0xbb07601400000000, 0xd9dae6fe00000000,
+ 0x386cb41100000000, 0x489468c900000000, 0xa9223a2600000000,
+ 0xcbffbccc00000000, 0x2a49ee2300000000, 0x4e43c0c200000000,
+ 0xaff5922d00000000, 0xcd2814c700000000, 0x2c9e462800000000,
+ 0x443a39de00000000, 0xa58c6b3100000000, 0xc751eddb00000000,
+ 0x26e7bf3400000000, 0x42ed91d500000000, 0xa35bc33a00000000,
+ 0xc18645d000000000, 0x2030173f00000000, 0x81e66bae00000000,
+ 0x6050394100000000, 0x028dbfab00000000, 0xe33bed4400000000,
+ 0x8731c3a500000000, 0x6687914a00000000, 0x045a17a000000000,
+ 0xe5ec454f00000000, 0x8d483ab900000000, 0x6cfe685600000000,
+ 0x0e23eebc00000000, 0xef95bc5300000000, 0x8b9f92b200000000,
+ 0x6a29c05d00000000, 0x08f446b700000000, 0xe942145800000000,
+ 0x99bac88000000000, 0x780c9a6f00000000, 0x1ad11c8500000000,
+ 0xfb674e6a00000000, 0x9f6d608b00000000, 0x7edb326400000000,
+ 0x1c06b48e00000000, 0xfdb0e66100000000, 0x9514999700000000,
+ 0x74a2cb7800000000, 0x167f4d9200000000, 0xf7c91f7d00000000,
+ 0x93c3319c00000000, 0x7275637300000000, 0x10a8e59900000000,
+ 0xf11eb77600000000, 0xb15e2df300000000, 0x50e87f1c00000000,
+ 0x3235f9f600000000, 0xd383ab1900000000, 0xb78985f800000000,
+ 0x563fd71700000000, 0x34e251fd00000000, 0xd554031200000000,
+ 0xbdf07ce400000000, 0x5c462e0b00000000, 0x3e9ba8e100000000,
+ 0xdf2dfa0e00000000, 0xbb27d4ef00000000, 0x5a91860000000000,
+ 0x384c00ea00000000, 0xd9fa520500000000, 0xa9028edd00000000,
+ 0x48b4dc3200000000, 0x2a695ad800000000, 0xcbdf083700000000,
+ 0xafd526d600000000, 0x4e63743900000000, 0x2cbef2d300000000,
+ 0xcd08a03c00000000, 0xa5acdfca00000000, 0x441a8d2500000000,
+ 0x26c70bcf00000000, 0xc771592000000000, 0xa37b77c100000000,
+ 0x42cd252e00000000, 0x2010a3c400000000, 0xc1a6f12b00000000,
+ 0xe196e61400000000, 0x0020b4fb00000000, 0x62fd321100000000,
+ 0x834b60fe00000000, 0xe7414e1f00000000, 0x06f71cf000000000,
+ 0x642a9a1a00000000, 0x859cc8f500000000, 0xed38b70300000000,
+ 0x0c8ee5ec00000000, 0x6e53630600000000, 0x8fe531e900000000,
+ 0xebef1f0800000000, 0x0a594de700000000, 0x6884cb0d00000000,
+ 0x893299e200000000, 0xf9ca453a00000000, 0x187c17d500000000,
+ 0x7aa1913f00000000, 0x9b17c3d000000000, 0xff1ded3100000000,
+ 0x1eabbfde00000000, 0x7c76393400000000, 0x9dc06bdb00000000,
+ 0xf564142d00000000, 0x14d246c200000000, 0x760fc02800000000,
+ 0x97b992c700000000, 0xf3b3bc2600000000, 0x1205eec900000000,
+ 0x70d8682300000000, 0x916e3acc00000000, 0xd12ea04900000000,
+ 0x3098f2a600000000, 0x5245744c00000000, 0xb3f326a300000000,
+ 0xd7f9084200000000, 0x364f5aad00000000, 0x5492dc4700000000,
+ 0xb5248ea800000000, 0xdd80f15e00000000, 0x3c36a3b100000000,
+ 0x5eeb255b00000000, 0xbf5d77b400000000, 0xdb57595500000000,
+ 0x3ae10bba00000000, 0x583c8d5000000000, 0xb98adfbf00000000,
+ 0xc972036700000000, 0x28c4518800000000, 0x4a19d76200000000,
+ 0xabaf858d00000000, 0xcfa5ab6c00000000, 0x2e13f98300000000,
+ 0x4cce7f6900000000, 0xad782d8600000000, 0xc5dc527000000000,
+ 0x246a009f00000000, 0x46b7867500000000, 0xa701d49a00000000,
+ 0xc30bfa7b00000000, 0x22bda89400000000, 0x40602e7e00000000,
+ 0xa1d67c9100000000},
+ {0x0000000000000000, 0x5880e2d700000000, 0xf106b47400000000,
+ 0xa98656a300000000, 0xe20d68e900000000, 0xba8d8a3e00000000,
+ 0x130bdc9d00000000, 0x4b8b3e4a00000000, 0x851da10900000000,
+ 0xdd9d43de00000000, 0x741b157d00000000, 0x2c9bf7aa00000000,
+ 0x6710c9e000000000, 0x3f902b3700000000, 0x96167d9400000000,
+ 0xce969f4300000000, 0x0a3b421300000000, 0x52bba0c400000000,
+ 0xfb3df66700000000, 0xa3bd14b000000000, 0xe8362afa00000000,
+ 0xb0b6c82d00000000, 0x19309e8e00000000, 0x41b07c5900000000,
+ 0x8f26e31a00000000, 0xd7a601cd00000000, 0x7e20576e00000000,
+ 0x26a0b5b900000000, 0x6d2b8bf300000000, 0x35ab692400000000,
+ 0x9c2d3f8700000000, 0xc4addd5000000000, 0x1476842600000000,
+ 0x4cf666f100000000, 0xe570305200000000, 0xbdf0d28500000000,
+ 0xf67beccf00000000, 0xaefb0e1800000000, 0x077d58bb00000000,
+ 0x5ffdba6c00000000, 0x916b252f00000000, 0xc9ebc7f800000000,
+ 0x606d915b00000000, 0x38ed738c00000000, 0x73664dc600000000,
+ 0x2be6af1100000000, 0x8260f9b200000000, 0xdae01b6500000000,
+ 0x1e4dc63500000000, 0x46cd24e200000000, 0xef4b724100000000,
+ 0xb7cb909600000000, 0xfc40aedc00000000, 0xa4c04c0b00000000,
+ 0x0d461aa800000000, 0x55c6f87f00000000, 0x9b50673c00000000,
+ 0xc3d085eb00000000, 0x6a56d34800000000, 0x32d6319f00000000,
+ 0x795d0fd500000000, 0x21dded0200000000, 0x885bbba100000000,
+ 0xd0db597600000000, 0x28ec084d00000000, 0x706cea9a00000000,
+ 0xd9eabc3900000000, 0x816a5eee00000000, 0xcae160a400000000,
+ 0x9261827300000000, 0x3be7d4d000000000, 0x6367360700000000,
+ 0xadf1a94400000000, 0xf5714b9300000000, 0x5cf71d3000000000,
+ 0x0477ffe700000000, 0x4ffcc1ad00000000, 0x177c237a00000000,
+ 0xbefa75d900000000, 0xe67a970e00000000, 0x22d74a5e00000000,
+ 0x7a57a88900000000, 0xd3d1fe2a00000000, 0x8b511cfd00000000,
+ 0xc0da22b700000000, 0x985ac06000000000, 0x31dc96c300000000,
+ 0x695c741400000000, 0xa7caeb5700000000, 0xff4a098000000000,
+ 0x56cc5f2300000000, 0x0e4cbdf400000000, 0x45c783be00000000,
+ 0x1d47616900000000, 0xb4c137ca00000000, 0xec41d51d00000000,
+ 0x3c9a8c6b00000000, 0x641a6ebc00000000, 0xcd9c381f00000000,
+ 0x951cdac800000000, 0xde97e48200000000, 0x8617065500000000,
+ 0x2f9150f600000000, 0x7711b22100000000, 0xb9872d6200000000,
+ 0xe107cfb500000000, 0x4881991600000000, 0x10017bc100000000,
+ 0x5b8a458b00000000, 0x030aa75c00000000, 0xaa8cf1ff00000000,
+ 0xf20c132800000000, 0x36a1ce7800000000, 0x6e212caf00000000,
+ 0xc7a77a0c00000000, 0x9f2798db00000000, 0xd4aca69100000000,
+ 0x8c2c444600000000, 0x25aa12e500000000, 0x7d2af03200000000,
+ 0xb3bc6f7100000000, 0xeb3c8da600000000, 0x42badb0500000000,
+ 0x1a3a39d200000000, 0x51b1079800000000, 0x0931e54f00000000,
+ 0xa0b7b3ec00000000, 0xf837513b00000000, 0x50d8119a00000000,
+ 0x0858f34d00000000, 0xa1dea5ee00000000, 0xf95e473900000000,
+ 0xb2d5797300000000, 0xea559ba400000000, 0x43d3cd0700000000,
+ 0x1b532fd000000000, 0xd5c5b09300000000, 0x8d45524400000000,
+ 0x24c304e700000000, 0x7c43e63000000000, 0x37c8d87a00000000,
+ 0x6f483aad00000000, 0xc6ce6c0e00000000, 0x9e4e8ed900000000,
+ 0x5ae3538900000000, 0x0263b15e00000000, 0xabe5e7fd00000000,
+ 0xf365052a00000000, 0xb8ee3b6000000000, 0xe06ed9b700000000,
+ 0x49e88f1400000000, 0x11686dc300000000, 0xdffef28000000000,
+ 0x877e105700000000, 0x2ef846f400000000, 0x7678a42300000000,
+ 0x3df39a6900000000, 0x657378be00000000, 0xccf52e1d00000000,
+ 0x9475ccca00000000, 0x44ae95bc00000000, 0x1c2e776b00000000,
+ 0xb5a821c800000000, 0xed28c31f00000000, 0xa6a3fd5500000000,
+ 0xfe231f8200000000, 0x57a5492100000000, 0x0f25abf600000000,
+ 0xc1b334b500000000, 0x9933d66200000000, 0x30b580c100000000,
+ 0x6835621600000000, 0x23be5c5c00000000, 0x7b3ebe8b00000000,
+ 0xd2b8e82800000000, 0x8a380aff00000000, 0x4e95d7af00000000,
+ 0x1615357800000000, 0xbf9363db00000000, 0xe713810c00000000,
+ 0xac98bf4600000000, 0xf4185d9100000000, 0x5d9e0b3200000000,
+ 0x051ee9e500000000, 0xcb8876a600000000, 0x9308947100000000,
+ 0x3a8ec2d200000000, 0x620e200500000000, 0x29851e4f00000000,
+ 0x7105fc9800000000, 0xd883aa3b00000000, 0x800348ec00000000,
+ 0x783419d700000000, 0x20b4fb0000000000, 0x8932ada300000000,
+ 0xd1b24f7400000000, 0x9a39713e00000000, 0xc2b993e900000000,
+ 0x6b3fc54a00000000, 0x33bf279d00000000, 0xfd29b8de00000000,
+ 0xa5a95a0900000000, 0x0c2f0caa00000000, 0x54afee7d00000000,
+ 0x1f24d03700000000, 0x47a432e000000000, 0xee22644300000000,
+ 0xb6a2869400000000, 0x720f5bc400000000, 0x2a8fb91300000000,
+ 0x8309efb000000000, 0xdb890d6700000000, 0x9002332d00000000,
+ 0xc882d1fa00000000, 0x6104875900000000, 0x3984658e00000000,
+ 0xf712facd00000000, 0xaf92181a00000000, 0x06144eb900000000,
+ 0x5e94ac6e00000000, 0x151f922400000000, 0x4d9f70f300000000,
+ 0xe419265000000000, 0xbc99c48700000000, 0x6c429df100000000,
+ 0x34c27f2600000000, 0x9d44298500000000, 0xc5c4cb5200000000,
+ 0x8e4ff51800000000, 0xd6cf17cf00000000, 0x7f49416c00000000,
+ 0x27c9a3bb00000000, 0xe95f3cf800000000, 0xb1dfde2f00000000,
+ 0x1859888c00000000, 0x40d96a5b00000000, 0x0b52541100000000,
+ 0x53d2b6c600000000, 0xfa54e06500000000, 0xa2d402b200000000,
+ 0x6679dfe200000000, 0x3ef93d3500000000, 0x977f6b9600000000,
+ 0xcfff894100000000, 0x8474b70b00000000, 0xdcf455dc00000000,
+ 0x7572037f00000000, 0x2df2e1a800000000, 0xe3647eeb00000000,
+ 0xbbe49c3c00000000, 0x1262ca9f00000000, 0x4ae2284800000000,
+ 0x0169160200000000, 0x59e9f4d500000000, 0xf06fa27600000000,
+ 0xa8ef40a100000000},
+ {0x0000000000000000, 0x463b676500000000, 0x8c76ceca00000000,
+ 0xca4da9af00000000, 0x59ebed4e00000000, 0x1fd08a2b00000000,
+ 0xd59d238400000000, 0x93a644e100000000, 0xb2d6db9d00000000,
+ 0xf4edbcf800000000, 0x3ea0155700000000, 0x789b723200000000,
+ 0xeb3d36d300000000, 0xad0651b600000000, 0x674bf81900000000,
+ 0x21709f7c00000000, 0x25abc6e000000000, 0x6390a18500000000,
+ 0xa9dd082a00000000, 0xefe66f4f00000000, 0x7c402bae00000000,
+ 0x3a7b4ccb00000000, 0xf036e56400000000, 0xb60d820100000000,
+ 0x977d1d7d00000000, 0xd1467a1800000000, 0x1b0bd3b700000000,
+ 0x5d30b4d200000000, 0xce96f03300000000, 0x88ad975600000000,
+ 0x42e03ef900000000, 0x04db599c00000000, 0x0b50fc1a00000000,
+ 0x4d6b9b7f00000000, 0x872632d000000000, 0xc11d55b500000000,
+ 0x52bb115400000000, 0x1480763100000000, 0xdecddf9e00000000,
+ 0x98f6b8fb00000000, 0xb986278700000000, 0xffbd40e200000000,
+ 0x35f0e94d00000000, 0x73cb8e2800000000, 0xe06dcac900000000,
+ 0xa656adac00000000, 0x6c1b040300000000, 0x2a20636600000000,
+ 0x2efb3afa00000000, 0x68c05d9f00000000, 0xa28df43000000000,
+ 0xe4b6935500000000, 0x7710d7b400000000, 0x312bb0d100000000,
+ 0xfb66197e00000000, 0xbd5d7e1b00000000, 0x9c2de16700000000,
+ 0xda16860200000000, 0x105b2fad00000000, 0x566048c800000000,
+ 0xc5c60c2900000000, 0x83fd6b4c00000000, 0x49b0c2e300000000,
+ 0x0f8ba58600000000, 0x16a0f83500000000, 0x509b9f5000000000,
+ 0x9ad636ff00000000, 0xdced519a00000000, 0x4f4b157b00000000,
+ 0x0970721e00000000, 0xc33ddbb100000000, 0x8506bcd400000000,
+ 0xa47623a800000000, 0xe24d44cd00000000, 0x2800ed6200000000,
+ 0x6e3b8a0700000000, 0xfd9dcee600000000, 0xbba6a98300000000,
+ 0x71eb002c00000000, 0x37d0674900000000, 0x330b3ed500000000,
+ 0x753059b000000000, 0xbf7df01f00000000, 0xf946977a00000000,
+ 0x6ae0d39b00000000, 0x2cdbb4fe00000000, 0xe6961d5100000000,
+ 0xa0ad7a3400000000, 0x81dde54800000000, 0xc7e6822d00000000,
+ 0x0dab2b8200000000, 0x4b904ce700000000, 0xd836080600000000,
+ 0x9e0d6f6300000000, 0x5440c6cc00000000, 0x127ba1a900000000,
+ 0x1df0042f00000000, 0x5bcb634a00000000, 0x9186cae500000000,
+ 0xd7bdad8000000000, 0x441be96100000000, 0x02208e0400000000,
+ 0xc86d27ab00000000, 0x8e5640ce00000000, 0xaf26dfb200000000,
+ 0xe91db8d700000000, 0x2350117800000000, 0x656b761d00000000,
+ 0xf6cd32fc00000000, 0xb0f6559900000000, 0x7abbfc3600000000,
+ 0x3c809b5300000000, 0x385bc2cf00000000, 0x7e60a5aa00000000,
+ 0xb42d0c0500000000, 0xf2166b6000000000, 0x61b02f8100000000,
+ 0x278b48e400000000, 0xedc6e14b00000000, 0xabfd862e00000000,
+ 0x8a8d195200000000, 0xccb67e3700000000, 0x06fbd79800000000,
+ 0x40c0b0fd00000000, 0xd366f41c00000000, 0x955d937900000000,
+ 0x5f103ad600000000, 0x192b5db300000000, 0x2c40f16b00000000,
+ 0x6a7b960e00000000, 0xa0363fa100000000, 0xe60d58c400000000,
+ 0x75ab1c2500000000, 0x33907b4000000000, 0xf9ddd2ef00000000,
+ 0xbfe6b58a00000000, 0x9e962af600000000, 0xd8ad4d9300000000,
+ 0x12e0e43c00000000, 0x54db835900000000, 0xc77dc7b800000000,
+ 0x8146a0dd00000000, 0x4b0b097200000000, 0x0d306e1700000000,
+ 0x09eb378b00000000, 0x4fd050ee00000000, 0x859df94100000000,
+ 0xc3a69e2400000000, 0x5000dac500000000, 0x163bbda000000000,
+ 0xdc76140f00000000, 0x9a4d736a00000000, 0xbb3dec1600000000,
+ 0xfd068b7300000000, 0x374b22dc00000000, 0x717045b900000000,
+ 0xe2d6015800000000, 0xa4ed663d00000000, 0x6ea0cf9200000000,
+ 0x289ba8f700000000, 0x27100d7100000000, 0x612b6a1400000000,
+ 0xab66c3bb00000000, 0xed5da4de00000000, 0x7efbe03f00000000,
+ 0x38c0875a00000000, 0xf28d2ef500000000, 0xb4b6499000000000,
+ 0x95c6d6ec00000000, 0xd3fdb18900000000, 0x19b0182600000000,
+ 0x5f8b7f4300000000, 0xcc2d3ba200000000, 0x8a165cc700000000,
+ 0x405bf56800000000, 0x0660920d00000000, 0x02bbcb9100000000,
+ 0x4480acf400000000, 0x8ecd055b00000000, 0xc8f6623e00000000,
+ 0x5b5026df00000000, 0x1d6b41ba00000000, 0xd726e81500000000,
+ 0x911d8f7000000000, 0xb06d100c00000000, 0xf656776900000000,
+ 0x3c1bdec600000000, 0x7a20b9a300000000, 0xe986fd4200000000,
+ 0xafbd9a2700000000, 0x65f0338800000000, 0x23cb54ed00000000,
+ 0x3ae0095e00000000, 0x7cdb6e3b00000000, 0xb696c79400000000,
+ 0xf0ada0f100000000, 0x630be41000000000, 0x2530837500000000,
+ 0xef7d2ada00000000, 0xa9464dbf00000000, 0x8836d2c300000000,
+ 0xce0db5a600000000, 0x04401c0900000000, 0x427b7b6c00000000,
+ 0xd1dd3f8d00000000, 0x97e658e800000000, 0x5dabf14700000000,
+ 0x1b90962200000000, 0x1f4bcfbe00000000, 0x5970a8db00000000,
+ 0x933d017400000000, 0xd506661100000000, 0x46a022f000000000,
+ 0x009b459500000000, 0xcad6ec3a00000000, 0x8ced8b5f00000000,
+ 0xad9d142300000000, 0xeba6734600000000, 0x21ebdae900000000,
+ 0x67d0bd8c00000000, 0xf476f96d00000000, 0xb24d9e0800000000,
+ 0x780037a700000000, 0x3e3b50c200000000, 0x31b0f54400000000,
+ 0x778b922100000000, 0xbdc63b8e00000000, 0xfbfd5ceb00000000,
+ 0x685b180a00000000, 0x2e607f6f00000000, 0xe42dd6c000000000,
+ 0xa216b1a500000000, 0x83662ed900000000, 0xc55d49bc00000000,
+ 0x0f10e01300000000, 0x492b877600000000, 0xda8dc39700000000,
+ 0x9cb6a4f200000000, 0x56fb0d5d00000000, 0x10c06a3800000000,
+ 0x141b33a400000000, 0x522054c100000000, 0x986dfd6e00000000,
+ 0xde569a0b00000000, 0x4df0deea00000000, 0x0bcbb98f00000000,
+ 0xc186102000000000, 0x87bd774500000000, 0xa6cde83900000000,
+ 0xe0f68f5c00000000, 0x2abb26f300000000, 0x6c80419600000000,
+ 0xff26057700000000, 0xb91d621200000000, 0x7350cbbd00000000,
+ 0x356bacd800000000},
+ {0x0000000000000000, 0x9e83da9f00000000, 0x7d01c4e400000000,
+ 0xe3821e7b00000000, 0xbb04f91200000000, 0x2587238d00000000,
+ 0xc6053df600000000, 0x5886e76900000000, 0x7609f22500000000,
+ 0xe88a28ba00000000, 0x0b0836c100000000, 0x958bec5e00000000,
+ 0xcd0d0b3700000000, 0x538ed1a800000000, 0xb00ccfd300000000,
+ 0x2e8f154c00000000, 0xec12e44b00000000, 0x72913ed400000000,
+ 0x911320af00000000, 0x0f90fa3000000000, 0x57161d5900000000,
+ 0xc995c7c600000000, 0x2a17d9bd00000000, 0xb494032200000000,
+ 0x9a1b166e00000000, 0x0498ccf100000000, 0xe71ad28a00000000,
+ 0x7999081500000000, 0x211fef7c00000000, 0xbf9c35e300000000,
+ 0x5c1e2b9800000000, 0xc29df10700000000, 0xd825c89700000000,
+ 0x46a6120800000000, 0xa5240c7300000000, 0x3ba7d6ec00000000,
+ 0x6321318500000000, 0xfda2eb1a00000000, 0x1e20f56100000000,
+ 0x80a32ffe00000000, 0xae2c3ab200000000, 0x30afe02d00000000,
+ 0xd32dfe5600000000, 0x4dae24c900000000, 0x1528c3a000000000,
+ 0x8bab193f00000000, 0x6829074400000000, 0xf6aadddb00000000,
+ 0x34372cdc00000000, 0xaab4f64300000000, 0x4936e83800000000,
+ 0xd7b532a700000000, 0x8f33d5ce00000000, 0x11b00f5100000000,
+ 0xf232112a00000000, 0x6cb1cbb500000000, 0x423edef900000000,
+ 0xdcbd046600000000, 0x3f3f1a1d00000000, 0xa1bcc08200000000,
+ 0xf93a27eb00000000, 0x67b9fd7400000000, 0x843be30f00000000,
+ 0x1ab8399000000000, 0xf14de1f400000000, 0x6fce3b6b00000000,
+ 0x8c4c251000000000, 0x12cfff8f00000000, 0x4a4918e600000000,
+ 0xd4cac27900000000, 0x3748dc0200000000, 0xa9cb069d00000000,
+ 0x874413d100000000, 0x19c7c94e00000000, 0xfa45d73500000000,
+ 0x64c60daa00000000, 0x3c40eac300000000, 0xa2c3305c00000000,
+ 0x41412e2700000000, 0xdfc2f4b800000000, 0x1d5f05bf00000000,
+ 0x83dcdf2000000000, 0x605ec15b00000000, 0xfedd1bc400000000,
+ 0xa65bfcad00000000, 0x38d8263200000000, 0xdb5a384900000000,
+ 0x45d9e2d600000000, 0x6b56f79a00000000, 0xf5d52d0500000000,
+ 0x1657337e00000000, 0x88d4e9e100000000, 0xd0520e8800000000,
+ 0x4ed1d41700000000, 0xad53ca6c00000000, 0x33d010f300000000,
+ 0x2968296300000000, 0xb7ebf3fc00000000, 0x5469ed8700000000,
+ 0xcaea371800000000, 0x926cd07100000000, 0x0cef0aee00000000,
+ 0xef6d149500000000, 0x71eece0a00000000, 0x5f61db4600000000,
+ 0xc1e201d900000000, 0x22601fa200000000, 0xbce3c53d00000000,
+ 0xe465225400000000, 0x7ae6f8cb00000000, 0x9964e6b000000000,
+ 0x07e73c2f00000000, 0xc57acd2800000000, 0x5bf917b700000000,
+ 0xb87b09cc00000000, 0x26f8d35300000000, 0x7e7e343a00000000,
+ 0xe0fdeea500000000, 0x037ff0de00000000, 0x9dfc2a4100000000,
+ 0xb3733f0d00000000, 0x2df0e59200000000, 0xce72fbe900000000,
+ 0x50f1217600000000, 0x0877c61f00000000, 0x96f41c8000000000,
+ 0x757602fb00000000, 0xebf5d86400000000, 0xa39db33200000000,
+ 0x3d1e69ad00000000, 0xde9c77d600000000, 0x401fad4900000000,
+ 0x18994a2000000000, 0x861a90bf00000000, 0x65988ec400000000,
+ 0xfb1b545b00000000, 0xd594411700000000, 0x4b179b8800000000,
+ 0xa89585f300000000, 0x36165f6c00000000, 0x6e90b80500000000,
+ 0xf013629a00000000, 0x13917ce100000000, 0x8d12a67e00000000,
+ 0x4f8f577900000000, 0xd10c8de600000000, 0x328e939d00000000,
+ 0xac0d490200000000, 0xf48bae6b00000000, 0x6a0874f400000000,
+ 0x898a6a8f00000000, 0x1709b01000000000, 0x3986a55c00000000,
+ 0xa7057fc300000000, 0x448761b800000000, 0xda04bb2700000000,
+ 0x82825c4e00000000, 0x1c0186d100000000, 0xff8398aa00000000,
+ 0x6100423500000000, 0x7bb87ba500000000, 0xe53ba13a00000000,
+ 0x06b9bf4100000000, 0x983a65de00000000, 0xc0bc82b700000000,
+ 0x5e3f582800000000, 0xbdbd465300000000, 0x233e9ccc00000000,
+ 0x0db1898000000000, 0x9332531f00000000, 0x70b04d6400000000,
+ 0xee3397fb00000000, 0xb6b5709200000000, 0x2836aa0d00000000,
+ 0xcbb4b47600000000, 0x55376ee900000000, 0x97aa9fee00000000,
+ 0x0929457100000000, 0xeaab5b0a00000000, 0x7428819500000000,
+ 0x2cae66fc00000000, 0xb22dbc6300000000, 0x51afa21800000000,
+ 0xcf2c788700000000, 0xe1a36dcb00000000, 0x7f20b75400000000,
+ 0x9ca2a92f00000000, 0x022173b000000000, 0x5aa794d900000000,
+ 0xc4244e4600000000, 0x27a6503d00000000, 0xb9258aa200000000,
+ 0x52d052c600000000, 0xcc53885900000000, 0x2fd1962200000000,
+ 0xb1524cbd00000000, 0xe9d4abd400000000, 0x7757714b00000000,
+ 0x94d56f3000000000, 0x0a56b5af00000000, 0x24d9a0e300000000,
+ 0xba5a7a7c00000000, 0x59d8640700000000, 0xc75bbe9800000000,
+ 0x9fdd59f100000000, 0x015e836e00000000, 0xe2dc9d1500000000,
+ 0x7c5f478a00000000, 0xbec2b68d00000000, 0x20416c1200000000,
+ 0xc3c3726900000000, 0x5d40a8f600000000, 0x05c64f9f00000000,
+ 0x9b45950000000000, 0x78c78b7b00000000, 0xe64451e400000000,
+ 0xc8cb44a800000000, 0x56489e3700000000, 0xb5ca804c00000000,
+ 0x2b495ad300000000, 0x73cfbdba00000000, 0xed4c672500000000,
+ 0x0ece795e00000000, 0x904da3c100000000, 0x8af59a5100000000,
+ 0x147640ce00000000, 0xf7f45eb500000000, 0x6977842a00000000,
+ 0x31f1634300000000, 0xaf72b9dc00000000, 0x4cf0a7a700000000,
+ 0xd2737d3800000000, 0xfcfc687400000000, 0x627fb2eb00000000,
+ 0x81fdac9000000000, 0x1f7e760f00000000, 0x47f8916600000000,
+ 0xd97b4bf900000000, 0x3af9558200000000, 0xa47a8f1d00000000,
+ 0x66e77e1a00000000, 0xf864a48500000000, 0x1be6bafe00000000,
+ 0x8565606100000000, 0xdde3870800000000, 0x43605d9700000000,
+ 0xa0e243ec00000000, 0x3e61997300000000, 0x10ee8c3f00000000,
+ 0x8e6d56a000000000, 0x6def48db00000000, 0xf36c924400000000,
+ 0xabea752d00000000, 0x3569afb200000000, 0xd6ebb1c900000000,
+ 0x48686b5600000000},
+ {0x0000000000000000, 0xc064281700000000, 0x80c9502e00000000,
+ 0x40ad783900000000, 0x0093a15c00000000, 0xc0f7894b00000000,
+ 0x805af17200000000, 0x403ed96500000000, 0x002643b900000000,
+ 0xc0426bae00000000, 0x80ef139700000000, 0x408b3b8000000000,
+ 0x00b5e2e500000000, 0xc0d1caf200000000, 0x807cb2cb00000000,
+ 0x40189adc00000000, 0x414af7a900000000, 0x812edfbe00000000,
+ 0xc183a78700000000, 0x01e78f9000000000, 0x41d956f500000000,
+ 0x81bd7ee200000000, 0xc11006db00000000, 0x01742ecc00000000,
+ 0x416cb41000000000, 0x81089c0700000000, 0xc1a5e43e00000000,
+ 0x01c1cc2900000000, 0x41ff154c00000000, 0x819b3d5b00000000,
+ 0xc136456200000000, 0x01526d7500000000, 0xc3929f8800000000,
+ 0x03f6b79f00000000, 0x435bcfa600000000, 0x833fe7b100000000,
+ 0xc3013ed400000000, 0x036516c300000000, 0x43c86efa00000000,
+ 0x83ac46ed00000000, 0xc3b4dc3100000000, 0x03d0f42600000000,
+ 0x437d8c1f00000000, 0x8319a40800000000, 0xc3277d6d00000000,
+ 0x0343557a00000000, 0x43ee2d4300000000, 0x838a055400000000,
+ 0x82d8682100000000, 0x42bc403600000000, 0x0211380f00000000,
+ 0xc275101800000000, 0x824bc97d00000000, 0x422fe16a00000000,
+ 0x0282995300000000, 0xc2e6b14400000000, 0x82fe2b9800000000,
+ 0x429a038f00000000, 0x02377bb600000000, 0xc25353a100000000,
+ 0x826d8ac400000000, 0x4209a2d300000000, 0x02a4daea00000000,
+ 0xc2c0f2fd00000000, 0xc7234eca00000000, 0x074766dd00000000,
+ 0x47ea1ee400000000, 0x878e36f300000000, 0xc7b0ef9600000000,
+ 0x07d4c78100000000, 0x4779bfb800000000, 0x871d97af00000000,
+ 0xc7050d7300000000, 0x0761256400000000, 0x47cc5d5d00000000,
+ 0x87a8754a00000000, 0xc796ac2f00000000, 0x07f2843800000000,
+ 0x475ffc0100000000, 0x873bd41600000000, 0x8669b96300000000,
+ 0x460d917400000000, 0x06a0e94d00000000, 0xc6c4c15a00000000,
+ 0x86fa183f00000000, 0x469e302800000000, 0x0633481100000000,
+ 0xc657600600000000, 0x864ffada00000000, 0x462bd2cd00000000,
+ 0x0686aaf400000000, 0xc6e282e300000000, 0x86dc5b8600000000,
+ 0x46b8739100000000, 0x06150ba800000000, 0xc67123bf00000000,
+ 0x04b1d14200000000, 0xc4d5f95500000000, 0x8478816c00000000,
+ 0x441ca97b00000000, 0x0422701e00000000, 0xc446580900000000,
+ 0x84eb203000000000, 0x448f082700000000, 0x049792fb00000000,
+ 0xc4f3baec00000000, 0x845ec2d500000000, 0x443aeac200000000,
+ 0x040433a700000000, 0xc4601bb000000000, 0x84cd638900000000,
+ 0x44a94b9e00000000, 0x45fb26eb00000000, 0x859f0efc00000000,
+ 0xc53276c500000000, 0x05565ed200000000, 0x456887b700000000,
+ 0x850cafa000000000, 0xc5a1d79900000000, 0x05c5ff8e00000000,
+ 0x45dd655200000000, 0x85b94d4500000000, 0xc514357c00000000,
+ 0x05701d6b00000000, 0x454ec40e00000000, 0x852aec1900000000,
+ 0xc587942000000000, 0x05e3bc3700000000, 0xcf41ed4f00000000,
+ 0x0f25c55800000000, 0x4f88bd6100000000, 0x8fec957600000000,
+ 0xcfd24c1300000000, 0x0fb6640400000000, 0x4f1b1c3d00000000,
+ 0x8f7f342a00000000, 0xcf67aef600000000, 0x0f0386e100000000,
+ 0x4faefed800000000, 0x8fcad6cf00000000, 0xcff40faa00000000,
+ 0x0f9027bd00000000, 0x4f3d5f8400000000, 0x8f59779300000000,
+ 0x8e0b1ae600000000, 0x4e6f32f100000000, 0x0ec24ac800000000,
+ 0xcea662df00000000, 0x8e98bbba00000000, 0x4efc93ad00000000,
+ 0x0e51eb9400000000, 0xce35c38300000000, 0x8e2d595f00000000,
+ 0x4e49714800000000, 0x0ee4097100000000, 0xce80216600000000,
+ 0x8ebef80300000000, 0x4edad01400000000, 0x0e77a82d00000000,
+ 0xce13803a00000000, 0x0cd372c700000000, 0xccb75ad000000000,
+ 0x8c1a22e900000000, 0x4c7e0afe00000000, 0x0c40d39b00000000,
+ 0xcc24fb8c00000000, 0x8c8983b500000000, 0x4cedaba200000000,
+ 0x0cf5317e00000000, 0xcc91196900000000, 0x8c3c615000000000,
+ 0x4c58494700000000, 0x0c66902200000000, 0xcc02b83500000000,
+ 0x8cafc00c00000000, 0x4ccbe81b00000000, 0x4d99856e00000000,
+ 0x8dfdad7900000000, 0xcd50d54000000000, 0x0d34fd5700000000,
+ 0x4d0a243200000000, 0x8d6e0c2500000000, 0xcdc3741c00000000,
+ 0x0da75c0b00000000, 0x4dbfc6d700000000, 0x8ddbeec000000000,
+ 0xcd7696f900000000, 0x0d12beee00000000, 0x4d2c678b00000000,
+ 0x8d484f9c00000000, 0xcde537a500000000, 0x0d811fb200000000,
+ 0x0862a38500000000, 0xc8068b9200000000, 0x88abf3ab00000000,
+ 0x48cfdbbc00000000, 0x08f102d900000000, 0xc8952ace00000000,
+ 0x883852f700000000, 0x485c7ae000000000, 0x0844e03c00000000,
+ 0xc820c82b00000000, 0x888db01200000000, 0x48e9980500000000,
+ 0x08d7416000000000, 0xc8b3697700000000, 0x881e114e00000000,
+ 0x487a395900000000, 0x4928542c00000000, 0x894c7c3b00000000,
+ 0xc9e1040200000000, 0x09852c1500000000, 0x49bbf57000000000,
+ 0x89dfdd6700000000, 0xc972a55e00000000, 0x09168d4900000000,
+ 0x490e179500000000, 0x896a3f8200000000, 0xc9c747bb00000000,
+ 0x09a36fac00000000, 0x499db6c900000000, 0x89f99ede00000000,
+ 0xc954e6e700000000, 0x0930cef000000000, 0xcbf03c0d00000000,
+ 0x0b94141a00000000, 0x4b396c2300000000, 0x8b5d443400000000,
+ 0xcb639d5100000000, 0x0b07b54600000000, 0x4baacd7f00000000,
+ 0x8bcee56800000000, 0xcbd67fb400000000, 0x0bb257a300000000,
+ 0x4b1f2f9a00000000, 0x8b7b078d00000000, 0xcb45dee800000000,
+ 0x0b21f6ff00000000, 0x4b8c8ec600000000, 0x8be8a6d100000000,
+ 0x8abacba400000000, 0x4adee3b300000000, 0x0a739b8a00000000,
+ 0xca17b39d00000000, 0x8a296af800000000, 0x4a4d42ef00000000,
+ 0x0ae03ad600000000, 0xca8412c100000000, 0x8a9c881d00000000,
+ 0x4af8a00a00000000, 0x0a55d83300000000, 0xca31f02400000000,
+ 0x8a0f294100000000, 0x4a6b015600000000, 0x0ac6796f00000000,
+ 0xcaa2517800000000},
+ {0x0000000000000000, 0xd4ea739b00000000, 0xe9d396ed00000000,
+ 0x3d39e57600000000, 0x93a15c0000000000, 0x474b2f9b00000000,
+ 0x7a72caed00000000, 0xae98b97600000000, 0x2643b90000000000,
+ 0xf2a9ca9b00000000, 0xcf902fed00000000, 0x1b7a5c7600000000,
+ 0xb5e2e50000000000, 0x6108969b00000000, 0x5c3173ed00000000,
+ 0x88db007600000000, 0x4c86720100000000, 0x986c019a00000000,
+ 0xa555e4ec00000000, 0x71bf977700000000, 0xdf272e0100000000,
+ 0x0bcd5d9a00000000, 0x36f4b8ec00000000, 0xe21ecb7700000000,
+ 0x6ac5cb0100000000, 0xbe2fb89a00000000, 0x83165dec00000000,
+ 0x57fc2e7700000000, 0xf964970100000000, 0x2d8ee49a00000000,
+ 0x10b701ec00000000, 0xc45d727700000000, 0x980ce50200000000,
+ 0x4ce6969900000000, 0x71df73ef00000000, 0xa535007400000000,
+ 0x0badb90200000000, 0xdf47ca9900000000, 0xe27e2fef00000000,
+ 0x36945c7400000000, 0xbe4f5c0200000000, 0x6aa52f9900000000,
+ 0x579ccaef00000000, 0x8376b97400000000, 0x2dee000200000000,
+ 0xf904739900000000, 0xc43d96ef00000000, 0x10d7e57400000000,
+ 0xd48a970300000000, 0x0060e49800000000, 0x3d5901ee00000000,
+ 0xe9b3727500000000, 0x472bcb0300000000, 0x93c1b89800000000,
+ 0xaef85dee00000000, 0x7a122e7500000000, 0xf2c92e0300000000,
+ 0x26235d9800000000, 0x1b1ab8ee00000000, 0xcff0cb7500000000,
+ 0x6168720300000000, 0xb582019800000000, 0x88bbe4ee00000000,
+ 0x5c51977500000000, 0x3019ca0500000000, 0xe4f3b99e00000000,
+ 0xd9ca5ce800000000, 0x0d202f7300000000, 0xa3b8960500000000,
+ 0x7752e59e00000000, 0x4a6b00e800000000, 0x9e81737300000000,
+ 0x165a730500000000, 0xc2b0009e00000000, 0xff89e5e800000000,
+ 0x2b63967300000000, 0x85fb2f0500000000, 0x51115c9e00000000,
+ 0x6c28b9e800000000, 0xb8c2ca7300000000, 0x7c9fb80400000000,
+ 0xa875cb9f00000000, 0x954c2ee900000000, 0x41a65d7200000000,
+ 0xef3ee40400000000, 0x3bd4979f00000000, 0x06ed72e900000000,
+ 0xd207017200000000, 0x5adc010400000000, 0x8e36729f00000000,
+ 0xb30f97e900000000, 0x67e5e47200000000, 0xc97d5d0400000000,
+ 0x1d972e9f00000000, 0x20aecbe900000000, 0xf444b87200000000,
+ 0xa8152f0700000000, 0x7cff5c9c00000000, 0x41c6b9ea00000000,
+ 0x952cca7100000000, 0x3bb4730700000000, 0xef5e009c00000000,
+ 0xd267e5ea00000000, 0x068d967100000000, 0x8e56960700000000,
+ 0x5abce59c00000000, 0x678500ea00000000, 0xb36f737100000000,
+ 0x1df7ca0700000000, 0xc91db99c00000000, 0xf4245cea00000000,
+ 0x20ce2f7100000000, 0xe4935d0600000000, 0x30792e9d00000000,
+ 0x0d40cbeb00000000, 0xd9aab87000000000, 0x7732010600000000,
+ 0xa3d8729d00000000, 0x9ee197eb00000000, 0x4a0be47000000000,
+ 0xc2d0e40600000000, 0x163a979d00000000, 0x2b0372eb00000000,
+ 0xffe9017000000000, 0x5171b80600000000, 0x859bcb9d00000000,
+ 0xb8a22eeb00000000, 0x6c485d7000000000, 0x6032940b00000000,
+ 0xb4d8e79000000000, 0x89e102e600000000, 0x5d0b717d00000000,
+ 0xf393c80b00000000, 0x2779bb9000000000, 0x1a405ee600000000,
+ 0xceaa2d7d00000000, 0x46712d0b00000000, 0x929b5e9000000000,
+ 0xafa2bbe600000000, 0x7b48c87d00000000, 0xd5d0710b00000000,
+ 0x013a029000000000, 0x3c03e7e600000000, 0xe8e9947d00000000,
+ 0x2cb4e60a00000000, 0xf85e959100000000, 0xc56770e700000000,
+ 0x118d037c00000000, 0xbf15ba0a00000000, 0x6bffc99100000000,
+ 0x56c62ce700000000, 0x822c5f7c00000000, 0x0af75f0a00000000,
+ 0xde1d2c9100000000, 0xe324c9e700000000, 0x37ceba7c00000000,
+ 0x9956030a00000000, 0x4dbc709100000000, 0x708595e700000000,
+ 0xa46fe67c00000000, 0xf83e710900000000, 0x2cd4029200000000,
+ 0x11ede7e400000000, 0xc507947f00000000, 0x6b9f2d0900000000,
+ 0xbf755e9200000000, 0x824cbbe400000000, 0x56a6c87f00000000,
+ 0xde7dc80900000000, 0x0a97bb9200000000, 0x37ae5ee400000000,
+ 0xe3442d7f00000000, 0x4ddc940900000000, 0x9936e79200000000,
+ 0xa40f02e400000000, 0x70e5717f00000000, 0xb4b8030800000000,
+ 0x6052709300000000, 0x5d6b95e500000000, 0x8981e67e00000000,
+ 0x27195f0800000000, 0xf3f32c9300000000, 0xcecac9e500000000,
+ 0x1a20ba7e00000000, 0x92fbba0800000000, 0x4611c99300000000,
+ 0x7b282ce500000000, 0xafc25f7e00000000, 0x015ae60800000000,
+ 0xd5b0959300000000, 0xe88970e500000000, 0x3c63037e00000000,
+ 0x502b5e0e00000000, 0x84c12d9500000000, 0xb9f8c8e300000000,
+ 0x6d12bb7800000000, 0xc38a020e00000000, 0x1760719500000000,
+ 0x2a5994e300000000, 0xfeb3e77800000000, 0x7668e70e00000000,
+ 0xa282949500000000, 0x9fbb71e300000000, 0x4b51027800000000,
+ 0xe5c9bb0e00000000, 0x3123c89500000000, 0x0c1a2de300000000,
+ 0xd8f05e7800000000, 0x1cad2c0f00000000, 0xc8475f9400000000,
+ 0xf57ebae200000000, 0x2194c97900000000, 0x8f0c700f00000000,
+ 0x5be6039400000000, 0x66dfe6e200000000, 0xb235957900000000,
+ 0x3aee950f00000000, 0xee04e69400000000, 0xd33d03e200000000,
+ 0x07d7707900000000, 0xa94fc90f00000000, 0x7da5ba9400000000,
+ 0x409c5fe200000000, 0x94762c7900000000, 0xc827bb0c00000000,
+ 0x1ccdc89700000000, 0x21f42de100000000, 0xf51e5e7a00000000,
+ 0x5b86e70c00000000, 0x8f6c949700000000, 0xb25571e100000000,
+ 0x66bf027a00000000, 0xee64020c00000000, 0x3a8e719700000000,
+ 0x07b794e100000000, 0xd35de77a00000000, 0x7dc55e0c00000000,
+ 0xa92f2d9700000000, 0x9416c8e100000000, 0x40fcbb7a00000000,
+ 0x84a1c90d00000000, 0x504bba9600000000, 0x6d725fe000000000,
+ 0xb9982c7b00000000, 0x1700950d00000000, 0xc3eae69600000000,
+ 0xfed303e000000000, 0x2a39707b00000000, 0xa2e2700d00000000,
+ 0x7608039600000000, 0x4b31e6e000000000, 0x9fdb957b00000000,
+ 0x31432c0d00000000, 0xe5a95f9600000000, 0xd890bae000000000,
+ 0x0c7ac97b00000000},
+ {0x0000000000000000, 0x2765258100000000, 0x0fcc3bd900000000,
+ 0x28a91e5800000000, 0x5f9e066900000000, 0x78fb23e800000000,
+ 0x50523db000000000, 0x7737183100000000, 0xbe3c0dd200000000,
+ 0x9959285300000000, 0xb1f0360b00000000, 0x9695138a00000000,
+ 0xe1a20bbb00000000, 0xc6c72e3a00000000, 0xee6e306200000000,
+ 0xc90b15e300000000, 0x3d7f6b7f00000000, 0x1a1a4efe00000000,
+ 0x32b350a600000000, 0x15d6752700000000, 0x62e16d1600000000,
+ 0x4584489700000000, 0x6d2d56cf00000000, 0x4a48734e00000000,
+ 0x834366ad00000000, 0xa426432c00000000, 0x8c8f5d7400000000,
+ 0xabea78f500000000, 0xdcdd60c400000000, 0xfbb8454500000000,
+ 0xd3115b1d00000000, 0xf4747e9c00000000, 0x7afed6fe00000000,
+ 0x5d9bf37f00000000, 0x7532ed2700000000, 0x5257c8a600000000,
+ 0x2560d09700000000, 0x0205f51600000000, 0x2aaceb4e00000000,
+ 0x0dc9cecf00000000, 0xc4c2db2c00000000, 0xe3a7fead00000000,
+ 0xcb0ee0f500000000, 0xec6bc57400000000, 0x9b5cdd4500000000,
+ 0xbc39f8c400000000, 0x9490e69c00000000, 0xb3f5c31d00000000,
+ 0x4781bd8100000000, 0x60e4980000000000, 0x484d865800000000,
+ 0x6f28a3d900000000, 0x181fbbe800000000, 0x3f7a9e6900000000,
+ 0x17d3803100000000, 0x30b6a5b000000000, 0xf9bdb05300000000,
+ 0xded895d200000000, 0xf6718b8a00000000, 0xd114ae0b00000000,
+ 0xa623b63a00000000, 0x814693bb00000000, 0xa9ef8de300000000,
+ 0x8e8aa86200000000, 0xb5fadc2600000000, 0x929ff9a700000000,
+ 0xba36e7ff00000000, 0x9d53c27e00000000, 0xea64da4f00000000,
+ 0xcd01ffce00000000, 0xe5a8e19600000000, 0xc2cdc41700000000,
+ 0x0bc6d1f400000000, 0x2ca3f47500000000, 0x040aea2d00000000,
+ 0x236fcfac00000000, 0x5458d79d00000000, 0x733df21c00000000,
+ 0x5b94ec4400000000, 0x7cf1c9c500000000, 0x8885b75900000000,
+ 0xafe092d800000000, 0x87498c8000000000, 0xa02ca90100000000,
+ 0xd71bb13000000000, 0xf07e94b100000000, 0xd8d78ae900000000,
+ 0xffb2af6800000000, 0x36b9ba8b00000000, 0x11dc9f0a00000000,
+ 0x3975815200000000, 0x1e10a4d300000000, 0x6927bce200000000,
+ 0x4e42996300000000, 0x66eb873b00000000, 0x418ea2ba00000000,
+ 0xcf040ad800000000, 0xe8612f5900000000, 0xc0c8310100000000,
+ 0xe7ad148000000000, 0x909a0cb100000000, 0xb7ff293000000000,
+ 0x9f56376800000000, 0xb83312e900000000, 0x7138070a00000000,
+ 0x565d228b00000000, 0x7ef43cd300000000, 0x5991195200000000,
+ 0x2ea6016300000000, 0x09c324e200000000, 0x216a3aba00000000,
+ 0x060f1f3b00000000, 0xf27b61a700000000, 0xd51e442600000000,
+ 0xfdb75a7e00000000, 0xdad27fff00000000, 0xade567ce00000000,
+ 0x8a80424f00000000, 0xa2295c1700000000, 0x854c799600000000,
+ 0x4c476c7500000000, 0x6b2249f400000000, 0x438b57ac00000000,
+ 0x64ee722d00000000, 0x13d96a1c00000000, 0x34bc4f9d00000000,
+ 0x1c1551c500000000, 0x3b70744400000000, 0x6af5b94d00000000,
+ 0x4d909ccc00000000, 0x6539829400000000, 0x425ca71500000000,
+ 0x356bbf2400000000, 0x120e9aa500000000, 0x3aa784fd00000000,
+ 0x1dc2a17c00000000, 0xd4c9b49f00000000, 0xf3ac911e00000000,
+ 0xdb058f4600000000, 0xfc60aac700000000, 0x8b57b2f600000000,
+ 0xac32977700000000, 0x849b892f00000000, 0xa3feacae00000000,
+ 0x578ad23200000000, 0x70eff7b300000000, 0x5846e9eb00000000,
+ 0x7f23cc6a00000000, 0x0814d45b00000000, 0x2f71f1da00000000,
+ 0x07d8ef8200000000, 0x20bdca0300000000, 0xe9b6dfe000000000,
+ 0xced3fa6100000000, 0xe67ae43900000000, 0xc11fc1b800000000,
+ 0xb628d98900000000, 0x914dfc0800000000, 0xb9e4e25000000000,
+ 0x9e81c7d100000000, 0x100b6fb300000000, 0x376e4a3200000000,
+ 0x1fc7546a00000000, 0x38a271eb00000000, 0x4f9569da00000000,
+ 0x68f04c5b00000000, 0x4059520300000000, 0x673c778200000000,
+ 0xae37626100000000, 0x895247e000000000, 0xa1fb59b800000000,
+ 0x869e7c3900000000, 0xf1a9640800000000, 0xd6cc418900000000,
+ 0xfe655fd100000000, 0xd9007a5000000000, 0x2d7404cc00000000,
+ 0x0a11214d00000000, 0x22b83f1500000000, 0x05dd1a9400000000,
+ 0x72ea02a500000000, 0x558f272400000000, 0x7d26397c00000000,
+ 0x5a431cfd00000000, 0x9348091e00000000, 0xb42d2c9f00000000,
+ 0x9c8432c700000000, 0xbbe1174600000000, 0xccd60f7700000000,
+ 0xebb32af600000000, 0xc31a34ae00000000, 0xe47f112f00000000,
+ 0xdf0f656b00000000, 0xf86a40ea00000000, 0xd0c35eb200000000,
+ 0xf7a67b3300000000, 0x8091630200000000, 0xa7f4468300000000,
+ 0x8f5d58db00000000, 0xa8387d5a00000000, 0x613368b900000000,
+ 0x46564d3800000000, 0x6eff536000000000, 0x499a76e100000000,
+ 0x3ead6ed000000000, 0x19c84b5100000000, 0x3161550900000000,
+ 0x1604708800000000, 0xe2700e1400000000, 0xc5152b9500000000,
+ 0xedbc35cd00000000, 0xcad9104c00000000, 0xbdee087d00000000,
+ 0x9a8b2dfc00000000, 0xb22233a400000000, 0x9547162500000000,
+ 0x5c4c03c600000000, 0x7b29264700000000, 0x5380381f00000000,
+ 0x74e51d9e00000000, 0x03d205af00000000, 0x24b7202e00000000,
+ 0x0c1e3e7600000000, 0x2b7b1bf700000000, 0xa5f1b39500000000,
+ 0x8294961400000000, 0xaa3d884c00000000, 0x8d58adcd00000000,
+ 0xfa6fb5fc00000000, 0xdd0a907d00000000, 0xf5a38e2500000000,
+ 0xd2c6aba400000000, 0x1bcdbe4700000000, 0x3ca89bc600000000,
+ 0x1401859e00000000, 0x3364a01f00000000, 0x4453b82e00000000,
+ 0x63369daf00000000, 0x4b9f83f700000000, 0x6cfaa67600000000,
+ 0x988ed8ea00000000, 0xbfebfd6b00000000, 0x9742e33300000000,
+ 0xb027c6b200000000, 0xc710de8300000000, 0xe075fb0200000000,
+ 0xc8dce55a00000000, 0xefb9c0db00000000, 0x26b2d53800000000,
+ 0x01d7f0b900000000, 0x297eeee100000000, 0x0e1bcb6000000000,
+ 0x792cd35100000000, 0x5e49f6d000000000, 0x76e0e88800000000,
+ 0x5185cd0900000000}};
+
+#else /* W == 4 */
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0x9ba54c6f, 0xec3b9e9f, 0x779ed2f0, 0x03063b7f,
+ 0x98a37710, 0xef3da5e0, 0x7498e98f, 0x060c76fe, 0x9da93a91,
+ 0xea37e861, 0x7192a40e, 0x050a4d81, 0x9eaf01ee, 0xe931d31e,
+ 0x72949f71, 0x0c18edfc, 0x97bda193, 0xe0237363, 0x7b863f0c,
+ 0x0f1ed683, 0x94bb9aec, 0xe325481c, 0x78800473, 0x0a149b02,
+ 0x91b1d76d, 0xe62f059d, 0x7d8a49f2, 0x0912a07d, 0x92b7ec12,
+ 0xe5293ee2, 0x7e8c728d, 0x1831dbf8, 0x83949797, 0xf40a4567,
+ 0x6faf0908, 0x1b37e087, 0x8092ace8, 0xf70c7e18, 0x6ca93277,
+ 0x1e3dad06, 0x8598e169, 0xf2063399, 0x69a37ff6, 0x1d3b9679,
+ 0x869eda16, 0xf10008e6, 0x6aa54489, 0x14293604, 0x8f8c7a6b,
+ 0xf812a89b, 0x63b7e4f4, 0x172f0d7b, 0x8c8a4114, 0xfb1493e4,
+ 0x60b1df8b, 0x122540fa, 0x89800c95, 0xfe1ede65, 0x65bb920a,
+ 0x11237b85, 0x8a8637ea, 0xfd18e51a, 0x66bda975, 0x3063b7f0,
+ 0xabc6fb9f, 0xdc58296f, 0x47fd6500, 0x33658c8f, 0xa8c0c0e0,
+ 0xdf5e1210, 0x44fb5e7f, 0x366fc10e, 0xadca8d61, 0xda545f91,
+ 0x41f113fe, 0x3569fa71, 0xaeccb61e, 0xd95264ee, 0x42f72881,
+ 0x3c7b5a0c, 0xa7de1663, 0xd040c493, 0x4be588fc, 0x3f7d6173,
+ 0xa4d82d1c, 0xd346ffec, 0x48e3b383, 0x3a772cf2, 0xa1d2609d,
+ 0xd64cb26d, 0x4de9fe02, 0x3971178d, 0xa2d45be2, 0xd54a8912,
+ 0x4eefc57d, 0x28526c08, 0xb3f72067, 0xc469f297, 0x5fccbef8,
+ 0x2b545777, 0xb0f11b18, 0xc76fc9e8, 0x5cca8587, 0x2e5e1af6,
+ 0xb5fb5699, 0xc2658469, 0x59c0c806, 0x2d582189, 0xb6fd6de6,
+ 0xc163bf16, 0x5ac6f379, 0x244a81f4, 0xbfefcd9b, 0xc8711f6b,
+ 0x53d45304, 0x274cba8b, 0xbce9f6e4, 0xcb772414, 0x50d2687b,
+ 0x2246f70a, 0xb9e3bb65, 0xce7d6995, 0x55d825fa, 0x2140cc75,
+ 0xbae5801a, 0xcd7b52ea, 0x56de1e85, 0x60c76fe0, 0xfb62238f,
+ 0x8cfcf17f, 0x1759bd10, 0x63c1549f, 0xf86418f0, 0x8ffaca00,
+ 0x145f866f, 0x66cb191e, 0xfd6e5571, 0x8af08781, 0x1155cbee,
+ 0x65cd2261, 0xfe686e0e, 0x89f6bcfe, 0x1253f091, 0x6cdf821c,
+ 0xf77ace73, 0x80e41c83, 0x1b4150ec, 0x6fd9b963, 0xf47cf50c,
+ 0x83e227fc, 0x18476b93, 0x6ad3f4e2, 0xf176b88d, 0x86e86a7d,
+ 0x1d4d2612, 0x69d5cf9d, 0xf27083f2, 0x85ee5102, 0x1e4b1d6d,
+ 0x78f6b418, 0xe353f877, 0x94cd2a87, 0x0f6866e8, 0x7bf08f67,
+ 0xe055c308, 0x97cb11f8, 0x0c6e5d97, 0x7efac2e6, 0xe55f8e89,
+ 0x92c15c79, 0x09641016, 0x7dfcf999, 0xe659b5f6, 0x91c76706,
+ 0x0a622b69, 0x74ee59e4, 0xef4b158b, 0x98d5c77b, 0x03708b14,
+ 0x77e8629b, 0xec4d2ef4, 0x9bd3fc04, 0x0076b06b, 0x72e22f1a,
+ 0xe9476375, 0x9ed9b185, 0x057cfdea, 0x71e41465, 0xea41580a,
+ 0x9ddf8afa, 0x067ac695, 0x50a4d810, 0xcb01947f, 0xbc9f468f,
+ 0x273a0ae0, 0x53a2e36f, 0xc807af00, 0xbf997df0, 0x243c319f,
+ 0x56a8aeee, 0xcd0de281, 0xba933071, 0x21367c1e, 0x55ae9591,
+ 0xce0bd9fe, 0xb9950b0e, 0x22304761, 0x5cbc35ec, 0xc7197983,
+ 0xb087ab73, 0x2b22e71c, 0x5fba0e93, 0xc41f42fc, 0xb381900c,
+ 0x2824dc63, 0x5ab04312, 0xc1150f7d, 0xb68bdd8d, 0x2d2e91e2,
+ 0x59b6786d, 0xc2133402, 0xb58de6f2, 0x2e28aa9d, 0x489503e8,
+ 0xd3304f87, 0xa4ae9d77, 0x3f0bd118, 0x4b933897, 0xd03674f8,
+ 0xa7a8a608, 0x3c0dea67, 0x4e997516, 0xd53c3979, 0xa2a2eb89,
+ 0x3907a7e6, 0x4d9f4e69, 0xd63a0206, 0xa1a4d0f6, 0x3a019c99,
+ 0x448dee14, 0xdf28a27b, 0xa8b6708b, 0x33133ce4, 0x478bd56b,
+ 0xdc2e9904, 0xabb04bf4, 0x3015079b, 0x428198ea, 0xd924d485,
+ 0xaeba0675, 0x351f4a1a, 0x4187a395, 0xda22effa, 0xadbc3d0a,
+ 0x36197165},
+ {0x00000000, 0xc18edfc0, 0x586cb9c1, 0x99e26601, 0xb0d97382,
+ 0x7157ac42, 0xe8b5ca43, 0x293b1583, 0xbac3e145, 0x7b4d3e85,
+ 0xe2af5884, 0x23218744, 0x0a1a92c7, 0xcb944d07, 0x52762b06,
+ 0x93f8f4c6, 0xaef6c4cb, 0x6f781b0b, 0xf69a7d0a, 0x3714a2ca,
+ 0x1e2fb749, 0xdfa16889, 0x46430e88, 0x87cdd148, 0x1435258e,
+ 0xd5bbfa4e, 0x4c599c4f, 0x8dd7438f, 0xa4ec560c, 0x656289cc,
+ 0xfc80efcd, 0x3d0e300d, 0x869c8fd7, 0x47125017, 0xdef03616,
+ 0x1f7ee9d6, 0x3645fc55, 0xf7cb2395, 0x6e294594, 0xafa79a54,
+ 0x3c5f6e92, 0xfdd1b152, 0x6433d753, 0xa5bd0893, 0x8c861d10,
+ 0x4d08c2d0, 0xd4eaa4d1, 0x15647b11, 0x286a4b1c, 0xe9e494dc,
+ 0x7006f2dd, 0xb1882d1d, 0x98b3389e, 0x593de75e, 0xc0df815f,
+ 0x01515e9f, 0x92a9aa59, 0x53277599, 0xcac51398, 0x0b4bcc58,
+ 0x2270d9db, 0xe3fe061b, 0x7a1c601a, 0xbb92bfda, 0xd64819ef,
+ 0x17c6c62f, 0x8e24a02e, 0x4faa7fee, 0x66916a6d, 0xa71fb5ad,
+ 0x3efdd3ac, 0xff730c6c, 0x6c8bf8aa, 0xad05276a, 0x34e7416b,
+ 0xf5699eab, 0xdc528b28, 0x1ddc54e8, 0x843e32e9, 0x45b0ed29,
+ 0x78bedd24, 0xb93002e4, 0x20d264e5, 0xe15cbb25, 0xc867aea6,
+ 0x09e97166, 0x900b1767, 0x5185c8a7, 0xc27d3c61, 0x03f3e3a1,
+ 0x9a1185a0, 0x5b9f5a60, 0x72a44fe3, 0xb32a9023, 0x2ac8f622,
+ 0xeb4629e2, 0x50d49638, 0x915a49f8, 0x08b82ff9, 0xc936f039,
+ 0xe00de5ba, 0x21833a7a, 0xb8615c7b, 0x79ef83bb, 0xea17777d,
+ 0x2b99a8bd, 0xb27bcebc, 0x73f5117c, 0x5ace04ff, 0x9b40db3f,
+ 0x02a2bd3e, 0xc32c62fe, 0xfe2252f3, 0x3fac8d33, 0xa64eeb32,
+ 0x67c034f2, 0x4efb2171, 0x8f75feb1, 0x169798b0, 0xd7194770,
+ 0x44e1b3b6, 0x856f6c76, 0x1c8d0a77, 0xdd03d5b7, 0xf438c034,
+ 0x35b61ff4, 0xac5479f5, 0x6ddaa635, 0x77e1359f, 0xb66fea5f,
+ 0x2f8d8c5e, 0xee03539e, 0xc738461d, 0x06b699dd, 0x9f54ffdc,
+ 0x5eda201c, 0xcd22d4da, 0x0cac0b1a, 0x954e6d1b, 0x54c0b2db,
+ 0x7dfba758, 0xbc757898, 0x25971e99, 0xe419c159, 0xd917f154,
+ 0x18992e94, 0x817b4895, 0x40f59755, 0x69ce82d6, 0xa8405d16,
+ 0x31a23b17, 0xf02ce4d7, 0x63d41011, 0xa25acfd1, 0x3bb8a9d0,
+ 0xfa367610, 0xd30d6393, 0x1283bc53, 0x8b61da52, 0x4aef0592,
+ 0xf17dba48, 0x30f36588, 0xa9110389, 0x689fdc49, 0x41a4c9ca,
+ 0x802a160a, 0x19c8700b, 0xd846afcb, 0x4bbe5b0d, 0x8a3084cd,
+ 0x13d2e2cc, 0xd25c3d0c, 0xfb67288f, 0x3ae9f74f, 0xa30b914e,
+ 0x62854e8e, 0x5f8b7e83, 0x9e05a143, 0x07e7c742, 0xc6691882,
+ 0xef520d01, 0x2edcd2c1, 0xb73eb4c0, 0x76b06b00, 0xe5489fc6,
+ 0x24c64006, 0xbd242607, 0x7caaf9c7, 0x5591ec44, 0x941f3384,
+ 0x0dfd5585, 0xcc738a45, 0xa1a92c70, 0x6027f3b0, 0xf9c595b1,
+ 0x384b4a71, 0x11705ff2, 0xd0fe8032, 0x491ce633, 0x889239f3,
+ 0x1b6acd35, 0xdae412f5, 0x430674f4, 0x8288ab34, 0xabb3beb7,
+ 0x6a3d6177, 0xf3df0776, 0x3251d8b6, 0x0f5fe8bb, 0xced1377b,
+ 0x5733517a, 0x96bd8eba, 0xbf869b39, 0x7e0844f9, 0xe7ea22f8,
+ 0x2664fd38, 0xb59c09fe, 0x7412d63e, 0xedf0b03f, 0x2c7e6fff,
+ 0x05457a7c, 0xc4cba5bc, 0x5d29c3bd, 0x9ca71c7d, 0x2735a3a7,
+ 0xe6bb7c67, 0x7f591a66, 0xbed7c5a6, 0x97ecd025, 0x56620fe5,
+ 0xcf8069e4, 0x0e0eb624, 0x9df642e2, 0x5c789d22, 0xc59afb23,
+ 0x041424e3, 0x2d2f3160, 0xeca1eea0, 0x754388a1, 0xb4cd5761,
+ 0x89c3676c, 0x484db8ac, 0xd1afdead, 0x1021016d, 0x391a14ee,
+ 0xf894cb2e, 0x6176ad2f, 0xa0f872ef, 0x33008629, 0xf28e59e9,
+ 0x6b6c3fe8, 0xaae2e028, 0x83d9f5ab, 0x42572a6b, 0xdbb54c6a,
+ 0x1a3b93aa},
+ {0x00000000, 0xefc26b3e, 0x04f5d03d, 0xeb37bb03, 0x09eba07a,
+ 0xe629cb44, 0x0d1e7047, 0xe2dc1b79, 0x13d740f4, 0xfc152bca,
+ 0x172290c9, 0xf8e0fbf7, 0x1a3ce08e, 0xf5fe8bb0, 0x1ec930b3,
+ 0xf10b5b8d, 0x27ae81e8, 0xc86cead6, 0x235b51d5, 0xcc993aeb,
+ 0x2e452192, 0xc1874aac, 0x2ab0f1af, 0xc5729a91, 0x3479c11c,
+ 0xdbbbaa22, 0x308c1121, 0xdf4e7a1f, 0x3d926166, 0xd2500a58,
+ 0x3967b15b, 0xd6a5da65, 0x4f5d03d0, 0xa09f68ee, 0x4ba8d3ed,
+ 0xa46ab8d3, 0x46b6a3aa, 0xa974c894, 0x42437397, 0xad8118a9,
+ 0x5c8a4324, 0xb348281a, 0x587f9319, 0xb7bdf827, 0x5561e35e,
+ 0xbaa38860, 0x51943363, 0xbe56585d, 0x68f38238, 0x8731e906,
+ 0x6c065205, 0x83c4393b, 0x61182242, 0x8eda497c, 0x65edf27f,
+ 0x8a2f9941, 0x7b24c2cc, 0x94e6a9f2, 0x7fd112f1, 0x901379cf,
+ 0x72cf62b6, 0x9d0d0988, 0x763ab28b, 0x99f8d9b5, 0x9eba07a0,
+ 0x71786c9e, 0x9a4fd79d, 0x758dbca3, 0x9751a7da, 0x7893cce4,
+ 0x93a477e7, 0x7c661cd9, 0x8d6d4754, 0x62af2c6a, 0x89989769,
+ 0x665afc57, 0x8486e72e, 0x6b448c10, 0x80733713, 0x6fb15c2d,
+ 0xb9148648, 0x56d6ed76, 0xbde15675, 0x52233d4b, 0xb0ff2632,
+ 0x5f3d4d0c, 0xb40af60f, 0x5bc89d31, 0xaac3c6bc, 0x4501ad82,
+ 0xae361681, 0x41f47dbf, 0xa32866c6, 0x4cea0df8, 0xa7ddb6fb,
+ 0x481fddc5, 0xd1e70470, 0x3e256f4e, 0xd512d44d, 0x3ad0bf73,
+ 0xd80ca40a, 0x37cecf34, 0xdcf97437, 0x333b1f09, 0xc2304484,
+ 0x2df22fba, 0xc6c594b9, 0x2907ff87, 0xcbdbe4fe, 0x24198fc0,
+ 0xcf2e34c3, 0x20ec5ffd, 0xf6498598, 0x198beea6, 0xf2bc55a5,
+ 0x1d7e3e9b, 0xffa225e2, 0x10604edc, 0xfb57f5df, 0x14959ee1,
+ 0xe59ec56c, 0x0a5cae52, 0xe16b1551, 0x0ea97e6f, 0xec756516,
+ 0x03b70e28, 0xe880b52b, 0x0742de15, 0xe6050901, 0x09c7623f,
+ 0xe2f0d93c, 0x0d32b202, 0xefeea97b, 0x002cc245, 0xeb1b7946,
+ 0x04d91278, 0xf5d249f5, 0x1a1022cb, 0xf12799c8, 0x1ee5f2f6,
+ 0xfc39e98f, 0x13fb82b1, 0xf8cc39b2, 0x170e528c, 0xc1ab88e9,
+ 0x2e69e3d7, 0xc55e58d4, 0x2a9c33ea, 0xc8402893, 0x278243ad,
+ 0xccb5f8ae, 0x23779390, 0xd27cc81d, 0x3dbea323, 0xd6891820,
+ 0x394b731e, 0xdb976867, 0x34550359, 0xdf62b85a, 0x30a0d364,
+ 0xa9580ad1, 0x469a61ef, 0xadaddaec, 0x426fb1d2, 0xa0b3aaab,
+ 0x4f71c195, 0xa4467a96, 0x4b8411a8, 0xba8f4a25, 0x554d211b,
+ 0xbe7a9a18, 0x51b8f126, 0xb364ea5f, 0x5ca68161, 0xb7913a62,
+ 0x5853515c, 0x8ef68b39, 0x6134e007, 0x8a035b04, 0x65c1303a,
+ 0x871d2b43, 0x68df407d, 0x83e8fb7e, 0x6c2a9040, 0x9d21cbcd,
+ 0x72e3a0f3, 0x99d41bf0, 0x761670ce, 0x94ca6bb7, 0x7b080089,
+ 0x903fbb8a, 0x7ffdd0b4, 0x78bf0ea1, 0x977d659f, 0x7c4ade9c,
+ 0x9388b5a2, 0x7154aedb, 0x9e96c5e5, 0x75a17ee6, 0x9a6315d8,
+ 0x6b684e55, 0x84aa256b, 0x6f9d9e68, 0x805ff556, 0x6283ee2f,
+ 0x8d418511, 0x66763e12, 0x89b4552c, 0x5f118f49, 0xb0d3e477,
+ 0x5be45f74, 0xb426344a, 0x56fa2f33, 0xb938440d, 0x520fff0e,
+ 0xbdcd9430, 0x4cc6cfbd, 0xa304a483, 0x48331f80, 0xa7f174be,
+ 0x452d6fc7, 0xaaef04f9, 0x41d8bffa, 0xae1ad4c4, 0x37e20d71,
+ 0xd820664f, 0x3317dd4c, 0xdcd5b672, 0x3e09ad0b, 0xd1cbc635,
+ 0x3afc7d36, 0xd53e1608, 0x24354d85, 0xcbf726bb, 0x20c09db8,
+ 0xcf02f686, 0x2ddeedff, 0xc21c86c1, 0x292b3dc2, 0xc6e956fc,
+ 0x104c8c99, 0xff8ee7a7, 0x14b95ca4, 0xfb7b379a, 0x19a72ce3,
+ 0xf66547dd, 0x1d52fcde, 0xf29097e0, 0x039bcc6d, 0xec59a753,
+ 0x076e1c50, 0xe8ac776e, 0x0a706c17, 0xe5b20729, 0x0e85bc2a,
+ 0xe147d714},
+ {0x00000000, 0x177b1443, 0x2ef62886, 0x398d3cc5, 0x5dec510c,
+ 0x4a97454f, 0x731a798a, 0x64616dc9, 0xbbd8a218, 0xaca3b65b,
+ 0x952e8a9e, 0x82559edd, 0xe634f314, 0xf14fe757, 0xc8c2db92,
+ 0xdfb9cfd1, 0xacc04271, 0xbbbb5632, 0x82366af7, 0x954d7eb4,
+ 0xf12c137d, 0xe657073e, 0xdfda3bfb, 0xc8a12fb8, 0x1718e069,
+ 0x0063f42a, 0x39eec8ef, 0x2e95dcac, 0x4af4b165, 0x5d8fa526,
+ 0x640299e3, 0x73798da0, 0x82f182a3, 0x958a96e0, 0xac07aa25,
+ 0xbb7cbe66, 0xdf1dd3af, 0xc866c7ec, 0xf1ebfb29, 0xe690ef6a,
+ 0x392920bb, 0x2e5234f8, 0x17df083d, 0x00a41c7e, 0x64c571b7,
+ 0x73be65f4, 0x4a335931, 0x5d484d72, 0x2e31c0d2, 0x394ad491,
+ 0x00c7e854, 0x17bcfc17, 0x73dd91de, 0x64a6859d, 0x5d2bb958,
+ 0x4a50ad1b, 0x95e962ca, 0x82927689, 0xbb1f4a4c, 0xac645e0f,
+ 0xc80533c6, 0xdf7e2785, 0xe6f31b40, 0xf1880f03, 0xde920307,
+ 0xc9e91744, 0xf0642b81, 0xe71f3fc2, 0x837e520b, 0x94054648,
+ 0xad887a8d, 0xbaf36ece, 0x654aa11f, 0x7231b55c, 0x4bbc8999,
+ 0x5cc79dda, 0x38a6f013, 0x2fdde450, 0x1650d895, 0x012bccd6,
+ 0x72524176, 0x65295535, 0x5ca469f0, 0x4bdf7db3, 0x2fbe107a,
+ 0x38c50439, 0x014838fc, 0x16332cbf, 0xc98ae36e, 0xdef1f72d,
+ 0xe77ccbe8, 0xf007dfab, 0x9466b262, 0x831da621, 0xba909ae4,
+ 0xadeb8ea7, 0x5c6381a4, 0x4b1895e7, 0x7295a922, 0x65eebd61,
+ 0x018fd0a8, 0x16f4c4eb, 0x2f79f82e, 0x3802ec6d, 0xe7bb23bc,
+ 0xf0c037ff, 0xc94d0b3a, 0xde361f79, 0xba5772b0, 0xad2c66f3,
+ 0x94a15a36, 0x83da4e75, 0xf0a3c3d5, 0xe7d8d796, 0xde55eb53,
+ 0xc92eff10, 0xad4f92d9, 0xba34869a, 0x83b9ba5f, 0x94c2ae1c,
+ 0x4b7b61cd, 0x5c00758e, 0x658d494b, 0x72f65d08, 0x169730c1,
+ 0x01ec2482, 0x38611847, 0x2f1a0c04, 0x6655004f, 0x712e140c,
+ 0x48a328c9, 0x5fd83c8a, 0x3bb95143, 0x2cc24500, 0x154f79c5,
+ 0x02346d86, 0xdd8da257, 0xcaf6b614, 0xf37b8ad1, 0xe4009e92,
+ 0x8061f35b, 0x971ae718, 0xae97dbdd, 0xb9eccf9e, 0xca95423e,
+ 0xddee567d, 0xe4636ab8, 0xf3187efb, 0x97791332, 0x80020771,
+ 0xb98f3bb4, 0xaef42ff7, 0x714de026, 0x6636f465, 0x5fbbc8a0,
+ 0x48c0dce3, 0x2ca1b12a, 0x3bdaa569, 0x025799ac, 0x152c8def,
+ 0xe4a482ec, 0xf3df96af, 0xca52aa6a, 0xdd29be29, 0xb948d3e0,
+ 0xae33c7a3, 0x97befb66, 0x80c5ef25, 0x5f7c20f4, 0x480734b7,
+ 0x718a0872, 0x66f11c31, 0x029071f8, 0x15eb65bb, 0x2c66597e,
+ 0x3b1d4d3d, 0x4864c09d, 0x5f1fd4de, 0x6692e81b, 0x71e9fc58,
+ 0x15889191, 0x02f385d2, 0x3b7eb917, 0x2c05ad54, 0xf3bc6285,
+ 0xe4c776c6, 0xdd4a4a03, 0xca315e40, 0xae503389, 0xb92b27ca,
+ 0x80a61b0f, 0x97dd0f4c, 0xb8c70348, 0xafbc170b, 0x96312bce,
+ 0x814a3f8d, 0xe52b5244, 0xf2504607, 0xcbdd7ac2, 0xdca66e81,
+ 0x031fa150, 0x1464b513, 0x2de989d6, 0x3a929d95, 0x5ef3f05c,
+ 0x4988e41f, 0x7005d8da, 0x677ecc99, 0x14074139, 0x037c557a,
+ 0x3af169bf, 0x2d8a7dfc, 0x49eb1035, 0x5e900476, 0x671d38b3,
+ 0x70662cf0, 0xafdfe321, 0xb8a4f762, 0x8129cba7, 0x9652dfe4,
+ 0xf233b22d, 0xe548a66e, 0xdcc59aab, 0xcbbe8ee8, 0x3a3681eb,
+ 0x2d4d95a8, 0x14c0a96d, 0x03bbbd2e, 0x67dad0e7, 0x70a1c4a4,
+ 0x492cf861, 0x5e57ec22, 0x81ee23f3, 0x969537b0, 0xaf180b75,
+ 0xb8631f36, 0xdc0272ff, 0xcb7966bc, 0xf2f45a79, 0xe58f4e3a,
+ 0x96f6c39a, 0x818dd7d9, 0xb800eb1c, 0xaf7bff5f, 0xcb1a9296,
+ 0xdc6186d5, 0xe5ecba10, 0xf297ae53, 0x2d2e6182, 0x3a5575c1,
+ 0x03d84904, 0x14a35d47, 0x70c2308e, 0x67b924cd, 0x5e341808,
+ 0x494f0c4b}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x00000000, 0x43147b17, 0x8628f62e, 0xc53c8d39, 0x0c51ec5d,
+ 0x4f45974a, 0x8a791a73, 0xc96d6164, 0x18a2d8bb, 0x5bb6a3ac,
+ 0x9e8a2e95, 0xdd9e5582, 0x14f334e6, 0x57e74ff1, 0x92dbc2c8,
+ 0xd1cfb9df, 0x7142c0ac, 0x3256bbbb, 0xf76a3682, 0xb47e4d95,
+ 0x7d132cf1, 0x3e0757e6, 0xfb3bdadf, 0xb82fa1c8, 0x69e01817,
+ 0x2af46300, 0xefc8ee39, 0xacdc952e, 0x65b1f44a, 0x26a58f5d,
+ 0xe3990264, 0xa08d7973, 0xa382f182, 0xe0968a95, 0x25aa07ac,
+ 0x66be7cbb, 0xafd31ddf, 0xecc766c8, 0x29fbebf1, 0x6aef90e6,
+ 0xbb202939, 0xf834522e, 0x3d08df17, 0x7e1ca400, 0xb771c564,
+ 0xf465be73, 0x3159334a, 0x724d485d, 0xd2c0312e, 0x91d44a39,
+ 0x54e8c700, 0x17fcbc17, 0xde91dd73, 0x9d85a664, 0x58b92b5d,
+ 0x1bad504a, 0xca62e995, 0x89769282, 0x4c4a1fbb, 0x0f5e64ac,
+ 0xc63305c8, 0x85277edf, 0x401bf3e6, 0x030f88f1, 0x070392de,
+ 0x4417e9c9, 0x812b64f0, 0xc23f1fe7, 0x0b527e83, 0x48460594,
+ 0x8d7a88ad, 0xce6ef3ba, 0x1fa14a65, 0x5cb53172, 0x9989bc4b,
+ 0xda9dc75c, 0x13f0a638, 0x50e4dd2f, 0x95d85016, 0xd6cc2b01,
+ 0x76415272, 0x35552965, 0xf069a45c, 0xb37ddf4b, 0x7a10be2f,
+ 0x3904c538, 0xfc384801, 0xbf2c3316, 0x6ee38ac9, 0x2df7f1de,
+ 0xe8cb7ce7, 0xabdf07f0, 0x62b26694, 0x21a61d83, 0xe49a90ba,
+ 0xa78eebad, 0xa481635c, 0xe795184b, 0x22a99572, 0x61bdee65,
+ 0xa8d08f01, 0xebc4f416, 0x2ef8792f, 0x6dec0238, 0xbc23bbe7,
+ 0xff37c0f0, 0x3a0b4dc9, 0x791f36de, 0xb07257ba, 0xf3662cad,
+ 0x365aa194, 0x754eda83, 0xd5c3a3f0, 0x96d7d8e7, 0x53eb55de,
+ 0x10ff2ec9, 0xd9924fad, 0x9a8634ba, 0x5fbab983, 0x1caec294,
+ 0xcd617b4b, 0x8e75005c, 0x4b498d65, 0x085df672, 0xc1309716,
+ 0x8224ec01, 0x47186138, 0x040c1a2f, 0x4f005566, 0x0c142e71,
+ 0xc928a348, 0x8a3cd85f, 0x4351b93b, 0x0045c22c, 0xc5794f15,
+ 0x866d3402, 0x57a28ddd, 0x14b6f6ca, 0xd18a7bf3, 0x929e00e4,
+ 0x5bf36180, 0x18e71a97, 0xdddb97ae, 0x9ecfecb9, 0x3e4295ca,
+ 0x7d56eedd, 0xb86a63e4, 0xfb7e18f3, 0x32137997, 0x71070280,
+ 0xb43b8fb9, 0xf72ff4ae, 0x26e04d71, 0x65f43666, 0xa0c8bb5f,
+ 0xe3dcc048, 0x2ab1a12c, 0x69a5da3b, 0xac995702, 0xef8d2c15,
+ 0xec82a4e4, 0xaf96dff3, 0x6aaa52ca, 0x29be29dd, 0xe0d348b9,
+ 0xa3c733ae, 0x66fbbe97, 0x25efc580, 0xf4207c5f, 0xb7340748,
+ 0x72088a71, 0x311cf166, 0xf8719002, 0xbb65eb15, 0x7e59662c,
+ 0x3d4d1d3b, 0x9dc06448, 0xded41f5f, 0x1be89266, 0x58fce971,
+ 0x91918815, 0xd285f302, 0x17b97e3b, 0x54ad052c, 0x8562bcf3,
+ 0xc676c7e4, 0x034a4add, 0x405e31ca, 0x893350ae, 0xca272bb9,
+ 0x0f1ba680, 0x4c0fdd97, 0x4803c7b8, 0x0b17bcaf, 0xce2b3196,
+ 0x8d3f4a81, 0x44522be5, 0x074650f2, 0xc27addcb, 0x816ea6dc,
+ 0x50a11f03, 0x13b56414, 0xd689e92d, 0x959d923a, 0x5cf0f35e,
+ 0x1fe48849, 0xdad80570, 0x99cc7e67, 0x39410714, 0x7a557c03,
+ 0xbf69f13a, 0xfc7d8a2d, 0x3510eb49, 0x7604905e, 0xb3381d67,
+ 0xf02c6670, 0x21e3dfaf, 0x62f7a4b8, 0xa7cb2981, 0xe4df5296,
+ 0x2db233f2, 0x6ea648e5, 0xab9ac5dc, 0xe88ebecb, 0xeb81363a,
+ 0xa8954d2d, 0x6da9c014, 0x2ebdbb03, 0xe7d0da67, 0xa4c4a170,
+ 0x61f82c49, 0x22ec575e, 0xf323ee81, 0xb0379596, 0x750b18af,
+ 0x361f63b8, 0xff7202dc, 0xbc6679cb, 0x795af4f2, 0x3a4e8fe5,
+ 0x9ac3f696, 0xd9d78d81, 0x1ceb00b8, 0x5fff7baf, 0x96921acb,
+ 0xd58661dc, 0x10baece5, 0x53ae97f2, 0x82612e2d, 0xc175553a,
+ 0x0449d803, 0x475da314, 0x8e30c270, 0xcd24b967, 0x0818345e,
+ 0x4b0c4f49},
+ {0x00000000, 0x3e6bc2ef, 0x3dd0f504, 0x03bb37eb, 0x7aa0eb09,
+ 0x44cb29e6, 0x47701e0d, 0x791bdce2, 0xf440d713, 0xca2b15fc,
+ 0xc9902217, 0xf7fbe0f8, 0x8ee03c1a, 0xb08bfef5, 0xb330c91e,
+ 0x8d5b0bf1, 0xe881ae27, 0xd6ea6cc8, 0xd5515b23, 0xeb3a99cc,
+ 0x9221452e, 0xac4a87c1, 0xaff1b02a, 0x919a72c5, 0x1cc17934,
+ 0x22aabbdb, 0x21118c30, 0x1f7a4edf, 0x6661923d, 0x580a50d2,
+ 0x5bb16739, 0x65daa5d6, 0xd0035d4f, 0xee689fa0, 0xedd3a84b,
+ 0xd3b86aa4, 0xaaa3b646, 0x94c874a9, 0x97734342, 0xa91881ad,
+ 0x24438a5c, 0x1a2848b3, 0x19937f58, 0x27f8bdb7, 0x5ee36155,
+ 0x6088a3ba, 0x63339451, 0x5d5856be, 0x3882f368, 0x06e93187,
+ 0x0552066c, 0x3b39c483, 0x42221861, 0x7c49da8e, 0x7ff2ed65,
+ 0x41992f8a, 0xccc2247b, 0xf2a9e694, 0xf112d17f, 0xcf791390,
+ 0xb662cf72, 0x88090d9d, 0x8bb23a76, 0xb5d9f899, 0xa007ba9e,
+ 0x9e6c7871, 0x9dd74f9a, 0xa3bc8d75, 0xdaa75197, 0xe4cc9378,
+ 0xe777a493, 0xd91c667c, 0x54476d8d, 0x6a2caf62, 0x69979889,
+ 0x57fc5a66, 0x2ee78684, 0x108c446b, 0x13377380, 0x2d5cb16f,
+ 0x488614b9, 0x76edd656, 0x7556e1bd, 0x4b3d2352, 0x3226ffb0,
+ 0x0c4d3d5f, 0x0ff60ab4, 0x319dc85b, 0xbcc6c3aa, 0x82ad0145,
+ 0x811636ae, 0xbf7df441, 0xc66628a3, 0xf80dea4c, 0xfbb6dda7,
+ 0xc5dd1f48, 0x7004e7d1, 0x4e6f253e, 0x4dd412d5, 0x73bfd03a,
+ 0x0aa40cd8, 0x34cfce37, 0x3774f9dc, 0x091f3b33, 0x844430c2,
+ 0xba2ff22d, 0xb994c5c6, 0x87ff0729, 0xfee4dbcb, 0xc08f1924,
+ 0xc3342ecf, 0xfd5fec20, 0x988549f6, 0xa6ee8b19, 0xa555bcf2,
+ 0x9b3e7e1d, 0xe225a2ff, 0xdc4e6010, 0xdff557fb, 0xe19e9514,
+ 0x6cc59ee5, 0x52ae5c0a, 0x51156be1, 0x6f7ea90e, 0x166575ec,
+ 0x280eb703, 0x2bb580e8, 0x15de4207, 0x010905e6, 0x3f62c709,
+ 0x3cd9f0e2, 0x02b2320d, 0x7ba9eeef, 0x45c22c00, 0x46791beb,
+ 0x7812d904, 0xf549d2f5, 0xcb22101a, 0xc89927f1, 0xf6f2e51e,
+ 0x8fe939fc, 0xb182fb13, 0xb239ccf8, 0x8c520e17, 0xe988abc1,
+ 0xd7e3692e, 0xd4585ec5, 0xea339c2a, 0x932840c8, 0xad438227,
+ 0xaef8b5cc, 0x90937723, 0x1dc87cd2, 0x23a3be3d, 0x201889d6,
+ 0x1e734b39, 0x676897db, 0x59035534, 0x5ab862df, 0x64d3a030,
+ 0xd10a58a9, 0xef619a46, 0xecdaadad, 0xd2b16f42, 0xabaab3a0,
+ 0x95c1714f, 0x967a46a4, 0xa811844b, 0x254a8fba, 0x1b214d55,
+ 0x189a7abe, 0x26f1b851, 0x5fea64b3, 0x6181a65c, 0x623a91b7,
+ 0x5c515358, 0x398bf68e, 0x07e03461, 0x045b038a, 0x3a30c165,
+ 0x432b1d87, 0x7d40df68, 0x7efbe883, 0x40902a6c, 0xcdcb219d,
+ 0xf3a0e372, 0xf01bd499, 0xce701676, 0xb76bca94, 0x8900087b,
+ 0x8abb3f90, 0xb4d0fd7f, 0xa10ebf78, 0x9f657d97, 0x9cde4a7c,
+ 0xa2b58893, 0xdbae5471, 0xe5c5969e, 0xe67ea175, 0xd815639a,
+ 0x554e686b, 0x6b25aa84, 0x689e9d6f, 0x56f55f80, 0x2fee8362,
+ 0x1185418d, 0x123e7666, 0x2c55b489, 0x498f115f, 0x77e4d3b0,
+ 0x745fe45b, 0x4a3426b4, 0x332ffa56, 0x0d4438b9, 0x0eff0f52,
+ 0x3094cdbd, 0xbdcfc64c, 0x83a404a3, 0x801f3348, 0xbe74f1a7,
+ 0xc76f2d45, 0xf904efaa, 0xfabfd841, 0xc4d41aae, 0x710de237,
+ 0x4f6620d8, 0x4cdd1733, 0x72b6d5dc, 0x0bad093e, 0x35c6cbd1,
+ 0x367dfc3a, 0x08163ed5, 0x854d3524, 0xbb26f7cb, 0xb89dc020,
+ 0x86f602cf, 0xffedde2d, 0xc1861cc2, 0xc23d2b29, 0xfc56e9c6,
+ 0x998c4c10, 0xa7e78eff, 0xa45cb914, 0x9a377bfb, 0xe32ca719,
+ 0xdd4765f6, 0xdefc521d, 0xe09790f2, 0x6dcc9b03, 0x53a759ec,
+ 0x501c6e07, 0x6e77ace8, 0x176c700a, 0x2907b2e5, 0x2abc850e,
+ 0x14d747e1},
+ {0x00000000, 0xc0df8ec1, 0xc1b96c58, 0x0166e299, 0x8273d9b0,
+ 0x42ac5771, 0x43cab5e8, 0x83153b29, 0x45e1c3ba, 0x853e4d7b,
+ 0x8458afe2, 0x44872123, 0xc7921a0a, 0x074d94cb, 0x062b7652,
+ 0xc6f4f893, 0xcbc4f6ae, 0x0b1b786f, 0x0a7d9af6, 0xcaa21437,
+ 0x49b72f1e, 0x8968a1df, 0x880e4346, 0x48d1cd87, 0x8e253514,
+ 0x4efabbd5, 0x4f9c594c, 0x8f43d78d, 0x0c56eca4, 0xcc896265,
+ 0xcdef80fc, 0x0d300e3d, 0xd78f9c86, 0x17501247, 0x1636f0de,
+ 0xd6e97e1f, 0x55fc4536, 0x9523cbf7, 0x9445296e, 0x549aa7af,
+ 0x926e5f3c, 0x52b1d1fd, 0x53d73364, 0x9308bda5, 0x101d868c,
+ 0xd0c2084d, 0xd1a4ead4, 0x117b6415, 0x1c4b6a28, 0xdc94e4e9,
+ 0xddf20670, 0x1d2d88b1, 0x9e38b398, 0x5ee73d59, 0x5f81dfc0,
+ 0x9f5e5101, 0x59aaa992, 0x99752753, 0x9813c5ca, 0x58cc4b0b,
+ 0xdbd97022, 0x1b06fee3, 0x1a601c7a, 0xdabf92bb, 0xef1948d6,
+ 0x2fc6c617, 0x2ea0248e, 0xee7faa4f, 0x6d6a9166, 0xadb51fa7,
+ 0xacd3fd3e, 0x6c0c73ff, 0xaaf88b6c, 0x6a2705ad, 0x6b41e734,
+ 0xab9e69f5, 0x288b52dc, 0xe854dc1d, 0xe9323e84, 0x29edb045,
+ 0x24ddbe78, 0xe40230b9, 0xe564d220, 0x25bb5ce1, 0xa6ae67c8,
+ 0x6671e909, 0x67170b90, 0xa7c88551, 0x613c7dc2, 0xa1e3f303,
+ 0xa085119a, 0x605a9f5b, 0xe34fa472, 0x23902ab3, 0x22f6c82a,
+ 0xe22946eb, 0x3896d450, 0xf8495a91, 0xf92fb808, 0x39f036c9,
+ 0xbae50de0, 0x7a3a8321, 0x7b5c61b8, 0xbb83ef79, 0x7d7717ea,
+ 0xbda8992b, 0xbcce7bb2, 0x7c11f573, 0xff04ce5a, 0x3fdb409b,
+ 0x3ebda202, 0xfe622cc3, 0xf35222fe, 0x338dac3f, 0x32eb4ea6,
+ 0xf234c067, 0x7121fb4e, 0xb1fe758f, 0xb0989716, 0x704719d7,
+ 0xb6b3e144, 0x766c6f85, 0x770a8d1c, 0xb7d503dd, 0x34c038f4,
+ 0xf41fb635, 0xf57954ac, 0x35a6da6d, 0x9f35e177, 0x5fea6fb6,
+ 0x5e8c8d2f, 0x9e5303ee, 0x1d4638c7, 0xdd99b606, 0xdcff549f,
+ 0x1c20da5e, 0xdad422cd, 0x1a0bac0c, 0x1b6d4e95, 0xdbb2c054,
+ 0x58a7fb7d, 0x987875bc, 0x991e9725, 0x59c119e4, 0x54f117d9,
+ 0x942e9918, 0x95487b81, 0x5597f540, 0xd682ce69, 0x165d40a8,
+ 0x173ba231, 0xd7e42cf0, 0x1110d463, 0xd1cf5aa2, 0xd0a9b83b,
+ 0x107636fa, 0x93630dd3, 0x53bc8312, 0x52da618b, 0x9205ef4a,
+ 0x48ba7df1, 0x8865f330, 0x890311a9, 0x49dc9f68, 0xcac9a441,
+ 0x0a162a80, 0x0b70c819, 0xcbaf46d8, 0x0d5bbe4b, 0xcd84308a,
+ 0xcce2d213, 0x0c3d5cd2, 0x8f2867fb, 0x4ff7e93a, 0x4e910ba3,
+ 0x8e4e8562, 0x837e8b5f, 0x43a1059e, 0x42c7e707, 0x821869c6,
+ 0x010d52ef, 0xc1d2dc2e, 0xc0b43eb7, 0x006bb076, 0xc69f48e5,
+ 0x0640c624, 0x072624bd, 0xc7f9aa7c, 0x44ec9155, 0x84331f94,
+ 0x8555fd0d, 0x458a73cc, 0x702ca9a1, 0xb0f32760, 0xb195c5f9,
+ 0x714a4b38, 0xf25f7011, 0x3280fed0, 0x33e61c49, 0xf3399288,
+ 0x35cd6a1b, 0xf512e4da, 0xf4740643, 0x34ab8882, 0xb7beb3ab,
+ 0x77613d6a, 0x7607dff3, 0xb6d85132, 0xbbe85f0f, 0x7b37d1ce,
+ 0x7a513357, 0xba8ebd96, 0x399b86bf, 0xf944087e, 0xf822eae7,
+ 0x38fd6426, 0xfe099cb5, 0x3ed61274, 0x3fb0f0ed, 0xff6f7e2c,
+ 0x7c7a4505, 0xbca5cbc4, 0xbdc3295d, 0x7d1ca79c, 0xa7a33527,
+ 0x677cbbe6, 0x661a597f, 0xa6c5d7be, 0x25d0ec97, 0xe50f6256,
+ 0xe46980cf, 0x24b60e0e, 0xe242f69d, 0x229d785c, 0x23fb9ac5,
+ 0xe3241404, 0x60312f2d, 0xa0eea1ec, 0xa1884375, 0x6157cdb4,
+ 0x6c67c389, 0xacb84d48, 0xaddeafd1, 0x6d012110, 0xee141a39,
+ 0x2ecb94f8, 0x2fad7661, 0xef72f8a0, 0x29860033, 0xe9598ef2,
+ 0xe83f6c6b, 0x28e0e2aa, 0xabf5d983, 0x6b2a5742, 0x6a4cb5db,
+ 0xaa933b1a},
+ {0x00000000, 0x6f4ca59b, 0x9f9e3bec, 0xf0d29e77, 0x7f3b0603,
+ 0x1077a398, 0xe0a53def, 0x8fe99874, 0xfe760c06, 0x913aa99d,
+ 0x61e837ea, 0x0ea49271, 0x814d0a05, 0xee01af9e, 0x1ed331e9,
+ 0x719f9472, 0xfced180c, 0x93a1bd97, 0x637323e0, 0x0c3f867b,
+ 0x83d61e0f, 0xec9abb94, 0x1c4825e3, 0x73048078, 0x029b140a,
+ 0x6dd7b191, 0x9d052fe6, 0xf2498a7d, 0x7da01209, 0x12ecb792,
+ 0xe23e29e5, 0x8d728c7e, 0xf8db3118, 0x97979483, 0x67450af4,
+ 0x0809af6f, 0x87e0371b, 0xe8ac9280, 0x187e0cf7, 0x7732a96c,
+ 0x06ad3d1e, 0x69e19885, 0x993306f2, 0xf67fa369, 0x79963b1d,
+ 0x16da9e86, 0xe60800f1, 0x8944a56a, 0x04362914, 0x6b7a8c8f,
+ 0x9ba812f8, 0xf4e4b763, 0x7b0d2f17, 0x14418a8c, 0xe49314fb,
+ 0x8bdfb160, 0xfa402512, 0x950c8089, 0x65de1efe, 0x0a92bb65,
+ 0x857b2311, 0xea37868a, 0x1ae518fd, 0x75a9bd66, 0xf0b76330,
+ 0x9ffbc6ab, 0x6f2958dc, 0x0065fd47, 0x8f8c6533, 0xe0c0c0a8,
+ 0x10125edf, 0x7f5efb44, 0x0ec16f36, 0x618dcaad, 0x915f54da,
+ 0xfe13f141, 0x71fa6935, 0x1eb6ccae, 0xee6452d9, 0x8128f742,
+ 0x0c5a7b3c, 0x6316dea7, 0x93c440d0, 0xfc88e54b, 0x73617d3f,
+ 0x1c2dd8a4, 0xecff46d3, 0x83b3e348, 0xf22c773a, 0x9d60d2a1,
+ 0x6db24cd6, 0x02fee94d, 0x8d177139, 0xe25bd4a2, 0x12894ad5,
+ 0x7dc5ef4e, 0x086c5228, 0x6720f7b3, 0x97f269c4, 0xf8becc5f,
+ 0x7757542b, 0x181bf1b0, 0xe8c96fc7, 0x8785ca5c, 0xf61a5e2e,
+ 0x9956fbb5, 0x698465c2, 0x06c8c059, 0x8921582d, 0xe66dfdb6,
+ 0x16bf63c1, 0x79f3c65a, 0xf4814a24, 0x9bcdefbf, 0x6b1f71c8,
+ 0x0453d453, 0x8bba4c27, 0xe4f6e9bc, 0x142477cb, 0x7b68d250,
+ 0x0af74622, 0x65bbe3b9, 0x95697dce, 0xfa25d855, 0x75cc4021,
+ 0x1a80e5ba, 0xea527bcd, 0x851ede56, 0xe06fc760, 0x8f2362fb,
+ 0x7ff1fc8c, 0x10bd5917, 0x9f54c163, 0xf01864f8, 0x00cafa8f,
+ 0x6f865f14, 0x1e19cb66, 0x71556efd, 0x8187f08a, 0xeecb5511,
+ 0x6122cd65, 0x0e6e68fe, 0xfebcf689, 0x91f05312, 0x1c82df6c,
+ 0x73ce7af7, 0x831ce480, 0xec50411b, 0x63b9d96f, 0x0cf57cf4,
+ 0xfc27e283, 0x936b4718, 0xe2f4d36a, 0x8db876f1, 0x7d6ae886,
+ 0x12264d1d, 0x9dcfd569, 0xf28370f2, 0x0251ee85, 0x6d1d4b1e,
+ 0x18b4f678, 0x77f853e3, 0x872acd94, 0xe866680f, 0x678ff07b,
+ 0x08c355e0, 0xf811cb97, 0x975d6e0c, 0xe6c2fa7e, 0x898e5fe5,
+ 0x795cc192, 0x16106409, 0x99f9fc7d, 0xf6b559e6, 0x0667c791,
+ 0x692b620a, 0xe459ee74, 0x8b154bef, 0x7bc7d598, 0x148b7003,
+ 0x9b62e877, 0xf42e4dec, 0x04fcd39b, 0x6bb07600, 0x1a2fe272,
+ 0x756347e9, 0x85b1d99e, 0xeafd7c05, 0x6514e471, 0x0a5841ea,
+ 0xfa8adf9d, 0x95c67a06, 0x10d8a450, 0x7f9401cb, 0x8f469fbc,
+ 0xe00a3a27, 0x6fe3a253, 0x00af07c8, 0xf07d99bf, 0x9f313c24,
+ 0xeeaea856, 0x81e20dcd, 0x713093ba, 0x1e7c3621, 0x9195ae55,
+ 0xfed90bce, 0x0e0b95b9, 0x61473022, 0xec35bc5c, 0x837919c7,
+ 0x73ab87b0, 0x1ce7222b, 0x930eba5f, 0xfc421fc4, 0x0c9081b3,
+ 0x63dc2428, 0x1243b05a, 0x7d0f15c1, 0x8ddd8bb6, 0xe2912e2d,
+ 0x6d78b659, 0x023413c2, 0xf2e68db5, 0x9daa282e, 0xe8039548,
+ 0x874f30d3, 0x779daea4, 0x18d10b3f, 0x9738934b, 0xf87436d0,
+ 0x08a6a8a7, 0x67ea0d3c, 0x1675994e, 0x79393cd5, 0x89eba2a2,
+ 0xe6a70739, 0x694e9f4d, 0x06023ad6, 0xf6d0a4a1, 0x999c013a,
+ 0x14ee8d44, 0x7ba228df, 0x8b70b6a8, 0xe43c1333, 0x6bd58b47,
+ 0x04992edc, 0xf44bb0ab, 0x9b071530, 0xea988142, 0x85d424d9,
+ 0x7506baae, 0x1a4a1f35, 0x95a38741, 0xfaef22da, 0x0a3dbcad,
+ 0x65711936}};
+
+#endif
+
+#endif
+
+#if N == 4
+
+#if W == 8
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0xf1da05aa, 0x38c50d15, 0xc91f08bf, 0x718a1a2a,
+ 0x80501f80, 0x494f173f, 0xb8951295, 0xe3143454, 0x12ce31fe,
+ 0xdbd13941, 0x2a0b3ceb, 0x929e2e7e, 0x63442bd4, 0xaa5b236b,
+ 0x5b8126c1, 0x1d596ee9, 0xec836b43, 0x259c63fc, 0xd4466656,
+ 0x6cd374c3, 0x9d097169, 0x541679d6, 0xa5cc7c7c, 0xfe4d5abd,
+ 0x0f975f17, 0xc68857a8, 0x37525202, 0x8fc74097, 0x7e1d453d,
+ 0xb7024d82, 0x46d84828, 0x3ab2ddd2, 0xcb68d878, 0x0277d0c7,
+ 0xf3add56d, 0x4b38c7f8, 0xbae2c252, 0x73fdcaed, 0x8227cf47,
+ 0xd9a6e986, 0x287cec2c, 0xe163e493, 0x10b9e139, 0xa82cf3ac,
+ 0x59f6f606, 0x90e9feb9, 0x6133fb13, 0x27ebb33b, 0xd631b691,
+ 0x1f2ebe2e, 0xeef4bb84, 0x5661a911, 0xa7bbacbb, 0x6ea4a404,
+ 0x9f7ea1ae, 0xc4ff876f, 0x352582c5, 0xfc3a8a7a, 0x0de08fd0,
+ 0xb5759d45, 0x44af98ef, 0x8db09050, 0x7c6a95fa, 0x7565bba4,
+ 0x84bfbe0e, 0x4da0b6b1, 0xbc7ab31b, 0x04efa18e, 0xf535a424,
+ 0x3c2aac9b, 0xcdf0a931, 0x96718ff0, 0x67ab8a5a, 0xaeb482e5,
+ 0x5f6e874f, 0xe7fb95da, 0x16219070, 0xdf3e98cf, 0x2ee49d65,
+ 0x683cd54d, 0x99e6d0e7, 0x50f9d858, 0xa123ddf2, 0x19b6cf67,
+ 0xe86ccacd, 0x2173c272, 0xd0a9c7d8, 0x8b28e119, 0x7af2e4b3,
+ 0xb3edec0c, 0x4237e9a6, 0xfaa2fb33, 0x0b78fe99, 0xc267f626,
+ 0x33bdf38c, 0x4fd76676, 0xbe0d63dc, 0x77126b63, 0x86c86ec9,
+ 0x3e5d7c5c, 0xcf8779f6, 0x06987149, 0xf74274e3, 0xacc35222,
+ 0x5d195788, 0x94065f37, 0x65dc5a9d, 0xdd494808, 0x2c934da2,
+ 0xe58c451d, 0x145640b7, 0x528e089f, 0xa3540d35, 0x6a4b058a,
+ 0x9b910020, 0x230412b5, 0xd2de171f, 0x1bc11fa0, 0xea1b1a0a,
+ 0xb19a3ccb, 0x40403961, 0x895f31de, 0x78853474, 0xc01026e1,
+ 0x31ca234b, 0xf8d52bf4, 0x090f2e5e, 0xeacb7748, 0x1b1172e2,
+ 0xd20e7a5d, 0x23d47ff7, 0x9b416d62, 0x6a9b68c8, 0xa3846077,
+ 0x525e65dd, 0x09df431c, 0xf80546b6, 0x311a4e09, 0xc0c04ba3,
+ 0x78555936, 0x898f5c9c, 0x40905423, 0xb14a5189, 0xf79219a1,
+ 0x06481c0b, 0xcf5714b4, 0x3e8d111e, 0x8618038b, 0x77c20621,
+ 0xbedd0e9e, 0x4f070b34, 0x14862df5, 0xe55c285f, 0x2c4320e0,
+ 0xdd99254a, 0x650c37df, 0x94d63275, 0x5dc93aca, 0xac133f60,
+ 0xd079aa9a, 0x21a3af30, 0xe8bca78f, 0x1966a225, 0xa1f3b0b0,
+ 0x5029b51a, 0x9936bda5, 0x68ecb80f, 0x336d9ece, 0xc2b79b64,
+ 0x0ba893db, 0xfa729671, 0x42e784e4, 0xb33d814e, 0x7a2289f1,
+ 0x8bf88c5b, 0xcd20c473, 0x3cfac1d9, 0xf5e5c966, 0x043fcccc,
+ 0xbcaade59, 0x4d70dbf3, 0x846fd34c, 0x75b5d6e6, 0x2e34f027,
+ 0xdfeef58d, 0x16f1fd32, 0xe72bf898, 0x5fbeea0d, 0xae64efa7,
+ 0x677be718, 0x96a1e2b2, 0x9faeccec, 0x6e74c946, 0xa76bc1f9,
+ 0x56b1c453, 0xee24d6c6, 0x1ffed36c, 0xd6e1dbd3, 0x273bde79,
+ 0x7cbaf8b8, 0x8d60fd12, 0x447ff5ad, 0xb5a5f007, 0x0d30e292,
+ 0xfceae738, 0x35f5ef87, 0xc42fea2d, 0x82f7a205, 0x732da7af,
+ 0xba32af10, 0x4be8aaba, 0xf37db82f, 0x02a7bd85, 0xcbb8b53a,
+ 0x3a62b090, 0x61e39651, 0x903993fb, 0x59269b44, 0xa8fc9eee,
+ 0x10698c7b, 0xe1b389d1, 0x28ac816e, 0xd97684c4, 0xa51c113e,
+ 0x54c61494, 0x9dd91c2b, 0x6c031981, 0xd4960b14, 0x254c0ebe,
+ 0xec530601, 0x1d8903ab, 0x4608256a, 0xb7d220c0, 0x7ecd287f,
+ 0x8f172dd5, 0x37823f40, 0xc6583aea, 0x0f473255, 0xfe9d37ff,
+ 0xb8457fd7, 0x499f7a7d, 0x808072c2, 0x715a7768, 0xc9cf65fd,
+ 0x38156057, 0xf10a68e8, 0x00d06d42, 0x5b514b83, 0xaa8b4e29,
+ 0x63944696, 0x924e433c, 0x2adb51a9, 0xdb015403, 0x121e5cbc,
+ 0xe3c45916},
+ {0x00000000, 0x0ee7e8d1, 0x1dcfd1a2, 0x13283973, 0x3b9fa344,
+ 0x35784b95, 0x265072e6, 0x28b79a37, 0x773f4688, 0x79d8ae59,
+ 0x6af0972a, 0x64177ffb, 0x4ca0e5cc, 0x42470d1d, 0x516f346e,
+ 0x5f88dcbf, 0xee7e8d10, 0xe09965c1, 0xf3b15cb2, 0xfd56b463,
+ 0xd5e12e54, 0xdb06c685, 0xc82efff6, 0xc6c91727, 0x9941cb98,
+ 0x97a62349, 0x848e1a3a, 0x8a69f2eb, 0xa2de68dc, 0xac39800d,
+ 0xbf11b97e, 0xb1f651af, 0x078c1c61, 0x096bf4b0, 0x1a43cdc3,
+ 0x14a42512, 0x3c13bf25, 0x32f457f4, 0x21dc6e87, 0x2f3b8656,
+ 0x70b35ae9, 0x7e54b238, 0x6d7c8b4b, 0x639b639a, 0x4b2cf9ad,
+ 0x45cb117c, 0x56e3280f, 0x5804c0de, 0xe9f29171, 0xe71579a0,
+ 0xf43d40d3, 0xfadaa802, 0xd26d3235, 0xdc8adae4, 0xcfa2e397,
+ 0xc1450b46, 0x9ecdd7f9, 0x902a3f28, 0x8302065b, 0x8de5ee8a,
+ 0xa55274bd, 0xabb59c6c, 0xb89da51f, 0xb67a4dce, 0x0f1838c2,
+ 0x01ffd013, 0x12d7e960, 0x1c3001b1, 0x34879b86, 0x3a607357,
+ 0x29484a24, 0x27afa2f5, 0x78277e4a, 0x76c0969b, 0x65e8afe8,
+ 0x6b0f4739, 0x43b8dd0e, 0x4d5f35df, 0x5e770cac, 0x5090e47d,
+ 0xe166b5d2, 0xef815d03, 0xfca96470, 0xf24e8ca1, 0xdaf91696,
+ 0xd41efe47, 0xc736c734, 0xc9d12fe5, 0x9659f35a, 0x98be1b8b,
+ 0x8b9622f8, 0x8571ca29, 0xadc6501e, 0xa321b8cf, 0xb00981bc,
+ 0xbeee696d, 0x089424a3, 0x0673cc72, 0x155bf501, 0x1bbc1dd0,
+ 0x330b87e7, 0x3dec6f36, 0x2ec45645, 0x2023be94, 0x7fab622b,
+ 0x714c8afa, 0x6264b389, 0x6c835b58, 0x4434c16f, 0x4ad329be,
+ 0x59fb10cd, 0x571cf81c, 0xe6eaa9b3, 0xe80d4162, 0xfb257811,
+ 0xf5c290c0, 0xdd750af7, 0xd392e226, 0xc0badb55, 0xce5d3384,
+ 0x91d5ef3b, 0x9f3207ea, 0x8c1a3e99, 0x82fdd648, 0xaa4a4c7f,
+ 0xa4ada4ae, 0xb7859ddd, 0xb962750c, 0x1e307184, 0x10d79955,
+ 0x03ffa026, 0x0d1848f7, 0x25afd2c0, 0x2b483a11, 0x38600362,
+ 0x3687ebb3, 0x690f370c, 0x67e8dfdd, 0x74c0e6ae, 0x7a270e7f,
+ 0x52909448, 0x5c777c99, 0x4f5f45ea, 0x41b8ad3b, 0xf04efc94,
+ 0xfea91445, 0xed812d36, 0xe366c5e7, 0xcbd15fd0, 0xc536b701,
+ 0xd61e8e72, 0xd8f966a3, 0x8771ba1c, 0x899652cd, 0x9abe6bbe,
+ 0x9459836f, 0xbcee1958, 0xb209f189, 0xa121c8fa, 0xafc6202b,
+ 0x19bc6de5, 0x175b8534, 0x0473bc47, 0x0a945496, 0x2223cea1,
+ 0x2cc42670, 0x3fec1f03, 0x310bf7d2, 0x6e832b6d, 0x6064c3bc,
+ 0x734cfacf, 0x7dab121e, 0x551c8829, 0x5bfb60f8, 0x48d3598b,
+ 0x4634b15a, 0xf7c2e0f5, 0xf9250824, 0xea0d3157, 0xe4ead986,
+ 0xcc5d43b1, 0xc2baab60, 0xd1929213, 0xdf757ac2, 0x80fda67d,
+ 0x8e1a4eac, 0x9d3277df, 0x93d59f0e, 0xbb620539, 0xb585ede8,
+ 0xa6add49b, 0xa84a3c4a, 0x11284946, 0x1fcfa197, 0x0ce798e4,
+ 0x02007035, 0x2ab7ea02, 0x245002d3, 0x37783ba0, 0x399fd371,
+ 0x66170fce, 0x68f0e71f, 0x7bd8de6c, 0x753f36bd, 0x5d88ac8a,
+ 0x536f445b, 0x40477d28, 0x4ea095f9, 0xff56c456, 0xf1b12c87,
+ 0xe29915f4, 0xec7efd25, 0xc4c96712, 0xca2e8fc3, 0xd906b6b0,
+ 0xd7e15e61, 0x886982de, 0x868e6a0f, 0x95a6537c, 0x9b41bbad,
+ 0xb3f6219a, 0xbd11c94b, 0xae39f038, 0xa0de18e9, 0x16a45527,
+ 0x1843bdf6, 0x0b6b8485, 0x058c6c54, 0x2d3bf663, 0x23dc1eb2,
+ 0x30f427c1, 0x3e13cf10, 0x619b13af, 0x6f7cfb7e, 0x7c54c20d,
+ 0x72b32adc, 0x5a04b0eb, 0x54e3583a, 0x47cb6149, 0x492c8998,
+ 0xf8dad837, 0xf63d30e6, 0xe5150995, 0xebf2e144, 0xc3457b73,
+ 0xcda293a2, 0xde8aaad1, 0xd06d4200, 0x8fe59ebf, 0x8102766e,
+ 0x922a4f1d, 0x9ccda7cc, 0xb47a3dfb, 0xba9dd52a, 0xa9b5ec59,
+ 0xa7520488},
+ {0x00000000, 0x3c60e308, 0x78c1c610, 0x44a12518, 0xf1838c20,
+ 0xcde36f28, 0x89424a30, 0xb522a938, 0x38761e01, 0x0416fd09,
+ 0x40b7d811, 0x7cd73b19, 0xc9f59221, 0xf5957129, 0xb1345431,
+ 0x8d54b739, 0x70ec3c02, 0x4c8cdf0a, 0x082dfa12, 0x344d191a,
+ 0x816fb022, 0xbd0f532a, 0xf9ae7632, 0xc5ce953a, 0x489a2203,
+ 0x74fac10b, 0x305be413, 0x0c3b071b, 0xb919ae23, 0x85794d2b,
+ 0xc1d86833, 0xfdb88b3b, 0xe1d87804, 0xddb89b0c, 0x9919be14,
+ 0xa5795d1c, 0x105bf424, 0x2c3b172c, 0x689a3234, 0x54fad13c,
+ 0xd9ae6605, 0xe5ce850d, 0xa16fa015, 0x9d0f431d, 0x282dea25,
+ 0x144d092d, 0x50ec2c35, 0x6c8ccf3d, 0x91344406, 0xad54a70e,
+ 0xe9f58216, 0xd595611e, 0x60b7c826, 0x5cd72b2e, 0x18760e36,
+ 0x2416ed3e, 0xa9425a07, 0x9522b90f, 0xd1839c17, 0xede37f1f,
+ 0x58c1d627, 0x64a1352f, 0x20001037, 0x1c60f33f, 0x18c1f649,
+ 0x24a11541, 0x60003059, 0x5c60d351, 0xe9427a69, 0xd5229961,
+ 0x9183bc79, 0xade35f71, 0x20b7e848, 0x1cd70b40, 0x58762e58,
+ 0x6416cd50, 0xd1346468, 0xed548760, 0xa9f5a278, 0x95954170,
+ 0x682dca4b, 0x544d2943, 0x10ec0c5b, 0x2c8cef53, 0x99ae466b,
+ 0xa5cea563, 0xe16f807b, 0xdd0f6373, 0x505bd44a, 0x6c3b3742,
+ 0x289a125a, 0x14faf152, 0xa1d8586a, 0x9db8bb62, 0xd9199e7a,
+ 0xe5797d72, 0xf9198e4d, 0xc5796d45, 0x81d8485d, 0xbdb8ab55,
+ 0x089a026d, 0x34fae165, 0x705bc47d, 0x4c3b2775, 0xc16f904c,
+ 0xfd0f7344, 0xb9ae565c, 0x85ceb554, 0x30ec1c6c, 0x0c8cff64,
+ 0x482dda7c, 0x744d3974, 0x89f5b24f, 0xb5955147, 0xf134745f,
+ 0xcd549757, 0x78763e6f, 0x4416dd67, 0x00b7f87f, 0x3cd71b77,
+ 0xb183ac4e, 0x8de34f46, 0xc9426a5e, 0xf5228956, 0x4000206e,
+ 0x7c60c366, 0x38c1e67e, 0x04a10576, 0x3183ec92, 0x0de30f9a,
+ 0x49422a82, 0x7522c98a, 0xc00060b2, 0xfc6083ba, 0xb8c1a6a2,
+ 0x84a145aa, 0x09f5f293, 0x3595119b, 0x71343483, 0x4d54d78b,
+ 0xf8767eb3, 0xc4169dbb, 0x80b7b8a3, 0xbcd75bab, 0x416fd090,
+ 0x7d0f3398, 0x39ae1680, 0x05cef588, 0xb0ec5cb0, 0x8c8cbfb8,
+ 0xc82d9aa0, 0xf44d79a8, 0x7919ce91, 0x45792d99, 0x01d80881,
+ 0x3db8eb89, 0x889a42b1, 0xb4faa1b9, 0xf05b84a1, 0xcc3b67a9,
+ 0xd05b9496, 0xec3b779e, 0xa89a5286, 0x94fab18e, 0x21d818b6,
+ 0x1db8fbbe, 0x5919dea6, 0x65793dae, 0xe82d8a97, 0xd44d699f,
+ 0x90ec4c87, 0xac8caf8f, 0x19ae06b7, 0x25cee5bf, 0x616fc0a7,
+ 0x5d0f23af, 0xa0b7a894, 0x9cd74b9c, 0xd8766e84, 0xe4168d8c,
+ 0x513424b4, 0x6d54c7bc, 0x29f5e2a4, 0x159501ac, 0x98c1b695,
+ 0xa4a1559d, 0xe0007085, 0xdc60938d, 0x69423ab5, 0x5522d9bd,
+ 0x1183fca5, 0x2de31fad, 0x29421adb, 0x1522f9d3, 0x5183dccb,
+ 0x6de33fc3, 0xd8c196fb, 0xe4a175f3, 0xa00050eb, 0x9c60b3e3,
+ 0x113404da, 0x2d54e7d2, 0x69f5c2ca, 0x559521c2, 0xe0b788fa,
+ 0xdcd76bf2, 0x98764eea, 0xa416ade2, 0x59ae26d9, 0x65cec5d1,
+ 0x216fe0c9, 0x1d0f03c1, 0xa82daaf9, 0x944d49f1, 0xd0ec6ce9,
+ 0xec8c8fe1, 0x61d838d8, 0x5db8dbd0, 0x1919fec8, 0x25791dc0,
+ 0x905bb4f8, 0xac3b57f0, 0xe89a72e8, 0xd4fa91e0, 0xc89a62df,
+ 0xf4fa81d7, 0xb05ba4cf, 0x8c3b47c7, 0x3919eeff, 0x05790df7,
+ 0x41d828ef, 0x7db8cbe7, 0xf0ec7cde, 0xcc8c9fd6, 0x882dbace,
+ 0xb44d59c6, 0x016ff0fe, 0x3d0f13f6, 0x79ae36ee, 0x45ced5e6,
+ 0xb8765edd, 0x8416bdd5, 0xc0b798cd, 0xfcd77bc5, 0x49f5d2fd,
+ 0x759531f5, 0x313414ed, 0x0d54f7e5, 0x800040dc, 0xbc60a3d4,
+ 0xf8c186cc, 0xc4a165c4, 0x7183ccfc, 0x4de32ff4, 0x09420aec,
+ 0x3522e9e4},
+ {0x00000000, 0x6307d924, 0xc60fb248, 0xa5086b6c, 0x576e62d1,
+ 0x3469bbf5, 0x9161d099, 0xf26609bd, 0xaedcc5a2, 0xcddb1c86,
+ 0x68d377ea, 0x0bd4aece, 0xf9b2a773, 0x9ab57e57, 0x3fbd153b,
+ 0x5cbacc1f, 0x86c88d05, 0xe5cf5421, 0x40c73f4d, 0x23c0e669,
+ 0xd1a6efd4, 0xb2a136f0, 0x17a95d9c, 0x74ae84b8, 0x281448a7,
+ 0x4b139183, 0xee1bfaef, 0x8d1c23cb, 0x7f7a2a76, 0x1c7df352,
+ 0xb975983e, 0xda72411a, 0xd6e01c4b, 0xb5e7c56f, 0x10efae03,
+ 0x73e87727, 0x818e7e9a, 0xe289a7be, 0x4781ccd2, 0x248615f6,
+ 0x783cd9e9, 0x1b3b00cd, 0xbe336ba1, 0xdd34b285, 0x2f52bb38,
+ 0x4c55621c, 0xe95d0970, 0x8a5ad054, 0x5028914e, 0x332f486a,
+ 0x96272306, 0xf520fa22, 0x0746f39f, 0x64412abb, 0xc14941d7,
+ 0xa24e98f3, 0xfef454ec, 0x9df38dc8, 0x38fbe6a4, 0x5bfc3f80,
+ 0xa99a363d, 0xca9def19, 0x6f958475, 0x0c925d51, 0x76b13ed7,
+ 0x15b6e7f3, 0xb0be8c9f, 0xd3b955bb, 0x21df5c06, 0x42d88522,
+ 0xe7d0ee4e, 0x84d7376a, 0xd86dfb75, 0xbb6a2251, 0x1e62493d,
+ 0x7d659019, 0x8f0399a4, 0xec044080, 0x490c2bec, 0x2a0bf2c8,
+ 0xf079b3d2, 0x937e6af6, 0x3676019a, 0x5571d8be, 0xa717d103,
+ 0xc4100827, 0x6118634b, 0x021fba6f, 0x5ea57670, 0x3da2af54,
+ 0x98aac438, 0xfbad1d1c, 0x09cb14a1, 0x6acccd85, 0xcfc4a6e9,
+ 0xacc37fcd, 0xa051229c, 0xc356fbb8, 0x665e90d4, 0x055949f0,
+ 0xf73f404d, 0x94389969, 0x3130f205, 0x52372b21, 0x0e8de73e,
+ 0x6d8a3e1a, 0xc8825576, 0xab858c52, 0x59e385ef, 0x3ae45ccb,
+ 0x9fec37a7, 0xfcebee83, 0x2699af99, 0x459e76bd, 0xe0961dd1,
+ 0x8391c4f5, 0x71f7cd48, 0x12f0146c, 0xb7f87f00, 0xd4ffa624,
+ 0x88456a3b, 0xeb42b31f, 0x4e4ad873, 0x2d4d0157, 0xdf2b08ea,
+ 0xbc2cd1ce, 0x1924baa2, 0x7a236386, 0xed627dae, 0x8e65a48a,
+ 0x2b6dcfe6, 0x486a16c2, 0xba0c1f7f, 0xd90bc65b, 0x7c03ad37,
+ 0x1f047413, 0x43beb80c, 0x20b96128, 0x85b10a44, 0xe6b6d360,
+ 0x14d0dadd, 0x77d703f9, 0xd2df6895, 0xb1d8b1b1, 0x6baaf0ab,
+ 0x08ad298f, 0xada542e3, 0xcea29bc7, 0x3cc4927a, 0x5fc34b5e,
+ 0xfacb2032, 0x99ccf916, 0xc5763509, 0xa671ec2d, 0x03798741,
+ 0x607e5e65, 0x921857d8, 0xf11f8efc, 0x5417e590, 0x37103cb4,
+ 0x3b8261e5, 0x5885b8c1, 0xfd8dd3ad, 0x9e8a0a89, 0x6cec0334,
+ 0x0febda10, 0xaae3b17c, 0xc9e46858, 0x955ea447, 0xf6597d63,
+ 0x5351160f, 0x3056cf2b, 0xc230c696, 0xa1371fb2, 0x043f74de,
+ 0x6738adfa, 0xbd4aece0, 0xde4d35c4, 0x7b455ea8, 0x1842878c,
+ 0xea248e31, 0x89235715, 0x2c2b3c79, 0x4f2ce55d, 0x13962942,
+ 0x7091f066, 0xd5999b0a, 0xb69e422e, 0x44f84b93, 0x27ff92b7,
+ 0x82f7f9db, 0xe1f020ff, 0x9bd34379, 0xf8d49a5d, 0x5ddcf131,
+ 0x3edb2815, 0xccbd21a8, 0xafbaf88c, 0x0ab293e0, 0x69b54ac4,
+ 0x350f86db, 0x56085fff, 0xf3003493, 0x9007edb7, 0x6261e40a,
+ 0x01663d2e, 0xa46e5642, 0xc7698f66, 0x1d1bce7c, 0x7e1c1758,
+ 0xdb147c34, 0xb813a510, 0x4a75acad, 0x29727589, 0x8c7a1ee5,
+ 0xef7dc7c1, 0xb3c70bde, 0xd0c0d2fa, 0x75c8b996, 0x16cf60b2,
+ 0xe4a9690f, 0x87aeb02b, 0x22a6db47, 0x41a10263, 0x4d335f32,
+ 0x2e348616, 0x8b3ced7a, 0xe83b345e, 0x1a5d3de3, 0x795ae4c7,
+ 0xdc528fab, 0xbf55568f, 0xe3ef9a90, 0x80e843b4, 0x25e028d8,
+ 0x46e7f1fc, 0xb481f841, 0xd7862165, 0x728e4a09, 0x1189932d,
+ 0xcbfbd237, 0xa8fc0b13, 0x0df4607f, 0x6ef3b95b, 0x9c95b0e6,
+ 0xff9269c2, 0x5a9a02ae, 0x399ddb8a, 0x65271795, 0x0620ceb1,
+ 0xa328a5dd, 0xc02f7cf9, 0x32497544, 0x514eac60, 0xf446c70c,
+ 0x97411e28},
+ {0x00000000, 0x01b5fd1d, 0x036bfa3a, 0x02de0727, 0x06d7f474,
+ 0x07620969, 0x05bc0e4e, 0x0409f353, 0x0dafe8e8, 0x0c1a15f5,
+ 0x0ec412d2, 0x0f71efcf, 0x0b781c9c, 0x0acde181, 0x0813e6a6,
+ 0x09a61bbb, 0x1b5fd1d0, 0x1aea2ccd, 0x18342bea, 0x1981d6f7,
+ 0x1d8825a4, 0x1c3dd8b9, 0x1ee3df9e, 0x1f562283, 0x16f03938,
+ 0x1745c425, 0x159bc302, 0x142e3e1f, 0x1027cd4c, 0x11923051,
+ 0x134c3776, 0x12f9ca6b, 0x36bfa3a0, 0x370a5ebd, 0x35d4599a,
+ 0x3461a487, 0x306857d4, 0x31ddaac9, 0x3303adee, 0x32b650f3,
+ 0x3b104b48, 0x3aa5b655, 0x387bb172, 0x39ce4c6f, 0x3dc7bf3c,
+ 0x3c724221, 0x3eac4506, 0x3f19b81b, 0x2de07270, 0x2c558f6d,
+ 0x2e8b884a, 0x2f3e7557, 0x2b378604, 0x2a827b19, 0x285c7c3e,
+ 0x29e98123, 0x204f9a98, 0x21fa6785, 0x232460a2, 0x22919dbf,
+ 0x26986eec, 0x272d93f1, 0x25f394d6, 0x244669cb, 0x6d7f4740,
+ 0x6ccaba5d, 0x6e14bd7a, 0x6fa14067, 0x6ba8b334, 0x6a1d4e29,
+ 0x68c3490e, 0x6976b413, 0x60d0afa8, 0x616552b5, 0x63bb5592,
+ 0x620ea88f, 0x66075bdc, 0x67b2a6c1, 0x656ca1e6, 0x64d95cfb,
+ 0x76209690, 0x77956b8d, 0x754b6caa, 0x74fe91b7, 0x70f762e4,
+ 0x71429ff9, 0x739c98de, 0x722965c3, 0x7b8f7e78, 0x7a3a8365,
+ 0x78e48442, 0x7951795f, 0x7d588a0c, 0x7ced7711, 0x7e337036,
+ 0x7f868d2b, 0x5bc0e4e0, 0x5a7519fd, 0x58ab1eda, 0x591ee3c7,
+ 0x5d171094, 0x5ca2ed89, 0x5e7ceaae, 0x5fc917b3, 0x566f0c08,
+ 0x57daf115, 0x5504f632, 0x54b10b2f, 0x50b8f87c, 0x510d0561,
+ 0x53d30246, 0x5266ff5b, 0x409f3530, 0x412ac82d, 0x43f4cf0a,
+ 0x42413217, 0x4648c144, 0x47fd3c59, 0x45233b7e, 0x4496c663,
+ 0x4d30ddd8, 0x4c8520c5, 0x4e5b27e2, 0x4feedaff, 0x4be729ac,
+ 0x4a52d4b1, 0x488cd396, 0x49392e8b, 0xdafe8e80, 0xdb4b739d,
+ 0xd99574ba, 0xd82089a7, 0xdc297af4, 0xdd9c87e9, 0xdf4280ce,
+ 0xdef77dd3, 0xd7516668, 0xd6e49b75, 0xd43a9c52, 0xd58f614f,
+ 0xd186921c, 0xd0336f01, 0xd2ed6826, 0xd358953b, 0xc1a15f50,
+ 0xc014a24d, 0xc2caa56a, 0xc37f5877, 0xc776ab24, 0xc6c35639,
+ 0xc41d511e, 0xc5a8ac03, 0xcc0eb7b8, 0xcdbb4aa5, 0xcf654d82,
+ 0xced0b09f, 0xcad943cc, 0xcb6cbed1, 0xc9b2b9f6, 0xc80744eb,
+ 0xec412d20, 0xedf4d03d, 0xef2ad71a, 0xee9f2a07, 0xea96d954,
+ 0xeb232449, 0xe9fd236e, 0xe848de73, 0xe1eec5c8, 0xe05b38d5,
+ 0xe2853ff2, 0xe330c2ef, 0xe73931bc, 0xe68ccca1, 0xe452cb86,
+ 0xe5e7369b, 0xf71efcf0, 0xf6ab01ed, 0xf47506ca, 0xf5c0fbd7,
+ 0xf1c90884, 0xf07cf599, 0xf2a2f2be, 0xf3170fa3, 0xfab11418,
+ 0xfb04e905, 0xf9daee22, 0xf86f133f, 0xfc66e06c, 0xfdd31d71,
+ 0xff0d1a56, 0xfeb8e74b, 0xb781c9c0, 0xb63434dd, 0xb4ea33fa,
+ 0xb55fcee7, 0xb1563db4, 0xb0e3c0a9, 0xb23dc78e, 0xb3883a93,
+ 0xba2e2128, 0xbb9bdc35, 0xb945db12, 0xb8f0260f, 0xbcf9d55c,
+ 0xbd4c2841, 0xbf922f66, 0xbe27d27b, 0xacde1810, 0xad6be50d,
+ 0xafb5e22a, 0xae001f37, 0xaa09ec64, 0xabbc1179, 0xa962165e,
+ 0xa8d7eb43, 0xa171f0f8, 0xa0c40de5, 0xa21a0ac2, 0xa3aff7df,
+ 0xa7a6048c, 0xa613f991, 0xa4cdfeb6, 0xa57803ab, 0x813e6a60,
+ 0x808b977d, 0x8255905a, 0x83e06d47, 0x87e99e14, 0x865c6309,
+ 0x8482642e, 0x85379933, 0x8c918288, 0x8d247f95, 0x8ffa78b2,
+ 0x8e4f85af, 0x8a4676fc, 0x8bf38be1, 0x892d8cc6, 0x889871db,
+ 0x9a61bbb0, 0x9bd446ad, 0x990a418a, 0x98bfbc97, 0x9cb64fc4,
+ 0x9d03b2d9, 0x9fddb5fe, 0x9e6848e3, 0x97ce5358, 0x967bae45,
+ 0x94a5a962, 0x9510547f, 0x9119a72c, 0x90ac5a31, 0x92725d16,
+ 0x93c7a00b},
+ {0x00000000, 0x6e8c1b41, 0xdd183682, 0xb3942dc3, 0x61416b45,
+ 0x0fcd7004, 0xbc595dc7, 0xd2d54686, 0xc282d68a, 0xac0ecdcb,
+ 0x1f9ae008, 0x7116fb49, 0xa3c3bdcf, 0xcd4fa68e, 0x7edb8b4d,
+ 0x1057900c, 0x5e74ab55, 0x30f8b014, 0x836c9dd7, 0xede08696,
+ 0x3f35c010, 0x51b9db51, 0xe22df692, 0x8ca1edd3, 0x9cf67ddf,
+ 0xf27a669e, 0x41ee4b5d, 0x2f62501c, 0xfdb7169a, 0x933b0ddb,
+ 0x20af2018, 0x4e233b59, 0xbce956aa, 0xd2654deb, 0x61f16028,
+ 0x0f7d7b69, 0xdda83def, 0xb32426ae, 0x00b00b6d, 0x6e3c102c,
+ 0x7e6b8020, 0x10e79b61, 0xa373b6a2, 0xcdffade3, 0x1f2aeb65,
+ 0x71a6f024, 0xc232dde7, 0xacbec6a6, 0xe29dfdff, 0x8c11e6be,
+ 0x3f85cb7d, 0x5109d03c, 0x83dc96ba, 0xed508dfb, 0x5ec4a038,
+ 0x3048bb79, 0x201f2b75, 0x4e933034, 0xfd071df7, 0x938b06b6,
+ 0x415e4030, 0x2fd25b71, 0x9c4676b2, 0xf2ca6df3, 0xa2a3ab15,
+ 0xcc2fb054, 0x7fbb9d97, 0x113786d6, 0xc3e2c050, 0xad6edb11,
+ 0x1efaf6d2, 0x7076ed93, 0x60217d9f, 0x0ead66de, 0xbd394b1d,
+ 0xd3b5505c, 0x016016da, 0x6fec0d9b, 0xdc782058, 0xb2f43b19,
+ 0xfcd70040, 0x925b1b01, 0x21cf36c2, 0x4f432d83, 0x9d966b05,
+ 0xf31a7044, 0x408e5d87, 0x2e0246c6, 0x3e55d6ca, 0x50d9cd8b,
+ 0xe34de048, 0x8dc1fb09, 0x5f14bd8f, 0x3198a6ce, 0x820c8b0d,
+ 0xec80904c, 0x1e4afdbf, 0x70c6e6fe, 0xc352cb3d, 0xadded07c,
+ 0x7f0b96fa, 0x11878dbb, 0xa213a078, 0xcc9fbb39, 0xdcc82b35,
+ 0xb2443074, 0x01d01db7, 0x6f5c06f6, 0xbd894070, 0xd3055b31,
+ 0x609176f2, 0x0e1d6db3, 0x403e56ea, 0x2eb24dab, 0x9d266068,
+ 0xf3aa7b29, 0x217f3daf, 0x4ff326ee, 0xfc670b2d, 0x92eb106c,
+ 0x82bc8060, 0xec309b21, 0x5fa4b6e2, 0x3128ada3, 0xe3fdeb25,
+ 0x8d71f064, 0x3ee5dda7, 0x5069c6e6, 0x9e36506b, 0xf0ba4b2a,
+ 0x432e66e9, 0x2da27da8, 0xff773b2e, 0x91fb206f, 0x226f0dac,
+ 0x4ce316ed, 0x5cb486e1, 0x32389da0, 0x81acb063, 0xef20ab22,
+ 0x3df5eda4, 0x5379f6e5, 0xe0eddb26, 0x8e61c067, 0xc042fb3e,
+ 0xaecee07f, 0x1d5acdbc, 0x73d6d6fd, 0xa103907b, 0xcf8f8b3a,
+ 0x7c1ba6f9, 0x1297bdb8, 0x02c02db4, 0x6c4c36f5, 0xdfd81b36,
+ 0xb1540077, 0x638146f1, 0x0d0d5db0, 0xbe997073, 0xd0156b32,
+ 0x22df06c1, 0x4c531d80, 0xffc73043, 0x914b2b02, 0x439e6d84,
+ 0x2d1276c5, 0x9e865b06, 0xf00a4047, 0xe05dd04b, 0x8ed1cb0a,
+ 0x3d45e6c9, 0x53c9fd88, 0x811cbb0e, 0xef90a04f, 0x5c048d8c,
+ 0x328896cd, 0x7cabad94, 0x1227b6d5, 0xa1b39b16, 0xcf3f8057,
+ 0x1deac6d1, 0x7366dd90, 0xc0f2f053, 0xae7eeb12, 0xbe297b1e,
+ 0xd0a5605f, 0x63314d9c, 0x0dbd56dd, 0xdf68105b, 0xb1e40b1a,
+ 0x027026d9, 0x6cfc3d98, 0x3c95fb7e, 0x5219e03f, 0xe18dcdfc,
+ 0x8f01d6bd, 0x5dd4903b, 0x33588b7a, 0x80cca6b9, 0xee40bdf8,
+ 0xfe172df4, 0x909b36b5, 0x230f1b76, 0x4d830037, 0x9f5646b1,
+ 0xf1da5df0, 0x424e7033, 0x2cc26b72, 0x62e1502b, 0x0c6d4b6a,
+ 0xbff966a9, 0xd1757de8, 0x03a03b6e, 0x6d2c202f, 0xdeb80dec,
+ 0xb03416ad, 0xa06386a1, 0xceef9de0, 0x7d7bb023, 0x13f7ab62,
+ 0xc122ede4, 0xafaef6a5, 0x1c3adb66, 0x72b6c027, 0x807cadd4,
+ 0xeef0b695, 0x5d649b56, 0x33e88017, 0xe13dc691, 0x8fb1ddd0,
+ 0x3c25f013, 0x52a9eb52, 0x42fe7b5e, 0x2c72601f, 0x9fe64ddc,
+ 0xf16a569d, 0x23bf101b, 0x4d330b5a, 0xfea72699, 0x902b3dd8,
+ 0xde080681, 0xb0841dc0, 0x03103003, 0x6d9c2b42, 0xbf496dc4,
+ 0xd1c57685, 0x62515b46, 0x0cdd4007, 0x1c8ad00b, 0x7206cb4a,
+ 0xc192e689, 0xaf1efdc8, 0x7dcbbb4e, 0x1347a00f, 0xa0d38dcc,
+ 0xce5f968d},
+ {0x00000000, 0xe71da697, 0x154a4b6f, 0xf257edf8, 0x2a9496de,
+ 0xcd893049, 0x3fdeddb1, 0xd8c37b26, 0x55292dbc, 0xb2348b2b,
+ 0x406366d3, 0xa77ec044, 0x7fbdbb62, 0x98a01df5, 0x6af7f00d,
+ 0x8dea569a, 0xaa525b78, 0x4d4ffdef, 0xbf181017, 0x5805b680,
+ 0x80c6cda6, 0x67db6b31, 0x958c86c9, 0x7291205e, 0xff7b76c4,
+ 0x1866d053, 0xea313dab, 0x0d2c9b3c, 0xd5efe01a, 0x32f2468d,
+ 0xc0a5ab75, 0x27b80de2, 0x8fd5b0b1, 0x68c81626, 0x9a9ffbde,
+ 0x7d825d49, 0xa541266f, 0x425c80f8, 0xb00b6d00, 0x5716cb97,
+ 0xdafc9d0d, 0x3de13b9a, 0xcfb6d662, 0x28ab70f5, 0xf0680bd3,
+ 0x1775ad44, 0xe52240bc, 0x023fe62b, 0x2587ebc9, 0xc29a4d5e,
+ 0x30cda0a6, 0xd7d00631, 0x0f137d17, 0xe80edb80, 0x1a593678,
+ 0xfd4490ef, 0x70aec675, 0x97b360e2, 0x65e48d1a, 0x82f92b8d,
+ 0x5a3a50ab, 0xbd27f63c, 0x4f701bc4, 0xa86dbd53, 0xc4da6723,
+ 0x23c7c1b4, 0xd1902c4c, 0x368d8adb, 0xee4ef1fd, 0x0953576a,
+ 0xfb04ba92, 0x1c191c05, 0x91f34a9f, 0x76eeec08, 0x84b901f0,
+ 0x63a4a767, 0xbb67dc41, 0x5c7a7ad6, 0xae2d972e, 0x493031b9,
+ 0x6e883c5b, 0x89959acc, 0x7bc27734, 0x9cdfd1a3, 0x441caa85,
+ 0xa3010c12, 0x5156e1ea, 0xb64b477d, 0x3ba111e7, 0xdcbcb770,
+ 0x2eeb5a88, 0xc9f6fc1f, 0x11358739, 0xf62821ae, 0x047fcc56,
+ 0xe3626ac1, 0x4b0fd792, 0xac127105, 0x5e459cfd, 0xb9583a6a,
+ 0x619b414c, 0x8686e7db, 0x74d10a23, 0x93ccacb4, 0x1e26fa2e,
+ 0xf93b5cb9, 0x0b6cb141, 0xec7117d6, 0x34b26cf0, 0xd3afca67,
+ 0x21f8279f, 0xc6e58108, 0xe15d8cea, 0x06402a7d, 0xf417c785,
+ 0x130a6112, 0xcbc91a34, 0x2cd4bca3, 0xde83515b, 0x399ef7cc,
+ 0xb474a156, 0x536907c1, 0xa13eea39, 0x46234cae, 0x9ee03788,
+ 0x79fd911f, 0x8baa7ce7, 0x6cb7da70, 0x52c5c807, 0xb5d86e90,
+ 0x478f8368, 0xa09225ff, 0x78515ed9, 0x9f4cf84e, 0x6d1b15b6,
+ 0x8a06b321, 0x07ece5bb, 0xe0f1432c, 0x12a6aed4, 0xf5bb0843,
+ 0x2d787365, 0xca65d5f2, 0x3832380a, 0xdf2f9e9d, 0xf897937f,
+ 0x1f8a35e8, 0xedddd810, 0x0ac07e87, 0xd20305a1, 0x351ea336,
+ 0xc7494ece, 0x2054e859, 0xadbebec3, 0x4aa31854, 0xb8f4f5ac,
+ 0x5fe9533b, 0x872a281d, 0x60378e8a, 0x92606372, 0x757dc5e5,
+ 0xdd1078b6, 0x3a0dde21, 0xc85a33d9, 0x2f47954e, 0xf784ee68,
+ 0x109948ff, 0xe2cea507, 0x05d30390, 0x8839550a, 0x6f24f39d,
+ 0x9d731e65, 0x7a6eb8f2, 0xa2adc3d4, 0x45b06543, 0xb7e788bb,
+ 0x50fa2e2c, 0x774223ce, 0x905f8559, 0x620868a1, 0x8515ce36,
+ 0x5dd6b510, 0xbacb1387, 0x489cfe7f, 0xaf8158e8, 0x226b0e72,
+ 0xc576a8e5, 0x3721451d, 0xd03ce38a, 0x08ff98ac, 0xefe23e3b,
+ 0x1db5d3c3, 0xfaa87554, 0x961faf24, 0x710209b3, 0x8355e44b,
+ 0x644842dc, 0xbc8b39fa, 0x5b969f6d, 0xa9c17295, 0x4edcd402,
+ 0xc3368298, 0x242b240f, 0xd67cc9f7, 0x31616f60, 0xe9a21446,
+ 0x0ebfb2d1, 0xfce85f29, 0x1bf5f9be, 0x3c4df45c, 0xdb5052cb,
+ 0x2907bf33, 0xce1a19a4, 0x16d96282, 0xf1c4c415, 0x039329ed,
+ 0xe48e8f7a, 0x6964d9e0, 0x8e797f77, 0x7c2e928f, 0x9b333418,
+ 0x43f04f3e, 0xa4ede9a9, 0x56ba0451, 0xb1a7a2c6, 0x19ca1f95,
+ 0xfed7b902, 0x0c8054fa, 0xeb9df26d, 0x335e894b, 0xd4432fdc,
+ 0x2614c224, 0xc10964b3, 0x4ce33229, 0xabfe94be, 0x59a97946,
+ 0xbeb4dfd1, 0x6677a4f7, 0x816a0260, 0x733def98, 0x9420490f,
+ 0xb39844ed, 0x5485e27a, 0xa6d20f82, 0x41cfa915, 0x990cd233,
+ 0x7e1174a4, 0x8c46995c, 0x6b5b3fcb, 0xe6b16951, 0x01accfc6,
+ 0xf3fb223e, 0x14e684a9, 0xcc25ff8f, 0x2b385918, 0xd96fb4e0,
+ 0x3e721277},
+ {0x00000000, 0xa58b900e, 0x9066265d, 0x35edb653, 0xfbbd4afb,
+ 0x5e36daf5, 0x6bdb6ca6, 0xce50fca8, 0x2c0b93b7, 0x898003b9,
+ 0xbc6db5ea, 0x19e625e4, 0xd7b6d94c, 0x723d4942, 0x47d0ff11,
+ 0xe25b6f1f, 0x5817276e, 0xfd9cb760, 0xc8710133, 0x6dfa913d,
+ 0xa3aa6d95, 0x0621fd9b, 0x33cc4bc8, 0x9647dbc6, 0x741cb4d9,
+ 0xd19724d7, 0xe47a9284, 0x41f1028a, 0x8fa1fe22, 0x2a2a6e2c,
+ 0x1fc7d87f, 0xba4c4871, 0xb02e4edc, 0x15a5ded2, 0x20486881,
+ 0x85c3f88f, 0x4b930427, 0xee189429, 0xdbf5227a, 0x7e7eb274,
+ 0x9c25dd6b, 0x39ae4d65, 0x0c43fb36, 0xa9c86b38, 0x67989790,
+ 0xc213079e, 0xf7feb1cd, 0x527521c3, 0xe83969b2, 0x4db2f9bc,
+ 0x785f4fef, 0xddd4dfe1, 0x13842349, 0xb60fb347, 0x83e20514,
+ 0x2669951a, 0xc432fa05, 0x61b96a0b, 0x5454dc58, 0xf1df4c56,
+ 0x3f8fb0fe, 0x9a0420f0, 0xafe996a3, 0x0a6206ad, 0xbb2d9bf9,
+ 0x1ea60bf7, 0x2b4bbda4, 0x8ec02daa, 0x4090d102, 0xe51b410c,
+ 0xd0f6f75f, 0x757d6751, 0x9726084e, 0x32ad9840, 0x07402e13,
+ 0xa2cbbe1d, 0x6c9b42b5, 0xc910d2bb, 0xfcfd64e8, 0x5976f4e6,
+ 0xe33abc97, 0x46b12c99, 0x735c9aca, 0xd6d70ac4, 0x1887f66c,
+ 0xbd0c6662, 0x88e1d031, 0x2d6a403f, 0xcf312f20, 0x6ababf2e,
+ 0x5f57097d, 0xfadc9973, 0x348c65db, 0x9107f5d5, 0xa4ea4386,
+ 0x0161d388, 0x0b03d525, 0xae88452b, 0x9b65f378, 0x3eee6376,
+ 0xf0be9fde, 0x55350fd0, 0x60d8b983, 0xc553298d, 0x27084692,
+ 0x8283d69c, 0xb76e60cf, 0x12e5f0c1, 0xdcb50c69, 0x793e9c67,
+ 0x4cd32a34, 0xe958ba3a, 0x5314f24b, 0xf69f6245, 0xc372d416,
+ 0x66f94418, 0xa8a9b8b0, 0x0d2228be, 0x38cf9eed, 0x9d440ee3,
+ 0x7f1f61fc, 0xda94f1f2, 0xef7947a1, 0x4af2d7af, 0x84a22b07,
+ 0x2129bb09, 0x14c40d5a, 0xb14f9d54, 0xad2a31b3, 0x08a1a1bd,
+ 0x3d4c17ee, 0x98c787e0, 0x56977b48, 0xf31ceb46, 0xc6f15d15,
+ 0x637acd1b, 0x8121a204, 0x24aa320a, 0x11478459, 0xb4cc1457,
+ 0x7a9ce8ff, 0xdf1778f1, 0xeafacea2, 0x4f715eac, 0xf53d16dd,
+ 0x50b686d3, 0x655b3080, 0xc0d0a08e, 0x0e805c26, 0xab0bcc28,
+ 0x9ee67a7b, 0x3b6dea75, 0xd936856a, 0x7cbd1564, 0x4950a337,
+ 0xecdb3339, 0x228bcf91, 0x87005f9f, 0xb2ede9cc, 0x176679c2,
+ 0x1d047f6f, 0xb88fef61, 0x8d625932, 0x28e9c93c, 0xe6b93594,
+ 0x4332a59a, 0x76df13c9, 0xd35483c7, 0x310fecd8, 0x94847cd6,
+ 0xa169ca85, 0x04e25a8b, 0xcab2a623, 0x6f39362d, 0x5ad4807e,
+ 0xff5f1070, 0x45135801, 0xe098c80f, 0xd5757e5c, 0x70feee52,
+ 0xbeae12fa, 0x1b2582f4, 0x2ec834a7, 0x8b43a4a9, 0x6918cbb6,
+ 0xcc935bb8, 0xf97eedeb, 0x5cf57de5, 0x92a5814d, 0x372e1143,
+ 0x02c3a710, 0xa748371e, 0x1607aa4a, 0xb38c3a44, 0x86618c17,
+ 0x23ea1c19, 0xedbae0b1, 0x483170bf, 0x7ddcc6ec, 0xd85756e2,
+ 0x3a0c39fd, 0x9f87a9f3, 0xaa6a1fa0, 0x0fe18fae, 0xc1b17306,
+ 0x643ae308, 0x51d7555b, 0xf45cc555, 0x4e108d24, 0xeb9b1d2a,
+ 0xde76ab79, 0x7bfd3b77, 0xb5adc7df, 0x102657d1, 0x25cbe182,
+ 0x8040718c, 0x621b1e93, 0xc7908e9d, 0xf27d38ce, 0x57f6a8c0,
+ 0x99a65468, 0x3c2dc466, 0x09c07235, 0xac4be23b, 0xa629e496,
+ 0x03a27498, 0x364fc2cb, 0x93c452c5, 0x5d94ae6d, 0xf81f3e63,
+ 0xcdf28830, 0x6879183e, 0x8a227721, 0x2fa9e72f, 0x1a44517c,
+ 0xbfcfc172, 0x719f3dda, 0xd414add4, 0xe1f91b87, 0x44728b89,
+ 0xfe3ec3f8, 0x5bb553f6, 0x6e58e5a5, 0xcbd375ab, 0x05838903,
+ 0xa008190d, 0x95e5af5e, 0x306e3f50, 0xd235504f, 0x77bec041,
+ 0x42537612, 0xe7d8e61c, 0x29881ab4, 0x8c038aba, 0xb9ee3ce9,
+ 0x1c65ace7}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x0000000000000000, 0x0e908ba500000000, 0x5d26669000000000,
+ 0x53b6ed3500000000, 0xfb4abdfb00000000, 0xf5da365e00000000,
+ 0xa66cdb6b00000000, 0xa8fc50ce00000000, 0xb7930b2c00000000,
+ 0xb903808900000000, 0xeab56dbc00000000, 0xe425e61900000000,
+ 0x4cd9b6d700000000, 0x42493d7200000000, 0x11ffd04700000000,
+ 0x1f6f5be200000000, 0x6e27175800000000, 0x60b79cfd00000000,
+ 0x330171c800000000, 0x3d91fa6d00000000, 0x956daaa300000000,
+ 0x9bfd210600000000, 0xc84bcc3300000000, 0xc6db479600000000,
+ 0xd9b41c7400000000, 0xd72497d100000000, 0x84927ae400000000,
+ 0x8a02f14100000000, 0x22fea18f00000000, 0x2c6e2a2a00000000,
+ 0x7fd8c71f00000000, 0x71484cba00000000, 0xdc4e2eb000000000,
+ 0xd2dea51500000000, 0x8168482000000000, 0x8ff8c38500000000,
+ 0x2704934b00000000, 0x299418ee00000000, 0x7a22f5db00000000,
+ 0x74b27e7e00000000, 0x6bdd259c00000000, 0x654dae3900000000,
+ 0x36fb430c00000000, 0x386bc8a900000000, 0x9097986700000000,
+ 0x9e0713c200000000, 0xcdb1fef700000000, 0xc321755200000000,
+ 0xb26939e800000000, 0xbcf9b24d00000000, 0xef4f5f7800000000,
+ 0xe1dfd4dd00000000, 0x4923841300000000, 0x47b30fb600000000,
+ 0x1405e28300000000, 0x1a95692600000000, 0x05fa32c400000000,
+ 0x0b6ab96100000000, 0x58dc545400000000, 0x564cdff100000000,
+ 0xfeb08f3f00000000, 0xf020049a00000000, 0xa396e9af00000000,
+ 0xad06620a00000000, 0xf99b2dbb00000000, 0xf70ba61e00000000,
+ 0xa4bd4b2b00000000, 0xaa2dc08e00000000, 0x02d1904000000000,
+ 0x0c411be500000000, 0x5ff7f6d000000000, 0x51677d7500000000,
+ 0x4e08269700000000, 0x4098ad3200000000, 0x132e400700000000,
+ 0x1dbecba200000000, 0xb5429b6c00000000, 0xbbd210c900000000,
+ 0xe864fdfc00000000, 0xe6f4765900000000, 0x97bc3ae300000000,
+ 0x992cb14600000000, 0xca9a5c7300000000, 0xc40ad7d600000000,
+ 0x6cf6871800000000, 0x62660cbd00000000, 0x31d0e18800000000,
+ 0x3f406a2d00000000, 0x202f31cf00000000, 0x2ebfba6a00000000,
+ 0x7d09575f00000000, 0x7399dcfa00000000, 0xdb658c3400000000,
+ 0xd5f5079100000000, 0x8643eaa400000000, 0x88d3610100000000,
+ 0x25d5030b00000000, 0x2b4588ae00000000, 0x78f3659b00000000,
+ 0x7663ee3e00000000, 0xde9fbef000000000, 0xd00f355500000000,
+ 0x83b9d86000000000, 0x8d2953c500000000, 0x9246082700000000,
+ 0x9cd6838200000000, 0xcf606eb700000000, 0xc1f0e51200000000,
+ 0x690cb5dc00000000, 0x679c3e7900000000, 0x342ad34c00000000,
+ 0x3aba58e900000000, 0x4bf2145300000000, 0x45629ff600000000,
+ 0x16d472c300000000, 0x1844f96600000000, 0xb0b8a9a800000000,
+ 0xbe28220d00000000, 0xed9ecf3800000000, 0xe30e449d00000000,
+ 0xfc611f7f00000000, 0xf2f194da00000000, 0xa14779ef00000000,
+ 0xafd7f24a00000000, 0x072ba28400000000, 0x09bb292100000000,
+ 0x5a0dc41400000000, 0x549d4fb100000000, 0xb3312aad00000000,
+ 0xbda1a10800000000, 0xee174c3d00000000, 0xe087c79800000000,
+ 0x487b975600000000, 0x46eb1cf300000000, 0x155df1c600000000,
+ 0x1bcd7a6300000000, 0x04a2218100000000, 0x0a32aa2400000000,
+ 0x5984471100000000, 0x5714ccb400000000, 0xffe89c7a00000000,
+ 0xf17817df00000000, 0xa2cefaea00000000, 0xac5e714f00000000,
+ 0xdd163df500000000, 0xd386b65000000000, 0x80305b6500000000,
+ 0x8ea0d0c000000000, 0x265c800e00000000, 0x28cc0bab00000000,
+ 0x7b7ae69e00000000, 0x75ea6d3b00000000, 0x6a8536d900000000,
+ 0x6415bd7c00000000, 0x37a3504900000000, 0x3933dbec00000000,
+ 0x91cf8b2200000000, 0x9f5f008700000000, 0xcce9edb200000000,
+ 0xc279661700000000, 0x6f7f041d00000000, 0x61ef8fb800000000,
+ 0x3259628d00000000, 0x3cc9e92800000000, 0x9435b9e600000000,
+ 0x9aa5324300000000, 0xc913df7600000000, 0xc78354d300000000,
+ 0xd8ec0f3100000000, 0xd67c849400000000, 0x85ca69a100000000,
+ 0x8b5ae20400000000, 0x23a6b2ca00000000, 0x2d36396f00000000,
+ 0x7e80d45a00000000, 0x70105fff00000000, 0x0158134500000000,
+ 0x0fc898e000000000, 0x5c7e75d500000000, 0x52eefe7000000000,
+ 0xfa12aebe00000000, 0xf482251b00000000, 0xa734c82e00000000,
+ 0xa9a4438b00000000, 0xb6cb186900000000, 0xb85b93cc00000000,
+ 0xebed7ef900000000, 0xe57df55c00000000, 0x4d81a59200000000,
+ 0x43112e3700000000, 0x10a7c30200000000, 0x1e3748a700000000,
+ 0x4aaa071600000000, 0x443a8cb300000000, 0x178c618600000000,
+ 0x191cea2300000000, 0xb1e0baed00000000, 0xbf70314800000000,
+ 0xecc6dc7d00000000, 0xe25657d800000000, 0xfd390c3a00000000,
+ 0xf3a9879f00000000, 0xa01f6aaa00000000, 0xae8fe10f00000000,
+ 0x0673b1c100000000, 0x08e33a6400000000, 0x5b55d75100000000,
+ 0x55c55cf400000000, 0x248d104e00000000, 0x2a1d9beb00000000,
+ 0x79ab76de00000000, 0x773bfd7b00000000, 0xdfc7adb500000000,
+ 0xd157261000000000, 0x82e1cb2500000000, 0x8c71408000000000,
+ 0x931e1b6200000000, 0x9d8e90c700000000, 0xce387df200000000,
+ 0xc0a8f65700000000, 0x6854a69900000000, 0x66c42d3c00000000,
+ 0x3572c00900000000, 0x3be24bac00000000, 0x96e429a600000000,
+ 0x9874a20300000000, 0xcbc24f3600000000, 0xc552c49300000000,
+ 0x6dae945d00000000, 0x633e1ff800000000, 0x3088f2cd00000000,
+ 0x3e18796800000000, 0x2177228a00000000, 0x2fe7a92f00000000,
+ 0x7c51441a00000000, 0x72c1cfbf00000000, 0xda3d9f7100000000,
+ 0xd4ad14d400000000, 0x871bf9e100000000, 0x898b724400000000,
+ 0xf8c33efe00000000, 0xf653b55b00000000, 0xa5e5586e00000000,
+ 0xab75d3cb00000000, 0x0389830500000000, 0x0d1908a000000000,
+ 0x5eafe59500000000, 0x503f6e3000000000, 0x4f5035d200000000,
+ 0x41c0be7700000000, 0x1276534200000000, 0x1ce6d8e700000000,
+ 0xb41a882900000000, 0xba8a038c00000000, 0xe93ceeb900000000,
+ 0xe7ac651c00000000},
+ {0x0000000000000000, 0x97a61de700000000, 0x6f4b4a1500000000,
+ 0xf8ed57f200000000, 0xde96942a00000000, 0x493089cd00000000,
+ 0xb1ddde3f00000000, 0x267bc3d800000000, 0xbc2d295500000000,
+ 0x2b8b34b200000000, 0xd366634000000000, 0x44c07ea700000000,
+ 0x62bbbd7f00000000, 0xf51da09800000000, 0x0df0f76a00000000,
+ 0x9a56ea8d00000000, 0x785b52aa00000000, 0xeffd4f4d00000000,
+ 0x171018bf00000000, 0x80b6055800000000, 0xa6cdc68000000000,
+ 0x316bdb6700000000, 0xc9868c9500000000, 0x5e20917200000000,
+ 0xc4767bff00000000, 0x53d0661800000000, 0xab3d31ea00000000,
+ 0x3c9b2c0d00000000, 0x1ae0efd500000000, 0x8d46f23200000000,
+ 0x75aba5c000000000, 0xe20db82700000000, 0xb1b0d58f00000000,
+ 0x2616c86800000000, 0xdefb9f9a00000000, 0x495d827d00000000,
+ 0x6f2641a500000000, 0xf8805c4200000000, 0x006d0bb000000000,
+ 0x97cb165700000000, 0x0d9dfcda00000000, 0x9a3be13d00000000,
+ 0x62d6b6cf00000000, 0xf570ab2800000000, 0xd30b68f000000000,
+ 0x44ad751700000000, 0xbc4022e500000000, 0x2be63f0200000000,
+ 0xc9eb872500000000, 0x5e4d9ac200000000, 0xa6a0cd3000000000,
+ 0x3106d0d700000000, 0x177d130f00000000, 0x80db0ee800000000,
+ 0x7836591a00000000, 0xef9044fd00000000, 0x75c6ae7000000000,
+ 0xe260b39700000000, 0x1a8de46500000000, 0x8d2bf98200000000,
+ 0xab503a5a00000000, 0x3cf627bd00000000, 0xc41b704f00000000,
+ 0x53bd6da800000000, 0x2367dac400000000, 0xb4c1c72300000000,
+ 0x4c2c90d100000000, 0xdb8a8d3600000000, 0xfdf14eee00000000,
+ 0x6a57530900000000, 0x92ba04fb00000000, 0x051c191c00000000,
+ 0x9f4af39100000000, 0x08ecee7600000000, 0xf001b98400000000,
+ 0x67a7a46300000000, 0x41dc67bb00000000, 0xd67a7a5c00000000,
+ 0x2e972dae00000000, 0xb931304900000000, 0x5b3c886e00000000,
+ 0xcc9a958900000000, 0x3477c27b00000000, 0xa3d1df9c00000000,
+ 0x85aa1c4400000000, 0x120c01a300000000, 0xeae1565100000000,
+ 0x7d474bb600000000, 0xe711a13b00000000, 0x70b7bcdc00000000,
+ 0x885aeb2e00000000, 0x1ffcf6c900000000, 0x3987351100000000,
+ 0xae2128f600000000, 0x56cc7f0400000000, 0xc16a62e300000000,
+ 0x92d70f4b00000000, 0x057112ac00000000, 0xfd9c455e00000000,
+ 0x6a3a58b900000000, 0x4c419b6100000000, 0xdbe7868600000000,
+ 0x230ad17400000000, 0xb4accc9300000000, 0x2efa261e00000000,
+ 0xb95c3bf900000000, 0x41b16c0b00000000, 0xd61771ec00000000,
+ 0xf06cb23400000000, 0x67caafd300000000, 0x9f27f82100000000,
+ 0x0881e5c600000000, 0xea8c5de100000000, 0x7d2a400600000000,
+ 0x85c717f400000000, 0x12610a1300000000, 0x341ac9cb00000000,
+ 0xa3bcd42c00000000, 0x5b5183de00000000, 0xccf79e3900000000,
+ 0x56a174b400000000, 0xc107695300000000, 0x39ea3ea100000000,
+ 0xae4c234600000000, 0x8837e09e00000000, 0x1f91fd7900000000,
+ 0xe77caa8b00000000, 0x70dab76c00000000, 0x07c8c55200000000,
+ 0x906ed8b500000000, 0x68838f4700000000, 0xff2592a000000000,
+ 0xd95e517800000000, 0x4ef84c9f00000000, 0xb6151b6d00000000,
+ 0x21b3068a00000000, 0xbbe5ec0700000000, 0x2c43f1e000000000,
+ 0xd4aea61200000000, 0x4308bbf500000000, 0x6573782d00000000,
+ 0xf2d565ca00000000, 0x0a38323800000000, 0x9d9e2fdf00000000,
+ 0x7f9397f800000000, 0xe8358a1f00000000, 0x10d8dded00000000,
+ 0x877ec00a00000000, 0xa10503d200000000, 0x36a31e3500000000,
+ 0xce4e49c700000000, 0x59e8542000000000, 0xc3bebead00000000,
+ 0x5418a34a00000000, 0xacf5f4b800000000, 0x3b53e95f00000000,
+ 0x1d282a8700000000, 0x8a8e376000000000, 0x7263609200000000,
+ 0xe5c57d7500000000, 0xb67810dd00000000, 0x21de0d3a00000000,
+ 0xd9335ac800000000, 0x4e95472f00000000, 0x68ee84f700000000,
+ 0xff48991000000000, 0x07a5cee200000000, 0x9003d30500000000,
+ 0x0a55398800000000, 0x9df3246f00000000, 0x651e739d00000000,
+ 0xf2b86e7a00000000, 0xd4c3ada200000000, 0x4365b04500000000,
+ 0xbb88e7b700000000, 0x2c2efa5000000000, 0xce23427700000000,
+ 0x59855f9000000000, 0xa168086200000000, 0x36ce158500000000,
+ 0x10b5d65d00000000, 0x8713cbba00000000, 0x7ffe9c4800000000,
+ 0xe85881af00000000, 0x720e6b2200000000, 0xe5a876c500000000,
+ 0x1d45213700000000, 0x8ae33cd000000000, 0xac98ff0800000000,
+ 0x3b3ee2ef00000000, 0xc3d3b51d00000000, 0x5475a8fa00000000,
+ 0x24af1f9600000000, 0xb309027100000000, 0x4be4558300000000,
+ 0xdc42486400000000, 0xfa398bbc00000000, 0x6d9f965b00000000,
+ 0x9572c1a900000000, 0x02d4dc4e00000000, 0x988236c300000000,
+ 0x0f242b2400000000, 0xf7c97cd600000000, 0x606f613100000000,
+ 0x4614a2e900000000, 0xd1b2bf0e00000000, 0x295fe8fc00000000,
+ 0xbef9f51b00000000, 0x5cf44d3c00000000, 0xcb5250db00000000,
+ 0x33bf072900000000, 0xa4191ace00000000, 0x8262d91600000000,
+ 0x15c4c4f100000000, 0xed29930300000000, 0x7a8f8ee400000000,
+ 0xe0d9646900000000, 0x777f798e00000000, 0x8f922e7c00000000,
+ 0x1834339b00000000, 0x3e4ff04300000000, 0xa9e9eda400000000,
+ 0x5104ba5600000000, 0xc6a2a7b100000000, 0x951fca1900000000,
+ 0x02b9d7fe00000000, 0xfa54800c00000000, 0x6df29deb00000000,
+ 0x4b895e3300000000, 0xdc2f43d400000000, 0x24c2142600000000,
+ 0xb36409c100000000, 0x2932e34c00000000, 0xbe94feab00000000,
+ 0x4679a95900000000, 0xd1dfb4be00000000, 0xf7a4776600000000,
+ 0x60026a8100000000, 0x98ef3d7300000000, 0x0f49209400000000,
+ 0xed4498b300000000, 0x7ae2855400000000, 0x820fd2a600000000,
+ 0x15a9cf4100000000, 0x33d20c9900000000, 0xa474117e00000000,
+ 0x5c99468c00000000, 0xcb3f5b6b00000000, 0x5169b1e600000000,
+ 0xc6cfac0100000000, 0x3e22fbf300000000, 0xa984e61400000000,
+ 0x8fff25cc00000000, 0x1859382b00000000, 0xe0b46fd900000000,
+ 0x7712723e00000000},
+ {0x0000000000000000, 0x411b8c6e00000000, 0x823618dd00000000,
+ 0xc32d94b300000000, 0x456b416100000000, 0x0470cd0f00000000,
+ 0xc75d59bc00000000, 0x8646d5d200000000, 0x8ad682c200000000,
+ 0xcbcd0eac00000000, 0x08e09a1f00000000, 0x49fb167100000000,
+ 0xcfbdc3a300000000, 0x8ea64fcd00000000, 0x4d8bdb7e00000000,
+ 0x0c90571000000000, 0x55ab745e00000000, 0x14b0f83000000000,
+ 0xd79d6c8300000000, 0x9686e0ed00000000, 0x10c0353f00000000,
+ 0x51dbb95100000000, 0x92f62de200000000, 0xd3eda18c00000000,
+ 0xdf7df69c00000000, 0x9e667af200000000, 0x5d4bee4100000000,
+ 0x1c50622f00000000, 0x9a16b7fd00000000, 0xdb0d3b9300000000,
+ 0x1820af2000000000, 0x593b234e00000000, 0xaa56e9bc00000000,
+ 0xeb4d65d200000000, 0x2860f16100000000, 0x697b7d0f00000000,
+ 0xef3da8dd00000000, 0xae2624b300000000, 0x6d0bb00000000000,
+ 0x2c103c6e00000000, 0x20806b7e00000000, 0x619be71000000000,
+ 0xa2b673a300000000, 0xe3adffcd00000000, 0x65eb2a1f00000000,
+ 0x24f0a67100000000, 0xe7dd32c200000000, 0xa6c6beac00000000,
+ 0xfffd9de200000000, 0xbee6118c00000000, 0x7dcb853f00000000,
+ 0x3cd0095100000000, 0xba96dc8300000000, 0xfb8d50ed00000000,
+ 0x38a0c45e00000000, 0x79bb483000000000, 0x752b1f2000000000,
+ 0x3430934e00000000, 0xf71d07fd00000000, 0xb6068b9300000000,
+ 0x30405e4100000000, 0x715bd22f00000000, 0xb276469c00000000,
+ 0xf36dcaf200000000, 0x15aba3a200000000, 0x54b02fcc00000000,
+ 0x979dbb7f00000000, 0xd686371100000000, 0x50c0e2c300000000,
+ 0x11db6ead00000000, 0xd2f6fa1e00000000, 0x93ed767000000000,
+ 0x9f7d216000000000, 0xde66ad0e00000000, 0x1d4b39bd00000000,
+ 0x5c50b5d300000000, 0xda16600100000000, 0x9b0dec6f00000000,
+ 0x582078dc00000000, 0x193bf4b200000000, 0x4000d7fc00000000,
+ 0x011b5b9200000000, 0xc236cf2100000000, 0x832d434f00000000,
+ 0x056b969d00000000, 0x44701af300000000, 0x875d8e4000000000,
+ 0xc646022e00000000, 0xcad6553e00000000, 0x8bcdd95000000000,
+ 0x48e04de300000000, 0x09fbc18d00000000, 0x8fbd145f00000000,
+ 0xcea6983100000000, 0x0d8b0c8200000000, 0x4c9080ec00000000,
+ 0xbffd4a1e00000000, 0xfee6c67000000000, 0x3dcb52c300000000,
+ 0x7cd0dead00000000, 0xfa960b7f00000000, 0xbb8d871100000000,
+ 0x78a013a200000000, 0x39bb9fcc00000000, 0x352bc8dc00000000,
+ 0x743044b200000000, 0xb71dd00100000000, 0xf6065c6f00000000,
+ 0x704089bd00000000, 0x315b05d300000000, 0xf276916000000000,
+ 0xb36d1d0e00000000, 0xea563e4000000000, 0xab4db22e00000000,
+ 0x6860269d00000000, 0x297baaf300000000, 0xaf3d7f2100000000,
+ 0xee26f34f00000000, 0x2d0b67fc00000000, 0x6c10eb9200000000,
+ 0x6080bc8200000000, 0x219b30ec00000000, 0xe2b6a45f00000000,
+ 0xa3ad283100000000, 0x25ebfde300000000, 0x64f0718d00000000,
+ 0xa7dde53e00000000, 0xe6c6695000000000, 0x6b50369e00000000,
+ 0x2a4bbaf000000000, 0xe9662e4300000000, 0xa87da22d00000000,
+ 0x2e3b77ff00000000, 0x6f20fb9100000000, 0xac0d6f2200000000,
+ 0xed16e34c00000000, 0xe186b45c00000000, 0xa09d383200000000,
+ 0x63b0ac8100000000, 0x22ab20ef00000000, 0xa4edf53d00000000,
+ 0xe5f6795300000000, 0x26dbede000000000, 0x67c0618e00000000,
+ 0x3efb42c000000000, 0x7fe0ceae00000000, 0xbccd5a1d00000000,
+ 0xfdd6d67300000000, 0x7b9003a100000000, 0x3a8b8fcf00000000,
+ 0xf9a61b7c00000000, 0xb8bd971200000000, 0xb42dc00200000000,
+ 0xf5364c6c00000000, 0x361bd8df00000000, 0x770054b100000000,
+ 0xf146816300000000, 0xb05d0d0d00000000, 0x737099be00000000,
+ 0x326b15d000000000, 0xc106df2200000000, 0x801d534c00000000,
+ 0x4330c7ff00000000, 0x022b4b9100000000, 0x846d9e4300000000,
+ 0xc576122d00000000, 0x065b869e00000000, 0x47400af000000000,
+ 0x4bd05de000000000, 0x0acbd18e00000000, 0xc9e6453d00000000,
+ 0x88fdc95300000000, 0x0ebb1c8100000000, 0x4fa090ef00000000,
+ 0x8c8d045c00000000, 0xcd96883200000000, 0x94adab7c00000000,
+ 0xd5b6271200000000, 0x169bb3a100000000, 0x57803fcf00000000,
+ 0xd1c6ea1d00000000, 0x90dd667300000000, 0x53f0f2c000000000,
+ 0x12eb7eae00000000, 0x1e7b29be00000000, 0x5f60a5d000000000,
+ 0x9c4d316300000000, 0xdd56bd0d00000000, 0x5b1068df00000000,
+ 0x1a0be4b100000000, 0xd926700200000000, 0x983dfc6c00000000,
+ 0x7efb953c00000000, 0x3fe0195200000000, 0xfccd8de100000000,
+ 0xbdd6018f00000000, 0x3b90d45d00000000, 0x7a8b583300000000,
+ 0xb9a6cc8000000000, 0xf8bd40ee00000000, 0xf42d17fe00000000,
+ 0xb5369b9000000000, 0x761b0f2300000000, 0x3700834d00000000,
+ 0xb146569f00000000, 0xf05ddaf100000000, 0x33704e4200000000,
+ 0x726bc22c00000000, 0x2b50e16200000000, 0x6a4b6d0c00000000,
+ 0xa966f9bf00000000, 0xe87d75d100000000, 0x6e3ba00300000000,
+ 0x2f202c6d00000000, 0xec0db8de00000000, 0xad1634b000000000,
+ 0xa18663a000000000, 0xe09defce00000000, 0x23b07b7d00000000,
+ 0x62abf71300000000, 0xe4ed22c100000000, 0xa5f6aeaf00000000,
+ 0x66db3a1c00000000, 0x27c0b67200000000, 0xd4ad7c8000000000,
+ 0x95b6f0ee00000000, 0x569b645d00000000, 0x1780e83300000000,
+ 0x91c63de100000000, 0xd0ddb18f00000000, 0x13f0253c00000000,
+ 0x52eba95200000000, 0x5e7bfe4200000000, 0x1f60722c00000000,
+ 0xdc4de69f00000000, 0x9d566af100000000, 0x1b10bf2300000000,
+ 0x5a0b334d00000000, 0x9926a7fe00000000, 0xd83d2b9000000000,
+ 0x810608de00000000, 0xc01d84b000000000, 0x0330100300000000,
+ 0x422b9c6d00000000, 0xc46d49bf00000000, 0x8576c5d100000000,
+ 0x465b516200000000, 0x0740dd0c00000000, 0x0bd08a1c00000000,
+ 0x4acb067200000000, 0x89e692c100000000, 0xc8fd1eaf00000000,
+ 0x4ebbcb7d00000000, 0x0fa0471300000000, 0xcc8dd3a000000000,
+ 0x8d965fce00000000},
+ {0x0000000000000000, 0x1dfdb50100000000, 0x3afa6b0300000000,
+ 0x2707de0200000000, 0x74f4d70600000000, 0x6909620700000000,
+ 0x4e0ebc0500000000, 0x53f3090400000000, 0xe8e8af0d00000000,
+ 0xf5151a0c00000000, 0xd212c40e00000000, 0xcfef710f00000000,
+ 0x9c1c780b00000000, 0x81e1cd0a00000000, 0xa6e6130800000000,
+ 0xbb1ba60900000000, 0xd0d15f1b00000000, 0xcd2cea1a00000000,
+ 0xea2b341800000000, 0xf7d6811900000000, 0xa425881d00000000,
+ 0xb9d83d1c00000000, 0x9edfe31e00000000, 0x8322561f00000000,
+ 0x3839f01600000000, 0x25c4451700000000, 0x02c39b1500000000,
+ 0x1f3e2e1400000000, 0x4ccd271000000000, 0x5130921100000000,
+ 0x76374c1300000000, 0x6bcaf91200000000, 0xa0a3bf3600000000,
+ 0xbd5e0a3700000000, 0x9a59d43500000000, 0x87a4613400000000,
+ 0xd457683000000000, 0xc9aadd3100000000, 0xeead033300000000,
+ 0xf350b63200000000, 0x484b103b00000000, 0x55b6a53a00000000,
+ 0x72b17b3800000000, 0x6f4cce3900000000, 0x3cbfc73d00000000,
+ 0x2142723c00000000, 0x0645ac3e00000000, 0x1bb8193f00000000,
+ 0x7072e02d00000000, 0x6d8f552c00000000, 0x4a888b2e00000000,
+ 0x57753e2f00000000, 0x0486372b00000000, 0x197b822a00000000,
+ 0x3e7c5c2800000000, 0x2381e92900000000, 0x989a4f2000000000,
+ 0x8567fa2100000000, 0xa260242300000000, 0xbf9d912200000000,
+ 0xec6e982600000000, 0xf1932d2700000000, 0xd694f32500000000,
+ 0xcb69462400000000, 0x40477f6d00000000, 0x5dbaca6c00000000,
+ 0x7abd146e00000000, 0x6740a16f00000000, 0x34b3a86b00000000,
+ 0x294e1d6a00000000, 0x0e49c36800000000, 0x13b4766900000000,
+ 0xa8afd06000000000, 0xb552656100000000, 0x9255bb6300000000,
+ 0x8fa80e6200000000, 0xdc5b076600000000, 0xc1a6b26700000000,
+ 0xe6a16c6500000000, 0xfb5cd96400000000, 0x9096207600000000,
+ 0x8d6b957700000000, 0xaa6c4b7500000000, 0xb791fe7400000000,
+ 0xe462f77000000000, 0xf99f427100000000, 0xde989c7300000000,
+ 0xc365297200000000, 0x787e8f7b00000000, 0x65833a7a00000000,
+ 0x4284e47800000000, 0x5f79517900000000, 0x0c8a587d00000000,
+ 0x1177ed7c00000000, 0x3670337e00000000, 0x2b8d867f00000000,
+ 0xe0e4c05b00000000, 0xfd19755a00000000, 0xda1eab5800000000,
+ 0xc7e31e5900000000, 0x9410175d00000000, 0x89eda25c00000000,
+ 0xaeea7c5e00000000, 0xb317c95f00000000, 0x080c6f5600000000,
+ 0x15f1da5700000000, 0x32f6045500000000, 0x2f0bb15400000000,
+ 0x7cf8b85000000000, 0x61050d5100000000, 0x4602d35300000000,
+ 0x5bff665200000000, 0x30359f4000000000, 0x2dc82a4100000000,
+ 0x0acff44300000000, 0x1732414200000000, 0x44c1484600000000,
+ 0x593cfd4700000000, 0x7e3b234500000000, 0x63c6964400000000,
+ 0xd8dd304d00000000, 0xc520854c00000000, 0xe2275b4e00000000,
+ 0xffdaee4f00000000, 0xac29e74b00000000, 0xb1d4524a00000000,
+ 0x96d38c4800000000, 0x8b2e394900000000, 0x808efeda00000000,
+ 0x9d734bdb00000000, 0xba7495d900000000, 0xa78920d800000000,
+ 0xf47a29dc00000000, 0xe9879cdd00000000, 0xce8042df00000000,
+ 0xd37df7de00000000, 0x686651d700000000, 0x759be4d600000000,
+ 0x529c3ad400000000, 0x4f618fd500000000, 0x1c9286d100000000,
+ 0x016f33d000000000, 0x2668edd200000000, 0x3b9558d300000000,
+ 0x505fa1c100000000, 0x4da214c000000000, 0x6aa5cac200000000,
+ 0x77587fc300000000, 0x24ab76c700000000, 0x3956c3c600000000,
+ 0x1e511dc400000000, 0x03aca8c500000000, 0xb8b70ecc00000000,
+ 0xa54abbcd00000000, 0x824d65cf00000000, 0x9fb0d0ce00000000,
+ 0xcc43d9ca00000000, 0xd1be6ccb00000000, 0xf6b9b2c900000000,
+ 0xeb4407c800000000, 0x202d41ec00000000, 0x3dd0f4ed00000000,
+ 0x1ad72aef00000000, 0x072a9fee00000000, 0x54d996ea00000000,
+ 0x492423eb00000000, 0x6e23fde900000000, 0x73de48e800000000,
+ 0xc8c5eee100000000, 0xd5385be000000000, 0xf23f85e200000000,
+ 0xefc230e300000000, 0xbc3139e700000000, 0xa1cc8ce600000000,
+ 0x86cb52e400000000, 0x9b36e7e500000000, 0xf0fc1ef700000000,
+ 0xed01abf600000000, 0xca0675f400000000, 0xd7fbc0f500000000,
+ 0x8408c9f100000000, 0x99f57cf000000000, 0xbef2a2f200000000,
+ 0xa30f17f300000000, 0x1814b1fa00000000, 0x05e904fb00000000,
+ 0x22eedaf900000000, 0x3f136ff800000000, 0x6ce066fc00000000,
+ 0x711dd3fd00000000, 0x561a0dff00000000, 0x4be7b8fe00000000,
+ 0xc0c981b700000000, 0xdd3434b600000000, 0xfa33eab400000000,
+ 0xe7ce5fb500000000, 0xb43d56b100000000, 0xa9c0e3b000000000,
+ 0x8ec73db200000000, 0x933a88b300000000, 0x28212eba00000000,
+ 0x35dc9bbb00000000, 0x12db45b900000000, 0x0f26f0b800000000,
+ 0x5cd5f9bc00000000, 0x41284cbd00000000, 0x662f92bf00000000,
+ 0x7bd227be00000000, 0x1018deac00000000, 0x0de56bad00000000,
+ 0x2ae2b5af00000000, 0x371f00ae00000000, 0x64ec09aa00000000,
+ 0x7911bcab00000000, 0x5e1662a900000000, 0x43ebd7a800000000,
+ 0xf8f071a100000000, 0xe50dc4a000000000, 0xc20a1aa200000000,
+ 0xdff7afa300000000, 0x8c04a6a700000000, 0x91f913a600000000,
+ 0xb6fecda400000000, 0xab0378a500000000, 0x606a3e8100000000,
+ 0x7d978b8000000000, 0x5a90558200000000, 0x476de08300000000,
+ 0x149ee98700000000, 0x09635c8600000000, 0x2e64828400000000,
+ 0x3399378500000000, 0x8882918c00000000, 0x957f248d00000000,
+ 0xb278fa8f00000000, 0xaf854f8e00000000, 0xfc76468a00000000,
+ 0xe18bf38b00000000, 0xc68c2d8900000000, 0xdb71988800000000,
+ 0xb0bb619a00000000, 0xad46d49b00000000, 0x8a410a9900000000,
+ 0x97bcbf9800000000, 0xc44fb69c00000000, 0xd9b2039d00000000,
+ 0xfeb5dd9f00000000, 0xe348689e00000000, 0x5853ce9700000000,
+ 0x45ae7b9600000000, 0x62a9a59400000000, 0x7f54109500000000,
+ 0x2ca7199100000000, 0x315aac9000000000, 0x165d729200000000,
+ 0x0ba0c79300000000},
+ {0x0000000000000000, 0x24d9076300000000, 0x48b20fc600000000,
+ 0x6c6b08a500000000, 0xd1626e5700000000, 0xf5bb693400000000,
+ 0x99d0619100000000, 0xbd0966f200000000, 0xa2c5dcae00000000,
+ 0x861cdbcd00000000, 0xea77d36800000000, 0xceaed40b00000000,
+ 0x73a7b2f900000000, 0x577eb59a00000000, 0x3b15bd3f00000000,
+ 0x1fccba5c00000000, 0x058dc88600000000, 0x2154cfe500000000,
+ 0x4d3fc74000000000, 0x69e6c02300000000, 0xd4efa6d100000000,
+ 0xf036a1b200000000, 0x9c5da91700000000, 0xb884ae7400000000,
+ 0xa748142800000000, 0x8391134b00000000, 0xeffa1bee00000000,
+ 0xcb231c8d00000000, 0x762a7a7f00000000, 0x52f37d1c00000000,
+ 0x3e9875b900000000, 0x1a4172da00000000, 0x4b1ce0d600000000,
+ 0x6fc5e7b500000000, 0x03aeef1000000000, 0x2777e87300000000,
+ 0x9a7e8e8100000000, 0xbea789e200000000, 0xd2cc814700000000,
+ 0xf615862400000000, 0xe9d93c7800000000, 0xcd003b1b00000000,
+ 0xa16b33be00000000, 0x85b234dd00000000, 0x38bb522f00000000,
+ 0x1c62554c00000000, 0x70095de900000000, 0x54d05a8a00000000,
+ 0x4e91285000000000, 0x6a482f3300000000, 0x0623279600000000,
+ 0x22fa20f500000000, 0x9ff3460700000000, 0xbb2a416400000000,
+ 0xd74149c100000000, 0xf3984ea200000000, 0xec54f4fe00000000,
+ 0xc88df39d00000000, 0xa4e6fb3800000000, 0x803ffc5b00000000,
+ 0x3d369aa900000000, 0x19ef9dca00000000, 0x7584956f00000000,
+ 0x515d920c00000000, 0xd73eb17600000000, 0xf3e7b61500000000,
+ 0x9f8cbeb000000000, 0xbb55b9d300000000, 0x065cdf2100000000,
+ 0x2285d84200000000, 0x4eeed0e700000000, 0x6a37d78400000000,
+ 0x75fb6dd800000000, 0x51226abb00000000, 0x3d49621e00000000,
+ 0x1990657d00000000, 0xa499038f00000000, 0x804004ec00000000,
+ 0xec2b0c4900000000, 0xc8f20b2a00000000, 0xd2b379f000000000,
+ 0xf66a7e9300000000, 0x9a01763600000000, 0xbed8715500000000,
+ 0x03d117a700000000, 0x270810c400000000, 0x4b63186100000000,
+ 0x6fba1f0200000000, 0x7076a55e00000000, 0x54afa23d00000000,
+ 0x38c4aa9800000000, 0x1c1dadfb00000000, 0xa114cb0900000000,
+ 0x85cdcc6a00000000, 0xe9a6c4cf00000000, 0xcd7fc3ac00000000,
+ 0x9c2251a000000000, 0xb8fb56c300000000, 0xd4905e6600000000,
+ 0xf049590500000000, 0x4d403ff700000000, 0x6999389400000000,
+ 0x05f2303100000000, 0x212b375200000000, 0x3ee78d0e00000000,
+ 0x1a3e8a6d00000000, 0x765582c800000000, 0x528c85ab00000000,
+ 0xef85e35900000000, 0xcb5ce43a00000000, 0xa737ec9f00000000,
+ 0x83eeebfc00000000, 0x99af992600000000, 0xbd769e4500000000,
+ 0xd11d96e000000000, 0xf5c4918300000000, 0x48cdf77100000000,
+ 0x6c14f01200000000, 0x007ff8b700000000, 0x24a6ffd400000000,
+ 0x3b6a458800000000, 0x1fb342eb00000000, 0x73d84a4e00000000,
+ 0x57014d2d00000000, 0xea082bdf00000000, 0xced12cbc00000000,
+ 0xa2ba241900000000, 0x8663237a00000000, 0xae7d62ed00000000,
+ 0x8aa4658e00000000, 0xe6cf6d2b00000000, 0xc2166a4800000000,
+ 0x7f1f0cba00000000, 0x5bc60bd900000000, 0x37ad037c00000000,
+ 0x1374041f00000000, 0x0cb8be4300000000, 0x2861b92000000000,
+ 0x440ab18500000000, 0x60d3b6e600000000, 0xdddad01400000000,
+ 0xf903d77700000000, 0x9568dfd200000000, 0xb1b1d8b100000000,
+ 0xabf0aa6b00000000, 0x8f29ad0800000000, 0xe342a5ad00000000,
+ 0xc79ba2ce00000000, 0x7a92c43c00000000, 0x5e4bc35f00000000,
+ 0x3220cbfa00000000, 0x16f9cc9900000000, 0x093576c500000000,
+ 0x2dec71a600000000, 0x4187790300000000, 0x655e7e6000000000,
+ 0xd857189200000000, 0xfc8e1ff100000000, 0x90e5175400000000,
+ 0xb43c103700000000, 0xe561823b00000000, 0xc1b8855800000000,
+ 0xadd38dfd00000000, 0x890a8a9e00000000, 0x3403ec6c00000000,
+ 0x10daeb0f00000000, 0x7cb1e3aa00000000, 0x5868e4c900000000,
+ 0x47a45e9500000000, 0x637d59f600000000, 0x0f16515300000000,
+ 0x2bcf563000000000, 0x96c630c200000000, 0xb21f37a100000000,
+ 0xde743f0400000000, 0xfaad386700000000, 0xe0ec4abd00000000,
+ 0xc4354dde00000000, 0xa85e457b00000000, 0x8c87421800000000,
+ 0x318e24ea00000000, 0x1557238900000000, 0x793c2b2c00000000,
+ 0x5de52c4f00000000, 0x4229961300000000, 0x66f0917000000000,
+ 0x0a9b99d500000000, 0x2e429eb600000000, 0x934bf84400000000,
+ 0xb792ff2700000000, 0xdbf9f78200000000, 0xff20f0e100000000,
+ 0x7943d39b00000000, 0x5d9ad4f800000000, 0x31f1dc5d00000000,
+ 0x1528db3e00000000, 0xa821bdcc00000000, 0x8cf8baaf00000000,
+ 0xe093b20a00000000, 0xc44ab56900000000, 0xdb860f3500000000,
+ 0xff5f085600000000, 0x933400f300000000, 0xb7ed079000000000,
+ 0x0ae4616200000000, 0x2e3d660100000000, 0x42566ea400000000,
+ 0x668f69c700000000, 0x7cce1b1d00000000, 0x58171c7e00000000,
+ 0x347c14db00000000, 0x10a513b800000000, 0xadac754a00000000,
+ 0x8975722900000000, 0xe51e7a8c00000000, 0xc1c77def00000000,
+ 0xde0bc7b300000000, 0xfad2c0d000000000, 0x96b9c87500000000,
+ 0xb260cf1600000000, 0x0f69a9e400000000, 0x2bb0ae8700000000,
+ 0x47dba62200000000, 0x6302a14100000000, 0x325f334d00000000,
+ 0x1686342e00000000, 0x7aed3c8b00000000, 0x5e343be800000000,
+ 0xe33d5d1a00000000, 0xc7e45a7900000000, 0xab8f52dc00000000,
+ 0x8f5655bf00000000, 0x909aefe300000000, 0xb443e88000000000,
+ 0xd828e02500000000, 0xfcf1e74600000000, 0x41f881b400000000,
+ 0x652186d700000000, 0x094a8e7200000000, 0x2d93891100000000,
+ 0x37d2fbcb00000000, 0x130bfca800000000, 0x7f60f40d00000000,
+ 0x5bb9f36e00000000, 0xe6b0959c00000000, 0xc26992ff00000000,
+ 0xae029a5a00000000, 0x8adb9d3900000000, 0x9517276500000000,
+ 0xb1ce200600000000, 0xdda528a300000000, 0xf97c2fc000000000,
+ 0x4475493200000000, 0x60ac4e5100000000, 0x0cc746f400000000,
+ 0x281e419700000000},
+ {0x0000000000000000, 0x08e3603c00000000, 0x10c6c17800000000,
+ 0x1825a14400000000, 0x208c83f100000000, 0x286fe3cd00000000,
+ 0x304a428900000000, 0x38a922b500000000, 0x011e763800000000,
+ 0x09fd160400000000, 0x11d8b74000000000, 0x193bd77c00000000,
+ 0x2192f5c900000000, 0x297195f500000000, 0x315434b100000000,
+ 0x39b7548d00000000, 0x023cec7000000000, 0x0adf8c4c00000000,
+ 0x12fa2d0800000000, 0x1a194d3400000000, 0x22b06f8100000000,
+ 0x2a530fbd00000000, 0x3276aef900000000, 0x3a95cec500000000,
+ 0x03229a4800000000, 0x0bc1fa7400000000, 0x13e45b3000000000,
+ 0x1b073b0c00000000, 0x23ae19b900000000, 0x2b4d798500000000,
+ 0x3368d8c100000000, 0x3b8bb8fd00000000, 0x0478d8e100000000,
+ 0x0c9bb8dd00000000, 0x14be199900000000, 0x1c5d79a500000000,
+ 0x24f45b1000000000, 0x2c173b2c00000000, 0x34329a6800000000,
+ 0x3cd1fa5400000000, 0x0566aed900000000, 0x0d85cee500000000,
+ 0x15a06fa100000000, 0x1d430f9d00000000, 0x25ea2d2800000000,
+ 0x2d094d1400000000, 0x352cec5000000000, 0x3dcf8c6c00000000,
+ 0x0644349100000000, 0x0ea754ad00000000, 0x1682f5e900000000,
+ 0x1e6195d500000000, 0x26c8b76000000000, 0x2e2bd75c00000000,
+ 0x360e761800000000, 0x3eed162400000000, 0x075a42a900000000,
+ 0x0fb9229500000000, 0x179c83d100000000, 0x1f7fe3ed00000000,
+ 0x27d6c15800000000, 0x2f35a16400000000, 0x3710002000000000,
+ 0x3ff3601c00000000, 0x49f6c11800000000, 0x4115a12400000000,
+ 0x5930006000000000, 0x51d3605c00000000, 0x697a42e900000000,
+ 0x619922d500000000, 0x79bc839100000000, 0x715fe3ad00000000,
+ 0x48e8b72000000000, 0x400bd71c00000000, 0x582e765800000000,
+ 0x50cd166400000000, 0x686434d100000000, 0x608754ed00000000,
+ 0x78a2f5a900000000, 0x7041959500000000, 0x4bca2d6800000000,
+ 0x43294d5400000000, 0x5b0cec1000000000, 0x53ef8c2c00000000,
+ 0x6b46ae9900000000, 0x63a5cea500000000, 0x7b806fe100000000,
+ 0x73630fdd00000000, 0x4ad45b5000000000, 0x42373b6c00000000,
+ 0x5a129a2800000000, 0x52f1fa1400000000, 0x6a58d8a100000000,
+ 0x62bbb89d00000000, 0x7a9e19d900000000, 0x727d79e500000000,
+ 0x4d8e19f900000000, 0x456d79c500000000, 0x5d48d88100000000,
+ 0x55abb8bd00000000, 0x6d029a0800000000, 0x65e1fa3400000000,
+ 0x7dc45b7000000000, 0x75273b4c00000000, 0x4c906fc100000000,
+ 0x44730ffd00000000, 0x5c56aeb900000000, 0x54b5ce8500000000,
+ 0x6c1cec3000000000, 0x64ff8c0c00000000, 0x7cda2d4800000000,
+ 0x74394d7400000000, 0x4fb2f58900000000, 0x475195b500000000,
+ 0x5f7434f100000000, 0x579754cd00000000, 0x6f3e767800000000,
+ 0x67dd164400000000, 0x7ff8b70000000000, 0x771bd73c00000000,
+ 0x4eac83b100000000, 0x464fe38d00000000, 0x5e6a42c900000000,
+ 0x568922f500000000, 0x6e20004000000000, 0x66c3607c00000000,
+ 0x7ee6c13800000000, 0x7605a10400000000, 0x92ec833100000000,
+ 0x9a0fe30d00000000, 0x822a424900000000, 0x8ac9227500000000,
+ 0xb26000c000000000, 0xba8360fc00000000, 0xa2a6c1b800000000,
+ 0xaa45a18400000000, 0x93f2f50900000000, 0x9b11953500000000,
+ 0x8334347100000000, 0x8bd7544d00000000, 0xb37e76f800000000,
+ 0xbb9d16c400000000, 0xa3b8b78000000000, 0xab5bd7bc00000000,
+ 0x90d06f4100000000, 0x98330f7d00000000, 0x8016ae3900000000,
+ 0x88f5ce0500000000, 0xb05cecb000000000, 0xb8bf8c8c00000000,
+ 0xa09a2dc800000000, 0xa8794df400000000, 0x91ce197900000000,
+ 0x992d794500000000, 0x8108d80100000000, 0x89ebb83d00000000,
+ 0xb1429a8800000000, 0xb9a1fab400000000, 0xa1845bf000000000,
+ 0xa9673bcc00000000, 0x96945bd000000000, 0x9e773bec00000000,
+ 0x86529aa800000000, 0x8eb1fa9400000000, 0xb618d82100000000,
+ 0xbefbb81d00000000, 0xa6de195900000000, 0xae3d796500000000,
+ 0x978a2de800000000, 0x9f694dd400000000, 0x874cec9000000000,
+ 0x8faf8cac00000000, 0xb706ae1900000000, 0xbfe5ce2500000000,
+ 0xa7c06f6100000000, 0xaf230f5d00000000, 0x94a8b7a000000000,
+ 0x9c4bd79c00000000, 0x846e76d800000000, 0x8c8d16e400000000,
+ 0xb424345100000000, 0xbcc7546d00000000, 0xa4e2f52900000000,
+ 0xac01951500000000, 0x95b6c19800000000, 0x9d55a1a400000000,
+ 0x857000e000000000, 0x8d9360dc00000000, 0xb53a426900000000,
+ 0xbdd9225500000000, 0xa5fc831100000000, 0xad1fe32d00000000,
+ 0xdb1a422900000000, 0xd3f9221500000000, 0xcbdc835100000000,
+ 0xc33fe36d00000000, 0xfb96c1d800000000, 0xf375a1e400000000,
+ 0xeb5000a000000000, 0xe3b3609c00000000, 0xda04341100000000,
+ 0xd2e7542d00000000, 0xcac2f56900000000, 0xc221955500000000,
+ 0xfa88b7e000000000, 0xf26bd7dc00000000, 0xea4e769800000000,
+ 0xe2ad16a400000000, 0xd926ae5900000000, 0xd1c5ce6500000000,
+ 0xc9e06f2100000000, 0xc1030f1d00000000, 0xf9aa2da800000000,
+ 0xf1494d9400000000, 0xe96cecd000000000, 0xe18f8cec00000000,
+ 0xd838d86100000000, 0xd0dbb85d00000000, 0xc8fe191900000000,
+ 0xc01d792500000000, 0xf8b45b9000000000, 0xf0573bac00000000,
+ 0xe8729ae800000000, 0xe091fad400000000, 0xdf629ac800000000,
+ 0xd781faf400000000, 0xcfa45bb000000000, 0xc7473b8c00000000,
+ 0xffee193900000000, 0xf70d790500000000, 0xef28d84100000000,
+ 0xe7cbb87d00000000, 0xde7cecf000000000, 0xd69f8ccc00000000,
+ 0xceba2d8800000000, 0xc6594db400000000, 0xfef06f0100000000,
+ 0xf6130f3d00000000, 0xee36ae7900000000, 0xe6d5ce4500000000,
+ 0xdd5e76b800000000, 0xd5bd168400000000, 0xcd98b7c000000000,
+ 0xc57bd7fc00000000, 0xfdd2f54900000000, 0xf531957500000000,
+ 0xed14343100000000, 0xe5f7540d00000000, 0xdc40008000000000,
+ 0xd4a360bc00000000, 0xcc86c1f800000000, 0xc465a1c400000000,
+ 0xfccc837100000000, 0xf42fe34d00000000, 0xec0a420900000000,
+ 0xe4e9223500000000},
+ {0x0000000000000000, 0xd1e8e70e00000000, 0xa2d1cf1d00000000,
+ 0x7339281300000000, 0x44a39f3b00000000, 0x954b783500000000,
+ 0xe672502600000000, 0x379ab72800000000, 0x88463f7700000000,
+ 0x59aed87900000000, 0x2a97f06a00000000, 0xfb7f176400000000,
+ 0xcce5a04c00000000, 0x1d0d474200000000, 0x6e346f5100000000,
+ 0xbfdc885f00000000, 0x108d7eee00000000, 0xc16599e000000000,
+ 0xb25cb1f300000000, 0x63b456fd00000000, 0x542ee1d500000000,
+ 0x85c606db00000000, 0xf6ff2ec800000000, 0x2717c9c600000000,
+ 0x98cb419900000000, 0x4923a69700000000, 0x3a1a8e8400000000,
+ 0xebf2698a00000000, 0xdc68dea200000000, 0x0d8039ac00000000,
+ 0x7eb911bf00000000, 0xaf51f6b100000000, 0x611c8c0700000000,
+ 0xb0f46b0900000000, 0xc3cd431a00000000, 0x1225a41400000000,
+ 0x25bf133c00000000, 0xf457f43200000000, 0x876edc2100000000,
+ 0x56863b2f00000000, 0xe95ab37000000000, 0x38b2547e00000000,
+ 0x4b8b7c6d00000000, 0x9a639b6300000000, 0xadf92c4b00000000,
+ 0x7c11cb4500000000, 0x0f28e35600000000, 0xdec0045800000000,
+ 0x7191f2e900000000, 0xa07915e700000000, 0xd3403df400000000,
+ 0x02a8dafa00000000, 0x35326dd200000000, 0xe4da8adc00000000,
+ 0x97e3a2cf00000000, 0x460b45c100000000, 0xf9d7cd9e00000000,
+ 0x283f2a9000000000, 0x5b06028300000000, 0x8aeee58d00000000,
+ 0xbd7452a500000000, 0x6c9cb5ab00000000, 0x1fa59db800000000,
+ 0xce4d7ab600000000, 0xc238180f00000000, 0x13d0ff0100000000,
+ 0x60e9d71200000000, 0xb101301c00000000, 0x869b873400000000,
+ 0x5773603a00000000, 0x244a482900000000, 0xf5a2af2700000000,
+ 0x4a7e277800000000, 0x9b96c07600000000, 0xe8afe86500000000,
+ 0x39470f6b00000000, 0x0eddb84300000000, 0xdf355f4d00000000,
+ 0xac0c775e00000000, 0x7de4905000000000, 0xd2b566e100000000,
+ 0x035d81ef00000000, 0x7064a9fc00000000, 0xa18c4ef200000000,
+ 0x9616f9da00000000, 0x47fe1ed400000000, 0x34c736c700000000,
+ 0xe52fd1c900000000, 0x5af3599600000000, 0x8b1bbe9800000000,
+ 0xf822968b00000000, 0x29ca718500000000, 0x1e50c6ad00000000,
+ 0xcfb821a300000000, 0xbc8109b000000000, 0x6d69eebe00000000,
+ 0xa324940800000000, 0x72cc730600000000, 0x01f55b1500000000,
+ 0xd01dbc1b00000000, 0xe7870b3300000000, 0x366fec3d00000000,
+ 0x4556c42e00000000, 0x94be232000000000, 0x2b62ab7f00000000,
+ 0xfa8a4c7100000000, 0x89b3646200000000, 0x585b836c00000000,
+ 0x6fc1344400000000, 0xbe29d34a00000000, 0xcd10fb5900000000,
+ 0x1cf81c5700000000, 0xb3a9eae600000000, 0x62410de800000000,
+ 0x117825fb00000000, 0xc090c2f500000000, 0xf70a75dd00000000,
+ 0x26e292d300000000, 0x55dbbac000000000, 0x84335dce00000000,
+ 0x3befd59100000000, 0xea07329f00000000, 0x993e1a8c00000000,
+ 0x48d6fd8200000000, 0x7f4c4aaa00000000, 0xaea4ada400000000,
+ 0xdd9d85b700000000, 0x0c7562b900000000, 0x8471301e00000000,
+ 0x5599d71000000000, 0x26a0ff0300000000, 0xf748180d00000000,
+ 0xc0d2af2500000000, 0x113a482b00000000, 0x6203603800000000,
+ 0xb3eb873600000000, 0x0c370f6900000000, 0xdddfe86700000000,
+ 0xaee6c07400000000, 0x7f0e277a00000000, 0x4894905200000000,
+ 0x997c775c00000000, 0xea455f4f00000000, 0x3badb84100000000,
+ 0x94fc4ef000000000, 0x4514a9fe00000000, 0x362d81ed00000000,
+ 0xe7c566e300000000, 0xd05fd1cb00000000, 0x01b736c500000000,
+ 0x728e1ed600000000, 0xa366f9d800000000, 0x1cba718700000000,
+ 0xcd52968900000000, 0xbe6bbe9a00000000, 0x6f83599400000000,
+ 0x5819eebc00000000, 0x89f109b200000000, 0xfac821a100000000,
+ 0x2b20c6af00000000, 0xe56dbc1900000000, 0x34855b1700000000,
+ 0x47bc730400000000, 0x9654940a00000000, 0xa1ce232200000000,
+ 0x7026c42c00000000, 0x031fec3f00000000, 0xd2f70b3100000000,
+ 0x6d2b836e00000000, 0xbcc3646000000000, 0xcffa4c7300000000,
+ 0x1e12ab7d00000000, 0x29881c5500000000, 0xf860fb5b00000000,
+ 0x8b59d34800000000, 0x5ab1344600000000, 0xf5e0c2f700000000,
+ 0x240825f900000000, 0x57310dea00000000, 0x86d9eae400000000,
+ 0xb1435dcc00000000, 0x60abbac200000000, 0x139292d100000000,
+ 0xc27a75df00000000, 0x7da6fd8000000000, 0xac4e1a8e00000000,
+ 0xdf77329d00000000, 0x0e9fd59300000000, 0x390562bb00000000,
+ 0xe8ed85b500000000, 0x9bd4ada600000000, 0x4a3c4aa800000000,
+ 0x4649281100000000, 0x97a1cf1f00000000, 0xe498e70c00000000,
+ 0x3570000200000000, 0x02eab72a00000000, 0xd302502400000000,
+ 0xa03b783700000000, 0x71d39f3900000000, 0xce0f176600000000,
+ 0x1fe7f06800000000, 0x6cded87b00000000, 0xbd363f7500000000,
+ 0x8aac885d00000000, 0x5b446f5300000000, 0x287d474000000000,
+ 0xf995a04e00000000, 0x56c456ff00000000, 0x872cb1f100000000,
+ 0xf41599e200000000, 0x25fd7eec00000000, 0x1267c9c400000000,
+ 0xc38f2eca00000000, 0xb0b606d900000000, 0x615ee1d700000000,
+ 0xde82698800000000, 0x0f6a8e8600000000, 0x7c53a69500000000,
+ 0xadbb419b00000000, 0x9a21f6b300000000, 0x4bc911bd00000000,
+ 0x38f039ae00000000, 0xe918dea000000000, 0x2755a41600000000,
+ 0xf6bd431800000000, 0x85846b0b00000000, 0x546c8c0500000000,
+ 0x63f63b2d00000000, 0xb21edc2300000000, 0xc127f43000000000,
+ 0x10cf133e00000000, 0xaf139b6100000000, 0x7efb7c6f00000000,
+ 0x0dc2547c00000000, 0xdc2ab37200000000, 0xebb0045a00000000,
+ 0x3a58e35400000000, 0x4961cb4700000000, 0x98892c4900000000,
+ 0x37d8daf800000000, 0xe6303df600000000, 0x950915e500000000,
+ 0x44e1f2eb00000000, 0x737b45c300000000, 0xa293a2cd00000000,
+ 0xd1aa8ade00000000, 0x00426dd000000000, 0xbf9ee58f00000000,
+ 0x6e76028100000000, 0x1d4f2a9200000000, 0xcca7cd9c00000000,
+ 0xfb3d7ab400000000, 0x2ad59dba00000000, 0x59ecb5a900000000,
+ 0x880452a700000000},
+ {0x0000000000000000, 0xaa05daf100000000, 0x150dc53800000000,
+ 0xbf081fc900000000, 0x2a1a8a7100000000, 0x801f508000000000,
+ 0x3f174f4900000000, 0x951295b800000000, 0x543414e300000000,
+ 0xfe31ce1200000000, 0x4139d1db00000000, 0xeb3c0b2a00000000,
+ 0x7e2e9e9200000000, 0xd42b446300000000, 0x6b235baa00000000,
+ 0xc126815b00000000, 0xe96e591d00000000, 0x436b83ec00000000,
+ 0xfc639c2500000000, 0x566646d400000000, 0xc374d36c00000000,
+ 0x6971099d00000000, 0xd679165400000000, 0x7c7ccca500000000,
+ 0xbd5a4dfe00000000, 0x175f970f00000000, 0xa85788c600000000,
+ 0x0252523700000000, 0x9740c78f00000000, 0x3d451d7e00000000,
+ 0x824d02b700000000, 0x2848d84600000000, 0xd2ddb23a00000000,
+ 0x78d868cb00000000, 0xc7d0770200000000, 0x6dd5adf300000000,
+ 0xf8c7384b00000000, 0x52c2e2ba00000000, 0xedcafd7300000000,
+ 0x47cf278200000000, 0x86e9a6d900000000, 0x2cec7c2800000000,
+ 0x93e463e100000000, 0x39e1b91000000000, 0xacf32ca800000000,
+ 0x06f6f65900000000, 0xb9fee99000000000, 0x13fb336100000000,
+ 0x3bb3eb2700000000, 0x91b631d600000000, 0x2ebe2e1f00000000,
+ 0x84bbf4ee00000000, 0x11a9615600000000, 0xbbacbba700000000,
+ 0x04a4a46e00000000, 0xaea17e9f00000000, 0x6f87ffc400000000,
+ 0xc582253500000000, 0x7a8a3afc00000000, 0xd08fe00d00000000,
+ 0x459d75b500000000, 0xef98af4400000000, 0x5090b08d00000000,
+ 0xfa956a7c00000000, 0xa4bb657500000000, 0x0ebebf8400000000,
+ 0xb1b6a04d00000000, 0x1bb37abc00000000, 0x8ea1ef0400000000,
+ 0x24a435f500000000, 0x9bac2a3c00000000, 0x31a9f0cd00000000,
+ 0xf08f719600000000, 0x5a8aab6700000000, 0xe582b4ae00000000,
+ 0x4f876e5f00000000, 0xda95fbe700000000, 0x7090211600000000,
+ 0xcf983edf00000000, 0x659de42e00000000, 0x4dd53c6800000000,
+ 0xe7d0e69900000000, 0x58d8f95000000000, 0xf2dd23a100000000,
+ 0x67cfb61900000000, 0xcdca6ce800000000, 0x72c2732100000000,
+ 0xd8c7a9d000000000, 0x19e1288b00000000, 0xb3e4f27a00000000,
+ 0x0cecedb300000000, 0xa6e9374200000000, 0x33fba2fa00000000,
+ 0x99fe780b00000000, 0x26f667c200000000, 0x8cf3bd3300000000,
+ 0x7666d74f00000000, 0xdc630dbe00000000, 0x636b127700000000,
+ 0xc96ec88600000000, 0x5c7c5d3e00000000, 0xf67987cf00000000,
+ 0x4971980600000000, 0xe37442f700000000, 0x2252c3ac00000000,
+ 0x8857195d00000000, 0x375f069400000000, 0x9d5adc6500000000,
+ 0x084849dd00000000, 0xa24d932c00000000, 0x1d458ce500000000,
+ 0xb740561400000000, 0x9f088e5200000000, 0x350d54a300000000,
+ 0x8a054b6a00000000, 0x2000919b00000000, 0xb512042300000000,
+ 0x1f17ded200000000, 0xa01fc11b00000000, 0x0a1a1bea00000000,
+ 0xcb3c9ab100000000, 0x6139404000000000, 0xde315f8900000000,
+ 0x7434857800000000, 0xe12610c000000000, 0x4b23ca3100000000,
+ 0xf42bd5f800000000, 0x5e2e0f0900000000, 0x4877cbea00000000,
+ 0xe272111b00000000, 0x5d7a0ed200000000, 0xf77fd42300000000,
+ 0x626d419b00000000, 0xc8689b6a00000000, 0x776084a300000000,
+ 0xdd655e5200000000, 0x1c43df0900000000, 0xb64605f800000000,
+ 0x094e1a3100000000, 0xa34bc0c000000000, 0x3659557800000000,
+ 0x9c5c8f8900000000, 0x2354904000000000, 0x89514ab100000000,
+ 0xa11992f700000000, 0x0b1c480600000000, 0xb41457cf00000000,
+ 0x1e118d3e00000000, 0x8b03188600000000, 0x2106c27700000000,
+ 0x9e0eddbe00000000, 0x340b074f00000000, 0xf52d861400000000,
+ 0x5f285ce500000000, 0xe020432c00000000, 0x4a2599dd00000000,
+ 0xdf370c6500000000, 0x7532d69400000000, 0xca3ac95d00000000,
+ 0x603f13ac00000000, 0x9aaa79d000000000, 0x30afa32100000000,
+ 0x8fa7bce800000000, 0x25a2661900000000, 0xb0b0f3a100000000,
+ 0x1ab5295000000000, 0xa5bd369900000000, 0x0fb8ec6800000000,
+ 0xce9e6d3300000000, 0x649bb7c200000000, 0xdb93a80b00000000,
+ 0x719672fa00000000, 0xe484e74200000000, 0x4e813db300000000,
+ 0xf189227a00000000, 0x5b8cf88b00000000, 0x73c420cd00000000,
+ 0xd9c1fa3c00000000, 0x66c9e5f500000000, 0xcccc3f0400000000,
+ 0x59deaabc00000000, 0xf3db704d00000000, 0x4cd36f8400000000,
+ 0xe6d6b57500000000, 0x27f0342e00000000, 0x8df5eedf00000000,
+ 0x32fdf11600000000, 0x98f82be700000000, 0x0deabe5f00000000,
+ 0xa7ef64ae00000000, 0x18e77b6700000000, 0xb2e2a19600000000,
+ 0xecccae9f00000000, 0x46c9746e00000000, 0xf9c16ba700000000,
+ 0x53c4b15600000000, 0xc6d624ee00000000, 0x6cd3fe1f00000000,
+ 0xd3dbe1d600000000, 0x79de3b2700000000, 0xb8f8ba7c00000000,
+ 0x12fd608d00000000, 0xadf57f4400000000, 0x07f0a5b500000000,
+ 0x92e2300d00000000, 0x38e7eafc00000000, 0x87eff53500000000,
+ 0x2dea2fc400000000, 0x05a2f78200000000, 0xafa72d7300000000,
+ 0x10af32ba00000000, 0xbaaae84b00000000, 0x2fb87df300000000,
+ 0x85bda70200000000, 0x3ab5b8cb00000000, 0x90b0623a00000000,
+ 0x5196e36100000000, 0xfb93399000000000, 0x449b265900000000,
+ 0xee9efca800000000, 0x7b8c691000000000, 0xd189b3e100000000,
+ 0x6e81ac2800000000, 0xc48476d900000000, 0x3e111ca500000000,
+ 0x9414c65400000000, 0x2b1cd99d00000000, 0x8119036c00000000,
+ 0x140b96d400000000, 0xbe0e4c2500000000, 0x010653ec00000000,
+ 0xab03891d00000000, 0x6a25084600000000, 0xc020d2b700000000,
+ 0x7f28cd7e00000000, 0xd52d178f00000000, 0x403f823700000000,
+ 0xea3a58c600000000, 0x5532470f00000000, 0xff379dfe00000000,
+ 0xd77f45b800000000, 0x7d7a9f4900000000, 0xc272808000000000,
+ 0x68775a7100000000, 0xfd65cfc900000000, 0x5760153800000000,
+ 0xe8680af100000000, 0x426dd00000000000, 0x834b515b00000000,
+ 0x294e8baa00000000, 0x9646946300000000, 0x3c434e9200000000,
+ 0xa951db2a00000000, 0x035401db00000000, 0xbc5c1e1200000000,
+ 0x1659c4e300000000}};
+
+#else /* W == 4 */
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0xae689191, 0x87a02563, 0x29c8b4f2, 0xd4314c87,
+ 0x7a59dd16, 0x539169e4, 0xfdf9f875, 0x73139f4f, 0xdd7b0ede,
+ 0xf4b3ba2c, 0x5adb2bbd, 0xa722d3c8, 0x094a4259, 0x2082f6ab,
+ 0x8eea673a, 0xe6273e9e, 0x484faf0f, 0x61871bfd, 0xcfef8a6c,
+ 0x32167219, 0x9c7ee388, 0xb5b6577a, 0x1bdec6eb, 0x9534a1d1,
+ 0x3b5c3040, 0x129484b2, 0xbcfc1523, 0x4105ed56, 0xef6d7cc7,
+ 0xc6a5c835, 0x68cd59a4, 0x173f7b7d, 0xb957eaec, 0x909f5e1e,
+ 0x3ef7cf8f, 0xc30e37fa, 0x6d66a66b, 0x44ae1299, 0xeac68308,
+ 0x642ce432, 0xca4475a3, 0xe38cc151, 0x4de450c0, 0xb01da8b5,
+ 0x1e753924, 0x37bd8dd6, 0x99d51c47, 0xf11845e3, 0x5f70d472,
+ 0x76b86080, 0xd8d0f111, 0x25290964, 0x8b4198f5, 0xa2892c07,
+ 0x0ce1bd96, 0x820bdaac, 0x2c634b3d, 0x05abffcf, 0xabc36e5e,
+ 0x563a962b, 0xf85207ba, 0xd19ab348, 0x7ff222d9, 0x2e7ef6fa,
+ 0x8016676b, 0xa9ded399, 0x07b64208, 0xfa4fba7d, 0x54272bec,
+ 0x7def9f1e, 0xd3870e8f, 0x5d6d69b5, 0xf305f824, 0xdacd4cd6,
+ 0x74a5dd47, 0x895c2532, 0x2734b4a3, 0x0efc0051, 0xa09491c0,
+ 0xc859c864, 0x663159f5, 0x4ff9ed07, 0xe1917c96, 0x1c6884e3,
+ 0xb2001572, 0x9bc8a180, 0x35a03011, 0xbb4a572b, 0x1522c6ba,
+ 0x3cea7248, 0x9282e3d9, 0x6f7b1bac, 0xc1138a3d, 0xe8db3ecf,
+ 0x46b3af5e, 0x39418d87, 0x97291c16, 0xbee1a8e4, 0x10893975,
+ 0xed70c100, 0x43185091, 0x6ad0e463, 0xc4b875f2, 0x4a5212c8,
+ 0xe43a8359, 0xcdf237ab, 0x639aa63a, 0x9e635e4f, 0x300bcfde,
+ 0x19c37b2c, 0xb7abeabd, 0xdf66b319, 0x710e2288, 0x58c6967a,
+ 0xf6ae07eb, 0x0b57ff9e, 0xa53f6e0f, 0x8cf7dafd, 0x229f4b6c,
+ 0xac752c56, 0x021dbdc7, 0x2bd50935, 0x85bd98a4, 0x784460d1,
+ 0xd62cf140, 0xffe445b2, 0x518cd423, 0x5cfdedf4, 0xf2957c65,
+ 0xdb5dc897, 0x75355906, 0x88cca173, 0x26a430e2, 0x0f6c8410,
+ 0xa1041581, 0x2fee72bb, 0x8186e32a, 0xa84e57d8, 0x0626c649,
+ 0xfbdf3e3c, 0x55b7afad, 0x7c7f1b5f, 0xd2178ace, 0xbadad36a,
+ 0x14b242fb, 0x3d7af609, 0x93126798, 0x6eeb9fed, 0xc0830e7c,
+ 0xe94bba8e, 0x47232b1f, 0xc9c94c25, 0x67a1ddb4, 0x4e696946,
+ 0xe001f8d7, 0x1df800a2, 0xb3909133, 0x9a5825c1, 0x3430b450,
+ 0x4bc29689, 0xe5aa0718, 0xcc62b3ea, 0x620a227b, 0x9ff3da0e,
+ 0x319b4b9f, 0x1853ff6d, 0xb63b6efc, 0x38d109c6, 0x96b99857,
+ 0xbf712ca5, 0x1119bd34, 0xece04541, 0x4288d4d0, 0x6b406022,
+ 0xc528f1b3, 0xade5a817, 0x038d3986, 0x2a458d74, 0x842d1ce5,
+ 0x79d4e490, 0xd7bc7501, 0xfe74c1f3, 0x501c5062, 0xdef63758,
+ 0x709ea6c9, 0x5956123b, 0xf73e83aa, 0x0ac77bdf, 0xa4afea4e,
+ 0x8d675ebc, 0x230fcf2d, 0x72831b0e, 0xdceb8a9f, 0xf5233e6d,
+ 0x5b4baffc, 0xa6b25789, 0x08dac618, 0x211272ea, 0x8f7ae37b,
+ 0x01908441, 0xaff815d0, 0x8630a122, 0x285830b3, 0xd5a1c8c6,
+ 0x7bc95957, 0x5201eda5, 0xfc697c34, 0x94a42590, 0x3accb401,
+ 0x130400f3, 0xbd6c9162, 0x40956917, 0xeefdf886, 0xc7354c74,
+ 0x695ddde5, 0xe7b7badf, 0x49df2b4e, 0x60179fbc, 0xce7f0e2d,
+ 0x3386f658, 0x9dee67c9, 0xb426d33b, 0x1a4e42aa, 0x65bc6073,
+ 0xcbd4f1e2, 0xe21c4510, 0x4c74d481, 0xb18d2cf4, 0x1fe5bd65,
+ 0x362d0997, 0x98459806, 0x16afff3c, 0xb8c76ead, 0x910fda5f,
+ 0x3f674bce, 0xc29eb3bb, 0x6cf6222a, 0x453e96d8, 0xeb560749,
+ 0x839b5eed, 0x2df3cf7c, 0x043b7b8e, 0xaa53ea1f, 0x57aa126a,
+ 0xf9c283fb, 0xd00a3709, 0x7e62a698, 0xf088c1a2, 0x5ee05033,
+ 0x7728e4c1, 0xd9407550, 0x24b98d25, 0x8ad11cb4, 0xa319a846,
+ 0x0d7139d7},
+ {0x00000000, 0xb9fbdbe8, 0xa886b191, 0x117d6a79, 0x8a7c6563,
+ 0x3387be8b, 0x22fad4f2, 0x9b010f1a, 0xcf89cc87, 0x7672176f,
+ 0x670f7d16, 0xdef4a6fe, 0x45f5a9e4, 0xfc0e720c, 0xed731875,
+ 0x5488c39d, 0x44629f4f, 0xfd9944a7, 0xece42ede, 0x551ff536,
+ 0xce1efa2c, 0x77e521c4, 0x66984bbd, 0xdf639055, 0x8beb53c8,
+ 0x32108820, 0x236de259, 0x9a9639b1, 0x019736ab, 0xb86ced43,
+ 0xa911873a, 0x10ea5cd2, 0x88c53e9e, 0x313ee576, 0x20438f0f,
+ 0x99b854e7, 0x02b95bfd, 0xbb428015, 0xaa3fea6c, 0x13c43184,
+ 0x474cf219, 0xfeb729f1, 0xefca4388, 0x56319860, 0xcd30977a,
+ 0x74cb4c92, 0x65b626eb, 0xdc4dfd03, 0xcca7a1d1, 0x755c7a39,
+ 0x64211040, 0xdddacba8, 0x46dbc4b2, 0xff201f5a, 0xee5d7523,
+ 0x57a6aecb, 0x032e6d56, 0xbad5b6be, 0xaba8dcc7, 0x1253072f,
+ 0x89520835, 0x30a9d3dd, 0x21d4b9a4, 0x982f624c, 0xcafb7b7d,
+ 0x7300a095, 0x627dcaec, 0xdb861104, 0x40871e1e, 0xf97cc5f6,
+ 0xe801af8f, 0x51fa7467, 0x0572b7fa, 0xbc896c12, 0xadf4066b,
+ 0x140fdd83, 0x8f0ed299, 0x36f50971, 0x27886308, 0x9e73b8e0,
+ 0x8e99e432, 0x37623fda, 0x261f55a3, 0x9fe48e4b, 0x04e58151,
+ 0xbd1e5ab9, 0xac6330c0, 0x1598eb28, 0x411028b5, 0xf8ebf35d,
+ 0xe9969924, 0x506d42cc, 0xcb6c4dd6, 0x7297963e, 0x63eafc47,
+ 0xda1127af, 0x423e45e3, 0xfbc59e0b, 0xeab8f472, 0x53432f9a,
+ 0xc8422080, 0x71b9fb68, 0x60c49111, 0xd93f4af9, 0x8db78964,
+ 0x344c528c, 0x253138f5, 0x9ccae31d, 0x07cbec07, 0xbe3037ef,
+ 0xaf4d5d96, 0x16b6867e, 0x065cdaac, 0xbfa70144, 0xaeda6b3d,
+ 0x1721b0d5, 0x8c20bfcf, 0x35db6427, 0x24a60e5e, 0x9d5dd5b6,
+ 0xc9d5162b, 0x702ecdc3, 0x6153a7ba, 0xd8a87c52, 0x43a97348,
+ 0xfa52a8a0, 0xeb2fc2d9, 0x52d41931, 0x4e87f0bb, 0xf77c2b53,
+ 0xe601412a, 0x5ffa9ac2, 0xc4fb95d8, 0x7d004e30, 0x6c7d2449,
+ 0xd586ffa1, 0x810e3c3c, 0x38f5e7d4, 0x29888dad, 0x90735645,
+ 0x0b72595f, 0xb28982b7, 0xa3f4e8ce, 0x1a0f3326, 0x0ae56ff4,
+ 0xb31eb41c, 0xa263de65, 0x1b98058d, 0x80990a97, 0x3962d17f,
+ 0x281fbb06, 0x91e460ee, 0xc56ca373, 0x7c97789b, 0x6dea12e2,
+ 0xd411c90a, 0x4f10c610, 0xf6eb1df8, 0xe7967781, 0x5e6dac69,
+ 0xc642ce25, 0x7fb915cd, 0x6ec47fb4, 0xd73fa45c, 0x4c3eab46,
+ 0xf5c570ae, 0xe4b81ad7, 0x5d43c13f, 0x09cb02a2, 0xb030d94a,
+ 0xa14db333, 0x18b668db, 0x83b767c1, 0x3a4cbc29, 0x2b31d650,
+ 0x92ca0db8, 0x8220516a, 0x3bdb8a82, 0x2aa6e0fb, 0x935d3b13,
+ 0x085c3409, 0xb1a7efe1, 0xa0da8598, 0x19215e70, 0x4da99ded,
+ 0xf4524605, 0xe52f2c7c, 0x5cd4f794, 0xc7d5f88e, 0x7e2e2366,
+ 0x6f53491f, 0xd6a892f7, 0x847c8bc6, 0x3d87502e, 0x2cfa3a57,
+ 0x9501e1bf, 0x0e00eea5, 0xb7fb354d, 0xa6865f34, 0x1f7d84dc,
+ 0x4bf54741, 0xf20e9ca9, 0xe373f6d0, 0x5a882d38, 0xc1892222,
+ 0x7872f9ca, 0x690f93b3, 0xd0f4485b, 0xc01e1489, 0x79e5cf61,
+ 0x6898a518, 0xd1637ef0, 0x4a6271ea, 0xf399aa02, 0xe2e4c07b,
+ 0x5b1f1b93, 0x0f97d80e, 0xb66c03e6, 0xa711699f, 0x1eeab277,
+ 0x85ebbd6d, 0x3c106685, 0x2d6d0cfc, 0x9496d714, 0x0cb9b558,
+ 0xb5426eb0, 0xa43f04c9, 0x1dc4df21, 0x86c5d03b, 0x3f3e0bd3,
+ 0x2e4361aa, 0x97b8ba42, 0xc33079df, 0x7acba237, 0x6bb6c84e,
+ 0xd24d13a6, 0x494c1cbc, 0xf0b7c754, 0xe1caad2d, 0x583176c5,
+ 0x48db2a17, 0xf120f1ff, 0xe05d9b86, 0x59a6406e, 0xc2a74f74,
+ 0x7b5c949c, 0x6a21fee5, 0xd3da250d, 0x8752e690, 0x3ea93d78,
+ 0x2fd45701, 0x962f8ce9, 0x0d2e83f3, 0xb4d5581b, 0xa5a83262,
+ 0x1c53e98a},
+ {0x00000000, 0x9d0fe176, 0xe16ec4ad, 0x7c6125db, 0x19ac8f1b,
+ 0x84a36e6d, 0xf8c24bb6, 0x65cdaac0, 0x33591e36, 0xae56ff40,
+ 0xd237da9b, 0x4f383bed, 0x2af5912d, 0xb7fa705b, 0xcb9b5580,
+ 0x5694b4f6, 0x66b23c6c, 0xfbbddd1a, 0x87dcf8c1, 0x1ad319b7,
+ 0x7f1eb377, 0xe2115201, 0x9e7077da, 0x037f96ac, 0x55eb225a,
+ 0xc8e4c32c, 0xb485e6f7, 0x298a0781, 0x4c47ad41, 0xd1484c37,
+ 0xad2969ec, 0x3026889a, 0xcd6478d8, 0x506b99ae, 0x2c0abc75,
+ 0xb1055d03, 0xd4c8f7c3, 0x49c716b5, 0x35a6336e, 0xa8a9d218,
+ 0xfe3d66ee, 0x63328798, 0x1f53a243, 0x825c4335, 0xe791e9f5,
+ 0x7a9e0883, 0x06ff2d58, 0x9bf0cc2e, 0xabd644b4, 0x36d9a5c2,
+ 0x4ab88019, 0xd7b7616f, 0xb27acbaf, 0x2f752ad9, 0x53140f02,
+ 0xce1bee74, 0x988f5a82, 0x0580bbf4, 0x79e19e2f, 0xe4ee7f59,
+ 0x8123d599, 0x1c2c34ef, 0x604d1134, 0xfd42f042, 0x41b9f7f1,
+ 0xdcb61687, 0xa0d7335c, 0x3dd8d22a, 0x581578ea, 0xc51a999c,
+ 0xb97bbc47, 0x24745d31, 0x72e0e9c7, 0xefef08b1, 0x938e2d6a,
+ 0x0e81cc1c, 0x6b4c66dc, 0xf64387aa, 0x8a22a271, 0x172d4307,
+ 0x270bcb9d, 0xba042aeb, 0xc6650f30, 0x5b6aee46, 0x3ea74486,
+ 0xa3a8a5f0, 0xdfc9802b, 0x42c6615d, 0x1452d5ab, 0x895d34dd,
+ 0xf53c1106, 0x6833f070, 0x0dfe5ab0, 0x90f1bbc6, 0xec909e1d,
+ 0x719f7f6b, 0x8cdd8f29, 0x11d26e5f, 0x6db34b84, 0xf0bcaaf2,
+ 0x95710032, 0x087ee144, 0x741fc49f, 0xe91025e9, 0xbf84911f,
+ 0x228b7069, 0x5eea55b2, 0xc3e5b4c4, 0xa6281e04, 0x3b27ff72,
+ 0x4746daa9, 0xda493bdf, 0xea6fb345, 0x77605233, 0x0b0177e8,
+ 0x960e969e, 0xf3c33c5e, 0x6eccdd28, 0x12adf8f3, 0x8fa21985,
+ 0xd936ad73, 0x44394c05, 0x385869de, 0xa55788a8, 0xc09a2268,
+ 0x5d95c31e, 0x21f4e6c5, 0xbcfb07b3, 0x8373efe2, 0x1e7c0e94,
+ 0x621d2b4f, 0xff12ca39, 0x9adf60f9, 0x07d0818f, 0x7bb1a454,
+ 0xe6be4522, 0xb02af1d4, 0x2d2510a2, 0x51443579, 0xcc4bd40f,
+ 0xa9867ecf, 0x34899fb9, 0x48e8ba62, 0xd5e75b14, 0xe5c1d38e,
+ 0x78ce32f8, 0x04af1723, 0x99a0f655, 0xfc6d5c95, 0x6162bde3,
+ 0x1d039838, 0x800c794e, 0xd698cdb8, 0x4b972cce, 0x37f60915,
+ 0xaaf9e863, 0xcf3442a3, 0x523ba3d5, 0x2e5a860e, 0xb3556778,
+ 0x4e17973a, 0xd318764c, 0xaf795397, 0x3276b2e1, 0x57bb1821,
+ 0xcab4f957, 0xb6d5dc8c, 0x2bda3dfa, 0x7d4e890c, 0xe041687a,
+ 0x9c204da1, 0x012facd7, 0x64e20617, 0xf9ede761, 0x858cc2ba,
+ 0x188323cc, 0x28a5ab56, 0xb5aa4a20, 0xc9cb6ffb, 0x54c48e8d,
+ 0x3109244d, 0xac06c53b, 0xd067e0e0, 0x4d680196, 0x1bfcb560,
+ 0x86f35416, 0xfa9271cd, 0x679d90bb, 0x02503a7b, 0x9f5fdb0d,
+ 0xe33efed6, 0x7e311fa0, 0xc2ca1813, 0x5fc5f965, 0x23a4dcbe,
+ 0xbeab3dc8, 0xdb669708, 0x4669767e, 0x3a0853a5, 0xa707b2d3,
+ 0xf1930625, 0x6c9ce753, 0x10fdc288, 0x8df223fe, 0xe83f893e,
+ 0x75306848, 0x09514d93, 0x945eace5, 0xa478247f, 0x3977c509,
+ 0x4516e0d2, 0xd81901a4, 0xbdd4ab64, 0x20db4a12, 0x5cba6fc9,
+ 0xc1b58ebf, 0x97213a49, 0x0a2edb3f, 0x764ffee4, 0xeb401f92,
+ 0x8e8db552, 0x13825424, 0x6fe371ff, 0xf2ec9089, 0x0fae60cb,
+ 0x92a181bd, 0xeec0a466, 0x73cf4510, 0x1602efd0, 0x8b0d0ea6,
+ 0xf76c2b7d, 0x6a63ca0b, 0x3cf77efd, 0xa1f89f8b, 0xdd99ba50,
+ 0x40965b26, 0x255bf1e6, 0xb8541090, 0xc435354b, 0x593ad43d,
+ 0x691c5ca7, 0xf413bdd1, 0x8872980a, 0x157d797c, 0x70b0d3bc,
+ 0xedbf32ca, 0x91de1711, 0x0cd1f667, 0x5a454291, 0xc74aa3e7,
+ 0xbb2b863c, 0x2624674a, 0x43e9cd8a, 0xdee62cfc, 0xa2870927,
+ 0x3f88e851},
+ {0x00000000, 0xdd96d985, 0x605cb54b, 0xbdca6cce, 0xc0b96a96,
+ 0x1d2fb313, 0xa0e5dfdd, 0x7d730658, 0x5a03d36d, 0x87950ae8,
+ 0x3a5f6626, 0xe7c9bfa3, 0x9abab9fb, 0x472c607e, 0xfae60cb0,
+ 0x2770d535, 0xb407a6da, 0x69917f5f, 0xd45b1391, 0x09cdca14,
+ 0x74becc4c, 0xa92815c9, 0x14e27907, 0xc974a082, 0xee0475b7,
+ 0x3392ac32, 0x8e58c0fc, 0x53ce1979, 0x2ebd1f21, 0xf32bc6a4,
+ 0x4ee1aa6a, 0x937773ef, 0xb37e4bf5, 0x6ee89270, 0xd322febe,
+ 0x0eb4273b, 0x73c72163, 0xae51f8e6, 0x139b9428, 0xce0d4dad,
+ 0xe97d9898, 0x34eb411d, 0x89212dd3, 0x54b7f456, 0x29c4f20e,
+ 0xf4522b8b, 0x49984745, 0x940e9ec0, 0x0779ed2f, 0xdaef34aa,
+ 0x67255864, 0xbab381e1, 0xc7c087b9, 0x1a565e3c, 0xa79c32f2,
+ 0x7a0aeb77, 0x5d7a3e42, 0x80ece7c7, 0x3d268b09, 0xe0b0528c,
+ 0x9dc354d4, 0x40558d51, 0xfd9fe19f, 0x2009381a, 0xbd8d91ab,
+ 0x601b482e, 0xddd124e0, 0x0047fd65, 0x7d34fb3d, 0xa0a222b8,
+ 0x1d684e76, 0xc0fe97f3, 0xe78e42c6, 0x3a189b43, 0x87d2f78d,
+ 0x5a442e08, 0x27372850, 0xfaa1f1d5, 0x476b9d1b, 0x9afd449e,
+ 0x098a3771, 0xd41ceef4, 0x69d6823a, 0xb4405bbf, 0xc9335de7,
+ 0x14a58462, 0xa96fe8ac, 0x74f93129, 0x5389e41c, 0x8e1f3d99,
+ 0x33d55157, 0xee4388d2, 0x93308e8a, 0x4ea6570f, 0xf36c3bc1,
+ 0x2efae244, 0x0ef3da5e, 0xd36503db, 0x6eaf6f15, 0xb339b690,
+ 0xce4ab0c8, 0x13dc694d, 0xae160583, 0x7380dc06, 0x54f00933,
+ 0x8966d0b6, 0x34acbc78, 0xe93a65fd, 0x944963a5, 0x49dfba20,
+ 0xf415d6ee, 0x29830f6b, 0xbaf47c84, 0x6762a501, 0xdaa8c9cf,
+ 0x073e104a, 0x7a4d1612, 0xa7dbcf97, 0x1a11a359, 0xc7877adc,
+ 0xe0f7afe9, 0x3d61766c, 0x80ab1aa2, 0x5d3dc327, 0x204ec57f,
+ 0xfdd81cfa, 0x40127034, 0x9d84a9b1, 0xa06a2517, 0x7dfcfc92,
+ 0xc036905c, 0x1da049d9, 0x60d34f81, 0xbd459604, 0x008ffaca,
+ 0xdd19234f, 0xfa69f67a, 0x27ff2fff, 0x9a354331, 0x47a39ab4,
+ 0x3ad09cec, 0xe7464569, 0x5a8c29a7, 0x871af022, 0x146d83cd,
+ 0xc9fb5a48, 0x74313686, 0xa9a7ef03, 0xd4d4e95b, 0x094230de,
+ 0xb4885c10, 0x691e8595, 0x4e6e50a0, 0x93f88925, 0x2e32e5eb,
+ 0xf3a43c6e, 0x8ed73a36, 0x5341e3b3, 0xee8b8f7d, 0x331d56f8,
+ 0x13146ee2, 0xce82b767, 0x7348dba9, 0xaede022c, 0xd3ad0474,
+ 0x0e3bddf1, 0xb3f1b13f, 0x6e6768ba, 0x4917bd8f, 0x9481640a,
+ 0x294b08c4, 0xf4ddd141, 0x89aed719, 0x54380e9c, 0xe9f26252,
+ 0x3464bbd7, 0xa713c838, 0x7a8511bd, 0xc74f7d73, 0x1ad9a4f6,
+ 0x67aaa2ae, 0xba3c7b2b, 0x07f617e5, 0xda60ce60, 0xfd101b55,
+ 0x2086c2d0, 0x9d4cae1e, 0x40da779b, 0x3da971c3, 0xe03fa846,
+ 0x5df5c488, 0x80631d0d, 0x1de7b4bc, 0xc0716d39, 0x7dbb01f7,
+ 0xa02dd872, 0xdd5ede2a, 0x00c807af, 0xbd026b61, 0x6094b2e4,
+ 0x47e467d1, 0x9a72be54, 0x27b8d29a, 0xfa2e0b1f, 0x875d0d47,
+ 0x5acbd4c2, 0xe701b80c, 0x3a976189, 0xa9e01266, 0x7476cbe3,
+ 0xc9bca72d, 0x142a7ea8, 0x695978f0, 0xb4cfa175, 0x0905cdbb,
+ 0xd493143e, 0xf3e3c10b, 0x2e75188e, 0x93bf7440, 0x4e29adc5,
+ 0x335aab9d, 0xeecc7218, 0x53061ed6, 0x8e90c753, 0xae99ff49,
+ 0x730f26cc, 0xcec54a02, 0x13539387, 0x6e2095df, 0xb3b64c5a,
+ 0x0e7c2094, 0xd3eaf911, 0xf49a2c24, 0x290cf5a1, 0x94c6996f,
+ 0x495040ea, 0x342346b2, 0xe9b59f37, 0x547ff3f9, 0x89e92a7c,
+ 0x1a9e5993, 0xc7088016, 0x7ac2ecd8, 0xa754355d, 0xda273305,
+ 0x07b1ea80, 0xba7b864e, 0x67ed5fcb, 0x409d8afe, 0x9d0b537b,
+ 0x20c13fb5, 0xfd57e630, 0x8024e068, 0x5db239ed, 0xe0785523,
+ 0x3dee8ca6}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x00000000, 0x85d996dd, 0x4bb55c60, 0xce6ccabd, 0x966ab9c0,
+ 0x13b32f1d, 0xdddfe5a0, 0x5806737d, 0x6dd3035a, 0xe80a9587,
+ 0x26665f3a, 0xa3bfc9e7, 0xfbb9ba9a, 0x7e602c47, 0xb00ce6fa,
+ 0x35d57027, 0xdaa607b4, 0x5f7f9169, 0x91135bd4, 0x14cacd09,
+ 0x4cccbe74, 0xc91528a9, 0x0779e214, 0x82a074c9, 0xb77504ee,
+ 0x32ac9233, 0xfcc0588e, 0x7919ce53, 0x211fbd2e, 0xa4c62bf3,
+ 0x6aaae14e, 0xef737793, 0xf54b7eb3, 0x7092e86e, 0xbefe22d3,
+ 0x3b27b40e, 0x6321c773, 0xe6f851ae, 0x28949b13, 0xad4d0dce,
+ 0x98987de9, 0x1d41eb34, 0xd32d2189, 0x56f4b754, 0x0ef2c429,
+ 0x8b2b52f4, 0x45479849, 0xc09e0e94, 0x2fed7907, 0xaa34efda,
+ 0x64582567, 0xe181b3ba, 0xb987c0c7, 0x3c5e561a, 0xf2329ca7,
+ 0x77eb0a7a, 0x423e7a5d, 0xc7e7ec80, 0x098b263d, 0x8c52b0e0,
+ 0xd454c39d, 0x518d5540, 0x9fe19ffd, 0x1a380920, 0xab918dbd,
+ 0x2e481b60, 0xe024d1dd, 0x65fd4700, 0x3dfb347d, 0xb822a2a0,
+ 0x764e681d, 0xf397fec0, 0xc6428ee7, 0x439b183a, 0x8df7d287,
+ 0x082e445a, 0x50283727, 0xd5f1a1fa, 0x1b9d6b47, 0x9e44fd9a,
+ 0x71378a09, 0xf4ee1cd4, 0x3a82d669, 0xbf5b40b4, 0xe75d33c9,
+ 0x6284a514, 0xace86fa9, 0x2931f974, 0x1ce48953, 0x993d1f8e,
+ 0x5751d533, 0xd28843ee, 0x8a8e3093, 0x0f57a64e, 0xc13b6cf3,
+ 0x44e2fa2e, 0x5edaf30e, 0xdb0365d3, 0x156faf6e, 0x90b639b3,
+ 0xc8b04ace, 0x4d69dc13, 0x830516ae, 0x06dc8073, 0x3309f054,
+ 0xb6d06689, 0x78bcac34, 0xfd653ae9, 0xa5634994, 0x20badf49,
+ 0xeed615f4, 0x6b0f8329, 0x847cf4ba, 0x01a56267, 0xcfc9a8da,
+ 0x4a103e07, 0x12164d7a, 0x97cfdba7, 0x59a3111a, 0xdc7a87c7,
+ 0xe9aff7e0, 0x6c76613d, 0xa21aab80, 0x27c33d5d, 0x7fc54e20,
+ 0xfa1cd8fd, 0x34701240, 0xb1a9849d, 0x17256aa0, 0x92fcfc7d,
+ 0x5c9036c0, 0xd949a01d, 0x814fd360, 0x049645bd, 0xcafa8f00,
+ 0x4f2319dd, 0x7af669fa, 0xff2fff27, 0x3143359a, 0xb49aa347,
+ 0xec9cd03a, 0x694546e7, 0xa7298c5a, 0x22f01a87, 0xcd836d14,
+ 0x485afbc9, 0x86363174, 0x03efa7a9, 0x5be9d4d4, 0xde304209,
+ 0x105c88b4, 0x95851e69, 0xa0506e4e, 0x2589f893, 0xebe5322e,
+ 0x6e3ca4f3, 0x363ad78e, 0xb3e34153, 0x7d8f8bee, 0xf8561d33,
+ 0xe26e1413, 0x67b782ce, 0xa9db4873, 0x2c02deae, 0x7404add3,
+ 0xf1dd3b0e, 0x3fb1f1b3, 0xba68676e, 0x8fbd1749, 0x0a648194,
+ 0xc4084b29, 0x41d1ddf4, 0x19d7ae89, 0x9c0e3854, 0x5262f2e9,
+ 0xd7bb6434, 0x38c813a7, 0xbd11857a, 0x737d4fc7, 0xf6a4d91a,
+ 0xaea2aa67, 0x2b7b3cba, 0xe517f607, 0x60ce60da, 0x551b10fd,
+ 0xd0c28620, 0x1eae4c9d, 0x9b77da40, 0xc371a93d, 0x46a83fe0,
+ 0x88c4f55d, 0x0d1d6380, 0xbcb4e71d, 0x396d71c0, 0xf701bb7d,
+ 0x72d82da0, 0x2ade5edd, 0xaf07c800, 0x616b02bd, 0xe4b29460,
+ 0xd167e447, 0x54be729a, 0x9ad2b827, 0x1f0b2efa, 0x470d5d87,
+ 0xc2d4cb5a, 0x0cb801e7, 0x8961973a, 0x6612e0a9, 0xe3cb7674,
+ 0x2da7bcc9, 0xa87e2a14, 0xf0785969, 0x75a1cfb4, 0xbbcd0509,
+ 0x3e1493d4, 0x0bc1e3f3, 0x8e18752e, 0x4074bf93, 0xc5ad294e,
+ 0x9dab5a33, 0x1872ccee, 0xd61e0653, 0x53c7908e, 0x49ff99ae,
+ 0xcc260f73, 0x024ac5ce, 0x87935313, 0xdf95206e, 0x5a4cb6b3,
+ 0x94207c0e, 0x11f9ead3, 0x242c9af4, 0xa1f50c29, 0x6f99c694,
+ 0xea405049, 0xb2462334, 0x379fb5e9, 0xf9f37f54, 0x7c2ae989,
+ 0x93599e1a, 0x168008c7, 0xd8ecc27a, 0x5d3554a7, 0x053327da,
+ 0x80eab107, 0x4e867bba, 0xcb5fed67, 0xfe8a9d40, 0x7b530b9d,
+ 0xb53fc120, 0x30e657fd, 0x68e02480, 0xed39b25d, 0x235578e0,
+ 0xa68cee3d},
+ {0x00000000, 0x76e10f9d, 0xadc46ee1, 0xdb25617c, 0x1b8fac19,
+ 0x6d6ea384, 0xb64bc2f8, 0xc0aacd65, 0x361e5933, 0x40ff56ae,
+ 0x9bda37d2, 0xed3b384f, 0x2d91f52a, 0x5b70fab7, 0x80559bcb,
+ 0xf6b49456, 0x6c3cb266, 0x1addbdfb, 0xc1f8dc87, 0xb719d31a,
+ 0x77b31e7f, 0x015211e2, 0xda77709e, 0xac967f03, 0x5a22eb55,
+ 0x2cc3e4c8, 0xf7e685b4, 0x81078a29, 0x41ad474c, 0x374c48d1,
+ 0xec6929ad, 0x9a882630, 0xd87864cd, 0xae996b50, 0x75bc0a2c,
+ 0x035d05b1, 0xc3f7c8d4, 0xb516c749, 0x6e33a635, 0x18d2a9a8,
+ 0xee663dfe, 0x98873263, 0x43a2531f, 0x35435c82, 0xf5e991e7,
+ 0x83089e7a, 0x582dff06, 0x2eccf09b, 0xb444d6ab, 0xc2a5d936,
+ 0x1980b84a, 0x6f61b7d7, 0xafcb7ab2, 0xd92a752f, 0x020f1453,
+ 0x74ee1bce, 0x825a8f98, 0xf4bb8005, 0x2f9ee179, 0x597feee4,
+ 0x99d52381, 0xef342c1c, 0x34114d60, 0x42f042fd, 0xf1f7b941,
+ 0x8716b6dc, 0x5c33d7a0, 0x2ad2d83d, 0xea781558, 0x9c991ac5,
+ 0x47bc7bb9, 0x315d7424, 0xc7e9e072, 0xb108efef, 0x6a2d8e93,
+ 0x1ccc810e, 0xdc664c6b, 0xaa8743f6, 0x71a2228a, 0x07432d17,
+ 0x9dcb0b27, 0xeb2a04ba, 0x300f65c6, 0x46ee6a5b, 0x8644a73e,
+ 0xf0a5a8a3, 0x2b80c9df, 0x5d61c642, 0xabd55214, 0xdd345d89,
+ 0x06113cf5, 0x70f03368, 0xb05afe0d, 0xc6bbf190, 0x1d9e90ec,
+ 0x6b7f9f71, 0x298fdd8c, 0x5f6ed211, 0x844bb36d, 0xf2aabcf0,
+ 0x32007195, 0x44e17e08, 0x9fc41f74, 0xe92510e9, 0x1f9184bf,
+ 0x69708b22, 0xb255ea5e, 0xc4b4e5c3, 0x041e28a6, 0x72ff273b,
+ 0xa9da4647, 0xdf3b49da, 0x45b36fea, 0x33526077, 0xe877010b,
+ 0x9e960e96, 0x5e3cc3f3, 0x28ddcc6e, 0xf3f8ad12, 0x8519a28f,
+ 0x73ad36d9, 0x054c3944, 0xde695838, 0xa88857a5, 0x68229ac0,
+ 0x1ec3955d, 0xc5e6f421, 0xb307fbbc, 0xe2ef7383, 0x940e7c1e,
+ 0x4f2b1d62, 0x39ca12ff, 0xf960df9a, 0x8f81d007, 0x54a4b17b,
+ 0x2245bee6, 0xd4f12ab0, 0xa210252d, 0x79354451, 0x0fd44bcc,
+ 0xcf7e86a9, 0xb99f8934, 0x62bae848, 0x145be7d5, 0x8ed3c1e5,
+ 0xf832ce78, 0x2317af04, 0x55f6a099, 0x955c6dfc, 0xe3bd6261,
+ 0x3898031d, 0x4e790c80, 0xb8cd98d6, 0xce2c974b, 0x1509f637,
+ 0x63e8f9aa, 0xa34234cf, 0xd5a33b52, 0x0e865a2e, 0x786755b3,
+ 0x3a97174e, 0x4c7618d3, 0x975379af, 0xe1b27632, 0x2118bb57,
+ 0x57f9b4ca, 0x8cdcd5b6, 0xfa3dda2b, 0x0c894e7d, 0x7a6841e0,
+ 0xa14d209c, 0xd7ac2f01, 0x1706e264, 0x61e7edf9, 0xbac28c85,
+ 0xcc238318, 0x56aba528, 0x204aaab5, 0xfb6fcbc9, 0x8d8ec454,
+ 0x4d240931, 0x3bc506ac, 0xe0e067d0, 0x9601684d, 0x60b5fc1b,
+ 0x1654f386, 0xcd7192fa, 0xbb909d67, 0x7b3a5002, 0x0ddb5f9f,
+ 0xd6fe3ee3, 0xa01f317e, 0x1318cac2, 0x65f9c55f, 0xbedca423,
+ 0xc83dabbe, 0x089766db, 0x7e766946, 0xa553083a, 0xd3b207a7,
+ 0x250693f1, 0x53e79c6c, 0x88c2fd10, 0xfe23f28d, 0x3e893fe8,
+ 0x48683075, 0x934d5109, 0xe5ac5e94, 0x7f2478a4, 0x09c57739,
+ 0xd2e01645, 0xa40119d8, 0x64abd4bd, 0x124adb20, 0xc96fba5c,
+ 0xbf8eb5c1, 0x493a2197, 0x3fdb2e0a, 0xe4fe4f76, 0x921f40eb,
+ 0x52b58d8e, 0x24548213, 0xff71e36f, 0x8990ecf2, 0xcb60ae0f,
+ 0xbd81a192, 0x66a4c0ee, 0x1045cf73, 0xd0ef0216, 0xa60e0d8b,
+ 0x7d2b6cf7, 0x0bca636a, 0xfd7ef73c, 0x8b9ff8a1, 0x50ba99dd,
+ 0x265b9640, 0xe6f15b25, 0x901054b8, 0x4b3535c4, 0x3dd43a59,
+ 0xa75c1c69, 0xd1bd13f4, 0x0a987288, 0x7c797d15, 0xbcd3b070,
+ 0xca32bfed, 0x1117de91, 0x67f6d10c, 0x9142455a, 0xe7a34ac7,
+ 0x3c862bbb, 0x4a672426, 0x8acde943, 0xfc2ce6de, 0x270987a2,
+ 0x51e8883f},
+ {0x00000000, 0xe8dbfbb9, 0x91b186a8, 0x796a7d11, 0x63657c8a,
+ 0x8bbe8733, 0xf2d4fa22, 0x1a0f019b, 0x87cc89cf, 0x6f177276,
+ 0x167d0f67, 0xfea6f4de, 0xe4a9f545, 0x0c720efc, 0x751873ed,
+ 0x9dc38854, 0x4f9f6244, 0xa74499fd, 0xde2ee4ec, 0x36f51f55,
+ 0x2cfa1ece, 0xc421e577, 0xbd4b9866, 0x559063df, 0xc853eb8b,
+ 0x20881032, 0x59e26d23, 0xb139969a, 0xab369701, 0x43ed6cb8,
+ 0x3a8711a9, 0xd25cea10, 0x9e3ec588, 0x76e53e31, 0x0f8f4320,
+ 0xe754b899, 0xfd5bb902, 0x158042bb, 0x6cea3faa, 0x8431c413,
+ 0x19f24c47, 0xf129b7fe, 0x8843caef, 0x60983156, 0x7a9730cd,
+ 0x924ccb74, 0xeb26b665, 0x03fd4ddc, 0xd1a1a7cc, 0x397a5c75,
+ 0x40102164, 0xa8cbdadd, 0xb2c4db46, 0x5a1f20ff, 0x23755dee,
+ 0xcbaea657, 0x566d2e03, 0xbeb6d5ba, 0xc7dca8ab, 0x2f075312,
+ 0x35085289, 0xddd3a930, 0xa4b9d421, 0x4c622f98, 0x7d7bfbca,
+ 0x95a00073, 0xecca7d62, 0x041186db, 0x1e1e8740, 0xf6c57cf9,
+ 0x8faf01e8, 0x6774fa51, 0xfab77205, 0x126c89bc, 0x6b06f4ad,
+ 0x83dd0f14, 0x99d20e8f, 0x7109f536, 0x08638827, 0xe0b8739e,
+ 0x32e4998e, 0xda3f6237, 0xa3551f26, 0x4b8ee49f, 0x5181e504,
+ 0xb95a1ebd, 0xc03063ac, 0x28eb9815, 0xb5281041, 0x5df3ebf8,
+ 0x249996e9, 0xcc426d50, 0xd64d6ccb, 0x3e969772, 0x47fcea63,
+ 0xaf2711da, 0xe3453e42, 0x0b9ec5fb, 0x72f4b8ea, 0x9a2f4353,
+ 0x802042c8, 0x68fbb971, 0x1191c460, 0xf94a3fd9, 0x6489b78d,
+ 0x8c524c34, 0xf5383125, 0x1de3ca9c, 0x07eccb07, 0xef3730be,
+ 0x965d4daf, 0x7e86b616, 0xacda5c06, 0x4401a7bf, 0x3d6bdaae,
+ 0xd5b02117, 0xcfbf208c, 0x2764db35, 0x5e0ea624, 0xb6d55d9d,
+ 0x2b16d5c9, 0xc3cd2e70, 0xbaa75361, 0x527ca8d8, 0x4873a943,
+ 0xa0a852fa, 0xd9c22feb, 0x3119d452, 0xbbf0874e, 0x532b7cf7,
+ 0x2a4101e6, 0xc29afa5f, 0xd895fbc4, 0x304e007d, 0x49247d6c,
+ 0xa1ff86d5, 0x3c3c0e81, 0xd4e7f538, 0xad8d8829, 0x45567390,
+ 0x5f59720b, 0xb78289b2, 0xcee8f4a3, 0x26330f1a, 0xf46fe50a,
+ 0x1cb41eb3, 0x65de63a2, 0x8d05981b, 0x970a9980, 0x7fd16239,
+ 0x06bb1f28, 0xee60e491, 0x73a36cc5, 0x9b78977c, 0xe212ea6d,
+ 0x0ac911d4, 0x10c6104f, 0xf81debf6, 0x817796e7, 0x69ac6d5e,
+ 0x25ce42c6, 0xcd15b97f, 0xb47fc46e, 0x5ca43fd7, 0x46ab3e4c,
+ 0xae70c5f5, 0xd71ab8e4, 0x3fc1435d, 0xa202cb09, 0x4ad930b0,
+ 0x33b34da1, 0xdb68b618, 0xc167b783, 0x29bc4c3a, 0x50d6312b,
+ 0xb80dca92, 0x6a512082, 0x828adb3b, 0xfbe0a62a, 0x133b5d93,
+ 0x09345c08, 0xe1efa7b1, 0x9885daa0, 0x705e2119, 0xed9da94d,
+ 0x054652f4, 0x7c2c2fe5, 0x94f7d45c, 0x8ef8d5c7, 0x66232e7e,
+ 0x1f49536f, 0xf792a8d6, 0xc68b7c84, 0x2e50873d, 0x573afa2c,
+ 0xbfe10195, 0xa5ee000e, 0x4d35fbb7, 0x345f86a6, 0xdc847d1f,
+ 0x4147f54b, 0xa99c0ef2, 0xd0f673e3, 0x382d885a, 0x222289c1,
+ 0xcaf97278, 0xb3930f69, 0x5b48f4d0, 0x89141ec0, 0x61cfe579,
+ 0x18a59868, 0xf07e63d1, 0xea71624a, 0x02aa99f3, 0x7bc0e4e2,
+ 0x931b1f5b, 0x0ed8970f, 0xe6036cb6, 0x9f6911a7, 0x77b2ea1e,
+ 0x6dbdeb85, 0x8566103c, 0xfc0c6d2d, 0x14d79694, 0x58b5b90c,
+ 0xb06e42b5, 0xc9043fa4, 0x21dfc41d, 0x3bd0c586, 0xd30b3e3f,
+ 0xaa61432e, 0x42bab897, 0xdf7930c3, 0x37a2cb7a, 0x4ec8b66b,
+ 0xa6134dd2, 0xbc1c4c49, 0x54c7b7f0, 0x2dadcae1, 0xc5763158,
+ 0x172adb48, 0xfff120f1, 0x869b5de0, 0x6e40a659, 0x744fa7c2,
+ 0x9c945c7b, 0xe5fe216a, 0x0d25dad3, 0x90e65287, 0x783da93e,
+ 0x0157d42f, 0xe98c2f96, 0xf3832e0d, 0x1b58d5b4, 0x6232a8a5,
+ 0x8ae9531c},
+ {0x00000000, 0x919168ae, 0x6325a087, 0xf2b4c829, 0x874c31d4,
+ 0x16dd597a, 0xe4699153, 0x75f8f9fd, 0x4f9f1373, 0xde0e7bdd,
+ 0x2cbab3f4, 0xbd2bdb5a, 0xc8d322a7, 0x59424a09, 0xabf68220,
+ 0x3a67ea8e, 0x9e3e27e6, 0x0faf4f48, 0xfd1b8761, 0x6c8aefcf,
+ 0x19721632, 0x88e37e9c, 0x7a57b6b5, 0xebc6de1b, 0xd1a13495,
+ 0x40305c3b, 0xb2849412, 0x2315fcbc, 0x56ed0541, 0xc77c6def,
+ 0x35c8a5c6, 0xa459cd68, 0x7d7b3f17, 0xecea57b9, 0x1e5e9f90,
+ 0x8fcff73e, 0xfa370ec3, 0x6ba6666d, 0x9912ae44, 0x0883c6ea,
+ 0x32e42c64, 0xa37544ca, 0x51c18ce3, 0xc050e44d, 0xb5a81db0,
+ 0x2439751e, 0xd68dbd37, 0x471cd599, 0xe34518f1, 0x72d4705f,
+ 0x8060b876, 0x11f1d0d8, 0x64092925, 0xf598418b, 0x072c89a2,
+ 0x96bde10c, 0xacda0b82, 0x3d4b632c, 0xcfffab05, 0x5e6ec3ab,
+ 0x2b963a56, 0xba0752f8, 0x48b39ad1, 0xd922f27f, 0xfaf67e2e,
+ 0x6b671680, 0x99d3dea9, 0x0842b607, 0x7dba4ffa, 0xec2b2754,
+ 0x1e9fef7d, 0x8f0e87d3, 0xb5696d5d, 0x24f805f3, 0xd64ccdda,
+ 0x47dda574, 0x32255c89, 0xa3b43427, 0x5100fc0e, 0xc09194a0,
+ 0x64c859c8, 0xf5593166, 0x07edf94f, 0x967c91e1, 0xe384681c,
+ 0x721500b2, 0x80a1c89b, 0x1130a035, 0x2b574abb, 0xbac62215,
+ 0x4872ea3c, 0xd9e38292, 0xac1b7b6f, 0x3d8a13c1, 0xcf3edbe8,
+ 0x5eafb346, 0x878d4139, 0x161c2997, 0xe4a8e1be, 0x75398910,
+ 0x00c170ed, 0x91501843, 0x63e4d06a, 0xf275b8c4, 0xc812524a,
+ 0x59833ae4, 0xab37f2cd, 0x3aa69a63, 0x4f5e639e, 0xdecf0b30,
+ 0x2c7bc319, 0xbdeaabb7, 0x19b366df, 0x88220e71, 0x7a96c658,
+ 0xeb07aef6, 0x9eff570b, 0x0f6e3fa5, 0xfddaf78c, 0x6c4b9f22,
+ 0x562c75ac, 0xc7bd1d02, 0x3509d52b, 0xa498bd85, 0xd1604478,
+ 0x40f12cd6, 0xb245e4ff, 0x23d48c51, 0xf4edfd5c, 0x657c95f2,
+ 0x97c85ddb, 0x06593575, 0x73a1cc88, 0xe230a426, 0x10846c0f,
+ 0x811504a1, 0xbb72ee2f, 0x2ae38681, 0xd8574ea8, 0x49c62606,
+ 0x3c3edffb, 0xadafb755, 0x5f1b7f7c, 0xce8a17d2, 0x6ad3daba,
+ 0xfb42b214, 0x09f67a3d, 0x98671293, 0xed9feb6e, 0x7c0e83c0,
+ 0x8eba4be9, 0x1f2b2347, 0x254cc9c9, 0xb4dda167, 0x4669694e,
+ 0xd7f801e0, 0xa200f81d, 0x339190b3, 0xc125589a, 0x50b43034,
+ 0x8996c24b, 0x1807aae5, 0xeab362cc, 0x7b220a62, 0x0edaf39f,
+ 0x9f4b9b31, 0x6dff5318, 0xfc6e3bb6, 0xc609d138, 0x5798b996,
+ 0xa52c71bf, 0x34bd1911, 0x4145e0ec, 0xd0d48842, 0x2260406b,
+ 0xb3f128c5, 0x17a8e5ad, 0x86398d03, 0x748d452a, 0xe51c2d84,
+ 0x90e4d479, 0x0175bcd7, 0xf3c174fe, 0x62501c50, 0x5837f6de,
+ 0xc9a69e70, 0x3b125659, 0xaa833ef7, 0xdf7bc70a, 0x4eeaafa4,
+ 0xbc5e678d, 0x2dcf0f23, 0x0e1b8372, 0x9f8aebdc, 0x6d3e23f5,
+ 0xfcaf4b5b, 0x8957b2a6, 0x18c6da08, 0xea721221, 0x7be37a8f,
+ 0x41849001, 0xd015f8af, 0x22a13086, 0xb3305828, 0xc6c8a1d5,
+ 0x5759c97b, 0xa5ed0152, 0x347c69fc, 0x9025a494, 0x01b4cc3a,
+ 0xf3000413, 0x62916cbd, 0x17699540, 0x86f8fdee, 0x744c35c7,
+ 0xe5dd5d69, 0xdfbab7e7, 0x4e2bdf49, 0xbc9f1760, 0x2d0e7fce,
+ 0x58f68633, 0xc967ee9d, 0x3bd326b4, 0xaa424e1a, 0x7360bc65,
+ 0xe2f1d4cb, 0x10451ce2, 0x81d4744c, 0xf42c8db1, 0x65bde51f,
+ 0x97092d36, 0x06984598, 0x3cffaf16, 0xad6ec7b8, 0x5fda0f91,
+ 0xce4b673f, 0xbbb39ec2, 0x2a22f66c, 0xd8963e45, 0x490756eb,
+ 0xed5e9b83, 0x7ccff32d, 0x8e7b3b04, 0x1fea53aa, 0x6a12aa57,
+ 0xfb83c2f9, 0x09370ad0, 0x98a6627e, 0xa2c188f0, 0x3350e05e,
+ 0xc1e42877, 0x507540d9, 0x258db924, 0xb41cd18a, 0x46a819a3,
+ 0xd739710d}};
+
+#endif
+
+#endif
+
+#if N == 5
+
+#if W == 8
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0xaf449247, 0x85f822cf, 0x2abcb088, 0xd08143df,
+ 0x7fc5d198, 0x55796110, 0xfa3df357, 0x7a7381ff, 0xd53713b8,
+ 0xff8ba330, 0x50cf3177, 0xaaf2c220, 0x05b65067, 0x2f0ae0ef,
+ 0x804e72a8, 0xf4e703fe, 0x5ba391b9, 0x711f2131, 0xde5bb376,
+ 0x24664021, 0x8b22d266, 0xa19e62ee, 0x0edaf0a9, 0x8e948201,
+ 0x21d01046, 0x0b6ca0ce, 0xa4283289, 0x5e15c1de, 0xf1515399,
+ 0xdbede311, 0x74a97156, 0x32bf01bd, 0x9dfb93fa, 0xb7472372,
+ 0x1803b135, 0xe23e4262, 0x4d7ad025, 0x67c660ad, 0xc882f2ea,
+ 0x48cc8042, 0xe7881205, 0xcd34a28d, 0x627030ca, 0x984dc39d,
+ 0x370951da, 0x1db5e152, 0xb2f17315, 0xc6580243, 0x691c9004,
+ 0x43a0208c, 0xece4b2cb, 0x16d9419c, 0xb99dd3db, 0x93216353,
+ 0x3c65f114, 0xbc2b83bc, 0x136f11fb, 0x39d3a173, 0x96973334,
+ 0x6caac063, 0xc3ee5224, 0xe952e2ac, 0x461670eb, 0x657e037a,
+ 0xca3a913d, 0xe08621b5, 0x4fc2b3f2, 0xb5ff40a5, 0x1abbd2e2,
+ 0x3007626a, 0x9f43f02d, 0x1f0d8285, 0xb04910c2, 0x9af5a04a,
+ 0x35b1320d, 0xcf8cc15a, 0x60c8531d, 0x4a74e395, 0xe53071d2,
+ 0x91990084, 0x3edd92c3, 0x1461224b, 0xbb25b00c, 0x4118435b,
+ 0xee5cd11c, 0xc4e06194, 0x6ba4f3d3, 0xebea817b, 0x44ae133c,
+ 0x6e12a3b4, 0xc15631f3, 0x3b6bc2a4, 0x942f50e3, 0xbe93e06b,
+ 0x11d7722c, 0x57c102c7, 0xf8859080, 0xd2392008, 0x7d7db24f,
+ 0x87404118, 0x2804d35f, 0x02b863d7, 0xadfcf190, 0x2db28338,
+ 0x82f6117f, 0xa84aa1f7, 0x070e33b0, 0xfd33c0e7, 0x527752a0,
+ 0x78cbe228, 0xd78f706f, 0xa3260139, 0x0c62937e, 0x26de23f6,
+ 0x899ab1b1, 0x73a742e6, 0xdce3d0a1, 0xf65f6029, 0x591bf26e,
+ 0xd95580c6, 0x76111281, 0x5cada209, 0xf3e9304e, 0x09d4c319,
+ 0xa690515e, 0x8c2ce1d6, 0x23687391, 0xcafc06f4, 0x65b894b3,
+ 0x4f04243b, 0xe040b67c, 0x1a7d452b, 0xb539d76c, 0x9f8567e4,
+ 0x30c1f5a3, 0xb08f870b, 0x1fcb154c, 0x3577a5c4, 0x9a333783,
+ 0x600ec4d4, 0xcf4a5693, 0xe5f6e61b, 0x4ab2745c, 0x3e1b050a,
+ 0x915f974d, 0xbbe327c5, 0x14a7b582, 0xee9a46d5, 0x41ded492,
+ 0x6b62641a, 0xc426f65d, 0x446884f5, 0xeb2c16b2, 0xc190a63a,
+ 0x6ed4347d, 0x94e9c72a, 0x3bad556d, 0x1111e5e5, 0xbe5577a2,
+ 0xf8430749, 0x5707950e, 0x7dbb2586, 0xd2ffb7c1, 0x28c24496,
+ 0x8786d6d1, 0xad3a6659, 0x027ef41e, 0x823086b6, 0x2d7414f1,
+ 0x07c8a479, 0xa88c363e, 0x52b1c569, 0xfdf5572e, 0xd749e7a6,
+ 0x780d75e1, 0x0ca404b7, 0xa3e096f0, 0x895c2678, 0x2618b43f,
+ 0xdc254768, 0x7361d52f, 0x59dd65a7, 0xf699f7e0, 0x76d78548,
+ 0xd993170f, 0xf32fa787, 0x5c6b35c0, 0xa656c697, 0x091254d0,
+ 0x23aee458, 0x8cea761f, 0xaf82058e, 0x00c697c9, 0x2a7a2741,
+ 0x853eb506, 0x7f034651, 0xd047d416, 0xfafb649e, 0x55bff6d9,
+ 0xd5f18471, 0x7ab51636, 0x5009a6be, 0xff4d34f9, 0x0570c7ae,
+ 0xaa3455e9, 0x8088e561, 0x2fcc7726, 0x5b650670, 0xf4219437,
+ 0xde9d24bf, 0x71d9b6f8, 0x8be445af, 0x24a0d7e8, 0x0e1c6760,
+ 0xa158f527, 0x2116878f, 0x8e5215c8, 0xa4eea540, 0x0baa3707,
+ 0xf197c450, 0x5ed35617, 0x746fe69f, 0xdb2b74d8, 0x9d3d0433,
+ 0x32799674, 0x18c526fc, 0xb781b4bb, 0x4dbc47ec, 0xe2f8d5ab,
+ 0xc8446523, 0x6700f764, 0xe74e85cc, 0x480a178b, 0x62b6a703,
+ 0xcdf23544, 0x37cfc613, 0x988b5454, 0xb237e4dc, 0x1d73769b,
+ 0x69da07cd, 0xc69e958a, 0xec222502, 0x4366b745, 0xb95b4412,
+ 0x161fd655, 0x3ca366dd, 0x93e7f49a, 0x13a98632, 0xbced1475,
+ 0x9651a4fd, 0x391536ba, 0xc328c5ed, 0x6c6c57aa, 0x46d0e722,
+ 0xe9947565},
+ {0x00000000, 0x4e890ba9, 0x9d121752, 0xd39b1cfb, 0xe15528e5,
+ 0xafdc234c, 0x7c473fb7, 0x32ce341e, 0x19db578b, 0x57525c22,
+ 0x84c940d9, 0xca404b70, 0xf88e7f6e, 0xb60774c7, 0x659c683c,
+ 0x2b156395, 0x33b6af16, 0x7d3fa4bf, 0xaea4b844, 0xe02db3ed,
+ 0xd2e387f3, 0x9c6a8c5a, 0x4ff190a1, 0x01789b08, 0x2a6df89d,
+ 0x64e4f334, 0xb77fefcf, 0xf9f6e466, 0xcb38d078, 0x85b1dbd1,
+ 0x562ac72a, 0x18a3cc83, 0x676d5e2c, 0x29e45585, 0xfa7f497e,
+ 0xb4f642d7, 0x863876c9, 0xc8b17d60, 0x1b2a619b, 0x55a36a32,
+ 0x7eb609a7, 0x303f020e, 0xe3a41ef5, 0xad2d155c, 0x9fe32142,
+ 0xd16a2aeb, 0x02f13610, 0x4c783db9, 0x54dbf13a, 0x1a52fa93,
+ 0xc9c9e668, 0x8740edc1, 0xb58ed9df, 0xfb07d276, 0x289cce8d,
+ 0x6615c524, 0x4d00a6b1, 0x0389ad18, 0xd012b1e3, 0x9e9bba4a,
+ 0xac558e54, 0xe2dc85fd, 0x31479906, 0x7fce92af, 0xcedabc58,
+ 0x8053b7f1, 0x53c8ab0a, 0x1d41a0a3, 0x2f8f94bd, 0x61069f14,
+ 0xb29d83ef, 0xfc148846, 0xd701ebd3, 0x9988e07a, 0x4a13fc81,
+ 0x049af728, 0x3654c336, 0x78ddc89f, 0xab46d464, 0xe5cfdfcd,
+ 0xfd6c134e, 0xb3e518e7, 0x607e041c, 0x2ef70fb5, 0x1c393bab,
+ 0x52b03002, 0x812b2cf9, 0xcfa22750, 0xe4b744c5, 0xaa3e4f6c,
+ 0x79a55397, 0x372c583e, 0x05e26c20, 0x4b6b6789, 0x98f07b72,
+ 0xd67970db, 0xa9b7e274, 0xe73ee9dd, 0x34a5f526, 0x7a2cfe8f,
+ 0x48e2ca91, 0x066bc138, 0xd5f0ddc3, 0x9b79d66a, 0xb06cb5ff,
+ 0xfee5be56, 0x2d7ea2ad, 0x63f7a904, 0x51399d1a, 0x1fb096b3,
+ 0xcc2b8a48, 0x82a281e1, 0x9a014d62, 0xd48846cb, 0x07135a30,
+ 0x499a5199, 0x7b546587, 0x35dd6e2e, 0xe64672d5, 0xa8cf797c,
+ 0x83da1ae9, 0xcd531140, 0x1ec80dbb, 0x50410612, 0x628f320c,
+ 0x2c0639a5, 0xff9d255e, 0xb1142ef7, 0x46c47ef1, 0x084d7558,
+ 0xdbd669a3, 0x955f620a, 0xa7915614, 0xe9185dbd, 0x3a834146,
+ 0x740a4aef, 0x5f1f297a, 0x119622d3, 0xc20d3e28, 0x8c843581,
+ 0xbe4a019f, 0xf0c30a36, 0x235816cd, 0x6dd11d64, 0x7572d1e7,
+ 0x3bfbda4e, 0xe860c6b5, 0xa6e9cd1c, 0x9427f902, 0xdaaef2ab,
+ 0x0935ee50, 0x47bce5f9, 0x6ca9866c, 0x22208dc5, 0xf1bb913e,
+ 0xbf329a97, 0x8dfcae89, 0xc375a520, 0x10eeb9db, 0x5e67b272,
+ 0x21a920dd, 0x6f202b74, 0xbcbb378f, 0xf2323c26, 0xc0fc0838,
+ 0x8e750391, 0x5dee1f6a, 0x136714c3, 0x38727756, 0x76fb7cff,
+ 0xa5606004, 0xebe96bad, 0xd9275fb3, 0x97ae541a, 0x443548e1,
+ 0x0abc4348, 0x121f8fcb, 0x5c968462, 0x8f0d9899, 0xc1849330,
+ 0xf34aa72e, 0xbdc3ac87, 0x6e58b07c, 0x20d1bbd5, 0x0bc4d840,
+ 0x454dd3e9, 0x96d6cf12, 0xd85fc4bb, 0xea91f0a5, 0xa418fb0c,
+ 0x7783e7f7, 0x390aec5e, 0x881ec2a9, 0xc697c900, 0x150cd5fb,
+ 0x5b85de52, 0x694bea4c, 0x27c2e1e5, 0xf459fd1e, 0xbad0f6b7,
+ 0x91c59522, 0xdf4c9e8b, 0x0cd78270, 0x425e89d9, 0x7090bdc7,
+ 0x3e19b66e, 0xed82aa95, 0xa30ba13c, 0xbba86dbf, 0xf5216616,
+ 0x26ba7aed, 0x68337144, 0x5afd455a, 0x14744ef3, 0xc7ef5208,
+ 0x896659a1, 0xa2733a34, 0xecfa319d, 0x3f612d66, 0x71e826cf,
+ 0x432612d1, 0x0daf1978, 0xde340583, 0x90bd0e2a, 0xef739c85,
+ 0xa1fa972c, 0x72618bd7, 0x3ce8807e, 0x0e26b460, 0x40afbfc9,
+ 0x9334a332, 0xddbda89b, 0xf6a8cb0e, 0xb821c0a7, 0x6bbadc5c,
+ 0x2533d7f5, 0x17fde3eb, 0x5974e842, 0x8aeff4b9, 0xc466ff10,
+ 0xdcc53393, 0x924c383a, 0x41d724c1, 0x0f5e2f68, 0x3d901b76,
+ 0x731910df, 0xa0820c24, 0xee0b078d, 0xc51e6418, 0x8b976fb1,
+ 0x580c734a, 0x168578e3, 0x244b4cfd, 0x6ac24754, 0xb9595baf,
+ 0xf7d05006},
+ {0x00000000, 0x8d88fde2, 0xc060fd85, 0x4de80067, 0x5bb0fd4b,
+ 0xd63800a9, 0x9bd000ce, 0x1658fd2c, 0xb761fa96, 0x3ae90774,
+ 0x77010713, 0xfa89faf1, 0xecd107dd, 0x6159fa3f, 0x2cb1fa58,
+ 0xa13907ba, 0xb5b2f36d, 0x383a0e8f, 0x75d20ee8, 0xf85af30a,
+ 0xee020e26, 0x638af3c4, 0x2e62f3a3, 0xa3ea0e41, 0x02d309fb,
+ 0x8f5bf419, 0xc2b3f47e, 0x4f3b099c, 0x5963f4b0, 0xd4eb0952,
+ 0x99030935, 0x148bf4d7, 0xb014e09b, 0x3d9c1d79, 0x70741d1e,
+ 0xfdfce0fc, 0xeba41dd0, 0x662ce032, 0x2bc4e055, 0xa64c1db7,
+ 0x07751a0d, 0x8afde7ef, 0xc715e788, 0x4a9d1a6a, 0x5cc5e746,
+ 0xd14d1aa4, 0x9ca51ac3, 0x112de721, 0x05a613f6, 0x882eee14,
+ 0xc5c6ee73, 0x484e1391, 0x5e16eebd, 0xd39e135f, 0x9e761338,
+ 0x13feeeda, 0xb2c7e960, 0x3f4f1482, 0x72a714e5, 0xff2fe907,
+ 0xe977142b, 0x64ffe9c9, 0x2917e9ae, 0xa49f144c, 0xbb58c777,
+ 0x36d03a95, 0x7b383af2, 0xf6b0c710, 0xe0e83a3c, 0x6d60c7de,
+ 0x2088c7b9, 0xad003a5b, 0x0c393de1, 0x81b1c003, 0xcc59c064,
+ 0x41d13d86, 0x5789c0aa, 0xda013d48, 0x97e93d2f, 0x1a61c0cd,
+ 0x0eea341a, 0x8362c9f8, 0xce8ac99f, 0x4302347d, 0x555ac951,
+ 0xd8d234b3, 0x953a34d4, 0x18b2c936, 0xb98bce8c, 0x3403336e,
+ 0x79eb3309, 0xf463ceeb, 0xe23b33c7, 0x6fb3ce25, 0x225bce42,
+ 0xafd333a0, 0x0b4c27ec, 0x86c4da0e, 0xcb2cda69, 0x46a4278b,
+ 0x50fcdaa7, 0xdd742745, 0x909c2722, 0x1d14dac0, 0xbc2ddd7a,
+ 0x31a52098, 0x7c4d20ff, 0xf1c5dd1d, 0xe79d2031, 0x6a15ddd3,
+ 0x27fdddb4, 0xaa752056, 0xbefed481, 0x33762963, 0x7e9e2904,
+ 0xf316d4e6, 0xe54e29ca, 0x68c6d428, 0x252ed44f, 0xa8a629ad,
+ 0x099f2e17, 0x8417d3f5, 0xc9ffd392, 0x44772e70, 0x522fd35c,
+ 0xdfa72ebe, 0x924f2ed9, 0x1fc7d33b, 0xadc088af, 0x2048754d,
+ 0x6da0752a, 0xe02888c8, 0xf67075e4, 0x7bf88806, 0x36108861,
+ 0xbb987583, 0x1aa17239, 0x97298fdb, 0xdac18fbc, 0x5749725e,
+ 0x41118f72, 0xcc997290, 0x817172f7, 0x0cf98f15, 0x18727bc2,
+ 0x95fa8620, 0xd8128647, 0x559a7ba5, 0x43c28689, 0xce4a7b6b,
+ 0x83a27b0c, 0x0e2a86ee, 0xaf138154, 0x229b7cb6, 0x6f737cd1,
+ 0xe2fb8133, 0xf4a37c1f, 0x792b81fd, 0x34c3819a, 0xb94b7c78,
+ 0x1dd46834, 0x905c95d6, 0xddb495b1, 0x503c6853, 0x4664957f,
+ 0xcbec689d, 0x860468fa, 0x0b8c9518, 0xaab592a2, 0x273d6f40,
+ 0x6ad56f27, 0xe75d92c5, 0xf1056fe9, 0x7c8d920b, 0x3165926c,
+ 0xbced6f8e, 0xa8669b59, 0x25ee66bb, 0x680666dc, 0xe58e9b3e,
+ 0xf3d66612, 0x7e5e9bf0, 0x33b69b97, 0xbe3e6675, 0x1f0761cf,
+ 0x928f9c2d, 0xdf679c4a, 0x52ef61a8, 0x44b79c84, 0xc93f6166,
+ 0x84d76101, 0x095f9ce3, 0x16984fd8, 0x9b10b23a, 0xd6f8b25d,
+ 0x5b704fbf, 0x4d28b293, 0xc0a04f71, 0x8d484f16, 0x00c0b2f4,
+ 0xa1f9b54e, 0x2c7148ac, 0x619948cb, 0xec11b529, 0xfa494805,
+ 0x77c1b5e7, 0x3a29b580, 0xb7a14862, 0xa32abcb5, 0x2ea24157,
+ 0x634a4130, 0xeec2bcd2, 0xf89a41fe, 0x7512bc1c, 0x38fabc7b,
+ 0xb5724199, 0x144b4623, 0x99c3bbc1, 0xd42bbba6, 0x59a34644,
+ 0x4ffbbb68, 0xc273468a, 0x8f9b46ed, 0x0213bb0f, 0xa68caf43,
+ 0x2b0452a1, 0x66ec52c6, 0xeb64af24, 0xfd3c5208, 0x70b4afea,
+ 0x3d5caf8d, 0xb0d4526f, 0x11ed55d5, 0x9c65a837, 0xd18da850,
+ 0x5c0555b2, 0x4a5da89e, 0xc7d5557c, 0x8a3d551b, 0x07b5a8f9,
+ 0x133e5c2e, 0x9eb6a1cc, 0xd35ea1ab, 0x5ed65c49, 0x488ea165,
+ 0xc5065c87, 0x88ee5ce0, 0x0566a102, 0xa45fa6b8, 0x29d75b5a,
+ 0x643f5b3d, 0xe9b7a6df, 0xffef5bf3, 0x7267a611, 0x3f8fa676,
+ 0xb2075b94},
+ {0x00000000, 0x80f0171f, 0xda91287f, 0x5a613f60, 0x6e5356bf,
+ 0xeea341a0, 0xb4c27ec0, 0x343269df, 0xdca6ad7e, 0x5c56ba61,
+ 0x06378501, 0x86c7921e, 0xb2f5fbc1, 0x3205ecde, 0x6864d3be,
+ 0xe894c4a1, 0x623c5cbd, 0xe2cc4ba2, 0xb8ad74c2, 0x385d63dd,
+ 0x0c6f0a02, 0x8c9f1d1d, 0xd6fe227d, 0x560e3562, 0xbe9af1c3,
+ 0x3e6ae6dc, 0x640bd9bc, 0xe4fbcea3, 0xd0c9a77c, 0x5039b063,
+ 0x0a588f03, 0x8aa8981c, 0xc478b97a, 0x4488ae65, 0x1ee99105,
+ 0x9e19861a, 0xaa2befc5, 0x2adbf8da, 0x70bac7ba, 0xf04ad0a5,
+ 0x18de1404, 0x982e031b, 0xc24f3c7b, 0x42bf2b64, 0x768d42bb,
+ 0xf67d55a4, 0xac1c6ac4, 0x2cec7ddb, 0xa644e5c7, 0x26b4f2d8,
+ 0x7cd5cdb8, 0xfc25daa7, 0xc817b378, 0x48e7a467, 0x12869b07,
+ 0x92768c18, 0x7ae248b9, 0xfa125fa6, 0xa07360c6, 0x208377d9,
+ 0x14b11e06, 0x94410919, 0xce203679, 0x4ed02166, 0x538074b5,
+ 0xd37063aa, 0x89115cca, 0x09e14bd5, 0x3dd3220a, 0xbd233515,
+ 0xe7420a75, 0x67b21d6a, 0x8f26d9cb, 0x0fd6ced4, 0x55b7f1b4,
+ 0xd547e6ab, 0xe1758f74, 0x6185986b, 0x3be4a70b, 0xbb14b014,
+ 0x31bc2808, 0xb14c3f17, 0xeb2d0077, 0x6bdd1768, 0x5fef7eb7,
+ 0xdf1f69a8, 0x857e56c8, 0x058e41d7, 0xed1a8576, 0x6dea9269,
+ 0x378bad09, 0xb77bba16, 0x8349d3c9, 0x03b9c4d6, 0x59d8fbb6,
+ 0xd928eca9, 0x97f8cdcf, 0x1708dad0, 0x4d69e5b0, 0xcd99f2af,
+ 0xf9ab9b70, 0x795b8c6f, 0x233ab30f, 0xa3caa410, 0x4b5e60b1,
+ 0xcbae77ae, 0x91cf48ce, 0x113f5fd1, 0x250d360e, 0xa5fd2111,
+ 0xff9c1e71, 0x7f6c096e, 0xf5c49172, 0x7534866d, 0x2f55b90d,
+ 0xafa5ae12, 0x9b97c7cd, 0x1b67d0d2, 0x4106efb2, 0xc1f6f8ad,
+ 0x29623c0c, 0xa9922b13, 0xf3f31473, 0x7303036c, 0x47316ab3,
+ 0xc7c17dac, 0x9da042cc, 0x1d5055d3, 0xa700e96a, 0x27f0fe75,
+ 0x7d91c115, 0xfd61d60a, 0xc953bfd5, 0x49a3a8ca, 0x13c297aa,
+ 0x933280b5, 0x7ba64414, 0xfb56530b, 0xa1376c6b, 0x21c77b74,
+ 0x15f512ab, 0x950505b4, 0xcf643ad4, 0x4f942dcb, 0xc53cb5d7,
+ 0x45cca2c8, 0x1fad9da8, 0x9f5d8ab7, 0xab6fe368, 0x2b9ff477,
+ 0x71fecb17, 0xf10edc08, 0x199a18a9, 0x996a0fb6, 0xc30b30d6,
+ 0x43fb27c9, 0x77c94e16, 0xf7395909, 0xad586669, 0x2da87176,
+ 0x63785010, 0xe388470f, 0xb9e9786f, 0x39196f70, 0x0d2b06af,
+ 0x8ddb11b0, 0xd7ba2ed0, 0x574a39cf, 0xbfdefd6e, 0x3f2eea71,
+ 0x654fd511, 0xe5bfc20e, 0xd18dabd1, 0x517dbcce, 0x0b1c83ae,
+ 0x8bec94b1, 0x01440cad, 0x81b41bb2, 0xdbd524d2, 0x5b2533cd,
+ 0x6f175a12, 0xefe74d0d, 0xb586726d, 0x35766572, 0xdde2a1d3,
+ 0x5d12b6cc, 0x077389ac, 0x87839eb3, 0xb3b1f76c, 0x3341e073,
+ 0x6920df13, 0xe9d0c80c, 0xf4809ddf, 0x74708ac0, 0x2e11b5a0,
+ 0xaee1a2bf, 0x9ad3cb60, 0x1a23dc7f, 0x4042e31f, 0xc0b2f400,
+ 0x282630a1, 0xa8d627be, 0xf2b718de, 0x72470fc1, 0x4675661e,
+ 0xc6857101, 0x9ce44e61, 0x1c14597e, 0x96bcc162, 0x164cd67d,
+ 0x4c2de91d, 0xccddfe02, 0xf8ef97dd, 0x781f80c2, 0x227ebfa2,
+ 0xa28ea8bd, 0x4a1a6c1c, 0xcaea7b03, 0x908b4463, 0x107b537c,
+ 0x24493aa3, 0xa4b92dbc, 0xfed812dc, 0x7e2805c3, 0x30f824a5,
+ 0xb00833ba, 0xea690cda, 0x6a991bc5, 0x5eab721a, 0xde5b6505,
+ 0x843a5a65, 0x04ca4d7a, 0xec5e89db, 0x6cae9ec4, 0x36cfa1a4,
+ 0xb63fb6bb, 0x820ddf64, 0x02fdc87b, 0x589cf71b, 0xd86ce004,
+ 0x52c47818, 0xd2346f07, 0x88555067, 0x08a54778, 0x3c972ea7,
+ 0xbc6739b8, 0xe60606d8, 0x66f611c7, 0x8e62d566, 0x0e92c279,
+ 0x54f3fd19, 0xd403ea06, 0xe03183d9, 0x60c194c6, 0x3aa0aba6,
+ 0xba50bcb9},
+ {0x00000000, 0x9570d495, 0xf190af6b, 0x64e07bfe, 0x38505897,
+ 0xad208c02, 0xc9c0f7fc, 0x5cb02369, 0x70a0b12e, 0xe5d065bb,
+ 0x81301e45, 0x1440cad0, 0x48f0e9b9, 0xdd803d2c, 0xb96046d2,
+ 0x2c109247, 0xe141625c, 0x7431b6c9, 0x10d1cd37, 0x85a119a2,
+ 0xd9113acb, 0x4c61ee5e, 0x288195a0, 0xbdf14135, 0x91e1d372,
+ 0x049107e7, 0x60717c19, 0xf501a88c, 0xa9b18be5, 0x3cc15f70,
+ 0x5821248e, 0xcd51f01b, 0x19f3c2f9, 0x8c83166c, 0xe8636d92,
+ 0x7d13b907, 0x21a39a6e, 0xb4d34efb, 0xd0333505, 0x4543e190,
+ 0x695373d7, 0xfc23a742, 0x98c3dcbc, 0x0db30829, 0x51032b40,
+ 0xc473ffd5, 0xa093842b, 0x35e350be, 0xf8b2a0a5, 0x6dc27430,
+ 0x09220fce, 0x9c52db5b, 0xc0e2f832, 0x55922ca7, 0x31725759,
+ 0xa40283cc, 0x8812118b, 0x1d62c51e, 0x7982bee0, 0xecf26a75,
+ 0xb042491c, 0x25329d89, 0x41d2e677, 0xd4a232e2, 0x33e785f2,
+ 0xa6975167, 0xc2772a99, 0x5707fe0c, 0x0bb7dd65, 0x9ec709f0,
+ 0xfa27720e, 0x6f57a69b, 0x434734dc, 0xd637e049, 0xb2d79bb7,
+ 0x27a74f22, 0x7b176c4b, 0xee67b8de, 0x8a87c320, 0x1ff717b5,
+ 0xd2a6e7ae, 0x47d6333b, 0x233648c5, 0xb6469c50, 0xeaf6bf39,
+ 0x7f866bac, 0x1b661052, 0x8e16c4c7, 0xa2065680, 0x37768215,
+ 0x5396f9eb, 0xc6e62d7e, 0x9a560e17, 0x0f26da82, 0x6bc6a17c,
+ 0xfeb675e9, 0x2a14470b, 0xbf64939e, 0xdb84e860, 0x4ef43cf5,
+ 0x12441f9c, 0x8734cb09, 0xe3d4b0f7, 0x76a46462, 0x5ab4f625,
+ 0xcfc422b0, 0xab24594e, 0x3e548ddb, 0x62e4aeb2, 0xf7947a27,
+ 0x937401d9, 0x0604d54c, 0xcb552557, 0x5e25f1c2, 0x3ac58a3c,
+ 0xafb55ea9, 0xf3057dc0, 0x6675a955, 0x0295d2ab, 0x97e5063e,
+ 0xbbf59479, 0x2e8540ec, 0x4a653b12, 0xdf15ef87, 0x83a5ccee,
+ 0x16d5187b, 0x72356385, 0xe745b710, 0x67cf0be4, 0xf2bfdf71,
+ 0x965fa48f, 0x032f701a, 0x5f9f5373, 0xcaef87e6, 0xae0ffc18,
+ 0x3b7f288d, 0x176fbaca, 0x821f6e5f, 0xe6ff15a1, 0x738fc134,
+ 0x2f3fe25d, 0xba4f36c8, 0xdeaf4d36, 0x4bdf99a3, 0x868e69b8,
+ 0x13febd2d, 0x771ec6d3, 0xe26e1246, 0xbede312f, 0x2baee5ba,
+ 0x4f4e9e44, 0xda3e4ad1, 0xf62ed896, 0x635e0c03, 0x07be77fd,
+ 0x92cea368, 0xce7e8001, 0x5b0e5494, 0x3fee2f6a, 0xaa9efbff,
+ 0x7e3cc91d, 0xeb4c1d88, 0x8fac6676, 0x1adcb2e3, 0x466c918a,
+ 0xd31c451f, 0xb7fc3ee1, 0x228cea74, 0x0e9c7833, 0x9becaca6,
+ 0xff0cd758, 0x6a7c03cd, 0x36cc20a4, 0xa3bcf431, 0xc75c8fcf,
+ 0x522c5b5a, 0x9f7dab41, 0x0a0d7fd4, 0x6eed042a, 0xfb9dd0bf,
+ 0xa72df3d6, 0x325d2743, 0x56bd5cbd, 0xc3cd8828, 0xefdd1a6f,
+ 0x7aadcefa, 0x1e4db504, 0x8b3d6191, 0xd78d42f8, 0x42fd966d,
+ 0x261ded93, 0xb36d3906, 0x54288e16, 0xc1585a83, 0xa5b8217d,
+ 0x30c8f5e8, 0x6c78d681, 0xf9080214, 0x9de879ea, 0x0898ad7f,
+ 0x24883f38, 0xb1f8ebad, 0xd5189053, 0x406844c6, 0x1cd867af,
+ 0x89a8b33a, 0xed48c8c4, 0x78381c51, 0xb569ec4a, 0x201938df,
+ 0x44f94321, 0xd18997b4, 0x8d39b4dd, 0x18496048, 0x7ca91bb6,
+ 0xe9d9cf23, 0xc5c95d64, 0x50b989f1, 0x3459f20f, 0xa129269a,
+ 0xfd9905f3, 0x68e9d166, 0x0c09aa98, 0x99797e0d, 0x4ddb4cef,
+ 0xd8ab987a, 0xbc4be384, 0x293b3711, 0x758b1478, 0xe0fbc0ed,
+ 0x841bbb13, 0x116b6f86, 0x3d7bfdc1, 0xa80b2954, 0xcceb52aa,
+ 0x599b863f, 0x052ba556, 0x905b71c3, 0xf4bb0a3d, 0x61cbdea8,
+ 0xac9a2eb3, 0x39eafa26, 0x5d0a81d8, 0xc87a554d, 0x94ca7624,
+ 0x01baa2b1, 0x655ad94f, 0xf02a0dda, 0xdc3a9f9d, 0x494a4b08,
+ 0x2daa30f6, 0xb8dae463, 0xe46ac70a, 0x711a139f, 0x15fa6861,
+ 0x808abcf4},
+ {0x00000000, 0xcf9e17c8, 0x444d29d1, 0x8bd33e19, 0x889a53a2,
+ 0x4704446a, 0xccd77a73, 0x03496dbb, 0xca45a105, 0x05dbb6cd,
+ 0x8e0888d4, 0x41969f1c, 0x42dff2a7, 0x8d41e56f, 0x0692db76,
+ 0xc90cccbe, 0x4ffa444b, 0x80645383, 0x0bb76d9a, 0xc4297a52,
+ 0xc76017e9, 0x08fe0021, 0x832d3e38, 0x4cb329f0, 0x85bfe54e,
+ 0x4a21f286, 0xc1f2cc9f, 0x0e6cdb57, 0x0d25b6ec, 0xc2bba124,
+ 0x49689f3d, 0x86f688f5, 0x9ff48896, 0x506a9f5e, 0xdbb9a147,
+ 0x1427b68f, 0x176edb34, 0xd8f0ccfc, 0x5323f2e5, 0x9cbde52d,
+ 0x55b12993, 0x9a2f3e5b, 0x11fc0042, 0xde62178a, 0xdd2b7a31,
+ 0x12b56df9, 0x996653e0, 0x56f84428, 0xd00eccdd, 0x1f90db15,
+ 0x9443e50c, 0x5bddf2c4, 0x58949f7f, 0x970a88b7, 0x1cd9b6ae,
+ 0xd347a166, 0x1a4b6dd8, 0xd5d57a10, 0x5e064409, 0x919853c1,
+ 0x92d13e7a, 0x5d4f29b2, 0xd69c17ab, 0x19020063, 0xe498176d,
+ 0x2b0600a5, 0xa0d53ebc, 0x6f4b2974, 0x6c0244cf, 0xa39c5307,
+ 0x284f6d1e, 0xe7d17ad6, 0x2eddb668, 0xe143a1a0, 0x6a909fb9,
+ 0xa50e8871, 0xa647e5ca, 0x69d9f202, 0xe20acc1b, 0x2d94dbd3,
+ 0xab625326, 0x64fc44ee, 0xef2f7af7, 0x20b16d3f, 0x23f80084,
+ 0xec66174c, 0x67b52955, 0xa82b3e9d, 0x6127f223, 0xaeb9e5eb,
+ 0x256adbf2, 0xeaf4cc3a, 0xe9bda181, 0x2623b649, 0xadf08850,
+ 0x626e9f98, 0x7b6c9ffb, 0xb4f28833, 0x3f21b62a, 0xf0bfa1e2,
+ 0xf3f6cc59, 0x3c68db91, 0xb7bbe588, 0x7825f240, 0xb1293efe,
+ 0x7eb72936, 0xf564172f, 0x3afa00e7, 0x39b36d5c, 0xf62d7a94,
+ 0x7dfe448d, 0xb2605345, 0x3496dbb0, 0xfb08cc78, 0x70dbf261,
+ 0xbf45e5a9, 0xbc0c8812, 0x73929fda, 0xf841a1c3, 0x37dfb60b,
+ 0xfed37ab5, 0x314d6d7d, 0xba9e5364, 0x750044ac, 0x76492917,
+ 0xb9d73edf, 0x320400c6, 0xfd9a170e, 0x1241289b, 0xdddf3f53,
+ 0x560c014a, 0x99921682, 0x9adb7b39, 0x55456cf1, 0xde9652e8,
+ 0x11084520, 0xd804899e, 0x179a9e56, 0x9c49a04f, 0x53d7b787,
+ 0x509eda3c, 0x9f00cdf4, 0x14d3f3ed, 0xdb4de425, 0x5dbb6cd0,
+ 0x92257b18, 0x19f64501, 0xd66852c9, 0xd5213f72, 0x1abf28ba,
+ 0x916c16a3, 0x5ef2016b, 0x97fecdd5, 0x5860da1d, 0xd3b3e404,
+ 0x1c2df3cc, 0x1f649e77, 0xd0fa89bf, 0x5b29b7a6, 0x94b7a06e,
+ 0x8db5a00d, 0x422bb7c5, 0xc9f889dc, 0x06669e14, 0x052ff3af,
+ 0xcab1e467, 0x4162da7e, 0x8efccdb6, 0x47f00108, 0x886e16c0,
+ 0x03bd28d9, 0xcc233f11, 0xcf6a52aa, 0x00f44562, 0x8b277b7b,
+ 0x44b96cb3, 0xc24fe446, 0x0dd1f38e, 0x8602cd97, 0x499cda5f,
+ 0x4ad5b7e4, 0x854ba02c, 0x0e989e35, 0xc10689fd, 0x080a4543,
+ 0xc794528b, 0x4c476c92, 0x83d97b5a, 0x809016e1, 0x4f0e0129,
+ 0xc4dd3f30, 0x0b4328f8, 0xf6d93ff6, 0x3947283e, 0xb2941627,
+ 0x7d0a01ef, 0x7e436c54, 0xb1dd7b9c, 0x3a0e4585, 0xf590524d,
+ 0x3c9c9ef3, 0xf302893b, 0x78d1b722, 0xb74fa0ea, 0xb406cd51,
+ 0x7b98da99, 0xf04be480, 0x3fd5f348, 0xb9237bbd, 0x76bd6c75,
+ 0xfd6e526c, 0x32f045a4, 0x31b9281f, 0xfe273fd7, 0x75f401ce,
+ 0xba6a1606, 0x7366dab8, 0xbcf8cd70, 0x372bf369, 0xf8b5e4a1,
+ 0xfbfc891a, 0x34629ed2, 0xbfb1a0cb, 0x702fb703, 0x692db760,
+ 0xa6b3a0a8, 0x2d609eb1, 0xe2fe8979, 0xe1b7e4c2, 0x2e29f30a,
+ 0xa5facd13, 0x6a64dadb, 0xa3681665, 0x6cf601ad, 0xe7253fb4,
+ 0x28bb287c, 0x2bf245c7, 0xe46c520f, 0x6fbf6c16, 0xa0217bde,
+ 0x26d7f32b, 0xe949e4e3, 0x629adafa, 0xad04cd32, 0xae4da089,
+ 0x61d3b741, 0xea008958, 0x259e9e90, 0xec92522e, 0x230c45e6,
+ 0xa8df7bff, 0x67416c37, 0x6408018c, 0xab961644, 0x2045285d,
+ 0xefdb3f95},
+ {0x00000000, 0x24825136, 0x4904a26c, 0x6d86f35a, 0x920944d8,
+ 0xb68b15ee, 0xdb0de6b4, 0xff8fb782, 0xff638ff1, 0xdbe1dec7,
+ 0xb6672d9d, 0x92e57cab, 0x6d6acb29, 0x49e89a1f, 0x246e6945,
+ 0x00ec3873, 0x25b619a3, 0x01344895, 0x6cb2bbcf, 0x4830eaf9,
+ 0xb7bf5d7b, 0x933d0c4d, 0xfebbff17, 0xda39ae21, 0xdad59652,
+ 0xfe57c764, 0x93d1343e, 0xb7536508, 0x48dcd28a, 0x6c5e83bc,
+ 0x01d870e6, 0x255a21d0, 0x4b6c3346, 0x6fee6270, 0x0268912a,
+ 0x26eac01c, 0xd965779e, 0xfde726a8, 0x9061d5f2, 0xb4e384c4,
+ 0xb40fbcb7, 0x908ded81, 0xfd0b1edb, 0xd9894fed, 0x2606f86f,
+ 0x0284a959, 0x6f025a03, 0x4b800b35, 0x6eda2ae5, 0x4a587bd3,
+ 0x27de8889, 0x035cd9bf, 0xfcd36e3d, 0xd8513f0b, 0xb5d7cc51,
+ 0x91559d67, 0x91b9a514, 0xb53bf422, 0xd8bd0778, 0xfc3f564e,
+ 0x03b0e1cc, 0x2732b0fa, 0x4ab443a0, 0x6e361296, 0x96d8668c,
+ 0xb25a37ba, 0xdfdcc4e0, 0xfb5e95d6, 0x04d12254, 0x20537362,
+ 0x4dd58038, 0x6957d10e, 0x69bbe97d, 0x4d39b84b, 0x20bf4b11,
+ 0x043d1a27, 0xfbb2ada5, 0xdf30fc93, 0xb2b60fc9, 0x96345eff,
+ 0xb36e7f2f, 0x97ec2e19, 0xfa6add43, 0xdee88c75, 0x21673bf7,
+ 0x05e56ac1, 0x6863999b, 0x4ce1c8ad, 0x4c0df0de, 0x688fa1e8,
+ 0x050952b2, 0x218b0384, 0xde04b406, 0xfa86e530, 0x9700166a,
+ 0xb382475c, 0xddb455ca, 0xf93604fc, 0x94b0f7a6, 0xb032a690,
+ 0x4fbd1112, 0x6b3f4024, 0x06b9b37e, 0x223be248, 0x22d7da3b,
+ 0x06558b0d, 0x6bd37857, 0x4f512961, 0xb0de9ee3, 0x945ccfd5,
+ 0xf9da3c8f, 0xdd586db9, 0xf8024c69, 0xdc801d5f, 0xb106ee05,
+ 0x9584bf33, 0x6a0b08b1, 0x4e895987, 0x230faadd, 0x078dfbeb,
+ 0x0761c398, 0x23e392ae, 0x4e6561f4, 0x6ae730c2, 0x95688740,
+ 0xb1ead676, 0xdc6c252c, 0xf8ee741a, 0xf6c1cb59, 0xd2439a6f,
+ 0xbfc56935, 0x9b473803, 0x64c88f81, 0x404adeb7, 0x2dcc2ded,
+ 0x094e7cdb, 0x09a244a8, 0x2d20159e, 0x40a6e6c4, 0x6424b7f2,
+ 0x9bab0070, 0xbf295146, 0xd2afa21c, 0xf62df32a, 0xd377d2fa,
+ 0xf7f583cc, 0x9a737096, 0xbef121a0, 0x417e9622, 0x65fcc714,
+ 0x087a344e, 0x2cf86578, 0x2c145d0b, 0x08960c3d, 0x6510ff67,
+ 0x4192ae51, 0xbe1d19d3, 0x9a9f48e5, 0xf719bbbf, 0xd39bea89,
+ 0xbdadf81f, 0x992fa929, 0xf4a95a73, 0xd02b0b45, 0x2fa4bcc7,
+ 0x0b26edf1, 0x66a01eab, 0x42224f9d, 0x42ce77ee, 0x664c26d8,
+ 0x0bcad582, 0x2f4884b4, 0xd0c73336, 0xf4456200, 0x99c3915a,
+ 0xbd41c06c, 0x981be1bc, 0xbc99b08a, 0xd11f43d0, 0xf59d12e6,
+ 0x0a12a564, 0x2e90f452, 0x43160708, 0x6794563e, 0x67786e4d,
+ 0x43fa3f7b, 0x2e7ccc21, 0x0afe9d17, 0xf5712a95, 0xd1f37ba3,
+ 0xbc7588f9, 0x98f7d9cf, 0x6019add5, 0x449bfce3, 0x291d0fb9,
+ 0x0d9f5e8f, 0xf210e90d, 0xd692b83b, 0xbb144b61, 0x9f961a57,
+ 0x9f7a2224, 0xbbf87312, 0xd67e8048, 0xf2fcd17e, 0x0d7366fc,
+ 0x29f137ca, 0x4477c490, 0x60f595a6, 0x45afb476, 0x612de540,
+ 0x0cab161a, 0x2829472c, 0xd7a6f0ae, 0xf324a198, 0x9ea252c2,
+ 0xba2003f4, 0xbacc3b87, 0x9e4e6ab1, 0xf3c899eb, 0xd74ac8dd,
+ 0x28c57f5f, 0x0c472e69, 0x61c1dd33, 0x45438c05, 0x2b759e93,
+ 0x0ff7cfa5, 0x62713cff, 0x46f36dc9, 0xb97cda4b, 0x9dfe8b7d,
+ 0xf0787827, 0xd4fa2911, 0xd4161162, 0xf0944054, 0x9d12b30e,
+ 0xb990e238, 0x461f55ba, 0x629d048c, 0x0f1bf7d6, 0x2b99a6e0,
+ 0x0ec38730, 0x2a41d606, 0x47c7255c, 0x6345746a, 0x9ccac3e8,
+ 0xb84892de, 0xd5ce6184, 0xf14c30b2, 0xf1a008c1, 0xd52259f7,
+ 0xb8a4aaad, 0x9c26fb9b, 0x63a94c19, 0x472b1d2f, 0x2aadee75,
+ 0x0e2fbf43},
+ {0x00000000, 0x36f290f3, 0x6de521e6, 0x5b17b115, 0xdbca43cc,
+ 0xed38d33f, 0xb62f622a, 0x80ddf2d9, 0x6ce581d9, 0x5a17112a,
+ 0x0100a03f, 0x37f230cc, 0xb72fc215, 0x81dd52e6, 0xdacae3f3,
+ 0xec387300, 0xd9cb03b2, 0xef399341, 0xb42e2254, 0x82dcb2a7,
+ 0x0201407e, 0x34f3d08d, 0x6fe46198, 0x5916f16b, 0xb52e826b,
+ 0x83dc1298, 0xd8cba38d, 0xee39337e, 0x6ee4c1a7, 0x58165154,
+ 0x0301e041, 0x35f370b2, 0x68e70125, 0x5e1591d6, 0x050220c3,
+ 0x33f0b030, 0xb32d42e9, 0x85dfd21a, 0xdec8630f, 0xe83af3fc,
+ 0x040280fc, 0x32f0100f, 0x69e7a11a, 0x5f1531e9, 0xdfc8c330,
+ 0xe93a53c3, 0xb22de2d6, 0x84df7225, 0xb12c0297, 0x87de9264,
+ 0xdcc92371, 0xea3bb382, 0x6ae6415b, 0x5c14d1a8, 0x070360bd,
+ 0x31f1f04e, 0xddc9834e, 0xeb3b13bd, 0xb02ca2a8, 0x86de325b,
+ 0x0603c082, 0x30f15071, 0x6be6e164, 0x5d147197, 0xd1ce024a,
+ 0xe73c92b9, 0xbc2b23ac, 0x8ad9b35f, 0x0a044186, 0x3cf6d175,
+ 0x67e16060, 0x5113f093, 0xbd2b8393, 0x8bd91360, 0xd0cea275,
+ 0xe63c3286, 0x66e1c05f, 0x501350ac, 0x0b04e1b9, 0x3df6714a,
+ 0x080501f8, 0x3ef7910b, 0x65e0201e, 0x5312b0ed, 0xd3cf4234,
+ 0xe53dd2c7, 0xbe2a63d2, 0x88d8f321, 0x64e08021, 0x521210d2,
+ 0x0905a1c7, 0x3ff73134, 0xbf2ac3ed, 0x89d8531e, 0xd2cfe20b,
+ 0xe43d72f8, 0xb929036f, 0x8fdb939c, 0xd4cc2289, 0xe23eb27a,
+ 0x62e340a3, 0x5411d050, 0x0f066145, 0x39f4f1b6, 0xd5cc82b6,
+ 0xe33e1245, 0xb829a350, 0x8edb33a3, 0x0e06c17a, 0x38f45189,
+ 0x63e3e09c, 0x5511706f, 0x60e200dd, 0x5610902e, 0x0d07213b,
+ 0x3bf5b1c8, 0xbb284311, 0x8ddad3e2, 0xd6cd62f7, 0xe03ff204,
+ 0x0c078104, 0x3af511f7, 0x61e2a0e2, 0x57103011, 0xd7cdc2c8,
+ 0xe13f523b, 0xba28e32e, 0x8cda73dd, 0x78ed02d5, 0x4e1f9226,
+ 0x15082333, 0x23fab3c0, 0xa3274119, 0x95d5d1ea, 0xcec260ff,
+ 0xf830f00c, 0x1408830c, 0x22fa13ff, 0x79eda2ea, 0x4f1f3219,
+ 0xcfc2c0c0, 0xf9305033, 0xa227e126, 0x94d571d5, 0xa1260167,
+ 0x97d49194, 0xccc32081, 0xfa31b072, 0x7aec42ab, 0x4c1ed258,
+ 0x1709634d, 0x21fbf3be, 0xcdc380be, 0xfb31104d, 0xa026a158,
+ 0x96d431ab, 0x1609c372, 0x20fb5381, 0x7bece294, 0x4d1e7267,
+ 0x100a03f0, 0x26f89303, 0x7def2216, 0x4b1db2e5, 0xcbc0403c,
+ 0xfd32d0cf, 0xa62561da, 0x90d7f129, 0x7cef8229, 0x4a1d12da,
+ 0x110aa3cf, 0x27f8333c, 0xa725c1e5, 0x91d75116, 0xcac0e003,
+ 0xfc3270f0, 0xc9c10042, 0xff3390b1, 0xa42421a4, 0x92d6b157,
+ 0x120b438e, 0x24f9d37d, 0x7fee6268, 0x491cf29b, 0xa524819b,
+ 0x93d61168, 0xc8c1a07d, 0xfe33308e, 0x7eeec257, 0x481c52a4,
+ 0x130be3b1, 0x25f97342, 0xa923009f, 0x9fd1906c, 0xc4c62179,
+ 0xf234b18a, 0x72e94353, 0x441bd3a0, 0x1f0c62b5, 0x29fef246,
+ 0xc5c68146, 0xf33411b5, 0xa823a0a0, 0x9ed13053, 0x1e0cc28a,
+ 0x28fe5279, 0x73e9e36c, 0x451b739f, 0x70e8032d, 0x461a93de,
+ 0x1d0d22cb, 0x2bffb238, 0xab2240e1, 0x9dd0d012, 0xc6c76107,
+ 0xf035f1f4, 0x1c0d82f4, 0x2aff1207, 0x71e8a312, 0x471a33e1,
+ 0xc7c7c138, 0xf13551cb, 0xaa22e0de, 0x9cd0702d, 0xc1c401ba,
+ 0xf7369149, 0xac21205c, 0x9ad3b0af, 0x1a0e4276, 0x2cfcd285,
+ 0x77eb6390, 0x4119f363, 0xad218063, 0x9bd31090, 0xc0c4a185,
+ 0xf6363176, 0x76ebc3af, 0x4019535c, 0x1b0ee249, 0x2dfc72ba,
+ 0x180f0208, 0x2efd92fb, 0x75ea23ee, 0x4318b31d, 0xc3c541c4,
+ 0xf537d137, 0xae206022, 0x98d2f0d1, 0x74ea83d1, 0x42181322,
+ 0x190fa237, 0x2ffd32c4, 0xaf20c01d, 0x99d250ee, 0xc2c5e1fb,
+ 0xf4377108}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x0000000000000000, 0xf390f23600000000, 0xe621e56d00000000,
+ 0x15b1175b00000000, 0xcc43cadb00000000, 0x3fd338ed00000000,
+ 0x2a622fb600000000, 0xd9f2dd8000000000, 0xd981e56c00000000,
+ 0x2a11175a00000000, 0x3fa0000100000000, 0xcc30f23700000000,
+ 0x15c22fb700000000, 0xe652dd8100000000, 0xf3e3cada00000000,
+ 0x007338ec00000000, 0xb203cbd900000000, 0x419339ef00000000,
+ 0x54222eb400000000, 0xa7b2dc8200000000, 0x7e40010200000000,
+ 0x8dd0f33400000000, 0x9861e46f00000000, 0x6bf1165900000000,
+ 0x6b822eb500000000, 0x9812dc8300000000, 0x8da3cbd800000000,
+ 0x7e3339ee00000000, 0xa7c1e46e00000000, 0x5451165800000000,
+ 0x41e0010300000000, 0xb270f33500000000, 0x2501e76800000000,
+ 0xd691155e00000000, 0xc320020500000000, 0x30b0f03300000000,
+ 0xe9422db300000000, 0x1ad2df8500000000, 0x0f63c8de00000000,
+ 0xfcf33ae800000000, 0xfc80020400000000, 0x0f10f03200000000,
+ 0x1aa1e76900000000, 0xe931155f00000000, 0x30c3c8df00000000,
+ 0xc3533ae900000000, 0xd6e22db200000000, 0x2572df8400000000,
+ 0x97022cb100000000, 0x6492de8700000000, 0x7123c9dc00000000,
+ 0x82b33bea00000000, 0x5b41e66a00000000, 0xa8d1145c00000000,
+ 0xbd60030700000000, 0x4ef0f13100000000, 0x4e83c9dd00000000,
+ 0xbd133beb00000000, 0xa8a22cb000000000, 0x5b32de8600000000,
+ 0x82c0030600000000, 0x7150f13000000000, 0x64e1e66b00000000,
+ 0x9771145d00000000, 0x4a02ced100000000, 0xb9923ce700000000,
+ 0xac232bbc00000000, 0x5fb3d98a00000000, 0x8641040a00000000,
+ 0x75d1f63c00000000, 0x6060e16700000000, 0x93f0135100000000,
+ 0x93832bbd00000000, 0x6013d98b00000000, 0x75a2ced000000000,
+ 0x86323ce600000000, 0x5fc0e16600000000, 0xac50135000000000,
+ 0xb9e1040b00000000, 0x4a71f63d00000000, 0xf801050800000000,
+ 0x0b91f73e00000000, 0x1e20e06500000000, 0xedb0125300000000,
+ 0x3442cfd300000000, 0xc7d23de500000000, 0xd2632abe00000000,
+ 0x21f3d88800000000, 0x2180e06400000000, 0xd210125200000000,
+ 0xc7a1050900000000, 0x3431f73f00000000, 0xedc32abf00000000,
+ 0x1e53d88900000000, 0x0be2cfd200000000, 0xf8723de400000000,
+ 0x6f0329b900000000, 0x9c93db8f00000000, 0x8922ccd400000000,
+ 0x7ab23ee200000000, 0xa340e36200000000, 0x50d0115400000000,
+ 0x4561060f00000000, 0xb6f1f43900000000, 0xb682ccd500000000,
+ 0x45123ee300000000, 0x50a329b800000000, 0xa333db8e00000000,
+ 0x7ac1060e00000000, 0x8951f43800000000, 0x9ce0e36300000000,
+ 0x6f70115500000000, 0xdd00e26000000000, 0x2e90105600000000,
+ 0x3b21070d00000000, 0xc8b1f53b00000000, 0x114328bb00000000,
+ 0xe2d3da8d00000000, 0xf762cdd600000000, 0x04f23fe000000000,
+ 0x0481070c00000000, 0xf711f53a00000000, 0xe2a0e26100000000,
+ 0x1130105700000000, 0xc8c2cdd700000000, 0x3b523fe100000000,
+ 0x2ee328ba00000000, 0xdd73da8c00000000, 0xd502ed7800000000,
+ 0x26921f4e00000000, 0x3323081500000000, 0xc0b3fa2300000000,
+ 0x194127a300000000, 0xead1d59500000000, 0xff60c2ce00000000,
+ 0x0cf030f800000000, 0x0c83081400000000, 0xff13fa2200000000,
+ 0xeaa2ed7900000000, 0x19321f4f00000000, 0xc0c0c2cf00000000,
+ 0x335030f900000000, 0x26e127a200000000, 0xd571d59400000000,
+ 0x670126a100000000, 0x9491d49700000000, 0x8120c3cc00000000,
+ 0x72b031fa00000000, 0xab42ec7a00000000, 0x58d21e4c00000000,
+ 0x4d63091700000000, 0xbef3fb2100000000, 0xbe80c3cd00000000,
+ 0x4d1031fb00000000, 0x58a126a000000000, 0xab31d49600000000,
+ 0x72c3091600000000, 0x8153fb2000000000, 0x94e2ec7b00000000,
+ 0x67721e4d00000000, 0xf0030a1000000000, 0x0393f82600000000,
+ 0x1622ef7d00000000, 0xe5b21d4b00000000, 0x3c40c0cb00000000,
+ 0xcfd032fd00000000, 0xda6125a600000000, 0x29f1d79000000000,
+ 0x2982ef7c00000000, 0xda121d4a00000000, 0xcfa30a1100000000,
+ 0x3c33f82700000000, 0xe5c125a700000000, 0x1651d79100000000,
+ 0x03e0c0ca00000000, 0xf07032fc00000000, 0x4200c1c900000000,
+ 0xb19033ff00000000, 0xa42124a400000000, 0x57b1d69200000000,
+ 0x8e430b1200000000, 0x7dd3f92400000000, 0x6862ee7f00000000,
+ 0x9bf21c4900000000, 0x9b8124a500000000, 0x6811d69300000000,
+ 0x7da0c1c800000000, 0x8e3033fe00000000, 0x57c2ee7e00000000,
+ 0xa4521c4800000000, 0xb1e30b1300000000, 0x4273f92500000000,
+ 0x9f0023a900000000, 0x6c90d19f00000000, 0x7921c6c400000000,
+ 0x8ab134f200000000, 0x5343e97200000000, 0xa0d31b4400000000,
+ 0xb5620c1f00000000, 0x46f2fe2900000000, 0x4681c6c500000000,
+ 0xb51134f300000000, 0xa0a023a800000000, 0x5330d19e00000000,
+ 0x8ac20c1e00000000, 0x7952fe2800000000, 0x6ce3e97300000000,
+ 0x9f731b4500000000, 0x2d03e87000000000, 0xde931a4600000000,
+ 0xcb220d1d00000000, 0x38b2ff2b00000000, 0xe14022ab00000000,
+ 0x12d0d09d00000000, 0x0761c7c600000000, 0xf4f135f000000000,
+ 0xf4820d1c00000000, 0x0712ff2a00000000, 0x12a3e87100000000,
+ 0xe1331a4700000000, 0x38c1c7c700000000, 0xcb5135f100000000,
+ 0xdee022aa00000000, 0x2d70d09c00000000, 0xba01c4c100000000,
+ 0x499136f700000000, 0x5c2021ac00000000, 0xafb0d39a00000000,
+ 0x76420e1a00000000, 0x85d2fc2c00000000, 0x9063eb7700000000,
+ 0x63f3194100000000, 0x638021ad00000000, 0x9010d39b00000000,
+ 0x85a1c4c000000000, 0x763136f600000000, 0xafc3eb7600000000,
+ 0x5c53194000000000, 0x49e20e1b00000000, 0xba72fc2d00000000,
+ 0x08020f1800000000, 0xfb92fd2e00000000, 0xee23ea7500000000,
+ 0x1db3184300000000, 0xc441c5c300000000, 0x37d137f500000000,
+ 0x226020ae00000000, 0xd1f0d29800000000, 0xd183ea7400000000,
+ 0x2213184200000000, 0x37a20f1900000000, 0xc432fd2f00000000,
+ 0x1dc020af00000000, 0xee50d29900000000, 0xfbe1c5c200000000,
+ 0x087137f400000000},
+ {0x0000000000000000, 0x3651822400000000, 0x6ca2044900000000,
+ 0x5af3866d00000000, 0xd844099200000000, 0xee158bb600000000,
+ 0xb4e60ddb00000000, 0x82b78fff00000000, 0xf18f63ff00000000,
+ 0xc7dee1db00000000, 0x9d2d67b600000000, 0xab7ce59200000000,
+ 0x29cb6a6d00000000, 0x1f9ae84900000000, 0x45696e2400000000,
+ 0x7338ec0000000000, 0xa319b62500000000, 0x9548340100000000,
+ 0xcfbbb26c00000000, 0xf9ea304800000000, 0x7b5dbfb700000000,
+ 0x4d0c3d9300000000, 0x17ffbbfe00000000, 0x21ae39da00000000,
+ 0x5296d5da00000000, 0x64c757fe00000000, 0x3e34d19300000000,
+ 0x086553b700000000, 0x8ad2dc4800000000, 0xbc835e6c00000000,
+ 0xe670d80100000000, 0xd0215a2500000000, 0x46336c4b00000000,
+ 0x7062ee6f00000000, 0x2a91680200000000, 0x1cc0ea2600000000,
+ 0x9e7765d900000000, 0xa826e7fd00000000, 0xf2d5619000000000,
+ 0xc484e3b400000000, 0xb7bc0fb400000000, 0x81ed8d9000000000,
+ 0xdb1e0bfd00000000, 0xed4f89d900000000, 0x6ff8062600000000,
+ 0x59a9840200000000, 0x035a026f00000000, 0x350b804b00000000,
+ 0xe52ada6e00000000, 0xd37b584a00000000, 0x8988de2700000000,
+ 0xbfd95c0300000000, 0x3d6ed3fc00000000, 0x0b3f51d800000000,
+ 0x51ccd7b500000000, 0x679d559100000000, 0x14a5b99100000000,
+ 0x22f43bb500000000, 0x7807bdd800000000, 0x4e563ffc00000000,
+ 0xcce1b00300000000, 0xfab0322700000000, 0xa043b44a00000000,
+ 0x9612366e00000000, 0x8c66d89600000000, 0xba375ab200000000,
+ 0xe0c4dcdf00000000, 0xd6955efb00000000, 0x5422d10400000000,
+ 0x6273532000000000, 0x3880d54d00000000, 0x0ed1576900000000,
+ 0x7de9bb6900000000, 0x4bb8394d00000000, 0x114bbf2000000000,
+ 0x271a3d0400000000, 0xa5adb2fb00000000, 0x93fc30df00000000,
+ 0xc90fb6b200000000, 0xff5e349600000000, 0x2f7f6eb300000000,
+ 0x192eec9700000000, 0x43dd6afa00000000, 0x758ce8de00000000,
+ 0xf73b672100000000, 0xc16ae50500000000, 0x9b99636800000000,
+ 0xadc8e14c00000000, 0xdef00d4c00000000, 0xe8a18f6800000000,
+ 0xb252090500000000, 0x84038b2100000000, 0x06b404de00000000,
+ 0x30e586fa00000000, 0x6a16009700000000, 0x5c4782b300000000,
+ 0xca55b4dd00000000, 0xfc0436f900000000, 0xa6f7b09400000000,
+ 0x90a632b000000000, 0x1211bd4f00000000, 0x24403f6b00000000,
+ 0x7eb3b90600000000, 0x48e23b2200000000, 0x3bdad72200000000,
+ 0x0d8b550600000000, 0x5778d36b00000000, 0x6129514f00000000,
+ 0xe39edeb000000000, 0xd5cf5c9400000000, 0x8f3cdaf900000000,
+ 0xb96d58dd00000000, 0x694c02f800000000, 0x5f1d80dc00000000,
+ 0x05ee06b100000000, 0x33bf849500000000, 0xb1080b6a00000000,
+ 0x8759894e00000000, 0xddaa0f2300000000, 0xebfb8d0700000000,
+ 0x98c3610700000000, 0xae92e32300000000, 0xf461654e00000000,
+ 0xc230e76a00000000, 0x4087689500000000, 0x76d6eab100000000,
+ 0x2c256cdc00000000, 0x1a74eef800000000, 0x59cbc1f600000000,
+ 0x6f9a43d200000000, 0x3569c5bf00000000, 0x0338479b00000000,
+ 0x818fc86400000000, 0xb7de4a4000000000, 0xed2dcc2d00000000,
+ 0xdb7c4e0900000000, 0xa844a20900000000, 0x9e15202d00000000,
+ 0xc4e6a64000000000, 0xf2b7246400000000, 0x7000ab9b00000000,
+ 0x465129bf00000000, 0x1ca2afd200000000, 0x2af32df600000000,
+ 0xfad277d300000000, 0xcc83f5f700000000, 0x9670739a00000000,
+ 0xa021f1be00000000, 0x22967e4100000000, 0x14c7fc6500000000,
+ 0x4e347a0800000000, 0x7865f82c00000000, 0x0b5d142c00000000,
+ 0x3d0c960800000000, 0x67ff106500000000, 0x51ae924100000000,
+ 0xd3191dbe00000000, 0xe5489f9a00000000, 0xbfbb19f700000000,
+ 0x89ea9bd300000000, 0x1ff8adbd00000000, 0x29a92f9900000000,
+ 0x735aa9f400000000, 0x450b2bd000000000, 0xc7bca42f00000000,
+ 0xf1ed260b00000000, 0xab1ea06600000000, 0x9d4f224200000000,
+ 0xee77ce4200000000, 0xd8264c6600000000, 0x82d5ca0b00000000,
+ 0xb484482f00000000, 0x3633c7d000000000, 0x006245f400000000,
+ 0x5a91c39900000000, 0x6cc041bd00000000, 0xbce11b9800000000,
+ 0x8ab099bc00000000, 0xd0431fd100000000, 0xe6129df500000000,
+ 0x64a5120a00000000, 0x52f4902e00000000, 0x0807164300000000,
+ 0x3e56946700000000, 0x4d6e786700000000, 0x7b3ffa4300000000,
+ 0x21cc7c2e00000000, 0x179dfe0a00000000, 0x952a71f500000000,
+ 0xa37bf3d100000000, 0xf98875bc00000000, 0xcfd9f79800000000,
+ 0xd5ad196000000000, 0xe3fc9b4400000000, 0xb90f1d2900000000,
+ 0x8f5e9f0d00000000, 0x0de910f200000000, 0x3bb892d600000000,
+ 0x614b14bb00000000, 0x571a969f00000000, 0x24227a9f00000000,
+ 0x1273f8bb00000000, 0x48807ed600000000, 0x7ed1fcf200000000,
+ 0xfc66730d00000000, 0xca37f12900000000, 0x90c4774400000000,
+ 0xa695f56000000000, 0x76b4af4500000000, 0x40e52d6100000000,
+ 0x1a16ab0c00000000, 0x2c47292800000000, 0xaef0a6d700000000,
+ 0x98a124f300000000, 0xc252a29e00000000, 0xf40320ba00000000,
+ 0x873bccba00000000, 0xb16a4e9e00000000, 0xeb99c8f300000000,
+ 0xddc84ad700000000, 0x5f7fc52800000000, 0x692e470c00000000,
+ 0x33ddc16100000000, 0x058c434500000000, 0x939e752b00000000,
+ 0xa5cff70f00000000, 0xff3c716200000000, 0xc96df34600000000,
+ 0x4bda7cb900000000, 0x7d8bfe9d00000000, 0x277878f000000000,
+ 0x1129fad400000000, 0x621116d400000000, 0x544094f000000000,
+ 0x0eb3129d00000000, 0x38e290b900000000, 0xba551f4600000000,
+ 0x8c049d6200000000, 0xd6f71b0f00000000, 0xe0a6992b00000000,
+ 0x3087c30e00000000, 0x06d6412a00000000, 0x5c25c74700000000,
+ 0x6a74456300000000, 0xe8c3ca9c00000000, 0xde9248b800000000,
+ 0x8461ced500000000, 0xb2304cf100000000, 0xc108a0f100000000,
+ 0xf75922d500000000, 0xadaaa4b800000000, 0x9bfb269c00000000,
+ 0x194ca96300000000, 0x2f1d2b4700000000, 0x75eead2a00000000,
+ 0x43bf2f0e00000000},
+ {0x0000000000000000, 0xc8179ecf00000000, 0xd1294d4400000000,
+ 0x193ed38b00000000, 0xa2539a8800000000, 0x6a44044700000000,
+ 0x737ad7cc00000000, 0xbb6d490300000000, 0x05a145ca00000000,
+ 0xcdb6db0500000000, 0xd488088e00000000, 0x1c9f964100000000,
+ 0xa7f2df4200000000, 0x6fe5418d00000000, 0x76db920600000000,
+ 0xbecc0cc900000000, 0x4b44fa4f00000000, 0x8353648000000000,
+ 0x9a6db70b00000000, 0x527a29c400000000, 0xe91760c700000000,
+ 0x2100fe0800000000, 0x383e2d8300000000, 0xf029b34c00000000,
+ 0x4ee5bf8500000000, 0x86f2214a00000000, 0x9fccf2c100000000,
+ 0x57db6c0e00000000, 0xecb6250d00000000, 0x24a1bbc200000000,
+ 0x3d9f684900000000, 0xf588f68600000000, 0x9688f49f00000000,
+ 0x5e9f6a5000000000, 0x47a1b9db00000000, 0x8fb6271400000000,
+ 0x34db6e1700000000, 0xfcccf0d800000000, 0xe5f2235300000000,
+ 0x2de5bd9c00000000, 0x9329b15500000000, 0x5b3e2f9a00000000,
+ 0x4200fc1100000000, 0x8a1762de00000000, 0x317a2bdd00000000,
+ 0xf96db51200000000, 0xe053669900000000, 0x2844f85600000000,
+ 0xddcc0ed000000000, 0x15db901f00000000, 0x0ce5439400000000,
+ 0xc4f2dd5b00000000, 0x7f9f945800000000, 0xb7880a9700000000,
+ 0xaeb6d91c00000000, 0x66a147d300000000, 0xd86d4b1a00000000,
+ 0x107ad5d500000000, 0x0944065e00000000, 0xc153989100000000,
+ 0x7a3ed19200000000, 0xb2294f5d00000000, 0xab179cd600000000,
+ 0x6300021900000000, 0x6d1798e400000000, 0xa500062b00000000,
+ 0xbc3ed5a000000000, 0x74294b6f00000000, 0xcf44026c00000000,
+ 0x07539ca300000000, 0x1e6d4f2800000000, 0xd67ad1e700000000,
+ 0x68b6dd2e00000000, 0xa0a143e100000000, 0xb99f906a00000000,
+ 0x71880ea500000000, 0xcae547a600000000, 0x02f2d96900000000,
+ 0x1bcc0ae200000000, 0xd3db942d00000000, 0x265362ab00000000,
+ 0xee44fc6400000000, 0xf77a2fef00000000, 0x3f6db12000000000,
+ 0x8400f82300000000, 0x4c1766ec00000000, 0x5529b56700000000,
+ 0x9d3e2ba800000000, 0x23f2276100000000, 0xebe5b9ae00000000,
+ 0xf2db6a2500000000, 0x3accf4ea00000000, 0x81a1bde900000000,
+ 0x49b6232600000000, 0x5088f0ad00000000, 0x989f6e6200000000,
+ 0xfb9f6c7b00000000, 0x3388f2b400000000, 0x2ab6213f00000000,
+ 0xe2a1bff000000000, 0x59ccf6f300000000, 0x91db683c00000000,
+ 0x88e5bbb700000000, 0x40f2257800000000, 0xfe3e29b100000000,
+ 0x3629b77e00000000, 0x2f1764f500000000, 0xe700fa3a00000000,
+ 0x5c6db33900000000, 0x947a2df600000000, 0x8d44fe7d00000000,
+ 0x455360b200000000, 0xb0db963400000000, 0x78cc08fb00000000,
+ 0x61f2db7000000000, 0xa9e545bf00000000, 0x12880cbc00000000,
+ 0xda9f927300000000, 0xc3a141f800000000, 0x0bb6df3700000000,
+ 0xb57ad3fe00000000, 0x7d6d4d3100000000, 0x64539eba00000000,
+ 0xac44007500000000, 0x1729497600000000, 0xdf3ed7b900000000,
+ 0xc600043200000000, 0x0e179afd00000000, 0x9b28411200000000,
+ 0x533fdfdd00000000, 0x4a010c5600000000, 0x8216929900000000,
+ 0x397bdb9a00000000, 0xf16c455500000000, 0xe85296de00000000,
+ 0x2045081100000000, 0x9e8904d800000000, 0x569e9a1700000000,
+ 0x4fa0499c00000000, 0x87b7d75300000000, 0x3cda9e5000000000,
+ 0xf4cd009f00000000, 0xedf3d31400000000, 0x25e44ddb00000000,
+ 0xd06cbb5d00000000, 0x187b259200000000, 0x0145f61900000000,
+ 0xc95268d600000000, 0x723f21d500000000, 0xba28bf1a00000000,
+ 0xa3166c9100000000, 0x6b01f25e00000000, 0xd5cdfe9700000000,
+ 0x1dda605800000000, 0x04e4b3d300000000, 0xccf32d1c00000000,
+ 0x779e641f00000000, 0xbf89fad000000000, 0xa6b7295b00000000,
+ 0x6ea0b79400000000, 0x0da0b58d00000000, 0xc5b72b4200000000,
+ 0xdc89f8c900000000, 0x149e660600000000, 0xaff32f0500000000,
+ 0x67e4b1ca00000000, 0x7eda624100000000, 0xb6cdfc8e00000000,
+ 0x0801f04700000000, 0xc0166e8800000000, 0xd928bd0300000000,
+ 0x113f23cc00000000, 0xaa526acf00000000, 0x6245f40000000000,
+ 0x7b7b278b00000000, 0xb36cb94400000000, 0x46e44fc200000000,
+ 0x8ef3d10d00000000, 0x97cd028600000000, 0x5fda9c4900000000,
+ 0xe4b7d54a00000000, 0x2ca04b8500000000, 0x359e980e00000000,
+ 0xfd8906c100000000, 0x43450a0800000000, 0x8b5294c700000000,
+ 0x926c474c00000000, 0x5a7bd98300000000, 0xe116908000000000,
+ 0x29010e4f00000000, 0x303fddc400000000, 0xf828430b00000000,
+ 0xf63fd9f600000000, 0x3e28473900000000, 0x271694b200000000,
+ 0xef010a7d00000000, 0x546c437e00000000, 0x9c7bddb100000000,
+ 0x85450e3a00000000, 0x4d5290f500000000, 0xf39e9c3c00000000,
+ 0x3b8902f300000000, 0x22b7d17800000000, 0xeaa04fb700000000,
+ 0x51cd06b400000000, 0x99da987b00000000, 0x80e44bf000000000,
+ 0x48f3d53f00000000, 0xbd7b23b900000000, 0x756cbd7600000000,
+ 0x6c526efd00000000, 0xa445f03200000000, 0x1f28b93100000000,
+ 0xd73f27fe00000000, 0xce01f47500000000, 0x06166aba00000000,
+ 0xb8da667300000000, 0x70cdf8bc00000000, 0x69f32b3700000000,
+ 0xa1e4b5f800000000, 0x1a89fcfb00000000, 0xd29e623400000000,
+ 0xcba0b1bf00000000, 0x03b72f7000000000, 0x60b72d6900000000,
+ 0xa8a0b3a600000000, 0xb19e602d00000000, 0x7989fee200000000,
+ 0xc2e4b7e100000000, 0x0af3292e00000000, 0x13cdfaa500000000,
+ 0xdbda646a00000000, 0x651668a300000000, 0xad01f66c00000000,
+ 0xb43f25e700000000, 0x7c28bb2800000000, 0xc745f22b00000000,
+ 0x0f526ce400000000, 0x166cbf6f00000000, 0xde7b21a000000000,
+ 0x2bf3d72600000000, 0xe3e449e900000000, 0xfada9a6200000000,
+ 0x32cd04ad00000000, 0x89a04dae00000000, 0x41b7d36100000000,
+ 0x588900ea00000000, 0x909e9e2500000000, 0x2e5292ec00000000,
+ 0xe6450c2300000000, 0xff7bdfa800000000, 0x376c416700000000,
+ 0x8c01086400000000, 0x441696ab00000000, 0x5d28452000000000,
+ 0x953fdbef00000000},
+ {0x0000000000000000, 0x95d4709500000000, 0x6baf90f100000000,
+ 0xfe7be06400000000, 0x9758503800000000, 0x028c20ad00000000,
+ 0xfcf7c0c900000000, 0x6923b05c00000000, 0x2eb1a07000000000,
+ 0xbb65d0e500000000, 0x451e308100000000, 0xd0ca401400000000,
+ 0xb9e9f04800000000, 0x2c3d80dd00000000, 0xd24660b900000000,
+ 0x4792102c00000000, 0x5c6241e100000000, 0xc9b6317400000000,
+ 0x37cdd11000000000, 0xa219a18500000000, 0xcb3a11d900000000,
+ 0x5eee614c00000000, 0xa095812800000000, 0x3541f1bd00000000,
+ 0x72d3e19100000000, 0xe707910400000000, 0x197c716000000000,
+ 0x8ca801f500000000, 0xe58bb1a900000000, 0x705fc13c00000000,
+ 0x8e24215800000000, 0x1bf051cd00000000, 0xf9c2f31900000000,
+ 0x6c16838c00000000, 0x926d63e800000000, 0x07b9137d00000000,
+ 0x6e9aa32100000000, 0xfb4ed3b400000000, 0x053533d000000000,
+ 0x90e1434500000000, 0xd773536900000000, 0x42a723fc00000000,
+ 0xbcdcc39800000000, 0x2908b30d00000000, 0x402b035100000000,
+ 0xd5ff73c400000000, 0x2b8493a000000000, 0xbe50e33500000000,
+ 0xa5a0b2f800000000, 0x3074c26d00000000, 0xce0f220900000000,
+ 0x5bdb529c00000000, 0x32f8e2c000000000, 0xa72c925500000000,
+ 0x5957723100000000, 0xcc8302a400000000, 0x8b11128800000000,
+ 0x1ec5621d00000000, 0xe0be827900000000, 0x756af2ec00000000,
+ 0x1c4942b000000000, 0x899d322500000000, 0x77e6d24100000000,
+ 0xe232a2d400000000, 0xf285e73300000000, 0x675197a600000000,
+ 0x992a77c200000000, 0x0cfe075700000000, 0x65ddb70b00000000,
+ 0xf009c79e00000000, 0x0e7227fa00000000, 0x9ba6576f00000000,
+ 0xdc34474300000000, 0x49e037d600000000, 0xb79bd7b200000000,
+ 0x224fa72700000000, 0x4b6c177b00000000, 0xdeb867ee00000000,
+ 0x20c3878a00000000, 0xb517f71f00000000, 0xaee7a6d200000000,
+ 0x3b33d64700000000, 0xc548362300000000, 0x509c46b600000000,
+ 0x39bff6ea00000000, 0xac6b867f00000000, 0x5210661b00000000,
+ 0xc7c4168e00000000, 0x805606a200000000, 0x1582763700000000,
+ 0xebf9965300000000, 0x7e2de6c600000000, 0x170e569a00000000,
+ 0x82da260f00000000, 0x7ca1c66b00000000, 0xe975b6fe00000000,
+ 0x0b47142a00000000, 0x9e9364bf00000000, 0x60e884db00000000,
+ 0xf53cf44e00000000, 0x9c1f441200000000, 0x09cb348700000000,
+ 0xf7b0d4e300000000, 0x6264a47600000000, 0x25f6b45a00000000,
+ 0xb022c4cf00000000, 0x4e5924ab00000000, 0xdb8d543e00000000,
+ 0xb2aee46200000000, 0x277a94f700000000, 0xd901749300000000,
+ 0x4cd5040600000000, 0x572555cb00000000, 0xc2f1255e00000000,
+ 0x3c8ac53a00000000, 0xa95eb5af00000000, 0xc07d05f300000000,
+ 0x55a9756600000000, 0xabd2950200000000, 0x3e06e59700000000,
+ 0x7994f5bb00000000, 0xec40852e00000000, 0x123b654a00000000,
+ 0x87ef15df00000000, 0xeecca58300000000, 0x7b18d51600000000,
+ 0x8563357200000000, 0x10b745e700000000, 0xe40bcf6700000000,
+ 0x71dfbff200000000, 0x8fa45f9600000000, 0x1a702f0300000000,
+ 0x73539f5f00000000, 0xe687efca00000000, 0x18fc0fae00000000,
+ 0x8d287f3b00000000, 0xcaba6f1700000000, 0x5f6e1f8200000000,
+ 0xa115ffe600000000, 0x34c18f7300000000, 0x5de23f2f00000000,
+ 0xc8364fba00000000, 0x364dafde00000000, 0xa399df4b00000000,
+ 0xb8698e8600000000, 0x2dbdfe1300000000, 0xd3c61e7700000000,
+ 0x46126ee200000000, 0x2f31debe00000000, 0xbae5ae2b00000000,
+ 0x449e4e4f00000000, 0xd14a3eda00000000, 0x96d82ef600000000,
+ 0x030c5e6300000000, 0xfd77be0700000000, 0x68a3ce9200000000,
+ 0x01807ece00000000, 0x94540e5b00000000, 0x6a2fee3f00000000,
+ 0xfffb9eaa00000000, 0x1dc93c7e00000000, 0x881d4ceb00000000,
+ 0x7666ac8f00000000, 0xe3b2dc1a00000000, 0x8a916c4600000000,
+ 0x1f451cd300000000, 0xe13efcb700000000, 0x74ea8c2200000000,
+ 0x33789c0e00000000, 0xa6acec9b00000000, 0x58d70cff00000000,
+ 0xcd037c6a00000000, 0xa420cc3600000000, 0x31f4bca300000000,
+ 0xcf8f5cc700000000, 0x5a5b2c5200000000, 0x41ab7d9f00000000,
+ 0xd47f0d0a00000000, 0x2a04ed6e00000000, 0xbfd09dfb00000000,
+ 0xd6f32da700000000, 0x43275d3200000000, 0xbd5cbd5600000000,
+ 0x2888cdc300000000, 0x6f1addef00000000, 0xfacead7a00000000,
+ 0x04b54d1e00000000, 0x91613d8b00000000, 0xf8428dd700000000,
+ 0x6d96fd4200000000, 0x93ed1d2600000000, 0x06396db300000000,
+ 0x168e285400000000, 0x835a58c100000000, 0x7d21b8a500000000,
+ 0xe8f5c83000000000, 0x81d6786c00000000, 0x140208f900000000,
+ 0xea79e89d00000000, 0x7fad980800000000, 0x383f882400000000,
+ 0xadebf8b100000000, 0x539018d500000000, 0xc644684000000000,
+ 0xaf67d81c00000000, 0x3ab3a88900000000, 0xc4c848ed00000000,
+ 0x511c387800000000, 0x4aec69b500000000, 0xdf38192000000000,
+ 0x2143f94400000000, 0xb49789d100000000, 0xddb4398d00000000,
+ 0x4860491800000000, 0xb61ba97c00000000, 0x23cfd9e900000000,
+ 0x645dc9c500000000, 0xf189b95000000000, 0x0ff2593400000000,
+ 0x9a2629a100000000, 0xf30599fd00000000, 0x66d1e96800000000,
+ 0x98aa090c00000000, 0x0d7e799900000000, 0xef4cdb4d00000000,
+ 0x7a98abd800000000, 0x84e34bbc00000000, 0x11373b2900000000,
+ 0x78148b7500000000, 0xedc0fbe000000000, 0x13bb1b8400000000,
+ 0x866f6b1100000000, 0xc1fd7b3d00000000, 0x54290ba800000000,
+ 0xaa52ebcc00000000, 0x3f869b5900000000, 0x56a52b0500000000,
+ 0xc3715b9000000000, 0x3d0abbf400000000, 0xa8decb6100000000,
+ 0xb32e9aac00000000, 0x26faea3900000000, 0xd8810a5d00000000,
+ 0x4d557ac800000000, 0x2476ca9400000000, 0xb1a2ba0100000000,
+ 0x4fd95a6500000000, 0xda0d2af000000000, 0x9d9f3adc00000000,
+ 0x084b4a4900000000, 0xf630aa2d00000000, 0x63e4dab800000000,
+ 0x0ac76ae400000000, 0x9f131a7100000000, 0x6168fa1500000000,
+ 0xf4bc8a8000000000},
+ {0x0000000000000000, 0x1f17f08000000000, 0x7f2891da00000000,
+ 0x603f615a00000000, 0xbf56536e00000000, 0xa041a3ee00000000,
+ 0xc07ec2b400000000, 0xdf69323400000000, 0x7eada6dc00000000,
+ 0x61ba565c00000000, 0x0185370600000000, 0x1e92c78600000000,
+ 0xc1fbf5b200000000, 0xdeec053200000000, 0xbed3646800000000,
+ 0xa1c494e800000000, 0xbd5c3c6200000000, 0xa24bcce200000000,
+ 0xc274adb800000000, 0xdd635d3800000000, 0x020a6f0c00000000,
+ 0x1d1d9f8c00000000, 0x7d22fed600000000, 0x62350e5600000000,
+ 0xc3f19abe00000000, 0xdce66a3e00000000, 0xbcd90b6400000000,
+ 0xa3cefbe400000000, 0x7ca7c9d000000000, 0x63b0395000000000,
+ 0x038f580a00000000, 0x1c98a88a00000000, 0x7ab978c400000000,
+ 0x65ae884400000000, 0x0591e91e00000000, 0x1a86199e00000000,
+ 0xc5ef2baa00000000, 0xdaf8db2a00000000, 0xbac7ba7000000000,
+ 0xa5d04af000000000, 0x0414de1800000000, 0x1b032e9800000000,
+ 0x7b3c4fc200000000, 0x642bbf4200000000, 0xbb428d7600000000,
+ 0xa4557df600000000, 0xc46a1cac00000000, 0xdb7dec2c00000000,
+ 0xc7e544a600000000, 0xd8f2b42600000000, 0xb8cdd57c00000000,
+ 0xa7da25fc00000000, 0x78b317c800000000, 0x67a4e74800000000,
+ 0x079b861200000000, 0x188c769200000000, 0xb948e27a00000000,
+ 0xa65f12fa00000000, 0xc66073a000000000, 0xd977832000000000,
+ 0x061eb11400000000, 0x1909419400000000, 0x793620ce00000000,
+ 0x6621d04e00000000, 0xb574805300000000, 0xaa6370d300000000,
+ 0xca5c118900000000, 0xd54be10900000000, 0x0a22d33d00000000,
+ 0x153523bd00000000, 0x750a42e700000000, 0x6a1db26700000000,
+ 0xcbd9268f00000000, 0xd4ced60f00000000, 0xb4f1b75500000000,
+ 0xabe647d500000000, 0x748f75e100000000, 0x6b98856100000000,
+ 0x0ba7e43b00000000, 0x14b014bb00000000, 0x0828bc3100000000,
+ 0x173f4cb100000000, 0x77002deb00000000, 0x6817dd6b00000000,
+ 0xb77eef5f00000000, 0xa8691fdf00000000, 0xc8567e8500000000,
+ 0xd7418e0500000000, 0x76851aed00000000, 0x6992ea6d00000000,
+ 0x09ad8b3700000000, 0x16ba7bb700000000, 0xc9d3498300000000,
+ 0xd6c4b90300000000, 0xb6fbd85900000000, 0xa9ec28d900000000,
+ 0xcfcdf89700000000, 0xd0da081700000000, 0xb0e5694d00000000,
+ 0xaff299cd00000000, 0x709babf900000000, 0x6f8c5b7900000000,
+ 0x0fb33a2300000000, 0x10a4caa300000000, 0xb1605e4b00000000,
+ 0xae77aecb00000000, 0xce48cf9100000000, 0xd15f3f1100000000,
+ 0x0e360d2500000000, 0x1121fda500000000, 0x711e9cff00000000,
+ 0x6e096c7f00000000, 0x7291c4f500000000, 0x6d86347500000000,
+ 0x0db9552f00000000, 0x12aea5af00000000, 0xcdc7979b00000000,
+ 0xd2d0671b00000000, 0xb2ef064100000000, 0xadf8f6c100000000,
+ 0x0c3c622900000000, 0x132b92a900000000, 0x7314f3f300000000,
+ 0x6c03037300000000, 0xb36a314700000000, 0xac7dc1c700000000,
+ 0xcc42a09d00000000, 0xd355501d00000000, 0x6ae900a700000000,
+ 0x75fef02700000000, 0x15c1917d00000000, 0x0ad661fd00000000,
+ 0xd5bf53c900000000, 0xcaa8a34900000000, 0xaa97c21300000000,
+ 0xb580329300000000, 0x1444a67b00000000, 0x0b5356fb00000000,
+ 0x6b6c37a100000000, 0x747bc72100000000, 0xab12f51500000000,
+ 0xb405059500000000, 0xd43a64cf00000000, 0xcb2d944f00000000,
+ 0xd7b53cc500000000, 0xc8a2cc4500000000, 0xa89dad1f00000000,
+ 0xb78a5d9f00000000, 0x68e36fab00000000, 0x77f49f2b00000000,
+ 0x17cbfe7100000000, 0x08dc0ef100000000, 0xa9189a1900000000,
+ 0xb60f6a9900000000, 0xd6300bc300000000, 0xc927fb4300000000,
+ 0x164ec97700000000, 0x095939f700000000, 0x696658ad00000000,
+ 0x7671a82d00000000, 0x1050786300000000, 0x0f4788e300000000,
+ 0x6f78e9b900000000, 0x706f193900000000, 0xaf062b0d00000000,
+ 0xb011db8d00000000, 0xd02ebad700000000, 0xcf394a5700000000,
+ 0x6efddebf00000000, 0x71ea2e3f00000000, 0x11d54f6500000000,
+ 0x0ec2bfe500000000, 0xd1ab8dd100000000, 0xcebc7d5100000000,
+ 0xae831c0b00000000, 0xb194ec8b00000000, 0xad0c440100000000,
+ 0xb21bb48100000000, 0xd224d5db00000000, 0xcd33255b00000000,
+ 0x125a176f00000000, 0x0d4de7ef00000000, 0x6d7286b500000000,
+ 0x7265763500000000, 0xd3a1e2dd00000000, 0xccb6125d00000000,
+ 0xac89730700000000, 0xb39e838700000000, 0x6cf7b1b300000000,
+ 0x73e0413300000000, 0x13df206900000000, 0x0cc8d0e900000000,
+ 0xdf9d80f400000000, 0xc08a707400000000, 0xa0b5112e00000000,
+ 0xbfa2e1ae00000000, 0x60cbd39a00000000, 0x7fdc231a00000000,
+ 0x1fe3424000000000, 0x00f4b2c000000000, 0xa130262800000000,
+ 0xbe27d6a800000000, 0xde18b7f200000000, 0xc10f477200000000,
+ 0x1e66754600000000, 0x017185c600000000, 0x614ee49c00000000,
+ 0x7e59141c00000000, 0x62c1bc9600000000, 0x7dd64c1600000000,
+ 0x1de92d4c00000000, 0x02feddcc00000000, 0xdd97eff800000000,
+ 0xc2801f7800000000, 0xa2bf7e2200000000, 0xbda88ea200000000,
+ 0x1c6c1a4a00000000, 0x037beaca00000000, 0x63448b9000000000,
+ 0x7c537b1000000000, 0xa33a492400000000, 0xbc2db9a400000000,
+ 0xdc12d8fe00000000, 0xc305287e00000000, 0xa524f83000000000,
+ 0xba3308b000000000, 0xda0c69ea00000000, 0xc51b996a00000000,
+ 0x1a72ab5e00000000, 0x05655bde00000000, 0x655a3a8400000000,
+ 0x7a4dca0400000000, 0xdb895eec00000000, 0xc49eae6c00000000,
+ 0xa4a1cf3600000000, 0xbbb63fb600000000, 0x64df0d8200000000,
+ 0x7bc8fd0200000000, 0x1bf79c5800000000, 0x04e06cd800000000,
+ 0x1878c45200000000, 0x076f34d200000000, 0x6750558800000000,
+ 0x7847a50800000000, 0xa72e973c00000000, 0xb83967bc00000000,
+ 0xd80606e600000000, 0xc711f66600000000, 0x66d5628e00000000,
+ 0x79c2920e00000000, 0x19fdf35400000000, 0x06ea03d400000000,
+ 0xd98331e000000000, 0xc694c16000000000, 0xa6aba03a00000000,
+ 0xb9bc50ba00000000},
+ {0x0000000000000000, 0xe2fd888d00000000, 0x85fd60c000000000,
+ 0x6700e84d00000000, 0x4bfdb05b00000000, 0xa90038d600000000,
+ 0xce00d09b00000000, 0x2cfd581600000000, 0x96fa61b700000000,
+ 0x7407e93a00000000, 0x1307017700000000, 0xf1fa89fa00000000,
+ 0xdd07d1ec00000000, 0x3ffa596100000000, 0x58fab12c00000000,
+ 0xba0739a100000000, 0x6df3b2b500000000, 0x8f0e3a3800000000,
+ 0xe80ed27500000000, 0x0af35af800000000, 0x260e02ee00000000,
+ 0xc4f38a6300000000, 0xa3f3622e00000000, 0x410eeaa300000000,
+ 0xfb09d30200000000, 0x19f45b8f00000000, 0x7ef4b3c200000000,
+ 0x9c093b4f00000000, 0xb0f4635900000000, 0x5209ebd400000000,
+ 0x3509039900000000, 0xd7f48b1400000000, 0x9be014b000000000,
+ 0x791d9c3d00000000, 0x1e1d747000000000, 0xfce0fcfd00000000,
+ 0xd01da4eb00000000, 0x32e02c6600000000, 0x55e0c42b00000000,
+ 0xb71d4ca600000000, 0x0d1a750700000000, 0xefe7fd8a00000000,
+ 0x88e715c700000000, 0x6a1a9d4a00000000, 0x46e7c55c00000000,
+ 0xa41a4dd100000000, 0xc31aa59c00000000, 0x21e72d1100000000,
+ 0xf613a60500000000, 0x14ee2e8800000000, 0x73eec6c500000000,
+ 0x91134e4800000000, 0xbdee165e00000000, 0x5f139ed300000000,
+ 0x3813769e00000000, 0xdaeefe1300000000, 0x60e9c7b200000000,
+ 0x82144f3f00000000, 0xe514a77200000000, 0x07e92fff00000000,
+ 0x2b1477e900000000, 0xc9e9ff6400000000, 0xaee9172900000000,
+ 0x4c149fa400000000, 0x77c758bb00000000, 0x953ad03600000000,
+ 0xf23a387b00000000, 0x10c7b0f600000000, 0x3c3ae8e000000000,
+ 0xdec7606d00000000, 0xb9c7882000000000, 0x5b3a00ad00000000,
+ 0xe13d390c00000000, 0x03c0b18100000000, 0x64c059cc00000000,
+ 0x863dd14100000000, 0xaac0895700000000, 0x483d01da00000000,
+ 0x2f3de99700000000, 0xcdc0611a00000000, 0x1a34ea0e00000000,
+ 0xf8c9628300000000, 0x9fc98ace00000000, 0x7d34024300000000,
+ 0x51c95a5500000000, 0xb334d2d800000000, 0xd4343a9500000000,
+ 0x36c9b21800000000, 0x8cce8bb900000000, 0x6e33033400000000,
+ 0x0933eb7900000000, 0xebce63f400000000, 0xc7333be200000000,
+ 0x25ceb36f00000000, 0x42ce5b2200000000, 0xa033d3af00000000,
+ 0xec274c0b00000000, 0x0edac48600000000, 0x69da2ccb00000000,
+ 0x8b27a44600000000, 0xa7dafc5000000000, 0x452774dd00000000,
+ 0x22279c9000000000, 0xc0da141d00000000, 0x7add2dbc00000000,
+ 0x9820a53100000000, 0xff204d7c00000000, 0x1dddc5f100000000,
+ 0x31209de700000000, 0xd3dd156a00000000, 0xb4ddfd2700000000,
+ 0x562075aa00000000, 0x81d4febe00000000, 0x6329763300000000,
+ 0x04299e7e00000000, 0xe6d416f300000000, 0xca294ee500000000,
+ 0x28d4c66800000000, 0x4fd42e2500000000, 0xad29a6a800000000,
+ 0x172e9f0900000000, 0xf5d3178400000000, 0x92d3ffc900000000,
+ 0x702e774400000000, 0x5cd32f5200000000, 0xbe2ea7df00000000,
+ 0xd92e4f9200000000, 0x3bd3c71f00000000, 0xaf88c0ad00000000,
+ 0x4d75482000000000, 0x2a75a06d00000000, 0xc88828e000000000,
+ 0xe47570f600000000, 0x0688f87b00000000, 0x6188103600000000,
+ 0x837598bb00000000, 0x3972a11a00000000, 0xdb8f299700000000,
+ 0xbc8fc1da00000000, 0x5e72495700000000, 0x728f114100000000,
+ 0x907299cc00000000, 0xf772718100000000, 0x158ff90c00000000,
+ 0xc27b721800000000, 0x2086fa9500000000, 0x478612d800000000,
+ 0xa57b9a5500000000, 0x8986c24300000000, 0x6b7b4ace00000000,
+ 0x0c7ba28300000000, 0xee862a0e00000000, 0x548113af00000000,
+ 0xb67c9b2200000000, 0xd17c736f00000000, 0x3381fbe200000000,
+ 0x1f7ca3f400000000, 0xfd812b7900000000, 0x9a81c33400000000,
+ 0x787c4bb900000000, 0x3468d41d00000000, 0xd6955c9000000000,
+ 0xb195b4dd00000000, 0x53683c5000000000, 0x7f95644600000000,
+ 0x9d68eccb00000000, 0xfa68048600000000, 0x18958c0b00000000,
+ 0xa292b5aa00000000, 0x406f3d2700000000, 0x276fd56a00000000,
+ 0xc5925de700000000, 0xe96f05f100000000, 0x0b928d7c00000000,
+ 0x6c92653100000000, 0x8e6fedbc00000000, 0x599b66a800000000,
+ 0xbb66ee2500000000, 0xdc66066800000000, 0x3e9b8ee500000000,
+ 0x1266d6f300000000, 0xf09b5e7e00000000, 0x979bb63300000000,
+ 0x75663ebe00000000, 0xcf61071f00000000, 0x2d9c8f9200000000,
+ 0x4a9c67df00000000, 0xa861ef5200000000, 0x849cb74400000000,
+ 0x66613fc900000000, 0x0161d78400000000, 0xe39c5f0900000000,
+ 0xd84f981600000000, 0x3ab2109b00000000, 0x5db2f8d600000000,
+ 0xbf4f705b00000000, 0x93b2284d00000000, 0x714fa0c000000000,
+ 0x164f488d00000000, 0xf4b2c00000000000, 0x4eb5f9a100000000,
+ 0xac48712c00000000, 0xcb48996100000000, 0x29b511ec00000000,
+ 0x054849fa00000000, 0xe7b5c17700000000, 0x80b5293a00000000,
+ 0x6248a1b700000000, 0xb5bc2aa300000000, 0x5741a22e00000000,
+ 0x30414a6300000000, 0xd2bcc2ee00000000, 0xfe419af800000000,
+ 0x1cbc127500000000, 0x7bbcfa3800000000, 0x994172b500000000,
+ 0x23464b1400000000, 0xc1bbc39900000000, 0xa6bb2bd400000000,
+ 0x4446a35900000000, 0x68bbfb4f00000000, 0x8a4673c200000000,
+ 0xed469b8f00000000, 0x0fbb130200000000, 0x43af8ca600000000,
+ 0xa152042b00000000, 0xc652ec6600000000, 0x24af64eb00000000,
+ 0x08523cfd00000000, 0xeaafb47000000000, 0x8daf5c3d00000000,
+ 0x6f52d4b000000000, 0xd555ed1100000000, 0x37a8659c00000000,
+ 0x50a88dd100000000, 0xb255055c00000000, 0x9ea85d4a00000000,
+ 0x7c55d5c700000000, 0x1b553d8a00000000, 0xf9a8b50700000000,
+ 0x2e5c3e1300000000, 0xcca1b69e00000000, 0xaba15ed300000000,
+ 0x495cd65e00000000, 0x65a18e4800000000, 0x875c06c500000000,
+ 0xe05cee8800000000, 0x02a1660500000000, 0xb8a65fa400000000,
+ 0x5a5bd72900000000, 0x3d5b3f6400000000, 0xdfa6b7e900000000,
+ 0xf35befff00000000, 0x11a6677200000000, 0x76a68f3f00000000,
+ 0x945b07b200000000},
+ {0x0000000000000000, 0xa90b894e00000000, 0x5217129d00000000,
+ 0xfb1c9bd300000000, 0xe52855e100000000, 0x4c23dcaf00000000,
+ 0xb73f477c00000000, 0x1e34ce3200000000, 0x8b57db1900000000,
+ 0x225c525700000000, 0xd940c98400000000, 0x704b40ca00000000,
+ 0x6e7f8ef800000000, 0xc77407b600000000, 0x3c689c6500000000,
+ 0x9563152b00000000, 0x16afb63300000000, 0xbfa43f7d00000000,
+ 0x44b8a4ae00000000, 0xedb32de000000000, 0xf387e3d200000000,
+ 0x5a8c6a9c00000000, 0xa190f14f00000000, 0x089b780100000000,
+ 0x9df86d2a00000000, 0x34f3e46400000000, 0xcfef7fb700000000,
+ 0x66e4f6f900000000, 0x78d038cb00000000, 0xd1dbb18500000000,
+ 0x2ac72a5600000000, 0x83cca31800000000, 0x2c5e6d6700000000,
+ 0x8555e42900000000, 0x7e497ffa00000000, 0xd742f6b400000000,
+ 0xc976388600000000, 0x607db1c800000000, 0x9b612a1b00000000,
+ 0x326aa35500000000, 0xa709b67e00000000, 0x0e023f3000000000,
+ 0xf51ea4e300000000, 0x5c152dad00000000, 0x4221e39f00000000,
+ 0xeb2a6ad100000000, 0x1036f10200000000, 0xb93d784c00000000,
+ 0x3af1db5400000000, 0x93fa521a00000000, 0x68e6c9c900000000,
+ 0xc1ed408700000000, 0xdfd98eb500000000, 0x76d207fb00000000,
+ 0x8dce9c2800000000, 0x24c5156600000000, 0xb1a6004d00000000,
+ 0x18ad890300000000, 0xe3b112d000000000, 0x4aba9b9e00000000,
+ 0x548e55ac00000000, 0xfd85dce200000000, 0x0699473100000000,
+ 0xaf92ce7f00000000, 0x58bcdace00000000, 0xf1b7538000000000,
+ 0x0aabc85300000000, 0xa3a0411d00000000, 0xbd948f2f00000000,
+ 0x149f066100000000, 0xef839db200000000, 0x468814fc00000000,
+ 0xd3eb01d700000000, 0x7ae0889900000000, 0x81fc134a00000000,
+ 0x28f79a0400000000, 0x36c3543600000000, 0x9fc8dd7800000000,
+ 0x64d446ab00000000, 0xcddfcfe500000000, 0x4e136cfd00000000,
+ 0xe718e5b300000000, 0x1c047e6000000000, 0xb50ff72e00000000,
+ 0xab3b391c00000000, 0x0230b05200000000, 0xf92c2b8100000000,
+ 0x5027a2cf00000000, 0xc544b7e400000000, 0x6c4f3eaa00000000,
+ 0x9753a57900000000, 0x3e582c3700000000, 0x206ce20500000000,
+ 0x89676b4b00000000, 0x727bf09800000000, 0xdb7079d600000000,
+ 0x74e2b7a900000000, 0xdde93ee700000000, 0x26f5a53400000000,
+ 0x8ffe2c7a00000000, 0x91cae24800000000, 0x38c16b0600000000,
+ 0xc3ddf0d500000000, 0x6ad6799b00000000, 0xffb56cb000000000,
+ 0x56bee5fe00000000, 0xada27e2d00000000, 0x04a9f76300000000,
+ 0x1a9d395100000000, 0xb396b01f00000000, 0x488a2bcc00000000,
+ 0xe181a28200000000, 0x624d019a00000000, 0xcb4688d400000000,
+ 0x305a130700000000, 0x99519a4900000000, 0x8765547b00000000,
+ 0x2e6edd3500000000, 0xd57246e600000000, 0x7c79cfa800000000,
+ 0xe91ada8300000000, 0x401153cd00000000, 0xbb0dc81e00000000,
+ 0x1206415000000000, 0x0c328f6200000000, 0xa539062c00000000,
+ 0x5e259dff00000000, 0xf72e14b100000000, 0xf17ec44600000000,
+ 0x58754d0800000000, 0xa369d6db00000000, 0x0a625f9500000000,
+ 0x145691a700000000, 0xbd5d18e900000000, 0x4641833a00000000,
+ 0xef4a0a7400000000, 0x7a291f5f00000000, 0xd322961100000000,
+ 0x283e0dc200000000, 0x8135848c00000000, 0x9f014abe00000000,
+ 0x360ac3f000000000, 0xcd16582300000000, 0x641dd16d00000000,
+ 0xe7d1727500000000, 0x4edafb3b00000000, 0xb5c660e800000000,
+ 0x1ccde9a600000000, 0x02f9279400000000, 0xabf2aeda00000000,
+ 0x50ee350900000000, 0xf9e5bc4700000000, 0x6c86a96c00000000,
+ 0xc58d202200000000, 0x3e91bbf100000000, 0x979a32bf00000000,
+ 0x89aefc8d00000000, 0x20a575c300000000, 0xdbb9ee1000000000,
+ 0x72b2675e00000000, 0xdd20a92100000000, 0x742b206f00000000,
+ 0x8f37bbbc00000000, 0x263c32f200000000, 0x3808fcc000000000,
+ 0x9103758e00000000, 0x6a1fee5d00000000, 0xc314671300000000,
+ 0x5677723800000000, 0xff7cfb7600000000, 0x046060a500000000,
+ 0xad6be9eb00000000, 0xb35f27d900000000, 0x1a54ae9700000000,
+ 0xe148354400000000, 0x4843bc0a00000000, 0xcb8f1f1200000000,
+ 0x6284965c00000000, 0x99980d8f00000000, 0x309384c100000000,
+ 0x2ea74af300000000, 0x87acc3bd00000000, 0x7cb0586e00000000,
+ 0xd5bbd12000000000, 0x40d8c40b00000000, 0xe9d34d4500000000,
+ 0x12cfd69600000000, 0xbbc45fd800000000, 0xa5f091ea00000000,
+ 0x0cfb18a400000000, 0xf7e7837700000000, 0x5eec0a3900000000,
+ 0xa9c21e8800000000, 0x00c997c600000000, 0xfbd50c1500000000,
+ 0x52de855b00000000, 0x4cea4b6900000000, 0xe5e1c22700000000,
+ 0x1efd59f400000000, 0xb7f6d0ba00000000, 0x2295c59100000000,
+ 0x8b9e4cdf00000000, 0x7082d70c00000000, 0xd9895e4200000000,
+ 0xc7bd907000000000, 0x6eb6193e00000000, 0x95aa82ed00000000,
+ 0x3ca10ba300000000, 0xbf6da8bb00000000, 0x166621f500000000,
+ 0xed7aba2600000000, 0x4471336800000000, 0x5a45fd5a00000000,
+ 0xf34e741400000000, 0x0852efc700000000, 0xa159668900000000,
+ 0x343a73a200000000, 0x9d31faec00000000, 0x662d613f00000000,
+ 0xcf26e87100000000, 0xd112264300000000, 0x7819af0d00000000,
+ 0x830534de00000000, 0x2a0ebd9000000000, 0x859c73ef00000000,
+ 0x2c97faa100000000, 0xd78b617200000000, 0x7e80e83c00000000,
+ 0x60b4260e00000000, 0xc9bfaf4000000000, 0x32a3349300000000,
+ 0x9ba8bddd00000000, 0x0ecba8f600000000, 0xa7c021b800000000,
+ 0x5cdcba6b00000000, 0xf5d7332500000000, 0xebe3fd1700000000,
+ 0x42e8745900000000, 0xb9f4ef8a00000000, 0x10ff66c400000000,
+ 0x9333c5dc00000000, 0x3a384c9200000000, 0xc124d74100000000,
+ 0x682f5e0f00000000, 0x761b903d00000000, 0xdf10197300000000,
+ 0x240c82a000000000, 0x8d070bee00000000, 0x18641ec500000000,
+ 0xb16f978b00000000, 0x4a730c5800000000, 0xe378851600000000,
+ 0xfd4c4b2400000000, 0x5447c26a00000000, 0xaf5b59b900000000,
+ 0x0650d0f700000000},
+ {0x0000000000000000, 0x479244af00000000, 0xcf22f88500000000,
+ 0x88b0bc2a00000000, 0xdf4381d000000000, 0x98d1c57f00000000,
+ 0x1061795500000000, 0x57f33dfa00000000, 0xff81737a00000000,
+ 0xb81337d500000000, 0x30a38bff00000000, 0x7731cf5000000000,
+ 0x20c2f2aa00000000, 0x6750b60500000000, 0xefe00a2f00000000,
+ 0xa8724e8000000000, 0xfe03e7f400000000, 0xb991a35b00000000,
+ 0x31211f7100000000, 0x76b35bde00000000, 0x2140662400000000,
+ 0x66d2228b00000000, 0xee629ea100000000, 0xa9f0da0e00000000,
+ 0x0182948e00000000, 0x4610d02100000000, 0xcea06c0b00000000,
+ 0x893228a400000000, 0xdec1155e00000000, 0x995351f100000000,
+ 0x11e3eddb00000000, 0x5671a97400000000, 0xbd01bf3200000000,
+ 0xfa93fb9d00000000, 0x722347b700000000, 0x35b1031800000000,
+ 0x62423ee200000000, 0x25d07a4d00000000, 0xad60c66700000000,
+ 0xeaf282c800000000, 0x4280cc4800000000, 0x051288e700000000,
+ 0x8da234cd00000000, 0xca30706200000000, 0x9dc34d9800000000,
+ 0xda51093700000000, 0x52e1b51d00000000, 0x1573f1b200000000,
+ 0x430258c600000000, 0x04901c6900000000, 0x8c20a04300000000,
+ 0xcbb2e4ec00000000, 0x9c41d91600000000, 0xdbd39db900000000,
+ 0x5363219300000000, 0x14f1653c00000000, 0xbc832bbc00000000,
+ 0xfb116f1300000000, 0x73a1d33900000000, 0x3433979600000000,
+ 0x63c0aa6c00000000, 0x2452eec300000000, 0xace252e900000000,
+ 0xeb70164600000000, 0x7a037e6500000000, 0x3d913aca00000000,
+ 0xb52186e000000000, 0xf2b3c24f00000000, 0xa540ffb500000000,
+ 0xe2d2bb1a00000000, 0x6a62073000000000, 0x2df0439f00000000,
+ 0x85820d1f00000000, 0xc21049b000000000, 0x4aa0f59a00000000,
+ 0x0d32b13500000000, 0x5ac18ccf00000000, 0x1d53c86000000000,
+ 0x95e3744a00000000, 0xd27130e500000000, 0x8400999100000000,
+ 0xc392dd3e00000000, 0x4b22611400000000, 0x0cb025bb00000000,
+ 0x5b43184100000000, 0x1cd15cee00000000, 0x9461e0c400000000,
+ 0xd3f3a46b00000000, 0x7b81eaeb00000000, 0x3c13ae4400000000,
+ 0xb4a3126e00000000, 0xf33156c100000000, 0xa4c26b3b00000000,
+ 0xe3502f9400000000, 0x6be093be00000000, 0x2c72d71100000000,
+ 0xc702c15700000000, 0x809085f800000000, 0x082039d200000000,
+ 0x4fb27d7d00000000, 0x1841408700000000, 0x5fd3042800000000,
+ 0xd763b80200000000, 0x90f1fcad00000000, 0x3883b22d00000000,
+ 0x7f11f68200000000, 0xf7a14aa800000000, 0xb0330e0700000000,
+ 0xe7c033fd00000000, 0xa052775200000000, 0x28e2cb7800000000,
+ 0x6f708fd700000000, 0x390126a300000000, 0x7e93620c00000000,
+ 0xf623de2600000000, 0xb1b19a8900000000, 0xe642a77300000000,
+ 0xa1d0e3dc00000000, 0x29605ff600000000, 0x6ef21b5900000000,
+ 0xc68055d900000000, 0x8112117600000000, 0x09a2ad5c00000000,
+ 0x4e30e9f300000000, 0x19c3d40900000000, 0x5e5190a600000000,
+ 0xd6e12c8c00000000, 0x9173682300000000, 0xf406fcca00000000,
+ 0xb394b86500000000, 0x3b24044f00000000, 0x7cb640e000000000,
+ 0x2b457d1a00000000, 0x6cd739b500000000, 0xe467859f00000000,
+ 0xa3f5c13000000000, 0x0b878fb000000000, 0x4c15cb1f00000000,
+ 0xc4a5773500000000, 0x8337339a00000000, 0xd4c40e6000000000,
+ 0x93564acf00000000, 0x1be6f6e500000000, 0x5c74b24a00000000,
+ 0x0a051b3e00000000, 0x4d975f9100000000, 0xc527e3bb00000000,
+ 0x82b5a71400000000, 0xd5469aee00000000, 0x92d4de4100000000,
+ 0x1a64626b00000000, 0x5df626c400000000, 0xf584684400000000,
+ 0xb2162ceb00000000, 0x3aa690c100000000, 0x7d34d46e00000000,
+ 0x2ac7e99400000000, 0x6d55ad3b00000000, 0xe5e5111100000000,
+ 0xa27755be00000000, 0x490743f800000000, 0x0e95075700000000,
+ 0x8625bb7d00000000, 0xc1b7ffd200000000, 0x9644c22800000000,
+ 0xd1d6868700000000, 0x59663aad00000000, 0x1ef47e0200000000,
+ 0xb686308200000000, 0xf114742d00000000, 0x79a4c80700000000,
+ 0x3e368ca800000000, 0x69c5b15200000000, 0x2e57f5fd00000000,
+ 0xa6e749d700000000, 0xe1750d7800000000, 0xb704a40c00000000,
+ 0xf096e0a300000000, 0x78265c8900000000, 0x3fb4182600000000,
+ 0x684725dc00000000, 0x2fd5617300000000, 0xa765dd5900000000,
+ 0xe0f799f600000000, 0x4885d77600000000, 0x0f1793d900000000,
+ 0x87a72ff300000000, 0xc0356b5c00000000, 0x97c656a600000000,
+ 0xd054120900000000, 0x58e4ae2300000000, 0x1f76ea8c00000000,
+ 0x8e0582af00000000, 0xc997c60000000000, 0x41277a2a00000000,
+ 0x06b53e8500000000, 0x5146037f00000000, 0x16d447d000000000,
+ 0x9e64fbfa00000000, 0xd9f6bf5500000000, 0x7184f1d500000000,
+ 0x3616b57a00000000, 0xbea6095000000000, 0xf9344dff00000000,
+ 0xaec7700500000000, 0xe95534aa00000000, 0x61e5888000000000,
+ 0x2677cc2f00000000, 0x7006655b00000000, 0x379421f400000000,
+ 0xbf249dde00000000, 0xf8b6d97100000000, 0xaf45e48b00000000,
+ 0xe8d7a02400000000, 0x60671c0e00000000, 0x27f558a100000000,
+ 0x8f87162100000000, 0xc815528e00000000, 0x40a5eea400000000,
+ 0x0737aa0b00000000, 0x50c497f100000000, 0x1756d35e00000000,
+ 0x9fe66f7400000000, 0xd8742bdb00000000, 0x33043d9d00000000,
+ 0x7496793200000000, 0xfc26c51800000000, 0xbbb481b700000000,
+ 0xec47bc4d00000000, 0xabd5f8e200000000, 0x236544c800000000,
+ 0x64f7006700000000, 0xcc854ee700000000, 0x8b170a4800000000,
+ 0x03a7b66200000000, 0x4435f2cd00000000, 0x13c6cf3700000000,
+ 0x54548b9800000000, 0xdce437b200000000, 0x9b76731d00000000,
+ 0xcd07da6900000000, 0x8a959ec600000000, 0x022522ec00000000,
+ 0x45b7664300000000, 0x12445bb900000000, 0x55d61f1600000000,
+ 0xdd66a33c00000000, 0x9af4e79300000000, 0x3286a91300000000,
+ 0x7514edbc00000000, 0xfda4519600000000, 0xba36153900000000,
+ 0xedc528c300000000, 0xaa576c6c00000000, 0x22e7d04600000000,
+ 0x657594e900000000}};
+
+#else /* W == 4 */
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0x65673b46, 0xcace768c, 0xafa94dca, 0x4eedeb59,
+ 0x2b8ad01f, 0x84239dd5, 0xe144a693, 0x9ddbd6b2, 0xf8bcedf4,
+ 0x5715a03e, 0x32729b78, 0xd3363deb, 0xb65106ad, 0x19f84b67,
+ 0x7c9f7021, 0xe0c6ab25, 0x85a19063, 0x2a08dda9, 0x4f6fe6ef,
+ 0xae2b407c, 0xcb4c7b3a, 0x64e536f0, 0x01820db6, 0x7d1d7d97,
+ 0x187a46d1, 0xb7d30b1b, 0xd2b4305d, 0x33f096ce, 0x5697ad88,
+ 0xf93ee042, 0x9c59db04, 0x1afc500b, 0x7f9b6b4d, 0xd0322687,
+ 0xb5551dc1, 0x5411bb52, 0x31768014, 0x9edfcdde, 0xfbb8f698,
+ 0x872786b9, 0xe240bdff, 0x4de9f035, 0x288ecb73, 0xc9ca6de0,
+ 0xacad56a6, 0x03041b6c, 0x6663202a, 0xfa3afb2e, 0x9f5dc068,
+ 0x30f48da2, 0x5593b6e4, 0xb4d71077, 0xd1b02b31, 0x7e1966fb,
+ 0x1b7e5dbd, 0x67e12d9c, 0x028616da, 0xad2f5b10, 0xc8486056,
+ 0x290cc6c5, 0x4c6bfd83, 0xe3c2b049, 0x86a58b0f, 0x35f8a016,
+ 0x509f9b50, 0xff36d69a, 0x9a51eddc, 0x7b154b4f, 0x1e727009,
+ 0xb1db3dc3, 0xd4bc0685, 0xa82376a4, 0xcd444de2, 0x62ed0028,
+ 0x078a3b6e, 0xe6ce9dfd, 0x83a9a6bb, 0x2c00eb71, 0x4967d037,
+ 0xd53e0b33, 0xb0593075, 0x1ff07dbf, 0x7a9746f9, 0x9bd3e06a,
+ 0xfeb4db2c, 0x511d96e6, 0x347aada0, 0x48e5dd81, 0x2d82e6c7,
+ 0x822bab0d, 0xe74c904b, 0x060836d8, 0x636f0d9e, 0xccc64054,
+ 0xa9a17b12, 0x2f04f01d, 0x4a63cb5b, 0xe5ca8691, 0x80adbdd7,
+ 0x61e91b44, 0x048e2002, 0xab276dc8, 0xce40568e, 0xb2df26af,
+ 0xd7b81de9, 0x78115023, 0x1d766b65, 0xfc32cdf6, 0x9955f6b0,
+ 0x36fcbb7a, 0x539b803c, 0xcfc25b38, 0xaaa5607e, 0x050c2db4,
+ 0x606b16f2, 0x812fb061, 0xe4488b27, 0x4be1c6ed, 0x2e86fdab,
+ 0x52198d8a, 0x377eb6cc, 0x98d7fb06, 0xfdb0c040, 0x1cf466d3,
+ 0x79935d95, 0xd63a105f, 0xb35d2b19, 0x6bf1402c, 0x0e967b6a,
+ 0xa13f36a0, 0xc4580de6, 0x251cab75, 0x407b9033, 0xefd2ddf9,
+ 0x8ab5e6bf, 0xf62a969e, 0x934dadd8, 0x3ce4e012, 0x5983db54,
+ 0xb8c77dc7, 0xdda04681, 0x72090b4b, 0x176e300d, 0x8b37eb09,
+ 0xee50d04f, 0x41f99d85, 0x249ea6c3, 0xc5da0050, 0xa0bd3b16,
+ 0x0f1476dc, 0x6a734d9a, 0x16ec3dbb, 0x738b06fd, 0xdc224b37,
+ 0xb9457071, 0x5801d6e2, 0x3d66eda4, 0x92cfa06e, 0xf7a89b28,
+ 0x710d1027, 0x146a2b61, 0xbbc366ab, 0xdea45ded, 0x3fe0fb7e,
+ 0x5a87c038, 0xf52e8df2, 0x9049b6b4, 0xecd6c695, 0x89b1fdd3,
+ 0x2618b019, 0x437f8b5f, 0xa23b2dcc, 0xc75c168a, 0x68f55b40,
+ 0x0d926006, 0x91cbbb02, 0xf4ac8044, 0x5b05cd8e, 0x3e62f6c8,
+ 0xdf26505b, 0xba416b1d, 0x15e826d7, 0x708f1d91, 0x0c106db0,
+ 0x697756f6, 0xc6de1b3c, 0xa3b9207a, 0x42fd86e9, 0x279abdaf,
+ 0x8833f065, 0xed54cb23, 0x5e09e03a, 0x3b6edb7c, 0x94c796b6,
+ 0xf1a0adf0, 0x10e40b63, 0x75833025, 0xda2a7def, 0xbf4d46a9,
+ 0xc3d23688, 0xa6b50dce, 0x091c4004, 0x6c7b7b42, 0x8d3fddd1,
+ 0xe858e697, 0x47f1ab5d, 0x2296901b, 0xbecf4b1f, 0xdba87059,
+ 0x74013d93, 0x116606d5, 0xf022a046, 0x95459b00, 0x3aecd6ca,
+ 0x5f8bed8c, 0x23149dad, 0x4673a6eb, 0xe9daeb21, 0x8cbdd067,
+ 0x6df976f4, 0x089e4db2, 0xa7370078, 0xc2503b3e, 0x44f5b031,
+ 0x21928b77, 0x8e3bc6bd, 0xeb5cfdfb, 0x0a185b68, 0x6f7f602e,
+ 0xc0d62de4, 0xa5b116a2, 0xd92e6683, 0xbc495dc5, 0x13e0100f,
+ 0x76872b49, 0x97c38dda, 0xf2a4b69c, 0x5d0dfb56, 0x386ac010,
+ 0xa4331b14, 0xc1542052, 0x6efd6d98, 0x0b9a56de, 0xeadef04d,
+ 0x8fb9cb0b, 0x201086c1, 0x4577bd87, 0x39e8cda6, 0x5c8ff6e0,
+ 0xf326bb2a, 0x9641806c, 0x770526ff, 0x12621db9, 0xbdcb5073,
+ 0xd8ac6b35},
+ {0x00000000, 0xd7e28058, 0x74b406f1, 0xa35686a9, 0xe9680de2,
+ 0x3e8a8dba, 0x9ddc0b13, 0x4a3e8b4b, 0x09a11d85, 0xde439ddd,
+ 0x7d151b74, 0xaaf79b2c, 0xe0c91067, 0x372b903f, 0x947d1696,
+ 0x439f96ce, 0x13423b0a, 0xc4a0bb52, 0x67f63dfb, 0xb014bda3,
+ 0xfa2a36e8, 0x2dc8b6b0, 0x8e9e3019, 0x597cb041, 0x1ae3268f,
+ 0xcd01a6d7, 0x6e57207e, 0xb9b5a026, 0xf38b2b6d, 0x2469ab35,
+ 0x873f2d9c, 0x50ddadc4, 0x26847614, 0xf166f64c, 0x523070e5,
+ 0x85d2f0bd, 0xcfec7bf6, 0x180efbae, 0xbb587d07, 0x6cbafd5f,
+ 0x2f256b91, 0xf8c7ebc9, 0x5b916d60, 0x8c73ed38, 0xc64d6673,
+ 0x11afe62b, 0xb2f96082, 0x651be0da, 0x35c64d1e, 0xe224cd46,
+ 0x41724bef, 0x9690cbb7, 0xdcae40fc, 0x0b4cc0a4, 0xa81a460d,
+ 0x7ff8c655, 0x3c67509b, 0xeb85d0c3, 0x48d3566a, 0x9f31d632,
+ 0xd50f5d79, 0x02eddd21, 0xa1bb5b88, 0x7659dbd0, 0x4d08ec28,
+ 0x9aea6c70, 0x39bcead9, 0xee5e6a81, 0xa460e1ca, 0x73826192,
+ 0xd0d4e73b, 0x07366763, 0x44a9f1ad, 0x934b71f5, 0x301df75c,
+ 0xe7ff7704, 0xadc1fc4f, 0x7a237c17, 0xd975fabe, 0x0e977ae6,
+ 0x5e4ad722, 0x89a8577a, 0x2afed1d3, 0xfd1c518b, 0xb722dac0,
+ 0x60c05a98, 0xc396dc31, 0x14745c69, 0x57ebcaa7, 0x80094aff,
+ 0x235fcc56, 0xf4bd4c0e, 0xbe83c745, 0x6961471d, 0xca37c1b4,
+ 0x1dd541ec, 0x6b8c9a3c, 0xbc6e1a64, 0x1f389ccd, 0xc8da1c95,
+ 0x82e497de, 0x55061786, 0xf650912f, 0x21b21177, 0x622d87b9,
+ 0xb5cf07e1, 0x16998148, 0xc17b0110, 0x8b458a5b, 0x5ca70a03,
+ 0xfff18caa, 0x28130cf2, 0x78cea136, 0xaf2c216e, 0x0c7aa7c7,
+ 0xdb98279f, 0x91a6acd4, 0x46442c8c, 0xe512aa25, 0x32f02a7d,
+ 0x716fbcb3, 0xa68d3ceb, 0x05dbba42, 0xd2393a1a, 0x9807b151,
+ 0x4fe53109, 0xecb3b7a0, 0x3b5137f8, 0x9a11d850, 0x4df35808,
+ 0xeea5dea1, 0x39475ef9, 0x7379d5b2, 0xa49b55ea, 0x07cdd343,
+ 0xd02f531b, 0x93b0c5d5, 0x4452458d, 0xe704c324, 0x30e6437c,
+ 0x7ad8c837, 0xad3a486f, 0x0e6ccec6, 0xd98e4e9e, 0x8953e35a,
+ 0x5eb16302, 0xfde7e5ab, 0x2a0565f3, 0x603beeb8, 0xb7d96ee0,
+ 0x148fe849, 0xc36d6811, 0x80f2fedf, 0x57107e87, 0xf446f82e,
+ 0x23a47876, 0x699af33d, 0xbe787365, 0x1d2ef5cc, 0xcacc7594,
+ 0xbc95ae44, 0x6b772e1c, 0xc821a8b5, 0x1fc328ed, 0x55fda3a6,
+ 0x821f23fe, 0x2149a557, 0xf6ab250f, 0xb534b3c1, 0x62d63399,
+ 0xc180b530, 0x16623568, 0x5c5cbe23, 0x8bbe3e7b, 0x28e8b8d2,
+ 0xff0a388a, 0xafd7954e, 0x78351516, 0xdb6393bf, 0x0c8113e7,
+ 0x46bf98ac, 0x915d18f4, 0x320b9e5d, 0xe5e91e05, 0xa67688cb,
+ 0x71940893, 0xd2c28e3a, 0x05200e62, 0x4f1e8529, 0x98fc0571,
+ 0x3baa83d8, 0xec480380, 0xd7193478, 0x00fbb420, 0xa3ad3289,
+ 0x744fb2d1, 0x3e71399a, 0xe993b9c2, 0x4ac53f6b, 0x9d27bf33,
+ 0xdeb829fd, 0x095aa9a5, 0xaa0c2f0c, 0x7deeaf54, 0x37d0241f,
+ 0xe032a447, 0x436422ee, 0x9486a2b6, 0xc45b0f72, 0x13b98f2a,
+ 0xb0ef0983, 0x670d89db, 0x2d330290, 0xfad182c8, 0x59870461,
+ 0x8e658439, 0xcdfa12f7, 0x1a1892af, 0xb94e1406, 0x6eac945e,
+ 0x24921f15, 0xf3709f4d, 0x502619e4, 0x87c499bc, 0xf19d426c,
+ 0x267fc234, 0x8529449d, 0x52cbc4c5, 0x18f54f8e, 0xcf17cfd6,
+ 0x6c41497f, 0xbba3c927, 0xf83c5fe9, 0x2fdedfb1, 0x8c885918,
+ 0x5b6ad940, 0x1154520b, 0xc6b6d253, 0x65e054fa, 0xb202d4a2,
+ 0xe2df7966, 0x353df93e, 0x966b7f97, 0x4189ffcf, 0x0bb77484,
+ 0xdc55f4dc, 0x7f037275, 0xa8e1f22d, 0xeb7e64e3, 0x3c9ce4bb,
+ 0x9fca6212, 0x4828e24a, 0x02166901, 0xd5f4e959, 0x76a26ff0,
+ 0xa140efa8},
+ {0x00000000, 0xef52b6e1, 0x05d46b83, 0xea86dd62, 0x0ba8d706,
+ 0xe4fa61e7, 0x0e7cbc85, 0xe12e0a64, 0x1751ae0c, 0xf80318ed,
+ 0x1285c58f, 0xfdd7736e, 0x1cf9790a, 0xf3abcfeb, 0x192d1289,
+ 0xf67fa468, 0x2ea35c18, 0xc1f1eaf9, 0x2b77379b, 0xc425817a,
+ 0x250b8b1e, 0xca593dff, 0x20dfe09d, 0xcf8d567c, 0x39f2f214,
+ 0xd6a044f5, 0x3c269997, 0xd3742f76, 0x325a2512, 0xdd0893f3,
+ 0x378e4e91, 0xd8dcf870, 0x5d46b830, 0xb2140ed1, 0x5892d3b3,
+ 0xb7c06552, 0x56ee6f36, 0xb9bcd9d7, 0x533a04b5, 0xbc68b254,
+ 0x4a17163c, 0xa545a0dd, 0x4fc37dbf, 0xa091cb5e, 0x41bfc13a,
+ 0xaeed77db, 0x446baab9, 0xab391c58, 0x73e5e428, 0x9cb752c9,
+ 0x76318fab, 0x9963394a, 0x784d332e, 0x971f85cf, 0x7d9958ad,
+ 0x92cbee4c, 0x64b44a24, 0x8be6fcc5, 0x616021a7, 0x8e329746,
+ 0x6f1c9d22, 0x804e2bc3, 0x6ac8f6a1, 0x859a4040, 0xba8d7060,
+ 0x55dfc681, 0xbf591be3, 0x500bad02, 0xb125a766, 0x5e771187,
+ 0xb4f1cce5, 0x5ba37a04, 0xaddcde6c, 0x428e688d, 0xa808b5ef,
+ 0x475a030e, 0xa674096a, 0x4926bf8b, 0xa3a062e9, 0x4cf2d408,
+ 0x942e2c78, 0x7b7c9a99, 0x91fa47fb, 0x7ea8f11a, 0x9f86fb7e,
+ 0x70d44d9f, 0x9a5290fd, 0x7500261c, 0x837f8274, 0x6c2d3495,
+ 0x86abe9f7, 0x69f95f16, 0x88d75572, 0x6785e393, 0x8d033ef1,
+ 0x62518810, 0xe7cbc850, 0x08997eb1, 0xe21fa3d3, 0x0d4d1532,
+ 0xec631f56, 0x0331a9b7, 0xe9b774d5, 0x06e5c234, 0xf09a665c,
+ 0x1fc8d0bd, 0xf54e0ddf, 0x1a1cbb3e, 0xfb32b15a, 0x146007bb,
+ 0xfee6dad9, 0x11b46c38, 0xc9689448, 0x263a22a9, 0xccbcffcb,
+ 0x23ee492a, 0xc2c0434e, 0x2d92f5af, 0xc71428cd, 0x28469e2c,
+ 0xde393a44, 0x316b8ca5, 0xdbed51c7, 0x34bfe726, 0xd591ed42,
+ 0x3ac35ba3, 0xd04586c1, 0x3f173020, 0xae6be681, 0x41395060,
+ 0xabbf8d02, 0x44ed3be3, 0xa5c33187, 0x4a918766, 0xa0175a04,
+ 0x4f45ece5, 0xb93a488d, 0x5668fe6c, 0xbcee230e, 0x53bc95ef,
+ 0xb2929f8b, 0x5dc0296a, 0xb746f408, 0x581442e9, 0x80c8ba99,
+ 0x6f9a0c78, 0x851cd11a, 0x6a4e67fb, 0x8b606d9f, 0x6432db7e,
+ 0x8eb4061c, 0x61e6b0fd, 0x97991495, 0x78cba274, 0x924d7f16,
+ 0x7d1fc9f7, 0x9c31c393, 0x73637572, 0x99e5a810, 0x76b71ef1,
+ 0xf32d5eb1, 0x1c7fe850, 0xf6f93532, 0x19ab83d3, 0xf88589b7,
+ 0x17d73f56, 0xfd51e234, 0x120354d5, 0xe47cf0bd, 0x0b2e465c,
+ 0xe1a89b3e, 0x0efa2ddf, 0xefd427bb, 0x0086915a, 0xea004c38,
+ 0x0552fad9, 0xdd8e02a9, 0x32dcb448, 0xd85a692a, 0x3708dfcb,
+ 0xd626d5af, 0x3974634e, 0xd3f2be2c, 0x3ca008cd, 0xcadfaca5,
+ 0x258d1a44, 0xcf0bc726, 0x205971c7, 0xc1777ba3, 0x2e25cd42,
+ 0xc4a31020, 0x2bf1a6c1, 0x14e696e1, 0xfbb42000, 0x1132fd62,
+ 0xfe604b83, 0x1f4e41e7, 0xf01cf706, 0x1a9a2a64, 0xf5c89c85,
+ 0x03b738ed, 0xece58e0c, 0x0663536e, 0xe931e58f, 0x081fefeb,
+ 0xe74d590a, 0x0dcb8468, 0xe2993289, 0x3a45caf9, 0xd5177c18,
+ 0x3f91a17a, 0xd0c3179b, 0x31ed1dff, 0xdebfab1e, 0x3439767c,
+ 0xdb6bc09d, 0x2d1464f5, 0xc246d214, 0x28c00f76, 0xc792b997,
+ 0x26bcb3f3, 0xc9ee0512, 0x2368d870, 0xcc3a6e91, 0x49a02ed1,
+ 0xa6f29830, 0x4c744552, 0xa326f3b3, 0x4208f9d7, 0xad5a4f36,
+ 0x47dc9254, 0xa88e24b5, 0x5ef180dd, 0xb1a3363c, 0x5b25eb5e,
+ 0xb4775dbf, 0x555957db, 0xba0be13a, 0x508d3c58, 0xbfdf8ab9,
+ 0x670372c9, 0x8851c428, 0x62d7194a, 0x8d85afab, 0x6caba5cf,
+ 0x83f9132e, 0x697fce4c, 0x862d78ad, 0x7052dcc5, 0x9f006a24,
+ 0x7586b746, 0x9ad401a7, 0x7bfa0bc3, 0x94a8bd22, 0x7e2e6040,
+ 0x917cd6a1},
+ {0x00000000, 0x87a6cb43, 0xd43c90c7, 0x539a5b84, 0x730827cf,
+ 0xf4aeec8c, 0xa734b708, 0x20927c4b, 0xe6104f9e, 0x61b684dd,
+ 0x322cdf59, 0xb58a141a, 0x95186851, 0x12bea312, 0x4124f896,
+ 0xc68233d5, 0x1751997d, 0x90f7523e, 0xc36d09ba, 0x44cbc2f9,
+ 0x6459beb2, 0xe3ff75f1, 0xb0652e75, 0x37c3e536, 0xf141d6e3,
+ 0x76e71da0, 0x257d4624, 0xa2db8d67, 0x8249f12c, 0x05ef3a6f,
+ 0x567561eb, 0xd1d3aaa8, 0x2ea332fa, 0xa905f9b9, 0xfa9fa23d,
+ 0x7d39697e, 0x5dab1535, 0xda0dde76, 0x899785f2, 0x0e314eb1,
+ 0xc8b37d64, 0x4f15b627, 0x1c8feda3, 0x9b2926e0, 0xbbbb5aab,
+ 0x3c1d91e8, 0x6f87ca6c, 0xe821012f, 0x39f2ab87, 0xbe5460c4,
+ 0xedce3b40, 0x6a68f003, 0x4afa8c48, 0xcd5c470b, 0x9ec61c8f,
+ 0x1960d7cc, 0xdfe2e419, 0x58442f5a, 0x0bde74de, 0x8c78bf9d,
+ 0xaceac3d6, 0x2b4c0895, 0x78d65311, 0xff709852, 0x5d4665f4,
+ 0xdae0aeb7, 0x897af533, 0x0edc3e70, 0x2e4e423b, 0xa9e88978,
+ 0xfa72d2fc, 0x7dd419bf, 0xbb562a6a, 0x3cf0e129, 0x6f6abaad,
+ 0xe8cc71ee, 0xc85e0da5, 0x4ff8c6e6, 0x1c629d62, 0x9bc45621,
+ 0x4a17fc89, 0xcdb137ca, 0x9e2b6c4e, 0x198da70d, 0x391fdb46,
+ 0xbeb91005, 0xed234b81, 0x6a8580c2, 0xac07b317, 0x2ba17854,
+ 0x783b23d0, 0xff9de893, 0xdf0f94d8, 0x58a95f9b, 0x0b33041f,
+ 0x8c95cf5c, 0x73e5570e, 0xf4439c4d, 0xa7d9c7c9, 0x207f0c8a,
+ 0x00ed70c1, 0x874bbb82, 0xd4d1e006, 0x53772b45, 0x95f51890,
+ 0x1253d3d3, 0x41c98857, 0xc66f4314, 0xe6fd3f5f, 0x615bf41c,
+ 0x32c1af98, 0xb56764db, 0x64b4ce73, 0xe3120530, 0xb0885eb4,
+ 0x372e95f7, 0x17bce9bc, 0x901a22ff, 0xc380797b, 0x4426b238,
+ 0x82a481ed, 0x05024aae, 0x5698112a, 0xd13eda69, 0xf1aca622,
+ 0x760a6d61, 0x259036e5, 0xa236fda6, 0xba8ccbe8, 0x3d2a00ab,
+ 0x6eb05b2f, 0xe916906c, 0xc984ec27, 0x4e222764, 0x1db87ce0,
+ 0x9a1eb7a3, 0x5c9c8476, 0xdb3a4f35, 0x88a014b1, 0x0f06dff2,
+ 0x2f94a3b9, 0xa83268fa, 0xfba8337e, 0x7c0ef83d, 0xaddd5295,
+ 0x2a7b99d6, 0x79e1c252, 0xfe470911, 0xded5755a, 0x5973be19,
+ 0x0ae9e59d, 0x8d4f2ede, 0x4bcd1d0b, 0xcc6bd648, 0x9ff18dcc,
+ 0x1857468f, 0x38c53ac4, 0xbf63f187, 0xecf9aa03, 0x6b5f6140,
+ 0x942ff912, 0x13893251, 0x401369d5, 0xc7b5a296, 0xe727dedd,
+ 0x6081159e, 0x331b4e1a, 0xb4bd8559, 0x723fb68c, 0xf5997dcf,
+ 0xa603264b, 0x21a5ed08, 0x01379143, 0x86915a00, 0xd50b0184,
+ 0x52adcac7, 0x837e606f, 0x04d8ab2c, 0x5742f0a8, 0xd0e43beb,
+ 0xf07647a0, 0x77d08ce3, 0x244ad767, 0xa3ec1c24, 0x656e2ff1,
+ 0xe2c8e4b2, 0xb152bf36, 0x36f47475, 0x1666083e, 0x91c0c37d,
+ 0xc25a98f9, 0x45fc53ba, 0xe7caae1c, 0x606c655f, 0x33f63edb,
+ 0xb450f598, 0x94c289d3, 0x13644290, 0x40fe1914, 0xc758d257,
+ 0x01dae182, 0x867c2ac1, 0xd5e67145, 0x5240ba06, 0x72d2c64d,
+ 0xf5740d0e, 0xa6ee568a, 0x21489dc9, 0xf09b3761, 0x773dfc22,
+ 0x24a7a7a6, 0xa3016ce5, 0x839310ae, 0x0435dbed, 0x57af8069,
+ 0xd0094b2a, 0x168b78ff, 0x912db3bc, 0xc2b7e838, 0x4511237b,
+ 0x65835f30, 0xe2259473, 0xb1bfcff7, 0x361904b4, 0xc9699ce6,
+ 0x4ecf57a5, 0x1d550c21, 0x9af3c762, 0xba61bb29, 0x3dc7706a,
+ 0x6e5d2bee, 0xe9fbe0ad, 0x2f79d378, 0xa8df183b, 0xfb4543bf,
+ 0x7ce388fc, 0x5c71f4b7, 0xdbd73ff4, 0x884d6470, 0x0febaf33,
+ 0xde38059b, 0x599eced8, 0x0a04955c, 0x8da25e1f, 0xad302254,
+ 0x2a96e917, 0x790cb293, 0xfeaa79d0, 0x38284a05, 0xbf8e8146,
+ 0xec14dac2, 0x6bb21181, 0x4b206dca, 0xcc86a689, 0x9f1cfd0d,
+ 0x18ba364e}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x00000000, 0x43cba687, 0xc7903cd4, 0x845b9a53, 0xcf270873,
+ 0x8cecaef4, 0x08b734a7, 0x4b7c9220, 0x9e4f10e6, 0xdd84b661,
+ 0x59df2c32, 0x1a148ab5, 0x51681895, 0x12a3be12, 0x96f82441,
+ 0xd53382c6, 0x7d995117, 0x3e52f790, 0xba096dc3, 0xf9c2cb44,
+ 0xb2be5964, 0xf175ffe3, 0x752e65b0, 0x36e5c337, 0xe3d641f1,
+ 0xa01de776, 0x24467d25, 0x678ddba2, 0x2cf14982, 0x6f3aef05,
+ 0xeb617556, 0xa8aad3d1, 0xfa32a32e, 0xb9f905a9, 0x3da29ffa,
+ 0x7e69397d, 0x3515ab5d, 0x76de0dda, 0xf2859789, 0xb14e310e,
+ 0x647db3c8, 0x27b6154f, 0xa3ed8f1c, 0xe026299b, 0xab5abbbb,
+ 0xe8911d3c, 0x6cca876f, 0x2f0121e8, 0x87abf239, 0xc46054be,
+ 0x403bceed, 0x03f0686a, 0x488cfa4a, 0x0b475ccd, 0x8f1cc69e,
+ 0xccd76019, 0x19e4e2df, 0x5a2f4458, 0xde74de0b, 0x9dbf788c,
+ 0xd6c3eaac, 0x95084c2b, 0x1153d678, 0x529870ff, 0xf465465d,
+ 0xb7aee0da, 0x33f57a89, 0x703edc0e, 0x3b424e2e, 0x7889e8a9,
+ 0xfcd272fa, 0xbf19d47d, 0x6a2a56bb, 0x29e1f03c, 0xadba6a6f,
+ 0xee71cce8, 0xa50d5ec8, 0xe6c6f84f, 0x629d621c, 0x2156c49b,
+ 0x89fc174a, 0xca37b1cd, 0x4e6c2b9e, 0x0da78d19, 0x46db1f39,
+ 0x0510b9be, 0x814b23ed, 0xc280856a, 0x17b307ac, 0x5478a12b,
+ 0xd0233b78, 0x93e89dff, 0xd8940fdf, 0x9b5fa958, 0x1f04330b,
+ 0x5ccf958c, 0x0e57e573, 0x4d9c43f4, 0xc9c7d9a7, 0x8a0c7f20,
+ 0xc170ed00, 0x82bb4b87, 0x06e0d1d4, 0x452b7753, 0x9018f595,
+ 0xd3d35312, 0x5788c941, 0x14436fc6, 0x5f3ffde6, 0x1cf45b61,
+ 0x98afc132, 0xdb6467b5, 0x73ceb464, 0x300512e3, 0xb45e88b0,
+ 0xf7952e37, 0xbce9bc17, 0xff221a90, 0x7b7980c3, 0x38b22644,
+ 0xed81a482, 0xae4a0205, 0x2a119856, 0x69da3ed1, 0x22a6acf1,
+ 0x616d0a76, 0xe5369025, 0xa6fd36a2, 0xe8cb8cba, 0xab002a3d,
+ 0x2f5bb06e, 0x6c9016e9, 0x27ec84c9, 0x6427224e, 0xe07cb81d,
+ 0xa3b71e9a, 0x76849c5c, 0x354f3adb, 0xb114a088, 0xf2df060f,
+ 0xb9a3942f, 0xfa6832a8, 0x7e33a8fb, 0x3df80e7c, 0x9552ddad,
+ 0xd6997b2a, 0x52c2e179, 0x110947fe, 0x5a75d5de, 0x19be7359,
+ 0x9de5e90a, 0xde2e4f8d, 0x0b1dcd4b, 0x48d66bcc, 0xcc8df19f,
+ 0x8f465718, 0xc43ac538, 0x87f163bf, 0x03aaf9ec, 0x40615f6b,
+ 0x12f92f94, 0x51328913, 0xd5691340, 0x96a2b5c7, 0xddde27e7,
+ 0x9e158160, 0x1a4e1b33, 0x5985bdb4, 0x8cb63f72, 0xcf7d99f5,
+ 0x4b2603a6, 0x08eda521, 0x43913701, 0x005a9186, 0x84010bd5,
+ 0xc7caad52, 0x6f607e83, 0x2cabd804, 0xa8f04257, 0xeb3be4d0,
+ 0xa04776f0, 0xe38cd077, 0x67d74a24, 0x241ceca3, 0xf12f6e65,
+ 0xb2e4c8e2, 0x36bf52b1, 0x7574f436, 0x3e086616, 0x7dc3c091,
+ 0xf9985ac2, 0xba53fc45, 0x1caecae7, 0x5f656c60, 0xdb3ef633,
+ 0x98f550b4, 0xd389c294, 0x90426413, 0x1419fe40, 0x57d258c7,
+ 0x82e1da01, 0xc12a7c86, 0x4571e6d5, 0x06ba4052, 0x4dc6d272,
+ 0x0e0d74f5, 0x8a56eea6, 0xc99d4821, 0x61379bf0, 0x22fc3d77,
+ 0xa6a7a724, 0xe56c01a3, 0xae109383, 0xeddb3504, 0x6980af57,
+ 0x2a4b09d0, 0xff788b16, 0xbcb32d91, 0x38e8b7c2, 0x7b231145,
+ 0x305f8365, 0x739425e2, 0xf7cfbfb1, 0xb4041936, 0xe69c69c9,
+ 0xa557cf4e, 0x210c551d, 0x62c7f39a, 0x29bb61ba, 0x6a70c73d,
+ 0xee2b5d6e, 0xade0fbe9, 0x78d3792f, 0x3b18dfa8, 0xbf4345fb,
+ 0xfc88e37c, 0xb7f4715c, 0xf43fd7db, 0x70644d88, 0x33afeb0f,
+ 0x9b0538de, 0xd8ce9e59, 0x5c95040a, 0x1f5ea28d, 0x542230ad,
+ 0x17e9962a, 0x93b20c79, 0xd079aafe, 0x054a2838, 0x46818ebf,
+ 0xc2da14ec, 0x8111b26b, 0xca6d204b, 0x89a686cc, 0x0dfd1c9f,
+ 0x4e36ba18},
+ {0x00000000, 0xe1b652ef, 0x836bd405, 0x62dd86ea, 0x06d7a80b,
+ 0xe761fae4, 0x85bc7c0e, 0x640a2ee1, 0x0cae5117, 0xed1803f8,
+ 0x8fc58512, 0x6e73d7fd, 0x0a79f91c, 0xebcfabf3, 0x89122d19,
+ 0x68a47ff6, 0x185ca32e, 0xf9eaf1c1, 0x9b37772b, 0x7a8125c4,
+ 0x1e8b0b25, 0xff3d59ca, 0x9de0df20, 0x7c568dcf, 0x14f2f239,
+ 0xf544a0d6, 0x9799263c, 0x762f74d3, 0x12255a32, 0xf39308dd,
+ 0x914e8e37, 0x70f8dcd8, 0x30b8465d, 0xd10e14b2, 0xb3d39258,
+ 0x5265c0b7, 0x366fee56, 0xd7d9bcb9, 0xb5043a53, 0x54b268bc,
+ 0x3c16174a, 0xdda045a5, 0xbf7dc34f, 0x5ecb91a0, 0x3ac1bf41,
+ 0xdb77edae, 0xb9aa6b44, 0x581c39ab, 0x28e4e573, 0xc952b79c,
+ 0xab8f3176, 0x4a396399, 0x2e334d78, 0xcf851f97, 0xad58997d,
+ 0x4ceecb92, 0x244ab464, 0xc5fce68b, 0xa7216061, 0x4697328e,
+ 0x229d1c6f, 0xc32b4e80, 0xa1f6c86a, 0x40409a85, 0x60708dba,
+ 0x81c6df55, 0xe31b59bf, 0x02ad0b50, 0x66a725b1, 0x8711775e,
+ 0xe5ccf1b4, 0x047aa35b, 0x6cdedcad, 0x8d688e42, 0xefb508a8,
+ 0x0e035a47, 0x6a0974a6, 0x8bbf2649, 0xe962a0a3, 0x08d4f24c,
+ 0x782c2e94, 0x999a7c7b, 0xfb47fa91, 0x1af1a87e, 0x7efb869f,
+ 0x9f4dd470, 0xfd90529a, 0x1c260075, 0x74827f83, 0x95342d6c,
+ 0xf7e9ab86, 0x165ff969, 0x7255d788, 0x93e38567, 0xf13e038d,
+ 0x10885162, 0x50c8cbe7, 0xb17e9908, 0xd3a31fe2, 0x32154d0d,
+ 0x561f63ec, 0xb7a93103, 0xd574b7e9, 0x34c2e506, 0x5c669af0,
+ 0xbdd0c81f, 0xdf0d4ef5, 0x3ebb1c1a, 0x5ab132fb, 0xbb076014,
+ 0xd9dae6fe, 0x386cb411, 0x489468c9, 0xa9223a26, 0xcbffbccc,
+ 0x2a49ee23, 0x4e43c0c2, 0xaff5922d, 0xcd2814c7, 0x2c9e4628,
+ 0x443a39de, 0xa58c6b31, 0xc751eddb, 0x26e7bf34, 0x42ed91d5,
+ 0xa35bc33a, 0xc18645d0, 0x2030173f, 0x81e66bae, 0x60503941,
+ 0x028dbfab, 0xe33bed44, 0x8731c3a5, 0x6687914a, 0x045a17a0,
+ 0xe5ec454f, 0x8d483ab9, 0x6cfe6856, 0x0e23eebc, 0xef95bc53,
+ 0x8b9f92b2, 0x6a29c05d, 0x08f446b7, 0xe9421458, 0x99bac880,
+ 0x780c9a6f, 0x1ad11c85, 0xfb674e6a, 0x9f6d608b, 0x7edb3264,
+ 0x1c06b48e, 0xfdb0e661, 0x95149997, 0x74a2cb78, 0x167f4d92,
+ 0xf7c91f7d, 0x93c3319c, 0x72756373, 0x10a8e599, 0xf11eb776,
+ 0xb15e2df3, 0x50e87f1c, 0x3235f9f6, 0xd383ab19, 0xb78985f8,
+ 0x563fd717, 0x34e251fd, 0xd5540312, 0xbdf07ce4, 0x5c462e0b,
+ 0x3e9ba8e1, 0xdf2dfa0e, 0xbb27d4ef, 0x5a918600, 0x384c00ea,
+ 0xd9fa5205, 0xa9028edd, 0x48b4dc32, 0x2a695ad8, 0xcbdf0837,
+ 0xafd526d6, 0x4e637439, 0x2cbef2d3, 0xcd08a03c, 0xa5acdfca,
+ 0x441a8d25, 0x26c70bcf, 0xc7715920, 0xa37b77c1, 0x42cd252e,
+ 0x2010a3c4, 0xc1a6f12b, 0xe196e614, 0x0020b4fb, 0x62fd3211,
+ 0x834b60fe, 0xe7414e1f, 0x06f71cf0, 0x642a9a1a, 0x859cc8f5,
+ 0xed38b703, 0x0c8ee5ec, 0x6e536306, 0x8fe531e9, 0xebef1f08,
+ 0x0a594de7, 0x6884cb0d, 0x893299e2, 0xf9ca453a, 0x187c17d5,
+ 0x7aa1913f, 0x9b17c3d0, 0xff1ded31, 0x1eabbfde, 0x7c763934,
+ 0x9dc06bdb, 0xf564142d, 0x14d246c2, 0x760fc028, 0x97b992c7,
+ 0xf3b3bc26, 0x1205eec9, 0x70d86823, 0x916e3acc, 0xd12ea049,
+ 0x3098f2a6, 0x5245744c, 0xb3f326a3, 0xd7f90842, 0x364f5aad,
+ 0x5492dc47, 0xb5248ea8, 0xdd80f15e, 0x3c36a3b1, 0x5eeb255b,
+ 0xbf5d77b4, 0xdb575955, 0x3ae10bba, 0x583c8d50, 0xb98adfbf,
+ 0xc9720367, 0x28c45188, 0x4a19d762, 0xabaf858d, 0xcfa5ab6c,
+ 0x2e13f983, 0x4cce7f69, 0xad782d86, 0xc5dc5270, 0x246a009f,
+ 0x46b78675, 0xa701d49a, 0xc30bfa7b, 0x22bda894, 0x40602e7e,
+ 0xa1d67c91},
+ {0x00000000, 0x5880e2d7, 0xf106b474, 0xa98656a3, 0xe20d68e9,
+ 0xba8d8a3e, 0x130bdc9d, 0x4b8b3e4a, 0x851da109, 0xdd9d43de,
+ 0x741b157d, 0x2c9bf7aa, 0x6710c9e0, 0x3f902b37, 0x96167d94,
+ 0xce969f43, 0x0a3b4213, 0x52bba0c4, 0xfb3df667, 0xa3bd14b0,
+ 0xe8362afa, 0xb0b6c82d, 0x19309e8e, 0x41b07c59, 0x8f26e31a,
+ 0xd7a601cd, 0x7e20576e, 0x26a0b5b9, 0x6d2b8bf3, 0x35ab6924,
+ 0x9c2d3f87, 0xc4addd50, 0x14768426, 0x4cf666f1, 0xe5703052,
+ 0xbdf0d285, 0xf67beccf, 0xaefb0e18, 0x077d58bb, 0x5ffdba6c,
+ 0x916b252f, 0xc9ebc7f8, 0x606d915b, 0x38ed738c, 0x73664dc6,
+ 0x2be6af11, 0x8260f9b2, 0xdae01b65, 0x1e4dc635, 0x46cd24e2,
+ 0xef4b7241, 0xb7cb9096, 0xfc40aedc, 0xa4c04c0b, 0x0d461aa8,
+ 0x55c6f87f, 0x9b50673c, 0xc3d085eb, 0x6a56d348, 0x32d6319f,
+ 0x795d0fd5, 0x21dded02, 0x885bbba1, 0xd0db5976, 0x28ec084d,
+ 0x706cea9a, 0xd9eabc39, 0x816a5eee, 0xcae160a4, 0x92618273,
+ 0x3be7d4d0, 0x63673607, 0xadf1a944, 0xf5714b93, 0x5cf71d30,
+ 0x0477ffe7, 0x4ffcc1ad, 0x177c237a, 0xbefa75d9, 0xe67a970e,
+ 0x22d74a5e, 0x7a57a889, 0xd3d1fe2a, 0x8b511cfd, 0xc0da22b7,
+ 0x985ac060, 0x31dc96c3, 0x695c7414, 0xa7caeb57, 0xff4a0980,
+ 0x56cc5f23, 0x0e4cbdf4, 0x45c783be, 0x1d476169, 0xb4c137ca,
+ 0xec41d51d, 0x3c9a8c6b, 0x641a6ebc, 0xcd9c381f, 0x951cdac8,
+ 0xde97e482, 0x86170655, 0x2f9150f6, 0x7711b221, 0xb9872d62,
+ 0xe107cfb5, 0x48819916, 0x10017bc1, 0x5b8a458b, 0x030aa75c,
+ 0xaa8cf1ff, 0xf20c1328, 0x36a1ce78, 0x6e212caf, 0xc7a77a0c,
+ 0x9f2798db, 0xd4aca691, 0x8c2c4446, 0x25aa12e5, 0x7d2af032,
+ 0xb3bc6f71, 0xeb3c8da6, 0x42badb05, 0x1a3a39d2, 0x51b10798,
+ 0x0931e54f, 0xa0b7b3ec, 0xf837513b, 0x50d8119a, 0x0858f34d,
+ 0xa1dea5ee, 0xf95e4739, 0xb2d57973, 0xea559ba4, 0x43d3cd07,
+ 0x1b532fd0, 0xd5c5b093, 0x8d455244, 0x24c304e7, 0x7c43e630,
+ 0x37c8d87a, 0x6f483aad, 0xc6ce6c0e, 0x9e4e8ed9, 0x5ae35389,
+ 0x0263b15e, 0xabe5e7fd, 0xf365052a, 0xb8ee3b60, 0xe06ed9b7,
+ 0x49e88f14, 0x11686dc3, 0xdffef280, 0x877e1057, 0x2ef846f4,
+ 0x7678a423, 0x3df39a69, 0x657378be, 0xccf52e1d, 0x9475ccca,
+ 0x44ae95bc, 0x1c2e776b, 0xb5a821c8, 0xed28c31f, 0xa6a3fd55,
+ 0xfe231f82, 0x57a54921, 0x0f25abf6, 0xc1b334b5, 0x9933d662,
+ 0x30b580c1, 0x68356216, 0x23be5c5c, 0x7b3ebe8b, 0xd2b8e828,
+ 0x8a380aff, 0x4e95d7af, 0x16153578, 0xbf9363db, 0xe713810c,
+ 0xac98bf46, 0xf4185d91, 0x5d9e0b32, 0x051ee9e5, 0xcb8876a6,
+ 0x93089471, 0x3a8ec2d2, 0x620e2005, 0x29851e4f, 0x7105fc98,
+ 0xd883aa3b, 0x800348ec, 0x783419d7, 0x20b4fb00, 0x8932ada3,
+ 0xd1b24f74, 0x9a39713e, 0xc2b993e9, 0x6b3fc54a, 0x33bf279d,
+ 0xfd29b8de, 0xa5a95a09, 0x0c2f0caa, 0x54afee7d, 0x1f24d037,
+ 0x47a432e0, 0xee226443, 0xb6a28694, 0x720f5bc4, 0x2a8fb913,
+ 0x8309efb0, 0xdb890d67, 0x9002332d, 0xc882d1fa, 0x61048759,
+ 0x3984658e, 0xf712facd, 0xaf92181a, 0x06144eb9, 0x5e94ac6e,
+ 0x151f9224, 0x4d9f70f3, 0xe4192650, 0xbc99c487, 0x6c429df1,
+ 0x34c27f26, 0x9d442985, 0xc5c4cb52, 0x8e4ff518, 0xd6cf17cf,
+ 0x7f49416c, 0x27c9a3bb, 0xe95f3cf8, 0xb1dfde2f, 0x1859888c,
+ 0x40d96a5b, 0x0b525411, 0x53d2b6c6, 0xfa54e065, 0xa2d402b2,
+ 0x6679dfe2, 0x3ef93d35, 0x977f6b96, 0xcfff8941, 0x8474b70b,
+ 0xdcf455dc, 0x7572037f, 0x2df2e1a8, 0xe3647eeb, 0xbbe49c3c,
+ 0x1262ca9f, 0x4ae22848, 0x01691602, 0x59e9f4d5, 0xf06fa276,
+ 0xa8ef40a1},
+ {0x00000000, 0x463b6765, 0x8c76ceca, 0xca4da9af, 0x59ebed4e,
+ 0x1fd08a2b, 0xd59d2384, 0x93a644e1, 0xb2d6db9d, 0xf4edbcf8,
+ 0x3ea01557, 0x789b7232, 0xeb3d36d3, 0xad0651b6, 0x674bf819,
+ 0x21709f7c, 0x25abc6e0, 0x6390a185, 0xa9dd082a, 0xefe66f4f,
+ 0x7c402bae, 0x3a7b4ccb, 0xf036e564, 0xb60d8201, 0x977d1d7d,
+ 0xd1467a18, 0x1b0bd3b7, 0x5d30b4d2, 0xce96f033, 0x88ad9756,
+ 0x42e03ef9, 0x04db599c, 0x0b50fc1a, 0x4d6b9b7f, 0x872632d0,
+ 0xc11d55b5, 0x52bb1154, 0x14807631, 0xdecddf9e, 0x98f6b8fb,
+ 0xb9862787, 0xffbd40e2, 0x35f0e94d, 0x73cb8e28, 0xe06dcac9,
+ 0xa656adac, 0x6c1b0403, 0x2a206366, 0x2efb3afa, 0x68c05d9f,
+ 0xa28df430, 0xe4b69355, 0x7710d7b4, 0x312bb0d1, 0xfb66197e,
+ 0xbd5d7e1b, 0x9c2de167, 0xda168602, 0x105b2fad, 0x566048c8,
+ 0xc5c60c29, 0x83fd6b4c, 0x49b0c2e3, 0x0f8ba586, 0x16a0f835,
+ 0x509b9f50, 0x9ad636ff, 0xdced519a, 0x4f4b157b, 0x0970721e,
+ 0xc33ddbb1, 0x8506bcd4, 0xa47623a8, 0xe24d44cd, 0x2800ed62,
+ 0x6e3b8a07, 0xfd9dcee6, 0xbba6a983, 0x71eb002c, 0x37d06749,
+ 0x330b3ed5, 0x753059b0, 0xbf7df01f, 0xf946977a, 0x6ae0d39b,
+ 0x2cdbb4fe, 0xe6961d51, 0xa0ad7a34, 0x81dde548, 0xc7e6822d,
+ 0x0dab2b82, 0x4b904ce7, 0xd8360806, 0x9e0d6f63, 0x5440c6cc,
+ 0x127ba1a9, 0x1df0042f, 0x5bcb634a, 0x9186cae5, 0xd7bdad80,
+ 0x441be961, 0x02208e04, 0xc86d27ab, 0x8e5640ce, 0xaf26dfb2,
+ 0xe91db8d7, 0x23501178, 0x656b761d, 0xf6cd32fc, 0xb0f65599,
+ 0x7abbfc36, 0x3c809b53, 0x385bc2cf, 0x7e60a5aa, 0xb42d0c05,
+ 0xf2166b60, 0x61b02f81, 0x278b48e4, 0xedc6e14b, 0xabfd862e,
+ 0x8a8d1952, 0xccb67e37, 0x06fbd798, 0x40c0b0fd, 0xd366f41c,
+ 0x955d9379, 0x5f103ad6, 0x192b5db3, 0x2c40f16b, 0x6a7b960e,
+ 0xa0363fa1, 0xe60d58c4, 0x75ab1c25, 0x33907b40, 0xf9ddd2ef,
+ 0xbfe6b58a, 0x9e962af6, 0xd8ad4d93, 0x12e0e43c, 0x54db8359,
+ 0xc77dc7b8, 0x8146a0dd, 0x4b0b0972, 0x0d306e17, 0x09eb378b,
+ 0x4fd050ee, 0x859df941, 0xc3a69e24, 0x5000dac5, 0x163bbda0,
+ 0xdc76140f, 0x9a4d736a, 0xbb3dec16, 0xfd068b73, 0x374b22dc,
+ 0x717045b9, 0xe2d60158, 0xa4ed663d, 0x6ea0cf92, 0x289ba8f7,
+ 0x27100d71, 0x612b6a14, 0xab66c3bb, 0xed5da4de, 0x7efbe03f,
+ 0x38c0875a, 0xf28d2ef5, 0xb4b64990, 0x95c6d6ec, 0xd3fdb189,
+ 0x19b01826, 0x5f8b7f43, 0xcc2d3ba2, 0x8a165cc7, 0x405bf568,
+ 0x0660920d, 0x02bbcb91, 0x4480acf4, 0x8ecd055b, 0xc8f6623e,
+ 0x5b5026df, 0x1d6b41ba, 0xd726e815, 0x911d8f70, 0xb06d100c,
+ 0xf6567769, 0x3c1bdec6, 0x7a20b9a3, 0xe986fd42, 0xafbd9a27,
+ 0x65f03388, 0x23cb54ed, 0x3ae0095e, 0x7cdb6e3b, 0xb696c794,
+ 0xf0ada0f1, 0x630be410, 0x25308375, 0xef7d2ada, 0xa9464dbf,
+ 0x8836d2c3, 0xce0db5a6, 0x04401c09, 0x427b7b6c, 0xd1dd3f8d,
+ 0x97e658e8, 0x5dabf147, 0x1b909622, 0x1f4bcfbe, 0x5970a8db,
+ 0x933d0174, 0xd5066611, 0x46a022f0, 0x009b4595, 0xcad6ec3a,
+ 0x8ced8b5f, 0xad9d1423, 0xeba67346, 0x21ebdae9, 0x67d0bd8c,
+ 0xf476f96d, 0xb24d9e08, 0x780037a7, 0x3e3b50c2, 0x31b0f544,
+ 0x778b9221, 0xbdc63b8e, 0xfbfd5ceb, 0x685b180a, 0x2e607f6f,
+ 0xe42dd6c0, 0xa216b1a5, 0x83662ed9, 0xc55d49bc, 0x0f10e013,
+ 0x492b8776, 0xda8dc397, 0x9cb6a4f2, 0x56fb0d5d, 0x10c06a38,
+ 0x141b33a4, 0x522054c1, 0x986dfd6e, 0xde569a0b, 0x4df0deea,
+ 0x0bcbb98f, 0xc1861020, 0x87bd7745, 0xa6cde839, 0xe0f68f5c,
+ 0x2abb26f3, 0x6c804196, 0xff260577, 0xb91d6212, 0x7350cbbd,
+ 0x356bacd8}};
+
+#endif
+
+#endif
+
+#if N == 6
+
+#if W == 8
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0x3db1ecdc, 0x7b63d9b8, 0x46d23564, 0xf6c7b370,
+ 0xcb765fac, 0x8da46ac8, 0xb0158614, 0x36fe60a1, 0x0b4f8c7d,
+ 0x4d9db919, 0x702c55c5, 0xc039d3d1, 0xfd883f0d, 0xbb5a0a69,
+ 0x86ebe6b5, 0x6dfcc142, 0x504d2d9e, 0x169f18fa, 0x2b2ef426,
+ 0x9b3b7232, 0xa68a9eee, 0xe058ab8a, 0xdde94756, 0x5b02a1e3,
+ 0x66b34d3f, 0x2061785b, 0x1dd09487, 0xadc51293, 0x9074fe4f,
+ 0xd6a6cb2b, 0xeb1727f7, 0xdbf98284, 0xe6486e58, 0xa09a5b3c,
+ 0x9d2bb7e0, 0x2d3e31f4, 0x108fdd28, 0x565de84c, 0x6bec0490,
+ 0xed07e225, 0xd0b60ef9, 0x96643b9d, 0xabd5d741, 0x1bc05155,
+ 0x2671bd89, 0x60a388ed, 0x5d126431, 0xb60543c6, 0x8bb4af1a,
+ 0xcd669a7e, 0xf0d776a2, 0x40c2f0b6, 0x7d731c6a, 0x3ba1290e,
+ 0x0610c5d2, 0x80fb2367, 0xbd4acfbb, 0xfb98fadf, 0xc6291603,
+ 0x763c9017, 0x4b8d7ccb, 0x0d5f49af, 0x30eea573, 0x6c820349,
+ 0x5133ef95, 0x17e1daf1, 0x2a50362d, 0x9a45b039, 0xa7f45ce5,
+ 0xe1266981, 0xdc97855d, 0x5a7c63e8, 0x67cd8f34, 0x211fba50,
+ 0x1cae568c, 0xacbbd098, 0x910a3c44, 0xd7d80920, 0xea69e5fc,
+ 0x017ec20b, 0x3ccf2ed7, 0x7a1d1bb3, 0x47acf76f, 0xf7b9717b,
+ 0xca089da7, 0x8cdaa8c3, 0xb16b441f, 0x3780a2aa, 0x0a314e76,
+ 0x4ce37b12, 0x715297ce, 0xc14711da, 0xfcf6fd06, 0xba24c862,
+ 0x879524be, 0xb77b81cd, 0x8aca6d11, 0xcc185875, 0xf1a9b4a9,
+ 0x41bc32bd, 0x7c0dde61, 0x3adfeb05, 0x076e07d9, 0x8185e16c,
+ 0xbc340db0, 0xfae638d4, 0xc757d408, 0x7742521c, 0x4af3bec0,
+ 0x0c218ba4, 0x31906778, 0xda87408f, 0xe736ac53, 0xa1e49937,
+ 0x9c5575eb, 0x2c40f3ff, 0x11f11f23, 0x57232a47, 0x6a92c69b,
+ 0xec79202e, 0xd1c8ccf2, 0x971af996, 0xaaab154a, 0x1abe935e,
+ 0x270f7f82, 0x61dd4ae6, 0x5c6ca63a, 0xd9040692, 0xe4b5ea4e,
+ 0xa267df2a, 0x9fd633f6, 0x2fc3b5e2, 0x1272593e, 0x54a06c5a,
+ 0x69118086, 0xeffa6633, 0xd24b8aef, 0x9499bf8b, 0xa9285357,
+ 0x193dd543, 0x248c399f, 0x625e0cfb, 0x5fefe027, 0xb4f8c7d0,
+ 0x89492b0c, 0xcf9b1e68, 0xf22af2b4, 0x423f74a0, 0x7f8e987c,
+ 0x395cad18, 0x04ed41c4, 0x8206a771, 0xbfb74bad, 0xf9657ec9,
+ 0xc4d49215, 0x74c11401, 0x4970f8dd, 0x0fa2cdb9, 0x32132165,
+ 0x02fd8416, 0x3f4c68ca, 0x799e5dae, 0x442fb172, 0xf43a3766,
+ 0xc98bdbba, 0x8f59eede, 0xb2e80202, 0x3403e4b7, 0x09b2086b,
+ 0x4f603d0f, 0x72d1d1d3, 0xc2c457c7, 0xff75bb1b, 0xb9a78e7f,
+ 0x841662a3, 0x6f014554, 0x52b0a988, 0x14629cec, 0x29d37030,
+ 0x99c6f624, 0xa4771af8, 0xe2a52f9c, 0xdf14c340, 0x59ff25f5,
+ 0x644ec929, 0x229cfc4d, 0x1f2d1091, 0xaf389685, 0x92897a59,
+ 0xd45b4f3d, 0xe9eaa3e1, 0xb58605db, 0x8837e907, 0xcee5dc63,
+ 0xf35430bf, 0x4341b6ab, 0x7ef05a77, 0x38226f13, 0x059383cf,
+ 0x8378657a, 0xbec989a6, 0xf81bbcc2, 0xc5aa501e, 0x75bfd60a,
+ 0x480e3ad6, 0x0edc0fb2, 0x336de36e, 0xd87ac499, 0xe5cb2845,
+ 0xa3191d21, 0x9ea8f1fd, 0x2ebd77e9, 0x130c9b35, 0x55deae51,
+ 0x686f428d, 0xee84a438, 0xd33548e4, 0x95e77d80, 0xa856915c,
+ 0x18431748, 0x25f2fb94, 0x6320cef0, 0x5e91222c, 0x6e7f875f,
+ 0x53ce6b83, 0x151c5ee7, 0x28adb23b, 0x98b8342f, 0xa509d8f3,
+ 0xe3dbed97, 0xde6a014b, 0x5881e7fe, 0x65300b22, 0x23e23e46,
+ 0x1e53d29a, 0xae46548e, 0x93f7b852, 0xd5258d36, 0xe89461ea,
+ 0x0383461d, 0x3e32aac1, 0x78e09fa5, 0x45517379, 0xf544f56d,
+ 0xc8f519b1, 0x8e272cd5, 0xb396c009, 0x357d26bc, 0x08ccca60,
+ 0x4e1eff04, 0x73af13d8, 0xc3ba95cc, 0xfe0b7910, 0xb8d94c74,
+ 0x8568a0a8},
+ {0x00000000, 0x69790b65, 0xd2f216ca, 0xbb8b1daf, 0x7e952bd5,
+ 0x17ec20b0, 0xac673d1f, 0xc51e367a, 0xfd2a57aa, 0x94535ccf,
+ 0x2fd84160, 0x46a14a05, 0x83bf7c7f, 0xeac6771a, 0x514d6ab5,
+ 0x383461d0, 0x2125a915, 0x485ca270, 0xf3d7bfdf, 0x9aaeb4ba,
+ 0x5fb082c0, 0x36c989a5, 0x8d42940a, 0xe43b9f6f, 0xdc0ffebf,
+ 0xb576f5da, 0x0efde875, 0x6784e310, 0xa29ad56a, 0xcbe3de0f,
+ 0x7068c3a0, 0x1911c8c5, 0x424b522a, 0x2b32594f, 0x90b944e0,
+ 0xf9c04f85, 0x3cde79ff, 0x55a7729a, 0xee2c6f35, 0x87556450,
+ 0xbf610580, 0xd6180ee5, 0x6d93134a, 0x04ea182f, 0xc1f42e55,
+ 0xa88d2530, 0x1306389f, 0x7a7f33fa, 0x636efb3f, 0x0a17f05a,
+ 0xb19cedf5, 0xd8e5e690, 0x1dfbd0ea, 0x7482db8f, 0xcf09c620,
+ 0xa670cd45, 0x9e44ac95, 0xf73da7f0, 0x4cb6ba5f, 0x25cfb13a,
+ 0xe0d18740, 0x89a88c25, 0x3223918a, 0x5b5a9aef, 0x8496a454,
+ 0xedefaf31, 0x5664b29e, 0x3f1db9fb, 0xfa038f81, 0x937a84e4,
+ 0x28f1994b, 0x4188922e, 0x79bcf3fe, 0x10c5f89b, 0xab4ee534,
+ 0xc237ee51, 0x0729d82b, 0x6e50d34e, 0xd5dbcee1, 0xbca2c584,
+ 0xa5b30d41, 0xccca0624, 0x77411b8b, 0x1e3810ee, 0xdb262694,
+ 0xb25f2df1, 0x09d4305e, 0x60ad3b3b, 0x58995aeb, 0x31e0518e,
+ 0x8a6b4c21, 0xe3124744, 0x260c713e, 0x4f757a5b, 0xf4fe67f4,
+ 0x9d876c91, 0xc6ddf67e, 0xafa4fd1b, 0x142fe0b4, 0x7d56ebd1,
+ 0xb848ddab, 0xd131d6ce, 0x6abacb61, 0x03c3c004, 0x3bf7a1d4,
+ 0x528eaab1, 0xe905b71e, 0x807cbc7b, 0x45628a01, 0x2c1b8164,
+ 0x97909ccb, 0xfee997ae, 0xe7f85f6b, 0x8e81540e, 0x350a49a1,
+ 0x5c7342c4, 0x996d74be, 0xf0147fdb, 0x4b9f6274, 0x22e66911,
+ 0x1ad208c1, 0x73ab03a4, 0xc8201e0b, 0xa159156e, 0x64472314,
+ 0x0d3e2871, 0xb6b535de, 0xdfcc3ebb, 0xd25c4ee9, 0xbb25458c,
+ 0x00ae5823, 0x69d75346, 0xacc9653c, 0xc5b06e59, 0x7e3b73f6,
+ 0x17427893, 0x2f761943, 0x460f1226, 0xfd840f89, 0x94fd04ec,
+ 0x51e33296, 0x389a39f3, 0x8311245c, 0xea682f39, 0xf379e7fc,
+ 0x9a00ec99, 0x218bf136, 0x48f2fa53, 0x8deccc29, 0xe495c74c,
+ 0x5f1edae3, 0x3667d186, 0x0e53b056, 0x672abb33, 0xdca1a69c,
+ 0xb5d8adf9, 0x70c69b83, 0x19bf90e6, 0xa2348d49, 0xcb4d862c,
+ 0x90171cc3, 0xf96e17a6, 0x42e50a09, 0x2b9c016c, 0xee823716,
+ 0x87fb3c73, 0x3c7021dc, 0x55092ab9, 0x6d3d4b69, 0x0444400c,
+ 0xbfcf5da3, 0xd6b656c6, 0x13a860bc, 0x7ad16bd9, 0xc15a7676,
+ 0xa8237d13, 0xb132b5d6, 0xd84bbeb3, 0x63c0a31c, 0x0ab9a879,
+ 0xcfa79e03, 0xa6de9566, 0x1d5588c9, 0x742c83ac, 0x4c18e27c,
+ 0x2561e919, 0x9eeaf4b6, 0xf793ffd3, 0x328dc9a9, 0x5bf4c2cc,
+ 0xe07fdf63, 0x8906d406, 0x56caeabd, 0x3fb3e1d8, 0x8438fc77,
+ 0xed41f712, 0x285fc168, 0x4126ca0d, 0xfaadd7a2, 0x93d4dcc7,
+ 0xabe0bd17, 0xc299b672, 0x7912abdd, 0x106ba0b8, 0xd57596c2,
+ 0xbc0c9da7, 0x07878008, 0x6efe8b6d, 0x77ef43a8, 0x1e9648cd,
+ 0xa51d5562, 0xcc645e07, 0x097a687d, 0x60036318, 0xdb887eb7,
+ 0xb2f175d2, 0x8ac51402, 0xe3bc1f67, 0x583702c8, 0x314e09ad,
+ 0xf4503fd7, 0x9d2934b2, 0x26a2291d, 0x4fdb2278, 0x1481b897,
+ 0x7df8b3f2, 0xc673ae5d, 0xaf0aa538, 0x6a149342, 0x036d9827,
+ 0xb8e68588, 0xd19f8eed, 0xe9abef3d, 0x80d2e458, 0x3b59f9f7,
+ 0x5220f292, 0x973ec4e8, 0xfe47cf8d, 0x45ccd222, 0x2cb5d947,
+ 0x35a41182, 0x5cdd1ae7, 0xe7560748, 0x8e2f0c2d, 0x4b313a57,
+ 0x22483132, 0x99c32c9d, 0xf0ba27f8, 0xc88e4628, 0xa1f74d4d,
+ 0x1a7c50e2, 0x73055b87, 0xb61b6dfd, 0xdf626698, 0x64e97b37,
+ 0x0d907052},
+ {0x00000000, 0x7fc99b93, 0xff933726, 0x805aacb5, 0x2457680d,
+ 0x5b9ef39e, 0xdbc45f2b, 0xa40dc4b8, 0x48aed01a, 0x37674b89,
+ 0xb73de73c, 0xc8f47caf, 0x6cf9b817, 0x13302384, 0x936a8f31,
+ 0xeca314a2, 0x915da034, 0xee943ba7, 0x6ece9712, 0x11070c81,
+ 0xb50ac839, 0xcac353aa, 0x4a99ff1f, 0x3550648c, 0xd9f3702e,
+ 0xa63aebbd, 0x26604708, 0x59a9dc9b, 0xfda41823, 0x826d83b0,
+ 0x02372f05, 0x7dfeb496, 0xf9ca4629, 0x8603ddba, 0x0659710f,
+ 0x7990ea9c, 0xdd9d2e24, 0xa254b5b7, 0x220e1902, 0x5dc78291,
+ 0xb1649633, 0xcead0da0, 0x4ef7a115, 0x313e3a86, 0x9533fe3e,
+ 0xeafa65ad, 0x6aa0c918, 0x1569528b, 0x6897e61d, 0x175e7d8e,
+ 0x9704d13b, 0xe8cd4aa8, 0x4cc08e10, 0x33091583, 0xb353b936,
+ 0xcc9a22a5, 0x20393607, 0x5ff0ad94, 0xdfaa0121, 0xa0639ab2,
+ 0x046e5e0a, 0x7ba7c599, 0xfbfd692c, 0x8434f2bf, 0x28e58a13,
+ 0x572c1180, 0xd776bd35, 0xa8bf26a6, 0x0cb2e21e, 0x737b798d,
+ 0xf321d538, 0x8ce84eab, 0x604b5a09, 0x1f82c19a, 0x9fd86d2f,
+ 0xe011f6bc, 0x441c3204, 0x3bd5a997, 0xbb8f0522, 0xc4469eb1,
+ 0xb9b82a27, 0xc671b1b4, 0x462b1d01, 0x39e28692, 0x9def422a,
+ 0xe226d9b9, 0x627c750c, 0x1db5ee9f, 0xf116fa3d, 0x8edf61ae,
+ 0x0e85cd1b, 0x714c5688, 0xd5419230, 0xaa8809a3, 0x2ad2a516,
+ 0x551b3e85, 0xd12fcc3a, 0xaee657a9, 0x2ebcfb1c, 0x5175608f,
+ 0xf578a437, 0x8ab13fa4, 0x0aeb9311, 0x75220882, 0x99811c20,
+ 0xe64887b3, 0x66122b06, 0x19dbb095, 0xbdd6742d, 0xc21fefbe,
+ 0x4245430b, 0x3d8cd898, 0x40726c0e, 0x3fbbf79d, 0xbfe15b28,
+ 0xc028c0bb, 0x64250403, 0x1bec9f90, 0x9bb63325, 0xe47fa8b6,
+ 0x08dcbc14, 0x77152787, 0xf74f8b32, 0x888610a1, 0x2c8bd419,
+ 0x53424f8a, 0xd318e33f, 0xacd178ac, 0x51cb1426, 0x2e028fb5,
+ 0xae582300, 0xd191b893, 0x759c7c2b, 0x0a55e7b8, 0x8a0f4b0d,
+ 0xf5c6d09e, 0x1965c43c, 0x66ac5faf, 0xe6f6f31a, 0x993f6889,
+ 0x3d32ac31, 0x42fb37a2, 0xc2a19b17, 0xbd680084, 0xc096b412,
+ 0xbf5f2f81, 0x3f058334, 0x40cc18a7, 0xe4c1dc1f, 0x9b08478c,
+ 0x1b52eb39, 0x649b70aa, 0x88386408, 0xf7f1ff9b, 0x77ab532e,
+ 0x0862c8bd, 0xac6f0c05, 0xd3a69796, 0x53fc3b23, 0x2c35a0b0,
+ 0xa801520f, 0xd7c8c99c, 0x57926529, 0x285bfeba, 0x8c563a02,
+ 0xf39fa191, 0x73c50d24, 0x0c0c96b7, 0xe0af8215, 0x9f661986,
+ 0x1f3cb533, 0x60f52ea0, 0xc4f8ea18, 0xbb31718b, 0x3b6bdd3e,
+ 0x44a246ad, 0x395cf23b, 0x469569a8, 0xc6cfc51d, 0xb9065e8e,
+ 0x1d0b9a36, 0x62c201a5, 0xe298ad10, 0x9d513683, 0x71f22221,
+ 0x0e3bb9b2, 0x8e611507, 0xf1a88e94, 0x55a54a2c, 0x2a6cd1bf,
+ 0xaa367d0a, 0xd5ffe699, 0x792e9e35, 0x06e705a6, 0x86bda913,
+ 0xf9743280, 0x5d79f638, 0x22b06dab, 0xa2eac11e, 0xdd235a8d,
+ 0x31804e2f, 0x4e49d5bc, 0xce137909, 0xb1dae29a, 0x15d72622,
+ 0x6a1ebdb1, 0xea441104, 0x958d8a97, 0xe8733e01, 0x97baa592,
+ 0x17e00927, 0x682992b4, 0xcc24560c, 0xb3edcd9f, 0x33b7612a,
+ 0x4c7efab9, 0xa0ddee1b, 0xdf147588, 0x5f4ed93d, 0x208742ae,
+ 0x848a8616, 0xfb431d85, 0x7b19b130, 0x04d02aa3, 0x80e4d81c,
+ 0xff2d438f, 0x7f77ef3a, 0x00be74a9, 0xa4b3b011, 0xdb7a2b82,
+ 0x5b208737, 0x24e91ca4, 0xc84a0806, 0xb7839395, 0x37d93f20,
+ 0x4810a4b3, 0xec1d600b, 0x93d4fb98, 0x138e572d, 0x6c47ccbe,
+ 0x11b97828, 0x6e70e3bb, 0xee2a4f0e, 0x91e3d49d, 0x35ee1025,
+ 0x4a278bb6, 0xca7d2703, 0xb5b4bc90, 0x5917a832, 0x26de33a1,
+ 0xa6849f14, 0xd94d0487, 0x7d40c03f, 0x02895bac, 0x82d3f719,
+ 0xfd1a6c8a},
+ {0x00000000, 0xa396284c, 0x9c5d56d9, 0x3fcb7e95, 0xe3cbabf3,
+ 0x405d83bf, 0x7f96fd2a, 0xdc00d566, 0x1ce651a7, 0xbf7079eb,
+ 0x80bb077e, 0x232d2f32, 0xff2dfa54, 0x5cbbd218, 0x6370ac8d,
+ 0xc0e684c1, 0x39cca34e, 0x9a5a8b02, 0xa591f597, 0x0607dddb,
+ 0xda0708bd, 0x799120f1, 0x465a5e64, 0xe5cc7628, 0x252af2e9,
+ 0x86bcdaa5, 0xb977a430, 0x1ae18c7c, 0xc6e1591a, 0x65777156,
+ 0x5abc0fc3, 0xf92a278f, 0x7399469c, 0xd00f6ed0, 0xefc41045,
+ 0x4c523809, 0x9052ed6f, 0x33c4c523, 0x0c0fbbb6, 0xaf9993fa,
+ 0x6f7f173b, 0xcce93f77, 0xf32241e2, 0x50b469ae, 0x8cb4bcc8,
+ 0x2f229484, 0x10e9ea11, 0xb37fc25d, 0x4a55e5d2, 0xe9c3cd9e,
+ 0xd608b30b, 0x759e9b47, 0xa99e4e21, 0x0a08666d, 0x35c318f8,
+ 0x965530b4, 0x56b3b475, 0xf5259c39, 0xcaeee2ac, 0x6978cae0,
+ 0xb5781f86, 0x16ee37ca, 0x2925495f, 0x8ab36113, 0xe7328d38,
+ 0x44a4a574, 0x7b6fdbe1, 0xd8f9f3ad, 0x04f926cb, 0xa76f0e87,
+ 0x98a47012, 0x3b32585e, 0xfbd4dc9f, 0x5842f4d3, 0x67898a46,
+ 0xc41fa20a, 0x181f776c, 0xbb895f20, 0x844221b5, 0x27d409f9,
+ 0xdefe2e76, 0x7d68063a, 0x42a378af, 0xe13550e3, 0x3d358585,
+ 0x9ea3adc9, 0xa168d35c, 0x02fefb10, 0xc2187fd1, 0x618e579d,
+ 0x5e452908, 0xfdd30144, 0x21d3d422, 0x8245fc6e, 0xbd8e82fb,
+ 0x1e18aab7, 0x94abcba4, 0x373de3e8, 0x08f69d7d, 0xab60b531,
+ 0x77606057, 0xd4f6481b, 0xeb3d368e, 0x48ab1ec2, 0x884d9a03,
+ 0x2bdbb24f, 0x1410ccda, 0xb786e496, 0x6b8631f0, 0xc81019bc,
+ 0xf7db6729, 0x544d4f65, 0xad6768ea, 0x0ef140a6, 0x313a3e33,
+ 0x92ac167f, 0x4eacc319, 0xed3aeb55, 0xd2f195c0, 0x7167bd8c,
+ 0xb181394d, 0x12171101, 0x2ddc6f94, 0x8e4a47d8, 0x524a92be,
+ 0xf1dcbaf2, 0xce17c467, 0x6d81ec2b, 0x15141c31, 0xb682347d,
+ 0x89494ae8, 0x2adf62a4, 0xf6dfb7c2, 0x55499f8e, 0x6a82e11b,
+ 0xc914c957, 0x09f24d96, 0xaa6465da, 0x95af1b4f, 0x36393303,
+ 0xea39e665, 0x49afce29, 0x7664b0bc, 0xd5f298f0, 0x2cd8bf7f,
+ 0x8f4e9733, 0xb085e9a6, 0x1313c1ea, 0xcf13148c, 0x6c853cc0,
+ 0x534e4255, 0xf0d86a19, 0x303eeed8, 0x93a8c694, 0xac63b801,
+ 0x0ff5904d, 0xd3f5452b, 0x70636d67, 0x4fa813f2, 0xec3e3bbe,
+ 0x668d5aad, 0xc51b72e1, 0xfad00c74, 0x59462438, 0x8546f15e,
+ 0x26d0d912, 0x191ba787, 0xba8d8fcb, 0x7a6b0b0a, 0xd9fd2346,
+ 0xe6365dd3, 0x45a0759f, 0x99a0a0f9, 0x3a3688b5, 0x05fdf620,
+ 0xa66bde6c, 0x5f41f9e3, 0xfcd7d1af, 0xc31caf3a, 0x608a8776,
+ 0xbc8a5210, 0x1f1c7a5c, 0x20d704c9, 0x83412c85, 0x43a7a844,
+ 0xe0318008, 0xdffafe9d, 0x7c6cd6d1, 0xa06c03b7, 0x03fa2bfb,
+ 0x3c31556e, 0x9fa77d22, 0xf2269109, 0x51b0b945, 0x6e7bc7d0,
+ 0xcdedef9c, 0x11ed3afa, 0xb27b12b6, 0x8db06c23, 0x2e26446f,
+ 0xeec0c0ae, 0x4d56e8e2, 0x729d9677, 0xd10bbe3b, 0x0d0b6b5d,
+ 0xae9d4311, 0x91563d84, 0x32c015c8, 0xcbea3247, 0x687c1a0b,
+ 0x57b7649e, 0xf4214cd2, 0x282199b4, 0x8bb7b1f8, 0xb47ccf6d,
+ 0x17eae721, 0xd70c63e0, 0x749a4bac, 0x4b513539, 0xe8c71d75,
+ 0x34c7c813, 0x9751e05f, 0xa89a9eca, 0x0b0cb686, 0x81bfd795,
+ 0x2229ffd9, 0x1de2814c, 0xbe74a900, 0x62747c66, 0xc1e2542a,
+ 0xfe292abf, 0x5dbf02f3, 0x9d598632, 0x3ecfae7e, 0x0104d0eb,
+ 0xa292f8a7, 0x7e922dc1, 0xdd04058d, 0xe2cf7b18, 0x41595354,
+ 0xb87374db, 0x1be55c97, 0x242e2202, 0x87b80a4e, 0x5bb8df28,
+ 0xf82ef764, 0xc7e589f1, 0x6473a1bd, 0xa495257c, 0x07030d30,
+ 0x38c873a5, 0x9b5e5be9, 0x475e8e8f, 0xe4c8a6c3, 0xdb03d856,
+ 0x7895f01a},
+ {0x00000000, 0x2a283862, 0x545070c4, 0x7e7848a6, 0xa8a0e188,
+ 0x8288d9ea, 0xfcf0914c, 0xd6d8a92e, 0x8a30c551, 0xa018fd33,
+ 0xde60b595, 0xf4488df7, 0x229024d9, 0x08b81cbb, 0x76c0541d,
+ 0x5ce86c7f, 0xcf108ce3, 0xe538b481, 0x9b40fc27, 0xb168c445,
+ 0x67b06d6b, 0x4d985509, 0x33e01daf, 0x19c825cd, 0x452049b2,
+ 0x6f0871d0, 0x11703976, 0x3b580114, 0xed80a83a, 0xc7a89058,
+ 0xb9d0d8fe, 0x93f8e09c, 0x45501f87, 0x6f7827e5, 0x11006f43,
+ 0x3b285721, 0xedf0fe0f, 0xc7d8c66d, 0xb9a08ecb, 0x9388b6a9,
+ 0xcf60dad6, 0xe548e2b4, 0x9b30aa12, 0xb1189270, 0x67c03b5e,
+ 0x4de8033c, 0x33904b9a, 0x19b873f8, 0x8a409364, 0xa068ab06,
+ 0xde10e3a0, 0xf438dbc2, 0x22e072ec, 0x08c84a8e, 0x76b00228,
+ 0x5c983a4a, 0x00705635, 0x2a586e57, 0x542026f1, 0x7e081e93,
+ 0xa8d0b7bd, 0x82f88fdf, 0xfc80c779, 0xd6a8ff1b, 0x8aa03f0e,
+ 0xa088076c, 0xdef04fca, 0xf4d877a8, 0x2200de86, 0x0828e6e4,
+ 0x7650ae42, 0x5c789620, 0x0090fa5f, 0x2ab8c23d, 0x54c08a9b,
+ 0x7ee8b2f9, 0xa8301bd7, 0x821823b5, 0xfc606b13, 0xd6485371,
+ 0x45b0b3ed, 0x6f988b8f, 0x11e0c329, 0x3bc8fb4b, 0xed105265,
+ 0xc7386a07, 0xb94022a1, 0x93681ac3, 0xcf8076bc, 0xe5a84ede,
+ 0x9bd00678, 0xb1f83e1a, 0x67209734, 0x4d08af56, 0x3370e7f0,
+ 0x1958df92, 0xcff02089, 0xe5d818eb, 0x9ba0504d, 0xb188682f,
+ 0x6750c101, 0x4d78f963, 0x3300b1c5, 0x192889a7, 0x45c0e5d8,
+ 0x6fe8ddba, 0x1190951c, 0x3bb8ad7e, 0xed600450, 0xc7483c32,
+ 0xb9307494, 0x93184cf6, 0x00e0ac6a, 0x2ac89408, 0x54b0dcae,
+ 0x7e98e4cc, 0xa8404de2, 0x82687580, 0xfc103d26, 0xd6380544,
+ 0x8ad0693b, 0xa0f85159, 0xde8019ff, 0xf4a8219d, 0x227088b3,
+ 0x0858b0d1, 0x7620f877, 0x5c08c015, 0xce31785d, 0xe419403f,
+ 0x9a610899, 0xb04930fb, 0x669199d5, 0x4cb9a1b7, 0x32c1e911,
+ 0x18e9d173, 0x4401bd0c, 0x6e29856e, 0x1051cdc8, 0x3a79f5aa,
+ 0xeca15c84, 0xc68964e6, 0xb8f12c40, 0x92d91422, 0x0121f4be,
+ 0x2b09ccdc, 0x5571847a, 0x7f59bc18, 0xa9811536, 0x83a92d54,
+ 0xfdd165f2, 0xd7f95d90, 0x8b1131ef, 0xa139098d, 0xdf41412b,
+ 0xf5697949, 0x23b1d067, 0x0999e805, 0x77e1a0a3, 0x5dc998c1,
+ 0x8b6167da, 0xa1495fb8, 0xdf31171e, 0xf5192f7c, 0x23c18652,
+ 0x09e9be30, 0x7791f696, 0x5db9cef4, 0x0151a28b, 0x2b799ae9,
+ 0x5501d24f, 0x7f29ea2d, 0xa9f14303, 0x83d97b61, 0xfda133c7,
+ 0xd7890ba5, 0x4471eb39, 0x6e59d35b, 0x10219bfd, 0x3a09a39f,
+ 0xecd10ab1, 0xc6f932d3, 0xb8817a75, 0x92a94217, 0xce412e68,
+ 0xe469160a, 0x9a115eac, 0xb03966ce, 0x66e1cfe0, 0x4cc9f782,
+ 0x32b1bf24, 0x18998746, 0x44914753, 0x6eb97f31, 0x10c13797,
+ 0x3ae90ff5, 0xec31a6db, 0xc6199eb9, 0xb861d61f, 0x9249ee7d,
+ 0xcea18202, 0xe489ba60, 0x9af1f2c6, 0xb0d9caa4, 0x6601638a,
+ 0x4c295be8, 0x3251134e, 0x18792b2c, 0x8b81cbb0, 0xa1a9f3d2,
+ 0xdfd1bb74, 0xf5f98316, 0x23212a38, 0x0909125a, 0x77715afc,
+ 0x5d59629e, 0x01b10ee1, 0x2b993683, 0x55e17e25, 0x7fc94647,
+ 0xa911ef69, 0x8339d70b, 0xfd419fad, 0xd769a7cf, 0x01c158d4,
+ 0x2be960b6, 0x55912810, 0x7fb91072, 0xa961b95c, 0x8349813e,
+ 0xfd31c998, 0xd719f1fa, 0x8bf19d85, 0xa1d9a5e7, 0xdfa1ed41,
+ 0xf589d523, 0x23517c0d, 0x0979446f, 0x77010cc9, 0x5d2934ab,
+ 0xced1d437, 0xe4f9ec55, 0x9a81a4f3, 0xb0a99c91, 0x667135bf,
+ 0x4c590ddd, 0x3221457b, 0x18097d19, 0x44e11166, 0x6ec92904,
+ 0x10b161a2, 0x3a9959c0, 0xec41f0ee, 0xc669c88c, 0xb811802a,
+ 0x9239b848},
+ {0x00000000, 0x4713f6fb, 0x8e27edf6, 0xc9341b0d, 0xc73eddad,
+ 0x802d2b56, 0x4919305b, 0x0e0ac6a0, 0x550cbd1b, 0x121f4be0,
+ 0xdb2b50ed, 0x9c38a616, 0x923260b6, 0xd521964d, 0x1c158d40,
+ 0x5b067bbb, 0xaa197a36, 0xed0a8ccd, 0x243e97c0, 0x632d613b,
+ 0x6d27a79b, 0x2a345160, 0xe3004a6d, 0xa413bc96, 0xff15c72d,
+ 0xb80631d6, 0x71322adb, 0x3621dc20, 0x382b1a80, 0x7f38ec7b,
+ 0xb60cf776, 0xf11f018d, 0x8f43f22d, 0xc85004d6, 0x01641fdb,
+ 0x4677e920, 0x487d2f80, 0x0f6ed97b, 0xc65ac276, 0x8149348d,
+ 0xda4f4f36, 0x9d5cb9cd, 0x5468a2c0, 0x137b543b, 0x1d71929b,
+ 0x5a626460, 0x93567f6d, 0xd4458996, 0x255a881b, 0x62497ee0,
+ 0xab7d65ed, 0xec6e9316, 0xe26455b6, 0xa577a34d, 0x6c43b840,
+ 0x2b504ebb, 0x70563500, 0x3745c3fb, 0xfe71d8f6, 0xb9622e0d,
+ 0xb768e8ad, 0xf07b1e56, 0x394f055b, 0x7e5cf3a0, 0xc5f6e21b,
+ 0x82e514e0, 0x4bd10fed, 0x0cc2f916, 0x02c83fb6, 0x45dbc94d,
+ 0x8cefd240, 0xcbfc24bb, 0x90fa5f00, 0xd7e9a9fb, 0x1eddb2f6,
+ 0x59ce440d, 0x57c482ad, 0x10d77456, 0xd9e36f5b, 0x9ef099a0,
+ 0x6fef982d, 0x28fc6ed6, 0xe1c875db, 0xa6db8320, 0xa8d14580,
+ 0xefc2b37b, 0x26f6a876, 0x61e55e8d, 0x3ae32536, 0x7df0d3cd,
+ 0xb4c4c8c0, 0xf3d73e3b, 0xfdddf89b, 0xbace0e60, 0x73fa156d,
+ 0x34e9e396, 0x4ab51036, 0x0da6e6cd, 0xc492fdc0, 0x83810b3b,
+ 0x8d8bcd9b, 0xca983b60, 0x03ac206d, 0x44bfd696, 0x1fb9ad2d,
+ 0x58aa5bd6, 0x919e40db, 0xd68db620, 0xd8877080, 0x9f94867b,
+ 0x56a09d76, 0x11b36b8d, 0xe0ac6a00, 0xa7bf9cfb, 0x6e8b87f6,
+ 0x2998710d, 0x2792b7ad, 0x60814156, 0xa9b55a5b, 0xeea6aca0,
+ 0xb5a0d71b, 0xf2b321e0, 0x3b873aed, 0x7c94cc16, 0x729e0ab6,
+ 0x358dfc4d, 0xfcb9e740, 0xbbaa11bb, 0x509cc277, 0x178f348c,
+ 0xdebb2f81, 0x99a8d97a, 0x97a21fda, 0xd0b1e921, 0x1985f22c,
+ 0x5e9604d7, 0x05907f6c, 0x42838997, 0x8bb7929a, 0xcca46461,
+ 0xc2aea2c1, 0x85bd543a, 0x4c894f37, 0x0b9ab9cc, 0xfa85b841,
+ 0xbd964eba, 0x74a255b7, 0x33b1a34c, 0x3dbb65ec, 0x7aa89317,
+ 0xb39c881a, 0xf48f7ee1, 0xaf89055a, 0xe89af3a1, 0x21aee8ac,
+ 0x66bd1e57, 0x68b7d8f7, 0x2fa42e0c, 0xe6903501, 0xa183c3fa,
+ 0xdfdf305a, 0x98ccc6a1, 0x51f8ddac, 0x16eb2b57, 0x18e1edf7,
+ 0x5ff21b0c, 0x96c60001, 0xd1d5f6fa, 0x8ad38d41, 0xcdc07bba,
+ 0x04f460b7, 0x43e7964c, 0x4ded50ec, 0x0afea617, 0xc3cabd1a,
+ 0x84d94be1, 0x75c64a6c, 0x32d5bc97, 0xfbe1a79a, 0xbcf25161,
+ 0xb2f897c1, 0xf5eb613a, 0x3cdf7a37, 0x7bcc8ccc, 0x20caf777,
+ 0x67d9018c, 0xaeed1a81, 0xe9feec7a, 0xe7f42ada, 0xa0e7dc21,
+ 0x69d3c72c, 0x2ec031d7, 0x956a206c, 0xd279d697, 0x1b4dcd9a,
+ 0x5c5e3b61, 0x5254fdc1, 0x15470b3a, 0xdc731037, 0x9b60e6cc,
+ 0xc0669d77, 0x87756b8c, 0x4e417081, 0x0952867a, 0x075840da,
+ 0x404bb621, 0x897fad2c, 0xce6c5bd7, 0x3f735a5a, 0x7860aca1,
+ 0xb154b7ac, 0xf6474157, 0xf84d87f7, 0xbf5e710c, 0x766a6a01,
+ 0x31799cfa, 0x6a7fe741, 0x2d6c11ba, 0xe4580ab7, 0xa34bfc4c,
+ 0xad413aec, 0xea52cc17, 0x2366d71a, 0x647521e1, 0x1a29d241,
+ 0x5d3a24ba, 0x940e3fb7, 0xd31dc94c, 0xdd170fec, 0x9a04f917,
+ 0x5330e21a, 0x142314e1, 0x4f256f5a, 0x083699a1, 0xc10282ac,
+ 0x86117457, 0x881bb2f7, 0xcf08440c, 0x063c5f01, 0x412fa9fa,
+ 0xb030a877, 0xf7235e8c, 0x3e174581, 0x7904b37a, 0x770e75da,
+ 0x301d8321, 0xf929982c, 0xbe3a6ed7, 0xe53c156c, 0xa22fe397,
+ 0x6b1bf89a, 0x2c080e61, 0x2202c8c1, 0x65113e3a, 0xac252537,
+ 0xeb36d3cc},
+ {0x00000000, 0xa13984ee, 0x99020f9d, 0x383b8b73, 0xe975197b,
+ 0x484c9d95, 0x707716e6, 0xd14e9208, 0x099b34b7, 0xa8a2b059,
+ 0x90993b2a, 0x31a0bfc4, 0xe0ee2dcc, 0x41d7a922, 0x79ec2251,
+ 0xd8d5a6bf, 0x1336696e, 0xb20fed80, 0x8a3466f3, 0x2b0de21d,
+ 0xfa437015, 0x5b7af4fb, 0x63417f88, 0xc278fb66, 0x1aad5dd9,
+ 0xbb94d937, 0x83af5244, 0x2296d6aa, 0xf3d844a2, 0x52e1c04c,
+ 0x6ada4b3f, 0xcbe3cfd1, 0x266cd2dc, 0x87555632, 0xbf6edd41,
+ 0x1e5759af, 0xcf19cba7, 0x6e204f49, 0x561bc43a, 0xf72240d4,
+ 0x2ff7e66b, 0x8ece6285, 0xb6f5e9f6, 0x17cc6d18, 0xc682ff10,
+ 0x67bb7bfe, 0x5f80f08d, 0xfeb97463, 0x355abbb2, 0x94633f5c,
+ 0xac58b42f, 0x0d6130c1, 0xdc2fa2c9, 0x7d162627, 0x452dad54,
+ 0xe41429ba, 0x3cc18f05, 0x9df80beb, 0xa5c38098, 0x04fa0476,
+ 0xd5b4967e, 0x748d1290, 0x4cb699e3, 0xed8f1d0d, 0x4cd9a5b8,
+ 0xede02156, 0xd5dbaa25, 0x74e22ecb, 0xa5acbcc3, 0x0495382d,
+ 0x3caeb35e, 0x9d9737b0, 0x4542910f, 0xe47b15e1, 0xdc409e92,
+ 0x7d791a7c, 0xac378874, 0x0d0e0c9a, 0x353587e9, 0x940c0307,
+ 0x5fefccd6, 0xfed64838, 0xc6edc34b, 0x67d447a5, 0xb69ad5ad,
+ 0x17a35143, 0x2f98da30, 0x8ea15ede, 0x5674f861, 0xf74d7c8f,
+ 0xcf76f7fc, 0x6e4f7312, 0xbf01e11a, 0x1e3865f4, 0x2603ee87,
+ 0x873a6a69, 0x6ab57764, 0xcb8cf38a, 0xf3b778f9, 0x528efc17,
+ 0x83c06e1f, 0x22f9eaf1, 0x1ac26182, 0xbbfbe56c, 0x632e43d3,
+ 0xc217c73d, 0xfa2c4c4e, 0x5b15c8a0, 0x8a5b5aa8, 0x2b62de46,
+ 0x13595535, 0xb260d1db, 0x79831e0a, 0xd8ba9ae4, 0xe0811197,
+ 0x41b89579, 0x90f60771, 0x31cf839f, 0x09f408ec, 0xa8cd8c02,
+ 0x70182abd, 0xd121ae53, 0xe91a2520, 0x4823a1ce, 0x996d33c6,
+ 0x3854b728, 0x006f3c5b, 0xa156b8b5, 0x99b34b70, 0x388acf9e,
+ 0x00b144ed, 0xa188c003, 0x70c6520b, 0xd1ffd6e5, 0xe9c45d96,
+ 0x48fdd978, 0x90287fc7, 0x3111fb29, 0x092a705a, 0xa813f4b4,
+ 0x795d66bc, 0xd864e252, 0xe05f6921, 0x4166edcf, 0x8a85221e,
+ 0x2bbca6f0, 0x13872d83, 0xb2bea96d, 0x63f03b65, 0xc2c9bf8b,
+ 0xfaf234f8, 0x5bcbb016, 0x831e16a9, 0x22279247, 0x1a1c1934,
+ 0xbb259dda, 0x6a6b0fd2, 0xcb528b3c, 0xf369004f, 0x525084a1,
+ 0xbfdf99ac, 0x1ee61d42, 0x26dd9631, 0x87e412df, 0x56aa80d7,
+ 0xf7930439, 0xcfa88f4a, 0x6e910ba4, 0xb644ad1b, 0x177d29f5,
+ 0x2f46a286, 0x8e7f2668, 0x5f31b460, 0xfe08308e, 0xc633bbfd,
+ 0x670a3f13, 0xace9f0c2, 0x0dd0742c, 0x35ebff5f, 0x94d27bb1,
+ 0x459ce9b9, 0xe4a56d57, 0xdc9ee624, 0x7da762ca, 0xa572c475,
+ 0x044b409b, 0x3c70cbe8, 0x9d494f06, 0x4c07dd0e, 0xed3e59e0,
+ 0xd505d293, 0x743c567d, 0xd56aeec8, 0x74536a26, 0x4c68e155,
+ 0xed5165bb, 0x3c1ff7b3, 0x9d26735d, 0xa51df82e, 0x04247cc0,
+ 0xdcf1da7f, 0x7dc85e91, 0x45f3d5e2, 0xe4ca510c, 0x3584c304,
+ 0x94bd47ea, 0xac86cc99, 0x0dbf4877, 0xc65c87a6, 0x67650348,
+ 0x5f5e883b, 0xfe670cd5, 0x2f299edd, 0x8e101a33, 0xb62b9140,
+ 0x171215ae, 0xcfc7b311, 0x6efe37ff, 0x56c5bc8c, 0xf7fc3862,
+ 0x26b2aa6a, 0x878b2e84, 0xbfb0a5f7, 0x1e892119, 0xf3063c14,
+ 0x523fb8fa, 0x6a043389, 0xcb3db767, 0x1a73256f, 0xbb4aa181,
+ 0x83712af2, 0x2248ae1c, 0xfa9d08a3, 0x5ba48c4d, 0x639f073e,
+ 0xc2a683d0, 0x13e811d8, 0xb2d19536, 0x8aea1e45, 0x2bd39aab,
+ 0xe030557a, 0x4109d194, 0x79325ae7, 0xd80bde09, 0x09454c01,
+ 0xa87cc8ef, 0x9047439c, 0x317ec772, 0xe9ab61cd, 0x4892e523,
+ 0x70a96e50, 0xd190eabe, 0x00de78b6, 0xa1e7fc58, 0x99dc772b,
+ 0x38e5f3c5},
+ {0x00000000, 0xe81790a1, 0x0b5e2703, 0xe349b7a2, 0x16bc4e06,
+ 0xfeabdea7, 0x1de26905, 0xf5f5f9a4, 0x2d789c0c, 0xc56f0cad,
+ 0x2626bb0f, 0xce312bae, 0x3bc4d20a, 0xd3d342ab, 0x309af509,
+ 0xd88d65a8, 0x5af13818, 0xb2e6a8b9, 0x51af1f1b, 0xb9b88fba,
+ 0x4c4d761e, 0xa45ae6bf, 0x4713511d, 0xaf04c1bc, 0x7789a414,
+ 0x9f9e34b5, 0x7cd78317, 0x94c013b6, 0x6135ea12, 0x89227ab3,
+ 0x6a6bcd11, 0x827c5db0, 0xb5e27030, 0x5df5e091, 0xbebc5733,
+ 0x56abc792, 0xa35e3e36, 0x4b49ae97, 0xa8001935, 0x40178994,
+ 0x989aec3c, 0x708d7c9d, 0x93c4cb3f, 0x7bd35b9e, 0x8e26a23a,
+ 0x6631329b, 0x85788539, 0x6d6f1598, 0xef134828, 0x0704d889,
+ 0xe44d6f2b, 0x0c5aff8a, 0xf9af062e, 0x11b8968f, 0xf2f1212d,
+ 0x1ae6b18c, 0xc26bd424, 0x2a7c4485, 0xc935f327, 0x21226386,
+ 0xd4d79a22, 0x3cc00a83, 0xdf89bd21, 0x379e2d80, 0xb0b5e621,
+ 0x58a27680, 0xbbebc122, 0x53fc5183, 0xa609a827, 0x4e1e3886,
+ 0xad578f24, 0x45401f85, 0x9dcd7a2d, 0x75daea8c, 0x96935d2e,
+ 0x7e84cd8f, 0x8b71342b, 0x6366a48a, 0x802f1328, 0x68388389,
+ 0xea44de39, 0x02534e98, 0xe11af93a, 0x090d699b, 0xfcf8903f,
+ 0x14ef009e, 0xf7a6b73c, 0x1fb1279d, 0xc73c4235, 0x2f2bd294,
+ 0xcc626536, 0x2475f597, 0xd1800c33, 0x39979c92, 0xdade2b30,
+ 0x32c9bb91, 0x05579611, 0xed4006b0, 0x0e09b112, 0xe61e21b3,
+ 0x13ebd817, 0xfbfc48b6, 0x18b5ff14, 0xf0a26fb5, 0x282f0a1d,
+ 0xc0389abc, 0x23712d1e, 0xcb66bdbf, 0x3e93441b, 0xd684d4ba,
+ 0x35cd6318, 0xdddaf3b9, 0x5fa6ae09, 0xb7b13ea8, 0x54f8890a,
+ 0xbcef19ab, 0x491ae00f, 0xa10d70ae, 0x4244c70c, 0xaa5357ad,
+ 0x72de3205, 0x9ac9a2a4, 0x79801506, 0x919785a7, 0x64627c03,
+ 0x8c75eca2, 0x6f3c5b00, 0x872bcba1, 0xba1aca03, 0x520d5aa2,
+ 0xb144ed00, 0x59537da1, 0xaca68405, 0x44b114a4, 0xa7f8a306,
+ 0x4fef33a7, 0x9762560f, 0x7f75c6ae, 0x9c3c710c, 0x742be1ad,
+ 0x81de1809, 0x69c988a8, 0x8a803f0a, 0x6297afab, 0xe0ebf21b,
+ 0x08fc62ba, 0xebb5d518, 0x03a245b9, 0xf657bc1d, 0x1e402cbc,
+ 0xfd099b1e, 0x151e0bbf, 0xcd936e17, 0x2584feb6, 0xc6cd4914,
+ 0x2edad9b5, 0xdb2f2011, 0x3338b0b0, 0xd0710712, 0x386697b3,
+ 0x0ff8ba33, 0xe7ef2a92, 0x04a69d30, 0xecb10d91, 0x1944f435,
+ 0xf1536494, 0x121ad336, 0xfa0d4397, 0x2280263f, 0xca97b69e,
+ 0x29de013c, 0xc1c9919d, 0x343c6839, 0xdc2bf898, 0x3f624f3a,
+ 0xd775df9b, 0x5509822b, 0xbd1e128a, 0x5e57a528, 0xb6403589,
+ 0x43b5cc2d, 0xaba25c8c, 0x48ebeb2e, 0xa0fc7b8f, 0x78711e27,
+ 0x90668e86, 0x732f3924, 0x9b38a985, 0x6ecd5021, 0x86dac080,
+ 0x65937722, 0x8d84e783, 0x0aaf2c22, 0xe2b8bc83, 0x01f10b21,
+ 0xe9e69b80, 0x1c136224, 0xf404f285, 0x174d4527, 0xff5ad586,
+ 0x27d7b02e, 0xcfc0208f, 0x2c89972d, 0xc49e078c, 0x316bfe28,
+ 0xd97c6e89, 0x3a35d92b, 0xd222498a, 0x505e143a, 0xb849849b,
+ 0x5b003339, 0xb317a398, 0x46e25a3c, 0xaef5ca9d, 0x4dbc7d3f,
+ 0xa5abed9e, 0x7d268836, 0x95311897, 0x7678af35, 0x9e6f3f94,
+ 0x6b9ac630, 0x838d5691, 0x60c4e133, 0x88d37192, 0xbf4d5c12,
+ 0x575accb3, 0xb4137b11, 0x5c04ebb0, 0xa9f11214, 0x41e682b5,
+ 0xa2af3517, 0x4ab8a5b6, 0x9235c01e, 0x7a2250bf, 0x996be71d,
+ 0x717c77bc, 0x84898e18, 0x6c9e1eb9, 0x8fd7a91b, 0x67c039ba,
+ 0xe5bc640a, 0x0dabf4ab, 0xeee24309, 0x06f5d3a8, 0xf3002a0c,
+ 0x1b17baad, 0xf85e0d0f, 0x10499dae, 0xc8c4f806, 0x20d368a7,
+ 0xc39adf05, 0x2b8d4fa4, 0xde78b600, 0x366f26a1, 0xd5269103,
+ 0x3d3101a2}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x0000000000000000, 0xa19017e800000000, 0x03275e0b00000000,
+ 0xa2b749e300000000, 0x064ebc1600000000, 0xa7deabfe00000000,
+ 0x0569e21d00000000, 0xa4f9f5f500000000, 0x0c9c782d00000000,
+ 0xad0c6fc500000000, 0x0fbb262600000000, 0xae2b31ce00000000,
+ 0x0ad2c43b00000000, 0xab42d3d300000000, 0x09f59a3000000000,
+ 0xa8658dd800000000, 0x1838f15a00000000, 0xb9a8e6b200000000,
+ 0x1b1faf5100000000, 0xba8fb8b900000000, 0x1e764d4c00000000,
+ 0xbfe65aa400000000, 0x1d51134700000000, 0xbcc104af00000000,
+ 0x14a4897700000000, 0xb5349e9f00000000, 0x1783d77c00000000,
+ 0xb613c09400000000, 0x12ea356100000000, 0xb37a228900000000,
+ 0x11cd6b6a00000000, 0xb05d7c8200000000, 0x3070e2b500000000,
+ 0x91e0f55d00000000, 0x3357bcbe00000000, 0x92c7ab5600000000,
+ 0x363e5ea300000000, 0x97ae494b00000000, 0x351900a800000000,
+ 0x9489174000000000, 0x3cec9a9800000000, 0x9d7c8d7000000000,
+ 0x3fcbc49300000000, 0x9e5bd37b00000000, 0x3aa2268e00000000,
+ 0x9b32316600000000, 0x3985788500000000, 0x98156f6d00000000,
+ 0x284813ef00000000, 0x89d8040700000000, 0x2b6f4de400000000,
+ 0x8aff5a0c00000000, 0x2e06aff900000000, 0x8f96b81100000000,
+ 0x2d21f1f200000000, 0x8cb1e61a00000000, 0x24d46bc200000000,
+ 0x85447c2a00000000, 0x27f335c900000000, 0x8663222100000000,
+ 0x229ad7d400000000, 0x830ac03c00000000, 0x21bd89df00000000,
+ 0x802d9e3700000000, 0x21e6b5b000000000, 0x8076a25800000000,
+ 0x22c1ebbb00000000, 0x8351fc5300000000, 0x27a809a600000000,
+ 0x86381e4e00000000, 0x248f57ad00000000, 0x851f404500000000,
+ 0x2d7acd9d00000000, 0x8ceada7500000000, 0x2e5d939600000000,
+ 0x8fcd847e00000000, 0x2b34718b00000000, 0x8aa4666300000000,
+ 0x28132f8000000000, 0x8983386800000000, 0x39de44ea00000000,
+ 0x984e530200000000, 0x3af91ae100000000, 0x9b690d0900000000,
+ 0x3f90f8fc00000000, 0x9e00ef1400000000, 0x3cb7a6f700000000,
+ 0x9d27b11f00000000, 0x35423cc700000000, 0x94d22b2f00000000,
+ 0x366562cc00000000, 0x97f5752400000000, 0x330c80d100000000,
+ 0x929c973900000000, 0x302bdeda00000000, 0x91bbc93200000000,
+ 0x1196570500000000, 0xb00640ed00000000, 0x12b1090e00000000,
+ 0xb3211ee600000000, 0x17d8eb1300000000, 0xb648fcfb00000000,
+ 0x14ffb51800000000, 0xb56fa2f000000000, 0x1d0a2f2800000000,
+ 0xbc9a38c000000000, 0x1e2d712300000000, 0xbfbd66cb00000000,
+ 0x1b44933e00000000, 0xbad484d600000000, 0x1863cd3500000000,
+ 0xb9f3dadd00000000, 0x09aea65f00000000, 0xa83eb1b700000000,
+ 0x0a89f85400000000, 0xab19efbc00000000, 0x0fe01a4900000000,
+ 0xae700da100000000, 0x0cc7444200000000, 0xad5753aa00000000,
+ 0x0532de7200000000, 0xa4a2c99a00000000, 0x0615807900000000,
+ 0xa785979100000000, 0x037c626400000000, 0xa2ec758c00000000,
+ 0x005b3c6f00000000, 0xa1cb2b8700000000, 0x03ca1aba00000000,
+ 0xa25a0d5200000000, 0x00ed44b100000000, 0xa17d535900000000,
+ 0x0584a6ac00000000, 0xa414b14400000000, 0x06a3f8a700000000,
+ 0xa733ef4f00000000, 0x0f56629700000000, 0xaec6757f00000000,
+ 0x0c713c9c00000000, 0xade12b7400000000, 0x0918de8100000000,
+ 0xa888c96900000000, 0x0a3f808a00000000, 0xabaf976200000000,
+ 0x1bf2ebe000000000, 0xba62fc0800000000, 0x18d5b5eb00000000,
+ 0xb945a20300000000, 0x1dbc57f600000000, 0xbc2c401e00000000,
+ 0x1e9b09fd00000000, 0xbf0b1e1500000000, 0x176e93cd00000000,
+ 0xb6fe842500000000, 0x1449cdc600000000, 0xb5d9da2e00000000,
+ 0x11202fdb00000000, 0xb0b0383300000000, 0x120771d000000000,
+ 0xb397663800000000, 0x33baf80f00000000, 0x922aefe700000000,
+ 0x309da60400000000, 0x910db1ec00000000, 0x35f4441900000000,
+ 0x946453f100000000, 0x36d31a1200000000, 0x97430dfa00000000,
+ 0x3f26802200000000, 0x9eb697ca00000000, 0x3c01de2900000000,
+ 0x9d91c9c100000000, 0x39683c3400000000, 0x98f82bdc00000000,
+ 0x3a4f623f00000000, 0x9bdf75d700000000, 0x2b82095500000000,
+ 0x8a121ebd00000000, 0x28a5575e00000000, 0x893540b600000000,
+ 0x2dccb54300000000, 0x8c5ca2ab00000000, 0x2eebeb4800000000,
+ 0x8f7bfca000000000, 0x271e717800000000, 0x868e669000000000,
+ 0x24392f7300000000, 0x85a9389b00000000, 0x2150cd6e00000000,
+ 0x80c0da8600000000, 0x2277936500000000, 0x83e7848d00000000,
+ 0x222caf0a00000000, 0x83bcb8e200000000, 0x210bf10100000000,
+ 0x809be6e900000000, 0x2462131c00000000, 0x85f204f400000000,
+ 0x27454d1700000000, 0x86d55aff00000000, 0x2eb0d72700000000,
+ 0x8f20c0cf00000000, 0x2d97892c00000000, 0x8c079ec400000000,
+ 0x28fe6b3100000000, 0x896e7cd900000000, 0x2bd9353a00000000,
+ 0x8a4922d200000000, 0x3a145e5000000000, 0x9b8449b800000000,
+ 0x3933005b00000000, 0x98a317b300000000, 0x3c5ae24600000000,
+ 0x9dcaf5ae00000000, 0x3f7dbc4d00000000, 0x9eedaba500000000,
+ 0x3688267d00000000, 0x9718319500000000, 0x35af787600000000,
+ 0x943f6f9e00000000, 0x30c69a6b00000000, 0x91568d8300000000,
+ 0x33e1c46000000000, 0x9271d38800000000, 0x125c4dbf00000000,
+ 0xb3cc5a5700000000, 0x117b13b400000000, 0xb0eb045c00000000,
+ 0x1412f1a900000000, 0xb582e64100000000, 0x1735afa200000000,
+ 0xb6a5b84a00000000, 0x1ec0359200000000, 0xbf50227a00000000,
+ 0x1de76b9900000000, 0xbc777c7100000000, 0x188e898400000000,
+ 0xb91e9e6c00000000, 0x1ba9d78f00000000, 0xba39c06700000000,
+ 0x0a64bce500000000, 0xabf4ab0d00000000, 0x0943e2ee00000000,
+ 0xa8d3f50600000000, 0x0c2a00f300000000, 0xadba171b00000000,
+ 0x0f0d5ef800000000, 0xae9d491000000000, 0x06f8c4c800000000,
+ 0xa768d32000000000, 0x05df9ac300000000, 0xa44f8d2b00000000,
+ 0x00b678de00000000, 0xa1266f3600000000, 0x039126d500000000,
+ 0xa201313d00000000},
+ {0x0000000000000000, 0xee8439a100000000, 0x9d0f029900000000,
+ 0x738b3b3800000000, 0x7b1975e900000000, 0x959d4c4800000000,
+ 0xe616777000000000, 0x08924ed100000000, 0xb7349b0900000000,
+ 0x59b0a2a800000000, 0x2a3b999000000000, 0xc4bfa03100000000,
+ 0xcc2deee000000000, 0x22a9d74100000000, 0x5122ec7900000000,
+ 0xbfa6d5d800000000, 0x6e69361300000000, 0x80ed0fb200000000,
+ 0xf366348a00000000, 0x1de20d2b00000000, 0x157043fa00000000,
+ 0xfbf47a5b00000000, 0x887f416300000000, 0x66fb78c200000000,
+ 0xd95dad1a00000000, 0x37d994bb00000000, 0x4452af8300000000,
+ 0xaad6962200000000, 0xa244d8f300000000, 0x4cc0e15200000000,
+ 0x3f4bda6a00000000, 0xd1cfe3cb00000000, 0xdcd26c2600000000,
+ 0x3256558700000000, 0x41dd6ebf00000000, 0xaf59571e00000000,
+ 0xa7cb19cf00000000, 0x494f206e00000000, 0x3ac41b5600000000,
+ 0xd44022f700000000, 0x6be6f72f00000000, 0x8562ce8e00000000,
+ 0xf6e9f5b600000000, 0x186dcc1700000000, 0x10ff82c600000000,
+ 0xfe7bbb6700000000, 0x8df0805f00000000, 0x6374b9fe00000000,
+ 0xb2bb5a3500000000, 0x5c3f639400000000, 0x2fb458ac00000000,
+ 0xc130610d00000000, 0xc9a22fdc00000000, 0x2726167d00000000,
+ 0x54ad2d4500000000, 0xba2914e400000000, 0x058fc13c00000000,
+ 0xeb0bf89d00000000, 0x9880c3a500000000, 0x7604fa0400000000,
+ 0x7e96b4d500000000, 0x90128d7400000000, 0xe399b64c00000000,
+ 0x0d1d8fed00000000, 0xb8a5d94c00000000, 0x5621e0ed00000000,
+ 0x25aadbd500000000, 0xcb2ee27400000000, 0xc3bcaca500000000,
+ 0x2d38950400000000, 0x5eb3ae3c00000000, 0xb037979d00000000,
+ 0x0f91424500000000, 0xe1157be400000000, 0x929e40dc00000000,
+ 0x7c1a797d00000000, 0x748837ac00000000, 0x9a0c0e0d00000000,
+ 0xe987353500000000, 0x07030c9400000000, 0xd6ccef5f00000000,
+ 0x3848d6fe00000000, 0x4bc3edc600000000, 0xa547d46700000000,
+ 0xadd59ab600000000, 0x4351a31700000000, 0x30da982f00000000,
+ 0xde5ea18e00000000, 0x61f8745600000000, 0x8f7c4df700000000,
+ 0xfcf776cf00000000, 0x12734f6e00000000, 0x1ae101bf00000000,
+ 0xf465381e00000000, 0x87ee032600000000, 0x696a3a8700000000,
+ 0x6477b56a00000000, 0x8af38ccb00000000, 0xf978b7f300000000,
+ 0x17fc8e5200000000, 0x1f6ec08300000000, 0xf1eaf92200000000,
+ 0x8261c21a00000000, 0x6ce5fbbb00000000, 0xd3432e6300000000,
+ 0x3dc717c200000000, 0x4e4c2cfa00000000, 0xa0c8155b00000000,
+ 0xa85a5b8a00000000, 0x46de622b00000000, 0x3555591300000000,
+ 0xdbd160b200000000, 0x0a1e837900000000, 0xe49abad800000000,
+ 0x971181e000000000, 0x7995b84100000000, 0x7107f69000000000,
+ 0x9f83cf3100000000, 0xec08f40900000000, 0x028ccda800000000,
+ 0xbd2a187000000000, 0x53ae21d100000000, 0x20251ae900000000,
+ 0xcea1234800000000, 0xc6336d9900000000, 0x28b7543800000000,
+ 0x5b3c6f0000000000, 0xb5b856a100000000, 0x704bb39900000000,
+ 0x9ecf8a3800000000, 0xed44b10000000000, 0x03c088a100000000,
+ 0x0b52c67000000000, 0xe5d6ffd100000000, 0x965dc4e900000000,
+ 0x78d9fd4800000000, 0xc77f289000000000, 0x29fb113100000000,
+ 0x5a702a0900000000, 0xb4f413a800000000, 0xbc665d7900000000,
+ 0x52e264d800000000, 0x21695fe000000000, 0xcfed664100000000,
+ 0x1e22858a00000000, 0xf0a6bc2b00000000, 0x832d871300000000,
+ 0x6da9beb200000000, 0x653bf06300000000, 0x8bbfc9c200000000,
+ 0xf834f2fa00000000, 0x16b0cb5b00000000, 0xa9161e8300000000,
+ 0x4792272200000000, 0x34191c1a00000000, 0xda9d25bb00000000,
+ 0xd20f6b6a00000000, 0x3c8b52cb00000000, 0x4f0069f300000000,
+ 0xa184505200000000, 0xac99dfbf00000000, 0x421de61e00000000,
+ 0x3196dd2600000000, 0xdf12e48700000000, 0xd780aa5600000000,
+ 0x390493f700000000, 0x4a8fa8cf00000000, 0xa40b916e00000000,
+ 0x1bad44b600000000, 0xf5297d1700000000, 0x86a2462f00000000,
+ 0x68267f8e00000000, 0x60b4315f00000000, 0x8e3008fe00000000,
+ 0xfdbb33c600000000, 0x133f0a6700000000, 0xc2f0e9ac00000000,
+ 0x2c74d00d00000000, 0x5fffeb3500000000, 0xb17bd29400000000,
+ 0xb9e99c4500000000, 0x576da5e400000000, 0x24e69edc00000000,
+ 0xca62a77d00000000, 0x75c472a500000000, 0x9b404b0400000000,
+ 0xe8cb703c00000000, 0x064f499d00000000, 0x0edd074c00000000,
+ 0xe0593eed00000000, 0x93d205d500000000, 0x7d563c7400000000,
+ 0xc8ee6ad500000000, 0x266a537400000000, 0x55e1684c00000000,
+ 0xbb6551ed00000000, 0xb3f71f3c00000000, 0x5d73269d00000000,
+ 0x2ef81da500000000, 0xc07c240400000000, 0x7fdaf1dc00000000,
+ 0x915ec87d00000000, 0xe2d5f34500000000, 0x0c51cae400000000,
+ 0x04c3843500000000, 0xea47bd9400000000, 0x99cc86ac00000000,
+ 0x7748bf0d00000000, 0xa6875cc600000000, 0x4803656700000000,
+ 0x3b885e5f00000000, 0xd50c67fe00000000, 0xdd9e292f00000000,
+ 0x331a108e00000000, 0x40912bb600000000, 0xae15121700000000,
+ 0x11b3c7cf00000000, 0xff37fe6e00000000, 0x8cbcc55600000000,
+ 0x6238fcf700000000, 0x6aaab22600000000, 0x842e8b8700000000,
+ 0xf7a5b0bf00000000, 0x1921891e00000000, 0x143c06f300000000,
+ 0xfab83f5200000000, 0x8933046a00000000, 0x67b73dcb00000000,
+ 0x6f25731a00000000, 0x81a14abb00000000, 0xf22a718300000000,
+ 0x1cae482200000000, 0xa3089dfa00000000, 0x4d8ca45b00000000,
+ 0x3e079f6300000000, 0xd083a6c200000000, 0xd811e81300000000,
+ 0x3695d1b200000000, 0x451eea8a00000000, 0xab9ad32b00000000,
+ 0x7a5530e000000000, 0x94d1094100000000, 0xe75a327900000000,
+ 0x09de0bd800000000, 0x014c450900000000, 0xefc87ca800000000,
+ 0x9c43479000000000, 0x72c77e3100000000, 0xcd61abe900000000,
+ 0x23e5924800000000, 0x506ea97000000000, 0xbeea90d100000000,
+ 0xb678de0000000000, 0x58fce7a100000000, 0x2b77dc9900000000,
+ 0xc5f3e53800000000},
+ {0x0000000000000000, 0xfbf6134700000000, 0xf6ed278e00000000,
+ 0x0d1b34c900000000, 0xaddd3ec700000000, 0x562b2d8000000000,
+ 0x5b30194900000000, 0xa0c60a0e00000000, 0x1bbd0c5500000000,
+ 0xe04b1f1200000000, 0xed502bdb00000000, 0x16a6389c00000000,
+ 0xb660329200000000, 0x4d9621d500000000, 0x408d151c00000000,
+ 0xbb7b065b00000000, 0x367a19aa00000000, 0xcd8c0aed00000000,
+ 0xc0973e2400000000, 0x3b612d6300000000, 0x9ba7276d00000000,
+ 0x6051342a00000000, 0x6d4a00e300000000, 0x96bc13a400000000,
+ 0x2dc715ff00000000, 0xd63106b800000000, 0xdb2a327100000000,
+ 0x20dc213600000000, 0x801a2b3800000000, 0x7bec387f00000000,
+ 0x76f70cb600000000, 0x8d011ff100000000, 0x2df2438f00000000,
+ 0xd60450c800000000, 0xdb1f640100000000, 0x20e9774600000000,
+ 0x802f7d4800000000, 0x7bd96e0f00000000, 0x76c25ac600000000,
+ 0x8d34498100000000, 0x364f4fda00000000, 0xcdb95c9d00000000,
+ 0xc0a2685400000000, 0x3b547b1300000000, 0x9b92711d00000000,
+ 0x6064625a00000000, 0x6d7f569300000000, 0x968945d400000000,
+ 0x1b885a2500000000, 0xe07e496200000000, 0xed657dab00000000,
+ 0x16936eec00000000, 0xb65564e200000000, 0x4da377a500000000,
+ 0x40b8436c00000000, 0xbb4e502b00000000, 0x0035567000000000,
+ 0xfbc3453700000000, 0xf6d871fe00000000, 0x0d2e62b900000000,
+ 0xade868b700000000, 0x561e7bf000000000, 0x5b054f3900000000,
+ 0xa0f35c7e00000000, 0x1be2f6c500000000, 0xe014e58200000000,
+ 0xed0fd14b00000000, 0x16f9c20c00000000, 0xb63fc80200000000,
+ 0x4dc9db4500000000, 0x40d2ef8c00000000, 0xbb24fccb00000000,
+ 0x005ffa9000000000, 0xfba9e9d700000000, 0xf6b2dd1e00000000,
+ 0x0d44ce5900000000, 0xad82c45700000000, 0x5674d71000000000,
+ 0x5b6fe3d900000000, 0xa099f09e00000000, 0x2d98ef6f00000000,
+ 0xd66efc2800000000, 0xdb75c8e100000000, 0x2083dba600000000,
+ 0x8045d1a800000000, 0x7bb3c2ef00000000, 0x76a8f62600000000,
+ 0x8d5ee56100000000, 0x3625e33a00000000, 0xcdd3f07d00000000,
+ 0xc0c8c4b400000000, 0x3b3ed7f300000000, 0x9bf8ddfd00000000,
+ 0x600eceba00000000, 0x6d15fa7300000000, 0x96e3e93400000000,
+ 0x3610b54a00000000, 0xcde6a60d00000000, 0xc0fd92c400000000,
+ 0x3b0b818300000000, 0x9bcd8b8d00000000, 0x603b98ca00000000,
+ 0x6d20ac0300000000, 0x96d6bf4400000000, 0x2dadb91f00000000,
+ 0xd65baa5800000000, 0xdb409e9100000000, 0x20b68dd600000000,
+ 0x807087d800000000, 0x7b86949f00000000, 0x769da05600000000,
+ 0x8d6bb31100000000, 0x006aace000000000, 0xfb9cbfa700000000,
+ 0xf6878b6e00000000, 0x0d71982900000000, 0xadb7922700000000,
+ 0x5641816000000000, 0x5b5ab5a900000000, 0xa0aca6ee00000000,
+ 0x1bd7a0b500000000, 0xe021b3f200000000, 0xed3a873b00000000,
+ 0x16cc947c00000000, 0xb60a9e7200000000, 0x4dfc8d3500000000,
+ 0x40e7b9fc00000000, 0xbb11aabb00000000, 0x77c29c5000000000,
+ 0x8c348f1700000000, 0x812fbbde00000000, 0x7ad9a89900000000,
+ 0xda1fa29700000000, 0x21e9b1d000000000, 0x2cf2851900000000,
+ 0xd704965e00000000, 0x6c7f900500000000, 0x9789834200000000,
+ 0x9a92b78b00000000, 0x6164a4cc00000000, 0xc1a2aec200000000,
+ 0x3a54bd8500000000, 0x374f894c00000000, 0xccb99a0b00000000,
+ 0x41b885fa00000000, 0xba4e96bd00000000, 0xb755a27400000000,
+ 0x4ca3b13300000000, 0xec65bb3d00000000, 0x1793a87a00000000,
+ 0x1a889cb300000000, 0xe17e8ff400000000, 0x5a0589af00000000,
+ 0xa1f39ae800000000, 0xace8ae2100000000, 0x571ebd6600000000,
+ 0xf7d8b76800000000, 0x0c2ea42f00000000, 0x013590e600000000,
+ 0xfac383a100000000, 0x5a30dfdf00000000, 0xa1c6cc9800000000,
+ 0xacddf85100000000, 0x572beb1600000000, 0xf7ede11800000000,
+ 0x0c1bf25f00000000, 0x0100c69600000000, 0xfaf6d5d100000000,
+ 0x418dd38a00000000, 0xba7bc0cd00000000, 0xb760f40400000000,
+ 0x4c96e74300000000, 0xec50ed4d00000000, 0x17a6fe0a00000000,
+ 0x1abdcac300000000, 0xe14bd98400000000, 0x6c4ac67500000000,
+ 0x97bcd53200000000, 0x9aa7e1fb00000000, 0x6151f2bc00000000,
+ 0xc197f8b200000000, 0x3a61ebf500000000, 0x377adf3c00000000,
+ 0xcc8ccc7b00000000, 0x77f7ca2000000000, 0x8c01d96700000000,
+ 0x811aedae00000000, 0x7aecfee900000000, 0xda2af4e700000000,
+ 0x21dce7a000000000, 0x2cc7d36900000000, 0xd731c02e00000000,
+ 0x6c206a9500000000, 0x97d679d200000000, 0x9acd4d1b00000000,
+ 0x613b5e5c00000000, 0xc1fd545200000000, 0x3a0b471500000000,
+ 0x371073dc00000000, 0xcce6609b00000000, 0x779d66c000000000,
+ 0x8c6b758700000000, 0x8170414e00000000, 0x7a86520900000000,
+ 0xda40580700000000, 0x21b64b4000000000, 0x2cad7f8900000000,
+ 0xd75b6cce00000000, 0x5a5a733f00000000, 0xa1ac607800000000,
+ 0xacb754b100000000, 0x574147f600000000, 0xf7874df800000000,
+ 0x0c715ebf00000000, 0x016a6a7600000000, 0xfa9c793100000000,
+ 0x41e77f6a00000000, 0xba116c2d00000000, 0xb70a58e400000000,
+ 0x4cfc4ba300000000, 0xec3a41ad00000000, 0x17cc52ea00000000,
+ 0x1ad7662300000000, 0xe121756400000000, 0x41d2291a00000000,
+ 0xba243a5d00000000, 0xb73f0e9400000000, 0x4cc91dd300000000,
+ 0xec0f17dd00000000, 0x17f9049a00000000, 0x1ae2305300000000,
+ 0xe114231400000000, 0x5a6f254f00000000, 0xa199360800000000,
+ 0xac8202c100000000, 0x5774118600000000, 0xf7b21b8800000000,
+ 0x0c4408cf00000000, 0x015f3c0600000000, 0xfaa92f4100000000,
+ 0x77a830b000000000, 0x8c5e23f700000000, 0x8145173e00000000,
+ 0x7ab3047900000000, 0xda750e7700000000, 0x21831d3000000000,
+ 0x2c9829f900000000, 0xd76e3abe00000000, 0x6c153ce500000000,
+ 0x97e32fa200000000, 0x9af81b6b00000000, 0x610e082c00000000,
+ 0xc1c8022200000000, 0x3a3e116500000000, 0x372525ac00000000,
+ 0xccd336eb00000000},
+ {0x0000000000000000, 0x6238282a00000000, 0xc470505400000000,
+ 0xa648787e00000000, 0x88e1a0a800000000, 0xead9888200000000,
+ 0x4c91f0fc00000000, 0x2ea9d8d600000000, 0x51c5308a00000000,
+ 0x33fd18a000000000, 0x95b560de00000000, 0xf78d48f400000000,
+ 0xd924902200000000, 0xbb1cb80800000000, 0x1d54c07600000000,
+ 0x7f6ce85c00000000, 0xe38c10cf00000000, 0x81b438e500000000,
+ 0x27fc409b00000000, 0x45c468b100000000, 0x6b6db06700000000,
+ 0x0955984d00000000, 0xaf1de03300000000, 0xcd25c81900000000,
+ 0xb249204500000000, 0xd071086f00000000, 0x7639701100000000,
+ 0x1401583b00000000, 0x3aa880ed00000000, 0x5890a8c700000000,
+ 0xfed8d0b900000000, 0x9ce0f89300000000, 0x871f504500000000,
+ 0xe527786f00000000, 0x436f001100000000, 0x2157283b00000000,
+ 0x0ffef0ed00000000, 0x6dc6d8c700000000, 0xcb8ea0b900000000,
+ 0xa9b6889300000000, 0xd6da60cf00000000, 0xb4e248e500000000,
+ 0x12aa309b00000000, 0x709218b100000000, 0x5e3bc06700000000,
+ 0x3c03e84d00000000, 0x9a4b903300000000, 0xf873b81900000000,
+ 0x6493408a00000000, 0x06ab68a000000000, 0xa0e310de00000000,
+ 0xc2db38f400000000, 0xec72e02200000000, 0x8e4ac80800000000,
+ 0x2802b07600000000, 0x4a3a985c00000000, 0x3556700000000000,
+ 0x576e582a00000000, 0xf126205400000000, 0x931e087e00000000,
+ 0xbdb7d0a800000000, 0xdf8ff88200000000, 0x79c780fc00000000,
+ 0x1bffa8d600000000, 0x0e3fa08a00000000, 0x6c0788a000000000,
+ 0xca4ff0de00000000, 0xa877d8f400000000, 0x86de002200000000,
+ 0xe4e6280800000000, 0x42ae507600000000, 0x2096785c00000000,
+ 0x5ffa900000000000, 0x3dc2b82a00000000, 0x9b8ac05400000000,
+ 0xf9b2e87e00000000, 0xd71b30a800000000, 0xb523188200000000,
+ 0x136b60fc00000000, 0x715348d600000000, 0xedb3b04500000000,
+ 0x8f8b986f00000000, 0x29c3e01100000000, 0x4bfbc83b00000000,
+ 0x655210ed00000000, 0x076a38c700000000, 0xa12240b900000000,
+ 0xc31a689300000000, 0xbc7680cf00000000, 0xde4ea8e500000000,
+ 0x7806d09b00000000, 0x1a3ef8b100000000, 0x3497206700000000,
+ 0x56af084d00000000, 0xf0e7703300000000, 0x92df581900000000,
+ 0x8920f0cf00000000, 0xeb18d8e500000000, 0x4d50a09b00000000,
+ 0x2f6888b100000000, 0x01c1506700000000, 0x63f9784d00000000,
+ 0xc5b1003300000000, 0xa789281900000000, 0xd8e5c04500000000,
+ 0xbadde86f00000000, 0x1c95901100000000, 0x7eadb83b00000000,
+ 0x500460ed00000000, 0x323c48c700000000, 0x947430b900000000,
+ 0xf64c189300000000, 0x6aace00000000000, 0x0894c82a00000000,
+ 0xaedcb05400000000, 0xcce4987e00000000, 0xe24d40a800000000,
+ 0x8075688200000000, 0x263d10fc00000000, 0x440538d600000000,
+ 0x3b69d08a00000000, 0x5951f8a000000000, 0xff1980de00000000,
+ 0x9d21a8f400000000, 0xb388702200000000, 0xd1b0580800000000,
+ 0x77f8207600000000, 0x15c0085c00000000, 0x5d7831ce00000000,
+ 0x3f4019e400000000, 0x9908619a00000000, 0xfb3049b000000000,
+ 0xd599916600000000, 0xb7a1b94c00000000, 0x11e9c13200000000,
+ 0x73d1e91800000000, 0x0cbd014400000000, 0x6e85296e00000000,
+ 0xc8cd511000000000, 0xaaf5793a00000000, 0x845ca1ec00000000,
+ 0xe66489c600000000, 0x402cf1b800000000, 0x2214d99200000000,
+ 0xbef4210100000000, 0xdccc092b00000000, 0x7a84715500000000,
+ 0x18bc597f00000000, 0x361581a900000000, 0x542da98300000000,
+ 0xf265d1fd00000000, 0x905df9d700000000, 0xef31118b00000000,
+ 0x8d0939a100000000, 0x2b4141df00000000, 0x497969f500000000,
+ 0x67d0b12300000000, 0x05e8990900000000, 0xa3a0e17700000000,
+ 0xc198c95d00000000, 0xda67618b00000000, 0xb85f49a100000000,
+ 0x1e1731df00000000, 0x7c2f19f500000000, 0x5286c12300000000,
+ 0x30bee90900000000, 0x96f6917700000000, 0xf4ceb95d00000000,
+ 0x8ba2510100000000, 0xe99a792b00000000, 0x4fd2015500000000,
+ 0x2dea297f00000000, 0x0343f1a900000000, 0x617bd98300000000,
+ 0xc733a1fd00000000, 0xa50b89d700000000, 0x39eb714400000000,
+ 0x5bd3596e00000000, 0xfd9b211000000000, 0x9fa3093a00000000,
+ 0xb10ad1ec00000000, 0xd332f9c600000000, 0x757a81b800000000,
+ 0x1742a99200000000, 0x682e41ce00000000, 0x0a1669e400000000,
+ 0xac5e119a00000000, 0xce6639b000000000, 0xe0cfe16600000000,
+ 0x82f7c94c00000000, 0x24bfb13200000000, 0x4687991800000000,
+ 0x5347914400000000, 0x317fb96e00000000, 0x9737c11000000000,
+ 0xf50fe93a00000000, 0xdba631ec00000000, 0xb99e19c600000000,
+ 0x1fd661b800000000, 0x7dee499200000000, 0x0282a1ce00000000,
+ 0x60ba89e400000000, 0xc6f2f19a00000000, 0xa4cad9b000000000,
+ 0x8a63016600000000, 0xe85b294c00000000, 0x4e13513200000000,
+ 0x2c2b791800000000, 0xb0cb818b00000000, 0xd2f3a9a100000000,
+ 0x74bbd1df00000000, 0x1683f9f500000000, 0x382a212300000000,
+ 0x5a12090900000000, 0xfc5a717700000000, 0x9e62595d00000000,
+ 0xe10eb10100000000, 0x8336992b00000000, 0x257ee15500000000,
+ 0x4746c97f00000000, 0x69ef11a900000000, 0x0bd7398300000000,
+ 0xad9f41fd00000000, 0xcfa769d700000000, 0xd458c10100000000,
+ 0xb660e92b00000000, 0x1028915500000000, 0x7210b97f00000000,
+ 0x5cb961a900000000, 0x3e81498300000000, 0x98c931fd00000000,
+ 0xfaf119d700000000, 0x859df18b00000000, 0xe7a5d9a100000000,
+ 0x41eda1df00000000, 0x23d589f500000000, 0x0d7c512300000000,
+ 0x6f44790900000000, 0xc90c017700000000, 0xab34295d00000000,
+ 0x37d4d1ce00000000, 0x55ecf9e400000000, 0xf3a4819a00000000,
+ 0x919ca9b000000000, 0xbf35716600000000, 0xdd0d594c00000000,
+ 0x7b45213200000000, 0x197d091800000000, 0x6611e14400000000,
+ 0x0429c96e00000000, 0xa261b11000000000, 0xc059993a00000000,
+ 0xeef041ec00000000, 0x8cc869c600000000, 0x2a8011b800000000,
+ 0x48b8399200000000},
+ {0x0000000000000000, 0x4c2896a300000000, 0xd9565d9c00000000,
+ 0x957ecb3f00000000, 0xf3abcbe300000000, 0xbf835d4000000000,
+ 0x2afd967f00000000, 0x66d500dc00000000, 0xa751e61c00000000,
+ 0xeb7970bf00000000, 0x7e07bb8000000000, 0x322f2d2300000000,
+ 0x54fa2dff00000000, 0x18d2bb5c00000000, 0x8dac706300000000,
+ 0xc184e6c000000000, 0x4ea3cc3900000000, 0x028b5a9a00000000,
+ 0x97f591a500000000, 0xdbdd070600000000, 0xbd0807da00000000,
+ 0xf120917900000000, 0x645e5a4600000000, 0x2876cce500000000,
+ 0xe9f22a2500000000, 0xa5dabc8600000000, 0x30a477b900000000,
+ 0x7c8ce11a00000000, 0x1a59e1c600000000, 0x5671776500000000,
+ 0xc30fbc5a00000000, 0x8f272af900000000, 0x9c46997300000000,
+ 0xd06e0fd000000000, 0x4510c4ef00000000, 0x0938524c00000000,
+ 0x6fed529000000000, 0x23c5c43300000000, 0xb6bb0f0c00000000,
+ 0xfa9399af00000000, 0x3b177f6f00000000, 0x773fe9cc00000000,
+ 0xe24122f300000000, 0xae69b45000000000, 0xc8bcb48c00000000,
+ 0x8494222f00000000, 0x11eae91000000000, 0x5dc27fb300000000,
+ 0xd2e5554a00000000, 0x9ecdc3e900000000, 0x0bb308d600000000,
+ 0x479b9e7500000000, 0x214e9ea900000000, 0x6d66080a00000000,
+ 0xf818c33500000000, 0xb430559600000000, 0x75b4b35600000000,
+ 0x399c25f500000000, 0xace2eeca00000000, 0xe0ca786900000000,
+ 0x861f78b500000000, 0xca37ee1600000000, 0x5f49252900000000,
+ 0x1361b38a00000000, 0x388d32e700000000, 0x74a5a44400000000,
+ 0xe1db6f7b00000000, 0xadf3f9d800000000, 0xcb26f90400000000,
+ 0x870e6fa700000000, 0x1270a49800000000, 0x5e58323b00000000,
+ 0x9fdcd4fb00000000, 0xd3f4425800000000, 0x468a896700000000,
+ 0x0aa21fc400000000, 0x6c771f1800000000, 0x205f89bb00000000,
+ 0xb521428400000000, 0xf909d42700000000, 0x762efede00000000,
+ 0x3a06687d00000000, 0xaf78a34200000000, 0xe35035e100000000,
+ 0x8585353d00000000, 0xc9ada39e00000000, 0x5cd368a100000000,
+ 0x10fbfe0200000000, 0xd17f18c200000000, 0x9d578e6100000000,
+ 0x0829455e00000000, 0x4401d3fd00000000, 0x22d4d32100000000,
+ 0x6efc458200000000, 0xfb828ebd00000000, 0xb7aa181e00000000,
+ 0xa4cbab9400000000, 0xe8e33d3700000000, 0x7d9df60800000000,
+ 0x31b560ab00000000, 0x5760607700000000, 0x1b48f6d400000000,
+ 0x8e363deb00000000, 0xc21eab4800000000, 0x039a4d8800000000,
+ 0x4fb2db2b00000000, 0xdacc101400000000, 0x96e486b700000000,
+ 0xf031866b00000000, 0xbc1910c800000000, 0x2967dbf700000000,
+ 0x654f4d5400000000, 0xea6867ad00000000, 0xa640f10e00000000,
+ 0x333e3a3100000000, 0x7f16ac9200000000, 0x19c3ac4e00000000,
+ 0x55eb3aed00000000, 0xc095f1d200000000, 0x8cbd677100000000,
+ 0x4d3981b100000000, 0x0111171200000000, 0x946fdc2d00000000,
+ 0xd8474a8e00000000, 0xbe924a5200000000, 0xf2badcf100000000,
+ 0x67c417ce00000000, 0x2bec816d00000000, 0x311c141500000000,
+ 0x7d3482b600000000, 0xe84a498900000000, 0xa462df2a00000000,
+ 0xc2b7dff600000000, 0x8e9f495500000000, 0x1be1826a00000000,
+ 0x57c914c900000000, 0x964df20900000000, 0xda6564aa00000000,
+ 0x4f1baf9500000000, 0x0333393600000000, 0x65e639ea00000000,
+ 0x29ceaf4900000000, 0xbcb0647600000000, 0xf098f2d500000000,
+ 0x7fbfd82c00000000, 0x33974e8f00000000, 0xa6e985b000000000,
+ 0xeac1131300000000, 0x8c1413cf00000000, 0xc03c856c00000000,
+ 0x55424e5300000000, 0x196ad8f000000000, 0xd8ee3e3000000000,
+ 0x94c6a89300000000, 0x01b863ac00000000, 0x4d90f50f00000000,
+ 0x2b45f5d300000000, 0x676d637000000000, 0xf213a84f00000000,
+ 0xbe3b3eec00000000, 0xad5a8d6600000000, 0xe1721bc500000000,
+ 0x740cd0fa00000000, 0x3824465900000000, 0x5ef1468500000000,
+ 0x12d9d02600000000, 0x87a71b1900000000, 0xcb8f8dba00000000,
+ 0x0a0b6b7a00000000, 0x4623fdd900000000, 0xd35d36e600000000,
+ 0x9f75a04500000000, 0xf9a0a09900000000, 0xb588363a00000000,
+ 0x20f6fd0500000000, 0x6cde6ba600000000, 0xe3f9415f00000000,
+ 0xafd1d7fc00000000, 0x3aaf1cc300000000, 0x76878a6000000000,
+ 0x10528abc00000000, 0x5c7a1c1f00000000, 0xc904d72000000000,
+ 0x852c418300000000, 0x44a8a74300000000, 0x088031e000000000,
+ 0x9dfefadf00000000, 0xd1d66c7c00000000, 0xb7036ca000000000,
+ 0xfb2bfa0300000000, 0x6e55313c00000000, 0x227da79f00000000,
+ 0x099126f200000000, 0x45b9b05100000000, 0xd0c77b6e00000000,
+ 0x9cefedcd00000000, 0xfa3aed1100000000, 0xb6127bb200000000,
+ 0x236cb08d00000000, 0x6f44262e00000000, 0xaec0c0ee00000000,
+ 0xe2e8564d00000000, 0x77969d7200000000, 0x3bbe0bd100000000,
+ 0x5d6b0b0d00000000, 0x11439dae00000000, 0x843d569100000000,
+ 0xc815c03200000000, 0x4732eacb00000000, 0x0b1a7c6800000000,
+ 0x9e64b75700000000, 0xd24c21f400000000, 0xb499212800000000,
+ 0xf8b1b78b00000000, 0x6dcf7cb400000000, 0x21e7ea1700000000,
+ 0xe0630cd700000000, 0xac4b9a7400000000, 0x3935514b00000000,
+ 0x751dc7e800000000, 0x13c8c73400000000, 0x5fe0519700000000,
+ 0xca9e9aa800000000, 0x86b60c0b00000000, 0x95d7bf8100000000,
+ 0xd9ff292200000000, 0x4c81e21d00000000, 0x00a974be00000000,
+ 0x667c746200000000, 0x2a54e2c100000000, 0xbf2a29fe00000000,
+ 0xf302bf5d00000000, 0x3286599d00000000, 0x7eaecf3e00000000,
+ 0xebd0040100000000, 0xa7f892a200000000, 0xc12d927e00000000,
+ 0x8d0504dd00000000, 0x187bcfe200000000, 0x5453594100000000,
+ 0xdb7473b800000000, 0x975ce51b00000000, 0x02222e2400000000,
+ 0x4e0ab88700000000, 0x28dfb85b00000000, 0x64f72ef800000000,
+ 0xf189e5c700000000, 0xbda1736400000000, 0x7c2595a400000000,
+ 0x300d030700000000, 0xa573c83800000000, 0xe95b5e9b00000000,
+ 0x8f8e5e4700000000, 0xc3a6c8e400000000, 0x56d803db00000000,
+ 0x1af0957800000000},
+ {0x0000000000000000, 0x939bc97f00000000, 0x263793ff00000000,
+ 0xb5ac5a8000000000, 0x0d68572400000000, 0x9ef39e5b00000000,
+ 0x2b5fc4db00000000, 0xb8c40da400000000, 0x1ad0ae4800000000,
+ 0x894b673700000000, 0x3ce73db700000000, 0xaf7cf4c800000000,
+ 0x17b8f96c00000000, 0x8423301300000000, 0x318f6a9300000000,
+ 0xa214a3ec00000000, 0x34a05d9100000000, 0xa73b94ee00000000,
+ 0x1297ce6e00000000, 0x810c071100000000, 0x39c80ab500000000,
+ 0xaa53c3ca00000000, 0x1fff994a00000000, 0x8c64503500000000,
+ 0x2e70f3d900000000, 0xbdeb3aa600000000, 0x0847602600000000,
+ 0x9bdca95900000000, 0x2318a4fd00000000, 0xb0836d8200000000,
+ 0x052f370200000000, 0x96b4fe7d00000000, 0x2946caf900000000,
+ 0xbadd038600000000, 0x0f71590600000000, 0x9cea907900000000,
+ 0x242e9ddd00000000, 0xb7b554a200000000, 0x02190e2200000000,
+ 0x9182c75d00000000, 0x339664b100000000, 0xa00dadce00000000,
+ 0x15a1f74e00000000, 0x863a3e3100000000, 0x3efe339500000000,
+ 0xad65faea00000000, 0x18c9a06a00000000, 0x8b52691500000000,
+ 0x1de6976800000000, 0x8e7d5e1700000000, 0x3bd1049700000000,
+ 0xa84acde800000000, 0x108ec04c00000000, 0x8315093300000000,
+ 0x36b953b300000000, 0xa5229acc00000000, 0x0736392000000000,
+ 0x94adf05f00000000, 0x2101aadf00000000, 0xb29a63a000000000,
+ 0x0a5e6e0400000000, 0x99c5a77b00000000, 0x2c69fdfb00000000,
+ 0xbff2348400000000, 0x138ae52800000000, 0x80112c5700000000,
+ 0x35bd76d700000000, 0xa626bfa800000000, 0x1ee2b20c00000000,
+ 0x8d797b7300000000, 0x38d521f300000000, 0xab4ee88c00000000,
+ 0x095a4b6000000000, 0x9ac1821f00000000, 0x2f6dd89f00000000,
+ 0xbcf611e000000000, 0x04321c4400000000, 0x97a9d53b00000000,
+ 0x22058fbb00000000, 0xb19e46c400000000, 0x272ab8b900000000,
+ 0xb4b171c600000000, 0x011d2b4600000000, 0x9286e23900000000,
+ 0x2a42ef9d00000000, 0xb9d926e200000000, 0x0c757c6200000000,
+ 0x9feeb51d00000000, 0x3dfa16f100000000, 0xae61df8e00000000,
+ 0x1bcd850e00000000, 0x88564c7100000000, 0x309241d500000000,
+ 0xa30988aa00000000, 0x16a5d22a00000000, 0x853e1b5500000000,
+ 0x3acc2fd100000000, 0xa957e6ae00000000, 0x1cfbbc2e00000000,
+ 0x8f60755100000000, 0x37a478f500000000, 0xa43fb18a00000000,
+ 0x1193eb0a00000000, 0x8208227500000000, 0x201c819900000000,
+ 0xb38748e600000000, 0x062b126600000000, 0x95b0db1900000000,
+ 0x2d74d6bd00000000, 0xbeef1fc200000000, 0x0b43454200000000,
+ 0x98d88c3d00000000, 0x0e6c724000000000, 0x9df7bb3f00000000,
+ 0x285be1bf00000000, 0xbbc028c000000000, 0x0304256400000000,
+ 0x909fec1b00000000, 0x2533b69b00000000, 0xb6a87fe400000000,
+ 0x14bcdc0800000000, 0x8727157700000000, 0x328b4ff700000000,
+ 0xa110868800000000, 0x19d48b2c00000000, 0x8a4f425300000000,
+ 0x3fe318d300000000, 0xac78d1ac00000000, 0x2614cb5100000000,
+ 0xb58f022e00000000, 0x002358ae00000000, 0x93b891d100000000,
+ 0x2b7c9c7500000000, 0xb8e7550a00000000, 0x0d4b0f8a00000000,
+ 0x9ed0c6f500000000, 0x3cc4651900000000, 0xaf5fac6600000000,
+ 0x1af3f6e600000000, 0x89683f9900000000, 0x31ac323d00000000,
+ 0xa237fb4200000000, 0x179ba1c200000000, 0x840068bd00000000,
+ 0x12b496c000000000, 0x812f5fbf00000000, 0x3483053f00000000,
+ 0xa718cc4000000000, 0x1fdcc1e400000000, 0x8c47089b00000000,
+ 0x39eb521b00000000, 0xaa709b6400000000, 0x0864388800000000,
+ 0x9bfff1f700000000, 0x2e53ab7700000000, 0xbdc8620800000000,
+ 0x050c6fac00000000, 0x9697a6d300000000, 0x233bfc5300000000,
+ 0xb0a0352c00000000, 0x0f5201a800000000, 0x9cc9c8d700000000,
+ 0x2965925700000000, 0xbafe5b2800000000, 0x023a568c00000000,
+ 0x91a19ff300000000, 0x240dc57300000000, 0xb7960c0c00000000,
+ 0x1582afe000000000, 0x8619669f00000000, 0x33b53c1f00000000,
+ 0xa02ef56000000000, 0x18eaf8c400000000, 0x8b7131bb00000000,
+ 0x3edd6b3b00000000, 0xad46a24400000000, 0x3bf25c3900000000,
+ 0xa869954600000000, 0x1dc5cfc600000000, 0x8e5e06b900000000,
+ 0x369a0b1d00000000, 0xa501c26200000000, 0x10ad98e200000000,
+ 0x8336519d00000000, 0x2122f27100000000, 0xb2b93b0e00000000,
+ 0x0715618e00000000, 0x948ea8f100000000, 0x2c4aa55500000000,
+ 0xbfd16c2a00000000, 0x0a7d36aa00000000, 0x99e6ffd500000000,
+ 0x359e2e7900000000, 0xa605e70600000000, 0x13a9bd8600000000,
+ 0x803274f900000000, 0x38f6795d00000000, 0xab6db02200000000,
+ 0x1ec1eaa200000000, 0x8d5a23dd00000000, 0x2f4e803100000000,
+ 0xbcd5494e00000000, 0x097913ce00000000, 0x9ae2dab100000000,
+ 0x2226d71500000000, 0xb1bd1e6a00000000, 0x041144ea00000000,
+ 0x978a8d9500000000, 0x013e73e800000000, 0x92a5ba9700000000,
+ 0x2709e01700000000, 0xb492296800000000, 0x0c5624cc00000000,
+ 0x9fcdedb300000000, 0x2a61b73300000000, 0xb9fa7e4c00000000,
+ 0x1beedda000000000, 0x887514df00000000, 0x3dd94e5f00000000,
+ 0xae42872000000000, 0x16868a8400000000, 0x851d43fb00000000,
+ 0x30b1197b00000000, 0xa32ad00400000000, 0x1cd8e48000000000,
+ 0x8f432dff00000000, 0x3aef777f00000000, 0xa974be0000000000,
+ 0x11b0b3a400000000, 0x822b7adb00000000, 0x3787205b00000000,
+ 0xa41ce92400000000, 0x06084ac800000000, 0x959383b700000000,
+ 0x203fd93700000000, 0xb3a4104800000000, 0x0b601dec00000000,
+ 0x98fbd49300000000, 0x2d578e1300000000, 0xbecc476c00000000,
+ 0x2878b91100000000, 0xbbe3706e00000000, 0x0e4f2aee00000000,
+ 0x9dd4e39100000000, 0x2510ee3500000000, 0xb68b274a00000000,
+ 0x03277dca00000000, 0x90bcb4b500000000, 0x32a8175900000000,
+ 0xa133de2600000000, 0x149f84a600000000, 0x87044dd900000000,
+ 0x3fc0407d00000000, 0xac5b890200000000, 0x19f7d38200000000,
+ 0x8a6c1afd00000000},
+ {0x0000000000000000, 0x650b796900000000, 0xca16f2d200000000,
+ 0xaf1d8bbb00000000, 0xd52b957e00000000, 0xb020ec1700000000,
+ 0x1f3d67ac00000000, 0x7a361ec500000000, 0xaa572afd00000000,
+ 0xcf5c539400000000, 0x6041d82f00000000, 0x054aa14600000000,
+ 0x7f7cbf8300000000, 0x1a77c6ea00000000, 0xb56a4d5100000000,
+ 0xd061343800000000, 0x15a9252100000000, 0x70a25c4800000000,
+ 0xdfbfd7f300000000, 0xbab4ae9a00000000, 0xc082b05f00000000,
+ 0xa589c93600000000, 0x0a94428d00000000, 0x6f9f3be400000000,
+ 0xbffe0fdc00000000, 0xdaf576b500000000, 0x75e8fd0e00000000,
+ 0x10e3846700000000, 0x6ad59aa200000000, 0x0fdee3cb00000000,
+ 0xa0c3687000000000, 0xc5c8111900000000, 0x2a524b4200000000,
+ 0x4f59322b00000000, 0xe044b99000000000, 0x854fc0f900000000,
+ 0xff79de3c00000000, 0x9a72a75500000000, 0x356f2cee00000000,
+ 0x5064558700000000, 0x800561bf00000000, 0xe50e18d600000000,
+ 0x4a13936d00000000, 0x2f18ea0400000000, 0x552ef4c100000000,
+ 0x30258da800000000, 0x9f38061300000000, 0xfa337f7a00000000,
+ 0x3ffb6e6300000000, 0x5af0170a00000000, 0xf5ed9cb100000000,
+ 0x90e6e5d800000000, 0xead0fb1d00000000, 0x8fdb827400000000,
+ 0x20c609cf00000000, 0x45cd70a600000000, 0x95ac449e00000000,
+ 0xf0a73df700000000, 0x5fbab64c00000000, 0x3ab1cf2500000000,
+ 0x4087d1e000000000, 0x258ca88900000000, 0x8a91233200000000,
+ 0xef9a5a5b00000000, 0x54a4968400000000, 0x31afefed00000000,
+ 0x9eb2645600000000, 0xfbb91d3f00000000, 0x818f03fa00000000,
+ 0xe4847a9300000000, 0x4b99f12800000000, 0x2e92884100000000,
+ 0xfef3bc7900000000, 0x9bf8c51000000000, 0x34e54eab00000000,
+ 0x51ee37c200000000, 0x2bd8290700000000, 0x4ed3506e00000000,
+ 0xe1cedbd500000000, 0x84c5a2bc00000000, 0x410db3a500000000,
+ 0x2406cacc00000000, 0x8b1b417700000000, 0xee10381e00000000,
+ 0x942626db00000000, 0xf12d5fb200000000, 0x5e30d40900000000,
+ 0x3b3bad6000000000, 0xeb5a995800000000, 0x8e51e03100000000,
+ 0x214c6b8a00000000, 0x444712e300000000, 0x3e710c2600000000,
+ 0x5b7a754f00000000, 0xf467fef400000000, 0x916c879d00000000,
+ 0x7ef6ddc600000000, 0x1bfda4af00000000, 0xb4e02f1400000000,
+ 0xd1eb567d00000000, 0xabdd48b800000000, 0xced631d100000000,
+ 0x61cbba6a00000000, 0x04c0c30300000000, 0xd4a1f73b00000000,
+ 0xb1aa8e5200000000, 0x1eb705e900000000, 0x7bbc7c8000000000,
+ 0x018a624500000000, 0x64811b2c00000000, 0xcb9c909700000000,
+ 0xae97e9fe00000000, 0x6b5ff8e700000000, 0x0e54818e00000000,
+ 0xa1490a3500000000, 0xc442735c00000000, 0xbe746d9900000000,
+ 0xdb7f14f000000000, 0x74629f4b00000000, 0x1169e62200000000,
+ 0xc108d21a00000000, 0xa403ab7300000000, 0x0b1e20c800000000,
+ 0x6e1559a100000000, 0x1423476400000000, 0x71283e0d00000000,
+ 0xde35b5b600000000, 0xbb3eccdf00000000, 0xe94e5cd200000000,
+ 0x8c4525bb00000000, 0x2358ae0000000000, 0x4653d76900000000,
+ 0x3c65c9ac00000000, 0x596eb0c500000000, 0xf6733b7e00000000,
+ 0x9378421700000000, 0x4319762f00000000, 0x26120f4600000000,
+ 0x890f84fd00000000, 0xec04fd9400000000, 0x9632e35100000000,
+ 0xf3399a3800000000, 0x5c24118300000000, 0x392f68ea00000000,
+ 0xfce779f300000000, 0x99ec009a00000000, 0x36f18b2100000000,
+ 0x53faf24800000000, 0x29ccec8d00000000, 0x4cc795e400000000,
+ 0xe3da1e5f00000000, 0x86d1673600000000, 0x56b0530e00000000,
+ 0x33bb2a6700000000, 0x9ca6a1dc00000000, 0xf9add8b500000000,
+ 0x839bc67000000000, 0xe690bf1900000000, 0x498d34a200000000,
+ 0x2c864dcb00000000, 0xc31c179000000000, 0xa6176ef900000000,
+ 0x090ae54200000000, 0x6c019c2b00000000, 0x163782ee00000000,
+ 0x733cfb8700000000, 0xdc21703c00000000, 0xb92a095500000000,
+ 0x694b3d6d00000000, 0x0c40440400000000, 0xa35dcfbf00000000,
+ 0xc656b6d600000000, 0xbc60a81300000000, 0xd96bd17a00000000,
+ 0x76765ac100000000, 0x137d23a800000000, 0xd6b532b100000000,
+ 0xb3be4bd800000000, 0x1ca3c06300000000, 0x79a8b90a00000000,
+ 0x039ea7cf00000000, 0x6695dea600000000, 0xc988551d00000000,
+ 0xac832c7400000000, 0x7ce2184c00000000, 0x19e9612500000000,
+ 0xb6f4ea9e00000000, 0xd3ff93f700000000, 0xa9c98d3200000000,
+ 0xccc2f45b00000000, 0x63df7fe000000000, 0x06d4068900000000,
+ 0xbdeaca5600000000, 0xd8e1b33f00000000, 0x77fc388400000000,
+ 0x12f741ed00000000, 0x68c15f2800000000, 0x0dca264100000000,
+ 0xa2d7adfa00000000, 0xc7dcd49300000000, 0x17bde0ab00000000,
+ 0x72b699c200000000, 0xddab127900000000, 0xb8a06b1000000000,
+ 0xc29675d500000000, 0xa79d0cbc00000000, 0x0880870700000000,
+ 0x6d8bfe6e00000000, 0xa843ef7700000000, 0xcd48961e00000000,
+ 0x62551da500000000, 0x075e64cc00000000, 0x7d687a0900000000,
+ 0x1863036000000000, 0xb77e88db00000000, 0xd275f1b200000000,
+ 0x0214c58a00000000, 0x671fbce300000000, 0xc802375800000000,
+ 0xad094e3100000000, 0xd73f50f400000000, 0xb234299d00000000,
+ 0x1d29a22600000000, 0x7822db4f00000000, 0x97b8811400000000,
+ 0xf2b3f87d00000000, 0x5dae73c600000000, 0x38a50aaf00000000,
+ 0x4293146a00000000, 0x27986d0300000000, 0x8885e6b800000000,
+ 0xed8e9fd100000000, 0x3defabe900000000, 0x58e4d28000000000,
+ 0xf7f9593b00000000, 0x92f2205200000000, 0xe8c43e9700000000,
+ 0x8dcf47fe00000000, 0x22d2cc4500000000, 0x47d9b52c00000000,
+ 0x8211a43500000000, 0xe71add5c00000000, 0x480756e700000000,
+ 0x2d0c2f8e00000000, 0x573a314b00000000, 0x3231482200000000,
+ 0x9d2cc39900000000, 0xf827baf000000000, 0x28468ec800000000,
+ 0x4d4df7a100000000, 0xe2507c1a00000000, 0x875b057300000000,
+ 0xfd6d1bb600000000, 0x986662df00000000, 0x377be96400000000,
+ 0x5270900d00000000},
+ {0x0000000000000000, 0xdcecb13d00000000, 0xb8d9637b00000000,
+ 0x6435d24600000000, 0x70b3c7f600000000, 0xac5f76cb00000000,
+ 0xc86aa48d00000000, 0x148615b000000000, 0xa160fe3600000000,
+ 0x7d8c4f0b00000000, 0x19b99d4d00000000, 0xc5552c7000000000,
+ 0xd1d339c000000000, 0x0d3f88fd00000000, 0x690a5abb00000000,
+ 0xb5e6eb8600000000, 0x42c1fc6d00000000, 0x9e2d4d5000000000,
+ 0xfa189f1600000000, 0x26f42e2b00000000, 0x32723b9b00000000,
+ 0xee9e8aa600000000, 0x8aab58e000000000, 0x5647e9dd00000000,
+ 0xe3a1025b00000000, 0x3f4db36600000000, 0x5b78612000000000,
+ 0x8794d01d00000000, 0x9312c5ad00000000, 0x4ffe749000000000,
+ 0x2bcba6d600000000, 0xf72717eb00000000, 0x8482f9db00000000,
+ 0x586e48e600000000, 0x3c5b9aa000000000, 0xe0b72b9d00000000,
+ 0xf4313e2d00000000, 0x28dd8f1000000000, 0x4ce85d5600000000,
+ 0x9004ec6b00000000, 0x25e207ed00000000, 0xf90eb6d000000000,
+ 0x9d3b649600000000, 0x41d7d5ab00000000, 0x5551c01b00000000,
+ 0x89bd712600000000, 0xed88a36000000000, 0x3164125d00000000,
+ 0xc64305b600000000, 0x1aafb48b00000000, 0x7e9a66cd00000000,
+ 0xa276d7f000000000, 0xb6f0c24000000000, 0x6a1c737d00000000,
+ 0x0e29a13b00000000, 0xd2c5100600000000, 0x6723fb8000000000,
+ 0xbbcf4abd00000000, 0xdffa98fb00000000, 0x031629c600000000,
+ 0x17903c7600000000, 0xcb7c8d4b00000000, 0xaf495f0d00000000,
+ 0x73a5ee3000000000, 0x4903826c00000000, 0x95ef335100000000,
+ 0xf1dae11700000000, 0x2d36502a00000000, 0x39b0459a00000000,
+ 0xe55cf4a700000000, 0x816926e100000000, 0x5d8597dc00000000,
+ 0xe8637c5a00000000, 0x348fcd6700000000, 0x50ba1f2100000000,
+ 0x8c56ae1c00000000, 0x98d0bbac00000000, 0x443c0a9100000000,
+ 0x2009d8d700000000, 0xfce569ea00000000, 0x0bc27e0100000000,
+ 0xd72ecf3c00000000, 0xb31b1d7a00000000, 0x6ff7ac4700000000,
+ 0x7b71b9f700000000, 0xa79d08ca00000000, 0xc3a8da8c00000000,
+ 0x1f446bb100000000, 0xaaa2803700000000, 0x764e310a00000000,
+ 0x127be34c00000000, 0xce97527100000000, 0xda1147c100000000,
+ 0x06fdf6fc00000000, 0x62c824ba00000000, 0xbe24958700000000,
+ 0xcd817bb700000000, 0x116dca8a00000000, 0x755818cc00000000,
+ 0xa9b4a9f100000000, 0xbd32bc4100000000, 0x61de0d7c00000000,
+ 0x05ebdf3a00000000, 0xd9076e0700000000, 0x6ce1858100000000,
+ 0xb00d34bc00000000, 0xd438e6fa00000000, 0x08d457c700000000,
+ 0x1c52427700000000, 0xc0bef34a00000000, 0xa48b210c00000000,
+ 0x7867903100000000, 0x8f4087da00000000, 0x53ac36e700000000,
+ 0x3799e4a100000000, 0xeb75559c00000000, 0xfff3402c00000000,
+ 0x231ff11100000000, 0x472a235700000000, 0x9bc6926a00000000,
+ 0x2e2079ec00000000, 0xf2ccc8d100000000, 0x96f91a9700000000,
+ 0x4a15abaa00000000, 0x5e93be1a00000000, 0x827f0f2700000000,
+ 0xe64add6100000000, 0x3aa66c5c00000000, 0x920604d900000000,
+ 0x4eeab5e400000000, 0x2adf67a200000000, 0xf633d69f00000000,
+ 0xe2b5c32f00000000, 0x3e59721200000000, 0x5a6ca05400000000,
+ 0x8680116900000000, 0x3366faef00000000, 0xef8a4bd200000000,
+ 0x8bbf999400000000, 0x575328a900000000, 0x43d53d1900000000,
+ 0x9f398c2400000000, 0xfb0c5e6200000000, 0x27e0ef5f00000000,
+ 0xd0c7f8b400000000, 0x0c2b498900000000, 0x681e9bcf00000000,
+ 0xb4f22af200000000, 0xa0743f4200000000, 0x7c988e7f00000000,
+ 0x18ad5c3900000000, 0xc441ed0400000000, 0x71a7068200000000,
+ 0xad4bb7bf00000000, 0xc97e65f900000000, 0x1592d4c400000000,
+ 0x0114c17400000000, 0xddf8704900000000, 0xb9cda20f00000000,
+ 0x6521133200000000, 0x1684fd0200000000, 0xca684c3f00000000,
+ 0xae5d9e7900000000, 0x72b12f4400000000, 0x66373af400000000,
+ 0xbadb8bc900000000, 0xdeee598f00000000, 0x0202e8b200000000,
+ 0xb7e4033400000000, 0x6b08b20900000000, 0x0f3d604f00000000,
+ 0xd3d1d17200000000, 0xc757c4c200000000, 0x1bbb75ff00000000,
+ 0x7f8ea7b900000000, 0xa362168400000000, 0x5445016f00000000,
+ 0x88a9b05200000000, 0xec9c621400000000, 0x3070d32900000000,
+ 0x24f6c69900000000, 0xf81a77a400000000, 0x9c2fa5e200000000,
+ 0x40c314df00000000, 0xf525ff5900000000, 0x29c94e6400000000,
+ 0x4dfc9c2200000000, 0x91102d1f00000000, 0x859638af00000000,
+ 0x597a899200000000, 0x3d4f5bd400000000, 0xe1a3eae900000000,
+ 0xdb0586b500000000, 0x07e9378800000000, 0x63dce5ce00000000,
+ 0xbf3054f300000000, 0xabb6414300000000, 0x775af07e00000000,
+ 0x136f223800000000, 0xcf83930500000000, 0x7a65788300000000,
+ 0xa689c9be00000000, 0xc2bc1bf800000000, 0x1e50aac500000000,
+ 0x0ad6bf7500000000, 0xd63a0e4800000000, 0xb20fdc0e00000000,
+ 0x6ee36d3300000000, 0x99c47ad800000000, 0x4528cbe500000000,
+ 0x211d19a300000000, 0xfdf1a89e00000000, 0xe977bd2e00000000,
+ 0x359b0c1300000000, 0x51aede5500000000, 0x8d426f6800000000,
+ 0x38a484ee00000000, 0xe44835d300000000, 0x807de79500000000,
+ 0x5c9156a800000000, 0x4817431800000000, 0x94fbf22500000000,
+ 0xf0ce206300000000, 0x2c22915e00000000, 0x5f877f6e00000000,
+ 0x836bce5300000000, 0xe75e1c1500000000, 0x3bb2ad2800000000,
+ 0x2f34b89800000000, 0xf3d809a500000000, 0x97eddbe300000000,
+ 0x4b016ade00000000, 0xfee7815800000000, 0x220b306500000000,
+ 0x463ee22300000000, 0x9ad2531e00000000, 0x8e5446ae00000000,
+ 0x52b8f79300000000, 0x368d25d500000000, 0xea6194e800000000,
+ 0x1d46830300000000, 0xc1aa323e00000000, 0xa59fe07800000000,
+ 0x7973514500000000, 0x6df544f500000000, 0xb119f5c800000000,
+ 0xd52c278e00000000, 0x09c096b300000000, 0xbc267d3500000000,
+ 0x60cacc0800000000, 0x04ff1e4e00000000, 0xd813af7300000000,
+ 0xcc95bac300000000, 0x10790bfe00000000, 0x744cd9b800000000,
+ 0xa8a0688500000000}};
+
+#else /* W == 4 */
+
+local const z_crc_t FAR crc_braid_table[][256] = {
+ {0x00000000, 0x81256527, 0xd93bcc0f, 0x581ea928, 0x69069e5f,
+ 0xe823fb78, 0xb03d5250, 0x31183777, 0xd20d3cbe, 0x53285999,
+ 0x0b36f0b1, 0x8a139596, 0xbb0ba2e1, 0x3a2ec7c6, 0x62306eee,
+ 0xe3150bc9, 0x7f6b7f3d, 0xfe4e1a1a, 0xa650b332, 0x2775d615,
+ 0x166de162, 0x97488445, 0xcf562d6d, 0x4e73484a, 0xad664383,
+ 0x2c4326a4, 0x745d8f8c, 0xf578eaab, 0xc460dddc, 0x4545b8fb,
+ 0x1d5b11d3, 0x9c7e74f4, 0xfed6fe7a, 0x7ff39b5d, 0x27ed3275,
+ 0xa6c85752, 0x97d06025, 0x16f50502, 0x4eebac2a, 0xcfcec90d,
+ 0x2cdbc2c4, 0xadfea7e3, 0xf5e00ecb, 0x74c56bec, 0x45dd5c9b,
+ 0xc4f839bc, 0x9ce69094, 0x1dc3f5b3, 0x81bd8147, 0x0098e460,
+ 0x58864d48, 0xd9a3286f, 0xe8bb1f18, 0x699e7a3f, 0x3180d317,
+ 0xb0a5b630, 0x53b0bdf9, 0xd295d8de, 0x8a8b71f6, 0x0bae14d1,
+ 0x3ab623a6, 0xbb934681, 0xe38defa9, 0x62a88a8e, 0x26dcfab5,
+ 0xa7f99f92, 0xffe736ba, 0x7ec2539d, 0x4fda64ea, 0xceff01cd,
+ 0x96e1a8e5, 0x17c4cdc2, 0xf4d1c60b, 0x75f4a32c, 0x2dea0a04,
+ 0xaccf6f23, 0x9dd75854, 0x1cf23d73, 0x44ec945b, 0xc5c9f17c,
+ 0x59b78588, 0xd892e0af, 0x808c4987, 0x01a92ca0, 0x30b11bd7,
+ 0xb1947ef0, 0xe98ad7d8, 0x68afb2ff, 0x8bbab936, 0x0a9fdc11,
+ 0x52817539, 0xd3a4101e, 0xe2bc2769, 0x6399424e, 0x3b87eb66,
+ 0xbaa28e41, 0xd80a04cf, 0x592f61e8, 0x0131c8c0, 0x8014ade7,
+ 0xb10c9a90, 0x3029ffb7, 0x6837569f, 0xe91233b8, 0x0a073871,
+ 0x8b225d56, 0xd33cf47e, 0x52199159, 0x6301a62e, 0xe224c309,
+ 0xba3a6a21, 0x3b1f0f06, 0xa7617bf2, 0x26441ed5, 0x7e5ab7fd,
+ 0xff7fd2da, 0xce67e5ad, 0x4f42808a, 0x175c29a2, 0x96794c85,
+ 0x756c474c, 0xf449226b, 0xac578b43, 0x2d72ee64, 0x1c6ad913,
+ 0x9d4fbc34, 0xc551151c, 0x4474703b, 0x4db9f56a, 0xcc9c904d,
+ 0x94823965, 0x15a75c42, 0x24bf6b35, 0xa59a0e12, 0xfd84a73a,
+ 0x7ca1c21d, 0x9fb4c9d4, 0x1e91acf3, 0x468f05db, 0xc7aa60fc,
+ 0xf6b2578b, 0x779732ac, 0x2f899b84, 0xaeacfea3, 0x32d28a57,
+ 0xb3f7ef70, 0xebe94658, 0x6acc237f, 0x5bd41408, 0xdaf1712f,
+ 0x82efd807, 0x03cabd20, 0xe0dfb6e9, 0x61fad3ce, 0x39e47ae6,
+ 0xb8c11fc1, 0x89d928b6, 0x08fc4d91, 0x50e2e4b9, 0xd1c7819e,
+ 0xb36f0b10, 0x324a6e37, 0x6a54c71f, 0xeb71a238, 0xda69954f,
+ 0x5b4cf068, 0x03525940, 0x82773c67, 0x616237ae, 0xe0475289,
+ 0xb859fba1, 0x397c9e86, 0x0864a9f1, 0x8941ccd6, 0xd15f65fe,
+ 0x507a00d9, 0xcc04742d, 0x4d21110a, 0x153fb822, 0x941add05,
+ 0xa502ea72, 0x24278f55, 0x7c39267d, 0xfd1c435a, 0x1e094893,
+ 0x9f2c2db4, 0xc732849c, 0x4617e1bb, 0x770fd6cc, 0xf62ab3eb,
+ 0xae341ac3, 0x2f117fe4, 0x6b650fdf, 0xea406af8, 0xb25ec3d0,
+ 0x337ba6f7, 0x02639180, 0x8346f4a7, 0xdb585d8f, 0x5a7d38a8,
+ 0xb9683361, 0x384d5646, 0x6053ff6e, 0xe1769a49, 0xd06ead3e,
+ 0x514bc819, 0x09556131, 0x88700416, 0x140e70e2, 0x952b15c5,
+ 0xcd35bced, 0x4c10d9ca, 0x7d08eebd, 0xfc2d8b9a, 0xa43322b2,
+ 0x25164795, 0xc6034c5c, 0x4726297b, 0x1f388053, 0x9e1de574,
+ 0xaf05d203, 0x2e20b724, 0x763e1e0c, 0xf71b7b2b, 0x95b3f1a5,
+ 0x14969482, 0x4c883daa, 0xcdad588d, 0xfcb56ffa, 0x7d900add,
+ 0x258ea3f5, 0xa4abc6d2, 0x47becd1b, 0xc69ba83c, 0x9e850114,
+ 0x1fa06433, 0x2eb85344, 0xaf9d3663, 0xf7839f4b, 0x76a6fa6c,
+ 0xead88e98, 0x6bfdebbf, 0x33e34297, 0xb2c627b0, 0x83de10c7,
+ 0x02fb75e0, 0x5ae5dcc8, 0xdbc0b9ef, 0x38d5b226, 0xb9f0d701,
+ 0xe1ee7e29, 0x60cb1b0e, 0x51d32c79, 0xd0f6495e, 0x88e8e076,
+ 0x09cd8551},
+ {0x00000000, 0x9b73ead4, 0xed96d3e9, 0x76e5393d, 0x005ca193,
+ 0x9b2f4b47, 0xedca727a, 0x76b998ae, 0x00b94326, 0x9bcaa9f2,
+ 0xed2f90cf, 0x765c7a1b, 0x00e5e2b5, 0x9b960861, 0xed73315c,
+ 0x7600db88, 0x0172864c, 0x9a016c98, 0xece455a5, 0x7797bf71,
+ 0x012e27df, 0x9a5dcd0b, 0xecb8f436, 0x77cb1ee2, 0x01cbc56a,
+ 0x9ab82fbe, 0xec5d1683, 0x772efc57, 0x019764f9, 0x9ae48e2d,
+ 0xec01b710, 0x77725dc4, 0x02e50c98, 0x9996e64c, 0xef73df71,
+ 0x740035a5, 0x02b9ad0b, 0x99ca47df, 0xef2f7ee2, 0x745c9436,
+ 0x025c4fbe, 0x992fa56a, 0xefca9c57, 0x74b97683, 0x0200ee2d,
+ 0x997304f9, 0xef963dc4, 0x74e5d710, 0x03978ad4, 0x98e46000,
+ 0xee01593d, 0x7572b3e9, 0x03cb2b47, 0x98b8c193, 0xee5df8ae,
+ 0x752e127a, 0x032ec9f2, 0x985d2326, 0xeeb81a1b, 0x75cbf0cf,
+ 0x03726861, 0x980182b5, 0xeee4bb88, 0x7597515c, 0x05ca1930,
+ 0x9eb9f3e4, 0xe85ccad9, 0x732f200d, 0x0596b8a3, 0x9ee55277,
+ 0xe8006b4a, 0x7373819e, 0x05735a16, 0x9e00b0c2, 0xe8e589ff,
+ 0x7396632b, 0x052ffb85, 0x9e5c1151, 0xe8b9286c, 0x73cac2b8,
+ 0x04b89f7c, 0x9fcb75a8, 0xe92e4c95, 0x725da641, 0x04e43eef,
+ 0x9f97d43b, 0xe972ed06, 0x720107d2, 0x0401dc5a, 0x9f72368e,
+ 0xe9970fb3, 0x72e4e567, 0x045d7dc9, 0x9f2e971d, 0xe9cbae20,
+ 0x72b844f4, 0x072f15a8, 0x9c5cff7c, 0xeab9c641, 0x71ca2c95,
+ 0x0773b43b, 0x9c005eef, 0xeae567d2, 0x71968d06, 0x0796568e,
+ 0x9ce5bc5a, 0xea008567, 0x71736fb3, 0x07caf71d, 0x9cb91dc9,
+ 0xea5c24f4, 0x712fce20, 0x065d93e4, 0x9d2e7930, 0xebcb400d,
+ 0x70b8aad9, 0x06013277, 0x9d72d8a3, 0xeb97e19e, 0x70e40b4a,
+ 0x06e4d0c2, 0x9d973a16, 0xeb72032b, 0x7001e9ff, 0x06b87151,
+ 0x9dcb9b85, 0xeb2ea2b8, 0x705d486c, 0x0b943260, 0x90e7d8b4,
+ 0xe602e189, 0x7d710b5d, 0x0bc893f3, 0x90bb7927, 0xe65e401a,
+ 0x7d2daace, 0x0b2d7146, 0x905e9b92, 0xe6bba2af, 0x7dc8487b,
+ 0x0b71d0d5, 0x90023a01, 0xe6e7033c, 0x7d94e9e8, 0x0ae6b42c,
+ 0x91955ef8, 0xe77067c5, 0x7c038d11, 0x0aba15bf, 0x91c9ff6b,
+ 0xe72cc656, 0x7c5f2c82, 0x0a5ff70a, 0x912c1dde, 0xe7c924e3,
+ 0x7cbace37, 0x0a035699, 0x9170bc4d, 0xe7958570, 0x7ce66fa4,
+ 0x09713ef8, 0x9202d42c, 0xe4e7ed11, 0x7f9407c5, 0x092d9f6b,
+ 0x925e75bf, 0xe4bb4c82, 0x7fc8a656, 0x09c87dde, 0x92bb970a,
+ 0xe45eae37, 0x7f2d44e3, 0x0994dc4d, 0x92e73699, 0xe4020fa4,
+ 0x7f71e570, 0x0803b8b4, 0x93705260, 0xe5956b5d, 0x7ee68189,
+ 0x085f1927, 0x932cf3f3, 0xe5c9cace, 0x7eba201a, 0x08bafb92,
+ 0x93c91146, 0xe52c287b, 0x7e5fc2af, 0x08e65a01, 0x9395b0d5,
+ 0xe57089e8, 0x7e03633c, 0x0e5e2b50, 0x952dc184, 0xe3c8f8b9,
+ 0x78bb126d, 0x0e028ac3, 0x95716017, 0xe394592a, 0x78e7b3fe,
+ 0x0ee76876, 0x959482a2, 0xe371bb9f, 0x7802514b, 0x0ebbc9e5,
+ 0x95c82331, 0xe32d1a0c, 0x785ef0d8, 0x0f2cad1c, 0x945f47c8,
+ 0xe2ba7ef5, 0x79c99421, 0x0f700c8f, 0x9403e65b, 0xe2e6df66,
+ 0x799535b2, 0x0f95ee3a, 0x94e604ee, 0xe2033dd3, 0x7970d707,
+ 0x0fc94fa9, 0x94baa57d, 0xe25f9c40, 0x792c7694, 0x0cbb27c8,
+ 0x97c8cd1c, 0xe12df421, 0x7a5e1ef5, 0x0ce7865b, 0x97946c8f,
+ 0xe17155b2, 0x7a02bf66, 0x0c0264ee, 0x97718e3a, 0xe194b707,
+ 0x7ae75dd3, 0x0c5ec57d, 0x972d2fa9, 0xe1c81694, 0x7abbfc40,
+ 0x0dc9a184, 0x96ba4b50, 0xe05f726d, 0x7b2c98b9, 0x0d950017,
+ 0x96e6eac3, 0xe003d3fe, 0x7b70392a, 0x0d70e2a2, 0x96030876,
+ 0xe0e6314b, 0x7b95db9f, 0x0d2c4331, 0x965fa9e5, 0xe0ba90d8,
+ 0x7bc97a0c},
+ {0x00000000, 0x172864c0, 0x2e50c980, 0x3978ad40, 0x5ca19300,
+ 0x4b89f7c0, 0x72f15a80, 0x65d93e40, 0xb9432600, 0xae6b42c0,
+ 0x9713ef80, 0x803b8b40, 0xe5e2b500, 0xf2cad1c0, 0xcbb27c80,
+ 0xdc9a1840, 0xa9f74a41, 0xbedf2e81, 0x87a783c1, 0x908fe701,
+ 0xf556d941, 0xe27ebd81, 0xdb0610c1, 0xcc2e7401, 0x10b46c41,
+ 0x079c0881, 0x3ee4a5c1, 0x29ccc101, 0x4c15ff41, 0x5b3d9b81,
+ 0x624536c1, 0x756d5201, 0x889f92c3, 0x9fb7f603, 0xa6cf5b43,
+ 0xb1e73f83, 0xd43e01c3, 0xc3166503, 0xfa6ec843, 0xed46ac83,
+ 0x31dcb4c3, 0x26f4d003, 0x1f8c7d43, 0x08a41983, 0x6d7d27c3,
+ 0x7a554303, 0x432dee43, 0x54058a83, 0x2168d882, 0x3640bc42,
+ 0x0f381102, 0x181075c2, 0x7dc94b82, 0x6ae12f42, 0x53998202,
+ 0x44b1e6c2, 0x982bfe82, 0x8f039a42, 0xb67b3702, 0xa15353c2,
+ 0xc48a6d82, 0xd3a20942, 0xeadaa402, 0xfdf2c0c2, 0xca4e23c7,
+ 0xdd664707, 0xe41eea47, 0xf3368e87, 0x96efb0c7, 0x81c7d407,
+ 0xb8bf7947, 0xaf971d87, 0x730d05c7, 0x64256107, 0x5d5dcc47,
+ 0x4a75a887, 0x2fac96c7, 0x3884f207, 0x01fc5f47, 0x16d43b87,
+ 0x63b96986, 0x74910d46, 0x4de9a006, 0x5ac1c4c6, 0x3f18fa86,
+ 0x28309e46, 0x11483306, 0x066057c6, 0xdafa4f86, 0xcdd22b46,
+ 0xf4aa8606, 0xe382e2c6, 0x865bdc86, 0x9173b846, 0xa80b1506,
+ 0xbf2371c6, 0x42d1b104, 0x55f9d5c4, 0x6c817884, 0x7ba91c44,
+ 0x1e702204, 0x095846c4, 0x3020eb84, 0x27088f44, 0xfb929704,
+ 0xecbaf3c4, 0xd5c25e84, 0xc2ea3a44, 0xa7330404, 0xb01b60c4,
+ 0x8963cd84, 0x9e4ba944, 0xeb26fb45, 0xfc0e9f85, 0xc57632c5,
+ 0xd25e5605, 0xb7876845, 0xa0af0c85, 0x99d7a1c5, 0x8effc505,
+ 0x5265dd45, 0x454db985, 0x7c3514c5, 0x6b1d7005, 0x0ec44e45,
+ 0x19ec2a85, 0x209487c5, 0x37bce305, 0x4fed41cf, 0x58c5250f,
+ 0x61bd884f, 0x7695ec8f, 0x134cd2cf, 0x0464b60f, 0x3d1c1b4f,
+ 0x2a347f8f, 0xf6ae67cf, 0xe186030f, 0xd8feae4f, 0xcfd6ca8f,
+ 0xaa0ff4cf, 0xbd27900f, 0x845f3d4f, 0x9377598f, 0xe61a0b8e,
+ 0xf1326f4e, 0xc84ac20e, 0xdf62a6ce, 0xbabb988e, 0xad93fc4e,
+ 0x94eb510e, 0x83c335ce, 0x5f592d8e, 0x4871494e, 0x7109e40e,
+ 0x662180ce, 0x03f8be8e, 0x14d0da4e, 0x2da8770e, 0x3a8013ce,
+ 0xc772d30c, 0xd05ab7cc, 0xe9221a8c, 0xfe0a7e4c, 0x9bd3400c,
+ 0x8cfb24cc, 0xb583898c, 0xa2abed4c, 0x7e31f50c, 0x691991cc,
+ 0x50613c8c, 0x4749584c, 0x2290660c, 0x35b802cc, 0x0cc0af8c,
+ 0x1be8cb4c, 0x6e85994d, 0x79adfd8d, 0x40d550cd, 0x57fd340d,
+ 0x32240a4d, 0x250c6e8d, 0x1c74c3cd, 0x0b5ca70d, 0xd7c6bf4d,
+ 0xc0eedb8d, 0xf99676cd, 0xeebe120d, 0x8b672c4d, 0x9c4f488d,
+ 0xa537e5cd, 0xb21f810d, 0x85a36208, 0x928b06c8, 0xabf3ab88,
+ 0xbcdbcf48, 0xd902f108, 0xce2a95c8, 0xf7523888, 0xe07a5c48,
+ 0x3ce04408, 0x2bc820c8, 0x12b08d88, 0x0598e948, 0x6041d708,
+ 0x7769b3c8, 0x4e111e88, 0x59397a48, 0x2c542849, 0x3b7c4c89,
+ 0x0204e1c9, 0x152c8509, 0x70f5bb49, 0x67dddf89, 0x5ea572c9,
+ 0x498d1609, 0x95170e49, 0x823f6a89, 0xbb47c7c9, 0xac6fa309,
+ 0xc9b69d49, 0xde9ef989, 0xe7e654c9, 0xf0ce3009, 0x0d3cf0cb,
+ 0x1a14940b, 0x236c394b, 0x34445d8b, 0x519d63cb, 0x46b5070b,
+ 0x7fcdaa4b, 0x68e5ce8b, 0xb47fd6cb, 0xa357b20b, 0x9a2f1f4b,
+ 0x8d077b8b, 0xe8de45cb, 0xfff6210b, 0xc68e8c4b, 0xd1a6e88b,
+ 0xa4cbba8a, 0xb3e3de4a, 0x8a9b730a, 0x9db317ca, 0xf86a298a,
+ 0xef424d4a, 0xd63ae00a, 0xc11284ca, 0x1d889c8a, 0x0aa0f84a,
+ 0x33d8550a, 0x24f031ca, 0x41290f8a, 0x56016b4a, 0x6f79c60a,
+ 0x7851a2ca},
+ {0x00000000, 0x9fda839e, 0xe4c4017d, 0x7b1e82e3, 0x12f904bb,
+ 0x8d238725, 0xf63d05c6, 0x69e78658, 0x25f20976, 0xba288ae8,
+ 0xc136080b, 0x5eec8b95, 0x370b0dcd, 0xa8d18e53, 0xd3cf0cb0,
+ 0x4c158f2e, 0x4be412ec, 0xd43e9172, 0xaf201391, 0x30fa900f,
+ 0x591d1657, 0xc6c795c9, 0xbdd9172a, 0x220394b4, 0x6e161b9a,
+ 0xf1cc9804, 0x8ad21ae7, 0x15089979, 0x7cef1f21, 0xe3359cbf,
+ 0x982b1e5c, 0x07f19dc2, 0x97c825d8, 0x0812a646, 0x730c24a5,
+ 0xecd6a73b, 0x85312163, 0x1aeba2fd, 0x61f5201e, 0xfe2fa380,
+ 0xb23a2cae, 0x2de0af30, 0x56fe2dd3, 0xc924ae4d, 0xa0c32815,
+ 0x3f19ab8b, 0x44072968, 0xdbddaaf6, 0xdc2c3734, 0x43f6b4aa,
+ 0x38e83649, 0xa732b5d7, 0xced5338f, 0x510fb011, 0x2a1132f2,
+ 0xb5cbb16c, 0xf9de3e42, 0x6604bddc, 0x1d1a3f3f, 0x82c0bca1,
+ 0xeb273af9, 0x74fdb967, 0x0fe33b84, 0x9039b81a, 0xf4e14df1,
+ 0x6b3bce6f, 0x10254c8c, 0x8fffcf12, 0xe618494a, 0x79c2cad4,
+ 0x02dc4837, 0x9d06cba9, 0xd1134487, 0x4ec9c719, 0x35d745fa,
+ 0xaa0dc664, 0xc3ea403c, 0x5c30c3a2, 0x272e4141, 0xb8f4c2df,
+ 0xbf055f1d, 0x20dfdc83, 0x5bc15e60, 0xc41bddfe, 0xadfc5ba6,
+ 0x3226d838, 0x49385adb, 0xd6e2d945, 0x9af7566b, 0x052dd5f5,
+ 0x7e335716, 0xe1e9d488, 0x880e52d0, 0x17d4d14e, 0x6cca53ad,
+ 0xf310d033, 0x63296829, 0xfcf3ebb7, 0x87ed6954, 0x1837eaca,
+ 0x71d06c92, 0xee0aef0c, 0x95146def, 0x0aceee71, 0x46db615f,
+ 0xd901e2c1, 0xa21f6022, 0x3dc5e3bc, 0x542265e4, 0xcbf8e67a,
+ 0xb0e66499, 0x2f3ce707, 0x28cd7ac5, 0xb717f95b, 0xcc097bb8,
+ 0x53d3f826, 0x3a347e7e, 0xa5eefde0, 0xdef07f03, 0x412afc9d,
+ 0x0d3f73b3, 0x92e5f02d, 0xe9fb72ce, 0x7621f150, 0x1fc67708,
+ 0x801cf496, 0xfb027675, 0x64d8f5eb, 0x32b39da3, 0xad691e3d,
+ 0xd6779cde, 0x49ad1f40, 0x204a9918, 0xbf901a86, 0xc48e9865,
+ 0x5b541bfb, 0x174194d5, 0x889b174b, 0xf38595a8, 0x6c5f1636,
+ 0x05b8906e, 0x9a6213f0, 0xe17c9113, 0x7ea6128d, 0x79578f4f,
+ 0xe68d0cd1, 0x9d938e32, 0x02490dac, 0x6bae8bf4, 0xf474086a,
+ 0x8f6a8a89, 0x10b00917, 0x5ca58639, 0xc37f05a7, 0xb8618744,
+ 0x27bb04da, 0x4e5c8282, 0xd186011c, 0xaa9883ff, 0x35420061,
+ 0xa57bb87b, 0x3aa13be5, 0x41bfb906, 0xde653a98, 0xb782bcc0,
+ 0x28583f5e, 0x5346bdbd, 0xcc9c3e23, 0x8089b10d, 0x1f533293,
+ 0x644db070, 0xfb9733ee, 0x9270b5b6, 0x0daa3628, 0x76b4b4cb,
+ 0xe96e3755, 0xee9faa97, 0x71452909, 0x0a5babea, 0x95812874,
+ 0xfc66ae2c, 0x63bc2db2, 0x18a2af51, 0x87782ccf, 0xcb6da3e1,
+ 0x54b7207f, 0x2fa9a29c, 0xb0732102, 0xd994a75a, 0x464e24c4,
+ 0x3d50a627, 0xa28a25b9, 0xc652d052, 0x598853cc, 0x2296d12f,
+ 0xbd4c52b1, 0xd4abd4e9, 0x4b715777, 0x306fd594, 0xafb5560a,
+ 0xe3a0d924, 0x7c7a5aba, 0x0764d859, 0x98be5bc7, 0xf159dd9f,
+ 0x6e835e01, 0x159ddce2, 0x8a475f7c, 0x8db6c2be, 0x126c4120,
+ 0x6972c3c3, 0xf6a8405d, 0x9f4fc605, 0x0095459b, 0x7b8bc778,
+ 0xe45144e6, 0xa844cbc8, 0x379e4856, 0x4c80cab5, 0xd35a492b,
+ 0xbabdcf73, 0x25674ced, 0x5e79ce0e, 0xc1a34d90, 0x519af58a,
+ 0xce407614, 0xb55ef4f7, 0x2a847769, 0x4363f131, 0xdcb972af,
+ 0xa7a7f04c, 0x387d73d2, 0x7468fcfc, 0xebb27f62, 0x90acfd81,
+ 0x0f767e1f, 0x6691f847, 0xf94b7bd9, 0x8255f93a, 0x1d8f7aa4,
+ 0x1a7ee766, 0x85a464f8, 0xfebae61b, 0x61606585, 0x0887e3dd,
+ 0x975d6043, 0xec43e2a0, 0x7399613e, 0x3f8cee10, 0xa0566d8e,
+ 0xdb48ef6d, 0x44926cf3, 0x2d75eaab, 0xb2af6935, 0xc9b1ebd6,
+ 0x566b6848}};
+
+local const z_word_t FAR crc_braid_big_table[][256] = {
+ {0x00000000, 0x9e83da9f, 0x7d01c4e4, 0xe3821e7b, 0xbb04f912,
+ 0x2587238d, 0xc6053df6, 0x5886e769, 0x7609f225, 0xe88a28ba,
+ 0x0b0836c1, 0x958bec5e, 0xcd0d0b37, 0x538ed1a8, 0xb00ccfd3,
+ 0x2e8f154c, 0xec12e44b, 0x72913ed4, 0x911320af, 0x0f90fa30,
+ 0x57161d59, 0xc995c7c6, 0x2a17d9bd, 0xb4940322, 0x9a1b166e,
+ 0x0498ccf1, 0xe71ad28a, 0x79990815, 0x211fef7c, 0xbf9c35e3,
+ 0x5c1e2b98, 0xc29df107, 0xd825c897, 0x46a61208, 0xa5240c73,
+ 0x3ba7d6ec, 0x63213185, 0xfda2eb1a, 0x1e20f561, 0x80a32ffe,
+ 0xae2c3ab2, 0x30afe02d, 0xd32dfe56, 0x4dae24c9, 0x1528c3a0,
+ 0x8bab193f, 0x68290744, 0xf6aadddb, 0x34372cdc, 0xaab4f643,
+ 0x4936e838, 0xd7b532a7, 0x8f33d5ce, 0x11b00f51, 0xf232112a,
+ 0x6cb1cbb5, 0x423edef9, 0xdcbd0466, 0x3f3f1a1d, 0xa1bcc082,
+ 0xf93a27eb, 0x67b9fd74, 0x843be30f, 0x1ab83990, 0xf14de1f4,
+ 0x6fce3b6b, 0x8c4c2510, 0x12cfff8f, 0x4a4918e6, 0xd4cac279,
+ 0x3748dc02, 0xa9cb069d, 0x874413d1, 0x19c7c94e, 0xfa45d735,
+ 0x64c60daa, 0x3c40eac3, 0xa2c3305c, 0x41412e27, 0xdfc2f4b8,
+ 0x1d5f05bf, 0x83dcdf20, 0x605ec15b, 0xfedd1bc4, 0xa65bfcad,
+ 0x38d82632, 0xdb5a3849, 0x45d9e2d6, 0x6b56f79a, 0xf5d52d05,
+ 0x1657337e, 0x88d4e9e1, 0xd0520e88, 0x4ed1d417, 0xad53ca6c,
+ 0x33d010f3, 0x29682963, 0xb7ebf3fc, 0x5469ed87, 0xcaea3718,
+ 0x926cd071, 0x0cef0aee, 0xef6d1495, 0x71eece0a, 0x5f61db46,
+ 0xc1e201d9, 0x22601fa2, 0xbce3c53d, 0xe4652254, 0x7ae6f8cb,
+ 0x9964e6b0, 0x07e73c2f, 0xc57acd28, 0x5bf917b7, 0xb87b09cc,
+ 0x26f8d353, 0x7e7e343a, 0xe0fdeea5, 0x037ff0de, 0x9dfc2a41,
+ 0xb3733f0d, 0x2df0e592, 0xce72fbe9, 0x50f12176, 0x0877c61f,
+ 0x96f41c80, 0x757602fb, 0xebf5d864, 0xa39db332, 0x3d1e69ad,
+ 0xde9c77d6, 0x401fad49, 0x18994a20, 0x861a90bf, 0x65988ec4,
+ 0xfb1b545b, 0xd5944117, 0x4b179b88, 0xa89585f3, 0x36165f6c,
+ 0x6e90b805, 0xf013629a, 0x13917ce1, 0x8d12a67e, 0x4f8f5779,
+ 0xd10c8de6, 0x328e939d, 0xac0d4902, 0xf48bae6b, 0x6a0874f4,
+ 0x898a6a8f, 0x1709b010, 0x3986a55c, 0xa7057fc3, 0x448761b8,
+ 0xda04bb27, 0x82825c4e, 0x1c0186d1, 0xff8398aa, 0x61004235,
+ 0x7bb87ba5, 0xe53ba13a, 0x06b9bf41, 0x983a65de, 0xc0bc82b7,
+ 0x5e3f5828, 0xbdbd4653, 0x233e9ccc, 0x0db18980, 0x9332531f,
+ 0x70b04d64, 0xee3397fb, 0xb6b57092, 0x2836aa0d, 0xcbb4b476,
+ 0x55376ee9, 0x97aa9fee, 0x09294571, 0xeaab5b0a, 0x74288195,
+ 0x2cae66fc, 0xb22dbc63, 0x51afa218, 0xcf2c7887, 0xe1a36dcb,
+ 0x7f20b754, 0x9ca2a92f, 0x022173b0, 0x5aa794d9, 0xc4244e46,
+ 0x27a6503d, 0xb9258aa2, 0x52d052c6, 0xcc538859, 0x2fd19622,
+ 0xb1524cbd, 0xe9d4abd4, 0x7757714b, 0x94d56f30, 0x0a56b5af,
+ 0x24d9a0e3, 0xba5a7a7c, 0x59d86407, 0xc75bbe98, 0x9fdd59f1,
+ 0x015e836e, 0xe2dc9d15, 0x7c5f478a, 0xbec2b68d, 0x20416c12,
+ 0xc3c37269, 0x5d40a8f6, 0x05c64f9f, 0x9b459500, 0x78c78b7b,
+ 0xe64451e4, 0xc8cb44a8, 0x56489e37, 0xb5ca804c, 0x2b495ad3,
+ 0x73cfbdba, 0xed4c6725, 0x0ece795e, 0x904da3c1, 0x8af59a51,
+ 0x147640ce, 0xf7f45eb5, 0x6977842a, 0x31f16343, 0xaf72b9dc,
+ 0x4cf0a7a7, 0xd2737d38, 0xfcfc6874, 0x627fb2eb, 0x81fdac90,
+ 0x1f7e760f, 0x47f89166, 0xd97b4bf9, 0x3af95582, 0xa47a8f1d,
+ 0x66e77e1a, 0xf864a485, 0x1be6bafe, 0x85656061, 0xdde38708,
+ 0x43605d97, 0xa0e243ec, 0x3e619973, 0x10ee8c3f, 0x8e6d56a0,
+ 0x6def48db, 0xf36c9244, 0xabea752d, 0x3569afb2, 0xd6ebb1c9,
+ 0x48686b56},
+ {0x00000000, 0xc0642817, 0x80c9502e, 0x40ad7839, 0x0093a15c,
+ 0xc0f7894b, 0x805af172, 0x403ed965, 0x002643b9, 0xc0426bae,
+ 0x80ef1397, 0x408b3b80, 0x00b5e2e5, 0xc0d1caf2, 0x807cb2cb,
+ 0x40189adc, 0x414af7a9, 0x812edfbe, 0xc183a787, 0x01e78f90,
+ 0x41d956f5, 0x81bd7ee2, 0xc11006db, 0x01742ecc, 0x416cb410,
+ 0x81089c07, 0xc1a5e43e, 0x01c1cc29, 0x41ff154c, 0x819b3d5b,
+ 0xc1364562, 0x01526d75, 0xc3929f88, 0x03f6b79f, 0x435bcfa6,
+ 0x833fe7b1, 0xc3013ed4, 0x036516c3, 0x43c86efa, 0x83ac46ed,
+ 0xc3b4dc31, 0x03d0f426, 0x437d8c1f, 0x8319a408, 0xc3277d6d,
+ 0x0343557a, 0x43ee2d43, 0x838a0554, 0x82d86821, 0x42bc4036,
+ 0x0211380f, 0xc2751018, 0x824bc97d, 0x422fe16a, 0x02829953,
+ 0xc2e6b144, 0x82fe2b98, 0x429a038f, 0x02377bb6, 0xc25353a1,
+ 0x826d8ac4, 0x4209a2d3, 0x02a4daea, 0xc2c0f2fd, 0xc7234eca,
+ 0x074766dd, 0x47ea1ee4, 0x878e36f3, 0xc7b0ef96, 0x07d4c781,
+ 0x4779bfb8, 0x871d97af, 0xc7050d73, 0x07612564, 0x47cc5d5d,
+ 0x87a8754a, 0xc796ac2f, 0x07f28438, 0x475ffc01, 0x873bd416,
+ 0x8669b963, 0x460d9174, 0x06a0e94d, 0xc6c4c15a, 0x86fa183f,
+ 0x469e3028, 0x06334811, 0xc6576006, 0x864ffada, 0x462bd2cd,
+ 0x0686aaf4, 0xc6e282e3, 0x86dc5b86, 0x46b87391, 0x06150ba8,
+ 0xc67123bf, 0x04b1d142, 0xc4d5f955, 0x8478816c, 0x441ca97b,
+ 0x0422701e, 0xc4465809, 0x84eb2030, 0x448f0827, 0x049792fb,
+ 0xc4f3baec, 0x845ec2d5, 0x443aeac2, 0x040433a7, 0xc4601bb0,
+ 0x84cd6389, 0x44a94b9e, 0x45fb26eb, 0x859f0efc, 0xc53276c5,
+ 0x05565ed2, 0x456887b7, 0x850cafa0, 0xc5a1d799, 0x05c5ff8e,
+ 0x45dd6552, 0x85b94d45, 0xc514357c, 0x05701d6b, 0x454ec40e,
+ 0x852aec19, 0xc5879420, 0x05e3bc37, 0xcf41ed4f, 0x0f25c558,
+ 0x4f88bd61, 0x8fec9576, 0xcfd24c13, 0x0fb66404, 0x4f1b1c3d,
+ 0x8f7f342a, 0xcf67aef6, 0x0f0386e1, 0x4faefed8, 0x8fcad6cf,
+ 0xcff40faa, 0x0f9027bd, 0x4f3d5f84, 0x8f597793, 0x8e0b1ae6,
+ 0x4e6f32f1, 0x0ec24ac8, 0xcea662df, 0x8e98bbba, 0x4efc93ad,
+ 0x0e51eb94, 0xce35c383, 0x8e2d595f, 0x4e497148, 0x0ee40971,
+ 0xce802166, 0x8ebef803, 0x4edad014, 0x0e77a82d, 0xce13803a,
+ 0x0cd372c7, 0xccb75ad0, 0x8c1a22e9, 0x4c7e0afe, 0x0c40d39b,
+ 0xcc24fb8c, 0x8c8983b5, 0x4cedaba2, 0x0cf5317e, 0xcc911969,
+ 0x8c3c6150, 0x4c584947, 0x0c669022, 0xcc02b835, 0x8cafc00c,
+ 0x4ccbe81b, 0x4d99856e, 0x8dfdad79, 0xcd50d540, 0x0d34fd57,
+ 0x4d0a2432, 0x8d6e0c25, 0xcdc3741c, 0x0da75c0b, 0x4dbfc6d7,
+ 0x8ddbeec0, 0xcd7696f9, 0x0d12beee, 0x4d2c678b, 0x8d484f9c,
+ 0xcde537a5, 0x0d811fb2, 0x0862a385, 0xc8068b92, 0x88abf3ab,
+ 0x48cfdbbc, 0x08f102d9, 0xc8952ace, 0x883852f7, 0x485c7ae0,
+ 0x0844e03c, 0xc820c82b, 0x888db012, 0x48e99805, 0x08d74160,
+ 0xc8b36977, 0x881e114e, 0x487a3959, 0x4928542c, 0x894c7c3b,
+ 0xc9e10402, 0x09852c15, 0x49bbf570, 0x89dfdd67, 0xc972a55e,
+ 0x09168d49, 0x490e1795, 0x896a3f82, 0xc9c747bb, 0x09a36fac,
+ 0x499db6c9, 0x89f99ede, 0xc954e6e7, 0x0930cef0, 0xcbf03c0d,
+ 0x0b94141a, 0x4b396c23, 0x8b5d4434, 0xcb639d51, 0x0b07b546,
+ 0x4baacd7f, 0x8bcee568, 0xcbd67fb4, 0x0bb257a3, 0x4b1f2f9a,
+ 0x8b7b078d, 0xcb45dee8, 0x0b21f6ff, 0x4b8c8ec6, 0x8be8a6d1,
+ 0x8abacba4, 0x4adee3b3, 0x0a739b8a, 0xca17b39d, 0x8a296af8,
+ 0x4a4d42ef, 0x0ae03ad6, 0xca8412c1, 0x8a9c881d, 0x4af8a00a,
+ 0x0a55d833, 0xca31f024, 0x8a0f2941, 0x4a6b0156, 0x0ac6796f,
+ 0xcaa25178},
+ {0x00000000, 0xd4ea739b, 0xe9d396ed, 0x3d39e576, 0x93a15c00,
+ 0x474b2f9b, 0x7a72caed, 0xae98b976, 0x2643b900, 0xf2a9ca9b,
+ 0xcf902fed, 0x1b7a5c76, 0xb5e2e500, 0x6108969b, 0x5c3173ed,
+ 0x88db0076, 0x4c867201, 0x986c019a, 0xa555e4ec, 0x71bf9777,
+ 0xdf272e01, 0x0bcd5d9a, 0x36f4b8ec, 0xe21ecb77, 0x6ac5cb01,
+ 0xbe2fb89a, 0x83165dec, 0x57fc2e77, 0xf9649701, 0x2d8ee49a,
+ 0x10b701ec, 0xc45d7277, 0x980ce502, 0x4ce69699, 0x71df73ef,
+ 0xa5350074, 0x0badb902, 0xdf47ca99, 0xe27e2fef, 0x36945c74,
+ 0xbe4f5c02, 0x6aa52f99, 0x579ccaef, 0x8376b974, 0x2dee0002,
+ 0xf9047399, 0xc43d96ef, 0x10d7e574, 0xd48a9703, 0x0060e498,
+ 0x3d5901ee, 0xe9b37275, 0x472bcb03, 0x93c1b898, 0xaef85dee,
+ 0x7a122e75, 0xf2c92e03, 0x26235d98, 0x1b1ab8ee, 0xcff0cb75,
+ 0x61687203, 0xb5820198, 0x88bbe4ee, 0x5c519775, 0x3019ca05,
+ 0xe4f3b99e, 0xd9ca5ce8, 0x0d202f73, 0xa3b89605, 0x7752e59e,
+ 0x4a6b00e8, 0x9e817373, 0x165a7305, 0xc2b0009e, 0xff89e5e8,
+ 0x2b639673, 0x85fb2f05, 0x51115c9e, 0x6c28b9e8, 0xb8c2ca73,
+ 0x7c9fb804, 0xa875cb9f, 0x954c2ee9, 0x41a65d72, 0xef3ee404,
+ 0x3bd4979f, 0x06ed72e9, 0xd2070172, 0x5adc0104, 0x8e36729f,
+ 0xb30f97e9, 0x67e5e472, 0xc97d5d04, 0x1d972e9f, 0x20aecbe9,
+ 0xf444b872, 0xa8152f07, 0x7cff5c9c, 0x41c6b9ea, 0x952cca71,
+ 0x3bb47307, 0xef5e009c, 0xd267e5ea, 0x068d9671, 0x8e569607,
+ 0x5abce59c, 0x678500ea, 0xb36f7371, 0x1df7ca07, 0xc91db99c,
+ 0xf4245cea, 0x20ce2f71, 0xe4935d06, 0x30792e9d, 0x0d40cbeb,
+ 0xd9aab870, 0x77320106, 0xa3d8729d, 0x9ee197eb, 0x4a0be470,
+ 0xc2d0e406, 0x163a979d, 0x2b0372eb, 0xffe90170, 0x5171b806,
+ 0x859bcb9d, 0xb8a22eeb, 0x6c485d70, 0x6032940b, 0xb4d8e790,
+ 0x89e102e6, 0x5d0b717d, 0xf393c80b, 0x2779bb90, 0x1a405ee6,
+ 0xceaa2d7d, 0x46712d0b, 0x929b5e90, 0xafa2bbe6, 0x7b48c87d,
+ 0xd5d0710b, 0x013a0290, 0x3c03e7e6, 0xe8e9947d, 0x2cb4e60a,
+ 0xf85e9591, 0xc56770e7, 0x118d037c, 0xbf15ba0a, 0x6bffc991,
+ 0x56c62ce7, 0x822c5f7c, 0x0af75f0a, 0xde1d2c91, 0xe324c9e7,
+ 0x37ceba7c, 0x9956030a, 0x4dbc7091, 0x708595e7, 0xa46fe67c,
+ 0xf83e7109, 0x2cd40292, 0x11ede7e4, 0xc507947f, 0x6b9f2d09,
+ 0xbf755e92, 0x824cbbe4, 0x56a6c87f, 0xde7dc809, 0x0a97bb92,
+ 0x37ae5ee4, 0xe3442d7f, 0x4ddc9409, 0x9936e792, 0xa40f02e4,
+ 0x70e5717f, 0xb4b80308, 0x60527093, 0x5d6b95e5, 0x8981e67e,
+ 0x27195f08, 0xf3f32c93, 0xcecac9e5, 0x1a20ba7e, 0x92fbba08,
+ 0x4611c993, 0x7b282ce5, 0xafc25f7e, 0x015ae608, 0xd5b09593,
+ 0xe88970e5, 0x3c63037e, 0x502b5e0e, 0x84c12d95, 0xb9f8c8e3,
+ 0x6d12bb78, 0xc38a020e, 0x17607195, 0x2a5994e3, 0xfeb3e778,
+ 0x7668e70e, 0xa2829495, 0x9fbb71e3, 0x4b510278, 0xe5c9bb0e,
+ 0x3123c895, 0x0c1a2de3, 0xd8f05e78, 0x1cad2c0f, 0xc8475f94,
+ 0xf57ebae2, 0x2194c979, 0x8f0c700f, 0x5be60394, 0x66dfe6e2,
+ 0xb2359579, 0x3aee950f, 0xee04e694, 0xd33d03e2, 0x07d77079,
+ 0xa94fc90f, 0x7da5ba94, 0x409c5fe2, 0x94762c79, 0xc827bb0c,
+ 0x1ccdc897, 0x21f42de1, 0xf51e5e7a, 0x5b86e70c, 0x8f6c9497,
+ 0xb25571e1, 0x66bf027a, 0xee64020c, 0x3a8e7197, 0x07b794e1,
+ 0xd35de77a, 0x7dc55e0c, 0xa92f2d97, 0x9416c8e1, 0x40fcbb7a,
+ 0x84a1c90d, 0x504bba96, 0x6d725fe0, 0xb9982c7b, 0x1700950d,
+ 0xc3eae696, 0xfed303e0, 0x2a39707b, 0xa2e2700d, 0x76080396,
+ 0x4b31e6e0, 0x9fdb957b, 0x31432c0d, 0xe5a95f96, 0xd890bae0,
+ 0x0c7ac97b},
+ {0x00000000, 0x27652581, 0x0fcc3bd9, 0x28a91e58, 0x5f9e0669,
+ 0x78fb23e8, 0x50523db0, 0x77371831, 0xbe3c0dd2, 0x99592853,
+ 0xb1f0360b, 0x9695138a, 0xe1a20bbb, 0xc6c72e3a, 0xee6e3062,
+ 0xc90b15e3, 0x3d7f6b7f, 0x1a1a4efe, 0x32b350a6, 0x15d67527,
+ 0x62e16d16, 0x45844897, 0x6d2d56cf, 0x4a48734e, 0x834366ad,
+ 0xa426432c, 0x8c8f5d74, 0xabea78f5, 0xdcdd60c4, 0xfbb84545,
+ 0xd3115b1d, 0xf4747e9c, 0x7afed6fe, 0x5d9bf37f, 0x7532ed27,
+ 0x5257c8a6, 0x2560d097, 0x0205f516, 0x2aaceb4e, 0x0dc9cecf,
+ 0xc4c2db2c, 0xe3a7fead, 0xcb0ee0f5, 0xec6bc574, 0x9b5cdd45,
+ 0xbc39f8c4, 0x9490e69c, 0xb3f5c31d, 0x4781bd81, 0x60e49800,
+ 0x484d8658, 0x6f28a3d9, 0x181fbbe8, 0x3f7a9e69, 0x17d38031,
+ 0x30b6a5b0, 0xf9bdb053, 0xded895d2, 0xf6718b8a, 0xd114ae0b,
+ 0xa623b63a, 0x814693bb, 0xa9ef8de3, 0x8e8aa862, 0xb5fadc26,
+ 0x929ff9a7, 0xba36e7ff, 0x9d53c27e, 0xea64da4f, 0xcd01ffce,
+ 0xe5a8e196, 0xc2cdc417, 0x0bc6d1f4, 0x2ca3f475, 0x040aea2d,
+ 0x236fcfac, 0x5458d79d, 0x733df21c, 0x5b94ec44, 0x7cf1c9c5,
+ 0x8885b759, 0xafe092d8, 0x87498c80, 0xa02ca901, 0xd71bb130,
+ 0xf07e94b1, 0xd8d78ae9, 0xffb2af68, 0x36b9ba8b, 0x11dc9f0a,
+ 0x39758152, 0x1e10a4d3, 0x6927bce2, 0x4e429963, 0x66eb873b,
+ 0x418ea2ba, 0xcf040ad8, 0xe8612f59, 0xc0c83101, 0xe7ad1480,
+ 0x909a0cb1, 0xb7ff2930, 0x9f563768, 0xb83312e9, 0x7138070a,
+ 0x565d228b, 0x7ef43cd3, 0x59911952, 0x2ea60163, 0x09c324e2,
+ 0x216a3aba, 0x060f1f3b, 0xf27b61a7, 0xd51e4426, 0xfdb75a7e,
+ 0xdad27fff, 0xade567ce, 0x8a80424f, 0xa2295c17, 0x854c7996,
+ 0x4c476c75, 0x6b2249f4, 0x438b57ac, 0x64ee722d, 0x13d96a1c,
+ 0x34bc4f9d, 0x1c1551c5, 0x3b707444, 0x6af5b94d, 0x4d909ccc,
+ 0x65398294, 0x425ca715, 0x356bbf24, 0x120e9aa5, 0x3aa784fd,
+ 0x1dc2a17c, 0xd4c9b49f, 0xf3ac911e, 0xdb058f46, 0xfc60aac7,
+ 0x8b57b2f6, 0xac329777, 0x849b892f, 0xa3feacae, 0x578ad232,
+ 0x70eff7b3, 0x5846e9eb, 0x7f23cc6a, 0x0814d45b, 0x2f71f1da,
+ 0x07d8ef82, 0x20bdca03, 0xe9b6dfe0, 0xced3fa61, 0xe67ae439,
+ 0xc11fc1b8, 0xb628d989, 0x914dfc08, 0xb9e4e250, 0x9e81c7d1,
+ 0x100b6fb3, 0x376e4a32, 0x1fc7546a, 0x38a271eb, 0x4f9569da,
+ 0x68f04c5b, 0x40595203, 0x673c7782, 0xae376261, 0x895247e0,
+ 0xa1fb59b8, 0x869e7c39, 0xf1a96408, 0xd6cc4189, 0xfe655fd1,
+ 0xd9007a50, 0x2d7404cc, 0x0a11214d, 0x22b83f15, 0x05dd1a94,
+ 0x72ea02a5, 0x558f2724, 0x7d26397c, 0x5a431cfd, 0x9348091e,
+ 0xb42d2c9f, 0x9c8432c7, 0xbbe11746, 0xccd60f77, 0xebb32af6,
+ 0xc31a34ae, 0xe47f112f, 0xdf0f656b, 0xf86a40ea, 0xd0c35eb2,
+ 0xf7a67b33, 0x80916302, 0xa7f44683, 0x8f5d58db, 0xa8387d5a,
+ 0x613368b9, 0x46564d38, 0x6eff5360, 0x499a76e1, 0x3ead6ed0,
+ 0x19c84b51, 0x31615509, 0x16047088, 0xe2700e14, 0xc5152b95,
+ 0xedbc35cd, 0xcad9104c, 0xbdee087d, 0x9a8b2dfc, 0xb22233a4,
+ 0x95471625, 0x5c4c03c6, 0x7b292647, 0x5380381f, 0x74e51d9e,
+ 0x03d205af, 0x24b7202e, 0x0c1e3e76, 0x2b7b1bf7, 0xa5f1b395,
+ 0x82949614, 0xaa3d884c, 0x8d58adcd, 0xfa6fb5fc, 0xdd0a907d,
+ 0xf5a38e25, 0xd2c6aba4, 0x1bcdbe47, 0x3ca89bc6, 0x1401859e,
+ 0x3364a01f, 0x4453b82e, 0x63369daf, 0x4b9f83f7, 0x6cfaa676,
+ 0x988ed8ea, 0xbfebfd6b, 0x9742e333, 0xb027c6b2, 0xc710de83,
+ 0xe075fb02, 0xc8dce55a, 0xefb9c0db, 0x26b2d538, 0x01d7f0b9,
+ 0x297eeee1, 0x0e1bcb60, 0x792cd351, 0x5e49f6d0, 0x76e0e888,
+ 0x5185cd09}};
+
+#endif
+
+#endif
+
+#endif
+
+local const z_crc_t FAR x2n_table[] = {
+ 0x40000000, 0x20000000, 0x08000000, 0x00800000, 0x00008000,
+ 0xedb88320, 0xb1e6b092, 0xa06a2517, 0xed627dae, 0x88d14467,
+ 0xd7bbfe6a, 0xec447f11, 0x8e7ea170, 0x6427800e, 0x4d47bae0,
+ 0x09fe548f, 0x83852d0f, 0x30362f1a, 0x7b5a9cc3, 0x31fec169,
+ 0x9fec022a, 0x6c8dedc4, 0x15d6874d, 0x5fde7a4e, 0xbad90e37,
+ 0x2e4e5eef, 0x4eaba214, 0xa8a472c0, 0x429a969e, 0x148d302a,
+ 0xc40ba6d0, 0xc4e22c3c};
diff --git a/freetype/src/gzip/ftgzip.c b/freetype/src/gzip/ftgzip.c
index 8f98a7d1..34bbe4da 100644
--- a/freetype/src/gzip/ftgzip.c
+++ b/freetype/src/gzip/ftgzip.c
@@ -8,7 +8,7 @@
* parse compressed PCF fonts, as found with many X11 server
* distributions.
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -69,10 +69,21 @@
/* */
/* so that configuration with `FT_CONFIG_OPTION_SYSTEM_ZLIB' might */
/* include the wrong `zconf.h' file, leading to errors. */
-#include "zlib.h"
-#undef SLOW
-#define SLOW 1 /* we can't use asm-optimized sources here! */
+ /* `HAVE_HIDDEN` should be defined if */
+ /* */
+ /* __attribute__((visibility("hidden"))) */
+ /* */
+ /* is supported by the compiler, which prevents internal symbols from */
+ /* being exported by the library. */
+#if defined( __GNUC__ ) || defined( __clang__ )
+#define HAVE_HIDDEN 1
+#define ZEXPORT
+#define ZEXTERN static
+#endif
+
+#define Z_SOLO 1
+#define Z_FREETYPE 1
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
/* We disable the warning `conversion from XXX to YYY, */
@@ -83,24 +94,23 @@
#pragma warning( disable : 4244 )
#endif /* _MSC_VER */
- /* Urgh. `inflate_mask' must not be declared twice -- C++ doesn't like
- this. We temporarily disable it and load all necessary header files. */
-#define NO_INFLATE_MASK
-#include "zutil.h"
-#include "inftrees.h"
-#include "infblock.h"
-#include "infcodes.h"
-#include "infutil.h"
-#undef NO_INFLATE_MASK
-
- /* infutil.c must be included before infcodes.c */
+#if defined( __GNUC__ )
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-prototypes"
+#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
+#pragma GCC diagnostic ignored "-Wredundant-decls"
+#endif
+
#include "zutil.c"
-#include "inftrees.c"
-#include "infutil.c"
-#include "infcodes.c"
-#include "infblock.c"
+#include "inffast.c"
#include "inflate.c"
+#include "inftrees.c"
#include "adler32.c"
+#include "crc32.c"
+
+#if defined( __GNUC__ )
+#pragma GCC diagnostic pop
+#endif
#if defined( _MSC_VER )
#pragma warning( pop )
@@ -150,7 +160,7 @@
#if !defined( FT_CONFIG_OPTION_SYSTEM_ZLIB ) && !defined( USE_ZLIB_ZCALLOC )
- local voidpf
+ voidpf ZLIB_INTERNAL
zcalloc ( voidpf opaque,
unsigned items,
unsigned size )
@@ -158,7 +168,8 @@
return ft_gzip_alloc( opaque, items, size );
}
- local void
+
+ void ZLIB_INTERNAL
zcfree( voidpf opaque,
voidpf ptr )
{
@@ -751,16 +762,7 @@
stream.zfree = ft_gzip_free;
stream.opaque = memory;
- /* This is a temporary fix and will be removed once the internal
- * copy of zlib is updated to the newest version. The `|32' flag
- * is only supported in the new versions of zlib to enable gzip
- * encoded header.
- */
-#ifdef FT_CONFIG_OPTION_SYSTEM_ZLIB
err = inflateInit2( &stream, MAX_WBITS|32 );
-#else
- err = inflateInit2( &stream, MAX_WBITS );
-#endif
if ( err != Z_OK )
return FT_THROW( Invalid_Argument );
diff --git a/freetype/src/gzip/ftzconf.h b/freetype/src/gzip/ftzconf.h
index 3abf0ba0..5e1d68a0 100644
--- a/freetype/src/gzip/ftzconf.h
+++ b/freetype/src/gzip/ftzconf.h
@@ -1,109 +1,255 @@
/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2002 Jean-loup Gailly.
+ * Copyright (C) 1995-2016 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
-#ifndef _ZCONF_H
-#define _ZCONF_H
+#ifndef ZCONF_H
+#define ZCONF_H
/*
* If you *really* need a unique prefix for all types and library functions,
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
+ * Even better than compiling with -DZ_PREFIX would be to use configure to set
+ * this permanently in zconf.h using "./configure --zprefix".
*/
-#ifdef Z_PREFIX
-# define deflateInit_ z_deflateInit_
-# define deflate z_deflate
-# define deflateEnd z_deflateEnd
-# define inflateInit_ z_inflateInit_
-# define inflate z_inflate
-# define inflateEnd z_inflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateCopy z_deflateCopy
-# define deflateReset z_deflateReset
-# define deflateParams z_deflateParams
-# define inflateInit2_ z_inflateInit2_
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateReset z_inflateReset
-# define compress z_compress
-# define compress2 z_compress2
-# define uncompress z_uncompress
-# define adler32 z_adler32
-# define crc32 z_crc32
-# define get_crc_table z_get_crc_table
-
-# define Byte z_Byte
-# define uInt z_uInt
-# define uLong z_uLong
-# define Bytef z_Bytef
-# define charf z_charf
-# define intf z_intf
-# define uIntf z_uIntf
-# define uLongf z_uLongf
-# define voidpf z_voidpf
-# define voidp z_voidp
-#endif
-
-#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
-# define WIN32
-#endif
-#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
-# ifndef __32BIT__
-# define __32BIT__
+#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
+# define Z_PREFIX_SET
+
+/* all linked symbols and init macros */
+# define _dist_code z__dist_code
+# define _length_code z__length_code
+# define _tr_align z__tr_align
+# define _tr_flush_bits z__tr_flush_bits
+# define _tr_flush_block z__tr_flush_block
+# define _tr_init z__tr_init
+# define _tr_stored_block z__tr_stored_block
+# define _tr_tally z__tr_tally
+# define adler32 z_adler32
+# define adler32_combine z_adler32_combine
+# define adler32_combine64 z_adler32_combine64
+# define adler32_z z_adler32_z
+# ifndef Z_SOLO
+# define compress z_compress
+# define compress2 z_compress2
+# define compressBound z_compressBound
+# endif
+# define crc32 z_crc32
+# define crc32_combine z_crc32_combine
+# define crc32_combine64 z_crc32_combine64
+# define crc32_z z_crc32_z
+# define deflate z_deflate
+# define deflateBound z_deflateBound
+# define deflateCopy z_deflateCopy
+# define deflateEnd z_deflateEnd
+# define deflateGetDictionary z_deflateGetDictionary
+# define deflateInit z_deflateInit
+# define deflateInit2 z_deflateInit2
+# define deflateInit2_ z_deflateInit2_
+# define deflateInit_ z_deflateInit_
+# define deflateParams z_deflateParams
+# define deflatePending z_deflatePending
+# define deflatePrime z_deflatePrime
+# define deflateReset z_deflateReset
+# define deflateResetKeep z_deflateResetKeep
+# define deflateSetDictionary z_deflateSetDictionary
+# define deflateSetHeader z_deflateSetHeader
+# define deflateTune z_deflateTune
+# define deflate_copyright z_deflate_copyright
+# define get_crc_table z_get_crc_table
+# ifndef Z_SOLO
+# define gz_error z_gz_error
+# define gz_intmax z_gz_intmax
+# define gz_strwinerror z_gz_strwinerror
+# define gzbuffer z_gzbuffer
+# define gzclearerr z_gzclearerr
+# define gzclose z_gzclose
+# define gzclose_r z_gzclose_r
+# define gzclose_w z_gzclose_w
+# define gzdirect z_gzdirect
+# define gzdopen z_gzdopen
+# define gzeof z_gzeof
+# define gzerror z_gzerror
+# define gzflush z_gzflush
+# define gzfread z_gzfread
+# define gzfwrite z_gzfwrite
+# define gzgetc z_gzgetc
+# define gzgetc_ z_gzgetc_
+# define gzgets z_gzgets
+# define gzoffset z_gzoffset
+# define gzoffset64 z_gzoffset64
+# define gzopen z_gzopen
+# define gzopen64 z_gzopen64
+# ifdef _WIN32
+# define gzopen_w z_gzopen_w
+# endif
+# define gzprintf z_gzprintf
+# define gzputc z_gzputc
+# define gzputs z_gzputs
+# define gzread z_gzread
+# define gzrewind z_gzrewind
+# define gzseek z_gzseek
+# define gzseek64 z_gzseek64
+# define gzsetparams z_gzsetparams
+# define gztell z_gztell
+# define gztell64 z_gztell64
+# define gzungetc z_gzungetc
+# define gzvprintf z_gzvprintf
+# define gzwrite z_gzwrite
+# endif
+# define inflate z_inflate
+# define inflateBack z_inflateBack
+# define inflateBackEnd z_inflateBackEnd
+# define inflateBackInit z_inflateBackInit
+# define inflateBackInit_ z_inflateBackInit_
+# define inflateCodesUsed z_inflateCodesUsed
+# define inflateCopy z_inflateCopy
+# define inflateEnd z_inflateEnd
+# define inflateGetDictionary z_inflateGetDictionary
+# define inflateGetHeader z_inflateGetHeader
+# define inflateInit z_inflateInit
+# define inflateInit2 z_inflateInit2
+# define inflateInit2_ z_inflateInit2_
+# define inflateInit_ z_inflateInit_
+# define inflateMark z_inflateMark
+# define inflatePrime z_inflatePrime
+# define inflateReset z_inflateReset
+# define inflateReset2 z_inflateReset2
+# define inflateResetKeep z_inflateResetKeep
+# define inflateSetDictionary z_inflateSetDictionary
+# define inflateSync z_inflateSync
+# define inflateSyncPoint z_inflateSyncPoint
+# define inflateUndermine z_inflateUndermine
+# define inflateValidate z_inflateValidate
+# define inflate_copyright z_inflate_copyright
+# define inflate_fast z_inflate_fast
+# define inflate_table z_inflate_table
+# ifndef Z_SOLO
+# define uncompress z_uncompress
+# define uncompress2 z_uncompress2
+# endif
+# define zError z_zError
+# ifndef Z_SOLO
+# define zcalloc z_zcalloc
+# define zcfree z_zcfree
+# endif
+# define zlibCompileFlags z_zlibCompileFlags
+# define zlibVersion z_zlibVersion
+
+/* all zlib typedefs in zlib.h and zconf.h */
+# define Byte z_Byte
+# define Bytef z_Bytef
+# define alloc_func z_alloc_func
+# define charf z_charf
+# define free_func z_free_func
+# ifndef Z_SOLO
+# define gzFile z_gzFile
# endif
+# define gz_header z_gz_header
+# define gz_headerp z_gz_headerp
+# define in_func z_in_func
+# define intf z_intf
+# define out_func z_out_func
+# define uInt z_uInt
+# define uIntf z_uIntf
+# define uLong z_uLong
+# define uLongf z_uLongf
+# define voidp z_voidp
+# define voidpc z_voidpc
+# define voidpf z_voidpf
+
+/* all zlib structs in zlib.h and zconf.h */
+# define gz_header_s z_gz_header_s
+# define internal_state z_internal_state
+
#endif
+
#if defined(__MSDOS__) && !defined(MSDOS)
# define MSDOS
#endif
-
-/* WinCE doesn't have errno.h */
-#ifdef _WIN32_WCE
-# define NO_ERRNO_H
+#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
+# define OS2
+#endif
+#if defined(_WINDOWS) && !defined(WINDOWS)
+# define WINDOWS
+#endif
+#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
+# ifndef WIN32
+# define WIN32
+# endif
+#endif
+#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
+# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
+# ifndef SYS16BIT
+# define SYS16BIT
+# endif
+# endif
#endif
-
/*
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
* than 64k bytes at a time (needed on systems with 16-bit int).
*/
-#if defined(MSDOS) && !defined(__32BIT__)
+#ifdef SYS16BIT
# define MAXSEG_64K
#endif
#ifdef MSDOS
# define UNALIGNED_OK
#endif
-#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
-# define STDC
-#endif
-#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
+#ifdef __STDC_VERSION__
# ifndef STDC
# define STDC
# endif
+# if __STDC_VERSION__ >= 199901L
+# ifndef STDC99
+# define STDC99
+# endif
+# endif
+#endif
+#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
+# define STDC
+#endif
+#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
+# define STDC
+#endif
+
+#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
+# define STDC
#endif
#ifndef STDC
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-# define const
+# define const /* note: need a more gentle solution here */
# endif
#endif
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
-# define NO_DUMMY_DECL
-#endif
-
-/* Old Borland C and LCC incorrectly complains about missing returns: */
-#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
-# define NEED_DUMMY_RETURN
+#if defined(ZLIB_CONST) && !defined(z_const)
+# define z_const const
+#else
+# define z_const
#endif
-#if defined(__LCC__)
-# define NEED_DUMMY_RETURN
+#ifdef Z_SOLO
+ typedef unsigned long z_size_t;
+#else
+# define z_longlong long long
+# if defined(NO_SIZE_T)
+ typedef unsigned NO_SIZE_T z_size_t;
+# elif defined(STDC)
+# include <stddef.h>
+ typedef size_t z_size_t;
+# else
+ typedef unsigned long z_size_t;
+# endif
+# undef z_longlong
#endif
/* Maximum value for memLevel in deflateInit2 */
@@ -133,7 +279,7 @@
Of course this will generally degrade compression (there's no free lunch).
The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
+ that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
for small objects.
*/
@@ -147,75 +293,101 @@
# endif
#endif
+#ifndef Z_ARG /* function prototypes for stdarg */
+# if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# define Z_ARG(args) args
+# else
+# define Z_ARG(args) ()
+# endif
+#endif
+
/* The following definitions for FAR are needed only for MSDOS mixed
* model programming (small or medium model with some far allocations).
* This was tested only with MSC; for other MSDOS compilers you may have
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
* just define FAR to be empty.
*/
-#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
- /* MSC small or medium model */
-# define SMALL_MEDIUM
-# ifdef _MSC_VER
-# define FAR _far
-# else
-# define FAR far
+#ifdef SYS16BIT
+# if defined(M_I86SM) || defined(M_I86MM)
+ /* MSC small or medium model */
+# define SMALL_MEDIUM
+# ifdef _MSC_VER
+# define FAR _far
+# else
+# define FAR far
+# endif
# endif
-#endif
-#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
-# ifndef __32BIT__
+# if (defined(__SMALL__) || defined(__MEDIUM__))
+ /* Turbo C small or medium model */
# define SMALL_MEDIUM
-# define FAR _far
+# ifdef __BORLANDC__
+# define FAR _far
+# else
+# define FAR far
+# endif
# endif
#endif
-/* Compile with -DZLIB_DLL for Windows DLL support */
-#if defined(ZLIB_DLL)
-# if defined(_WINDOWS) || defined(WINDOWS)
+#if defined(WINDOWS) || defined(WIN32)
+ /* If building or using zlib as a DLL, define ZLIB_DLL.
+ * This is not mandatory, but it offers a little performance increase.
+ */
+# ifdef ZLIB_DLL
+# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
+# ifdef ZLIB_INTERNAL
+# define ZEXTERN extern __declspec(dllexport)
+# else
+# define ZEXTERN extern __declspec(dllimport)
+# endif
+# endif
+# endif /* ZLIB_DLL */
+ /* If building or using zlib with the WINAPI/WINAPIV calling convention,
+ * define ZLIB_WINAPI.
+ * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
+ */
+# ifdef ZLIB_WINAPI
# ifdef FAR
# undef FAR
# endif
# include <windows.h>
-# define ZEXPORT(x) x WINAPI
+ /* No need for _export, use ZLIB.DEF instead. */
+ /* For complete Windows compatibility, use WINAPI, not __stdcall. */
+# define ZEXPORT WINAPI
# ifdef WIN32
-# define ZEXPORTVA(x) x WINAPIV
+# define ZEXPORTVA WINAPIV
# else
-# define ZEXPORTVA(x) x FAR _cdecl _export
+# define ZEXPORTVA FAR CDECL
# endif
# endif
-# if defined (__BORLANDC__)
-# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
-# include <windows.h>
-# define ZEXPORT(x) x __declspec(dllexport) WINAPI
-# define ZEXPORTRVA(x) x __declspec(dllexport) WINAPIV
+#endif
+
+#if defined (__BEOS__)
+# ifdef ZLIB_DLL
+# ifdef ZLIB_INTERNAL
+# define ZEXPORT __declspec(dllexport)
+# define ZEXPORTVA __declspec(dllexport)
# else
-# if defined (_Windows) && defined (__DLL__)
-# define ZEXPORT(x) x _export
-# define ZEXPORTVA(x) x _export
-# endif
+# define ZEXPORT __declspec(dllimport)
+# define ZEXPORTVA __declspec(dllimport)
# endif
# endif
#endif
-
+#ifndef ZEXTERN
+# define ZEXTERN extern
+#endif
#ifndef ZEXPORT
-# define ZEXPORT(x) static x
+# define ZEXPORT
#endif
#ifndef ZEXPORTVA
-# define ZEXPORTVA(x) static x
-#endif
-#ifndef ZEXTERN
-# define ZEXTERN(x) static x
-#endif
-#ifndef ZEXTERNDEF
-# define ZEXTERNDEF(x) static x
+# define ZEXPORTVA
#endif
#ifndef FAR
-# define FAR
+# define FAR
#endif
-#if !defined(MACOS) && !defined(TARGET_OS_MAC)
+#if !defined(__MACTYPES__)
typedef unsigned char Byte; /* 8 bits */
#endif
typedef unsigned int uInt; /* 16 bits or more */
@@ -233,52 +405,130 @@ typedef uInt FAR uIntf;
typedef uLong FAR uLongf;
#ifdef STDC
- typedef void FAR *voidpf;
- typedef void *voidp;
+ typedef void const *voidpc;
+ typedef void FAR *voidpf;
+ typedef void *voidp;
+#else
+ typedef Byte const *voidpc;
+ typedef Byte FAR *voidpf;
+ typedef Byte *voidp;
+#endif
+
+#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
+# include <limits.h>
+# if (UINT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned
+# elif (ULONG_MAX == 0xffffffffUL)
+# define Z_U4 unsigned long
+# elif (USHRT_MAX == 0xffffffffUL)
+# define Z_U4 unsigned short
+# endif
+#endif
+
+#ifdef Z_U4
+ typedef Z_U4 z_crc_t;
#else
- typedef Byte FAR *voidpf;
- typedef Byte *voidp;
+ typedef unsigned long z_crc_t;
+#endif
+
+#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_UNISTD_H
#endif
-#ifdef HAVE_UNISTD_H
-# include <sys/types.h> /* for off_t */
-# include <unistd.h> /* for SEEK_* and off_t */
-# define z_off_t off_t
+#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */
+# define Z_HAVE_STDARG_H
#endif
-#ifndef SEEK_SET
+
+#ifdef STDC
+# ifndef Z_SOLO
+# include <sys/types.h> /* for off_t */
+# endif
+#endif
+
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+# include <stdarg.h> /* for va_list */
+# endif
+#endif
+
+#ifdef _WIN32
+# ifndef Z_SOLO
+# include <stddef.h> /* for wchar_t */
+# endif
+#endif
+
+/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
+ * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
+ * though the former does not conform to the LFS document), but considering
+ * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
+ * equivalently requesting no 64-bit operations
+ */
+#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
+# undef _LARGEFILE64_SOURCE
+#endif
+
+#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
+# define Z_HAVE_UNISTD_H
+#endif
+#ifndef Z_SOLO
+# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# include <unistd.h> /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
+# ifdef VMS
+# include <unixio.h> /* for off_t */
+# endif
+# ifndef z_off_t
+# define z_off_t off_t
+# endif
+# endif
+#endif
+
+#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
+# define Z_LFS64
+#endif
+
+#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
+# define Z_LARGE64
+#endif
+
+#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
+# define Z_WANT64
+#endif
+
+#if !defined(SEEK_SET) && !defined(Z_SOLO)
# define SEEK_SET 0 /* Seek from beginning of file. */
# define SEEK_CUR 1 /* Seek from current position. */
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
#endif
+
#ifndef z_off_t
-# define z_off_t long
+# define z_off_t long
+#endif
+
+#if !defined(_WIN32) && defined(Z_LARGE64)
+# define z_off64_t off64_t
+#else
+# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
+# define z_off64_t __int64
+# else
+# define z_off64_t z_off_t
+# endif
#endif
/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
-# pragma map(deflateInit_,"DEIN")
-# pragma map(deflateInit2_,"DEIN2")
-# pragma map(deflateEnd,"DEEND")
-# pragma map(inflateInit_,"ININ")
-# pragma map(inflateInit2_,"ININ2")
-# pragma map(inflateEnd,"INEND")
-# pragma map(inflateSync,"INSY")
-# pragma map(inflateSetDictionary,"INSEDI")
-# pragma map(inflate_blocks,"INBL")
-# pragma map(inflate_blocks_new,"INBLNE")
-# pragma map(inflate_blocks_free,"INBLFR")
-# pragma map(inflate_blocks_reset,"INBLRE")
-# pragma map(inflate_codes_free,"INCOFR")
-# pragma map(inflate_codes,"INCO")
-# pragma map(inflate_fast,"INFA")
-# pragma map(inflate_flush,"INFLU")
-# pragma map(inflate_mask,"INMA")
-# pragma map(inflate_set_dictionary,"INSEDI2")
-# pragma map(inflate_copyright,"INCOPY")
-# pragma map(inflate_trees_bits,"INTRBI")
-# pragma map(inflate_trees_dynamic,"INTRDY")
-# pragma map(inflate_trees_fixed,"INTRFI")
-# pragma map(inflate_trees_free,"INTRFR")
-#endif
-
-#endif /* _ZCONF_H */
+ #pragma map(deflateInit_,"DEIN")
+ #pragma map(deflateInit2_,"DEIN2")
+ #pragma map(deflateEnd,"DEEND")
+ #pragma map(deflateBound,"DEBND")
+ #pragma map(inflateInit_,"ININ")
+ #pragma map(inflateInit2_,"ININ2")
+ #pragma map(inflateEnd,"INEND")
+ #pragma map(inflateSync,"INSY")
+ #pragma map(inflateSetDictionary,"INSEDI")
+ #pragma map(compressBound,"CMBND")
+ #pragma map(inflate_table,"INTABL")
+ #pragma map(inflate_fast,"INFA")
+ #pragma map(inflate_copyright,"INCOPY")
+#endif
+
+#endif /* ZCONF_H */
diff --git a/freetype/src/gzip/gzguts.h b/freetype/src/gzip/gzguts.h
new file mode 100644
index 00000000..4f09a52a
--- /dev/null
+++ b/freetype/src/gzip/gzguts.h
@@ -0,0 +1,219 @@
+/* gzguts.h -- zlib internal header definitions for gz* operations
+ * Copyright (C) 2004-2019 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#ifdef _LARGEFILE64_SOURCE
+# ifndef _LARGEFILE_SOURCE
+# define _LARGEFILE_SOURCE 1
+# endif
+# ifdef _FILE_OFFSET_BITS
+# undef _FILE_OFFSET_BITS
+# endif
+#endif
+
+#ifdef HAVE_HIDDEN
+# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+# define ZLIB_INTERNAL
+#endif
+
+#include <stdio.h>
+#include "zlib.h"
+#ifdef STDC
+# include <string.h>
+# include <stdlib.h>
+# include <limits.h>
+#endif
+
+#ifndef _POSIX_SOURCE
+# define _POSIX_SOURCE
+#endif
+#include <fcntl.h>
+
+#ifdef _WIN32
+# include <stddef.h>
+#endif
+
+#if defined(__TURBOC__) || defined(_MSC_VER) || defined(_WIN32)
+# include <io.h>
+#endif
+
+#if defined(_WIN32)
+# define WIDECHAR
+#endif
+
+#ifdef WINAPI_FAMILY
+# define open _open
+# define read _read
+# define write _write
+# define close _close
+#endif
+
+#ifdef NO_DEFLATE /* for compatibility with old definition */
+# define NO_GZCOMPRESS
+#endif
+
+#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
+# ifndef HAVE_VSNPRINTF
+# define HAVE_VSNPRINTF
+# endif
+#endif
+
+#if defined(__CYGWIN__)
+# ifndef HAVE_VSNPRINTF
+# define HAVE_VSNPRINTF
+# endif
+#endif
+
+#if defined(MSDOS) && defined(__BORLANDC__) && (BORLANDC > 0x410)
+# ifndef HAVE_VSNPRINTF
+# define HAVE_VSNPRINTF
+# endif
+#endif
+
+#ifndef HAVE_VSNPRINTF
+# ifdef MSDOS
+/* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
+ but for now we just assume it doesn't. */
+# define NO_vsnprintf
+# endif
+# ifdef __TURBOC__
+# define NO_vsnprintf
+# endif
+# ifdef WIN32
+/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
+# if !defined(vsnprintf) && !defined(NO_vsnprintf)
+# if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
+# define vsnprintf _vsnprintf
+# endif
+# endif
+# endif
+# ifdef __SASC
+# define NO_vsnprintf
+# endif
+# ifdef VMS
+# define NO_vsnprintf
+# endif
+# ifdef __OS400__
+# define NO_vsnprintf
+# endif
+# ifdef __MVS__
+# define NO_vsnprintf
+# endif
+#endif
+
+/* unlike snprintf (which is required in C99), _snprintf does not guarantee
+ null termination of the result -- however this is only used in gzlib.c where
+ the result is assured to fit in the space provided */
+#if defined(_MSC_VER) && _MSC_VER < 1900
+# define snprintf _snprintf
+#endif
+
+#ifndef local
+# define local static
+#endif
+/* since "static" is used to mean two completely different things in C, we
+ define "local" for the non-static meaning of "static", for readability
+ (compile with -Dlocal if your debugger can't find static symbols) */
+
+/* gz* functions always use library allocation functions */
+#ifndef STDC
+ extern voidp malloc OF((uInt size));
+ extern void free OF((voidpf ptr));
+#endif
+
+/* get errno and strerror definition */
+#if defined UNDER_CE
+# include <windows.h>
+# define zstrerror() gz_strwinerror((DWORD)GetLastError())
+#else
+# ifndef NO_STRERROR
+# include <errno.h>
+# define zstrerror() strerror(errno)
+# else
+# define zstrerror() "stdio error (consult errno)"
+# endif
+#endif
+
+/* provide prototypes for these when building zlib without LFS */
+#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+ ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+#endif
+
+/* default memLevel */
+#if MAX_MEM_LEVEL >= 8
+# define DEF_MEM_LEVEL 8
+#else
+# define DEF_MEM_LEVEL MAX_MEM_LEVEL
+#endif
+
+/* default i/o buffer size -- double this for output when reading (this and
+ twice this must be able to fit in an unsigned type) */
+#define GZBUFSIZE 8192
+
+/* gzip modes, also provide a little integrity check on the passed structure */
+#define GZ_NONE 0
+#define GZ_READ 7247
+#define GZ_WRITE 31153
+#define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */
+
+/* values for gz_state how */
+#define LOOK 0 /* look for a gzip header */
+#define COPY__ 1 /* copy input directly */
+#define GZIP 2 /* decompress a gzip stream */
+
+/* internal gzip file state data structure */
+typedef struct {
+ /* exposed contents for gzgetc() macro */
+ struct gzFile_s x; /* "x" for exposed */
+ /* x.have: number of bytes available at x.next */
+ /* x.next: next output data to deliver or write */
+ /* x.pos: current position in uncompressed data */
+ /* used for both reading and writing */
+ int mode; /* see gzip modes above */
+ int fd; /* file descriptor */
+ char *path; /* path or fd for error messages */
+ unsigned size; /* buffer size, zero if not allocated yet */
+ unsigned want; /* requested buffer size, default is GZBUFSIZE */
+ unsigned char *in; /* input buffer (double-sized when writing) */
+ unsigned char *out; /* output buffer (double-sized when reading) */
+ int direct; /* 0 if processing gzip, 1 if transparent */
+ /* just for reading */
+ int how; /* 0: get header, 1: copy, 2: decompress */
+ z_off64_t start; /* where the gzip data started, for rewinding */
+ int eof; /* true if end of input file reached */
+ int past; /* true if read requested past end */
+ /* just for writing */
+ int level; /* compression level */
+ int strategy; /* compression strategy */
+ int reset; /* true if a reset is pending after a Z_FINISH */
+ /* seek request */
+ z_off64_t skip; /* amount to skip (already rewound if backwards) */
+ int seek; /* true if seek request pending */
+ /* error information */
+ int err; /* error code */
+ char *msg; /* error message */
+ /* zlib inflate or deflate stream */
+ z_stream strm; /* stream structure in-place (not a pointer) */
+} gz_state;
+typedef gz_state FAR *gz_statep;
+
+/* shared functions */
+void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *));
+#if defined UNDER_CE
+char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error));
+#endif
+
+/* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t
+ value -- needed when comparing unsigned to z_off64_t, which is signed
+ (possible z_off64_t types off_t, off64_t, and long are all signed) */
+#ifdef INT_MAX
+# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX)
+#else
+unsigned ZLIB_INTERNAL gz_intmax OF((void));
+# define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax())
+#endif
diff --git a/freetype/src/gzip/infback.c b/freetype/src/gzip/infback.c
new file mode 100644
index 00000000..5fb8c679
--- /dev/null
+++ b/freetype/src/gzip/infback.c
@@ -0,0 +1,641 @@
+/* infback.c -- inflate using a call-back interface
+ * Copyright (C) 1995-2022 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/*
+ This code is largely copied from inflate.c. Normally either infback.o or
+ inflate.o would be linked into an application--not both. The interface
+ with inffast.c is retained so that optimized assembler-coded versions of
+ inflate_fast() can be used with either inflate.c or infback.c.
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+/* function prototypes */
+local void fixedtables OF((struct inflate_state FAR *state));
+
+/*
+ strm provides memory allocation functions in zalloc and zfree, or
+ Z_NULL to use the library memory allocation functions.
+
+ windowBits is in the range 8..15, and window is a user-supplied
+ window and output buffer that is 2**windowBits bytes.
+ */
+int ZEXPORT inflateBackInit_(
+ z_streamp strm,
+ int windowBits,
+ unsigned char FAR *window,
+ const char *version,
+ int stream_size)
+{
+ struct inflate_state FAR *state;
+
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != (int)(sizeof(z_stream)))
+ return Z_VERSION_ERROR;
+ if (strm == Z_NULL || window == Z_NULL ||
+ windowBits < 8 || windowBits > 15)
+ return Z_STREAM_ERROR;
+ strm->msg = Z_NULL; /* in case we return an error */
+ if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zalloc = zcalloc;
+ strm->opaque = (voidpf)0;
+#endif
+ }
+ if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zfree = zcfree;
+#endif
+ state = (struct inflate_state FAR *)ZALLOC(strm, 1,
+ sizeof(struct inflate_state));
+ if (state == Z_NULL) return Z_MEM_ERROR;
+ Tracev((stderr, "inflate: allocated\n"));
+ strm->state = (struct internal_state FAR *)state;
+ state->dmax = 32768U;
+ state->wbits = (uInt)windowBits;
+ state->wsize = 1U << windowBits;
+ state->window = window;
+ state->wnext = 0;
+ state->whave = 0;
+ return Z_OK;
+}
+
+/*
+ Return state with length and distance decoding tables and index sizes set to
+ fixed code decoding. Normally this returns fixed tables from inffixed.h.
+ If BUILDFIXED is defined, then instead this routine builds the tables the
+ first time it's called, and returns those tables the first time and
+ thereafter. This reduces the size of the code by about 2K bytes, in
+ exchange for a little execution time. However, BUILDFIXED should not be
+ used for threaded applications, since the rewriting of the tables and virgin
+ may not be thread-safe.
+ */
+local void fixedtables(
+ struct inflate_state FAR *state)
+{
+#ifdef BUILDFIXED
+ static int virgin = 1;
+ static code *lenfix, *distfix;
+ static code fixed[544];
+
+ /* build fixed huffman tables if first call (may not be thread safe) */
+ if (virgin) {
+ unsigned sym, bits;
+ static code *next;
+
+ /* literal/length table */
+ sym = 0;
+ while (sym < 144) state->lens[sym++] = 8;
+ while (sym < 256) state->lens[sym++] = 9;
+ while (sym < 280) state->lens[sym++] = 7;
+ while (sym < 288) state->lens[sym++] = 8;
+ next = fixed;
+ lenfix = next;
+ bits = 9;
+ inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+
+ /* distance table */
+ sym = 0;
+ while (sym < 32) state->lens[sym++] = 5;
+ distfix = next;
+ bits = 5;
+ inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+
+ /* do this just once */
+ virgin = 0;
+ }
+#else /* !BUILDFIXED */
+# include "inffixed.h"
+#endif /* BUILDFIXED */
+ state->lencode = lenfix;
+ state->lenbits = 9;
+ state->distcode = distfix;
+ state->distbits = 5;
+}
+
+/* Macros for inflateBack(): */
+
+/* Load returned state from inflate_fast() */
+#define LOAD() \
+ do { \
+ put = strm->next_out; \
+ left = strm->avail_out; \
+ next = strm->next_in; \
+ have = strm->avail_in; \
+ hold = state->hold; \
+ bits = state->bits; \
+ } while (0)
+
+/* Set state from registers for inflate_fast() */
+#define RESTORE() \
+ do { \
+ strm->next_out = put; \
+ strm->avail_out = left; \
+ strm->next_in = next; \
+ strm->avail_in = have; \
+ state->hold = hold; \
+ state->bits = bits; \
+ } while (0)
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+ do { \
+ hold = 0; \
+ bits = 0; \
+ } while (0)
+
+/* Assure that some input is available. If input is requested, but denied,
+ then return a Z_BUF_ERROR from inflateBack(). */
+#define PULL() \
+ do { \
+ if (have == 0) { \
+ have = in(in_desc, &next); \
+ if (have == 0) { \
+ next = Z_NULL; \
+ ret = Z_BUF_ERROR; \
+ goto inf_leave; \
+ } \
+ } \
+ } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflateBack()
+ with an error if there is no input available. */
+#define PULLBYTE() \
+ do { \
+ PULL(); \
+ have--; \
+ hold += (unsigned long)(*next++) << bits; \
+ bits += 8; \
+ } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator. If there is
+ not enough available input to do that, then return from inflateBack() with
+ an error. */
+#define NEEDBITS(n) \
+ do { \
+ while (bits < (unsigned)(n)) \
+ PULLBYTE(); \
+ } while (0)
+
+/* Return the low n bits of the bit accumulator (n < 16) */
+#define BITS(n) \
+ ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+ do { \
+ hold >>= (n); \
+ bits -= (unsigned)(n); \
+ } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+ do { \
+ hold >>= bits & 7; \
+ bits -= bits & 7; \
+ } while (0)
+
+/* Assure that some output space is available, by writing out the window
+ if it's full. If the write fails, return from inflateBack() with a
+ Z_BUF_ERROR. */
+#define ROOM() \
+ do { \
+ if (left == 0) { \
+ put = state->window; \
+ left = state->wsize; \
+ state->whave = left; \
+ if (out(out_desc, put, left)) { \
+ ret = Z_BUF_ERROR; \
+ goto inf_leave; \
+ } \
+ } \
+ } while (0)
+
+/*
+ strm provides the memory allocation functions and window buffer on input,
+ and provides information on the unused input on return. For Z_DATA_ERROR
+ returns, strm will also provide an error message.
+
+ in() and out() are the call-back input and output functions. When
+ inflateBack() needs more input, it calls in(). When inflateBack() has
+ filled the window with output, or when it completes with data in the
+ window, it calls out() to write out the data. The application must not
+ change the provided input until in() is called again or inflateBack()
+ returns. The application must not change the window/output buffer until
+ inflateBack() returns.
+
+ in() and out() are called with a descriptor parameter provided in the
+ inflateBack() call. This parameter can be a structure that provides the
+ information required to do the read or write, as well as accumulated
+ information on the input and output such as totals and check values.
+
+ in() should return zero on failure. out() should return non-zero on
+ failure. If either in() or out() fails, than inflateBack() returns a
+ Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it
+ was in() or out() that caused in the error. Otherwise, inflateBack()
+ returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format
+ error, or Z_MEM_ERROR if it could not allocate memory for the state.
+ inflateBack() can also return Z_STREAM_ERROR if the input parameters
+ are not correct, i.e. strm is Z_NULL or the state was not initialized.
+ */
+int ZEXPORT inflateBack(
+ z_streamp strm,
+ in_func in,
+ void FAR *in_desc,
+ out_func out,
+ void FAR *out_desc)
+{
+ struct inflate_state FAR *state;
+ z_const unsigned char FAR *next; /* next input */
+ unsigned char FAR *put; /* next output */
+ unsigned have, left; /* available input and output */
+ unsigned long hold; /* bit buffer */
+ unsigned bits; /* bits in bit buffer */
+ unsigned copy; /* number of stored or match bytes to copy */
+ unsigned char FAR *from; /* where to copy match bytes from */
+ code here; /* current decoding table entry */
+ code last; /* parent table entry */
+ unsigned len; /* length to copy for repeats, bits to drop */
+ int ret; /* return code */
+ static const unsigned short order[19] = /* permutation of code lengths */
+ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+ /* Check that the strm exists and that the state was initialized */
+ if (strm == Z_NULL || strm->state == Z_NULL)
+ return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* Reset the state */
+ strm->msg = Z_NULL;
+ state->mode = TYPE;
+ state->last = 0;
+ state->whave = 0;
+ next = strm->next_in;
+ have = next != Z_NULL ? strm->avail_in : 0;
+ hold = 0;
+ bits = 0;
+ put = state->window;
+ left = state->wsize;
+
+ /* Inflate until end of block marked as last */
+ for (;;)
+ switch (state->mode) {
+ case TYPE:
+ /* determine and dispatch block type */
+ if (state->last) {
+ BYTEBITS();
+ state->mode = DONE;
+ break;
+ }
+ NEEDBITS(3);
+ state->last = BITS(1);
+ DROPBITS(1);
+ switch (BITS(2)) {
+ case 0: /* stored block */
+ Tracev((stderr, "inflate: stored block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = STORED;
+ break;
+ case 1: /* fixed block */
+ fixedtables(state);
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = LEN; /* decode codes */
+ break;
+ case 2: /* dynamic block */
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = TABLE;
+ break;
+ case 3:
+ strm->msg = (char *)"invalid block type";
+ state->mode = BAD;
+ }
+ DROPBITS(2);
+ break;
+
+ case STORED:
+ /* get and verify stored block length */
+ BYTEBITS(); /* go to byte boundary */
+ NEEDBITS(32);
+ if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+ strm->msg = (char *)"invalid stored block lengths";
+ state->mode = BAD;
+ break;
+ }
+ state->length = (unsigned)hold & 0xffff;
+ Tracev((stderr, "inflate: stored length %u\n",
+ state->length));
+ INITBITS();
+
+ /* copy stored block from input to output */
+ while (state->length != 0) {
+ copy = state->length;
+ PULL();
+ ROOM();
+ if (copy > have) copy = have;
+ if (copy > left) copy = left;
+ zmemcpy(put, next, copy);
+ have -= copy;
+ next += copy;
+ left -= copy;
+ put += copy;
+ state->length -= copy;
+ }
+ Tracev((stderr, "inflate: stored end\n"));
+ state->mode = TYPE;
+ break;
+
+ case TABLE:
+ /* get dynamic table entries descriptor */
+ NEEDBITS(14);
+ state->nlen = BITS(5) + 257;
+ DROPBITS(5);
+ state->ndist = BITS(5) + 1;
+ DROPBITS(5);
+ state->ncode = BITS(4) + 4;
+ DROPBITS(4);
+#ifndef PKZIP_BUG_WORKAROUND
+ if (state->nlen > 286 || state->ndist > 30) {
+ strm->msg = (char *)"too many length or distance symbols";
+ state->mode = BAD;
+ break;
+ }
+#endif
+ Tracev((stderr, "inflate: table sizes ok\n"));
+
+ /* get code length code lengths (not a typo) */
+ state->have = 0;
+ while (state->have < state->ncode) {
+ NEEDBITS(3);
+ state->lens[order[state->have++]] = (unsigned short)BITS(3);
+ DROPBITS(3);
+ }
+ while (state->have < 19)
+ state->lens[order[state->have++]] = 0;
+ state->next = state->codes;
+ state->lencode = (code const FAR *)(state->next);
+ state->lenbits = 7;
+ ret = inflate_table(CODES, state->lens, 19, &(state->next),
+ &(state->lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid code lengths set";
+ state->mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: code lengths ok\n"));
+
+ /* get length and distance code code lengths */
+ state->have = 0;
+ while (state->have < state->nlen + state->ndist) {
+ for (;;) {
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.val < 16) {
+ DROPBITS(here.bits);
+ state->lens[state->have++] = here.val;
+ }
+ else {
+ if (here.val == 16) {
+ NEEDBITS(here.bits + 2);
+ DROPBITS(here.bits);
+ if (state->have == 0) {
+ strm->msg = (char *)"invalid bit length repeat";
+ state->mode = BAD;
+ break;
+ }
+ len = (unsigned)(state->lens[state->have - 1]);
+ copy = 3 + BITS(2);
+ DROPBITS(2);
+ }
+ else if (here.val == 17) {
+ NEEDBITS(here.bits + 3);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 3 + BITS(3);
+ DROPBITS(3);
+ }
+ else {
+ NEEDBITS(here.bits + 7);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 11 + BITS(7);
+ DROPBITS(7);
+ }
+ if (state->have + copy > state->nlen + state->ndist) {
+ strm->msg = (char *)"invalid bit length repeat";
+ state->mode = BAD;
+ break;
+ }
+ while (copy--)
+ state->lens[state->have++] = (unsigned short)len;
+ }
+ }
+
+ /* handle error breaks in while */
+ if (state->mode == BAD) break;
+
+ /* check for end-of-block code (better have one) */
+ if (state->lens[256] == 0) {
+ strm->msg = (char *)"invalid code -- missing end-of-block";
+ state->mode = BAD;
+ break;
+ }
+
+ /* build code tables -- note: do not change the lenbits or distbits
+ values here (9 and 6) without reading the comments in inftrees.h
+ concerning the ENOUGH constants, which depend on those values */
+ state->next = state->codes;
+ state->lencode = (code const FAR *)(state->next);
+ state->lenbits = 9;
+ ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+ &(state->lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid literal/lengths set";
+ state->mode = BAD;
+ break;
+ }
+ state->distcode = (code const FAR *)(state->next);
+ state->distbits = 6;
+ ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+ &(state->next), &(state->distbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid distances set";
+ state->mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: codes ok\n"));
+ state->mode = LEN;
+ /* fallthrough */
+
+ case LEN:
+ /* use inflate_fast() if we have enough input and output */
+ if (have >= 6 && left >= 258) {
+ RESTORE();
+ if (state->whave < state->wsize)
+ state->whave = state->wsize - left;
+ inflate_fast(strm, state->wsize);
+ LOAD();
+ break;
+ }
+
+ /* get a literal, length, or end-of-block code */
+ for (;;) {
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.op && (here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = state->lencode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ }
+ DROPBITS(here.bits);
+ state->length = (unsigned)here.val;
+
+ /* process literal */
+ if (here.op == 0) {
+ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", here.val));
+ ROOM();
+ *put++ = (unsigned char)(state->length);
+ left--;
+ state->mode = LEN;
+ break;
+ }
+
+ /* process end of block */
+ if (here.op & 32) {
+ Tracevv((stderr, "inflate: end of block\n"));
+ state->mode = TYPE;
+ break;
+ }
+
+ /* invalid code */
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid literal/length code";
+ state->mode = BAD;
+ break;
+ }
+
+ /* length code -- get extra bits, if any */
+ state->extra = (unsigned)(here.op) & 15;
+ if (state->extra != 0) {
+ NEEDBITS(state->extra);
+ state->length += BITS(state->extra);
+ DROPBITS(state->extra);
+ }
+ Tracevv((stderr, "inflate: length %u\n", state->length));
+
+ /* get distance code */
+ for (;;) {
+ here = state->distcode[BITS(state->distbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if ((here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = state->distcode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ }
+ DROPBITS(here.bits);
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid distance code";
+ state->mode = BAD;
+ break;
+ }
+ state->offset = (unsigned)here.val;
+
+ /* get distance extra bits, if any */
+ state->extra = (unsigned)(here.op) & 15;
+ if (state->extra != 0) {
+ NEEDBITS(state->extra);
+ state->offset += BITS(state->extra);
+ DROPBITS(state->extra);
+ }
+ if (state->offset > state->wsize - (state->whave < state->wsize ?
+ left : 0)) {
+ strm->msg = (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+ Tracevv((stderr, "inflate: distance %u\n", state->offset));
+
+ /* copy match from window to output */
+ do {
+ ROOM();
+ copy = state->wsize - state->offset;
+ if (copy < left) {
+ from = put + copy;
+ copy = left - copy;
+ }
+ else {
+ from = put - state->offset;
+ copy = left;
+ }
+ if (copy > state->length) copy = state->length;
+ state->length -= copy;
+ left -= copy;
+ do {
+ *put++ = *from++;
+ } while (--copy);
+ } while (state->length != 0);
+ break;
+
+ case DONE:
+ /* inflate stream terminated properly -- write leftover output */
+ ret = Z_STREAM_END;
+ if (left < state->wsize) {
+ if (out(out_desc, state->window, state->wsize - left))
+ ret = Z_BUF_ERROR;
+ }
+ goto inf_leave;
+
+ case BAD:
+ ret = Z_DATA_ERROR;
+ goto inf_leave;
+
+ default: /* can't happen, but makes compilers happy */
+ ret = Z_STREAM_ERROR;
+ goto inf_leave;
+ }
+
+ /* Return unused input */
+ inf_leave:
+ strm->next_in = next;
+ strm->avail_in = have;
+ return ret;
+}
+
+int ZEXPORT inflateBackEnd(
+ z_streamp strm)
+{
+ if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0)
+ return Z_STREAM_ERROR;
+ ZFREE(strm, strm->state);
+ strm->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
diff --git a/freetype/src/gzip/infblock.c b/freetype/src/gzip/infblock.c
deleted file mode 100644
index 2b4f0c2b..00000000
--- a/freetype/src/gzip/infblock.c
+++ /dev/null
@@ -1,392 +0,0 @@
-/* infblock.c -- interpret and process block types to last block
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "infblock.h"
-#include "inftrees.h"
-#include "infcodes.h"
-#include "infutil.h"
-
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-/* Table for deflate from PKZIP's appnote.txt. */
-local const uInt border[] = { /* Order of the bit length code lengths */
- 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
-
-/*
- Notes beyond the 1.93a appnote.txt:
-
- 1. Distance pointers never point before the beginning of the output
- stream.
- 2. Distance pointers can point back across blocks, up to 32k away.
- 3. There is an implied maximum of 7 bits for the bit length table and
- 15 bits for the actual data.
- 4. If only one code exists, then it is encoded using one bit. (Zero
- would be more efficient, but perhaps a little confusing.) If two
- codes exist, they are coded using one bit each (0 and 1).
- 5. There is no way of sending zero distance codes--a dummy must be
- sent if there are none. (History: a pre 2.0 version of PKZIP would
- store blocks with no distance codes, but this was discovered to be
- too harsh a criterion.) Valid only for 1.93a. 2.04c does allow
- zero distance codes, which is sent as one code of zero bits in
- length.
- 6. There are up to 286 literal/length codes. Code 256 represents the
- end-of-block. Note however that the static length tree defines
- 288 codes just to fill out the Huffman codes. Codes 286 and 287
- cannot be used though, since there is no length base or extra bits
- defined for them. Similarily, there are up to 30 distance codes.
- However, static trees define 32 codes (all 5 bits) to fill out the
- Huffman codes, but the last two had better not show up in the data.
- 7. Unzip can check dynamic Huffman blocks for complete code sets.
- The exception is that a single code would not be complete (see #4).
- 8. The five bits following the block type is really the number of
- literal codes sent minus 257.
- 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits
- (1+6+6). Therefore, to output three times the length, you output
- three codes (1+1+1), whereas to output four times the same length,
- you only need two codes (1+3). Hmm.
- 10. In the tree reconstruction algorithm, Code = Code + Increment
- only if BitLength(i) is not zero. (Pretty obvious.)
- 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19)
- 12. Note: length code 284 can represent 227-258, but length code 285
- really is 258. The last length deserves its own, short code
- since it gets used a lot in very redundant files. The length
- 258 is special since 258 - 3 (the min match length) is 255.
- 13. The literal/length and distance code bit lengths are read as a
- single stream of lengths. It is possible (and advantageous) for
- a repeat code (16, 17, or 18) to go across the boundary between
- the two sets of lengths.
- */
-
-
-local void inflate_blocks_reset( /* s, z, c) */
-inflate_blocks_statef *s,
-z_streamp z,
-uLongf *c )
-{
- if (c != Z_NULL)
- *c = s->check;
- if (s->mode == BTREE || s->mode == DTREE)
- ZFREE(z, s->sub.trees.blens);
- if (s->mode == CODES)
- inflate_codes_free(s->sub.decode.codes, z);
- s->mode = TYPE;
- s->bitk = 0;
- s->bitb = 0;
- s->read = s->write = s->window;
- if (s->checkfn != Z_NULL)
- z->adler = s->check = (*s->checkfn)(0L, (const Bytef *)Z_NULL, 0);
- Tracev((stderr, "inflate: blocks reset\n"));
-}
-
-
-local inflate_blocks_statef *inflate_blocks_new( /* z, c, w) */
-z_streamp z,
-check_func c,
-uInt w )
-{
- inflate_blocks_statef *s;
-
- if ((s = (inflate_blocks_statef *)ZALLOC
- (z,1,sizeof(struct inflate_blocks_state))) == Z_NULL)
- return s;
- if ((s->hufts =
- (inflate_huft *)ZALLOC(z, sizeof(inflate_huft), MANY)) == Z_NULL)
- {
- ZFREE(z, s);
- return Z_NULL;
- }
- if ((s->window = (Bytef *)ZALLOC(z, 1, w)) == Z_NULL)
- {
- ZFREE(z, s->hufts);
- ZFREE(z, s);
- return Z_NULL;
- }
- s->end = s->window + w;
- s->checkfn = c;
- s->mode = TYPE;
- Tracev((stderr, "inflate: blocks allocated\n"));
- inflate_blocks_reset(s, z, Z_NULL);
- return s;
-}
-
-
-local int inflate_blocks( /* s, z, r) */
-inflate_blocks_statef *s,
-z_streamp z,
-int r )
-{
- uInt t; /* temporary storage */
- uLong b; /* bit buffer */
- uInt k; /* bits in bit buffer */
- Bytef *p; /* input data pointer */
- uInt n; /* bytes available there */
- Bytef *q; /* output window write pointer */
- uInt m; /* bytes to end of window or read pointer */
-
- /* copy input/output information to locals (UPDATE macro restores) */
- LOAD
-
- /* process input based on current state */
- while (1) switch (s->mode)
- {
- case TYPE:
- NEEDBITS(3)
- t = (uInt)b & 7;
- s->last = t & 1;
- switch (t >> 1)
- {
- case 0: /* stored */
- Tracev((stderr, "inflate: stored block%s\n",
- s->last ? " (last)" : ""));
- DUMPBITS(3)
- t = k & 7; /* go to byte boundary */
- DUMPBITS(t)
- s->mode = LENS; /* get length of stored block */
- break;
- case 1: /* fixed */
- Tracev((stderr, "inflate: fixed codes block%s\n",
- s->last ? " (last)" : ""));
- {
- uInt bl, bd;
- inflate_huft *tl, *td;
-
- inflate_trees_fixed(&bl, &bd, (const inflate_huft**)&tl,
- (const inflate_huft**)&td, z);
- s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z);
- if (s->sub.decode.codes == Z_NULL)
- {
- r = Z_MEM_ERROR;
- LEAVE
- }
- }
- DUMPBITS(3)
- s->mode = CODES;
- break;
- case 2: /* dynamic */
- Tracev((stderr, "inflate: dynamic codes block%s\n",
- s->last ? " (last)" : ""));
- DUMPBITS(3)
- s->mode = TABLE;
- break;
- case 3: /* illegal */
- DUMPBITS(3)
- s->mode = BAD;
- z->msg = (char*)"invalid block type";
- r = Z_DATA_ERROR;
- LEAVE
- }
- break;
- case LENS:
- NEEDBITS(32)
- if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
- {
- s->mode = BAD;
- z->msg = (char*)"invalid stored block lengths";
- r = Z_DATA_ERROR;
- LEAVE
- }
- s->sub.left = (uInt)b & 0xffff;
- b = k = 0; /* dump bits */
- Tracev((stderr, "inflate: stored length %u\n", s->sub.left));
- s->mode = s->sub.left ? STORED : (s->last ? DRY : TYPE);
- break;
- case STORED:
- if (n == 0)
- LEAVE
- NEEDOUT
- t = s->sub.left;
- if (t > n) t = n;
- if (t > m) t = m;
- zmemcpy(q, p, t);
- p += t; n -= t;
- q += t; m -= t;
- if ((s->sub.left -= t) != 0)
- break;
- Tracev((stderr, "inflate: stored end, %lu total out\n",
- z->total_out + (q >= s->read ? q - s->read :
- (s->end - s->read) + (q - s->window))));
- s->mode = s->last ? DRY : TYPE;
- break;
- case TABLE:
- NEEDBITS(14)
- s->sub.trees.table = t = (uInt)b & 0x3fff;
-#ifndef PKZIP_BUG_WORKAROUND
- if ((t & 0x1f) > 29 || ((t >> 5) & 0x1f) > 29)
- {
- s->mode = BAD;
- z->msg = (char*)"too many length or distance symbols";
- r = Z_DATA_ERROR;
- LEAVE
- }
-#endif
- t = 258 + (t & 0x1f) + ((t >> 5) & 0x1f);
- if ((s->sub.trees.blens = (uIntf*)ZALLOC(z, t, sizeof(uInt))) == Z_NULL)
- {
- r = Z_MEM_ERROR;
- LEAVE
- }
- DUMPBITS(14)
- s->sub.trees.index = 0;
- Tracev((stderr, "inflate: table sizes ok\n"));
- s->mode = BTREE;
- /* fall through */
- case BTREE:
- while (s->sub.trees.index < 4 + (s->sub.trees.table >> 10))
- {
- NEEDBITS(3)
- s->sub.trees.blens[border[s->sub.trees.index++]] = (uInt)b & 7;
- DUMPBITS(3)
- }
- while (s->sub.trees.index < 19)
- s->sub.trees.blens[border[s->sub.trees.index++]] = 0;
- s->sub.trees.bb = 7;
- t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb,
- &s->sub.trees.tb, s->hufts, z);
- if (t != Z_OK)
- {
- r = t;
- if (r == Z_DATA_ERROR)
- {
- ZFREE(z, s->sub.trees.blens);
- s->mode = BAD;
- }
- LEAVE
- }
- s->sub.trees.index = 0;
- Tracev((stderr, "inflate: bits tree ok\n"));
- s->mode = DTREE;
- /* fall through */
- case DTREE:
- while (t = s->sub.trees.table,
- s->sub.trees.index < 258 + (t & 0x1f) + ((t >> 5) & 0x1f))
- {
- inflate_huft *h;
- uInt i, j, c;
-
- t = s->sub.trees.bb;
- NEEDBITS(t)
- h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]);
- t = h->bits;
- c = h->base;
- if (c < 16)
- {
- DUMPBITS(t)
- s->sub.trees.blens[s->sub.trees.index++] = c;
- }
- else /* c == 16..18 */
- {
- i = c == 18 ? 7 : c - 14;
- j = c == 18 ? 11 : 3;
- NEEDBITS(t + i)
- DUMPBITS(t)
- j += (uInt)b & inflate_mask[i];
- DUMPBITS(i)
- i = s->sub.trees.index;
- t = s->sub.trees.table;
- if (i + j > 258 + (t & 0x1f) + ((t >> 5) & 0x1f) ||
- (c == 16 && i < 1))
- {
- ZFREE(z, s->sub.trees.blens);
- s->mode = BAD;
- z->msg = (char*)"invalid bit length repeat";
- r = Z_DATA_ERROR;
- LEAVE
- }
- c = c == 16 ? s->sub.trees.blens[i - 1] : 0;
- do {
- s->sub.trees.blens[i++] = c;
- } while (--j);
- s->sub.trees.index = i;
- }
- }
- s->sub.trees.tb = Z_NULL;
- {
- uInt bl, bd;
- inflate_huft *tl, *td;
- inflate_codes_statef *c;
-
- bl = 9; /* must be <= 9 for lookahead assumptions */
- bd = 6; /* must be <= 9 for lookahead assumptions */
- t = s->sub.trees.table;
- t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f),
- s->sub.trees.blens, &bl, &bd, &tl, &td,
- s->hufts, z);
- if (t != Z_OK)
- {
- if (t == (uInt)Z_DATA_ERROR)
- {
- ZFREE(z, s->sub.trees.blens);
- s->mode = BAD;
- }
- r = t;
- LEAVE
- }
- Tracev((stderr, "inflate: trees ok\n"));
- if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL)
- {
- r = Z_MEM_ERROR;
- LEAVE
- }
- s->sub.decode.codes = c;
- }
- ZFREE(z, s->sub.trees.blens);
- s->mode = CODES;
- /* fall through */
- case CODES:
- UPDATE
- if ((r = inflate_codes(s, z, r)) != Z_STREAM_END)
- return inflate_flush(s, z, r);
- r = Z_OK;
- inflate_codes_free(s->sub.decode.codes, z);
- LOAD
- Tracev((stderr, "inflate: codes end, %lu total out\n",
- z->total_out + (q >= s->read ? q - s->read :
- (s->end - s->read) + (q - s->window))));
- if (!s->last)
- {
- s->mode = TYPE;
- break;
- }
- s->mode = DRY;
- /* fall through */
- case DRY:
- FLUSH
- if (s->read != s->write)
- LEAVE
- s->mode = DONE;
- /* fall through */
- case DONE:
- r = Z_STREAM_END;
- LEAVE
- case BAD:
- r = Z_DATA_ERROR;
- LEAVE
- default:
- r = Z_STREAM_ERROR;
- LEAVE
- }
-#ifdef NEED_DUMMY_RETURN
- return 0;
-#endif
-}
-
-
-local int inflate_blocks_free( /* s, z) */
-inflate_blocks_statef *s,
-z_streamp z )
-{
- inflate_blocks_reset(s, z, Z_NULL);
- ZFREE(z, s->window);
- ZFREE(z, s->hufts);
- ZFREE(z, s);
- Tracev((stderr, "inflate: blocks freed\n"));
- return Z_OK;
-}
-
-
diff --git a/freetype/src/gzip/infblock.h b/freetype/src/gzip/infblock.h
deleted file mode 100644
index c2535a1e..00000000
--- a/freetype/src/gzip/infblock.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* infblock.h -- header to use infblock.c
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-#ifndef _INFBLOCK_H
-#define _INFBLOCK_H
-
-struct inflate_blocks_state;
-typedef struct inflate_blocks_state FAR inflate_blocks_statef;
-
-local inflate_blocks_statef * inflate_blocks_new OF((
- z_streamp z,
- check_func c, /* check function */
- uInt w)); /* window size */
-
-local int inflate_blocks OF((
- inflate_blocks_statef *,
- z_streamp ,
- int)); /* initial return code */
-
-local void inflate_blocks_reset OF((
- inflate_blocks_statef *,
- z_streamp ,
- uLongf *)); /* check value on output */
-
-local int inflate_blocks_free OF((
- inflate_blocks_statef *,
- z_streamp));
-
-#endif /* _INFBLOCK_H */
diff --git a/freetype/src/gzip/infcodes.c b/freetype/src/gzip/infcodes.c
deleted file mode 100644
index ba306549..00000000
--- a/freetype/src/gzip/infcodes.c
+++ /dev/null
@@ -1,254 +0,0 @@
-/* infcodes.c -- process literals and length/distance pairs
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "infblock.h"
-#include "infcodes.h"
-#include "infutil.h"
-
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-typedef enum { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
- START, /* x: set up for LEN */
- LEN, /* i: get length/literal/eob next */
- LENEXT, /* i: getting length extra (have base) */
- DIST, /* i: get distance next */
- DISTEXT, /* i: getting distance extra */
- COPY, /* o: copying bytes in window, waiting for space */
- LIT, /* o: got literal, waiting for output space */
- WASH, /* o: got eob, possibly still output waiting */
- END, /* x: got eob and all data flushed */
- BADCODE} /* x: got error */
-inflate_codes_mode;
-
-/* inflate codes private state */
-struct inflate_codes_state {
-
- /* mode */
- inflate_codes_mode mode; /* current inflate_codes mode */
-
- /* mode dependent information */
- uInt len;
- union {
- struct {
- inflate_huft *tree; /* pointer into tree */
- uInt need; /* bits needed */
- } code; /* if LEN or DIST, where in tree */
- uInt lit; /* if LIT, literal */
- struct {
- uInt get; /* bits to get for extra */
- uInt dist; /* distance back to copy from */
- } copy; /* if EXT or COPY, where and how much */
- } sub; /* submode */
-
- /* mode independent information */
- Byte lbits; /* ltree bits decoded per branch */
- Byte dbits; /* dtree bits decoder per branch */
- inflate_huft *ltree; /* literal/length/eob tree */
- inflate_huft *dtree; /* distance tree */
-
-};
-
-
-local inflate_codes_statef *inflate_codes_new( /* bl, bd, tl, td, z) */
-uInt bl, uInt bd,
-inflate_huft *tl,
-inflate_huft *td, /* need separate declaration for Borland C++ */
-z_streamp z )
-{
- inflate_codes_statef *c;
-
- if ((c = (inflate_codes_statef *)
- ZALLOC(z,1,sizeof(struct inflate_codes_state))) != Z_NULL)
- {
- c->mode = START;
- c->lbits = (Byte)bl;
- c->dbits = (Byte)bd;
- c->ltree = tl;
- c->dtree = td;
- Tracev((stderr, "inflate: codes new\n"));
- }
- return c;
-}
-
-
-local int inflate_codes( /* s, z, r) */
-inflate_blocks_statef *s,
-z_streamp z,
-int r )
-{
- uInt j; /* temporary storage */
- inflate_huft *t; /* temporary pointer */
- uInt e; /* extra bits or operation */
- uLong b; /* bit buffer */
- uInt k; /* bits in bit buffer */
- Bytef *p; /* input data pointer */
- uInt n; /* bytes available there */
- Bytef *q; /* output window write pointer */
- uInt m; /* bytes to end of window or read pointer */
- Bytef *f; /* pointer to copy strings from */
- inflate_codes_statef *c = s->sub.decode.codes; /* codes state */
-
- /* copy input/output information to locals (UPDATE macro restores) */
- LOAD
-
- /* process input and output based on current state */
- while (1) switch (c->mode)
- { /* waiting for "i:"=input, "o:"=output, "x:"=nothing */
- case START: /* x: set up for LEN */
-#ifndef SLOW
- if (m >= 258 && n >= 10)
- {
- UPDATE
- r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z);
- LOAD
- if (r != Z_OK)
- {
- c->mode = r == Z_STREAM_END ? WASH : BADCODE;
- break;
- }
- }
-#endif /* !SLOW */
- c->sub.code.need = c->lbits;
- c->sub.code.tree = c->ltree;
- c->mode = LEN;
- /* fall through */
- case LEN: /* i: get length/literal/eob next */
- j = c->sub.code.need;
- NEEDBITS(j)
- t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
- DUMPBITS(t->bits)
- e = (uInt)(t->exop);
- if (e == 0) /* literal */
- {
- c->sub.lit = t->base;
- Tracevv((stderr, t->base >= 0x20 && t->base < 0x7f ?
- "inflate: literal '%c'\n" :
- "inflate: literal 0x%02x\n", t->base));
- c->mode = LIT;
- break;
- }
- if (e & 16) /* length */
- {
- c->sub.copy.get = e & 15;
- c->len = t->base;
- c->mode = LENEXT;
- break;
- }
- if ((e & 64) == 0) /* next table */
- {
- c->sub.code.need = e;
- c->sub.code.tree = t + t->base;
- break;
- }
- if (e & 32) /* end of block */
- {
- Tracevv((stderr, "inflate: end of block\n"));
- c->mode = WASH;
- break;
- }
- c->mode = BADCODE; /* invalid code */
- z->msg = (char*)"invalid literal/length code";
- r = Z_DATA_ERROR;
- LEAVE
- case LENEXT: /* i: getting length extra (have base) */
- j = c->sub.copy.get;
- NEEDBITS(j)
- c->len += (uInt)b & inflate_mask[j];
- DUMPBITS(j)
- c->sub.code.need = c->dbits;
- c->sub.code.tree = c->dtree;
- Tracevv((stderr, "inflate: length %u\n", c->len));
- c->mode = DIST;
- /* fall through */
- case DIST: /* i: get distance next */
- j = c->sub.code.need;
- NEEDBITS(j)
- t = c->sub.code.tree + ((uInt)b & inflate_mask[j]);
- DUMPBITS(t->bits)
- e = (uInt)(t->exop);
- if (e & 16) /* distance */
- {
- c->sub.copy.get = e & 15;
- c->sub.copy.dist = t->base;
- c->mode = DISTEXT;
- break;
- }
- if ((e & 64) == 0) /* next table */
- {
- c->sub.code.need = e;
- c->sub.code.tree = t + t->base;
- break;
- }
- c->mode = BADCODE; /* invalid code */
- z->msg = (char*)"invalid distance code";
- r = Z_DATA_ERROR;
- LEAVE
- case DISTEXT: /* i: getting distance extra */
- j = c->sub.copy.get;
- NEEDBITS(j)
- c->sub.copy.dist += (uInt)b & inflate_mask[j];
- DUMPBITS(j)
- Tracevv((stderr, "inflate: distance %u\n", c->sub.copy.dist));
- c->mode = COPY;
- /* fall through */
- case COPY: /* o: copying bytes in window, waiting for space */
- f = q - c->sub.copy.dist;
- while (f < s->window) /* modulo window size-"while" instead */
- f += s->end - s->window; /* of "if" handles invalid distances */
- while (c->len)
- {
- NEEDOUT
- OUTBYTE(*f++)
- if (f == s->end)
- f = s->window;
- c->len--;
- }
- c->mode = START;
- break;
- case LIT: /* o: got literal, waiting for output space */
- NEEDOUT
- OUTBYTE(c->sub.lit)
- c->mode = START;
- break;
- case WASH: /* o: got eob, possibly more output */
- if (k > 7) /* return unused byte, if any */
- {
- Assert(k < 16, "inflate_codes grabbed too many bytes")
- k -= 8;
- n++;
- p--; /* can always return one */
- }
- FLUSH
- if (s->read != s->write)
- LEAVE
- c->mode = END;
- /* fall through */
- case END:
- r = Z_STREAM_END;
- LEAVE
- case BADCODE: /* x: got error */
- r = Z_DATA_ERROR;
- LEAVE
- default:
- r = Z_STREAM_ERROR;
- LEAVE
- }
-#ifdef NEED_DUMMY_RETURN
- return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
-#endif
-}
-
-
-local void inflate_codes_free( /* c, z) */
-inflate_codes_statef *c,
-z_streamp z )
-{
- ZFREE(z, c);
- Tracev((stderr, "inflate: codes free\n"));
-}
diff --git a/freetype/src/gzip/infcodes.h b/freetype/src/gzip/infcodes.h
deleted file mode 100644
index 154d7f89..00000000
--- a/freetype/src/gzip/infcodes.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* infcodes.h -- header to use infcodes.c
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-#ifndef _INFCODES_H
-#define _INFCODES_H
-
-struct inflate_codes_state;
-typedef struct inflate_codes_state FAR inflate_codes_statef;
-
-local inflate_codes_statef *inflate_codes_new OF((
- uInt, uInt,
- inflate_huft *, inflate_huft *,
- z_streamp ));
-
-local int inflate_codes OF((
- inflate_blocks_statef *,
- z_streamp ,
- int));
-
-local void inflate_codes_free OF((
- inflate_codes_statef *,
- z_streamp ));
-
-#endif /* _INFCODES_H */
diff --git a/freetype/src/gzip/inffast.c b/freetype/src/gzip/inffast.c
new file mode 100644
index 00000000..809737b1
--- /dev/null
+++ b/freetype/src/gzip/inffast.c
@@ -0,0 +1,323 @@
+/* inffast.c -- fast decoding
+ * Copyright (C) 1995-2017 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#include "zutil.h"
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifdef ASMINF
+# pragma message("Assembler code may have bugs -- use at your own risk")
+#else
+
+/*
+ Decode literal, length, and distance codes and write out the resulting
+ literal and match bytes until either not enough input or output is
+ available, an end-of-block is encountered, or a data error is encountered.
+ When large enough input and output buffers are supplied to inflate(), for
+ example, a 16K input buffer and a 64K output buffer, more than 95% of the
+ inflate execution time is spent in this routine.
+
+ Entry assumptions:
+
+ state->mode == LEN
+ strm->avail_in >= 6
+ strm->avail_out >= 258
+ start >= strm->avail_out
+ state->bits < 8
+
+ On return, state->mode is one of:
+
+ LEN -- ran out of enough output space or enough available input
+ TYPE -- reached end of block code, inflate() to interpret next block
+ BAD -- error in block data
+
+ Notes:
+
+ - The maximum input bits used by a length/distance pair is 15 bits for the
+ length code, 5 bits for the length extra, 15 bits for the distance code,
+ and 13 bits for the distance extra. This totals 48 bits, or six bytes.
+ Therefore if strm->avail_in >= 6, then there is enough input to avoid
+ checking for available input while decoding.
+
+ - The maximum bytes that a single length/distance pair can output is 258
+ bytes, which is the maximum length that can be coded. inflate_fast()
+ requires strm->avail_out >= 258 for each loop to avoid checking for
+ output space.
+ */
+void ZLIB_INTERNAL inflate_fast(
+ z_streamp strm,
+ unsigned start)
+{
+ struct inflate_state FAR *state;
+ z_const unsigned char FAR *in; /* local strm->next_in */
+ z_const unsigned char FAR *last; /* have enough input while in < last */
+ unsigned char FAR *out; /* local strm->next_out */
+ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */
+ unsigned char FAR *end; /* while out < end, enough space available */
+#ifdef INFLATE_STRICT
+ unsigned dmax; /* maximum distance from zlib header */
+#endif
+ unsigned wsize; /* window size or zero if not using window */
+ unsigned whave; /* valid bytes in the window */
+ unsigned wnext; /* window write index */
+ unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */
+ unsigned long hold; /* local strm->hold */
+ unsigned bits; /* local strm->bits */
+ code const FAR *lcode; /* local strm->lencode */
+ code const FAR *dcode; /* local strm->distcode */
+ unsigned lmask; /* mask for first level of length codes */
+ unsigned dmask; /* mask for first level of distance codes */
+ code const *here; /* retrieved table entry */
+ unsigned op; /* code bits, operation, extra bits, or */
+ /* window position, window bytes to copy */
+ unsigned len; /* match length, unused bytes */
+ unsigned dist; /* match distance */
+ unsigned char FAR *from; /* where to copy match from */
+
+ /* copy state to local variables */
+ state = (struct inflate_state FAR *)strm->state;
+ in = strm->next_in;
+ last = in + (strm->avail_in - 5);
+ out = strm->next_out;
+ beg = out - (start - strm->avail_out);
+ end = out + (strm->avail_out - 257);
+#ifdef INFLATE_STRICT
+ dmax = state->dmax;
+#endif
+ wsize = state->wsize;
+ whave = state->whave;
+ wnext = state->wnext;
+ window = state->window;
+ hold = state->hold;
+ bits = state->bits;
+ lcode = state->lencode;
+ dcode = state->distcode;
+ lmask = (1U << state->lenbits) - 1;
+ dmask = (1U << state->distbits) - 1;
+
+ /* decode literals and length/distances until end-of-block or not enough
+ input data or output space */
+ do {
+ if (bits < 15) {
+ hold += (unsigned long)(*in++) << bits;
+ bits += 8;
+ hold += (unsigned long)(*in++) << bits;
+ bits += 8;
+ }
+ here = lcode + (hold & lmask);
+ dolen:
+ op = (unsigned)(here->bits);
+ hold >>= op;
+ bits -= op;
+ op = (unsigned)(here->op);
+ if (op == 0) { /* literal */
+ Tracevv((stderr, here->val >= 0x20 && here->val < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", here->val));
+ *out++ = (unsigned char)(here->val);
+ }
+ else if (op & 16) { /* length base */
+ len = (unsigned)(here->val);
+ op &= 15; /* number of extra bits */
+ if (op) {
+ if (bits < op) {
+ hold += (unsigned long)(*in++) << bits;
+ bits += 8;
+ }
+ len += (unsigned)hold & ((1U << op) - 1);
+ hold >>= op;
+ bits -= op;
+ }
+ Tracevv((stderr, "inflate: length %u\n", len));
+ if (bits < 15) {
+ hold += (unsigned long)(*in++) << bits;
+ bits += 8;
+ hold += (unsigned long)(*in++) << bits;
+ bits += 8;
+ }
+ here = dcode + (hold & dmask);
+ dodist:
+ op = (unsigned)(here->bits);
+ hold >>= op;
+ bits -= op;
+ op = (unsigned)(here->op);
+ if (op & 16) { /* distance base */
+ dist = (unsigned)(here->val);
+ op &= 15; /* number of extra bits */
+ if (bits < op) {
+ hold += (unsigned long)(*in++) << bits;
+ bits += 8;
+ if (bits < op) {
+ hold += (unsigned long)(*in++) << bits;
+ bits += 8;
+ }
+ }
+ dist += (unsigned)hold & ((1U << op) - 1);
+#ifdef INFLATE_STRICT
+ if (dist > dmax) {
+ strm->msg = (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#endif
+ hold >>= op;
+ bits -= op;
+ Tracevv((stderr, "inflate: distance %u\n", dist));
+ op = (unsigned)(out - beg); /* max distance in output */
+ if (dist > op) { /* see if copy from window */
+ op = dist - op; /* distance back in window */
+ if (op > whave) {
+ if (state->sane) {
+ strm->msg =
+ (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ if (len <= op - whave) {
+ do {
+ *out++ = 0;
+ } while (--len);
+ continue;
+ }
+ len -= op - whave;
+ do {
+ *out++ = 0;
+ } while (--op > whave);
+ if (op == 0) {
+ from = out - dist;
+ do {
+ *out++ = *from++;
+ } while (--len);
+ continue;
+ }
+#endif
+ }
+ from = window;
+ if (wnext == 0) { /* very common case */
+ from += wsize - op;
+ if (op < len) { /* some from window */
+ len -= op;
+ do {
+ *out++ = *from++;
+ } while (--op);
+ from = out - dist; /* rest from output */
+ }
+ }
+ else if (wnext < op) { /* wrap around window */
+ from += wsize + wnext - op;
+ op -= wnext;
+ if (op < len) { /* some from end of window */
+ len -= op;
+ do {
+ *out++ = *from++;
+ } while (--op);
+ from = window;
+ if (wnext < len) { /* some from start of window */
+ op = wnext;
+ len -= op;
+ do {
+ *out++ = *from++;
+ } while (--op);
+ from = out - dist; /* rest from output */
+ }
+ }
+ }
+ else { /* contiguous in window */
+ from += wnext - op;
+ if (op < len) { /* some from window */
+ len -= op;
+ do {
+ *out++ = *from++;
+ } while (--op);
+ from = out - dist; /* rest from output */
+ }
+ }
+ while (len > 2) {
+ *out++ = *from++;
+ *out++ = *from++;
+ *out++ = *from++;
+ len -= 3;
+ }
+ if (len) {
+ *out++ = *from++;
+ if (len > 1)
+ *out++ = *from++;
+ }
+ }
+ else {
+ from = out - dist; /* copy direct from output */
+ do { /* minimum length is three */
+ *out++ = *from++;
+ *out++ = *from++;
+ *out++ = *from++;
+ len -= 3;
+ } while (len > 2);
+ if (len) {
+ *out++ = *from++;
+ if (len > 1)
+ *out++ = *from++;
+ }
+ }
+ }
+ else if ((op & 64) == 0) { /* 2nd level distance code */
+ here = dcode + here->val + (hold & ((1U << op) - 1));
+ goto dodist;
+ }
+ else {
+ strm->msg = (char *)"invalid distance code";
+ state->mode = BAD;
+ break;
+ }
+ }
+ else if ((op & 64) == 0) { /* 2nd level length code */
+ here = lcode + here->val + (hold & ((1U << op) - 1));
+ goto dolen;
+ }
+ else if (op & 32) { /* end-of-block */
+ Tracevv((stderr, "inflate: end of block\n"));
+ state->mode = TYPE;
+ break;
+ }
+ else {
+ strm->msg = (char *)"invalid literal/length code";
+ state->mode = BAD;
+ break;
+ }
+ } while (in < last && out < end);
+
+ /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
+ len = bits >> 3;
+ in -= len;
+ bits -= len << 3;
+ hold &= (1U << bits) - 1;
+
+ /* update state and return */
+ strm->next_in = in;
+ strm->next_out = out;
+ strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last));
+ strm->avail_out = (unsigned)(out < end ?
+ 257 + (end - out) : 257 - (out - end));
+ state->hold = hold;
+ state->bits = bits;
+ return;
+}
+
+/*
+ inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe):
+ - Using bit fields for code structure
+ - Different op definition to avoid & for extra bits (do & for table bits)
+ - Three separate decoding do-loops for direct, window, and wnext == 0
+ - Special case for distance > 1 copies to do overlapped load and store copy
+ - Explicit branch predictions (based on measured branch probabilities)
+ - Deferring match copy and interspersed it with decoding subsequent codes
+ - Swapping literal/length else
+ - Swapping window/direct else
+ - Larger unrolled copy loops (three is about right)
+ - Moving len -= 3 statement into middle of loop
+ */
+
+#endif /* !ASMINF */
diff --git a/freetype/src/gzip/inffast.h b/freetype/src/gzip/inffast.h
new file mode 100644
index 00000000..e5c1aa4c
--- /dev/null
+++ b/freetype/src/gzip/inffast.h
@@ -0,0 +1,11 @@
+/* inffast.h -- header to use inffast.c
+ * Copyright (C) 1995-2003, 2010 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start));
diff --git a/freetype/src/gzip/inffixed.h b/freetype/src/gzip/inffixed.h
index 4d4760ea..d6283277 100644
--- a/freetype/src/gzip/inffixed.h
+++ b/freetype/src/gzip/inffixed.h
@@ -1,151 +1,94 @@
-/* inffixed.h -- table for decoding fixed codes
- * Generated automatically by the maketree.c program
- */
+ /* inffixed.h -- table for decoding fixed codes
+ * Generated automatically by makefixed().
+ */
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
+ /* WARNING: this file should *not* be used by applications.
+ It is part of the implementation of this library and is
+ subject to change. Applications should only use zlib.h.
+ */
-local const uInt fixed_bl = 9;
-local const uInt fixed_bd = 5;
-local const inflate_huft fixed_tl[] = {
- {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
- {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},192},
- {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},160},
- {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},224},
- {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},144},
- {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},208},
- {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},176},
- {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},240},
- {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
- {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},200},
- {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},168},
- {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},232},
- {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},152},
- {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},216},
- {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},184},
- {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},248},
- {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
- {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},196},
- {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},164},
- {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},228},
- {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},148},
- {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},212},
- {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},180},
- {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},244},
- {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},204},
- {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},172},
- {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},236},
- {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},156},
- {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},220},
- {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},188},
- {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},252},
- {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
- {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},194},
- {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},162},
- {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},226},
- {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},146},
- {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},210},
- {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},178},
- {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},242},
- {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
- {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},202},
- {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},170},
- {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},234},
- {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},154},
- {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},218},
- {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},186},
- {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},250},
- {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
- {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},198},
- {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},166},
- {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},230},
- {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},150},
- {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},214},
- {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},182},
- {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},246},
- {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},206},
- {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},174},
- {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},238},
- {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},158},
- {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},222},
- {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},190},
- {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},254},
- {{{96,7}},256}, {{{0,8}},80}, {{{0,8}},16}, {{{84,8}},115},
- {{{82,7}},31}, {{{0,8}},112}, {{{0,8}},48}, {{{0,9}},193},
- {{{80,7}},10}, {{{0,8}},96}, {{{0,8}},32}, {{{0,9}},161},
- {{{0,8}},0}, {{{0,8}},128}, {{{0,8}},64}, {{{0,9}},225},
- {{{80,7}},6}, {{{0,8}},88}, {{{0,8}},24}, {{{0,9}},145},
- {{{83,7}},59}, {{{0,8}},120}, {{{0,8}},56}, {{{0,9}},209},
- {{{81,7}},17}, {{{0,8}},104}, {{{0,8}},40}, {{{0,9}},177},
- {{{0,8}},8}, {{{0,8}},136}, {{{0,8}},72}, {{{0,9}},241},
- {{{80,7}},4}, {{{0,8}},84}, {{{0,8}},20}, {{{85,8}},227},
- {{{83,7}},43}, {{{0,8}},116}, {{{0,8}},52}, {{{0,9}},201},
- {{{81,7}},13}, {{{0,8}},100}, {{{0,8}},36}, {{{0,9}},169},
- {{{0,8}},4}, {{{0,8}},132}, {{{0,8}},68}, {{{0,9}},233},
- {{{80,7}},8}, {{{0,8}},92}, {{{0,8}},28}, {{{0,9}},153},
- {{{84,7}},83}, {{{0,8}},124}, {{{0,8}},60}, {{{0,9}},217},
- {{{82,7}},23}, {{{0,8}},108}, {{{0,8}},44}, {{{0,9}},185},
- {{{0,8}},12}, {{{0,8}},140}, {{{0,8}},76}, {{{0,9}},249},
- {{{80,7}},3}, {{{0,8}},82}, {{{0,8}},18}, {{{85,8}},163},
- {{{83,7}},35}, {{{0,8}},114}, {{{0,8}},50}, {{{0,9}},197},
- {{{81,7}},11}, {{{0,8}},98}, {{{0,8}},34}, {{{0,9}},165},
- {{{0,8}},2}, {{{0,8}},130}, {{{0,8}},66}, {{{0,9}},229},
- {{{80,7}},7}, {{{0,8}},90}, {{{0,8}},26}, {{{0,9}},149},
- {{{84,7}},67}, {{{0,8}},122}, {{{0,8}},58}, {{{0,9}},213},
- {{{82,7}},19}, {{{0,8}},106}, {{{0,8}},42}, {{{0,9}},181},
- {{{0,8}},10}, {{{0,8}},138}, {{{0,8}},74}, {{{0,9}},245},
- {{{80,7}},5}, {{{0,8}},86}, {{{0,8}},22}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},118}, {{{0,8}},54}, {{{0,9}},205},
- {{{81,7}},15}, {{{0,8}},102}, {{{0,8}},38}, {{{0,9}},173},
- {{{0,8}},6}, {{{0,8}},134}, {{{0,8}},70}, {{{0,9}},237},
- {{{80,7}},9}, {{{0,8}},94}, {{{0,8}},30}, {{{0,9}},157},
- {{{84,7}},99}, {{{0,8}},126}, {{{0,8}},62}, {{{0,9}},221},
- {{{82,7}},27}, {{{0,8}},110}, {{{0,8}},46}, {{{0,9}},189},
- {{{0,8}},14}, {{{0,8}},142}, {{{0,8}},78}, {{{0,9}},253},
- {{{96,7}},256}, {{{0,8}},81}, {{{0,8}},17}, {{{85,8}},131},
- {{{82,7}},31}, {{{0,8}},113}, {{{0,8}},49}, {{{0,9}},195},
- {{{80,7}},10}, {{{0,8}},97}, {{{0,8}},33}, {{{0,9}},163},
- {{{0,8}},1}, {{{0,8}},129}, {{{0,8}},65}, {{{0,9}},227},
- {{{80,7}},6}, {{{0,8}},89}, {{{0,8}},25}, {{{0,9}},147},
- {{{83,7}},59}, {{{0,8}},121}, {{{0,8}},57}, {{{0,9}},211},
- {{{81,7}},17}, {{{0,8}},105}, {{{0,8}},41}, {{{0,9}},179},
- {{{0,8}},9}, {{{0,8}},137}, {{{0,8}},73}, {{{0,9}},243},
- {{{80,7}},4}, {{{0,8}},85}, {{{0,8}},21}, {{{80,8}},258},
- {{{83,7}},43}, {{{0,8}},117}, {{{0,8}},53}, {{{0,9}},203},
- {{{81,7}},13}, {{{0,8}},101}, {{{0,8}},37}, {{{0,9}},171},
- {{{0,8}},5}, {{{0,8}},133}, {{{0,8}},69}, {{{0,9}},235},
- {{{80,7}},8}, {{{0,8}},93}, {{{0,8}},29}, {{{0,9}},155},
- {{{84,7}},83}, {{{0,8}},125}, {{{0,8}},61}, {{{0,9}},219},
- {{{82,7}},23}, {{{0,8}},109}, {{{0,8}},45}, {{{0,9}},187},
- {{{0,8}},13}, {{{0,8}},141}, {{{0,8}},77}, {{{0,9}},251},
- {{{80,7}},3}, {{{0,8}},83}, {{{0,8}},19}, {{{85,8}},195},
- {{{83,7}},35}, {{{0,8}},115}, {{{0,8}},51}, {{{0,9}},199},
- {{{81,7}},11}, {{{0,8}},99}, {{{0,8}},35}, {{{0,9}},167},
- {{{0,8}},3}, {{{0,8}},131}, {{{0,8}},67}, {{{0,9}},231},
- {{{80,7}},7}, {{{0,8}},91}, {{{0,8}},27}, {{{0,9}},151},
- {{{84,7}},67}, {{{0,8}},123}, {{{0,8}},59}, {{{0,9}},215},
- {{{82,7}},19}, {{{0,8}},107}, {{{0,8}},43}, {{{0,9}},183},
- {{{0,8}},11}, {{{0,8}},139}, {{{0,8}},75}, {{{0,9}},247},
- {{{80,7}},5}, {{{0,8}},87}, {{{0,8}},23}, {{{192,8}},0},
- {{{83,7}},51}, {{{0,8}},119}, {{{0,8}},55}, {{{0,9}},207},
- {{{81,7}},15}, {{{0,8}},103}, {{{0,8}},39}, {{{0,9}},175},
- {{{0,8}},7}, {{{0,8}},135}, {{{0,8}},71}, {{{0,9}},239},
- {{{80,7}},9}, {{{0,8}},95}, {{{0,8}},31}, {{{0,9}},159},
- {{{84,7}},99}, {{{0,8}},127}, {{{0,8}},63}, {{{0,9}},223},
- {{{82,7}},27}, {{{0,8}},111}, {{{0,8}},47}, {{{0,9}},191},
- {{{0,8}},15}, {{{0,8}},143}, {{{0,8}},79}, {{{0,9}},255}
- };
-local const inflate_huft fixed_td[] = {
- {{{80,5}},1}, {{{87,5}},257}, {{{83,5}},17}, {{{91,5}},4097},
- {{{81,5}},5}, {{{89,5}},1025}, {{{85,5}},65}, {{{93,5}},16385},
- {{{80,5}},3}, {{{88,5}},513}, {{{84,5}},33}, {{{92,5}},8193},
- {{{82,5}},9}, {{{90,5}},2049}, {{{86,5}},129}, {{{192,5}},24577},
- {{{80,5}},2}, {{{87,5}},385}, {{{83,5}},25}, {{{91,5}},6145},
- {{{81,5}},7}, {{{89,5}},1537}, {{{85,5}},97}, {{{93,5}},24577},
- {{{80,5}},4}, {{{88,5}},769}, {{{84,5}},49}, {{{92,5}},12289},
- {{{82,5}},13}, {{{90,5}},3073}, {{{86,5}},193}, {{{192,5}},24577}
- };
+ static const code lenfix[512] = {
+ {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48},
+ {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128},
+ {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59},
+ {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176},
+ {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20},
+ {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100},
+ {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8},
+ {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216},
+ {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76},
+ {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114},
+ {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2},
+ {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148},
+ {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42},
+ {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86},
+ {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15},
+ {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236},
+ {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62},
+ {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142},
+ {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31},
+ {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162},
+ {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25},
+ {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105},
+ {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4},
+ {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202},
+ {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69},
+ {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125},
+ {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13},
+ {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195},
+ {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35},
+ {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91},
+ {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19},
+ {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246},
+ {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55},
+ {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135},
+ {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99},
+ {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190},
+ {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16},
+ {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96},
+ {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6},
+ {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209},
+ {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72},
+ {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116},
+ {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4},
+ {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153},
+ {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44},
+ {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82},
+ {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11},
+ {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229},
+ {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58},
+ {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138},
+ {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51},
+ {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173},
+ {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30},
+ {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110},
+ {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0},
+ {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195},
+ {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65},
+ {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121},
+ {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9},
+ {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258},
+ {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37},
+ {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93},
+ {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23},
+ {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251},
+ {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51},
+ {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131},
+ {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67},
+ {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183},
+ {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23},
+ {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103},
+ {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9},
+ {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223},
+ {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79},
+ {0,9,255}
+ };
+
+ static const code distfix[32] = {
+ {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025},
+ {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193},
+ {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385},
+ {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577},
+ {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073},
+ {22,5,193},{64,5,0}
+ };
diff --git a/freetype/src/gzip/inflate.c b/freetype/src/gzip/inflate.c
index 95e26536..5bf5b815 100644
--- a/freetype/src/gzip/inflate.c
+++ b/freetype/src/gzip/inflate.c
@@ -1,283 +1,1610 @@
-/* inflate.c -- zlib interface to inflate modules
- * Copyright (C) 1995-2002 Mark Adler
+/* inflate.c -- zlib decompression
+ * Copyright (C) 1995-2022 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
+/*
+ * Change history:
+ *
+ * 1.2.beta0 24 Nov 2002
+ * - First version -- complete rewrite of inflate to simplify code, avoid
+ * creation of window when not needed, minimize use of window when it is
+ * needed, make inffast.c even faster, implement gzip decoding, and to
+ * improve code readability and style over the previous zlib inflate code
+ *
+ * 1.2.beta1 25 Nov 2002
+ * - Use pointers for available input and output checking in inffast.c
+ * - Remove input and output counters in inffast.c
+ * - Change inffast.c entry and loop from avail_in >= 7 to >= 6
+ * - Remove unnecessary second byte pull from length extra in inffast.c
+ * - Unroll direct copy to three copies per loop in inffast.c
+ *
+ * 1.2.beta2 4 Dec 2002
+ * - Change external routine names to reduce potential conflicts
+ * - Correct filename to inffixed.h for fixed tables in inflate.c
+ * - Make hbuf[] unsigned char to match parameter type in inflate.c
+ * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset)
+ * to avoid negation problem on Alphas (64 bit) in inflate.c
+ *
+ * 1.2.beta3 22 Dec 2002
+ * - Add comments on state->bits assertion in inffast.c
+ * - Add comments on op field in inftrees.h
+ * - Fix bug in reuse of allocated window after inflateReset()
+ * - Remove bit fields--back to byte structure for speed
+ * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths
+ * - Change post-increments to pre-increments in inflate_fast(), PPC biased?
+ * - Add compile time option, POSTINC, to use post-increments instead (Intel?)
+ * - Make MATCH copy in inflate() much faster for when inflate_fast() not used
+ * - Use local copies of stream next and avail values, as well as local bit
+ * buffer and bit count in inflate()--for speed when inflate_fast() not used
+ *
+ * 1.2.beta4 1 Jan 2003
+ * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings
+ * - Move a comment on output buffer sizes from inffast.c to inflate.c
+ * - Add comments in inffast.c to introduce the inflate_fast() routine
+ * - Rearrange window copies in inflate_fast() for speed and simplification
+ * - Unroll last copy for window match in inflate_fast()
+ * - Use local copies of window variables in inflate_fast() for speed
+ * - Pull out common wnext == 0 case for speed in inflate_fast()
+ * - Make op and len in inflate_fast() unsigned for consistency
+ * - Add FAR to lcode and dcode declarations in inflate_fast()
+ * - Simplified bad distance check in inflate_fast()
+ * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new
+ * source file infback.c to provide a call-back interface to inflate for
+ * programs like gzip and unzip -- uses window as output buffer to avoid
+ * window copying
+ *
+ * 1.2.beta5 1 Jan 2003
+ * - Improved inflateBack() interface to allow the caller to provide initial
+ * input in strm.
+ * - Fixed stored blocks bug in inflateBack()
+ *
+ * 1.2.beta6 4 Jan 2003
+ * - Added comments in inffast.c on effectiveness of POSTINC
+ * - Typecasting all around to reduce compiler warnings
+ * - Changed loops from while (1) or do {} while (1) to for (;;), again to
+ * make compilers happy
+ * - Changed type of window in inflateBackInit() to unsigned char *
+ *
+ * 1.2.beta7 27 Jan 2003
+ * - Changed many types to unsigned or unsigned short to avoid warnings
+ * - Added inflateCopy() function
+ *
+ * 1.2.0 9 Mar 2003
+ * - Changed inflateBack() interface to provide separate opaque descriptors
+ * for the in() and out() functions
+ * - Changed inflateBack() argument and in_func typedef to swap the length
+ * and buffer address return values for the input function
+ * - Check next_in and next_out for Z_NULL on entry to inflate()
+ *
+ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution.
+ */
+
#include "zutil.h"
-#include "infblock.h"
-
-#define DONE INFLATE_DONE
-#define BAD INFLATE_BAD
-
-typedef enum {
- METHOD, /* waiting for method byte */
- FLAG, /* waiting for flag byte */
- DICT4, /* four dictionary check bytes to go */
- DICT3, /* three dictionary check bytes to go */
- DICT2, /* two dictionary check bytes to go */
- DICT1, /* one dictionary check byte to go */
- DICT0, /* waiting for inflateSetDictionary */
- BLOCKS, /* decompressing blocks */
- CHECK4, /* four check bytes to go */
- CHECK3, /* three check bytes to go */
- CHECK2, /* two check bytes to go */
- CHECK1, /* one check byte to go */
- DONE, /* finished check, done */
- BAD} /* got an error--stay here */
-inflate_mode;
-
-/* inflate private state */
-struct internal_state {
-
- /* mode */
- inflate_mode mode; /* current inflate mode */
-
- /* mode dependent information */
- union {
- uInt method; /* if FLAGS, method byte */
- struct {
- uLong was; /* computed check value */
- uLong need; /* stream check value */
- } check; /* if CHECK, check values to compare */
- uInt marker; /* if BAD, inflateSync's marker bytes count */
- } sub; /* submode */
-
- /* mode independent information */
- int nowrap; /* flag for no wrapper */
- uInt wbits; /* log2(window size) (8..15, defaults to 15) */
- inflate_blocks_statef
- *blocks; /* current inflate_blocks state */
-
-};
-
-
-ZEXPORT(int) inflateReset( /* z) */
-z_streamp z )
+#include "inftrees.h"
+#include "inflate.h"
+#include "inffast.h"
+
+#ifdef MAKEFIXED
+# ifndef BUILDFIXED
+# define BUILDFIXED
+# endif
+#endif
+
+/* function prototypes */
+local int inflateStateCheck OF((z_streamp strm));
+local void fixedtables OF((struct inflate_state FAR *state));
+local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
+ unsigned copy));
+#ifdef BUILDFIXED
+ void makefixed OF((void));
+#endif
+#ifndef Z_FREETYPE
+local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
+ unsigned len));
+#endif
+
+local int inflateStateCheck(
+ z_streamp strm)
{
- if (z == Z_NULL || z->state == Z_NULL)
- return Z_STREAM_ERROR;
- z->total_in = z->total_out = 0;
- z->msg = Z_NULL;
- z->state->mode = z->state->nowrap ? BLOCKS : METHOD;
- inflate_blocks_reset(z->state->blocks, z, Z_NULL);
- Tracev((stderr, "inflate: reset\n"));
- return Z_OK;
+ struct inflate_state FAR *state;
+ if (strm == Z_NULL ||
+ strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0)
+ return 1;
+ state = (struct inflate_state FAR *)strm->state;
+ if (state == Z_NULL || state->strm != strm ||
+ state->mode < HEAD || state->mode > SYNC)
+ return 1;
+ return 0;
}
+int ZEXPORT inflateResetKeep(
+ z_streamp strm)
+{
+ struct inflate_state FAR *state;
+
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ strm->total_in = strm->total_out = state->total = 0;
+ strm->msg = Z_NULL;
+ if (state->wrap) /* to support ill-conceived Java test suite */
+ strm->adler = state->wrap & 1;
+ state->mode = HEAD;
+ state->last = 0;
+ state->havedict = 0;
+ state->flags = -1;
+ state->dmax = 32768U;
+ state->head = Z_NULL;
+ state->hold = 0;
+ state->bits = 0;
+ state->lencode = state->distcode = state->next = state->codes;
+ state->sane = 1;
+ state->back = -1;
+ Tracev((stderr, "inflate: reset\n"));
+ return Z_OK;
+}
-ZEXPORT(int) inflateEnd( /* z) */
-z_streamp z )
+int ZEXPORT inflateReset(
+ z_streamp strm)
{
- if (z == Z_NULL || z->state == Z_NULL || z->zfree == Z_NULL)
- return Z_STREAM_ERROR;
- if (z->state->blocks != Z_NULL)
- inflate_blocks_free(z->state->blocks, z);
- ZFREE(z, z->state);
- z->state = Z_NULL;
- Tracev((stderr, "inflate: end\n"));
- return Z_OK;
+ struct inflate_state FAR *state;
+
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ state->wsize = 0;
+ state->whave = 0;
+ state->wnext = 0;
+ return inflateResetKeep(strm);
}
+int ZEXPORT inflateReset2(
+ z_streamp strm,
+ int windowBits)
+{
+ int wrap;
+ struct inflate_state FAR *state;
+
+ /* get the state */
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* extract wrap request from windowBits parameter */
+ if (windowBits < 0) {
+ wrap = 0;
+ windowBits = -windowBits;
+ }
+ else {
+ wrap = (windowBits >> 4) + 5;
+#ifdef GUNZIP
+ if (windowBits < 48)
+ windowBits &= 15;
+#endif
+ }
+
+ /* set number of window bits, free window if different */
+ if (windowBits && (windowBits < 8 || windowBits > 15))
+ return Z_STREAM_ERROR;
+ if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) {
+ ZFREE(strm, state->window);
+ state->window = Z_NULL;
+ }
+
+ /* update state and reset the rest of it */
+ state->wrap = wrap;
+ state->wbits = (unsigned)windowBits;
+ return inflateReset(strm);
+}
-ZEXPORT(int) inflateInit2_( /* z, w, version, stream_size) */
-z_streamp z,
-int w,
-const char *version,
-int stream_size )
+int ZEXPORT inflateInit2_(
+ z_streamp strm,
+ int windowBits,
+ const char *version,
+ int stream_size)
{
- if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
- stream_size != sizeof(z_stream))
- return Z_VERSION_ERROR;
-
- /* initialize state */
- if (z == Z_NULL)
- return Z_STREAM_ERROR;
- z->msg = Z_NULL;
- if (z->zalloc == Z_NULL)
- {
- z->zalloc = zcalloc;
- z->opaque = (voidpf)0;
- }
- if (z->zfree == Z_NULL) z->zfree = zcfree;
- if ((z->state = (struct internal_state FAR *)
- ZALLOC(z,1,sizeof(struct internal_state))) == Z_NULL)
- return Z_MEM_ERROR;
- z->state->blocks = Z_NULL;
-
- /* handle undocumented nowrap option (no zlib header or check) */
- z->state->nowrap = 0;
- if (w < 0)
- {
- w = - w;
- z->state->nowrap = 1;
- }
-
- /* set window size */
- if (w < 8 || w > 15)
- {
- inflateEnd(z);
- return Z_STREAM_ERROR;
- }
- z->state->wbits = (uInt)w;
-
- /* create inflate_blocks state */
- if ((z->state->blocks =
- inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w))
- == Z_NULL)
- {
- inflateEnd(z);
- return Z_MEM_ERROR;
- }
- Tracev((stderr, "inflate: allocated\n"));
-
- /* reset state */
- inflateReset(z);
- return Z_OK;
+ int ret;
+ struct inflate_state FAR *state;
+
+ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] ||
+ stream_size != (int)(sizeof(z_stream)))
+ return Z_VERSION_ERROR;
+ if (strm == Z_NULL) return Z_STREAM_ERROR;
+ strm->msg = Z_NULL; /* in case we return an error */
+ if (strm->zalloc == (alloc_func)0) {
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zalloc = zcalloc;
+ strm->opaque = (voidpf)0;
+#endif
+ }
+ if (strm->zfree == (free_func)0)
+#ifdef Z_SOLO
+ return Z_STREAM_ERROR;
+#else
+ strm->zfree = zcfree;
+#endif
+ state = (struct inflate_state FAR *)
+ ZALLOC(strm, 1, sizeof(struct inflate_state));
+ if (state == Z_NULL) return Z_MEM_ERROR;
+ Tracev((stderr, "inflate: allocated\n"));
+ strm->state = (struct internal_state FAR *)state;
+ state->strm = strm;
+ state->window = Z_NULL;
+ state->mode = HEAD; /* to pass state test in inflateReset2() */
+ ret = inflateReset2(strm, windowBits);
+ if (ret != Z_OK) {
+ ZFREE(strm, state);
+ strm->state = Z_NULL;
+ }
+ return ret;
}
+int ZEXPORT inflateInit_(
+ z_streamp strm,
+ const char *version,
+ int stream_size)
+{
+ return inflateInit2_(strm, DEF_WBITS, version, stream_size);
+}
+#ifndef Z_FREETYPE
-#undef NEEDBYTE
-#define NEEDBYTE {if(z->avail_in==0)return r;r=f;}
+int ZEXPORT inflatePrime(
+ z_streamp strm,
+ int bits,
+ int value)
+{
+ struct inflate_state FAR *state;
-#undef NEXTBYTE
-#define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++)
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (bits < 0) {
+ state->hold = 0;
+ state->bits = 0;
+ return Z_OK;
+ }
+ if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR;
+ value &= (1L << bits) - 1;
+ state->hold += (unsigned)value << state->bits;
+ state->bits += (uInt)bits;
+ return Z_OK;
+}
+#endif /* !Z_FREETYPE */
-ZEXPORT(int) inflate( /* z, f) */
-z_streamp z,
-int f )
+/*
+ Return state with length and distance decoding tables and index sizes set to
+ fixed code decoding. Normally this returns fixed tables from inffixed.h.
+ If BUILDFIXED is defined, then instead this routine builds the tables the
+ first time it's called, and returns those tables the first time and
+ thereafter. This reduces the size of the code by about 2K bytes, in
+ exchange for a little execution time. However, BUILDFIXED should not be
+ used for threaded applications, since the rewriting of the tables and virgin
+ may not be thread-safe.
+ */
+local void fixedtables(
+ struct inflate_state FAR *state)
{
- int r;
- uInt b;
-
- if (z == Z_NULL || z->state == Z_NULL || z->next_in == Z_NULL)
- return Z_STREAM_ERROR;
- f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
- r = Z_BUF_ERROR;
- while (1) switch (z->state->mode)
- {
- case METHOD:
- NEEDBYTE
- if (((z->state->sub.method = NEXTBYTE) & 0xf) != Z_DEFLATED)
- {
- z->state->mode = BAD;
- z->msg = (char*)"unknown compression method";
- z->state->sub.marker = 5; /* can't try inflateSync */
- break;
- }
- if ((z->state->sub.method >> 4) + 8 > z->state->wbits)
- {
- z->state->mode = BAD;
- z->msg = (char*)"invalid window size";
- z->state->sub.marker = 5; /* can't try inflateSync */
- break;
- }
- z->state->mode = FLAG;
- /* fall through */
- case FLAG:
- NEEDBYTE
- b = NEXTBYTE;
- if (((z->state->sub.method << 8) + b) % 31)
- {
- z->state->mode = BAD;
- z->msg = (char*)"incorrect header check";
- z->state->sub.marker = 5; /* can't try inflateSync */
- break;
- }
- Tracev((stderr, "inflate: zlib header ok\n"));
- if (!(b & PRESET_DICT))
- {
- z->state->mode = BLOCKS;
- break;
- }
- z->state->mode = DICT4;
- /* fall through */
- case DICT4:
- NEEDBYTE
- z->state->sub.check.need = (uLong)NEXTBYTE << 24;
- z->state->mode = DICT3;
- /* fall through */
- case DICT3:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE << 16;
- z->state->mode = DICT2;
- /* fall through */
- case DICT2:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE << 8;
- z->state->mode = DICT1;
- /* fall through */
- case DICT1:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE;
- z->adler = z->state->sub.check.need;
- z->state->mode = DICT0;
- return Z_NEED_DICT;
- case DICT0:
- z->state->mode = BAD;
- z->msg = (char*)"need dictionary";
- z->state->sub.marker = 0; /* can try inflateSync */
- return Z_STREAM_ERROR;
- case BLOCKS:
- r = inflate_blocks(z->state->blocks, z, r);
- if (r == Z_DATA_ERROR)
- {
- z->state->mode = BAD;
- z->state->sub.marker = 0; /* can try inflateSync */
- break;
- }
- if (r == Z_OK)
- r = f;
- if (r != Z_STREAM_END)
- return r;
- r = f;
- inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was);
- if (z->state->nowrap)
- {
- z->state->mode = DONE;
- break;
- }
- z->state->mode = CHECK4;
- /* fall through */
- case CHECK4:
- NEEDBYTE
- z->state->sub.check.need = (uLong)NEXTBYTE << 24;
- z->state->mode = CHECK3;
- /* fall through */
- case CHECK3:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE << 16;
- z->state->mode = CHECK2;
- /* fall through */
- case CHECK2:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE << 8;
- z->state->mode = CHECK1;
- /* fall through */
- case CHECK1:
- NEEDBYTE
- z->state->sub.check.need += (uLong)NEXTBYTE;
-
- if (z->state->sub.check.was != z->state->sub.check.need)
- {
- z->state->mode = BAD;
- z->msg = (char*)"incorrect data check";
- z->state->sub.marker = 5; /* can't try inflateSync */
+#ifdef BUILDFIXED
+ static int virgin = 1;
+ static code *lenfix, *distfix;
+ static code fixed[544];
+
+ /* build fixed huffman tables if first call (may not be thread safe) */
+ if (virgin) {
+ unsigned sym, bits;
+ static code *next;
+
+ /* literal/length table */
+ sym = 0;
+ while (sym < 144) state->lens[sym++] = 8;
+ while (sym < 256) state->lens[sym++] = 9;
+ while (sym < 280) state->lens[sym++] = 7;
+ while (sym < 288) state->lens[sym++] = 8;
+ next = fixed;
+ lenfix = next;
+ bits = 9;
+ inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work);
+
+ /* distance table */
+ sym = 0;
+ while (sym < 32) state->lens[sym++] = 5;
+ distfix = next;
+ bits = 5;
+ inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work);
+
+ /* do this just once */
+ virgin = 0;
+ }
+#else /* !BUILDFIXED */
+# include "inffixed.h"
+#endif /* BUILDFIXED */
+ state->lencode = lenfix;
+ state->lenbits = 9;
+ state->distcode = distfix;
+ state->distbits = 5;
+}
+
+#ifdef MAKEFIXED
+#include <stdio.h>
+
+/*
+ Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also
+ defines BUILDFIXED, so the tables are built on the fly. makefixed() writes
+ those tables to stdout, which would be piped to inffixed.h. A small program
+ can simply call makefixed to do this:
+
+ void makefixed(void);
+
+ int main(void)
+ {
+ makefixed();
+ return 0;
+ }
+
+ Then that can be linked with zlib built with MAKEFIXED defined and run:
+
+ a.out > inffixed.h
+ */
+void makefixed()
+{
+ unsigned low, size;
+ struct inflate_state state;
+
+ fixedtables(&state);
+ puts(" /* inffixed.h -- table for decoding fixed codes");
+ puts(" * Generated automatically by makefixed().");
+ puts(" */");
+ puts("");
+ puts(" /* WARNING: this file should *not* be used by applications.");
+ puts(" It is part of the implementation of this library and is");
+ puts(" subject to change. Applications should only use zlib.h.");
+ puts(" */");
+ puts("");
+ size = 1U << 9;
+ printf(" static const code lenfix[%u] = {", size);
+ low = 0;
+ for (;;) {
+ if ((low % 7) == 0) printf("\n ");
+ printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op,
+ state.lencode[low].bits, state.lencode[low].val);
+ if (++low == size) break;
+ putchar(',');
+ }
+ puts("\n };");
+ size = 1U << 5;
+ printf("\n static const code distfix[%u] = {", size);
+ low = 0;
+ for (;;) {
+ if ((low % 6) == 0) printf("\n ");
+ printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits,
+ state.distcode[low].val);
+ if (++low == size) break;
+ putchar(',');
+ }
+ puts("\n };");
+}
+#endif /* MAKEFIXED */
+
+/*
+ Update the window with the last wsize (normally 32K) bytes written before
+ returning. If window does not exist yet, create it. This is only called
+ when a window is already in use, or when output has been written during this
+ inflate call, but the end of the deflate stream has not been reached yet.
+ It is also called to create a window for dictionary data when a dictionary
+ is loaded.
+
+ Providing output buffers larger than 32K to inflate() should provide a speed
+ advantage, since only the last 32K of output is copied to the sliding window
+ upon return from inflate(), and since all distances after the first 32K of
+ output will fall in the output data, making match copies simpler and faster.
+ The advantage may be dependent on the size of the processor's data caches.
+ */
+local int updatewindow(
+ z_streamp strm,
+ const Bytef *end,
+ unsigned copy)
+{
+ struct inflate_state FAR *state;
+ unsigned dist;
+
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* if it hasn't been done already, allocate space for the window */
+ if (state->window == Z_NULL) {
+ state->window = (unsigned char FAR *)
+ ZALLOC(strm, 1U << state->wbits,
+ sizeof(unsigned char));
+ if (state->window == Z_NULL) return 1;
+ }
+
+ /* if window not in use yet, initialize */
+ if (state->wsize == 0) {
+ state->wsize = 1U << state->wbits;
+ state->wnext = 0;
+ state->whave = 0;
+ }
+
+ /* copy state->wsize or less output bytes into the circular window */
+ if (copy >= state->wsize) {
+ zmemcpy(state->window, end - state->wsize, state->wsize);
+ state->wnext = 0;
+ state->whave = state->wsize;
+ }
+ else {
+ dist = state->wsize - state->wnext;
+ if (dist > copy) dist = copy;
+ zmemcpy(state->window + state->wnext, end - copy, dist);
+ copy -= dist;
+ if (copy) {
+ zmemcpy(state->window, end - copy, copy);
+ state->wnext = copy;
+ state->whave = state->wsize;
+ }
+ else {
+ state->wnext += dist;
+ if (state->wnext == state->wsize) state->wnext = 0;
+ if (state->whave < state->wsize) state->whave += dist;
+ }
+ }
+ return 0;
+}
+
+/* Macros for inflate(): */
+
+/* check function to use adler32() for zlib or crc32() for gzip */
+#ifdef GUNZIP
+# define UPDATE_CHECK(check, buf, len) \
+ (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
+#else
+# define UPDATE_CHECK(check, buf, len) adler32(check, buf, len)
+#endif
+
+/* check macros for header crc */
+#ifdef GUNZIP
+# define CRC2(check, word) \
+ do { \
+ hbuf[0] = (unsigned char)(word); \
+ hbuf[1] = (unsigned char)((word) >> 8); \
+ check = crc32(check, hbuf, 2); \
+ } while (0)
+
+# define CRC4(check, word) \
+ do { \
+ hbuf[0] = (unsigned char)(word); \
+ hbuf[1] = (unsigned char)((word) >> 8); \
+ hbuf[2] = (unsigned char)((word) >> 16); \
+ hbuf[3] = (unsigned char)((word) >> 24); \
+ check = crc32(check, hbuf, 4); \
+ } while (0)
+#endif
+
+/* Load registers with state in inflate() for speed */
+#define LOAD() \
+ do { \
+ put = strm->next_out; \
+ left = strm->avail_out; \
+ next = strm->next_in; \
+ have = strm->avail_in; \
+ hold = state->hold; \
+ bits = state->bits; \
+ } while (0)
+
+/* Restore state from registers in inflate() */
+#define RESTORE() \
+ do { \
+ strm->next_out = put; \
+ strm->avail_out = left; \
+ strm->next_in = next; \
+ strm->avail_in = have; \
+ state->hold = hold; \
+ state->bits = bits; \
+ } while (0)
+
+/* Clear the input bit accumulator */
+#define INITBITS() \
+ do { \
+ hold = 0; \
+ bits = 0; \
+ } while (0)
+
+/* Get a byte of input into the bit accumulator, or return from inflate()
+ if there is no input available. */
+#define PULLBYTE() \
+ do { \
+ if (have == 0) goto inf_leave; \
+ have--; \
+ hold += (unsigned long)(*next++) << bits; \
+ bits += 8; \
+ } while (0)
+
+/* Assure that there are at least n bits in the bit accumulator. If there is
+ not enough available input to do that, then return from inflate(). */
+#define NEEDBITS(n) \
+ do { \
+ while (bits < (unsigned)(n)) \
+ PULLBYTE(); \
+ } while (0)
+
+/* Return the low n bits of the bit accumulator (n < 16) */
+#define BITS(n) \
+ ((unsigned)hold & ((1U << (n)) - 1))
+
+/* Remove n bits from the bit accumulator */
+#define DROPBITS(n) \
+ do { \
+ hold >>= (n); \
+ bits -= (unsigned)(n); \
+ } while (0)
+
+/* Remove zero to seven bits as needed to go to a byte boundary */
+#define BYTEBITS() \
+ do { \
+ hold >>= bits & 7; \
+ bits -= bits & 7; \
+ } while (0)
+
+/*
+ inflate() uses a state machine to process as much input data and generate as
+ much output data as possible before returning. The state machine is
+ structured roughly as follows:
+
+ for (;;) switch (state) {
+ ...
+ case STATEn:
+ if (not enough input data or output space to make progress)
+ return;
+ ... make progress ...
+ state = STATEm;
break;
- }
- Tracev((stderr, "inflate: zlib check ok\n"));
- z->state->mode = DONE;
- /* fall through */
- case DONE:
- return Z_STREAM_END;
- case BAD:
- return Z_DATA_ERROR;
- default:
- return Z_STREAM_ERROR;
- }
-#ifdef NEED_DUMMY_RETURN
- return Z_STREAM_ERROR; /* Some dumb compilers complain without this */
+ ...
+ }
+
+ so when inflate() is called again, the same case is attempted again, and
+ if the appropriate resources are provided, the machine proceeds to the
+ next state. The NEEDBITS() macro is usually the way the state evaluates
+ whether it can proceed or should return. NEEDBITS() does the return if
+ the requested bits are not available. The typical use of the BITS macros
+ is:
+
+ NEEDBITS(n);
+ ... do something with BITS(n) ...
+ DROPBITS(n);
+
+ where NEEDBITS(n) either returns from inflate() if there isn't enough
+ input left to load n bits into the accumulator, or it continues. BITS(n)
+ gives the low n bits in the accumulator. When done, DROPBITS(n) drops
+ the low n bits off the accumulator. INITBITS() clears the accumulator
+ and sets the number of available bits to zero. BYTEBITS() discards just
+ enough bits to put the accumulator on a byte boundary. After BYTEBITS()
+ and a NEEDBITS(8), then BITS(8) would return the next byte in the stream.
+
+ NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return
+ if there is no input available. The decoding of variable length codes uses
+ PULLBYTE() directly in order to pull just enough bytes to decode the next
+ code, and no more.
+
+ Some states loop until they get enough input, making sure that enough
+ state information is maintained to continue the loop where it left off
+ if NEEDBITS() returns in the loop. For example, want, need, and keep
+ would all have to actually be part of the saved state in case NEEDBITS()
+ returns:
+
+ case STATEw:
+ while (want < need) {
+ NEEDBITS(n);
+ keep[want++] = BITS(n);
+ DROPBITS(n);
+ }
+ state = STATEx;
+ case STATEx:
+
+ As shown above, if the next state is also the next case, then the break
+ is omitted.
+
+ A state may also return if there is not enough output space available to
+ complete that state. Those states are copying stored data, writing a
+ literal byte, and copying a matching string.
+
+ When returning, a "goto inf_leave" is used to update the total counters,
+ update the check value, and determine whether any progress has been made
+ during that inflate() call in order to return the proper return code.
+ Progress is defined as a change in either strm->avail_in or strm->avail_out.
+ When there is a window, goto inf_leave will update the window with the last
+ output written. If a goto inf_leave occurs in the middle of decompression
+ and there is no window currently, goto inf_leave will create one and copy
+ output to the window for the next call of inflate().
+
+ In this implementation, the flush parameter of inflate() only affects the
+ return code (per zlib.h). inflate() always writes as much as possible to
+ strm->next_out, given the space available and the provided input--the effect
+ documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers
+ the allocation of and copying into a sliding window until necessary, which
+ provides the effect documented in zlib.h for Z_FINISH when the entire input
+ stream available. So the only thing the flush parameter actually does is:
+ when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it
+ will return Z_BUF_ERROR if it has not reached the end of the stream.
+ */
+
+int ZEXPORT inflate(
+ z_streamp strm,
+ int flush)
+{
+ struct inflate_state FAR *state;
+ z_const unsigned char FAR *next; /* next input */
+ unsigned char FAR *put; /* next output */
+ unsigned have, left; /* available input and output */
+ unsigned long hold; /* bit buffer */
+ unsigned bits; /* bits in bit buffer */
+ unsigned in, out; /* save starting available input and output */
+ unsigned copy; /* number of stored or match bytes to copy */
+ unsigned char FAR *from; /* where to copy match bytes from */
+ code here; /* current decoding table entry */
+ code last; /* parent table entry */
+ unsigned len; /* length to copy for repeats, bits to drop */
+ int ret; /* return code */
+#ifdef GUNZIP
+ unsigned char hbuf[4]; /* buffer for gzip header crc calculation */
#endif
+ static const unsigned short order[19] = /* permutation of code lengths */
+ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
+
+ if (inflateStateCheck(strm) || strm->next_out == Z_NULL ||
+ (strm->next_in == Z_NULL && strm->avail_in != 0))
+ return Z_STREAM_ERROR;
+
+ state = (struct inflate_state FAR *)strm->state;
+ if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */
+ LOAD();
+ in = have;
+ out = left;
+ ret = Z_OK;
+ for (;;)
+ switch (state->mode) {
+ case HEAD:
+ if (state->wrap == 0) {
+ state->mode = TYPEDO;
+ break;
+ }
+ NEEDBITS(16);
+#ifdef GUNZIP
+ if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */
+ if (state->wbits == 0)
+ state->wbits = 15;
+ state->check = crc32(0L, Z_NULL, 0);
+ CRC2(state->check, hold);
+ INITBITS();
+ state->mode = FLAGS;
+ break;
+ }
+ if (state->head != Z_NULL)
+ state->head->done = -1;
+ if (!(state->wrap & 1) || /* check if zlib header allowed */
+#else
+ if (
+#endif
+ ((BITS(8) << 8) + (hold >> 8)) % 31) {
+ strm->msg = (char *)"incorrect header check";
+ state->mode = BAD;
+ break;
+ }
+ if (BITS(4) != Z_DEFLATED) {
+ strm->msg = (char *)"unknown compression method";
+ state->mode = BAD;
+ break;
+ }
+ DROPBITS(4);
+ len = BITS(4) + 8;
+ if (state->wbits == 0)
+ state->wbits = len;
+ if (len > 15 || len > state->wbits) {
+ strm->msg = (char *)"invalid window size";
+ state->mode = BAD;
+ break;
+ }
+ state->dmax = 1U << len;
+ state->flags = 0; /* indicate zlib header */
+ Tracev((stderr, "inflate: zlib header ok\n"));
+ strm->adler = state->check = adler32(0L, Z_NULL, 0);
+ state->mode = hold & 0x200 ? DICTID : TYPE;
+ INITBITS();
+ break;
+#ifdef GUNZIP
+ case FLAGS:
+ NEEDBITS(16);
+ state->flags = (int)(hold);
+ if ((state->flags & 0xff) != Z_DEFLATED) {
+ strm->msg = (char *)"unknown compression method";
+ state->mode = BAD;
+ break;
+ }
+ if (state->flags & 0xe000) {
+ strm->msg = (char *)"unknown header flags set";
+ state->mode = BAD;
+ break;
+ }
+ if (state->head != Z_NULL)
+ state->head->text = (int)((hold >> 8) & 1);
+ if ((state->flags & 0x0200) && (state->wrap & 4))
+ CRC2(state->check, hold);
+ INITBITS();
+ state->mode = TIME;
+ /* fallthrough */
+ case TIME:
+ NEEDBITS(32);
+ if (state->head != Z_NULL)
+ state->head->time = hold;
+ if ((state->flags & 0x0200) && (state->wrap & 4))
+ CRC4(state->check, hold);
+ INITBITS();
+ state->mode = OS;
+ /* fallthrough */
+ case OS:
+ NEEDBITS(16);
+ if (state->head != Z_NULL) {
+ state->head->xflags = (int)(hold & 0xff);
+ state->head->os = (int)(hold >> 8);
+ }
+ if ((state->flags & 0x0200) && (state->wrap & 4))
+ CRC2(state->check, hold);
+ INITBITS();
+ state->mode = EXLEN;
+ /* fallthrough */
+ case EXLEN:
+ if (state->flags & 0x0400) {
+ NEEDBITS(16);
+ state->length = (unsigned)(hold);
+ if (state->head != Z_NULL)
+ state->head->extra_len = (unsigned)hold;
+ if ((state->flags & 0x0200) && (state->wrap & 4))
+ CRC2(state->check, hold);
+ INITBITS();
+ }
+ else if (state->head != Z_NULL)
+ state->head->extra = Z_NULL;
+ state->mode = EXTRA;
+ /* fallthrough */
+ case EXTRA:
+ if (state->flags & 0x0400) {
+ copy = state->length;
+ if (copy > have) copy = have;
+ if (copy) {
+ if (state->head != Z_NULL &&
+ state->head->extra != Z_NULL) {
+ len = state->head->extra_len - state->length;
+ zmemcpy(state->head->extra + len, next,
+ len + copy > state->head->extra_max ?
+ state->head->extra_max - len : copy);
+ }
+ if ((state->flags & 0x0200) && (state->wrap & 4))
+ state->check = crc32(state->check, next, copy);
+ have -= copy;
+ next += copy;
+ state->length -= copy;
+ }
+ if (state->length) goto inf_leave;
+ }
+ state->length = 0;
+ state->mode = NAME;
+ /* fallthrough */
+ case NAME:
+ if (state->flags & 0x0800) {
+ if (have == 0) goto inf_leave;
+ copy = 0;
+ do {
+ len = (unsigned)(next[copy++]);
+ if (state->head != Z_NULL &&
+ state->head->name != Z_NULL &&
+ state->length < state->head->name_max)
+ state->head->name[state->length++] = (Bytef)len;
+ } while (len && copy < have);
+ if ((state->flags & 0x0200) && (state->wrap & 4))
+ state->check = crc32(state->check, next, copy);
+ have -= copy;
+ next += copy;
+ if (len) goto inf_leave;
+ }
+ else if (state->head != Z_NULL)
+ state->head->name = Z_NULL;
+ state->length = 0;
+ state->mode = COMMENT;
+ /* fallthrough */
+ case COMMENT:
+ if (state->flags & 0x1000) {
+ if (have == 0) goto inf_leave;
+ copy = 0;
+ do {
+ len = (unsigned)(next[copy++]);
+ if (state->head != Z_NULL &&
+ state->head->comment != Z_NULL &&
+ state->length < state->head->comm_max)
+ state->head->comment[state->length++] = (Bytef)len;
+ } while (len && copy < have);
+ if ((state->flags & 0x0200) && (state->wrap & 4))
+ state->check = crc32(state->check, next, copy);
+ have -= copy;
+ next += copy;
+ if (len) goto inf_leave;
+ }
+ else if (state->head != Z_NULL)
+ state->head->comment = Z_NULL;
+ state->mode = HCRC;
+ /* fallthrough */
+ case HCRC:
+ if (state->flags & 0x0200) {
+ NEEDBITS(16);
+ if ((state->wrap & 4) && hold != (state->check & 0xffff)) {
+ strm->msg = (char *)"header crc mismatch";
+ state->mode = BAD;
+ break;
+ }
+ INITBITS();
+ }
+ if (state->head != Z_NULL) {
+ state->head->hcrc = (int)((state->flags >> 9) & 1);
+ state->head->done = 1;
+ }
+ strm->adler = state->check = crc32(0L, Z_NULL, 0);
+ state->mode = TYPE;
+ break;
+#endif
+ case DICTID:
+ NEEDBITS(32);
+ strm->adler = state->check = ZSWAP32(hold);
+ INITBITS();
+ state->mode = DICT;
+ /* fallthrough */
+ case DICT:
+ if (state->havedict == 0) {
+ RESTORE();
+ return Z_NEED_DICT;
+ }
+ strm->adler = state->check = adler32(0L, Z_NULL, 0);
+ state->mode = TYPE;
+ /* fallthrough */
+ case TYPE:
+ if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
+ /* fallthrough */
+ case TYPEDO:
+ if (state->last) {
+ BYTEBITS();
+ state->mode = CHECK;
+ break;
+ }
+ NEEDBITS(3);
+ state->last = BITS(1);
+ DROPBITS(1);
+ switch (BITS(2)) {
+ case 0: /* stored block */
+ Tracev((stderr, "inflate: stored block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = STORED;
+ break;
+ case 1: /* fixed block */
+ fixedtables(state);
+ Tracev((stderr, "inflate: fixed codes block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = LEN_; /* decode codes */
+ if (flush == Z_TREES) {
+ DROPBITS(2);
+ goto inf_leave;
+ }
+ break;
+ case 2: /* dynamic block */
+ Tracev((stderr, "inflate: dynamic codes block%s\n",
+ state->last ? " (last)" : ""));
+ state->mode = TABLE;
+ break;
+ case 3:
+ strm->msg = (char *)"invalid block type";
+ state->mode = BAD;
+ }
+ DROPBITS(2);
+ break;
+ case STORED:
+ BYTEBITS(); /* go to byte boundary */
+ NEEDBITS(32);
+ if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
+ strm->msg = (char *)"invalid stored block lengths";
+ state->mode = BAD;
+ break;
+ }
+ state->length = (unsigned)hold & 0xffff;
+ Tracev((stderr, "inflate: stored length %u\n",
+ state->length));
+ INITBITS();
+ state->mode = COPY_;
+ if (flush == Z_TREES) goto inf_leave;
+ /* fallthrough */
+ case COPY_:
+ state->mode = COPY;
+ /* fallthrough */
+ case COPY:
+ copy = state->length;
+ if (copy) {
+ if (copy > have) copy = have;
+ if (copy > left) copy = left;
+ if (copy == 0) goto inf_leave;
+ zmemcpy(put, next, copy);
+ have -= copy;
+ next += copy;
+ left -= copy;
+ put += copy;
+ state->length -= copy;
+ break;
+ }
+ Tracev((stderr, "inflate: stored end\n"));
+ state->mode = TYPE;
+ break;
+ case TABLE:
+ NEEDBITS(14);
+ state->nlen = BITS(5) + 257;
+ DROPBITS(5);
+ state->ndist = BITS(5) + 1;
+ DROPBITS(5);
+ state->ncode = BITS(4) + 4;
+ DROPBITS(4);
+#ifndef PKZIP_BUG_WORKAROUND
+ if (state->nlen > 286 || state->ndist > 30) {
+ strm->msg = (char *)"too many length or distance symbols";
+ state->mode = BAD;
+ break;
+ }
+#endif
+ Tracev((stderr, "inflate: table sizes ok\n"));
+ state->have = 0;
+ state->mode = LENLENS;
+ /* fallthrough */
+ case LENLENS:
+ while (state->have < state->ncode) {
+ NEEDBITS(3);
+ state->lens[order[state->have++]] = (unsigned short)BITS(3);
+ DROPBITS(3);
+ }
+ while (state->have < 19)
+ state->lens[order[state->have++]] = 0;
+ state->next = state->codes;
+ state->lencode = (const code FAR *)(state->next);
+ state->lenbits = 7;
+ ret = inflate_table(CODES, state->lens, 19, &(state->next),
+ &(state->lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid code lengths set";
+ state->mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: code lengths ok\n"));
+ state->have = 0;
+ state->mode = CODELENS;
+ /* fallthrough */
+ case CODELENS:
+ while (state->have < state->nlen + state->ndist) {
+ for (;;) {
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.val < 16) {
+ DROPBITS(here.bits);
+ state->lens[state->have++] = here.val;
+ }
+ else {
+ if (here.val == 16) {
+ NEEDBITS(here.bits + 2);
+ DROPBITS(here.bits);
+ if (state->have == 0) {
+ strm->msg = (char *)"invalid bit length repeat";
+ state->mode = BAD;
+ break;
+ }
+ len = state->lens[state->have - 1];
+ copy = 3 + BITS(2);
+ DROPBITS(2);
+ }
+ else if (here.val == 17) {
+ NEEDBITS(here.bits + 3);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 3 + BITS(3);
+ DROPBITS(3);
+ }
+ else {
+ NEEDBITS(here.bits + 7);
+ DROPBITS(here.bits);
+ len = 0;
+ copy = 11 + BITS(7);
+ DROPBITS(7);
+ }
+ if (state->have + copy > state->nlen + state->ndist) {
+ strm->msg = (char *)"invalid bit length repeat";
+ state->mode = BAD;
+ break;
+ }
+ while (copy--)
+ state->lens[state->have++] = (unsigned short)len;
+ }
+ }
+
+ /* handle error breaks in while */
+ if (state->mode == BAD) break;
+
+ /* check for end-of-block code (better have one) */
+ if (state->lens[256] == 0) {
+ strm->msg = (char *)"invalid code -- missing end-of-block";
+ state->mode = BAD;
+ break;
+ }
+
+ /* build code tables -- note: do not change the lenbits or distbits
+ values here (9 and 6) without reading the comments in inftrees.h
+ concerning the ENOUGH constants, which depend on those values */
+ state->next = state->codes;
+ state->lencode = (const code FAR *)(state->next);
+ state->lenbits = 9;
+ ret = inflate_table(LENS, state->lens, state->nlen, &(state->next),
+ &(state->lenbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid literal/lengths set";
+ state->mode = BAD;
+ break;
+ }
+ state->distcode = (const code FAR *)(state->next);
+ state->distbits = 6;
+ ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist,
+ &(state->next), &(state->distbits), state->work);
+ if (ret) {
+ strm->msg = (char *)"invalid distances set";
+ state->mode = BAD;
+ break;
+ }
+ Tracev((stderr, "inflate: codes ok\n"));
+ state->mode = LEN_;
+ if (flush == Z_TREES) goto inf_leave;
+ /* fallthrough */
+ case LEN_:
+ state->mode = LEN;
+ /* fallthrough */
+ case LEN:
+ if (have >= 6 && left >= 258) {
+ RESTORE();
+ inflate_fast(strm, out);
+ LOAD();
+ if (state->mode == TYPE)
+ state->back = -1;
+ break;
+ }
+ state->back = 0;
+ for (;;) {
+ here = state->lencode[BITS(state->lenbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if (here.op && (here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = state->lencode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ state->back += last.bits;
+ }
+ DROPBITS(here.bits);
+ state->back += here.bits;
+ state->length = (unsigned)here.val;
+ if ((int)(here.op) == 0) {
+ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
+ "inflate: literal '%c'\n" :
+ "inflate: literal 0x%02x\n", here.val));
+ state->mode = LIT;
+ break;
+ }
+ if (here.op & 32) {
+ Tracevv((stderr, "inflate: end of block\n"));
+ state->back = -1;
+ state->mode = TYPE;
+ break;
+ }
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid literal/length code";
+ state->mode = BAD;
+ break;
+ }
+ state->extra = (unsigned)(here.op) & 15;
+ state->mode = LENEXT;
+ /* fallthrough */
+ case LENEXT:
+ if (state->extra) {
+ NEEDBITS(state->extra);
+ state->length += BITS(state->extra);
+ DROPBITS(state->extra);
+ state->back += state->extra;
+ }
+ Tracevv((stderr, "inflate: length %u\n", state->length));
+ state->was = state->length;
+ state->mode = DIST;
+ /* fallthrough */
+ case DIST:
+ for (;;) {
+ here = state->distcode[BITS(state->distbits)];
+ if ((unsigned)(here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ if ((here.op & 0xf0) == 0) {
+ last = here;
+ for (;;) {
+ here = state->distcode[last.val +
+ (BITS(last.bits + last.op) >> last.bits)];
+ if ((unsigned)(last.bits + here.bits) <= bits) break;
+ PULLBYTE();
+ }
+ DROPBITS(last.bits);
+ state->back += last.bits;
+ }
+ DROPBITS(here.bits);
+ state->back += here.bits;
+ if (here.op & 64) {
+ strm->msg = (char *)"invalid distance code";
+ state->mode = BAD;
+ break;
+ }
+ state->offset = (unsigned)here.val;
+ state->extra = (unsigned)(here.op) & 15;
+ state->mode = DISTEXT;
+ /* fallthrough */
+ case DISTEXT:
+ if (state->extra) {
+ NEEDBITS(state->extra);
+ state->offset += BITS(state->extra);
+ DROPBITS(state->extra);
+ state->back += state->extra;
+ }
+#ifdef INFLATE_STRICT
+ if (state->offset > state->dmax) {
+ strm->msg = (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#endif
+ Tracevv((stderr, "inflate: distance %u\n", state->offset));
+ state->mode = MATCH;
+ /* fallthrough */
+ case MATCH:
+ if (left == 0) goto inf_leave;
+ copy = out - left;
+ if (state->offset > copy) { /* copy from window */
+ copy = state->offset - copy;
+ if (copy > state->whave) {
+ if (state->sane) {
+ strm->msg = (char *)"invalid distance too far back";
+ state->mode = BAD;
+ break;
+ }
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ Trace((stderr, "inflate.c too far\n"));
+ copy -= state->whave;
+ if (copy > state->length) copy = state->length;
+ if (copy > left) copy = left;
+ left -= copy;
+ state->length -= copy;
+ do {
+ *put++ = 0;
+ } while (--copy);
+ if (state->length == 0) state->mode = LEN;
+ break;
+#endif
+ }
+ if (copy > state->wnext) {
+ copy -= state->wnext;
+ from = state->window + (state->wsize - copy);
+ }
+ else
+ from = state->window + (state->wnext - copy);
+ if (copy > state->length) copy = state->length;
+ }
+ else { /* copy from output */
+ from = put - state->offset;
+ copy = state->length;
+ }
+ if (copy > left) copy = left;
+ left -= copy;
+ state->length -= copy;
+ do {
+ *put++ = *from++;
+ } while (--copy);
+ if (state->length == 0) state->mode = LEN;
+ break;
+ case LIT:
+ if (left == 0) goto inf_leave;
+ *put++ = (unsigned char)(state->length);
+ left--;
+ state->mode = LEN;
+ break;
+ case CHECK:
+ if (state->wrap) {
+ NEEDBITS(32);
+ out -= left;
+ strm->total_out += out;
+ state->total += out;
+ if ((state->wrap & 4) && out)
+ strm->adler = state->check =
+ UPDATE_CHECK(state->check, put - out, out);
+ out = left;
+ if ((state->wrap & 4) && (
+#ifdef GUNZIP
+ state->flags ? hold :
+#endif
+ ZSWAP32(hold)) != state->check) {
+ strm->msg = (char *)"incorrect data check";
+ state->mode = BAD;
+ break;
+ }
+ INITBITS();
+ Tracev((stderr, "inflate: check matches trailer\n"));
+ }
+#ifdef GUNZIP
+ state->mode = LENGTH;
+ /* fallthrough */
+ case LENGTH:
+ if (state->wrap && state->flags) {
+ NEEDBITS(32);
+ if ((state->wrap & 4) && hold != (state->total & 0xffffffff)) {
+ strm->msg = (char *)"incorrect length check";
+ state->mode = BAD;
+ break;
+ }
+ INITBITS();
+ Tracev((stderr, "inflate: length matches trailer\n"));
+ }
+#endif
+ state->mode = DONE;
+ /* fallthrough */
+ case DONE:
+ ret = Z_STREAM_END;
+ goto inf_leave;
+ case BAD:
+ ret = Z_DATA_ERROR;
+ goto inf_leave;
+ case MEM:
+ return Z_MEM_ERROR;
+ case SYNC:
+ /* fallthrough */
+ default:
+ return Z_STREAM_ERROR;
+ }
+
+ /*
+ Return from inflate(), updating the total counts and the check value.
+ If there was no progress during the inflate() call, return a buffer
+ error. Call updatewindow() to create and/or update the window state.
+ Note: a memory error from inflate() is non-recoverable.
+ */
+ inf_leave:
+ RESTORE();
+ if (state->wsize || (out != strm->avail_out && state->mode < BAD &&
+ (state->mode < CHECK || flush != Z_FINISH)))
+ if (updatewindow(strm, strm->next_out, out - strm->avail_out)) {
+ state->mode = MEM;
+ return Z_MEM_ERROR;
+ }
+ in -= strm->avail_in;
+ out -= strm->avail_out;
+ strm->total_in += in;
+ strm->total_out += out;
+ state->total += out;
+ if ((state->wrap & 4) && out)
+ strm->adler = state->check =
+ UPDATE_CHECK(state->check, strm->next_out - out, out);
+ strm->data_type = (int)state->bits + (state->last ? 64 : 0) +
+ (state->mode == TYPE ? 128 : 0) +
+ (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0);
+ if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK)
+ ret = Z_BUF_ERROR;
+ return ret;
+}
+
+int ZEXPORT inflateEnd(
+ z_streamp strm)
+{
+ struct inflate_state FAR *state;
+ if (inflateStateCheck(strm))
+ return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (state->window != Z_NULL) ZFREE(strm, state->window);
+ ZFREE(strm, strm->state);
+ strm->state = Z_NULL;
+ Tracev((stderr, "inflate: end\n"));
+ return Z_OK;
+}
+
+#ifndef Z_FREETYPE
+
+int ZEXPORT inflateGetDictionary(
+ z_streamp strm,
+ Bytef *dictionary,
+ uInt *dictLength)
+{
+ struct inflate_state FAR *state;
+
+ /* check state */
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+
+ /* copy dictionary */
+ if (state->whave && dictionary != Z_NULL) {
+ zmemcpy(dictionary, state->window + state->wnext,
+ state->whave - state->wnext);
+ zmemcpy(dictionary + state->whave - state->wnext,
+ state->window, state->wnext);
+ }
+ if (dictLength != Z_NULL)
+ *dictLength = state->whave;
+ return Z_OK;
+}
+
+int ZEXPORT inflateSetDictionary(
+ z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength)
+{
+ struct inflate_state FAR *state;
+ unsigned long dictid;
+ int ret;
+
+ /* check state */
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (state->wrap != 0 && state->mode != DICT)
+ return Z_STREAM_ERROR;
+
+ /* check for correct dictionary identifier */
+ if (state->mode == DICT) {
+ dictid = adler32(0L, Z_NULL, 0);
+ dictid = adler32(dictid, dictionary, dictLength);
+ if (dictid != state->check)
+ return Z_DATA_ERROR;
+ }
+
+ /* copy dictionary to window using updatewindow(), which will amend the
+ existing dictionary if appropriate */
+ ret = updatewindow(strm, dictionary + dictLength, dictLength);
+ if (ret) {
+ state->mode = MEM;
+ return Z_MEM_ERROR;
+ }
+ state->havedict = 1;
+ Tracev((stderr, "inflate: dictionary set\n"));
+ return Z_OK;
+}
+
+int ZEXPORT inflateGetHeader(
+ z_streamp strm,
+ gz_headerp head)
+{
+ struct inflate_state FAR *state;
+
+ /* check state */
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if ((state->wrap & 2) == 0) return Z_STREAM_ERROR;
+
+ /* save header structure */
+ state->head = head;
+ head->done = 0;
+ return Z_OK;
+}
+
+/*
+ Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found
+ or when out of input. When called, *have is the number of pattern bytes
+ found in order so far, in 0..3. On return *have is updated to the new
+ state. If on return *have equals four, then the pattern was found and the
+ return value is how many bytes were read including the last byte of the
+ pattern. If *have is less than four, then the pattern has not been found
+ yet and the return value is len. In the latter case, syncsearch() can be
+ called again with more data and the *have state. *have is initialized to
+ zero for the first call.
+ */
+local unsigned syncsearch(
+ unsigned FAR *have,
+ const unsigned char FAR *buf,
+ unsigned len)
+{
+ unsigned got;
+ unsigned next;
+
+ got = *have;
+ next = 0;
+ while (next < len && got < 4) {
+ if ((int)(buf[next]) == (got < 2 ? 0 : 0xff))
+ got++;
+ else if (buf[next])
+ got = 0;
+ else
+ got = 4 - got;
+ next++;
+ }
+ *have = got;
+ return next;
+}
+
+int ZEXPORT inflateSync(
+ z_streamp strm)
+{
+ unsigned len; /* number of bytes to look at or looked at */
+ int flags; /* temporary to save header status */
+ unsigned long in, out; /* temporary to save total_in and total_out */
+ unsigned char buf[4]; /* to restore bit buffer to byte string */
+ struct inflate_state FAR *state;
+
+ /* check parameters */
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR;
+
+ /* if first time, start search in bit buffer */
+ if (state->mode != SYNC) {
+ state->mode = SYNC;
+ state->hold <<= state->bits & 7;
+ state->bits -= state->bits & 7;
+ len = 0;
+ while (state->bits >= 8) {
+ buf[len++] = (unsigned char)(state->hold);
+ state->hold >>= 8;
+ state->bits -= 8;
+ }
+ state->have = 0;
+ syncsearch(&(state->have), buf, len);
+ }
+
+ /* search available input */
+ len = syncsearch(&(state->have), strm->next_in, strm->avail_in);
+ strm->avail_in -= len;
+ strm->next_in += len;
+ strm->total_in += len;
+
+ /* return no joy or set up to restart inflate() on a new block */
+ if (state->have != 4) return Z_DATA_ERROR;
+ if (state->flags == -1)
+ state->wrap = 0; /* if no header yet, treat as raw */
+ else
+ state->wrap &= ~4; /* no point in computing a check value now */
+ flags = state->flags;
+ in = strm->total_in; out = strm->total_out;
+ inflateReset(strm);
+ strm->total_in = in; strm->total_out = out;
+ state->flags = flags;
+ state->mode = TYPE;
+ return Z_OK;
+}
+
+#endif /* !Z_FREETYPE */
+
+/*
+ Returns true if inflate is currently at the end of a block generated by
+ Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+ implementation to provide an additional safety check. PPP uses
+ Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored
+ block. When decompressing, PPP checks that at the end of input packet,
+ inflate is waiting for these length bytes.
+ */
+int ZEXPORT inflateSyncPoint(
+ z_streamp strm)
+{
+ struct inflate_state FAR *state;
+
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ return state->mode == STORED && state->bits == 0;
+}
+
+#ifndef Z_FREETYPE
+
+int ZEXPORT inflateCopy(
+ z_streamp dest,
+ z_streamp source)
+{
+ struct inflate_state FAR *state;
+ struct inflate_state FAR *copy;
+ unsigned char FAR *window;
+ unsigned wsize;
+
+ /* check input */
+ if (inflateStateCheck(source) || dest == Z_NULL)
+ return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)source->state;
+
+ /* allocate space */
+ copy = (struct inflate_state FAR *)
+ ZALLOC(source, 1, sizeof(struct inflate_state));
+ if (copy == Z_NULL) return Z_MEM_ERROR;
+ window = Z_NULL;
+ if (state->window != Z_NULL) {
+ window = (unsigned char FAR *)
+ ZALLOC(source, 1U << state->wbits, sizeof(unsigned char));
+ if (window == Z_NULL) {
+ ZFREE(source, copy);
+ return Z_MEM_ERROR;
+ }
+ }
+
+ /* copy state */
+ zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream));
+ zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state));
+ copy->strm = dest;
+ if (state->lencode >= state->codes &&
+ state->lencode <= state->codes + ENOUGH - 1) {
+ copy->lencode = copy->codes + (state->lencode - state->codes);
+ copy->distcode = copy->codes + (state->distcode - state->codes);
+ }
+ copy->next = copy->codes + (state->next - state->codes);
+ if (window != Z_NULL) {
+ wsize = 1U << state->wbits;
+ zmemcpy(window, state->window, wsize);
+ }
+ copy->window = window;
+ dest->state = (struct internal_state FAR *)copy;
+ return Z_OK;
+}
+
+#endif /* !Z_FREETYPE */
+
+int ZEXPORT inflateUndermine(
+ z_streamp strm,
+ int subvert)
+{
+ struct inflate_state FAR *state;
+
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
+ state->sane = !subvert;
+ return Z_OK;
+#else
+ (void)subvert;
+ state->sane = 1;
+ return Z_DATA_ERROR;
+#endif
+}
+
+int ZEXPORT inflateValidate(
+ z_streamp strm,
+ int check)
+{
+ struct inflate_state FAR *state;
+
+ if (inflateStateCheck(strm)) return Z_STREAM_ERROR;
+ state = (struct inflate_state FAR *)strm->state;
+ if (check && state->wrap)
+ state->wrap |= 4;
+ else
+ state->wrap &= ~4;
+ return Z_OK;
+}
+
+#ifndef Z_FREETYPE
+
+long ZEXPORT inflateMark(
+ z_streamp strm)
+{
+ struct inflate_state FAR *state;
+
+ if (inflateStateCheck(strm))
+ return -(1L << 16);
+ state = (struct inflate_state FAR *)strm->state;
+ return (long)(((unsigned long)((long)state->back)) << 16) +
+ (state->mode == COPY ? state->length :
+ (state->mode == MATCH ? state->was - state->length : 0));
+}
+
+unsigned long ZEXPORT inflateCodesUsed(
+ z_streamp strm)
+{
+ struct inflate_state FAR *state;
+ if (inflateStateCheck(strm)) return (unsigned long)-1;
+ state = (struct inflate_state FAR *)strm->state;
+ return (unsigned long)(state->next - state->codes);
}
+#endif /* !Z_FREETYPE */
diff --git a/freetype/src/gzip/inflate.h b/freetype/src/gzip/inflate.h
new file mode 100644
index 00000000..c6f5a52e
--- /dev/null
+++ b/freetype/src/gzip/inflate.h
@@ -0,0 +1,131 @@
+/* inflate.h -- internal inflate state definition
+ * Copyright (C) 1995-2019 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+#ifndef INFLATE_H
+#define INFLATE_H
+
+/* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+ */
+
+/* define NO_GZIP when compiling if you want to disable gzip header and
+ trailer decoding by inflate(). NO_GZIP would be used to avoid linking in
+ the crc code when it is not needed. For shared libraries, gzip decoding
+ should be left enabled. */
+#ifndef NO_GZIP
+# define GUNZIP
+#endif
+
+/* Possible inflate modes between inflate() calls */
+typedef enum {
+ HEAD = 16180, /* i: waiting for magic header */
+ FLAGS, /* i: waiting for method and flags (gzip) */
+ TIME, /* i: waiting for modification time (gzip) */
+ OS, /* i: waiting for extra flags and operating system (gzip) */
+ EXLEN, /* i: waiting for extra length (gzip) */
+ EXTRA, /* i: waiting for extra bytes (gzip) */
+ NAME, /* i: waiting for end of file name (gzip) */
+ COMMENT, /* i: waiting for end of comment (gzip) */
+ HCRC, /* i: waiting for header crc (gzip) */
+ DICTID, /* i: waiting for dictionary check value */
+ DICT, /* waiting for inflateSetDictionary() call */
+ TYPE, /* i: waiting for type bits, including last-flag bit */
+ TYPEDO, /* i: same, but skip check to exit inflate on new block */
+ STORED, /* i: waiting for stored size (length and complement) */
+ COPY_, /* i/o: same as COPY below, but only first time in */
+ COPY, /* i/o: waiting for input or output to copy stored block */
+ TABLE, /* i: waiting for dynamic block table lengths */
+ LENLENS, /* i: waiting for code length code lengths */
+ CODELENS, /* i: waiting for length/lit and distance code lengths */
+ LEN_, /* i: same as LEN below, but only first time in */
+ LEN, /* i: waiting for length/lit/eob code */
+ LENEXT, /* i: waiting for length extra bits */
+ DIST, /* i: waiting for distance code */
+ DISTEXT, /* i: waiting for distance extra bits */
+ MATCH, /* o: waiting for output space to copy string */
+ LIT, /* o: waiting for output space to write literal */
+ CHECK, /* i: waiting for 32-bit check value */
+ LENGTH, /* i: waiting for 32-bit length (gzip) */
+ DONE, /* finished check, done -- remain here until reset */
+ BAD, /* got a data error -- remain here until reset */
+ MEM, /* got an inflate() memory error -- remain here until reset */
+ SYNC /* looking for synchronization bytes to restart inflate() */
+} inflate_mode;
+
+/*
+ State transitions between above modes -
+
+ (most modes can go to BAD or MEM on error -- not shown for clarity)
+
+ Process header:
+ HEAD -> (gzip) or (zlib) or (raw)
+ (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT ->
+ HCRC -> TYPE
+ (zlib) -> DICTID or TYPE
+ DICTID -> DICT -> TYPE
+ (raw) -> TYPEDO
+ Read deflate blocks:
+ TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK
+ STORED -> COPY_ -> COPY -> TYPE
+ TABLE -> LENLENS -> CODELENS -> LEN_
+ LEN_ -> LEN
+ Read deflate codes in fixed or dynamic block:
+ LEN -> LENEXT or LIT or TYPE
+ LENEXT -> DIST -> DISTEXT -> MATCH -> LEN
+ LIT -> LEN
+ Process trailer:
+ CHECK -> LENGTH -> DONE
+ */
+
+/* State maintained between inflate() calls -- approximately 7K bytes, not
+ including the allocated sliding window, which is up to 32K bytes. */
+struct inflate_state {
+ z_streamp strm; /* pointer back to this zlib stream */
+ inflate_mode mode; /* current inflate mode */
+ int last; /* true if processing last block */
+ int wrap; /* bit 0 true for zlib, bit 1 true for gzip,
+ bit 2 true to validate check value */
+ int havedict; /* true if dictionary provided */
+ int flags; /* gzip header method and flags, 0 if zlib, or
+ -1 if raw or no header yet */
+ unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */
+ unsigned long check; /* protected copy of check value */
+ unsigned long total; /* protected copy of output count */
+ gz_headerp head; /* where to save gzip header information */
+ /* sliding window */
+ unsigned wbits; /* log base 2 of requested window size */
+ unsigned wsize; /* window size or zero if not using window */
+ unsigned whave; /* valid bytes in the window */
+ unsigned wnext; /* window write index */
+ unsigned char FAR *window; /* allocated sliding window, if needed */
+ /* bit accumulator */
+ unsigned long hold; /* input bit accumulator */
+ unsigned bits; /* number of bits in "in" */
+ /* for string and stored block copying */
+ unsigned length; /* literal or length of data to copy */
+ unsigned offset; /* distance back to copy string from */
+ /* for table and code decoding */
+ unsigned extra; /* extra bits needed */
+ /* fixed and dynamic code tables */
+ code const FAR *lencode; /* starting table for length/literal codes */
+ code const FAR *distcode; /* starting table for distance codes */
+ unsigned lenbits; /* index bits for lencode */
+ unsigned distbits; /* index bits for distcode */
+ /* dynamic table building */
+ unsigned ncode; /* number of code length code lengths */
+ unsigned nlen; /* number of length code lengths */
+ unsigned ndist; /* number of distance code lengths */
+ unsigned have; /* number of code lengths in lens[] */
+ code FAR *next; /* next available space in codes[] */
+ unsigned short lens[320]; /* temporary storage for code lengths */
+ unsigned short work[288]; /* work area for code table building */
+ code codes[ENOUGH]; /* space for code tables */
+ int sane; /* if false, allow invalid distance too far */
+ int back; /* bits back of last unprocessed length/lit */
+ unsigned was; /* initial length of match */
+};
+
+#endif /* INFLATE_H */
diff --git a/freetype/src/gzip/inftrees.c b/freetype/src/gzip/inftrees.c
index 56f52b17..0b58b29b 100644
--- a/freetype/src/gzip/inftrees.c
+++ b/freetype/src/gzip/inftrees.c
@@ -1,20 +1,15 @@
/* inftrees.c -- generate Huffman trees for efficient decoding
- * Copyright (C) 1995-2002 Mark Adler
+ * Copyright (C) 1995-2022 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
#include "zutil.h"
#include "inftrees.h"
-#if !defined(BUILDFIXED) && !defined(STDC)
-# define BUILDFIXED /* non ANSI compilers may not accept inffixed.h */
-#endif
+#define MAXBITS 15
-
-#if 0
-local const char inflate_copyright[] =
- " inflate 1.1.4 Copyright 1995-2002 Mark Adler ";
-#endif
+const char inflate_copyright[] =
+ " inflate 1.2.12 Copyright 1995-2022 Mark Adler ";
/*
If you use the zlib library in a product, an acknowledgment is welcome
in the documentation of your product. If for some reason you cannot
@@ -22,447 +17,288 @@ local const char inflate_copyright[] =
copyright string in the executable of your product.
*/
-/* simplify the use of the inflate_huft type with some defines */
-#define exop word.what.Exop
-#define bits word.what.Bits
-
-
-local int huft_build OF((
- uIntf *, /* code lengths in bits */
- uInt, /* number of codes */
- uInt, /* number of "simple" codes */
- const uIntf *, /* list of base values for non-simple codes */
- const uIntf *, /* list of extra bits for non-simple codes */
- inflate_huft * FAR*,/* result: starting table */
- uIntf *, /* maximum lookup bits (returns actual) */
- inflate_huft *, /* space for trees */
- uInt *, /* hufts used in space */
- uIntf * )); /* space for values */
-
-/* Tables for deflate from PKZIP's appnote.txt. */
-local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
+/*
+ Build a set of tables to decode the provided canonical Huffman code.
+ The code lengths are lens[0..codes-1]. The result starts at *table,
+ whose indices are 0..2^bits-1. work is a writable array of at least
+ lens shorts, which is used as a work area. type is the type of code
+ to be generated, CODES, LENS, or DISTS. On return, zero is success,
+ -1 is an invalid code, and +1 means that ENOUGH isn't enough. table
+ on return points to the next available entry's address. bits is the
+ requested root table index bits, and on return it is the actual root
+ table index bits. It will differ if the request is greater than the
+ longest code or if it is less than the shortest code.
+ */
+int ZLIB_INTERNAL inflate_table(
+ codetype type,
+ unsigned short FAR *lens,
+ unsigned codes,
+ code FAR * FAR *table,
+ unsigned FAR *bits,
+ unsigned short FAR *work)
+{
+ unsigned len; /* a code's length in bits */
+ unsigned sym; /* index of code symbols */
+ unsigned min, max; /* minimum and maximum code lengths */
+ unsigned root; /* number of index bits for root table */
+ unsigned curr; /* number of index bits for current table */
+ unsigned drop; /* code bits to drop for sub-table */
+ int left; /* number of prefix codes available */
+ unsigned used; /* code entries in table used */
+ unsigned huff; /* Huffman code */
+ unsigned incr; /* for incrementing code, index */
+ unsigned fill; /* index for replicating entries */
+ unsigned low; /* low bits for current root entry */
+ unsigned mask; /* mask for low root bits */
+ code here; /* table entry for duplication */
+ code FAR *next; /* next available space in table */
+ const unsigned short FAR *base; /* base value table to use */
+ const unsigned short FAR *extra; /* extra bits table to use */
+ unsigned match; /* use base and extra for symbol >= match */
+ unsigned short count[MAXBITS+1]; /* number of codes of each length */
+ unsigned short offs[MAXBITS+1]; /* offsets in table for each length */
+ static const unsigned short lbase[31] = { /* Length codes 257..285 base */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
- /* see note #13 above about 258 */
-local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
- 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112}; /* 112==invalid */
-local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
+ static const unsigned short lext[31] = { /* Length codes 257..285 extra */
+ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
+ 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202};
+ static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
- 8193, 12289, 16385, 24577};
-local const uInt cpdext[30] = { /* Extra bits for distance codes */
- 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
- 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
- 12, 12, 13, 13};
-
-/*
- Huffman code decoding is performed using a multi-level table lookup.
- The fastest way to decode is to simply build a lookup table whose
- size is determined by the longest code. However, the time it takes
- to build this table can also be a factor if the data being decoded
- is not very long. The most common codes are necessarily the
- shortest codes, so those codes dominate the decoding time, and hence
- the speed. The idea is you can have a shorter table that decodes the
- shorter, more probable codes, and then point to subsidiary tables for
- the longer codes. The time it costs to decode the longer codes is
- then traded against the time it takes to make longer tables.
-
- This results of this trade are in the variables lbits and dbits
- below. lbits is the number of bits the first level table for literal/
- length codes can decode in one step, and dbits is the same thing for
- the distance codes. Subsequent tables are also less than or equal to
- those sizes. These values may be adjusted either when all of the
- codes are shorter than that, in which case the longest code length in
- bits is used, or when the shortest code is *longer* than the requested
- table size, in which case the length of the shortest code in bits is
- used.
-
- There are two different values for the two tables, since they code a
- different number of possibilities each. The literal/length table
- codes 286 possible values, or in a flat code, a little over eight
- bits. The distance table codes 30 possible values, or a little less
- than five bits, flat. The optimum values for speed end up being
- about one bit more than those, so lbits is 8+1 and dbits is 5+1.
- The optimum values may differ though from machine to machine, and
- possibly even between compilers. Your mileage may vary.
- */
-
-
-/* If BMAX needs to be larger than 16, then h and x[] should be uLong. */
-#define BMAX 15 /* maximum bit length of any code */
-
-local int huft_build( /* b, n, s, d, e, t, m, hp, hn, v) */
-uIntf *b, /* code lengths in bits (all assumed <= BMAX) */
-uInt n, /* number of codes (assumed <= 288) */
-uInt s, /* number of simple-valued codes (0..s-1) */
-const uIntf *d, /* list of base values for non-simple codes */
-const uIntf *e, /* list of extra bits for non-simple codes */
-inflate_huft * FAR *t, /* result: starting table */
-uIntf *m, /* maximum lookup bits, returns actual */
-inflate_huft *hp, /* space for trees */
-uInt *hn, /* hufts used in space */
-uIntf *v /* working area: values in order of bit length */
-/* Given a list of code lengths and a maximum table size, make a set of
- tables to decode that set of codes. Return Z_OK on success, Z_BUF_ERROR
- if the given code set is incomplete (the tables are still built in this
- case), or Z_DATA_ERROR if the input is invalid. */
-)
-{
+ 8193, 12289, 16385, 24577, 0, 0};
+ static const unsigned short dext[32] = { /* Distance codes 0..29 extra */
+ 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
+ 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
+ 28, 28, 29, 29, 64, 64};
+
+ /*
+ Process a set of code lengths to create a canonical Huffman code. The
+ code lengths are lens[0..codes-1]. Each length corresponds to the
+ symbols 0..codes-1. The Huffman code is generated by first sorting the
+ symbols by length from short to long, and retaining the symbol order
+ for codes with equal lengths. Then the code starts with all zero bits
+ for the first code of the shortest length, and the codes are integer
+ increments for the same length, and zeros are appended as the length
+ increases. For the deflate format, these bits are stored backwards
+ from their more natural integer increment ordering, and so when the
+ decoding tables are built in the large loop below, the integer codes
+ are incremented backwards.
+
+ This routine assumes, but does not check, that all of the entries in
+ lens[] are in the range 0..MAXBITS. The caller must assure this.
+ 1..MAXBITS is interpreted as that code length. zero means that that
+ symbol does not occur in this code.
+
+ The codes are sorted by computing a count of codes for each length,
+ creating from that a table of starting indices for each length in the
+ sorted table, and then entering the symbols in order in the sorted
+ table. The sorted table is work[], with that space being provided by
+ the caller.
+
+ The length counts are used for other purposes as well, i.e. finding
+ the minimum and maximum length codes, determining if there are any
+ codes at all, checking for a valid set of lengths, and looking ahead
+ at length counts to determine sub-table sizes when building the
+ decoding tables.
+ */
+
+ /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
+ for (len = 0; len <= MAXBITS; len++)
+ count[len] = 0;
+ for (sym = 0; sym < codes; sym++)
+ count[lens[sym]]++;
+
+ /* bound code lengths, force root to be within code lengths */
+ root = *bits;
+ for (max = MAXBITS; max >= 1; max--)
+ if (count[max] != 0) break;
+ if (root > max) root = max;
+ if (max == 0) { /* no symbols to code at all */
+ here.op = (unsigned char)64; /* invalid code marker */
+ here.bits = (unsigned char)1;
+ here.val = (unsigned short)0;
+ *(*table)++ = here; /* make a table to force an error */
+ *(*table)++ = here;
+ *bits = 1;
+ return 0; /* no symbols, but wait for decoding to report error */
+ }
+ for (min = 1; min < max; min++)
+ if (count[min] != 0) break;
+ if (root < min) root = min;
+
+ /* check for an over-subscribed or incomplete set of lengths */
+ left = 1;
+ for (len = 1; len <= MAXBITS; len++) {
+ left <<= 1;
+ left -= count[len];
+ if (left < 0) return -1; /* over-subscribed */
+ }
+ if (left > 0 && (type == CODES || max != 1))
+ return -1; /* incomplete set */
+
+ /* generate offsets into symbol table for each length for sorting */
+ offs[1] = 0;
+ for (len = 1; len < MAXBITS; len++)
+ offs[len + 1] = offs[len] + count[len];
+
+ /* sort symbols by length, by symbol order within each length */
+ for (sym = 0; sym < codes; sym++)
+ if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym;
+
+ /*
+ Create and fill in decoding tables. In this loop, the table being
+ filled is at next and has curr index bits. The code being used is huff
+ with length len. That code is converted to an index by dropping drop
+ bits off of the bottom. For codes where len is less than drop + curr,
+ those top drop + curr - len bits are incremented through all values to
+ fill the table with replicated entries.
+
+ root is the number of index bits for the root table. When len exceeds
+ root, sub-tables are created pointed to by the root entry with an index
+ of the low root bits of huff. This is saved in low to check for when a
+ new sub-table should be started. drop is zero when the root table is
+ being filled, and drop is root when sub-tables are being filled.
+
+ When a new sub-table is needed, it is necessary to look ahead in the
+ code lengths to determine what size sub-table is needed. The length
+ counts are used for this, and so count[] is decremented as codes are
+ entered in the tables.
+
+ used keeps track of how many table entries have been allocated from the
+ provided *table space. It is checked for LENS and DIST tables against
+ the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
+ the initial root table size constants. See the comments in inftrees.h
+ for more information.
+
+ sym increments through all symbols, and the loop terminates when
+ all codes of length max, i.e. all codes, have been processed. This
+ routine permits incomplete codes, so another loop after this one fills
+ in the rest of the decoding tables with invalid code markers.
+ */
+
+ /* set up for code type */
+ switch (type) {
+ case CODES:
+ base = extra = work; /* dummy value--not used */
+ match = 20;
+ break;
+ case LENS:
+ base = lbase;
+ extra = lext;
+ match = 257;
+ break;
+ default: /* DISTS */
+ base = dbase;
+ extra = dext;
+ match = 0;
+ }
- uInt a; /* counter for codes of length k */
- uInt c[BMAX+1]; /* bit length count table */
- uInt f; /* i repeats in table every f entries */
- int g; /* maximum code length */
- int h; /* table level */
- uInt i; /* counter, current code */
- uInt j; /* counter */
- int k; /* number of bits in current code */
- int l; /* bits per table (returned in m) */
- uInt mask; /* (1 << w) - 1, to avoid cc -O bug on HP */
- uIntf *p; /* pointer into c[], b[], or v[] */
- inflate_huft *q; /* points to current table */
- struct inflate_huft_s r; /* table entry for structure assignment */
- inflate_huft *u[BMAX]; /* table stack */
- int w; /* bits before this table == (l * h) */
- uInt x[BMAX+1]; /* bit offsets, then code stack */
- uIntf *xp; /* pointer into x */
- int y; /* number of dummy codes added */
- uInt z; /* number of entries in current table */
-
-
- /* Make compiler happy */
- r.base = 0;
-
- /* Generate counts for each bit length */
- p = c;
-#define C0 *p++ = 0;
-#define C2 C0 C0 C0 C0
-#define C4 C2 C2 C2 C2
- C4 /* clear c[]--assume BMAX+1 is 16 */
- p = b; i = n;
- do {
- c[*p++]++; /* assume all entries <= BMAX */
- } while (--i);
- if (c[0] == n) /* null input--all zero length codes */
- {
- *t = (inflate_huft *)Z_NULL;
- *m = 0;
- return Z_OK;
- }
-
-
- /* Find minimum and maximum length, bound *m by those */
- l = *m;
- for (j = 1; j <= BMAX; j++)
- if (c[j])
- break;
- k = j; /* minimum code length */
- if ((uInt)l < j)
- l = j;
- for (i = BMAX; i; i--)
- if (c[i])
- break;
- g = i; /* maximum code length */
- if ((uInt)l > i)
- l = i;
- *m = l;
-
-
- /* Adjust last length count to fill out codes, if needed */
- for (y = 1 << j; j < i; j++, y <<= 1)
- if ((y -= c[j]) < 0)
- return Z_DATA_ERROR;
- if ((y -= c[i]) < 0)
- return Z_DATA_ERROR;
- c[i] += y;
-
-
- /* Generate starting offsets into the value table for each length */
- x[1] = j = 0;
- p = c + 1; xp = x + 2;
- while (--i) { /* note that i == g from above */
- *xp++ = (j += *p++);
- }
-
-
- /* Make a table of values in order of bit lengths */
- p = b; i = 0;
- do {
- if ((j = *p++) != 0)
- v[x[j]++] = i;
- } while (++i < n);
- n = x[g]; /* set n to length of v */
-
-
- /* Generate the Huffman codes and for each, make the table entries */
- x[0] = i = 0; /* first Huffman code is zero */
- p = v; /* grab values in bit order */
- h = -1; /* no tables yet--level -1 */
- w = -l; /* bits decoded == (l * h) */
- u[0] = (inflate_huft *)Z_NULL; /* just to keep compilers happy */
- q = (inflate_huft *)Z_NULL; /* ditto */
- z = 0; /* ditto */
-
- /* go through the bit lengths (k already is bits in shortest code) */
- for (; k <= g; k++)
- {
- a = c[k];
- while (a--)
- {
- /* here i is the Huffman code of length k bits for value *p */
- /* make tables up to required level */
- while (k > w + l)
- {
- h++;
- w += l; /* previous table always l bits */
-
- /* compute minimum size table less than or equal to l bits */
- z = g - w;
- z = z > (uInt)l ? (uInt)l : z; /* table size upper limit */
- if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */
- { /* too few codes for k-w bit table */
- f -= a + 1; /* deduct codes from patterns left */
- xp = c + k;
- if (j < z)
- while (++j < z) /* try smaller tables up to z bits */
- {
- if ((f <<= 1) <= *++xp)
- break; /* enough codes to use up j bits */
- f -= *xp; /* else deduct codes from patterns */
- }
+ /* initialize state for loop */
+ huff = 0; /* starting code */
+ sym = 0; /* starting code symbol */
+ len = min; /* starting code length */
+ next = *table; /* current table to fill in */
+ curr = root; /* current table index bits */
+ drop = 0; /* current bits to drop from code for index */
+ low = (unsigned)(-1); /* trigger new sub-table when len > root */
+ used = 1U << root; /* use root table entries */
+ mask = used - 1; /* mask for comparing low */
+
+ /* check available table space */
+ if ((type == LENS && used > ENOUGH_LENS) ||
+ (type == DISTS && used > ENOUGH_DISTS))
+ return 1;
+
+ /* process all codes and make table entries */
+ for (;;) {
+ /* create table entry */
+ here.bits = (unsigned char)(len - drop);
+ if (work[sym] + 1U < match) {
+ here.op = (unsigned char)0;
+ here.val = work[sym];
}
- z = 1 << j; /* table entries for j-bit table */
-
- /* allocate new table */
- if (*hn + z > MANY) /* (note: doesn't matter for fixed) */
- return Z_DATA_ERROR; /* overflow of MANY */
- u[h] = q = hp + *hn;
- *hn += z;
-
- /* connect to last table, if there is one */
- if (h)
- {
- x[h] = i; /* save pattern for backing up */
- r.bits = (Byte)l; /* bits to dump before this table */
- r.exop = (Byte)j; /* bits in this table */
- j = i >> (w - l);
- r.base = (uInt)(q - u[h-1] - j); /* offset to this table */
- u[h-1][j] = r; /* connect to last table */
+ else if (work[sym] >= match) {
+ here.op = (unsigned char)(extra[work[sym] - match]);
+ here.val = base[work[sym] - match];
+ }
+ else {
+ here.op = (unsigned char)(32 + 64); /* end of block */
+ here.val = 0;
}
- else
- *t = q; /* first table is returned result */
- }
-
- /* set up table entry in r */
- r.bits = (Byte)(k - w);
- if (p >= v + n)
- r.exop = 128 + 64; /* out of values--invalid code */
- else if (*p < s)
- {
- r.exop = (Byte)(*p < 256 ? 0 : 32 + 64); /* 256 is end-of-block */
- r.base = *p++; /* simple code is just the value */
- }
- else
- {
- r.exop = (Byte)(e[*p - s] + 16 + 64);/* non-simple--look up in lists */
- r.base = d[*p++ - s];
- }
-
- /* fill code-like entries with r */
- f = 1 << (k - w);
- for (j = i >> w; j < z; j += f)
- q[j] = r;
-
- /* backwards increment the k-bit code i */
- for (j = 1 << (k - 1); i & j; j >>= 1)
- i ^= j;
- i ^= j;
-
- /* backup over finished tables */
- mask = (1 << w) - 1; /* needed on HP, cc -O bug */
- while ((i & mask) != x[h])
- {
- h--; /* don't need to update q */
- w -= l;
- mask = (1 << w) - 1;
- }
- }
- }
-
-
- /* Return Z_BUF_ERROR if we were given an incomplete table */
- return y != 0 && g != 1 ? Z_BUF_ERROR : Z_OK;
-}
+ /* replicate for those indices with low len bits equal to huff */
+ incr = 1U << (len - drop);
+ fill = 1U << curr;
+ min = fill; /* save offset to next table */
+ do {
+ fill -= incr;
+ next[(huff >> drop) + fill] = here;
+ } while (fill != 0);
+
+ /* backwards increment the len-bit code huff */
+ incr = 1U << (len - 1);
+ while (huff & incr)
+ incr >>= 1;
+ if (incr != 0) {
+ huff &= incr - 1;
+ huff += incr;
+ }
+ else
+ huff = 0;
-local int inflate_trees_bits( /* c, bb, tb, hp, z) */
-uIntf *c, /* 19 code lengths */
-uIntf *bb, /* bits tree desired/actual depth */
-inflate_huft * FAR *tb, /* bits tree result */
-inflate_huft *hp, /* space for trees */
-z_streamp z /* for messages */
-)
-{
- int r;
- uInt hn = 0; /* hufts used in space */
- uIntf *v; /* work area for huft_build */
-
- if ((v = (uIntf*)ZALLOC(z, 19, sizeof(uInt))) == Z_NULL)
- return Z_MEM_ERROR;
- r = huft_build(c, 19, 19, (uIntf*)Z_NULL, (uIntf*)Z_NULL,
- tb, bb, hp, &hn, v);
- if (r == Z_DATA_ERROR)
- z->msg = (char*)"oversubscribed dynamic bit lengths tree";
- else if (r == Z_BUF_ERROR || *bb == 0)
- {
- z->msg = (char*)"incomplete dynamic bit lengths tree";
- r = Z_DATA_ERROR;
- }
- ZFREE(z, v);
- return r;
-}
+ /* go to next symbol, update count, len */
+ sym++;
+ if (--(count[len]) == 0) {
+ if (len == max) break;
+ len = lens[work[sym]];
+ }
+ /* create new sub-table if needed */
+ if (len > root && (huff & mask) != low) {
+ /* if first time, transition to sub-tables */
+ if (drop == 0)
+ drop = root;
+
+ /* increment past last table */
+ next += min; /* here min is 1 << curr */
+
+ /* determine length of next table */
+ curr = len - drop;
+ left = (int)(1 << curr);
+ while (curr + drop < max) {
+ left -= count[curr + drop];
+ if (left <= 0) break;
+ curr++;
+ left <<= 1;
+ }
-local int inflate_trees_dynamic( /* nl, nd, c, bl, bd, tl, td, hp, z) */
-uInt nl, /* number of literal/length codes */
-uInt nd, /* number of distance codes */
-uIntf *c, /* that many (total) code lengths */
-uIntf *bl, /* literal desired/actual bit depth */
-uIntf *bd, /* distance desired/actual bit depth */
-inflate_huft * FAR *tl, /* literal/length tree result */
-inflate_huft * FAR *td, /* distance tree result */
-inflate_huft *hp, /* space for trees */
-z_streamp z /* for messages */
-)
-{
- int r;
- uInt hn = 0; /* hufts used in space */
- uIntf *v; /* work area for huft_build */
-
- /* allocate work area */
- if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
- return Z_MEM_ERROR;
-
- /* build literal/length tree */
- r = huft_build(c, nl, 257, cplens, cplext, tl, bl, hp, &hn, v);
- if (r != Z_OK || *bl == 0)
- {
- if (r == Z_DATA_ERROR)
- z->msg = (char*)"oversubscribed literal/length tree";
- else if (r != Z_MEM_ERROR)
- {
- z->msg = (char*)"incomplete literal/length tree";
- r = Z_DATA_ERROR;
- }
- ZFREE(z, v);
- return r;
- }
-
- /* build distance tree */
- r = huft_build(c + nl, nd, 0, cpdist, cpdext, td, bd, hp, &hn, v);
- if (r != Z_OK || (*bd == 0 && nl > 257))
- {
- if (r == Z_DATA_ERROR)
- z->msg = (char*)"oversubscribed distance tree";
- else if (r == Z_BUF_ERROR) {
-#if 0
- {
-#endif
-#ifdef PKZIP_BUG_WORKAROUND
- r = Z_OK;
- }
-#else
- z->msg = (char*)"incomplete distance tree";
- r = Z_DATA_ERROR;
- }
- else if (r != Z_MEM_ERROR)
- {
- z->msg = (char*)"empty distance tree with lengths";
- r = Z_DATA_ERROR;
+ /* check for enough space */
+ used += 1U << curr;
+ if ((type == LENS && used > ENOUGH_LENS) ||
+ (type == DISTS && used > ENOUGH_DISTS))
+ return 1;
+
+ /* point entry in root table to sub-table */
+ low = huff & mask;
+ (*table)[low].op = (unsigned char)curr;
+ (*table)[low].bits = (unsigned char)root;
+ (*table)[low].val = (unsigned short)(next - *table);
+ }
}
- ZFREE(z, v);
- return r;
-#endif
- }
-
- /* done */
- ZFREE(z, v);
- return Z_OK;
-}
-
-/* build fixed tables only once--keep them here */
-#ifdef BUILDFIXED
-local int fixed_built = 0;
-#define FIXEDH 544 /* number of hufts used by fixed tables */
-local inflate_huft fixed_mem[FIXEDH];
-local uInt fixed_bl;
-local uInt fixed_bd;
-local inflate_huft *fixed_tl;
-local inflate_huft *fixed_td;
-#else
-#include "inffixed.h"
-#endif
-
-
-local int inflate_trees_fixed( /* bl, bd, tl, td, z) */
-uIntf *bl, /* literal desired/actual bit depth */
-uIntf *bd, /* distance desired/actual bit depth */
-const inflate_huft * FAR *tl, /* literal/length tree result */
-const inflate_huft * FAR *td, /* distance tree result */
-z_streamp z /* for memory allocation */
-)
-{
-#ifdef BUILDFIXED
- /* build fixed tables if not already */
- if (!fixed_built)
- {
- int k; /* temporary variable */
- uInt f = 0; /* number of hufts used in fixed_mem */
- uIntf *c; /* length list for huft_build */
- uIntf *v; /* work area for huft_build */
-
- /* allocate memory */
- if ((c = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
- return Z_MEM_ERROR;
- if ((v = (uIntf*)ZALLOC(z, 288, sizeof(uInt))) == Z_NULL)
- {
- ZFREE(z, c);
- return Z_MEM_ERROR;
+ /* fill in remaining table entry if code is incomplete (guaranteed to have
+ at most one remaining entry, since if the code is incomplete, the
+ maximum code length that was allowed to get this far is one bit) */
+ if (huff != 0) {
+ here.op = (unsigned char)64; /* invalid code marker */
+ here.bits = (unsigned char)(len - drop);
+ here.val = (unsigned short)0;
+ next[huff] = here;
}
- /* literal table */
- for (k = 0; k < 144; k++)
- c[k] = 8;
- for (; k < 256; k++)
- c[k] = 9;
- for (; k < 280; k++)
- c[k] = 7;
- for (; k < 288; k++)
- c[k] = 8;
- fixed_bl = 9;
- huft_build(c, 288, 257, cplens, cplext, &fixed_tl, &fixed_bl,
- fixed_mem, &f, v);
-
- /* distance table */
- for (k = 0; k < 30; k++)
- c[k] = 5;
- fixed_bd = 5;
- huft_build(c, 30, 0, cpdist, cpdext, &fixed_td, &fixed_bd,
- fixed_mem, &f, v);
-
- /* done */
- ZFREE(z, v);
- ZFREE(z, c);
- fixed_built = 1;
- }
-#else
- FT_UNUSED(z);
-#endif
- *bl = fixed_bl;
- *bd = fixed_bd;
- *tl = fixed_tl;
- *td = fixed_td;
- return Z_OK;
+ /* set return parameters */
+ *table += used;
+ *bits = root;
+ return 0;
}
diff --git a/freetype/src/gzip/inftrees.h b/freetype/src/gzip/inftrees.h
index 07bf2aa0..c94eb78b 100644
--- a/freetype/src/gzip/inftrees.h
+++ b/freetype/src/gzip/inftrees.h
@@ -1,63 +1,67 @@
/* inftrees.h -- header to use inftrees.c
- * Copyright (C) 1995-2002 Mark Adler
+ * Copyright (C) 1995-2005, 2010 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
+#ifndef INFTREES_H
+#define INFTREES_H
+
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
-/* Huffman code lookup table entry--this entry is four bytes for machines
- that have 16-bit pointers (e.g. PC's in the small or medium model). */
-
-#ifndef _INFTREES_H
-#define _INFTREES_H
-
-typedef struct inflate_huft_s FAR inflate_huft;
-
-struct inflate_huft_s {
- union {
- struct {
- Byte Exop; /* number of extra bits or operation */
- Byte Bits; /* number of bits in this code or subcode */
- } what;
- uInt pad; /* pad structure to a power of 2 (4 bytes for */
- } word; /* 16-bit, 8 bytes for 32-bit int's) */
- uInt base; /* literal, length base, distance base,
- or table offset */
-};
-
-/* Maximum size of dynamic tree. The maximum found in a long but non-
- exhaustive search was 1004 huft structures (850 for length/literals
- and 154 for distances, the latter actually the result of an
- exhaustive search). The actual maximum is not known, but the
- value below is more than safe. */
-#define MANY 1440
-
-local int inflate_trees_bits OF((
- uIntf *, /* 19 code lengths */
- uIntf *, /* bits tree desired/actual depth */
- inflate_huft * FAR *, /* bits tree result */
- inflate_huft *, /* space for trees */
- z_streamp)); /* for messages */
-
-local int inflate_trees_dynamic OF((
- uInt, /* number of literal/length codes */
- uInt, /* number of distance codes */
- uIntf *, /* that many (total) code lengths */
- uIntf *, /* literal desired/actual bit depth */
- uIntf *, /* distance desired/actual bit depth */
- inflate_huft * FAR *, /* literal/length tree result */
- inflate_huft * FAR *, /* distance tree result */
- inflate_huft *, /* space for trees */
- z_streamp)); /* for messages */
-
-local int inflate_trees_fixed OF((
- uIntf *, /* literal desired/actual bit depth */
- uIntf *, /* distance desired/actual bit depth */
- const inflate_huft * FAR *, /* literal/length tree result */
- const inflate_huft * FAR *, /* distance tree result */
- z_streamp)); /* for memory allocation */
-
-#endif /* _INFTREES_H */
+/* Structure for decoding tables. Each entry provides either the
+ information needed to do the operation requested by the code that
+ indexed that table entry, or it provides a pointer to another
+ table that indexes more bits of the code. op indicates whether
+ the entry is a pointer to another table, a literal, a length or
+ distance, an end-of-block, or an invalid code. For a table
+ pointer, the low four bits of op is the number of index bits of
+ that table. For a length or distance, the low four bits of op
+ is the number of extra bits to get after the code. bits is
+ the number of bits in this code or part of the code to drop off
+ of the bit buffer. val is the actual byte to output in the case
+ of a literal, the base length or distance, or the offset from
+ the current table to the next table. Each entry is four bytes. */
+typedef struct {
+ unsigned char op; /* operation, extra bits, table bits */
+ unsigned char bits; /* bits in this part of the code */
+ unsigned short val; /* offset in table or code value */
+} code;
+
+/* op values as set by inflate_table():
+ 00000000 - literal
+ 0000tttt - table link, tttt != 0 is the number of table index bits
+ 0001eeee - length or distance, eeee is the number of extra bits
+ 01100000 - end of block
+ 01000000 - invalid code
+ */
+
+/* Maximum size of the dynamic table. The maximum number of code structures is
+ 1444, which is the sum of 852 for literal/length codes and 592 for distance
+ codes. These values were found by exhaustive searches using the program
+ examples/enough.c found in the zlib distribtution. The arguments to that
+ program are the number of symbols, the initial root table size, and the
+ maximum bit length of a code. "enough 286 9 15" for literal/length codes
+ returns returns 852, and "enough 30 6 15" for distance codes returns 592.
+ The initial root table size (9 or 6) is found in the fifth argument of the
+ inflate_table() calls in inflate.c and infback.c. If the root table size is
+ changed, then these maximum sizes would be need to be recalculated and
+ updated. */
+#define ENOUGH_LENS 852
+#define ENOUGH_DISTS 592
+#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS)
+
+/* Type of code to build for inflate_table() */
+typedef enum {
+ CODES,
+ LENS,
+ DISTS
+} codetype;
+
+int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
+ unsigned codes, code FAR * FAR *table,
+ unsigned FAR *bits, unsigned short FAR *work));
+
+#endif /* INFTREES_H_ */
diff --git a/freetype/src/gzip/infutil.c b/freetype/src/gzip/infutil.c
deleted file mode 100644
index 6087b406..00000000
--- a/freetype/src/gzip/infutil.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* inflate_util.c -- data and routines common to blocks and codes
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-#include "zutil.h"
-#include "infblock.h"
-#include "inftrees.h"
-#include "infcodes.h"
-#include "infutil.h"
-
-
-/* And'ing with mask[n] masks the lower n bits */
-local const uInt inflate_mask[17] = {
- 0x0000,
- 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
- 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
-};
-
-
-/* copy as much as possible from the sliding window to the output area */
-local int inflate_flush( /* s, z, r) */
-inflate_blocks_statef *s,
-z_streamp z,
-int r )
-{
- uInt n;
- Bytef *p;
- Bytef *q;
-
- /* local copies of source and destination pointers */
- p = z->next_out;
- q = s->read;
-
- /* compute number of bytes to copy as far as end of window */
- n = (uInt)((q <= s->write ? s->write : s->end) - q);
- if (n > z->avail_out) n = z->avail_out;
- if (n && r == Z_BUF_ERROR) r = Z_OK;
-
- /* update counters */
- z->avail_out -= n;
- z->total_out += n;
-
- /* update check information */
- if (s->checkfn != Z_NULL)
- z->adler = s->check = (*s->checkfn)(s->check, q, n);
-
- /* copy as far as end of window */
- zmemcpy(p, q, n);
- p += n;
- q += n;
-
- /* see if more to copy at beginning of window */
- if (q == s->end)
- {
- /* wrap pointers */
- q = s->window;
- if (s->write == s->end)
- s->write = s->window;
-
- /* compute bytes to copy */
- n = (uInt)(s->write - q);
- if (n > z->avail_out) n = z->avail_out;
- if (n && r == Z_BUF_ERROR) r = Z_OK;
-
- /* update counters */
- z->avail_out -= n;
- z->total_out += n;
-
- /* update check information */
- if (s->checkfn != Z_NULL)
- z->adler = s->check = (*s->checkfn)(s->check, q, n);
-
- /* copy */
- zmemcpy(p, q, n);
- p += n;
- q += n;
- }
-
- /* update pointers */
- z->next_out = p;
- s->read = q;
-
- /* done */
- return r;
-}
diff --git a/freetype/src/gzip/infutil.h b/freetype/src/gzip/infutil.h
deleted file mode 100644
index cdf18b4f..00000000
--- a/freetype/src/gzip/infutil.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/* infutil.h -- types and macros common to blocks and codes
- * Copyright (C) 1995-2002 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* WARNING: this file should *not* be used by applications. It is
- part of the implementation of the compression library and is
- subject to change. Applications should only use zlib.h.
- */
-
-#ifndef _INFUTIL_H
-#define _INFUTIL_H
-
-typedef enum {
- TYPE, /* get type bits (3, including end bit) */
- LENS, /* get lengths for stored */
- STORED, /* processing stored block */
- TABLE, /* get table lengths */
- BTREE, /* get bit lengths tree for a dynamic block */
- DTREE, /* get length, distance trees for a dynamic block */
- CODES, /* processing fixed or dynamic block */
- DRY, /* output remaining window bytes */
- DONE, /* finished last block, done */
- BAD} /* got a data error--stuck here */
-inflate_block_mode;
-
-/* inflate blocks semi-private state */
-struct inflate_blocks_state {
-
- /* mode */
- inflate_block_mode mode; /* current inflate_block mode */
-
- /* mode dependent information */
- union {
- uInt left; /* if STORED, bytes left to copy */
- struct {
- uInt table; /* table lengths (14 bits) */
- uInt index; /* index into blens (or border) */
- uIntf *blens; /* bit lengths of codes */
- uInt bb; /* bit length tree depth */
- inflate_huft *tb; /* bit length decoding tree */
- } trees; /* if DTREE, decoding info for trees */
- struct {
- inflate_codes_statef
- *codes;
- } decode; /* if CODES, current state */
- } sub; /* submode */
- uInt last; /* true if this block is the last block */
-
- /* mode independent information */
- uInt bitk; /* bits in bit buffer */
- uLong bitb; /* bit buffer */
- inflate_huft *hufts; /* single malloc for tree space */
- Bytef *window; /* sliding window */
- Bytef *end; /* one byte after sliding window */
- Bytef *read; /* window read pointer */
- Bytef *write; /* window write pointer */
- check_func checkfn; /* check function */
- uLong check; /* check on output */
-
-};
-
-
-/* defines for inflate input/output */
-/* update pointers and return */
-#define UPDBITS {s->bitb=b;s->bitk=k;}
-#define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
-#define UPDOUT {s->write=q;}
-#define UPDATE {UPDBITS UPDIN UPDOUT}
-#define LEAVE {UPDATE return inflate_flush(s,z,r);}
-/* get bytes and bits */
-#define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
-#define NEEDBYTE {if(n)r=Z_OK;else LEAVE}
-#define NEXTBYTE (n--,*p++)
-#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
-#define DUMPBITS(j) {b>>=(j);k-=(j);}
-/* output bytes */
-#define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q)
-#define LOADOUT {q=s->write;m=(uInt)WAVAIL;}
-#define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
-#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
-#define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
-#define OUTBYTE(a) {*q++=(Byte)(a);m--;}
-/* load local pointers */
-#define LOAD {LOADIN LOADOUT}
-
-/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
-#ifndef NO_INFLATE_MASK
-local const uInt inflate_mask[17];
-#endif
-
-/* copy as much as possible from the sliding window to the output area */
-local int inflate_flush OF((
- inflate_blocks_statef *,
- z_streamp ,
- int));
-
-#endif
diff --git a/freetype/src/gzip/patches/freetype-zlib.diff b/freetype/src/gzip/patches/freetype-zlib.diff
new file mode 100644
index 00000000..20d84293
--- /dev/null
+++ b/freetype/src/gzip/patches/freetype-zlib.diff
@@ -0,0 +1,372 @@
+[zlib] Fix zlib sources for compilation with FreeType
+
+We must ensure that they do not issue compiler errors or warnings when they
+are compiled as part of `src/gzip/ftgzip.c`.
+
+* src/gzip/adler32.c: Do not define unused functions when `Z_FREETYPE`
+is set.
+
+* src/gzip/gzguts.h (COPY): Rename to...
+(COPY__): ... this since `COPY` and `COPY_` conflict with enum values,
+which have the same name in `zlib.h`.
+
+* src/gzip/inflate.c, src/gzip/adler32.c: Omit unused function
+declarations when `Z_FREETYPE` is defined.
+
+* src/gzip/zlib.h: Include `ftzconf.h` instead of `zconf.h` to avoid
+conflicts with system-installed headers.
+Omit unused function declarations when `Z_FREETYPE` is defined.
+
+* src/gzip/zutil.h: Use `ft_memxxx` functions instead of `memxxx`.
+Omit unused function declarations when `Z_FREETYPE` is defined.
+
+* src/gzip/inflate.h, src/gzip/inftrees.h: Add header guard macros to
+prevent compiler errors.
+
+diff --git a/src/gzip/adler32.c b/src/gzip/adler32.c
+index be5e8a247..aa032e1dd 100644
+--- a/src/gzip/adler32.c
++++ b/src/gzip/adler32.c
+@@ -7,7 +7,9 @@
+
+ #include "zutil.h"
+
++#ifndef Z_FREETYPE
+ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
++#endif
+
+ #define BASE 65521U /* largest prime smaller than 65536 */
+ #define NMAX 5552
+@@ -139,6 +141,8 @@ uLong ZEXPORT adler32(
+ return adler32_z(adler, buf, len);
+ }
+
++#ifndef Z_FREETYPE
++
+ /* ========================================================================= */
+ local uLong adler32_combine_(
+ uLong adler1,
+@@ -184,3 +188,5 @@ uLong ZEXPORT adler32_combine64(
+ {
+ return adler32_combine_(adler1, adler2, len2);
+ }
++
++#endif /* !Z_FREETYPE */
+diff --git a/src/gzip/gzguts.h b/src/gzip/gzguts.h
+index 57faf3716..4f09a52a7 100644
+--- a/src/gzip/gzguts.h
++++ b/src/gzip/gzguts.h
+@@ -163,7 +163,7 @@
+
+ /* values for gz_state how */
+ #define LOOK 0 /* look for a gzip header */
+-#define COPY 1 /* copy input directly */
++#define COPY__ 1 /* copy input directly */
+ #define GZIP 2 /* decompress a gzip stream */
+
+ /* internal gzip file state data structure */
+diff --git a/src/gzip/inflate.c b/src/gzip/inflate.c
+index 4375557b4..5bf5b815e 100644
+--- a/src/gzip/inflate.c
++++ b/src/gzip/inflate.c
+@@ -99,8 +99,10 @@ local int updatewindow OF((z_streamp strm, const unsigned char FAR *end,
+ #ifdef BUILDFIXED
+ void makefixed OF((void));
+ #endif
++#ifndef Z_FREETYPE
+ local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf,
+ unsigned len));
++#endif
+
+ local int inflateStateCheck(
+ z_streamp strm)
+@@ -245,6 +247,8 @@ int ZEXPORT inflateInit_(
+ return inflateInit2_(strm, DEF_WBITS, version, stream_size);
+ }
+
++#ifndef Z_FREETYPE
++
+ int ZEXPORT inflatePrime(
+ z_streamp strm,
+ int bits,
+@@ -266,6 +270,8 @@ int ZEXPORT inflatePrime(
+ return Z_OK;
+ }
+
++#endif /* !Z_FREETYPE */
++
+ /*
+ Return state with length and distance decoding tables and index sizes set to
+ fixed code decoding. Normally this returns fixed tables from inffixed.h.
+@@ -1312,6 +1318,8 @@ int ZEXPORT inflateEnd(
+ return Z_OK;
+ }
+
++#ifndef Z_FREETYPE
++
+ int ZEXPORT inflateGetDictionary(
+ z_streamp strm,
+ Bytef *dictionary,
+@@ -1471,6 +1479,8 @@ int ZEXPORT inflateSync(
+ return Z_OK;
+ }
+
++#endif /* !Z_FREETYPE */
++
+ /*
+ Returns true if inflate is currently at the end of a block generated by
+ Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP
+@@ -1489,6 +1499,8 @@ int ZEXPORT inflateSyncPoint(
+ return state->mode == STORED && state->bits == 0;
+ }
+
++#ifndef Z_FREETYPE
++
+ int ZEXPORT inflateCopy(
+ z_streamp dest,
+ z_streamp source)
+@@ -1536,6 +1548,8 @@ int ZEXPORT inflateCopy(
+ return Z_OK;
+ }
+
++#endif /* !Z_FREETYPE */
++
+ int ZEXPORT inflateUndermine(
+ z_streamp strm,
+ int subvert)
+@@ -1569,6 +1583,8 @@ int ZEXPORT inflateValidate(
+ return Z_OK;
+ }
+
++#ifndef Z_FREETYPE
++
+ long ZEXPORT inflateMark(
+ z_streamp strm)
+ {
+@@ -1590,3 +1606,5 @@ unsigned long ZEXPORT inflateCodesUsed(
+ state = (struct inflate_state FAR *)strm->state;
+ return (unsigned long)(state->next - state->codes);
+ }
++
++#endif /* !Z_FREETYPE */
+diff --git a/src/gzip/inflate.h b/src/gzip/inflate.h
+index f127b6b1f..c6f5a52e1 100644
+--- a/src/gzip/inflate.h
++++ b/src/gzip/inflate.h
+@@ -3,6 +3,9 @@
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
++#ifndef INFLATE_H
++#define INFLATE_H
++
+ /* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+@@ -124,3 +127,5 @@ struct inflate_state {
+ int back; /* bits back of last unprocessed length/lit */
+ unsigned was; /* initial length of match */
+ };
++
++#endif /* INFLATE_H */
+diff --git a/src/gzip/inftrees.h b/src/gzip/inftrees.h
+index baa53a0b1..c94eb78b5 100644
+--- a/src/gzip/inftrees.h
++++ b/src/gzip/inftrees.h
+@@ -3,6 +3,9 @@
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
++#ifndef INFTREES_H
++#define INFTREES_H
++
+ /* WARNING: this file should *not* be used by applications. It is
+ part of the implementation of the compression library and is
+ subject to change. Applications should only use zlib.h.
+@@ -60,3 +63,5 @@ typedef enum {
+ int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens,
+ unsigned codes, code FAR * FAR *table,
+ unsigned FAR *bits, unsigned short FAR *work));
++
++#endif /* INFTREES_H_ */
+diff --git a/src/gzip/zlib.h b/src/gzip/zlib.h
+index 4a98e38bf..d760140c2 100644
+--- a/src/gzip/zlib.h
++++ b/src/gzip/zlib.h
+@@ -31,7 +31,7 @@
+ #ifndef ZLIB_H
+ #define ZLIB_H
+
+-#include "zconf.h"
++#include "ftzconf.h"
+
+ #ifdef __cplusplus
+ extern "C" {
+@@ -211,6 +211,8 @@ typedef gz_header FAR *gz_headerp;
+
+ #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+
++#ifndef Z_FREETYPE
++
+ #define zlib_version zlibVersion()
+ /* for compatibility with versions < 1.0.2 */
+
+@@ -246,7 +248,6 @@ ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
+ this will be done by deflate().
+ */
+
+-
+ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
+ /*
+ deflate compresses as much data as possible, and stops when the input
+@@ -373,6 +374,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
+ deallocated).
+ */
+
++#endif /* !Z_FREETYPE */
+
+ /*
+ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
+@@ -534,6 +536,8 @@ ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
+ The following functions are needed only in some special applications.
+ */
+
++#ifndef Z_FREETYPE
++
+ /*
+ ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
+ int level,
+@@ -956,6 +960,8 @@ ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+ destination.
+ */
+
++#endif /* !Z_FREETYPE */
++
+ ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
+ /*
+ This function is equivalent to inflateEnd followed by inflateInit,
+@@ -980,6 +986,8 @@ ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+ the windowBits parameter is invalid.
+ */
+
++#ifndef Z_FREETYPE
++
+ ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+@@ -1069,6 +1077,8 @@ ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+ stream state was inconsistent.
+ */
+
++#endif /* !Z_FREETYPE */
++
+ /*
+ ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window));
+@@ -1095,6 +1105,8 @@ typedef unsigned (*in_func) OF((void FAR *,
+ z_const unsigned char FAR * FAR *));
+ typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
+
++#ifndef Z_FREETYPE
++
+ ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+ in_func in, void FAR *in_desc,
+ out_func out, void FAR *out_desc));
+@@ -1214,6 +1226,8 @@ ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+ 27-31: 0 (reserved)
+ */
+
++#endif /* !Z_FREETYPE */
++
+ #ifndef Z_SOLO
+
+ /* utility functions */
+@@ -1742,6 +1756,8 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
+ if (crc != original_crc) error();
+ */
+
++#ifndef Z_FREETYPE
++
+ ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
+ z_size_t len));
+ /*
+@@ -1822,6 +1838,19 @@ ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+ ZLIB_VERSION, (int)sizeof(z_stream))
+ #endif
+
++#else /* Z_FREETYPE */
++
++
++ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
++ const char *version, int stream_size));
++
++# define inflateInit2(strm, windowBits) \
++ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
++ (int)sizeof(z_stream))
++
++#endif /* Z_FREETYPE */
++
++
+ #ifndef Z_SOLO
+
+ /* gzgetc() macro and its supporting function and exposed data structure. Note
+@@ -1901,13 +1930,16 @@ ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
+
+ #else /* Z_SOLO */
+
++#ifndef Z_FREETYPE
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
++#endif
+
+ #endif /* !Z_SOLO */
+
+ /* undocumented functions */
++#ifndef Z_FREETYPE
+ ZEXTERN const char * ZEXPORT zError OF((int));
+ ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
+ ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
+@@ -1927,6 +1959,7 @@ ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
+ va_list va));
+ # endif
+ #endif
++#endif /* !Z_FREETYPE */
+
+ #ifdef __cplusplus
+ }
+diff --git a/src/gzip/zutil.h b/src/gzip/zutil.h
+index d9a20ae1b..14f0f1a85 100644
+--- a/src/gzip/zutil.h
++++ b/src/gzip/zutil.h
+@@ -188,6 +188,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+ #pragma warn -8066
+ #endif
+
++#ifndef Z_FREETYPE
++
+ /* provide prototypes for these when building zlib without LFS */
+ #if !defined(_WIN32) && \
+ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
+@@ -195,6 +197,8 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+ #endif
+
++#endif /* !Z_FREETYPE */
++
+ /* common defaults */
+
+ #ifndef OS_CODE
+@@ -226,9 +230,9 @@ extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+ # define zmemcmp _fmemcmp
+ # define zmemzero(dest, len) _fmemset(dest, 0, len)
+ # else
+-# define zmemcpy memcpy
+-# define zmemcmp memcmp
+-# define zmemzero(dest, len) memset(dest, 0, len)
++# define zmemcpy ft_memcpy
++# define zmemcmp ft_memcmp
++# define zmemzero(dest, len) ft_memset(dest, 0, len)
+ # endif
+ #else
+ void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
diff --git a/freetype/src/gzip/rules.mk b/freetype/src/gzip/rules.mk
index 1a90ae8f..10c8b41c 100644
--- a/freetype/src/gzip/rules.mk
+++ b/freetype/src/gzip/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2002-2021 by
+# Copyright (C) 2002-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -40,17 +40,17 @@ endif
# unconditionally.
#
GZIP_DRV_SRCS := $(GZIP_DIR)/adler32.c \
+ $(GZIP_DIR)/crc32.c \
+ $(GZIP_DIR)/crc32.h \
$(GZIP_DIR)/ftzconf.h \
- $(GZIP_DIR)/infblock.c \
- $(GZIP_DIR)/infblock.h \
- $(GZIP_DIR)/infcodes.c \
- $(GZIP_DIR)/infcodes.h \
+ $(GZIP_DIR)/infback.c \
+ $(GZIP_DIR)/inffast.c \
+ $(GZIP_DIR)/inffast.h \
$(GZIP_DIR)/inffixed.h \
$(GZIP_DIR)/inflate.c \
+ $(GZIP_DIR)/inflate.h \
$(GZIP_DIR)/inftrees.c \
$(GZIP_DIR)/inftrees.h \
- $(GZIP_DIR)/infutil.c \
- $(GZIP_DIR)/infutil.h \
$(GZIP_DIR)/zlib.h \
$(GZIP_DIR)/zutil.c \
$(GZIP_DIR)/zutil.h
diff --git a/freetype/src/gzip/zlib.h b/freetype/src/gzip/zlib.h
index a4e82c6a..d760140c 100644
--- a/freetype/src/gzip/zlib.h
+++ b/freetype/src/gzip/zlib.h
@@ -1,7 +1,7 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.1.4, March 11th, 2002
+ version 1.2.12, March 11th, 2022
- Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
+ Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -24,12 +24,12 @@
The data format used by the zlib library is described by RFCs (Request for
- Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
- (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
+ Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
+ (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
*/
-#ifndef _ZLIB_H
-#define _ZLIB_H
+#ifndef ZLIB_H
+#define ZLIB_H
#include "ftzconf.h"
@@ -37,27 +37,45 @@
extern "C" {
#endif
-#define ZLIB_VERSION "1.1.4"
+#define ZLIB_VERSION "1.2.12"
+#define ZLIB_VERNUM 0x12c0
+#define ZLIB_VER_MAJOR 1
+#define ZLIB_VER_MINOR 2
+#define ZLIB_VER_REVISION 12
+#define ZLIB_VER_SUBREVISION 0
/*
- The 'zlib' compression library provides in-memory compression and
- decompression functions, including integrity checks of the uncompressed
- data. This version of the library supports only one compression method
- (deflation) but other algorithms will be added later and will have the same
- stream interface.
-
- Compression can be done in a single step if the buffers are large
- enough (for example if an input file is mmap'ed), or can be done by
- repeated calls of the compression function. In the latter case, the
- application must provide more input and/or consume the output
+ The 'zlib' compression library provides in-memory compression and
+ decompression functions, including integrity checks of the uncompressed data.
+ This version of the library supports only one compression method (deflation)
+ but other algorithms will be added later and will have the same stream
+ interface.
+
+ Compression can be done in a single step if the buffers are large enough,
+ or can be done by repeated calls of the compression function. In the latter
+ case, the application must provide more input and/or consume the output
(providing more output space) before each call.
- The library also supports reading and writing files in gzip (.gz) format
- with an interface similar to that of stdio.
+ The compressed data format used by default by the in-memory functions is
+ the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
+ around a deflate stream, which is itself documented in RFC 1951.
+
+ The library also supports reading and writing files in gzip (.gz) format
+ with an interface similar to that of stdio using the functions that start
+ with "gz". The gzip format is different from the zlib format. gzip is a
+ gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
+
+ This library can optionally read and write gzip and raw deflate streams in
+ memory as well.
- The library does not install any signal handler. The decoder checks
- the consistency of the compressed data, so the library should never
- crash even in case of corrupted input.
+ The zlib format was designed to be compact and fast for use in memory
+ and on communications channels. The gzip format was designed for single-
+ file compression on file systems, has a larger header than zlib to maintain
+ directory information, and uses a different, slower check method than zlib.
+
+ The library does not install any signal handler. The decoder checks
+ the consistency of the compressed data, so the library should never crash
+ even in the case of corrupted input.
*/
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
@@ -66,68 +84,95 @@ typedef void (*free_func) OF((voidpf opaque, voidpf address));
struct internal_state;
typedef struct z_stream_s {
- Bytef *next_in; /* next input byte */
+ z_const Bytef *next_in; /* next input byte */
uInt avail_in; /* number of bytes available at next_in */
- uLong total_in; /* total nb of input bytes read so far */
+ uLong total_in; /* total number of input bytes read so far */
- Bytef *next_out; /* next output byte should be put there */
+ Bytef *next_out; /* next output byte will go here */
uInt avail_out; /* remaining free space at next_out */
- uLong total_out; /* total nb of bytes output so far */
+ uLong total_out; /* total number of bytes output so far */
- char *msg; /* last error message, NULL if no error */
+ z_const char *msg; /* last error message, NULL if no error */
struct internal_state FAR *state; /* not visible by applications */
alloc_func zalloc; /* used to allocate the internal state */
free_func zfree; /* used to free the internal state */
voidpf opaque; /* private data object passed to zalloc and zfree */
- int data_type; /* best guess about the data type: ascii or binary */
- uLong adler; /* adler32 value of the uncompressed data */
+ int data_type; /* best guess about the data type: binary or text
+ for deflate, or the decoding state for inflate */
+ uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */
uLong reserved; /* reserved for future use */
} z_stream;
typedef z_stream FAR *z_streamp;
/*
- The application must update next_in and avail_in when avail_in has
- dropped to zero. It must update next_out and avail_out when avail_out
- has dropped to zero. The application must initialize zalloc, zfree and
- opaque before calling the init function. All other fields are set by the
- compression library and must not be updated by the application.
+ gzip header information passed to and from zlib routines. See RFC 1952
+ for more details on the meanings of these fields.
+*/
+typedef struct gz_header_s {
+ int text; /* true if compressed data believed to be text */
+ uLong time; /* modification time */
+ int xflags; /* extra flags (not used when writing a gzip file) */
+ int os; /* operating system */
+ Bytef *extra; /* pointer to extra field or Z_NULL if none */
+ uInt extra_len; /* extra field length (valid if extra != Z_NULL) */
+ uInt extra_max; /* space at extra (only when reading header) */
+ Bytef *name; /* pointer to zero-terminated file name or Z_NULL */
+ uInt name_max; /* space at name (only when reading header) */
+ Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */
+ uInt comm_max; /* space at comment (only when reading header) */
+ int hcrc; /* true if there was or will be a header crc */
+ int done; /* true when done reading gzip header (not used
+ when writing a gzip file) */
+} gz_header;
+
+typedef gz_header FAR *gz_headerp;
- The opaque value provided by the application will be passed as the first
- parameter for calls of zalloc and zfree. This can be useful for custom
- memory management. The compression library attaches no meaning to the
+/*
+ The application must update next_in and avail_in when avail_in has dropped
+ to zero. It must update next_out and avail_out when avail_out has dropped
+ to zero. The application must initialize zalloc, zfree and opaque before
+ calling the init function. All other fields are set by the compression
+ library and must not be updated by the application.
+
+ The opaque value provided by the application will be passed as the first
+ parameter for calls of zalloc and zfree. This can be useful for custom
+ memory management. The compression library attaches no meaning to the
opaque value.
- zalloc must return Z_NULL if there is not enough memory for the object.
+ zalloc must return Z_NULL if there is not enough memory for the object.
If zlib is used in a multi-threaded application, zalloc and zfree must be
- thread safe.
-
- On 16-bit systems, the functions zalloc and zfree must be able to allocate
- exactly 65536 bytes, but will not be required to allocate more than this
- if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
- pointers returned by zalloc for objects of exactly 65536 bytes *must*
- have their offset normalized to zero. The default allocation function
- provided by this library ensures this (see zutil.c). To reduce memory
- requirements and avoid any allocation of 64K objects, at the expense of
- compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
-
- The fields total_in and total_out can be used for statistics or
- progress reports. After compression, total_in holds the total size of
- the uncompressed data and may be saved for use in the decompressor
- (particularly if the decompressor wants to decompress everything in
- a single step).
+ thread safe. In that case, zlib is thread-safe. When zalloc and zfree are
+ Z_NULL on entry to the initialization function, they are set to internal
+ routines that use the standard library functions malloc() and free().
+
+ On 16-bit systems, the functions zalloc and zfree must be able to allocate
+ exactly 65536 bytes, but will not be required to allocate more than this if
+ the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, pointers
+ returned by zalloc for objects of exactly 65536 bytes *must* have their
+ offset normalized to zero. The default allocation function provided by this
+ library ensures this (see zutil.c). To reduce memory requirements and avoid
+ any allocation of 64K objects, at the expense of compression ratio, compile
+ the library with -DMAX_WBITS=14 (see zconf.h).
+
+ The fields total_in and total_out can be used for statistics or progress
+ reports. After compression, total_in holds the total size of the
+ uncompressed data and may be saved for use by the decompressor (particularly
+ if the decompressor wants to decompress everything in a single step).
*/
/* constants */
#define Z_NO_FLUSH 0
-#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
+#define Z_PARTIAL_FLUSH 1
#define Z_SYNC_FLUSH 2
#define Z_FULL_FLUSH 3
#define Z_FINISH 4
-/* Allowed flush values; see deflate() below for details */
+#define Z_BLOCK 5
+#define Z_TREES 6
+/* Allowed flush values; see deflate() and inflate() below for details */
#define Z_OK 0
#define Z_STREAM_END 1
@@ -138,8 +183,8 @@ typedef z_stream FAR *z_streamp;
#define Z_MEM_ERROR (-4)
#define Z_BUF_ERROR (-5)
#define Z_VERSION_ERROR (-6)
-/* Return codes for the compression/decompression functions. Negative
- * values are errors, positive values are used for special but normal events.
+/* Return codes for the compression/decompression functions. Negative values
+ * are errors, positive values are used for special but normal events.
*/
#define Z_NO_COMPRESSION 0
@@ -150,636 +195,1522 @@ typedef z_stream FAR *z_streamp;
#define Z_FILTERED 1
#define Z_HUFFMAN_ONLY 2
+#define Z_RLE 3
+#define Z_FIXED 4
#define Z_DEFAULT_STRATEGY 0
/* compression strategy; see deflateInit2() below for details */
#define Z_BINARY 0
-#define Z_ASCII 1
+#define Z_TEXT 1
+#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */
#define Z_UNKNOWN 2
-/* Possible values of the data_type field */
+/* Possible values of the data_type field for deflate() */
#define Z_DEFLATED 8
/* The deflate compression method (the only one supported in this version) */
#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
+#ifndef Z_FREETYPE
+
+#define zlib_version zlibVersion()
+/* for compatibility with versions < 1.0.2 */
+
/* basic functions */
+ZEXTERN const char * ZEXPORT zlibVersion OF((void));
/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
- If the first character differs, the library code actually used is
- not compatible with the zlib.h header file used by the application.
- This check is automatically made by deflateInit and inflateInit.
+ If the first character differs, the library code actually used is not
+ compatible with the zlib.h header file used by the application. This check
+ is automatically made by deflateInit and inflateInit.
*/
/*
-ZEXTERN(int) deflateInit OF((z_streamp strm, int level));
+ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
- Initializes the internal stream state for compression. The fields
- zalloc, zfree and opaque must be initialized before by the caller.
- If zalloc and zfree are set to Z_NULL, deflateInit updates them to
- use default allocation functions.
+ Initializes the internal stream state for compression. The fields
+ zalloc, zfree and opaque must be initialized before by the caller. If
+ zalloc and zfree are set to Z_NULL, deflateInit updates them to use default
+ allocation functions.
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
- 1 gives best speed, 9 gives best compression, 0 gives no compression at
- all (the input data is simply copied a block at a time).
- Z_DEFAULT_COMPRESSION requests a default compromise between speed and
- compression (currently equivalent to level 6).
+ 1 gives best speed, 9 gives best compression, 0 gives no compression at all
+ (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESSION
+ requests a default compromise between speed and compression (currently
+ equivalent to level 6).
- deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
- enough memory, Z_STREAM_ERROR if level is not a valid compression level,
+ deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if level is not a valid compression level, or
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
- with the version assumed by the caller (ZLIB_VERSION).
- msg is set to null if there is no error message. deflateInit does not
- perform any compression: this will be done by deflate().
+ with the version assumed by the caller (ZLIB_VERSION). msg is set to null
+ if there is no error message. deflateInit does not perform any compression:
+ this will be done by deflate().
*/
-
+ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
/*
deflate compresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may introduce some
- output latency (reading input without producing any output) except when
+ buffer becomes empty or the output buffer becomes full. It may introduce
+ some output latency (reading input without producing any output) except when
forced to flush.
- The detailed semantics are as follows. deflate performs one or both of the
+ The detailed semantics are as follows. deflate performs one or both of the
following actions:
- Compress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
+ accordingly. If not all input can be processed (because there is not
enough room in the output buffer), next_in and avail_in are updated and
processing will resume at this point for the next call of deflate().
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. This action is forced if the parameter flush is non zero.
+ - Generate more output starting at next_out and update next_out and avail_out
+ accordingly. This action is forced if the parameter flush is non zero.
Forcing flush frequently degrades the compression ratio, so this parameter
- should be set only when necessary (in interactive applications).
- Some output may be provided even if flush is not set.
-
- Before the call of deflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating avail_in or avail_out accordingly; avail_out
- should never be zero before the call. The application can consume the
- compressed output when it wants, for example when the output buffer is full
- (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
- and with zero avail_out, it must be called again after making room in the
- output buffer because there might be more output pending.
+ should be set only when necessary. Some output may be provided even if
+ flush is zero.
+
+ Before the call of deflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming more
+ output, and updating avail_in or avail_out accordingly; avail_out should
+ never be zero before the call. The application can consume the compressed
+ output when it wants, for example when the output buffer is full (avail_out
+ == 0), or after each call of deflate(). If deflate returns Z_OK and with
+ zero avail_out, it must be called again after making room in the output
+ buffer because there might be more output pending. See deflatePending(),
+ which can be used if desired to determine whether or not there is more ouput
+ in that case.
+
+ Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
+ decide how much data to accumulate before producing output, in order to
+ maximize compression.
If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
flushed to the output buffer and the output is aligned on a byte boundary, so
- that the decompressor can get all input data available so far. (In particular
- avail_in is zero after the call if enough output space has been provided
- before the call.) Flushing may degrade compression for some compression
- algorithms and so it should be used only when necessary.
+ that the decompressor can get all input data available so far. (In
+ particular avail_in is zero after the call if enough output space has been
+ provided before the call.) Flushing may degrade compression for some
+ compression algorithms and so it should be used only when necessary. This
+ completes the current deflate block and follows it with an empty stored block
+ that is three bits plus filler bits to the next byte, followed by four bytes
+ (00 00 ff ff).
+
+ If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to the
+ output buffer, but the output is not aligned to a byte boundary. All of the
+ input data so far will be available to the decompressor, as for Z_SYNC_FLUSH.
+ This completes the current deflate block and follows it with an empty fixed
+ codes block that is 10 bits long. This assures that enough bytes are output
+ in order for the decompressor to finish the block before the empty fixed
+ codes block.
+
+ If flush is set to Z_BLOCK, a deflate block is completed and emitted, as
+ for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and up to
+ seven bits of the current block are held to be written as the next byte after
+ the next deflate block is completed. In this case, the decompressor may not
+ be provided enough bits at this point in order to complete decompression of
+ the data provided so far to the compressor. It may need to wait for the next
+ block to be emitted. This is for advanced applications that need to control
+ the emission of deflate blocks.
If flush is set to Z_FULL_FLUSH, all output is flushed as with
Z_SYNC_FLUSH, and the compression state is reset so that decompression can
restart from this point if previous compressed data has been damaged or if
- random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
- the compression.
+ random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
+ compression.
If deflate returns with avail_out == 0, this function must be called again
with the same value of the flush parameter and more output space (updated
avail_out), until the flush is complete (deflate returns with non-zero
- avail_out).
+ avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that
+ avail_out is greater than six to avoid repeated flush markers due to
+ avail_out == 0 on return.
If the parameter flush is set to Z_FINISH, pending input is processed,
- pending output is flushed and deflate returns with Z_STREAM_END if there
- was enough output space; if deflate returns with Z_OK, this function must be
- called again with Z_FINISH and more output space (updated avail_out) but no
- more input data, until it returns with Z_STREAM_END or an error. After
- deflate has returned Z_STREAM_END, the only possible operations on the
- stream are deflateReset or deflateEnd.
-
- Z_FINISH can be used immediately after deflateInit if all the compression
- is to be done in a single step. In this case, avail_out must be at least
- 0.1% larger than avail_in plus 12 bytes. If deflate does not return
- Z_STREAM_END, then it must be called again as described above.
-
- deflate() sets strm->adler to the adler32 checksum of all input read
- so far (that is, total_in bytes).
-
- deflate() may update data_type if it can make a good guess about
- the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
- binary. This field is only for information purposes and does not affect
- the compression algorithm in any manner.
+ pending output is flushed and deflate returns with Z_STREAM_END if there was
+ enough output space. If deflate returns with Z_OK or Z_BUF_ERROR, this
+ function must be called again with Z_FINISH and more output space (updated
+ avail_out) but no more input data, until it returns with Z_STREAM_END or an
+ error. After deflate has returned Z_STREAM_END, the only possible operations
+ on the stream are deflateReset or deflateEnd.
+
+ Z_FINISH can be used in the first deflate call after deflateInit if all the
+ compression is to be done in a single step. In order to complete in one
+ call, avail_out must be at least the value returned by deflateBound (see
+ below). Then deflate is guaranteed to return Z_STREAM_END. If not enough
+ output space is provided, deflate will not return Z_STREAM_END, and it must
+ be called again as described above.
+
+ deflate() sets strm->adler to the Adler-32 checksum of all input read
+ so far (that is, total_in bytes). If a gzip stream is being generated, then
+ strm->adler will be the CRC-32 checksum of the input read so far. (See
+ deflateInit2 below.)
+
+ deflate() may update strm->data_type if it can make a good guess about
+ the input data type (Z_BINARY or Z_TEXT). If in doubt, the data is
+ considered binary. This field is only for information purposes and does not
+ affect the compression algorithm in any manner.
deflate() returns Z_OK if some progress has been made (more input
processed or more output produced), Z_STREAM_END if all input has been
consumed and all output has been produced (only when flush is set to
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
- if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
- (for example avail_in or avail_out was zero).
+ if next_in or next_out was Z_NULL or the state was inadvertently written over
+ by the application), or Z_BUF_ERROR if no progress is possible (for example
+ avail_in or avail_out was zero). Note that Z_BUF_ERROR is not fatal, and
+ deflate() can be called again with more input and more output space to
+ continue compressing.
*/
+ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
+ This function discards any unprocessed input and does not flush any pending
+ output.
deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
stream state was inconsistent, Z_DATA_ERROR if the stream was freed
- prematurely (some input or output was discarded). In the error case,
- msg may be set but then points to a static string (which must not be
+ prematurely (some input or output was discarded). In the error case, msg
+ may be set but then points to a static string (which must not be
deallocated).
*/
+#endif /* !Z_FREETYPE */
/*
-ZEXTERN(int) inflateInit OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
- Initializes the internal stream state for decompression. The fields
+ Initializes the internal stream state for decompression. The fields
next_in, avail_in, zalloc, zfree and opaque must be initialized before by
- the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
- value depends on the compression method), inflateInit determines the
- compression method from the zlib header and allocates all data structures
- accordingly; otherwise the allocation will be deferred to the first call of
- inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
- use default allocation functions.
+ the caller. In the current version of inflate, the provided input is not
+ read or consumed. The allocation of a sliding window will be deferred to
+ the first call of inflate (if the decompression does not complete on the
+ first call). If zalloc and zfree are set to Z_NULL, inflateInit updates
+ them to use default allocation functions.
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
- version assumed by the caller. msg is set to null if there is no error
- message. inflateInit does not perform any decompression apart from reading
- the zlib header if present: this will be done by inflate(). (So next_in and
- avail_in may be modified, but next_out and avail_out are unchanged.)
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit does not perform any decompression.
+ Actual decompression will be done by inflate(). So next_in, and avail_in,
+ next_out, and avail_out are unused and unchanged. The current
+ implementation of inflateInit() does not process any header information --
+ that is deferred until inflate() is called.
*/
-ZEXTERN(int) inflate OF((z_streamp strm, int flush));
+ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
/*
inflate decompresses as much data as possible, and stops when the input
- buffer becomes empty or the output buffer becomes full. It may some
- introduce some output latency (reading input without producing any output)
- except when forced to flush.
+ buffer becomes empty or the output buffer becomes full. It may introduce
+ some output latency (reading input without producing any output) except when
+ forced to flush.
- The detailed semantics are as follows. inflate performs one or both of the
+ The detailed semantics are as follows. inflate performs one or both of the
following actions:
- Decompress more input starting at next_in and update next_in and avail_in
- accordingly. If not all input can be processed (because there is not
- enough room in the output buffer), next_in is updated and processing
- will resume at this point for the next call of inflate().
-
- - Provide more output starting at next_out and update next_out and avail_out
- accordingly. inflate() provides as much output as possible, until there
- is no more input data or no more space in the output buffer (see below
- about the flush parameter).
-
- Before the call of inflate(), the application should ensure that at least
- one of the actions is possible, by providing more input and/or consuming
- more output, and updating the next_* and avail_* values accordingly.
- The application can consume the uncompressed output when it wants, for
- example when the output buffer is full (avail_out == 0), or after each
- call of inflate(). If inflate returns Z_OK and with zero avail_out, it
- must be called again after making room in the output buffer because there
- might be more output pending.
-
- If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
- output as possible to the output buffer. The flushing behavior of inflate is
- not specified for values of the flush parameter other than Z_SYNC_FLUSH
- and Z_FINISH, but the current implementation actually flushes as much output
- as possible anyway.
+ accordingly. If not all input can be processed (because there is not
+ enough room in the output buffer), then next_in and avail_in are updated
+ accordingly, and processing will resume at this point for the next call of
+ inflate().
+
+ - Generate more output starting at next_out and update next_out and avail_out
+ accordingly. inflate() provides as much output as possible, until there is
+ no more input data or no more space in the output buffer (see below about
+ the flush parameter).
+
+ Before the call of inflate(), the application should ensure that at least
+ one of the actions is possible, by providing more input and/or consuming more
+ output, and updating the next_* and avail_* values accordingly. If the
+ caller of inflate() does not provide both available input and available
+ output space, it is possible that there will be no progress made. The
+ application can consume the uncompressed output when it wants, for example
+ when the output buffer is full (avail_out == 0), or after each call of
+ inflate(). If inflate returns Z_OK and with zero avail_out, it must be
+ called again after making room in the output buffer because there might be
+ more output pending.
+
+ The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FINISH,
+ Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much
+ output as possible to the output buffer. Z_BLOCK requests that inflate()
+ stop if and when it gets to the next deflate block boundary. When decoding
+ the zlib or gzip format, this will cause inflate() to return immediately
+ after the header and before the first block. When doing a raw inflate,
+ inflate() will go ahead and process the first block, and will return when it
+ gets to the end of that block, or when it runs out of data.
+
+ The Z_BLOCK option assists in appending to or combining deflate streams.
+ To assist in this, on return inflate() always sets strm->data_type to the
+ number of unused bits in the last byte taken from strm->next_in, plus 64 if
+ inflate() is currently decoding the last block in the deflate stream, plus
+ 128 if inflate() returned immediately after decoding an end-of-block code or
+ decoding the complete header up to just before the first byte of the deflate
+ stream. The end-of-block will not be indicated until all of the uncompressed
+ data from that block has been written to strm->next_out. The number of
+ unused bits may in general be greater than seven, except when bit 7 of
+ data_type is set, in which case the number of unused bits will be less than
+ eight. data_type is set as noted here every time inflate() returns for all
+ flush options, and so can be used to determine the amount of currently
+ consumed input in bits.
+
+ The Z_TREES option behaves as Z_BLOCK does, but it also returns when the
+ end of each deflate block header is reached, before any actual data in that
+ block is decoded. This allows the caller to determine the length of the
+ deflate block header for later use in random access within a deflate block.
+ 256 is added to the value of strm->data_type when inflate() returns
+ immediately after reaching the end of the deflate block header.
inflate() should normally be called until it returns Z_STREAM_END or an
- error. However if all decompression is to be performed in a single step
- (a single call of inflate), the parameter flush should be set to
- Z_FINISH. In this case all pending input is processed and all pending
- output is flushed; avail_out must be large enough to hold all the
- uncompressed data. (The size of the uncompressed data may have been saved
- by the compressor for this purpose.) The next operation on this stream must
- be inflateEnd to deallocate the decompression state. The use of Z_FINISH
- is never required, but can be used to inform inflate that a faster routine
- may be used for the single inflate() call.
-
- If a preset dictionary is needed at this point (see inflateSetDictionary
- below), inflate sets strm-adler to the adler32 checksum of the
- dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
- it sets strm->adler to the adler32 checksum of all output produced
- so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
- an error code as described below. At the end of the stream, inflate()
- checks that its computed adler32 checksum is equal to that saved by the
- compressor and returns Z_STREAM_END only if the checksum is correct.
+ error. However if all decompression is to be performed in a single step (a
+ single call of inflate), the parameter flush should be set to Z_FINISH. In
+ this case all pending input is processed and all pending output is flushed;
+ avail_out must be large enough to hold all of the uncompressed data for the
+ operation to complete. (The size of the uncompressed data may have been
+ saved by the compressor for this purpose.) The use of Z_FINISH is not
+ required to perform an inflation in one step. However it may be used to
+ inform inflate that a faster approach can be used for the single inflate()
+ call. Z_FINISH also informs inflate to not maintain a sliding window if the
+ stream completes, which reduces inflate's memory footprint. If the stream
+ does not complete, either because not all of the stream is provided or not
+ enough output space is provided, then a sliding window will be allocated and
+ inflate() can be called again to continue the operation as if Z_NO_FLUSH had
+ been used.
+
+ In this implementation, inflate() always flushes as much output as
+ possible to the output buffer, and always uses the faster approach on the
+ first call. So the effects of the flush parameter in this implementation are
+ on the return value of inflate() as noted below, when inflate() returns early
+ when Z_BLOCK or Z_TREES is used, and when inflate() avoids the allocation of
+ memory for a sliding window when Z_FINISH is used.
+
+ If a preset dictionary is needed after this call (see inflateSetDictionary
+ below), inflate sets strm->adler to the Adler-32 checksum of the dictionary
+ chosen by the compressor and returns Z_NEED_DICT; otherwise it sets
+ strm->adler to the Adler-32 checksum of all output produced so far (that is,
+ total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as described
+ below. At the end of the stream, inflate() checks that its computed Adler-32
+ checksum is equal to that saved by the compressor and returns Z_STREAM_END
+ only if the checksum is correct.
+
+ inflate() can decompress and check either zlib-wrapped or gzip-wrapped
+ deflate data. The header type is detected automatically, if requested when
+ initializing with inflateInit2(). Any information contained in the gzip
+ header is not retained unless inflateGetHeader() is used. When processing
+ gzip-wrapped deflate data, strm->adler32 is set to the CRC-32 of the output
+ produced so far. The CRC-32 is checked against the gzip trailer, as is the
+ uncompressed length, modulo 2^32.
inflate() returns Z_OK if some progress has been made (more input processed
or more output produced), Z_STREAM_END if the end of the compressed data has
been reached and all uncompressed output has been produced, Z_NEED_DICT if a
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
- corrupted (input stream not conforming to the zlib format or incorrect
- adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
- (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
- enough memory, Z_BUF_ERROR if no progress is possible or if there was not
- enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
- case, the application may then call inflateSync to look for a good
- compression block.
+ corrupted (input stream not conforming to the zlib format or incorrect check
+ value, in which case strm->msg points to a string with a more specific
+ error), Z_STREAM_ERROR if the stream structure was inconsistent (for example
+ next_in or next_out was Z_NULL, or the state was inadvertently written over
+ by the application), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR
+ if no progress was possible or if there was not enough room in the output
+ buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and
+ inflate() can be called again with more input and more output space to
+ continue decompressing. If Z_DATA_ERROR is returned, the application may
+ then call inflateSync() to look for a good compression block if a partial
+ recovery of the data is to be attempted.
*/
-ZEXTERN(int) inflateEnd OF((z_streamp strm));
+ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
/*
All dynamically allocated data structures for this stream are freed.
- This function discards any unprocessed input and does not flush any
- pending output.
+ This function discards any unprocessed input and does not flush any pending
+ output.
- inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
- was inconsistent. In the error case, msg may be set but then points to a
- static string (which must not be deallocated).
+ inflateEnd returns Z_OK if success, or Z_STREAM_ERROR if the stream state
+ was inconsistent.
*/
+
/* Advanced functions */
/*
The following functions are needed only in some special applications.
*/
+#ifndef Z_FREETYPE
+
/*
-ZEXTERN(int) deflateInit2 OF((z_streamp strm,
+ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
int level,
int method,
int windowBits,
int memLevel,
int strategy));
- This is another version of deflateInit with more compression options. The
- fields next_in, zalloc, zfree and opaque must be initialized before by
- the caller.
+ This is another version of deflateInit with more compression options. The
+ fields zalloc, zfree and opaque must be initialized before by the caller.
- The method parameter is the compression method. It must be Z_DEFLATED in
+ The method parameter is the compression method. It must be Z_DEFLATED in
this version of the library.
The windowBits parameter is the base two logarithm of the window size
(the size of the history buffer). It should be in the range 8..15 for this
- version of the library. Larger values of this parameter result in better
- compression at the expense of memory usage. The default value is 15 if
+ version of the library. Larger values of this parameter result in better
+ compression at the expense of memory usage. The default value is 15 if
deflateInit is used instead.
+ For the current implementation of deflate(), a windowBits value of 8 (a
+ window size of 256 bytes) is not supported. As a result, a request for 8
+ will result in 9 (a 512-byte window). In that case, providing 8 to
+ inflateInit2() will result in an error when the zlib header with 9 is
+ checked against the initialization of inflate(). The remedy is to not use 8
+ with deflateInit2() with this initialization, or at least in that case use 9
+ with inflateInit2().
+
+ windowBits can also be -8..-15 for raw deflate. In this case, -windowBits
+ determines the window size. deflate() will then generate raw deflate data
+ with no zlib header or trailer, and will not compute a check value.
+
+ windowBits can also be greater than 15 for optional gzip encoding. Add
+ 16 to windowBits to write a simple gzip header and trailer around the
+ compressed data instead of a zlib wrapper. The gzip header will have no
+ file name, no extra data, no comment, no modification time (set to zero), no
+ header crc, and the operating system will be set to the appropriate value,
+ if the operating system was determined at compile time. If a gzip stream is
+ being written, strm->adler is a CRC-32 instead of an Adler-32.
+
+ For raw deflate or gzip encoding, a request for a 256-byte window is
+ rejected as invalid, since only the zlib header provides a means of
+ transmitting the window size to the decompressor.
+
The memLevel parameter specifies how much memory should be allocated
- for the internal compression state. memLevel=1 uses minimum memory but
- is slow and reduces compression ratio; memLevel=9 uses maximum memory
- for optimal speed. The default value is 8. See zconf.h for total memory
- usage as a function of windowBits and memLevel.
+ for the internal compression state. memLevel=1 uses minimum memory but is
+ slow and reduces compression ratio; memLevel=9 uses maximum memory for
+ optimal speed. The default value is 8. See zconf.h for total memory usage
+ as a function of windowBits and memLevel.
- The strategy parameter is used to tune the compression algorithm. Use the
+ The strategy parameter is used to tune the compression algorithm. Use the
value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
- filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
- string match). Filtered data consists mostly of small values with a
- somewhat random distribution. In this case, the compression algorithm is
- tuned to compress them better. The effect of Z_FILTERED is to force more
- Huffman coding and less string matching; it is somewhat intermediate
- between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
- the compression ratio but not the correctness of the compressed output even
- if it is not set appropriately.
-
- deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
- method). msg is set to null if there is no error message. deflateInit2 does
- not perform any compression: this will be done by deflate().
+ filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no
+ string match), or Z_RLE to limit match distances to one (run-length
+ encoding). Filtered data consists mostly of small values with a somewhat
+ random distribution. In this case, the compression algorithm is tuned to
+ compress them better. The effect of Z_FILTERED is to force more Huffman
+ coding and less string matching; it is somewhat intermediate between
+ Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as
+ fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. The
+ strategy parameter only affects the compression ratio but not the
+ correctness of the compressed output even if it is not set appropriately.
+ Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simpler
+ decoder for special applications.
+
+ deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid
+ method), or Z_VERSION_ERROR if the zlib library version (zlib_version) is
+ incompatible with the version assumed by the caller (ZLIB_VERSION). msg is
+ set to null if there is no error message. deflateInit2 does not perform any
+ compression: this will be done by deflate().
*/
+ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
/*
Initializes the compression dictionary from the given byte sequence
- without producing any compressed output. This function must be called
- immediately after deflateInit, deflateInit2 or deflateReset, before any
- call of deflate. The compressor and decompressor must use exactly the same
- dictionary (see inflateSetDictionary).
+ without producing any compressed output. When using the zlib format, this
+ function must be called immediately after deflateInit, deflateInit2 or
+ deflateReset, and before any call of deflate. When doing raw deflate, this
+ function must be called either before any call of deflate, or immediately
+ after the completion of a deflate block, i.e. after all input has been
+ consumed and all output has been delivered when using any of the flush
+ options Z_BLOCK, Z_PARTIAL_FLUSH, Z_SYNC_FLUSH, or Z_FULL_FLUSH. The
+ compressor and decompressor must use exactly the same dictionary (see
+ inflateSetDictionary).
The dictionary should consist of strings (byte sequences) that are likely
to be encountered later in the data to be compressed, with the most commonly
- used strings preferably put towards the end of the dictionary. Using a
+ used strings preferably put towards the end of the dictionary. Using a
dictionary is most useful when the data to be compressed is short and can be
predicted with good accuracy; the data can then be compressed better than
with the default empty dictionary.
Depending on the size of the compression data structures selected by
deflateInit or deflateInit2, a part of the dictionary may in effect be
- discarded, for example if the dictionary is larger than the window size in
- deflate or deflate2. Thus the strings most likely to be useful should be
- put at the end of the dictionary, not at the front.
+ discarded, for example if the dictionary is larger than the window size
+ provided in deflateInit or deflateInit2. Thus the strings most likely to be
+ useful should be put at the end of the dictionary, not at the front. In
+ addition, the current implementation of deflate will use at most the window
+ size minus 262 bytes of the provided dictionary.
- Upon return of this function, strm->adler is set to the Adler32 value
+ Upon return of this function, strm->adler is set to the Adler-32 value
of the dictionary; the decompressor may later use this value to determine
- which dictionary has been used by the compressor. (The Adler32 value
+ which dictionary has been used by the compressor. (The Adler-32 value
applies to the whole dictionary even if only a subset of the dictionary is
- actually used by the compressor.)
+ actually used by the compressor.) If a raw deflate was requested, then the
+ Adler-32 value is not computed and strm->adler is not set.
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
inconsistent (for example if deflate has already been called for this stream
- or if the compression method is bsort). deflateSetDictionary does not
- perform any compression: this will be done by deflate().
+ or if not at a block boundary for raw deflate). deflateSetDictionary does
+ not perform any compression: this will be done by deflate().
*/
+ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
+ Bytef *dictionary,
+ uInt *dictLength));
+/*
+ Returns the sliding dictionary being maintained by deflate. dictLength is
+ set to the number of bytes in the dictionary, and that many bytes are copied
+ to dictionary. dictionary must have enough space, where 32768 bytes is
+ always enough. If deflateGetDictionary() is called with dictionary equal to
+ Z_NULL, then only the dictionary length is returned, and nothing is copied.
+ Similary, if dictLength is Z_NULL, then it is not set.
+
+ deflateGetDictionary() may return a length less than the window size, even
+ when more than the window size in input has been provided. It may return up
+ to 258 bytes less in that case, due to how zlib's implementation of deflate
+ manages the sliding window and lookahead for matches, where matches can be
+ up to 258 bytes long. If the application needs the last window-size bytes of
+ input, then that would need to be saved by the application outside of zlib.
+
+ deflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
+ stream state is inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
+ z_streamp source));
/*
Sets the destination stream as a complete copy of the source stream.
This function can be useful when several compression strategies will be
tried, for example when there are several ways of pre-processing the input
- data with a filter. The streams that will be discarded should then be freed
+ data with a filter. The streams that will be discarded should then be freed
by calling deflateEnd. Note that deflateCopy duplicates the internal
- compression state which can be quite large, so this strategy is slow and
- can consume lots of memory.
+ compression state which can be quite large, so this strategy is slow and can
+ consume lots of memory.
deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
- (such as zalloc being NULL). msg is left unchanged in both source and
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
destination.
*/
+ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
/*
- This function is equivalent to deflateEnd followed by deflateInit,
- but does not free and reallocate all the internal compression state.
- The stream will keep the same compression level and any other attributes
- that may have been set by deflateInit2.
+ This function is equivalent to deflateEnd followed by deflateInit, but
+ does not free and reallocate the internal compression state. The stream
+ will leave the compression level and any other attributes that may have been
+ set unchanged.
- deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
+ deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
*/
+ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
+ int level,
+ int strategy));
/*
Dynamically update the compression level and compression strategy. The
- interpretation of level and strategy is as in deflateInit2. This can be
+ interpretation of level and strategy is as in deflateInit2(). This can be
used to switch between compression and straight copy of the input data, or
- to switch to a different kind of input data requiring a different
- strategy. If the compression level is changed, the input available so far
- is compressed with the old level (and may be flushed); the new level will
- take effect only at the next call of deflate().
+ to switch to a different kind of input data requiring a different strategy.
+ If the compression approach (which is a function of the level) or the
+ strategy is changed, and if there have been any deflate() calls since the
+ state was initialized or reset, then the input available so far is
+ compressed with the old level and strategy using deflate(strm, Z_BLOCK).
+ There are three approaches for the compression levels 0, 1..3, and 4..9
+ respectively. The new level and strategy will take effect at the next call
+ of deflate().
+
+ If a deflate(strm, Z_BLOCK) is performed by deflateParams(), and it does
+ not have enough output space to complete, then the parameter change will not
+ take effect. In this case, deflateParams() can be called again with the
+ same parameters and more output space to try again.
+
+ In order to assure a change in the parameters on the first try, the
+ deflate stream should be flushed using deflate() with Z_BLOCK or other flush
+ request until strm.avail_out is not zero, before calling deflateParams().
+ Then no more input data should be provided before the deflateParams() call.
+ If this is done, the old level and strategy will be applied to the data
+ compressed before deflateParams(), and the new level and strategy will be
+ applied to the the data compressed after deflateParams().
+
+ deflateParams returns Z_OK on success, Z_STREAM_ERROR if the source stream
+ state was inconsistent or if a parameter was invalid, or Z_BUF_ERROR if
+ there was not enough output space to complete the compression of the
+ available input data before a change in the strategy or approach. Note that
+ in the case of a Z_BUF_ERROR, the parameters are not changed. A return
+ value of Z_BUF_ERROR is not fatal, in which case deflateParams() can be
+ retried with more output space.
+*/
- Before the call of deflateParams, the stream state must be set as for
- a call of deflate(), since the currently available input may have to
- be compressed and flushed. In particular, strm->avail_out must be non-zero.
+ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm,
+ int good_length,
+ int max_lazy,
+ int nice_length,
+ int max_chain));
+/*
+ Fine tune deflate's internal compression parameters. This should only be
+ used by someone who understands the algorithm used by zlib's deflate for
+ searching for the best matching string, and even then only by the most
+ fanatic optimizer trying to squeeze out the last compressed bit for their
+ specific input data. Read the deflate.c source code for the meaning of the
+ max_lazy, good_length, nice_length, and max_chain parameters.
+
+ deflateTune() can be called after deflateInit() or deflateInit2(), and
+ returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream.
+ */
- deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
- stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
- if strm->avail_out was zero.
+ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm,
+ uLong sourceLen));
+/*
+ deflateBound() returns an upper bound on the compressed size after
+ deflation of sourceLen bytes. It must be called after deflateInit() or
+ deflateInit2(), and after deflateSetHeader(), if used. This would be used
+ to allocate an output buffer for deflation in a single pass, and so would be
+ called before deflate(). If that first deflate() call is provided the
+ sourceLen input bytes, an output buffer allocated to the size returned by
+ deflateBound(), and the flush value Z_FINISH, then deflate() is guaranteed
+ to return Z_STREAM_END. Note that it is possible for the compressed size to
+ be larger than the value returned by deflateBound() if flush options other
+ than Z_FINISH or Z_NO_FLUSH are used.
*/
+ZEXTERN int ZEXPORT deflatePending OF((z_streamp strm,
+ unsigned *pending,
+ int *bits));
+/*
+ deflatePending() returns the number of bytes and bits of output that have
+ been generated, but not yet provided in the available output. The bytes not
+ provided would be due to the available output space having being consumed.
+ The number of bits of output not provided are between 0 and 7, where they
+ await more bits to join them in order to fill out a full byte. If pending
+ or bits are Z_NULL, then those values are not set.
+
+ deflatePending returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+ */
+
+ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
/*
-ZEXTERN(int) inflateInit2 OF((z_streamp strm,
+ deflatePrime() inserts bits in the deflate output stream. The intent
+ is that this function is used to start off the deflate output with the bits
+ leftover from a previous deflate stream when appending to it. As such, this
+ function can only be used for raw deflate, and must be used before the first
+ deflate() call after a deflateInit2() or deflateReset(). bits must be less
+ than or equal to 16, and that many of the least significant bits of value
+ will be inserted in the output.
+
+ deflatePrime returns Z_OK if success, Z_BUF_ERROR if there was not enough
+ room in the internal buffer to insert the bits, or Z_STREAM_ERROR if the
+ source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ deflateSetHeader() provides gzip header information for when a gzip
+ stream is requested by deflateInit2(). deflateSetHeader() may be called
+ after deflateInit2() or deflateReset() and before the first call of
+ deflate(). The text, time, os, extra field, name, and comment information
+ in the provided gz_header structure are written to the gzip header (xflag is
+ ignored -- the extra flags are set according to the compression level). The
+ caller must assure that, if not Z_NULL, name and comment are terminated with
+ a zero byte, and that if extra is not Z_NULL, that extra_len bytes are
+ available there. If hcrc is true, a gzip header crc is included. Note that
+ the current versions of the command-line version of gzip (up through version
+ 1.3.x) do not support header crc's, and will report that it is a "multi-part
+ gzip file" and give up.
+
+ If deflateSetHeader is not used, the default gzip header has text false,
+ the time set to zero, and os set to 255, with no extra, name, or comment
+ fields. The gzip header is returned to the default state by deflateReset().
+
+ deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+/*
+ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
int windowBits));
- This is another version of inflateInit with an extra parameter. The
+ This is another version of inflateInit with an extra parameter. The
fields next_in, avail_in, zalloc, zfree and opaque must be initialized
before by the caller.
The windowBits parameter is the base two logarithm of the maximum window
size (the size of the history buffer). It should be in the range 8..15 for
- this version of the library. The default value is 15 if inflateInit is used
- instead. If a compressed stream with a larger window size is given as
- input, inflate() will return with the error code Z_DATA_ERROR instead of
- trying to allocate a larger window.
-
- inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
- memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
- memLevel). msg is set to null if there is no error message. inflateInit2
- does not perform any decompression apart from reading the zlib header if
- present: this will be done by inflate(). (So next_in and avail_in may be
- modified, but next_out and avail_out are unchanged.)
+ this version of the library. The default value is 15 if inflateInit is used
+ instead. windowBits must be greater than or equal to the windowBits value
+ provided to deflateInit2() while compressing, or it must be equal to 15 if
+ deflateInit2() was not used. If a compressed stream with a larger window
+ size is given as input, inflate() will return with the error code
+ Z_DATA_ERROR instead of trying to allocate a larger window.
+
+ windowBits can also be zero to request that inflate use the window size in
+ the zlib header of the compressed stream.
+
+ windowBits can also be -8..-15 for raw inflate. In this case, -windowBits
+ determines the window size. inflate() will then process raw deflate data,
+ not looking for a zlib or gzip header, not generating a check value, and not
+ looking for any check values for comparison at the end of the stream. This
+ is for use with other formats that use the deflate compressed data format
+ such as zip. Those formats provide their own check values. If a custom
+ format is developed using the raw deflate format for compressed data, it is
+ recommended that a check value such as an Adler-32 or a CRC-32 be applied to
+ the uncompressed data as is done in the zlib, gzip, and zip formats. For
+ most applications, the zlib format should be used as is. Note that comments
+ above on the use in deflateInit2() applies to the magnitude of windowBits.
+
+ windowBits can also be greater than 15 for optional gzip decoding. Add
+ 32 to windowBits to enable zlib and gzip decoding with automatic header
+ detection, or add 16 to decode only the gzip format (the zlib format will
+ return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is a
+ CRC-32 instead of an Adler-32. Unlike the gunzip utility and gzread() (see
+ below), inflate() will *not* automatically decode concatenated gzip members.
+ inflate() will return Z_STREAM_END at the end of the gzip member. The state
+ would need to be reset to continue decoding a subsequent gzip member. This
+ *must* be done if there is more data after a gzip member, in order for the
+ decompression to be compliant with the gzip standard (RFC 1952).
+
+ inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
+ memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
+ version assumed by the caller, or Z_STREAM_ERROR if the parameters are
+ invalid, such as a null pointer to the structure. msg is set to null if
+ there is no error message. inflateInit2 does not perform any decompression
+ apart from possibly reading the zlib header if present: actual decompression
+ will be done by inflate(). (So next_in and avail_in may be modified, but
+ next_out and avail_out are unused and unchanged.) The current implementation
+ of inflateInit2() does not process any header information -- that is
+ deferred until inflate() is called.
*/
+ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
+ const Bytef *dictionary,
+ uInt dictLength));
/*
Initializes the decompression dictionary from the given uncompressed byte
- sequence. This function must be called immediately after a call of inflate
- if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
- can be determined from the Adler32 value returned by this call of
- inflate. The compressor and decompressor must use exactly the same
- dictionary (see deflateSetDictionary).
+ sequence. This function must be called immediately after a call of inflate,
+ if that call returned Z_NEED_DICT. The dictionary chosen by the compressor
+ can be determined from the Adler-32 value returned by that call of inflate.
+ The compressor and decompressor must use exactly the same dictionary (see
+ deflateSetDictionary). For raw inflate, this function can be called at any
+ time to set the dictionary. If the provided dictionary is smaller than the
+ window and there is already data in the window, then the provided dictionary
+ will amend what's there. The application must insure that the dictionary
+ that was used for compression is provided.
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
- parameter is invalid (such as NULL dictionary) or the stream state is
+ parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
- expected one (incorrect Adler32 value). inflateSetDictionary does not
+ expected one (incorrect Adler-32 value). inflateSetDictionary does not
perform any decompression: this will be done by subsequent calls of
inflate().
*/
+ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
+ Bytef *dictionary,
+ uInt *dictLength));
+/*
+ Returns the sliding dictionary being maintained by inflate. dictLength is
+ set to the number of bytes in the dictionary, and that many bytes are copied
+ to dictionary. dictionary must have enough space, where 32768 bytes is
+ always enough. If inflateGetDictionary() is called with dictionary equal to
+ Z_NULL, then only the dictionary length is returned, and nothing is copied.
+ Similary, if dictLength is Z_NULL, then it is not set.
+
+ inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
+ stream state is inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
/*
- Skips invalid compressed data until a full flush point (see above the
- description of deflate with Z_FULL_FLUSH) can be found, or until all
- available input is skipped. No output is provided.
+ Skips invalid compressed data until a possible full flush point (see above
+ for the description of deflate with Z_FULL_FLUSH) can be found, or until all
+ available input is skipped. No output is provided.
+
+ inflateSync searches for a 00 00 FF FF pattern in the compressed data.
+ All full flush points have this pattern, but not all occurrences of this
+ pattern are full flush points.
+
+ inflateSync returns Z_OK if a possible full flush point has been found,
+ Z_BUF_ERROR if no more input was provided, Z_DATA_ERROR if no flush point
+ has been found, or Z_STREAM_ERROR if the stream structure was inconsistent.
+ In the success case, the application may save the current current value of
+ total_in which indicates where valid compressed data was found. In the
+ error case, the application may repeatedly call inflateSync, providing more
+ input each time, until success or end of the input data.
+*/
+
+ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest,
+ z_streamp source));
+/*
+ Sets the destination stream as a complete copy of the source stream.
- inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
- if no more input was provided, Z_DATA_ERROR if no flush point has been found,
- or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
- case, the application may save the current value of total_in which
- indicates where valid compressed data was found. In the error case, the
- application may repeatedly call inflateSync, providing more input each time,
- until success or end of the input data.
+ This function can be useful when randomly accessing a large stream. The
+ first pass through the stream can periodically record the inflate state,
+ allowing restarting inflate at those points when randomly accessing the
+ stream.
+
+ inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
+ enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
+ (such as zalloc being Z_NULL). msg is left unchanged in both source and
+ destination.
*/
-ZEXTERN(int) inflateReset OF((z_streamp strm));
+#endif /* !Z_FREETYPE */
+
+ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
/*
This function is equivalent to inflateEnd followed by inflateInit,
- but does not free and reallocate all the internal decompression state.
- The stream will keep attributes that may have been set by inflateInit2.
+ but does not free and reallocate the internal decompression state. The
+ stream will keep attributes that may have been set by inflateInit2.
+
+ inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL).
+*/
+
+ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm,
+ int windowBits));
+/*
+ This function is the same as inflateReset, but it also permits changing
+ the wrap and window size requests. The windowBits parameter is interpreted
+ the same as it is for inflateInit2. If the window size is changed, then the
+ memory allocated for the window is freed, and the window will be reallocated
+ by inflate() if needed.
+
+ inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent (such as zalloc or state being Z_NULL), or if
+ the windowBits parameter is invalid.
+*/
+
+#ifndef Z_FREETYPE
+
+ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm,
+ int bits,
+ int value));
+/*
+ This function inserts bits in the inflate input stream. The intent is
+ that this function is used to start inflating at a bit position in the
+ middle of a byte. The provided bits will be used before any bytes are used
+ from next_in. This function should only be used with raw inflate, and
+ should be used before the first inflate() call after inflateInit2() or
+ inflateReset(). bits must be less than or equal to 16, and that many of the
+ least significant bits of value will be inserted in the input.
+
+ If bits is negative, then the input stream bit buffer is emptied. Then
+ inflatePrime() can be called again to put bits in the buffer. This is used
+ to clear out bits leftover after feeding inflate a block description prior
+ to feeding inflate codes.
+
+ inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm));
+/*
+ This function returns two values, one in the lower 16 bits of the return
+ value, and the other in the remaining upper bits, obtained by shifting the
+ return value down 16 bits. If the upper value is -1 and the lower value is
+ zero, then inflate() is currently decoding information outside of a block.
+ If the upper value is -1 and the lower value is non-zero, then inflate is in
+ the middle of a stored block, with the lower value equaling the number of
+ bytes from the input remaining to copy. If the upper value is not -1, then
+ it is the number of bits back from the current bit position in the input of
+ the code (literal or length/distance pair) currently being processed. In
+ that case the lower value is the number of bytes already emitted for that
+ code.
+
+ A code is being processed if inflate is waiting for more input to complete
+ decoding of the code, or if it has completed decoding but is waiting for
+ more output space to write the literal or match data.
+
+ inflateMark() is used to mark locations in the input data for random
+ access, which may be at bit positions, and to note those cases where the
+ output of a code may span boundaries of random access blocks. The current
+ location in the input stream can be determined from avail_in and data_type
+ as noted in the description for the Z_BLOCK flush parameter for inflate.
+
+ inflateMark returns the value noted above, or -65536 if the provided
+ source stream state was inconsistent.
+*/
+
+ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm,
+ gz_headerp head));
+/*
+ inflateGetHeader() requests that gzip header information be stored in the
+ provided gz_header structure. inflateGetHeader() may be called after
+ inflateInit2() or inflateReset(), and before the first call of inflate().
+ As inflate() processes the gzip stream, head->done is zero until the header
+ is completed, at which time head->done is set to one. If a zlib stream is
+ being decoded, then head->done is set to -1 to indicate that there will be
+ no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES can be
+ used to force inflate() to return immediately after header processing is
+ complete and before any actual data is decompressed.
+
+ The text, time, xflags, and os fields are filled in with the gzip header
+ contents. hcrc is set to true if there is a header CRC. (The header CRC
+ was valid if done is set to one.) If extra is not Z_NULL, then extra_max
+ contains the maximum number of bytes to write to extra. Once done is true,
+ extra_len contains the actual extra field length, and extra contains the
+ extra field, or that field truncated if extra_max is less than extra_len.
+ If name is not Z_NULL, then up to name_max characters are written there,
+ terminated with a zero unless the length is greater than name_max. If
+ comment is not Z_NULL, then up to comm_max characters are written there,
+ terminated with a zero unless the length is greater than comm_max. When any
+ of extra, name, or comment are not Z_NULL and the respective field is not
+ present in the header, then that field is set to Z_NULL to signal its
+ absence. This allows the use of deflateSetHeader() with the returned
+ structure to duplicate the header. However if those fields are set to
+ allocated memory, then the application will need to save those pointers
+ elsewhere so that they can be eventually freed.
+
+ If inflateGetHeader is not used, then the header information is simply
+ discarded. The header is always checked for validity, including the header
+ CRC if present. inflateReset() will reset the process to discard the header
+ information. The application would need to call inflateGetHeader() again to
+ retrieve the header from the next gzip stream.
+
+ inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
+ stream state was inconsistent.
+*/
+
+#endif /* !Z_FREETYPE */
+
+/*
+ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window));
+
+ Initialize the internal stream state for decompression using inflateBack()
+ calls. The fields zalloc, zfree and opaque in strm must be initialized
+ before the call. If zalloc and zfree are Z_NULL, then the default library-
+ derived memory allocation routines are used. windowBits is the base two
+ logarithm of the window size, in the range 8..15. window is a caller
+ supplied buffer of that size. Except for special applications where it is
+ assured that deflate was used with small window sizes, windowBits must be 15
+ and a 32K byte window must be supplied to be able to decompress general
+ deflate streams.
+
+ See inflateBack() for the usage of these routines.
+
+ inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
+ the parameters are invalid, Z_MEM_ERROR if the internal state could not be
+ allocated, or Z_VERSION_ERROR if the version of the library does not match
+ the version of the header file.
+*/
+
+typedef unsigned (*in_func) OF((void FAR *,
+ z_const unsigned char FAR * FAR *));
+typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned));
- inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
- stream state was inconsistent (such as zalloc or state being NULL).
+#ifndef Z_FREETYPE
+
+ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm,
+ in_func in, void FAR *in_desc,
+ out_func out, void FAR *out_desc));
+/*
+ inflateBack() does a raw inflate with a single call using a call-back
+ interface for input and output. This is potentially more efficient than
+ inflate() for file i/o applications, in that it avoids copying between the
+ output and the sliding window by simply making the window itself the output
+ buffer. inflate() can be faster on modern CPUs when used with large
+ buffers. inflateBack() trusts the application to not change the output
+ buffer passed by the output function, at least until inflateBack() returns.
+
+ inflateBackInit() must be called first to allocate the internal state
+ and to initialize the state with the user-provided window buffer.
+ inflateBack() may then be used multiple times to inflate a complete, raw
+ deflate stream with each call. inflateBackEnd() is then called to free the
+ allocated state.
+
+ A raw deflate stream is one with no zlib or gzip header or trailer.
+ This routine would normally be used in a utility that reads zip or gzip
+ files and writes out uncompressed files. The utility would decode the
+ header and process the trailer on its own, hence this routine expects only
+ the raw deflate stream to decompress. This is different from the default
+ behavior of inflate(), which expects a zlib header and trailer around the
+ deflate stream.
+
+ inflateBack() uses two subroutines supplied by the caller that are then
+ called by inflateBack() for input and output. inflateBack() calls those
+ routines until it reads a complete deflate stream and writes out all of the
+ uncompressed data, or until it encounters an error. The function's
+ parameters and return types are defined above in the in_func and out_func
+ typedefs. inflateBack() will call in(in_desc, &buf) which should return the
+ number of bytes of provided input, and a pointer to that input in buf. If
+ there is no input available, in() must return zero -- buf is ignored in that
+ case -- and inflateBack() will return a buffer error. inflateBack() will
+ call out(out_desc, buf, len) to write the uncompressed data buf[0..len-1].
+ out() should return zero on success, or non-zero on failure. If out()
+ returns non-zero, inflateBack() will return with an error. Neither in() nor
+ out() are permitted to change the contents of the window provided to
+ inflateBackInit(), which is also the buffer that out() uses to write from.
+ The length written by out() will be at most the window size. Any non-zero
+ amount of input may be provided by in().
+
+ For convenience, inflateBack() can be provided input on the first call by
+ setting strm->next_in and strm->avail_in. If that input is exhausted, then
+ in() will be called. Therefore strm->next_in must be initialized before
+ calling inflateBack(). If strm->next_in is Z_NULL, then in() will be called
+ immediately for input. If strm->next_in is not Z_NULL, then strm->avail_in
+ must also be initialized, and then if strm->avail_in is not zero, input will
+ initially be taken from strm->next_in[0 .. strm->avail_in - 1].
+
+ The in_desc and out_desc parameters of inflateBack() is passed as the
+ first parameter of in() and out() respectively when they are called. These
+ descriptors can be optionally used to pass any information that the caller-
+ supplied in() and out() functions need to do their job.
+
+ On return, inflateBack() will set strm->next_in and strm->avail_in to
+ pass back any unused input that was provided by the last in() call. The
+ return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERROR
+ if in() or out() returned an error, Z_DATA_ERROR if there was a format error
+ in the deflate stream (in which case strm->msg is set to indicate the nature
+ of the error), or Z_STREAM_ERROR if the stream was not properly initialized.
+ In the case of Z_BUF_ERROR, an input or output error can be distinguished
+ using strm->next_in which will be Z_NULL only if in() returned an error. If
+ strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() returning
+ non-zero. (in() will always be called before out(), so strm->next_in is
+ assured to be defined if out() returns non-zero.) Note that inflateBack()
+ cannot return Z_OK.
*/
+ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm));
+/*
+ All memory allocated by inflateBackInit() is freed.
+
+ inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the stream
+ state was inconsistent.
+*/
+
+ZEXTERN uLong ZEXPORT zlibCompileFlags OF((void));
+/* Return flags indicating compile-time options.
+
+ Type sizes, two bits each, 00 = 16 bits, 01 = 32, 10 = 64, 11 = other:
+ 1.0: size of uInt
+ 3.2: size of uLong
+ 5.4: size of voidpf (pointer)
+ 7.6: size of z_off_t
+
+ Compiler, assembler, and debug options:
+ 8: ZLIB_DEBUG
+ 9: ASMV or ASMINF -- use ASM code
+ 10: ZLIB_WINAPI -- exported functions use the WINAPI calling convention
+ 11: 0 (reserved)
+
+ One-time table building (smaller code, but not thread-safe if true):
+ 12: BUILDFIXED -- build static block decoding tables when needed
+ 13: DYNAMIC_CRC_TABLE -- build CRC calculation tables when needed
+ 14,15: 0 (reserved)
+
+ Library content (indicates missing functionality):
+ 16: NO_GZCOMPRESS -- gz* functions cannot compress (to avoid linking
+ deflate code when not needed)
+ 17: NO_GZIP -- deflate can't write gzip streams, and inflate can't detect
+ and decode gzip streams (to avoid linking crc code)
+ 18-19: 0 (reserved)
+
+ Operation variations (changes in library functionality):
+ 20: PKZIP_BUG_WORKAROUND -- slightly more permissive inflate
+ 21: FASTEST -- deflate algorithm with only one, lowest compression level
+ 22,23: 0 (reserved)
+
+ The sprintf variant used by gzprintf (zero is best):
+ 24: 0 = vs*, 1 = s* -- 1 means limited to 20 arguments after the format
+ 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure!
+ 26: 0 = returns value, 1 = void -- 1 means inferred string length returned
+
+ Remainder:
+ 27-31: 0 (reserved)
+ */
+
+#endif /* !Z_FREETYPE */
+
+#ifndef Z_SOLO
/* utility functions */
/*
- The following utility functions are implemented on top of the
- basic stream-oriented functions. To simplify the interface, some
- default options are assumed (compression level and memory usage,
- standard memory allocation functions). The source code of these
- utility functions can easily be modified if you need special options.
+ The following utility functions are implemented on top of the basic
+ stream-oriented functions. To simplify the interface, some default options
+ are assumed (compression level and memory usage, standard memory allocation
+ functions). The source code of these utility functions can be modified if
+ you need special options.
*/
+ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
/*
Compresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be at least 0.1% larger than
- sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
- compressed buffer.
- This function can be used to compress a whole file at once if the
- input file is mmap'ed.
+ the byte length of the source buffer. Upon entry, destLen is the total size
+ of the destination buffer, which must be at least the value returned by
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed data. compress() is equivalent to compress2() with a level
+ parameter of Z_DEFAULT_COMPRESSION.
+
compress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
buffer.
*/
+ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen,
+ int level));
/*
- Compresses the source buffer into the destination buffer. The level
+ Compresses the source buffer into the destination buffer. The level
parameter has the same meaning as in deflateInit. sourceLen is the byte
- length of the source buffer. Upon entry, destLen is the total size of the
- destination buffer, which must be at least 0.1% larger than sourceLen plus
- 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
+ length of the source buffer. Upon entry, destLen is the total size of the
+ destination buffer, which must be at least the value returned by
+ compressBound(sourceLen). Upon exit, destLen is the actual size of the
+ compressed data.
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
Z_STREAM_ERROR if the level parameter is invalid.
*/
+ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen));
+/*
+ compressBound() returns an upper bound on the compressed size after
+ compress() or compress2() on sourceLen bytes. It would be used before a
+ compress() or compress2() call to allocate the destination buffer.
+*/
+
+ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong sourceLen));
/*
Decompresses the source buffer into the destination buffer. sourceLen is
- the byte length of the source buffer. Upon entry, destLen is the total
- size of the destination buffer, which must be large enough to hold the
- entire uncompressed data. (The size of the uncompressed data must have
- been saved previously by the compressor and transmitted to the decompressor
- by some mechanism outside the scope of this compression library.)
- Upon exit, destLen is the actual size of the compressed buffer.
- This function can be used to decompress a whole file at once if the
- input file is mmap'ed.
+ the byte length of the source buffer. Upon entry, destLen is the total size
+ of the destination buffer, which must be large enough to hold the entire
+ uncompressed data. (The size of the uncompressed data must have been saved
+ previously by the compressor and transmitted to the decompressor by some
+ mechanism outside the scope of this compression library.) Upon exit, destLen
+ is the actual size of the uncompressed data.
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
enough memory, Z_BUF_ERROR if there was not enough room in the output
- buffer, or Z_DATA_ERROR if the input data was corrupted.
+ buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. In
+ the case where there is not enough room, uncompress() will fill the output
+ buffer with the uncompressed data up to that point.
+*/
+
+ZEXTERN int ZEXPORT uncompress2 OF((Bytef *dest, uLongf *destLen,
+ const Bytef *source, uLong *sourceLen));
+/*
+ Same as uncompress, except that sourceLen is a pointer, where the
+ length of the source is *sourceLen. On return, *sourceLen is the number of
+ source bytes consumed.
+*/
+
+ /* gzip file access functions */
+
+/*
+ This library supports reading and writing files in gzip (.gz) format with
+ an interface similar to that of stdio, using the functions that start with
+ "gz". The gzip format is different from the zlib format. gzip is a gzip
+ wrapper, documented in RFC 1952, wrapped around a deflate stream.
*/
+typedef struct gzFile_s *gzFile; /* semi-opaque gzip file descriptor */
/*
- Opens a gzip (.gz) file for reading or writing. The mode parameter
- is as in fopen ("rb" or "wb") but can also include a compression level
- ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
- Huffman only compression as in "wb1h". (See the description
- of deflateInit2 for more information about the strategy parameter.)
+ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
+
+ Open the gzip (.gz) file at path for reading and decompressing, or
+ compressing and writing. The mode parameter is as in fopen ("rb" or "wb")
+ but can also include a compression level ("wb9") or a strategy: 'f' for
+ filtered data as in "wb6f", 'h' for Huffman-only compression as in "wb1h",
+ 'R' for run-length encoding as in "wb1R", or 'F' for fixed code compression
+ as in "wb9F". (See the description of deflateInit2 for more information
+ about the strategy parameter.) 'T' will request transparent writing or
+ appending with no compression and not using the gzip format.
+
+ "a" can be used instead of "w" to request that the gzip stream that will
+ be written be appended to the file. "+" will result in an error, since
+ reading and writing to the same gzip file is not supported. The addition of
+ "x" when writing will create the file exclusively, which fails if the file
+ already exists. On systems that support it, the addition of "e" when
+ reading or writing will set the flag to close the file on an execve() call.
+
+ These functions, as well as gzip, will read and decode a sequence of gzip
+ streams in a file. The append function of gzopen() can be used to create
+ such a file. (Also see gzflush() for another way to do this.) When
+ appending, gzopen does not test whether the file begins with a gzip stream,
+ nor does it look for the end of the gzip streams to begin appending. gzopen
+ will simply append a gzip stream to the existing file.
gzopen can be used to read a file which is not in gzip format; in this
- case gzread will directly read from the file without decompression.
+ case gzread will directly read from the file without decompression. When
+ reading, this will be detected automatically by looking for the magic two-
+ byte gzip header.
+
+ gzopen returns NULL if the file could not be opened, if there was
+ insufficient memory to allocate the gzFile state, or if an invalid mode was
+ specified (an 'r', 'w', or 'a' was not provided, or '+' was provided).
+ errno can be checked to determine if the reason gzopen failed was that the
+ file could not be opened.
+*/
- gzopen returns NULL if the file could not be opened or if there was
- insufficient memory to allocate the (de)compression state; errno
- can be checked to distinguish the two cases (if errno is zero, the
- zlib error is Z_MEM_ERROR). */
+ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
+/*
+ Associate a gzFile with the file descriptor fd. File descriptors are
+ obtained from calls like open, dup, creat, pipe or fileno (if the file has
+ been previously opened with fopen). The mode parameter is as in gzopen.
+
+ The next call of gzclose on the returned gzFile will also close the file
+ descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descriptor
+ fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd,
+ mode);. The duplicated descriptor should be saved to avoid a leak, since
+ gzdopen does not close fd if it fails. If you are using fileno() to get the
+ file descriptor from a FILE *, then you will have to use dup() to avoid
+ double-close()ing the file descriptor. Both gzclose() and fclose() will
+ close the associated file descriptor, so they need to have different file
+ descriptors.
+
+ gzdopen returns NULL if there was insufficient memory to allocate the
+ gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was not
+ provided, or '+' was provided), or if fd is -1. The file descriptor is not
+ used until the next gz* read, write, seek, or close operation, so gzdopen
+ will not detect if fd is invalid (unless fd is -1).
+*/
+ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size));
/*
- gzdopen() associates a gzFile with the file descriptor fd. File
- descriptors are obtained from calls like open, dup, creat, pipe or
- fileno (in the file has been previously opened with fopen).
- The mode parameter is as in gzopen.
- The next call of gzclose on the returned gzFile will also close the
- file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
- descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
- gzdopen returns NULL if there was insufficient memory to allocate
- the (de)compression state.
+ Set the internal buffer size used by this library's functions for file to
+ size. The default buffer size is 8192 bytes. This function must be called
+ after gzopen() or gzdopen(), and before any other calls that read or write
+ the file. The buffer memory allocation is always deferred to the first read
+ or write. Three times that size in buffer space is allocated. A larger
+ buffer size of, for example, 64K or 128K bytes will noticeably increase the
+ speed of decompression (reading).
+
+ The new buffer size also affects the maximum length for gzprintf().
+
+ gzbuffer() returns 0 on success, or -1 on failure, such as being called
+ too late.
*/
+ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
/*
- Dynamically update the compression level or strategy. See the description
- of deflateInit2 for the meaning of these parameters.
- gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
- opened for writing.
+ Dynamically update the compression level and strategy for file. See the
+ description of deflateInit2 for the meaning of these parameters. Previously
+ provided data is flushed before applying the parameter changes.
+
+ gzsetparams returns Z_OK if success, Z_STREAM_ERROR if the file was not
+ opened for writing, Z_ERRNO if there is an error writing the flushed data,
+ or Z_MEM_ERROR if there is a memory allocation error.
*/
+ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
/*
- Reads the given number of uncompressed bytes from the compressed file.
- If the input file was not in gzip format, gzread copies the given number
- of bytes into the buffer.
- gzread returns the number of uncompressed bytes actually read (0 for
- end of file, -1 for error). */
+ Read and decompress up to len uncompressed bytes from file into buf. If
+ the input file is not in gzip format, gzread copies the given number of
+ bytes into the buffer directly from the file.
+
+ After reaching the end of a gzip stream in the input, gzread will continue
+ to read, looking for another gzip stream. Any number of gzip streams may be
+ concatenated in the input file, and will all be decompressed by gzread().
+ If something other than a gzip stream is encountered after a gzip stream,
+ that remaining trailing garbage is ignored (and no error is returned).
+
+ gzread can be used to read a gzip file that is being concurrently written.
+ Upon reaching the end of the input, gzread will return with the available
+ data. If the error code returned by gzerror is Z_OK or Z_BUF_ERROR, then
+ gzclearerr can be used to clear the end of file indicator in order to permit
+ gzread to be tried again. Z_OK indicates that a gzip stream was completed
+ on the last gzread. Z_BUF_ERROR indicates that the input file ended in the
+ middle of a gzip stream. Note that gzread does not return -1 in the event
+ of an incomplete gzip stream. This error is deferred until gzclose(), which
+ will return Z_BUF_ERROR if the last gzread ended in the middle of a gzip
+ stream. Alternatively, gzerror can be used before gzclose to detect this
+ case.
+
+ gzread returns the number of uncompressed bytes actually read, less than
+ len for end of file, or -1 for error. If len is too large to fit in an int,
+ then nothing is read, -1 is returned, and the error state is set to
+ Z_STREAM_ERROR.
+*/
+ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
+ gzFile file));
/*
- Writes the given number of uncompressed bytes into the compressed file.
- gzwrite returns the number of uncompressed bytes actually written
- (0 in case of error).
+ Read and decompress up to nitems items of size size from file into buf,
+ otherwise operating as gzread() does. This duplicates the interface of
+ stdio's fread(), with size_t request and return types. If the library
+ defines size_t, then z_size_t is identical to size_t. If not, then z_size_t
+ is an unsigned integer type that can contain a pointer.
+
+ gzfread() returns the number of full items read of size size, or zero if
+ the end of the file was reached and a full item could not be read, or if
+ there was an error. gzerror() must be consulted if zero is returned in
+ order to determine if there was an error. If the multiplication of size and
+ nitems overflows, i.e. the product does not fit in a z_size_t, then nothing
+ is read, zero is returned, and the error state is set to Z_STREAM_ERROR.
+
+ In the event that the end of file is reached and only a partial item is
+ available at the end, i.e. the remaining uncompressed data length is not a
+ multiple of size, then the final partial item is nevetheless read into buf
+ and the end-of-file flag is set. The length of the partial item read is not
+ provided, but could be inferred from the result of gztell(). This behavior
+ is the same as the behavior of fread() implementations in common libraries,
+ but it prevents the direct use of gzfread() to read a concurrently written
+ file, reseting and retrying on end-of-file, when size is not 1.
*/
+ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
/*
- Converts, formats, and writes the args to the compressed file under
- control of the format string, as in fprintf. gzprintf returns the number of
- uncompressed bytes actually written (0 in case of error).
+ Compress and write the len uncompressed bytes at buf to file. gzwrite
+ returns the number of uncompressed bytes written or 0 in case of error.
*/
+ZEXTERN z_size_t ZEXPORT gzfwrite OF((voidpc buf, z_size_t size,
+ z_size_t nitems, gzFile file));
/*
- Writes the given null-terminated string to the compressed file, excluding
+ Compress and write nitems items of size size from buf to file, duplicating
+ the interface of stdio's fwrite(), with size_t request and return types. If
+ the library defines size_t, then z_size_t is identical to size_t. If not,
+ then z_size_t is an unsigned integer type that can contain a pointer.
+
+ gzfwrite() returns the number of full items written of size size, or zero
+ if there was an error. If the multiplication of size and nitems overflows,
+ i.e. the product does not fit in a z_size_t, then nothing is written, zero
+ is returned, and the error state is set to Z_STREAM_ERROR.
+*/
+
+ZEXTERN int ZEXPORTVA gzprintf Z_ARG((gzFile file, const char *format, ...));
+/*
+ Convert, format, compress, and write the arguments (...) to file under
+ control of the string format, as in fprintf. gzprintf returns the number of
+ uncompressed bytes actually written, or a negative zlib error code in case
+ of error. The number of uncompressed bytes written is limited to 8191, or
+ one less than the buffer size given to gzbuffer(). The caller should assure
+ that this limit is not exceeded. If it is exceeded, then gzprintf() will
+ return an error (0) with nothing written. In this case, there may also be a
+ buffer overflow with unpredictable consequences, which is possible only if
+ zlib was compiled with the insecure functions sprintf() or vsprintf(),
+ because the secure snprintf() or vsnprintf() functions were not available.
+ This can be determined using zlibCompileFlags().
+*/
+
+ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
+/*
+ Compress and write the given null-terminated string s to file, excluding
the terminating null character.
- gzputs returns the number of characters written, or -1 in case of error.
+
+ gzputs returns the number of characters written, or -1 in case of error.
+*/
+
+ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
+/*
+ Read and decompress bytes from file into buf, until len-1 characters are
+ read, or until a newline character is read and transferred to buf, or an
+ end-of-file condition is encountered. If any characters are read or if len
+ is one, the string is terminated with a null character. If no characters
+ are read due to an end-of-file or len is less than one, then the buffer is
+ left untouched.
+
+ gzgets returns buf which is a null-terminated string, or it returns NULL
+ for end-of-file or in case of error. If there was an error, the contents at
+ buf are indeterminate.
*/
+ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
/*
- Reads bytes from the compressed file until len-1 characters are read, or
- a newline character is read and transferred to buf, or an end-of-file
- condition is encountered. The string is then terminated with a null
- character.
- gzgets returns buf, or Z_NULL in case of error.
+ Compress and write c, converted to an unsigned char, into file. gzputc
+ returns the value that was written, or -1 in case of error.
*/
+ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
/*
- Writes c, converted to an unsigned char, into the compressed file.
- gzputc returns the value that was written, or -1 in case of error.
+ Read and decompress one byte from file. gzgetc returns this byte or -1
+ in case of end of file or error. This is implemented as a macro for speed.
+ As such, it does not do all of the checking the other functions do. I.e.
+ it does not check to see if file is NULL, nor whether the structure file
+ points to has been clobbered or not.
*/
+ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file));
/*
- Reads one byte from the compressed file. gzgetc returns this byte
- or -1 in case of end of file or error.
+ Push c back onto the stream for file to be read as the first character on
+ the next read. At least one character of push-back is always allowed.
+ gzungetc() returns the character pushed, or -1 on failure. gzungetc() will
+ fail if c is -1, and may fail if a character has been pushed but not read
+ yet. If gzungetc is used immediately after gzopen or gzdopen, at least the
+ output buffer size of pushed characters is allowed. (See gzbuffer above.)
+ The pushed character will be discarded if the stream is repositioned with
+ gzseek() or gzrewind().
*/
+ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
/*
- Flushes all pending output into the compressed file. The parameter
- flush is as in the deflate() function. The return value is the zlib
- error number (see function gzerror below). gzflush returns Z_OK if
- the flush parameter is Z_FINISH and all output could be flushed.
- gzflush should be called only when strictly necessary because it can
- degrade compression.
+ Flush all pending output to file. The parameter flush is as in the
+ deflate() function. The return value is the zlib error number (see function
+ gzerror below). gzflush is only permitted when writing.
+
+ If the flush parameter is Z_FINISH, the remaining data is written and the
+ gzip stream is completed in the output. If gzwrite() is called again, a new
+ gzip stream will be started in the output. gzread() is able to read such
+ concatenated gzip streams.
+
+ gzflush should be called only when strictly necessary because it will
+ degrade compression if called too often.
*/
/*
- Sets the starting position for the next gzread or gzwrite on the
- given compressed file. The offset represents a number of bytes in the
- uncompressed data stream. The whence parameter is defined as in lseek(2);
+ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
+ z_off_t offset, int whence));
+
+ Set the starting position to offset relative to whence for the next gzread
+ or gzwrite on file. The offset represents a number of bytes in the
+ uncompressed data stream. The whence parameter is defined as in lseek(2);
the value SEEK_END is not supported.
+
If the file is opened for reading, this function is emulated but can be
- extremely slow. If the file is opened for writing, only forward seeks are
+ extremely slow. If the file is opened for writing, only forward seeks are
supported; gzseek then compresses a sequence of zeroes up to the new
starting position.
- gzseek returns the resulting offset location as measured in bytes from
+ gzseek returns the resulting offset location as measured in bytes from
the beginning of the uncompressed stream, or -1 in case of error, in
particular if the file is opened for writing and the new starting position
would be before the current position.
*/
+ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
/*
- Rewinds the given file. This function is supported only for reading.
+ Rewind file. This function is supported only for reading.
- gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
+ gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET).
*/
/*
- Returns the starting position for the next gzread or gzwrite on the
- given compressed file. This position represents a number of bytes in the
- uncompressed data stream.
+ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
- gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+ Return the starting position for the next gzread or gzwrite on file.
+ This position represents a number of bytes in the uncompressed data stream,
+ and is zero when starting, even if appending or reading a gzip stream from
+ the middle of a file using gzdopen().
+
+ gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
+*/
+
+/*
+ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file));
+
+ Return the current compressed (actual) read or write offset of file. This
+ offset includes the count of bytes that precede the gzip stream, for example
+ when appending or when using gzdopen() for reading. When reading, the
+ offset does not include as yet unused buffered input. This information can
+ be used for a progress indicator. On error, gzoffset() returns -1.
+*/
+
+ZEXTERN int ZEXPORT gzeof OF((gzFile file));
+/*
+ Return true (1) if the end-of-file indicator for file has been set while
+ reading, false (0) otherwise. Note that the end-of-file indicator is set
+ only if the read tried to go past the end of the input, but came up short.
+ Therefore, just like feof(), gzeof() may return false even if there is no
+ more data to read, in the event that the last read request was for the exact
+ number of bytes remaining in the input file. This will happen if the input
+ file size is an exact multiple of the buffer size.
+
+ If gzeof() returns true, then the read functions will return no more data,
+ unless the end-of-file indicator is reset by gzclearerr() and the input file
+ has grown since the previous end of file was detected.
+*/
+
+ZEXTERN int ZEXPORT gzdirect OF((gzFile file));
+/*
+ Return true (1) if file is being copied directly while reading, or false
+ (0) if file is a gzip stream being decompressed.
+
+ If the input file is empty, gzdirect() will return true, since the input
+ does not contain a gzip stream.
+
+ If gzdirect() is used immediately after gzopen() or gzdopen() it will
+ cause buffers to be allocated to allow reading the file to determine if it
+ is a gzip file. Therefore if gzbuffer() is used, it should be called before
+ gzdirect().
+
+ When writing, gzdirect() returns true (1) if transparent writing was
+ requested ("wT" for the gzopen() mode), or false (0) otherwise. (Note:
+ gzdirect() is not needed when writing. Transparent writing must be
+ explicitly requested, so the application already knows the answer. When
+ linking statically, using gzdirect() will include all of the zlib code for
+ gzip file reading and decompression, which may not be desired.)
*/
+ZEXTERN int ZEXPORT gzclose OF((gzFile file));
/*
- Returns 1 when EOF has previously been detected reading the given
- input stream, otherwise zero.
+ Flush all pending output for file, if necessary, close file and
+ deallocate the (de)compression state. Note that once file is closed, you
+ cannot call gzerror with file, since its structures have been deallocated.
+ gzclose must not be called more than once on the same file, just as free
+ must not be called more than once on the same allocation.
+
+ gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a
+ file operation error, Z_MEM_ERROR if out of memory, Z_BUF_ERROR if the
+ last read ended in the middle of a gzip stream, or Z_OK on success.
*/
+ZEXTERN int ZEXPORT gzclose_r OF((gzFile file));
+ZEXTERN int ZEXPORT gzclose_w OF((gzFile file));
/*
- Flushes all pending output if necessary, closes the compressed file
- and deallocates all the (de)compression state. The return value is the zlib
- error number (see function gzerror below).
+ Same as gzclose(), but gzclose_r() is only for use when reading, and
+ gzclose_w() is only for use when writing or appending. The advantage to
+ using these instead of gzclose() is that they avoid linking in zlib
+ compression or decompression code that is not used when only reading or only
+ writing respectively. If gzclose() is used, then both compression and
+ decompression code will be included the application when linking to a static
+ zlib library.
*/
+ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
/*
- Returns the error message for the last error which occurred on the
- given compressed file. errnum is set to zlib error number. If an
- error occurred in the file system and not in the compression library,
- errnum is set to Z_ERRNO and the application may consult errno
- to get the exact error code.
+ Return the error message for the last error which occurred on file.
+ errnum is set to zlib error number. If an error occurred in the file system
+ and not in the compression library, errnum is set to Z_ERRNO and the
+ application may consult errno to get the exact error code.
+
+ The application must not modify the returned string. Future calls to
+ this function may invalidate the previously returned string. If file is
+ closed, then the string previously returned by gzerror will no longer be
+ available.
+
+ gzerror() should be used to distinguish errors from end-of-file for those
+ functions above that do not distinguish those cases in their return values.
*/
+ZEXTERN void ZEXPORT gzclearerr OF((gzFile file));
+/*
+ Clear the error and end-of-file flags for file. This is analogous to the
+ clearerr() function in stdio. This is useful for continuing to read a gzip
+ file that is being written concurrently.
+*/
+
+#endif /* !Z_SOLO */
+
/* checksum functions */
/*
These functions are not related to compression but are exported
- anyway because they might be useful in applications using the
- compression library.
+ anyway because they might be useful in applications using the compression
+ library.
*/
-ZEXTERN(uLong) adler32 OF((uLong adler, const Bytef *buf, uInt len));
-
+ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
/*
Update a running Adler-32 checksum with the bytes buf[0..len-1] and
- return the updated checksum. If buf is NULL, this function returns
- the required initial value for the checksum.
- An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
- much faster. Usage example:
+ return the updated checksum. An Adler-32 value is in the range of a 32-bit
+ unsigned integer. If buf is Z_NULL, this function returns the required
+ initial value for the checksum.
+
+ An Adler-32 checksum is almost as reliable as a CRC-32 but can be computed
+ much faster.
+
+ Usage example:
uLong adler = adler32(0L, Z_NULL, 0);
@@ -789,11 +1720,32 @@ ZEXTERN(uLong) adler32 OF((uLong adler, const Bytef *buf, uInt len));
if (adler != original_adler) error();
*/
+ZEXTERN uLong ZEXPORT adler32_z OF((uLong adler, const Bytef *buf,
+ z_size_t len));
+/*
+ Same as adler32(), but with a size_t length.
+*/
+
+/*
+ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2,
+ z_off_t len2));
+
+ Combine two Adler-32 checksums into one. For two sequences of bytes, seq1
+ and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for
+ each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of
+ seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. Note
+ that the z_off_t type (like off_t) is a signed integer. If len2 is
+ negative, the result has no meaning or utility.
+*/
+
+ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
/*
- Update a running crc with the bytes buf[0..len-1] and return the updated
- crc. If buf is NULL, this function returns the required initial value
- for the crc. Pre- and post-conditioning (one's complement) is performed
- within this function so it shouldn't be done by the application.
+ Update a running CRC-32 with the bytes buf[0..len-1] and return the
+ updated CRC-32. A CRC-32 value is in the range of a 32-bit unsigned integer.
+ If buf is Z_NULL, this function returns the required initial value for the
+ crc. Pre- and post-conditioning (one's complement) is performed within this
+ function so it shouldn't be done by the application.
+
Usage example:
uLong crc = crc32(0L, Z_NULL, 0);
@@ -804,27 +1756,213 @@ ZEXTERN(uLong) adler32 OF((uLong adler, const Bytef *buf, uInt len));
if (crc != original_crc) error();
*/
+#ifndef Z_FREETYPE
+
+ZEXTERN uLong ZEXPORT crc32_z OF((uLong crc, const Bytef *buf,
+ z_size_t len));
+/*
+ Same as crc32(), but with a size_t length.
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2));
+
+ Combine two CRC-32 check values into one. For two sequences of bytes,
+ seq1 and seq2 with lengths len1 and len2, CRC-32 check values were
+ calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32
+ check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and
+ len2.
+*/
+
+/*
+ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t len2));
+
+ Return the operator corresponding to length len2, to be used with
+ crc32_combine_op().
+*/
+
+ZEXTERN uLong ZEXPORT crc32_combine_op OF((uLong crc1, uLong crc2, uLong op));
+/*
+ Give the same result as crc32_combine(), using op in place of len2. op is
+ is generated from len2 by crc32_combine_gen(). This will be faster than
+ crc32_combine() if the generated op is used more than once.
+*/
+
/* various hacks, don't look :) */
/* deflateInit and inflateInit are macros to allow checking the zlib version
* and the compiler's view of z_stream:
*/
-ZEXTERN(int) inflateInit2_ OF((z_streamp strm, int windowBits,
+ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
+ int windowBits, int memLevel,
+ int strategy, const char *version,
+ int stream_size));
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
+ const char *version, int stream_size));
+ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits,
+ unsigned char FAR *window,
+ const char *version,
+ int stream_size));
+#ifdef Z_PREFIX_SET
+# define z_deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+# define z_inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+# define z_deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
+# define z_inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+ (int)sizeof(z_stream))
+# define z_inflateBackInit(strm, windowBits, window) \
+ inflateBackInit_((strm), (windowBits), (window), \
+ ZLIB_VERSION, (int)sizeof(z_stream))
+#else
+# define deflateInit(strm, level) \
+ deflateInit_((strm), (level), ZLIB_VERSION, (int)sizeof(z_stream))
+# define inflateInit(strm) \
+ inflateInit_((strm), ZLIB_VERSION, (int)sizeof(z_stream))
+# define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
+ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
+ (strategy), ZLIB_VERSION, (int)sizeof(z_stream))
+# define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+ (int)sizeof(z_stream))
+# define inflateBackInit(strm, windowBits, window) \
+ inflateBackInit_((strm), (windowBits), (window), \
+ ZLIB_VERSION, (int)sizeof(z_stream))
+#endif
+
+#else /* Z_FREETYPE */
+
+
+ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
const char *version, int stream_size));
-#define deflateInit(strm, level) \
- deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit(strm) \
- inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
-#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
- deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
- (strategy), ZLIB_VERSION, sizeof(z_stream))
-#define inflateInit2(strm, windowBits) \
- inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
+# define inflateInit2(strm, windowBits) \
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, \
+ (int)sizeof(z_stream))
+
+#endif /* Z_FREETYPE */
+
+
+#ifndef Z_SOLO
+
+/* gzgetc() macro and its supporting function and exposed data structure. Note
+ * that the real internal state is much larger than the exposed structure.
+ * This abbreviated structure exposes just enough for the gzgetc() macro. The
+ * user should not mess with these exposed elements, since their names or
+ * behavior could change in the future, perhaps even capriciously. They can
+ * only be used by the gzgetc() macro. You have been warned.
+ */
+struct gzFile_s {
+ unsigned have;
+ unsigned char *next;
+ z_off64_t pos;
+};
+ZEXTERN int ZEXPORT gzgetc_ OF((gzFile file)); /* backward compatibility */
+#ifdef Z_PREFIX_SET
+# undef z_gzgetc
+# define z_gzgetc(g) \
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
+#else
+# define gzgetc(g) \
+ ((g)->have ? ((g)->have--, (g)->pos++, *((g)->next)++) : (gzgetc)(g))
+#endif
+
+/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or
+ * change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if
+ * both are true, the application gets the *64 functions, and the regular
+ * functions are changed to 64 bits) -- in case these are set on systems
+ * without large file support, _LFS64_LARGEFILE must also be true
+ */
+#ifdef Z_LARGE64
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int));
+ ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t));
+ ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off64_t));
+#endif
+
+#if !defined(ZLIB_INTERNAL) && defined(Z_WANT64)
+# ifdef Z_PREFIX_SET
+# define z_gzopen z_gzopen64
+# define z_gzseek z_gzseek64
+# define z_gztell z_gztell64
+# define z_gzoffset z_gzoffset64
+# define z_adler32_combine z_adler32_combine64
+# define z_crc32_combine z_crc32_combine64
+# define z_crc32_combine_gen z_crc32_combine_gen64
+# else
+# define gzopen gzopen64
+# define gzseek gzseek64
+# define gztell gztell64
+# define gzoffset gzoffset64
+# define adler32_combine adler32_combine64
+# define crc32_combine crc32_combine64
+# define crc32_combine_gen crc32_combine_gen64
+# endif
+# ifndef Z_LARGE64
+ ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile));
+ ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
+# endif
+#else
+ ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
+ ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
+ ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
+ ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
+#endif
+
+#else /* Z_SOLO */
+
+#ifndef Z_FREETYPE
+ ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine_gen OF((z_off_t));
+#endif
+
+#endif /* !Z_SOLO */
+
+/* undocumented functions */
+#ifndef Z_FREETYPE
+ZEXTERN const char * ZEXPORT zError OF((int));
+ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp));
+ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table OF((void));
+ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int));
+ZEXTERN int ZEXPORT inflateValidate OF((z_streamp, int));
+ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
+ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
+ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
+#if defined(_WIN32) && !defined(Z_SOLO)
+ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
+ const char *mode));
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifndef Z_SOLO
+ZEXTERN int ZEXPORTVA gzvprintf Z_ARG((gzFile file,
+ const char *format,
+ va_list va));
+# endif
+#endif
+#endif /* !Z_FREETYPE */
#ifdef __cplusplus
}
#endif
-#endif /* _ZLIB_H */
+#endif /* ZLIB_H */
diff --git a/freetype/src/gzip/zutil.c b/freetype/src/gzip/zutil.c
index 7ad0c1f8..a19ac2b9 100644
--- a/freetype/src/gzip/zutil.c
+++ b/freetype/src/gzip/zutil.c
@@ -1,23 +1,155 @@
/* zutil.c -- target dependent utility functions for the compression library
- * Copyright (C) 1995-2002 Jean-loup Gailly.
+ * Copyright (C) 1995-2017 Jean-loup Gailly
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zutil.h"
+#ifndef Z_SOLO
+# include "gzguts.h"
+#endif
-#ifndef STDC
-extern void exit OF((int));
+z_const char * const z_errmsg[10] = {
+ (z_const char *)"need dictionary", /* Z_NEED_DICT 2 */
+ (z_const char *)"stream end", /* Z_STREAM_END 1 */
+ (z_const char *)"", /* Z_OK 0 */
+ (z_const char *)"file error", /* Z_ERRNO (-1) */
+ (z_const char *)"stream error", /* Z_STREAM_ERROR (-2) */
+ (z_const char *)"data error", /* Z_DATA_ERROR (-3) */
+ (z_const char *)"insufficient memory", /* Z_MEM_ERROR (-4) */
+ (z_const char *)"buffer error", /* Z_BUF_ERROR (-5) */
+ (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */
+ (z_const char *)""
+};
+
+
+const char * ZEXPORT zlibVersion()
+{
+ return ZLIB_VERSION;
+}
+
+uLong ZEXPORT zlibCompileFlags()
+{
+ uLong flags;
+
+ flags = 0;
+ switch ((int)(sizeof(uInt))) {
+ case 2: break;
+ case 4: flags += 1; break;
+ case 8: flags += 2; break;
+ default: flags += 3;
+ }
+ switch ((int)(sizeof(uLong))) {
+ case 2: break;
+ case 4: flags += 1 << 2; break;
+ case 8: flags += 2 << 2; break;
+ default: flags += 3 << 2;
+ }
+ switch ((int)(sizeof(voidpf))) {
+ case 2: break;
+ case 4: flags += 1 << 4; break;
+ case 8: flags += 2 << 4; break;
+ default: flags += 3 << 4;
+ }
+ switch ((int)(sizeof(z_off_t))) {
+ case 2: break;
+ case 4: flags += 1 << 6; break;
+ case 8: flags += 2 << 6; break;
+ default: flags += 3 << 6;
+ }
+#ifdef ZLIB_DEBUG
+ flags += 1 << 8;
+#endif
+#if defined(ASMV) || defined(ASMINF)
+ flags += 1 << 9;
+#endif
+#ifdef ZLIB_WINAPI
+ flags += 1 << 10;
+#endif
+#ifdef BUILDFIXED
+ flags += 1 << 12;
+#endif
+#ifdef DYNAMIC_CRC_TABLE
+ flags += 1 << 13;
+#endif
+#ifdef NO_GZCOMPRESS
+ flags += 1L << 16;
+#endif
+#ifdef NO_GZIP
+ flags += 1L << 17;
+#endif
+#ifdef PKZIP_BUG_WORKAROUND
+ flags += 1L << 20;
+#endif
+#ifdef FASTEST
+ flags += 1L << 21;
+#endif
+#if defined(STDC) || defined(Z_HAVE_STDARG_H)
+# ifdef NO_vsnprintf
+ flags += 1L << 25;
+# ifdef HAS_vsprintf_void
+ flags += 1L << 26;
+# endif
+# else
+# ifdef HAS_vsnprintf_void
+ flags += 1L << 26;
+# endif
+# endif
+#else
+ flags += 1L << 24;
+# ifdef NO_snprintf
+ flags += 1L << 25;
+# ifdef HAS_sprintf_void
+ flags += 1L << 26;
+# endif
+# else
+# ifdef HAS_snprintf_void
+ flags += 1L << 26;
+# endif
+# endif
+#endif
+ return flags;
+}
+
+#ifdef ZLIB_DEBUG
+#include <stdlib.h>
+# ifndef verbose
+# define verbose 0
+# endif
+int ZLIB_INTERNAL z_verbose = verbose;
+
+void ZLIB_INTERNAL z_error (
+ char *m)
+{
+ fprintf(stderr, "%s\n", m);
+ exit(1);
+}
#endif
+/* exported to allow conversion of error code to string for compress() and
+ * uncompress()
+ */
+const char * ZEXPORT zError(
+ int err)
+{
+ return ERR_MSG(err);
+}
+
+#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
+ /* The older Microsoft C Run-Time Library for Windows CE doesn't have
+ * errno. We define it as a global variable to simplify porting.
+ * Its value is always 0 and should not be used.
+ */
+ int errno = 0;
+#endif
#ifndef HAVE_MEMCPY
-void zmemcpy(dest, source, len)
- Bytef* dest;
- const Bytef* source;
- uInt len;
+void ZLIB_INTERNAL zmemcpy(
+ Bytef* dest,
+ const Bytef* source,
+ uInt len)
{
if (len == 0) return;
do {
@@ -25,10 +157,10 @@ void zmemcpy(dest, source, len)
} while (--len != 0);
}
-int zmemcmp(s1, s2, len)
- const Bytef* s1;
- const Bytef* s2;
- uInt len;
+int ZLIB_INTERNAL zmemcmp(
+ const Bytef* s1,
+ const Bytef* s2,
+ uInt len)
{
uInt j;
@@ -38,9 +170,9 @@ int zmemcmp(s1, s2, len)
return 0;
}
-void zmemzero(dest, len)
- Bytef* dest;
- uInt len;
+void ZLIB_INTERNAL zmemzero(
+ Bytef* dest,
+ uInt len)
{
if (len == 0) return;
do {
@@ -49,11 +181,13 @@ void zmemzero(dest, len)
}
#endif
-#if defined( MSDOS ) && defined( __TURBOC__ ) && !defined( MY_ZCALLOC )
-#if (defined( __BORLANDC__) || !defined(SMALL_MEDIUM)) && !defined(__32BIT__)
-/* Small and medium model in Turbo C are for now limited to near allocation
- * with reduced MAX_WBITS and MAX_MEM_LEVEL
- */
+#ifndef Z_SOLO
+
+#ifdef SYS16BIT
+
+#ifdef __TURBOC__
+/* Turbo C in 16-bit mode */
+
# define MY_ZCALLOC
/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
@@ -80,11 +214,13 @@ local ptr_table table[MAX_PTR];
* a protected system like OS/2. Use Microsoft C instead.
*/
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
{
- voidpf buf = opaque; /* just to make some compilers happy */
+ voidpf buf;
ulg bsize = (ulg)items*size;
+ (void)opaque;
+
/* If we allocate less than 65520 bytes, we assume that farmalloc
* will return a usable pointer which doesn't have to be normalized.
*/
@@ -104,9 +240,12 @@ voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
return buf;
}
-void zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
{
int n;
+
+ (void)opaque;
+
if (*(ush*)&ptr != 0) { /* object < 64K */
farfree(ptr);
return;
@@ -122,14 +261,13 @@ void zcfree (voidpf opaque, voidpf ptr)
next_ptr--;
return;
}
- ptr = opaque; /* just to make some compilers happy */
Assert(0, "zcfree: ptr not found");
}
-#endif
-#endif /* MSDOS && __TURBOC__ */
+
+#endif /* __TURBOC__ */
-#if defined(M_I86) && !defined(__32BIT__) && !defined( MY_ZCALLOC )
+#ifdef M_I86
/* Microsoft C in 16-bit mode */
# define MY_ZCALLOC
@@ -139,43 +277,49 @@ void zcfree (voidpf opaque, voidpf ptr)
# define _hfree hfree
#endif
-voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
+voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
{
- if (opaque) opaque = 0; /* to make compiler happy */
+ (void)opaque;
return _halloc((long)items, size);
}
-void zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
{
- if (opaque) opaque = 0; /* to make compiler happy */
+ (void)opaque;
_hfree(ptr);
}
-#endif /* MSC */
+#endif /* M_I86 */
+
+#endif /* SYS16BIT */
#ifndef MY_ZCALLOC /* Any system without a special alloc function */
#ifndef STDC
-extern voidp ft_scalloc OF((uInt items, uInt size));
-extern void ft_sfree OF((voidpf ptr));
+extern voidp malloc OF((uInt size));
+extern voidp calloc OF((uInt items, uInt size));
+extern void free OF((voidpf ptr));
#endif
-voidpf zcalloc (opaque, items, size)
- voidpf opaque;
- unsigned items;
- unsigned size;
+voidpf ZLIB_INTERNAL zcalloc (
+ voidpf opaque,
+ unsigned items,
+ unsigned size)
{
- if (opaque) items += size - size; /* make compiler happy */
- return (voidpf)ft_scalloc(items, size);
+ (void)opaque;
+ return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
+ (voidpf)calloc(items, size);
}
-void zcfree (opaque, ptr)
- voidpf opaque;
- voidpf ptr;
+void ZLIB_INTERNAL zcfree (
+ voidpf opaque,
+ voidpf ptr)
{
- ft_sfree(ptr);
- if (opaque) return; /* make compiler happy */
+ (void)opaque;
+ free(ptr);
}
#endif /* MY_ZCALLOC */
+
+#endif /* !Z_SOLO */
diff --git a/freetype/src/gzip/zutil.h b/freetype/src/gzip/zutil.h
index 40808a3c..14f0f1a8 100644
--- a/freetype/src/gzip/zutil.h
+++ b/freetype/src/gzip/zutil.h
@@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
- * Copyright (C) 1995-2002 Jean-loup Gailly.
+ * Copyright (C) 1995-2022 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -10,26 +10,31 @@
/* @(#) $Id$ */
-#ifndef _Z_UTIL_H
-#define _Z_UTIL_H
+#ifndef ZUTIL_H
+#define ZUTIL_H
+
+#ifdef HAVE_HIDDEN
+# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
+#else
+# define ZLIB_INTERNAL
+#endif
#include "zlib.h"
-#ifdef STDC
-# include <stddef.h>
+#if defined(STDC) && !defined(Z_SOLO)
+# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
+# include <stddef.h>
+# endif
# include <string.h>
# include <stdlib.h>
#endif
-#ifdef NO_ERRNO_H
- extern int errno;
-#else
-# include <errno.h>
-#endif
#ifndef local
# define local static
#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
+/* since "static" is used to mean two completely different things in C, we
+ define "local" for the non-static meaning of "static", for readability
+ (compile with -Dlocal if your debugger can't find static symbols) */
typedef unsigned char uch;
typedef uch FAR uchf;
@@ -37,9 +42,24 @@ typedef unsigned short ush;
typedef ush FAR ushf;
typedef unsigned long ulg;
+#if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC)
+# include <limits.h>
+# if (ULONG_MAX == 0xffffffffffffffff)
+# define Z_U8 unsigned long
+# elif (ULLONG_MAX == 0xffffffffffffffff)
+# define Z_U8 unsigned long long
+# elif (UINT_MAX == 0xffffffffffffffff)
+# define Z_U8 unsigned
+# endif
+#endif
+
+extern z_const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
+/* (size given to avoid silly warnings with Visual C++) */
+
+#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
#define ERR_RETURN(strm,err) \
- return (strm->msg = (char*)ERR_MSG(err), (err))
+ return (strm->msg = ERR_MSG(err), (err))
/* To be used only when the state is known to be valid */
/* common constants */
@@ -69,90 +89,129 @@ typedef unsigned long ulg;
/* target dependencies */
-#ifdef MSDOS
+#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
# define OS_CODE 0x00
-# if defined(__TURBOC__) || defined(__BORLANDC__)
-# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
- /* Allow compilation with ANSI keywords only enabled */
- void _Cdecl farfree( void *block );
- void *_Cdecl farmalloc( unsigned long nbytes );
-# else
-# include <alloc.h>
+# ifndef Z_SOLO
+# if defined(__TURBOC__) || defined(__BORLANDC__)
+# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
+ /* Allow compilation with ANSI keywords only enabled */
+ void _Cdecl farfree( void *block );
+ void *_Cdecl farmalloc( unsigned long nbytes );
+# else
+# include <alloc.h>
+# endif
+# else /* MSC or DJGPP */
+# include <malloc.h>
# endif
-# else /* MSC or DJGPP */
# endif
#endif
-#ifdef OS2
-# define OS_CODE 0x06
-#endif
-
-#ifdef WIN32 /* Window 95 & Windows NT */
-# define OS_CODE 0x0b
+#ifdef AMIGA
+# define OS_CODE 1
#endif
#if defined(VAXC) || defined(VMS)
-# define OS_CODE 0x02
+# define OS_CODE 2
# define F_OPEN(name, mode) \
- ft_fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
+ fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
#endif
-#ifdef AMIGA
-# define OS_CODE 0x01
+#ifdef __370__
+# if __TARGET_LIB__ < 0x20000000
+# define OS_CODE 4
+# elif __TARGET_LIB__ < 0x40000000
+# define OS_CODE 11
+# else
+# define OS_CODE 8
+# endif
#endif
#if defined(ATARI) || defined(atarist)
-# define OS_CODE 0x05
+# define OS_CODE 5
+#endif
+
+#ifdef OS2
+# define OS_CODE 6
+# if defined(M_I86) && !defined(Z_SOLO)
+# include <malloc.h>
+# endif
#endif
#if defined(MACOS) || defined(TARGET_OS_MAC)
-# define OS_CODE 0x07
-# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
-# include <unix.h> /* for fdopen */
-# else
-# ifndef fdopen
-# define fdopen(fd,mode) NULL /* No fdopen() */
+# define OS_CODE 7
+# ifndef Z_SOLO
+# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
+# include <unix.h> /* for fdopen */
+# else
+# ifndef fdopen
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# endif
# endif
# endif
#endif
-#ifdef __50SERIES /* Prime/PRIMOS */
-# define OS_CODE 0x0F
+#ifdef __acorn
+# define OS_CODE 13
#endif
-#ifdef TOPS20
-# define OS_CODE 0x0a
+#if defined(WIN32) && !defined(__CYGWIN__)
+# define OS_CODE 10
+#endif
+
+#ifdef _BEOS_
+# define OS_CODE 16
+#endif
+
+#ifdef __TOS_OS400__
+# define OS_CODE 18
+#endif
+
+#ifdef __APPLE__
+# define OS_CODE 19
#endif
#if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
-#if (defined(_MSC_VER) && (_MSC_VER > 600))
-# define fdopen(fd,type) _fdopen(fd,type)
+#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
+# if defined(_WIN32_WCE)
+# define fdopen(fd,mode) NULL /* No fdopen() */
+# else
+# define fdopen(fd,type) _fdopen(fd,type)
+# endif
+#endif
+
+#if defined(__BORLANDC__) && !defined(MSDOS)
+ #pragma warn -8004
+ #pragma warn -8008
+ #pragma warn -8066
+#endif
+
+#ifndef Z_FREETYPE
+
+/* provide prototypes for these when building zlib without LFS */
+#if !defined(_WIN32) && \
+ (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
+ ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
+ ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
#endif
+#endif /* !Z_FREETYPE */
- /* Common defaults */
+ /* common defaults */
#ifndef OS_CODE
-# define OS_CODE 0x03 /* assume Unix */
+# define OS_CODE 3 /* assume Unix */
#endif
#ifndef F_OPEN
-# define F_OPEN(name, mode) ft_fopen((name), (mode))
+# define F_OPEN(name, mode) fopen((name), (mode))
#endif
/* functions */
-#ifdef HAVE_STRERROR
- extern char *strerror OF((int));
-# define zstrerror(errnum) strerror(errnum)
-#else
-# define zstrerror(errnum) ""
-#endif
-
-#if defined(pyr)
+#if defined(pyr) || defined(Z_SOLO)
# define NO_MEMCPY
#endif
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
@@ -176,19 +235,22 @@ typedef unsigned long ulg;
# define zmemzero(dest, len) ft_memset(dest, 0, len)
# endif
#else
- extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
- extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
- extern void zmemzero OF((Bytef* dest, uInt len));
+ void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
+ int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
+ void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
#endif
/* Diagnostic functions */
-#ifdef DEBUG
-# define Assert(cond,msg)
-# define Trace(x)
-# define Tracev(x)
-# define Tracevv(x)
-# define Tracec(c,x)
-# define Tracecv(c,x)
+#ifdef ZLIB_DEBUG
+# include <stdio.h>
+ extern int ZLIB_INTERNAL z_verbose;
+ extern void ZLIB_INTERNAL z_error OF((char *m));
+# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
+# define Trace(x) {if (z_verbose>=0) fprintf x ;}
+# define Tracev(x) {if (z_verbose>0) fprintf x ;}
+# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
+# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
+# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
#else
# define Assert(cond,msg)
# define Trace(x)
@@ -198,15 +260,19 @@ typedef unsigned long ulg;
# define Tracecv(c,x)
#endif
-
-typedef uLong (*check_func) OF((uLong check, const Bytef *buf,
- uInt len));
-local voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
-local void zcfree OF((voidpf opaque, voidpf ptr));
+#ifndef Z_SOLO
+ voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items,
+ unsigned size));
+ void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr));
+#endif
#define ZALLOC(strm, items, size) \
(*((strm)->zalloc))((strm)->opaque, (items), (size))
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
-#endif /* _Z_UTIL_H */
+/* Reverse the bytes in a 32-bit value */
+#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
+ (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
+
+#endif /* ZUTIL_H */
diff --git a/freetype/src/lzw/ftlzw.c b/freetype/src/lzw/ftlzw.c
index e112418a..e12efcaa 100644
--- a/freetype/src/lzw/ftlzw.c
+++ b/freetype/src/lzw/ftlzw.c
@@ -8,7 +8,7 @@
* be used to parse compressed PCF fonts, as found with many X11 server
* distributions.
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* Albert Chin-A-Young.
*
* based on code in `src/gzip/ftgzip.c'
@@ -369,7 +369,7 @@
FT_ZERO( stream );
stream->memory = memory;
- if ( !FT_NEW( zip ) )
+ if ( !FT_QNEW( zip ) )
{
error = ft_lzw_file_init( zip, stream, source );
if ( error )
diff --git a/freetype/src/lzw/ftzopen.c b/freetype/src/lzw/ftzopen.c
index 8b5b357f..aaa98be2 100644
--- a/freetype/src/lzw/ftzopen.c
+++ b/freetype/src/lzw/ftzopen.c
@@ -8,7 +8,7 @@
* be used to parse compressed PCF fonts, as found with many X11 server
* distributions.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* David Turner.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/lzw/ftzopen.h b/freetype/src/lzw/ftzopen.h
index 9ada742c..86fccfe3 100644
--- a/freetype/src/lzw/ftzopen.h
+++ b/freetype/src/lzw/ftzopen.h
@@ -8,7 +8,7 @@
* be used to parse compressed PCF fonts, as found with many X11 server
* distributions.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* David Turner.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/lzw/rules.mk b/freetype/src/lzw/rules.mk
index 747cbdcc..d3aa1efa 100644
--- a/freetype/src/lzw/rules.mk
+++ b/freetype/src/lzw/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2004-2021 by
+# Copyright (C) 2004-2022 by
# Albert Chin-A-Young.
#
# based on `src/lzw/rules.mk'
diff --git a/freetype/src/otvalid/module.mk b/freetype/src/otvalid/module.mk
index 30093492..1d08012e 100644
--- a/freetype/src/otvalid/module.mk
+++ b/freetype/src/otvalid/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2004-2021 by
+# Copyright (C) 2004-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/otvalid/otvalid.c b/freetype/src/otvalid/otvalid.c
index 869233ce..f5344ca0 100644
--- a/freetype/src/otvalid/otvalid.c
+++ b/freetype/src/otvalid/otvalid.c
@@ -4,7 +4,7 @@
*
* FreeType validator for OpenType tables (body only).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvalid.h b/freetype/src/otvalid/otvalid.h
index f8ca454d..6274858f 100644
--- a/freetype/src/otvalid/otvalid.h
+++ b/freetype/src/otvalid/otvalid.h
@@ -4,7 +4,7 @@
*
* OpenType table validation (specification only).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvbase.c b/freetype/src/otvalid/otvbase.c
index 83f998cd..70de653b 100644
--- a/freetype/src/otvalid/otvbase.c
+++ b/freetype/src/otvalid/otvbase.c
@@ -4,7 +4,7 @@
*
* OpenType BASE table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvcommn.c b/freetype/src/otvalid/otvcommn.c
index 40624bb1..b9873ff2 100644
--- a/freetype/src/otvalid/otvcommn.c
+++ b/freetype/src/otvalid/otvcommn.c
@@ -4,7 +4,7 @@
*
* OpenType common tables validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvcommn.h b/freetype/src/otvalid/otvcommn.h
index 3b096ecc..f1e4a6a9 100644
--- a/freetype/src/otvalid/otvcommn.h
+++ b/freetype/src/otvalid/otvcommn.h
@@ -4,7 +4,7 @@
*
* OpenType common tables validation (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otverror.h b/freetype/src/otvalid/otverror.h
index 3e23234f..8c75c582 100644
--- a/freetype/src/otvalid/otverror.h
+++ b/freetype/src/otvalid/otverror.h
@@ -4,7 +4,7 @@
*
* OpenType validation module error codes (specification only).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvgdef.c b/freetype/src/otvalid/otvgdef.c
index 5a160a41..42533533 100644
--- a/freetype/src/otvalid/otvgdef.c
+++ b/freetype/src/otvalid/otvgdef.c
@@ -4,7 +4,7 @@
*
* OpenType GDEF table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvgpos.c b/freetype/src/otvalid/otvgpos.c
index e0d4e420..52e2cd1c 100644
--- a/freetype/src/otvalid/otvgpos.c
+++ b/freetype/src/otvalid/otvgpos.c
@@ -4,7 +4,7 @@
*
* OpenType GPOS table validation (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvgpos.h b/freetype/src/otvalid/otvgpos.h
index 176a6888..85ef6091 100644
--- a/freetype/src/otvalid/otvgpos.h
+++ b/freetype/src/otvalid/otvgpos.h
@@ -4,7 +4,7 @@
*
* OpenType GPOS table validator (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvgsub.c b/freetype/src/otvalid/otvgsub.c
index b426a174..3b6dcbb7 100644
--- a/freetype/src/otvalid/otvgsub.c
+++ b/freetype/src/otvalid/otvgsub.c
@@ -4,7 +4,7 @@
*
* OpenType GSUB table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvjstf.c b/freetype/src/otvalid/otvjstf.c
index 404dda88..0934716a 100644
--- a/freetype/src/otvalid/otvjstf.c
+++ b/freetype/src/otvalid/otvjstf.c
@@ -4,7 +4,7 @@
*
* OpenType JSTF table validation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvmath.c b/freetype/src/otvalid/otvmath.c
index b4bfabb6..a59557b3 100644
--- a/freetype/src/otvalid/otvmath.c
+++ b/freetype/src/otvalid/otvmath.c
@@ -4,7 +4,7 @@
*
* OpenType MATH table validation (body).
*
- * Copyright (C) 2007-2021 by
+ * Copyright (C) 2007-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by George Williams.
diff --git a/freetype/src/otvalid/otvmod.c b/freetype/src/otvalid/otvmod.c
index b7d674b5..3fc2dbe5 100644
--- a/freetype/src/otvalid/otvmod.c
+++ b/freetype/src/otvalid/otvmod.c
@@ -4,7 +4,7 @@
*
* FreeType's OpenType validation module implementation (body).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/otvmod.h b/freetype/src/otvalid/otvmod.h
index 37c20e00..2f0bcd6e 100644
--- a/freetype/src/otvalid/otvmod.h
+++ b/freetype/src/otvalid/otvmod.h
@@ -5,7 +5,7 @@
* FreeType's OpenType validation module implementation
* (specification).
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/otvalid/rules.mk b/freetype/src/otvalid/rules.mk
index 634a3506..924d2b6b 100644
--- a/freetype/src/otvalid/rules.mk
+++ b/freetype/src/otvalid/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2004-2021 by
+# Copyright (C) 2004-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/pcf/pcfread.c b/freetype/src/pcf/pcfread.c
index e60a0a51..f167bcb8 100644
--- a/freetype/src/pcf/pcfread.c
+++ b/freetype/src/pcf/pcfread.c
@@ -1034,16 +1034,6 @@ THE SOFTWARE.
enc->lastRow > 0xFF )
return FT_THROW( Invalid_Table );
- nencoding = (FT_ULong)( enc->lastCol - enc->firstCol + 1 ) *
- (FT_ULong)( enc->lastRow - enc->firstRow + 1 );
-
- if ( FT_NEW_ARRAY( enc->offset, nencoding ) )
- goto Bail;
-
- error = FT_Stream_EnterFrame( stream, 2 * nencoding );
- if ( error )
- goto Exit;
-
FT_TRACE5(( "\n" ));
defaultCharRow = enc->defaultChar >> 8;
@@ -1064,6 +1054,13 @@ THE SOFTWARE.
defaultCharCol = enc->firstCol;
}
+ nencoding = (FT_ULong)( enc->lastCol - enc->firstCol + 1 ) *
+ (FT_ULong)( enc->lastRow - enc->firstRow + 1 );
+
+ error = FT_Stream_EnterFrame( stream, 2 * nencoding );
+ if ( error )
+ goto Bail;
+
/*
* FreeType mandates that glyph index 0 is the `undefined glyph', which
* PCF calls the `default character'. However, FreeType needs glyph
@@ -1109,6 +1106,9 @@ THE SOFTWARE.
/* copy metrics of default character to index 0 */
face->metrics[0] = face->metrics[defaultCharEncodingOffset];
+ if ( FT_QNEW_ARRAY( enc->offset, nencoding ) )
+ goto Bail;
+
/* now loop over all values */
offset = enc->offset;
for ( i = enc->firstRow; i <= enc->lastRow; i++ )
@@ -1131,11 +1131,6 @@ THE SOFTWARE.
}
FT_Stream_ExitFrame( stream );
- return error;
-
- Exit:
- FT_FREE( enc->offset );
-
Bail:
return error;
}
diff --git a/freetype/src/pfr/module.mk b/freetype/src/pfr/module.mk
index 4f49e12d..570d400b 100644
--- a/freetype/src/pfr/module.mk
+++ b/freetype/src/pfr/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2002-2021 by
+# Copyright (C) 2002-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/pfr/pfr.c b/freetype/src/pfr/pfr.c
index 4058ad56..1dd38f93 100644
--- a/freetype/src/pfr/pfr.c
+++ b/freetype/src/pfr/pfr.c
@@ -4,7 +4,7 @@
*
* FreeType PFR driver component.
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrcmap.c b/freetype/src/pfr/pfrcmap.c
index 6a7f5735..6fa2417d 100644
--- a/freetype/src/pfr/pfrcmap.c
+++ b/freetype/src/pfr/pfrcmap.c
@@ -4,7 +4,7 @@
*
* FreeType PFR cmap handling (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrcmap.h b/freetype/src/pfr/pfrcmap.h
index 17c02a2b..afde164f 100644
--- a/freetype/src/pfr/pfrcmap.h
+++ b/freetype/src/pfr/pfrcmap.h
@@ -4,7 +4,7 @@
*
* FreeType PFR cmap handling (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrdrivr.c b/freetype/src/pfr/pfrdrivr.c
index 16b8f794..2a753c58 100644
--- a/freetype/src/pfr/pfrdrivr.c
+++ b/freetype/src/pfr/pfrdrivr.c
@@ -4,7 +4,7 @@
*
* FreeType PFR driver interface (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrdrivr.h b/freetype/src/pfr/pfrdrivr.h
index 6ff16fea..cfd749ab 100644
--- a/freetype/src/pfr/pfrdrivr.h
+++ b/freetype/src/pfr/pfrdrivr.h
@@ -4,7 +4,7 @@
*
* High-level Type PFR driver interface (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrerror.h b/freetype/src/pfr/pfrerror.h
index 255696ef..98b8f2fd 100644
--- a/freetype/src/pfr/pfrerror.h
+++ b/freetype/src/pfr/pfrerror.h
@@ -4,7 +4,7 @@
*
* PFR error codes (specification only).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrgload.c b/freetype/src/pfr/pfrgload.c
index b400042a..1b8d6cde 100644
--- a/freetype/src/pfr/pfrgload.c
+++ b/freetype/src/pfr/pfrgload.c
@@ -4,7 +4,7 @@
*
* FreeType PFR glyph loader (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrgload.h b/freetype/src/pfr/pfrgload.h
index b726d564..af592969 100644
--- a/freetype/src/pfr/pfrgload.h
+++ b/freetype/src/pfr/pfrgload.h
@@ -4,7 +4,7 @@
*
* FreeType PFR glyph loader (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrload.c b/freetype/src/pfr/pfrload.c
index a9c1e283..6bf79797 100644
--- a/freetype/src/pfr/pfrload.c
+++ b/freetype/src/pfr/pfrload.c
@@ -4,7 +4,7 @@
*
* FreeType PFR loader (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -993,7 +993,7 @@
PFR_CHECK_SIZE( count * Size );
- if ( FT_NEW_ARRAY( phy_font->chars, count ) )
+ if ( FT_QNEW_ARRAY( phy_font->chars, count ) )
goto Fail;
for ( n = 0; n < count; n++ )
diff --git a/freetype/src/pfr/pfrload.h b/freetype/src/pfr/pfrload.h
index 4f467d1b..5e0f451f 100644
--- a/freetype/src/pfr/pfrload.h
+++ b/freetype/src/pfr/pfrload.h
@@ -4,7 +4,7 @@
*
* FreeType PFR loader (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrobjs.c b/freetype/src/pfr/pfrobjs.c
index 3080cb65..5a6e3979 100644
--- a/freetype/src/pfr/pfrobjs.c
+++ b/freetype/src/pfr/pfrobjs.c
@@ -4,7 +4,7 @@
*
* FreeType PFR object methods (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -207,7 +207,7 @@
pfrface->height = (FT_Short)( ( pfrface->units_per_EM * 12 ) / 10 );
if ( pfrface->height < pfrface->ascender - pfrface->descender )
- pfrface->height = (FT_Short)(pfrface->ascender - pfrface->descender);
+ pfrface->height = (FT_Short)( pfrface->ascender - pfrface->descender );
if ( phy_font->num_strikes > 0 )
{
diff --git a/freetype/src/pfr/pfrobjs.h b/freetype/src/pfr/pfrobjs.h
index 70b05395..9ffc297d 100644
--- a/freetype/src/pfr/pfrobjs.h
+++ b/freetype/src/pfr/pfrobjs.h
@@ -4,7 +4,7 @@
*
* FreeType PFR object methods (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrsbit.c b/freetype/src/pfr/pfrsbit.c
index 255fd587..8b23fa15 100644
--- a/freetype/src/pfr/pfrsbit.c
+++ b/freetype/src/pfr/pfrsbit.c
@@ -4,7 +4,7 @@
*
* FreeType PFR bitmap loader (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrsbit.h b/freetype/src/pfr/pfrsbit.h
index f50d8013..b948a384 100644
--- a/freetype/src/pfr/pfrsbit.h
+++ b/freetype/src/pfr/pfrsbit.h
@@ -4,7 +4,7 @@
*
* FreeType PFR bitmap loader (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/pfrtypes.h b/freetype/src/pfr/pfrtypes.h
index dc4fead7..d9a0c789 100644
--- a/freetype/src/pfr/pfrtypes.h
+++ b/freetype/src/pfr/pfrtypes.h
@@ -4,7 +4,7 @@
*
* FreeType PFR data structures (specification only).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pfr/rules.mk b/freetype/src/pfr/rules.mk
index 00c791f1..b5dffaaa 100644
--- a/freetype/src/pfr/rules.mk
+++ b/freetype/src/pfr/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2002-2021 by
+# Copyright (C) 2002-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/psaux/afmparse.c b/freetype/src/psaux/afmparse.c
index 0ad17605..bd86129f 100644
--- a/freetype/src/psaux/afmparse.c
+++ b/freetype/src/psaux/afmparse.c
@@ -4,7 +4,7 @@
*
* AFM parser (body).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/afmparse.h b/freetype/src/psaux/afmparse.h
index 44b05b2c..eee49e36 100644
--- a/freetype/src/psaux/afmparse.h
+++ b/freetype/src/psaux/afmparse.h
@@ -4,7 +4,7 @@
*
* AFM parser (specification).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/cffdecode.c b/freetype/src/psaux/cffdecode.c
index 29b68a8e..92139c93 100644
--- a/freetype/src/psaux/cffdecode.c
+++ b/freetype/src/psaux/cffdecode.c
@@ -4,7 +4,7 @@
*
* PostScript CFF (Type 2) decoding routines (body).
*
- * Copyright (C) 2017-2021 by
+ * Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -248,7 +248,7 @@
else
#endif /* FT_CONFIG_OPTION_INCREMENTAL */
{
- CFF_Font cff = (CFF_Font)(face->extra.data);
+ CFF_Font cff = (CFF_Font)( face->extra.data );
bchar_index = cff_lookup_glyph_by_stdcharcode( cff, bchar );
diff --git a/freetype/src/psaux/cffdecode.h b/freetype/src/psaux/cffdecode.h
index b1314ed1..a9f67618 100644
--- a/freetype/src/psaux/cffdecode.h
+++ b/freetype/src/psaux/cffdecode.h
@@ -4,7 +4,7 @@
*
* PostScript CFF (Type 2) decoding routines (specification).
*
- * Copyright (C) 2017-2021 by
+ * Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/module.mk b/freetype/src/psaux/module.mk
index 06f7e72c..e52e9879 100644
--- a/freetype/src/psaux/module.mk
+++ b/freetype/src/psaux/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/psaux/psaux.c b/freetype/src/psaux/psaux.c
index 2960c8b6..2ac79494 100644
--- a/freetype/src/psaux/psaux.c
+++ b/freetype/src/psaux/psaux.c
@@ -4,7 +4,7 @@
*
* FreeType auxiliary PostScript driver component (body only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/psauxerr.h b/freetype/src/psaux/psauxerr.h
index e8ee2916..1504b34e 100644
--- a/freetype/src/psaux/psauxerr.h
+++ b/freetype/src/psaux/psauxerr.h
@@ -4,7 +4,7 @@
*
* PS auxiliary module error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/psauxmod.c b/freetype/src/psaux/psauxmod.c
index 52da2336..113490ab 100644
--- a/freetype/src/psaux/psauxmod.c
+++ b/freetype/src/psaux/psauxmod.c
@@ -4,7 +4,7 @@
*
* FreeType auxiliary PostScript module implementation (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/psauxmod.h b/freetype/src/psaux/psauxmod.h
index e3e80632..2d508edc 100644
--- a/freetype/src/psaux/psauxmod.h
+++ b/freetype/src/psaux/psauxmod.h
@@ -4,7 +4,7 @@
*
* FreeType auxiliary PostScript module implementation (specification).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/psconv.c b/freetype/src/psaux/psconv.c
index c28d65df..9b8c0d90 100644
--- a/freetype/src/psaux/psconv.c
+++ b/freetype/src/psaux/psconv.c
@@ -4,7 +4,7 @@
*
* Some convenience conversions (body).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -535,11 +535,11 @@
if ( r & 1 )
{
- *buffer = (FT_Byte)(*buffer + c);
+ *buffer = (FT_Byte)( *buffer + c );
buffer++;
}
else
- *buffer = (FT_Byte)(c << 4);
+ *buffer = (FT_Byte)( c << 4 );
r++;
}
@@ -572,8 +572,8 @@
if ( p >= limit )
return 0;
- if ( n > (FT_UInt)(limit - p) )
- n = (FT_UInt)(limit - p);
+ if ( n > (FT_UInt)( limit - p ) )
+ n = (FT_UInt)( limit - p );
for ( r = 0; r < n; r++ )
{
diff --git a/freetype/src/psaux/psconv.h b/freetype/src/psaux/psconv.h
index cd91a7bb..650d7c93 100644
--- a/freetype/src/psaux/psconv.h
+++ b/freetype/src/psaux/psconv.h
@@ -4,7 +4,7 @@
*
* Some convenience conversions (specification).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/psintrp.c b/freetype/src/psaux/psintrp.c
index c550533a..6c640eeb 100644
--- a/freetype/src/psaux/psintrp.c
+++ b/freetype/src/psaux/psintrp.c
@@ -1900,7 +1900,8 @@
/* WeightVector */
{
FT_UInt idx;
- PS_Blend blend = decoder->blend;
+ PS_Blend blend = decoder->blend;
+ FT_UInt len_buildchar = decoder->len_buildchar;
if ( arg_cnt != 1 || !blend )
@@ -1908,14 +1909,15 @@
idx = (FT_UInt)cf2_stack_popInt( opStack );
- if ( idx + blend->num_designs >
- decoder->len_buildchar )
+ if ( len_buildchar < blend->num_designs ||
+ len_buildchar - blend->num_designs < idx )
goto Unexpected_OtherSubr;
- ft_memcpy( &decoder->buildchar[idx],
- blend->weight_vector,
- blend->num_designs *
- sizeof ( blend->weight_vector[0] ) );
+ if ( decoder->buildchar && blend->weight_vector )
+ ft_memcpy( &decoder->buildchar[idx],
+ blend->weight_vector,
+ blend->num_designs *
+ sizeof ( blend->weight_vector[0] ) );
}
break;
diff --git a/freetype/src/psaux/psobjs.c b/freetype/src/psaux/psobjs.c
index 30f50191..371e5380 100644
--- a/freetype/src/psaux/psobjs.c
+++ b/freetype/src/psaux/psobjs.c
@@ -4,7 +4,7 @@
*
* Auxiliary functions for PostScript fonts (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -99,45 +99,31 @@
}
- static void
- shift_elements( PS_Table table,
- FT_Byte* old_base )
- {
- FT_PtrDist delta = table->block - old_base;
- FT_Byte** offset = table->elements;
- FT_Byte** limit = offset + table->max_elems;
-
-
- for ( ; offset < limit; offset++ )
- {
- if ( offset[0] )
- offset[0] += delta;
- }
- }
-
-
static FT_Error
- reallocate_t1_table( PS_Table table,
- FT_Offset new_size )
+ ps_table_realloc( PS_Table table,
+ FT_Offset new_size )
{
FT_Memory memory = table->memory;
FT_Byte* old_base = table->block;
FT_Error error;
- /* allocate new base block */
- if ( FT_ALLOC( table->block, new_size ) )
- {
- table->block = old_base;
+ /* (re)allocate the base block */
+ if ( FT_REALLOC( table->block, table->capacity, new_size ) )
return error;
- }
- /* copy elements and shift offsets */
- if ( old_base )
+ /* rebase offsets if necessary */
+ if ( old_base && table->block != old_base )
{
- FT_MEM_COPY( table->block, old_base, table->capacity );
- shift_elements( table, old_base );
- FT_FREE( old_base );
+ FT_Byte** offset = table->elements;
+ FT_Byte** limit = offset + table->max_elems;
+
+
+ for ( ; offset < limit; offset++ )
+ {
+ if ( *offset )
+ *offset = table->block + ( *offset - old_base );
+ }
}
table->capacity = new_size;
@@ -204,7 +190,7 @@
new_size = FT_PAD_CEIL( new_size, 1024 );
}
- error = reallocate_t1_table( table, new_size );
+ error = ps_table_realloc( table, new_size );
if ( error )
return error;
@@ -234,32 +220,12 @@
* @InOut:
* table ::
* The target table.
- *
- * @Note:
- * This function does NOT release the heap's memory block. It is up
- * to the caller to clean it, or reference it in its own structures.
*/
FT_LOCAL_DEF( void )
ps_table_done( PS_Table table )
{
- FT_Memory memory = table->memory;
- FT_Error error;
- FT_Byte* old_base = table->block;
-
-
- /* should never fail, because rec.cursor <= rec.size */
- if ( !old_base )
- return;
-
- if ( FT_QALLOC( table->block, table->cursor ) )
- return;
- FT_MEM_COPY( table->block, old_base, table->cursor );
- shift_elements( table, old_base );
-
- table->capacity = table->cursor;
- FT_FREE( old_base );
-
- FT_UNUSED( error );
+ /* no problem if shrinking fails */
+ ps_table_realloc( table, table->cursor );
}
@@ -552,7 +518,7 @@
if ( *cur == '<' ) /* <...> */
{
- if ( cur + 1 < limit && *(cur + 1) == '<' ) /* << */
+ if ( cur + 1 < limit && *( cur + 1 ) == '<' ) /* << */
{
cur++;
cur++;
@@ -1098,7 +1064,6 @@
{
FT_Byte* q = (FT_Byte*)objects[idx] + field->offset;
FT_Long val;
- FT_String* string = NULL;
skip_spaces( &cur, limit );
@@ -1148,8 +1113,9 @@
case T1_FIELD_TYPE_STRING:
case T1_FIELD_TYPE_KEY:
{
- FT_Memory memory = parser->memory;
- FT_UInt len = (FT_UInt)( limit - cur );
+ FT_Memory memory = parser->memory;
+ FT_UInt len = (FT_UInt)( limit - cur );
+ FT_String* string = NULL;
if ( cur >= limit )
@@ -1190,7 +1156,6 @@
FT_TRACE0(( "ps_parser_load_field: overwriting field %s\n",
field->ident ));
FT_FREE( *(FT_String**)q );
- *(FT_String**)q = NULL;
}
if ( FT_QALLOC( string, len + 1 ) )
diff --git a/freetype/src/psaux/psobjs.h b/freetype/src/psaux/psobjs.h
index 99d16959..f01d4bd5 100644
--- a/freetype/src/psaux/psobjs.h
+++ b/freetype/src/psaux/psobjs.h
@@ -4,7 +4,7 @@
*
* Auxiliary functions for PostScript fonts (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/rules.mk b/freetype/src/psaux/rules.mk
index 05439120..d20ff3e6 100644
--- a/freetype/src/psaux/rules.mk
+++ b/freetype/src/psaux/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/psaux/t1cmap.c b/freetype/src/psaux/t1cmap.c
index 3e7c577a..f297ce75 100644
--- a/freetype/src/psaux/t1cmap.c
+++ b/freetype/src/psaux/t1cmap.c
@@ -4,7 +4,7 @@
*
* Type 1 character map support (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/t1cmap.h b/freetype/src/psaux/t1cmap.h
index 8f69600c..460d91f5 100644
--- a/freetype/src/psaux/t1cmap.h
+++ b/freetype/src/psaux/t1cmap.h
@@ -4,7 +4,7 @@
*
* Type 1 character map support (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/t1decode.c b/freetype/src/psaux/t1decode.c
index 7e65bde6..1cdf436f 100644
--- a/freetype/src/psaux/t1decode.c
+++ b/freetype/src/psaux/t1decode.c
@@ -4,7 +4,7 @@
*
* PostScript Type 1 decoding routines (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psaux/t1decode.h b/freetype/src/psaux/t1decode.h
index eea9d34b..d60d61c9 100644
--- a/freetype/src/psaux/t1decode.h
+++ b/freetype/src/psaux/t1decode.h
@@ -4,7 +4,7 @@
*
* PostScript Type 1 decoding routines (specification).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pshinter/module.mk b/freetype/src/pshinter/module.mk
index ca181ee6..bdb05c10 100644
--- a/freetype/src/pshinter/module.mk
+++ b/freetype/src/pshinter/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/pshinter/pshalgo.c b/freetype/src/pshinter/pshalgo.c
index 227caeae..dca53976 100644
--- a/freetype/src/pshinter/pshalgo.c
+++ b/freetype/src/pshinter/pshalgo.c
@@ -4,7 +4,7 @@
*
* PostScript hinting algorithm (body).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
@@ -182,13 +182,13 @@
count = hints->num_hints;
/* allocate our tables */
- if ( FT_NEW_ARRAY( table->sort, 2 * count ) ||
- FT_NEW_ARRAY( table->hints, count ) ||
- FT_NEW_ARRAY( table->zones, 2 * count + 1 ) )
+ if ( FT_QNEW_ARRAY( table->sort, 2 * count ) ||
+ FT_QNEW_ARRAY( table->hints, count ) ||
+ FT_QNEW_ARRAY( table->zones, 2 * count + 1 ) )
goto Exit;
table->max_hints = count;
- table->sort_global = table->sort + count;
+ table->sort_global = FT_OFFSET( table->sort, count );
table->num_hints = 0;
table->num_zones = 0;
table->zone = NULL;
@@ -1167,8 +1167,8 @@
memory = glyph->memory = globals->memory;
/* allocate and setup points + contours arrays */
- if ( FT_NEW_ARRAY( glyph->points, outline->n_points ) ||
- FT_NEW_ARRAY( glyph->contours, outline->n_contours ) )
+ if ( FT_QNEW_ARRAY( glyph->points, outline->n_points ) ||
+ FT_QNEW_ARRAY( glyph->contours, outline->n_contours ) )
goto Exit;
glyph->num_points = (FT_UInt)outline->n_points;
@@ -1228,8 +1228,9 @@
FT_Pos dxi, dyi, dxo, dyo;
+ point->flags = 0;
if ( !( outline->tags[n] & FT_CURVE_TAG_ON ) )
- point->flags = PSH_POINT_OFF;
+ psh_point_set_off( point );
dxi = vec[n].x - vec[n_prev].x;
dyi = vec[n].y - vec[n_prev].y;
@@ -1242,14 +1243,14 @@
point->dir_out = psh_compute_dir( dxo, dyo );
/* detect smooth points */
- if ( point->flags & PSH_POINT_OFF )
- point->flags |= PSH_POINT_SMOOTH;
+ if ( psh_point_is_off( point ) )
+ psh_point_set_smooth( point );
else if ( point->dir_in == point->dir_out )
{
if ( point->dir_out != PSH_DIR_NONE ||
psh_corner_is_flat( dxi, dyi, dxo, dyo ) )
- point->flags |= PSH_POINT_SMOOTH;
+ psh_point_set_smooth( point );
}
}
}
@@ -1547,8 +1548,9 @@
/* the accepted shift for strong points in fractional pixels */
#define PSH_STRONG_THRESHOLD 32
- /* the maximum shift value in font units */
-#define PSH_STRONG_THRESHOLD_MAXIMUM 30
+ /* the maximum shift value in font units tuned to distinguish */
+ /* between stems and serifs in URW+ font collection */
+#define PSH_STRONG_THRESHOLD_MAXIMUM 12
/* find strong points in a glyph */
@@ -1797,7 +1799,7 @@
FT_Error error;
- if ( FT_NEW_ARRAY( strongs, num_strongs ) )
+ if ( FT_QNEW_ARRAY( strongs, num_strongs ) )
return;
}
@@ -2110,14 +2112,17 @@
FT_Fixed old_x_scale = x_scale;
FT_Fixed old_y_scale = y_scale;
- FT_Fixed scaled;
- FT_Fixed fitted;
+ FT_Fixed scaled = 0;
+ FT_Fixed fitted = 0;
FT_Bool rescale = FALSE;
- scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale );
- fitted = FT_PIX_ROUND( scaled );
+ if ( globals->blues.normal_top.count )
+ {
+ scaled = FT_MulFix( globals->blues.normal_top.zones->org_ref, y_scale );
+ fitted = FT_PIX_ROUND( scaled );
+ }
if ( fitted != 0 && scaled != fitted )
{
diff --git a/freetype/src/pshinter/pshalgo.h b/freetype/src/pshinter/pshalgo.h
index 999c6019..ab978bf6 100644
--- a/freetype/src/pshinter/pshalgo.h
+++ b/freetype/src/pshinter/pshalgo.h
@@ -4,7 +4,7 @@
*
* PostScript hinting algorithm (specification).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pshinter/pshglob.c b/freetype/src/pshinter/pshglob.c
index 2ca0f665..887ea8d9 100644
--- a/freetype/src/pshinter/pshglob.c
+++ b/freetype/src/pshinter/pshglob.c
@@ -5,7 +5,7 @@
* PostScript hinter global hinting management (body).
* Inspired by the new auto-hinter module.
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
@@ -650,7 +650,7 @@
FT_Error error;
- if ( !FT_NEW( globals ) )
+ if ( !FT_QNEW( globals ) )
{
FT_UInt count;
FT_Short* read;
diff --git a/freetype/src/pshinter/pshglob.h b/freetype/src/pshinter/pshglob.h
index a8f9953f..47247f96 100644
--- a/freetype/src/pshinter/pshglob.h
+++ b/freetype/src/pshinter/pshglob.h
@@ -4,7 +4,7 @@
*
* PostScript hinter global hinting management.
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pshinter/pshinter.c b/freetype/src/pshinter/pshinter.c
index 705143dc..22315685 100644
--- a/freetype/src/pshinter/pshinter.c
+++ b/freetype/src/pshinter/pshinter.c
@@ -4,7 +4,7 @@
*
* FreeType PostScript Hinting module
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pshinter/pshmod.c b/freetype/src/pshinter/pshmod.c
index 6674041f..a74a4fe9 100644
--- a/freetype/src/pshinter/pshmod.c
+++ b/freetype/src/pshinter/pshmod.c
@@ -4,7 +4,7 @@
*
* FreeType PostScript hinter module implementation (body).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pshinter/pshmod.h b/freetype/src/pshinter/pshmod.h
index 8b229bb0..cdf95b7c 100644
--- a/freetype/src/pshinter/pshmod.h
+++ b/freetype/src/pshinter/pshmod.h
@@ -4,7 +4,7 @@
*
* PostScript hinter module interface (specification).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pshinter/pshnterr.h b/freetype/src/pshinter/pshnterr.h
index 567d7651..789afb59 100644
--- a/freetype/src/pshinter/pshnterr.h
+++ b/freetype/src/pshinter/pshnterr.h
@@ -4,7 +4,7 @@
*
* PS Hinter error codes (specification only).
*
- * Copyright (C) 2003-2021 by
+ * Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pshinter/pshrec.c b/freetype/src/pshinter/pshrec.c
index 1faabdaa..2a5cffba 100644
--- a/freetype/src/pshinter/pshrec.c
+++ b/freetype/src/pshinter/pshrec.c
@@ -4,7 +4,7 @@
*
* FreeType PostScript hints recorder (body).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -63,16 +63,14 @@
{
FT_UInt old_max = table->max_hints;
FT_UInt new_max = count;
- FT_Error error = FT_Err_Ok;
+ FT_Error error;
- if ( new_max > old_max )
- {
- /* try to grow the table */
- new_max = FT_PAD_CEIL( new_max, 8 );
- if ( !FT_RENEW_ARRAY( table->hints, old_max, new_max ) )
- table->max_hints = new_max;
- }
+ /* try to grow the table */
+ new_max = FT_PAD_CEIL( new_max, 8 );
+ if ( !FT_QRENEW_ARRAY( table->hints, old_max, new_max ) )
+ table->max_hints = new_max;
+
return error;
}
@@ -90,17 +88,14 @@
count = table->num_hints;
count++;
- if ( count >= table->max_hints )
+ if ( count > table->max_hints )
{
error = ps_hint_table_ensure( table, count, memory );
if ( error )
goto Exit;
}
- hint = table->hints + count - 1;
- hint->pos = 0;
- hint->len = 0;
- hint->flags = 0;
+ hint = table->hints + count - 1; /* initialized upstream */
table->num_hints = count;
@@ -136,14 +131,15 @@
FT_UInt count,
FT_Memory memory )
{
- FT_UInt old_max = ( mask->max_bits + 7 ) >> 3;
- FT_UInt new_max = ( count + 7 ) >> 3;
+ FT_UInt old_max = mask->max_bits >> 3;
+ FT_UInt new_max = ( count + 7 ) >> 3;
FT_Error error = FT_Err_Ok;
if ( new_max > old_max )
{
new_max = FT_PAD_CEIL( new_max, 8 );
+ /* added bytes are zeroed here */
if ( !FT_RENEW_ARRAY( mask->bytes, old_max, new_max ) )
mask->max_bits = new_max * 8;
}
@@ -154,31 +150,15 @@
/* test a bit value in a given mask */
static FT_Int
ps_mask_test_bit( PS_Mask mask,
- FT_Int idx )
+ FT_UInt idx )
{
- if ( (FT_UInt)idx >= mask->num_bits )
+ if ( idx >= mask->num_bits )
return 0;
return mask->bytes[idx >> 3] & ( 0x80 >> ( idx & 7 ) );
}
- /* clear a given bit */
- static void
- ps_mask_clear_bit( PS_Mask mask,
- FT_UInt idx )
- {
- FT_Byte* p;
-
-
- if ( idx >= mask->num_bits )
- return;
-
- p = mask->bytes + ( idx >> 3 );
- p[0] = (FT_Byte)( p[0] & ~( 0x80 >> ( idx & 7 ) ) );
- }
-
-
/* set a given bit, possibly grow the mask */
static FT_Error
ps_mask_set_bit( PS_Mask mask,
@@ -269,6 +249,10 @@
mask = table->masks + count - 1;
mask->num_bits = 0;
mask->end_point = 0;
+ /* reused mask must be cleared */
+ if ( mask->max_bits )
+ FT_MEM_ZERO( mask->bytes, mask->max_bits >> 3 );
+
table->num_masks = count;
Exit:
@@ -426,7 +410,7 @@
PS_Mask mask2 = table->masks + index2;
FT_UInt count1 = mask1->num_bits;
FT_UInt count2 = mask2->num_bits;
- FT_Int delta;
+ FT_UInt delta;
if ( count2 > 0 )
@@ -437,15 +421,14 @@
/* if "count2" is greater than "count1", we need to grow the */
- /* first bitset, and clear the highest bits */
+ /* first bitset */
if ( count2 > count1 )
{
error = ps_mask_ensure( mask1, count2, memory );
if ( error )
goto Exit;
- for ( pos = count1; pos < count2; pos++ )
- ps_mask_clear_bit( mask1, pos );
+ mask1->num_bits = count2;
}
/* merge (unite) the bitsets */
@@ -467,7 +450,7 @@
mask2->end_point = 0;
/* number of masks to move */
- delta = (FT_Int)( table->num_masks - 1 - index2 );
+ delta = table->num_masks - 1 - index2;
if ( delta > 0 )
{
/* move to end of table for reuse */
@@ -476,7 +459,7 @@
ft_memmove( mask2,
mask2 + 1,
- (FT_UInt)delta * sizeof ( PS_MaskRec ) );
+ delta * sizeof ( PS_MaskRec ) );
mask2[delta] = dummy;
}
@@ -647,7 +630,7 @@
FT_Int pos,
FT_Int len,
FT_Memory memory,
- FT_Int *aindex )
+ FT_UInt *aindex )
{
FT_Error error = FT_Err_Ok;
FT_UInt flags = 0;
@@ -665,9 +648,6 @@
len = 0;
}
- if ( aindex )
- *aindex = -1;
-
/* now, lookup stem in the current hints table */
{
PS_Mask mask;
@@ -704,7 +684,7 @@
goto Exit;
if ( aindex )
- *aindex = (FT_Int)idx;
+ *aindex = idx;
}
Exit:
@@ -715,9 +695,9 @@
/* add a "hstem3/vstem3" counter to our dimension table */
static FT_Error
ps_dimension_add_counter( PS_Dimension dim,
- FT_Int hint1,
- FT_Int hint2,
- FT_Int hint3,
+ FT_UInt hint1,
+ FT_UInt hint2,
+ FT_UInt hint3,
FT_Memory memory )
{
FT_Error error = FT_Err_Ok;
@@ -744,26 +724,17 @@
}
/* now, set the bits for our hints in the counter mask */
- if ( hint1 >= 0 )
- {
- error = ps_mask_set_bit( counter, (FT_UInt)hint1, memory );
- if ( error )
- goto Exit;
- }
+ error = ps_mask_set_bit( counter, hint1, memory );
+ if ( error )
+ goto Exit;
- if ( hint2 >= 0 )
- {
- error = ps_mask_set_bit( counter, (FT_UInt)hint2, memory );
- if ( error )
- goto Exit;
- }
+ error = ps_mask_set_bit( counter, hint2, memory );
+ if ( error )
+ goto Exit;
- if ( hint3 >= 0 )
- {
- error = ps_mask_set_bit( counter, (FT_UInt)hint3, memory );
- if ( error )
- goto Exit;
- }
+ error = ps_mask_set_bit( counter, hint3, memory );
+ if ( error )
+ goto Exit;
Exit:
return error;
@@ -892,7 +863,7 @@
PS_Dimension dim;
FT_Memory memory = hints->memory;
FT_Int count;
- FT_Int idx[3];
+ FT_UInt idx[3];
/* limit "dimension" to 0..1 */
diff --git a/freetype/src/pshinter/pshrec.h b/freetype/src/pshinter/pshrec.h
index e483981d..a0d37979 100644
--- a/freetype/src/pshinter/pshrec.h
+++ b/freetype/src/pshinter/pshrec.h
@@ -4,7 +4,7 @@
*
* Postscript (Type1/Type2) hints recorder (specification).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/pshinter/rules.mk b/freetype/src/pshinter/rules.mk
index 3c5a59a8..ee596804 100644
--- a/freetype/src/pshinter/rules.mk
+++ b/freetype/src/pshinter/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2001-2021 by
+# Copyright (C) 2001-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/psnames/module.mk b/freetype/src/psnames/module.mk
index abfb54ff..4bd2ee62 100644
--- a/freetype/src/psnames/module.mk
+++ b/freetype/src/psnames/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/psnames/psmodule.c b/freetype/src/psnames/psmodule.c
index 74adefa1..e7d51e95 100644
--- a/freetype/src/psnames/psmodule.c
+++ b/freetype/src/psnames/psmodule.c
@@ -4,7 +4,7 @@
*
* psnames module implementation (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psnames/psmodule.h b/freetype/src/psnames/psmodule.h
index e92a975e..ff3eda56 100644
--- a/freetype/src/psnames/psmodule.h
+++ b/freetype/src/psnames/psmodule.h
@@ -4,7 +4,7 @@
*
* High-level psnames module interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psnames/psnamerr.h b/freetype/src/psnames/psnamerr.h
index 888b76c4..ae566202 100644
--- a/freetype/src/psnames/psnamerr.h
+++ b/freetype/src/psnames/psnamerr.h
@@ -4,7 +4,7 @@
*
* PS names module error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psnames/psnames.c b/freetype/src/psnames/psnames.c
index e7be6707..c844a317 100644
--- a/freetype/src/psnames/psnames.c
+++ b/freetype/src/psnames/psnames.c
@@ -4,7 +4,7 @@
*
* FreeType psnames module component (body only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psnames/pstables.h b/freetype/src/psnames/pstables.h
index 0bcadca9..d28d580b 100644
--- a/freetype/src/psnames/pstables.h
+++ b/freetype/src/psnames/pstables.h
@@ -4,7 +4,7 @@
*
* PostScript glyph names.
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/psnames/rules.mk b/freetype/src/psnames/rules.mk
index 6694f4eb..3768e2f1 100644
--- a/freetype/src/psnames/rules.mk
+++ b/freetype/src/psnames/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/raster/ftmisc.h b/freetype/src/raster/ftmisc.h
index b12a0512..75fb5f84 100644
--- a/freetype/src/raster/ftmisc.h
+++ b/freetype/src/raster/ftmisc.h
@@ -5,7 +5,7 @@
* Miscellaneous macros for stand-alone rasterizer (specification
* only).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
diff --git a/freetype/src/raster/ftraster.c b/freetype/src/raster/ftraster.c
index bfc059c1..68b0e1fd 100644
--- a/freetype/src/raster/ftraster.c
+++ b/freetype/src/raster/ftraster.c
@@ -4,7 +4,7 @@
*
* The FreeType glyph rasterizer (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -2269,7 +2269,7 @@
/* This is due to the fact that, in the vast majority of cases, */
/* the span length in bytes is relatively small. */
while ( --c2 > 0 )
- *(++target) = 0xFF;
+ *( ++target ) = 0xFF;
target[1] |= f2;
}
diff --git a/freetype/src/raster/ftraster.h b/freetype/src/raster/ftraster.h
index 4affd48b..e9ece8cf 100644
--- a/freetype/src/raster/ftraster.h
+++ b/freetype/src/raster/ftraster.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph rasterizer (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used
diff --git a/freetype/src/raster/ftrend1.c b/freetype/src/raster/ftrend1.c
index 236a8daf..f319f03d 100644
--- a/freetype/src/raster/ftrend1.c
+++ b/freetype/src/raster/ftrend1.c
@@ -4,7 +4,7 @@
*
* The FreeType glyph rasterizer interface (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/raster/ftrend1.h b/freetype/src/raster/ftrend1.h
index e4cea537..14ec336b 100644
--- a/freetype/src/raster/ftrend1.h
+++ b/freetype/src/raster/ftrend1.h
@@ -4,7 +4,7 @@
*
* The FreeType glyph rasterizer interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/raster/module.mk b/freetype/src/raster/module.mk
index fbc1d64e..b56a4902 100644
--- a/freetype/src/raster/module.mk
+++ b/freetype/src/raster/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/raster/raster.c b/freetype/src/raster/raster.c
index ad81a394..324cc566 100644
--- a/freetype/src/raster/raster.c
+++ b/freetype/src/raster/raster.c
@@ -4,7 +4,7 @@
*
* FreeType monochrome rasterer module component (body only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/raster/rasterrs.h b/freetype/src/raster/rasterrs.h
index 852dd5bc..8b1ebf07 100644
--- a/freetype/src/raster/rasterrs.h
+++ b/freetype/src/raster/rasterrs.h
@@ -4,7 +4,7 @@
*
* monochrome renderer error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/raster/rules.mk b/freetype/src/raster/rules.mk
index 7ffda772..0cf3b4bf 100644
--- a/freetype/src/raster/rules.mk
+++ b/freetype/src/raster/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/sdf/ftbsdf.c b/freetype/src/sdf/ftbsdf.c
index 8da5c9d9..1328ac49 100644
--- a/freetype/src/sdf/ftbsdf.c
+++ b/freetype/src/sdf/ftbsdf.c
@@ -4,7 +4,7 @@
*
* Signed Distance Field support for bitmap fonts (body only).
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by Anuj Verma.
@@ -177,11 +177,11 @@
*
* @Fields:
* dist ::
- * Vector length of the `near` parameter. Can be squared or absolute
+ * Vector length of the `prox` parameter. Can be squared or absolute
* depending on the `USE_SQUARED_DISTANCES` macro defined in file
* `ftsdfcommon.h`.
*
- * near ::
+ * prox ::
* Vector to the nearest edge. Can also be interpreted as shortest
* distance of a point.
*
@@ -194,7 +194,7 @@
typedef struct ED_
{
FT_16D16 dist;
- FT_16D16_Vec near;
+ FT_16D16_Vec prox;
FT_Byte alpha;
} ED;
@@ -595,18 +595,18 @@
worker->rows ) )
{
/* approximate the edge distance for edge pixels */
- ed[index].near = compute_edge_distance( ed + index,
+ ed[index].prox = compute_edge_distance( ed + index,
i, j,
worker->width,
worker->rows );
- ed[index].dist = VECTOR_LENGTH_16D16( ed[index].near );
+ ed[index].dist = VECTOR_LENGTH_16D16( ed[index].prox );
}
else
{
/* for non-edge pixels assign far away distances */
ed[index].dist = 400 * ONE;
- ed[index].near.x = 200 * ONE;
- ed[index].near.y = 200 * ONE;
+ ed[index].prox.x = 200 * ONE;
+ ed[index].prox.y = 200 * ONE;
}
}
}
@@ -756,8 +756,6 @@
byte = (FT_Byte)( 1 << mod );
t[t_index].alpha = pixel & byte ? 255 : 0;
-
- pixel = 0;
}
}
}
@@ -873,7 +871,7 @@
if ( dist < current->dist )
{
- dist_vec = to_check->near;
+ dist_vec = to_check->prox;
dist_vec.x += x_offset * ONE;
dist_vec.y += y_offset * ONE;
@@ -882,7 +880,7 @@
if ( dist < current->dist )
{
current->dist = dist;
- current->near = dist_vec;
+ current->prox = dist_vec;
}
}
}
@@ -1098,7 +1096,7 @@
FT_Int i, j;
FT_SDFFormat* t_buffer;
- FT_16D16 spread;
+ FT_16D16 sp_sq, spread;
if ( !worker || !target )
@@ -1118,11 +1116,13 @@
goto Exit;
}
+ spread = FT_INT_16D16( worker->params.spread );
+
#if USE_SQUARED_DISTANCES
- spread = FT_INT_16D16( worker->params.spread *
- worker->params.spread );
+ sp_sq = FT_INT_16D16( worker->params.spread *
+ worker->params.spread );
#else
- spread = FT_INT_16D16( worker->params.spread );
+ sp_sq = FT_INT_16D16( worker->params.spread );
#endif
for ( j = 0; j < r; j++ )
@@ -1138,8 +1138,8 @@
index = j * w + i;
dist = worker->distance_map[index].dist;
- if ( dist < 0 || dist > spread )
- dist = spread;
+ if ( dist < 0 || dist > sp_sq )
+ dist = sp_sq;
#if USE_SQUARED_DISTANCES
dist = square_root( dist );
diff --git a/freetype/src/sdf/ftsdf.c b/freetype/src/sdf/ftsdf.c
index f69cf49b..ffac8bf4 100644
--- a/freetype/src/sdf/ftsdf.c
+++ b/freetype/src/sdf/ftsdf.c
@@ -4,7 +4,7 @@
*
* Signed Distance Field support for outline fonts (body).
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by Anuj Verma.
@@ -497,7 +497,7 @@
goto Exit;
}
- if ( !FT_QALLOC( ptr, sizeof ( *ptr ) ) )
+ if ( !FT_QNEW( ptr ) )
{
*ptr = null_edge;
*edge = ptr;
@@ -536,7 +536,7 @@
goto Exit;
}
- if ( !FT_QALLOC( ptr, sizeof ( *ptr ) ) )
+ if ( !FT_QNEW( ptr ) )
{
*ptr = null_contour;
*contour = ptr;
@@ -591,7 +591,7 @@
goto Exit;
}
- if ( !FT_QALLOC( ptr, sizeof ( *ptr ) ) )
+ if ( !FT_QNEW( ptr ) )
{
*ptr = null_shape;
ptr->memory = memory;
@@ -738,6 +738,18 @@
contour = shape->contours;
+ /* If the control point coincides with any of the end points */
+ /* then it is a line and should be treated as one to avoid */
+ /* unnecessary complexity later in the algorithm. */
+ if ( ( contour->last_pos.x == control_1->x &&
+ contour->last_pos.y == control_1->y ) ||
+ ( control_1->x == to->x &&
+ control_1->y == to->y ) )
+ {
+ sdf_line_to( to, user );
+ goto Exit;
+ }
+
FT_CALL( sdf_edge_new( memory, &edge ) );
edge->edge_type = SDF_EDGE_CONIC;
@@ -764,9 +776,9 @@
const FT_26D6_Vec* to,
void* user )
{
- SDF_Shape* shape = ( SDF_Shape* )user;
- SDF_Edge* edge = NULL;
- SDF_Contour* contour = NULL;
+ SDF_Shape* shape = ( SDF_Shape* )user;
+ SDF_Edge* edge = NULL;
+ SDF_Contour* contour = NULL;
FT_Error error = FT_Err_Ok;
FT_Memory memory = shape->memory;
@@ -1065,7 +1077,7 @@
static FT_Error
split_sdf_conic( FT_Memory memory,
FT_26D6_Vec* control_points,
- FT_Int max_splits,
+ FT_UInt max_splits,
SDF_Edge** out )
{
FT_Error error = FT_Err_Ok;
@@ -1134,26 +1146,41 @@
static FT_Error
split_sdf_cubic( FT_Memory memory,
FT_26D6_Vec* control_points,
- FT_Int max_splits,
+ FT_UInt max_splits,
SDF_Edge** out )
{
- FT_Error error = FT_Err_Ok;
- FT_26D6_Vec cpos[7];
- SDF_Edge* left,* right;
+ FT_Error error = FT_Err_Ok;
+ FT_26D6_Vec cpos[7];
+ SDF_Edge* left, *right;
+ const FT_26D6 threshold = ONE_PIXEL / 4;
- if ( !memory || !out )
+ if ( !memory || !out )
{
error = FT_THROW( Invalid_Argument );
goto Exit;
}
- /* split the conic */
+ /* split the cubic */
cpos[0] = control_points[0];
cpos[1] = control_points[1];
cpos[2] = control_points[2];
cpos[3] = control_points[3];
+ /* If the segment is flat enough we won't get any benefit by */
+ /* splitting it further, so we can just stop splitting. */
+ /* */
+ /* Check the deviation of the Bezier curve and stop if it is */
+ /* smaller than the pre-defined `threshold` value. */
+ if ( FT_ABS( 2 * cpos[0].x - 3 * cpos[1].x + cpos[3].x ) < threshold &&
+ FT_ABS( 2 * cpos[0].y - 3 * cpos[1].y + cpos[3].y ) < threshold &&
+ FT_ABS( cpos[0].x - 3 * cpos[2].x + 2 * cpos[3].x ) < threshold &&
+ FT_ABS( cpos[0].y - 3 * cpos[2].y + 2 * cpos[3].y ) < threshold )
+ {
+ split_cubic( cpos );
+ goto Append;
+ }
+
split_cubic( cpos );
/* If max number of splits is done */
@@ -1250,13 +1277,32 @@
/* Subdivide the curve and add it to the list. */
{
FT_26D6_Vec ctrls[3];
+ FT_26D6 dx, dy;
+ FT_UInt num_splits;
ctrls[0] = edge->start_pos;
ctrls[1] = edge->control_a;
ctrls[2] = edge->end_pos;
- error = split_sdf_conic( memory, ctrls, 32, &new_edges );
+ dx = FT_ABS( ctrls[2].x + ctrls[0].x - 2 * ctrls[1].x );
+ dy = FT_ABS( ctrls[2].y + ctrls[0].y - 2 * ctrls[1].y );
+ if ( dx < dy )
+ dx = dy;
+
+ /* Calculate the number of necessary bisections. Each */
+ /* bisection causes a four-fold reduction of the deviation, */
+ /* hence we bisect the Bezier curve until the deviation */
+ /* becomes less than 1/8th of a pixel. For more details */
+ /* check file `ftgrays.c`. */
+ num_splits = 1;
+ while ( dx > ONE_PIXEL / 8 )
+ {
+ dx >>= 2;
+ num_splits <<= 1;
+ }
+
+ error = split_sdf_conic( memory, ctrls, num_splits, &new_edges );
}
break;
@@ -1277,9 +1323,11 @@
default:
error = FT_THROW( Invalid_Argument );
- goto Exit;
}
+ if ( error != FT_Err_Ok )
+ goto Exit;
+
edges = edges->next;
}
@@ -2966,7 +3014,7 @@
diff = current_dist.distance - min_dist.distance;
- if ( FT_ABS(diff ) < CORNER_CHECK_EPSILON )
+ if ( FT_ABS( diff ) < CORNER_CHECK_EPSILON )
min_dist = resolve_corner( min_dist, current_dist );
else if ( diff < 0 )
min_dist = current_dist;
@@ -3240,7 +3288,7 @@
buffer = (FT_SDFFormat*)bitmap->buffer;
if ( USE_SQUARED_DISTANCES )
- sp_sq = fixed_spread * fixed_spread;
+ sp_sq = FT_INT_16D16( (FT_Int)( spread * spread ) );
else
sp_sq = fixed_spread;
@@ -3284,6 +3332,7 @@
FT_26D6_Vec grid_point = zero_vector;
SDF_Signed_Distance dist = max_sdf;
FT_UInt index = 0;
+ FT_16D16 diff = 0;
if ( x < 0 || x >= width )
@@ -3311,7 +3360,7 @@
if ( dist.distance > sp_sq )
continue;
- /* square_root the values and fit in a 6.10 fixed-point */
+ /* take the square root of the distance if required */
if ( USE_SQUARED_DISTANCES )
dist.distance = square_root( dist.distance );
@@ -3323,11 +3372,15 @@
/* check whether the pixel is set or not */
if ( dists[index].sign == 0 )
dists[index] = dist;
- else if ( dists[index].distance > dist.distance )
- dists[index] = dist;
- else if ( FT_ABS( dists[index].distance - dist.distance )
- < CORNER_CHECK_EPSILON )
- dists[index] = resolve_corner( dists[index], dist );
+ else
+ {
+ diff = FT_ABS( dists[index].distance - dist.distance );
+
+ if ( diff <= CORNER_CHECK_EPSILON )
+ dists[index] = resolve_corner( dists[index], dist );
+ else if ( dists[index].distance > dist.distance )
+ dists[index] = dist;
+ }
}
}
diff --git a/freetype/src/sdf/ftsdf.h b/freetype/src/sdf/ftsdf.h
index 187b418a..5f6b3f52 100644
--- a/freetype/src/sdf/ftsdf.h
+++ b/freetype/src/sdf/ftsdf.h
@@ -4,7 +4,7 @@
*
* Signed Distance Field support (specification).
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by Anuj Verma.
diff --git a/freetype/src/sdf/ftsdfcommon.c b/freetype/src/sdf/ftsdfcommon.c
index 91aa521b..072a36ea 100644
--- a/freetype/src/sdf/ftsdfcommon.c
+++ b/freetype/src/sdf/ftsdfcommon.c
@@ -4,7 +4,7 @@
*
* Auxiliary data for Signed Distance Field support (body).
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by Anuj Verma.
diff --git a/freetype/src/sdf/ftsdfcommon.h b/freetype/src/sdf/ftsdfcommon.h
index 44f6bba5..af4490bb 100644
--- a/freetype/src/sdf/ftsdfcommon.h
+++ b/freetype/src/sdf/ftsdfcommon.h
@@ -4,7 +4,7 @@
*
* Auxiliary data for Signed Distance Field support (specification).
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by Anuj Verma.
@@ -48,6 +48,8 @@ FT_BEGIN_HEADER
#define MIN_SPREAD 2
/* maximum spread supported by the renderer */
#define MAX_SPREAD 32
+ /* pixel size in 26.6 */
+#define ONE_PIXEL ( 1 << 6 )
/**************************************************************************
diff --git a/freetype/src/sdf/ftsdferrs.h b/freetype/src/sdf/ftsdferrs.h
index dbb113d5..b2886760 100644
--- a/freetype/src/sdf/ftsdferrs.h
+++ b/freetype/src/sdf/ftsdferrs.h
@@ -4,7 +4,7 @@
*
* Signed Distance Field error codes (specification only).
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by Anuj Verma.
diff --git a/freetype/src/sdf/ftsdfrend.c b/freetype/src/sdf/ftsdfrend.c
index 30f2e62a..b0213a40 100644
--- a/freetype/src/sdf/ftsdfrend.c
+++ b/freetype/src/sdf/ftsdfrend.c
@@ -4,7 +4,7 @@
*
* Signed Distance Field renderer interface (body).
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by Anuj Verma.
@@ -298,15 +298,9 @@
goto Exit;
}
- /* the rows and pitch must be valid after presetting the */
- /* bitmap using outline */
+ /* nothing to render */
if ( !bitmap->rows || !bitmap->pitch )
- {
- FT_ERROR(( "ft_sdf_render: failed to preset bitmap\n" ));
-
- error = FT_THROW( Cannot_Render_Glyph );
- goto Exit;
- }
+ return FT_Err_Ok;
/* the padding will simply be equal to the `spread' */
x_pad = sdf_module->spread;
@@ -525,13 +519,9 @@
goto Exit;
}
+ /* nothing to render */
if ( !bitmap->rows || !bitmap->pitch )
- {
- FT_ERROR(( "ft_bsdf_render: invalid bitmap size\n" ));
-
- error = FT_THROW( Invalid_Argument );
- goto Exit;
- }
+ return FT_Err_Ok;
FT_Bitmap_New( &target );
diff --git a/freetype/src/sdf/ftsdfrend.h b/freetype/src/sdf/ftsdfrend.h
index bc88707e..cdb9c5f0 100644
--- a/freetype/src/sdf/ftsdfrend.h
+++ b/freetype/src/sdf/ftsdfrend.h
@@ -4,7 +4,7 @@
*
* Signed Distance Field renderer interface (specification).
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by Anuj Verma.
diff --git a/freetype/src/sdf/module.mk b/freetype/src/sdf/module.mk
index 6be4b0c6..772bc48b 100644
--- a/freetype/src/sdf/module.mk
+++ b/freetype/src/sdf/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/sdf/rules.mk b/freetype/src/sdf/rules.mk
index 7e7e4fbe..5239d643 100644
--- a/freetype/src/sdf/rules.mk
+++ b/freetype/src/sdf/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2020-2021 by
+# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/sdf/sdf.c b/freetype/src/sdf/sdf.c
index 1bc3fc38..297ba9ab 100644
--- a/freetype/src/sdf/sdf.c
+++ b/freetype/src/sdf/sdf.c
@@ -4,7 +4,7 @@
*
* FreeType Signed Distance Field renderer module component (body only).
*
- * Copyright (C) 2020-2021 by
+ * Copyright (C) 2020-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Written by Anuj Verma.
diff --git a/freetype/src/sfnt/module.mk b/freetype/src/sfnt/module.mk
index eabd48f6..dbdde156 100644
--- a/freetype/src/sfnt/module.mk
+++ b/freetype/src/sfnt/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/sfnt/pngshim.c b/freetype/src/sfnt/pngshim.c
index 02fe3744..0ce4bdb6 100644
--- a/freetype/src/sfnt/pngshim.c
+++ b/freetype/src/sfnt/pngshim.c
@@ -4,7 +4,7 @@
*
* PNG Bitmap glyph support.
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* Google, Inc.
* Written by Stuart Gill and Behdad Esfahbod.
*
@@ -367,7 +367,7 @@
}
/* transform transparency to alpha */
- if ( png_get_valid(png, info, PNG_INFO_tRNS ) )
+ if ( png_get_valid( png, info, PNG_INFO_tRNS ) )
png_set_tRNS_to_alpha( png );
if ( bitdepth == 16 )
@@ -387,7 +387,7 @@
png_set_filler( png, 0xFF, PNG_FILLER_AFTER );
/* recheck header after setting EXPAND options */
- png_read_update_info(png, info );
+ png_read_update_info( png, info );
png_get_IHDR( png, info,
&imgWidth, &imgHeight,
&bitdepth, &color_type, &interlace,
diff --git a/freetype/src/sfnt/pngshim.h b/freetype/src/sfnt/pngshim.h
index 89efd275..36d749c3 100644
--- a/freetype/src/sfnt/pngshim.h
+++ b/freetype/src/sfnt/pngshim.h
@@ -4,7 +4,7 @@
*
* PNG Bitmap glyph support.
*
- * Copyright (C) 2013-2021 by
+ * Copyright (C) 2013-2022 by
* Google, Inc.
* Written by Stuart Gill and Behdad Esfahbod.
*
diff --git a/freetype/src/sfnt/rules.mk b/freetype/src/sfnt/rules.mk
index d41305c0..ac4b5712 100644
--- a/freetype/src/sfnt/rules.mk
+++ b/freetype/src/sfnt/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -36,6 +36,7 @@ SFNT_DRV_SRC := $(SFNT_DIR)/pngshim.c \
$(SFNT_DIR)/ttbdf.c \
$(SFNT_DIR)/ttcmap.c \
$(SFNT_DIR)/ttcolr.c \
+ $(SFNT_DIR)/ttsvg.c \
$(SFNT_DIR)/ttcpal.c \
$(SFNT_DIR)/ttkern.c \
$(SFNT_DIR)/ttload.c \
diff --git a/freetype/src/sfnt/sfdriver.c b/freetype/src/sfnt/sfdriver.c
index d1d01c99..cc121e57 100644
--- a/freetype/src/sfnt/sfdriver.c
+++ b/freetype/src/sfnt/sfdriver.c
@@ -4,7 +4,7 @@
*
* High-level SFNT driver interface (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -36,6 +36,10 @@
#include "ttcpal.h"
#endif
+#ifdef FT_CONFIG_OPTION_SVG
+#include "ttsvg.h"
+#endif
+
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
#include "ttpost.h"
#endif
@@ -491,15 +495,13 @@
char_type_func char_type,
FT_Bool report_invalid_characters )
{
- FT_Error error = FT_Err_Ok;
+ FT_Error error;
char* result = NULL;
FT_String* r;
FT_Char* p;
FT_UInt len;
- FT_UNUSED( error );
-
if ( FT_QALLOC( result, entry->stringLength / 2 + 1 ) )
return NULL;
@@ -550,15 +552,13 @@
char_type_func char_type,
FT_Bool report_invalid_characters )
{
- FT_Error error = FT_Err_Ok;
+ FT_Error error;
char* result = NULL;
FT_String* r;
FT_Char* p;
FT_UInt len;
- FT_UNUSED( error );
-
if ( FT_QALLOC( result, entry->stringLength + 1 ) )
return NULL;
@@ -1214,6 +1214,12 @@
#define PUT_COLOR_LAYERS( a ) NULL
#endif
+#ifdef FT_CONFIG_OPTION_SVG
+#define PUT_SVG_SUPPORT( a ) a
+#else
+#define PUT_SVG_SUPPORT( a ) NULL
+#endif
+
#define PUT_COLOR_LAYERS_V1( a ) PUT_COLOR_LAYERS( a )
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
@@ -1308,7 +1314,14 @@
tt_face_get_metrics, /* TT_Get_Metrics_Func get_metrics */
tt_face_get_name, /* TT_Get_Name_Func get_name */
- sfnt_get_name_id /* TT_Get_Name_ID_Func get_name_id */
+ sfnt_get_name_id, /* TT_Get_Name_ID_Func get_name_id */
+
+ PUT_SVG_SUPPORT( tt_face_load_svg ),
+ /* TT_Load_Table_Func load_svg */
+ PUT_SVG_SUPPORT( tt_face_free_svg ),
+ /* TT_Free_Table_Func free_svg */
+ PUT_SVG_SUPPORT( tt_face_load_svg_doc )
+ /* TT_Load_Svg_Doc_Func load_svg_doc */
)
diff --git a/freetype/src/sfnt/sfdriver.h b/freetype/src/sfnt/sfdriver.h
index 8d5b5ce3..6a2e3e9c 100644
--- a/freetype/src/sfnt/sfdriver.h
+++ b/freetype/src/sfnt/sfdriver.h
@@ -4,7 +4,7 @@
*
* High-level SFNT driver interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/sferrors.h b/freetype/src/sfnt/sferrors.h
index 78e6f035..99ef3f9f 100644
--- a/freetype/src/sfnt/sferrors.h
+++ b/freetype/src/sfnt/sferrors.h
@@ -4,7 +4,7 @@
*
* SFNT error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/sfnt.c b/freetype/src/sfnt/sfnt.c
index 97692cdf..9b3ceaed 100644
--- a/freetype/src/sfnt/sfnt.c
+++ b/freetype/src/sfnt/sfnt.c
@@ -4,7 +4,7 @@
*
* Single object library component.
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -27,6 +27,7 @@
#include "ttcmap.c"
#include "ttcolr.c"
#include "ttcpal.c"
+#include "ttsvg.c"
#include "ttkern.c"
#include "ttload.c"
diff --git a/freetype/src/sfnt/sfobjs.c b/freetype/src/sfnt/sfobjs.c
index 78910247..a0da984e 100644
--- a/freetype/src/sfnt/sfobjs.c
+++ b/freetype/src/sfnt/sfobjs.c
@@ -4,7 +4,7 @@
*
* SFNT object management (base).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -566,7 +566,7 @@
face_index = FT_ABS( face_instance_index ) & 0xFFFF;
/* value -(N+1) requests information on index N */
- if ( face_instance_index < 0 )
+ if ( face_instance_index < 0 && face_index > 0 )
face_index--;
if ( face_index >= face->ttc_header.count )
@@ -784,17 +784,23 @@
FT_Int num_params,
FT_Parameter* params )
{
- FT_Error error;
+ FT_Error error;
#ifdef TT_CONFIG_OPTION_POSTSCRIPT_NAMES
- FT_Error psnames_error;
+ FT_Error psnames_error;
#endif
- FT_Bool has_outline;
- FT_Bool is_apple_sbit;
- FT_Bool is_apple_sbix;
- FT_Bool has_CBLC;
- FT_Bool has_CBDT;
- FT_Bool ignore_typographic_family = FALSE;
- FT_Bool ignore_typographic_subfamily = FALSE;
+
+ FT_Bool has_outline;
+ FT_Bool is_apple_sbit;
+
+ FT_Bool has_CBLC;
+ FT_Bool has_CBDT;
+ FT_Bool has_EBLC;
+ FT_Bool has_bloc;
+ FT_Bool has_sbix;
+
+ FT_Bool ignore_typographic_family = FALSE;
+ FT_Bool ignore_typographic_subfamily = FALSE;
+ FT_Bool ignore_sbix = FALSE;
SFNT_Service sfnt = (SFNT_Service)face->sfnt;
@@ -813,6 +819,8 @@
ignore_typographic_family = TRUE;
else if ( params[i].tag == FT_PARAM_TAG_IGNORE_TYPOGRAPHIC_SUBFAMILY )
ignore_typographic_subfamily = TRUE;
+ else if ( params[i].tag == FT_PARAM_TAG_IGNORE_SBIX )
+ ignore_sbix = TRUE;
}
}
@@ -848,14 +856,17 @@
tt_face_lookup_table( face, TTAG_CFF2 ) );
#endif
- is_apple_sbit = 0;
- is_apple_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 );
+ /* check which sbit formats are present */
+ has_CBLC = !face->goto_table( face, TTAG_CBLC, stream, 0 );
+ has_CBDT = !face->goto_table( face, TTAG_CBDT, stream, 0 );
+ has_EBLC = !face->goto_table( face, TTAG_EBLC, stream, 0 );
+ has_bloc = !face->goto_table( face, TTAG_bloc, stream, 0 );
+ has_sbix = !face->goto_table( face, TTAG_sbix, stream, 0 );
- /* Apple 'sbix' color bitmaps are rendered scaled and then the 'glyf'
- * outline rendered on top. We don't support that yet, so just ignore
- * the 'glyf' outline and advertise it as a bitmap-only font. */
- if ( is_apple_sbix )
- has_outline = FALSE;
+ is_apple_sbit = FALSE;
+
+ if ( ignore_sbix )
+ has_sbix = FALSE;
/* if this font doesn't contain outlines, we try to load */
/* a `bhed' table */
@@ -867,16 +878,13 @@
/* load the font header (`head' table) if this isn't an Apple */
/* sbit font file */
- if ( !is_apple_sbit || is_apple_sbix )
+ if ( !is_apple_sbit || has_sbix )
{
LOAD_( head );
if ( error )
goto Exit;
}
- has_CBLC = !face->goto_table( face, TTAG_CBLC, stream, 0 );
- has_CBDT = !face->goto_table( face, TTAG_CBDT, stream, 0 );
-
/* Ignore outlines for CBLC/CBDT fonts. */
if ( has_CBLC || has_CBDT )
has_outline = FALSE;
@@ -986,7 +994,11 @@
/* the optional tables */
/* embedded bitmap support */
- if ( sfnt->load_eblc )
+ /* TODO: Replace this clumsy check for all possible sbit tables */
+ /* with something better (for example, by passing a parameter */
+ /* to suppress 'sbix' loading). */
+ if ( sfnt->load_eblc &&
+ ( has_CBLC || has_EBLC || has_bloc || has_sbix ) )
LOAD_( eblc );
/* colored glyph support */
@@ -996,6 +1008,10 @@
LOAD_( colr );
}
+ /* OpenType-SVG glyph support */
+ if ( sfnt->load_svg )
+ LOAD_( svg );
+
/* consider the pclt, kerning, and gasp tables as optional */
LOAD_( pclt );
LOAD_( gasp );
@@ -1050,11 +1066,19 @@
*/
if ( face->sbit_table_type == TT_SBIT_TABLE_TYPE_CBLC ||
face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX ||
- face->colr )
+ face->colr ||
+ face->svg )
flags |= FT_FACE_FLAG_COLOR; /* color glyphs */
if ( has_outline == TRUE )
- flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */
+ {
+ /* by default (and for backward compatibility) we handle */
+ /* fonts with an 'sbix' table as bitmap-only */
+ if ( has_sbix )
+ flags |= FT_FACE_FLAG_SBIX; /* with 'sbix' bitmaps */
+ else
+ flags |= FT_FACE_FLAG_SCALABLE; /* scalable outlines */
+ }
/* The sfnt driver only supports bitmap fonts natively, thus we */
/* don't set FT_FACE_FLAG_HINTER. */
@@ -1277,7 +1301,8 @@
*
* Set up metrics.
*/
- if ( FT_IS_SCALABLE( root ) )
+ if ( FT_IS_SCALABLE( root ) ||
+ FT_HAS_SBIX( root ) )
{
/* XXX What about if outline header is missing */
/* (e.g. sfnt wrapped bitmap)? */
@@ -1416,6 +1441,12 @@
sfnt->free_cpal( face );
sfnt->free_colr( face );
}
+
+#ifdef FT_CONFIG_OPTION_SVG
+ /* free SVG data */
+ if ( sfnt->free_svg )
+ sfnt->free_svg( face );
+#endif
}
#ifdef TT_CONFIG_OPTION_BDF
diff --git a/freetype/src/sfnt/sfobjs.h b/freetype/src/sfnt/sfobjs.h
index 172c47eb..1d99bfed 100644
--- a/freetype/src/sfnt/sfobjs.h
+++ b/freetype/src/sfnt/sfobjs.h
@@ -4,7 +4,7 @@
*
* SFNT object management (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/sfwoff.c b/freetype/src/sfnt/sfwoff.c
index 422c816a..0e8ec3fa 100644
--- a/freetype/src/sfnt/sfwoff.c
+++ b/freetype/src/sfnt/sfwoff.c
@@ -4,7 +4,7 @@
*
* WOFF format management (base).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -64,7 +64,6 @@
FT_FREE( stream->base );
stream->size = 0;
- stream->base = NULL;
stream->close = NULL;
}
diff --git a/freetype/src/sfnt/sfwoff.h b/freetype/src/sfnt/sfwoff.h
index 3fbdac0f..5866a161 100644
--- a/freetype/src/sfnt/sfwoff.h
+++ b/freetype/src/sfnt/sfwoff.h
@@ -4,7 +4,7 @@
*
* WOFFF format management (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/sfwoff2.c b/freetype/src/sfnt/sfwoff2.c
index 5ee8dea2..b2855b8e 100644
--- a/freetype/src/sfnt/sfwoff2.c
+++ b/freetype/src/sfnt/sfwoff2.c
@@ -4,7 +4,7 @@
*
* WOFF2 format management (base).
*
- * Copyright (C) 2019-2021 by
+ * Copyright (C) 2019-2022 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -84,6 +84,8 @@
#define BBOX_STREAM 5
#define INSTRUCTION_STREAM 6
+#define HAVE_OVERLAP_SIMPLE_BITMAP 0x1
+
static void
stream_close( FT_Stream stream )
@@ -94,7 +96,6 @@
FT_FREE( stream->base );
stream->size = 0;
- stream->base = NULL;
stream->close = NULL;
}
@@ -523,6 +524,7 @@
const WOFF2_Point points,
FT_UShort n_contours,
FT_UShort instruction_len,
+ FT_Bool have_overlap,
FT_Byte* dst,
FT_ULong dst_size,
FT_ULong* glyph_size )
@@ -550,6 +552,9 @@
FT_Int dy = point.y - last_y;
+ if ( i == 0 && have_overlap )
+ flag |= GLYF_OVERLAP_SIMPLE;
+
if ( dx == 0 )
flag |= GLYF_THIS_X_IS_SAME;
else if ( dx > -256 && dx < 256 )
@@ -834,15 +839,18 @@
FT_UInt num_substreams = 7;
+ FT_UShort option_flags;
FT_UShort num_glyphs;
FT_UShort index_format;
FT_ULong expected_loca_length;
FT_UInt offset;
FT_UInt i;
FT_ULong points_size;
- FT_ULong bitmap_length;
FT_ULong glyph_buf_size;
FT_ULong bbox_bitmap_offset;
+ FT_ULong bbox_bitmap_length;
+ FT_ULong overlap_bitmap_offset = 0;
+ FT_ULong overlap_bitmap_length = 0;
const FT_ULong glyf_start = *out_offset;
FT_ULong dest_offset = *out_offset;
@@ -858,15 +866,17 @@
if ( FT_NEW_ARRAY( substreams, num_substreams ) )
goto Fail;
- if ( FT_STREAM_SKIP( 4 ) )
+ if ( FT_STREAM_SKIP( 2 ) )
+ goto Fail;
+ if ( FT_READ_USHORT( option_flags ) )
goto Fail;
if ( FT_READ_USHORT( num_glyphs ) )
goto Fail;
if ( FT_READ_USHORT( index_format ) )
goto Fail;
- FT_TRACE4(( "num_glyphs = %u; index_format = %u\n",
- num_glyphs, index_format ));
+ FT_TRACE4(( "option_flags = %u; num_glyphs = %u; index_format = %u\n",
+ option_flags, num_glyphs, index_format ));
info->num_glyphs = num_glyphs;
@@ -879,7 +889,7 @@
if ( info->loca_table->dst_length != expected_loca_length )
goto Fail;
- offset = ( 2 + num_substreams ) * 4;
+ offset = 2 + 2 + 2 + 2 + ( num_substreams * 4 );
if ( offset > info->glyf_table->TransformLength )
goto Fail;
@@ -902,6 +912,20 @@
offset += substream_size;
}
+ if ( option_flags & HAVE_OVERLAP_SIMPLE_BITMAP )
+ {
+ /* Size of overlapBitmap = floor((numGlyphs + 7) / 8) */
+ overlap_bitmap_length = ( num_glyphs + 7U ) >> 3;
+ if ( overlap_bitmap_length > info->glyf_table->TransformLength - offset )
+ goto Fail;
+
+ overlap_bitmap_offset = pos + offset;
+
+ FT_TRACE5(( " Overlap bitmap: offset = %lu; size = %lu;\n",
+ overlap_bitmap_offset, overlap_bitmap_length ));
+ offset += overlap_bitmap_length;
+ }
+
if ( FT_NEW_ARRAY( loca_values, num_glyphs + 1 ) )
goto Fail;
@@ -909,8 +933,9 @@
bbox_bitmap_offset = substreams[BBOX_STREAM].offset;
/* Size of bboxBitmap = 4 * floor((numGlyphs + 31) / 32) */
- bitmap_length = ( ( num_glyphs + 31U ) >> 5 ) << 2;
- substreams[BBOX_STREAM].offset += bitmap_length;
+ bbox_bitmap_length = ( ( num_glyphs + 31U ) >> 5 ) << 2;
+ /* bboxStreamSize is the combined size of bboxBitmap and bboxStream. */
+ substreams[BBOX_STREAM].offset += bbox_bitmap_length;
glyph_buf_size = WOFF2_DEFAULT_GLYPH_BUF;
if ( FT_NEW_ARRAY( glyph_buf, glyph_buf_size ) )
@@ -948,7 +973,7 @@
/* composite glyph */
FT_Bool have_instructions = FALSE;
FT_UShort instruction_size = 0;
- FT_ULong composite_size;
+ FT_ULong composite_size = 0;
FT_ULong size_needed;
FT_Byte* pointer = NULL;
@@ -1026,8 +1051,11 @@
FT_ULong flag_size;
FT_ULong triplet_size;
FT_ULong triplet_bytes_used;
- FT_Byte* flags_buf = NULL;
- FT_Byte* triplet_buf = NULL;
+ FT_Bool have_overlap = FALSE;
+ FT_Byte overlap_bitmap;
+ FT_ULong overlap_offset;
+ FT_Byte* flags_buf = NULL;
+ FT_Byte* triplet_buf = NULL;
FT_UShort instruction_size;
FT_ULong size_needed;
FT_Int end_point;
@@ -1036,6 +1064,17 @@
FT_Byte* pointer = NULL;
+ /* Set `have_overlap`. */
+ if ( overlap_bitmap_offset )
+ {
+ overlap_offset = overlap_bitmap_offset + ( i >> 3 );
+ if ( FT_STREAM_SEEK( overlap_offset ) ||
+ FT_READ_BYTE( overlap_bitmap ) )
+ goto Fail;
+ if ( overlap_bitmap & ( 0x80 >> ( i & 7 ) ) )
+ have_overlap = TRUE;
+ }
+
if ( FT_NEW_ARRAY( n_points_arr, n_contours ) )
goto Fail;
@@ -1156,6 +1195,7 @@
points,
n_contours,
instruction_size,
+ have_overlap,
glyph_buf,
glyph_buf_size,
&glyph_size ) )
@@ -2064,7 +2104,7 @@
error = FT_THROW( Invalid_Table );
goto Exit;
}
- file_offset = ROUND4(woff2.metaOffset + woff2.metaLength);
+ file_offset = ROUND4( woff2.metaOffset + woff2.metaLength );
}
if ( woff2.privOffset )
@@ -2074,7 +2114,7 @@
error = FT_THROW( Invalid_Table );
goto Exit;
}
- file_offset = ROUND4(woff2.privOffset + woff2.privLength);
+ file_offset = ROUND4( woff2.privOffset + woff2.privLength );
}
if ( file_offset != ( ROUND4( woff2.length ) ) )
@@ -2086,7 +2126,7 @@
/* Validate requested face index. */
*num_faces = woff2.num_fonts;
/* value -(N+1) requests information on index N */
- if ( *face_instance_index < 0 )
+ if ( *face_instance_index < 0 && face_index > 0 )
face_index--;
if ( face_index >= woff2.num_fonts )
diff --git a/freetype/src/sfnt/sfwoff2.h b/freetype/src/sfnt/sfwoff2.h
index fa78b024..e84982ed 100644
--- a/freetype/src/sfnt/sfwoff2.h
+++ b/freetype/src/sfnt/sfwoff2.h
@@ -4,7 +4,7 @@
*
* WOFFF2 format management (specification).
*
- * Copyright (C) 2019-2021 by
+ * Copyright (C) 2019-2022 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -56,6 +56,7 @@ FT_BEGIN_HEADER
#define GLYF_REPEAT 1 << 3
#define GLYF_THIS_X_IS_SAME 1 << 4
#define GLYF_THIS_Y_IS_SAME 1 << 5
+#define GLYF_OVERLAP_SIMPLE 1 << 6
/* Other constants */
#define CONTOUR_OFFSET_END_POINT 10
diff --git a/freetype/src/sfnt/ttbdf.c b/freetype/src/sfnt/ttbdf.c
index b8d9473a..4d2faf23 100644
--- a/freetype/src/sfnt/ttbdf.c
+++ b/freetype/src/sfnt/ttbdf.c
@@ -4,7 +4,7 @@
*
* TrueType and OpenType embedded BDF properties (body).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttbdf.h b/freetype/src/sfnt/ttbdf.h
index 91271d91..b7b11c9b 100644
--- a/freetype/src/sfnt/ttbdf.h
+++ b/freetype/src/sfnt/ttbdf.h
@@ -4,7 +4,7 @@
*
* TrueType and OpenType embedded BDF properties (specification).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttcmap.c b/freetype/src/sfnt/ttcmap.c
index b369d837..bfeabacb 100644
--- a/freetype/src/sfnt/ttcmap.c
+++ b/freetype/src/sfnt/ttcmap.c
@@ -4,7 +4,7 @@
*
* TrueType character mapping table (cmap) support (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -465,7 +465,7 @@
if ( subheader )
{
FT_Byte* p = subheader;
- FT_UInt idx = (FT_UInt)(char_code & 0xFF);
+ FT_UInt idx = (FT_UInt)( char_code & 0xFF );
FT_UInt start, count;
FT_Int delta;
FT_UInt offset;
diff --git a/freetype/src/sfnt/ttcmap.h b/freetype/src/sfnt/ttcmap.h
index 504fc951..b10860b3 100644
--- a/freetype/src/sfnt/ttcmap.h
+++ b/freetype/src/sfnt/ttcmap.h
@@ -4,7 +4,7 @@
*
* TrueType character mapping table (cmap) support (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttcmapc.h b/freetype/src/sfnt/ttcmapc.h
index 4e6cd46b..6822a9cd 100644
--- a/freetype/src/sfnt/ttcmapc.h
+++ b/freetype/src/sfnt/ttcmapc.h
@@ -4,7 +4,7 @@
*
* TT CMAP classes definitions (specification only).
*
- * Copyright (C) 2009-2021 by
+ * Copyright (C) 2009-2022 by
* Oran Agra and Mickey Gabel.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttcolr.c b/freetype/src/sfnt/ttcolr.c
index 8f5cc8bc..d54231fd 100644
--- a/freetype/src/sfnt/ttcolr.c
+++ b/freetype/src/sfnt/ttcolr.c
@@ -4,7 +4,7 @@
*
* TrueType and OpenType colored glyph layer support (body).
*
- * Copyright (C) 2018-2021 by
+ * Copyright (C) 2018-2022 by
* David Turner, Robert Wilhelm, Dominik Röttsches, and Werner Lemberg.
*
* Originally written by Shao Yu Zhang <shaozhang@fb.com>.
@@ -522,19 +522,29 @@
else if ( apaint->format == FT_COLR_PAINTFORMAT_RADIAL_GRADIENT )
{
+ FT_Pos tmp;
+
+
if ( !read_color_line( child_table_p,
&apaint->u.radial_gradient.colorline ) )
return 0;
+ /* In the OpenType specification, `r0` and `r1` are defined as */
+ /* `UFWORD`. Since FreeType doesn't have a corresponding 16.16 */
+ /* format we convert to `FWORD` and replace negative values with */
+ /* (32bit) `FT_INT_MAX`. */
+
apaint->u.radial_gradient.c0.x = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
apaint->u.radial_gradient.c0.y = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
- apaint->u.radial_gradient.r0 = FT_NEXT_USHORT( p ) << 16;
+ tmp = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
+ apaint->u.radial_gradient.r0 = tmp < 0 ? FT_INT_MAX : tmp;
apaint->u.radial_gradient.c1.x = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
apaint->u.radial_gradient.c1.y = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
- apaint->u.radial_gradient.r1 = FT_NEXT_USHORT( p ) << 16;
+ tmp = INT_TO_FIXED( FT_NEXT_SHORT( p ) );
+ apaint->u.radial_gradient.r1 = tmp < 0 ? FT_INT_MAX : tmp;
return 1;
}
@@ -824,7 +834,7 @@
{
Colr* colr;
- FT_Byte *p, *p1, *clip_base;
+ FT_Byte *p, *p1, *clip_base, *limit;
FT_Byte clip_list_format;
FT_ULong num_clip_boxes, i;
@@ -847,16 +857,32 @@
p = colr->clip_list;
+ /* Limit points to the first byte after the end of the color table. */
+ /* Thus, in subsequent limit checks below we need to check whether the */
+ /* read pointer is strictly greater than a position offset by certain */
+ /* field sizes to the left of that position. */
+ limit = (FT_Byte*)colr->table + colr->table_size;
+
+ /* Check whether we can extract one `uint8` and one `uint32`. */
+ if ( p > limit - ( 1 + 4 ) )
+ return 0;
+
clip_base = p;
clip_list_format = FT_NEXT_BYTE ( p );
/* Format byte used here to be able to upgrade ClipList for >16bit */
- /* glyph ids; for now we can expect it to be 0. */
+ /* glyph ids; for now we can expect it to be 0. */
if ( !( clip_list_format == 1 ) )
return 0;
num_clip_boxes = FT_NEXT_ULONG( p );
+ /* Check whether we can extract two `uint16` and one `Offset24`, */
+ /* `num_clip_boxes` times. */
+ if ( colr->table_size / ( 2 + 2 + 3 ) < num_clip_boxes ||
+ p > limit - ( 2 + 2 + 3 ) * num_clip_boxes )
+ return 0;
+
for ( i = 0; i < num_clip_boxes; ++i )
{
gid_start = FT_NEXT_USHORT( p );
@@ -867,7 +893,8 @@
{
p1 = (FT_Byte*)( clip_base + clip_box_offset );
- if ( p1 >= ( (FT_Byte*)colr->table + colr->table_size ) )
+ /* Check whether we can extract one `uint8`. */
+ if ( p1 > limit - 1 )
return 0;
format = FT_NEXT_BYTE( p1 );
@@ -875,6 +902,10 @@
if ( format > 1 )
return 0;
+ /* Check whether we can extract four `FWORD`. */
+ if ( p1 > limit - ( 2 + 2 + 2 + 2 ) )
+ return 0;
+
/* `face->root.size->metrics.x_scale` and `y_scale` are factors */
/* that scale a font unit value in integers to a 26.6 fixed value */
/* according to the requested size, see for example */
diff --git a/freetype/src/sfnt/ttcolr.h b/freetype/src/sfnt/ttcolr.h
index b81e4cb9..4200cb29 100644
--- a/freetype/src/sfnt/ttcolr.h
+++ b/freetype/src/sfnt/ttcolr.h
@@ -4,7 +4,7 @@
*
* TrueType and OpenType colored glyph layer support (specification).
*
- * Copyright (C) 2018-2021 by
+ * Copyright (C) 2018-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Originally written by Shao Yu Zhang <shaozhang@fb.com>.
diff --git a/freetype/src/sfnt/ttcpal.c b/freetype/src/sfnt/ttcpal.c
index a0d84bca..9ae535cb 100644
--- a/freetype/src/sfnt/ttcpal.c
+++ b/freetype/src/sfnt/ttcpal.c
@@ -4,7 +4,7 @@
*
* TrueType and OpenType color palette support (body).
*
- * Copyright (C) 2018-2021 by
+ * Copyright (C) 2018-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Originally written by Shao Yu Zhang <shaozhang@fb.com>.
diff --git a/freetype/src/sfnt/ttcpal.h b/freetype/src/sfnt/ttcpal.h
index 1c558685..4717d224 100644
--- a/freetype/src/sfnt/ttcpal.h
+++ b/freetype/src/sfnt/ttcpal.h
@@ -4,7 +4,7 @@
*
* TrueType and OpenType color palette support (specification).
*
- * Copyright (C) 2018-2021 by
+ * Copyright (C) 2018-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Originally written by Shao Yu Zhang <shaozhang@fb.com>.
diff --git a/freetype/src/sfnt/ttkern.c b/freetype/src/sfnt/ttkern.c
index bb1922ca..ca1c5094 100644
--- a/freetype/src/sfnt/ttkern.c
+++ b/freetype/src/sfnt/ttkern.c
@@ -5,7 +5,7 @@
* Load the basic TrueType kerning table. This doesn't handle
* kerning data within the GPOS table at the moment.
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -94,7 +94,7 @@
p_next = p;
- p += 2; /* skip version */
+ p += 2; /* skip version */
length = FT_NEXT_USHORT( p );
coverage = FT_NEXT_USHORT( p );
@@ -144,7 +144,7 @@
cur_pair = FT_NEXT_ULONG( p );
- if ( cur_pair <= old_pair )
+ if ( cur_pair < old_pair )
break;
p += 2;
@@ -187,11 +187,18 @@
FT_UInt left_glyph,
FT_UInt right_glyph )
{
- FT_Int result = 0;
- FT_UInt count, mask;
- FT_Byte* p = face->kern_table;
- FT_Byte* p_limit = p + face->kern_table_size;
+ FT_Int result = 0;
+ FT_UInt count, mask;
+ FT_Byte* p;
+ FT_Byte* p_limit;
+
+
+ if ( !face->kern_table )
+ return result;
+
+ p = face->kern_table;
+ p_limit = p + face->kern_table_size;
p += 4;
mask = 0x0001;
diff --git a/freetype/src/sfnt/ttkern.h b/freetype/src/sfnt/ttkern.h
index 3d8f1e83..f0635583 100644
--- a/freetype/src/sfnt/ttkern.h
+++ b/freetype/src/sfnt/ttkern.h
@@ -5,7 +5,7 @@
* Load the basic TrueType kerning table. This doesn't handle
* kerning data within the GPOS table at the moment.
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttload.c b/freetype/src/sfnt/ttload.c
index 51416d80..c83bd197 100644
--- a/freetype/src/sfnt/ttload.c
+++ b/freetype/src/sfnt/ttload.c
@@ -5,7 +5,7 @@
* Load the basic TrueType tables, i.e., tables that can be either in
* TTF or OTF fonts (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -205,7 +205,6 @@
if ( FT_STREAM_READ_FIELDS( table_dir_entry_fields, &table ) )
{
- nn--;
FT_TRACE2(( "check_table_dir:"
" can read only %d table%s in font (instead of %d)\n",
nn, nn == 1 ? "" : "s", sfnt->num_tables ));
diff --git a/freetype/src/sfnt/ttload.h b/freetype/src/sfnt/ttload.h
index cab15cd2..5368971c 100644
--- a/freetype/src/sfnt/ttload.h
+++ b/freetype/src/sfnt/ttload.h
@@ -5,7 +5,7 @@
* Load the basic TrueType tables, i.e., tables that can be either in
* TTF or OTF fonts (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttmtx.c b/freetype/src/sfnt/ttmtx.c
index 7aece36f..88377327 100644
--- a/freetype/src/sfnt/ttmtx.c
+++ b/freetype/src/sfnt/ttmtx.c
@@ -4,7 +4,7 @@
*
* Load the metrics tables common to TTF and OTF fonts (body).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttmtx.h b/freetype/src/sfnt/ttmtx.h
index 270170d4..1e45b949 100644
--- a/freetype/src/sfnt/ttmtx.h
+++ b/freetype/src/sfnt/ttmtx.h
@@ -4,7 +4,7 @@
*
* Load the metrics tables common to TTF and OTF fonts (specification).
*
- * Copyright (C) 2006-2021 by
+ * Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttpost.c b/freetype/src/sfnt/ttpost.c
index b92ca5db..1a885a15 100644
--- a/freetype/src/sfnt/ttpost.c
+++ b/freetype/src/sfnt/ttpost.c
@@ -5,7 +5,7 @@
* PostScript name table processing for TrueType and OpenType fonts
* (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttpost.h b/freetype/src/sfnt/ttpost.h
index 6d65b576..bf9342a9 100644
--- a/freetype/src/sfnt/ttpost.h
+++ b/freetype/src/sfnt/ttpost.h
@@ -5,7 +5,7 @@
* PostScript name table processing for TrueType and OpenType fonts
* (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttsbit.c b/freetype/src/sfnt/ttsbit.c
index e9ba697d..bf73d04e 100644
--- a/freetype/src/sfnt/ttsbit.c
+++ b/freetype/src/sfnt/ttsbit.c
@@ -4,7 +4,7 @@
*
* TrueType and OpenType embedded bitmap support (body).
*
- * Copyright (C) 2005-2021 by
+ * Copyright (C) 2005-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* Copyright 2013 by Google, Inc.
@@ -172,17 +172,8 @@
goto Exit;
}
-#ifdef FT_DEBUG_LEVEL_TRACE
- /* we currently don't support bit 1; however, it is better to */
- /* draw at least something... */
if ( flags == 3 )
- {
- FT_TRACE1(( "tt_face_load_sbit_strikes:"
- " sbix overlay not supported yet\n" ));
- FT_TRACE1(( " "
- " expect bad rendering results\n" ));
- }
-#endif
+ face->root.face_flags |= FT_FACE_FLAG_SBIX_OVERLAY;
/*
* Count the number of strikes available in the table. We are a bit
@@ -730,6 +721,9 @@
pitch = bitmap->pitch;
line = bitmap->buffer;
+ if ( !line )
+ goto Exit;
+
width = decoder->metrics->width;
height = decoder->metrics->height;
@@ -1577,17 +1571,34 @@
if ( !error )
{
- FT_Short abearing;
+ FT_Short abearing; /* not used here */
FT_UShort aadvance;
tt_face_get_metrics( face, FALSE, glyph_index, &abearing, &aadvance );
metrics->horiBearingX = (FT_Short)originOffsetX;
- metrics->horiBearingY = (FT_Short)( -originOffsetY + metrics->height );
+ metrics->vertBearingX = (FT_Short)originOffsetX;
+
+ metrics->horiBearingY = (FT_Short)( originOffsetY + metrics->height );
+ metrics->vertBearingY = (FT_Short)originOffsetY;
+
metrics->horiAdvance = (FT_UShort)( aadvance *
face->root.size->metrics.x_ppem /
face->header.Units_Per_EM );
+
+ if ( face->vertical_info )
+ tt_face_get_metrics( face, TRUE, glyph_index, &abearing, &aadvance );
+ else if ( face->os2.version != 0xFFFFU )
+ aadvance = (FT_UShort)FT_ABS( face->os2.sTypoAscender -
+ face->os2.sTypoDescender );
+ else
+ aadvance = (FT_UShort)FT_ABS( face->horizontal.Ascender -
+ face->horizontal.Descender );
+
+ metrics->vertAdvance = (FT_UShort)( aadvance *
+ face->root.size->metrics.x_ppem /
+ face->header.Units_Per_EM );
}
return error;
diff --git a/freetype/src/sfnt/ttsbit.h b/freetype/src/sfnt/ttsbit.h
index 7a0ed92e..c967bffb 100644
--- a/freetype/src/sfnt/ttsbit.h
+++ b/freetype/src/sfnt/ttsbit.h
@@ -4,7 +4,7 @@
*
* TrueType and OpenType embedded bitmap support (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/ttsvg.c b/freetype/src/sfnt/ttsvg.c
new file mode 100644
index 00000000..69277da5
--- /dev/null
+++ b/freetype/src/sfnt/ttsvg.c
@@ -0,0 +1,403 @@
+/****************************************************************************
+ *
+ * ttsvg.c
+ *
+ * OpenType SVG Color (specification).
+ *
+ * Copyright (C) 2022 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * 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.
+ *
+ */
+
+
+ /**************************************************************************
+ *
+ * 'SVG' table specification:
+ *
+ * https://docs.microsoft.com/en-us/typography/opentype/spec/svg
+ *
+ */
+
+#include <ft2build.h>
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/internal/ftdebug.h>
+#include <freetype/tttags.h>
+#include <freetype/ftgzip.h>
+#include <freetype/otsvg.h>
+
+
+#ifdef FT_CONFIG_OPTION_SVG
+
+#include "ttsvg.h"
+
+
+ /* NOTE: These table sizes are given by the specification. */
+#define SVG_TABLE_HEADER_SIZE (10U)
+#define SVG_DOCUMENT_RECORD_SIZE (12U)
+#define SVG_DOCUMENT_LIST_MINIMUM_SIZE (2U + SVG_DOCUMENT_RECORD_SIZE)
+#define SVG_MINIMUM_SIZE (SVG_TABLE_HEADER_SIZE + \
+ SVG_DOCUMENT_LIST_MINIMUM_SIZE)
+
+
+ typedef struct Svg_
+ {
+ FT_UShort version; /* table version (starting at 0) */
+ FT_UShort num_entries; /* number of SVG document records */
+
+ FT_Byte* svg_doc_list; /* pointer to the start of SVG Document List */
+
+ void* table; /* memory that backs up SVG */
+ FT_ULong table_size;
+
+ } Svg;
+
+
+ /**************************************************************************
+ *
+ * The macro FT_COMPONENT is used in trace mode. It is an implicit
+ * parameter of the FT_TRACE() and FT_ERROR() macros, usued to print/log
+ * messages during execution.
+ */
+#undef FT_COMPONENT
+#define FT_COMPONENT ttsvg
+
+
+ FT_LOCAL_DEF( FT_Error )
+ tt_face_load_svg( TT_Face face,
+ FT_Stream stream )
+ {
+ FT_Error error;
+ FT_Memory memory = face->root.memory;
+
+ FT_ULong table_size;
+ FT_Byte* table = NULL;
+ FT_Byte* p = NULL;
+ Svg* svg = NULL;
+ FT_ULong offsetToSVGDocumentList;
+
+
+ error = face->goto_table( face, TTAG_SVG, stream, &table_size );
+ if ( error )
+ goto NoSVG;
+
+ if ( table_size < SVG_MINIMUM_SIZE )
+ goto InvalidTable;
+
+ if ( FT_FRAME_EXTRACT( table_size, table ) )
+ goto NoSVG;
+
+ /* Allocate memory for the SVG object */
+ if ( FT_NEW( svg ) )
+ goto NoSVG;
+
+ p = table;
+ svg->version = FT_NEXT_USHORT( p );
+ offsetToSVGDocumentList = FT_NEXT_ULONG( p );
+
+ if ( offsetToSVGDocumentList < SVG_TABLE_HEADER_SIZE ||
+ offsetToSVGDocumentList > table_size -
+ SVG_DOCUMENT_LIST_MINIMUM_SIZE )
+ goto InvalidTable;
+
+ svg->svg_doc_list = (FT_Byte*)( table + offsetToSVGDocumentList );
+
+ p = svg->svg_doc_list;
+ svg->num_entries = FT_NEXT_USHORT( p );
+
+ FT_TRACE3(( "version: %d\n", svg->version ));
+ FT_TRACE3(( "number of entries: %d\n", svg->num_entries ));
+
+ if ( offsetToSVGDocumentList +
+ svg->num_entries * SVG_DOCUMENT_RECORD_SIZE > table_size )
+ goto InvalidTable;
+
+ svg->table = table;
+ svg->table_size = table_size;
+
+ face->svg = svg;
+ face->root.face_flags |= FT_FACE_FLAG_SVG;
+
+ return FT_Err_Ok;
+
+ InvalidTable:
+ error = FT_THROW( Invalid_Table );
+
+ NoSVG:
+ FT_FRAME_RELEASE( table );
+ FT_FREE( svg );
+ face->svg = NULL;
+
+ return error;
+ }
+
+
+ FT_LOCAL_DEF( void )
+ tt_face_free_svg( TT_Face face )
+ {
+ FT_Memory memory = face->root.memory;
+ FT_Stream stream = face->root.stream;
+
+ Svg* svg = (Svg*)face->svg;
+
+
+ if ( svg )
+ {
+ FT_FRAME_RELEASE( svg->table );
+ FT_FREE( svg );
+ }
+ }
+
+
+ typedef struct Svg_doc_
+ {
+ FT_UShort start_glyph_id;
+ FT_UShort end_glyph_id;
+
+ FT_ULong offset;
+ FT_ULong length;
+
+ } Svg_doc;
+
+
+ static Svg_doc
+ extract_svg_doc( FT_Byte* stream )
+ {
+ Svg_doc doc;
+
+
+ doc.start_glyph_id = FT_NEXT_USHORT( stream );
+ doc.end_glyph_id = FT_NEXT_USHORT( stream );
+
+ doc.offset = FT_NEXT_ULONG( stream );
+ doc.length = FT_NEXT_ULONG( stream );
+
+ return doc;
+ }
+
+
+ static FT_Int
+ compare_svg_doc( Svg_doc doc,
+ FT_UInt glyph_index )
+ {
+ if ( glyph_index < doc.start_glyph_id )
+ return -1;
+ else if ( glyph_index > doc.end_glyph_id )
+ return 1;
+ else
+ return 0;
+ }
+
+
+ static FT_Error
+ find_doc( FT_Byte* stream,
+ FT_UShort num_entries,
+ FT_UInt glyph_index,
+ FT_ULong *doc_offset,
+ FT_ULong *doc_length,
+ FT_UShort *start_glyph,
+ FT_UShort *end_glyph )
+ {
+ FT_Error error;
+
+ Svg_doc start_doc;
+ Svg_doc mid_doc;
+ Svg_doc end_doc;
+
+ FT_Bool found = FALSE;
+ FT_UInt i = 0;
+
+ FT_UInt start_index = 0;
+ FT_UInt end_index = num_entries - 1;
+ FT_Int comp_res;
+
+
+ /* search algorithm */
+ if ( num_entries == 0 )
+ {
+ error = FT_THROW( Invalid_Table );
+ return error;
+ }
+
+ start_doc = extract_svg_doc( stream + start_index * 12 );
+ end_doc = extract_svg_doc( stream + end_index * 12 );
+
+ if ( ( compare_svg_doc( start_doc, glyph_index ) == -1 ) ||
+ ( compare_svg_doc( end_doc, glyph_index ) == 1 ) )
+ {
+ error = FT_THROW( Invalid_Glyph_Index );
+ return error;
+ }
+
+ while ( start_index <= end_index )
+ {
+ i = ( start_index + end_index ) / 2;
+ mid_doc = extract_svg_doc( stream + i * 12 );
+ comp_res = compare_svg_doc( mid_doc, glyph_index );
+
+ if ( comp_res == 1 )
+ {
+ start_index = i + 1;
+ start_doc = extract_svg_doc( stream + start_index * 4 );
+ }
+ else if ( comp_res == -1 )
+ {
+ end_index = i - 1;
+ end_doc = extract_svg_doc( stream + end_index * 4 );
+ }
+ else
+ {
+ found = TRUE;
+ break;
+ }
+ }
+ /* search algorithm end */
+
+ if ( found != TRUE )
+ {
+ FT_TRACE5(( "SVG glyph not found\n" ));
+ error = FT_THROW( Invalid_Glyph_Index );
+ }
+ else
+ {
+ *doc_offset = mid_doc.offset;
+ *doc_length = mid_doc.length;
+
+ *start_glyph = mid_doc.start_glyph_id;
+ *end_glyph = mid_doc.end_glyph_id;
+
+ error = FT_Err_Ok;
+ }
+
+ return error;
+ }
+
+
+ FT_LOCAL_DEF( FT_Error )
+ tt_face_load_svg_doc( FT_GlyphSlot glyph,
+ FT_UInt glyph_index )
+ {
+ FT_Byte* doc_list; /* pointer to the SVG doc list */
+ FT_UShort num_entries; /* total number of entries in doc list */
+ FT_ULong doc_offset;
+ FT_ULong doc_length;
+
+ FT_UShort start_glyph_id;
+ FT_UShort end_glyph_id;
+
+ FT_Error error = FT_Err_Ok;
+ TT_Face face = (TT_Face)glyph->face;
+ FT_Memory memory = face->root.memory;
+ Svg* svg = (Svg*)face->svg;
+
+ FT_SVG_Document svg_document = (FT_SVG_Document)glyph->other;
+
+
+ FT_ASSERT( !( svg == NULL ) );
+
+ doc_list = svg->svg_doc_list;
+ num_entries = FT_NEXT_USHORT( doc_list );
+
+ error = find_doc( doc_list, num_entries, glyph_index,
+ &doc_offset, &doc_length,
+ &start_glyph_id, &end_glyph_id );
+ if ( error != FT_Err_Ok )
+ goto Exit;
+
+ doc_list = svg->svg_doc_list; /* reset, so we can use it again */
+ doc_list = (FT_Byte*)( doc_list + doc_offset );
+
+ if ( ( doc_list[0] == 0x1F ) && ( doc_list[1] == 0x8B )
+ && ( doc_list[2] == 0x08 ) )
+ {
+#ifdef FT_CONFIG_OPTION_USE_ZLIB
+
+ FT_ULong uncomp_size;
+ FT_Byte* uncomp_buffer = NULL;
+
+
+ /*
+ * Get the size of the original document. This helps in allotting the
+ * buffer to accommodate the uncompressed version. The last 4 bytes
+ * of the compressed document are equal to the original size modulo
+ * 2^32. Since the size of SVG documents is less than 2^32 bytes we
+ * can use this accurately. The four bytes are stored in
+ * little-endian format.
+ */
+ FT_TRACE4(( "SVG document is GZIP compressed\n" ));
+ uncomp_size = (FT_ULong)doc_list[doc_length - 1] << 24 |
+ (FT_ULong)doc_list[doc_length - 2] << 16 |
+ (FT_ULong)doc_list[doc_length - 3] << 8 |
+ (FT_ULong)doc_list[doc_length - 4];
+
+ if ( FT_QALLOC( uncomp_buffer, uncomp_size ) )
+ goto Exit;
+
+ error = FT_Gzip_Uncompress( memory,
+ uncomp_buffer,
+ &uncomp_size,
+ doc_list,
+ doc_length );
+ if ( error )
+ {
+ FT_FREE( uncomp_buffer );
+ error = FT_THROW( Invalid_Table );
+ goto Exit;
+ }
+
+ glyph->internal->flags |= FT_GLYPH_OWN_GZIP_SVG;
+
+ doc_list = uncomp_buffer;
+ doc_length = uncomp_size;
+
+#else /* !FT_CONFIG_OPTION_USE_ZLIB */
+
+ error = FT_THROW( Unimplemented_Feature );
+ goto Exit;
+
+#endif /* !FT_CONFIG_OPTION_USE_ZLIB */
+ }
+
+ svg_document->svg_document = doc_list;
+ svg_document->svg_document_length = doc_length;
+
+ svg_document->metrics = glyph->face->size->metrics;
+ svg_document->units_per_EM = glyph->face->units_per_EM;
+
+ svg_document->start_glyph_id = start_glyph_id;
+ svg_document->end_glyph_id = end_glyph_id;
+
+ svg_document->transform.xx = 0x10000;
+ svg_document->transform.xy = 0;
+ svg_document->transform.yx = 0;
+ svg_document->transform.yy = 0x10000;
+
+ svg_document->delta.x = 0;
+ svg_document->delta.y = 0;
+
+ FT_TRACE5(( "start_glyph_id: %d\n", start_glyph_id ));
+ FT_TRACE5(( "end_glyph_id: %d\n", end_glyph_id ));
+ FT_TRACE5(( "svg_document:\n" ));
+ FT_TRACE5(( " %.*s\n", (FT_UInt)doc_length, doc_list ));
+
+ glyph->other = svg_document;
+
+ Exit:
+ return error;
+ }
+
+#else /* !FT_CONFIG_OPTION_SVG */
+
+ /* ANSI C doesn't like empty source files */
+ typedef int _tt_svg_dummy;
+
+#endif /* !FT_CONFIG_OPTION_SVG */
+
+
+/* END */
diff --git a/freetype/src/sfnt/ttsvg.h b/freetype/src/sfnt/ttsvg.h
new file mode 100644
index 00000000..7c234fd5
--- /dev/null
+++ b/freetype/src/sfnt/ttsvg.h
@@ -0,0 +1,43 @@
+/****************************************************************************
+ *
+ * ttsvg.h
+ *
+ * OpenType SVG Color (specification).
+ *
+ * Copyright (C) 2022 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * 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 TTSVG_H_
+#define TTSVG_H_
+
+#include <freetype/internal/ftstream.h>
+#include <freetype/internal/tttypes.h>
+
+
+FT_BEGIN_HEADER
+
+ FT_LOCAL( FT_Error )
+ tt_face_load_svg( TT_Face face,
+ FT_Stream stream );
+
+ FT_LOCAL( void )
+ tt_face_free_svg( TT_Face face );
+
+ FT_LOCAL( FT_Error )
+ tt_face_load_svg_doc( FT_GlyphSlot glyph,
+ FT_UInt glyph_index );
+
+FT_END_HEADER
+
+#endif /* TTSVG_H_ */
+
+
+/* END */
diff --git a/freetype/src/sfnt/woff2tags.c b/freetype/src/sfnt/woff2tags.c
index fe8f5cf7..7d79fef3 100644
--- a/freetype/src/sfnt/woff2tags.c
+++ b/freetype/src/sfnt/woff2tags.c
@@ -4,7 +4,7 @@
*
* WOFF2 Font table tags (base).
*
- * Copyright (C) 2019-2021 by
+ * Copyright (C) 2019-2022 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/sfnt/woff2tags.h b/freetype/src/sfnt/woff2tags.h
index 4ef0a651..05df85ab 100644
--- a/freetype/src/sfnt/woff2tags.h
+++ b/freetype/src/sfnt/woff2tags.h
@@ -4,7 +4,7 @@
*
* WOFF2 Font table tags (specification).
*
- * Copyright (C) 2019-2021 by
+ * Copyright (C) 2019-2022 by
* Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/smooth/ftgrays.c b/freetype/src/smooth/ftgrays.c
index d982c282..622035aa 100644
--- a/freetype/src/smooth/ftgrays.c
+++ b/freetype/src/smooth/ftgrays.c
@@ -4,7 +4,7 @@
*
* A new `perfect' anti-aliasing renderer (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -333,7 +333,9 @@ typedef ptrdiff_t FT_PtrDist;
#define PIXEL_BITS 8
#define ONE_PIXEL ( 1 << PIXEL_BITS )
+#undef TRUNC
#define TRUNC( x ) (TCoord)( (x) >> PIXEL_BITS )
+#undef FRACT
#define FRACT( x ) (TCoord)( (x) & ( ONE_PIXEL - 1 ) )
#if PIXEL_BITS >= 6
diff --git a/freetype/src/smooth/ftgrays.h b/freetype/src/smooth/ftgrays.h
index 3dad0498..13bf2baa 100644
--- a/freetype/src/smooth/ftgrays.h
+++ b/freetype/src/smooth/ftgrays.h
@@ -4,7 +4,7 @@
*
* FreeType smooth renderer declaration
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/smooth/ftsmerrs.h b/freetype/src/smooth/ftsmerrs.h
index dc2c40cc..7bc60779 100644
--- a/freetype/src/smooth/ftsmerrs.h
+++ b/freetype/src/smooth/ftsmerrs.h
@@ -4,7 +4,7 @@
*
* smooth renderer error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/smooth/ftsmooth.c b/freetype/src/smooth/ftsmooth.c
index bea3b4a8..df227c37 100644
--- a/freetype/src/smooth/ftsmooth.c
+++ b/freetype/src/smooth/ftsmooth.c
@@ -4,7 +4,7 @@
*
* Anti-aliasing renderer interface (body).
*
- * Copyright (C) 2000-2021 by
+ * Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/smooth/ftsmooth.h b/freetype/src/smooth/ftsmooth.h
index 2dd81e84..87f09fae 100644
--- a/freetype/src/smooth/ftsmooth.h
+++ b/freetype/src/smooth/ftsmooth.h
@@ -4,7 +4,7 @@
*
* Anti-aliasing renderer interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/smooth/module.mk b/freetype/src/smooth/module.mk
index ec6537f1..76235513 100644
--- a/freetype/src/smooth/module.mk
+++ b/freetype/src/smooth/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/smooth/rules.mk b/freetype/src/smooth/rules.mk
index de701d91..d5109313 100644
--- a/freetype/src/smooth/rules.mk
+++ b/freetype/src/smooth/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/smooth/smooth.c b/freetype/src/smooth/smooth.c
index 9e254406..f341e8f2 100644
--- a/freetype/src/smooth/smooth.c
+++ b/freetype/src/smooth/smooth.c
@@ -4,7 +4,7 @@
*
* FreeType anti-aliasing rasterer module component (body only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/svg/ftsvg.c b/freetype/src/svg/ftsvg.c
new file mode 100644
index 00000000..55c50718
--- /dev/null
+++ b/freetype/src/svg/ftsvg.c
@@ -0,0 +1,350 @@
+/****************************************************************************
+ *
+ * ftsvg.c
+ *
+ * The FreeType SVG renderer interface (body).
+ *
+ * Copyright (C) 2022 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * 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.
+ *
+ */
+
+#include <freetype/internal/ftdebug.h>
+#include <freetype/internal/ftserv.h>
+#include <freetype/internal/services/svprop.h>
+#include <freetype/otsvg.h>
+#include <freetype/internal/svginterface.h>
+#include <freetype/ftbbox.h>
+
+#include "ftsvg.h"
+#include "svgtypes.h"
+
+
+ /**************************************************************************
+ *
+ * The macro FT_COMPONENT is used in trace mode. It is an implicit
+ * parameter of the FT_TRACE() and FT_ERROR() macros, usued to print/log
+ * messages during execution.
+ */
+#undef FT_COMPONENT
+#define FT_COMPONENT otsvg
+
+
+#ifdef FT_CONFIG_OPTION_SVG
+
+ /* ft_svg_init */
+ static FT_Error
+ ft_svg_init( SVG_Renderer svg_module )
+ {
+ FT_Error error = FT_Err_Ok;
+
+
+ svg_module->loaded = FALSE;
+ svg_module->hooks_set = FALSE;
+
+ return error;
+ }
+
+
+ static void
+ ft_svg_done( SVG_Renderer svg_module )
+ {
+ if ( svg_module->loaded == TRUE &&
+ svg_module->hooks_set == TRUE )
+ svg_module->hooks.free_svg( &svg_module->state );
+
+ svg_module->loaded = FALSE;
+ }
+
+
+ static FT_Error
+ ft_svg_preset_slot( FT_Module module,
+ FT_GlyphSlot slot,
+ FT_Bool cache )
+ {
+ SVG_Renderer svg_renderer = (SVG_Renderer)module;
+ SVG_RendererHooks hooks = svg_renderer->hooks;
+
+
+ if ( svg_renderer->hooks_set == FALSE )
+ {
+ FT_TRACE1(( "Hooks are NOT set. Can't render OT-SVG glyphs\n" ));
+ return FT_THROW( Missing_SVG_Hooks );
+ }
+
+ if ( svg_renderer->loaded == FALSE )
+ {
+ FT_TRACE3(( "ft_svg_preset_slot: first presetting call,"
+ " calling init hook\n" ));
+ hooks.init_svg( &svg_renderer->state );
+
+ svg_renderer->loaded = TRUE;
+ }
+
+ return hooks.preset_slot( slot, cache, &svg_renderer->state );
+ }
+
+
+ static FT_Error
+ ft_svg_render( FT_Renderer renderer,
+ FT_GlyphSlot slot,
+ FT_Render_Mode mode,
+ const FT_Vector* origin )
+ {
+ SVG_Renderer svg_renderer = (SVG_Renderer)renderer;
+
+ FT_Library library = renderer->root.library;
+ FT_Memory memory = library->memory;
+ FT_Error error;
+
+ FT_ULong size_image_buffer;
+
+ SVG_RendererHooks hooks = svg_renderer->hooks;
+
+
+ FT_UNUSED( mode );
+ FT_UNUSED( origin );
+
+ if ( mode != FT_RENDER_MODE_NORMAL )
+ return FT_THROW( Bad_Argument );
+
+ if ( svg_renderer->hooks_set == FALSE )
+ {
+ FT_TRACE1(( "Hooks are NOT set. Can't render OT-SVG glyphs\n" ));
+ return FT_THROW( Missing_SVG_Hooks );
+ }
+
+ if ( svg_renderer->loaded == FALSE )
+ {
+ FT_TRACE3(( "ft_svg_render: first rendering, calling init hook\n" ));
+ error = hooks.init_svg( &svg_renderer->state );
+
+ svg_renderer->loaded = TRUE;
+ }
+
+ ft_svg_preset_slot( (FT_Module)renderer, slot, TRUE );
+
+ size_image_buffer = (FT_ULong)slot->bitmap.pitch * slot->bitmap.rows;
+ /* No `FT_QALLOC` here since we need a clean, empty canvas */
+ /* to start with. */
+ if ( FT_ALLOC( slot->bitmap.buffer, size_image_buffer ) )
+ return error;
+
+ error = hooks.render_svg( slot, &svg_renderer->state );
+ if ( error )
+ FT_FREE( slot->bitmap.buffer );
+ else
+ slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
+
+ return error;
+ }
+
+
+ static const SVG_Interface svg_interface =
+ {
+ (Preset_Bitmap_Func)ft_svg_preset_slot
+ };
+
+
+ static FT_Error
+ ft_svg_property_set( FT_Module module,
+ const char* property_name,
+ const void* value,
+ FT_Bool value_is_string )
+ {
+ FT_Error error = FT_Err_Ok;
+ SVG_Renderer renderer = (SVG_Renderer)module;
+
+
+ if ( !ft_strcmp( property_name, "svg-hooks" ) )
+ {
+ SVG_RendererHooks* hooks;
+
+
+ if ( value_is_string == TRUE )
+ {
+ error = FT_THROW( Invalid_Argument );
+ goto Exit;
+ }
+
+ hooks = (SVG_RendererHooks*)value;
+
+ if ( !hooks->init_svg ||
+ !hooks->free_svg ||
+ !hooks->render_svg ||
+ !hooks->preset_slot )
+ {
+ FT_TRACE0(( "ft_svg_property_set:"
+ " SVG rendering hooks not set because\n" ));
+ FT_TRACE0(( " "
+ " at least one function pointer is NULL\n" ));
+
+ error = FT_THROW( Invalid_Argument );
+ goto Exit;
+ }
+
+ renderer->hooks = *hooks;
+ renderer->hooks_set = TRUE;
+ }
+ else
+ error = FT_THROW( Missing_Property );
+
+ Exit:
+ return error;
+ }
+
+
+ static FT_Error
+ ft_svg_property_get( FT_Module module,
+ const char* property_name,
+ const void* value )
+ {
+ FT_Error error = FT_Err_Ok;
+ SVG_Renderer renderer = (SVG_Renderer)module;
+
+
+ if ( !ft_strcmp( property_name, "svg-hooks" ) )
+ {
+ SVG_RendererHooks* hooks = (SVG_RendererHooks*)value;
+
+
+ *hooks = renderer->hooks;
+ }
+ else
+ error = FT_THROW( Missing_Property );
+
+ return error;
+ }
+
+
+ FT_DEFINE_SERVICE_PROPERTIESREC(
+ ft_svg_service_properties,
+
+ (FT_Properties_SetFunc)ft_svg_property_set, /* set_property */
+ (FT_Properties_GetFunc)ft_svg_property_get /* get_property */
+ )
+
+
+ FT_DEFINE_SERVICEDESCREC1(
+ ft_svg_services,
+ FT_SERVICE_ID_PROPERTIES, &ft_svg_service_properties )
+
+
+ FT_CALLBACK_DEF( FT_Module_Interface )
+ ft_svg_get_interface( FT_Module module,
+ const char* ft_svg_interface )
+ {
+ FT_Module_Interface result;
+
+
+ FT_UNUSED( module );
+
+ result = ft_service_list_lookup( ft_svg_services, ft_svg_interface );
+ if ( result )
+ return result;
+
+ return 0;
+ }
+
+
+ static FT_Error
+ ft_svg_transform( FT_Renderer renderer,
+ FT_GlyphSlot slot,
+ const FT_Matrix* _matrix,
+ const FT_Vector* _delta )
+ {
+ FT_SVG_Document doc = (FT_SVG_Document)slot->other;
+ FT_Matrix* matrix = (FT_Matrix*)_matrix;
+ FT_Vector* delta = (FT_Vector*)_delta;
+
+ FT_Matrix tmp_matrix;
+ FT_Vector tmp_delta;
+
+ FT_Matrix a, b;
+ FT_Pos x, y;
+
+
+ FT_UNUSED( renderer );
+
+ if ( !matrix )
+ {
+ tmp_matrix.xx = 0x10000;
+ tmp_matrix.xy = 0;
+ tmp_matrix.yx = 0;
+ tmp_matrix.yy = 0x10000;
+
+ matrix = &tmp_matrix;
+ }
+
+ if ( !delta )
+ {
+ tmp_delta.x = 0;
+ tmp_delta.y = 0;
+
+ delta = &tmp_delta;
+ }
+
+ a = doc->transform;
+ b = *matrix;
+ FT_Matrix_Multiply( &b, &a );
+
+
+ x = ADD_LONG( ADD_LONG( FT_MulFix( matrix->xx, doc->delta.x ),
+ FT_MulFix( matrix->xy, doc->delta.y ) ),
+ delta->x );
+ y = ADD_LONG( ADD_LONG( FT_MulFix( matrix->yx, doc->delta.x ),
+ FT_MulFix( matrix->yy, doc->delta.y ) ),
+ delta->y );
+
+ doc->delta.x = x;
+ doc->delta.y = y;
+ doc->transform = a;
+
+ return FT_Err_Ok;
+ }
+
+#endif /* FT_CONFIG_OPTION_SVG */
+
+
+#ifdef FT_CONFIG_OPTION_SVG
+#define PUT_SVG_MODULE( a ) a
+#define SVG_GLYPH_FORMAT FT_GLYPH_FORMAT_SVG
+#else
+#define PUT_SVG_MODULE( a ) NULL
+#define SVG_GLYPH_FORMAT FT_GLYPH_FORMAT_NONE
+#endif
+
+
+ FT_DEFINE_RENDERER(
+ ft_svg_renderer_class,
+
+ FT_MODULE_RENDERER,
+ sizeof ( SVG_RendererRec ),
+
+ "ot-svg",
+ 0x10000L,
+ 0x20000L,
+
+ (const void*)PUT_SVG_MODULE( &svg_interface ), /* module specific interface */
+
+ (FT_Module_Constructor)PUT_SVG_MODULE( ft_svg_init ), /* module_init */
+ (FT_Module_Destructor)PUT_SVG_MODULE( ft_svg_done ), /* module_done */
+ PUT_SVG_MODULE( ft_svg_get_interface ), /* get_interface */
+
+ SVG_GLYPH_FORMAT,
+
+ (FT_Renderer_RenderFunc) PUT_SVG_MODULE( ft_svg_render ), /* render_glyph */
+ (FT_Renderer_TransformFunc)PUT_SVG_MODULE( ft_svg_transform ), /* transform_glyph */
+ NULL, /* get_glyph_cbox */
+ NULL, /* set_mode */
+ NULL /* raster_class */
+ )
+
+
+/* END */
diff --git a/freetype/src/svg/ftsvg.h b/freetype/src/svg/ftsvg.h
new file mode 100644
index 00000000..73514b8c
--- /dev/null
+++ b/freetype/src/svg/ftsvg.h
@@ -0,0 +1,35 @@
+/****************************************************************************
+ *
+ * ftsvg.h
+ *
+ * The FreeType SVG renderer interface (specification).
+ *
+ * Copyright (C) 2022 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * 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 FTSVG_H_
+#define FTSVG_H_
+
+#include <ft2build.h>
+#include <freetype/ftrender.h>
+#include <freetype/internal/ftobjs.h>
+
+
+FT_BEGIN_HEADER
+
+ FT_DECLARE_RENDERER( ft_svg_renderer_class )
+
+FT_END_HEADER
+
+#endif /* FTSVG_H_ */
+
+
+/* END */
diff --git a/freetype/src/svg/module.mk b/freetype/src/svg/module.mk
new file mode 100644
index 00000000..30c35257
--- /dev/null
+++ b/freetype/src/svg/module.mk
@@ -0,0 +1,23 @@
+#
+# FreeType 2 SVG renderer module definition
+#
+
+
+# Copyright (C) 2022 by
+# David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+#
+# 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.
+
+
+FTMODULE_H_COMMANDS += SVG_MODULE
+
+define SVG_MODULE
+$(OPEN_DRIVER) FT_Renderer_Class, ft_svg_renderer_class $(CLOSE_DRIVER)
+$(ECHO_DRIVER)ot-svg $(ECHO_DRIVER_DESC)OT-SVG glyph renderer module$(ECHO_DRIVER_DONE)
+endef
+
+# EOF
diff --git a/freetype/src/svg/rules.mk b/freetype/src/svg/rules.mk
new file mode 100644
index 00000000..9c53128c
--- /dev/null
+++ b/freetype/src/svg/rules.mk
@@ -0,0 +1,70 @@
+#
+# FreeType 2 SVG renderer module build rules
+#
+
+
+# Copyright (C) 2022 by
+# David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+#
+# 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.
+
+
+# SVG renderer driver directory
+#
+SVG_DIR := $(SRC_DIR)/svg
+
+# compilation flags for the driver
+#
+SVG_COMPILE := $(CC) $(ANSIFLAGS) \
+ $I$(subst /,$(COMPILER_SEP),$(SVG_DIR)) \
+ $(INCLUDE_FLAGS) \
+ $(FT_CFLAGS)
+
+# SVG renderer sources (i.e., C files)
+#
+SVG_DRV_SRC := $(SVG_DIR)/ftsvg.c
+
+
+# SVG renderer headers
+#
+SVG_DRV_H := $(SVG_DIR)/ftsvg.h \
+ $(SVG_DIR)/svgtypes.h
+
+
+# SVG renderer object(s)
+#
+# SVG_DRV_OBJ_M is used during `multi' builds.
+# SVG_DRV_OBJ_S is used during `single' builds.
+#
+SVG_DRV_OBJ_M := $(SVG_DRV_SRC:$(SVG_DIR)/%.c=$(OBJ_DIR)/%.$O)
+SVG_DRV_OBJ_S := $(OBJ_DIR)/svg.$O
+
+# SVG renderer source file for single build
+#
+SVG_DRV_SRC_S := $(SVG_DIR)/svg.c
+
+
+# SVG renderer - single object
+#
+$(SVG_DRV_OBJ_S): $(SVG_DRV_SRC_S) $(SVG_DRV_SRC) \
+ $(FREETYPE_H) $(SVG_DRV_H)
+ $(SVG_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $(SVG_DRV_SRC_S))
+
+
+# SVG renderer - multiple objects
+#
+$(OBJ_DIR)/%.$O: $(SVG_DIR)/%.c $(FREETYPE_H) $(SVG_DRV_H)
+ $(SVG_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
+
+
+# update main driver object lists
+#
+DRV_OBJS_S += $(SVG_DRV_OBJ_S)
+DRV_OBJS_M += $(SVG_DRV_OBJ_M)
+
+
+# EOF
diff --git a/freetype/src/svg/svg.c b/freetype/src/svg/svg.c
new file mode 100644
index 00000000..b7e62a41
--- /dev/null
+++ b/freetype/src/svg/svg.c
@@ -0,0 +1,24 @@
+/****************************************************************************
+ *
+ * svg.c
+ *
+ * FreeType SVG renderer module component (body only).
+ *
+ * Copyright (C) 2022 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * 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.
+ *
+ */
+
+#define FT_MAKE_OPTION_SINGLE_OBJECT
+
+#include "svgtypes.h"
+#include "ftsvg.c"
+
+
+/* END */
diff --git a/freetype/src/svg/svgtypes.h b/freetype/src/svg/svgtypes.h
new file mode 100644
index 00000000..34fce47a
--- /dev/null
+++ b/freetype/src/svg/svgtypes.h
@@ -0,0 +1,42 @@
+/****************************************************************************
+ *
+ * svgtypes.h
+ *
+ * The FreeType SVG renderer internal types (specification).
+ *
+ * Copyright (C) 2022 by
+ * David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
+ *
+ * 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 SVGTYPES_H_
+#define SVGTYPES_H_
+
+#include <ft2build.h>
+#include <freetype/internal/ftobjs.h>
+#include <freetype/ftrender.h>
+#include <freetype/otsvg.h>
+
+
+ typedef struct SVG_RendererRec_
+ {
+ FT_RendererRec root; /* this inherits FT_RendererRec */
+ FT_Bool loaded;
+ FT_Bool hooks_set;
+ SVG_RendererHooks hooks; /* this holds hooks for SVG rendering */
+ FT_Pointer state; /* a place for hooks to store state, if needed */
+
+ } SVG_RendererRec;
+
+ typedef struct SVG_RendererRec_* SVG_Renderer;
+
+#endif /* SVGTYPES_H_ */
+
+
+/* EOF */
diff --git a/freetype/src/tools/afblue.pl b/freetype/src/tools/afblue.pl
index 95481627..f4f3845e 100644
--- a/freetype/src/tools/afblue.pl
+++ b/freetype/src/tools/afblue.pl
@@ -5,7 +5,7 @@
#
# Process a blue zone character data file.
#
-# Copyright (C) 2013-2021 by
+# Copyright (C) 2013-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/tools/glnames.py b/freetype/src/tools/glnames.py
index c6f2f278..ad7786d2 100644
--- a/freetype/src/tools/glnames.py
+++ b/freetype/src/tools/glnames.py
@@ -6,7 +6,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/tools/update-copyright-year b/freetype/src/tools/update-copyright-year
index 69d63b60..f699db76 100755
--- a/freetype/src/tools/update-copyright-year
+++ b/freetype/src/tools/update-copyright-year
@@ -2,7 +2,7 @@ eval '(exit $?0)' && eval 'exec perl -wS -i "$0" ${1+"$@"}'
& eval 'exec perl -wS -i "$0" $argv:q'
if 0;
-# Copyright (C) 2015-2021 by
+# Copyright (C) 2015-2022 by
# Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/truetype/module.mk b/freetype/src/truetype/module.mk
index 485ef05c..f6e1c91a 100644
--- a/freetype/src/truetype/module.mk
+++ b/freetype/src/truetype/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/truetype/rules.mk b/freetype/src/truetype/rules.mk
index cfd6b3b2..d0d2404b 100644
--- a/freetype/src/truetype/rules.mk
+++ b/freetype/src/truetype/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/truetype/truetype.c b/freetype/src/truetype/truetype.c
index 4232aca6..41c844ac 100644
--- a/freetype/src/truetype/truetype.c
+++ b/freetype/src/truetype/truetype.c
@@ -4,7 +4,7 @@
*
* FreeType TrueType driver component (body only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/truetype/ttdriver.c b/freetype/src/truetype/ttdriver.c
index 6fcfdb23..245d97cb 100644
--- a/freetype/src/truetype/ttdriver.c
+++ b/freetype/src/truetype/ttdriver.c
@@ -4,7 +4,7 @@
*
* TrueType font driver implementation (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/truetype/ttdriver.h b/freetype/src/truetype/ttdriver.h
index 4e6d52d2..c477c0b1 100644
--- a/freetype/src/truetype/ttdriver.h
+++ b/freetype/src/truetype/ttdriver.h
@@ -4,7 +4,7 @@
*
* High-level TrueType driver interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/truetype/tterrors.h b/freetype/src/truetype/tterrors.h
index 0ce247e3..2c95ea17 100644
--- a/freetype/src/truetype/tterrors.h
+++ b/freetype/src/truetype/tterrors.h
@@ -4,7 +4,7 @@
*
* TrueType error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/truetype/ttgload.c b/freetype/src/truetype/ttgload.c
index 11968f6f..2ca63d65 100644
--- a/freetype/src/truetype/ttgload.c
+++ b/freetype/src/truetype/ttgload.c
@@ -4,7 +4,7 @@
*
* TrueType Glyph Loader (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -1104,8 +1104,8 @@
for ( ; vec < limit; vec++, u++ )
{
- vec->x = ( FT_MulFix( u->x, x_scale ) + 32 ) >> 6;
- vec->y = ( FT_MulFix( u->y, y_scale ) + 32 ) >> 6;
+ vec->x = ADD_LONG( FT_MulFix( u->x, x_scale ), 32 ) >> 6;
+ vec->y = ADD_LONG( FT_MulFix( u->y, y_scale ), 32 ) >> 6;
}
}
else
@@ -1228,8 +1228,8 @@
p1 = gloader->base.outline.points + k;
p2 = gloader->base.outline.points + l;
- x = p1->x - p2->x;
- y = p1->y - p2->y;
+ x = SUB_LONG( p1->x, p2->x );
+ y = SUB_LONG( p1->y, p2->y );
}
else
{
@@ -2230,10 +2230,6 @@
FT_UInt glyph_index )
{
TT_Face face = loader->face;
-#if defined TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY || \
- defined TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( face );
-#endif
FT_BBox bbox;
FT_Fixed y_scale;
@@ -2256,53 +2252,10 @@
glyph->metrics.horiBearingX = bbox.xMin;
glyph->metrics.horiBearingY = bbox.yMax;
- glyph->metrics.horiAdvance = SUB_LONG(loader->pp2.x, loader->pp1.x);
-
- /* Adjust advance width to the value contained in the hdmx table */
- /* unless FT_LOAD_COMPUTE_METRICS is set or backward compatibility */
- /* mode of the v40 interpreter is active. See `ttinterp.h' for */
- /* details on backward compatibility mode. */
- if (
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
- ( loader->exec && loader->exec->backward_compatibility ) ) &&
-#endif
- !face->postscript.isFixedPitch &&
- IS_HINTED( loader->load_flags ) &&
- !( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) )
- {
- FT_Byte* widthp;
-
-
- widthp = tt_face_get_device_metrics( face,
- size->metrics->x_ppem,
- glyph_index );
-
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
-
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 )
- {
- FT_Bool ignore_x_mode;
-
-
- ignore_x_mode = FT_BOOL( FT_LOAD_TARGET_MODE( loader->load_flags ) !=
- FT_RENDER_MODE_MONO );
-
- if ( widthp &&
- ( ( ignore_x_mode && loader->exec->compatible_widths ) ||
- !ignore_x_mode ||
- SPH_OPTION_BITMAP_WIDTHS ) )
- glyph->metrics.horiAdvance = *widthp * 64;
- }
- else
-
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
-
- {
- if ( widthp )
- glyph->metrics.horiAdvance = *widthp * 64;
- }
- }
+ if ( loader->widthp )
+ glyph->metrics.horiAdvance = loader->widthp[glyph_index] * 64;
+ else
+ glyph->metrics.horiAdvance = SUB_LONG( loader->pp2.x, loader->pp1.x );
/* set glyph dimensions */
glyph->metrics.width = SUB_LONG( bbox.xMax, bbox.xMin );
@@ -2735,12 +2688,58 @@
/* note that this flag can also be modified in a glyph's bytecode */
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
exec->GS.instruct_control & 4 )
- exec->ignore_x_mode = 0;
-#endif
+ exec->ignore_x_mode = FALSE;
+#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
+
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+ /*
+ * Toggle backward compatibility according to what font wants, except
+ * when
+ *
+ * 1) we have a `tricky' font that heavily relies on the interpreter to
+ * render glyphs correctly, for example DFKai-SB, or
+ * 2) FT_RENDER_MODE_MONO (i.e, monochome rendering) is requested.
+ *
+ * In those cases, backward compatibility needs to be turned off to get
+ * correct rendering. The rendering is then completely up to the
+ * font's programming.
+ *
+ */
+ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
+ subpixel_hinting_lean &&
+ !FT_IS_TRICKY( glyph->face ) )
+ exec->backward_compatibility = !( exec->GS.instruct_control & 4 );
+ else
+ exec->backward_compatibility = FALSE;
+#endif /* TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL */
exec->pedantic_hinting = FT_BOOL( load_flags & FT_LOAD_PEDANTIC );
loader->exec = exec;
loader->instructions = exec->glyphIns;
+
+ /* Use the hdmx table if any unless FT_LOAD_COMPUTE_METRICS */
+ /* is set or backward compatibility mode of the v38 or v40 */
+ /* interpreters is active. See `ttinterp.h' for details on */
+ /* backward compatibility mode. */
+ if ( IS_HINTED( loader->load_flags ) &&
+ !( loader->load_flags & FT_LOAD_COMPUTE_METRICS ) &&
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+ !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
+ exec->backward_compatibility ) &&
+#endif
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
+ !( driver->interpreter_version == TT_INTERPRETER_VERSION_38 &&
+ !SPH_OPTION_BITMAP_WIDTHS &&
+ FT_LOAD_TARGET_MODE( loader->load_flags ) !=
+ FT_RENDER_MODE_MONO &&
+ exec->compatible_widths ) &&
+#endif
+ !face->postscript.isFixedPitch )
+ {
+ loader->widthp = size->widthp;
+ }
+ else
+ loader->widthp = NULL;
}
#endif /* TT_USE_BYTECODE_INTERPRETER */
@@ -2788,11 +2787,12 @@
* A function used to load a single glyph within a given glyph slot,
* for a given size.
*
- * @Input:
+ * @InOut:
* glyph ::
* A handle to a target slot object where the glyph
* will be loaded.
*
+ * @Input:
* size ::
* A handle to the source face size at which the glyph
* must be scaled/loaded.
@@ -2897,8 +2897,12 @@
}
else
{
- if ( FT_IS_SCALABLE( glyph->face ) )
+ if ( FT_IS_SCALABLE( glyph->face ) ||
+ FT_HAS_SBIX( glyph->face ) )
{
+ TT_Face face = (TT_Face)glyph->face;
+
+
/* for the bbox we need the header only */
(void)tt_loader_init( &loader, size, glyph, load_flags, TRUE );
(void)load_truetype_glyph( &loader, glyph_index, 0, TRUE );
@@ -2906,6 +2910,35 @@
glyph->linearHoriAdvance = loader.linear;
glyph->linearVertAdvance = loader.vadvance;
+ /* Bitmaps from the 'sbix' table need special treatment: */
+ /* if there is a glyph contour, the bitmap origin must be */
+ /* shifted to be relative to the lower left corner of the */
+ /* glyph bounding box, also taking the left-side bearing */
+ /* (or top bearing) into account. */
+ if ( face->sbit_table_type == TT_SBIT_TABLE_TYPE_SBIX &&
+ loader.n_contours > 0 )
+ {
+ FT_Int bitmap_left;
+ FT_Int bitmap_top;
+
+
+ if ( load_flags & FT_LOAD_VERTICAL_LAYOUT )
+ {
+ /* This is a guess, since Apple's CoreText engine doesn't */
+ /* really do vertical typesetting. */
+ bitmap_left = loader.bbox.xMin;
+ bitmap_top = loader.top_bearing;
+ }
+ else
+ {
+ bitmap_left = loader.left_bearing;
+ bitmap_top = loader.bbox.yMin;
+ }
+
+ glyph->bitmap_left += FT_MulFix( bitmap_left, x_scale ) >> 6;
+ glyph->bitmap_top += FT_MulFix( bitmap_top, y_scale ) >> 6;
+ }
+
/* sanity checks: if `xxxAdvance' in the sbit metric */
/* structure isn't set, use `linearXXXAdvance' */
if ( !glyph->metrics.horiAdvance && glyph->linearHoriAdvance )
@@ -2920,6 +2953,12 @@
}
}
+ if ( load_flags & FT_LOAD_SBITS_ONLY )
+ {
+ error = FT_THROW( Invalid_Argument );
+ goto Exit;
+ }
+
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
/* if FT_LOAD_NO_SCALE is not set, `ttmetrics' must be valid */
@@ -2929,16 +2968,81 @@
goto Exit;
}
- if ( load_flags & FT_LOAD_SBITS_ONLY )
+#ifdef FT_CONFIG_OPTION_SVG
+
+ /* check for OT-SVG */
+ if ( ( load_flags & FT_LOAD_COLOR ) && ( (TT_Face)glyph->face )->svg )
+ {
+ SFNT_Service sfnt;
+
+ FT_Short leftBearing;
+ FT_Short topBearing;
+ FT_UShort advanceX;
+ FT_UShort advanceY;
+
+
+ FT_TRACE3(( "Trying to load SVG glyph\n" ));
+ sfnt = (SFNT_Service)( (TT_Face)glyph->face )->sfnt;
+
+ error = sfnt->load_svg_doc( glyph, glyph_index );
+ if ( !error )
+ {
+ TT_Face face = (TT_Face)glyph->face;
+
+
+ FT_TRACE3(( "Successfully loaded SVG glyph\n" ));
+
+ glyph->format = FT_GLYPH_FORMAT_SVG;
+
+ sfnt->get_metrics( face,
+ FALSE,
+ glyph_index,
+ &leftBearing,
+ &advanceX );
+ sfnt->get_metrics( face,
+ TRUE,
+ glyph_index,
+ &topBearing,
+ &advanceY );
+
+ advanceX = (FT_UShort)FT_MulDiv( advanceX,
+ glyph->face->size->metrics.x_ppem,
+ glyph->face->units_per_EM );
+ advanceY = (FT_UShort)FT_MulDiv( advanceY,
+ glyph->face->size->metrics.y_ppem,
+ glyph->face->units_per_EM );
+
+ glyph->metrics.horiAdvance = advanceX << 6;
+ glyph->metrics.vertAdvance = advanceY << 6;
+
+ return error;
+ }
+
+ FT_TRACE3(( "Failed to load SVG glyph\n" ));
+ }
+
+ /* return immediately if we only want SVG glyphs */
+ if ( load_flags & FT_LOAD_SVG_ONLY )
{
error = FT_THROW( Invalid_Argument );
goto Exit;
}
+#endif /* FT_CONFIG_OPTION_SVG */
+
error = tt_loader_init( &loader, size, glyph, load_flags, FALSE );
if ( error )
goto Exit;
+ /* done if we are only interested in the `hdmx` advance */
+ if ( load_flags & FT_LOAD_ADVANCE_ONLY &&
+ !( load_flags & FT_LOAD_VERTICAL_LAYOUT ) &&
+ loader.widthp )
+ {
+ glyph->metrics.horiAdvance = loader.widthp[glyph_index] * 64;
+ goto Done;
+ }
+
glyph->format = FT_GLYPH_FORMAT_OUTLINE;
glyph->num_subglyphs = 0;
glyph->outline.flags = 0;
@@ -3017,6 +3121,7 @@
glyph->outline.n_points,
glyph->outline.flags ));
+ Done:
tt_loader_done( &loader );
Exit:
diff --git a/freetype/src/truetype/ttgload.h b/freetype/src/truetype/ttgload.h
index 78fdeaa7..3195351f 100644
--- a/freetype/src/truetype/ttgload.h
+++ b/freetype/src/truetype/ttgload.h
@@ -4,7 +4,7 @@
*
* TrueType Glyph Loader (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/truetype/ttgxvar.c b/freetype/src/truetype/ttgxvar.c
index 7f2db0cb..6a0edef2 100644
--- a/freetype/src/truetype/ttgxvar.c
+++ b/freetype/src/truetype/ttgxvar.c
@@ -4,7 +4,7 @@
*
* TrueType GX Font Variation loader
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.
*
* This file is part of the FreeType project, and may only be used,
@@ -151,9 +151,7 @@
FT_UInt i, j;
FT_UShort first;
FT_Memory memory = stream->memory;
- FT_Error error = FT_Err_Ok;
-
- FT_UNUSED( error );
+ FT_Error error;
*point_cnt = 0;
@@ -266,9 +264,7 @@
FT_UInt i, j;
FT_UInt bytes_used;
FT_Memory memory = stream->memory;
- FT_Error error = FT_Err_Ok;
-
- FT_UNUSED( error );
+ FT_Error error;
if ( FT_QNEW_ARRAY( deltas, delta_cnt ) )
@@ -361,14 +357,12 @@
FT_Memory memory = stream->memory;
GX_Blend blend = face->blend;
GX_AVarSegment segment;
- FT_Error error = FT_Err_Ok;
+ FT_Error error;
FT_Long version;
FT_Long axisCount;
FT_Int i, j;
FT_ULong table_len;
- FT_UNUSED( error );
-
FT_TRACE2(( "AVAR " ));
@@ -421,7 +415,6 @@
FT_FREE( blend->avar_segment[j].correspondence );
FT_FREE( blend->avar_segment );
- blend->avar_segment = NULL;
goto Exit;
}
@@ -2753,7 +2746,6 @@
/* The cvt table has been loaded already; every time we change the */
/* blend we may need to reload and remodify the cvt table. */
FT_FREE( face->cvt );
- face->cvt = NULL;
error = tt_face_load_cvt( face, face->root.stream );
break;
@@ -2772,7 +2764,6 @@
/* enforce recomputation of the PostScript name; */
FT_FREE( face->postscript_name );
- face->postscript_name = NULL;
Exit:
return error;
@@ -3476,6 +3467,7 @@
}
else
{
+ localpoints = NULL;
points = sharedpoints;
point_count = spoint_count;
}
diff --git a/freetype/src/truetype/ttgxvar.h b/freetype/src/truetype/ttgxvar.h
index ded9ea1d..17915f00 100644
--- a/freetype/src/truetype/ttgxvar.h
+++ b/freetype/src/truetype/ttgxvar.h
@@ -4,7 +4,7 @@
*
* TrueType GX Font Variation loader (specification)
*
- * Copyright (C) 2004-2021 by
+ * Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, Werner Lemberg and George Williams.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/truetype/ttinterp.c b/freetype/src/truetype/ttinterp.c
index 731095ed..e16565c3 100644
--- a/freetype/src/truetype/ttinterp.c
+++ b/freetype/src/truetype/ttinterp.c
@@ -4,7 +4,7 @@
*
* TrueType bytecode interpreter (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -5260,16 +5260,21 @@
}
}
- exc->GS.instruct_control &= ~(FT_Byte)Kf;
- exc->GS.instruct_control |= (FT_Byte)L;
+ /* INSTCTRL should only be used in the CVT program */
+ if ( exc->iniRange == tt_coderange_cvt )
+ {
+ exc->GS.instruct_control &= ~(FT_Byte)Kf;
+ exc->GS.instruct_control |= (FT_Byte)L;
+ }
- if ( K == 3 )
+ /* except to change the subpixel flags temporarily */
+ else if ( exc->iniRange == tt_coderange_glyph && K == 3 )
{
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
/* INSTCTRL modifying flag 3 also has an effect */
/* outside of the CVT program */
if ( SUBPIXEL_HINTING_INFINALITY )
- exc->ignore_x_mode = FT_BOOL( L == 4 );
+ exc->ignore_x_mode = !FT_BOOL( L == 4 );
#endif
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
@@ -5280,6 +5285,8 @@
exc->backward_compatibility = !FT_BOOL( L == 4 );
#endif
}
+ else if ( exc->pedantic_hinting )
+ exc->error = FT_THROW( Invalid_Reference );
}
@@ -7755,35 +7762,6 @@
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
- exc->iup_called = FALSE;
-#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
-
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
- /*
- * Toggle backward compatibility according to what font wants, except
- * when
- *
- * 1) we have a `tricky' font that heavily relies on the interpreter to
- * render glyphs correctly, for example DFKai-SB, or
- * 2) FT_RENDER_MODE_MONO (i.e, monochome rendering) is requested.
- *
- * In those cases, backward compatibility needs to be turned off to get
- * correct rendering. The rendering is then completely up to the
- * font's programming.
- *
- */
- if ( SUBPIXEL_HINTING_MINIMAL &&
- exc->subpixel_hinting_lean &&
- !FT_IS_TRICKY( &exc->face->root ) )
- exc->backward_compatibility = !( exc->GS.instruct_control & 4 );
- else
- exc->backward_compatibility = FALSE;
-
- exc->iupx_called = FALSE;
- exc->iupy_called = FALSE;
-#endif
-
/* We restrict the number of twilight points to a reasonable, */
/* heuristic value to avoid slow execution of malformed bytecode. */
num_twilight_points = FT_MAX( 30,
@@ -7861,6 +7839,15 @@
Compute_Funcs( exc );
Compute_Round( exc, (FT_Byte)exc->GS.round_state );
+ /* These flags cancel execution of some opcodes after IUP is called */
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
+ exc->iup_called = FALSE;
+#endif
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
+ exc->iupx_called = FALSE;
+ exc->iupy_called = FALSE;
+#endif
+
do
{
exc->opcode = exc->code[exc->IP];
diff --git a/freetype/src/truetype/ttinterp.h b/freetype/src/truetype/ttinterp.h
index 9c01ec83..48f618dc 100644
--- a/freetype/src/truetype/ttinterp.h
+++ b/freetype/src/truetype/ttinterp.h
@@ -4,7 +4,7 @@
*
* TrueType bytecode interpreter (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/truetype/ttobjs.c b/freetype/src/truetype/ttobjs.c
index 93fc5484..f4f3c693 100644
--- a/freetype/src/truetype/ttobjs.c
+++ b/freetype/src/truetype/ttobjs.c
@@ -4,7 +4,7 @@
*
* Objects manager (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -727,7 +727,8 @@
if ( error )
goto Exit;
- if ( FT_IS_SCALABLE( ttface ) )
+ if ( FT_IS_SCALABLE( ttface ) ||
+ FT_HAS_SBIX( ttface ) )
{
#ifdef FT_CONFIG_OPTION_INCREMENTAL
if ( !ttface->internal->incremental_interface )
@@ -1435,6 +1436,8 @@
size->ttmetrics.y_ratio = 0x10000L;
}
+ size->widthp = tt_face_get_device_metrics( face, size_metrics->x_ppem, 0 );
+
size->metrics = size_metrics;
#ifdef TT_USE_BYTECODE_INTERPRETER
diff --git a/freetype/src/truetype/ttobjs.h b/freetype/src/truetype/ttobjs.h
index fd723787..5fa239d4 100644
--- a/freetype/src/truetype/ttobjs.h
+++ b/freetype/src/truetype/ttobjs.h
@@ -4,7 +4,7 @@
*
* Objects manager (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -282,6 +282,8 @@ FT_BEGIN_HEADER
TT_Size_Metrics ttmetrics;
+ FT_Byte* widthp; /* glyph widths from the hdmx table */
+
FT_ULong strike_index; /* 0xFFFFFFFF to indicate invalid */
#ifdef TT_USE_BYTECODE_INTERPRETER
diff --git a/freetype/src/truetype/ttpload.c b/freetype/src/truetype/ttpload.c
index 71db75ae..6982c717 100644
--- a/freetype/src/truetype/ttpload.c
+++ b/freetype/src/truetype/ttpload.c
@@ -4,7 +4,7 @@
*
* TrueType-specific tables loader (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -498,6 +498,14 @@
}
+ FT_COMPARE_DEF( int )
+ compare_ppem( const void* a,
+ const void* b )
+ {
+ return **(FT_Byte**)a - **(FT_Byte**)b;
+ }
+
+
/**************************************************************************
*
* @Function:
@@ -574,20 +582,21 @@
goto Fail;
}
- if ( FT_QNEW_ARRAY( face->hdmx_record_sizes, num_records ) )
+ if ( FT_QNEW_ARRAY( face->hdmx_records, num_records ) )
goto Fail;
- /* XXX: We do not check if the records are sorted by ppem */
- /* and cannot use binary search later. */
for ( nn = 0; nn < num_records; nn++ )
{
if ( p + record_size > limit )
break;
-
- face->hdmx_record_sizes[nn] = p[0];
- p += record_size;
+ face->hdmx_records[nn] = p;
+ p += record_size;
}
+ /* The records must be already sorted by ppem but it does not */
+ /* hurt to make sure so that the binary search works later. */
+ ft_qsort( face->hdmx_records, nn, sizeof ( FT_Byte* ), compare_ppem );
+
face->hdmx_record_count = nn;
face->hdmx_table_size = table_size;
face->hdmx_record_size = record_size;
@@ -611,7 +620,7 @@
FT_Memory memory = stream->memory;
- FT_FREE( face->hdmx_record_sizes );
+ FT_FREE( face->hdmx_records );
FT_FRAME_RELEASE( face->hdmx_table );
}
@@ -619,27 +628,34 @@
/**************************************************************************
*
* Return the advance width table for a given pixel size if it is found
- * in the font's `hdmx' table (if any).
+ * in the font's `hdmx' table (if any). The records must be sorted for
+ * the binary search to work properly.
*/
FT_LOCAL_DEF( FT_Byte* )
tt_face_get_device_metrics( TT_Face face,
FT_UInt ppem,
FT_UInt gindex )
{
- FT_UInt nn;
- FT_Byte* result = NULL;
- FT_ULong record_size = face->hdmx_record_size;
- FT_Byte* record = FT_OFFSET( face->hdmx_table, 8 );
+ FT_UInt min = 0;
+ FT_UInt max = face->hdmx_record_count;
+ FT_UInt mid;
+ FT_Byte* result = NULL;
+
+ while ( min < max )
+ {
+ mid = ( min + max ) >> 1;
- for ( nn = 0; nn < face->hdmx_record_count; nn++ )
- if ( face->hdmx_record_sizes[nn] == ppem )
+ if ( face->hdmx_records[mid][0] > ppem )
+ max = mid;
+ else if ( face->hdmx_records[mid][0] < ppem )
+ min = mid + 1;
+ else
{
- gindex += 2;
- if ( gindex < record_size )
- result = record + nn * record_size + gindex;
+ result = face->hdmx_records[mid] + 2 + gindex;
break;
}
+ }
return result;
}
diff --git a/freetype/src/truetype/ttpload.h b/freetype/src/truetype/ttpload.h
index 84c42cda..fa5d96ed 100644
--- a/freetype/src/truetype/ttpload.h
+++ b/freetype/src/truetype/ttpload.h
@@ -4,7 +4,7 @@
*
* TrueType-specific tables loader (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/truetype/ttsubpix.c b/freetype/src/truetype/ttsubpix.c
index c484665b..2438d3a2 100644
--- a/freetype/src/truetype/ttsubpix.c
+++ b/freetype/src/truetype/ttsubpix.c
@@ -4,7 +4,7 @@
*
* TrueType Subpixel Hinting.
*
- * Copyright (C) 2010-2021 by
+ * Copyright (C) 2010-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/truetype/ttsubpix.h b/freetype/src/truetype/ttsubpix.h
index 762b7c98..181f8381 100644
--- a/freetype/src/truetype/ttsubpix.h
+++ b/freetype/src/truetype/ttsubpix.h
@@ -4,7 +4,7 @@
*
* TrueType Subpixel Hinting.
*
- * Copyright (C) 2010-2021 by
+ * Copyright (C) 2010-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/module.mk b/freetype/src/type1/module.mk
index 5da4716f..0342a08f 100644
--- a/freetype/src/type1/module.mk
+++ b/freetype/src/type1/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/type1/rules.mk b/freetype/src/type1/rules.mk
index 985248d3..cae0ee55 100644
--- a/freetype/src/type1/rules.mk
+++ b/freetype/src/type1/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/type1/t1afm.c b/freetype/src/type1/t1afm.c
index 4c18ed19..6009e9ee 100644
--- a/freetype/src/type1/t1afm.c
+++ b/freetype/src/type1/t1afm.c
@@ -4,7 +4,7 @@
*
* AFM support for Type 1 fonts (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -203,7 +203,7 @@
kp->index1 = FT_Get_Char_Index( t1_face, p[0] );
kp->index2 = FT_Get_Char_Index( t1_face, p[1] );
- kp->x = (FT_Int)FT_PEEK_SHORT_LE(p + 2);
+ kp->x = (FT_Int)FT_PEEK_SHORT_LE( p + 2 );
kp->y = 0;
kp++;
diff --git a/freetype/src/type1/t1afm.h b/freetype/src/type1/t1afm.h
index 86fe45ea..040ed682 100644
--- a/freetype/src/type1/t1afm.h
+++ b/freetype/src/type1/t1afm.h
@@ -4,7 +4,7 @@
*
* AFM support for Type 1 fonts (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1driver.c b/freetype/src/type1/t1driver.c
index f4d7a089..dd31545c 100644
--- a/freetype/src/type1/t1driver.c
+++ b/freetype/src/type1/t1driver.c
@@ -4,7 +4,7 @@
*
* Type 1 driver interface (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1driver.h b/freetype/src/type1/t1driver.h
index 20a827f8..9fe19403 100644
--- a/freetype/src/type1/t1driver.h
+++ b/freetype/src/type1/t1driver.h
@@ -4,7 +4,7 @@
*
* High-level Type 1 driver interface (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1errors.h b/freetype/src/type1/t1errors.h
index 18ef7545..1b87c42f 100644
--- a/freetype/src/type1/t1errors.h
+++ b/freetype/src/type1/t1errors.h
@@ -4,7 +4,7 @@
*
* Type 1 error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1gload.c b/freetype/src/type1/t1gload.c
index 86649edf..54023156 100644
--- a/freetype/src/type1/t1gload.c
+++ b/freetype/src/type1/t1gload.c
@@ -4,7 +4,7 @@
*
* Type 1 Glyph Loader (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1gload.h b/freetype/src/type1/t1gload.h
index a924d551..fdb98526 100644
--- a/freetype/src/type1/t1gload.h
+++ b/freetype/src/type1/t1gload.h
@@ -4,7 +4,7 @@
*
* Type 1 Glyph Loader (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1load.c b/freetype/src/type1/t1load.c
index bb62c799..66bebd56 100644
--- a/freetype/src/type1/t1load.c
+++ b/freetype/src/type1/t1load.c
@@ -4,7 +4,7 @@
*
* Type 1 font loader (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -1530,8 +1530,8 @@
/* we use a T1_Table to store our charnames */
loader->num_chars = encode->num_chars = array_size;
- if ( FT_NEW_ARRAY( encode->char_index, array_size ) ||
- FT_NEW_ARRAY( encode->char_name, array_size ) ||
+ if ( FT_QNEW_ARRAY( encode->char_index, array_size ) ||
+ FT_QNEW_ARRAY( encode->char_name, array_size ) ||
FT_SET_ERROR( psaux->ps_table_funcs->init(
char_table, array_size, memory ) ) )
{
@@ -1772,7 +1772,7 @@
if ( !loader->subrs_hash )
{
- if ( FT_NEW( loader->subrs_hash ) )
+ if ( FT_QNEW( loader->subrs_hash ) )
goto Fail;
error = ft_hash_num_init( loader->subrs_hash, memory );
@@ -2057,9 +2057,9 @@
name_table->elements[n][len] = '\0';
/* record index of /.notdef */
- if ( *cur == '.' &&
+ if ( *cur == '.' &&
ft_strcmp( ".notdef",
- (const char*)(name_table->elements[n]) ) == 0 )
+ (const char*)( name_table->elements[n] ) ) == 0 )
{
notdef_index = n;
notdef_found = 1;
@@ -2331,8 +2331,8 @@
/* in valid Type 1 fonts we don't see `RD' or `-|' directly */
/* since those tokens are handled by parse_subrs and */
/* parse_charstrings */
- else if ( *cur == 'R' && cur + 6 < limit && *(cur + 1) == 'D' &&
- have_integer )
+ else if ( *cur == 'R' && cur + 6 < limit && *( cur + 1 ) == 'D' &&
+ have_integer )
{
FT_ULong s;
FT_Byte* b;
@@ -2344,8 +2344,8 @@
have_integer = 0;
}
- else if ( *cur == '-' && cur + 6 < limit && *(cur + 1) == '|' &&
- have_integer )
+ else if ( *cur == '-' && cur + 6 < limit && *( cur + 1 ) == '|' &&
+ have_integer )
{
FT_ULong s;
FT_Byte* b;
diff --git a/freetype/src/type1/t1load.h b/freetype/src/type1/t1load.h
index ba19adb1..a6d46eb1 100644
--- a/freetype/src/type1/t1load.h
+++ b/freetype/src/type1/t1load.h
@@ -4,7 +4,7 @@
*
* Type 1 font loader (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1objs.c b/freetype/src/type1/t1objs.c
index 50dad038..fa4a13b5 100644
--- a/freetype/src/type1/t1objs.c
+++ b/freetype/src/type1/t1objs.c
@@ -4,7 +4,7 @@
*
* Type 1 objects manager (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@@ -146,7 +146,9 @@
FT_LOCAL_DEF( void )
T1_GlyphSlot_Done( FT_GlyphSlot slot )
{
- slot->internal->glyph_hints = NULL;
+ /* `slot->internal` might be NULL in out-of-memory situations. */
+ if ( slot->internal )
+ slot->internal->glyph_hints = NULL;
}
diff --git a/freetype/src/type1/t1objs.h b/freetype/src/type1/t1objs.h
index 5f103b50..e632fb58 100644
--- a/freetype/src/type1/t1objs.h
+++ b/freetype/src/type1/t1objs.h
@@ -4,7 +4,7 @@
*
* Type 1 objects manager (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1parse.c b/freetype/src/type1/t1parse.c
index 9f226296..95dc97d7 100644
--- a/freetype/src/type1/t1parse.c
+++ b/freetype/src/type1/t1parse.c
@@ -4,7 +4,7 @@
*
* Type 1 parser (body).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1parse.h b/freetype/src/type1/t1parse.h
index 247ff73b..d9c7e3b5 100644
--- a/freetype/src/type1/t1parse.h
+++ b/freetype/src/type1/t1parse.h
@@ -4,7 +4,7 @@
*
* Type 1 parser (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/t1tokens.h b/freetype/src/type1/t1tokens.h
index 13ac8ac1..79080d9e 100644
--- a/freetype/src/type1/t1tokens.h
+++ b/freetype/src/type1/t1tokens.h
@@ -4,7 +4,7 @@
*
* Type 1 tokenizer (specification).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type1/type1.c b/freetype/src/type1/type1.c
index 003b78cb..6f112492 100644
--- a/freetype/src/type1/type1.c
+++ b/freetype/src/type1/type1.c
@@ -4,7 +4,7 @@
*
* FreeType Type 1 driver component (body only).
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type42/module.mk b/freetype/src/type42/module.mk
index ec3214cd..f619fa5c 100644
--- a/freetype/src/type42/module.mk
+++ b/freetype/src/type42/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2002-2021 by
+# Copyright (C) 2002-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/type42/rules.mk b/freetype/src/type42/rules.mk
index 9821943e..9d26c879 100644
--- a/freetype/src/type42/rules.mk
+++ b/freetype/src/type42/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 2002-2021 by
+# Copyright (C) 2002-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/type42/t42drivr.c b/freetype/src/type42/t42drivr.c
index e74ba1de..45d8c382 100644
--- a/freetype/src/type42/t42drivr.c
+++ b/freetype/src/type42/t42drivr.c
@@ -4,7 +4,7 @@
*
* High-level Type 42 driver interface (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* Roberto Alameda.
*
* This file is part of the FreeType project, and may only be used,
@@ -150,22 +150,13 @@
}
- static FT_Error
- t42_ps_get_font_private( FT_Face face,
- PS_PrivateRec* afont_private )
- {
- *afont_private = ((T42_Face)face)->type1.private_dict;
-
- return FT_Err_Ok;
- }
-
-
static const FT_Service_PsInfoRec t42_service_ps_info =
{
(PS_GetFontInfoFunc) t42_ps_get_font_info, /* ps_get_font_info */
(PS_GetFontExtraFunc) t42_ps_get_font_extra, /* ps_get_font_extra */
(PS_HasGlyphNamesFunc) t42_ps_has_glyph_names, /* ps_has_glyph_names */
- (PS_GetFontPrivateFunc)t42_ps_get_font_private, /* ps_get_font_private */
+ /* Type42 fonts don't have a Private dict */
+ (PS_GetFontPrivateFunc)NULL, /* ps_get_font_private */
/* not implemented */
(PS_GetFontValueFunc) NULL /* ps_get_font_value */
};
diff --git a/freetype/src/type42/t42drivr.h b/freetype/src/type42/t42drivr.h
index c6d8a440..95e1207b 100644
--- a/freetype/src/type42/t42drivr.h
+++ b/freetype/src/type42/t42drivr.h
@@ -4,7 +4,7 @@
*
* High-level Type 42 driver interface (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* Roberto Alameda.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type42/t42error.h b/freetype/src/type42/t42error.h
index 470f5189..b2782210 100644
--- a/freetype/src/type42/t42error.h
+++ b/freetype/src/type42/t42error.h
@@ -4,7 +4,7 @@
*
* Type 42 error codes (specification only).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type42/t42objs.c b/freetype/src/type42/t42objs.c
index 03955e94..da1e0732 100644
--- a/freetype/src/type42/t42objs.c
+++ b/freetype/src/type42/t42objs.c
@@ -4,7 +4,7 @@
*
* Type 42 objects manager (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* Roberto Alameda.
*
* This file is part of the FreeType project, and may only be used,
@@ -44,14 +44,8 @@
parser = &loader.parser;
- if ( FT_QALLOC( face->ttf_data, 12 ) )
- goto Exit;
-
- /* while parsing the font we always update `face->ttf_size' so that */
- /* even in case of buggy data (which might lead to premature end of */
- /* scanning without causing an error) the call to `FT_Open_Face' in */
- /* `T42_Face_Init' passes the correct size */
- face->ttf_size = 12;
+ face->ttf_data = NULL;
+ face->ttf_size = 0;
error = t42_parser_init( parser,
face->root.stream,
@@ -152,6 +146,11 @@
Exit:
t42_loader_done( &loader );
+ if ( error )
+ {
+ FT_FREE( face->ttf_data );
+ face->ttf_size = 0;
+ }
return error;
}
diff --git a/freetype/src/type42/t42objs.h b/freetype/src/type42/t42objs.h
index cbd344ff..e677996a 100644
--- a/freetype/src/type42/t42objs.h
+++ b/freetype/src/type42/t42objs.h
@@ -4,7 +4,7 @@
*
* Type 42 objects manager (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* Roberto Alameda.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type42/t42parse.c b/freetype/src/type42/t42parse.c
index ea2c5198..59cc519e 100644
--- a/freetype/src/type42/t42parse.c
+++ b/freetype/src/type42/t42parse.c
@@ -4,7 +4,7 @@
*
* Type 42 font parser (body).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* Roberto Alameda.
*
* This file is part of the FreeType project, and may only be used,
@@ -92,7 +92,7 @@
#undef T1CODE
#define T1CODE T1_FIELD_LOCATION_BBOX
- T1_FIELD_BBOX("FontBBox", xMin, 0 )
+ T1_FIELD_BBOX( "FontBBox", xMin, 0 )
T1_FIELD_CALLBACK( "FontMatrix", t42_parse_font_matrix, 0 )
T1_FIELD_CALLBACK( "Encoding", t42_parse_encoding, 0 )
@@ -363,8 +363,8 @@
/* we use a T1_Table to store our charnames */
loader->num_chars = encode->num_chars = count;
- if ( FT_NEW_ARRAY( encode->char_index, count ) ||
- FT_NEW_ARRAY( encode->char_name, count ) ||
+ if ( FT_QNEW_ARRAY( encode->char_index, count ) ||
+ FT_QNEW_ARRAY( encode->char_name, count ) ||
FT_SET_ERROR( psaux->ps_table_funcs->init(
char_table, count, memory ) ) )
{
@@ -538,7 +538,8 @@
FT_Byte* limit = parser->root.limit;
FT_Error error;
FT_Int num_tables = 0;
- FT_Long count;
+ FT_Long ttf_count;
+ FT_Long ttf_reserved;
FT_ULong n, string_size, old_string_size, real_size;
FT_Byte* string_buf = NULL;
@@ -546,6 +547,9 @@
T42_Load_Status status;
+ /** There should only be one sfnts array, but free any previous. */
+ FT_FREE( face->ttf_data );
+ face->ttf_size = 0;
/* The format is */
/* */
@@ -574,7 +578,10 @@
status = BEFORE_START;
string_size = 0;
old_string_size = 0;
- count = 0;
+ ttf_count = 0;
+ ttf_reserved = 12;
+ if ( FT_QALLOC( face->ttf_data, ttf_reserved ) )
+ goto Fail;
FT_TRACE2(( "\n" ));
FT_TRACE2(( "t42_parse_sfnts:\n" ));
@@ -589,6 +596,7 @@
if ( *cur == ']' )
{
parser->root.cursor++;
+ face->ttf_size = ttf_count;
goto Exit;
}
@@ -684,7 +692,7 @@
}
FT_TRACE2(( " PS string size %5lu bytes, offset 0x%08lx (%lu)\n",
- string_size, count, count ));
+ string_size, ttf_count, ttf_count ));
/* The whole TTF is now loaded into `string_buf'. We are */
/* checking its contents while copying it to `ttf_data'. */
@@ -697,43 +705,48 @@
{
case BEFORE_START:
/* load offset table, 12 bytes */
- if ( count < 12 )
+ if ( ttf_count < 12 )
{
- face->ttf_data[count++] = string_buf[n];
+ face->ttf_data[ttf_count++] = string_buf[n];
continue;
}
else
{
- num_tables = 16 * face->ttf_data[4] + face->ttf_data[5];
- status = BEFORE_TABLE_DIR;
- face->ttf_size = 12 + 16 * num_tables;
+ FT_Long ttf_reserved_prev = ttf_reserved;
+
+
+ num_tables = 16 * face->ttf_data[4] + face->ttf_data[5];
+ status = BEFORE_TABLE_DIR;
+ ttf_reserved = 12 + 16 * num_tables;
FT_TRACE2(( " SFNT directory contains %d tables\n",
num_tables ));
- if ( (FT_Long)size < face->ttf_size )
+ if ( (FT_Long)size < ttf_reserved )
{
FT_ERROR(( "t42_parse_sfnts: invalid data in sfnts array\n" ));
error = FT_THROW( Invalid_File_Format );
goto Fail;
}
- if ( FT_QREALLOC( face->ttf_data, 12, face->ttf_size ) )
+ if ( FT_QREALLOC( face->ttf_data, ttf_reserved_prev,
+ ttf_reserved ) )
goto Fail;
}
/* fall through */
case BEFORE_TABLE_DIR:
/* the offset table is read; read the table directory */
- if ( count < face->ttf_size )
+ if ( ttf_count < ttf_reserved )
{
- face->ttf_data[count++] = string_buf[n];
+ face->ttf_data[ttf_count++] = string_buf[n];
continue;
}
else
{
int i;
FT_ULong len;
+ FT_Long ttf_reserved_prev = ttf_reserved;
FT_TRACE2(( "\n" ));
@@ -749,7 +762,7 @@
FT_TRACE2(( " %4i 0x%08lx (%lu)\n", i, len, len ));
if ( len > size ||
- face->ttf_size > (FT_Long)( size - len ) )
+ ttf_reserved > (FT_Long)( size - len ) )
{
FT_ERROR(( "t42_parse_sfnts:"
" invalid data in sfnts array\n" ));
@@ -758,30 +771,31 @@
}
/* Pad to a 4-byte boundary length */
- face->ttf_size += (FT_Long)( ( len + 3 ) & ~3U );
+ ttf_reserved += (FT_Long)( ( len + 3 ) & ~3U );
}
+ ttf_reserved += 1;
status = OTHER_TABLES;
FT_TRACE2(( "\n" ));
- FT_TRACE2(( " allocating %ld bytes\n", face->ttf_size + 1 ));
+ FT_TRACE2(( " allocating %ld bytes\n", ttf_reserved ));
FT_TRACE2(( "\n" ));
- if ( FT_QREALLOC( face->ttf_data, 12 + 16 * num_tables,
- face->ttf_size + 1 ) )
+ if ( FT_QREALLOC( face->ttf_data, ttf_reserved_prev,
+ ttf_reserved ) )
goto Fail;
}
/* fall through */
case OTHER_TABLES:
/* all other tables are just copied */
- if ( count >= face->ttf_size )
+ if ( ttf_count >= ttf_reserved )
{
FT_ERROR(( "t42_parse_sfnts: too much binary data\n" ));
error = FT_THROW( Invalid_File_Format );
goto Fail;
}
- face->ttf_data[count++] = string_buf[n];
+ face->ttf_data[ttf_count++] = string_buf[n];
}
}
@@ -795,6 +809,11 @@
parser->root.error = error;
Exit:
+ if ( parser->root.error )
+ {
+ FT_FREE( face->ttf_data );
+ face->ttf_size = 0;
+ }
if ( allocated )
FT_FREE( string_buf );
}
@@ -989,9 +1008,9 @@
name_table->elements[n][len] = '\0';
/* record index of /.notdef */
- if ( *cur == '.' &&
+ if ( *cur == '.' &&
ft_strcmp( ".notdef",
- (const char*)(name_table->elements[n]) ) == 0 )
+ (const char*)( name_table->elements[n] ) ) == 0 )
{
notdef_index = n;
notdef_found = 1;
diff --git a/freetype/src/type42/t42parse.h b/freetype/src/type42/t42parse.h
index 0fbd2b5e..fa633e7f 100644
--- a/freetype/src/type42/t42parse.h
+++ b/freetype/src/type42/t42parse.h
@@ -4,7 +4,7 @@
*
* Type 42 font parser (specification).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* Roberto Alameda.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type42/t42types.h b/freetype/src/type42/t42types.h
index ea2f03e8..985bdfda 100644
--- a/freetype/src/type42/t42types.h
+++ b/freetype/src/type42/t42types.h
@@ -4,7 +4,7 @@
*
* Type 42 font data types (specification only).
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* Roberto Alameda.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/type42/type42.c b/freetype/src/type42/type42.c
index d8d3936b..ccf5d472 100644
--- a/freetype/src/type42/type42.c
+++ b/freetype/src/type42/type42.c
@@ -4,7 +4,7 @@
*
* FreeType Type 42 driver component.
*
- * Copyright (C) 2002-2021 by
+ * Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/winfonts/fnterrs.h b/freetype/src/winfonts/fnterrs.h
index d582a9b9..10564e10 100644
--- a/freetype/src/winfonts/fnterrs.h
+++ b/freetype/src/winfonts/fnterrs.h
@@ -4,7 +4,7 @@
*
* Win FNT/FON error codes (specification only).
*
- * Copyright (C) 2001-2021 by
+ * Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
diff --git a/freetype/src/winfonts/module.mk b/freetype/src/winfonts/module.mk
index 4a8580ca..7a49201f 100644
--- a/freetype/src/winfonts/module.mk
+++ b/freetype/src/winfonts/module.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/winfonts/rules.mk b/freetype/src/winfonts/rules.mk
index 1384f23b..2f67ab45 100644
--- a/freetype/src/winfonts/rules.mk
+++ b/freetype/src/winfonts/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright (C) 1996-2021 by
+# Copyright (C) 1996-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
diff --git a/freetype/src/winfonts/winfnt.c b/freetype/src/winfonts/winfnt.c
index b4fabad2..8afd6be6 100644
--- a/freetype/src/winfonts/winfnt.c
+++ b/freetype/src/winfonts/winfnt.c
@@ -4,7 +4,7 @@
*
* FreeType font driver for Windows FNT/FON files
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
* Copyright 2003 Huw D M Davies for Codeweavers
* Copyright 2007 Dmitry Timoshkov for Codeweavers
@@ -352,6 +352,10 @@
count = FT_GET_USHORT_LE();
+ FT_TRACE2(( type_id == 0x8007U ? "RT_FONTDIR count %hu\n" :
+ type_id == 0x8008U ? "RT_FONT count %hu\n" : "",
+ count ));
+
if ( type_id == 0x8008U )
{
font_count = count;
@@ -485,7 +489,7 @@
&dir_entry1 ) )
goto Exit;
- if ( !(dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ )
+ if ( !( dir_entry1.offset & 0x80000000UL ) /* DataIsDirectory */ )
{
error = FT_THROW( Invalid_File_Format );
goto Exit;
@@ -509,7 +513,7 @@
&dir_entry2 ) )
goto Exit;
- if ( !(dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ )
+ if ( !( dir_entry2.offset & 0x80000000UL ) /* DataIsDirectory */ )
{
error = FT_THROW( Invalid_File_Format );
goto Exit;
diff --git a/freetype/src/winfonts/winfnt.h b/freetype/src/winfonts/winfnt.h
index a7134abd..7e6f5915 100644
--- a/freetype/src/winfonts/winfnt.h
+++ b/freetype/src/winfonts/winfnt.h
@@ -4,7 +4,7 @@
*
* FreeType font driver for Windows FNT/FON files
*
- * Copyright (C) 1996-2021 by
+ * Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
* Copyright 2007 Dmitry Timoshkov for Codeweavers
*
diff --git a/freetype/version.sed b/freetype/version.sed
deleted file mode 100644
index c281ff50..00000000
--- a/freetype/version.sed
+++ /dev/null
@@ -1,5 +0,0 @@
-#! /usr/bin/sed -nf
-
-s/^#define *FREETYPE_MAJOR *\([^ ][^ ]*\).*$/freetype_major="\1" ;/p
-s/^#define *FREETYPE_MINOR *\([^ ][^ ]*\).*$/freetype_minor=".\1" ;/p
-s/^#define *FREETYPE_PATCH *\([^ ][^ ]*\).*$/freetype_patch=".\1" ;/p
diff --git a/freetype/vms_make.com b/freetype/vms_make.com
index 6e6337d2..2746d407 100644
--- a/freetype/vms_make.com
+++ b/freetype/vms_make.com
@@ -1,6 +1,6 @@
$! make FreeType 2 under OpenVMS
$!
-$! Copyright (C) 2003-2021 by
+$! Copyright (C) 2003-2022 by
$! David Turner, Robert Wilhelm, and Werner Lemberg.
$!
$! This file is part of the FreeType project, and may only be used, modified,
diff --git a/jpeg/Makefile.am b/jpeg/Makefile.am
index c477a445..2ccb5922 100644
--- a/jpeg/Makefile.am
+++ b/jpeg/Makefile.am
@@ -30,7 +30,7 @@ DISTMANS= cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
# Other documentation files
DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
- structure.txt coderules.txt filelist.txt change.log
+ structure.txt coderules.txt filelist.txt cdaltui.txt change.log
# Makefiles for various systems
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
@@ -42,8 +42,10 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
# Configuration files
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
@@ -55,7 +57,8 @@ CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
# Miscellaneous support files
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
# Test support files
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
diff --git a/jpeg/Makefile.in b/jpeg/Makefile.in
index 79efda66..7cfc261b 100644
--- a/jpeg/Makefile.in
+++ b/jpeg/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.5 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2018 Free Software Foundation, Inc.
+# Copyright (C) 1994-2021 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -265,8 +265,8 @@ NROFF = nroff
MANS = $(man_MANS)
DATA = $(nodist_pkgconfig_DATA)
HEADERS = $(include_HEADERS) $(noinst_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)jconfig.cfg
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+ jconfig.cfg
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
@@ -283,9 +283,6 @@ am__define_uniq_tagged_files = \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
-ETAGS = etags
-CTAGS = ctags
-CSCOPE = cscope
AM_RECURSIVE_TARGETS = cscope
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -301,6 +298,8 @@ CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
+CSCOPE = @CSCOPE@
+CTAGS = @CTAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
@@ -311,6 +310,7 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ETAGS = @ETAGS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
@@ -400,6 +400,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -440,7 +441,7 @@ DISTMANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
# Other documentation files
DOCS = README install.txt usage.txt wizard.txt example.c libjpeg.txt \
- structure.txt coderules.txt filelist.txt change.log
+ structure.txt coderules.txt filelist.txt cdaltui.txt change.log
# Makefiles for various systems
@@ -453,8 +454,10 @@ MKFILES = configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
# Configuration files
@@ -469,7 +472,9 @@ CONFIGUREFILES = config.guess config.sub install-sh ltmain.sh depcomp \
# Miscellaneous support files
-OTHERFILES = jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES = jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
+
# Test support files
TESTFILES = testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
@@ -662,7 +667,7 @@ clean-libLTLIBRARIES:
rm -f $${locs}; \
}
-libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES)
+libjpeg.la: $(libjpeg_la_OBJECTS) $(libjpeg_la_DEPENDENCIES) $(EXTRA_libjpeg_la_DEPENDENCIES)
$(AM_V_CCLD)$(libjpeg_la_LINK) -rpath $(libdir) $(libjpeg_la_OBJECTS) $(libjpeg_la_LIBADD) $(LIBS)
cjpeg$(EXEEXT): $(cjpeg_OBJECTS) $(cjpeg_DEPENDENCIES) $(EXTRA_cjpeg_DEPENDENCIES)
diff --git a/jpeg/README b/jpeg/README
index 13b245c5..d288f41b 100644
--- a/jpeg/README
+++ b/jpeg/README
@@ -1,7 +1,7 @@
The Independent JPEG Group's JPEG software
==========================================
-README for release 9d of 12-Jan-2020
+README for release 9e of 16-Jan-2022
====================================
This distribution contains the ninth public release of the Independent JPEG
@@ -38,6 +38,7 @@ User documentation:
rdjpgcom, and wrjpgcom.
*.1 Unix-style man pages for programs (same info as usage.txt).
wizard.txt Advanced usage instructions for JPEG wizards only.
+ cdaltui.txt Description of alternate user interface for cjpeg/djpeg.
change.log Version-to-version change highlights.
Programmer and internal documentation:
libjpeg.txt How to use the JPEG library in your own programs.
@@ -115,7 +116,7 @@ with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
-This software is copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
+This software is copyright (C) 1991-2022, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
@@ -165,7 +166,7 @@ The best short technical introduction to the JPEG compression algorithm is
(Adjacent articles in that issue discuss MPEG motion picture compression,
applications of JPEG, and related topics.) If you don't have the CACM issue
handy, a PDF file containing a revised version of Wallace's article is
-available at http://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
+available at https://www.ijg.org/files/Wallace.JPEG.pdf. The file (actually
a preprint for an article that appeared in IEEE Trans. Consumer Electronics)
omits the sample images that appeared in CACM, but it includes corrections
and some added material. Note: the Wallace article is copyright ACM and IEEE,
@@ -209,17 +210,16 @@ document is Revision 3. And a contributed document ISO/IEC JTC1/SC29/WG1 N
5799 with title "Evolution of JPEG", June/July 2011, Berlin, Germany.
IJG JPEG 9 introduces a reversible color transform for improved lossless
compression which is described in a contributed document ISO/IEC JTC1/SC29/
-WG1 N 6080 with title "JPEG 9 Lossless Coding", June/July 2012, Paris,
-France.
+WG1 N 6080 with title "JPEG 9 Lossless Coding", June/July 2012, Paris, France.
The JPEG standard does not specify all details of an interchangeable file
format. For the omitted details we follow the "JFIF" conventions, version 2.
JFIF version 1 has been adopted as Recommendation ITU-T T.871 (05/2011) :
Information technology - Digital compression and coding of continuous-tone
still images: JPEG File Interchange Format (JFIF). It is available as a
-free download in PDF file format from http://www.itu.int/rec/T-REC-T.871.
+free download in PDF file format from https://www.itu.int/rec/T-REC-T.871.
A PDF file of the older JFIF document is available at
-http://www.w3.org/Graphics/JPEG/jfif3.pdf.
+https://www.w3.org/Graphics/JPEG/jfif3.pdf.
The TIFF 6.0 file format specification can be obtained by FTP from
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
@@ -227,7 +227,7 @@ found in the TIFF 6.0 spec of 3-June-92 has a number of serious problems.
IJG does not recommend use of the TIFF 6.0 design (TIFF Compression tag 6).
Instead, we recommend the JPEG design proposed by TIFF Technical Note #2
(Compression tag 7). Copies of this Note can be obtained from
-http://www.ijg.org/files/. It is expected that the next revision
+https://www.ijg.org/files/. It is expected that the next revision
of the TIFF spec will replace the 6.0 JPEG design with the Note's design.
Although IJG's own code does not support TIFF/JPEG, the free libtiff library
uses our library to implement TIFF/JPEG per the Note.
@@ -238,9 +238,11 @@ ARCHIVE LOCATIONS
The "official" archive site for this software is www.ijg.org.
The most recent released version can always be found there in
-directory "files". This particular version will be archived as
-http://www.ijg.org/files/jpegsrc.v9d.tar.gz, and in Windows-compatible
-"zip" archive format as http://www.ijg.org/files/jpegsr9d.zip.
+directory "files". This particular version will be archived
+in Windows-compatible "zip" archive format as
+https://www.ijg.org/files/jpegsr9e.zip, and
+in Unix-compatible "tar.gz" archive format as
+https://www.ijg.org/files/jpegsrc.v9e.tar.gz.
The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG.
@@ -286,11 +288,12 @@ communication about JPEG configuration in Sigma Photo Pro software.
Thank to Andrew Finkenstadt for hosting the ijg.org site.
-Thank to Thomas G. Lane for the original design and development of
-this singular software package.
+Thank to Thomas G. Lane for the original design and development
+of this singular software package.
-Thank to Lars Goehler, Andreas Heinecke, Sebastian Fuss, Yvonne Roebert,
-Andrej Werner, and Ulf-Dietrich Braumann for support and public relations.
+Thank to Lars Goehler, Andreas Heinecke, Sebastian Fuss,
+Yvonne Roebert, Andrej Werner, Ulf-Dietrich Braumann,
+and Nina Ssymank for support and public relations.
FILE FORMAT WARS
diff --git a/jpeg/aclocal.m4 b/jpeg/aclocal.m4
index f77f2904..d9cdb41d 100644
--- a/jpeg/aclocal.m4
+++ b/jpeg/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.5 -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,8 +14,8 @@
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
@@ -9049,7 +9049,7 @@ m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
-# Copyright (C) 2002-2018 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9064,7 +9064,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.16.1], [],
+m4_if([$1], [1.16.5], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -9080,12 +9080,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.1])dnl
+[AM_AUTOMAKE_VERSION([1.16.5])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-# Copyright (C) 2011-2018 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9147,7 +9147,7 @@ AC_SUBST([AR])dnl
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9199,7 +9199,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9230,7 +9230,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9421,7 +9421,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9460,7 +9460,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. Try re-running configure with the
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE="gmake" (or whatever is
+ necessary). You can also try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
@@ -9487,7 +9489,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9515,6 +9517,10 @@ m4_defn([AC_PROG_CC])
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.65])dnl
+m4_ifdef([_$0_ALREADY_INIT],
+ [m4_fatal([$0 expanded multiple times
+]m4_defn([_$0_ALREADY_INIT]))],
+ [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -9551,7 +9557,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]),
[ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
@@ -9603,6 +9609,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
[m4_define([AC_PROG_OBJCXX],
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
+# Variables for tags utilities; see am/tags.am
+if test -z "$CTAGS"; then
+ CTAGS=ctags
+fi
+AC_SUBST([CTAGS])
+if test -z "$ETAGS"; then
+ ETAGS=etags
+fi
+AC_SUBST([ETAGS])
+if test -z "$CSCOPE"; then
+ CSCOPE=cscope
+fi
+AC_SUBST([CSCOPE])
+
AC_REQUIRE([AM_SILENT_RULES])dnl
dnl The testsuite driver may need to know about EXEEXT, so add the
dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
@@ -9684,7 +9704,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9705,7 +9725,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2018 Free Software Foundation, Inc.
+# Copyright (C) 2003-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9727,7 +9747,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9762,7 +9782,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9805,7 +9825,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2018 Free Software Foundation, Inc.
+# Copyright (C) 1997-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9826,12 +9846,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
@@ -9844,7 +9859,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9873,7 +9888,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9920,7 +9935,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -9939,7 +9954,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -10020,7 +10035,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2018 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -10080,7 +10095,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2018 Free Software Foundation, Inc.
+# Copyright (C) 2001-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -10108,7 +10123,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2018 Free Software Foundation, Inc.
+# Copyright (C) 2006-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -10127,7 +10142,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2018 Free Software Foundation, Inc.
+# Copyright (C) 2004-2021 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/jpeg/ar-lib b/jpeg/ar-lib
index 0baa4f60..c349042c 100755
--- a/jpeg/ar-lib
+++ b/jpeg/ar-lib
@@ -2,9 +2,9 @@
# Wrapper for Microsoft lib.exe
me=ar-lib
-scriptversion=2012-03-01.08; # UTC
+scriptversion=2019-07-04.01; # UTC
-# Copyright (C) 2010-2018 Free Software Foundation, Inc.
+# Copyright (C) 2010-2021 Free Software Foundation, Inc.
# Written by Peter Rosin <peda@lysator.liu.se>.
#
# This program is free software; you can redistribute it and/or modify
@@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@@ -65,7 +65,7 @@ func_file_conv ()
mingw)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin)
+ cygwin | msys)
file=`cygpath -m "$file" || echo "$file"`
;;
wine)
@@ -224,10 +224,11 @@ elif test -n "$extract"; then
esac
done
else
- $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
- do
- $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
- done
+ $AR -NOLOGO -LIST "$archive" | tr -d '\r' | sed -e 's/\\/\\\\/g' \
+ | while read member
+ do
+ $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
+ done
fi
elif test -n "$quick$replace"; then
diff --git a/jpeg/cdaltui.txt b/jpeg/cdaltui.txt
new file mode 100644
index 00000000..702999fc
--- /dev/null
+++ b/jpeg/cdaltui.txt
@@ -0,0 +1,138 @@
+IJG JPEG LIBRARY: ALTERNATE USER INTERFACE FOR CJPEG/DJPEG
+
+Copyright (C) 2020, Guido Vollbeding.
+This file is part of the Independent JPEG Group's software.
+For conditions of distribution and use, see the accompanying README file.
+
+
+There is an alternate command-line user interface for the IJG JPEG software.
+It is designed for use under MS-DOS, and may also be useful on other non-Unix
+operating systems. (For that matter, this code works fine on Unix, but the
+standard command-line syntax is better on Unix because it is pipe-friendly.)
+
+With this user interface, cjpeg and djpeg accept multiple input file names
+on the command line; output file names are generated by substituting
+appropriate extensions. The user is prompted before any already-existing
+file will be overwritten.
+
+Expansion of wild-card file specifications is useful but is not directly
+provided by this code. Most DOS C compilers have the ability to do wild-card
+expansion "behind the scenes", and we rely on that feature. On other systems,
+the shell may do it for you, as is done on Unix.
+
+Also, a DOS-specific routine is provided to determine available memory;
+this makes the -maxmemory switch unnecessary except in unusual cases.
+If you know how to determine available memory on a different system,
+you can easily add the necessary code. (And please send it along to
+jpeg-info@jpegclub.org so we can include it in future releases!)
+
+
+INSTALLATION
+============
+
+Rename the standard cjpeg.c file to cjpegstd.c, then rename cjpegalt.c to
+cjpeg.c.
+Rename the standard djpeg.c file to djpegstd.c, then rename djpegalt.c to
+djpeg.c.
+Then build the software as described in install.txt, with these exceptions:
+
+* Define PROGRESS_REPORT in jconfig.h if you want the percent-done display.
+* Define NO_OVERWRITE_CHECK if you *don't* want overwrite confirmation.
+* You may ignore the USE_SETMODE and TWO_FILE_COMMANDLINE symbols discussed
+ in install.txt; these files do not use them.
+* As given, djpegalt.c defaults to BMP output (not PPM output as in the
+ standard djpeg.c). If you want something different, modify DEFAULT_FMT.
+
+You may also need to do something special to enable filename wild-card
+expansion, assuming your compiler has that capability at all.
+
+Modify the standard usage.txt file as described below. (If you want to use
+the Unix-style manual pages cjpeg.1 and djpeg.1, better fix them too.)
+
+To restore the standard user interface:
+Rename cjpeg.c to cjpegalt.c, then rename cjpegstd.c to cjpeg.c.
+Rename djpeg.c to djpegalt.c, then rename djpegstd.c to djpeg.c.
+Then recompile/rebuild.
+
+
+Here are some specific notes for popular MS-DOS compilers:
+
+Borland C:
+ Add "-DMSDOS" to CFLAGS to enable use of the DOS memory determination code.
+ Link with the standard library file WILDARGS.OBJ to get wild-card expansion.
+
+Microsoft C:
+ Add "-DMSDOS" to CFLAGS to enable use of the DOS memory determination code.
+ Link with the standard library file SETARGV.OBJ to get wild-card expansion.
+ In the versions I've used, you must also add /NOE to the linker switches to
+ avoid a duplicate-symbol error from including SETARGV.
+
+DJGPP (we recommend version 2.0 or later):
+ Add "-DFREE_MEM_ESTIMATE=0" to CFLAGS. Wild-card expansion is automatic.
+
+
+USAGE
+=====
+
+Most of the standard usage.txt file also applies to the alternate version,
+but replace its "GENERAL USAGE" section with the text below. Edit the text
+as necessary if you don't support wildcards or overwrite checking. Be sure
+to fix the djpeg switch descriptions if you are not defaulting to PPM output.
+Also, if you've provided an accurate memory-estimation procedure, you can
+probably eliminate the HINTS related to the -maxmemory switch.
+
+
+GENERAL USAGE
+
+We provide two programs, cjpeg to compress an image file into JPEG format,
+and djpeg to decompress a JPEG file back into a conventional image format.
+
+The basic command line is:
+ cjpeg [switches] list of image files
+or
+ djpeg [switches] list of jpeg files
+
+Each file named is compressed or decompressed. The input file(s) are not
+modified; the output data is written to files which have the same names
+except for extension. cjpeg always uses ".jpg" for the output file name's
+extension; djpeg uses one of ".bmp", ".gif", ".ppm", ".rle", or ".tga",
+depending on what output format is selected by the switches.
+
+For example, to convert xxx.bmp to xxx.jpg and yyy.ppm to yyy.jpg, say:
+ cjpeg xxx.bmp yyy.ppm
+
+On most systems you can use standard wildcards to specify the list of input
+files; for example, on DOS "djpeg *.jpg" decompresses all the JPEG files in
+the current directory.
+
+If an intended output file already exists, you'll be asked whether or not to
+overwrite it. If you say no, the program skips that input file and goes on
+to the next one.
+
+You can intermix switches and file names; for example
+ djpeg -gif file1.jpg -targa file2.jpg
+decompresses file1.jpg into GIF format (file1.gif) and file2.jpg into Targa
+format (file2.tga). Only switches to the left of a given file name affect
+processing of that file; when there are conflicting switches, the rightmost
+one takes precedence.
+
+You can override the program's choice of output file name by using the
+-outfile switch, as in
+ cjpeg -outfile output.jpg input.ppm
+-outfile only affects the first input file name to its right.
+
+The currently supported image file formats are: PPM (PBMPLUS color format),
+PGM (PBMPLUS grayscale format), BMP, GIF, Targa, and RLE (Utah Raster Toolkit
+format). (RLE is supported only if the URT library is available, which it
+isn't on most non-Unix systems.) cjpeg recognizes the input image format
+automatically, with the exception of some Targa-format files. You have to
+tell djpeg which format to generate.
+
+JPEG files are in the standard JFIF file format. There are other,
+less widely used JPEG-based file formats, but we don't support them.
+
+All switch names may be abbreviated; for example, -grayscale may be written
+-gray or -gr. Most of the "basic" switches can be abbreviated to as little as
+one letter. Upper and lower case are equivalent (-BMP is the same as -bmp).
+British spellings are also accepted (e.g., -greyscale), though for brevity
+these are not mentioned below.
diff --git a/jpeg/cderror.h b/jpeg/cderror.h
index fd1884f1..bb45b066 100644
--- a/jpeg/cderror.h
+++ b/jpeg/cderror.h
@@ -2,7 +2,7 @@
* cderror.h
*
* Copyright (C) 1994-1997, Thomas G. Lane.
- * Modified 2009-2017 by Guido Vollbeding.
+ * Modified 2009-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -60,6 +60,7 @@ JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d")
JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB")
JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file")
JMESSAGE(JERR_GIF_NOT, "Not a GIF file")
+JMESSAGE(JERR_GIF_OUTOFRANGE, "Numeric value out of range in GIF file")
JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image")
JMESSAGE(JTRC_GIF_BADVERSION,
"Warning: unexpected GIF version number '%c%c%c'")
diff --git a/jpeg/change.log b/jpeg/change.log
index ed8ec6af..7d459313 100644
--- a/jpeg/change.log
+++ b/jpeg/change.log
@@ -1,6 +1,20 @@
CHANGE LOG for Independent JPEG Group's JPEG software
+Version 9e 16-Jan-2022
+-----------------------
+
+Include alternate user interface files for cjpeg/djpeg.
+
+jcparam.c: change default chrominance DC quantization factor
+for lossless support. Note: Requires rebuild of test images.
+
+rdgif.c, cderror.h: add sanity check for GIF image dimensions.
+Thank to Casper Sun for cjpeg potential vulnerability report.
+
+Add ARM and ARM64 platform support in the Visual Studio build.
+
+
Version 9d 12-Jan-2020
-----------------------
diff --git a/jpeg/cjpegalt.c b/jpeg/cjpegalt.c
new file mode 100644
index 00000000..4f35b04b
--- /dev/null
+++ b/jpeg/cjpegalt.c
@@ -0,0 +1,791 @@
+/*
+ * alternate cjpeg.c
+ *
+ * Copyright (C) 1991-1998, Thomas G. Lane.
+ * Modified 2009-2020 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains an alternate user interface for the JPEG compressor.
+ * One or more input files are named on the command line, and output file
+ * names are created by substituting ".jpg" for the input file's extension.
+ */
+
+#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
+#include "jversion.h" /* for version message */
+
+#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
+#ifdef __MWERKS__
+#include <SIOUX.h> /* Metrowerks needs this */
+#include <console.h> /* ... and this */
+#endif
+#ifdef THINK_C
+#include <console.h> /* Think declares it here */
+#endif
+#endif
+
+#ifndef PATH_MAX /* ANSI maximum-pathname-length constant */
+#define PATH_MAX 256
+#endif
+
+
+/* Create the add-on message string table. */
+
+#define JMESSAGE(code,string) string ,
+
+static const char * const cdjpeg_message_table[] = {
+#include "cderror.h"
+ NULL
+};
+
+
+/*
+ * Automatic determination of available memory.
+ */
+
+static long default_maxmem; /* saves value determined at startup, or 0 */
+
+#ifndef FREE_MEM_ESTIMATE /* may be defined from command line */
+
+#ifdef MSDOS /* For MS-DOS (unless flat-memory model) */
+
+#include <dos.h> /* for access to intdos() call */
+
+LOCAL(long)
+unused_dos_memory (void)
+/* Obtain total amount of unallocated DOS memory */
+{
+ union REGS regs;
+ long nparas;
+
+ regs.h.ah = 0x48; /* DOS function Allocate Memory Block */
+ regs.x.bx = 0xFFFF; /* Ask for more memory than DOS can have */
+ (void) intdos(&regs, &regs);
+ /* DOS will fail and return # of paragraphs actually available in BX. */
+ nparas = (unsigned int) regs.x.bx;
+ /* Times 16 to convert to bytes. */
+ return nparas << 4;
+}
+
+/* The default memory setting is 95% of the available space. */
+#define FREE_MEM_ESTIMATE ((unused_dos_memory() * 95L) / 100L)
+
+#endif /* MSDOS */
+
+#ifdef ATARI /* For Atari ST/STE/TT, Pure C or Turbo C */
+
+#include <ext.h>
+
+/* The default memory setting is 90% of the available space. */
+#define FREE_MEM_ESTIMATE (((long) coreleft() * 90L) / 100L)
+
+#endif /* ATARI */
+
+/* Add memory-estimation procedures for other operating systems here,
+ * with appropriate #ifdef's around them.
+ */
+
+#endif /* !FREE_MEM_ESTIMATE */
+
+
+/*
+ * This routine determines what format the input file is,
+ * and selects the appropriate input-reading module.
+ *
+ * To determine which family of input formats the file belongs to,
+ * we may look only at the first byte of the file, since C does not
+ * guarantee that more than one character can be pushed back with ungetc.
+ * Looking at additional bytes would require one of these approaches:
+ * 1) assume we can fseek() the input file (fails for piped input);
+ * 2) assume we can push back more than one character (works in
+ * some C implementations, but unportable);
+ * 3) provide our own buffering (breaks input readers that want to use
+ * stdio directly, such as the RLE library);
+ * or 4) don't put back the data, and modify the input_init methods to assume
+ * they start reading after the start of file (also breaks RLE library).
+ * #1 is attractive for MS-DOS but is untenable on Unix.
+ *
+ * The most portable solution for file types that can't be identified by their
+ * first byte is to make the user tell us what they are. This is also the
+ * only approach for "raw" file types that contain only arbitrary values.
+ * We presently apply this method for Targa files. Most of the time Targa
+ * files start with 0x00, so we recognize that case. Potentially, however,
+ * a Targa file could start with any byte value (byte 0 is the length of the
+ * seldom-used ID field), so we provide a switch to force Targa input mode.
+ */
+
+static boolean is_targa; /* records user -targa switch */
+
+
+LOCAL(cjpeg_source_ptr)
+select_file_type (j_compress_ptr cinfo, FILE * infile)
+{
+ int c;
+
+ if (is_targa) {
+#ifdef TARGA_SUPPORTED
+ return jinit_read_targa(cinfo);
+#else
+ ERREXIT(cinfo, JERR_TGA_NOTCOMP);
+#endif
+ }
+
+ if ((c = getc(infile)) == EOF)
+ ERREXIT(cinfo, JERR_INPUT_EMPTY);
+ if (ungetc(c, infile) == EOF)
+ ERREXIT(cinfo, JERR_UNGETC_FAILED);
+
+ switch (c) {
+#ifdef BMP_SUPPORTED
+ case 'B':
+ return jinit_read_bmp(cinfo);
+#endif
+#ifdef GIF_SUPPORTED
+ case 'G':
+ return jinit_read_gif(cinfo);
+#endif
+#ifdef PPM_SUPPORTED
+ case 'P':
+ return jinit_read_ppm(cinfo);
+#endif
+#ifdef RLE_SUPPORTED
+ case 'R':
+ return jinit_read_rle(cinfo);
+#endif
+#ifdef TARGA_SUPPORTED
+ case 0x00:
+ return jinit_read_targa(cinfo);
+#endif
+ default:
+ ERREXIT(cinfo, JERR_UNKNOWN_FORMAT);
+ break;
+ }
+
+ return NULL; /* suppress compiler warnings */
+}
+
+
+/*
+ * Argument-parsing code.
+ * The switch parser is designed to be useful with DOS-style command line
+ * syntax, ie, intermixed switches and file names, where only the switches
+ * to the left of a given file name affect processing of that file.
+ */
+
+
+static const char * progname; /* program name for error messages */
+static char * outfilename; /* for -outfile switch */
+
+
+LOCAL(void)
+usage (void)
+/* complain about bad command line */
+{
+ fprintf(stderr, "usage: %s [switches] inputfile(s)\n", progname);
+ fprintf(stderr, "List of input files may use wildcards (* and ?)\n");
+ fprintf(stderr, "Output filename is same as input filename, but extension .jpg\n");
+
+ fprintf(stderr, "Switches (names may be abbreviated):\n");
+ fprintf(stderr, " -quality N[,...] Compression quality (0..100; 5-95 is useful range)\n");
+ fprintf(stderr, " -grayscale Create monochrome JPEG file\n");
+ fprintf(stderr, " -rgb Create RGB JPEG file\n");
+#ifdef ENTROPY_OPT_SUPPORTED
+ fprintf(stderr, " -optimize Optimize Huffman table (smaller file, but slow compression)\n");
+#endif
+#ifdef C_PROGRESSIVE_SUPPORTED
+ fprintf(stderr, " -progressive Create progressive JPEG file\n");
+#endif
+#ifdef DCT_SCALING_SUPPORTED
+ fprintf(stderr, " -scale M/N Scale image by fraction M/N, eg, 1/2\n");
+#endif
+#ifdef TARGA_SUPPORTED
+ fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n");
+#endif
+ fprintf(stderr, "Switches for advanced users:\n");
+#ifdef C_ARITH_CODING_SUPPORTED
+ fprintf(stderr, " -arithmetic Use arithmetic coding\n");
+#endif
+#ifdef DCT_SCALING_SUPPORTED
+ fprintf(stderr, " -block N DCT block size (1..16; default is 8)\n");
+#endif
+#if JPEG_LIB_VERSION_MAJOR >= 9
+ fprintf(stderr, " -rgb1 Create RGB JPEG file with reversible color transform\n");
+ fprintf(stderr, " -bgycc Create big gamut YCC JPEG file\n");
+#endif
+#ifdef DCT_ISLOW_SUPPORTED
+ fprintf(stderr, " -dct int Use integer DCT method%s\n",
+ (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+ fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n",
+ (JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+ fprintf(stderr, " -dct float Use floating-point DCT method%s\n",
+ (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
+#endif
+ fprintf(stderr, " -nosmooth Don't use high-quality downsampling\n");
+ fprintf(stderr, " -restart N Set restart interval in rows, or in blocks with B\n");
+#ifdef INPUT_SMOOTHING_SUPPORTED
+ fprintf(stderr, " -smooth N Smooth dithered input (N=1..100 is strength)\n");
+#endif
+#ifndef FREE_MEM_ESTIMATE
+ fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
+#endif
+ fprintf(stderr, " -outfile name Specify name for output file\n");
+ fprintf(stderr, " -verbose or -debug Emit debug output\n");
+ fprintf(stderr, "Switches for wizards:\n");
+ fprintf(stderr, " -baseline Force baseline quantization tables\n");
+ fprintf(stderr, " -qtables file Use quantization tables given in file\n");
+ fprintf(stderr, " -qslots N[,...] Set component quantization tables\n");
+ fprintf(stderr, " -sample HxV[,...] Set component sampling factors\n");
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+ fprintf(stderr, " -scans file Create multi-scan JPEG per script file\n");
+#endif
+ exit(EXIT_FAILURE);
+}
+
+
+LOCAL(int)
+parse_switches (j_compress_ptr cinfo, int argc, char **argv,
+ int last_file_arg_seen, boolean for_real)
+/* Parse optional switches.
+ * Returns argv[] index of first file-name argument (== argc if none).
+ * Any file names with indexes <= last_file_arg_seen are ignored;
+ * they have presumably been processed in a previous iteration.
+ * (Pass 0 for last_file_arg_seen on the first or only iteration.)
+ * for_real is FALSE on the first (dummy) pass; we may skip any expensive
+ * processing.
+ */
+{
+ int argn;
+ char * arg;
+ boolean force_baseline;
+ boolean simple_progressive;
+ char * qualityarg = NULL; /* saves -quality parm if any */
+ char * qtablefile = NULL; /* saves -qtables filename if any */
+ char * qslotsarg = NULL; /* saves -qslots parm if any */
+ char * samplearg = NULL; /* saves -sample parm if any */
+ char * scansarg = NULL; /* saves -scans parm if any */
+
+ /* Set up default JPEG parameters. */
+
+ force_baseline = FALSE; /* by default, allow 16-bit quantizers */
+ simple_progressive = FALSE;
+ is_targa = FALSE;
+ outfilename = NULL;
+ cinfo->err->trace_level = 0;
+ if (default_maxmem > 0) /* override library's default value */
+ cinfo->mem->max_memory_to_use = default_maxmem;
+
+ /* Scan command line options, adjust parameters */
+
+ for (argn = 1; argn < argc; argn++) {
+ arg = argv[argn];
+ if (*arg != '-') {
+ /* Not a switch, must be a file name argument */
+ if (argn <= last_file_arg_seen) {
+ outfilename = NULL; /* -outfile applies to just one input file */
+ continue; /* ignore this name if previously processed */
+ }
+ break; /* else done parsing switches */
+ }
+ arg++; /* advance past switch marker character */
+
+ if (keymatch(arg, "arithmetic", 1)) {
+ /* Use arithmetic coding. */
+#ifdef C_ARITH_CODING_SUPPORTED
+ cinfo->arith_code = TRUE;
+#else
+ fprintf(stderr, "%s: sorry, arithmetic coding not supported\n",
+ progname);
+ exit(EXIT_FAILURE);
+#endif
+
+ } else if (keymatch(arg, "baseline", 2)) {
+ /* Force baseline-compatible output (8-bit quantizer values). */
+ force_baseline = TRUE;
+
+ } else if (keymatch(arg, "block", 2)) {
+ /* Set DCT block size. */
+#if defined DCT_SCALING_SUPPORTED && JPEG_LIB_VERSION_MAJOR >= 8 && \
+ (JPEG_LIB_VERSION_MAJOR > 8 || JPEG_LIB_VERSION_MINOR >= 3)
+ int val;
+
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (sscanf(argv[argn], "%d", &val) != 1)
+ usage();
+ if (val < 1 || val > 16)
+ usage();
+ cinfo->block_size = val;
+#else
+ fprintf(stderr, "%s: sorry, block size setting not supported\n",
+ progname);
+ exit(EXIT_FAILURE);
+#endif
+
+ } else if (keymatch(arg, "dct", 2)) {
+ /* Select DCT algorithm. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (keymatch(argv[argn], "int", 1)) {
+ cinfo->dct_method = JDCT_ISLOW;
+ } else if (keymatch(argv[argn], "fast", 2)) {
+ cinfo->dct_method = JDCT_IFAST;
+ } else if (keymatch(argv[argn], "float", 2)) {
+ cinfo->dct_method = JDCT_FLOAT;
+ } else
+ usage();
+
+ } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
+ /* Enable debug printouts. */
+ /* On first -d, print version identification */
+ static boolean printed_version = FALSE;
+
+ if (! printed_version) {
+ fprintf(stderr, "Independent JPEG Group's CJPEG, version %s\n%s\n",
+ JVERSION, JCOPYRIGHT);
+ printed_version = TRUE;
+ }
+ cinfo->err->trace_level++;
+
+ } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) {
+ /* Force a monochrome JPEG file to be generated. */
+ jpeg_set_colorspace(cinfo, JCS_GRAYSCALE);
+
+ } else if (keymatch(arg, "rgb", 3) || keymatch(arg, "rgb1", 4)) {
+ /* Force an RGB JPEG file to be generated. */
+#if JPEG_LIB_VERSION_MAJOR >= 9
+ /* Note: Entropy table assignment in jpeg_set_colorspace depends
+ * on color_transform.
+ */
+ cinfo->color_transform = arg[3] ? JCT_SUBTRACT_GREEN : JCT_NONE;
+#endif
+ jpeg_set_colorspace(cinfo, JCS_RGB);
+
+ } else if (keymatch(arg, "bgycc", 5)) {
+ /* Force a big gamut YCC JPEG file to be generated. */
+#if JPEG_LIB_VERSION_MAJOR >= 9 && \
+ (JPEG_LIB_VERSION_MAJOR > 9 || JPEG_LIB_VERSION_MINOR >= 1)
+ jpeg_set_colorspace(cinfo, JCS_BG_YCC);
+#else
+ fprintf(stderr, "%s: sorry, BG_YCC colorspace not supported\n",
+ progname);
+ exit(EXIT_FAILURE);
+#endif
+
+ } else if (keymatch(arg, "maxmemory", 3)) {
+ /* Maximum memory in Kb (or Mb with 'm'). */
+ long lval;
+ char ch = 'x';
+
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
+ usage();
+ if (ch == 'm' || ch == 'M')
+ lval *= 1000L;
+ cinfo->mem->max_memory_to_use = lval * 1000L;
+
+ } else if (keymatch(arg, "nosmooth", 3)) {
+ /* Suppress fancy downsampling. */
+ cinfo->do_fancy_downsampling = FALSE;
+
+ } else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) {
+ /* Enable entropy parm optimization. */
+#ifdef ENTROPY_OPT_SUPPORTED
+ cinfo->optimize_coding = TRUE;
+#else
+ fprintf(stderr, "%s: sorry, entropy optimization was not compiled\n",
+ progname);
+ exit(EXIT_FAILURE);
+#endif
+
+ } else if (keymatch(arg, "outfile", 4)) {
+ /* Set output file name. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ outfilename = argv[argn]; /* save it away for later use */
+
+ } else if (keymatch(arg, "progressive", 1)) {
+ /* Select simple progressive mode. */
+#ifdef C_PROGRESSIVE_SUPPORTED
+ simple_progressive = TRUE;
+ /* We must postpone execution until num_components is known. */
+#else
+ fprintf(stderr, "%s: sorry, progressive output was not compiled\n",
+ progname);
+ exit(EXIT_FAILURE);
+#endif
+
+ } else if (keymatch(arg, "quality", 1)) {
+ /* Quality ratings (quantization table scaling factors). */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ qualityarg = argv[argn];
+
+ } else if (keymatch(arg, "qslots", 2)) {
+ /* Quantization table slot numbers. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ qslotsarg = argv[argn];
+ /* Must delay setting qslots until after we have processed any
+ * colorspace-determining switches, since jpeg_set_colorspace sets
+ * default quant table numbers.
+ */
+
+ } else if (keymatch(arg, "qtables", 2)) {
+ /* Quantization tables fetched from file. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ qtablefile = argv[argn];
+ /* We postpone actually reading the file in case -quality comes later. */
+
+ } else if (keymatch(arg, "restart", 1)) {
+ /* Restart interval in MCU rows (or in MCUs with 'b'). */
+ long lval;
+ char ch = 'x';
+
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
+ usage();
+ if (lval < 0 || lval > 65535L)
+ usage();
+ if (ch == 'b' || ch == 'B') {
+ cinfo->restart_interval = (unsigned int) lval;
+ cinfo->restart_in_rows = 0; /* else prior '-restart n' overrides me */
+ } else {
+ cinfo->restart_in_rows = (int) lval;
+ /* restart_interval will be computed during startup */
+ }
+
+ } else if (keymatch(arg, "sample", 2)) {
+ /* Set sampling factors. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ samplearg = argv[argn];
+ /* Must delay setting sample factors until after we have processed any
+ * colorspace-determining switches, since jpeg_set_colorspace sets
+ * default sampling factors.
+ */
+
+ } else if (keymatch(arg, "scale", 4)) {
+ /* Scale the image by a fraction M/N. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (sscanf(argv[argn], "%d/%d",
+ &cinfo->scale_num, &cinfo->scale_denom) != 2)
+ usage();
+
+ } else if (keymatch(arg, "scans", 4)) {
+ /* Set scan script. */
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ scansarg = argv[argn];
+ /* We must postpone reading the file in case -progressive appears. */
+#else
+ fprintf(stderr, "%s: sorry, multi-scan output was not compiled\n",
+ progname);
+ exit(EXIT_FAILURE);
+#endif
+
+ } else if (keymatch(arg, "smooth", 2)) {
+ /* Set input smoothing factor. */
+ int val;
+
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (sscanf(argv[argn], "%d", &val) != 1)
+ usage();
+ if (val < 0 || val > 100)
+ usage();
+ cinfo->smoothing_factor = val;
+
+ } else if (keymatch(arg, "targa", 1)) {
+ /* Input file is Targa format. */
+ is_targa = TRUE;
+
+ } else {
+ usage(); /* bogus switch */
+ }
+ }
+
+ /* Post-switch-scanning cleanup */
+
+ if (for_real) {
+
+ /* Set quantization tables for selected quality. */
+ /* Some or all may be overridden if -qtables is present. */
+ if (qualityarg != NULL) /* process -quality if it was present */
+ if (! set_quality_ratings(cinfo, qualityarg, force_baseline))
+ usage();
+
+ if (qtablefile != NULL) /* process -qtables if it was present */
+ if (! read_quant_tables(cinfo, qtablefile, force_baseline))
+ usage();
+
+ if (qslotsarg != NULL) /* process -qslots if it was present */
+ if (! set_quant_slots(cinfo, qslotsarg))
+ usage();
+
+ if (samplearg != NULL) /* process -sample if it was present */
+ if (! set_sample_factors(cinfo, samplearg))
+ usage();
+
+#ifdef C_PROGRESSIVE_SUPPORTED
+ if (simple_progressive) /* process -progressive; -scans can override */
+ jpeg_simple_progression(cinfo);
+#endif
+
+#ifdef C_MULTISCAN_FILES_SUPPORTED
+ if (scansarg != NULL) /* process -scans if it was present */
+ if (! read_scan_script(cinfo, scansarg))
+ usage();
+#endif
+ }
+
+ return argn; /* return index of next arg (file name) */
+}
+
+
+/*
+ * Check for overwrite of an existing file; clear it with user
+ */
+
+#ifndef NO_OVERWRITE_CHECK
+
+LOCAL(boolean)
+is_write_ok (char * outfname)
+{
+ FILE * ofile;
+ int ch;
+
+ ofile = fopen(outfname, READ_BINARY);
+ if (ofile == NULL)
+ return TRUE; /* not present */
+ fclose(ofile); /* oops, it is present */
+
+ for (;;) {
+ fprintf(stderr, "%s already exists, overwrite it? [y/n] ",
+ outfname);
+ fflush(stderr);
+ ch = getc(stdin);
+ if (ch != '\n') /* flush rest of line */
+ while (getc(stdin) != '\n')
+ /* nothing */;
+
+ switch (ch) {
+ case 'Y':
+ case 'y':
+ return TRUE;
+ case 'N':
+ case 'n':
+ return FALSE;
+ /* otherwise, ask again */
+ }
+ }
+}
+
+#endif
+
+
+/*
+ * Process a single input file name, and return its index in argv[].
+ * File names at or to left of old_file_index have been processed already.
+ */
+
+LOCAL(int)
+process_one_file (int argc, char **argv, int old_file_index)
+{
+ struct jpeg_compress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ char *infilename;
+ char workfilename[PATH_MAX];
+#ifdef PROGRESS_REPORT
+ struct cdjpeg_progress_mgr progress;
+#endif
+ int file_index;
+ cjpeg_source_ptr src_mgr;
+ FILE * input_file = NULL;
+ FILE * output_file = NULL;
+ JDIMENSION num_scanlines;
+
+ /* Initialize the JPEG compression object with default error handling. */
+ cinfo.err = jpeg_std_error(&jerr);
+ jpeg_create_compress(&cinfo);
+ /* Add some application-specific error messages (from cderror.h) */
+ jerr.addon_message_table = cdjpeg_message_table;
+ jerr.first_addon_message = JMSG_FIRSTADDONCODE;
+ jerr.last_addon_message = JMSG_LASTADDONCODE;
+
+ /* Now safe to enable signal catcher. */
+#ifdef NEED_SIGNAL_CATCHER
+ enable_signal_catcher((j_common_ptr) &cinfo);
+#endif
+
+ /* Initialize JPEG parameters.
+ * Much of this may be overridden later.
+ * In particular, we don't yet know the input file's color space,
+ * but we need to provide some value for jpeg_set_defaults() to work.
+ */
+
+ cinfo.in_color_space = JCS_RGB; /* arbitrary guess */
+ jpeg_set_defaults(&cinfo);
+
+ /* Scan command line to find next file name.
+ * It is convenient to use just one switch-parsing routine, but the switch
+ * values read here are ignored; we will rescan the switches after opening
+ * the input file.
+ */
+
+ file_index = parse_switches(&cinfo, argc, argv, old_file_index, FALSE);
+ if (file_index >= argc) {
+ fprintf(stderr, "%s: missing input file name\n", progname);
+ usage();
+ }
+
+ /* Open the input file. */
+ infilename = argv[file_index];
+ if ((input_file = fopen(infilename, READ_BINARY)) == NULL) {
+ fprintf(stderr, "%s: can't open %s\n", progname, infilename);
+ goto fail;
+ }
+
+#ifdef PROGRESS_REPORT
+ start_progress_monitor((j_common_ptr) &cinfo, &progress);
+#endif
+
+ /* Figure out the input file format, and set up to read it. */
+ src_mgr = select_file_type(&cinfo, input_file);
+ src_mgr->input_file = input_file;
+
+ /* Read the input file header to obtain file size & colorspace. */
+ (*src_mgr->start_input) (&cinfo, src_mgr);
+
+ /* Now that we know input colorspace, fix colorspace-dependent defaults */
+ jpeg_default_colorspace(&cinfo);
+
+ /* Adjust default compression parameters by re-parsing the options */
+ file_index = parse_switches(&cinfo, argc, argv, old_file_index, TRUE);
+
+ /* If user didn't supply -outfile switch, select output file name. */
+ if (outfilename == NULL) {
+ int i;
+
+ outfilename = workfilename;
+ /* Make outfilename be infilename with .jpg substituted for extension */
+ strcpy(outfilename, infilename);
+ for (i = (int)strlen(outfilename)-1; i >= 0; i--) {
+ switch (outfilename[i]) {
+ case ':':
+ case '/':
+ case '\\':
+ i = 0; /* stop scanning */
+ break;
+ case '.':
+ outfilename[i] = '\0'; /* lop off existing extension */
+ i = 0; /* stop scanning */
+ break;
+ default:
+ break; /* keep scanning */
+ }
+ }
+ strcat(outfilename, ".jpg");
+ }
+
+ fprintf(stderr, "Compressing %s => %s\n", infilename, outfilename);
+#ifndef NO_OVERWRITE_CHECK
+ if (! is_write_ok(outfilename))
+ goto fail;
+#endif
+
+ /* Open the output file. */
+ if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
+ fprintf(stderr, "%s: can't create %s\n", progname, outfilename);
+ goto fail;
+ }
+
+ /* Specify data destination for compression */
+ jpeg_stdio_dest(&cinfo, output_file);
+
+ /* Start compressor */
+ jpeg_start_compress(&cinfo, TRUE);
+
+ /* Process data */
+ while (cinfo.next_scanline < cinfo.image_height) {
+ num_scanlines = (*src_mgr->get_pixel_rows) (&cinfo, src_mgr);
+ (void) jpeg_write_scanlines(&cinfo, src_mgr->buffer, num_scanlines);
+ }
+
+ /* Finish compression and release memory */
+ (*src_mgr->finish_input) (&cinfo, src_mgr);
+ jpeg_finish_compress(&cinfo);
+
+ /* Clean up and exit */
+fail:
+ jpeg_destroy_compress(&cinfo);
+
+ if (input_file != NULL) fclose(input_file);
+ if (output_file != NULL) fclose(output_file);
+
+#ifdef PROGRESS_REPORT
+ end_progress_monitor((j_common_ptr) &cinfo);
+#endif
+
+ /* Disable signal catcher. */
+#ifdef NEED_SIGNAL_CATCHER
+ enable_signal_catcher((j_common_ptr) NULL);
+#endif
+
+ return file_index;
+}
+
+
+/*
+ * The main program.
+ */
+
+int
+main (int argc, char **argv)
+{
+ int file_index;
+
+ /* On Mac, fetch a command line. */
+#ifdef USE_CCOMMAND
+ argc = ccommand(&argv);
+#endif
+
+#ifdef MSDOS
+ progname = "cjpeg"; /* DOS tends to be too verbose about argv[0] */
+#else
+ progname = argv[0];
+ if (progname == NULL || progname[0] == 0)
+ progname = "cjpeg"; /* in case C library doesn't provide it */
+#endif
+
+ /* The default maxmem must be computed only once at program startup,
+ * since releasing memory with free() won't give it back to the OS.
+ */
+#ifdef FREE_MEM_ESTIMATE
+ default_maxmem = FREE_MEM_ESTIMATE;
+#else
+ default_maxmem = 0;
+#endif
+
+ /* Scan command line, parse switches and locate input file names */
+
+ if (argc < 2)
+ usage(); /* nothing on the command line?? */
+
+ file_index = 0;
+
+ while (file_index < argc-1)
+ file_index = process_one_file(argc, argv, file_index);
+
+ /* All done. */
+ exit(EXIT_SUCCESS);
+ return 0; /* suppress no-return-value warnings */
+}
diff --git a/jpeg/compile b/jpeg/compile
index 99e50524..df363c8f 100755
--- a/jpeg/compile
+++ b/jpeg/compile
@@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -53,7 +53,7 @@ func_file_conv ()
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
@@ -67,7 +67,7 @@ func_file_conv ()
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
diff --git a/jpeg/config.guess b/jpeg/config.guess
deleted file mode 100755
index 256083a7..00000000
--- a/jpeg/config.guess
+++ /dev/null
@@ -1,1476 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright 1992-2018 Free Software Foundation, Inc.
-
-timestamp='2018-03-08'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 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, see <https://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-#
-# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
-#
-# You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
-#
-# Please send patches to <config-patches@gnu.org>.
-
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Options:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright 1992-2018 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > "$dummy.c" ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-case "$UNAME_SYSTEM" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval "$set_cc_for_build"
- cat <<-EOF > "$dummy.c"
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
-
- # If ldd exists, use it to detect musl libc.
- if command -v ldd >/dev/null && \
- ldd --version 2>&1 | grep -q ^musl
- then
- LIBC=musl
- fi
- ;;
-esac
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
- "/sbin/$sysctl" 2>/dev/null || \
- "/usr/sbin/$sysctl" 2>/dev/null || \
- echo unknown)`
- case "$UNAME_MACHINE_ARCH" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- earmv*)
- arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
- endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
- machine="${arch}${endian}"-unknown
- ;;
- *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently (or will in the future) and ABI.
- case "$UNAME_MACHINE_ARCH" in
- earm*)
- os=netbsdelf
- ;;
- arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval "$set_cc_for_build"
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ELF__
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # Determine ABI tags.
- case "$UNAME_MACHINE_ARCH" in
- earm*)
- expr='s/^earmv[0-9]/-eabi/;s/eb$//'
- abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "$UNAME_VERSION" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "$machine-${os}${release}${abi}"
- exit ;;
- *:Bitrig:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
- exit ;;
- *:LibertyBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
- echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
- exit ;;
- *:MidnightBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
- exit ;;
- *:ekkoBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
- exit ;;
- *:SolidBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
- exit ;;
- *:MirBSD:*:*)
- echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
- exit ;;
- *:Sortix:*:*)
- echo "$UNAME_MACHINE"-unknown-sortix
- exit ;;
- *:Redox:*:*)
- echo "$UNAME_MACHINE"-unknown-redox
- exit ;;
- mips:OSF1:*.*)
- echo mips-dec-osf1
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE=alpha ;;
- "EV4.5 (21064)")
- UNAME_MACHINE=alpha ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE=alpha ;;
- "EV5 (21164)")
- UNAME_MACHINE=alphaev5 ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE=alphaev56 ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE=alphapca56 ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE=alphapca57 ;;
- "EV6 (21264)")
- UNAME_MACHINE=alphaev6 ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE=alphaev67 ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE=alphaev68 ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE=alphaev68 ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE=alphaev68 ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE=alphaev69 ;;
- "EV7 (21364)")
- UNAME_MACHINE=alphaev7 ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE=alphaev79 ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo "$UNAME_MACHINE"-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo "$UNAME_MACHINE"-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix"$UNAME_RELEASE"
- exit ;;
- arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- s390x:SunOS:*:*)
- echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
- exit ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
- exit ;;
- i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux"$UNAME_RELEASE"
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval "$set_cc_for_build"
- SUN_ARCH=i386
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- SUN_ARCH=x86_64
- fi
- fi
- echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos"$UNAME_RELEASE"
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos"$UNAME_RELEASE"
- ;;
- sun4)
- echo sparc-sun-sunos"$UNAME_RELEASE"
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos"$UNAME_RELEASE"
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint"$UNAME_RELEASE"
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint"$UNAME_RELEASE"
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint"$UNAME_RELEASE"
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint"$UNAME_RELEASE"
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint"$UNAME_RELEASE"
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint"$UNAME_RELEASE"
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten"$UNAME_RELEASE"
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten"$UNAME_RELEASE"
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix"$UNAME_RELEASE"
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix"$UNAME_RELEASE"
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix"$UNAME_RELEASE"
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval "$set_cc_for_build"
- sed 's/^ //' << EOF > "$dummy.c"
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
- dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos"$UNAME_RELEASE"
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
- then
- if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
- [ "$TARGET_BINARY_INTERFACE"x = x ]
- then
- echo m88k-dg-dgux"$UNAME_RELEASE"
- else
- echo m88k-dg-dguxbcs"$UNAME_RELEASE"
- fi
- else
- echo i586-dg-dgux"$UNAME_RELEASE"
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
- fi
- echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval "$set_cc_for_build"
- sed 's/^ //' << EOF > "$dummy.c"
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[4567])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/lslpp ] ; then
- IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
- awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
- else
- IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
- fi
- echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
- case "$UNAME_MACHINE" in
- 9000/31?) HP_ARCH=m68000 ;;
- 9000/[34]??) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "$sc_cpu_version" in
- 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
- 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "$sc_kernel_bits" in
- 32) HP_ARCH=hppa2.0n ;;
- 64) HP_ARCH=hppa2.0w ;;
- '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "$HP_ARCH" = "" ]; then
- eval "$set_cc_for_build"
- sed 's/^ //' << EOF > "$dummy.c"
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ "$HP_ARCH" = hppa2.0w ]
- then
- eval "$set_cc_for_build"
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
- grep -q __LP64__
- then
- HP_ARCH=hppa2.0w
- else
- HP_ARCH=hppa64
- fi
- fi
- echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux"$HPUX_REV"
- exit ;;
- 3050*:HI-UX:*:*)
- eval "$set_cc_for_build"
- sed 's/^ //' << EOF > "$dummy.c"
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo "$UNAME_MACHINE"-unknown-osf1mk
- else
- echo "$UNAME_MACHINE"-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
- FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
- FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
- FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi"$UNAME_RELEASE"
- exit ;;
- *:BSD/OS:*:*)
- echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
- exit ;;
- *:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- case "$UNAME_PROCESSOR" in
- amd64)
- UNAME_PROCESSOR=x86_64 ;;
- i386)
- UNAME_PROCESSOR=i586 ;;
- esac
- echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
- exit ;;
- i*:CYGWIN*:*)
- echo "$UNAME_MACHINE"-pc-cygwin
- exit ;;
- *:MINGW64*:*)
- echo "$UNAME_MACHINE"-pc-mingw64
- exit ;;
- *:MINGW*:*)
- echo "$UNAME_MACHINE"-pc-mingw32
- exit ;;
- *:MSYS*:*)
- echo "$UNAME_MACHINE"-pc-msys
- exit ;;
- i*:PW*:*)
- echo "$UNAME_MACHINE"-pc-pw32
- exit ;;
- *:Interix*:*)
- case "$UNAME_MACHINE" in
- x86)
- echo i586-pc-interix"$UNAME_RELEASE"
- exit ;;
- authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix"$UNAME_RELEASE"
- exit ;;
- IA64)
- echo ia64-unknown-interix"$UNAME_RELEASE"
- exit ;;
- esac ;;
- i*:UWIN*:*)
- echo "$UNAME_MACHINE"-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
- exit ;;
- i*86:Minix:*:*)
- echo "$UNAME_MACHINE"-pc-minix
- exit ;;
- aarch64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- aarch64_be:Linux:*:*)
- UNAME_MACHINE=aarch64_be
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- arm*:Linux:*:*)
- eval "$set_cc_for_build"
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- else
- if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_PCS_VFP
- then
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
- else
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
- fi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- cris:Linux:*:*)
- echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
- exit ;;
- crisv32:Linux:*:*)
- echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
- exit ;;
- e2k:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- frv:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- hexagon:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- i*86:Linux:*:*)
- echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
- exit ;;
- ia64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- k1om:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- m32r*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- m68*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- mips:Linux:*:* | mips64:Linux:*:*)
- eval "$set_cc_for_build"
- sed 's/^ //' << EOF > "$dummy.c"
- #undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
- #else
- CPU=
- #endif
- #endif
-EOF
- eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
- test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
- ;;
- mips64el:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- openrisc*:Linux:*:*)
- echo or1k-unknown-linux-"$LIBC"
- exit ;;
- or32:Linux:*:* | or1k*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- padre:Linux:*:*)
- echo sparc-unknown-linux-"$LIBC"
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-"$LIBC"
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
- PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
- *) echo hppa-unknown-linux-"$LIBC" ;;
- esac
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-"$LIBC"
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-"$LIBC"
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-"$LIBC"
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-"$LIBC"
- exit ;;
- riscv32:Linux:*:* | riscv64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
- exit ;;
- sh64*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- sh*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- tile*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- vax:Linux:*:*)
- echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
- exit ;;
- x86_64:Linux:*:*)
- echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
- exit ;;
- xtensa*:Linux:*:*)
- echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
- exit ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo "$UNAME_MACHINE"-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo "$UNAME_MACHINE"-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo "$UNAME_MACHINE"-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo "$UNAME_MACHINE"-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
- i*86:*DOS:*:*)
- echo "$UNAME_MACHINE"-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:*)
- UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
- else
- echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
- else
- echo "$UNAME_MACHINE"-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
- # Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configure will decide that
- # this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- NCR*:*:4.2:* | MPRAS*:*:4.2:*)
- OS_REL='.3'
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos"$UNAME_RELEASE"
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv"$UNAME_RELEASE"
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo "$UNAME_MACHINE"-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo "$UNAME_MACHINE"-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux"$UNAME_RELEASE"
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv"$UNAME_RELEASE"
- else
- echo mips-unknown-sysv"$UNAME_RELEASE"
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux"$UNAME_RELEASE"
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux"$UNAME_RELEASE"
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux"$UNAME_RELEASE"
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux"$UNAME_RELEASE"
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux"$UNAME_RELEASE"
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux"$UNAME_RELEASE"
- exit ;;
- SX-ACE:SUPER-UX:*:*)
- echo sxace-nec-superux"$UNAME_RELEASE"
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody"$UNAME_RELEASE"
- exit ;;
- *:Rhapsody:*:*)
- echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval "$set_cc_for_build"
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
- if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_PPC >/dev/null
- then
- UNAME_PROCESSOR=powerpc
- fi
- fi
- elif test "$UNAME_PROCESSOR" = i386 ; then
- # Avoid executing cc on OS X 10.9, as it ships with a stub
- # that puts up a graphical alert prompting to install
- # developer tools. Any system running Mac OS X 10.7 or
- # later (Darwin 11 and later) is required to have a 64-bit
- # processor. This is not true of the ARM version of Darwin
- # that Apple uses in portable devices.
- UNAME_PROCESSOR=x86_64
- fi
- echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = x86; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-*:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk"$UNAME_RELEASE"
- exit ;;
- NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk"$UNAME_RELEASE"
- exit ;;
- NSR-*:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk"$UNAME_RELEASE"
- exit ;;
- NSV-*:NONSTOP_KERNEL:*:*)
- echo nsv-tandem-nsk"$UNAME_RELEASE"
- exit ;;
- NSX-*:NONSTOP_KERNEL:*:*)
- echo nsx-tandem-nsk"$UNAME_RELEASE"
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = 386; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo "$UNAME_MACHINE"-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux"$UNAME_RELEASE"
- exit ;;
- *:DragonFly:*:*)
- echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "$UNAME_MACHINE" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
- exit ;;
- i*86:rdos:*:*)
- echo "$UNAME_MACHINE"-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo "$UNAME_MACHINE"-pc-aros
- exit ;;
- x86_64:VMkernel:*:*)
- echo "$UNAME_MACHINE"-unknown-esx
- exit ;;
- amd64:Isilon\ OneFS:*:*)
- echo x86_64-unknown-onefs
- exit ;;
-esac
-
-echo "$0: unable to guess system type" >&2
-
-case "$UNAME_MACHINE:$UNAME_SYSTEM" in
- mips:Linux | mips64:Linux)
- # If we got here on MIPS GNU/Linux, output extra information.
- cat >&2 <<EOF
-
-NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
-the system type. Please install a C compiler and try again.
-EOF
- ;;
-esac
-
-cat >&2 <<EOF
-
-This script (version $timestamp), has failed to recognize the
-operating system you are using. If your script is old, overwrite *all*
-copies of config.guess and config.sub with the latest versions from:
-
- https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
-and
- https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-
-If $0 has already been updated, send the following data and any
-information you think might be pertinent to config-patches@gnu.org to
-provide the necessary information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = "$UNAME_MACHINE"
-UNAME_RELEASE = "$UNAME_RELEASE"
-UNAME_SYSTEM = "$UNAME_SYSTEM"
-UNAME_VERSION = "$UNAME_VERSION"
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/jpeg/config.sub b/jpeg/config.sub
deleted file mode 100755
index 9ccf09a7..00000000
--- a/jpeg/config.sub
+++ /dev/null
@@ -1,1801 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright 1992-2018 Free Software Foundation, Inc.
-
-timestamp='2018-03-08'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 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, see <https://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches to <config-patches@gnu.org>.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
-
-Canonicalize a configuration name.
-
-Options:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright 1992-2018 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo "$1"
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
- kopensolaris*-gnu* | cloudabi*-eabi* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
- if [ "$basic_machine" != "$1" ]
- then os=`echo "$1" | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | ba \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | e2k | epiphany \
- | fido | fr30 | frv | ft32 \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia16 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pru \
- | pyramid \
- | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | visium \
- | wasm32 \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- leon|leon[3-9])
- basic_machine=sparc-$basic_machine
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- xscaleeb)
- basic_machine=armeb-unknown
- ;;
-
- xscaleel)
- basic_machine=armel-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | ba-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | e2k-* | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa32r6-* | mipsisa32r6el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64r6-* | mipsisa64r6el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | or1k*-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pru-* \
- | pyramid-* \
- | riscv32-* | riscv64-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | visium-* \
- | wasm32-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-pc
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- asmjs)
- basic_machine=asmjs-unknown
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2*)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- e500v[12])
- basic_machine=powerpc-unknown
- os=$os"spe"
- ;;
- e500v[12]-*)
- basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- os=$os"spe"
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
- i*86v32)
- basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- leon-*|leon[3-9]-*)
- basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- moxiebox)
- basic_machine=moxie-unknown
- os=-moxiebox
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next)
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- nsv-tandem)
- basic_machine=nsv-tandem
- ;;
- nsx-tandem)
- basic_machine=nsx-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- x64)
- basic_machine=x86_64-pc
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases that might get confused
- # with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
- ;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # es1800 is here to avoid being matched by es* (a different OS)
- -es1800*)
- os=-ose
- ;;
- # Now accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST end in a * to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* | -cloudabi* | -sortix* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
- | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
- | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
- | -midnightbsd*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -xray | -os68k* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo "$os" | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2)
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -pikeos*)
- # Until real need of OS specific support for
- # particular features comes up, bare metal
- # configurations are quite functional.
- case $basic_machine in
- arm*)
- os=-eabi
- ;;
- *)
- os=-elf
- ;;
- esac
- ;;
- -nacl*)
- ;;
- -ios)
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- c8051-*)
- os=-elf
- ;;
- hexagon-*)
- os=-elf
- ;;
- tic54x-*)
- os=-coff
- ;;
- tic55x-*)
- os=-coff
- ;;
- tic6x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- pru-*)
- os=-elf
- ;;
- *-be)
- os=-beos
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next)
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -cnk*|-aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo "$basic_machine$os"
-exit
-
-# Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/jpeg/configure b/jpeg/configure
deleted file mode 100755
index ccd339d1..00000000
--- a/jpeg/configure
+++ /dev/null
@@ -1,15885 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libjpeg 9.4.0.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1
-
- test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
- ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
- PATH=/empty FPATH=/empty; export PATH FPATH
- test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
- || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='libjpeg'
-PACKAGE_TARNAME='libjpeg'
-PACKAGE_VERSION='9.4.0'
-PACKAGE_STRING='libjpeg 9.4.0'
-PACKAGE_BUGREPORT=''
-PACKAGE_URL=''
-
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-LIBOBJS
-JPEG_LIB_VERSION_MINOR
-JPEG_LIB_VERSION_MAJOR
-JPEG_LIB_VERSION
-MEMORYMGR
-LT_SYS_LIBRARY_PATH
-OTOOL64
-OTOOL
-LIPO
-NMEDIT
-DSYMUTIL
-MANIFEST_TOOL
-RANLIB
-NM
-ac_ct_DUMPBIN
-DUMPBIN
-LD
-FGREP
-SED
-LIBTOOL
-OBJDUMP
-DLLTOOL
-AS
-EGREP
-GREP
-HAVE_LD_VERSION_SCRIPT_FALSE
-HAVE_LD_VERSION_SCRIPT_TRUE
-ac_ct_AR
-AR
-LN_S
-CPP
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-target_os
-target_vendor
-target_cpu
-target
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL
-am__quote'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_silent_rules
-enable_maintainer_mode
-enable_dependency_tracking
-enable_ld_version_script
-enable_shared
-enable_static
-with_pic
-enable_fast_install
-with_aix_soname
-with_gnu_ld
-with_sysroot
-enable_libtool_lock
-enable_maxmem
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP
-LT_SYS_LIBRARY_PATH'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-if test "$ac_init_help" = "long"; then
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat <<_ACEOF
-\`configure' configures libjpeg 9.4.0 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/libjpeg]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
- --target=TARGET configure for building compilers for TARGET [HOST]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of libjpeg 9.4.0:";;
- esac
- cat <<\_ACEOF
-
-Optional Features:
- --disable-option-checking ignore unrecognized --enable/--with options
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --enable-silent-rules less verbose build output (undo: "make V=1")
- --disable-silent-rules verbose build output (undo: "make V=0")
- --enable-maintainer-mode
- enable make rules and dependencies not useful (and
- sometimes confusing) to the casual installer
- --enable-dependency-tracking
- do not reject slow dependency extractors
- --disable-dependency-tracking
- speeds up one-time build
- --enable-ld-version-script
- enable linker version script (default is enabled
- when possible)
- --enable-shared[=PKGS] build shared libraries [default=yes]
- --enable-static[=PKGS] build static libraries [default=yes]
- --enable-fast-install[=PKGS]
- optimize for fast installation [default=yes]
- --disable-libtool-lock avoid locking (might break parallel builds)
- --enable-maxmem=N enable use of temp files, set max mem usage to N MB
-
-Optional Packages:
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
- both]
- --with-aix-soname=aix|svr4|both
- shared library versioning (aka "SONAME") variant to
- provide on AIX, [default=aix].
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
- compiler's sysroot if not specified).
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CPP C preprocessor
- LT_SYS_LIBRARY_PATH
- User-defined run-time library search path.
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to the package provider.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-libjpeg configure 9.4.0
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_check_func LINENO FUNC VAR
-# ----------------------------------
-# Tests whether FUNC exists, setting the cache variable VAR accordingly
-ac_fn_c_check_func ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $2 innocuous_$2
-
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $2 (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $2
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char $2 ();
-/* The GNU C library defines this for functions which it implements
- to always fail with ENOSYS. Some functions are actually named
- something starting with __ and the normal name is an alias. */
-#if defined __stub_$2 || defined __stub___$2
-choke me
-#endif
-
-int
-main ()
-{
-return $2 ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_func
-cat >config.log <<_ACEOF
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-
-It was created by libjpeg $as_me 9.4.0, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-# Directory where autotools helper scripts lives.
-ac_aux_dir=
-for ac_dir in . "$srcdir"/.; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
-# Generate configuration headers.
-ac_config_headers="$ac_config_headers jconfig.h:jconfig.cfg"
-
-
-# Hack: disable autoheader so that it doesn't overwrite our cfg template.
-AUTOHEADER="echo autoheader ignored"
-
-# Check system type
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$target_alias" = x; then
- ac_cv_target=$ac_cv_host
-else
- ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
-
-
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
- test "$program_prefix$program_suffix$program_transform_name" = \
- NONENONEs,x,x, &&
- program_prefix=${target_alias}-
-
-# Initialize Automake
-# Don't require all the GNU mandated files
-am__api_version='1.16'
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
- alias in your environment" "$LINENO" 5
- fi
- if test "$2" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
- am_sleep_pid=$!
-fi
-
-rm -f conftest.file
-
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
- am_missing_run="$MISSING "
-else
- am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
- enableval=$enable_silent_rules;
-fi
-
-case $enable_silent_rules in # (((
- yes) AM_DEFAULT_VERBOSITY=0;;
- no) AM_DEFAULT_VERBOSITY=1;;
- *) AM_DEFAULT_VERBOSITY=1;;
-esac
-am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AM_BACKSLASH='\'
-
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='libjpeg'
- VERSION='9.4.0'
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# For better backward compatibility. To be removed once Automake 1.9.x
-# dies out for good. For more background, see:
-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-mkdir_p='$(MKDIR_P)'
-
-# We need awk for the "check" target (and possibly the TAP driver). The
-# system "awk" is bad on some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-
-# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar pax cpio none'
-
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-
-
-
-
-
-
-# POSIX will say in a future version that running "rm -f" with no argument
-# is OK; and we want to be able to make that assumption in our Makefile
-# recipes. So use an aggressive probe to check that the usage we want is
-# actually supported "in the wild" to an acceptable degree.
-# See automake bug#10828.
-# To make any issue more visible, cause the running configure to be aborted
-# by default if the 'rm' program in use doesn't match our expectations; the
-# user can still override this though.
-if rm -f && rm -fr && rm -rf; then : OK; else
- cat >&2 <<'END'
-Oops!
-
-Your 'rm' program seems unable to run without file operands specified
-on the command line, even when the '-f' option is present. This is contrary
-to the behaviour of most rm programs out there, and not conforming with
-the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
-
-Please tell bug-automake@gnu.org about your system, including the value
-of your $PATH and any error possibly output before this message. This
-can help us improve future automake versions.
-
-END
- if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
- echo 'Configuration will proceed anyway, since you have set the' >&2
- echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
- echo >&2
- else
- cat >&2 <<'END'
-Aborting the configuration process, to ensure you take notice of the issue.
-
-You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <https://www.gnu.org/software/coreutils/>.
-
-If you want to complete the configuration process using your problematic
-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
-to "yes", and re-run configure.
-
-END
- as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
- fi
-fi
-
-
-# Make --enable-silent-rules the default.
-# To get verbose build output you may configure
-# with --disable-silent-rules or use "make V=1".
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
- enableval=$enable_silent_rules;
-fi
-
-case $enable_silent_rules in # (((
- yes) AM_DEFAULT_VERBOSITY=0;;
- no) AM_DEFAULT_VERBOSITY=1;;
- *) AM_DEFAULT_VERBOSITY=0;;
-esac
-am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if $as_echo 'TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
- @$(TRUE)
-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
- am_cv_make_support_nested_variables=yes
-else
- am_cv_make_support_nested_variables=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
- AM_V='$(V)'
- AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
- AM_V=$AM_DEFAULT_VERBOSITY
- AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AM_BACKSLASH='\'
-
-
-# Add configure option --enable-maintainer-mode which enables
-# dependency checking and generation useful to package maintainers.
-# This is made an option to avoid confusing end users.
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
-$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
- # Check whether --enable-maintainer-mode was given.
-if test "${enable_maintainer_mode+set}" = set; then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-
-# Check for programs
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
- # Make sure it works both with $CC and with simple cc.
- # Following AC_PROG_CC_C_O, we do the test twice because some
- # compilers refuse to overwrite an existing .o file with -o,
- # though they will create one.
- am_cv_prog_cc_c_o=yes
- for am_i in 1 2; do
- if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
- ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } \
- && test -f conftest2.$ac_objext; then
- : OK
- else
- am_cv_prog_cc_c_o=no
- break
- fi
- done
- rm -f core conftest*
- unset am_i
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
-if test "$am_cv_prog_cc_c_o" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
-$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
-cat > confinc.mk << 'END'
-am__doit:
- @echo this is the am__doit target >confinc.out
-.PHONY: am__doit
-END
-am__include="#"
-am__quote=
-# BSD make does it like this.
-echo '.include "confinc.mk" # ignored' > confmf.BSD
-# Other make implementations (GNU, Solaris 10, AIX) do it like this.
-echo 'include confinc.mk # ignored' > confmf.GNU
-_am_result=no
-for s in GNU BSD; do
- { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
- (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- case $?:`cat confinc.out 2>/dev/null` in #(
- '0:this is the am__doit target') :
- case $s in #(
- BSD) :
- am__include='.include' am__quote='"' ;; #(
- *) :
- am__include='include' am__quote='' ;;
-esac ;; #(
- *) :
- ;;
-esac
- if test "$am__include" != "#"; then
- _am_result="yes ($s style)"
- break
- fi
-done
-rm -f confinc.* confmf.*
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
-$as_echo "${_am_result}" >&6; }
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
- case $ac_cv_prog_cc_stdc in #(
- no) :
- ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
- *) :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
-$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
-if ${ac_cv_prog_cc_c99+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c99=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <stdio.h>
-
-// Check varargs macros. These examples are taken from C99 6.10.3.5.
-#define debug(...) fprintf (stderr, __VA_ARGS__)
-#define showlist(...) puts (#__VA_ARGS__)
-#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
-static void
-test_varargs_macros (void)
-{
- int x = 1234;
- int y = 5678;
- debug ("Flag");
- debug ("X = %d\n", x);
- showlist (The first, second, and third items.);
- report (x>y, "x is %d but y is %d", x, y);
-}
-
-// Check long long types.
-#define BIG64 18446744073709551615ull
-#define BIG32 4294967295ul
-#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
-#if !BIG_OK
- your preprocessor is broken;
-#endif
-#if BIG_OK
-#else
- your preprocessor is broken;
-#endif
-static long long int bignum = -9223372036854775807LL;
-static unsigned long long int ubignum = BIG64;
-
-struct incomplete_array
-{
- int datasize;
- double data[];
-};
-
-struct named_init {
- int number;
- const wchar_t *name;
- double average;
-};
-
-typedef const char *ccp;
-
-static inline int
-test_restrict (ccp restrict text)
-{
- // See if C++-style comments work.
- // Iterate through items via the restricted pointer.
- // Also check for declarations in for loops.
- for (unsigned int i = 0; *(text+i) != '\0'; ++i)
- continue;
- return 0;
-}
-
-// Check varargs and va_copy.
-static void
-test_varargs (const char *format, ...)
-{
- va_list args;
- va_start (args, format);
- va_list args_copy;
- va_copy (args_copy, args);
-
- const char *str;
- int number;
- float fnumber;
-
- while (*format)
- {
- switch (*format++)
- {
- case 's': // string
- str = va_arg (args_copy, const char *);
- break;
- case 'd': // int
- number = va_arg (args_copy, int);
- break;
- case 'f': // float
- fnumber = va_arg (args_copy, double);
- break;
- default:
- break;
- }
- }
- va_end (args_copy);
- va_end (args);
-}
-
-int
-main ()
-{
-
- // Check bool.
- _Bool success = false;
-
- // Check restrict.
- if (test_restrict ("String literal") == 0)
- success = true;
- char *restrict newvar = "Another string";
-
- // Check varargs.
- test_varargs ("s, d' f .", "string", 65, 34.234);
- test_varargs_macros ();
-
- // Check flexible array members.
- struct incomplete_array *ia =
- malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
- ia->datasize = 10;
- for (int i = 0; i < ia->datasize; ++i)
- ia->data[i] = i * 1.234;
-
- // Check named initializers.
- struct named_init ni = {
- .number = 34,
- .name = L"Test wide string",
- .average = 543.34343,
- };
-
- ni.number = 58;
-
- int dynamic_array[ni.number];
- dynamic_array[ni.number - 1] = 543;
-
- // work around unused variable warnings
- return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
- || dynamic_array[ni.number - 1] != 543);
-
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c99=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c99" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c99" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c99"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
-$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c99" != xno; then :
- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
- ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
-else
- ac_cv_prog_cc_stdc=no
-fi
-
-fi
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
-$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
- if ${ac_cv_prog_cc_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-
- case $ac_cv_prog_cc_stdc in #(
- no) :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;; #(
- '') :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;; #(
- *) :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
-$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
-esac
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-
-if test -n "$ac_tool_prefix"; then
- for ac_prog in ar lib "link -lib"
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AR" && break
- done
-fi
-if test -z "$AR"; then
- ac_ct_AR=$AR
- for ac_prog in ar lib "link -lib"
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_AR" && break
-done
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-fi
-
-: ${AR=ar}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
-$as_echo_n "checking the archiver ($AR) interface... " >&6; }
-if ${am_cv_ar_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- am_cv_ar_interface=ar
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int some_variable = 0;
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
- (eval $am_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -eq 0; then
- am_cv_ar_interface=ar
- else
- am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
- (eval $am_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -eq 0; then
- am_cv_ar_interface=lib
- else
- am_cv_ar_interface=unknown
- fi
- fi
- rm -f conftest.lib libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
-$as_echo "$am_cv_ar_interface" >&6; }
-
-case $am_cv_ar_interface in
-ar)
- ;;
-lib)
- # Microsoft lib, so override with the ar-lib wrapper script.
- # FIXME: It is wrong to rewrite AR.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__AR in this case,
- # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
- # similar.
- AR="$am_aux_dir/ar-lib $AR"
- ;;
-unknown)
- as_fn_error $? "could not determine $AR interface" "$LINENO" 5
- ;;
-esac
-
-
-# Check if LD supports linker scripts,
-# and define automake conditional HAVE_LD_VERSION_SCRIPT if so.
-# Check whether --enable-ld-version-script was given.
-if test "${enable_ld_version_script+set}" = set; then :
- enableval=$enable_ld_version_script; have_ld_version_script=$enableval
-fi
-
-if test -z "$have_ld_version_script"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if LD -Wl,--version-script works" >&5
-$as_echo_n "checking if LD -Wl,--version-script works... " >&6; }
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
- cat > conftest.map <<EOF
-VERS_1 {
- global: sym;
-};
-
-VERS_2 {
- global: sym;
-} VERS_1;
-EOF
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- have_ld_version_script=yes
-else
- have_ld_version_script=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- rm -f conftest.map
- LDFLAGS="$save_LDFLAGS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_ld_version_script" >&5
-$as_echo "$have_ld_version_script" >&6; }
-fi
- if test "$have_ld_version_script" = "yes"; then
- HAVE_LD_VERSION_SCRIPT_TRUE=
- HAVE_LD_VERSION_SCRIPT_FALSE='#'
-else
- HAVE_LD_VERSION_SCRIPT_TRUE='#'
- HAVE_LD_VERSION_SCRIPT_FALSE=
-fi
-
-
-# See if compiler supports prototypes.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for function prototypes" >&5
-$as_echo_n "checking for function prototypes... " >&6; }
-if ${ijg_cv_have_prototypes+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int testfunction (int arg1, int * arg2); /* check prototypes */
-struct methods_struct { /* check method-pointer declarations */
- int (*error_exit) (char *msgtext);
- int (*trace_message) (char *msgtext);
- int (*another_method) (void);
-};
-int testfunction (int arg1, int * arg2) /* check definitions */
-{ return arg2[arg1]; }
-int test2function (void) /* check void arg list */
-{ return 0; }
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ijg_cv_have_prototypes=yes
-else
- ijg_cv_have_prototypes=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_cv_have_prototypes" >&5
-$as_echo "$ijg_cv_have_prototypes" >&6; }
-if test $ijg_cv_have_prototypes = yes; then
-
-$as_echo "#define HAVE_PROTOTYPES 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your compiler does not seem to know about function prototypes.
- Perhaps it needs a special switch to enable ANSI C mode.
- If so, we recommend running configure like this:
- ./configure CC='cc -switch'
- where -switch is the proper switch." >&5
-$as_echo "$as_me: WARNING: Your compiler does not seem to know about function prototypes.
- Perhaps it needs a special switch to enable ANSI C mode.
- If so, we recommend running configure like this:
- ./configure CC='cc -switch'
- where -switch is the proper switch." >&2;}
-fi
-
-# Check header files
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in stddef.h stdlib.h locale.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default"
-if test "x$ac_cv_header_string_h" = xyes; then :
-
-else
-
-$as_echo "#define NEED_BSD_STRINGS 1" >>confdefs.h
-
-fi
-
-
-
-# See whether type size_t is defined in any ANSI-standard places;
-# if not, perhaps it is defined in <sys/types.h>.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for size_t" >&5
-$as_echo_n "checking for size_t... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#ifdef HAVE_STDDEF_H
-#include <stddef.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <stdio.h>
-#ifdef NEED_BSD_STRINGS
-#include <strings.h>
-#else
-#include <string.h>
-#endif
-typedef size_t my_size_t;
-
-int
-main ()
-{
- my_size_t foovar;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ijg_size_t_ok=yes
-else
- ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_size_t_ok" >&5
-$as_echo "$ijg_size_t_ok" >&6; }
-if test "$ijg_size_t_ok" != yes; then
- ac_fn_c_check_header_mongrel "$LINENO" "sys/types.h" "ac_cv_header_sys_types_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_types_h" = xyes; then :
-
-$as_echo "#define NEED_SYS_TYPES_H 1" >>confdefs.h
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "size_t" >/dev/null 2>&1; then :
- ijg_size_t_ok="size_t is in sys/types.h"
-else
- ijg_size_t_ok=no
-fi
-rm -f conftest*
-
-else
- ijg_size_t_ok=no
-fi
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_size_t_ok" >&5
-$as_echo "$ijg_size_t_ok" >&6; }
- if test "$ijg_size_t_ok" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Type size_t is not defined in any of the usual places.
- Try putting '\"typedef unsigned int size_t;\"' in jconfig.h." >&5
-$as_echo "$as_me: WARNING: Type size_t is not defined in any of the usual places.
- Try putting '\"typedef unsigned int size_t;\"' in jconfig.h." >&2;}
- fi
-fi
-
-# Check compiler characteristics
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type unsigned char" >&5
-$as_echo_n "checking for type unsigned char... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
- unsigned char un_char;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_UNSIGNED_CHAR 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type unsigned short" >&5
-$as_echo_n "checking for type unsigned short... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
- unsigned short un_short;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define HAVE_UNSIGNED_SHORT 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type void" >&5
-$as_echo_n "checking for type void... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Caution: a C++ compiler will insist on valid prototypes */
-typedef void * void_ptr; /* check void * */
-#ifdef HAVE_PROTOTYPES /* check ptr to function returning void */
-typedef void (*void_func) (int a, int b);
-#else
-typedef void (*void_func) ();
-#endif
-
-#ifdef HAVE_PROTOTYPES /* check void function result */
-void test3function (void_ptr arg1, void_func arg2)
-#else
-void test3function (arg1, arg2)
- void_ptr arg1;
- void_func arg2;
-#endif
-{
- char * locptr = (char *) arg1; /* check casting to and from void * */
- arg1 = (void *) locptr;
- (*arg2) (1, 2); /* check call of fcn returning void */
-}
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define void char" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if ${ac_cv_c_const+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
-#ifndef __cplusplus
- /* Ultrix mips cc rejects this sort of thing. */
- typedef int charset[2];
- const charset cs = { 0, 0 };
- /* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
- /* NEC SVR4.0.2 mips cc rejects this. */
- struct point {int x, y;};
- static struct point const zero = {0,0};
- /* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in
- an arm of an if-expression whose if-part is not a constant
- expression */
- const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
- /* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this sort of thing. */
- char tx;
- char *t = &tx;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
- if (s) return 0;
- }
- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
- }
- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
- }
- { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; } bx;
- struct s *b = &bx; b->j = 5;
- }
- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
- if (!foo) return 0;
- }
- return !cs[0] && !zero.x;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_const=yes
-else
- ac_cv_c_const=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-$as_echo "#define const /**/" >>confdefs.h
-
-fi
-
-
-# Check for non-broken inline under various spellings
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-ijg_cv_inline=""
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-} __inline__ int foo() { return 0; }
-int bar() { return foo();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ijg_cv_inline="__inline__"
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-} __inline int foo() { return 0; }
-int bar() { return foo();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ijg_cv_inline="__inline"
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-} inline int foo() { return 0; }
-int bar() { return foo();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ijg_cv_inline="inline"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ijg_cv_inline" >&5
-$as_echo "$ijg_cv_inline" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define INLINE $ijg_cv_inline
-_ACEOF
-
-
-# We cannot check for bogus warnings, but at least we can check for errors
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken incomplete types" >&5
-$as_echo_n "checking for broken incomplete types... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
- typedef struct undefined_structure * undef_struct_ptr;
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: broken" >&5
-$as_echo "broken" >&6; }
-
-$as_echo "#define INCOMPLETE_TYPES_BROKEN 1" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-# Test whether global names are unique to at least 15 chars
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for short external names" >&5
-$as_echo_n "checking for short external names... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int possibly_duplicate_function () { return 0; }
-int possibly_dupli_function () { return 1; }
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: short" >&5
-$as_echo "short" >&6; }
-
-$as_echo "#define NEED_SHORT_EXTERNAL_NAMES 1" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-# Run-time checks
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if char is signed" >&5
-$as_echo_n "checking to see if char is signed... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Assuming that char is signed on target machine.
- If it is unsigned, this will be a little bit inefficient." >&5
-$as_echo "$as_me: WARNING: Assuming that char is signed on target machine.
- If it is unsigned, this will be a little bit inefficient." >&2;}
-
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <stdio.h>
-#ifdef HAVE_PROTOTYPES
-int is_char_signed (int arg)
-#else
-int is_char_signed (arg)
- int arg;
-#endif
-{
- if (arg == 189) { /* expected result for unsigned char */
- return 0; /* type char is unsigned */
- }
- else if (arg != -67) { /* expected result for signed char */
- printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
- printf("I fear the JPEG software will not work at all.\n\n");
- }
- return 1; /* assume char is signed otherwise */
-}
-char signed_char_check = (char) (-67);
-int main() {
- exit(is_char_signed((int) signed_char_check));
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define CHAR_IS_UNSIGNED 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if right shift is signed" >&5
-$as_echo_n "checking to see if right shift is signed... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Assuming that right shift is signed on target machine." >&5
-$as_echo "Assuming that right shift is signed on target machine." >&6; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <stdio.h>
-#ifdef HAVE_PROTOTYPES
-int is_shifting_signed (long arg)
-#else
-int is_shifting_signed (arg)
- long arg;
-#endif
-/* See whether right-shift on a long is signed or not. */
-{
- long res = arg >> 4;
-
- if (res == -0x7F7E80CL) { /* expected result for signed shift */
- return 1; /* right shift is signed */
- }
- /* see if unsigned-shift hack will fix it. */
- /* we can't just test exact value since it depends on width of long... */
- res |= (~0L) << (32-4);
- if (res == -0x7F7E80CL) { /* expected result now? */
- return 0; /* right shift is unsigned */
- }
- printf("Right shift isn't acting as I expect it to.\n");
- printf("I fear the JPEG software will not work at all.\n\n");
- return 0; /* try it with unsigned anyway */
-}
-int main() {
- exit(is_shifting_signed(-0x7F7E80B1L));
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define RIGHT_SHIFT_IS_UNSIGNED 1" >>confdefs.h
-
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if fopen accepts b spec" >&5
-$as_echo_n "checking to see if fopen accepts b spec... " >&6; }
-if test "$cross_compiling" = yes; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: Assuming that it does." >&5
-$as_echo "Assuming that it does." >&6; }
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <stdio.h>
-int main() {
- if (fopen("conftestdata", "wb") != NULL)
- exit(0);
- exit(1);
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define DONT_USE_B_MODE 1" >>confdefs.h
-
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-# Configure libtool
-enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
-set dummy ${ac_tool_prefix}as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AS="${ac_tool_prefix}as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AS=$ac_cv_prog_AS
-if test -n "$AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
-$as_echo "$AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AS"; then
- ac_ct_AS=$AS
- # Extract the first word of "as", so it can be a program name with args.
-set dummy as; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AS+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AS"; then
- ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AS="as"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AS=$ac_cv_prog_ac_ct_AS
-if test -n "$ac_ct_AS"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
-$as_echo "$ac_ct_AS" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_AS" = x; then
- AS="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AS=$ac_ct_AS
- fi
-else
- AS="$ac_cv_prog_AS"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
- ac_ct_DLLTOOL=$DLLTOOL
- # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DLLTOOL"; then
- ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_DLLTOOL" = x; then
- DLLTOOL="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DLLTOOL=$ac_ct_DLLTOOL
- fi
-else
- DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OBJDUMP"; then
- ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
- ac_ct_OBJDUMP=$OBJDUMP
- # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OBJDUMP"; then
- ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OBJDUMP" = x; then
- OBJDUMP="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OBJDUMP=$ac_ct_OBJDUMP
- fi
-else
- OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
- ;;
-esac
-
-test -z "$AS" && AS=as
-
-
-
-
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-
-case `pwd` in
- *\ * | *\ *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.4.6'
-macro_revision='2.4.6'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain=$ac_aux_dir/ltmain.sh
-
-# Backslashify metacharacters that are still active within
-# double-quoted strings.
-sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
-ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
-$as_echo_n "checking how to print strings... " >&6; }
-# Test print first, because it will be a builtin if present.
-if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
- test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='print -r --'
-elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
- ECHO='printf %s\n'
-else
- # Use this function as a fallback that always works.
- func_fallback_echo ()
- {
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
- }
- ECHO='func_fallback_echo'
-fi
-
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
- $ECHO ""
-}
-
-case $ECHO in
- printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
-$as_echo "printf" >&6; } ;;
- print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
-$as_echo "print -r" >&6; } ;;
- *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
-$as_echo "cat" >&6; } ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
- for ac_i in 1 2 3 4 5 6 7; do
- ac_script="$ac_script$as_nl$ac_script"
- done
- echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
- { ac_script=; unset ac_script;}
- if test -z "$SED"; then
- ac_path_SED_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
- # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
- ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo '' >> "conftest.nl"
- "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_SED_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_SED="$ac_path_SED"
- ac_path_SED_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_SED_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_SED"; then
- as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
- fi
-else
- ac_cv_path_SED=$SED
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
- rm -f conftest.sed
-
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if ${ac_cv_path_FGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
- then ac_cv_path_FGREP="$GREP -F"
- else
- if test -z "$FGREP"; then
- ac_path_FGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in fgrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_FGREP" || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
- # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'FGREP' >> "conftest.nl"
- "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_FGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_FGREP="$ac_path_FGREP"
- ac_path_FGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_FGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_FGREP"; then
- as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_FGREP=$FGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-ac_prog=ld
-if test yes = "$GCC"; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return, which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD=$ac_prog
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test yes = "$with_gnu_ld"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${lt_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD=$ac_dir/$ac_prog
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test no != "$with_gnu_ld" && break
- ;;
- *)
- test yes != "$with_gnu_ld" && break
- ;;
- esac
- fi
- done
- IFS=$lt_save_ifs
-else
- lt_cv_path_LD=$LD # Let the user override the test with a path.
-fi
-fi
-
-LD=$lt_cv_path_LD
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${lt_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if ${lt_cv_path_NM+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM=$NM
-else
- lt_nm_to_check=${ac_tool_prefix}nm
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- tmp_nm=$ac_dir/$lt_tmp_nm
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
- case $build_os in
- mingw*) lt_bad_file=conftest.nm/nofile ;;
- *) lt_bad_file=/dev/null ;;
- esac
- case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
- *$lt_bad_file* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break 2
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break 2
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS=$lt_save_ifs
- done
- : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test no != "$lt_cv_path_NM"; then
- NM=$lt_cv_path_NM
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- if test -n "$DUMPBIN"; then :
- # Let the user override the test.
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in dumpbin "link -dump"
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DUMPBIN"; then
- ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$DUMPBIN" && break
- done
-fi
-if test -z "$DUMPBIN"; then
- ac_ct_DUMPBIN=$DUMPBIN
- for ac_prog in dumpbin "link -dump"
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DUMPBIN"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_DUMPBIN" && break
-done
-
- if test "x$ac_ct_DUMPBIN" = x; then
- DUMPBIN=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DUMPBIN=$ac_ct_DUMPBIN
- fi
-fi
-
- case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
- *COFF*)
- DUMPBIN="$DUMPBIN -symbols -headers"
- ;;
- *)
- DUMPBIN=:
- ;;
- esac
- fi
-
- if test : != "$DUMPBIN"; then
- NM=$DUMPBIN
- fi
-fi
-test -z "$NM" && NM=nm
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if ${lt_cv_nm_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&5
- (eval echo "\"\$as_me:$LINENO: output\"" >&5)
- cat conftest.out >&5
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if ${lt_cv_sys_max_cmd_len+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- i=0
- teststring=ABCD
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- mint*)
- # On MiNT this can take a long time and run out of memory.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- os2*)
- # The test takes a long time on OS/2.
- lt_cv_sys_max_cmd_len=8192
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len" && \
- test undefined != "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test X`env echo "$teststring$teststring" 2>/dev/null` \
- = "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test 17 != "$i" # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-
-fi
-
-if test -n "$lt_cv_sys_max_cmd_len"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-
-
-
-
-
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-
-
-
-
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
-$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
-if ${lt_cv_to_host_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
- ;;
- esac
- ;;
- *-*-cygwin* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
- ;;
- *-*-cygwin* )
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
- * ) # otherwise, assume *nix
- lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
- ;;
- esac
- ;;
- * ) # unhandled hosts (and "normal" native builds)
- lt_cv_to_host_file_cmd=func_convert_file_noop
- ;;
-esac
-
-fi
-
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
-$as_echo "$lt_cv_to_host_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
-$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
-if ${lt_cv_to_tool_file_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- #assume ordinary cross tools, or native build.
-lt_cv_to_tool_file_cmd=func_convert_file_noop
-case $host in
- *-*-mingw* )
- case $build in
- *-*-mingw* ) # actually msys
- lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
- ;;
- esac
- ;;
-esac
-
-fi
-
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
-$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if ${lt_cv_ld_reload_flag+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- if test yes != "$GCC"; then
- reload_cmds=false
- fi
- ;;
- darwin*)
- if test yes = "$GCC"; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
-set dummy ${ac_tool_prefix}objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OBJDUMP"; then
- ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OBJDUMP=$ac_cv_prog_OBJDUMP
-if test -n "$OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
-$as_echo "$OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OBJDUMP"; then
- ac_ct_OBJDUMP=$OBJDUMP
- # Extract the first word of "objdump", so it can be a program name with args.
-set dummy objdump; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OBJDUMP"; then
- ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OBJDUMP="objdump"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
-if test -n "$ac_ct_OBJDUMP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
-$as_echo "$ac_ct_OBJDUMP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OBJDUMP" = x; then
- OBJDUMP="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OBJDUMP=$ac_ct_OBJDUMP
- fi
-else
- OBJDUMP="$ac_cv_prog_OBJDUMP"
-fi
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if ${lt_cv_deplibs_check_method+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# 'unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# that responds to the $file_magic_cmd with a given extended regex.
-# If you have 'file' or equivalent on your system and you're not sure
-# whether 'pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[45]*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- if ( file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- # Keep this pattern in sync with the one in func_win32_libid.
- lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc*)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-haiku*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[3-9]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd* | bitrig*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-os2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$lt_cv_deplibs_check_method" >&6; }
-
-file_magic_glob=
-want_nocaseglob=no
-if test "$build" = "$host"; then
- case $host_os in
- mingw* | pw32*)
- if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
- want_nocaseglob=yes
- else
- file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
- fi
- ;;
- esac
-fi
-
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DLLTOOL=$ac_cv_prog_DLLTOOL
-if test -n "$DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
-$as_echo "$DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DLLTOOL"; then
- ac_ct_DLLTOOL=$DLLTOOL
- # Extract the first word of "dlltool", so it can be a program name with args.
-set dummy dlltool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DLLTOOL"; then
- ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DLLTOOL="dlltool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
-if test -n "$ac_ct_DLLTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
-$as_echo "$ac_ct_DLLTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_DLLTOOL" = x; then
- DLLTOOL="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DLLTOOL=$ac_ct_DLLTOOL
- fi
-else
- DLLTOOL="$ac_cv_prog_DLLTOOL"
-fi
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
-$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
-if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_sharedlib_from_linklib_cmd='unknown'
-
-case $host_os in
-cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh;
- # decide which one to use based on capabilities of $DLLTOOL
- case `$DLLTOOL --help 2>&1` in
- *--identify-strict*)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
- ;;
- *)
- lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
- ;;
- esac
- ;;
-*)
- # fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd=$ECHO
- ;;
-esac
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
-$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
-sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
-test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- for ac_prog in ar
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AR" && break
- done
-fi
-if test -z "$AR"; then
- ac_ct_AR=$AR
- for ac_prog in ar
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_AR" && break
-done
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-fi
-
-: ${AR=ar}
-: ${AR_FLAGS=cru}
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
-$as_echo_n "checking for archiver @FILE support... " >&6; }
-if ${lt_cv_ar_at_file+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ar_at_file=no
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- echo conftest.$ac_objext > conftest.lst
- lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test 0 -eq "$ac_status"; then
- # Ensure the archiver fails upon bogus file names.
- rm -f conftest.$ac_objext libconftest.a
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
- (eval $lt_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test 0 -ne "$ac_status"; then
- lt_cv_ar_at_file=@
- fi
- fi
- rm -f conftest.* libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
-$as_echo "$lt_cv_ar_at_file" >&6; }
-
-if test no = "$lt_cv_ar_at_file"; then
- archiver_list_spec=
-else
- archiver_list_spec=$lt_cv_ar_at_file
-fi
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- bitrig* | openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
-fi
-
-case $host_os in
- darwin*)
- lock_old_archive_extraction=yes ;;
- *)
- lock_old_archive_extraction=no ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if ${lt_cv_sys_global_symbol_pipe+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[BCDT]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[ABCDGISTW]'
- ;;
-hpux*)
- if test ia64 = "$host_cpu"; then
- symcode='[ABCDEGRST]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[BCDEGRST]'
- ;;
-osf*)
- symcode='[BCDEGQRST]'
- ;;
-solaris*)
- symcode='[BDRT]'
- ;;
-sco3.2v5*)
- symcode='[DT]'
- ;;
-sysv4.2uw2*)
- symcode='[DT]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[ABDT]'
- ;;
-sysv4)
- symcode='[DFNSTU]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[ABCDGIRSTW]' ;;
-esac
-
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Gets list of data symbols to import.
- lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
- # Adjust the below global symbol transforms to fixup imported variables.
- lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
- lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
- lt_c_name_lib_hook="\
- -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
- -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
-else
- # Disable hooks by default.
- lt_cv_sys_global_symbol_to_import=
- lt_cdecl_hook=
- lt_c_name_hook=
- lt_c_name_lib_hook=
-fi
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n"\
-$lt_cdecl_hook\
-" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
-$lt_c_name_hook\
-" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
-
-# Transform an extracted symbol line into symbol name with lib prefix and
-# symbol address.
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
-$lt_c_name_lib_hook\
-" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
-" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
-" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function,
- # D for any global variable and I for any imported variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK '"\
-" {last_section=section; section=\$ 3};"\
-" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
-" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
-" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
-" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
-" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
- lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
-/* DATA imports from DLLs on WIN32 can't be const, because runtime
- relocations are performed -- see ld's documentation on pseudo-relocs. */
-# define LT_DLSYM_CONST
-#elif defined __osf__
-/* This system does not cope well with relocations in const data. */
-# define LT_DLSYM_CONST
-#else
-# define LT_DLSYM_CONST const
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-LT_DLSYM_CONST struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_globsym_save_LIBS=$LIBS
- lt_globsym_save_CFLAGS=$CFLAGS
- LIBS=conftstm.$ac_objext
- CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest$ac_exeext; then
- pipe_works=yes
- fi
- LIBS=$lt_globsym_save_LIBS
- CFLAGS=$lt_globsym_save_CFLAGS
- else
- echo "cannot find nm_test_func in $nlist" >&5
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&5
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
- fi
- else
- echo "$progname: failed program was:" >&5
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test yes = "$pipe_works"; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-
-fi
-
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
-$as_echo "failed" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-
-# Response file support.
-if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- nm_file_list_spec='@'
-elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
- nm_file_list_spec='@'
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
-$as_echo_n "checking for sysroot... " >&6; }
-
-# Check whether --with-sysroot was given.
-if test "${with_sysroot+set}" = set; then :
- withval=$with_sysroot;
-else
- with_sysroot=no
-fi
-
-
-lt_sysroot=
-case $with_sysroot in #(
- yes)
- if test yes = "$GCC"; then
- lt_sysroot=`$CC --print-sysroot 2>/dev/null`
- fi
- ;; #(
- /*)
- lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
- ;; #(
- no|'')
- ;; #(
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
-$as_echo "$with_sysroot" >&6; }
- as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
- ;;
-esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
-$as_echo "${lt_sysroot:-no}" >&6; }
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
-$as_echo_n "checking for a working dd... " >&6; }
-if ${ac_cv_path_lt_DD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-: ${lt_DD:=$DD}
-if test -z "$lt_DD"; then
- ac_path_lt_DD_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in dd; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_lt_DD" || continue
-if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
- cmp -s conftest.i conftest.out \
- && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
-fi
- $ac_path_lt_DD_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_lt_DD"; then
- :
- fi
-else
- ac_cv_path_lt_DD=$lt_DD
-fi
-
-rm -f conftest.i conftest2.i conftest.out
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
-$as_echo "$ac_cv_path_lt_DD" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
-$as_echo_n "checking how to truncate binary pipes... " >&6; }
-if ${lt_cv_truncate_bin+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- printf 0123456789abcdef0123456789abcdef >conftest.i
-cat conftest.i conftest.i >conftest2.i
-lt_cv_truncate_bin=
-if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
- cmp -s conftest.i conftest.out \
- && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
-fi
-rm -f conftest.i conftest2.i conftest.out
-test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
-$as_echo "$lt_cv_truncate_bin" >&6; }
-
-
-
-
-
-
-
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-func_cc_basename ()
-{
- for cc_temp in $*""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
- done
- func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-}
-
-# Check whether --enable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then :
- enableval=$enable_libtool_lock;
-fi
-
-test no = "$enable_libtool_lock" || enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out what ABI is being produced by ac_compile, and set mode
- # options accordingly.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE=32
- ;;
- *ELF-64*)
- HPUX_IA64_MODE=64
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly.
- echo '#line '$LINENO' "configure"' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- if test yes = "$lt_cv_prog_gnu_ld"; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-mips64*-*linux*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly.
- echo '#line '$LINENO' "configure"' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- emul=elf
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- emul="${emul}32"
- ;;
- *64-bit*)
- emul="${emul}64"
- ;;
- esac
- case `/usr/bin/file conftest.$ac_objext` in
- *MSB*)
- emul="${emul}btsmip"
- ;;
- *LSB*)
- emul="${emul}ltsmip"
- ;;
- esac
- case `/usr/bin/file conftest.$ac_objext` in
- *N32*)
- emul="${emul}n32"
- ;;
- esac
- LD="${LD-ld} -m $emul"
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly. Note that the listed cases only cover the
- # situations where additional linker options are needed (such as when
- # doing 32-bit compilation for a host where ld defaults to 64-bit, or
- # vice versa); the common cases where no linker options are needed do
- # not appear in the list.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- case `/usr/bin/file conftest.o` in
- *x86-64*)
- LD="${LD-ld} -m elf32_x86_64"
- ;;
- *)
- LD="${LD-ld} -m elf_i386"
- ;;
- esac
- ;;
- powerpc64le-*linux*)
- LD="${LD-ld} -m elf32lppclinux"
- ;;
- powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- powerpcle-*linux*)
- LD="${LD-ld} -m elf64lppc"
- ;;
- powerpc-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS -belf"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
-$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
-if ${lt_cv_cc_needs_belf+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_cc_needs_belf=yes
-else
- lt_cv_cc_needs_belf=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
-$as_echo "$lt_cv_cc_needs_belf" >&6; }
- if test yes != "$lt_cv_cc_needs_belf"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS=$SAVE_CFLAGS
- fi
- ;;
-*-*solaris*)
- # Find out what ABI is being produced by ac_compile, and set linker
- # options accordingly.
- echo 'int i;' > conftest.$ac_ext
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*)
- case $host in
- i?86-*-solaris*|x86_64-*-solaris*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- sparc*-*-solaris*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
- if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD=${LD-ld}_sol2
- fi
- ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks=$enable_libtool_lock
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
-set dummy ${ac_tool_prefix}mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$MANIFEST_TOOL"; then
- ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
-if test -n "$MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
-$as_echo "$MANIFEST_TOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
- ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
- # Extract the first word of "mt", so it can be a program name with args.
-set dummy mt; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_MANIFEST_TOOL"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
-if test -n "$ac_ct_MANIFEST_TOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
-$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_MANIFEST_TOOL" = x; then
- MANIFEST_TOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
- fi
-else
- MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
-fi
-
-test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
-$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
-if ${lt_cv_path_mainfest_tool+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_path_mainfest_tool=no
- echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
- $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
- cat conftest.err >&5
- if $GREP 'Manifest Tool' conftest.out > /dev/null; then
- lt_cv_path_mainfest_tool=yes
- fi
- rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
-$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test yes != "$lt_cv_path_mainfest_tool"; then
- MANIFEST_TOOL=:
-fi
-
-
-
-
-
-
- case $host_os in
- rhapsody* | darwin*)
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
-set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$DSYMUTIL"; then
- ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-DSYMUTIL=$ac_cv_prog_DSYMUTIL
-if test -n "$DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
-$as_echo "$DSYMUTIL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_DSYMUTIL"; then
- ac_ct_DSYMUTIL=$DSYMUTIL
- # Extract the first word of "dsymutil", so it can be a program name with args.
-set dummy dsymutil; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_DSYMUTIL"; then
- ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
-if test -n "$ac_ct_DSYMUTIL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
-$as_echo "$ac_ct_DSYMUTIL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_DSYMUTIL" = x; then
- DSYMUTIL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- DSYMUTIL=$ac_ct_DSYMUTIL
- fi
-else
- DSYMUTIL="$ac_cv_prog_DSYMUTIL"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
-set dummy ${ac_tool_prefix}nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$NMEDIT"; then
- ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-NMEDIT=$ac_cv_prog_NMEDIT
-if test -n "$NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
-$as_echo "$NMEDIT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_NMEDIT"; then
- ac_ct_NMEDIT=$NMEDIT
- # Extract the first word of "nmedit", so it can be a program name with args.
-set dummy nmedit; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_NMEDIT"; then
- ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_NMEDIT="nmedit"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
-if test -n "$ac_ct_NMEDIT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
-$as_echo "$ac_ct_NMEDIT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_NMEDIT" = x; then
- NMEDIT=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- NMEDIT=$ac_ct_NMEDIT
- fi
-else
- NMEDIT="$ac_cv_prog_NMEDIT"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
-set dummy ${ac_tool_prefix}lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$LIPO"; then
- ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-LIPO=$ac_cv_prog_LIPO
-if test -n "$LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
-$as_echo "$LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_LIPO"; then
- ac_ct_LIPO=$LIPO
- # Extract the first word of "lipo", so it can be a program name with args.
-set dummy lipo; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_LIPO"; then
- ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_LIPO="lipo"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
-if test -n "$ac_ct_LIPO"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
-$as_echo "$ac_ct_LIPO" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_LIPO" = x; then
- LIPO=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- LIPO=$ac_ct_LIPO
- fi
-else
- LIPO="$ac_cv_prog_LIPO"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OTOOL"; then
- ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL=$ac_cv_prog_OTOOL
-if test -n "$OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
-$as_echo "$OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL"; then
- ac_ct_OTOOL=$OTOOL
- # Extract the first word of "otool", so it can be a program name with args.
-set dummy otool; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL"; then
- ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL="otool"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
-if test -n "$ac_ct_OTOOL"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
-$as_echo "$ac_ct_OTOOL" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OTOOL" = x; then
- OTOOL=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OTOOL=$ac_ct_OTOOL
- fi
-else
- OTOOL="$ac_cv_prog_OTOOL"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
-set dummy ${ac_tool_prefix}otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$OTOOL64"; then
- ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-OTOOL64=$ac_cv_prog_OTOOL64
-if test -n "$OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
-$as_echo "$OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_OTOOL64"; then
- ac_ct_OTOOL64=$OTOOL64
- # Extract the first word of "otool64", so it can be a program name with args.
-set dummy otool64; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_OTOOL64"; then
- ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_OTOOL64="otool64"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
-if test -n "$ac_ct_OTOOL64"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
-$as_echo "$ac_ct_OTOOL64" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_OTOOL64" = x; then
- OTOOL64=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- OTOOL64=$ac_ct_OTOOL64
- fi
-else
- OTOOL64="$ac_cv_prog_OTOOL64"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
-$as_echo_n "checking for -single_module linker flag... " >&6; }
-if ${lt_cv_apple_cc_single_mod+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_apple_cc_single_mod=no
- if test -z "$LT_MULTI_MODULE"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- # If there is a non-empty error log, and "single_module"
- # appears in it, assume the flag caused a linker warning
- if test -s conftest.err && $GREP single_module conftest.err; then
- cat conftest.err >&5
- # Otherwise, if the output was created with a 0 exit code from
- # the compiler, it worked.
- elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&5
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
-$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
-$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
-if ${lt_cv_ld_exported_symbols_list+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_ld_exported_symbols_list=yes
-else
- lt_cv_ld_exported_symbols_list=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
-$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
-$as_echo_n "checking for -force_load linker flag... " >&6; }
-if ${lt_cv_ld_force_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_ld_force_load=no
- cat > conftest.c << _LT_EOF
-int forced_loaded() { return 2;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
- $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
- echo "$AR cru libconftest.a conftest.o" >&5
- $AR cru libconftest.a conftest.o 2>&5
- echo "$RANLIB libconftest.a" >&5
- $RANLIB libconftest.a 2>&5
- cat > conftest.c << _LT_EOF
-int main() { return 0;}
-_LT_EOF
- echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
- $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
- _lt_result=$?
- if test -s conftest.err && $GREP force_load conftest.err; then
- cat conftest.err >&5
- elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
- lt_cv_ld_force_load=yes
- else
- cat conftest.err >&5
- fi
- rm -f conftest.err libconftest.a conftest conftest.c
- rm -rf conftest.dSYM
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
-$as_echo "$lt_cv_ld_force_load" >&6; }
- case $host_os in
- rhapsody* | darwin1.[012])
- _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- 10.[012][,.]*)
- _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test yes = "$lt_cv_apple_cc_single_mod"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test yes = "$lt_cv_ld_exported_symbols_list"; then
- _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
- fi
- if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-
-# func_munge_path_list VARIABLE PATH
-# -----------------------------------
-# VARIABLE is name of variable containing _space_ separated list of
-# directories to be munged by the contents of PATH, which is string
-# having a format:
-# "DIR[:DIR]:"
-# string "DIR[ DIR]" will be prepended to VARIABLE
-# ":DIR[:DIR]"
-# string "DIR[ DIR]" will be appended to VARIABLE
-# "DIRP[:DIRP]::[DIRA:]DIRA"
-# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
-# "DIRA[ DIRA]" will be appended to VARIABLE
-# "DIR[:DIR]"
-# VARIABLE will be replaced by "DIR[ DIR]"
-func_munge_path_list ()
-{
- case x$2 in
- x)
- ;;
- *:)
- eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
- ;;
- x:*)
- eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
- ;;
- *::*)
- eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
- eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
- ;;
- *)
- eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
- ;;
- esac
-}
-
-for ac_header in dlfcn.h
-do :
- ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
-"
-if test "x$ac_cv_header_dlfcn_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_DLFCN_H 1
-_ACEOF
-
-fi
-
-done
-
-
-
-
-
-# Set options
-
-
-
- enable_dlopen=no
-
-
-
- # Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then :
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for pkg in $enableval; do
- IFS=$lt_save_ifs
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else
- enable_shared=yes
-fi
-
-
-
-
-
-
-
-
-
- # Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then :
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for pkg in $enableval; do
- IFS=$lt_save_ifs
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else
- enable_static=yes
-fi
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-pic was given.
-if test "${with_pic+set}" = set; then :
- withval=$with_pic; lt_p=${PACKAGE-default}
- case $withval in
- yes|no) pic_mode=$withval ;;
- *)
- pic_mode=default
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for lt_pkg in $withval; do
- IFS=$lt_save_ifs
- if test "X$lt_pkg" = "X$lt_p"; then
- pic_mode=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else
- pic_mode=default
-fi
-
-
-
-
-
-
-
-
- # Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then :
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
- for pkg in $enableval; do
- IFS=$lt_save_ifs
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS=$lt_save_ifs
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-
-
-
-
-
-
-
-
- shared_archive_member_spec=
-case $host,$enable_shared in
-power*-*-aix[5-9]*,yes)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
-$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
-
-# Check whether --with-aix-soname was given.
-if test "${with_aix_soname+set}" = set; then :
- withval=$with_aix_soname; case $withval in
- aix|svr4|both)
- ;;
- *)
- as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
- ;;
- esac
- lt_cv_with_aix_soname=$with_aix_soname
-else
- if ${lt_cv_with_aix_soname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_with_aix_soname=aix
-fi
-
- with_aix_soname=$lt_cv_with_aix_soname
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
-$as_echo "$with_aix_soname" >&6; }
- if test aix != "$with_aix_soname"; then
- # For the AIX way of multilib, we name the shared archive member
- # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
- # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
- # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
- # the AIX toolchain works better with OBJECT_MODE set (default 32).
- if test 64 = "${OBJECT_MODE-32}"; then
- shared_archive_member_spec=shr_64
- else
- shared_archive_member_spec=shr
- fi
- fi
- ;;
-*)
- with_aix_soname=aix
- ;;
-esac
-
-
-
-
-
-
-
-
-
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS=$ltmain
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test -z "$LN_S" && LN_S="ln -s"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-if test -n "${ZSH_VERSION+set}"; then
- setopt NO_GLOB_SUBST
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
-$as_echo_n "checking for objdir... " >&6; }
-if ${lt_cv_objdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
-$as_echo "$lt_cv_objdir" >&6; }
-objdir=$lt_cv_objdir
-
-
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define LT_OBJDIR "$lt_cv_objdir/"
-_ACEOF
-
-
-
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test set != "${COLLECT_NAMES+set}"; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a '.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-old_CC=$CC
-old_CFLAGS=$CFLAGS
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-func_cc_basename $compiler
-cc_basename=$func_cc_basename_result
-
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
-$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD=$MAGIC_CMD
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/${ac_tool_prefix}file"; then
- lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD=$lt_cv_path_MAGIC_CMD
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS=$lt_save_ifs
- MAGIC_CMD=$lt_save_MAGIC_CMD
- ;;
-esac
-fi
-
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-
-
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
-$as_echo_n "checking for file... " >&6; }
-if ${lt_cv_path_MAGIC_CMD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $MAGIC_CMD in
-[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD=$MAGIC_CMD
- lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
- ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
- for ac_dir in $ac_dummy; do
- IFS=$lt_save_ifs
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/file"; then
- lt_cv_path_MAGIC_CMD=$ac_dir/"file"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD=$lt_cv_path_MAGIC_CMD
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS=$lt_save_ifs
- MAGIC_CMD=$lt_save_MAGIC_CMD
- ;;
-esac
-fi
-
-MAGIC_CMD=$lt_cv_path_MAGIC_CMD
-if test -n "$MAGIC_CMD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
-$as_echo "$MAGIC_CMD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- else
- MAGIC_CMD=:
- fi
-fi
-
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-
-lt_save_CC=$CC
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-objext=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-
-
-if test -n "$compiler"; then
-
-lt_prog_compiler_no_builtin_flag=
-
-if test yes = "$GCC"; then
- case $cc_basename in
- nvcc*)
- lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
- *)
- lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
- esac
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
-$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
-if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_rtti_exceptions=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_rtti_exceptions=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
-$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
- lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
-else
- :
-fi
-
-fi
-
-
-
-
-
-
- lt_prog_compiler_wl=
-lt_prog_compiler_pic=
-lt_prog_compiler_static=
-
-
- if test yes = "$GCC"; then
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_static='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- fi
- lt_prog_compiler_pic='-fPIC'
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- lt_prog_compiler_pic='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the '-m68020' flag to GCC prevents building anything better,
- # like '-m68040'.
- lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- lt_prog_compiler_pic='-DDLL_EXPORT'
- case $host_os in
- os2*)
- lt_prog_compiler_static='$wl-static'
- ;;
- esac
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- ;;
-
- haiku*)
- # PIC is the default for Haiku.
- # The "-static" flag exists, but is broken.
- lt_prog_compiler_static=
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
- ;;
-
- interix[3-9]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- lt_prog_compiler_can_build_shared=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic=-Kconform_pic
- fi
- ;;
-
- *)
- lt_prog_compiler_pic='-fPIC'
- ;;
- esac
-
- case $cc_basename in
- nvcc*) # Cuda Compiler Driver 2.2
- lt_prog_compiler_wl='-Xlinker '
- if test -n "$lt_prog_compiler_pic"; then
- lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
- fi
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- lt_prog_compiler_wl='-Wl,'
- if test ia64 = "$host_cpu"; then
- # AIX 5 now supports IA64 processor
- lt_prog_compiler_static='-Bstatic'
- else
- lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_prog_compiler_pic='-fno-common'
- case $cc_basename in
- nagfor*)
- # NAG Fortran compiler
- lt_prog_compiler_wl='-Wl,-Wl,,'
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
- esac
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic='-DDLL_EXPORT'
- case $host_os in
- os2*)
- lt_prog_compiler_static='$wl-static'
- ;;
- esac
- ;;
-
- hpux9* | hpux10* | hpux11*)
- lt_prog_compiler_wl='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- lt_prog_compiler_pic='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static='$wl-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- lt_prog_compiler_wl='-Wl,'
- # PIC (with -KPIC) is the default.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- case $cc_basename in
- # old Intel for x86_64, which still supported -KPIC.
- ecc*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='--shared'
- lt_prog_compiler_static='--static'
- ;;
- nagfor*)
- # NAG Fortran compiler
- lt_prog_compiler_wl='-Wl,-Wl,,'
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
- tcc*)
- # Fabrice Bellard et al's Tiny C Compiler
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- ccc*)
- lt_prog_compiler_wl='-Wl,'
- # All Alpha code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
- xl* | bgxl* | bgf* | mpixl*)
- # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-qpic'
- lt_prog_compiler_static='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl=''
- ;;
- *Sun\ F* | *Sun*Fortran*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Qoption ld '
- ;;
- *Sun\ C*)
- # Sun C 5.9
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- lt_prog_compiler_wl='-Wl,'
- ;;
- *Intel*\ [CF]*Compiler*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fPIC'
- lt_prog_compiler_static='-static'
- ;;
- *Portland\ Group*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-fpic'
- lt_prog_compiler_static='-Bstatic'
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- lt_prog_compiler_pic='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- lt_prog_compiler_wl='-Wl,'
- # All OSF/1 code is PIC.
- lt_prog_compiler_static='-non_shared'
- ;;
-
- rdos*)
- lt_prog_compiler_static='-non_shared'
- ;;
-
- solaris*)
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
- lt_prog_compiler_wl='-Qoption ld ';;
- *)
- lt_prog_compiler_wl='-Wl,';;
- esac
- ;;
-
- sunos4*)
- lt_prog_compiler_wl='-Qoption ld '
- lt_prog_compiler_pic='-PIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_prog_compiler_pic='-Kconform_pic'
- lt_prog_compiler_static='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_pic='-KPIC'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- unicos*)
- lt_prog_compiler_wl='-Wl,'
- lt_prog_compiler_can_build_shared=no
- ;;
-
- uts4*)
- lt_prog_compiler_pic='-pic'
- lt_prog_compiler_static='-Bstatic'
- ;;
-
- *)
- lt_prog_compiler_can_build_shared=no
- ;;
- esac
- fi
-
-case $host_os in
- # For platforms that do not support PIC, -DPIC is meaningless:
- *djgpp*)
- lt_prog_compiler_pic=
- ;;
- *)
- lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
-if ${lt_cv_prog_compiler_pic+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
-$as_echo "$lt_cv_prog_compiler_pic" >&6; }
-lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$lt_prog_compiler_pic"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
-$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
-if ${lt_cv_prog_compiler_pic_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_pic_works=no
- ac_outfile=conftest.$ac_objext
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_pic_works=yes
- fi
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
-$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_pic_works"; then
- case $lt_prog_compiler_pic in
- "" | " "*) ;;
- *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
- esac
-else
- lt_prog_compiler_pic=
- lt_prog_compiler_can_build_shared=no
-fi
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
-$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
-if ${lt_cv_prog_compiler_static_works+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_static_works=no
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_static_works=yes
- fi
- else
- lt_cv_prog_compiler_static_works=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
-$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-
-if test yes = "$lt_cv_prog_compiler_static_works"; then
- :
-else
- lt_prog_compiler_static=
-fi
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
-$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
-if ${lt_cv_prog_compiler_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler_c_o=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- lt_cv_prog_compiler_c_o=yes
- fi
- fi
- chmod u+w . 2>&5
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
-$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
-
-
-
-
-hard_links=nottested
-if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
- # do not overwrite the value of need_locks provided by the user
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
-$as_echo_n "checking if we can lock with hard links... " >&6; }
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
-$as_echo "$hard_links" >&6; }
- if test no = "$hard_links"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
-$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
-
- runpath_var=
- allow_undefined_flag=
- always_export_symbols=no
- archive_cmds=
- archive_expsym_cmds=
- compiler_needs_object=no
- enable_shared_with_static_runtimes=no
- export_dynamic_flag_spec=
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- hardcode_automatic=no
- hardcode_direct=no
- hardcode_direct_absolute=no
- hardcode_libdir_flag_spec=
- hardcode_libdir_separator=
- hardcode_minus_L=no
- hardcode_shlibpath_var=unsupported
- inherit_rpath=no
- link_all_deplibs=unknown
- module_cmds=
- module_expsym_cmds=
- old_archive_from_new_cmds=
- old_archive_from_expsyms_cmds=
- thread_safe_flag_spec=
- whole_archive_flag_spec=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- include_expsyms=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ' (' and ')$', so one must not match beginning or
- # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
- # as well as any symbol that contains 'd'.
- exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test yes != "$GCC"; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd* | bitrig*)
- with_gnu_ld=no
- ;;
- esac
-
- ld_shlibs=yes
-
- # On some targets, GNU ld is compatible enough with the native linker
- # that we're better off using the native interface for both.
- lt_use_gnu_ld_interface=no
- if test yes = "$with_gnu_ld"; then
- case $host_os in
- aix*)
- # The AIX port of GNU ld has always aspired to compatibility
- # with the native linker. However, as the warning in the GNU ld
- # block says, versions before 2.19.5* couldn't really create working
- # shared libraries, regardless of the interface used.
- case `$LD -v 2>&1` in
- *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
- *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
- *\ \(GNU\ Binutils\)\ [3-9]*) ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- ;;
- *)
- lt_use_gnu_ld_interface=yes
- ;;
- esac
- fi
-
- if test yes = "$lt_use_gnu_ld_interface"; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='$wl'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- export_dynamic_flag_spec='$wl--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
- else
- whole_archive_flag_spec=
- fi
- supports_anon_versioning=no
- case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[3-9]*)
- # On AIX/PPC, the GNU linker is very broken
- if test ia64 != "$host_cpu"; then
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.19, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to install binutils
-*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
-*** You will then need to restart the configuration process.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
- # as there is no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- export_dynamic_flag_spec='$wl--export-all-symbols'
- allow_undefined_flag=unsupported
- always_export_symbols=no
- enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
- exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file, use it as
- # is; otherwise, prepend EXPORTS...
- archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- haiku*)
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- link_all_deplibs=yes
- ;;
-
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- allow_undefined_flag=unsupported
- shrext_cmds=.dll
- archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
- $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
- $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
- $ECHO EXPORTS >> $output_objdir/$libname.def~
- emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
- $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
- emximp -o $lib $output_objdir/$libname.def'
- archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
- $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
- $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
- $ECHO EXPORTS >> $output_objdir/$libname.def~
- prefix_cmds="$SED"~
- if test EXPORTS = "`$SED 1q $export_symbols`"; then
- prefix_cmds="$prefix_cmds -e 1d";
- fi~
- prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
- cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
- $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
- emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
- enable_shared_with_static_runtimes=yes
- ;;
-
- interix[3-9]*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='$wl-rpath,$libdir'
- export_dynamic_flag_spec='$wl-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test linux-dietlibc = "$host_os"; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test no = "$tmp_diet"
- then
- tmp_addflag=' $pic_flag'
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95* | pgfortran*)
- # Portland Group f77 and f90 compilers
- whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- whole_archive_flag_spec=
- tmp_sharedflag='--shared' ;;
- nagfor*) # NAGFOR 5.3
- tmp_sharedflag='-Wl,-shared' ;;
- xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- nvcc*) # Cuda Compiler Driver 2.2
- whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- compiler_needs_object=yes
- ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
- compiler_needs_object=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
-
- if test yes = "$supports_anon_versioning"; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- tcc*)
- export_dynamic_flag_spec='-rdynamic'
- ;;
- xlf* | bgf* | bgxlf* | mpixlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test yes = "$supports_anon_versioning"; then
- archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- ld_shlibs=no
- fi
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
- ld_shlibs=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
- esac
-
- if test no = "$ld_shlibs"; then
- runpath_var=
- hardcode_libdir_flag_spec=
- export_dynamic_flag_spec=
- whole_archive_flag_spec=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
-
- aix[4-9]*)
- if test ia64 = "$host_cpu"; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to GNU nm, but means don't demangle to AIX nm.
- # Without the "-l" option, or with the "-B" option, AIX nm treats
- # weak defined symbols like other global defined symbols, whereas
- # GNU nm marks them as "W".
- # While the 'weak' keyword is ignored in the Export File, we need
- # it in the Import File for the 'aix-soname' feature, so we have
- # to replace the "-B" option with "-P" for AIX nm.
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
- else
- export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # have runtime linking enabled, and use it for executables.
- # For shared libraries, we enable/disable runtime linking
- # depending on the kind of the shared library created -
- # when "with_aix_soname,aix_use_runtimelinking" is:
- # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
- # "aix,yes" lib.so shared, rtl:yes, for executables
- # lib.a static archive
- # "both,no" lib.so.V(shr.o) shared, rtl:yes
- # lib.a(lib.so.V) shared, rtl:no, for executables
- # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
- # lib.a(lib.so.V) shared, rtl:no
- # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
- # lib.a static archive
- case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
- for ld_flag in $LDFLAGS; do
- if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
- # With aix-soname=svr4, we create the lib.so.V shared archives only,
- # so we don't have lib.a shared libs to link our executables.
- # We have to force runtime linking in this case.
- aix_use_runtimelinking=yes
- LDFLAGS="$LDFLAGS -Wl,-brtl"
- fi
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- archive_cmds=''
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- file_list_spec='$wl-f,'
- case $with_aix_soname,$aix_use_runtimelinking in
- aix,*) ;; # traditional, no import file
- svr4,* | *,yes) # use import file
- # The Import File defines what to hardcode.
- hardcode_direct=no
- hardcode_direct_absolute=no
- ;;
- esac
-
- if test yes = "$GCC"; then
- case $host_os in aix4.[012]|aix4.[012].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`$CC -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- hardcode_direct=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- hardcode_minus_L=yes
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_libdir_separator=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag="$shared_flag "'$wl-G'
- fi
- # Need to ensure runtime linking is disabled for the traditional
- # shared library, or the linker may eventually find shared libraries
- # /with/ Import File - we do not want to mix them.
- shared_flag_aix='-shared'
- shared_flag_svr4='-shared $wl-G'
- else
- # not using gcc
- if test ia64 = "$host_cpu"; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test yes = "$aix_use_runtimelinking"; then
- shared_flag='$wl-G'
- else
- shared_flag='$wl-bM:SRE'
- fi
- shared_flag_aix='$wl-bM:SRE'
- shared_flag_svr4='$wl-G'
- fi
- fi
-
- export_dynamic_flag_spec='$wl-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- always_export_symbols=yes
- if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test set = "${lt_cv_aix_libpath+set}"; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=/usr/lib:/lib
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath_
-fi
-
- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
- else
- if test ia64 = "$host_cpu"; then
- hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
- allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- if test set = "${lt_cv_aix_libpath+set}"; then
- aix_libpath=$lt_cv_aix_libpath
-else
- if ${lt_cv_aix_libpath_+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-
- lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\([^ ]*\) *$/\1/
- p
- }
- }'
- lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- # Check for a 64-bit object if we didn't find anything.
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
- fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_=/usr/lib:/lib
- fi
-
-fi
-
- aix_libpath=$lt_cv_aix_libpath_
-fi
-
- hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- no_undefined_flag=' $wl-bernotok'
- allow_undefined_flag=' $wl-berok'
- if test yes = "$with_gnu_ld"; then
- # We only use this code for GNU lds that support --whole-archive.
- whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
- else
- # Exported symbols can be pulled into shared objects from archives
- whole_archive_flag_spec='$convenience'
- fi
- archive_cmds_need_lc=yes
- archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
- # -brtl affects multiple linker settings, -berok does not and is overridden later
- compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
- if test svr4 != "$with_aix_soname"; then
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
- fi
- if test aix != "$with_aix_soname"; then
- archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
- else
- # used by -dlpreopen to get the symbols
- archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
- fi
- archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- archive_expsym_cmds=''
- ;;
- m68k)
- archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- ;;
- esac
- ;;
-
- bsdi[45]*)
- export_dynamic_flag_spec=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- case $cc_basename in
- cl*)
- # Native MSVC
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- file_list_spec='@'
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=.dll
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
- archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
- cp "$export_symbols" "$output_objdir/$soname.def";
- echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
- else
- $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
- # The linker will not automatically build a static lib if we build a DLL.
- # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
- enable_shared_with_static_runtimes=yes
- exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
- # Don't use ranlib
- old_postinstall_cmds='chmod 644 $oldlib'
- postlink_cmds='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile=$lt_outputfile.exe
- lt_tool_outputfile=$lt_tool_outputfile.exe
- ;;
- esac~
- if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
- ;;
- *)
- # Assume MSVC wrapper
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=.dll
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_from_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
- enable_shared_with_static_runtimes=yes
- ;;
- esac
- ;;
-
- darwin* | rhapsody*)
-
-
- archive_cmds_need_lc=no
- hardcode_direct=no
- hardcode_automatic=yes
- hardcode_shlibpath_var=unsupported
- if test yes = "$lt_cv_ld_force_load"; then
- whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
-
- else
- whole_archive_flag_spec=''
- fi
- link_all_deplibs=yes
- allow_undefined_flag=$_lt_dar_allow_undefined
- case $cc_basename in
- ifort*|nagfor*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test yes = "$_lt_dar_can_shared"; then
- output_verbose_link_cmd=func_echo_all
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
- module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
- archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
- module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
-
- else
- ld_shlibs=no
- fi
-
- ;;
-
- dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2.*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- hpux9*)
- if test yes = "$GCC"; then
- archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- else
- archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
- fi
- hardcode_libdir_flag_spec='$wl+b $wl$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- export_dynamic_flag_spec='$wl-E'
- ;;
-
- hpux10*)
- if test yes,no = "$GCC,$with_gnu_ld"; then
- archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test no = "$with_gnu_ld"; then
- hardcode_libdir_flag_spec='$wl+b $wl$libdir'
- hardcode_libdir_separator=:
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- export_dynamic_flag_spec='$wl-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- fi
- ;;
-
- hpux11*)
- if test yes,no = "$GCC,$with_gnu_ld"; then
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
-
- # Older versions of the 11.00 compiler do not understand -b yet
- # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
-$as_echo_n "checking if $CC understands -b... " >&6; }
-if ${lt_cv_prog_compiler__b+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_prog_compiler__b=no
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS -b"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&5
- $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- lt_cv_prog_compiler__b=yes
- fi
- else
- lt_cv_prog_compiler__b=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS=$save_LDFLAGS
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
-$as_echo "$lt_cv_prog_compiler__b" >&6; }
-
-if test yes = "$lt_cv_prog_compiler__b"; then
- archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-else
- archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-fi
-
- ;;
- esac
- fi
- if test no = "$with_gnu_ld"; then
- hardcode_libdir_flag_spec='$wl+b $wl$libdir'
- hardcode_libdir_separator=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- hardcode_direct=no
- hardcode_shlibpath_var=no
- ;;
- *)
- hardcode_direct=yes
- hardcode_direct_absolute=yes
- export_dynamic_flag_spec='$wl-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- hardcode_minus_L=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test yes = "$GCC"; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- # This should be the same for all languages, so no per-tag cache variable.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
-$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
-if ${lt_cv_irix_exported_symbol+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int foo (void) { return 0; }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- lt_cv_irix_exported_symbol=yes
-else
- lt_cv_irix_exported_symbol=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
-$as_echo "$lt_cv_irix_exported_symbol" >&6; }
- if test yes = "$lt_cv_irix_exported_symbol"; then
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
- fi
- else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- hardcode_libdir_separator=:
- inherit_rpath=yes
- link_all_deplibs=yes
- ;;
-
- linux*)
- case $cc_basename in
- tcc*)
- # Fabrice Bellard et al's Tiny C Compiler
- ld_shlibs=yes
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- newsos6)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- hardcode_libdir_separator=:
- hardcode_shlibpath_var=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd* | bitrig*)
- if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- hardcode_direct_absolute=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='$wl-rpath,$libdir'
- export_dynamic_flag_spec='$wl-E'
- else
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='$wl-rpath,$libdir'
- fi
- else
- ld_shlibs=no
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- allow_undefined_flag=unsupported
- shrext_cmds=.dll
- archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
- $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
- $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
- $ECHO EXPORTS >> $output_objdir/$libname.def~
- emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
- $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
- emximp -o $lib $output_objdir/$libname.def'
- archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
- $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
- $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
- $ECHO EXPORTS >> $output_objdir/$libname.def~
- prefix_cmds="$SED"~
- if test EXPORTS = "`$SED 1q $export_symbols`"; then
- prefix_cmds="$prefix_cmds -e 1d";
- fi~
- prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
- cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
- $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
- emximp -o $lib $output_objdir/$libname.def'
- old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
- enable_shared_with_static_runtimes=yes
- ;;
-
- osf3*)
- if test yes = "$GCC"; then
- allow_undefined_flag=' $wl-expect_unresolved $wl\*'
- archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- hardcode_libdir_separator=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test yes = "$GCC"; then
- allow_undefined_flag=' $wl-expect_unresolved $wl\*'
- archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
- hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
- archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- archive_cmds_need_lc='no'
- hardcode_libdir_separator=:
- ;;
-
- solaris*)
- no_undefined_flag=' -z defs'
- if test yes = "$GCC"; then
- wlarc='$wl'
- archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='$wl'
- archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_shlibpath_var=no
- case $host_os in
- solaris2.[0-5] | solaris2.[0-5].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands '-z linker_flag'. GCC discards it without '$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test yes = "$GCC"; then
- whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
- else
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- link_all_deplibs=yes
- ;;
-
- sunos4*)
- if test sequent = "$host_vendor"; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- reload_cmds='$CC -r -o $output$reload_objs'
- hardcode_direct=no
- ;;
- motorola)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
- ;;
-
- sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag='$wl-z,text'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- runpath_var='LD_RUN_PATH'
-
- if test yes = "$GCC"; then
- archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We CANNOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- no_undefined_flag='$wl-z,text'
- allow_undefined_flag='$wl-z,nodefs'
- archive_cmds_need_lc=no
- hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='$wl-R,$libdir'
- hardcode_libdir_separator=':'
- link_all_deplibs=yes
- export_dynamic_flag_spec='$wl-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test yes = "$GCC"; then
- archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- *)
- ld_shlibs=no
- ;;
- esac
-
- if test sni = "$host_vendor"; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- export_dynamic_flag_spec='$wl-Blargedynsym'
- ;;
- esac
- fi
- fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
-$as_echo "$ld_shlibs" >&6; }
-test no = "$ld_shlibs" && can_build_shared=no
-
-with_gnu_ld=$with_gnu_ld
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$archive_cmds_need_lc" in
-x|xyes)
- # Assume -lc should be added
- archive_cmds_need_lc=yes
-
- if test yes,yes = "$GCC,$enable_shared"; then
- case $archive_cmds in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
-$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
-if ${lt_cv_archive_cmds_need_lc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_prog_compiler_wl
- pic_flag=$lt_prog_compiler_pic
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
- (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- then
- lt_cv_archive_cmds_need_lc=no
- else
- lt_cv_archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
-$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
- archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
- ;;
- esac
- fi
- ;;
-esac
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
-$as_echo_n "checking dynamic linker characteristics... " >&6; }
-
-if test yes = "$GCC"; then
- case $host_os in
- darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
- *) lt_awk_arg='/^libraries:/' ;;
- esac
- case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
- *) lt_sed_strip_eq='s|=/|/|g' ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
- case $lt_search_path_spec in
- *\;*)
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
- ;;
- *)
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
- ;;
- esac
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary...
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- # ...but if some path component already ends with the multilib dir we assume
- # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
- case "$lt_multi_os_dir; $lt_search_path_spec " in
- "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
- lt_multi_os_dir=
- ;;
- esac
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
- elif test -n "$lt_multi_os_dir"; then
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS = " "; FS = "/|\n";} {
- lt_foo = "";
- lt_count = 0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo = "/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[lt_foo]++; }
- if (lt_freq[lt_foo] == 1) { print lt_foo; }
-}'`
- # AWK program above erroneously prepends '/' to C:/dos/paths
- # for these hosts.
- case $host_os in
- mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
- esac
- sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=.so
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-
-
-case $host_os in
-aix3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='$libname$release$shared_ext$major'
- ;;
-
-aix[4-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test ia64 = "$host_cpu"; then
- # AIX 5 supports IA64
- library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line '#! .'. This would cause the generated library to
- # depend on '.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[01] | aix4.[01].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # Using Import Files as archive members, it is possible to support
- # filename-based versioning of shared library archives on AIX. While
- # this would work for both with and without runtime linking, it will
- # prevent static linking of such archives. So we do filename-based
- # shared library versioning with .so extension only, which is used
- # when both runtime linking and shared linking is enabled.
- # Unfortunately, runtime linking may impact performance, so we do
- # not want this to be the default eventually. Also, we use the
- # versioned .so libs for executables only if there is the -brtl
- # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
- # To allow for filename-based versioning support, we need to create
- # libNAME.so.V as an archive file, containing:
- # *) an Import File, referring to the versioned filename of the
- # archive as well as the shared archive member, telling the
- # bitwidth (32 or 64) of that shared object, and providing the
- # list of exported symbols of that shared object, eventually
- # decorated with the 'weak' keyword
- # *) the shared object with the F_LOADONLY flag set, to really avoid
- # it being seen by the linker.
- # At run time we better use the real file rather than another symlink,
- # but for link time we create the symlink libNAME.so -> libNAME.so.V
-
- case $with_aix_soname,$aix_use_runtimelinking in
- # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- aix,yes) # traditional libtool
- dynamic_linker='AIX unversionable lib.so'
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- ;;
- aix,no) # traditional AIX only
- dynamic_linker='AIX lib.a(lib.so.V)'
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='$libname$release.a $libname.a'
- soname_spec='$libname$release$shared_ext$major'
- ;;
- svr4,*) # full svr4 only
- dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
- library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
- # We do not specify a path in Import Files, so LIBPATH fires.
- shlibpath_overrides_runpath=yes
- ;;
- *,yes) # both, prefer svr4
- dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
- library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
- # unpreferred sharedlib libNAME.a needs extra handling
- postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
- postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
- # We do not specify a path in Import Files, so LIBPATH fires.
- shlibpath_overrides_runpath=yes
- ;;
- *,no) # both, prefer aix
- dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
- library_names_spec='$libname$release.a $libname.a'
- soname_spec='$libname$release$shared_ext$major'
- # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
- postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
- postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
- ;;
- esac
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='$libname$shared_ext'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[45]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=.dll
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$cc_basename in
- yes,*)
- # gcc
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- ;;
-
- *,cl*)
- # Native MSVC
- libname_spec='$name'
- soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
- library_names_spec='$libname.dll.lib'
-
- case $build_os in
- mingw*)
- sys_lib_search_path_spec=
- lt_save_ifs=$IFS
- IFS=';'
- for lt_path in $LIB
- do
- IFS=$lt_save_ifs
- # Let DOS variable expansion print the short 8.3 style file name.
- lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
- sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
- done
- IFS=$lt_save_ifs
- # Convert to MSYS style.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
- ;;
- cygwin*)
- # Convert to unix form, then to dos form, then back to unix form
- # but this time dos style (no spaces!) so that the unix form looks
- # like /cygdrive/c/PROGRA~1:/cygdr...
- sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
- sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
- sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- ;;
- *)
- sys_lib_search_path_spec=$LIB
- if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
- # It is most probably a Windows format PATH.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # FIXME: find the short name or the path components, as spaces are
- # common. (e.g. "Program Files" -> "PROGRA~1")
- ;;
- esac
-
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
- dynamic_linker='Win32 link.exe'
- ;;
-
- *)
- # Assume MSVC wrapper
- library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
- dynamic_linker='Win32 ld.exe'
- ;;
- esac
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
- soname_spec='$libname$release$major$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[23].*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2.*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[01]* | freebsdelf3.[01]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
- freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-haiku*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- dynamic_linker="$host_os runtime_loader"
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=no
- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- if test 32 = "$HPUX_IA64_MODE"; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- sys_lib_dlsearch_path_spec=/usr/lib/hpux32
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- sys_lib_dlsearch_path_spec=/usr/lib/hpux64
- fi
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
- postinstall_cmds='chmod 555 $lib'
- # or fails outright, so override atomically:
- install_override_mode=555
- ;;
-
-interix[3-9]*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test yes = "$lt_cv_prog_gnu_ld"; then
- version_type=linux # correct to gnu/linux during the next big refactor
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='$libname$release$shared_ext$major'
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
- sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-linux*android*)
- version_type=none # Android doesn't support versioned libraries.
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext'
- soname_spec='$libname$release$shared_ext'
- finish_cmds=
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- dynamic_linker='Android linker'
- # Don't embed -rpath directories since the linker doesn't support them.
- hardcode_libdir_flag_spec='-L$libdir'
- ;;
-
-# This must be glibc/ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
-
- # Some binutils ld are patched to set DT_RUNPATH
- if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- lt_cv_shlibpath_overrides_runpath=no
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
- LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
- lt_cv_shlibpath_overrides_runpath=yes
-fi
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
-
-fi
-
- shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Ideally, we could use ldconfig to report *all* directores which are
- # searched for libraries, however this is still not possible. Aside from not
- # being certain /sbin/ldconfig is available, command
- # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
- # even though it is searched at run-time. Try to do the best guess by
- # appending ld.so.conf contents (and includes) to the search path.
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd* | bitrig*)
- version_type=sunos
- sys_lib_dlsearch_path_spec=/usr/lib
- need_lib_prefix=no
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
- need_version=no
- else
- need_version=yes
- fi
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-os2*)
- libname_spec='$name'
- version_type=windows
- shrext_cmds=.dll
- need_version=no
- need_lib_prefix=no
- # OS/2 can only load a DLL with a base name of 8 characters or less.
- soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
- v=$($ECHO $release$versuffix | tr -d .-);
- n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
- $ECHO $n$v`$shared_ext'
- library_names_spec='${libname}_dll.$libext'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=BEGINLIBPATH
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- postinstall_cmds='base_file=`basename \$file`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='$libname$release$shared_ext$major'
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test yes = "$with_gnu_ld"; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec; then
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
- soname_spec='$libname$shared_ext.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=sco
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test yes = "$with_gnu_ld"; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux # correct to gnu/linux during the next big refactor
- need_lib_prefix=no
- need_version=no
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
- soname_spec='$libname$release$shared_ext$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test no = "$dynamic_linker" && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test yes = "$GCC"; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
- sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
-fi
-
-if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
- sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
-fi
-
-# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
-configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
-
-# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
-func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
-
-# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
-configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
- test -n "$runpath_var" ||
- test yes = "$hardcode_automatic"; then
-
- # We can hardcode non-existent directories.
- if test no != "$hardcode_direct" &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
- test no != "$hardcode_minus_L"; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action=unsupported
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test relink = "$hardcode_action" ||
- test yes = "$inherit_rpath"; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test yes = "$shlibpath_overrides_runpath" ||
- test no = "$enable_shared"; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-
-
-
-
-
- if test yes != "$enable_dlopen"; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen=load_add_on
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen=LoadLibrary
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen=dlopen
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
-
- lt_cv_dlopen=dyld
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
-
-fi
-
- ;;
-
- tpf*)
- # Don't try to run any link tests for TPF. We know it's impossible
- # because TPF is a cross-compiler, and we know how we open DSOs.
- lt_cv_dlopen=dlopen
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=no
- ;;
-
- *)
- ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
-if test "x$ac_cv_func_shl_load" = xyes; then :
- lt_cv_dlopen=shl_load
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if ${ac_cv_lib_dld_shl_load+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char shl_load ();
-int
-main ()
-{
-return shl_load ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_shl_load=yes
-else
- ac_cv_lib_dld_shl_load=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
-else
- ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
-if test "x$ac_cv_func_dlopen" = xyes; then :
- lt_cv_dlopen=dlopen
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if ${ac_cv_lib_dl_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dl_dlopen=yes
-else
- ac_cv_lib_dl_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if ${ac_cv_lib_svld_dlopen+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dlopen ();
-int
-main ()
-{
-return dlopen ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_svld_dlopen=yes
-else
- ac_cv_lib_svld_dlopen=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
- lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if ${ac_cv_lib_dld_dld_link+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char dld_link ();
-int
-main ()
-{
-return dld_link ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_dld_dld_link=yes
-else
- ac_cv_lib_dld_dld_link=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
- lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
- ;;
- esac
-
- if test no = "$lt_cv_dlopen"; then
- enable_dlopen=no
- else
- enable_dlopen=yes
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS=$CPPFLAGS
- test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS=$LDFLAGS
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS=$LIBS
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test yes = "$cross_compiling"; then :
- lt_cv_dlopen_self=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisibility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
- if test yes = "$lt_cv_dlopen_self"; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if ${lt_cv_dlopen_self_static+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test yes = "$cross_compiling"; then :
- lt_cv_dlopen_self_static=cross
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-/* When -fvisibility=hidden is used, assume the code has been annotated
- correspondingly for the symbols needed. */
-#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-int fnord () __attribute__((visibility("default")));
-#endif
-
-int fnord () { return 42; }
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else
- {
- if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- else puts (dlerror ());
- }
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}
-_LT_EOF
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
- (./conftest; exit; ) >&5 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
- x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
- esac
- else :
- # compilation failed
- lt_cv_dlopen_self_static=no
- fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
- fi
-
- CPPFLAGS=$save_CPPFLAGS
- LDFLAGS=$save_LDFLAGS
- LIBS=$save_LIBS
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP"; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- fi
- ;;
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- ;;
- esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
- # Report what library types will actually be built
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
- test no = "$can_build_shared" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test yes = "$enable_shared" && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[4-9]*)
- if test ia64 != "$host_cpu"; then
- case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
- yes,aix,yes) ;; # shared object as lib.so file only
- yes,svr4,*) ;; # shared object as lib.so archive member only
- yes,*) enable_static=no ;; # shared object in lib.a archive as well
- esac
- fi
- ;;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
- # Make sure either enable_shared or enable_static is yes.
- test yes = "$enable_shared" || enable_static=yes
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-
-
-
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC=$lt_save_CC
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-
-# Select memory manager depending on user input.
-# If no "-enable-maxmem", use jmemnobs
-MEMORYMGR='jmemnobs'
-MAXMEM="no"
-# Check whether --enable-maxmem was given.
-if test "${enable_maxmem+set}" = set; then :
- enableval=$enable_maxmem; MAXMEM="$enableval"
-fi
-
-if test "x$MAXMEM" = xyes; then
- MAXMEM=1
-fi
-if test "x$MAXMEM" != xno; then
- if test -n "`echo $MAXMEM | sed 's/[0-9]//g'`"; then
- as_fn_error $? "non-numeric argument to --enable-maxmem" "$LINENO" 5
- fi
- DEFAULTMAXMEM=`expr $MAXMEM \* 1048576`
-
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_MAX_MEM ${DEFAULTMAXMEM}
-_ACEOF
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 'tmpfile()'" >&5
-$as_echo_n "checking for 'tmpfile()'... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
- FILE * tfile = tmpfile();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- MEMORYMGR='jmemansi'
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- MEMORYMGR='jmemname'
-
- # Test for the need to remove temporary files using a signal handler
- # (for cjpeg/djpeg)
-
-$as_echo "#define NEED_SIGNAL_CATCHER 1" >>confdefs.h
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 'mktemp()'" >&5
-$as_echo_n "checking for 'mktemp()'... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
- char fname[80]; mktemp(fname);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define NO_MKTEMP 1" >>confdefs.h
-
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-fi
-
-
-# Extract the library version IDs from jpeglib.h.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking libjpeg version number" >&5
-$as_echo_n "checking libjpeg version number... " >&6; }
-major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`
-minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`
-JPEG_LIB_VERSION=`expr $major + $minor`:0:$minor
-
-JPEG_LIB_VERSION_MAJOR=$major
-
-JPEG_LIB_VERSION_MINOR=$minor
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $major.$minor.0" >&5
-$as_echo "$major.$minor.0" >&6; }
-
-ac_config_files="$ac_config_files Makefile libjpeg.pc"
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-U=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
- if test -n "$am_sleep_pid"; then
- # Hide warnings about reused PIDs.
- wait $am_sleep_pid 2>/dev/null
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
- if test -n "$EXEEXT"; then
- am__EXEEXT_TRUE=
- am__EXEEXT_FALSE='#'
-else
- am__EXEEXT_TRUE='#'
- am__EXEEXT_FALSE=
-fi
-
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${HAVE_LD_VERSION_SCRIPT_TRUE}" && test -z "${HAVE_LD_VERSION_SCRIPT_FALSE}"; then
- as_fn_error $? "conditional \"HAVE_LD_VERSION_SCRIPT\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by libjpeg $as_me 9.4.0, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to the package provider."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-libjpeg config.status 9.4.0
-configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
-
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`'
-DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
-macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
-macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
-enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
-enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
-pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
-enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
-shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
-SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
-ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
-PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
-host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
-host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
-host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
-build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
-build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
-build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
-SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
-Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
-GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
-EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
-FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
-LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
-NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
-LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
-max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
-ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
-exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
-lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
-lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
-lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
-lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
-reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
-reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
-deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
-file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
-file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
-want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
-AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
-AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
-archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
-STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
-RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
-old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
-lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
-CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
-CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
-compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
-GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
-lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
-nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
-lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
-lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
-objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
-MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
-lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
-need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
-MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
-DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
-NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
-LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
-OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
-OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
-libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
-shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
-extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
-enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
-export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
-whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
-compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
-old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
-old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
-archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
-archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
-module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
-with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
-allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
-no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
-hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
-hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
-hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
-hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
-hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
-inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
-link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
-export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
-exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
-include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
-prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
-postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
-file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
-variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
-need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
-need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
-version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
-runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
-shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
-libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
-library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
-soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
-install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
-postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
-postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
-finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
-finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
-hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
-sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
-configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
-hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
-enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
-enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
-old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
-striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
-
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-\$1
-_LTECHO_EOF'
-}
-
-# Quote evaled strings.
-for var in AS \
-DLLTOOL \
-OBJDUMP \
-SHELL \
-ECHO \
-PATH_SEPARATOR \
-SED \
-GREP \
-EGREP \
-FGREP \
-LD \
-NM \
-LN_S \
-lt_SP2NL \
-lt_NL2SP \
-reload_flag \
-deplibs_check_method \
-file_magic_cmd \
-file_magic_glob \
-want_nocaseglob \
-sharedlib_from_linklib_cmd \
-AR \
-AR_FLAGS \
-archiver_list_spec \
-STRIP \
-RANLIB \
-CC \
-CFLAGS \
-compiler \
-lt_cv_sys_global_symbol_pipe \
-lt_cv_sys_global_symbol_to_cdecl \
-lt_cv_sys_global_symbol_to_import \
-lt_cv_sys_global_symbol_to_c_name_address \
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
-lt_cv_nm_interface \
-nm_file_list_spec \
-lt_cv_truncate_bin \
-lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_pic \
-lt_prog_compiler_wl \
-lt_prog_compiler_static \
-lt_cv_prog_compiler_c_o \
-need_locks \
-MANIFEST_TOOL \
-DSYMUTIL \
-NMEDIT \
-LIPO \
-OTOOL \
-OTOOL64 \
-shrext_cmds \
-export_dynamic_flag_spec \
-whole_archive_flag_spec \
-compiler_needs_object \
-with_gnu_ld \
-allow_undefined_flag \
-no_undefined_flag \
-hardcode_libdir_flag_spec \
-hardcode_libdir_separator \
-exclude_expsyms \
-include_expsyms \
-file_list_spec \
-variables_saved_for_relink \
-libname_spec \
-library_names_spec \
-soname_spec \
-install_override_mode \
-finish_eval \
-old_striplib \
-striplib; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in reload_cmds \
-old_postinstall_cmds \
-old_postuninstall_cmds \
-old_archive_cmds \
-extract_expsyms_cmds \
-old_archive_from_new_cmds \
-old_archive_from_expsyms_cmds \
-archive_cmds \
-archive_expsym_cmds \
-module_cmds \
-module_expsym_cmds \
-export_symbols_cmds \
-prelink_cmds \
-postlink_cmds \
-postinstall_cmds \
-postuninstall_cmds \
-finish_cmds \
-sys_lib_search_path_spec \
-configure_time_dlsearch_path \
-configure_time_lt_sys_library_path; do
- case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
- *[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-ac_aux_dir='$ac_aux_dir'
-
-# See if we are running on zsh, and set the options that allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}"; then
- setopt NO_GLOB_SUBST
-fi
-
-
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- RM='$RM'
- ofile='$ofile'
-
-
-
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "jconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS jconfig.h:jconfig.cfg" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "libjpeg.pc") CONFIG_FILES="$CONFIG_FILES libjpeg.pc" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any. Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[ ]*#[ ]*define[ ][ ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- for (key in D) D_is_set[key] = 1
- FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
- line = \$ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$_am_arg" : 'X\(//\)[^/]' \| \
- X"$_am_arg" : 'X\(//\)$' \| \
- X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Older Autoconf quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- # TODO: see whether this extra hack can be removed once we start
- # requiring Autoconf 2.70 or later.
- case $CONFIG_FILES in #(
- *\'*) :
- eval set x "$CONFIG_FILES" ;; #(
- *) :
- set x $CONFIG_FILES ;; #(
- *) :
- ;;
-esac
- shift
- # Used to flag and report bootstrapping failures.
- am_rc=0
- for am_mf
- do
- # Strip MF so we end up with the name of the file.
- am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile which includes
- # dependency-tracking related rules and includes.
- # Grep'ing the whole file directly is not great: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
- || continue
- am_dirpart=`$as_dirname -- "$am_mf" ||
-$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$am_mf" : 'X\(//\)[^/]' \| \
- X"$am_mf" : 'X\(//\)$' \| \
- X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$am_mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- am_filepart=`$as_basename -- "$am_mf" ||
-$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
- X"$am_mf" : 'X\(//\)$' \| \
- X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$am_mf" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { echo "$as_me:$LINENO: cd "$am_dirpart" \
- && sed -e '/# am--include-marker/d' "$am_filepart" \
- | $MAKE -f - am--depfiles" >&5
- (cd "$am_dirpart" \
- && sed -e '/# am--include-marker/d' "$am_filepart" \
- | $MAKE -f - am--depfiles) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } || am_rc=$?
- done
- if test $am_rc -ne 0; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. Try re-running configure with the
- '--disable-dependency-tracking' option to at least be able to build
- the package (albeit without support for automatic dependency tracking).
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- { am_dirpart=; unset am_dirpart;}
- { am_filepart=; unset am_filepart;}
- { am_mf=; unset am_mf;}
- { am_rc=; unset am_rc;}
- rm -f conftest-deps.mk
-}
- ;;
- "libtool":C)
-
- # See if we are running on zsh, and set the options that allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}"; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile=${ofile}T
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-
-# Provide generalized library-building support services.
-# Written by Gordon Matzigkeit, 1996
-
-# Copyright (C) 2014 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program or library that is built
-# using GNU Libtool, you may include this file under the same
-# distribution terms that you use for the rest of that program.
-#
-# GNU Libtool 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, see <http://www.gnu.org/licenses/>.
-
-
-# The names of the tagged configurations supported by this script.
-available_tags=''
-
-# Configured defaults for sys_lib_dlsearch_path munging.
-: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Assembler program.
-AS=$lt_AS
-
-# DLL creation program.
-DLLTOOL=$lt_DLLTOOL
-
-# Object dumper program.
-OBJDUMP=$lt_OBJDUMP
-
-# Which release of libtool.m4 was used?
-macro_version=$macro_version
-macro_revision=$macro_revision
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# What type of objects to build.
-pic_mode=$pic_mode
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# Shared archive member basename,for filename based shared library versioning on AIX.
-shared_archive_member_spec=$shared_archive_member_spec
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# An echo program that protects backslashes.
-ECHO=$lt_ECHO
-
-# The PATH separator for the build system.
-PATH_SEPARATOR=$lt_PATH_SEPARATOR
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="\$SED -e 1s/^X//"
-
-# A grep program that handles long lines.
-GREP=$lt_GREP
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# A literal string matcher.
-FGREP=$lt_FGREP
-
-# A BSD- or MS-compatible name lister.
-NM=$lt_NM
-
-# Whether we need soft or hard links.
-LN_S=$lt_LN_S
-
-# What is the maximum length of a command?
-max_cmd_len=$max_cmd_len
-
-# Object file suffix (normally "o").
-objext=$ac_objext
-
-# Executable file suffix (normally "").
-exeext=$exeext
-
-# whether the shell understands "unset".
-lt_unset=$lt_unset
-
-# turn spaces into newlines.
-SP2NL=$lt_lt_SP2NL
-
-# turn newlines into spaces.
-NL2SP=$lt_lt_NL2SP
-
-# convert \$build file names to \$host format.
-to_host_file_cmd=$lt_cv_to_host_file_cmd
-
-# convert \$build files to toolchain format.
-to_tool_file_cmd=$lt_cv_to_tool_file_cmd
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method = "file_magic".
-file_magic_cmd=$lt_file_magic_cmd
-
-# How to find potential files when deplibs_check_method = "file_magic".
-file_magic_glob=$lt_file_magic_glob
-
-# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
-want_nocaseglob=$lt_want_nocaseglob
-
-# Command to associate shared and link libraries.
-sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
-
-# The archiver.
-AR=$lt_AR
-
-# Flags to create an archive.
-AR_FLAGS=$lt_AR_FLAGS
-
-# How to feed a file listing to the archiver.
-archiver_list_spec=$lt_archiver_list_spec
-
-# A symbol stripping program.
-STRIP=$lt_STRIP
-
-# Commands used to install an old-style archive.
-RANLIB=$lt_RANLIB
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Whether to use a lock for old archive extraction.
-lock_old_archive_extraction=$lock_old_archive_extraction
-
-# A C compiler.
-LTCC=$lt_CC
-
-# LTCC compiler flags.
-LTCFLAGS=$lt_CFLAGS
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration.
-global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
-
-# Transform the output of nm into a list of symbols to manually relocate.
-global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
-
-# Transform the output of nm in a C name address pair.
-global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
-
-# Transform the output of nm in a C name address pair when lib prefix is needed.
-global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
-
-# The name lister interface.
-nm_interface=$lt_lt_cv_nm_interface
-
-# Specify filename containing input files for \$NM.
-nm_file_list_spec=$lt_nm_file_list_spec
-
-# The root where to search for dependent libraries,and where our libraries should be installed.
-lt_sysroot=$lt_sysroot
-
-# Command to truncate a binary pipe.
-lt_truncate_bin=$lt_lt_cv_truncate_bin
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# Used to examine libraries when file_magic_cmd begins with "file".
-MAGIC_CMD=$MAGIC_CMD
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Manifest tool.
-MANIFEST_TOOL=$lt_MANIFEST_TOOL
-
-# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
-DSYMUTIL=$lt_DSYMUTIL
-
-# Tool to change global to local symbols on Mac OS X.
-NMEDIT=$lt_NMEDIT
-
-# Tool to manipulate fat objects and archives on Mac OS X.
-LIPO=$lt_LIPO
-
-# ldd/readelf like tool for Mach-O binaries on Mac OS X.
-OTOOL=$lt_OTOOL
-
-# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
-OTOOL64=$lt_OTOOL64
-
-# Old archive suffix (normally "a").
-libext=$libext
-
-# Shared library suffix (normally ".so").
-shrext_cmds=$lt_shrext_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at link time.
-variables_saved_for_relink=$lt_variables_saved_for_relink
-
-# Do we need the "lib" prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Library versioning type.
-version_type=$version_type
-
-# Shared library runtime path variable.
-runpath_var=$runpath_var
-
-# Shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Permission mode override for installation of shared libraries.
-install_override_mode=$lt_install_override_mode
-
-# Command to use after installation of a shared archive.
-postinstall_cmds=$lt_postinstall_cmds
-
-# Command to use after uninstallation of a shared archive.
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# As "finish_cmds", except a single script fragment to be evaled but
-# not shown.
-finish_eval=$lt_finish_eval
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Compile-time system search path for libraries.
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Detected run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
-
-# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
-configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# Commands used to build an old-style archive.
-old_archive_cmds=$lt_old_archive_cmds
-
-# A language specific compiler.
-CC=$lt_compiler
-
-# Is the compiler the GNU compiler?
-with_gcc=$GCC
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_lt_prog_compiler_pic
-
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_lt_prog_compiler_static
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_lt_cv_prog_compiler_c_o
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$archive_cmds_need_lc
-
-# Whether or not to disallow shared libs when runtime libs are static.
-allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Whether the compiler copes with passing no objects directly.
-compiler_needs_object=$lt_compiler_needs_object
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-
-# Commands used to build a loadable module if different from building
-# a shared archive.
-module_cmds=$lt_module_cmds
-module_expsym_cmds=$lt_module_expsym_cmds
-
-# Whether we are building with GNU ld or not.
-with_gnu_ld=$lt_with_gnu_ld
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that enforces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single "-rpath" flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
-# DIR into the resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
-# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \$shlibpath_var if the
-# library is relocated.
-hardcode_direct_absolute=$hardcode_direct_absolute
-
-# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
-# into the resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
-# into the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Set to "yes" if building a shared library automatically hardcodes DIR
-# into the library and all subsequent libraries and executables linked
-# against it.
-hardcode_automatic=$hardcode_automatic
-
-# Set to yes if linker adds runtime paths of dependent libraries
-# to runtime path list.
-inherit_rpath=$inherit_rpath
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Set to "yes" if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# Commands necessary for linking programs (against libraries) with templates.
-prelink_cmds=$lt_prelink_cmds
-
-# Commands necessary for finishing linking programs.
-postlink_cmds=$lt_postlink_cmds
-
-# Specify filename containing input files.
-file_list_spec=$lt_file_list_spec
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- cat <<'_LT_EOF' >> "$cfgfile"
-
-# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
-
-# func_munge_path_list VARIABLE PATH
-# -----------------------------------
-# VARIABLE is name of variable containing _space_ separated list of
-# directories to be munged by the contents of PATH, which is string
-# having a format:
-# "DIR[:DIR]:"
-# string "DIR[ DIR]" will be prepended to VARIABLE
-# ":DIR[:DIR]"
-# string "DIR[ DIR]" will be appended to VARIABLE
-# "DIRP[:DIRP]::[DIRA:]DIRA"
-# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
-# "DIRA[ DIRA]" will be appended to VARIABLE
-# "DIR[:DIR]"
-# VARIABLE will be replaced by "DIR[ DIR]"
-func_munge_path_list ()
-{
- case x$2 in
- x)
- ;;
- *:)
- eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
- ;;
- x:*)
- eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
- ;;
- *::*)
- eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
- eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
- ;;
- *)
- eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
- ;;
- esac
-}
-
-
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-func_cc_basename ()
-{
- for cc_temp in $*""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
- done
- func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
-}
-
-
-# ### END FUNCTIONS SHARED WITH CONFIGURE
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test set != "${COLLECT_NAMES+set}"; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
-
-ltmain=$ac_aux_dir/ltmain.sh
-
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/jpeg/configure.ac b/jpeg/configure.ac
index eb3eeede..f7d4035e 100644
--- a/jpeg/configure.ac
+++ b/jpeg/configure.ac
@@ -5,7 +5,7 @@
# Configure script for IJG libjpeg
#
-AC_INIT([libjpeg], [9.4.0])
+AC_INIT([libjpeg], [9.5.0])
# Directory where autotools helper scripts lives.
AC_CONFIG_AUX_DIR([.])
@@ -35,11 +35,11 @@ AM_MAINTAINER_MODE
# Check for programs
AC_PROG_CC
-AC_PROG_CC_STDC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
+AC_PROG_EGREP
AM_PROG_AR
# Check if LD supports linker scripts,
@@ -84,8 +84,8 @@ int testfunction (int arg1, int * arg2) /* check definitions */
int test2function (void) /* check void arg list */
{ return 0; }
]])],
- [ijg_cv_have_prototypes=yes],
- [ijg_cv_have_prototypes=no])])
+ [ijg_cv_have_prototypes=yes],
+ [ijg_cv_have_prototypes=no])])
AC_MSG_RESULT([$ijg_cv_have_prototypes])
if test $ijg_cv_have_prototypes = yes; then
AC_DEFINE([HAVE_PROTOTYPES],[1],[Compiler supports function prototypes.])
@@ -106,7 +106,7 @@ AC_CHECK_HEADER([string.h], [],
# See whether type size_t is defined in any ANSI-standard places;
# if not, perhaps it is defined in <sys/types.h>.
AC_MSG_CHECKING([for size_t])
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_STDDEF_H
#include <stddef.h>
#endif
@@ -120,10 +120,9 @@ AC_TRY_COMPILE([
#include <string.h>
#endif
typedef size_t my_size_t;
-],
- [ my_size_t foovar; ],
- [ijg_size_t_ok=yes],
- [ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"])
+]], [[ my_size_t foovar; ]])],
+ [ijg_size_t_ok=yes],
+ [ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"])
AC_MSG_RESULT([$ijg_size_t_ok])
if test "$ijg_size_t_ok" != yes; then
AC_CHECK_HEADER([sys/types.h],
@@ -142,21 +141,21 @@ fi
# Check compiler characteristics
AC_MSG_CHECKING([for type unsigned char])
-AC_TRY_COMPILE([], [ unsigned char un_char; ],
- [AC_MSG_RESULT(yes)
- AC_DEFINE([HAVE_UNSIGNED_CHAR], [1],
- [Compiler supports 'unsigned char'.])],
- [AC_MSG_RESULT(no)])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ unsigned char un_char; ]])],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_UNSIGNED_CHAR], [1],
+ [Compiler supports 'unsigned char'.])],
+ [AC_MSG_RESULT(no)])
AC_MSG_CHECKING([for type unsigned short])
-AC_TRY_COMPILE([], [ unsigned short un_short; ],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ unsigned short un_short; ]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_UNSIGNED_SHORT], [1],
[Compiler supports 'unsigned short'.])],
[AC_MSG_RESULT(no)])
AC_MSG_CHECKING([for type void])
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
/* Caution: a C++ compiler will insist on valid prototypes */
typedef void * void_ptr; /* check void * */
#ifdef HAVE_PROTOTYPES /* check ptr to function returning void */
@@ -177,7 +176,7 @@ void test3function (arg1, arg2)
arg1 = (void *) locptr;
(*arg2) (1, 2); /* check call of fcn returning void */
}
-], [ ],
+]], [[ ]])],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_DEFINE([void], [char],
@@ -188,41 +187,42 @@ AC_C_CONST
# Check for non-broken inline under various spellings
AC_MSG_CHECKING([for inline])
ijg_cv_inline=""
-AC_TRY_COMPILE([], [} __inline__ int foo() { return 0; }
-int bar() { return foo();], ijg_cv_inline="__inline__",
-[AC_TRY_COMPILE(, [} __inline int foo() { return 0; }
-int bar() { return foo();], ijg_cv_inline="__inline",
-[AC_TRY_COMPILE(, [} inline int foo() { return 0; }
-int bar() { return foo();], ijg_cv_inline="inline")])])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[} __inline__ int foo() { return 0; }
+int bar() { return foo();]])], ijg_cv_inline="__inline__",
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[} __inline int foo() { return 0; }
+int bar() { return foo();]])], ijg_cv_inline="__inline",
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(, [[} inline int foo() { return 0; }
+int bar() { return foo();]])], ijg_cv_inline="inline")])])
AC_MSG_RESULT($ijg_cv_inline)
AC_DEFINE_UNQUOTED([INLINE], [$ijg_cv_inline],
[How to obtain function inlining.])
# We cannot check for bogus warnings, but at least we can check for errors
AC_MSG_CHECKING([for broken incomplete types])
-AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ],
- [],
- [AC_MSG_RESULT(ok)],
- [AC_MSG_RESULT(broken)
- AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],
- [Compiler does not support pointers to unspecified
- structures.])])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+typedef struct undefined_structure * undef_struct_ptr;
+]], [[]])],
+ [AC_MSG_RESULT(ok)],
+ [AC_MSG_RESULT(broken)
+ AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1],
+ [Compiler does not support pointers to unspecified
+ structures.])])
# Test whether global names are unique to at least 15 chars
AC_MSG_CHECKING([for short external names])
-AC_TRY_LINK([
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
int possibly_duplicate_function () { return 0; }
int possibly_dupli_function () { return 1; }
-], [],
- [AC_MSG_RESULT(ok)],
- [AC_MSG_RESULT(short)
- AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], [1],
- [Linker requires that global names be unique in
- first 15 characters.])])
+]], [[]])],
+ [AC_MSG_RESULT(ok)],
+ [AC_MSG_RESULT(short)
+ AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], [1],
+ [Linker requires that global names be unique in
+ first 15 characters.])])
# Run-time checks
AC_MSG_CHECKING([to see if char is signed])
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -246,16 +246,16 @@ int is_char_signed (arg)
char signed_char_check = (char) (-67);
int main() {
exit(is_char_signed((int) signed_char_check));
-}], [AC_MSG_RESULT(no)
- AC_DEFINE([CHAR_IS_UNSIGNED], [1],
- [Characters are unsigned])],
- [AC_MSG_RESULT(yes)],
+}]])], [AC_MSG_RESULT(no)
+ AC_DEFINE([CHAR_IS_UNSIGNED], [1],
+ [Characters are unsigned])],
+ [AC_MSG_RESULT(yes)],
[AC_MSG_WARN([Assuming that char is signed on target machine.
If it is unsigned, this will be a little bit inefficient.])
])
AC_MSG_CHECKING([to see if right shift is signed])
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -264,7 +264,7 @@ AC_TRY_RUN([
int is_shifting_signed (long arg)
#else
int is_shifting_signed (arg)
- long arg;
+ long arg;
#endif
/* See whether right-shift on a long is signed or not. */
{
@@ -285,15 +285,15 @@ int is_shifting_signed (arg)
}
int main() {
exit(is_shifting_signed(-0x7F7E80B1L));
-}],
- [AC_MSG_RESULT(no)
- AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], [1],
- [Broken compiler shifts signed values as an unsigned shift.])],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
+}]])],
+ [AC_MSG_RESULT(no)
+ AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], [1],
+ [Broken compiler shifts signed values as an unsigned shift.])],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)])
AC_MSG_CHECKING([to see if fopen accepts b spec])
-AC_TRY_RUN([
+AC_RUN_IFELSE([AC_LANG_SOURCE([[
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -302,16 +302,15 @@ int main() {
if (fopen("conftestdata", "wb") != NULL)
exit(0);
exit(1);
-}],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- AC_DEFINE([DONT_USE_B_MODE], [1],
- [Don't open files in binary mode.])],
- [AC_MSG_RESULT(Assuming that it does.)])
+}]])],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+ AC_DEFINE([DONT_USE_B_MODE], [1],
+ [Don't open files in binary mode.])],
+ [AC_MSG_RESULT(Assuming that it does.)])
# Configure libtool
-AC_LIBTOOL_WIN32_DLL
-AC_PROG_LIBTOOL
+LT_INIT([win32-dll])
# Select memory manager depending on user input.
# If no "-enable-maxmem", use jmemnobs
@@ -333,23 +332,23 @@ if test "x$MAXMEM" != xno; then
AC_DEFINE_UNQUOTED([DEFAULT_MAX_MEM], [${DEFAULTMAXMEM}],
[Maximum data space library will allocate.])
AC_MSG_CHECKING([for 'tmpfile()'])
- AC_TRY_LINK([#include <stdio.h>], [ FILE * tfile = tmpfile(); ],
- [AC_MSG_RESULT(yes)
- MEMORYMGR='jmemansi'],
- [AC_MSG_RESULT(no)
- dnl if tmpfile is not present, must use jmemname.
- MEMORYMGR='jmemname'
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], [[ FILE * tfile = tmpfile(); ]])],
+ [AC_MSG_RESULT(yes)
+ MEMORYMGR='jmemansi'],
+ [AC_MSG_RESULT(no)
+ dnl if tmpfile is not present, must use jmemname.
+ MEMORYMGR='jmemname'
# Test for the need to remove temporary files using a signal handler
# (for cjpeg/djpeg)
AC_DEFINE([NEED_SIGNAL_CATCHER], [1],
[Need signal handler to clean up temporary files.])
AC_MSG_CHECKING([for 'mktemp()'])
- AC_TRY_LINK([], [ char fname[80]; mktemp(fname); ],
- [AC_MSG_RESULT(yes)],
- [AC_MSG_RESULT(no)
- AC_DEFINE([NO_MKTEMP], [1],
- [The mktemp() function is not available.])])])
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[ char fname[80]; mktemp(fname); ]])],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+ AC_DEFINE([NO_MKTEMP], [1],
+ [The mktemp() function is not available.])])])
fi
AC_SUBST([MEMORYMGR])
diff --git a/jpeg/depcomp b/jpeg/depcomp
index 65cbf709..715e3431 100755
--- a/jpeg/depcomp
+++ b/jpeg/depcomp
@@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2018 Free Software Foundation, Inc.
+# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
diff --git a/jpeg/djpegalt.c b/jpeg/djpegalt.c
new file mode 100644
index 00000000..da809ae4
--- /dev/null
+++ b/jpeg/djpegalt.c
@@ -0,0 +1,766 @@
+/*
+ * alternate djpeg.c
+ *
+ * Copyright (C) 1991-1997, Thomas G. Lane.
+ * Modified 2009-2020 by Guido Vollbeding.
+ * This file is part of the Independent JPEG Group's software.
+ * For conditions of distribution and use, see the accompanying README file.
+ *
+ * This file contains an alternate user interface for the JPEG decompressor.
+ * One or more input files are named on the command line, and output file
+ * names are created by substituting an appropriate extension.
+ */
+
+#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
+#include "jversion.h" /* for version message */
+
+#include <ctype.h> /* to declare isprint() */
+
+#ifdef USE_CCOMMAND /* command-line reader for Macintosh */
+#ifdef __MWERKS__
+#include <SIOUX.h> /* Metrowerks needs this */
+#include <console.h> /* ... and this */
+#endif
+#ifdef THINK_C
+#include <console.h> /* Think declares it here */
+#endif
+#endif
+
+#ifndef PATH_MAX /* ANSI maximum-pathname-length constant */
+#define PATH_MAX 256
+#endif
+
+
+/* Create the add-on message string table. */
+
+#define JMESSAGE(code,string) string ,
+
+static const char * const cdjpeg_message_table[] = {
+#include "cderror.h"
+ NULL
+};
+
+
+/*
+ * Automatic determination of available memory.
+ */
+
+static long default_maxmem; /* saves value determined at startup, or 0 */
+
+#ifndef FREE_MEM_ESTIMATE /* may be defined from command line */
+
+#ifdef MSDOS /* For MS-DOS (unless flat-memory model) */
+
+#include <dos.h> /* for access to intdos() call */
+
+LOCAL(long)
+unused_dos_memory (void)
+/* Obtain total amount of unallocated DOS memory */
+{
+ union REGS regs;
+ long nparas;
+
+ regs.h.ah = 0x48; /* DOS function Allocate Memory Block */
+ regs.x.bx = 0xFFFF; /* Ask for more memory than DOS can have */
+ (void) intdos(&regs, &regs);
+ /* DOS will fail and return # of paragraphs actually available in BX. */
+ nparas = (unsigned int) regs.x.bx;
+ /* Times 16 to convert to bytes. */
+ return nparas << 4;
+}
+
+/* The default memory setting is 95% of the available space. */
+#define FREE_MEM_ESTIMATE ((unused_dos_memory() * 95L) / 100L)
+
+#endif /* MSDOS */
+
+#ifdef ATARI /* For Atari ST/STE/TT, Pure C or Turbo C */
+
+#include <ext.h>
+
+/* The default memory setting is 90% of the available space. */
+#define FREE_MEM_ESTIMATE (((long) coreleft() * 90L) / 100L)
+
+#endif /* ATARI */
+
+/* Add memory-estimation procedures for other operating systems here,
+ * with appropriate #ifdef's around them.
+ */
+
+#endif /* !FREE_MEM_ESTIMATE */
+
+
+/*
+ * This list defines the known output image formats
+ * (not all of which need be supported by a given version).
+ * You can change the default output format by defining DEFAULT_FMT;
+ * indeed, you had better do so if you undefine PPM_SUPPORTED.
+ */
+
+typedef enum {
+ FMT_BMP, /* BMP format (Windows flavor) */
+ FMT_GIF, /* GIF format (LZW compressed) */
+ FMT_GIF0, /* GIF format (uncompressed) */
+ FMT_OS2, /* BMP format (OS/2 flavor) */
+ FMT_PPM, /* PPM/PGM (PBMPLUS formats) */
+ FMT_RLE, /* RLE format */
+ FMT_TARGA, /* Targa format */
+ FMT_TIFF /* TIFF format */
+} IMAGE_FORMATS;
+
+#ifndef DEFAULT_FMT /* so can override from CFLAGS in Makefile */
+#define DEFAULT_FMT FMT_BMP
+#endif
+
+static IMAGE_FORMATS requested_fmt;
+
+
+/*
+ * Argument-parsing code.
+ * The switch parser is designed to be useful with DOS-style command line
+ * syntax, ie, intermixed switches and file names, where only the switches
+ * to the left of a given file name affect processing of that file.
+ */
+
+
+static const char * progname; /* program name for error messages */
+static char * outfilename; /* for -outfile switch */
+
+
+LOCAL(void)
+usage (void)
+/* complain about bad command line */
+{
+ fprintf(stderr, "usage: %s [switches] inputfile(s)\n", progname);
+ fprintf(stderr, "List of input files may use wildcards (* and ?)\n");
+ fprintf(stderr, "Output filename is same as input filename except for extension\n");
+
+ fprintf(stderr, "Switches (names may be abbreviated):\n");
+ fprintf(stderr, " -colors N Reduce image to no more than N colors\n");
+ fprintf(stderr, " -fast Fast, low-quality processing\n");
+ fprintf(stderr, " -grayscale Force grayscale output\n");
+ fprintf(stderr, " -rgb Force RGB output\n");
+#ifdef IDCT_SCALING_SUPPORTED
+ fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
+#endif
+#ifdef BMP_SUPPORTED
+ fprintf(stderr, " -bmp Select BMP output format (Windows style)%s\n",
+ (DEFAULT_FMT == FMT_BMP ? " (default)" : ""));
+#endif
+#ifdef GIF_SUPPORTED
+ fprintf(stderr, " -gif Select GIF output format (LZW compressed)%s\n",
+ (DEFAULT_FMT == FMT_GIF ? " (default)" : ""));
+ fprintf(stderr, " -gif0 Select GIF output format (uncompressed)%s\n",
+ (DEFAULT_FMT == FMT_GIF0 ? " (default)" : ""));
+#endif
+#ifdef BMP_SUPPORTED
+ fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s\n",
+ (DEFAULT_FMT == FMT_OS2 ? " (default)" : ""));
+#endif
+#ifdef PPM_SUPPORTED
+ fprintf(stderr, " -pnm Select PBMPLUS (PPM/PGM) output format%s\n",
+ (DEFAULT_FMT == FMT_PPM ? " (default)" : ""));
+#endif
+#ifdef RLE_SUPPORTED
+ fprintf(stderr, " -rle Select Utah RLE output format%s\n",
+ (DEFAULT_FMT == FMT_RLE ? " (default)" : ""));
+#endif
+#ifdef TARGA_SUPPORTED
+ fprintf(stderr, " -targa Select Targa output format%s\n",
+ (DEFAULT_FMT == FMT_TARGA ? " (default)" : ""));
+#endif
+ fprintf(stderr, "Switches for advanced users:\n");
+#ifdef DCT_ISLOW_SUPPORTED
+ fprintf(stderr, " -dct int Use integer DCT method%s\n",
+ (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
+#endif
+#ifdef DCT_IFAST_SUPPORTED
+ fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n",
+ (JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
+#endif
+#ifdef DCT_FLOAT_SUPPORTED
+ fprintf(stderr, " -dct float Use floating-point DCT method%s\n",
+ (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
+#endif
+ fprintf(stderr, " -dither fs Use F-S dithering (default)\n");
+ fprintf(stderr, " -dither none Don't use dithering in quantization\n");
+ fprintf(stderr, " -dither ordered Use ordered dither (medium speed, quality)\n");
+#ifdef QUANT_2PASS_SUPPORTED
+ fprintf(stderr, " -map FILE Map to colors used in named image file\n");
+#endif
+ fprintf(stderr, " -nosmooth Don't use high-quality upsampling\n");
+#ifdef QUANT_1PASS_SUPPORTED
+ fprintf(stderr, " -onepass Use 1-pass quantization (fast, low quality)\n");
+#endif
+#ifndef FREE_MEM_ESTIMATE
+ fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
+#endif
+ fprintf(stderr, " -outfile name Specify name for output file\n");
+ fprintf(stderr, " -verbose or -debug Emit debug output\n");
+ exit(EXIT_FAILURE);
+}
+
+
+LOCAL(int)
+parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
+ int last_file_arg_seen, boolean for_real)
+/* Parse optional switches.
+ * Returns argv[] index of first file-name argument (== argc if none).
+ * Any file names with indexes <= last_file_arg_seen are ignored;
+ * they have presumably been processed in a previous iteration.
+ * (Pass 0 for last_file_arg_seen on the first or only iteration.)
+ * for_real is FALSE on the first (dummy) pass; we may skip any expensive
+ * processing.
+ */
+{
+ int argn;
+ char * arg;
+
+ /* Set up default JPEG parameters. */
+ requested_fmt = DEFAULT_FMT; /* set default output file format */
+ outfilename = NULL;
+ cinfo->err->trace_level = 0;
+ if (default_maxmem > 0) /* override library's default value */
+ cinfo->mem->max_memory_to_use = default_maxmem;
+
+ /* Scan command line options, adjust parameters */
+
+ for (argn = 1; argn < argc; argn++) {
+ arg = argv[argn];
+ if (*arg != '-') {
+ /* Not a switch, must be a file name argument */
+ if (argn <= last_file_arg_seen) {
+ outfilename = NULL; /* -outfile applies to just one input file */
+ continue; /* ignore this name if previously processed */
+ }
+ break; /* else done parsing switches */
+ }
+ arg++; /* advance past switch marker character */
+
+ if (keymatch(arg, "bmp", 1)) {
+ /* BMP output format (Windows flavor). */
+ requested_fmt = FMT_BMP;
+
+ } else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) ||
+ keymatch(arg, "quantize", 1) || keymatch(arg, "quantise", 1)) {
+ /* Do color quantization. */
+ int val;
+
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (sscanf(argv[argn], "%d", &val) != 1)
+ usage();
+ cinfo->desired_number_of_colors = val;
+ cinfo->quantize_colors = TRUE;
+
+ } else if (keymatch(arg, "dct", 2)) {
+ /* Select IDCT algorithm. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (keymatch(argv[argn], "int", 1)) {
+ cinfo->dct_method = JDCT_ISLOW;
+ } else if (keymatch(argv[argn], "fast", 2)) {
+ cinfo->dct_method = JDCT_IFAST;
+ } else if (keymatch(argv[argn], "float", 2)) {
+ cinfo->dct_method = JDCT_FLOAT;
+ } else
+ usage();
+
+ } else if (keymatch(arg, "dither", 2)) {
+ /* Select dithering algorithm. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (keymatch(argv[argn], "fs", 2)) {
+ cinfo->dither_mode = JDITHER_FS;
+ } else if (keymatch(argv[argn], "none", 2)) {
+ cinfo->dither_mode = JDITHER_NONE;
+ } else if (keymatch(argv[argn], "ordered", 2)) {
+ cinfo->dither_mode = JDITHER_ORDERED;
+ } else
+ usage();
+
+ } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
+ /* Enable debug printouts. */
+ /* On first -d, print version identification */
+ static boolean printed_version = FALSE;
+
+ if (! printed_version) {
+ fprintf(stderr, "Independent JPEG Group's DJPEG, version %s\n%s\n",
+ JVERSION, JCOPYRIGHT);
+ printed_version = TRUE;
+ }
+ cinfo->err->trace_level++;
+
+ } else if (keymatch(arg, "fast", 1)) {
+ /* Select recommended processing options for quick-and-dirty output. */
+ cinfo->two_pass_quantize = FALSE;
+ cinfo->dither_mode = JDITHER_ORDERED;
+ if (! cinfo->quantize_colors) /* don't override an earlier -colors */
+ cinfo->desired_number_of_colors = 216;
+ cinfo->dct_method = JDCT_FASTEST;
+ cinfo->do_fancy_upsampling = FALSE;
+
+ } else if (keymatch(arg, "gif", 1)) {
+ /* GIF output format (LZW compressed). */
+ requested_fmt = FMT_GIF;
+
+ } else if (keymatch(arg, "gif0", 4)) {
+ /* GIF output format (uncompressed). */
+ requested_fmt = FMT_GIF0;
+
+ } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) {
+ /* Force monochrome output. */
+ cinfo->out_color_space = JCS_GRAYSCALE;
+
+ } else if (keymatch(arg, "rgb", 3)) {
+ /* Force RGB output. */
+ cinfo->out_color_space = JCS_RGB;
+
+ } else if (keymatch(arg, "map", 3)) {
+ /* Quantize to a color map taken from an input file. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (for_real) { /* too expensive to do twice! */
+#ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */
+ FILE * mapfile;
+
+ if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {
+ fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
+ exit(EXIT_FAILURE);
+ }
+ read_color_map(cinfo, mapfile);
+ fclose(mapfile);
+ cinfo->quantize_colors = TRUE;
+#else
+ ERREXIT(cinfo, JERR_NOT_COMPILED);
+#endif
+ }
+
+ } else if (keymatch(arg, "maxmemory", 3)) {
+ /* Maximum memory in Kb (or Mb with 'm'). */
+ long lval;
+ char ch = 'x';
+
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
+ usage();
+ if (ch == 'm' || ch == 'M')
+ lval *= 1000L;
+ cinfo->mem->max_memory_to_use = lval * 1000L;
+
+ } else if (keymatch(arg, "nosmooth", 3)) {
+ /* Suppress fancy upsampling. */
+ cinfo->do_fancy_upsampling = FALSE;
+
+ } else if (keymatch(arg, "onepass", 3)) {
+ /* Use fast one-pass quantization. */
+ cinfo->two_pass_quantize = FALSE;
+
+ } else if (keymatch(arg, "os2", 3)) {
+ /* BMP output format (OS/2 flavor). */
+ requested_fmt = FMT_OS2;
+
+ } else if (keymatch(arg, "outfile", 4)) {
+ /* Set output file name. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ outfilename = argv[argn]; /* save it away for later use */
+
+ } else if (keymatch(arg, "pnm", 1) || keymatch(arg, "ppm", 1)) {
+ /* PPM/PGM output format. */
+ requested_fmt = FMT_PPM;
+
+ } else if (keymatch(arg, "rle", 1)) {
+ /* RLE output format. */
+ requested_fmt = FMT_RLE;
+
+ } else if (keymatch(arg, "scale", 1)) {
+ /* Scale the output image by a fraction M/N. */
+ if (++argn >= argc) /* advance to next argument */
+ usage();
+ if (sscanf(argv[argn], "%u/%u",
+ &cinfo->scale_num, &cinfo->scale_denom) < 1)
+ usage();
+
+ } else if (keymatch(arg, "targa", 1)) {
+ /* Targa output format. */
+ requested_fmt = FMT_TARGA;
+
+ } else {
+ usage(); /* bogus switch */
+ }
+ }
+
+ return argn; /* return index of next arg (file name) */
+}
+
+
+/*
+ * Marker processor for COM and interesting APPn markers.
+ * This replaces the library's built-in processor, which just skips the marker.
+ * We want to print out the marker as text, to the extent possible.
+ * Note this code relies on a non-suspending data source.
+ */
+
+LOCAL(unsigned int)
+jpeg_getc (j_decompress_ptr cinfo)
+/* Read next byte */
+{
+ struct jpeg_source_mgr * datasrc = cinfo->src;
+
+ if (datasrc->bytes_in_buffer == 0) {
+ if (! (*datasrc->fill_input_buffer) (cinfo))
+ ERREXIT(cinfo, JERR_CANT_SUSPEND);
+ }
+ datasrc->bytes_in_buffer--;
+ return GETJOCTET(*datasrc->next_input_byte++);
+}
+
+
+METHODDEF(boolean)
+print_text_marker (j_decompress_ptr cinfo)
+{
+ boolean traceit = (cinfo->err->trace_level >= 1);
+ INT32 length;
+ unsigned int ch;
+ unsigned int lastch = 0;
+
+ length = jpeg_getc(cinfo) << 8;
+ length += jpeg_getc(cinfo);
+ length -= 2; /* discount the length word itself */
+
+ if (traceit) {
+ if (cinfo->unread_marker == JPEG_COM)
+ fprintf(stderr, "Comment, length %ld:\n", (long) length);
+ else /* assume it is an APPn otherwise */
+ fprintf(stderr, "APP%d, length %ld:\n",
+ cinfo->unread_marker - JPEG_APP0, (long) length);
+ }
+
+ while (--length >= 0) {
+ ch = jpeg_getc(cinfo);
+ if (traceit) {
+ /* Emit the character in a readable form.
+ * Nonprintables are converted to \nnn form,
+ * while \ is converted to \\.
+ * Newlines in CR, CR/LF, or LF form will be printed as one newline.
+ */
+ if (ch == '\r') {
+ fprintf(stderr, "\n");
+ } else if (ch == '\n') {
+ if (lastch != '\r')
+ fprintf(stderr, "\n");
+ } else if (ch == '\\') {
+ fprintf(stderr, "\\\\");
+ } else if (isprint(ch)) {
+ putc(ch, stderr);
+ } else {
+ fprintf(stderr, "\\%03o", ch);
+ }
+ lastch = ch;
+ }
+ }
+
+ if (traceit)
+ fprintf(stderr, "\n");
+
+ return TRUE;
+}
+
+
+/*
+ * Check for overwrite of an existing file; clear it with user
+ */
+
+#ifndef NO_OVERWRITE_CHECK
+
+LOCAL(boolean)
+is_write_ok (char * outfname)
+{
+ FILE * ofile;
+ int ch;
+
+ ofile = fopen(outfname, READ_BINARY);
+ if (ofile == NULL)
+ return TRUE; /* not present */
+ fclose(ofile); /* oops, it is present */
+
+ for (;;) {
+ fprintf(stderr, "%s already exists, overwrite it? [y/n] ",
+ outfname);
+ fflush(stderr);
+ ch = getc(stdin);
+ if (ch != '\n') /* flush rest of line */
+ while (getc(stdin) != '\n')
+ /* nothing */;
+
+ switch (ch) {
+ case 'Y':
+ case 'y':
+ return TRUE;
+ case 'N':
+ case 'n':
+ return FALSE;
+ /* otherwise, ask again */
+ }
+ }
+}
+
+#endif
+
+
+/*
+ * Process a single input file name, and return its index in argv[].
+ * File names at or to left of old_file_index have been processed already.
+ */
+
+LOCAL(int)
+process_one_file (int argc, char **argv, int old_file_index)
+{
+ struct jpeg_decompress_struct cinfo;
+ struct jpeg_error_mgr jerr;
+ char *infilename;
+ char workfilename[PATH_MAX];
+ const char *default_extension = NULL;
+#ifdef PROGRESS_REPORT
+ struct cdjpeg_progress_mgr progress;
+#endif
+ int file_index;
+ djpeg_dest_ptr dest_mgr = NULL;
+ FILE * input_file = NULL;
+ FILE * output_file = NULL;
+ JDIMENSION num_scanlines;
+
+ /* Initialize the JPEG decompression object with default error handling. */
+ cinfo.err = jpeg_std_error(&jerr);
+ jpeg_create_decompress(&cinfo);
+ /* Add some application-specific error messages (from cderror.h) */
+ jerr.addon_message_table = cdjpeg_message_table;
+ jerr.first_addon_message = JMSG_FIRSTADDONCODE;
+ jerr.last_addon_message = JMSG_LASTADDONCODE;
+
+ /* Insert custom marker processor for COM and APP12.
+ * APP12 is used by some digital camera makers for textual info,
+ * so we provide the ability to display it as text.
+ * If you like, additional APPn marker types can be selected for display,
+ * but don't try to override APP0 or APP14 this way (see libjpeg.txt).
+ */
+ jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);
+ jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);
+
+ /* Now safe to enable signal catcher. */
+#ifdef NEED_SIGNAL_CATCHER
+ enable_signal_catcher((j_common_ptr) &cinfo);
+#endif
+
+ /* Scan command line to find next file name.
+ * It is convenient to use just one switch-parsing routine, but the switch
+ * values read here are ignored; we will rescan the switches after opening
+ * the input file.
+ * (Exception: tracing level set here controls verbosity for COM markers
+ * found during jpeg_read_header...)
+ */
+
+ file_index = parse_switches(&cinfo, argc, argv, old_file_index, FALSE);
+ if (file_index >= argc) {
+ fprintf(stderr, "%s: missing input file name\n", progname);
+ usage();
+ }
+
+ /* Open the input file. */
+ infilename = argv[file_index];
+ if ((input_file = fopen(infilename, READ_BINARY)) == NULL) {
+ fprintf(stderr, "%s: can't open %s\n", progname, infilename);
+ goto fail;
+ }
+
+#ifdef PROGRESS_REPORT
+ start_progress_monitor((j_common_ptr) &cinfo, &progress);
+#endif
+
+ /* Specify data source for decompression */
+ jpeg_stdio_src(&cinfo, input_file);
+
+ /* Read file header, set default decompression parameters */
+ (void) jpeg_read_header(&cinfo, TRUE);
+
+ /* Adjust default decompression parameters by re-parsing the options */
+ file_index = parse_switches(&cinfo, argc, argv, old_file_index, TRUE);
+
+ /* Initialize the output module now to let it override any crucial
+ * option settings (for instance, GIF wants to force color quantization).
+ */
+ switch (requested_fmt) {
+#ifdef BMP_SUPPORTED
+ case FMT_BMP:
+ dest_mgr = jinit_write_bmp(&cinfo, FALSE);
+ default_extension = ".bmp";
+ break;
+ case FMT_OS2:
+ dest_mgr = jinit_write_bmp(&cinfo, TRUE);
+ default_extension = ".bmp";
+ break;
+#endif
+#ifdef GIF_SUPPORTED
+ case FMT_GIF:
+ dest_mgr = jinit_write_gif(&cinfo, TRUE);
+ default_extension = ".gif";
+ break;
+ case FMT_GIF0:
+ dest_mgr = jinit_write_gif(&cinfo, FALSE);
+ default_extension = ".gif";
+ break;
+#endif
+#ifdef PPM_SUPPORTED
+ case FMT_PPM:
+ dest_mgr = jinit_write_ppm(&cinfo);
+ default_extension = ".ppm";
+ break;
+#endif
+#ifdef RLE_SUPPORTED
+ case FMT_RLE:
+ dest_mgr = jinit_write_rle(&cinfo);
+ default_extension = ".rle";
+ break;
+#endif
+#ifdef TARGA_SUPPORTED
+ case FMT_TARGA:
+ dest_mgr = jinit_write_targa(&cinfo);
+ default_extension = ".tga";
+ break;
+#endif
+ default:
+ ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);
+ }
+
+ /* If user didn't supply -outfile switch, select output file name. */
+ if (outfilename == NULL) {
+ int i;
+
+ outfilename = workfilename;
+ /* Make outfilename be infilename with appropriate extension */
+ strcpy(outfilename, infilename);
+ for (i = (int)strlen(outfilename)-1; i >= 0; i--) {
+ switch (outfilename[i]) {
+ case ':':
+ case '/':
+ case '\\':
+ i = 0; /* stop scanning */
+ break;
+ case '.':
+ outfilename[i] = '\0'; /* lop off existing extension */
+ i = 0; /* stop scanning */
+ break;
+ default:
+ break; /* keep scanning */
+ }
+ }
+ strcat(outfilename, default_extension);
+ }
+
+ fprintf(stderr, "Decompressing %s => %s\n", infilename, outfilename);
+#ifndef NO_OVERWRITE_CHECK
+ if (! is_write_ok(outfilename))
+ goto fail;
+#endif
+
+ /* Open the output file. */
+ if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
+ fprintf(stderr, "%s: can't create %s\n", progname, outfilename);
+ goto fail;
+ }
+ dest_mgr->output_file = output_file;
+
+ /* Start decompressor */
+ (void) jpeg_start_decompress(&cinfo);
+
+ /* Write output file header */
+ (*dest_mgr->start_output) (&cinfo, dest_mgr);
+
+ /* Process data */
+ while (cinfo.output_scanline < cinfo.output_height) {
+ num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
+ dest_mgr->buffer_height);
+ (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
+ }
+
+#ifdef PROGRESS_REPORT
+ /* Hack: count final pass as done in case finish_output does an extra pass.
+ * The library won't have updated completed_passes.
+ */
+ progress.pub.completed_passes = progress.pub.total_passes;
+#endif
+
+ /* Finish decompression and release memory.
+ * I must do it in this order because output module has allocated memory
+ * of lifespan JPOOL_IMAGE; it needs to finish before releasing memory.
+ */
+ (*dest_mgr->finish_output) (&cinfo, dest_mgr);
+ (void) jpeg_finish_decompress(&cinfo);
+
+ /* Clean up and exit */
+fail:
+ jpeg_destroy_decompress(&cinfo);
+
+ if (input_file != NULL) fclose(input_file);
+ if (output_file != NULL) fclose(output_file);
+
+#ifdef PROGRESS_REPORT
+ end_progress_monitor((j_common_ptr) &cinfo);
+#endif
+
+ /* Disable signal catcher. */
+#ifdef NEED_SIGNAL_CATCHER
+ enable_signal_catcher((j_common_ptr) NULL);
+#endif
+
+ return file_index;
+}
+
+
+/*
+ * The main program.
+ */
+
+int
+main (int argc, char **argv)
+{
+ int file_index;
+
+ /* On Mac, fetch a command line. */
+#ifdef USE_CCOMMAND
+ argc = ccommand(&argv);
+#endif
+
+#ifdef MSDOS
+ progname = "djpeg"; /* DOS tends to be too verbose about argv[0] */
+#else
+ progname = argv[0];
+ if (progname == NULL || progname[0] == 0)
+ progname = "djpeg"; /* in case C library doesn't provide it */
+#endif
+
+ /* The default maxmem must be computed only once at program startup,
+ * since releasing memory with free() won't give it back to the OS.
+ */
+#ifdef FREE_MEM_ESTIMATE
+ default_maxmem = FREE_MEM_ESTIMATE;
+#else
+ default_maxmem = 0;
+#endif
+
+ /* Scan command line, parse switches and locate input file names */
+
+ if (argc < 2)
+ usage(); /* nothing on the command line?? */
+
+ file_index = 0;
+
+ while (file_index < argc-1)
+ file_index = process_one_file(argc, argv, file_index);
+
+ /* All done. */
+ exit(EXIT_SUCCESS);
+ return 0; /* suppress no-return-value warnings */
+}
diff --git a/jpeg/filelist.txt b/jpeg/filelist.txt
index 86def455..ddd681b2 100644
--- a/jpeg/filelist.txt
+++ b/jpeg/filelist.txt
@@ -1,6 +1,6 @@
IJG JPEG LIBRARY: FILE LIST
-Copyright (C) 1994-2019, Thomas G. Lane, Guido Vollbeding.
+Copyright (C) 1994-2020, Thomas G. Lane, Guido Vollbeding.
This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file.
@@ -140,7 +140,9 @@ transupp.h Declarations for jpegtran support routines in transupp.c.
C source code files:
cjpeg.c Main program for cjpeg.
+cjpegalt.c Main program for cjpeg with alternate user interface.
djpeg.c Main program for djpeg.
+djpegalt.c Main program for djpeg with alternate user interface.
jpegtran.c Main program for jpegtran.
cdjpeg.c Utility routines used by all three programs.
rdcolmap.c Code to read a colormap file for djpeg's "-map" switch.
diff --git a/jpeg/install-sh b/jpeg/install-sh
deleted file mode 100755
index 8175c640..00000000
--- a/jpeg/install-sh
+++ /dev/null
@@ -1,518 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2018-03-11.20; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# 'make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-tab=' '
-nl='
-'
-IFS=" $tab$nl"
-
-# Set DOITPROG to "echo" to test this script.
-
-doit=${DOITPROG-}
-doit_exec=${doit:-exec}
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-is_target_a_directory=possibly
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
- --help display this help and exit.
- --version display version info and exit.
-
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
- case $1 in
- -c) ;;
-
- -C) copy_on_change=true;;
-
- -d) dir_arg=true;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) mode=$2
- case $mode in
- *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
-
- -o) chowncmd="$chownprog $2"
- shift;;
-
- -s) stripcmd=$stripprog;;
-
- -t)
- is_target_a_directory=always
- dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
-
- -T) is_target_a_directory=never;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- --) shift
- break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
- esac
- shift
-done
-
-# We allow the use of options -d and -T together, by making -d
-# take the precedence; this is for compatibility with GNU install.
-
-if test -n "$dir_arg"; then
- if test -n "$dst_arg"; then
- echo "$0: target directory not allowed when installing a directory." >&2
- exit 1
- fi
-fi
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dst_arg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
- shift # fnord
- fi
- shift # arg
- dst_arg=$arg
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- done
-fi
-
-if test $# -eq 0; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call 'install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-if test -z "$dir_arg"; then
- if test $# -gt 1 || test "$is_target_a_directory" = always; then
- if test ! -d "$dst_arg"; then
- echo "$0: $dst_arg: Is not a directory." >&2
- exit 1
- fi
- fi
-fi
-
-if test -z "$dir_arg"; then
- do_exit='(exit $ret); exit $ret'
- trap "ret=129; $do_exit" 1
- trap "ret=130; $do_exit" 2
- trap "ret=141; $do_exit" 13
- trap "ret=143; $do_exit" 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
-
-for src
-do
- # Protect names problematic for 'test' and other utilities.
- case $src in
- -* | [=\(\)!]) src=./$src;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
-
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dst_arg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
- dst=$dst_arg
-
- # If destination is a directory, append the input filename.
- if test -d "$dst"; then
- if test "$is_target_a_directory" = never; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
- fi
- dstdir=$dst
- dstbase=`basename "$src"`
- case $dst in
- */) dst=$dst$dstbase;;
- *) dst=$dst/$dstbase;;
- esac
- dstdir_status=0
- else
- dstdir=`dirname "$dst"`
- test -d "$dstdir"
- dstdir_status=$?
- fi
- fi
-
- case $dstdir in
- */) dstdirslash=$dstdir;;
- *) dstdirslash=$dstdir/;;
- esac
-
- obsolete_mkdir_used=false
-
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- # Note that $RANDOM variable is not portable (e.g. dash); Use it
- # here however when possible just to lower collision chance.
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-
- trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- # Because "mkdir -p" follows existing symlinks and we likely work
- # directly in world-writeable /tmp, make sure that the '$tmpdir'
- # directory is successfully created first before we actually test
- # 'mkdir -p' feature.
- if (umask $mkdir_umask &&
- $mkdirprog $mkdir_mode "$tmpdir" &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- test_tmpdir="$tmpdir/a"
- ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
-
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
- esac
-
- oIFS=$IFS
- IFS=/
- set -f
- set fnord $dstdir
- shift
- set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
- fi
- fi
- fi
-
- if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
- else
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=${dstdirslash}_inst.$$_
- rmtmp=${dstdirslash}_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
- # Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # If -C, don't bother to copy if it wouldn't change the file.
- if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
- set -f &&
- set X $old && old=:$2:$4:$5:$6 &&
- set X $new && new=:$2:$4:$5:$6 &&
- set +f &&
- test "$old" = "$new" &&
- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
- then
- rm -f "$dsttmp"
- else
- # Rename the file to the real destination.
- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
- {
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- fi || exit 1
-
- trap '' 0
- fi
-done
-
-# Local variables:
-# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC0"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/jpeg/install.txt b/jpeg/install.txt
index 107f6c1f..64205134 100644
--- a/jpeg/install.txt
+++ b/jpeg/install.txt
@@ -1,6 +1,6 @@
INSTALLATION INSTRUCTIONS for the Independent JPEG Group's JPEG software
-Copyright (C) 1991-2019, Thomas G. Lane, Guido Vollbeding.
+Copyright (C) 1991-2021, Thomas G. Lane, Guido Vollbeding.
This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file.
@@ -150,8 +150,11 @@ makefile.wat jconfig.wat MS-DOS, OS/2, or Windows NT, Watcom C
makefile.vc jconfig.vc Windows, MS Visual C++
makefile.vs jconfig.vc Windows, MS Visual C++ 6 Developer Studio
make*.vc6
-makefile.vs jconfig.vc Windows, Visual Studio 2019 (v16)
+makefile.vs jconfig.vc Windows, Visual Studio 2019 Version 16
make*.v16
+makefile.vs jconfig.vc Windows, Visual Studio 2022 Version 17
+make*.v16
+make*.v17
makefile.b32 jconfig.vc Windows, Borland C++ 32-bit (bcc32)
makefile.mms jconfig.vms Digital VMS, with MMS software
makefile.vms jconfig.vms Digital VMS, without MMS software
@@ -320,6 +323,7 @@ As a quick test of functionality we've included a small sample image in
several forms:
testorig.jpg Starting point for the djpeg tests.
testimg.ppm The output of djpeg testorig.jpg
+ testimg.gif The output of djpeg -gif testorig.jpg
testimg.bmp The output of djpeg -bmp -colors 256 testorig.jpg
testimg.jpg The output of cjpeg testimg.ppm
testprog.jpg Progressive-mode equivalent of testorig.jpg.
@@ -1029,18 +1033,18 @@ library, we recommend building the applications so that you can run the
self-test.)
To use:
-1. Open the command prompt, change to the source directory and execute
- the command line
- NMAKE /f makefile.vs setup-vc6
- If you get an error message saying that the "NMAKE" command could
+1. Open the Windows Command Prompt, change to the source directory and
+ execute the command line
+ nmake /f makefile.vs setup-vc6
+ If you get an error message saying that the "nmake" command could
not be found, execute the command
"%ProgramFiles%\Microsoft Visual Studio\VC98\Bin\VCVARS32"
to set the environment for using Microsoft Visual C++ tools,
- and repeat the NMAKE call.
+ and repeat the nmake call.
This will move jconfig.vc to jconfig.h and makefiles to project files.
(Note that the renaming is critical!)
Alternatively you can use
- NMAKE /f makefile.vs setupcopy-vc6
+ nmake /f makefile.vs setupcopy-vc6
This will create renamed copies of the files, which allows to repeat
the setup later.
2. Open the workspace file jpeg.dsw, build the library project.
@@ -1048,45 +1052,112 @@ To use:
probably get a message saying that the project files are being updated.)
3. Open the workspace file apps.dsw, build the application projects.
4. To perform the self-test, execute the command line
- NMAKE /f makefile.vs test-build
+ nmake /f makefile.vs test-build
+5. Move the application .exe files from the Release folder to an
+ appropriate location on your path.
+
+
+Microsoft Windows, Visual Studio 2019 Version 16:
+
+We include makefiles that should work as project files in Visual Studio
+2019 Version 16 or later. There is a library makefile that builds the
+IJG library as a static Win32/x64/ARM/ARM64 library, and application
+makefiles that build the sample applications as Win32/x64/ARM/ARM64
+console applications. (Even if you only want the library, we recommend
+building the applications so that you can run the self-test.)
+
+To use:
+1. Ensure you’ve checked the item "Desktop development with C++" in the
+ Workloads tab of Visual Studio Installer.
+ Open the Developer Command Prompt for VS 2019, change to the source
+ directory and execute the command line
+ nmake /f makefile.vs setup-v16
+ This will move jconfig.vc to jconfig.h and makefiles to project files.
+ (Note that the renaming is critical!)
+ Alternatively you can use
+ nmake /f makefile.vs setupcopy-v16
+ This will create renamed copies of the files, which allows to repeat
+ the setup later.
+2. Open the solution file jpeg.sln, build the library project.
+ a) If you are using Visual Studio more recent than
+ 2019 Version 16, you'll probably get a message
+ saying that the project files are being updated.
+ b) If necessary, open the project properties and
+ adapt the Windows Target Platform Version in
+ the Configuration Properties, General section;
+ we support the latest version at the time of release.
+ c) If you get a warning saying that a platform cannot be found,
+ you can either
+ * forgo the platform and ignore the warning, or
+ * remove the platform in the Configuration Manager, or
+ * install the corresponding platform Buildtools in
+ Visual Studio Installer (Workloads tab Optional components
+ or Individual components tab).
+ d) If you want to build x64 code, change the platform setting from
+ Win32 to x64. You can build Win32 and x64 versions side by side.
+ e) If you want to build ARM/ARM64 code, change the platform setting
+ to ARM/ARM64. Ensure you've installed the ARM/ARM64-Buildtools
+ in Visual Studio Installer (Workloads tab Optional components
+ or Individual components tab).
+ You can build Win32/x64/ARM/ARM64 versions side by side.
+3. Open the solution file apps.sln, build the application projects.
+4. To perform the self-test, execute the command line
+ nmake /f makefile.vs test-32
+ for the Win32 build, or on a 64-bit system
+ nmake /f makefile.vs test-64
+ for the x64 build.
5. Move the application .exe files from the Release folder to an
appropriate location on your path.
-Microsoft Windows, Visual Studio 2019 (v16):
+Microsoft Windows, Visual Studio 2022 Version 17:
We include makefiles that should work as project files in Visual Studio
-2019 (v16) or later. There is a library makefile that builds the IJG
-library as a static Win32/x64 library, and application makefiles that
-build the sample applications as Win32/x64 console applications. (Even
-if you only want the library, we recommend building the applications so
-that you can run the self-test.)
+2022 Version 17 or later. There is a library makefile that builds the
+IJG library as a static Win32/x64/ARM/ARM64 library, and application
+makefiles that build the sample applications as Win32/x64/ARM/ARM64
+console applications. (Even if you only want the library, we recommend
+building the applications so that you can run the self-test.)
To use:
-1. Open the Developer Command Prompt for VS 2019, change to the source
+1. Ensure you’ve checked the item "Desktop development with C++" in the
+ Workloads tab of Visual Studio Installer.
+ Open the Developer Command Prompt for VS 2022, change to the source
directory and execute the command line
- NMAKE /f makefile.vs setup-v16
+ nmake /f makefile.vs setup-v17
This will move jconfig.vc to jconfig.h and makefiles to project files.
(Note that the renaming is critical!)
Alternatively you can use
- NMAKE /f makefile.vs setupcopy-v16
+ nmake /f makefile.vs setupcopy-v17
This will create renamed copies of the files, which allows to repeat
the setup later.
2. Open the solution file jpeg.sln, build the library project.
a) If you are using Visual Studio more recent than
- 2019 (v16), you'll probably get a message saying
- that the project files are being updated.
+ 2022 Version 17, you'll probably get a message
+ saying that the project files are being updated.
b) If necessary, open the project properties and
adapt the Windows Target Platform Version in
the Configuration Properties, General section;
we support the latest version at the time of release.
- c) If you want to build x64 code, change the platform setting from
+ c) If you get a warning saying that a platform cannot be found,
+ you can either
+ * forgo the platform and ignore the warning, or
+ * remove the platform in the Configuration Manager, or
+ * install the corresponding platform Buildtools in
+ Visual Studio Installer (Workloads tab Optional components
+ or Individual components tab).
+ d) If you want to build x64 code, change the platform setting from
Win32 to x64. You can build Win32 and x64 versions side by side.
+ e) If you want to build ARM/ARM64 code, change the platform setting
+ to ARM/ARM64. Ensure you've installed the ARM/ARM64-Buildtools
+ in Visual Studio Installer (Workloads tab Optional components
+ or Individual components tab).
+ You can build Win32/x64/ARM/ARM64 versions side by side.
3. Open the solution file apps.sln, build the application projects.
4. To perform the self-test, execute the command line
- NMAKE /f makefile.vs test-32
+ nmake /f makefile.vs test-32
for the Win32 build, or on a 64-bit system
- NMAKE /f makefile.vs test-64
+ nmake /f makefile.vs test-64
for the x64 build.
5. Move the application .exe files from the Release folder to an
appropriate location on your path.
diff --git a/jpeg/jcarith.c b/jpeg/jcarith.c
index 46ce6c6a..1b45089a 100644
--- a/jpeg/jcarith.c
+++ b/jpeg/jcarith.c
@@ -1,7 +1,7 @@
/*
* jcarith.c
*
- * Developed 1997-2019 by Guido Vollbeding.
+ * Developed 1997-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -361,7 +361,7 @@ emit_restart (j_compress_ptr cinfo, int restart_num)
*/
METHODDEF(boolean)
-encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
unsigned char *st;
@@ -450,7 +450,7 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
const int * natural_order;
@@ -557,7 +557,7 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
unsigned char *st;
@@ -592,7 +592,7 @@ encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
const int * natural_order;
@@ -691,7 +691,7 @@ encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-encode_mcu (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
const int * natural_order;
diff --git a/jpeg/jccoefct.c b/jpeg/jccoefct.c
index 924a703d..69b07e64 100644
--- a/jpeg/jccoefct.c
+++ b/jpeg/jccoefct.c
@@ -2,7 +2,7 @@
* jccoefct.c
*
* Copyright (C) 1994-1997, Thomas G. Lane.
- * Modified 2003-2011 by Guido Vollbeding.
+ * Modified 2003-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -36,16 +36,14 @@ typedef struct {
struct jpeg_c_coef_controller pub; /* public fields */
JDIMENSION iMCU_row_num; /* iMCU row # within image */
- JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
+ JDIMENSION MCU_ctr; /* counts MCUs processed in current row */
int MCU_vert_offset; /* counts MCU rows within iMCU row */
int MCU_rows_per_iMCU_row; /* number of such rows needed */
/* For single-pass compression, it's sufficient to buffer just one MCU
- * (although this may prove a bit slow in practice). We allocate a
- * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it for each
- * MCU constructed and sent. (On 80x86, the workspace is FAR even though
- * it's not really very big; this is to keep the module interfaces unchanged
- * when a large coefficient buffer is necessary.)
+ * (although this may prove a bit slow in practice). We append a
+ * workspace of C_MAX_BLOCKS_IN_MCU coefficient blocks, and reuse it
+ * for each MCU constructed and sent.
* In multi-pass modes, this array points to the current MCU's blocks
* within the virtual arrays.
*/
@@ -53,6 +51,9 @@ typedef struct {
/* In multi-pass modes, we need a virtual block array for each component. */
jvirt_barray_ptr whole_image[MAX_COMPONENTS];
+
+ /* Workspace for single-pass compression (omitted otherwise). */
+ JBLOCK blk_buffer[C_MAX_BLOCKS_IN_MCU];
} my_coef_controller;
typedef my_coef_controller * my_coef_ptr;
@@ -88,7 +89,7 @@ start_iMCU_row (j_compress_ptr cinfo)
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
}
- coef->mcu_ctr = 0;
+ coef->MCU_ctr = 0;
coef->MCU_vert_offset = 0;
}
@@ -125,7 +126,6 @@ start_pass_coef (j_compress_ptr cinfo, J_BUF_MODE pass_mode)
#endif
default:
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- break;
}
}
@@ -147,59 +147,56 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
JDIMENSION MCU_col_num; /* index of current MCU within row */
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
- int blkn, bi, ci, yindex, yoffset, blockcnt;
- JDIMENSION ypos, xpos;
+ int ci, xindex, yindex, yoffset, blockcnt;
+ JBLOCKROW blkp;
+ JSAMPARRAY input_ptr;
+ JDIMENSION xpos;
jpeg_component_info *compptr;
forward_DCT_ptr forward_DCT;
/* Loop to write as much as one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
- for (MCU_col_num = coef->mcu_ctr; MCU_col_num <= last_MCU_col;
+ for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
MCU_col_num++) {
/* Determine where data comes from in input_buf and do the DCT thing.
- * Each call on forward_DCT processes a horizontal row of DCT blocks
- * as wide as an MCU; we rely on having allocated the MCU_buffer[] blocks
- * sequentially. Dummy blocks at the right or bottom edge are filled in
+ * Each call on forward_DCT processes a horizontal row of DCT blocks as
+ * wide as an MCU. Dummy blocks at the right or bottom edge are filled in
* specially. The data in them does not matter for image reconstruction,
* so we fill them with values that will encode to the smallest amount of
* data, viz: all zeroes in the AC entries, DC entries equal to previous
* block's DC value. (Thanks to Thomas Kinsman for this idea.)
*/
- blkn = 0;
+ blkp = coef->blk_buffer; /* pointer to current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
forward_DCT = cinfo->fdct->forward_DCT[compptr->component_index];
+ input_ptr = input_buf[compptr->component_index] +
+ yoffset * compptr->DCT_v_scaled_size;
+ /* ypos == (yoffset + yindex) * compptr->DCT_v_scaled_size */
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
: compptr->last_col_width;
xpos = MCU_col_num * compptr->MCU_sample_width;
- ypos = yoffset * compptr->DCT_v_scaled_size;
- /* ypos == (yoffset+yindex) * DCTSIZE */
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (coef->iMCU_row_num < last_iMCU_row ||
- yoffset+yindex < compptr->last_row_height) {
- (*forward_DCT) (cinfo, compptr,
- input_buf[compptr->component_index],
- coef->MCU_buffer[blkn],
- ypos, xpos, (JDIMENSION) blockcnt);
- if (blockcnt < compptr->MCU_width) {
- /* Create some dummy blocks at the right edge of the image. */
- FMEMZERO((void FAR *) coef->MCU_buffer[blkn + blockcnt],
- (compptr->MCU_width - blockcnt) * SIZEOF(JBLOCK));
- for (bi = blockcnt; bi < compptr->MCU_width; bi++) {
- coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn+bi-1][0][0];
- }
- }
+ yoffset + yindex < compptr->last_row_height) {
+ (*forward_DCT) (cinfo, compptr, input_ptr, blkp,
+ xpos, (JDIMENSION) blockcnt);
+ input_ptr += compptr->DCT_v_scaled_size;
+ blkp += blockcnt;
+ /* Dummy blocks at right edge */
+ if ((xindex = compptr->MCU_width - blockcnt) == 0)
+ continue;
} else {
- /* Create a row of dummy blocks at the bottom of the image. */
- FMEMZERO((void FAR *) coef->MCU_buffer[blkn],
- compptr->MCU_width * SIZEOF(JBLOCK));
- for (bi = 0; bi < compptr->MCU_width; bi++) {
- coef->MCU_buffer[blkn+bi][0][0] = coef->MCU_buffer[blkn-1][0][0];
- }
+ /* At bottom of image, need a whole row of dummy blocks */
+ xindex = compptr->MCU_width;
}
- blkn += compptr->MCU_width;
- ypos += compptr->DCT_v_scaled_size;
+ /* Fill in any dummy blocks needed in this row */
+ MEMZERO(blkp, xindex * SIZEOF(JBLOCK));
+ do {
+ blkp[0][0] = blkp[-1][0];
+ blkp++;
+ } while (--xindex);
}
}
/* Try to write the MCU. In event of a suspension failure, we will
@@ -208,12 +205,12 @@ compress_data (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
- coef->mcu_ctr = MCU_col_num;
+ coef->MCU_ctr = MCU_col_num;
return FALSE;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
- coef->mcu_ctr = 0;
+ coef->MCU_ctr = 0;
}
/* Completed the iMCU row, advance counters for next one */
coef->iMCU_row_num++;
@@ -256,6 +253,7 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
jpeg_component_info *compptr;
JBLOCKARRAY buffer;
JBLOCKROW thisblockrow, lastblockrow;
+ JSAMPARRAY input_ptr;
forward_DCT_ptr forward_DCT;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
@@ -280,14 +278,15 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
if (ndummy > 0)
ndummy = h_samp_factor - ndummy;
forward_DCT = cinfo->fdct->forward_DCT[ci];
+ input_ptr = input_buf[ci];
/* Perform DCT for all non-dummy blocks in this iMCU row. Each call
* on forward_DCT processes a complete horizontal row of DCT blocks.
*/
for (block_row = 0; block_row < block_rows; block_row++) {
thisblockrow = buffer[block_row];
- (*forward_DCT) (cinfo, compptr, input_buf[ci], thisblockrow,
- (JDIMENSION) (block_row * compptr->DCT_v_scaled_size),
+ (*forward_DCT) (cinfo, compptr, input_ptr, thisblockrow,
(JDIMENSION) 0, blocks_across);
+ input_ptr += compptr->DCT_v_scaled_size;
if (ndummy > 0) {
/* Create dummy blocks at the right edge of the image. */
thisblockrow += blocks_across; /* => first dummy block */
@@ -303,15 +302,14 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
* of the dummy blocks to match the last real block's DC value.
* This squeezes a few more bytes out of the resulting file...
*/
- if (coef->iMCU_row_num == last_iMCU_row) {
+ if (block_row < compptr->v_samp_factor) {
blocks_across += ndummy; /* include lower right corner */
MCUs_across = blocks_across / h_samp_factor;
- for (block_row = block_rows; block_row < compptr->v_samp_factor;
- block_row++) {
+ do {
thisblockrow = buffer[block_row];
lastblockrow = buffer[block_row-1];
FMEMZERO((void FAR *) thisblockrow,
- (size_t) (blocks_across * SIZEOF(JBLOCK)));
+ (size_t) blocks_across * SIZEOF(JBLOCK));
for (MCUindex = 0; MCUindex < MCUs_across; MCUindex++) {
lastDC = lastblockrow[h_samp_factor-1][0];
for (bi = 0; bi < h_samp_factor; bi++) {
@@ -320,7 +318,7 @@ compress_first_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
thisblockrow += h_samp_factor; /* advance to next MCU in row */
lastblockrow += h_samp_factor;
}
- }
+ } while (++block_row < compptr->v_samp_factor);
}
}
/* NB: compress_output will increment iMCU_row_num if successful.
@@ -347,8 +345,9 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
{
my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
JDIMENSION MCU_col_num; /* index of current MCU within row */
- int blkn, ci, xindex, yindex, yoffset;
+ int ci, xindex, yindex, yoffset;
JDIMENSION start_col;
+ JBLOCKARRAY blkp;
JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
JBLOCKROW buffer_ptr;
jpeg_component_info *compptr;
@@ -368,30 +367,31 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
/* Loop to process one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
- for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
+ for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
MCU_col_num++) {
/* Construct list of pointers to DCT blocks belonging to this MCU */
- blkn = 0; /* index of current DCT block within MCU */
+ blkp = coef->MCU_buffer; /* pointer to current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
- buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
- for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
- coef->MCU_buffer[blkn++] = buffer_ptr++;
- }
+ buffer_ptr = buffer[ci][yoffset + yindex] + start_col;
+ xindex = compptr->MCU_width;
+ do {
+ *blkp++ = buffer_ptr++;
+ } while (--xindex);
}
}
/* Try to write the MCU. */
if (! (*cinfo->entropy->encode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
- coef->mcu_ctr = MCU_col_num;
+ coef->MCU_ctr = MCU_col_num;
return FALSE;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
- coef->mcu_ctr = 0;
+ coef->MCU_ctr = 0;
}
/* Completed the iMCU row, advance counters for next one */
coef->iMCU_row_num++;
@@ -409,15 +409,8 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
GLOBAL(void)
jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
{
- my_coef_ptr coef;
+ my_coef_ptr coef = NULL;
- coef = (my_coef_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_coef_controller));
- cinfo->coef = (struct jpeg_c_coef_controller *) coef;
- coef->pub.start_pass = start_pass_coef;
-
- /* Create the coefficient buffer. */
if (need_full_buffer) {
#ifdef FULL_COEF_BUFFER_SUPPORTED
/* Allocate a full-image virtual array for each component, */
@@ -425,6 +418,9 @@ jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
int ci;
jpeg_component_info *compptr;
+ coef = (my_coef_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_coef_controller) - SIZEOF(coef->blk_buffer));
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
@@ -440,15 +436,21 @@ jinit_c_coef_controller (j_compress_ptr cinfo, boolean need_full_buffer)
#endif
} else {
/* We only need a single-MCU buffer. */
- JBLOCKROW buffer;
- int i;
-
- buffer = (JBLOCKROW)
- (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
- for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
- coef->MCU_buffer[i] = buffer + i;
- }
+ JBLOCKARRAY blkp;
+ JBLOCKROW buffer_ptr;
+ int bi;
+
+ coef = (my_coef_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_coef_controller));
+ blkp = coef->MCU_buffer;
+ buffer_ptr = coef->blk_buffer;
+ bi = C_MAX_BLOCKS_IN_MCU;
+ do {
+ *blkp++ = buffer_ptr++;
+ } while (--bi);
coef->whole_image[0] = NULL; /* flag for no virtual arrays */
}
+
+ coef->pub.start_pass = start_pass_coef;
+ cinfo->coef = &coef->pub;
}
diff --git a/jpeg/jcdctmgr.c b/jpeg/jcdctmgr.c
index fafab91c..a48ccd81 100644
--- a/jpeg/jcdctmgr.c
+++ b/jpeg/jcdctmgr.c
@@ -2,7 +2,7 @@
* jcdctmgr.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
- * Modified 2003-2013 by Guido Vollbeding.
+ * Modified 2003-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -66,15 +66,14 @@ typedef union {
* Perform forward DCT on one or more blocks of a component.
*
* The input samples are taken from the sample_data[] array starting at
- * position start_row/start_col, and moving to the right for any additional
- * blocks. The quantized coefficients are returned in coef_blocks[].
+ * position start_col, and moving to the right for any additional blocks.
+ * The quantized coefficients are returned in coef_blocks[].
*/
METHODDEF(void)
forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
- JDIMENSION start_row, JDIMENSION start_col,
- JDIMENSION num_blocks)
+ JDIMENSION start_col, JDIMENSION num_blocks)
/* This version is used for integer DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
@@ -84,8 +83,6 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */
JDIMENSION bi;
- sample_data += start_row; /* fold in the vertical offset once */
-
for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {
/* Perform the DCT */
(*do_dct) (workspace, sample_data, start_col);
@@ -136,8 +133,7 @@ forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr,
METHODDEF(void)
forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
- JDIMENSION start_row, JDIMENSION start_col,
- JDIMENSION num_blocks)
+ JDIMENSION start_col, JDIMENSION num_blocks)
/* This version is used for floating-point DCT implementations. */
{
/* This routine is heavily used, so it's worth coding it tightly. */
@@ -147,8 +143,6 @@ forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr,
FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */
JDIMENSION bi;
- sample_data += start_row; /* fold in the vertical offset once */
-
for (bi = 0; bi < num_blocks; bi++, start_col += compptr->DCT_h_scaled_size) {
/* Perform the DCT */
(*do_dct) (workspace, sample_data, start_col);
@@ -347,13 +341,11 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
- break;
}
break;
default:
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
compptr->DCT_h_scaled_size, compptr->DCT_v_scaled_size);
- break;
}
qtblno = compptr->quant_tbl_no;
/* Make sure specified quantization table is present */
@@ -444,7 +436,6 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
#endif
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
- break;
}
}
}
@@ -461,17 +452,15 @@ jinit_forward_dct (j_compress_ptr cinfo)
int ci;
jpeg_component_info *compptr;
- fdct = (my_fdct_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_fdct_controller));
+ fdct = (my_fdct_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_fdct_controller));
cinfo->fdct = &fdct->pub;
fdct->pub.start_pass = start_pass_fdctmgr;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
/* Allocate a divisor table for each component */
- compptr->dct_table =
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(divisor_table));
+ compptr->dct_table = (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(divisor_table));
}
}
diff --git a/jpeg/jchuff.c b/jpeg/jchuff.c
index 02fc275b..f3272c9f 100644
--- a/jpeg/jchuff.c
+++ b/jpeg/jchuff.c
@@ -2,7 +2,7 @@
* jchuff.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2006-2019 by Guido Vollbeding.
+ * Modified 2006-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -542,7 +542,7 @@ emit_restart_e (huff_entropy_ptr entropy, int restart_num)
*/
METHODDEF(boolean)
-encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
register int temp, temp2;
@@ -625,7 +625,7 @@ encode_mcu_DC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
const int * natural_order;
@@ -736,7 +736,7 @@ encode_mcu_AC_first (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int Al, blkn;
@@ -779,7 +779,7 @@ encode_mcu_DC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_AC_refine (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
const int * natural_order;
@@ -1009,7 +1009,7 @@ encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
*/
METHODDEF(boolean)
-encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_huff (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
working_state state;
@@ -1190,7 +1190,7 @@ htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
*/
METHODDEF(boolean)
-encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
+encode_mcu_gather (j_compress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int blkn, ci;
diff --git a/jpeg/jcmaster.c b/jpeg/jcmaster.c
index 89dcf78c..a70af0c0 100644
--- a/jpeg/jcmaster.c
+++ b/jpeg/jcmaster.c
@@ -2,7 +2,7 @@
* jcmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2003-2019 by Guido Vollbeding.
+ * Modified 2003-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -391,16 +391,16 @@ per_scan_setup (j_compress_ptr cinfo)
{
int ci, mcublks, tmp;
jpeg_component_info *compptr;
-
+
if (cinfo->comps_in_scan == 1) {
-
+
/* Noninterleaved (single-component) scan */
compptr = cinfo->cur_comp_info[0];
-
+
/* Overall image size in MCUs */
cinfo->MCUs_per_row = compptr->width_in_blocks;
cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
-
+
/* For noninterleaved scan, always one block per MCU */
compptr->MCU_width = 1;
compptr->MCU_height = 1;
@@ -413,28 +413,26 @@ per_scan_setup (j_compress_ptr cinfo)
tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
if (tmp == 0) tmp = compptr->v_samp_factor;
compptr->last_row_height = tmp;
-
+
/* Prepare array describing MCU composition */
cinfo->blocks_in_MCU = 1;
cinfo->MCU_membership[0] = 0;
-
+
} else {
-
+
/* Interleaved (multi-component) scan */
if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
MAX_COMPS_IN_SCAN);
-
+
/* Overall image size in MCUs */
cinfo->MCUs_per_row = (JDIMENSION)
jdiv_round_up((long) cinfo->jpeg_width,
(long) (cinfo->max_h_samp_factor * cinfo->block_size));
- cinfo->MCU_rows_in_scan = (JDIMENSION)
- jdiv_round_up((long) cinfo->jpeg_height,
- (long) (cinfo->max_v_samp_factor * cinfo->block_size));
-
+ cinfo->MCU_rows_in_scan = cinfo->total_iMCU_rows;
+
cinfo->blocks_in_MCU = 0;
-
+
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* Sampling factors give # of blocks of component in each MCU */
@@ -457,7 +455,7 @@ per_scan_setup (j_compress_ptr cinfo)
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
}
}
-
+
}
/* Convert restart specified in rows to actual MCU count. */
diff --git a/jpeg/jcparam.c b/jpeg/jcparam.c
index 3b7014ff..261ae86c 100644
--- a/jpeg/jcparam.c
+++ b/jpeg/jcparam.c
@@ -2,7 +2,7 @@
* jcparam.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
- * Modified 2003-2019 by Guido Vollbeding.
+ * Modified 2003-2022 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -62,8 +62,9 @@ jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
/* These are the sample quantization tables given in JPEG spec section K.1.
- * The spec says that the values given produce "good" quality, and
- * when divided by 2, "very good" quality.
+ * NOTE: chrominance DC value is changed from 17 to 16 for lossless support.
+ * The spec says that the values given produce "good" quality,
+ * and when divided by 2, "very good" quality.
*/
static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
16, 11, 10, 16, 24, 40, 51, 61,
@@ -76,7 +77,7 @@ static const unsigned int std_luminance_quant_tbl[DCTSIZE2] = {
72, 92, 95, 98, 112, 100, 103, 99
};
static const unsigned int std_chrominance_quant_tbl[DCTSIZE2] = {
- 17, 18, 24, 47, 99, 99, 99, 99,
+ 16, 18, 24, 47, 99, 99, 99, 99,
18, 21, 26, 66, 99, 99, 99, 99,
24, 26, 56, 99, 99, 99, 99, 99,
47, 66, 99, 99, 99, 99, 99, 99,
@@ -379,11 +380,13 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
case JCS_RGB:
cinfo->write_Adobe_marker = TRUE; /* write Adobe marker to flag RGB */
cinfo->num_components = 3;
- SET_COMP(0, 0x52 /* 'R' */, 1,1, 0,
+ SET_COMP(0, 0x52 /* 'R' */, 1,1,
+ cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
SET_COMP(1, 0x47 /* 'G' */, 1,1, 0, 0,0);
- SET_COMP(2, 0x42 /* 'B' */, 1,1, 0,
+ SET_COMP(2, 0x42 /* 'B' */, 1,1,
+ cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
break;
@@ -417,11 +420,13 @@ jpeg_set_colorspace (j_compress_ptr cinfo, J_COLOR_SPACE colorspace)
cinfo->JFIF_major_version = 2; /* Set JFIF major version = 2 */
cinfo->num_components = 3;
/* Add offset 0x20 to the normal R/G/B component IDs */
- SET_COMP(0, 0x72 /* 'r' */, 1,1, 0,
+ SET_COMP(0, 0x72 /* 'r' */, 1,1,
+ cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
SET_COMP(1, 0x67 /* 'g' */, 1,1, 0, 0,0);
- SET_COMP(2, 0x62 /* 'b' */, 1,1, 0,
+ SET_COMP(2, 0x62 /* 'b' */, 1,1,
+ cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0,
cinfo->color_transform == JCT_SUBTRACT_GREEN ? 1 : 0);
break;
diff --git a/jpeg/jcprepct.c b/jpeg/jcprepct.c
index be44cc4b..586964bd 100644
--- a/jpeg/jcprepct.c
+++ b/jpeg/jcprepct.c
@@ -2,6 +2,7 @@
* jcprepct.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
+ * Modified 2003-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -109,7 +110,8 @@ expand_bottom_edge (JSAMPARRAY image_data, JDIMENSION num_cols,
register int row;
for (row = input_rows; row < output_rows; row++) {
- jcopy_sample_rows(image_data, input_rows-1, image_data, row,
+ jcopy_sample_rows(image_data + input_rows - 1,
+ image_data + row,
1, num_cols);
}
}
@@ -220,8 +222,8 @@ pre_process_context (j_compress_ptr cinfo,
for (ci = 0; ci < cinfo->num_components; ci++) {
int row;
for (row = 1; row <= cinfo->max_v_samp_factor; row++) {
- jcopy_sample_rows(prep->color_buf[ci], 0,
- prep->color_buf[ci], -row,
+ jcopy_sample_rows(prep->color_buf[ci],
+ prep->color_buf[ci] - row,
1, cinfo->image_width);
}
}
@@ -277,10 +279,9 @@ create_context_buffer (j_compress_ptr cinfo)
/* Grab enough space for fake row pointers for all the components;
* we need five row groups' worth of pointers for each component.
*/
- fake_buffer = (JSAMPARRAY)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- (cinfo->num_components * 5 * rgroup_height) *
- SIZEOF(JSAMPROW));
+ fake_buffer = (JSAMPARRAY) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (cinfo->num_components * 5 * rgroup_height) * SIZEOF(JSAMPROW));
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
@@ -324,10 +325,9 @@ jinit_c_prep_controller (j_compress_ptr cinfo, boolean need_full_buffer)
if (need_full_buffer) /* safety check */
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- prep = (my_prep_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_prep_controller));
- cinfo->prep = (struct jpeg_c_prep_controller *) prep;
+ prep = (my_prep_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_prep_controller));
+ cinfo->prep = &prep->pub;
prep->pub.start_pass = start_pass_prep;
/* Allocate the color conversion buffer.
diff --git a/jpeg/jcsample.c b/jpeg/jcsample.c
index 4d36f85f..99392090 100644
--- a/jpeg/jcsample.c
+++ b/jpeg/jcsample.c
@@ -2,6 +2,7 @@
* jcsample.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
+ * Modified 2003-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -200,7 +201,7 @@ fullsize_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY input_data, JSAMPARRAY output_data)
{
/* Copy the data */
- jcopy_sample_rows(input_data, 0, output_data, 0,
+ jcopy_sample_rows(input_data, output_data,
cinfo->max_v_samp_factor, cinfo->image_width);
/* Edge-expand */
expand_right_edge(output_data, cinfo->max_v_samp_factor, cinfo->image_width,
@@ -480,13 +481,14 @@ jinit_downsampler (j_compress_ptr cinfo)
my_downsample_ptr downsample;
int ci;
jpeg_component_info * compptr;
+#ifdef INPUT_SMOOTHING_SUPPORTED
boolean smoothok = TRUE;
+#endif
int h_in_group, v_in_group, h_out_group, v_out_group;
- downsample = (my_downsample_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_downsampler));
- cinfo->downsample = (struct jpeg_downsampler *) downsample;
+ downsample = (my_downsample_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_downsampler));
+ cinfo->downsample = &downsample->pub;
downsample->pub.start_pass = start_pass_downsample;
downsample->pub.downsample = sep_downsample;
downsample->pub.need_context_rows = FALSE;
@@ -517,7 +519,9 @@ jinit_downsampler (j_compress_ptr cinfo)
downsample->methods[ci] = fullsize_downsample;
} else if (h_in_group == h_out_group * 2 &&
v_in_group == v_out_group) {
+#ifdef INPUT_SMOOTHING_SUPPORTED
smoothok = FALSE;
+#endif
downsample->methods[ci] = h2v1_downsample;
} else if (h_in_group == h_out_group * 2 &&
v_in_group == v_out_group * 2) {
@@ -530,7 +534,9 @@ jinit_downsampler (j_compress_ptr cinfo)
downsample->methods[ci] = h2v2_downsample;
} else if ((h_in_group % h_out_group) == 0 &&
(v_in_group % v_out_group) == 0) {
+#ifdef INPUT_SMOOTHING_SUPPORTED
smoothok = FALSE;
+#endif
downsample->methods[ci] = int_downsample;
downsample->h_expand[ci] = (UINT8) (h_in_group / h_out_group);
downsample->v_expand[ci] = (UINT8) (v_in_group / v_out_group);
diff --git a/jpeg/jctrans.c b/jpeg/jctrans.c
index 5780de42..261dd299 100644
--- a/jpeg/jctrans.c
+++ b/jpeg/jctrans.c
@@ -2,7 +2,7 @@
* jctrans.c
*
* Copyright (C) 1995-1998, Thomas G. Lane.
- * Modified 2000-2017 by Guido Vollbeding.
+ * Modified 2000-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -224,7 +224,7 @@ typedef struct {
struct jpeg_c_coef_controller pub; /* public fields */
JDIMENSION iMCU_row_num; /* iMCU row # within image */
- JDIMENSION mcu_ctr; /* counts MCUs processed in current row */
+ JDIMENSION MCU_ctr; /* counts MCUs processed in current row */
int MCU_vert_offset; /* counts MCU rows within iMCU row */
int MCU_rows_per_iMCU_row; /* number of such rows needed */
@@ -232,7 +232,7 @@ typedef struct {
jvirt_barray_ptr * whole_image;
/* Workspace for constructing dummy blocks at right/bottom edges. */
- JBLOCKROW dummy_buffer[C_MAX_BLOCKS_IN_MCU];
+ JBLOCK dummy_buffer[C_MAX_BLOCKS_IN_MCU];
} my_coef_controller;
typedef my_coef_controller * my_coef_ptr;
@@ -257,7 +257,7 @@ start_iMCU_row (j_compress_ptr cinfo)
coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
}
- coef->mcu_ctr = 0;
+ coef->MCU_ctr = 0;
coef->MCU_vert_offset = 0;
}
@@ -315,25 +315,30 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
/* Loop to process one whole iMCU row */
for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
yoffset++) {
- for (MCU_col_num = coef->mcu_ctr; MCU_col_num < cinfo->MCUs_per_row;
+ for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
MCU_col_num++) {
/* Construct list of pointers to DCT blocks belonging to this MCU */
blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
- start_col = MCU_col_num * compptr->MCU_width;
blockcnt = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
: compptr->last_col_width;
+ start_col = MCU_col_num * compptr->MCU_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (coef->iMCU_row_num < last_iMCU_row ||
- yindex+yoffset < compptr->last_row_height) {
+ yoffset + yindex < compptr->last_row_height) {
/* Fill in pointers to real blocks in this row */
- buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
- for (xindex = 0; xindex < blockcnt; xindex++)
+ buffer_ptr = buffer[ci][yoffset + yindex] + start_col;
+ xindex = blockcnt;
+ do {
MCU_buffer[blkn++] = buffer_ptr++;
+ } while (--xindex);
+ /* Dummy blocks at right edge */
+ if ((xindex = compptr->MCU_width - blockcnt) == 0)
+ continue;
} else {
/* At bottom of image, need a whole row of dummy blocks */
- xindex = 0;
+ xindex = compptr->MCU_width;
}
/* Fill in any dummy blocks needed in this row.
* Dummy blocks are filled in the same way as in jccoefct.c:
@@ -341,23 +346,23 @@ compress_output (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
* block's DC value. The init routine has already zeroed the
* AC entries, so we need only set the DC entries correctly.
*/
- for (; xindex < compptr->MCU_width; xindex++) {
- MCU_buffer[blkn] = coef->dummy_buffer[blkn];
- MCU_buffer[blkn][0][0] = MCU_buffer[blkn-1][0][0];
- blkn++;
- }
+ buffer_ptr = coef->dummy_buffer + blkn;
+ do {
+ buffer_ptr[0][0] = MCU_buffer[blkn-1][0][0];
+ MCU_buffer[blkn++] = buffer_ptr++;
+ } while (--xindex);
}
}
/* Try to write the MCU. */
if (! (*cinfo->entropy->encode_mcu) (cinfo, MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
- coef->mcu_ctr = MCU_col_num;
+ coef->MCU_ctr = MCU_col_num;
return FALSE;
}
}
/* Completed an MCU row, but perhaps not an iMCU row */
- coef->mcu_ctr = 0;
+ coef->MCU_ctr = 0;
}
/* Completed the iMCU row, advance counters for next one */
coef->iMCU_row_num++;
@@ -379,12 +384,9 @@ transencode_coef_controller (j_compress_ptr cinfo,
jvirt_barray_ptr * coef_arrays)
{
my_coef_ptr coef;
- JBLOCKROW buffer;
- int i;
- coef = (my_coef_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_coef_controller));
+ coef = (my_coef_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_coef_controller));
cinfo->coef = &coef->pub;
coef->pub.start_pass = start_pass_coef;
coef->pub.compress_data = compress_output;
@@ -392,12 +394,6 @@ transencode_coef_controller (j_compress_ptr cinfo,
/* Save pointer to virtual arrays */
coef->whole_image = coef_arrays;
- /* Allocate and pre-zero space for dummy DCT blocks. */
- buffer = (JBLOCKROW)
- (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
- FMEMZERO((void FAR *) buffer, C_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
- for (i = 0; i < C_MAX_BLOCKS_IN_MCU; i++) {
- coef->dummy_buffer[i] = buffer + i;
- }
+ /* Pre-zero space for dummy DCT blocks */
+ MEMZERO(coef->dummy_buffer, SIZEOF(coef->dummy_buffer));
}
diff --git a/jpeg/jdapimin.c b/jpeg/jdapimin.c
index a6e0dd9f..785e5272 100644
--- a/jpeg/jdapimin.c
+++ b/jpeg/jdapimin.c
@@ -2,7 +2,7 @@
* jdapimin.c
*
* Copyright (C) 1994-1998, Thomas G. Lane.
- * Modified 2009-2013 by Guido Vollbeding.
+ * Modified 2009-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -114,7 +114,7 @@ jpeg_abort_decompress (j_decompress_ptr cinfo)
LOCAL(void)
default_decompress_parms (j_decompress_ptr cinfo)
{
- int cid0, cid1, cid2;
+ int cid0, cid1, cid2, cid3;
/* Guess the input colorspace, and set output colorspace accordingly. */
/* Note application may override our guesses. */
@@ -123,13 +123,16 @@ default_decompress_parms (j_decompress_ptr cinfo)
cinfo->jpeg_color_space = JCS_GRAYSCALE;
cinfo->out_color_space = JCS_GRAYSCALE;
break;
-
+
case 3:
cid0 = cinfo->comp_info[0].component_id;
cid1 = cinfo->comp_info[1].component_id;
cid2 = cinfo->comp_info[2].component_id;
- /* First try to guess from the component IDs */
+ /* For robust detection of standard colorspaces
+ * regardless of the presence of special markers,
+ * check component IDs from SOF marker first.
+ */
if (cid0 == 0x01 && cid1 == 0x02 && cid2 == 0x03)
cinfo->jpeg_color_space = JCS_YCbCr;
else if (cid0 == 0x01 && cid1 == 0x22 && cid2 == 0x23)
@@ -151,7 +154,6 @@ default_decompress_parms (j_decompress_ptr cinfo)
default:
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
- break;
}
} else {
TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
@@ -160,9 +162,22 @@ default_decompress_parms (j_decompress_ptr cinfo)
/* Always guess RGB is proper output colorspace. */
cinfo->out_color_space = JCS_RGB;
break;
-
+
case 4:
- if (cinfo->saw_Adobe_marker) {
+ cid0 = cinfo->comp_info[0].component_id;
+ cid1 = cinfo->comp_info[1].component_id;
+ cid2 = cinfo->comp_info[2].component_id;
+ cid3 = cinfo->comp_info[3].component_id;
+
+ /* For robust detection of standard colorspaces
+ * regardless of the presence of special markers,
+ * check component IDs from SOF marker first.
+ */
+ if (cid0 == 0x01 && cid1 == 0x02 && cid2 == 0x03 && cid3 == 0x04)
+ cinfo->jpeg_color_space = JCS_YCCK;
+ else if (cid0 == 0x43 && cid1 == 0x4D && cid2 == 0x59 && cid3 == 0x4B)
+ cinfo->jpeg_color_space = JCS_CMYK; /* ASCII 'C', 'M', 'Y', 'K' */
+ else if (cinfo->saw_Adobe_marker) {
switch (cinfo->Adobe_transform) {
case 0:
cinfo->jpeg_color_space = JCS_CMYK;
@@ -173,19 +188,17 @@ default_decompress_parms (j_decompress_ptr cinfo)
default:
WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
- break;
}
} else {
- /* No special markers, assume straight CMYK. */
+ /* Unknown IDs and no special markers, assume straight CMYK. */
cinfo->jpeg_color_space = JCS_CMYK;
}
cinfo->out_color_space = JCS_CMYK;
break;
-
+
default:
cinfo->jpeg_color_space = JCS_UNKNOWN;
cinfo->out_color_space = JCS_UNKNOWN;
- break;
}
/* Set defaults for other decompression parameters. */
diff --git a/jpeg/jdarith.c b/jpeg/jdarith.c
index 67363eb5..740020ba 100644
--- a/jpeg/jdarith.c
+++ b/jpeg/jdarith.c
@@ -1,7 +1,7 @@
/*
* jdarith.c
*
- * Developed 1997-2019 by Guido Vollbeding.
+ * Developed 1997-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -239,7 +239,7 @@ process_restart (j_decompress_ptr cinfo)
*/
METHODDEF(boolean)
-decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
JBLOCKROW block;
@@ -318,7 +318,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
JBLOCKROW block;
@@ -400,7 +400,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
unsigned char *st;
@@ -434,7 +434,7 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
JBLOCKROW block;
@@ -509,7 +509,7 @@ decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
arith_entropy_ptr entropy = (arith_entropy_ptr) cinfo->entropy;
jpeg_component_info * compptr;
diff --git a/jpeg/jdcoefct.c b/jpeg/jdcoefct.c
index ed02fc37..79ba4201 100644
--- a/jpeg/jdcoefct.c
+++ b/jpeg/jdcoefct.c
@@ -2,7 +2,7 @@
* jdcoefct.c
*
* Copyright (C) 1994-1997, Thomas G. Lane.
- * Modified 2002-2011 by Guido Vollbeding.
+ * Modified 2002-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -19,11 +19,13 @@
#include "jinclude.h"
#include "jpeglib.h"
+
/* Block smoothing is only applicable for progressive JPEG, so: */
#ifndef D_PROGRESSIVE_SUPPORTED
#undef BLOCK_SMOOTHING_SUPPORTED
#endif
+
/* Private buffer controller object */
typedef struct {
@@ -38,11 +40,8 @@ typedef struct {
/* The output side's location is represented by cinfo->output_iMCU_row. */
/* In single-pass modes, it's sufficient to buffer just one MCU.
- * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
+ * We append a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks,
* and let the entropy decoder write into that workspace each time.
- * (On 80x86, the workspace is FAR even though it's not really very big;
- * this is to keep the module interfaces unchanged when a large coefficient
- * buffer is necessary.)
* In multi-pass modes, this array points to the current MCU's blocks
* within the virtual arrays; it is used only by the input side.
*/
@@ -58,10 +57,14 @@ typedef struct {
int * coef_bits_latch;
#define SAVED_COEFS 6 /* we save coef_bits[0..5] */
#endif
+
+ /* Workspace for single-pass modes (omitted otherwise). */
+ JBLOCK blk_buffer[D_MAX_BLOCKS_IN_MCU];
} my_coef_controller;
typedef my_coef_controller * my_coef_ptr;
+
/* Forward declarations */
METHODDEF(int) decompress_onepass
JPP((j_decompress_ptr cinfo, JSAMPIMAGE output_buf));
@@ -151,7 +154,8 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
JDIMENSION MCU_col_num; /* index of current MCU within row */
JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
- int blkn, ci, xindex, yindex, yoffset, useful_width;
+ int ci, xindex, yindex, yoffset, useful_width;
+ JBLOCKROW blkp;
JSAMPARRAY output_ptr;
JDIMENSION start_col, output_col;
jpeg_component_info *compptr;
@@ -162,10 +166,10 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
yoffset++) {
for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
MCU_col_num++) {
+ blkp = coef->blk_buffer; /* pointer to current DCT block within MCU */
/* Try to fetch an MCU. Entropy decoder expects buffer to be zeroed. */
if (cinfo->lim_Se) /* can bypass in DC only case */
- FMEMZERO((void FAR *) coef->MCU_buffer[0],
- (size_t) (cinfo->blocks_in_MCU * SIZEOF(JBLOCK)));
+ MEMZERO(blkp, cinfo->blocks_in_MCU * SIZEOF(JBLOCK));
if (! (*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
/* Suspension forced; update state counters and exit */
coef->MCU_vert_offset = yoffset;
@@ -173,37 +177,34 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
return JPEG_SUSPENDED;
}
/* Determine where data should go in output_buf and do the IDCT thing.
- * We skip dummy blocks at the right and bottom edges (but blkn gets
- * incremented past them!). Note the inner loop relies on having
- * allocated the MCU_buffer[] blocks sequentially.
+ * We skip dummy blocks at the right and bottom edges (but blkp gets
+ * incremented past them!).
*/
- blkn = 0; /* index of current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* Don't bother to IDCT an uninteresting component. */
if (! compptr->component_needed) {
- blkn += compptr->MCU_blocks;
+ blkp += compptr->MCU_blocks;
continue;
}
inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
- useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
- : compptr->last_col_width;
output_ptr = output_buf[compptr->component_index] +
yoffset * compptr->DCT_v_scaled_size;
+ useful_width = (MCU_col_num < last_MCU_col) ? compptr->MCU_width
+ : compptr->last_col_width;
start_col = MCU_col_num * compptr->MCU_sample_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
if (cinfo->input_iMCU_row < last_iMCU_row ||
- yoffset+yindex < compptr->last_row_height) {
+ yoffset + yindex < compptr->last_row_height) {
output_col = start_col;
for (xindex = 0; xindex < useful_width; xindex++) {
- (*inverse_DCT) (cinfo, compptr,
- (JCOEFPTR) coef->MCU_buffer[blkn+xindex],
+ (*inverse_DCT) (cinfo, compptr, (JCOEFPTR) (blkp + xindex),
output_ptr, output_col);
output_col += compptr->DCT_h_scaled_size;
}
+ output_ptr += compptr->DCT_v_scaled_size;
}
- blkn += compptr->MCU_width;
- output_ptr += compptr->DCT_v_scaled_size;
+ blkp += compptr->MCU_width;
}
}
}
@@ -212,7 +213,7 @@ decompress_onepass (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
}
/* Completed the iMCU row, advance counters for next one */
cinfo->output_iMCU_row++;
- if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
+ if (++(cinfo->input_iMCU_row) <= last_iMCU_row) {
start_iMCU_row(cinfo);
return JPEG_ROW_COMPLETED;
}
@@ -247,8 +248,9 @@ consume_data (j_decompress_ptr cinfo)
{
my_coef_ptr coef = (my_coef_ptr) cinfo->coef;
JDIMENSION MCU_col_num; /* index of current MCU within row */
- int blkn, ci, xindex, yindex, yoffset;
+ int ci, xindex, yindex, yoffset;
JDIMENSION start_col;
+ JBLOCKARRAY blkp;
JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
JBLOCKROW buffer_ptr;
jpeg_component_info *compptr;
@@ -272,15 +274,16 @@ consume_data (j_decompress_ptr cinfo)
for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
MCU_col_num++) {
/* Construct list of pointers to DCT blocks belonging to this MCU */
- blkn = 0; /* index of current DCT block within MCU */
+ blkp = coef->MCU_buffer; /* pointer to current DCT block within MCU */
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
start_col = MCU_col_num * compptr->MCU_width;
for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
- buffer_ptr = buffer[ci][yindex+yoffset] + start_col;
- for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
- coef->MCU_buffer[blkn++] = buffer_ptr++;
- }
+ buffer_ptr = buffer[ci][yoffset + yindex] + start_col;
+ xindex = compptr->MCU_width;
+ do {
+ *blkp++ = buffer_ptr++;
+ } while (--xindex);
}
}
/* Try to fetch the MCU. */
@@ -370,7 +373,7 @@ decompress_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
}
}
- if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
+ if (++(cinfo->output_iMCU_row) <= last_iMCU_row)
return JPEG_ROW_COMPLETED;
return JPEG_SCAN_COMPLETED;
}
@@ -419,10 +422,9 @@ smoothing_ok (j_decompress_ptr cinfo)
/* Allocate latch area if not already done */
if (coef->coef_bits_latch == NULL)
- coef->coef_bits_latch = (int *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- cinfo->num_components *
- (SAVED_COEFS * SIZEOF(int)));
+ coef->coef_bits_latch = (int *) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ cinfo->num_components * (SAVED_COEFS * SIZEOF(int)));
coef_bits_latch = coef->coef_bits_latch;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
@@ -662,7 +664,7 @@ decompress_smooth_data (j_decompress_ptr cinfo, JSAMPIMAGE output_buf)
}
}
- if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
+ if (++(cinfo->output_iMCU_row) <= last_iMCU_row)
return JPEG_ROW_COMPLETED;
return JPEG_SCAN_COMPLETED;
}
@@ -679,17 +681,6 @@ jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
{
my_coef_ptr coef;
- coef = (my_coef_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_coef_controller));
- cinfo->coef = (struct jpeg_d_coef_controller *) coef;
- coef->pub.start_input_pass = start_input_pass;
- coef->pub.start_output_pass = start_output_pass;
-#ifdef BLOCK_SMOOTHING_SUPPORTED
- coef->coef_bits_latch = NULL;
-#endif
-
- /* Create the coefficient buffer. */
if (need_full_buffer) {
#ifdef D_MULTISCAN_FILES_SUPPORTED
/* Allocate a full-image virtual array for each component, */
@@ -698,6 +689,9 @@ jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
int ci, access_rows;
jpeg_component_info *compptr;
+ coef = (my_coef_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ SIZEOF(my_coef_controller) - SIZEOF(coef->blk_buffer));
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
access_rows = compptr->v_samp_factor;
@@ -722,20 +716,29 @@ jinit_d_coef_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
#endif
} else {
/* We only need a single-MCU buffer. */
- JBLOCKROW buffer;
- int i;
-
- buffer = (JBLOCKROW)
- (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK));
- for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
- coef->MCU_buffer[i] = buffer + i;
- }
+ JBLOCKARRAY blkp;
+ JBLOCKROW buffer_ptr;
+ int bi;
+
+ coef = (my_coef_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_coef_controller));
+ buffer_ptr = coef->blk_buffer;
if (cinfo->lim_Se == 0) /* DC only case: want to bypass later */
- FMEMZERO((void FAR *) buffer,
- (size_t) (D_MAX_BLOCKS_IN_MCU * SIZEOF(JBLOCK)));
+ MEMZERO(buffer_ptr, SIZEOF(coef->blk_buffer));
+ blkp = coef->MCU_buffer;
+ bi = D_MAX_BLOCKS_IN_MCU;
+ do {
+ *blkp++ = buffer_ptr++;
+ } while (--bi);
coef->pub.consume_data = dummy_consume_data;
coef->pub.decompress_data = decompress_onepass;
coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
}
+
+ coef->pub.start_input_pass = start_input_pass;
+ coef->pub.start_output_pass = start_output_pass;
+#ifdef BLOCK_SMOOTHING_SUPPORTED
+ coef->coef_bits_latch = NULL;
+#endif
+ cinfo->coef = &coef->pub;
}
diff --git a/jpeg/jdcolor.c b/jpeg/jdcolor.c
index 3746c2e9..7750df12 100644
--- a/jpeg/jdcolor.c
+++ b/jpeg/jdcolor.c
@@ -2,7 +2,7 @@
* jdcolor.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2011-2019 by Guido Vollbeding.
+ * Modified 2011-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -420,7 +420,7 @@ rgb_convert (j_decompress_ptr cinfo,
/*
* Color conversion for no colorspace change: just copy the data,
* converting from separate-planes to interleaved representation.
- * We assume out_color_components == num_components.
+ * Note: Omit uninteresting components in output buffer.
*/
METHODDEF(void)
@@ -431,22 +431,27 @@ null_convert (j_decompress_ptr cinfo,
register JSAMPROW outptr;
register JSAMPROW inptr;
register JDIMENSION count;
- register int num_comps = cinfo->num_components;
+ register int out_comps = cinfo->out_color_components;
JDIMENSION num_cols = cinfo->output_width;
+ JSAMPROW startptr;
int ci;
+ jpeg_component_info *compptr;
while (--num_rows >= 0) {
/* It seems fastest to make a separate pass for each component. */
- for (ci = 0; ci < num_comps; ci++) {
+ startptr = *output_buf++;
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++) {
+ if (! compptr->component_needed)
+ continue; /* skip uninteresting component */
inptr = input_buf[ci][input_row];
- outptr = output_buf[0] + ci;
+ outptr = startptr++;
for (count = num_cols; count > 0; count--) {
*outptr = *inptr++; /* don't need GETJSAMPLE() here */
- outptr += num_comps;
+ outptr += out_comps;
}
}
input_row++;
- output_buf++;
}
}
@@ -462,7 +467,7 @@ grayscale_convert (j_decompress_ptr cinfo,
JSAMPIMAGE input_buf, JDIMENSION input_row,
JSAMPARRAY output_buf, int num_rows)
{
- jcopy_sample_rows(input_buf[0], (int) input_row, output_buf, 0,
+ jcopy_sample_rows(input_buf[0] + input_row, output_buf,
num_rows, cinfo->output_width);
}
@@ -550,6 +555,47 @@ ycck_cmyk_convert (j_decompress_ptr cinfo,
/*
+ * Convert CMYK to YK part of YCCK for colorless output.
+ * We assume build_rgb_y_table has been called.
+ */
+
+METHODDEF(void)
+cmyk_yk_convert (j_decompress_ptr cinfo,
+ JSAMPIMAGE input_buf, JDIMENSION input_row,
+ JSAMPARRAY output_buf, int num_rows)
+{
+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
+ register int r, g, b;
+ register INT32 * ctab = cconvert->rgb_y_tab;
+ register JSAMPROW outptr;
+ register JSAMPROW inptr0, inptr1, inptr2, inptr3;
+ register JDIMENSION col;
+ JDIMENSION num_cols = cinfo->output_width;
+
+ while (--num_rows >= 0) {
+ inptr0 = input_buf[0][input_row];
+ inptr1 = input_buf[1][input_row];
+ inptr2 = input_buf[2][input_row];
+ inptr3 = input_buf[3][input_row];
+ input_row++;
+ outptr = *output_buf++;
+ for (col = 0; col < num_cols; col++) {
+ r = MAXJSAMPLE - GETJSAMPLE(inptr0[col]);
+ g = MAXJSAMPLE - GETJSAMPLE(inptr1[col]);
+ b = MAXJSAMPLE - GETJSAMPLE(inptr2[col]);
+ /* Y */
+ outptr[0] = (JSAMPLE)
+ ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF])
+ >> SCALEBITS);
+ /* K passes through unchanged */
+ outptr[1] = inptr3[col]; /* don't need GETJSAMPLE here */
+ outptr += 2;
+ }
+ }
+}
+
+
+/*
* Empty method for start_pass.
*/
@@ -568,7 +614,7 @@ GLOBAL(void)
jinit_color_deconverter (j_decompress_ptr cinfo)
{
my_cconvert_ptr cconvert;
- int ci;
+ int ci, i;
cconvert = (my_cconvert_ptr) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_color_deconverter));
@@ -608,7 +654,7 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
/* Set out_color_components and conversion method based on requested space.
- * Also clear the component_needed flags for any unused components,
+ * Also adjust the component_needed flags for any unused components,
* so that earlier pipeline stages can avoid useless computation.
*/
@@ -674,9 +720,9 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
break;
case JCS_BG_RGB:
- cinfo->out_color_components = RGB_PIXELSIZE;
if (cinfo->jpeg_color_space != JCS_BG_RGB)
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
+ cinfo->out_color_components = RGB_PIXELSIZE;
switch (cinfo->color_transform) {
case JCT_NONE:
cconvert->pub.color_convert = rgb_convert;
@@ -690,25 +736,38 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
break;
case JCS_CMYK:
+ if (cinfo->jpeg_color_space != JCS_YCCK)
+ goto def_label;
cinfo->out_color_components = 4;
- switch (cinfo->jpeg_color_space) {
- case JCS_YCCK:
- cconvert->pub.color_convert = ycck_cmyk_convert;
- build_ycc_rgb_table(cinfo);
- break;
- case JCS_CMYK:
- cconvert->pub.color_convert = null_convert;
- break;
- default:
- ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- }
+ cconvert->pub.color_convert = ycck_cmyk_convert;
+ build_ycc_rgb_table(cinfo);
+ break;
+
+ case JCS_YCCK:
+ if (cinfo->jpeg_color_space != JCS_CMYK ||
+ /* Support only YK part of YCCK for colorless output */
+ ! cinfo->comp_info[0].component_needed ||
+ cinfo->comp_info[1].component_needed ||
+ cinfo->comp_info[2].component_needed ||
+ ! cinfo->comp_info[3].component_needed)
+ goto def_label;
+ cinfo->out_color_components = 2;
+ /* Need all components on input side */
+ cinfo->comp_info[1].component_needed = TRUE;
+ cinfo->comp_info[2].component_needed = TRUE;
+ cconvert->pub.color_convert = cmyk_yk_convert;
+ build_rgb_y_table(cinfo);
break;
- default: /* permit null conversion to same output space */
+ default: def_label: /* permit null conversion to same output space */
if (cinfo->out_color_space != cinfo->jpeg_color_space)
/* unsupported non-null conversion */
ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
- cinfo->out_color_components = cinfo->num_components;
+ i = 0;
+ for (ci = 0; ci < cinfo->num_components; ci++)
+ if (cinfo->comp_info[ci].component_needed)
+ i++; /* count output color components */
+ cinfo->out_color_components = i;
cconvert->pub.color_convert = null_convert;
}
diff --git a/jpeg/jdhuff.c b/jpeg/jdhuff.c
index aea06f60..f175f0c3 100644
--- a/jpeg/jdhuff.c
+++ b/jpeg/jdhuff.c
@@ -2,7 +2,7 @@
* jdhuff.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2006-2019 by Guido Vollbeding.
+ * Modified 2006-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -704,7 +704,7 @@ process_restart (j_decompress_ptr cinfo)
*/
METHODDEF(boolean)
-decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int Al = cinfo->Al;
@@ -776,7 +776,7 @@ decode_mcu_DC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
register int s, k, r;
@@ -864,7 +864,7 @@ decode_mcu_AC_first (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
JCOEF p1;
@@ -913,7 +913,7 @@ decode_mcu_DC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu_AC_refine (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
register int s, k, r;
@@ -1072,7 +1072,7 @@ undoit:
*/
METHODDEF(boolean)
-decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
const int * natural_order;
@@ -1201,7 +1201,7 @@ decode_mcu_sub (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
*/
METHODDEF(boolean)
-decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data)
+decode_mcu (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data)
{
huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
int blkn;
diff --git a/jpeg/jdinput.c b/jpeg/jdinput.c
index 0199553e..29fbef90 100644
--- a/jpeg/jdinput.c
+++ b/jpeg/jdinput.c
@@ -2,7 +2,7 @@
* jdinput.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2002-2013 by Guido Vollbeding.
+ * Modified 2002-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -330,7 +330,6 @@ initial_setup (j_decompress_ptr cinfo)
default:
ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
- break;
}
/* We initialize DCT_scaled_size and min_DCT_scaled_size to block_size.
@@ -391,16 +390,16 @@ per_scan_setup (j_decompress_ptr cinfo)
{
int ci, mcublks, tmp;
jpeg_component_info *compptr;
-
+
if (cinfo->comps_in_scan == 1) {
-
+
/* Noninterleaved (single-component) scan */
compptr = cinfo->cur_comp_info[0];
-
+
/* Overall image size in MCUs */
cinfo->MCUs_per_row = compptr->width_in_blocks;
cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
-
+
/* For noninterleaved scan, always one block per MCU */
compptr->MCU_width = 1;
compptr->MCU_height = 1;
@@ -413,28 +412,26 @@ per_scan_setup (j_decompress_ptr cinfo)
tmp = (int) (compptr->height_in_blocks % compptr->v_samp_factor);
if (tmp == 0) tmp = compptr->v_samp_factor;
compptr->last_row_height = tmp;
-
+
/* Prepare array describing MCU composition */
cinfo->blocks_in_MCU = 1;
cinfo->MCU_membership[0] = 0;
-
+
} else {
-
+
/* Interleaved (multi-component) scan */
if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
MAX_COMPS_IN_SCAN);
-
+
/* Overall image size in MCUs */
cinfo->MCUs_per_row = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width,
(long) (cinfo->max_h_samp_factor * cinfo->block_size));
- cinfo->MCU_rows_in_scan = (JDIMENSION)
- jdiv_round_up((long) cinfo->image_height,
- (long) (cinfo->max_v_samp_factor * cinfo->block_size));
-
+ cinfo->MCU_rows_in_scan = cinfo->total_iMCU_rows;
+
cinfo->blocks_in_MCU = 0;
-
+
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
compptr = cinfo->cur_comp_info[ci];
/* Sampling factors give # of blocks of component in each MCU */
@@ -457,7 +454,7 @@ per_scan_setup (j_decompress_ptr cinfo)
cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
}
}
-
+
}
}
@@ -501,9 +498,8 @@ latch_quant_tables (j_decompress_ptr cinfo)
cinfo->quant_tbl_ptrs[qtblno] == NULL)
ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
/* OK, save away the quantization table */
- qtbl = (JQUANT_TBL *)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(JQUANT_TBL));
+ qtbl = (JQUANT_TBL *) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(JQUANT_TBL));
MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], SIZEOF(JQUANT_TBL));
compptr->quant_table = qtbl;
}
@@ -644,9 +640,8 @@ jinit_input_controller (j_decompress_ptr cinfo)
my_inputctl_ptr inputctl;
/* Create subobject in permanent pool */
- inputctl = (my_inputctl_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT,
- SIZEOF(my_input_controller));
+ inputctl = (my_inputctl_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_PERMANENT, SIZEOF(my_input_controller));
cinfo->inputctl = &inputctl->pub;
/* Initialize method pointers */
inputctl->pub.consume_input = consume_markers;
diff --git a/jpeg/jdmainct.c b/jpeg/jdmainct.c
index 4d738fba..1cd66d85 100644
--- a/jpeg/jdmainct.c
+++ b/jpeg/jdmainct.c
@@ -2,7 +2,7 @@
* jdmainct.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
- * Modified 2002-2016 by Guido Vollbeding.
+ * Modified 2002-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -170,21 +170,22 @@ alloc_funny_pointers (j_decompress_ptr cinfo)
/* Get top-level space for component array pointers.
* We alloc both arrays with one call to save a few cycles.
*/
- mainp->xbuffer[0] = (JSAMPIMAGE)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
+ mainp->xbuffer[0] = (JSAMPIMAGE) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ cinfo->num_components * 2 * SIZEOF(JSAMPARRAY));
mainp->xbuffer[1] = mainp->xbuffer[0] + cinfo->num_components;
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
+ if (! compptr->component_needed)
+ continue; /* skip uninteresting component */
rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
/* Get space for pointer lists --- M+4 row groups in each list.
* We alloc both pointer lists with one call to save a few cycles.
*/
- xbuf = (JSAMPARRAY)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
+ xbuf = (JSAMPARRAY) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
+ JPOOL_IMAGE, 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW));
xbuf += rgroup; /* want one row group at negative offsets */
mainp->xbuffer[0][ci] = xbuf;
xbuf += rgroup * (M + 4);
@@ -210,6 +211,8 @@ make_funny_pointers (j_decompress_ptr cinfo)
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
+ if (! compptr->component_needed)
+ continue; /* skip uninteresting component */
rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
xbuf0 = mainp->xbuffer[0][ci];
@@ -250,6 +253,8 @@ set_wraparound_pointers (j_decompress_ptr cinfo)
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
+ if (! compptr->component_needed)
+ continue; /* skip uninteresting component */
rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
xbuf0 = mainp->xbuffer[0][ci];
@@ -278,6 +283,8 @@ set_bottom_pointers (j_decompress_ptr cinfo)
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
+ if (! compptr->component_needed)
+ continue; /* skip uninteresting component */
/* Count sample rows in one iMCU row and in one row group */
iMCUheight = compptr->v_samp_factor * compptr->DCT_v_scaled_size;
rgroup = iMCUheight / cinfo->min_DCT_v_scaled_size;
@@ -333,7 +340,6 @@ start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
#endif
default:
ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
- break;
}
}
@@ -344,9 +350,8 @@ start_pass_main (j_decompress_ptr cinfo, J_BUF_MODE pass_mode)
*/
METHODDEF(void)
-process_data_simple_main (j_decompress_ptr cinfo,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
+process_data_simple_main (j_decompress_ptr cinfo, JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
{
my_main_ptr mainp = (my_main_ptr) cinfo->main;
@@ -375,9 +380,8 @@ process_data_simple_main (j_decompress_ptr cinfo,
*/
METHODDEF(void)
-process_data_context_main (j_decompress_ptr cinfo,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
+process_data_context_main (j_decompress_ptr cinfo, JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
{
my_main_ptr mainp = (my_main_ptr) cinfo->main;
@@ -449,13 +453,12 @@ process_data_context_main (j_decompress_ptr cinfo,
#ifdef QUANT_2PASS_SUPPORTED
METHODDEF(void)
-process_data_crank_post (j_decompress_ptr cinfo,
- JSAMPARRAY output_buf, JDIMENSION *out_row_ctr,
- JDIMENSION out_rows_avail)
+process_data_crank_post (j_decompress_ptr cinfo, JSAMPARRAY output_buf,
+ JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
{
(*cinfo->post->post_process_data) (cinfo, (JSAMPIMAGE) NULL,
- (JDIMENSION *) NULL, (JDIMENSION) 0,
- output_buf, out_row_ctr, out_rows_avail);
+ (JDIMENSION *) NULL, (JDIMENSION) 0,
+ output_buf, out_row_ctr, out_rows_avail);
}
#endif /* QUANT_2PASS_SUPPORTED */
@@ -472,9 +475,8 @@ jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
int ci, rgroup, ngroups;
jpeg_component_info *compptr;
- mainp = (my_main_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_main_controller));
+ mainp = (my_main_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_main_controller));
cinfo->main = &mainp->pub;
mainp->pub.start_pass = start_pass_main;
@@ -497,6 +499,8 @@ jinit_d_main_controller (j_decompress_ptr cinfo, boolean need_full_buffer)
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
+ if (! compptr->component_needed)
+ continue; /* skip uninteresting component */
rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) /
cinfo->min_DCT_v_scaled_size; /* height of a row group of component */
mainp->buffer[ci] = (*cinfo->mem->alloc_sarray)
diff --git a/jpeg/jdmaster.c b/jpeg/jdmaster.c
index c309f762..3070b7bb 100644
--- a/jpeg/jdmaster.c
+++ b/jpeg/jdmaster.c
@@ -2,7 +2,7 @@
* jdmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2002-2019 by Guido Vollbeding.
+ * Modified 2002-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -103,10 +103,8 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
* This function is used for full decompression.
*/
{
-#ifdef IDCT_SCALING_SUPPORTED
- int ci, ssize;
+ int ci, i;
jpeg_component_info *compptr;
-#endif
/* Prevent application from calling me at wrong times */
if (cinfo->global_state != DSTATE_READY)
@@ -124,7 +122,7 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
*/
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
- ssize = 1;
+ int ssize = 1;
if (! cinfo->raw_data_out)
while (cinfo->min_DCT_h_scaled_size * ssize <=
(cinfo->do_fancy_upsampling ? DCTSIZE : DCTSIZE / 2) &&
@@ -166,27 +164,22 @@ jpeg_calc_output_dimensions (j_decompress_ptr cinfo)
#endif /* IDCT_SCALING_SUPPORTED */
/* Report number of components in selected colorspace. */
- /* Probably this should be in the color conversion module... */
+ /* This should correspond to the actual code in the color conversion module. */
switch (cinfo->out_color_space) {
case JCS_GRAYSCALE:
cinfo->out_color_components = 1;
break;
case JCS_RGB:
case JCS_BG_RGB:
-#if RGB_PIXELSIZE != 3
cinfo->out_color_components = RGB_PIXELSIZE;
break;
-#endif /* else share code with YCbCr */
- case JCS_YCbCr:
- case JCS_BG_YCC:
- cinfo->out_color_components = 3;
- break;
- case JCS_CMYK:
- case JCS_YCCK:
- cinfo->out_color_components = 4;
- break;
- default: /* else must be same colorspace as in file */
- cinfo->out_color_components = cinfo->num_components;
+ default: /* YCCK <=> CMYK conversion or same colorspace as in file */
+ i = 0;
+ for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
+ ci++, compptr++)
+ if (compptr->component_needed)
+ i++; /* count output color components */
+ cinfo->out_color_components = i;
}
cinfo->output_components = (cinfo->quantize_colors ? 1 :
cinfo->out_color_components);
diff --git a/jpeg/jdmerge.c b/jpeg/jdmerge.c
index 8b5c899c..8ff13143 100644
--- a/jpeg/jdmerge.c
+++ b/jpeg/jdmerge.c
@@ -2,7 +2,7 @@
* jdmerge.c
*
* Copyright (C) 1994-1996, Thomas G. Lane.
- * Modified 2013-2019 by Guido Vollbeding.
+ * Modified 2013-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -190,7 +190,7 @@ merged_2v_upsample (j_decompress_ptr cinfo,
if (upsample->spare_full) {
/* If we have a spare row saved from a previous cycle, just return it. */
- jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0,
+ jcopy_sample_rows(& upsample->spare_row, output_buf + *out_row_ctr,
1, upsample->out_row_width);
num_rows = 1;
upsample->spare_full = FALSE;
diff --git a/jpeg/jdsample.c b/jpeg/jdsample.c
index fd9907e2..15afeafe 100644
--- a/jpeg/jdsample.c
+++ b/jpeg/jdsample.c
@@ -2,7 +2,7 @@
* jdsample.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
- * Modified 2002-2015 by Guido Vollbeding.
+ * Modified 2002-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -27,7 +27,7 @@
/* Pointer to routine to upsample a single component */
typedef JMETHOD(void, upsample1_ptr,
(j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr));
+ JSAMPARRAY input_data, JSAMPIMAGE output_data_ptr));
/* Private subobject */
@@ -102,6 +102,9 @@ sep_upsample (j_decompress_ptr cinfo,
if (upsample->next_row_out >= cinfo->max_v_samp_factor) {
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
+ /* Don't bother to upsample an uninteresting component. */
+ if (! compptr->component_needed)
+ continue;
/* Invoke per-component upsample method. Notice we pass a POINTER
* to color_buf[ci], so that fullsize_upsample can change it.
*/
@@ -156,26 +159,13 @@ sep_upsample (j_decompress_ptr cinfo,
METHODDEF(void)
fullsize_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+ JSAMPARRAY input_data, JSAMPIMAGE output_data_ptr)
{
*output_data_ptr = input_data;
}
/*
- * This is a no-op version used for "uninteresting" components.
- * These components will not be referenced by color conversion.
- */
-
-METHODDEF(void)
-noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
-{
- *output_data_ptr = NULL; /* safety check */
-}
-
-
-/*
* This version handles any integral sampling ratios.
* This is not used for typical JPEG files, so it need not be fast.
* Nor, for that matter, is it particularly accurate: the algorithm is
@@ -188,25 +178,25 @@ noop_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
METHODDEF(void)
int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+ JSAMPARRAY input_data, JSAMPIMAGE output_data_ptr)
{
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
- JSAMPARRAY output_data = *output_data_ptr;
+ JSAMPARRAY output_data, output_end;
register JSAMPROW inptr, outptr;
register JSAMPLE invalue;
register int h;
JSAMPROW outend;
int h_expand, v_expand;
- int inrow, outrow;
h_expand = upsample->h_expand[compptr->component_index];
v_expand = upsample->v_expand[compptr->component_index];
- inrow = outrow = 0;
- while (outrow < cinfo->max_v_samp_factor) {
+ output_data = *output_data_ptr;
+ output_end = output_data + cinfo->max_v_samp_factor;
+ for (; output_data < output_end; output_data += v_expand) {
/* Generate one output row with proper horizontal expansion */
- inptr = input_data[inrow];
- outptr = output_data[outrow];
+ inptr = *input_data++;
+ outptr = *output_data;
outend = outptr + cinfo->output_width;
while (outptr < outend) {
invalue = *inptr++; /* don't need GETJSAMPLE() here */
@@ -216,11 +206,9 @@ int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
}
/* Generate any additional output rows by duplicating the first one */
if (v_expand > 1) {
- jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
- v_expand-1, cinfo->output_width);
+ jcopy_sample_rows(output_data, output_data + 1,
+ v_expand - 1, cinfo->output_width);
}
- inrow++;
- outrow += v_expand;
}
}
@@ -232,7 +220,7 @@ int_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
METHODDEF(void)
h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+ JSAMPARRAY input_data, JSAMPIMAGE output_data_ptr)
{
JSAMPARRAY output_data = *output_data_ptr;
register JSAMPROW inptr, outptr;
@@ -260,28 +248,26 @@ h2v1_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
METHODDEF(void)
h2v2_upsample (j_decompress_ptr cinfo, jpeg_component_info * compptr,
- JSAMPARRAY input_data, JSAMPARRAY * output_data_ptr)
+ JSAMPARRAY input_data, JSAMPIMAGE output_data_ptr)
{
- JSAMPARRAY output_data = *output_data_ptr;
+ JSAMPARRAY output_data, output_end;
register JSAMPROW inptr, outptr;
register JSAMPLE invalue;
JSAMPROW outend;
- int inrow, outrow;
- inrow = outrow = 0;
- while (outrow < cinfo->max_v_samp_factor) {
- inptr = input_data[inrow];
- outptr = output_data[outrow];
+ output_data = *output_data_ptr;
+ output_end = output_data + cinfo->max_v_samp_factor;
+ for (; output_data < output_end; output_data += 2) {
+ inptr = *input_data++;
+ outptr = *output_data;
outend = outptr + cinfo->output_width;
while (outptr < outend) {
invalue = *inptr++; /* don't need GETJSAMPLE() here */
*outptr++ = invalue;
*outptr++ = invalue;
}
- jcopy_sample_rows(output_data, outrow, output_data, outrow+1,
+ jcopy_sample_rows(output_data, output_data + 1,
1, cinfo->output_width);
- inrow++;
- outrow += 2;
}
}
@@ -298,9 +284,8 @@ jinit_upsampler (j_decompress_ptr cinfo)
jpeg_component_info * compptr;
int h_in_group, v_in_group, h_out_group, v_out_group;
- upsample = (my_upsample_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_upsampler));
+ upsample = (my_upsample_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_upsampler));
cinfo->upsample = &upsample->pub;
upsample->pub.start_pass = start_pass_upsample;
upsample->pub.upsample = sep_upsample;
@@ -314,6 +299,9 @@ jinit_upsampler (j_decompress_ptr cinfo)
*/
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
ci++, compptr++) {
+ /* Don't bother to upsample an uninteresting component. */
+ if (! compptr->component_needed)
+ continue;
/* Compute size of an "input group" after IDCT scaling. This many samples
* are to be converted to max_h_samp_factor * max_v_samp_factor pixels.
*/
@@ -324,11 +312,6 @@ jinit_upsampler (j_decompress_ptr cinfo)
h_out_group = cinfo->max_h_samp_factor;
v_out_group = cinfo->max_v_samp_factor;
upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
- if (! compptr->component_needed) {
- /* Don't bother to upsample an uninteresting component. */
- upsample->methods[ci] = noop_upsample;
- continue; /* don't need to allocate buffer */
- }
if (h_in_group == h_out_group && v_in_group == v_out_group) {
/* Fullsize components can be processed without any work. */
upsample->methods[ci] = fullsize_upsample;
diff --git a/jpeg/jidctint.c b/jpeg/jidctint.c
index 8881a8f2..d7c3589e 100644
--- a/jpeg/jidctint.c
+++ b/jpeg/jidctint.c
@@ -1109,22 +1109,18 @@ jpeg_idct_1x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
- DCTELEM dcval;
+ int dcval;
ISLOW_MULT_TYPE * quantptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- ISHIFT_TEMPS
+ SHIFT_TEMPS
/* 1x1 is trivial: just take the DC coefficient divided by 8. */
-
quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
-
dcval = DEQUANTIZE(coef_block[0], quantptr[0]);
CLAMP_DC(dcval);
- /* Add range center and fudge factor for descale and range-limit. */
- dcval += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
+ dcval = (int) DESCALE((INT32) dcval, 3);
- output_buf[0][output_col] =
- range_limit[(int) IRIGHT_SHIFT(dcval, 3) & RANGE_MASK];
+ output_buf[0][output_col] = range_limit[dcval & RANGE_MASK];
}
@@ -4109,11 +4105,11 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
- DCTELEM tmp0, tmp1;
+ INT32 tmp0, tmp1;
ISLOW_MULT_TYPE * quantptr;
JSAMPROW outptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- ISHIFT_TEMPS
+ SHIFT_TEMPS
/* Pass 1: empty. */
@@ -4126,8 +4122,8 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
tmp0 = DEQUANTIZE(coef_block[0], quantptr[0]);
CLAMP_DC(tmp0);
- /* Add range center and fudge factor for final descale and range-limit. */
- tmp0 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
+ /* Add fudge factor here for final descale. */
+ tmp0 += ONE << 2;
/* Odd part */
@@ -4135,8 +4131,8 @@ jpeg_idct_2x1 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
/* Final output stage */
- outptr[0] = range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
- outptr[1] = range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
+ outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
+ outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
}
@@ -4956,8 +4952,6 @@ jpeg_idct_4x8 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
*/
z2 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);
- if (ctr == 4)
- CLAMP_DC(z2);
z3 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);
z2 <<= CONST_BITS;
z3 <<= CONST_BITS;
@@ -5286,32 +5280,34 @@ jpeg_idct_1x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
JCOEFPTR coef_block,
JSAMPARRAY output_buf, JDIMENSION output_col)
{
- DCTELEM tmp0, tmp1;
+ INT32 tmp0, tmp1;
ISLOW_MULT_TYPE * quantptr;
+ JSAMPROW outptr;
JSAMPLE *range_limit = IDCT_range_limit(cinfo);
- ISHIFT_TEMPS
+ SHIFT_TEMPS
+
+ /* Pass 1: empty. */
- /* Process 1 column from input, store into output array. */
+ /* Pass 2: process 1 row from input, store into output array. */
quantptr = (ISLOW_MULT_TYPE *) compptr->dct_table;
+ outptr = output_buf[0] + output_col;
/* Even part */
- tmp0 = DEQUANTIZE(coef_block[DCTSIZE*0], quantptr[DCTSIZE*0]);
+ tmp0 = DEQUANTIZE(coef_block[0], quantptr[0]);
CLAMP_DC(tmp0);
- /* Add range center and fudge factor for final descale and range-limit. */
- tmp0 += (((DCTELEM) RANGE_CENTER) << 3) + (1 << 2);
+ /* Add fudge factor here for final descale. */
+ tmp0 += ONE << 2;
/* Odd part */
- tmp1 = DEQUANTIZE(coef_block[DCTSIZE*1], quantptr[DCTSIZE*1]);
+ tmp1 = DEQUANTIZE(coef_block[1], quantptr[1]);
/* Final output stage */
- output_buf[0][output_col] =
- range_limit[(int) IRIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
- output_buf[1][output_col] =
- range_limit[(int) IRIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
+ outptr[0] = range_limit[(int) RIGHT_SHIFT(tmp0 + tmp1, 3) & RANGE_MASK];
+ outptr[1] = range_limit[(int) RIGHT_SHIFT(tmp0 - tmp1, 3) & RANGE_MASK];
}
#endif /* IDCT_SCALING_SUPPORTED */
diff --git a/jpeg/jpegint.h b/jpeg/jpegint.h
index 52c708d4..3528bff5 100644
--- a/jpeg/jpegint.h
+++ b/jpeg/jpegint.h
@@ -2,7 +2,7 @@
* jpegint.h
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 1997-2019 by Guido Vollbeding.
+ * Modified 1997-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -103,8 +103,7 @@ struct jpeg_downsampler {
typedef JMETHOD(void, forward_DCT_ptr,
(j_compress_ptr cinfo, jpeg_component_info * compptr,
JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
- JDIMENSION start_row, JDIMENSION start_col,
- JDIMENSION num_blocks));
+ JDIMENSION start_col, JDIMENSION num_blocks));
struct jpeg_forward_dct {
JMETHOD(void, start_pass, (j_compress_ptr cinfo));
@@ -115,7 +114,7 @@ struct jpeg_forward_dct {
/* Entropy encoding */
struct jpeg_entropy_encoder {
JMETHOD(void, start_pass, (j_compress_ptr cinfo, boolean gather_statistics));
- JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKROW *MCU_data));
+ JMETHOD(boolean, encode_mcu, (j_compress_ptr cinfo, JBLOCKARRAY MCU_data));
JMETHOD(void, finish_pass, (j_compress_ptr cinfo));
};
@@ -211,7 +210,7 @@ struct jpeg_marker_reader {
/* Entropy decoding */
struct jpeg_entropy_decoder {
JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
- JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, JBLOCKROW *MCU_data));
+ JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo, JBLOCKARRAY MCU_data));
JMETHOD(void, finish_pass, (j_decompress_ptr cinfo));
};
@@ -416,8 +415,8 @@ EXTERN(void) jinit_memory_mgr JPP((j_common_ptr cinfo));
/* Utility routines in jutils.c */
EXTERN(long) jdiv_round_up JPP((long a, long b));
EXTERN(long) jround_up JPP((long a, long b));
-EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
- JSAMPARRAY output_array, int dest_row,
+EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array,
+ JSAMPARRAY output_array,
int num_rows, JDIMENSION num_cols));
EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
JDIMENSION num_blocks));
diff --git a/jpeg/jpeglib.h b/jpeg/jpeglib.h
index 591a2cb6..b1fa8ea9 100644
--- a/jpeg/jpeglib.h
+++ b/jpeg/jpeglib.h
@@ -2,7 +2,7 @@
* jpeglib.h
*
* Copyright (C) 1991-1998, Thomas G. Lane.
- * Modified 2002-2019 by Guido Vollbeding.
+ * Modified 2002-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -39,7 +39,7 @@ extern "C" {
#define JPEG_LIB_VERSION 90 /* Compatibility version 9.0 */
#define JPEG_LIB_VERSION_MAJOR 9
-#define JPEG_LIB_VERSION_MINOR 4
+#define JPEG_LIB_VERSION_MINOR 5
/* Various constants determining the sizes of things.
diff --git a/jpeg/jquant1.c b/jpeg/jquant1.c
index 9d11f706..60b1843e 100644
--- a/jpeg/jquant1.c
+++ b/jpeg/jquant1.c
@@ -2,7 +2,7 @@
* jquant1.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
- * Modified 2011 by Guido Vollbeding.
+ * Modified 2011-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -293,8 +293,7 @@ create_colormap (j_decompress_ptr cinfo)
/* The colors are ordered in the map in standard row-major order, */
/* i.e. rightmost (highest-indexed) color changes most rapidly. */
- colormap = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ colormap = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE,
(JDIMENSION) total_colors, (JDIMENSION) cinfo->out_color_components);
/* blksize is number of adjacent repeated entries for a component */
@@ -400,9 +399,8 @@ make_odither_array (j_decompress_ptr cinfo, int ncolors)
int j,k;
INT32 num,den;
- odither = (ODITHER_MATRIX_PTR)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(ODITHER_MATRIX));
+ odither = (ODITHER_MATRIX_PTR) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(ODITHER_MATRIX));
/* The inter-value distance for this color is MAXJSAMPLE/(ncolors-1).
* Hence the dither value for the matrix cell with fill order f
* (f=0..N-1) should be (N-1-2*f)/(2*N) * MAXJSAMPLE/(ncolors-1).
@@ -531,8 +529,7 @@ quantize_ord_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
for (row = 0; row < num_rows; row++) {
/* Initialize output values to 0 so can process components separately */
- FMEMZERO((void FAR *) output_buf[row],
- (size_t) (width * SIZEOF(JSAMPLE)));
+ FMEMZERO((void FAR *) output_buf[row], (size_t) width * SIZEOF(JSAMPLE));
row_index = cquantize->row_index;
for (ci = 0; ci < nc; ci++) {
input_ptr = input_buf[row] + ci;
@@ -636,8 +633,7 @@ quantize_fs_dither (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
for (row = 0; row < num_rows; row++) {
/* Initialize output values to 0 so can process components separately */
- FMEMZERO((void FAR *) output_buf[row],
- (size_t) (width * SIZEOF(JSAMPLE)));
+ FMEMZERO((void FAR *) output_buf[row], (size_t) width * SIZEOF(JSAMPLE));
for (ci = 0; ci < nc; ci++) {
input_ptr = input_buf[row] + ci;
output_ptr = output_buf[row];
@@ -726,10 +722,10 @@ alloc_fs_workspace (j_decompress_ptr cinfo)
size_t arraysize;
int i;
- arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
+ arraysize = ((size_t) cinfo->output_width + (size_t) 2) * SIZEOF(FSERROR);
for (i = 0; i < cinfo->out_color_components; i++) {
- cquantize->fserrors[i] = (FSERRPTR)
- (*cinfo->mem->alloc_large)((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
+ cquantize->fserrors[i] = (FSERRPTR) (*cinfo->mem->alloc_large)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, arraysize);
}
}
@@ -780,13 +776,12 @@ start_pass_1_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
if (cquantize->fserrors[0] == NULL)
alloc_fs_workspace(cinfo);
/* Initialize the propagated errors to zero. */
- arraysize = (size_t) ((cinfo->output_width + 2) * SIZEOF(FSERROR));
+ arraysize = ((size_t) cinfo->output_width + (size_t) 2) * SIZEOF(FSERROR);
for (i = 0; i < cinfo->out_color_components; i++)
FMEMZERO((void FAR *) cquantize->fserrors[i], arraysize);
break;
default:
ERREXIT(cinfo, JERR_NOT_COMPILED);
- break;
}
}
@@ -823,10 +818,9 @@ jinit_1pass_quantizer (j_decompress_ptr cinfo)
{
my_cquantize_ptr cquantize;
- cquantize = (my_cquantize_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_cquantizer));
- cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
+ cquantize = (my_cquantize_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_cquantizer));
+ cinfo->cquantize = &cquantize->pub;
cquantize->pub.start_pass = start_pass_1_quant;
cquantize->pub.finish_pass = finish_pass_1_quant;
cquantize->pub.new_color_map = new_color_map_1_quant;
diff --git a/jpeg/jquant2.c b/jpeg/jquant2.c
index 38fc2af7..662b9bce 100644
--- a/jpeg/jquant2.c
+++ b/jpeg/jquant2.c
@@ -2,7 +2,7 @@
* jquant2.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
- * Modified 2011 by Guido Vollbeding.
+ * Modified 2011-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -1197,8 +1197,8 @@ start_pass_2_quant (j_decompress_ptr cinfo, boolean is_pre_scan)
ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
if (cinfo->dither_mode == JDITHER_FS) {
- size_t arraysize = (size_t) ((cinfo->output_width + 2) *
- (3 * SIZEOF(FSERROR)));
+ size_t arraysize = ((size_t) cinfo->output_width + (size_t) 2)
+ * (3 * SIZEOF(FSERROR));
/* Allocate Floyd-Steinberg workspace if we didn't already. */
if (cquantize->fserrors == NULL)
cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
@@ -1247,10 +1247,9 @@ jinit_2pass_quantizer (j_decompress_ptr cinfo)
my_cquantize_ptr cquantize;
int i;
- cquantize = (my_cquantize_ptr)
- (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
- SIZEOF(my_cquantizer));
- cinfo->cquantize = (struct jpeg_color_quantizer *) cquantize;
+ cquantize = (my_cquantize_ptr) (*cinfo->mem->alloc_small)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(my_cquantizer));
+ cinfo->cquantize = &cquantize->pub;
cquantize->pub.start_pass = start_pass_2_quant;
cquantize->pub.new_color_map = new_color_map_2_quant;
cquantize->fserrors = NULL; /* flag optional arrays not allocated */
@@ -1284,7 +1283,8 @@ jinit_2pass_quantizer (j_decompress_ptr cinfo)
if (desired > MAXNUMCOLORS)
ERREXIT1(cinfo, JERR_QUANT_MANY_COLORS, MAXNUMCOLORS);
cquantize->sv_colormap = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo,JPOOL_IMAGE, (JDIMENSION) desired, (JDIMENSION) 3);
+ ((j_common_ptr) cinfo, JPOOL_IMAGE,
+ (JDIMENSION) desired, (JDIMENSION) 3);
cquantize->desired = desired;
} else
cquantize->sv_colormap = NULL;
@@ -1302,7 +1302,7 @@ jinit_2pass_quantizer (j_decompress_ptr cinfo)
if (cinfo->dither_mode == JDITHER_FS) {
cquantize->fserrors = (FSERRPTR) (*cinfo->mem->alloc_large)
((j_common_ptr) cinfo, JPOOL_IMAGE,
- (size_t) ((cinfo->output_width + 2) * (3 * SIZEOF(FSERROR))));
+ ((size_t) cinfo->output_width + (size_t) 2) * (3 * SIZEOF(FSERROR)));
/* Might as well create the error-limiting table too. */
init_error_limit(cinfo);
}
diff --git a/jpeg/jutils.c b/jpeg/jutils.c
index 1e2dfb01..31e16dfb 100644
--- a/jpeg/jutils.c
+++ b/jpeg/jutils.c
@@ -2,7 +2,7 @@
* jutils.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
- * Modified 2009-2019 by Guido Vollbeding.
+ * Modified 2009-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -52,67 +52,67 @@ const int jpeg_zigzag_order[DCTSIZE2] = {
*/
const int jpeg_natural_order[DCTSIZE2+16] = {
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63,
- 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
- 63, 63, 63, 63, 63, 63, 63, 63
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 5,
+ 12, 19, 26, 33, 40, 48, 41, 34,
+ 27, 20, 13, 6, 7, 14, 21, 28,
+ 35, 42, 49, 56, 57, 50, 43, 36,
+ 29, 22, 15, 23, 30, 37, 44, 51,
+ 58, 59, 52, 45, 38, 31, 39, 46,
+ 53, 60, 61, 54, 47, 55, 62, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+ 63, 63, 63, 63, 63, 63, 63, 63
};
const int jpeg_natural_order7[7*7+16] = {
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 14, 21, 28, 35,
- 42, 49, 50, 43, 36, 29, 22, 30,
- 37, 44, 51, 52, 45, 38, 46, 53,
- 54,
- 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
- 63, 63, 63, 63, 63, 63, 63, 63
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 5,
+ 12, 19, 26, 33, 40, 48, 41, 34,
+ 27, 20, 13, 6, 14, 21, 28, 35,
+ 42, 49, 50, 43, 36, 29, 22, 30,
+ 37, 44, 51, 52, 45, 38, 46, 53,
+ 54,
+ 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+ 63, 63, 63, 63, 63, 63, 63, 63
};
const int jpeg_natural_order6[6*6+16] = {
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 41, 34, 27,
- 20, 13, 21, 28, 35, 42, 43, 36,
- 29, 37, 44, 45,
- 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
- 63, 63, 63, 63, 63, 63, 63, 63
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 5,
+ 12, 19, 26, 33, 40, 41, 34, 27,
+ 20, 13, 21, 28, 35, 42, 43, 36,
+ 29, 37, 44, 45,
+ 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+ 63, 63, 63, 63, 63, 63, 63, 63
};
const int jpeg_natural_order5[5*5+16] = {
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 12,
- 19, 26, 33, 34, 27, 20, 28, 35,
- 36,
- 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
- 63, 63, 63, 63, 63, 63, 63, 63
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 32, 25, 18, 11, 4, 12,
+ 19, 26, 33, 34, 27, 20, 28, 35,
+ 36,
+ 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+ 63, 63, 63, 63, 63, 63, 63, 63
};
const int jpeg_natural_order4[4*4+16] = {
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 25, 18, 11, 19, 26, 27,
- 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
- 63, 63, 63, 63, 63, 63, 63, 63
+ 0, 1, 8, 16, 9, 2, 3, 10,
+ 17, 24, 25, 18, 11, 19, 26, 27,
+ 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+ 63, 63, 63, 63, 63, 63, 63, 63
};
const int jpeg_natural_order3[3*3+16] = {
- 0, 1, 8, 16, 9, 2, 10, 17,
- 18,
- 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
- 63, 63, 63, 63, 63, 63, 63, 63
+ 0, 1, 8, 16, 9, 2, 10, 17,
+ 18,
+ 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+ 63, 63, 63, 63, 63, 63, 63, 63
};
const int jpeg_natural_order2[2*2+16] = {
- 0, 1, 8, 9,
- 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
- 63, 63, 63, 63, 63, 63, 63, 63
+ 0, 1, 8, 9,
+ 63, 63, 63, 63, 63, 63, 63, 63, /* extra entries for safety in decoder */
+ 63, 63, 63, 63, 63, 63, 63, 63
};
@@ -174,12 +174,12 @@ jzero_far (void FAR * target, size_t bytestozero)
GLOBAL(void)
-jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
- JSAMPARRAY output_array, int dest_row,
+jcopy_sample_rows (JSAMPARRAY input_array,
+ JSAMPARRAY output_array,
int num_rows, JDIMENSION num_cols)
/* Copy some rows of samples from one place to another.
- * num_rows rows are copied from input_array[source_row++]
- * to output_array[dest_row++]; these areas may overlap for duplication.
+ * num_rows rows are copied from *input_array++ to *output_array++;
+ * these areas may overlap for duplication.
* The source and destination arrays must be at least as wide as num_cols.
*/
{
@@ -191,9 +191,6 @@ jcopy_sample_rows (JSAMPARRAY input_array, int source_row,
#endif
register int row;
- input_array += source_row;
- output_array += dest_row;
-
for (row = num_rows; row > 0; row--) {
inptr = *input_array++;
outptr = *output_array++;
diff --git a/jpeg/jversion.h b/jpeg/jversion.h
index c9befacd..17134b7a 100644
--- a/jpeg/jversion.h
+++ b/jpeg/jversion.h
@@ -1,7 +1,7 @@
/*
* jversion.h
*
- * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding.
+ * Copyright (C) 1991-2022, Thomas G. Lane, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -9,6 +9,6 @@
*/
-#define JVERSION "9d 12-Jan-2020"
+#define JVERSION "9e 16-Jan-2022"
-#define JCOPYRIGHT "Copyright (C) 2020, Thomas G. Lane, Guido Vollbeding"
+#define JCOPYRIGHT "Copyright (C) 2022, Thomas G. Lane, Guido Vollbeding"
diff --git a/jpeg/makeasln.v16 b/jpeg/makeasln.v16
index 8e69d6ff..3880c9f9 100644
--- a/jpeg/makeasln.v16
+++ b/jpeg/makeasln.v16
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28307.329
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31402.337
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cjpeg", "cjpeg.vcxproj", "{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}"
EndProject
@@ -15,26 +15,48 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wrjpgcom", "wrjpgcom.vcxpro
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|ARM.ActiveCfg = Release|ARM
+ {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|ARM.Build.0 = Release|ARM
+ {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|ARM64.ActiveCfg = Release|ARM64
+ {2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|ARM64.Build.0 = Release|ARM64
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.ActiveCfg = Release|Win32
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|Win32.Build.0 = Release|Win32
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|x64.ActiveCfg = Release|x64
{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}.Release|x64.Build.0 = Release|x64
+ {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|ARM.ActiveCfg = Release|ARM
+ {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|ARM.Build.0 = Release|ARM
+ {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|ARM64.ActiveCfg = Release|ARM64
+ {11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|ARM64.Build.0 = Release|ARM64
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.ActiveCfg = Release|Win32
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|Win32.Build.0 = Release|Win32
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|x64.ActiveCfg = Release|x64
{11043137-B453-4DFA-9010-4D2B9DC1545C}.Release|x64.Build.0 = Release|x64
+ {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|ARM.ActiveCfg = Release|ARM
+ {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|ARM.Build.0 = Release|ARM
+ {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|ARM64.ActiveCfg = Release|ARM64
+ {025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|ARM64.Build.0 = Release|ARM64
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.ActiveCfg = Release|Win32
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|Win32.Build.0 = Release|Win32
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|x64.ActiveCfg = Release|x64
{025BAC50-51B5-4FFE-BC47-3F920BB4047E}.Release|x64.Build.0 = Release|x64
+ {C81513DB-78DC-46BC-BC98-82E745203976}.Release|ARM.ActiveCfg = Release|ARM
+ {C81513DB-78DC-46BC-BC98-82E745203976}.Release|ARM.Build.0 = Release|ARM
+ {C81513DB-78DC-46BC-BC98-82E745203976}.Release|ARM64.ActiveCfg = Release|ARM64
+ {C81513DB-78DC-46BC-BC98-82E745203976}.Release|ARM64.Build.0 = Release|ARM64
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.ActiveCfg = Release|Win32
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|Win32.Build.0 = Release|Win32
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|x64.ActiveCfg = Release|x64
{C81513DB-78DC-46BC-BC98-82E745203976}.Release|x64.Build.0 = Release|x64
+ {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|ARM.ActiveCfg = Release|ARM
+ {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|ARM.Build.0 = Release|ARM
+ {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|ARM64.ActiveCfg = Release|ARM64
+ {B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|ARM64.Build.0 = Release|ARM64
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.ActiveCfg = Release|Win32
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|Win32.Build.0 = Release|Win32
{B57065D4-DDDA-4668-BAF5-2D49270C973C}.Release|x64.ActiveCfg = Release|x64
diff --git a/jpeg/makecvcx.v16 b/jpeg/makecvcx.v16
index c67383b8..ee6bd4ee 100644
--- a/jpeg/makecvcx.v16
+++ b/jpeg/makecvcx.v16
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -24,6 +32,20 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@@ -37,6 +59,12 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@@ -46,6 +74,16 @@
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
@@ -71,6 +109,46 @@
<AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@@ -78,7 +156,7 @@
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
diff --git a/jpeg/makecvcx.v17 b/jpeg/makecvcx.v17
new file mode 100644
index 00000000..b55fd90a
--- /dev/null
+++ b/jpeg/makecvcx.v17
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{2E7FAAD9-2F58-4BDE-81F2-1D6D3FB8BF57}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>cjpeg</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="cderror.h" />
+ <ClInclude Include="cdjpeg.h" />
+ <ClInclude Include="jconfig.h" />
+ <ClInclude Include="jerror.h" />
+ <ClInclude Include="jinclude.h" />
+ <ClInclude Include="jmorecfg.h" />
+ <ClInclude Include="jpeglib.h" />
+ <ClInclude Include="jversion.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="cdjpeg.c" />
+ <ClCompile Include="cjpeg.c" />
+ <ClCompile Include="rdbmp.c" />
+ <ClCompile Include="rdgif.c" />
+ <ClCompile Include="rdppm.c" />
+ <ClCompile Include="rdrle.c" />
+ <ClCompile Include="rdswitch.c" />
+ <ClCompile Include="rdtarga.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/jpeg/makedvcx.v16 b/jpeg/makedvcx.v16
index b295719d..199bbf3a 100644
--- a/jpeg/makedvcx.v16
+++ b/jpeg/makedvcx.v16
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -24,6 +32,20 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@@ -37,6 +59,12 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@@ -46,6 +74,16 @@
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
@@ -71,6 +109,46 @@
<AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@@ -78,7 +156,7 @@
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
diff --git a/jpeg/makedvcx.v17 b/jpeg/makedvcx.v17
new file mode 100644
index 00000000..37455365
--- /dev/null
+++ b/jpeg/makedvcx.v17
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{11043137-B453-4DFA-9010-4D2B9DC1545C}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>djpeg</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="cderror.h" />
+ <ClInclude Include="cdjpeg.h" />
+ <ClInclude Include="jconfig.h" />
+ <ClInclude Include="jerror.h" />
+ <ClInclude Include="jinclude.h" />
+ <ClInclude Include="jmorecfg.h" />
+ <ClInclude Include="jpeglib.h" />
+ <ClInclude Include="jversion.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="cdjpeg.c" />
+ <ClCompile Include="djpeg.c" />
+ <ClCompile Include="rdcolmap.c" />
+ <ClCompile Include="wrbmp.c" />
+ <ClCompile Include="wrgif.c" />
+ <ClCompile Include="wrppm.c" />
+ <ClCompile Include="wrrle.c" />
+ <ClCompile Include="wrtarga.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/jpeg/makefile.ansi b/jpeg/makefile.ansi
index cb695c50..703882cc 100644
--- a/jpeg/makefile.ansi
+++ b/jpeg/makefile.ansi
@@ -59,7 +59,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -69,14 +69,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
diff --git a/jpeg/makefile.b32 b/jpeg/makefile.b32
index 083e56d6..9812aeea 100644
--- a/jpeg/makefile.b32
+++ b/jpeg/makefile.b32
@@ -55,7 +55,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -65,14 +65,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
diff --git a/jpeg/makefile.bcc b/jpeg/makefile.bcc
index 16b640ab..237a3e67 100644
--- a/jpeg/makefile.bcc
+++ b/jpeg/makefile.bcc
@@ -86,7 +86,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -96,14 +96,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
diff --git a/jpeg/makefile.dj b/jpeg/makefile.dj
index 38724919..a9ceecbc 100644
--- a/jpeg/makefile.dj
+++ b/jpeg/makefile.dj
@@ -59,7 +59,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -69,14 +69,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
diff --git a/jpeg/makefile.manx b/jpeg/makefile.manx
index 4776b637..87e92b12 100644
--- a/jpeg/makefile.manx
+++ b/jpeg/makefile.manx
@@ -60,7 +60,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -70,14 +70,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
diff --git a/jpeg/makefile.mc6 b/jpeg/makefile.mc6
index 7e155f5d..04191349 100644
--- a/jpeg/makefile.mc6
+++ b/jpeg/makefile.mc6
@@ -57,7 +57,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -67,14 +67,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
diff --git a/jpeg/makefile.mms b/jpeg/makefile.mms
index 0e616bbb..1a64028d 100644
--- a/jpeg/makefile.mms
+++ b/jpeg/makefile.mms
@@ -46,7 +46,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -56,14 +56,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
diff --git a/jpeg/makefile.sas b/jpeg/makefile.sas
index f5beb1f1..f1a82cbd 100644
--- a/jpeg/makefile.sas
+++ b/jpeg/makefile.sas
@@ -68,7 +68,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -78,14 +78,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
diff --git a/jpeg/makefile.unix b/jpeg/makefile.unix
index 5887970b..90d7c812 100644
--- a/jpeg/makefile.unix
+++ b/jpeg/makefile.unix
@@ -63,7 +63,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -73,14 +73,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
diff --git a/jpeg/makefile.vc b/jpeg/makefile.vc
index aff85a66..b52e0e44 100644
--- a/jpeg/makefile.vc
+++ b/jpeg/makefile.vc
@@ -56,7 +56,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -66,14 +66,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
@@ -211,6 +214,40 @@ setupcopy-v16:
copy /y makewvcx.v16 wrjpgcom.vcxproj
copy /y makewfil.v16 wrjpgcom.vcxproj.filters
+setup-v17:
+ ren jconfig.vc jconfig.h
+ ren makejsln.v16 jpeg.sln
+ ren makeasln.v16 apps.sln
+ ren makejvcx.v17 jpeg.vcxproj
+ ren makejfil.v16 jpeg.vcxproj.filters
+ ren makecvcx.v17 cjpeg.vcxproj
+ ren makecfil.v16 cjpeg.vcxproj.filters
+ ren makedvcx.v17 djpeg.vcxproj
+ ren makedfil.v16 djpeg.vcxproj.filters
+ ren maketvcx.v17 jpegtran.vcxproj
+ ren maketfil.v16 jpegtran.vcxproj.filters
+ ren makervcx.v17 rdjpgcom.vcxproj
+ ren makerfil.v16 rdjpgcom.vcxproj.filters
+ ren makewvcx.v17 wrjpgcom.vcxproj
+ ren makewfil.v16 wrjpgcom.vcxproj.filters
+
+setupcopy-v17:
+ copy /y jconfig.vc jconfig.h
+ copy /y makejsln.v16 jpeg.sln
+ copy /y makeasln.v16 apps.sln
+ copy /y makejvcx.v17 jpeg.vcxproj
+ copy /y makejfil.v16 jpeg.vcxproj.filters
+ copy /y makecvcx.v17 cjpeg.vcxproj
+ copy /y makecfil.v16 cjpeg.vcxproj.filters
+ copy /y makedvcx.v17 djpeg.vcxproj
+ copy /y makedfil.v16 djpeg.vcxproj.filters
+ copy /y maketvcx.v17 jpegtran.vcxproj
+ copy /y maketfil.v16 jpegtran.vcxproj.filters
+ copy /y makervcx.v17 rdjpgcom.vcxproj
+ copy /y makerfil.v16 rdjpgcom.vcxproj.filters
+ copy /y makewvcx.v17 wrjpgcom.vcxproj
+ copy /y makewfil.v16 wrjpgcom.vcxproj.filters
+
test:
IF EXIST testout* $(RM) testout*
.\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
diff --git a/jpeg/makefile.vms b/jpeg/makefile.vms
index a07d070d..fe0fb0e7 100644
--- a/jpeg/makefile.vms
+++ b/jpeg/makefile.vms
@@ -125,12 +125,14 @@ $!
$! Run the self-test
$!
$ mcr sys$disk:[]djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
+$ mcr sys$disk:[]djpeg -dct int -gif -outfile testout.gif testorig.jpg
$ mcr sys$disk:[]djpeg -dct int -bmp -colors 256 -outfile testout.bmp testorig.jpg
$ mcr sys$disk:[]cjpeg -dct int -outfile testout.jpg testimg.ppm
$ mcr sys$disk:[]djpeg -dct int -ppm -outfile testoutp.ppm testprog.jpg
$ mcr sys$disk:[]cjpeg -dct int -progressive -opt -outfile testoutp.jpg testimg.ppm
$ mcr sys$disk:[]jpegtran -outfile testoutt.jpg testprog.jpg
$ Backup /Compare/Log testimg.ppm testout.ppm
+$ Backup /Compare/Log testimg.gif testout.gif
$ Backup /Compare/Log testimg.bmp testout.bmp
$ Backup /Compare/Log testimg.jpg testout.jpg
$ Backup /Compare/Log testimg.ppm testoutp.ppm
diff --git a/jpeg/makefile.vs b/jpeg/makefile.vs
index bb10fcb6..15419d5a 100644
--- a/jpeg/makefile.vs
+++ b/jpeg/makefile.vs
@@ -56,7 +56,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h \
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 \
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt \
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc \
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 \
@@ -66,14 +66,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 \
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 \
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 \
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 \
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st \
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 \
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st \
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms \
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp \
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in \
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg \
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) \
@@ -211,6 +214,40 @@ setupcopy-v16:
copy /y makewvcx.v16 wrjpgcom.vcxproj
copy /y makewfil.v16 wrjpgcom.vcxproj.filters
+setup-v17:
+ ren jconfig.vc jconfig.h
+ ren makejsln.v16 jpeg.sln
+ ren makeasln.v16 apps.sln
+ ren makejvcx.v17 jpeg.vcxproj
+ ren makejfil.v16 jpeg.vcxproj.filters
+ ren makecvcx.v17 cjpeg.vcxproj
+ ren makecfil.v16 cjpeg.vcxproj.filters
+ ren makedvcx.v17 djpeg.vcxproj
+ ren makedfil.v16 djpeg.vcxproj.filters
+ ren maketvcx.v17 jpegtran.vcxproj
+ ren maketfil.v16 jpegtran.vcxproj.filters
+ ren makervcx.v17 rdjpgcom.vcxproj
+ ren makerfil.v16 rdjpgcom.vcxproj.filters
+ ren makewvcx.v17 wrjpgcom.vcxproj
+ ren makewfil.v16 wrjpgcom.vcxproj.filters
+
+setupcopy-v17:
+ copy /y jconfig.vc jconfig.h
+ copy /y makejsln.v16 jpeg.sln
+ copy /y makeasln.v16 apps.sln
+ copy /y makejvcx.v17 jpeg.vcxproj
+ copy /y makejfil.v16 jpeg.vcxproj.filters
+ copy /y makecvcx.v17 cjpeg.vcxproj
+ copy /y makecfil.v16 cjpeg.vcxproj.filters
+ copy /y makedvcx.v17 djpeg.vcxproj
+ copy /y makedfil.v16 djpeg.vcxproj.filters
+ copy /y maketvcx.v17 jpegtran.vcxproj
+ copy /y maketfil.v16 jpegtran.vcxproj.filters
+ copy /y makervcx.v17 rdjpgcom.vcxproj
+ copy /y makerfil.v16 rdjpgcom.vcxproj.filters
+ copy /y makewvcx.v17 wrjpgcom.vcxproj
+ copy /y makewfil.v16 wrjpgcom.vcxproj.filters
+
test:
IF EXIST testout* $(RM) testout*
.\djpeg -dct int -ppm -outfile testout.ppm testorig.jpg
diff --git a/jpeg/makefile.wat b/jpeg/makefile.wat
index 56b2f0dd..a04e96d9 100644
--- a/jpeg/makefile.wat
+++ b/jpeg/makefile.wat
@@ -58,7 +58,7 @@ INCLUDES= jdct.h jerror.h jinclude.h jmemsys.h jmorecfg.h jpegint.h &
# documentation, test, and support files
DOCS= README install.txt usage.txt cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 &
wrjpgcom.1 wizard.txt example.c libjpeg.txt structure.txt &
- coderules.txt filelist.txt change.log
+ coderules.txt filelist.txt cdaltui.txt change.log
MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 &
makefile.bcc makefile.mc6 makefile.dj makefile.wat makefile.vc &
makefile.vs makejdsw.vc6 makeadsw.vc6 makejdep.vc6 makejdsp.vc6 &
@@ -68,14 +68,17 @@ MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.b32 &
makewmak.vc6 makejsln.v16 makeasln.v16 makejvcx.v16 makejfil.v16 &
makecvcx.v16 makecfil.v16 makedvcx.v16 makedfil.v16 maketvcx.v16 &
maketfil.v16 makervcx.v16 makerfil.v16 makewvcx.v16 makewfil.v16 &
- makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st maktjpeg.st &
- makefile.manx makefile.sas makefile.mms makefile.vms makvms.opt
+ makejvcx.v17 makecvcx.v17 makedvcx.v17 maketvcx.v17 makervcx.v17 &
+ makewvcx.v17 makeproj.mac makcjpeg.st makdjpeg.st makljpeg.st &
+ maktjpeg.st makefile.manx makefile.sas makefile.mms makefile.vms &
+ makvms.opt
CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat &
jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas &
jconfig.vms
CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp &
missing ar-lib
-OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in
+OTHERFILES= jconfig.txt ckconfig.c jmemdosa.asm libjpeg.map libjpeg.pc.in &
+ cjpegalt.c djpegalt.c
TESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.bmp testimg.jpg &
testprog.jpg testimgp.jpg
DISTFILES= $(DOCS) $(MKFILES) $(CONFIGFILES) $(SOURCES) $(INCLUDES) &
diff --git a/jpeg/makejsln.v16 b/jpeg/makejsln.v16
index 11ef80f8..344f7995 100644
--- a/jpeg/makejsln.v16
+++ b/jpeg/makejsln.v16
@@ -1,16 +1,22 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.28307.329
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31402.337
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jpeg", "jpeg.vcxproj", "{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Release|ARM = Release|ARM
+ Release|ARM64 = Release|ARM64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|ARM.ActiveCfg = Release|ARM
+ {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|ARM.Build.0 = Release|ARM
+ {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|ARM64.ActiveCfg = Release|ARM64
+ {019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|ARM64.Build.0 = Release|ARM64
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.ActiveCfg = Release|Win32
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|Win32.Build.0 = Release|Win32
{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}.Release|x64.ActiveCfg = Release|x64
diff --git a/jpeg/makejvcx.v16 b/jpeg/makejvcx.v16
index 20ad5f7a..55f98cbd 100644
--- a/jpeg/makejvcx.v16
+++ b/jpeg/makejvcx.v16
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -83,6 +91,20 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@@ -96,6 +118,12 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@@ -104,6 +132,14 @@
<OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
@@ -126,6 +162,42 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
diff --git a/jpeg/makejvcx.v17 b/jpeg/makejvcx.v17
new file mode 100644
index 00000000..e4000a92
--- /dev/null
+++ b/jpeg/makejvcx.v17
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="jconfig.h" />
+ <ClInclude Include="jdct.h" />
+ <ClInclude Include="jerror.h" />
+ <ClInclude Include="jinclude.h" />
+ <ClInclude Include="jmemsys.h" />
+ <ClInclude Include="jmorecfg.h" />
+ <ClInclude Include="jpegint.h" />
+ <ClInclude Include="jpeglib.h" />
+ <ClInclude Include="jversion.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="jaricom.c" />
+ <ClCompile Include="jcapimin.c" />
+ <ClCompile Include="jcapistd.c" />
+ <ClCompile Include="jcarith.c" />
+ <ClCompile Include="jccoefct.c" />
+ <ClCompile Include="jccolor.c" />
+ <ClCompile Include="jcdctmgr.c" />
+ <ClCompile Include="jchuff.c" />
+ <ClCompile Include="jcinit.c" />
+ <ClCompile Include="jcmainct.c" />
+ <ClCompile Include="jcmarker.c" />
+ <ClCompile Include="jcmaster.c" />
+ <ClCompile Include="jcomapi.c" />
+ <ClCompile Include="jcparam.c" />
+ <ClCompile Include="jcprepct.c" />
+ <ClCompile Include="jcsample.c" />
+ <ClCompile Include="jctrans.c" />
+ <ClCompile Include="jdapimin.c" />
+ <ClCompile Include="jdapistd.c" />
+ <ClCompile Include="jdarith.c" />
+ <ClCompile Include="jdatadst.c" />
+ <ClCompile Include="jdatasrc.c" />
+ <ClCompile Include="jdcoefct.c" />
+ <ClCompile Include="jdcolor.c" />
+ <ClCompile Include="jddctmgr.c" />
+ <ClCompile Include="jdhuff.c" />
+ <ClCompile Include="jdinput.c" />
+ <ClCompile Include="jdmainct.c" />
+ <ClCompile Include="jdmarker.c" />
+ <ClCompile Include="jdmaster.c" />
+ <ClCompile Include="jdmerge.c" />
+ <ClCompile Include="jdpostct.c" />
+ <ClCompile Include="jdsample.c" />
+ <ClCompile Include="jdtrans.c" />
+ <ClCompile Include="jerror.c" />
+ <ClCompile Include="jfdctflt.c" />
+ <ClCompile Include="jfdctfst.c" />
+ <ClCompile Include="jfdctint.c" />
+ <ClCompile Include="jidctflt.c" />
+ <ClCompile Include="jidctfst.c" />
+ <ClCompile Include="jidctint.c" />
+ <ClCompile Include="jmemmgr.c" />
+ <ClCompile Include="jmemnobs.c" />
+ <ClCompile Include="jquant1.c" />
+ <ClCompile Include="jquant2.c" />
+ <ClCompile Include="jutils.c" />
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{019DBD2A-273D-4BA4-BF86-B5EFE2ED76B1}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>jpeg</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>StaticLibrary</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/jpeg/makervcx.v16 b/jpeg/makervcx.v16
index e53020ae..21e412eb 100644
--- a/jpeg/makervcx.v16
+++ b/jpeg/makervcx.v16
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -24,6 +32,20 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@@ -37,6 +59,12 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@@ -46,6 +74,16 @@
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
@@ -70,6 +108,44 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@@ -77,7 +153,7 @@
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
diff --git a/jpeg/makervcx.v17 b/jpeg/makervcx.v17
new file mode 100644
index 00000000..bf20038c
--- /dev/null
+++ b/jpeg/makervcx.v17
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{C81513DB-78DC-46BC-BC98-82E745203976}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>rdjpgcom</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="jconfig.h" />
+ <ClInclude Include="jinclude.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="rdjpgcom.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/jpeg/maketvcx.v16 b/jpeg/maketvcx.v16
index 1ce73bb3..0a90ae4e 100644
--- a/jpeg/maketvcx.v16
+++ b/jpeg/maketvcx.v16
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -24,6 +32,20 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@@ -37,6 +59,12 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@@ -46,6 +74,16 @@
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
@@ -71,6 +109,46 @@
<AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@@ -78,7 +156,7 @@
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
diff --git a/jpeg/maketvcx.v17 b/jpeg/maketvcx.v17
new file mode 100644
index 00000000..4d414151
--- /dev/null
+++ b/jpeg/maketvcx.v17
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{025BAC50-51B5-4FFE-BC47-3F920BB4047E}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>jpegtran</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ <AdditionalDependencies>$(Configuration)\$(Platform)\jpeg.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="cderror.h" />
+ <ClInclude Include="cdjpeg.h" />
+ <ClInclude Include="jconfig.h" />
+ <ClInclude Include="jerror.h" />
+ <ClInclude Include="jinclude.h" />
+ <ClInclude Include="jmorecfg.h" />
+ <ClInclude Include="jpegint.h" />
+ <ClInclude Include="jpeglib.h" />
+ <ClInclude Include="jversion.h" />
+ <ClInclude Include="transupp.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="cdjpeg.c" />
+ <ClCompile Include="jpegtran.c" />
+ <ClCompile Include="rdswitch.c" />
+ <ClCompile Include="transupp.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/jpeg/makewvcx.v16 b/jpeg/makewvcx.v16
index 4abd720c..2ecbb2cd 100644
--- a/jpeg/makewvcx.v16
+++ b/jpeg/makewvcx.v16
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@@ -24,6 +32,20 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v142</PlatformToolset>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
@@ -37,6 +59,12 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
@@ -46,6 +74,16 @@
<OutDir>$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
</PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(Configuration)\$(Platform)\</OutDir>
@@ -70,6 +108,44 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
@@ -77,7 +153,7 @@
<Optimization>Full</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>false</IntrinsicFunctions>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
<OmitFramePointers>true</OmitFramePointers>
<EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
<DisableSpecificWarnings>4996</DisableSpecificWarnings>
diff --git a/jpeg/makewvcx.v17 b/jpeg/makewvcx.v17
new file mode 100644
index 00000000..542b4ad0
--- /dev/null
+++ b/jpeg/makewvcx.v17
@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM64">
+ <Configuration>Release</Configuration>
+ <Platform>ARM64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{B57065D4-DDDA-4668-BAF5-2D49270C973C}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ <RootNamespace>wrjpgcom</RootNamespace>
+ <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ <CharacterSet>Unicode</CharacterSet>
+ <PlatformToolset>v143</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <LinkIncremental>false</LinkIncremental>
+ <OutDir>$(Configuration)\$(Platform)\</OutDir>
+ <IntDir>$(Configuration)\$(Platform)\$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <Optimization>Full</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <PreprocessorDefinitions>NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions>
+ <OmitFramePointers>true</OmitFramePointers>
+ <EnableFiberSafeOptimizations>true</EnableFiberSafeOptimizations>
+ <DisableSpecificWarnings>4996</DisableSpecificWarnings>
+ </ClCompile>
+ <Link>
+ <SubSystem>Console</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <OptimizeReferences>true</OptimizeReferences>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="jconfig.h" />
+ <ClInclude Include="jinclude.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="wrjpgcom.c" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/jpeg/missing b/jpeg/missing
index 625aeb11..1fe1611f 100755
--- a/jpeg/missing
+++ b/jpeg/missing
@@ -3,7 +3,7 @@
scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2018 Free Software Foundation, Inc.
+# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
diff --git a/jpeg/rdgif.c b/jpeg/rdgif.c
index 0cbf8d13..5d2339ca 100644
--- a/jpeg/rdgif.c
+++ b/jpeg/rdgif.c
@@ -2,7 +2,7 @@
* rdgif.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
- * Modified 2019 by Guido Vollbeding.
+ * Modified 2019-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -309,7 +309,7 @@ LZWReadByte (gif_source_ptr sinfo)
/* Got normal raw byte or LZW symbol */
incode = code; /* save for a moment */
-
+
if (code >= sinfo->max_code) { /* special case for not-yet-defined symbol */
/* code == max_code is OK; anything bigger is bad data */
if (code > sinfo->max_code) {
@@ -342,7 +342,7 @@ LZWReadByte (gif_source_ptr sinfo)
sinfo->limit_code <<= 1; /* keep equal to 2^code_size */
}
}
-
+
sinfo->oldcode = incode; /* save last input symbol for future use */
return sinfo->firstcode; /* return first byte of symbol's expansion */
}
@@ -442,7 +442,7 @@ start_input_gif (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
DoExtension(source);
continue;
}
-
+
if (c != ',') { /* Not an image separator? */
WARNMS1(cinfo, JWRN_GIF_CHAR, c);
continue;
@@ -454,6 +454,8 @@ start_input_gif (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
/* we ignore top/left position info, also sort flag */
width = LM_to_uint(hdrbuf, 4);
height = LM_to_uint(hdrbuf, 6);
+ if (width <= 0 || height <= 0)
+ ERREXIT(cinfo, JERR_GIF_OUTOFRANGE);
source->is_interlaced = (BitSet(hdrbuf[8], INTERLACE) != 0);
/* Read local colormap if header indicates it is present */
@@ -542,7 +544,7 @@ get_pixel_rows (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
register JSAMPROW ptr;
register JDIMENSION col;
register JSAMPARRAY colormap = source->colormap;
-
+
ptr = source->pub.buffer[0];
for (col = cinfo->image_width; col > 0; col--) {
c = LZWReadByte(source);
diff --git a/jpeg/rdppm.c b/jpeg/rdppm.c
index 33e469ac..ca638678 100644
--- a/jpeg/rdppm.c
+++ b/jpeg/rdppm.c
@@ -2,7 +2,7 @@
* rdppm.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
- * Modified 2009-2019 by Bill Allombert, Guido Vollbeding.
+ * Modified 2009-2020 by Bill Allombert, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -70,8 +70,9 @@ typedef char U_CHAR;
typedef struct {
struct cjpeg_source_struct pub; /* public fields */
- U_CHAR *iobuffer; /* non-FAR pointer to I/O buffer */
- JSAMPROW pixrow; /* FAR pointer to same */
+ /* Usually these two pointers point to the same place: */
+ U_CHAR *iobuffer; /* fread's I/O buffer */
+ JSAMPROW pixrow; /* compressor input buffer */
size_t buffer_width; /* width of I/O buffer */
JSAMPLE *rescale; /* => maxval-remapping array, or NULL */
unsigned int maxval;
@@ -148,7 +149,7 @@ get_text_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
unsigned int maxval = source->maxval;
JDIMENSION col;
- ptr = source->pub.buffer[0];
+ ptr = source->pixrow;
for (col = cinfo->image_width; col > 0; col--) {
register unsigned int temp;
temp = read_pbm_integer(cinfo, infile);
@@ -171,7 +172,7 @@ get_text_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
unsigned int maxval = source->maxval;
JDIMENSION col;
- ptr = source->pub.buffer[0];
+ ptr = source->pixrow;
for (col = cinfo->image_width; col > 0; col--) {
register unsigned int temp;
temp = read_pbm_integer(cinfo, infile);
@@ -204,7 +205,7 @@ get_scaled_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
ERREXIT(cinfo, JERR_INPUT_EOF);
- ptr = source->pub.buffer[0];
+ ptr = source->pixrow;
bufferptr = source->iobuffer;
for (col = cinfo->image_width; col > 0; col--) {
register unsigned int temp;
@@ -230,7 +231,7 @@ get_scaled_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
ERREXIT(cinfo, JERR_INPUT_EOF);
- ptr = source->pub.buffer[0];
+ ptr = source->pixrow;
bufferptr = source->iobuffer;
for (col = cinfo->image_width; col > 0; col--) {
register unsigned int temp;
@@ -279,7 +280,7 @@ get_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
ERREXIT(cinfo, JERR_INPUT_EOF);
- ptr = source->pub.buffer[0];
+ ptr = source->pixrow;
bufferptr = source->iobuffer;
for (col = cinfo->image_width; col > 0; col--) {
register unsigned int temp;
@@ -306,7 +307,7 @@ get_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
if (! ReadOK(source->pub.input_file, source->iobuffer, source->buffer_width))
ERREXIT(cinfo, JERR_INPUT_EOF);
- ptr = source->pub.buffer[0];
+ ptr = source->pixrow;
bufferptr = source->iobuffer;
for (col = cinfo->image_width; col > 0; col--) {
register unsigned int temp;
@@ -430,7 +431,7 @@ start_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
/* Allocate space for I/O buffer: 1 or 3 bytes or words/pixel. */
if (need_iobuffer) {
- source->buffer_width = (size_t) w * cinfo->input_components *
+ source->buffer_width = (size_t) w * (size_t) cinfo->input_components *
((maxval <= 255) ? SIZEOF(U_CHAR) : (2 * SIZEOF(U_CHAR)));
source->iobuffer = (U_CHAR *) (*cinfo->mem->alloc_small)
((j_common_ptr) cinfo, JPOOL_IMAGE, source->buffer_width);
@@ -439,17 +440,17 @@ start_input_ppm (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
/* Create compressor input buffer. */
if (use_raw_buffer) {
/* For unscaled raw-input case, we can just map it onto the I/O buffer. */
- /* Synthesize a JSAMPARRAY pointer structure */
/* Cast here implies near->far pointer conversion on PCs */
source->pixrow = (JSAMPROW) source->iobuffer;
- source->pub.buffer = & source->pixrow;
- source->pub.buffer_height = 1;
} else {
/* Need to translate anyway, so make a separate sample buffer. */
- source->pub.buffer = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo,
- JPOOL_IMAGE, (JDIMENSION) w * cinfo->input_components, (JDIMENSION) 1);
- source->pub.buffer_height = 1;
+ source->pixrow = (JSAMPROW) (*cinfo->mem->alloc_large)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, (size_t) w *
+ (size_t) cinfo->input_components * SIZEOF(JSAMPLE));
}
+ /* Synthesize a JSAMPARRAY pointer structure */
+ source->pub.buffer = & source->pixrow;
+ source->pub.buffer_height = 1;
/* Compute the rescaling array if required. */
if (need_rescale) {
diff --git a/jpeg/rdswitch.c b/jpeg/rdswitch.c
index c0f7fed8..8a6675db 100644
--- a/jpeg/rdswitch.c
+++ b/jpeg/rdswitch.c
@@ -2,7 +2,7 @@
* rdswitch.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
- * Modified 2003-2019 by Guido Vollbeding.
+ * Modified 2003-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -283,8 +283,7 @@ set_quality_ratings (j_compress_ptr cinfo, char *arg, boolean force_baseline)
return FALSE;
/* Convert user 0-100 rating to percentage scaling */
cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);
- while (*arg && *arg++ != ',') /* advance to next segment of arg string */
- ;
+ while (*arg && *arg++ != ','); /* advance to next segment of arg string */
} else {
/* reached end of parameter, set remaining factors to last value */
cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);
@@ -319,8 +318,7 @@ set_quant_slots (j_compress_ptr cinfo, char *arg)
return FALSE;
}
cinfo->comp_info[ci].quant_tbl_no = val;
- while (*arg && *arg++ != ',') /* advance to next segment of arg string */
- ;
+ while (*arg && *arg++ != ','); /* advance to next segment of arg string */
} else {
/* reached end of parameter, set remaining components to last table */
cinfo->comp_info[ci].quant_tbl_no = val;
@@ -354,8 +352,7 @@ set_sample_factors (j_compress_ptr cinfo, char *arg)
}
cinfo->comp_info[ci].h_samp_factor = val1;
cinfo->comp_info[ci].v_samp_factor = val2;
- while (*arg && *arg++ != ',') /* advance to next segment of arg string */
- ;
+ while (*arg && *arg++ != ','); /* advance to next segment of arg string */
} else {
/* reached end of parameter, set remaining components to 1x1 sampling */
cinfo->comp_info[ci].h_samp_factor = 1;
diff --git a/jpeg/testimg.jpg b/jpeg/testimg.jpg
index a026e486..048a88aa 100644
--- a/jpeg/testimg.jpg
+++ b/jpeg/testimg.jpg
Binary files differ
diff --git a/jpeg/testimgp.jpg b/jpeg/testimgp.jpg
index 7dc62509..ee116e64 100644
--- a/jpeg/testimgp.jpg
+++ b/jpeg/testimgp.jpg
Binary files differ
diff --git a/jpeg/transupp.c b/jpeg/transupp.c
index 7ee74ef4..6d7d0902 100644
--- a/jpeg/transupp.c
+++ b/jpeg/transupp.c
@@ -338,7 +338,7 @@ do_drop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
FMEMZERO(dst_buffer[offset_y] + x_drop_blocks,
comp_width * SIZEOF(JBLOCK));
- }
+ }
}
}
}
diff --git a/jpeg/wrbmp.c b/jpeg/wrbmp.c
index a9a7f53e..bed699ff 100644
--- a/jpeg/wrbmp.c
+++ b/jpeg/wrbmp.c
@@ -322,7 +322,7 @@ write_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest,
putc(0, outfile);
}
}
- /* Pad colormap to ensure specified number of colormap entries */
+ /* Pad colormap to ensure specified number of colormap entries */
if (i > map_colors)
ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, i);
for (; i < map_colors; i++) {
diff --git a/jpeg/wrppm.c b/jpeg/wrppm.c
index eb8bdf40..c9e03ad1 100644
--- a/jpeg/wrppm.c
+++ b/jpeg/wrppm.c
@@ -2,7 +2,7 @@
* wrppm.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
- * Modified 2009-2019 by Guido Vollbeding.
+ * Modified 2009-2020 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -111,7 +111,7 @@ copy_pixel_rows (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
register JSAMPROW ptr;
register JDIMENSION col;
- ptr = dest->pub.buffer[0];
+ ptr = dest->pixrow;
bufferptr = dest->iobuffer;
for (col = dest->samples_per_row; col > 0; col--) {
PUTPPMSAMPLE(bufferptr, GETJSAMPLE(*ptr++));
@@ -138,7 +138,7 @@ put_demapped_rgb (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
register JSAMPROW color_map2 = cinfo->colormap[2];
register JDIMENSION col;
- ptr = dest->pub.buffer[0];
+ ptr = dest->pixrow;
bufferptr = dest->iobuffer;
for (col = cinfo->output_width; col > 0; col--) {
pixval = GETJSAMPLE(*ptr++);
@@ -159,7 +159,7 @@ put_demapped_gray (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo,
register JSAMPROW color_map0 = cinfo->colormap[0];
register JDIMENSION col;
- ptr = dest->pub.buffer[0];
+ ptr = dest->pixrow;
bufferptr = dest->iobuffer;
for (col = cinfo->output_width; col > 0; col--) {
PUTPPMSAMPLE(bufferptr, GETJSAMPLE(color_map0[GETJSAMPLE(*ptr++)]));
@@ -239,10 +239,9 @@ jinit_write_ppm (j_decompress_ptr cinfo)
* that's separate from the physical I/O buffer. We also need a
* separate buffer if pixel format translation must take place.
*/
- dest->pub.buffer = (*cinfo->mem->alloc_sarray)
- ((j_common_ptr) cinfo, JPOOL_IMAGE,
- cinfo->output_width * cinfo->output_components, (JDIMENSION) 1);
- dest->pub.buffer_height = 1;
+ dest->pixrow = (JSAMPROW) (*cinfo->mem->alloc_large)
+ ((j_common_ptr) cinfo, JPOOL_IMAGE, (size_t) cinfo->output_width *
+ (size_t) cinfo->output_components * SIZEOF(JSAMPLE));
if (! cinfo->quantize_colors)
dest->pub.put_pixel_rows = copy_pixel_rows;
else if (cinfo->out_color_space == JCS_GRAYSCALE)
@@ -251,13 +250,13 @@ jinit_write_ppm (j_decompress_ptr cinfo)
dest->pub.put_pixel_rows = put_demapped_rgb;
} else {
/* We will fwrite() directly from decompressor output buffer. */
- /* Synthesize a JSAMPARRAY pointer structure */
/* Cast here implies near->far pointer conversion on PCs */
dest->pixrow = (JSAMPROW) dest->iobuffer;
- dest->pub.buffer = & dest->pixrow;
- dest->pub.buffer_height = 1;
dest->pub.put_pixel_rows = put_pixel_rows;
}
+ /* Synthesize a JSAMPARRAY pointer structure */
+ dest->pub.buffer = & dest->pixrow;
+ dest->pub.buffer_height = 1;
return &dest->pub;
}
diff --git a/lcms2mt/src/cmsvirt.c b/lcms2mt/src/cmsvirt.c
index 6c0890f5..f85aa5d1 100644
--- a/lcms2mt/src/cmsvirt.c
+++ b/lcms2mt/src/cmsvirt.c
@@ -937,7 +937,7 @@ cmsHPROFILE CreateNamedColorDevicelink(cmsContext ContextID, cmsHTRANSFORM xform
v ->OutputFormat = OutputFormat;
v ->FromInput = FromInput;
v ->ToOutput = ToOutput;
- _cmsFindFormatter(v, InputFormat, OutputFormat, v->core->dwOriginalFlags);
+ _cmsFindFormatter(ContextID, v, InputFormat, OutputFormat, v->core->dwOriginalFlags);
// Apply the transfor to colorants.
for (i=0; i < nColors; i++) {
diff --git a/lcms2mt/src/cmsxform.c b/lcms2mt/src/cmsxform.c
index 7f4e1589..e3ede6ba 100644
--- a/lcms2mt/src/cmsxform.c
+++ b/lcms2mt/src/cmsxform.c
@@ -26,6 +26,10 @@
#include "lcms2_internal.h"
+#ifdef WITH_CAL
+#include "cal_cms.h"
+#endif
+
// Transformations stuff
// -----------------------------------------------------------------------
@@ -1939,18 +1943,20 @@ cmsUInt32Number CMSEXPORT _cmsGetTransformFlags(struct _cmstransform_struct* CMM
}
void
-_cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number OutputFormat, cmsUInt32Number dwFlags)
+_cmsFindFormatter(cmsContext ContextID, _cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number OutputFormat, cmsUInt32Number dwFlags)
{
+ int isIdentity;
if (dwFlags & cmsFLAGS_NULLTRANSFORM) {
p ->xform = NullXFORM;
return;
}
+ isIdentity = ((InputFormat & ~COLORSPACE_SH(31)) == (OutputFormat & ~COLORSPACE_SH(31)) &&
+ _cmsLutIsIdentity(p->core->Lut));
if (dwFlags & cmsFLAGS_PREMULT) {
if (dwFlags & cmsFLAGS_NOCACHE) {
if (dwFlags & cmsFLAGS_GAMUTCHECK)
p ->xform = PrecalculatedXFORMGamutCheck_P; // Gamut check, no cache
- else if ((InputFormat & ~COLORSPACE_SH(31)) == (OutputFormat & ~COLORSPACE_SH(31)) &&
- _cmsLutIsIdentity(p->core->Lut)) {
+ else if (isIdentity) {
if (T_PLANAR(InputFormat))
p ->xform = PrecalculatedXFORMIdentityPlanar;
else
@@ -1963,8 +1969,7 @@ _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number
p ->xform = CachedXFORMGamutCheck_P; // Gamut check, cache
return;
}
- if ((InputFormat & ~COLORSPACE_SH(31)) == (OutputFormat & ~COLORSPACE_SH(31)) &&
- _cmsLutIsIdentity(p->core->Lut)) {
+ if (isIdentity) {
/* No point in a cache here! */
if (T_PLANAR(InputFormat))
p ->xform = PrecalculatedXFORMIdentityPlanar;
@@ -1976,8 +1981,7 @@ _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number
if (dwFlags & cmsFLAGS_NOCACHE) {
if (dwFlags & cmsFLAGS_GAMUTCHECK)
p ->xform = PrecalculatedXFORMGamutCheck; // Gamut check, no cache
- else if ((InputFormat & ~COLORSPACE_SH(31)) == (OutputFormat & ~COLORSPACE_SH(31)) &&
- _cmsLutIsIdentity(p->core->Lut)) {
+ else if (isIdentity) {
if (T_PLANAR(InputFormat))
p ->xform = PrecalculatedXFORMIdentityPlanar;
else
@@ -1990,8 +1994,7 @@ _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number
p ->xform = CachedXFORMGamutCheck; // Gamut check, cache
return;
}
- if ((InputFormat & ~COLORSPACE_SH(31)) == (OutputFormat & ~COLORSPACE_SH(31)) &&
- _cmsLutIsIdentity(p->core->Lut)) {
+ if (isIdentity) {
/* No point in a cache here! */
if (T_PLANAR(InputFormat))
p ->xform = PrecalculatedXFORMIdentityPlanar;
@@ -1999,6 +2002,11 @@ _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number
p ->xform = PrecalculatedXFORMIdentity;
return;
}
+#ifdef WITH_CAL
+ if (cal_cms_find_formatter_and_xform(ContextID, &p->xform, InputFormat, OutputFormat, &dwFlags)) {
+ return;
+ }
+#endif
if (T_EXTRA(InputFormat) == 1 && T_EXTRA(OutputFormat) == 1) {
if (dwFlags & cmsFLAGS_PREMULT) {
if ((InputFormat & ~(COLORSPACE_SH(31)|CHANNELS_SH(7)|BYTES_SH(3)|EXTRA_SH(1))) == 0 &&
@@ -2329,7 +2337,7 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut,
}
- _cmsFindFormatter(p, *InputFormat, *OutputFormat, *dwFlags);
+ _cmsFindFormatter(ContextID, p, *InputFormat, *OutputFormat, *dwFlags);
}
p ->InputFormat = *InputFormat;
@@ -2745,7 +2753,7 @@ cmsHTRANSFORM cmsCloneTransformChangingFormats(cmsContext ContextID,
xform ->OutputFormat = OutputFormat;
xform ->FromInput = FromInput;
xform ->ToOutput = ToOutput;
- _cmsFindFormatter(xform, InputFormat, OutputFormat, xform->core->dwOriginalFlags);
+ _cmsFindFormatter(ContextID, xform, InputFormat, OutputFormat, xform->core->dwOriginalFlags);
(void)_cmsAdjustReferenceCount(&xform->core->refs, 1);
diff --git a/lcms2mt/src/lcms2_internal.h b/lcms2mt/src/lcms2_internal.h
index 504393e2..97dcbc4d 100644
--- a/lcms2mt/src/lcms2_internal.h
+++ b/lcms2mt/src/lcms2_internal.h
@@ -1116,7 +1116,7 @@ cmsBool _cmsAdaptationMatrix(cmsContext ContextID, cmsMAT3* r, const cmsMAT3*
cmsBool _cmsBuildRGB2XYZtransferMatrix(cmsContext ContextID, cmsMAT3* r, const cmsCIExyY* WhitePoint, const cmsCIExyYTRIPLE* Primaries);
-void _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number OutputFormat, cmsUInt32Number flags);
+void _cmsFindFormatter(cmsContext ContextID, _cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number OutputFormat, cmsUInt32Number flags);
cmsUInt32Number _cmsAdjustReferenceCount(cmsUInt32Number *rc, int delta);
diff --git a/lib/pdf_info.ps b/lib/pdf_info.ps
index 35951e9a..2a5f5796 100644
--- a/lib/pdf_info.ps
+++ b/lib/pdf_info.ps
@@ -527,6 +527,164 @@ systemdict /.sort known not {
} ifelse
} bind def
-enum-pdfs
+/NEWPDF where {/NEWPDF get}{false}ifelse
+{
+ /knownoget
+ {
+ 2 copy known {
+ get
+ true
+ }{
+ pop pop false
+ } ifelse
+ }bind def
+
+ /PDFContext << >> .PDFInit def
+ {File (r) file PDFContext .PDFStream} stopped not
+ {
+
+ PDFContext .PDFInfo
+ File
+ () = ( ) print print ( has ) print
+ dup /NumPages get dup =print 10 mod 1 eq { ( page.\n) } { ( pages\n) } ifelse = flush
+
+ /DumpXML where {/DumpXML get}{//false}ifelse
+ {
+ (\n*** DumpXML is no longer supported. ***\n\n) print
+ }if
+
+ dup /Title knownoget { (Title: ) print write-doc-string () = flush } if
+ dup /Author knownoget { (Author: ) print write-doc-string () = flush } if
+ dup /Subject knownoget { (Subject: ) print write-doc-string () = flush } if
+ dup /Keywords knownoget { (Keywords: ) print write-doc-string () = flush } if
+ dup /Creator knownoget { (Creator: ) print write-doc-string () = flush } if
+ dup /Producer knownoget { (Producer: ) print write-doc-string () = flush } if
+ dup /CreationDate knownoget { (CreationDate: ) print write-doc-string () = flush } if
+ dup /ModDate knownoget { (ModDate: ) print write-doc-string () = flush } if
+ dup /Trapped knownoget { (Trapped: ) print write-doc-string () = flush } if
+ (\n) print flush
+
+ /EmbeddedFonts 10 dict def
+ /UnEmbeddedFonts 10 dict def
+ /FontNumbers 10 dict def
+
+ /NumPages get 0 1 3 -1 roll 1 sub
+ {
+ dup
+ PDFContext exch .PDFPageInfoExt exch
+ DumpMediaSizes {
+ (Page ) print 1 add =print
+ dup /UserUnit knownoget {( UserUnit: ) print =print} if
+ dup /MediaBox knownoget {( MediaBox: ) print ==only} if
+ dup /CropBox knownoget {( CropBox: ) print ==only} if
+ dup /BleedBox knownoget {( BleedBox: ) print ==only} if
+ dup /TrimBox knownoget {( TrimBox: ) print ==only} if
+ dup /ArtBox knownoget {( ArtBox: ) print ==only} if
+ dup /Rotate knownoget not {0}if ( Rotate = ) print =print
+ dup /Annots knownoget {{( Page contains Annotations) print} if} if
+ dup /UsesTransparency knownoget {{( Page uses transparency features) print} if} if
+ dup /Spots knownoget {
+ (\n Page Spot colors: ) =
+ {( ) print (') print 256 string cvs print (') =} forall
+ } if
+ (\n) print flush
+ (\n) print flush
+ }
+ {
+ pop
+ } ifelse
+
+ /Fonts knownoget
+ {
+ {
+ dup /ObjectNum known
+ {
+ %% Fonts with an ObjectNumber may have been previously referenced on another page
+ dup /ObjectNum get
+ dup FontNumbers exch known
+ {
+ pop
+ %% found the ObjectNumber in the FontNumbers dictionary so we've seen this one.
+ //false
+ }
+ {
+ %% Not seen before, add the number to the array and process this font
+ FontNumbers exch dup put
+ //true
+ }ifelse
+ }{
+ %% Fonts without an ObjectNumber are defined inline and so must be unique
+ //true
+ } ifelse
+ {
+ % First time we've seen the font
+ dup /Descendants known
+ {
+ dup /BaseFont get
+ EmbeddedFonts exch dup put % We class the Type 0 font as 'embedded', but it's really the descendant which is embedded or not.
+ dup /Descendants get
+ 1 index /BaseFont get
+ 2 index /Embedded get
+ {
+ EmbeddedFonts exch dup put
+ }
+ {
+ UnEmbeddedFonts exch dup put
+ }ifelse
+ pop
+ }
+ {
+ dup /BaseFont get
+ 1 index /Embedded get
+ {
+ EmbeddedFonts exch dup put
+ }
+ {
+ UnEmbeddedFonts exch dup put
+ } ifelse
+ }ifelse
+ pop
+ }
+ {
+ pop
+ } ifelse
+ }forall
+ } if
+ } for
+
+ /DumpFontsUsed where {/DumpFontsUsed get}{//false}ifelse
+ {
+ [
+ UnEmbeddedFonts {pop} forall
+ /ShowEmbeddedFonts where {/ShowEmbeddedFonts get}{//false}ifelse
+ {
+ EmbeddedFonts {pop} forall
+ } if
+ ]
+ dup length 0 gt {
+ { 100 string cvs exch 100 string cvs exch lt } .sort
+ (\nFont or CIDFont resources used (plain name and ASCIIHEX string representation):) =
+ { 128 string cvs dup print ( ) print (<) print 128 string cvs {16 8 string cvrs print} forall (>) print (\n) print} forall
+ } if
+ }
+ {
+ [
+ DumpFontsNeeded
+ {
+ UnEmbeddedFonts {pop} forall
+ } if
+ ]
+ dup length 0 gt {
+ { 100 string cvs exch 100 string cvs exch lt } .sort
+ (\nFonts Needed that are not embedded \(system fonts required\):) =
+ { ( ) print 128 string cvs dup print ( ) print (<) print {16 8 string cvrs print} forall (>) print (\n) print} forall
+ } if
+ }ifelse
+ } if
+ PDFContext .PDFClose
+}
+{
+ enum-pdfs
+} ifelse
end
quit
diff --git a/lib/viewcmyk.ps b/lib/viewcmyk.ps
index e8034e53..33c5bdce 100644
--- a/lib/viewcmyk.ps
+++ b/lib/viewcmyk.ps
@@ -56,6 +56,8 @@
cleartomark
(Usage: gs -- viewcmyk.ps filename.cmyk width\n) print
( e.g.: gs -- viewcmyk.ps my.cmyk 2550\n) print flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
} ifelse
} {
pop
diff --git a/lib/viewjpeg.ps b/lib/viewjpeg.ps
index 71cb5d44..54453fe4 100644
--- a/lib/viewjpeg.ps
+++ b/lib/viewjpeg.ps
@@ -35,6 +35,9 @@
% Usage example:
% (jpeg-6/testimg.jpg) viewJPEG
+% From version 9.50 you must supply permissions for this program
+% to read the input file(s) either by using -dNOSAFER or by
+% supplying --permit-file-read=<filename>
/languagelevel where {pop languagelevel 2 lt}{true} ifelse {
(JPEG needs PostScript Level 2!\n) print flush stop
diff --git a/lib/viewpbm.ps b/lib/viewpbm.ps
index c8d3f86b..143a056a 100644
--- a/lib/viewpbm.ps
+++ b/lib/viewpbm.ps
@@ -327,6 +327,8 @@
( e.g.: gs [-dSCALE=#.#] [-dFITPAGE] [--] viewpbm.ps my.ppm another.ppm\n) print flush
( also -dTAG option can be used to show the pseudo-color tag image from a\n) print flush
( P7 RGB_TAG PAM file created by the bitrgbtags device.\n) print flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
}
ifelse
}
diff --git a/lib/viewpcx.ps b/lib/viewpcx.ps
index 76bfdfae..0b549ad9 100644
--- a/lib/viewpcx.ps
+++ b/lib/viewpcx.ps
@@ -183,6 +183,8 @@
{ cleartomark
(Usage: gs -- viewpcx.ps filename.pcx ...\n) print
( e.g.: gs -- viewpcx.ps my.pcx another.pcx\n) print flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
}
ifelse
}
diff --git a/lib/viewraw.ps b/lib/viewraw.ps
index dee86e02..85438ffa 100644
--- a/lib/viewraw.ps
+++ b/lib/viewraw.ps
@@ -181,6 +181,8 @@
cleartomark
(Usage: gs -- viewraw filename.raw width\n) print
( e.g.: gs -- viewraw my.raw 2550\n) print flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
} ifelse
} {
pop
diff --git a/lib/viewrgb.ps b/lib/viewrgb.ps
index ab2f6d82..c2c34fec 100644
--- a/lib/viewrgb.ps
+++ b/lib/viewrgb.ps
@@ -143,6 +143,8 @@
( e.g.: gs -- viewrgb.ps my.rgb 2550\n) print flush
( -dSCALE=### sets specific scaling \(default = 1.0\)) = flush
( -dBITS=# sets the BitsPerComponent \(1, 2, 8, 12] \(default = 1\)) = flush
+ (From version 9.50 you must supply permissions for this program to read the input file(s)\n) print flush
+ (either by using -dNOSAFER or by supplying --permit-file-read=<filename>\n) = flush
} ifelse
} {
pop
diff --git a/lib/zugferd.ps b/lib/zugferd.ps
index 97d33d4d..d20c39ed 100644
--- a/lib/zugferd.ps
+++ b/lib/zugferd.ps
@@ -455,7 +455,7 @@ ZUGFeRDVersion (2p1) eq {
[ /_objdef {FSDict} /type /dict /OBJ pdfmark
% Fill in the required dictionary elements
[ {FSDict} <<
- /Type /FileSpec
+ /Type /Filespec
/F ZUGFeRDDocumentFileName
/UF ZUGFeRDDocumentFileName SimpleUTF16BE
/Desc (ZUGFeRD electronic invoice)
diff --git a/man/dvipdf.1 b/man/dvipdf.1
index 1b8e87f8..9e19af21 100644
--- a/man/dvipdf.1
+++ b/man/dvipdf.1
@@ -1,4 +1,4 @@
-.TH DVIPDF 1 "4 April 2022" 9.56.1 Ghostscript \" -*- nroff -*-
+.TH DVIPDF 1 "21 September 2022" 10.00.0 Ghostscript \" -*- nroff -*-
.SH NAME
dvipdf \- Convert TeX DVI file to PDF using ghostscript and dvips
.SH SYNOPSIS
@@ -21,7 +21,7 @@ and any options from the command-line.
.SH SEE ALSO
gs(1), dvips(1)
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/gs.1 b/man/gs.1
index 7f7f6cd1..219c9124 100644
--- a/man/gs.1
+++ b/man/gs.1
@@ -1,4 +1,4 @@
-.TH GS 1 "4 April 2022" 9.56.1 Ghostscript \" -*- nroff -*-
+.TH GS 1 "21 September 2022" 10.00.0 Ghostscript \" -*- nroff -*-
.SH NAME
gs \- Ghostscript (PostScript and PDF language interpreter and previewer)
.SH SYNOPSIS
@@ -423,7 +423,7 @@ The various Ghostscript document files (above), especially \fBUse.htm\fR.
See http://bugs.ghostscript.com/ and the Usenet news group
comp.lang.postscript.
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the primary maintainers
of Ghostscript.
diff --git a/man/gslp.1 b/man/gslp.1
index fb55a7c5..ba020b32 100644
--- a/man/gslp.1
+++ b/man/gslp.1
@@ -1,4 +1,4 @@
-.TH GSLP 1 "4 April 2022" 9.56.1 Ghostscript \" -*- nroff -*-
+.TH GSLP 1 "21 September 2022" 10.00.0 Ghostscript \" -*- nroff -*-
.SH NAME
gslp \- Format and print text using ghostscript
.br
@@ -92,7 +92,7 @@ Also, the string %# in a heading or footing is replaced with the page #.
.SH SEE ALSO
gs(1)
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/gsnd.1 b/man/gsnd.1
index dbcad816..e7325d78 100644
--- a/man/gsnd.1
+++ b/man/gsnd.1
@@ -1,4 +1,4 @@
-.TH GSND 1 "4 April 2022" 9.56.1 Ghostscript \" -*- nroff -*-
+.TH GSND 1 "21 September 2022" 10.00.0 Ghostscript \" -*- nroff -*-
.SH NAME
gsnd \- Run ghostscript (PostScript and PDF engine) without display
.SH SYNOPSIS
@@ -12,7 +12,7 @@ flag, followed by any other arguments from the command-line.
.SH SEE ALSO
gs(1)
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/pdf2dsc.1 b/man/pdf2dsc.1
index cf76260a..d1992367 100644
--- a/man/pdf2dsc.1
+++ b/man/pdf2dsc.1
@@ -1,4 +1,4 @@
-.TH PDF2DSC 1 "4 April 2022" 9.56.1 "Ghostscript Tools" \" -*- nroff -*-
+.TH PDF2DSC 1 "21 September 2022" 10.00.0 "Ghostscript Tools" \" -*- nroff -*-
.SH NAME
pdf2dsc \- generate a PostScript page list of a PDF document
.SH SYNOPSIS
@@ -28,6 +28,6 @@ Ghostscript since release 3.53.
.SH SEE ALSO
gs(1), ghostview(1)
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Yves Arrouye <yves.arrouye@usa.net> and Russell Lang gsview at ghostgum.com.au
diff --git a/man/pdf2ps.1 b/man/pdf2ps.1
index 59128d8c..eba734d6 100644
--- a/man/pdf2ps.1
+++ b/man/pdf2ps.1
@@ -1,4 +1,4 @@
-.TH PDF2PS 1 "4 April 2022" 9.56.1 "Ghostscript Tools" \" -*- nroff -*-
+.TH PDF2PS 1 "21 September 2022" 10.00.0 "Ghostscript Tools" \" -*- nroff -*-
.SH NAME
pdf2ps \- Ghostscript PDF to PostScript translator
.SH SYNOPSIS
@@ -14,7 +14,7 @@ LanguageLevel 3 in the output.
Run "\fBgs -h\fR" to find the location of Ghostscript documentation on your
system, from which you can get more details.
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/pf2afm.1 b/man/pf2afm.1
index 464a2435..d7276c89 100644
--- a/man/pf2afm.1
+++ b/man/pf2afm.1
@@ -1,4 +1,4 @@
-.TH PF2AFM 1 "4 April 2022" 9.56.1 Ghostscript \" -*- nroff -*-
+.TH PF2AFM 1 "21 September 2022" 10.00.0 Ghostscript \" -*- nroff -*-
.SH NAME
pf2afm \- Make an AFM file from Postscript (PFB/PFA/PFM) font files using ghostscript
.SH SYNOPSIS
@@ -15,7 +15,7 @@ gs(1)
.br
pf2afm.ps in the Ghostscript lib directory.
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/pfbtopfa.1 b/man/pfbtopfa.1
index fd89d1ea..ece62f62 100644
--- a/man/pfbtopfa.1
+++ b/man/pfbtopfa.1
@@ -1,4 +1,4 @@
-.TH PFBTOPFA 1 "4 April 2022" 9.56.1 Ghostscript \" -*- nroff -*-
+.TH PFBTOPFA 1 "21 September 2022" 10.00.0 Ghostscript \" -*- nroff -*-
.SH NAME
pfbtopfa \- Convert Postscript .pfb fonts to .pfa format using ghostscript
.SH SYNOPSIS
@@ -10,7 +10,7 @@ to convert a .pfb file into a .pfa file.
.SH SEE ALSO
gs(1)
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/printafm.1 b/man/printafm.1
index d449d1f0..6a05fe8b 100644
--- a/man/printafm.1
+++ b/man/printafm.1
@@ -1,4 +1,4 @@
-.TH PRINTAFM 1 "4 April 2022" 9.56.1 Ghostscript \" -*- nroff -*-
+.TH PRINTAFM 1 "21 September 2022" 10.00.0 Ghostscript \" -*- nroff -*-
.SH NAME
printafm \- Print the metrics from a Postscript font in AFM format using ghostscript
.SH SYNOPSIS
@@ -11,7 +11,7 @@ Output goes to stdout.
.SH SEE ALSO
gs(1)
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/ps2ascii.1 b/man/ps2ascii.1
index 1f6c1bae..6d41ecc3 100644
--- a/man/ps2ascii.1
+++ b/man/ps2ascii.1
@@ -1,4 +1,4 @@
-.TH PS2ASCII 1 "4 April 2022" 9.56.1 "Ghostscript Tools" \" -*- nroff -*-
+.TH PS2ASCII 1 "21 September 2022" 10.00.0 "Ghostscript Tools" \" -*- nroff -*-
.SH NAME
ps2ascii \- Ghostscript translator from PostScript or PDF to ASCII
.SH SYNOPSIS
@@ -22,7 +22,7 @@ system, from which you can get more details.
.SH SEE ALSO
pstotext(1), http://www.research.digital.com/SRC/virtualpaper/pstotext.html
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/ps2epsi.1 b/man/ps2epsi.1
index 8592cac1..8be6924e 100644
--- a/man/ps2epsi.1
+++ b/man/ps2epsi.1
@@ -1,4 +1,4 @@
-.TH PS2EPSI 1 "4 April 2022" 9.56.1 "Ghostscript Tools" \" -*- nroff -*-
+.TH PS2EPSI 1 "21 September 2022" 10.00.0 "Ghostscript Tools" \" -*- nroff -*-
.SH NAME
ps2epsi \- generate conforming Encapsulated PostScript
.SH SYNOPSIS
@@ -59,7 +59,7 @@ ps2epsi.ps>the Ghostscript program which does the work
.SH SEE ALSO
gs (1)
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
However, the content may be obsolete, or inconsistent with ps2epsi.txt.
.SH AUTHOR
George Cameron
diff --git a/man/ps2pdf.1 b/man/ps2pdf.1
index 9d4b38fe..0ccbf9ab 100644
--- a/man/ps2pdf.1
+++ b/man/ps2pdf.1
@@ -1,4 +1,4 @@
-.TH PS2PDF 1 "4 April 2022" 9.56.1 Ghostscript \" -*- nroff -*-
+.TH PS2PDF 1 "21 September 2022" 10.00.0 Ghostscript \" -*- nroff -*-
.SH NAME
ps2pdf \- Convert PostScript to PDF using ghostscript
.br
@@ -89,7 +89,7 @@ VectorDevices.htm in the Ghostscript documentation
See http://bugs.ghostscript.com/ and the Usenet news group
comp.lang.postscript.
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/ps2pdfwr.1 b/man/ps2pdfwr.1
index 044817a7..013c856d 100644
--- a/man/ps2pdfwr.1
+++ b/man/ps2pdfwr.1
@@ -1,4 +1,4 @@
-.TH PS2PDFWR 1 "4 April 2022" 9.56.1 Ghostscript \" -*- nroff -*-
+.TH PS2PDFWR 1 "21 September 2022" 10.00.0 Ghostscript \" -*- nroff -*-
.SH NAME
ps2pdfwr \- Convert PostScript to PDF without specifying CompatibilityLevel, using ghostscript
.SH SYNOPSIS
@@ -24,7 +24,7 @@ scripts all invoke this one with the addition of the respective compatibility le
.SH SEE ALSO
gs(1), ps2pdf(1)
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/man/ps2ps.1 b/man/ps2ps.1
index efb68cb3..09450a4d 100644
--- a/man/ps2ps.1
+++ b/man/ps2ps.1
@@ -1,4 +1,4 @@
-.TH PS2PS 1 "4 April 2022" 9.56.1 "Ghostscript Tools" \" -*- nroff -*-
+.TH PS2PS 1 "21 September 2022" 10.00.0 "Ghostscript Tools" \" -*- nroff -*-
.SH NAME
ps2ps, eps2eps \- Ghostscript PostScript "distiller"
.SH SYNOPSIS
@@ -22,7 +22,7 @@ system, from which you can get more details.
.SH SEE ALSO
ps2pdf(1), ps2ascii(1), ps2epsi(1)
.SH VERSION
-This document was last revised for Ghostscript version 9.56.1.
+This document was last revised for Ghostscript version 10.00.0.
.SH AUTHOR
Artifex Software, Inc. are the
primary maintainers of Ghostscript.
diff --git a/pdf/ghostpdf.c b/pdf/ghostpdf.c
index 8d88b090..2dd4c63c 100644
--- a/pdf/ghostpdf.c
+++ b/pdf/ghostpdf.c
@@ -79,10 +79,15 @@ static int pdfi_output_metadata(pdf_context *ctx)
{
int code = 0;
+ if (ctx->filename != NULL)
+ dmprintf2(ctx->memory, "\n %s has %"PRIi64" ", ctx->filename, ctx->num_pages);
+ else
+ dmprintf1(ctx->memory, "\n File has %"PRIi64" ", ctx->num_pages);
+
if (ctx->num_pages > 1)
- dmprintf2(ctx->memory, "\n %s has %"PRIi64" pages\n\n", ctx->filename, ctx->num_pages);
+ dmprintf(ctx->memory, "pages\n\n");
else
- dmprintf2(ctx->memory, "\n %s has %"PRIi64" page.\n\n", ctx->filename, ctx->num_pages);
+ dmprintf(ctx->memory, "page.\n\n");
if (ctx->Info != NULL) {
pdf_name *n = NULL;
@@ -151,6 +156,7 @@ static int pdfi_output_metadata(pdf_context *ctx)
pdfi_countdown(n);
n = NULL;
}
+ dmprintf(ctx->memory, "\n");
return code;
}
@@ -177,7 +183,7 @@ static int pdfi_dump_box(pdf_context *ctx, pdf_dict *page_dict, const char *Key)
if (i != 0)
dmprintf(ctx->memory, " ");
if (code == 0) {
- if (a->values[i]->type == PDF_INT)
+ if (pdfi_type_of(a->values[i]) == PDF_INT)
dmprintf1(ctx->memory, "%"PRIi64"", ((pdf_num *)a->values[i])->value.i);
else
dmprintf1(ctx->memory, "%f", ((pdf_num *)a->values[i])->value.d);
@@ -192,6 +198,90 @@ static int pdfi_dump_box(pdf_context *ctx, pdf_dict *page_dict, const char *Key)
return code;
}
+static int dump_font(pdf_context *ctx, pdf_dict *font_dict, bool space_name)
+{
+ pdf_obj *obj = NULL;
+ char *str = NULL;
+ int len = 0, code = 0, i;
+ bool known = false, type0 = false;
+
+ code = pdfi_dict_get_type(ctx, font_dict, "BaseFont", PDF_NAME, &obj);
+ if (code >= 0) {
+ code = pdfi_string_from_name(ctx, (pdf_name *)obj, &str, &len);
+ if (code >= 0) {
+ dmprintf1(ctx->memory, "%s", str);
+ if (len < 32 && space_name) {
+ for (i = 0; i < 32 - len;i++)
+ dmprintf(ctx->memory, " ");
+ } else
+ dmprintf(ctx->memory, " ");
+ (void)pdfi_free_string_from_name(ctx, str);
+ }
+ pdfi_countdown(obj);
+ obj = NULL;
+ }
+
+ code = pdfi_dict_get_type(ctx, font_dict, "Subtype", PDF_NAME, &obj);
+ if (code >= 0) {
+ code = pdfi_string_from_name(ctx, (pdf_name *)obj, &str, &len);
+ if (code >= 0) {
+ dmprintf1(ctx->memory, "%s", str);
+ for (i = 0; i < 16 - len;i++)
+ dmprintf(ctx->memory, " ");
+ (void)pdfi_free_string_from_name(ctx, str);
+ }
+ if (pdfi_name_is((pdf_name *)obj, "Type0"))
+ type0 = true;
+ pdfi_countdown(obj);
+ obj = NULL;
+ }
+
+ if (!type0) {
+ code = pdfi_dict_get_type(ctx, font_dict, "Embedded", PDF_BOOL, &obj);
+ if (code >= 0) {
+ if (obj == PDF_FALSE_OBJ)
+ dmprintf(ctx->memory, "Not embedded ");
+ else
+ dmprintf(ctx->memory, "Embedded ");
+ pdfi_countdown(obj);
+ obj = NULL;
+ }
+ else
+ dmprintf(ctx->memory, "Not embedded ");
+ } else
+ dmprintf(ctx->memory, " ");
+
+ code = pdfi_dict_get_type(ctx, font_dict, "ToUnicode", PDF_BOOL, &obj);
+ if (code >= 0) {
+ if (obj == PDF_TRUE_OBJ)
+ dmprintf(ctx->memory, "Has ToUnicode ");
+ else
+ dmprintf(ctx->memory, "No ToUnicode ");
+ pdfi_countdown(obj);
+ obj = NULL;
+ }
+ else
+ dmprintf(ctx->memory, "No ToUnicode ");
+
+ code = pdfi_dict_known(ctx, font_dict, "Descendants", &known);
+ if (code >= 0 && known) {
+ code = pdfi_dict_get_type(ctx, font_dict, "Descendants", PDF_ARRAY, &obj);
+ if (code >= 0) {
+ pdf_obj *desc = NULL;
+
+ code = pdfi_array_get_type(ctx, (pdf_array *)obj, 0, PDF_DICT, &desc);
+ if (code >= 0) {
+ dmprintf(ctx->memory, "\n Descendants: [");
+ (void)dump_font(ctx, (pdf_dict *)desc, false);
+ dmprintf(ctx->memory, "]");
+ }
+ pdfi_countdown(obj);
+ obj = NULL;
+ }
+ }
+ return 0;
+}
+
/*
* This routine along with pdfi_output_metadtaa above, dumps certain kinds
* of metadata from the PDF file, and from each page in the PDF file. It is
@@ -202,12 +292,13 @@ static int pdfi_dump_box(pdf_context *ctx, pdf_dict *page_dict, const char *Key)
* we always emit them, and the switches -dDumpFontsNeeded, -dDumpXML,
* -dDumpFontsUsed and -dShowEmbeddedFonts are not implemented at all yet.
*/
-static int pdfi_output_page_info(pdf_context *ctx, uint64_t page_num)
+int pdfi_output_page_info(pdf_context *ctx, uint64_t page_num)
{
int code;
bool known = false;
double f;
pdf_dict *page_dict = NULL;
+ pdf_array *fonts_array = NULL, *spots_array = NULL;
code = pdfi_page_get_dict(ctx, page_num, &page_dict);
if (code < 0)
@@ -271,7 +362,7 @@ static int pdfi_output_page_info(pdf_context *ctx, uint64_t page_num)
return code;
}
- code = pdfi_check_page(ctx, page_dict, false);
+ code = pdfi_check_page(ctx, page_dict, &fonts_array, &spots_array, false);
if (code < 0) {
if (ctx->args.pdfstoponerror)
return code;
@@ -283,16 +374,62 @@ static int pdfi_output_page_info(pdf_context *ctx, uint64_t page_num)
code = pdfi_dict_known(ctx, page_dict, "Annots", &known);
if (code < 0) {
if (code != gs_error_undefined && ctx->args.pdfstoponerror)
- return code;
+ goto error;
} else {
if (known == true)
dmprintf(ctx->memory, " Page contains Annotations");
+ code = 0;
+ }
+
+ if (spots_array != NULL) {
+ uint64_t index = 0;
+ pdf_name *spot = NULL;
+ char *str = NULL;
+ int len;
+
+ dmprintf(ctx->memory, "\n Page Spot colors: \n");
+ for (index = 0;index < pdfi_array_size(spots_array);index++) {
+ code = pdfi_array_get(ctx, spots_array, index, (pdf_obj **)&spot);
+ if (code >= 0) {
+ if (pdfi_type_of(spot) == PDF_NAME) {
+ code = pdfi_string_from_name(ctx, spot, &str, &len);
+ if (code >= 0) {
+ dmprintf1(ctx->memory, " '%s'\n", str);
+ (void)pdfi_free_string_from_name(ctx, str);
+ }
+ }
+ pdfi_countdown(spot);
+ spot = NULL;
+ }
+ }
+ code = 0;
}
+ if (fonts_array != NULL && pdfi_array_size(fonts_array) != 0) {
+ uint64_t index = 0;
+ pdf_dict *font_dict = NULL;
+
+ dmprintf(ctx->memory, "\n Fonts used: \n");
+ for (index = 0;index < pdfi_array_size(fonts_array);index++) {
+ code = pdfi_array_get_type(ctx, fonts_array, index, PDF_DICT, (pdf_obj **)&font_dict);
+ if (code >= 0) {
+ dmprintf(ctx->memory, " ");
+ (void)dump_font(ctx, font_dict, true);
+ dmprintf(ctx->memory, "\n");
+ pdfi_countdown(font_dict);
+ font_dict = NULL;
+ }
+ }
+ code = 0;
+ }
+
+error:
+ pdfi_countdown(fonts_array);
+ pdfi_countdown(spots_array);
dmprintf(ctx->memory, "\n\n");
pdfi_countdown(page_dict);
- return 0;
+ return code;
}
/* Error and warning string tables. There should be a string for each error and warning
@@ -347,6 +484,8 @@ const char *gs_error_strings[] = {
"unregistered",
"invalidcontext",
"invalidid",
+ "pdf_stackoverflow",
+ "circular reference"
};
const char *gs_internal_error_strings[] = {
@@ -358,16 +497,15 @@ const char *gs_internal_error_strings[] = {
"exec stack underflow",
"VMreclaim",
"Need input",
+ "need file",
"No defined error",
"No defined error (2)",
- "need file",
"error info",
"handled",
- "circular reference"
};
-#define LASTNORMALGSERROR gs_error_invalidid * -1
+#define LASTNORMALGSERROR gs_error_circular_reference * -1
#define FIRSTINTERNALERROR gs_error_hit_detected * -1
-#define LASTGSERROR gs_error_circular_reference * -1
+#define LASTGSERROR gs_error_handled * -1
void pdfi_verbose_error(pdf_context *ctx, int gs_error, const char *gs_lib_function, int pdfi_error, const char *pdfi_function_name, const char *extra_info)
{
@@ -784,7 +922,7 @@ int pdfi_prep_collection(pdf_context *ctx, uint64_t *TotalFiles, char ***names_a
if (code < 0)
goto exit;
- if (File->type == PDF_DICT) {
+ if (pdfi_type_of(File) == PDF_DICT) {
if (pdfi_dict_knownget_type(ctx, (pdf_dict *)File, "EF", PDF_DICT, &EF)) {
if (pdfi_dict_knownget_type(ctx, (pdf_dict *)EF, "F", PDF_STREAM, &F)) {
pdf_dict *stream_dict = NULL;
@@ -859,7 +997,7 @@ int pdfi_prep_collection(pdf_context *ctx, uint64_t *TotalFiles, char ***names_a
/* Create an entry for the Description in the names array */
code = pdfi_array_get(ctx, FileNames, ix * 2, (pdf_obj **)&Name);
if (code >= 0) {
- if (Name->type == PDF_STRING) {
+ if (pdfi_type_of((pdf_obj *)Name) == PDF_STRING) {
working_array[(index * 2) + 1] = (char *)gs_alloc_bytes(ctx->memory, Name->length + 3, "Collection file names array entry");
if (working_array[(index * 2) + 1] != NULL) {
memset(working_array[(index * 2) + 1], 0x00, Name->length + 3);
@@ -999,6 +1137,13 @@ int pdfi_process_pdf_file(pdf_context *ctx, char *filename)
else
code = pdfi_process(ctx);
+ /* Pdfmark_InitialPage is the offset for Page Dests in
+ * /Outlines and Link annotations. It is the count of pages
+ * processed so far. Update it by the number of pages in
+ * this file.
+ */
+ ctx->Pdfmark_InitialPage += ctx->num_pages;
+
pdfi_close_pdf_file(ctx);
return code;
}
@@ -1037,9 +1182,14 @@ static int pdfi_init_file(pdf_context *ctx)
if (code < 0 && code != gs_error_undefined)
goto exit;
if (code == 0) {
- code = pdfi_initialise_Decryption(ctx);
- if (code < 0)
- goto exit;
+ if (pdfi_type_of(o) == PDF_DICT) {
+ code = pdfi_initialise_Decryption(ctx);
+ if (code < 0)
+ goto exit;
+ } else {
+ if (pdfi_type_of(o) != PDF_NULL)
+ pdfi_set_error(ctx, code, NULL, E_PDF_BADENCRYPT, "pdfi_init_file", NULL);
+ }
}
}
@@ -1144,6 +1294,7 @@ int pdfi_set_input_stream(pdf_context *ctx, stream *stm)
}
/* Determine file size */
+ pdfi_seek(ctx, ctx->main_stream, 0, SEEK_SET);
pdfi_seek(ctx, ctx->main_stream, 0, SEEK_END);
ctx->main_stream_length = pdfi_tell(ctx->main_stream);
Offset = BUF_SIZE;
@@ -1268,8 +1419,15 @@ int pdfi_set_input_stream(pdf_context *ctx, stream *stm)
*/
if (last_lineend) {
leftover = last_lineend - Buffer;
- memmove(Buffer + bytes - leftover, last_lineend, leftover);
- bytes -= leftover;
+ /* Ensure we don't try to copy more than half a buffer, because that will
+ * end up overrunning the buffer end. Since we are only doing this to
+ * ensure we don't drop a partial 'startxref' that's far more than enough.
+ */
+ if (leftover < BUF_SIZE / 2) {
+ memmove(Buffer + bytes - leftover, last_lineend, leftover);
+ bytes -= leftover;
+ } else
+ leftover = 0;
} else
leftover = 0;
}
@@ -1757,6 +1915,15 @@ int pdfi_clear_context(pdf_context *ctx)
dmprintf1(ctx->memory, "Normal object cache hit rate: %f\n", hit_rate);
dmprintf1(ctx->memory, "Compressed object cache hit rate: %f\n", compressed_hit_rate);
#endif
+ if (ctx->PathSegments != NULL) {
+ gs_free_object(ctx->memory, ctx->PathSegments, "pdfi_clear_context");
+ ctx->PathSegments = NULL;
+ }
+ if (ctx->PathPts != NULL) {
+ gs_free_object(ctx->memory, ctx->PathPts, "pdfi_clear_context");
+ ctx->PathPts = NULL;
+ }
+
if (ctx->args.PageList) {
gs_free_object(ctx->memory, ctx->args.PageList, "pdfi_clear_context");
ctx->args.PageList = NULL;
@@ -1786,14 +1953,19 @@ int pdfi_clear_context(pdf_context *ctx)
ctx->PagesTree = NULL;
}
- if (ctx->args.cidsubstpath.data != NULL) {
- gs_free_object(ctx->memory, ctx->args.cidsubstpath.data, "cidsubstpath.data");
- ctx->args.cidsubstpath.data = NULL;
+ if (ctx->args.cidfsubstpath.data != NULL) {
+ gs_free_object(ctx->memory, ctx->args.cidfsubstpath.data, "cidfsubstpath.data");
+ ctx->args.cidfsubstpath.data = NULL;
+ }
+
+ if (ctx->args.cidfsubstfont.data != NULL) {
+ gs_free_object(ctx->memory, ctx->args.cidfsubstfont.data, "cidfsubstfont.data");
+ ctx->args.cidfsubstfont.data = NULL;
}
- if (ctx->args.cidsubstfont.data != NULL) {
- gs_free_object(ctx->memory, ctx->args.cidsubstfont.data, "cidsubstpath.data");
- ctx->args.cidsubstfont.data = NULL;
+ if (ctx->args.defaultfont.data != NULL) {
+ gs_free_object(ctx->memory, ctx->args.defaultfont.data, "cidfsubstfont.data");
+ ctx->args.defaultfont.data = NULL;
}
pdfi_free_cstring_array(ctx, &ctx->args.showannottypes);
@@ -1923,6 +2095,8 @@ int pdfi_clear_context(pdf_context *ctx)
ctx->pdffontmap = NULL;
pdfi_countdown(ctx->pdfnativefontmap);
ctx->pdfnativefontmap = NULL;
+ pdfi_countdown(ctx->pdf_substitute_fonts);
+ ctx->pdf_substitute_fonts = NULL;
return 0;
}
diff --git a/pdf/ghostpdf.h b/pdf/ghostpdf.h
index 49c91808..1c2ffe78 100644
--- a/pdf/ghostpdf.h
+++ b/pdf/ghostpdf.h
@@ -22,6 +22,12 @@
#define BUF_SIZE 2048
+/* Limit nesting of arrays and dictionaries. We don't want to allow this
+ * to be unbounded, because on exit we could end up exceeding the C execution stack
+ * if we get too deeply nested.
+ */
+#define MAX_NESTING_DEPTH 100
+
#include "pdf_types.h"
#if defined(MEMENTO)
@@ -143,8 +149,11 @@ typedef struct cmd_args_s {
bool QUIET;
bool verbose_errors;
bool verbose_warnings;
- gs_string cidsubstpath;
- gs_string cidsubstfont;
+ gs_string cidfsubstpath;
+ gs_string cidfsubstfont;
+ gs_string defaultfont;
+ bool defaultfont_is_name;
+
bool ignoretounicode;
bool nonativefontmap;
} cmd_args_t;
@@ -321,6 +330,11 @@ typedef struct pdf_context_s
/* Doing a high level form for pdfwrite (annotations) */
bool PreservePDFForm;
+ /* If processing multiple files, the number of pages to add to /Page Destinations
+ * when handling Outlines and Annotations. This is the number of pages in all
+ * files completely processed so far.
+ */
+ int Pdfmark_InitialPage;
/* Optional things from Root */
pdf_dict *OCProperties;
@@ -339,6 +353,27 @@ typedef struct pdf_context_s
gs_font_dir * font_dir;
/* Obviously we need a graphics state */
gs_gstate *pgs;
+
+ /* PDF really doesn't have a path in the graphics state. This is different to
+ * PostScript and has implications; changing the CTM partway through path
+ * construction affects path segments already accumulated. The path is
+ * unaffected by gsvae and grestore. Previously we've unwound any pending
+ * path and rerun it, this is causing problems so instead we'll do what
+ * Acrobat obviously does and build the path outside the graphics state
+ */
+ /* We make allocations in chunks for the path to avoid lots of little
+ * allocations, but we need to know where the end of the current allocation
+ * is so that we can tell if we would overflow and increase it.
+ */
+ char *PathSegments;
+ /* The current insertion point. */
+ char *PathSegmentsCurrent;
+ /* The current limit of the block */
+ char *PathSegmentsTop;
+ double *PathPts;
+ double *PathPtsCurrent;
+ double *PathPtsTop;
+
/* set up by pdf_impl_set_device, this is the 'high water mark' for
* restoring back to when we close a PDF file. This ensures the device
* is correctly set up for any subesquent file to be run.
@@ -406,6 +441,12 @@ typedef struct pdf_context_s
uint32_t loop_detection_entries;
uint64_t *loop_detection;
+ /* A counter for nesting of arrays and dictionaries. We don't want to allow this
+ * to be unbounded, because on exit we could end up exceeding the C execution stack
+ * if we get too deeply nested.
+ */
+ uint32_t object_nesting;
+
/* Used to set the 'parent' stream of a stream that gets created by dereferencing
* We should not need this but badly fromed PDF files can use Resources defined in
* an earlier (non-Page) stream object, and Acrobat handles this, so we need to.
@@ -423,6 +464,7 @@ typedef struct pdf_context_s
search_paths_t search_paths;
pdf_dict *pdffontmap;
pdf_dict *pdfnativefontmap; /* Explicit mappings take precedence, hence we need separate dictionaries */
+ pdf_dict *pdf_substitute_fonts;
pdf_dict *pdfcidfmap;
/* These function pointers can be replaced by ones intended to replicate
@@ -468,6 +510,7 @@ int pdfi_prep_collection(pdf_context *ctx, uint64_t *TotalFiles, char ***names_a
int pdfi_close_pdf_file(pdf_context *ctx);
int pdfi_gstate_from_PS(pdf_context *ctx, gs_gstate *pgs, pdfi_switch_t *i_switch, gsicc_profile_cache_t *profile_cache);
void pdfi_gstate_to_PS(pdf_context *ctx, gs_gstate *pgs, pdfi_switch_t *i_switch);
+int pdfi_output_page_info(pdf_context *ctx, uint64_t page_num);
void pdfi_report_errors(pdf_context *ctx);
void pdfi_verbose_error(pdf_context *ctx, int gs_error, const char *gs_lib_function, int pdfi_error, const char *pdfi_function_name, const char *extra_info);
diff --git a/pdf/pdf.mak b/pdf/pdf.mak
index 7040a72e..118a0b7d 100644
--- a/pdf/pdf.mak
+++ b/pdf/pdf.mak
@@ -188,7 +188,7 @@ $(PDFOBJ)pdf_stack.$(OBJ): $(PDFSRC)pdf_stack.c $(PDFINCLUDES) $(PDF_MAK) $(MAKE
$(PDFOBJ)pdf_gstate.$(OBJ): $(PDFSRC)pdf_gstate.c $(PDFINCLUDES) $(gsstate_h) \
$(gsmatrix_h) $(gslparam_h) $(gstparam_h) $(gxdht_h) $(gxht_h) $(gzht_h) $(gsht_h) \
- $(gscoord_h) $(gsutil_h) $(gscolor3_h) $(PDF_MAK) $(MAKEDIRS)
+ $(gscoord_h) $(gsutil_h) $(gscolor3_h) $(PDF_MAK) $(MAKEDIRS) $(gzpath_h) $(gspenum_h)
$(PDFCCC) $(PDFSRC)pdf_gstate.c $(PDFO_)pdf_gstate.$(OBJ)
$(PDFOBJ)pdf_colour.$(OBJ): $(PDFSRC)pdf_colour.c $(PDFINCLUDES) \
diff --git a/pdf/pdf_annot.c b/pdf/pdf_annot.c
index 7b96be1c..83b79293 100644
--- a/pdf/pdf_annot.c
+++ b/pdf/pdf_annot.c
@@ -269,7 +269,7 @@ static int pdfi_annot_draw_AP(pdf_context *ctx, pdf_dict *annot, pdf_obj *NormAP
if (NormAP == NULL)
return 0;
- if (NormAP->type != PDF_STREAM)
+ if (pdfi_type_of(NormAP) != PDF_STREAM)
return_error(gs_error_typecheck);
code = pdfi_op_q(ctx);
@@ -649,11 +649,55 @@ static int pdfi_form_get_inheritable(pdf_context *ctx, pdf_dict *field, const ch
{
int code = 0;
pdf_dict *Parent = NULL;
+ bool known = false;
/* Check this field */
code = pdfi_dict_knownget_type(ctx, field, Key, type, o);
- if (code != 0) goto exit;
+ if (code != 0) goto exit1;
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0)
+ goto exit;
+
+ /* Check for Parent. Do not store the dereferenced Parent back to the dictionary
+ * as this can cause circular references.
+ */
+ code = pdfi_dict_known(ctx, field, "Parent", &known);
+ if (code >= 0 && known == true)
+ {
+ code = pdfi_dict_get_no_store_R(ctx, field, "Parent", (pdf_obj **)&Parent);
+ if (code < 0)
+ goto exit;
+
+ if (pdfi_type_of(Parent) != PDF_DICT) {
+ if (pdfi_type_of(Parent) == PDF_INDIRECT) {
+ pdf_indirect_ref *o = (pdf_indirect_ref *)Parent;
+
+ code = pdfi_dereference(ctx, o->ref_object_num, o->ref_generation_num, (pdf_obj **)&Parent);
+ pdfi_countdown(o);
+ goto exit;
+ } else {
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
+ }
+ }
+ if (Parent->object_num != 0) {
+ code = pdfi_loop_detector_add_object(ctx, Parent->object_num);
+ if (code < 0)
+ goto exit;
+ }
+ code = pdfi_form_get_inheritable(ctx, Parent, Key, type, o);
+ if (code <= 0) {
+ if (ctx->AcroForm)
+ code = pdfi_dict_knownget_type(ctx, ctx->AcroForm, Key, type, o);
+ }
+ } else {
+ /* No Parent, so check AcroForm, if any */
+ if (ctx->AcroForm)
+ code = pdfi_dict_knownget_type(ctx, ctx->AcroForm, Key, type, o);
+ }
+
+#if 0
/* If not found, recursively check Parent, if any */
code = pdfi_dict_knownget_type(ctx, field, "Parent", PDF_DICT, (pdf_obj **)&Parent);
if (code < 0) goto exit;
@@ -665,8 +709,12 @@ static int pdfi_form_get_inheritable(pdf_context *ctx, pdf_dict *field, const ch
if (ctx->AcroForm)
code = pdfi_dict_knownget_type(ctx, ctx->AcroForm, Key, type, o);
}
+#endif
- exit:
+exit:
+ (void)pdfi_loop_detector_cleartomark(ctx);
+
+exit1:
pdfi_countdown(Parent);
return code;
}
@@ -1475,11 +1523,13 @@ static int pdfi_annot_draw_LE(pdf_context *ctx, pdf_dict *annot,
double dx, dy;
double angle;
int code;
+ pdf_obj_type type;
code = pdfi_dict_knownget(ctx, annot, "LE", (pdf_obj **)&LE);
if (code <= 0)
goto exit;
- if (LE->type != PDF_ARRAY && LE->type != PDF_NAME) {
+ type = pdfi_type_of(LE);
+ if (type != PDF_ARRAY && type != PDF_NAME) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -1490,7 +1540,7 @@ static int pdfi_annot_draw_LE(pdf_context *ctx, pdf_dict *annot,
if (code < 0)
angle = 0;
- if (LE->type == PDF_ARRAY) {
+ if (type == PDF_ARRAY) {
code = pdfi_array_get_type(ctx, (pdf_array *)LE, 0, PDF_NAME, (pdf_obj **)&LE1);
if (code < 0) goto exit;
@@ -1554,34 +1604,35 @@ static int pdfi_annot_get_NormAP(pdf_context *ctx, pdf_dict *annot, pdf_obj **No
/* Nothing found */
if (code == 0) goto exit;
- if (baseAP->type == PDF_STREAM) {
- /* Use baseAP for the AP */
- AP = (pdf_stream *)baseAP;
- baseAP = NULL;
- } else {
- if (baseAP->type != PDF_DICT) {
- code = gs_error_typecheck;
- goto exit;
- }
-
- code = pdfi_dict_knownget_type(ctx, annot, "AS", PDF_NAME, (pdf_obj **)&AS);
- if (code < 0) goto exit;
- if (code == 0) {
- pdfi_set_warning(ctx, 0, NULL, W_PDF_ANNOT_AP_ERROR, "pdfi_annot_get_NormAP", "WARNING Annotation has non-stream AP but no AS. Don't know what to render");
- goto exit;
- }
+ switch (pdfi_type_of(baseAP)) {
+ case PDF_STREAM:
+ /* Use baseAP for the AP */
+ AP = (pdf_stream *)baseAP;
+ baseAP = NULL;
+ break;
+ case PDF_DICT:
+ code = pdfi_dict_knownget_type(ctx, annot, "AS", PDF_NAME, (pdf_obj **)&AS);
+ if (code < 0) goto exit;
+ if (code == 0) {
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_ANNOT_AP_ERROR, "pdfi_annot_get_NormAP", "WARNING Annotation has non-stream AP but no AS. Don't know what to render");
+ goto exit;
+ }
- /* Lookup the AS in the NormAP and use that as the AP */
- code = pdfi_dict_get_by_key(ctx, (pdf_dict *)baseAP, AS, (pdf_obj **)&AP);
- if (code < 0) {
- /* Apparently this is not an error, just silently don't have an AP */
- code = 0;
- goto exit;
- }
- if (AP->type != PDF_STREAM) {
- code = gs_note_error(gs_error_typecheck);
+ /* Lookup the AS in the NormAP and use that as the AP */
+ code = pdfi_dict_get_by_key(ctx, (pdf_dict *)baseAP, AS, (pdf_obj **)&AP);
+ if (code < 0) {
+ /* Apparently this is not an error, just silently don't have an AP */
+ code = 0;
+ goto exit;
+ }
+ if (pdfi_type_of(AP) != PDF_STREAM) {
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
+ }
+ break;
+ default:
+ code = gs_error_typecheck;
goto exit;
- }
}
*NormAP = (pdf_obj *)AP;
@@ -3630,9 +3681,9 @@ static int pdfi_annot_draw_Widget(pdf_context *ctx, pdf_dict *annot, pdf_obj *No
{
int code = 0;
bool found_T = false;
- bool found_TF = false;
+ bool found_FT = false, known = false;
pdf_obj *T = NULL;
- pdf_obj *TF = NULL;
+ pdf_obj *FT = NULL;
pdf_dict *Parent = NULL;
pdf_dict *currdict = NULL;
@@ -3651,33 +3702,71 @@ static int pdfi_annot_draw_Widget(pdf_context *ctx, pdf_dict *annot, pdf_obj *No
/* TODO: See top part of pdf_draw.ps/drawwidget
* check for /FT and /T and stuff
*/
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0)
+ goto exit;
+
currdict = annot;
pdfi_countup(currdict);
while (true) {
+ if (currdict->object_num != 0) {
+ code = pdfi_loop_detector_add_object(ctx, currdict->object_num);
+ if (code < 0)
+ break;
+ }
+
code = pdfi_dict_knownget(ctx, currdict, "T", &T);
if (code < 0) goto exit;
if (code > 0) {
found_T = true;
- break;
+ pdfi_countdown(T);
+ T = NULL;
+ if (found_FT)
+ break;
}
- code = pdfi_dict_knownget(ctx, currdict, "TF", &TF);
+ code = pdfi_dict_knownget(ctx, currdict, "FT", &FT);
if (code < 0) goto exit;
if (code > 0) {
- found_TF = true;
- break;
+ found_FT = true;
+ pdfi_countdown(FT);
+ FT = NULL;
+ if (found_T)
+ break;
}
- /* Check for Parent */
- code = pdfi_dict_knownget_type(ctx, currdict, "Parent", PDF_DICT, (pdf_obj **)&Parent);
- if (code < 0) goto exit;
- if (code == 0)
+ /* Check for Parent. Do not store the dereferenced Parent back to the dictionary
+ * as this can cause circular references.
+ */
+ code = pdfi_dict_known(ctx, currdict, "Parent", &known);
+ if (code >= 0 && known == true)
+ {
+ code = pdfi_dict_get_no_store_R(ctx, currdict, "Parent", (pdf_obj **)&Parent);
+ if (code < 0) {
+ (void)pdfi_loop_detector_cleartomark(ctx);
+ goto exit;
+ }
+ if (pdfi_type_of(Parent) != PDF_DICT) {
+ if (pdfi_type_of(Parent) == PDF_INDIRECT) {
+ pdf_indirect_ref *o = (pdf_indirect_ref *)Parent;
+
+ code = pdfi_dereference(ctx, o->ref_object_num, o->ref_generation_num, (pdf_obj **)&Parent);
+ pdfi_countdown(o);
+ if (code < 0)
+ break;
+ } else {
+ break;
+ }
+ }
+ pdfi_countdown(currdict);
+ currdict = Parent;
+ Parent = NULL;
+ } else
break;
- pdfi_countdown(currdict);
- currdict = Parent;
- pdfi_countup(currdict);
}
+ (void)pdfi_loop_detector_cleartomark(ctx);
+
code = 0;
- if (!found_T && !found_TF) {
+ if (!found_T || !found_FT) {
*render_done = true;
dmprintf(ctx->memory, "**** Warning: A Widget annotation dictionary lacks either the FT or T key.\n");
dmprintf(ctx->memory, " Acrobat ignores such annoataions, annotation will not be rendered.\n");
@@ -3696,8 +3785,6 @@ static int pdfi_annot_draw_Widget(pdf_context *ctx, pdf_dict *annot, pdf_obj *No
*render_done = true;
exit:
- pdfi_countdown(T);
- pdfi_countdown(TF);
pdfi_countdown(Parent);
pdfi_countdown(currdict);
return code;
@@ -3950,7 +4037,7 @@ static int pdfi_annot_preserve_modQP(pdf_context *ctx, pdf_dict *annot, pdf_name
code = pdfi_dict_get(ctx, annot, "QuadPoints", (pdf_obj **)&QP);
if (code < 0) goto exit;
- if (QP->type != PDF_ARRAY) {
+ if (pdfi_type_of(QP) != PDF_ARRAY) {
/* Invalid QuadPoints, just delete it because I dunno what to do...
* TODO: Should flag a warning here
*/
@@ -4024,7 +4111,7 @@ static int pdfi_annot_preserve_modAP(pdf_context *ctx, pdf_dict *annot, pdf_name
code = pdfi_dict_get(ctx, annot, "AP", (pdf_obj **)&AP);
if (code < 0) goto exit;
- if (AP->type != PDF_DICT) {
+ if (pdfi_type_of(AP) != PDF_DICT) {
/* This is an invalid AP, we will flag and delete it below */
found_ap = false;
goto exit;
@@ -4037,14 +4124,14 @@ static int pdfi_annot_preserve_modAP(pdf_context *ctx, pdf_dict *annot, pdf_name
if (code < 0) goto exit;
/* Handle indirect object */
- if (Value->type != PDF_INDIRECT)
+ if (pdfi_type_of(Value) != PDF_INDIRECT)
goto loop_continue;
/* Dereference it */
code = pdfi_dereference(ctx, Value->ref_object_num, Value->ref_generation_num, &object);
if (code < 0) goto exit;
- if (object->type == PDF_STREAM) {
+ if (pdfi_type_of(object) == PDF_STREAM) {
/* Get a form label */
code = pdfi_annot_preserve_nextformlabel(ctx, &labeldata, &labellen);
if (code < 0) goto exit;
diff --git a/pdf/pdf_array.c b/pdf/pdf_array.c
index 5f269fe5..0cdb3365 100644
--- a/pdf/pdf_array.c
+++ b/pdf/pdf_array.c
@@ -20,6 +20,7 @@
#include "pdf_stack.h"
#include "pdf_deref.h"
#include "pdf_array.h"
+#include "pdf_loop_detect.h"
/* NOTE: I think this should take a pdf_context param, but it's not available where it's
* called, would require some surgery.
@@ -40,7 +41,6 @@ void pdfi_free_array(pdf_obj *o)
int pdfi_array_alloc(pdf_context *ctx, uint64_t size, pdf_array **a)
{
int code, i;
- pdf_obj *n = NULL;
*a = NULL;
code = pdfi_object_alloc(ctx, PDF_ARRAY, size, (pdf_obj **)a);
@@ -50,22 +50,14 @@ int pdfi_array_alloc(pdf_context *ctx, uint64_t size, pdf_array **a)
(*a)->size = size;
if (size > 0) {
- /* Make a null object */
- code = pdfi_object_alloc(ctx, PDF_NULL, 1, &n);
- if (code < 0) {
- pdfi_free_object((pdf_obj *)(*a));
- *a = NULL;
- return code;
- }
- /* And start all the array entries pointing at that null object.
+ /* Start all the array entries pointing to null.
* array_put will replace tehm. This ensures we always have a valid
* object for every entry. pdfi_array_from_stack() doesn't do this
* initialisation because we know how many obejcts there are in the array
* and we have valid objects for each entry on the stack already created.
*/
for (i=0;i<size;i++){
- (*a)->values[i] = n;
- pdfi_countup(n);
+ (*a)->values[i] = PDF_NULL_OBJ;
}
}
return 0;
@@ -118,6 +110,48 @@ int pdfi_array_from_stack(pdf_context *ctx, uint32_t indirect_num, uint32_t indi
return code;
}
+int pdfi_array_fetch_recursing(pdf_context *ctx, pdf_array *a, uint64_t index, pdf_obj **o, bool setref, bool cache)
+{
+ int code;
+ pdf_obj *obj;
+
+ *o = NULL;
+
+ if (pdfi_type_of(a) != PDF_ARRAY)
+ return_error(gs_error_typecheck);
+
+ if (index >= a->size)
+ return_error(gs_error_rangecheck);
+ obj = a->values[index];
+
+ if (pdfi_type_of(obj) == PDF_INDIRECT) {
+ pdf_obj *o1 = NULL;
+ pdf_indirect_ref *r = (pdf_indirect_ref *)obj;
+
+ if (r->ref_object_num == a->object_num)
+ return_error(gs_error_circular_reference);
+
+ if (cache)
+ code = pdfi_deref_loop_detect(ctx, r->ref_object_num, r->ref_generation_num, &o1);
+ else
+ code = pdfi_deref_loop_detect_nocache(ctx, r->ref_object_num, r->ref_generation_num, &o1);
+ if (code < 0)
+ return code;
+
+ if (setref)
+ (void)pdfi_array_put(ctx, a, index, o1);
+ obj = o1;
+ } else {
+ if (ctx->loop_detection != NULL && (uintptr_t)obj > TOKEN__LAST_KEY && obj->object_num != 0)
+ if (pdfi_loop_detector_check_object(ctx, obj->object_num))
+ return gs_note_error(gs_error_circular_reference);
+ pdfi_countup(obj);
+ }
+
+ *o = obj;
+ return 0;
+}
+
/* Fetch object from array, resolving indirect reference if needed
* setref -- indicates whether to replace indirect ref with the object
*/
@@ -128,14 +162,14 @@ int pdfi_array_fetch(pdf_context *ctx, pdf_array *a, uint64_t index, pdf_obj **o
*o = NULL;
- if (a->type != PDF_ARRAY)
+ if (pdfi_type_of(a) != PDF_ARRAY)
return_error(gs_error_typecheck);
if (index >= a->size)
return_error(gs_error_rangecheck);
obj = a->values[index];
- if (obj->type == PDF_INDIRECT) {
+ if (pdfi_type_of(obj) == PDF_INDIRECT) {
pdf_obj *o1 = NULL;
pdf_indirect_ref *r = (pdf_indirect_ref *)obj;
@@ -166,7 +200,7 @@ int pdfi_array_fetch(pdf_context *ctx, pdf_array *a, uint64_t index, pdf_obj **o
*/
int pdfi_array_get_no_deref(pdf_context *ctx, pdf_array *a, uint64_t index, pdf_obj **o)
{
- if (a->type != PDF_ARRAY)
+ if (pdfi_type_of(a) != PDF_ARRAY)
return_error(gs_error_typecheck);
if (index >= a->size)
@@ -201,7 +235,7 @@ int pdfi_array_get_type(pdf_context *ctx, pdf_array *a, uint64_t index,
if (code < 0)
return code;
- if ((*o)->type != type) {
+ if (pdfi_type_of(*o) != type) {
pdfi_countdown(*o);
*o = NULL;
return_error(gs_error_typecheck);
@@ -212,34 +246,26 @@ int pdfi_array_get_type(pdf_context *ctx, pdf_array *a, uint64_t index,
int pdfi_array_get_int(pdf_context *ctx, pdf_array *a, uint64_t index, int64_t *i)
{
int code;
- pdf_num *n;
+ pdf_obj *n;
- code = pdfi_array_get_type(ctx, a, index, PDF_INT, (pdf_obj **)&n);
+ code = pdfi_array_get(ctx, a, index, &n);
if (code < 0)
return code;
- *i = n->value.i;
+ code = pdfi_obj_to_int(ctx, n, i);
pdfi_countdown(n);
- return 0;
+ return code;
}
-int pdfi_array_get_number(pdf_context *ctx, pdf_array *a, uint64_t index, double *f)
+int pdfi_array_get_number(pdf_context *ctx, pdf_array *a, uint64_t index, double *d)
{
int code;
- pdf_num *n;
+ pdf_obj *n;
- code = pdfi_array_get(ctx, a, index, (pdf_obj **)&n);
+ code = pdfi_array_get(ctx, a, index, &n);
if (code < 0)
return code;
- if (n->type == PDF_INT)
- *f = (double)n->value.i;
- else {
- if (n->type == PDF_REAL)
- *f = n->value.d;
- else {
- code = gs_note_error(gs_error_typecheck);
- }
- }
+ code = pdfi_obj_to_real(ctx, n, d);
pdfi_countdown(n);
return code;
@@ -253,7 +279,7 @@ bool pdfi_array_known(pdf_context *ctx, pdf_array *a, pdf_obj *o, int *index)
{
int i;
- if (a->type != PDF_ARRAY)
+ if (pdfi_type_of(a) != PDF_ARRAY)
return_error(gs_error_typecheck);
for (i=0; i < a->size; i++) {
@@ -263,7 +289,7 @@ bool pdfi_array_known(pdf_context *ctx, pdf_array *a, pdf_obj *o, int *index)
code = pdfi_array_fetch(ctx, a, i, &val, true, true);
if (code < 0)
continue;
- if (val->object_num == o->object_num) {
+ if (pdf_object_num(val) == pdf_object_num(o)) {
if (index != NULL) *index = i;
pdfi_countdown(val);
return true;
@@ -275,7 +301,7 @@ bool pdfi_array_known(pdf_context *ctx, pdf_array *a, pdf_obj *o, int *index)
int pdfi_array_put(pdf_context *ctx, pdf_array *a, uint64_t index, pdf_obj *o)
{
- if (a->type != PDF_ARRAY)
+ if (pdfi_type_of(a) != PDF_ARRAY)
return_error(gs_error_typecheck);
if (index >= a->size)
@@ -292,7 +318,7 @@ int pdfi_array_put_int(pdf_context *ctx, pdf_array *a, uint64_t index, int64_t v
int code;
pdf_num *obj;
- if (a->type != PDF_ARRAY)
+ if (pdfi_type_of(a) != PDF_ARRAY)
return_error(gs_error_typecheck);
code = pdfi_object_alloc(ctx, PDF_INT, 0, (pdf_obj **)&obj);
@@ -308,7 +334,7 @@ int pdfi_array_put_real(pdf_context *ctx, pdf_array *a, uint64_t index, double v
int code;
pdf_num *obj;
- if (a->type != PDF_ARRAY)
+ if (pdfi_type_of(a) != PDF_ARRAY)
return_error(gs_error_typecheck);
code = pdfi_object_alloc(ctx, PDF_REAL, 0, (pdf_obj **)&obj);
@@ -358,7 +384,7 @@ int pdfi_array_to_gs_rect(pdf_context *ctx, pdf_array *array, gs_rect *rect)
rect->q.y = 1.0;
/* Identity matrix if no array */
- if (array == NULL || array->type != PDF_ARRAY) {
+ if (array == NULL || pdfi_type_of(array) != PDF_ARRAY) {
return 0;
}
if (pdfi_array_size(array) != 4) {
@@ -451,7 +477,7 @@ int pdfi_array_to_gs_matrix(pdf_context *ctx, pdf_array *array, gs_matrix *mat)
mat->ty = 0.0;
/* Identity matrix if no array */
- if (array == NULL || array->type != PDF_ARRAY) {
+ if (array == NULL || pdfi_type_of(array) != PDF_ARRAY) {
return 0;
}
if (pdfi_array_size(array) != 6) {
diff --git a/pdf/pdf_array.h b/pdf/pdf_array.h
index 37097aaa..a4eb7d35 100644
--- a/pdf/pdf_array.h
+++ b/pdf/pdf_array.h
@@ -55,4 +55,6 @@ int pdfi_array_to_gs_matrix(pdf_context *ctx, pdf_array *array, gs_matrix *matri
int pdfi_array_to_num_array(pdf_context *ctx, pdf_array *array, double *out, int start, int size);
void pdfi_bbox_transform(pdf_context *ctx, gs_rect *bbox, gs_matrix *matrix);
+int pdfi_array_fetch_recursing(pdf_context *ctx, pdf_array *a, uint64_t index, pdf_obj **o, bool setref, bool cache);
+
#endif
diff --git a/pdf/pdf_check.c b/pdf/pdf_check.c
index 00933bdf..19a6d957 100644
--- a/pdf/pdf_check.c
+++ b/pdf/pdf_check.c
@@ -66,7 +66,7 @@
* stores all the objects (which we don't want to do because its wasteful) and checking
* to see if its already tested a given resource for spots/transparency.
* This is a temporary allocation, big enough to hold all the objects in the file (1 per bit)
- * each time we have fully checked a resource we add it here, when checking a resoruce we
+ * each time we have fully checked a resource we add it here, when checking a resource we
* first check this list to see if its already been checked, in which case we can skip
* it. When done we release the memory.
*/
@@ -74,6 +74,7 @@ typedef struct {
bool transparent;
bool has_overprint; /* Does it have OP or op in an ExtGState? */
pdf_dict *spot_dict;
+ pdf_array *font_array;
uint32_t size;
byte *CheckedResources;
} pdfi_check_tracker_t;
@@ -84,6 +85,7 @@ static inline bool resource_is_checked(pdfi_check_tracker_t *tracker, pdf_obj *o
{
uint32_t byte_offset;
byte bit_offset;
+ int object_num;
if(tracker->CheckedResources == NULL)
return 0;
@@ -91,14 +93,15 @@ static inline bool resource_is_checked(pdfi_check_tracker_t *tracker, pdf_obj *o
/* objects with object number 0 are directly defined, we can't
* store those so just return immediately
*/
- if (o->object_num > 0 && (o->object_num >> 3) < tracker->size) {
+ object_num = pdf_object_num(o);
+ if (object_num > 0 && (object_num >> 3) < tracker->size) {
/* CheckedResources is a byte array, each byte represents
* 8 objects. So the object number / 8 is the byte offset
* into the array, and then object number % 8 is the bit
* within that byte that we want.
*/
- bit_offset = 0x01 << (o->object_num % 8);
- byte_offset = o->object_num >> 3;
+ bit_offset = 0x01 << (object_num % 8);
+ byte_offset = object_num >> 3;
/* If its already set, then return that. */
if (tracker->CheckedResources[byte_offset] & bit_offset)
@@ -116,12 +119,13 @@ pdfi_check_free_tracker(pdf_context *ctx, pdfi_check_tracker_t *tracker)
{
gs_free_object(ctx->memory, tracker->CheckedResources, "pdfi_check_free_tracker(flags)");
pdfi_countdown(tracker->spot_dict);
+ pdfi_countdown(tracker->font_array);
memset(tracker, 0, sizeof(*tracker));
return 0;
}
static int
-pdfi_check_init_tracker(pdf_context *ctx, pdfi_check_tracker_t *tracker)
+pdfi_check_init_tracker(pdf_context *ctx, pdfi_check_tracker_t *tracker, pdf_array **fonts_array, pdf_array **spot_array)
{
int code = 0;
@@ -136,16 +140,25 @@ pdfi_check_init_tracker(pdf_context *ctx, pdfi_check_tracker_t *tracker)
memset(tracker->CheckedResources, 0x00, tracker->size);
if (ctx->device_state.spot_capable ||
- (ctx->pgs->device->icc_struct->overprint_control) == gs_overprint_control_simulate) {
+ (ctx->pgs->device->icc_struct->overprint_control) == gs_overprint_control_simulate ||
+ spot_array != NULL)
+ {
code = pdfi_dict_alloc(ctx, 32, &tracker->spot_dict);
if (code < 0)
goto cleanup;
pdfi_countup(tracker->spot_dict);
}
+ if (fonts_array != NULL) {
+ code = pdfi_array_alloc(ctx, 0, &tracker->font_array);
+ if (code < 0)
+ goto cleanup;
+ pdfi_countup(tracker->font_array);
+ }
+
return 0;
- cleanup:
+cleanup:
pdfi_check_free_tracker(ctx, tracker);
return code;
}
@@ -164,6 +177,9 @@ static int pdfi_check_ColorSpace_dict(pdf_context *ctx, pdf_dict *cspace_dict,
if (resource_is_checked(tracker, (pdf_obj *)cspace_dict))
return 0;
+ if (pdfi_type_of(cspace_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
if (pdfi_dict_entries(cspace_dict) > 0) {
code = pdfi_loop_detector_mark(ctx); /* Mark the start of the ColorSpace dictionary loop */
if (code < 0)
@@ -197,7 +213,7 @@ static int pdfi_check_ColorSpace_dict(pdf_context *ctx, pdf_dict *cspace_dict,
}
code = pdfi_dict_next(ctx, cspace_dict, &Key, &Value, &index);
- if (code == 0 && Value->type == PDF_ARRAY)
+ if (code == 0 && pdfi_type_of(Value) == PDF_ARRAY)
break;
pdfi_countdown(Key);
Key = NULL;
@@ -235,6 +251,9 @@ static int pdfi_check_Shading(pdf_context *ctx, pdf_obj *shading,
if (code < 0)
return code;
+ if (pdfi_type_of(shading_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
code = pdfi_dict_knownget(ctx, shading_dict, "ColorSpace", (pdf_obj **)&o);
if (code > 0) {
code = pdfi_check_ColorSpace_for_spots(ctx, o, shading_dict, page_dict, tracker->spot_dict);
@@ -257,13 +276,16 @@ static int pdfi_check_Shading_dict(pdf_context *ctx, pdf_dict *shading_dict,
if (resource_is_checked(tracker, (pdf_obj *)shading_dict))
return 0;
+ if (pdfi_type_of(shading_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
if (pdfi_dict_entries(shading_dict) > 0) {
code = pdfi_loop_detector_mark(ctx); /* Mark the start of the Shading dictionary loop */
if (code < 0)
return code;
code = pdfi_dict_first(ctx, shading_dict, &Key, &Value, &index);
- if (code < 0 || !(Value->type == PDF_DICT || Value->type == PDF_STREAM))
+ if (code < 0 || !(pdfi_type_of(Value) == PDF_DICT || pdfi_type_of(Value) == PDF_STREAM))
goto error1;
i = 1;
@@ -290,7 +312,7 @@ static int pdfi_check_Shading_dict(pdf_context *ctx, pdf_dict *shading_dict,
}
code = pdfi_dict_next(ctx, shading_dict, &Key, &Value, &index);
- if (code == 0 && Value->type == PDF_DICT)
+ if (code == 0 && pdfi_type_of(Value) == PDF_DICT)
break;
pdfi_countdown(Key);
Key = NULL;
@@ -326,6 +348,9 @@ static int pdfi_check_XObject(pdf_context *ctx, pdf_dict *xobject, pdf_dict *pag
if (resource_is_checked(tracker, (pdf_obj *)xobject))
return 0;
+ if (pdfi_type_of(xobject) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
code = pdfi_dict_get_type(ctx, xobject, "Subtype", PDF_NAME, (pdf_obj **)&n);
if (code >= 0) {
if (pdfi_name_is((const pdf_name *)n, "Image")) {
@@ -417,6 +442,9 @@ static int pdfi_check_XObject_dict(pdf_context *ctx, pdf_dict *xobject_dict, pdf
if (resource_is_checked(tracker, (pdf_obj *)xobject_dict))
return 0;
+ if (pdfi_type_of(xobject_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
if (pdfi_dict_entries(xobject_dict) > 0) {
code = pdfi_loop_detector_mark(ctx); /* Mark the start of the XObject dictionary loop */
if (code < 0)
@@ -425,7 +453,7 @@ static int pdfi_check_XObject_dict(pdf_context *ctx, pdf_dict *xobject_dict, pdf
code = pdfi_dict_first(ctx, xobject_dict, &Key, &Value, &index);
if (code < 0)
goto error_exit;
- if (Value->type != PDF_STREAM)
+ if (pdfi_type_of(Value) != PDF_STREAM)
goto error_exit;
i = 1;
@@ -457,7 +485,7 @@ static int pdfi_check_XObject_dict(pdf_context *ctx, pdf_dict *xobject_dict, pdf
}
code = pdfi_dict_next(ctx, xobject_dict, &Key, &Value, &index);
- if (code == 0 && Value->type == PDF_STREAM)
+ if (code == 0 && pdfi_type_of(Value) == PDF_STREAM)
break;
pdfi_countdown(Key);
Key = NULL;
@@ -490,6 +518,9 @@ static int pdfi_check_ExtGState(pdf_context *ctx, pdf_dict *extgstate_dict, pdf_
if (resource_is_checked(tracker, (pdf_obj *)extgstate_dict))
return 0;
+ if (pdfi_type_of(extgstate_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
if (pdfi_dict_entries(extgstate_dict) > 0) {
/* See if /OP or /op is true */
code = pdfi_dict_get_bool(ctx, extgstate_dict, "OP", &overprint);
@@ -502,14 +533,16 @@ static int pdfi_check_ExtGState(pdf_context *ctx, pdf_dict *extgstate_dict, pdf_
/* Check SMask */
code = pdfi_dict_knownget(ctx, extgstate_dict, "SMask", &o);
if (code > 0) {
- if (o->type == PDF_NAME) {
- if (!pdfi_name_is((pdf_name *)o, "None")) {
- pdfi_countdown(o);
- tracker->transparent = true;
- return 0;
- }
- } else {
- if (o->type == PDF_DICT) {
+ switch (pdfi_type_of(o)) {
+ case PDF_NAME:
+ if (!pdfi_name_is((pdf_name *)o, "None")) {
+ pdfi_countdown(o);
+ tracker->transparent = true;
+ return 0;
+ }
+ break;
+ case PDF_DICT:
+ {
pdf_obj *G = NULL;
tracker->transparent = true;
@@ -526,6 +559,8 @@ static int pdfi_check_ExtGState(pdf_context *ctx, pdf_dict *extgstate_dict, pdf_
pdfi_countdown(o);
return code;
}
+ default:
+ break;
}
}
pdfi_countdown(o);
@@ -577,6 +612,9 @@ static int pdfi_check_ExtGState_dict(pdf_context *ctx, pdf_dict *extgstate_dict,
if (resource_is_checked(tracker, (pdf_obj *)extgstate_dict))
return 0;
+ if (pdfi_type_of(extgstate_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
if (pdfi_dict_entries(extgstate_dict) > 0) {
code = pdfi_loop_detector_mark(ctx); /* Mark the start of the ColorSpace dictionary loop */
if (code < 0)
@@ -611,7 +649,7 @@ static int pdfi_check_ExtGState_dict(pdf_context *ctx, pdf_dict *extgstate_dict,
}
code = pdfi_dict_next(ctx, extgstate_dict, &Key, &Value, &index);
- if (code == 0 && Value->type == PDF_DICT)
+ if (code == 0 && pdfi_type_of(Value) == PDF_DICT)
break;
pdfi_countdown(Key);
Key = NULL;
@@ -644,6 +682,9 @@ static int pdfi_check_Pattern(pdf_context *ctx, pdf_dict *pattern, pdf_dict *pag
if (resource_is_checked(tracker, (pdf_obj *)pattern))
return 0;
+ if (pdfi_type_of(pattern) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
if (tracker->spot_dict != NULL) {
code = pdfi_dict_knownget(ctx, pattern, "Shading", &o);
if (code > 0)
@@ -677,7 +718,7 @@ int pdfi_check_Pattern_transparency(pdf_context *ctx, pdf_dict *pattern, pdf_dic
bool *transparent)
{
int code;
- pdfi_check_tracker_t tracker = {0, 0, NULL, 0, NULL};
+ pdfi_check_tracker_t tracker = {0, 0, NULL, NULL, 0, NULL};
/* NOTE: We use a "null" tracker that won't do any optimization to prevent
* checking the same resource twice.
@@ -708,6 +749,9 @@ static int pdfi_check_Pattern_dict(pdf_context *ctx, pdf_dict *pattern_dict, pdf
if (resource_is_checked(tracker, (pdf_obj *)pattern_dict))
return 0;
+ if (pdfi_type_of(pattern_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
if (pdfi_dict_entries(pattern_dict) > 0) {
code = pdfi_loop_detector_mark(ctx); /* Mark the start of the Pattern dictionary loop */
if (code < 0)
@@ -717,7 +761,7 @@ static int pdfi_check_Pattern_dict(pdf_context *ctx, pdf_dict *pattern_dict, pdf
if (code < 0)
goto error1;
- if(Value->type != PDF_DICT && Value->type != PDF_STREAM)
+ if (pdfi_type_of(Value) != PDF_DICT && pdfi_type_of(Value) != PDF_STREAM)
goto transparency_exit;
i = 1;
@@ -748,7 +792,7 @@ static int pdfi_check_Pattern_dict(pdf_context *ctx, pdf_dict *pattern_dict, pdf
}
code = pdfi_dict_next(ctx, pattern_dict, &Key, &Value, &index);
- if (code == 0 && (Value->type == PDF_DICT || Value->type == PDF_STREAM))
+ if (code == 0 && (pdfi_type_of(Value) == PDF_DICT || pdfi_type_of(Value) == PDF_STREAM))
break;
pdfi_countdown(Key);
Key = NULL;
@@ -771,7 +815,8 @@ error1:
/*
* This routine checks a Font dictionary to see if it contains any spot
- * colour definitions, or transparency usage.
+ * colour definitions, or transparency usage. While we are here, if the tracker's font_array
+ * is not NULL, pick up the font information and store it in the array.
*/
static int pdfi_check_Font(pdf_context *ctx, pdf_dict *font, pdf_dict *page_dict,
pdfi_check_tracker_t *tracker)
@@ -782,22 +827,186 @@ static int pdfi_check_Font(pdf_context *ctx, pdf_dict *font, pdf_dict *page_dict
if (resource_is_checked(tracker, (pdf_obj *)font))
return 0;
- if (font->type != PDF_DICT)
+ if (pdfi_type_of(font) != PDF_DICT)
return_error(gs_error_typecheck);
- code = pdfi_dict_knownget_type(ctx, font, "Subtype", PDF_NAME, &o);
- if (code > 0) {
- if (pdfi_name_is((pdf_name *)o, "Type3")) {
- pdfi_countdown(o);
- o = NULL;
+ if (tracker->font_array != NULL) {
+ /* If we get to here this is a font we have not seen before. We need
+ * to make a new font array big enough to hold the existing entries +1
+ * copy the existing entries to the new array and free the old array.
+ * Finally create a dictionary with all the font information we want
+ * and add it to the array.
+ */
+ pdf_array *new_fonts = NULL;
+ int index = 0;
+ pdf_obj *array_obj = NULL;
+ pdf_dict *font_info_dict = NULL;
- code = pdfi_dict_knownget_type(ctx, font, "Resources", PDF_DICT, &o);
- if (code > 0)
- (void)pdfi_check_Resources(ctx, (pdf_dict *)o, page_dict, tracker);
+ /* Let's start by gathering the information we need and storing it in a dictionary */
+ code = pdfi_dict_alloc(ctx, 4, &font_info_dict);
+ if (code < 0)
+ return code;
+ pdfi_countup(font_info_dict);
+
+ if (font->object_num != 0) {
+ pdf_num *int_obj = NULL;
+
+ code = pdfi_object_alloc(ctx, PDF_INT, 0, (pdf_obj **)&int_obj);
+ if (code >= 0) {
+ pdfi_countup(int_obj);
+ int_obj->value.i = font->object_num;
+ code = pdfi_dict_put(ctx, font_info_dict, "ObjectNum", (pdf_obj *)int_obj);
+ pdfi_countdown(int_obj);
+ }
+ if (code < 0) {
+ pdfi_countdown(font_info_dict);
+ return code;
+ }
+ }
+
+ code = pdfi_dict_get(ctx, font, "BaseFont", &array_obj);
+ if (code >= 0) {
+ code = pdfi_dict_put(ctx, font_info_dict, "BaseFont", array_obj);
+ if (code < 0) {
+ pdfi_countdown(array_obj);
+ pdfi_countdown(font_info_dict);
+ return code;
+ }
+ }
+ pdfi_countdown(array_obj);
+ array_obj = NULL;
+
+ code = pdfi_dict_get(ctx, font, "ToUnicode", &array_obj);
+ if (code >= 0)
+ code = pdfi_dict_put(ctx, font_info_dict, "ToUnicode", PDF_TRUE_OBJ);
+ else
+ code = pdfi_dict_put(ctx, font_info_dict, "ToUnicode", PDF_FALSE_OBJ);
+ pdfi_countdown(array_obj);
+ array_obj = NULL;
+ if (code < 0)
+ return code;
+
+ code = pdfi_dict_get(ctx, font, "FontDescriptor", &array_obj);
+ if (code >= 0) {
+ bool known = false;
+
+ (void)pdfi_dict_known(ctx, (pdf_dict *)array_obj, "FontFile", &known);
+ if (!known) {
+ (void)pdfi_dict_known(ctx, (pdf_dict *)array_obj, "FontFile2", &known);
+ if (!known) {
+ (void)pdfi_dict_known(ctx, (pdf_dict *)array_obj, "FontFile3", &known);
+ }
+ }
+
+ if (known >= 0)
+ code = pdfi_dict_put(ctx, font_info_dict, "Embedded", PDF_TRUE_OBJ);
+ else
+ code = pdfi_dict_put(ctx, font_info_dict, "Embedded", PDF_FALSE_OBJ);
+ } else
+ code = pdfi_dict_put(ctx, font_info_dict, "Embedded", PDF_FALSE_OBJ);
+
+ pdfi_countdown(array_obj);
+ array_obj = NULL;
+
+ if (code < 0)
+ return code;
+
+
+ code = pdfi_dict_knownget_type(ctx, font, "Subtype", PDF_NAME, &array_obj);
+ if (code >= 0) {
+ code = pdfi_dict_put(ctx, font_info_dict, "Subtype", array_obj);
+ if (code < 0) {
+ pdfi_countdown(array_obj);
+ pdfi_countdown(font_info_dict);
+ return code;
+ }
+
+ if (pdfi_name_is((pdf_name *)array_obj, "Type3")) {
+ pdfi_countdown(o);
+ o = NULL;
+
+ code = pdfi_dict_knownget_type(ctx, font, "Resources", PDF_DICT, &o);
+ if (code > 0)
+ (void)pdfi_check_Resources(ctx, (pdf_dict *)o, page_dict, tracker);
+ }
+
+ if (pdfi_name_is((const pdf_name *)array_obj, "Type0")){
+ pdf_array *descendants = NULL;
+ pdf_dict *desc_font = NULL;
+
+ code = pdfi_dict_get(ctx, font, "DescendantFonts", (pdf_obj **)&descendants);
+ if (code >= 0) {
+ code = pdfi_array_get(ctx, descendants, 0, (pdf_obj **)&desc_font);
+ if (code >= 0){
+ pdf_array *desc_array = NULL;
+
+ code = pdfi_array_alloc(ctx, 0, &desc_array);
+ pdfi_countup(desc_array);
+ if (code >= 0) {
+ pdf_array *saved = tracker->font_array;
+
+ tracker->font_array = desc_array;
+ (void)pdfi_check_Font(ctx, desc_font, page_dict, tracker);
+ (void)pdfi_dict_put(ctx, font_info_dict, "Descendants", (pdf_obj *)tracker->font_array);
+ pdfi_countdown((pdf_obj *)tracker->font_array);
+ tracker->font_array = saved;
+ }
+ pdfi_countdown(descendants);
+ pdfi_countdown(desc_font);
+ }
+ }
+ }
+ }
+ pdfi_countdown(array_obj);
+ array_obj = NULL;
+
+ code = pdfi_array_alloc(ctx, pdfi_array_size(tracker->font_array) + 1, &new_fonts);
+ if (code < 0) {
+ pdfi_countdown(font_info_dict);
+ return code;
+ }
+ pdfi_countup(new_fonts);
+
+ for (index = 0; index < pdfi_array_size(tracker->font_array); index++) {
+ code = pdfi_array_get(ctx, tracker->font_array, index, &array_obj);
+ if (code < 0) {
+ pdfi_countdown(font_info_dict);
+ pdfi_countdown(new_fonts);
+ return code;
+ }
+ code = pdfi_array_put(ctx, new_fonts, index, array_obj);
+ pdfi_countdown(array_obj);
+ if (code < 0) {
+ pdfi_countdown(font_info_dict);
+ pdfi_countdown(new_fonts);
+ return code;
+ }
+ }
+ code = pdfi_array_put(ctx, new_fonts, index, (pdf_obj *)font_info_dict);
+ if (code < 0) {
+ pdfi_countdown(font_info_dict);
+ pdfi_countdown(new_fonts);
+ return code;
}
+ pdfi_countdown(font_info_dict);
+ pdfi_countdown(tracker->font_array);
+ tracker->font_array = new_fonts;
+ } else {
+ code = pdfi_dict_knownget_type(ctx, font, "Subtype", PDF_NAME, &o);
+ if (code > 0) {
+ if (pdfi_name_is((pdf_name *)o, "Type3")) {
+ pdfi_countdown(o);
+ o = NULL;
+
+ code = pdfi_dict_knownget_type(ctx, font, "Resources", PDF_DICT, &o);
+ if (code > 0)
+ (void)pdfi_check_Resources(ctx, (pdf_dict *)o, page_dict, tracker);
+ }
+ }
+
+ pdfi_countdown(o);
+ o = NULL;
}
- pdfi_countdown(o);
- o = NULL;
return 0;
}
@@ -815,6 +1024,9 @@ static int pdfi_check_Font_dict(pdf_context *ctx, pdf_dict *font_dict, pdf_dict
if (resource_is_checked(tracker, (pdf_obj *)font_dict))
return 0;
+ if (pdfi_type_of(font_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
if (pdfi_dict_entries(font_dict) > 0) {
code = pdfi_loop_detector_mark(ctx); /* Mark the start of the Font dictionary loop */
if (code < 0)
@@ -846,7 +1058,7 @@ static int pdfi_check_Font_dict(pdf_context *ctx, pdf_dict *font_dict, pdf_dict
}
code = pdfi_dict_next(ctx, font_dict, &Key, &Value, &index);
- if (code == 0 && Value->type == PDF_DICT)
+ if (code == 0 && pdfi_type_of(Value) == PDF_DICT)
break;
pdfi_countdown(Key);
Key = NULL;
@@ -875,6 +1087,9 @@ static int pdfi_check_Resources(pdf_context *ctx, pdf_dict *Resources_dict,
if (resource_is_checked(tracker, (pdf_obj *)Resources_dict))
return 0;
+ if (pdfi_type_of(Resources_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
/* First up, check any colour spaces, for new spot colours.
* We only do this if asked because its expensive. spot_dict being NULL
* means we aren't interested in spot colours (not a DeviceN or Separation device)
@@ -937,6 +1152,9 @@ static int pdfi_check_annot_for_transparency(pdf_context *ctx, pdf_dict *annot,
if (resource_is_checked(tracker, (pdf_obj *)annot))
return 0;
+ if (pdfi_type_of(annot) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
/* Check #1 Does the (Normal) Appearnce stream use any Resources which include transparency.
* We check this first, because this also checks for spot colour spaces. Once we've done that we
* can exit the checks as soon as we detect transparency.
@@ -1035,6 +1253,9 @@ static int pdfi_check_Annots_for_transparency(pdf_context *ctx, pdf_array *annot
if (resource_is_checked(tracker, (pdf_obj *)annots_array))
return 0;
+ if (pdfi_type_of(annots_array) != PDF_ARRAY)
+ return_error(gs_error_typecheck);
+
for (i=0; i < pdfi_array_size(annots_array); i++) {
code = pdfi_array_get_type(ctx, annots_array, (uint64_t)i, PDF_DICT, (pdf_obj **)&annot);
if (code >= 0) {
@@ -1084,6 +1305,10 @@ static int pdfi_check_page_inner(pdf_context *ctx, pdf_dict *page_dict,
tracker->transparent = false;
+ if (pdfi_type_of(page_dict) != PDF_DICT)
+ return_error(gs_error_typecheck);
+
+
/* Check if the page dictionary has a page Group entry (for spots).
* Page group should mean the page has transparency but we ignore it for the purposes
* of transparency detection. See above.
@@ -1104,7 +1329,7 @@ static int pdfi_check_page_inner(pdf_context *ctx, pdf_dict *page_dict,
code = pdfi_dict_knownget_type(ctx, page_dict, "Resources", PDF_DICT, (pdf_obj **)&Resources);
if (code > 0)
code = pdfi_check_Resources(ctx, Resources, page_dict, tracker);
- if ((code < 0 && ctx->args.pdfstoponerror) || (code == gs_error_stackoverflow))
+ if ((code < 0 && ctx->args.pdfstoponerror) || (code == gs_error_pdf_stackoverflow))
goto exit;
/* If we are drawing Annotations, check to see if the page uses any Annots */
@@ -1130,7 +1355,7 @@ static int pdfi_check_page_inner(pdf_context *ctx, pdf_dict *page_dict,
* Sets ctx->page.has_transparency and ctx->page.num_spots
* do_setup -- indicates whether to actually set up the device with the spot count.
*/
-int pdfi_check_page(pdf_context *ctx, pdf_dict *page_dict, bool do_setup)
+int pdfi_check_page(pdf_context *ctx, pdf_dict *page_dict, pdf_array **fonts_array, pdf_array **spots_array, bool do_setup)
{
int code;
int spots = 0;
@@ -1145,7 +1370,7 @@ int pdfi_check_page(pdf_context *ctx, pdf_dict *page_dict, bool do_setup)
* TODO: Should probably look into that..
*/
pdfi_device_set_flags(ctx);
- code = pdfi_check_init_tracker(ctx, &tracker);
+ code = pdfi_check_init_tracker(ctx, &tracker, fonts_array, spots_array);
if (code < 0)
goto exit;
@@ -1191,7 +1416,7 @@ int pdfi_check_page(pdf_context *ctx, pdf_dict *page_dict, bool do_setup)
code = pdfi_dict_first(ctx, tracker.spot_dict, (pdf_obj **)&Key, &Value, &index);
while (code >= 0)
{
- if (Key->type == PDF_NAME) {
+ if (pdfi_type_of(Key) == PDF_NAME) {
table[a].data = ((pdf_string *)Key)->data;
table[a].size = ((pdf_string *)Key)->length;
table[a++].persistent = false;
@@ -1263,6 +1488,47 @@ int pdfi_check_page(pdf_context *ctx, pdf_dict *page_dict, bool do_setup)
ctx->page.has_OP = false;
exit:
+ if (fonts_array != NULL) {
+ *fonts_array = tracker.font_array;
+ pdfi_countup(*fonts_array);
+ }
+
+ if (spots_array != NULL && tracker.spot_dict != NULL && pdfi_dict_entries(tracker.spot_dict) != 0) {
+ pdf_array *new_array = NULL;
+ pdf_name *Key = NULL;
+ pdf_obj *Value = NULL;
+ uint64_t index = 0, a_index = 0;
+
+ index = pdfi_dict_entries(tracker.spot_dict);
+
+ code = pdfi_array_alloc(ctx, index, &new_array);
+ if (code < 0)
+ goto error;
+ pdfi_countup(new_array);
+
+ code = pdfi_dict_first(ctx, tracker.spot_dict, (pdf_obj **)&Key, &Value, &index);
+ while (code >= 0)
+ {
+ if (pdfi_type_of(Key) == PDF_NAME) {
+ code = pdfi_array_put(ctx, new_array, a_index++, (pdf_obj *)Key);
+ if (code < 0) {
+ pdfi_countdown(new_array);
+ pdfi_countdown(Key);
+ pdfi_countdown(Value);
+ goto error;
+ }
+ }
+
+ pdfi_countdown(Key);
+ Key = NULL;
+ pdfi_countdown(Value);
+ Value = NULL;
+ code = pdfi_dict_next(ctx, tracker.spot_dict, (pdf_obj **)&Key, &Value, &index);
+ }
+ code = 0;
+ *spots_array = new_array;
+ }
+error:
(void)pdfi_check_free_tracker(ctx, &tracker);
return code;
}
diff --git a/pdf/pdf_check.h b/pdf/pdf_check.h
index eee5c82b..68619864 100644
--- a/pdf/pdf_check.h
+++ b/pdf/pdf_check.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019-2021 Artifex Software, Inc.
+/* Copyright (C) 2019-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -16,7 +16,7 @@
#ifndef PDF_CHECK
#define PDF_CHECK
-int pdfi_check_page(pdf_context *ctx, pdf_dict *page_dict, bool do_setup);
+int pdfi_check_page(pdf_context *ctx, pdf_dict *page_dict, pdf_array **fonts_array, pdf_array **spots_array, bool do_setup);
int pdfi_check_Pattern_transparency(pdf_context *ctx, pdf_dict *pattern,
pdf_dict *page_dict, bool *transparent);
diff --git a/pdf/pdf_cmap.c b/pdf/pdf_cmap.c
index d7198e24..792b8d1b 100644
--- a/pdf/pdf_cmap.c
+++ b/pdf/pdf_cmap.c
@@ -790,17 +790,20 @@ pdfi_read_cmap(pdf_context *ctx, pdf_obj *cmap, pdf_cmap **pcmap)
pdf_ps_ctx_t cmap_ctx;
pdfi_cmap->ctx = ctx;
- if (cmap->type == PDF_NAME) {
- gs_string cmname;
- pdf_name *cmapn = (pdf_name *)cmap;
- cmname.data = cmapn->data;
- cmname.size = cmapn->length;
- code = pdf_cmap_open_file(ctx, &cmname, &buf, &buflen);
- if (code < 0)
- goto error_out;
- }
- else {
- if (cmap->type == PDF_STREAM) {
+ switch (pdfi_type_of(cmap)) {
+ case PDF_NAME:
+ {
+ gs_string cmname;
+ pdf_name *cmapn = (pdf_name *)cmap;
+ cmname.data = cmapn->data;
+ cmname.size = cmapn->length;
+ code = pdf_cmap_open_file(ctx, &cmname, &buf, &buflen);
+ if (code < 0)
+ goto error_out;
+ break;
+ }
+ case PDF_STREAM:
+ {
pdf_obj *ucmap;
pdf_cmap *upcmap = NULL;
pdf_dict *cmap_dict = NULL;
@@ -842,11 +845,11 @@ pdfi_read_cmap(pdf_context *ctx, pdf_obj *cmap, pdf_cmap **pcmap)
if (code < 0) {
goto error_out;
}
+ break;
}
- else {
- code = gs_note_error(gs_error_typecheck);
- goto error_out;
- }
+ default:
+ code = gs_note_error(gs_error_typecheck);
+ goto error_out;
}
pdfi_cmap->ctx = ctx;
pdfi_cmap->buf = buf;
diff --git a/pdf/pdf_colour.c b/pdf/pdf_colour.c
index dcc3ebf0..0fad43a6 100644
--- a/pdf/pdf_colour.c
+++ b/pdf/pdf_colour.c
@@ -227,7 +227,7 @@ static int pdfi_check_for_spots_by_array(pdf_context *ctx, pdf_array *color_arra
if (code < 0)
goto exit;
- if (a->type != PDF_ARRAY) {
+ if (pdfi_type_of(a) != PDF_ARRAY) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -256,15 +256,16 @@ int pdfi_check_ColorSpace_for_spots(pdf_context *ctx, pdf_obj *space, pdf_dict *
if (code < 0)
return code;
- if (space->type == PDF_NAME) {
- code = pdfi_check_for_spots_by_name(ctx, (pdf_name *)space, parent_dict, page_dict, spot_dict);
- } else {
- if (space->type == PDF_ARRAY) {
+ switch(pdfi_type_of(space)) {
+ case PDF_NAME:
+ code = pdfi_check_for_spots_by_name(ctx, (pdf_name *)space, parent_dict, page_dict, spot_dict);
+ break;
+ case PDF_ARRAY:
code = pdfi_check_for_spots_by_array(ctx, (pdf_array *)space, parent_dict, page_dict, spot_dict);
- } else {
+ break;
+ default:
pdfi_loop_detector_cleartomark(ctx);
return 0;
- }
}
(void)pdfi_loop_detector_cleartomark(ctx);
@@ -282,13 +283,15 @@ int pdfi_ri(pdf_context *ctx)
if (pdfi_count_stack(ctx) < 1)
return_error(gs_error_stackunderflow);
- if (ctx->stack_top[-1]->type != PDF_NAME) {
+ if (pdfi_type_of(ctx->stack_top[-1]) != PDF_NAME) {
pdfi_pop(ctx, 1);
return_error(gs_error_typecheck);
}
n = (pdf_name *)ctx->stack_top[-1];
- code = pdfi_setrenderingintent(ctx, n);
+ pdfi_countup(n);
pdfi_pop(ctx, 1);
+ code = pdfi_setrenderingintent(ctx, n);
+ pdfi_countdown(n);
return code;
}
@@ -330,7 +333,7 @@ static void pdfi_cspace_free_callback(gs_memory_t * mem, void *cs)
if (pfn)
pdfi_free_function(ctx, pfn);
}
- if (o->type != PDF_CTX) {
+ if (pdfi_type_of(o) != PDF_CTX) {
pdfi_countdown(o);
pcs->interpreter_data = NULL;
}
@@ -439,84 +442,45 @@ int pdfi_gs_setcolorspace(pdf_context *ctx, gs_color_space *pcs)
/* Start with the simple cases, where we set the colour space and colour in a single operation */
int pdfi_setgraystroke(pdf_context *ctx)
{
- pdf_num *n1;
int code;
double d1;
- if (pdfi_count_stack(ctx) < 1)
- return_error(gs_error_stackunderflow);
+ code = pdfi_destack_real(ctx, &d1);
+ if (code < 0)
+ return code;
- n1 = (pdf_num *)ctx->stack_top[-1];
- if (n1->type == PDF_INT){
- d1 = (double)n1->value.i;
- } else{
- if (n1->type == PDF_REAL) {
- d1 = n1->value.d;
- } else {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- }
gs_swapcolors_quick(ctx->pgs);
code = pdfi_gs_setgray(ctx, d1);
gs_swapcolors_quick(ctx->pgs);
- pdfi_pop(ctx, 1);
+
return code;
}
int pdfi_setgrayfill(pdf_context *ctx)
{
- pdf_num *n1;
int code;
double d1;
- if (pdfi_count_stack(ctx) < 1)
- return_error(gs_error_stackunderflow);
+ code = pdfi_destack_real(ctx, &d1);
+ if (code < 0)
+ return code;
- n1 = (pdf_num *)ctx->stack_top[-1];
- if (n1->type == PDF_INT){
- d1 = (double)n1->value.i;
- } else{
- if (n1->type == PDF_REAL) {
- d1 = n1->value.d;
- } else {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- }
- code = pdfi_gs_setgray(ctx, d1);
- pdfi_pop(ctx, 1);
- return code;
+ return pdfi_gs_setgray(ctx, d1);
}
int pdfi_setrgbstroke(pdf_context *ctx)
{
- pdf_num *num;
double Values[3];
- int i, code;
+ int code;
- if (pdfi_count_stack(ctx) < 3) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ code = pdfi_destack_reals(ctx, Values, 3);
+ if (code < 0)
+ return code;
- for (i=0;i < 3;i++){
- num = (pdf_num *)ctx->stack_top[i - 3];
- if (num->type != PDF_INT) {
- if(num->type != PDF_REAL) {
- pdfi_pop(ctx, 3);
- return_error(gs_error_typecheck);
- }
- else
- Values[i] = num->value.d;
- } else {
- Values[i] = (double)num->value.i;
- }
- }
gs_swapcolors_quick(ctx->pgs);
code = pdfi_gs_setrgbcolor(ctx, Values[0], Values[1], Values[2]);
gs_swapcolors_quick(ctx->pgs);
- pdfi_pop(ctx, 3);
+
return code;
}
@@ -534,104 +498,57 @@ int pdfi_setrgbfill_array(pdf_context *ctx)
return_error(gs_error_stackunderflow);
array = (pdf_array *)ctx->stack_top[-1];
- if (array->type != PDF_ARRAY) {
+ pdfi_countup(array);
+ pdfi_pop(ctx, 1);
+ if (pdfi_type_of(array) != PDF_ARRAY) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
code = pdfi_setcolor_from_array(ctx, array);
exit:
- pdfi_pop(ctx, 1);
+ pdfi_countdown(array);
return code;
}
int pdfi_setrgbfill(pdf_context *ctx)
{
- pdf_num *num;
double Values[3];
- int i, code;
+ int code;
- if (pdfi_count_stack(ctx) < 3) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ code = pdfi_destack_reals(ctx, Values, 3);
+ if (code < 0)
+ return code;
- for (i=0;i < 3;i++){
- num = (pdf_num *)ctx->stack_top[i - 3];
- if (num->type != PDF_INT) {
- if(num->type != PDF_REAL) {
- pdfi_pop(ctx, 3);
- return_error(gs_error_typecheck);
- }
- else
- Values[i] = num->value.d;
- } else {
- Values[i] = (double)num->value.i;
- }
- }
- code = pdfi_gs_setrgbcolor(ctx, Values[0], Values[1], Values[2]);
- pdfi_pop(ctx, 3);
- return code;
+ return pdfi_gs_setrgbcolor(ctx, Values[0], Values[1], Values[2]);
}
int pdfi_setcmykstroke(pdf_context *ctx)
{
- pdf_num *num;
double Values[4];
- int i, code;
+ int code;
- if (pdfi_count_stack(ctx) < 4) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ code = pdfi_destack_reals(ctx, Values, 4);
+ if (code < 0)
+ return code;
- for (i=0;i < 4;i++){
- num = (pdf_num *)ctx->stack_top[i - 4];
- if (num->type != PDF_INT) {
- if(num->type != PDF_REAL) {
- pdfi_pop(ctx, 4);
- return_error(gs_error_typecheck);
- }
- else
- Values[i] = num->value.d;
- } else {
- Values[i] = (double)num->value.i;
- }
- }
gs_swapcolors_quick(ctx->pgs);
code = pdfi_gs_setcmykcolor(ctx, Values[0], Values[1], Values[2], Values[3]);
gs_swapcolors_quick(ctx->pgs);
- pdfi_pop(ctx, 4);
+
return code;
}
int pdfi_setcmykfill(pdf_context *ctx)
{
- pdf_num *num;
double Values[4];
- int i, code;
+ int code;
- if (pdfi_count_stack(ctx) < 4) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ code = pdfi_destack_reals(ctx, Values, 4);
+ if (code < 0)
+ return code;
- for (i=0;i < 4;i++){
- num = (pdf_num *)ctx->stack_top[i - 4];
- if (num->type != PDF_INT) {
- if(num->type != PDF_REAL) {
- pdfi_pop(ctx, 4);
- return_error(gs_error_typecheck);
- }
- else
- Values[i] = num->value.d;
- } else {
- Values[i] = (double)num->value.i;
- }
- }
- code = pdfi_gs_setcmykcolor(ctx, Values[0], Values[1], Values[2], Values[3]);
- pdfi_pop(ctx, 4);
- return code;
+ return pdfi_gs_setcmykcolor(ctx, Values[0], Values[1], Values[2], Values[3]);
}
/* Do a setcolor using values in an array
@@ -675,27 +592,22 @@ int pdfi_setcolor_from_array(pdf_context *ctx, pdf_array *array)
static int
pdfi_get_color_from_stack(pdf_context *ctx, gs_client_color *cc, int ncomps)
{
- int i;
- pdf_num *n;
+ int i, code;
if (pdfi_count_stack(ctx) < ncomps) {
pdfi_clearstack(ctx);
return_error(gs_error_stackunderflow);
}
- for (i=0;i<ncomps;i++){
- n = (pdf_num *)ctx->stack_top[i - ncomps];
- if (n->type == PDF_INT) {
- cc->paint.values[i] = (float)n->value.i;
- } else {
- if (n->type == PDF_REAL) {
- cc->paint.values[i] = n->value.d;
- } else {
- pdfi_clearstack(ctx);
- return_error(gs_error_typecheck);
- }
+
+ for (i = 0; i < ncomps; i++) {
+ code = pdfi_obj_to_float(ctx, ctx->stack_top[i - ncomps], &cc->paint.values[i]);
+ if (code < 0) {
+ pdfi_clearstack(ctx);
+ return code;
}
}
pdfi_pop(ctx, ncomps);
+
return 0;
}
@@ -780,14 +692,20 @@ pdfi_setcolorN(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict, boo
if (pcs->type == &gs_color_space_type_Pattern)
is_pattern = true;
if (is_pattern) {
- if (ctx->stack_top[-1]->type != PDF_NAME) {
+ pdf_name *n = NULL;
+
+ if (pdfi_type_of(ctx->stack_top[-1]) != PDF_NAME) {
pdfi_clearstack(ctx);
- code = gs_note_error(gs_error_syntaxerror);
+ code = gs_note_error(gs_error_typecheck);
goto cleanupExit0;
}
- base_space = pcs->base_space;
- code = pdfi_pattern_set(ctx, stream_dict, page_dict, (pdf_name *)ctx->stack_top[-1], &cc);
+ n = (pdf_name *)ctx->stack_top[-1];
+ pdfi_countup(n);
pdfi_pop(ctx, 1);
+
+ base_space = pcs->base_space;
+ code = pdfi_pattern_set(ctx, stream_dict, page_dict, n, &cc);
+ pdfi_countdown(n);
if (code < 0) {
/* Ignore the pattern if we failed to set it */
pdfi_set_warning(ctx, 0, NULL, W_PDF_BADPATTERN, "pdfi_setcolorN", (char *)"PATTERN: Error setting pattern");
@@ -1125,14 +1043,19 @@ static int pdfi_create_iccbased(pdf_context *ctx, pdf_array *color_array, int in
}
code = pdfi_dict_knownget(ctx, dict, "Name", &Name);
if (code > 0) {
- if(Name->type == PDF_STRING || Name->type == PDF_NAME) {
- cname = (char *)gs_alloc_bytes(ctx->memory, ((pdf_name *)Name)->length + 1, "pdfi_create_iccbased (profile name)");
- if (cname == NULL) {
- code = gs_note_error(gs_error_VMerror);
- goto done;
- }
- memset(cname, 0x00, ((pdf_name *)Name)->length + 1);
- memcpy(cname, ((pdf_name *)Name)->data, ((pdf_name *)Name)->length);
+ switch (pdfi_type_of(Name)) {
+ case PDF_STRING:
+ case PDF_NAME:
+ cname = (char *)gs_alloc_bytes(ctx->memory, ((pdf_name *)Name)->length + 1, "pdfi_create_iccbased (profile name)");
+ if (cname == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto done;
+ }
+ memset(cname, 0x00, ((pdf_name *)Name)->length + 1);
+ memcpy(cname, ((pdf_name *)Name)->data, ((pdf_name *)Name)->length);
+ break;
+ default:
+ break;
}
}
if (code < 0)
@@ -1146,7 +1069,7 @@ static int pdfi_create_iccbased(pdf_context *ctx, pdf_array *color_array, int in
int i;
if (pdfi_array_size(a) >= N * 2) {
- for (i = 0; i < pdfi_array_size(a);i++) {
+ for (i = 0; i < N * 2;i++) {
code = pdfi_array_get_number(ctx, a, i, &dbl);
if (code < 0) {
known = false;
@@ -1218,7 +1141,7 @@ static int pdfi_create_iccbased(pdf_context *ctx, pdf_array *color_array, int in
code = pdfi_dict_knownget(ctx, dict, "Alternate", &Alternate);
if (code > 0) {
/* The Alternate should be one of the device spaces, therefore a Name object. If its not, fallback to using /N */
- if (Alternate->type == PDF_NAME)
+ if (pdfi_type_of(Alternate) == PDF_NAME)
code = pdfi_create_colorspace_by_name(ctx, (pdf_name *)Alternate, stream_dict,
page_dict, ppcs, inline_image);
pdfi_countdown(Alternate);
@@ -1639,23 +1562,23 @@ static int pdfi_create_Separation(pdf_context *ctx, pdf_array *color_array, int
if (code < 0)
goto pdfi_separation_error;
- if (o->type == PDF_NAME) {
- NamedAlternate = (pdf_name *)o;
- code = pdfi_create_colorspace_by_name(ctx, NamedAlternate, stream_dict, page_dict, &pcs_alt, inline_image);
- if (code < 0)
- goto pdfi_separation_error;
-
- } else {
- if (o->type == PDF_ARRAY) {
+ switch (pdfi_type_of(o)) {
+ case PDF_NAME:
+ NamedAlternate = (pdf_name *)o;
+ code = pdfi_create_colorspace_by_name(ctx, NamedAlternate, stream_dict, page_dict, &pcs_alt, inline_image);
+ if (code < 0)
+ goto pdfi_separation_error;
+ break;
+ case PDF_ARRAY:
ArrayAlternate = (pdf_array *)o;
code = pdfi_create_colorspace_by_array(ctx, ArrayAlternate, 0, stream_dict, page_dict, &pcs_alt, inline_image);
if (code < 0)
goto pdfi_separation_error;
- }
- else {
+ break;
+ default:
+ pdfi_countdown(o);
code = gs_error_typecheck;
goto pdfi_separation_error;
- }
}
code = pdfi_array_get(ctx, color_array, index + 3, &transform);
@@ -1814,14 +1737,14 @@ all_error:
if (code < 0)
goto pdfi_devicen_error;
- if (o->type == PDF_NAME) {
- NamedAlternate = (pdf_name *)o;
- code = pdfi_create_colorspace_by_name(ctx, NamedAlternate, stream_dict, page_dict, &pcs_alt, inline_image);
- if (code < 0)
- goto pdfi_devicen_error;
-
- } else {
- if (o->type == PDF_ARRAY) {
+ switch (pdfi_type_of(o)) {
+ case PDF_NAME:
+ NamedAlternate = (pdf_name *)o;
+ code = pdfi_create_colorspace_by_name(ctx, NamedAlternate, stream_dict, page_dict, &pcs_alt, inline_image);
+ if (code < 0)
+ goto pdfi_devicen_error;
+ break;
+ case PDF_ARRAY:
ArrayAlternate = (pdf_array *)o;
code = pdfi_create_colorspace_by_array(ctx, ArrayAlternate, 0, stream_dict, page_dict, &pcs_alt, inline_image);
if (code < 0)
@@ -1830,12 +1753,11 @@ all_error:
* paths count down ArrayAlternate.
*/
goto pdfi_devicen_error;
- }
- else {
+ break;
+ default:
code = gs_error_typecheck;
pdfi_countdown(o);
goto pdfi_devicen_error;
- }
}
/* Now the tint transform */
@@ -1889,21 +1811,24 @@ all_error:
if (code == 0) {
pcs->params.device_n.subtype = gs_devicen_DeviceN;
} else {
- if (subtype->type == PDF_NAME || subtype->type == PDF_STRING) {
- if (memcmp(((pdf_name *)subtype)->data, "DeviceN", 7) == 0) {
- pcs->params.device_n.subtype = gs_devicen_DeviceN;
- } else {
- if (memcmp(((pdf_name *)subtype)->data, "NChannel", 8) == 0) {
- pcs->params.device_n.subtype = gs_devicen_NChannel;
+ switch (pdfi_type_of(subtype)) {
+ case PDF_NAME:
+ case PDF_STRING:
+ if (memcmp(((pdf_name *)subtype)->data, "DeviceN", 7) == 0) {
+ pcs->params.device_n.subtype = gs_devicen_DeviceN;
} else {
- pdfi_countdown(subtype);
- goto pdfi_devicen_error;
+ if (memcmp(((pdf_name *)subtype)->data, "NChannel", 8) == 0) {
+ pcs->params.device_n.subtype = gs_devicen_NChannel;
+ } else {
+ pdfi_countdown(subtype);
+ goto pdfi_devicen_error;
+ }
}
- }
- pdfi_countdown(subtype);
- } else {
- pdfi_countdown(subtype);
- goto pdfi_devicen_error;
+ pdfi_countdown(subtype);
+ break;
+ default:
+ pdfi_countdown(subtype);
+ goto pdfi_devicen_error;
}
}
@@ -1944,21 +1869,24 @@ all_error:
goto pdfi_devicen_error;
}
- if (name->type == PDF_NAME || name->type == PDF_STRING) {
- pcs->params.device_n.process_names[ix] = (char *)gs_alloc_bytes(pcs->params.device_n.mem->non_gc_memory, ((pdf_name *)name)->length + 1, "pdfi_devicen(Processnames)");
- if (pcs->params.device_n.process_names[ix] == NULL) {
+ switch (pdfi_type_of(name)) {
+ case PDF_NAME:
+ case PDF_STRING:
+ pcs->params.device_n.process_names[ix] = (char *)gs_alloc_bytes(pcs->params.device_n.mem->non_gc_memory, ((pdf_name *)name)->length + 1, "pdfi_devicen(Processnames)");
+ if (pcs->params.device_n.process_names[ix] == NULL) {
+ pdfi_countdown(Components);
+ pdfi_countdown(name);
+ code = gs_error_VMerror;
+ goto pdfi_devicen_error;
+ }
+ memcpy(pcs->params.device_n.process_names[ix], ((pdf_name *)name)->data, ((pdf_name *)name)->length);
+ pcs->params.device_n.process_names[ix][((pdf_name *)name)->length] = 0x00;
+ pdfi_countdown(name);
+ break;
+ default:
pdfi_countdown(Components);
pdfi_countdown(name);
- code = gs_error_VMerror;
goto pdfi_devicen_error;
- }
- memcpy(pcs->params.device_n.process_names[ix], ((pdf_name *)name)->data, ((pdf_name *)name)->length);
- pcs->params.device_n.process_names[ix][((pdf_name *)name)->length] = 0x00;
- pdfi_countdown(name);
- } else {
- pdfi_countdown(Components);
- pdfi_countdown(name);
- goto pdfi_devicen_error;
}
}
pdfi_countdown(Components);
@@ -1979,17 +1907,26 @@ all_error:
goto pdfi_devicen_error;
do {
- if (Space->type != PDF_STRING && Space->type != PDF_NAME && Space->type != PDF_ARRAY) {
- pdfi_countdown(Space);
- pdfi_countdown(Colorant);
- code = gs_note_error(gs_error_typecheck);
- goto pdfi_devicen_error;
+ switch (pdfi_type_of(Space)) {
+ case PDF_STRING:
+ case PDF_NAME:
+ case PDF_ARRAY:
+ break;
+ default:
+ pdfi_countdown(Space);
+ pdfi_countdown(Colorant);
+ code = gs_note_error(gs_error_typecheck);
+ goto pdfi_devicen_error;
}
- if (Colorant->type != PDF_STRING && Colorant->type != PDF_NAME) {
- pdfi_countdown(Space);
- pdfi_countdown(Colorant);
- code = gs_note_error(gs_error_typecheck);
- goto pdfi_devicen_error;
+ switch (pdfi_type_of(Colorant)) {
+ case PDF_STRING:
+ case PDF_NAME:
+ break;
+ default:
+ pdfi_countdown(Space);
+ pdfi_countdown(Colorant);
+ code = gs_note_error(gs_error_typecheck);
+ goto pdfi_devicen_error;
}
code = pdfi_create_colorspace(ctx, Space, stream_dict, page_dict, &colorant_space, inline_image);
@@ -2115,11 +2052,14 @@ pdfi_create_indexed(pdf_context *ctx, pdf_array *color_array, int index,
if (code < 0)
goto exit;
- if (lookup->type == PDF_STREAM) {
+ switch (pdfi_type_of(lookup)) {
+ case PDF_STREAM:
code = pdfi_stream_to_buffer(ctx, (pdf_stream *)lookup, &Buffer, &lookup_length);
if (code < 0)
goto exit;
- } else if (lookup->type == PDF_STRING) {
+ break;
+ case PDF_STRING:
+ {
/* This is not legal, but Acrobat seems to accept it */
pdf_string *lookup_string = (pdf_string *)lookup; /* alias */
@@ -2131,7 +2071,9 @@ pdfi_create_indexed(pdf_context *ctx, pdf_array *color_array, int index,
memcpy(Buffer, lookup_string->data, lookup_string->length);
lookup_length = lookup_string->length;
- } else {
+ break;
+ }
+ default:
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -2208,6 +2150,7 @@ static int pdfi_create_DeviceGray(pdf_context *ctx, gs_color_space **ppcs)
}
} else {
code = pdfi_gs_setgray(ctx, 0);
+ pdfi_set_colour_callback(ctx->pgs->color[0].color_space, ctx, pdfi_cspace_free_callback);
}
return code;
}
@@ -2236,6 +2179,7 @@ static int pdfi_create_DeviceRGB(pdf_context *ctx, gs_color_space **ppcs)
}
} else {
code = pdfi_gs_setrgbcolor(ctx, 0, 0, 0);
+ pdfi_set_colour_callback(ctx->pgs->color[0].color_space, ctx, pdfi_cspace_free_callback);
}
return code;
}
@@ -2264,6 +2208,7 @@ static int pdfi_create_DeviceCMYK(pdf_context *ctx, gs_color_space **ppcs)
}
} else {
code = pdfi_gs_setcmykcolor(ctx, 0, 0, 0, 1);
+ pdfi_set_colour_callback(ctx->pgs->color[0].color_space, ctx, pdfi_cspace_free_callback);
}
return code;
}
@@ -2352,7 +2297,7 @@ pdfi_create_colorspace_by_array(pdf_context *ctx, pdf_array *color_array, int in
if (code < 0)
goto exit;
- if (a->type != PDF_ARRAY) {
+ if (pdfi_type_of(a) != PDF_ARRAY) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -2416,11 +2361,15 @@ pdfi_create_colorspace_by_name(pdf_context *ctx, pdf_name *name,
if (code < 0)
return code;
- if (ref_space->type == PDF_NAME) {
+ if (pdfi_type_of(ref_space) == PDF_NAME) {
if (ref_space->object_num != 0 && ref_space->object_num == name->object_num) {
pdfi_countdown(ref_space);
return_error(gs_error_circular_reference);
}
+ if (((pdf_name *)ref_space)->length <= 0) {
+ pdfi_countdown(ref_space);
+ return_error(gs_error_syntaxerror);
+ }
}
/* recursion */
@@ -2492,15 +2441,16 @@ int pdfi_create_colorspace(pdf_context *ctx, pdf_obj *space, pdf_dict *stream_di
if (code < 0)
return code;
- if (space->type == PDF_NAME) {
+ switch (pdfi_type_of(space)) {
+ case PDF_NAME:
code = pdfi_create_colorspace_by_name(ctx, (pdf_name *)space, stream_dict, page_dict, ppcs, inline_image);
- } else {
- if (space->type == PDF_ARRAY) {
- code = pdfi_create_colorspace_by_array(ctx, (pdf_array *)space, 0, stream_dict, page_dict, ppcs, inline_image);
- } else {
- pdfi_loop_detector_cleartomark(ctx);
- return_error(gs_error_typecheck);
- }
+ break;
+ case PDF_ARRAY:
+ code = pdfi_create_colorspace_by_array(ctx, (pdf_array *)space, 0, stream_dict, page_dict, ppcs, inline_image);
+ break;
+ default:
+ pdfi_loop_detector_cleartomark(ctx);
+ return_error(gs_error_typecheck);
}
if (code >= 0 && ppcs && *ppcs)
(void)(*ppcs)->type->install_cspace(*ppcs, ctx->pgs);
@@ -2518,36 +2468,46 @@ int pdfi_setcolorspace(pdf_context *ctx, pdf_obj *space, pdf_dict *stream_dict,
int pdfi_setstrokecolor_space(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
{
int code;
+ pdf_obj *n = NULL;
if (pdfi_count_stack(ctx) < 1)
return_error(gs_error_stackunderflow);
- if (ctx->stack_top[-1]->type != PDF_NAME) {
+ if (pdfi_type_of(ctx->stack_top[-1]) != PDF_NAME) {
pdfi_pop(ctx, 1);
- return_error(gs_error_stackunderflow);
+ return_error(gs_error_typecheck);
}
+ n = ctx->stack_top[-1];
+ pdfi_countup(n);
+ pdfi_pop(ctx, 1);
+
gs_swapcolors_quick(ctx->pgs);
- code = pdfi_setcolorspace(ctx, ctx->stack_top[-1], stream_dict, page_dict);
+ code = pdfi_setcolorspace(ctx, n, stream_dict, page_dict);
gs_swapcolors_quick(ctx->pgs);
- pdfi_pop(ctx, 1);
+ pdfi_countdown(n);
return code;
}
int pdfi_setfillcolor_space(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
{
int code;
+ pdf_obj *n = NULL;
if (pdfi_count_stack(ctx) < 1)
return_error(gs_error_stackunderflow);
- if (ctx->stack_top[-1]->type != PDF_NAME) {
+ if (pdfi_type_of(ctx->stack_top[-1]) != PDF_NAME) {
pdfi_pop(ctx, 1);
- return_error(gs_error_stackunderflow);
+ return_error(gs_error_typecheck);
}
- code = pdfi_setcolorspace(ctx, ctx->stack_top[-1], stream_dict, page_dict);
+ n = ctx->stack_top[-1];
+ pdfi_countup(n);
pdfi_pop(ctx, 1);
+ code = pdfi_setcolorspace(ctx, n, stream_dict, page_dict);
+
+ pdfi_countdown(n);
return code;
}
@@ -2790,7 +2750,7 @@ static int Check_Default_Space(pdf_context *ctx, pdf_obj *space, pdf_dict *sourc
pdf_obj *ref_space = NULL;
int code = 0;
- if (space->type == PDF_NAME)
+ if (pdfi_type_of(space) == PDF_NAME)
{
if (pdfi_name_is((const pdf_name *)space, "DeviceGray"))
return (num_components == 1 ? 0 : gs_error_rangecheck);
@@ -2804,7 +2764,7 @@ static int Check_Default_Space(pdf_context *ctx, pdf_obj *space, pdf_dict *sourc
if (code < 0)
return code;
- if (ref_space->type == PDF_NAME) {
+ if (pdfi_type_of(ref_space) == PDF_NAME) {
if (ref_space->object_num != 0 && ref_space->object_num == space->object_num) {
pdfi_countdown(ref_space);
return_error(gs_error_circular_reference);
@@ -2827,12 +2787,12 @@ static int Check_Default_Space(pdf_context *ctx, pdf_obj *space, pdf_dict *sourc
space = ref_space;
}
- if (space->type == PDF_ARRAY) {
+ if (pdfi_type_of(space) == PDF_ARRAY) {
code = pdfi_array_get(ctx, (pdf_array *)space, 0, &primary);
if (code < 0)
goto exit;
- if (primary->type == PDF_NAME) {
+ if (pdfi_type_of(primary) == PDF_NAME) {
if (pdfi_name_is((pdf_name *)primary, "Lab")) {
code = gs_note_error(gs_error_typecheck);
goto exit;
diff --git a/pdf/pdf_colour.h b/pdf/pdf_colour.h
index 263c3d9d..b279c2f8 100644
--- a/pdf/pdf_colour.h
+++ b/pdf/pdf_colour.h
@@ -27,7 +27,7 @@ static inline void pdfi_set_colourspace_name(pdf_context *ctx, gs_color_space *p
{
if (pcs->interpreter_data != NULL) {
pdf_obj *o = (pdf_obj *)(pcs->interpreter_data);
- if (o != NULL && o->type == PDF_NAME) {
+ if (o != NULL && pdfi_type_of(o) == PDF_NAME) {
pdfi_countdown(o);
pcs->interpreter_data = NULL;
}
@@ -53,7 +53,7 @@ static inline int check_same_current_space(pdf_context *ctx, pdf_name *n)
{
pdf_obj *o = (pdf_obj *)(ctx->pgs->color[0].color_space->interpreter_data);
- if (o == NULL || o->type != PDF_NAME)
+ if (o == NULL || pdfi_type_of(o) != PDF_NAME)
return 0;
if (pdfi_name_cmp(n, (pdf_name *)o) == 0) {
diff --git a/pdf/pdf_deref.c b/pdf/pdf_deref.c
index 91d77f63..d444e0c7 100644
--- a/pdf/pdf_deref.c
+++ b/pdf/pdf_deref.c
@@ -45,6 +45,9 @@ static int pdfi_add_to_cache(pdf_context *ctx, pdf_obj *o)
{
pdf_obj_cache_entry *entry;
+ if (o < PDF_TOKEN_AS_OBJ(TOKEN__LAST_KEY))
+ return 0;
+
if (ctx->xref_table->xref[o->object_num].cache != NULL) {
#if DEBUG_CACHE
dmprintf1(ctx->memory, "Attempting to add object %d to cache when the object is already cached!\n", o->object_num);
@@ -200,7 +203,6 @@ static int pdfi_read_stream_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_
{
int code = 0;
int64_t i;
- pdf_keyword *keyword = NULL;
pdf_dict *dict = NULL;
gs_offset_t offset;
pdf_stream *stream_obj = NULL;
@@ -222,14 +224,15 @@ static int pdfi_read_stream_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_
return_error(gs_error_stackunderflow);
dict = (pdf_dict *)ctx->stack_top[-1];
- dict->indirect_num = dict->object_num = objnum;
- dict->indirect_gen = dict->generation_num = gen;
- if (dict->type != PDF_DICT) {
+ if (pdfi_type_of(dict) != PDF_DICT) {
pdfi_pop(ctx, 1);
return_error(gs_error_syntaxerror);
}
+ dict->indirect_num = dict->object_num = objnum;
+ dict->indirect_gen = dict->generation_num = gen;
+
/* Convert the dict into a stream */
code = pdfi_obj_dict_to_stream(ctx, dict, &stream_obj, true);
if (code < 0) {
@@ -258,12 +261,16 @@ static int pdfi_read_stream_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_
pdfi_countdown(stream_obj); /* get rid of extra ref */
return code;
}
- if (pdfi_loop_detector_check_object(ctx, stream_obj->object_num))
+ if (pdfi_loop_detector_check_object(ctx, stream_obj->object_num)) {
+ pdfi_countdown(stream_obj); /* get rid of extra ref */
+ pdfi_loop_detector_cleartomark(ctx);
return_error(gs_error_circular_reference);
+ }
code = pdfi_loop_detector_add_object(ctx, stream_obj->object_num);
if (code < 0) {
pdfi_countdown(stream_obj); /* get rid of extra ref */
+ pdfi_loop_detector_cleartomark(ctx);
return code;
}
@@ -305,8 +312,8 @@ static int pdfi_read_stream_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_
stream_obj->Length = 0;
stream_obj->length_valid = false;
- code = pdfi_read_token(ctx, ctx->main_stream, objnum, gen);
- if (code < 0 || pdfi_count_stack(ctx) < 2) {
+ code = pdfi_read_bare_keyword(ctx, ctx->main_stream);
+ if (code == 0) {
char extra_info[gp_file_name_sizeof];
gs_snprintf(extra_info, sizeof(extra_info), "Failed to find a valid object at end of stream object %u.\n", objnum);
@@ -318,34 +325,27 @@ static int pdfi_read_stream_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_
pdfi_countdown(stream_obj); /* get rid of extra ref */
return code;
}
- }
- else {
- if (((pdf_obj *)ctx->stack_top[-1])->type != PDF_KEYWORD) {
- char extra_info[gp_file_name_sizeof];
+ } else if (code < 0) {
+ char extra_info[gp_file_name_sizeof];
- gs_snprintf(extra_info, sizeof(extra_info), "Failed to find 'endstream' keyword at end of stream object %u.\n", objnum);
- pdfi_set_error(ctx, 0, NULL, E_PDF_MISSINGENDOBJ, "pdfi_read_stream_object", extra_info);
- } else {
- keyword = ((pdf_keyword *)ctx->stack_top[-1]);
- if (keyword->key != TOKEN_ENDSTREAM) {
- char extra_info[gp_file_name_sizeof];
-
- gs_snprintf(extra_info, sizeof(extra_info), "Stream object %u has an incorrect /Length of %"PRIu64"\n", objnum, i);
- pdfi_log_info(ctx, "pdfi_read_stream_object", extra_info);
- } else {
- /* Cache the Length in the stream object and mark it valid */
- stream_obj->Length = i;
- stream_obj->length_valid = true;
- }
- }
- pdfi_pop(ctx, 1);
+ gs_snprintf(extra_info, sizeof(extra_info), "Failed to find 'endstream' keyword at end of stream object %u.\n", objnum);
+ pdfi_set_error(ctx, 0, NULL, E_PDF_MISSINGENDOBJ, "pdfi_read_stream_object", extra_info);
+ } else if (code != TOKEN_ENDSTREAM) {
+ char extra_info[gp_file_name_sizeof];
+
+ gs_snprintf(extra_info, sizeof(extra_info), "Stream object %u has an incorrect /Length of %"PRIu64"\n", objnum, i);
+ pdfi_log_info(ctx, "pdfi_read_stream_object", extra_info);
+ } else {
+ /* Cache the Length in the stream object and mark it valid */
+ stream_obj->Length = i;
+ stream_obj->length_valid = true;
}
}
/* If we failed to find a valid object, or the object wasn't a keyword, or the
* keywrod wasn't 'endstream' then the Length is wrong. We need to have the correct
* Length for streams if we have encrypted files, because we must install a
- * SubFileDecode filter iwth a Length (EODString is incompatible with AES encryption)
+ * SubFileDecode filter with a Length (EODString is incompatible with AES encryption)
* Rather than mess about checking for encryption, we'll choose to just correctly
* calculate the Length of all streams. Although this takes time, it will only
* happen for files which are invalid.
@@ -393,7 +393,7 @@ static int pdfi_read_stream_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_
return 0;
}
- code = pdfi_read_token(ctx, ctx->main_stream, objnum, gen);
+ code = pdfi_read_bare_keyword(ctx, ctx->main_stream);
if (code < 0) {
pdfi_countdown(stream_obj); /* get rid of extra ref */
if (ctx->args.pdfstoponerror)
@@ -406,14 +406,13 @@ static int pdfi_read_stream_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_
return 0;
}
- if (pdfi_count_stack(ctx) < 2) {
+ if (code == 0) {
pdfi_countdown(stream_obj); /* get rid of extra ref */
return_error(gs_error_stackunderflow);
}
- if (((pdf_obj *)ctx->stack_top[-1])->type != PDF_KEYWORD) {
+ if (code != TOKEN_ENDOBJ) {
pdfi_countdown(stream_obj); /* get rid of extra ref */
- pdfi_pop(ctx, 1);
if (ctx->args.pdfstoponerror)
return_error(gs_error_typecheck);
pdfi_set_error(ctx, 0, NULL, E_PDF_MISSINGENDOBJ, "pdfi_read_stream_object", NULL);
@@ -424,12 +423,6 @@ static int pdfi_read_stream_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_
}
pdfi_countdown(stream_obj); /* get rid of extra ref */
- keyword = ((pdf_keyword *)ctx->stack_top[-1]);
- if (keyword->key != TOKEN_ENDOBJ) {
- pdfi_pop(ctx, 2);
- return_error(gs_error_typecheck);
- }
- pdfi_pop(ctx, 1);
return 0;
}
@@ -440,10 +433,12 @@ static int pdfi_read_stream_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_
*/
int pdfi_read_bare_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_t stream_offset, uint32_t objnum, uint32_t gen)
{
- int code = 0;
- pdf_keyword *keyword = NULL;
+ int code = 0, initial_depth = 0;
+ pdf_key keyword;
gs_offset_t saved_offset[3];
+ pdf_obj_type type;
+ initial_depth = pdfi_count_stack(ctx);
saved_offset[0] = saved_offset[1] = saved_offset[2] = 0;
code = pdfi_read_token(ctx, s, objnum, gen);
@@ -468,13 +463,16 @@ int pdfi_read_bare_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_t stream_
if (s->eof)
return_error(gs_error_syntaxerror);
code = 0;
- }while (ctx->stack_top[-1]->type != PDF_KEYWORD);
+ type = pdfi_type_of(ctx->stack_top[-1]);
+ if (type == PDF_KEYWORD)
+ goto missing_endobj;
+ } while (type != PDF_FAST_KEYWORD);
- keyword = ((pdf_keyword *)ctx->stack_top[-1]);
- if (keyword->key == TOKEN_ENDOBJ) {
+ keyword = (pdf_key)(uintptr_t)(ctx->stack_top[-1]);
+ if (keyword == TOKEN_ENDOBJ) {
pdf_obj *o;
- if (pdfi_count_stack(ctx) < 2) {
+ if (pdfi_count_stack(ctx) - initial_depth < 2) {
pdfi_clearstack(ctx);
return_error(gs_error_stackunderflow);
}
@@ -483,21 +481,23 @@ int pdfi_read_bare_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_t stream_
pdfi_pop(ctx, 1);
- o->indirect_num = o->object_num = objnum;
- o->indirect_gen = o->generation_num = gen;
+ if (o >= PDF_TOKEN_AS_OBJ(TOKEN__LAST_KEY)) {
+ o->indirect_num = o->object_num = objnum;
+ o->indirect_gen = o->generation_num = gen;
+ }
return code;
}
- if (keyword->key == TOKEN_STREAM) {
+ if (keyword == TOKEN_STREAM) {
pdfi_pop(ctx, 1);
return pdfi_read_stream_object(ctx, s, stream_offset, objnum, gen);
}
- if (keyword->key == TOKEN_OBJ) {
+ if (keyword == TOKEN_OBJ) {
pdf_obj *o;
pdfi_set_error(ctx, 0, NULL, E_PDF_MISSINGENDOBJ, "pdfi_read_bare_object", NULL);
/* 4 for; the object we want, the object number, generation number and 'obj' keyword */
- if (pdfi_count_stack(ctx) < 4)
+ if (pdfi_count_stack(ctx) - initial_depth < 4)
return_error(gs_error_stackunderflow);
/* If we have that many objects, assume that we can throw away the x y obj and just use the remaining object */
@@ -505,28 +505,33 @@ int pdfi_read_bare_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_t stream_
pdfi_pop(ctx, 3);
- o->indirect_num = o->object_num = objnum;
- o->indirect_gen = o->generation_num = gen;
+ if (pdfi_type_of(o) != PDF_BOOL && pdfi_type_of(o) != PDF_NULL && pdfi_type_of(o) != PDF_FAST_KEYWORD) {
+ o->indirect_num = o->object_num = objnum;
+ o->indirect_gen = o->generation_num = gen;
+ }
if (saved_offset[0] > 0)
(void)pdfi_seek(ctx, s, saved_offset[0], SEEK_SET);
return 0;
}
+missing_endobj:
/* Assume that any other keyword means a missing 'endobj' */
if (!ctx->args.pdfstoponerror) {
pdf_obj *o;
pdfi_set_error(ctx, 0, NULL, E_PDF_MISSINGENDOBJ, "pdfi_read_bare_object", NULL);
- if (pdfi_count_stack(ctx) < 2)
+ if (pdfi_count_stack(ctx) - initial_depth < 2)
return_error(gs_error_stackunderflow);
o = ctx->stack_top[-2];
pdfi_pop(ctx, 1);
- o->indirect_num = o->object_num = objnum;
- o->indirect_gen = o->generation_num = gen;
+ if (pdfi_type_of(o) != PDF_BOOL && pdfi_type_of(o) != PDF_NULL && pdfi_type_of(o) != PDF_FAST_KEYWORD) {
+ o->indirect_num = o->object_num = objnum;
+ o->indirect_gen = o->generation_num = gen;
+ }
return code;
}
pdfi_pop(ctx, 2);
@@ -535,60 +540,34 @@ int pdfi_read_bare_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_t stream_
static int pdfi_read_object(pdf_context *ctx, pdf_c_stream *s, gs_offset_t stream_offset)
{
- int code = 0, stack_size = pdfi_count_stack(ctx);
- uint64_t objnum = 0, gen = 0;
- pdf_keyword *keyword = NULL;
+ int code = 0;
+ int objnum = 0, gen = 0;
/* An object consists of 'num gen obj' followed by a token, follwed by an endobj
* A stream dictionary might have a 'stream' instead of an 'endobj', in which case we
* want to deal with it specially by getting the Length, jumping to the end and checking
* for an endobj. Or not, possibly, because it would be slow.
*/
- code = pdfi_read_token(ctx, s, 0, 0);
+ code = pdfi_read_bare_int(ctx, s, &objnum);
if (code < 0)
return code;
if (code == 0)
return_error(gs_error_syntaxerror);
- if (stack_size >= pdfi_count_stack(ctx))
- return gs_note_error(gs_error_ioerror);
- if (((pdf_obj *)ctx->stack_top[-1])->type != PDF_INT) {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- objnum = ((pdf_num *)ctx->stack_top[-1])->value.i;
- pdfi_pop(ctx, 1);
-
- code = pdfi_read_token(ctx, s, 0, 0);
+ code = pdfi_read_bare_int(ctx, s, &gen);
if (code < 0)
return code;
if (code == 0)
return_error(gs_error_syntaxerror);
- if (stack_size >= pdfi_count_stack(ctx))
- return gs_note_error(gs_error_ioerror);
- if (((pdf_obj *)ctx->stack_top[-1])->type != PDF_INT) {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- gen = ((pdf_num *)ctx->stack_top[-1])->value.i;
- pdfi_pop(ctx, 1);
-
- code = pdfi_read_token(ctx, s, 0, 0);
+ code = pdfi_read_bare_keyword(ctx, s);
if (code < 0)
return code;
- if (stack_size >= pdfi_count_stack(ctx))
+ if (code == 0)
return gs_note_error(gs_error_ioerror);
- if (((pdf_obj *)ctx->stack_top[-1])->type != PDF_KEYWORD) {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- keyword = ((pdf_keyword *)ctx->stack_top[-1]);
- if (keyword->key != TOKEN_OBJ) {
- pdfi_pop(ctx, 1);
+ if (code != TOKEN_OBJ) {
return_error(gs_error_syntaxerror);
}
- pdfi_pop(ctx, 1);
return pdfi_read_bare_object(ctx, s, stream_offset, objnum, gen);
}
@@ -602,13 +581,13 @@ static int pdfi_deref_compressed(pdf_context *ctx, uint64_t obj, uint64_t gen, p
pdf_c_stream *SubFile_stream = NULL;
pdf_c_stream *Object_stream = NULL;
int i = 0, object_length = 0;
- int64_t num_entries, found_object;
- int64_t Length;
+ int64_t num_entries;
+ int found_object;
+ int64_t Length, First;
gs_offset_t offset = 0;
pdf_stream *compressed_object = NULL;
pdf_dict *compressed_sdict = NULL; /* alias */
pdf_name *Type = NULL;
- pdf_obj *temp_obj;
if (entry->u.compressed.compressed_stream_num > ctx->xref_table->xref_size - 1)
return_error(gs_error_undefined);
@@ -637,7 +616,7 @@ static int pdfi_deref_compressed(pdf_context *ctx, uint64_t obj, uint64_t gen, p
goto exit;
}
- if ((ctx->stack_top[-1])->type != PDF_STREAM) {
+ if (pdfi_type_of(ctx->stack_top[-1]) != PDF_STREAM) {
pdfi_pop(ctx, 1);
code = gs_note_error(gs_error_typecheck);
goto exit;
@@ -666,31 +645,70 @@ static int pdfi_deref_compressed(pdf_context *ctx, uint64_t obj, uint64_t gen, p
if (code < 0)
return code;
+ if (ctx->loop_detection != NULL) {
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0)
+ goto exit;
+ if (compressed_sdict->object_num != 0) {
+ if (pdfi_loop_detector_check_object(ctx, compressed_sdict->object_num)) {
+ code = gs_note_error(gs_error_circular_reference);
+ } else {
+ code = pdfi_loop_detector_add_object(ctx, compressed_sdict->object_num);
+ }
+ if (code < 0) {
+ (void)pdfi_loop_detector_cleartomark(ctx);
+ goto exit;
+ }
+ }
+ }
/* Check its an ObjStm ! */
code = pdfi_dict_get_type(ctx, compressed_sdict, "Type", PDF_NAME, (pdf_obj **)&Type);
- if (code < 0)
+ if (code < 0) {
+ if (ctx->loop_detection != NULL)
+ (void)pdfi_loop_detector_cleartomark(ctx);
goto exit;
+ }
if (!pdfi_name_is(Type, "ObjStm")){
+ if (ctx->loop_detection != NULL)
+ (void)pdfi_loop_detector_cleartomark(ctx);
code = gs_note_error(gs_error_syntaxerror);
goto exit;
}
/* Need to check the /N entry to see if the object is actually in this stream! */
code = pdfi_dict_get_int(ctx, compressed_sdict, "N", &num_entries);
- if (code < 0)
+ if (code < 0) {
+ if (ctx->loop_detection != NULL)
+ (void)pdfi_loop_detector_cleartomark(ctx);
goto exit;
+ }
if (num_entries < 0 || num_entries > ctx->xref_table->xref_size) {
+ if (ctx->loop_detection != NULL)
+ (void)pdfi_loop_detector_cleartomark(ctx);
code = gs_note_error(gs_error_rangecheck);
goto exit;
}
- code = pdfi_seek(ctx, ctx->main_stream, pdfi_stream_offset(ctx, compressed_object), SEEK_SET);
- if (code < 0)
+ code = pdfi_dict_get_int(ctx, compressed_sdict, "Length", &Length);
+ if (code < 0) {
+ if (ctx->loop_detection != NULL)
+ (void)pdfi_loop_detector_cleartomark(ctx);
goto exit;
+ }
- code = pdfi_dict_get_int(ctx, compressed_sdict, "Length", &Length);
+ code = pdfi_dict_get_int(ctx, compressed_sdict, "First", &First);
+ if (code < 0) {
+ if (ctx->loop_detection != NULL)
+ (void)pdfi_loop_detector_cleartomark(ctx);
+ goto exit;
+ }
+
+ if (ctx->loop_detection != NULL)
+ (void)pdfi_loop_detector_cleartomark(ctx);
+
+ code = pdfi_seek(ctx, ctx->main_stream, pdfi_stream_offset(ctx, compressed_object), SEEK_SET);
if (code < 0)
goto exit;
@@ -703,57 +721,86 @@ static int pdfi_deref_compressed(pdf_context *ctx, uint64_t obj, uint64_t gen, p
goto exit;
for (i=0;i < num_entries;i++)
- {
- code = pdfi_read_token(ctx, compressed_stream, obj, gen);
- if (code < 0)
- goto exit;
- if (code == 0) {
- code = gs_note_error(gs_error_syntaxerror);
- goto exit;
- }
- temp_obj = ctx->stack_top[-1];
- if (temp_obj->type != PDF_INT) {
- code = gs_note_error(gs_error_typecheck);
- pdfi_pop(ctx, 1);
- goto exit;
- }
- found_object = ((pdf_num *)temp_obj)->value.i;
- pdfi_pop(ctx, 1);
- code = pdfi_read_token(ctx, compressed_stream, obj, gen);
- if (code < 0)
- goto exit;
- if (code == 0) {
- code = gs_note_error(gs_error_syntaxerror);
- goto exit;
- }
- temp_obj = ctx->stack_top[-1];
- if (temp_obj->type != PDF_INT) {
- pdfi_pop(ctx, 1);
- code = gs_note_error(gs_error_typecheck);
+ {
+ int new_offset;
+ code = pdfi_read_bare_int(ctx, compressed_stream, &found_object);
+ if (code < 0)
+ goto exit;
+ if (code == 0) {
+ code = gs_note_error(gs_error_syntaxerror);
+ goto exit;
+ }
+ code = pdfi_read_bare_int(ctx, compressed_stream, &new_offset);
+ if (code < 0)
+ goto exit;
+ if (code == 0) {
+ code = gs_note_error(gs_error_syntaxerror);
+ goto exit;
+ }
+ if (i == entry->u.compressed.object_index) {
+ if (found_object != obj) {
+ code = gs_note_error(gs_error_undefined);
goto exit;
}
- if (i == entry->u.compressed.object_index) {
- if (found_object != obj) {
- pdfi_pop(ctx, 1);
- code = gs_note_error(gs_error_undefined);
- goto exit;
- }
- offset = ((pdf_num *)temp_obj)->value.i;
- }
- if (i == entry->u.compressed.object_index + 1)
- object_length = ((pdf_num *)temp_obj)->value.i - offset;
- pdfi_pop(ctx, 1);
+ offset = new_offset;
+ }
+ if (i == entry->u.compressed.object_index + 1)
+ object_length = new_offset - offset;
+ }
+
+ /* Bug #705259 - The first object need not lie immediately after the initial
+ * table of object numbers and offsets. The start of the first object is given
+ * by the value of First. We don't know how many bytes we consumed getting to
+ * the end of the table, unfortunately, so we close the stream, rewind the main
+ * stream back to the beginning of the ObjStm, and then read and discard 'First'
+ * bytes in order to get to the start of the first object. Then we read the
+ * number of bytes required to get from there to the start of the object we
+ * actually want.
+ * If this ever looks like it's causing performance problems we could read the
+ * initial table above manually instead of using the existing code, and track
+ * how many bytes we'd read, which would avoid us having to tear down and
+ * rebuild the stream.
+ */
+ if (compressed_stream)
+ pdfi_close_file(ctx, compressed_stream);
+ if (SubFile_stream)
+ pdfi_close_file(ctx, SubFile_stream);
+
+ code = pdfi_seek(ctx, ctx->main_stream, pdfi_stream_offset(ctx, compressed_object), SEEK_SET);
+ if (code < 0)
+ goto exit;
+
+ /* We already dereferenced this above, so we don't need the loop detection checking here */
+ code = pdfi_dict_get_int(ctx, compressed_sdict, "Length", &Length);
+ if (code < 0)
+ goto exit;
+
+ code = pdfi_apply_SubFileDecode_filter(ctx, Length, NULL, ctx->main_stream, &SubFile_stream, false);
+ if (code < 0)
+ goto exit;
+
+ code = pdfi_filter(ctx, compressed_object, SubFile_stream, &compressed_stream, false);
+ if (code < 0)
+ goto exit;
+
+ for (i=0;i < First;i++)
+ {
+ int c = pdfi_read_byte(ctx, compressed_stream);
+ if (c < 0) {
+ code = gs_note_error(gs_error_ioerror);
+ goto exit;
}
+ }
/* Skip to the offset of the object we want to read */
for (i=0;i < offset;i++)
- {
- int c = pdfi_read_byte(ctx, compressed_stream);
- if (c < 0) {
- code = gs_note_error(gs_error_ioerror);
- goto exit;
- }
+ {
+ int c = pdfi_read_byte(ctx, compressed_stream);
+ if (c < 0) {
+ code = gs_note_error(gs_error_ioerror);
+ goto exit;
}
+ }
/* If object_length is not 0, then we want to apply a SubFileDecode filter to limit
* the number of bytes we read to the declared size of the object (difference between
@@ -777,7 +824,7 @@ static int pdfi_deref_compressed(pdf_context *ctx, uint64_t obj, uint64_t gen, p
code = gs_note_error(gs_error_syntaxerror);
goto exit;
}
- if (ctx->stack_top[-1]->type == PDF_ARRAY_MARK || ctx->stack_top[-1]->type == PDF_DICT_MARK) {
+ if (pdfi_type_of(ctx->stack_top[-1]) == PDF_ARRAY_MARK || pdfi_type_of(ctx->stack_top[-1]) == PDF_DICT_MARK) {
int start_depth = pdfi_count_stack(ctx);
/* Need to read all the elements from COS objects */
@@ -793,16 +840,18 @@ static int pdfi_deref_compressed(pdf_context *ctx, uint64_t obj, uint64_t gen, p
code = gs_note_error(gs_error_ioerror);
goto exit;
}
- }while ((ctx->stack_top[-1]->type != PDF_ARRAY && ctx->stack_top[-1]->type != PDF_DICT) || pdfi_count_stack(ctx) > start_depth);
+ } while ((pdfi_type_of(ctx->stack_top[-1]) != PDF_ARRAY && pdfi_type_of(ctx->stack_top[-1]) != PDF_DICT) || pdfi_count_stack(ctx) > start_depth);
}
*object = ctx->stack_top[-1];
/* For compressed objects we don't get a 'obj gen obj' sequence which is what sets
* the object number for uncompressed objects. So we need to do that here.
*/
- (*object)->indirect_num = (*object)->object_num = obj;
- (*object)->indirect_gen = (*object)->generation_num = gen;
- pdfi_countup(*object);
+ if (*object >= PDF_TOKEN_AS_OBJ(TOKEN__LAST_KEY)) {
+ (*object)->indirect_num = (*object)->object_num = obj;
+ (*object)->indirect_gen = (*object)->generation_num = gen;
+ pdfi_countup(*object);
+ }
pdfi_pop(ctx, 1);
if (cache) {
@@ -850,10 +899,15 @@ static int pdfi_dereference_main(pdf_context *ctx, uint64_t obj, uint64_t gen, p
if(ctx->args.pdfstoponerror)
return_error(gs_error_rangecheck);
- code = pdfi_object_alloc(ctx, PDF_NULL, 0, object);
- if (code == 0)
- pdfi_countup(*object);
- return code;
+ code = pdfi_repair_file(ctx);
+ if (code < 0) {
+ *object = PDF_NULL_OBJ;
+ return code;
+ }
+ if (obj >= ctx->xref_table->xref_size) {
+ *object = PDF_NULL_OBJ;
+ return_error(gs_error_rangecheck);
+ }
}
entry = &ctx->xref_table->xref[obj];
@@ -924,11 +978,8 @@ static int pdfi_dereference_main(pdf_context *ctx, uint64_t obj, uint64_t gen, p
int code1 = 0;
if (entry->free) {
dmprintf2(ctx->memory, "Dereference of free object %"PRIu64", next object number as offset failed (code = %d), returning NULL object.\n", entry->object_num, code);
- code = pdfi_object_alloc(ctx, PDF_NULL, 1, object);
- if (code >= 0) {
- pdfi_countup(*object);
- goto free_obj;
- }
+ *object = PDF_NULL_OBJ;
+ goto free_obj;
}
ctx->encryption.decrypt_strings = saved_decrypt_strings;
(void)pdfi_seek(ctx, ctx->main_stream, saved_stream_offset, SEEK_SET);
@@ -941,10 +992,22 @@ static int pdfi_dereference_main(pdf_context *ctx, uint64_t obj, uint64_t gen, p
return code;
}
- if (pdfi_count_stack(ctx) > 0 && (ctx->stack_top[-1])->object_num == obj) {
+ if (pdfi_count_stack(ctx) > 0 &&
+ (ctx->stack_top[-1] > PDF_TOKEN_AS_OBJ(TOKEN__LAST_KEY) &&
+ (ctx->stack_top[-1])->object_num == obj)) {
*object = ctx->stack_top[-1];
pdfi_countup(*object);
pdfi_pop(ctx, 1);
+ if (pdfi_type_of(*object) == PDF_INDIRECT) {
+ pdf_indirect_ref *iref = (pdf_indirect_ref *)*object;
+
+ if (iref->ref_object_num == obj) {
+ code = gs_note_error(gs_error_circular_reference);
+ pdfi_countdown(*object);
+ *object = NULL;
+ goto error;
+ }
+ }
if (cache) {
code = pdfi_add_to_cache(ctx, *object);
if (code < 0) {
@@ -956,10 +1019,8 @@ static int pdfi_dereference_main(pdf_context *ctx, uint64_t obj, uint64_t gen, p
pdfi_pop(ctx, 1);
if (entry->free) {
dmprintf1(ctx->memory, "Dereference of free object %"PRIu64", next object number as offset failed, returning NULL object.\n", entry->object_num);
- code = pdfi_object_alloc(ctx, PDF_NULL, 1, object);
- if (code >= 0)
- pdfi_countup(*object);
- return code;
+ *object = PDF_NULL_OBJ;
+ return 0;
}
code = gs_note_error(gs_error_undefined);
goto error;
@@ -969,7 +1030,7 @@ free_obj:
(void)pdfi_seek(ctx, ctx->main_stream, saved_stream_offset, SEEK_SET);
}
- if (ctx->loop_detection && (*object)->object_num != 0) {
+ if (ctx->loop_detection && pdf_object_num(*object) != 0) {
code = pdfi_loop_detector_add_object(ctx, (*object)->object_num);
if (code < 0) {
ctx->encryption.decrypt_strings = saved_decrypt_strings;
@@ -1052,11 +1113,12 @@ static int pdfi_resolve_indirect_array(pdf_context *ctx, pdf_obj *obj, bool recu
code = 0;
} else {
if (code < 0) goto exit;
- /* don't store the object if it's a stream (leave as a ref) */
- if (object->type != PDF_STREAM)
- code = pdfi_array_put(ctx, array, index, object);
if (recurse)
code = pdfi_resolve_indirect_loop_detect(ctx, NULL, object, recurse);
+ if (code < 0) goto exit;
+ /* don't store the object if it's a stream (leave as a ref) */
+ if (pdfi_type_of(object) != PDF_STREAM)
+ code = pdfi_array_put(ctx, array, index, object);
}
if (code < 0) goto exit;
@@ -1107,7 +1169,7 @@ static int pdfi_resolve_indirect_dict(pdf_context *ctx, pdf_obj *obj, bool recur
} else {
if (code < 0) goto exit;
/* don't store the object if it's a stream (leave as a ref) */
- if (Value->type != PDF_STREAM)
+ if (pdfi_type_of(Value) != PDF_STREAM)
pdfi_dict_put_obj(ctx, dict, (pdf_obj *)Key, Value, true);
if (recurse)
code = pdfi_resolve_indirect_loop_detect(ctx, NULL, Value, recurse);
@@ -1130,7 +1192,7 @@ int pdfi_resolve_indirect(pdf_context *ctx, pdf_obj *value, bool recurse)
{
int code = 0;
- switch(value->type) {
+ switch(pdfi_type_of(value)) {
case PDF_ARRAY:
code = pdfi_resolve_indirect_array(ctx, value, recurse);
break;
@@ -1158,7 +1220,7 @@ int pdfi_resolve_indirect_loop_detect(pdf_context *ctx, pdf_obj *parent, pdf_obj
if (code < 0) goto exit;
}
- if (value->object_num != 0) {
+ if (pdf_object_num(value) != 0) {
if (pdfi_loop_detector_check_object(ctx, value->object_num)) {
code = gs_note_error(gs_error_circular_reference);
goto exit;
diff --git a/pdf/pdf_dict.c b/pdf/pdf_dict.c
index 34356dfe..217cb6db 100644
--- a/pdf/pdf_dict.c
+++ b/pdf/pdf_dict.c
@@ -140,7 +140,7 @@ int pdfi_dict_from_stack(pdf_context *ctx, uint32_t indirect_num, uint32_t indir
i = (index / 2) - 1;
/* In PDF keys are *required* to be names, so we ought to check that here */
- if (((pdf_obj *)ctx->stack_top[-2])->type == PDF_NAME) {
+ if (pdfi_type_of((pdf_obj *)ctx->stack_top[-2]) == PDF_NAME) {
d->list[i].key = ctx->stack_top[-2];
pdfi_countup(d->list[i].key);
#if DEBUG_DICT
@@ -149,7 +149,7 @@ int pdfi_dict_from_stack(pdf_context *ctx, uint32_t indirect_num, uint32_t indir
d->list[i].value = ctx->stack_top[-1];
pdfi_countup(d->list[i].value);
} else {
- if (convert_string_keys && ((pdf_obj *)ctx->stack_top[-2])->type == PDF_STRING) {
+ if (convert_string_keys && (pdfi_type_of((pdf_obj *)ctx->stack_top[-2]) == PDF_STRING)) {
pdf_name *n;
code = pdfi_dict_name_from_string(ctx, (pdf_string *)ctx->stack_top[-2], &n);
if (code < 0) {
@@ -266,7 +266,7 @@ static int pdfi_dict_find_unsorted(pdf_context *ctx, pdf_dict *d, const char *Ke
for (i=0;i< d->entries;i++) {
t = (pdf_name *)d->list[i].key;
- if (t && t->type == PDF_NAME) {
+ if (t && pdfi_type_of(t) == PDF_NAME) {
if (pdfi_name_is((pdf_name *)t, Key)) {
return i;
}
@@ -315,14 +315,14 @@ int pdfi_dict_get_common(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj
*o = NULL;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
index = pdfi_dict_find(ctx, d, Key, true);
if (index < 0)
return index;
- if (d->list[index].value->type == PDF_INDIRECT) {
+ if (pdfi_type_of(d->list[index].value) == PDF_INDIRECT) {
pdf_indirect_ref *r = (pdf_indirect_ref *)d->list[index].value;
if (r->ref_object_num == d->object_num)
@@ -340,8 +340,11 @@ int pdfi_dict_get_common(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj
* referencing and never counts down to 0, leading to a memory leak.
* This is clearly an error, so flag it and don't replace the indirect reference.
*/
- if ((*o)->object_num == 0 || (*o)->object_num != d->object_num)
- {
+ if ((*o) < (pdf_obj *)(uintptr_t)(TOKEN__LAST_KEY)) {
+ /* "FAST" object, therefore can't be a problem. */
+ pdfi_countdown(d->list[index].value);
+ d->list[index].value = *o;
+ } else if ((*o)->object_num == 0 || (*o)->object_num != d->object_num) {
pdfi_countdown(d->list[index].value);
d->list[index].value = *o;
} else {
@@ -364,7 +367,7 @@ int pdfi_dict_get_no_deref(pdf_context *ctx, pdf_dict *d, const pdf_name *Key, p
*o = NULL;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
index = pdfi_dict_find_key(ctx, d, Key, true);
@@ -386,14 +389,14 @@ int pdfi_dict_get_by_key(pdf_context *ctx, pdf_dict *d, const pdf_name *Key, pdf
*o = NULL;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
index = pdfi_dict_find_key(ctx, d, Key, true);
if (index < 0)
return index;
- if (d->list[index].value->type == PDF_INDIRECT) {
+ if (pdfi_type_of(d->list[index].value) == PDF_INDIRECT) {
pdf_indirect_ref *r = (pdf_indirect_ref *)d->list[index].value;
code = pdfi_deref_loop_detect(ctx, r->ref_object_num, r->ref_generation_num, o);
@@ -414,14 +417,14 @@ int pdfi_dict_get_ref(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_indire
*o = NULL;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
index = pdfi_dict_find(ctx, d, Key, true);
if (index < 0)
return index;
- if (d->list[index].value->type == PDF_INDIRECT) {
+ if (pdfi_type_of(d->list[index].value) == PDF_INDIRECT) {
*o = (pdf_indirect_ref *)d->list[index].value;
pdfi_countup(*o);
return 0;
@@ -444,7 +447,7 @@ static int pdfi_dict_get_no_store_R_inner(pdf_context *ctx, pdf_dict *d, const c
*o = NULL;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
if (strKey == NULL)
@@ -455,7 +458,7 @@ static int pdfi_dict_get_no_store_R_inner(pdf_context *ctx, pdf_dict *d, const c
if (index < 0)
return index;
- if (d->list[index].value->type == PDF_INDIRECT) {
+ if (pdfi_type_of(d->list[index].value) == PDF_INDIRECT) {
pdf_indirect_ref *r = (pdf_indirect_ref *)d->list[index].value;
code = pdfi_dereference(ctx, r->ref_object_num, r->ref_generation_num, o);
@@ -500,7 +503,7 @@ int pdfi_dict_get_type(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj_t
if (code < 0)
return code;
- if ((*o)->type != type) {
+ if (pdfi_type_of(*o) != type) {
pdfi_countdown(*o);
*o = NULL;
return_error(gs_error_typecheck);
@@ -524,15 +527,14 @@ pdfi_dict_get_int2(pdf_context *ctx, pdf_dict *d, const char *Key1,
int pdfi_dict_get_int(pdf_context *ctx, pdf_dict *d, const char *Key, int64_t *i)
{
int code;
- pdf_num *n;
+ pdf_obj *n;
- code = pdfi_dict_get_type(ctx, d, Key, PDF_INT, (pdf_obj **)&n);
+ code = pdfi_dict_get(ctx, d, Key, &n);
if (code < 0)
return code;
-
- *i = n->value.i;
+ code = pdfi_obj_to_int(ctx, n, i);
pdfi_countdown(n);
- return 0;
+ return code;
}
/* Get an int from dict, and if undefined, return provided default */
@@ -566,15 +568,24 @@ pdfi_dict_get_bool2(pdf_context *ctx, pdf_dict *d, const char *Key1,
int pdfi_dict_get_bool(pdf_context *ctx, pdf_dict *d, const char *Key, bool *val)
{
int code;
- pdf_bool *b;
+ pdf_obj *b;
- code = pdfi_dict_get_type(ctx, d, Key, PDF_BOOL, (pdf_obj **)&b);
+ code = pdfi_dict_get(ctx, d, Key, &b);
if (code < 0)
return code;
- *val = b->value;
+ if (b == PDF_TRUE_OBJ) {
+ *val = 1;
+ return 0;
+ } else if (b == PDF_FALSE_OBJ) {
+ *val = 0;
+ return 0;
+ }
+
pdfi_countdown(b);
- return 0;
+
+ *val = 0; /* Be consistent at least! */
+ return_error(gs_error_typecheck);
}
int pdfi_dict_get_number2(pdf_context *ctx, pdf_dict *d, const char *Key1, const char *Key2, double *f)
@@ -590,23 +601,15 @@ int pdfi_dict_get_number2(pdf_context *ctx, pdf_dict *d, const char *Key1, const
int pdfi_dict_get_number(pdf_context *ctx, pdf_dict *d, const char *Key, double *f)
{
int code;
- pdf_num *o;
+ pdf_obj *o;
- code = pdfi_dict_get(ctx, d, Key, (pdf_obj **)&o);
+ code = pdfi_dict_get(ctx, d, Key, &o);
if (code < 0)
return code;
- if (o->type == PDF_INT) {
- *f = (double)(o->value.i);
- } else {
- if (o->type == PDF_REAL){
- *f = o->value.d;
- } else {
- pdfi_countdown(o);
- return_error(gs_error_typecheck);
- }
- }
+ code = pdfi_obj_to_real(ctx, o, f);
pdfi_countdown(o);
- return 0;
+
+ return code;
}
/* convenience functions for retrieving arrys, see shadings and functions */
@@ -627,7 +630,7 @@ int fill_domain_from_dict(pdf_context *ctx, float *parray, int size, pdf_dict *d
code = pdfi_dict_get(ctx, dict, "Domain", (pdf_obj **)&a);
if (code < 0)
return code;
- if (a->type != PDF_ARRAY) {
+ if (pdfi_type_of(a) != PDF_ARRAY) {
pdfi_countdown(a);
return_error(gs_error_typecheck);
}
@@ -659,7 +662,7 @@ int fill_float_array_from_dict(pdf_context *ctx, float *parray, int size, pdf_di
code = pdfi_dict_get(ctx, dict, Key, (pdf_obj **)&a);
if (code < 0)
return code;
- if (a->type != PDF_ARRAY) {
+ if (pdfi_type_of(a) != PDF_ARRAY) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -685,13 +688,13 @@ int fill_bool_array_from_dict(pdf_context *ctx, bool *parray, int size, pdf_dict
{
int code, i;
pdf_array *a = NULL;
- pdf_bool *o;
+ pdf_obj *o;
uint64_t array_size;
code = pdfi_dict_get(ctx, dict, Key, (pdf_obj **)&a);
if (code < 0)
return code;
- if (a->type != PDF_ARRAY) {
+ if (pdfi_type_of(a) != PDF_ARRAY) {
pdfi_countdown(a);
return_error(gs_error_typecheck);
}
@@ -700,13 +703,20 @@ int fill_bool_array_from_dict(pdf_context *ctx, bool *parray, int size, pdf_dict
return_error(gs_error_rangecheck);
for (i=0;i< array_size;i++) {
- code = pdfi_array_get_type(ctx, a, (uint64_t)i, PDF_BOOL, (pdf_obj **)&o);
+ code = pdfi_array_get(ctx, a, (uint64_t)i, (pdf_obj **)&o);
if (code < 0) {
pdfi_countdown(a);
return_error(code);
}
- parray[i] = o->value;
- pdfi_countdown(o);
+ if (o == PDF_TRUE_OBJ) {
+ parray[i] = 1;
+ } else if (o == PDF_FALSE_OBJ) {
+ parray[i] = 0;
+ } else {
+ pdfi_countdown(o);
+ pdfi_countdown(a);
+ return_error(gs_error_typecheck);
+ }
}
pdfi_countdown(a);
return array_size;
@@ -722,7 +732,7 @@ int fill_matrix_from_dict(pdf_context *ctx, float *parray, pdf_dict *dict)
code = pdfi_dict_get(ctx, dict, "Matrix", (pdf_obj **)&a);
if (code < 0)
return code;
- if (a->type != PDF_ARRAY) {
+ if (pdfi_type_of(a) != PDF_ARRAY) {
pdfi_countdown(a);
return_error(gs_error_typecheck);
}
@@ -758,7 +768,7 @@ int pdfi_make_float_array_from_dict(pdf_context *ctx, float **parray, pdf_dict *
code = pdfi_dict_get(ctx, dict, Key, (pdf_obj **)&a);
if (code < 0)
return code;
- if (a->type != PDF_ARRAY) {
+ if (pdfi_type_of(a) != PDF_ARRAY) {
pdfi_countdown(a);
return_error(gs_error_typecheck);
}
@@ -795,7 +805,7 @@ int pdfi_make_int_array_from_dict(pdf_context *ctx, int **parray, pdf_dict *dict
code = pdfi_dict_get(ctx, dict, Key, (pdf_obj **)&a);
if (code < 0)
return code;
- if (a->type != PDF_ARRAY) {
+ if (pdfi_type_of(a) != PDF_ARRAY) {
pdfi_countdown(a);
return_error(gs_error_typecheck);
}
@@ -828,10 +838,10 @@ int pdfi_dict_put_obj(pdf_context *ctx, pdf_dict *d, pdf_obj *Key, pdf_obj *valu
int i;
pdf_dict_entry *new_list;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
- if (Key->type != PDF_NAME)
+ if (pdfi_type_of(Key) != PDF_NAME)
return_error(gs_error_typecheck);
/* First, do we have a Key/value pair already ? */
@@ -883,6 +893,60 @@ int pdfi_dict_put_obj(pdf_context *ctx, pdf_dict *d, pdf_obj *Key, pdf_obj *valu
return 0;
}
+/*
+ * Be very cautious using this routine; it does not check to see if a key already exists
+ * in a dictionary!. This is initially at least intended for use by the font code, to build
+ * a CharStrings dictionary. We do that by adding each glyph individually with a name
+ * created from a loop counter, so we know there cannot be any duplicates, and the time
+ * taken to check that each of 64K names was unique was quite significant.
+ * See bug #705534, the old PDF interpreter (nullpage, 72 dpi) runs this file in ~20 seconds
+ * pdfi runs it in around 40 seconds. With this change it runs in around 3 seconds. THis is,
+ * of course, an extreme example.
+ */
+int pdfi_dict_put_unchecked(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj *value)
+{
+ int i, code = 0;
+ pdf_dict_entry *new_list;
+ pdf_obj *key = NULL;
+
+ code = pdfi_name_alloc(ctx, (byte *)Key, strlen(Key), &key);
+ if (code < 0)
+ return code;
+ pdfi_countup(key);
+
+ /* Nope, its a new Key */
+ if (d->size > d->entries) {
+ /* We have a hole, find and use it */
+ for (i=0;i< d->size;i++) {
+ if (d->list[i].key == NULL) {
+ d->list[i].key = key;
+ d->list[i].value = value;
+ pdfi_countup(value);
+ d->entries++;
+ return 0;
+ }
+ }
+ }
+
+ new_list = (pdf_dict_entry *)gs_alloc_bytes(ctx->memory, (d->size + 1) * sizeof(pdf_dict_entry), "pdfi_dict_put reallocate dictionary key/values");
+ if (new_list == NULL) {
+ return_error(gs_error_VMerror);
+ }
+ memcpy(new_list, d->list, d->size * sizeof(pdf_dict_entry));
+
+ gs_free_object(ctx->memory, d->list, "pdfi_dict_put key/value reallocation");
+
+ d->list = new_list;
+
+ d->list[d->size].key = key;
+ d->list[d->size].value = value;
+ d->size++;
+ d->entries++;
+ pdfi_countup(value);
+
+ return 0;
+}
+
/* Put into dictionary with key as string */
int pdfi_dict_put(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj *value)
{
@@ -914,15 +978,9 @@ int pdfi_dict_put_int(pdf_context *ctx, pdf_dict *d, const char *key, int64_t va
int pdfi_dict_put_bool(pdf_context *ctx, pdf_dict *d, const char *key, bool value)
{
- int code;
- pdf_bool *obj = NULL;
-
- code = pdfi_object_alloc(ctx, PDF_BOOL, 0, (pdf_obj **)&obj);
- if (code < 0)
- return code;
+ pdf_obj *obj = (value ? PDF_TRUE_OBJ : PDF_FALSE_OBJ);
- obj->value = value;
- return pdfi_dict_put(ctx, d, key, (pdf_obj *)obj);
+ return pdfi_dict_put(ctx, d, key, obj);
}
int pdfi_dict_put_name(pdf_context *ctx, pdf_dict *d, const char *key, const char *name)
@@ -957,7 +1015,7 @@ int pdfi_dict_known(pdf_context *ctx, pdf_dict *d, const char *Key, bool *known)
{
int i;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
*known = false;
@@ -972,7 +1030,7 @@ int pdfi_dict_known_by_key(pdf_context *ctx, pdf_dict *d, pdf_name *Key, bool *k
{
int i;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
*known = false;
@@ -1030,6 +1088,25 @@ int pdfi_dict_knownget_type(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_
return 1;
}
+int pdfi_dict_knownget_bool(pdf_context *ctx, pdf_dict *d, const char *Key, bool *b)
+{
+ bool known = false;
+ int code;
+
+ code = pdfi_dict_known(ctx, d, Key, &known);
+ if (code < 0)
+ return code;
+
+ if (known == false)
+ return 0;
+
+ code = pdfi_dict_get_bool(ctx, d, Key, b);
+ if (code < 0)
+ return code;
+
+ return 1;
+}
+
/* Like pdfi_dict_knownget_type() but retrieves numbers (two possible types)
*/
int pdfi_dict_knownget_number(pdf_context *ctx, pdf_dict *d, const char *Key, double *f)
@@ -1055,7 +1132,7 @@ int pdfi_dict_next(pdf_context *ctx, pdf_dict *d, pdf_obj **Key, pdf_obj **Value
{
int code;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
while (1) {
@@ -1078,7 +1155,7 @@ int pdfi_dict_next(pdf_context *ctx, pdf_dict *d, pdf_obj **Key, pdf_obj **Value
continue;
}
- if (d->list[*index].value->type == PDF_INDIRECT) {
+ if (pdfi_type_of(d->list[*index].value) == PDF_INDIRECT) {
pdf_indirect_ref *r = (pdf_indirect_ref *)d->list[*index].value;
pdf_obj *o;
@@ -1113,7 +1190,7 @@ int pdfi_dict_key_next(pdf_context *ctx, pdf_dict *d, pdf_obj **Key, uint64_t *i
{
uint64_t *i = index;
- if (d->type != PDF_DICT)
+ if (pdfi_type_of(d) != PDF_DICT)
return_error(gs_error_typecheck);
while (1) {
@@ -1169,7 +1246,7 @@ int64_t pdfi_stream_length(pdf_context *ctx, pdf_stream *stream)
int64_t Length = 0;
int code;
- if (stream->type != PDF_STREAM)
+ if (pdfi_type_of(stream) != PDF_STREAM)
return 0;
if (stream->length_valid)
@@ -1195,14 +1272,14 @@ int64_t pdfi_stream_length(pdf_context *ctx, pdf_stream *stream)
*/
gs_offset_t pdfi_stream_offset(pdf_context *ctx, pdf_stream *stream)
{
- if (stream->type != PDF_STREAM)
+ if (pdfi_type_of(stream) != PDF_STREAM)
return 0;
return stream->stream_offset;
}
pdf_stream *pdfi_stream_parent(pdf_context *ctx, pdf_stream *stream)
{
- if (stream->type != PDF_STREAM)
+ if (pdfi_type_of(stream) != PDF_STREAM)
return 0;
return (pdf_stream *)stream->parent_obj;
}
@@ -1233,11 +1310,15 @@ void pdfi_clear_stream_parent(pdf_context *ctx, pdf_stream *stream)
int pdfi_dict_from_obj(pdf_context *ctx, pdf_obj *obj, pdf_dict **dict)
{
*dict = NULL;
- if (obj->type == PDF_DICT)
- *dict = (pdf_dict *)obj;
- else if (obj->type == PDF_STREAM)
- *dict = ((pdf_stream *)obj)->stream_dict;
- else
- return_error(gs_error_typecheck);
+ switch (pdfi_type_of(obj)) {
+ case PDF_DICT:
+ *dict = (pdf_dict *)obj;
+ break;
+ case PDF_STREAM:
+ *dict = ((pdf_stream *)obj)->stream_dict;
+ break;
+ default:
+ return_error(gs_error_typecheck);
+ }
return 0;
}
diff --git a/pdf/pdf_dict.h b/pdf/pdf_dict.h
index c5a8743b..90cac6af 100644
--- a/pdf/pdf_dict.h
+++ b/pdf/pdf_dict.h
@@ -28,7 +28,7 @@ static inline int pdfi_dict_get(pdf_context *ctx, pdf_dict *d, const char *Key,
static inline int pdfi_dict_get_nocache(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj **o)
{
- return pdfi_dict_get_common(ctx, d, Key, o, true);
+ return pdfi_dict_get_common(ctx, d, Key, o, false);
}
@@ -42,8 +42,10 @@ int pdfi_dict_known_by_key(pdf_context *ctx, pdf_dict *d, pdf_name *Key, bool *k
int pdfi_dict_knownget(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj **o);
int pdfi_dict_knownget_type(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj_type type, pdf_obj **o);
int pdfi_dict_knownget_number(pdf_context *ctx, pdf_dict *d, const char *Key, double *f);
+int pdfi_dict_knownget_bool(pdf_context *ctx, pdf_dict *d, const char *Key, bool *b);
int pdfi_merge_dicts(pdf_context *ctx, pdf_dict *target, pdf_dict *source);
int pdfi_dict_put_obj(pdf_context *ctx, pdf_dict *d, pdf_obj *Key, pdf_obj *value, bool replace);
+int pdfi_dict_put_unchecked(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj *value);
int pdfi_dict_put(pdf_context *ctx, pdf_dict *d, const char *Key, pdf_obj *value);
int pdfi_dict_put_int(pdf_context *ctx, pdf_dict *d, const char *Key, int64_t value);
int pdfi_dict_put_bool(pdf_context *ctx, pdf_dict *d, const char *Key, bool value);
diff --git a/pdf/pdf_doc.c b/pdf/pdf_doc.c
index be71dfcb..7febe60a 100644
--- a/pdf/pdf_doc.c
+++ b/pdf/pdf_doc.c
@@ -55,13 +55,13 @@ int pdfi_read_Root(pdf_context *ctx)
}
pdfi_countdown(d);
- if (o1->type == PDF_INDIRECT) {
+ if (pdfi_type_of(o1) == PDF_INDIRECT) {
code = pdfi_dereference(ctx, ((pdf_indirect_ref *)o1)->ref_object_num, ((pdf_indirect_ref *)o1)->ref_generation_num, &o);
pdfi_countdown(o1);
if (code < 0)
return code;
- if (o->type != PDF_DICT) {
+ if (pdfi_type_of(o) != PDF_DICT) {
pdfi_countdown(o);
return_error(gs_error_typecheck);
}
@@ -73,23 +73,40 @@ int pdfi_read_Root(pdf_context *ctx)
}
o1 = o;
} else {
- if (o1->type != PDF_DICT) {
+ if (pdfi_type_of(o1) != PDF_DICT) {
pdfi_countdown(o1);
- return_error(gs_error_typecheck);
+ if (ctx->Root == NULL)
+ return_error(gs_error_typecheck);
+ return 0;
}
}
code = pdfi_dict_get_type(ctx, (pdf_dict *)o1, "Type", PDF_NAME, &o);
if (code < 0) {
- pdfi_countdown(o1);
- return code;
+ bool known = false;
+
+ pdfi_set_error(ctx, 0, NULL, E_PDF_MISSINGTYPE, "pdfi_read_Root", NULL);
+
+ /* Missing the *required* /Type key! See if it has /Pages at least, if it does carry on */
+ code = pdfi_dict_known(ctx, (pdf_dict *)o1, "Pages", &known);
+ if (code < 0 || known == false) {
+ pdfi_countdown(o1);
+ return code;
+ }
}
- if (pdfi_name_strcmp((pdf_name *)o, "Catalog") != 0){
+ else {
+ if (pdfi_name_strcmp((pdf_name *)o, "Catalog") != 0){
+ pdfi_countdown(o);
+ pdfi_countdown(o1);
+ /* If we repaired the file, we may already have spotted a potential Root dictionary
+ * so if the one we found here isn't valid, try the one we found when scanning
+ */
+ if (ctx->Root == NULL)
+ return_error(gs_error_syntaxerror);
+ return 0;
+ }
pdfi_countdown(o);
- pdfi_countdown(o1);
- return_error(gs_error_syntaxerror);
}
- pdfi_countdown(o);
if (ctx->args.pdfdebug)
dmprintf(ctx->memory, "\n");
@@ -101,6 +118,183 @@ int pdfi_read_Root(pdf_context *ctx)
return 0;
}
+static int Info_check_dict(pdf_context *ctx, pdf_dict *d);
+
+static int Info_check_array(pdf_context *ctx, pdf_array *a)
+{
+ int code = 0, i = 0;
+ pdf_obj *array_obj = NULL;
+
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0)
+ return code;
+
+ for (i = 0;i < pdfi_array_size(a); i++) {
+ code = pdfi_array_fetch_recursing(ctx, a, i, &array_obj, true, true);
+ if (code < 0)
+ goto error;
+
+ switch(pdfi_type_of(array_obj)) {
+ case PDF_DICT:
+ if (array_obj->object_num != 0) {
+ code = pdfi_loop_detector_add_object(ctx, array_obj->object_num);
+ if (code < 0)
+ goto error;
+ }
+ code = Info_check_dict(ctx, (pdf_dict *)array_obj);
+ if (code < 0)
+ goto error;
+ break;
+ case PDF_ARRAY:
+ if (array_obj->object_num != 0) {
+ code = pdfi_loop_detector_add_object(ctx, array_obj->object_num);
+ if (code < 0)
+ goto error;
+ }
+ code = Info_check_array(ctx, (pdf_array *)array_obj);
+ if (code < 0)
+ goto error;
+ break;
+ default:
+ break;
+ }
+
+ pdfi_countdown(array_obj);
+ array_obj = NULL;
+ }
+error:
+ pdfi_countdown(array_obj);
+ pdfi_loop_detector_cleartomark(ctx);
+ return code;
+}
+
+static int Info_check_dict(pdf_context *ctx, pdf_dict *d)
+{
+ int code = 0;
+ uint64_t index = 0;
+ pdf_name *Key = NULL;
+ pdf_obj *Value = NULL;
+
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0)
+ return code;
+
+ code = pdfi_dict_first(ctx, d, (pdf_obj **)&Key, &Value, &index);
+ if (code < 0) {
+ if (code == gs_error_undefined)
+ code = 0;
+ goto error;
+ }
+
+ while (code >= 0) {
+ switch(pdfi_type_of(Value)) {
+ case PDF_DICT:
+ if (Value->object_num != 0) {
+ code = pdfi_loop_detector_add_object(ctx, Value->object_num);
+ if (code < 0)
+ goto error;
+ }
+ code = Info_check_dict(ctx, (pdf_dict *)Value);
+ if (code < 0)
+ goto error;
+ break;
+ case PDF_ARRAY:
+ if (Value->object_num != 0) {
+ code = pdfi_loop_detector_add_object(ctx, Value->object_num);
+ if (code < 0)
+ goto error;
+ }
+ code = Info_check_array(ctx, (pdf_array *)Value);
+ if (code < 0)
+ goto error;
+ break;
+ default:
+ break;
+ }
+ pdfi_countdown(Key);
+ Key = NULL;
+ pdfi_countdown(Value);
+ Value = NULL;
+
+ code = pdfi_dict_next(ctx, d, (pdf_obj **)&Key, &Value, &index);
+ if (code == gs_error_undefined) {
+ code = 0;
+ break;
+ }
+ }
+error:
+ pdfi_countdown(Key);
+ pdfi_countdown(Value);
+ pdfi_loop_detector_cleartomark(ctx);
+ return code;
+}
+
+static int pdfi_sanitize_Info_references(pdf_context *ctx, pdf_dict *Info)
+{
+ int code = 0;
+ uint64_t index = 0;
+ pdf_name *Key = NULL;
+ pdf_obj *Value = NULL;
+
+restart_scan:
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0)
+ return code;
+
+ code = pdfi_dict_first(ctx, Info, (pdf_obj **)&Key, &Value, &index);
+ if (code == gs_error_undefined) {
+ code = 0;
+ goto error;
+ }
+
+ while (code >= 0) {
+ switch(pdfi_type_of(Value)) {
+ case PDF_DICT:
+ code = Info_check_dict(ctx, (pdf_dict *)Value);
+ break;
+ case PDF_ARRAY:
+ code = Info_check_array(ctx, (pdf_array *)Value);
+ break;
+ default:
+ code = 0;
+ break;
+ }
+ pdfi_countdown(Value);
+ Value = NULL;
+ if (code < 0) {
+ code = pdfi_dict_delete_pair(ctx, Info, Key);
+ if (code < 0)
+ goto error;
+ pdfi_countdown(Key);
+ Key = NULL;
+
+ pdfi_loop_detector_cleartomark(ctx);
+ goto restart_scan;
+ }
+ pdfi_countdown(Key);
+ Key = NULL;
+
+ pdfi_loop_detector_cleartomark(ctx);
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0) {
+ pdfi_countdown(Key);
+ pdfi_countdown(Value);
+ return code;
+ }
+
+ code = pdfi_dict_next(ctx, Info, (pdf_obj **)&Key, &Value, &index);
+ if (code == gs_error_undefined) {
+ code = 0;
+ break;
+ }
+ }
+error:
+ pdfi_countdown(Key);
+ pdfi_countdown(Value);
+ pdfi_loop_detector_cleartomark(ctx);
+ return code;
+}
+
int pdfi_read_Info(pdf_context *ctx)
{
pdf_dict *Info;
@@ -121,6 +315,20 @@ int pdfi_read_Info(pdf_context *ctx)
if (ctx->args.pdfdebug)
dmprintf(ctx->memory, "\n");
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0)
+ goto error;
+ code = pdfi_loop_detector_add_object(ctx, Info->object_num);
+ if (code < 0)
+ goto error1;
+
+ /* sanitize Info for circular references */
+ code = pdfi_sanitize_Info_references(ctx, Info);
+ if (code < 0)
+ goto error1;
+
+ (void)pdfi_loop_detector_cleartomark(ctx);
+
pdfi_device_set_flags(ctx);
pdfi_pdfmark_write_docinfo(ctx, Info);
@@ -129,12 +337,19 @@ int pdfi_read_Info(pdf_context *ctx)
*/
ctx->Info = Info;
return 0;
+
+error1:
+ pdfi_loop_detector_cleartomark(ctx);
+error:
+ pdfi_countdown(Info);
+ return code;
}
int pdfi_read_Pages(pdf_context *ctx)
{
pdf_obj *o, *o1;
- int code;
+ pdf_array *a = NULL;
+ int code, pagecount = 0;
double d;
if (ctx->args.pdfdebug)
@@ -144,15 +359,15 @@ int pdfi_read_Pages(pdf_context *ctx)
if (code < 0)
return code;
- if (o1->type == PDF_INDIRECT) {
+ if (pdfi_type_of(o1) == PDF_INDIRECT) {
code = pdfi_dereference(ctx, ((pdf_indirect_ref *)o1)->ref_object_num, ((pdf_indirect_ref *)o1)->ref_generation_num, &o);
pdfi_countdown(o1);
if (code < 0)
return code;
- if (o->type != PDF_DICT) {
+ if (pdfi_type_of(o) != PDF_DICT) {
pdfi_countdown(o);
- if (o->type == PDF_INDIRECT)
+ if (pdfi_type_of(o) == PDF_INDIRECT)
pdfi_set_error(ctx, 0, NULL, E_PDF_BADPAGEDICT, "pdfi_read_Pages", (char *)"*** Error: Something is wrong with the Pages dictionary. Giving up.");
else
pdfi_set_error(ctx, 0, NULL, E_PDF_BADPAGEDICT, "pdfi_read_Pages", (char *)"*** Error: Something is wrong with the Pages dictionary. Giving up.\n Double indirect reference. Loop in Pages tree?");
@@ -166,7 +381,7 @@ int pdfi_read_Pages(pdf_context *ctx)
}
o1 = o;
} else {
- if (o1->type != PDF_DICT) {
+ if (pdfi_type_of(o1) != PDF_DICT) {
pdfi_countdown(o1);
return_error(gs_error_typecheck);
}
@@ -212,6 +427,86 @@ int pdfi_read_Pages(pdf_context *ctx)
ctx->num_pages = (int)floor(d);
}
+ /* A simple confidence check in the value of Count. We only do this because
+ * the OSS-fuzz tool keeps on coming up with files that time out because the
+ * initial Count is insanely huge, and we spend much time trying to find
+ * millions of pages which don't exist.
+ */
+ code = pdfi_dict_knownget_type(ctx, (pdf_dict *)o1, "Kids", PDF_ARRAY, (pdf_obj **)&a);
+ if (code == 0)
+ code = gs_note_error(gs_error_undefined);
+ if (code < 0) {
+ pdfi_countdown(o1);
+ return code;
+ }
+
+ /* Firstly check if the Kids array has enough nodes, in which case it's
+ * probably flat (the common case)
+ */
+ if (a->size != ctx->num_pages) {
+ int i = 0;
+ pdf_obj *p = NULL, *p1 = NULL;
+ pdf_num *c = NULL;
+
+ /* Either its not a flat tree, or the top node /Count is incorrect.
+ * Get each entry in the Kids array in turn and total the /Count of
+ * each node and add any leaf nodes.
+ */
+ for (i=0;i < a->size; i++) {
+ code = pdfi_array_get(ctx, a, i, &p);
+ if (code < 0)
+ continue;
+ if (pdfi_type_of(p) != PDF_DICT) {
+ pdfi_countdown(p);
+ p = NULL;
+ continue;
+ }
+ code = pdfi_dict_knownget_type(ctx, (pdf_dict *)p, "Type", PDF_NAME, (pdf_obj **)&p1);
+ if (code <= 0) {
+ pdfi_countdown(p);
+ p = NULL;
+ continue;
+ }
+ if (pdfi_name_is((pdf_name *)p1, "Page")) {
+ pagecount++;
+ } else {
+ if (pdfi_name_is((pdf_name *)p1, "Pages")) {
+ code = pdfi_dict_knownget(ctx, (pdf_dict *)p, "Count", (pdf_obj **)&c);
+ if (code >= 0) {
+ if (pdfi_type_of(c) == PDF_INT)
+ pagecount += c->value.i;
+ if (pdfi_type_of(c) == PDF_REAL)
+ pagecount += (int)c->value.d;
+ pdfi_countdown(c);
+ c = NULL;
+ }
+ }
+ }
+ pdfi_countdown(p1);
+ p1 = NULL;
+ pdfi_countdown(p);
+ p = NULL;
+ }
+ } else
+ pagecount = a->size;
+
+ pdfi_countdown(a);
+
+ /* If the count of the top level of the tree doesn't match the /Count
+ * of the root node then something is wrong. We could abort right now
+ * and will if this continues to be a problem, but initially let's assume
+ * the count of the top level is correct and the root node /Count is wrong.
+ * This will allow us to recover if only the root /Count gets corrupted.
+ * In future we could also try validating the entire tree at this point,
+ * though I suspect that's pointless; if the tree is corrupted we aren't
+ * likely to get much that's usable from it.
+ */
+ if (pagecount != ctx->num_pages) {
+ ctx->num_pages = pagecount;
+ code = pdfi_dict_put_int(ctx, (pdf_dict *)o1, "Count", ctx->num_pages);
+ pdfi_set_error(ctx, 0, NULL, E_PDF_BADPAGECOUNT, "pdfi_read_Pages", NULL);
+ }
+
/* We don't pdfi_countdown(o1) now, because we've transferred our
* reference to the pointer in the pdf_context structure.
*/
@@ -278,12 +573,12 @@ static int pdfi_get_child(pdf_context *ctx, pdf_array *Kids, int i, pdf_dict **p
if (code < 0)
goto errorExit;
- if (node->type != PDF_INDIRECT && node->type != PDF_DICT) {
+ if (pdfi_type_of(node) != PDF_INDIRECT && pdfi_type_of(node) != PDF_DICT) {
code = gs_note_error(gs_error_typecheck);
goto errorExit;
}
- if (node->type == PDF_INDIRECT) {
+ if (pdfi_type_of(node) == PDF_INDIRECT) {
code = pdfi_dereference(ctx, node->ref_object_num, node->ref_generation_num,
(pdf_obj **)&child);
if (code < 0) {
@@ -295,7 +590,7 @@ static int pdfi_get_child(pdf_context *ctx, pdf_array *Kids, int i, pdf_dict **p
if (code < 0)
goto errorExit;
}
- if (child->type != PDF_DICT) {
+ if (pdfi_type_of(child) != PDF_DICT) {
code = gs_note_error(gs_error_typecheck);
goto errorExit;
}
@@ -352,6 +647,11 @@ static int pdfi_get_child(pdf_context *ctx, pdf_array *Kids, int i, pdf_dict **p
code = gs_note_error(gs_error_circular_reference);
goto errorExit;
}
+ if (node->object_num > 0) {
+ code = pdfi_loop_detector_add_object(ctx, node->object_num);
+ if (code < 0)
+ goto errorExit;
+ }
}
child = (pdf_dict *)node;
pdfi_countup(child);
@@ -423,6 +723,10 @@ int pdfi_get_page_dict(pdf_context *ctx, pdf_dict *d, uint64_t page_num, uint64_
return code;
pdfi_countup(inheritable);
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0)
+ return code;
+
/* if we are being passed any inherited values from our parent, copy them now */
if (inherited != NULL) {
code = pdfi_dict_copy(ctx, inheritable, inherited);
@@ -543,6 +847,7 @@ int pdfi_get_page_dict(pdf_context *ctx, pdf_dict *d, uint64_t page_num, uint64_
code = 1;
exit:
+ pdfi_loop_detector_cleartomark(ctx);
pdfi_countdown(inheritable);
pdfi_countdown(Kids);
pdfi_countdown(child);
@@ -599,12 +904,15 @@ int pdfi_find_resource(pdf_context *ctx, unsigned char *Type, pdf_name *name,
{
pdf_dict *typedict = NULL;
pdf_dict *Parent = NULL;
+ pdf_name *n = NULL;
int code;
*o = NULL;
/* Check the provided dict, stream_dict can be NULL if we are trying to find a Default* ColorSpace */
if (dict != NULL) {
+ bool deref_parent = true;
+
code = pdfi_resource_knownget_typedict(ctx, Type, dict, &typedict);
if (code < 0)
goto exit;
@@ -615,30 +923,40 @@ int pdfi_find_resource(pdf_context *ctx, unsigned char *Type, pdf_name *name,
}
/* Check the Parents, if any */
- code = pdfi_dict_knownget_type(ctx, dict, "Parent", PDF_DICT, (pdf_obj **)&Parent);
- if (code < 0)
- goto exit;
- if (code > 0) {
- if (Parent->object_num != ctx->page.CurrentPageDict->object_num) {
- if (pdfi_loop_detector_check_object(ctx, Parent->object_num) == true)
- return_error(gs_error_circular_reference);
-
- code = pdfi_loop_detector_mark(ctx);
- if (code < 0)
- return code;
+ /* If the current dictionary is a Page dictionary, do NOT dereference it's Parent, as that
+ * will be the Pages tree, and we will end up with circular references, causing a memory leak.
+ */
+ if (pdfi_dict_knownget_type(ctx, dict, "Type", PDF_NAME, (pdf_obj **)&n) > 0) {
+ if (pdfi_name_is(n, "Page"))
+ deref_parent = false;
+ pdfi_countdown(n);
+ }
- code = pdfi_loop_detector_add_object(ctx, dict->object_num);
- if (code < 0) {
+ if (deref_parent) {
+ code = pdfi_dict_knownget_type(ctx, dict, "Parent", PDF_DICT, (pdf_obj **)&Parent);
+ if (code < 0)
+ goto exit;
+ if (code > 0) {
+ if (ctx->page.CurrentPageDict != NULL && Parent->object_num != ctx->page.CurrentPageDict->object_num) {
+ if (pdfi_loop_detector_check_object(ctx, Parent->object_num) == true)
+ return_error(gs_error_circular_reference);
+
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0)
+ return code;
+
+ code = pdfi_loop_detector_add_object(ctx, dict->object_num);
+ if (code < 0) {
+ (void)pdfi_loop_detector_cleartomark(ctx);
+ return code;
+ }
+ code = pdfi_find_resource(ctx, Type, name, Parent, page_dict, o);
(void)pdfi_loop_detector_cleartomark(ctx);
- return code;
+ if (code != gs_error_undefined)
+ goto exit;
}
- code = pdfi_find_resource(ctx, Type, name, Parent, page_dict, o);
- (void)pdfi_loop_detector_cleartomark(ctx);
- if (code != gs_error_undefined)
- goto exit;
}
}
-
pdfi_countdown(typedict);
typedict = NULL;
}
@@ -788,6 +1106,9 @@ static int pdfi_doc_mark_outline(pdf_context *ctx, pdf_dict *outline)
pdf_dict *child = NULL;
pdf_dict *Next = NULL;
+ if (outline == (pdf_dict *)PDF_NULL_OBJ)
+ return 0;
+
/* Mark the outline */
/* NOTE: I think the pdfmark for this needs to be written before the children
* because I think pdfwrite relies on the order of things.
@@ -803,7 +1124,7 @@ static int pdfi_doc_mark_outline(pdf_context *ctx, pdf_dict *outline)
/* Handle any children (don't deref them, we don't want to leave them hanging around) */
code = pdfi_dict_get_no_store_R(ctx, outline, "First", (pdf_obj **)&child);
- if (code < 0 || child->type != PDF_DICT) {
+ if (code < 0 || pdfi_type_of(child) != PDF_DICT) {
/* TODO: flag a warning? */
code = 0;
goto exit;
@@ -829,7 +1150,7 @@ static int pdfi_doc_mark_outline(pdf_context *ctx, pdf_dict *outline)
code = 0;
goto exit;
}
- if (code < 0 || Next->type != PDF_DICT)
+ if (code < 0 || pdfi_type_of(Next) != PDF_DICT)
goto exit;
pdfi_countdown(child);
@@ -869,12 +1190,15 @@ static int pdfi_doc_Outlines(pdf_context *ctx)
/* Handle any children (don't deref them, we don't want to leave them hanging around) */
code = pdfi_dict_get_no_store_R(ctx, Outlines, "First", (pdf_obj **)&outline);
- if (code < 0 || outline->type != PDF_DICT) {
+ if (code < 0 || pdfi_type_of(outline) != PDF_DICT) {
/* TODO: flag a warning? */
code = 0;
goto exit;
}
+ if (pdfi_type_of(outline) != PDF_DICT)
+ goto exit; /* Exit with no error? */
+
if (outline->object_num != 0) {
code = pdfi_loop_detector_add_object(ctx, outline->object_num);
if (code < 0)
@@ -900,7 +1224,7 @@ static int pdfi_doc_Outlines(pdf_context *ctx)
code = 0;
goto exit;
}
- if (code < 0 || outline->type != PDF_DICT)
+ if (code < 0 || pdfi_type_of(Next) != PDF_DICT)
goto exit;
pdfi_countdown(outline);
diff --git a/pdf/pdf_errors.h b/pdf/pdf_errors.h
index e52a6c74..d62d6acb 100644
--- a/pdf/pdf_errors.h
+++ b/pdf/pdf_errors.h
@@ -24,6 +24,7 @@ PARAM(E_PDF_BADSTARTXREF, "startxref offset invalid"),
PARAM(E_PDF_BADXREFSTREAM, "couldn't read hybrid file's XrefStm"),
PARAM(E_PDF_BADXREF, "error in xref table"),
PARAM(E_PDF_SHORTXREF, "too few entries in xref table"),
+PARAM(E_PDF_PREV_NOT_XREF_STREAM, "The /Prev entry in an XrefStm dictionary did not point to an XrefStm"),
PARAM(E_PDF_MISSINGENDSTREAM, "content stream lacks endstream"),
PARAM(E_PDF_UNKNOWNFILTER, "request for unknown filter"),
PARAM(E_PDF_MISSINGWHITESPACE, "missing white space after number"),
@@ -52,5 +53,11 @@ PARAM(E_PDF_IMAGECOLOR_ERROR, "error in image colour"),
PARAM(E_DICT_SELF_REFERENCE, "dictionary contains a key which (indirectly) references the dictionary."),
PARAM(E_IMAGE_MASKWITHCOLOR, "Image has both ImageMask and ColorSpace keys."),
PARAM(E_PDF_INVALID_DECRYPT_LEN, "Invalid /Length in Encryption dictionary (not in range 40-128 or not a multiple of 8)."),
-
+PARAM(E_PDF_GROUP_NO_CS, "Group attributes dictionary is missing /CS"),
+PARAM(E_BAD_GROUP_DICT, "Error retrieving Group dictionary for a page or XObject"),
+PARAM(E_BAD_HALFTONE, "Error setting a halftone"),
+PARAM(E_PDF_BADENCRYPT, "Encrypt diciotnary not a dictionary"),
+PARAM(E_PDF_MISSINGTYPE, "A dictionary is missing a required /Type key."),
+PARAM(E_PDF_NESTEDTOODEEP, "Dictionaries/arrays nested too deeply"),
+PARAM(E_PDF_BADPAGECOUNT, "page tree root node /Count did not match the actual number of pages in the tree."),
#undef PARAM
diff --git a/pdf/pdf_fapi.c b/pdf/pdf_fapi.c
index 3e4420c4..7fb7c954 100644
--- a/pdf/pdf_fapi.c
+++ b/pdf/pdf_fapi.c
@@ -35,12 +35,14 @@
#include "pdf_dict.h"
#include "pdf_array.h"
#include "pdf_font.h"
-#include "pdf_font.h"
#include "gscencs.h"
#include "gsagl.h"
#include "gxfont1.h" /* for gs_font_type1_s */
#include "gscrypt1.h" /* for crypt_c1 */
+extern single_glyph_list_t SingleGlyphList[];
+
+
/* forward declarations for the pdfi_ff_stub definition */
static int
pdfi_fapi_get_word(gs_fapi_font *ff, gs_fapi_font_feature var_id, int index, unsigned short *ret);
@@ -70,6 +72,9 @@ static int
pdfi_fapi_serialize_tt_font(gs_fapi_font * ff, void *buf, int buf_size);
static int
+pdfi_fapi_retrieve_tt_font(gs_fapi_font * ff, void **buf, int *buf_size);
+
+static int
pdfi_fapi_get_charstring(gs_fapi_font *ff, int index, byte *buf, ushort buf_length);
static int
@@ -130,6 +135,7 @@ static const gs_fapi_font pdfi_ff_stub = {
pdfi_fapi_get_raw_subr, /* get_raw_subr */
pdfi_fapi_get_glyph, /* get_glyph */
pdfi_fapi_serialize_tt_font, /* serialize_tt_font */
+ pdfi_fapi_retrieve_tt_font, /* retrieve_tt_font */
pdfi_fapi_get_charstring, /* get_charstring */
pdfi_fapi_get_charstring_name, /* get_charstring_name */
pdfi_get_glyphdirectory_data, /* get_GlyphDirectory_data_ptr */
@@ -248,7 +254,7 @@ pdfi_fapi_get_word(gs_fapi_font *ff, gs_fapi_font_feature var_id, int index, uns
{
if (pfont->FontType == ft_encrypted2) {
pdf_font_cff *pdffont2 = (pdf_font_cff *)pfont->client_data;
- *ret = pdffont2->NumGlobalSubrs;
+ *ret = pdffont2->GlobalSubrs == NULL ? 0 : pdfi_array_size(pdffont2->GlobalSubrs);
}
else {
*ret = 0;
@@ -260,11 +266,11 @@ pdfi_fapi_get_word(gs_fapi_font *ff, gs_fapi_font_feature var_id, int index, uns
{
if (pfont->FontType == ft_encrypted) {
pdf_font_type1 *pdffont1 = (pdf_font_type1 *)pfont->client_data;
- *ret = pdffont1->NumSubrs;
+ *ret = pdffont1->Subrs == NULL ? 0 : pdfi_array_size(pdffont1->Subrs);
}
else if (pfont->FontType == ft_encrypted2) {
pdf_font_cff *pdffont2 = (pdf_font_cff *)pfont->client_data;
- *ret = pdffont2->NumSubrs;
+ *ret = pdffont2->Subrs == NULL ? 0 : pdfi_array_size(pdffont2->Subrs);
}
else {
*ret = 0;
@@ -395,7 +401,7 @@ pdfi_fapi_get_word(gs_fapi_font *ff, gs_fapi_font_feature var_id, int index, uns
pdf_font_type1 *pdffont1 = (pdf_font_type1 *)pfont->client_data;
if (pdffont1->blendfontbbox != NULL) {
pdf_array *suba;
- pdf_num *v;
+ double d;
int ind, aind;
ind = index % 4;
aind = (index - ind) / 4;
@@ -404,17 +410,13 @@ pdfi_fapi_get_word(gs_fapi_font *ff, gs_fapi_font_feature var_id, int index, uns
*ret = 0;
break;
}
- code = pdfi_array_get(pdffont1->ctx, suba, ind, (pdf_obj **)&v);
+ code = pdfi_array_get_number(pdffont1->ctx, suba, ind, &d);
pdfi_countdown(suba);
if (code < 0) {
*ret = 0;
break;
}
- if (v->type == PDF_INT)
- *ret = (unsigned short)v->value.i;
- else
- *ret = (unsigned short)v->value.d;
- pdfi_countdown(v);
+ *ret = (unsigned short)d;
}
else {
*ret = 0;
@@ -447,8 +449,13 @@ pdfi_fapi_get_long(gs_fapi_font * ff, gs_fapi_font_feature var_id, int index, un
pdf_font_type1 *pdffont1 = (pdf_font_type1 *)pfont->client_data;
int i;
*ret = 0;
- for (i = 0; i < pdffont1->NumSubrs; i++) {
- *ret += pdffont1->Subrs[i].size;
+ for (i = 0; i < (pdffont1->Subrs == NULL ? 0 : pdfi_array_size(pdffont1->Subrs)); i++) {
+ pdf_string *subr_str = NULL;
+ code = pdfi_array_get_type(pdffont1->ctx, pdffont1->Subrs, i, PDF_STRING, (pdf_obj **)&subr_str);
+ if (code >= 0) {
+ *ret += subr_str->length;
+ }
+ pdfi_countdown(subr_str);
}
}
}
@@ -520,7 +527,7 @@ pdfi_fapi_get_float(gs_fapi_font *ff, gs_fapi_font_feature var_id, int index, fl
{
int array_index, subind;
pdf_array *suba;
- pdf_num *v;
+ double d;
pdf_font_type1 *pdffont1 = (pdf_font_type1 *)pbfont->client_data;
*ret = 0;
@@ -543,19 +550,13 @@ pdfi_fapi_get_float(gs_fapi_font *ff, gs_fapi_font_feature var_id, int index, fl
break;
}
- code = pdfi_array_get(pdffont1->ctx, suba, subind, (pdf_obj**)&v);
+ code = pdfi_array_get_number(pdffont1->ctx, suba, subind, &d);
pdfi_countdown(suba);
if (code < 0) {
code = 0;
break;
}
- if (v->type == PDF_INT) {
- *ret = (float)v->value.i;
- }
- else {
- *ret = (float)v->value.d;
- }
- pdfi_countdown(v);
+ *ret = (float)d;
}
break;
case gs_fapi_font_feature_BlendDesignMapArrayValue:
@@ -580,15 +581,11 @@ pdfi_fapi_get_float(gs_fapi_font *ff, gs_fapi_font_feature var_id, int index, fl
pdfi doesn't, hence the multiplications by 64.
*/
if ((i * 64) + (j * 64) + k == index) {
- pdf_num *n;
- code = pdfi_array_get(pdffont1->ctx, suba, i, (pdf_obj **)&n);
+ double d;
+ code = pdfi_array_get_number(pdffont1->ctx, suba, i, &d);
if (code < 0)
continue;
- if (n->type == PDF_INT)
- *ret = (float)n->value.i;
- else
- *ret = (float)n->value.d;
- pdfi_countdown(n);
+ *ret = (float)d;
pdfi_countdown(subsuba);
pdfi_countdown(suba);
goto gotit;
@@ -683,7 +680,7 @@ pdfi_fapi_get_gsubr(gs_fapi_font *ff, int index, byte *buf, int buf_length)
int code = 0;
if (pfont->FontType == ft_encrypted2) {
pdf_font_cff *pdffont2 = (pdf_font_cff *)pfont->client_data;
- if (index > pdffont2->NumGlobalSubrs) {
+ if (index > (pdffont2->GlobalSubrs == NULL ? 0 : pdfi_array_size(pdffont2->GlobalSubrs))) {
code = gs_error_rangecheck;
}
else {
@@ -692,7 +689,7 @@ pdfi_fapi_get_gsubr(gs_fapi_font *ff, int index, byte *buf, int buf_length)
code = pdfi_array_get(pdffont2->ctx, pdffont2->GlobalSubrs, index, (pdf_obj **)&subrstring);
if (code >= 0) {
- if (subrstring->type == PDF_STRING) {
+ if (pdfi_type_of(subrstring) == PDF_STRING) {
code = subrstring->length - leniv;
if (buf && buf_length >= code) {
if (ff->need_decrypt && pfont->data.lenIV >= 0) {
@@ -724,27 +721,35 @@ pdfi_fapi_get_subr(gs_fapi_font *ff, int index, byte *buf, int buf_length)
if (pfont->FontType == ft_encrypted) {
pdf_font_type1 *pdffont1 = (pdf_font_type1 *)pfont->client_data;
- if (index > pdffont1->NumSubrs) {
+ if (index > (pdffont1->Subrs == NULL ? 0 : pdfi_array_size(pdffont1->Subrs))) {
code = gs_note_error(gs_error_rangecheck);
}
else {
int leniv = (pfont->data.lenIV > 0 ? pfont->data.lenIV : 0);
- if (pdffont1->Subrs[index].size > 0) {
- code = pdffont1->Subrs[index].size - leniv;
+ pdf_string *subr_str = NULL;
+
+ code = pdfi_array_get_type(pdffont1->ctx, pdffont1->Subrs, index, PDF_STRING, (pdf_obj **)&subr_str);
+ if (code >= 0) {
+ code = subr_str->length - leniv;
if (buf && buf_length >= code) {
if (ff->need_decrypt && pfont->data.lenIV >= 0) {
- decode_bytes(buf, pdffont1->Subrs[index].data, code + leniv, pfont->data.lenIV);
+ decode_bytes(buf, subr_str->data, code + leniv, pfont->data.lenIV);
}
else {
- memcpy(buf, pdffont1->Subrs[index].data, code);
+ memcpy(buf, subr_str->data, code);
}
}
}
+ else {
+ /* Ignore invalid or missing subrs */
+ code = 0;
+ }
+ pdfi_countdown(subr_str);
}
}
else if (pfont->FontType == ft_encrypted2) {
pdf_font_cff *pdffont2 = (pdf_font_cff *)pfont->client_data;
- if (index > pdffont2->NumSubrs) {
+ if (index > (pdffont2->Subrs == NULL ? 0 : pdfi_array_size(pdffont2->Subrs))) {
code = gs_error_rangecheck;
}
else {
@@ -756,7 +761,7 @@ pdfi_fapi_get_subr(gs_fapi_font *ff, int index, byte *buf, int buf_length)
else
code = pdfi_array_get(pdffont2->ctx, pdffont2->Subrs, index, (pdf_obj **)&subrstring);
if (code >= 0) {
- if (subrstring->type == PDF_STRING) {
+ if (pdfi_type_of(subrstring) == PDF_STRING) {
if (subrstring->length > 0) {
code = subrstring->length - leniv;
if (buf && buf_length >= code) {
@@ -790,14 +795,23 @@ pdfi_fapi_get_raw_subr(gs_fapi_font *ff, int index, byte *buf, int buf_length)
if (pfont->FontType == ft_encrypted) {
pdf_font_type1 *pdffont1 = (pdf_font_type1 *)pfont->client_data;
- if (index > pdffont1->NumSubrs) {
+ if (index > (pdffont1->Subrs == NULL ? 0 : pdfi_array_size(pdffont1->Subrs))) {
code = gs_error_rangecheck;
}
else {
- code = pdffont1->Subrs[index].size;
- if (buf && buf_length >= code) {
- memcpy(buf, pdffont1->Subrs[index].data, code);
+ pdf_string *subr_str = NULL;
+ code = pdfi_array_get_type(pdffont1->ctx, pdffont1->Subrs, index, PDF_STRING, (pdf_obj **)&subr_str);
+ if (code >= 0) {
+ code = subr_str->length;
+ if (buf && buf_length >= code) {
+ memcpy(buf, subr_str->data, code);
+ }
+ }
+ else {
+ /* Ignore missing or invalid subrs */
+ code = 0;
}
+ pdfi_countdown(subr_str);
}
}
return code;
@@ -815,8 +829,6 @@ pdfi_fapi_get_charstring_name(gs_fapi_font *ff, int index, byte *buf, ushort buf
return 0;
}
-extern single_glyph_list_t SingleGlyphList[];
-
static int
pdfi_fapi_get_glyphname_or_cid(gs_text_enum_t *penum, gs_font_base * pbfont, gs_string * charstring,
gs_string * name, gs_glyph ccode, gs_string * enc_char_name,
@@ -835,8 +847,8 @@ pdfi_fapi_get_glyphname_or_cid(gs_text_enum_t *penum, gs_font_base * pbfont, gs_
if (pttfont->substitute == false) {
gid = ccode;
- if (pttfont->cidtogidmap.size > (ccode << 1) + 1) {
- gid = pttfont->cidtogidmap.data[ccode << 1] << 8 | pttfont->cidtogidmap.data[(ccode << 1) + 1];
+ if (pttfont->cidtogidmap != NULL && pttfont->cidtogidmap->length > (ccode << 1) + 1) {
+ gid = pttfont->cidtogidmap->data[ccode << 1] << 8 | pttfont->cidtogidmap->data[(ccode << 1) + 1];
}
cr->client_char_code = ccode;
cr->char_codes[0] = gid;
@@ -933,8 +945,9 @@ pdfi_fapi_get_glyphname_or_cid(gs_text_enum_t *penum, gs_font_base * pbfont, gs_
code = (*ctx->get_glyph_name)((gs_font *)pbfont, ccode, &gname);
if (code >= 0) {
code = pdfi_name_alloc(ctx, (byte *) gname.data, gname.size, (pdf_obj **) &glyphname);
- if (code >= 0)
- pdfi_countup(glyphname);
+ if (code < 0)
+ return code;
+ pdfi_countup(glyphname);
}
if (code < 0) {
@@ -942,10 +955,12 @@ pdfi_fapi_get_glyphname_or_cid(gs_text_enum_t *penum, gs_font_base * pbfont, gs_
return code;
}
code = pdfi_dict_get_by_key(cfffont->ctx, cfffont->CharStrings, glyphname, (pdf_obj **)&charstr);
- pdfi_countdown(glyphname);
if (code < 0) {
- code = pdfi_dict_get(cfffont->ctx, cfffont->CharStrings, ".notdef", (pdf_obj **)&charstr);
+ code = pdfi_map_glyph_name_via_agl(cfffont->CharStrings, glyphname, &charstr);
+ if (code < 0)
+ code = pdfi_dict_get(cfffont->ctx, cfffont->CharStrings, ".notdef", (pdf_obj **)&charstr);
}
+ pdfi_countdown(glyphname);
if (code < 0)
return code;
@@ -1121,7 +1136,6 @@ pdfi_fapi_get_glyph(gs_fapi_font * ff, gs_glyph char_code, byte * buf, int buf_l
pdf_name *encn;
int cstrlen = 0;
- /* This should only get called for Postscript-type fonts */
if (ff->is_type1) {
if (pbfont->FontType == ft_encrypted) {
@@ -1137,14 +1151,18 @@ pdfi_fapi_get_glyph(gs_fapi_font * ff, gs_glyph char_code, byte * buf, int buf_l
return code;
pdfi_countup(glyphname);
code = pdfi_dict_get_by_key(pdffont1->ctx, pdffont1->CharStrings, glyphname, (pdf_obj **)&charstring);
- pdfi_countdown(glyphname);
if (code < 0) {
- code = pdfi_dict_get(pdffont1->ctx, pdffont1->CharStrings, ".notdef", (pdf_obj **)&charstring);
+ code = pdfi_map_glyph_name_via_agl(pdffont1->CharStrings, glyphname, &charstring);
if (code < 0) {
- code = gs_note_error(gs_error_invalidfont);
- goto done;
+ code = pdfi_dict_get(pdffont1->ctx, pdffont1->CharStrings, ".notdef", (pdf_obj **)&charstring);
+ if (code < 0) {
+ pdfi_countdown(glyphname);
+ code = gs_note_error(gs_error_invalidfont);
+ goto done;
+ }
}
}
+ pdfi_countdown(glyphname);
cstrlen = charstring->length - leniv;
if (buf != NULL && cstrlen <= buf_length) {
if (ff->need_decrypt && pfont1->data.lenIV >= 0)
@@ -1261,7 +1279,16 @@ pdfi_fapi_get_glyph(gs_fapi_font * ff, gs_glyph char_code, byte * buf, int buf_l
}
}
else {
- code = gs_error_invalidaccess;
+ gs_font_type42 *pfont42 = (gs_font_type42 *)pbfont;
+ gs_glyph_data_t pgd;
+
+ code = pfont42->data.get_outline(pfont42, char_code, &pgd);
+ cstrlen = pgd.bits.size;
+ if (code >= 0) {
+ if (buf && buf_length >= cstrlen) {
+ memcpy(buf, pgd.bits.data, cstrlen);
+ }
+ }
}
done:
if (code < 0)
@@ -1277,6 +1304,19 @@ pdfi_fapi_serialize_tt_font(gs_fapi_font * ff, void *buf, int buf_size)
}
static int
+pdfi_fapi_retrieve_tt_font(gs_fapi_font * ff, void **buf, int *buf_size)
+{
+ gs_font_type42 *pfonttt = (gs_font_type42 *) ff->client_font_data;
+ pdf_font_truetype *pdfttf = (pdf_font_truetype *)pfonttt->client_data;
+
+ *buf = pdfttf->sfnt->data;
+ *buf_size = pdfttf->sfnt->length;
+
+ return 0;
+}
+
+
+static int
pdfi_get_glyphdirectory_data(gs_fapi_font * ff, int char_code,
const byte ** ptr)
{
@@ -1439,6 +1479,7 @@ pdfi_fapi_passfont(pdf_font *font, int subfont, char *fapi_request,
char *fapi_id = NULL;
int code = 0;
gs_string fdata;
+ gs_string *fdatap = &fdata;
gs_font_base *pbfont = (gs_font_base *)font->pfont;
gs_fapi_font local_pdf_ff_stub = pdfi_ff_stub;
gs_fapi_ttf_cmap_request symbolic_req[GS_FAPI_NUM_TTF_CMAP_REQ] = {{3, 0}, {1, 0}, {3, 1}, {3, 10}, {-1, -1}};
@@ -1450,16 +1491,15 @@ pdfi_fapi_passfont(pdf_font *font, int subfont, char *fapi_request,
}
if (font->pdfi_font_type == e_pdf_font_truetype) {
- fdata.data = ((pdf_font_truetype *)font)->sfnt.data;
- fdata.size = ((pdf_font_truetype *)font)->sfnt.size;
+ fdatap = NULL;
}
else if (font->pdfi_font_type == e_pdf_cidfont_type2) {
- fdata.data = ((pdf_cidfont_type2 *)font)->sfnt.data;
- fdata.size = ((pdf_cidfont_type2 *)font)->sfnt.size;
+ fdatap->data = ((pdf_cidfont_type2 *)font)->sfnt->data;
+ fdatap->size = ((pdf_cidfont_type2 *)font)->sfnt->length;
}
else {
- fdata.data = font_data;
- fdata.size = font_data_len;
+ fdatap->data = font_data;
+ fdatap->size = font_data_len;
}
if (font->pdfi_font_type == e_pdf_font_truetype) {
@@ -1476,7 +1516,7 @@ pdfi_fapi_passfont(pdf_font *font, int subfont, char *fapi_request,
(gs_font *)pbfont);
code =
- gs_fapi_passfont((gs_font *)pbfont, subfont, (char *)file_name, &fdata,
+ gs_fapi_passfont((gs_font *)pbfont, subfont, (char *)file_name, fdatap,
(char *)fapi_request, NULL, (char **)&fapi_id,
(gs_fapi_get_server_param_callback)
pdfi_get_server_param);
diff --git a/pdf/pdf_file.c b/pdf/pdf_file.c
index 5698866e..7f06a046 100644
--- a/pdf/pdf_file.c
+++ b/pdf/pdf_file.c
@@ -334,7 +334,7 @@ static int pdfi_Flate_filter(pdf_context *ctx, pdf_dict *d, stream *source, stre
(*new_stream)->strm = source;
source = *new_stream;
- if (d && d->type == PDF_DICT) {
+ if (d && pdfi_type_of(d) == PDF_DICT) {
Flate_source = (*new_stream)->strm;
code = pdfi_Predictor_filter(ctx, d, source, new_stream);
if (code < 0)
@@ -403,7 +403,7 @@ static int pdfi_LZW_filter(pdf_context *ctx, pdf_dict *d, stream *source, stream
/* s_zlibD_template defined in base/szlibd.c */
s_LZW_set_defaults_inline(&lzs);
- if (d && d->type == PDF_DICT) {
+ if (d && pdfi_type_of(d) == PDF_DICT) {
code = pdfi_dict_get_int(ctx, d, "EarlyChange", &i);
if (code < 0 && code != gs_error_undefined)
return code;
@@ -421,7 +421,7 @@ static int pdfi_LZW_filter(pdf_context *ctx, pdf_dict *d, stream *source, stream
(*new_stream)->strm = source;
source = *new_stream;
- if (d && d->type == PDF_DICT)
+ if (d && pdfi_type_of(d) == PDF_DICT)
pdfi_Predictor_filter(ctx, d, source, new_stream);
return 0;
}
@@ -473,21 +473,25 @@ pdfi_JPX_filter(pdf_context *ctx, pdf_dict *dict, pdf_dict *decode,
}
if (dict && pdfi_dict_get(ctx, dict, "ColorSpace", &csobj) == 0) {
/* parse the value */
- if (csobj->type == PDF_ARRAY) {
+ switch (pdfi_type_of(csobj)) {
+ case PDF_ARRAY:
/* assume it's the first array element */
code = pdfi_array_get(ctx, (pdf_array *)csobj, (uint64_t)0, (pdf_obj **)&csname);
if (code < 0) {
pdfi_countdown(csobj);
return code;
}
- } else if (csobj->type == PDF_NAME) {
+ break;
+ case PDF_NAME:
/* use the name directly */
csname = (pdf_name *)csobj;
csobj = NULL; /* To keep ref counting straight */
- } else {
+ break;
+ default:
dmprintf(ctx->memory, "warning: JPX ColorSpace value is an unhandled type!\n");
+ break;
}
- if (csname != NULL && csname->type == PDF_NAME) {
+ if (csname != NULL && pdfi_type_of(csname) == PDF_NAME) {
/* request raw index values if the colorspace is /Indexed */
if (pdfi_name_is(csname, "Indexed"))
state.colorspace = gs_jpx_cs_indexed;
@@ -613,7 +617,7 @@ static int pdfi_DCT_filter(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *de
return code;
}
- if (decode && decode->type == PDF_DICT) {
+ if (decode && pdfi_type_of(decode) == PDF_DICT) {
/* TODO: Why is this here? 'i' never gets used? */
code = pdfi_dict_get_int(ctx, decode, "ColorTransform", &i);
if (code < 0 && code != gs_error_undefined)
@@ -674,7 +678,7 @@ static int pdfi_CCITTFax_filter(pdf_context *ctx, pdf_dict *d, stream *source, s
s_CF_set_defaults_inline(&ss);
- if (d && d->type == PDF_DICT) {
+ if (d && pdfi_type_of(d) == PDF_DICT) {
code = pdfi_dict_get_int(ctx, d, "K", &i);
if (code < 0 && code != gs_error_undefined)
return code;
@@ -922,12 +926,11 @@ int pdfi_filter_no_decryption(pdf_context *ctx, pdf_stream *stream_obj,
goto exit;
}
- if (Filter->type != PDF_ARRAY && Filter->type != PDF_NAME) {
+ switch (pdfi_type_of(Filter)) {
+ default:
code = gs_note_error(gs_error_typecheck);
goto exit;
- }
-
- if (Filter->type == PDF_NAME) {
+ case PDF_NAME:
code = pdfi_dict_knownget(ctx, stream_dict, "DecodeParms", &decode);
if (code == 0 && inline_image)
code = pdfi_dict_knownget(ctx, stream_dict, "DP", &decode);
@@ -940,7 +943,9 @@ int pdfi_filter_no_decryption(pdf_context *ctx, pdf_stream *stream_obj,
goto exit;
code = pdfi_alloc_stream(ctx, new_s, source->s, new_stream);
- } else {
+ break;
+ case PDF_ARRAY:
+ {
pdf_array *filter_array = (pdf_array *)Filter;
code = pdfi_dict_knownget_type(ctx, stream_dict, "DecodeParms", PDF_ARRAY, (pdf_obj **)&DecodeParams);
@@ -1003,11 +1008,15 @@ int pdfi_filter_no_decryption(pdf_context *ctx, pdf_stream *stream_obj,
goto error;
}
}
- if (decode && decode->type != PDF_NULL && decode->type != PDF_DICT) {
+ if (decode && decode != PDF_NULL_OBJ && pdfi_type_of(decode) != PDF_DICT) {
pdfi_countdown(decode);
decode = NULL;
pdfi_set_warning(ctx, 0, NULL, W_PDF_STREAM_BAD_DECODEPARMS, "pdfi_filter_no_decryption", NULL);
}
+ if (decode && decode == PDF_NULL_OBJ) {
+ pdfi_countdown(decode);
+ decode = NULL;
+ }
code = pdfi_apply_filter(ctx, stream_dict, (pdf_name *)o,
(pdf_dict *)decode, s, &new_s, inline_image);
@@ -1022,6 +1031,7 @@ int pdfi_filter_no_decryption(pdf_context *ctx, pdf_stream *stream_obj,
}
code = pdfi_alloc_stream(ctx, s, source->s, new_stream);
}
+ }
exit:
pdfi_countdown(o);
@@ -1050,6 +1060,9 @@ int pdfi_filter(pdf_context *ctx, pdf_stream *stream_obj, pdf_c_stream *source,
pdf_c_stream *crypt_stream = NULL, *SubFile_stream = NULL;
pdf_string *StreamKey = NULL;
pdf_dict *stream_dict = NULL;
+ pdf_obj *FileSpec = NULL;
+ pdf_stream *NewStream = NULL;
+ bool known = false;
*new_stream = NULL;
@@ -1057,6 +1070,98 @@ int pdfi_filter(pdf_context *ctx, pdf_stream *stream_obj, pdf_c_stream *source,
if (code < 0)
goto error;
+ /* Horrifyingly, any stream dictionary can contain a file specification, which means that
+ * instead of using the stream from the PDF file we must use an external file.
+ * So much for portability!
+ * Note: We must not do this for inline images as an inline image dictionary can
+ * contain the abbreviation /F for the Filter, and an inline image is never a
+ * separate stream, it is (obviously) contained in the current stream.
+ */
+ if (!inline_image) {
+ code = pdfi_dict_known(ctx, stream_dict, "F", &known);
+ if (code >= 0 && known) {
+ pdf_obj *FS = NULL, *o = NULL;
+ pdf_dict *dict = NULL;
+ stream *gstream = NULL;
+
+ code = pdfi_dict_get(ctx, stream_dict, "F", &FileSpec);
+ if (code < 0)
+ goto error;
+ if (pdfi_type_of(FileSpec) == PDF_DICT) {
+ /* We don't really support FileSpec dictionaries, partly because we
+ * don't really know which platform to use. If there is a /F string
+ * then we will use that, just as if we had been given a string in
+ * the first place.
+ */
+ code = pdfi_dict_knownget(ctx, (pdf_dict *)FileSpec, "F", &FS);
+ if (code < 0) {
+ goto error;
+ }
+ pdfi_countdown(FileSpec);
+ FileSpec = FS;
+ FS = NULL;
+ }
+ if (pdfi_type_of(FileSpec) != PDF_STRING) {
+ code = gs_note_error(gs_error_typecheck);
+ goto error;
+ }
+ /* We should now have a string with the filename (or URL). We need
+ * to open the file and create a stream, if that succeeds.
+ */
+ gstream = sfopen((const char *)((pdf_string *)FileSpec)->data, "r", ctx->memory);
+ if (gstream == NULL) {
+ emprintf1(ctx->memory, "Failed to open file %s\n", (const char *)((pdf_string *)FileSpec)->data);
+ code = gs_note_error(gs_error_ioerror);
+ goto error;
+ }
+
+ source = (pdf_c_stream *)gs_alloc_bytes(ctx->memory, sizeof(pdf_c_stream), "external stream");
+ if (source == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error;
+ }
+ memset(source, 0x00, sizeof(pdf_c_stream));
+ source->s = gstream;
+
+ code = pdfi_object_alloc(ctx, PDF_STREAM, 0, (pdf_obj **)&NewStream);
+ if (code < 0)
+ goto error;
+ pdfi_countup(NewStream);
+ code = pdfi_dict_alloc(ctx, 32, &dict);
+ if (code < 0){
+ pdfi_countdown(NewStream);
+ goto error;
+ }
+ pdfi_countup(dict);
+ NewStream->stream_dict = dict;
+ code = pdfi_dict_get(ctx, stream_dict, "FFilter", &o);
+ if (code >= 0) {
+ code = pdfi_dict_put(ctx, NewStream->stream_dict, "Filter", o);
+ if (code < 0) {
+ pdfi_countdown(NewStream);
+ goto error;
+ }
+ }
+ code = pdfi_dict_get(ctx, stream_dict, "FPredictor", &o);
+ if (code >= 0) {
+ code = pdfi_dict_put(ctx, NewStream->stream_dict, "Predictor", o);
+ if (code < 0) {
+ pdfi_countdown(NewStream);
+ goto error;
+ }
+ }
+ pdfi_countup(NewStream->stream_dict);
+ NewStream->stream_offset = 0;
+ NewStream->Length = 0;
+ NewStream->length_valid = 0;
+ NewStream->stream_written = 0;
+ NewStream->is_marking = 0;
+ NewStream->parent_obj = NULL;
+ stream_obj = NewStream;
+ stream_dict = NewStream->stream_dict;
+ }
+ }
+
/* If the file isn't encrypted, don't apply encryption. If this is an inline
* image then its in a content stream and will already be decrypted, so don't
* apply decryption again.
@@ -1143,7 +1248,9 @@ int pdfi_filter(pdf_context *ctx, pdf_stream *stream_obj, pdf_c_stream *source,
code = pdfi_filter_no_decryption(ctx, stream_obj, source, new_stream, inline_image);
}
error:
+ pdfi_countdown(NewStream);
pdfi_countdown(StreamKey);
+ pdfi_countdown(FileSpec);
return code;
}
diff --git a/pdf/pdf_fmap.c b/pdf/pdf_fmap.c
index ee05af1c..00034594 100644
--- a/pdf/pdf_fmap.c
+++ b/pdf/pdf_fmap.c
@@ -728,11 +728,11 @@ static int pdfi_generate_native_fontmap(pdf_context *ctx)
(void)pdfi_dict_get_by_key(ctx, ctx->pdfnativefontmap, key, (pdf_obj **)&v);
for (j = 0; j < key->length; j++)
dprintf1("%c", key->data[j]);
- if (v->type == PDF_DICT) {
+ if (pdfi_type_of(v) == PDF_DICT) {
pdf_num *n;
pdf_string *val2;
code = pdfi_dict_get(ctx, (pdf_dict *)v, "Index", (pdf_obj **)&n);
- if (code >= 0 && n->type == PDF_INT)
+ if (code >= 0 && pdfi_type_of(n) == PDF_INT)
find = n->value.i;
else
code = 0;
@@ -758,11 +758,11 @@ static int pdfi_generate_native_fontmap(pdf_context *ctx)
(void)pdfi_dict_get_by_key(ctx, ctx->pdfnativefontmap, key, (pdf_obj **)&v);
for (j = 0; j < key->length; j++)
dprintf1("%c", key->data[j]);
- if (v->type == PDF_DICT) {
+ if (pdfi_type_of(v) == PDF_DICT) {
pdf_num *n;
pdf_string *val2;
code = pdfi_dict_get(ctx, (pdf_dict *)v, "Index", (pdf_obj **)&n);
- if (code >= 0 && n->type == PDF_INT)
+ if (code >= 0 && pdfi_type_of(n) == PDF_INT)
find = n->value.i;
else
code = 0;
@@ -814,48 +814,56 @@ pdf_fontmap_lookup_font(pdf_context *ctx, pdf_name *fname, pdf_obj **mapname, in
return code;
}
- code = pdfi_dict_get_by_key(ctx, ctx->pdffontmap, fname, &mname);
- if (code >= 0) {
- /* Fontmap can map in multiple "jump" i.e.
- name -> substitute name
- subsitute name -> file name
- So we want to loop until we no more hits.
- */
- while(1) {
- pdf_obj *mname2;
- code = pdfi_dict_get_by_key(ctx, ctx->pdffontmap, (pdf_name *)mname, &mname2);
- if (code < 0) break;
- pdfi_countdown(mname);
- mname = mname2;
- }
- }
- else if (ctx->pdfnativefontmap != NULL) {
+ if (ctx->pdfnativefontmap != NULL) {
pdf_obj *record;
code = pdfi_dict_get_by_key(ctx, ctx->pdfnativefontmap, fname, &record);
- if (code < 0)
- return code;
- if (record->type == PDF_STRING) {
- mname = record;
- }
- else {
- pdf_num *ind;
- code = pdfi_dict_get(ctx, (pdf_dict *)record, "Path", &mname);
- if (code < 0) {
- pdfi_countdown(record);
- return code;
+ if (code >= 0) {
+ if (pdfi_type_of(record) == PDF_STRING) {
+ mname = record;
+ }
+ else if (pdfi_type_of(record) == PDF_DICT) {
+ int64_t i64;
+ code = pdfi_dict_get(ctx, (pdf_dict *)record, "Path", &mname);
+ if (code >= 0)
+ code = pdfi_dict_get_int(ctx, (pdf_dict *)record, "Index", &i64);
+ if (code < 0) {
+ pdfi_countdown(record);
+ return code;
+ }
+ *findex = (int)i64; /* Rangecheck? */
}
- code = pdfi_dict_get(ctx, (pdf_dict *)record, "Index", (pdf_obj **)&ind);
- if (code >= 0 && ind->type == PDF_INT) {
- *findex = ind->value.i;
+ else {
+ pdfi_countdown(record);
+ code = gs_error_undefined;
}
}
}
+ else {
+ code = gs_error_undefined;
+ }
- if (mname != NULL && mname->type == PDF_STRING && pdfi_fmap_file_exists(ctx, (pdf_string *)mname)) {
+ if (code < 0) {
+ code = pdfi_dict_get_by_key(ctx, ctx->pdffontmap, fname, &mname);
+ if (code >= 0) {
+ /* Fontmap can map in multiple "jump" i.e.
+ name -> substitute name
+ subsitute name -> file name
+ So we want to loop until we no more hits.
+ */
+ while(1) {
+ pdf_obj *mname2;
+ code = pdfi_dict_get_by_key(ctx, ctx->pdffontmap, (pdf_name *)mname, &mname2);
+ if (code < 0) break;
+ pdfi_countdown(mname);
+ mname = mname2;
+ }
+ }
+ }
+ if (mname != NULL && pdfi_type_of(mname) == PDF_STRING && pdfi_fmap_file_exists(ctx, (pdf_string *)mname)) {
*mapname = mname;
code = 0;
}
- else if (mname != NULL && mname->type == PDF_NAME) { /* If we map to a name, we assume (for now) we have the font as a "built-in" */
+ else if (mname != NULL && pdfi_type_of(mname) == PDF_NAME) { /* If we map to a name, we assume (for now) we have the font as a "built-in" */
*mapname = mname;
code = 0;
}
@@ -881,9 +889,9 @@ pdf_fontmap_lookup_cidfont(pdf_context *ctx, pdf_dict *font_dict, pdf_name *name
return code;
}
}
- if (name == NULL || name->type != PDF_NAME) {
+ if (name == NULL || pdfi_type_of(name) != PDF_NAME) {
code = pdfi_dict_get(ctx, font_dict, "BaseFont", &cidname);
- if (code < 0 || cidname->type != PDF_NAME) {
+ if (code < 0 || pdfi_type_of(cidname) != PDF_NAME) {
pdfi_countdown(cidname);
return_error(gs_error_undefined);
}
@@ -910,19 +918,18 @@ pdf_fontmap_lookup_cidfont(pdf_context *ctx, pdf_dict *font_dict, pdf_name *name
pdfi_countdown(mname);
mname = mname2;
}
- if (mname->type == PDF_DICT) {
+ if (pdfi_type_of(mname) == PDF_DICT) {
pdf_dict *rec = (pdf_dict *)mname;
pdf_name *filetype;
pdf_name *path = NULL;
- pdf_num *ind = NULL;
pdf_array *mcsi = NULL;
pdf_dict *ocsi = NULL;
pdf_string *ord1 = NULL, *ord2 = NULL;
- pdf_num *sup1, *sup2;
+ int64_t i64;
code = pdfi_dict_get(ctx, rec, "FileType", (pdf_obj **)&filetype);
/* We only handle TTF files, just now */
- if (code < 0 || filetype->type != PDF_NAME || filetype->length != 8 || memcmp(filetype->data, "TrueType", 8) != 0) {
+ if (code < 0 || pdfi_type_of(filetype) != PDF_NAME || filetype->length != 8 || memcmp(filetype->data, "TrueType", 8) != 0) {
pdfi_countdown(filetype);
pdfi_countdown(rec);
return_error(gs_error_undefined);
@@ -930,21 +937,21 @@ pdf_fontmap_lookup_cidfont(pdf_context *ctx, pdf_dict *font_dict, pdf_name *name
pdfi_countdown(filetype);
code = pdfi_dict_get(ctx, rec, "CSI", (pdf_obj **)&mcsi);
- if (code < 0 || mcsi->type != PDF_ARRAY) {
+ if (code < 0 || pdfi_type_of(mcsi) != PDF_ARRAY) {
pdfi_countdown(mcsi);
pdfi_countdown(rec);
return_error(gs_error_undefined);
}
code = pdfi_dict_get(ctx, font_dict, "CIDSystemInfo", (pdf_obj **)&ocsi);
- if (code < 0 || ocsi->type != PDF_DICT) {
+ if (code < 0 || pdfi_type_of(ocsi) != PDF_DICT) {
pdfi_countdown(ocsi);
pdfi_countdown(mcsi);
pdfi_countdown(rec);
return_error(gs_error_undefined);
}
code = pdfi_dict_get(ctx, ocsi, "Ordering", (pdf_obj **)&ord1);
- if (code < 0 || ord1->type != PDF_STRING) {
+ if (code < 0 || pdfi_type_of(ord1) != PDF_STRING) {
pdfi_countdown(ord1);
pdfi_countdown(ocsi);
pdfi_countdown(mcsi);
@@ -952,7 +959,7 @@ pdf_fontmap_lookup_cidfont(pdf_context *ctx, pdf_dict *font_dict, pdf_name *name
return_error(gs_error_undefined);
}
code = pdfi_array_get(ctx, mcsi, 0, (pdf_obj **)&ord2);
- if (code < 0 || ord2->type != PDF_STRING) {
+ if (code < 0 || pdfi_type_of(ord2) != PDF_STRING) {
pdfi_countdown(ord1);
pdfi_countdown(ord2);
pdfi_countdown(ocsi);
@@ -970,43 +977,16 @@ pdf_fontmap_lookup_cidfont(pdf_context *ctx, pdf_dict *font_dict, pdf_name *name
}
pdfi_countdown(ord1);
pdfi_countdown(ord2);
- code = pdfi_dict_get(ctx, ocsi, "Supplement", (pdf_obj **)&sup1);
- if (code < 0 || sup1->type != PDF_INT) {
- pdfi_countdown(ord1);
- pdfi_countdown(ocsi);
- pdfi_countdown(mcsi);
- pdfi_countdown(rec);
- return_error(gs_error_undefined);
- }
- code = pdfi_array_get(ctx, mcsi, 1, (pdf_obj **)&sup2);
- if (code < 0 || sup2->type != PDF_INT || sup1->value.i != sup2->value.i) {
- pdfi_countdown(sup1);
- pdfi_countdown(sup2);
- pdfi_countdown(ocsi);
- pdfi_countdown(mcsi);
- pdfi_countdown(rec);
- return_error(gs_error_undefined);
- }
- pdfi_countdown(sup1);
- pdfi_countdown(sup2);
- pdfi_countdown(ocsi);
- pdfi_countdown(mcsi);
code = pdfi_dict_get(ctx, rec, "Path", (pdf_obj **)&path);
- if (code < 0 || path->type != PDF_STRING || !pdfi_fmap_file_exists(ctx, (pdf_string *)path)) {
+ if (code < 0 || pdfi_type_of(path) != PDF_STRING || !pdfi_fmap_file_exists(ctx, (pdf_string *)path)) {
pdfi_countdown(rec);
return_error(gs_error_undefined);
}
*mapname = (pdf_obj *)path;
- code = pdfi_dict_get(ctx, rec, "Index", (pdf_obj **)&ind);
- if (code >= 0 && ind->type != PDF_INT) {
- *findex = ind->value.i;
- }
- else {
- *findex = 0;
- }
- pdfi_countdown(ind);
+ code = pdfi_dict_get_int(ctx, rec, "Index", &i64);
+ *findex = (code < 0) ? 0 : (int)i64; /* rangecheck? */
code = 0;
}
diff --git a/pdf/pdf_font.c b/pdf/pdf_font.c
index fa716056..28ebe96e 100644
--- a/pdf/pdf_font.c
+++ b/pdf/pdf_font.c
@@ -34,11 +34,14 @@
#include "pdf_font0.h"
#include "pdf_fmap.h"
#include "gscencs.h" /* For gs_c_known_encode and gs_c_glyph_name */
+#include "gsagl.h"
#include "strmio.h"
#include "stream.h"
#include "gsstate.h" /* For gs_setPDFfontsize() */
+extern single_glyph_list_t SingleGlyphList[];
+
static int pdfi_gs_setfont(pdf_context *ctx, gs_font *pfont)
{
int code = 0;
@@ -78,7 +81,7 @@ bool pdfi_font_known_symbolic(pdf_obj *basefont)
int i;
pdf_name *nm = (pdf_name *)basefont;
- if (basefont != NULL && basefont->type == PDF_NAME) {
+ if (basefont != NULL && pdfi_type_of(basefont) == PDF_NAME) {
for (i = 0; known_symbolic_font_names[i].name != NULL; i++) {
if (nm->length == known_symbolic_font_names[i].namelen
&& !strncmp((char *)nm->data, known_symbolic_font_names[i].name, nm->length)) {
@@ -104,7 +107,7 @@ pdfi_font_match_glyph_widths(pdf_font *pdfont)
/* For "best" results, restrict to what we *hope* are A-Z,a-z */
sindex = pdfont->FirstChar < 96 ? 96 : pdfont->FirstChar;
- lindex = pdfont->LastChar > 122 ? 122 : pdfont->LastChar;
+ lindex = pdfont->LastChar > 122 ? 123 : pdfont->LastChar + 1;
for (i = sindex; i < lindex; i++) {
gs_glyph_info_t ginfo = {0};
@@ -156,8 +159,14 @@ static void pdfi_print_font_name(pdf_context *ctx, pdf_name *n)
(void)outwrite(ctx->memory, (const char *)n->data, n->length);
}
+static void pdfi_print_font_string(pdf_context *ctx, pdf_string *s)
+{
+ if (ctx->args.QUIET != true)
+ (void)outwrite(ctx->memory, (const char *)s->data, s->length);
+}
+
/* Print a null terminated string to stdout */
-static void pdfi_print_string(pdf_context *ctx, const char *str)
+static void pdfi_print_cstring(pdf_context *ctx, const char *str)
{
if (ctx->args.QUIET != true)
(void)outwrite(ctx->memory, str, strlen(str));
@@ -169,7 +178,7 @@ static void pdfi_print_string(pdf_context *ctx, const char *str)
Currently only loads subsitute - DroidSansFallback
*/
static int
-pdfi_open_CIDFont_substitute_file(pdf_context * ctx, pdf_dict *font_dict, pdf_dict *fontdesc, bool fallback, byte ** buf, int64_t * buflen, int *findex)
+pdfi_open_CIDFont_substitute_file(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *fontdesc, bool fallback, byte ** buf, int64_t * buflen, int *findex)
{
int code = 0;
char fontfname[gp_file_name_sizeof];
@@ -184,12 +193,12 @@ pdfi_open_CIDFont_substitute_file(pdf_context * ctx, pdf_dict *font_dict, pdf_di
pdf_dict *csi = NULL;
code = pdfi_dict_get(ctx, font_dict, "CIDSystemInfo", (pdf_obj **)&csi);
- if (code >= 0 && csi->type == PDF_DICT) {
+ if (code >= 0 && pdfi_type_of(csi) == PDF_DICT) {
pdf_string *csi_reg = NULL, *csi_ord = NULL;
if (pdfi_dict_get(ctx, csi, "Registry", (pdf_obj **)&csi_reg) >= 0
&& pdfi_dict_get(ctx, csi, "Ordering", (pdf_obj **)&csi_ord) >= 0
- && csi_reg->type == PDF_STRING && csi_ord->type == PDF_STRING
+ && pdfi_type_of(csi_reg) == PDF_STRING && pdfi_type_of(csi_ord) == PDF_STRING
&& csi_reg->length + csi_ord->length + 1 < gp_file_name_sizeof - 1) {
pdf_name *reg_ord;
memcpy(fontfname, csi_reg->data, csi_reg->length);
@@ -209,10 +218,10 @@ pdfi_open_CIDFont_substitute_file(pdf_context * ctx, pdf_dict *font_dict, pdf_di
}
pdfi_countdown(csi);
- if (mname == NULL || mname->type != PDF_STRING)
+ if (mname == NULL || pdfi_type_of(mname) != PDF_STRING)
code = pdf_fontmap_lookup_cidfont(ctx, font_dict, NULL, (pdf_obj **)&mname, findex);
- if (code < 0 || mname->type != PDF_STRING) {
+ if (code < 0 || pdfi_type_of(mname) != PDF_STRING) {
const char *fsprefix = "CIDFSubst/";
int fsprefixlen = strlen(fsprefix);
const char *defcidfallack = "DroidSansFallback.ttf";
@@ -224,26 +233,26 @@ pdfi_open_CIDFont_substitute_file(pdf_context * ctx, pdf_dict *font_dict, pdf_di
code = gs_note_error(gs_error_invalidfont);
}
else {
- if (ctx->args.cidsubstpath.data == NULL) {
+ if (ctx->args.cidfsubstpath.data == NULL) {
memcpy(fontfname, fsprefix, fsprefixlen);
}
else {
- memcpy(fontfname, ctx->args.cidsubstpath.data, ctx->args.cidsubstpath.size);
- fsprefixlen = ctx->args.cidsubstpath.size;
+ memcpy(fontfname, ctx->args.cidfsubstpath.data, ctx->args.cidfsubstpath.size);
+ fsprefixlen = ctx->args.cidfsubstpath.size;
}
- if (ctx->args.cidsubstfont.data == NULL) {
+ if (ctx->args.cidfsubstfont.data == NULL) {
int len = 0;
- if (gp_getenv("CIDSUBSTFONT", (char *)0, &len) < 0 && len + fsprefixlen + 1 < gp_file_name_sizeof) {
- (void)gp_getenv("CIDSUBSTFONT", (char *)(fontfname + fsprefixlen), &defcidfallacklen);
+ if (gp_getenv("CIDFSUBSTFONT", (char *)0, &len) < 0 && len + fsprefixlen + 1 < gp_file_name_sizeof) {
+ (void)gp_getenv("CIDFSUBSTFONT", (char *)(fontfname + fsprefixlen), &defcidfallacklen);
}
else {
memcpy(fontfname + fsprefixlen, defcidfallack, defcidfallacklen);
}
}
else {
- memcpy(fontfname, ctx->args.cidsubstfont.data, ctx->args.cidsubstfont.size);
- defcidfallacklen = ctx->args.cidsubstfont.size;
+ memcpy(fontfname, ctx->args.cidfsubstfont.data, ctx->args.cidfsubstfont.size);
+ defcidfallacklen = ctx->args.cidfsubstfont.size;
}
fontfname[fsprefixlen + defcidfallacklen] = '\0';
@@ -253,12 +262,12 @@ pdfi_open_CIDFont_substitute_file(pdf_context * ctx, pdf_dict *font_dict, pdf_di
}
else {
if (cidname) {
- pdfi_print_string(ctx, "Loading CIDFont ");
+ pdfi_print_cstring(ctx, "Loading CIDFont ");
pdfi_print_font_name(ctx, (pdf_name *)cidname);
- pdfi_print_string(ctx, " substitute from ");
+ pdfi_print_cstring(ctx, " substitute from ");
}
else {
- pdfi_print_string(ctx, "Loading nameless CIDFont from ");
+ pdfi_print_cstring(ctx, "Loading nameless CIDFont from ");
}
sfilename(s, &fname);
if (fname.size < gp_file_name_sizeof) {
@@ -268,8 +277,8 @@ pdfi_open_CIDFont_substitute_file(pdf_context * ctx, pdf_dict *font_dict, pdf_di
else {
strcpy(fontfname, "unnamed file");
}
- pdfi_print_string(ctx, fontfname);
- pdfi_print_string(ctx, "\n");
+ pdfi_print_cstring(ctx, fontfname);
+ pdfi_print_cstring(ctx, "\n");
sfseek(s, 0, SEEK_END);
@@ -287,19 +296,25 @@ pdfi_open_CIDFont_substitute_file(pdf_context * ctx, pdf_dict *font_dict, pdf_di
}
}
else {
- code = pdfi_open_resource_file(ctx, (const char *)mname->data, mname->length, &s);
+ if (mname->length + 1 > gp_file_name_sizeof) {
+ pdfi_countdown(mname);
+ return_error(gs_error_invalidfont);
+ }
+ memcpy(fontfname, mname->data, mname->length);
+ fontfname[mname->length] = '\0';
+ code = pdfi_open_resource_file(ctx, (const char *)fontfname, mname->length, &s);
pdfi_countdown(mname);
if (code < 0) {
code = gs_note_error(gs_error_invalidfont);
}
else {
if (cidname) {
- pdfi_print_string(ctx, "Loading CIDFont ");
+ pdfi_print_cstring(ctx, "Loading CIDFont ");
pdfi_print_font_name(ctx, (pdf_name *)cidname);
- pdfi_print_string(ctx, " (or substitute) from ");
+ pdfi_print_cstring(ctx, " (or substitute) from ");
}
else {
- pdfi_print_string(ctx, "Loading nameless CIDFont from ");
+ pdfi_print_cstring(ctx, "Loading nameless CIDFont from ");
}
sfilename(s, &fname);
if (fname.size < gp_file_name_sizeof) {
@@ -309,8 +324,8 @@ pdfi_open_CIDFont_substitute_file(pdf_context * ctx, pdf_dict *font_dict, pdf_di
else {
strcpy(fontfname, "unnamed file");
}
- pdfi_print_string(ctx, fontfname);
- pdfi_print_string(ctx, "\n");
+ pdfi_print_cstring(ctx, fontfname);
+ pdfi_print_cstring(ctx, "\n");
sfseek(s, 0, SEEK_END);
*buflen = sftell(s);
sfseek(s, 0, SEEK_SET);
@@ -329,9 +344,11 @@ pdfi_open_CIDFont_substitute_file(pdf_context * ctx, pdf_dict *font_dict, pdf_di
const char *fsprefix = "CIDFont/";
const int fsprefixlen = strlen(fsprefix);
- if (cidname == NULL || cidname->type != PDF_NAME
- || fsprefixlen + cidname->length >= gp_file_name_sizeof)
+ if (cidname == NULL || pdfi_type_of(cidname) != PDF_NAME
+ || fsprefixlen + cidname->length >= gp_file_name_sizeof) {
+ code = gs_note_error(gs_error_invalidfont);
goto exit;
+ }
memcpy(fontfname, fsprefix, fsprefixlen);
memcpy(fontfname + fsprefixlen, cidname->data, cidname->length);
@@ -428,64 +445,90 @@ static const char *pdfi_clean_font_name(const char *fontname)
return NULL;
}
-static const char *pdfi_font_substitute_by_flags(unsigned int flags)
+static int pdfi_font_substitute_by_flags(pdf_context *ctx, unsigned int flags, char **name, int *namelen)
{
bool fixed = ((flags & pdfi_font_flag_fixed) != 0);
bool serif = ((flags & pdfi_font_flag_serif) != 0);
bool italic = ((flags & pdfi_font_flag_italic) != 0);
bool bold = ((flags & pdfi_font_flag_forcebold) != 0);
+ int code = 0;
- if (fixed) {
+ if (ctx->args.defaultfont_is_name == true && ctx->args.defaultfont.size == 4
+ && !memcmp(ctx->args.defaultfont.data, "None", 4)) {
+ *name = NULL;
+ *namelen = 0;
+ code = gs_error_invalidfont;
+ }
+ else if (ctx->args.defaultfont.data != NULL && ctx->args.defaultfont.size > 0) {
+ *name = (char *)ctx->args.defaultfont.data;
+ *namelen = ctx->args.defaultfont.size;
+ }
+ else if (fixed) {
if (bold) {
if (italic) {
- return "Courier-BoldOblique";
+ *name = (char *)pdfi_base_font_names[3][0];
+ *namelen = strlen(*name);
}
else {
- return "Courier-Bold";
+ *name = (char *)pdfi_base_font_names[1][0];
+ *namelen = strlen(*name);
}
}
else {
if (italic) {
- return "Courier-Oblique";
+ *name = (char *)pdfi_base_font_names[2][0];
+ *namelen = strlen(*name);
}
else {
- return "Courier";
+ *name = (char *)pdfi_base_font_names[0][0];
+ *namelen = strlen(*name);
}
}
}
else if (serif) {
if (bold) {
if (italic) {
- return "Times-BoldItalic";
+ *name = (char *)pdfi_base_font_names[11][0];
+ *namelen = strlen(*name);
}
else {
- return "Times-Bold";
+ *name = (char *)pdfi_base_font_names[9][0];
+ *namelen = strlen(*name);
}
}
else {
if (italic) {
- return "Times-Italic";
+ *name = (char *)pdfi_base_font_names[10][0];
+ *namelen = strlen(*name);
}
else {
- return "Times-Roman";
+ *name = (char *)pdfi_base_font_names[8][0];
+ *namelen = strlen(*name);
}
}
} else {
if (bold) {
if (italic) {
- return "Helvetica-BoldOblique";
+ *name = (char *)pdfi_base_font_names[7][0];
+ *namelen = strlen(*name);
}
else {
- return "Helvetica-Bold";
+ *name = (char *)pdfi_base_font_names[5][0];
+ *namelen = strlen(*name);
}
}
else {
if (italic) {
- return "Helvetica-Oblique";
+ *name = (char *)pdfi_base_font_names[6][0];
+ *namelen = strlen(*name);
+ }
+ else {
+ *name = (char *)pdfi_base_font_names[4][0];
+ *namelen = strlen(*name);
}
}
}
- return "Helvetica"; /* Really shouldn't ever happen */
+ return code;
}
enum {
@@ -524,27 +567,112 @@ static int pdfi_fonttype_picker(byte *buf, int64_t buflen)
#undef MAKEMAGIC
}
-static int
-pdfi_open_font_substitute_file(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *fontdesc, bool fallback, byte **buf, int64_t *buflen, int *findex)
+static int pdfi_copy_font(pdf_context *ctx, pdf_font *spdffont, pdf_dict *font_dict, pdf_font **tpdffont)
+{
+ int code;
+ if (pdfi_type_of(spdffont) != PDF_FONT)
+ return_error(gs_error_typecheck);
+
+ switch(spdffont->pdfi_font_type) {
+ case e_pdf_font_type1:
+ code = pdfi_copy_type1_font(ctx, spdffont, font_dict, tpdffont);
+ break;
+ case e_pdf_font_cff:
+ code = pdfi_copy_cff_font(ctx, spdffont, font_dict, tpdffont);
+ break;
+ case e_pdf_font_truetype:
+ code = pdfi_copy_truetype_font(ctx, spdffont, font_dict, tpdffont);
+ break;
+ default:
+ return_error(gs_error_invalidfont);
+ }
+ return code;
+}
+
+enum {
+ font_embedded = 0,
+ font_from_file = 1,
+ font_substitute = 2
+};
+
+static int pdfi_load_font_buffer(pdf_context *ctx, byte *fbuf, int fbuflen, int fftype, pdf_name *Subtype, int findex, pdf_dict *stream_dict, pdf_dict *page_dict, pdf_dict *font_dict, pdf_font **ppdffont, bool cidfont)
+{
+ int code = gs_error_invalidfont;
+ if (fbuf != NULL) {
+ /* First, see if we can glean the type from the magic number */
+ int sftype = pdfi_fonttype_picker(fbuf, fbuflen);
+ if (sftype == no_type_font) {
+ if (fftype != no_type_font)
+ sftype = fftype;
+ else {
+ /* If we don't have a Subtype, can't work it out, try Type 1 */
+ if (Subtype == NULL || pdfi_name_is(Subtype, "Type1") || pdfi_name_is(Subtype, "MMType1"))
+ sftype = type1_font;
+ else if (pdfi_name_is(Subtype, "Type1C"))
+ sftype = cff_font;
+ else if (pdfi_name_is(Subtype, "TrueType"))
+ sftype = tt_font;
+ }
+ }
+ /* fbuf ownership passes to the font loader */
+ switch (sftype) {
+ case type1_font:
+ code = pdfi_read_type1_font(ctx, (pdf_dict *)font_dict, stream_dict, page_dict, fbuf, fbuflen, ppdffont);
+ fbuf = NULL;
+ break;
+ case cff_font:
+ code = pdfi_read_cff_font(ctx, (pdf_dict *)font_dict, stream_dict, page_dict, fbuf, fbuflen, cidfont, ppdffont);
+ fbuf = NULL;
+ break;
+ case tt_font:
+ {
+ if (cidfont)
+ code = pdfi_read_cidtype2_font(ctx, font_dict, stream_dict, page_dict, fbuf, fbuflen, findex, ppdffont);
+ else
+ code = pdfi_read_truetype_font(ctx, font_dict, stream_dict, page_dict, fbuf, fbuflen, findex, ppdffont);
+ fbuf = NULL;
+ }
+ break;
+ default:
+ gs_free_object(ctx->memory, fbuf, "pdfi_load_font_buffer(fbuf)");
+ code = gs_note_error(gs_error_invalidfont);
+ }
+ }
+ return code;
+}
+
+static int pdfi_load_font_file(pdf_context *ctx, int fftype, pdf_name *Subtype, pdf_dict *stream_dict, pdf_dict *page_dict, pdf_dict *font_dict, pdf_dict *fontdesc, bool substitute, pdf_font **ppdffont)
{
int code;
char fontfname[gp_file_name_sizeof];
- pdf_obj *basefont = NULL, *mapname;
+ pdf_obj *basefont = NULL, *mapname = NULL;
pdf_obj *fontname = NULL;
stream *s;
const char *fn;
+ int findex = 0;
+ byte *buf;
+ int buflen;
+ pdf_font *pdffont = NULL;
+ pdf_font *substpdffont = NULL;
+ bool f_retry = true;
code = pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, &basefont);
- if (code < 0 || basefont == NULL || ((pdf_name *)basefont)->length == 0)
- fallback = true;
+ if (substitute == false && (code < 0 || basefont == NULL || ((pdf_name *)basefont)->length == 0)) {
+ pdfi_countdown(basefont);
+ return_error(gs_error_invalidfont);
+ }
- if (fallback == true) {
- const char *fbname;
+ if (substitute == true) {
+ char *fbname;
+ int fbnamelen;
int64_t flags = 0;
if (fontdesc != NULL) {
(void)pdfi_dict_get_int(ctx, fontdesc, "Flags", &flags);
}
- fbname = pdfi_font_substitute_by_flags((int)flags);
+ code = pdfi_font_substitute_by_flags(ctx, (int)flags, &fbname, &fbnamelen);
+ if (code < 0)
+ return code;
+
code = pdfi_name_alloc(ctx, (byte *)fbname, strlen(fbname), (pdf_obj **) &fontname);
if (code < 0)
return code;
@@ -558,87 +686,166 @@ pdfi_open_font_substitute_file(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *
if (((pdf_name *)fontname)->length < gp_file_name_sizeof) {
memcpy(fontfname, ((pdf_name *)fontname)->data, ((pdf_name *)fontname)->length);
fontfname[((pdf_name *)fontname)->length] = '\0';
- fn = pdfi_clean_font_name(fontfname);
- if (fn != NULL) {
- pdfi_countdown(fontname);
+ pdfi_countdown(fontname);
- code = pdfi_name_alloc(ctx, (byte *)fn, strlen(fn), (pdf_obj **) &fontname);
- if (code < 0)
- return code;
- pdfi_countup(fontname);
- }
- }
- code = pdf_fontmap_lookup_font(ctx, (pdf_name *) fontname, &mapname, findex);
- if (code < 0) {
- mapname = fontname;
- pdfi_countup(mapname);
- code = 0;
+ code = pdfi_name_alloc(ctx, (byte *)fontfname, strlen(fontfname), (pdf_obj **) &fontname);
+ if (code < 0)
+ return code;
+ pdfi_countup(fontname);
}
- if (mapname->type == PDF_NAME || mapname->type == PDF_STRING) {
- pdf_name *mname = (pdf_name *) mapname;
- if (mname->length + 1 < gp_file_name_sizeof) {
- memcpy(fontfname, mname->data, mname->length);
- fontfname[mname->length] = '\0';
+
+ do {
+ code = pdf_fontmap_lookup_font(ctx, (pdf_name *) fontname, &mapname, &findex);
+ if (code < 0) {
+ if (((pdf_name *)fontname)->length < gp_file_name_sizeof) {
+ memcpy(fontfname, ((pdf_name *)fontname)->data, ((pdf_name *)fontname)->length);
+ fontfname[((pdf_name *)fontname)->length] = '\0';
+ fn = pdfi_clean_font_name(fontfname);
+ if (fn != NULL) {
+ pdfi_countdown(fontname);
+
+ code = pdfi_name_alloc(ctx, (byte *)fn, strlen(fn), (pdf_obj **) &fontname);
+ if (code < 0)
+ return code;
+ pdfi_countup(fontname);
+ }
+ }
+ code = pdf_fontmap_lookup_font(ctx, (pdf_name *) fontname, &mapname, &findex);
+ if (code < 0) {
+ mapname = fontname;
+ pdfi_countup(mapname);
+ code = 0;
+ }
+ }
+ if (pdfi_type_of(mapname) == PDF_NAME || pdfi_type_of(mapname) == PDF_STRING) {
+ pdf_name *mname = (pdf_name *) mapname;
+ if (mname->length + 1 < gp_file_name_sizeof) {
+ memcpy(fontfname, mname->data, mname->length);
+ fontfname[mname->length] = '\0';
+ }
+ else {
+ pdfi_countdown(mapname);
+ pdfi_countdown(fontname);
+ return_error(gs_error_invalidfileaccess);
+ }
}
else {
pdfi_countdown(mapname);
pdfi_countdown(fontname);
return_error(gs_error_invalidfileaccess);
}
- }
- else {
- pdfi_countdown(mapname);
- pdfi_countdown(fontname);
- return_error(gs_error_invalidfileaccess);
- }
- code = pdfi_open_font_file(ctx, fontfname, strlen(fontfname), &s);
+ if (ctx->pdf_substitute_fonts != NULL) {
+ code = pdfi_dict_knownget_type(ctx, ctx->pdf_substitute_fonts, fontfname, PDF_FONT, (pdf_obj **)&pdffont);
+ if (code == 1 && pdffont->filename == NULL) {
+ pdfi_countdown(pdffont);
+ pdffont = NULL;
+ code = 0;
+ }
+ }
+ else
+ code = 0;
+
+ if (code != 1) {
+ code = pdfi_open_font_file(ctx, fontfname, strlen(fontfname), &s);
+ if (code < 0 && f_retry && pdfi_type_of(mapname) == PDF_NAME) {
+ pdfi_countdown(fontname);
+ fontname = mapname;
+ mapname = NULL;
+ f_retry = false;
+ continue;
+ }
+ if (code >= 0) {
+ gs_const_string fname;
+
+ sfilename(s, &fname);
+ if (fname.size < gp_file_name_sizeof) {
+ memcpy(fontfname, fname.data, fname.size);
+ fontfname[fname.size] = '\0';
+ }
+ else {
+ strcpy(fontfname, "unnamed file");
+ }
+ sfseek(s, 0, SEEK_END);
+ buflen = sftell(s);
+ sfseek(s, 0, SEEK_SET);
+ buf = gs_alloc_bytes(ctx->memory, buflen, "pdfi_open_t1_font_file(buf)");
+ if (buf != NULL) {
+ sfread(buf, 1, buflen, s);
+ }
+ else {
+ code = gs_note_error(gs_error_VMerror);
+ }
+ sfclose(s);
+ /* On success, the buffer owership moves to the font object */
+ code = pdfi_load_font_buffer(ctx, buf, buflen, no_type_font, NULL, findex, stream_dict, page_dict, NULL, &pdffont, false);
+ if (code < 0) {
+ gs_free_object(ctx->memory, buf, "pdfi_load_font_file");
+ }
+ else {
+ pdffont->filename = NULL;
+ code = pdfi_object_alloc(ctx, PDF_STRING, strlen(fontfname) , (pdf_obj **)&pdffont->filename);
+ if (code >= 0) {
+ pdfi_countup(pdffont->filename);
+ memcpy(pdffont->filename->data, fontfname, strlen(fontfname));
+ pdffont->filename->length = strlen(fontfname);
+ }
+
+ if (ctx->pdf_substitute_fonts == NULL) {
+ code = pdfi_dict_alloc(ctx, 16, &ctx->pdf_substitute_fonts);
+ if (code >= 0)
+ pdfi_countup(ctx->pdf_substitute_fonts);
+ }
+ if (ctx->pdf_substitute_fonts != NULL) {
+ if (pdfi_type_of(mapname) == PDF_STRING) {
+ pdf_name *n = NULL;
+ pdf_string *mn = (pdf_string *)mapname;
+
+ code = pdfi_name_alloc(ctx, mn->data, mn->length, (pdf_obj **)&n);
+ if (code >= 0) {
+ pdfi_countdown(mapname);
+ mapname = (pdf_obj *)n;
+ pdfi_countup(mapname);
+ code = 0;
+ }
+ }
+ else
+ code = 0;
+
+ if (code == 0)
+ (void)pdfi_dict_put_obj(ctx, ctx->pdf_substitute_fonts, mapname, (pdf_obj *)pdffont, true);
+ code = 0;
+ }
+ }
+ }
+ }
+ break;
+ } while (1);
+
if (code >= 0) {
- gs_const_string fname;
if (basefont) {
- pdfi_print_string(ctx, "Loading font ");
+ pdfi_print_cstring(ctx, "Loading font ");
pdfi_print_font_name(ctx, (pdf_name *)basefont);
- pdfi_print_string(ctx, " (or substitute) from ");
- }
- else {
- pdfi_print_string(ctx, "Loading nameless font from ");
- }
- sfilename(s, &fname);
- if (fname.size < gp_file_name_sizeof) {
- memcpy(fontfname, fname.data, fname.size);
- fontfname[fname.size] = '\0';
- }
- else {
- strcpy(fontfname, "unnamed file");
- }
- pdfi_print_string(ctx, fontfname);
- pdfi_print_string(ctx, "\n");
-
- sfseek(s, 0, SEEK_END);
- *buflen = sftell(s);
- sfseek(s, 0, SEEK_SET);
- *buf = gs_alloc_bytes(ctx->memory, *buflen, "pdfi_open_t1_font_file(buf)");
- if (*buf != NULL) {
- sfread(*buf, 1, *buflen, s);
+ pdfi_print_cstring(ctx, " (or substitute) from ");
}
else {
- code = gs_note_error(gs_error_VMerror);
+ pdfi_print_cstring(ctx, "Loading nameless font from ");
}
- sfclose(s);
+ pdfi_print_font_string(ctx, pdffont->filename);
+ pdfi_print_cstring(ctx, "\n");
+
+ code = pdfi_copy_font(ctx, pdffont, font_dict, &substpdffont);
+ pdfi_countdown(pdffont);
}
+ *ppdffont = substpdffont;
+
pdfi_countdown(basefont);
pdfi_countdown(mapname);
pdfi_countdown(fontname);
return code;
}
-enum {
- font_embedded = 0,
- font_from_file = 1,
- font_substitute = 2
-};
-
int pdfi_load_font(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict, pdf_dict *font_dict, gs_font **ppfont, bool cidfont)
{
int code;
@@ -655,13 +862,19 @@ int pdfi_load_font(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict,
int findex = -1;
code = pdfi_dict_get_type(ctx, font_dict, "Type", PDF_NAME, (pdf_obj **)&Type);
- if (code < 0)
- goto exit;
- if (!pdfi_name_is(Type, "Font")){
- code = gs_note_error(gs_error_typecheck);
- goto exit;
+ if (code < 0) {
+ pdfi_set_error(ctx, 0, NULL, E_PDF_MISSINGTYPE, "pdfi_load_font", NULL);
+ }
+ else {
+ if (!pdfi_name_is(Type, "Font")){
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
+ }
}
code = pdfi_dict_get_type(ctx, font_dict, "Subtype", PDF_NAME, (pdf_obj **)&Subtype);
+ if (code < 0) {
+ pdfi_set_error(ctx, 0, NULL, E_PDF_NO_SUBTYPE, "pdfi_load_font", NULL);
+ }
/* Beyond Type 0 and Type 3, there is no point trusting the Subtype key */
if (code >= 0 && pdfi_name_is(Subtype, "Type0")) {
@@ -682,7 +895,7 @@ int pdfi_load_font(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict,
even if we don't
*/
code = pdfi_dict_get_type(ctx, font_dict, "FontDescriptor", PDF_DICT, (pdf_obj**)&fontdesc);
- if (fontdesc != NULL && fontdesc->type == PDF_DICT) {
+ if (fontdesc != NULL && pdfi_type_of(fontdesc) == PDF_DICT) {
code = pdfi_dict_get_type(ctx, (pdf_dict *) fontdesc, "FontFile", PDF_STREAM, (pdf_obj**)&fontfile);
if (code >= 0)
fftype = type1_font;
@@ -692,7 +905,7 @@ int pdfi_load_font(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict,
}
if (code < 0) {
code = pdfi_dict_get_type(ctx, (pdf_dict *) fontdesc, "FontFile3", PDF_STREAM, (pdf_obj**)&fontfile);
- if (fontfile != NULL) {
+ if (code >= 0 && fontfile != NULL) {
code = pdfi_dict_get_type(ctx, fontfile->stream_dict, "Subtype", PDF_NAME, (pdf_obj **)&ffsubtype);
if (code >= 0) {
if (pdfi_name_is(ffsubtype, "Type1"))
@@ -724,59 +937,27 @@ int pdfi_load_font(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict,
while (1) {
if (fbuf != NULL) {
- /* First, see if we can glean the type from the magic number */
- int sftype = pdfi_fonttype_picker(fbuf, fbuflen);
- if (sftype == no_type_font) {
- if (fftype != no_type_font)
- sftype = fftype;
- else {
- /* If we don't have a Subtype, can't work it out, try Type 1 */
- if (Subtype == NULL || pdfi_name_is(Subtype, "Type1") || pdfi_name_is(Subtype, "MMType1"))
- sftype = type1_font;
- else if (pdfi_name_is(Subtype, "Type1C"))
- sftype = cff_font;
- else if (pdfi_name_is(Subtype, "TrueType"))
- sftype = tt_font;
- }
- }
- /* fbuf ownership passes to the font loader */
- switch (sftype) {
- case type1_font:
- code = pdfi_read_type1_font(ctx, (pdf_dict *)font_dict, stream_dict, page_dict, fbuf, fbuflen, &ppdffont);
- fbuf = NULL;
- break;
- case cff_font:
- code = pdfi_read_cff_font(ctx, (pdf_dict *)font_dict, stream_dict, page_dict, fbuf, fbuflen, cidfont, &ppdffont);
- fbuf = NULL;
- break;
- case tt_font:
- {
- if (cidfont)
- code = pdfi_read_cidtype2_font(ctx, font_dict, stream_dict, page_dict, fbuf, fbuflen, findex, &ppdffont);
- else
- code = pdfi_read_truetype_font(ctx, font_dict, stream_dict, page_dict, fbuf, fbuflen, findex, &ppdffont);
- fbuf = NULL;
- }
- break;
- default:
- code = gs_note_error(gs_error_invalidfont);
- }
+ /* fbuf overship passes to pdfi_load_font_buffer() */
+ code = pdfi_load_font_buffer(ctx, fbuf, fbuflen, fftype, Subtype, findex, stream_dict, page_dict, font_dict, &ppdffont, cidfont);
if (code < 0 && substitute == font_embedded) {
- char obj[129];
- pdfi_print_string(ctx, "**** Warning: cannot process embedded stream for font object ");
- gs_snprintf(obj, 128, "%d %d\n", (int)font_dict->object_num, (int)font_dict->generation_num);
- pdfi_print_string(ctx, obj);
- pdfi_print_string(ctx, "**** Attempting to load a substitute font.\n");
+ if (ctx->args.pdfstoponerror == true) {
+ goto exit;
+ }
+ else {
+ char obj[129];
+ pdfi_print_cstring(ctx, "**** Warning: cannot process embedded stream for font object ");
+ gs_snprintf(obj, 128, "%d %d\n", (int)font_dict->object_num, (int)font_dict->generation_num);
+ pdfi_print_cstring(ctx, obj);
+ pdfi_print_cstring(ctx, "**** Attempting to load a substitute font.\n");
+ }
}
}
+ else {
+ code = gs_error_invalidfont;
+ }
if (code < 0 && code != gs_error_VMerror && substitute == font_embedded) {
- /* Font not embedded, or embedded font not usable - use a substitute */
- if (fbuf != NULL) {
- gs_free_object(ctx->memory, fbuf, "pdfi_load_font(fbuf)");
- }
-
substitute = font_from_file;
if (cidfont == true) {
@@ -790,14 +971,12 @@ int pdfi_load_font(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict,
goto exit;
}
else {
- code = pdfi_open_font_substitute_file(ctx, font_dict, fontdesc, false, &fbuf, &fbuflen, &findex);
+ code = pdfi_load_font_file(ctx, no_type_font, Subtype, stream_dict, page_dict, font_dict, fontdesc, false, &ppdffont);
if (code < 0) {
- code = pdfi_open_font_substitute_file(ctx, font_dict, fontdesc, true, &fbuf, &fbuflen, &findex);
+ code = pdfi_load_font_file(ctx, no_type_font, Subtype, stream_dict, page_dict, font_dict, fontdesc, true, &ppdffont);
substitute |= font_substitute;
}
-
- if (code < 0)
- goto exit;
+ break;
}
continue;
}
@@ -834,17 +1013,18 @@ int pdfi_load_dict_font(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_
gs_font *pfont;
pdf_font *pdfif;
- if (font_dict->type == PDF_FONT) {
- pdfi_countup(font_dict);
- pfont = (gs_font *)((pdf_font *)font_dict)->pfont;
- code = 0;
- }
- else {
- if (font_dict->type != PDF_DICT) {
+ switch (pdfi_type_of(font_dict)) {
+ case PDF_FONT:
+ pdfi_countup(font_dict);
+ pfont = (gs_font *)((pdf_font *)font_dict)->pfont;
+ code = 0;
+ break;
+ case PDF_DICT:
+ code = pdfi_load_font(ctx, stream_dict, page_dict, font_dict, &pfont, false);
+ break;
+ default:
code = gs_note_error(gs_error_typecheck);
goto exit;
- }
- code = pdfi_load_font(ctx, stream_dict, page_dict, font_dict, &pfont, false);
}
if (code < 0)
goto exit;
@@ -869,7 +1049,7 @@ static int pdfi_load_resource_font(pdf_context *ctx, pdf_dict *stream_dict, pdf_
int code;
pdf_dict *font_dict = NULL;
- if (fontname->type != PDF_NAME) {
+ if (pdfi_type_of(fontname) != PDF_NAME) {
/* Passing empty string here should fall back to a default font */
return pdfi_font_set_internal_string(ctx, "", point_size);
}
@@ -922,6 +1102,8 @@ int pdfi_get_cidfont_glyph_metrics(gs_font *pfont, gs_glyph cid, double *widths,
i = 0;
while(1) {
+ pdf_obj_type type;
+
if (i + 1>= W->size) break;
code = pdfi_array_get_type(pdffont->ctx, W, i, PDF_INT, (pdf_obj **)&c);
if (code < 0) goto cleanup;
@@ -929,7 +1111,9 @@ int pdfi_get_cidfont_glyph_metrics(gs_font *pfont, gs_glyph cid, double *widths,
code = pdfi_array_get(pdffont->ctx, W, i + 1, &o);
if (code < 0) goto cleanup;
- if (o->type == PDF_INT) {
+ type = pdfi_type_of(o);
+ if (type == PDF_INT) {
+ double d;
c2 = (pdf_num *)o;
o = NULL;
if (i + 2 >= W->size){
@@ -939,18 +1123,10 @@ int pdfi_get_cidfont_glyph_metrics(gs_font *pfont, gs_glyph cid, double *widths,
break;
}
- code = pdfi_array_get(pdffont->ctx, W, i + 2, (pdf_obj **)&o);
+ code = pdfi_array_get_number(pdffont->ctx, W, i + 2, &d);
if (code < 0) goto cleanup;
- if (o->type != PDF_INT && o->type != PDF_REAL) {
- code = gs_note_error(gs_error_typecheck);
- goto cleanup;
- }
if (cid >= c->value.i && cid <= c2->value.i) {
- if (o->type == PDF_INT)
- widths[GLYPH_W0_WIDTH_INDEX] = (double)((pdf_num *)o)->value.i;
- else
- widths[GLYPH_W0_WIDTH_INDEX] = ((pdf_num *)o)->value.d;
-
+ widths[GLYPH_W0_WIDTH_INDEX] = d;
widths[GLYPH_W0_HEIGHT_INDEX] = 0.0;
/* We countdown and NULL c, c2 and o after exit from the loop
* in order to avoid doing so in the break statements
@@ -961,27 +1137,17 @@ int pdfi_get_cidfont_glyph_metrics(gs_font *pfont, gs_glyph cid, double *widths,
i += 3;
pdfi_countdown(c2);
pdfi_countdown(c);
- pdfi_countdown(o);
c = c2 = NULL;
- o = NULL;
continue;
}
}
- else if (o->type == PDF_ARRAY) {
+ else if (type == PDF_ARRAY) {
pdf_array *a = (pdf_array *)o;
o = NULL;
if (cid >= c->value.i && cid < c->value.i + a->size) {
- code = pdfi_array_get(pdffont->ctx, a, cid - c->value.i, (pdf_obj **)&o);
+ code = pdfi_array_get_number(pdffont->ctx, a, cid - c->value.i, &widths[GLYPH_W0_WIDTH_INDEX]);
if (code >= 0) {
pdfi_countdown(a);
- if (o->type == PDF_INT)
- widths[GLYPH_W0_WIDTH_INDEX] = (double)((pdf_num *)o)->value.i;
- else if (o->type == PDF_REAL)
- widths[GLYPH_W0_WIDTH_INDEX] = ((pdf_num *)o)->value.d;
- else {
- code = gs_note_error(gs_error_typecheck);
- goto cleanup;
- }
widths[GLYPH_W0_HEIGHT_INDEX] = 0.0;
/* We countdown and NULL c, c2 and o on exit from the loop
* in order to avoid doing so in the break statements
@@ -991,8 +1157,6 @@ int pdfi_get_cidfont_glyph_metrics(gs_font *pfont, gs_glyph cid, double *widths,
}
pdfi_countdown(a);
pdfi_countdown(c);
- pdfi_countdown(o);
- o = NULL;
c = NULL;
i += 2;
continue;
@@ -1016,78 +1180,42 @@ int pdfi_get_cidfont_glyph_metrics(gs_font *pfont, gs_glyph cid, double *widths,
widths[GLYPH_W1_V_X_INDEX] = (widths[GLYPH_W0_WIDTH_INDEX] / 2.0);
widths[GLYPH_W1_V_Y_INDEX] = 880.0;
- if (DW2 != NULL && DW2->type == PDF_ARRAY
+ if (DW2 != NULL && pdfi_type_of(DW2) == PDF_ARRAY
&& DW2->size >= 2) {
- pdf_num *w2_0 = NULL, *w2_1 = NULL;
-
- code = pdfi_array_get(pdffont->ctx, (pdf_array *)DW2, 0, (pdf_obj **)&w2_0);
- if (code >= 0 && (w2_0->type == PDF_INT || w2_0->type == PDF_REAL)) {
- code = pdfi_array_get(pdffont->ctx, (pdf_array *)DW2, 1, (pdf_obj **)&w2_1);
- if (code >= 0 && (w2_1->type == PDF_INT || w2_1->type == PDF_REAL)) {
- widths[GLYPH_W1_V_X_INDEX] = widths[GLYPH_W0_WIDTH_INDEX] / 2.0;
- if (w2_0->type == PDF_INT)
- widths[GLYPH_W1_V_Y_INDEX] = (double)w2_0->value.i;
- else
- widths[GLYPH_W1_V_Y_INDEX] = (double)w2_0->value.d;
-
- widths[GLYPH_W1_WIDTH_INDEX] = 0.0;
- if (w2_1->type == PDF_INT)
- widths[GLYPH_W1_HEIGHT_INDEX] = (double)w2_1->value.i;
- else
- widths[GLYPH_W1_HEIGHT_INDEX] = (double)w2_1->value.d;
- }
+ code = pdfi_array_get_number(pdffont->ctx, (pdf_array *)DW2, 0, &widths[GLYPH_W1_V_Y_INDEX]);
+ if (code >= 0)
+ code = pdfi_array_get_number(pdffont->ctx, (pdf_array *)DW2, 1, &widths[GLYPH_W1_HEIGHT_INDEX]);
+ if (code >= 0) {
+ widths[GLYPH_W1_V_X_INDEX] = widths[GLYPH_W0_WIDTH_INDEX] / 2.0;
+ widths[GLYPH_W1_WIDTH_INDEX] = 0.0;
}
- pdfi_countdown(w2_0);
- pdfi_countdown(w2_1);
}
- if (W2 != NULL && W2->type == PDF_ARRAY) {
+ if (W2 != NULL && pdfi_type_of(W2) == PDF_ARRAY) {
i = 0;
while(1) {
+ pdf_obj_type type;
if (i + 1 >= W2->size) break;
(void)pdfi_array_get(pdffont->ctx, W2, i, (pdf_obj **)&c);
- if (c->type != PDF_INT) {
+ if (pdfi_type_of(c) != PDF_INT) {
code = gs_note_error(gs_error_typecheck);
goto cleanup;
}
code = pdfi_array_get(pdffont->ctx, W2, i + 1, (pdf_obj **)&o);
if (code < 0) goto cleanup;
- if (o->type == PDF_INT) {
+ type = pdfi_type_of(o);
+ if (type == PDF_INT) {
if (cid >= c->value.i && cid <= ((pdf_num *)o)->value.i) {
- pdf_num *w1y, *v1x, *v1y;
if (i + 4 >= W2->size) {
/* We countdown and NULL c, and o on exit from the function
* so we don't need to do so in the break statements
*/
break;
}
- (void)pdfi_array_get(pdffont->ctx, W2, i + 1, (pdf_obj **)&w1y);
- (void)pdfi_array_get(pdffont->ctx, W2, i + 1, (pdf_obj **)&v1x);
- (void)pdfi_array_get(pdffont->ctx, W2, i + 1, (pdf_obj **)&v1y);
- if (w1y != NULL && (w1y->type == PDF_INT || w1y->type == PDF_REAL)
- && v1x != NULL && (v1x->type == PDF_INT || v1x->type == PDF_REAL)
- && v1y != NULL && (v1y->type == PDF_INT || v1y->type == PDF_REAL)) {
- widths[GLYPH_W1_WIDTH_INDEX] = 0;
- if (w1y->type == PDF_INT)
- widths[GLYPH_W1_HEIGHT_INDEX] = (double)w1y->value.i;
- else
- widths[GLYPH_W1_HEIGHT_INDEX] = w1y->value.d;
-
- if (v1x->type == PDF_INT)
- widths[GLYPH_W1_V_X_INDEX] = (double)v1x->value.i;
- else
- widths[GLYPH_W1_V_X_INDEX] = v1x->value.d;
-
- if (v1y->type == PDF_INT)
- widths[GLYPH_W1_V_Y_INDEX] = (double)v1y->value.i;
- else
- widths[GLYPH_W1_V_Y_INDEX] = v1y->value.d;
- }
- else
- code = gs_note_error(gs_error_typecheck);
-
- pdfi_countdown(w1y);
- pdfi_countdown(v1x);
- pdfi_countdown(v1y);
+ code = pdfi_array_get_number(pdffont->ctx, W2, i + 1, &widths[GLYPH_W1_HEIGHT_INDEX]);
+ if (code < 0) goto cleanup;
+ code = pdfi_array_get_number(pdffont->ctx, W2, i + 1, &widths[GLYPH_W1_V_X_INDEX]);
+ if (code < 0) goto cleanup;
+ code = pdfi_array_get_number(pdffont->ctx, W2, i + 1, &widths[GLYPH_W1_V_Y_INDEX]);
if (code < 0) goto cleanup;
/* We countdown and NULL c, and o on exit from the function
* so we don't need to do so in the break statements
@@ -1096,43 +1224,26 @@ int pdfi_get_cidfont_glyph_metrics(gs_font *pfont, gs_glyph cid, double *widths,
}
i += 5;
}
- else if (o->type == PDF_ARRAY) {
+ else if (type == PDF_ARRAY) {
pdf_array *a = (pdf_array *)o;
int l = a->size - (a->size % 3);
o = NULL;
if (cid >= c->value.i && cid < c->value.i + (l / 3)) {
- pdf_num *w1y = NULL, *v1x = NULL, *v1y = NULL;
int index = (cid - c->value.i) * 3;
- (void)pdfi_array_get(pdffont->ctx, a, index, (pdf_obj **)&w1y);
- (void)pdfi_array_get(pdffont->ctx, a, index + 1, (pdf_obj **)&v1x);
- (void)pdfi_array_get(pdffont->ctx, a, index + 2, (pdf_obj **)&v1y);
- pdfi_countdown(a);
-
- if (w1y != NULL && (w1y->type == PDF_INT || w1y->type == PDF_REAL)
- && v1x != NULL && (v1x->type == PDF_INT || v1x->type == PDF_REAL)
- && v1y != NULL && (v1y->type == PDF_INT || v1y->type == PDF_REAL)) {
- widths[GLYPH_W1_WIDTH_INDEX] = 0.0;
- if (w1y->type == PDF_INT)
- widths[GLYPH_W1_HEIGHT_INDEX] = (double)w1y->value.i;
- else
- widths[GLYPH_W1_HEIGHT_INDEX] = w1y->value.d;
-
- if (v1x->type == PDF_INT)
- widths[GLYPH_W1_V_X_INDEX] = (double)v1x->value.i;
- else
- widths[GLYPH_W1_V_X_INDEX] = v1x->value.d;
-
- if (v1y->type == PDF_INT)
- widths[GLYPH_W1_V_Y_INDEX] = (double)v1y->value.i;
- else
- widths[GLYPH_W1_V_Y_INDEX] = v1y->value.d;
+ code = pdfi_array_get_number(pdffont->ctx, a, index, &widths[GLYPH_W1_HEIGHT_INDEX]);
+ if (code < 0) {
+ pdfi_countdown(a);
+ goto cleanup;
}
- else
- code = gs_note_error(gs_error_typecheck);
- pdfi_countdown(w1y);
- pdfi_countdown(v1x);
- pdfi_countdown(v1y);
+ code = pdfi_array_get_number(pdffont->ctx, a, index + 1, &widths[GLYPH_W1_V_X_INDEX]);
+ if (code < 0) {
+ pdfi_countdown(a);
+ goto cleanup;
+ }
+ code = pdfi_array_get_number(pdffont->ctx, a, index + 2, &widths[GLYPH_W1_V_Y_INDEX]);
+ pdfi_countdown(a);
if (code < 0) goto cleanup;
+
/* We countdown and NULL c, and o on exit from the function
* so we don't need to do so in the break statements
*/
@@ -1176,11 +1287,11 @@ int pdfi_d0(pdf_context *ctx)
goto d0_error;
}
- if (ctx->stack_top[-1]->type != PDF_INT && ctx->stack_top[-1]->type != PDF_REAL) {
+ if (pdfi_type_of(ctx->stack_top[-1]) != PDF_INT && pdfi_type_of(ctx->stack_top[-1]) != PDF_REAL) {
code = gs_note_error(gs_error_typecheck);
goto d0_error;
}
- if (ctx->stack_top[-2]->type != PDF_INT && ctx->stack_top[-2]->type != PDF_REAL) {
+ if (pdfi_type_of(ctx->stack_top[-2]) != PDF_INT && pdfi_type_of(ctx->stack_top[-2]) != PDF_REAL) {
code = gs_note_error(gs_error_typecheck);
goto d0_error;
}
@@ -1189,11 +1300,11 @@ int pdfi_d0(pdf_context *ctx)
goto d0_error;
}
- if (ctx->stack_top[-1]->type == PDF_INT)
+ if (pdfi_type_of(ctx->stack_top[-1]) == PDF_INT)
width[0] = (double)((pdf_num *)ctx->stack_top[-1])->value.i;
else
width[0] = ((pdf_num *)ctx->stack_top[-1])->value.d;
- if (ctx->stack_top[-2]->type == PDF_INT)
+ if (pdfi_type_of(ctx->stack_top[-2]) == PDF_INT)
width[1] = (double)((pdf_num *)ctx->stack_top[-1])->value.i;
else
width[1] = ((pdf_num *)ctx->stack_top[-1])->value.d;
@@ -1245,7 +1356,7 @@ d0_error:
int pdfi_d1(pdf_context *ctx)
{
- int code = 0, i, gsave_level;
+ int code = 0, gsave_level;
double wbox[6];
if (ctx->text.inside_CharProc == false)
@@ -1253,21 +1364,9 @@ int pdfi_d1(pdf_context *ctx)
ctx->text.CharProc_d_type = pdf_type3_d1;
- if (pdfi_count_stack(ctx) < 6) {
- code = gs_note_error(gs_error_stackunderflow);
+ code = pdfi_destack_reals(ctx, wbox, 6);
+ if (code < 0)
goto d1_error;
- }
-
- for (i=-6;i < 0;i++) {
- if (ctx->stack_top[i]->type != PDF_INT && ctx->stack_top[i]->type != PDF_REAL) {
- code = gs_note_error(gs_error_typecheck);
- goto d1_error;
- }
- if (ctx->stack_top[i]->type == PDF_INT)
- wbox[i + 6] = (double)((pdf_num *)ctx->stack_top[i])->value.i;
- else
- wbox[i + 6] = ((pdf_num *)ctx->stack_top[i])->value.d;
- }
/*
* We don't intend to retain this, instead we will use (effectively) xyshow to apply
@@ -1291,7 +1390,6 @@ int pdfi_d1(pdf_context *ctx)
if (code < 0)
goto d1_error;
- pdfi_pop(ctx, 6);
return 0;
d1_error:
@@ -1319,16 +1417,9 @@ int pdfi_Tf(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
pdfi_pop(ctx, 2);
/* Get the point_size */
- if (point_arg->type == PDF_INT)
- point_size = (double)((pdf_num *)point_arg)->value.i;
- else {
- if (point_arg->type == PDF_REAL)
- point_size = ((pdf_num *)point_arg)->value.d;
- else {
- code = gs_note_error(gs_error_typecheck);
- goto exit0;
- }
- }
+ code = pdfi_obj_to_real(ctx, point_arg, &point_size);
+ if (code < 0)
+ goto exit0;
code = pdfi_load_resource_font(ctx, stream_dict, page_dict, fontname, point_size);
@@ -1378,7 +1469,7 @@ int pdfi_free_font(pdf_obj *font)
static inline int pdfi_encoding_name_to_index(pdf_name *name)
{
int ind = gs_error_undefined;
- if (name->type == PDF_NAME) {
+ if (pdfi_type_of(name) == PDF_NAME) {
if (pdfi_name_is(name, "StandardEncoding")) {
ind = ENCODING_INDEX_STANDARD;
} else {
@@ -1452,21 +1543,23 @@ int pdfi_create_Encoding(pdf_context *ctx, pdf_obj *pdf_Encoding, pdf_obj *font_
return code;
pdfi_countup(*Encoding);
- if (pdf_Encoding->type == PDF_NAME) {
- code = pdfi_build_Encoding(ctx, (pdf_name *)pdf_Encoding, (pdf_array *)*Encoding);
- if (code < 0) {
- pdfi_countdown(*Encoding);
- *Encoding = NULL;
- return code;
- }
- } else {
- if (pdf_Encoding->type == PDF_DICT) {
+ switch (pdfi_type_of(pdf_Encoding)) {
+ case PDF_NAME:
+ code = pdfi_build_Encoding(ctx, (pdf_name *)pdf_Encoding, (pdf_array *)*Encoding);
+ if (code < 0) {
+ pdfi_countdown(*Encoding);
+ *Encoding = NULL;
+ return code;
+ }
+ break;
+ case PDF_DICT:
+ {
pdf_name *n = NULL;
pdf_array *a = NULL;
pdf_obj *o = NULL;
int offset = 0;
- if (font_Encoding != NULL && font_Encoding->type == PDF_ARRAY) {
+ if (font_Encoding != NULL && pdfi_type_of(font_Encoding) == PDF_ARRAY) {
pdf_array *fenc = (pdf_array *)font_Encoding;
for (i = 0; i < pdfi_array_size(fenc) && code >= 0; i++) {
code = pdfi_array_get(ctx, fenc, (uint64_t)i, &o);
@@ -1523,25 +1616,25 @@ int pdfi_create_Encoding(pdf_context *ctx, pdf_obj *pdf_Encoding, pdf_obj *font_
}
for (i=0;i < pdfi_array_size(a);i++) {
+ pdf_obj_type type;
code = pdfi_array_get(ctx, a, (uint64_t)i, &o);
if (code < 0)
break;
- if (o->type == PDF_NAME) {
+ type = pdfi_type_of(o);
+ if (type == PDF_NAME) {
if (offset < pdfi_array_size((pdf_array *)*Encoding))
code = pdfi_array_put(ctx, (pdf_array *)*Encoding, (uint64_t)offset, o);
pdfi_countdown(o);
offset++;
if (code < 0)
break;
+ } else if (type == PDF_INT) {
+ offset = ((pdf_num *)o)->value.i;
+ pdfi_countdown(o);
} else {
- if (o->type == PDF_INT) {
- offset = ((pdf_num *)o)->value.i;
- pdfi_countdown(o);
- } else {
- code = gs_note_error(gs_error_typecheck);
- pdfi_countdown(o);
- break;
- }
+ code = gs_note_error(gs_error_typecheck);
+ pdfi_countdown(o);
+ break;
}
}
pdfi_countdown(a);
@@ -1550,11 +1643,12 @@ int pdfi_create_Encoding(pdf_context *ctx, pdf_obj *pdf_Encoding, pdf_obj *font_
*Encoding = NULL;
return code;
}
- } else {
+ break;
+ }
+ default:
pdfi_countdown(*Encoding);
*Encoding = NULL;
return gs_note_error(gs_error_typecheck);
- }
}
return 0;
}
@@ -1575,6 +1669,10 @@ gs_glyph pdfi_encode_char(gs_font * pfont, gs_char chr, gs_glyph_space_t not_use
pdf_name *GlyphName = NULL;
code = pdfi_array_get(ctx, font->Encoding, (uint64_t)chr, (pdf_obj **)&GlyphName);
if (code >= 0) {
+ if (pdfi_type_of(GlyphName) != PDF_NAME)
+ /* Can't signal an error, just return the 'not found' case */
+ return g;
+
code = (*ctx->get_glyph_index)(pfont, (byte *)GlyphName->data, GlyphName->length, &nindex);
pdfi_countdown(GlyphName);
if (code >= 0)
@@ -1595,9 +1693,9 @@ int pdfi_tounicode_char_to_unicode(pdf_context *ctx, pdf_cmap *tounicode, gs_gly
if (tounicode != NULL) {
gs_cmap_lookups_enum_t lenum;
gs_cmap_lookups_enum_init((const gs_cmap_t *)tounicode->gscmap, 0, &lenum);
- while (l == 0 && (code = gs_cmap_enum_next_lookup(ctx->memory, &lenum)) == 0) {
+ while (l == 0 && gs_cmap_enum_next_lookup(ctx->memory, &lenum) == 0) {
gs_cmap_lookups_enum_t counter = lenum;
- while (l == 0 && (code = gs_cmap_enum_next_entry(&counter) == 0)) {
+ while (l == 0 && gs_cmap_enum_next_entry(&counter) == 0) {
if (counter.entry.value_type == CODE_VALUE_CID) {
unsigned int v = 0;
for (i = 0; i < counter.entry.key_size; i++) {
@@ -1704,6 +1802,62 @@ static int pdfi_global_glyph_code(const gs_font *pfont, gs_const_string *gstr, g
return code;
}
+int pdfi_map_glyph_name_via_agl(pdf_dict *cstrings, pdf_name *gname, pdf_string **cstring)
+{
+ single_glyph_list_t *sgl = (single_glyph_list_t *)&(SingleGlyphList);
+ int i, code, ucode = gs_error_undefined;
+ *cstring = NULL;
+
+ if (gname->length == 7 && strncmp((char *)gname->data, "uni", 3) == 0) {
+ char u[5] = {0};
+ memcpy(u, gname->data + 3, 4);
+ code = sscanf(u, "%x", &ucode);
+ if (code <= 0)
+ ucode = gs_error_undefined;
+ }
+
+ if (ucode == gs_error_undefined) {
+ for (i = 0; sgl[i].Glyph != 0x00; i++) {
+ if (sgl[i].Glyph[0] == gname->data[0]
+ && strlen(sgl[i].Glyph) == gname->length
+ && !strncmp((char *)sgl[i].Glyph, (char *)gname->data, gname->length)) {
+ ucode = (int)sgl[i].Unicode;
+ break;
+ }
+ }
+ }
+ if (ucode > 0) {
+ for (i = 0; sgl[i].Glyph != 0x00; i++) {
+ if (sgl[i].Unicode == (unsigned short)ucode) {
+ pdf_string *s;
+ code = pdfi_dict_get((pdf_context *)cstrings->ctx, cstrings, (char *)sgl[i].Glyph, (pdf_obj **)&s);
+ if (code >= 0) {
+ *cstring = s;
+ break;
+ }
+ }
+ }
+ if (*cstring == NULL) {
+ char u[16] = {0};
+ code = gs_snprintf(u, 16, "uni%04x", ucode);
+ if (code > 0) {
+ pdf_string *s;
+ code = pdfi_dict_get((pdf_context *)cstrings->ctx, cstrings, u, (pdf_obj **)&s);
+ if (code >= 0) {
+ *cstring = s;
+ }
+ }
+ }
+ }
+
+ if (*cstring == NULL)
+ code = gs_note_error(gs_error_undefined);
+ else
+ code = 0;
+
+ return code;
+}
+
int pdfi_init_font_directory(pdf_context *ctx)
{
ctx->font_dir = gs_font_dir_alloc2(ctx->memory, ctx->memory);
@@ -1763,6 +1917,95 @@ int pdfi_load_font_by_name_string(pdf_context *ctx, const byte *fontname, size_t
return code;
}
+
+int pdfi_font_create_widths(pdf_context *ctx, pdf_dict *fontdict, pdf_font *font, double scale)
+{
+ int code = 0;
+ pdf_obj *obj = NULL;
+ int i;
+
+ font->Widths = NULL;
+
+ if (font->FontDescriptor != NULL) {
+ code = pdfi_dict_knownget(ctx, font->FontDescriptor, "MissingWidth", &obj);
+ if (code > 0) {
+ if (pdfi_type_of(obj) == PDF_INT) {
+ font->MissingWidth = ((pdf_num *) obj)->value.i * scale;
+ }
+ else if (pdfi_type_of(obj) == PDF_REAL) {
+ font->MissingWidth = ((pdf_num *) obj)->value.d * scale;
+ }
+ else {
+ font->MissingWidth = 0;
+ }
+ pdfi_countdown(obj);
+ obj = NULL;
+ }
+ else {
+ font->MissingWidth = 0;
+ }
+ }
+ else {
+ font->MissingWidth = 1000.0 * scale;
+ }
+
+ code = pdfi_dict_knownget_type(ctx, fontdict, "Widths", PDF_ARRAY, (pdf_obj **)&obj);
+ if (code > 0) {
+ if (pdfi_array_size((pdf_array *)obj) < font->LastChar - font->FirstChar + 1) {
+ code = gs_note_error(gs_error_rangecheck);
+ goto error;
+ }
+
+ font->Widths = (double *)gs_alloc_bytes(OBJ_MEMORY(font), sizeof(double) * (font->LastChar - font->FirstChar + 1), "pdfi_font_create_widths(Widths)");
+ if (font->Widths == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error;
+ }
+ memset(font->Widths, 0x00, sizeof(double) * (font->LastChar - font->FirstChar + 1));
+ for (i = 0; i < (font->LastChar - font->FirstChar + 1); i++) {
+ code = pdfi_array_get_number(ctx, (pdf_array *)obj, (uint64_t)i, &font->Widths[i]);
+ if (code < 0)
+ goto error;
+ font->Widths[i] *= scale;
+ }
+ }
+error:
+ pdfi_countdown(obj);
+ if (code < 0) {
+ gs_free_object(OBJ_MEMORY(font), font->Widths, "pdfi_font_create_widths(Widths)");
+ font->Widths = NULL;
+ }
+ return code;
+}
+
+void pdfi_font_set_first_last_char(pdf_context *ctx, pdf_dict *fontdict, pdf_font *font)
+{
+ double f, l;
+ int code;
+
+ if (fontdict == NULL) {
+ f = (double)0;
+ l = (double)255;
+ }
+ else {
+ code = pdfi_dict_get_number(ctx, fontdict, "FirstChar", &f);
+ if (code < 0 || f < 0 || f > 255)
+ f = (double)0;
+
+ code = pdfi_dict_get_number(ctx, fontdict, "LastChar", &l);
+ if (code < 0 || l < 0 || l > 255)
+ l = (double)255;
+ }
+ if (f <= l) {
+ font->FirstChar = f;
+ font->LastChar = l;
+ }
+ else {
+ font->FirstChar = 0;
+ font->LastChar = 255;
+ }
+}
+
/* Patch or create a new XUID based on the existing UID/XUID, a simple hash
of the input file name and the font dictionary object number.
This allows improved glyph cache efficiency, also ensures pdfwrite understands
@@ -1776,10 +2019,10 @@ int pdfi_font_generate_pseudo_XUID(pdf_context *ctx, pdf_dict *fontdict, gs_font
int i;
uint32_t hash = 0;
long *xvalues;
- int xuidlen = 2;
+ int xuidlen = 3;
sfilename(ctx->main_stream->s, &fn);
- if (fn.size > 0 && fontdict->object_num != 0) {
+ if (fn.size > 0 && fontdict!= NULL && fontdict->object_num != 0) {
for (i = 0; i < fn.size; i++) {
hash = ((((hash & 0xf8000000) >> 27) ^ (hash << 5)) & 0x7ffffffff) ^ fn.data[i];
}
@@ -1795,14 +2038,17 @@ int pdfi_font_generate_pseudo_XUID(pdf_context *ctx, pdf_dict *fontdict, gs_font
}
xvalues[0] = 1000000; /* "Private" value */
xvalues[1] = hash;
+
+ xvalues[2] = ctx->device_state.HighLevelDevice ? pfont->id : 0;
+
if (uid_is_XUID(&pfont->UID)) {
for (i = 0; i < uid_XUID_size(&pfont->UID); i++) {
- xvalues[i + 2] = uid_XUID_values(&pfont->UID)[i];
+ xvalues[i + 3] = uid_XUID_values(&pfont->UID)[i];
}
uid_free(&pfont->UID, pfont->memory, "pdfi_font_generate_pseudo_XUID");
}
else if (uid_is_valid(&pfont->UID))
- xvalues[2] = pfont->UID.id;
+ xvalues[3] = pfont->UID.id;
uid_set_XUID(&pfont->UID, xvalues, xuidlen);
}
@@ -1817,7 +2063,7 @@ int pdfi_set_font_internal(pdf_context *ctx, pdf_obj *fontobj, double point_size
int code;
pdf_font *pdffont = (pdf_font *)fontobj;
- if (pdffont->type != PDF_FONT || pdffont->pfont == NULL)
+ if (pdfi_type_of(pdffont) != PDF_FONT || pdffont->pfont == NULL)
return_error(gs_error_invalidfont);
code = gs_setPDFfontsize(ctx->pgs, point_size);
@@ -1854,7 +2100,7 @@ int pdfi_font_set_internal_string(pdf_context *ctx, const char *fontname, double
int pdfi_font_set_internal_name(pdf_context *ctx, pdf_name *fontname, double point_size)
{
- if (fontname->type != PDF_NAME)
+ if (pdfi_type_of(fontname) != PDF_NAME)
return_error(gs_error_typecheck);
else
return pdfi_font_set_internal_inner(ctx, fontname->data, fontname->length, point_size);
diff --git a/pdf/pdf_font.h b/pdf/pdf_font.h
index da76aeb8..a18541c6 100644
--- a/pdf/pdf_font.h
+++ b/pdf/pdf_font.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018-2021 Artifex Software, Inc.
+/* Copyright (C) 2018-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -57,6 +57,7 @@ static inline pdf_font *pdfi_get_current_pdf_font(pdf_context *ctx)
return NULL;
}
+int pdfi_create_Widths(pdf_context *ctx, pdf_dict *font_dict, pdf_font *pdffont);
int pdfi_create_Encoding(pdf_context *ctx, pdf_obj *pdf_Encoding, pdf_obj *font_Encoding, pdf_obj **Encoding);
gs_glyph pdfi_encode_char(gs_font * pfont, gs_char chr, gs_glyph_space_t not_used);
int pdfi_glyph_index(gs_font *pfont, byte *str, uint size, uint *glyph);
@@ -72,6 +73,8 @@ int pdfi_fapi_passfont(pdf_font *font, int subfont, char *fapi_request,
int pdfi_fapi_check_cmap_for_GID(gs_font *pfont, uint c, uint *g);
+int pdfi_map_glyph_name_via_agl(pdf_dict *cstrings, pdf_name *gname, pdf_string **cstring);
+
int pdfi_init_font_directory(pdf_context *ctx);
int pdfi_load_font(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict, pdf_dict *font_dict, gs_font **ppfont, bool cidfont);
@@ -103,5 +106,7 @@ enum {
};
int pdfi_get_cidfont_glyph_metrics(gs_font *pfont, gs_glyph cid, double *widths, bool vertical);
+int pdfi_font_create_widths(pdf_context *ctx, pdf_dict *fontdict, pdf_font *font, double wscale);
+void pdfi_font_set_first_last_char(pdf_context *ctx, pdf_dict *fontdict, pdf_font *font);
int pdfi_font_generate_pseudo_XUID(pdf_context *ctx, pdf_dict *fontdict, gs_font_base *pfont);
#endif
diff --git a/pdf/pdf_font0.c b/pdf/pdf_font0.c
index a322bfb4..76a94c8a 100644
--- a/pdf/pdf_font0.c
+++ b/pdf/pdf_font0.c
@@ -64,9 +64,21 @@ static void pdfi_font0_cid_subst_tables(const char *reg, const int reglen, const
}
static int
-pdfi_font0_glyph_name(gs_font *font, gs_glyph index, gs_const_string *pstr)
+pdfi_font0_glyph_name(gs_font *pfont, gs_glyph index, gs_const_string *pstr)
{
- return_error(gs_error_rangecheck);
+ int code;
+ pdf_font_type0 *pt0font = (pdf_font_type0 *)pfont->client_data;
+ char gnm[64];
+ pdf_context *ctx = pt0font->ctx;
+ uint gindex = 0;
+
+ gs_snprintf(gnm, 64, "%lu", (long)index);
+ code = (*ctx->get_glyph_index)((gs_font *)pfont, (byte *)gnm, strlen(gnm), &gindex);
+ if (code < 0)
+ return code;
+ code = (*ctx->get_glyph_name)(pfont, (gs_glyph)gindex, (gs_const_string *)pstr);
+
+ return code;
}
static int
@@ -80,7 +92,7 @@ pdfi_font0_map_glyph_to_unicode(gs_font *font, gs_glyph glyph, int ch, ushort *u
pdfi_cid_subst_nwp_table_t *substnwp = pt0font->substnwp;
code = pdfi_array_get(pt0font->ctx, pt0font->DescendantFonts, 0, (pdf_obj **)&decfont);
- if (code < 0 || decfont->type != PDF_FONT) {
+ if (code < 0 || pdfi_type_of(decfont) != PDF_FONT) {
pdfi_countdown(decfont);
return gs_error_undefined;
}
@@ -189,7 +201,7 @@ int pdfi_read_type0_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream
code = pdfi_dict_get(ctx, font_dict, "Encoding", &cmap);
if (code < 0) goto error;
- if (cmap->type == PDF_CMAP) {
+ if (pdfi_type_of(cmap) == PDF_CMAP) {
pcmap = (pdf_cmap *)cmap;
cmap = NULL;
}
@@ -203,7 +215,7 @@ int pdfi_read_type0_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream
code = pdfi_dict_get(ctx, font_dict, "DescendantFonts", (pdf_obj **)&arr);
if (code < 0) goto error;
- if (arr->type != PDF_ARRAY || arr->size != 1) {
+ if (pdfi_type_of(arr) != PDF_ARRAY || arr->size != 1) {
code = gs_note_error(gs_error_invalidfont);
goto error;
}
@@ -211,31 +223,32 @@ int pdfi_read_type0_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream
pdfi_countdown(arr);
arr = NULL;
if (code < 0) goto error;
- if (decfontdict->type == PDF_FONT) {
- descpfont = (pdf_font *)decfontdict;
- decfontdict = descpfont->PDF_font;
- pdfi_countup(decfontdict);
- }
- else {
- if (decfontdict->type != PDF_DICT) {
- code = gs_note_error(gs_error_invalidfont);
- goto error;
- }
- code = pdfi_dict_get(ctx, (pdf_dict *)decfontdict, "Type", (pdf_obj **)&n);
- if (code < 0) goto error;
- if (n->type != PDF_NAME || n->length != 4 || memcmp(n->data, "Font", 4) != 0) {
+ switch (pdfi_type_of(decfontdict)) {
+ case PDF_FONT:
+ descpfont = (pdf_font *)decfontdict;
+ decfontdict = descpfont->PDF_font;
+ pdfi_countup(decfontdict);
+ break;
+ case PDF_DICT:
+ code = pdfi_dict_get(ctx, (pdf_dict *)decfontdict, "Type", (pdf_obj **)&n);
+ if (code < 0) goto error;
+ if (pdfi_type_of(n) != PDF_NAME || n->length != 4 || memcmp(n->data, "Font", 4) != 0) {
+ pdfi_countdown(n);
+ code = gs_note_error(gs_error_invalidfont);
+ goto error;
+ }
pdfi_countdown(n);
+ break;
+ default:
code = gs_note_error(gs_error_invalidfont);
goto error;
- }
- pdfi_countdown(n);
}
#if 0
code = pdfi_dict_get(ctx, (pdf_dict *)decfontdict, "Subtype", (pdf_obj **)&n);
if (code < 0)
goto error;
- if (n->type != PDF_NAME || n->length != 12 || memcmp(n->data, "CIDFontType", 11) != 0) {
+ if (pdfi_type_of(n) != PDF_NAME || n->length != 12 || memcmp(n->data, "CIDFontType", 11) != 0) {
pdfi_countdown(n);
code = gs_note_error(gs_error_invalidfont);
goto error;
@@ -255,13 +268,13 @@ int pdfi_read_type0_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream
if (ctx->args.ignoretounicode != true) {
code = pdfi_dict_get(ctx, font_dict, "ToUnicode", (pdf_obj **)&tounicode);
- if (code >= 0 && tounicode->type == PDF_STREAM) {
+ if (code >= 0 && pdfi_type_of(tounicode) == PDF_STREAM) {
pdf_cmap *tu = NULL;
code = pdfi_read_cmap(ctx, tounicode, &tu);
pdfi_countdown(tounicode);
tounicode = (pdf_obj *)tu;
}
- if (code < 0 || (tounicode != NULL && tounicode->type != PDF_CMAP)) {
+ if (code < 0 || (tounicode != NULL && pdfi_type_of(tounicode) != PDF_CMAP)) {
pdfi_countdown(tounicode);
tounicode = NULL;
code = 0;
@@ -295,8 +308,8 @@ int pdfi_read_type0_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream
if (code >= 0) {
(void)pdfi_dict_get(ctx, (pdf_dict *)csi, "Registry", (pdf_obj **)&reg);
(void)pdfi_dict_get(ctx, (pdf_dict *)csi, "Ordering", (pdf_obj **)&ord);
- if (reg != NULL && reg->type == PDF_STRING
- && ord != NULL && ord->type == PDF_STRING) {
+ if (reg != NULL && pdfi_type_of(reg) == PDF_STRING
+ && ord != NULL && pdfi_type_of(ord) == PDF_STRING) {
r = (char *)reg->data;
rlen = reg->length;
o = (char *)ord->data;
@@ -352,6 +365,7 @@ int pdfi_read_type0_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream
dmprintf2(ctx->memory, "Allocated object of type %c with UID %"PRIi64"\n", pdft0->type, pdft0->UID);
#endif
pdft0->refcnt = 1;
+ pdft0->filename = NULL;
pdft0->object_num = font_dict->object_num;
pdft0->generation_num = font_dict->generation_num;
pdft0->indirect_num = font_dict->indirect_num;
@@ -524,6 +538,8 @@ pdfi_free_font_type0(pdf_obj *font)
pdfi_countdown(pdft0->Encoding);
pdfi_countdown(pdft0->DescendantFonts);
pdfi_countdown(pdft0->ToUnicode);
+ pdfi_countdown(pdft0->filename);
+
gs_free_object(OBJ_MEMORY(pdft0), pfont0->data.Encoding, "pdfi_free_font_type0(data.Encoding)");
/* We shouldn't need to free the fonts in the FDepVector, that should happen
with DescendantFonts above.
diff --git a/pdf/pdf_font1.c b/pdf/pdf_font1.c
index 87ba858b..b350f449 100644
--- a/pdf/pdf_font1.c
+++ b/pdf/pdf_font1.c
@@ -117,6 +117,9 @@ pdfi_t1_glyph_data(gs_font_type1 *pfont, gs_glyph glyph, gs_glyph_data_t *pgd)
if (code >= 0) {
code = pdfi_dict_get_by_key(ctx, pdffont1->CharStrings, glyphname, (pdf_obj **)&charstring);
+ if (code < 0) {
+ code = pdfi_map_glyph_name_via_agl(pdffont1->CharStrings, glyphname, &charstring);
+ }
if (code >= 0)
gs_glyph_data_from_bytes(pgd, charstring->data, 0, charstring->length, NULL);
}
@@ -132,11 +135,17 @@ pdfi_t1_subr_data(gs_font_type1 *pfont, int index, bool global, gs_glyph_data_t
int code = 0;
pdf_font_type1 *pdffont1 = (pdf_font_type1 *) pfont->client_data;
- if (global == true || index < 0 || index >= pdffont1->NumSubrs) {
+ if (global == true || index < 0 || index >= (pdffont1->Subrs == NULL ? 0 : pdfi_array_size(pdffont1->Subrs))) {
code = gs_note_error(gs_error_rangecheck);
}
else {
- gs_glyph_data_from_bytes(pgd, pdffont1->Subrs[index].data, 0, pdffont1->Subrs[index].size, NULL);
+ pdf_string *subr_str = NULL;
+ code = pdfi_array_get_type(pdffont1->ctx, pdffont1->Subrs, index, PDF_STRING, (pdf_obj **)&subr_str);
+ if (code >= 0) {
+ gs_glyph_data_from_bytes(pgd, subr_str->data, 0, subr_str->length, NULL);
+ }
+ /* decrementing is safe here, because the reference in the pdffont1->Subrs will persist */
+ pdfi_countdown(subr_str);
}
return code;
}
@@ -168,11 +177,13 @@ pdfi_t1_seac_data(gs_font_type1 *pfont, int ccode, gs_glyph *pglyph, gs_const_st
pdfi_countup(glyphname);
code = pdfi_dict_get_by_key(ctx, pdffont1->CharStrings, glyphname, (pdf_obj **)&charstring);
pdfi_countdown(glyphname);
- if (code >= 0)
- if (pgd != NULL)
+ if (code >= 0) {
+ if (pgd != NULL) {
gs_glyph_data_from_bytes(pgd, charstring->data, 0, charstring->length, NULL);
+ }
pdfi_countdown(charstring);
}
+ }
}
return code;
@@ -368,7 +379,7 @@ pdfi_t1_decode_pfb(pdf_context *ctx, byte *inbuf, int inlen, byte **outbuf, int
*outbuf = NULL;
*outlen = 0;
- strm = push_pfb_filter(ctx->memory, inbuf, inbuf + inlen + 1);
+ strm = push_pfb_filter(ctx->memory, inbuf, inbuf + inlen);
if (strm == NULL) {
code = gs_note_error(gs_error_VMerror);
}
@@ -386,7 +397,7 @@ pdfi_t1_decode_pfb(pdf_context *ctx, byte *inbuf, int inlen, byte **outbuf, int
}
else {
d = decodebuf;
- strm = push_pfb_filter(ctx->memory, inbuf, inbuf + inlen + 1);
+ strm = push_pfb_filter(ctx->memory, inbuf, inbuf + inlen);
while (1) {
c = sgetc(strm);
if (c < 0)
@@ -501,6 +512,7 @@ int
pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict, pdf_dict *page_dict, byte *fbuf, int64_t fbuflen, pdf_font **ppdffont)
{
int code = 0;
+ double x_scale;
pdf_obj *fontdesc = NULL;
pdf_obj *basefont = NULL;
pdf_obj *mapname = NULL;
@@ -508,8 +520,10 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
pdf_font_type1 *t1f = NULL;
pdf_obj *tounicode = NULL;
ps_font_interp_private fpriv = { 0 };
+ bool key_known;
- (void)pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, &fontdesc);
+ if (font_dict != NULL)
+ (void)pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, &fontdesc);
if (fbuf[0] == 128 && fbuf[1] == 1) {
byte *decodebuf = NULL;
@@ -530,12 +544,12 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
gs_free_object(ctx->memory, fbuf, "pdfi_read_type1_font");
/* If we have a full CharStrings dictionary, we probably have enough to make a font */
- if (code < 0 || (fpriv.u.t1.CharStrings == NULL || fpriv.u.t1.CharStrings->type != PDF_DICT
- || fpriv.u.t1.CharStrings->entries == 0)) {
+ if (code < 0 || fpriv.u.t1.CharStrings == NULL || pdfi_type_of(fpriv.u.t1.CharStrings) != PDF_DICT
+ || fpriv.u.t1.CharStrings->entries == 0) {
code = gs_note_error(gs_error_invalidfont);
goto error;
}
- code = pdfi_alloc_t1_font(ctx, &t1f, font_dict->object_num);
+ code = pdfi_alloc_t1_font(ctx, &t1f, font_dict != NULL ? font_dict->object_num : 0);
if (code >= 0) {
gs_font_type1 *pfont1 = (gs_font_type1 *) t1f->pfont;
@@ -555,22 +569,26 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
pfont1->PaintType = fpriv.gsu.gst1.PaintType;
pfont1->StrokeWidth = fpriv.gsu.gst1.StrokeWidth;
- t1f->object_num = font_dict->object_num;
- t1f->generation_num = font_dict->generation_num;
- t1f->indirect_num = font_dict->indirect_num;
- t1f->indirect_gen = font_dict->indirect_gen;
+ if (font_dict != NULL) {
+ t1f->object_num = font_dict->object_num;
+ t1f->generation_num = font_dict->generation_num;
+ t1f->indirect_num = font_dict->indirect_num;
+ t1f->indirect_gen = font_dict->indirect_gen;
+ }
t1f->PDF_font = font_dict;
pdfi_countup(font_dict);
- t1f->BaseFont = basefont;
- pdfi_countup(basefont);
t1f->FontDescriptor = (pdf_dict *) fontdesc;
pdfi_countup(fontdesc);
t1f->Name = mapname;
pdfi_countup(mapname);
/* We want basefont, but we can live without it */
- (void)pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, &basefont);
+ if (font_dict != NULL) {
+ (void)pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, &basefont);
+ t1f->BaseFont = basefont;
+ pdfi_countup(basefont);
+ }
t1f->descflags = 0;
if (t1f->FontDescriptor != NULL) {
@@ -588,15 +606,15 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
t1f->descflags |= 4;
}
- if (ctx->args.ignoretounicode != true) {
+ if (ctx->args.ignoretounicode != true && font_dict != NULL) {
code = pdfi_dict_get(ctx, font_dict, "ToUnicode", (pdf_obj **)&tounicode);
- if (code >= 0 && tounicode->type == PDF_STREAM) {
+ if (code >= 0 && pdfi_type_of(tounicode) == PDF_STREAM) {
pdf_cmap *tu = NULL;
code = pdfi_read_cmap(ctx, tounicode, &tu);
pdfi_countdown(tounicode);
tounicode = (pdf_obj *)tu;
}
- if (code < 0 || (tounicode != NULL && tounicode->type != PDF_CMAP)) {
+ if (code < 0 || (tounicode != NULL && pdfi_type_of(tounicode) != PDF_CMAP)) {
pdfi_countdown(tounicode);
tounicode = NULL;
code = 0;
@@ -608,74 +626,29 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
t1f->ToUnicode = tounicode;
tounicode = NULL;
- code = pdfi_dict_knownget_type(ctx, font_dict, "FirstChar", PDF_INT, &tmp);
- if (code == 1) {
- t1f->FirstChar = ((pdf_num *) tmp)->value.i;
- pdfi_countdown(tmp);
- tmp = NULL;
- }
- else {
- t1f->FirstChar = 0;
- }
- code = pdfi_dict_knownget_type(ctx, font_dict, "LastChar", PDF_INT, &tmp);
- if (code == 1) {
- t1f->LastChar = ((pdf_num *) tmp)->value.i;
- pdfi_countdown(tmp);
- tmp = NULL;
- }
- else {
- t1f->LastChar = 255;
- }
+ pdfi_font_set_first_last_char(ctx, font_dict, (pdf_font *)t1f);
- t1f->fake_glyph_names = (gs_string *) gs_alloc_bytes(ctx->memory, t1f->LastChar * sizeof(gs_string), "pdfi_read_type1_font: fake_glyph_names");
- if (!t1f->fake_glyph_names) {
- code = gs_note_error(gs_error_VMerror);
- goto error;
- }
- memset(t1f->fake_glyph_names, 0x00, t1f->LastChar * sizeof(gs_string));
-
- code = pdfi_dict_knownget_type(ctx, font_dict, "Widths", PDF_ARRAY, &tmp);
- if (code > 0) {
- int i;
- double x_scale;
- int num_chars = t1f->LastChar - t1f->FirstChar + 1;
-
- if (num_chars == pdfi_array_size((pdf_array *) tmp)) {
- t1f->Widths = (double *)gs_alloc_bytes(ctx->memory, sizeof(double) * num_chars, "Type 1 font Widths array");
- if (t1f->Widths == NULL) {
- code = gs_note_error(gs_error_VMerror);
- goto error;
- }
-
- /* Widths are defined assuming a 1000x1000 design grid, but we apply
- * them in font space - so undo the 1000x1000 scaling, and apply
- * the inverse of the font's x scaling
- */
- x_scale = 0.001 / hypot(pfont1->FontMatrix.xx, pfont1->FontMatrix.xy);
-
- memset(t1f->Widths, 0x00, sizeof(double) * num_chars);
- for (i = 0; i < num_chars; i++) {
- code = pdfi_array_get_number(ctx, (pdf_array *) tmp, (uint64_t) i, &t1f->Widths[i]);
- if (code < 0)
- goto error;
- t1f->Widths[i] *= x_scale;
- }
- }
- else {
- t1f->Widths = NULL;
- }
- }
- pdfi_countdown(tmp);
- tmp = NULL;
+ /* Widths are defined assuming a 1000x1000 design grid, but we apply
+ * them in font space - so undo the 1000x1000 scaling, and apply
+ * the inverse of the font's x scaling
+ */
+ x_scale = 0.001 / hypot(pfont1->FontMatrix.xx, pfont1->FontMatrix.xy);
+
+ /* ignore errors with widths... for now */
+ if (font_dict != NULL)
+ (void)pdfi_font_create_widths(ctx, font_dict, (pdf_font*)t1f, x_scale);
- code = pdfi_dict_knownget(ctx, font_dict, "Encoding", &tmp);
+ if (font_dict != NULL)
+ code = pdfi_dict_knownget(ctx, font_dict, "Encoding", &tmp);
+ else
+ code = gs_error_undefined;
if (code == 1) {
- if ((tmp->type == PDF_NAME || tmp->type == PDF_DICT) && (t1f->descflags & 4) == 0) {
+ if ((pdfi_type_of(tmp) == PDF_NAME || pdfi_type_of(tmp) == PDF_DICT) && (t1f->descflags & 4) == 0) {
code = pdfi_create_Encoding(ctx, tmp, NULL, (pdf_obj **) & t1f->Encoding);
if (code >= 0)
code = 1;
}
- else if (tmp->type == PDF_DICT && (t1f->descflags & 4) != 0) {
+ else if (pdfi_type_of(tmp) == PDF_DICT && (t1f->descflags & 4) != 0) {
code = pdfi_create_Encoding(ctx, tmp, (pdf_obj *)fpriv.u.t1.Encoding, (pdf_obj **) & t1f->Encoding);
if (code >= 0)
code = 1;
@@ -685,15 +658,6 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
pdfi_countdown(tmp);
tmp = NULL;
if (code == 1) {
- /* Since the underlying font stream can be shared between font descriptors,
- and the font descriptors can be shared between font objects, if we change
- the encoding, we can't share cached glyphs with other instances of this
- underlying font, so invalidate the UniqueID/XUID so the glyph cache won't
- try.
- */
- if (uid_is_XUID(&t1f->pfont->UID))
- uid_free(&t1f->pfont->UID, t1f->pfont->memory, "pdfi_read_type1_font");
- uid_set_invalid(&t1f->pfont->UID);
}
}
else {
@@ -706,6 +670,15 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
t1f->Encoding = fpriv.u.t1.Encoding;
pdfi_countup(t1f->Encoding);
}
+ /* Since the underlying font stream can be shared between font descriptors,
+ and the font descriptors can be shared between font objects, if we change
+ the encoding, we can't share cached glyphs with other instances of this
+ underlying font, so invalidate the UniqueID/XUID so the glyph cache won't
+ try.
+ */
+ if (uid_is_XUID(&t1f->pfont->UID))
+ uid_free(&t1f->pfont->UID, t1f->pfont->memory, "pdfi_read_type1_font");
+ uid_set_invalid(&t1f->pfont->UID);
t1f->CharStrings = fpriv.u.t1.CharStrings;
pdfi_countup(t1f->CharStrings);
@@ -713,7 +686,11 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
t1f->Subrs = fpriv.u.t1.Subrs;
fpriv.u.t1.Subrs = NULL;
- t1f->NumSubrs = fpriv.u.t1.NumSubrs;
+
+ code = pdfi_font_generate_pseudo_XUID(ctx, font_dict, t1f->pfont);
+ if (code < 0) {
+ goto error;
+ }
t1f->blenddesignpositions = fpriv.u.t1.blenddesignpositions;
pdfi_countup(t1f->blenddesignpositions);
@@ -724,6 +701,18 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
t1f->blendaxistypes = fpriv.u.t1.blendaxistypes;
pdfi_countup(t1f->blendaxistypes);
+ key_known = false;
+ if (t1f->FontDescriptor != NULL) {
+ code = pdfi_dict_known(ctx, t1f->FontDescriptor, "FontFile", &key_known);
+ if (code < 0 || key_known == false) {
+ code = pdfi_dict_known(ctx, t1f->FontDescriptor, "FontFile2", &key_known);
+ if (code < 0 || key_known == false) {
+ code = pdfi_dict_known(ctx, t1f->FontDescriptor, "FontFile3", &key_known);
+ }
+ }
+ }
+ t1f->pfont->is_resource = (key_known == false);
+
code = gs_definefont(ctx->font_dir, (gs_font *) t1f->pfont);
if (code < 0) {
goto error;
@@ -753,20 +742,190 @@ pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dic
pdfi_countdown(fpriv.u.t1.blenddesignmap);
pdfi_countdown(fpriv.u.t1.blendfontbbox);
pdfi_countdown(fpriv.u.t1.blendaxistypes);
+ pdfi_countdown(fpriv.u.t1.Subrs);
if (fpriv.gsu.gst1.UID.xvalues != NULL) {
gs_free_object(ctx->memory, fpriv.gsu.gst1.UID.xvalues, "pdfi_read_type1_font(xuid)");
}
- if (fpriv.u.t1.Subrs) {
- int i;
- for (i = 0; i < fpriv.u.t1.NumSubrs; i++) {
- gs_free_object(ctx->memory, fpriv.u.t1.Subrs[i].data, "Subrs[i]");
+ if (code < 0) {
+ pdfi_countdown(t1f);
+ }
+ return code;
+}
+
+int
+pdfi_copy_type1_font(pdf_context *ctx, pdf_font *spdffont, pdf_dict *font_dict, pdf_font **tpdffont)
+{
+ int code = 0;
+ pdf_font_type1 *font = NULL;
+ gs_font_type1 *spfont1 = (gs_font_type1 *) spdffont->pfont;
+ gs_font_type1 *dpfont1;
+ gs_id t_id;
+ pdf_obj *tmp;
+
+ if (font_dict == NULL)
+ return_error(gs_error_invalidfont);
+
+ code = pdfi_alloc_t1_font(ctx, &font, font_dict->object_num);
+ if (code < 0)
+ return code;
+ dpfont1 = (gs_font_type1 *) font->pfont;
+
+ t_id = dpfont1->id;
+ memcpy(dpfont1, spfont1, sizeof(gs_font_type1));
+ dpfont1->id = t_id;
+ dpfont1->FAPI = NULL;
+ dpfont1->FAPI_font_data = NULL;
+
+ memcpy(font, spdffont, sizeof(pdf_font_type1));
+ font->pfont = (gs_font_base *)dpfont1;
+ font->refcnt = 1;
+ dpfont1->client_data = (void *)font;
+ font->filename = NULL;
+
+ dpfont1->notify_list.memory = NULL;
+ dpfont1->notify_list.first = NULL;
+ gs_notify_init(&dpfont1->notify_list, dpfont1->memory);
+
+ font->PDF_font = font_dict;
+ font->object_num = font_dict->object_num;
+ font->generation_num = font_dict->generation_num;
+ pdfi_countup(font->PDF_font);
+
+ /* We want basefont and descriptor, but we can live without them */
+ font->BaseFont = NULL;
+ code = pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, &font->BaseFont);
+ if (code < 0) {
+ pdfi_countdown(font->BaseFont);
+ font->BaseFont = NULL;
+ }
+ font->FontDescriptor = NULL;
+ code = pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, (pdf_obj **)&font->FontDescriptor);
+ if (code < 0) {
+ pdfi_countdown(font->FontDescriptor);
+ font->FontDescriptor = NULL;
+ }
+
+ pdfi_countup(font->Name);
+ pdfi_countup(font->CharStrings);
+ pdfi_countup(font->blenddesignpositions);
+ pdfi_countup(font->blenddesignmap);
+ pdfi_countup(font->blendfontbbox);
+ pdfi_countup(font->blendaxistypes);
+ pdfi_countup(font->Subrs);
+
+ if (font->BaseFont != NULL && ((pdf_name *)font->BaseFont)->length <= gs_font_name_max - 1) {
+ memcpy(dpfont1->key_name.chars, ((pdf_name *)font->BaseFont)->data, ((pdf_name *)font->BaseFont)->length);
+ dpfont1->key_name.size = ((pdf_name *)font->BaseFont)->length;
+ dpfont1->key_name.chars[dpfont1->key_name.size] = '\0';
+ memcpy(dpfont1->font_name.chars, ((pdf_name *)font->BaseFont)->data, ((pdf_name *)font->BaseFont)->length);
+ dpfont1->font_name.size = ((pdf_name *)font->BaseFont)->length;
+ dpfont1->font_name.chars[dpfont1->font_name.size] = '\0';
+ }
+
+ font->Encoding = NULL;
+ font->ToUnicode = NULL;
+ font->Widths = NULL;
+
+ pdfi_font_set_first_last_char(ctx, font_dict, (pdf_font *)font);
+ (void)pdfi_font_create_widths(ctx, font_dict, (pdf_font *)font, (double)(0.001 / hypot(dpfont1->FontMatrix.xx, dpfont1->FontMatrix.xy)));
+
+ font->descflags = 0;
+ if (font->FontDescriptor != NULL) {
+ code = pdfi_dict_get_int(ctx, font->FontDescriptor, "Flags", &font->descflags);
+ if (code >= 0) {
+ /* If both the symbolic and non-symbolic flag are set,
+ believe that latter.
+ */
+ if ((font->descflags & 32) != 0)
+ font->descflags = (font->descflags & ~4);
}
- gs_free_object(ctx->memory, fpriv.u.t1.Subrs, "Subrs");
}
+
+ if (pdfi_font_known_symbolic(font->BaseFont)) {
+ font->descflags |= 4;
+ }
+
+ tmp = NULL;
+ code = pdfi_dict_knownget(ctx, font_dict, "Encoding", &tmp);
+ if (code == 1) {
+ if ((pdfi_type_of(tmp) == PDF_NAME || pdfi_type_of(tmp) == PDF_DICT) && (font->descflags & 4) == 0) {
+ code = pdfi_create_Encoding(ctx, tmp, NULL, (pdf_obj **) & font->Encoding);
+ if (code >= 0)
+ code = 1;
+ }
+ else if (pdfi_type_of(tmp) == PDF_DICT && (font->descflags & 4) != 0) {
+ code = pdfi_create_Encoding(ctx, tmp, (pdf_obj *)spdffont->Encoding, (pdf_obj **) &font->Encoding);
+ if (code >= 0)
+ code = 1;
+ }
+ else
+ code = gs_error_undefined;
+ pdfi_countdown(tmp);
+ tmp = NULL;
+ }
+ else {
+ pdfi_countdown(tmp);
+ tmp = NULL;
+ code = 0;
+ }
+
+ if (code <= 0) {
+ font->Encoding = spdffont->Encoding;
+ pdfi_countup(font->Encoding);
+ }
+
+ /* Since various aspects of the font may differ (widths, encoding, etc)
+ we cannot reliably use the UniqueID/XUID for copied fonts.
+ */
+ if (uid_is_XUID(&font->pfont->UID))
+ uid_free(&font->pfont->UID, font->pfont->memory, "pdfi_read_type1_font");
+ uid_set_invalid(&font->pfont->UID);
+
+ code = pdfi_font_generate_pseudo_XUID(ctx, font_dict, font->pfont);
if (code < 0) {
- pdfi_countdown(t1f);
+ goto error;
}
+
+ if (ctx->args.ignoretounicode != true) {
+ code = pdfi_dict_get(ctx, font_dict, "ToUnicode", (pdf_obj **)&tmp);
+ if (code >= 0 && pdfi_type_of(tmp) == PDF_STREAM) {
+ pdf_cmap *tu = NULL;
+ code = pdfi_read_cmap(ctx, tmp, &tu);
+ pdfi_countdown(tmp);
+ tmp = (pdf_obj *)tu;
+ }
+ if (code < 0 || (tmp != NULL && pdfi_type_of(tmp) != PDF_CMAP)) {
+ pdfi_countdown(tmp);
+ tmp = NULL;
+ code = 0;
+ }
+ }
+ else {
+ tmp = NULL;
+ }
+ font->ToUnicode = tmp;
+
+ code = gs_definefont(ctx->font_dir, (gs_font *) font->pfont);
+ if (code < 0) {
+ goto error;
+ }
+
+ code = pdfi_fapi_passfont((pdf_font *) font, 0, NULL, NULL, NULL, 0);
+ if (code < 0) {
+ goto error;
+ }
+ /* object_num can be zero if the dictionary was defined inline */
+ if (font->object_num != 0) {
+ (void)replace_cache_entry(ctx, (pdf_obj *) font);
+ }
+
+ *tpdffont = (pdf_font *)font;
+
+error:
+ if (code < 0)
+ pdfi_countdown(font);
+
return code;
}
@@ -774,7 +933,6 @@ int
pdfi_free_font_type1(pdf_obj *font)
{
pdf_font_type1 *t1f = (pdf_font_type1 *) font;
- int i;
gs_free_object(OBJ_MEMORY(font), t1f->pfont, "Free Type 1 gs_font");
@@ -789,20 +947,9 @@ pdfi_free_font_type1(pdf_obj *font)
pdfi_countdown(t1f->blenddesignmap);
pdfi_countdown(t1f->blendfontbbox);
pdfi_countdown(t1f->blendaxistypes);
+ pdfi_countdown(t1f->Subrs);
+ pdfi_countdown(t1f->filename);
- if (t1f->fake_glyph_names != NULL) {
- for (i = 0; i < t1f->LastChar; i++) {
- if (t1f->fake_glyph_names[i].data != NULL)
- gs_free_object(OBJ_MEMORY(font), t1f->fake_glyph_names[i].data, "Type 1 fake_glyph_name");
- }
- gs_free_object(OBJ_MEMORY(font), t1f->fake_glyph_names, "Type 1 fake_glyph_names");
- }
- if (t1f->NumSubrs > 0 && t1f->Subrs != NULL) {
- for (i = 0; i < t1f->NumSubrs; i++) {
- gs_free_object(OBJ_MEMORY(font), t1f->Subrs[i].data, "Type 1 Subr");
- }
- gs_free_object(OBJ_MEMORY(font), t1f->Subrs, "Type 1 Subrs");
- }
gs_free_object(OBJ_MEMORY(font), t1f->Widths, "Free Type 1 fontWidths");
gs_free_object(OBJ_MEMORY(font), t1f, "Free Type 1 font");
return 0;
diff --git a/pdf/pdf_font1.h b/pdf/pdf_font1.h
index 0385aafd..5fd41afa 100644
--- a/pdf/pdf_font1.h
+++ b/pdf/pdf_font1.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019-2021 Artifex Software, Inc.
+/* Copyright (C) 2019-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -21,6 +21,8 @@
int pdfi_read_type1_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict, pdf_dict *page_dict, byte *fbuf, int64_t fbuflen, pdf_font **ppdffont);
int pdfi_free_font_type1(pdf_obj *font);
+int pdfi_copy_type1_font(pdf_context *ctx, pdf_font *spdffont, pdf_dict *font_dict, pdf_font **tpdffont);
+
int pdfi_t1_global_glyph_code(const gs_font *pfont, gs_const_string *gstr, gs_glyph *pglyph);
#endif
diff --git a/pdf/pdf_font11.c b/pdf/pdf_font11.c
index 09712f60..d01e13e2 100644
--- a/pdf/pdf_font11.c
+++ b/pdf/pdf_font11.c
@@ -36,12 +36,12 @@ static int pdfi_cidtype2_string_proc(gs_font_type42 * pfont, ulong offset, uint
pdf_cidfont_type2 *ttfont = (pdf_cidfont_type2 *)pfont->client_data;
int code = 0;
- if (offset + length > ttfont->sfnt.size) {
+ if (offset + length > ttfont->sfnt->length) {
*pdata = NULL;
code = gs_note_error(gs_error_invalidfont);
}
else {
- *pdata = ttfont->sfnt.data + offset;
+ *pdata = ttfont->sfnt->data + offset;
}
return code;
}
@@ -51,8 +51,8 @@ static int pdfi_cidtype2_CIDMap_proc(gs_font_cid2 *pfont, gs_glyph glyph)
pdf_cidfont_type2 *pdffont11 = (pdf_cidfont_type2 *)pfont->client_data;
uint gid = glyph - GS_MIN_CID_GLYPH;
- if (pdffont11->cidtogidmap.size > (gid << 1) + 1) {
- gid = pdffont11->cidtogidmap.data[gid << 1] << 8 | pdffont11->cidtogidmap.data[(gid << 1) + 1];
+ if (pdffont11->cidtogidmap != NULL && pdffont11->cidtogidmap->length > (gid << 1) + 1) {
+ gid = pdffont11->cidtogidmap->data[gid << 1] << 8 | pdffont11->cidtogidmap->data[(gid << 1) + 1];
}
return (int)gid;
@@ -61,7 +61,7 @@ static int pdfi_cidtype2_CIDMap_proc(gs_font_cid2 *pfont, gs_glyph glyph)
static uint pdfi_cidtype2_get_glyph_index(gs_font_type42 *pfont, gs_glyph glyph)
{
pdf_cidfont_type2 *pdffont11 = (pdf_cidfont_type2 *)pfont->client_data;
- uint gid;
+ uint gid = 0;
if (glyph < GS_MIN_CID_GLYPH) {
gid = 0;
@@ -69,13 +69,10 @@ static uint pdfi_cidtype2_get_glyph_index(gs_font_type42 *pfont, gs_glyph glyph)
else {
if (glyph < GS_MIN_GLYPH_INDEX) {
gid = glyph - GS_MIN_CID_GLYPH;
- if (pdffont11->cidtogidmap.size > 0) {
- gid = pdffont11->cidtogidmap.data[gid << 1] << 8 | pdffont11->cidtogidmap.data[(gid << 1) + 1];
+ if (pdffont11->cidtogidmap != NULL && pdffont11->cidtogidmap->length > (gid << 1) + 1) {
+ gid = pdffont11->cidtogidmap->data[gid << 1] << 8 | pdffont11->cidtogidmap->data[(gid << 1) + 1];
}
}
- else {
- gid = (uint)(glyph - GS_MIN_GLYPH_INDEX);
- }
}
return gid;
@@ -151,15 +148,15 @@ pdfi_cidtype2_enumerate_glyph(gs_font *font, int *pindex,
if (*pindex <= 0)
*pindex = 0;
- if (pdffont11->cidtogidmap.size > 0) {
+ if (pdffont11->cidtogidmap != NULL && pdffont11->cidtogidmap->length > 0) {
do {
- *pglyph = pdffont11->cidtogidmap.data[(*pindex) << 1] << 8 | pdffont11->cidtogidmap.data[((*pindex) << 1) + 1];
+ *pglyph = pdffont11->cidtogidmap->data[(*pindex) << 1] << 8 | pdffont11->cidtogidmap->data[((*pindex) << 1) + 1];
(*pindex)++;
if (*pglyph == 0 && *pindex == 1) /* notdef - special case */
break;
- } while (*pglyph == 0 && ((*pindex) << 1) < pdffont11->cidtogidmap.size);
+ } while (*pglyph == 0 && ((*pindex) << 1) < pdffont11->cidtogidmap->length);
- if (((*pindex) << 1) >= pdffont11->cidtogidmap.size) {
+ if (((*pindex) << 1) >= pdffont11->cidtogidmap->length) {
*pindex = 0;
}
else {
@@ -312,9 +309,16 @@ int pdfi_read_cidtype2_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str
font->FontDescriptor = (pdf_dict *)fontdesc;
fontdesc = NULL;
- /* Ownership of buf is now part of the font and managed via its lifetime */
- font->sfnt.data = buf;
- font->sfnt.size = buflen;
+ code = pdfi_object_alloc(ctx, PDF_BUFFER, 0, (pdf_obj **)&font->sfnt);
+ if (code < 0) {
+ goto error;
+ }
+ pdfi_countup(font->sfnt);
+ code = pdfi_buffer_set_data((pdf_obj *)font->sfnt, buf, buflen);
+ if (code < 0) {
+ goto error;
+ }
+ buf = NULL;
/* Strictly speaking BaseFont is required, but we can continue without one */
code = pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, (pdf_obj **)&obj);
@@ -368,18 +372,26 @@ int pdfi_read_cidtype2_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str
code = pdfi_dict_knownget(ctx, font_dict, "CIDToGIDMap", (pdf_obj **)&obj);
if (code > 0) {
- font->cidtogidmap.data = NULL;
- font->cidtogidmap.size = 0;
/* CIDToGIDMap can only be a stream or a name, and if it's a name
it's only permitted to be "/Identity", so ignore it
*/
- if (obj->type == PDF_STREAM) {
+ if (pdfi_type_of(obj) == PDF_STREAM) {
+ byte *d;
int64_t sz;
- code = pdfi_stream_to_buffer(ctx, (pdf_stream *)obj, &(font->cidtogidmap.data), &sz);
+
+ code = pdfi_object_alloc(ctx, PDF_BUFFER, 0, (pdf_obj **)&font->cidtogidmap);
+ if (code < 0) {
+ goto error;
+ }
+ pdfi_countup(font->cidtogidmap);
+ code = pdfi_stream_to_buffer(ctx, (pdf_stream *)obj, &d, &sz);
+ if (code < 0) {
+ goto error;
+ }
+ code = pdfi_buffer_set_data((pdf_obj *)font->cidtogidmap, d, (int32_t)sz);
if (code < 0) {
goto error;
}
- font->cidtogidmap.size = (uint)sz;
}
pdfi_countdown(obj);
obj = NULL;
@@ -427,20 +439,31 @@ int pdfi_read_cidtype2_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str
pdfi_countdown(obj);
obj = NULL;
+
code = gs_type42_font_init((gs_font_type42 *)font->pfont, 0);
if (code < 0) {
goto error;
}
+ if (uid_is_XUID(&font->pfont->UID))
+ uid_free(&font->pfont->UID, font->pfont->memory, "pdfi_read_type1_font");
+ uid_set_invalid(&font->pfont->UID);
+ font->pfont->id = gs_next_ids(ctx->memory, 1);
+
+ code = pdfi_font_generate_pseudo_XUID(ctx, font_dict, font->pfont);
+ if (code < 0)
+ goto error;
+
+
font->orig_glyph_info = font->pfont->procs.glyph_info;
font->pfont->procs.glyph_info = pdfi_cidtype2_glyph_info;
font->pfont->procs.enumerate_glyph = pdfi_cidtype2_enumerate_glyph;
- if (font->cidtogidmap.size > 0) {
+ if (font->cidtogidmap != NULL) {
gs_font_cid2 *cid2 = (gs_font_cid2 *)font->pfont;
- if (cid2->data.numGlyphs > font->cidtogidmap.size >> 1)
+ if (cid2->data.numGlyphs > font->cidtogidmap->length >> 1)
cid2->cidata.common.CIDCount = cid2->data.numGlyphs;
else {
- cid2->cidata.common.CIDCount = font->cidtogidmap.size >> 1;
+ cid2->cidata.common.CIDCount = font->cidtogidmap->length >> 1;
}
cid2->cidata.common.MaxCID = cid2->cidata.common.CIDCount;
}
@@ -453,16 +476,12 @@ int pdfi_read_cidtype2_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str
cid2->cidata.orig_procs.get_outline = cid2->data.get_outline;
cid2->data.get_glyph_index = pdfi_cidtype2_get_glyph_index;
- code = pdfi_font_generate_pseudo_XUID(ctx, font->PDF_font, font->pfont);
- if (code < 0)
- goto error;
-
code = gs_definefont(ctx->font_dir, (gs_font *)font->pfont);
if (code < 0) {
goto error;
}
- code = pdfi_fapi_passfont((pdf_font *)font, 0, NULL, NULL, font->sfnt.data, font->sfnt.size);
+ code = pdfi_fapi_passfont((pdf_font *)font, 0, NULL, NULL, font->sfnt->data, font->sfnt->length);
if (code < 0) {
goto error;
}
@@ -487,9 +506,9 @@ int pdfi_free_font_cidtype2(pdf_obj *font)
gs_font_cid2 *pfont = (gs_font_cid2 *)pdfcidf->pfont;
gs_free_object(OBJ_MEMORY(pdfcidf), pfont, "pdfi_free_font_cidtype2(pfont)");
- gs_free_object(OBJ_MEMORY(pdfcidf), pdfcidf->cidtogidmap.data, "pdfi_free_font_cidtype2(cidtogidmap.data)");
- gs_free_object(OBJ_MEMORY(pdfcidf), pdfcidf->sfnt.data, "pdfi_free_font_cidtype2(sfnt.data)");
+ pdfi_countdown(pdfcidf->cidtogidmap);
+ pdfi_countdown(pdfcidf->sfnt);
pdfi_countdown(pdfcidf->PDF_font);
pdfi_countdown(pdfcidf->BaseFont);
pdfi_countdown(pdfcidf->FontDescriptor);
@@ -498,6 +517,7 @@ int pdfi_free_font_cidtype2(pdf_obj *font)
pdfi_countdown(pdfcidf->W2);
pdfi_countdown(pdfcidf->registry);
pdfi_countdown(pdfcidf->ordering);
+ pdfi_countdown(pdfcidf->filename);
gs_free_object(OBJ_MEMORY(pdfcidf), pdfcidf, "pdfi_free_font_cidtype2(pdfcidf)");
return 0;
diff --git a/pdf/pdf_font1C.c b/pdf/pdf_font1C.c
index f4788845..43ebced3 100644
--- a/pdf/pdf_font1C.c
+++ b/pdf/pdf_font1C.c
@@ -60,7 +60,7 @@ typedef struct pdfi_cff_font_priv_s {
pdf_array *W;
pdf_array *DW2;
pdf_array *W2;
- gs_string cidtogidmap;
+ pdf_buffer *cidtogidmap;
pdf_array *FDArray;
/* The registry and ordering strings in gs_font_cid0_data are just references to
strings assumed to be managed be managed by the interpreter - so we have to stash
@@ -145,6 +145,9 @@ pdfi_cff_glyph_data(gs_font_type1 *pfont, gs_glyph glyph, gs_glyph_data_t *pgd)
}
if (code >= 0) {
code = pdfi_dict_get_by_key(ctx, cfffont->CharStrings, glyphname, (pdf_obj **) &charstring);
+ if (code < 0) {
+ code = pdfi_map_glyph_name_via_agl(cfffont->CharStrings, glyphname, &charstring);
+ }
if (code >= 0)
gs_glyph_data_from_bytes(pgd, charstring->data, 0, charstring->length, NULL);
}
@@ -205,11 +208,13 @@ pdfi_cff_seac_data(gs_font_type1 *pfont, int ccode, gs_glyph *pglyph, gs_const_s
pdfi_countup(glyphname);
code = pdfi_dict_get_by_key(ctx, cfffont->CharStrings, glyphname, (pdf_obj **)&charstring);
pdfi_countdown(glyphname);
- if (code >= 0)
- if (pgd != NULL)
+ if (code >= 0) {
+ if (pgd != NULL) {
gs_glyph_data_from_bytes(pgd, charstring->data, 0, charstring->length, NULL);
+ }
pdfi_countdown(charstring);
}
+ }
}
return code;
@@ -272,8 +277,13 @@ pdfi_cff_enumerate_glyph(gs_font *pfont, int *pindex,
else if (pdffont->pdfi_font_type != e_pdf_cidfont_type0 && pdffont->Encoding != NULL) {
unsigned int nindex;
code = (*ctx->get_glyph_index)(pfont, key->data, key->length, &nindex);
- if (code < 0)
- *pglyph = GS_NO_GLYPH;
+ if (code < 0) {
+ code = (*ctx->get_glyph_index)(pfont, (byte *)".notdef", 7, &nindex);
+ if (code < 0)
+ *pglyph = GS_NO_GLYPH;
+ else
+ *pglyph = (gs_glyph)nindex;
+ }
else
*pglyph = (gs_glyph)nindex;
}
@@ -296,9 +306,9 @@ pdfi_cff_enumerate_glyph(gs_font *pfont, int *pindex,
}
if (l > 0) {
pdf_cidfont_type0 *cffcidfont = (pdf_cidfont_type0 *) pdffont;
- if (cffcidfont->cidtogidmap.size > 0) {
- for (j = (cffcidfont->cidtogidmap.size >> 1) - 1; j >= 0; j--) {
- if (val == (cffcidfont->cidtogidmap.data[j << 1] << 8 | cffcidfont->cidtogidmap.data[(j << 1) + 1])) {
+ if (cffcidfont->cidtogidmap != NULL && cffcidfont->cidtogidmap->length > 0) {
+ for (j = (cffcidfont->cidtogidmap->length >> 1) - 1; j >= 0; j--) {
+ if (val == (cffcidfont->cidtogidmap->data[j << 1] << 8 | cffcidfont->cidtogidmap->data[(j << 1) + 1])) {
val = j;
break;
}
@@ -427,8 +437,8 @@ pdfi_cff_cid_glyph_data(gs_font_base *pbfont, gs_glyph glyph, gs_glyph_data_t *p
else
gid = glyph - GS_MIN_CID_GLYPH;
- if (pdffont9->cidtogidmap.size > (gid << 1) + 1) {
- gid = pdffont9->cidtogidmap.data[gid << 1] << 8 | pdffont9->cidtogidmap.data[(gid << 1) + 1];
+ if (pdffont9->cidtogidmap != NULL && pdffont9->cidtogidmap->length > (gid << 1) + 1) {
+ gid = pdffont9->cidtogidmap->data[gid << 1] << 8 | pdffont9->cidtogidmap->data[(gid << 1) + 1];
}
l = gs_snprintf(nbuf, sizeof(nbuf), "%" PRId64, gid);
@@ -814,7 +824,8 @@ pdfi_read_cff_dict(byte *p, byte *e, pdfi_gs_cff_font_priv *ptpriv, cff_font_off
n = 0;
while (p < e && code >= 0) {
- b0 = *p++;
+ b0 = *p;
+ p++;
switch (b0) {
case 22:
@@ -946,9 +957,10 @@ pdfi_read_cff_dict(byte *p, byte *e, pdfi_gs_cff_font_priv *ptpriv, cff_font_off
code = pdfi_make_string_from_sid(font->ctx, (pdf_obj **) &fnamestr, font, offsets, args[0].ival);
if (code >= 0) {
- memcpy(ptpriv->font_name.chars, fnamestr->data, fnamestr->length);
- memcpy(ptpriv->key_name.chars, fnamestr->data, fnamestr->length);
- ptpriv->font_name.size = ptpriv->key_name.size = fnamestr->length;
+ int nlen = fnamestr->length > gs_font_name_max ? gs_font_name_max : fnamestr->length;
+ memcpy(ptpriv->font_name.chars, fnamestr->data, nlen);
+ memcpy(ptpriv->key_name.chars, fnamestr->data, nlen);
+ ptpriv->font_name.size = ptpriv->key_name.size = nlen;
pdfi_countdown(fnamestr);
}
break;
@@ -1698,7 +1710,6 @@ pdfi_read_cff(pdf_context *ctx, pdfi_gs_cff_font_priv *ptpriv)
font->GlobalSubrs->refcnt = 1;
for (i = 0; i < font->NumGlobalSubrs; i++) {
pdf_string *gsubrstr;
- pdf_obj *nullobj = NULL;
p = pdfi_find_cff_index(font->gsubrs, font->cffend, i, &strp, &stre);
if (p) {
@@ -1715,11 +1726,7 @@ pdfi_read_cff(pdf_context *ctx, pdfi_gs_cff_font_priv *ptpriv)
}
}
else {
- code = 0;
- if (nullobj == NULL)
- code = pdfi_object_alloc(ctx, PDF_NULL, 1, (pdf_obj **) &nullobj);
- if (code >= 0)
- code = pdfi_array_put(ctx, font->GlobalSubrs, (uint64_t) i, (pdf_obj *) nullobj);
+ code = pdfi_array_put(ctx, font->GlobalSubrs, (uint64_t) i, PDF_NULL_OBJ);
if (code < 0) {
pdfi_countdown(font->GlobalSubrs);
font->GlobalSubrs = NULL;
@@ -1736,7 +1743,6 @@ pdfi_read_cff(pdf_context *ctx, pdfi_gs_cff_font_priv *ptpriv)
font->Subrs->refcnt = 1;
for (i = 0; i < font->NumSubrs; i++) {
pdf_string *subrstr;
- pdf_obj *nullobj = NULL;
p = pdfi_find_cff_index(font->subrs, font->cffend, i, &strp, &stre);
if (p) {
@@ -1751,11 +1757,7 @@ pdfi_read_cff(pdf_context *ctx, pdfi_gs_cff_font_priv *ptpriv)
}
}
else {
- code = 0;
- if (nullobj == NULL)
- code = pdfi_object_alloc(ctx, PDF_NULL, 1, (pdf_obj **) &nullobj);
- if (code >= 0)
- code = pdfi_array_put(ctx, font->Subrs, (uint64_t) i, (pdf_obj *) nullobj);
+ code = pdfi_array_put(ctx, font->Subrs, (uint64_t) i, PDF_NULL_OBJ);
if (code < 0) {
pdfi_countdown(font->Subrs);
font->Subrs = NULL;
@@ -1838,7 +1840,7 @@ pdfi_read_cff(pdf_context *ctx, pdfi_gs_cff_font_priv *ptpriv)
pdf_font_cff *pdffont = NULL;
gs_font_type1 *pt1font;
- pdfi_init_cff_font_priv(ctx, &fdptpriv, font->cffdata, (font->cffend - font->cffdata) + 1, true);
+ pdfi_init_cff_font_priv(ctx, &fdptpriv, font->cffdata, (font->cffend - font->cffdata), true);
offsets.private_off = 0;
@@ -1879,9 +1881,8 @@ pdfi_read_cff(pdf_context *ctx, pdfi_gs_cff_font_priv *ptpriv)
/* Check the subrs index */
pdffont->Subrs = NULL;
- pdffont->subrs = fdptpriv.pdfcffpriv.subrs;
- if (pdffont->subrs) {
- p = pdfi_count_cff_index(pdffont->subrs, e, &pdffont->NumSubrs);
+ if (fdptpriv.pdfcffpriv.subrs) {
+ p = pdfi_count_cff_index(fdptpriv.pdfcffpriv.subrs, e, &pdffont->NumSubrs);
if (!p) {
pdffont->Subrs = NULL;
pdffont->NumSubrs = 0;
@@ -1897,7 +1898,7 @@ pdfi_read_cff(pdf_context *ctx, pdfi_gs_cff_font_priv *ptpriv)
for (j = 0; j < pdffont->NumSubrs; j++) {
pdf_string *subrstr;
- p = pdfi_find_cff_index(pdffont->subrs, e, j, &strp, &stre);
+ p = pdfi_find_cff_index(fdptpriv.pdfcffpriv.subrs, e, j, &strp, &stre);
if (p) {
code = pdfi_object_alloc(ctx, PDF_STRING, stre - strp, (pdf_obj **) &subrstr);
if (code >= 0) {
@@ -1975,7 +1976,7 @@ pdfi_read_cff(pdf_context *ctx, pdfi_gs_cff_font_priv *ptpriv)
if (g > maxcid) maxcid = g;
gs_snprintf(gkey, sizeof(gkey), "%d", g);
- code = pdfi_dict_put(ctx, font->CharStrings, gkey, (pdf_obj *) charstr);
+ code = pdfi_dict_put_unchecked(ctx, font->CharStrings, gkey, (pdf_obj *) charstr);
}
if (maxcid > ptpriv->pdfcffpriv.cidcount - 1)
ptpriv->pdfcffpriv.cidcount = maxcid + 1;
@@ -2270,8 +2271,13 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
fbuflen = tlen;
}
- code = pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, &fontdesc);
- if (code < 0) {
+ if (font_dict != NULL) {
+ code = pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, &fontdesc);
+ if (code < 0) {
+ fontdesc = NULL;
+ }
+ }
+ else {
fontdesc = NULL;
}
@@ -2335,7 +2341,7 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
cffpriv.pdfcffpriv.ordering = NULL;
}
code = pdfi_dict_knownget_type(ctx, (pdf_dict *)obj, "Supplement", PDF_INT, (pdf_obj **)&suppl);
- if (code <= 0 || suppl->type != PDF_INT) {
+ if (code <= 0 || pdfi_type_of(suppl) != PDF_INT) {
cffcid->supplement = cffpriv.pdfcffpriv.supplement;
}
else {
@@ -2358,9 +2364,6 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
cffcid->PDF_font = font_dict;
pdfi_countup(font_dict);
- cffcid->cidtogidmap.data = NULL;
- cffcid->cidtogidmap.size = 0;
-
pfont->client_data = cffcid;
cffcid->object_num = font_dict->object_num;
@@ -2384,23 +2387,35 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
pfont->cidata.common.CIDCount = cffpriv.pdfcffpriv.cidcount;
- cffcid->cidtogidmap.data = NULL;
- cffcid->cidtogidmap.size = 0;
+ cffcid->cidtogidmap = NULL;
code = pdfi_dict_knownget(ctx, font_dict, "CIDToGIDMap", (pdf_obj **) &obj);
if (code > 0) {
/* CIDToGIDMap can only be a stream or a name, and if it's a name
it's only permitted to be "/Identity", so ignore it
*/
- int64_t size = 0;
- if (obj->type == PDF_STREAM) {
- code = pdfi_stream_to_buffer(ctx, (pdf_stream *) obj, &(cffcid->cidtogidmap.data), &size);
+ if (pdfi_type_of(obj) == PDF_STREAM) {
+ byte *d;
+ int64_t sz;
+
+ code = pdfi_object_alloc(ctx, PDF_BUFFER, 0, (pdf_obj **)&cffcid->cidtogidmap);
+ if (code < 0) {
+ goto error;
+ }
+ pdfi_countup(cffcid->cidtogidmap);
+ code = pdfi_stream_to_buffer(ctx, (pdf_stream *)obj, &d, &sz);
+ if (code < 0) {
+ goto error;
+ }
+ code = pdfi_buffer_set_data((pdf_obj *)cffcid->cidtogidmap, d, (int32_t)sz);
+ if (code < 0) {
+ goto error;
+ }
}
pdfi_countdown(obj);
obj = NULL;
- cffcid->cidtogidmap.size = size;
- if (size > 0) {
- pfont->cidata.common.CIDCount = size >> 1;
+ if (cffcid->cidtogidmap != NULL && cffcid->cidtogidmap->length > 0) {
+ pfont->cidata.common.CIDCount = cffcid->cidtogidmap->length >> 1;
}
}
pfont->cidata.common.MaxCID = pfont->cidata.common.CIDCount - 1;
@@ -2438,10 +2453,10 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
else {
cffcid->W2 = NULL;
}
- code = pdfi_font_generate_pseudo_XUID(ctx, font_dict, (gs_font_base *)cffcid->pfont);
- if (code < 0)
- uid_set_invalid(&cffcid->pfont->UID);
-
+ if (uid_is_XUID(&cffcid->pfont->UID))
+ uid_free(&cffcid->pfont->UID, cffcid->pfont->memory, "pdfi_read_type1_font");
+ uid_set_invalid(&cffcid->pfont->UID);
+ cffcid->pfont->id = gs_next_ids(ctx->memory, 1);
}
else if (forcecid) {
pdf_obj *obj;
@@ -2581,22 +2596,34 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
cffcid->PDF_font = font_dict;
pdfi_countup(font_dict);
- cffcid->cidtogidmap.data = NULL;
- cffcid->cidtogidmap.size = 0;
+ cffcid->cidtogidmap = NULL;
code = pdfi_dict_knownget(ctx, font_dict, "CIDToGIDMap", (pdf_obj **) &obj);
if (code > 0) {
+ byte *d;
+ int64_t sz;
/* CIDToGIDMap can only be a stream or a name, and if it's a name
it's only permitted to be "/Identity", so ignore it
*/
- int64_t size = 0;
- if (obj->type == PDF_STREAM) {
- code = pdfi_stream_to_buffer(ctx, (pdf_stream *) obj, &(cffcid->cidtogidmap.data), (int64_t *) &size);
+ if (pdfi_type_of(obj) == PDF_STREAM) {
+ code = pdfi_object_alloc(ctx, PDF_BUFFER, 0, (pdf_obj **)&cffcid->cidtogidmap);
+ if (code < 0) {
+ goto error;
+ }
+ pdfi_countup(cffcid->cidtogidmap);
+ code = pdfi_stream_to_buffer(ctx, (pdf_stream *)obj, &d, &sz);
+ if (code < 0) {
+ goto error;
+ }
+ code = pdfi_buffer_set_data((pdf_obj *)cffcid->cidtogidmap, d, (int32_t)sz);
+ if (code < 0) {
+ goto error;
+ }
}
pdfi_countdown(obj);
obj = NULL;
- cffcid->cidtogidmap.size = size;
- if (size > 0) {
- pfont->cidata.common.CIDCount = size >> 1;
+
+ if (cffcid->cidtogidmap != NULL && cffcid->cidtogidmap->length > 0) {
+ pfont->cidata.common.CIDCount = cffcid->cidtogidmap->length >> 1;
}
}
pfont->cidata.common.MaxCID = pfont->cidata.common.CIDCount - 1;
@@ -2635,17 +2662,17 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
cffcid->W2 = NULL;
}
- code = pdfi_font_generate_pseudo_XUID(ctx, cffcid->PDF_font, ppdfont->pfont);
- if (code < 0)
- goto error;
-
+ if (uid_is_XUID(&cffcid->pfont->UID))
+ uid_free(&cffcid->pfont->UID, cffcid->pfont->memory, "pdfi_read_type1_font");
+ uid_set_invalid(&cffcid->pfont->UID);
+ cffcid->pfont->id = gs_next_ids(ctx->memory, 1);
}
else {
pdf_font_cff *cfffont;
gs_font_type1 *pfont = NULL;
pdf_obj *tounicode = NULL;
- code = pdfi_alloc_cff_font(ctx, &cfffont, font_dict->object_num, false);
+ code = pdfi_alloc_cff_font(ctx, &cfffont, font_dict != NULL ? font_dict->object_num : 0, false);
pfont = (gs_font_type1 *) cfffont->pfont;
ppdfont = (pdf_font *) cfffont;
@@ -2657,12 +2684,15 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
pfont->procs.glyph_info = pdfi_cff_glyph_info;
- cfffont->object_num = font_dict->object_num;
- cfffont->generation_num = font_dict->generation_num;
- cfffont->indirect_num = font_dict->indirect_num;
- cfffont->indirect_gen = font_dict->indirect_gen;
+ if (font_dict) {
+ cfffont->object_num = font_dict->object_num;
+ cfffont->generation_num = font_dict->generation_num;
+ cfffont->indirect_num = font_dict->indirect_num;
+ cfffont->indirect_gen = font_dict->indirect_gen;
+
+ (void)pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, &basefont);
+ }
- (void)pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, &basefont);
cfffont->BaseFont = basefont;
cfffont->Name = basefont;
pdfi_countup(basefont);
@@ -2700,69 +2730,23 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
cfffont->descflags |= 4;
}
- code = pdfi_dict_knownget_type(ctx, font_dict, "FirstChar", PDF_INT, &tmp);
- if (code == 1) {
- cfffont->FirstChar = ((pdf_num *) tmp)->value.i;
- pdfi_countdown(tmp);
- tmp = NULL;
- }
- else {
- cfffont->FirstChar = 0;
- }
- code = pdfi_dict_knownget_type(ctx, font_dict, "LastChar", PDF_INT, &tmp);
- if (code == 1) {
- cfffont->LastChar = ((pdf_num *) tmp)->value.i;
- pdfi_countdown(tmp);
- tmp = NULL;
- }
- else {
- cfffont->LastChar = 255;
- }
+ pdfi_font_set_first_last_char(ctx, font_dict, (pdf_font *)cfffont);
- cfffont->fake_glyph_names = (gs_string *) gs_alloc_bytes(ctx->memory, cfffont->LastChar * sizeof(gs_string), "pdfi_read_cff_font: fake_glyph_names");
- if (!cfffont->fake_glyph_names) {
- code = gs_note_error(gs_error_VMerror);
- goto error;
- }
- memset(cfffont->fake_glyph_names, 0x00, cfffont->LastChar * sizeof(gs_string));
- code = pdfi_dict_knownget_type(ctx, font_dict, "Widths", PDF_ARRAY, &tmp);
- if (code > 0) {
- int i;
- double x_scale;
- int num_chars = cfffont->LastChar - cfffont->FirstChar + 1;
-
- if (num_chars != pdfi_array_size((pdf_array *) tmp)) {
- pdfi_countdown(tmp);
- code = gs_note_error(gs_error_rangecheck);
- goto error;
- }
-
- cfffont->Widths = (double *)gs_alloc_bytes(ctx->memory, sizeof(double) * num_chars, "Type 1C font Widths array");
- if (cfffont->Widths == NULL) {
- code = gs_note_error(gs_error_VMerror);
- goto error;
- }
- memset(cfffont->Widths, 0x00, sizeof(double) * num_chars);
-
- /* Widths are defined assuming a 1000x1000 design grid, but we apply
- * them in font space - so undo the 1000x1000 scaling, and apply
- * the inverse of the font's x scaling
- */
- x_scale = 0.001 / hypot(pfont->FontMatrix.xx, pfont->FontMatrix.xy);
-
- for (i = 0; i < num_chars; i++) {
- code = pdfi_array_get_number(ctx, (pdf_array *) tmp, (uint64_t) i, &cfffont->Widths[i]);
- if (code < 0)
- goto error;
- cfffont->Widths[i] *= x_scale;
- }
+ /* Widths are defined assuming a 1000x1000 design grid, but we apply
+ * them in font space - so undo the 1000x1000 scaling, and apply
+ * the inverse of the font's x scaling
+ */
+ if (font_dict != NULL) {
+ /* ignore errors with widths... for now */
+ (void)pdfi_font_create_widths(ctx, font_dict, (pdf_font*)cfffont, (double)(0.001 / hypot(pfont->FontMatrix.xx, pfont->FontMatrix.xy)));
}
- pdfi_countdown(tmp);
- tmp = NULL;
- code = pdfi_dict_knownget(ctx, font_dict, "Encoding", &tmp);
+ if (font_dict != NULL)
+ code = pdfi_dict_knownget(ctx, font_dict, "Encoding", &tmp);
+ else
+ code = gs_error_undefined;
if (code == 1) {
- if ((cfffont->descflags & 4) != 0 && tmp->type == PDF_DICT) {
+ if ((cfffont->descflags & 4) != 0 && pdfi_type_of(tmp) == PDF_DICT) {
code = pdfi_create_Encoding(ctx, tmp, (pdf_obj *)cffpriv.pdfcffpriv.Encoding, (pdf_obj **) &cfffont->Encoding);
if (code >= 0) {
pdfi_countdown(cffpriv.pdfcffpriv.Encoding);
@@ -2770,7 +2754,7 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
code = 1;
}
}
- else if ((tmp->type == PDF_NAME || tmp->type == PDF_DICT)) {
+ else if ((pdfi_type_of(tmp) == PDF_NAME || pdfi_type_of(tmp) == PDF_DICT)) {
code = pdfi_create_Encoding(ctx, tmp, NULL, (pdf_obj **) &cfffont->Encoding);
if (code >= 0) {
pdfi_countdown(cffpriv.pdfcffpriv.Encoding);
@@ -2780,6 +2764,9 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
}
else
code = gs_error_undefined;
+
+ if (code == 1) {
+ }
pdfi_countdown(tmp);
tmp = NULL;
}
@@ -2792,15 +2779,27 @@ pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict,
cfffont->Encoding = cffpriv.pdfcffpriv.Encoding;
cffpriv.pdfcffpriv.Encoding = NULL;
}
- if (ctx->args.ignoretounicode != true) {
+
+ /* Since the underlying font stream can be shared between font descriptors,
+ and the font descriptors can be shared between font objects, if we change
+ the encoding, we can't share cached glyphs with other instances of this
+ underlying font, so invalidate the UniqueID/XUID so the glyph cache won't
+ try.
+ */
+ if (uid_is_XUID(&cfffont->pfont->UID))
+ uid_free(&cfffont->pfont->UID, cfffont->pfont->memory, "pdfi_read_type1_font");
+ uid_set_invalid(&cfffont->pfont->UID);
+ cfffont->pfont->id = gs_next_ids(ctx->memory, 1);
+
+ if (ctx->args.ignoretounicode != true && font_dict != NULL) {
code = pdfi_dict_get(ctx, font_dict, "ToUnicode", (pdf_obj **)&tounicode);
- if (code >= 0 && tounicode->type == PDF_STREAM) {
+ if (code >= 0 && pdfi_type_of(tounicode) == PDF_STREAM) {
pdf_cmap *tu = NULL;
code = pdfi_read_cmap(ctx, tounicode, &tu);
pdfi_countdown(tounicode);
tounicode = (pdf_obj *)tu;
}
- if (code < 0 || (tounicode != NULL && tounicode->type != PDF_CMAP)) {
+ if (code < 0 || (tounicode != NULL && pdfi_type_of(tounicode) != PDF_CMAP)) {
pdfi_countdown(tounicode);
tounicode = NULL;
code = 0;
@@ -2831,6 +2830,11 @@ error:
}
}
else {
+ code = pdfi_font_generate_pseudo_XUID(ctx, font_dict, ppdfont->pfont);
+ if (code < 0) {
+ goto error;
+ }
+
code = gs_definefont(ctx->font_dir, (gs_font *) ppdfont->pfont);
if (code >= 0)
@@ -2840,6 +2844,7 @@ error:
if (code >= 0 && ppdfont->object_num != 0) {
(void)replace_cache_entry(ctx, (pdf_obj *) ppdfont);
}
+
if (code >= 0) {
*ppdffont = (pdf_font *) ppdfont;
ppdfont = NULL;
@@ -2898,6 +2903,168 @@ pdfi_read_type1C_font(pdf_context *ctx, pdf_dict *font_dict,
}
int
+pdfi_copy_cff_font(pdf_context *ctx, pdf_font *spdffont, pdf_dict *font_dict, pdf_font **tpdffont)
+{
+ int code = 0;
+ pdf_font_cff *font = NULL;
+ gs_font_type1 *spfont1 = (gs_font_type1 *) spdffont->pfont;
+ gs_font_type1 *dpfont1;
+ gs_id t_id;
+ pdf_obj *tmp;
+
+ if (font_dict == NULL)
+ return_error(gs_error_invalidfont);
+
+ code = pdfi_alloc_cff_font(ctx, &font, font_dict->object_num, false);
+ if (code < 0)
+ return code;
+ dpfont1 = (gs_font_type1 *) font->pfont;
+
+ t_id = dpfont1->id;
+ memcpy(dpfont1, spfont1, sizeof(gs_font_type1));
+ dpfont1->id = t_id;
+ dpfont1->FAPI = NULL;
+ dpfont1->FAPI_font_data = NULL;
+ dpfont1->notify_list.memory = NULL;
+ dpfont1->notify_list.first = NULL;
+ gs_notify_init(&dpfont1->notify_list, dpfont1->memory);
+
+ memcpy(font, spdffont, sizeof(pdf_font_type1));
+ font->refcnt = 1;
+ font->pfont = (gs_font_base *)dpfont1;
+ dpfont1->client_data = (void *)font;
+ font->filename = NULL;
+
+ font->PDF_font = font_dict;
+ font->object_num = font_dict->object_num;
+ font->generation_num = font_dict->generation_num;
+ pdfi_countup(font->PDF_font);
+
+ /* We want basefont and descriptor, but we can live without them */
+ font->BaseFont = NULL;
+ (void)pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, &font->BaseFont);
+ font->FontDescriptor = NULL;
+ (void)pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, (pdf_obj **)&font->FontDescriptor);
+
+ pdfi_countup(font->Name);
+ pdfi_countup(font->CharStrings);
+ pdfi_countup(font->Subrs);
+ pdfi_countup(font->GlobalSubrs);
+
+ if (font->BaseFont != NULL && ((pdf_name *)font->BaseFont)->length <= gs_font_name_max) {
+ memcpy(dpfont1->key_name.chars, ((pdf_name *)font->BaseFont)->data, ((pdf_name *)font->BaseFont)->length);
+ dpfont1->key_name.size = ((pdf_name *)font->BaseFont)->length;
+ memcpy(dpfont1->font_name.chars, ((pdf_name *)font->BaseFont)->data, ((pdf_name *)font->BaseFont)->length);
+ dpfont1->font_name.size = ((pdf_name *)font->BaseFont)->length;
+ }
+
+ font->Encoding = NULL;
+ font->ToUnicode = NULL;
+ font->Widths = NULL;
+
+ pdfi_font_set_first_last_char(ctx, font_dict, (pdf_font *)font);
+ (void)pdfi_font_create_widths(ctx, font_dict, (pdf_font *)font, (double)(0.001 / hypot(dpfont1->FontMatrix.xx, dpfont1->FontMatrix.xy)));
+
+ font->descflags = 0;
+ if (font->FontDescriptor != NULL) {
+ code = pdfi_dict_get_int(ctx, font->FontDescriptor, "Flags", &font->descflags);
+ if (code >= 0) {
+ /* If both the symbolic and non-symbolic flag are set,
+ believe that latter.
+ */
+ if ((font->descflags & 32) != 0)
+ font->descflags = (font->descflags & ~4);
+ }
+ }
+
+ if (pdfi_font_known_symbolic(font->BaseFont)) {
+ font->descflags |= 4;
+ }
+
+
+ tmp = NULL;
+ code = pdfi_dict_knownget(ctx, font_dict, "Encoding", &tmp);
+ if (code == 1) {
+ if ((pdfi_type_of(tmp) == PDF_NAME || pdfi_type_of(tmp) == PDF_DICT) && (font->descflags & 4) == 0) {
+ code = pdfi_create_Encoding(ctx, tmp, NULL, (pdf_obj **) & font->Encoding);
+ if (code >= 0)
+ code = 1;
+ }
+ else if (pdfi_type_of(tmp) == PDF_DICT && (font->descflags & 4) != 0) {
+ code = pdfi_create_Encoding(ctx, tmp, (pdf_obj *)spdffont->Encoding, (pdf_obj **) &font->Encoding);
+ if (code >= 0)
+ code = 1;
+ }
+ else
+ code = gs_error_undefined;
+ pdfi_countdown(tmp);
+ tmp = NULL;
+ }
+ else {
+ pdfi_countdown(tmp);
+ tmp = NULL;
+ code = 0;
+ }
+
+ if (code <= 0) {
+ font->Encoding = spdffont->Encoding;
+ pdfi_countup(font->Encoding);
+ }
+
+ /* Since various aspects of the font may differ (widths, encoding, etc)
+ we cannot reliably use the UniqueID/XUID for copied fonts.
+ */
+ if (uid_is_XUID(&font->pfont->UID))
+ uid_free(&font->pfont->UID, font->pfont->memory, "pdfi_read_type1_font");
+ uid_set_invalid(&font->pfont->UID);
+
+ code = pdfi_font_generate_pseudo_XUID(ctx, font_dict, font->pfont);
+ if (code < 0) {
+ goto error;
+ }
+
+ if (ctx->args.ignoretounicode != true) {
+ code = pdfi_dict_get(ctx, font_dict, "ToUnicode", (pdf_obj **)&tmp);
+ if (code >= 0 && pdfi_type_of(tmp) == PDF_STREAM) {
+ pdf_cmap *tu = NULL;
+ code = pdfi_read_cmap(ctx, tmp, &tu);
+ pdfi_countdown(tmp);
+ tmp = (pdf_obj *)tu;
+ }
+ if (code < 0 || (tmp != NULL && pdfi_type_of(tmp) != PDF_CMAP)) {
+ pdfi_countdown(tmp);
+ tmp = NULL;
+ code = 0;
+ }
+ }
+ else {
+ tmp = NULL;
+ }
+ font->ToUnicode = tmp;
+
+ code = gs_definefont(ctx->font_dir, (gs_font *) font->pfont);
+ if (code < 0) {
+ goto error;
+ }
+
+ code = pdfi_fapi_passfont((pdf_font *) font, 0, NULL, NULL, NULL, 0);
+ if (code < 0) {
+ goto error;
+ }
+ /* object_num can be zero if the dictionary was defined inline */
+ if (font->object_num != 0) {
+ (void)replace_cache_entry(ctx, (pdf_obj *) font);
+ }
+
+ *tpdffont = (pdf_font *)font;
+
+error:
+ if (code < 0)
+ pdfi_countdown(font);
+ return code;
+}
+
+int
pdfi_free_font_cff(pdf_obj *font)
{
pdf_font_cff *pdfontcff = (pdf_font_cff *) font;
@@ -2913,8 +3080,8 @@ pdfi_free_font_cff(pdf_obj *font)
pdfi_countdown(pdfontcff->GlobalSubrs);
pdfi_countdown(pdfontcff->Encoding);
pdfi_countdown(pdfontcff->ToUnicode);
+ pdfi_countdown(pdfontcff->filename);
- gs_free_object(OBJ_MEMORY(font), pdfontcff->fake_glyph_names, "Type 2 fake_glyph_names");
gs_free_object(OBJ_MEMORY(font), pdfontcff->Widths, "Type 2 fontWidths");
gs_free_object(OBJ_MEMORY(font), pdfontcff, "pdfi_free_font_cff(pbfont)");
@@ -2948,8 +3115,9 @@ pdfi_free_font_cidtype0(pdf_obj *font)
pdfi_countdown(pdfont0->FDArray);
pdfi_countdown(pdfont0->registry);
pdfi_countdown(pdfont0->ordering);
+ pdfi_countdown(pdfont0->cidtogidmap);
+ pdfi_countdown(pdfont0->filename);
- gs_free_object(OBJ_MEMORY(font), pdfont0->cidtogidmap.data, "pdfi_free_font_cff(cidtogidmap.data)");
gs_free_object(OBJ_MEMORY(font), pdfont0, "pdfi_free_font_cff(pbfont)");
return 0;
diff --git a/pdf/pdf_font1C.h b/pdf/pdf_font1C.h
index e02b6342..ea8c7084 100644
--- a/pdf/pdf_font1C.h
+++ b/pdf/pdf_font1C.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019-2021 Artifex Software, Inc.
+/* Copyright (C) 2019-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -19,10 +19,11 @@
#define PDF_TYPE1C_FONT
int pdfi_read_type1C_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict, pdf_dict *page_dict, pdf_font **ppdffont);
int pdfi_cff_global_glyph_code(const gs_font *pfont, gs_const_string *gstr, gs_glyph *pglyph);
-int pdfi_free_font_cff(pdf_obj *font);
int pdfi_read_cff_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict, pdf_dict *page_dict, byte *pfbuf, int64_t fbuflen, bool forcecid, pdf_font **ppdffont);
+int pdfi_copy_cff_font(pdf_context *ctx, pdf_font *spdffont, pdf_dict *font_dict, pdf_font **tpdffont);
+int pdfi_free_font_cff(pdf_obj *font);
int pdfi_free_font_cidtype0(pdf_obj *font);
#endif
diff --git a/pdf/pdf_font3.c b/pdf/pdf_font3.c
index 7ecd3bff..708e7658 100644
--- a/pdf/pdf_font3.c
+++ b/pdf/pdf_font3.c
@@ -74,7 +74,7 @@ pdfi_type3_build_char(gs_show_enum * penum, gs_gstate * pgs, gs_font * pfont,
}
if (code < 0)
goto build_char_error;
- if (CharProc->type != PDF_STREAM) {
+ if (pdfi_type_of(CharProc) != PDF_STREAM) {
code = gs_note_error(gs_error_typecheck);
goto build_char_error;
}
@@ -223,6 +223,8 @@ int pdfi_free_font_type3(pdf_obj *font)
pdfi_countdown(t3font->CharProcs);
pdfi_countdown(t3font->Encoding);
pdfi_countdown(t3font->ToUnicode);
+ pdfi_countdown(t3font->filename); /* Should never exist, but just in case */
+
gs_free_object(OBJ_MEMORY(font), font, "Free type 3 font");
return 0;
}
@@ -230,10 +232,9 @@ int pdfi_free_font_type3(pdf_obj *font)
int pdfi_read_type3_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict, pdf_dict *page_dict, pdf_font **ppdffont)
{
- int code = 0, i, num_chars = 0;
+ int code = 0;
pdf_font_type3 *font = NULL;
pdf_obj *obj = NULL;
- double f;
pdf_obj *tounicode = NULL;
*ppdffont = NULL;
@@ -271,44 +272,15 @@ int pdfi_read_type3_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream
if (code < 0)
goto font3_error;
- code = pdfi_dict_get_number(ctx, font_dict, "FirstChar", &f);
- if (code < 0)
- goto font3_error;
- font->FirstChar = (int)f;
-
- code = pdfi_dict_get_number(ctx, font_dict, "LastChar", &f);
- if (code < 0)
- goto font3_error;
- font->LastChar = (int)f;
- num_chars = (font->LastChar - font->FirstChar) + 1;
code = pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, (pdf_obj **)&font->FontDescriptor);
if (code < 0)
goto font3_error;
- code = pdfi_dict_knownget_type(ctx, font_dict, "Widths", PDF_ARRAY, (pdf_obj **)&obj);
- if (code < 0)
- goto font3_error;
- if (code > 0) {
- if (num_chars != pdfi_array_size((pdf_array *)obj)) {
- code = gs_note_error(gs_error_rangecheck);
- goto font3_error;
- }
+ pdfi_font_set_first_last_char(ctx, font_dict, (pdf_font *)font);
+ /* ignore errors with widths... for now */
+ (void)pdfi_font_create_widths(ctx, font_dict, (pdf_font*)font, 1.0);
- font->Widths = (double *)gs_alloc_bytes(ctx->memory, sizeof(double) * num_chars, "type 3 font Widths array");
- if (font->Widths == NULL) {
- code = gs_note_error(gs_error_VMerror);
- goto font3_error;
- }
- memset(font->Widths, 0x00, sizeof(double) * num_chars);
- for (i = 0; i < num_chars; i++) {
- code = pdfi_array_get_number(ctx, (pdf_array *)obj, (uint64_t)i, &font->Widths[i]);
- if (code < 0)
- goto font3_error;
- }
- }
- pdfi_countdown(obj);
- obj = NULL;
code = pdfi_dict_get(ctx, font_dict, "Encoding", &obj);
if (code < 0)
@@ -324,13 +296,13 @@ int pdfi_read_type3_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream
if (ctx->args.ignoretounicode != true) {
code = pdfi_dict_get(ctx, font_dict, "ToUnicode", (pdf_obj **)&tounicode);
- if (code >= 0 && tounicode->type == PDF_STREAM) {
+ if (code >= 0 && pdfi_type_of(tounicode) == PDF_STREAM) {
pdf_cmap *tu = NULL;
code = pdfi_read_cmap(ctx, tounicode, &tu);
pdfi_countdown(tounicode);
tounicode = (pdf_obj *)tu;
}
- if (code < 0 || (tounicode != NULL && tounicode->type != PDF_CMAP)) {
+ if (code < 0 || (tounicode != NULL && pdfi_type_of(tounicode) != PDF_CMAP)) {
pdfi_countdown(tounicode);
tounicode = NULL;
code = 0;
diff --git a/pdf/pdf_fontTT.c b/pdf/pdf_fontTT.c
index aec3ee7b..d7d43e62 100644
--- a/pdf/pdf_fontTT.c
+++ b/pdf/pdf_fontTT.c
@@ -44,12 +44,12 @@ pdfi_ttf_string_proc(gs_font_type42 * pfont, ulong offset, uint length, const by
pdf_font_truetype *ttfont = (pdf_font_truetype *)pfont->client_data;
int code = 0;
- if ((uint64_t)offset + length > ttfont->sfnt.size) {
+ if ((uint64_t)offset + length > ttfont->sfnt->length) {
*pdata = NULL;
code = gs_note_error(gs_error_invalidfont);
}
else {
- *pdata = ttfont->sfnt.data + offset;
+ *pdata = ttfont->sfnt->data + offset;
}
return code;
}
@@ -356,11 +356,10 @@ static int pdfi_set_type42_data_procs(gs_font_type42 *pfont)
int pdfi_read_truetype_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict, pdf_dict *page_dict, byte *buf, int64_t buflen, int findex, pdf_font **ppdffont)
{
pdf_font_truetype *font = NULL;
- int code = 0, num_chars = 0, i;
+ int code = 0, i;
pdf_obj *fontdesc = NULL;
pdf_obj *obj = NULL;
pdf_obj *basefont = NULL;
- double f;
int64_t descflags;
bool encoding_known = false;
bool forced_symbolic = false;
@@ -371,96 +370,71 @@ int pdfi_read_truetype_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str
*ppdffont = NULL;
- code = pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, &fontdesc);
- if (code <= 0) {
- code = gs_note_error(gs_error_invalidfont);
- goto error;
- }
+ if (font_dict != NULL)
+ (void)pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, &fontdesc);
if ((code = pdfi_alloc_tt_font(ctx, &font, false)) < 0) {
code = gs_note_error(gs_error_invalidfont);
goto error;
}
- font->object_num = font_dict->object_num;
- font->generation_num = font_dict->generation_num;
- font->indirect_num = font_dict->indirect_num;
- font->indirect_gen = font_dict->indirect_gen;
+ if (font_dict != NULL) {
+ font->object_num = font_dict->object_num;
+ font->generation_num = font_dict->generation_num;
+ font->indirect_num = font_dict->indirect_num;
+ font->indirect_gen = font_dict->indirect_gen;
+ }
font->FontDescriptor = (pdf_dict *)fontdesc;
fontdesc = NULL;
- code = pdfi_dict_get_number(ctx, font_dict, "FirstChar", &f);
+ pdfi_font_set_first_last_char(ctx, font_dict, (pdf_font *)font);
+
+ code = pdfi_object_alloc(ctx, PDF_BUFFER, 0, (pdf_obj **)&font->sfnt);
if (code < 0) {
goto error;
}
- font->FirstChar = (int)f;
-
- code = pdfi_dict_get_number(ctx, font_dict, "LastChar", &f);
+ pdfi_countup(font->sfnt);
+ code = pdfi_buffer_set_data((pdf_obj *)font->sfnt, buf, buflen);
if (code < 0) {
goto error;
}
- font->LastChar = (int)f;
-
- num_chars = font->LastChar - font->FirstChar + 1;
-
- font->sfnt.data = buf;
- font->sfnt.size = buflen;
buf = NULL;
/* Strictly speaking BaseFont is required, but we can continue without one */
- code = pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, (pdf_obj **)&basefont);
- if (code > 0) {
- pdf_name *nobj = (pdf_name *)basefont;
- int nlen = nobj->length > gs_font_name_max ? gs_font_name_max : nobj->length;
-
- memcpy(font->pfont->key_name.chars, nobj->data, nlen);
- font->pfont->key_name.chars[nlen] = 0;
- font->pfont->key_name.size = nlen;
- memcpy(font->pfont->font_name.chars, nobj->data, nlen);
- font->pfont->font_name.chars[nlen] = 0;
- font->pfont->font_name.size = nlen;
- pdfi_countdown(obj);
- obj = NULL;
+ if (font_dict != NULL) {
+ code = pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, (pdf_obj **)&basefont);
+ if (code > 0) {
+ pdf_name *nobj = (pdf_name *)basefont;
+ int nlen = nobj->length > gs_font_name_max ? gs_font_name_max : nobj->length;
+
+ memcpy(font->pfont->key_name.chars, nobj->data, nlen);
+ font->pfont->key_name.chars[nlen] = 0;
+ font->pfont->key_name.size = nlen;
+ memcpy(font->pfont->font_name.chars, nobj->data, nlen);
+ font->pfont->font_name.chars[nlen] = 0;
+ font->pfont->font_name.size = nlen;
+ pdfi_countdown(obj);
+ obj = NULL;
+ }
}
font->BaseFont = basefont;
basefont = NULL;
font->PDF_font = font_dict;
pdfi_countup(font_dict);
- code = pdfi_dict_knownget_type(ctx, font_dict, "Widths", PDF_ARRAY, (pdf_obj **)&obj);
- if (code < 0)
- goto error;
- if (code > 0) {
- if (num_chars != pdfi_array_size((pdf_array *)obj)) {
- code = gs_note_error(gs_error_rangecheck);
- goto error;
- }
-
- font->Widths = (double *)gs_alloc_bytes(ctx->memory, sizeof(double) * num_chars, "truetype font Widths array");
- if (font->Widths == NULL) {
- code = gs_note_error(gs_error_VMerror);
- goto error;
- }
- memset(font->Widths, 0x00, sizeof(double) * num_chars);
- for (i = 0; i < num_chars; i++) {
- code = pdfi_array_get_number(ctx, (pdf_array *)obj, (uint64_t)i, &font->Widths[i]);
- if (code < 0)
- goto error;
- font->Widths[i] /= 1000;
- }
- }
- pdfi_countdown(obj);
- obj = NULL;
+ /* ignore errors with widths... for now */
+ if (font_dict != NULL)
+ (void)pdfi_font_create_widths(ctx, font_dict, (pdf_font*)font, 0.001);
- if (ctx->args.ignoretounicode != true) {
+ if (ctx->args.ignoretounicode != true && font_dict != NULL) {
code = pdfi_dict_get(ctx, font_dict, "ToUnicode", (pdf_obj **)&tounicode);
- if (code >= 0 && tounicode->type == PDF_STREAM) {
+ if (code >= 0 && pdfi_type_of(tounicode) == PDF_STREAM) {
pdf_cmap *tu = NULL;
code = pdfi_read_cmap(ctx, tounicode, &tu);
pdfi_countdown(tounicode);
tounicode = (pdf_obj *)tu;
}
- if (code < 0 || (tounicode != NULL && tounicode->type != PDF_CMAP)) {
+ if (code < 0 || (tounicode != NULL && pdfi_type_of(tounicode) != PDF_CMAP)) {
pdfi_countdown(tounicode);
tounicode = NULL;
code = 0;
@@ -472,11 +446,20 @@ int pdfi_read_truetype_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str
font->ToUnicode = tounicode;
tounicode = NULL;
- code = pdfi_dict_get_int(ctx, font->FontDescriptor, "Flags", &descflags);
- if (code < 0)
+ if (font->FontDescriptor != NULL) {
+ code = pdfi_dict_get_int(ctx, font->FontDescriptor, "Flags", &descflags);
+ if (code < 0)
+ descflags = 0;
+ }
+ else {
descflags = 0;
+ }
+
+ if (font_dict != NULL)
+ code = pdfi_dict_get(ctx, font_dict, "Encoding", &obj);
+ else
+ code = gs_error_undefined;
- code = pdfi_dict_get(ctx, font_dict, "Encoding", &obj);
if (code < 0) {
static const char encstr[] = "WinAnsiEncoding";
code = pdfi_name_alloc(ctx, (byte *)encstr, strlen(encstr), (pdf_obj **)&obj);
@@ -508,13 +491,6 @@ int pdfi_read_truetype_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str
pdfi_countdown(obj);
obj = NULL;
- font->fake_glyph_names = (gs_string *)gs_alloc_bytes(OBJ_MEMORY(font), font->LastChar * sizeof(gs_string), "pdfi_read_truetype_font: fake_glyph_names");
- if (!font->fake_glyph_names) {
- code = gs_note_error(gs_error_VMerror);
- goto error;
- }
- memset(font->fake_glyph_names, 0x00, font->LastChar * sizeof(gs_string));
-
code = gs_type42_font_init((gs_font_type42 *)font->pfont, 0);
if (code < 0) {
goto error;
@@ -565,7 +541,9 @@ int pdfi_read_truetype_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str
font->descflags = descflags;
}
else if (encoding_known == true) {
- static const char encstr[] = "WinAnsiEncoding";
+ static const char mrencstr[] = "MacRomanEncoding";
+ static const char waencstr[] = "WinAnsiEncoding";
+ const char *encstr = ((cmaps_available & CMAP_TABLE_31_PRESENT) == CMAP_TABLE_31_PRESENT) ? waencstr : mrencstr;
font->descflags = descflags & ~4;
code = pdfi_name_alloc(ctx, (byte *)encstr, strlen(encstr), (pdf_obj **)&obj);
if (code >= 0)
@@ -586,12 +564,30 @@ int pdfi_read_truetype_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *str
font->descflags = descflags;
}
+ if (uid_is_XUID(&font->pfont->UID))
+ uid_free(&font->pfont->UID, font->pfont->memory, "pdfi_read_type1_font");
+ uid_set_invalid(&font->pfont->UID);
+
+ code = pdfi_font_generate_pseudo_XUID(ctx, font_dict, font->pfont);
+ if (code < 0) {
+ goto error;
+ }
+
+ if ((font->descflags & 4) == 0) {
+ /* Horrid hacky solution */
+ /* We don't want to draw the TTF notdef */
+ gs_font_type42 *gst42 = ((gs_font_type42 *)font->pfont);
+ if (gst42->data.len_glyphs != NULL && gst42->data.len_glyphs[0] > 10) {
+ gst42->data.len_glyphs[0] = 0;
+ }
+ }
+
code = gs_definefont(ctx->font_dir, (gs_font *)font->pfont);
if (code < 0) {
goto error;
}
- code = pdfi_fapi_passfont((pdf_font *)font, 0, NULL, NULL, font->sfnt.data, font->sfnt.size);
+ code = pdfi_fapi_passfont((pdf_font *)font, 0, NULL, NULL, font->sfnt->data, font->sfnt->length);
if (code < 0) {
goto error;
}
@@ -613,30 +609,175 @@ error:
return code;
}
+int
+pdfi_copy_truetype_font(pdf_context *ctx, pdf_font *spdffont, pdf_dict *font_dict, pdf_font **tpdffont)
+{
+ int code = 0;
+ pdf_font_truetype *font = NULL;
+ gs_font_type42 *spfont1 = (gs_font_type42 *) spdffont->pfont;
+ gs_font_type42 *dpfont42;
+ gs_id t_id;
+ pdf_obj *tmp;
+
+ if (font_dict == NULL)
+ return_error(gs_error_invalidfont);
+
+ code = pdfi_alloc_tt_font(ctx, &font, font_dict->object_num);
+ if (code < 0)
+ return code;
+ dpfont42 = (gs_font_type42 *) font->pfont;
+
+ t_id = dpfont42->id;
+ memcpy(dpfont42, spfont1, sizeof(gs_font_type42));
+ dpfont42->id = t_id;
+ dpfont42->FAPI = NULL;
+ dpfont42->FAPI_font_data = NULL;
+ dpfont42->notify_list.memory = NULL;
+ dpfont42->notify_list.first = NULL;
+ gs_notify_init(&dpfont42->notify_list, dpfont42->memory);
+
+ memcpy(font, spdffont, sizeof(pdf_font_truetype));
+ font->refcnt = 1;
+ font->filename = NULL;
+
+ font->pfont = (gs_font_base *)dpfont42;
+ dpfont42->client_data = (void *)font;
+
+ font->PDF_font = font_dict;
+ font->object_num = font_dict->object_num;
+ font->generation_num = font_dict->generation_num;
+ pdfi_countup(font->PDF_font);
+
+ /* We want basefont and descriptor, but we can live without them */
+ font->BaseFont = NULL;
+ (void)pdfi_dict_knownget_type(ctx, font_dict, "BaseFont", PDF_NAME, &font->BaseFont);
+ font->FontDescriptor = NULL;
+ (void)pdfi_dict_knownget_type(ctx, font_dict, "FontDescriptor", PDF_DICT, (pdf_obj **)&font->FontDescriptor);
+
+ pdfi_countup(font->sfnt);
+
+ if (font->BaseFont != NULL && ((pdf_name *)font->BaseFont)->length <= gs_font_name_max) {
+ memcpy(dpfont42->key_name.chars, ((pdf_name *)font->BaseFont)->data, ((pdf_name *)font->BaseFont)->length);
+ dpfont42->key_name.size = ((pdf_name *)font->BaseFont)->length;
+ memcpy(dpfont42->font_name.chars, ((pdf_name *)font->BaseFont)->data, ((pdf_name *)font->BaseFont)->length);
+ dpfont42->font_name.size = ((pdf_name *)font->BaseFont)->length;
+ }
+
+ font->Encoding = NULL;
+ font->ToUnicode = NULL;
+ font->Widths = NULL;
+
+ pdfi_font_set_first_last_char(ctx, font_dict, (pdf_font *)font);
+ (void)pdfi_font_create_widths(ctx, font_dict, (pdf_font*)font, (double)0.001);
+
+ font->descflags = 0;
+ if (font->FontDescriptor != NULL) {
+ code = pdfi_dict_get_int(ctx, font->FontDescriptor, "Flags", &font->descflags);
+ if (code >= 0) {
+ /* If both the symbolic and non-symbolic flag are set,
+ believe that latter.
+ */
+ if ((font->descflags & 32) != 0)
+ font->descflags = (font->descflags & ~4);
+ }
+ }
+
+ tmp = NULL;
+ code = pdfi_dict_knownget(ctx, font_dict, "Encoding", &tmp);
+ if (code == 1) {
+ if ((pdfi_type_of(tmp) == PDF_NAME || pdfi_type_of(tmp) == PDF_DICT) && (font->descflags & 4) == 0) {
+ code = pdfi_create_Encoding(ctx, tmp, NULL, (pdf_obj **) & font->Encoding);
+ }
+ else if (pdfi_type_of(tmp) == PDF_DICT && (font->descflags & 4) != 0) {
+ code = pdfi_create_Encoding(ctx, tmp, (pdf_obj *)spdffont->Encoding, (pdf_obj **) &font->Encoding);
+ }
+ pdfi_countdown(tmp);
+ tmp = NULL;
+ }
+ else {
+ pdfi_countdown(tmp);
+ tmp = NULL;
+ code = 0;
+ }
+ if (code < 0) {
+ goto error;
+ }
+
+ /* Since various aspects of the font may differ (widths, encoding, etc)
+ we cannot reliably use the UniqueID/XUID for copied fonts.
+ */
+ if (uid_is_XUID(&font->pfont->UID))
+ uid_free(&font->pfont->UID, font->pfont->memory, "pdfi_read_type1_font");
+ uid_set_invalid(&font->pfont->UID);
+
+ code = pdfi_font_generate_pseudo_XUID(ctx, font_dict, font->pfont);
+ if (code < 0) {
+ goto error;
+ }
+
+ if (code <= 0) {
+ font->Encoding = spdffont->Encoding;
+ pdfi_countup(font->Encoding);
+ }
+
+ if (ctx->args.ignoretounicode != true) {
+ code = pdfi_dict_get(ctx, font_dict, "ToUnicode", (pdf_obj **)&tmp);
+ if (code >= 0 && pdfi_type_of(tmp) == PDF_STREAM) {
+ pdf_cmap *tu = NULL;
+ code = pdfi_read_cmap(ctx, tmp, &tu);
+ pdfi_countdown(tmp);
+ tmp = (pdf_obj *)tu;
+ }
+ if (code < 0 || (tmp != NULL && pdfi_type_of(tmp) != PDF_CMAP)) {
+ pdfi_countdown(tmp);
+ tmp = NULL;
+ code = 0;
+ }
+ }
+ else {
+ tmp = NULL;
+ }
+ font->ToUnicode = tmp;
+ code = gs_definefont(ctx->font_dir, (gs_font *) font->pfont);
+ if (code < 0) {
+ goto error;
+ }
+
+ code = pdfi_fapi_passfont((pdf_font *) font, 0, NULL, NULL, NULL, 0);
+ if (code < 0) {
+ goto error;
+ }
+ /* object_num can be zero if the dictionary was defined inline */
+ if (font->object_num != 0) {
+ (void)replace_cache_entry(ctx, (pdf_obj *) font);
+ }
+
+ *tpdffont = (pdf_font *)font;
+
+error:
+ if (code < 0)
+ pdfi_countdown(font);
+ return code;
+}
+
int pdfi_free_font_truetype(pdf_obj *font)
{
pdf_font_truetype *ttfont = (pdf_font_truetype *)font;
- int i;
+
if (ttfont->pfont)
gs_free_object(OBJ_MEMORY(ttfont), ttfont->pfont, "Free TrueType gs_font");
if (ttfont->Widths)
gs_free_object(OBJ_MEMORY(ttfont), ttfont->Widths, "Free TrueType font Widths array");
- if (ttfont->fake_glyph_names != NULL) {
- for (i = 0; i < ttfont->LastChar; i++) {
- if (ttfont->fake_glyph_names[i].data != NULL)
- gs_free_object(OBJ_MEMORY(ttfont), ttfont->fake_glyph_names[i].data, "Free TrueType fake_glyph_name");
- }
- }
- gs_free_object(OBJ_MEMORY(ttfont), ttfont->fake_glyph_names, "Free TrueType fake_glyph_names");
- gs_free_object(OBJ_MEMORY(ttfont), ttfont->sfnt.data, "Free TrueType font sfnt buffer");
-
+ pdfi_countdown(ttfont->sfnt);
pdfi_countdown(ttfont->FontDescriptor);
pdfi_countdown(ttfont->Encoding);
pdfi_countdown(ttfont->BaseFont);
pdfi_countdown(ttfont->PDF_font);
pdfi_countdown(ttfont->ToUnicode);
+ pdfi_countdown(ttfont->filename);
+
gs_free_object(OBJ_MEMORY(ttfont), ttfont, "Free TrueType font");
return 0;
diff --git a/pdf/pdf_fontTT.h b/pdf/pdf_fontTT.h
index 90e4086e..14932f66 100644
--- a/pdf/pdf_fontTT.h
+++ b/pdf/pdf_fontTT.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019-2021 Artifex Software, Inc.
+/* Copyright (C) 2019-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -19,6 +19,7 @@
#define PDF_TRUETYPE_FONT
int pdfi_read_truetype_font(pdf_context *ctx, pdf_dict *font_dict, pdf_dict *stream_dict, pdf_dict *page_dict, byte *buf, int64_t buflen, int findex, pdf_font **ppdffont);
+int pdfi_copy_truetype_font(pdf_context *ctx, pdf_font *spdffont, pdf_dict *font_dict, pdf_font **tpdffont);
int pdfi_free_font_truetype(pdf_obj *font);
#endif
diff --git a/pdf/pdf_font_types.h b/pdf/pdf_font_types.h
index f83a0851..f29088f5 100644
--- a/pdf/pdf_font_types.h
+++ b/pdf/pdf_font_types.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019-2021 Artifex Software, Inc.
+/* Copyright (C) 2019-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -84,18 +84,18 @@ typedef enum pdf_font_type_e {
pdf_dict *PDF_font; /* The original font dictionary from the PDF file */\
pdf_obj *BaseFont; /* Should be a name object, but best allow for strings as well */\
pdf_dict *FontDescriptor; /* For PDF up to 1.4 this may be absent for the base 14 */ \
- int64_t descflags
-
+ int64_t descflags; \
+ pdf_obj *ToUnicode; /* Name or stream (technically should be a stream, but we've seen Identity names */ \
+ pdf_string *filename /* If we read this from disk, this is the file it came from */
#define pdf_font_common \
pdf_font_base;\
pdf_obj *Name; /* Should be a name object, but best allow for strings as well */\
unsigned int FirstChar; /* For PDF up to 1.4 this may be absent for the base 14 */\
unsigned int LastChar; /* For PDF up to 1.4 this may be absent for the base 14 */\
- double *Widths; /* For PDF up to 1.4 this may be absent for the base 14 */\
- pdf_array *Encoding; /* Array built from name or dictionary */\
- pdf_obj *ToUnicode; /* Name or stream (technically should be a stream, but we've seen Identity names */ \
- gs_string *fake_glyph_names /* For when we encounter a glyph not in the Encoding */
+ double MissingWidth; \
+ double *Widths; /* For PDF up to 1.4 this may be absent for the base 14 */\
+ pdf_array *Encoding /* Array built from name or dictionary */\
/* The registry and ordering strings in gs_font_cid0_data are just references to
@@ -112,7 +112,7 @@ typedef enum pdf_font_type_e {
pdf_string *registry; \
pdf_string *ordering; \
int supplement; \
- gs_string cidtogidmap; \
+ pdf_buffer *cidtogidmap; \
bool substitute; /* We need to know what a CIDFont is a substitute */ \
font_proc_glyph_info((*orig_glyph_info))
@@ -147,16 +147,14 @@ typedef struct pdf_font_type0_s {
pdf_obj *Encoding; /* CMap */
pdf_array *DescendantFonts; /* A single element array specifying the CIDFont dictionary */
- pdf_obj *ToUnicode; /* Name or stream (technically shoudl be a stream, but we've seen Identity names */
pdfi_cid_decoding_t *decoding; /* Used when substituting a non-Identity CIDFont */
pdfi_cid_subst_nwp_table_t *substnwp; /* Also used for CIDFont substitions */
} pdf_font_type0;
typedef struct pdf_font_type1_s {
pdf_font_common;
- gs_string *Subrs;
+ pdf_array *Subrs;
pdf_dict *CharStrings;
- int NumSubrs;
/* Multiple Master Support - weightvector is stored in gs_font_type1 */
pdf_array *blenddesignpositions;
pdf_array *blenddesignmap;
@@ -171,11 +169,6 @@ typedef struct pdf_font_cff_s {
pdf_array *GlobalSubrs;
int NumGlobalSubrs;
pdf_dict *CharStrings;
- byte *cffdata;
- byte *cffend;
- byte *gsubrs;
- byte *subrs;
- byte *charstrings;
int ncharstrings;
} pdf_font_cff;
@@ -197,7 +190,7 @@ typedef enum {
typedef struct pdf_font_truetype_s {
pdf_font_common;
- gs_string sfnt;
+ pdf_buffer *sfnt;
pdfi_truetype_cmap cmap;
} pdf_font_truetype;
@@ -212,11 +205,6 @@ typedef struct pdf_cidfont_type0_s {
pdf_array *GlobalSubrs;
int NumGlobalSubrs;
pdf_dict *CharStrings;
- byte *cffdata;
- byte *cffend;
- byte *gsubrs;
- byte *subrs;
- byte *charstrings;
int ncharstrings;
pdf_array *FDArray;
int cidcount;
@@ -225,7 +213,7 @@ typedef struct pdf_cidfont_type0_s {
typedef struct pdf_cidfont_type2_s {
pdf_cid_font_common;
- gs_string sfnt;
+ pdf_buffer *sfnt;
} pdf_cidfont_type2;
#endif
diff --git a/pdf/pdf_fontps.c b/pdf/pdf_fontps.c
index 3ab399b9..5cfa1652 100644
--- a/pdf/pdf_fontps.c
+++ b/pdf/pdf_fontps.c
@@ -885,7 +885,7 @@ ps_font_def_func(gs_memory_t *mem, pdf_ps_ctx_t *s, byte *buf, byte *bufend)
}
}
if (code >= 0) {
- pdfi_array_put(s->pdfi_ctx, priv->u.t1.blenddesignpositions, i, (pdf_obj *)sa);
+ code = pdfi_array_put(s->pdfi_ctx, priv->u.t1.blenddesignpositions, i, (pdf_obj *)sa);
}
pdfi_countdown(sa);
}
@@ -1045,21 +1045,14 @@ ps_font_array_func(gs_memory_t *mem, pdf_ps_ctx_t *s, byte *buf, byte *bufend)
!memcmp(s->cur[-1].val.name, PDF_PS_OPER_NAME_AND_LEN("Subrs"))) {
if (s->cur[0].val.i > 0) {
- if (priv->u.t1.Subrs != NULL) {
- int i;
- for (i = 0; i < priv->u.t1.NumSubrs; i++) {
- gs_free_object(mem, priv->u.t1.Subrs[i].data, "ps_font_array_func(Subrs[i])");
- }
- gs_free_object(mem, priv->u.t1.Subrs, "ps_font_array_func(Subrs)");
- }
+ pdfi_countdown(priv->u.t1.Subrs);
- priv->u.t1.Subrs = (gs_string *) gs_alloc_bytes(mem, s->cur[0].val.i *sizeof(gs_string), "ps_font_array_func(Subrs)");
- if (priv->u.t1.Subrs == NULL) {
- return_error(gs_error_VMerror);
+ code = pdfi_object_alloc(s->pdfi_ctx, PDF_ARRAY, (unsigned int)s->cur[0].val.i, (pdf_obj **)&priv->u.t1.Subrs);
+ if (code < 0) {
+ return code;
}
- memset(priv->u.t1.Subrs, 0x00, s->cur[0].val.i * sizeof(gs_string));
+ pdfi_countup(priv->u.t1.Subrs);
}
- priv->u.t1.NumSubrs = s->cur[0].val.i;
code = pdf_ps_stack_pop(s, 1);
}
else if (pdf_ps_obj_has_type(&s->cur[-1], PDF_PS_OBJ_NAME) &&
@@ -1162,14 +1155,18 @@ pdf_ps_RD_oper_func(gs_memory_t *mem, pdf_ps_ctx_t *s, byte *buf, byte *bufend)
size = s->cur[0].val.i;
buf++;
if (buf + size < bufend) {
- priv->u.t1.Subrs[inx].data =
- gs_alloc_bytes(mem, size, "pdf_ps_RD_oper_func(subr string)");
- if (priv->u.t1.Subrs[inx].data == NULL) {
- (void)pdf_ps_stack_pop(s, 2);
- return_error(gs_error_VMerror);
+ pdf_string *subr_str;
+
+ code = pdfi_object_alloc(s->pdfi_ctx, PDF_STRING, (unsigned int)size, (pdf_obj **)&subr_str);
+ if (code < 0) {
+ return code;
}
- memcpy(priv->u.t1.Subrs[inx].data, buf, size);
- priv->u.t1.Subrs[inx].size = size;
+ memcpy(subr_str->data, buf, size);
+ pdfi_countup(subr_str);
+ code = pdfi_array_put(s->pdfi_ctx, priv->u.t1.Subrs, inx, (pdf_obj *)subr_str);
+ pdfi_countdown(subr_str);
+ if (code < 0)
+ return code;
}
}
}
@@ -1282,7 +1279,7 @@ pdfi_read_ps_font(pdf_context *ctx, pdf_dict *font_dict, byte *fbuf, int fbuflen
and that can end up in a stackoverflow error, even though we have a complete font. Override it
and let the Type 1 specific code decide for itself if it can use the font.
*/
- if (code == gs_error_stackoverflow)
+ if (code == gs_error_pdf_stackoverflow)
code = 0;
return code;
diff --git a/pdf/pdf_fontps.h b/pdf/pdf_fontps.h
index 835f0066..79ba2aef 100644
--- a/pdf/pdf_fontps.h
+++ b/pdf/pdf_fontps.h
@@ -208,7 +208,7 @@ static inline int pdf_ps_stack_push(pdf_ps_ctx_t *s)
}
s->cur++;
if (pdf_ps_obj_has_type(s->cur, PDF_PS_OBJ_STACK_TOP))
- return_error(gs_error_stackoverflow);
+ return_error(gs_error_pdf_stackoverflow);
if (pdf_ps_obj_has_type(s->cur, PDF_PS_OBJ_STACK_BOTTOM))
return_error(gs_error_stackunderflow);
return 0;
@@ -239,7 +239,7 @@ static inline int pdf_ps_stack_pop(pdf_ps_ctx_t *s, unsigned int n)
pdf_ps_make_null(s->cur);
s->cur--;
if (pdf_ps_obj_has_type(s->cur, PDF_PS_OBJ_STACK_TOP))
- return_error(gs_error_stackoverflow);
+ return_error(gs_error_pdf_stackoverflow);
if (pdf_ps_obj_has_type(s->cur, PDF_PS_OBJ_STACK_BOTTOM))
return_error(gs_error_stackunderflow);
}
diff --git a/pdf/pdf_func.c b/pdf/pdf_func.c
index 9537152e..2aaf1eea 100644
--- a/pdf/pdf_func.c
+++ b/pdf/pdf_func.c
@@ -157,6 +157,15 @@ pdfi_parse_type4_func_stream(pdf_context *ctx, pdf_c_stream *function_stream, in
if (c < 0)
break;
switch(c) {
+ case '%':
+ do {
+ c = pdfi_read_byte(ctx, function_stream);
+ if (c < 0)
+ break;
+ if (c == 0x0a || c == 0x0d)
+ break;
+ }while (1);
+ break;
case 0x20:
case 0x0a:
case 0x0d:
@@ -296,7 +305,7 @@ pdfi_build_function_4(pdf_context *ctx, gs_function_params_t * mnDR,
params.ops.data = 0; /* in case of failure */
params.ops.size = 0; /* ditto */
- if (function_obj->type != PDF_STREAM)
+ if (pdfi_type_of(function_obj) != PDF_STREAM)
return_error(gs_error_undefined);
Length = pdfi_stream_length(ctx, (pdf_stream *)function_obj);
@@ -378,7 +387,7 @@ pdfi_build_function_0(pdf_context *ctx, gs_function_params_t * mnDR,
params.Size = params.array_step = params.stream_step = NULL;
params.Order = 0;
- if (function_obj->type != PDF_STREAM)
+ if (pdfi_type_of(function_obj) != PDF_STREAM)
return_error(gs_error_undefined);
code = pdfi_dict_from_obj(ctx, (pdf_obj *)function_obj, &function_dict);
@@ -444,7 +453,7 @@ pdfi_build_function_0(pdf_context *ctx, gs_function_params_t * mnDR,
code = pdfi_make_int_array_from_dict(ctx, (int **)&params.Size, function_dict, "Size");
if (code != params.m) {
- if (code > 0)
+ if (code >= 0)
code = gs_error_rangecheck;
goto function_0_error;
}
@@ -560,6 +569,20 @@ pdfi_build_function_3(pdf_context *ctx, gs_function_params_t * mnDR,
params.Functions = (const gs_function_t * const *)ptr;
+ code = pdfi_make_float_array_from_dict(ctx, (float **)&params.Bounds, function_dict, "Bounds");
+ if (code < 0)
+ goto function_3_error;
+
+ code = pdfi_make_float_array_from_dict(ctx, (float **)&params.Encode, function_dict, "Encode");
+ if (code < 0)
+ goto function_3_error;
+
+ if (code != 2 * params.k) {
+ code = gs_note_error(gs_error_rangecheck);
+ goto function_3_error;
+ }
+ code = 0;
+
for (i = 0; i < params.k; ++i) {
pdf_obj * rsubfn = NULL;
@@ -578,23 +601,12 @@ pdfi_build_function_3(pdf_context *ctx, gs_function_params_t * mnDR,
if (code < 0)
goto function_3_error;
- code = pdfi_build_sub_function(ctx, &ptr[i], shading_domain, num_inputs, rsubfn, page_dict);
+ code = pdfi_build_sub_function(ctx, &ptr[i], &params.Encode[i * 2], num_inputs, rsubfn, page_dict);
pdfi_countdown(rsubfn);
if (code < 0)
goto function_3_error;
}
- code = pdfi_make_float_array_from_dict(ctx, (float **)&params.Bounds, function_dict, "Bounds");
- if (code < 0)
- goto function_3_error;
-
- code = pdfi_make_float_array_from_dict(ctx, (float **)&params.Encode, function_dict, "Encode");
- if (code < 0)
- goto function_3_error;
-
- if (code != 2 * params.k)
- goto function_3_error;
-
if (params.Range == 0)
params.n = params.Functions[0]->params.n;
@@ -619,6 +631,7 @@ static int pdfi_build_sub_function(pdf_context *ctx, gs_function_t ** ppfn, cons
int64_t Type;
gs_function_params_t params;
pdf_dict *stream_dict;
+ int obj_num;
params.Range = params.Domain = NULL;
@@ -626,10 +639,11 @@ static int pdfi_build_sub_function(pdf_context *ctx, gs_function_t ** ppfn, cons
if (code < 0)
return code;
- if (stream_obj->object_num != 0) {
- if (pdfi_loop_detector_check_object(ctx, stream_obj->object_num))
+ obj_num = pdf_object_num(stream_obj);
+ if (obj_num != 0) {
+ if (pdfi_loop_detector_check_object(ctx, obj_num))
return gs_note_error(gs_error_circular_reference);
- code = pdfi_loop_detector_add_object(ctx, stream_obj->object_num);
+ code = pdfi_loop_detector_add_object(ctx, obj_num);
if (code < 0)
goto sub_function_error;
}
diff --git a/pdf/pdf_gstate.c b/pdf/pdf_gstate.c
index c1444b4b..5248bd40 100644
--- a/pdf/pdf_gstate.c
+++ b/pdf/pdf_gstate.c
@@ -44,6 +44,8 @@
#include "gscoord.h" /* For gs_concat() */
#include "gsutil.h" /* For gs_next_ids() */
#include "gscolor3.h" /* For gs_setsmoothness() */
+#include "gzpath.h"
+#include "gspenum.h"
static const char *blend_mode_names[] = {
GS_BLEND_MODE_NAMES, 0
@@ -158,8 +160,7 @@ pdfi_gstate_set_client(pdf_context *ctx, gs_gstate *pgs)
int pdfi_concat(pdf_context *ctx)
{
- int i, code;
- pdf_num *num;
+ int code;
double Values[6];
gs_matrix m;
@@ -171,28 +172,18 @@ int pdfi_concat(pdf_context *ctx)
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_concat", NULL);
- for (i=0;i < 6;i++){
- num = (pdf_num *)ctx->stack_top[i - 6];
- if (num->type != PDF_INT) {
- if(num->type != PDF_REAL) {
- pdfi_pop(ctx, 6);
- return_error(gs_error_typecheck);
- }
- else
- Values[i] = num->value.d;
- } else {
- Values[i] = (double)num->value.i;
- }
- }
+ code = pdfi_destack_reals(ctx, Values, 6);
+ if (code < 0)
+ return code;
+
m.xx = (float)Values[0];
m.xy = (float)Values[1];
m.yx = (float)Values[2];
m.yy = (float)Values[3];
m.tx = (float)Values[4];
m.ty = (float)Values[5];
- code = gs_concat(ctx->pgs, (const gs_matrix *)&m);
- pdfi_pop(ctx, 6);
- return code;
+
+ return gs_concat(ctx->pgs, (const gs_matrix *)&m);
}
int pdfi_op_q(pdf_context *ctx)
@@ -216,7 +207,6 @@ int pdfi_op_q(pdf_context *ctx)
int pdfi_op_Q(pdf_context *ctx)
{
int code = 0;
- gx_path *ppath = NULL;
#if DEBUG_GSAVE
dbgmprintf(ctx->memory, "(doing Q)\n"); /* TODO: Spammy, delete me at some point */
@@ -232,30 +222,7 @@ int pdfi_op_Q(pdf_context *ctx)
return code;
}
- /* Section 4.4.1 of the 3rd Edition PDF_Refrence Manual, p226 of the 1.7 version
- * states that the current path is **NOT** part of the graphics state and is not
- * saved and restored along with the other graphics state parameters. So here
- * we need to indulge in some ugliness. We take a copy of the current path
- * before we do a grestore, and below we assign the copy to the graphics state
- * after the grestore, thus preserving it unchanged. This is still better than
- * the 'PDF interpreter written in PostScript' method.
- */
- ppath = gx_path_alloc_shared(ctx->pgs->path, ctx->memory, "temporary current path copy for Q");
- if (ppath == NULL)
- return_error(gs_error_VMerror);
-
- code = pdfi_grestore(ctx);
-
- if (code >= 0) {
- /* Put the path back, and make sure current point is properly set */
- code = gx_path_assign_preserve(ctx->pgs->path, ppath);
- if (gx_path_position_valid(ctx->pgs->path))
- gx_setcurrentpoint_from_path(ctx->pgs, ctx->pgs->path);
- }
-
- gx_path_free(ppath, "temporary current path copy for Q");
-
- return code;
+ return pdfi_grestore(ctx);
}
/* We want pdfi_grestore() so we can track and warn of "too many Qs"
@@ -296,86 +263,60 @@ int pdfi_gs_setgstate(gs_gstate * pgs, const gs_gstate * pfrom)
int pdfi_setlinewidth(pdf_context *ctx)
{
int code;
- pdf_num *n1;
double d1;
if (pdfi_count_stack(ctx) < 1)
return_error(gs_error_stackunderflow);
- n1 = (pdf_num *)ctx->stack_top[-1];
- if (n1->type == PDF_INT){
- d1 = (double)n1->value.i;
- } else{
- if (n1->type == PDF_REAL) {
- d1 = n1->value.d;
- } else {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- }
- code = gs_setlinewidth(ctx->pgs, d1);
- pdfi_pop(ctx, 1);
- return code;
+ code = pdfi_destack_real(ctx, &d1);
+ if (code < 0)
+ return code;
+
+ return gs_setlinewidth(ctx->pgs, d1);
}
int pdfi_setlinejoin(pdf_context *ctx)
{
int code;
- pdf_num *n1;
+ int64_t i;
if (pdfi_count_stack(ctx) < 1)
return_error(gs_error_stackunderflow);
- n1 = (pdf_num *)ctx->stack_top[-1];
- if (n1->type == PDF_INT){
- code = gs_setlinejoin(ctx->pgs, n1->value.i);
- } else {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- pdfi_pop(ctx, 1);
- return code;
+ code = pdfi_destack_int(ctx, &i);
+ if (code < 0)
+ return code;
+
+ return gs_setlinejoin(ctx->pgs, (int)i);
}
int pdfi_setlinecap(pdf_context *ctx)
{
int code;
- pdf_num *n1;
+ int64_t i;
if (pdfi_count_stack(ctx) < 1)
return_error(gs_error_stackunderflow);
- n1 = (pdf_num *)ctx->stack_top[-1];
- if (n1->type == PDF_INT){
- code = gs_setlinecap(ctx->pgs, n1->value.i);
- } else {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- pdfi_pop(ctx, 1);
- return code;
+ code = pdfi_destack_int(ctx, &i);
+ if (code < 0)
+ return code;
+
+ return gs_setlinecap(ctx->pgs, i);
}
int pdfi_setflat(pdf_context *ctx)
{
int code;
- pdf_num *n1;
double d1;
if (pdfi_count_stack(ctx) < 1)
return_error(gs_error_stackunderflow);
- n1 = (pdf_num *)ctx->stack_top[-1];
- if (n1->type == PDF_INT){
- d1 = (double)n1->value.i;
- } else{
- if (n1->type == PDF_REAL) {
- d1 = n1->value.d;
- } else {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- }
+ code = pdfi_destack_real(ctx, &d1);
+ if (code < 0)
+ return code;
+
/* PDF spec says the value is 1-100, with 0 meaning "use the default"
* But gs code (and now our code) forces the value to be <= 1
* This matches what Adobe and evince seem to do (see Bug 555657).
@@ -384,9 +325,7 @@ int pdfi_setflat(pdf_context *ctx)
*/
if (d1 > 1.0)
d1 = 1.0;
- code = gs_setflat(ctx->pgs, d1);
- pdfi_pop(ctx, 1);
- return code;
+ return gs_setflat(ctx->pgs, d1);
}
int pdfi_setdash_impl(pdf_context *ctx, pdf_array *a, double phase_d)
@@ -412,9 +351,9 @@ int pdfi_setdash_impl(pdf_context *ctx, pdf_array *a, double phase_d)
gs_free_object(ctx->memory, dash_array, "error in setdash");
return code;
}
+
int pdfi_setdash(pdf_context *ctx)
{
- pdf_num *phase;
pdf_array *a;
double phase_d;
int code;
@@ -424,52 +363,47 @@ int pdfi_setdash(pdf_context *ctx)
return_error(gs_error_stackunderflow);
}
- phase = (pdf_num *)ctx->stack_top[-1];
- if (phase->type == PDF_INT){
- phase_d = (double)phase->value.i;
- } else{
- if (phase->type == PDF_REAL) {
- phase_d = phase->value.d;
- } else {
- pdfi_pop(ctx, 2);
- return_error(gs_error_typecheck);
- }
+ code = pdfi_destack_real(ctx, &phase_d);
+ if (code < 0) {
+ pdfi_pop(ctx, 1);
+ return code;
}
- a = (pdf_array *)ctx->stack_top[-2];
- if (a->type != PDF_ARRAY) {
- pdfi_pop(ctx, 2);
+ a = (pdf_array *)ctx->stack_top[-1];
+ pdfi_countup(a);
+ pdfi_pop(ctx, 1);
+
+ if (pdfi_type_of(a) != PDF_ARRAY) {
+ pdfi_countdown(a);
return_error(gs_error_typecheck);
}
code = pdfi_setdash_impl(ctx, a, phase_d);
- pdfi_pop(ctx, 2);
+ pdfi_countdown(a);
return code;
}
int pdfi_setmiterlimit(pdf_context *ctx)
{
int code;
- pdf_num *n1;
double d1;
if (pdfi_count_stack(ctx) < 1)
return_error(gs_error_stackunderflow);
- n1 = (pdf_num *)ctx->stack_top[-1];
- if (n1->type == PDF_INT){
- d1 = (double)n1->value.i;
- } else{
- if (n1->type == PDF_REAL) {
- d1 = n1->value.d;
- } else {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- }
- code = gs_setmiterlimit(ctx->pgs, d1);
- pdfi_pop(ctx, 1);
- return code;
+ code = pdfi_destack_real(ctx, &d1);
+ if (code < 0)
+ return code;
+
+ /* PostScript (and therefore the graphics library) impose a minimum
+ * value of 1.0 on miter limit. PDF does not specify a minimum, but less
+ * than 1 doesn't make a lot of sense. This code brought over from the old
+ * PDF interpreter which silently clamped the value to 1.
+ */
+ if (d1 < 1.0)
+ d1 = 1.0;
+
+ return gs_setmiterlimit(ctx->pgs, d1);
}
static int GS_LW(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
@@ -569,38 +503,36 @@ static int GS_RI(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict
static int GS_OP(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
{
- pdf_bool *b = NULL;
+ bool b;
int code;
bool known=false;
- code = pdfi_dict_get_type(ctx, GS, "OP", PDF_BOOL, (pdf_obj **)&b);
+ code = pdfi_dict_get_bool(ctx, GS, "OP", &b);
if (code < 0)
return code;
- gs_setstrokeoverprint(ctx->pgs, b->value);
+ gs_setstrokeoverprint(ctx->pgs, b);
/* If op not in the dict, then also set it with OP
* Because that's what gs does pdf_draw.ps/gsparamdict/OP
*/
code = pdfi_dict_known(ctx, GS, "op", &known);
if (!known)
- gs_setfilloverprint(ctx->pgs, b->value);
+ gs_setfilloverprint(ctx->pgs, b);
- pdfi_countdown(b);
return 0;
}
static int GS_op(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
{
- pdf_bool *b;
+ bool b;
int code;
- code = pdfi_dict_get_type(ctx, GS, "op", PDF_BOOL, (pdf_obj **)&b);
+ code = pdfi_dict_get_bool(ctx, GS, "op", &b);
if (code < 0)
return code;
- gs_setfilloverprint(ctx->pgs, b->value);
- pdfi_countdown(b);
+ gs_setfilloverprint(ctx->pgs, b);
return 0;
}
@@ -652,46 +584,45 @@ static int pdfi_set_blackgeneration(pdf_context *ctx, pdf_obj *obj, pdf_dict *pa
int code = 0, i;
gs_function_t *pfn;
- if (obj->type == PDF_NAME) {
- if (pdfi_name_is((const pdf_name *)obj, "Identity")) {
- code = gs_setblackgeneration_remap(ctx->pgs, gs_identity_transfer, false);
- goto exit;
- } else {
- if (!is_BG && pdfi_name_is((const pdf_name *)obj, "Default")) {
+ switch (pdfi_type_of(obj)) {
+ case PDF_NAME:
+ if (pdfi_name_is((const pdf_name *)obj, "Identity"))
+ code = gs_setblackgeneration_remap(ctx->pgs, gs_identity_transfer, false);
+ else if (!is_BG && pdfi_name_is((const pdf_name *)obj, "Default")) {
code = gs_setblackgeneration_remap(ctx->pgs, ctx->page.DefaultBG.proc, false);
memcpy(ctx->pgs->black_generation->values, ctx->page.DefaultBG.values, transfer_map_size * sizeof(frac));
- goto exit;
- } else {
+ } else
code = gs_note_error(gs_error_rangecheck);
- goto exit;
- }
- }
- } else {
- if (obj->type != PDF_DICT && obj->type != PDF_STREAM)
- return_error(gs_error_typecheck);
+ goto exit;
- code = pdfi_build_function(ctx, &pfn, NULL, 1, obj, page_dict);
- if (code < 0)
- return code;
+ case PDF_DICT:
+ case PDF_STREAM:
+ code = pdfi_build_function(ctx, &pfn, NULL, 1, obj, page_dict);
+ if (code < 0)
+ return code;
- gs_setblackgeneration_remap(ctx->pgs, gs_mapped_transfer, false);
- for (i = 0; i < transfer_map_size; i++) {
- float v, f;
+ gs_setblackgeneration_remap(ctx->pgs, gs_mapped_transfer, false);
+ for (i = 0; i < transfer_map_size; i++) {
+ float v, f;
- f = (1.0f / (transfer_map_size - 1)) * i;
+ f = (1.0f / (transfer_map_size - 1)) * i;
- code = gs_function_evaluate(pfn, (const float *)&f, &v);
- if (code < 0) {
- pdfi_free_function(ctx, pfn);
- return code;
+ code = gs_function_evaluate(pfn, (const float *)&f, &v);
+ if (code < 0) {
+ pdfi_free_function(ctx, pfn);
+ return code;
+ }
+
+ ctx->pgs->black_generation->values[i] =
+ (v < 0.0 ? float2frac(0.0) :
+ v >= 1.0 ? frac_1 :
+ float2frac(v));
}
+ code = pdfi_free_function(ctx, pfn);
+ break;
- ctx->pgs->black_generation->values[i] =
- (v < 0.0 ? float2frac(0.0) :
- v >= 1.0 ? frac_1 :
- float2frac(v));
- }
- code = pdfi_free_function(ctx, pfn);
+ default:
+ return_error(gs_error_typecheck);
}
exit:
return code;
@@ -741,46 +672,52 @@ static int pdfi_set_undercolorremoval(pdf_context *ctx, pdf_obj *obj, pdf_dict *
int code = 0, i;
gs_function_t *pfn;
- if (obj->type == PDF_NAME) {
- if (pdfi_name_is((const pdf_name *)obj, "Identity")) {
- code = gs_setundercolorremoval_remap(ctx->pgs, gs_identity_transfer, false);
- goto exit;
- } else {
- if (!is_BG && pdfi_name_is((const pdf_name *)obj, "Default")) {
+ switch (pdfi_type_of(obj)) {
+ case PDF_NAME:
+ if (pdfi_name_is((const pdf_name *)obj, "Identity")) {
+ code = gs_setundercolorremoval_remap(ctx->pgs, gs_identity_transfer, false);
+ } else if (!is_BG && pdfi_name_is((const pdf_name *)obj, "Default")) {
code = gs_setundercolorremoval_remap(ctx->pgs, ctx->page.DefaultUCR.proc, false);
memcpy(ctx->pgs->undercolor_removal->values, ctx->page.DefaultUCR.values, transfer_map_size * sizeof(frac));
- goto exit;
} else {
code = gs_note_error(gs_error_rangecheck);
- goto exit;
}
- }
- } else {
- if (obj->type != PDF_DICT && obj->type != PDF_STREAM)
- return_error(gs_error_typecheck);
+ goto exit;
- code = pdfi_build_function(ctx, &pfn, NULL, 1, obj, page_dict);
- if (code < 0)
- return code;
+ case PDF_DICT:
+ case PDF_STREAM:
+ code = pdfi_build_function(ctx, &pfn, NULL, 1, obj, page_dict);
+ if (code < 0)
+ return code;
- gs_setundercolorremoval_remap(ctx->pgs, gs_mapped_transfer, false);
- for (i = 0; i < transfer_map_size; i++) {
- float v, f;
+ if (pfn->params.n == 1) {
+ gs_setundercolorremoval_remap(ctx->pgs, gs_mapped_transfer, false);
+ for (i = 0; i < transfer_map_size; i++) {
+ float v, f;
- f = (1.0f / (transfer_map_size - 1)) * i;
+ f = (1.0f / (transfer_map_size - 1)) * i;
- code = gs_function_evaluate(pfn, (const float *)&f, &v);
- if (code < 0) {
- pdfi_free_function(ctx, pfn);
- return code;
+ code = gs_function_evaluate(pfn, (const float *)&f, &v);
+ if (code < 0) {
+ pdfi_free_function(ctx, pfn);
+ return code;
+ }
+
+ ctx->pgs->undercolor_removal->values[i] =
+ (v < 0.0 ? float2frac(0.0) :
+ v >= 1.0 ? frac_1 :
+ float2frac(v));
+ }
+ code = pdfi_free_function(ctx, pfn);
+ }
+ else {
+ (void)pdfi_free_function(ctx, pfn);
+ code = gs_note_error(gs_error_rangecheck);
}
+ break;
- ctx->pgs->undercolor_removal->values[i] =
- (v < 0.0 ? float2frac(0.0) :
- v >= 1.0 ? frac_1 :
- float2frac(v));
- }
- code = pdfi_free_function(ctx, pfn);
+ default:
+ return_error(gs_error_typecheck);
}
exit:
return code;
@@ -852,12 +789,12 @@ static int pdfi_set_all_transfers(pdf_context *ctx, pdf_array *a, pdf_dict *page
code = pdfi_array_get(ctx, a, (uint64_t)i, &o);
if (code < 0)
goto exit;
- if (o->type == PDF_NAME) {
- if (pdfi_name_is((const pdf_name *)o, "Identity")) {
- proc_types[i] = E_IDENTITY;
- map_procs[i] = gs_identity_transfer;
- } else {
- if (!is_TR && pdfi_name_is((const pdf_name *)o, "Default")) {
+ switch (pdfi_type_of(o)) {
+ case PDF_NAME:
+ if (pdfi_name_is((const pdf_name *)o, "Identity")) {
+ proc_types[i] = E_IDENTITY;
+ map_procs[i] = gs_identity_transfer;
+ } else if (!is_TR && pdfi_name_is((const pdf_name *)o, "Default")) {
proc_types[i] = E_DEFAULT;
map_procs[i] = ctx->page.DefaultTransfers[i].proc;
} else {
@@ -865,9 +802,9 @@ static int pdfi_set_all_transfers(pdf_context *ctx, pdf_array *a, pdf_dict *page
code = gs_note_error(gs_error_typecheck);
goto exit;
}
- }
- } else {
- if (o->type == PDF_STREAM || o->type == PDF_DICT) {
+ break;
+ case PDF_STREAM:
+ case PDF_DICT:
proc_types[i] = E_FUNCTION;
map_procs[i] = gs_mapped_transfer;
code = pdfi_build_function(ctx, &pfn[i], NULL, 1, o, page_dict);
@@ -880,11 +817,11 @@ static int pdfi_set_all_transfers(pdf_context *ctx, pdf_array *a, pdf_dict *page
code = gs_note_error(gs_error_rangecheck);
goto exit;
}
- } else {
+ break;
+ default:
pdfi_countdown(o);
code = gs_note_error(gs_error_typecheck);
goto exit;
- }
}
pdfi_countdown(o);
}
@@ -954,7 +891,7 @@ static int pdfi_set_gray_transfer(pdf_context *ctx, pdf_obj *tr_obj, pdf_dict *p
int code = 0, i;
gs_function_t *pfn;
- if (tr_obj->type != PDF_DICT && tr_obj->type != PDF_STREAM)
+ if (pdfi_type_of(tr_obj) != PDF_DICT && pdfi_type_of(tr_obj) != PDF_STREAM)
return_error(gs_error_typecheck);
code = pdfi_build_function(ctx, &pfn, NULL, 1, tr_obj, page_dict);
@@ -990,7 +927,7 @@ static int pdfi_set_transfer(pdf_context *ctx, pdf_obj *obj, pdf_dict *page_dict
{
int code = 0;
- if (obj->type == PDF_NAME) {
+ if (pdfi_type_of(obj) == PDF_NAME) {
if (pdfi_name_is((const pdf_name *)obj, "Identity")) {
code = gs_settransfer_remap(ctx->pgs, gs_identity_transfer, false);
goto exit;
@@ -1006,7 +943,7 @@ static int pdfi_set_transfer(pdf_context *ctx, pdf_obj *obj, pdf_dict *page_dict
}
}
- if (obj->type == PDF_ARRAY) {
+ if (pdfi_type_of(obj) == PDF_ARRAY) {
if (pdfi_array_size((pdf_array *)obj) != 4) {
code = gs_note_error(gs_error_rangecheck);
goto exit;
@@ -1157,7 +1094,7 @@ error:
static int build_type1_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_dict *page_dict, gx_ht_order *porder, gs_halftone_component *phtc, char *name, int len, int comp_num)
{
- int code;
+ int code, i;
pdf_obj *obj = NULL, *transfer = NULL;
double f, a;
float values[2] = {0, 0}, domain[4] = {-1, 1, -1, 1}, out;
@@ -1193,46 +1130,48 @@ static int build_type1_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_d
}
memset(order, 0x00, sizeof(gx_ht_order));
- if (obj->type == PDF_NAME) {
- int i;
-
- if (pdfi_name_is((pdf_name *)obj, "Default")) {
- i = 0;
- } else {
- for (i = 0; i < (sizeof(spot_table) / sizeof (char *)); i++){
- if (pdfi_name_is((pdf_name *)obj, spot_table[i]))
- break;
+ switch (pdfi_type_of(obj)) {
+ case PDF_NAME:
+ if (pdfi_name_is((pdf_name *)obj, "Default")) {
+ i = 0;
+ } else {
+ for (i = 0; i < (sizeof(spot_table) / sizeof (char *)); i++) {
+ if (pdfi_name_is((pdf_name *)obj, spot_table[i]))
+ break;
+ }
+ if (i >= (sizeof(spot_table) / sizeof (char *)))
+ return gs_note_error(gs_error_rangecheck);
}
- if (i >= (sizeof(spot_table) / sizeof (char *)))
- return gs_note_error(gs_error_rangecheck);
- }
- code = pdfi_build_halftone_function(ctx, &pfn, (byte *)spot_functions[i], strlen(spot_functions[i]));
- if (code < 0)
- goto error;
- } else {
- if (obj->type == PDF_DICT || obj->type == PDF_STREAM) {
+ code = pdfi_build_halftone_function(ctx, &pfn, (byte *)spot_functions[i], strlen(spot_functions[i]));
+ if (code < 0)
+ goto error;
+ break;
+ case PDF_DICT:
+ case PDF_STREAM:
code = pdfi_build_function(ctx, &pfn, (const float *)domain, 2, obj, page_dict);
if (code < 0)
goto error;
- } else {
+ break;
+ default:
code = gs_note_error(gs_error_typecheck);
goto error;
- }
}
if (pdfi_dict_knownget(ctx, halftone_dict, "TransferFunction", &transfer) > 0) {
- if (transfer->type == PDF_NAME) {
- /* As far as I can tell, only /Identity is valid as a name, so we can just ignore
- * names, if it's not Identity it would be an error (which we would ignore) and if
- * it is, it has no effect. So what's the point ?
- */
- } else {
- if (transfer->type == PDF_STREAM) {
+ switch (pdfi_type_of(transfer)) {
+ case PDF_NAME:
+ /* As far as I can tell, only /Identity is valid as a name, so we can just ignore
+ * names, if it's not Identity it would be an error (which we would ignore) and if
+ * it is, it has no effect. So what's the point ?
+ */
+ break;
+ case PDF_STREAM:
pdfi_evaluate_transfer(ctx, transfer, page_dict, &pmap);
- } else {
+ break;
+ default:
/* should be an error, but we can just ignore it */
pdfi_set_warning(ctx, 0, NULL, W_PDF_TYPECHECK, "build_type1_halftone", NULL);
- }
+ break;
}
}
@@ -1557,7 +1496,7 @@ static int build_type5_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_d
* members.
*/
do {
- if (Key->type != PDF_NAME) {
+ if (pdfi_type_of(Key) != PDF_NAME) {
code = gs_note_error(gs_error_typecheck);
goto error;
}
@@ -1630,7 +1569,7 @@ static int build_type5_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_d
*/
ix = 1;
do {
- if (Key->type != PDF_NAME) {
+ if (pdfi_type_of(Key) != PDF_NAME) {
code = gs_note_error(gs_error_typecheck);
goto error;
}
@@ -1673,7 +1612,7 @@ static int build_type5_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_d
goto error;
break;
case 6:
- if (Value->type != PDF_STREAM) {
+ if (pdfi_type_of(Value) != PDF_STREAM) {
code = gs_note_error(gs_error_typecheck);
goto error;
}
@@ -1682,7 +1621,7 @@ static int build_type5_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_d
goto error;
break;
case 10:
- if (Value->type != PDF_STREAM) {
+ if (pdfi_type_of(Value) != PDF_STREAM) {
code = gs_note_error(gs_error_typecheck);
goto error;
}
@@ -1691,7 +1630,7 @@ static int build_type5_halftone(pdf_context *ctx, pdf_dict *halftone_dict, pdf_d
goto error;
break;
case 16:
- if (Value->type != PDF_STREAM) {
+ if (pdfi_type_of(Value) != PDF_STREAM) {
code = gs_note_error(gs_error_typecheck);
goto error;
}
@@ -1849,7 +1788,7 @@ static int pdfi_do_halftone(pdf_context *ctx, pdf_obj *halftone_obj, pdf_dict *p
break;
case 6:
- if (halftone_obj->type != PDF_STREAM)
+ if (pdfi_type_of(halftone_obj) != PDF_STREAM)
return_error(gs_error_typecheck);
phtc = (gs_halftone_component *)gs_alloc_bytes(ctx->memory, sizeof(gs_halftone_component), "pdfi_do_halftone");
if (phtc == 0) {
@@ -1870,22 +1809,24 @@ static int pdfi_do_halftone(pdf_context *ctx, pdf_obj *halftone_obj, pdf_dict *p
/* Transfer function pdht->order->transfer */
if (pdfi_dict_knownget(ctx, ((pdf_stream *)halftone_obj)->stream_dict, "TransferFunction", &transfer) > 0) {
- if (transfer->type == PDF_NAME) {
- /* As far as I can tell, only /Identity is valid as a name, so we can just ignore
- * names, if it's not Identity it would be an error (which we would ignore) and if
- * it is, it has no effect. So what's the point ?
- */
- } else {
- if (transfer->type == PDF_STREAM) {
+ switch (pdfi_type_of(transfer)) {
+ case PDF_NAME:
+ /* As far as I can tell, only /Identity is valid as a name, so we can just ignore
+ * names, if it's not Identity it would be an error (which we would ignore) and if
+ * it is, it has no effect. So what's the point ?
+ */
+ break;
+ case PDF_STREAM:
/* If we get an error here, we can just ignore it, and not apply the transfer */
code = pdfi_evaluate_transfer(ctx, transfer, page_dict, &pmap);
if (code >= 0) {
pdht->order.transfer = pmap;
}
- } else {
+ break;
+ default:
/* should be an error, but we can just ignore it */
pdfi_set_warning(ctx, 0, NULL, W_PDF_TYPECHECK, "do_halftone", NULL);
- }
+ break;
}
pdfi_countdown(transfer);
}
@@ -1901,7 +1842,7 @@ static int pdfi_do_halftone(pdf_context *ctx, pdf_obj *halftone_obj, pdf_dict *p
gx_unset_both_dev_colors(ctx->pgs);
break;
case 10:
- if (halftone_obj->type != PDF_STREAM)
+ if (pdfi_type_of(halftone_obj) != PDF_STREAM)
return_error(gs_error_typecheck);
phtc = (gs_halftone_component *)gs_alloc_bytes(ctx->memory, sizeof(gs_halftone_component), "pdfi_do_halftone");
if (phtc == 0) {
@@ -1922,22 +1863,24 @@ static int pdfi_do_halftone(pdf_context *ctx, pdf_obj *halftone_obj, pdf_dict *p
/* Transfer function pdht->order->transfer */
if (pdfi_dict_knownget(ctx, ((pdf_stream *)halftone_obj)->stream_dict, "TransferFunction", &transfer) > 0) {
- if (transfer->type == PDF_NAME) {
- /* As far as I can tell, only /Identity is valid as a name, so we can just ignore
- * names, if it's not Identity it would be an error (which we would ignore) and if
- * it is, it has no effect. So what's the point ?
- */
- } else {
- if (transfer->type == PDF_STREAM) {
+ switch (pdfi_type_of(transfer)) {
+ case PDF_NAME:
+ /* As far as I can tell, only /Identity is valid as a name, so we can just ignore
+ * names, if it's not Identity it would be an error (which we would ignore) and if
+ * it is, it has no effect. So what's the point ?
+ */
+ break;
+ case PDF_STREAM:
/* If we get an error here, we can just ignore it, and not apply the transfer */
code = pdfi_evaluate_transfer(ctx, transfer, page_dict, &pmap);
if (code >= 0) {
pdht->order.transfer = pmap;
}
- } else {
+ break;
+ default:
/* should be an error, but we can just ignore it */
pdfi_set_warning(ctx, 0, NULL, W_PDF_TYPECHECK, "do_halftone", NULL);
- }
+ break;
}
pdfi_countdown(transfer);
}
@@ -1953,7 +1896,7 @@ static int pdfi_do_halftone(pdf_context *ctx, pdf_obj *halftone_obj, pdf_dict *p
gx_unset_both_dev_colors(ctx->pgs);
break;
case 16:
- if (halftone_obj->type != PDF_STREAM)
+ if (pdfi_type_of(halftone_obj) != PDF_STREAM)
return_error(gs_error_typecheck);
phtc = (gs_halftone_component *)gs_alloc_bytes(ctx->memory, sizeof(gs_halftone_component), "pdfi_do_halftone");
if (phtc == 0) {
@@ -1974,22 +1917,24 @@ static int pdfi_do_halftone(pdf_context *ctx, pdf_obj *halftone_obj, pdf_dict *p
/* Transfer function pdht->order->transfer */
if (pdfi_dict_knownget(ctx, ((pdf_stream *)halftone_obj)->stream_dict, "TransferFunction", &transfer) > 0) {
- if (transfer->type == PDF_NAME) {
- /* As far as I can tell, only /Identity is valid as a name, so we can just ignore
- * names, if it's not Identity it would be an error (which we would ignore) and if
- * it is, it has no effect. So what's the point ?
- */
- } else {
- if (transfer->type == PDF_STREAM) {
+ switch (pdfi_type_of(transfer)) {
+ case PDF_NAME:
+ /* As far as I can tell, only /Identity is valid as a name, so we can just ignore
+ * names, if it's not Identity it would be an error (which we would ignore) and if
+ * it is, it has no effect. So what's the point ?
+ */
+ break;
+ case PDF_STREAM:
/* If we get an error here, we can just ignore it, and not apply the transfer */
code = pdfi_evaluate_transfer(ctx, transfer, page_dict, &pmap);
if (code >= 0) {
pdht->order.transfer = pmap;
}
- } else {
+ break;
+ default:
/* should be an error, but we can just ignore it */
pdfi_set_warning(ctx, 0, NULL, W_PDF_TYPECHECK, "do_halftone", NULL);
- }
+ break;
}
pdfi_countdown(transfer);
}
@@ -2034,7 +1979,7 @@ static int GS_HT(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict
return code;
- if (obj->type == PDF_NAME) {
+ if (pdfi_type_of(obj) == PDF_NAME) {
if (pdfi_name_is((const pdf_name *)obj, "Default")) {
goto exit;
} else {
@@ -2044,6 +1989,10 @@ static int GS_HT(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict
} else {
code = pdfi_do_halftone(ctx, obj, page_dict);
}
+ if (code < 0 && !ctx->args.pdfstoponerror) {
+ pdfi_set_error(ctx, code, NULL, E_BAD_HALFTONE, "GS_HT", "Halftone will be ignored");
+ code = 0;
+ }
exit:
pdfi_countdown(obj);
@@ -2078,33 +2027,51 @@ static int GS_SM(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict
static int GS_SA(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
{
- pdf_bool *b;
+ bool b;
int code;
- code = pdfi_dict_get_type(ctx, GS, "SA", PDF_BOOL, (pdf_obj **)&b);
+ code = pdfi_dict_get_bool(ctx, GS, "SA", &b);
if (code < 0)
return code;
- code = gs_setstrokeadjust(ctx->pgs, b->value);
- pdfi_countdown(b);
- return 0;
+ return gs_setstrokeadjust(ctx->pgs, b);
}
static int GS_BM(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
{
pdf_name *n;
int code;
- gs_blend_mode_t mode;
+ gs_blend_mode_t mode = 0; /* Start with /Normal */
- code = pdfi_dict_get_type(ctx, GS, "BM", PDF_NAME, (pdf_obj **)&n);
+ code = pdfi_dict_get(ctx, GS, "BM", (pdf_obj **)&n);
if (code < 0)
return code;
- code = pdfi_get_blend_mode(ctx, n, &mode);
- pdfi_countdown(n);
- if (code == 0)
+ if (pdfi_type_of(n) == PDF_ARRAY) {
+ int i;
+ pdf_array *a = (pdf_array *)n;
+
+ for (i=0;i < pdfi_array_size(a);i++){
+ code = pdfi_array_get_type(ctx, a, i, PDF_NAME, (pdf_obj **)&n);
+ if (code < 0)
+ continue;
+ code = pdfi_get_blend_mode(ctx, n, &mode);
+ pdfi_countdown(n);
+ if (code == 0)
+ break;
+ }
+ pdfi_countdown(a);
return gs_setblendmode(ctx->pgs, mode);
- return_error(gs_error_undefined);
+ }
+
+ if (pdfi_type_of(n) == PDF_NAME) {
+ code = pdfi_get_blend_mode(ctx, n, &mode);
+ pdfi_countdown(n);
+ if (code == 0)
+ return gs_setblendmode(ctx->pgs, mode);
+ return_error(gs_error_undefined);
+ }
+ return_error(gs_error_typecheck);
}
static int GS_SMask(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
@@ -2112,7 +2079,7 @@ static int GS_SMask(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_d
pdf_obj *o = NULL;
pdfi_int_gstate *igs = (pdfi_int_gstate *)ctx->pgs->client_data;
int code;
- pdf_bool *Processed = NULL;
+ bool Processed;
if (ctx->page.has_transparency == false || ctx->args.notransparency == true)
return 0;
@@ -2121,40 +2088,51 @@ static int GS_SMask(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_d
if (code < 0)
return code;
- if (o->type == PDF_NAME) {
- pdf_name *n = (pdf_name *)o;
+ switch (pdfi_type_of(o)) {
+ case PDF_NAME:
+ {
+ pdf_name *n = (pdf_name *)o;
- if (pdfi_name_is(n, "None")) {
- if (igs->SMask) {
- pdfi_gstate_smask_free(igs);
- code = pdfi_trans_end_smask_notify(ctx);
+ if (pdfi_name_is(n, "None")) {
+ if (igs->SMask) {
+ pdfi_gstate_smask_free(igs);
+ code = pdfi_trans_end_smask_notify(ctx);
+ }
+ goto exit;
}
- goto exit;
+ code = pdfi_find_resource(ctx, (unsigned char *)"ExtGState", n, stream_dict, page_dict, &o);
+ pdfi_countdown(n);
+ if (code < 0)
+ return code;
+ break;
}
- code = pdfi_find_resource(ctx, (unsigned char *)"ExtGState", n, stream_dict, page_dict, &o);
- pdfi_countdown(n);
- if (code < 0)
- return code;
- }
- if (o->type == PDF_DICT) {
- code = pdfi_dict_knownget_type(ctx, (pdf_dict *)o, "Processed", PDF_BOOL, (pdf_obj **)&Processed);
- /* Need to clear the Processed flag in the SMask if another value is set
- * (even if it's the same SMask?)
- * TODO: I think there is a better way to do this that doesn't require sticking this
- * flag in the SMask dictionary. But for now, let's get correct behavior.
- */
- if (code > 0 && Processed->value)
- Processed->value = false;
- if (igs->SMask)
- pdfi_gstate_smask_free(igs);
- /* We need to use the graphics state memory, in case we are running under Ghostscript. */
- pdfi_gstate_smask_install(igs, ctx->pgs->memory, (pdf_dict *)o, ctx->pgs);
+ case PDF_DICT:
+ {
+ code = pdfi_dict_knownget_bool(ctx, (pdf_dict *)o, "Processed", &Processed);
+ /* Need to clear the Processed flag in the SMask if another value is set
+ * (even if it's the same SMask?)
+ * TODO: I think there is a better way to do this that doesn't require sticking this
+ * flag in the SMask dictionary. But for now, let's get correct behavior.
+ */
+ if (code > 0 && Processed) {
+ code = pdfi_dict_put_bool(ctx, (pdf_dict *)o, "Processed", false);
+ if (code < 0)
+ return code;
+ }
+ if (igs->SMask)
+ pdfi_gstate_smask_free(igs);
+ /* We need to use the graphics state memory, in case we are running under Ghostscript. */
+ pdfi_gstate_smask_install(igs, ctx->pgs->memory, (pdf_dict *)o, ctx->pgs);
+ break;
+ }
+
+ default:
+ break;
}
exit:
pdfi_countdown(o);
- pdfi_countdown(Processed);
return 0;
}
@@ -2206,30 +2184,26 @@ static int GS_ca(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict
static int GS_AIS(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
{
- pdf_bool *b;
+ bool b;
int code;
- code = pdfi_dict_get_type(ctx, GS, "AIS", PDF_BOOL, (pdf_obj **)&b);
+ code = pdfi_dict_get_bool(ctx, GS, "AIS", &b);
if (code < 0)
return code;
- code = gs_setalphaisshape(ctx->pgs, b->value);
- pdfi_countdown(b);
- return 0;
+ return gs_setalphaisshape(ctx->pgs, b);
}
static int GS_TK(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict)
{
- pdf_bool *b;
+ bool b;
int code;
- code = pdfi_dict_get_type(ctx, GS, "TK", PDF_BOOL, (pdf_obj **)&b);
+ code = pdfi_dict_get_bool(ctx, GS, "TK", &b);
if (code < 0)
return code;
- code = gs_settextknockout(ctx->pgs, b->value);
- pdfi_countdown(b);
- return 0;
+ return gs_settextknockout(ctx->pgs, b);
}
typedef int (*GS_proc)(pdf_context *ctx, pdf_dict *GS, pdf_dict *stream_dict, pdf_dict *page_dict);
@@ -2293,7 +2267,7 @@ int pdfi_set_ExtGState(pdf_context *ctx, pdf_dict *stream_dict,
int pdfi_setgstate(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
{
- pdf_name *n;
+ pdf_name *n = NULL;
pdf_obj *o = NULL;
int code=0, code1 = 0;
@@ -2306,19 +2280,20 @@ int pdfi_setgstate(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
goto setgstate_error;
}
n = (pdf_name *)ctx->stack_top[-1];
- if (n->type != PDF_NAME) {
- pdfi_pop(ctx, 1);
+ pdfi_countup(n);
+ pdfi_pop(ctx, 1);
+
+ if (pdfi_type_of(n) != PDF_NAME) {
code = gs_note_error(gs_error_typecheck);
goto setgstate_error;
}
code = pdfi_find_resource(ctx, (unsigned char *)"ExtGState", n, (pdf_dict *)stream_dict,
page_dict, &o);
- pdfi_pop(ctx, 1);
if (code < 0)
goto setgstate_error;
- if (o->type != PDF_DICT) {
+ if (pdfi_type_of(o) != PDF_DICT) {
code = gs_note_error(gs_error_typecheck);
goto setgstate_error;
}
@@ -2329,6 +2304,7 @@ setgstate_error:
code1 = pdfi_loop_detector_cleartomark(ctx);
if (code == 0) code = code1;
+ pdfi_countdown(n);
pdfi_countdown(o);
return code;
}
diff --git a/pdf/pdf_image.c b/pdf/pdf_image.c
index 554cc344..43b70f56 100644
--- a/pdf/pdf_image.c
+++ b/pdf/pdf_image.c
@@ -173,7 +173,7 @@ pdfi_find_alternate(pdf_context *ctx, pdf_obj *alt)
int code;
bool flag;
- if (alt->type != PDF_ARRAY)
+ if (pdfi_type_of(alt) != PDF_ARRAY)
return NULL;
array = (pdf_array *)alt;
@@ -528,6 +528,10 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
}
info->BPC = 1;
}
+ else if (info->BPC != 1 && info->BPC != 2 && info->BPC != 4 && info->BPC != 8 && info->BPC != 16) {
+ code = gs_note_error(gs_error_rangecheck);
+ goto errorExit;
+ }
/* TODO: spec says if ImageMask is specified, and BPC is specified, then BPC must be 1
Should we flag an error if this is violated?
*/
@@ -541,11 +545,18 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
* GS implementation does.
*/
if (code != gs_error_undefined) {
- pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
if (ctx->args.pdfstoponwarning)
goto errorExit;
}
}
+ if (info->Mask != NULL && (pdfi_type_of(info->Mask) != PDF_ARRAY && pdfi_type_of(info->Mask) != PDF_STREAM)) {
+ pdfi_countdown(info->Mask);
+ info->Mask = NULL;
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
+ if (ctx->args.pdfstoponwarning)
+ goto errorExit;
+ }
/* Optional (apparently there is no abbreviation for "SMask"? */
code = pdfi_dict_get(ctx, image_dict, "SMask", &info->SMask);
@@ -558,7 +569,7 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
code = 0;
}
} else {
- if (info->SMask->type == PDF_NAME) {
+ if (pdfi_type_of(info->SMask) == PDF_NAME) {
pdf_obj *o = NULL;
code = pdfi_find_resource(ctx, (unsigned char *)"ExtGState", (pdf_name *)info->SMask, image_dict, page_dict, &o);
@@ -568,9 +579,12 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
}
}
- if (info->SMask->type != PDF_STREAM){
+ if (pdfi_type_of(info->SMask) != PDF_STREAM){
pdfi_countdown(info->SMask);
info->SMask = NULL;
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
+ if (ctx->args.pdfstoponwarning)
+ goto errorExit;
}
}
@@ -592,6 +606,13 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
if (code != gs_error_undefined)
goto errorExit;
}
+ if (info->ColorSpace != NULL && (pdfi_type_of(info->ColorSpace) != PDF_NAME && pdfi_type_of(info->ColorSpace) != PDF_ARRAY)) {
+ pdfi_countdown(info->ColorSpace);
+ info->ColorSpace = NULL;
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
+ if (ctx->args.pdfstoponwarning)
+ goto errorExit;
+ }
/* Optional (default is to use from graphics state) */
/* (no abbreviation for inline) */
@@ -607,6 +628,13 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
if (code != gs_error_undefined)
goto errorExit;
}
+ if (info->Alternates != NULL && pdfi_type_of(info->Alternates) != PDF_ARRAY) {
+ pdfi_countdown(info->Alternates);
+ info->Alternates = NULL;
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
+ if (ctx->args.pdfstoponwarning)
+ goto errorExit;
+ }
/* Optional (required in PDF1.0, obsolete, do we support?) */
code = pdfi_dict_get(ctx, image_dict, "Name", &info->Name);
@@ -614,6 +642,13 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
if (code != gs_error_undefined)
goto errorExit;
}
+ if (info->Name != NULL && pdfi_type_of(info->Name) != PDF_NAME) {
+ pdfi_countdown(info->Name);
+ info->Name = NULL;
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
+ if (ctx->args.pdfstoponwarning)
+ goto errorExit;
+ }
/* Required "if image is structural content item" */
/* TODO: Figure out what to do here */
@@ -629,6 +664,13 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
if (code != gs_error_undefined)
goto errorExit;
}
+ if (info->Decode != NULL && pdfi_type_of(info->Decode) != PDF_ARRAY) {
+ pdfi_countdown(info->Decode);
+ info->Decode = NULL;
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
+ if (ctx->args.pdfstoponwarning)
+ goto errorExit;
+ }
/* Optional "Optional Content" */
code = pdfi_dict_get_type(ctx, image_dict, "OC", PDF_DICT, (pdf_obj **)&info->OC);
@@ -643,10 +685,17 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
if (code != gs_error_undefined)
goto errorExit;
}
+ if (info->Filter != NULL && (pdfi_type_of(info->Filter) != PDF_NAME && pdfi_type_of(info->Filter) != PDF_ARRAY)) {
+ pdfi_countdown(info->Filter);
+ info->Filter = NULL;
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
+ if (ctx->args.pdfstoponwarning)
+ goto errorExit;
+ }
/* Check and set JPXDecode flag for later */
info->is_JPXDecode = false;
- if (info->Filter && info->Filter->type == PDF_NAME) {
+ if (info->Filter && pdfi_type_of(info->Filter) == PDF_NAME) {
if (pdfi_name_is((pdf_name *)info->Filter, "JPXDecode"))
info->is_JPXDecode = true;
}
@@ -657,6 +706,13 @@ pdfi_get_image_info(pdf_context *ctx, pdf_stream *image_obj,
if (code != gs_error_undefined)
goto errorExit;
}
+ if (info->DecodeParms != NULL && (pdfi_type_of(info->DecodeParms) != PDF_DICT && pdfi_type_of(info->DecodeParms) != PDF_ARRAY)) {
+ pdfi_countdown(info->DecodeParms);
+ info->DecodeParms = NULL;
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_IMAGEDICT, "pdfi_get_image_info", NULL);
+ if (ctx->args.pdfstoponwarning)
+ goto errorExit;
+ }
return 0;
@@ -987,6 +1043,9 @@ pdfi_do_image_smask(pdf_context *ctx, pdf_c_stream *source, pdfi_image_info_t *i
if (code < 0)
return code;
+ if (pdfi_type_of(image_info->SMask) != PDF_STREAM)
+ return_error(gs_error_typecheck);
+
if (image_info->SMask->object_num != 0) {
if (pdfi_loop_detector_check_object(ctx, image_info->SMask->object_num))
return gs_note_error(gs_error_circular_reference);
@@ -1018,22 +1077,23 @@ pdfi_do_image_smask(pdf_context *ctx, pdf_c_stream *source, pdfi_image_info_t *i
pdfi_seek(ctx, ctx->main_stream,
pdfi_stream_offset(ctx, (pdf_stream *)image_info->SMask), SEEK_SET);
- if (image_info->SMask->type == PDF_DICT) {
- code = pdfi_obj_dict_to_stream(ctx, (pdf_dict *)image_info->SMask, &stream_obj, false);
- if (code == 0) {
- code = pdfi_do_image_or_form(ctx, image_info->stream_dict,
- image_info->page_dict, (pdf_obj *)stream_obj);
+ switch (pdfi_type_of(image_info->SMask)) {
+ case PDF_DICT:
+ code = pdfi_obj_dict_to_stream(ctx, (pdf_dict *)image_info->SMask, &stream_obj, false);
+ if (code == 0) {
+ code = pdfi_do_image_or_form(ctx, image_info->stream_dict,
+ image_info->page_dict, (pdf_obj *)stream_obj);
- pdfi_countdown(stream_obj);
- }
- } else {
- if (image_info->SMask->type == PDF_STREAM)
+ pdfi_countdown(stream_obj);
+ }
+ break;
+ case PDF_STREAM:
code = pdfi_do_image_or_form(ctx, image_info->stream_dict,
image_info->page_dict, image_info->SMask);
- else {
+ break;
+ default:
code = gs_note_error(gs_error_typecheck);
goto exit;
- }
}
pdfi_seek(ctx, ctx->main_stream, savedoffset, SEEK_SET);
@@ -1434,7 +1494,7 @@ pdfi_image_get_color(pdf_context *ctx, pdf_c_stream *source, pdfi_image_info_t *
pcs, image_info->inline_image);
if (code < 0) {
dmprintf(ctx->memory, "WARNING: Image has unsupported ColorSpace ");
- if (ColorSpace->type == PDF_NAME) {
+ if (pdfi_type_of(ColorSpace) == PDF_NAME) {
pdf_name *name = (pdf_name *)ColorSpace;
char str[100];
int length = name->length;
@@ -1496,7 +1556,7 @@ pdfi_make_smask_dict(pdf_context *ctx, pdf_stream *image_stream, pdfi_image_info
goto exit;
}
- if (image_stream->type != PDF_STREAM) {
+ if (pdfi_type_of(image_stream) != PDF_STREAM) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -1623,7 +1683,7 @@ pdfi_do_image(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *stream_dict, pdf_
memset(&smask_info, 0, sizeof(mask_info));
/* Make sure the image is a stream (which we will assume in later code) */
- if (image_stream->type != PDF_STREAM)
+ if (pdfi_type_of(image_stream) != PDF_STREAM)
return_error(gs_error_typecheck);
if (!inline_image) {
@@ -1867,23 +1927,26 @@ pdfi_do_image(pdf_context *ctx, pdf_dict *page_dict, pdf_dict *stream_dict, pdf_
/* Get the Mask data either as an array or a dict, if present */
if (image_info.Mask != NULL) {
- if (image_info.Mask->type == PDF_ARRAY) {
- mask_array = (pdf_array *)image_info.Mask;
- } else if (image_info.Mask->type == PDF_STREAM) {
- mask_stream = (pdf_stream *)image_info.Mask;
- code = pdfi_get_image_info(ctx, mask_stream, page_dict,
- stream_dict, inline_image, &mask_info);
- if (code < 0)
- goto cleanupExit;
- } else {
- pdfi_countdown(image_info.Mask);
- image_info.Mask = NULL;
- pdfi_set_warning(ctx, 0, NULL, W_PDF_MASK_ERROR, "pdfi_do_image", NULL);
+ switch (pdfi_type_of(image_info.Mask)) {
+ case PDF_ARRAY:
+ mask_array = (pdf_array *)image_info.Mask;
+ break;
+ case PDF_STREAM:
+ mask_stream = (pdf_stream *)image_info.Mask;
+ code = pdfi_get_image_info(ctx, mask_stream, page_dict,
+ stream_dict, inline_image, &mask_info);
+ if (code < 0)
+ goto cleanupExit;
+ break;
+ default:
+ pdfi_countdown(image_info.Mask);
+ image_info.Mask = NULL;
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_MASK_ERROR, "pdfi_do_image", NULL);
}
}
/* Get the SMask info if we will need it (Type 3x images) */
- if (image_info.SMask && image_info.SMask->type == PDF_STREAM && ctx->device_state.preserve_smask) {
+ if (image_info.SMask && pdfi_type_of(image_info.SMask) == PDF_STREAM && ctx->device_state.preserve_smask) {
/* smask_dict non-NULL is used to flag a Type 3x image below */
smask_stream = (pdf_stream *)image_info.SMask;
code = pdfi_get_image_info(ctx, smask_stream, page_dict, stream_dict,
@@ -2305,7 +2368,7 @@ static int pdfi_form_stream_hack(pdf_context *ctx, pdf_dict *form_dict, pdf_stre
*hacked_stream = NULL;
- if (form_dict->type == PDF_STREAM)
+ if (pdfi_type_of(form_dict) == PDF_STREAM)
return 0;
if (!ctx->args.pdfstoponerror) {
@@ -2325,7 +2388,7 @@ static int pdfi_form_stream_hack(pdf_context *ctx, pdf_dict *form_dict, pdf_stre
pdfi_countup(d);
do {
code = pdfi_dict_knownget(ctx, d, "Parent", (pdf_obj **)&Parent);
- if (code > 0) {
+ if (code > 0 && pdfi_type_of(Parent) == PDF_DICT) {
if (Parent->object_num == stream_obj->object_num) {
pdfi_countdown(d);
pdfi_countdown(Parent);
@@ -2386,7 +2449,7 @@ static int pdfi_do_form(pdf_context *ctx, pdf_dict *page_dict, pdf_stream *form_
#if DEBUG_IMAGES
dbgmprintf(ctx->memory, "pdfi_do_form BEGIN\n");
#endif
- if (form_obj->type != PDF_STREAM) {
+ if (pdfi_type_of(form_obj) != PDF_STREAM) {
code = pdfi_form_stream_hack(ctx, (pdf_dict *)form_obj, &hacked_stream);
if (code < 0)
return code;
@@ -2530,10 +2593,15 @@ int pdfi_do_image_or_form(pdf_context *ctx, pdf_dict *stream_dict,
else
goto exit;
}
+ if (pdfi_type_of(n) != PDF_NAME) {
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
+ }
+
if (pdfi_name_is(n, "Image")) {
gs_offset_t savedoffset;
- if (xobject_obj->type != PDF_STREAM) {
+ if (pdfi_type_of(xobject_obj) != PDF_STREAM) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -2568,14 +2636,17 @@ int pdfi_Do(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
pdf_name *n = NULL;
pdf_obj *o = NULL;
pdf_dict *sdict = NULL;
- bool known = false;
+ bool known = false, AddedParent = false;
if (pdfi_count_stack(ctx) < 1) {
code = gs_note_error(gs_error_stackunderflow);
goto exit1;
}
n = (pdf_name *)ctx->stack_top[-1];
- if (n->type != PDF_NAME) {
+ pdfi_countup(n);
+ pdfi_pop(ctx, 1);
+
+ if (pdfi_type_of(n) != PDF_NAME) {
code = gs_note_error(gs_error_typecheck);
goto exit1;
}
@@ -2590,7 +2661,7 @@ int pdfi_Do(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
if (code < 0)
goto exit;
- if (o->type != PDF_STREAM && o->type != PDF_DICT) {
+ if (pdfi_type_of(o) != PDF_STREAM && pdfi_type_of(o) != PDF_DICT) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -2610,9 +2681,11 @@ int pdfi_Do(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
code = pdfi_dict_put(ctx, sdict, "Parent", (pdf_obj *)stream_dict);
if (code < 0)
goto exit;
+ pdfi_countup(sdict);
+ AddedParent = true;
}
- code = pdfi_loop_detector_cleartomark(ctx);
+ (void)pdfi_loop_detector_cleartomark(ctx);
/* NOTE: Used to have a pdfi_gsave/pdfi_grestore around this, but it actually makes
* things render incorrectly (and isn't in the PS code).
* It also causes demo.ai.pdf to crash.
@@ -2627,15 +2700,21 @@ int pdfi_Do(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
// pdfi_gsave(ctx);
code = pdfi_do_image_or_form(ctx, stream_dict, page_dict, o);
// pdfi_grestore(ctx);
+ pdfi_countdown(n);
pdfi_countdown(o);
- pdfi_pop(ctx, 1);
+ if (AddedParent == true) {
+ if (code >= 0)
+ code = pdfi_dict_delete(ctx, sdict, "Parent");
+ else
+ (void)pdfi_dict_delete(ctx, sdict, "Parent");
+ pdfi_countdown(sdict);
+ }
return code;
exit:
(void)pdfi_loop_detector_cleartomark(ctx);
exit1:
- /* No need to countdown 'n' because that points to the stack object, and we're going to pop that */
+ pdfi_countdown(n);
pdfi_countdown(o);
- pdfi_pop(ctx, 1);
return code;
}
diff --git a/pdf/pdf_int.c b/pdf/pdf_int.c
index 9493922b..d32b3f7e 100644
--- a/pdf/pdf_int.c
+++ b/pdf/pdf_int.c
@@ -36,6 +36,7 @@
#include "pdf_trans.h"
#include "pdf_optcontent.h"
#include "pdf_sec.h"
+#include <stdlib.h>
#include "gsstate.h" /* for gs_gstate_free */
@@ -134,6 +135,7 @@ int pdfi_skip_eol(pdf_context *ctx, pdf_c_stream *s)
return 0;
if (c >= 0)
pdfi_unread_byte(ctx, s, (byte)c);
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_STREAM_BAD_KEYWORD, "pdfi_skip_eol", NULL);
return 0;
}
@@ -162,11 +164,14 @@ static float acrobat_compatible_atof(char *s)
}
if (*s == '.') {
+ float MAX = (MAX_FLOAT-9)/10;
float v = (float)i;
float n = 0;
float d = 1;
++s;
- while (*s >= '0' && *s <= '9') {
+ /* Bug 705211: Ensure that we don't overflow n here - just ignore any
+ * trailing digits after this. This will be plenty accurate enough. */
+ while (*s >= '0' && *s <= '9' && n <= MAX) {
n = 10 * n + (*s - '0');
d = 10 * d;
++s;
@@ -178,6 +183,83 @@ static float acrobat_compatible_atof(char *s)
}
}
+int pdfi_read_bare_int(pdf_context *ctx, pdf_c_stream *s, int *parsed_int)
+{
+ int index = 0;
+ int int_val = 0;
+ int negative = 0;
+
+restart:
+ pdfi_skip_white(ctx, s);
+
+ do {
+ int c = pdfi_read_byte(ctx, s);
+ if (c == EOFC)
+ break;
+
+ if (c < 0)
+ return_error(gs_error_ioerror);
+
+ if (iswhite(c)) {
+ break;
+ } else if (c == '%' && index == 0) {
+ pdfi_skip_comment(ctx, s);
+ goto restart;
+ } else if (isdelimiter(c)) {
+ pdfi_unread_byte(ctx, s, (byte)c);
+ break;
+ }
+
+ if (c >= '0' && c <= '9') {
+ int_val = int_val*10 + c - '0';
+ } else if (c == '.') {
+ goto error;
+ } else if (c == 'e' || c == 'E') {
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_NUM_EXPONENT, "pdfi_read_num", NULL);
+ goto error;
+ } else if (c == '-') {
+ /* Any - sign not at the start of the string indicates a malformed number. */
+ if (index != 0 || negative) {
+ pdfi_set_error(ctx, 0, NULL, E_PDF_MALFORMEDNUMBER, "pdfi_read_num", NULL);
+ if (ctx->args.pdfstoponerror)
+ return_error(gs_error_syntaxerror);
+ goto error;
+ }
+ negative = 1;
+ } else if (c == '+') {
+ if (index == 0) {
+ /* Just drop the + it's pointless, and it'll get in the way
+ * of our negation handling for floats. */
+ continue;
+ } else {
+ pdfi_set_error(ctx, 0, NULL, E_PDF_MALFORMEDNUMBER, "pdfi_read_num", NULL);
+ if (ctx->args.pdfstoponerror)
+ return_error(gs_error_syntaxerror);
+ goto error;
+ }
+ } else {
+ if (index > 0) {
+ pdfi_set_error(ctx, 0, NULL, E_PDF_MISSINGWHITESPACE, "pdfi_read_num", (char *)"Ignoring missing white space while parsing number");
+ if (ctx->args.pdfstoponerror)
+ return_error(gs_error_syntaxerror);
+ }
+ pdfi_unread_byte(ctx, s, (byte)c);
+ goto error;
+ }
+ if (++index > 255)
+ return_error(gs_error_syntaxerror);
+ } while(1);
+
+ *parsed_int = negative ? -int_val : int_val;
+ if (ctx->args.pdfdebug)
+ dmprintf1(ctx->memory, " %d", *parsed_int);
+ return (index > 0);
+
+error:
+ *parsed_int = 0;
+ return_error(gs_error_syntaxerror);
+}
+
static int pdfi_read_num(pdf_context *ctx, pdf_c_stream *s, uint32_t indirect_num, uint32_t indirect_gen)
{
byte Buffer[256];
@@ -297,12 +379,29 @@ static int pdfi_read_num(pdf_context *ctx, pdf_c_stream *s, uint32_t indirect_nu
pdfi_set_error_var(ctx, 0, NULL, E_PDF_MALFORMEDNUMBER, "pdfi_read_num", "Treating malformed number %s as 0", Buffer);
num->value.i = 0;
} else if (has_exponent) {
- float f;
- if (sscanf((char *)Buffer, "%g", &f) == 1) {
- num->value.d = f;
- } else {
+ float f, exp;
+ char *p = strstr((const char *)Buffer, "e");
+
+ if (p == NULL)
+ p = strstr((const char *)Buffer, "E");
+
+ if (p == NULL) {
pdfi_set_error_var(ctx, 0, NULL, E_PDF_MALFORMEDNUMBER, "pdfi_read_num", "Treating malformed float %s as 0", Buffer);
num->value.d = 0;
+ } else {
+ p++;
+
+ if (sscanf((char *)p, "%g", &exp) != 1 || exp > 38) {
+ pdfi_set_error_var(ctx, 0, NULL, E_PDF_MALFORMEDNUMBER, "pdfi_read_num", "Treating malformed float %s as 0", Buffer);
+ num->value.d = 0;
+ } else {
+ if (sscanf((char *)Buffer, "%g", &f) == 1) {
+ num->value.d = f;
+ } else {
+ pdfi_set_error_var(ctx, 0, NULL, E_PDF_MALFORMEDNUMBER, "pdfi_read_num", "Treating malformed float %s as 0", Buffer);
+ num->value.d = 0;
+ }
+ }
}
} else if (real) {
num->value.d = acrobat_compatible_atof((char *)Buffer);
@@ -443,6 +542,22 @@ static int pdfi_read_hexstring(pdf_context *ctx, pdf_c_stream *s, uint32_t indir
if (hex1 < 0)
break;
+ if (hex1 == '>') {
+ /* PDF Reference 1.7 page 56:
+ * "If the final digit of a hexadecimal string is missing that is,
+ * if there is an odd number of digits the final digit is assumed to be 0."
+ */
+ hex1 = 0x30;
+ if (!ishex(hex0) || !ishex(hex1)) {
+ code = gs_note_error(gs_error_syntaxerror);
+ goto exit;
+ }
+ Buffer[index] = (fromhex(hex0) << 4) + fromhex(hex1);
+ if (ctx->args.pdfdebug)
+ dmprintf1(ctx->memory, "%c", hex1);
+ break;
+ }
+
if (!ishex(hex0) || !ishex(hex1)) {
code = gs_note_error(gs_error_syntaxerror);
goto exit;
@@ -674,7 +789,7 @@ int pdfi_read_dict(pdf_context *ctx, pdf_c_stream *s, uint32_t indirect_num, uin
if (code == 0)
return_error(gs_error_syntaxerror);
- if (ctx->stack_top[-1]->type != PDF_DICT_MARK)
+ if (pdfi_type_of(ctx->stack_top[-1]) != PDF_DICT_MARK)
return_error(gs_error_typecheck);
depth = pdfi_count_stack(ctx);
@@ -708,18 +823,22 @@ int pdfi_skip_comment(pdf_context *ctx, pdf_c_stream *s)
return 0;
}
-/* This function is slightly misnamed, for some keywords we do
- * indeed read the keyword and return a PDF_KEYWORD object, but
- * for null, true, false and R we create an appropriate object
- * of that type (PDF_NULL, PDF_BOOL or PDF_INDIRECT_REF)
- * and return it instead.
- */
-static int pdfi_read_keyword(pdf_context *ctx, pdf_c_stream *s, uint32_t indirect_num, uint32_t indirect_gen)
+#define PARAM1(A) # A,
+#define PARAM2(A,B) A,
+static const char pdf_token_strings[][10] = {
+#include "pdf_tokens.h"
+};
+
+#define nelems(A) (sizeof(A)/sizeof(A[0]))
+
+typedef int (*bsearch_comparator)(const void *, const void *);
+
+int pdfi_read_bare_keyword(pdf_context *ctx, pdf_c_stream *s)
{
byte Buffer[256];
- unsigned short index = 0;
- int c, code;
- pdf_keyword *keyword;
+ int index = 0;
+ int c;
+ void *t;
pdfi_skip_white(ctx, s);
@@ -739,46 +858,94 @@ static int pdfi_read_keyword(pdf_context *ctx, pdf_c_stream *s, uint32_t indirec
if (index >= 255 || index == 0) {
if (ctx->args.pdfstoponerror)
return_error(gs_error_syntaxerror);
- strcpy((char *)Buffer, "KEYWORD_TOO_LONG");
- index = 16;
+ return TOKEN_INVALID_KEY;
}
- /* NB The code below uses 'Buffer', not the data stored in keyword->data to compare strings */
Buffer[index] = 0x00;
+ t = bsearch((const void *)Buffer,
+ (const void *)pdf_token_strings[TOKEN_INVALID_KEY+1],
+ nelems(pdf_token_strings)-(TOKEN_INVALID_KEY+1),
+ sizeof(pdf_token_strings[0]),
+ (bsearch_comparator)&strcmp);
+ if (t == NULL)
+ return TOKEN_INVALID_KEY;
- code = pdfi_object_alloc(ctx, PDF_KEYWORD, index, (pdf_obj **)&keyword);
- if (code < 0)
- return code;
+ if (ctx->args.pdfdebug)
+ dmprintf1(ctx->memory, " %s\n", Buffer);
- memcpy(keyword->data, Buffer, index);
- pdfi_countup(keyword);
+ return (((const char *)t) - pdf_token_strings[0]) / sizeof(pdf_token_strings[0]);
+}
- keyword->indirect_num = indirect_num;
- keyword->indirect_gen = indirect_gen;
+static pdf_key lookup_keyword(const byte *Buffer)
+{
+ void *t = bsearch((const void *)Buffer,
+ (const void *)pdf_token_strings[TOKEN_INVALID_KEY+1],
+ nelems(pdf_token_strings)-(TOKEN_INVALID_KEY+1),
+ sizeof(pdf_token_strings[0]),
+ (bsearch_comparator)&strcmp);
+ if (t == NULL)
+ return TOKEN_NOT_A_KEYWORD;
+
+ return (pdf_key)((((const char *)t) - pdf_token_strings[0]) /
+ sizeof(pdf_token_strings[0]));
+}
- if (ctx->args.pdfdebug)
- dmprintf1(ctx->memory, " %s\n", Buffer);
+/* This function is slightly misnamed. We read 'keywords' from
+ * the stream (including null, true, false and R), and will usually
+ * return them directly as TOKENs cast to be pointers. In the event
+ * that we can't match what we parse to a known keyword, we'll
+ * instead return a PDF_KEYWORD object. In the even that we parse
+ * an 'R', we will return a PDF_INDIRECT object.
+ */
+static int pdfi_read_keyword(pdf_context *ctx, pdf_c_stream *s, uint32_t indirect_num, uint32_t indirect_gen)
+{
+ byte Buffer[256];
+ unsigned short index = 0;
+ int c, code;
+ pdf_keyword *keyword;
+ pdf_key key;
- switch(Buffer[0]) {
- case 'K':
- if (keyword->length == 16 && memcmp(keyword->data, "KEYWORD_TOO_LONG", 16) == 0) {
- keyword->key = TOKEN_INVALID_KEY;
- }
+ pdfi_skip_white(ctx, s);
+
+ do {
+ c = pdfi_read_byte(ctx, s);
+ if (c < 0)
+ break;
+
+ if (iswhite(c) || isdelimiter(c)) {
+ pdfi_unread_byte(ctx, s, (byte)c);
break;
- case 'R':
- if (keyword->length == 1){
+ }
+ Buffer[index] = (byte)c;
+ index++;
+ } while (index < 255);
+
+ if (index >= 255 || index == 0) {
+ if (ctx->args.pdfstoponerror)
+ return_error(gs_error_syntaxerror);
+ key = (index >= 255 ? TOKEN_TOO_LONG : TOKEN_INVALID_KEY);
+ index = 0;
+ Buffer[0] = 0;
+ } else {
+ Buffer[index] = 0x00;
+ key = lookup_keyword(Buffer);
+
+ if (ctx->args.pdfdebug)
+ dmprintf1(ctx->memory, " %s\n", Buffer);
+
+ switch (key) {
+ case TOKEN_R:
+ {
pdf_indirect_ref *o;
uint64_t obj_num;
uint32_t gen_num;
- pdfi_countdown(keyword);
-
if(pdfi_count_stack(ctx) < 2) {
pdfi_clearstack(ctx);
return_error(gs_error_stackunderflow);
}
- if(((pdf_obj *)ctx->stack_top[-1])->type != PDF_INT || ((pdf_obj *)ctx->stack_top[-2])->type != PDF_INT) {
+ if(pdfi_type_of(ctx->stack_top[-1]) != PDF_INT || pdfi_type_of(ctx->stack_top[-2]) != PDF_INT) {
pdfi_clearstack(ctx);
return_error(gs_error_typecheck);
}
@@ -803,104 +970,43 @@ static int pdfi_read_keyword(pdf_context *ctx, pdf_c_stream *s, uint32_t indirec
return code;
}
- break;
- case 'e':
- if (keyword->length == 9 && memcmp((const char *)Buffer, "endstream", 9) == 0)
- keyword->key = TOKEN_ENDSTREAM;
- else {
- if (keyword->length == 6 && memcmp((const char *)Buffer, "endobj", 6) == 0)
- keyword->key = TOKEN_ENDOBJ;
- }
- break;
- case 'o':
- if (keyword->length == 3 && memcmp((const char *)Buffer, "obj", 3) == 0)
- keyword->key = TOKEN_OBJ;
- break;
- case 's':
- if (keyword->length == 6 && memcmp((const char *)Buffer, "stream", 6) == 0){
- keyword->key = TOKEN_STREAM;
+ case TOKEN_NOT_A_KEYWORD:
+ /* Unexpected keyword found. We'll allocate an object for the buffer below. */
+ break;
+ case TOKEN_STREAM:
code = pdfi_skip_eol(ctx, s);
- if (code < 0) {
- pdfi_countdown(keyword);
- return code;
- }
- }
- else {
- if (keyword->length == 9 && memcmp((const char *)Buffer, "startxref", 9) == 0)
- keyword->key = TOKEN_STARTXREF;
- }
- break;
- case 't':
- if (keyword->length == 4 && memcmp((const char *)Buffer, "true", 4) == 0) {
- pdf_bool *o;
-
- pdfi_countdown(keyword);
-
- code = pdfi_object_alloc(ctx, PDF_BOOL, 0, (pdf_obj **)&o);
- if (code < 0)
- return code;
-
- o->value = true;
- o->indirect_num = indirect_num;
- o->indirect_gen = indirect_gen;
-
- code = pdfi_push(ctx, (pdf_obj *)o);
- if (code < 0)
- pdfi_free_object((pdf_obj *)o);
- return code;
- }
- else {
- if (keyword->length == 7 && memcmp((const char *)Buffer, "trailer", 7) == 0)
- keyword->key = TOKEN_TRAILER;
- }
- break;
- case 'f':
- if (keyword->length == 5 && memcmp((const char *)Buffer, "false", 5) == 0)
- {
- pdf_bool *o;
-
- pdfi_countdown(keyword);
-
- code = pdfi_object_alloc(ctx, PDF_BOOL, 0, (pdf_obj **)&o);
if (code < 0)
return code;
+ /* fallthrough */
+ case TOKEN_TRUE:
+ case TOKEN_FALSE:
+ case TOKEN_null:
+ default:
+ /* This is the fast, common exit case. We just push the key
+ * onto the stack. No allocation required. No deallocation
+ * in the case of error. */
+ return pdfi_push(ctx, (pdf_obj *)(intptr_t)key);
+ }
+ }
- o->value = false;
- o->indirect_num = indirect_num;
- o->indirect_gen = indirect_gen;
-
- code = pdfi_push(ctx, (pdf_obj *)o);
- if (code < 0)
- pdfi_free_object((pdf_obj *)o);
- return code;
- }
- break;
- case 'n':
- if (keyword->length == 4 && memcmp((const char *)Buffer, "null", 4) == 0){
- pdf_obj *o;
+ /* Unexpected keyword. We can't handle this with the fast no-allocation case. */
+ code = pdfi_object_alloc(ctx, PDF_KEYWORD, index, (pdf_obj **)&keyword);
+ if (code < 0)
+ return code;
- pdfi_countdown(keyword);
+ if (index)
+ memcpy(keyword->data, Buffer, index);
- code = pdfi_object_alloc(ctx, PDF_NULL, 0, &o);
- if (code < 0)
- return code;
- o->indirect_num = indirect_num;
- o->indirect_gen = indirect_gen;
+ /* keyword->length set as part of allocation. */
+ keyword->indirect_num = indirect_num;
+ keyword->indirect_gen = indirect_gen;
- code = pdfi_push(ctx, o);
- if (code < 0)
- pdfi_free_object((pdf_obj *)o);
- return code;
- }
- break;
- case 'x':
- if (keyword->length == 4 && memcmp((const char *)Buffer, "xref", 4) == 0)
- keyword->key = TOKEN_XREF;
- break;
- }
+ if (ctx->args.pdfdebug)
+ dmprintf1(ctx->memory, " %s\n", Buffer);
code = pdfi_push(ctx, (pdf_obj *)keyword);
- pdfi_countdown(keyword);
+ if (code < 0)
+ pdfi_free_object((pdf_obj *)keyword);
return code;
}
@@ -957,6 +1063,8 @@ rescan:
c = pdfi_read_byte(ctx, s);
}
if (c == '<') {
+ if (ctx->object_nesting < MAX_NESTING_DEPTH)
+ ctx->object_nesting++;
if (ctx->args.pdfdebug)
dmprintf (ctx->memory, " <<\n");
code = pdfi_mark_stack(ctx, PDF_DICT_MARK);
@@ -983,9 +1091,14 @@ rescan:
if (c < 0)
return (gs_error_ioerror);
if (c == '>') {
- code = pdfi_dict_from_stack(ctx, indirect_num, indirect_gen, false);
- if (code < 0)
- return code;
+ if (ctx->object_nesting > 0)
+ ctx->object_nesting--;
+ if (ctx->object_nesting < MAX_NESTING_DEPTH) {
+ code = pdfi_dict_from_stack(ctx, indirect_num, indirect_gen, false);
+ if (code < 0)
+ return code;
+ } else
+ pdfi_set_error(ctx, 0, NULL, E_PDF_NESTEDTOODEEP, "pdfi_read_token", NULL);
return 1;
} else {
pdfi_unread_byte(ctx, s, (byte)c);
@@ -999,6 +1112,8 @@ rescan:
return 1;
break;
case '[':
+ if (ctx->object_nesting < MAX_NESTING_DEPTH)
+ ctx->object_nesting++;
if (ctx->args.pdfdebug)
dmprintf (ctx->memory, "[");
code = pdfi_mark_stack(ctx, PDF_ARRAY_MARK);
@@ -1007,9 +1122,14 @@ rescan:
return 1;
break;
case ']':
- code = pdfi_array_from_stack(ctx, indirect_num, indirect_gen);
- if (code < 0)
- return code;
+ if (ctx->object_nesting > 0)
+ ctx->object_nesting--;
+ if (ctx->object_nesting < MAX_NESTING_DEPTH) {
+ code = pdfi_array_from_stack(ctx, indirect_num, indirect_gen);
+ if (code < 0)
+ return code;
+ } else
+ pdfi_set_error(ctx, 0, NULL, E_PDF_NESTEDTOODEEP, "pdfi_read_token", NULL);
break;
case '{':
if (ctx->args.pdfdebug)
@@ -1080,56 +1200,63 @@ static char op_table_1[27][1] = {
static int pdfi_interpret_stream_operator(pdf_context *ctx, pdf_c_stream *source,
pdf_dict *stream_dict, pdf_dict *page_dict);
+static int
+make_keyword_obj(pdf_context *ctx, const byte *data, int length, pdf_keyword **pkey)
+{
+ byte Buffer[256];
+ pdf_key key;
+ int code;
+
+ memcpy(Buffer, data, length);
+ Buffer[length] = 0;
+ key = lookup_keyword(Buffer);
+ if (key != TOKEN_INVALID_KEY) {
+ /* The common case. We've found a real key, just cast the token to
+ * a pointer, and return that. */
+ *pkey = (pdf_keyword *)PDF_TOKEN_AS_OBJ(key);
+ return 1;
+ }
+ /* We still haven't found a real keyword. Allocate a new object and
+ * return it. */
+ code = pdfi_object_alloc(ctx, PDF_KEYWORD, length, (pdf_obj **)pkey);
+ if (code < 0)
+ return code;
+ if (length)
+ memcpy((*pkey)->data, Buffer, length);
+ pdfi_countup(*pkey);
+
+ return 1;
+}
+
static int search_table_3(pdf_context *ctx, unsigned char *str, pdf_keyword **key)
{
- int i, code = 0;
+ int i;
for (i = 0; i < 5; i++) {
- if (memcmp(str, op_table_3[i], 3) == 0) {
- code = pdfi_object_alloc(ctx, PDF_KEYWORD, 3, (pdf_obj **)key);
- if (code < 0)
- return code;
- memcpy((*key)->data, str, 3);
- (*key)->key = TOKEN_NOT_A_KEYWORD;
- pdfi_countup(*key);
- return 1;
- }
+ if (memcmp(str, op_table_3[i], 3) == 0)
+ return make_keyword_obj(ctx, str, 3, key);
}
return 0;
}
static int search_table_2(pdf_context *ctx, unsigned char *str, pdf_keyword **key)
{
- int i, code = 0;
+ int i;
for (i = 0; i < 39; i++) {
- if (memcmp(str, op_table_2[i], 2) == 0) {
- code = pdfi_object_alloc(ctx, PDF_KEYWORD, 2, (pdf_obj **)key);
- if (code < 0)
- return code;
- memcpy((*key)->data, str, 2);
- (*key)->key = TOKEN_NOT_A_KEYWORD;
- pdfi_countup(*key);
- return 1;
- }
+ if (memcmp(str, op_table_2[i], 2) == 0)
+ return make_keyword_obj(ctx, str, 2, key);
}
return 0;
}
static int search_table_1(pdf_context *ctx, unsigned char *str, pdf_keyword **key)
{
- int i, code = 0;
+ int i;
for (i = 0; i < 27; i++) {
- if (memcmp(str, op_table_1[i], 1) == 0) {
- code = pdfi_object_alloc(ctx, PDF_KEYWORD, 1, (pdf_obj **)key);
- if (code < 0)
- return code;
- memcpy((*key)->data, str, 1);
- (*key)->key = TOKEN_NOT_A_KEYWORD;
- pdfi_countup(*key);
- return 1;
- }
+ if (memcmp(str, op_table_1[i], 1) == 0)
+ return make_keyword_obj(ctx, str, 1, key);
}
return 0;
}
@@ -1138,45 +1265,41 @@ static int split_bogus_operator(pdf_context *ctx, pdf_c_stream *source, pdf_dict
{
int code = 0;
pdf_keyword *keyword = (pdf_keyword *)ctx->stack_top[-1], *key1 = NULL, *key2 = NULL;
+ int length = keyword->length - 6;
- if (keyword->length > 6) {
+ if (length > 0) {
/* Longer than 2 3-character operators, we only allow for up to two
* operators. Check to see if it includes an endstream or endobj.
*/
- if (memcmp(&keyword->data[keyword->length - 6], "endobj", 6) == 0) {
- code = pdfi_object_alloc(ctx, PDF_KEYWORD, keyword->length - 6, (pdf_obj **)&key1);
+ if (memcmp(&keyword->data[length], "endobj", 6) == 0) {
+ /* Keyword is "<something>endobj". So make a keyword just from
+ * <something>, push that, execute it, then push endobj. */
+ code = make_keyword_obj(ctx, keyword->data, length, &key1);
if (code < 0)
goto error_exit;
- memcpy(key1->data, keyword->data, key1->length);
pdfi_pop(ctx, 1);
pdfi_push(ctx, (pdf_obj *)key1);
+ pdfi_countdown(key1); /* Drop the reference returned by make_keyword_obj. */
code = pdfi_interpret_stream_operator(ctx, source, stream_dict, page_dict);
if (code < 0)
goto error_exit;
- code = pdfi_object_alloc(ctx, PDF_KEYWORD, 6, (pdf_obj **)&key1);
- if (code < 0)
- goto error_exit;
- memcpy(key1->data, "endobj", 6);
- key1->key = TOKEN_ENDOBJ;
- pdfi_push(ctx, (pdf_obj *)key1);
+ pdfi_push(ctx, PDF_TOKEN_AS_OBJ(TOKEN_ENDOBJ));
return 0;
} else {
- if (keyword->length > 9 && memcmp(&keyword->data[keyword->length - 9], "endstream", 9) == 0) {
- code = pdfi_object_alloc(ctx, PDF_KEYWORD, keyword->length - 9, (pdf_obj **)&key1);
+ length = keyword->length - 9;
+ if (length > 0 && memcmp(&keyword->data[length], "endstream", 9) == 0) {
+ /* Keyword is "<something>endstream". So make a keyword just from
+ * <something>, push that, execute it, then push endstream. */
+ code = make_keyword_obj(ctx, keyword->data, length, &key1);
if (code < 0)
goto error_exit;
- memcpy(key1->data, keyword->data, key1->length);
pdfi_pop(ctx, 1);
pdfi_push(ctx, (pdf_obj *)key1);
+ pdfi_countdown(key1); /* Drop the reference returned by make_keyword_obj. */
code = pdfi_interpret_stream_operator(ctx, source, stream_dict, page_dict);
if (code < 0)
goto error_exit;
- code = pdfi_object_alloc(ctx, PDF_KEYWORD, 9, (pdf_obj **)&key1);
- if (code < 0)
- goto error_exit;
- memcpy(key1->data, "endstream", 9);
- key1->key = TOKEN_ENDSTREAM;
- pdfi_push(ctx, (pdf_obj *)key1);
+ pdfi_push(ctx, PDF_TOKEN_AS_OBJ(TOKEN_ENDSTREAM));
return 0;
} else {
pdfi_clearstack(ctx);
@@ -1191,15 +1314,15 @@ static int split_bogus_operator(pdf_context *ctx, pdf_c_stream *source, pdf_dict
goto error_exit;
if (code > 0) {
- switch(keyword->length - 3) {
+ switch (keyword->length - 3) {
case 1:
- code = search_table_1(ctx, &keyword->data[key1->length], &key2);
+ code = search_table_1(ctx, &keyword->data[3], &key2);
break;
case 2:
- code = search_table_1(ctx, &keyword->data[key1->length], &key2);
+ code = search_table_2(ctx, &keyword->data[3], &key2);
break;
case 3:
- code = search_table_1(ctx, &keyword->data[key1->length], &key2);
+ code = search_table_3(ctx, &keyword->data[3], &key2);
break;
default:
goto error_exit;
@@ -1225,13 +1348,13 @@ static int split_bogus_operator(pdf_context *ctx, pdf_c_stream *source, pdf_dict
if (code > 0) {
switch(keyword->length - 2) {
case 1:
- code = search_table_1(ctx, &keyword->data[key1->length], &key2);
+ code = search_table_1(ctx, &keyword->data[2], &key2);
break;
case 2:
- code = search_table_1(ctx, &keyword->data[key1->length], &key2);
+ code = search_table_2(ctx, &keyword->data[2], &key2);
break;
case 3:
- code = search_table_1(ctx, &keyword->data[key1->length], &key2);
+ code = search_table_3(ctx, &keyword->data[2], &key2);
break;
default:
goto error_exit;
@@ -1255,13 +1378,13 @@ static int split_bogus_operator(pdf_context *ctx, pdf_c_stream *source, pdf_dict
switch(keyword->length - 1) {
case 1:
- code = search_table_1(ctx, &keyword->data[key1->length], &key2);
+ code = search_table_1(ctx, &keyword->data[1], &key2);
break;
case 2:
- code = search_table_1(ctx, &keyword->data[key1->length], &key2);
+ code = search_table_2(ctx, &keyword->data[1], &key2);
break;
case 3:
- code = search_table_1(ctx, &keyword->data[key1->length], &key2);
+ code = search_table_3(ctx, &keyword->data[1], &key2);
break;
default:
goto error_exit;
@@ -1289,354 +1412,353 @@ error_exit:
return code;
}
-#define K1(a) (a)
-#define K2(a, b) ((a << 8) + b)
-#define K3(a, b, c) ((a << 16) + (b << 8) + c)
-
static int pdfi_interpret_stream_operator(pdf_context *ctx, pdf_c_stream *source,
pdf_dict *stream_dict, pdf_dict *page_dict)
{
- pdf_keyword *keyword = (pdf_keyword *)ctx->stack_top[-1];
- uint32_t op = 0;
- int i, code = 0;
+ pdf_obj *keyword = ctx->stack_top[-1];
+ int code = 0;
- if (keyword->length > 3) {
- /* This means we either have a corrupted or illegal operator. The most
- * usual corruption is two concatented operators (eg QBT instead of Q BT)
- * I plan to tackle this by trying to see if I can make two or more operators
- * out of the mangled one. Note this will also be done below in the 'default'
- * case where we don't recognise a keyword with 3 or fewer characters.
- */
- code = split_bogus_operator(ctx, source, stream_dict, page_dict);
- if (code < 0)
- return code;
- if (pdfi_count_stack(ctx) > 0) {
- keyword = (pdf_keyword *)ctx->stack_top[-1];
- if (keyword->key != TOKEN_NOT_A_KEYWORD)
- return REPAIRED_KEYWORD;
- } else
- return 0;
- } else {
- for (i=0;i < keyword->length;i++) {
- op = (op << 8) + keyword->data[i];
- }
- switch(op) {
- case K1('b'): /* closepath, fill, stroke */
+ if (keyword < PDF_TOKEN_AS_OBJ(TOKEN__LAST_KEY))
+ {
+ switch((uintptr_t)keyword) {
+ case TOKEN_b: /* closepath, fill, stroke */
pdfi_pop(ctx, 1);
code = pdfi_b(ctx);
break;
- case K1('B'): /* fill, stroke */
+ case TOKEN_B: /* fill, stroke */
pdfi_pop(ctx, 1);
code = pdfi_B(ctx);
break;
- case K2('b','*'): /* closepath, eofill, stroke */
+ case TOKEN_bstar: /* closepath, eofill, stroke */
pdfi_pop(ctx, 1);
code = pdfi_b_star(ctx);
break;
- case K2('B','*'): /* eofill, stroke */
+ case TOKEN_Bstar: /* eofill, stroke */
pdfi_pop(ctx, 1);
code = pdfi_B_star(ctx);
break;
- case K2('B','I'): /* begin inline image */
+ case TOKEN_BI: /* begin inline image */
pdfi_pop(ctx, 1);
code = pdfi_BI(ctx);
break;
- case K3('B','D','C'): /* begin marked content sequence with property list */
+ case TOKEN_BDC: /* begin marked content sequence with property list */
pdfi_pop(ctx, 1);
code = pdfi_op_BDC(ctx, stream_dict, page_dict);
break;
- case K3('B','M','C'): /* begin marked content sequence */
+ case TOKEN_BMC: /* begin marked content sequence */
pdfi_pop(ctx, 1);
code = pdfi_op_BMC(ctx);
break;
- case K2('B','T'): /* begin text */
+ case TOKEN_BT: /* begin text */
pdfi_pop(ctx, 1);
code = pdfi_BT(ctx);
break;
- case K2('B','X'): /* begin compatibility section */
+ case TOKEN_BX: /* begin compatibility section */
pdfi_pop(ctx, 1);
break;
- case K1('c'): /* curveto */
+ case TOKEN_c: /* curveto */
pdfi_pop(ctx, 1);
code = pdfi_curveto(ctx);
break;
- case K2('c','m'): /* concat */
+ case TOKEN_cm: /* concat */
pdfi_pop(ctx, 1);
code = pdfi_concat(ctx);
break;
- case K2('C','S'): /* set stroke colour space */
+ case TOKEN_CS: /* set stroke colour space */
pdfi_pop(ctx, 1);
code = pdfi_setstrokecolor_space(ctx, stream_dict, page_dict);
break;
- case K2('c','s'): /* set non-stroke colour space */
+ case TOKEN_cs: /* set non-stroke colour space */
pdfi_pop(ctx, 1);
code = pdfi_setfillcolor_space(ctx, stream_dict, page_dict);
break;
- break;
- case K1('d'): /* set dash params */
+ case TOKEN_d: /* set dash params */
pdfi_pop(ctx, 1);
code = pdfi_setdash(ctx);
break;
- case K2('d','0'): /* set type 3 font glyph width */
+ case TOKEN_d0: /* set type 3 font glyph width */
pdfi_pop(ctx, 1);
code = pdfi_d0(ctx);
break;
- case K2('d','1'): /* set type 3 font glyph width and bounding box */
+ case TOKEN_d1: /* set type 3 font glyph width and bounding box */
pdfi_pop(ctx, 1);
code = pdfi_d1(ctx);
break;
- case K2('D','o'): /* invoke named XObject */
+ case TOKEN_Do: /* invoke named XObject */
pdfi_pop(ctx, 1);
code = pdfi_Do(ctx, stream_dict, page_dict);
break;
- case K2('D','P'): /* define marked content point with property list */
+ case TOKEN_DP: /* define marked content point with property list */
pdfi_pop(ctx, 1);
code = pdfi_op_DP(ctx, stream_dict, page_dict);
break;
- case K2('E','I'): /* end inline image */
+ case TOKEN_EI: /* end inline image */
pdfi_pop(ctx, 1);
code = pdfi_EI(ctx);
break;
- case K2('E','T'): /* end text */
+ case TOKEN_ET: /* end text */
pdfi_pop(ctx, 1);
code = pdfi_ET(ctx);
break;
- case K3('E','M','C'): /* end marked content sequence */
+ case TOKEN_EMC: /* end marked content sequence */
pdfi_pop(ctx, 1);
code = pdfi_op_EMC(ctx);
break;
- case K2('E','X'): /* end compatibility section */
+ case TOKEN_EX: /* end compatibility section */
pdfi_pop(ctx, 1);
break;
- case K1('f'): /* fill */
+ case TOKEN_f: /* fill */
pdfi_pop(ctx, 1);
code = pdfi_fill(ctx);
break;
- case K1('F'): /* fill (obselete operator) */
+ case TOKEN_F: /* fill (obselete operator) */
pdfi_pop(ctx, 1);
code = pdfi_fill(ctx);
break;
- case K2('f','*'): /* eofill */
+ case TOKEN_fstar: /* eofill */
pdfi_pop(ctx, 1);
code = pdfi_eofill(ctx);
break;
- case K1('G'): /* setgray for stroke */
+ case TOKEN_G: /* setgray for stroke */
pdfi_pop(ctx, 1);
code = pdfi_setgraystroke(ctx);
break;
- case K1('g'): /* setgray for non-stroke */
+ case TOKEN_g: /* setgray for non-stroke */
pdfi_pop(ctx, 1);
code = pdfi_setgrayfill(ctx);
break;
- case K2('g','s'): /* set graphics state from dictionary */
+ case TOKEN_gs: /* set graphics state from dictionary */
pdfi_pop(ctx, 1);
code = pdfi_setgstate(ctx, stream_dict, page_dict);
break;
- case K1('h'): /* closepath */
+ case TOKEN_h: /* closepath */
pdfi_pop(ctx, 1);
code = pdfi_closepath(ctx);
break;
- case K1('i'): /* setflat */
+ case TOKEN_i: /* setflat */
pdfi_pop(ctx, 1);
code = pdfi_setflat(ctx);
break;
- case K2('I','D'): /* begin inline image data */
+ case TOKEN_ID: /* begin inline image data */
pdfi_pop(ctx, 1);
code = pdfi_ID(ctx, stream_dict, page_dict, source);
break;
- case K1('j'): /* setlinejoin */
+ case TOKEN_j: /* setlinejoin */
pdfi_pop(ctx, 1);
code = pdfi_setlinejoin(ctx);
break;
- case K1('J'): /* setlinecap */
+ case TOKEN_J: /* setlinecap */
pdfi_pop(ctx, 1);
code = pdfi_setlinecap(ctx);
break;
- case K1('K'): /* setcmyk for non-stroke */
+ case TOKEN_K: /* setcmyk for non-stroke */
pdfi_pop(ctx, 1);
code = pdfi_setcmykstroke(ctx);
break;
- case K1('k'): /* setcmyk for non-stroke */
+ case TOKEN_k: /* setcmyk for non-stroke */
pdfi_pop(ctx, 1);
code = pdfi_setcmykfill(ctx);
break;
- case K1('l'): /* lineto */
+ case TOKEN_l: /* lineto */
pdfi_pop(ctx, 1);
code = pdfi_lineto(ctx);
break;
- case K1('m'): /* moveto */
+ case TOKEN_m: /* moveto */
pdfi_pop(ctx, 1);
code = pdfi_moveto(ctx);
break;
- case K1('M'): /* setmiterlimit */
+ case TOKEN_M: /* setmiterlimit */
pdfi_pop(ctx, 1);
code = pdfi_setmiterlimit(ctx);
break;
- case K2('M','P'): /* define marked content point */
+ case TOKEN_MP: /* define marked content point */
pdfi_pop(ctx, 1);
code = pdfi_op_MP(ctx);
break;
- case K1('n'): /* newpath */
+ case TOKEN_n: /* newpath */
pdfi_pop(ctx, 1);
code = pdfi_newpath(ctx);
break;
- case K1('q'): /* gsave */
+ case TOKEN_q: /* gsave */
pdfi_pop(ctx, 1);
code = pdfi_op_q(ctx);
break;
- case K1('Q'): /* grestore */
+ case TOKEN_Q: /* grestore */
pdfi_pop(ctx, 1);
code = pdfi_op_Q(ctx);
break;
- case K1('r'): /* non-standard set rgb colour for non-stroke */
+ case TOKEN_r: /* non-standard set rgb colour for non-stroke */
pdfi_pop(ctx, 1);
code = pdfi_setrgbfill_array(ctx);
break;
- case K2('r','e'): /* append rectangle */
+ case TOKEN_re: /* append rectangle */
pdfi_pop(ctx, 1);
code = pdfi_rectpath(ctx);
break;
- case K2('R','G'): /* set rgb colour for stroke */
+ case TOKEN_RG: /* set rgb colour for stroke */
pdfi_pop(ctx, 1);
code = pdfi_setrgbstroke(ctx);
break;
- case K2('r','g'): /* set rgb colour for non-stroke */
+ case TOKEN_rg: /* set rgb colour for non-stroke */
pdfi_pop(ctx, 1);
code = pdfi_setrgbfill(ctx);
break;
- case K2('r','i'): /* set rendering intent */
+ case TOKEN_ri: /* set rendering intent */
pdfi_pop(ctx, 1);
code = pdfi_ri(ctx);
break;
- case K1('s'): /* closepath, stroke */
+ case TOKEN_s: /* closepath, stroke */
pdfi_pop(ctx, 1);
code = pdfi_closepath_stroke(ctx);
break;
- case K1('S'): /* stroke */
+ case TOKEN_S: /* stroke */
pdfi_pop(ctx, 1);
code = pdfi_stroke(ctx);
break;
- case K2('S','C'): /* set colour for stroke */
+ case TOKEN_SC: /* set colour for stroke */
pdfi_pop(ctx, 1);
code = pdfi_setstrokecolor(ctx);
break;
- case K2('s','c'): /* set colour for non-stroke */
+ case TOKEN_sc: /* set colour for non-stroke */
pdfi_pop(ctx, 1);
code = pdfi_setfillcolor(ctx);
break;
- case K3('S','C','N'): /* set special colour for stroke */
+ case TOKEN_SCN: /* set special colour for stroke */
pdfi_pop(ctx, 1);
code = pdfi_setcolorN(ctx, stream_dict, page_dict, false);
break;
- case K3('s','c','n'): /* set special colour for non-stroke */
+ case TOKEN_scn: /* set special colour for non-stroke */
pdfi_pop(ctx, 1);
code = pdfi_setcolorN(ctx, stream_dict, page_dict, true);
break;
- case K2('s','h'): /* fill with sahding pattern */
+ case TOKEN_sh: /* fill with sahding pattern */
pdfi_pop(ctx, 1);
code = pdfi_shading(ctx, stream_dict, page_dict);
break;
- case K2('T','*'): /* Move to start of next text line */
+ case TOKEN_Tstar: /* Move to start of next text line */
pdfi_pop(ctx, 1);
code = pdfi_T_star(ctx);
break;
- case K2('T','c'): /* set character spacing */
+ case TOKEN_Tc: /* set character spacing */
pdfi_pop(ctx, 1);
code = pdfi_Tc(ctx);
break;
- case K2('T','d'): /* move text position */
+ case TOKEN_Td: /* move text position */
pdfi_pop(ctx, 1);
code = pdfi_Td(ctx);
break;
- case K2('T','D'): /* Move text position, set leading */
+ case TOKEN_TD: /* Move text position, set leading */
pdfi_pop(ctx, 1);
code = pdfi_TD(ctx);
break;
- case K2('T','f'): /* set font and size */
+ case TOKEN_Tf: /* set font and size */
pdfi_pop(ctx, 1);
code = pdfi_Tf(ctx, stream_dict, page_dict);
break;
- case K2('T','j'): /* show text */
+ case TOKEN_Tj: /* show text */
pdfi_pop(ctx, 1);
code = pdfi_Tj(ctx);
break;
- case K2('T','J'): /* show text with individual glyph positioning */
+ case TOKEN_TJ: /* show text with individual glyph positioning */
pdfi_pop(ctx, 1);
code = pdfi_TJ(ctx);
break;
- case K2('T','L'): /* set text leading */
+ case TOKEN_TL: /* set text leading */
pdfi_pop(ctx, 1);
code = pdfi_TL(ctx);
break;
- case K2('T','m'): /* set text matrix */
+ case TOKEN_Tm: /* set text matrix */
pdfi_pop(ctx, 1);
code = pdfi_Tm(ctx);
break;
- case K2('T','r'): /* set text rendering mode */
+ case TOKEN_Tr: /* set text rendering mode */
pdfi_pop(ctx, 1);
code = pdfi_Tr(ctx);
break;
- case K2('T','s'): /* set text rise */
+ case TOKEN_Ts: /* set text rise */
pdfi_pop(ctx, 1);
code = pdfi_Ts(ctx);
break;
- case K2('T','w'): /* set word spacing */
+ case TOKEN_Tw: /* set word spacing */
pdfi_pop(ctx, 1);
code = pdfi_Tw(ctx);
break;
- case K2('T','z'): /* set text matrix */
+ case TOKEN_Tz: /* set text matrix */
pdfi_pop(ctx, 1);
code = pdfi_Tz(ctx);
break;
- case K1('v'): /* append curve (initial point replicated) */
+ case TOKEN_v: /* append curve (initial point replicated) */
pdfi_pop(ctx, 1);
code = pdfi_v_curveto(ctx);
break;
- case K1('w'): /* setlinewidth */
+ case TOKEN_w: /* setlinewidth */
pdfi_pop(ctx, 1);
code = pdfi_setlinewidth(ctx);
break;
- case K1('W'): /* clip */
+ case TOKEN_W: /* clip */
pdfi_pop(ctx, 1);
ctx->clip_active = true;
ctx->do_eoclip = false;
break;
- case K2('W','*'): /* eoclip */
+ case TOKEN_Wstar: /* eoclip */
pdfi_pop(ctx, 1);
ctx->clip_active = true;
ctx->do_eoclip = true;
break;
- case K1('y'): /* append curve (final point replicated) */
+ case TOKEN_y: /* append curve (final point replicated) */
pdfi_pop(ctx, 1);
code = pdfi_y_curveto(ctx);
break;
- case K1('\''): /* move to next line and show text */
+ case TOKEN_APOSTROPHE: /* move to next line and show text */
pdfi_pop(ctx, 1);
code = pdfi_singlequote(ctx);
break;
- case K1('"'): /* set word and character spacing, move to next line, show text */
+ case TOKEN_QUOTE: /* set word and character spacing, move to next line, show text */
pdfi_pop(ctx, 1);
code = pdfi_doublequote(ctx);
break;
default:
- code = split_bogus_operator(ctx, source, stream_dict, page_dict);
- if (code < 0)
- return code;
- if (pdfi_count_stack(ctx) > 0) {
- keyword = (pdf_keyword *)ctx->stack_top[-1];
- if (keyword->key != TOKEN_NOT_A_KEYWORD)
- return REPAIRED_KEYWORD;
- }
+ /* Shouldn't we return an error here? Original code didn't seem to. */
break;
- }
+ }
+ /* We use a return value of 1 to indicate a repaired keyword (a pair of operators
+ * was concatenated, and we split them up). We must not return a value > 0 from here
+ * to avoid tripping that test.
+ */
+ if (code > 0)
+ code = 0;
+ return code;
+ } else if (((pdf_keyword *)keyword)->length > 3) {
+ if (ctx->args.pdfdebug) {
+ char Buffer[1024];
+ int length;
+
+ if (((pdf_keyword *)keyword)->length > 1023)
+ length = 1023;
+ else
+ length = ((pdf_keyword *)keyword)->length;
+
+ memcpy(Buffer, ((pdf_keyword *)keyword)->data, length);
+ Buffer[length] = 0x00;
+ dmprintf1(ctx->memory, " %s\n", Buffer);
+ }
+
+ /* This means we either have a corrupted or illegal operator. The most
+ * usual corruption is two concatented operators (eg QBT instead of Q BT)
+ * I plan to tackle this by trying to see if I can make two or more operators
+ * out of the mangled one. Note this will also be done below in the 'default'
+ * case where we don't recognise a keyword with 3 or fewer characters.
+ */
+ code = split_bogus_operator(ctx, source, stream_dict, page_dict);
+ if (code < 0)
+ return code;
+ if (pdfi_count_stack(ctx) > 0) {
+ keyword = ctx->stack_top[-1];
+ if (keyword != PDF_TOKEN_AS_OBJ(TOKEN_NOT_A_KEYWORD))
+ return REPAIRED_KEYWORD;
+ }
}
- /* We use a return value of 1 to indicate a repaired keyword (a pair of operators
- * was concatenated, and we split them up). We must not return a value > 0 from here
- * to avoid tripping that test.
- */
- if (code > 0)
- code = 0;
- return code;
+ return 0;
}
void local_save_stream_state(pdf_context *ctx, stream_save *local_save)
@@ -1699,10 +1821,9 @@ int pdfi_run_context(pdf_context *ctx, pdf_stream *stream_obj,
gs_color_space *PageDefaultRGB = ctx->page.DefaultRGB_cs;
gs_color_space *PageDefaultCMYK = ctx->page.DefaultCMYK_cs;
- /* increment their reference counts because we took a new reference to each */
- rc_increment(ctx->page.DefaultGray_cs);
- rc_increment(ctx->page.DefaultRGB_cs);
- rc_increment(ctx->page.DefaultCMYK_cs);
+ ctx->page.DefaultGray_cs = NULL;
+ ctx->page.DefaultRGB_cs = NULL;
+ ctx->page.DefaultCMYK_cs = NULL;
#if DEBUG_CONTEXT
dbgmprintf(ctx->memory, "pdfi_run_context BEGIN\n");
@@ -1714,6 +1835,20 @@ int pdfi_run_context(pdf_context *ctx, pdf_stream *stream_obj,
if (code < 0)
goto exit;
+ /* If no Default* space found, try using the Page level ones (if any) */
+ if (ctx->page.DefaultGray_cs == NULL) {
+ ctx->page.DefaultGray_cs = PageDefaultGray;
+ rc_increment(PageDefaultGray);
+ }
+ if (ctx->page.DefaultRGB_cs == NULL) {
+ ctx->page.DefaultRGB_cs = PageDefaultRGB;
+ rc_increment(PageDefaultRGB);
+ }
+ if (ctx->page.DefaultCMYK_cs == NULL) {
+ ctx->page.DefaultCMYK_cs = PageDefaultCMYK;
+ rc_increment(PageDefaultCMYK);
+ }
+
code = pdfi_copy_DefaultQState(ctx, &DefaultQState);
if (code < 0)
goto exit;
@@ -1743,6 +1878,7 @@ exit:
ctx->page.DefaultGray_cs = PageDefaultGray;
ctx->page.DefaultRGB_cs = PageDefaultRGB;
ctx->page.DefaultCMYK_cs = PageDefaultCMYK;
+
#if DEBUG_CONTEXT
dbgmprintf(ctx->memory, "pdfi_run_context END\n");
#endif
@@ -1900,6 +2036,7 @@ pdfi_interpret_content_stream(pdf_context *ctx, pdf_c_stream *content_stream,
pdf_c_stream *stream;
pdf_keyword *keyword;
pdf_stream *s = ctx->current_stream;
+ pdf_obj_type type;
/* Check this stream, and all the streams currently being executed, to see
* if the stream we've been given is already in train. If it is, then we
@@ -1908,9 +2045,18 @@ pdfi_interpret_content_stream(pdf_context *ctx, pdf_c_stream *content_stream,
* Resources, and instead inherits it from the parent. We cannot detect that
* before the Resource is used, so all we can do is check here.
*/
- while (s != NULL && s->type == PDF_STREAM) {
+ while (s != NULL && pdfi_type_of(s) == PDF_STREAM) {
if (s->object_num > 0) {
if (s->object_num == stream_obj->object_num) {
+ pdf_dict *d = NULL;
+ bool known = false;
+
+ code = pdfi_dict_from_obj(ctx, (pdf_obj *)stream_obj, &d);
+ if (code >= 0) {
+ code = pdfi_dict_known(ctx, d, "Parent", &known);
+ if (code >= 0 && known)
+ (void)pdfi_dict_delete(ctx, d, "Parent");
+ }
pdfi_set_error(ctx, 0, NULL, E_PDF_CIRCULARREF, "pdfi_interpret_content_stream", "Aborting stream");
return_error(gs_error_circular_reference);
}
@@ -1952,11 +2098,12 @@ pdfi_interpret_content_stream(pdf_context *ctx, pdf_c_stream *content_stream,
break;
}
- if (ctx->stack_top[-1]->type == PDF_KEYWORD) {
repaired_keyword:
+ type = pdfi_type_of(ctx->stack_top[-1]);
+ if (type == PDF_FAST_KEYWORD) {
keyword = (pdf_keyword *)ctx->stack_top[-1];
- switch(keyword->key) {
+ switch((uintptr_t)keyword) {
case TOKEN_ENDSTREAM:
pdfi_pop(ctx,1);
goto exit;
@@ -1968,35 +2115,39 @@ repaired_keyword:
code = gs_note_error(gs_error_syntaxerror);
goto exit;
break;
- case TOKEN_NOT_A_KEYWORD:
- {
- pdf_dict *stream_dict = NULL;
-
- code = pdfi_dict_from_obj(ctx, (pdf_obj *)stream_obj, &stream_dict);
- if (code < 0)
- goto exit;
-
- code = pdfi_interpret_stream_operator(ctx, stream, stream_dict, page_dict);
- if (code == REPAIRED_KEYWORD)
- goto repaired_keyword;
-
- if (code < 0) {
- pdfi_set_error(ctx, code, NULL, E_PDF_TOKENERROR, "pdf_interpret_content_stream", NULL);
- if (ctx->args.pdfstoponerror) {
- pdfi_clearstack(ctx);
- goto exit;
- }
- }
- }
- break;
case TOKEN_INVALID_KEY:
pdfi_set_error(ctx, 0, NULL, E_PDF_KEYWORDTOOLONG, "pdfi_interpret_content_stream", NULL);
pdfi_clearstack(ctx);
break;
- default:
+ case TOKEN_TOO_LONG:
pdfi_set_error(ctx, 0, NULL, E_PDF_MISSINGENDSTREAM, "pdfi_interpret_content_stream", NULL);
pdfi_clearstack(ctx);
break;
+ default:
+ goto execute;
+ }
+ }
+ else if (type == PDF_KEYWORD)
+ {
+execute:
+ {
+ pdf_dict *stream_dict = NULL;
+
+ code = pdfi_dict_from_obj(ctx, (pdf_obj *)stream_obj, &stream_dict);
+ if (code < 0)
+ goto exit;
+
+ code = pdfi_interpret_stream_operator(ctx, stream, stream_dict, page_dict);
+ if (code == REPAIRED_KEYWORD)
+ goto repaired_keyword;
+
+ if (code < 0) {
+ pdfi_set_error(ctx, code, NULL, E_PDF_TOKENERROR, "pdf_interpret_content_stream", NULL);
+ if (ctx->args.pdfstoponerror) {
+ pdfi_clearstack(ctx);
+ goto exit;
+ }
+ }
}
}
if(stream->eof == true)
diff --git a/pdf/pdf_int.h b/pdf/pdf_int.h
index c841fc9f..4cf1dcb6 100644
--- a/pdf/pdf_int.h
+++ b/pdf/pdf_int.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018-2021 Artifex Software, Inc.
+/* Copyright (C) 2018-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -29,6 +29,9 @@ int pdfi_name_alloc(pdf_context *ctx, byte *key, uint32_t size, pdf_obj **o);
int pdfi_read_dict(pdf_context *ctx, pdf_c_stream *s, uint32_t indirect_num, uint32_t indirect_gen);
+int pdfi_read_bare_int(pdf_context *ctx, pdf_c_stream *s, int *parsed_int);
+int pdfi_read_bare_keyword(pdf_context *ctx, pdf_c_stream *s);
+
void local_save_stream_state(pdf_context *ctx, stream_save *local_save);
void local_restore_stream_state(pdf_context *ctx, stream_save *local_save);
void cleanup_context_interpretation(pdf_context *ctx, stream_save *local_save);
diff --git a/pdf/pdf_mark.c b/pdf/pdf_mark.c
index d625e34a..27b72d8c 100644
--- a/pdf/pdf_mark.c
+++ b/pdf/pdf_mark.c
@@ -50,7 +50,7 @@ static int pdfi_pdfmark_setparam_pair(pdf_context *ctx, pdf_name *Key, pdf_obj *
int code = 0;
/* Handle the Key */
- if (Key->type != PDF_NAME) {
+ if (pdfi_type_of(Key) != PDF_NAME) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -391,14 +391,20 @@ static int pdfi_pdfmark_add_Page_View(pdf_context *ctx, pdf_dict *link_dict, pdf
code = pdfi_array_get_no_store_R(ctx, dest_array, 0, (pdf_obj **)&page_dict);
if (code < 0) goto exit;
- if (page_dict->type != PDF_DICT) {
- code = gs_note_error(gs_error_typecheck);
- goto exit;
+ if(pdfi_type_of(page_dict) == PDF_INT) {
+ page_num = ((pdf_num *)page_dict)->value.i;
+ } else {
+ if (pdfi_type_of(page_dict) != PDF_DICT) {
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
+ }
+
+ /* Find out which page number this is */
+ code = pdfi_page_get_number(ctx, page_dict, &page_num);
+ if (code < 0) goto exit;
}
- /* Find out which page number this is */
- code = pdfi_page_get_number(ctx, page_dict, &page_num);
- if (code < 0) goto exit;
+ page_num += ctx->Pdfmark_InitialPage;
/* Add /Page key to the link_dict
* Of course pdfwrite is numbering its pages starting at 1, because... of course :(
@@ -457,12 +463,12 @@ static int pdfi_pdfmark_handle_dest_names(pdf_context *ctx, pdf_dict *link_dict,
/* Note: in current implementation, PDF_STRING and PDF_NAME have all the same
* fields, but just in case that changes I treat them separately here.
*/
- if (name->type == PDF_STRING && dest->type == PDF_STRING) {
+ if (pdfi_type_of(name) == PDF_STRING && pdfi_type_of(dest) == PDF_STRING) {
if (!pdfi_string_cmp((pdf_string *)name, (pdf_string *)dest)) {
found = true;
break;
}
- } else if (name->type == PDF_NAME && dest->type == PDF_NAME) {
+ } else if (pdfi_type_of(name) == PDF_NAME && pdfi_type_of(dest) == PDF_NAME) {
if (!pdfi_name_cmp((pdf_name *)name, (pdf_name *)dest)) {
found = true;
break;
@@ -482,18 +488,19 @@ static int pdfi_pdfmark_handle_dest_names(pdf_context *ctx, pdf_dict *link_dict,
code = pdfi_array_get(ctx, Names, i+1, (pdf_obj **)&D_dict);
if (code < 0) goto exit;
- if (D_dict->type == PDF_DICT) {
- /* Dict is supposed to contain key "D" with Dest array */
- code = pdfi_dict_knownget_type(ctx, D_dict, "D", PDF_ARRAY, (pdf_obj **)&dest_array);
- if (code <= 0) goto exit;
- } else {
- if (D_dict->type == PDF_ARRAY) {
+ switch (pdfi_type_of(D_dict)) {
+ case PDF_DICT:
+ /* Dict is supposed to contain key "D" with Dest array */
+ code = pdfi_dict_knownget_type(ctx, D_dict, "D", PDF_ARRAY, (pdf_obj **)&dest_array);
+ if (code <= 0) goto exit;
+ break;
+ case PDF_ARRAY:
dest_array = (pdf_array *)D_dict;
D_dict = NULL;
- } else {
+ break;
+ default:
code = gs_note_error(gs_error_typecheck);
goto exit;
- }
}
/* Process the dest_array to replace with /Page /View */
@@ -512,7 +519,7 @@ static int pdfi_pdfmark_handle_dest_names(pdf_context *ctx, pdf_dict *link_dict,
*/
int pdfi_pdfmark_modDest(pdf_context *ctx, pdf_dict *link_dict)
{
- int code = 0;
+ int code = 0, code1 = 0;
pdf_dict *Dests = NULL;
pdf_obj *Dest = NULL;
bool delete_Dest = true;
@@ -529,14 +536,13 @@ int pdfi_pdfmark_modDest(pdf_context *ctx, pdf_dict *link_dict)
code = pdfi_dict_knownget_type(ctx, ctx->Root, "Names", PDF_DICT, (pdf_obj **)&Names_dict);
if (code < 0) goto exit;
- switch (Dest->type) {
+ switch (pdfi_type_of(Dest)) {
case PDF_ARRAY:
code = pdfi_pdfmark_add_Page_View(ctx, link_dict, (pdf_array *)Dest);
if (code < 0) goto exit;
break;
case PDF_NAME:
- case PDF_STRING:
- if (Dest->type == PDF_NAME && Dests != NULL) {
+ if (Dests != NULL) {
/* Case where it's a name to look up in Contents(Root) /Dests */
code = pdfi_dict_get_by_key(ctx, Dests, (const pdf_name *)Dest, (pdf_obj **)&dest_array);
if (code == gs_error_undefined) {
@@ -545,13 +551,17 @@ int pdfi_pdfmark_modDest(pdf_context *ctx, pdf_dict *link_dict)
goto exit;
}
if (code < 0) goto exit;
- if (dest_array->type != PDF_ARRAY) {
+ if (pdfi_type_of(dest_array) != PDF_ARRAY) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
code = pdfi_pdfmark_add_Page_View(ctx, link_dict, dest_array);
if (code < 0) goto exit;
- } else if (Names_dict != NULL) {
+ break;
+ }
+ /* fallthrough */
+ case PDF_STRING:
+ if (Names_dict != NULL) {
/* Looking in Catalog(Root) for /Names<</Dests<</Names [name dict array]>>>> */
code = pdfi_dict_knownget_type(ctx, Names_dict, "Dests", PDF_DICT, (pdf_obj **)&Dests);
if (code < 0) goto exit;
@@ -580,8 +590,9 @@ int pdfi_pdfmark_modDest(pdf_context *ctx, pdf_dict *link_dict)
exit:
if (delete_Dest) {
/* Delete the Dest key */
- code = pdfi_dict_delete(ctx, link_dict, "Dest");
- if (code < 0) goto exit;
+ code1 = pdfi_dict_delete(ctx, link_dict, "Dest");
+ if (code1 < 0 && code >= 0)
+ code = code1;
}
pdfi_countdown(Dest);
pdfi_countdown(Dests);
@@ -591,6 +602,233 @@ int pdfi_pdfmark_modDest(pdf_context *ctx, pdf_dict *link_dict)
return code;
}
+static int pdfi_check_limits(pdf_context *ctx, pdf_dict *node, char *str, int len)
+{
+ int code = 0, min, i, len2 = 0;
+ pdf_array *Limits = NULL;
+ pdf_string *Str = NULL;
+ char *str2 = NULL;
+
+ code = pdfi_dict_get_type(ctx, node, "Limits", PDF_ARRAY, (pdf_obj **)&Limits);
+ if (code < 0)
+ goto error;
+
+ if (pdfi_array_size(Limits) != 2) {
+ /* Limits are not valid, just ignore them. The calling code will then check
+ * the Names array.
+ */
+ pdfi_set_warning(ctx, 0, NULL, PDF_W_BAD_TREE_LIMITS, "pdfi_get_name_from_node", 0);
+ goto error;
+ }
+
+ code = pdfi_array_get_type(ctx, Limits, 0, PDF_STRING, (pdf_obj **)&Str);
+ if (code < 0)
+ goto error;
+
+ if (pdfi_type_of(Str) == PDF_NAME) {
+ code = pdfi_string_from_name(ctx, (pdf_name *)Str, &str2, &len2);
+ if (code < 0)
+ return code;
+ } else {
+ len2 = ((pdf_string *)Str)->length;
+ str2 = (char *)gs_alloc_bytes(ctx->memory, len2 + 1, "pdfi_get_named_dest");
+ if (str2 == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error;
+ }
+ memcpy(str2, ((pdf_string *)Str)->data, len2);
+ str2[len2] = 0;
+ }
+
+ pdfi_countdown(Str);
+ Str = NULL;
+
+ min = len;
+ if (len2 < min)
+ min = len2;
+
+ for (i=0;i< min;i++) {
+ if (str[i] < str2[i]) {
+ code = gs_note_error(gs_error_undefined);
+ goto error;
+ }
+ if (str[i] != str2[i])
+ break;
+ }
+ if (i > min && len2 < Str->length) {
+ code = gs_note_error(gs_error_undefined);
+ goto error;
+ }
+ gs_free_object(ctx->memory, str2, "pdfi_get_named_dest");
+ str2 = NULL;
+
+ code = pdfi_array_get_type(ctx, Limits, 1, PDF_STRING, (pdf_obj **)&Str);
+ if (code < 0)
+ goto error;
+
+ if (pdfi_type_of(Str) == PDF_NAME) {
+ code = pdfi_string_from_name(ctx, (pdf_name *)Str, &str2, &len2);
+ if (code < 0)
+ return code;
+ } else {
+ len2 = ((pdf_string *)Str)->length;
+ str2 = (char *)gs_alloc_bytes(ctx->memory, len2 + 1, "pdfi_get_named_dest");
+ if (str2 == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error;
+ }
+ memcpy(str2, ((pdf_string *)Str)->data, len2);
+ str2[len2] = 0;
+ }
+
+ pdfi_countdown(Str);
+ Str = NULL;
+
+ min = len;
+ if (len2 < min)
+ min = len2;
+
+ for (i=0;i< min;i++) {
+ if (str[i] > str2[i]) {
+ code = gs_note_error(gs_error_undefined);
+ goto error;
+ }
+ if (str[i] != str2[i])
+ break;
+ }
+
+ if (i > min && len > len2)
+ code = gs_note_error(gs_error_undefined);
+
+error:
+ gs_free_object(ctx->memory, str2, "pdfi_get_named_dest");
+ pdfi_countdown(Str);
+ pdfi_countdown(Limits);
+ return code;
+}
+
+static int pdfi_get_name_from_node(pdf_context *ctx, pdf_dict *node, char *str, pdf_obj **Name)
+{
+ int i = 0, len = strlen(str), code = 0;
+ pdf_string *StrKey = NULL;
+ pdf_array *NamesArray = NULL;
+ pdf_dict *Kid = NULL;
+ bool known;
+
+ code = pdfi_dict_known(ctx, node, "Names", &known);
+ if (code < 0)
+ goto error;
+
+ if (known) {
+ code = pdfi_dict_known(ctx, node, "Limits", &known);
+ if (code < 0)
+ goto error;
+
+ if (!known) {
+ /* No Limits array (a required entry), so just assume that the
+ * string is in this node and check all the Names anyway
+ */
+ pdfi_set_warning(ctx, 0, NULL, PDF_W_NO_TREE_LIMITS, "pdfi_get_name_from_node", 0);
+ } else {
+ code = pdfi_check_limits(ctx, node, str, len);
+ if (code < 0)
+ goto error;
+ }
+
+ code = pdfi_dict_get_type(ctx, node, "Names", PDF_ARRAY, (pdf_obj **)&NamesArray);
+ if (code < 0)
+ goto error;
+
+ if (pdfi_array_size(NamesArray) & 1)
+ pdfi_set_warning(ctx, 0, NULL, PDF_W_NAMES_ARRAY_SIZE, "pdfi_get_name_from_node", 0);
+
+ for (i = 0;i < pdfi_array_size(NamesArray) / 2; i++) {
+ code = pdfi_array_get_type(ctx, NamesArray, i * 2, PDF_STRING, (pdf_obj **)&StrKey);
+ if (code < 0)
+ goto error;
+
+ if (StrKey->length == len && strncmp((const char *)StrKey->data, str, len) == 0) {
+ code = pdfi_array_get(ctx, NamesArray, (i * 2) + 1, (pdf_obj **)Name);
+ goto error;
+ }
+ pdfi_countdown(StrKey);
+ StrKey = NULL;
+ }
+ pdfi_countdown(NamesArray);
+ NamesArray = NULL;
+ }
+
+ /* Either no Names array (initial node) or not in array */
+ code = pdfi_dict_get_type(ctx, node, "Kids", PDF_ARRAY, (pdf_obj **)&NamesArray);
+ if (code < 0)
+ goto error;
+
+ for (i = 0;i < pdfi_array_size(NamesArray); i++) {
+ code = pdfi_array_get_type(ctx, NamesArray, i, PDF_DICT, (pdf_obj **)&Kid);
+ if (code < 0)
+ goto error;
+
+ code = pdfi_get_name_from_node(ctx, Kid, str, Name);
+ pdfi_countdown(Kid);
+ Kid = NULL;
+ if (code == 0)
+ break;
+
+ if (code < 0) {
+ if (code == gs_error_undefined)
+ continue;
+ goto error;
+ }
+ }
+
+error:
+ pdfi_countdown(Kid);
+ pdfi_countdown(StrKey);
+ pdfi_countdown(NamesArray);
+ return code;
+}
+
+static int pdfi_get_named_dest(pdf_context *ctx, pdf_obj *Named, pdf_obj **Dest)
+{
+ int code = 0, len = 0;
+ pdf_dict *Names = NULL, *Dests = NULL;
+ char *str = NULL;
+
+ code = pdfi_dict_get_type(ctx, ctx->Root, "Names", PDF_DICT, (pdf_obj **)&Names);
+ if (code < 0)
+ goto error;
+
+ code = pdfi_dict_get_type(ctx, Names, "Dests", PDF_DICT, (pdf_obj **)&Dests);
+ if (code < 0)
+ goto error;
+
+ if (pdfi_type_of(Named) == PDF_NAME) {
+ code = pdfi_string_from_name(ctx, (pdf_name *)Named, &str, &len);
+ if (code < 0)
+ return code;
+ } else {
+ len = ((pdf_string *)Named)->length;
+ str = (char *)gs_alloc_bytes(ctx->memory, len + 1, "pdfi_get_named_dest");
+ if (str == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error;
+ }
+ memcpy(str, ((pdf_string *)Named)->data, len);
+ str[len] = 0;
+ }
+
+ code = pdfi_get_name_from_node(ctx, Dests, str, Dest);
+
+error:
+ if (pdfi_type_of(Named) == PDF_NAME)
+ (void)pdfi_free_string_from_name(ctx, str);
+ else
+ gs_free_object(ctx->memory, str, "pdfi_get_named_dest");
+ pdfi_countdown(Names);
+ pdfi_countdown(Dests);
+ return code;
+}
+
/* Special handling for "A" in Link annotations and Outlines
* Will delete A if handled and if A_key is provided.
*/
@@ -607,7 +845,7 @@ int pdfi_pdfmark_modA(pdf_context *ctx, pdf_dict *dict)
code = pdfi_dict_get_no_store_R(ctx, dict, "A", (pdf_obj **)&A_dict);
if (code < 0) goto exit;
- if (A_dict->type != PDF_DICT) {
+ if (pdfi_type_of(A_dict) != PDF_DICT) {
/* Invalid AP, just delete it because I dunno what to do...
* TODO: Should flag a warning here
*/
@@ -631,19 +869,33 @@ int pdfi_pdfmark_modA(pdf_context *ctx, pdf_dict *dict)
if (code <= 0) goto exit;
/* We only handle GoTo for now */
if (pdfi_name_is(S_name, "GoTo")) {
- code = pdfi_dict_knownget_type(ctx, A_dict, "D", PDF_ARRAY, (pdf_obj **)&D_array);
- if (code == 0) goto exit;
- if (code < 0) {
- if (code == gs_error_typecheck) {
- /* TODO: Are there other cases to handle?
- * Sample tests_private/pdf/sumatra/recursive_action_destinations.pdf
- * has a recursive destination that has an indirect ref here. We return a
- * typecheck and that causes us to omit the whole thing, but is that
- * really the best treatment?
- */
+ code = pdfi_dict_knownget(ctx, A_dict, "D", (pdf_obj **)&D_array);
+ if (code <= 0)
+ goto exit;
+ if (pdfi_type_of(D_array) == PDF_STRING || pdfi_type_of(D_array) == PDF_NAME)
+ {
+ pdf_obj *Dest = NULL;
+
+ code = pdfi_get_named_dest(ctx, (pdf_obj *)D_array, &Dest);
+ if (code < 0)
+ goto exit;
+ pdfi_countdown(D_array);
+ D_array = NULL;
+ if (pdfi_type_of(Dest) != PDF_DICT) {
+ pdfi_countdown(Dest);
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
}
+ code = pdfi_dict_knownget(ctx, (pdf_dict *)Dest, "D", (pdf_obj **)&D_array);
+ pdfi_countdown(Dest);
+ if (code <= 0)
+ goto exit;
+ }
+ if (pdfi_type_of(D_array) != PDF_ARRAY) {
+ code = gs_note_error(gs_error_typecheck);
goto exit;
}
+
/* Process the D array to replace with /Page /View */
code = pdfi_pdfmark_add_Page_View(ctx, dict, D_array);
if (code < 0) goto exit;
@@ -1043,7 +1295,7 @@ void pdfi_pdfmark_write_boxes(pdf_context *ctx, pdf_dict *page_dict)
pdf_array *new_array = NULL;
/* Box is present in page dicitonayr, check it's an array */
- if (o->type != PDF_ARRAY) {
+ if (pdfi_type_of(o) != PDF_ARRAY) {
pdfi_countdown(o);
continue;
}
diff --git a/pdf/pdf_misc.c b/pdf/pdf_misc.c
index 11c5dde5..e027baec 100644
--- a/pdf/pdf_misc.c
+++ b/pdf/pdf_misc.c
@@ -149,7 +149,7 @@ int pdfi_setrenderingintent(pdf_context *ctx, pdf_name *n)
int pdfi_string_from_name(pdf_context *ctx, pdf_name *n, char **str, int *len)
{
- if (n->type != PDF_NAME)
+ if (pdfi_type_of(n) != PDF_NAME)
return gs_note_error(gs_error_typecheck);
*str = NULL;
@@ -166,6 +166,13 @@ int pdfi_string_from_name(pdf_context *ctx, pdf_name *n, char **str, int *len)
return 0;
}
+int pdfi_free_string_from_name(pdf_context *ctx, char *str)
+{
+ if (str != NULL)
+ gs_free_object(ctx->memory, str, "pdfi_free_string_from_name");
+ return 0;
+}
+
void normalize_rectangle(double *d)
{
double d1[4];
diff --git a/pdf/pdf_misc.h b/pdf/pdf_misc.h
index 8642b088..a879ec2b 100644
--- a/pdf/pdf_misc.h
+++ b/pdf/pdf_misc.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019-2021 Artifex Software, Inc.
+/* Copyright (C) 2019-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -23,6 +23,7 @@ bool pdfi_name_is(const pdf_name *n, const char *s);
int pdfi_name_cmp(const pdf_name *n1, const pdf_name *n2);
int pdfi_string_cmp(const pdf_string *n1, const pdf_string *n2);
int pdfi_string_from_name(pdf_context *ctx, pdf_name *n, char **str, int *len);
+int pdfi_free_string_from_name(pdf_context *ctx, char *str);
gs_color_space_index pdfi_get_color_space_index(pdf_context *ctx, const gs_color_space *pcs);
gs_color_space_index pdfi_currentcolorspace(pdf_context *ctx, int index);
diff --git a/pdf/pdf_obj.c b/pdf/pdf_obj.c
index 58bd59b0..aae9401b 100644
--- a/pdf/pdf_obj.c
+++ b/pdf/pdf_obj.c
@@ -36,12 +36,12 @@
int pdfi_object_alloc(pdf_context *ctx, pdf_obj_type type, unsigned int size, pdf_obj **obj)
{
int bytes = 0;
+ int code = 0;
switch(type) {
case PDF_ARRAY_MARK:
case PDF_DICT_MARK:
case PDF_PROC_MARK:
- case PDF_NULL:
bytes = sizeof(pdf_obj);
break;
case PDF_INT:
@@ -50,7 +50,10 @@ int pdfi_object_alloc(pdf_context *ctx, pdf_obj_type type, unsigned int size, pd
break;
case PDF_STRING:
case PDF_NAME:
- bytes = sizeof(pdf_string) + size - sizeof(PDF_NAME_DECLARED_LENGTH);
+ bytes = sizeof(pdf_string) + size - PDF_NAME_DECLARED_LENGTH;
+ break;
+ case PDF_BUFFER:
+ bytes = sizeof(pdf_buffer);
break;
case PDF_ARRAY:
bytes = sizeof(pdf_array);
@@ -61,11 +64,8 @@ int pdfi_object_alloc(pdf_context *ctx, pdf_obj_type type, unsigned int size, pd
case PDF_INDIRECT:
bytes = sizeof(pdf_indirect_ref);
break;
- case PDF_BOOL:
- bytes = sizeof(pdf_bool);
- break;
case PDF_KEYWORD:
- bytes = sizeof(pdf_keyword) + size - sizeof(PDF_NAME_DECLARED_LENGTH);
+ bytes = sizeof(pdf_keyword) + size - PDF_NAME_DECLARED_LENGTH;
break;
/* The following aren't PDF object types, but are objects we either want to
* reference count, or store on the stack.
@@ -76,23 +76,34 @@ int pdfi_object_alloc(pdf_context *ctx, pdf_obj_type type, unsigned int size, pd
case PDF_STREAM:
bytes = sizeof(pdf_stream);
break;
+ case PDF_NULL:
+ case PDF_BOOL:
default:
- return_error(gs_error_typecheck);
+ code = gs_note_error(gs_error_typecheck);
+ goto error_out;
}
*obj = (pdf_obj *)gs_alloc_bytes(ctx->memory, bytes, "pdfi_object_alloc");
- if (*obj == NULL)
- return_error(gs_error_VMerror);
+ if (*obj == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error_out;
+ }
memset(*obj, 0x00, bytes);
(*obj)->ctx = ctx;
(*obj)->type = type;
switch(type) {
+/* PDF_NULL and PDF_BOOL are now handled as special (not allocated) data types
+ and we will return an error in the switch above if we get a call to allocate
+ one of these. Having the cases isn't harmful but Coverity complains of dead
+ code, so commenting these out to silence Coverity while preserving the old
+ semantics to indicate what's happening.
case PDF_NULL:
+ case PDF_BOOL: */
+
case PDF_INT:
case PDF_REAL:
case PDF_INDIRECT:
- case PDF_BOOL:
case PDF_ARRAY_MARK:
case PDF_DICT_MARK:
case PDF_PROC_MARK:
@@ -102,6 +113,24 @@ int pdfi_object_alloc(pdf_context *ctx, pdf_obj_type type, unsigned int size, pd
case PDF_NAME:
((pdf_string *)*obj)->length = size;
break;
+ case PDF_BUFFER:
+ {
+ pdf_buffer *b = (pdf_buffer *)*obj;
+ /* NOTE: size can be 0 if the caller wants to allocate the data area itself
+ */
+ if (size > 0) {
+ b->data = gs_alloc_bytes(ctx->memory, size, "pdfi_object_alloc");
+ if (b->data == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error_out;
+ }
+ }
+ else {
+ b->data = NULL;
+ }
+ b->length = size;
+ }
+ break;
case PDF_ARRAY:
{
pdf_obj **values = NULL;
@@ -110,10 +139,8 @@ int pdfi_object_alloc(pdf_context *ctx, pdf_obj_type type, unsigned int size, pd
if (size > 0) {
values = (pdf_obj **)gs_alloc_bytes(ctx->memory, size * sizeof(pdf_obj *), "pdfi_object_alloc");
if (values == NULL) {
- gs_free_object(ctx->memory, *obj, "pdfi_object_alloc");
- gs_free_object(ctx->memory, values, "pdfi_object_alloc");
- *obj = NULL;
- return_error(gs_error_VMerror);
+ code = gs_note_error(gs_error_VMerror);
+ goto error_out;
}
((pdf_array *)*obj)->values = values;
memset(((pdf_array *)*obj)->values, 0x00, size * sizeof(pdf_obj *));
@@ -128,9 +155,8 @@ int pdfi_object_alloc(pdf_context *ctx, pdf_obj_type type, unsigned int size, pd
if (size > 0) {
entries = (pdf_dict_entry *)gs_alloc_bytes(ctx->memory, size * sizeof(pdf_dict_entry), "pdfi_object_alloc");
if (entries == NULL) {
- gs_free_object(ctx->memory, *obj, "pdfi_object_alloc");
- *obj = NULL;
- return_error(gs_error_VMerror);
+ code = gs_note_error(gs_error_VMerror);
+ goto error_out;
}
((pdf_dict *)*obj)->list = entries;
memset(((pdf_dict *)*obj)->list, 0x00, size * sizeof(pdf_dict_entry));
@@ -150,6 +176,10 @@ int pdfi_object_alloc(pdf_context *ctx, pdf_obj_type type, unsigned int size, pd
dmprintf2(ctx->memory, "Allocated object of type %c with UID %"PRIi64"\n", (*obj)->type, (*obj)->UID);
#endif
return 0;
+error_out:
+ gs_free_object(ctx->memory, *obj, "pdfi_object_alloc");
+ *obj = NULL;
+ return code;
}
/* Create a PDF number object from a numeric value. Attempts to create
@@ -217,25 +247,36 @@ static void pdfi_free_stream(pdf_obj *o)
gs_free_object(OBJ_MEMORY(o), o, "pdfi_free_stream");
}
+static void pdfi_free_buffer(pdf_obj *o)
+{
+ pdf_buffer *b = (pdf_buffer *)o;
+
+ gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_free_buffer(data)");
+ gs_free_object(OBJ_MEMORY(o), o, "pdfi_free_buffer");
+}
+
void pdfi_free_object(pdf_obj *o)
{
if (o == NULL)
return;
+ if ((intptr_t)o < (intptr_t)TOKEN__LAST_KEY)
+ return;
switch(o->type) {
case PDF_ARRAY_MARK:
case PDF_DICT_MARK:
case PDF_PROC_MARK:
- case PDF_NULL:
case PDF_INT:
case PDF_REAL:
case PDF_INDIRECT:
- case PDF_BOOL:
gs_free_object(OBJ_MEMORY(o), o, "pdf interpreter object refcount to 0");
break;
case PDF_STRING:
case PDF_NAME:
pdfi_free_namestring(o);
break;
+ case PDF_BUFFER:
+ pdfi_free_buffer(o);
+ break;
case PDF_ARRAY:
pdfi_free_array(o);
break;
@@ -257,8 +298,12 @@ void pdfi_free_object(pdf_obj *o)
case PDF_CMAP:
pdfi_free_cmap(o);
break;
+ case PDF_BOOL:
+ case PDF_NULL:
+ dbgmprintf(OBJ_MEMORY(o), "!!! Attempting to free non-allocated object type !!!\n");
+ break;
default:
- dbgmprintf(OBJ_MEMORY(o), "!!! Attempting to free unknown obect type !!!\n");
+ dbgmprintf(OBJ_MEMORY(o), "!!! Attempting to free unknown object type !!!\n");
break;
}
}
@@ -274,7 +319,7 @@ int pdfi_obj_dict_to_stream(pdf_context *ctx, pdf_dict *dict, pdf_stream **strea
int code = 0;
pdf_stream *new_stream = NULL;
- if (dict->type != PDF_DICT)
+ if (pdfi_type_of(dict) != PDF_DICT)
return_error(gs_error_typecheck);
code = pdfi_object_alloc(ctx, PDF_STREAM, 0, (pdf_obj **)&new_stream);
@@ -445,7 +490,7 @@ int pdfi_obj_get_label(pdf_context *ctx, pdf_obj *obj, char **label)
goto exit;
}
- if (obj->type == PDF_INDIRECT)
+ if (pdfi_type_of(obj) == PDF_INDIRECT)
snprintf(string, length, template, ref->ref_object_num, ref->ref_generation_num);
else
snprintf(string, length, template, obj->object_num, obj->generation_num);
@@ -566,10 +611,10 @@ static int pdfi_obj_indirect_str(pdf_context *ctx, pdf_obj *obj, byte **data, in
if (code < 0 && code != gs_error_circular_reference)
goto exit;
if (code == 0) {
- if (object->type == PDF_STREAM) {
+ if (pdfi_type_of(object) == PDF_STREAM) {
code = pdfi_pdfmark_stream(ctx, (pdf_stream *)object);
if (code < 0) goto exit;
- } else if (object->type == PDF_DICT) {
+ } else if (pdfi_type_of(object) == PDF_DICT) {
code = pdfi_pdfmark_dict(ctx, (pdf_dict *)object);
if (code < 0) goto exit;
} else {
@@ -596,13 +641,12 @@ static int pdfi_obj_bool_str(pdf_context *ctx, pdf_obj *obj, byte **data, int *l
{
int code = 0;
int size = 5;
- pdf_bool *bool = (pdf_bool *)obj;
char *buf;
buf = (char *)gs_alloc_bytes(ctx->memory, size, "pdfi_obj_bool_str(data)");
if (buf == NULL)
return_error(gs_error_VMerror);
- if (bool->value) {
+ if (obj == PDF_TRUE_OBJ) {
memcpy(buf, (byte *)"true", 4);
*len = 4;
} else {
@@ -665,6 +709,8 @@ static int pdfi_obj_string_str(pdf_context *ctx, pdf_obj *obj, byte **data, int
* can have special characters. So I will handle the minimum that seems needed for that.
*/
switch (*ptr) {
+ case 0x0a:
+ case 0x0d:
case '(':
case ')':
case '\\':
@@ -694,6 +740,16 @@ static int pdfi_obj_string_str(pdf_context *ctx, pdf_obj *obj, byte **data, int
bufptr = buf + 1;
for (i=0,ptr=string->data;i<string_len;i++) {
switch (*ptr) {
+ case 0x0d:
+ *bufptr++ = '\\';
+ *bufptr++ = 'r';
+ ptr++;
+ continue;
+ case 0x0a:
+ *bufptr++ = '\\';
+ *bufptr++ = 'n';
+ ptr++;
+ continue;
case '(':
case ')':
case '\\':
@@ -920,6 +976,28 @@ static int pdfi_obj_dict_str(pdf_context *ctx, pdf_obj *obj, byte **data, int *l
return code;
}
+#define PARAM1(A) # A,
+#define PARAM2(A,B) A,
+static const char pdf_token_strings[][10] = {
+#include "pdf_tokens.h"
+};
+
+static int pdfi_obj_fast_keyword_str(pdf_context *ctx, pdf_obj *obj, byte **data, int *len)
+{
+ int code = 0;
+ const char *s = pdf_token_strings[(uintptr_t)obj];
+ int size = (int)strlen(s) + 1;
+ byte *buf;
+
+ buf = gs_alloc_bytes(ctx->memory, size, "pdfi_obj_name_str(data)");
+ if (buf == NULL)
+ return_error(gs_error_VMerror);
+ memcpy(buf, s, size);
+ *data = buf;
+ *len = size;
+ return code;
+}
+
obj_str_dispatch_t obj_str_dispatch[] = {
{PDF_NAME, pdfi_obj_name_str},
{PDF_ARRAY, pdfi_obj_array_str},
@@ -931,6 +1009,7 @@ obj_str_dispatch_t obj_str_dispatch[] = {
{PDF_STREAM, pdfi_obj_stream_str},
{PDF_INDIRECT, pdfi_obj_indirect_str},
{PDF_NULL, pdfi_obj_null_str},
+ {PDF_FAST_KEYWORD, pdfi_obj_fast_keyword_str},
{0, NULL}
};
@@ -940,11 +1019,13 @@ int pdfi_obj_to_string(pdf_context *ctx, pdf_obj *obj, byte **data, int *len)
{
obj_str_dispatch_t *dispatch_ptr;
int code = 0;
+ pdf_obj_type type;
*data = NULL;
*len = 0;
+ type = pdfi_type_of(obj);
for (dispatch_ptr = obj_str_dispatch; dispatch_ptr->func; dispatch_ptr ++) {
- if (obj->type == dispatch_ptr->type) {
+ if (type == dispatch_ptr->type) {
code = dispatch_ptr->func(ctx, obj, data, len);
goto exit;
}
diff --git a/pdf/pdf_obj.h b/pdf/pdf_obj.h
index 99c9a178..eb512db9 100644
--- a/pdf/pdf_obj.h
+++ b/pdf/pdf_obj.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2020-2021 Artifex Software, Inc.
+/* Copyright (C) 2020-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -25,4 +25,90 @@ int pdfi_obj_charstr_to_name(pdf_context *ctx, const char *charstr, pdf_name **n
int pdfi_obj_get_label(pdf_context *ctx, pdf_obj *obj, char **label);
int pdfi_num_alloc(pdf_context *ctx, double d, pdf_num **num);
+static inline int
+pdfi_obj_to_real(pdf_context *ctx, pdf_obj *obj, double *d)
+{
+ pdf_num *num = (pdf_num *)obj;
+
+ switch (pdfi_type_of(num)) {
+ case PDF_INT:
+ *d = (double)num->value.i;
+ break;
+ case PDF_REAL:
+ *d = num->value.d;
+ break;
+ default:
+ return_error(gs_error_typecheck);
+ }
+
+ return 0;
+}
+
+static inline int
+pdfi_obj_to_float(pdf_context *ctx, pdf_obj *obj, float *f)
+{
+ pdf_num *num = (pdf_num *)obj;
+
+ switch (pdfi_type_of(num)) {
+ case PDF_INT:
+ *f = (float)num->value.i;
+ break;
+ case PDF_REAL:
+ *f = (float)num->value.d;
+ break;
+ default:
+ return_error(gs_error_typecheck);
+ }
+
+ return 0;
+}
+
+static inline int
+pdfi_obj_to_int(pdf_context *ctx, pdf_obj *obj, int64_t *i)
+{
+ pdf_num *num = (pdf_num *)obj;
+ int64_t tmp;
+
+ switch (pdfi_type_of(num)) {
+ case PDF_INT:
+ *i = num->value.i;
+ break;
+ case PDF_REAL:
+ /* We shouldn't be given a real here. We will grudgingly accept
+ * (with a warning) an int given as a real, but will error out
+ * otherwise. If we find a case where we need to accept reals
+ * as ints, we'll do a new version of this function called something
+ * like pdfi_obj_real_as_int what will just cast it down. */
+ tmp = (int64_t)num->value.d;
+ if ((double)tmp != num->value.d) {
+ return_error(gs_error_typecheck);
+ }
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_INT_AS_REAL, "pdfi_obj_to_int", NULL);
+ *i = tmp;
+ break;
+ default:
+ return_error(gs_error_typecheck);
+ }
+
+ return 0;
+}
+
+/* NOTE: the buffer object takes ownership of "data" */
+static inline int
+pdfi_buffer_set_data(pdf_obj *o, byte *data, int32_t length)
+{
+ pdf_buffer *b = (pdf_buffer *)o;
+ if (pdfi_type_of(b) != PDF_BUFFER) {
+ return_error(gs_error_typecheck);
+ }
+
+ if (b->data) {
+ gs_free_object(OBJ_MEMORY(b), b->data, "pdfi_buffer_set_data(data)");
+ }
+ b->data = data;
+ b->length = length;
+ return 0;
+}
+
+
#endif
diff --git a/pdf/pdf_optcontent.c b/pdf/pdf_optcontent.c
index 484d72c9..288ee231 100644
--- a/pdf/pdf_optcontent.c
+++ b/pdf/pdf_optcontent.c
@@ -167,8 +167,8 @@ pdfi_oc_check_OCMD_array(pdf_context *ctx, pdf_array *array, ocmd_p_type type)
code = pdfi_array_get(ctx, array, i, &val);
if (code < 0) continue;
- if (val->type != PDF_DICT) {
- dmprintf1(ctx->memory, "WARNING: OCMD array contains item type %d, expected PDF_DICT or PDF_NULL\n", val->type);
+ if (pdfi_type_of(val) != PDF_DICT) {
+ dmprintf1(ctx->memory, "WARNING: OCMD array contains item type %d, expected PDF_DICT or PDF_NULL\n", pdfi_type_of(val));
pdfi_countdown(val);
val = NULL;
continue;
@@ -235,9 +235,9 @@ pdfi_oc_check_OCMD(pdf_context *ctx, pdf_dict *ocdict)
code = pdfi_dict_knownget(ctx, ocdict, "OCGs", &obj);
if (code <= 0)
goto cleanup;
- if (obj->type == PDF_ARRAY) {
+ if (pdfi_type_of(obj) == PDF_ARRAY) {
OCGs_array = (pdf_array *)obj;
- } else if (obj->type == PDF_DICT) {
+ } else if (pdfi_type_of(obj) == PDF_DICT) {
OCGs_dict = (pdf_dict *)obj;
} else {
goto cleanup;
@@ -367,7 +367,7 @@ static int pdfi_oc_levels_set(pdf_context *ctx, pdfi_oc_levels_t *levels, uint64
byte *new = NULL;
uint64_t newmax;
- if (index > levels->max_flags) {
+ if (index > levels->max_flags - 1) {
/* Expand the flags buffer */
newmax = levels->max_flags + NUM_CONTENT_LEVELS;
if (index > newmax)
@@ -390,7 +390,7 @@ static int pdfi_oc_levels_set(pdf_context *ctx, pdfi_oc_levels_t *levels, uint64
static int pdfi_oc_levels_clear(pdf_context *ctx, pdfi_oc_levels_t *levels, uint64_t index)
{
- if (index > levels->max_flags)
+ if (index > levels->max_flags - 1)
return -1;
if (levels->flags[index] != 0)
levels->num_off --;
@@ -446,16 +446,19 @@ int pdfi_op_MP(pdf_context *ctx)
goto exit;
o = ctx->stack_top[-1];
- if (o->type != PDF_NAME) {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
+ pdfi_countup(o);
+ pdfi_pop(ctx, 1);
+
+ if (pdfi_type_of(o) != PDF_NAME) {
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
}
code = pdfi_pdfmark_from_objarray(ctx, &o, 1, NULL, "MP");
ctx->BMClevel ++;
exit:
- pdfi_pop(ctx, 1);
+ pdfi_countdown(o);
return code;
}
@@ -463,17 +466,20 @@ int pdfi_op_DP(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
{
pdf_name *properties = NULL;
int code = 0;
- pdf_obj **objarray = NULL;
+ pdf_obj **objarray = NULL, *o = NULL;
if (pdfi_count_stack(ctx) < 2) {
pdfi_clearstack(ctx);
return gs_note_error(gs_error_stackunderflow);
}
- if (!ctx->device_state.writepdfmarks || !ctx->args.preservemarkedcontent)
+ if (!ctx->device_state.writepdfmarks || !ctx->args.preservemarkedcontent) {
+ pdfi_pop(ctx, 2); /* pop args */
goto exit;
+ }
- if ((ctx->stack_top[-2])->type != PDF_NAME) {
+ if (pdfi_type_of(ctx->stack_top[-2]) != PDF_NAME) {
+ pdfi_pop(ctx, 2); /* pop args */
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -485,30 +491,38 @@ int pdfi_op_DP(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
}
objarray[0] = ctx->stack_top[-2];
+ pdfi_countup(objarray[0]);
+ o = ctx->stack_top[-2];
+ pdfi_countup(o);
+ pdfi_pop(ctx, 2); /* pop args */
- if ((ctx->stack_top[-1])->type == PDF_NAME) {
- code = pdfi_find_resource(ctx, (unsigned char *)"Properties", (pdf_name *)ctx->stack_top[-1], stream_dict, page_dict, (pdf_obj **)&properties);
- if(code < 0)
- goto exit;
- if (properties->type != PDF_DICT) {
- code = gs_note_error(gs_error_typecheck);
- goto exit;
- }
- objarray[1] = (pdf_obj *)properties;
- } else {
- if ((ctx->stack_top[-1])->type != PDF_DICT) {
+ switch (pdfi_type_of(o)) {
+ case PDF_NAME:
+ code = pdfi_find_resource(ctx, (unsigned char *)"Properties", (pdf_name *)o, stream_dict, page_dict, (pdf_obj **)&properties);
+ if(code < 0)
+ goto exit;
+ if (pdfi_type_of(properties) != PDF_DICT) {
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
+ }
+ objarray[1] = (pdf_obj *)properties;
+ break;
+ case PDF_DICT:
+ objarray[1] = o;
+ break;
+ default:
code = gs_note_error(gs_error_VMerror);
goto exit;
- }
- objarray[1] = ctx->stack_top[-1];
}
code = pdfi_pdfmark_from_objarray(ctx, objarray, 2, NULL, "DP");
exit:
- if (objarray != NULL)
+ if (objarray != NULL) {
+ pdfi_countdown(objarray[0]);
gs_free_object(ctx->memory, objarray, "free pdfi_op_DP");
- pdfi_pop(ctx, 2); /* pop args */
+ }
+ pdfi_countdown(o);
pdfi_countdown(properties);
return code;
}
@@ -525,13 +539,18 @@ int pdfi_op_BMC(pdf_context *ctx)
if (pdfi_count_stack(ctx) < 1)
return_error(gs_error_stackunderflow);
- if (!ctx->device_state.writepdfmarks || !ctx->args.preservemarkedcontent)
+ if (!ctx->device_state.writepdfmarks || !ctx->args.preservemarkedcontent) {
+ pdfi_pop(ctx, 1);
goto exit;
+ }
o = ctx->stack_top[-1];
- if (o->type != PDF_NAME) {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
+ pdfi_countup(o);
+ pdfi_pop(ctx, 1);
+
+ if (pdfi_type_of(o) != PDF_NAME) {
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
}
ctx->BDCWasOC = false;
@@ -539,7 +558,7 @@ int pdfi_op_BMC(pdf_context *ctx)
ctx->BMClevel ++;
exit:
- pdfi_pop(ctx, 1);
+ pdfi_countdown(o);
return code;
}
@@ -551,7 +570,7 @@ int pdfi_op_BDC(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
pdf_dict *oc_dict = NULL;
int code = 0;
bool ocg_is_visible;
- pdf_obj **objarray = NULL;
+ pdf_obj **objarray = NULL, *o = NULL;;
/* This will also prevent us writing out an EMC if the BDC is in any way invalid */
ctx->BDCWasOC = true;
@@ -564,7 +583,12 @@ int pdfi_op_BDC(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
ctx->BMClevel ++;
tag = (pdf_name *)ctx->stack_top[-2];
- if (tag->type != PDF_NAME)
+ pdfi_countup(tag);
+ o = ctx->stack_top[-1];
+ pdfi_countup(o);
+ pdfi_pop(ctx, 2);
+
+ if (pdfi_type_of(tag) != PDF_NAME)
goto exit;
if (!pdfi_name_is(tag, "OC")) {
@@ -578,23 +602,25 @@ int pdfi_op_BDC(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
goto exit;
}
- objarray[0] = ctx->stack_top[-2];
-
- if ((ctx->stack_top[-1])->type == PDF_NAME) {
- code = pdfi_find_resource(ctx, (unsigned char *)"Properties", (pdf_name *)ctx->stack_top[-1], stream_dict, page_dict, (pdf_obj **)&oc_dict);
- if(code < 0)
- goto exit;
- if (oc_dict->type != PDF_DICT) {
- code = gs_note_error(gs_error_typecheck);
- goto exit;
- }
- objarray[1] = (pdf_obj *)oc_dict;
- } else {
- if ((ctx->stack_top[-1])->type != PDF_DICT) {
+ objarray[0] = (pdf_obj *)tag;
+
+ switch (pdfi_type_of(o)) {
+ case PDF_NAME:
+ code = pdfi_find_resource(ctx, (unsigned char *)"Properties", (pdf_name *)o, stream_dict, page_dict, (pdf_obj **)&oc_dict);
+ if(code < 0)
+ goto exit;
+ if (pdfi_type_of(oc_dict) != PDF_DICT) {
+ code = gs_note_error(gs_error_typecheck);
+ goto exit;
+ }
+ objarray[1] = (pdf_obj *)oc_dict;
+ break;
+ case PDF_DICT:
+ objarray[1] = o;
+ break;
+ default:
code = gs_note_error(gs_error_VMerror);
goto exit;
- }
- objarray[1] = ctx->stack_top[-1];
}
code = pdfi_pdfmark_from_objarray(ctx, objarray, 2, NULL, "BDC");
@@ -605,8 +631,8 @@ int pdfi_op_BDC(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
/* TODO: spec says it could also be an inline dict that we should be able to handle,
* but I am just matching what gs does for now, and it doesn't handle that case.
*/
- properties = (pdf_name *)ctx->stack_top[-1];
- if (properties->type != PDF_NAME)
+ properties = (pdf_name *)o;
+ if (pdfi_type_of(properties) != PDF_NAME)
goto exit;
/* If it's a name, look it up in Properties */
@@ -614,7 +640,7 @@ int pdfi_op_BDC(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
(pdf_dict *)stream_dict, page_dict, (pdf_obj **)&oc_dict);
if (code != 0)
goto exit;
- if (oc_dict->type != PDF_DICT)
+ if (pdfi_type_of(oc_dict) != PDF_DICT)
goto exit;
/* Now we have an OC dict, see if it's visible */
@@ -625,7 +651,8 @@ int pdfi_op_BDC(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
exit:
if (objarray != NULL)
gs_free_object(ctx->memory, objarray, "free pdfi_op_BDC");
- pdfi_pop(ctx, 2); /* pop args */
+ pdfi_countdown(o);
+ pdfi_countdown(tag);
pdfi_countdown(oc_dict);
return code;
}
diff --git a/pdf/pdf_page.c b/pdf/pdf_page.c
index f2389fea..b413b68d 100644
--- a/pdf/pdf_page.c
+++ b/pdf/pdf_page.c
@@ -56,7 +56,7 @@ static int pdfi_process_page_contents(pdf_context *ctx, pdf_dict *page_dict)
if (code < 0)
return code;
- if (o->type == PDF_INDIRECT) {
+ if (pdfi_type_of(o) == PDF_INDIRECT) {
if (((pdf_indirect_ref *)o)->ref_object_num == page_dict->object_num)
return_error(gs_error_circular_reference);
@@ -77,7 +77,7 @@ static int pdfi_process_page_contents(pdf_context *ctx, pdf_dict *page_dict)
}
ctx->encryption.decrypt_strings = false;
- if (o->type == PDF_ARRAY) {
+ if (pdfi_type_of(o) == PDF_ARRAY) {
pdf_array *a = (pdf_array *)o;
for (i=0;i < pdfi_array_size(a); i++) {
@@ -85,13 +85,13 @@ static int pdfi_process_page_contents(pdf_context *ctx, pdf_dict *page_dict)
code = pdfi_array_get_no_deref(ctx, a, i, (pdf_obj **)&r);
if (code < 0)
goto page_error;
- if (r->type == PDF_STREAM) {
+ if (pdfi_type_of (r) == PDF_STREAM) {
code = pdfi_interpret_content_stream(ctx, NULL, (pdf_stream *)r, page_dict);
pdfi_countdown(r);
if (code < 0)
goto page_error;
} else {
- if (r->type != PDF_INDIRECT) {
+ if (pdfi_type_of(r) != PDF_INDIRECT) {
pdfi_countdown(r);
code = gs_note_error(gs_error_typecheck);
goto page_error;
@@ -108,7 +108,7 @@ static int pdfi_process_page_contents(pdf_context *ctx, pdf_dict *page_dict)
code = 0;
goto page_error;
}
- if (o1->type != PDF_STREAM) {
+ if (pdfi_type_of(o1) != PDF_STREAM) {
pdfi_countdown(o1);
code = gs_note_error(gs_error_typecheck);
goto page_error;
@@ -123,7 +123,7 @@ static int pdfi_process_page_contents(pdf_context *ctx, pdf_dict *page_dict)
}
}
} else {
- if (o->type == PDF_STREAM) {
+ if (pdfi_type_of(o) == PDF_STREAM) {
code = pdfi_interpret_content_stream(ctx, NULL, (pdf_stream *)o, page_dict);
} else {
pdfi_countdown(o);
@@ -295,14 +295,23 @@ static int pdfi_set_media_size(pdf_context *ctx, pdf_dict *page_dict)
if (a == NULL) {
code = pdfi_dict_get_type(ctx, page_dict, "CropBox", PDF_ARRAY, (pdf_obj **)&a);
if (code >= 0 && pdfi_array_size(a) >= 4) {
+ pdf_obj *box_obj = NULL;
+
for (i=0;i<4;i++) {
- code = pdfi_array_get_number(ctx, a, i, &d_crop[i]);
- d_crop[i] *= userunit;
+ code = pdfi_array_get_no_store_R(ctx, a, i, &box_obj);
+ if (code >= 0) {
+ code = pdfi_obj_to_real(ctx, box_obj, &d_crop[i]);
+ pdfi_countdown(box_obj);
+ }
+ if (code < 0)
+ break;
}
pdfi_countdown(a);
- normalize_rectangle(d_crop);
- memcpy(ctx->page.Crop, d_crop, 4 * sizeof(double));
- do_crop = true;
+ if (code >= 0) {
+ normalize_rectangle(d_crop);
+ memcpy(ctx->page.Crop, d_crop, 4 * sizeof(double));
+ do_crop = true;
+ }
}
a = default_media;
}
@@ -313,7 +322,20 @@ static int pdfi_set_media_size(pdf_context *ctx, pdf_dict *page_dict)
ctx->page.UserUnit = userunit;
for (i=0;i<4;i++) {
- code = pdfi_array_get_number(ctx, a, i, &d[i]);
+ pdf_obj *box_obj = NULL;
+
+ code = pdfi_array_get_no_store_R(ctx, a, i, &box_obj);
+ if (code >= 0) {
+ code = pdfi_obj_to_real(ctx, box_obj, &d[i]);
+ pdfi_countdown(box_obj);
+ }
+
+ if (code < 0) {
+ pdfi_countdown(a);
+ pdfi_set_warning(ctx, code, NULL, W_PDF_BAD_MEDIABOX, "pdfi_get_media_size", NULL);
+ code = gs_erasepage(ctx->pgs);
+ return 0;
+ }
d[i] *= userunit;
}
pdfi_countdown(a);
@@ -458,26 +480,21 @@ static void pdfi_setup_transfers(pdf_context *ctx)
}
}
-static int store_box(pdf_context *ctx, float *box, pdf_array *a)
-{
- double f;
- int code = 0, i;
-
- for (i=0;i < 4;i++) {
- code = pdfi_array_get_number(ctx, a, (uint64_t)i, &f);
- if (code < 0)
- return code;
- box[i] = (float)f;
- }
- return 0;
-}
-
-int pdfi_page_info(pdf_context *ctx, uint64_t page_num, pdf_info_t *info)
+/* Return a dictionary containing information about the page. Basic information is that
+ * required to render the page; if extended is true then additionally contains an
+ * array of spot ink names and an array of dictionaries each of which contains
+ * information about a font used on the page. THis is normally only used for tools
+ * like pdf_info.ps
+ */
+int pdfi_page_info(pdf_context *ctx, uint64_t page_num, pdf_dict **info, bool extended)
{
- int code = 0;
- pdf_dict *page_dict = NULL;
+ int code = 0, i=0;
+ pdf_dict *page_dict = NULL, *info_dict = NULL;
+ pdf_array *fonts_array = NULL, *spots_array = NULL;
pdf_array *a = NULL;
- double dbl = 0.0;
+ pdf_obj *o = NULL;
+ bool known = false;
+ double dummy;
code = pdfi_page_get_dict(ctx, page_num, &page_dict);
if (code < 0)
@@ -488,79 +505,202 @@ int pdfi_page_info(pdf_context *ctx, uint64_t page_num, pdf_info_t *info)
goto done;
}
- code = pdfi_check_page(ctx, page_dict, false);
+ code = pdfi_dict_alloc(ctx, 6, &info_dict);
if (code < 0)
goto done;
- info->boxes = BOX_NONE;
+ pdfi_countup(info_dict);
+
+ if (extended)
+ code = pdfi_check_page(ctx, page_dict, &fonts_array, &spots_array, false);
+ else
+ code = pdfi_check_page(ctx, page_dict, NULL, NULL, false);
+ if (code < 0)
+ goto done;
+
+ if (spots_array != NULL) {
+ code = pdfi_dict_put(ctx, info_dict, "Spots", (pdf_obj *)spots_array);
+ if (code < 0)
+ goto done;
+ pdfi_countdown(spots_array);
+ }
+
+ if (fonts_array != NULL) {
+ code = pdfi_dict_put(ctx, info_dict, "Fonts", (pdf_obj *)fonts_array);
+ if (code < 0)
+ goto done;
+ pdfi_countdown(fonts_array);
+ }
+
code = pdfi_dict_get_type(ctx, page_dict, "MediaBox", PDF_ARRAY, (pdf_obj **)&a);
if (code < 0)
pdfi_set_warning(ctx, code, NULL, W_PDF_BAD_MEDIABOX, "pdfi_page_info", NULL);
if (code >= 0) {
- code = store_box(ctx, (float *)&info->MediaBox, a);
+ pdf_obj *box_obj = NULL;
+
+ for (i = 0;i < pdfi_array_size(a); i++) {
+ code = pdfi_array_get_no_store_R(ctx, a, i, &box_obj);
+ if (code >= 0) {
+ code = pdfi_obj_to_real(ctx, box_obj, &dummy);
+ pdfi_countdown(box_obj);
+ }
+ if (code < 0) {
+ pdfi_set_warning(ctx, code, NULL, W_PDF_BAD_MEDIABOX, "pdfi_page_info", NULL);
+ goto done;
+ }
+ }
+
+ code = pdfi_dict_put(ctx, info_dict, "MediaBox", (pdf_obj *)a);
if (code < 0)
goto done;
- info->boxes |= MEDIA_BOX;
pdfi_countdown(a);
a = NULL;
}
code = pdfi_dict_get_type(ctx, page_dict, "ArtBox", PDF_ARRAY, (pdf_obj **)&a);
if (code >= 0) {
- code = store_box(ctx, (float *)&info->ArtBox, a);
- if (code < 0)
- goto done;
- info->boxes |= ART_BOX;
+ pdf_obj *box_obj = NULL;
+
+ for (i = 0;i < pdfi_array_size(a); i++) {
+ code = pdfi_array_get_no_store_R(ctx, a, i, &box_obj);
+ if (code >= 0) {
+ code = pdfi_obj_to_real(ctx, box_obj, &dummy);
+ pdfi_countdown(box_obj);
+ }
+ if (code < 0)
+ break;
+ }
+ if (code >= 0) {
+ code = pdfi_dict_put(ctx, info_dict, "ArtBox", (pdf_obj *)a);
+ if (code < 0)
+ goto done;
+ }
pdfi_countdown(a);
a = NULL;
}
code = pdfi_dict_get_type(ctx, page_dict, "CropBox", PDF_ARRAY, (pdf_obj **)&a);
if (code >= 0) {
- code = store_box(ctx, (float *)&info->CropBox, a);
- if (code < 0)
- goto done;
- info->boxes |= CROP_BOX;
+ pdf_obj *box_obj = NULL;
+
+ for (i = 0;i < pdfi_array_size(a); i++) {
+ code = pdfi_array_get_no_store_R(ctx, a, i, &box_obj);
+ if (code >= 0) {
+ code = pdfi_obj_to_real(ctx, box_obj, &dummy);
+ pdfi_countdown(box_obj);
+ }
+ if (code < 0)
+ break;
+ }
+ if (code >= 0) {
+ code = pdfi_dict_put(ctx, info_dict, "CropBox", (pdf_obj *)a);
+ if (code < 0)
+ goto done;
+ }
pdfi_countdown(a);
a = NULL;
}
code = pdfi_dict_get_type(ctx, page_dict, "TrimBox", PDF_ARRAY, (pdf_obj **)&a);
if (code >= 0) {
- code = store_box(ctx, (float *)&info->TrimBox, a);
- if (code < 0)
- goto done;
- info->boxes |= TRIM_BOX;
+ pdf_obj *box_obj = NULL;
+
+ for (i = 0;i < pdfi_array_size(a); i++) {
+ code = pdfi_array_get_no_store_R(ctx, a, i, &box_obj);
+ if (code >= 0) {
+ code = pdfi_obj_to_real(ctx, box_obj, &dummy);
+ pdfi_countdown(box_obj);
+ }
+ if (code < 0)
+ break;
+ }
+ if (code >= 0) {
+ code = pdfi_dict_put(ctx, info_dict, "TrimBox", (pdf_obj *)a);
+ if (code < 0)
+ goto done;
+ }
pdfi_countdown(a);
a = NULL;
}
code = pdfi_dict_get_type(ctx, page_dict, "BleedBox", PDF_ARRAY, (pdf_obj **)&a);
if (code >= 0) {
- code = store_box(ctx, (float *)&info->BleedBox, a);
- if (code < 0)
- goto done;
- info->boxes |= BLEED_BOX;
+ pdf_obj *box_obj = NULL;
+
+ for (i = 0;i < pdfi_array_size(a); i++) {
+ code = pdfi_array_get_no_store_R(ctx, a, i, &box_obj);
+ if (code >= 0) {
+ code = pdfi_obj_to_real(ctx, box_obj, &dummy);
+ pdfi_countdown(box_obj);
+ }
+ if (code < 0)
+ break;
+ }
+ if (code >= 0) {
+ code = pdfi_dict_put(ctx, info_dict, "BleedBox", (pdf_obj *)a);
+ if (code < 0)
+ goto done;
+ }
pdfi_countdown(a);
a = NULL;
}
code = 0;
- dbl = info->Rotate = 0;
- code = pdfi_dict_get_number(ctx, page_dict, "Rotate", &dbl);
- code = 0;
- info->Rotate = dbl;
+ code = pdfi_dict_get(ctx, page_dict, "Rotate", &o);
+ if (code >= 0) {
+ if (pdfi_type_of(o) == PDF_INT || pdfi_type_of(o) == PDF_REAL) {
+ code = pdfi_dict_put(ctx, info_dict, "Rotate", o);
+ if (code < 0)
+ goto done;
+ }
+ pdfi_countdown(o);
+ }
- dbl = info->UserUnit = 1;
- code = pdfi_dict_get_number(ctx, page_dict, "UserUnit", &dbl);
- code = 0;
- info->UserUnit = dbl;
+ code = pdfi_dict_get(ctx, page_dict, "UserUnit", &o);
+ if (code >= 0) {
+ if (pdfi_type_of(o) == PDF_INT || pdfi_type_of(o) == PDF_REAL) {
+ code = pdfi_dict_put(ctx, info_dict, "UserUnit", o);
+ if (code < 0)
+ goto done;
+ }
+ pdfi_countdown(o);
+ }
+
+ if (ctx->page.has_transparency)
+ code = pdfi_dict_put(ctx, info_dict, "UsesTransparency", PDF_TRUE_OBJ);
+ else
+ code = pdfi_dict_put(ctx, info_dict, "UsesTransparency", PDF_FALSE_OBJ);
+ if (code < 0)
+ goto done;
+
+ code = pdfi_dict_known(ctx, page_dict, "Annots", &known);
+ if (code >= 0 && known)
+ code = pdfi_dict_put(ctx, info_dict, "Annots", PDF_TRUE_OBJ);
+ else
+ code = pdfi_dict_put(ctx, info_dict, "Annots", PDF_FALSE_OBJ);
+ if (code < 0)
+ goto done;
- info->HasTransparency = ctx->page.has_transparency;
- info->NumSpots = ctx->page.num_spots;
+ code = pdfi_object_alloc(ctx, PDF_INT, 0, &o);
+ if (code >= 0) {
+ pdfi_countup(o);
+ ((pdf_num *)o)->value.i = ctx->page.num_spots;
+ code = pdfi_dict_put(ctx, info_dict, "NumSpots", o);
+ pdfi_countdown(o);
+ o = NULL;
+ if (code < 0)
+ goto done;
+ }
done:
+ if (code < 0) {
+ pdfi_countdown(info_dict);
+ info_dict = NULL;
+ *info = NULL;
+ } else
+ *info = info_dict;
+
pdfi_countdown(a);
pdfi_countdown(page_dict);
return code;
@@ -585,7 +725,7 @@ int pdfi_page_get_dict(pdf_context *ctx, uint64_t page_num, pdf_dict **dict)
code = pdfi_dict_get(ctx, ctx->Root, "Pages", &o);
if (code < 0)
goto page_error;
- if (o->type != PDF_DICT) {
+ if (pdfi_type_of(o) != PDF_DICT) {
code = gs_note_error(gs_error_typecheck);
goto page_error;
}
@@ -663,14 +803,35 @@ int pdfi_page_get_number(pdf_context *ctx, pdf_dict *target_dict, uint64_t *page
static void release_page_DefaultSpaces(pdf_context *ctx)
{
if (ctx->page.DefaultGray_cs != NULL) {
+ if (ctx->page.DefaultGray_cs->interpreter_data != NULL) {
+ pdf_obj *o = (pdf_obj *)(ctx->page.DefaultGray_cs->interpreter_data);
+ if (o != NULL && pdfi_type_of(o) == PDF_NAME) {
+ pdfi_countdown(o);
+ ctx->page.DefaultGray_cs->interpreter_data = NULL;
+ }
+ }
rc_decrement(ctx->page.DefaultGray_cs, "pdfi_page_render");
ctx->page.DefaultGray_cs = NULL;
}
if (ctx->page.DefaultRGB_cs != NULL) {
+ if (ctx->page.DefaultRGB_cs->interpreter_data != NULL) {
+ pdf_obj *o = (pdf_obj *)(ctx->page.DefaultRGB_cs->interpreter_data);
+ if (o != NULL && pdfi_type_of(o) == PDF_NAME) {
+ pdfi_countdown(o);
+ ctx->page.DefaultRGB_cs->interpreter_data = NULL;
+ }
+ }
rc_decrement(ctx->page.DefaultRGB_cs, "pdfi_page_render");
ctx->page.DefaultRGB_cs = NULL;
}
if (ctx->page.DefaultCMYK_cs != NULL) {
+ if (ctx->page.DefaultCMYK_cs->interpreter_data != NULL) {
+ pdf_obj *o = (pdf_obj *)(ctx->page.DefaultCMYK_cs->interpreter_data);
+ if (o != NULL && pdfi_type_of(o) == PDF_NAME) {
+ pdfi_countdown(o);
+ ctx->page.DefaultCMYK_cs->interpreter_data = NULL;
+ }
+ }
rc_decrement(ctx->page.DefaultCMYK_cs, "pdfi_page_render");
ctx->page.DefaultCMYK_cs = NULL;
}
@@ -684,6 +845,12 @@ static int setup_page_DefaultSpaces(pdf_context *ctx, pdf_dict *page_dict)
return(pdfi_setup_DefaultSpaces(ctx, page_dict));
}
+static bool
+pdfi_pattern_purge_all_proc(gx_color_tile * ctile, void *proc_data)
+{
+ return true;
+}
+
int pdfi_page_render(pdf_context *ctx, uint64_t page_num, bool init_graphics)
{
int code, code1=0;
@@ -714,7 +881,7 @@ int pdfi_page_render(pdf_context *ctx, uint64_t page_num, bool init_graphics)
pdfi_device_set_flags(ctx);
- code = pdfi_check_page(ctx, page_dict, init_graphics);
+ code = pdfi_check_page(ctx, page_dict, NULL, NULL, init_graphics);
if (code < 0)
goto exit3;
@@ -729,8 +896,12 @@ int pdfi_page_render(pdf_context *ctx, uint64_t page_num, bool init_graphics)
}
code = pdfi_dict_knownget_type(ctx, page_dict, "Group", PDF_DICT, (pdf_obj **)&group_dict);
+ /* Ignore errors retrieving the Group dictionary, we will just ignore it. This allows us
+ * to handle files such as Bug #705206 where the Group dictionary is a free object in a
+ * compressed object stream.
+ */
if (code < 0)
- goto exit3;
+ pdfi_set_error(ctx, 0, NULL, E_BAD_GROUP_DICT, "pdfi_page_render", NULL);
if (group_dict != NULL)
page_group_known = true;
@@ -864,7 +1035,12 @@ exit3:
release_page_DefaultSpaces(ctx);
- if (code == 0 || (!ctx->args.pdfstoponerror && code != gs_error_stackoverflow))
+ /* Flush any pattern tiles. We don't want to (potentially) return to PostScript
+ * with any pattern tiles referencing our objects, in case the garbager runs.
+ */
+ gx_pattern_cache_winnow(gstate_pattern_cache(ctx->pgs), pdfi_pattern_purge_all_proc, NULL);
+
+ if (code == 0 || (!ctx->args.pdfstoponerror && code != gs_error_pdf_stackoverflow))
if (!page_dict_error && ctx->finish_page != NULL)
code = ctx->finish_page(ctx);
return code;
diff --git a/pdf/pdf_page.h b/pdf/pdf_page.h
index b5fd3e2a..156f3794 100644
--- a/pdf/pdf_page.h
+++ b/pdf/pdf_page.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019-2021 Artifex Software, Inc.
+/* Copyright (C) 2019-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -18,30 +18,8 @@
#ifndef PDF_PAGE_OPERATORS
#define PDF_PAGE_OPERATORS
-typedef enum pdfi_box_enum_e {
- BOX_NONE = 0,
- MEDIA_BOX = 1,
- CROP_BOX = 2,
- TRIM_BOX = 4,
- ART_BOX = 8,
- BLEED_BOX = 16
-}pdfi_box_enum;
-
-typedef struct {
- bool HasTransparency;
- int NumSpots;
- pdfi_box_enum boxes;
- float MediaBox[4];
- float CropBox[4];
- float ArtBox[4];
- float BleedBox[4];
- float TrimBox[4];
- float Rotate;
- float UserUnit;
-} pdf_info_t;
-
int pdfi_page_render(pdf_context *ctx, uint64_t page_num, bool init_graphics);
-int pdfi_page_info(pdf_context *ctx, uint64_t page_num, pdf_info_t *info);
+int pdfi_page_info(pdf_context *ctx, uint64_t page_num, pdf_dict **info_dict, bool extended);
int pdfi_page_graphics_begin(pdf_context *ctx);
int pdfi_page_get_dict(pdf_context *ctx, uint64_t page_num, pdf_dict **dict);
int pdfi_page_get_number(pdf_context *ctx, pdf_dict *target_dict, uint64_t *page_num);
diff --git a/pdf/pdf_path.c b/pdf/pdf_path.c
index a9724def..56a59b07 100644
--- a/pdf/pdf_path.c
+++ b/pdf/pdf_path.c
@@ -26,88 +26,227 @@
#include "gspath.h" /* For gs_moveto() and friends */
#include "gspaint.h" /* For gs_fill() and friends */
-int pdfi_moveto (pdf_context *ctx)
+typedef enum path_segment_e {
+ pdfi_moveto_seg,
+ pdfi_lineto_seg,
+ pdfi_curveto_seg,
+ pdfi_re_seg,
+ pdfi_v_curveto_seg,
+ pdfi_y_curveto_seg,
+ pdfi_closepath_seg
+} pdfi_path_segment;
+
+static int StorePathSegment(pdf_context *ctx, pdfi_path_segment segment, double *pts)
{
- pdf_num *n1, *n2;
- int code;
- double x, y;
+ int size = 0;
+
+ switch (segment)
+ {
+ case pdfi_moveto_seg:
+ case pdfi_lineto_seg:
+ size = 2;
+ break;
+ case pdfi_re_seg:
+ case pdfi_v_curveto_seg:
+ case pdfi_y_curveto_seg:
+ size = 4;
+ break;
+ case pdfi_curveto_seg:
+ size = 6;
+ break;
+ case pdfi_closepath_seg:
+ break;
+ default:
+ return_error(gs_error_undefined);
+ break;
+ }
+ if (ctx->PathSegments == NULL) {
+ ctx->PathSegments = (char *)gs_alloc_bytes(ctx->memory, 1024, "StorePathSegment");
+ if (ctx->PathSegments == NULL)
+ return_error(gs_error_VMerror);
+ ctx->PathSegmentsCurrent = ctx->PathSegments;
+ ctx->PathSegmentsTop = ctx->PathSegments + 1024;
+ }
+ if (ctx->PathSegmentsCurrent == ctx->PathSegmentsTop) {
+ char *new_accumulator = NULL;
+ uint64_t old_size;
+
+ old_size = ctx->PathSegmentsCurrent - ctx->PathSegments;
+ new_accumulator = (char *)gs_alloc_bytes(ctx->memory, old_size + 1024, "StorePathSegment");
+ if (new_accumulator == NULL)
+ return_error(gs_error_VMerror);
+ memcpy(new_accumulator, ctx->PathSegments, old_size);
+ ctx->PathSegmentsCurrent = new_accumulator + old_size;
+ gs_free_object(ctx->memory, ctx->PathSegments, "StorePathSegment");
+ ctx->PathSegments = new_accumulator;
+ ctx->PathSegmentsTop = ctx->PathSegments + old_size + 1024;
+ }
- if (ctx->text.BlockDepth != 0)
- pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_moveto", NULL);
+ if (ctx->PathPts == NULL) {
+ ctx->PathPts = (double *)gs_alloc_bytes(ctx->memory, 4096, "StorePathSegment");
+ if (ctx->PathPts == NULL)
+ return_error(gs_error_VMerror);
+ ctx->PathPtsCurrent = ctx->PathPts;
+ ctx->PathPtsTop = ctx->PathPts + (4096 / sizeof(double));
+ }
+ if (ctx->PathPtsCurrent + size > ctx->PathPtsTop) {
+ double *new_accumulator = NULL;
+ uint64_t old_size;
+
+ old_size = (char *)ctx->PathPtsCurrent - (char *)ctx->PathPts;
+ new_accumulator = (double *)gs_alloc_bytes(ctx->memory, old_size + 4096, "StorePathSegment");
+ if (new_accumulator == NULL)
+ return_error(gs_error_VMerror);
+ memcpy(new_accumulator, ctx->PathPts, old_size);
+ ctx->PathPtsCurrent = new_accumulator + (old_size / sizeof(double));
+ gs_free_object(ctx->memory, ctx->PathPts, "StorePathSegment");
+ ctx->PathPts = new_accumulator;
+ ctx->PathPtsTop = ctx->PathPts + ((old_size + 4096) / sizeof(double));
+ }
- if (pdfi_count_stack(ctx) < 2) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
+ *(ctx->PathSegmentsCurrent++) = (char)segment;
+ switch (segment)
+ {
+ case pdfi_moveto_seg:
+ case pdfi_lineto_seg:
+ memcpy(ctx->PathPtsCurrent, pts, 2 * sizeof(double));
+ ctx->PathPtsCurrent += 2;
+ break;
+ case pdfi_re_seg:
+ case pdfi_v_curveto_seg:
+ case pdfi_y_curveto_seg:
+ memcpy(ctx->PathPtsCurrent, pts, 4 * sizeof(double));
+ ctx->PathPtsCurrent += 4;
+ break;
+ case pdfi_curveto_seg:
+ memcpy(ctx->PathPtsCurrent, pts, 6 * sizeof(double));
+ ctx->PathPtsCurrent += 6;
+ break;
+ case pdfi_closepath_seg:
+ break;
}
+ return 0;
+}
- n1 = (pdf_num *)ctx->stack_top[-1];
- n2 = (pdf_num *)ctx->stack_top[-2];
- if (n1->type == PDF_INT){
- y = (double)n1->value.i;
- } else{
- if (n1->type == PDF_REAL) {
- y = n1->value.d;
- } else {
- pdfi_pop(ctx, 2);
- return_error(gs_error_typecheck);
- }
+static int ApplyStoredPath(pdf_context *ctx)
+{
+ int code = 0;
+ char *op = NULL;
+ double *dpts = NULL;
+
+ if (ctx->PathSegments == NULL)
+ return 0;
+
+ if (ctx->PathPts == NULL) {
+ code = gs_note_error(gs_error_unknownerror);
+ goto error;
+ }
+
+ if (ctx->pgs->current_point_valid) {
+ code = gs_newpath(ctx->pgs);
+ if (code < 0)
+ goto error;
}
- if (n2->type == PDF_INT){
- x = (double)n2->value.i;
- } else{
- if (n2->type == PDF_REAL) {
- x = n2->value.d;
- } else {
- pdfi_pop(ctx, 2);
- return_error(gs_error_typecheck);
+
+ op = ctx->PathSegments;
+ dpts = ctx->PathPts;
+
+ while (op < ctx->PathSegmentsCurrent) {
+ if (dpts > ctx->PathPtsCurrent) {
+ code = gs_note_error(gs_error_unknownerror);
+ goto error;
}
+
+ switch(*op++) {
+ case pdfi_moveto_seg:
+ code = gs_moveto(ctx->pgs, dpts[0], dpts[1]);
+ dpts+= 2;
+ break;
+ case pdfi_lineto_seg:
+ code = gs_lineto(ctx->pgs, dpts[0], dpts[1]);
+ dpts+= 2;
+ break;
+ case pdfi_re_seg:
+ code = gs_moveto(ctx->pgs, dpts[0], dpts[1]);
+ if (code >= 0) {
+ code = gs_rlineto(ctx->pgs, dpts[2], 0);
+ if (code >= 0) {
+ code = gs_rlineto(ctx->pgs, 0, dpts[3]);
+ if (code >= 0) {
+ code = gs_rlineto(ctx->pgs, -dpts[2], 0);
+ if (code >= 0)
+ code = gs_closepath(ctx->pgs);
+ }
+ }
+ }
+ dpts+= 4;
+ break;
+ case pdfi_v_curveto_seg:
+ {
+ gs_point pt;
+
+ code = gs_currentpoint(ctx->pgs, &pt);
+ if (code >= 0) {
+ code = gs_curveto(ctx->pgs, pt.x, pt.y, dpts[0], dpts[1], dpts[2], dpts[3]);
+ dpts+= 4;
+ }
+ }
+ break;
+ case pdfi_y_curveto_seg:
+ code = gs_curveto(ctx->pgs, dpts[0], dpts[1], dpts[2], dpts[3], dpts[2], dpts[3]);
+ dpts+= 4;
+ break;
+ case pdfi_curveto_seg:
+ code = gs_curveto(ctx->pgs, dpts[0], dpts[1], dpts[2], dpts[3], dpts[4], dpts[5]);
+ dpts+= 6;
+ break;
+ case pdfi_closepath_seg:
+ code = gs_closepath(ctx->pgs);
+ break;
+ default:
+ code = gs_note_error(gs_error_rangecheck);
+ break;
+ }
+ if (code < 0)
+ break;
}
- code = gs_moveto(ctx->pgs, x, y);
- pdfi_pop(ctx, 2);
+error:
+ gs_free_object(ctx->memory, ctx->PathSegments, "ApplyStoredPath");
+ ctx->PathSegmentsTop = ctx->PathSegmentsCurrent = ctx->PathSegments = NULL;
+ gs_free_object(ctx->memory, ctx->PathPts, "ApplyStoredPath");
+ ctx->PathPtsTop = ctx->PathPtsCurrent = ctx->PathPts = NULL;
return code;
}
+int pdfi_moveto (pdf_context *ctx)
+{
+ int code;
+ double xy[2];
+
+ if (ctx->text.BlockDepth != 0)
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_moveto", NULL);
+
+ code = pdfi_destack_reals(ctx, xy, 2);
+ if (code < 0)
+ return code;
+
+ return StorePathSegment(ctx, pdfi_moveto_seg, (double *)&xy);
+}
+
int pdfi_lineto (pdf_context *ctx)
{
- pdf_num *n1, *n2;
int code;
- double x, y;
+ double xy[2];
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_lineto", NULL);
- if (pdfi_count_stack(ctx) < 2) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
-
- n1 = (pdf_num *)ctx->stack_top[-1];
- n2 = (pdf_num *)ctx->stack_top[-2];
- if (n1->type == PDF_INT){
- y = (double)n1->value.i;
- } else{
- if (n1->type == PDF_REAL) {
- y = n1->value.d;
- } else {
- pdfi_pop(ctx, 2);
- return_error(gs_error_typecheck);
- }
- }
- if (n2->type == PDF_INT){
- x = (double)n2->value.i;
- } else{
- if (n2->type == PDF_REAL) {
- x = n2->value.d;
- } else {
- pdfi_pop(ctx, 2);
- return_error(gs_error_typecheck);
- }
- }
+ code = pdfi_destack_reals(ctx, xy, 2);
+ if (code < 0)
+ return code;
- code = gs_lineto(ctx->pgs, x, y);
- pdfi_pop(ctx, 2);
- return code;
+ return StorePathSegment(ctx, pdfi_lineto_seg, (double *)&xy);
}
static int pdfi_fill_inner(pdf_context *ctx, bool use_eofill)
@@ -121,6 +260,10 @@ static int pdfi_fill_inner(pdf_context *ctx, bool use_eofill)
if (pdfi_oc_is_off(ctx))
goto exit;
+ code = ApplyStoredPath(ctx);
+ if (code < 0)
+ return code;
+
code = pdfi_trans_setup(ctx, &state, NULL, TRANSPARENCY_Caller_Fill);
if (code == 0) {
/* If we don't gsave/grestore round the fill, then the file
@@ -171,8 +314,9 @@ int pdfi_stroke(pdf_context *ctx)
if (pdfi_oc_is_off(ctx))
goto exit;
-/* code = pdfi_gsave(ctx);
- if (code < 0) goto exit;*/
+ code = ApplyStoredPath(ctx);
+ if (code < 0)
+ return code;
gs_swapcolors_quick(ctx->pgs);
code = pdfi_trans_setup(ctx, &state, NULL, TRANSPARENCY_Caller_Stroke);
@@ -190,9 +334,6 @@ int pdfi_stroke(pdf_context *ctx)
}
gs_swapcolors_quick(ctx->pgs);
-/* code1 = pdfi_grestore(ctx);
- if (code == 0) code = code1;*/
-
exit:
code1 = pdfi_newpath(ctx);
if (code == 0) code = code1;
@@ -207,127 +348,64 @@ int pdfi_closepath_stroke(pdf_context *ctx)
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_closepath_stroke", NULL);
- code = gs_closepath(ctx->pgs);
- if (code == 0)
- code = pdfi_stroke(ctx);
- return code;
+ code = StorePathSegment(ctx, pdfi_closepath_seg, NULL);
+ if (code < 0)
+ return code;
+
+ return pdfi_stroke(ctx);
}
int pdfi_curveto(pdf_context *ctx)
{
- int i, code;
- pdf_num *num;
+ int code;
double Values[6];
- if (pdfi_count_stack(ctx) < 6) {
- pdfi_clearstack(ctx);
- pdfi_set_error(ctx, 0, NULL, E_PDF_STACKUNDERFLOWERROR, "pdfi_curveto", NULL);
- return_error(gs_error_stackunderflow);
- }
-
- for (i=0;i < 6;i++){
- num = (pdf_num *)ctx->stack_top[i - 6];
- if (num->type != PDF_INT) {
- if(num->type != PDF_REAL) {
- pdfi_pop(ctx, 6);
- return_error(gs_error_typecheck);
- }
- else
- Values[i] = num->value.d;
- } else {
- Values[i] = (double)num->value.i;
- }
- }
+ code = pdfi_destack_reals(ctx, Values, 6);
+ if (code < 0)
+ return code;
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_curveto", NULL);
- code = gs_curveto(ctx->pgs, Values[0], Values[1], Values[2], Values[3], Values[4], Values[5]);
- pdfi_pop(ctx, 6);
- return code;
+ return StorePathSegment(ctx, pdfi_curveto_seg, (double *)&Values);
}
int pdfi_v_curveto(pdf_context *ctx)
{
- int i, code;
- pdf_num *num;
+ int code;
double Values[4];
- gs_point pt;
- if (pdfi_count_stack(ctx) < 4) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
-
- for (i=0;i < 4;i++){
- num = (pdf_num *)ctx->stack_top[i - 4];
- if (num->type != PDF_INT) {
- if(num->type != PDF_REAL) {
- pdfi_pop(ctx, 4);
- return_error(gs_error_typecheck);
- }
- else
- Values[i] = num->value.d;
- } else {
- Values[i] = (double)num->value.i;
- }
- }
+ code = pdfi_destack_reals(ctx, Values, 4);
+ if (code < 0)
+ return code;
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_v_curveto", NULL);
- code = gs_currentpoint(ctx->pgs, &pt);
- if (code < 0) {
- pdfi_pop(ctx, 4);
- return code;
- }
-
- code = gs_curveto(ctx->pgs, pt.x, pt.y, Values[0], Values[1], Values[2], Values[3]);
- pdfi_pop(ctx, 4);
- return code;
+ return StorePathSegment(ctx, pdfi_v_curveto_seg, (double *)&Values);
}
int pdfi_y_curveto(pdf_context *ctx)
{
- int i, code;
- pdf_num *num;
+ int code;
double Values[4];
- if (pdfi_count_stack(ctx) < 4) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
-
- for (i=0;i < 4;i++){
- num = (pdf_num *)ctx->stack_top[i - 4];
- if (num->type != PDF_INT) {
- if(num->type != PDF_REAL) {
- pdfi_pop(ctx, 4);
- return_error(gs_error_typecheck);
- }
- else
- Values[i] = num->value.d;
- } else {
- Values[i] = (double)num->value.i;
- }
- }
+ code = pdfi_destack_reals(ctx, Values, 4);
+ if (code < 0)
+ return code;
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_y_curveto", NULL);
- code = gs_curveto(ctx->pgs, Values[0], Values[1], Values[2], Values[3], Values[2], Values[3]);
- pdfi_pop(ctx, 4);
- return code;
+ return StorePathSegment(ctx, pdfi_y_curveto_seg, (double *)&Values);
}
int pdfi_closepath(pdf_context *ctx)
{
- int code = gs_closepath(ctx->pgs);
-
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_closepath", NULL);
- return code;
+ return StorePathSegment(ctx, pdfi_closepath_seg, NULL);
}
int pdfi_newpath(pdf_context *ctx)
@@ -335,8 +413,13 @@ int pdfi_newpath(pdf_context *ctx)
int code = 0, code1;
/* This code is to deal with the wacky W and W* operators */
- if (ctx->pgs->current_point_valid) {
- if (ctx->clip_active) {
+ if (ctx->clip_active) {
+ if (ctx->PathSegments != NULL) {
+ code = ApplyStoredPath(ctx);
+ if (code < 0)
+ return code;
+ }
+ if (ctx->pgs->current_point_valid) {
if (ctx->do_eoclip)
code = gs_eoclip(ctx->pgs);
else
@@ -345,6 +428,13 @@ int pdfi_newpath(pdf_context *ctx)
}
ctx->clip_active = false;
+ if (ctx->PathSegments != NULL){
+ gs_free_object(ctx->memory, ctx->PathSegments, "ApplyStoredPath");
+ ctx->PathSegmentsTop = ctx->PathSegmentsCurrent = ctx->PathSegments = NULL;
+ gs_free_object(ctx->memory, ctx->PathPts, "ApplyStoredPath");
+ ctx->PathPtsTop = ctx->PathPtsCurrent = ctx->PathPts = NULL;
+ }
+
code1 = gs_newpath(ctx->pgs);
if (code == 0) code = code1;
@@ -361,10 +451,11 @@ int pdfi_b(pdf_context *ctx)
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_b", NULL);
- code = gs_closepath(ctx->pgs);
- if (code >= 0)
- code = pdfi_B(ctx);
- return code;
+ code = StorePathSegment(ctx, pdfi_closepath_seg, NULL);
+ if (code < 0)
+ return code;
+
+ return pdfi_B(ctx);
}
int pdfi_b_star(pdf_context *ctx)
@@ -374,10 +465,11 @@ int pdfi_b_star(pdf_context *ctx)
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_b_star", NULL);
- code = gs_closepath(ctx->pgs);
- if (code >= 0)
- code = pdfi_B_star(ctx);
- return code;
+ code = StorePathSegment(ctx, pdfi_closepath_seg, NULL);
+ if (code < 0)
+ return code;
+
+ return pdfi_B_star(ctx);
}
/* common code for B and B* */
@@ -392,6 +484,10 @@ static int pdfi_B_inner(pdf_context *ctx, bool use_eofill)
if (pdfi_oc_is_off(ctx))
goto exit;
+ code = ApplyStoredPath(ctx);
+ if (code < 0)
+ return code;
+
code = pdfi_trans_setup(ctx, &state, NULL, TRANSPARENCY_Caller_FillStroke);
if (code == 0) {
code = pdfi_gsave(ctx);
@@ -448,45 +544,15 @@ int pdfi_eoclip(pdf_context *ctx)
int pdfi_rectpath(pdf_context *ctx)
{
- int i, code;
- pdf_num *num;
+ int code;
double Values[4];
- if (pdfi_count_stack(ctx) < 4) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
-
- for (i=0;i < 4;i++){
- num = (pdf_num *)ctx->stack_top[i - 4];
- if (num->type != PDF_INT) {
- if(num->type != PDF_REAL) {
- pdfi_pop(ctx, 4);
- return_error(gs_error_typecheck);
- }
- else
- Values[i] = num->value.d;
- } else {
- Values[i] = (double)num->value.i;
- }
- }
+ code = pdfi_destack_reals(ctx, Values, 4);
+ if (code < 0)
+ return code;
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_rectpath", NULL);
- code = gs_moveto(ctx->pgs, Values[0], Values[1]);
- if (code == 0) {
- code = gs_rlineto(ctx->pgs, Values[2], 0);
- if (code == 0){
- code = gs_rlineto(ctx->pgs, 0, Values[3]);
- if (code == 0) {
- code = gs_rlineto(ctx->pgs, -Values[2], 0);
- if (code == 0){
- code = gs_closepath(ctx->pgs);
- }
- }
- }
- }
- pdfi_pop(ctx, 4);
- return code;
+ return StorePathSegment(ctx, pdfi_re_seg, (double *)&Values);
}
diff --git a/pdf/pdf_pattern.c b/pdf/pdf_pattern.c
index 57a16449..b4bd0375 100644
--- a/pdf/pdf_pattern.c
+++ b/pdf/pdf_pattern.c
@@ -114,35 +114,12 @@ static void pdfi_free_pattern_context(pdf_pattern_context_t *context)
gs_free_object(context->ctx->memory, context, "Free pattern context");
}
-static bool
-pdfi_pattern_purge_proc(gx_color_tile * ctile, void *proc_data)
-{
- if (ctile->id == *((gx_bitmap_id *)proc_data))
- return true;
- return false;
-}
-
void pdfi_pattern_cleanup(gs_memory_t * mem, void *p)
{
gs_pattern1_instance_t *pinst = (gs_pattern1_instance_t *)p;
- pdf_pattern_context_t *context;
- gx_color_tile *pctile = NULL;
-
- context = (pdf_pattern_context_t *)pinst->client_data;
- /* If are being called from Ghostscript, the clist pattern accumulator device (in
- the tile cache) *can* outlast outlast our pattern instance, so if the pattern
- instance is being freed, also remove the entry from the cache
- */
- if (context != NULL && context->ctx != NULL && context->ctx->pgs != NULL &&
- context->shading == NULL && context->ctx->pgs->pattern_cache != NULL
- && gx_pattern_cache_get_entry(context->ctx->pgs, pinst->id, &pctile) == 0
- && gx_pattern_tile_is_clist(pctile)) {
- gx_pattern_cache_winnow(gstate_pattern_cache(context->ctx->pgs), pdfi_pattern_purge_proc, (void *)(&pctile->id));
- }
-
- if (context != NULL) {
- pdfi_free_pattern_context(context);
+ if (pinst->client_data != NULL) {
+ pdfi_free_pattern_context((pdf_pattern_context_t *)pinst->client_data);
pinst->client_data = NULL;
pinst->notify_free = NULL;
}
@@ -418,7 +395,7 @@ pdfi_setpattern_type1(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_di
gs_pattern1_init(&templat);
/* Must be a stream */
- if (stream->type != PDF_STREAM) {
+ if (pdfi_type_of(stream) != PDF_STREAM) {
code = gs_note_error(gs_error_typecheck);
goto exit;
}
@@ -525,6 +502,28 @@ pdfi_setpattern_type1(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_di
cc->pattern->client_data = context;
cc->pattern->notify_free = pdfi_pattern_cleanup;
+ {
+ unsigned long hash = 5381;
+ unsigned int i;
+ const char *str = (const char *)&ctx->pgs->ctm;
+
+ gs_pattern1_instance_t *pinst = (gs_pattern1_instance_t *)cc->pattern;
+
+
+ for (i = 0; i < 4 * sizeof(float); i++)
+ hash = ((hash << 5) + hash) + str[i]; /* hash * 33 + c */
+
+ str = (const char *)&pdict->object_num;
+ for (i = 0; i < sizeof(uint32_t); i++)
+ hash = ((hash << 5) + hash) + str[i]; /* hash * 33 + c */
+
+ hash = ((hash << 5) + hash) + ctx->pgs->device->color_info.num_components; /* hash * 33 + c */
+
+ /* Include num_components for case where we have softmask and non-softmask
+ fills with the same tile. We may need two tiles for this if there is a
+ change in color space for the transparency group. */
+ pinst->id = hash;
+ }
context = NULL;
code = pdfi_grestore(ctx);
diff --git a/pdf/pdf_repair.c b/pdf/pdf_repair.c
index 2c2badf2..22865fe6 100644
--- a/pdf/pdf_repair.c
+++ b/pdf/pdf_repair.c
@@ -25,14 +25,14 @@
#include "pdf_misc.h"
#include "pdf_repair.h"
-static int pdfi_repair_add_object(pdf_context *ctx, uint64_t obj, uint64_t gen, gs_offset_t offset)
+static int pdfi_repair_add_object(pdf_context *ctx, int64_t obj, int64_t gen, gs_offset_t offset)
{
/* Although we can handle object numbers larger than this, on some systems (32-bit Windows)
* memset is limited to a (signed!) integer for the size of memory to clear. We could deal
* with this by clearing the memory in blocks, but really, this is almost certainly a
* corrupted file or something.
*/
- if (obj >= 0x7ffffff / sizeof(xref_entry))
+ if (obj >= 0x7ffffff / sizeof(xref_entry) || obj < 1 || gen < 0 || offset < 0)
return_error(gs_error_rangecheck);
if (ctx->xref_table == NULL) {
@@ -85,7 +85,7 @@ int pdfi_repair_file(pdf_context *ctx)
{
int code = 0;
gs_offset_t offset, saved_offset;
- uint64_t object_num = 0, generation_num = 0;
+ int64_t object_num = 0, generation_num = 0;
int i;
gs_offset_t outer_saved_offset[3];
@@ -163,18 +163,18 @@ int pdfi_repair_file(pdf_context *ctx)
goto exit;
}
if (pdfi_count_stack(ctx) > 0) {
- if (ctx->stack_top[-1]->type == PDF_KEYWORD) {
- pdf_keyword *k = (pdf_keyword *)ctx->stack_top[-1];
+ if (pdfi_type_of(ctx->stack_top[-1]) == PDF_FAST_KEYWORD) {
+ pdf_obj *k = ctx->stack_top[-1];
pdf_num *n;
- if (k->key == TOKEN_OBJ) {
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_OBJ)) {
gs_offset_t saved_offset[3];
offset = outer_saved_offset[0];
saved_offset[0] = saved_offset[1] = saved_offset[2] = 0;
- if (pdfi_count_stack(ctx) < 3 || ctx->stack_top[-2]->type != PDF_INT || ctx->stack_top[-2]->type != PDF_INT) {
+ if (pdfi_count_stack(ctx) < 3 || pdfi_type_of(ctx->stack_top[-3]) != PDF_INT || pdfi_type_of(ctx->stack_top[-2]) != PDF_INT) {
pdfi_clearstack(ctx);
continue;
}
@@ -199,15 +199,15 @@ int pdfi_repair_file(pdf_context *ctx)
if (code == 0 && ctx->main_stream->eof)
break;
- if (ctx->stack_top[-1]->type == PDF_KEYWORD){
- pdf_keyword *k = (pdf_keyword *)ctx->stack_top[-1];
+ if (pdfi_type_of(ctx->stack_top[-1]) == PDF_FAST_KEYWORD) {
+ pdf_obj *k = ctx->stack_top[-1];
- if (k->key == TOKEN_OBJ) {
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_OBJ)) {
/* Found obj while looking for endobj, store the existing 'obj'
* and start afresh.
*/
code = pdfi_repair_add_object(ctx, object_num, generation_num, offset);
- if (pdfi_count_stack(ctx) < 3 || ctx->stack_top[-2]->type != PDF_INT || ctx->stack_top[-2]->type != PDF_INT) {
+ if (pdfi_count_stack(ctx) < 3 || pdfi_type_of(ctx->stack_top[-3]) != PDF_INT || pdfi_type_of(ctx->stack_top[-2]) != PDF_INT) {
pdfi_clearstack(ctx);
break;
}
@@ -220,14 +220,14 @@ int pdfi_repair_file(pdf_context *ctx)
continue;
}
- if (k->key == TOKEN_ENDOBJ) {
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_ENDOBJ)) {
code = pdfi_repair_add_object(ctx, object_num, generation_num, offset);
if (code < 0)
goto exit;
pdfi_clearstack(ctx);
break;
} else {
- if (k->key == TOKEN_STREAM) {
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_STREAM)) {
static const char test[] = "endstream";
int index = 0;
@@ -245,27 +245,16 @@ int pdfi_repair_file(pdf_context *ctx)
index = 0;
} while (index < 9);
do {
- code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
- if (code < 0) {
- if (code != gs_error_VMerror && code != gs_error_ioerror)
- continue;
+ code = pdfi_read_bare_keyword(ctx, ctx->main_stream);
+ if (code == gs_error_VMerror || code == gs_error_ioerror)
goto exit;
+ if (code == TOKEN_ENDOBJ || code == TOKEN_INVALID_KEY) {
+ code = pdfi_repair_add_object(ctx, object_num, generation_num, offset);
+ if (code == gs_error_VMerror || code == gs_error_ioerror)
+ goto exit;
+ break;
}
- if (code > 0) {
- if (ctx->stack_top[-1]->type == PDF_KEYWORD){
- pdf_keyword *k = (pdf_keyword *)ctx->stack_top[-1];
- if (k->key == TOKEN_ENDOBJ) {
- code = pdfi_repair_add_object(ctx, object_num, generation_num, offset);
- if (code < 0) {
- if (code != gs_error_VMerror && code != gs_error_ioerror)
- break;
- goto exit;
- }
- break;
- }
- }
- }
- }while(ctx->main_stream->eof == false);
+ } while(ctx->main_stream->eof == false);
pdfi_clearstack(ctx);
break;
@@ -277,10 +266,10 @@ int pdfi_repair_file(pdf_context *ctx)
} while(1);
break;
} else {
- if (k->key == TOKEN_ENDOBJ) {
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_ENDOBJ)) {
pdfi_clearstack(ctx);
} else
- if (k->key == TOKEN_STARTXREF) {
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_STARTXREF)) {
code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
if (code < 0 && code != gs_error_VMerror && code != gs_error_ioerror)
continue;
@@ -288,9 +277,9 @@ int pdfi_repair_file(pdf_context *ctx)
goto exit;
pdfi_clearstack(ctx);
} else {
- if (k->key == TOKEN_TRAILER) {
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_TRAILER)) {
code = pdfi_read_bare_object(ctx, ctx->main_stream, 0, 0, 0);
- if (code == 0 && pdfi_count_stack(ctx) > 0 && ctx->stack_top[-1]->type == PDF_DICT) {
+ if (code == 0 && pdfi_count_stack(ctx) > 0 && pdfi_type_of(ctx->stack_top[-1]) == PDF_DICT) {
if (ctx->Trailer) {
pdf_dict *d = (pdf_dict *)ctx->stack_top[-1];
bool known = false;
@@ -319,7 +308,7 @@ int pdfi_repair_file(pdf_context *ctx)
goto exit;
}
}
- if (pdfi_count_stack(ctx) > 0 && ctx->stack_top[-1]->type != PDF_INT)
+ if (pdfi_count_stack(ctx) > 0 && pdfi_type_of(ctx->stack_top[-1]) != PDF_INT)
pdfi_clearstack(ctx);
}
} while (ctx->main_stream->eof == false);
@@ -338,33 +327,44 @@ int pdfi_repair_file(pdf_context *ctx)
if (ctx->xref_table->xref[i].object_num != 0) {
/* At this stage, all the objects we've found must be uncompressed */
if (ctx->xref_table->xref[i].u.uncompressed.offset > ctx->main_stream_length) {
- code = gs_note_error(gs_error_rangecheck);
- goto exit;
+ /* This can only happen if we had read an xref table before we tried to repair
+ * the file, and the table has entries we didn't find in the file. So
+ * mark the entry as free, and offset of 0, and just carry on.
+ */
+ ctx->xref_table->xref[i].free = 1;
+ ctx->xref_table->xref[i].u.uncompressed.offset = 0;
+ continue;
}
pdfi_seek(ctx, ctx->main_stream, ctx->xref_table->xref[i].u.uncompressed.offset, SEEK_SET);
do {
code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
- if (ctx->main_stream->eof == true || (code < 0 && code != gs_error_ioerror && code != gs_error_VMerror))
+ if (ctx->main_stream->eof == true || (code < 0 && code != gs_error_ioerror && code != gs_error_VMerror)) {
+ /* object offset is beyond EOF or object is broken (possibly due to multiple xref
+ * errors) ignore the error and carry on, if the object gets used then we will
+ * error out at that point.
+ */
+ code = 0;
break;
+ }
if (code < 0)
goto exit;
- if (ctx->stack_top[-1]->type == PDF_KEYWORD) {
- pdf_keyword *k = (pdf_keyword *)ctx->stack_top[-1];
+ if (pdfi_type_of(ctx->stack_top[-1]) == PDF_FAST_KEYWORD) {
+ pdf_obj *k = ctx->stack_top[-1];
- if (k->key == TOKEN_OBJ){
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_OBJ)) {
continue;
}
- if (k->key == TOKEN_ENDOBJ) {
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_ENDOBJ)) {
if (pdfi_count_stack(ctx) > 1) {
- if (ctx->stack_top[-2]->type == PDF_DICT) {
+ if (pdfi_type_of(ctx->stack_top[-2]) == PDF_DICT) {
pdf_dict *d = (pdf_dict *)ctx->stack_top[-2];
pdf_obj *o = NULL;
code = pdfi_dict_knownget_type(ctx, d, "Type", PDF_NAME, &o);
if (code < 0) {
pdfi_clearstack(ctx);
- goto exit;
+ continue;
}
if (code > 0) {
pdf_name *n = (pdf_name *)o;
@@ -381,7 +381,7 @@ int pdfi_repair_file(pdf_context *ctx)
pdfi_clearstack(ctx);
break;
}
- if (k->key == TOKEN_STREAM) {
+ if (k == PDF_TOKEN_AS_OBJ(TOKEN_STREAM)) {
pdf_dict *d;
pdf_name *n = NULL;
@@ -390,7 +390,7 @@ int pdfi_repair_file(pdf_context *ctx)
break;;
}
d = (pdf_dict *)ctx->stack_top[-2];
- if (d->type != PDF_DICT) {
+ if (pdfi_type_of(d) != PDF_DICT) {
pdfi_clearstack(ctx);
break;;
}
@@ -403,10 +403,10 @@ int pdfi_repair_file(pdf_context *ctx)
}
if (code > 0) {
if (pdfi_name_is(n, "ObjStm")) {
- int64_t N, obj_num, offset;
+ int64_t N;
+ int obj_num, offset;
int j;
pdf_c_stream *compressed_stream;
- pdf_obj *o;
pdf_stream *stream;
offset = pdfi_unread_tell(ctx);
@@ -422,36 +422,28 @@ int pdfi_repair_file(pdf_context *ctx)
code = pdfi_dict_get_int(ctx, d, "N", &N);
if (code == 0) {
for (j=0;j < N; j++) {
- code = pdfi_read_token(ctx, compressed_stream, 0, 0);
- if (code == 0)
+ code = pdfi_read_bare_int(ctx, compressed_stream, &obj_num);
+ if (code <= 0)
break;
- if (code > 0) {
- o = ctx->stack_top[-1];
- if (((pdf_obj *)o)->type == PDF_INT) {
- obj_num = ((pdf_num *)o)->value.i;
- pdfi_pop(ctx, 1);
- code = pdfi_read_token(ctx, compressed_stream, 0, 0);
- if (code > 0) {
- o = ctx->stack_top[-1];
- if (((pdf_obj *)o)->type == PDF_INT) {
- offset = ((pdf_num *)o)->value.i;
- if (obj_num < 1) {
- pdfi_close_file(ctx, compressed_stream);
- pdfi_clearstack(ctx);
- code = gs_note_error(gs_error_rangecheck);
- goto exit;
- }
- if (obj_num >= ctx->xref_table->xref_size)
- code = pdfi_repair_add_object(ctx, obj_num, 0, 0);
-
- if (code >= 0) {
- ctx->xref_table->xref[obj_num].compressed = true;
- ctx->xref_table->xref[obj_num].free = false;
- ctx->xref_table->xref[obj_num].object_num = obj_num;
- ctx->xref_table->xref[obj_num].u.compressed.compressed_stream_num = i;
- ctx->xref_table->xref[obj_num].u.compressed.object_index = j;
- }
- }
+ else {
+ code = pdfi_read_bare_int(ctx, compressed_stream, &offset);
+ if (code > 0) {
+ if (obj_num < 1) {
+ pdfi_close_file(ctx, compressed_stream);
+ pdfi_countdown(n);
+ pdfi_clearstack(ctx);
+ code = gs_note_error(gs_error_rangecheck);
+ goto exit;
+ }
+ if (obj_num >= ctx->xref_table->xref_size)
+ code = pdfi_repair_add_object(ctx, obj_num, 0, 0);
+
+ if (code >= 0) {
+ ctx->xref_table->xref[obj_num].compressed = true;
+ ctx->xref_table->xref[obj_num].free = false;
+ ctx->xref_table->xref[obj_num].object_num = obj_num;
+ ctx->xref_table->xref[obj_num].u.compressed.compressed_stream_num = i;
+ ctx->xref_table->xref[obj_num].u.compressed.object_index = j;
}
}
}
@@ -461,6 +453,7 @@ int pdfi_repair_file(pdf_context *ctx)
}
if (code < 0) {
if (ctx->args.pdfstoponerror || code == gs_error_VMerror) {
+ pdfi_countdown(n);
pdfi_clearstack(ctx);
goto exit;
}
@@ -477,6 +470,8 @@ int pdfi_repair_file(pdf_context *ctx)
}
exit:
+ if (code > 0)
+ code = 0;
pdfi_seek(ctx, ctx->main_stream, saved_offset, SEEK_SET);
ctx->main_stream->eof = false;
return code;
diff --git a/pdf/pdf_sec.c b/pdf/pdf_sec.c
index fa7131f8..999fa713 100644
--- a/pdf/pdf_sec.c
+++ b/pdf/pdf_sec.c
@@ -993,6 +993,7 @@ static int pdfi_read_Encrypt_dict(pdf_context *ctx, int *KeyLen)
pdf_dict *CF_dict = NULL, *StdCF_dict = NULL;
pdf_dict *d = NULL, *d1 = NULL;
pdf_obj *o = NULL;
+ bool b;
pdf_string *s = NULL;
int64_t i64;
double f;
@@ -1039,30 +1040,40 @@ static int pdfi_read_Encrypt_dict(pdf_context *ctx, int *KeyLen)
pdfi_countdown(o);
o = NULL;
- code = pdfi_dict_knownget_number(ctx, d, "Length", &f);
+ *KeyLen = 0;
+ ctx->encryption.V = -1;
+
+ code = pdfi_dict_get_int(ctx, d, "R", &i64);
if (code < 0)
goto done;
+ ctx->encryption.R = (int)i64;
- if (code > 0)
- *KeyLen = (int)f;
- else
- *KeyLen = 0;
-
- code = pdfi_dict_get_int(ctx, d, "V", &i64);
+ /* V is required for PDF 2.0 but only strongly recommended for earlier versions */
+ code = pdfi_dict_known(ctx, d, "V", &b);
if (code < 0)
goto done;
- if (i64 < 1 || i64 > 5) {
- code = gs_error_rangecheck;
- goto done;
- }
+ if (b) {
+ code = pdfi_dict_get_int(ctx, d, "V", &i64);
+ if (code < 0)
+ goto done;
- ctx->encryption.V = (int)i64;
+ if (i64 < 1 || i64 > 5) {
+ code = gs_error_rangecheck;
+ goto done;
+ }
- code = pdfi_dict_get_int(ctx, d, "R", &i64);
- if (code < 0)
- goto done;
- ctx->encryption.R = (int)i64;
+ ctx->encryption.V = (int)i64;
+
+ if (ctx->encryption.V == 2 || ctx->encryption.V == 3) {
+ code = pdfi_dict_knownget_number(ctx, d, "Length", &f);
+ if (code < 0)
+ goto done;
+
+ if (code > 0)
+ *KeyLen = (int)f;
+ }
+ }
code = pdfi_dict_get_int(ctx, d, "P", &i64);
if (code < 0)
@@ -1109,12 +1120,12 @@ static int pdfi_read_Encrypt_dict(pdf_context *ctx, int *KeyLen)
pdfi_countdown(s);
s = NULL;
- code = pdfi_dict_knownget_type(ctx, d, "EncryptMetadata", PDF_BOOL, &o);
+ code = pdfi_dict_knownget_bool(ctx, d, "EncryptMetadata", &b);
if (code < 0)
goto done;
if (code > 0) {
- ctx->encryption.EncryptMetadata = ((pdf_bool *)o)->value;
- pdfi_countdown(o);
+ ctx->encryption.EncryptMetadata = b;
+ code = 0;
}
else
ctx->encryption.EncryptMetadata = true;
@@ -1368,13 +1379,19 @@ int pdfi_initialise_Decryption(pdf_context *ctx)
switch(ctx->encryption.R) {
case 2:
/* Set up the defaults if not already set */
+ /* R of 2 means V < 2 which is either algorithm 3.1 with a 40-bit key
+ * or an undocumented and unsupported algorithm.
+ */
+ if (ctx->encryption.V >= 0) {
+ if (ctx->encryption.V == 0) {
+ code = gs_note_error(gs_error_undefined);
+ goto done;
+ }
+ }
/* Revision 2 is always 40-bit RC4 */
- if (KeyLen != 0 && (KeyLen < 40 || KeyLen > 128 || KeyLen % 8 != 0)) {
+ if (KeyLen != 0 && KeyLen != 40)
pdfi_set_error(ctx, 0, NULL, E_PDF_INVALID_DECRYPT_LEN, "pdfi_initialise_Decryption", NULL);
- return_error(gs_error_rangecheck);
- }
- if (KeyLen == 0)
- KeyLen = 40;
+ KeyLen = 40;
if (ctx->encryption.StmF == CRYPT_NONE)
ctx->encryption.StmF = CRYPT_V1;
if (ctx->encryption.StrF == CRYPT_NONE)
@@ -1383,10 +1400,17 @@ int pdfi_initialise_Decryption(pdf_context *ctx)
break;
case 3:
/* Set up the defaults if not already set */
- /* Revision 3 is always 128-bit RC4 */
- if (KeyLen != 0 && KeyLen != 128)
+ if (ctx->encryption.V >= 0) {
+ if (ctx->encryption.V == 3) {
+ code = gs_note_error(gs_error_undefined);
+ goto done;
+ }
+ }
+ /* Revision 3 *may* be more than 40 bits of RC4 */
+ if (KeyLen != 0 && (KeyLen < 40 || KeyLen > 128 || KeyLen % 8 != 0)) {
pdfi_set_warning(ctx, 0, NULL, W_PDF_INVALID_DECRYPT_LEN, "pdfi_initialise_Decryption", NULL);
- KeyLen = 128;
+ KeyLen = 128;
+ }
if (ctx->encryption.StmF == CRYPT_NONE)
ctx->encryption.StmF = CRYPT_V2;
if (ctx->encryption.StrF == CRYPT_NONE)
diff --git a/pdf/pdf_shading.c b/pdf/pdf_shading.c
index c4e93e88..5cd347f7 100644
--- a/pdf/pdf_shading.c
+++ b/pdf/pdf_shading.c
@@ -55,13 +55,13 @@ static int pdfi_build_shading_function(pdf_context *ctx, gs_function_t **ppfn, c
if (code < 0)
goto build_shading_function_error;
- if (o->type != PDF_DICT && o->type != PDF_STREAM) {
+ if (pdfi_type_of(o) != PDF_DICT && pdfi_type_of(o) != PDF_STREAM) {
uint size;
pdf_obj *rsubfn;
gs_function_t **Functions;
int64_t i;
- if (o->type != PDF_ARRAY) {
+ if (pdfi_type_of(o) != PDF_ARRAY) {
code = gs_error_typecheck;
goto build_shading_function_error;
}
@@ -78,7 +78,7 @@ static int pdfi_build_shading_function(pdf_context *ctx, gs_function_t **ppfn, c
for (i = 0; i < size; ++i) {
code = pdfi_array_get(ctx, (pdf_array *)o, i, &rsubfn);
if (code == 0) {
- if (rsubfn->type != PDF_DICT && rsubfn->type != PDF_STREAM)
+ if (pdfi_type_of(rsubfn) != PDF_DICT && pdfi_type_of(rsubfn) != PDF_STREAM)
code = gs_note_error(gs_error_typecheck);
}
if (code < 0) {
@@ -133,7 +133,7 @@ static int pdfi_shading1(pdf_context *ctx, gs_shading_params_t *pcommon,
static const float default_Domain[4] = {0, 1, 0, 1};
pdf_dict *shading_dict;
- if (Shading->type != PDF_DICT)
+ if (pdfi_type_of(Shading) != PDF_DICT)
return_error(gs_error_typecheck);
shading_dict = (pdf_dict *)Shading;
@@ -179,7 +179,7 @@ static int pdfi_shading2(pdf_context *ctx, gs_shading_params_t *pcommon,
int code, i;
pdf_dict *shading_dict;
- if (Shading->type != PDF_DICT)
+ if (pdfi_type_of(Shading) != PDF_DICT)
return_error(gs_error_typecheck);
shading_dict = (pdf_dict *)Shading;
@@ -231,7 +231,7 @@ static int pdfi_shading3(pdf_context *ctx, gs_shading_params_t *pcommon,
int code, i;
pdf_dict *shading_dict;
- if (Shading->type != PDF_DICT)
+ if (pdfi_type_of(Shading) != PDF_DICT)
return_error(gs_error_typecheck);
shading_dict = (pdf_dict *)Shading;
@@ -285,7 +285,7 @@ static int pdfi_build_mesh_shading(pdf_context *ctx, gs_shading_mesh_params_t *p
int64_t i;
pdf_dict *shading_dict;
- if (Shading->type != PDF_STREAM)
+ if (pdfi_type_of(Shading) != PDF_STREAM)
return_error(gs_error_typecheck);
code = pdfi_dict_from_obj(ctx, Shading, &shading_dict);
@@ -634,6 +634,7 @@ static int get_shading_common(pdf_context *ctx, pdf_dict *shading_dict, gs_shadi
get_shading_common_error:
pdfi_countdown((pdf_obj *)a);
gs_free_object(ctx->memory, params->Background, "Background (common_shading_error)");
+ params->Background = NULL;
return code;
}
@@ -861,17 +862,27 @@ int pdfi_shading(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
if (ctx->text.BlockDepth != 0)
pdfi_set_warning(ctx, 0, NULL, W_PDF_OPINVALIDINTEXT, "pdfi_shading", NULL);
- if (pdfi_oc_is_off(ctx))
+ if (pdfi_oc_is_off(ctx)) {
+ pdfi_pop(ctx, 1);
return 0;
+ }
+
+ savedoffset = pdfi_tell(ctx->main_stream);
n = (pdf_name *)ctx->stack_top[-1];
- if (n->type != PDF_NAME)
- return_error(gs_error_typecheck);
+ pdfi_countup(n);
+ pdfi_pop(ctx, 1);
+
+ if (pdfi_type_of(n) != PDF_NAME) {
+ code = gs_note_error(gs_error_typecheck);
+ goto exit1;
+ }
- savedoffset = pdfi_tell(ctx->main_stream);
code = pdfi_loop_detector_mark(ctx);
- if (code < 0)
+ if (code < 0) {
+ pdfi_countdown(n);
return code;
+ }
code = pdfi_op_q(ctx);
if (code < 0)
@@ -882,7 +893,7 @@ int pdfi_shading(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
if (code < 0)
goto exit2;
- if (Shading->type != PDF_DICT && Shading->type != PDF_STREAM) {
+ if (pdfi_type_of(Shading) != PDF_DICT && pdfi_type_of(Shading) != PDF_STREAM) {
code = gs_note_error(gs_error_typecheck);
goto exit2;
}
@@ -929,7 +940,7 @@ int pdfi_shading(pdf_context *ctx, pdf_dict *stream_dict, pdf_dict *page_dict)
if (code == 0)
code = code1;
exit1:
- pdfi_pop(ctx, 1);
+ pdfi_countdown(n);
(void)pdfi_loop_detector_cleartomark(ctx);
pdfi_seek(ctx, ctx->main_stream, savedoffset, SEEK_SET);
return code;
diff --git a/pdf/pdf_stack.c b/pdf/pdf_stack.c
index d2644fbb..12dae267 100644
--- a/pdf/pdf_stack.c
+++ b/pdf/pdf_stack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018-2021 Artifex Software, Inc.
+/* Copyright (C) 2018-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -49,7 +49,7 @@ int pdfi_push(pdf_context *ctx, pdf_obj *o)
if (ctx->stack_top >= ctx->stack_limit) {
if (ctx->stack_size >= MAX_STACK_SIZE)
- return_error(gs_error_stackoverflow);
+ return_error(gs_error_pdf_stackoverflow);
new_stack = (pdf_obj **)gs_alloc_bytes(ctx->memory, (ctx->stack_size + INITIAL_STACK_SIZE) * sizeof (pdf_obj *), "pdfi_push_increase_interp_stack");
if (new_stack == NULL)
@@ -106,7 +106,7 @@ int pdfi_count_to_mark(pdf_context *ctx, uint64_t *count)
*count = 0;
while (&ctx->stack_top[index] >= save_bot) {
- if (o->type == PDF_ARRAY_MARK || o->type == PDF_DICT_MARK)
+ if (pdfi_type_of(o) == PDF_ARRAY_MARK || pdfi_type_of(o) == PDF_DICT_MARK)
return 0;
o = ctx->stack_top[--index];
(*count)++;
@@ -124,3 +124,105 @@ int pdfi_clear_to_mark(pdf_context *ctx)
return code;
return pdfi_pop(ctx, count + 1);
}
+
+int
+pdfi_destack_real(pdf_context *ctx, double *d)
+{
+ int code;
+
+ if (pdfi_count_stack(ctx) < 1)
+ return_error(gs_error_stackunderflow);
+
+ code = pdfi_obj_to_real(ctx, ctx->stack_top[-1], d);
+ if (code < 0) {
+ pdfi_clearstack(ctx);
+ return code;
+ }
+ pdfi_pop(ctx, 1);
+
+ return 0;
+}
+
+int
+pdfi_destack_reals(pdf_context *ctx, double *d, int n)
+{
+ int i, code;
+
+ if (pdfi_count_stack(ctx) < n) {
+ pdfi_clearstack(ctx);
+ return_error(gs_error_stackunderflow);
+ }
+
+ for (i = 0; i < n; i++) {
+ code = pdfi_obj_to_real(ctx, ctx->stack_top[i-n], &d[i]);
+ if (code < 0) {
+ pdfi_clearstack(ctx);
+ return code;
+ }
+ }
+ pdfi_pop(ctx, n);
+
+ return 0;
+}
+
+int
+pdfi_destack_floats(pdf_context *ctx, float *d, int n)
+{
+ int i, code;
+
+ if (pdfi_count_stack(ctx) < n) {
+ pdfi_clearstack(ctx);
+ return_error(gs_error_stackunderflow);
+ }
+
+ for (i = 0; i < n; i++) {
+ code = pdfi_obj_to_float(ctx, ctx->stack_top[i-n], &d[i]);
+ if (code < 0) {
+ pdfi_clearstack(ctx);
+ return code;
+ }
+ }
+ pdfi_pop(ctx, n);
+
+ return 0;
+}
+
+int
+pdfi_destack_int(pdf_context *ctx, int64_t *i)
+{
+ int code;
+
+ if (pdfi_count_stack(ctx) < 1)
+ return_error(gs_error_stackunderflow);
+
+ code = pdfi_obj_to_int(ctx, ctx->stack_top[-1], i);
+ if (code < 0) {
+ pdfi_clearstack(ctx);
+ return code;
+ }
+ pdfi_pop(ctx, 1);
+
+ return 0;
+}
+
+int
+pdfi_destack_ints(pdf_context *ctx, int64_t *i64, int n)
+{
+ int i, code;
+
+ if (pdfi_count_stack(ctx) < n) {
+ pdfi_clearstack(ctx);
+ return_error(gs_error_stackunderflow);
+ }
+
+ for (i = 0; i < n; i++) {
+ code = pdfi_obj_to_int(ctx, ctx->stack_top[i-n], &i64[i]);
+ if (code < 0) {
+ pdfi_clearstack(ctx);
+ return code;
+ }
+ }
+ pdfi_pop(ctx, n);
+
+ return 0;
+}
diff --git a/pdf/pdf_stack.h b/pdf/pdf_stack.h
index 982cfab1..2f7d8640 100644
--- a/pdf/pdf_stack.h
+++ b/pdf/pdf_stack.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2018-2021 Artifex Software, Inc.
+/* Copyright (C) 2018-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -29,60 +29,75 @@ int pdfi_mark_stack(pdf_context *ctx, pdf_obj_type type);
void pdfi_clearstack(pdf_context *ctx);
int pdfi_count_to_mark(pdf_context *ctx, uint64_t *count);
int pdfi_clear_to_mark(pdf_context *ctx);
+int pdfi_destack_real(pdf_context *ctx, double *d);
+int pdfi_destack_reals(pdf_context *ctx, double *d, int n);
+int pdfi_destack_floats(pdf_context *ctx, float *d, int n);
+int pdfi_destack_int(pdf_context *ctx, int64_t *i);
+int pdfi_destack_ints(pdf_context *ctx, int64_t *i, int n);
static inline void pdfi_countup_impl(pdf_obj *o)
{
- if (o != NULL) {
- o->refcnt++;
+ if ((uintptr_t)o < TOKEN__LAST_KEY)
+ {
#if REFCNT_DEBUG
- dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
+ if (o == NULL)
+ dprintf("Incrementing reference count of NULL pointer\n");
#endif
+ return;
}
+ o->refcnt++;
#if REFCNT_DEBUG
- else {
- dprintf("Incrementing reference count of NULL pointer\n");
- }
+ dmprintf3(OBJ_MEMORY(o), "Incrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
#endif
}
static inline void pdfi_countdown_impl(pdf_obj *o)
{
- if (o != NULL) {
+#if defined(DEBUG) || REFCNT_DEBUG
+ pdf_context *ctx;
+#endif
+
+ /* A 'low' pointer value indicates a type that is not an
+ * actual object (typically keyword). This includes the
+ * NULL case. Nothing to free in that case. */
+ if ((uintptr_t)o < TOKEN__LAST_KEY)
+ return;
+
+#if defined(DEBUG) || REFCNT_DEBUG
+ ctx = (pdf_context *)o->ctx;
+#endif
#ifdef DEBUG
- pdf_context *ctx1 = (pdf_context *)o->ctx;
- if (o->refcnt == 0)
- emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
+ if (o->refcnt == 0)
+ emprintf(OBJ_MEMORY(o), "Decrementing object with refcount at 0!\n");
#endif
- o->refcnt--;
+ o->refcnt--;
#if REFCNT_DEBUG
- dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
+ dmprintf3(OBJ_MEMORY(o), "Decrementing reference count of object %d, UID %lu, to %d\n", o->object_num, o->UID, o->refcnt);
#endif
- if (o->refcnt == 0) {
+ if (o->refcnt != 0)
+ return;
#if REFCNT_DEBUG
- pdf_context *ctx = (pdf_context *)o->ctx;
- if (ctx != NULL && ctx->cache_entries != 0) {
- pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
-
- while(entry) {
- next = entry->next;
- if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
- dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
- entry = next;
- }
- }
- dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu\n", o->object_num, o->UID);
+ if (ctx != NULL && ctx->cache_entries != 0) {
+ pdf_obj_cache_entry *entry = ctx->cache_LRU, *next;
+
+ while(entry) {
+ next = entry->next;
+ if (entry->o->object_num != 0 && entry->o->object_num == o->object_num)
+ dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu, but there is still a cache entry!\n", o->object_num, o->UID);
+ entry = next;
+ }
+ }
+ dmprintf2(OBJ_MEMORY(o), "Freeing object %d, UID %lu\n", o->object_num, o->UID);
#endif
#ifdef DEBUG
- if (ctx1->xref_table != NULL && o->object_num > 0 &&
- o->object_num < ctx1->xref_table->xref_size &&
- ctx1->xref_table->xref[o->object_num].cache != NULL &&
- ctx1->xref_table->xref[o->object_num].cache->o == o) {
- dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
- }
-#endif
- pdfi_free_object(o);
- }
+ if (ctx->xref_table != NULL && o->object_num > 0 &&
+ o->object_num < ctx->xref_table->xref_size &&
+ ctx->xref_table->xref[o->object_num].cache != NULL &&
+ ctx->xref_table->xref[o->object_num].cache->o == o) {
+ dmprintf1(OBJ_MEMORY(o), "Freeing object %d while it is still in the object cache!\n", o->object_num);
}
+#endif
+ pdfi_free_object(o);
}
/* These two macros are present simply to add a cast to the generic object type, so that
diff --git a/pdf/pdf_text.c b/pdf/pdf_text.c
index e22f0c0e..dfc35201 100644
--- a/pdf/pdf_text.c
+++ b/pdf/pdf_text.c
@@ -188,65 +188,30 @@ static int pdfi_set_Tc(pdf_context *ctx, double Tc)
int pdfi_Tc(pdf_context *ctx)
{
- int code = 0;
- pdf_num *n = NULL;
-
- if (pdfi_count_stack(ctx) < 1) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ int code;
+ double d;
- n = (pdf_num *)ctx->stack_top[-1];
+ code = pdfi_destack_real(ctx, &d);
+ if (code < 0)
+ return code;
- if (n->type == PDF_INT)
- code = pdfi_set_Tc(ctx, (double)n->value.i);
- else {
- if (n->type == PDF_REAL)
- code = pdfi_set_Tc(ctx, n->value.d);
- else
- code = gs_note_error(gs_error_typecheck);
- }
- pdfi_pop(ctx, 1);
- return code;
+ return pdfi_set_Tc(ctx, d);
}
int pdfi_Td(pdf_context *ctx)
{
int code;
- pdf_num *Tx = NULL, *Ty = NULL;
+ double Txy[2];
gs_matrix m, mat;
- if (pdfi_count_stack(ctx) < 2) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ code = pdfi_destack_reals(ctx, Txy, 2);
+ if (code < 0)
+ return code;
gs_make_identity(&m);
- Ty = (pdf_num *)ctx->stack_top[-1];
- Tx = (pdf_num *)ctx->stack_top[-2];
-
- if (Tx->type == PDF_INT) {
- m.tx = (float)Tx->value.i;
- } else {
- if (Tx->type == PDF_REAL) {
- m.tx = (float)Tx->value.d;
- } else {
- code = gs_note_error(gs_error_typecheck);
- goto Td_error;
- }
- }
-
- if (Ty->type == PDF_INT) {
- m.ty = (float)Ty->value.i;
- } else {
- if (Ty->type == PDF_REAL) {
- m.ty = (float)Ty->value.d;
- } else {
- code = gs_note_error(gs_error_typecheck);
- goto Td_error;
- }
- }
+ m.tx = Txy[0];
+ m.ty = Txy[1];
if (ctx->text.BlockDepth == 0) {
pdfi_set_warning(ctx, 0, NULL, W_PDF_TEXTOPNOBT, "pdfi_Td", NULL);
@@ -254,70 +219,38 @@ int pdfi_Td(pdf_context *ctx)
gs_make_identity(&mat);
code = gs_settextmatrix(ctx->pgs, &mat);
if (code < 0)
- goto Td_error;
+ return code;
code = gs_settextlinematrix(ctx->pgs, &mat);
if (code < 0)
- goto Td_error;
+ return code;
}
code = gs_matrix_multiply(&m, &ctx->pgs->textlinematrix, &mat);
if (code < 0)
- goto Td_error;
+ return code;
code = gs_settextmatrix(ctx->pgs, (gs_matrix *)&mat);
if (code < 0)
- goto Td_error;
-
- code = gs_settextlinematrix(ctx->pgs, (gs_matrix *)&mat);
- if (code < 0)
- goto Td_error;
-
- pdfi_pop(ctx, 2);
- return code;
+ return code;
-Td_error:
- pdfi_pop(ctx, 2);
- return code;
+ return gs_settextlinematrix(ctx->pgs, (gs_matrix *)&mat);
}
int pdfi_TD(pdf_context *ctx)
{
int code;
- pdf_num *Tx = NULL, *Ty = NULL;
+ double Txy[2];
gs_matrix m, mat;
- if (pdfi_count_stack(ctx) < 2) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
-
gs_make_identity(&m);
- Ty = (pdf_num *)ctx->stack_top[-1];
- Tx = (pdf_num *)ctx->stack_top[-2];
-
- if (Tx->type == PDF_INT) {
- m.tx = (float)Tx->value.i;
- } else {
- if (Tx->type == PDF_REAL) {
- m.tx = (float)Tx->value.d;
- } else {
- code = gs_note_error(gs_error_typecheck);
- goto TD_error;
- }
- }
+ code = pdfi_destack_reals(ctx, Txy, 2);
+ if (code < 0)
+ return code;
- if (Ty->type == PDF_INT) {
- m.ty = (float)Ty->value.i;
- } else {
- if (Ty->type == PDF_REAL) {
- m.ty = (float)Ty->value.d;
- } else {
- code = gs_note_error(gs_error_typecheck);
- goto TD_error;
- }
- }
+ m.tx = Txy[0];
+ m.ty = Txy[1];
if (ctx->text.BlockDepth == 0) {
pdfi_set_warning(ctx, 0, NULL, W_PDF_TEXTOPNOBT, "pdfi_TD", NULL);
@@ -325,35 +258,26 @@ int pdfi_TD(pdf_context *ctx)
gs_make_identity(&mat);
code = gs_settextmatrix(ctx->pgs, &mat);
if (code < 0)
- goto TD_error;
+ return code;
code = gs_settextlinematrix(ctx->pgs, &mat);
if (code < 0)
- goto TD_error;
+ return code;
}
code = pdfi_set_TL(ctx, m.ty * 1.0f);
if (code < 0)
- goto TD_error;
+ return code;
code = gs_matrix_multiply(&m, &ctx->pgs->textlinematrix, &mat);
if (code < 0)
- goto TD_error;
+ return code;
code = gs_settextmatrix(ctx->pgs, (gs_matrix *)&mat);
if (code < 0)
- goto TD_error;
-
- code = gs_settextlinematrix(ctx->pgs, (gs_matrix *)&mat);
- if (code < 0)
- goto TD_error;
-
- pdfi_pop(ctx, 2);
- return code;
+ return code;
-TD_error:
- pdfi_pop(ctx, 2);
- return code;
+ return gs_settextlinematrix(ctx->pgs, (gs_matrix *)&mat);
}
/* This routine sets up most of the text params structure. In particular it
@@ -436,7 +360,7 @@ static int pdfi_show_set_params(pdf_context *ctx, pdf_string *s, gs_text_params_
for (i = 0;i < s->length; i++) {
/* Get the width (in unscaled text units) */
if (s->data[i] < current_font->FirstChar || s->data[i] > current_font->LastChar)
- width = 0;
+ width = current_font->MissingWidth;
else
width = current_font->Widths[s->data[i] - current_font->FirstChar];
/* And convert the width into an appropriate value for the current environment */
@@ -1083,8 +1007,10 @@ int pdfi_Tj(pdf_context *ctx)
goto exit;
s = (pdf_string *)ctx->stack_top[-1];
- if (s->type != PDF_STRING)
+ if (pdfi_type_of(s) != PDF_STRING) {
+ pdfi_pop(ctx, 1);
return_error(gs_error_typecheck);
+ }
/* We can't rely on the stack reference because an error during
the text operation (i.e. retrieving objects for glyph metrics
@@ -1198,7 +1124,7 @@ int pdfi_TJ(pdf_context *ctx)
goto exit;
a = (pdf_array *)ctx->stack_top[-1];
- if (a->type != PDF_ARRAY) {
+ if (pdfi_type_of(a) != PDF_ARRAY) {
pdfi_pop(ctx, 1);
return gs_note_error(gs_error_typecheck);
}
@@ -1260,29 +1186,17 @@ int pdfi_TJ(pdf_context *ctx)
if (code < 0)
goto TJ_error;
- if (o->type == PDF_INT) {
- dx = (double)((pdf_num *)o)->value.i / -1000;
+ if (pdfi_type_of(o) == PDF_STRING)
+ code = pdfi_show(ctx, (pdf_string *)o);
+ else {
+ code = pdfi_obj_to_real(ctx, o, &dx);
+ if (code < 0)
+ goto TJ_error;
+ dx /= -1000;
if (current_font->pfont && current_font->pfont->WMode == 0)
code = gs_rmoveto(ctx->pgs, dx, 0);
else
code = gs_rmoveto(ctx->pgs, 0, dx);
- if (code < 0)
- goto TJ_error;
- } else {
- if (o->type == PDF_REAL) {
- dx = ((pdf_num *)o)->value.d / -1000;
- if (current_font->pfont && current_font->pfont->WMode == 0)
- code = gs_rmoveto(ctx->pgs, dx, 0);
- else
- code = gs_rmoveto(ctx->pgs, 0, dx);
- if (code < 0)
- goto TJ_error;
- } else {
- if (o->type == PDF_STRING)
- code = pdfi_show(ctx, (pdf_string *)o);
- else
- code = gs_note_error(gs_error_typecheck);
- }
}
pdfi_countdown(o);
o = NULL;
@@ -1326,53 +1240,25 @@ static int pdfi_set_TL(pdf_context *ctx, double TL)
int pdfi_TL(pdf_context *ctx)
{
- int code = 0;
- pdf_num *n = NULL;
-
- if (pdfi_count_stack(ctx) < 1) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ int code;
+ double d;
- n = (pdf_num *)ctx->stack_top[-1];
+ code = pdfi_destack_real(ctx, &d);
+ if (code < 0)
+ return code;
- if (n->type == PDF_INT)
- code = pdfi_set_TL(ctx, (double)(n->value.i * -1));
- else {
- if (n->type == PDF_REAL)
- code = pdfi_set_TL(ctx, n->value.d * -1.0);
- else
- code = gs_note_error(gs_error_typecheck);
- }
- pdfi_pop(ctx, 1);
- return code;
+ return pdfi_set_TL(ctx, -d);
}
int pdfi_Tm(pdf_context *ctx)
{
- int code = 0, i;
+ int code;
float m[6];
- pdf_num *n = NULL;
gs_matrix mat;
- if (pdfi_count_stack(ctx) < 6) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
- for (i = 1;i < 7;i++) {
- n = (pdf_num *)ctx->stack_top[-1 * i];
- if (n->type == PDF_INT)
- m[6 - i] = (float)n->value.i;
- else {
- if (n->type == PDF_REAL)
- m[6 - i] = (float)n->value.d;
- else {
- pdfi_pop(ctx, 6);
- return_error(gs_error_typecheck);
- }
- }
- }
- pdfi_pop(ctx, 6);
+ code = pdfi_destack_floats(ctx, m, 6);
+ if (code < 0)
+ return code;
if (ctx->text.BlockDepth == 0) {
pdfi_set_warning(ctx, 0, NULL, W_PDF_TEXTOPNOBT, "pdfi_Tm", NULL);
@@ -1394,91 +1280,72 @@ int pdfi_Tm(pdf_context *ctx)
if (code < 0)
return code;
- code = gs_settextlinematrix(ctx->pgs, (gs_matrix *)&m);
-
- return code;
+ return gs_settextlinematrix(ctx->pgs, (gs_matrix *)&m);
}
int pdfi_Tr(pdf_context *ctx)
{
- int code = 0, mode = 0;
- pdf_num *n = NULL;
-
- if (pdfi_count_stack(ctx) < 1) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
-
- n = (pdf_num *)ctx->stack_top[-1];
+ int code;
+ int64_t mode;
- if (n->type == PDF_INT)
- mode = n->value.i;
- else {
- if (n->type == PDF_REAL)
- mode = (int)n->value.d;
- else {
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
- }
- }
- pdfi_pop(ctx, 1);
+ code = pdfi_destack_int(ctx, &mode);
+ if (code < 0)
+ return code;
if (mode < 0 || mode > 7)
- code = gs_note_error(gs_error_rangecheck);
- else {
+ return_error(gs_error_rangecheck);
+
/* See comment regarding text rendering modes involving clip in pdfi_BT() above.
* The commented out code here will be needed when we enhance pdfwrite so that
* we don't need to do the clip separately.
*/
-/* if (!ctx->device_state.preserve_tr_mode) {*/
- gs_point initial_point;
+/*
+ if (ctx->device_state.preserve_tr_mode) {
+ gs_settextrenderingmode(ctx->pgs, mode);
+ } else
+*/
+ {
+ gs_point initial_point;
- /* Detect attempts to switch from a clipping mode to a non-clipping
- * mode, this is defined as invalid in the spec.
+ /* Detect attempts to switch from a clipping mode to a non-clipping
+ * mode, this is defined as invalid in the spec.
+ */
+ if (gs_currenttextrenderingmode(ctx->pgs) > 3 && mode < 4 && ctx->text.BlockDepth != 0)
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BADTRSWITCH, "pdfi_Tr", NULL);
+
+ if (gs_currenttextrenderingmode(ctx->pgs) < 4 && mode >= 4 && ctx->text.BlockDepth != 0) {
+ /* If we are switching from a non-clip text rendering mode to a
+ * mode involving a cip, and we are already inside a text block,
+ * put a gsave in place so that we can accumulate a path for
+ * clipping without disturbing any existing path in the
+ * graphics state.
*/
- if (gs_currenttextrenderingmode(ctx->pgs) > 3 && mode < 4 && ctx->text.BlockDepth != 0)
- pdfi_set_warning(ctx, 0, NULL, W_PDF_BADTRSWITCH, "pdfi_Tr", NULL);
-
- if (gs_currenttextrenderingmode(ctx->pgs) < 4 && mode >= 4 && ctx->text.BlockDepth != 0) {
- /* If we are switching from a non-clip text rendering mode to a
- * mode involving a cip, and we are already inside a text block,
- * put a gsave in place so that we can accumulate a path for
- * clipping without disturbing any existing path in the
- * graphics state.
- */
- gs_settextrenderingmode(ctx->pgs, mode);
- pdfi_gsave(ctx);
- /* Capture the current position */
- code = gs_currentpoint(ctx->pgs, &initial_point);
- /* Start a new path (so our clip doesn't include any
- * already extant path in the graphics state)
- */
- gs_newpath(ctx->pgs);
- gs_moveto(ctx->pgs, initial_point.x, initial_point.y);
- }
- else {
- if (gs_currenttextrenderingmode(ctx->pgs) >= 4 && mode < 4 && ctx->text.BlockDepth != 0) {
- /* If we are switching from a clipping mode to a non-clipping
- * mode then behave as if we had an implicit ET to flush the
- * accumulated text to a clip, then set the text rendering mode
- * to the non-clip mode, and perform an implicit BT.
- */
- code = pdfi_ET(ctx);
- if (code < 0)
- return code;
- gs_settextrenderingmode(ctx->pgs, mode);
- code = pdfi_BT(ctx);
- if (code < 0)
- return code;
- }
- else
- gs_settextrenderingmode(ctx->pgs, mode);
- }
-/* }
+ gs_settextrenderingmode(ctx->pgs, mode);
+ pdfi_gsave(ctx);
+ /* Capture the current position */
+ code = gs_currentpoint(ctx->pgs, &initial_point);
+ /* Start a new path (so our clip doesn't include any
+ * already extant path in the graphics state)
+ */
+ gs_newpath(ctx->pgs);
+ gs_moveto(ctx->pgs, initial_point.x, initial_point.y);
+ } else if (gs_currenttextrenderingmode(ctx->pgs) >= 4 && mode < 4 && ctx->text.BlockDepth != 0) {
+ /* If we are switching from a clipping mode to a non-clipping
+ * mode then behave as if we had an implicit ET to flush the
+ * accumulated text to a clip, then set the text rendering mode
+ * to the non-clip mode, and perform an implicit BT.
+ */
+ code = pdfi_ET(ctx);
+ if (code < 0)
+ return code;
+ gs_settextrenderingmode(ctx->pgs, mode);
+ code = pdfi_BT(ctx);
+ if (code < 0)
+ return code;
+ }
else
- gs_settextrenderingmode(ctx->pgs, mode);*/
+ gs_settextrenderingmode(ctx->pgs, mode);
}
-
return code;
}
@@ -1489,26 +1356,14 @@ static int pdfi_set_Ts(pdf_context *ctx, double Ts)
int pdfi_Ts(pdf_context *ctx)
{
- int code = 0;
- pdf_num *n = NULL;
-
- if (pdfi_count_stack(ctx) < 1) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ int code;
+ double d;
- n = (pdf_num *)ctx->stack_top[-1];
+ code = pdfi_destack_real(ctx, &d);
+ if (code < 0)
+ return code;
- if (n->type == PDF_INT)
- code = pdfi_set_Ts(ctx, (double)n->value.i);
- else {
- if (n->type == PDF_REAL)
- code = pdfi_set_Ts(ctx, n->value.d);
- else
- code = gs_note_error(gs_error_typecheck);
- }
- pdfi_pop(ctx, 1);
- return code;
+ return pdfi_set_Ts(ctx, d);
}
static int pdfi_set_Tw(pdf_context *ctx, double Tw)
@@ -1518,50 +1373,26 @@ static int pdfi_set_Tw(pdf_context *ctx, double Tw)
int pdfi_Tw(pdf_context *ctx)
{
- int code = 0;
- pdf_num *n = NULL;
-
- if (pdfi_count_stack(ctx) < 1) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ int code;
+ double d;
- n = (pdf_num *)ctx->stack_top[-1];
+ code = pdfi_destack_real(ctx, &d);
+ if (code < 0)
+ return code;
- if (n->type == PDF_INT)
- code = pdfi_set_Tw(ctx, (double)n->value.i);
- else {
- if (n->type == PDF_REAL)
- code = pdfi_set_Tw(ctx, n->value.d);
- else
- code = gs_note_error(gs_error_typecheck);
- }
- pdfi_pop(ctx, 1);
- return code;
+ return pdfi_set_Tw(ctx, d);
}
int pdfi_Tz(pdf_context *ctx)
{
- int code = 0;
- pdf_num *n = NULL;
-
- if (pdfi_count_stack(ctx) < 1) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
+ int code;
+ double d;
- n = (pdf_num *)ctx->stack_top[-1];
+ code = pdfi_destack_real(ctx, &d);
+ if (code < 0)
+ return code;
- if (n->type == PDF_INT)
- code = gs_settexthscaling(ctx->pgs, (double)n->value.i);
- else {
- if (n->type == PDF_REAL)
- code = gs_settexthscaling(ctx->pgs, n->value.d);
- else
- code = gs_note_error(gs_error_typecheck);
- }
- pdfi_pop(ctx, 1);
- return code;
+ return gs_settexthscaling(ctx->pgs, d);
}
int pdfi_singlequote(pdf_context *ctx)
@@ -1572,11 +1403,6 @@ int pdfi_singlequote(pdf_context *ctx)
pdfi_set_warning(ctx, 0, NULL, W_PDF_TEXTOPNOBT, "pdfi_singlequote", NULL);
}
- if (pdfi_count_stack(ctx) < 1) {
- pdfi_clearstack(ctx);
- return_error(gs_error_stackunderflow);
- }
-
code = pdfi_T_star(ctx);
if (code < 0)
return code;
@@ -1587,8 +1413,7 @@ int pdfi_singlequote(pdf_context *ctx)
int pdfi_doublequote(pdf_context *ctx)
{
int code;
- pdf_string *s;
- pdf_num *Tw, *Tc;
+ double Tw, Tc;
if (ctx->text.BlockDepth == 0) {
pdfi_set_warning(ctx, 0, NULL, W_PDF_TEXTOPNOBT, "pdfi_T_doublequote", NULL);
@@ -1599,38 +1424,35 @@ int pdfi_doublequote(pdf_context *ctx)
return_error(gs_error_stackunderflow);
}
- s = (pdf_string *)ctx->stack_top[-1];
- Tc = (pdf_num *)ctx->stack_top[-2];
- Tw = (pdf_num *)ctx->stack_top[-3];
- if (s->type != PDF_STRING || (Tc->type != PDF_INT && Tc->type != PDF_REAL) ||
- (Tw->type != PDF_INT && Tw->type != PDF_REAL)) {
+ if (pdfi_type_of(ctx->stack_top[-1]) != PDF_STRING) {
pdfi_pop(ctx, 3);
return gs_note_error(gs_error_typecheck);
}
- if (Tc->type == PDF_INT)
- code = pdfi_set_Tc(ctx, (double)Tc->value.i);
- else
- code = pdfi_set_Tc(ctx, Tc->value.d);
- if (code < 0) {
- pdfi_pop(ctx, 3);
- return code;
- }
+ code = pdfi_obj_to_real(ctx, ctx->stack_top[-2], &Tc);
+ if (code < 0)
+ goto error;
+ code = pdfi_set_Tc(ctx, Tc);
+ if (code < 0)
+ goto error;
- if (Tw->type == PDF_INT)
- code = pdfi_set_Tw(ctx, (double)Tw->value.i);
- else
- code = pdfi_set_Tw(ctx, Tw->value.d);
- if (code < 0) {
- pdfi_pop(ctx, 3);
- return code;
- }
+ code = pdfi_obj_to_real(ctx, ctx->stack_top[-3], &Tw);
+ if (code < 0)
+ goto error;
+ code = pdfi_set_Tw(ctx, Tw);
+ if (code < 0)
+ goto error;
code = pdfi_T_star(ctx);
if (code < 0)
- return code;
+ goto error;
code = pdfi_Tj(ctx);
+ /* Tj pops one off the stack for us, leaving us 2 to go. */
+ pdfi_pop(ctx, 2);
+ return code;
+
+error:
pdfi_pop(ctx, 3);
return code;
}
diff --git a/pdf/pdf_tokens.h b/pdf/pdf_tokens.h
new file mode 100644
index 00000000..e9fe833d
--- /dev/null
+++ b/pdf/pdf_tokens.h
@@ -0,0 +1,116 @@
+/* Copyright (C) 2022 Artifex Software, Inc.
+ All Rights Reserved.
+
+ This software is provided AS-IS with no warranty, either express or
+ implied.
+
+ This software is distributed under license and may not be copied,
+ modified or distributed except as expressly authorized under the terms
+ of the license contained in the file LICENSE in this distribution.
+
+ Refer to licensing information at http://www.artifex.com or contact
+ Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
+ CA 94945, U.S.A., +1(415)492-9861, for further information.
+*/
+
+#ifndef PARAM1
+#define PARAMCAT(A,B) A ## B
+#define PARAM1(A) PARAMCAT(TOKEN_, A),
+#define PARAM2(A,B) PARAMCAT(TOKEN_, B),
+#endif
+
+// Errors
+PARAM2("", NOT_A_KEYWORD)
+// Insert new error tokens here.
+PARAM2("", TOO_LONG)
+PARAM2("", INVALID_KEY)
+// Real tokens start here, at TOKEN_INVALID_KEY+1
+PARAM2("\"", QUOTE)
+PARAM2("'", APOSTROPHE)
+PARAM1(B)
+PARAM2("B*", Bstar)
+PARAM1(BDC)
+PARAM1(BI)
+PARAM1(BMC)
+PARAM1(BT)
+PARAM1(BX)
+PARAM1(CS)
+PARAM1(DP)
+PARAM1(Do)
+PARAM1(EI)
+PARAM1(EMC)
+PARAM1(ET)
+PARAM1(EX)
+PARAM1(F)
+PARAM1(G)
+PARAM1(ID)
+PARAM1(J)
+PARAM1(K)
+PARAM1(M)
+PARAM1(MP)
+PARAM1(Q)
+PARAM1(R)
+PARAM1(RG)
+PARAM1(S)
+PARAM1(SC)
+PARAM1(SCN)
+PARAM2("T*", Tstar)
+PARAM1(TD)
+PARAM1(TJ)
+PARAM1(TL)
+PARAM1(Tc)
+PARAM1(Td)
+PARAM1(Tf)
+PARAM1(Tj)
+PARAM1(Tm)
+PARAM1(Tr)
+PARAM1(Ts)
+PARAM1(Tw)
+PARAM1(Tz)
+PARAM1(W)
+PARAM2("W*", Wstar)
+PARAM1(b)
+PARAM2("b*", bstar)
+PARAM1(c)
+PARAM1(cm)
+PARAM1(cs)
+PARAM1(d)
+PARAM1(d0)
+PARAM1(d1)
+PARAM2("endobj", ENDOBJ)
+PARAM2("endstream", ENDSTREAM)
+PARAM1(f)
+PARAM2("f*", fstar)
+PARAM2("false", FALSE)
+PARAM1(g)
+PARAM1(gs)
+PARAM1(h)
+PARAM1(i)
+PARAM1(j)
+PARAM1(k)
+PARAM1(l)
+PARAM1(m)
+PARAM1(n)
+PARAM1(null)
+PARAM2("obj", OBJ)
+PARAM1(q)
+PARAM1(r)
+PARAM1(re)
+PARAM1(rg)
+PARAM1(ri)
+PARAM1(s)
+PARAM1(sc)
+PARAM1(scn)
+PARAM1(sh)
+PARAM2("startxref", STARTXREF)
+PARAM2("stream", STREAM)
+PARAM2("trailer", TRAILER)
+PARAM2("true", TRUE)
+PARAM1(v)
+PARAM1(w)
+PARAM2("xref", XREF)
+PARAM1(y)
+
+#undef PARAM1
+#undef PARAM2
+#undef PARAMCAT
diff --git a/pdf/pdf_trans.c b/pdf/pdf_trans.c
index df0194d7..fecb74c9 100644
--- a/pdf/pdf_trans.c
+++ b/pdf/pdf_trans.c
@@ -103,7 +103,7 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
double f;
gs_matrix save_matrix, GroupMat, group_Matrix;
gs_transparency_mask_subtype_t subtype = TRANSPARENCY_MASK_Luminosity;
- pdf_bool *Processed = NULL;
+ bool Processed, ProcessedKnown = 0;
bool save_OverrideICC = gs_currentoverrideicc(ctx->pgs);
#if DEBUG_TRANSPARENCY
@@ -114,28 +114,26 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
/* Following the logic of the ps code, cram a /Processed key in the SMask dict to
* track whether it's already been processed.
*/
- code = pdfi_dict_knownget_type(ctx, SMask, "Processed", PDF_BOOL, (pdf_obj **)&Processed);
- if (code > 0 && Processed->value) {
+ code = pdfi_dict_knownget_bool(ctx, SMask, "Processed", &Processed);
+ if (code > 0) {
+ if (Processed) {
#if DEBUG_TRANSPARENCY
- dbgmprintf(ctx->memory, "SMask already built, skipping\n");
+ dbgmprintf(ctx->memory, "SMask already built, skipping\n");
#endif
- goto exit;
+ code = 0;
+ goto exit;
+ }
+ ProcessedKnown = 1;
}
gs_setoverrideicc(ctx->pgs, true);
/* If /Processed not in the dict, put it there */
if (code == 0) {
- /* the cleanup at end of this routine assumes Processed has a ref */
- code = pdfi_object_alloc(ctx, PDF_BOOL, 0, (pdf_obj **)&Processed);
- if (code < 0)
- goto exit;
- Processed->value = false;
- /* pdfi_object_alloc() doesn't grab a ref */
- pdfi_countup(Processed);
- code = pdfi_dict_put(ctx, SMask, "Processed", (pdf_obj *)Processed);
+ code = pdfi_dict_put_bool(ctx, SMask, "Processed", false);
if (code < 0)
goto exit;
+ ProcessedKnown = 1;
}
/* See pdf1.7 pg 553 (pain in the butt to find this!) */
@@ -172,21 +170,25 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
/* TR is transfer function (Optional) */
code = pdfi_dict_knownget(ctx, SMask, "TR", (pdf_obj **)&TR);
if (code > 0) {
- if (TR->type == PDF_DICT || TR->type == PDF_STREAM) {
- code = pdfi_build_function(ctx, &gsfunc, NULL, 1, TR, NULL);
- if (code < 0)
- goto exit;
- if (gsfunc->params.m != 1 || gsfunc->params.n != 1) {
- pdfi_free_function(ctx, gsfunc);
- gsfunc = NULL;
- dmprintf(ctx->memory, "WARNING: Ignoring invalid TR (number of inpuits or outputs not 1) in SMask\n");
- }
- } else if (TR->type == PDF_NAME) {
- if (!pdfi_name_is((pdf_name *)TR, "Identity")) {
- dmprintf(ctx->memory, "WARNING: Unknown TR in SMask\n");
- }
- } else {
- dmprintf(ctx->memory, "WARNING: Ignoring invalid TR in SMask\n");
+ switch (pdfi_type_of(TR)) {
+ case PDF_DICT:
+ case PDF_STREAM:
+ code = pdfi_build_function(ctx, &gsfunc, NULL, 1, TR, NULL);
+ if (code < 0)
+ goto exit;
+ if (gsfunc->params.m != 1 || gsfunc->params.n != 1) {
+ pdfi_free_function(ctx, gsfunc);
+ gsfunc = NULL;
+ dmprintf(ctx->memory, "WARNING: Ignoring invalid TR (number of inpuits or outputs not 1) in SMask\n");
+ }
+ break;
+ case PDF_NAME:
+ if (!pdfi_name_is((pdf_name *)TR, "Identity")) {
+ dmprintf(ctx->memory, "WARNING: Unknown TR in SMask\n");
+ }
+ break;
+ default:
+ dmprintf(ctx->memory, "WARNING: Ignoring invalid TR in SMask\n");
}
}
@@ -251,8 +253,14 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
if (code > 0) {
/* TODO: Stuff with colorspace, see .execmaskgroup */
code = pdfi_dict_knownget(ctx, Group, "CS", &CS);
- if (code < 0)
- goto exit;
+ if (code < 0) {
+ code = pdfi_dict_knownget(ctx, Group, "ColorSpace", &CS);
+ if (code < 0) {
+ pdfi_set_error(ctx, 0, NULL, E_PDF_GROUP_NO_CS, "pdfi_trans_set_mask", (char *)"*** Defaulting to currrent colour space");
+ goto exit;
+ }
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_GROUP_HAS_COLORSPACE, "pdfi_trans_set_mask", NULL);
+ }
if (code > 0) {
code = pdfi_create_colorspace(ctx, CS, (pdf_dict *)ctx->main_stream,
ctx->page.CurrentPageDict, &pcs, false);
@@ -284,6 +292,9 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
}
params.Background_components = pdfi_array_size(BC);
+ if (gs_color_space_num_components(params.ColorSpace) != params.Background_components)
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_GROUP_BAD_BC, "pdfi_trans_set_mask", NULL);
+
/* TODO: Not sure how to handle this... recheck PS code (pdf_draw.ps/gssmask) */
/* This should be "currentgray" for the color that we put in params.ColorSpace,
* It looks super-convoluted to actually get this value. Really?
@@ -300,7 +311,7 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
code = pdfi_form_execgroup(ctx, ctx->page.CurrentPageDict, G_stream,
igs->GroupGState, NULL, &group_Matrix);
code1 = gs_end_transparency_mask(ctx->pgs, colorindex);
- if (code != 0)
+ if (code == 0)
code = code1;
/* Put back the matrix (we couldn't just rely on gsave/grestore for whatever reason,
@@ -309,8 +320,12 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
gs_setmatrix(ctx->pgs, &save_matrix);
/* Set Processed flag */
- if (code == 0 && Processed)
- Processed->value = true;
+ if (code == 0 && ProcessedKnown)
+ {
+ code = pdfi_dict_put_bool(ctx, SMask, "Processed", true);
+ if (code < 0)
+ goto exit;
+ }
} else {
/* take action on a non-/Mask entry. What does this mean ? What do we need to do */
dmprintf(ctx->memory, "Warning: Type is not /Mask, entry ignored in pdfi_set_trans_mask\n");
@@ -332,7 +347,6 @@ static int pdfi_trans_set_mask(pdf_context *ctx, pdfi_int_gstate *igs, int color
pdfi_countdown(BBox);
pdfi_countdown(Matrix);
pdfi_countdown(CS);
- pdfi_countdown(Processed);
#if DEBUG_TRANSPARENCY
dbgmprintf(ctx->memory, "pdfi_trans_set_mask (.execmaskgroup) END\n");
#endif
@@ -393,7 +407,7 @@ static int pdfi_transparency_group_common(pdf_context *ctx, pdf_dict *page_dict,
/* Didn't find a /CS key, try again using /ColorSpace */
code = pdfi_dict_knownget(ctx, group_dict, "ColorSpace", &CS);
}
- if (code > 0 && CS->type != PDF_NULL) {
+ if (code > 0 && pdfi_type_of(CS) != PDF_NULL) {
code = pdfi_setcolorspace(ctx, CS, group_dict, page_dict);
if (code < 0)
goto exit;
@@ -865,6 +879,7 @@ int pdfi_trans_teardown(pdf_context *ctx, pdfi_trans_state_t *state)
int pdfi_trans_set_params(pdf_context *ctx)
{
+ int code = 0;
pdfi_int_gstate *igs = (pdfi_int_gstate *)ctx->pgs->client_data;
gs_transparency_channel_selector_t csel;
@@ -874,9 +889,9 @@ int pdfi_trans_set_params(pdf_context *ctx)
else
csel = TRANSPARENCY_CHANNEL_Opacity;
if (igs->SMask) {
- pdfi_trans_set_mask(ctx, igs, csel);
+ code = pdfi_trans_set_mask(ctx, igs, csel);
}
}
- return 0;
+ return code;
}
diff --git a/pdf/pdf_types.h b/pdf/pdf_types.h
index b8213e0b..6f78dde7 100644
--- a/pdf/pdf_types.h
+++ b/pdf/pdf_types.h
@@ -47,6 +47,7 @@ typedef enum pdf_obj_type_e {
PDF_INDIRECT = 'R',
PDF_BOOL = 'b',
PDF_KEYWORD = 'K',
+ PDF_FAST_KEYWORD = 'k',
PDF_FONT = 'F',
PDF_STREAM = 'S',
/* The following aren't PDF object types, but are objects we either want to
@@ -57,6 +58,7 @@ typedef enum pdf_obj_type_e {
PDF_DICT_MARK = '<',
PDF_PROC_MARK = '{',
PDF_CMAP = 'C',
+ PDF_BUFFER = 'B',
/* Lastly, for the benefit of duplicate colour space identification, we store either
* a name for a colour space, or if there is no name, the context (we can get the
* context from the name object if there is one). We need to be able to tell if a
@@ -115,11 +117,6 @@ typedef struct pdf_obj_s {
pdf_obj_common;
} pdf_obj;
-typedef struct pdf_bool_s {
- pdf_obj_common;
- bool value;
-} pdf_bool;
-
typedef struct pdf_num_s {
pdf_obj_common;
union {
@@ -141,22 +138,29 @@ typedef struct pdf_name_s {
unsigned char data[PDF_NAME_DECLARED_LENGTH];
} pdf_name;
+/* For storing arbitrary byte arrays where the length may be
+ greater than PDF_NAME_DECLARED_LENGTH - prevents static
+ alalysis tools complaining if we just used pdf_string
+ */
+typedef struct pdf_buffer_s {
+ pdf_obj_common;
+ uint32_t length;
+ unsigned char *data;
+} pdf_buffer;
+
typedef enum pdf_key_e {
- TOKEN_NOT_A_KEYWORD,
- TOKEN_OBJ,
- TOKEN_ENDOBJ,
- TOKEN_STREAM,
- TOKEN_ENDSTREAM,
- TOKEN_XREF,
- TOKEN_STARTXREF,
- TOKEN_TRAILER,
- TOKEN_INVALID_KEY,
+#include "pdf_tokens.h"
+ TOKEN__LAST_KEY,
} pdf_key;
+#define PDF_NULL_OBJ ((pdf_obj *)(uintptr_t)TOKEN_null)
+#define PDF_TRUE_OBJ ((pdf_obj *)(uintptr_t)TOKEN_TRUE)
+#define PDF_FALSE_OBJ ((pdf_obj *)(uintptr_t)TOKEN_FALSE)
+#define PDF_TOKEN_AS_OBJ(token) ((pdf_obj *)(uintptr_t)(token))
+
typedef struct pdf_keyword_s {
pdf_obj_common;
uint32_t length;
- pdf_key key;
unsigned char data[PDF_NAME_DECLARED_LENGTH];
} pdf_keyword;
@@ -251,4 +255,29 @@ typedef struct pdf_c_stream_s {
char unget_buffer[UNREAD_BUFFER_SIZE];
} pdf_c_stream;
+#ifndef inline
+#define inline __inline
+#endif /* inline */
+
+#define pdfi_type_of(A) pdfi_type_of_imp((pdf_obj *)A)
+
+static inline pdf_obj_type pdfi_type_of_imp(pdf_obj *obj)
+{
+ if ((uintptr_t)obj > TOKEN__LAST_KEY)
+ return obj->type;
+ else if ((uintptr_t)obj == TOKEN_TRUE || (uintptr_t)obj == TOKEN_FALSE)
+ return PDF_BOOL;
+ else if ((uintptr_t)obj == TOKEN_null)
+ return PDF_NULL;
+ else
+ return PDF_FAST_KEYWORD;
+}
+
+static inline int pdf_object_num(pdf_obj *obj)
+{
+ if ((uintptr_t)obj > TOKEN__LAST_KEY)
+ return obj->object_num;
+ return 0;
+}
+
#endif
diff --git a/pdf/pdf_warnings.h b/pdf/pdf_warnings.h
index 21b2403f..82928bef 100644
--- a/pdf/pdf_warnings.h
+++ b/pdf/pdf_warnings.h
@@ -18,6 +18,9 @@
#endif
PARAM(W_PDF_NOWARNING, "no warning"),
PARAM(W_PDF_BAD_XREF_SIZE, "incorrect xref size"),
+PARAM(W_PDF_BAD_XREF_ENTRY_SIZE, "xref entry not exactly 20 bytes"),
+PARAM(W_PDF_BAD_XREF_ENTRY_NO_EOL, "xref entry not terminated with EOL"),
+PARAM(W_PDF_BAD_XREF_ENTRY_FORMAT, "xref entry not valid format"),
PARAM(W_PDF_BAD_INLINEFILTER, "used inline filter name inappropriately"),
PARAM(W_PDF_BAD_INLINECOLORSPACE, "used inline colour space inappropriately"),
PARAM(W_PDF_BAD_INLINEIMAGEKEY, "used inline image key inappropriately"),
@@ -43,6 +46,7 @@ PARAM(W_PDF_NONSTANDARD_OP, "non standard operator found - ignoring"),
PARAM(W_PDF_NUM_EXPONENT, "number uses illegal exponent form"),
PARAM(W_PDF_STREAM_HAS_CONTENTS, "Stream has inappropriate /Contents entry"),
PARAM(W_PDF_STREAM_BAD_DECODEPARMS, "bad DecodeParms"),
+PARAM(W_PDF_STREAM_BAD_KEYWORD, "A stream keyword was not terminated with a linefeed (0x0A)"),
PARAM(W_PDF_MASK_ERROR, "error in Mask"),
PARAM(W_PDF_ANNOT_AP_ERROR, "error in annotation Appearance"),
PARAM(W_PDF_BAD_NAME_ESCAPE, "badly escaped name"),
@@ -58,5 +62,10 @@ PARAM(W_PDF_CA_OUTOFRANGE, "CA or ca value not in range 0.0 to 1.0, cla
PARAM(W_PDF_INVALID_DEFAULTSPACE, "Invalid DefaultGray, DefaultRGB or DefaultCMYK space specified, ignored."),
PARAM(W_PDF_INVALID_DECRYPT_LEN, "Invalid /Length supplied in Encryption dictionary."),
PARAM(W_PDF_INVALID_FONT_BASEENC, "Ignoring invalid BaseEncoding name in font"),
-
+PARAM(W_PDF_GROUP_HAS_COLORSPACE, "Group attributes dictionary has /ColorSpace instead of /CS"),
+PARAM(W_PDF_GROUP_BAD_BC, "Group attributes dictionary /BC differs in number of components from the colour space"),
+PARAM(W_PDF_INT_AS_REAL, "found real number when expecting int"),
+PARAM(PDF_W_NO_TREE_LIMITS, "Name tree node missing required Limits entry"),
+PARAM(PDF_W_BAD_TREE_LIMITS, "Name tree node Limits array does not have 2 entries"),
+PARAM(PDF_W_NAMES_ARRAY_SIZE, "Name tree Names array size not a mulitple of 2"),
#undef PARAM
diff --git a/pdf/pdf_xref.c b/pdf/pdf_xref.c
index 7e611130..3f3d8008 100644
--- a/pdf/pdf_xref.c
+++ b/pdf/pdf_xref.c
@@ -141,7 +141,7 @@ static int read_xref_stream_entries(pdf_context *ctx, pdf_c_stream *s, uint64_t
/* Forward definition */
static int read_xref(pdf_context *ctx, pdf_c_stream *s);
/* These two routines are recursive.... */
-static int pdfi_read_xref_stream_dict(pdf_context *ctx, pdf_c_stream *s);
+static int pdfi_read_xref_stream_dict(pdf_context *ctx, pdf_c_stream *s, int obj_num);
static int pdfi_process_xref_stream(pdf_context *ctx, pdf_stream *stream_obj, pdf_c_stream *s)
{
@@ -153,9 +153,10 @@ static int pdfi_process_xref_stream(pdf_context *ctx, pdf_stream *stream_obj, pd
int64_t size;
int64_t num;
int64_t W[3];
+ int objnum;
bool known = false;
- if (stream_obj->type != PDF_STREAM)
+ if (pdfi_type_of(stream_obj) != PDF_STREAM)
return_error(gs_error_typecheck);
code = pdfi_dict_from_obj(ctx, (pdf_obj *)stream_obj, &sdict);
@@ -307,7 +308,7 @@ static int pdfi_process_xref_stream(pdf_context *ctx, pdf_stream *stream_obj, pd
return code;
}
} else {
- int64_t start, end;
+ int64_t start, size;
if (code < 0) {
pdfi_close_file(ctx, XRefStrm);
@@ -334,7 +335,7 @@ static int pdfi_process_xref_stream(pdf_context *ctx, pdf_stream *stream_obj, pd
return code;
}
- code = pdfi_array_get_int(ctx, a, (uint64_t)i+1, &end);
+ code = pdfi_array_get_int(ctx, a, (uint64_t)i+1, &size);
if (code < 0) {
pdfi_countdown(a);
pdfi_close_file(ctx, XRefStrm);
@@ -343,8 +344,11 @@ static int pdfi_process_xref_stream(pdf_context *ctx, pdf_stream *stream_obj, pd
return code;
}
- if (start + end >= ctx->xref_table->xref_size) {
- code = resize_xref(ctx, start + end);
+ if (size < 1)
+ continue;
+
+ if (start + size >= ctx->xref_table->xref_size) {
+ code = resize_xref(ctx, start + size);
if (code < 0) {
pdfi_countdown(a);
pdfi_close_file(ctx, XRefStrm);
@@ -354,7 +358,7 @@ static int pdfi_process_xref_stream(pdf_context *ctx, pdf_stream *stream_obj, pd
}
}
- code = read_xref_stream_entries(ctx, XRefStrm, start, start + end - 1, (uint64_t *)W);
+ code = read_xref_stream_entries(ctx, XRefStrm, start, start + size - 1, (uint64_t *)W);
if (code < 0) {
pdfi_countdown(a);
pdfi_close_file(ctx, XRefStrm);
@@ -391,145 +395,106 @@ static int pdfi_process_xref_stream(pdf_context *ctx, pdf_stream *stream_obj, pd
pdfi_seek(ctx, s, num, SEEK_SET);
- code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
+ code = pdfi_read_bare_int(ctx, ctx->main_stream, &objnum);
+ if (code == 1)
+ return pdfi_read_xref_stream_dict(ctx, s, objnum);
+
+ code = pdfi_read_bare_keyword(ctx, ctx->main_stream);
if (code < 0)
return code;
- if (code == 0)
- return_error(gs_error_syntaxerror);
-
- if (((pdf_obj *)ctx->stack_top[-1])->type == PDF_KEYWORD && ((pdf_keyword *)ctx->stack_top[-1])->key == TOKEN_XREF) {
- /* Read old-style xref table */
- pdfi_pop(ctx, 1);
- return(read_xref(ctx, ctx->main_stream));
- } else
- code = pdfi_read_xref_stream_dict(ctx, s);
-
- return code;
+ if (code == TOKEN_XREF) {
+ pdfi_set_error(ctx, 0, NULL, E_PDF_PREV_NOT_XREF_STREAM, "pdfi_process_xref_stream", NULL);
+ if (!ctx->args.pdfstoponerror)
+ /* Read old-style xref table */
+ return(read_xref(ctx, ctx->main_stream));
+ }
+ return_error(gs_error_syntaxerror);
}
-static int pdfi_read_xref_stream_dict(pdf_context *ctx, pdf_c_stream *s)
+static int pdfi_read_xref_stream_dict(pdf_context *ctx, pdf_c_stream *s, int obj_num)
{
int code;
+ int gen_num;
if (ctx->args.pdfdebug)
dmprintf(ctx->memory, "\n%% Reading PDF 1.5+ xref stream\n");
- if (((pdf_obj *)ctx->stack_top[-1])->type == PDF_INT) {
- /* Its an integer, lets try for index gen obj as a XRef stream */
- code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
-
- if (code <= 0)
- return(pdfi_repair_file(ctx));
+ /* We have the obj_num. Lets try for obj_num gen obj as a XRef stream */
+ code = pdfi_read_bare_int(ctx, ctx->main_stream, &gen_num);
+ if (code <= 0)
+ return(pdfi_repair_file(ctx));
- if (((pdf_obj *)ctx->stack_top[-1])->type != PDF_INT) {
- /* Second element is not an integer, not a valid xref */
- pdfi_pop(ctx, 1);
- return(pdfi_repair_file(ctx));
- }
+ /* Try to read 'obj' */
+ code = pdfi_read_bare_keyword(ctx, ctx->main_stream);
+ if (code < 0)
+ return code;
+ if (code == 0)
+ return_error(gs_error_syntaxerror);
- code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
- if (code < 0) {
- pdfi_pop(ctx, 1);
- return code;
- }
- if (code == 0) {
- pdfi_pop(ctx, 1);
- return_error(gs_error_syntaxerror);
- }
+ /* Third element must be obj, or it's not a valid xref */
+ if (code != TOKEN_OBJ)
+ return(pdfi_repair_file(ctx));
- if (((pdf_obj *)ctx->stack_top[-1])->type != PDF_KEYWORD) {
- /* Second element is not an integer, not a valid xref */
- pdfi_pop(ctx, 2);
- return(pdfi_repair_file(ctx));
- } else {
- int obj_num, gen_num;
+ do {
+ code = pdfi_read_token(ctx, ctx->main_stream, obj_num, gen_num);
+ if (code <= 0)
+ return pdfi_repair_file(ctx);
- pdf_keyword *keyword = (pdf_keyword *)ctx->stack_top[-1];
+ if (pdfi_count_stack(ctx) >= 2 && pdfi_type_of(ctx->stack_top[-1]) == PDF_FAST_KEYWORD) {
+ uintptr_t keyword = (uintptr_t)ctx->stack_top[-1];
+ if (keyword == TOKEN_STREAM) {
+ pdf_dict *dict;
+ pdf_stream *sdict = NULL;
+ int64_t Length;
- if (keyword->key != TOKEN_OBJ) {
- pdfi_pop(ctx, 3);
- return(pdfi_repair_file(ctx));
- }
- /* pop the 'obj', generation and object numbers */
- pdfi_pop(ctx, 1);
- gen_num = ((pdf_num *)ctx->stack_top[-1])->value.i;
- pdfi_pop(ctx, 1);
- obj_num = ((pdf_num *)ctx->stack_top[-1])->value.i;
- pdfi_pop(ctx, 1);
+ /* Remove the 'stream' token from the stack, should leave a dictionary object on the stack */
+ pdfi_pop(ctx, 1);
+ if (pdfi_type_of(ctx->stack_top[-1]) != PDF_DICT) {
+ return pdfi_repair_file(ctx);
+ }
+ dict = (pdf_dict *)ctx->stack_top[-1];
- do {
- code = pdfi_read_token(ctx, ctx->main_stream, obj_num, gen_num);
- if (code <= 0)
+ /* Convert the dict into a stream (sdict comes back with at least one ref) */
+ code = pdfi_obj_dict_to_stream(ctx, dict, &sdict, true);
+ /* Pop off the dict */
+ pdfi_pop(ctx, 1);
+ if (code < 0) {
+ /* TODO: should I return code instead of trying to repair?
+ * Normally the above routine should not fail so something is
+ * probably seriously fubar.
+ */
return pdfi_repair_file(ctx);
+ }
+ dict = NULL;
+
+ /* Init the stuff for the stream */
+ sdict->stream_offset = pdfi_unread_tell(ctx);
+ sdict->object_num = obj_num;
+ sdict->generation_num = gen_num;
+
+ code = pdfi_dict_get_int(ctx, sdict->stream_dict, "Length", &Length);
+ if (code < 0) {
+ /* TODO: Not positive this will actually have a length -- just use 0 */
+ pdfi_set_error_var(ctx, 0, NULL, E_PDF_BADSTREAM, "pdfi_read_xref_stream_dict", "Xref Stream object %u missing mandatory keyword /Length\n", obj_num);
+ code = 0;
+ Length = 0;
+ }
+ sdict->Length = Length;
+ sdict->length_valid = true;
- if (pdfi_count_stack(ctx) >= 2 && ((pdf_obj *)ctx->stack_top[-1])->type == PDF_KEYWORD) {
- keyword = (pdf_keyword *)ctx->stack_top[-1];
- if (keyword->key == TOKEN_STREAM) {
- pdf_dict *dict;
- pdf_stream *sdict = NULL;
- int64_t Length;
-
- /* Remove the 'stream' token from the stack, should leave a dictionary object on the stack */
- pdfi_pop(ctx, 1);
- if (((pdf_obj *)ctx->stack_top[-1])->type != PDF_DICT) {
- pdfi_pop(ctx, 1);
- return pdfi_repair_file(ctx);
- }
- dict = (pdf_dict *)ctx->stack_top[-1];
-
- /* Convert the dict into a stream (sdict comes back with at least one ref) */
- code = pdfi_obj_dict_to_stream(ctx, dict, &sdict, true);
- if (code < 0) {
- pdfi_pop(ctx, 1);
- /* TODO: should I return code instead of trying to repair?
- * Normally the above routine should not fail so something is
- * probably seriously fubar.
- */
- return pdfi_repair_file(ctx);
- }
- /* Pop off the dict */
- pdfi_pop(ctx, 1);
- dict = NULL;
-
- /* Init the stuff for the stream */
- sdict->stream_offset = pdfi_unread_tell(ctx);
- sdict->object_num = obj_num;
- sdict->generation_num = gen_num;
-
- code = pdfi_dict_get_int(ctx, sdict->stream_dict, "Length", &Length);
- if (code < 0) {
- /* TODO: Not positive this will actually have a length -- just use 0 */
- char extra_info[gp_file_name_sizeof];
-
- gs_snprintf(extra_info, sizeof(extra_info), "Xref Stream object %u missing mandatory keyword /Length\n", obj_num);
- pdfi_set_error(ctx, 0, NULL, E_PDF_BADSTREAM, "pdfi_read_xref_stream_dict", extra_info);
- code = 0;
- Length = 0;
- }
- sdict->Length = Length;
- sdict->length_valid = true;
-
- code = pdfi_process_xref_stream(ctx, sdict, ctx->main_stream);
- if (code < 0) {
- pdfi_countdown(sdict);
- return (pdfi_repair_file(ctx));
- }
- pdfi_countdown(sdict);
- break;
- }
- if (keyword->key == TOKEN_ENDOBJ) {
- /* Something went wrong, this is not a stream dictionary */
- pdfi_pop(ctx, 3);
- return(pdfi_repair_file(ctx));
- break;
- }
+ code = pdfi_process_xref_stream(ctx, sdict, ctx->main_stream);
+ if (code < 0) {
+ pdfi_countdown(sdict);
+ return (pdfi_repair_file(ctx));
}
- } while(1);
+ pdfi_countdown(sdict);
+ break;
+ } else if (keyword == TOKEN_ENDOBJ) {
+ /* Something went wrong, this is not a stream dictionary */
+ return(pdfi_repair_file(ctx));
+ }
}
- } else {
- /* Not an 'xref' and not an integer, so not a valid xref */
- return(pdfi_repair_file(ctx));
- }
+ } while(1);
return 0;
}
@@ -676,8 +641,8 @@ static int write_offset(byte *B, gs_offset_t o, unsigned int g, unsigned char fr
static int read_xref_section(pdf_context *ctx, pdf_c_stream *s, uint64_t *section_start, uint64_t *section_size)
{
int code = 0, i, j;
- pdf_obj *o = NULL;
- uint64_t start = 0, size = 0;
+ int start = 0;
+ int size = 0;
int64_t bytes = 0;
char Buffer[21];
@@ -686,57 +651,37 @@ static int read_xref_section(pdf_context *ctx, pdf_c_stream *s, uint64_t *sectio
if (ctx->args.pdfdebug)
dmprintf(ctx->memory, "\n%% Reading xref section\n");
- code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
-
- if (code < 0)
- return code;
-
- if (pdfi_count_stack(ctx) < 1)
- return_error(gs_error_stackunderflow);
-
- o = ctx->stack_top[-1];
- if (o->type == PDF_KEYWORD)
- return 0;
+ code = pdfi_read_bare_int(ctx, ctx->main_stream, &start);
+ if (code < 0) {
+ /* Not an int, might be a keyword */
+ code = pdfi_read_bare_keyword(ctx, ctx->main_stream);
+ if (code < 0)
+ return code;
- if (o->type != PDF_INT) {
- /* element is not an integer, not a valid xref */
- pdfi_pop(ctx, 1);
- return_error(gs_error_typecheck);
+ if (code != TOKEN_TRAILER) {
+ /* element is not an integer, and not a keyword - not a valid xref */
+ return_error(gs_error_typecheck);
+ }
+ return 1;
}
- if (((pdf_num *)o)->value.i < 0) {
- pdfi_pop(ctx, 1);
+ if (start < 0)
return_error(gs_error_rangecheck);
- }
- *section_start = start = ((pdf_num *)o)->value.i;
+ *section_start = start;
- code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
- if (code < 0) {
- pdfi_pop(ctx, 1);
+ code = pdfi_read_bare_int(ctx, ctx->main_stream, &size);
+ if (code < 0)
return code;
- }
- if (code == 0) {
- pdfi_pop(ctx, 1);
+ if (code == 0)
return_error(gs_error_syntaxerror);
- }
-
- o = ctx->stack_top[-1];
- if (o->type != PDF_INT) {
- /* element is not an integer, not a valid xref */
- pdfi_pop(ctx, 2);
- return_error(gs_error_typecheck);
- }
/* Zero sized xref sections are valid; see the file attached to
* bug 704947 for an example. */
- if (((pdf_num *)o)->value.i < 0) {
- pdfi_pop(ctx, 2);
+ if (size < 0)
return_error(gs_error_rangecheck);
- }
- *section_size = size = ((pdf_num *)o)->value.i;
- pdfi_pop(ctx, 2);
+ *section_size = size;
if (ctx->args.pdfdebug)
dmprintf2(ctx->memory, "\n%% Section starts at %d and has %d entries\n", (unsigned int) start, (unsigned int)size);
@@ -784,9 +729,12 @@ static int read_xref_section(pdf_context *ctx, pdf_c_stream *s, uint64_t *sectio
if (bytes < 20)
return_error(gs_error_ioerror);
j = 19;
+ if ((Buffer[19] != 0x0a && Buffer[19] != 0x0d) || (Buffer[18] != 0x0d && Buffer[18] != 0x0a && Buffer[18] != 0x20))
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_XREF_ENTRY_SIZE, "read_xref_section", NULL);
while (Buffer[j] != 0x0D && Buffer[j] != 0x0A) {
pdfi_unread_byte(ctx, s, (byte)Buffer[j]);
if (--j < 0) {
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_XREF_ENTRY_NO_EOL, "read_xref_section", NULL);
dmprintf(ctx->memory, "Invalid xref entry, line terminator missing.\n");
code = read_xref_entry_slow(ctx, s, &off, &gen, &free);
if (code < 0)
@@ -803,6 +751,7 @@ static int read_xref_section(pdf_context *ctx, pdf_c_stream *s, uint64_t *sectio
continue;
if (sscanf(Buffer, "%"PRIdOFFSET" %d %c", &entry->u.uncompressed.offset, &entry->u.uncompressed.generation_num, &free) != 3) {
+ pdfi_set_warning(ctx, 0, NULL, W_PDF_BAD_XREF_ENTRY_FORMAT, "read_xref_section", NULL);
dmprintf(ctx->memory, "Invalid xref entry, incorrect format.\n");
pdfi_unread(ctx, s, (byte *)Buffer, 20);
code = read_xref_entry_slow(ctx, s, &off, &gen, &free);
@@ -827,16 +776,17 @@ static int read_xref_section(pdf_context *ctx, pdf_c_stream *s, uint64_t *sectio
static int read_xref(pdf_context *ctx, pdf_c_stream *s)
{
int code = 0;
- pdf_obj **o = NULL;
- pdf_keyword *k;
pdf_dict *d = NULL;
uint64_t size = 0, max_obj = 0;
int64_t num;
+ int obj_num;
+
+ if (ctx->repaired)
+ return 0;
do {
uint64_t section_start, section_size;
- o = ctx->stack_top;
code = read_xref_section(ctx, s, &section_start, &section_size);
if (code < 0)
return code;
@@ -844,23 +794,15 @@ static int read_xref(pdf_context *ctx, pdf_c_stream *s)
if (section_size > 0 && section_start + section_size - 1 > max_obj)
max_obj = section_start + section_size - 1;
- if (ctx->stack_top - o > 0) {
- k = (pdf_keyword *)ctx->stack_top[-1];
- if(k->type != PDF_KEYWORD || k->key != TOKEN_TRAILER)
- return_error(gs_error_syntaxerror);
- else {
- pdfi_pop(ctx, 1);
- break;
- }
- }
- } while (1);
+ /* code == 1 => read_xref_section ended with a trailer. */
+ } while (code != 1);
code = pdfi_read_dict(ctx, ctx->main_stream, 0, 0);
if (code < 0)
return code;
d = (pdf_dict *)ctx->stack_top[-1];
- if (d->type != PDF_DICT) {
+ if (pdfi_type_of(d) != PDF_DICT) {
pdfi_pop(ctx, 1);
return_error(gs_error_typecheck);
}
@@ -950,21 +892,25 @@ static int read_xref(pdf_context *ctx, pdf_c_stream *s)
}
}
- pdfi_loop_detector_mark(ctx);
+ code = pdfi_loop_detector_mark(ctx);
+ if (code < 0) {
+ pdfi_pop(ctx, 1);
+ return code;
+ }
/* Because of the way the code works when we read a file which is a pure
* xref stream file, we need to read the first integer of 'x y obj'
* because the xref stream decoding code expects that to be on the stack.
*/
pdfi_seek(ctx, s, num, SEEK_SET);
- code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
+ code = pdfi_read_bare_int(ctx, ctx->main_stream, &obj_num);
if (code < 0) {
pdfi_loop_detector_cleartomark(ctx);
pdfi_pop(ctx, 1);
return code;
}
- code = pdfi_read_xref_stream_dict(ctx, ctx->main_stream);
+ code = pdfi_read_xref_stream_dict(ctx, ctx->main_stream, obj_num);
if (code < 0) {
pdfi_loop_detector_cleartomark(ctx);
pdfi_pop(ctx, 1);
@@ -1017,13 +963,16 @@ static int read_xref(pdf_context *ctx, pdf_c_stream *s)
if (code < 0)
return code;
- code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
- if (code < 0)
- return(code);
- if (code == 0)
+ if (!ctx->repaired) {
+ code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
+ if (code < 0)
+ return(code);
+ if (code == 0)
return_error(gs_error_syntaxerror);
+ } else
+ return 0;
- if (((pdf_obj *)ctx->stack_top[-1])->type == PDF_KEYWORD && ((pdf_keyword *)ctx->stack_top[-1])->key == TOKEN_XREF) {
+ if ((intptr_t)(ctx->stack_top[-1]) == (intptr_t)TOKEN_XREF) {
/* Read old-style xref table */
pdfi_pop(ctx, 1);
return(read_xref(ctx, ctx->main_stream));
@@ -1036,61 +985,51 @@ static int read_xref(pdf_context *ctx, pdf_c_stream *s)
int pdfi_read_xref(pdf_context *ctx)
{
int code = 0;
- bool do_repair = false;
+ int obj_num;
code = pdfi_loop_detector_mark(ctx);
if (code < 0)
return code;
- if (ctx->startxref != 0) {
- code = pdfi_loop_detector_add_object(ctx, ctx->startxref);
- if (code < 0)
- goto exit;
+ if (ctx->startxref == 0)
+ goto repair;
- if (ctx->args.pdfdebug)
- dmprintf(ctx->memory, "%% Trying to read 'xref' token for xref table, or 'int int obj' for an xref stream\n");
+ code = pdfi_loop_detector_add_object(ctx, ctx->startxref);
+ if (code < 0)
+ goto exit;
- if (ctx->startxref > ctx->main_stream_length - 5) {
- pdfi_set_error(ctx, 0, NULL, E_PDF_BADSTARTXREF, "pdfi_read_xref", (char *)"startxref offset is beyond end of file");
- do_repair = true;
- goto exit;
- }
+ if (ctx->args.pdfdebug)
+ dmprintf(ctx->memory, "%% Trying to read 'xref' token for xref table, or 'int int obj' for an xref stream\n");
+ if (ctx->startxref > ctx->main_stream_length - 5) {
+ pdfi_set_error(ctx, 0, NULL, E_PDF_BADSTARTXREF, "pdfi_read_xref", (char *)"startxref offset is beyond end of file");
+ goto repair;
+ }
+ if (ctx->startxref < 0) {
+ pdfi_set_error(ctx, 0, NULL, E_PDF_BADSTARTXREF, "pdfi_read_xref", (char *)"startxref offset is before start of file");
+ goto repair;
+ }
- /* Read the xref(s) */
- pdfi_seek(ctx, ctx->main_stream, ctx->startxref, SEEK_SET);
+ /* Read the xref(s) */
+ pdfi_seek(ctx, ctx->main_stream, ctx->startxref, SEEK_SET);
- code = pdfi_read_token(ctx, ctx->main_stream, 0, 0);
- if (code < 0) {
+ /* If it starts with an int, it's an xref stream dict */
+ code = pdfi_read_bare_int(ctx, ctx->main_stream, &obj_num);
+ if (code == 1) {
+ code = pdfi_read_xref_stream_dict(ctx, ctx->main_stream, obj_num);
+ if (code < 0)
+ goto repair;
+ } else {
+ /* If not, it had better start 'xref', and be an old-style xref table */
+ code = pdfi_read_bare_keyword(ctx, ctx->main_stream);
+ if (code != TOKEN_XREF) {
pdfi_set_error(ctx, 0, NULL, E_PDF_BADSTARTXREF, "pdfi_read_xref", (char *)"Failed to read any token at the startxref location");
- do_repair = true;
- goto exit;
- }
-
- if (pdfi_count_stack(ctx) < 1) {
- code = gs_note_error(gs_error_undefined);
- goto exit;
+ goto repair;
}
- if (((pdf_obj *)ctx->stack_top[-1])->type == PDF_KEYWORD && ((pdf_keyword *)ctx->stack_top[-1])->key == TOKEN_XREF) {
- /* Read old-style xref table */
- pdfi_pop(ctx, 1);
- code = read_xref(ctx, ctx->main_stream);
- if (code < 0) {
- do_repair = true;
- goto exit;
- }
- } else {
- code = pdfi_read_xref_stream_dict(ctx, ctx->main_stream);
- if (code < 0){
- do_repair = true;
- goto exit;
- }
- }
- } else {
- /* Attempt to repair PDF file */
- do_repair = true;
- goto exit;
+ code = read_xref(ctx, ctx->main_stream);
+ if (code < 0)
+ goto repair;
}
if(ctx->args.pdfdebug && ctx->xref_table) {
@@ -1159,11 +1098,15 @@ int pdfi_read_xref(pdf_context *ctx)
exit:
(void)pdfi_loop_detector_cleartomark(ctx);
- if (do_repair)
- return(pdfi_repair_file(ctx));
if (code < 0)
return code;
return 0;
+
+repair:
+ (void)pdfi_loop_detector_cleartomark(ctx);
+ if (!ctx->repaired)
+ return(pdfi_repair_file(ctx));
+ return 0;
}
diff --git a/pdf/pdftop.c b/pdf/pdftop.c
index 5e147cdd..9f5cfdf4 100644
--- a/pdf/pdftop.c
+++ b/pdf/pdftop.c
@@ -60,9 +60,9 @@ extern const char gp_file_name_list_separator;
static int
pdf_detect_language(const char *s, int len)
{
- if (len < 5)
- return 1;
- return memcmp(s, "%!PDF", 5);
+ if (len >= 5 && memcmp(s, "%!PDF", 5) == 0)
+ return 100;
+ return 0;
}
static const pl_interp_characteristics_t *
@@ -393,7 +393,7 @@ static int plist_value_get_int64(gs_param_typed_value *pvalue, int64_t *pint)
/* Get the value for a string or a name (null terminated) */
static int plist_value_get_string_or_name(pdf_context *ctx, gs_param_typed_value *pvalue,
- char **pstr, int *plen)
+ char **pstr, int *plen, bool *is_name)
{
const byte *data;
uint size;
@@ -401,9 +401,11 @@ static int plist_value_get_string_or_name(pdf_context *ctx, gs_param_typed_value
if (pvalue->type == gs_param_type_string) {
data = pvalue->value.s.data;
size = pvalue->value.s.size;
+ *is_name = false;
} else if (pvalue->type == gs_param_type_name) {
data = pvalue->value.n.data;
size = pvalue->value.n.size;
+ *is_name = true;
} else {
return_error(gs_error_typecheck);
}
@@ -481,6 +483,7 @@ pdf_impl_set_param(pl_interp_implementation_t *impl,
gs_param_key_t key;
int code;
int len;
+ bool discard_isname;
param_init_enumerator(&enumerator);
if ((code = param_get_next_key(plist, &enumerator, &key)) == 0) {
@@ -645,7 +648,7 @@ pdf_impl_set_param(pl_interp_implementation_t *impl,
return code;
}
if (!strncmp(param, "PDFPassword", 11)) {
- code = plist_value_get_string_or_name(ctx, &pvalue, &ctx->encryption.Password , &ctx->encryption.PasswordLen);
+ code = plist_value_get_string_or_name(ctx, &pvalue, &ctx->encryption.Password , &ctx->encryption.PasswordLen, &discard_isname);
if (code < 0)
return code;
}
@@ -671,14 +674,14 @@ pdf_impl_set_param(pl_interp_implementation_t *impl,
return code;
}
if (!strncmp(param, "UseOutputIntent", strlen("UseOutputIntent"))) {
- code = plist_value_get_string_or_name(ctx, &pvalue, &ctx->args.UseOutputIntent, &len);
+ code = plist_value_get_string_or_name(ctx, &pvalue, &ctx->args.UseOutputIntent, &len, &discard_isname);
if (code < 0)
return code;
}
if (!strncmp(param, "FONTPATH", 11)) {
char *s = NULL;
int slen;
- code = plist_value_get_string_or_name(ctx, &pvalue, &s , &slen);
+ code = plist_value_get_string_or_name(ctx, &pvalue, &s , &slen, &discard_isname);
if (code < 0)
return code;
code = pdfi_add_paths_to_search_paths(ctx, (const char *)s, slen, true);
@@ -687,19 +690,24 @@ pdf_impl_set_param(pl_interp_implementation_t *impl,
if (!strncmp(param, "FONTMAP", 7)) {
char *s = NULL;
int slen;
- code = plist_value_get_string_or_name(ctx, &pvalue, &s, &slen);
+ code = plist_value_get_string_or_name(ctx, &pvalue, &s, &slen, &discard_isname);
if (code < 0)
return code;
code = pdfi_add_fontmapfiles(ctx, (const char *)s, slen);
gs_free_object(ctx->memory, s, "FONTMAP param string");
}
if (!strncmp(param, "CIDSubstPath", 12)) {
- code = plist_value_get_string_or_name(ctx, &pvalue, (char **)&ctx->args.cidsubstpath.data, (int *)&ctx->args.cidsubstpath.size);
+ code = plist_value_get_string_or_name(ctx, &pvalue, (char **)&ctx->args.cidfsubstpath.data, (int *)&ctx->args.cidfsubstpath.size, &discard_isname);
if (code < 0)
return code;
}
if (!strncmp(param, "CIDSubstFont", 12)) {
- code = plist_value_get_string_or_name(ctx, &pvalue, (char **)&ctx->args.cidsubstfont.data, (int *)&ctx->args.cidsubstfont.size);
+ code = plist_value_get_string_or_name(ctx, &pvalue, (char **)&ctx->args.cidfsubstfont.data, (int *)&ctx->args.cidfsubstfont.size, &discard_isname);
+ if (code < 0)
+ return code;
+ }
+ if (!strncmp(param, "SUBSTFONT", 12)) {
+ code = plist_value_get_string_or_name(ctx, &pvalue, (char **)&ctx->args.defaultfont.data, (int *)&ctx->args.defaultfont.size, &ctx->args.defaultfont_is_name);
if (code < 0)
return code;
}
diff --git a/psi/dwmain.rc b/psi/dwmain.rc
index 3e81c9d2..a96d0eac 100644
--- a/psi/dwmain.rc
+++ b/psi/dwmain.rc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -35,8 +35,8 @@ GSIMAGE_ICON ICON gsgraph_ico
#endif
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,0,GS_VERSION_MAJOR,GS_VERSION_MINOR
- PRODUCTVERSION 0,0,GS_VERSION_MAJOR,GS_VERSION_MINOR
+ FILEVERSION GS_VERSION_MAJOR,GS_VERSION_MINOR,GS_VERSION_PATCH,0
+ PRODUCTVERSION GS_VERSION_MAJOR,GS_VERSION_MINOR,GS_VERSION_PATCH,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
diff --git a/psi/gsdll32.rc b/psi/gsdll32.rc
index a03540ac..6bbf6d03 100644
--- a/psi/gsdll32.rc
+++ b/psi/gsdll32.rc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -51,8 +51,8 @@ BEGIN
END
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,0,GS_VERSION_MAJOR,GS_VERSION_MINOR
- PRODUCTVERSION 0,0,GS_VERSION_MAJOR,GS_VERSION_MINOR
+ FILEVERSION GS_VERSION_MAJOR,GS_VERSION_MINOR,GS_VERSION_PATCH,0
+ PRODUCTVERSION GS_VERSION_MAJOR,GS_VERSION_MINOR,GS_VERSION_PATCH,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
diff --git a/psi/idstack.c b/psi/idstack.c
index 701cd8d0..6342c6ad 100644
--- a/psi/idstack.c
+++ b/psi/idstack.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -24,6 +24,8 @@
#include "ipacked.h"
#include "iutil.h"
#include "ivmspace.h"
+#include "idebug.h" /* for debug_print_name */
+
/*
#include "idicttpl.h" - Do not remove this comment.
"idicttpl.h" is included below.
@@ -33,7 +35,6 @@
/* #define COLLECT_STATS_IDSTACK */
#ifdef COLLECT_STATS_IDSTACK
-#include "idebug.h"
#define MAX_STATS_DEPTH 6
struct stats_dstack_s {
long lookups; /* total lookups */
diff --git a/psi/ierrors.h b/psi/ierrors.h
index 50f32128..15abaa0f 100644
--- a/psi/ierrors.h
+++ b/psi/ierrors.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -57,8 +57,11 @@ extern const char *const gs_error_names[];
#define DPS_ERROR_NAMES\
"invalidcontext", "invalidid"
+#define PDF_ERROR_NAMES\
+ "pdf_stackoverflow", "pdf_circular_reference"
+
#define ERROR_NAMES\
- LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES, DPS_ERROR_NAMES
+ LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES, DPS_ERROR_NAMES, PDF_ERROR_NAMES
/*
* Define which error codes require re-executing the current object.
diff --git a/psi/iinit.c b/psi/iinit.c
index e3471292..2d8bfe99 100644
--- a/psi/iinit.c
+++ b/psi/iinit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -363,7 +363,7 @@ obj_init(i_ctx_t **pi_ctx_p, gs_dual_memory_t *idmem)
/* Create the error name table */
{
- int n = countof(gs_error_names) - 1;
+ int n = countof(gs_error_names);
int i;
ref era;
diff --git a/psi/mkfilelt.cpp b/psi/mkfilelt.cpp
deleted file mode 100644
index 8647fbb3..00000000
--- a/psi/mkfilelt.cpp
+++ /dev/null
@@ -1,368 +0,0 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
- All Rights Reserved.
-
- This software is provided AS-IS with no warranty, either express or
- implied.
-
- This software is distributed under license and may not be copied,
- modified or distributed except as expressly authorized under the terms
- of the license contained in the file LICENSE in this distribution.
-
- Refer to licensing information at http://www.artifex.com or contact
- Artifex Software, Inc., 1305 Grant Avenue - Suite 200, Novato,
- CA 94945, U.S.A., +1(415)492-9861, for further information.
-*/
-
-//
-//
-// This is the setup program for Win32 GPL Ghostscript
-//
-// The starting point is a self extracting zip archive
-// with the following contents:
-// setupgs.exe
-// uninstgs.exe
-// filelist.txt (contains list of program files)
-// gs#.##\* (files listed in filelist.txt)
-// This is the same as the zip file created by Aladdin Enterprises,
-// with the addition of setupgs.exe, uninstgs.exe, and filelist.txt
-//
-// The first line of the file filelist.txt
-// contains the uninstall name to be used.
-// The second line contains name of the main directory where
-// uninstall log files are to be placed.
-// Subsequent lines contain files to be copied (but not directories).
-// For example, filelist.txt might contain:
-// GPL Ghostscript 8.55
-// gs8.55
-// gs8.55\bin\gsdll32.dll
-// gs8.55\lib\gs_init.ps
-//
-// The default install directory is c:\gs.
-// The default Start Menu Folder is Ghostscript.
-// These are set in the resources.
-// The setup program will create the following uninstall log files
-// c:\gs\gs#.##\uninstal.txt
-// The uninstall program (accessed through control panel) will not
-// remove directories nor will it remove itself.
-//
-// If the install directory is the same as the current file
-// location, no files will be copied, but the existence of each file
-// will be checked. This allows the archive to be unzipped, then
-// configured in its current location. Running the uninstall will not
-// remove uninstgs.exe, setupgs.exe, or filelist.txt.
-
-
-#define STRICT
-#include <windows.h>
-#include <shellapi.h>
-#include <objbase.h>
-#include <shlobj.h>
-#include <stdio.h>
-#include <direct.h>
-#include <ctype.h>
-
-#pragma comment(lib,"user32.lib")
-
-#ifdef MAX_PATH
-#define MAXSTR MAX_PATH
-#else
-#define MAXSTR 256
-#endif
-
-CHAR g_szAppName[MAXSTR];
-
-// Prototypes
-BOOL init();
-BOOL make_filelist(int argc, char *argv[]);
-
-
-//////////////////////////////////////////////////////////////////////
-// Entry point
-//////////////////////////////////////////////////////////////////////
-
-int APIENTRY WinMain(HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
-{
- strcpy(g_szAppName, "make_filelist");
- if (!init()) {
- MessageBox(HWND_DESKTOP, "Initialisation failed",
- g_szAppName, MB_OK);
- return 1;
- }
-
- return 0;
-}
-
-
-
-
-//////////////////////////////////////////////////////////////////////
-// Initialisation and Main dialog box
-//////////////////////////////////////////////////////////////////////
-
-void
-message_box(const char *str)
-{
- MessageBox(HWND_DESKTOP, str, g_szAppName, MB_OK);
-}
-
-
-BOOL
-init()
-{
- DWORD dwVersion = GetVersion();
- // get source directory
-
-
- if (LOBYTE(LOWORD(dwVersion)) < 4) {
- MessageBox(HWND_DESKTOP,
- "This install program needs Windows 4.0 or later",
- g_szAppName, MB_OK);
- return FALSE;
- }
-
-
-#define MAXCMDTOKENS 128
-
- int argc;
- LPSTR argv[MAXCMDTOKENS];
- LPSTR p;
- char *args;
- char *d, *e;
-
- p = GetCommandLine();
-
- argc = 0;
- args = (char *)malloc(lstrlen(p)+1);
- if (args == (char *)NULL)
- return 1;
-
- // Parse command line handling quotes.
- d = args;
- while (*p) {
- // for each argument
-
- if (argc >= MAXCMDTOKENS - 1)
- break;
-
- e = d;
- while ((*p) && (*p != ' ')) {
- if (*p == '\042') {
- // Remove quotes, skipping over embedded spaces.
- // Doesn't handle embedded quotes.
- p++;
- while ((*p) && (*p != '\042'))
- *d++ =*p++;
- }
- else
- *d++ = *p;
- if (*p)
- p++;
- }
- *d++ = '\0';
- argv[argc++] = e;
-
- while ((*p) && (*p == ' '))
- p++; // Skip over trailing spaces
- }
- argv[argc] = NULL;
-
- if (argc > 2) {
- // Probably creating filelist.txt
- return make_filelist(argc, argv);
- }
- return 0;
-}
-
-
-//////////////////////////////////////////////////////////////////////
-// Create file list
-//////////////////////////////////////////////////////////////////////
-
-FILE *fList;
-
-typedef int (*PFN_dodir)(const char *name);
-
-/* Called once for each directory */
-int
-dodir(const char *filename)
-{
- return 0;
-}
-
-/* Called once for each file */
-int
-dofile(const char *filename)
-{
- if (fList != (FILE *)NULL) {
- fputs(filename, fList);
- fputs("\n", fList);
- }
-
- return 0;
-}
-
-
-/* Walk through directory 'path', calling dodir() for given directory
- * and dofile() for each file.
- * If recurse=1, recurse into subdirectories, calling dodir() for
- * each directory.
- */
-int
-dirwalk(char *path, int recurse, PFN_dodir dodir, PFN_dodir dofile)
-{
- WIN32_FIND_DATA find_data;
- HANDLE find_handle;
- char pattern[MAXSTR]; /* orig pattern + modified pattern */
- char base[MAXSTR];
- char name[MAXSTR];
- BOOL bMore = TRUE;
- char *p;
-
-
- if (path) {
- strcpy(pattern, path);
- if (strlen(pattern) != 0) {
- p = pattern + strlen(pattern) -1;
- if (*p == '\\')
- *p = '\0'; // truncate trailing backslash
- }
-
- strcpy(base, pattern);
- if (strchr(base, '*') != NULL) {
- // wildcard already included
- // truncate it from the base path
- if ( (p = strrchr(base, '\\')) != NULL )
- *(++p) = '\0';
- }
- else if (isalpha(pattern[0]) &&
- pattern[1]==':' && pattern[2]=='\0') {
- strcat(pattern, "\\*"); // search entire disk
- strcat(base, "\\");
- }
- else {
- // wildcard NOT included
- // check to see if path is a directory
- find_handle = FindFirstFile(pattern, &find_data);
- if (find_handle != INVALID_HANDLE_VALUE) {
- FindClose(find_handle);
- if (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- strcat(pattern, "\\*"); // yes, search files
- strcat(base, "\\");
- }
- else {
- dofile(path); // no, return just this file
- return 0;
- }
- }
- else
- return 1; // path invalid
- }
- }
- else {
- base[0] = '\0';
- strcpy(pattern, "*");
- }
-
- find_handle = FindFirstFile(pattern, &find_data);
- if (find_handle == INVALID_HANDLE_VALUE)
- return 1;
-
- while (bMore) {
- strcpy(name, base);
- strcat(name, find_data.cFileName);
- if (find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- if ( strcmp(find_data.cFileName, ".") &&
- strcmp(find_data.cFileName, "..") ) {
- dodir(name);
- if (recurse)
- dirwalk(name, recurse, dodir, dofile);
- }
- }
- else {
- dofile(name);
- }
- bMore = FindNextFile(find_handle, &find_data);
- }
- FindClose(find_handle);
-
- return 0;
-}
-
-
-
-// This is used when creating a file list.
-
-BOOL make_filelist(int argc, char *argv[])
-{
- char *title = NULL;
- char *dir = NULL;
- char *list = NULL;
- int i;
-
- for (i=1; i<argc; i++) {
- if (strcmp(argv[i], "-title") == 0) {
- i++;
- title = argv[i];
- }
- else if (strcmp(argv[i], "-dir") == 0) {
- i++;
- dir = argv[i];
- }
- else if (strcmp(argv[i], "-list") == 0) {
- i++;
- list = argv[i];
- }
- else {
- if ((title == NULL) || (strlen(title) == 0) ||
- (dir == NULL) || (strlen(dir) == 0) ||
- (list == NULL) || (strlen(list) == 0)) {
- message_box("Usage: make_filelist -title \042GPL Ghostscript #.##\042 -dir \042gs#.##\042 -list \042filelist.txt\042 spec1 spec2 specn\n");
- return FALSE;
- }
- if (fList == (FILE *)NULL) {
- if ( (fList = fopen(list, "w")) == (FILE *)NULL ) {
- message_box("Can't write list file\n");
- return FALSE;
- }
- fputs(title, fList);
- fputs("\n", fList);
- fputs(dir, fList);
- fputs("\n", fList);
- }
- if (argv[i][0] == '@') {
- // Use @filename with list of files/directories
- // to avoid DOS command line limit
- FILE *f;
- char buf[MAXSTR];
- int j;
- if ( (f = fopen(&(argv[i][1]), "r")) != (FILE *)NULL) {
- while (fgets(buf, sizeof(buf), f)) {
- // remove trailing newline and spaces
- while ( ((j = strlen(buf)-1) >= 0) &&
- ((buf[j] == '\n') || (buf[j] == ' ')) )
- buf[j] = '\0';
- dirwalk(buf, TRUE, &dodir, &dofile);
- }
- fclose(f);
- }
- else {
- wsprintf(buf, "Can't open @ file \042%s\042",
- &argv[i][1]);
- message_box(buf);
- }
- }
- else
- dirwalk(argv[i], TRUE, &dodir, &dofile);
- }
- }
-
- if (fList != (FILE *)NULL) {
- fclose(fList);
- fList = NULL;
- }
- return TRUE;
-}
-
diff --git a/psi/msvc.mak b/psi/msvc.mak
index cb74a2b6..c8fd659e 100644
--- a/psi/msvc.mak
+++ b/psi/msvc.mak
@@ -278,6 +278,15 @@ IMGGENDIR=$(GLGENDIR)
IMGOBJDIR=$(GLOBJDIR)
!endif
+# CAL detects the presence of SSE/AVX2 at runtime. We assume
+# modern windows compilers can build for both, and they will
+# just be disabled automatically if not present. If the compiler
+# can't cope with this, then define CAL_CFLAGS to be empty
+# in the makefile invocation.
+!ifndef CAL_CFLAGS
+CAL_CFLAGS=/DHAVE_SSE4_2 /DHAVE_AVX2
+!endif
+
CONTRIBDIR=.\contrib
# Can we build PCL and XPS and PDF
@@ -730,7 +739,7 @@ TIFFSRCDIR=tiff$(D)
TIFFCONFDIR=$(TIFFSRCDIR)
TIFFCONFIG_SUFFIX=.vc
TIFFPLATFORM=win32
-TIFF_CFLAGS=-DJPEG_SUPPORT -DOJPEG_SUPPORT -DJPEG_LIB_MK1_OR_12BIT=0
+TIFF_CFLAGS=-DJPEG_SUPPORT -DOJPEG_SUPPORT -DJPEG_LIB_MK1_OR_12BIT=0 -DTIFF_DISABLE_DEPRECATED
ENABLE_TIFF=$(D_)TIFF_INCLUDED$(_D)
!endif
@@ -1155,6 +1164,21 @@ MS_TOOLSET_VERSION=14.29.30133
MSVC_VERSION=16
MS_TOOLSET_VERSION=14.29.30133
!endif
+!if "$(_NMAKE_VER)" == "14.29.30142.1"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.29.30133
+!endif
+!if "$(_NMAKE_VER)" == "14.29.30145.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.29.30133
+!endif
+!if "$(_NMAKE_VER)" == "14.29.30146.0"
+# VS2019 (Toolset v142)
+MSVC_VERSION=16
+MS_TOOLSET_VERSION=14.29.30133
+!endif
!endif
!ifndef MSVC_VERSION
diff --git a/psi/nsisinst.nsi b/psi/nsisinst.nsi
index 404747b5..3c141da3 100644
--- a/psi/nsisinst.nsi
+++ b/psi/nsisinst.nsi
@@ -1,4 +1,4 @@
-; Copyright (C) 2001-2021 Artifex Software, Inc.
+; Copyright (C) 2001-2022 Artifex Software, Inc.
; All Rights Reserved.
;
; This software is provided AS-IS with no warranty, either express or
@@ -43,6 +43,8 @@ SetCompressor /SOLID /FINAL lzma
XPStyle on
CRCCheck on
+Var RebootRequired
+
; the following is from: http://nsis.sourceforge.net/StrRep
!define StrRep "!insertmacro StrRep"
!macro StrRep output string old new
@@ -141,7 +143,7 @@ FunctionEnd
!define MUI_FINISHPAGE_RUN_TEXT "Generate cidfmap for Windows CJK TrueType fonts"
!define MUI_FINISHPAGE_RUN_FUNCTION CJKGen
; !define MUI_FINISHPAGE_RUN_NOTCHECKED
-!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\Readme.htm"
+; !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\Readme.htm"
; MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_LINK "Visit the Ghostscript web site"
!define MUI_FINISHPAGE_LINK_LOCATION http://www.ghostscript.com/
@@ -159,7 +161,6 @@ Page custom OldVersionsPageCreate
Function OldVersionsPageCreate
!insertmacro MUI_HEADER_TEXT "Previous Ghostscript Installations" "Optionally run the uninstallers for previous Ghostscript installations$\nClick $\"Cancel$\" to stop uninstalling previous installs"
-
StrCpy $0 0
loop:
EnumRegKey $1 HKLM "Software\Artifex\GPL Ghostscript" $0
@@ -174,6 +175,13 @@ Function OldVersionsPageCreate
FunctionEnd
+Function RedistInstCreate
+ ExecWait '"$INSTDIR\${VCREDIST}" /norestart /install /quiet' $0
+ ${If} $0 == 3010
+ StrCpy $RebootRequired "yes"
+ ${EndIf}
+FunctionEnd
+
!searchparse /ignorecase /noerrors "${TARGET}" w WINTYPE
!echo "Building ${WINTYPE}-bit installer"
@@ -230,6 +238,8 @@ File /oname=bin\gsdll${WINTYPE}.lib .\bin\gsdll${WINTYPE}.lib
File /oname=bin\gswin${WINTYPE}.exe .\bin\gswin${WINTYPE}.exe
File /oname=bin\gswin${WINTYPE}c.exe .\bin\gswin${WINTYPE}c.exe
+File /oname=${VCREDIST} .\${VCREDIST}
+
!if "${WINTYPE}" == "64"
SetRegView 64
!endif
@@ -254,6 +264,9 @@ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghos
; write out uninstaller
WriteUninstaller "$INSTDIR\uninstgs.exe"
+
+Call RedistInstCreate
+
SectionEnd ; end of default section
Function .onInstSuccess
@@ -261,10 +274,19 @@ Function .onInstSuccess
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\Ghostscript"
CreateShortCut "$SMPROGRAMS\Ghostscript\Ghostscript ${VERSION}.LNK" "$INSTDIR\bin\gswin${WINTYPE}.exe" '"-I$INSTDIR\lib;$INSTDIR\..\fonts"'
- CreateShortCut "$SMPROGRAMS\Ghostscript\Ghostscript Readme ${VERSION}.LNK" "$INSTDIR\doc\Readme.htm"
+; CreateShortCut "$SMPROGRAMS\Ghostscript\Ghostscript Readme ${VERSION}.LNK" "$INSTDIR\doc\Readme.htm"
CreateShortCut "$SMPROGRAMS\Ghostscript\Uninstall Ghostscript ${VERSION}.LNK" "$INSTDIR\uninstgs.exe"
FunctionEnd
+Function .onGUIEnd
+ StrCmp $RebootRequired "yes" doit
+ Goto done
+ doit:
+ MessageBox MB_YESNO|MB_ICONQUESTION "Do you wish to reboot the system?" IDNO +2
+ Reboot
+ done:
+FunctionEnd
+
Function CJKGen
${StrRep} $0 "$FONTS" "\" "/"
${StrRep} $1 "$INSTDIR\lib\cidfmap" "\" "/"
@@ -273,6 +295,7 @@ Function CJKGen
FunctionEnd
Function .onInit
+ StrCpy $RebootRequired "no"
!if "${WINTYPE}" == "64"
SetRegView 64
${IfNot} ${RunningX64}
@@ -301,7 +324,7 @@ Section Uninstall
; add delete commands to delete whatever files/registry keys/etc you installed here.
SetShellVarContext all
Delete "$SMPROGRAMS\Ghostscript\Ghostscript ${VERSION}.LNK"
-Delete "$SMPROGRAMS\Ghostscript\Ghostscript Readme ${VERSION}.LNK"
+; Delete "$SMPROGRAMS\Ghostscript\Ghostscript Readme ${VERSION}.LNK"
Delete "$SMPROGRAMS\Ghostscript\Uninstall Ghostscript ${VERSION}.LNK"
RMDir "$SMPROGRAMS\Ghostscript"
Delete "$INSTDIR\uninstgs.exe"
@@ -320,6 +343,7 @@ Delete "$INSTDIR\bin\gsdll${WINTYPE}.dll"
Delete "$INSTDIR\bin\gsdll${WINTYPE}.lib"
Delete "$INSTDIR\bin\gswin${WINTYPE}.exe"
Delete "$INSTDIR\bin\gswin${WINTYPE}c.exe"
+Delete "$INSTDIR\${VCREDIST}"
RMDir "$INSTDIR\bin"
RMDir "$INSTDIR"
!if "${WINTYPE}" == "64"
diff --git a/psi/winint.mak b/psi/winint.mak
index d6234089..d604d024 100644
--- a/psi/winint.mak
+++ b/psi/winint.mak
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2021 Artifex Software, Inc.
+# Copyright (C) 2001-2022 Artifex Software, Inc.
# All Rights Reserved.
#
# This software is provided AS-IS with no warranty, either express or
@@ -34,8 +34,10 @@ MAKENSIS_XE="C:\Program Files\NSIS-3.0\makensis.exe"
!ifdef WIN64
NSISTARGET=gs$(GS_VERSION)w64
+VCREDIST=vcredist_x64.exe
!else
NSISTARGET=gs$(GS_VERSION)w32
+VCREDIST=vcredist_x86.exe
!endif
# Define the C++ compiler invocation for library modules.
@@ -83,7 +85,7 @@ $(GS_OBJ).res: $(PSSRC)dwmain.rc $(dwres_h) $(ICONS) $(WININT_MAK)
$(ECHOGS_XE) -w $(PSGEN)_exe.rc -x 23 define -s gstext_ico $(GLGENDIR)\gswin.ico
$(ECHOGS_XE) -a $(PSGEN)_exe.rc -x 23 define -s gsgraph_ico $(GLGENDIR)\gswin.ico
$(ECHOGS_XE) -a $(PSGEN)_exe.rc -R $(PSSRC)dwmain.rc
- $(RCOMP) -dGS_DOT_VERSION=$(GS_DOT_VERSION) -dGS_VERSION_MAJOR=$(GS_VERSION_MAJOR) -dGS_VERSION_MINOR=$(GS_VERSION_MINOR) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(GLSRCDIR) $(i_INCDIR) -r $(RO_)$(GS_OBJ).res $(PSGEN)_exe.rc
+ $(RCOMP) -dGS_DOT_VERSION=$(GS_DOT_VERSION) -dGS_VERSION_MAJOR=$(GS_VERSION_MAJOR) -dGS_VERSION_MINOR=$(GS_VERSION_MINOR) -dGS_VERSION_PATCH=$(GS_VERSION_PATCH) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(GLSRCDIR) $(i_INCDIR) -r $(RO_)$(GS_OBJ).res $(PSGEN)_exe.rc
del $(PSGEN)_exe.rc
# resources for main program (includes dialogs)
@@ -91,7 +93,7 @@ $(GSDLL_OBJ).res: $(PSSRC)gsdll32.rc $(gp_mswin_h) $(ICONS) $(WININT_MAK)
$(ECHOGS_XE) -w $(PSGEN)_dll.rc -x 23 define -s gstext_ico $(GLGENDIR)\gswin.ico
$(ECHOGS_XE) -a $(PSGEN)_dll.rc -x 23 define -s gsgraph_ico $(GLGENDIR)\gswin.ico
$(ECHOGS_XE) -a $(PSGEN)_dll.rc -R $(PSSRC)gsdll32.rc
- $(RCOMP) -dGS_DOT_VERSION=$(GS_DOT_VERSION) -dGS_VERSION_MAJOR=$(GS_VERSION_MAJOR) -dGS_VERSION_MINOR=$(GS_VERSION_MINOR) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(GLSRCDIR) $(i_INCDIR) -r $(RO_)$(GSDLL_OBJ).res $(PSGEN)_dll.rc
+ $(RCOMP) -dGS_DOT_VERSION=$(GS_DOT_VERSION) -dGS_VERSION_MAJOR=$(GS_VERSION_MAJOR) -dGS_VERSION_MINOR=$(GS_VERSION_MINOR) -dGS_VERSION_PATCH=$(GS_VERSION_PATCH) -i$(PSSRCDIR) -i$(PSGENDIR) -i$(GLSRCDIR) $(i_INCDIR) -r $(RO_)$(GSDLL_OBJ).res $(PSGEN)_dll.rc
del $(PSGEN)_dll.rc
@@ -185,8 +187,10 @@ $(PSOBJ)zwinutf8.$(OBJ) : $(PSSRC)zwinutf8.c $(OP)\
# -------------------- NSIS Installer -------------------------------- #
nsis: $(PSSRC)nsisinst.nsi $(GSCONSOLE_XE) $(GS_ALL) $(GS_XE) $(GSDLL_DLL) $(BINDIR)\$(GSDLL).lib \
+ "$(VCINSTALLDIR)Redist\MSVC\$(MS_TOOLSET_VERSION)\$(VCREDIST)" \
$(WININT_MAK)
- $(MAKENSIS_XE) -NOCD -DTARGET=$(NSISTARGET) -DVERSION=$(GS_DOT_VERSION) -DCOMPILE_INITS=$(COMPILE_INITS) $(PSSRC)nsisinst.nsi
+ $(CP_) "$(VCINSTALLDIR)Redist\MSVC\$(MS_TOOLSET_VERSION)\$(VCREDIST)" .
+ $(MAKENSIS_XE) -NOCD -DVCREDIST=$(VCREDIST) -DTARGET=$(NSISTARGET) -DVERSION=$(GS_DOT_VERSION) -DCOMPILE_INITS=$(COMPILE_INITS) $(PSSRC)nsisinst.nsi
!if defined(KEYFILE) && defined(KEYPWORD) && defined(TIMESTAMP)
signtool sign -f $(KEYFILE) /p $(KEYPWORD) /t $(TIMESTAMP) $(NSISTARGET)$(XE)
!endif
diff --git a/psi/zbfont.c b/psi/zbfont.c
index 044f58a1..bcf38ace 100644
--- a/psi/zbfont.c
+++ b/psi/zbfont.c
@@ -136,8 +136,11 @@ zfont_glyph_name(gs_font *font, gs_glyph index, gs_const_string *pstr)
&nref, 1);
if (code < 0)
return code;
- } else
+ } else {
name_index_ref(font->memory, index, &nref);
+ if (nref.value.pname == NULL)
+ return_error(gs_error_unknownerror);
+ }
name_string_ref(font->memory, &nref, &sref);
pstr->data = sref.value.const_bytes;
pstr->size = r_size(&sref);
diff --git a/psi/zchar.c b/psi/zchar.c
index 55af9f59..d4527db0 100644
--- a/psi/zchar.c
+++ b/psi/zchar.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -1020,7 +1020,7 @@ op_show_restore(i_ctx_t *i_ctx_p, bool for_error)
If we are going to be doing the stroke
operation through zstroke then we do not want to restore yet. */
if (penum->k_text_release) {
- gsicc_restore_black_text(igs);
+ gsicc_restore_blacktextvec(igs, true);
}
gs_text_release(NULL, penum, "op_show_restore");
diff --git a/psi/zcharout.c b/psi/zcharout.c
index c204a956..96e1d355 100644
--- a/psi/zcharout.c
+++ b/psi/zcharout.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -309,9 +309,25 @@ int
zchar_charstring_data(gs_font *font, const ref *pgref, gs_glyph_data_t *pgd)
{
ref *pcstr;
+ ref *cffcstr;
+ ref *pdr = pfont_dict(font);
if (dict_find(&pfont_data(font)->CharStrings, pgref, &pcstr) <= 0)
return_error(gs_error_undefined);
+
+ if (r_has_type(pcstr, t_integer)
+ && dict_find_string(pdr, "CFFCharStrings", &cffcstr) > 0) {
+ ref *pcstr2;
+ if (dict_find(cffcstr, pcstr, &pcstr2) <= 0) {
+ ref nd;
+ make_int(&nd, 0);
+ if (dict_find(cffcstr, &nd, &pcstr2) <= 0) {
+ return_error(gs_error_undefined);
+ }
+ }
+ pcstr = pcstr2;
+ }
+
if (!r_has_type(pcstr, t_string)) {
/*
* The ADOBEPS4 Windows driver replaces the .notdef entry of
diff --git a/psi/zcie.c b/psi/zcie.c
index 93284186..ea95dcfc 100644
--- a/psi/zcie.c
+++ b/psi/zcie.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -467,8 +467,8 @@ ciedefgspace(i_ctx_t *i_ctx_p, ref *CIEDict, uint64_t dictkey)
check_read_type(*ptref, t_array);
if (r_size(ptref) != 5)
return_error(gs_error_rangecheck);
- /* Stable memory due to current caching of color space */
- code = gs_cspace_build_CIEDEFG(&pcs, NULL, mem->stable_memory);
+ /* Stable memory due to current caching of color space */
+ code = gs_cspace_build_CIEDEFG(&pcs, NULL, mem->stable_memory);
if (code < 0)
return cie_set_finish(i_ctx_p, pcs, &procs, edepth, code);
pcie = pcs->params.defg;
@@ -580,8 +580,8 @@ ciedefspace(i_ctx_t *i_ctx_p, ref *CIEDict, uint64_t dictkey)
check_read_type(*ptref, t_array);
if (r_size(ptref) != 4)
return_error(gs_error_rangecheck);
- /* Stable memory due to current caching of color space */
- code = gs_cspace_build_CIEDEF(&pcs, NULL, mem->stable_memory);
+ /* Stable memory due to current caching of color space */
+ code = gs_cspace_build_CIEDEF(&pcs, NULL, mem->stable_memory);
if (code < 0)
return cie_set_finish(i_ctx_p, pcs, &procs, edepth, code);
pcie = pcs->params.def;
diff --git a/psi/zcolor.c b/psi/zcolor.c
index c0d73c28..e1b51db4 100644
--- a/psi/zcolor.c
+++ b/psi/zcolor.c
@@ -6423,6 +6423,7 @@ static int validate_spaces(i_ctx_t *i_ctx_p, ref *arr, int *depth)
static int
setcolor_cont(i_ctx_t *i_ctx_p)
{
+ os_ptr op = osp;
ref arr, *parr = &arr;
es_ptr ep = esp;
int i=0, code = 0, usealternate, stage, stack_depth, CIESubst = 0, IsICC = 0;
@@ -6497,6 +6498,8 @@ setcolor_cont(i_ctx_t *i_ctx_p)
/* Remove our next continuation and our data */
obj->numcomponents(i_ctx_p, parr, &i);
+ /* This would be better done sooner, but we need the color space object first */
+ check_op(i);
pop(i);
esp -= 5;
return o_pop_estack;
diff --git a/psi/zdevice.c b/psi/zdevice.c
index 99beaff7..7e9779f7 100644
--- a/psi/zdevice.c
+++ b/psi/zdevice.c
@@ -45,7 +45,7 @@ ENUM_PTRS_WITH(psi_device_ref_enum_ptrs, psi_device_ref *devref)
}
case 0:
{
- if (devref->device->memory != NULL) {
+ if (devref->device != NULL && devref->device->memory != NULL) {
ENUM_RETURN(gx_device_enum_ptr(devref->device));
}
return 0;
@@ -54,7 +54,7 @@ ENUM_PTRS_END
static
RELOC_PTRS_WITH(psi_device_ref_reloc_ptrs, psi_device_ref *devref)
- if (devref->device->memory != NULL) {
+ if (devref->device != NULL && devref->device->memory != NULL) {
devref->device = gx_device_reloc_ptr(devref->device, gcst);
}
RELOC_PTRS_END
@@ -71,7 +71,7 @@ psi_device_ref_finalize(const gs_memory_t *cmem, void *vptr)
/* pdref->device->memory == NULL indicates either a device prototype
or a device allocated on the stack rather than the heap
*/
- if (pdref->device->memory != NULL)
+ if (pdref->device != NULL && pdref->device->memory != NULL)
rc_decrement(pdref->device, "psi_device_ref_finalize");
pdref->device = NULL;
@@ -456,6 +456,7 @@ zmakewordimagedevice(i_ctx_t *i_ctx_p)
return_error(gs_error_VMerror);
}
psdev->device = new_dev;
+ rc_increment(new_dev);
make_tav(op - 4, t_device, imemory_space(iimemory) | a_all, pdevice, psdev);
pop(4);
}
diff --git a/psi/zfapi.c b/psi/zfapi.c
index 6927e60e..aa7369a1 100644
--- a/psi/zfapi.c
+++ b/psi/zfapi.c
@@ -2024,7 +2024,7 @@ FAPI_FF_get_glyph(gs_fapi_font *ff, gs_glyph char_code, byte *buf, int buf_lengt
glyph_length = get_type1_data(ff, &glyph, buf, buf_length);
}
else {
- ref *CharStrings, char_name, *glyph;
+ ref *CharStrings, *CFFCharStrings, char_name, *glyph;
if (ff->char_data != NULL) {
/*
@@ -2069,6 +2069,20 @@ FAPI_FF_get_glyph(gs_fapi_font *ff, gs_glyph char_code, byte *buf, int buf_lengt
}
if (r_has_type(glyph, t_array) || r_has_type(glyph, t_mixedarray))
return gs_fapi_glyph_invalid_format;
+
+ if (r_has_type(glyph, t_integer)
+ && dict_find_string(pdr, "CFFCharStrings", &CFFCharStrings) > 0) {
+ ref *g2;
+ if (dict_find(CFFCharStrings, glyph, &g2) <= 0) {
+ ref nd;
+ make_int(&nd, 0);
+ if (dict_find(CFFCharStrings, &nd, &g2) <= 0) {
+ return gs_fapi_glyph_invalid_format;
+ }
+ }
+ glyph = g2;
+ }
+
if (!r_has_type(glyph, t_string))
return 0;
glyph_length = get_type1_data(ff, glyph, buf, buf_length);
@@ -2255,6 +2269,7 @@ static const gs_fapi_font ps_ff_stub = {
FAPI_FF_get_raw_subr,
FAPI_FF_get_glyph,
FAPI_FF_serialize_tt_font,
+ NULL, /* retrieve_tt_font */
FAPI_FF_get_charstring,
FAPI_FF_get_charstring_name,
ps_get_GlyphDirectory_data_ptr,
diff --git a/psi/zfile.c b/psi/zfile.c
index fe3f7e9f..e4a2a3e1 100644
--- a/psi/zfile.c
+++ b/psi/zfile.c
@@ -772,18 +772,25 @@ ztempfile(i_ctx_t *i_ctx_p)
if (gp_file_name_is_absolute(pstr, strlen(pstr))) {
int plen = strlen(pstr);
const char *sep = gp_file_name_separator();
-#ifdef DEBUG
int seplen = strlen(sep);
- if (seplen != 1)
+
+ /* This should not be possible if gp_file_name_is_absolute is true I think
+ * But let's avoid the problem.
+ */
+ if (plen < seplen)
return_error(gs_error_Fatal);
-#endif
+
+ plen -= seplen;
/* strip off the file name prefix, leave just the directory name
* so we can check if we are allowed to write to it
*/
for ( ; plen >=0; plen--) {
- if (pstr[plen] == sep[0])
+ if ( gs_file_name_check_separator(&pstr[plen], seplen, &pstr[plen]))
break;
}
+ if (plen < 0)
+ return_error(gs_error_Fatal);
+
memcpy(fname, pstr, plen);
fname[plen] = '\0';
if (check_file_permissions(i_ctx_p, fname, strlen(fname),
diff --git a/psi/zfont2.c b/psi/zfont2.c
index 2be4279a..bc13fc04 100644
--- a/psi/zfont2.c
+++ b/psi/zfont2.c
@@ -2632,7 +2632,7 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
/* Simple font */
unsigned int i, gid, enc_format = 0;
int sid;
- ref name, cstr, charstrings_dict, encoding, notdef;
+ ref ccoderef, name, cstr, cffcharstrings_dict, charstrings_dict, encoding, notdef;
unsigned char gid2char[256];
unsigned supp_enc_offset = 0;
@@ -2642,9 +2642,16 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
return code;
if ((code = dict_create(charstrings_index.count + 1, &charstrings_dict)) < 0)
return code;
+ if ((code = dict_create(charstrings_index.count + 1, &cffcharstrings_dict)) < 0)
+ return code;
if ((code = idict_put_c_name(i_ctx_p, topdict, STR2MEM("CharStrings"), &charstrings_dict)) < 0)
return code;
- if ((code = idict_put(&charstrings_dict, &notdef, &cstr)) < 0)
+ if ((code = idict_put_c_name(i_ctx_p, topdict, STR2MEM("CFFCharStrings"), &cffcharstrings_dict)) < 0)
+ return code;
+ make_int(&ccoderef, 0);
+ if ((code = idict_put(&charstrings_dict, &notdef, &ccoderef)) < 0)
+ return code;
+ if ((code = idict_put(&cffcharstrings_dict, &ccoderef, &cstr)) < 0)
return code;
if (offsets.encoding_off <= 1) {
if ((code = ialloc_ref_array(&encoding, a_readonly, 256, "cff_parser.encoding")) < 0)
@@ -2710,7 +2717,10 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
if ((code = name_ref(imemory, (unsigned char *)buf, len, &name, 1)) < 0)
return code;
}
- if ((code = idict_put(&charstrings_dict, &name, &cstr)) < 0)
+ make_int(&ccoderef, gid);
+ if ((code = idict_put(&charstrings_dict, &name, &ccoderef)) < 0)
+ return code;
+ if ((code = idict_put(&cffcharstrings_dict, &ccoderef, &cstr)) < 0)
return code;
if (offsets.encoding_off > 1 && gid < 256) {
encoding.value.refs[gid2char[gid]] = name;
@@ -2859,7 +2869,7 @@ zparsecff(i_ctx_t *i_ctx_p)
if ((code = peek_index(&topdict_data, &topdict_len, &topdicts, &data, i_font)) < 0)
return code;
- if ((code = dict_create(20, &topdict)) < 0)
+ if ((code = dict_create(21, &topdict)) < 0)
return code;
if ((code = idict_put(&fontset, &name, &topdict)) < 0)
diff --git a/psi/zfsample.c b/psi/zfsample.c
index 00cd0cfd..791f24b4 100644
--- a/psi/zfsample.c
+++ b/psi/zfsample.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2021 Artifex Software, Inc.
+/* Copyright (C) 2001-2022 Artifex Software, Inc.
All Rights Reserved.
This software is provided AS-IS with no warranty, either express or
@@ -501,12 +501,9 @@ sampled_data_continue(i_ctx_t *i_ctx_p)
* (unused) stack stack space to allow for this but the function
* exceeded even that. Data on the stack may have been lost.
* The only thing that we can do is move the stack pointer back and
- * hope. (We have not seen real Postscript files that have this
- * problem.)
+ * hope.
*/
push(-stack_depth_adjust);
- ifree_object(penum->pfn, "sampled_data_continue(pfn)");
- ifree_object(penum, "sampled_data_continue((enum)");
return_error(gs_error_undefinedresult);
}
}
diff --git a/psi/zpdfops.c b/psi/zpdfops.c
index 45bd7803..e5526772 100644
--- a/psi/zpdfops.c
+++ b/psi/zpdfops.c
@@ -22,10 +22,15 @@
#include "gzht.h"
#include "gsrefct.h"
#include "pdf_misc.h"
+#include "pdf_stack.h"
+#include "pdf_dict.h"
+#include "pdf_array.h"
+#include "pdf_loop_detect.h"
#include "iminst.h"
#include "dstack.h"
#include "gsicc_profilecache.h"
+#include "pagelist.h"
#endif
#include "ghost.h"
@@ -402,6 +407,7 @@ typedef struct pdfctx_s {
gs_memory_t *pdf_memory; /* The 'wrapped' memory allocator used by the PDF interpreter. Not exposed to garbager */
gs_memory_t *pdf_stream_memory; /* The memory allocator used to copy the PostScript stream to pdf_stream. Not exposed to garbager */
stream *pdf_stream;
+ bool UsingPDFFile;
gsicc_profile_cache_t *profile_cache;
gs_memory_t *cache_memory; /* The memory allocator used to allocate the working (GC'ed) profile cache */
} pdfctx_t;
@@ -508,13 +514,13 @@ static int zPDFstream(i_ctx_t *i_ctx_p)
pdfctx = r_ptr(op, pdfctx_t);
/* If the supplied context already has a file open, signal an error */
- if (pdfctx->ps_stream != NULL)
+ if (pdfctx->ps_stream != NULL || pdfctx->UsingPDFFile)
return_error(gs_error_ioerror);
s->close_at_eod = false;
pdfctx->ps_stream = s;
- pdfctx->pdf_stream = s_alloc_immovable(imemory, "PDFstream copy of PS stream");
- pdfctx->pdf_stream_memory = imemory;
+ pdfctx->pdf_stream = s_alloc_immovable(imemory->stable_memory, "PDFstream copy of PS stream");
+ pdfctx->pdf_stream_memory = imemory->stable_memory;
if (pdfctx->pdf_stream == NULL)
return_error(gs_error_VMerror);
@@ -580,6 +586,7 @@ static int zPDFfile(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
+ pdfctx->UsingPDFFile = true;
pdfctx->ctx->finish_page = NULL;
pop(2);
@@ -622,6 +629,283 @@ static int zPDFclose(i_ctx_t *i_ctx_p)
return code;
}
+static int PDFobj_to_PSobj(i_ctx_t *i_ctx_p, pdfctx_t *pdfctx, pdf_obj *PDFobj, ref *PSobj);
+
+#define DEBUG_INFO_DICT 0
+
+static void debug_printmark(int type)
+{
+#if DEBUG_INFO_DICT
+ switch(type) {
+ case 0:
+ dbgprintf("<<\n");
+ break;
+ case 1:
+ dbgprintf(">>\n");
+ break;
+ case 2:
+ dbgprintf("[");
+ break;
+ case 3:
+ dbgprintf("]\n");
+ break;
+ }
+#endif
+}
+
+static void debug_pdfobj(i_ctx_t *i_ctx_p, pdfctx_t *pdfctx, pdf_obj *PDFobj)
+{
+#if DEBUG_INFO_DICT
+ char *str = NULL;
+ int code = 0, len = 0;
+
+ switch(pdfi_type_of(PDFobj)) {
+ case PDF_NAME:
+ code = pdfi_string_from_name(pdfctx->ctx, (pdf_name *)PDFobj, &str, &len);
+ if (code < 0)
+ return;
+ dbgprintf1("/%s ", str);
+ (void)pdfi_free_string_from_name(pdfctx->ctx, str);
+ break;
+ case PDF_STRING:
+ str = (char *)gs_alloc_bytes(pdfctx->ctx->memory, ((pdf_string *)PDFobj)->length + 1, "");
+ if (str == NULL)
+ return;
+ memset(str, 0x00, ((pdf_string *)PDFobj)->length + 1);
+ memcpy(str, ((pdf_string *)PDFobj)->data, ((pdf_string *)PDFobj)->length);
+ dbgprintf1("/%s ", str);
+ gs_free_object(pdfctx->ctx->memory, str, "");
+ break;
+ case PDF_INT:
+ dbgprintf1("/%d ", ((pdf_num *)PDFobj)->value.i);
+ break;
+ case PDF_REAL:
+ dbgprintf1("/%f ", ((pdf_num *)PDFobj)->value.d);
+ break;
+ break;
+ case PDF_BOOL:
+ if (PDFobj == PDF_TRUE_OBJ)
+ dbgprintf("true ");
+ else
+ dbgprintf("false ");
+ break;
+ default:
+ break;
+ }
+#endif
+}
+
+static int PDFdict_to_PSdict(i_ctx_t *i_ctx_p, pdfctx_t *pdfctx, pdf_dict *PDFdict, ref *PSdict)
+{
+ int code = 0;
+ uint64_t index = 0;
+ pdf_name *Key = NULL;
+ pdf_obj *Value = NULL;
+ ref nameref, valueref;
+ char *str = NULL;
+ int len = 0;
+
+ code = dict_create(pdfi_dict_entries(PDFdict), PSdict);
+ if (code < 0)
+ return code;
+
+ code = pdfi_loop_detector_mark(pdfctx->ctx);
+ if (code < 0)
+ goto error;
+
+ code = pdfi_dict_first(pdfctx->ctx, PDFdict, (pdf_obj **)&Key, &Value, &index);
+ if (code == gs_error_undefined) {
+ code = 0;
+ goto error;
+ }
+
+ while (code >= 0) {
+ code = pdfi_string_from_name(pdfctx->ctx, Key, &str, &len);
+ if (code < 0)
+ goto error;
+
+ debug_pdfobj(i_ctx_p, pdfctx, (pdf_obj *)Key);
+
+ code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)str, len, &nameref, 1);
+ if (code < 0)
+ goto error;
+
+ code = PDFobj_to_PSobj(i_ctx_p, pdfctx, Value, &valueref);
+ if (code < 0)
+ goto error;
+
+ code = dict_put(PSdict, &nameref, &valueref, &i_ctx_p->dict_stack);
+ if (code < 0)
+ goto error;
+
+ pdfi_countdown(Key);
+ pdfi_countdown(Value);
+ Key = NULL;
+ Value = NULL;
+
+ code = pdfi_loop_detector_cleartomark(pdfctx->ctx);
+ if (code < 0)
+ goto error;
+
+ code = pdfi_loop_detector_mark(pdfctx->ctx);
+ if (code < 0)
+ goto error;
+
+ (void)pdfi_free_string_from_name(pdfctx->ctx, str);
+ str = NULL;
+ code = pdfi_dict_next(pdfctx->ctx, PDFdict, (pdf_obj **)&Key, &Value, &index);
+ if (code == gs_error_undefined) {
+ code = 0;
+ break;
+ }
+ }
+error:
+ (void)pdfi_free_string_from_name(pdfctx->ctx, str);
+ pdfi_countdown(Key);
+ pdfi_countdown(Value);
+
+ if (code < 0)
+ (void)pdfi_loop_detector_cleartomark(pdfctx->ctx);
+ else
+ code = pdfi_loop_detector_cleartomark(pdfctx->ctx);
+ return code;
+}
+
+static int PDFarray_to_PSarray(i_ctx_t *i_ctx_p, pdfctx_t *pdfctx, pdf_array *PDFarray, ref *PSarray)
+{
+ int code = 0, i = 0;
+ ref PS_ref;
+ pdf_obj *array_obj = NULL;
+ ref *eltp = NULL;
+
+ code = pdfi_loop_detector_mark(pdfctx->ctx);
+ if (code < 0)
+ goto error;
+
+ code = ialloc_ref_array(PSarray, a_all, pdfi_array_size(PDFarray), "zPDFInfo");
+ if (code < 0)
+ goto error;
+
+ for (i = 0;i < pdfi_array_size(PDFarray); i++) {
+ code = pdfi_array_fetch_recursing(pdfctx->ctx, PDFarray, i, &array_obj, true, true);
+ if (code < 0)
+ goto error;
+ code = PDFobj_to_PSobj(i_ctx_p, pdfctx, array_obj, &PS_ref);
+ if (code < 0) {
+ pdfi_countdown(array_obj);
+ goto error;
+ }
+
+ eltp = PSarray->value.refs + i;
+ ref_assign_old((const ref *)PSarray, eltp, &PS_ref, "zPDFInfo");
+
+ pdfi_countdown(array_obj);
+ array_obj = NULL;
+ }
+error:
+ if (code < 0)
+ (void)pdfi_loop_detector_cleartomark(pdfctx->ctx);
+ else
+ code = pdfi_loop_detector_cleartomark(pdfctx->ctx);
+ return code;
+}
+
+static int PDFobj_to_PSobj(i_ctx_t *i_ctx_p, pdfctx_t *pdfctx, pdf_obj *PDFobj, ref *PSobj)
+{
+ int code = 0;
+
+ code = pdfi_loop_detector_mark(pdfctx->ctx);
+ if (code < 0)
+ goto error;
+
+ debug_pdfobj(i_ctx_p, pdfctx, PDFobj);
+
+ switch(pdfi_type_of(PDFobj)) {
+ case PDF_NAME:
+ {
+ char *str = NULL;
+ int len;
+
+ code = pdfi_string_from_name(pdfctx->ctx, (pdf_name *)PDFobj, &str, &len);
+ if (code < 0)
+ goto error;
+ code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)str, len, PSobj, 1);
+ (void)pdfi_free_string_from_name(pdfctx->ctx, str);
+ }
+ break;
+ case PDF_STRING:
+ {
+ byte *sbody;
+ uint size = ((pdf_name *)PDFobj)->length;
+
+ sbody = ialloc_string(size, "string");
+ if (sbody == 0) {
+ code = gs_note_error(gs_error_VMerror);
+ } else {
+ make_string(PSobj, a_all | icurrent_space, size, sbody);
+ memcpy(sbody, ((pdf_name *)PDFobj)->data, size);
+ }
+ }
+ break;
+ case PDF_INT:
+ {
+ int64_t i;
+
+ code = pdfi_obj_to_int(pdfctx->ctx, PDFobj, &i);
+ if (code < 0)
+ goto error;
+ make_int(PSobj, i);
+ }
+ break;
+ case PDF_BOOL:
+ if (PDFobj == PDF_TRUE_OBJ)
+ make_bool(PSobj, 1);
+ else
+ make_bool(PSobj, 0);
+ break;
+ case PDF_REAL:
+ {
+ double d;
+
+ code = pdfi_obj_to_real(pdfctx->ctx, PDFobj, &d);
+ if (code < 0)
+ goto error;
+ make_real(PSobj, d);
+ }
+ break;
+ case PDF_DICT:
+ if (PDFobj->object_num != 0) {
+ code = pdfi_loop_detector_add_object(pdfctx->ctx, PDFobj->object_num);
+ if (code < 0)
+ goto error;
+ }
+ debug_printmark(0);
+ code = PDFdict_to_PSdict(i_ctx_p, pdfctx, (pdf_dict *)PDFobj, PSobj);
+ debug_printmark(1);
+ break;
+ case PDF_ARRAY:
+ if (PDFobj->object_num != 0) {
+ code = pdfi_loop_detector_add_object(pdfctx->ctx, PDFobj->object_num);
+ if (code < 0)
+ goto error;
+ }
+ debug_printmark(2);
+ code = PDFarray_to_PSarray(i_ctx_p, pdfctx, (pdf_array *)PDFobj, PSobj);
+ debug_printmark(3);
+ break;
+ default:
+ make_null(PSobj);
+ break;
+ }
+
+error:
+ if (code < 0)
+ (void)pdfi_loop_detector_cleartomark(pdfctx->ctx);
+ else
+ code = pdfi_loop_detector_cleartomark(pdfctx->ctx);
+ return code;
+}
+
static int zPDFinfo(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
@@ -634,7 +918,7 @@ static int zPDFinfo(i_ctx_t *i_ctx_p)
check_type(*(op), t_pdfctx);
pdfctx = r_ptr(op, pdfctx_t);
- if (pdfctx->pdf_stream != NULL) {
+ if (pdfctx->pdf_stream != NULL || pdfctx->UsingPDFFile) {
code = dict_create(4, op);
if (code < 0)
return code;
@@ -702,6 +986,36 @@ static int zPDFinfo(i_ctx_t *i_ctx_p)
}
gs_free_object(pdfctx->ctx->memory, names_array, "free collection temporary filenames");
code = 0;
+ } else {
+ if (pdfctx->ctx->Info != NULL) {
+ code = PDFobj_to_PSobj(i_ctx_p, pdfctx, (pdf_obj *)pdfctx->ctx->Info, (ref *)op);
+ if (code < 0)
+ return code;
+
+ code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"NumPages", 8, &nameref, 1);
+ if (code < 0)
+ return code;
+
+ make_int(&intref, pdfctx->ctx->num_pages);
+
+ code = dict_put(op, &nameref, &intref, &i_ctx_p->dict_stack);
+ if (code < 0)
+ return code;
+ } else {
+ code = dict_create(1, op);
+ if (code < 0)
+ return code;
+
+ code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"NumPages", 8, &nameref, 1);
+ if (code < 0)
+ return code;
+
+ make_int(&intref, pdfctx->ctx->num_pages);
+
+ code = dict_put(op, &nameref, &intref, &i_ctx_p->dict_stack);
+ if (code < 0)
+ return code;
+ }
}
}
else {
@@ -719,10 +1033,9 @@ error:
static int zPDFpageinfo(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
- ref aref, boolref, nameref, numref, *eltp;
- int page = 0, code = 0, i;
+ int page = 0, code = 0;
pdfctx_t *pdfctx;
- pdf_info_t info;
+ pdf_dict *InfoDict = NULL;
pdfi_switch_t i_switch;
check_op(2);
@@ -733,11 +1046,11 @@ static int zPDFpageinfo(i_ctx_t *i_ctx_p)
check_type(*(op - 1), t_pdfctx);
pdfctx = r_ptr(op - 1, pdfctx_t);
- if (pdfctx->pdf_stream != NULL) {
+ if (pdfctx->pdf_stream != NULL || pdfctx->UsingPDFFile) {
code = pdfi_gstate_from_PS(pdfctx->ctx, igs, &i_switch, pdfctx->profile_cache);
if (code >= 0) {
- code = pdfi_page_info(pdfctx->ctx, (uint64_t)page, &info);
+ code = pdfi_page_info(pdfctx->ctx, (uint64_t)page, &InfoDict, false);
pdfi_gstate_to_PS(pdfctx->ctx, igs, &i_switch);
}
@@ -748,141 +1061,52 @@ static int zPDFpageinfo(i_ctx_t *i_ctx_p)
pop(1);
op = osp;
- code = dict_create(4, op);
- if (code < 0)
- return code;
-
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"HasAnnots", 9, &nameref, 1);
- if (code < 0)
- return code;
- make_bool(&boolref, false);
- code = dict_put(op, &nameref, &boolref, &i_ctx_p->dict_stack);
+ code = PDFobj_to_PSobj(i_ctx_p, pdfctx, (pdf_obj *)InfoDict, op);
+ pdfi_countdown(InfoDict);
if (code < 0)
return code;
+ }
+ else {
+ return_error(gs_error_ioerror);
+ }
+ return 0;
+}
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"UsesTransparency", 16, &nameref, 1);
- if (code < 0)
- return code;
- make_bool(&boolref, info.HasTransparency);
- code = dict_put(op, &nameref, &boolref, &i_ctx_p->dict_stack);
- if (code < 0)
- return code;
+static int zPDFpageinfoExt(i_ctx_t *i_ctx_p)
+{
+ os_ptr op = osp;
+ int page = 0, code = 0;
+ pdfctx_t *pdfctx;
+ pdf_dict *InfoDict = NULL;
+ pdfi_switch_t i_switch;
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"NumSpots", 8, &nameref, 1);
- if (code < 0)
- return code;
- make_int(&numref, info.NumSpots);
- code = dict_put(op, &nameref, &numref, &i_ctx_p->dict_stack);
- if (code < 0)
- return code;
+ check_op(2);
- if (info.boxes & MEDIA_BOX) {
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"MediaBox", 8, &nameref, 1);
- if (code < 0)
- return code;
- code = ialloc_ref_array(&aref, a_all, 4, "array");
- if (code < 0)
- return code;
- refset_null(aref.value.refs, 4);
- for (i=0;i < 4;i++) {
- make_real(&numref, info.MediaBox[i]);
- eltp = aref.value.refs + i;
- ref_assign_old(&aref, eltp, &numref, "put");
- }
- code = dict_put(op, &nameref, &aref, &i_ctx_p->dict_stack);
- if (code < 0)
- return code;
- }
+ check_type(*op, t_integer);
+ page = op->value.intval;
- if (info.boxes & CROP_BOX) {
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"CropBox", 7, &nameref, 1);
- if (code < 0)
- return code;
- code = ialloc_ref_array(&aref, a_all, 4, "array");
- if (code < 0)
- return code;
- refset_null(aref.value.refs, 4);
- for (i=0;i < 4;i++) {
- make_real(&numref, info.CropBox[i]);
- eltp = aref.value.refs + i;
- ref_assign_old(&aref, eltp, &numref, "put");
- }
- code = dict_put(op, &nameref, &aref, &i_ctx_p->dict_stack);
- if (code < 0)
- return code;
- }
+ check_type(*(op - 1), t_pdfctx);
+ pdfctx = r_ptr(op - 1, pdfctx_t);
- if (info.boxes & TRIM_BOX) {
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"TrimBox", 7, &nameref, 1);
- if (code < 0)
- return code;
- code = ialloc_ref_array(&aref, a_all, 4, "array");
- if (code < 0)
- return code;
- refset_null(aref.value.refs, 4);
- for (i=0;i < 4;i++) {
- make_real(&numref, info.TrimBox[i]);
- eltp = aref.value.refs + i;
- ref_assign_old(&aref, eltp, &numref, "put");
- }
- code = dict_put(op, &nameref, &aref, &i_ctx_p->dict_stack);
- if (code < 0)
- return code;
- }
+ if (pdfctx->pdf_stream != NULL || pdfctx->UsingPDFFile) {
+ code = pdfi_gstate_from_PS(pdfctx->ctx, igs, &i_switch, pdfctx->profile_cache);
- if (info.boxes & ART_BOX) {
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"ArtBox", 6, &nameref, 1);
- if (code < 0)
- return code;
- code = ialloc_ref_array(&aref, a_all, 4, "array");
- if (code < 0)
- return code;
- refset_null(aref.value.refs, 4);
- for (i=0;i < 4;i++) {
- make_real(&numref, info.ArtBox[i]);
- eltp = aref.value.refs + i;
- ref_assign_old(&aref, eltp, &numref, "put");
- }
- code = dict_put(op, &nameref, &aref, &i_ctx_p->dict_stack);
- if (code < 0)
- return code;
- }
+ if (code >= 0) {
+ code = pdfi_page_info(pdfctx->ctx, (uint64_t)page, &InfoDict, true);
- if (info.boxes & BLEED_BOX) {
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"BleedBox", 8, &nameref, 1);
- if (code < 0)
- return code;
- code = ialloc_ref_array(&aref, a_all, 4, "array");
- if (code < 0)
- return code;
- refset_null(aref.value.refs, 4);
- for (i=0;i < 4;i++) {
- make_real(&numref, info.BleedBox[i]);
- eltp = aref.value.refs + i;
- ref_assign_old(&aref, eltp, &numref, "put");
- }
- code = dict_put(op, &nameref, &aref, &i_ctx_p->dict_stack);
- if (code < 0)
- return code;
+ pdfi_gstate_to_PS(pdfctx->ctx, igs, &i_switch);
}
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"Rotate", 6, &nameref, 1);
if (code < 0)
return code;
- make_real(&numref, info.Rotate);
- code = dict_put(op, &nameref, &numref, &i_ctx_p->dict_stack);
+
+ pop(1);
+ op = osp;
+
+ code = PDFobj_to_PSobj(i_ctx_p, pdfctx, (pdf_obj *)InfoDict, op);
+ pdfi_countdown(InfoDict);
if (code < 0)
return code;
-
- if (info.UserUnit != 1) {
- code = names_ref(imemory->gs_lib_ctx->gs_name_table, (const byte *)"UserUnit", 8, &nameref, 1);
- if (code < 0)
- return code;
- make_real(&numref, info.UserUnit);
- code = dict_put(op, &nameref, &numref, &i_ctx_p->dict_stack);
- if (code < 0)
- return code;
- }
}
else {
return_error(gs_error_ioerror);
@@ -919,7 +1143,7 @@ static int zPDFdrawpage(i_ctx_t *i_ctx_p)
check_type(*(op - 1), t_pdfctx);
pdfctx = r_ptr(op - 1, pdfctx_t);
- if (pdfctx->pdf_stream != NULL) {
+ if (pdfctx->pdf_stream != NULL || pdfctx->UsingPDFFile) {
code = gs_gsave(igs);
if (code < 0)
return code;
@@ -927,7 +1151,10 @@ static int zPDFdrawpage(i_ctx_t *i_ctx_p)
code = pdfi_gstate_from_PS(pdfctx->ctx, igs, &i_switch, pdfctx->profile_cache);
if (code >= 0) {
- code = pdfi_page_render(pdfctx->ctx, page, false);
+ if (pdfctx->ctx->args.pdfinfo)
+ code = pdfi_output_page_info(pdfctx->ctx, page);
+ else
+ code = pdfi_page_render(pdfctx->ctx, page, false);
if (code >= 0)
pop(2);
@@ -1004,6 +1231,7 @@ static int zPDFInit(i_ctx_t *i_ctx_p)
pdfctx->ctx = NULL;
pdfctx->ps_stream = NULL;
pdfctx->pdf_stream = NULL;
+ pdfctx->UsingPDFFile = false;
pdfctx->pdf_stream_memory = NULL;
pdfctx->profile_cache = gsicc_profilecache_new(imemory);
if (pdfctx->profile_cache == NULL) {
@@ -1217,19 +1445,49 @@ static int zPDFInit(i_ctx_t *i_ctx_p)
if (code < 0)
goto error;
}
- if (dict_find_string(pdictref, "CIDSubstPath", &pvalueref) > 0) {
+ if (dict_find_string(pdictref, "CIDFSubstPath", &pvalueref) > 0) {
if (!r_has_type(pvalueref, t_string))
goto error;
- pdfctx->ctx->args.cidsubstpath.data = (byte *)gs_alloc_bytes(pdfctx->ctx->memory, r_size(pvalueref) + 1, "PDF CIDSubstPath from zpdfops");
- memcpy(pdfctx->ctx->args.cidsubstpath.data, pvalueref->value.const_bytes, r_size(pvalueref));
- pdfctx->ctx->args.cidsubstpath.size = r_size(pvalueref);
+ pdfctx->ctx->args.cidfsubstpath.data = (byte *)gs_alloc_bytes(pdfctx->ctx->memory, r_size(pvalueref) + 1, "PDF cidfsubstpath from zpdfops");
+ if (pdfctx->ctx->args.cidfsubstpath.data == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error;
+ }
+ memcpy(pdfctx->ctx->args.cidfsubstpath.data, pvalueref->value.const_bytes, r_size(pvalueref));
+ pdfctx->ctx->args.cidfsubstpath.size = r_size(pvalueref);
}
- if (dict_find_string(pdictref, "CIDSubstFont", &pvalueref) > 0) {
+ if (dict_find_string(pdictref, "CIDFSubstFont", &pvalueref) > 0) {
if (!r_has_type(pvalueref, t_string))
goto error;
- pdfctx->ctx->args.cidsubstfont.data = (byte *)gs_alloc_bytes(pdfctx->ctx->memory, r_size(pvalueref) + 1, "PDF CIDSubstPath from zpdfops");
- memcpy(pdfctx->ctx->args.cidsubstfont.data, pvalueref->value.const_bytes, r_size(pvalueref));
- pdfctx->ctx->args.cidsubstfont.size = r_size(pvalueref);
+ pdfctx->ctx->args.cidfsubstfont.data = (byte *)gs_alloc_bytes(pdfctx->ctx->memory, r_size(pvalueref) + 1, "PDF cidfsubstfont from zpdfops");
+ if (pdfctx->ctx->args.cidfsubstfont.data == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error;
+ }
+ memcpy(pdfctx->ctx->args.cidfsubstfont.data, pvalueref->value.const_bytes, r_size(pvalueref));
+ pdfctx->ctx->args.cidfsubstfont.size = r_size(pvalueref);
+ }
+ if (dict_find_string(pdictref, "SUBSTFONT", &pvalueref) > 0) {
+ ref nmstr, *namstrp;
+ if (r_has_type(pvalueref, t_string)) {
+ namstrp = pvalueref;
+ pdfctx->ctx->args.defaultfont_is_name = false;
+ } else if (r_has_type(pvalueref, t_name)) {
+ name_string_ref(imemory, pvalueref, &nmstr);
+ namstrp = &nmstr;
+ pdfctx->ctx->args.defaultfont_is_name = true;
+ }
+ else {
+ code = gs_note_error(gs_error_typecheck);
+ goto error;
+ }
+ pdfctx->ctx->args.defaultfont.data = (byte *)gs_alloc_bytes(pdfctx->ctx->memory, r_size(namstrp) + 1, "PDF defaultfontname from zpdfops");
+ if (pdfctx->ctx->args.defaultfont.data == NULL) {
+ code = gs_note_error(gs_error_VMerror);
+ goto error;
+ }
+ memcpy(pdfctx->ctx->args.defaultfont.data, pvalueref->value.const_bytes, r_size(namstrp));
+ pdfctx->ctx->args.defaultfont.size = r_size(namstrp);
}
if (dict_find_string(pdictref, "IgnoreToUnicode", &pvalueref) > 0) {
if (!r_has_type(pvalueref, t_boolean))
@@ -1241,6 +1499,11 @@ static int zPDFInit(i_ctx_t *i_ctx_p)
goto error;
pdfctx->ctx->args.nonativefontmap = pvalueref->value.boolval;
}
+ if (dict_find_string(pdictref, "PageCount", &pvalueref) > 0) {
+ if (!r_has_type(pvalueref, t_integer))
+ goto error;
+ pdfctx->ctx->Pdfmark_InitialPage = pvalueref->value.intval;
+ }
code = 0;
pop(1);
}
@@ -1273,6 +1536,44 @@ error:
}
return code;
}
+
+/* <Pagelist_string> num_pages .PDFparsePageList even/odd, start, end ... range_count */
+/* PostScript will create an array of 3 integers per range */
+static int zPDFparsePageList(i_ctx_t *i_ctx_p)
+{
+ int code = 0, size = 0, i;
+ os_ptr op = osp;
+ int *page_range_array;
+ int num_pages;
+
+ check_op(2);
+
+ code = int_param(op, max_int, &num_pages);
+ if (code < 0)
+ return code;
+
+ check_type_only(*(op - 1), t_string);
+
+ code = pagelist_parse_to_array((char *)((op - 1)->value.const_bytes), imemory, num_pages, &page_range_array);
+ make_int(op, 0); /* default return 0 */
+ if (code < 0) {
+ return code;
+ }
+ /* code returned is the number of ranges */
+ size = 3 * (code - 1); /* runpdfpagerange doesn't use 0, 0, 0 marker at end */
+ code = ref_stack_push(&o_stack, size - 1);
+ if (code < 0) {
+ return code;
+ }
+ /* push the even/odd, start, end triples on the stack */
+ for (i=0; i < size; i++) {
+ /* skip the initial "ordered" flag */
+ make_int(ref_stack_index(&o_stack, size - i), page_range_array[i+1]);
+ }
+ make_int(ref_stack_index(&o_stack, 0), size);
+ pagelist_free_range_array(imemory, page_range_array); /* all done with C array */
+ return 0;
+}
#else
static int zPDFfile(i_ctx_t *i_ctx_p)
@@ -1300,6 +1601,11 @@ static int zPDFpageinfo(i_ctx_t *i_ctx_p)
return_error(gs_error_undefined);
}
+static int zPDFpageinfoExt(i_ctx_t *i_ctx_p)
+{
+ return_error(gs_error_undefined);
+}
+
static int zPDFmetadata(i_ctx_t *i_ctx_p)
{
return_error(gs_error_undefined);
@@ -1319,8 +1625,26 @@ static int zPDFInit(i_ctx_t *i_ctx_p)
{
return_error(gs_error_undefined);
}
+
+static int zPDFparsePageList(i_ctx_t *i_ctx_p)
+{
+ return_error(gs_error_undefined);
+}
#endif
+static int zPDFAvailable(i_ctx_t *i_ctx_p)
+{
+ os_ptr op = osp;
+
+ push(1);
+#if defined(BUILD_PDF) && BUILD_PDF == 1
+ make_bool(op, true);
+#else
+ make_bool(op, false);
+#endif
+ return 0;
+}
+
/* ------ Initialization procedure ------ */
const op_def zpdfops_op_defs[] =
@@ -1333,10 +1657,13 @@ const op_def zpdfops_op_defs[] =
{"1.PDFClose", zPDFclose},
{"1.PDFInfo", zPDFinfo},
{"1.PDFPageInfo", zPDFpageinfo},
+ {"1.PDFPageInfoExt", zPDFpageinfoExt},
{"1.PDFMetadata", zPDFmetadata},
{"1.PDFDrawPage", zPDFdrawpage},
{"1.PDFDrawAnnots", zPDFdrawannots},
{"1.PDFInit", zPDFInit},
+ {"1.PDFparsePageList", zPDFparsePageList},
+ {"0.PDFAvailable", zPDFAvailable},
#ifdef HAVE_LIBIDN
{"1.saslprep", zsaslprep},
#endif
diff --git a/tiff/CMakeLists.txt b/tiff/CMakeLists.txt
index efe857df..dddbaf6a 100644
--- a/tiff/CMakeLists.txt
+++ b/tiff/CMakeLists.txt
@@ -2,6 +2,7 @@
# Run "cmake" to generate the build files for your platform
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
@@ -23,718 +24,115 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-cmake_minimum_required(VERSION 2.8.11) # b/c of use of BUILD_INTERFACE generator expression
-
-# Default policy is from 2.8.9
-cmake_policy(VERSION 2.8.9)
-# Set MacOSX @rpath usage globally.
-if (POLICY CMP0020)
- cmake_policy(SET CMP0020 NEW)
-endif(POLICY CMP0020)
-if (POLICY CMP0042)
- cmake_policy(SET CMP0042 NEW)
-endif(POLICY CMP0042)
-# Use new variable expansion policy.
-if (POLICY CMP0053)
- cmake_policy(SET CMP0053 NEW)
-endif(POLICY CMP0053)
-if (POLICY CMP0054)
- cmake_policy(SET CMP0054 NEW)
-endif(POLICY CMP0054)
+cmake_minimum_required(VERSION 3.9.0)
-# Read version information from configure.ac.
-FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" configure REGEX "^LIBTIFF_.*=")
-foreach(line ${configure})
- foreach(var LIBTIFF_MAJOR_VERSION LIBTIFF_MINOR_VERSION LIBTIFF_MICRO_VERSION LIBTIFF_ALPHA_VERSION
- LIBTIFF_CURRENT LIBTIFF_REVISION LIBTIFF_AGE)
- if(NOT ${var} AND line MATCHES "^${var}=(.*)")
- set(${var} "${CMAKE_MATCH_1}")
- break()
- endif()
- endforeach()
-endforeach()
-
-math(EXPR SO_MAJOR "${LIBTIFF_CURRENT} - ${LIBTIFF_AGE}")
-set(SO_MINOR "${LIBTIFF_AGE}")
-set(SO_REVISION "${LIBTIFF_REVISION}")
-
-message(STATUS "Building tiff version ${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF_MICRO_VERSION}${LIBTIFF_ALPHA_VERSION}")
-message(STATUS "libtiff library version ${SO_MAJOR}.${SO_MINOR}.${SO_REVISION}")
-
-set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
-
-# Project version
-project(tiff C)
-set(VERSION "${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF_MICRO_VERSION}")
-set(tiff_VERSION "${VERSION}")
-set(tiff_VERSION_MAJOR "${LIBTIFF_MAJOR_VERSION}")
-set(tiff_VERSION_MINOR "${LIBTIFF_MINOR_VERSION}")
-set(tiff_VERSION_PATCH "${LIBTIFF_MICRO_VERSION}")
-
-# the other tiff_VERSION_* variables are set automatically
-set(tiff_VERSION_ALPHA "${LIBTIFF_ALPHA_VERSION}")
-# Library version (unlike libtool's baroque scheme, WYSIWYG here)
-set(SO_COMPATVERSION "${SO_MAJOR}")
-set(SO_VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_REVISION}")
-
-# For autotools header compatibility
-set(PACKAGE_NAME "LibTIFF Software")
-set(PACKAGE_TARNAME "${PROJECT_NAME}")
-set(PACKAGE_VERSION "${PROJECT_VERSION}${tiff_VERSION_ALPHA}")
-set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-set(PACKAGE_BUGREPORT "tiff@lists.maptools.org")
-
-include(GNUInstallDirs)
-include(CheckCCompilerFlag)
-include(CheckCSourceCompiles)
-include(CheckIncludeFile)
-include(CheckLibraryExists)
-include(CheckTypeSize)
-include(CheckSymbolExists)
-enable_testing()
-
-macro(current_date var)
- if(UNIX)
- execute_process(COMMAND "date" +"%Y%m%d" OUTPUT_VARIABLE ${var})
- endif()
-endmacro()
-
-current_date(RELEASE_DATE)
-
-macro(extra_dist)
- foreach(file ${ARGV})
- file(RELATIVE_PATH relfile "${PROJECT_SOURCE_DIR}"
- "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
- list(APPEND EXTRA_DIST "${relfile}")
- endforeach()
- set(EXTRA_DIST "${EXTRA_DIST}" PARENT_SCOPE)
-endmacro()
-
-set(EXTRA_DIST
- HOWTO-RELEASE
- Makefile.vc
- SConstruct
- autogen.sh
- configure.com
- nmake.opt
- libtiff-4.pc.in)
-
-# These are annoyingly verbose, produce false positives or don't work
-# nicely with all supported compiler versions, so are disabled unless
-# explicitly enabled.
-option(extra-warnings "Enable extra compiler warnings" OFF)
-
-# This will cause the compiler to fail when an error occurs.
-option(fatal-warnings "Compiler warnings are errors" OFF)
-
-# Check if the compiler supports each of the following additional
-# flags, and enable them if supported. This greatly improves the
-# quality of the build by checking for a number of common problems,
-# some of which are quite serious.
-if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
- CMAKE_C_COMPILER_ID MATCHES "Clang")
- set(test_flags
- -Wall
- -Winline
- -W
- -Wformat-security
- -Wpointer-arith
- -Wdisabled-optimization
- -Wno-unknown-pragmas
- -Wdeclaration-after-statement
- -fstrict-aliasing)
- if(extra-warnings)
- list(APPEND test_flags
- -Wfloat-equal
- -Wmissing-prototypes
- -Wunreachable-code)
- endif()
- if(fatal-warnings)
- list(APPEND test_flags
- -Werror)
- endif()
-elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
- set(test_flags)
- if(extra-warnings)
- list(APPEND test_flags
- /W4)
- else()
- list(APPEND test_flags
- /W3)
- endif()
- if (fatal-warnings)
- list(APPEND test_flags
- /WX)
- endif()
-endif()
-
-foreach(flag ${test_flags})
- string(REGEX REPLACE "[^A-Za-z0-9]" "_" flag_var "${flag}")
- set(test_c_flag "C_FLAG${flag_var}")
- CHECK_C_COMPILER_FLAG(${flag} "${test_c_flag}")
- if (${test_c_flag})
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
- endif (${test_c_flag})
-endforeach(flag ${test_flags})
-
-if(MSVC)
- set(CMAKE_DEBUG_POSTFIX "d")
-endif()
-
-option(ld-version-script "Enable linker version script" ON)
-# Check if LD supports linker scripts.
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 {
- global: sym;
-};
-
-VERS_2 {
- global: sym;
-} VERS_1;
-")
-set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
-set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
-check_c_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT)
-set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
-file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
-if (ld-version-script AND HAVE_LD_VERSION_SCRIPT)
- set(HAVE_LD_VERSION_SCRIPT TRUE)
-else()
- set(HAVE_LD_VERSION_SCRIPT FALSE)
-endif()
+# Default policy is from 3.9.0
+cmake_policy(VERSION 3.9.0)
-# Find libm, if available
-if(NOT MINGW)
- find_library(M_LIBRARY m)
-endif()
+# Find CMake modules in cmake/
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
-check_include_file(assert.h HAVE_ASSERT_H)
-check_include_file(dlfcn.h HAVE_DLFCN_H)
-check_include_file(fcntl.h HAVE_FCNTL_H)
-check_include_file(inttypes.h HAVE_INTTYPES_H)
-check_include_file(io.h HAVE_IO_H)
-check_include_file(search.h HAVE_SEARCH_H)
-check_include_file(stdint.h HAVE_STDINT_H)
-check_include_file(string.h HAVE_STRING_H)
-check_include_file(strings.h HAVE_STRINGS_H)
-check_include_file(sys/time.h HAVE_SYS_TIME_H)
-check_include_file(sys/types.h HAVE_SYS_TYPES_H)
-check_include_file(unistd.h HAVE_UNISTD_H)
-
-# Inspired from /usr/share/autoconf/autoconf/c.m4
-foreach(inline_keyword "inline" "__inline__" "__inline")
- if(NOT DEFINED C_INLINE)
- set(CMAKE_REQUIRED_DEFINITIONS_SAVE ${CMAKE_REQUIRED_DEFINITIONS})
- set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
- "-Dinline=${inline_keyword}")
- check_c_source_compiles("
- typedef int foo_t;
- static inline foo_t static_foo() {return 0;}
- foo_t foo(){return 0;}
- int main(int argc, char *argv[]) {return 0;}"
- C_HAS_${inline_keyword})
- set(CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS_SAVE})
- if(C_HAS_${inline_keyword})
- set(C_INLINE TRUE)
- set(INLINE_KEYWORD "${inline_keyword}")
- endif()
- endif()
-endforeach()
-if(NOT DEFINED C_INLINE)
- set(INLINE_KEYWORD)
-endif()
+# Read version information from configure.ac.
+include(AutotoolsVersion)
+message(STATUS "Building tiff version ${LIBTIFF_VERSION_FULL}")
+message(STATUS "libtiff library version ${SO_VERSION}")
+string(TIMESTAMP BUILD_DATE "%Y%m%d")
+message(STATUS "libtiff build date: ${BUILD_DATE}")
-# off_t and size_t checks omitted; not clear they are used at all
-# Are off_t and size_t checks strictly necessary?
-
-# Check if sys/time.h and time.h allow use together
-check_c_source_compiles("
-#include <sys/time.h>
-#include <time.h>
-int main(void){return 0;}"
- TIME_WITH_SYS_TIME)
-
-# Check if struct tm is in sys/time.h
-check_c_source_compiles("
-#include <sys/types.h>
-#include <time.h>
-
-int main(void){
- struct tm tm;
- int *p = &tm.tm_sec;
- return !p;
-}"
- TM_IN_SYS_TIME)
-
-# Check type sizes
-# NOTE: Could be replaced with C99 <stdint.h>
-check_type_size("signed int" SIZEOF_SIGNED_INT)
-check_type_size("unsigned int" SIZEOF_UNSIGNED_INT)
-check_type_size("signed long" SIZEOF_SIGNED_LONG)
-check_type_size("unsigned long" SIZEOF_UNSIGNED_LONG)
-check_type_size("signed long long" SIZEOF_SIGNED_LONG_LONG)
-check_type_size("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG)
-check_type_size("unsigned char *" SIZEOF_UNSIGNED_CHAR_P)
-
-set(CMAKE_EXTRA_INCLUDE_FILES_SAVE ${CMAKE_EXTRA_INCLUDE_FILES})
-set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "stddef.h")
-check_type_size("size_t" SIZEOF_SIZE_T)
-check_type_size("ptrdiff_t" SIZEOF_PTRDIFF_T)
-set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES_SAVE})
-
-macro(report_values)
- foreach(val ${ARGV})
- message(STATUS "${val} set to ${${val}}")
- endforeach()
-endmacro()
-
-set(TIFF_INT8_T "signed char")
-set(TIFF_UINT8_T "unsigned char")
-
-set(TIFF_INT16_T "signed short")
-set(TIFF_UINT16_T "unsigned short")
-
-if(SIZEOF_SIGNED_INT EQUAL 4)
- set(TIFF_INT32_T "signed int")
- set(TIFF_INT32_FORMAT "%d")
-elseif(SIZEOF_SIGNED_LONG EQUAL 4)
- set(TIFF_INT32_T "signed long")
- set(TIFF_INT32_FORMAT "%ld")
-endif()
-if(SIZEOF_UNSIGNED_INT EQUAL 4)
- set(TIFF_UINT32_T "unsigned int")
- set(TIFF_UINT32_FORMAT "%u")
-elseif(SIZEOF_UNSIGNED_LONG EQUAL 4)
- set(TIFF_UINT32_T "unsigned long")
- set(TIFF_UINT32_FORMAT "%lu")
-endif()
+set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
-if(SIZEOF_SIGNED_LONG EQUAL 8)
- set(TIFF_INT64_T "signed long")
- set(TIFF_INT64_FORMAT "%ld")
-elseif(SIZEOF_SIGNED_LONG_LONG EQUAL 8)
- set(TIFF_INT64_T "signed long long")
- if (MINGW)
- set(TIFF_INT64_FORMAT "%I64d")
- else()
- set(TIFF_INT64_FORMAT "%lld")
- endif()
-endif()
-if(SIZEOF_UNSIGNED_LONG EQUAL 8)
- set(TIFF_UINT64_T "unsigned long")
- set(TIFF_UINT64_FORMAT "%lu")
-elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL 8)
- set(TIFF_UINT64_T "unsigned long long")
- if (MINGW)
- set(TIFF_UINT64_FORMAT "%I64u")
- else()
- set(TIFF_UINT64_FORMAT "%llu")
- endif()
-endif()
+# Disable deprecated features to ensure clean build
+add_definitions(-DTIFF_DISABLE_DEPRECATED)
-if(SIZEOF_UNSIGNED_INT EQUAL SIZEOF_SIZE_T)
- set(TIFF_SIZE_T "unsigned int")
- set(TIFF_SIZE_FORMAT "%u")
- set(TIFF_SSIZE_T "signed int")
- set(TIFF_SSIZE_FORMAT "%d")
-elseif(SIZEOF_UNSIGNED_LONG EQUAL SIZEOF_SIZE_T)
- set(TIFF_SIZE_T "unsigned long")
- set(TIFF_SIZE_FORMAT "%lu")
- set(TIFF_SSIZE_T "signed long")
- set(TIFF_SSIZE_FORMAT "%ld")
-elseif(SIZEOF_UNSIGNED_LONG_LONG EQUAL SIZEOF_SIZE_T)
- set(TIFF_SIZE_T "unsigned long long")
- set(TIFF_SSIZE_T "signed long long")
- if (MINGW)
- set(TIFF_SIZE_FORMAT "%I64u")
- set(TIFF_SSIZE_FORMAT "%I64d")
- else()
- set(TIFF_SIZE_FORMAT "%llu")
- set(TIFF_SSIZE_FORMAT "%lld")
- endif()
-endif()
-if(NOT SIZEOF_PTRDIFF_T)
- set(TIFF_PTRDIFF_T "${TIFF_SSIZE_T}")
- set(TIFF_PTRDIFF_FORMAT "${SSIZE_FORMAT}")
-else()
- set(TIFF_PTRDIFF_T "ptrdiff_t")
- set(TIFF_PTRDIFF_FORMAT "%ld")
-endif()
+# Project definition
+set(CMAKE_C_STANDARD 99)
+project(tiff
+ VERSION "${LIBTIFF_VERSION}"
+ LANGUAGES C CXX)
-#report_values(TIFF_INT8_T TIFF_INT8_FORMAT
-# TIFF_UINT8_T TIFF_UINT8_FORMAT
-# TIFF_INT16_T TIFF_INT16_FORMAT
-# TIFF_UINT16_T TIFF_UINT16_FORMAT
-# TIFF_INT32_T TIFF_INT32_FORMAT
-# TIFF_UINT32_T TIFF_UINT32_FORMAT
-# TIFF_INT64_T TIFF_INT64_FORMAT
-# TIFF_UINT64_T TIFF_UINT64_FORMAT
-# TIFF_SSIZE_T TIFF_SSIZE_FORMAT
-# TIFF_PTRDIFF_T TIFF_PTRDIFF_FORMAT)
-
-check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP)
-check_symbol_exists(setmode "unistd.h" HAVE_SETMODE)
-check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
-check_symbol_exists(strcasecmp "strings.h" HAVE_STRCASECMP)
-check_symbol_exists(strtol "stdlib.h" HAVE_STRTOL)
-check_symbol_exists(strtoll "stdlib.h" HAVE_STRTOLL)
-check_symbol_exists(strtoul "stdlib.h" HAVE_STRTOUL)
-check_symbol_exists(strtoull "stdlib.h" HAVE_STRTOULL)
-check_symbol_exists(getopt "unistd.h;stdio.h" HAVE_GETOPT)
-check_symbol_exists(lfind "search.h" HAVE_LFIND)
-
-if(NOT HAVE_SNPRINTF)
- add_definitions(-DNEED_LIBPORT)
-endif()
+# Autotools compatibility
+include(AutotoolsCompat)
-# CPU bit order
-set(HOST_FILLORDER FILLORDER_MSB2LSB)
-if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
- CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
- # AMD64 on Windows
- CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "AMD64" OR
- CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
- set(HOST_FILLORDER FILLORDER_LSB2MSB)
-endif()
+# Compiler checks (warning flags, etc.)
+include(CompilerChecks)
-# CPU endianness
-include(TestBigEndian)
-test_big_endian(HOST_BIG_ENDIAN)
-if(HOST_BIG_ENDIAN)
- add_definitions(-DWORDS_BIGENDIAN)
-endif()
+# Linker checks (version script, etc.)
+include(LinkerChecks)
-# IEEE floating point
-set(HAVE_IEEEFP 1)
+# Processor checks (endianness, fill order, floating point, etc.)
+include(ProcessorChecks)
-report_values(CMAKE_HOST_SYSTEM_PROCESSOR HOST_FILLORDER
- HOST_BIG_ENDIAN HAVE_IEEEFP)
+# Checks for headers
+include(IncludeChecks)
-# Large file support
-if (UNIX OR MINGW)
- # This might not catch every possibility catered for by
- # AC_SYS_LARGEFILE.
- add_definitions(-D_FILE_OFFSET_BITS=64)
- set(FILE_OFFSET_BITS 64)
-endif()
+# Checks for functions and other symbols
+include(SymbolChecks)
+# Standard installation paths
+include(GNUInstallDirs)
# Documentation install directory (default to cmake project docdir)
set(LIBTIFF_DOCDIR "${CMAKE_INSTALL_FULL_DOCDIR}")
-# Options to enable and disable internal codecs
-
-option(ccitt "support for CCITT Group 3 & 4 algorithms" ON)
-set(CCITT_SUPPORT ${ccitt})
-
-option(packbits "support for Macintosh PackBits algorithm" ON)
-set(PACKBITS_SUPPORT ${packbits})
-
-option(lzw "support for LZW algorithm" ON)
-set(LZW_SUPPORT ${lzw})
+# CTest testing
+enable_testing()
-option(thunder "support for ThunderScan 4-bit RLE algorithm" ON)
-set(THUNDER_SUPPORT ${thunder})
+# Checks for type presence and size
+include(TypeSizeChecks)
-option(next "support for NeXT 2-bit RLE algorithm" ON)
-set(NEXT_SUPPORT ${next})
+# Check for POSIX Large File Support (LFS)
+include(LargeFileSupport)
-option(logluv "support for LogLuv high dynamic range algorithm" ON)
-set(LOGLUV_SUPPORT ${logluv})
+# Options for internal codec support
+include(InternalCodecs)
-# Option for Microsoft Document Imaging
-option(mdi "support for Microsoft Document Imaging" ON)
-set(MDI_SUPPORT ${mdi})
+# Check for Deflate codec
+include(DeflateCodec)
-# ZLIB
-option(zlib "use zlib (required for Deflate compression)" ON)
-if (zlib)
- find_package(ZLIB)
-endif()
-set(ZLIB_SUPPORT 0)
-if(ZLIB_FOUND)
- set(ZLIB_SUPPORT 1)
-endif()
-set(ZIP_SUPPORT ${ZLIB_SUPPORT})
-
-
-# libdeflate
-option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ON)
-if (libdeflate)
- set(DEFLATE_FOUND 0)
- find_path(DEFLATE_INCLUDE_DIR libdeflate.h)
- set(DEFLATE_NAMES ${DEFLATE_NAMES} deflate)
- find_library(DEFLATE_LIBRARY NAMES ${DEFLATE_NAMES})
- if (DEFLATE_INCLUDE_DIR AND DEFLATE_LIBRARY)
- set(DEFLATE_FOUND 1)
- set(DEFLATE_LIBRARIES ${DEFLATE_LIBRARY})
- endif()
-endif()
-set(LIBDEFLATE_SUPPORT FALSE)
-if(DEFLATE_FOUND)
- set(LIBDEFLATE_SUPPORT TRUE)
-endif()
+# Check for PixarLog codec
+include(PixarLogCodec)
-if(LIBDEFLATE_SUPPORT AND NOT ZIP_SUPPORT)
- message(WARNING "libdeflate available but zlib is not. libdeflate cannot be used")
- set(LIBDEFLATE_SUPPORT FALSE)
-endif()
+# Check for JPEG codec
+include(JPEGCodec)
-set(LIBDEFLATE_SUPPORT ${LIBDEFLATE_SUPPORT})
+# Check for JBIG codec
+include(JBIGCodec)
+# Check for LERC codec
+include(LERCCodec)
-# Option for Pixar log-format algorithm
+# Check for LZMA codec
+include(LZMACodec)
-# Pixar log format
-option(pixarlog "support for Pixar log-format algorithm (requires Zlib)" ON)
-set(PIXARLOG_SUPPORT FALSE)
-if (ZLIB_SUPPORT)
- if(pixarlog)
- set(PIXARLOG_SUPPORT TRUE)
- endif()
-endif()
+# Check for ZSTD codec
+include(ZSTDCodec)
-# JPEG
-option(jpeg "use libjpeg (required for JPEG compression)" ON)
-if (jpeg)
- find_package(JPEG)
-endif()
-set(JPEG_SUPPORT FALSE)
-if(JPEG_FOUND)
- set(JPEG_SUPPORT TRUE)
-endif()
+# Check for WebP codec
+include(WebPCodec)
-option(old-jpeg "support for Old JPEG compression (read-only)" ON)
-set(OJPEG_SUPPORT FALSE)
-if (JPEG_SUPPORT)
- if (old-jpeg)
- set(OJPEG_SUPPORT TRUE)
- endif()
-endif()
+# Option for C++ libtiffxx library
+include(CXXLibrary)
-# JBIG-KIT
-option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ON)
-if (jbig)
- set(JBIG_FOUND 0)
- find_path(JBIG_INCLUDE_DIR jbig.h)
- set(JBIG_NAMES ${JBIG_NAMES} jbig libjbig)
- find_library(JBIG_LIBRARY NAMES ${JBIG_NAMES})
- if (JBIG_INCLUDE_DIR AND JBIG_LIBRARY)
- set(JBIG_FOUND 1)
- set(JBIG_LIBRARIES ${JBIG_LIBRARY})
- endif()
-endif()
-set(JBIG_SUPPORT 0)
-if(JBIG_FOUND)
- set(JBIG_FOUND TRUE)
- set(JBIG_SUPPORT 1)
-else()
- set(JBIG_FOUND FALSE)
-endif()
+# Checks for OpenGL support
+include(OpenGLChecks)
-set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
-set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIR})
-check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN)
-set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
-
-# liblzma2
-option(lzma "use liblzma (required for LZMA2 compression)" ON)
-if (lzma)
- find_package(LibLZMA)
-endif()
-set(LZMA_SUPPORT 0)
-if(LIBLZMA_FOUND)
- set(LZMA_SUPPORT 1)
-endif()
-
-# libzstd
-option(zstd "use libzstd (required for ZSTD compression)" ON)
-if (zstd)
- find_path(ZSTD_INCLUDE_DIR zstd.h)
- find_library(ZSTD_LIBRARY NAMES zstd)
- if (ZSTD_INCLUDE_DIR AND ZSTD_LIBRARY)
- check_library_exists ("${ZSTD_LIBRARY}" ZSTD_decompressStream "" ZSTD_RECENT_ENOUGH)
- if (ZSTD_RECENT_ENOUGH)
- set(ZSTD_FOUND TRUE)
- set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
- message(STATUS "Found ZSTD library: ${ZSTD_LIBRARY}")
- else ()
- message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0")
- endif ()
- endif ()
-endif()
-set(ZSTD_SUPPORT 0)
-if(ZSTD_FOUND)
- set(ZSTD_SUPPORT 1)
-endif()
-
-# libwebp
-option(webp "use libwebp (required for WEBP compression)" ON)
-if (webp)
- find_path(WEBP_INCLUDE_DIR /webp/decode.h)
- find_library(WEBP_LIBRARY NAMES webp)
-endif()
-set(WEBP_SUPPORT 0)
-set(WEBP_FOUND FALSE)
-if (WEBP_INCLUDE_DIR AND WEBP_LIBRARY)
- set(WEBP_SUPPORT 1)
- set(WEBP_FOUND TRUE)
- set(WEBP_LIBRARIES ${WEBP_LIBRARY})
- message(STATUS "Found WEBP library: ${WEBP_LIBRARY}")
-endif()
-
-# 8/12-bit jpeg mode
-option(jpeg12 "enable libjpeg 8/12-bit dual mode (requires separate
-12-bit libjpeg build)" ON)
-set(JPEG12_INCLUDE_DIR JPEG12_INCLUDE_DIR-NOTFOUND CACHE PATH "Include directory for 12-bit libjpeg")
-set(JPEG12_LIBRARY JPEG12_LIBRARY-NOTFOUND CACHE FILEPATH "12-bit libjpeg library")
-set(JPEG12_FOUND FALSE)
-if (JPEG12_INCLUDE_DIR AND JPEG12_LIBRARY)
- set(JPEG12_LIBRARIES ${JPEG12_LIBRARY})
- set(JPEG12_FOUND TRUE)
-endif()
-if (JPEG12_FOUND)
- set(JPEG_DUAL_MODE_8_12 1)
- set(LIBJPEG_12_PATH "${JPEG12_INCLUDE_DIR}/jpeglib.h")
-endif()
-
-# C++ support
-option(cxx "Enable C++ stream API building (requires C++ compiler)" ON)
-set(CXX_SUPPORT FALSE)
-if (cxx)
- enable_language(CXX)
- set(CXX_SUPPORT TRUE)
-endif()
-
-# OpenGL and GLUT
-find_package(OpenGL)
-find_package(GLUT)
-set(HAVE_OPENGL FALSE)
-if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
- set(HAVE_OPENGL TRUE)
-endif()
-# Purely to satisfy the generated headers:
-check_include_file(GL/gl.h HAVE_GL_GL_H)
-check_include_file(GL/glu.h HAVE_GL_GLU_H)
-check_include_file(GL/glut.h HAVE_GL_GLUT_H)
-check_include_file(GLUT/glut.h HAVE_GLUT_GLUT_H)
-check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H)
-check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)
-
-# Win32 IO
-set(win32_io FALSE)
-if(WIN32)
- set(win32_io TRUE)
-endif()
-
-set(USE_WIN32_FILEIO ${win32_io})
+# Windows support
+include(WindowsSupport)
# Orthogonal features
+include(LibraryFeatures)
-# Strip chopping
-option(strip-chopping "strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)" ON)
-set(TIFF_DEFAULT_STRIP_SIZE 8192 CACHE STRING "default size of the strip in bytes (when strip chopping is enabled)")
-
-set(STRIPCHOP_DEFAULT)
-if(strip-chopping)
- set(STRIPCHOP_DEFAULT TRUE)
- if(TIFF_DEFAULT_STRIP_SIZE)
- set(STRIP_SIZE_DEFAULT "${TIFF_DEFAULT_STRIP_SIZE}")
- endif()
-endif()
-
-# Defer loading of strip/tile offsets
-option(defer-strile-load "enable deferred strip/tile offset/size loading (also available at runtime with the 'D' flag of TIFFOpen())" OFF)
-set(DEFER_STRILE_LOAD ${defer-strile-load})
-
-# CHUNKY_STRIP_READ_SUPPORT
-option(chunky-strip-read "enable reading large strips in chunks for TIFFReadScanline() (experimental)" OFF)
-set(CHUNKY_STRIP_READ_SUPPORT ${chunky-strip-read})
+# pkg-config support
+include(PkgConfig)
-# SUBIFD support
-set(SUBIFD_SUPPORT 1)
+# math.h/libm portability
+find_package(CMath REQUIRED)
-# Default handling of ASSOCALPHA support.
-option(extrasample-as-alpha "the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly" ON)
-if(extrasample-as-alpha)
- set(DEFAULT_EXTRASAMPLE_AS_ALPHA 1)
-endif()
+# Release support
+include(Release)
-# Default handling of YCbCr subsampling support.
-# See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details.
-option(check-ycbcr-subsampling "enable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag" ON)
-if (check-ycbcr-subsampling)
- set(CHECK_JPEG_YCBCR_SUBSAMPLING 1)
-endif()
-
-# Generate pkg-config file
-set(prefix "${CMAKE_INSTALL_PREFIX}")
-set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
-set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
-set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libtiff-4.pc.in
- ${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc
- DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig")
-
-# Includes used by libtiff (and tests)
-if(ZLIB_INCLUDE_DIRS)
- list(APPEND TIFF_INCLUDES ${ZLIB_INCLUDE_DIRS})
-endif()
-if(DEFLATE_INCLUDE_DIR)
- list(APPEND TIFF_INCLUDES ${DEFLATE_INCLUDE_DIR})
-endif()
-if(JPEG_INCLUDE_DIR)
- list(APPEND TIFF_INCLUDES ${JPEG_INCLUDE_DIR})
-endif()
-if(JPEG12_INCLUDE_DIR)
- list(APPEND TIFF_INCLUDES ${JPEG12_INCLUDE_DIR})
-endif()
-if(JBIG_INCLUDE_DIR)
- list(APPEND TIFF_INCLUDES ${JBIG_INCLUDE_DIR})
-endif()
-if(LIBLZMA_INCLUDE_DIRS)
- list(APPEND TIFF_INCLUDES ${LIBLZMA_INCLUDE_DIRS})
-endif()
-if(ZSTD_INCLUDE_DIR)
- list(APPEND TIFF_INCLUDES ${ZSTD_INCLUDE_DIR})
-endif()
-if(WEBP_INCLUDE_DIR)
- list(APPEND TIFF_INCLUDES ${WEBP_INCLUDE_DIR})
-endif()
-
-# Libraries required by libtiff
-set(TIFF_LIBRARY_DEPS)
-if(NOT MINGW AND M_LIBRARY)
- list(APPEND TIFF_LIBRARY_DEPS "m")
-endif()
-if(ZLIB_LIBRARIES)
- list(APPEND TIFF_LIBRARY_DEPS ${ZLIB_LIBRARIES})
-endif()
-if(DEFLATE_LIBRARIES)
- list(APPEND TIFF_LIBRARY_DEPS ${DEFLATE_LIBRARIES})
-endif()
-if(JPEG_LIBRARIES)
- list(APPEND TIFF_LIBRARY_DEPS ${JPEG_LIBRARIES})
-endif()
-if(JPEG12_LIBRARIES)
- list(APPEND TIFF_LIBRARY_DEPS ${JPEG12_LIBRARIES})
-endif()
-if(JBIG_LIBRARIES)
- list(APPEND TIFF_LIBRARY_DEPS ${JBIG_LIBRARIES})
-endif()
-if(LIBLZMA_LIBRARIES)
- list(APPEND TIFF_LIBRARY_DEPS ${LIBLZMA_LIBRARIES})
-endif()
-if(ZSTD_LIBRARIES)
- list(APPEND TIFF_LIBRARY_DEPS ${ZSTD_LIBRARIES})
-endif()
-if(WEBP_LIBRARIES)
- list(APPEND TIFF_LIBRARY_DEPS ${WEBP_LIBRARIES})
-endif()
-
-#report_values(TIFF_INCLUDES TIFF_LIBRARY_DEPS)
# Process subdirectories
add_subdirectory(port)
@@ -746,10 +144,9 @@ add_subdirectory(build)
add_subdirectory(man)
add_subdirectory(html)
-#message(STATUS "EXTRA_DIST: ${EXTRA_DIST}")
message(STATUS "")
-message(STATUS "Libtiff is now configured for ${host}")
+message(STATUS "Libtiff is now configured for ${CMAKE_SYSTEM}")
message(STATUS "")
message(STATUS " Installation directory: ${prefix}")
message(STATUS " Documentation directory: ${LIBTIFF_DOCDIR}")
@@ -769,16 +166,29 @@ message(STATUS " NeXT 2-bit RLE algorithm: ${next}")
message(STATUS " LogLuv high dynamic range encoding: ${logluv}")
message(STATUS "")
message(STATUS " Support for external codecs:")
-message(STATUS " ZLIB support: ${zlib} (requested) ${ZLIB_FOUND} (availability)")
-message(STATUS " libdeflate support: ${libdeflate} (requested) ${LIBDEFLATE_SUPPORT} (availability)")
-message(STATUS " Pixar log-format algorithm: ${pixarlog} (requested) ${PIXARLOG_SUPPORT} (availability)")
-message(STATUS " JPEG support: ${jpeg} (requested) ${JPEG_FOUND} (availability)")
-message(STATUS " Old JPEG support: ${old-jpeg} (requested) ${JPEG_FOUND} (availability)")
-message(STATUS " JPEG 8/12 bit dual mode: ${jpeg12} (requested) ${JPEG12_FOUND} (availability)")
-message(STATUS " ISO JBIG support: ${jbig} (requested) ${JBIG_FOUND} (availability)")
-message(STATUS " LZMA2 support: ${lzma} (requested) ${LIBLZMA_FOUND} (availability)")
-message(STATUS " ZSTD support: ${zstd} (requested) ${ZSTD_FOUND} (availability)")
-message(STATUS " WEBP support: ${webp} (requested) ${WEBP_FOUND} (availability)")
+message(STATUS " ZLIB support: Requested:${zlib} Availability:${ZLIB_FOUND} Support:${ZLIB_SUPPORT}")
+if(ZLIB_SUPPORT)
+ message(STATUS " libdeflate support: Requested:${libdeflate} Availability:${DEFLATE_FOUND} Support:${LIBDEFLATE_SUPPORT}")
+else()
+ message(STATUS " libdeflate support: Requested:${libdeflate} Availability:${DEFLATE_FOUND} Support:${LIBDEFLATE_SUPPORT} (Depends on ZLIB Support)")
+endif()
+if(ZLIB_SUPPORT)
+ message(STATUS " Pixar log-format algorithm: Requested:${pixarlog} Availability:${ZLIB_FOUND} Support:${PIXARLOG_SUPPORT}")
+else()
+ message(STATUS " Pixar log-format algorithm: Requested:${pixarlog} Availability:${ZLIB_FOUND} Support:${PIXARLOG_SUPPORT} (Depends on ZLIB Support)")
+endif()
+message(STATUS " JPEG support: Requested:${jpeg} Availability:${JPEG_FOUND} Support:${JPEG_SUPPORT}")
+if(JPEG_SUPPORT)
+ message(STATUS " Old JPEG support: Requested:${old-jpeg} Availability:${JPEG_SUPPORT} Support:${OJPEG_SUPPORT}")
+else()
+ message(STATUS " Old JPEG support: Requested:${old-jpeg} Availability:${JPEG_SUPPORT} Support:${OJPEG_SUPPORT} (Depends on JPEG Support)")
+endif()
+message(STATUS " JPEG 8/12 bit dual mode: Requested:${jpeg12} Availability:${JPEG12_FOUND} Support:${JPEG_DUAL_MODE_8_12}")
+message(STATUS " ISO JBIG support: Requested:${jbig} Availability:${JBIG_FOUND} Support:${JBIG_SUPPORT}")
+message(STATUS " LERC support: Requested:${lerc} Availability:${LERC_FOUND} Support:${LERC_SUPPORT}")
+message(STATUS " LZMA2 support: Requested:${lzma} Availability:${LIBLZMA_FOUND} Support:${LZMA_SUPPORT}")
+message(STATUS " ZSTD support: Requested:${zstd} Availability:${ZSTD_USABLE} Support:${ZSTD_SUPPORT}")
+message(STATUS " WEBP support: Requested:${webp} Availability:${WEBP_FOUND} Support:${WEBP_SUPPORT}")
message(STATUS "")
message(STATUS " C++ support: ${cxx} (requested) ${CXX_SUPPORT} (availability)")
message(STATUS "")
diff --git a/tiff/ChangeLog b/tiff/ChangeLog
index 452dcb3a..9bda39c3 100644
--- a/tiff/ChangeLog
+++ b/tiff/ChangeLog
@@ -1,3 +1,899 @@
+2021-04-16 Even Rouault <even.rouault@spatialys.com>
+
+ libtiff v4.3.0 released
+
+2021-04-15 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'libjpeg12_cmake' into 'master'
+ libtiff/tif_config.h.cmake.in: surround LIBJPEG_12_PATH by double quotes
+
+ See merge request libtiff/libtiff!237
+
+2021-04-15 Even Rouault <even.rouault@spatialys.com>
+
+ libtiff/tif_config.h.cmake.in: surround LIBJPEG_12_PATH by double quotes
+
+2021-04-14 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'lerc_api_change' into 'master'
+ tif_lerc.c: cope with API breakage in liblerc master
+
+ See merge request libtiff/libtiff!236
+
+2021-04-14 Even Rouault <even.rouault@spatialys.com>
+
+ tif_lerc.c: cope with API breakage in liblerc master.
+
+2021-04-08 Even Rouault <even.rouault@spatialys.com>
+
+ libtiff: remove remaining #ifdef WIN32 and use PRI formatting.
+
+2021-03-10 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'kmilos-master-patch-73187' into 'master'
+ tiffcp: Remove LZW help text, preset not supported
+
+ See merge request libtiff/libtiff!229
+
+2021-03-10 Miloš Komarčević <miloskomarcevic@aim.com>
+
+ tiffcp: Remove LZW help text, preset not supported.
+
+2021-03-10 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'feature/lerc' into 'master'
+ Add LERC Compression Plugin (closes: #213)
+
+ Closes #213
+
+ See merge request libtiff/libtiff!228
+
+2021-03-10 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'cmake-fixes' into 'master'
+ CMake fixes
+
+ Closes #246 et #245
+
+ See merge request libtiff/libtiff!232
+
+2021-03-09 Roger Leigh <rleigh@codelibre.net>
+
+ cmake: Correct FindCMath.
+
+ cmake: Correct ZSTD_USABLE typo.
+
+2021-03-07 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'cmake-find-lib-prefixes' into 'master'
+ cmake: Correct find lib prefixes for Deflate and JBIG
+
+ See merge request libtiff/libtiff!231
+
+2021-03-07 Roger Leigh <rleigh@codelibre.net>
+
+ cmake: FindJBIG uses lib prefix on Windows.
+
+ cmake: FindDeflate uses lib prefix on Windows.
+
+2021-03-07 Even Rouault <even.rouault@spatialys.com>
+
+ TWebPDecode(): avoid potential overflow on multiplication (CID 1472928)
+
+ TIFFReadDirEntryArrayWithLimit(): avoid false positive from Coverity Scan regarding out-of-bounds access (CID 1472927)
+
+ tif_dirwrite.c: avoid setting a variable that is not read afterwards.
+
+2021-03-07 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'coverity-fixes' into 'master'
+ Coverity fixes (high impact)
+
+ See merge request libtiff/libtiff!227
+
+2021-03-07 Roger Leigh <rleigh@codelibre.net>
+
+ Fix high-impact Coverity issues (resource leaks).
+ The issues are in the tests and tiffcrop, not the core library. Real issues, but not high risk.
+
+ Use to test if Coverity integration is performing properly on merge.
+
+2021-03-07 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'fix_tif_fax3_encoder_regression' into 'master'
+ tif_fax3.c: fix master regression in encoder
+
+ See merge request libtiff/libtiff!230
+
+2021-03-07 Even Rouault <even.rouault@spatialys.com>
+
+ tif_fax3.c: fix master regression in encoder.
+ Fix issue introduced in 39a74eede0455ec8ee334dcddf71f5354d508d8b
+
+ Spotted by gdal's tiff_write_76 test
+
+2021-03-07 Antonio Valentino <antonio.valentino@tiscali.it>
+
+ Add LERC support in CMake.
+
+2021-03-07 Antonio Valentino <Antonio.Valentino@esa.int>
+
+ Add LERC support in configure.ac and Makefile.am.
+
+2021-03-07 Antonio Valentino <antonio.valentino@tiscali.it>
+
+ Add LERC support to tiffcp.
+
+2021-03-07 Antonio Valentino <Antonio.Valentino@esa.int>
+
+ Add LERC plugin.
+ The lerc plugin code has been copyed form GDAL.
+
+2021-03-06 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'display_tool_purpose' into 'master'
+ TIFF tools: insert a line of text summarizing each tool's purpose
+
+ See merge request libtiff/libtiff!214
+
+2021-03-06 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'cmake-update' into 'master'
+ CMake updates
+
+ See merge request libtiff/libtiff!224
+
+2021-03-06 Even Rouault <even.rouault@spatialys.com>
+
+ tiff.h: typo fix in comment.
+
+2021-02-15 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'remove-travis' into 'master'
+ ci: Remove unused Travis-CI support
+
+ See merge request libtiff/libtiff!226
+
+2021-02-14 Roger Leigh <rleigh@codelibre.net>
+
+ ci: Remove unused Travis-CI support.
+
+2021-02-14 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'ci-coverity' into 'master'
+ Enable Coverity static analysis with CI pipeline
+
+ See merge request libtiff/libtiff!225
+
+2021-02-14 Roger Leigh <rleigh@codelibre.net>
+
+ ci: Add Coverity static analysis job.
+
+ ci: Use custom libtiff CI image.
+
+2021-02-13 Roger Leigh <rleigh@codelibre.net>
+
+ cmake: Add release target.
+
+ cmake: Remove empty contrib files.
+
+ cmake: Tidy toplevel.
+
+ cmake: Move pkg-config support to PkgConfig.cmake.
+
+ cmake: Move library feature options to CXXLibraryFeatures.cmake.
+
+ cmake: Move C++ support to CXXLibrary.cmake.
+
+ cmake: Add FindCMath to handle libm linking portably.
+
+ cmake: Tidy unused includes.
+
+ cmake: Rename release date to build date.
+
+ cmake: Compute timestamp portably.
+
+ cmake: Remove remaining uses of report_values()
+
+ cmake: Move JPEG12 checks to JPEGCodec.cmake.
+
+ cmake: Move OpenGL checks to OpenGLChecks.cmake.
+
+ cmake: Move OpenGL checks to OpenGLChecks.cmake.
+
+ cmake: Move WebP codec support to WebPCodec.cmake.
+
+ cmake: Use imported targets for WebP.
+
+ cmake: Add FindWebP.
+
+ cmake: Move ZSTD codec support to ZSTDCodec.cmake.
+
+ cmake: Use imported targets for ZSTD.
+
+ cmake: Add FindZSTD.
+
+ cmake: Move LZMA codec support to LZMACodec.cmake.
+
+ cmake: Use imported targets for LibLZMA.
+
+ cmake: Move JBIG codec support to JBIGCodec.cmake.
+
+ cmake: Use imported targets for JBIG.
+
+ cmake: Add FindJBIG.
+
+ cmake: Move PixarLog codec support to PixarLogCodec.cmake.
+
+ cmake: Report system name in configuration report.
+
+ cmake: Move JPEG codec support to JPEGCodec.cmake.
+
+ cmake: Use imported targets for JPEG.
+
+ cmake: Move Deflate codec support to DeflateCodec.cmake.
+
+ cmake: Use imported targets for ZLIB and Deflate.
+
+ cmake: Add FindDeflate.
+
+ cmake: Move symbol checks to SymbolChecks.cmake.
+
+ cmake: Move include checks to IncludeChecks.cmake.
+
+ cmake: Move all autotools logic to separate files.
+
+ cmake: Move internal codec options to InternalCodecs.cmake.
+
+ cmake: Move LFS check to LargeFileSupport.cmake.
+
+ cmake: Move Win32 IO feature to WindowsIOFeature.cmake.
+
+ cmake: Move processor capability checks to ProcessorChecks.cmake.
+
+ cmake: Move type size checks to TypeSizeChecks.cmake.
+
+ cmake: Move linker checks to LinkerChecks.cmake.
+
+ cmake: Move warning options to CompilerChecks.
+
+ cmake: Move version introspection to AutotoolsVersion.cmake.
+
+ cmake: Move compiler checks to CompilerChecks.cmake.
+
+ cmake: Split into helper scripts.
+
+2021-02-08 Roger Leigh <rleigh@codelibre.net>
+
+ cmake: Use target_sources.
+
+ libport: Adjust header and library to only define and link if required.
+ * Make libport an OBJECT library when in use, otherwise a dummy
+ INTERFACE library
+ * libport.h will work if getopt is present or not present. If
+ present, will fall back to <unistd.h>, else will define
+ symbols
+ * Add generated libport_config.h to define HAVE_GETOPT and HAVE_UNISTD_H
+ * dummy.c no longer needed with CMake
+ * libtiff/libtiffxx no longer link with libport
+
+ cmake: Remove unnecessary extra_dist usage.
+ Only makes sense in the context of Automake. Was carried over
+ for reference while porting, but is not needed.
+
+ cmake: Update minimum version and policy version to 3.9.
+
+2021-02-08 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'remove-nmake' into 'master'
+ Remove NMake build support
+
+ See merge request libtiff/libtiff!223
+
+2021-02-08 Roger Leigh <rleigh@codelibre.net>
+
+ Remove NMake build support.
+ The functionality provided by the NMake build is now completely
+ superseded by the CMake build.
+
+2021-02-08 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'warning-fixes' into 'master'
+ Warning fixes
+
+ See merge request libtiff/libtiff!222
+
+2021-02-07 Miguel Medalha <medalist@sapo.pt>
+
+ Update tiffsplit.c.
+
+ Reinsert summary line lost after conflicting merge.
+
+ Merge branch 'master' into 'display_tool_purpose'
+ # Conflicts:
+ # tools/tiffsplit.c
+
+2021-02-06 Roger Leigh <rleigh@codelibre.net>
+
+ ci: Enable fatal warnings with -Werror for AppVeyor/GCC.
+
+ ci: Enable fatal warnings with -Werror for GitLab CI.
+
+ tif_zstd.c: Remove unused variable warning.
+
+ custom_dir_EXIF_231: Remove case statement fallthrough.
+
+ custom_dir_EXIF_231: Correct use of strncpy.
+
+ Correct include order.
+
+ Eliminate implict fallthrough usage.
+ Use simple loops in place of manual loop unrolling. Rely on
+ the compiler optimiser to unroll loops when appropriate.
+
+ Suppress potential unused variable warning.
+
+ Suppress warnings or avoid case statement fallthrough.
+
+2021-02-05 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'c99-ssize_t-fixes' into 'master'
+ C99 ssize_t fixes
+
+ Closes #239
+
+ See merge request libtiff/libtiff!219
+
+2021-02-05 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'tiffsplit-too-many-args' into 'master'
+ tiffsplit.c: exit with EXIT_FAILURE if there are extra args on the command line
+
+ See merge request libtiff/libtiff!209
+
+2021-02-05 Roger Leigh <rleigh@codelibre.net>
+
+ Add additional TIFF_SSIZE_FORMAT uses.
+
+2021-02-04 Roger Leigh <rleigh@codelibre.net>
+
+ NMake fixes for size type formatting.
+
+ Add TIFF_SIZE_FORMAT for portable use of %z.
+ MinGW64 does support %z, but it issues a compiler warning.
+
+ Align Autoconf tif_config.h and CMake tif_config.cmake.in.
+
+ Use TIFF_SSIZE_FORMAT for formatting tmsize_t.
+
+2021-02-04 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'remove-lcc' into 'master'
+ Remove Makefile.lcc
+
+ See merge request libtiff/libtiff!221
+
+2021-02-04 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'remove-scons' into 'master'
+ Remove SCons build
+
+ See merge request libtiff/libtiff!220
+
+2021-02-03 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'c99-snprintf' into 'master'
+ Use C99 snprintf
+
+ See merge request libtiff/libtiff!217
+
+2021-02-03 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'tiff2ps-const' into 'master'
+ tiff2ps.c: string literals must be const char *, not char *
+
+ See merge request libtiff/libtiff!202
+
+2021-02-03 Roger Leigh <rleigh@codelibre.net>
+
+ Remove SCons build.
+ Unmaintained for 16 years.
+
+2021-02-03 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'codec_summary' into 'master'
+ Modify 'CMakeLists.txt' to produce a meaningful summary of external codecs
+
+ See merge request libtiff/libtiff!192
+
+2021-02-03 Roger Leigh <rleigh@codelibre.net>
+
+ Remove Makefile.lcc.
+ Unmaintained for 22 years.
+
+2021-02-02 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'ci-32-bit' into 'master'
+ ci: Build 32- and 64-bit MSVC variants
+
+ See merge request libtiff/libtiff!218
+
+2021-02-01 Roger Leigh <rleigh@codelibre.net>
+
+ ci: Build 32- and 64-bit MSVC variants.
+
+ Use C99 snprintf.
+
+2021-02-01 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'c99-strtol' into 'master'
+ Use C99 strtol, strtoul, strtoll and strtoull
+
+ See merge request libtiff/libtiff!216
+
+2021-01-31 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'c99-inline' into 'master'
+ Use C99 inline
+
+ See merge request libtiff/libtiff!215
+
+2021-01-31 Roger Leigh <rleigh@codelibre.net>
+
+ Use C99 strtol, strtoul, strtoll and strtoull.
+
+ tif_fax3: Use C99 inline.
+
+ Remove inline feature tests and defines.
+ Available as a standard feature with C99.
+
+2021-01-30 Miguel Medalha <medalist@sapo.pt>
+
+ Update raw2tiff.c (remove duplicate description of tool)
+
+2021-01-30 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'c99-format-strings' into 'master'
+ C99 format strings
+
+ See merge request libtiff/libtiff!211
+
+2021-01-29 Miguel Medalha <medalist@sapo.pt>
+
+ Update tiffdither.c (2 tabs caused slight misalignment of lines in usage info output)
+
+2021-01-28 Miguel Medalha <medalist@sapo.pt>
+
+ Update ppm2tiff.c (slight misalignment of lines in usage info output)
+
+ Update tiffset.c (small misalignment of lines in usage info output)
+
+2021-01-28 Medalha <medalist@sapo.pt>
+
+ Display tool purpose.
+
+2021-01-28 Thomas Bernard <miniupnp@free.fr>
+
+ tiff2ps.c: string literals must be const char *, not char *
+
+2021-01-28 Roger Leigh <rleigh@codelibre.net>
+
+ libtiff: Use PRI format flags and remove unnecessary casts.
+
+2021-01-27 Roger Leigh <rleigh@codelibre.net>
+
+ ascii_tag: Use PRI format flags and remove unnecessary casts.
+
+ check_tag: Use PRI format flags and remove unnecessary casts.
+
+ custom_dir_EXIF_231: Use PRI format flags and remove unnecessary casts.
+
+ short_tag: Use PRI format flags and remove unnecessary casts.
+
+ strip_rw: Use PRI format flags and remove unnecessary casts.
+
+ fax2tiff: Use PRI format flags and remove unnecessary casts.
+
+ ppm2tiff: Correct format strings.
+
+ raw2tiff: Use PRI format flags and remove unnecessary casts.
+
+ rgb2ycbcr: Use PRI format flags and remove unnecessary casts.
+
+ tiff2pdf: Use PRI format flags and remove unnecessary casts.
+
+ tiff2ps: Use PRI format flags and remove unnecessary casts.
+
+ tiff2rgba: Use PRI format flags and remove unnecessary casts.
+
+ tiffcmp: Use PRI format flags and remove unnecessary casts.
+
+ tiffcp: Use PRI format flags and remove unnecessary casts.
+
+ tiffcrop: Use PRI format flags and remove unnecessary casts.
+
+ tiffinfo: Use PRI format flags and remove unnecessary casts.
+
+ tiffdump: Use PRI format flags and remove unnecessary casts.
+
+2021-01-27 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'c99-require-stdtypes' into 'master'
+ Use standard C99 integer types
+
+ See merge request libtiff/libtiff!205
+
+2021-01-26 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'reserve_COMPRESSION_JXL' into 'master'
+ tiff.h: reserve COMPRESSION_JXL=50002 for JPEGXL
+
+ See merge request libtiff/libtiff!210
+
+2021-01-22 Even Rouault <even.rouault@spatialys.com>
+
+ tiff.h: reserve COMPRESSION_JXL=50002 for JPEGXL.
+
+2021-01-22 Kurt Schwehr <schwehr@google.com>
+
+ tiffsplit.c: exit with EXIT_FAILURE if there are extra args on the command line
+ e.g. tiffsplit in.tif a_prefix_ junk
+
+2021-01-22 Roger Leigh <rleigh@codelibre.net>
+
+ Add and enable TIFF_DISABLE_DEPRECATED for internal use.
+
+ Add typedef deprecations for GCC/Clang and MSVC.
+
+ Use standard C99 integer types.
+
+2021-01-20 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'ubuntu-zstd-wepb' into 'master'
+ gitlab-ci : use libzstd-dev and libwebp-dev ubuntu packages
+
+ See merge request libtiff/libtiff!208
+
+2021-01-20 Thomas Bernard <miniupnp@free.fr>
+
+ gitlab-ci : use libzstd-dev and libwebp-dev ubuntu packages.
+ should replace !206
+
+2021-01-20 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'issue-232' into 'master'
+ tiff2ps: exit the loop in case of error
+
+ Closes #232
+
+ See merge request libtiff/libtiff!201
+
+2021-01-20 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'tiffsplit-exit-status' into 'master'
+ tiffsplit: Exit with EXIT_FAILURE if unable to open the input file.
+
+ See merge request libtiff/libtiff!207
+
+2021-01-20 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'config-cleanup' into 'master'
+ Remove HAVE_INTTYPES_H, HAVE_LFIND & lfind, HAVE_SEARCH_H & include <search.h>
+
+ See merge request libtiff/libtiff!203
+
+2021-01-19 Kurt Schwehr <schwehr@google.com>
+
+ tiffsplit: Exit with EXIT_FAILURE if unable to open the input file.
+
+2021-01-18 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'tiffcmp' into 'master'
+ tiffcmp: fix comparaison with pixels that are fractional number of bytes
+
+ Closes #53
+
+ See merge request libtiff/libtiff!141
+
+2021-01-15 Kurt Schwehr <schwehr@google.com>
+
+ CMakeLists.txt: Remove search for lfind.
+
+ Remove HAVE_INTTYPES_H, HAVE_LFIND & lfind, HAVE_SEARCH_H & include <search.h>
+ - HAVE_INTTYPES_H is replaced with TIFF_HAVE_INTTYPES_H
+ - tif_dirinfo.c has a static td_lfind
+
+2021-01-15 Thomas Bernard <miniupnp@free.fr>
+
+ tiffcmp: fix comparaison with pixels that are fractional number of bytes
+ For exemple : 4bits per sample + 3 samples per pixel => 1.5 bytes per pixel
+
+ tiff2ps: exit the loop in case of error.
+ fixes #232
+
+2021-01-15 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'rm-strcasecmp' into 'master'
+ Remove port/strcasecmp.c as strcasecmp is not currently used in libtiff.
+
+ Closes #235
+
+ See merge request libtiff/libtiff!199
+
+2021-01-15 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'std-int-types' into 'master'
+ Use standard C99 integer types
+
+ See merge request libtiff/libtiff!185
+
+2021-01-13 Kurt Schwehr <schwehr@google.com>
+
+ Remove port/strcasecmp.c as strcasecmp is not currently used in libtiff.
+ Fixes #235
+
+2021-01-10 Miguel Medalha <medalist@sapo.pt>
+
+ Update CMakeLists.txt. Delete unnecessary line from libdeflate codec support section
+
+2021-01-10 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'include_libport' into 'master'
+ tiff tools and libtiff/mkg3states: include 'libport.h', remove local definition of 'getopt()'
+
+ See merge request libtiff/libtiff!198
+
+2021-01-09 Miguel Medalha <medalist@sapo.pt>
+
+ Update CMakeLists.txt. Cleanup of indentation space. Removal of leading '/' from webp include dir.
+
+2021-01-09 miguel <medalist@sapo.pt>
+
+ cmake: Use target_include_directories correctly.
+
+2021-01-09 Roger Leigh <rleigh@codelibre.net>
+
+ cmake: Use target_include_directories correctly.
+
+ cmake: Drop unnecessary TOOL_INCLUDES.
+
+2021-01-07 Roger Leigh <rleigh@codelibre.net>
+
+ cmake: Use target_include_directories correctly.
+
+2021-01-07 miguel <medalist@sapo.pt>
+
+ tiff tools and libtiff/mkg3states: include 'libport.h', remove local definition of 'getopt()'
+
+2021-01-07 Miguel Medalha <medalist@sapo.pt>
+
+ Update CMakeLists.txt.
+
+2021-01-07 miguel <medalist@sapo.pt>
+
+ tiff tools: include 'libport.h', remove local definition of 'getopt()'
+
+2021-01-06 Roger Leigh <rleigh@codelibre.net>
+
+ Remove conditional use of <string.h>
+
+ cmake: Drop dlfcn.h check.
+
+ cmake: Remove duplicate line.
+
+ Use stdint.h types when available.
+
+2021-01-05 Olivier Paquet <olivier.paquet@gmail.com>
+
+ Merge branch 'iptcutil' into 'master'
+ contrib/iptcutil.c: set '#ifdef _WIN32' (was '#ifdef WIN32', which failed at build time)
+
+ See merge request libtiff/libtiff!197
+
+2021-01-05 miguel <medalist@sapo.pt>
+
+ tiff tools: include 'libport.h', remove local definition of 'getopt()'
+
+ contrib/iptcutil.c - set '#ifdef _WIN32' (was '#ifdef WIN32', which failed at build time)
+
+2021-01-04 Even Rouault <even.rouault@spatialys.com>
+
+ tools/CMakeLists.txt: add comment about rgb2ycbcr and thumbnail not to be installed
+
+2021-01-04 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'revert-5331ed49' into 'master'
+ Revert "Merge branch 'install_targets' into 'master'"
+
+ See merge request libtiff/libtiff!196
+
+2021-01-04 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'drop-wince' into 'master'
+ Remove non-functional WinCE support
+
+ See merge request libtiff/libtiff!188
+
+2021-01-04 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'drop-vms' into 'master'
+ Remove non-functional VMS support
+
+ See merge request libtiff/libtiff!187
+
+2021-01-03 Even Rouault <even.rouault@spatialys.com>
+
+ Revert "Merge branch 'install_targets' into 'master'"
+ This reverts merge request !193
+
+2021-01-03 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'tiffcp_b_parameter' into 'master'
+ tiffcp: Remove unnecessary reference to compression from usage info for -b parameter
+
+ See merge request libtiff/libtiff!189
+
+2021-01-03 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'cmake-faxtable' into 'master'
+ cmake: Add faxtable target
+
+ See merge request libtiff/libtiff!186
+
+2021-01-03 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'install_targets' into 'master'
+ Update 'CMakeLists.txt' from 'tools'.
+
+ See merge request libtiff/libtiff!193
+
+2021-01-03 Miguel Medalha <medalist@sapo.pt>
+
+ Update 'CMakeLists.txt' from 'tools'.
+
+ Update CMakeLists.txt.
+
+2021-01-03 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'usage_info' into 'master'
+ thumbnail: Rename constant variable 'stuff' to 'usage_info'
+
+ See merge request libtiff/libtiff!190
+
+2021-01-03 Miguel Medalha <medalist@sapo.pt>
+
+ Modified 'CMakeLists.txt' to produce a meaningful summary of external codecs support.
+
+ Removed unnecessary reference to compression from usage info for -b parameter
+
+ Constant variable 'stuff' renamed to 'usage_info' for consistency with the other tools
+
+2021-01-02 Roger Leigh <rleigh@codelibre.net>
+
+ Remove non-functional VMS support.
+
+ Remove non-functional WinCE support.
+
+2021-01-02 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'codespell' into 'master'
+ Fix spelling mistakes.
+
+ See merge request libtiff/libtiff!183
+
+2021-01-02 Kurt Schwehr <schwehr@google.com>
+
+ ChangeLog: Remove extraneous character from prior commit - 00fe7828.
+
+2021-01-02 Roger Leigh <rleigh@codelibre.net>
+
+ Merge branch 'codespell-custom_dir_EXIF_231' into 'master'
+ custom_dir_EXIF_231.c: dos2unix and codespell
+
+ See merge request libtiff/libtiff!184
+
+2021-01-01 Roger Leigh <rleigh@codelibre.net>
+
+ mkg3states: Sync generator with current generated file content.
+
+ cmake: Add faxtable and mkg3states targets.
+
+2020-12-31 Kurt Schwehr <schwehr@google.com>
+
+ custom_dir_EXIF_231.c: dos2unix and codespell.
+ additonal, Varable, greather, alwasy
+
+2020-12-31 Kurt Schwehr <schwehr@google.com>
+
+ Fix spelling mistakes.
+ Found with:
+
+ codespell --version
+ 1.17.1
+
+2020-12-29 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'remove-some-vms-ifdef' into 'master'
+ Remove "ifdef VMS" that are no longer necessary.
+
+ See merge request libtiff/libtiff!181
+
+2020-12-29 Kurt Schwehr <schwehr@google.com>
+
+ Remove "ifdef VMS" that are no longer necessary.
+ Both sides of the if are now the same.
+
+2020-12-29 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ _TIFFBuiltinCODECS should be const.
+
+2020-12-28 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'issue-202' into 'master'
+ tiff2pdf.c: check that tiff_datasize fits in a signed tsize_t
+
+ Closes #202
+
+ See merge request libtiff/libtiff!166
+
+2020-12-28 Even Rouault <even.rouault@spatialys.com>
+
+ Merge branch 'w_report-when-libdeflate-is-found' into 'master'
+ CMakeLists.txt: Report when libdeflate is found
+
+ See merge request libtiff/libtiff!175
+
+2020-12-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Declare gpsFields as static const.
+
+2020-12-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Merge branch 'tools-reduce-initialized-data' into 'master'
+ Reduce initialized data by making more data const and simplifying usage() implementation.
+
+ See merge request libtiff/libtiff!180
+
+2020-12-28 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Reduce initialized data by making more data const and simplifying usage() implementation.
+
+2020-12-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Merge branch 'master' into 'master'
+ tiff tools: display of compression methods is now conditional instead of hard-coded
+
+ See merge request libtiff/libtiff!176
+
+2020-12-27 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Merge branch 'build' into 'master'
+ Fix wrong URL for fetching config.guess and config.sub
+
+ See merge request libtiff/libtiff!177
+
+2020-12-26 Chocobo1 <Chocobo1@users.noreply.github.com>
+
+ Fix wrong URL for fetching config.guess and config.sub.
+
+2020-12-25 miguel <medalist@sapo.pt>
+
+ tiff tools: made display of compression methods and their parameters conditional on their actual availability
+
+2020-12-20 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ autogen.sh now updates config.guess and config.sub from master gnulib version.
+
+2020-12-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+
+ Add a https://libtiff.gitlab.io/libtiff/ link.
+
+ Remove stray character in URL area.
+
+ Changes for 4.2.0 release.
+
+ Changes for 4.2.0 release.
+
2020-12-19 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
* libtiff 4.2.0 released.
@@ -469,7 +1365,7 @@
see #17
tiffmedian: shopw usage on stdout when -h is used.
- aslo use EXIT_SUCCESS/EXIT_FAILURE
+ also use EXIT_SUCCESS/EXIT_FAILURE
see #17
tiffinfo: print usage on stdout when -h is used.
@@ -674,7 +1570,7 @@
2020-03-27 Thomas Bernard <miniupnp@free.fr>
tiff2pdf: fix "raw" copy of Deflate streams.
- The Predictor parametter was not copied from the source tiff to the PDF.
+ The Predictor parameter was not copied from the source tiff to the PDF.
fixes #48 / http://bugzilla.maptools.org/show_bug.cgi?id=2442
2020-03-26 Thomas Bernard <miniupnp@free.fr>
@@ -982,7 +1878,7 @@
- EXIF_GPS_upgrade rebased onto c8c5309b765ef4ff097d2aaffbdb8f403db8967d (Merge branch 'Rational2DoublePrecision_correction' into 'master')
and adapted:
- tif_dirinfo.c: All rational tags set to TIFF_SETGET_FLOAT but only the GPSTAG_ tags set to TIFF_SETGET_DOUBLE.
- - custom_dir_EXIF_231.c: Editorials amended and gcc warnigs fixed.
+ - custom_dir_EXIF_231.c: Editorials amended and gcc warnings fixed.
- CMakeLists.txt: add_test(NAME "custom_dir_EXIF_231" COMMAND "custom_dir_EXIF_231") added.
2020-03-07 Even Rouault <even.rouault@spatialys.com>
@@ -1006,7 +1902,7 @@
fix #55
http://bugzilla.maptools.org/show_bug.cgi?id=2505
- Patch originally submited by Ludolf Holzheid <ludolf.holzheid@gmx.de>
+ Patch originally submitted by Ludolf Holzheid <ludolf.holzheid@gmx.de>
2020-03-06 Even Rouault <even.rouault@spatialys.com>
@@ -1129,7 +2025,7 @@
2020-02-29 Su_Laus <sulau@freenet.de>
- tif_dirwrite.c: bugfix DoubleToSrational(), which returns plain signed interger values always as unsigned rationals. Add a test into rational_precision2double.c for "-1.0" and some editorials in tif_dirwrite.c. (code is related to 6df997c786928757caea0dd68d26ea5f098f49df changes).
+ tif_dirwrite.c: bugfix DoubleToSrational(), which returns plain signed integer values always as unsigned rationals. Add a test into rational_precision2double.c for "-1.0" and some editorials in tif_dirwrite.c. (code is related to 6df997c786928757caea0dd68d26ea5f098f49df changes).
2020-02-29 Even Rouault <even.rouault@spatialys.com>
@@ -1174,7 +2070,7 @@
Rational with Double Precision Upgrade.
Unfortunately, custom rational tags (TIFF_RATIONAL with field_bit=FIELD_CUSTOM) are defined as TIFF_SETGET_DOUBLE
- but for the reading interface and LibTiff internally they are stored ALLWAYS as floating point SINGLE precision.
+ but for the reading interface and LibTiff internally they are stored ALWAYS as floating point SINGLE precision.
Double precision custom rational tags are not supported by LibTiff.
For the GPS tags in WGS84 a higher accuracy / precision is needed.
@@ -1269,7 +2165,7 @@
raw2tiff: avoid divide by 0.
fixes #151 / http://bugzilla.maptools.org/show_bug.cgi?id=2839
- first memcmp() lines before computing corellation
+ first memcmp() lines before computing correlation
and always avoid divide by 0 anyway
2020-02-09 Even Rouault <even.rouault@spatialys.com>
@@ -1294,7 +2190,7 @@
tiffcrop.c:4027:20: runtime error: left shift of 190 by 24 places cannot be represented in type 'int'
C treats (byte << 24) as an int expression.
- casting explicitely to unsigned type uint32 avoids the problem.
+ casting explicitly to unsigned type uint32 avoids the problem.
the same issue has been fixed elsewhere with a24213691616e7cd35aa3e2805493de80c7e4fcf
@@ -1523,7 +2419,7 @@
2019-08-25 Even Rouault <even.rouault@spatialys.com>
- JPEG: avoid use of unintialized memory on corrupted files.
+ JPEG: avoid use of uninitialized memory on corrupted files.
Follow-up of cf3ce6fab894414a336546f62adc57f02590a22c
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16602
Credit to OSS Fuzz
@@ -1587,7 +2483,7 @@
signed), which was especially easily triggered on 32-bit builds (with recent
enough compilers that assume that signed multiplication cannot overflow, since
this is undefined behaviour by the C standard). The original issue which lead to
- this fix was trigged from tif_fax3.c
+ this fix was triggered from tif_fax3.c
There were also unsafe (implementation defied), and broken in practice on 64bit
builds, ways of checking that a uint64 fits of a (signed) tmsize_t by doing
@@ -1660,7 +2556,7 @@
- Discussion in https://gitlab.com/libtiff/libtiff/merge_requests/39
- http://bugzilla.maptools.org/show_bug.cgi?id=2540
- Comments and indention adapted.
+ Comments and indentation adapted.
Preparation to rebase onto master
@@ -1680,7 +2576,7 @@
[00:02:58] -- CMAKE_HOST_SYSTEM_PROCESSOR set to AMD64
[00:02:58] -- HOST_FILLORDER set to FILLORDER_MSB2LSB
- Ther reason is that we match the "amd64.*" lowercase string whereas
+ The reason is that we match the "amd64.*" lowercase string whereas
CMAKE_HOST_SYSTEM_PROCESSOR is set to AMD64 uppercase.
2019-07-09 Even Rouault <even.rouault@spatialys.com>
@@ -1690,13 +2586,13 @@
2019-07-09 Even Rouault <even.rouault@spatialys.com>
Merge branch 'fix_chromium_925269' into 'master'
- OJPEG: avoid use of unintialized memory on corrupted files
+ OJPEG: avoid use of uninitialized memory on corrupted files
See merge request libtiff/libtiff!86
2019-07-05 Even Rouault <even.rouault@spatialys.com>
- OJPEG: avoid use of unintialized memory on corrupted files.
+ OJPEG: avoid use of uninitialized memory on corrupted files.
Fixes https://bugs.chromium.org/p/chromium/issues/detail?id=925269
Patch from Lei Zhang with little adaptations.
@@ -1849,12 +2745,12 @@
arrays are only loaded when first accessed. This can speed-up the opening
of files stored on the network when just metadata retrieval is needed.
This mode has been used for years by the GDAL library when compiled with
- its embeded libtiff copy.
+ its embedded libtiff copy.
To avoid potential out-of-tree code (typically codecs) that would use
the td_stripbytecount and td_stripoffset array inconditionnaly assuming they
have been loaded, those have been suffixed with _p (for protected). The
- use of the new functions mentionned below is then recommended.
+ use of the new functions mentioned below is then recommended.
Another addition of this commit is the capability of loading only the
values of the offset/bytecount of the strile of interest instead of the
@@ -1870,7 +2766,7 @@
if a strile is present or not without decompressing the data, or updating
an existing sparse file.
They will also be used to enable a future enhancement where client code can entirely
- skip bytecount loading in some situtations
+ skip bytecount loading in some situations
A new test/defer_strile_loading.c test has been added to test the above
capabilities.
@@ -2141,8 +3037,8 @@
Also the values were not properly calculated. It should be
255-x, 15-x, 3-x for bps 8, 4, 2.
- But anyway it is easyer to invert all bits as 255-x = ~x, etc.
- (substracting from a binary number composed of all 1 is like inverting
+ But anyway it is easier to invert all bits as 255-x = ~x, etc.
+ (subtracting from a binary number composed of all 1 is like inverting
the bits)
2019-02-11 Thomas Bernard <miniupnp@free.fr>
@@ -2670,7 +3566,7 @@
Merge branch 'zstd'
- Add warning about COMPRESSION_ZSTD not being officialy registered.
+ Add warning about COMPRESSION_ZSTD not being officially registered.
2018-02-14 Even Rouault <even.rouault@mines-paris.org>
@@ -2900,7 +3796,7 @@
result, we end up writing past the end of the buffer.
There are also some related issues that this also fixes. For example,
- TIFFGetField can return uninitalized pointer values, and the logic to
+ TIFFGetField can return uninitialized pointer values, and the logic to
detect a N=3 vs N=1 transfer function seemed rather strange.
It is also strange that we declare the transfer functions to be of type
@@ -3315,7 +4211,7 @@
scans and not interleavedin a single one, needs to allocate memory (or
backing store) for the whole strip/tile.
See http://www.libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf
- This limitation may be overriden by setting the
+ This limitation may be overridden by setting the
LIBTIFF_ALLOW_LARGE_LIBJPEG_MEM_ALLOC environment variable, or recompiling
libtiff with a custom value of TIFF_LIBJPEG_LARGEST_MEM_ALLOC macro.
@@ -3598,7 +4494,7 @@
* libtiff/tif_jpeg.c: only run JPEGFixupTagsSubsampling() if the
YCbCrSubsampling tag is not explicitly present. This helps a bit to reduce
- the I/O amount when te tag is present (especially on cloud hosted files).
+ the I/O amount when the tag is present (especially on cloud hosted files).
2017-01-14 Even Rouault <even.rouault at spatialys.com>
@@ -3839,7 +4735,7 @@
2016-12-03 Even Rouault <even.rouault at spatialys.com>
* libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to
- instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
+ instantiate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip),
instead of a logic based on the total size of data. Which is faulty is
the total size of data is not sufficient to fill the whole image, and thus
results in reading outside of the StripByCounts/StripOffsets arrays when
@@ -3863,7 +4759,7 @@
2016-12-02 Even Rouault <even.rouault at spatialys.com>
- * tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips that
+ * tools/tiffcp.c: avoid uint32 underflow in cpDecodedStrips that
can cause various issues, such as buffer overflows in the library.
Reported by Agostino Sarubbo.
Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2598
@@ -4305,7 +5201,7 @@
* libtiff/tif_write.c: TIFFWriteEncodedStrip() and TIFFWriteEncodedTile()
should return -1 in case of failure of tif_encodestrip() as documented
* libtiff/tif_dumpmode.c: DumpModeEncode() should return 0 in case of
- failure so that the above mentionned functions detect the error.
+ failure so that the above mentioned functions detect the error.
2015-12-06 Even Rouault <even.rouault at spatialys.com>
@@ -4328,7 +5224,7 @@
2015-11-22 Even Rouault <even.rouault at spatialys.com>
* libtiff/*.c: fix typos in comments (patch by Kurt Schwehr)
-
+
2015-11-22 Even Rouault <even.rouault at spatialys.com>
* libtiff/*.c: fix MSVC warnings related to cast shortening and
@@ -4896,7 +5792,7 @@
2014-12-27 Even Rouault <even.rouault@spatialys.com>
* libtiff/tif_dir.c: in TIFFDefaultDirectory(), reset any already existing
- extented tags installed by user code through the extender mechaninm before
+ extended tags installed by user code through the extender mechanism before
calling the extender callback (GDAL #5054)
2014-12-26 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
@@ -4999,14 +5895,14 @@
cpStripToTile() (called from writeBufferToContigTiles).
Note that the resulting TIFF file would be scrambled even
if tiffcp wouldn't crash, since the output file would contain
- RGB data intepreted as subsampled YCbCr values.
+ RGB data interpreted as subsampled YCbCr values.
This patch fixes the problem by forcing RGB space on the output
TIF if the input is JPEG-encoded and output is *not* JPEG-encoded.
Author: Tomasz Buchert <tomasz.buchert@inria.fr>
2014-12-21 Even Rouault <even.rouault@spatialys.com>
- Fix various crasher bugs on fuzzed images.
+ Fix various crash bugs on fuzzed images.
* libtiff/tif_dir.c: TIFFSetField(): refuse to set negative values for
TIFFTAG_XRESOLUTION and TIFFTAG_YRESOLUTION that cause asserts when writing
the directory
@@ -5343,7 +6239,7 @@
* libtiff 4.0.2 released.
- * tools/tif2pdf.c, tools/tifdump.c: avoid unitialized variable
+ * tools/tif2pdf.c, tools/tifdump.c: avoid uninitialized variable
warnings with clang.
2012-06-15 Tom Lane <tgl@sss.pgh.pa.us>
@@ -6990,7 +7886,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
Added support for a TIFF_PTRDIFF_T type to use when doing pointer arithmetic.
Added support for a TIFF_SSIZE_T in order to return memory sizes but still
allow returning -1 for errors.
- * libtiff/tiffconf.vc.h: Add porting type defintions for WIN32.
+ * libtiff/tiffconf.vc.h: Add porting type definitions for WIN32.
2007-06-25 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
@@ -7125,7 +8021,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
* libtiff/tif_config.wince.h: Added configuration header for WinCE.
* libtiff/tiffconf.wince.h: Ported old configuration header for WinCE.
* libtiff/tif_wince.c: Added WinCE-specific implementation of some
- functons from tif_win32.c.
+ functions from tif_win32.c.
* libtiff/tif_win32.c: Disabled some functions already reimplemented in tif_wince.c.
* libtiff/tiffiop.h, port/lfind.c: Added conditional include of some
standard header files for Windows CE build.
@@ -7369,7 +8265,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
* libtiff/tif_jpeg.c: strip size related bugfix in encode raw
- * libtiff/tif_strip.c: temporarilly added two new versions of
+ * libtiff/tif_strip.c: temporarily added two new versions of
TIFFScanlineSize
- TIFFNewScanlineSize: proposed new version, after all related
issues and side-effects are sorted out
@@ -7429,7 +8325,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
2006-03-16 Andrey Kiselev <dron@ak4719.spb.edu>
- * libtiff/tiffiop.h: Added decalration for
+ * libtiff/tiffiop.h: Added declaration for
_TIFFSetDefaultCompressionState().
* libtiff/{tif_jpeg.c, tif_fax3.c, tif_zip.c, tif_pixarlog.c,
@@ -7759,7 +8655,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
http://bugzilla.remotesensing.org/show_bug.cgi?id=1003
- * libtiff/tif_dirinfo.c: Correctly yse bsearch() and lfind()
+ * libtiff/tif_dirinfo.c: Correctly use bsearch() and lfind()
functions as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=1008
@@ -7804,7 +8700,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
http://bugzilla.remotesensing.org/show_bug.cgi?id=977
- * tools/tiffsplit.c: Copy fax related fields over splitted parts
+ * tools/tiffsplit.c: Copy fax related fields over split parts
as per bug
http://bugzilla.remotesensing.org/show_bug.cgi?id=983
@@ -7986,12 +8882,12 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
2005-06-07 Andrey Kiselev <dron@ak4719.spb.edu>
* contrib/addtiffo/tif_ovrcache.c: Properly extract tile/strip size;
- use pixel sized shift in contigous case.
+ use pixel sized shift in contiguous case.
2005-06-06 Andrey Kiselev <dron@ak4719.spb.edu>
* contrib/addtiffo/{tif_overview.c, tif_ovrcache.c, tif_ovrcache.h}:
- Make overviews working for contiguos images.
+ Make overviews working for contiguous images.
2005-06-03 Andrey Kiselev <dron@ak4719.spb.edu>
@@ -8421,7 +9317,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
http://bugzilla.remotesensing.org/show_bug.cgi?id=697
- * libtiff/tif_config.in.vc: Removed unneded definitions for
+ * libtiff/tif_config.in.vc: Removed unneeded definitions for
read/open/close/lseek functions to fix the
http://bugzilla.remotesensing.org/show_bug.cgi?id=680
@@ -9280,7 +10176,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
* man/tiff2pdf.1: Few improvements in page layout.
* Makefile.in, /man/Makefile.in, /html/man/tiff2pdf.1.html:
- Added support fpr tiff2pdf manual page.
+ Added support for tiff2pdf manual page.
2003-11-26 Ross Finlayson <libtiff@apexinternetsoftware.com>
@@ -9289,7 +10185,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
2003-11-26 Andrey Kiselev <dron@ak4719.spb.edu>
* Makefile.in, /tools/{Makefile.in, makefile.vc}:
- Added support fpr tiff2pdf utility.
+ Added support for tiff2pdf utility.
2003-11-25 Ross Finlayson <libtiff@apexinternetsoftware.com>
@@ -9332,7 +10228,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
2003-11-17 Andrey Kiselev <dron@ak4719.spb.edu>
* contrib/pds/{tif_pdsdirread.c, tif_pdsdirwrite.c}: Use
- TIFFDataWidth() function insted of tiffDataWidth array.
+ TIFFDataWidth() function instead of tiffDataWidth array.
2003-11-16 Andrey Kiselev <dron@ak4719.spb.edu>
@@ -10119,7 +11015,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
TIFFDataType sizes instead of working with tiffDataWidth array
directly. Should prevent out-of-borders bugs in case of unknown or
broken data types. EstimateStripByteCounts routine modified, so it
- won't work when tags with uknown sizes founded.
+ won't work when tags with unknown sizes founded.
Closes http://bugzilla.remotesensing.org/show_bug.cgi?id=109
2002-03-13 Andrey Kiselev <dron@ak4719.spb.edu>
@@ -10321,7 +11217,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
* libtiff/tif_getimage.c: relax handling of contig case where
there are extra samples that are supposed to be ignored. This
- should now work for 8bit greyscale or palletted images.
+ should now work for 8bit greyscale or paletted images.
http://bugzilla.remotesensing.org/show_bug.cgi?id=75
@@ -10551,7 +11447,7 @@ btiff/tif_win32.c: Replace custom Win32 memory api with generic
2001-02-16 Frank Warmerdam <warmerdam@pobox.com>
* libtiff/libtiff.def: Brent Roman submitted new version adding
- serveral missing entry points.
+ several missing entry points.
* libtiff/tif_dirinfo.c: don't declare tiffFieldInfo static on VMS.
Some sort of weird VMS thing.
@@ -10961,7 +11857,7 @@ Tue Nov 30 14:41:43 1999 Frank Warmerdam <warmerda@gdal.velocet.ca> *** 3.5
Tue Nov 30 14:15:32 EST 1999 Mike Welles <mike@onshore.com>
- * Added zip creation to relase makefile target
+ * Added zip creation to release makefile target
* Added html for TIFFWriteTile.3t man page.
diff --git a/tiff/HOWTO-RELEASE b/tiff/HOWTO-RELEASE
index abcdc9ba..dfadd5cd 100644
--- a/tiff/HOWTO-RELEASE
+++ b/tiff/HOWTO-RELEASE
@@ -25,7 +25,11 @@ Notes on releasing.
1. Commit any unsaved changes.
2. Use gnulib's gitlog-to-changelog script to add new (since the last
- release) entries to the traditional ChangeLog file. Take note of
+ release) entries to the traditional ChangeLog file.
+
+ http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/gitlog-to-changelog
+
+ Take note of
the most recent change note time stamp and use that as the starting
point. Concatenate the old logs to the new logs. The added logs
may be used to help produce the release notes (in next step). For
@@ -43,7 +47,8 @@ Notes on releasing.
4. Add vX.X.html file to the list of 'docfiles' files in the html/Makefile.am.
-5. Update html/index.html to refer to this new page as the current release.
+5. Update html/index.html to refer to this new page as the current release,
+ and update date at the bottom of the page
6. Increment the release version in configure.ac. Put 'alpha' or
'beta' after the version, if applicable. For example:
@@ -140,7 +145,7 @@ Notes on releasing.
17. Copy release packages from the build tree to the
ftp.remotesensing.org ftp site.
- scp tiff-*.tar.gz tiff-*.zip \
+ scp tiff-*.tar.gz tiff-*.tar.gz.sig tiff-*.zip tiff-*.zip.sig \
bfriesen@upload.osgeo.org:/osgeo/download/libtiff
18. Announce to list, tiff@lists.maptools.org
diff --git a/tiff/Makefile.am b/tiff/Makefile.am
index d19e58ee..f34dac2b 100644
--- a/tiff/Makefile.am
+++ b/tiff/Makefile.am
@@ -37,14 +37,11 @@ docfiles = \
VERSION
EXTRA_DIST = \
+ cmake \
CMakeLists.txt \
HOWTO-RELEASE \
- Makefile.vc \
- SConstruct \
autogen.sh \
- configure.com \
- libtiff-4.pc.in \
- nmake.opt
+ libtiff-4.pc.in
dist_doc_DATA = $(docfiles)
diff --git a/tiff/Makefile.in b/tiff/Makefile.in
index a4a7b80c..e272bd7d 100644
--- a/tiff/Makefile.in
+++ b/tiff/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -126,8 +126,9 @@ DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = config.h $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES = libtiff-4.pc
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -194,7 +195,8 @@ am__recursive_targets = \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir distdir-am dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
@@ -215,13 +217,14 @@ ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libtiff-4.pc.in \
- $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(srcdir)/libtiff-4.pc.in $(top_srcdir)/config/compile \
+ $(top_srcdir)/config/config.guess \
$(top_srcdir)/config/config.sub \
$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
$(top_srcdir)/config/missing ChangeLog TODO config/compile \
- config/config.guess config/config.sub config/depcomp \
- config/install-sh config/ltmain.sh config/missing
+ config/config.guess config/config.sub config/install-sh \
+ config/ltmain.sh config/missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -403,6 +406,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -423,14 +427,11 @@ docfiles = \
VERSION
EXTRA_DIST = \
+ cmake \
CMakeLists.txt \
HOWTO-RELEASE \
- Makefile.vc \
- SConstruct \
autogen.sh \
- configure.com \
- libtiff-4.pc.in \
- nmake.opt
+ libtiff-4.pc.in
dist_doc_DATA = $(docfiles)
SUBDIRS = port libtiff tools build contrib test man html
@@ -443,7 +444,8 @@ COVERITY_EMAIL = bfriesen@simple.dallas.tx.us
COVERITY_TARBALL = libtiff.xz
COVERITY_VERSION = devel-${PACKAGE_CHANGE_DATE}
COVERITY_DESCRIPTION = 'libtiff development'
-all: all-recursive
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
.SUFFIXES:
am--refresh: Makefile
@@ -479,6 +481,21 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
libtiff-4.pc: $(top_builddir)/config.status $(srcdir)/libtiff-4.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
@@ -722,10 +739,6 @@ dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
-dist-zstd: distdir
- tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
- $(am__post_remove_distdir)
-
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@@ -767,8 +780,6 @@ distcheck: dist
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
- *.tar.zst*) \
- zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
@@ -838,7 +849,7 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-recursive
-all-am: Makefile $(DATA)
+all-am: Makefile $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
for dir in "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"; do \
@@ -881,8 +892,8 @@ clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-libtool \
- distclean-tags
+distclean-am: clean-am distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags
dvi: dvi-recursive
@@ -944,25 +955,25 @@ ps-am:
uninstall-am: uninstall-dist_docDATA uninstall-pkgconfigDATA
-.MAKE: $(am__recursive_targets) install-am install-strip
+.MAKE: $(am__recursive_targets) all install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
- dist-xz dist-zip dist-zstd distcheck distclean \
- distclean-generic distclean-libtool distclean-tags \
- distcleancheck distdir distuninstallcheck dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dist_docDATA install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-pkgconfigDATA install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am uninstall-dist_docDATA uninstall-pkgconfigDATA
+ dist-xz dist-zip distcheck distclean distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags distcleancheck \
+ distdir distuninstallcheck dvi dvi-am html html-am info \
+ info-am install install-am install-data install-data-am \
+ install-dist_docDATA install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-pkgconfigDATA install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am uninstall-dist_docDATA \
+ uninstall-pkgconfigDATA
.PRECIOUS: Makefile
diff --git a/tiff/Makefile.vc b/tiff/Makefile.vc
deleted file mode 100644
index eeb5d04d..00000000
--- a/tiff/Makefile.vc
+++ /dev/null
@@ -1,60 +0,0 @@
-#
-# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee, provided
-# that (i) the above copyright notices and this permission notice appear in
-# all copies of the software and related documentation, and (ii) the names of
-# Sam Leffler and Silicon Graphics may not be used in any advertising or
-# publicity relating to the software without the specific, prior written
-# permission of Sam Leffler and Silicon Graphics.
-#
-# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-#
-# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
-# Makefile for MS Visual C and Watcom C compilers.
-# Edit nmake.opt file if you want to ajust building options.
-#
-# To build:
-# C:\libtiff> nmake /f makefile.vc
-
-!INCLUDE nmake.opt
-
-all: port lib tools
-
-port::
- cd libtiff
- $(MAKE) /f Makefile.vc tif_config.h
- cd..
- cd port
- $(MAKE) /f Makefile.vc
- cd..
-
-lib: port
- cd libtiff
- $(MAKE) /f Makefile.vc
- cd..
-
-tools: lib
- cd tools
- $(MAKE) /f Makefile.vc
- cd ..
-
-clean:
- cd port
- $(MAKE) /f Makefile.vc clean
- cd..
- cd libtiff
- $(MAKE) /f Makefile.vc clean
- cd..
- cd tools
- $(MAKE) /f Makefile.vc clean
- cd ..
diff --git a/tiff/RELEASE-DATE b/tiff/RELEASE-DATE
index 1137155e..e74bf2b4 100644
--- a/tiff/RELEASE-DATE
+++ b/tiff/RELEASE-DATE
@@ -1 +1 @@
-20201219
+20210416
diff --git a/tiff/SConstruct b/tiff/SConstruct
deleted file mode 100644
index ee87fedf..00000000
--- a/tiff/SConstruct
+++ /dev/null
@@ -1,169 +0,0 @@
-# Tag Image File Format (TIFF) Software
-#
-# Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee, provided
-# that (i) the above copyright notices and this permission notice appear in
-# all copies of the software and related documentation, and (ii) the names of
-# Sam Leffler and Silicon Graphics may not be used in any advertising or
-# publicity relating to the software without the specific, prior written
-# permission of Sam Leffler and Silicon Graphics.
-#
-# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-#
-# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-
-# This file contains rules to build software with the SCons tool
-# (see the http://www.scons.org/ for details on SCons).
-
-import os
-
-env = Environment()
-
-# Read the user supplied options
-opts = Options('libtiff.conf')
-opts.Add(PathOption('PREFIX', \
- 'install architecture-independent files in this directory', \
- '/usr/local', PathOption.PathIsDirCreate))
-opts.Add(BoolOption('ccitt', \
- 'enable support for CCITT Group 3 & 4 algorithms', \
- 'yes'))
-opts.Add(BoolOption('packbits', \
- 'enable support for Macintosh PackBits algorithm', \
- 'yes'))
-opts.Add(BoolOption('lzw', \
- 'enable support for LZW algorithm', \
- 'yes'))
-opts.Add(BoolOption('thunder', \
- 'enable support for ThunderScan 4-bit RLE algorithm', \
- 'yes'))
-opts.Add(BoolOption('next', \
- 'enable support for NeXT 2-bit RLE algorithm', \
- 'yes'))
-opts.Add(BoolOption('logluv', \
- 'enable support for LogLuv high dynamic range encoding', \
- 'yes'))
-opts.Add(BoolOption('strip_chopping', \
- 'support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of ~8Kb to reduce memory usage)', \
- 'yes'))
-opts.Add(BoolOption('extrasample_as_alpha', \
- 'the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don\'t mark the alpha properly', \
- 'yes'))
-opts.Add(BoolOption('check_ycbcr_subsampling', \
- 'disable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag', \
- 'yes'))
-opts.Update(env)
-opts.Save('libtiff.conf', env)
-Help(opts.GenerateHelpText(env))
-
-# Here are our installation paths:
-idir_prefix = '$PREFIX'
-idir_lib = '$PREFIX/lib'
-idir_bin = '$PREFIX/bin'
-idir_inc = '$PREFIX/include'
-idir_doc = '$PREFIX/doc'
-Export([ 'env', 'idir_prefix', 'idir_lib', 'idir_bin', 'idir_inc', 'idir_doc' ])
-
-# Now proceed to system feature checks
-target_cpu, target_vendor, target_kernel, target_os = \
- os.popen("./config/config.guess").readlines()[0].split("-")
-
-def Define(context, key, have):
- import SCons.Conftest
- SCons.Conftest._Have(context, key, have)
-
-def CheckCustomOption(context, name):
- context.Message('Checking is the ' + name + ' option set... ')
- ret = env[name]
- Define(context, name + '_SUPPORT', ret)
- context.Result(ret)
- return ret
-
-def CheckFillorderOption(context):
- context.Message('Checking for the native cpu bit order... ')
- if target_cpu[0] == 'i' and target_cpu[2:] == '86':
- Define(context, 'HOST_FILLORDER', 'FILLORDER_LSB2MSB')
- context.Result('lsb2msb')
- else:
- Define(context, 'HOST_FILLORDER', 'FILLORDER_MSB2LSB')
- context.Result('msb2lsb')
- return 1
-
-def CheckIEEEFPOption(context):
- context.Message('Checking for the IEEE floating point format... ')
- Define(context, 'HAVE_IEEEFP', 1)
- context.Result(1)
- return 1
-
-def CheckOtherOption(context, name):
- context.Message('Checking is the ' + name + ' option set... ')
- ret = env[name]
- Define(context, 'HAVE_' + name, ret)
- context.Result(ret)
- return ret
-
-custom_tests = { \
- 'CheckCustomOption' : CheckCustomOption, \
- 'CheckFillorderOption' : CheckFillorderOption, \
- 'CheckIEEEFPOption' : CheckIEEEFPOption, \
- 'CheckOtherOption' : CheckOtherOption \
- }
-conf = Configure(env, custom_tests = custom_tests, \
- config_h = 'libtiff/tif_config.h')
-
-# Check for standard library
-conf.CheckLib('c')
-if target_os != 'cygwin' \
- and target_os != 'mingw32' \
- and target_os != 'beos' \
- and target_os != 'darwin':
- conf.CheckLib('m')
-
-# Check for system headers
-conf.CheckCHeader('assert.h')
-conf.CheckCHeader('fcntl.h')
-conf.CheckCHeader('io.h')
-conf.CheckCHeader('limits.h')
-conf.CheckCHeader('malloc.h')
-conf.CheckCHeader('search.h')
-conf.CheckCHeader('sys/time.h')
-conf.CheckCHeader('unistd.h')
-
-# Check for standard library functions
-conf.CheckFunc('floor')
-conf.CheckFunc('isascii')
-conf.CheckFunc('memmove')
-conf.CheckFunc('memset')
-conf.CheckFunc('mmap')
-conf.CheckFunc('pow')
-conf.CheckFunc('setmode')
-conf.CheckFunc('sqrt')
-conf.CheckFunc('strchr')
-conf.CheckFunc('strrchr')
-conf.CheckFunc('strstr')
-conf.CheckFunc('strtol')
-
-conf.CheckFillorderOption()
-conf.CheckIEEEFPOption()
-conf.CheckCustomOption('ccitt')
-conf.CheckCustomOption('packbits')
-conf.CheckCustomOption('lzw')
-conf.CheckCustomOption('thunder')
-conf.CheckCustomOption('next')
-conf.CheckCustomOption('logluv')
-conf.CheckOtherOption('strip_chopping')
-conf.CheckOtherOption('extrasample_as_alpha')
-conf.CheckOtherOption('check_ycbcr_subsampling')
-
-env = conf.Finish()
-
-# Ok, now go to build files in the subdirectories
-SConscript(dirs = [ 'libtiff' ], name = 'SConstruct')
diff --git a/tiff/VERSION b/tiff/VERSION
index 6aba2b24..80895903 100644
--- a/tiff/VERSION
+++ b/tiff/VERSION
@@ -1 +1 @@
-4.2.0
+4.3.0
diff --git a/tiff/aclocal.m4 b/tiff/aclocal.m4
index 3ba29cd2..9299d04d 100644
--- a/tiff/aclocal.m4
+++ b/tiff/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.16.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2020 Free Software Foundation, Inc.
+# Copyright (C) 2002-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.16.2], [],
+m4_if([$1], [1.16.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.16.2])dnl
+[AM_AUTOMAKE_VERSION([1.16.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -332,7 +332,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -371,9 +371,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
done
if test $am_rc -ne 0; then
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. If GNU make was not used, consider
- re-running the configure script with MAKE="gmake" (or whatever is
- necessary). You can also try re-running configure with the
+ for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).])
fi
@@ -400,7 +398,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -597,7 +595,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -618,7 +616,7 @@ if test x"${install_sh+set}" != xset; then
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2020 Free Software Foundation, Inc.
+# Copyright (C) 2003-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -640,7 +638,7 @@ AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -675,7 +673,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -718,7 +716,7 @@ AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2020 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -757,7 +755,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -786,7 +784,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2020 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -833,7 +831,7 @@ AC_LANG_POP([C])])
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -852,7 +850,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2020 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -933,7 +931,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file
])
-# Copyright (C) 2009-2020 Free Software Foundation, Inc.
+# Copyright (C) 2009-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -993,7 +991,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2020 Free Software Foundation, Inc.
+# Copyright (C) 2001-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1021,7 +1019,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2020 Free Software Foundation, Inc.
+# Copyright (C) 2006-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -1040,7 +1038,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2020 Free Software Foundation, Inc.
+# Copyright (C) 2004-2018 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
diff --git a/tiff/autogen.sh b/tiff/autogen.sh
index 56338850..9ef71b53 100755
--- a/tiff/autogen.sh
+++ b/tiff/autogen.sh
@@ -5,4 +5,16 @@ aclocal -I ./m4
autoheader
automake --foreign --add-missing --copy
autoconf
-
+# Get latest config.guess and config.sub from upstream master since
+# these are often out of date.
+for file in config.guess config.sub
+do
+ echo "$0: getting $file..."
+ wget -q --timeout=5 -O config/$file.tmp \
+ "https://git.savannah.gnu.org/cgit/config.git/plain/${file}" \
+ && mv config/$file.tmp config/$file \
+ && chmod a+x config/$file
+ retval=$?
+ rm -f config/$file.tmp
+ test $retval -eq 0 || exit $retval
+done
diff --git a/tiff/build/CMakeLists.txt b/tiff/build/CMakeLists.txt
index d44c6eac..756fb716 100644
--- a/tiff/build/CMakeLists.txt
+++ b/tiff/build/CMakeLists.txt
@@ -21,5 +21,3 @@
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-
-extra_dist(README)
diff --git a/tiff/build/Makefile.in b/tiff/build/Makefile.in
index d0893046..148f618f 100644
--- a/tiff/build/Makefile.in
+++ b/tiff/build/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -123,8 +123,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -348,6 +350,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/tiff/cmake/AutotoolsCompat.cmake b/tiff/cmake/AutotoolsCompat.cmake
new file mode 100644
index 00000000..f491a8a1
--- /dev/null
+++ b/tiff/cmake/AutotoolsCompat.cmake
@@ -0,0 +1,32 @@
+# Autotools compatibility
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+# For autotools header compatibility
+set(PACKAGE_NAME "LibTIFF Software")
+set(PACKAGE_TARNAME "${PROJECT_NAME}")
+set(PACKAGE_VERSION "${PROJECT_VERSION}${LIBTIFF_ALPHA_VERSION}")
+set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
+set(PACKAGE_BUGREPORT "tiff@lists.maptools.org")
diff --git a/tiff/cmake/AutotoolsVersion.cmake b/tiff/cmake/AutotoolsVersion.cmake
new file mode 100644
index 00000000..0f660878
--- /dev/null
+++ b/tiff/cmake/AutotoolsVersion.cmake
@@ -0,0 +1,50 @@
+# Read version information from configure.ac.
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+# Get version from configure.ac
+FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" configure REGEX "^LIBTIFF_.*=")
+foreach(line ${configure})
+ foreach(var LIBTIFF_MAJOR_VERSION LIBTIFF_MINOR_VERSION LIBTIFF_MICRO_VERSION LIBTIFF_ALPHA_VERSION
+ LIBTIFF_CURRENT LIBTIFF_REVISION LIBTIFF_AGE)
+ if(NOT ${var} AND line MATCHES "^${var}=(.*)")
+ set(${var} "${CMAKE_MATCH_1}")
+ break()
+ endif()
+ endforeach()
+endforeach()
+
+# Package version
+set(LIBTIFF_VERSION "${LIBTIFF_MAJOR_VERSION}.${LIBTIFF_MINOR_VERSION}.${LIBTIFF_MICRO_VERSION}")
+set(LIBTIFF_VERSION_FULL "${LIBTIFF_VERSION}${LIBTIFF_ALPHA_VERSION}")
+
+# Convert the libtool version variables to proper major and minor versions
+math(EXPR SO_MAJOR "${LIBTIFF_CURRENT} - ${LIBTIFF_AGE}")
+set(SO_MINOR "${LIBTIFF_AGE}")
+set(SO_REVISION "${LIBTIFF_REVISION}")
+
+# Library version (unlike libtool's baroque scheme, WYSIWYG here)
+set(SO_COMPATVERSION "${SO_MAJOR}")
+set(SO_VERSION "${SO_MAJOR}.${SO_MINOR}.${SO_REVISION}")
diff --git a/tiff/contrib/ras/CMakeLists.txt b/tiff/cmake/CXXLibrary.cmake
index b19a04fa..3fc15a98 100644
--- a/tiff/contrib/ras/CMakeLists.txt
+++ b/tiff/cmake/CXXLibrary.cmake
@@ -1,6 +1,7 @@
-# CMake build for libtiff
+# C++ library option
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
@@ -22,7 +23,10 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-extra_dist(
- README
- ras2tif.c
- tif2ras.c)
+# C++ support
+option(cxx "Enable C++ stream API building (requires C++ compiler)" ON)
+set(CXX_SUPPORT FALSE)
+if (cxx)
+ enable_language(CXX)
+ set(CXX_SUPPORT TRUE)
+endif()
diff --git a/tiff/cmake/CompilerChecks.cmake b/tiff/cmake/CompilerChecks.cmake
new file mode 100644
index 00000000..8ac5564b
--- /dev/null
+++ b/tiff/cmake/CompilerChecks.cmake
@@ -0,0 +1,124 @@
+# Compiler feature checks
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+include(CheckCCompilerFlag)
+
+
+# These are annoyingly verbose, produce false positives or don't work
+# nicely with all supported compiler versions, so are disabled unless
+# explicitly enabled.
+option(extra-warnings "Enable extra compiler warnings" OFF)
+
+# This will cause the compiler to fail when an error occurs.
+option(fatal-warnings "Compiler warnings are errors" OFF)
+
+# Check if the compiler supports each of the following additional
+# flags, and enable them if supported. This greatly improves the
+# quality of the build by checking for a number of common problems,
+# some of which are quite serious.
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
+ CMAKE_C_COMPILER_ID MATCHES "Clang")
+ set(test_flags
+ -Wall
+ -Winline
+ -Wformat-security
+ -Wpointer-arith
+ -Wdisabled-optimization
+ -Wno-unknown-pragmas
+ -fstrict-aliasing)
+ if(extra-warnings)
+ list(APPEND test_flags
+ -pedantic
+ -Wextra
+ -Wformat
+ -Wformat-overflow
+ -Wformat-nonliteral
+ -Wformat-signedness
+ -Wformat-truncation
+ -Wdeclaration-after-statement
+ -Wconversion
+ -Wsign-conversion
+ -Wnull-dereference
+ -Wdouble-promotion
+ -Wmisleading-indentation
+ -Wmissing-include-dirs
+ -Wswitch-default
+ -Wswitch-enum
+ -Wunused-local-typedefs
+ -Wunused-parameter
+ -Wuninitialized
+ -Warith-conversion
+ -Wbool-operation
+ -Wduplicated-branches
+ -Wduplicated-cond
+ -Wshadow
+ -Wunused-macros
+ -Wc99-c11-compat
+ -Wcast-qual
+ -Wcast-align
+ -Wwrite-strings
+ -Wdangling-else
+ -Wsizeof-array-div
+ -Wsizeof-pointer-div
+ -Wsizeof-pointer-memaccess
+ -Wlogical-op
+ -Wlogical-not-parentheses
+ -Wstrict-prototypes
+ -Wmissing-declarations
+ -Wredundant-decls
+ -Wno-int-to-pointer-cast
+ -Wfloat-equal
+ -Wfloat-conversion
+ -Wmissing-prototypes
+ -Wunreachable-code)
+ endif()
+ if(fatal-warnings)
+ list(APPEND test_flags
+ -Werror)
+ endif()
+elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
+ set(test_flags)
+ if(extra-warnings)
+ list(APPEND test_flags
+ /W4)
+ else()
+ list(APPEND test_flags
+ /W3)
+ endif()
+ if (fatal-warnings)
+ list(APPEND test_flags
+ /WX)
+ endif()
+endif()
+
+foreach(flag ${test_flags})
+ string(REGEX REPLACE "[^A-Za-z0-9]" "_" flag_var "${flag}")
+ set(test_c_flag "C_FLAG${flag_var}")
+ CHECK_C_COMPILER_FLAG(${flag} "${test_c_flag}")
+ if (${test_c_flag})
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
+ endif (${test_c_flag})
+endforeach(flag ${test_flags})
diff --git a/tiff/cmake/DeflateCodec.cmake b/tiff/cmake/DeflateCodec.cmake
new file mode 100644
index 00000000..76e5673e
--- /dev/null
+++ b/tiff/cmake/DeflateCodec.cmake
@@ -0,0 +1,45 @@
+# Checks for deflate codec support
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+# ZLIB
+set(ZLIB_SUPPORT FALSE)
+find_package(ZLIB)
+option(zlib "use zlib (required for Deflate compression)" ${ZLIB_FOUND})
+if(zlib AND ZLIB_FOUND)
+ set(ZLIB_SUPPORT TRUE)
+endif()
+set(ZIP_SUPPORT ${ZLIB_SUPPORT})
+
+# libdeflate
+set(LIBDEFLATE_SUPPORT FALSE)
+find_package(Deflate)
+option(libdeflate "use libdeflate (optional for faster Deflate support, still requires zlib)" ${Deflate_FOUND})
+if (libdeflate AND Deflate_FOUND AND ZIP_SUPPORT)
+ set(LIBDEFLATE_SUPPORT TRUE)
+endif()
+if(Deflate_FOUND AND NOT ZIP_SUPPORT)
+ message(WARNING "libdeflate available but zlib is not. libdeflate cannot be used")
+endif()
diff --git a/tiff/cmake/FindCMath.cmake b/tiff/cmake/FindCMath.cmake
new file mode 100644
index 00000000..2da3b7f1
--- /dev/null
+++ b/tiff/cmake/FindCMath.cmake
@@ -0,0 +1,72 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindCMath
+--------
+
+Find the native CMath includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``CMath::CMath``, if
+CMath has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ CMath_INCLUDE_DIRS - Where to find math.h
+ CMath_LIBRARIES - List of libraries when using CMath.
+ CMath_FOUND - True if CMath found.
+
+#]=======================================================================]
+
+
+include(CheckSymbolExists)
+include(CheckLibraryExists)
+
+check_symbol_exists(pow "math.h" CMath_HAVE_LIBC_POW)
+if(NOT CMath_HAVE_LIBC_POW)
+ find_library(CMath_LIBRARY NAMES m)
+
+ set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${CMath_LIBRARY})
+ check_symbol_exists(pow "math.h" CMath_HAVE_LIBM_POW)
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
+endif()
+
+set(CMath_pow FALSE)
+if(CMath_HAVE_LIBC_POW OR CMath_HAVE_LIBM_POW)
+ set(CMath_pow TRUE)
+endif()
+
+set(CMath_INCLUDE_DIRS)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(CMath REQUIRED_VARS CMath_pow)
+
+if(CMath_FOUND)
+ if(NOT CMath_INCLUDE_DIRS)
+ set(CMath_INCLUDE_DIRS)
+ endif()
+ if(NOT CMath_LIBRARIES)
+ if (CMath_LIBRARY)
+ set(CMath_LIBRARIES ${CMath_LIBRARY})
+ endif()
+ endif()
+
+ if(NOT TARGET CMath::CMath)
+ if(CMath_LIBRARIES)
+ add_library(CMath::CMath UNKNOWN IMPORTED)
+ set_target_properties(CMath::CMath PROPERTIES
+ IMPORTED_LOCATION "${CMath_LIBRARY}")
+ else()
+ add_library(CMath::CMath INTERFACE IMPORTED)
+ endif()
+ endif()
+endif()
diff --git a/tiff/cmake/FindDeflate.cmake b/tiff/cmake/FindDeflate.cmake
new file mode 100644
index 00000000..ef6a5765
--- /dev/null
+++ b/tiff/cmake/FindDeflate.cmake
@@ -0,0 +1,116 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindDeflate
+--------
+
+Find the native Deflate includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``Deflate::Deflate``, if
+Deflate has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ Deflate_INCLUDE_DIRS - where to find deflate.h, etc.
+ Deflate_LIBRARIES - List of libraries when using deflate.
+ Deflate_FOUND - True if deflate found.
+
+::
+
+ Deflate_VERSION_STRING - The version of deflate found (x.y.z)
+ Deflate_VERSION_MAJOR - The major version of deflate
+ Deflate_VERSION_MINOR - The minor version of deflate
+
+ Debug and Release variants are found separately.
+#]=======================================================================]
+
+# Standard names to search for
+set(Deflate_NAMES deflate deflatestatic)
+set(Deflate_NAMES_DEBUG deflated deflatestaticd)
+
+find_path(Deflate_INCLUDE_DIR
+ NAMES libdeflate.h
+ PATH_SUFFIXES include)
+
+set(Deflate_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
+# Library has a "lib" prefix even on Windows.
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
+
+# Allow Deflate_LIBRARY to be set manually, as the location of the deflate library
+if(NOT Deflate_LIBRARY)
+ find_library(Deflate_LIBRARY_RELEASE
+ NAMES ${Deflate_NAMES}
+ PATH_SUFFIXES lib)
+ find_library(Deflate_LIBRARY_DEBUG
+ NAMES ${Deflate_NAMES_DEBUG}
+ PATH_SUFFIXES lib)
+
+ include(SelectLibraryConfigurations)
+ select_library_configurations(Deflate)
+endif()
+
+set(CMAKE_FIND_LIBRARY_PREFIXES "${Deflate_OLD_FIND_LIBRARY_PREFIXES}")
+
+unset(Deflate_NAMES)
+unset(Deflate_NAMES_DEBUG)
+unset(Deflate_OLD_FIND_LIBRARY_PREFIXES)
+
+mark_as_advanced(Deflate_INCLUDE_DIR)
+
+if(Deflate_INCLUDE_DIR AND EXISTS "${Deflate_INCLUDE_DIR}/deflate.h")
+ file(STRINGS "${Deflate_INCLUDE_DIR}/libdeflate.h" Deflate_H REGEX "^#define LIBDEFLATE_VERSION_STRING\s+\"[^\"]*\"$")
+
+ string(REGEX REPLACE "^.*Deflate_VERSION \"([0-9]+).*$" "\\1" Deflate_MAJOR_VERSION "${Deflate_H}")
+ string(REGEX REPLACE "^.*Deflate_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" Deflate_MINOR_VERSION "${Deflate_H}")
+ set(Deflate_VERSION_STRING "${Deflate_MAJOR_VERSION}.${Deflate_MINOR_VERSION}")
+
+ set(Deflate_MAJOR_VERSION "${Deflate_VERSION_MAJOR}")
+ set(Deflate_MINOR_VERSION "${Deflate_VERSION_MINOR}")
+endif()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Deflate
+ REQUIRED_VARS Deflate_LIBRARY Deflate_INCLUDE_DIR
+ VERSION_VAR Deflate_VERSION_STRING)
+
+if(Deflate_FOUND)
+ set(Deflate_INCLUDE_DIRS ${Deflate_INCLUDE_DIR})
+
+ if(NOT Deflate_LIBRARIES)
+ set(Deflate_LIBRARIES ${Deflate_LIBRARY})
+ endif()
+
+ if(NOT TARGET Deflate::Deflate)
+ add_library(Deflate::Deflate UNKNOWN IMPORTED)
+ set_target_properties(Deflate::Deflate PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${Deflate_INCLUDE_DIRS}")
+
+ if(Deflate_LIBRARY_RELEASE)
+ set_property(TARGET Deflate::Deflate APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(Deflate::Deflate PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${Deflate_LIBRARY_RELEASE}")
+ endif()
+
+ if(Deflate_LIBRARY_DEBUG)
+ set_property(TARGET Deflate::Deflate APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(Deflate::Deflate PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${Deflate_LIBRARY_DEBUG}")
+ endif()
+
+ if(NOT Deflate_LIBRARY_RELEASE AND NOT Deflate_LIBRARY_DEBUG)
+ set_target_properties(Deflate::Deflate PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${Deflate_LIBRARY}")
+ endif()
+ endif()
+endif()
diff --git a/tiff/cmake/FindJBIG.cmake b/tiff/cmake/FindJBIG.cmake
new file mode 100644
index 00000000..f0c232c3
--- /dev/null
+++ b/tiff/cmake/FindJBIG.cmake
@@ -0,0 +1,116 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindJBIG
+--------
+
+Find the native JBIG includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``JBIG::JBIG``, if
+JBIG has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ JBIG_INCLUDE_DIRS - where to find jbig.h, etc.
+ JBIG_LIBRARIES - List of libraries when using jbig.
+ JBIG_FOUND - True if jbig found.
+
+::
+
+ JBIG_VERSION_STRING - The version of jbig found (x.y.z)
+ JBIG_VERSION_MAJOR - The major version of jbig
+ JBIG_VERSION_MINOR - The minor version of jbig
+
+ Debug and Release variants are found separately.
+#]=======================================================================]
+
+# Standard names to search for
+set(JBIG_NAMES jbig)
+set(JBIG_NAMES_DEBUG jbigd)
+
+find_path(JBIG_INCLUDE_DIR
+ NAMES jbig.h
+ PATH_SUFFIXES include)
+
+set(JBIG_OLD_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
+# Library has a "lib" prefix even on Windows.
+set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
+
+# Allow JBIG_LIBRARY to be set manually, as the location of the jbig library
+if(NOT JBIG_LIBRARY)
+ find_library(JBIG_LIBRARY_RELEASE
+ NAMES ${JBIG_NAMES}
+ PATH_SUFFIXES lib)
+ find_library(JBIG_LIBRARY_DEBUG
+ NAMES ${JBIG_NAMES_DEBUG}
+ PATH_SUFFIXES lib)
+
+ include(SelectLibraryConfigurations)
+ select_library_configurations(JBIG)
+endif()
+
+set(CMAKE_FIND_LIBRARY_PREFIXES "${JBIG_OLD_FIND_LIBRARY_PREFIXES}")
+
+unset(JBIG_NAMES)
+unset(JBIG_NAMES_DEBUG)
+unset(JBIG_OLD_FIND_LIBRARY_PREFIXES)
+
+mark_as_advanced(JBIG_INCLUDE_DIR)
+
+if(JBIG_INCLUDE_DIR AND EXISTS "${JBIG_INCLUDE_DIR}/jbig.h")
+ file(STRINGS "${JBIG_INCLUDE_DIR}/jbig.h" JBIG_H REGEX "^#define JBG_VERSION *\"[^\"]*\"$")
+
+ string(REGEX REPLACE "^.*JBG_VERSION *\"([0-9]+).*$" "\\1" JBIG_MAJOR_VERSION "${JBIG_H}")
+ string(REGEX REPLACE "^.*JBG_VERSION *\"[0-9]+\\.([0-9]+).*$" "\\1" JBIG_MINOR_VERSION "${JBIG_H}")
+ set(JBIG_VERSION_STRING "${JBIG_MAJOR_VERSION}.${JBIG_MINOR_VERSION}")
+
+ set(JBIG_MAJOR_VERSION "${JBIG_VERSION_MAJOR}")
+ set(JBIG_MINOR_VERSION "${JBIG_VERSION_MINOR}")
+endif()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(JBIG
+ REQUIRED_VARS JBIG_LIBRARY JBIG_INCLUDE_DIR
+ VERSION_VAR JBIG_VERSION_STRING)
+
+if(JBIG_FOUND)
+ set(JBIG_INCLUDE_DIRS ${JBIG_INCLUDE_DIR})
+
+ if(NOT JBIG_LIBRARIES)
+ set(JBIG_LIBRARIES ${JBIG_LIBRARY})
+ endif()
+
+ if(NOT TARGET JBIG::JBIG)
+ add_library(JBIG::JBIG UNKNOWN IMPORTED)
+ set_target_properties(JBIG::JBIG PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${JBIG_INCLUDE_DIRS}")
+
+ if(JBIG_LIBRARY_RELEASE)
+ set_property(TARGET JBIG::JBIG APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(JBIG::JBIG PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${JBIG_LIBRARY_RELEASE}")
+ endif()
+
+ if(JBIG_LIBRARY_DEBUG)
+ set_property(TARGET JBIG::JBIG APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(JBIG::JBIG PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${JBIG_LIBRARY_DEBUG}")
+ endif()
+
+ if(NOT JBIG_LIBRARY_RELEASE AND NOT JBIG_LIBRARY_DEBUG)
+ set_target_properties(JBIG::JBIG PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${JBIG_LIBRARY}")
+ endif()
+ endif()
+endif()
diff --git a/tiff/cmake/FindJPEG.cmake b/tiff/cmake/FindJPEG.cmake
new file mode 100644
index 00000000..12d0844b
--- /dev/null
+++ b/tiff/cmake/FindJPEG.cmake
@@ -0,0 +1,142 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindJPEG
+--------
+
+Find the Joint Photographic Experts Group (JPEG) library (``libjpeg``)
+
+Imported targets
+^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.12
+
+This module defines the following :prop_tgt:`IMPORTED` targets:
+
+``JPEG::JPEG``
+ The JPEG library, if found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``JPEG_FOUND``
+ If false, do not try to use JPEG.
+``JPEG_INCLUDE_DIRS``
+ where to find jpeglib.h, etc.
+``JPEG_LIBRARIES``
+ the libraries needed to use JPEG.
+``JPEG_VERSION``
+ .. versionadded:: 3.12
+ the version of the JPEG library found
+
+Cache variables
+^^^^^^^^^^^^^^^
+
+The following cache variables may also be set:
+
+``JPEG_INCLUDE_DIRS``
+ where to find jpeglib.h, etc.
+``JPEG_LIBRARY_RELEASE``
+ where to find the JPEG library (optimized).
+``JPEG_LIBRARY_DEBUG``
+ where to find the JPEG library (debug).
+
+.. versionadded:: 3.12
+ Debug and Release variand are found separately.
+
+Obsolete variables
+^^^^^^^^^^^^^^^^^^
+
+``JPEG_INCLUDE_DIR``
+ where to find jpeglib.h, etc. (same as JPEG_INCLUDE_DIRS)
+``JPEG_LIBRARY``
+ where to find the JPEG library.
+#]=======================================================================]
+
+find_path(JPEG_INCLUDE_DIR jpeglib.h)
+
+set(jpeg_names ${JPEG_NAMES} jpeg jpeg-static libjpeg libjpeg-static turbojpeg turbojpeg-static)
+foreach(name ${jpeg_names})
+ list(APPEND jpeg_names_debug "${name}d")
+endforeach()
+
+if(NOT JPEG_LIBRARY)
+ find_library(JPEG_LIBRARY_RELEASE NAMES ${jpeg_names} NAMES_PER_DIR)
+ find_library(JPEG_LIBRARY_DEBUG NAMES ${jpeg_names_debug} NAMES_PER_DIR)
+ include(SelectLibraryConfigurations)
+ select_library_configurations(JPEG)
+ mark_as_advanced(JPEG_LIBRARY_RELEASE JPEG_LIBRARY_DEBUG)
+endif()
+unset(jpeg_names)
+unset(jpeg_names_debug)
+
+if(JPEG_INCLUDE_DIR)
+ file(GLOB _JPEG_CONFIG_HEADERS_FEDORA "${JPEG_INCLUDE_DIR}/jconfig*.h")
+ file(GLOB _JPEG_CONFIG_HEADERS_DEBIAN "${JPEG_INCLUDE_DIR}/*/jconfig.h")
+ set(_JPEG_CONFIG_HEADERS
+ "${JPEG_INCLUDE_DIR}/jpeglib.h"
+ ${_JPEG_CONFIG_HEADERS_FEDORA}
+ ${_JPEG_CONFIG_HEADERS_DEBIAN})
+ foreach (_JPEG_CONFIG_HEADER IN LISTS _JPEG_CONFIG_HEADERS)
+ if (NOT EXISTS "${_JPEG_CONFIG_HEADER}")
+ continue ()
+ endif ()
+ file(STRINGS "${_JPEG_CONFIG_HEADER}"
+ jpeg_lib_version REGEX "^#define[\t ]+JPEG_LIB_VERSION[\t ]+.*")
+
+ if (NOT jpeg_lib_version)
+ continue ()
+ endif ()
+
+ string(REGEX REPLACE "^#define[\t ]+JPEG_LIB_VERSION[\t ]+([0-9]+).*"
+ "\\1" JPEG_VERSION "${jpeg_lib_version}")
+ break ()
+ endforeach ()
+ unset(jpeg_lib_version)
+ unset(_JPEG_CONFIG_HEADER)
+ unset(_JPEG_CONFIG_HEADERS)
+ unset(_JPEG_CONFIG_HEADERS_FEDORA)
+ unset(_JPEG_CONFIG_HEADERS_DEBIAN)
+endif()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(JPEG
+ REQUIRED_VARS JPEG_LIBRARY JPEG_INCLUDE_DIR
+ VERSION_VAR JPEG_VERSION)
+
+if(JPEG_FOUND)
+ set(JPEG_LIBRARIES ${JPEG_LIBRARY})
+ set(JPEG_INCLUDE_DIRS "${JPEG_INCLUDE_DIR}")
+
+ if(NOT TARGET JPEG::JPEG)
+ add_library(JPEG::JPEG UNKNOWN IMPORTED)
+ if(JPEG_INCLUDE_DIRS)
+ set_target_properties(JPEG::JPEG PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${JPEG_INCLUDE_DIRS}")
+ endif()
+ if(EXISTS "${JPEG_LIBRARY}")
+ set_target_properties(JPEG::JPEG PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${JPEG_LIBRARY}")
+ endif()
+ if(EXISTS "${JPEG_LIBRARY_RELEASE}")
+ set_property(TARGET JPEG::JPEG APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(JPEG::JPEG PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C"
+ IMPORTED_LOCATION_RELEASE "${JPEG_LIBRARY_RELEASE}")
+ endif()
+ if(EXISTS "${JPEG_LIBRARY_DEBUG}")
+ set_property(TARGET JPEG::JPEG APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(JPEG::JPEG PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C"
+ IMPORTED_LOCATION_DEBUG "${JPEG_LIBRARY_DEBUG}")
+ endif()
+ endif()
+endif()
+
+mark_as_advanced(JPEG_LIBRARY JPEG_INCLUDE_DIR)
diff --git a/tiff/cmake/FindLERC.cmake b/tiff/cmake/FindLERC.cmake
new file mode 100644
index 00000000..ade742a1
--- /dev/null
+++ b/tiff/cmake/FindLERC.cmake
@@ -0,0 +1,86 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindLerc
+--------
+
+Find the native Lerc includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``LERC::LERC``, if
+CMath has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ LERC_INCLUDE_DIRS - where to find Lerc_c_api.h, etc.
+ LERC_LIBRARIES - List of libraries when using LERC.
+ LERC_FOUND - True if LERC found.
+
+#]=======================================================================]
+
+# Standard names to search for
+set(LERC_NAMES LercLib Lerc)
+
+find_path(LERC_INCLUDE_DIR
+ NAMES Lerc_c_api.h
+ PATH_SUFFIXES include)
+
+# Allow LERC_LIBRARY to be set manually, as the location of the deflate library
+if(NOT LERC_LIBRARY)
+ find_library(LERC_LIBRARY_RELEASE
+ NAMES ${LERC_NAMES}
+ PATH_SUFFIXES lib)
+
+ include(SelectLibraryConfigurations)
+ select_library_configurations(LERC)
+endif()
+
+unset(LERC_NAMES)
+
+mark_as_advanced(LERC_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LERC
+ REQUIRED_VARS LERC_LIBRARY LERC_INCLUDE_DIR
+ VERSION_VAR LERC_VERSION_STRING)
+
+if(LERC_FOUND)
+ set(LERC_INCLUDE_DIRS ${LERC_INCLUDE_DIR})
+
+ if(NOT LERC_LIBRARIES)
+ set(LERC_LIBRARIES ${LERC_LIBRARY})
+ endif()
+
+ if(NOT TARGET LERC::LERC)
+ add_library(LERC::LERC UNKNOWN IMPORTED)
+ set_target_properties(LERC::LERC PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${LERC_INCLUDE_DIRS}")
+
+ if(LERC_LIBRARY_RELEASE)
+ set_property(TARGET LERC::LERC APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(LERC::LERC PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${LERC_LIBRARY_RELEASE}")
+ endif()
+
+ if(LERC_LIBRARY_DEBUG)
+ set_property(TARGET LERC::LERC APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(LERC::LERC PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${LERC_LIBRARY_DEBUG}")
+ endif()
+
+ if(NOT LERC_LIBRARY_RELEASE AND NOT LERC_LIBRARY_DEBUG)
+ set_target_properties(LERC::LERC PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${LERC_LIBRARY}")
+ endif()
+ endif()
+endif()
diff --git a/tiff/cmake/FindLibLZMA.cmake b/tiff/cmake/FindLibLZMA.cmake
new file mode 100644
index 00000000..3042bac9
--- /dev/null
+++ b/tiff/cmake/FindLibLZMA.cmake
@@ -0,0 +1,126 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindLibLZMA
+-----------
+
+Find LZMA compression algorithm headers and library.
+
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+.. versionadded:: 3.14
+
+This module defines :prop_tgt:`IMPORTED` target ``LibLZMA::LibLZMA``, if
+liblzma has been found.
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
+
+``LIBLZMA_FOUND``
+ True if liblzma headers and library were found.
+``LIBLZMA_INCLUDE_DIRS``
+ Directory where liblzma headers are located.
+``LIBLZMA_LIBRARIES``
+ Lzma libraries to link against.
+``LIBLZMA_HAS_AUTO_DECODER``
+ True if lzma_auto_decoder() is found (required).
+``LIBLZMA_HAS_EASY_ENCODER``
+ True if lzma_easy_encoder() is found (required).
+``LIBLZMA_HAS_LZMA_PRESET``
+ True if lzma_lzma_preset() is found (required).
+``LIBLZMA_VERSION_MAJOR``
+ The major version of lzma
+``LIBLZMA_VERSION_MINOR``
+ The minor version of lzma
+``LIBLZMA_VERSION_PATCH``
+ The patch version of lzma
+``LIBLZMA_VERSION_STRING``
+ version number as a string (ex: "5.0.3")
+#]=======================================================================]
+
+find_path(LIBLZMA_INCLUDE_DIR lzma.h )
+if(NOT LIBLZMA_LIBRARY)
+ find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma liblzma NAMES_PER_DIR PATH_SUFFIXES lib)
+ find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzmad liblzmad NAMES_PER_DIR PATH_SUFFIXES lib)
+ include(SelectLibraryConfigurations)
+ select_library_configurations(LIBLZMA)
+else()
+ file(TO_CMAKE_PATH "${LIBLZMA_LIBRARY}" LIBLZMA_LIBRARY)
+endif()
+
+if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
+ file(STRINGS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS REGEX "#define LZMA_VERSION_[A-Z]+ [0-9]+")
+
+ string(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
+
+ set(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
+ unset(LIBLZMA_HEADER_CONTENTS)
+endif()
+
+# We're using new code known now as XZ, even library still been called LZMA
+# it can be found in http://tukaani.org/xz/
+# Avoid using old codebase
+if (LIBLZMA_LIBRARY)
+ include(CheckLibraryExists)
+ set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
+ set(CMAKE_REQUIRED_QUIET ${LibLZMA_FIND_QUIETLY})
+ if(NOT LIBLZMA_LIBRARY_RELEASE AND NOT LIBLZMA_LIBRARY_DEBUG)
+ set(LIBLZMA_LIBRARY_check ${LIBLZMA_LIBRARY})
+ elseif(LIBLZMA_LIBRARY_RELEASE)
+ set(LIBLZMA_LIBRARY_check ${LIBLZMA_LIBRARY_RELEASE})
+ elseif(LIBLZMA_LIBRARY_DEBUG)
+ set(LIBLZMA_LIBRARY_check ${LIBLZMA_LIBRARY_DEBUG})
+ endif()
+ CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY_check} lzma_auto_decoder "" LIBLZMA_HAS_AUTO_DECODER)
+ CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY_check} lzma_easy_encoder "" LIBLZMA_HAS_EASY_ENCODER)
+ CHECK_LIBRARY_EXISTS(${LIBLZMA_LIBRARY_check} lzma_lzma_preset "" LIBLZMA_HAS_LZMA_PRESET)
+ unset(LIBLZMA_LIBRARY_check)
+ set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
+endif ()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LibLZMA REQUIRED_VARS LIBLZMA_LIBRARY
+ LIBLZMA_INCLUDE_DIR
+ LIBLZMA_HAS_AUTO_DECODER
+ LIBLZMA_HAS_EASY_ENCODER
+ LIBLZMA_HAS_LZMA_PRESET
+ VERSION_VAR LIBLZMA_VERSION_STRING
+ )
+mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY )
+
+if (LIBLZMA_FOUND)
+ set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY})
+ set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR})
+ if(NOT TARGET LibLZMA::LibLZMA)
+ add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED)
+ set_target_properties(LibLZMA::LibLZMA PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES ${LIBLZMA_INCLUDE_DIR}
+ IMPORTED_LINK_INTERFACE_LANGUAGES C)
+
+ if(LIBLZMA_LIBRARY_RELEASE)
+ set_property(TARGET LibLZMA::LibLZMA APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(LibLZMA::LibLZMA PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${LIBLZMA_LIBRARY_RELEASE}")
+ endif()
+
+ if(LIBLZMA_LIBRARY_DEBUG)
+ set_property(TARGET LibLZMA::LibLZMA APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(LibLZMA::LibLZMA PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${LIBLZMA_LIBRARY_DEBUG}")
+ endif()
+
+ if(NOT LIBLZMA_LIBRARY_RELEASE AND NOT LIBLZMA_LIBRARY_DEBUG)
+ set_target_properties(LibLZMA::LibLZMA PROPERTIES
+ IMPORTED_LOCATION "${LIBLZMA_LIBRARY}")
+ endif()
+ endif()
+endif ()
diff --git a/tiff/cmake/FindWebP.cmake b/tiff/cmake/FindWebP.cmake
new file mode 100644
index 00000000..770fd979
--- /dev/null
+++ b/tiff/cmake/FindWebP.cmake
@@ -0,0 +1,91 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindWebP
+--------
+
+Find the native WebP includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``WebP::WebP``, if
+WebP has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ WebP_INCLUDE_DIRS - where to find webp/*.h, etc.
+ WebP_LIBRARIES - List of libraries when using webp.
+ WebP_FOUND - True if webp found.
+
+ Debug and Release variants are found separately.
+#]=======================================================================]
+
+# Standard names to search for
+set(WebP_NAMES webp)
+set(WebP_NAMES_DEBUG webpd)
+
+find_path(WebP_INCLUDE_DIR
+ NAMES webp/decode.h
+ PATH_SUFFIXES include)
+
+# Allow WebP_LIBRARY to be set manually, as the location of the webp library
+if(NOT WebP_LIBRARY)
+ find_library(WebP_LIBRARY_RELEASE
+ NAMES ${WebP_NAMES}
+ PATH_SUFFIXES lib)
+ find_library(WebP_LIBRARY_DEBUG
+ NAMES ${WebP_NAMES_DEBUG}
+ PATH_SUFFIXES lib)
+
+ include(SelectLibraryConfigurations)
+ select_library_configurations(WebP)
+endif()
+
+unset(WebP_NAMES)
+unset(WebP_NAMES_DEBUG)
+
+mark_as_advanced(WebP_INCLUDE_DIR)
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(WebP
+ REQUIRED_VARS WebP_LIBRARY WebP_INCLUDE_DIR)
+
+if(WebP_FOUND)
+ set(WebP_INCLUDE_DIRS ${WebP_INCLUDE_DIR})
+
+ if(NOT WebP_LIBRARIES)
+ set(WebP_LIBRARIES ${WebP_LIBRARY})
+ endif()
+
+ if(NOT TARGET WebP::WebP)
+ add_library(WebP::WebP UNKNOWN IMPORTED)
+ set_target_properties(WebP::WebP PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${WebP_INCLUDE_DIRS}")
+
+ if(WebP_LIBRARY_RELEASE)
+ set_property(TARGET WebP::WebP APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(WebP::WebP PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${WebP_LIBRARY_RELEASE}")
+ endif()
+
+ if(WebP_LIBRARY_DEBUG)
+ set_property(TARGET WebP::WebP APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(WebP::WebP PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${WebP_LIBRARY_DEBUG}")
+ endif()
+
+ if(NOT WebP_LIBRARY_RELEASE AND NOT WebP_LIBRARY_DEBUG)
+ set_target_properties(WebP::WebP PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${WebP_LIBRARY}")
+ endif()
+ endif()
+endif()
diff --git a/tiff/cmake/FindZSTD.cmake b/tiff/cmake/FindZSTD.cmake
new file mode 100644
index 00000000..a4066300
--- /dev/null
+++ b/tiff/cmake/FindZSTD.cmake
@@ -0,0 +1,107 @@
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
+#[=======================================================================[.rst:
+FindZSTD
+--------
+
+Find the native ZSTD includes and library.
+
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
+
+This module defines :prop_tgt:`IMPORTED` target ``ZSTD::ZSTD``, if
+ZSTD has been found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This module defines the following variables:
+
+::
+
+ ZSTD_INCLUDE_DIRS - where to find zstd.h, etc.
+ ZSTD_LIBRARIES - List of libraries when using zstd.
+ ZSTD_FOUND - True if zstd found.
+
+::
+
+ ZSTD_VERSION_STRING - The version of zstd found (x.y.z)
+ ZSTD_VERSION_MAJOR - The major version of zstd
+ ZSTD_VERSION_MINOR - The minor version of zstd
+
+ Debug and Release variants are found separately.
+#]=======================================================================]
+
+# Standard names to search for
+set(ZSTD_NAMES zstd zstd_static)
+set(ZSTD_NAMES_DEBUG zstdd zstd_staticd)
+
+find_path(ZSTD_INCLUDE_DIR
+ NAMES zstd.h
+ PATH_SUFFIXES include)
+
+# Allow ZSTD_LIBRARY to be set manually, as the location of the zstd library
+if(NOT ZSTD_LIBRARY)
+ find_library(ZSTD_LIBRARY_RELEASE
+ NAMES ${ZSTD_NAMES}
+ PATH_SUFFIXES lib)
+ find_library(ZSTD_LIBRARY_DEBUG
+ NAMES ${ZSTD_NAMES_DEBUG}
+ PATH_SUFFIXES lib)
+
+ include(SelectLibraryConfigurations)
+ select_library_configurations(ZSTD)
+endif()
+
+unset(ZSTD_NAMES)
+unset(ZSTD_NAMES_DEBUG)
+
+mark_as_advanced(ZSTD_INCLUDE_DIR)
+
+if(ZSTD_INCLUDE_DIR AND EXISTS "${ZSTD_INCLUDE_DIR}/zstd.h")
+ file(STRINGS "${ZSTD_INCLUDE_DIR}/zstd.h" ZSTD_H REGEX "^#define ZSTD_VERSION_.*$")
+
+ string(REGEX REPLACE "^.*ZSTD_VERSION_MAJOR *([0-9]+).*$" "\\1" ZSTD_MAJOR_VERSION "${ZSTD_H}")
+ string(REGEX REPLACE "^.*ZSTD_VERSION_MINOR *([0-9]+).*$" "\\1" ZSTD_MINOR_VERSION "${ZSTD_H}")
+ string(REGEX REPLACE "^.*ZSTD_VERSION_RELEASE *([0-9]+).*$" "\\1" ZSTD_PATCH_VERSION "${ZSTD_H}")
+ set(ZSTD_VERSION_STRING "${ZSTD_MAJOR_VERSION}.${ZSTD_MINOR_VERSION}.${ZSTD_PATCH_VERSION}")
+endif()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZSTD
+ REQUIRED_VARS ZSTD_LIBRARY ZSTD_INCLUDE_DIR
+ VERSION_VAR ZSTD_VERSION_STRING)
+
+if(ZSTD_FOUND)
+ set(ZSTD_INCLUDE_DIRS ${ZSTD_INCLUDE_DIR})
+
+ if(NOT ZSTD_LIBRARIES)
+ set(ZSTD_LIBRARIES ${ZSTD_LIBRARY})
+ endif()
+
+ if(NOT TARGET ZSTD::ZSTD)
+ add_library(ZSTD::ZSTD UNKNOWN IMPORTED)
+ set_target_properties(ZSTD::ZSTD PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIRS}")
+
+ if(ZSTD_LIBRARY_RELEASE)
+ set_property(TARGET ZSTD::ZSTD APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(ZSTD::ZSTD PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${ZSTD_LIBRARY_RELEASE}")
+ endif()
+
+ if(ZSTD_LIBRARY_DEBUG)
+ set_property(TARGET ZSTD::ZSTD APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(ZSTD::ZSTD PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${ZSTD_LIBRARY_DEBUG}")
+ endif()
+
+ if(NOT ZSTD_LIBRARY_RELEASE AND NOT ZSTD_LIBRARY_DEBUG)
+ set_target_properties(ZSTD::ZSTD PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${ZSTD_LIBRARY}")
+ endif()
+ endif()
+endif()
diff --git a/tiff/cmake/IncludeChecks.cmake b/tiff/cmake/IncludeChecks.cmake
new file mode 100644
index 00000000..08873598
--- /dev/null
+++ b/tiff/cmake/IncludeChecks.cmake
@@ -0,0 +1,36 @@
+# Checks for headers
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+include(CheckIncludeFile)
+
+
+check_include_file(assert.h HAVE_ASSERT_H)
+check_include_file(fcntl.h HAVE_FCNTL_H)
+check_include_file(io.h HAVE_IO_H)
+check_include_file(strings.h HAVE_STRINGS_H)
+check_include_file(sys/time.h HAVE_SYS_TIME_H)
+check_include_file(sys/types.h HAVE_SYS_TYPES_H)
+check_include_file(unistd.h HAVE_UNISTD_H)
diff --git a/tiff/cmake/InternalCodecs.cmake b/tiff/cmake/InternalCodecs.cmake
new file mode 100644
index 00000000..97526e1e
--- /dev/null
+++ b/tiff/cmake/InternalCodecs.cmake
@@ -0,0 +1,46 @@
+# Options to enable and disable internal codecs
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+option(ccitt "support for CCITT Group 3 & 4 algorithms" ON)
+set(CCITT_SUPPORT ${ccitt})
+
+option(packbits "support for Macintosh PackBits algorithm" ON)
+set(PACKBITS_SUPPORT ${packbits})
+
+option(lzw "support for LZW algorithm" ON)
+set(LZW_SUPPORT ${lzw})
+
+option(thunder "support for ThunderScan 4-bit RLE algorithm" ON)
+set(THUNDER_SUPPORT ${thunder})
+
+option(next "support for NeXT 2-bit RLE algorithm" ON)
+set(NEXT_SUPPORT ${next})
+
+option(logluv "support for LogLuv high dynamic range algorithm" ON)
+set(LOGLUV_SUPPORT ${logluv})
+
+option(mdi "support for Microsoft Document Imaging" ON)
+set(MDI_SUPPORT ${mdi})
diff --git a/tiff/cmake/JBIGCodec.cmake b/tiff/cmake/JBIGCodec.cmake
new file mode 100644
index 00000000..a4350028
--- /dev/null
+++ b/tiff/cmake/JBIGCodec.cmake
@@ -0,0 +1,47 @@
+# Checks for JBIG codec support
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+# JBIG-KIT
+set(JBIG_SUPPORT FALSE)
+
+find_package(JBIG)
+
+if(JBIG_FOUND)
+ set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${JBIG_INCLUDE_DIRS})
+ set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${JBIG_LIBRARIES})
+ check_symbol_exists(jbg_newlen "jbig.h" HAVE_JBG_NEWLEN)
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
+endif()
+
+option(jbig "use ISO JBIG compression (requires JBIT-KIT library)" ${JBIG_FOUND})
+
+if (jbig AND JBIG_FOUND)
+ set(JBIG_SUPPORT TRUE)
+endif()
+
diff --git a/tiff/cmake/JPEGCodec.cmake b/tiff/cmake/JPEGCodec.cmake
new file mode 100644
index 00000000..5b295851
--- /dev/null
+++ b/tiff/cmake/JPEGCodec.cmake
@@ -0,0 +1,56 @@
+# Checks for JPEG codec support
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+# JPEG
+set(JPEG_SUPPORT FALSE)
+find_package(JPEG)
+option(jpeg "use libjpeg (required for JPEG compression)" ${JPEG_FOUND})
+if (jpeg AND JPEG_FOUND)
+ set(JPEG_SUPPORT TRUE)
+endif()
+
+# Old-jpeg
+set(OJPEG_SUPPORT FALSE)
+option(old-jpeg "support for Old JPEG compression (read-only)" ${JPEG_SUPPORT})
+if (old-jpeg AND JPEG_SUPPORT)
+ set(OJPEG_SUPPORT TRUE)
+endif()
+
+# 8/12-bit jpeg mode
+set(JPEG12_INCLUDE_DIR JPEG12_INCLUDE_DIR-NOTFOUND CACHE PATH "Include directory for 12-bit libjpeg")
+set(JPEG12_LIBRARY JPEG12_LIBRARY-NOTFOUND CACHE FILEPATH "12-bit libjpeg library")
+set(JPEG_DUAL_MODE_8_12 FALSE)
+if (JPEG12_INCLUDE_DIR AND JPEG12_LIBRARY)
+ set(JPEG12_LIBRARIES ${JPEG12_LIBRARY})
+ set(JPEG12_FOUND TRUE)
+else()
+ set(JPEG12_FOUND FALSE)
+endif()
+option(jpeg12 "enable libjpeg 8/12-bit dual mode (requires separate 12-bit libjpeg build)" ${JPEG12_FOUND})
+if (jpeg12 AND JPEG12_FOUND)
+ set(JPEG_DUAL_MODE_8_12 TRUE)
+ set(LIBJPEG_12_PATH "${JPEG12_INCLUDE_DIR}/jpeglib.h")
+endif()
diff --git a/tiff/cmake/LERCCodec.cmake b/tiff/cmake/LERCCodec.cmake
new file mode 100644
index 00000000..7344bfa5
--- /dev/null
+++ b/tiff/cmake/LERCCodec.cmake
@@ -0,0 +1,32 @@
+# Checks for LERC codec support
+#
+# Copyright © 2021 Antonio Valentino <antonio.valentino@tiscali.it>
+# Written by Antonio Valentino <antonio.valentino@tiscali.it>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+# libLerc
+set(LERC_SUPPORT FALSE)
+find_package(LERC)
+option(lerc "use libLerc (required for LERC compression)" ${LERC_FOUND})
+if (lerc AND LERC_FOUND)
+ set(LERC_SUPPORT TRUE)
+endif()
diff --git a/tiff/contrib/mfs/CMakeLists.txt b/tiff/cmake/LZMACodec.cmake
index 3f4f3a90..06b14c1e 100644
--- a/tiff/contrib/mfs/CMakeLists.txt
+++ b/tiff/cmake/LZMACodec.cmake
@@ -1,6 +1,7 @@
-# CMake build for libtiff
+# Checks for LZMA codec support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
@@ -22,6 +23,11 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-extra_dist(
- README
- mfs_file.c)
+
+# liblzma2
+set(LZMA_SUPPORT FALSE)
+find_package(LibLZMA)
+option(lzma "use liblzma (required for LZMA2 compression)" ${LZMA_FOUND})
+if (lzma AND LIBLZMA_FOUND)
+ set(LZMA_SUPPORT TRUE)
+endif()
diff --git a/tiff/contrib/tags/CMakeLists.txt b/tiff/cmake/LargeFileSupport.cmake
index 9945da76..f1819b97 100644
--- a/tiff/contrib/tags/CMakeLists.txt
+++ b/tiff/cmake/LargeFileSupport.cmake
@@ -1,6 +1,7 @@
-# CMake build for libtiff
+# Large file support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
@@ -22,11 +23,10 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-extra_dist(
- README
- listtif.c
- maketif.c
- xtif_dir.c
- xtiffio.h
- xtiffiop.h)
+if (UNIX OR MINGW)
+ # This might not catch every possibility catered for by
+ # Autoconf AC_SYS_LARGEFILE.
+ add_definitions(-D_FILE_OFFSET_BITS=64)
+ set(FILE_OFFSET_BITS 64)
+endif()
diff --git a/tiff/cmake/LibraryFeatures.cmake b/tiff/cmake/LibraryFeatures.cmake
new file mode 100644
index 00000000..929ed241
--- /dev/null
+++ b/tiff/cmake/LibraryFeatures.cmake
@@ -0,0 +1,60 @@
+# C library features
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+# Strip chopping
+option(strip-chopping "strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)" ON)
+set(TIFF_DEFAULT_STRIP_SIZE 8192 CACHE STRING "default size of the strip in bytes (when strip chopping is enabled)")
+
+set(STRIPCHOP_DEFAULT)
+if(strip-chopping)
+ set(STRIPCHOP_DEFAULT TRUE)
+ if(TIFF_DEFAULT_STRIP_SIZE)
+ set(STRIP_SIZE_DEFAULT "${TIFF_DEFAULT_STRIP_SIZE}")
+ endif()
+endif()
+
+# Defer loading of strip/tile offsets
+option(defer-strile-load "enable deferred strip/tile offset/size loading (also available at runtime with the 'D' flag of TIFFOpen())" OFF)
+set(DEFER_STRILE_LOAD ${defer-strile-load})
+
+# CHUNKY_STRIP_READ_SUPPORT
+option(chunky-strip-read "enable reading large strips in chunks for TIFFReadScanline() (experimental)" OFF)
+set(CHUNKY_STRIP_READ_SUPPORT ${chunky-strip-read})
+
+# SUBIFD support
+set(SUBIFD_SUPPORT 1)
+
+# Default handling of ASSOCALPHA support.
+option(extrasample-as-alpha "the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don't mark the alpha properly" ON)
+if(extrasample-as-alpha)
+ set(DEFAULT_EXTRASAMPLE_AS_ALPHA 1)
+endif()
+
+# Default handling of YCbCr subsampling support.
+# See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details.
+option(check-ycbcr-subsampling "enable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag" ON)
+if (check-ycbcr-subsampling)
+ set(CHECK_JPEG_YCBCR_SUBSAMPLING 1)
+endif()
diff --git a/tiff/cmake/LinkerChecks.cmake b/tiff/cmake/LinkerChecks.cmake
new file mode 100644
index 00000000..ad1f0f9f
--- /dev/null
+++ b/tiff/cmake/LinkerChecks.cmake
@@ -0,0 +1,50 @@
+# Check linker capabilities
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+include(CheckCSourceCompiles)
+
+
+option(ld-version-script "Enable linker version script" ON)
+
+# Check if LD supports linker scripts.
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map" "VERS_1 {
+ global: sym;
+};
+
+VERS_2 {
+ global: sym;
+} VERS_1;
+")
+set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
+set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
+check_c_source_compiles("int main(void){return 0;}" HAVE_LD_VERSION_SCRIPT)
+set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE})
+file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map")
+if (ld-version-script AND HAVE_LD_VERSION_SCRIPT)
+ set(HAVE_LD_VERSION_SCRIPT TRUE)
+else()
+ set(HAVE_LD_VERSION_SCRIPT FALSE)
+endif()
diff --git a/tiff/cmake/OpenGLChecks.cmake b/tiff/cmake/OpenGLChecks.cmake
new file mode 100644
index 00000000..8d4142aa
--- /dev/null
+++ b/tiff/cmake/OpenGLChecks.cmake
@@ -0,0 +1,43 @@
+# Checks for OpenGL and GLUT support
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+# OpenGL and GLUT
+set(OpenGL_GL_PREFERENCE LEGACY)
+
+find_package(OpenGL COMPONENTS OpenGL)
+find_package(GLUT)
+
+set(HAVE_OPENGL FALSE)
+if(OPENGL_FOUND AND OPENGL_GLU_FOUND AND GLUT_FOUND)
+ set(HAVE_OPENGL TRUE)
+endif()
+
+# Purely to satisfy the generated headers:
+check_include_file(GL/gl.h HAVE_GL_GL_H)
+check_include_file(GL/glu.h HAVE_GL_GLU_H)
+check_include_file(GL/glut.h HAVE_GL_GLUT_H)
+check_include_file(GLUT/glut.h HAVE_GLUT_GLUT_H)
+check_include_file(OpenGL/gl.h HAVE_OPENGL_GL_H)
+check_include_file(OpenGL/glu.h HAVE_OPENGL_GLU_H)
diff --git a/tiff/cmake/PixarLogCodec.cmake b/tiff/cmake/PixarLogCodec.cmake
new file mode 100644
index 00000000..db363050
--- /dev/null
+++ b/tiff/cmake/PixarLogCodec.cmake
@@ -0,0 +1,33 @@
+# Checks for PixarLog codec support
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+# Option for Pixar log-format algorithm
+# Pixar log format
+set(PIXARLOG_SUPPORT FALSE)
+option(pixarlog "support for Pixar log-format algorithm (requires Zlib)" ${ZLIB_SUPPORT})
+if(pixarlog AND ZLIB_SUPPORT)
+ set(PIXARLOG_SUPPORT TRUE)
+endif()
diff --git a/tiff/cmake/PkgConfig.cmake b/tiff/cmake/PkgConfig.cmake
new file mode 100644
index 00000000..92674bd7
--- /dev/null
+++ b/tiff/cmake/PkgConfig.cmake
@@ -0,0 +1,36 @@
+# pkg-config support
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+# Generate pkg-config file
+set(prefix "${CMAKE_INSTALL_PREFIX}")
+set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
+set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
+set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libtiff-4.pc.in
+ ${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc)
+
+# Install pkg-config file
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libtiff-4.pc
+ DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig")
diff --git a/tiff/cmake/ProcessorChecks.cmake b/tiff/cmake/ProcessorChecks.cmake
new file mode 100644
index 00000000..8d8c568a
--- /dev/null
+++ b/tiff/cmake/ProcessorChecks.cmake
@@ -0,0 +1,47 @@
+# Processor capability checks
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+include(TestBigEndian)
+
+
+# CPU bit order
+set(HOST_FILLORDER FILLORDER_MSB2LSB)
+if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
+ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
+ # AMD64 on Windows
+ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "AMD64" OR
+ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
+ set(HOST_FILLORDER FILLORDER_LSB2MSB)
+endif()
+
+# CPU endianness
+test_big_endian(HOST_BIG_ENDIAN)
+if(HOST_BIG_ENDIAN)
+ add_definitions(-DWORDS_BIGENDIAN)
+endif()
+
+# IEEE floating point
+set(HAVE_IEEEFP 1)
diff --git a/tiff/cmake/Release.cmake b/tiff/cmake/Release.cmake
new file mode 100644
index 00000000..fbf34cc6
--- /dev/null
+++ b/tiff/cmake/Release.cmake
@@ -0,0 +1,31 @@
+# Release support
+#
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+add_custom_target(release
+ COMMAND ${CMAKE_COMMAND}
+ "-DSOURCE_DIR:PATH=${PROJECT_SOURCE_DIR}"
+ "-DLIBTIFF_VERSION=${PROJECT_VERSION}"
+ -P "${CMAKE_CURRENT_LIST_DIR}/ReleaseScript.cmake"
+ COMMENT "Releasing ${PROJECT_NAME} ${PROJECT_VERSION}")
diff --git a/tiff/cmake/ReleaseScript.cmake b/tiff/cmake/ReleaseScript.cmake
new file mode 100644
index 00000000..31cdbfe3
--- /dev/null
+++ b/tiff/cmake/ReleaseScript.cmake
@@ -0,0 +1,32 @@
+# Release support
+#
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+string(TIMESTAMP LIBTIFF_RELEASE_DATE "%Y%m%d")
+
+message(STATUS "Setting release version to ${LIBTIFF_VERSION}")
+message(STATUS "Setting release date to ${LIBTIFF_RELEASE_DATE}")
+
+configure_file("${SOURCE_DIR}/libtiff/tiffvers.h.cmake.in"
+ "${SOURCE_DIR}/libtiff/tiffvers.h"
+ @ONLY)
diff --git a/tiff/cmake/SymbolChecks.cmake b/tiff/cmake/SymbolChecks.cmake
new file mode 100644
index 00000000..210748ed
--- /dev/null
+++ b/tiff/cmake/SymbolChecks.cmake
@@ -0,0 +1,43 @@
+# Checks for symbols
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+include(CheckSymbolExists)
+
+
+# Check for getopt
+check_symbol_exists(getopt "unistd.h;stdio.h" HAVE_GETOPT)
+check_symbol_exists(optarg "getopt.h" HAVE_DECL_OPTARG)
+if (HAVE_DECL_OPTARG)
+ set(HAVE_DECL_OPTARG 1)
+else()
+ set(HAVE_DECL_OPTARG 0)
+endif()
+
+# Check for mmap
+check_symbol_exists(mmap "sys/mman.h" HAVE_MMAP)
+
+# Check for setmode
+check_symbol_exists(setmode "unistd.h" HAVE_SETMODE)
diff --git a/tiff/cmake/TypeSizeChecks.cmake b/tiff/cmake/TypeSizeChecks.cmake
new file mode 100644
index 00000000..29f23b41
--- /dev/null
+++ b/tiff/cmake/TypeSizeChecks.cmake
@@ -0,0 +1,52 @@
+# Check type sizes
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+set(CMAKE_EXTRA_INCLUDE_FILES_SAVE ${CMAKE_EXTRA_INCLUDE_FILES})
+set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES} "stddef.h")
+check_type_size("size_t" SIZEOF_SIZE_T)
+set(CMAKE_EXTRA_INCLUDE_FILES ${CMAKE_EXTRA_INCLUDE_FILES_SAVE})
+
+# C99 fixed-size integer types
+set(TIFF_INT8_T "int8_t")
+set(TIFF_UINT8_T "uint8_t")
+
+set(TIFF_INT16_T "int16_t")
+set(TIFF_UINT16_T "uint16_t")
+
+set(TIFF_INT32_T "int32_t")
+set(TIFF_UINT32_T "uint32_t")
+
+set(TIFF_INT64_T "int64_t")
+set(TIFF_UINT64_T "uint64_t")
+
+# size_t and TIFF signed size-type
+if(SIZEOF_SIZE_T EQUAL 4)
+ set(TIFF_SSIZE_T "int32_t")
+elseif(SIZEOF_SIZE_T EQUAL 8)
+ set(TIFF_SSIZE_T "int64_t")
+else()
+ message(FATAL_ERROR "Unsupported size_t size ${SIZEOF_SIZE_T}; please add support")
+endif()
diff --git a/tiff/contrib/dbs/xtiff/CMakeLists.txt b/tiff/cmake/WebPCodec.cmake
index fec4d0d8..1d676a78 100644
--- a/tiff/contrib/dbs/xtiff/CMakeLists.txt
+++ b/tiff/cmake/WebPCodec.cmake
@@ -1,6 +1,7 @@
-# CMake build for libtiff
+# Checks for WebP codec support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
@@ -22,8 +23,13 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-extra_dist(
- README
- patchlevel.h
- xtiff.c
- xtifficon.h)
+# libwebp
+set(WEBP_SUPPORT FALSE)
+
+find_package(WebP)
+
+option(webp "use libwebp (required for WEBP compression)" ${WebP_FOUND})
+
+if (webp AND WebP_FOUND)
+ set(WEBP_SUPPORT TRUE)
+endif()
diff --git a/tiff/contrib/pds/CMakeLists.txt b/tiff/cmake/WindowsSupport.cmake
index 53a0e056..93c13094 100644
--- a/tiff/contrib/pds/CMakeLists.txt
+++ b/tiff/cmake/WindowsSupport.cmake
@@ -1,6 +1,7 @@
-# CMake build for libtiff
+# Windows support
#
# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
# Written by Roger Leigh <rleigh@codelibre.net>
#
# Permission to use, copy, modify, distribute, and sell this software and
@@ -22,9 +23,17 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-extra_dist(
- README
- tif_imageiter.c
- tif_imageiter.h
- tif_pdsdirread.c
- tif_pdsdirwrite.c)
+# Debug postfix
+if(MSVC)
+ set(CMAKE_DEBUG_POSTFIX "d")
+endif()
+
+# Win32 file I/O
+set(win32_io_default OFF)
+if(WIN32)
+ set(win32_io_default ON)
+endif()
+
+option(win32-io "Use Win32 I/O" ${win32_io_default})
+
+set(USE_WIN32_FILEIO ${win32-io})
diff --git a/tiff/cmake/ZSTDCodec.cmake b/tiff/cmake/ZSTDCodec.cmake
new file mode 100644
index 00000000..d3d2de80
--- /dev/null
+++ b/tiff/cmake/ZSTDCodec.cmake
@@ -0,0 +1,53 @@
+# Checks for LZMA codec support
+#
+# Copyright © 2015 Open Microscopy Environment / University of Dundee
+# Copyright © 2021 Roger Leigh <rleigh@codelibre.net>
+# Written by Roger Leigh <rleigh@codelibre.net>
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that (i) the above copyright notices and this permission notice appear in
+# all copies of the software and related documentation, and (ii) the names of
+# Sam Leffler and Silicon Graphics may not be used in any advertising or
+# publicity relating to the software without the specific, prior written
+# permission of Sam Leffler and Silicon Graphics.
+#
+# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+#
+# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+# OF THIS SOFTWARE.
+
+
+# libzstd
+set(ZSTD_SUPPORT FALSE)
+set(ZSTD_USABLE FALSE)
+
+find_package(ZSTD)
+
+if(ZSTD_FOUND)
+ set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${ZSTD_INCLUDE_DIRS})
+ set(CMAKE_REQUIRED_LIBRARIES_SAVE ${CMAKE_REQUIRED_LIBRARIES})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${ZSTD_LIBRARIES})
+ check_symbol_exists(ZSTD_decompressStream "zstd.h" ZSTD_RECENT_ENOUGH)
+ set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE})
+ set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_SAVE})
+
+ if (ZSTD_RECENT_ENOUGH)
+ set(ZSTD_USABLE TRUE)
+ else()
+ message(WARNING "Found ZSTD library, but not recent enough. Use zstd >= 1.0")
+ endif()
+endif()
+
+option(zstd "use libzstd (required for ZSTD compression)" ${ZSTD_USABLE})
+
+if (zstd AND ZSTD_USABLE)
+ set(ZSTD_SUPPORT TRUE)
+endif()
diff --git a/tiff/config.h.in b/tiff/config.h.in
new file mode 100644
index 00000000..4ccb7421
--- /dev/null
+++ b/tiff/config.h.in
@@ -0,0 +1,275 @@
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
+/* Support CCITT Group 3 & 4 algorithms */
+#undef CCITT_SUPPORT
+
+/* Pick up YCbCr subsampling info from the JPEG data stream to support files
+ lacking the tag (default enabled). */
+#undef CHECK_JPEG_YCBCR_SUBSAMPLING
+
+/* enable partial strip reading for large strips (experimental) */
+#undef CHUNKY_STRIP_READ_SUPPORT
+
+/* Support C++ stream API (requires C++ compiler) */
+#undef CXX_SUPPORT
+
+/* Treat extra sample as alpha (default enabled). The RGBA interface will
+ treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
+ packages produce RGBA files but don't mark the alpha properly. */
+#undef DEFAULT_EXTRASAMPLE_AS_ALPHA
+
+/* enable deferred strip/tile offset/size loading */
+#undef DEFER_STRILE_LOAD
+
+/* Define to 1 if you have the <assert.h> header file. */
+#undef HAVE_ASSERT_H
+
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't.
+ */
+#undef HAVE_DECL_OPTARG
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#undef HAVE_FSEEKO
+
+/* Define to 1 if you have the `getopt' function. */
+#undef HAVE_GETOPT
+
+/* Define to 1 if you have the <GLUT/glut.h> header file. */
+#undef HAVE_GLUT_GLUT_H
+
+/* Define to 1 if you have the <GL/glut.h> header file. */
+#undef HAVE_GL_GLUT_H
+
+/* Define to 1 if you have the <GL/glu.h> header file. */
+#undef HAVE_GL_GLU_H
+
+/* Define to 1 if you have the <GL/gl.h> header file. */
+#undef HAVE_GL_GL_H
+
+/* Define as 0 or 1 according to the floating point format supported by the
+ machine */
+#undef HAVE_IEEEFP
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <io.h> header file. */
+#undef HAVE_IO_H
+
+/* Define to 1 if you have the `jbg_newlen' function. */
+#undef HAVE_JBG_NEWLEN
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mmap' function. */
+#undef HAVE_MMAP
+
+/* Define to 1 if you have the <OpenGL/glu.h> header file. */
+#undef HAVE_OPENGL_GLU_H
+
+/* Define to 1 if you have the <OpenGL/gl.h> header file. */
+#undef HAVE_OPENGL_GL_H
+
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
+/* Define to 1 if you have the <search.h> header file. */
+#undef HAVE_SEARCH_H
+
+/* Define to 1 if you have the `setmode' function. */
+#undef HAVE_SETMODE
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Use nonstandard varargs form for the GLU tesselator callback */
+#undef HAVE_VARARGS_GLU_TESSCB
+
+/* Define to 1 if you have the <windows.h> header file. */
+#undef HAVE_WINDOWS_H
+
+/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
+ (Intel) */
+#undef HOST_BIGENDIAN
+
+/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
+#undef HOST_FILLORDER
+
+/* Support ISO JBIG compression (requires JBIG-KIT library) */
+#undef JBIG_SUPPORT
+
+/* 8/12 bit libjpeg dual mode enabled */
+#undef JPEG_DUAL_MODE_8_12
+
+/* Support JPEG compression (requires IJG JPEG library) */
+#undef JPEG_SUPPORT
+
+/* Support lerc compression */
+#undef LERC_SUPPORT
+
+/* Support libdeflate enhanced compression */
+#undef LIBDEFLATE_SUPPORT
+
+/* 12bit libjpeg primary include file with path */
+#undef LIBJPEG_12_PATH
+
+/* Support LogLuv high dynamic range encoding */
+#undef LOGLUV_SUPPORT
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#undef LT_OBJDIR
+
+/* Support LZMA2 compression */
+#undef LZMA_SUPPORT
+
+/* Support LZW algorithm */
+#undef LZW_SUPPORT
+
+/* Support Microsoft Document Imaging format */
+#undef MDI_SUPPORT
+
+/* Support NeXT 2-bit RLE algorithm */
+#undef NEXT_SUPPORT
+
+/* Support Old JPEG compresson (read-only) */
+#undef OJPEG_SUPPORT
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Support Macintosh PackBits algorithm */
+#undef PACKBITS_SUPPORT
+
+/* Support Pixar log-format algorithm (requires Zlib) */
+#undef PIXARLOG_SUPPORT
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+ your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* The size of `size_t', as computed by sizeof. */
+#undef SIZEOF_SIZE_T
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Support strip chopping (whether or not to convert single-strip uncompressed
+ images to multiple strips of specified size to reduce memory usage) */
+#undef STRIPCHOP_DEFAULT
+
+/* Default size of the strip in bytes (when strip chopping enabled) */
+#undef STRIP_SIZE_DEFAULT
+
+/* Enable SubIFD tag (330) support */
+#undef SUBIFD_SUPPORT
+
+/* Support ThunderScan 4-bit RLE algorithm */
+#undef THUNDER_SUPPORT
+
+/* Signed size type */
+#undef TIFF_SSIZE_T
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+
+/* define to use win32 IO system */
+#undef USE_WIN32_FILEIO
+
+/* Version number of package */
+#undef VERSION
+
+/* Support webp compression */
+#undef WEBP_SUPPORT
+
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
+/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING
+
+/* Support Deflate compression */
+#undef ZIP_SUPPORT
+
+/* Support zstd compression */
+#undef ZSTD_SUPPORT
+
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
+#undef _LARGEFILE_SOURCE
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/tiff/config/config.guess b/tiff/config/config.guess
index 6c32c864..1972fda8 100755
--- a/tiff/config/config.guess
+++ b/tiff/config/config.guess
@@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2021 Free Software Foundation, Inc.
-timestamp='2014-11-04'
+timestamp='2021-01-25'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2014-11-04'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -27,19 +27,19 @@ timestamp='2014-11-04'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
#
# Please send patches to <config-patches@gnu.org>.
-me=`echo "$0" | sed -e 's,.*/,,'`
+me=$(echo "$0" | sed -e 's,.*/,,')
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
exit 1
fi
-trap 'exit 1' 1 2 15
-
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
@@ -96,66 +94,89 @@ trap 'exit 1' 1 2 15
# Portable tmp directory creation inspired by the Autoconf team.
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+ # prevent multiple calls if $tmp is already set
+ test "$tmp" && return 0
+ : "${TMPDIR=/tmp}"
+ # shellcheck disable=SC2039
+ { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+ dummy=$tmp/dummy
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+ ,,) echo "int x;" > "$dummy.c"
+ for driver in cc gcc c89 c99 ; do
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$driver"
+ break
+ fi
+ done
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+ esac
+}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown
+UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown
+UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown
+UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
+ LIBC=unknown
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
+ set_cc_for_build
+ cat <<-EOF > "$dummy.c"
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
- #else
+ #elif defined(__GLIBC__)
LIBC=gnu
+ #else
+ #include <stdarg.h>
+ /* First heuristic to detect musl libc. */
+ #ifdef __DEFINED_va_list
+ LIBC=musl
+ #endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')"
+
+ # Second heuristic to detect musl libc.
+ if [ "$LIBC" = unknown ] &&
+ command -v ldd >/dev/null &&
+ ldd --version 2>&1 | grep -q ^musl; then
+ LIBC=musl
+ fi
+
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ if [ "$LIBC" = unknown ]; then
+ LIBC=gnu
+ fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -167,22 +188,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
+ UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
+ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ echo unknown))
+ case "$UNAME_MACHINE_ARCH" in
+ aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ earmv*)
+ arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,')
+ endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p')
+ machine="${arch}${endian}"-unknown
+ ;;
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
+ # to ELF recently (or will in the future) and ABI.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
@@ -197,117 +228,137 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
os=netbsd
;;
esac
+ # Determine ABI tags.
+ case "$UNAME_MACHINE_ARCH" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr")
+ ;;
+ esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
+ case "$UNAME_VERSION" in
Debian*)
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2)
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
+ echo "$machine-${os}${release}${abi-}"
exit ;;
*:Bitrig:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//')
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
exit ;;
*:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//')
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+ exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//')
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+ exit ;;
+ *:MidnightBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
exit ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
exit ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+ exit ;;
+ *:OS108:*:*)
+ echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
+ exit ;;
+ *:Sortix:*:*)
+ echo "$UNAME_MACHINE"-unknown-sortix
+ exit ;;
+ *:Twizzler:*:*)
+ echo "$UNAME_MACHINE"-unknown-twizzler
+ exit ;;
+ *:Redox:*:*)
+ echo "$UNAME_MACHINE"-unknown-redox
+ exit ;;
+ mips:OSF1:*.*)
+ echo mips-dec-osf1
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')
;;
*5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}')
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1)
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)"
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
+ echo "$UNAME_MACHINE"-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
+ echo "$UNAME_MACHINE"-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
@@ -319,7 +370,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
+ echo arm-acorn-riscix"$UNAME_RELEASE"
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
@@ -329,7 +380,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ if test "$( (/bin/universe) 2>/dev/null)" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
@@ -342,69 +393,69 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
+ case $(/usr/bin/uname -p) in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
exit ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
+ echo i386-pc-auroraux"$UNAME_RELEASE"
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
+ set_cc_for_build
+ SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
- SUN_ARCH="x86_64"
+ SUN_ARCH=x86_64
fi
fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
+ case "$(/usr/bin/arch -k)" in
Series*|S4*)
- UNAME_RELEASE=`uname -v`
+ UNAME_RELEASE=$(uname -v)
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')"
exit ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
exit ;;
sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
+ UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null)
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
+ case "$(/bin/arch)" in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
;;
sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
+ echo sparc-sun-sunos"$UNAME_RELEASE"
;;
esac
exit ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
+ echo sparc-auspex-sunos"$UNAME_RELEASE"
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
@@ -415,44 +466,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
+ echo m68k-milan-mint"$UNAME_RELEASE"
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
+ echo m68k-hades-mint"$UNAME_RELEASE"
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
+ echo m68k-unknown-mint"$UNAME_RELEASE"
exit ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
+ echo m68k-apple-machten"$UNAME_RELEASE"
exit ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
+ echo powerpc-apple-machten"$UNAME_RELEASE"
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
+ echo mips-dec-ultrix"$UNAME_RELEASE"
exit ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
+ echo vax-dec-ultrix"$UNAME_RELEASE"
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
+ echo clipper-intergraph-clix"$UNAME_RELEASE"
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
@@ -461,23 +512,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') &&
+ SYSTEM_NAME=$("$dummy" "$dummyarg") &&
{ echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
+ echo mips-mips-riscos"$UNAME_RELEASE"
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
@@ -502,18 +553,18 @@ EOF
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ UNAME_PROCESSOR=$(/usr/bin/uname -p)
+ if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
+ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
+ test "$TARGET_BINARY_INTERFACE"x = x
then
- echo m88k-dg-dgux${UNAME_RELEASE}
+ echo m88k-dg-dgux"$UNAME_RELEASE"
else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ echo i586-dg-dgux"$UNAME_RELEASE"
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
@@ -530,26 +581,26 @@ EOF
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')"
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
+ if test -x /usr/bin/oslevel ; then
+ IBM_REV=$(/usr/bin/oslevel)
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
main()
@@ -560,7 +611,7 @@ EOF
exit(0);
}
EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy")
then
echo "$SYSTEM_NAME"
else
@@ -573,28 +624,28 @@ EOF
fi
exit ;;
*:AIX:*:[4567])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }')
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/lslpp ] ; then
- IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
- awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+ if test -x /usr/bin/lslpp ; then
+ IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/)
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
@@ -609,28 +660,28 @@ EOF
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
+ HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
+ case "$UNAME_MACHINE" in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ if test -x /usr/bin/getconf; then
+ sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null)
+ sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null)
+ case "$sc_cpu_version" in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ case "$sc_kernel_bits" in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ if test "$HP_ARCH" = ""; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include <stdlib.h>
@@ -663,13 +714,13 @@ EOF
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy")
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if test "$HP_ARCH" = hppa2.0w
then
- eval $set_cc_for_build
+ set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -680,23 +731,23 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
exit ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
+ HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
+ echo ia64-hp-hpux"$HPUX_REV"
exit ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h>
int
main ()
@@ -721,11 +772,11 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
@@ -734,17 +785,17 @@ EOF
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ if test -x /usr/sbin/sysversion ; then
+ echo "$UNAME_MACHINE"-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ echo "$UNAME_MACHINE"-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
@@ -769,130 +820,123 @@ EOF
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)
+ FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
+ FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/')
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
+ FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/')
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
exit ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
+ echo sparc-unknown-bsdi"$UNAME_RELEASE"
exit ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+ exit ;;
+ arm:FreeBSD:*:*)
+ UNAME_PROCESSOR=$(uname -p)
+ set_cc_for_build
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi
+ else
+ echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf
+ fi
exit ;;
*:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
+ UNAME_PROCESSOR=$(/usr/bin/uname -p)
+ case "$UNAME_PROCESSOR" in
amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
esac
+ echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
exit ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
+ echo "$UNAME_MACHINE"-pc-cygwin
exit ;;
*:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
+ echo "$UNAME_MACHINE"-pc-mingw64
exit ;;
*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
+ echo "$UNAME_MACHINE"-pc-mingw32
exit ;;
*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ echo "$UNAME_MACHINE"-pc-msys
exit ;;
i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
+ echo "$UNAME_MACHINE"-pc-pw32
exit ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case "$UNAME_MACHINE" in
x86)
- echo i586-pc-interix${UNAME_RELEASE}
+ echo i586-pc-interix"$UNAME_RELEASE"
exit ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
+ echo x86_64-unknown-interix"$UNAME_RELEASE"
exit ;;
IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
+ echo ia64-unknown-interix"$UNAME_RELEASE"
exit ;;
esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
+ echo "$UNAME_MACHINE"-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
+ echo x86_64-pc-cygwin
exit ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')"
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC"
exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
+ *:Minix:*:*)
+ echo "$UNAME_MACHINE"-unknown-minix
exit ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -902,129 +946,182 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arm*:Linux:*:*)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
exit ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
+ exit ;;
+ e2k:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ k1om:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ IS_GLIBC=0
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
+ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
+ #undef mips
+ #undef mipsel
+ #undef mips64
+ #undef mips64el
+ #if ${IS_GLIBC} && defined(_ABI64)
+ LIBCABI=gnuabi64
+ #else
+ #if ${IS_GLIBC} && defined(_ABIN32)
+ LIBCABI=gnuabin32
+ #else
+ LIBCABI=${LIBC}
+ #endif
+ #endif
+
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa64r6
+ #else
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa32r6
+ #else
+ #if defined(__mips64)
+ CPU=mips64
+ #else
+ CPU=mips
+ #endif
+ #endif
+ #endif
+
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
+ MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
+ MIPS_ENDIAN=
#else
- CPU=
+ MIPS_ENDIAN=
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')"
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
;;
+ mips64el:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+ exit ;;
openrisc*:Linux:*:*)
- echo or1k-unknown-linux-${LIBC}
+ echo or1k-unknown-linux-"$LIBC"
exit ;;
or32:Linux:*:* | or1k*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
+ echo sparc-unknown-linux-"$LIBC"
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
+ echo hppa64-unknown-linux-"$LIBC"
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in
+ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+ *) echo hppa-unknown-linux-"$LIBC" ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
+ echo powerpc64-unknown-linux-"$LIBC"
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
+ echo powerpc-unknown-linux-"$LIBC"
exit ;;
ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
+ echo powerpc64le-unknown-linux-"$LIBC"
exit ;;
ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
+ echo powerpcle-unknown-linux-"$LIBC"
+ exit ;;
+ riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ set_cc_for_build
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_X32 >/dev/null
+ then
+ LIBCABI="$LIBC"x32
+ fi
+ fi
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1038,51 +1135,51 @@ EOF
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
+ echo "$UNAME_MACHINE"-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
+ echo "$UNAME_MACHINE"-unknown-stop
exit ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
+ echo "$UNAME_MACHINE"-unknown-atheos
exit ;;
i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
+ echo "$UNAME_MACHINE"-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
+ echo i386-unknown-lynxos"$UNAME_RELEASE"
exit ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ echo "$UNAME_MACHINE"-pc-msdosdjgpp
exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ i*86:*:4.*:*)
+ UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//')
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
+ case $(/bin/uname -X | grep "^Machine") in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ UNAME_REL=$(sed -n 's/.*Version //p' </usr/options/cb.name)
+ echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //'))
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
@@ -1090,9 +1187,9 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv32
+ echo "$UNAME_MACHINE"-pc-sysv32
fi
exit ;;
pc:*:*:*)
@@ -1100,7 +1197,7 @@ EOF
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
@@ -1112,9 +1209,9 @@ EOF
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
@@ -1132,41 +1229,41 @@ EOF
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
+ echo m68k-unknown-lynxos"$UNAME_RELEASE"
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
+ echo sparc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
+ echo mips-dde-sysv"$UNAME_RELEASE"
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
@@ -1176,8 +1273,8 @@ EOF
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
+ UNAME_MACHINE=$( (uname -p) 2>/dev/null)
+ echo "$UNAME_MACHINE"-sni-sysv4
else
echo ns32k-sni-sysv
fi
@@ -1197,23 +1294,23 @@ EOF
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
+ echo "$UNAME_MACHINE"-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
+ echo m68k-apple-aux"$UNAME_RELEASE"
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ if test -d /usr/nec; then
+ echo mips-nec-sysv"$UNAME_RELEASE"
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv"$UNAME_RELEASE"
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
@@ -1232,77 +1329,97 @@ EOF
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
+ echo sx4-nec-superux"$UNAME_RELEASE"
exit ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
+ echo sx5-nec-superux"$UNAME_RELEASE"
exit ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
+ echo sx6-nec-superux"$UNAME_RELEASE"
exit ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
+ echo sx7-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
+ echo sx8-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
+ echo sx8r-nec-superux"$UNAME_RELEASE"
+ exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux"$UNAME_RELEASE"
exit ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
+ exit ;;
+ arm64:Darwin:*:*)
+ echo aarch64-apple-darwin"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
+ UNAME_PROCESSOR=$(uname -p)
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ if command -v xcode-select > /dev/null 2> /dev/null && \
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+ # Avoid executing cc if there is no toolchain installed as
+ # cc will be a stub that puts up a graphical alert
+ # prompting the user to install developer tools.
+ CC_FOR_BUILD=no_compiler_found
+ else
+ set_cc_for_build
fi
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
- # Avoid executing cc on OS X 10.9, as it ships with a stub
- # that puts up a graphical alert prompting to install
- # developer tools. Any system running Mac OS X 10.7 or
- # later (Darwin 11 and later) is required to have a 64-bit
- # processor. This is not true of the ARM version of Darwin
- # that Apple uses in portable devices.
- UNAME_PROCESSOR=x86_64
+ # uname -m returns i386 or x86_64
+ UNAME_PROCESSOR=$UNAME_MACHINE
fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=$(uname -p)
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
+ NEO-*:NONSTOP_KERNEL:*:*)
+ echo neo-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
+ echo nse-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ echo nsv-tandem-nsk"$UNAME_RELEASE"
exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
+ NSX-*:NONSTOP_KERNEL:*:*)
+ echo nsx-tandem-nsk"$UNAME_RELEASE"
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
@@ -1311,18 +1428,19 @@ EOF
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ # shellcheck disable=SC2154
+ if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
- echo ${UNAME_MACHINE}-unknown-plan9
+ echo "$UNAME_MACHINE"-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
@@ -1343,14 +1461,14 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux"$UNAME_RELEASE"
exit ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
exit ;;
*:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
+ UNAME_MACHINE=$( (uname -p) 2>/dev/null)
+ case "$UNAME_MACHINE" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
@@ -1359,62 +1477,223 @@ EOF
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')"
exit ;;
i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
+ echo "$UNAME_MACHINE"-pc-rdos
exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
+ *:AROS:*:*)
+ echo "$UNAME_MACHINE"-unknown-aros
exit ;;
x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
+ echo "$UNAME_MACHINE"-unknown-esx
exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
+ *:Unleashed:*:*)
+ echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
+ exit ;;
+esac
+
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
+#ifdef _SEQUENT_
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null);
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
+
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+ ;;
esac
cat >&2 <<EOF
-$0: unable to guess system type
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+ https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+EOF
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
+year=$(echo $timestamp | sed 's,-.*,,')
+# shellcheck disable=SC2003
+if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then
+ cat >&2 <<EOF
+
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
config.guess timestamp = $timestamp
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
+uname -m = $( (uname -m) 2>/dev/null || echo unknown)
+uname -r = $( (uname -r) 2>/dev/null || echo unknown)
+uname -s = $( (uname -s) 2>/dev/null || echo unknown)
+uname -v = $( (uname -v) 2>/dev/null || echo unknown)
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null)
+/bin/uname -X = $( (/bin/uname -X) 2>/dev/null)
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+hostinfo = $( (hostinfo) 2>/dev/null)
+/bin/universe = $( (/bin/universe) 2>/dev/null)
+/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null)
+/bin/arch = $( (/bin/arch) 2>/dev/null)
+/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null)
+/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null)
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
EOF
+fi
exit 1
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/tiff/config/config.sub b/tiff/config/config.sub
index 7ffe3737..7f7d0b05 100755
--- a/tiff/config/config.sub
+++ b/tiff/config/config.sub
@@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2021 Free Software Foundation, Inc.
-timestamp='2014-12-03'
+timestamp='2021-03-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2014-12-03'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -33,7 +33,7 @@ timestamp='2014-12-03'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -50,15 +50,14 @@ timestamp='2014-12-03'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
-me=`echo "$0" | sed -e 's,.*/,,'`
+me=$(echo "$0" | sed -e 's,.*/,,')
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -68,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -90,12 +89,12 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- echo "$me: invalid option $1$help"
+ echo "$me: invalid option $1$help" >&2
exit 1 ;;
*local*)
# First pass through any local machine types.
- echo $1
+ echo "$1"
exit ;;
* )
@@ -111,1228 +110,1169 @@ case $# in
exit 1;;
esac
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
+# Separate into logical components for further validation
+case $1 in
+ *-*-*-*-*)
+ echo Invalid configuration \`"$1"\': more than four components >&2
+ exit 1
;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ *-*-*-*)
+ basic_machine=$field1-$field2
+ basic_os=$field3-$field4
;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+ nto-qnx* | linux-* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+ | storm-chaos* | os2-emx* | rtmk-nova*)
+ basic_machine=$field1
+ basic_os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+ basic_os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+ basic_os=$field3
+ ;;
+ esac
;;
- -psos*)
- os=-psos
+ *-*)
+ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+ case $field2 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+ | convergent* | ncr* | news | 32* | 3600* | 3100* \
+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+ | ultra | tti* | harris | dolphin | highlevel | gould \
+ | cbm | ns | masscomp | apple | axis | knuth | cray \
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+ basic_os=
+ ;;
+ *)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ esac
+ ;;
+ esac
;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
+ *)
+ # Convert single-component short-hands not valid as part of
+ # multi-component configurations.
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+ basic_os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ basic_os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+ basic_os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ basic_os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ basic_os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ basic_os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+ basic_os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ basic_os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ basic_os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ basic_os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ basic_os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ basic_os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ basic_os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ basic_os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ basic_os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ basic_os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ basic_os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ basic_os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ basic_os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ basic_os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ basic_os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+ basic_os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ basic_os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+ basic_os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ basic_os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ basic_os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ basic_os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ basic_os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ basic_os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ basic_os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ basic_os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ basic_os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ basic_os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ basic_os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ basic_os=sysv3
+ ;;
+ hp300 | hp300hpux)
+ basic_machine=m68k-hp
+ basic_os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ basic_os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ basic_os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ basic_os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ basic_os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ basic_os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ basic_os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ basic_os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ basic_os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ basic_os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ basic_os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ basic_os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ basic_os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ basic_os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+ basic_os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ basic_os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ basic_os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ basic_os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+ basic_os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ basic_os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ basic_os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ basic_os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ basic_os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ basic_os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ basic_os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ basic_os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ basic_os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ basic_os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ basic_os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ basic_os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ basic_os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ basic_os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ basic_os=linux
+ ;;
+ psp)
+ basic_machine=mipsallegrexel-sony
+ basic_os=psp
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ basic_os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ basic_os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ basic_os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+ basic_os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ basic_os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ basic_os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ basic_os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ basic_os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ basic_os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ basic_os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ basic_os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+ basic_os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ basic_os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ basic_os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ basic_os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ basic_os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ basic_os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ basic_os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ basic_os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ basic_os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ basic_os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ basic_os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ basic_os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ basic_os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ basic_os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ basic_os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ basic_os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ basic_os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ basic_os=vms
+ ;;
+ vsta)
+ basic_machine=i386-pc
+ basic_os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ basic_os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ basic_os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ basic_os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ basic_os=unicos
+ ;;
+ *)
+ basic_machine=$1
+ basic_os=
+ ;;
+ esac
;;
esac
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | visium \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- leon|leon[3-9])
- basic_machine=sparc-$basic_machine
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ cpu=hppa1.1
+ vendor=winbond
;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ op50n)
+ cpu=hppa1.1
+ vendor=oki
;;
- ms1)
- basic_machine=mt-unknown
+ op60c)
+ cpu=hppa1.1
+ vendor=oki
;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
+ ibm*)
+ cpu=i370
+ vendor=ibm
;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
+ orion105)
+ cpu=clipper
+ vendor=highlevel
;;
- xscaleeb)
- basic_machine=armeb-unknown
+ mac | mpw | mac-mpw)
+ cpu=m68k
+ vendor=apple
;;
-
- xscaleel)
- basic_machine=armel-unknown
+ pmac | pmac-mpw)
+ cpu=powerpc
+ vendor=apple
;;
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa32r6-* | mipsisa32r6el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64r6-* | mipsisa64r6el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | or1k*-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | visium-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
+ cpu=m68000
+ vendor=att
;;
3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=we32k
+ vendor=att
;;
bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
+ cpu=powerpc
+ vendor=ibm
+ basic_os=cnk
;;
decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops10
;;
decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
+ cpu=m68k
+ vendor=motorola
;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+ basic_os=sysv3
;;
encore | umax | mmax)
- basic_machine=ns32k-encore
+ cpu=ns32k
+ vendor=encore
;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+ basic_os=${basic_os:-bsd}
;;
fx2800)
- basic_machine=i860-alliant
+ cpu=i860
+ vendor=alliant
;;
genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
+ cpu=ns32k
+ vendor=ns
;;
h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
+ cpu=m68000
+ vendor=hp
;;
hp9k3[2-9][0-9])
- basic_machine=m68k-hp
+ cpu=m68k
+ vendor=hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
+ cpu=hppa1.0
+ vendor=hp
;;
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
+ cpu=$(echo "$1" | sed -e 's/86.*/86/')
+ vendor=pc
+ basic_os=sysv32
;;
i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
+ cpu=$(echo "$1" | sed -e 's/86.*/86/')
+ vendor=pc
+ basic_os=sysv4
;;
i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
+ cpu=$(echo "$1" | sed -e 's/86.*/86/')
+ vendor=pc
+ basic_os=sysv
;;
i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
+ cpu=$(echo "$1" | sed -e 's/86.*/86/')
+ vendor=pc
+ basic_os=solaris2
;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+ basic_os=${basic_os:-unicos}
;;
iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
+ cpu=mips
+ vendor=sgi
+ case $basic_os in
+ irix*)
;;
*)
- os=-irix4
+ basic_os=irix4
;;
esac
;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- leon-*|leon[3-9]-*)
- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
+ cpu=m68000
+ vendor=convergent
;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- moxiebox)
- basic_machine=moxie-unknown
- os=-moxiebox
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+ basic_os=mint
;;
news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
+ cpu=mips
+ vendor=sony
+ basic_os=newsos
+ ;;
+ next | m*-next)
+ cpu=m68k
+ vendor=next
+ case $basic_os in
+ openstep*)
+ ;;
+ nextstep*)
;;
- -ns2*)
- os=-nextstep2
+ ns2*)
+ basic_os=nextstep2
;;
*)
- os=-nextstep3
+ basic_os=nextstep3
;;
esac
;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
+ cpu=np1
+ vendor=gould
;;
op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
+ cpu=hppa1.1
+ vendor=oki
+ basic_os=proelf
;;
pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
pbd)
- basic_machine=sparc-tti
+ cpu=sparc
+ vendor=tti
;;
pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ cpu=m68k
+ vendor=tti
;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ pc532)
+ cpu=ns32k
+ vendor=pc532
;;
pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ cpu=pn
+ vendor=gould
;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ power)
+ cpu=power
+ vendor=ibm
;;
ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
+ cpu=i386
+ vendor=ibm
;;
rm[46]00)
- basic_machine=mips-siemens
+ cpu=mips
+ vendor=siemens
;;
rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
+ cpu=romp
+ vendor=ibm
;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+ basic_os=${basic_os:-elf}
;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+ basic_os=vxworks
;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
+ tower | tower-32)
+ cpu=m68k
+ vendor=ncr
;;
- sei)
- basic_machine=mips-sei
- os=-seiux
+ vpp*|vx|vx-*)
+ cpu=f301
+ vendor=fujitsu
;;
- sequent)
- basic_machine=i386-sequent
+ w65)
+ cpu=w65
+ vendor=wdc
;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+ basic_os=proelf
;;
- sh5el)
- basic_machine=sh5le-unknown
+ none)
+ cpu=none
+ vendor=none
;;
- sh64)
- basic_machine=sh64-unknown
+ leon|leon[3-9])
+ cpu=sparc
+ vendor=$basic_machine
;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
+ leon-*|leon[3-9]-*)
+ cpu=sparc
+ vendor=$(echo "$basic_machine" | sed 's/-.*//')
;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
+
+ *-*)
+ # shellcheck disable=SC2162
+ IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
;;
- spur)
- basic_machine=spur-unknown
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ cpu=$basic_machine
+ vendor=pc
;;
- st2000)
- basic_machine=m68k-tandem
+ # These rules are duplicated from below for sake of the special case above;
+ # i.e. things that normalized to x86 arches should also default to "pc"
+ pc98)
+ cpu=i386
+ vendor=pc
;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
+ x64 | amd64)
+ cpu=x86_64
+ vendor=pc
;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ # Recognize the basic CPU types without company name.
+ *)
+ cpu=$basic_machine
+ vendor=unknown
;;
- sun2)
- basic_machine=m68000-sun
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+ # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ craynv-unknown)
+ vendor=cray
+ basic_os=${basic_os:-unicosmp}
;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
+ c90-unknown | c90-cray)
+ vendor=cray
+ basic_os=${Basic_os:-unicos}
;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
+ fx80-unknown)
+ vendor=alliant
;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
+ romp-unknown)
+ vendor=ibm
;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
+ mmix-unknown)
+ vendor=knuth
;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
+ microblaze-unknown | microblazeel-unknown)
+ vendor=xilinx
;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
+ rs6000-unknown)
+ vendor=ibm
;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
+ vax-unknown)
+ vendor=dec
;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
+ pdp11-unknown)
+ vendor=dec
;;
- sun4)
- basic_machine=sparc-sun
+ we32k-unknown)
+ vendor=att
;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
+ cydra-unknown)
+ vendor=cydrome
;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
+ i370-ibm*)
+ vendor=ibm
;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
+ orion-unknown)
+ vendor=highlevel
;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
+ xps-unknown | xps100-unknown)
+ cpu=xps100
+ vendor=honeywell
;;
- t90)
- basic_machine=t90-cray
- os=-unicos
+
+ # Here we normalize CPU types with a missing or matching vendor
+ dpx20-unknown | dpx20-bull)
+ cpu=rs6000
+ vendor=bull
+ basic_os=${basic_os:-bosx}
;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
+
+ # Here we normalize CPU types irrespective of the vendor
+ amd64-*)
+ cpu=x86_64
;;
- tx39)
- basic_machine=mipstx39-unknown
+ blackfin-*)
+ cpu=bfin
+ basic_os=linux
;;
- tx39el)
- basic_machine=mipstx39el-unknown
+ c54x-*)
+ cpu=tic54x
;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
+ c55x-*)
+ cpu=tic55x
;;
- tower | tower-32)
- basic_machine=m68k-ncr
+ c6x-*)
+ cpu=tic6x
;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
+ e500v[12]-*)
+ cpu=powerpc
+ basic_os=${basic_os}"spe"
;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
+ mips3*-*)
+ cpu=mips64
;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
+ ms1-*)
+ cpu=mt
;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
+ m68knommu-*)
+ cpu=m68k
+ basic_os=linux
;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
+ m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+ cpu=s12z
;;
- vms)
- basic_machine=vax-dec
- os=-vms
+ openrisc-*)
+ cpu=or32
;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
+ parisc-*)
+ cpu=hppa
+ basic_os=linux
;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ cpu=i586
;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+ cpu=i686
;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ cpu=i686
;;
- w65*)
- basic_machine=w65-wdc
- os=-none
+ pentium4-*)
+ cpu=i786
;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
+ pc98-*)
+ cpu=i386
;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
+ ppc-* | ppcbe-*)
+ cpu=powerpc
;;
- xps | xps100)
- basic_machine=xps100-honeywell
+ ppcle-* | powerpclittle-*)
+ cpu=powerpcle
;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ ppc64-*)
+ cpu=powerpc64
;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
+ ppc64le-* | powerpc64little-*)
+ cpu=powerpc64le
;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
+ sb1-*)
+ cpu=mipsisa64sb1
;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
+ sb1el-*)
+ cpu=mipsisa64sb1el
;;
- none)
- basic_machine=none-none
- os=-none
+ sh5e[lb]-*)
+ cpu=$(echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/')
;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
+ spur-*)
+ cpu=spur
;;
- op50n)
- basic_machine=hppa1.1-oki
+ strongarm-* | thumb-*)
+ cpu=arm
;;
- op60c)
- basic_machine=hppa1.1-oki
+ tx39-*)
+ cpu=mipstx39
;;
- romp)
- basic_machine=romp-ibm
+ tx39el-*)
+ cpu=mipstx39el
;;
- mmix)
- basic_machine=mmix-knuth
+ x64-*)
+ cpu=x86_64
;;
- rs6000)
- basic_machine=rs6000-ibm
+ xscale-* | xscalee[bl]-*)
+ cpu=$(echo "$cpu" | sed 's/^xscale/arm/')
;;
- vax)
- basic_machine=vax-dec
+ arm64-*)
+ cpu=aarch64
;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
+
+ # Recognize the canonical CPU Types that limit and/or modify the
+ # company names they are paired with.
+ cr16-*)
+ basic_os=${basic_os:-elf}
;;
- pdp11)
- basic_machine=pdp11-dec
+ crisv32-* | etraxfs*-*)
+ cpu=crisv32
+ vendor=axis
;;
- we32k)
- basic_machine=we32k-att
+ cris-* | etrax*-*)
+ cpu=cris
+ vendor=axis
;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
+ crx-*)
+ basic_os=${basic_os:-elf}
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
+ neo-tandem)
+ cpu=neo
+ vendor=tandem
;;
- cydra)
- basic_machine=cydra-cydrome
+ nse-tandem)
+ cpu=nse
+ vendor=tandem
;;
- orion)
- basic_machine=orion-highlevel
+ nsr-tandem)
+ cpu=nsr
+ vendor=tandem
;;
- orion105)
- basic_machine=clipper-highlevel
+ nsv-tandem)
+ cpu=nsv
+ vendor=tandem
;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
+ nsx-tandem)
+ cpu=nsx
+ vendor=tandem
;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
+ mipsallegrexel-sony)
+ cpu=mipsallegrexel
+ vendor=sony
;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
+ tile*-*)
+ basic_os=${basic_os:-linux-gnu}
;;
+
*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
+ # Recognize the canonical CPU types that are allowed with any
+ # company name.
+ case $cpu in
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be \
+ | abacus \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+ | amdgcn \
+ | arc | arceb \
+ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+ | be32 | be64 \
+ | bfin | bpf | bs2000 \
+ | c[123]* | c30 | [cjt]90 | c4x \
+ | c8051 | clipper | craynv | csky | cydra \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | elxsi | epiphany \
+ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+ | h8300 | h8500 \
+ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | le32 | le64 \
+ | lm32 \
+ | loongarch32 | loongarch64 | loongarchx32 \
+ | m32c | m32r | m32rle \
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
+ | microblaze | microblazeel \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64eb | mips64el \
+ | mips64octeon | mips64octeonel \
+ | mips64orion | mips64orionel \
+ | mips64r5900 | mips64r5900el \
+ | mips64vr | mips64vrel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa32r6 | mipsisa32r6el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64r6 | mipsisa64r6el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
+ | mipstx39 | mipstx39el \
+ | mmix \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nds32 | nds32le | nds32be \
+ | nfp \
+ | nios | nios2 | nios2eb | nios2el \
+ | none | np1 | ns16k | ns32k | nvptx \
+ | open8 \
+ | or1k* \
+ | or32 \
+ | orion \
+ | picochip \
+ | pdp10 | pdp11 | pj | pjl | pn | power \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
+ | rl78 | romp | rs6000 | rx \
+ | s390 | s390x \
+ | score \
+ | sh | shl \
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
+ | thumbv7* \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | vax \
+ | visium \
+ | w65 \
+ | wasm32 | wasm64 \
+ | we32k \
+ | x86 | x86_64 | xc16x | xgate | xps100 \
+ | xstormy16 | xtensa* \
+ | ymp \
+ | z8k | z80)
+ ;;
+
+ *)
+ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+ exit 1
+ ;;
+ esac
;;
esac
# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+ digital*)
+ vendor=dec
;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ commodore*)
+ vendor=cbm
;;
*)
;;
@@ -1340,200 +1280,213 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x"$os" != x"" ]
+if test x$basic_os != x
then
+
+# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
+# set os.
+case $basic_os in
+ gnu/linux*)
+ kernel=linux
+ os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|')
+ ;;
+ os2-emx)
+ kernel=os2
+ os=$(echo $basic_os | sed -e 's|os2-emx|emx|')
+ ;;
+ nto-qnx*)
+ kernel=nto
+ os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|')
+ ;;
+ *-*)
+ # shellcheck disable=SC2162
+ IFS="-" read kernel os <<EOF
+$basic_os
+EOF
+ ;;
+ # Default OS when just kernel was specified
+ nto*)
+ kernel=nto
+ os=$(echo $basic_os | sed -e 's|nto|qnx|')
+ ;;
+ linux*)
+ kernel=linux
+ os=$(echo $basic_os | sed -e 's|linux|gnu|')
+ ;;
+ *)
+ kernel=
+ os=$basic_os
+ ;;
+esac
+
+# Now, normalize the OS (knowing we just have one component, it's not a kernel,
+# etc.)
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
+ # First match some system type aliases that might get confused
+ # with valid system types.
+ # solaris* is a basic system type, with this one exception.
+ auroraux)
+ os=auroraux
;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ bluegene*)
+ os=cnk
;;
- -solaris)
- os=-solaris2
+ solaris1 | solaris1.*)
+ os=$(echo $os | sed -e 's|solaris1|sunos4|')
;;
- -svr4*)
- os=-sysv4
+ solaris)
+ os=solaris2
;;
- -unixware*)
- os=-sysv4.2uw
+ unixware*)
+ os=sysv4.2uw
;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ # es1800 is here to avoid being matched by es* (a different OS)
+ es1800*)
+ os=ose
;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
+ # Some version numbers need modification
+ chorusos*)
+ os=chorusos
;;
- -nto-qnx*)
+ isc)
+ os=isc2.2
;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ sco6)
+ os=sco5v6
;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ sco5)
+ os=sco3.2v5
;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
+ sco4)
+ os=sco3.2v4
;;
- -linux-dietlibc)
- os=-linux-dietlibc
+ sco3.2.[4-9]*)
+ os=$(echo $os | sed -e 's/sco3.2./sco3.2v/')
;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ sco*v* | scout)
+ # Don't match below
;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ sco*)
+ os=sco3.2v2
;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ psos*)
+ os=psos
;;
- -opened*)
- os=-openedition
+ qnx*)
+ os=qnx
;;
- -os400*)
- os=-os400
+ hiux*)
+ os=hiuxwe2
;;
- -wince*)
- os=-wince
+ lynx*178)
+ os=lynxos178
;;
- -osfrose*)
- os=-osfrose
+ lynx*5)
+ os=lynxos5
;;
- -osf*)
- os=-osf
+ lynxos*)
+ # don't get caught up in next wildcard
;;
- -utek*)
- os=-bsd
+ lynx*)
+ os=lynxos
;;
- -dynix*)
- os=-bsd
+ mac[0-9]*)
+ os=$(echo "$os" | sed -e 's|mac|macos|')
;;
- -acis*)
- os=-aos
+ opened*)
+ os=openedition
;;
- -atheos*)
- os=-atheos
+ os400*)
+ os=os400
;;
- -syllable*)
- os=-syllable
+ sunos5*)
+ os=$(echo "$os" | sed -e 's|sunos5|solaris2|')
;;
- -386bsd)
- os=-bsd
+ sunos6*)
+ os=$(echo "$os" | sed -e 's|sunos6|solaris3|')
;;
- -ctix* | -uts*)
- os=-sysv
+ wince*)
+ os=wince
;;
- -nova*)
- os=-rtmk-nova
+ utek*)
+ os=bsd
;;
- -ns2 )
- os=-nextstep2
+ dynix*)
+ os=bsd
;;
- -nsk*)
- os=-nsk
+ acis*)
+ os=aos
;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
+ atheos*)
+ os=atheos
;;
- -sinix*)
- os=-sysv4
+ syllable*)
+ os=syllable
;;
- -tpf*)
- os=-tpf
+ 386bsd)
+ os=bsd
;;
- -triton*)
- os=-sysv3
+ ctix* | uts*)
+ os=sysv
;;
- -oss*)
- os=-sysv3
+ nova*)
+ os=rtmk-nova
;;
- -svr4)
- os=-sysv4
+ ns2)
+ os=nextstep2
;;
- -svr3)
- os=-sysv3
+ # Preserve the version number of sinix5.
+ sinix5.*)
+ os=$(echo $os | sed -e 's|sinix|sysv|')
;;
- -sysvr4)
- os=-sysv4
+ sinix*)
+ os=sysv4
;;
- # This must come after -sysvr4.
- -sysv*)
+ tpf*)
+ os=tpf
;;
- -ose*)
- os=-ose
+ triton*)
+ os=sysv3
;;
- -es1800*)
- os=-ose
+ oss*)
+ os=sysv3
;;
- -xenix)
- os=-xenix
+ svr4*)
+ os=sysv4
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
+ svr3)
+ os=sysv3
;;
- -aros*)
- os=-aros
+ sysvr4)
+ os=sysv4
;;
- -zvmoe)
- os=-zvmoe
+ ose*)
+ os=ose
;;
- -dicos*)
- os=-dicos
+ *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ os=mint
;;
- -nacl*)
+ dicos*)
+ os=dicos
;;
- -none)
+ pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
+ # configurations are quite functional.
+ case $cpu in
+ arm*)
+ os=eabi
+ ;;
+ *)
+ os=elf
+ ;;
+ esac
;;
*)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
+ # No normalization, but not necessarily accepted, that comes below.
;;
esac
+
else
# Here we handle the default operating systems that come with various machines.
@@ -1546,261 +1499,361 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
-case $basic_machine in
+kernel=
+case $cpu-$vendor in
score-*)
- os=-elf
+ os=elf
;;
spu-*)
- os=-elf
+ os=elf
;;
*-acorn)
- os=-riscix1.2
+ os=riscix1.2
;;
arm*-rebel)
- os=-linux
+ kernel=linux
+ os=gnu
;;
arm*-semi)
- os=-aout
+ os=aout
;;
c4x-* | tic4x-*)
- os=-coff
+ os=coff
;;
c8051-*)
- os=-elf
+ os=elf
+ ;;
+ clipper-intergraph)
+ os=clix
;;
hexagon-*)
- os=-elf
+ os=elf
;;
tic54x-*)
- os=-coff
+ os=coff
;;
tic55x-*)
- os=-coff
+ os=coff
;;
tic6x-*)
- os=-coff
+ os=coff
;;
# This must come before the *-dec entry.
pdp10-*)
- os=-tops20
+ os=tops20
;;
pdp11-*)
- os=-none
+ os=none
;;
*-dec | vax-*)
- os=-ultrix4.2
+ os=ultrix4.2
;;
m68*-apollo)
- os=-domain
+ os=domain
;;
i386-sun)
- os=-sunos4.0.2
+ os=sunos4.0.2
;;
m68000-sun)
- os=-sunos3
+ os=sunos3
;;
m68*-cisco)
- os=-aout
+ os=aout
;;
mep-*)
- os=-elf
+ os=elf
;;
mips*-cisco)
- os=-elf
+ os=elf
;;
mips*-*)
- os=-elf
+ os=elf
;;
or32-*)
- os=-coff
+ os=coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
+ os=sysv3
;;
sparc-* | *-sun)
- os=-sunos4.1.1
+ os=sunos4.1.1
;;
- *-be)
- os=-beos
+ pru-*)
+ os=elf
;;
- *-haiku)
- os=-haiku
+ *-be)
+ os=beos
;;
*-ibm)
- os=-aix
+ os=aix
;;
*-knuth)
- os=-mmixware
+ os=mmixware
;;
*-wec)
- os=-proelf
+ os=proelf
;;
*-winbond)
- os=-proelf
+ os=proelf
;;
*-oki)
- os=-proelf
+ os=proelf
;;
*-hp)
- os=-hpux
+ os=hpux
;;
*-hitachi)
- os=-hiux
+ os=hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
+ os=sysv
;;
*-cbm)
- os=-amigaos
+ os=amigaos
;;
*-dg)
- os=-dgux
+ os=dgux
;;
*-dolphin)
- os=-sysv3
+ os=sysv3
;;
m68k-ccur)
- os=-rtu
+ os=rtu
;;
m88k-omron*)
- os=-luna
+ os=luna
;;
- *-next )
- os=-nextstep
+ *-next)
+ os=nextstep
;;
*-sequent)
- os=-ptx
+ os=ptx
;;
*-crds)
- os=-unos
+ os=unos
;;
*-ns)
- os=-genix
+ os=genix
;;
i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
+ os=mvs
;;
*-gould)
- os=-sysv
+ os=sysv
;;
*-highlevel)
- os=-bsd
+ os=bsd
;;
*-encore)
- os=-bsd
+ os=bsd
;;
*-sgi)
- os=-irix
+ os=irix
;;
*-siemens)
- os=-sysv4
+ os=sysv4
;;
*-masscomp)
- os=-rtu
+ os=rtu
;;
f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
+ os=uxpv
;;
*-rom68k)
- os=-coff
+ os=coff
;;
*-*bug)
- os=-coff
+ os=coff
;;
*-apple)
- os=-macos
+ os=macos
;;
*-atari*)
- os=-mint
+ os=mint
+ ;;
+ *-wrs)
+ os=vxworks
;;
*)
- os=-none
+ os=none
;;
esac
+
fi
+# Now, validate our (potentially fixed-up) OS.
+case $os in
+ # Sometimes we do "kernel-libc", so those need to count as OSes.
+ musl* | newlib* | uclibc*)
+ ;;
+ # Likewise for "kernel-abi"
+ eabi* | gnueabi*)
+ ;;
+ # VxWorks passes extra cpu info in the 4th filed.
+ simlinux | simwindows | spe)
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
+ | hiux* | abug | nacl* | netware* | windows* \
+ | os9* | macos* | osx* | ios* \
+ | mpw* | magic* | mmixware* | mon960* | lnews* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* | serenity* \
+ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | mint* \
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
+ | storm-chaos* | tops10* | tenex* | tops20* | its* \
+ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
+ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*)
+ ;;
+ # This one is extra strict with allowed versions
+ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ none)
+ ;;
+ *)
+ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os in
+ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* )
+ ;;
+ uclinux-uclibc* )
+ ;;
+ -dietlibc* | -newlib* | -musl* | -uclibc* )
+ # These are just libc implementations, not actual OSes, and thus
+ # require a kernel.
+ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ kfreebsd*-gnu* | kopensolaris*-gnu*)
+ ;;
+ vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+ ;;
+ nto-qnx*)
+ ;;
+ os2-emx)
+ ;;
+ *-eabi* | *-gnueabi*)
+ ;;
+ -*)
+ # Blank kernel with real OS is always fine.
+ ;;
+ *-*)
+ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+ exit 1
+ ;;
+esac
+
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
+case $vendor in
+ unknown)
+ case $cpu-$os in
+ *-riscix*)
vendor=acorn
;;
- -sunos*)
+ *-sunos*)
vendor=sun
;;
- -cnk*|-aix*)
+ *-cnk* | *-aix*)
vendor=ibm
;;
- -beos*)
+ *-beos*)
vendor=be
;;
- -hpux*)
+ *-hpux*)
vendor=hp
;;
- -mpeix*)
+ *-mpeix*)
vendor=hp
;;
- -hiux*)
+ *-hiux*)
vendor=hitachi
;;
- -unos*)
+ *-unos*)
vendor=crds
;;
- -dgux*)
+ *-dgux*)
vendor=dg
;;
- -luna*)
+ *-luna*)
vendor=omron
;;
- -genix*)
+ *-genix*)
vendor=ns
;;
- -mvs* | -opened*)
+ *-clix*)
+ vendor=intergraph
+ ;;
+ *-mvs* | *-opened*)
+ vendor=ibm
+ ;;
+ *-os400*)
vendor=ibm
;;
- -os400*)
+ s390-* | s390x-*)
vendor=ibm
;;
- -ptx*)
+ *-ptx*)
vendor=sequent
;;
- -tpf*)
+ *-tpf*)
vendor=ibm
;;
- -vxsim* | -vxworks* | -windiss*)
+ *-vxsim* | *-vxworks* | *-windiss*)
vendor=wrs
;;
- -aux*)
+ *-aux*)
vendor=apple
;;
- -hms*)
+ *-hms*)
vendor=hitachi
;;
- -mpw* | -macos*)
+ *-mpw* | *-macos*)
vendor=apple
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
vendor=atari
;;
- -vos*)
+ *-vos*)
vendor=stratus
;;
esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
-echo $basic_machine$os
+echo "$cpu-$vendor-${kernel:+$kernel-}$os"
exit
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/tiff/config/install-sh b/tiff/config/install-sh
index 0b0fdcbb..8175c640 100755
--- a/tiff/config/install-sh
+++ b/tiff/config/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2013-12-25.23; # UTC
+scriptversion=2018-03-11.20; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -271,15 +271,18 @@ do
fi
dst=$dst_arg
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
+ # If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
- dst=$dstdir/`basename "$src"`
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
@@ -288,6 +291,11 @@ do
fi
fi
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
@@ -324,34 +332,43 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
+ # Note that $RANDOM variable is not portable (e.g. dash); Use it
+ # here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p' feature.
if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
- rmdir "$tmpdir/d" "$tmpdir"
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
@@ -427,8 +444,8 @@ do
else
# Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
@@ -493,9 +510,9 @@ do
done
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/tiff/config/ltmain.sh b/tiff/config/ltmain.sh
index 0f0a2da3..0cb7f90d 100644
--- a/tiff/config/ltmain.sh
+++ b/tiff/config/ltmain.sh
@@ -31,7 +31,7 @@
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.4.6
+VERSION="2.4.6 Debian-2.4.6-14"
package_revision=2.4.6
@@ -387,7 +387,7 @@ EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
# putting '$debug_cmd' at the start of all your functions, you can get
# bash to show function call trace with:
#
-# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+# debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
debug_cmd=${debug_cmd-":"}
exit_cmd=:
@@ -1370,7 +1370,7 @@ func_lt_ver ()
#! /bin/sh
# Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
+scriptversion=2015-10-07.11; # UTC
# A portable, pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010
@@ -1530,6 +1530,8 @@ func_run_hooks ()
{
$debug_cmd
+ _G_rc_run_hooks=false
+
case " $hookable_fns " in
*" $1 "*) ;;
*) func_fatal_error "'$1' does not support hook funcions.n" ;;
@@ -1538,16 +1540,16 @@ func_run_hooks ()
eval _G_hook_fns=\$$1_hooks; shift
for _G_hook in $_G_hook_fns; do
- eval $_G_hook '"$@"'
-
- # store returned options list back into positional
- # parameters for next 'cmd' execution.
- eval _G_hook_result=\$${_G_hook}_result
- eval set dummy "$_G_hook_result"; shift
+ if eval $_G_hook '"$@"'; then
+ # store returned options list back into positional
+ # parameters for next 'cmd' execution.
+ eval _G_hook_result=\$${_G_hook}_result
+ eval set dummy "$_G_hook_result"; shift
+ _G_rc_run_hooks=:
+ fi
done
- func_quote_for_eval ${1+"$@"}
- func_run_hooks_result=$func_quote_for_eval_result
+ $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result
}
@@ -1557,10 +1559,16 @@ func_run_hooks ()
## --------------- ##
# In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
+# full positional parameter list in your hook function, you may remove/edit
+# any options that you action, and then pass back the remaining unprocessed
# options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'. Like this:
+# 'eval'. In this case you also must return $EXIT_SUCCESS to let the
+# hook's caller know that it should pay attention to
+# '<hooked_function_name>_result'. Returning $EXIT_FAILURE signalizes that
+# arguments are left untouched by the hook and therefore caller will ignore the
+# result variable.
+#
+# Like this:
#
# my_options_prep ()
# {
@@ -1570,9 +1578,11 @@ func_run_hooks ()
# usage_message=$usage_message'
# -s, --silent don'\''t print informational messages
# '
-#
-# func_quote_for_eval ${1+"$@"}
-# my_options_prep_result=$func_quote_for_eval_result
+# # No change in '$@' (ignored completely by this hook). There is
+# # no need to do the equivalent (but slower) action:
+# # func_quote_for_eval ${1+"$@"}
+# # my_options_prep_result=$func_quote_for_eval_result
+# false
# }
# func_add_hook func_options_prep my_options_prep
#
@@ -1581,25 +1591,37 @@ func_run_hooks ()
# {
# $debug_cmd
#
+# args_changed=false
+#
# # Note that for efficiency, we parse as many options as we can
# # recognise in a loop before passing the remainder back to the
# # caller on the first unrecognised argument we encounter.
# while test $# -gt 0; do
# opt=$1; shift
# case $opt in
-# --silent|-s) opt_silent=: ;;
+# --silent|-s) opt_silent=:
+# args_changed=:
+# ;;
# # Separate non-argument short options:
# -s*) func_split_short_opt "$_G_opt"
# set dummy "$func_split_short_opt_name" \
# "-$func_split_short_opt_arg" ${1+"$@"}
# shift
+# args_changed=:
# ;;
-# *) set dummy "$_G_opt" "$*"; shift; break ;;
+# *) # Make sure the first unrecognised option "$_G_opt"
+# # is added back to "$@", we could need that later
+# # if $args_changed is true.
+# set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
# esac
# done
#
-# func_quote_for_eval ${1+"$@"}
-# my_silent_option_result=$func_quote_for_eval_result
+# if $args_changed; then
+# func_quote_for_eval ${1+"$@"}
+# my_silent_option_result=$func_quote_for_eval_result
+# fi
+#
+# $args_changed
# }
# func_add_hook func_parse_options my_silent_option
#
@@ -1611,16 +1633,32 @@ func_run_hooks ()
# $opt_silent && $opt_verbose && func_fatal_help "\
# '--silent' and '--verbose' options are mutually exclusive."
#
-# func_quote_for_eval ${1+"$@"}
-# my_option_validation_result=$func_quote_for_eval_result
+# false
# }
# func_add_hook func_validate_options my_option_validation
#
-# You'll alse need to manually amend $usage_message to reflect the extra
+# You'll also need to manually amend $usage_message to reflect the extra
# options you parse. It's preferable to append if you can, so that
# multiple option parsing hooks can be added safely.
+# func_options_finish [ARG]...
+# ----------------------------
+# Finishing the option parse loop (call 'func_options' hooks ATM).
+func_options_finish ()
+{
+ $debug_cmd
+
+ _G_func_options_finish_exit=false
+ if func_run_hooks func_options ${1+"$@"}; then
+ func_options_finish_result=$func_run_hooks_result
+ _G_func_options_finish_exit=:
+ fi
+
+ $_G_func_options_finish_exit
+}
+
+
# func_options [ARG]...
# ---------------------
# All the functions called inside func_options are hookable. See the
@@ -1630,17 +1668,28 @@ func_options ()
{
$debug_cmd
- func_options_prep ${1+"$@"}
- eval func_parse_options \
- ${func_options_prep_result+"$func_options_prep_result"}
- eval func_validate_options \
- ${func_parse_options_result+"$func_parse_options_result"}
+ _G_rc_options=false
+
+ for my_func in options_prep parse_options validate_options options_finish
+ do
+ if eval func_$my_func '${1+"$@"}'; then
+ eval _G_res_var='$'"func_${my_func}_result"
+ eval set dummy "$_G_res_var" ; shift
+ _G_rc_options=:
+ fi
+ done
- eval func_run_hooks func_options \
- ${func_validate_options_result+"$func_validate_options_result"}
+ # Save modified positional parameters for caller. As a top-level
+ # options-parser function we always need to set the 'func_options_result'
+ # variable (regardless the $_G_rc_options value).
+ if $_G_rc_options; then
+ func_options_result=$_G_res_var
+ else
+ func_quote_for_eval ${1+"$@"}
+ func_options_result=$func_quote_for_eval_result
+ fi
- # save modified positional parameters for caller
- func_options_result=$func_run_hooks_result
+ $_G_rc_options
}
@@ -1649,9 +1698,9 @@ func_options ()
# All initialisations required before starting the option parse loop.
# Note that when calling hook functions, we pass through the list of
# positional parameters. If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
+# needs to propagate that back to rest of this script, then the complete
# modified list must be put in 'func_run_hooks_result' before
-# returning.
+# returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned).
func_hookable func_options_prep
func_options_prep ()
{
@@ -1661,10 +1710,14 @@ func_options_prep ()
opt_verbose=false
opt_warning_types=
- func_run_hooks func_options_prep ${1+"$@"}
+ _G_rc_options_prep=false
+ if func_run_hooks func_options_prep ${1+"$@"}; then
+ _G_rc_options_prep=:
+ # save modified positional parameters for caller
+ func_options_prep_result=$func_run_hooks_result
+ fi
- # save modified positional parameters for caller
- func_options_prep_result=$func_run_hooks_result
+ $_G_rc_options_prep
}
@@ -1678,18 +1731,20 @@ func_parse_options ()
func_parse_options_result=
+ _G_rc_parse_options=false
# this just eases exit handling
while test $# -gt 0; do
# Defer to hook functions for initial option parsing, so they
# get priority in the event of reusing an option name.
- func_run_hooks func_parse_options ${1+"$@"}
-
- # Adjust func_parse_options positional parameters to match
- eval set dummy "$func_run_hooks_result"; shift
+ if func_run_hooks func_parse_options ${1+"$@"}; then
+ eval set dummy "$func_run_hooks_result"; shift
+ _G_rc_parse_options=:
+ fi
# Break out of the loop if we already parsed every option.
test $# -gt 0 || break
+ _G_match_parse_options=:
_G_opt=$1
shift
case $_G_opt in
@@ -1704,7 +1759,10 @@ func_parse_options ()
;;
--warnings|--warning|-W)
- test $# = 0 && func_missing_arg $_G_opt && break
+ if test $# = 0 && func_missing_arg $_G_opt; then
+ _G_rc_parse_options=:
+ break
+ fi
case " $warning_categories $1" in
*" $1 "*)
# trailing space prevents matching last $1 above
@@ -1757,15 +1815,25 @@ func_parse_options ()
shift
;;
- --) break ;;
+ --) _G_rc_parse_options=: ; break ;;
-*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ *) set dummy "$_G_opt" ${1+"$@"}; shift
+ _G_match_parse_options=false
+ break
+ ;;
esac
+
+ $_G_match_parse_options && _G_rc_parse_options=:
done
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- func_parse_options_result=$func_quote_for_eval_result
+
+ if $_G_rc_parse_options; then
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ func_parse_options_result=$func_quote_for_eval_result
+ fi
+
+ $_G_rc_parse_options
}
@@ -1778,16 +1846,21 @@ func_validate_options ()
{
$debug_cmd
+ _G_rc_validate_options=false
+
# Display all warnings if -W was not given.
test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
- func_run_hooks func_validate_options ${1+"$@"}
+ if func_run_hooks func_validate_options ${1+"$@"}; then
+ # save modified positional parameters for caller
+ func_validate_options_result=$func_run_hooks_result
+ _G_rc_validate_options=:
+ fi
# Bail if the options were screwed!
$exit_cmd $EXIT_FAILURE
- # save modified positional parameters for caller
- func_validate_options_result=$func_run_hooks_result
+ $_G_rc_validate_options
}
@@ -2068,12 +2141,12 @@ include the following information:
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
- version: $progname (GNU libtool) 2.4.6
+ version: $progname $scriptversion Debian-2.4.6-14
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
Report bugs to <bug-libtool@gnu.org>.
-GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+GNU libtool home page: <http://www.gnu.org/s/libtool/>.
General help using GNU software: <http://www.gnu.org/gethelp/>."
exit 0
}
@@ -2270,6 +2343,8 @@ libtool_options_prep ()
nonopt=
preserve_args=
+ _G_rc_lt_options_prep=:
+
# Shorthand for --mode=foo, only valid as the first argument
case $1 in
clean|clea|cle|cl)
@@ -2293,11 +2368,18 @@ libtool_options_prep ()
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
shift; set dummy --mode uninstall ${1+"$@"}; shift
;;
+ *)
+ _G_rc_lt_options_prep=false
+ ;;
esac
- # Pass back the list of options.
- func_quote_for_eval ${1+"$@"}
- libtool_options_prep_result=$func_quote_for_eval_result
+ if $_G_rc_lt_options_prep; then
+ # Pass back the list of options.
+ func_quote_for_eval ${1+"$@"}
+ libtool_options_prep_result=$func_quote_for_eval_result
+ fi
+
+ $_G_rc_lt_options_prep
}
func_add_hook func_options_prep libtool_options_prep
@@ -2309,9 +2391,12 @@ libtool_parse_options ()
{
$debug_cmd
+ _G_rc_lt_parse_options=false
+
# Perform our own loop to consume as many options as possible in
# each iteration.
while test $# -gt 0; do
+ _G_match_lt_parse_options=:
_G_opt=$1
shift
case $_G_opt in
@@ -2386,15 +2471,22 @@ libtool_parse_options ()
func_append preserve_args " $_G_opt"
;;
- # An option not handled by this hook function:
- *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ # An option not handled by this hook function:
+ *) set dummy "$_G_opt" ${1+"$@"} ; shift
+ _G_match_lt_parse_options=false
+ break
+ ;;
esac
+ $_G_match_lt_parse_options && _G_rc_lt_parse_options=:
done
+ if $_G_rc_lt_parse_options; then
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ libtool_parse_options_result=$func_quote_for_eval_result
+ fi
- # save modified positional parameters for caller
- func_quote_for_eval ${1+"$@"}
- libtool_parse_options_result=$func_quote_for_eval_result
+ $_G_rc_lt_parse_options
}
func_add_hook func_parse_options libtool_parse_options
@@ -7272,10 +7364,16 @@ func_mode_link ()
# -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support
# -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
+ # -fsanitize=* Clang/GCC memory and address sanitizer
+ # -fuse-ld=* Linker select flags for GCC
+ # -static-* direct GCC to link specific libraries statically
+ # -fcilkplus Cilk Plus language extension features for C/C++
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*)
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+ -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus)
func_quote_for_eval "$arg"
arg=$func_quote_for_eval_result
func_append compile_command " $arg"
@@ -7568,7 +7666,10 @@ func_mode_link ()
case $pass in
dlopen) libs=$dlfiles ;;
dlpreopen) libs=$dlprefiles ;;
- link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ link)
+ libs="$deplibs %DEPLIBS%"
+ test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+ ;;
esac
fi
if test lib,dlpreopen = "$linkmode,$pass"; then
@@ -7887,19 +7988,19 @@ func_mode_link ()
# It is a libtool convenience library, so add in its objects.
func_append convenience " $ladir/$objdir/$old_library"
func_append old_convenience " $ladir/$objdir/$old_library"
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if $opt_preserve_dup_deps; then
+ case "$tmp_libs " in
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ esac
+ fi
+ func_append tmp_libs " $deplib"
+ done
elif test prog != "$linkmode" && test lib != "$linkmode"; then
func_fatal_error "'$lib' is not a convenience library"
fi
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if $opt_preserve_dup_deps; then
- case "$tmp_libs " in
- *" $deplib "*) func_append specialdeplibs " $deplib" ;;
- esac
- fi
- func_append tmp_libs " $deplib"
- done
continue
fi # $pass = conv
@@ -8823,6 +8924,9 @@ func_mode_link ()
revision=$number_minor
lt_irix_increment=no
;;
+ *)
+ func_fatal_configuration "$modename: unknown library version type '$version_type'"
+ ;;
esac
;;
no)
diff --git a/tiff/config/test-driver b/tiff/config/test-driver
index 8e575b01..b8521a48 100755
--- a/tiff/config/test-driver
+++ b/tiff/config/test-driver
@@ -1,9 +1,9 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2013-07-13.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-07-13.22; # UTC
# 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, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -140,9 +140,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/tiff/configure b/tiff/configure
index 96362dad..1d9918f7 100755
--- a/tiff/configure
+++ b/tiff/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for LibTIFF Software 4.2.0.
+# Generated by GNU Autoconf 2.69 for LibTIFF Software 4.3.0.
#
# Report bugs to <tiff@lists.maptools.org>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='LibTIFF Software'
PACKAGE_TARNAME='tiff'
-PACKAGE_VERSION='4.2.0'
-PACKAGE_STRING='LibTIFF Software 4.2.0'
+PACKAGE_VERSION='4.3.0'
+PACKAGE_STRING='LibTIFF Software 4.3.0'
PACKAGE_BUGREPORT='tiff@lists.maptools.org'
PACKAGE_URL=''
@@ -662,6 +662,8 @@ HAVE_ZSTD_FALSE
HAVE_ZSTD_TRUE
HAVE_LZMA_FALSE
HAVE_LZMA_TRUE
+HAVE_LERC_FALSE
+HAVE_LERC_TRUE
HAVE_JBIG_FALSE
HAVE_JBIG_TRUE
HAVE_JPEG_FALSE
@@ -785,6 +787,7 @@ infodir
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -844,6 +847,9 @@ enable_old_jpeg
enable_jbig
with_jbig_include_dir
with_jbig_lib_dir
+enable_lerc
+with_lerc_include_dir
+with_lerc_lib_dir
enable_lzma
with_lzma_include_dir
with_lzma_lib_dir
@@ -919,6 +925,7 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1171,6 +1178,15 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1308,7 +1324,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1421,7 +1437,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures LibTIFF Software 4.2.0 to adapt to many kinds of systems.
+\`configure' configures LibTIFF Software 4.3.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1461,6 +1477,7 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1495,7 +1512,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of LibTIFF Software 4.2.0:";;
+ short | recursive ) echo "Configuration of LibTIFF Software 4.3.0:";;
esac
cat <<\_ACEOF
@@ -1542,6 +1559,8 @@ Optional Features:
enabled by default)
--disable-jbig disable JBIG-KIT usage (required for ISO JBIG
compression, enabled by default)
+ --disable-lerc disable liblerc usage (required for lerc
+ compression, enabled by default)
--disable-lzma disable liblzma usage (required for LZMA2
compression, enabled by default)
--disable-zstd disable libzstd usage (required for zstd
@@ -1556,7 +1575,7 @@ Optional Features:
--disable-strip-chopping
disable support for strip chopping (whether or not
to convert single-strip uncompressed images to
- mutiple strips of specified size to reduce memory
+ multiple strips of specified size to reduce memory
usage)
--enable-defer-strile-load
enable deferred strip/tile offset/size loading (also
@@ -1598,6 +1617,9 @@ Optional Packages:
--with-jbig-include-dir=DIR
location of JBIG-KIT headers
--with-jbig-lib-dir=DIR location of JBIG-KIT library binary
+ --with-lerc-include-dir=DIR
+ location of liblerc headers
+ --with-lerc-lib-dir=DIR location of liblerc library binary
--with-lzma-include-dir=DIR
location of liblzma headers
--with-lzma-lib-dir=DIR location of liblzma library binary
@@ -1698,7 +1720,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-LibTIFF Software configure 4.2.0
+LibTIFF Software configure 4.3.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2471,7 +2493,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by LibTIFF Software $as_me 4.2.0, which was
+It was created by LibTIFF Software $as_me 4.3.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3414,7 +3436,7 @@ fi
# Define the identity of the package.
PACKAGE='tiff'
- VERSION='4.2.0'
+ VERSION='4.3.0'
cat >>confdefs.h <<_ACEOF
@@ -3648,15 +3670,15 @@ fi
LIBTIFF_MAJOR_VERSION=4
-LIBTIFF_MINOR_VERSION=2
+LIBTIFF_MINOR_VERSION=3
LIBTIFF_MICRO_VERSION=0
LIBTIFF_ALPHA_VERSION=
LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
LIBTIFF_RELEASE_DATE=`date +"%Y%m%d"`
-LIBTIFF_CURRENT=11
+LIBTIFF_CURRENT=12
LIBTIFF_REVISION=0
-LIBTIFF_AGE=6
+LIBTIFF_AGE=7
LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
# This is a special hack for OpenBSD and MirOS systems. The dynamic linker
@@ -3680,6 +3702,69 @@ LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
+am__doit:
+ @echo this is the am__doit target >confinc.out
+.PHONY: am__doit
+END
+am__include="#"
+am__quote=
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ case $?:`cat confinc.out 2>/dev/null` in #(
+ '0:this is the am__doit target') :
+ case $s in #(
+ BSD) :
+ am__include='.include' am__quote='"' ;; #(
+ *) :
+ am__include='include' am__quote='' ;;
+esac ;; #(
+ *) :
+ ;;
+esac
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+ enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+ am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4527,69 +4612,6 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
-$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
-cat > confinc.mk << 'END'
-am__doit:
- @echo this is the am__doit target >confinc.out
-.PHONY: am__doit
-END
-am__include="#"
-am__quote=
-# BSD make does it like this.
-echo '.include "confinc.mk" # ignored' > confmf.BSD
-# Other make implementations (GNU, Solaris 10, AIX) do it like this.
-echo 'include confinc.mk # ignored' > confmf.GNU
-_am_result=no
-for s in GNU BSD; do
- { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
- (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- case $?:`cat confinc.out 2>/dev/null` in #(
- '0:this is the am__doit target') :
- case $s in #(
- BSD) :
- am__include='.include' am__quote='"' ;; #(
- *) :
- am__include='include' am__quote='' ;;
-esac ;; #(
- *) :
- ;;
-esac
- if test "$am__include" != "#"; then
- _am_result="yes ($s style)"
- break
- fi
-done
-rm -f confinc.* confmf.*
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
-$as_echo "${_am_result}" >&6; }
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
depcc="$CC" am_compiler_list=
@@ -4719,6 +4741,183 @@ else
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str;
+ int number;
+ float fnumber;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+}
+
+int
+main ()
+{
+
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c99"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
@@ -6165,7 +6364,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd*)
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
else
@@ -6524,7 +6723,7 @@ esac
fi
: ${AR=ar}
-: ${AR_FLAGS=cru}
+: ${AR_FLAGS=cr}
@@ -7025,11 +7224,8 @@ _LT_EOF
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -8248,8 +8444,8 @@ int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
- echo "$AR cru libconftest.a conftest.o" >&5
- $AR cru libconftest.a conftest.o 2>&5
+ echo "$AR cr libconftest.a conftest.o" >&5
+ $AR cr libconftest.a conftest.o 2>&5
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
@@ -9676,6 +9872,12 @@ lt_prog_compiler_static=
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
+ # flang / f18. f95 an alias for gfortran or flang on Debian
+ flang* | f18* | f95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
@@ -10152,6 +10354,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
openbsd* | bitrig*)
with_gnu_ld=no
;;
+ linux* | k*bsd*-gnu | gnu*)
+ link_all_deplibs=no
+ ;;
esac
ld_shlibs=yes
@@ -10406,7 +10611,7 @@ _LT_EOF
fi
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -11076,6 +11281,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
if test yes = "$lt_cv_irix_exported_symbol"; then
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
+ link_all_deplibs=no
else
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
@@ -11097,7 +11303,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
esac
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -12212,6 +12418,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -14020,7 +14238,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
else
GXX=no
@@ -14512,7 +14730,7 @@ fi
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -14577,7 +14795,7 @@ fi
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -14916,7 +15134,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
else
# FIXME: insert proper C++ library support
@@ -15000,7 +15218,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
@@ -15011,7 +15229,7 @@ fi
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
fi
hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
@@ -15524,7 +15742,7 @@ lt_prog_compiler_static_CXX=
;;
esac
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -15899,6 +16117,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
;;
esac
;;
+ linux* | k*bsd*-gnu | gnu*)
+ link_all_deplibs_CXX=no
+ ;;
*)
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@@ -16592,6 +16813,18 @@ fi
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -17113,48 +17346,6 @@ $as_echo "#define const /**/" >>confdefs.h
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- test "$ac_cv_c_inline" != no && break
-done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
- inline | yes) ;;
- *)
- case $ac_cv_c_inline in
- no) ac_val=;;
- *) ac_val=$ac_cv_c_inline;;
- esac
- cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
- ;;
-esac
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if ${ac_cv_c_bigendian+:} false; then :
@@ -17554,254 +17745,8 @@ _ACEOF
-# Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed int" >&5
-$as_echo_n "checking size of signed int... " >&6; }
-if ${ac_cv_sizeof_signed_int+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed int))" "ac_cv_sizeof_signed_int" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_signed_int" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (signed int)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_signed_int=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_int" >&5
-$as_echo "$ac_cv_sizeof_signed_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIGNED_INT $ac_cv_sizeof_signed_int
-_ACEOF
-
-
-
-# Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned int" >&5
-$as_echo_n "checking size of unsigned int... " >&6; }
-if ${ac_cv_sizeof_unsigned_int+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned int))" "ac_cv_sizeof_unsigned_int" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_unsigned_int" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (unsigned int)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_unsigned_int=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_int" >&5
-$as_echo "$ac_cv_sizeof_unsigned_int" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_INT $ac_cv_sizeof_unsigned_int
-_ACEOF
-
-
-
-# Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed long" >&5
-$as_echo_n "checking size of signed long... " >&6; }
-if ${ac_cv_sizeof_signed_long+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed long))" "ac_cv_sizeof_signed_long" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_signed_long" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (signed long)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_signed_long=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_long" >&5
-$as_echo "$ac_cv_sizeof_signed_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIGNED_LONG $ac_cv_sizeof_signed_long
-_ACEOF
-
-
-
-# Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long" >&5
-$as_echo_n "checking size of unsigned long... " >&6; }
-if ${ac_cv_sizeof_unsigned_long+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long))" "ac_cv_sizeof_unsigned_long" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_unsigned_long" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (unsigned long)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_unsigned_long=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long" >&5
-$as_echo "$ac_cv_sizeof_unsigned_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_LONG $ac_cv_sizeof_unsigned_long
-_ACEOF
-
-
-
-# Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG.
-# If 'long long' is not supported then the value defined is zero.
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of signed long long" >&5
-$as_echo_n "checking size of signed long long... " >&6; }
-if ${ac_cv_sizeof_signed_long_long+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (signed long long))" "ac_cv_sizeof_signed_long_long" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_signed_long_long" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (signed long long)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_signed_long_long=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_signed_long_long" >&5
-$as_echo "$ac_cv_sizeof_signed_long_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIGNED_LONG_LONG $ac_cv_sizeof_signed_long_long
-_ACEOF
-
-
-
-# Obtain size of a 'unsigned long long' and define as
-# SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
-# supported then the value defined is zero.
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned long long" >&5
-$as_echo_n "checking size of unsigned long long... " >&6; }
-if ${ac_cv_sizeof_unsigned_long_long+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long))" "ac_cv_sizeof_unsigned_long_long" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_unsigned_long_long" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (unsigned long long)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_unsigned_long_long=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long" >&5
-$as_echo "$ac_cv_sizeof_unsigned_long_long" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_LONG_LONG $ac_cv_sizeof_unsigned_long_long
-_ACEOF
-
-
-
-# Obtain the size of an 'unsigned char *' and define as
-# SIZEOF_UNSIGNED_CHAR_P. Result is available in
-# ac_cv_sizeof_unsigned_char_p.
-# The cast to long int works around a bug in the HP C Compiler
-# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
-# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
-# This bug is HP SR number 8606223364.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of unsigned char *" >&5
-$as_echo_n "checking size of unsigned char *... " >&6; }
-if ${ac_cv_sizeof_unsigned_char_p+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned char *))" "ac_cv_sizeof_unsigned_char_p" "$ac_includes_default"; then :
-
-else
- if test "$ac_cv_type_unsigned_char_p" = yes; then
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "cannot compute sizeof (unsigned char *)
-See \`config.log' for more details" "$LINENO" 5; }
- else
- ac_cv_sizeof_unsigned_char_p=0
- fi
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_char_p" >&5
-$as_echo "$ac_cv_sizeof_unsigned_char_p" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_UNSIGNED_CHAR_P $ac_cv_sizeof_unsigned_char_p
-_ACEOF
-
+# Disable deprecated features to ensure clean build
+CPPFLAGS="-DTIFF_DISABLE_DEPRECATED $CPPFLAGS"
# Obtain the size of 'size_t' and define as SIZEOF_SIZE_T. Result is
@@ -17840,241 +17785,34 @@ _ACEOF
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed 8-bit type" >&5
-$as_echo_n "checking for signed 8-bit type... " >&6; }
-INT8_T='signed char'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INT8_T" >&5
-$as_echo "$INT8_T" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_INT8_T $INT8_T
-_ACEOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned 8-bit type" >&5
-$as_echo_n "checking for unsigned 8-bit type... " >&6; }
-UINT8_T='unsigned char'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UINT8_T" >&5
-$as_echo "$UINT8_T" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_UINT8_T $UINT8_T
-_ACEOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed 16-bit type" >&5
-$as_echo_n "checking for signed 16-bit type... " >&6; }
-INT16_T='signed short'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INT16_T" >&5
-$as_echo "$INT16_T" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_INT16_T $INT16_T
-_ACEOF
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned 16-bit type" >&5
-$as_echo_n "checking for unsigned 16-bit type... " >&6; }
-UINT16_T='unsigned short'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UINT16_T" >&5
-$as_echo "$UINT16_T" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_UINT16_T $UINT16_T
-_ACEOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed 32-bit type" >&5
-$as_echo_n "checking for signed 32-bit type... " >&6; }
-INT32_T='none'
-INT32_FORMAT='none'
-if test $ac_cv_sizeof_signed_int -eq 4
-then
- INT32_T='signed int'
- INT32_FORMAT='"%d"'
-elif test $ac_cv_sizeof_signed_long -eq 4
-then
- INT32_T='signed long'
- INT32_FORMAT='"%ld"'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INT32_T" >&5
-$as_echo "$INT32_T" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_INT32_T $INT32_T
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_INT32_FORMAT $INT32_FORMAT
-_ACEOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned 32-bit type" >&5
-$as_echo_n "checking for unsigned 32-bit type... " >&6; }
-UINT32_T='none'
-UINT32_FORMAT='none'
-if test $ac_cv_sizeof_unsigned_int -eq 4
-then
- UINT32_T='unsigned int'
- UINT32_FORMAT='"%u"'
-elif test $ac_cv_sizeof_unsigned_long -eq 4
-then
- UINT32_T='unsigned long'
- UINT32_FORMAT='"%lu"'
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UINT32_T" >&5
-$as_echo "$UINT32_T" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_UINT32_T $UINT32_T
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_UINT32_FORMAT $UINT32_FORMAT
-_ACEOF
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed 64-bit type" >&5
-$as_echo_n "checking for signed 64-bit type... " >&6; }
-INT64_T='none'
-INT64_FORMAT='none'
-if test $ac_cv_sizeof_signed_long -eq 8
-then
- INT64_T='signed long'
- INT64_FORMAT='"%ld"'
-elif test $ac_cv_sizeof_signed_long_long -eq 8
-then
- INT64_T='signed long long'
- case "${host_os}" in
- mingw32*)
- # MinGW32 understands 'long long', but uses printf from WIN32 CRT
- INT64_FORMAT='"%I64d"'
- ;;
- *)
- INT64_FORMAT='"%lld"'
- ;;
- esac
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INT64_T" >&5
-$as_echo "$INT64_T" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_INT64_T $INT64_T
-_ACEOF
+# C99 fixed-size integer types
+INT8_T='int8_t'
+UINT8_T='uint8_t'
+INT16_T='int16_t'
+UINT16_T='uint16_t'
-cat >>confdefs.h <<_ACEOF
-#define TIFF_INT64_FORMAT $INT64_FORMAT
-_ACEOF
+INT32_T='int32_t'
+UINT32_T='uint32_t'
+INT64_T='int64_t'
+UINT64_T='uint64_t'
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned 64-bit type" >&5
-$as_echo_n "checking for unsigned 64-bit type... " >&6; }
-UINT64_T='none'
-UINT64_FORMAT='none'
-if test $ac_cv_sizeof_unsigned_long -eq 8
+if test $ac_cv_sizeof_size_t -eq 4
then
- UINT64_T='unsigned long'
- UINT64_FORMAT='"%lu"'
-elif test $ac_cv_sizeof_unsigned_long_long -eq 8
+ SSIZE_T='int32_t'
+elif test $ac_cv_sizeof_size_t -eq 8
then
- UINT64_T='unsigned long long'
- case "${host_os}" in
- mingw32*)
- # MinGW32 understands 'unsigned long long', but uses printf from WIN32 CRT
- UINT64_FORMAT='"%I64u"'
- ;;
- *)
- UINT64_FORMAT='"%llu"'
- ;;
- esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $UINT64_T" >&5
-$as_echo "$UINT64_T" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_UINT64_T $UINT64_T
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_UINT64_FORMAT $UINT64_FORMAT
-_ACEOF
-
-
-# Determine formatting specifier for 'size_t'. While the size should
-# be precise, the type determined may not match the system definition.
-# A named type is provided to allow casting to the type we determined
-# without changing the actual size.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 'size_t' format specifier" >&5
-$as_echo_n "checking for 'size_t' format specifier... " >&6; }
-SIZE_T='unknown'
-SIZE_FORMAT='unknown'
-if test $ac_cv_sizeof_unsigned_int -eq $ac_cv_sizeof_size_t
-then
- SIZE_T='unsigned int'
- SIZE_FORMAT='"%u"'
-elif test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_size_t
-then
- SIZE_T='unsigned long'
- SIZE_FORMAT='"%lu"'
-elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_size_t
-then
- SIZE_T='unsigned long long'
- case "${host_os}" in
- mingw32*)
- # MinGW32 understands 'unsigned long long', but uses printf from WIN32 CRT
- SIZE_FORMAT='"%I64u"'
- ;;
- *)
- SIZE_FORMAT='"%llu"'
- ;;
- esac
+ SSIZE_T='int64_t'
+else
+ as_fn_error $? "Unsupported size_t size ${ac_cv_sizeof_size_t}; please add support" "$LINENO" 5
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SIZE_FORMAT" >&5
-$as_echo "$SIZE_FORMAT" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_SIZE_T $SIZE_T
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_SIZE_FORMAT $SIZE_FORMAT
-_ACEOF
# Determine TIFF equivalent of ssize_t
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for signed size type" >&5
$as_echo_n "checking for signed size type... " >&6; }
-SSIZE_T='unknown'
-SSIZE_FORMAT='unknown'
-if test $ac_cv_sizeof_signed_int -eq $ac_cv_sizeof_size_t
-then
- SSIZE_T='signed int'
- SSIZE_FORMAT='"%d"'
-elif test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_size_t
-then
- SSIZE_T='signed long'
- SSIZE_FORMAT='"%ld"'
-elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_size_t
-then
- SSIZE_T='signed long long'
- case "${host_os}" in
- mingw32*)
- # MinGW32 understands 'long long', but uses printf from WIN32 CRT
- SSIZE_FORMAT='"%I64d"'
- ;;
- *)
- SSIZE_FORMAT='"%lld"'
- ;;
- esac
-fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SSIZE_T" >&5
$as_echo "$SSIZE_T" >&6; }
@@ -18083,42 +17821,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
-cat >>confdefs.h <<_ACEOF
-#define TIFF_SSIZE_FORMAT $SSIZE_FORMAT
-_ACEOF
-
-
-# Determine the type to use for the difference between two pointers.
-# We will default to the POSIX ptrdiff_t if it is available, but will
-# be prepared for the case when it is not.
-PTRDIFF_T='unknown'
-PTRDIFF_FORMAT='"%ld"'
-ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
- PTRDIFF_T=ptrdiff_t
-fi
-
-if test $PTRDIFF_T = unknown
-then
- PTRDIFF_T=$SSIZE_T
- PTRDIFF_FORMAT=$SSIZE_FORMAT
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pointer difference type" >&5
-$as_echo_n "checking for pointer difference type... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTRDIFF_T" >&5
-$as_echo "$PTRDIFF_T" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_PTRDIFF_T $PTRDIFF_T
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define TIFF_PTRDIFF_FORMAT $PTRDIFF_FORMAT
-_ACEOF
-
-
-for ac_func in mmap setmode snprintf
+for ac_func in mmap setmode
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -18145,104 +17848,6 @@ esac
fi
-ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
-if test "x$ac_cv_func_snprintf" = xyes; then :
- $as_echo "#define HAVE_SNPRINTF 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" snprintf.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS snprintf.$ac_objext"
- ;;
-esac
-
-fi
-
-
-ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp"
-if test "x$ac_cv_func_strcasecmp" = xyes; then :
- $as_echo "#define HAVE_STRCASECMP 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" strcasecmp.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strcasecmp.$ac_objext"
- ;;
-esac
-
-fi
-
-
-ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol"
-if test "x$ac_cv_func_strtol" = xyes; then :
- $as_echo "#define HAVE_STRTOL 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" strtol.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strtol.$ac_objext"
- ;;
-esac
-
-fi
-
-
-ac_fn_c_check_func "$LINENO" "strtoll" "ac_cv_func_strtoll"
-if test "x$ac_cv_func_strtoll" = xyes; then :
- $as_echo "#define HAVE_STRTOLL 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" strtoll.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strtoll.$ac_objext"
- ;;
-esac
-
-fi
-
-
-ac_fn_c_check_func "$LINENO" "strtoul" "ac_cv_func_strtoul"
-if test "x$ac_cv_func_strtoul" = xyes; then :
- $as_echo "#define HAVE_STRTOUL 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" strtoul.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strtoul.$ac_objext"
- ;;
-esac
-
-fi
-
-
-ac_fn_c_check_func "$LINENO" "strtoull" "ac_cv_func_strtoull"
-if test "x$ac_cv_func_strtoull" = xyes; then :
- $as_echo "#define HAVE_STRTOULL 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" strtoull.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS strtoull.$ac_objext"
- ;;
-esac
-
-fi
-
-
-ac_fn_c_check_func "$LINENO" "lfind" "ac_cv_func_lfind"
-if test "x$ac_cv_func_lfind" = xyes; then :
- $as_echo "#define HAVE_LFIND 1" >>confdefs.h
-
-else
- case " $LIBOBJS " in
- *" lfind.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS lfind.$ac_objext"
- ;;
-esac
-
-fi
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking native cpu bit order" >&5
$as_echo_n "checking native cpu bit order... " >&6; }
@@ -18328,7 +17933,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -18374,7 +17979,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -18398,7 +18003,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -18443,7 +18048,7 @@ else
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -18467,7 +18072,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
&& LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
@@ -18520,6 +18125,8 @@ fi
+
+
# Check whether --enable-ccitt was given.
if test "${enable_ccitt+set}" = set; then :
enableval=$enable_ccitt; HAVE_CCITT=$enableval
@@ -19123,6 +18730,172 @@ fi
+HAVE_LERC=no
+
+# Check whether --enable-lerc was given.
+if test "${enable_lerc+set}" = set; then :
+ enableval=$enable_lerc;
+fi
+
+
+# Check whether --with-lerc-include-dir was given.
+if test "${with_lerc_include_dir+set}" = set; then :
+ withval=$with_lerc_include_dir;
+fi
+
+
+# Check whether --with-lerc-lib-dir was given.
+if test "${with_lerc_lib_dir+set}" = set; then :
+ withval=$with_lerc_lib_dir;
+fi
+
+
+if test "x$enable_lerc" != "xno" ; then
+
+ if test "x$with_lerc_lib_dir" != "x" ; then
+ LDFLAGS="-L$with_lerc_lib_dir $LDFLAGS"
+ fi
+
+ lerc_lib_name="LercLib"
+ as_ac_Lib=`$as_echo "ac_cv_lib_"$lerc_lib_name"''_lerc_decode" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lerc_decode in -l\"$lerc_lib_name\"" >&5
+$as_echo_n "checking for lerc_decode in -l\"$lerc_lib_name\"... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l"$lerc_lib_name" $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lerc_decode ();
+int
+main ()
+{
+return lerc_decode ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$as_ac_Lib=yes"
+else
+ eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+ lerc_lib=yes
+else
+ lerc_lib=no
+fi
+
+ if test "$lerc_lib" = "no" ; then
+ lerc_lib_name="Lerc"
+ as_ac_Lib=`$as_echo "ac_cv_lib_"$lerc_lib_name"''_lerc_decode" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lerc_decode in -l\"$lerc_lib_name\"" >&5
+$as_echo_n "checking for lerc_decode in -l\"$lerc_lib_name\"... " >&6; }
+if eval \${$as_ac_Lib+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l"$lerc_lib_name" $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lerc_decode ();
+int
+main ()
+{
+return lerc_decode ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ eval "$as_ac_Lib=yes"
+else
+ eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+ lerc_lib=yes
+else
+ lerc_lib=no
+fi
+
+ fi
+ if test "$lerc_lib" = "no" -a "x$with_lerc_lib_dir" != "x"; then
+ as_fn_error $? "lerc library not found at $with_lerc_lib_dir" "$LINENO" 5
+ fi
+
+ if test "x$with_lerc_include_dir" != "x" ; then
+ CPPFLAGS="-I$with_lerc_include_dir $CPPFLAGS"
+ fi
+ ac_fn_c_check_header_mongrel "$LINENO" "Lerc_c_api.h" "ac_cv_header_Lerc_c_api_h" "$ac_includes_default"
+if test "x$ac_cv_header_Lerc_c_api_h" = xyes; then :
+ lerc_c_api_h=yes
+else
+ lerc_c_api_h=no
+fi
+
+
+ if test "$lerc_c_api_h" = "no" -a "x$with_lerc_include_dir" != "x" ; then
+ as_fn_error $? "Liblerc headers not found at $with_lerc_include_dir" "$LINENO" 5
+ fi
+
+ if test "$lerc_lib" = "yes" -a "$lerc_c_api_h" = "yes" ; then
+ HAVE_LERC=yes
+ fi
+
+fi
+
+if test "$HAVE_LERC" = "yes" ; then
+
+$as_echo "#define LERC_SUPPORT 1" >>confdefs.h
+
+ LIBS="-l${lerc_lib_name} $LIBS"
+ tiff_libs_private="-l${lerc_lib_name} ${tiff_libs_private}"
+
+ if test "$HAVE_RPATH" = "yes" -a "x$with_lerc_lib_dir" != "x" ; then
+ LIBDIR="-R $with_lerc_lib_dir $LIBDIR"
+ fi
+
+fi
+
+ if test "$HAVE_LERC" = 'yes'; then
+ HAVE_LERC_TRUE=
+ HAVE_LERC_FALSE='#'
+else
+ HAVE_LERC_TRUE='#'
+ HAVE_LERC_FALSE=
+fi
+
+
+
HAVE_LZMA=no
# Check whether --enable-lzma was given.
@@ -21243,7 +21016,7 @@ fi
-ac_config_headers="$ac_config_headers libtiff/tif_config.h libtiff/tiffconf.h"
+ac_config_headers="$ac_config_headers config.h libtiff/tif_config.h libtiff/tiffconf.h port/libport_config.h"
ac_config_files="$ac_config_files Makefile build/Makefile contrib/Makefile contrib/addtiffo/Makefile contrib/dbs/Makefile contrib/dbs/xtiff/Makefile contrib/iptcutil/Makefile contrib/mfs/Makefile contrib/pds/Makefile contrib/ras/Makefile contrib/stream/Makefile contrib/tags/Makefile contrib/win_dib/Makefile html/Makefile html/images/Makefile html/man/Makefile libtiff-4.pc libtiff/Makefile man/Makefile port/Makefile test/Makefile tools/Makefile"
@@ -21406,6 +21179,10 @@ if test -z "${HAVE_JBIG_TRUE}" && test -z "${HAVE_JBIG_FALSE}"; then
as_fn_error $? "conditional \"HAVE_JBIG\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${HAVE_LERC_TRUE}" && test -z "${HAVE_LERC_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_LERC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${HAVE_LZMA_TRUE}" && test -z "${HAVE_LZMA_FALSE}"; then
as_fn_error $? "conditional \"HAVE_LZMA\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -21827,7 +21604,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by LibTIFF Software $as_me 4.2.0, which was
+This file was extended by LibTIFF Software $as_me 4.3.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -21893,7 +21670,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-LibTIFF Software config.status 4.2.0
+LibTIFF Software config.status 4.3.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -22407,8 +22184,10 @@ do
case $ac_config_target in
"depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
"libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"libtiff/tif_config.h") CONFIG_HEADERS="$CONFIG_HEADERS libtiff/tif_config.h" ;;
"libtiff/tiffconf.h") CONFIG_HEADERS="$CONFIG_HEADERS libtiff/tiffconf.h" ;;
+ "port/libport_config.h") CONFIG_HEADERS="$CONFIG_HEADERS port/libport_config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"build/Makefile") CONFIG_FILES="$CONFIG_FILES build/Makefile" ;;
"contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;;
@@ -23108,9 +22887,7 @@ $as_echo X/"$am_mf" |
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "Something went wrong bootstrapping makefile fragments
- for automatic dependency tracking. If GNU make was not used, consider
- re-running the configure script with MAKE=\"gmake\" (or whatever is
- necessary). You can also try re-running configure with the
+ for automatic dependency tracking. Try re-running configure with the
'--disable-dependency-tracking' option to at least be able to build
the package (albeit without support for automatic dependency tracking).
See \`config.log' for more details" "$LINENO" 5; }
@@ -23137,7 +22914,6 @@ See \`config.log' for more details" "$LINENO" 5; }
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
@@ -23885,7 +23661,7 @@ echo " C++ compiler: ${CXX} ${CXXFLAGS}"
echo " Enable runtime linker paths: ${HAVE_RPATH}"
echo " Enable linker symbol versioning: ${have_ld_version_script}"
echo " Support Microsoft Document Imaging: ${HAVE_MDI}"
-echo " Use win32 IO: ${win32_io_ok}"
+echo " Use Win32 IO: ${win32_io_ok}"
echo ""
echo " Support for internal codecs:"
echo " CCITT Group 3 & 4 algorithms: ${HAVE_CCITT}"
@@ -23903,6 +23679,7 @@ echo " JPEG support: ${HAVE_JPEG}"
echo " Old JPEG support: ${HAVE_OJPEG}"
echo " JPEG 8/12 bit dual mode: ${HAVE_JPEG12}"
echo " ISO JBIG support: ${HAVE_JBIG}"
+echo " LERC support: ${HAVE_LERC}"
echo " LZMA2 support: ${HAVE_LZMA}"
echo " ZSTD support: ${HAVE_ZSTD}"
echo " WEBP support: ${HAVE_WEBP}"
diff --git a/tiff/configure.ac b/tiff/configure.ac
index a2242330..acde12bf 100644
--- a/tiff/configure.ac
+++ b/tiff/configure.ac
@@ -25,7 +25,7 @@ dnl OF THIS SOFTWARE.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.64)
-AC_INIT([LibTIFF Software],[4.2.0],[tiff@lists.maptools.org],[tiff])
+AC_INIT([LibTIFF Software],[4.3.0],[tiff@lists.maptools.org],[tiff])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR(m4)
AC_LANG(C)
@@ -40,7 +40,7 @@ AM_MAINTAINER_MODE
dnl Versioning.
dnl Don't fill the ALPHA_VERSION field, if not applicable.
LIBTIFF_MAJOR_VERSION=4
-LIBTIFF_MINOR_VERSION=2
+LIBTIFF_MINOR_VERSION=3
LIBTIFF_MICRO_VERSION=0
LIBTIFF_ALPHA_VERSION=
LIBTIFF_VERSION=$LIBTIFF_MAJOR_VERSION.$LIBTIFF_MINOR_VERSION.$LIBTIFF_MICRO_VERSION$LIBTIFF_ALPHA_VERSION
@@ -76,9 +76,9 @@ dnl 5. If any interfaces have been added since the last public release, then
dnl increment age.
dnl 6. If any interfaces have been removed since the last public release,
dnl then set age to 0.
-LIBTIFF_CURRENT=11
+LIBTIFF_CURRENT=12
LIBTIFF_REVISION=0
-LIBTIFF_AGE=6
+LIBTIFF_AGE=7
LIBTIFF_VERSION_INFO=$LIBTIFF_CURRENT:$LIBTIFF_REVISION:$LIBTIFF_AGE
# This is a special hack for OpenBSD and MirOS systems. The dynamic linker
@@ -103,7 +103,7 @@ AC_SUBST(LIBTIFF_VERSION_INFO)
AC_SUBST(LIBTIFF_RELEASE_DATE)
dnl Checks for programs.
-AC_PROG_CC
+AC_PROG_CC_C99
AM_PROG_CC_C_O
dnl We want warnings. As many warnings as possible.
@@ -178,7 +178,6 @@ AC_CHECK_HEADERS([assert.h fcntl.h io.h search.h unistd.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
-AC_C_INLINE
AC_C_BIGENDIAN
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
@@ -193,231 +192,55 @@ dnl Check if optarg (and presumably related externs) already declared in headers
AC_CHECK_DECLS([optarg])
dnl ---------------------------------------------------------------------------
-dnl Compute sized types for current CPU and compiler options
+dnl Deprecated features and backward compatibilty
dnl ---------------------------------------------------------------------------
-# Obtain size of an 'signed int' and define as SIZEOF_SIGNED_INT
-AC_CHECK_SIZEOF(signed int)
-
-# Obtain size of an 'unsigned int' and define as SIZEOF_UNSIGNED_INT
-AC_CHECK_SIZEOF(unsigned int)
-
-# Obtain size of a 'signed long' and define as SIZEOF_SIGNED_LONG
-AC_CHECK_SIZEOF(signed long)
-
-# Obtain size of a 'unsigned long' and define as SIZEOF_UNSIGNED_LONG
-AC_CHECK_SIZEOF(unsigned long)
+# Disable deprecated features to ensure clean build
+CPPFLAGS="-DTIFF_DISABLE_DEPRECATED $CPPFLAGS"
-# Obtain size of a 'long long' and define as SIZEOF_SIGNED_LONG_LONG.
-# If 'long long' is not supported then the value defined is zero.
-AC_CHECK_SIZEOF(signed long long)
-
-# Obtain size of a 'unsigned long long' and define as
-# SIZEOF_UNSIGNED_LONG_LONG. If 'unsigned long long' is not
-# supported then the value defined is zero.
-AC_CHECK_SIZEOF(unsigned long long)
-
-# Obtain the size of an 'unsigned char *' and define as
-# SIZEOF_UNSIGNED_CHAR_P. Result is available in
-# ac_cv_sizeof_unsigned_char_p.
-AC_CHECK_SIZEOF(unsigned char *)
+dnl ---------------------------------------------------------------------------
+dnl Compute sized types for current CPU and compiler options
+dnl ---------------------------------------------------------------------------
# Obtain the size of 'size_t' and define as SIZEOF_SIZE_T. Result is
# available in ac_cv_sizeof_size_t
AC_CHECK_SIZEOF([size_t])
-AC_MSG_CHECKING(for signed 8-bit type)
-INT8_T='signed char'
-AC_MSG_RESULT($INT8_T)
-AC_DEFINE_UNQUOTED(TIFF_INT8_T,$INT8_T,[Signed 8-bit type])
-AC_MSG_CHECKING(for unsigned 8-bit type)
-UINT8_T='unsigned char'
-AC_MSG_RESULT($UINT8_T)
-AC_DEFINE_UNQUOTED(TIFF_UINT8_T,$UINT8_T,[Unsigned 8-bit type])
+# C99 fixed-size integer types
+INT8_T='int8_t'
+UINT8_T='uint8_t'
-AC_MSG_CHECKING(for signed 16-bit type)
-INT16_T='signed short'
-AC_MSG_RESULT($INT16_T)
-AC_DEFINE_UNQUOTED(TIFF_INT16_T,$INT16_T,[Signed 16-bit type])
+INT16_T='int16_t'
+UINT16_T='uint16_t'
+INT32_T='int32_t'
+UINT32_T='uint32_t'
-AC_MSG_CHECKING(for unsigned 16-bit type)
-UINT16_T='unsigned short'
-AC_MSG_RESULT($UINT16_T)
-AC_DEFINE_UNQUOTED(TIFF_UINT16_T,$UINT16_T,[Unsigned 16-bit type])
+INT64_T='int64_t'
+UINT64_T='uint64_t'
-AC_MSG_CHECKING(for signed 32-bit type)
-INT32_T='none'
-INT32_FORMAT='none'
-if test $ac_cv_sizeof_signed_int -eq 4
-then
- INT32_T='signed int'
- INT32_FORMAT='"%d"'
-elif test $ac_cv_sizeof_signed_long -eq 4
-then
- INT32_T='signed long'
- INT32_FORMAT='"%ld"'
-fi
-AC_MSG_RESULT($INT32_T)
-AC_DEFINE_UNQUOTED(TIFF_INT32_T,$INT32_T,[Signed 32-bit type])
-AC_DEFINE_UNQUOTED(TIFF_INT32_FORMAT,$INT32_FORMAT,[Signed 32-bit type formatter])
-
-AC_MSG_CHECKING(for unsigned 32-bit type)
-UINT32_T='none'
-UINT32_FORMAT='none'
-if test $ac_cv_sizeof_unsigned_int -eq 4
+if test $ac_cv_sizeof_size_t -eq 4
then
- UINT32_T='unsigned int'
- UINT32_FORMAT='"%u"'
-elif test $ac_cv_sizeof_unsigned_long -eq 4
+ SSIZE_T='int32_t'
+elif test $ac_cv_sizeof_size_t -eq 8
then
- UINT32_T='unsigned long'
- UINT32_FORMAT='"%lu"'
-fi
-AC_MSG_RESULT($UINT32_T)
-AC_DEFINE_UNQUOTED(TIFF_UINT32_T,$UINT32_T,[Unsigned 32-bit type])
-AC_DEFINE_UNQUOTED(TIFF_UINT32_FORMAT,$UINT32_FORMAT,[Unsigned 32-bit type formatter])
-
-AC_MSG_CHECKING(for signed 64-bit type)
-INT64_T='none'
-INT64_FORMAT='none'
-if test $ac_cv_sizeof_signed_long -eq 8
-then
- INT64_T='signed long'
- INT64_FORMAT='"%ld"'
-elif test $ac_cv_sizeof_signed_long_long -eq 8
-then
- INT64_T='signed long long'
- case "${host_os}" in
- mingw32*)
- # MinGW32 understands 'long long', but uses printf from WIN32 CRT
- INT64_FORMAT='"%I64d"'
- ;;
- *)
- INT64_FORMAT='"%lld"'
- ;;
- esac
+ SSIZE_T='int64_t'
+else
+ AC_MSG_ERROR([Unsupported size_t size ${ac_cv_sizeof_size_t}; please add support])
fi
-AC_MSG_RESULT($INT64_T)
-AC_DEFINE_UNQUOTED(TIFF_INT64_T,$INT64_T,[Signed 64-bit type])
-AC_DEFINE_UNQUOTED(TIFF_INT64_FORMAT,$INT64_FORMAT,[Signed 64-bit type formatter])
-
-AC_MSG_CHECKING(for unsigned 64-bit type)
-UINT64_T='none'
-UINT64_FORMAT='none'
-if test $ac_cv_sizeof_unsigned_long -eq 8
-then
- UINT64_T='unsigned long'
- UINT64_FORMAT='"%lu"'
-elif test $ac_cv_sizeof_unsigned_long_long -eq 8
-then
- UINT64_T='unsigned long long'
- case "${host_os}" in
- mingw32*)
- # MinGW32 understands 'unsigned long long', but uses printf from WIN32 CRT
- UINT64_FORMAT='"%I64u"'
- ;;
- *)
- UINT64_FORMAT='"%llu"'
- ;;
- esac
-fi
-AC_MSG_RESULT($UINT64_T)
-AC_DEFINE_UNQUOTED(TIFF_UINT64_T,$UINT64_T,[Unsigned 64-bit type])
-AC_DEFINE_UNQUOTED(TIFF_UINT64_FORMAT,$UINT64_FORMAT,[Unsigned 64-bit type formatter])
-
-# Determine formatting specifier for 'size_t'. While the size should
-# be precise, the type determined may not match the system definition.
-# A named type is provided to allow casting to the type we determined
-# without changing the actual size.
-AC_MSG_CHECKING([for 'size_t' format specifier])
-SIZE_T='unknown'
-SIZE_FORMAT='unknown'
-if test $ac_cv_sizeof_unsigned_int -eq $ac_cv_sizeof_size_t
-then
- SIZE_T='unsigned int'
- SIZE_FORMAT='"%u"'
-elif test $ac_cv_sizeof_unsigned_long -eq $ac_cv_sizeof_size_t
-then
- SIZE_T='unsigned long'
- SIZE_FORMAT='"%lu"'
-elif test $ac_cv_sizeof_unsigned_long_long -eq $ac_cv_sizeof_size_t
-then
- SIZE_T='unsigned long long'
- case "${host_os}" in
- mingw32*)
- # MinGW32 understands 'unsigned long long', but uses printf from WIN32 CRT
- SIZE_FORMAT='"%I64u"'
- ;;
- *)
- SIZE_FORMAT='"%llu"'
- ;;
- esac
-fi
-AC_MSG_RESULT([$SIZE_FORMAT])
-AC_DEFINE_UNQUOTED([TIFF_SIZE_T],[$SIZE_T],[Unsigned size type])
-AC_DEFINE_UNQUOTED([TIFF_SIZE_FORMAT],[$SIZE_FORMAT],[Size type formatter])
-
# Determine TIFF equivalent of ssize_t
AC_MSG_CHECKING(for signed size type)
-SSIZE_T='unknown'
-SSIZE_FORMAT='unknown'
-if test $ac_cv_sizeof_signed_int -eq $ac_cv_sizeof_size_t
-then
- SSIZE_T='signed int'
- SSIZE_FORMAT='"%d"'
-elif test $ac_cv_sizeof_signed_long -eq $ac_cv_sizeof_size_t
-then
- SSIZE_T='signed long'
- SSIZE_FORMAT='"%ld"'
-elif test $ac_cv_sizeof_signed_long_long -eq $ac_cv_sizeof_size_t
-then
- SSIZE_T='signed long long'
- case "${host_os}" in
- mingw32*)
- # MinGW32 understands 'long long', but uses printf from WIN32 CRT
- SSIZE_FORMAT='"%I64d"'
- ;;
- *)
- SSIZE_FORMAT='"%lld"'
- ;;
- esac
-fi
AC_MSG_RESULT($SSIZE_T)
AC_DEFINE_UNQUOTED(TIFF_SSIZE_T,$SSIZE_T,[Signed size type])
-AC_DEFINE_UNQUOTED(TIFF_SSIZE_FORMAT,$SSIZE_FORMAT,[Signed size type formatter])
-
-# Determine the type to use for the difference between two pointers.
-# We will default to the POSIX ptrdiff_t if it is available, but will
-# be prepared for the case when it is not.
-PTRDIFF_T='unknown'
-PTRDIFF_FORMAT='"%ld"'
-AC_CHECK_TYPE(ptrdiff_t,[PTRDIFF_T=ptrdiff_t])
-if test $PTRDIFF_T = unknown
-then
- PTRDIFF_T=$SSIZE_T
- PTRDIFF_FORMAT=$SSIZE_FORMAT
-fi
-AC_MSG_CHECKING(for pointer difference type)
-AC_MSG_RESULT($PTRDIFF_T)
-AC_DEFINE_UNQUOTED(TIFF_PTRDIFF_T,$PTRDIFF_T,[Pointer difference type])
-AC_DEFINE_UNQUOTED(TIFF_PTRDIFF_FORMAT,$PTRDIFF_FORMAT,[Pointer difference type formatter])
dnl Checks for library functions.
-AC_CHECK_FUNCS([mmap setmode snprintf])
+AC_CHECK_FUNCS([mmap setmode])
dnl Will use local replacements for unavailable functions
AC_REPLACE_FUNCS(getopt)
-AC_REPLACE_FUNCS(snprintf)
-AC_REPLACE_FUNCS(strcasecmp)
-AC_REPLACE_FUNCS(strtol)
-AC_REPLACE_FUNCS(strtoll)
-AC_REPLACE_FUNCS(strtoul)
-AC_REPLACE_FUNCS(strtoull)
-AC_REPLACE_FUNCS(lfind)
dnl ---------------------------------------------------------------------------
dnl Check the native cpu bit order.
@@ -456,7 +279,7 @@ dnl Set the floating point format.
dnl FIXME: write appropriate test.
dnl ---------------------------------------------------------------------------
HAVE_IEEEFP=1
-AC_DEFINE_UNQUOTED(HAVE_IEEEFP, $HAVE_IEEEFP, [Define as 0 or 1 according to the floating point format suported by the machine])
+AC_DEFINE_UNQUOTED(HAVE_IEEEFP, $HAVE_IEEEFP, [Define as 0 or 1 according to the floating point format supported by the machine])
dnl ---------------------------------------------------------------------------
dnl Enable run-time paths to libraries usage.
@@ -489,6 +312,8 @@ fi
AC_SUBST(LIBTIFF_DOCDIR)
+
+
dnl ---------------------------------------------------------------------------
dnl Switch on/off internal codecs.
dnl ---------------------------------------------------------------------------
@@ -817,6 +642,65 @@ fi
AM_CONDITIONAL(HAVE_JBIG, test "$HAVE_JBIG" = 'yes')
dnl ---------------------------------------------------------------------------
+dnl Check for liblerc.
+dnl ---------------------------------------------------------------------------
+
+HAVE_LERC=no
+
+AC_ARG_ENABLE(lerc,
+ AS_HELP_STRING([--disable-lerc],
+ [disable liblerc usage (required for lerc compression, enabled by default)]),,)
+AC_ARG_WITH(lerc-include-dir,
+ AS_HELP_STRING([--with-lerc-include-dir=DIR],
+ [location of liblerc headers]),,)
+AC_ARG_WITH(lerc-lib-dir,
+ AS_HELP_STRING([--with-lerc-lib-dir=DIR],
+ [location of liblerc library binary]),,)
+
+if test "x$enable_lerc" != "xno" ; then
+
+ if test "x$with_lerc_lib_dir" != "x" ; then
+ LDFLAGS="-L$with_lerc_lib_dir $LDFLAGS"
+ fi
+
+ lerc_lib_name="LercLib"
+ AC_CHECK_LIB("$lerc_lib_name", lerc_decode, [lerc_lib=yes], [lerc_lib=no],)
+ if test "$lerc_lib" = "no" ; then
+ lerc_lib_name="Lerc"
+ AC_CHECK_LIB("$lerc_lib_name", lerc_decode, [lerc_lib=yes], [lerc_lib=no],)
+ fi
+ if test "$lerc_lib" = "no" -a "x$with_lerc_lib_dir" != "x"; then
+ AC_MSG_ERROR([lerc library not found at $with_lerc_lib_dir])
+ fi
+
+ if test "x$with_lerc_include_dir" != "x" ; then
+ CPPFLAGS="-I$with_lerc_include_dir $CPPFLAGS"
+ fi
+ AC_CHECK_HEADER(Lerc_c_api.h, [lerc_c_api_h=yes], [lerc_c_api_h=no])
+ if test "$lerc_c_api_h" = "no" -a "x$with_lerc_include_dir" != "x" ; then
+ AC_MSG_ERROR([Liblerc headers not found at $with_lerc_include_dir])
+ fi
+
+ if test "$lerc_lib" = "yes" -a "$lerc_c_api_h" = "yes" ; then
+ HAVE_LERC=yes
+ fi
+
+fi
+
+if test "$HAVE_LERC" = "yes" ; then
+ AC_DEFINE(LERC_SUPPORT,1,[Support lerc compression])
+ LIBS="-l${lerc_lib_name} $LIBS"
+ tiff_libs_private="-l${lerc_lib_name} ${tiff_libs_private}"
+
+ if test "$HAVE_RPATH" = "yes" -a "x$with_lerc_lib_dir" != "x" ; then
+ LIBDIR="-R $with_lerc_lib_dir $LIBDIR"
+ fi
+
+fi
+
+AM_CONDITIONAL(HAVE_LERC, test "$HAVE_LERC" = 'yes')
+
+dnl ---------------------------------------------------------------------------
dnl Check for liblzma2.
dnl ---------------------------------------------------------------------------
@@ -1106,7 +990,7 @@ dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE(strip-chopping,
AS_HELP_STRING([--disable-strip-chopping],
- [disable support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)]),
+ [disable support for strip chopping (whether or not to convert single-strip uncompressed images to multiple strips of specified size to reduce memory usage)]),
[HAVE_STRIPCHOP=$enableval], [HAVE_STRIPCHOP=yes])
AC_ARG_WITH(default-strip-size,
AS_HELP_STRING([--with-default-strip-size=SIZE],
@@ -1114,7 +998,7 @@ AC_ARG_WITH(default-strip-size,
if test "$HAVE_STRIPCHOP" = "yes" \
-a "x$with_default_strip_size" != "xno"; then
- AC_DEFINE(STRIPCHOP_DEFAULT,TIFF_STRIPCHOP,[Support strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of specified size to reduce memory usage)])
+ AC_DEFINE(STRIPCHOP_DEFAULT,TIFF_STRIPCHOP,[Support strip chopping (whether or not to convert single-strip uncompressed images to multiple strips of specified size to reduce memory usage)])
if test "x$with_default_strip_size" = "x" \
-o "x$with_default_strip_size" = "xyes"; then
@@ -1196,7 +1080,7 @@ dnl ---------------------------------------------------------------------------
AC_SUBST(LIBDIR)
-AC_CONFIG_HEADERS([libtiff/tif_config.h libtiff/tiffconf.h])
+AC_CONFIG_HEADERS([config.h libtiff/tif_config.h libtiff/tiffconf.h port/libport_config.h])
AC_CONFIG_FILES([Makefile \
build/Makefile \
@@ -1236,7 +1120,7 @@ LOC_MSG([ C++ compiler: ${CXX} ${CXXFLAGS}])
LOC_MSG([ Enable runtime linker paths: ${HAVE_RPATH}])
LOC_MSG([ Enable linker symbol versioning: ${have_ld_version_script}])
LOC_MSG([ Support Microsoft Document Imaging: ${HAVE_MDI}])
-LOC_MSG([ Use win32 IO: ${win32_io_ok}])
+LOC_MSG([ Use Win32 IO: ${win32_io_ok}])
LOC_MSG()
LOC_MSG([ Support for internal codecs:])
LOC_MSG([ CCITT Group 3 & 4 algorithms: ${HAVE_CCITT}])
@@ -1254,6 +1138,7 @@ LOC_MSG([ JPEG support: ${HAVE_JPEG}])
LOC_MSG([ Old JPEG support: ${HAVE_OJPEG}])
LOC_MSG([ JPEG 8/12 bit dual mode: ${HAVE_JPEG12}])
LOC_MSG([ ISO JBIG support: ${HAVE_JBIG}])
+LOC_MSG([ LERC support: ${HAVE_LERC}])
LOC_MSG([ LZMA2 support: ${HAVE_LZMA}])
LOC_MSG([ ZSTD support: ${HAVE_ZSTD}])
LOC_MSG([ WEBP support: ${HAVE_WEBP}])
diff --git a/tiff/configure.com b/tiff/configure.com
deleted file mode 100644
index a3064425..00000000
--- a/tiff/configure.com
+++ /dev/null
@@ -1,1356 +0,0 @@
-$!
-$! OpenVMS configure procedure for libtiff
-$! (c) Alexey Chupahin 22-NOV-2007
-$! elvis_75@mail.ru
-$!
-$! Permission to use, copy, modify, distribute, and sell this software and
-$! its documentation for any purpose is hereby granted without fee, provided
-$! that (i) the above copyright notices and this permission notice appear in
-$! all copies of the software and related documentation, and (ii) the names of
-$! Sam Leffler and Silicon Graphics may not be used in any advertising or
-$! publicity relating to the software without the specific, prior written
-$! permission of Sam Leffler and Silicon Graphics.
-$!
-$! THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-$! EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-$! WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-$!
-$! IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-$! ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-$! OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-$! WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-$! LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-$! OF THIS SOFTWARE.
-$!
-$!
-$ SET NOON
-$WRITE SYS$OUTPUT " "
-$WRITE SYS$OUTPUT "Configuring libTIFF library"
-$WRITE SYS$OUTPUT " "
-$! Checking architecture
-$DECC = F$SEARCH("SYS$SYSTEM:DECC$COMPILER.EXE") .NES. ""
-$IF (.NOT. DECC) THEN $WRITE SYS$OUTPUT "BAD compiler" GOTO EXIT
-$ IF F$GETSYI("ARCH_TYPE").EQ.1 THEN CPU = "VAX"
-$ IF F$GETSYI("ARCH_TYPE").EQ.2 THEN CPU = "Alpha"
-$ IF F$GETSYI("ARCH_TYPE").EQ.3 THEN CPU = "I64"
-$ OS = F$GETSYI("VERSION")
-$WRITE SYS$OUTPUT "Checking architecture ... ", CPU
-$WRITE SYS$OUTPUT "Checking OS ... OpenVMS ",OS
-$SHARED=0
-$IF ( (CPU.EQS."Alpha").OR.(CPU.EQS."I64") )
-$ THEN
-$ SHARED=64
-$ ELSE
-$ SHARED=32
-$ENDIF
-$MMS = F$SEARCH("SYS$SYSTEM:MMS.EXE") .NES. ""
-$MMK = F$TYPE(MMK)
-$IF (MMS .OR. MMK.NES."") THEN GOTO TEST_LIBRARIES
-$! I cant find any make tool
-$GOTO EXIT
-$!
-$!
-$TEST_LIBRARIES:
-$! Setting as MAKE utility one of MMS or MMK. I prefer MMS.
-$IF (MMK.NES."") THEN MAKE="MMK"
-$IF (MMS) THEN MAKE="MMS"
-$WRITE SYS$OUTPUT "Checking build utility ... ''MAKE'"
-$WRITE SYS$OUTPUT " "
-$!
-$!
-$IF (P1.EQS."STATIC").OR.(P1.EQS."static") THEN SHARED=0
-$!
-$!
-$!"Checking for strcasecmp "
-$ DEFINE SYS$ERROR _NLA0:
-$ DEFINE SYS$OUTPUT _NLA0:
-$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT
- #include <strings.h>
- #include <stdlib.h>
-
- int main()
- {
- if (strcasecmp("bla", "Bla")==0) exit(0);
- else exit(2);
- }
-$!
-$TMP = $STATUS
-$DEASS SYS$ERROR
-$DEAS SYS$OUTPUT
-$IF (TMP .NE. %X10B90001)
-$ THEN
-$ HAVE_STRCASECMP=0
-$ GOTO NEXT1
-$ENDIF
-$DEFINE SYS$ERROR _NLA0:
-$DEFINE SYS$OUTPUT _NLA0:
-$LINK/EXE=TEST TEST
-$TMP = $STATUS
-$DEAS SYS$ERROR
-$DEAS SYS$OUTPUT
-$!WRITE SYS$OUTPUT TMP
-$IF (TMP .NE. %X10000001)
-$ THEN
-$ HAVE_STRCASECMP=0
-$ GOTO NEXT1
-$ENDIF
-$!
-$DEFINE SYS$ERROR _NLA0:
-$DEFINE SYS$OUTPUT _NLA0:
-$RUN TEST
-$IF ($STATUS .NE. %X00000001)
-$ THEN
-$ HAVE_STRCASECMP=0
-$ ELSE
-$ HAVE_STRCASECMP=1
-$ENDIF
-$DEAS SYS$ERROR
-$DEAS SYS$OUTPUT
-$NEXT1:
-$IF (HAVE_STRCASECMP.EQ.1)
-$ THEN
-$ WRITE SYS$OUTPUT "Checking for strcasecmp ... Yes"
-$ ELSE
-$ WRITE SYS$OUTPUT "Checking for strcasecmp ... No"
-$ENDIF
-$!
-$!
-
-$!"Checking for lfind "
-$ DEFINE SYS$ERROR _NLA0:
-$ DEFINE SYS$OUTPUT _NLA0:
-$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT
- #include <search.h>
-
- int main()
- {
- lfind((const void *)key, (const void *)NULL, (size_t *)NULL,
- (size_t) 0, NULL);
- }
-$!
-$TMP = $STATUS
-$DEASS SYS$ERROR
-$DEAS SYS$OUTPUT
-$IF (TMP .NE. %X10B90001)
-$ THEN
-$ HAVE_LFIND=0
-$ GOTO NEXT2
-$ENDIF
-$DEFINE SYS$ERROR _NLA0:
-$DEFINE SYS$OUTPUT _NLA0:
-$LINK/EXE=TEST TEST
-$TMP = $STATUS
-$DEAS SYS$ERROR
-$DEAS SYS$OUTPUT
-$!WRITE SYS$OUTPUT TMP
-$IF (TMP .NE. %X10000001)
-$ THEN
-$ HAVE_LFIND=0
-$ GOTO NEXT2
-$ ELSE
-$ HAVE_LFIND=1
-$ENDIF
-$!
-$NEXT2:
-$IF (HAVE_LFIND.EQ.1)
-$ THEN
-$ WRITE SYS$OUTPUT "Checking for lfind ... Yes"
-$ ELSE
-$ WRITE SYS$OUTPUT "Checking for lfind ... No"
-$ENDIF
-$!
-$!
-$!"Checking for correct zlib library "
-$ DEFINE SYS$ERROR _NLA0:
-$ DEFINE SYS$OUTPUT _NLA0:
-$ CC/OBJECT=TEST.OBJ/INCLUDE=(ZLIB) SYS$INPUT
- #include <stdlib.h>
- #include <stdio.h>
- #include <zlib.h>
- int main()
- {
- printf("checking version zlib: %s\n",zlibVersion());
- }
-$TMP = $STATUS
-$DEASS SYS$ERROR
-$DEAS SYS$OUTPUT
-$!WRITE SYS$OUTPUT TMP
-$IF (TMP .NE. %X10B90001)
-$ THEN
-$ HAVE_ZLIB=0
-$ GOTO EXIT
-$ENDIF
-$DEFINE SYS$ERROR _NLA0:
-$DEFINE SYS$OUTPUT _NLA0:
-$LINK/EXE=TEST TEST,ZLIB:LIBZ/LIB
-$TMP = $STATUS
-$DEAS SYS$ERROR
-$DEAS SYS$OUTPUT
-$!WRITE SYS$OUTPUT TMP
-$IF (TMP .NE. %X10000001)
-$ THEN
-$ HAVE_ZLIB=0
-$ GOTO EXIT
-$ ELSE
-$ HAVE_ZLIB=1
-$ENDIF
-$IF (HAVE_ZLIB.EQ.1)
-$ THEN
-$ WRITE SYS$OUTPUT "Checking for correct zlib library ... Yes"
-$ ELSE
-$ WRITE SYS$OUTPUT "Checking for correct zlib library ... No"
-$ WRITE SYS$OUTPUT "This is fatal. Please download and install good library from fafner.dyndns.org/~alexey/libsdl/public.html"
-$ENDIF
-$RUN TEST
-$!
-
-$DEL TEST.OBJ;*
-$! Checking for JPEG ...
-$ DEFINE SYS$ERROR _NLA0:
-$ DEFINE SYS$OUTPUT _NLA0:
-$ CC/OBJECT=TEST.OBJ/INCLUDE=(JPEG) SYS$INPUT
- #include <stdlib.h>
- #include <stdio.h>
- #include <jpeglib.h>
- #include <jversion.h>
- int main()
- {
- printf("checking version jpeg: %s\n",JVERSION);
- jpeg_quality_scaling(0);
- return 0;
- }
-$TMP = $STATUS
-$DEASS SYS$ERROR
-$DEAS SYS$OUTPUT
-$!WRITE SYS$OUTPUT TMP
-$IF (TMP .NE. %X10B90001)
-$ THEN
-$ WRITE SYS$OUTPUT "Checking for static jpeg library ... No"
-$ HAVE_JPEG=0
-$ENDIF
-$DEFINE SYS$ERROR _NLA0:
-$DEFINE SYS$OUTPUT _NLA0:
-$LINK/EXE=TEST TEST,JPEG:LIBJPEG/LIB
-$TMP = $STATUS
-$DEAS SYS$ERROR
-$DEAS SYS$OUTPUT
-$!WRITE SYS$OUTPUT TMP
-$IF (TMP .NE. %X10000001)
-$ THEN
-$ HAVE_JPEG=0
-$ ELSE
-$ HAVE_JPEG=1
-$ENDIF
-$IF (HAVE_JPEG.EQ.1)
-$ THEN
-$ WRITE SYS$OUTPUT "Checking for static jpeg library ... Yes"
-$ JPEG_LIBRARY_PATH="JPEG:LIBJPEG/LIB"
-$ RUN TEST
-$ ELSE
-$ WRITE SYS$OUTPUT "Checking for static jpeg library ... No"
-$ENDIF
-$!
-$!"Checking for SHARED JPEG library "
-$OPEN/WRITE OUT TEST.OPT
-$WRITE OUT "SYS$SHARE:LIBJPEG$SHR/SHARE"
-$WRITE OUT "ZLIB:LIBZ/LIB"
-$CLOSE OUT
-$DEFINE SYS$ERROR _NLA0:
-$DEFINE SYS$OUTPUT _NLA0:
-$LINK/EXE=TEST TEST,TEST/OPT
-$TMP = $STATUS
-$DEAS SYS$ERROR
-$DEAS SYS$OUTPUT
-$!WRITE SYS$OUTPUT TMP
-$IF (TMP .NE. %X10000001)
-$ THEN
-$ HAVE_JPEG_SHARED=0
-$ ELSE
-$ HAVE_JPEG_SHARED=1
-$ENDIF
-$IF (HAVE_JPEG_SHARED.EQ.1)
-$ THEN
-$ WRITE SYS$OUTPUT "Checking for shared jpeg library ... Yes"
-$ JPEG_LIBRARY_PATH="SYS$SHARE:LIBJPEG$SHR/SHARE"
-$ ELSE
-$ WRITE SYS$OUTPUT "Checking for shared jpeg library ... No"
-$ENDIF
-$!
-$ IF ( (HAVE_JPEG_SHARED.EQ.0).AND.(HAVE_JPEG.EQ.0) )
-$ THEN
-$ WRITE SYS$OUTPUT "No JPEG library installed. This is fatal. Please download and install good library from fafner.dyndns.org/~alexey/libsdl/public.html"
-$ GOTO EXIT
-$ ENDIF
-$!
-$!
-$!
-$! Checking for X11 ...
-$IF F$TRNLNM("DECW$INCLUDE") .NES. ""
-$ THEN
-$ WRITE SYS$OUTPUT "Checking for X11 ... Yes"
-$ ELSE
-$ WRITE SYS$OUTPUT "Checking for X11 ... No"
-$ WRITE SYS$OUTPUT "This is fatal. Please install X11 software"
-$ GOTO EXIT
-$ENDIF
-$!
-$!WRITING BUILD FILES
-$OPEN/WRITE OUT BUILD.COM
-$ WRITE OUT "$set def [.port]"
-$ WRITE OUT "$",MAKE
-$ WRITE OUT "$set def [-.libtiff]"
-$ WRITE OUT "$",MAKE
-$ WRITE OUT "$set def [-.tools]"
-$ WRITE OUT "$",MAKE
-$ WRITE OUT "$set def [-]"
-$ WRITE OUT "$cop [.PORT]LIBPORT.OLB [.LIBTIFF]LIBPORT.OLB"
-$ WRITE OUT "$ CURRENT = F$ENVIRONMENT (""DEFAULT"") "
-$ WRITE OUT "$TIFF=CURRENT"
-$ WRITE OUT "$OPEN/WRITE OUTT LIBTIFF$STARTUP.COM"
-$ WRITE OUT "$TIFF[F$LOCATE(""]"",TIFF),9]:="".LIBTIFF]"""
-$ WRITE OUT "$WRITE OUTT ""DEFINE TIFF ","'","'","TIFF'"" "
-$ WRITE OUT "$TIFF=CURRENT"
-$ WRITE OUT "$TIFF[F$LOCATE(""]"",TIFF),7]:="".TOOLS]"""
-$ WRITE OUT "$WRITE OUTT ""BMP2TIFF:==$", "'","'","TIFF'BMP2TIFF"""
-$ WRITE OUT "$WRITE OUTT ""FAX2PS:==$", "'","'","TIFF'FAX2PS"""
-$ WRITE OUT "$WRITE OUTT ""FAX2TIFF:==$", "'","'","TIFF'FAX2TIFF"""
-$ WRITE OUT "$WRITE OUTT ""GIF2TIFF:==$", "'","'","TIFF'GIF2TIFF"""
-$ WRITE OUT "$WRITE OUTT ""PAL2RGB:==$", "'","'","TIFF'PAL2RGB"""
-$ WRITE OUT "$WRITE OUTT ""PPM2TIFF:==$", "'","'","TIFF'PPM2TIFF"""
-$ WRITE OUT "$WRITE OUTT ""RAS2TIFF:==$", "'","'","TIFF'RAS2TIFF"""
-$ WRITE OUT "$WRITE OUTT ""RAW2TIFF:==$", "'","'","TIFF'RAW2TIFF"""
-$ WRITE OUT "$WRITE OUTT ""RGB2YCBCR:==$", "'","'","TIFF'RGB2YCBCR"""
-$ WRITE OUT "$WRITE OUTT ""THUMBNAIL:==$", "'","'","TIFF'THUMBNAIL"""
-$ WRITE OUT "$WRITE OUTT ""TIFF2BW:==$", "'","'","TIFF'TIFF2BW"""
-$ WRITE OUT "$WRITE OUTT ""TIFF2PDF:==$", "'","'","TIFF'TIFF2PDF"""
-$ WRITE OUT "$WRITE OUTT ""TIFF2PS:==$", "'","'","TIFF'TIFF2PS"""
-$ WRITE OUT "$WRITE OUTT ""TIFF2RGBA:==$", "'","'","TIFF'TIFF2RGBA"""
-$ WRITE OUT "$WRITE OUTT ""TIFFCMP:==$", "'","'","TIFF'TIFFCMP"""
-$ WRITE OUT "$WRITE OUTT ""TIFFCP:==$", "'","'","TIFF'TIFFCP"""
-$ WRITE OUT "$WRITE OUTT ""TIFFDITHER:==$", "'","'","TIFF'TIFFDITHER"""
-$ WRITE OUT "$WRITE OUTT ""TIFFDUMP:==$", "'","'","TIFF'TIFFDUMP"""
-$ WRITE OUT "$WRITE OUTT ""TIFFINFO:==$", "'","'","TIFF'TIFFINFO"""
-$ WRITE OUT "$WRITE OUTT ""TIFFMEDIAN:==$", "'","'","TIFF'TIFFMEDIAN"""
-$ WRITE OUT "$WRITE OUTT ""TIFFCROP:==$", "'","'","TIFF'TIFFCROP"""
-$ WRITE OUT "$WRITE OUTT ""TIFFSET:==$", "'","'","TIFF'TIFFSET"""
-$ WRITE OUT "$CLOSE OUTT"
-$ WRITE OUT "$OPEN/WRITE OUTT [.LIBTIFF]LIBTIFF.OPT"
-$ WRITE OUT "$WRITE OUTT ""TIFF:TIFF/LIB""
-$ WRITE OUT "$WRITE OUTT ""TIFF:LIBPORT/LIB""
-$ WRITE OUT "$WRITE OUTT ""JPEG:LIBJPEG/LIB""
-$ WRITE OUT "$WRITE OUTT ""ZLIB:LIBZ/LIB""
-$ WRITE OUT "$CLOSE OUTT"
-$!
-$ WRITE OUT "$WRITE SYS$OUTPUT "" "" "
-$ WRITE OUT "$WRITE SYS$OUTPUT ""***************************************************************************** "" "
-$ WRITE OUT "$WRITE SYS$OUTPUT ""LIBTIFF$STARTUP.COM has been created. "" "
-$ WRITE OUT "$WRITE SYS$OUTPUT ""This file setups all logicals needed. It should be execute before using LibTIFF "" "
-$ WRITE OUT "$WRITE SYS$OUTPUT ""Nice place to call it - LOGIN.COM "" "
-$ WRITE OUT "$WRITE SYS$OUTPUT """" "
-$ WRITE OUT "$WRITE SYS$OUTPUT ""Using the library:"" "
-$ WRITE OUT "$WRITE SYS$OUTPUT ""CC/INC=TIFF ASCII_TAG.C"" "
-$ WRITE OUT "$WRITE SYS$OUTPUT ""LINK ASCII_TAG,TIFF:LIBTIFF/OPT"" "
-$ WRITE OUT "$WRITE SYS$OUTPUT ""***************************************************************************** "" "
-$CLOSE OUT
-$!
-$! DESCRIP.MMS in [.PORT]
-$OBJ="dummy.obj"
-$IF HAVE_STRCASECMP.NE.1
-$ THEN
-$ OBJ=OBJ+",strcasecmp.obj"
-$ENDIF
-$IF HAVE_LFIND.NE.1
-$ THEN
-$ OBJ=OBJ+",lfind.obj"
-$ENDIF
-$OPEN/WRITE OUT [.PORT]DESCRIP.MMS
-$WRITE OUT "OBJ=",OBJ
-$WRITE OUT ""
-$WRITE OUT "LIBPORT.OLB : $(OBJ)"
-$WRITE OUT " LIB/CREA LIBPORT $(OBJ)"
-$WRITE OUT ""
-$WRITE OUT ""
-$WRITE OUT "dummy.obj : dummy.c"
-$WRITE OUT " $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)"
-$WRITE OUT ""
-$WRITE OUT ""
-$WRITE OUT "strcasecmp.obj : strcasecmp.c"
-$WRITE OUT " $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)"
-$WRITE OUT ""
-$WRITE OUT ""
-$WRITE OUT "lfind.obj : lfind.c"
-$WRITE OUT " $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)"
-$WRITE OUT ""
-$WRITE OUT ""
-$CLOSE OUT
-$!
-$!
-$WRITE SYS$OUTPUT "Creating LIBTIFF$DEF.OPT"
-$IF (SHARED.EQ.64)
-$ THEN
-$ COPY SYS$INPUT TIFF$DEF.OPT
-SYMBOL_VECTOR= (-
-TIFFOpen=PROCEDURE,-
-TIFFGetVersion=PROCEDURE,-
-TIFFCleanup=PROCEDURE,-
-TIFFClose=PROCEDURE,-
-TIFFFlush=PROCEDURE,-
-TIFFFlushData=PROCEDURE,-
-TIFFGetField=PROCEDURE,-
-TIFFVGetField=PROCEDURE,-
-TIFFGetFieldDefaulted=PROCEDURE,-
-TIFFVGetFieldDefaulted=PROCEDURE,-
-TIFFGetTagListEntry=PROCEDURE,-
-TIFFGetTagListCount=PROCEDURE,-
-TIFFReadDirectory=PROCEDURE,-
-TIFFScanlineSize=PROCEDURE,-
-TIFFStripSize=PROCEDURE,-
-TIFFVStripSize=PROCEDURE,-
-TIFFRawStripSize=PROCEDURE,-
-TIFFTileRowSize=PROCEDURE,-
-TIFFTileSize=PROCEDURE,-
-TIFFVTileSize=PROCEDURE,-
-TIFFFileno=PROCEDURE,-
-TIFFSetFileno=PROCEDURE,-
-TIFFGetMode=PROCEDURE,-
-TIFFIsTiled=PROCEDURE,-
-TIFFIsByteSwapped=PROCEDURE,-
-TIFFIsBigEndian=PROCEDURE,-
-TIFFIsMSB2LSB=PROCEDURE,-
-TIFFIsUpSampled=PROCEDURE,-
-TIFFCIELabToRGBInit=PROCEDURE,-
-TIFFCIELabToXYZ=PROCEDURE,-
-TIFFXYZToRGB=PROCEDURE,-
-TIFFYCbCrToRGBInit=PROCEDURE,-
-TIFFYCbCrtoRGB=PROCEDURE,-
-TIFFCurrentRow=PROCEDURE,-
-TIFFCurrentDirectory=PROCEDURE,-
-TIFFCurrentStrip=PROCEDURE,-
-TIFFCurrentTile=PROCEDURE,-
-TIFFDataWidth=PROCEDURE,-
-TIFFReadBufferSetup=PROCEDURE,-
-TIFFWriteBufferSetup=PROCEDURE,-
-TIFFSetupStrips=PROCEDURE,-
-TIFFLastDirectory=PROCEDURE,-
-TIFFSetDirectory=PROCEDURE,-
-TIFFSetSubDirectory=PROCEDURE,-
-TIFFUnlinkDirectory=PROCEDURE,-
-TIFFSetField=PROCEDURE,-
-TIFFVSetField=PROCEDURE,-
-TIFFCheckpointDirectory=PROCEDURE,-
-TIFFWriteDirectory=PROCEDURE,-
-TIFFRewriteDirectory=PROCEDURE,-
-TIFFPrintDirectory=PROCEDURE,-
-TIFFReadScanline=PROCEDURE,-
-TIFFWriteScanline=PROCEDURE,-
-TIFFReadRGBAImage=PROCEDURE,-
-TIFFReadRGBAImageOriented=PROCEDURE,-
-TIFFFdOpen=PROCEDURE,-
-TIFFClientOpen=PROCEDURE,-
-TIFFFileName=PROCEDURE,-
-TIFFError=PROCEDURE,-
-TIFFErrorExt=PROCEDURE,-
-TIFFWarning=PROCEDURE,-
-TIFFWarningExt=PROCEDURE,-
-TIFFSetErrorHandler=PROCEDURE,-
-TIFFSetErrorHandlerExt=PROCEDURE,-
-TIFFSetWarningHandler=PROCEDURE,-
-TIFFSetWarningHandlerExt=PROCEDURE,-
-TIFFComputeTile=PROCEDURE,-
-TIFFCheckTile=PROCEDURE,-
-TIFFNumberOfTiles=PROCEDURE,-
-TIFFReadTile=PROCEDURE,-
-TIFFWriteTile=PROCEDURE,-
-TIFFComputeStrip=PROCEDURE,-
-TIFFNumberOfStrips=PROCEDURE,-
-TIFFRGBAImageBegin=PROCEDURE,-
-TIFFRGBAImageGet=PROCEDURE,-
-TIFFRGBAImageEnd=PROCEDURE,-
-TIFFReadEncodedStrip=PROCEDURE,-
-TIFFReadRawStrip=PROCEDURE,-
-TIFFReadEncodedTile=PROCEDURE,-
-TIFFReadRawTile=PROCEDURE,-
-TIFFReadRGBATile=PROCEDURE,-
-TIFFReadRGBAStrip=PROCEDURE,-
-TIFFWriteEncodedStrip=PROCEDURE,-
-TIFFWriteRawStrip=PROCEDURE,-
-TIFFWriteEncodedTile=PROCEDURE,-
-TIFFWriteRawTile=PROCEDURE,-
-TIFFSetWriteOffset=PROCEDURE,-
-TIFFSwabDouble=PROCEDURE,-
-TIFFSwabShort=PROCEDURE,-
-TIFFSwabLong=PROCEDURE,-
-TIFFSwabArrayOfShort=PROCEDURE,-
-TIFFSwabArrayOfLong=PROCEDURE,-
-TIFFSwabArrayOfDouble=PROCEDURE,-
-TIFFSwabArrayOfTriples=PROCEDURE,-
-TIFFReverseBits=PROCEDURE,-
-TIFFGetBitRevTable=PROCEDURE,-
-TIFFDefaultStripSize=PROCEDURE,-
-TIFFDefaultTileSize=PROCEDURE,-
-TIFFRasterScanlineSize=PROCEDURE,-
-_TIFFmalloc=PROCEDURE,-
-_TIFFrealloc=PROCEDURE,-
-_TIFFfree=PROCEDURE,-
-_TIFFmemset=PROCEDURE,-
-_TIFFmemcpy=PROCEDURE,-
-_TIFFmemcmp=PROCEDURE,-
-TIFFCreateDirectory=PROCEDURE,-
-TIFFSetTagExtender=PROCEDURE,-
-TIFFMergeFieldInfo=PROCEDURE,-
-TIFFFindFieldInfo=PROCEDURE,-
-TIFFFindFieldInfoByName=PROCEDURE,-
-TIFFFieldWithName=PROCEDURE,-
-TIFFFieldWithTag=PROCEDURE,-
-TIFFFieldTag=PROCEDURE,-
-TIFFFieldName=PROCEDURE,-
-TIFFFieldDataType=PROCEDURE,-
-TIFFFieldPassCount=PROCEDURE,-
-TIFFFieldReadCount=PROCEDURE,-
-TIFFFieldWriteCount=PROCEDURE,-
-TIFFCurrentDirOffset=PROCEDURE,-
-TIFFWriteCheck=PROCEDURE,-
-TIFFRGBAImageOK=PROCEDURE,-
-TIFFNumberOfDirectories=PROCEDURE,-
-TIFFSetFileName=PROCEDURE,-
-TIFFSetClientdata=PROCEDURE,-
-TIFFSetMode=PROCEDURE,-
-TIFFClientdata=PROCEDURE,-
-TIFFGetReadProc=PROCEDURE,-
-TIFFGetWriteProc=PROCEDURE,-
-TIFFGetSeekProc=PROCEDURE,-
-TIFFGetCloseProc=PROCEDURE,-
-TIFFGetSizeProc=PROCEDURE,-
-TIFFGetMapFileProc=PROCEDURE,-
-TIFFGetUnmapFileProc=PROCEDURE,-
-TIFFIsCODECConfigured=PROCEDURE,-
-TIFFGetConfiguredCODECs=PROCEDURE,-
-TIFFFindCODEC=PROCEDURE,-
-TIFFRegisterCODEC=PROCEDURE,-
-TIFFUnRegisterCODEC=PROCEDURE,-
-TIFFFreeDirectory=PROCEDURE,-
-TIFFReadCustomDirectory=PROCEDURE,-
-TIFFReadEXIFDirectory=PROCEDURE,-
-TIFFAccessTagMethods=PROCEDURE,-
-TIFFGetClientInfo=PROCEDURE,-
-TIFFSetClientInfo=PROCEDURE,-
-TIFFReassignTagToIgnore=PROCEDURE-
-)
-
-$ENDIF
-$IF (SHARED.EQ.32)
-$ THEN
-$ COPY SYS$INPUT TIFF$DEF.OPT
-UNIVERSAL=TIFFOpen
-UNIVERSAL=TIFFGetVersion
-UNIVERSAL=TIFFCleanup
-UNIVERSAL=TIFFClose
-UNIVERSAL=TIFFFlush
-UNIVERSAL=TIFFFlushData
-UNIVERSAL=TIFFGetField
-UNIVERSAL=TIFFVGetField
-UNIVERSAL=TIFFGetFieldDefaulted
-UNIVERSAL=TIFFVGetFieldDefaulted
-UNIVERSAL=TIFFGetTagListEntry
-UNIVERSAL=TIFFGetTagListCount
-UNIVERSAL=TIFFReadDirectory
-UNIVERSAL=TIFFScanlineSize
-UNIVERSAL=TIFFStripSize
-UNIVERSAL=TIFFVStripSize
-UNIVERSAL=TIFFRawStripSize
-UNIVERSAL=TIFFTileRowSize
-UNIVERSAL=TIFFTileSize
-UNIVERSAL=TIFFVTileSize
-UNIVERSAL=TIFFFileno
-UNIVERSAL=TIFFSetFileno
-UNIVERSAL=TIFFGetMode
-UNIVERSAL=TIFFIsTiled
-UNIVERSAL=TIFFIsByteSwapped
-UNIVERSAL=TIFFIsBigEndian
-UNIVERSAL=TIFFIsMSB2LSB
-UNIVERSAL=TIFFIsUpSampled
-UNIVERSAL=TIFFCIELabToRGBInit
-UNIVERSAL=TIFFCIELabToXYZ
-UNIVERSAL=TIFFXYZToRGB
-UNIVERSAL=TIFFYCbCrToRGBInit
-UNIVERSAL=TIFFYCbCrtoRGB
-UNIVERSAL=TIFFCurrentRow
-UNIVERSAL=TIFFCurrentDirectory
-UNIVERSAL=TIFFCurrentStrip
-UNIVERSAL=TIFFCurrentTile
-UNIVERSAL=TIFFDataWidth
-UNIVERSAL=TIFFReadBufferSetup
-UNIVERSAL=TIFFWriteBufferSetup
-UNIVERSAL=TIFFSetupStrips
-UNIVERSAL=TIFFLastDirectory
-UNIVERSAL=TIFFSetDirectory
-UNIVERSAL=TIFFSetSubDirectory
-UNIVERSAL=TIFFUnlinkDirectory
-UNIVERSAL=TIFFSetField
-UNIVERSAL=TIFFVSetField
-UNIVERSAL=TIFFCheckpointDirectory
-UNIVERSAL=TIFFWriteDirectory
-UNIVERSAL=TIFFRewriteDirectory
-UNIVERSAL=TIFFPrintDirectory
-UNIVERSAL=TIFFReadScanline
-UNIVERSAL=TIFFWriteScanline
-UNIVERSAL=TIFFReadRGBAImage
-UNIVERSAL=TIFFReadRGBAImageOriented
-UNIVERSAL=TIFFFdOpen
-UNIVERSAL=TIFFClientOpen
-UNIVERSAL=TIFFFileName
-UNIVERSAL=TIFFError
-UNIVERSAL=TIFFErrorExt
-UNIVERSAL=TIFFWarning
-UNIVERSAL=TIFFWarningExt
-UNIVERSAL=TIFFSetErrorHandler
-UNIVERSAL=TIFFSetErrorHandlerExt
-UNIVERSAL=TIFFSetWarningHandler
-UNIVERSAL=TIFFSetWarningHandlerExt
-UNIVERSAL=TIFFComputeTile
-UNIVERSAL=TIFFCheckTile
-UNIVERSAL=TIFFNumberOfTiles
-UNIVERSAL=TIFFReadTile
-UNIVERSAL=TIFFWriteTile
-UNIVERSAL=TIFFComputeStrip
-UNIVERSAL=TIFFNumberOfStrips
-UNIVERSAL=TIFFRGBAImageBegin
-UNIVERSAL=TIFFRGBAImageGet
-UNIVERSAL=TIFFRGBAImageEnd
-UNIVERSAL=TIFFReadEncodedStrip
-UNIVERSAL=TIFFReadRawStrip
-UNIVERSAL=TIFFReadEncodedTile
-UNIVERSAL=TIFFReadRawTile
-UNIVERSAL=TIFFReadRGBATile
-UNIVERSAL=TIFFReadRGBAStrip
-UNIVERSAL=TIFFWriteEncodedStrip
-UNIVERSAL=TIFFWriteRawStrip
-UNIVERSAL=TIFFWriteEncodedTile
-UNIVERSAL=TIFFWriteRawTile
-UNIVERSAL=TIFFSetWriteOffset
-UNIVERSAL=TIFFSwabDouble
-UNIVERSAL=TIFFSwabShort
-UNIVERSAL=TIFFSwabLong
-UNIVERSAL=TIFFSwabArrayOfShort
-UNIVERSAL=TIFFSwabArrayOfLong
-UNIVERSAL=TIFFSwabArrayOfDouble
-UNIVERSAL=TIFFSwabArrayOfTriples
-UNIVERSAL=TIFFReverseBits
-UNIVERSAL=TIFFGetBitRevTable
-UNIVERSAL=TIFFDefaultStripSize
-UNIVERSAL=TIFFDefaultTileSize
-UNIVERSAL=TIFFRasterScanlineSize
-UNIVERSAL=_TIFFmalloc
-UNIVERSAL=_TIFFrealloc
-UNIVERSAL=_TIFFfree
-UNIVERSAL=_TIFFmemset
-UNIVERSAL=_TIFFmemcpy
-UNIVERSAL=_TIFFmemcmp
-UNIVERSAL=TIFFCreateDirectory
-UNIVERSAL=TIFFSetTagExtender
-UNIVERSAL=TIFFMergeFieldInfo
-UNIVERSAL=TIFFFindFieldInfo
-UNIVERSAL=TIFFFindFieldInfoByName
-UNIVERSAL=TIFFFieldWithName
-UNIVERSAL=TIFFFieldWithTag
-UNIVERSAL=TIFFFieldTag
-UNIVERSAL=TIFFFieldName
-UNIVERSAL=TIFFFieldDataType
-UNIVERSAL=TIFFFieldPassCount
-UNIVERSAL=TIFFFieldReadCount
-UNIVERSAL=TIFFFieldWriteCount
-UNIVERSAL=TIFFCurrentDirOffset
-UNIVERSAL=TIFFWriteCheck
-UNIVERSAL=TIFFRGBAImageOK
-UNIVERSAL=TIFFNumberOfDirectories
-UNIVERSAL=TIFFSetFileName
-UNIVERSAL=TIFFSetClientdata
-UNIVERSAL=TIFFSetMode
-UNIVERSAL=TIFFClientdata
-UNIVERSAL=TIFFGetReadProc
-UNIVERSAL=TIFFGetWriteProc
-UNIVERSAL=TIFFGetSeekProc
-UNIVERSAL=TIFFGetCloseProc
-UNIVERSAL=TIFFGetSizeProc
-UNIVERSAL=TIFFGetMapFileProc
-UNIVERSAL=TIFFGetUnmapFileProc
-UNIVERSAL=TIFFIsCODECConfigured
-UNIVERSAL=TIFFGetConfiguredCODECs
-UNIVERSAL=TIFFFindCODEC
-UNIVERSAL=TIFFRegisterCODEC
-UNIVERSAL=TIFFUnRegisterCODEC
-UNIVERSAL=TIFFFreeDirectory
-UNIVERSAL=TIFFReadCustomDirectory
-UNIVERSAL=TIFFReadEXIFDirectory
-UNIVERSAL=TIFFAccessTagMethods
-UNIVERSAL=TIFFGetClientInfo
-UNIVERSAL=TIFFSetClientInfo
-UNIVERSAL=TIFFReassignTagToIgnore
-
-$ENDIF
-$!
-$!
-$! Writing TIFF$SHR.OPT file to build TOOLS
-$ IF (SHARED.GT.0)
-$ THEN
-$ OPEN/WRITE OUT TIFF$SHR.OPT
-$ WRITE OUT "[]TIFF/LIB"
-$ WRITE OUT "[-.PORT]LIBPORT/LIB"
-$ WRITE OUT JPEG_LIBRARY_PATH
-$ WRITE OUT "ZLIB:LIBZ/LIB"
-$ CLOSE OUT
-$ ENDIF
-$!
-$!
-$! Writing OPT.OPT file to build TOOLS
-$OPEN/WRITE OUT OPT.OPT
-$ IF (SHARED.GT.0)
-$ THEN
-$ WRITE OUT "[-.LIBTIFF]TIFF$SHR/SHARE"
-$ WRITE OUT JPEG_LIBRARY_PATH
-$ ELSE
-$ WRITE OUT "[-.LIBTIFF]TIFF/LIB"
-$ WRITE OUT "[-.PORT]LIBPORT/LIB"
-$ WRITE OUT JPEG_LIBRARY_PATH
-$ ENDIF
-$ WRITE OUT "ZLIB:LIBZ/LIB"
-$CLOSE OUT
-$!
-$!
-$COPY SYS$INPUT [.LIBTIFF]DESCRIP.MMS
-# (c) Alexey Chupahin 22-NOV-2007
-# OpenVMS 7.3-1, DEC 2000 mod.300
-# OpenVMS 8.3, HP rx1620
-# Makefile for DEC C compilers.
-#
-
-INCL = /INCLUDE=(JPEG,ZLIB,[])
-
-CFLAGS = $(INCL)
-
-OBJ_SYSDEP_MODULE = tif_vms.obj
-
-OBJ = \
-tif_aux.obj,\
-tif_close.obj,\
-tif_codec.obj,\
-tif_color.obj,\
-tif_compress.obj,\
-tif_dir.obj,\
-tif_dirinfo.obj,\
-tif_dirread.obj,\
-tif_dirwrite.obj,\
-tif_dumpmode.obj,\
-tif_error.obj,\
-tif_extension.obj,\
-tif_fax3.obj,\
-tif_fax3sm.obj,\
-tif_flush.obj,\
-tif_getimage.obj,\
-tif_jbig.obj,\
-tif_jpeg.obj,\
-tif_luv.obj,\
-tif_lzw.obj,\
-tif_next.obj,\
-tif_ojpeg.obj,\
-tif_open.obj,\
-tif_packbits.obj,\
-tif_pixarlog.obj,\
-tif_predict.obj,\
-tif_print.obj,\
-tif_read.obj,\
-tif_strip.obj,\
-tif_swab.obj,\
-tif_thunder.obj,\
-tif_tile.obj,\
-tif_version.obj,\
-tif_warning.obj,\
-tif_write.obj,\
-tif_zip.obj, $(OBJ_SYSDEP_MODULE)
-
-$IF (SHARED.GT.0)
-$ THEN
-$ APP SYS$INPUT [.LIBTIFF]DESCRIP.MMS
-ALL : tiff.olb, tiff$shr.exe
- $WRITE SYS$OUTPUT "Done"
-
-tiff$shr.exe : tiff.olb
- LINK/SHARE=TIFF$SHR.EXE TIF_AUX,[-]TIFF$DEF/OPT, [-]TIFF$SHR/OPT
- COPY TIFF$SHR.EXE SYS$SHARE
- PURGE SYS$SHARE:TIFF$SHR.EXE
-
-$ ELSE
-$ APP SYS$INPUT [.LIBTIFF]DESCRIP.MMS
-ALL : tiff.olb
- $WRITE SYS$OUTPUT "Done"
-
-$ENDIF
-$!
-$!
-$ APP SYS$INPUT [.LIBTIFF]DESCRIP.MMS
-
-tiff.olb : $(OBJ)
- lib/crea tiff.olb $(OBJ)
-
-#tif_config.h : tif_config.h-vms
-# copy tif_config.h-vms tif_config.h
-#
-#tiffconf.h : tiffconf.h-vms
-# copy tiffconf.h-vms tiffconf.h
-
-tif_aux.obj : tif_aux.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_close.obj : tif_close.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_codec.obj : tif_codec.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_color.obj : tif_color.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_compress.obj : tif_compress.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_dir.obj : tif_dir.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_dirinfo.obj : tif_dirinfo.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_dirread.obj : tif_dirread.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_dirwrite.obj : tif_dirwrite.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_dumpmode.obj : tif_dumpmode.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_error.obj : tif_error.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_extension.obj : tif_extension.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_fax3.obj : tif_fax3.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_fax3sm.obj : tif_fax3sm.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_flush.obj : tif_flush.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_getimage.obj : tif_getimage.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_jbig.obj : tif_jbig.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_jpeg.obj : tif_jpeg.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_luv.obj : tif_luv.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_lzw.obj : tif_lzw.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_next.obj : tif_next.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_ojpeg.obj : tif_ojpeg.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_open.obj : tif_open.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_packbits.obj : tif_packbits.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_pixarlog.obj : tif_pixarlog.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_predict.obj : tif_predict.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_print.obj : tif_print.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_read.obj : tif_read.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_strip.obj : tif_strip.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_swab.obj : tif_swab.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_thunder.obj : tif_thunder.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_tile.obj : tif_tile.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_unix.obj : tif_unix.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_version.obj : tif_version.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_warning.obj : tif_warning.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_write.obj : tif_write.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tif_zip.obj : tif_zip.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-
-clean :
- del *.obj;*
- del *.olb;*
-$!
-$!
-$!
-$COPY SYS$INPUT [.TOOLS]DESCRIP.MMS
-# (c) Alexey Chupahin 22-NOV-2007
-# OpenVMS 7.3-1, DEC 2000 mod.300
-# OpenVMS 8.3, HP rx1620
-
-INCL = /INCL=([],[-.LIBTIFF])
-CFLAGS = $(INCL)
-LIBS = [-]OPT/OPT
-
-OBJ=\
-bmp2tiff.exe,\
-fax2ps.exe,\
-fax2tiff.exe,\
-gif2tiff.exe,\
-pal2rgb.exe,\
-ppm2tiff.exe,\
-ras2tiff.exe,\
-raw2tiff.exe,\
-rgb2ycbcr.exe,\
-thumbnail.exe,\
-tiff2bw.exe,\
-tiff2pdf.exe,\
-tiff2ps.exe,\
-tiff2rgba.exe,\
-tiffcmp.exe,\
-tiffcp.exe,\
-tiffcrop.exe,\
-tiffdither.exe,\
-tiffdump.exe,\
-tiffinfo.exe,\
-tiffmedian.exe,\
-tiffset.exe,\
-tiffsplit.exe,\
-ycbcr.exe
-
-
-all : $(OBJ)
- $!
-
-bmp2tiff.obj : bmp2tiff.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-bmp2tiff.exe : bmp2tiff.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-fax2ps.obj : fax2ps.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-fax2ps.exe : fax2ps.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-fax2tiff.obj : fax2tiff.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-fax2tiff.exe : fax2tiff.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-gif2tiff.obj : gif2tiff.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-gif2tiff.exe : gif2tiff.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-pal2rgb.obj : pal2rgb.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-pal2rgb.exe : pal2rgb.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-ppm2tiff.obj : ppm2tiff.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-ppm2tiff.exe : ppm2tiff.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-ras2tiff.obj : ras2tiff.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-ras2tiff.exe : ras2tiff.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-raw2tiff.obj : raw2tiff.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-raw2tiff.exe : raw2tiff.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-rgb2ycbcr.obj : rgb2ycbcr.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-rgb2ycbcr.exe : rgb2ycbcr.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-sgi2tiff.obj : sgi2tiff.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-sgi2tiff.exe : sgi2tiff.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-sgisv.obj : sgisv.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-sgisv.exe : sgisv.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-thumbnail.obj : thumbnail.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-thumbnail.exe : thumbnail.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiff2bw.obj : tiff2bw.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiff2bw.exe : tiff2bw.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiff2pdf.obj : tiff2pdf.c
- $(CC) $(CFLAGS) /NOWARN $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiff2pdf.exe : tiff2pdf.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiff2ps.obj : tiff2ps.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiff2ps.exe : tiff2ps.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiff2rgba.obj : tiff2rgba.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiff2rgba.exe : tiff2rgba.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffcmp.obj : tiffcmp.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffcmp.exe : tiffcmp.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffcp.obj : tiffcp.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffcp.exe : tiffcp.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffcrop.obj : tiffcrop.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffcrop.exe : tiffcrop.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffdither.obj : tiffdither.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffdither.exe : tiffdither.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffdump.obj : tiffdump.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffdump.exe : tiffdump.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffgt.obj : tiffgt.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffgt.exe : tiffgt.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffinfo.obj : tiffinfo.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffinfo.exe : tiffinfo.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffmedian.obj : tiffmedian.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffmedian.exe : tiffmedian.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffset.obj : tiffset.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffset.exe : tiffset.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-tiffsplit.obj : tiffsplit.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-tiffsplit.exe : tiffsplit.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-ycbcr.obj : ycbcr.c
- $(CC) $(CFLAGS) $(MMS$SOURCE) /OBJ=$(MMS$TARGET)
-
-ycbcr.exe : ycbcr.obj
- LINK/EXE=$(MMS$TARGET) $(MMS$SOURCE), $(LIBS)
-
-
-CLEAN :
- DEL ALL.;*
- DEL *.OBJ;*
- DEL *.EXE;*
-
-$!
-$!
-$!
-$!copiing and patching TIFF_CONF.H, TIF_CONFIG.H
-$!
-$CURRENT = F$ENVIRONMENT (""DEFAULT"")
-$CURRENT[F$LOCATE("]",CURRENT),9]:=".LIBTIFF]"
-$WRITE SYS$OUTPUT "Creating TIFFCONF.H and TIF_CONFIG.H"
-$COPY SYS$INPUT 'CURRENT'TIFFCONF.H
-/*
- Configuration defines for installed libtiff.
- This file maintained for backward compatibility. Do not use definitions
- from this file in your programs.
-*/
-
-#ifndef _TIFFCONF_
-#define _TIFFCONF_
-
-/* Define to 1 if the system has the type `int16'. */
-//#define HAVE_INT16
-
-/* Define to 1 if the system has the type `int32'. */
-//#define HAVE_INT32
-
-/* Define to 1 if the system has the type `int8'. */
-//#define HAVE_INT8
-
-/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of a `long', as computed by sizeof. */
-#define SIZEOF_LONG 4
-
-/* Compatibility stuff. */
-
-/* Define as 0 or 1 according to the floating point format suported by the
- machine */
-
-#ifdef __IEEE_FLOAT
-#define HAVE_IEEEFP 1
-#endif
-
-#define HAVE_GETOPT 1
-
-/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
-#define HOST_FILLORDER FILLORDER_LSB2MSB
-
-/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
- (Intel) */
-#define HOST_BIGENDIAN 0
-
-/* Support CCITT Group 3 & 4 algorithms */
-#define CCITT_SUPPORT 1
-
-/* Support LogLuv high dynamic range encoding */
-#define LOGLUV_SUPPORT 1
-
-/* Support LZW algorithm */
-#define LZW_SUPPORT 1
-
-/* Support NeXT 2-bit RLE algorithm */
-#define NEXT_SUPPORT 1
-
-/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
- fails with unpatched IJG JPEG library) */
-
-/* Support Macintosh PackBits algorithm */
-#define PACKBITS_SUPPORT 1
-
-/* Support Pixar log-format algorithm (requires Zlib) */
-#define PIXARLOG_SUPPORT 1
-
-/* Support ThunderScan 4-bit RLE algorithm */
-#define THUNDER_SUPPORT 1
-
-/* Support Deflate compression */
-/* #undef ZIP_SUPPORT */
-
-/* Support strip chopping (whether or not to convert single-strip uncompressed
- images to mutiple strips of ~8Kb to reduce memory usage) */
-#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
-
-/* Enable SubIFD tag (330) support */
-#define SUBIFD_SUPPORT 1
-
-/* Treat extra sample as alpha (default enabled). The RGBA interface will
- treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
- packages produce RGBA files but don't mark the alpha properly. */
-#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
-
-/* Pick up YCbCr subsampling info from the JPEG data stream to support files
- lacking the tag (default enabled). */
-#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
-
-/*
- * Feature support definitions.
- * XXX: These macros are obsoleted. Don't use them in your apps!
- * Macros stays here for backward compatibility and should be always defined.
- */
-#define COLORIMETRY_SUPPORT
-#define YCBCR_SUPPORT
-#define CMYK_SUPPORT
-#define ICC_SUPPORT
-#define PHOTOSHOP_SUPPORT
-#define IPTC_SUPPORT
-
-#endif /* _TIFFCONF_ */
-
-
-$COPY SYS$INPUT 'CURRENT'TIF_CONFIG.H
-/* Define to 1 if you have the <assert.h> header file. */
-
-#ifndef HAVE_GETOPT
-# define HAVE_GETOPT 1
-#endif
-
-#define HAVE_ASSERT_H 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define as 0 or 1 according to the floating point format suported by the
- machine */
-
-#ifdef __IEEE_FLOAT
-#define HAVE_IEEEFP 1
-#endif
-
-#define HAVE_UNISTD_H 1
-
-#define HAVE_STRING_H 1
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <io.h> header file. */
-//#define HAVE_IO_H 1
-
-/* Define to 1 if you have the <search.h> header file. */
-//#define HAVE_SEARCH_H 1
-
-/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of a `long', as computed by sizeof. */
-#define SIZEOF_LONG 4
-
-/* Set the native cpu bit order */
-#define HOST_FILLORDER FILLORDER_LSB2MSB
-
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-/*
-#ifndef __cplusplus
-# ifndef inline
-# define inline __inline
-# endif
-#endif
-*/
-
-/* Support CCITT Group 3 & 4 algorithms */
-#define CCITT_SUPPORT 1
-
-/* Pick up YCbCr subsampling info from the JPEG data stream to support files
- lacking the tag (default enabled). */
-#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
-/* Support C++ stream API (requires C++ compiler) */
-#define CXX_SUPPORT 1
-
-/* Treat extra sample as alpha (default enabled). The RGBA interface will
- treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
- packages produce RGBA files but don't mark the alpha properly. */
-#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
-
-/* little Endian */
-#define HOST_BIGENDIAN 0
-#define JPEG_SUPPORT 1
-#define LOGLUV_SUPPORT 1
-/* Support LZW algorithm */
-#define LZW_SUPPORT 1
-
-/* Support Microsoft Document Imaging format */
-#define MDI_SUPPORT 1
-
-/* Support NeXT 2-bit RLE algorithm */
-#define NEXT_SUPPORT 1
-#define OJPEG_SUPPORT 1
-
-/* Name of package */
-#define PACKAGE "tiff"
-
-
-/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "tiff@lists.maptools.org"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "LibTIFF Software"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "LibTIFF Software 3.9.0beta for VMS"
-
-/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "tiff"
-
-$PURGE 'CURRENT'TIFFCONF.H
-$PURGE 'CURRENT'TIF_CONFIG.H
-$OPEN/APPEND OUT 'CURRENT'TIF_CONFIG.H
-$IF HAVE_LFIND.EQ.1
-$ THEN
-$ WRITE OUT "#define HAVE_SEARCH_H 1"
-$ ELSE
-$ WRITE OUT "#undef HAVE_SEARCH_H"
-$ENDIF
-$CLOSE OUT
-$!
-$!
-$WRITE SYS$OUTPUT " "
-$WRITE SYS$OUTPUT " "
-$WRITE SYS$OUTPUT "Now you can type @BUILD "
-$!
-$EXIT:
-$DEFINE SYS$ERROR _NLA0:
-$DEFINE SYS$OUTPUT _NLA0:
-$DEL TEST.OBJ;*
-$DEL TEST.C;*
-$DEL TEST.EXE;*
-$DEAS SYS$ERROR
-$DEAS SYS$OUTPUT
diff --git a/tiff/contrib/CMakeLists.txt b/tiff/contrib/CMakeLists.txt
index 6bb124f4..8c8310b6 100644
--- a/tiff/contrib/CMakeLists.txt
+++ b/tiff/contrib/CMakeLists.txt
@@ -25,11 +25,3 @@
add_subdirectory(addtiffo)
add_subdirectory(dbs)
add_subdirectory(iptcutil)
-add_subdirectory(mfs)
-add_subdirectory(pds)
-add_subdirectory(ras)
-add_subdirectory(stream)
-add_subdirectory(tags)
-add_subdirectory(win_dib)
-
-extra_dist(README)
diff --git a/tiff/contrib/Makefile.in b/tiff/contrib/Makefile.in
index c0f998b3..ec34d8de 100644
--- a/tiff/contrib/Makefile.in
+++ b/tiff/contrib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,8 +122,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -347,6 +349,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/tiff/contrib/addtiffo/CMakeLists.txt b/tiff/contrib/addtiffo/CMakeLists.txt
index 45e733cd..2f3959bc 100644
--- a/tiff/contrib/addtiffo/CMakeLists.txt
+++ b/tiff/contrib/addtiffo/CMakeLists.txt
@@ -22,14 +22,6 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-extra_dist(
- README
- Makefile.vc)
-
-include_directories(${PROJECT_SOURCE_DIR}/libtiff
- ${PROJECT_BINARY_DIR}/libtiff
- ${CMAKE_CURRENT_BINARY_DIR})
-
add_executable(addtiffo addtiffo.c tif_overview.c tif_ovrcache.c tif_ovrcache.h)
target_link_libraries(addtiffo tiff port)
diff --git a/tiff/contrib/addtiffo/Makefile.am b/tiff/contrib/addtiffo/Makefile.am
index 87342bde..3f817c6f 100644
--- a/tiff/contrib/addtiffo/Makefile.am
+++ b/tiff/contrib/addtiffo/Makefile.am
@@ -27,7 +27,6 @@ LIBTIFF = $(top_builddir)/libtiff/libtiff.la
EXTRA_DIST = \
CMakeLists.txt \
- Makefile.vc \
README
noinst_PROGRAMS = addtiffo
diff --git a/tiff/contrib/addtiffo/Makefile.in b/tiff/contrib/addtiffo/Makefile.in
index 31dc815c..49a90cbc 100644
--- a/tiff/contrib/addtiffo/Makefile.in
+++ b/tiff/contrib/addtiffo/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -124,8 +124,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
@@ -149,7 +151,7 @@ AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libtiff -I$(top_builddir)/port
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/addtiffo.Po \
@@ -341,6 +343,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -353,7 +356,6 @@ top_srcdir = @top_srcdir@
LIBTIFF = $(top_builddir)/libtiff/libtiff.la
EXTRA_DIST = \
CMakeLists.txt \
- Makefile.vc \
README
addtiffo_SOURCES = addtiffo.c tif_overview.c tif_ovrcache.c tif_ovrcache.h
diff --git a/tiff/contrib/addtiffo/Makefile.vc b/tiff/contrib/addtiffo/Makefile.vc
deleted file mode 100755
index 2777dc2a..00000000
--- a/tiff/contrib/addtiffo/Makefile.vc
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# If libtiff.a is installed in /usr/lib or /usr/local/lib just point
-# LIBTIFF_DIR there. It doesn't need a full libtiff tree.
-#
-!INCLUDE ..\..\nmake.opt
-
-LIBTIFF_DIR = ..\..\libtiff
-#
-INCL = -I..\..\libtiff
-LIBS = $(LIBTIFF_DIR)\libtiff.lib
-
-addtiffo: addtiffo.obj tif_overview.obj tif_ovrcache.obj
- $(CC) $(CFLAGS) addtiffo.obj tif_overview.obj tif_ovrcache.obj \
- $(LIBS) /Feaddtiffo.exe
-
-
-addtiffo.obj: addtiffo.c
- $(CC) -c $(CFLAGS) addtiffo.c
-
-tif_overview.obj: tif_overview.c
- $(CC) -c $(CFLAGS) tif_overview.c
-
-tif_ovrcache.obj: tif_ovrcache.c
- $(CC) -c $(CFLAGS) tif_ovrcache.c
-
-clean:
- -del *.obj
- -del addtiffo.exe
diff --git a/tiff/contrib/addtiffo/tif_overview.c b/tiff/contrib/addtiffo/tif_overview.c
index 03b35733..6e837d10 100644
--- a/tiff/contrib/addtiffo/tif_overview.c
+++ b/tiff/contrib/addtiffo/tif_overview.c
@@ -79,16 +79,16 @@ void TIFFBuildOverviews( TIFF *, int, int *, int, const char *,
/* function is called. */
/************************************************************************/
-uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize,
- int nBitsPerPixel, int nPlanarConfig, int nSamples,
- int nBlockXSize, int nBlockYSize,
- int bTiled, int nCompressFlag, int nPhotometric,
- int nSampleFormat,
- unsigned short *panRed,
- unsigned short *panGreen,
- unsigned short *panBlue,
- int bUseSubIFDs,
- int nHorSubsampling, int nVerSubsampling )
+uint32_t TIFF_WriteOverview( TIFF *hTIFF, uint32_t nXSize, uint32_t nYSize,
+ int nBitsPerPixel, int nPlanarConfig, int nSamples,
+ int nBlockXSize, int nBlockYSize,
+ int bTiled, int nCompressFlag, int nPhotometric,
+ int nSampleFormat,
+ unsigned short *panRed,
+ unsigned short *panGreen,
+ unsigned short *panBlue,
+ int bUseSubIFDs,
+ int nHorSubsampling, int nVerSubsampling )
{
toff_t nBaseDirOffset;
@@ -173,13 +173,13 @@ uint32 TIFF_WriteOverview( TIFF *hTIFF, uint32 nXSize, uint32 nYSize,
/************************************************************************/
static void
-TIFF_GetSourceSamples( double * padfSamples, unsigned char *pabySrc,
- int nPixelBytes, int nSampleFormat,
- uint32 nXSize, uint32 nYSize,
+TIFF_GetSourceSamples( double * padfSamples, unsigned char *pabySrc,
+ int nPixelBytes, int nSampleFormat,
+ uint32_t nXSize, uint32_t nYSize,
int nPixelOffset, int nLineOffset )
{
- uint32 iXOff, iYOff;
- int iSample;
+ uint32_t iXOff, iYOff;
+ int iSample;
iSample = 0;
@@ -197,19 +197,19 @@ TIFF_GetSourceSamples( double * padfSamples, unsigned char *pabySrc,
}
else if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 2 )
{
- padfSamples[iSample++] = ((uint16 *) pabyData)[0];
+ padfSamples[iSample++] = ((uint16_t *) pabyData)[0];
}
else if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 4 )
{
- padfSamples[iSample++] = ((uint32 *) pabyData)[0];
+ padfSamples[iSample++] = ((uint32_t *) pabyData)[0];
}
else if( nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 2 )
{
- padfSamples[iSample++] = ((int16 *) pabyData)[0];
+ padfSamples[iSample++] = ((int16_t *) pabyData)[0];
}
else if( nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 32 )
{
- padfSamples[iSample++] = ((int32 *) pabyData)[0];
+ padfSamples[iSample++] = ((int32_t *) pabyData)[0];
}
else if( nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 4 )
{
@@ -238,19 +238,19 @@ TIFF_SetSample( unsigned char * pabyData, int nPixelBytes, int nSampleFormat,
}
else if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 2 )
{
- *((uint16 *)pabyData) = (uint16) MAX(0,MIN(65535,dfValue));
+ *((uint16_t *)pabyData) = (uint16_t) MAX(0, MIN(65535, dfValue));
}
else if( nSampleFormat == SAMPLEFORMAT_UINT && nPixelBytes == 4 )
{
- *((uint32 *)pabyData) = (uint32) dfValue;
+ *((uint32_t *)pabyData) = (uint32_t) dfValue;
}
else if( nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 2 )
{
- *((int16 *)pabyData) = (int16) MAX(-32768,MIN(32767,dfValue));
+ *((int16_t *)pabyData) = (int16_t) MAX(-32768, MIN(32767, dfValue));
}
else if( nSampleFormat == SAMPLEFORMAT_INT && nPixelBytes == 32 )
{
- *((int32 *)pabyData) = (int32) dfValue;
+ *((int32_t *)pabyData) = (int32_t) dfValue;
}
else if( nSampleFormat == SAMPLEFORMAT_IEEEFP && nPixelBytes == 4 )
{
@@ -271,15 +271,15 @@ TIFF_SetSample( unsigned char * pabyData, int nPixelBytes, int nSampleFormat,
static
void TIFF_DownSample( unsigned char *pabySrcTile,
- uint32 nBlockXSize, uint32 nBlockYSize,
+ uint32_t nBlockXSize, uint32_t nBlockYSize,
int nPixelSkewBits, int nBitsPerPixel,
unsigned char * pabyOTile,
- uint32 nOBlockXSize, uint32 nOBlockYSize,
- uint32 nTXOff, uint32 nTYOff, int nOMult,
+ uint32_t nOBlockXSize, uint32_t nOBlockYSize,
+ uint32_t nTXOff, uint32_t nTYOff, int nOMult,
int nSampleFormat, const char * pszResampling )
{
- uint32 i, j;
+ uint32_t i, j;
int k, nPixelBytes = (nBitsPerPixel) / 8;
int nPixelGroupBytes = (nBitsPerPixel+nPixelSkewBits)/8;
unsigned char *pabySrc, *pabyDst;
@@ -357,13 +357,13 @@ void TIFF_DownSample( unsigned char *pabySrcTile,
for( i = 0; i*nOMult < nBlockXSize; i++ )
{
double dfTotal;
- uint32 nXSize, nYSize, iSample;
+ uint32_t nXSize, nYSize, iSample;
if( i + nTXOff >= nOBlockXSize )
break;
- nXSize = MIN((uint32)nOMult,nBlockXSize-i);
- nYSize = MIN((uint32)nOMult,nBlockYSize-j);
+ nXSize = MIN((uint32_t)nOMult, nBlockXSize - i);
+ nYSize = MIN((uint32_t)nOMult, nBlockYSize - j);
TIFF_GetSourceSamples( padfSamples, pabySrc,
nPixelBytes, nSampleFormat,
@@ -394,10 +394,10 @@ void TIFF_DownSample( unsigned char *pabySrcTile,
/************************************************************************/
static
void TIFF_DownSample_Subsampled( unsigned char *pabySrcTile, int nSample,
- uint32 nBlockXSize, uint32 nBlockYSize,
+ uint32_t nBlockXSize, uint32_t nBlockYSize,
unsigned char * pabyOTile,
- uint32 nOBlockXSize, uint32 nOBlockYSize,
- uint32 nTXOff, uint32 nTYOff, int nOMult,
+ uint32_t nOBlockXSize, uint32_t nOBlockYSize,
+ uint32_t nTXOff, uint32_t nTYOff, int nOMult,
const char *pszResampling,
int nHorSubsampling, int nVerSubsampling )
{
@@ -405,10 +405,10 @@ void TIFF_DownSample_Subsampled( unsigned char *pabySrcTile, int nSample,
int nSampleBlockSize;
int nSourceSampleRowSize;
int nDestSampleRowSize;
- uint32 nSourceX, nSourceY;
- uint32 nSourceXSec, nSourceYSec;
- uint32 nSourceXSecEnd, nSourceYSecEnd;
- uint32 nDestX, nDestY;
+ uint32_t nSourceX, nSourceY;
+ uint32_t nSourceXSec, nSourceYSec;
+ uint32_t nSourceXSecEnd, nSourceYSecEnd;
+ uint32_t nDestX, nDestY;
int nSampleOffsetInSampleBlock;
unsigned int nCummulator;
unsigned int nCummulatorCount;
@@ -572,9 +572,9 @@ void TIFF_ProcessFullResBlock( TIFF *hTIFF, int nPlanarConfig,
int nOverviews, int * panOvList,
int nBitsPerPixel,
int nSamples, TIFFOvrCache ** papoRawBIs,
- uint32 nSXOff, uint32 nSYOff,
+ uint32_t nSXOff, uint32_t nSYOff,
unsigned char *pabySrcTile,
- uint32 nBlockXSize, uint32 nBlockYSize,
+ uint32_t nBlockXSize, uint32_t nBlockYSize,
int nSampleFormat, const char * pszResampling )
{
@@ -614,10 +614,10 @@ void TIFF_ProcessFullResBlock( TIFF *hTIFF, int nPlanarConfig,
{
TIFFOvrCache *poRBI = papoRawBIs[iOverview];
unsigned char *pabyOTile;
- uint32 nTXOff, nTYOff, nOXOff, nOYOff, nOMult;
- uint32 nOBlockXSize = poRBI->nBlockXSize;
- uint32 nOBlockYSize = poRBI->nBlockYSize;
- int nSkewBits, nSampleByteOffset;
+ uint32_t nTXOff, nTYOff, nOXOff, nOYOff, nOMult;
+ uint32_t nOBlockXSize = poRBI->nBlockXSize;
+ uint32_t nOBlockYSize = poRBI->nBlockYSize;
+ int nSkewBits, nSampleByteOffset;
/*
* Fetch the destination overview tile
@@ -718,14 +718,14 @@ void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList,
{
TIFFOvrCache **papoRawBIs;
- uint32 nXSize, nYSize, nBlockXSize, nBlockYSize;
- uint16 nBitsPerPixel, nPhotometric, nCompressFlag, nSamples,
+ uint32_t nXSize, nYSize, nBlockXSize, nBlockYSize;
+ uint16_t nBitsPerPixel, nPhotometric, nCompressFlag, nSamples,
nPlanarConfig, nSampleFormat;
int bSubsampled;
- uint16 nHorSubsampling, nVerSubsampling;
+ uint16_t nHorSubsampling, nVerSubsampling;
int bTiled, nSXOff, nSYOff, i;
unsigned char *pabySrcTile;
- uint16 *panRedMap, *panGreenMap, *panBlueMap;
+ uint16_t *panRedMap, *panGreenMap, *panBlueMap;
TIFFErrorHandler pfnWarning;
(void) pfnProgress;
@@ -782,7 +782,7 @@ void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList,
}
/* -------------------------------------------------------------------- */
-/* Turn off warnings to avoid alot of repeated warnings while */
+/* Turn off warnings to avoid a lot of repeated warnings while */
/* rereading directories. */
/* -------------------------------------------------------------------- */
pfnWarning = TIFFSetWarningHandler( NULL );
@@ -803,17 +803,17 @@ void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList,
}
/* -------------------------------------------------------------------- */
-/* Capture the pallette if there is one. */
+/* Capture the palette if there is one. */
/* -------------------------------------------------------------------- */
if( TIFFGetField( hTIFF, TIFFTAG_COLORMAP,
&panRedMap, &panGreenMap, &panBlueMap ) )
{
- uint16 *panRed2, *panGreen2, *panBlue2;
+ uint16_t *panRed2, *panGreen2, *panBlue2;
int nColorCount = 1 << nBitsPerPixel;
- panRed2 = (uint16 *) _TIFFmalloc(2*nColorCount);
- panGreen2 = (uint16 *) _TIFFmalloc(2*nColorCount);
- panBlue2 = (uint16 *) _TIFFmalloc(2*nColorCount);
+ panRed2 = (uint16_t *) _TIFFmalloc(2 * nColorCount);
+ panGreen2 = (uint16_t *) _TIFFmalloc(2 * nColorCount);
+ panBlue2 = (uint16_t *) _TIFFmalloc(2 * nColorCount);
memcpy( panRed2, panRedMap, 2 * nColorCount );
memcpy( panGreen2, panGreenMap, 2 * nColorCount );
@@ -835,7 +835,7 @@ void TIFFBuildOverviews( TIFF *hTIFF, int nOverviews, int * panOvList,
for( i = 0; i < nOverviews; i++ )
{
- uint32 nOXSize, nOYSize, nOBlockXSize, nOBlockYSize;
+ uint32_t nOXSize, nOYSize, nOBlockXSize, nOBlockYSize;
toff_t nDirOffset;
nOXSize = (nXSize + panOvList[i] - 1) / panOvList[i];
diff --git a/tiff/contrib/addtiffo/tif_ovrcache.c b/tiff/contrib/addtiffo/tif_ovrcache.c
index ac500ab4..75b6436a 100644
--- a/tiff/contrib/addtiffo/tif_ovrcache.c
+++ b/tiff/contrib/addtiffo/tif_ovrcache.c
@@ -138,7 +138,7 @@ static void TIFFWriteOvrRow( TIFFOvrCache * psCache )
int nRet, iTileX, iTileY = psCache->nBlockOffset;
unsigned char *pabyData;
toff_t nBaseDirOffset;
- uint32 RowsInStrip;
+ uint32_t RowsInStrip;
/* -------------------------------------------------------------------- */
/* If the output cache is multi-byte per sample, and the file */
@@ -148,11 +148,11 @@ static void TIFFWriteOvrRow( TIFFOvrCache * psCache )
if( TIFFIsByteSwapped(psCache->hTIFF) )
{
if( psCache->nBitsPerPixel == 16 )
- TIFFSwabArrayOfShort( (uint16 *) psCache->pabyRow1Blocks,
+ TIFFSwabArrayOfShort( (uint16_t *) psCache->pabyRow1Blocks,
(psCache->nBytesPerBlock * psCache->nSamples) / 2 );
else if( psCache->nBitsPerPixel == 32 )
- TIFFSwabArrayOfLong( (uint32 *) psCache->pabyRow1Blocks,
+ TIFFSwabArrayOfLong( (uint32_t *) psCache->pabyRow1Blocks,
(psCache->nBytesPerBlock * psCache->nSamples) / 4 );
else if( psCache->nBitsPerPixel == 64 )
diff --git a/tiff/contrib/addtiffo/tif_ovrcache.h b/tiff/contrib/addtiffo/tif_ovrcache.h
index 0ad10829..83c97bf0 100644
--- a/tiff/contrib/addtiffo/tif_ovrcache.h
+++ b/tiff/contrib/addtiffo/tif_ovrcache.h
@@ -43,14 +43,14 @@ extern "C" {
typedef struct
{
- uint32 nXSize;
- uint32 nYSize;
+ uint32_t nXSize;
+ uint32_t nYSize;
- uint16 nBitsPerPixel;
- uint16 nSamples;
- uint16 nPlanarConfig;
- uint32 nBlockXSize;
- uint32 nBlockYSize;
+ uint16_t nBitsPerPixel;
+ uint16_t nSamples;
+ uint16_t nPlanarConfig;
+ uint32_t nBlockXSize;
+ uint32_t nBlockYSize;
toff_t nBytesPerBlock;
toff_t nBytesPerRow;
@@ -76,15 +76,15 @@ void TIFFDestroyOvrCache( TIFFOvrCache * );
void TIFFBuildOverviews( TIFF *, int, int *, int, const char *,
int (*)(double,void*), void * );
-void TIFF_ProcessFullResBlock( TIFF *, int, int, int, int, int, int *, int,
- int, TIFFOvrCache **, uint32, uint32,
- unsigned char *, uint32, uint32,
+void TIFF_ProcessFullResBlock( TIFF *, int, int, int, int, int, int *, int,
+ int, TIFFOvrCache **, uint32_t, uint32_t,
+ unsigned char *, uint32_t, uint32_t,
int, const char * );
-uint32 TIFF_WriteOverview( TIFF *, uint32, uint32, int, int, int, int, int,
- int, int, int, int, unsigned short *,
- unsigned short *, unsigned short *, int,
- int, int);
+uint32_t TIFF_WriteOverview( TIFF *, uint32_t, uint32_t, int, int, int, int, int,
+ int, int, int, int, unsigned short *,
+ unsigned short *, unsigned short *, int,
+ int, int);
diff --git a/tiff/contrib/dbs/CMakeLists.txt b/tiff/contrib/dbs/CMakeLists.txt
index ff3ce20c..b5681777 100644
--- a/tiff/contrib/dbs/CMakeLists.txt
+++ b/tiff/contrib/dbs/CMakeLists.txt
@@ -22,25 +22,17 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-include_directories(${PROJECT_SOURCE_DIR}/libtiff
- ${PROJECT_BINARY_DIR}/libtiff
- ${CMAKE_CURRENT_BINARY_DIR})
-
add_executable(tiff-bi tiff-bi.c)
target_link_libraries(tiff-bi tiff port)
add_executable(tiff-grayscale tiff-grayscale.c)
-target_link_libraries(tiff-grayscale tiff port)
+target_link_libraries(tiff-grayscale tiff port CMath::CMath)
add_executable(tiff-palette tiff-palette.c)
target_link_libraries(tiff-palette tiff port)
add_executable(tiff-rgb tiff-rgb.c)
-target_link_libraries(tiff-rgb tiff port)
-
-add_subdirectory(xtiff)
-
-extra_dist(README)
+target_link_libraries(tiff-rgb tiff port CMath::CMath)
if(WEBP_SUPPORT AND EMSCRIPTEN)
# Emscripten is pretty finnicky about linker flags.
diff --git a/tiff/contrib/dbs/Makefile.in b/tiff/contrib/dbs/Makefile.in
index 0f44fdd1..eb6a255d 100644
--- a/tiff/contrib/dbs/Makefile.in
+++ b/tiff/contrib/dbs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,8 +125,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
@@ -158,7 +160,7 @@ AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libtiff -I$(top_builddir)/port
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/tiff-bi.Po \
@@ -395,6 +397,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/tiff/contrib/dbs/tiff-grayscale.c b/tiff/contrib/dbs/tiff-grayscale.c
index 92c7b904..644eb9ee 100644
--- a/tiff/contrib/dbs/tiff-grayscale.c
+++ b/tiff/contrib/dbs/tiff-grayscale.c
@@ -41,7 +41,7 @@ int main(int argc, char **argv)
int bits_per_pixel = 8, cmsize, i, j, k,
gray_index, chunk_size = 32, nchunks = 16;
unsigned char * scan_line;
- uint16 * gray;
+ uint16_t * gray;
float refblackwhite[2*1];
TIFF * tif;
@@ -73,11 +73,11 @@ int main(int argc, char **argv)
}
cmsize = nchunks * nchunks;
- gray = (uint16 *) malloc(cmsize * sizeof(uint16));
+ gray = (uint16_t *) malloc(cmsize * sizeof(uint16_t));
gray[0] = 3000;
for (i = 1; i < cmsize; i++)
- gray[i] = (uint16) (-log10((double) i / (cmsize - 1)) * 1000);
+ gray[i] = (uint16_t) (-log10((double) i / (cmsize - 1)) * 1000);
refblackwhite[0] = 0.0;
refblackwhite[1] = (float)((1L<<bits_per_pixel) - 1);
diff --git a/tiff/contrib/dbs/tiff-palette.c b/tiff/contrib/dbs/tiff-palette.c
index 7b3d433f..9f8ea105 100644
--- a/tiff/contrib/dbs/tiff-palette.c
+++ b/tiff/contrib/dbs/tiff-palette.c
@@ -40,7 +40,7 @@ int main(int argc, char **argv)
int bits_per_pixel = 8, cmsize, i, j, k,
cmap_index, chunk_size = 32, nchunks = 16;
unsigned char * scan_line;
- uint16 *red, *green, *blue;
+ uint16_t *red, *green, *blue;
TIFF * tif;
programName = argv[0];
@@ -79,9 +79,9 @@ int main(int argc, char **argv)
} else {
cmsize = 2;
}
- red = (uint16 *) malloc(cmsize * sizeof(uint16));
- green = (uint16 *) malloc(cmsize * sizeof(uint16));
- blue = (uint16 *) malloc(cmsize * sizeof(uint16));
+ red = (uint16_t *) malloc(cmsize * sizeof(uint16_t));
+ green = (uint16_t *) malloc(cmsize * sizeof(uint16_t));
+ blue = (uint16_t *) malloc(cmsize * sizeof(uint16_t));
switch (bits_per_pixel) {
case 8:
diff --git a/tiff/contrib/dbs/tiff-rgb.c b/tiff/contrib/dbs/tiff-rgb.c
index d14ed005..f912cb99 100644
--- a/tiff/contrib/dbs/tiff-rgb.c
+++ b/tiff/contrib/dbs/tiff-rgb.c
@@ -29,7 +29,7 @@
#include "tiffio.h"
-#define ROUND(x) (uint16) ((x) + 0.5)
+#define ROUND(x) (uint16_t) ((x) + 0.5)
#define CMSIZE 256
#define WIDTH 525
#define HEIGHT 512
@@ -45,7 +45,7 @@ int main(int argc, char **argv)
int i, j;
TIFF * tif;
unsigned char * scan_line;
- uint16 red[CMSIZE], green[CMSIZE], blue[CMSIZE];
+ uint16_t red[CMSIZE], green[CMSIZE], blue[CMSIZE];
float refblackwhite[2*3];
programName = argv[0];
diff --git a/tiff/contrib/dbs/xtiff/Makefile.am b/tiff/contrib/dbs/xtiff/Makefile.am
index a138c90a..cd810472 100644
--- a/tiff/contrib/dbs/xtiff/Makefile.am
+++ b/tiff/contrib/dbs/xtiff/Makefile.am
@@ -27,7 +27,6 @@
#LIBTIFF = $(top_builddir)/libtiff/libtiff.la
EXTRA_DIST = \
- CMakeLists.txt \
README \
patchlevel.h \
xtiff.c \
diff --git a/tiff/contrib/dbs/xtiff/Makefile.in b/tiff/contrib/dbs/xtiff/Makefile.in
index 4be51fd8..50b6bf09 100644
--- a/tiff/contrib/dbs/xtiff/Makefile.in
+++ b/tiff/contrib/dbs/xtiff/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,8 +125,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -290,6 +292,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -300,7 +303,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
- CMakeLists.txt \
README \
patchlevel.h \
xtiff.c \
diff --git a/tiff/contrib/dbs/xtiff/xtiff.c b/tiff/contrib/dbs/xtiff/xtiff.c
index bc10b670..a9518f83 100644
--- a/tiff/contrib/dbs/xtiff/xtiff.c
+++ b/tiff/contrib/dbs/xtiff/xtiff.c
@@ -70,7 +70,7 @@
#include "xtifficon.h"
#define TIFF_GAMMA "2.2" /* default gamma from the TIFF 5.0 spec */
-#define ROUND(x) (uint16) ((x) + 0.5)
+#define ROUND(x) (uint16_t) ((x) + 0.5)
#define SCALE(x, s) (((x) * 65535L) / (s))
#define MCHECK(m) if (!m) { fprintf(stderr, "malloc failed\n"); exit(0); }
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
@@ -131,8 +131,8 @@ typedef struct {
Boolean help;
float gamma;
Boolean usePixmap;
- uint32 viewportWidth;
- uint32 viewportHeight;
+ uint32_t viewportWidth;
+ uint32_t viewportHeight;
int translate;
Boolean verbose;
} AppData, *AppDataPtr;
@@ -236,8 +236,8 @@ unsigned char basePixel = 0;
* TIFF data structures
*/
TIFF * tfFile = NULL;
-uint32 tfImageWidth, tfImageHeight;
-uint16 tfBitsPerSample, tfSamplesPerPixel, tfPlanarConfiguration,
+uint32_t tfImageWidth, tfImageHeight;
+uint16_t tfBitsPerSample, tfSamplesPerPixel, tfPlanarConfiguration,
tfPhotometricInterpretation, tfGrayResponseUnit,
tfImageDepth, tfBytesPerRow;
int tfDirectory = 0, tfMultiPage = False;
@@ -253,7 +253,7 @@ double *dRed, *dGreen, *dBlue;
/*
* shared data structures
*/
-uint16 * redMap = NULL, *greenMap = NULL, *blueMap = NULL,
+uint16_t * redMap = NULL, *greenMap = NULL, *blueMap = NULL,
*grayMap = NULL, colormapSize;
char * imageMemory;
char * fileName;
@@ -451,9 +451,9 @@ GetTIFFHeader()
*/
switch (tfPhotometricInterpretation) {
case PHOTOMETRIC_RGB:
- redMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
+ redMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ greenMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ blueMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap);
for (i = 0; i < colormapSize; i++)
dRed[i] = dGreen[i] = dBlue[i]
@@ -462,9 +462,9 @@ GetTIFFHeader()
case PHOTOMETRIC_PALETTE:
if (!TIFFGetField(tfFile, TIFFTAG_COLORMAP,
&redMap, &greenMap, &blueMap)) {
- redMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
+ redMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ greenMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ blueMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap);
for (i = 0; i < colormapSize; i++)
dRed[i] = dGreen[i] = dBlue[i]
@@ -479,18 +479,18 @@ GetTIFFHeader()
}
break;
case PHOTOMETRIC_MINISWHITE:
- redMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
+ redMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ greenMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ blueMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap);
for (i = 0; i < colormapSize; i++)
dRed[i] = dGreen[i] = dBlue[i] = (double)
SCALE(colormapSize-1-i, colormapSize-1);
break;
case PHOTOMETRIC_MINISBLACK:
- redMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- greenMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
- blueMap = (uint16 *) malloc(colormapSize * sizeof(uint16));
+ redMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ greenMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
+ blueMap = (uint16_t *) malloc(colormapSize * sizeof(uint16_t));
MCHECK(redMap); MCHECK(greenMap); MCHECK(blueMap);
for (i = 0; i < colormapSize; i++)
dRed[i] = dGreen[i] = dBlue[i] = (double) SCALE(i, colormapSize-1);
@@ -736,8 +736,8 @@ GetTIFFImage()
{
int pixel_map[3], red_shift, green_shift, blue_shift;
char *scan_line, *output_p, *input_p;
- uint32 i, j;
- uint16 s;
+ uint32_t i, j;
+ uint16_t s;
scan_line = (char *) malloc(tfBytesPerRow = TIFFScanlineSize(tfFile));
MCHECK(scan_line);
diff --git a/tiff/contrib/iptcutil/CMakeLists.txt b/tiff/contrib/iptcutil/CMakeLists.txt
index 35cc2612..39d908c6 100644
--- a/tiff/contrib/iptcutil/CMakeLists.txt
+++ b/tiff/contrib/iptcutil/CMakeLists.txt
@@ -22,14 +22,5 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-extra_dist(
- README
- test.iptc
- test.txt)
-
-include_directories(${PROJECT_SOURCE_DIR}/libtiff
- ${PROJECT_BINARY_DIR}/libtiff
- ${CMAKE_CURRENT_BINARY_DIR})
-
add_executable(iptcutil iptcutil.c)
target_link_libraries(iptcutil tiff port)
diff --git a/tiff/contrib/iptcutil/Makefile.in b/tiff/contrib/iptcutil/Makefile.in
index c0cc3959..ec2f2457 100644
--- a/tiff/contrib/iptcutil/Makefile.in
+++ b/tiff/contrib/iptcutil/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -124,8 +124,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
@@ -148,7 +150,7 @@ AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libtiff -I$(top_builddir)/port
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/iptcutil.Po
@@ -339,6 +341,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/tiff/contrib/iptcutil/iptcutil.c b/tiff/contrib/iptcutil/iptcutil.c
index 621716df..e002eee1 100644
--- a/tiff/contrib/iptcutil/iptcutil.c
+++ b/tiff/contrib/iptcutil/iptcutil.c
@@ -17,7 +17,7 @@
# include <fcntl.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
#define STRNICMP strnicmp
#else
#define STRNICMP strncasecmp
@@ -414,14 +414,14 @@ int main(int argc, char *argv[])
{
case 't':
mode = 1;
-#ifdef WIN32
+#ifdef _WIN32
/* Set "stdout" to binary mode: */
_setmode( _fileno( ofile ), _O_BINARY );
#endif
break;
case 'b':
mode = 0;
-#ifdef WIN32
+#ifdef _WIN32
/* Set "stdin" to binary mode: */
_setmode( _fileno( ifile ), _O_BINARY );
#endif
diff --git a/tiff/contrib/mfs/Makefile.am b/tiff/contrib/mfs/Makefile.am
index b0bad60a..62ae5d57 100644
--- a/tiff/contrib/mfs/Makefile.am
+++ b/tiff/contrib/mfs/Makefile.am
@@ -24,6 +24,5 @@
# Process this file with automake to produce Makefile.in.
EXTRA_DIST = \
- CMakeLists.txt \
README \
mfs_file.c
diff --git a/tiff/contrib/mfs/Makefile.in b/tiff/contrib/mfs/Makefile.in
index 0ed2019c..b558e081 100644
--- a/tiff/contrib/mfs/Makefile.in
+++ b/tiff/contrib/mfs/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,8 +122,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -287,6 +289,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -297,7 +300,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
- CMakeLists.txt \
README \
mfs_file.c
diff --git a/tiff/contrib/pds/Makefile.am b/tiff/contrib/pds/Makefile.am
index 435e2b33..c4e6bafe 100644
--- a/tiff/contrib/pds/Makefile.am
+++ b/tiff/contrib/pds/Makefile.am
@@ -24,7 +24,6 @@
# Process this file with automake to produce Makefile.in.
EXTRA_DIST = \
- CMakeLists.txt \
README \
tif_imageiter.c \
tif_imageiter.h \
diff --git a/tiff/contrib/pds/Makefile.in b/tiff/contrib/pds/Makefile.in
index 77b02179..f3f79a82 100644
--- a/tiff/contrib/pds/Makefile.in
+++ b/tiff/contrib/pds/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,8 +122,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -287,6 +289,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -297,7 +300,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
- CMakeLists.txt \
README \
tif_imageiter.c \
tif_imageiter.h \
diff --git a/tiff/contrib/pds/tif_imageiter.c b/tiff/contrib/pds/tif_imageiter.c
index 243cfd65..7ecf61a0 100644
--- a/tiff/contrib/pds/tif_imageiter.c
+++ b/tiff/contrib/pds/tif_imageiter.c
@@ -49,17 +49,17 @@
#include <assert.h>
#include <stdio.h>
-static int gtTileContig(TIFFImageIter*, void *udata, uint32, uint32);
-static int gtTileSeparate(TIFFImageIter*, void *udata, uint32, uint32);
-static int gtStripContig(TIFFImageIter*, void *udata, uint32, uint32);
-static int gtStripSeparate(TIFFImageIter*, void *udata, uint32, uint32);
+static int gtTileContig(TIFFImageIter*, void *udata, uint32_t, uint32_t);
+static int gtTileSeparate(TIFFImageIter*, void *udata, uint32_t, uint32_t);
+static int gtStripContig(TIFFImageIter*, void *udata, uint32_t, uint32_t);
+static int gtStripSeparate(TIFFImageIter*, void *udata, uint32_t, uint32_t);
static const char photoTag[] = "PhotometricInterpretation";
static int
isCCITTCompression(TIFF* tif)
{
- uint16 compress;
+ uint16_t compress;
TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress);
return (compress == COMPRESSION_CCITTFAX3 ||
compress == COMPRESSION_CCITTFAX4 ||
@@ -70,9 +70,9 @@ isCCITTCompression(TIFF* tif)
int
TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
{
- uint16* sampleinfo;
- uint16 extrasamples;
- uint16 planarconfig;
+ uint16_t* sampleinfo;
+ uint16_t extrasamples;
+ uint16_t planarconfig;
int colorchannels;
img->tif = tif;
@@ -134,7 +134,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
return (0);
}
/* It would probably be nice to have a reality check here. */
- { uint16 compress;
+ { uint16_t compress;
TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress);
if (compress == COMPRESSION_JPEG && planarconfig == PLANARCONFIG_CONTIG) {
/* can rely on libjpeg to convert to RGB */
@@ -152,7 +152,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
}
break;
case PHOTOMETRIC_SEPARATED: {
- uint16 inkset;
+ uint16_t inkset;
TIFFGetFieldDefaulted(tif, TIFFTAG_INKSET, &inkset);
if (inkset != INKSET_CMYK) {
sprintf(emsg, "Sorry, can not handle separated image with %s=%d",
@@ -206,7 +206,7 @@ TIFFImageIterBegin(TIFFImageIter* img, TIFF* tif, int stop, char emsg[1024])
}
int
-TIFFImageIterGet(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
+TIFFImageIterGet(TIFFImageIter* img, void *udata, uint32_t w, uint32_t h)
{
if (img->get == NULL) {
TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No \"get\" routine setup");
@@ -230,7 +230,7 @@ TIFFImageIterEnd(TIFFImageIter* img)
*/
int
TIFFReadImageIter(TIFF* tif,
- uint32 rwidth, uint32 rheight, uint8* raster, int stop)
+ uint32_t rwidth, uint32_t rheight, uint8_t* raster, int stop)
{
char emsg[1024];
TIFFImageIter img;
@@ -255,16 +255,16 @@ TIFFReadImageIter(TIFF* tif,
* SamplesPerPixel == 1
*/
static int
-gtTileContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
+gtTileContig(TIFFImageIter* img, void *udata, uint32_t w, uint32_t h)
{
TIFF* tif = img->tif;
ImageIterTileContigRoutine callback = img->callback.contig;
- uint16 orientation;
- uint32 col, row;
- uint32 tw, th;
+ uint16_t orientation;
+ uint32_t col, row;
+ uint32_t tw, th;
u_char* buf;
- int32 fromskew;
- uint32 nrow;
+ int32_t fromskew;
+ uint32_t nrow;
buf = (u_char*) _TIFFmalloc(TIFFTileSize(tif));
if (buf == 0) {
@@ -284,7 +284,7 @@ gtTileContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
* Tile is clipped horizontally. Calculate
* visible portion and skewing factors.
*/
- uint32 npix = w - col;
+ uint32_t npix = w - col;
fromskew = tw - npix;
(*callback)(img, udata, col, row, npix, nrow, fromskew, buf);
} else {
@@ -303,22 +303,22 @@ gtTileContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
* We assume that all such images are RGB.
*/
static int
-gtTileSeparate(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
+gtTileSeparate(TIFFImageIter* img, void *udata, uint32_t w, uint32_t h)
{
TIFF* tif = img->tif;
ImageIterTileSeparateRoutine callback = img->callback.separate;
- uint16 orientation;
- uint32 col, row;
- uint32 tw, th;
+ uint16_t orientation;
+ uint32_t col, row;
+ uint32_t tw, th;
u_char* buf;
u_char* r;
u_char* g;
u_char* b;
u_char* a;
tsize_t tilesize;
- int32 fromskew;
+ int32_t fromskew;
int alpha = img->alpha;
- uint32 nrow;
+ uint32_t nrow;
tilesize = TIFFTileSize(tif);
buf = (u_char*) _TIFFmalloc(4*tilesize);
@@ -351,7 +351,7 @@ gtTileSeparate(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
* Tile is clipped horizontally. Calculate
* visible portion and skewing factors.
*/
- uint32 npix = w - col;
+ uint32_t npix = w - col;
fromskew = tw - npix;
(*callback)(img, udata, col, row, npix, nrow, fromskew, r, g, b, a);
} else {
@@ -370,17 +370,17 @@ gtTileSeparate(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
* SamplesPerPixel == 1
*/
static int
-gtStripContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
+gtStripContig(TIFFImageIter* img, void *udata, uint32_t w, uint32_t h)
{
TIFF* tif = img->tif;
ImageIterTileContigRoutine callback = img->callback.contig;
- uint16 orientation;
- uint32 row, nrow;
+ uint16_t orientation;
+ uint32_t row, nrow;
u_char* buf;
- uint32 rowsperstrip;
- uint32 imagewidth = img->width;
+ uint32_t rowsperstrip;
+ uint32_t imagewidth = img->width;
tsize_t scanline;
- int32 fromskew;
+ int32_t fromskew;
buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif));
if (buf == 0) {
@@ -409,19 +409,19 @@ gtStripContig(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
* We assume that all such images are RGB.
*/
static int
-gtStripSeparate(TIFFImageIter* img, void *udata, uint32 w, uint32 h)
+gtStripSeparate(TIFFImageIter* img, void *udata, uint32_t w, uint32_t h)
{
TIFF* tif = img->tif;
ImageIterTileSeparateRoutine callback = img->callback.separate;
- uint16 orientation;
+ uint16_t orientation;
u_char *buf;
u_char *r, *g, *b, *a;
- uint32 row, nrow;
+ uint32_t row, nrow;
tsize_t scanline;
- uint32 rowsperstrip;
- uint32 imagewidth = img->width;
+ uint32_t rowsperstrip;
+ uint32_t imagewidth = img->width;
tsize_t stripsize;
- int32 fromskew;
+ int32_t fromskew;
int alpha = img->alpha;
stripsize = TIFFStripSize(tif);
diff --git a/tiff/contrib/pds/tif_imageiter.h b/tiff/contrib/pds/tif_imageiter.h
index 4f4fd279..4f09c1d2 100644
--- a/tiff/contrib/pds/tif_imageiter.h
+++ b/tiff/contrib/pds/tif_imageiter.h
@@ -8,28 +8,28 @@ typedef struct _TIFFImageIter TIFFImageIter;
bits of data. The array pp is ordered in h consecutive rows of w+fromskew
pixels each. */
typedef void (*ImageIterTileContigRoutine)
- (TIFFImageIter*, void *, uint32, uint32, uint32, uint32, int32,
+ (TIFFImageIter*, void *, uint32_t, uint32_t, uint32_t, uint32_t, int32_t,
unsigned char*);
#define DECLAREContigCallbackFunc(name) \
static void name(\
TIFFImageIter* img, \
void* user_data, \
- uint32 x, uint32 y, \
- uint32 w, uint32 h, \
- int32 fromskew, \
+ uint32_t x, uint32_t y, \
+ uint32_t w, uint32_t h, \
+ int32_t fromskew, \
u_char* pp \
)
typedef void (*ImageIterTileSeparateRoutine)
- (TIFFImageIter*, void *, uint32, uint32, uint32, uint32, int32,
+ (TIFFImageIter*, void *, uint32_t, uint32_t, uint32_t, uint32_t, int32_t,
unsigned char*, unsigned char*, unsigned char*, unsigned char*);
#define DECLARESepCallbackFunc(name) \
static void name(\
TIFFImageIter* img, \
void* user_data, \
- uint32 x, uint32 y, \
- uint32 w, uint32 h,\
- int32 fromskew, \
+ uint32_t x, uint32_t y, \
+ uint32_t w, uint32_t h,\
+ int32_t fromskew, \
u_char* r, u_char* g, u_char* b, u_char* a\
)
@@ -38,17 +38,17 @@ struct _TIFFImageIter {
int stoponerr; /* stop on read error */
int isContig; /* data is packed/separate */
int alpha; /* type of alpha data present */
- uint32 width; /* image width */
- uint32 height; /* image height */
- uint16 bitspersample; /* image bits/sample */
- uint16 samplesperpixel; /* image samples/pixel */
- uint16 orientation; /* image orientation */
- uint16 photometric; /* image photometric interp */
- uint16* redcmap; /* colormap palette */
- uint16* greencmap;
- uint16* bluecmap;
+ uint32_t width; /* image width */
+ uint32_t height; /* image height */
+ uint16_t bitspersample; /* image bits/sample */
+ uint16_t samplesperpixel; /* image samples/pixel */
+ uint16_t orientation; /* image orientation */
+ uint16_t photometric; /* image photometric interp */
+ uint16_t* redcmap; /* colormap palette */
+ uint16_t* greencmap;
+ uint16_t* bluecmap;
/* get image data routine */
- int (*get)(TIFFImageIter*, void *udata, uint32, uint32);
+ int (*get)(TIFFImageIter*, void *udata, uint32_t, uint32_t);
union {
void (*any)(TIFFImageIter*);
ImageIterTileContigRoutine contig;
diff --git a/tiff/contrib/pds/tif_pdsdirread.c b/tiff/contrib/pds/tif_pdsdirread.c
index cc6231da..19fccb38 100644
--- a/tiff/contrib/pds/tif_pdsdirread.c
+++ b/tiff/contrib/pds/tif_pdsdirread.c
@@ -55,13 +55,13 @@
#define TIFFCvtIEEEFloatToNative(tif, n, fp)
#define TIFFCvtIEEEDoubleToNative(tif, n, dp)
#else
-extern void TIFFCvtIEEEFloatToNative(TIFF*, uint32, float*);
-extern void TIFFCvtIEEEDoubleToNative(TIFF*, uint32, double*);
+extern void TIFFCvtIEEEFloatToNative(TIFF*, uint32_t, float*);
+extern void TIFFCvtIEEEDoubleToNative(TIFF*, uint32_t, double*);
#endif
-static void EstimateStripByteCounts(TIFF*, TIFFDirEntry*, uint16);
+static void EstimateStripByteCounts(TIFF*, TIFFDirEntry*, uint16_t);
static void MissingRequired(TIFF*, const char*);
-static int CheckDirCount(TIFF*, TIFFDirEntry*, uint32);
+static int CheckDirCount(TIFF*, TIFFDirEntry*, uint32_t);
static tsize_t TIFFFetchData(TIFF*, TIFFDirEntry*, char*);
static tsize_t TIFFFetchString(TIFF*, TIFFDirEntry*, char*);
static float TIFFFetchRational(TIFF*, TIFFDirEntry*);
@@ -69,8 +69,8 @@ static int TIFFFetchNormalSubTag(TIFF*, TIFFDirEntry*, const TIFFFieldInfo*,
int (*getFieldFn)(TIFF *tif,ttag_t tag,...));
static int TIFFFetchPerSampleShorts(TIFF*, TIFFDirEntry*, int*);
static int TIFFFetchPerSampleAnys(TIFF*, TIFFDirEntry*, double*);
-static int TIFFFetchShortArray(TIFF*, TIFFDirEntry*, uint16*);
-static int TIFFFetchStripThing(TIFF*, TIFFDirEntry*, long, uint32**);
+static int TIFFFetchShortArray(TIFF*, TIFFDirEntry*, uint16_t*);
+static int TIFFFetchStripThing(TIFF*, TIFFDirEntry*, long, uint32_t**);
static int TIFFFetchExtraSamples(TIFF*, TIFFDirEntry*);
static int TIFFFetchRefBlackWhite(TIFF*, TIFFDirEntry*);
static float TIFFFetchFloat(TIFF*, TIFFDirEntry*);
@@ -126,8 +126,8 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset,
double dv;
const TIFFFieldInfo* fip;
int fix;
- uint16 dircount;
- uint32 nextdiroff;
+ uint16_t dircount;
+ uint32_t nextdiroff;
char* cp;
int diroutoforderwarning = 0;
@@ -139,7 +139,7 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset,
"Seek error accessing TIFF private subdirectory");
return (0);
}
- if (!ReadOK(tif, &dircount, sizeof (uint16))) {
+ if (!ReadOK(tif, &dircount, sizeof (uint16_t))) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"Can not read TIFF private subdirectory count");
return (0);
@@ -157,7 +157,7 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset,
/*
* Read offset to next directory for sequential scans.
*/
- (void) ReadOK(tif, &nextdiroff, sizeof (uint32));
+ (void) ReadOK(tif, &nextdiroff, sizeof (uint32_t));
} else {
toff_t off = pdir_offset;
@@ -166,8 +166,8 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset,
"Can not read TIFF private subdirectory count");
return (0);
} else
- _TIFFmemcpy(&dircount, tif->tif_base + off, sizeof (uint16));
- off += sizeof (uint16);
+ _TIFFmemcpy(&dircount, tif->tif_base + off, sizeof (uint16_t));
+ off += sizeof (uint16_t);
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabShort(&dircount);
dir = (TIFFDirEntry *)CheckMalloc(tif,
@@ -181,8 +181,8 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset,
_TIFFmemcpy(dir, tif->tif_base + off,
dircount*sizeof (TIFFDirEntry));
off += dircount* sizeof (TIFFDirEntry);
- if (off + sizeof (uint32) < tif->tif_size)
- _TIFFmemcpy(&nextdiroff, tif->tif_base+off, sizeof (uint32));
+ if (off + sizeof (uint32_t) < tif->tif_size)
+ _TIFFmemcpy(&nextdiroff, tif->tif_base+off, sizeof (uint32_t));
}
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong(&nextdiroff);
@@ -260,9 +260,9 @@ TIFFReadPrivateDataSubDirectory(TIFF* tif, toff_t pdir_offset,
* Check count if known in advance.
*/
if (fip->field_readcount != TIFF_VARIABLE) {
- uint32 expected = (fip->field_readcount == TIFF_SPP) ?
- (uint32) td->td_samplesperpixel :
- (uint32) fip->field_readcount;
+ uint32_t expected = (fip->field_readcount == TIFF_SPP) ?
+ (uint32_t) td->td_samplesperpixel :
+ (uint32_t) fip->field_readcount;
if (!CheckDirCount(tif, dp, expected))
goto ignore;
}
@@ -283,29 +283,29 @@ bad:
}
static void
-EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
+EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16_t dircount)
{
register TIFFDirEntry *dp;
register TIFFDirectory *td = &tif->tif_dir;
- uint16 i;
+ uint16_t i;
if (td->td_stripbytecount)
_TIFFfree(td->td_stripbytecount);
- td->td_stripbytecount = (uint32*)
- CheckMalloc(tif, td->td_nstrips * sizeof (uint32),
+ td->td_stripbytecount = (uint32_t*)
+ CheckMalloc(tif, td->td_nstrips * sizeof (uint32_t),
"for \"StripByteCounts\" array");
if (td->td_compression != COMPRESSION_NONE) {
- uint32 space = (uint32)(sizeof (TIFFHeader)
- + sizeof (uint16)
+ uint32_t space = (uint32_t)(sizeof (TIFFHeader)
+ + sizeof (uint16_t)
+ (dircount * sizeof (TIFFDirEntry))
- + sizeof (uint32));
+ + sizeof (uint32_t));
toff_t filesize = TIFFGetFileSize(tif);
- uint16 n;
+ uint16_t n;
/* calculate amount of space used by indirect values */
for (dp = dir, n = dircount; n > 0; n--, dp++) {
- uint32 cc = dp->tdir_count*TIFFDataWidth(dp->tdir_type);
- if (cc > sizeof (uint32))
+ uint32_t cc = dp->tdir_count*TIFFDataWidth(dp->tdir_type);
+ if (cc > sizeof (uint32_t))
space += cc;
}
space = (filesize - space) / td->td_samplesperpixel;
@@ -323,8 +323,8 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
td->td_stripbytecount[i] =
filesize - td->td_stripoffset[i];
} else {
- uint32 rowbytes = TIFFScanlineSize(tif);
- uint32 rowsperstrip = td->td_imagelength / td->td_nstrips;
+ uint32_t rowbytes = TIFFScanlineSize(tif);
+ uint32_t rowsperstrip = td->td_imagelength / td->td_nstrips;
for (i = 0; i < td->td_nstrips; i++)
td->td_stripbytecount[i] = rowbytes*rowsperstrip;
}
@@ -347,7 +347,7 @@ MissingRequired(TIFF* tif, const char* tagname)
* there is a mismatch.
*/
static int
-CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count)
+CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32_t count)
{
if (count != dir->tdir_count) {
TIFFWarning(tif->tif_name,
@@ -382,16 +382,16 @@ TIFFFetchData(TIFF* tif, TIFFDirEntry* dir, char* cp)
switch (dir->tdir_type) {
case TIFF_SHORT:
case TIFF_SSHORT:
- TIFFSwabArrayOfShort((uint16*) cp, dir->tdir_count);
+ TIFFSwabArrayOfShort((uint16_t*) cp, dir->tdir_count);
break;
case TIFF_LONG:
case TIFF_SLONG:
case TIFF_FLOAT:
- TIFFSwabArrayOfLong((uint32*) cp, dir->tdir_count);
+ TIFFSwabArrayOfLong((uint32_t*) cp, dir->tdir_count);
break;
case TIFF_RATIONAL:
case TIFF_SRATIONAL:
- TIFFSwabArrayOfLong((uint32*) cp, 2*dir->tdir_count);
+ TIFFSwabArrayOfLong((uint32_t*) cp, 2*dir->tdir_count);
break;
case TIFF_DOUBLE:
TIFFSwabArrayOfDouble((double*) cp, dir->tdir_count);
@@ -412,7 +412,7 @@ static tsize_t
TIFFFetchString(TIFF* tif, TIFFDirEntry* dir, char* cp)
{
if (dir->tdir_count <= 4) {
- uint32 l = dir->tdir_offset;
+ uint32_t l = dir->tdir_offset;
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong(&l);
_TIFFmemcpy(cp, &l, dir->tdir_count);
@@ -425,7 +425,7 @@ TIFFFetchString(TIFF* tif, TIFFDirEntry* dir, char* cp)
* Convert numerator+denominator to float.
*/
static int
-cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv)
+cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32_t num, uint32_t denom, float* rv)
{
if (denom == 0) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
@@ -436,7 +436,7 @@ cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv)
if (dir->tdir_type == TIFF_RATIONAL)
*rv = ((float)num / (float)denom);
else
- *rv = ((float)(int32)num / (float)(int32)denom);
+ *rv = ((float)(int32_t)num / (float)(int32_t)denom);
return (1);
}
}
@@ -449,7 +449,7 @@ cvtRational(TIFF* tif, TIFFDirEntry* dir, uint32 num, uint32 denom, float* rv)
static float
TIFFFetchRational(TIFF* tif, TIFFDirEntry* dir)
{
- uint32 l[2];
+ uint32_t l[2];
float v;
return (!TIFFFetchData(tif, dir, (char *)l) ||
@@ -473,12 +473,12 @@ TIFFFetchFloat(TIFF* tif, TIFFDirEntry* dir)
TIFFCvtIEEEFloatToNative(tif, 1, &v);
#else
float v;
- /* This is a little bit tricky - if we just cast the uint32 to a float,
+ /* This is a little bit tricky - if we just cast the uint32_t to a float,
C will perform a numerical conversion, which is not what we want.
- We want to take the actual bit pattern in the uint32 and interpret
- it as a float. Thus we cast a uint32 * into a float * and then
+ We want to take the actual bit pattern in the uint32_t and interpret
+ it as a float. Thus we cast a uint32_t * into a float * and then
dereference to get v. */
- uint32 l = (uint32)
+ uint32_t l = (uint32_t)
TIFFExtractData(tif, dir->tdir_type, dir->tdir_offset);
v = * (float *) &l;
TIFFCvtIEEEFloatToNative(tif, 1, &v);
@@ -491,7 +491,7 @@ TIFFFetchFloat(TIFF* tif, TIFFDirEntry* dir)
* Fetch an array of BYTE or SBYTE values.
*/
static int
-TIFFFetchByteArray(TIFF* tif, TIFFDirEntry* dir, uint16* v)
+TIFFFetchByteArray(TIFF* tif, TIFFDirEntry* dir, uint16_t* v)
{
if (dir->tdir_count <= 4) {
/*
@@ -521,7 +521,7 @@ TIFFFetchByteArray(TIFF* tif, TIFFDirEntry* dir, uint16* v)
* Fetch an array of SHORT or SSHORT values.
*/
static int
-TIFFFetchShortArray(TIFF* tif, TIFFDirEntry* dir, uint16* v)
+TIFFFetchShortArray(TIFF* tif, TIFFDirEntry* dir, uint16_t* v)
{
if (dir->tdir_count <= 2) {
if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) {
@@ -546,7 +546,7 @@ TIFFFetchShortArray(TIFF* tif, TIFFDirEntry* dir, uint16* v)
static int
TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir)
{
- uint16 v[2];
+ uint16_t v[2];
int ok = 0;
switch (dir->tdir_type) {
@@ -568,7 +568,7 @@ TIFFFetchShortPair(TIFF* tif, TIFFDirEntry* dir)
* Fetch an array of LONG or SLONG values.
*/
static int
-TIFFFetchLongArray(TIFF* tif, TIFFDirEntry* dir, uint32* v)
+TIFFFetchLongArray(TIFF* tif, TIFFDirEntry* dir, uint32_t* v)
{
if (dir->tdir_count == 1) {
v[0] = dir->tdir_offset;
@@ -584,14 +584,14 @@ static int
TIFFFetchRationalArray(TIFF* tif, TIFFDirEntry* dir, float* v)
{
int ok = 0;
- uint32* l;
+ uint32_t* l;
- l = (uint32*)CheckMalloc(tif,
+ l = (uint32_t*)CheckMalloc(tif,
dir->tdir_count*TIFFDataWidth(dir->tdir_type),
"to fetch array of rationals");
if (l) {
if (TIFFFetchData(tif, dir, (char *)l)) {
- uint32 i;
+ uint32_t i;
for (i = 0; i < dir->tdir_count; i++) {
ok = cvtRational(tif, dir,
l[2*i+0], l[2*i+1], &v[i]);
@@ -654,42 +654,42 @@ TIFFFetchAnyArray(TIFF* tif, TIFFDirEntry* dir, double* v)
switch (dir->tdir_type) {
case TIFF_BYTE:
case TIFF_SBYTE:
- if (!TIFFFetchByteArray(tif, dir, (uint16*) v))
+ if (!TIFFFetchByteArray(tif, dir, (uint16_t*) v))
return (0);
if (dir->tdir_type == TIFF_BYTE) {
- uint16* vp = (uint16*) v;
+ uint16_t* vp = (uint16_t*) v;
for (i = dir->tdir_count-1; i >= 0; i--)
v[i] = vp[i];
} else {
- int16* vp = (int16*) v;
+ int16_t* vp = (int16_t*) v;
for (i = dir->tdir_count-1; i >= 0; i--)
v[i] = vp[i];
}
break;
case TIFF_SHORT:
case TIFF_SSHORT:
- if (!TIFFFetchShortArray(tif, dir, (uint16*) v))
+ if (!TIFFFetchShortArray(tif, dir, (uint16_t*) v))
return (0);
if (dir->tdir_type == TIFF_SHORT) {
- uint16* vp = (uint16*) v;
+ uint16_t* vp = (uint16_t*) v;
for (i = dir->tdir_count-1; i >= 0; i--)
v[i] = vp[i];
} else {
- int16* vp = (int16*) v;
+ int16_t* vp = (int16_t*) v;
for (i = dir->tdir_count-1; i >= 0; i--)
v[i] = vp[i];
}
break;
case TIFF_LONG:
case TIFF_SLONG:
- if (!TIFFFetchLongArray(tif, dir, (uint32*) v))
+ if (!TIFFFetchLongArray(tif, dir, (uint32_t*) v))
return (0);
if (dir->tdir_type == TIFF_LONG) {
- uint32* vp = (uint32*) v;
+ uint32_t* vp = (uint32_t*) v;
for (i = dir->tdir_count-1; i >= 0; i--)
v[i] = vp[i];
} else {
- int32* vp = (int32*) v;
+ int32_t* vp = (int32_t*) v;
for (i = dir->tdir_count-1; i >= 0; i--)
v[i] = vp[i];
}
@@ -747,20 +747,20 @@ TIFFFetchNormalSubTag(TIFF* tif, TIFFDirEntry* dp, const TIFFFieldInfo* fip,
case TIFF_SBYTE:
/* NB: always expand BYTE values to shorts */
cp = CheckMalloc(tif,
- dp->tdir_count * sizeof (uint16), mesg);
- ok = cp && TIFFFetchByteArray(tif, dp, (uint16*) cp);
+ dp->tdir_count * sizeof (uint16_t), mesg);
+ ok = cp && TIFFFetchByteArray(tif, dp, (uint16_t*) cp);
break;
case TIFF_SHORT:
case TIFF_SSHORT:
cp = CheckMalloc(tif,
- dp->tdir_count * sizeof (uint16), mesg);
- ok = cp && TIFFFetchShortArray(tif, dp, (uint16*) cp);
+ dp->tdir_count * sizeof (uint16_t), mesg);
+ ok = cp && TIFFFetchShortArray(tif, dp, (uint16_t*) cp);
break;
case TIFF_LONG:
case TIFF_SLONG:
cp = CheckMalloc(tif,
- dp->tdir_count * sizeof (uint32), mesg);
- ok = cp && TIFFFetchLongArray(tif, dp, (uint32*) cp);
+ dp->tdir_count * sizeof (uint32_t), mesg);
+ ok = cp && TIFFFetchLongArray(tif, dp, (uint32_t*) cp);
break;
case TIFF_RATIONAL:
case TIFF_SRATIONAL:
@@ -804,9 +804,9 @@ TIFFFetchNormalSubTag(TIFF* tif, TIFFDirEntry* dp, const TIFFFieldInfo* fip,
case TIFF_SSHORT:
/*
* If the tag is also acceptable as a LONG or SLONG
- * then (*setFieldFn) will expect an uint32 parameter
+ * then (*setFieldFn) will expect an uint32_t parameter
* passed to it (through varargs). Thus, for machines
- * where sizeof (int) != sizeof (uint32) we must do
+ * where sizeof (int) != sizeof (uint32_t) we must do
* a careful check here. It's hard to say if this
* is worth optimizing.
*
@@ -817,7 +817,7 @@ TIFFFetchNormalSubTag(TIFF* tif, TIFFDirEntry* dp, const TIFFFieldInfo* fip,
*/
{ TIFFDataType type = fip->field_type;
if (type != TIFF_LONG && type != TIFF_SLONG) {
- uint16 v = (uint16)
+ uint16_t v = (uint16_t)
TIFFExtractData(tif, dp->tdir_type, dp->tdir_offset);
ok = (fip->field_passcount ?
(*setFieldFn)(tif, dp->tdir_tag, 1, &v)
@@ -828,7 +828,7 @@ TIFFFetchNormalSubTag(TIFF* tif, TIFFDirEntry* dp, const TIFFFieldInfo* fip,
/* fall through... */
case TIFF_LONG:
case TIFF_SLONG:
- { uint32 v32 =
+ { uint32_t v32 =
TIFFExtractData(tif, dp->tdir_type, dp->tdir_offset);
ok = (fip->field_passcount ?
(*setFieldFn)(tif, dp->tdir_tag, 1, &v32)
@@ -885,12 +885,12 @@ TIFFFetchPerSampleShorts(TIFF* tif, TIFFDirEntry* dir, int* pl)
int samples = tif->tif_dir.td_samplesperpixel;
int status = 0;
- if (CheckDirCount(tif, dir, (uint32) samples)) {
- uint16 buf[10];
- uint16* v = buf;
+ if (CheckDirCount(tif, dir, (uint32_t) samples)) {
+ uint16_t buf[10];
+ uint16_t* v = buf;
if (samples > NITEMS(buf))
- v = (uint16*) _TIFFmalloc(samples * sizeof (uint16));
+ v = (uint16_t*) _TIFFmalloc(samples * sizeof (uint16_t));
if (TIFFFetchShortArray(tif, dir, v)) {
int i;
for (i = 1; i < samples; i++)
@@ -921,7 +921,7 @@ TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl)
int samples = (int) tif->tif_dir.td_samplesperpixel;
int status = 0;
- if (CheckDirCount(tif, dir, (uint32) samples)) {
+ if (CheckDirCount(tif, dir, (uint32_t) samples)) {
double buf[10];
double* v = buf;
@@ -953,31 +953,31 @@ TIFFFetchPerSampleAnys(TIFF* tif, TIFFDirEntry* dir, double* pl)
* in fact it's also used for tiles.
*/
static int
-TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp)
+TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32_t** lpp)
{
- register uint32* lp;
+ register uint32_t* lp;
int status;
- if (!CheckDirCount(tif, dir, (uint32) nstrips))
+ if (!CheckDirCount(tif, dir, (uint32_t) nstrips))
return (0);
/*
* Allocate space for strip information.
*/
if (*lpp == NULL &&
- (*lpp = (uint32 *)CheckMalloc(tif,
- nstrips * sizeof (uint32), "for strip array")) == NULL)
+ (*lpp = (uint32_t *)CheckMalloc(tif,
+ nstrips * sizeof (uint32_t), "for strip array")) == NULL)
return (0);
lp = *lpp;
if (dir->tdir_type == (int)TIFF_SHORT) {
/*
- * Handle uint16->uint32 expansion.
+ * Handle uint16_t->uint32_t expansion.
*/
- uint16* dp = (uint16*) CheckMalloc(tif,
- dir->tdir_count* sizeof (uint16), "to fetch strip tag");
+ uint16_t* dp = (uint16_t*) CheckMalloc(tif,
+ dir->tdir_count* sizeof (uint16_t), "to fetch strip tag");
if (dp == NULL)
return (0);
if (status = TIFFFetchShortArray(tif, dir, dp)) {
- register uint16* wp = dp;
+ register uint16_t* wp = dp;
while (nstrips-- > 0)
*lp++ = *wp++;
}
@@ -994,12 +994,12 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, long nstrips, uint32** lpp)
static int
TIFFFetchExtraSamples(TIFF* tif, TIFFDirEntry* dir)
{
- uint16 buf[10];
- uint16* v = buf;
+ uint16_t buf[10];
+ uint16_t* v = buf;
int status;
if (dir->tdir_count > NITEMS(buf))
- v = (uint16*) _TIFFmalloc(dir->tdir_count * sizeof (uint16));
+ v = (uint16_t*) _TIFFmalloc(dir->tdir_count * sizeof (uint16_t));
if (dir->tdir_type == TIFF_BYTE)
status = TIFFFetchByteArray(tif, dir, v);
else
@@ -1028,14 +1028,14 @@ TIFFFetchRefBlackWhite(TIFF* tif, TIFFDirEntry* dir)
/*
* Handle LONG's for backward compatibility.
*/
- cp = CheckMalloc(tif, dir->tdir_count * sizeof (uint32), mesg);
- if (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32*) cp))) {
+ cp = CheckMalloc(tif, dir->tdir_count * sizeof (uint32_t), mesg);
+ if (ok = (cp && TIFFFetchLongArray(tif, dir, (uint32_t*) cp))) {
float* fp = (float*)
CheckMalloc(tif, dir->tdir_count * sizeof (float), mesg);
if (ok = (fp != NULL)) {
- uint32 i;
+ uint32_t i;
for (i = 0; i < dir->tdir_count; i++)
- fp[i] = (float)((uint32*) cp)[i];
+ fp[i] = (float)((uint32_t*) cp)[i];
ok = TIFFSetField(tif, dir->tdir_tag, fp);
_TIFFfree((char*) fp);
}
@@ -1058,12 +1058,12 @@ static void
ChopUpSingleUncompressedStrip(TIFF* tif)
{
register TIFFDirectory *td = &tif->tif_dir;
- uint32 bytecount = td->td_stripbytecount[0];
- uint32 offset = td->td_stripoffset[0];
+ uint32_t bytecount = td->td_stripbytecount[0];
+ uint32_t offset = td->td_stripoffset[0];
tsize_t rowbytes = TIFFVTileSize(tif, 1), stripbytes;
tstrip_t strip, nstrips, rowsperstrip;
- uint32* newcounts;
- uint32* newoffsets;
+ uint32_t* newcounts;
+ uint32_t* newoffsets;
/*
* Make the rows hold at least one
@@ -1080,9 +1080,9 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
if (rowsperstrip >= td->td_rowsperstrip)
return;
nstrips = (tstrip_t) TIFFhowmany(bytecount, stripbytes);
- newcounts = (uint32*) CheckMalloc(tif, nstrips * sizeof (uint32),
+ newcounts = (uint32_t*) CheckMalloc(tif, nstrips * sizeof (uint32_t),
"for chopped \"StripByteCounts\" array");
- newoffsets = (uint32*) CheckMalloc(tif, nstrips * sizeof (uint32),
+ newoffsets = (uint32_t*) CheckMalloc(tif, nstrips * sizeof (uint32_t),
"for chopped \"StripOffsets\" array");
if (newcounts == NULL || newoffsets == NULL) {
/*
diff --git a/tiff/contrib/pds/tif_pdsdirwrite.c b/tiff/contrib/pds/tif_pdsdirwrite.c
index a670bda1..9e51bfbd 100644
--- a/tiff/contrib/pds/tif_pdsdirwrite.c
+++ b/tiff/contrib/pds/tif_pdsdirwrite.c
@@ -63,31 +63,31 @@
#define TIFFCvtNativeToIEEEFloat(tif, n, fp)
#define TIFFCvtNativeToIEEEDouble(tif, n, dp)
#else
-extern void TIFFCvtNativeToIEEEFloat(TIFF*, uint32, float*);
-extern void TIFFCvtNativeToIEEEDouble(TIFF*, uint32, double*);
+extern void TIFFCvtNativeToIEEEFloat(TIFF*, uint32_t, float*);
+extern void TIFFCvtNativeToIEEEDouble(TIFF*, uint32_t, double*);
#endif
static int TIFFWriteNormalTag(TIFF*, TIFFDirEntry*, const TIFFFieldInfo*);
static int TIFFWriteNormalSubTag(TIFF*, TIFFDirEntry*, const TIFFFieldInfo*,
int (*getFieldFn)(TIFF *tif,ttag_t tag,...));
-static void TIFFSetupShortLong(TIFF*, ttag_t, TIFFDirEntry*, uint32);
+static void TIFFSetupShortLong(TIFF*, ttag_t, TIFFDirEntry*, uint32_t);
static int TIFFSetupShortPair(TIFF*, ttag_t, TIFFDirEntry*);
static int TIFFWritePerSampleShorts(TIFF*, ttag_t, TIFFDirEntry*);
static int TIFFWritePerSampleAnys(TIFF*, TIFFDataType, ttag_t, TIFFDirEntry*);
-static int TIFFWriteShortTable(TIFF*, ttag_t, TIFFDirEntry*, uint32, uint16**);
+static int TIFFWriteShortTable(TIFF*, ttag_t, TIFFDirEntry*, uint32_t, uint16_t**);
static int TIFFWriteShortArray(TIFF*,
- TIFFDataType, ttag_t, TIFFDirEntry*, uint32, uint16*);
+ TIFFDataType, ttag_t, TIFFDirEntry*, uint32_t, uint16_t*);
static int TIFFWriteLongArray(TIFF *,
- TIFFDataType, ttag_t, TIFFDirEntry*, uint32, uint32*);
+ TIFFDataType, ttag_t, TIFFDirEntry*, uint32_t, uint32_t*);
static int TIFFWriteRationalArray(TIFF *,
- TIFFDataType, ttag_t, TIFFDirEntry*, uint32, float*);
+ TIFFDataType, ttag_t, TIFFDirEntry*, uint32_t, float*);
static int TIFFWriteFloatArray(TIFF *,
- TIFFDataType, ttag_t, TIFFDirEntry*, uint32, float*);
+ TIFFDataType, ttag_t, TIFFDirEntry*, uint32_t, float*);
static int TIFFWriteDoubleArray(TIFF *,
- TIFFDataType, ttag_t, TIFFDirEntry*, uint32, double*);
+ TIFFDataType, ttag_t, TIFFDirEntry*, uint32_t, double*);
static int TIFFWriteByteArray(TIFF*, TIFFDirEntry*, char*);
static int TIFFWriteAnyArray(TIFF*,
- TIFFDataType, ttag_t, TIFFDirEntry*, uint32, double*);
+ TIFFDataType, ttag_t, TIFFDirEntry*, uint32_t, double*);
#ifdef COLORIMETRY_SUPPORT
static int TIFFWriteTransferFunction(TIFF*, TIFFDirEntry*);
#endif
@@ -124,7 +124,7 @@ static int TIFFWriteRational(TIFF*,
the main, standard TIFF directories that does not apply to special
private subdirectories, so such a reimplementation for the sake of
eliminating redundant or duplicate code is probably not possible,
- unless we also pass in a Main flag to indiciate which type of handling
+ unless we also pass in a Main flag to indicate which type of handling
to do, which would be kind of a hack. I've marked those places where I
changed or ripped out code which would have to be re-inserted to
generalize this function. If it can be done in a clean and graceful way,
@@ -138,14 +138,14 @@ static int TIFFWriteRational(TIFF*,
*/
toff_t
TIFFWritePrivateDataSubDirectory(TIFF* tif,
- uint32 pdir_fieldsset[], int pdir_fields_last,
+ uint32_t pdir_fieldsset[], int pdir_fields_last,
TIFFFieldInfo *field_info,
int (*getFieldFn)(TIFF *tif, ttag_t tag, ...))
{
- uint16 dircount;
- uint32 diroff, nextdiroff;
+ uint16_t dircount;
+ uint32_t diroff, nextdiroff;
ttag_t tag;
- uint32 nfields;
+ uint32_t nfields;
tsize_t dirsize;
char* data;
TIFFDirEntry* dir;
@@ -188,7 +188,7 @@ TIFFWritePrivateDataSubDirectory(TIFF* tif,
tif->tif_dataoff =(TIFFSeekFile(tif, (toff_t) 0, SEEK_END)+1) &~ 1;
diroff = tif->tif_dataoff;
tif->tif_dataoff = (toff_t)(
- diroff + sizeof (uint16) + dirsize + sizeof (toff_t));
+ diroff + sizeof (uint16_t) + dirsize + sizeof (toff_t));
if (tif->tif_dataoff & 1)
tif->tif_dataoff++;
(void) TIFFSeekFile(tif, tif->tif_dataoff, SEEK_SET);
@@ -204,9 +204,9 @@ TIFFWritePrivateDataSubDirectory(TIFF* tif,
* why the original code calls ResetFieldBit(), since we're already
* going through the fields in order...
*
- * fields_size is the number of uint32's we will need to hold the
+ * fields_size is the number of uint32_t's we will need to hold the
* bit-mask for all of the fields. If our highest field number is
- * 100, then we'll need 100 / (8*4)+1 == 4 uint32's to hold the
+ * 100, then we'll need 100 / (8*4)+1 == 4 uint32_t's to hold the
* fieldset.
*
* Unlike the original code, we allocate fields dynamically based
@@ -214,9 +214,9 @@ TIFFWritePrivateDataSubDirectory(TIFF* tif,
* data subdirectories to contain more than the built-in code's limit
* of 95 tags in a directory.
*/
- fields_size = pdir_fields_last / (8*sizeof(uint32)) + 1;
- fields = _TIFFmalloc(fields_size*sizeof(uint32));
- _TIFFmemcpy(fields, pdir_fieldsset, fields_size * sizeof(uint32));
+ fields_size = pdir_fields_last / (8*sizeof(uint32_t)) + 1;
+ fields = _TIFFmalloc(fields_size*sizeof(uint32_t));
+ _TIFFmemcpy(fields, pdir_fieldsset, fields_size * sizeof(uint32_t));
/* Deleted "write out extra samples tag" code here. */
@@ -243,7 +243,7 @@ TIFFWritePrivateDataSubDirectory(TIFF* tif,
/*
* Write directory.
*/
- dircount = (uint16) nfields;
+ dircount = (uint16_t) nfields;
/* Deleted code to link to the next directory - we set it to zero! */
nextdiroff = 0;
if (tif->tif_flags & TIFF_SWAB) {
@@ -261,7 +261,7 @@ TIFFWritePrivateDataSubDirectory(TIFF* tif,
TIFFSwabArrayOfShort(&dir->tdir_tag, 2);
TIFFSwabArrayOfLong(&dir->tdir_count, 2);
}
- dircount = (uint16) nfields;
+ dircount = (uint16_t) nfields;
TIFFSwabShort(&dircount);
TIFFSwabLong(&nextdiroff);
}
@@ -296,7 +296,7 @@ TIFFWritePrivateDataSubDirectory(TIFF* tif,
*/
TIFFDefaultDirectory(tif);
tif->tif_curoff = 0;
- tif->tif_row = (uint32) -1;
+ tif->tif_row = (uint32_t) -1;
tif->tif_curstrip = (tstrip_t) -1;
#endif
@@ -328,7 +328,7 @@ TIFFWriteNormalSubTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip,
case TIFF_SHORT:
case TIFF_SSHORT:
if (wc > 1) {
- uint16* wp;
+ uint16_t* wp;
if (wc == (u_short) TIFF_VARIABLE) {
(*getFieldFn)(tif, fip->field_tag, &wc, &wp);
dir->tdir_count = wc;
@@ -337,7 +337,7 @@ TIFFWriteNormalSubTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip,
if (!WRITEF(TIFFWriteShortArray, wp))
return (0);
} else {
- uint16 sv;
+ uint16_t sv;
(*getFieldFn)(tif, fip->field_tag, &sv);
dir->tdir_offset =
TIFFInsertData(tif, dir->tdir_type, sv);
@@ -346,7 +346,7 @@ TIFFWriteNormalSubTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip,
case TIFF_LONG:
case TIFF_SLONG:
if (wc > 1) {
- uint32* lp;
+ uint32_t* lp;
if (wc == (u_short) TIFF_VARIABLE) {
(*getFieldFn)(tif, fip->field_tag, &wc, &lp);
dir->tdir_count = wc;
@@ -445,7 +445,7 @@ TIFFWriteNormalSubTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip,
case TIFF_ASCII:
{ char* cp;
(*getFieldFn)(tif, fip->field_tag, &cp);
- dir->tdir_count = (uint32) (strlen(cp) + 1);
+ dir->tdir_count = (uint32_t) (strlen(cp) + 1);
if (!TIFFWriteByteArray(tif, dir, cp))
return (0);
}
@@ -475,7 +475,7 @@ TIFFWriteNormalSubTag(TIFF* tif, TIFFDirEntry* dir, const TIFFFieldInfo* fip,
* or LONG type according to the value.
*/
static void
-TIFFSetupShortLong(TIFF* tif, ttag_t tag, TIFFDirEntry* dir, uint32 v)
+TIFFSetupShortLong(TIFF* tif, ttag_t tag, TIFFDirEntry* dir, uint32_t v)
{
dir->tdir_tag = tag;
dir->tdir_count = 1;
@@ -512,12 +512,12 @@ TIFFWriteRational(TIFF* tif,
static int
TIFFWritePerSampleShorts(TIFF* tif, ttag_t tag, TIFFDirEntry* dir)
{
- uint16 buf[10], v;
- uint16* w = buf;
+ uint16_t buf[10], v;
+ uint16_t* w = buf;
int i, status, samples = tif->tif_dir.td_samplesperpixel;
if (samples > NITEMS(buf))
- w = (uint16*) _TIFFmalloc(samples * sizeof (uint16));
+ w = (uint16_t*) _TIFFmalloc(samples * sizeof (uint16_t));
TIFFGetField(tif, tag, &v);
for (i = 0; i < samples; i++)
w[i] = v;
@@ -560,7 +560,7 @@ TIFFWritePerSampleAnys(TIFF* tif,
static int
TIFFSetupShortPair(TIFF* tif, ttag_t tag, TIFFDirEntry* dir)
{
- uint16 v[2];
+ uint16_t v[2];
TIFFGetField(tif, tag, &v[0], &v[1]);
return (TIFFWriteShortArray(tif, TIFF_SHORT, tag, dir, 2, v));
@@ -573,14 +573,14 @@ TIFFSetupShortPair(TIFF* tif, ttag_t tag, TIFFDirEntry* dir)
*/
static int
TIFFWriteShortTable(TIFF* tif,
- ttag_t tag, TIFFDirEntry* dir, uint32 n, uint16** table)
+ ttag_t tag, TIFFDirEntry* dir, uint32_t n, uint16_t** table)
{
- uint32 i, off;
+ uint32_t i, off;
dir->tdir_tag = tag;
dir->tdir_type = (short) TIFF_SHORT;
/* XXX -- yech, fool TIFFWriteData */
- dir->tdir_count = (uint32) (1L<<tif->tif_dir.td_bitspersample);
+ dir->tdir_count = (uint32_t) (1L<<tif->tif_dir.td_bitspersample);
off = tif->tif_dataoff;
for (i = 0; i < n; i++)
if (!TIFFWriteData(tif, dir, (char *)table[i]))
@@ -610,14 +610,14 @@ TIFFWriteByteArray(TIFF* tif, TIFFDirEntry* dir, char* cp)
*/
static int
TIFFWriteShortArray(TIFF* tif,
- TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, uint16* v)
+ TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32_t n, uint16_t* v)
{
dir->tdir_tag = tag;
dir->tdir_type = (short) type;
dir->tdir_count = n;
if (n <= 2) {
if (tif->tif_header.tiff_magic == TIFF_BIGENDIAN) {
- dir->tdir_offset = (uint32) ((long) v[0] << 16);
+ dir->tdir_offset = (uint32_t) ((long) v[0] << 16);
if (n == 2)
dir->tdir_offset |= v[1] & 0xffff;
} else {
@@ -636,7 +636,7 @@ TIFFWriteShortArray(TIFF* tif,
*/
static int
TIFFWriteLongArray(TIFF* tif,
- TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, uint32* v)
+ TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32_t n, uint32_t* v)
{
dir->tdir_tag = tag;
dir->tdir_type = (short) type;
@@ -654,20 +654,20 @@ TIFFWriteLongArray(TIFF* tif,
*/
static int
TIFFWriteRationalArray(TIFF* tif,
- TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, float* v)
+ TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32_t n, float* v)
{
- uint32 i;
- uint32* t;
+ uint32_t i;
+ uint32_t* t;
int status;
dir->tdir_tag = tag;
dir->tdir_type = (short) type;
dir->tdir_count = n;
- t = (uint32*) _TIFFmalloc(2*n * sizeof (uint32));
+ t = (uint32_t*) _TIFFmalloc(2*n * sizeof (uint32_t));
for (i = 0; i < n; i++) {
float fv = v[i];
int sign = 1;
- uint32 den;
+ uint32_t den;
if (fv < 0) {
if (type == TIFF_RATIONAL) {
@@ -693,14 +693,14 @@ TIFFWriteRationalArray(TIFF* tif,
static int
TIFFWriteFloatArray(TIFF* tif,
- TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, float* v)
+ TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32_t n, float* v)
{
dir->tdir_tag = tag;
dir->tdir_type = (short) type;
dir->tdir_count = n;
TIFFCvtNativeToIEEEFloat(tif, n, v);
if (n == 1) {
- dir->tdir_offset = *(uint32*) &v[0];
+ dir->tdir_offset = *(uint32_t*) &v[0];
return (1);
} else
return (TIFFWriteData(tif, dir, (char*) v));
@@ -708,7 +708,7 @@ TIFFWriteFloatArray(TIFF* tif,
static int
TIFFWriteDoubleArray(TIFF* tif,
- TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, double* v)
+ TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32_t n, double* v)
{
dir->tdir_tag = tag;
dir->tdir_type = (short) type;
@@ -728,7 +728,7 @@ TIFFWriteDoubleArray(TIFF* tif,
*/
static int
TIFFWriteAnyArray(TIFF* tif,
- TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, double* v)
+ TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32_t n, double* v)
{
char buf[10 * sizeof(double)];
char* w = buf;
@@ -760,34 +760,34 @@ TIFFWriteAnyArray(TIFF* tif,
}
break;
case TIFF_SHORT:
- { uint16* bp = (uint16*) w;
+ { uint16_t* bp = (uint16_t*) w;
for (i = 0; i < n; i++)
- bp[i] = (uint16) v[i];
- if (!TIFFWriteShortArray(tif, type, tag, dir, n, (uint16*)bp))
+ bp[i] = (uint16_t) v[i];
+ if (!TIFFWriteShortArray(tif, type, tag, dir, n, (uint16_t*)bp))
goto out;
}
break;
case TIFF_SSHORT:
- { int16* bp = (int16*) w;
+ { int16_t* bp = (int16_t*) w;
for (i = 0; i < n; i++)
- bp[i] = (int16) v[i];
- if (!TIFFWriteShortArray(tif, type, tag, dir, n, (uint16*)bp))
+ bp[i] = (int16_t) v[i];
+ if (!TIFFWriteShortArray(tif, type, tag, dir, n, (uint16_t*)bp))
goto out;
}
break;
case TIFF_LONG:
- { uint32* bp = (uint32*) w;
+ { uint32_t* bp = (uint32_t*) w;
for (i = 0; i < n; i++)
- bp[i] = (uint32) v[i];
+ bp[i] = (uint32_t) v[i];
if (!TIFFWriteLongArray(tif, type, tag, dir, n, bp))
goto out;
}
break;
case TIFF_SLONG:
- { int32* bp = (int32*) w;
+ { int32_t* bp = (int32_t*) w;
for (i = 0; i < n; i++)
- bp[i] = (int32) v[i];
- if (!TIFFWriteLongArray(tif, type, tag, dir, n, (uint32*) bp))
+ bp[i] = (int32_t) v[i];
+ if (!TIFFWriteLongArray(tif, type, tag, dir, n, (uint32_t*) bp))
goto out;
}
break;
@@ -821,8 +821,8 @@ static int
TIFFWriteTransferFunction(TIFF* tif, TIFFDirEntry* dir)
{
TIFFDirectory* td = &tif->tif_dir;
- tsize_t n = (1L<<td->td_bitspersample) * sizeof (uint16);
- uint16** tf = td->td_transferfunction;
+ tsize_t n = (1L<<td->td_bitspersample) * sizeof (uint16_t);
+ uint16_t** tf = td->td_transferfunction;
int ncols;
/*
@@ -853,16 +853,16 @@ TIFFWriteData(TIFF* tif, TIFFDirEntry* dir, char* cp)
switch (dir->tdir_type) {
case TIFF_SHORT:
case TIFF_SSHORT:
- TIFFSwabArrayOfShort((uint16*) cp, dir->tdir_count);
+ TIFFSwabArrayOfShort((uint16_t*) cp, dir->tdir_count);
break;
case TIFF_LONG:
case TIFF_SLONG:
case TIFF_FLOAT:
- TIFFSwabArrayOfLong((uint32*) cp, dir->tdir_count);
+ TIFFSwabArrayOfLong((uint32_t*) cp, dir->tdir_count);
break;
case TIFF_RATIONAL:
case TIFF_SRATIONAL:
- TIFFSwabArrayOfLong((uint32*) cp, 2*dir->tdir_count);
+ TIFFSwabArrayOfLong((uint32_t*) cp, 2*dir->tdir_count);
break;
case TIFF_DOUBLE:
TIFFSwabArrayOfDouble((double*) cp, dir->tdir_count);
@@ -889,11 +889,11 @@ static int
TIFFLinkDirectory(TIFF* tif)
{
static const char module[] = "TIFFLinkDirectory";
- uint32 nextdir;
- uint32 diroff;
+ uint32_t nextdir;
+ uint32_t diroff;
tif->tif_diroff = (TIFFSeekFile(tif, (toff_t) 0, SEEK_END)+1) &~ 1;
- diroff = (uint32) tif->tif_diroff;
+ diroff = (uint32_t) tif->tif_diroff;
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong(&diroff);
#if SUBIFD_SUPPORT
@@ -921,7 +921,7 @@ TIFFLinkDirectory(TIFF* tif)
/*
* First directory, overwrite offset in header.
*/
- tif->tif_header.tiff_diroff = (uint32) tif->tif_diroff;
+ tif->tif_header.tiff_diroff = (uint32_t) tif->tif_diroff;
#define HDROFF(f) ((toff_t) &(((TIFFHeader*) 0)->f))
(void) TIFFSeekFile(tif, HDROFF(tiff_diroff), SEEK_SET);
if (!WriteOK(tif, &diroff, sizeof (diroff))) {
@@ -935,7 +935,7 @@ TIFFLinkDirectory(TIFF* tif)
*/
nextdir = tif->tif_header.tiff_diroff;
do {
- uint16 dircount;
+ uint16_t dircount;
if (!SeekOK(tif, nextdir) ||
!ReadOK(tif, &dircount, sizeof (dircount))) {
diff --git a/tiff/contrib/ras/Makefile.am b/tiff/contrib/ras/Makefile.am
index 26617edf..92e124bf 100644
--- a/tiff/contrib/ras/Makefile.am
+++ b/tiff/contrib/ras/Makefile.am
@@ -24,7 +24,6 @@
# Process this file with automake to produce Makefile.in.
EXTRA_DIST = \
- CMakeLists.txt \
README \
ras2tif.c \
tif2ras.c
diff --git a/tiff/contrib/ras/Makefile.in b/tiff/contrib/ras/Makefile.in
index dac37b63..f891cb05 100644
--- a/tiff/contrib/ras/Makefile.in
+++ b/tiff/contrib/ras/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,8 +122,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -287,6 +289,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -297,7 +300,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
- CMakeLists.txt \
README \
ras2tif.c \
tif2ras.c
diff --git a/tiff/contrib/stream/CMakeLists.txt b/tiff/contrib/stream/CMakeLists.txt
deleted file mode 100644
index c874ff64..00000000
--- a/tiff/contrib/stream/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-# CMake build for libtiff
-#
-# Copyright © 2015 Open Microscopy Environment / University of Dundee
-# Written by Roger Leigh <rleigh@codelibre.net>
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee, provided
-# that (i) the above copyright notices and this permission notice appear in
-# all copies of the software and related documentation, and (ii) the names of
-# Sam Leffler and Silicon Graphics may not be used in any advertising or
-# publicity relating to the software without the specific, prior written
-# permission of Sam Leffler and Silicon Graphics.
-#
-# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-#
-# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-
-extra_dist(
- README
- tiffstream.cpp
- tiffstream.h)
diff --git a/tiff/contrib/stream/Makefile.am b/tiff/contrib/stream/Makefile.am
index 0324e865..cd882b32 100644
--- a/tiff/contrib/stream/Makefile.am
+++ b/tiff/contrib/stream/Makefile.am
@@ -24,7 +24,6 @@
# Process this file with automake to produce Makefile.in.
EXTRA_DIST = \
- CMakeLists.txt \
README \
tiffstream.cpp \
tiffstream.h
diff --git a/tiff/contrib/stream/Makefile.in b/tiff/contrib/stream/Makefile.in
index 5f7f1eba..b8bfc6aa 100644
--- a/tiff/contrib/stream/Makefile.in
+++ b/tiff/contrib/stream/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,8 +122,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -287,6 +289,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -297,7 +300,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
- CMakeLists.txt \
README \
tiffstream.cpp \
tiffstream.h
diff --git a/tiff/contrib/tags/Makefile.am b/tiff/contrib/tags/Makefile.am
index 67d99679..0bdec678 100644
--- a/tiff/contrib/tags/Makefile.am
+++ b/tiff/contrib/tags/Makefile.am
@@ -24,7 +24,6 @@
# Process this file with automake to produce Makefile.in.
EXTRA_DIST = \
- CMakeLists.txt \
README \
listtif.c \
maketif.c \
diff --git a/tiff/contrib/tags/Makefile.in b/tiff/contrib/tags/Makefile.in
index 502d8f05..7448a154 100644
--- a/tiff/contrib/tags/Makefile.in
+++ b/tiff/contrib/tags/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,8 +122,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -287,6 +289,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -297,7 +300,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
- CMakeLists.txt \
README \
listtif.c \
maketif.c \
diff --git a/tiff/contrib/tags/README b/tiff/contrib/tags/README
index 3220b7b1..d58a5641 100644
--- a/tiff/contrib/tags/README
+++ b/tiff/contrib/tags/README
@@ -56,7 +56,7 @@ so that multiple clients may be installed.
The TIFFExtendProc method that you define should be used to override
the TIFF file's "vsetfield" and "vgetfield" methods, so that you
can trap your new, private tags, and install their values into
-a private directory structure. For your convienience, a new pointer
+a private directory structure. For your convenience, a new pointer
has also been added to the "TIFF" file structure:
tidata_t tif_clientdir; /* client TIFF directory */
diff --git a/tiff/contrib/tags/maketif.c b/tiff/contrib/tags/maketif.c
index e965201a..41ca8859 100644
--- a/tiff/contrib/tags/maketif.c
+++ b/tiff/contrib/tags/maketif.c
@@ -36,7 +36,7 @@ failure:
void SetUpTIFFDirectory(TIFF *tif)
{
double mymulti[6]={0.0,1.0,2.0, 3.1415926, 5.0,1.0};
- uint32 mysingle=3456;
+ uint32_t mysingle=3456;
char *ascii="This file was produced by Steven Spielberg. NOT";
TIFFSetField(tif,TIFFTAG_IMAGEWIDTH,WIDTH);
diff --git a/tiff/contrib/tags/xtif_dir.c b/tiff/contrib/tags/xtif_dir.c
index 35295526..628bc415 100644
--- a/tiff/contrib/tags/xtif_dir.c
+++ b/tiff/contrib/tags/xtif_dir.c
@@ -91,7 +91,7 @@ _XTIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
xtiff *xt = XTIFFDIR(tif);
XTIFFDirectory* xd = &xt->xtif_dir;
int status = 1;
- uint32 v32=0;
+ uint32_t v32=0;
int i=0, v=0;
va_list ap1 = ap;
@@ -104,12 +104,12 @@ _XTIFFVSetField(TIFF* tif, ttag_t tag, va_list ap)
*/
case TIFFTAG_EXAMPLE_MULTI:
/* multi-valued tags need to store the count as well */
- xd->xd_num_multi = (uint16) va_arg(ap, int);
+ xd->xd_num_multi = (uint16_t) va_arg(ap, int);
_TIFFsetDoubleArray(&xd->xd_example_multi, va_arg(ap, double*),
(long) xd->xd_num_multi);
break;
case TIFFTAG_EXAMPLE_SINGLE:
- xd->xd_example_single = va_arg(ap, uint32);
+ xd->xd_example_single = va_arg(ap, uint32_t);
break;
case TIFFTAG_EXAMPLE_ASCII:
_TIFFsetString(&xd->xd_example_ascii, va_arg(ap, char*));
@@ -162,14 +162,14 @@ _XTIFFVGetField(TIFF* tif, ttag_t tag, va_list ap)
* example tags with your own.
*/
case TIFFTAG_EXAMPLE_MULTI:
- *va_arg(ap, uint16*) = xd->xd_num_multi;
+ *va_arg(ap, uint16_t*) = xd->xd_num_multi;
*va_arg(ap, double**) = xd->xd_example_multi;
break;
case TIFFTAG_EXAMPLE_ASCII:
*va_arg(ap, char**) = xd->xd_example_ascii;
break;
case TIFFTAG_EXAMPLE_SINGLE:
- *va_arg(ap, uint32*) = xd->xd_example_single;
+ *va_arg(ap, uint32_t*) = xd->xd_example_single;
break;
default:
/* return inherited method */
diff --git a/tiff/contrib/tags/xtiffiop.h b/tiff/contrib/tags/xtiffiop.h
index 9d534a83..5220e20d 100644
--- a/tiff/contrib/tags/xtiffiop.h
+++ b/tiff/contrib/tags/xtiffiop.h
@@ -32,9 +32,9 @@
/* XXX - Define Private directory tag structure here */
struct XTIFFDirectory {
- uint16 xd_num_multi; /* dir-count for the multi tag */
+ uint16_t xd_num_multi; /* dir-count for the multi tag */
double* xd_example_multi;
- uint32 xd_example_single;
+ uint32_t xd_example_single;
char* xd_example_ascii;
};
typedef struct XTIFFDirectory XTIFFDirectory;
@@ -45,7 +45,7 @@ typedef struct XTIFFDirectory XTIFFDirectory;
struct xtiff {
TIFF *xtif_tif; /* parent TIFF pointer */
- uint32 xtif_flags;
+ uint32_t xtif_flags;
#define XTIFFP_PRINT 0x00000001
XTIFFDirectory xtif_dir; /* internal rep of current directory */
TIFFVSetMethod xtif_vsetfield; /* inherited tag set routine */
diff --git a/tiff/contrib/win_dib/CMakeLists.txt b/tiff/contrib/win_dib/CMakeLists.txt
deleted file mode 100644
index 11d124f5..00000000
--- a/tiff/contrib/win_dib/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# CMake build for libtiff
-#
-# Copyright © 2015 Open Microscopy Environment / University of Dundee
-# Written by Roger Leigh <rleigh@codelibre.net>
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee, provided
-# that (i) the above copyright notices and this permission notice appear in
-# all copies of the software and related documentation, and (ii) the names of
-# Sam Leffler and Silicon Graphics may not be used in any advertising or
-# publicity relating to the software without the specific, prior written
-# permission of Sam Leffler and Silicon Graphics.
-#
-# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-#
-# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-
-extra_dist(
- Makefile.w95
- README.Tiffile
- README.tiff2dib
- Tiffile.cpp
- tiff2dib.c)
diff --git a/tiff/contrib/win_dib/Makefile.am b/tiff/contrib/win_dib/Makefile.am
index 50a1dab0..53ededb1 100644
--- a/tiff/contrib/win_dib/Makefile.am
+++ b/tiff/contrib/win_dib/Makefile.am
@@ -24,7 +24,6 @@
# Process this file with automake to produce Makefile.in.
EXTRA_DIST = \
- CMakeLists.txt \
Makefile.w95 \
README.Tiffile \
README.tiff2dib \
diff --git a/tiff/contrib/win_dib/Makefile.in b/tiff/contrib/win_dib/Makefile.in
index fa3b2237..d9f40b8e 100644
--- a/tiff/contrib/win_dib/Makefile.in
+++ b/tiff/contrib/win_dib/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,8 +122,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -287,6 +289,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -297,7 +300,6 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
- CMakeLists.txt \
Makefile.w95 \
README.Tiffile \
README.tiff2dib \
diff --git a/tiff/contrib/win_dib/README.Tiffile b/tiff/contrib/win_dib/README.Tiffile
index 82c6e5c4..8645f05c 100644
--- a/tiff/contrib/win_dib/README.Tiffile
+++ b/tiff/contrib/win_dib/README.Tiffile
@@ -2,7 +2,7 @@ Frank,
I attached a file that uses RGBA interface (tif_getimage.c) to read a tiff
file and convert to a DIB. It's advantage is that it is easy to read *any*
-tiff file suported by libtiff and easily convert it to a DIB. The disadvantage
+tiff file supported by libtiff and easily convert it to a DIB. The disadvantage
is that bilevel (B&W) bitmaps (and all other non-rgba images) are also
converted to RGBA, thus taking up 32x as much memory as needed (4 bytes per
pixel, rather than 1 bit). I read tiff files, but don't need to
diff --git a/tiff/contrib/win_dib/README.tiff2dib b/tiff/contrib/win_dib/README.tiff2dib
index ff70ca1a..75e1254b 100644
--- a/tiff/contrib/win_dib/README.tiff2dib
+++ b/tiff/contrib/win_dib/README.tiff2dib
@@ -14,7 +14,7 @@ Here is some information that may help someone.
I build the library under Windows 95 as a 32-bit library.
The contribution of Scott Wagner (tif_win32.c) worked fine, but
-the makefile "makefile.msc" was unsable because it was
+the makefile "makefile.msc" was unusable because it was
written for DOS or Windows 3.1 and all the files names
are limited to 8 characters.
@@ -38,7 +38,7 @@ I had to :
I also join the source file "tif2dib.c" that I created,
it contain the function LoadTIFFinDIB that load
a TIFF file and build a memory DIB with it and return the
-HANDLE (HDIB) of the memory bloc containing this DIB.
+HANDLE (HDIB) of the memory block containing this DIB.
Since DIB is the "natural" bitmap format for Windows 3.1, 95 and NT,
this function should be useful for some Windows 95 (or NT) developer.
diff --git a/tiff/contrib/win_dib/Tiffile.cpp b/tiff/contrib/win_dib/Tiffile.cpp
index 2f7965d6..27e29b5f 100644
--- a/tiff/contrib/win_dib/Tiffile.cpp
+++ b/tiff/contrib/win_dib/Tiffile.cpp
@@ -40,7 +40,7 @@ struct TIFFDibImage {
HANDLE LoadTIFFinDIB(LPCTSTR lpFileName);
-HANDLE TIFFRGBA2DIB(TIFFDibImage* dib, uint32* raster) ;
+HANDLE TIFFRGBA2DIB(TIFFDibImage* dib, uint32_t* raster) ;
static void
MyWarningHandler(const char* module, const char* fmt, va_list ap)
@@ -99,12 +99,12 @@ PVOID ReadTIFF ( LPCTSTR lpszPath )
if (TIFFRGBAImageBegin(&img.tif, tif, -1, emsg)) {
size_t npixels;
- uint32* raster;
+ uint32_t* raster;
DibInstallHack(&img);
npixels = img.tif.width * img.tif.height;
- raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));
+ raster = (uint32_t*) _TIFFmalloc(npixels * sizeof (uint32_t));
if (raster != NULL) {
if (TIFFRGBAImageGet(&img.tif, raster, img.tif.width, img.tif.height)) {
pDIB = TIFFRGBA2DIB(&img, raster);
@@ -128,17 +128,17 @@ PVOID ReadTIFF ( LPCTSTR lpszPath )
-HANDLE TIFFRGBA2DIB(TIFFDibImage* dib, uint32* raster)
+HANDLE TIFFRGBA2DIB(TIFFDibImage* dib, uint32_t* raster)
{
void* pDIB = 0;
TIFFRGBAImage* img = &dib->tif;
- uint32 imageLength;
- uint32 imageWidth;
- uint16 BitsPerSample;
- uint16 SamplePerPixel;
- uint32 RowsPerStrip;
- uint16 PhotometricInterpretation;
+ uint32_t imageLength;
+ uint32_t imageWidth;
+ uint16_t BitsPerSample;
+ uint16_t SamplePerPixel;
+ uint32_t RowsPerStrip;
+ uint16_t PhotometricInterpretation;
BITMAPINFOHEADER bi;
int dwDIBSize ;
@@ -273,25 +273,25 @@ typedef unsigned char u_char;
#define DECLAREContigPutFunc(name) \
static void name(\
TIFFRGBAImage* img, \
- uint32* cp, \
- uint32 x, uint32 y, \
- uint32 w, uint32 h, \
- int32 fromskew, int32 toskew, \
+ uint32_t* cp, \
+ uint32_t x, uint32_t y, \
+ uint32_t w, uint32_t h, \
+ int32_t fromskew, int32_t toskew, \
u_char* pp \
)
#define DECLARESepPutFunc(name) \
static void name(\
TIFFRGBAImage* img,\
- uint32* cp,\
- uint32 x, uint32 y, \
- uint32 w, uint32 h,\
- int32 fromskew, int32 toskew,\
+ uint32_t* cp,\
+ uint32_t x, uint32_t y, \
+ uint32_t w, uint32_t h,\
+ int32_t fromskew, int32_t toskew,\
u_char* r, u_char* g, u_char* b, u_char* a\
)
DECLAREContigPutFunc(putContig1bitTile);
-static int getStripContig1Bit(TIFFRGBAImage* img, uint32* uraster, uint32 w, uint32 h);
+static int getStripContig1Bit(TIFFRGBAImage* img, uint32_t* uraster, uint32_t w, uint32_t h);
//typdef struct TIFFDibImage {
// TIFFRGBAImage tif;
@@ -329,7 +329,7 @@ DECLAREContigPutFunc(putContig1bitTile)
int wb = WIDTHBYTES(w);
u_char* ucp = (u_char*)cp;
- /* Conver 'w' to bytes from pixels (rounded up) */
+ /* Convert 'w' to bytes from pixels (rounded up) */
w = (w+7)/8;
while (h-- > 0) {
@@ -348,11 +348,11 @@ DECLAREContigPutFunc(putContig1bitTile)
/*
* Hacked from the tif_getimage.c file.
*/
-static uint32
-setorientation(TIFFRGBAImage* img, uint32 h)
+static uint32_t
+setorientation(TIFFRGBAImage* img, uint32_t h)
{
TIFF* tif = img->tif;
- uint32 y;
+ uint32_t y;
switch (img->orientation) {
case ORIENTATION_BOTRIGHT:
@@ -390,22 +390,22 @@ setorientation(TIFFRGBAImage* img, uint32 h)
* for 1-bit bitmaps
*/
static int
-getStripContig1Bit(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+getStripContig1Bit(TIFFRGBAImage* img, uint32_t* raster, uint32_t w, uint32_t h)
{
TIFF* tif = img->tif;
tileContigRoutine put = img->put.contig;
- uint16 orientation;
- uint32 row, y, nrow, rowstoread;
- uint32 pos;
+ uint16_t orientation;
+ uint32_t row, y, nrow, rowstoread;
+ uint32_t pos;
u_char* buf;
- uint32 rowsperstrip;
- uint32 imagewidth = img->width;
+ uint32_t rowsperstrip;
+ uint32_t imagewidth = img->width;
tsize_t scanline;
- int32 fromskew, toskew;
+ int32_t fromskew, toskew;
tstrip_t strip;
tsize_t stripsize;
u_char* braster = (u_char*)raster; // byte wide raster
- uint32 wb = WIDTHBYTES(w);
+ uint32_t wb = WIDTHBYTES(w);
int ret = 1;
buf = (u_char*) _TIFFmalloc(TIFFStripSize(tif));
@@ -415,7 +415,7 @@ getStripContig1Bit(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
}
y = setorientation(img, h);
orientation = img->orientation;
- toskew = -(int32) (orientation == ORIENTATION_TOPLEFT ? wb+wb : wb-wb);
+ toskew = -(int32_t) (orientation == ORIENTATION_TOPLEFT ? wb+wb : wb-wb);
TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
scanline = TIFFScanlineSize(tif);
fromskew = (w < imagewidth ? imagewidth - w : 0)/8;
@@ -433,8 +433,8 @@ getStripContig1Bit(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
}
pos = ((row + img->row_offset) % rowsperstrip) * scanline;
- (*put)(img, (uint32*)(braster+y*wb), 0, y, w, nrow, fromskew, toskew, buf + pos);
- y += (orientation == ORIENTATION_TOPLEFT ?-(int32) nrow : (int32) nrow);
+ (*put)(img, (uint32_t*)(braster+y*wb), 0, y, w, nrow, fromskew, toskew, buf + pos);
+ y += (orientation == ORIENTATION_TOPLEFT ?-(int32_t) nrow : (int32_t) nrow);
}
_TIFFfree(buf);
return (ret);
diff --git a/tiff/contrib/win_dib/tiff2dib.c b/tiff/contrib/win_dib/tiff2dib.c
index 2fa2de69..5b9e1747 100644
--- a/tiff/contrib/win_dib/tiff2dib.c
+++ b/tiff/contrib/win_dib/tiff2dib.c
@@ -4,7 +4,7 @@
*
* The function LoadTIFFinDIB in this source file let you load
* a TIFF file and build a memory DIB with it and return the
- * HANDLE (HDIB) of the memory bloc containing the DIB.
+ * HANDLE (HDIB) of the memory block containing the DIB.
*
* Example :
*
@@ -30,7 +30,7 @@ static HDIB CreateDIB(DWORD dwWidth, DWORD dwHeight, WORD wBitCount);
static LPSTR FindDIBBits(LPSTR lpDIB);
static WORD PaletteSize(LPSTR lpDIB);
static WORD DIBNumColors(LPSTR lpDIB);
-static int checkcmap(int n, uint16* r, uint16* g, uint16* b);
+static int checkcmap(int n, uint16_t* r, uint16_t* g, uint16_t* b);
@@ -49,7 +49,7 @@ static int checkcmap(int n, uint16* r, uint16* g, uint16* b);
* Description:
*
* This function load a TIFF file and build a memory DIB with it
- * and return the HANDLE (HDIB) of the memory bloc containing
+ * and return the HANDLE (HDIB) of the memory block containing
* the DIB.
*
* 4/12/95 Philippe Tenenhaus 100423.3705@compuserve.com
@@ -127,10 +127,10 @@ HDIB LoadTIFFinDIB(LPSTR lpFileName)
//PhotometricInterpretation = 3 image have a color palette
if (PhotometricInterpretation == 3)
{
- uint16* red;
- uint16* green;
- uint16* blue;
- int16 i;
+ uint16_t* red;
+ uint16_t* green;
+ uint16_t* blue;
+ int16_t i;
LPBITMAPINFO lpbmi;
int Palette16Bits;
@@ -220,7 +220,7 @@ imageWidth*SamplePerPixel);
}
-static int checkcmap(int n, uint16* r, uint16* g, uint16* b)
+static int checkcmap(int n, uint16_t* r, uint16_t* g, uint16_t* b)
{
while (n-- > 0)
if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256)
diff --git a/tiff/html/CMakeLists.txt b/tiff/html/CMakeLists.txt
index 5f34e1e5..b3317d32 100644
--- a/tiff/html/CMakeLists.txt
+++ b/tiff/html/CMakeLists.txt
@@ -83,5 +83,3 @@ install(FILES ${docfiles}
add_subdirectory(images)
add_subdirectory(man)
-
-extra_dist(${docfiles})
diff --git a/tiff/html/Makefile.am b/tiff/html/Makefile.am
index 2929b8ed..2b41f03c 100644
--- a/tiff/html/Makefile.am
+++ b/tiff/html/Makefile.am
@@ -89,7 +89,8 @@ docfiles = \
v4.0.9.html \
v4.0.10.html \
v4.1.0.html \
- v4.2.0.html
+ v4.2.0.html \
+ v4.3.0.html
dist_doc_DATA = $(docfiles)
diff --git a/tiff/html/Makefile.in b/tiff/html/Makefile.in
index b60e5cfa..b80fdc5b 100644
--- a/tiff/html/Makefile.in
+++ b/tiff/html/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -125,8 +125,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -379,6 +381,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -451,7 +454,8 @@ docfiles = \
v4.0.9.html \
v4.0.10.html \
v4.1.0.html \
- v4.2.0.html
+ v4.2.0.html \
+ v4.3.0.html
dist_doc_DATA = $(docfiles)
SUBDIRS = images man
diff --git a/tiff/html/addingtags.html b/tiff/html/addingtags.html
index bd4b972a..7e197e25 100644
--- a/tiff/html/addingtags.html
+++ b/tiff/html/addingtags.html
@@ -239,7 +239,7 @@ add appropriate handling as follows:
<P>
If you want to maintain portability, beware of making assumptions
-about data types. Use the typedefs (<TT>uint16</TT>, etc. when dealing with
+about data types. Use the typedefs (<TT>uint16_t</TT>, etc. when dealing with
data on disk and <TT>t*_t</TT> when stuff is in memory) and be careful about
passing items through printf or similar vararg interfaces.
diff --git a/tiff/html/build.html b/tiff/html/build.html
index 4186645b..72a43f22 100644
--- a/tiff/html/build.html
+++ b/tiff/html/build.html
@@ -14,8 +14,6 @@ Building the Software Distribution</h1>
<ul>
<li><a href="#CMAKE">Building on all systems with CMake</a>.</li>
<li><a href="#UNIX">Building on a UNIX system with Autoconf</a>.</li>
-<li><a href="#PC">Building on an MS-DOS or Windows system with nmake</a>.</li>
-<li><a href="#VMS">Building on a VMS system</a>.</li>
<li><a href="#Other">Building the Software on Other
Systems.</a></li>
</ul>
@@ -424,179 +422,6 @@ configured.</dd>
</dl>
<hr width="65%" align="right">
<a name="PC" id="PC"></a>
-<h2>Building the Software under Windows 2000/XP/7/8/10 with nmake</h2>
-With Microsoft Visual C++ installed, and properly configured for
-commandline use (you will likely need to source VCVARS32.BAT in
-AUTOEXEC.bAT or somewhere similar) you should be able to use the
-provided <tt>makefile.vc</tt>.
-<p>The source package is delivered using Unix line termination
-conventions, which work with MSVC but do not work with Windows
-'notepad'. If you use unzip from the <a href=
-"http://www.info-zip.org/pub/infozip/">Info-Zip</a> package, you
-can extract the files using Windows normal line termination
-conventions with a command similar to:</p>
-<pre>
- unzip -aa -a tiff-4.0.5.zip
-</pre>
-<p>By default the nmake-based libtiff build does not depend on any
-additional libraries. Normally libtiff should be built with at least
-JPEG and ZIP support so that it can open JPEG and ZIP-compressed TIFF
-files. In order to add additional libraries (e.g. libjpeg, zlib,
-jbigkit), build those libraries according to their own particular
-build instructions, and then edit 'nmake.opt' (using a capable
-plain-text editor) to enable use of the libraries, including
-specifying where the libraries are installed. It is also necessary to
-edit libtiff/tiffconf.vc.h to enable the related configuration defines
-(<em>JPEG_SUPPORT</em>, <em>OJPEG_SUPPORT</em>, <em>PIXARLOG_SUPPORT</em>,
-<em>ZIP_SUPPORT</em>), or to disable features which are normally
-included by default. Ignore the comment at the top of the
-libtiff/tiffconf.vc.h file which says that it has no influence on the
-build, because the statement is not true for Windows. Please note that
-the nmake build copies tiffconf.vc.h to tiffconf.h, and copies
-tif_config.vc.h to tif_config.h, overwriting any files which may be
-present. Likewise, the 'nmake clean' step removes those files.</p>
-<p>To build using the provided makefile.vc you may use:</p>
-<pre>
- C:\tiff-4.0.5&gt; nmake /f makefile.vc clean
- C:\tiff-4.0.5&gt; nmake /f makefile.vc
-
- or (the hard way)
-
- C:\tiff-4.0.5&gt; cd port
- C:\tiff-4.0.5\port&gt; nmake /f makefile.vc clean
- C:\tiff-4.0.5\port&gt; nmake /f makefile.vc
- C:\tiff-4.0.5&gt; cd ../libtiff
- C:\tiff-4.0.5\libtiff&gt; nmake /f makefile.vc clean
- C:\tiff-4.0.5\libtiff&gt; nmake /f makefile.vc
- C:\tiff-4.0.5\libtiff&gt; cd ..\tools
- C:\tiff-4.0.5\tools&gt; nmake /f makefile.vc clean
- C:\tiff-4.0.5\tools&gt; nmake /f makefile.vc
-</pre>
-<p>This will build the library
-file <tt>libtiff\libtiff\libtiff.lib</tt>.</p>
-<p>The makefile also builds a DLL (libtiff.dll) with an associated
-import library (libtiff_i.lib). Any builds using libtiff will need to
-include the LIBTIFF\LIBTIFF directory in the include path.</p>
-<p>The <tt>libtiff\tools\makefile.vc</tt> should build .exe's for
-all the standard TIFF tool programs.</p>
-<hr>
-<a name="VMS" id="VMS"></a>
-<h2>Building the Software on a VMS System</h2>
-The VMS port was done by Karsten Spang (<a href=
-"mailto:krs@kampsax.dk">krs@kampsax.dk</a>), who also "sort of"
-maintains it. The VMS specific files are not in the main
-directories. Instead they are placed under
-<tt>[.CONTRIB.VMS...]</tt> in the distribution tree. Installation:
-It is assumed that you have unpacked the tar file into a VMS
-directory tree, in this text called DISK:[TIFF].
-<ol>
-<li>Move the VMS specific files to their proper directories.
-<pre>
-$ SET DEFAULT DISK:[TIFF.CONTRIB.VMS]
-$ RENAME [.LIBTIFF]*.* [-.-.LIBTIFF]
-$ RENAME [.TOOLS]*.* [-.-.TOOLS]
-</pre></li>
-<li>Compile the library.
-<pre>
-$ SET DEFAULT DISK:[TIFF.LIBTIFF]
-$ @MAKEVMS
-</pre></li>
-<li>Compile the tools.
-<pre>
-$ SET DEFAULT DISK:[TIFF.TOOLS]
-$ @MAKEVMS
-</pre></li>
-<li>Define the programs.
-<pre>
-$ DEFINE TIFFSHR DISK:[TIFF.LIBTIFF]TIFFSHR
-$ FAX2PS :==$DISK:[TIFF.TOOLS]FAX2PS
-$ FAX2TIFF :==$DISK:[TIFF.TOOLS]FAX2TIFF
-$ GIF2TIFF :==$DISK:[TIFF.TOOLS]GIF2TIFF
-$ PAL2RGB :==$DISK:[TIFF.TOOLS]PAL2RGB
-$ PPM2TIFF :==$DISK:[TIFF.TOOLS]PPM2TIFF
-$ RAS2TIFF :==$DISK:[TIFF.TOOLS]RAS2TIFF
-$ RGB2YCBCR :==$DISK:[TIFF.TOOLS]RGB2YCBCR
-$ THUMBNAIL :==$DISK:[TIFF.TOOLS]THUMBNAIL
-$ TIFF2BW :==$DISK:[TIFF.TOOLS]TIFF2BW
-$ TIFF2PS :==$DISK:[TIFF.TOOLS]TIFF2PS
-$ TIFFCMP :==$DISK:[TIFF.TOOLS]TIFFCMP
-$ TIFFCP :==$DISK:[TIFF.TOOLS]TIFFCP
-$ TIFFDITHER:==$DISK:[TIFF.TOOLS]TIFFDITHER
-$ TIFFDUMP :==$DISK:[TIFF.TOOLS]TIFFDUMP
-$ TIFFINFO :==$DISK:[TIFF.TOOLS]TIFFINFO
-$ TIFFMEDIAN:==$DISK:[TIFF.TOOLS]TIFFMEDIAN
-$ TIFFSPLIT :==$DISK:[TIFF.TOOLS]TIFFSPLIT
-$ YCBCR :==$DISK:[TIFF.TOOLS]YCBCR
-</pre></li>
-</ol>
-You will want to add these lines to your <tt>LOGIN.COM</tt> file,
-after changing the name of the directory that you have used on your
-machine.
-<p>This release has been tested on OpenVMS/VAX 5.5-2, using VAX C
-3.2. A previous release was tested under OpenVMS/AXP ?.? using DEC
-C ?.?, it is believed that this release as well works on AXP. The
-code contains some GNU C specific things. This does *not* imply,
-however, that the VAX/GCC configuration has been tested, *it has
-not*.</p>
-<p>The command procedures (<tt>MAKEVMS.COM</tt>) for building the
-library and tools, is believed to choose the correct options for
-the VAX and AXP cases automatically.</p>
-<p>On the AXP, IEEE floating point is used by default. If you want
-VAX floating point, remove the <tt>/FLOAT=IEEE_FLOAT</tt>
-qualifier, and change <tt>HAVE_IEEEFP=1</tt> to
-<tt>HAVE_IEEEFP=0</tt> in the <tt>MAKEVMS.COM</tt> files in both
-the <b>libtiff</b> and <b>tools</b> directories.</p>
-<h3>Compiling your own program on a VMS system:</h3>
-When compiling a source file in which you <tt>"#include
-&lt;tiffio.h&gt;"</tt>, use the following command
-<pre>
- $ CC/INCLUDE=DISK:[TIFF.LIBTIFF]
-</pre>
-This ensures that the header file is found. On the AXP, also add
-<tt>/FLOAT=IEEE_FLOAT</tt> (if used when building the library).
-<h3>Linking your own program to the TIFF library on a VMS
-system:</h3>
-You can link to the library in two ways: Either using the shareable
-library, or using the object library. On the VAX these
-possibilities are:
-<ol>
-<li>Using the shareable TIFF library.
-<pre>
-$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS,SYS$INPUT:/OPTIONS
- SYS$SHARE:VAXCRTL/SHAREABLE
-</pre></li>
-<li>Using the TIFF object library.
-<pre>
-$ LINK MY_PROGRAM, -
- DISK:[TIFF.LIBTIFF]TIFF/LIBRARY/INCLUDE=(TIF_FAX3SM,TIF_CODEC), -
- SYS$INPUT:/OPTIONS
- SYS$SHARE:VAXCRTL/SHAREABLE
-</pre></li>
-</ol>
-On AXP (and possibly also using DEC C on VAX) the corresponding
-commands are
-<ol>
-<li>Using the shareable TIFF library.
-<pre>
-$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/OPTIONS
-</pre></li>
-<li>Using the TIFF object library.
-<pre>
-$ LINK MY_PROGRAM,DISK:[TIFF.LIBTIFF]TIFF/LIBRARY
-</pre></li>
-</ol>
-Method 1 uses the shortest link time and smallest <tt>.EXE</tt>
-files, but it requires that <tt>TIFFSHR</tt> is defined as above at
-link time and <strong>at run time</strong>. Using the compilation
-procedure above, the tools are linked in this way.
-<p>Method 2 gives somewhat longer link time and larger
-<tt>.EXE</tt> files, but does not require <tt>TIFFSHR</tt> to be
-defined. This method is recommended if you want to run your program
-on another machine, and for some reason don't want to have the
-library on that machine. If you plan to have more than one program
-(including the tools) on the machine, it is recommended that you
-copy the library to the other machine and use method 1.</p>
-<hr>
<a name="Other" id="Other"></a>
<h2>Building the Software on Other Systems</h2>
This section contains information that might be useful if you are
@@ -720,7 +545,6 @@ libtiff/tif_thunder.c Thunderscan codec (decoding only)
libtiff/tif_tile.c some tile-related code
libtiff/tif_unix.c UNIX-related OS support
libtiff/tif_version.c library version support
-libtiff/tif_vms.c VMS-related OS support
libtiff/tif_warning.c library warning handler
libtiff/tif_win3.c Windows-3.1-related OS support
libtiff/tif_win32.c Win32 (95/98/NT) related OS support
diff --git a/tiff/html/contrib.html b/tiff/html/contrib.html
index 9a670658..16d3d744 100644
--- a/tiff/html/contrib.html
+++ b/tiff/html/contrib.html
@@ -30,16 +30,6 @@ aren't directly TIFF related).
<TR>
<TD VALIGN=top>
-<B>contrib/vms</B>
-</TD>
-<TD>
-scripts and files from Karsten Spang for building
- the library and tools under VMS
-</TD>
-</TR>
-
-<TR>
-<TD VALIGN=top>
<B>contrib/dbs</B>
</TD>
<TD>
diff --git a/tiff/html/images/CMakeLists.txt b/tiff/html/images/CMakeLists.txt
index e25f9f62..8c810575 100644
--- a/tiff/html/images/CMakeLists.txt
+++ b/tiff/html/images/CMakeLists.txt
@@ -42,5 +42,3 @@ set(docfiles
install(FILES ${docfiles}
DESTINATION "${LIBTIFF_DOCDIR}/html/images")
-
-extra_dist(${docfiles})
diff --git a/tiff/html/images/Makefile.in b/tiff/html/images/Makefile.in
index 64f473d1..f9065cf5 100644
--- a/tiff/html/images/Makefile.in
+++ b/tiff/html/images/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -124,8 +124,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -318,6 +320,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/tiff/html/index.html b/tiff/html/index.html
index fd7b5f77..3173ca72 100644
--- a/tiff/html/index.html
+++ b/tiff/html/index.html
@@ -28,7 +28,7 @@
</tr>
<tr>
<th>Latest Stable Release</th>
- <td><a href="v4.2.0.html">v4.2.0</a></td>
+ <td><a href="v4.3.0.html">v4.3.0</a></td>
</tr>
<tr>
<th>Master Download Site</th>
@@ -114,7 +114,7 @@
</ul>
<hr>
<p>
- Last updated 2019-11-03
+ Last updated 2021-04-16
</p>
</body>
</html>
diff --git a/tiff/html/internals.html b/tiff/html/internals.html
index 20061ef0..da2998ae 100644
--- a/tiff/html/internals.html
+++ b/tiff/html/internals.html
@@ -253,18 +253,7 @@ operating system-dependencies
as possible in two files: <B>tiffcomp.h</B> and
<B>libtiff/tif_&lt;os&gt;.c</B>. The latter file contains
operating system-specific routines to do I/O and I/O-related operations.
-The UNIX (<B>tif_unix.c</B>),
-Macintosh (<B>tif_apple.c</B>),
-and VMS (<B>tif_vms.c</B>)
-code has had the most use;
-the MS/DOS support (<B>tif_msdos.c</B>) assumes
-some level of UNIX system call emulation (i.e.
-<TT>open</TT>,
-<TT>read</TT>,
-<TT>write</TT>,
-<TT>fstat</TT>,
-<TT>malloc</TT>,
-<TT>free</TT>).
+The UNIX (<B>tif_unix.c</B>) code has had the most use.
<P>
Native CPU byte order is determined on the fly by
@@ -289,7 +278,7 @@ The following defines control general portability:
<TR>
<TD VALIGN=top><TT>HAVE_IEEEFP</TT></TD>
<TD>Define this as 0 or 1 according to the floating point
- format suported by the machine. If your machine does
+ format supported by the machine. If your machine does
not support IEEE floating point then you will need to
add support to tif_machdep.c to convert between the
native format and IEEE format.</TD>
@@ -338,37 +327,37 @@ purely by fiddling with the following machine-dependent typedefs:
<TABLE BORDER CELLPADDING=3 WIDTH="100%">
<TR>
-<TD>uint8</TD>
+<TD>uint8_t</TD>
<TD>8-bit unsigned integer</TD>
<TD>tiff.h</TD>
</TR>
<TR>
-<TD>int8</TD>
+<TD>int8_t</TD>
<TD>8-bit signed integer</TD>
<TD>tiff.h</TD>
</TR>
<TR>
-<TD>uint16</TD>
+<TD>uint16_t</TD>
<TD>16-bit unsigned integer</TD>
<TD>tiff.h</TD>
</TR>
<TR>
-<TD>int16</TD>
+<TD>int16_t</TD>
<TD>16-bit signed integer</TD>
<TD>tiff.h</TD>
</TR>
<TR>
-<TD>uint32</TD>
+<TD>uint32_t</TD>
<TD>32-bit unsigned integer</TD>
<TD>tiff.h</TD>
</TR>
<TR>
-<TD>int32</TD>
+<TD>int32_t</TD>
<TD>32-bit signed integer</TD>
<TD>tiff.h</TD>
</TR>
@@ -399,23 +388,23 @@ structure:
</TR>
<TR>
-<TD>typedef uint16 tdir_t;</TD> <TD>directory index</TD>
+<TD>typedef uint16_t tdir_t;</TD> <TD>directory index</TD>
</TR>
<TR>
-<TD>typedef uint16 tsample_t;</TD> <TD>sample number</TD>
+<TD>typedef uint16_t tsample_t;</TD> <TD>sample number</TD>
</TR>
<TR>
-<TD>typedef uint32 tstrip_t;</TD> <TD>strip number</TD>
+<TD>typedef uint32_t tstrip_t;</TD> <TD>strip number</TD>
</TR>
<TR>
-<TD>typedef uint32 ttile_t;</TD> <TD>tile number</TD>
+<TD>typedef uint32_t ttile_t;</TD> <TD>tile number</TD>
</TR>
<TR>
-<TD>typedef int32 tsize_t;</TD> <TD>i/o size in bytes</TD>
+<TD>typedef int32_t tsize_t;</TD> <TD>i/o size in bytes</TD>
</TR>
<TR>
@@ -427,7 +416,7 @@ structure:
</TR>
<TR>
-<TD>typedef int32 toff_t;</TD> <TD>file offset (should be off_t)</TD>
+<TD>typedef int32_t toff_t;</TD> <TD>file offset (should be off_t)</TD>
</TR>
<TR>
@@ -449,7 +438,7 @@ be an arbitrary size (without penalty). <TT>ttag_t</TT> must be either
because the library uses a varargs
interface and ANSI C restricts the type of the parameter before an
ellipsis to be a promoted type. <TT>toff_t</TT> is defined as
-<TT>int32</TT> because
+<TT>int32_t</TT> because
TIFF file offsets are (unsigned) 32-bit quantities. A signed
value is used because some interfaces return -1 on error (sigh).
Finally, note that <TT>tidata_t</TT> is used internally to the library to
diff --git a/tiff/html/libtiff.html b/tiff/html/libtiff.html
index cda66b5a..7698ef54 100644
--- a/tiff/html/libtiff.html
+++ b/tiff/html/libtiff.html
@@ -296,7 +296,7 @@
the <tt>TIFFGetFieldDefaulted</tt> interface may be used.
</p>
<p>
- The manual pages for the tag get and set routines specifiy the exact data types
+ The manual pages for the tag get and set routines specify the exact data types
and calling conventions required for each tag supported by the library.
</p>
<hr>
@@ -375,14 +375,14 @@
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;TIFF* tif = TIFFOpen(argv[1], "r");<br>
&nbsp;&nbsp;&nbsp;&nbsp;if (tif) {<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32 w, h;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t w, h;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size_t npixels;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32* raster;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t* raster;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &amp;w);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &amp;h);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;npixels = w * h;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raster = (uint32_t*) _TIFFmalloc(npixels * sizeof (uint32_t));<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (raster != NULL) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (TIFFReadRGBAImage(tif, w, h, raster, 0)) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...process raster data...<br>
@@ -417,10 +417,10 @@
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (TIFFRGBAImageBegin(&amp;img, tif, 0, emsg)) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size_t npixels;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32* raster;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t* raster;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;npixels = img.width * img.height;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raster = (uint32_t*) _TIFFmalloc(npixels * sizeof (uint32_t));<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (raster != NULL) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (TIFFRGBAImageGet(&amp;img, raster, img.width, img.height)) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...process raster data...<br>
@@ -511,9 +511,9 @@
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;TIFF* tif = TIFFOpen("myfile.tif", "r");<br>
&nbsp;&nbsp;&nbsp;&nbsp;if (tif) {<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32 imagelength;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t imagelength;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tdata_t buf;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32 row;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t row;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &amp;imagelength);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;buf = _TIFFmalloc(TIFFScanlineSize(tif));<br>
@@ -538,9 +538,9 @@
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;TIFF* tif = TIFFOpen("myfile.tif", "r");<br>
&nbsp;&nbsp;&nbsp;&nbsp;if (tif) {<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32 imagelength;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t imagelength;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tdata_t buf;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32 row;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t row;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &amp;imagelength);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &amp;config);<br>
@@ -549,7 +549,7 @@
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (row = 0; row &lt; imagelength; row++)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFReadScanline(tif, buf, row, 0);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else if (config == planarconfig_separate) {<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint16 s, nsamples;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint16_t s, nsamples;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tiffgetfield(tif, tifftag_samplesperpixel, &amp;nsamples);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (s = 0; s &lt; nsamples; s++)<br>
@@ -635,8 +635,8 @@
&nbsp;&nbsp;&nbsp;&nbsp;if (tif) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tdata_t buf;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tstrip_t strip;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32* bc;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32 stripsize;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t* bc;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t stripsize;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &amp;bc);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stripsize = bc[0];<br>
@@ -689,9 +689,9 @@
{<br>
&nbsp;&nbsp;&nbsp;&nbsp;TIFF* tif = TIFFOpen("myfile.tif", "r");<br>
&nbsp;&nbsp;&nbsp;&nbsp;if (tif) {<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32 imageWidth, imageLength;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32 tileWidth, tileLength;<br>
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32 x, y;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t imageWidth, imageLength;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t tileWidth, tileLength;<br>
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32_t x, y;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tdata_t buf;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &amp;imageWidth);<br>
diff --git a/tiff/html/man/CMakeLists.txt b/tiff/html/man/CMakeLists.txt
index 897a0e73..97aeaf63 100644
--- a/tiff/html/man/CMakeLists.txt
+++ b/tiff/html/man/CMakeLists.txt
@@ -91,8 +91,6 @@ set(docfiles
set(doc_DATA ${indexfile} ${docfiles})
-extra_dist(${doc_DATA})
-
install(FILES ${doc_DATA}
DESTINATION "${LIBTIFF_DOCDIR}/html/man")
diff --git a/tiff/html/man/Makefile.in b/tiff/html/man/Makefile.in
index f6d6cef2..4c5802de 100644
--- a/tiff/html/man/Makefile.in
+++ b/tiff/html/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -124,8 +124,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(dist_doc_DATA) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -318,6 +320,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/tiff/html/man/TIFFDataWidth.3tiff.html b/tiff/html/man/TIFFDataWidth.3tiff.html
index 9eede060..c8318ded 100644
--- a/tiff/html/man/TIFFDataWidth.3tiff.html
+++ b/tiff/html/man/TIFFDataWidth.3tiff.html
@@ -75,7 +75,7 @@ TIFF_DOUBLE</i></p>
<td width="8%"></td>
<td width="91%">
<p><i>TIFFDataWidth</i> returns a number of bytes occupied
-by the item of given type. 0 returned when uknown data type
+by the item of given type. 0 returned when unknown data type
supplied.</p>
</td>
</table>
diff --git a/tiff/html/man/TIFFFieldPassCount.3tiff.html b/tiff/html/man/TIFFFieldPassCount.3tiff.html
index 5dc31262..4f6c6ad3 100644
--- a/tiff/html/man/TIFFFieldPassCount.3tiff.html
+++ b/tiff/html/man/TIFFFieldPassCount.3tiff.html
@@ -67,9 +67,9 @@ field information pointer previously returned by
<b>TIFFFieldWithName</b>.</p>
<p style="margin-left:11%; margin-top: 1em">When a
-<i>count</i> is required, it will be of type <b>uint32</b>
+<i>count</i> is required, it will be of type <b>uint32_t</b>
when <b>TIFFFieldReadCount</b> reports
-<b>TIFF_VARIABLE2</b>, and of type <b>uint16</b> otherwise.
+<b>TIFF_VARIABLE2</b>, and of type <b>uint16_t</b> otherwise.
(This distinction is critical for use of
<b>TIFFGetField</b>, but normally not so for use of
<b>TIFFSetField</b>.)</p>
diff --git a/tiff/html/man/TIFFFieldReadCount.3tiff.html b/tiff/html/man/TIFFFieldReadCount.3tiff.html
index d800a861..6a0b1359 100644
--- a/tiff/html/man/TIFFFieldReadCount.3tiff.html
+++ b/tiff/html/man/TIFFFieldReadCount.3tiff.html
@@ -63,12 +63,12 @@ should be supplied to <b>TIFFGetField</b>. For most field
types this is a small positive integer, typically 1 or 2,
but there are some special values: <b><br>
TIFF_VARIABLE</b> indicates that a variable number of values
-is possible; then, a <b>uint16</b> <i>count</i> argument and
+is possible; then, a <b>uint16_t</b> <i>count</i> argument and
a pointer <i>data</i> argument must be supplied to
<b>TIFFGetField</b>. <b><br>
TIFF_VARIABLE2</b> is the same as <b>TIFF_VARIABLE</b>
except that the <i>count</i> argument must have type
-<b>uint32</b>. <b><br>
+<b>uint32_t</b>. <b><br>
TIFF_SPP</b> indicates that the number of arguments is equal
to the image&rsquo;s number of samples per pixel.</p>
diff --git a/tiff/html/man/TIFFFieldTag.3tiff.html b/tiff/html/man/TIFFFieldTag.3tiff.html
index b1fdea0f..05a13a71 100644
--- a/tiff/html/man/TIFFFieldTag.3tiff.html
+++ b/tiff/html/man/TIFFFieldTag.3tiff.html
@@ -45,7 +45,7 @@
<p style="margin-left:11%; margin-top: 1em"><b>#include
&lt;tiffio.h&gt;</b></p>
-<p style="margin-left:11%; margin-top: 1em"><b>uint32
+<p style="margin-left:11%; margin-top: 1em"><b>uint32_t
TIFFFieldTag(const TIFFField*</b> <i>fip</i><b>)</b></p>
<h2>DESCRIPTION
diff --git a/tiff/html/man/TIFFFieldWriteCount.3tiff.html b/tiff/html/man/TIFFFieldWriteCount.3tiff.html
index 0d446bc7..31f27f51 100644
--- a/tiff/html/man/TIFFFieldWriteCount.3tiff.html
+++ b/tiff/html/man/TIFFFieldWriteCount.3tiff.html
@@ -63,12 +63,12 @@ should be supplied to <b>TIFFSetField</b>. For most field
types this is a small positive integer, typically 1 or 2,
but there are some special values: <b><br>
TIFF_VARIABLE</b> indicates that a variable number of values
-is possible; then, a <b>uint16</b> <i>count</i> argument and
+is possible; then, a <b>uint16_t</b> <i>count</i> argument and
a pointer <i>data</i> argument must be supplied to
<b>TIFFSetField</b>. <b><br>
TIFF_VARIABLE2</b> is the same as <b>TIFF_VARIABLE</b>
except that the <i>count</i> argument must have type
-<b>uint32</b>. (On most modern machines, this makes no
+<b>uint32_t</b>. (On most modern machines, this makes no
practical difference, and the <i>count</i> argument can
simply be an <b>int</b> in either case.) <b><br>
TIFF_SPP</b> indicates that the number of arguments must be
diff --git a/tiff/html/man/TIFFGetField.3tiff.html b/tiff/html/man/TIFFGetField.3tiff.html
index cbbb8be7..ac2ca912 100644
--- a/tiff/html/man/TIFFGetField.3tiff.html
+++ b/tiff/html/man/TIFFGetField.3tiff.html
@@ -183,7 +183,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -206,7 +206,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -229,7 +229,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -252,7 +252,7 @@ values.</p>
<td width="28%">
-<p>uint16**</p></td>
+<p>uint16_t**</p></td>
<td width="12%">
@@ -277,7 +277,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -300,7 +300,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -346,7 +346,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -415,7 +415,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -438,7 +438,7 @@ values.</p>
<td width="28%">
-<p>uint16*,uint16**</p></td>
+<p>uint16_t*,uint16_t**</p></td>
<td width="12%">
@@ -513,7 +513,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -536,7 +536,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -559,7 +559,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -582,7 +582,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -628,7 +628,7 @@ values.</p>
<td width="28%">
-<p>uint32*,void**</p></td>
+<p>uint32_t*,void**</p></td>
<td width="12%">
@@ -653,7 +653,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -699,7 +699,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -722,7 +722,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -768,7 +768,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -841,7 +841,7 @@ values.</p>
<td width="28%">
-<p>uint32*,void**</p></td>
+<p>uint32_t*,void**</p></td>
<td width="12%">
@@ -914,7 +914,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -937,7 +937,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -960,7 +960,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1006,7 +1006,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1052,7 +1052,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1075,7 +1075,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1098,7 +1098,7 @@ values.</p>
<td width="28%">
-<p>uint32*,void**</p></td>
+<p>uint32_t*,void**</p></td>
<td width="12%">
@@ -1123,7 +1123,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1146,7 +1146,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1219,7 +1219,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1242,7 +1242,7 @@ values.</p>
<td width="28%">
-<p>uint32*,void**</p></td>
+<p>uint32_t*,void**</p></td>
<td width="12%">
@@ -1267,7 +1267,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1290,7 +1290,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1313,7 +1313,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1428,7 +1428,7 @@ values.</p>
<td width="28%">
-<p>uint32**</p></td>
+<p>uint32_t**</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1451,7 +1451,7 @@ values.</p>
<td width="28%">
-<p>uint32**</p></td>
+<p>uint32_t**</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1474,7 +1474,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1497,7 +1497,7 @@ values.</p>
<td width="28%">
-<p>uint16*,uint32**</p></td>
+<p>uint16_t*,uint32_t**</p></td>
<td width="12%">
@@ -1545,7 +1545,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1568,7 +1568,7 @@ values.</p>
<td width="28%">
-<p>uint32**</p></td>
+<p>uint32_t**</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1591,7 +1591,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1614,7 +1614,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1637,7 +1637,7 @@ values.</p>
<td width="28%">
-<p>uint32**</p></td>
+<p>uint32_t**</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1660,7 +1660,7 @@ values.</p>
<td width="28%">
-<p>uint32*</p></td>
+<p>uint32_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1677,7 +1677,7 @@ values.</p>
<td width="12%">
-<p>uint16**1&lt;&lt;BitsPerSample entry arrays</p></td></tr>
+<p>uint16_t**1&lt;&lt;BitsPerSample entry arrays</p></td></tr>
<tr valign="top" align="left">
<td width="11%"></td>
<td width="38%">
@@ -1723,7 +1723,7 @@ values.</p>
<td width="28%">
-<p>uint32*,void**</p></td>
+<p>uint32_t*,void**</p></td>
<td width="12%">
@@ -1819,7 +1819,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1842,7 +1842,7 @@ values.</p>
<td width="28%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="12%">
</td></tr>
<tr valign="top" align="left">
@@ -1914,14 +1914,14 @@ you want to read the LONG value from the tag 33424 and ASCII
string from the tag 36867 you can use the following
code:</p>
-<p style="margin-left:22%; margin-top: 1em">uint16 count;
+<p style="margin-left:22%; margin-top: 1em">uint16_t count;
<br>
void *data;</p>
<p style="margin-left:22%; margin-top: 1em">TIFFGetField(tiff,
33424, &amp;count, &amp;data); <br>
-printf(&quot;Tag %d: %d, count %d0, 33424, *(uint32 *)data,
+printf(&quot;Tag %d: %d, count %d0, 33424, *(uint32_t *)data,
count); <br>
TIFFGetField(tiff, 36867, &amp;count, &amp;data); <br>
printf(&quot;Tag %d: %s, count %d0, 36867, (char *)data,
diff --git a/tiff/html/man/TIFFRGBAImage.3tiff.html b/tiff/html/man/TIFFRGBAImage.3tiff.html
index 83581f11..1d97e53e 100644
--- a/tiff/html/man/TIFFRGBAImage.3tiff.html
+++ b/tiff/html/man/TIFFRGBAImage.3tiff.html
@@ -53,8 +53,8 @@ int TIFFRGBAImageBegin(TIFFRGBAImage *</b><i>img</i><b>,
TIFF*</b> <i>tif</i><b>, int</b> <i>stopOnError</i><b>,
char</b> <i>emsg[1024]</i><b>)<br>
int TIFFRGBAImageGet(TIFFRGBAImage *</b><i>img</i><b>,
-uint32*</b> <i>raster</i><b>, uint32</b> <i>width</i> <b>,
-uint32</b> <i>height</i><b>)<br>
+uint32_t*</b> <i>raster</i><b>, uint32_t</b> <i>width</i> <b>,
+uint32_t</b> <i>height</i><b>)<br>
void TIFFRGBAImageEnd(TIFFRGBAImage
*</b><i>img</i><b>)</b></p>
</td>
@@ -169,9 +169,9 @@ after each display operation. For example, the
update the display as the raster is being filled:</p>
<!-- INDENTATION -->
<pre>static void
-putContigAndDraw(TIFFRGBAImage* img, uint32* raster,
- uint32 x, uint32 y, uint32 w, uint32 h,
- int32 fromskew, int32 toskew,
+putContigAndDraw(TIFFRGBAImage* img, uint32_t* raster,
+ uint32_t x, uint32_t y, uint32_t w, uint32_t h,
+ int32_t fromskew, int32_t toskew,
unsigned char* cp)
{
(*putContig)(img, raster, x, y, w, h, fromskew, toskew, cp);
diff --git a/tiff/html/man/TIFFReadRGBAImage.3tiff.html b/tiff/html/man/TIFFReadRGBAImage.3tiff.html
index f648f099..37578bc5 100644
--- a/tiff/html/man/TIFFReadRGBAImage.3tiff.html
+++ b/tiff/html/man/TIFFReadRGBAImage.3tiff.html
@@ -47,12 +47,12 @@ and decode an image into a fixed-format raster</p>
0xff)</b></p>
<!-- INDENTATION -->
<p><b>int TIFFReadRGBAImage(TIFF *</b><i>tif</i><b>,
-uint32</b> <i>width</i><b>, uint32</b> <i>height</i><b>,
-uint32 *</b><i>raster</i><b>, int</b>
+uint32_t</b> <i>width</i><b>, uint32_t</b> <i>height</i><b>,
+uint32_t *</b><i>raster</i><b>, int</b>
<i>stopOnError</i><b>)<br>
int TIFFReadRGBAImageOriented(TIFF *</b><i>tif</i><b>,
-uint32</b> <i>width</i><b>, uint32</b> <i>height</i><b>,
-uint32 *</b><i>raster</i><b>, int</b> <i>orientation</i><b>,
+uint32_t</b> <i>width</i><b>, uint32_t</b> <i>height</i><b>,
+uint32_t *</b><i>raster</i><b>, int</b> <i>orientation</i><b>,
int</b> <i>stopOnError</i><b>)</b></p>
</td>
</table>
@@ -176,7 +176,7 @@ scaling sample values. Palette, grayscale, bilevel,
uncorrected by any colorimetry information present in the
directory.</p>
<!-- INDENTATION -->
-<p>The paramater <i>stopOnError</i> specifies how to act if
+<p>The parameter <i>stopOnError</i> specifies how to act if
an error is encountered while reading the image. If
<i>stopOnError</i> is non-zero, then an error will terminate
the operation; otherwise <i>TIFFReadRGBAImage</i> will
diff --git a/tiff/html/man/TIFFReadRGBAStrip.3tiff.html b/tiff/html/man/TIFFReadRGBAStrip.3tiff.html
index 3358df7d..2d6caeb7 100644
--- a/tiff/html/man/TIFFReadRGBAStrip.3tiff.html
+++ b/tiff/html/man/TIFFReadRGBAStrip.3tiff.html
@@ -47,7 +47,7 @@ into a fixed-format raster</p>
0xff)</b></p>
<!-- INDENTATION -->
<p><b>int TIFFReadRGBAStrip(TIFF *</b><i>tif</i><b>,
-uint32</b> <i>row</i><b>, uint32
+uint32_t</b> <i>row</i><b>, uint32_t
*</b><i>raster</i><b>)</b></p>
</td>
</table>
diff --git a/tiff/html/man/TIFFReadRGBATile.3tiff.html b/tiff/html/man/TIFFReadRGBATile.3tiff.html
index bdbb43cc..ea37f7e1 100644
--- a/tiff/html/man/TIFFReadRGBATile.3tiff.html
+++ b/tiff/html/man/TIFFReadRGBATile.3tiff.html
@@ -100,7 +100,7 @@ into a fixed-format raster</p>
<td width="8%"></td>
<td width="91%">
<p><b>int TIFFReadRGBATile(TIFF *</b><i>tif</i><b>,
-uint32</b> <i>x</i><b>, uint32</b> <i>y</i><b>, uint32
+uint32_t</b> <i>x</i><b>, uint32_t</b> <i>y</i><b>, uint32_t
*</b><i>raster</i><b>)</b></p>
</td>
</table>
diff --git a/tiff/html/man/TIFFReadScanline.3tiff.html b/tiff/html/man/TIFFReadScanline.3tiff.html
index 79f17fcd..11d60c45 100644
--- a/tiff/html/man/TIFFReadScanline.3tiff.html
+++ b/tiff/html/man/TIFFReadScanline.3tiff.html
@@ -42,7 +42,7 @@ data from an open <small>TIFF</small> file</p>
<p><b>#include &lt;tiffio.h&gt;</b></p>
<!-- INDENTATION -->
<p><b>int TIFFReadScanline(TIFF *</b><i>tif</i><b>,
-tdata_t</b> <i>buf</i><b>, uint32</b> <i>row</i><b>,
+tdata_t</b> <i>buf</i><b>, uint32_t</b> <i>row</i><b>,
tsample_t</b> <i>sample</i><b>)</b></p>
</td>
</table>
diff --git a/tiff/html/man/TIFFReadTile.3tiff.html b/tiff/html/man/TIFFReadTile.3tiff.html
index 26054803..11db5ed6 100644
--- a/tiff/html/man/TIFFReadTile.3tiff.html
+++ b/tiff/html/man/TIFFReadTile.3tiff.html
@@ -41,8 +41,8 @@ an open <small>TIFF</small> file</p>
<p><b>#include &lt;tiffio.h&gt;</b></p>
<!-- INDENTATION -->
<p><b>tsize_t TIFFReadTile(TIFF *</b><i>tif</i><b>,
-tdata_t</b> <i>buf</i><b>, uint32</b> <i>x</i><b>,
-uint32</b> <i>y</i><b>, uint32</b> <i>z</i><b>,
+tdata_t</b> <i>buf</i><b>, uint32_t</b> <i>x</i><b>,
+uint32_t</b> <i>y</i><b>, uint32_t</b> <i>z</i><b>,
tsample_t</b> <i>sample</i><b>)</b></p>
</td>
</table>
diff --git a/tiff/html/man/TIFFSetDirectory.3tiff.html b/tiff/html/man/TIFFSetDirectory.3tiff.html
index c3434056..be90c933 100644
--- a/tiff/html/man/TIFFSetDirectory.3tiff.html
+++ b/tiff/html/man/TIFFSetDirectory.3tiff.html
@@ -41,7 +41,7 @@ current directory for an open <small>TIFF</small> file</p>
<!-- INDENTATION -->
<p><b>int TIFFSetDirectory(TIFF *</b><i>tif</i><b>,
tdir_t</b> <i>dirnum</i><b>)<br>
-int TIFFSetSubDirectory(TIFF *</b><i>tif</i><b>, uint32</b>
+int TIFFSetSubDirectory(TIFF *</b><i>tif</i><b>, uint32_t</b>
<i>diroff</i><b>)</b></p>
</td>
</table>
diff --git a/tiff/html/man/TIFFSetField.3tiff.html b/tiff/html/man/TIFFSetField.3tiff.html
index ce6a88b0..be4de304 100644
--- a/tiff/html/man/TIFFSetField.3tiff.html
+++ b/tiff/html/man/TIFFSetField.3tiff.html
@@ -93,9 +93,9 @@ understood by <i>libtiff</i>, the number of parameter
values, and the expected types for the parameter values are
shown below. The data types are: <i>char*</i> is
null-terminated string and corresponds to the
-<small>ASCII</small> data type; <i>uint16</i> is an unsigned
-16-bit value; <i>uint32</i> is an unsigned 32-bit value;
-<i>uint16*</i> is an array of unsigned 16-bit values.
+<small>ASCII</small> data type; <i>uint16_t</i> is an unsigned
+16-bit value; <i>uint32_t</i> is an unsigned 32-bit value;
+<i>uint16_t*</i> is an array of unsigned 16-bit values.
<i>void*</i> is an array of data values of unspecified
type.</p>
@@ -173,7 +173,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -196,7 +196,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -221,7 +221,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -244,7 +244,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16*</p></td>
+<p>uint16_t*</p></td>
<td width="11%">
@@ -269,7 +269,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -294,7 +294,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -386,7 +386,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -409,7 +409,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16,uint16*</p></td>
+<p>uint16_t,uint16_t*</p></td>
<td width="11%">
@@ -484,7 +484,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -509,7 +509,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
@@ -534,7 +534,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
@@ -559,7 +559,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -605,7 +605,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32,void*</p></td>
+<p>uint32_t,void*</p></td>
<td width="11%">
@@ -630,7 +630,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
@@ -678,7 +678,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -701,7 +701,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
@@ -726,7 +726,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16, char*</p></td>
+<p>uint16_t, char*</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -749,7 +749,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -824,7 +824,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32*,void*</p></td>
+<p>uint32_t*,void*</p></td>
<td width="11%">
@@ -897,7 +897,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -922,7 +922,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -945,7 +945,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -991,7 +991,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -1037,7 +1037,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -1060,7 +1060,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -1083,7 +1083,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32,void*</p></td>
+<p>uint32_t,void*</p></td>
<td width="11%">
@@ -1108,7 +1108,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -1133,7 +1133,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -1208,7 +1208,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -1231,7 +1231,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32,void*</p></td>
+<p>uint32_t,void*</p></td>
<td width="11%">
@@ -1256,7 +1256,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
@@ -1281,7 +1281,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -1306,7 +1306,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -1425,7 +1425,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -1448,7 +1448,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16,uint32*</p></td>
+<p>uint16_t,uint32_t*</p></td>
<td width="11%">
@@ -1496,7 +1496,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
</td></tr>
<tr valign="top" align="left">
@@ -1519,7 +1519,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
@@ -1544,7 +1544,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
@@ -1569,7 +1569,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32</p></td>
+<p>uint32_t</p></td>
<td width="11%">
@@ -1584,7 +1584,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>1 or 3&Dagger; uint16*</p></td>
+<p>1 or 3&Dagger; uint16_t*</p></td>
<td width="11%">
@@ -1634,7 +1634,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint32,void*</p></td>
+<p>uint32_t,void*</p></td>
<td width="11%">
@@ -1730,7 +1730,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
@@ -1755,7 +1755,7 @@ meaning of each tag.</p>
<td width="29%">
-<p>uint16</p></td>
+<p>uint16_t</p></td>
<td width="11%">
diff --git a/tiff/html/man/TIFFWriteScanline.3tiff.html b/tiff/html/man/TIFFWriteScanline.3tiff.html
index 8f300217..7b5dfea7 100644
--- a/tiff/html/man/TIFFWriteScanline.3tiff.html
+++ b/tiff/html/man/TIFFWriteScanline.3tiff.html
@@ -42,7 +42,7 @@
<p><b>#include &lt;tiffio.h&gt;</b></p>
<!-- INDENTATION -->
<p><b>int TIFFWriteScanline(TIFF *</b><i>tif</i><b>,
-tdata_t</b> <i>buf</i><b>, uint32</b> <i>row</i><b>,
+tdata_t</b> <i>buf</i><b>, uint32_t</b> <i>row</i><b>,
tsample_t</b> <i>sample</i><b>)</b></p>
</td>
</table>
diff --git a/tiff/html/man/TIFFWriteTile.3tiff.html b/tiff/html/man/TIFFWriteTile.3tiff.html
index d450ee12..d4f520b6 100644
--- a/tiff/html/man/TIFFWriteTile.3tiff.html
+++ b/tiff/html/man/TIFFWriteTile.3tiff.html
@@ -40,8 +40,8 @@ an open <small>TIFF</small> file</p>
<p><b>#include &lt;tiffio.h&gt;</b></p>
<!-- INDENTATION -->
<p><b>tsize_t TIFFWriteTile(TIFF *</b><i>tif</i><b>,
-tdata_t</b> <i>buf</i><b>, uint32</b> <i>x</i><b>,
-uint32</b> <i>y</i><b>, uint32</b> <i>z</i><b>,
+tdata_t</b> <i>buf</i><b>, uint32_t</b> <i>x</i><b>,
+uint32_t</b> <i>y</i><b>, uint32_t</b> <i>z</i><b>,
tsample_t</b> <i>sample</i><b>)</b></p>
</td>
</table>
diff --git a/tiff/html/man/TIFFcodec.3tiff.html b/tiff/html/man/TIFFcodec.3tiff.html
index e18c0ed4..e7a52460 100644
--- a/tiff/html/man/TIFFcodec.3tiff.html
+++ b/tiff/html/man/TIFFcodec.3tiff.html
@@ -39,14 +39,14 @@ routines</p>
<td width="91%">
<p><b>#include &lt;tiffio.h&gt;</b></p>
<!-- INDENTATION -->
-<p><b>const TIFFCodec* TIFFFindCODEC(uint16</b>
+<p><b>const TIFFCodec* TIFFFindCODEC(uint16_t</b>
<i>scheme</i><b>);<br>
-TIFFCodec* TIFFRegisterCODEC(uint16</b> <i>scheme</i><b>,
+TIFFCodec* TIFFRegisterCODEC(uint16_t</b> <i>scheme</i><b>,
const char *</b><i>method</i><b>, TIFFInitMethod</b>
<i>init</i><b>);<br>
void TIFFUnRegisterCODEC(TIFFCodec
*</b><i>codec</i><b>);<br>
-int TIFFIsCODECConfigured(uint16</b>
+int TIFFIsCODECConfigured(uint16_t</b>
<i>scheme</i><b>);</b></p>
</td>
</table>
diff --git a/tiff/html/man/TIFFcolor.3tiff.html b/tiff/html/man/TIFFcolor.3tiff.html
index e598ae6e..d4c5a58a 100644
--- a/tiff/html/man/TIFFcolor.3tiff.html
+++ b/tiff/html/man/TIFFcolor.3tiff.html
@@ -42,21 +42,21 @@ routines.</p>
*</b><i>ycbcr</i><b>, float *</b><i>luma</i><b>, float
*</b><i>refBlackWhite&quot;</i><b>);&quot;<br>
void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *</b><i>ycbcr</i><b>,
-uint32</b> <i>Y</i><b>, int32</b> <i>Cb</i><b>, int32</b>
-<i>Cr</i><b>, uint32 *</b><i>R</i><b>, uint32
-*</b><i>G</i><b>, uint32 *</b><i>B</i> <b>);</b></p>
+uint32_t</b> <i>Y</i><b>, int32_t</b> <i>Cb</i><b>, int32_t</b>
+<i>Cr</i><b>, uint32_t *</b><i>R</i><b>, uint32_t
+*</b><i>G</i><b>, uint32_t *</b><i>B</i> <b>);</b></p>
<!-- INDENTATION -->
<p><b>int TIFFCIELabToRGBInit(TIFFCIELabToRGB
*</b><i>cielab</i><b>, TIFFDisplay *</b><i>display</i><b>,
float *</b><i>refWhite</i><b>);<br>
void TIFFCIELabToXYZ(TIFFCIELabToRGB *</b><i>cielab</i><b>,
-uint32</b> <i>L</i><b>, int32</b> <i>a</i><b>, int32</b>
+uint32_t</b> <i>L</i><b>, int32_t</b> <i>a</i><b>, int32_t</b>
<i>b</i><b>, float *</b><i>X</i><b>, float *</b><i>Y</i><b>,
float *</b><i>Z</i><b>);<br>
void TIFFXYZToRGB(TIFFCIELabToRGB *</b><i>cielab</i><b>,
float</b> <i>X</i><b>, float</b> <i>Y</i><b>, float</b>
-<i>Z&quot;</i><b>,</b><i>uint32</i><b>*&quot;</b><i>R</i><b>,
-uint32 *</b><i>G</i><b>, uint32 *</b><i>B</i><b>);</b></p>
+<i>Z&quot;</i><b>,</b><i>uint32_t</i><b>*&quot;</b><i>R</i><b>,
+uint32_t *</b><i>G</i><b>, uint32_t *</b><i>B</i><b>);</b></p>
</td>
</table>
<a name="DESCRIPTION"></a>
@@ -116,7 +116,7 @@ int*</p>
<td width="6%">
<p>Cb_b_tab;<br>
-int32*</p>
+int32_t*</p>
</td>
<td width="56%">
</td>
@@ -127,7 +127,7 @@ int32*</p>
<td width="6%">
<p>Cr_g_tab;<br>
-int32*</p>
+int32_t*</p>
</td>
<td width="56%">
</td>
@@ -148,7 +148,7 @@ int32*</p>
<tr valign="top" align="left">
<td width="17%"></td>
<td width="82%">
-<p>int32* Y_tab;<br>
+<p>int32_t* Y_tab;<br>
} TIFFYCbCrToRGB;</p></td>
</table>
<!-- INDENTATION -->
@@ -178,7 +178,7 @@ should helps to understand the the technique:</p>
<td width="17%"></td>
<td width="82%">
<pre>float *luma, *refBlackWhite;
-uint16 hs, vs;
+uint16_t hs, vs;
/* Initialize structures */
ycbcr = (TIFFYCbCrToRGB*)
@@ -212,7 +212,7 @@ sizeof(long))</p>
<td width="24%"></td>
<td width="75%">
-<p>+ 3*256*sizeof(int32));</p>
+<p>+ 3*256*sizeof(int32_t));</p>
</td>
</table>
<!-- INDENTATION -->
@@ -272,9 +272,9 @@ if (TIFFYCbCrToRGBInit(ycbcr, luma, refBlackWhite) &lt;
<td width="17%"></td>
<td width="82%">
<p>/* Start conversion */<br>
-uint32 r, g, b;<br>
-uint32 Y;<br>
-int32 Cb, Cr;</p>
+uint32_t r, g, b;<br>
+uint32_t Y;<br>
+int32_t Cb, Cr;</p>
<!-- INDENTATION -->
<p>for each pixel in image</p></td>
</table>
@@ -535,19 +535,19 @@ as</p>
<td width="24%"></td>
<td width="75%">
-<p>uint32 d_Vrwr; /* Pixel values for ref. white */</p>
+<p>uint32_t d_Vrwr; /* Pixel values for ref. white */</p>
</td>
<tr valign="top" align="left">
<td width="24%"></td>
<td width="75%">
-<p>uint32 d_Vrwg;</p>
+<p>uint32_t d_Vrwg;</p>
</td>
<tr valign="top" align="left">
<td width="24%"></td>
<td width="75%">
-<p>uint32 d_Vrwb;</p>
+<p>uint32_t d_Vrwb;</p>
</td>
<tr valign="top" align="left">
<td width="24%"></td>
@@ -922,9 +922,9 @@ state.&quot;);</p>
<p>}</p>
<!-- INDENTATION -->
<p>/* Now we can start to convert */<br>
-uint32 r, g, b;<br>
-uint32 L;<br>
-int32 a, b;<br>
+uint32_t r, g, b;<br>
+uint32_t L;<br>
+int32_t a, b;<br>
float X, Y, Z;</p>
<!-- INDENTATION -->
<p>for each pixel in image</p></td>
diff --git a/tiff/html/man/TIFFquery.3tiff.html b/tiff/html/man/TIFFquery.3tiff.html
index 2b47fc3d..9fabecca 100644
--- a/tiff/html/man/TIFFquery.3tiff.html
+++ b/tiff/html/man/TIFFquery.3tiff.html
@@ -41,7 +41,7 @@ routines</p>
<td width="91%">
<p><b>#include &lt;tiffio.h&gt;</b></p>
<!-- INDENTATION -->
-<p><b>uint32 TIFFCurrentRow(TIFF*</b> <i>tif</i><b>)<br>
+<p><b>uint32_t TIFFCurrentRow(TIFF*</b> <i>tif</i><b>)<br>
tstrip_t TIFFCurrentStrip(TIFF*</b> <i>tif</i><b>)<br>
ttile_t TIFFCurrentTile(TIFF*</b> <i>tif</i><b>)<br>
tdir_t TIFFCurrentDirectory(TIFF*</b> <i>tif</i><b>)<br>
diff --git a/tiff/html/man/TIFFstrip.3tiff.html b/tiff/html/man/TIFFstrip.3tiff.html
index ae6b7903..80cdc748 100644
--- a/tiff/html/man/TIFFstrip.3tiff.html
+++ b/tiff/html/man/TIFFstrip.3tiff.html
@@ -39,15 +39,15 @@ TIFFRawStripSize, TIFFComputeStrip, TIFFNumberOfStrips
<td width="91%">
<p><b>#include &lt;tiffio.h&gt;</b></p>
<!-- INDENTATION -->
-<p><b>uint32 TIFFDefaultStripSize(TIFF *</b><i>tif</i><b>,
-uint32</b> <i>estimate</i><b>)<br>
+<p><b>uint32_t TIFFDefaultStripSize(TIFF *</b><i>tif</i><b>,
+uint32_t</b> <i>estimate</i><b>)<br>
tsize_t TIFFStripSize(TIFF *</b><i>tif</i><b>)<br>
-tsize_t TIFFVStripSize(TIFF *</b><i>tif</i><b>, uint32</b>
+tsize_t TIFFVStripSize(TIFF *</b><i>tif</i><b>, uint32_t</b>
<i>nrows</i><b>)<br>
tsize_t TIFFRawStripSize(TIFF *</b><i>tif</i><b>,
tstrip_t</b> <i>strip</i><b>)<br>
tstrip_t TIFFComputeStrip(TIFF *</b><i>tif</i><b>,
-uint32</b> <i>row</i><b>, tsample_t</b>
+uint32_t</b> <i>row</i><b>, tsample_t</b>
<i>sample</i><b>)<br>
tstrip_t TIFFNumberOfStrips(TIFF *</b><i>tif</i><b>)</b></p>
</td>
diff --git a/tiff/html/man/TIFFswab.3tiff.html b/tiff/html/man/TIFFswab.3tiff.html
index 3f7ebfef..dcbf6012 100644
--- a/tiff/html/man/TIFFswab.3tiff.html
+++ b/tiff/html/man/TIFFswab.3tiff.html
@@ -43,11 +43,11 @@ TIFFSwabLong, TIFFSwabArrayOfShort, TIFFSwabArrayOfLong
<i>reversed</i><b>)<br>
void TIFFReverseBits(u_char *</b><i>data</i><b>, unsigned
long</b> <i>nbytes</i><b>)<br>
-void TIFFSwabShort(uint16 *</b><i>data</i><b>)<br>
-void TIFFSwabLong(uint32 *</b><i>data</i><b>)<br>
-void TIFFSwabArrayOfShort(uint16 *</b><i>data</i><b>,
+void TIFFSwabShort(uint16_t *</b><i>data</i><b>)<br>
+void TIFFSwabLong(uint32_t *</b><i>data</i><b>)<br>
+void TIFFSwabArrayOfShort(uint16_t *</b><i>data</i><b>,
unsigned long</b> <i>nshorts</i><b>)<br>
-void TIFFSwabArrayOfLong(uint32 *</b><i>data</i><b>,
+void TIFFSwabArrayOfLong(uint32_t *</b><i>data</i><b>,
unsigned long</b> <i>nlongs</i><b>)</b></p>
</td>
</table>
diff --git a/tiff/html/man/TIFFtile.3tiff.html b/tiff/html/man/TIFFtile.3tiff.html
index b69cc919..2d1bb576 100644
--- a/tiff/html/man/TIFFtile.3tiff.html
+++ b/tiff/html/man/TIFFtile.3tiff.html
@@ -40,16 +40,16 @@ TIFFNumberOfTiles &minus; tile-related utility routines</p>
<p><b>#include &lt;tiffio.h&gt;</b></p>
<!-- INDENTATION -->
<p><b>void TIFFDefaultTileSize(TIFF *</b><i>tif</i><b>,
-uint32 *</b><i>tw</i><b>, uint32 *</b><i>th</i><b>)<br>
+uint32_t *</b><i>tw</i><b>, uint32_t *</b><i>th</i><b>)<br>
tsize_t TIFFTileSize(TIFF *</b><i>tif</i><b>)<br>
tsize_t TIFFTileRowSize(TIFF *</b><i>tif</i><b>)<br>
-tsize_t TIFFVTileSize(TIFF *</b><i>tif</i><b>, uint32</b>
+tsize_t TIFFVTileSize(TIFF *</b><i>tif</i><b>, uint32_t</b>
<i>nrows</i><b>)<br>
-ttile_t TIFFComputeTile(TIFF *</b><i>tif</i><b>, uint32</b>
-<i>x</i><b>, uint32</b> <i>y</i><b>, uint32</b> <i>z</i><b>,
+ttile_t TIFFComputeTile(TIFF *</b><i>tif</i><b>, uint32_t</b>
+<i>x</i><b>, uint32_t</b> <i>y</i><b>, uint32_t</b> <i>z</i><b>,
tsample_t</b> <i>sample</i><b>)<br>
-int TIFFCheckTile(TIFF *</b><i>tif</i><b>, uint32</b>
-<i>x</i><b>, uint32</b> <i>y</i><b>, uint32</b> <i>z</i><b>,
+int TIFFCheckTile(TIFF *</b><i>tif</i><b>, uint32_t</b>
+<i>x</i><b>, uint32_t</b> <i>y</i><b>, uint32_t</b> <i>z</i><b>,
tsample_t</b> <i>sample</i><b>)<br>
ttile_t TIFFNumberOfTiles(TIFF *</b><i>tif</i><b>)</b></p>
</td>
diff --git a/tiff/html/man/libtiff.3tiff.html b/tiff/html/man/libtiff.3tiff.html
index 931ae94b..5ca38dfe 100644
--- a/tiff/html/man/libtiff.3tiff.html
+++ b/tiff/html/man/libtiff.3tiff.html
@@ -113,7 +113,7 @@ passed through the varargs interfaces.</big></p></td>
<td width="15%"></td>
<td width="46%">
-<p><big>typedef unsigned short uint16;</big></p>
+<p><big>typedef unsigned short uint16_t;</big></p>
</td>
<td width="38%">
@@ -124,7 +124,7 @@ passed through the varargs interfaces.</big></p></td>
<td width="46%">
<p><big>typedef unsigned &lt;<i>thing</i>&gt;
-uint32;</big></p>
+uint32_t;</big></p>
</td>
<td width="38%">
@@ -144,7 +144,7 @@ uint32;</big></p>
<td width="15%"></td>
<td width="46%">
-<p><big>typedef uint16 tdir_t;</big></p>
+<p><big>typedef uint16_t tdir_t;</big></p>
</td>
<td width="38%">
@@ -154,7 +154,7 @@ uint32;</big></p>
<td width="15%"></td>
<td width="46%">
-<p><big>typedef uint16 tsample_t;</big></p>
+<p><big>typedef uint16_t tsample_t;</big></p>
</td>
<td width="38%">
@@ -164,7 +164,7 @@ uint32;</big></p>
<td width="15%"></td>
<td width="46%">
-<p><big>typedef uint32 tstrip_t;</big></p>
+<p><big>typedef uint32_t tstrip_t;</big></p>
</td>
<td width="38%">
@@ -174,7 +174,7 @@ uint32;</big></p>
<td width="15%"></td>
<td width="46%">
-<p><big>typedef uint32 ttile_t;</big></p>
+<p><big>typedef uint32_t ttile_t;</big></p>
</td>
<td width="38%">
@@ -184,7 +184,7 @@ uint32;</big></p>
<td width="15%"></td>
<td width="46%">
-<p><big>typedef int32 tsize_t;</big></p>
+<p><big>typedef int32_t tsize_t;</big></p>
</td>
<td width="38%">
@@ -214,7 +214,7 @@ uint32;</big></p>
<td width="15%"></td>
<td width="46%">
-<p><big>typedef int32 toff_t;</big></p>
+<p><big>typedef int32_t toff_t;</big></p>
</td>
<td width="38%">
@@ -238,7 +238,7 @@ size (w/o penalty). <i>ttag_t</i> must be either int,
unsigned int, pointer, or double because the library uses a
varargs interface and</big> ANSI C <big>restricts the type
of the parameter before an ellipsis to be a promoted type.
-<i>toff_t</i> is defined as int32 because TIFF file offsets
+<i>toff_t</i> is defined as int32_t because TIFF file offsets
are (unsigned) 32-bit quantities. A signed value is used
because some interfaces return &minus;1 on error. Finally,
note that user-specified data references are passed as
diff --git a/tiff/html/v3.4beta007.html b/tiff/html/v3.4beta007.html
index c2b51f0a..77c6ac8d 100644
--- a/tiff/html/v3.4beta007.html
+++ b/tiff/html/v3.4beta007.html
@@ -54,7 +54,7 @@ The following information is located here:
<LI>Niles Ritter's client tag extension hooks were added
<LI>a new routine <TT>TIFFCurrentDirOffset</TT> was added for
applications that want to find out the file offset of a TIFF directory
-<LI>the calculation of the number of strips in an image was corected
+<LI>the calculation of the number of strips in an image was corrected
for images with certain esoteric configurations
<LI>a potential memory leak (very unlikely) was plugged
<LI>the <TT>TIFFReadRGBAImage</TT> support was completely rewritten
diff --git a/tiff/html/v3.4beta016.html b/tiff/html/v3.4beta016.html
index 11035384..e959af8e 100644
--- a/tiff/html/v3.4beta016.html
+++ b/tiff/html/v3.4beta016.html
@@ -55,7 +55,7 @@ The following information is located here:
<LI>support was added for registering new codecs external to the library
and for overriding the codecs that are builtin to the library
<LI>emulation support for the old <TT>DataType</TT> tag was improved
-<LI>suppport was added for the <TT>SMinSampleValue</TT>
+<LI>support was added for the <TT>SMinSampleValue</TT>
and <TT>SMaxSampleValue</TT> tags
<LI>the library no longer ignores <TT>TileWidth</TT> and <TT>TileLength</TT>
tags whose values are not a multiple of 16 (per the spec); this
diff --git a/tiff/html/v3.4beta028.html b/tiff/html/v3.4beta028.html
index 5ae0e490..1d54afe1 100644
--- a/tiff/html/v3.4beta028.html
+++ b/tiff/html/v3.4beta028.html
@@ -84,7 +84,7 @@ The following information is located here:
order, and ``H'' for the bit order of the native CPU)
<LI>the byte order of image and tag data written to newly-created files
can now be controlled on a per-file basis through a mode parameter
- supplied when openening a file (``b'' to force Big-Endian byte order
+ supplied when opening a file (``b'' to force Big-Endian byte order
and ``l'' to force Little-Endian byte order)
<LI>the use memory-mapped files for images opened read-only can now
be controlled on a per-file basis through a mode parameter supplied
diff --git a/tiff/html/v3.5.7.html b/tiff/html/v3.5.7.html
index a58b7e5a..5ae2d26c 100644
--- a/tiff/html/v3.5.7.html
+++ b/tiff/html/v3.5.7.html
@@ -44,7 +44,7 @@ The following information is located here:
<UL>
<li> libtiff/libtiff.def: Brent Roman submitted new version adding
-serveral missing entry points. Also add a few other entry points
+several missing entry points. Also add a few other entry points
later.
<li> configure, Makefile.in, etc: added support for OPTIMIZER being
@@ -152,7 +152,7 @@ later.
<li> libtiff/tif_getimage.c: relax handling of contig case where
there are extra samples that are supposed to be ignored as per bug 75. This
-should now work for 8bit greyscale or palletted images.
+should now work for 8bit greyscale or paletted images.
<li> libtiff/tif_packbits.c: fixed memory overrun error as per bug 77.
diff --git a/tiff/html/v3.6.0.html b/tiff/html/v3.6.0.html
index 1a3ba4a9..57613867 100644
--- a/tiff/html/v3.6.0.html
+++ b/tiff/html/v3.6.0.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
@@ -108,7 +108,7 @@ with externally defined tags is the primary reason for the shift to the
<UL>
<li> configure, config.site: Fix for large files (>2GiB) support. New
-option in the config.site: LARGEFILE="yes". Should be enougth for the large
+option in the config.site: LARGEFILE="yes". Should be enough for the large
files I/O.
<li> configure: Set -DPIXARLOG_SUPPORT option along with -DZIP_SUPPORT.
diff --git a/tiff/html/v3.6.1.html b/tiff/html/v3.6.1.html
index 6a357f4c..e7036c0f 100644
--- a/tiff/html/v3.6.1.html
+++ b/tiff/html/v3.6.1.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
@@ -125,7 +125,7 @@ interface. YCbCr to RGB conversion code also moved there and now has
<a href="./man/TIFFcolor.3t.html">publicly available interface</a>. These
routines currently used in TIFFRGBAImage interface only and not supported in
other libtiff tools yet. So if you want, for example, to convert CIE Lab image
-into PostScript file you should do it in two steps: chnge colorspace to RGB
+into PostScript file you should do it in two steps: change colorspace to RGB
using <a href="./man/tiff2rgba.1.html">tiff2rgba</a> utility abd then process
it with the <a href="./man/tiff2ps.1.html">tiff2ps</a>.
@@ -176,7 +176,7 @@ lines.
<UL>
<li> contrib/pds/{tif_pdsdirread.c, tif_pdsdirwrite.c}: Use TIFFDataWidth()
-function insted of tiffDataWidth array.
+function instead of tiffDataWidth array.
</UL>
diff --git a/tiff/html/v3.7.0.html b/tiff/html/v3.7.0.html
index 9c0819a4..c08fb3b6 100644
--- a/tiff/html/v3.7.0.html
+++ b/tiff/html/v3.7.0.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.7.0alpha.html b/tiff/html/v3.7.0alpha.html
index 39b63238..70b11177 100644
--- a/tiff/html/v3.7.0alpha.html
+++ b/tiff/html/v3.7.0alpha.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.7.0beta.html b/tiff/html/v3.7.0beta.html
index f646480f..8ed682ca 100644
--- a/tiff/html/v3.7.0beta.html
+++ b/tiff/html/v3.7.0beta.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.7.0beta2.html b/tiff/html/v3.7.0beta2.html
index 41ba6c3a..0b0b9a82 100644
--- a/tiff/html/v3.7.0beta2.html
+++ b/tiff/html/v3.7.0beta2.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.7.1.html b/tiff/html/v3.7.1.html
index 164b4059..66263cd5 100644
--- a/tiff/html/v3.7.1.html
+++ b/tiff/html/v3.7.1.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.7.2.html b/tiff/html/v3.7.2.html
index d396021e..ac1ae85d 100644
--- a/tiff/html/v3.7.2.html
+++ b/tiff/html/v3.7.2.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.7.3.html b/tiff/html/v3.7.3.html
index 54978c8f..bc1dc26d 100644
--- a/tiff/html/v3.7.3.html
+++ b/tiff/html/v3.7.3.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.7.4.html b/tiff/html/v3.7.4.html
index eeb0f3ca..a811a173 100644
--- a/tiff/html/v3.7.4.html
+++ b/tiff/html/v3.7.4.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.8.0.html b/tiff/html/v3.8.0.html
index 81a8b0c6..be1529ba 100644
--- a/tiff/html/v3.8.0.html
+++ b/tiff/html/v3.8.0.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
@@ -110,7 +110,7 @@ The following information is located here:
<a href="http://bugzilla.remotesensing.org/show_bug.cgi?id=1003">
http://bugzilla.remotesensing.org/show_bug.cgi?id=1003</a>
- <li> tif_dirinfo.c: Correctly yse bsearch() and lfind()
+ <li> tif_dirinfo.c: Correctly use bsearch() and lfind()
functions as per bug
<a href="http://bugzilla.remotesensing.org/show_bug.cgi?id=1008">
http://bugzilla.remotesensing.org/show_bug.cgi?id=1008</a>
@@ -170,7 +170,7 @@ The following information is located here:
<a href="http://bugzilla.remotesensing.org/show_bug.cgi?id=965">
http://bugzilla.remotesensing.org/show_bug.cgi?id=965</a>
- <li> tiffsplit.c: Copy fax related fields over splitted parts
+ <li> tiffsplit.c: Copy fax related fields over split parts
as per bug
<a href="http://bugzilla.remotesensing.org/show_bug.cgi?id=983">
http://bugzilla.remotesensing.org/show_bug.cgi?id=983</a>
diff --git a/tiff/html/v3.8.1.html b/tiff/html/v3.8.1.html
index 0fe7d9c0..d53bb1fb 100644
--- a/tiff/html/v3.8.1.html
+++ b/tiff/html/v3.8.1.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.8.2.html b/tiff/html/v3.8.2.html
index 41bb2e55..7a33181b 100644
--- a/tiff/html/v3.8.2.html
+++ b/tiff/html/v3.8.2.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.9.0beta.html b/tiff/html/v3.9.0beta.html
index 56f32ed3..ef6214ad 100644
--- a/tiff/html/v3.9.0beta.html
+++ b/tiff/html/v3.9.0beta.html
@@ -32,7 +32,7 @@ If you don't find something listed here, then it was not done in this
timeframe, or it was not considered important enough to be mentioned.
The following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
@@ -74,7 +74,7 @@ The following information is located here:
tif_config.vc.h for easier identification by folks using an IDE.
<li> configure, configure.ac: OJPEG support enabled by default (i.e.,
- whe the conformant JPEG support enabled).
+ when conformant JPEG support is enabled).
<li> README.vms, Makefile.am, configure.com, libtiff/{Makefile.am,
tif_config.h-vms, tif_stream.cxx, tif_vms.c, tiffconf.h-vms}:
diff --git a/tiff/html/v3.9.1.html b/tiff/html/v3.9.1.html
index 1f369a83..2f5a7afa 100644
--- a/tiff/html/v3.9.1.html
+++ b/tiff/html/v3.9.1.html
@@ -32,7 +32,7 @@ find something listed here, then it was not done in this timeframe, or
it was not considered important enough to be mentioned. The following
information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v3.9.2.html b/tiff/html/v3.9.2.html
index a190a301..8bd9dc85 100644
--- a/tiff/html/v3.9.2.html
+++ b/tiff/html/v3.9.2.html
@@ -32,7 +32,7 @@ find something listed here, then it was not done in this timeframe, or
it was not considered important enough to be mentioned. The following
information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v4.0.0.html b/tiff/html/v4.0.0.html
index a7e9bb63..d9b4c2bd 100644
--- a/tiff/html/v4.0.0.html
+++ b/tiff/html/v4.0.0.html
@@ -33,7 +33,7 @@ it was not considered important enough to be mentioned. Please consult
the ChangeLog file in the source package for full change details. The
following information is located here:
<UL>
-<LI><A HREF="#hightlights">Major Changes</A>
+<LI><A HREF="#highlights">Major Changes</A>
<LI><A HREF="#configure">Changes in the software configuration</A>
<LI><A HREF="#libtiff">Changes in libtiff</A>
<LI><A HREF="#tools">Changes in the tools</A>
diff --git a/tiff/html/v4.0.4beta.html b/tiff/html/v4.0.4beta.html
index e9e70a55..66e451a8 100644
--- a/tiff/html/v4.0.4beta.html
+++ b/tiff/html/v4.0.4beta.html
@@ -112,7 +112,7 @@ information is located here:
putcontig8bitYCbCr21tile cases.
<li> in TIFFDefaultDirectory(), reset any already existing
- extented tags installed by user code through the extender mechaninm before
+ extended tags installed by user code through the extender mechaninm before
calling the extender callback (GDAL #5054)
<li> Fix warnings about unused parameters.
diff --git a/tiff/html/v4.0.7.html b/tiff/html/v4.0.7.html
index 4f92c129..dab75df8 100644
--- a/tiff/html/v4.0.7.html
+++ b/tiff/html/v4.0.7.html
@@ -252,7 +252,7 @@ information is located here:
tif_encodestrip() as documented
<LI> libtiff/tif_dumpmode.c: DumpModeEncode() should return 0 in
- case of failure so that the above mentionned functions detect
+ case of failure so that the above mentioned functions detect
the error.
<LI> libtiff/*.c: fix MSVC warnings related to cast shortening and
diff --git a/tiff/html/v4.0.8.html b/tiff/html/v4.0.8.html
index bd3f751c..456f2bdb 100644
--- a/tiff/html/v4.0.8.html
+++ b/tiff/html/v4.0.8.html
@@ -98,7 +98,7 @@ information is located here:
makes it unnecessary.
<LI> libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip()
- to instanciate compute ntrips as
+ to instantiate compute ntrips as
TIFFhowmany_32(td->td_imagelength, rowsperstrip), instead of a
logic based on the total size of data. Which is faulty is the
total size of data is not sufficient to fill the whole image,
diff --git a/tiff/html/v4.0.9.html b/tiff/html/v4.0.9.html
index 19b370a4..6ab33510 100644
--- a/tiff/html/v4.0.9.html
+++ b/tiff/html/v4.0.9.html
@@ -170,7 +170,7 @@ information is located here:
scans and not interleavedin a single one, needs to allocate memory (or
backing store) for the whole strip/tile.
See http://www.libjpeg-turbo.org/pmwiki/uploads/About/TwoIssueswiththeJPEGStandard.pdf
- This limitation may be overriden by setting the
+ This limitation may be overridden by setting the
LIBTIFF_ALLOW_LARGE_LIBJPEG_MEM_ALLOC environment variable, or recompiling
libtiff with a custom value of TIFF_LIBJPEG_LARGEST_MEM_ALLOC macro.
<LI> libtiff/tif_jbig.c: fix memory leak in error code path of JBIGDecode()
diff --git a/tiff/html/v4.1.0.html b/tiff/html/v4.1.0.html
index 80dac5bf..4828bcc0 100644
--- a/tiff/html/v4.1.0.html
+++ b/tiff/html/v4.1.0.html
@@ -59,12 +59,12 @@ hr {
<div style="margin-left: 3em">
<HR SIZE=4 ALIGN=left>
<B>Current Version</B>: v4.1.0<BR>
-<B>Previous Version</B>: <A HREF=v4.0.10.html>v4.0.10</a><BR>
-<B>Master Download Site</B>: <A HREF="https://download.osgeo.org/libtiff">
-download.osgeo.org</a>, directory pub/libtiff<<BR>
-<B>Master HTTP Site #1</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+<B>Previous Version</B>: <A HREF=v4.0.10.html>v4.0.10</A><BR>
+<B>Master Download Site</B>: <A HREF="https://download.osgeo.org/libtiff"</A>
+download.osgeo.org</a>, directory pub/libtiff<BR>
+<B>Master HTTP Site #1</B>: <A HREF="http://www.simplesystems.org/libtiff/"</A>
http://www.simplesystems.org/libtiff/</a><BR>
-<B>Master HTTP Site #2</B>: <A HREF="http://libtiff.maptools.org/">
+<B>Master HTTP Site #2</B>: <A HREF="http://libtiff.maptools.org/"</A>
http://libtiff.maptools.org/</a>
<HR SIZE=4 ALIGN=left>
</div>
diff --git a/tiff/html/v4.2.0.html b/tiff/html/v4.2.0.html
index c81ecdd2..58d0bfc3 100644
--- a/tiff/html/v4.2.0.html
+++ b/tiff/html/v4.2.0.html
@@ -59,12 +59,14 @@ hr {
<div style="margin-left: 3em">
<HR SIZE=4 ALIGN=left>
<B>Current Version</B>: v4.2.0<BR>
-<B>Previous Version</B>: <A HREF=v4.1.0.html>v4.1.0</a><BR>
+<B>Previous Version</B>: <A HREF="v4.1.0.html">v4.1.0</A><BR>
<B>Master Download Site</B>: <A HREF="https://download.osgeo.org/libtiff">
-download.osgeo.org</a>, directory pub/libtiff<<BR>
+download.osgeo.org</a>, directory pub/libtiff<BR>
<B>Master HTTP Site #1</B>: <A HREF="http://www.simplesystems.org/libtiff/">
-http://www.simplesystems.org/libtiff/</a><BR>
-<B>Master HTTP Site #2</B>: <A HREF="http://libtiff.maptools.org/">
+ http://www.simplesystems.org/libtiff/</A><BR>
+<B>Master HTTP Site #2</B>: <A HREF="https://libtiff.gitlab.io/libtiff/">
+ https://libtiff.gitlab.io/libtiff/</A><BR>
+<B>Master HTTP Site #3</B>: <A HREF="http://libtiff.maptools.org/">
http://libtiff.maptools.org/</a>
<HR SIZE=4 ALIGN=left>
</div>
diff --git a/tiff/html/v4.3.0.html b/tiff/html/v4.3.0.html
new file mode 100644
index 00000000..64f9fa7f
--- /dev/null
+++ b/tiff/html/v4.3.0.html
@@ -0,0 +1,186 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+<TITLE>
+ Changes in TIFF v4.3.0
+</TITLE>
+<STYLE TYPE="text/css">
+body {
+ font-family: Helvetica, Arial, Sans;
+}
+table, th, td {
+ border: 1px solid black;
+ border-collapse: collapse;
+}
+th, td {
+ padding: 8pt;
+ text-align: center;
+}
+th {
+ text-align: center;
+}
+td {
+ text-align: center;
+}
+
+ul li {
+ padding: 3pt;
+}
+
+ul.a {
+ list-style-type: circle;
+}
+
+ul.b {
+ list-style-type: square;
+}
+
+ol.c {
+ list-style-type: upper-roman;
+}
+
+ol.d {
+ list-style-type: lower-alpha;
+}
+
+hr {
+ width: 65%;
+}
+
+</STYLE>
+</HEAD>
+
+<BODY BGCOLOR=white>
+
+<BASEFONT SIZE=4>
+<B><FONT SIZE="+3">T</FONT>IFF <FONT SIZE="+2">C</FONT>HANGE <FONT SIZE="+2">I</FONT>NFORMATION</B>
+<BASEFONT SIZE=3>
+
+<div style="margin-left: 3em">
+<HR SIZE=4 ALIGN=left>
+<B>Current Version</B>: v4.3.0<BR>
+<B>Previous Version</B>: <A HREF="v4.2.0.html">v4.2.0</A><BR>
+<B>Master Download Site</B>: <A HREF="https://download.osgeo.org/libtiff">
+download.osgeo.org</a>, directory pub/libtiff<BR>
+<B>Master HTTP Site #1</B>: <A HREF="http://www.simplesystems.org/libtiff/">
+ http://www.simplesystems.org/libtiff/</A><BR>
+<B>Master HTTP Site #2</B>: <A HREF="https://libtiff.gitlab.io/libtiff/">
+ https://libtiff.gitlab.io/libtiff/</A><BR>
+<B>Master HTTP Site #3</B>: <A HREF="http://libtiff.maptools.org/">
+http://libtiff.maptools.org/</a>
+<HR SIZE=4 ALIGN=left>
+</div>
+
+<P>
+This document provides a summary of significant changes made to the
+software between the <I>previous</I> and <I>current</I> versions (see
+above). A fully-detailed change summary is provided by the ChangeLog file
+included in the release package and by the Git commit history:
+<UL>
+<LI><A HREF="#highlights">Major Changes</A>
+<LI><A HREF="#configure">Changes in the software configuration</A>
+<LI><A HREF="#libtiff">Changes in libtiff</A>
+<LI><A HREF="#tools">Changes in the tools</A>
+<LI><A HREF="#contrib">Changes in the contrib area</A>
+</UL>
+<p>
+<P><HR ALIGN=left>
+
+<!-- ============================================================= -->
+
+<A NAME="highlights"><B><FONT SIZE="+3">M</FONT>AJOR CHANGES:</B></A>
+
+<UL>
+
+ <LI>Build and usage of the library and its utilities requires a C99 capable
+ compiler.</LI>
+
+ <LI>New optional codec for the LERC (Limited Error Raster Compression) compression scheme.
+ To have it available, configure libtiff against the SDK available at
+ https://github.com/esri/lerc</LI>
+
+ <LI>CMake build: revamp of build scripts</LI>
+</UL>
+
+
+<P><HR ALIGN=left>
+<!-- ============================================================= -->
+
+<A NAME="configure"><B><FONT SIZE="+3">C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>
+
+<UL>
+
+ <LI>cmake: revamp of the cmake build scripts. There are impacts on the case of
+ some options.</LI>
+
+ <LI>cmake: update minimum version and policy version to 3.9.</LI>
+
+ <LI>Remove NMake build support. The functionality provided by the NMake build
+ is now completely superseded by the CMake build.</LI>
+
+ <LI>Remove antiquated Scons and makefile.lcc build support.</LI>
+
+ <LI>Remove non-functional VMS and WinCE support.</LI>
+
+ <LI>autogen.sh now updates config.guess and config.sub from master gnulib version.</LI>
+
+</UL>
+
+<P><HR ALIGN=left>
+
+<!-- ============================================================= -->
+
+<A NAME="libtiff"><B><FONT SIZE="+3">C</FONT>HANGES IN LIBTIFF:</B></A>
+
+<UL>
+
+ <LI>Use of "int8", "uint8", "int16", "uint16", "int32", "uint32", "int64", "uint64"
+ typedefs is now deprecated. libtiff code and headers no longer use them,
+ and use their C99 standard equivalents (with "_t" suffix). Those typedefs
+ are still available, with deprecation warnings, but external code is strongly
+ encouraged to use the corresponding C99 stdint.h types. The deprecated
+ types might be removed in a future release.</LI>
+
+ <LI>Removal of unused, or now useless due to C99 availability, functions in port/</LI>
+
+ <LI>A few issues spotted by static code analysis tools fixed. Compiler
+ warnings addressed.</LI>
+</UL>
+
+<P><HR ALIGN=left>
+
+<!-- ============================================================= -->
+
+<A NAME="tools"><B><FONT SIZE="+3">C</FONT>HANGES IN THE TOOLS:</B></A>
+
+<UL>
+
+ <LI>In usage text, insert a line of text summarizing each tool's purpose </LI>
+
+ <LI>tiff tools: made display of compression methods and their parameters
+ conditional on their actual availability</LI>
+
+ <LI>tiff2ps: exit the loop in case of error (#232)</LI>
+
+ <LI>tiff2pdf: check that tiff_datasize fits in a signed tsize_t (#202)</LI>
+
+ <LI>tiffsplit: exit with EXIT_FAILURE if there are extra args on the command line</LI>
+
+ <LI>tiffcmp: fix comparaison with pixels that are fractional number of bytes (#53)</LI>
+
+</UL>
+
+<P><HR ALIGN=left>
+
+<!-- ============================================================= -->
+
+<A NAME="contrib"><B><FONT SIZE="+3">C</FONT>HANGES IN THE CONTRIB AREA:</B></A>
+
+<UL>
+
+ <LI>iptcutil.c - set '#ifdef _WIN32' (was '#ifdef WIN32', which failed at build time)</LI>
+
+</UL>
+
+</BODY>
+</HTML>
diff --git a/tiff/libtiff/CMakeLists.txt b/tiff/libtiff/CMakeLists.txt
index 080685db..90105b28 100644..100755
--- a/tiff/libtiff/CMakeLists.txt
+++ b/tiff/libtiff/CMakeLists.txt
@@ -30,97 +30,112 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tiffconf.h.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h
@ONLY)
-extra_dist(
- SConstruct
- tif_config.h-vms
- tif_config.vc.h
- tif_config.wince.h
- tiffconf.vc.h
- tiffconf.wince.h
- libtiff.def
- libtiff.map
- libtiffxx.map)
-
-set(tiff_HEADERS
- tiff.h
- tiffio.h
- tiffvers.h)
-
-set(tiff_noinst_HEADERS
- t4.h
- tif_dir.h
- tif_predict.h
- tiffiop.h
- uvcode.h)
-
-set(nodist_tiff_HEADERS
- ${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h)
-
-set(tiff_SOURCES
- tif_aux.c
- tif_close.c
- tif_codec.c
- tif_color.c
- tif_compress.c
- tif_dir.c
- tif_dirinfo.c
- tif_dirread.c
- tif_dirwrite.c
- tif_dumpmode.c
- tif_error.c
- tif_extension.c
- tif_fax3.c
- tif_fax3sm.c
- tif_flush.c
- tif_getimage.c
- tif_jbig.c
- tif_jpeg.c
- tif_jpeg_12.c
- tif_luv.c
- tif_lzma.c
- tif_lzw.c
- tif_next.c
- tif_ojpeg.c
- tif_open.c
- tif_packbits.c
- tif_pixarlog.c
- tif_predict.c
- tif_print.c
- tif_read.c
- tif_strip.c
- tif_swab.c
- tif_thunder.c
- tif_tile.c
- tif_version.c
- tif_warning.c
- tif_webp.c
- tif_write.c
- tif_zip.c
- tif_zstd.c)
-
-set(tiffxx_HEADERS
- tiffio.hxx)
-
-set(tiffxx_SOURCES
- tif_stream.cxx)
+set(tiff_public_HEADERS
+ tiff.h
+ tiffio.h
+ tiffvers.h
+ ${CMAKE_CURRENT_BINARY_DIR}/tiffconf.h)
+
+set(tiff_private_HEADERS
+ t4.h
+ tif_dir.h
+ tif_predict.h
+ tiffiop.h
+ uvcode.h
+ ${CMAKE_CURRENT_BINARY_DIR}/tif_config.h)
+
+
+add_library(tiff libtiff.def)
+
+target_sources(tiff PRIVATE
+ ${tiff_public_HEADERS}
+ ${tiff_private_HEADERS}
+ tif_aux.c
+ tif_close.c
+ tif_codec.c
+ tif_color.c
+ tif_compress.c
+ tif_dir.c
+ tif_dirinfo.c
+ tif_dirread.c
+ tif_dirwrite.c
+ tif_dumpmode.c
+ tif_error.c
+ tif_extension.c
+ tif_fax3.c
+ tif_fax3sm.c
+ tif_flush.c
+ tif_getimage.c
+ tif_jbig.c
+ tif_jpeg.c
+ tif_jpeg_12.c
+ tif_lerc.c
+ tif_luv.c
+ tif_lzma.c
+ tif_lzw.c
+ tif_next.c
+ tif_ojpeg.c
+ tif_open.c
+ tif_packbits.c
+ tif_pixarlog.c
+ tif_predict.c
+ tif_print.c
+ tif_read.c
+ tif_strip.c
+ tif_swab.c
+ tif_thunder.c
+ tif_tile.c
+ tif_version.c
+ tif_warning.c
+ tif_webp.c
+ tif_write.c
+ tif_zip.c
+ tif_zstd.c)
if(USE_WIN32_FILEIO)
- extra_dist(tif_unix.c)
- list(APPEND tiff_SOURCES tif_win32.c)
+ target_sources(tiff PRIVATE tif_win32.c)
else()
- extra_dist(tif_win32.c)
- list(APPEND tiff_SOURCES tif_unix.c)
+ target_sources(tiff PRIVATE tif_unix.c)
endif()
-add_library(tiff ${tiff_SOURCES} ${tiff_HEADERS} ${nodist_tiff_HEADERS}
- ${tiff_port_SOURCES} libtiff.def)
target_include_directories(tiff
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+ PRIVATE
${TIFF_INCLUDES}
)
-target_link_libraries(tiff ${TIFF_LIBRARY_DEPS})
+
+if(ZIP_SUPPORT)
+ target_link_libraries(tiff PRIVATE ZLIB::ZLIB)
+endif()
+if(ZIP_SUPPORT AND LIBDEFLATE_SUPPORT)
+ target_link_libraries(tiff PRIVATE Deflate::Deflate)
+endif()
+if(JPEG_SUPPORT)
+ target_link_libraries(tiff PRIVATE JPEG::JPEG)
+ if(JPEG_DUAL_MODE_8_12)
+ target_include_directories(tiff PRIVATE ${JPEG12_INCLUDE_DIR})
+ target_link_libraries(tiff PRIVATE ${JPEG12_LIBRARIES})
+ endif()
+endif()
+if(JBIG_SUPPORT)
+ target_link_libraries(tiff PRIVATE JBIG::JBIG)
+endif()
+if(LERC_SUPPORT)
+ target_link_libraries(tiff PRIVATE LERC::LERC)
+endif()
+if(LZMA_SUPPORT)
+ target_link_libraries(tiff PRIVATE LibLZMA::LibLZMA)
+endif()
+if(ZSTD_SUPPORT)
+ target_link_libraries(tiff PRIVATE ZSTD::ZSTD)
+endif()
+if(WEBP_SUPPORT)
+ target_link_libraries(tiff PRIVATE WebP::WebP)
+endif()
+target_link_libraries(tiff PRIVATE CMath::CMath)
+
set_target_properties(tiff PROPERTIES SOVERSION ${SO_COMPATVERSION})
if(NOT CYGWIN)
# This property causes shared libraries on Linux to have the full version
@@ -139,11 +154,17 @@ install(TARGETS tiff
LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})
-install(FILES ${tiff_HEADERS} ${nodist_tiff_HEADERS}
+install(FILES ${tiff_public_HEADERS}
DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
if(CXX_SUPPORT)
- add_library(tiffxx ${tiffxx_SOURCES} ${tiffxx_HEADERS})
+ set(tiffxx_HEADERS
+ tiffio.hxx)
+
+ add_library(tiffxx)
+ target_sources(tiffxx PRIVATE
+ ${tiffxx_HEADERS}
+ tif_stream.cxx)
target_link_libraries(tiffxx tiff)
set_target_properties(tiffxx PROPERTIES SOVERSION ${SO_COMPATVERSION})
if(NOT CYGWIN)
@@ -167,3 +188,13 @@ if(CXX_SUPPORT)
DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
endif()
+
+add_executable(mkg3states)
+target_sources(mkg3states PRIVATE mkg3states.c tif_fax3.h)
+target_link_libraries(mkg3states tiff port)
+
+add_custom_target(faxtable
+ DEPENDS mkg3states
+ COMMAND ${CMAKE_COMMAND} -E rm "tif_fax3sm.c"
+ COMMAND mkg3states -b -c const "tif_fax3sm.c"
+ WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
diff --git a/tiff/libtiff/Makefile.am b/tiff/libtiff/Makefile.am
index 14a250a5..44522b62 100644
--- a/tiff/libtiff/Makefile.am
+++ b/tiff/libtiff/Makefile.am
@@ -29,18 +29,11 @@ libtiffincludedir = $(includedir)
EXTRA_DIST = \
CMakeLists.txt \
- Makefile.vc \
- SConstruct \
libtiff.def \
libtiff.map \
libtiffxx.map \
- tif_config.h-vms \
tif_config.h.cmake.in \
- tif_config.vc.h \
- tif_config.wince.h \
- tiffconf.h.cmake.in \
- tiffconf.vc.h \
- tiffconf.wince.h
+ tiffconf.h.cmake.in
libtiffinclude_HEADERS = \
tiff.h \
@@ -81,6 +74,7 @@ libtiff_la_SOURCES = \
tif_jbig.c \
tif_jpeg.c \
tif_jpeg_12.c \
+ tif_lerc.c \
tif_luv.c \
tif_lzma.c \
tif_lzw.c \
@@ -128,7 +122,6 @@ endif
if HAVE_LD_VERSION_SCRIPT
libtiff_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtiff.map
endif
-libtiff_la_LIBADD = $(LIBPORT)
libtiffxx_la_LDFLAGS = \
-no-undefined \
@@ -139,7 +132,7 @@ endif
if HAVE_LD_VERSION_SCRIPT
libtiffxx_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libtiffxx.map
endif
-libtiffxx_la_LIBADD = $(LIBTIFF) $(LIBPORT)
+libtiffxx_la_LIBADD = $(LIBTIFF)
libtiffxx_la_DEPENDENCIES = libtiff.la
#
@@ -154,3 +147,4 @@ mkg3states_LDADD = $(LIBPORT)
faxtable: mkg3states
(rm -f tif_fax3sm.c && ./mkg3states -b -c const tif_fax3sm.c)
+AM_CPPFLAGS = -I$(top_srcdir)/libtiff -I$(top_srcdir)/port
diff --git a/tiff/libtiff/Makefile.in b/tiff/libtiff/Makefile.in
index 2f853ea5..40b78797 100644
--- a/tiff/libtiff/Makefile.in
+++ b/tiff/libtiff/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -137,7 +137,8 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(am__libtiffinclude_HEADERS_DIST) \
$(noinst_HEADERS) $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = tif_config.h tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h tif_config.h tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
PROGRAMS = $(noinst_PROGRAMS)
@@ -172,17 +173,17 @@ am__installdirs = "$(DESTDIR)$(libdir)" \
"$(DESTDIR)$(libtiffincludedir)" \
"$(DESTDIR)$(libtiffincludedir)"
LTLIBRARIES = $(lib_LTLIBRARIES)
-libtiff_la_DEPENDENCIES = $(LIBPORT)
+libtiff_la_LIBADD =
am__libtiff_la_SOURCES_DIST = tif_aux.c tif_close.c tif_codec.c \
tif_color.c tif_compress.c tif_dir.c tif_dirinfo.c \
tif_dirread.c tif_dirwrite.c tif_dumpmode.c tif_error.c \
tif_extension.c tif_fax3.c tif_fax3sm.c tif_flush.c \
- tif_getimage.c tif_jbig.c tif_jpeg.c tif_jpeg_12.c tif_luv.c \
- tif_lzma.c tif_lzw.c tif_next.c tif_ojpeg.c tif_open.c \
- tif_packbits.c tif_pixarlog.c tif_predict.c tif_print.c \
- tif_read.c tif_strip.c tif_swab.c tif_thunder.c tif_tile.c \
- tif_version.c tif_warning.c tif_webp.c tif_write.c tif_zip.c \
- tif_zstd.c tif_win32.c tif_unix.c
+ tif_getimage.c tif_jbig.c tif_jpeg.c tif_jpeg_12.c tif_lerc.c \
+ tif_luv.c tif_lzma.c tif_lzw.c tif_next.c tif_ojpeg.c \
+ tif_open.c tif_packbits.c tif_pixarlog.c tif_predict.c \
+ tif_print.c tif_read.c tif_strip.c tif_swab.c tif_thunder.c \
+ tif_tile.c tif_version.c tif_warning.c tif_webp.c tif_write.c \
+ tif_zip.c tif_zstd.c tif_win32.c tif_unix.c
@WIN32_IO_TRUE@am__objects_1 = tif_win32.lo
@WIN32_IO_FALSE@am__objects_2 = tif_unix.lo
am_libtiff_la_OBJECTS = tif_aux.lo tif_close.lo tif_codec.lo \
@@ -190,11 +191,11 @@ am_libtiff_la_OBJECTS = tif_aux.lo tif_close.lo tif_codec.lo \
tif_dirread.lo tif_dirwrite.lo tif_dumpmode.lo tif_error.lo \
tif_extension.lo tif_fax3.lo tif_fax3sm.lo tif_flush.lo \
tif_getimage.lo tif_jbig.lo tif_jpeg.lo tif_jpeg_12.lo \
- tif_luv.lo tif_lzma.lo tif_lzw.lo tif_next.lo tif_ojpeg.lo \
- tif_open.lo tif_packbits.lo tif_pixarlog.lo tif_predict.lo \
- tif_print.lo tif_read.lo tif_strip.lo tif_swab.lo \
- tif_thunder.lo tif_tile.lo tif_version.lo tif_warning.lo \
- tif_webp.lo tif_write.lo tif_zip.lo tif_zstd.lo \
+ tif_lerc.lo tif_luv.lo tif_lzma.lo tif_lzw.lo tif_next.lo \
+ tif_ojpeg.lo tif_open.lo tif_packbits.lo tif_pixarlog.lo \
+ tif_predict.lo tif_print.lo tif_read.lo tif_strip.lo \
+ tif_swab.lo tif_thunder.lo tif_tile.lo tif_version.lo \
+ tif_warning.lo tif_webp.lo tif_write.lo tif_zip.lo tif_zstd.lo \
$(am__objects_1) $(am__objects_2)
libtiff_la_OBJECTS = $(am_libtiff_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
@@ -225,7 +226,7 @@ AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/port
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/mkg3states.Po \
@@ -238,19 +239,19 @@ am__depfiles_remade = ./$(DEPDIR)/mkg3states.Po \
./$(DEPDIR)/tif_fax3.Plo ./$(DEPDIR)/tif_fax3sm.Plo \
./$(DEPDIR)/tif_flush.Plo ./$(DEPDIR)/tif_getimage.Plo \
./$(DEPDIR)/tif_jbig.Plo ./$(DEPDIR)/tif_jpeg.Plo \
- ./$(DEPDIR)/tif_jpeg_12.Plo ./$(DEPDIR)/tif_luv.Plo \
- ./$(DEPDIR)/tif_lzma.Plo ./$(DEPDIR)/tif_lzw.Plo \
- ./$(DEPDIR)/tif_next.Plo ./$(DEPDIR)/tif_ojpeg.Plo \
- ./$(DEPDIR)/tif_open.Plo ./$(DEPDIR)/tif_packbits.Plo \
- ./$(DEPDIR)/tif_pixarlog.Plo ./$(DEPDIR)/tif_predict.Plo \
- ./$(DEPDIR)/tif_print.Plo ./$(DEPDIR)/tif_read.Plo \
- ./$(DEPDIR)/tif_stream.Plo ./$(DEPDIR)/tif_strip.Plo \
- ./$(DEPDIR)/tif_swab.Plo ./$(DEPDIR)/tif_thunder.Plo \
- ./$(DEPDIR)/tif_tile.Plo ./$(DEPDIR)/tif_unix.Plo \
- ./$(DEPDIR)/tif_version.Plo ./$(DEPDIR)/tif_warning.Plo \
- ./$(DEPDIR)/tif_webp.Plo ./$(DEPDIR)/tif_win32.Plo \
- ./$(DEPDIR)/tif_write.Plo ./$(DEPDIR)/tif_zip.Plo \
- ./$(DEPDIR)/tif_zstd.Plo
+ ./$(DEPDIR)/tif_jpeg_12.Plo ./$(DEPDIR)/tif_lerc.Plo \
+ ./$(DEPDIR)/tif_luv.Plo ./$(DEPDIR)/tif_lzma.Plo \
+ ./$(DEPDIR)/tif_lzw.Plo ./$(DEPDIR)/tif_next.Plo \
+ ./$(DEPDIR)/tif_ojpeg.Plo ./$(DEPDIR)/tif_open.Plo \
+ ./$(DEPDIR)/tif_packbits.Plo ./$(DEPDIR)/tif_pixarlog.Plo \
+ ./$(DEPDIR)/tif_predict.Plo ./$(DEPDIR)/tif_print.Plo \
+ ./$(DEPDIR)/tif_read.Plo ./$(DEPDIR)/tif_stream.Plo \
+ ./$(DEPDIR)/tif_strip.Plo ./$(DEPDIR)/tif_swab.Plo \
+ ./$(DEPDIR)/tif_thunder.Plo ./$(DEPDIR)/tif_tile.Plo \
+ ./$(DEPDIR)/tif_unix.Plo ./$(DEPDIR)/tif_version.Plo \
+ ./$(DEPDIR)/tif_warning.Plo ./$(DEPDIR)/tif_webp.Plo \
+ ./$(DEPDIR)/tif_win32.Plo ./$(DEPDIR)/tif_write.Plo \
+ ./$(DEPDIR)/tif_zip.Plo ./$(DEPDIR)/tif_zstd.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -301,8 +302,8 @@ am__libtiffinclude_HEADERS_DIST = tiff.h tiffio.h tiffvers.h \
tiffio.hxx
HEADERS = $(libtiffinclude_HEADERS) $(nodist_libtiffinclude_HEADERS) \
$(noinst_HEADERS)
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
- tif_config.h.in tiffconf.h.in
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)tif_config.h.in tiffconf.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
@@ -463,6 +464,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -475,11 +477,9 @@ top_srcdir = @top_srcdir@
LIBPORT = $(top_builddir)/port/libport.la
LIBTIFF = $(top_builddir)/libtiff/libtiff.la
libtiffincludedir = $(includedir)
-EXTRA_DIST = CMakeLists.txt Makefile.vc SConstruct libtiff.def \
- libtiff.map libtiffxx.map tif_config.h-vms \
- tif_config.h.cmake.in tif_config.vc.h tif_config.wince.h \
- tiffconf.h.cmake.in tiffconf.vc.h tiffconf.wince.h \
- $(am__append_2) $(am__append_4)
+EXTRA_DIST = CMakeLists.txt libtiff.def libtiff.map libtiffxx.map \
+ tif_config.h.cmake.in tiffconf.h.cmake.in $(am__append_2) \
+ $(am__append_4)
libtiffinclude_HEADERS = tiff.h tiffio.h tiffvers.h $(am__append_1)
noinst_HEADERS = \
t4.h \
@@ -495,8 +495,8 @@ libtiff_la_SOURCES = tif_aux.c tif_close.c tif_codec.c tif_color.c \
tif_compress.c tif_dir.c tif_dirinfo.c tif_dirread.c \
tif_dirwrite.c tif_dumpmode.c tif_error.c tif_extension.c \
tif_fax3.c tif_fax3sm.c tif_flush.c tif_getimage.c tif_jbig.c \
- tif_jpeg.c tif_jpeg_12.c tif_luv.c tif_lzma.c tif_lzw.c \
- tif_next.c tif_ojpeg.c tif_open.c tif_packbits.c \
+ tif_jpeg.c tif_jpeg_12.c tif_lerc.c tif_luv.c tif_lzma.c \
+ tif_lzw.c tif_next.c tif_ojpeg.c tif_open.c tif_packbits.c \
tif_pixarlog.c tif_predict.c tif_print.c tif_read.c \
tif_strip.c tif_swab.c tif_thunder.c tif_tile.c tif_version.c \
tif_warning.c tif_webp.c tif_write.c tif_zip.c tif_zstd.c \
@@ -507,13 +507,13 @@ libtiffxx_la_SOURCES = \
lib_LTLIBRARIES = libtiff.la $(am__append_6)
libtiff_la_LDFLAGS = -no-undefined -version-info \
$(LIBTIFF_VERSION_INFO) $(am__append_7) $(am__append_8)
-libtiff_la_LIBADD = $(LIBPORT)
libtiffxx_la_LDFLAGS = -no-undefined -version-info \
$(LIBTIFF_VERSION_INFO) $(am__append_9) $(am__append_10)
-libtiffxx_la_LIBADD = $(LIBTIFF) $(LIBPORT)
+libtiffxx_la_LIBADD = $(LIBTIFF)
libtiffxx_la_DEPENDENCIES = libtiff.la
mkg3states_SOURCES = mkg3states.c tif_fax3.h
mkg3states_LDADD = $(LIBPORT)
+AM_CPPFLAGS = -I$(top_srcdir)/libtiff -I$(top_srcdir)/port
all: tif_config.h tiffconf.h
$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -549,28 +549,24 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
-tif_config.h: stamp-h1
- @test -f $@ || rm -f stamp-h1
- @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
-
-stamp-h1: $(srcdir)/tif_config.h.in $(top_builddir)/config.status
- @rm -f stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status libtiff/tif_config.h
-$(srcdir)/tif_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f stamp-h1
- touch $@
-
-tiffconf.h: stamp-h2
+tif_config.h: stamp-h2
@test -f $@ || rm -f stamp-h2
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2
-stamp-h2: $(srcdir)/tiffconf.h.in $(top_builddir)/config.status
+stamp-h2: $(srcdir)/tif_config.h.in $(top_builddir)/config.status
@rm -f stamp-h2
+ cd $(top_builddir) && $(SHELL) ./config.status libtiff/tif_config.h
+
+tiffconf.h: stamp-h3
+ @test -f $@ || rm -f stamp-h3
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h3
+
+stamp-h3: $(srcdir)/tiffconf.h.in $(top_builddir)/config.status
+ @rm -f stamp-h3
cd $(top_builddir) && $(SHELL) ./config.status libtiff/tiffconf.h
distclean-hdr:
- -rm -f tif_config.h stamp-h1 tiffconf.h stamp-h2
+ -rm -f tif_config.h stamp-h2 tiffconf.h stamp-h3
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
@@ -652,6 +648,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jbig.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_jpeg_12.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lerc.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_luv.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzma.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tif_lzw.Plo@am__quote@ # am--include-marker
@@ -922,6 +919,7 @@ distclean: distclean-am
-rm -f ./$(DEPDIR)/tif_jbig.Plo
-rm -f ./$(DEPDIR)/tif_jpeg.Plo
-rm -f ./$(DEPDIR)/tif_jpeg_12.Plo
+ -rm -f ./$(DEPDIR)/tif_lerc.Plo
-rm -f ./$(DEPDIR)/tif_luv.Plo
-rm -f ./$(DEPDIR)/tif_lzma.Plo
-rm -f ./$(DEPDIR)/tif_lzw.Plo
@@ -1012,6 +1010,7 @@ maintainer-clean: maintainer-clean-am
-rm -f ./$(DEPDIR)/tif_jbig.Plo
-rm -f ./$(DEPDIR)/tif_jpeg.Plo
-rm -f ./$(DEPDIR)/tif_jpeg_12.Plo
+ -rm -f ./$(DEPDIR)/tif_lerc.Plo
-rm -f ./$(DEPDIR)/tif_luv.Plo
-rm -f ./$(DEPDIR)/tif_lzma.Plo
-rm -f ./$(DEPDIR)/tif_lzw.Plo
diff --git a/tiff/libtiff/Makefile.vc b/tiff/libtiff/Makefile.vc
deleted file mode 100644
index 5aac3310..00000000
--- a/tiff/libtiff/Makefile.vc
+++ /dev/null
@@ -1,100 +0,0 @@
-# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee, provided
-# that (i) the above copyright notices and this permission notice appear in
-# all copies of the software and related documentation, and (ii) the names of
-# Sam Leffler and Silicon Graphics may not be used in any advertising or
-# publicity relating to the software without the specific, prior written
-# permission of Sam Leffler and Silicon Graphics.
-#
-# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-#
-# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
-# Makefile for MS Visual C and Watcom C compilers.
-#
-# To build:
-# C:\libtiff\libtiff> nmake /f makefile.vc all
-#
-
-!INCLUDE ..\nmake.opt
-
-INCL = -I. $(JPEG_INCLUDE) $(ZLIB_INCLUDE) $(JBIG_INCLUDE)
-
-!IFDEF USE_WIN_CRT_LIB
-OBJ_SYSDEP_MODULE = tif_unix.obj
-!ELSE
-OBJ_SYSDEP_MODULE = tif_win32.obj
-!ENDIF
-
-OBJ = \
- tif_aux.obj \
- tif_close.obj \
- tif_codec.obj \
- tif_color.obj \
- tif_compress.obj \
- tif_dir.obj \
- tif_dirinfo.obj \
- tif_dirread.obj \
- tif_dirwrite.obj \
- tif_dumpmode.obj \
- tif_error.obj \
- tif_extension.obj \
- tif_fax3.obj \
- tif_fax3sm.obj \
- tif_getimage.obj \
- tif_jbig.obj \
- tif_jpeg.obj \
- tif_jpeg_12.obj \
- tif_ojpeg.obj \
- tif_flush.obj \
- tif_luv.obj \
- tif_lzw.obj \
- tif_next.obj \
- tif_open.obj \
- tif_packbits.obj \
- tif_pixarlog.obj \
- tif_predict.obj \
- tif_print.obj \
- tif_read.obj \
- tif_stream.obj \
- tif_swab.obj \
- tif_strip.obj \
- tif_thunder.obj \
- tif_tile.obj \
- tif_version.obj \
- tif_warning.obj \
- tif_write.obj \
- tif_zip.obj \
- $(OBJ_SYSDEP_MODULE)
-
-all: libtiff.lib $(DLLNAME)
-
-tif_config.h: tif_config.vc.h
- copy tif_config.vc.h tif_config.h
-
-tiffconf.h: tiffconf.vc.h
- copy tiffconf.vc.h tiffconf.h
-
-libtiff.lib: tif_config.h tiffconf.h $(OBJ)
- $(AR) /out:libtiff.lib ..\port\libport.lib $(OBJ) $(LIBS)
-
-$(DLLNAME): tif_config.h tiffconf.h libtiff.def $(OBJ)
- $(LD) /debug /dll /def:libtiff.def /out:$(DLLNAME) \
- /implib:libtiff_i.lib ..\port\libport.lib $(OBJ) $(LIBS)
-
-clean:
- -del tif_config.h tiffconf.h
- -del *.obj
- -del *.lib
- -del *.dll
- -del *.dll.manifest
- -del *.pdb
diff --git a/tiff/libtiff/SConstruct b/tiff/libtiff/SConstruct
deleted file mode 100644
index af3daace..00000000
--- a/tiff/libtiff/SConstruct
+++ /dev/null
@@ -1,71 +0,0 @@
-# Tag Image File Format (TIFF) Software
-#
-# Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee, provided
-# that (i) the above copyright notices and this permission notice appear in
-# all copies of the software and related documentation, and (ii) the names of
-# Sam Leffler and Silicon Graphics may not be used in any advertising or
-# publicity relating to the software without the specific, prior written
-# permission of Sam Leffler and Silicon Graphics.
-#
-# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-#
-# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-
-# This file contains rules to build software with the SCons tool
-# (see the http://www.scons.org/ for details on SCons).
-
-# Import globally defined options
-Import([ 'env', 'idir_lib' ])
-
-SRCS = [ \
- 'tif_aux.c', \
- 'tif_close.c', \
- 'tif_codec.c', \
- 'tif_color.c', \
- 'tif_compress.c', \
- 'tif_dir.c', \
- 'tif_dirinfo.c', \
- 'tif_dirread.c', \
- 'tif_dirwrite.c', \
- 'tif_dumpmode.c', \
- 'tif_error.c', \
- 'tif_extension.c', \
- 'tif_fax3.c', \
- 'tif_fax3sm.c', \
- 'tif_flush.c', \
- 'tif_getimage.c', \
- 'tif_jbig.c', \
- 'tif_jpeg.c', \
- 'tif_luv.c', \
- 'tif_lzw.c', \
- 'tif_next.c', \
- 'tif_ojpeg.c', \
- 'tif_open.c', \
- 'tif_packbits.c', \
- 'tif_pixarlog.c', \
- 'tif_predict.c', \
- 'tif_print.c', \
- 'tif_read.c', \
- 'tif_strip.c', \
- 'tif_swab.c', \
- 'tif_thunder.c', \
- 'tif_tile.c', \
- 'tif_unix.c', \
- 'tif_version.c', \
- 'tif_warning.c', \
- 'tif_write.c', \
- 'tif_zip.c' ]
-
-StaticLibrary('tiff', SRCS)
-SharedLibrary('tiff', SRCS)
-
diff --git a/tiff/libtiff/mkg3states.c b/tiff/libtiff/mkg3states.c
index 2cb9174c..44653255 100644
--- a/tiff/libtiff/mkg3states.c
+++ b/tiff/libtiff/mkg3states.c
@@ -28,6 +28,7 @@
* Copyright (C) 1990, 1995 Frank D. Cringle.
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -39,10 +40,6 @@
#include "tif_fax3.h"
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
#define streq(a,b) (strcmp(a,b) == 0)
/* NB: can't use names in tif_fax3.h 'cuz they are declared const */
@@ -51,8 +48,8 @@ TIFFFaxTabEnt WhiteTable[4096];
TIFFFaxTabEnt BlackTable[8192];
struct proto {
- uint16 code; /* right justified, lsb-first, zero filled */
- uint16 val; /* (pixel count)<<4 + code width */
+ uint16_t code; /* right justified, lsb-first, zero filled */
+ uint16_t val; /* (pixel count)<<4 + code width */
};
static struct proto Pass[] = {
@@ -433,11 +430,19 @@ main(int argc, char* argv[])
fprintf(fd, "/* WARNING, this file was automatically generated by the\n");
fprintf(fd, " mkg3states program */\n");
+ fprintf(fd, "#include <stdint.h>\n");
fprintf(fd, "#include \"tiff.h\"\n");
fprintf(fd, "#include \"tif_fax3.h\"\n");
WriteTable(fd, MainTable, 128, "TIFFFaxMainTable");
WriteTable(fd, WhiteTable, 4096, "TIFFFaxWhiteTable");
WriteTable(fd, BlackTable, 8192, "TIFFFaxBlackTable");
+ fprintf(fd, "/*\n"
+ " * Local Variables:\n"
+ " * mode: c\n"
+ " * c-basic-offset: 8\n"
+ " * fill-column: 78\n"
+ " * End:\n"
+ " */\n");
fclose(fd);
return (0);
}
diff --git a/tiff/libtiff/tif_aux.c b/tiff/libtiff/tif_aux.c
index c9f19054..140f26c7 100644
--- a/tiff/libtiff/tif_aux.c
+++ b/tiff/libtiff/tif_aux.c
@@ -32,10 +32,10 @@
#include <math.h>
#include <float.h>
-uint32
-_TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
+uint32_t
+_TIFFMultiply32(TIFF* tif, uint32_t first, uint32_t second, const char* where)
{
- if (second && first > TIFF_UINT32_MAX / second) {
+ if (second && first > UINT32_MAX / second) {
TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
return 0;
}
@@ -43,10 +43,10 @@ _TIFFMultiply32(TIFF* tif, uint32 first, uint32 second, const char* where)
return first * second;
}
-uint64
-_TIFFMultiply64(TIFF* tif, uint64 first, uint64 second, const char* where)
+uint64_t
+_TIFFMultiply64(TIFF* tif, uint64_t first, uint64_t second, const char* where)
{
- if (second && first > TIFF_UINT64_MAX / second) {
+ if (second && first > UINT64_MAX / second) {
TIFFErrorExt(tif->tif_clientdata, where, "Integer overflow in %s", where);
return 0;
}
@@ -79,9 +79,9 @@ _TIFFMultiplySSize(TIFF* tif, tmsize_t first, tmsize_t second, const char* where
return first * second;
}
-tmsize_t _TIFFCastUInt64ToSSize(TIFF* tif, uint64 val, const char* module)
+tmsize_t _TIFFCastUInt64ToSSize(TIFF* tif, uint64_t val, const char* module)
{
- if( val > (uint64)TIFF_TMSIZE_T_MAX )
+ if( val > (uint64_t)TIFF_TMSIZE_T_MAX )
{
if( tif != NULL && module != NULL )
{
@@ -109,8 +109,8 @@ _TIFFCheckRealloc(TIFF* tif, void* buffer,
if (cp == NULL) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"Failed to allocate memory for %s "
- "(%ld elements of %ld bytes each)",
- what,(long) nmemb, (long) elem_size);
+ "(%"TIFF_SSIZE_FORMAT" elements of %"TIFF_SSIZE_FORMAT" bytes each)",
+ what, nmemb, elem_size);
}
return cp;
@@ -125,7 +125,7 @@ _TIFFCheckMalloc(TIFF* tif, tmsize_t nmemb, tmsize_t elem_size, const char* what
static int
TIFFDefaultTransferFunction(TIFFDirectory* td)
{
- uint16 **tf = td->td_transferfunction;
+ uint16_t **tf = td->td_transferfunction;
tmsize_t i, n, nbytes;
tf[0] = tf[1] = tf[2] = 0;
@@ -133,22 +133,22 @@ TIFFDefaultTransferFunction(TIFFDirectory* td)
return 0;
n = ((tmsize_t)1)<<td->td_bitspersample;
- nbytes = n * sizeof (uint16);
- tf[0] = (uint16 *)_TIFFmalloc(nbytes);
+ nbytes = n * sizeof (uint16_t);
+ tf[0] = (uint16_t *)_TIFFmalloc(nbytes);
if (tf[0] == NULL)
return 0;
tf[0][0] = 0;
for (i = 1; i < n; i++) {
double t = (double)i/((double) n-1.);
- tf[0][i] = (uint16)floor(65535.*pow(t, 2.2) + .5);
+ tf[0][i] = (uint16_t)floor(65535. * pow(t, 2.2) + .5);
}
if (td->td_samplesperpixel - td->td_extrasamples > 1) {
- tf[1] = (uint16 *)_TIFFmalloc(nbytes);
+ tf[1] = (uint16_t *)_TIFFmalloc(nbytes);
if(tf[1] == NULL)
goto bad;
_TIFFmemcpy(tf[1], tf[0], nbytes);
- tf[2] = (uint16 *)_TIFFmalloc(nbytes);
+ tf[2] = (uint16_t *)_TIFFmalloc(nbytes);
if (tf[2] == NULL)
goto bad;
_TIFFmemcpy(tf[2], tf[0], nbytes);
@@ -205,7 +205,7 @@ TIFFDefaultRefBlackWhite(TIFFDirectory* td)
* place in the library -- in TIFFDefaultDirectory.
*/
int
-TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
+TIFFVGetFieldDefaulted(TIFF* tif, uint32_t tag, va_list ap)
{
TIFFDirectory *td = &tif->tif_dir;
@@ -213,37 +213,37 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
return (1);
switch (tag) {
case TIFFTAG_SUBFILETYPE:
- *va_arg(ap, uint32 *) = td->td_subfiletype;
+ *va_arg(ap, uint32_t *) = td->td_subfiletype;
return (1);
case TIFFTAG_BITSPERSAMPLE:
- *va_arg(ap, uint16 *) = td->td_bitspersample;
+ *va_arg(ap, uint16_t *) = td->td_bitspersample;
return (1);
case TIFFTAG_THRESHHOLDING:
- *va_arg(ap, uint16 *) = td->td_threshholding;
+ *va_arg(ap, uint16_t *) = td->td_threshholding;
return (1);
case TIFFTAG_FILLORDER:
- *va_arg(ap, uint16 *) = td->td_fillorder;
+ *va_arg(ap, uint16_t *) = td->td_fillorder;
return (1);
case TIFFTAG_ORIENTATION:
- *va_arg(ap, uint16 *) = td->td_orientation;
+ *va_arg(ap, uint16_t *) = td->td_orientation;
return (1);
case TIFFTAG_SAMPLESPERPIXEL:
- *va_arg(ap, uint16 *) = td->td_samplesperpixel;
+ *va_arg(ap, uint16_t *) = td->td_samplesperpixel;
return (1);
case TIFFTAG_ROWSPERSTRIP:
- *va_arg(ap, uint32 *) = td->td_rowsperstrip;
+ *va_arg(ap, uint32_t *) = td->td_rowsperstrip;
return (1);
case TIFFTAG_MINSAMPLEVALUE:
- *va_arg(ap, uint16 *) = td->td_minsamplevalue;
+ *va_arg(ap, uint16_t *) = td->td_minsamplevalue;
return (1);
case TIFFTAG_MAXSAMPLEVALUE:
- *va_arg(ap, uint16 *) = td->td_maxsamplevalue;
+ *va_arg(ap, uint16_t *) = td->td_maxsamplevalue;
return (1);
case TIFFTAG_PLANARCONFIG:
- *va_arg(ap, uint16 *) = td->td_planarconfig;
+ *va_arg(ap, uint16_t *) = td->td_planarconfig;
return (1);
case TIFFTAG_RESOLUTIONUNIT:
- *va_arg(ap, uint16 *) = td->td_resolutionunit;
+ *va_arg(ap, uint16_t *) = td->td_resolutionunit;
return (1);
case TIFFTAG_PREDICTOR:
{
@@ -252,42 +252,42 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
{
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"Cannot get \"Predictor\" tag as plugin is not configured");
- *va_arg(ap, uint16*) = 0;
+ *va_arg(ap, uint16_t*) = 0;
return 0;
}
- *va_arg(ap, uint16*) = (uint16) sp->predictor;
+ *va_arg(ap, uint16_t*) = (uint16_t) sp->predictor;
return 1;
}
case TIFFTAG_DOTRANGE:
- *va_arg(ap, uint16 *) = 0;
- *va_arg(ap, uint16 *) = (1<<td->td_bitspersample)-1;
+ *va_arg(ap, uint16_t *) = 0;
+ *va_arg(ap, uint16_t *) = (1 << td->td_bitspersample) - 1;
return (1);
case TIFFTAG_INKSET:
- *va_arg(ap, uint16 *) = INKSET_CMYK;
+ *va_arg(ap, uint16_t *) = INKSET_CMYK;
return 1;
case TIFFTAG_NUMBEROFINKS:
- *va_arg(ap, uint16 *) = 4;
+ *va_arg(ap, uint16_t *) = 4;
return (1);
case TIFFTAG_EXTRASAMPLES:
- *va_arg(ap, uint16 *) = td->td_extrasamples;
- *va_arg(ap, const uint16 **) = td->td_sampleinfo;
+ *va_arg(ap, uint16_t *) = td->td_extrasamples;
+ *va_arg(ap, const uint16_t **) = td->td_sampleinfo;
return (1);
case TIFFTAG_MATTEING:
- *va_arg(ap, uint16 *) =
+ *va_arg(ap, uint16_t *) =
(td->td_extrasamples == 1 &&
td->td_sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA);
return (1);
case TIFFTAG_TILEDEPTH:
- *va_arg(ap, uint32 *) = td->td_tiledepth;
+ *va_arg(ap, uint32_t *) = td->td_tiledepth;
return (1);
case TIFFTAG_DATATYPE:
- *va_arg(ap, uint16 *) = td->td_sampleformat-1;
+ *va_arg(ap, uint16_t *) = td->td_sampleformat - 1;
return (1);
case TIFFTAG_SAMPLEFORMAT:
- *va_arg(ap, uint16 *) = td->td_sampleformat;
+ *va_arg(ap, uint16_t *) = td->td_sampleformat;
return(1);
case TIFFTAG_IMAGEDEPTH:
- *va_arg(ap, uint32 *) = td->td_imagedepth;
+ *va_arg(ap, uint32_t *) = td->td_imagedepth;
return (1);
case TIFFTAG_YCBCRCOEFFICIENTS:
{
@@ -297,11 +297,11 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
return 1;
}
case TIFFTAG_YCBCRSUBSAMPLING:
- *va_arg(ap, uint16 *) = td->td_ycbcrsubsampling[0];
- *va_arg(ap, uint16 *) = td->td_ycbcrsubsampling[1];
+ *va_arg(ap, uint16_t *) = td->td_ycbcrsubsampling[0];
+ *va_arg(ap, uint16_t *) = td->td_ycbcrsubsampling[1];
return (1);
case TIFFTAG_YCBCRPOSITIONING:
- *va_arg(ap, uint16 *) = td->td_ycbcrpositioning;
+ *va_arg(ap, uint16_t *) = td->td_ycbcrpositioning;
return (1);
case TIFFTAG_WHITEPOINT:
{
@@ -321,10 +321,10 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
TIFFErrorExt(tif->tif_clientdata, tif->tif_name, "No space for \"TransferFunction\" tag");
return (0);
}
- *va_arg(ap, const uint16 **) = td->td_transferfunction[0];
+ *va_arg(ap, const uint16_t **) = td->td_transferfunction[0];
if (td->td_samplesperpixel - td->td_extrasamples > 1) {
- *va_arg(ap, const uint16 **) = td->td_transferfunction[1];
- *va_arg(ap, const uint16 **) = td->td_transferfunction[2];
+ *va_arg(ap, const uint16_t **) = td->td_transferfunction[1];
+ *va_arg(ap, const uint16_t **) = td->td_transferfunction[2];
}
return (1);
case TIFFTAG_REFERENCEBLACKWHITE:
@@ -341,7 +341,7 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
* value if the tag is not present in the directory.
*/
int
-TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...)
+TIFFGetFieldDefaulted(TIFF* tif, uint32_t tag, ...)
{
int ok;
va_list ap;
@@ -353,16 +353,16 @@ TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...)
}
struct _Int64Parts {
- int32 low, high;
+ int32_t low, high;
};
typedef union {
struct _Int64Parts part;
- int64 value;
+ int64_t value;
} _Int64;
float
-_TIFFUInt64ToFloat(uint64 ui64)
+_TIFFUInt64ToFloat(uint64_t ui64)
{
_Int64 i;
@@ -378,7 +378,7 @@ _TIFFUInt64ToFloat(uint64 ui64)
}
double
-_TIFFUInt64ToDouble(uint64 ui64)
+_TIFFUInt64ToDouble(uint64_t ui64)
{
_Int64 i;
@@ -406,7 +406,7 @@ int _TIFFSeekOK(TIFF* tif, toff_t off)
{
/* Huge offsets, especially -1 / UINT64_MAX, can cause issues */
/* See http://bugzilla.maptools.org/show_bug.cgi?id=2726 */
- return off <= (~(uint64)0)/2 && TIFFSeekFile(tif,off,SEEK_SET)==off;
+ return off <= (~(uint64_t)0) / 2 && TIFFSeekFile(tif, off, SEEK_SET) == off;
}
/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/tiff/libtiff/tif_close.c b/tiff/libtiff/tif_close.c
index e4228df9..674518a1 100644
--- a/tiff/libtiff/tif_close.c
+++ b/tiff/libtiff/tif_close.c
@@ -76,7 +76,7 @@ TIFFCleanup(TIFF* tif)
* Clean up custom fields.
*/
if (tif->tif_fields && tif->tif_nfields > 0) {
- uint32 i;
+ uint32_t i;
for (i = 0; i < tif->tif_nfields; i++) {
TIFFField *fld = tif->tif_fields[i];
@@ -91,7 +91,7 @@ TIFFCleanup(TIFF* tif)
}
if (tif->tif_nfieldscompat > 0) {
- uint32 i;
+ uint32_t i;
for (i = 0; i < tif->tif_nfieldscompat; i++) {
if (tif->tif_fieldscompat[i].allocated_size)
diff --git a/tiff/libtiff/tif_codec.c b/tiff/libtiff/tif_codec.c
index b6c04f01..931eb093 100644
--- a/tiff/libtiff/tif_codec.c
+++ b/tiff/libtiff/tif_codec.c
@@ -67,6 +67,9 @@ static int NotConfigured(TIFF*, int);
#ifndef LOGLUV_SUPPORT
#define TIFFInitSGILog NotConfigured
#endif
+#ifndef LERC_SUPPORT
+#define TIFFInitLERC NotConfigured
+#endif
#ifndef LZMA_SUPPORT
#define TIFFInitLZMA NotConfigured
#endif
@@ -80,11 +83,7 @@ static int NotConfigured(TIFF*, int);
/*
* Compression schemes statically built into the library.
*/
-#ifdef VMS
const TIFFCodec _TIFFBuiltinCODECS[] = {
-#else
-TIFFCodec _TIFFBuiltinCODECS[] = {
-#endif
{ "None", COMPRESSION_NONE, TIFFInitDumpMode },
{ "LZW", COMPRESSION_LZW, TIFFInitLZW },
{ "PackBits", COMPRESSION_PACKBITS, TIFFInitPackBits },
@@ -105,6 +104,7 @@ TIFFCodec _TIFFBuiltinCODECS[] = {
{ "LZMA", COMPRESSION_LZMA, TIFFInitLZMA },
{ "ZSTD", COMPRESSION_ZSTD, TIFFInitZSTD },
{ "WEBP", COMPRESSION_WEBP, TIFFInitWebP },
+ { "LERC", COMPRESSION_LERC, TIFFInitLERC },
{ NULL, 0, NULL }
};
@@ -114,7 +114,7 @@ _notConfigured(TIFF* tif)
const TIFFCodec* c = TIFFFindCODEC(tif->tif_dir.td_compression);
char compression_code[20];
- sprintf(compression_code, "%d",tif->tif_dir.td_compression );
+ sprintf(compression_code, "%"PRIu16, tif->tif_dir.td_compression );
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"%s compression support is not configured",
c ? c->name : compression_code );
@@ -146,7 +146,7 @@ NotConfigured(TIFF* tif, int scheme)
*/
int
-TIFFIsCODECConfigured(uint16 scheme)
+TIFFIsCODECConfigured(uint16_t scheme)
{
const TIFFCodec* codec = TIFFFindCODEC(scheme);
diff --git a/tiff/libtiff/tif_color.c b/tiff/libtiff/tif_color.c
index 8fae40ea..2b962af9 100644
--- a/tiff/libtiff/tif_color.c
+++ b/tiff/libtiff/tif_color.c
@@ -41,8 +41,8 @@
* Convert color value from the CIE L*a*b* 1976 space to CIE XYZ.
*/
void
-TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32 l, int32 a, int32 b,
- float *X, float *Y, float *Z)
+TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32_t l, int32_t a, int32_t b,
+ float *X, float *Y, float *Z)
{
float L = (float)l * 100.0F / 255.0F;
float cby, tmp;
@@ -68,13 +68,13 @@ TIFFCIELabToXYZ(TIFFCIELabToRGB *cielab, uint32 l, int32 a, int32 b,
*Z = cielab->Z0 * tmp * tmp * tmp;
}
-#define RINT(R) ((uint32)((R)>0?((R)+0.5):((R)-0.5)))
+#define RINT(R) ((uint32_t)((R)>0?((R)+0.5):((R)-0.5)))
/*
* Convert color value from the XYZ space to RGB.
*/
void
TIFFXYZToRGB(TIFFCIELabToRGB *cielab, float X, float Y, float Z,
- uint32 *r, uint32 *g, uint32 *b)
+ uint32_t *r, uint32_t *g, uint32_t *b)
{
int i;
float Yr, Yg, Yb;
@@ -171,17 +171,17 @@ TIFFCIELabToRGBInit(TIFFCIELabToRGB* cielab,
* see below for more information on how it works.
*/
#define SHIFT 16
-#define FIX(x) ((int32)((x) * (1L<<SHIFT) + 0.5))
-#define ONE_HALF ((int32)(1<<(SHIFT-1)))
-#define Code2V(c, RB, RW, CR) ((((c)-(int32)(RB))*(float)(CR))/(float)(((RW)-(RB)!=0) ? ((RW)-(RB)) : 1))
+#define FIX(x) ((int32_t)((x) * (1L<<SHIFT) + 0.5))
+#define ONE_HALF ((int32_t)(1<<(SHIFT-1)))
+#define Code2V(c, RB, RW, CR) ((((c)-(int32_t)(RB))*(float)(CR))/(float)(((RW)-(RB)!=0) ? ((RW)-(RB)) : 1))
#define CLAMP(f,min,max) ((f)<(min)?(min):(f)>(max)?(max):(f))
#define HICLAMP(f,max) ((f)>(max)?(max):(f))
void
-TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32 Y, int32 Cb, int32 Cr,
- uint32 *r, uint32 *g, uint32 *b)
+TIFFYCbCrtoRGB(TIFFYCbCrToRGB *ycbcr, uint32_t Y, int32_t Cb, int32_t Cr,
+ uint32_t *r, uint32_t *g, uint32_t *b)
{
- int32 i;
+ int32_t i;
/* XXX: Only 8-bit YCbCr input supported for now */
Y = HICLAMP(Y, 255);
@@ -241,7 +241,7 @@ TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite)
#define LumaBlue luma[2]
clamptab = (TIFFRGBValue*)(
- (uint8*) ycbcr+TIFFroundup_32(sizeof (TIFFYCbCrToRGB), sizeof (long)));
+ (uint8_t*) ycbcr + TIFFroundup_32(sizeof (TIFFYCbCrToRGB), sizeof (long)));
_TIFFmemset(clamptab, 0, 256); /* v < 0 => 0 */
ycbcr->clamptab = (clamptab += 256);
for (i = 0; i < 256; i++)
@@ -249,14 +249,14 @@ TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite)
_TIFFmemset(clamptab+256, 255, 2*256); /* v > 255 => 255 */
ycbcr->Cr_r_tab = (int*) (clamptab + 3*256);
ycbcr->Cb_b_tab = ycbcr->Cr_r_tab + 256;
- ycbcr->Cr_g_tab = (int32*) (ycbcr->Cb_b_tab + 256);
+ ycbcr->Cr_g_tab = (int32_t*) (ycbcr->Cb_b_tab + 256);
ycbcr->Cb_g_tab = ycbcr->Cr_g_tab + 256;
ycbcr->Y_tab = ycbcr->Cb_g_tab + 256;
- { float f1 = 2-2*LumaRed; int32 D1 = FIX(CLAMP(f1,0.0F,2.0F));
- float f2 = LumaRed*f1/LumaGreen; int32 D2 = -FIX(CLAMP(f2,0.0F,2.0F));
- float f3 = 2-2*LumaBlue; int32 D3 = FIX(CLAMP(f3,0.0F,2.0F));
- float f4 = LumaBlue*f3/LumaGreen; int32 D4 = -FIX(CLAMP(f4,0.0F,2.0F));
+ { float f1 = 2-2*LumaRed; int32_t D1 = FIX(CLAMP(f1, 0.0F, 2.0F));
+ float f2 = LumaRed*f1/LumaGreen; int32_t D2 = -FIX(CLAMP(f2, 0.0F, 2.0F));
+ float f3 = 2-2*LumaBlue; int32_t D3 = FIX(CLAMP(f3, 0.0F, 2.0F));
+ float f4 = LumaBlue*f3/LumaGreen; int32_t D4 = -FIX(CLAMP(f4, 0.0F, 2.0F));
int x;
#undef LumaBlue
@@ -271,19 +271,19 @@ TIFFYCbCrToRGBInit(TIFFYCbCrToRGB* ycbcr, float *luma, float *refBlackWhite)
* constructing tables indexed by the raw pixel data.
*/
for (i = 0, x = -128; i < 256; i++, x++) {
- int32 Cr = (int32)CLAMPw(Code2V(x, refBlackWhite[4] - 128.0F,
+ int32_t Cr = (int32_t)CLAMPw(Code2V(x, refBlackWhite[4] - 128.0F,
refBlackWhite[5] - 128.0F, 127),
-128.0F * 32, 128.0F * 32);
- int32 Cb = (int32)CLAMPw(Code2V(x, refBlackWhite[2] - 128.0F,
+ int32_t Cb = (int32_t)CLAMPw(Code2V(x, refBlackWhite[2] - 128.0F,
refBlackWhite[3] - 128.0F, 127),
-128.0F * 32, 128.0F * 32);
- ycbcr->Cr_r_tab[i] = (int32)((D1*Cr + ONE_HALF)>>SHIFT);
- ycbcr->Cb_b_tab[i] = (int32)((D3*Cb + ONE_HALF)>>SHIFT);
+ ycbcr->Cr_r_tab[i] = (int32_t)((D1 * Cr + ONE_HALF) >> SHIFT);
+ ycbcr->Cb_b_tab[i] = (int32_t)((D3 * Cb + ONE_HALF) >> SHIFT);
ycbcr->Cr_g_tab[i] = D2*Cr;
ycbcr->Cb_g_tab[i] = D4*Cb + ONE_HALF;
ycbcr->Y_tab[i] =
- (int32)CLAMPw(Code2V(x + 128, refBlackWhite[0], refBlackWhite[1], 255),
+ (int32_t)CLAMPw(Code2V(x + 128, refBlackWhite[0], refBlackWhite[1], 255),
-128.0F * 32, 128.0F * 32);
}
}
diff --git a/tiff/libtiff/tif_compress.c b/tiff/libtiff/tif_compress.c
index 915478f5..8fcedf45 100644
--- a/tiff/libtiff/tif_compress.c
+++ b/tiff/libtiff/tif_compress.c
@@ -40,28 +40,28 @@ TIFFNoEncode(TIFF* tif, const char* method)
c->name, method);
} else {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "Compression scheme %u %s encoding is not implemented",
+ "Compression scheme %"PRIu16" %s encoding is not implemented",
tif->tif_dir.td_compression, method);
}
return (-1);
}
int
-_TIFFNoRowEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
+_TIFFNoRowEncode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s)
{
(void) pp; (void) cc; (void) s;
return (TIFFNoEncode(tif, "scanline"));
}
int
-_TIFFNoStripEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
+_TIFFNoStripEncode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s)
{
(void) pp; (void) cc; (void) s;
return (TIFFNoEncode(tif, "strip"));
}
int
-_TIFFNoTileEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
+_TIFFNoTileEncode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s)
{
(void) pp; (void) cc; (void) s;
return (TIFFNoEncode(tif, "tile"));
@@ -78,7 +78,7 @@ TIFFNoDecode(TIFF* tif, const char* method)
c->name, method);
else
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "Compression scheme %u %s decoding is not implemented",
+ "Compression scheme %"PRIu16" %s decoding is not implemented",
tif->tif_dir.td_compression, method);
return (0);
}
@@ -91,28 +91,28 @@ _TIFFNoFixupTags(TIFF* tif)
}
int
-_TIFFNoRowDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
+_TIFFNoRowDecode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s)
{
(void) pp; (void) cc; (void) s;
return (TIFFNoDecode(tif, "scanline"));
}
int
-_TIFFNoStripDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
+_TIFFNoStripDecode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s)
{
(void) pp; (void) cc; (void) s;
return (TIFFNoDecode(tif, "strip"));
}
int
-_TIFFNoTileDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
+_TIFFNoTileDecode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s)
{
(void) pp; (void) cc; (void) s;
return (TIFFNoDecode(tif, "tile"));
}
int
-_TIFFNoSeek(TIFF* tif, uint32 off)
+_TIFFNoSeek(TIFF* tif, uint32_t off)
{
(void) off;
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
@@ -121,7 +121,7 @@ _TIFFNoSeek(TIFF* tif, uint32 off)
}
int
-_TIFFNoPreCode(TIFF* tif, uint16 s)
+_TIFFNoPreCode(TIFF* tif, uint16_t s)
{
(void) tif; (void) s;
return (1);
@@ -158,7 +158,7 @@ _TIFFSetDefaultCompressionState(TIFF* tif)
int
TIFFSetCompressionScheme(TIFF* tif, int scheme)
{
- const TIFFCodec *c = TIFFFindCODEC((uint16) scheme);
+ const TIFFCodec *c = TIFFFindCODEC((uint16_t) scheme);
_TIFFSetDefaultCompressionState(tif);
/*
@@ -182,7 +182,7 @@ typedef struct _codec {
static codec_t* registeredCODECS = NULL;
const TIFFCodec*
-TIFFFindCODEC(uint16 scheme)
+TIFFFindCODEC(uint16_t scheme)
{
const TIFFCodec* c;
codec_t* cd;
@@ -197,15 +197,15 @@ TIFFFindCODEC(uint16 scheme)
}
TIFFCodec*
-TIFFRegisterCODEC(uint16 scheme, const char* name, TIFFInitMethod init)
+TIFFRegisterCODEC(uint16_t scheme, const char* name, TIFFInitMethod init)
{
codec_t* cd = (codec_t*)
_TIFFmalloc((tmsize_t)(sizeof (codec_t) + sizeof (TIFFCodec) + strlen(name)+1));
if (cd != NULL) {
- cd->info = (TIFFCodec*) ((uint8*) cd + sizeof (codec_t));
+ cd->info = (TIFFCodec*) ((uint8_t*) cd + sizeof (codec_t));
cd->info->name = (char*)
- ((uint8*) cd->info + sizeof (TIFFCodec));
+ ((uint8_t*) cd->info + sizeof (TIFFCodec));
strcpy(cd->info->name, name);
cd->info->scheme = scheme;
cd->info->init = init;
diff --git a/tiff/libtiff/tif_config.h-vms b/tiff/libtiff/tif_config.h-vms
deleted file mode 100644
index d653bd82..00000000
--- a/tiff/libtiff/tif_config.h-vms
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Define to 1 if you have the <assert.h> header file. */
-#define HAVE_ASSERT_H 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define as 0 or 1 according to the floating point format suported by the
- machine */
-#define HAVE_IEEEFP 1
-
-#define HAVE_UNISTD_H 1
-
-#define HAVE_STRING_H 1
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
-
-/* Define to 1 if you have the <io.h> header file. */
-//#define HAVE_IO_H 1
-
-/* Define to 1 if you have the <search.h> header file. */
-//#define HAVE_SEARCH_H 1
-
-/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* The size of a `long', as computed by sizeof. */
-#define SIZEOF_LONG 4
-
-/* Set the native cpu bit order */
-#define HOST_FILLORDER FILLORDER_LSB2MSB
-
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-/*
-#ifndef __cplusplus
-# ifndef inline
-# define inline __inline
-# endif
-#endif
-*/
-
-// #define lfind _lfind
diff --git a/tiff/libtiff/tif_config.h.cmake.in b/tiff/libtiff/tif_config.h.cmake.in
index 24144603..20e44630 100644
--- a/tiff/libtiff/tif_config.h.cmake.in
+++ b/tiff/libtiff/tif_config.h.cmake.in
@@ -1,6 +1,8 @@
/* libtiff/tif_config.h.cmake.in. Not generated, but originated from autoheader. */
/* This file must be kept up-to-date with needed substitutions from libtiff/tif_config.h.in. */
+#include "tiffconf.h"
+
/* Support CCITT Group 3 & 4 algorithms */
#cmakedefine CCITT_SUPPORT 1
@@ -20,12 +22,15 @@
/* Define to 1 if you have the <assert.h> header file. */
#cmakedefine HAVE_ASSERT_H 1
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#cmakedefine HAVE_DLFCN_H 1
+/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't. */
+#cmakedefine HAVE_DECL_OPTARG 1
/* Define to 1 if you have the <fcntl.h> header file. */
#cmakedefine HAVE_FCNTL_H 1
+/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
+#cmakedefine HAVE_FSEEKO 1
+
/* Define to 1 if you have the `getopt' function. */
#cmakedefine HAVE_GETOPT 1
@@ -41,18 +46,12 @@
/* Define to 1 if you have the <GL/gl.h> header file. */
#cmakedefine HAVE_GL_GL_H 1
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine HAVE_INTTYPES_H 1
-
/* Define to 1 if you have the <io.h> header file. */
#cmakedefine HAVE_IO_H 1
/* Define to 1 if you have the `jbg_newlen' function. */
#cmakedefine HAVE_JBG_NEWLEN 1
-/* Define to 1 if you have the `lfind' function. */
-#cmakedefine HAVE_LFIND 1
-
/* Define to 1 if you have the `mmap' function. */
#cmakedefine HAVE_MMAP 1
@@ -62,42 +61,12 @@
/* Define to 1 if you have the <OpenGL/gl.h> header file. */
#cmakedefine HAVE_OPENGL_GL_H 1
-/* Define to 1 if you have the <search.h> header file. */
-#cmakedefine HAVE_SEARCH_H 1
-
/* Define to 1 if you have the `setmode' function. */
#cmakedefine HAVE_SETMODE 1
-/* Define to 1 if you have the `snprintf' function. */
-#cmakedefine HAVE_SNPRINTF 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H 1
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#cmakedefine HAVE_STRCASECMP 1
-
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine HAVE_STRINGS_H 1
-/* Define to 1 if you have the <string.h> header file. */
-#cmakedefine HAVE_STRING_H 1
-
-/* Define to 1 if you have the `strtol' function. */
-#cmakedefine HAVE_STRTOL 1
-
-/* Define to 1 if you have the `strtoll' function. */
-#cmakedefine HAVE_STRTOLL 1
-
-/* Define to 1 if you have the `strtoul' function. */
-#cmakedefine HAVE_STRTOUL 1
-
-/* Define to 1 if you have the `strtoull' function. */
-#cmakedefine HAVE_STRTOULL 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#cmakedefine HAVE_SYS_TIME_H 1
-
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H 1
@@ -105,20 +74,17 @@
#cmakedefine HAVE_UNISTD_H 1
/* 8/12 bit libjpeg dual mode enabled */
-#cmakedefine JPEG_DUAL_MODE_8_12 1
+#cmakedefine JPEG_DUAL_MODE_8_12 1 1
+
+/* Support LERC compression */
+#cmakedefine LERC_SUPPORT 1
/* 12bit libjpeg primary include file with path */
-#define LIBJPEG_12_PATH @LIBJPEG_12_PATH@
+#define LIBJPEG_12_PATH "@LIBJPEG_12_PATH@"
/* Support LZMA2 compression */
#cmakedefine LZMA_SUPPORT 1
-/* Support ZSTD compression */
-#cmakedefine ZSTD_SUPPORT 1
-
-/* Support WEBP compression */
-#cmakedefine WEBP_SUPPORT 1
-
/* Name of package */
#define PACKAGE "@PACKAGE_NAME@"
@@ -140,69 +106,25 @@
/* Define to the version of this package. */
#define PACKAGE_VERSION "@PACKAGE_VERSION@"
-/* The size of `signed int', as computed by sizeof. */
-#define SIZEOF_SIGNED_INT @SIZEOF_SIGNED_INT@
-
-/* The size of `signed long', as computed by sizeof. */
-#define SIZEOF_SIGNED_LONG @SIZEOF_SIGNED_LONG@
-
-/* The size of `signed long long', as computed by sizeof. */
-#define SIZEOF_SIGNED_LONG_LONG @SIZEOF_SIGNED_LONG_LONG@
-
-/* The size of `unsigned char *', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_CHAR_P @SIZEOF_UNSIGNED_CHAR_P@
-
-/* The size of `unsigned int', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_INT @SIZEOF_UNSIGNED_INT@
-
-/* The size of `unsigned long', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_LONG @SIZEOF_UNSIGNED_LONG@
-
-/* The size of `unsigned long long', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_LONG_LONG @SIZEOF_UNSIGNED_LONG_LONG@
-
-/* The size of `unsigned short', as computed by sizeof. */
-#define SIZEOF_UNSIGNED_SHORT @SIZEOF_UNSIGNED_SHORT@
+/* Size of size_t */
+#define SIZEOF_SIZE_T @SIZEOF_SIZE_T@
/* Default size of the strip in bytes (when strip chopping enabled) */
#define STRIP_SIZE_DEFAULT @STRIP_SIZE_DEFAULT@
-/* Signed 32-bit type formatter */
-#define TIFF_INT32_FORMAT "@TIFF_INT32_FORMAT@"
-
-/* Signed 64-bit type formatter */
-#define TIFF_INT64_FORMAT "@TIFF_INT64_FORMAT@"
-
-/* Pointer difference type formatter */
-#define TIFF_PTRDIFF_FORMAT "@TIFF_PTRDIFF_FORMAT@"
-
-/* Unsigned size type formatter */
-#define TIFF_SIZE_FORMAT "@TIFF_SIZE_FORMAT@"
-
-/* Signed size type formatter */
-#define TIFF_SSIZE_FORMAT "@TIFF_SSIZE_FORMAT@"
-
-/* Unsigned 32-bit type formatter */
-#define TIFF_UINT32_FORMAT "@TIFF_UINT32_FORMAT@"
-
-/* Unsigned 64-bit type formatter */
-#define TIFF_UINT64_FORMAT "@TIFF_UINT64_FORMAT@"
-
-/* Unsigned 8-bit type */
-#define TIFF_UINT8_T @TIFF_UINT8_T@
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#cmakedefine TM_IN_SYS_TIME 1
-
/* define to use win32 IO system */
#cmakedefine USE_WIN32_FILEIO 1
/* Version number of package */
#define VERSION "@PACKAGE_VERSION@"
+/* Support WEBP compression */
+#cmakedefine WEBP_SUPPORT 1
+
+/* Support ZSTD compression */
+#cmakedefine ZSTD_SUPPORT 1
+
+
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
@@ -215,17 +137,19 @@
# endif
#endif
-/* Number of bits in a file offset, on hosts where this is settable. */
-#define _FILE_OFFSET_BITS @FILE_OFFSET_BITS@
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#define inline @INLINE_KEYWORD@
+#if !defined(__MINGW32__)
+# define TIFF_SIZE_FORMAT "zu"
+#endif
+#if SIZEOF_SIZE_T == 8
+# define TIFF_SSIZE_FORMAT PRId64
+# if defined(__MINGW32__)
+# define TIFF_SIZE_FORMAT PRIu64
+# endif
+#elif SIZEOF_SIZE_T == 4
+# define TIFF_SSIZE_FORMAT PRId32
+# if defined(__MINGW32__)
+# define TIFF_SIZE_FORMAT PRIu32
+# endif
+#else
+# error "Unsupported size_t size; please submit a bug report"
#endif
-
-/* Define to `long int' if <sys/types.h> does not define. */
-#undef off_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
diff --git a/tiff/libtiff/tif_config.h.in b/tiff/libtiff/tif_config.h.in
index 30afd7a1..66eef23b 100644
--- a/tiff/libtiff/tif_config.h.in
+++ b/tiff/libtiff/tif_config.h.in
@@ -1,7 +1,6 @@
-/* libtiff/tif_config.h.in. Generated from configure.ac by autoheader. */
+/* libtiff/tif_config.h.in. Not generated, but originated from autoheader. */
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
+#include "tiffconf.h"
/* Support CCITT Group 3 & 4 algorithms */
#undef CCITT_SUPPORT
@@ -16,11 +15,6 @@
/* Support C++ stream API (requires C++ compiler) */
#undef CXX_SUPPORT
-/* Treat extra sample as alpha (default enabled). The RGBA interface will
- treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
- packages produce RGBA files but don't mark the alpha properly. */
-#undef DEFAULT_EXTRASAMPLE_AS_ALPHA
-
/* enable deferred strip/tile offset/size loading */
#undef DEFER_STRILE_LOAD
@@ -31,9 +25,6 @@
*/
#undef HAVE_DECL_OPTARG
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
@@ -55,25 +46,12 @@
/* Define to 1 if you have the <GL/gl.h> header file. */
#undef HAVE_GL_GL_H
-/* Define as 0 or 1 according to the floating point format suported by the
- machine */
-#undef HAVE_IEEEFP
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
/* Define to 1 if you have the <io.h> header file. */
#undef HAVE_IO_H
/* Define to 1 if you have the `jbg_newlen' function. */
#undef HAVE_JBG_NEWLEN
-/* Define to 1 if you have the `lfind' function. */
-#undef HAVE_LFIND
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP
@@ -83,103 +61,33 @@
/* Define to 1 if you have the <OpenGL/gl.h> header file. */
#undef HAVE_OPENGL_GL_H
-/* Define if you have POSIX threads libraries and header files. */
-#undef HAVE_PTHREAD
-
-/* Define to 1 if you have the <search.h> header file. */
-#undef HAVE_SEARCH_H
-
/* Define to 1 if you have the `setmode' function. */
#undef HAVE_SETMODE
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the `strcasecmp' function. */
-#undef HAVE_STRCASECMP
-
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the `strtol' function. */
-#undef HAVE_STRTOL
-
-/* Define to 1 if you have the `strtoll' function. */
-#undef HAVE_STRTOLL
-
-/* Define to 1 if you have the `strtoul' function. */
-#undef HAVE_STRTOUL
-
-/* Define to 1 if you have the `strtoull' function. */
-#undef HAVE_STRTOULL
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Use nonstandard varargs form for the GLU tesselator callback */
-#undef HAVE_VARARGS_GLU_TESSCB
-
-/* Define to 1 if you have the <windows.h> header file. */
-#undef HAVE_WINDOWS_H
-
-/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
- (Intel) */
-#undef HOST_BIGENDIAN
-
-/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
-#undef HOST_FILLORDER
-
-/* Support ISO JBIG compression (requires JBIG-KIT library) */
-#undef JBIG_SUPPORT
-
/* 8/12 bit libjpeg dual mode enabled */
#undef JPEG_DUAL_MODE_8_12
-/* Support JPEG compression (requires IJG JPEG library) */
-#undef JPEG_SUPPORT
-
-/* Support libdeflate enhanced compression */
-#undef LIBDEFLATE_SUPPORT
+/* Support LERC compression */
+#undef LERC_SUPPORT
/* 12bit libjpeg primary include file with path */
#undef LIBJPEG_12_PATH
-/* Support LogLuv high dynamic range encoding */
-#undef LOGLUV_SUPPORT
-
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
-#undef LT_OBJDIR
-
/* Support LZMA2 compression */
#undef LZMA_SUPPORT
-/* Support LZW algorithm */
-#undef LZW_SUPPORT
-
-/* Support Microsoft Document Imaging format */
-#undef MDI_SUPPORT
-
-/* Support NeXT 2-bit RLE algorithm */
-#undef NEXT_SUPPORT
-
-/* Support Old JPEG compresson (read-only) */
-#undef OJPEG_SUPPORT
-
/* Name of package */
#undef PACKAGE
@@ -201,116 +109,12 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
-/* Support Macintosh PackBits algorithm */
-#undef PACKBITS_SUPPORT
-
-/* Support Pixar log-format algorithm (requires Zlib) */
-#undef PIXARLOG_SUPPORT
-
-/* Define to necessary symbol if this constant uses a non-standard name on
- your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* The size of `signed int', as computed by sizeof. */
-#undef SIZEOF_SIGNED_INT
-
-/* The size of `signed long', as computed by sizeof. */
-#undef SIZEOF_SIGNED_LONG
-
-/* The size of `signed long long', as computed by sizeof. */
-#undef SIZEOF_SIGNED_LONG_LONG
-
/* The size of `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
-/* The size of `unsigned char *', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_CHAR_P
-
-/* The size of `unsigned int', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_INT
-
-/* The size of `unsigned long', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_LONG
-
-/* The size of `unsigned long long', as computed by sizeof. */
-#undef SIZEOF_UNSIGNED_LONG_LONG
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Support strip chopping (whether or not to convert single-strip uncompressed
- images to mutiple strips of specified size to reduce memory usage) */
-#undef STRIPCHOP_DEFAULT
-
/* Default size of the strip in bytes (when strip chopping enabled) */
#undef STRIP_SIZE_DEFAULT
-/* Enable SubIFD tag (330) support */
-#undef SUBIFD_SUPPORT
-
-/* Support ThunderScan 4-bit RLE algorithm */
-#undef THUNDER_SUPPORT
-
-/* Signed 16-bit type */
-#undef TIFF_INT16_T
-
-/* Signed 32-bit type formatter */
-#undef TIFF_INT32_FORMAT
-
-/* Signed 32-bit type */
-#undef TIFF_INT32_T
-
-/* Signed 64-bit type formatter */
-#undef TIFF_INT64_FORMAT
-
-/* Signed 64-bit type */
-#undef TIFF_INT64_T
-
-/* Signed 8-bit type */
-#undef TIFF_INT8_T
-
-/* Pointer difference type formatter */
-#undef TIFF_PTRDIFF_FORMAT
-
-/* Pointer difference type */
-#undef TIFF_PTRDIFF_T
-
-/* Size type formatter */
-#undef TIFF_SIZE_FORMAT
-
-/* Unsigned size type */
-#undef TIFF_SIZE_T
-
-/* Signed size type formatter */
-#undef TIFF_SSIZE_FORMAT
-
-/* Signed size type */
-#undef TIFF_SSIZE_T
-
-/* Unsigned 16-bit type */
-#undef TIFF_UINT16_T
-
-/* Unsigned 32-bit type formatter */
-#undef TIFF_UINT32_FORMAT
-
-/* Unsigned 32-bit type */
-#undef TIFF_UINT32_T
-
-/* Unsigned 64-bit type formatter */
-#undef TIFF_UINT64_FORMAT
-
-/* Unsigned 64-bit type */
-#undef TIFF_UINT64_T
-
-/* Unsigned 8-bit type */
-#undef TIFF_UINT8_T
-
-/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#undef TIME_WITH_SYS_TIME
-
-/* Define to 1 if your <sys/time.h> declares `struct tm'. */
-#undef TM_IN_SYS_TIME
-
/* define to use win32 IO system */
#undef USE_WIN32_FILEIO
@@ -332,12 +136,6 @@
# endif
#endif
-/* Define to 1 if the X Window System is missing or not being used. */
-#undef X_DISPLAY_MISSING
-
-/* Support Deflate compression */
-#undef ZIP_SUPPORT
-
/* Support zstd compression */
#undef ZSTD_SUPPORT
@@ -355,17 +153,19 @@
/* Define for large files, on AIX-style hosts. */
#undef _LARGE_FILES
-/* Define to empty if `const' does not conform to ANSI C. */
-#undef const
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#undef inline
+#if !defined(__MINGW32__)
+# define TIFF_SIZE_FORMAT "zu"
+#endif
+#if SIZEOF_SIZE_T == 8
+# define TIFF_SSIZE_FORMAT PRId64
+# if defined(__MINGW32__)
+# define TIFF_SIZE_FORMAT PRIu64
+# endif
+#elif SIZEOF_SIZE_T == 4
+# define TIFF_SSIZE_FORMAT PRId32
+# if defined(__MINGW32__)
+# define TIFF_SIZE_FORMAT PRIu32
+# endif
+#else
+# error "Unsupported size_t size; please submit a bug report"
#endif
-
-/* Define to `long int' if <sys/types.h> does not define. */
-#undef off_t
-
-/* Define to `unsigned int' if <sys/types.h> does not define. */
-#undef size_t
diff --git a/tiff/libtiff/tif_config.vc.h b/tiff/libtiff/tif_config.vc.h
index 939594f8..5cebfa02 100644
--- a/tiff/libtiff/tif_config.vc.h
+++ b/tiff/libtiff/tif_config.vc.h
@@ -104,24 +104,11 @@
/* Set the native cpu bit order */
#define HOST_FILLORDER FILLORDER_LSB2MSB
-/*
- Please see associated settings in "nmake.opt" which configure porting
- settings. It should not be necessary to edit the following pre-processor
- logic.
-*/
-#if defined(_MSC_VER)
/* Visual Studio 2015 / VC 14 / MSVC 19.00 finally has snprintf() */
-# if _MSC_VER < 1900 /* Visual C++ 2015 */
-# define snprintf _snprintf
-# else
-# define HAVE_SNPRINTF 1
-# endif
-# define HAVE_STRTOL 1
-# define HAVE_STRTOUL 1
-# if _MSC_VER >= 1900 /* Visual Studio 2015 added strtoll/strtoull */
-# define HAVE_STRTOLL 1
-# define HAVE_STRTOULL 1
-# endif
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define snprintf _snprintf
+#else
+#define HAVE_SNPRINTF 1
#endif
/* Define to 1 if your processor stores words with the most significant byte
diff --git a/tiff/libtiff/tif_config.wince.h b/tiff/libtiff/tif_config.wince.h
deleted file mode 100644
index e85e2e62..00000000
--- a/tiff/libtiff/tif_config.wince.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * TIFF library configuration header for Windows CE platform.
- */
-#ifndef _WIN32_WCE
-# error This version of tif_config.h header is dedicated for Windows CE platform!
-#endif
-
-/* Define to 1 if you have the <assert.h> header file. */
-#define HAVE_ASSERT_H 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define as 0 or 1 according to the floating point format suported by the
- machine */
-#define HAVE_IEEEFP 1
-
-/* Define to 1 if you have the `jbg_newlen' function. */
-#define HAVE_JBG_NEWLEN 1
-
-/* Define to 1 if you have the <string.h> header file. */
-#define HAVE_STRING_H 1
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <io.h> header file. */
-#define HAVE_IO_H 1
-
-/* Define to 1 if you have the <search.h> header file. */
-#define HAVE_SEARCH_H 1
-
-/* Define to 1 if you have the `setmode' function. */
-#define HAVE_SETMODE 1
-
-/* Define to 1 if you have the `bsearch' function. */
-#define HAVE_BSEARCH 1
-#define bsearch wceex_bsearch
-
-/* Define to 1 if you have the `lfind' function. */
-#define HAVE_LFIND 1
-#define lfind wceex_lfind
-
-/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* Set the native cpu bit order */
-#define HOST_FILLORDER FILLORDER_LSB2MSB
-
-/* Define to 1 if your processor stores words with the most significant byte
- first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
-
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-# ifndef inline
-# define inline __inline
-# endif
-#endif
-
-
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 8
- * fill-column: 78
- * End:
- */
diff --git a/tiff/libtiff/tif_dir.c b/tiff/libtiff/tif_dir.c
index 347b7115..a6c254fc 100644
--- a/tiff/libtiff/tif_dir.c
+++ b/tiff/libtiff/tif_dir.c
@@ -54,21 +54,21 @@ setByteArray(void** vpp, void* vp, size_t nmemb, size_t elem_size)
_TIFFmemcpy(*vpp, vp, bytes);
}
}
-void _TIFFsetByteArray(void** vpp, void* vp, uint32 n)
+void _TIFFsetByteArray(void** vpp, void* vp, uint32_t n)
{ setByteArray(vpp, vp, n, 1); }
void _TIFFsetString(char** cpp, char* cp)
{ setByteArray((void**) cpp, (void*) cp, strlen(cp)+1, 1); }
-static void _TIFFsetNString(char** cpp, char* cp, uint32 n)
+static void _TIFFsetNString(char** cpp, char* cp, uint32_t n)
{ setByteArray((void**) cpp, (void*) cp, n, 1); }
-void _TIFFsetShortArray(uint16** wpp, uint16* wp, uint32 n)
- { setByteArray((void**) wpp, (void*) wp, n, sizeof (uint16)); }
-void _TIFFsetLongArray(uint32** lpp, uint32* lp, uint32 n)
- { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint32)); }
-static void _TIFFsetLong8Array(uint64** lpp, uint64* lp, uint32 n)
- { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint64)); }
-void _TIFFsetFloatArray(float** fpp, float* fp, uint32 n)
+void _TIFFsetShortArray(uint16_t** wpp, uint16_t* wp, uint32_t n)
+ { setByteArray((void**) wpp, (void*) wp, n, sizeof (uint16_t)); }
+void _TIFFsetLongArray(uint32_t** lpp, uint32_t* lp, uint32_t n)
+ { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint32_t)); }
+static void _TIFFsetLong8Array(uint64_t** lpp, uint64_t* lp, uint32_t n)
+ { setByteArray((void**) lpp, (void*) lp, n, sizeof (uint64_t)); }
+void _TIFFsetFloatArray(float** fpp, float* fp, uint32_t n)
{ setByteArray((void**) fpp, (void*) fp, n, sizeof (float)); }
-void _TIFFsetDoubleArray(double** dpp, double* dp, uint32 n)
+void _TIFFsetDoubleArray(double** dpp, double* dp, uint32_t n)
{ setByteArray((void**) dpp, (void*) dp, n, sizeof (double)); }
static void
@@ -88,20 +88,20 @@ setDoubleArrayOneValue(double** vpp, double value, size_t nmemb)
* Install extra samples information.
*/
static int
-setExtraSamples(TIFF* tif, va_list ap, uint32* v)
+setExtraSamples(TIFF* tif, va_list ap, uint32_t* v)
{
/* XXX: Unassociated alpha data == 999 is a known Corel Draw bug, see below */
#define EXTRASAMPLE_COREL_UNASSALPHA 999
- uint16* va;
- uint32 i;
+ uint16_t* va;
+ uint32_t i;
TIFFDirectory* td = &tif->tif_dir;
static const char module[] = "setExtraSamples";
- *v = (uint16) va_arg(ap, uint16_vap);
- if ((uint16) *v > td->td_samplesperpixel)
+ *v = (uint16_t) va_arg(ap, uint16_vap);
+ if ((uint16_t) *v > td->td_samplesperpixel)
return 0;
- va = va_arg(ap, uint16*);
+ va = va_arg(ap, uint16_t*);
if (*v > 0 && va == NULL) /* typically missing param */
return 0;
for (i = 0; i < *v; i++) {
@@ -130,7 +130,7 @@ setExtraSamples(TIFF* tif, va_list ap, uint32* v)
td->td_transferfunction[0] = NULL;
}
- td->td_extrasamples = (uint16) *v;
+ td->td_extrasamples = (uint16_t) *v;
_TIFFsetShortArray(&td->td_sampleinfo, va, td->td_extrasamples);
return 1;
@@ -141,11 +141,11 @@ setExtraSamples(TIFF* tif, va_list ap, uint32* v)
* Confirm we have "samplesperpixel" ink names separated by \0. Returns
* zero if the ink names are not as expected.
*/
-static uint32
-checkInkNamesString(TIFF* tif, uint32 slen, const char* s)
+static uint32_t
+checkInkNamesString(TIFF* tif, uint32_t slen, const char* s)
{
TIFFDirectory* td = &tif->tif_dir;
- uint16 i = td->td_samplesperpixel;
+ uint16_t i = td->td_samplesperpixel;
if (slen > 0) {
const char* ep = s+slen;
@@ -156,29 +156,29 @@ checkInkNamesString(TIFF* tif, uint32 slen, const char* s)
goto bad;
cp++; /* skip \0 */
}
- return ((uint32)(cp-s));
+ return ((uint32_t)(cp - s));
}
bad:
TIFFErrorExt(tif->tif_clientdata, "TIFFSetField",
- "%s: Invalid InkNames value; expecting %d names, found %d",
+ "%s: Invalid InkNames value; expecting %"PRIu16" names, found %"PRIu16,
tif->tif_name,
td->td_samplesperpixel,
- td->td_samplesperpixel-i);
+ (uint16_t)(td->td_samplesperpixel-i));
return (0);
}
static int
-_TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
+_TIFFVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
static const char module[] = "_TIFFVSetField";
TIFFDirectory* td = &tif->tif_dir;
int status = 1;
- uint32 v32, i, v;
+ uint32_t v32, i, v;
double dblval;
char* s;
const TIFFField *fip = TIFFFindField(tif, tag, TIFF_ANY);
- uint32 standard_tag = tag;
+ uint32_t standard_tag = tag;
if( fip == NULL ) /* cannot happen since OkToChangeTag() already checks it */
return 0;
/*
@@ -193,16 +193,16 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
switch (standard_tag) {
case TIFFTAG_SUBFILETYPE:
- td->td_subfiletype = (uint32) va_arg(ap, uint32);
+ td->td_subfiletype = (uint32_t) va_arg(ap, uint32_t);
break;
case TIFFTAG_IMAGEWIDTH:
- td->td_imagewidth = (uint32) va_arg(ap, uint32);
+ td->td_imagewidth = (uint32_t) va_arg(ap, uint32_t);
break;
case TIFFTAG_IMAGELENGTH:
- td->td_imagelength = (uint32) va_arg(ap, uint32);
+ td->td_imagelength = (uint32_t) va_arg(ap, uint32_t);
break;
case TIFFTAG_BITSPERSAMPLE:
- td->td_bitspersample = (uint16) va_arg(ap, uint16_vap);
+ td->td_bitspersample = (uint16_t) va_arg(ap, uint16_vap);
/*
* If the data require post-decoding processing to byte-swap
* samples, set it up here. Note that since tags are required
@@ -226,14 +226,14 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
}
break;
case TIFFTAG_COMPRESSION:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
/*
* If we're changing the compression scheme, the notify the
* previous module so that it can cleanup any state it's
* setup.
*/
if (TIFFFieldSet(tif, FIELD_COMPRESSION)) {
- if ((uint32)td->td_compression == v)
+ if ((uint32_t)td->td_compression == v)
break;
(*tif->tif_cleanup)(tif);
tif->tif_flags &= ~TIFF_CODERSETUP;
@@ -242,31 +242,31 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
* Setup new compression routine state.
*/
if( (status = TIFFSetCompressionScheme(tif, v)) != 0 )
- td->td_compression = (uint16) v;
+ td->td_compression = (uint16_t) v;
else
status = 0;
break;
case TIFFTAG_PHOTOMETRIC:
- td->td_photometric = (uint16) va_arg(ap, uint16_vap);
+ td->td_photometric = (uint16_t) va_arg(ap, uint16_vap);
break;
case TIFFTAG_THRESHHOLDING:
- td->td_threshholding = (uint16) va_arg(ap, uint16_vap);
+ td->td_threshholding = (uint16_t) va_arg(ap, uint16_vap);
break;
case TIFFTAG_FILLORDER:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
if (v != FILLORDER_LSB2MSB && v != FILLORDER_MSB2LSB)
goto badvalue;
- td->td_fillorder = (uint16) v;
+ td->td_fillorder = (uint16_t) v;
break;
case TIFFTAG_ORIENTATION:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
if (v < ORIENTATION_TOPLEFT || ORIENTATION_LEFTBOT < v)
goto badvalue;
else
- td->td_orientation = (uint16) v;
+ td->td_orientation = (uint16_t) v;
break;
case TIFFTAG_SAMPLESPERPIXEL:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
if (v == 0)
goto badvalue;
if( v != td->td_samplesperpixel )
@@ -303,10 +303,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
td->td_transferfunction[0] = NULL;
}
}
- td->td_samplesperpixel = (uint16) v;
+ td->td_samplesperpixel = (uint16_t) v;
break;
case TIFFTAG_ROWSPERSTRIP:
- v32 = (uint32) va_arg(ap, uint32);
+ v32 = (uint32_t) va_arg(ap, uint32_t);
if (v32 == 0)
goto badvalue32;
td->td_rowsperstrip = v32;
@@ -316,10 +316,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
}
break;
case TIFFTAG_MINSAMPLEVALUE:
- td->td_minsamplevalue = (uint16) va_arg(ap, uint16_vap);
+ td->td_minsamplevalue = (uint16_t) va_arg(ap, uint16_vap);
break;
case TIFFTAG_MAXSAMPLEVALUE:
- td->td_maxsamplevalue = (uint16) va_arg(ap, uint16_vap);
+ td->td_maxsamplevalue = (uint16_t) va_arg(ap, uint16_vap);
break;
case TIFFTAG_SMINSAMPLEVALUE:
if (tif->tif_flags & TIFF_PERSAMPLE)
@@ -346,10 +346,10 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
td->td_yresolution = _TIFFClampDoubleToFloat( dblval );
break;
case TIFFTAG_PLANARCONFIG:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
if (v != PLANARCONFIG_CONTIG && v != PLANARCONFIG_SEPARATE)
goto badvalue;
- td->td_planarconfig = (uint16) v;
+ td->td_planarconfig = (uint16_t) v;
break;
case TIFFTAG_XPOSITION:
td->td_xposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
@@ -358,66 +358,66 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
td->td_yposition = _TIFFClampDoubleToFloat( va_arg(ap, double) );
break;
case TIFFTAG_RESOLUTIONUNIT:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
if (v < RESUNIT_NONE || RESUNIT_CENTIMETER < v)
goto badvalue;
- td->td_resolutionunit = (uint16) v;
+ td->td_resolutionunit = (uint16_t) v;
break;
case TIFFTAG_PAGENUMBER:
- td->td_pagenumber[0] = (uint16) va_arg(ap, uint16_vap);
- td->td_pagenumber[1] = (uint16) va_arg(ap, uint16_vap);
+ td->td_pagenumber[0] = (uint16_t) va_arg(ap, uint16_vap);
+ td->td_pagenumber[1] = (uint16_t) va_arg(ap, uint16_vap);
break;
case TIFFTAG_HALFTONEHINTS:
- td->td_halftonehints[0] = (uint16) va_arg(ap, uint16_vap);
- td->td_halftonehints[1] = (uint16) va_arg(ap, uint16_vap);
+ td->td_halftonehints[0] = (uint16_t) va_arg(ap, uint16_vap);
+ td->td_halftonehints[1] = (uint16_t) va_arg(ap, uint16_vap);
break;
case TIFFTAG_COLORMAP:
- v32 = (uint32)(1L<<td->td_bitspersample);
- _TIFFsetShortArray(&td->td_colormap[0], va_arg(ap, uint16*), v32);
- _TIFFsetShortArray(&td->td_colormap[1], va_arg(ap, uint16*), v32);
- _TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16*), v32);
+ v32 = (uint32_t)(1L << td->td_bitspersample);
+ _TIFFsetShortArray(&td->td_colormap[0], va_arg(ap, uint16_t*), v32);
+ _TIFFsetShortArray(&td->td_colormap[1], va_arg(ap, uint16_t*), v32);
+ _TIFFsetShortArray(&td->td_colormap[2], va_arg(ap, uint16_t*), v32);
break;
case TIFFTAG_EXTRASAMPLES:
if (!setExtraSamples(tif, ap, &v))
goto badvalue;
break;
case TIFFTAG_MATTEING:
- td->td_extrasamples = (((uint16) va_arg(ap, uint16_vap)) != 0);
+ td->td_extrasamples = (((uint16_t) va_arg(ap, uint16_vap)) != 0);
if (td->td_extrasamples) {
- uint16 sv = EXTRASAMPLE_ASSOCALPHA;
+ uint16_t sv = EXTRASAMPLE_ASSOCALPHA;
_TIFFsetShortArray(&td->td_sampleinfo, &sv, 1);
}
break;
case TIFFTAG_TILEWIDTH:
- v32 = (uint32) va_arg(ap, uint32);
+ v32 = (uint32_t) va_arg(ap, uint32_t);
if (v32 % 16) {
if (tif->tif_mode != O_RDONLY)
goto badvalue32;
TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
- "Nonstandard tile width %u, convert file", v32);
+ "Nonstandard tile width %"PRIu32", convert file", v32);
}
td->td_tilewidth = v32;
tif->tif_flags |= TIFF_ISTILED;
break;
case TIFFTAG_TILELENGTH:
- v32 = (uint32) va_arg(ap, uint32);
+ v32 = (uint32_t) va_arg(ap, uint32_t);
if (v32 % 16) {
if (tif->tif_mode != O_RDONLY)
goto badvalue32;
TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
- "Nonstandard tile length %u, convert file", v32);
+ "Nonstandard tile length %"PRIu32", convert file", v32);
}
td->td_tilelength = v32;
tif->tif_flags |= TIFF_ISTILED;
break;
case TIFFTAG_TILEDEPTH:
- v32 = (uint32) va_arg(ap, uint32);
+ v32 = (uint32_t) va_arg(ap, uint32_t);
if (v32 == 0)
goto badvalue32;
td->td_tiledepth = v32;
break;
case TIFFTAG_DATATYPE:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
switch (v) {
case DATATYPE_VOID: v = SAMPLEFORMAT_VOID; break;
case DATATYPE_INT: v = SAMPLEFORMAT_INT; break;
@@ -425,13 +425,13 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
case DATATYPE_IEEEFP: v = SAMPLEFORMAT_IEEEFP;break;
default: goto badvalue;
}
- td->td_sampleformat = (uint16) v;
+ td->td_sampleformat = (uint16_t) v;
break;
case TIFFTAG_SAMPLEFORMAT:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
if (v < SAMPLEFORMAT_UINT || SAMPLEFORMAT_COMPLEXIEEEFP < v)
goto badvalue;
- td->td_sampleformat = (uint16) v;
+ td->td_sampleformat = (uint16_t) v;
/* Try to fix up the SWAB function for complex data. */
if( td->td_sampleformat == SAMPLEFORMAT_COMPLEXINT
@@ -445,13 +445,13 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
tif->tif_postdecode = _TIFFSwab32BitData;
break;
case TIFFTAG_IMAGEDEPTH:
- td->td_imagedepth = (uint32) va_arg(ap, uint32);
+ td->td_imagedepth = (uint32_t) va_arg(ap, uint32_t);
break;
case TIFFTAG_SUBIFD:
if ((tif->tif_flags & TIFF_INSUBIFD) == 0) {
- td->td_nsubifd = (uint16) va_arg(ap, uint16_vap);
- _TIFFsetLong8Array(&td->td_subifd, (uint64*) va_arg(ap, uint64*),
- (uint32) td->td_nsubifd);
+ td->td_nsubifd = (uint16_t) va_arg(ap, uint16_vap);
+ _TIFFsetLong8Array(&td->td_subifd, (uint64_t*) va_arg(ap, uint64_t*),
+ (uint32_t) td->td_nsubifd);
} else {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: Sorry, cannot nest SubIFDs",
@@ -460,24 +460,24 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
}
break;
case TIFFTAG_YCBCRPOSITIONING:
- td->td_ycbcrpositioning = (uint16) va_arg(ap, uint16_vap);
+ td->td_ycbcrpositioning = (uint16_t) va_arg(ap, uint16_vap);
break;
case TIFFTAG_YCBCRSUBSAMPLING:
- td->td_ycbcrsubsampling[0] = (uint16) va_arg(ap, uint16_vap);
- td->td_ycbcrsubsampling[1] = (uint16) va_arg(ap, uint16_vap);
+ td->td_ycbcrsubsampling[0] = (uint16_t) va_arg(ap, uint16_vap);
+ td->td_ycbcrsubsampling[1] = (uint16_t) va_arg(ap, uint16_vap);
break;
case TIFFTAG_TRANSFERFUNCTION:
v = (td->td_samplesperpixel - td->td_extrasamples) > 1 ? 3 : 1;
for (i = 0; i < v; i++)
_TIFFsetShortArray(&td->td_transferfunction[i],
- va_arg(ap, uint16*), 1U<<td->td_bitspersample);
+ va_arg(ap, uint16_t*), 1U << td->td_bitspersample);
break;
case TIFFTAG_REFERENCEBLACKWHITE:
/* XXX should check for null range */
_TIFFsetFloatArray(&td->td_refblackwhite, va_arg(ap, float*), 6);
break;
case TIFFTAG_INKNAMES:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
s = va_arg(ap, char*);
v = checkInkNamesString(tif, v, s);
status = v > 0;
@@ -487,7 +487,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
}
break;
case TIFFTAG_PERSAMPLE:
- v = (uint16) va_arg(ap, uint16_vap);
+ v = (uint16_t) va_arg(ap, uint16_vap);
if( v == PERSAMPLE_MULTI )
tif->tif_flags |= TIFF_PERSAMPLE;
else
@@ -575,18 +575,18 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
if (fip->field_type == TIFF_ASCII)
{
- uint32 ma;
+ uint32_t ma;
char* mb;
if (fip->field_passcount)
{
assert(fip->field_writecount==TIFF_VARIABLE2);
- ma=(uint32)va_arg(ap,uint32);
+ ma=(uint32_t)va_arg(ap, uint32_t);
mb=(char*)va_arg(ap,char*);
}
else
{
mb=(char*)va_arg(ap,char*);
- ma=(uint32)(strlen(mb)+1);
+ ma=(uint32_t)(strlen(mb) + 1);
}
tv->count=ma;
setByteArray(&tv->value,mb,ma,1);
@@ -595,7 +595,7 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
{
if (fip->field_passcount) {
if (fip->field_writecount == TIFF_VARIABLE2)
- tv->count = (uint32) va_arg(ap, uint32);
+ tv->count = (uint32_t) va_arg(ap, uint32_t);
else
tv->count = (int) va_arg(ap, int);
} else if (fip->field_writecount == TIFF_VARIABLE
@@ -632,9 +632,9 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
handled this way ... likely best if we move it into
the directory structure with an explicit field in
libtiff 4.1 and assign it a FIELD_ value */
- uint16 v2[2];
- v2[0] = (uint16)va_arg(ap, int);
- v2[1] = (uint16)va_arg(ap, int);
+ uint16_t v2[2];
+ v2[0] = (uint16_t)va_arg(ap, int);
+ v2[1] = (uint16_t)va_arg(ap, int);
_TIFFmemcpy(tv->value, &v2, 4);
}
@@ -654,51 +654,51 @@ _TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
case TIFF_BYTE:
case TIFF_UNDEFINED:
{
- uint8 v2 = (uint8)va_arg(ap, int);
+ uint8_t v2 = (uint8_t)va_arg(ap, int);
_TIFFmemcpy(val, &v2, tv_size);
}
break;
case TIFF_SBYTE:
{
- int8 v2 = (int8)va_arg(ap, int);
+ int8_t v2 = (int8_t)va_arg(ap, int);
_TIFFmemcpy(val, &v2, tv_size);
}
break;
case TIFF_SHORT:
{
- uint16 v2 = (uint16)va_arg(ap, int);
+ uint16_t v2 = (uint16_t)va_arg(ap, int);
_TIFFmemcpy(val, &v2, tv_size);
}
break;
case TIFF_SSHORT:
{
- int16 v2 = (int16)va_arg(ap, int);
+ int16_t v2 = (int16_t)va_arg(ap, int);
_TIFFmemcpy(val, &v2, tv_size);
}
break;
case TIFF_LONG:
case TIFF_IFD:
{
- uint32 v2 = va_arg(ap, uint32);
+ uint32_t v2 = va_arg(ap, uint32_t);
_TIFFmemcpy(val, &v2, tv_size);
}
break;
case TIFF_SLONG:
{
- int32 v2 = va_arg(ap, int32);
+ int32_t v2 = va_arg(ap, int32_t);
_TIFFmemcpy(val, &v2, tv_size);
}
break;
case TIFF_LONG8:
case TIFF_IFD8:
{
- uint64 v2 = va_arg(ap, uint64);
+ uint64_t v2 = va_arg(ap, uint64_t);
_TIFFmemcpy(val, &v2, tv_size);
}
break;
case TIFF_SLONG8:
{
- int64 v2 = va_arg(ap, int64);
+ int64_t v2 = va_arg(ap, int64_t);
_TIFFmemcpy(val, &v2, tv_size);
}
break;
@@ -755,7 +755,7 @@ badvalue:
{
const TIFFField* fip2=TIFFFieldWithTag(tif,tag);
TIFFErrorExt(tif->tif_clientdata, module,
- "%s: Bad value %u for \"%s\" tag",
+ "%s: Bad value %"PRIu32" for \"%s\" tag",
tif->tif_name, v,
fip2 ? fip2->field_name : "Unknown");
va_end(ap);
@@ -765,7 +765,7 @@ badvalue32:
{
const TIFFField* fip2=TIFFFieldWithTag(tif,tag);
TIFFErrorExt(tif->tif_clientdata, module,
- "%s: Bad value %u for \"%s\" tag",
+ "%s: Bad value %"PRIu32" for \"%s\" tag",
tif->tif_name, v32,
fip2 ? fip2->field_name : "Unknown");
va_end(ap);
@@ -793,11 +793,11 @@ badvaluedouble:
* on the format of the data that is written.
*/
static int
-OkToChangeTag(TIFF* tif, uint32 tag)
+OkToChangeTag(TIFF* tif, uint32_t tag)
{
const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
if (!fip) { /* unknown tag */
- TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", "%s: Unknown %stag %u",
+ TIFFErrorExt(tif->tif_clientdata, "TIFFSetField", "%s: Unknown %stag %"PRIu32,
tif->tif_name, isPseudoTag(tag) ? "pseudo-" : "", tag);
return (0);
}
@@ -825,7 +825,7 @@ OkToChangeTag(TIFF* tif, uint32 tag)
* updated.
*/
int
-TIFFSetField(TIFF* tif, uint32 tag, ...)
+TIFFSetField(TIFF* tif, uint32_t tag, ...)
{
va_list ap;
int status;
@@ -840,7 +840,7 @@ TIFFSetField(TIFF* tif, uint32 tag, ...)
* Clear the contents of the field in the internal structure.
*/
int
-TIFFUnsetField(TIFF* tif, uint32 tag)
+TIFFUnsetField(TIFF* tif, uint32_t tag)
{
const TIFFField *fip = TIFFFieldWithTag(tif, tag);
TIFFDirectory* td = &tif->tif_dir;
@@ -884,18 +884,18 @@ TIFFUnsetField(TIFF* tif, uint32 tag)
* top of the library.
*/
int
-TIFFVSetField(TIFF* tif, uint32 tag, va_list ap)
+TIFFVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
return OkToChangeTag(tif, tag) ?
(*tif->tif_tagmethods.vsetfield)(tif, tag, ap) : 0;
}
static int
-_TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
+_TIFFVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
TIFFDirectory* td = &tif->tif_dir;
int ret_val = 1;
- uint32 standard_tag = tag;
+ uint32_t standard_tag = tag;
const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
if( fip == NULL ) /* cannot happen since TIFFGetField() already checks it */
return 0;
@@ -914,13 +914,13 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
{
int i;
for (i = 0; i < td->td_customValueCount; i++) {
- uint16 val;
+ uint16_t val;
TIFFTagValue *tv = td->td_customValues + i;
if (tv->info->field_tag != standard_tag)
continue;
if( tv->value == NULL )
return 0;
- val = *(uint16 *)tv->value;
+ val = *(uint16_t *)tv->value;
/* Truncate to SamplesPerPixel, since the */
/* setting code for INKNAMES assume that there are SamplesPerPixel */
/* inknames. */
@@ -928,11 +928,11 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
if( val > td->td_samplesperpixel )
{
TIFFWarningExt(tif->tif_clientdata,"_TIFFVGetField",
- "Truncating NumberOfInks from %u to %u",
+ "Truncating NumberOfInks from %u to %"PRIu16,
val, td->td_samplesperpixel);
val = td->td_samplesperpixel;
}
- *va_arg(ap, uint16*) = val;
+ *va_arg(ap, uint16_t*) = val;
return 1;
}
return 0;
@@ -940,43 +940,43 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
switch (standard_tag) {
case TIFFTAG_SUBFILETYPE:
- *va_arg(ap, uint32*) = td->td_subfiletype;
+ *va_arg(ap, uint32_t*) = td->td_subfiletype;
break;
case TIFFTAG_IMAGEWIDTH:
- *va_arg(ap, uint32*) = td->td_imagewidth;
+ *va_arg(ap, uint32_t*) = td->td_imagewidth;
break;
case TIFFTAG_IMAGELENGTH:
- *va_arg(ap, uint32*) = td->td_imagelength;
+ *va_arg(ap, uint32_t*) = td->td_imagelength;
break;
case TIFFTAG_BITSPERSAMPLE:
- *va_arg(ap, uint16*) = td->td_bitspersample;
+ *va_arg(ap, uint16_t*) = td->td_bitspersample;
break;
case TIFFTAG_COMPRESSION:
- *va_arg(ap, uint16*) = td->td_compression;
+ *va_arg(ap, uint16_t*) = td->td_compression;
break;
case TIFFTAG_PHOTOMETRIC:
- *va_arg(ap, uint16*) = td->td_photometric;
+ *va_arg(ap, uint16_t*) = td->td_photometric;
break;
case TIFFTAG_THRESHHOLDING:
- *va_arg(ap, uint16*) = td->td_threshholding;
+ *va_arg(ap, uint16_t*) = td->td_threshholding;
break;
case TIFFTAG_FILLORDER:
- *va_arg(ap, uint16*) = td->td_fillorder;
+ *va_arg(ap, uint16_t*) = td->td_fillorder;
break;
case TIFFTAG_ORIENTATION:
- *va_arg(ap, uint16*) = td->td_orientation;
+ *va_arg(ap, uint16_t*) = td->td_orientation;
break;
case TIFFTAG_SAMPLESPERPIXEL:
- *va_arg(ap, uint16*) = td->td_samplesperpixel;
+ *va_arg(ap, uint16_t*) = td->td_samplesperpixel;
break;
case TIFFTAG_ROWSPERSTRIP:
- *va_arg(ap, uint32*) = td->td_rowsperstrip;
+ *va_arg(ap, uint32_t*) = td->td_rowsperstrip;
break;
case TIFFTAG_MINSAMPLEVALUE:
- *va_arg(ap, uint16*) = td->td_minsamplevalue;
+ *va_arg(ap, uint16_t*) = td->td_minsamplevalue;
break;
case TIFFTAG_MAXSAMPLEVALUE:
- *va_arg(ap, uint16*) = td->td_maxsamplevalue;
+ *va_arg(ap, uint16_t*) = td->td_maxsamplevalue;
break;
case TIFFTAG_SMINSAMPLEVALUE:
if (tif->tif_flags & TIFF_PERSAMPLE)
@@ -984,7 +984,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
else
{
/* libtiff historically treats this as a single value. */
- uint16 i;
+ uint16_t i;
double v = td->td_sminsamplevalue[0];
for (i=1; i < td->td_samplesperpixel; ++i)
if( td->td_sminsamplevalue[i] < v )
@@ -998,7 +998,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
else
{
/* libtiff historically treats this as a single value. */
- uint16 i;
+ uint16_t i;
double v = td->td_smaxsamplevalue[0];
for (i=1; i < td->td_samplesperpixel; ++i)
if( td->td_smaxsamplevalue[i] > v )
@@ -1013,7 +1013,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
*va_arg(ap, float*) = td->td_yresolution;
break;
case TIFFTAG_PLANARCONFIG:
- *va_arg(ap, uint16*) = td->td_planarconfig;
+ *va_arg(ap, uint16_t*) = td->td_planarconfig;
break;
case TIFFTAG_XPOSITION:
*va_arg(ap, float*) = td->td_xposition;
@@ -1022,90 +1022,90 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
*va_arg(ap, float*) = td->td_yposition;
break;
case TIFFTAG_RESOLUTIONUNIT:
- *va_arg(ap, uint16*) = td->td_resolutionunit;
+ *va_arg(ap, uint16_t*) = td->td_resolutionunit;
break;
case TIFFTAG_PAGENUMBER:
- *va_arg(ap, uint16*) = td->td_pagenumber[0];
- *va_arg(ap, uint16*) = td->td_pagenumber[1];
+ *va_arg(ap, uint16_t*) = td->td_pagenumber[0];
+ *va_arg(ap, uint16_t*) = td->td_pagenumber[1];
break;
case TIFFTAG_HALFTONEHINTS:
- *va_arg(ap, uint16*) = td->td_halftonehints[0];
- *va_arg(ap, uint16*) = td->td_halftonehints[1];
+ *va_arg(ap, uint16_t*) = td->td_halftonehints[0];
+ *va_arg(ap, uint16_t*) = td->td_halftonehints[1];
break;
case TIFFTAG_COLORMAP:
- *va_arg(ap, const uint16**) = td->td_colormap[0];
- *va_arg(ap, const uint16**) = td->td_colormap[1];
- *va_arg(ap, const uint16**) = td->td_colormap[2];
+ *va_arg(ap, const uint16_t**) = td->td_colormap[0];
+ *va_arg(ap, const uint16_t**) = td->td_colormap[1];
+ *va_arg(ap, const uint16_t**) = td->td_colormap[2];
break;
case TIFFTAG_STRIPOFFSETS:
case TIFFTAG_TILEOFFSETS:
_TIFFFillStriles( tif );
- *va_arg(ap, const uint64**) = td->td_stripoffset_p;
+ *va_arg(ap, const uint64_t**) = td->td_stripoffset_p;
break;
case TIFFTAG_STRIPBYTECOUNTS:
case TIFFTAG_TILEBYTECOUNTS:
_TIFFFillStriles( tif );
- *va_arg(ap, const uint64**) = td->td_stripbytecount_p;
+ *va_arg(ap, const uint64_t**) = td->td_stripbytecount_p;
break;
case TIFFTAG_MATTEING:
- *va_arg(ap, uint16*) =
+ *va_arg(ap, uint16_t*) =
(td->td_extrasamples == 1 &&
td->td_sampleinfo[0] == EXTRASAMPLE_ASSOCALPHA);
break;
case TIFFTAG_EXTRASAMPLES:
- *va_arg(ap, uint16*) = td->td_extrasamples;
- *va_arg(ap, const uint16**) = td->td_sampleinfo;
+ *va_arg(ap, uint16_t*) = td->td_extrasamples;
+ *va_arg(ap, const uint16_t**) = td->td_sampleinfo;
break;
case TIFFTAG_TILEWIDTH:
- *va_arg(ap, uint32*) = td->td_tilewidth;
+ *va_arg(ap, uint32_t*) = td->td_tilewidth;
break;
case TIFFTAG_TILELENGTH:
- *va_arg(ap, uint32*) = td->td_tilelength;
+ *va_arg(ap, uint32_t*) = td->td_tilelength;
break;
case TIFFTAG_TILEDEPTH:
- *va_arg(ap, uint32*) = td->td_tiledepth;
+ *va_arg(ap, uint32_t*) = td->td_tiledepth;
break;
case TIFFTAG_DATATYPE:
switch (td->td_sampleformat) {
case SAMPLEFORMAT_UINT:
- *va_arg(ap, uint16*) = DATATYPE_UINT;
+ *va_arg(ap, uint16_t*) = DATATYPE_UINT;
break;
case SAMPLEFORMAT_INT:
- *va_arg(ap, uint16*) = DATATYPE_INT;
+ *va_arg(ap, uint16_t*) = DATATYPE_INT;
break;
case SAMPLEFORMAT_IEEEFP:
- *va_arg(ap, uint16*) = DATATYPE_IEEEFP;
+ *va_arg(ap, uint16_t*) = DATATYPE_IEEEFP;
break;
case SAMPLEFORMAT_VOID:
- *va_arg(ap, uint16*) = DATATYPE_VOID;
+ *va_arg(ap, uint16_t*) = DATATYPE_VOID;
break;
}
break;
case TIFFTAG_SAMPLEFORMAT:
- *va_arg(ap, uint16*) = td->td_sampleformat;
+ *va_arg(ap, uint16_t*) = td->td_sampleformat;
break;
case TIFFTAG_IMAGEDEPTH:
- *va_arg(ap, uint32*) = td->td_imagedepth;
+ *va_arg(ap, uint32_t*) = td->td_imagedepth;
break;
case TIFFTAG_SUBIFD:
- *va_arg(ap, uint16*) = td->td_nsubifd;
- *va_arg(ap, const uint64**) = td->td_subifd;
+ *va_arg(ap, uint16_t*) = td->td_nsubifd;
+ *va_arg(ap, const uint64_t**) = td->td_subifd;
break;
case TIFFTAG_YCBCRPOSITIONING:
- *va_arg(ap, uint16*) = td->td_ycbcrpositioning;
+ *va_arg(ap, uint16_t*) = td->td_ycbcrpositioning;
break;
case TIFFTAG_YCBCRSUBSAMPLING:
- *va_arg(ap, uint16*) = td->td_ycbcrsubsampling[0];
- *va_arg(ap, uint16*) = td->td_ycbcrsubsampling[1];
+ *va_arg(ap, uint16_t*) = td->td_ycbcrsubsampling[0];
+ *va_arg(ap, uint16_t*) = td->td_ycbcrsubsampling[1];
break;
case TIFFTAG_TRANSFERFUNCTION:
- *va_arg(ap, const uint16**) = td->td_transferfunction[0];
+ *va_arg(ap, const uint16_t**) = td->td_transferfunction[0];
if (td->td_samplesperpixel - td->td_extrasamples > 1) {
- *va_arg(ap, const uint16**) = td->td_transferfunction[1];
- *va_arg(ap, const uint16**) = td->td_transferfunction[2];
+ *va_arg(ap, const uint16_t**) = td->td_transferfunction[1];
+ *va_arg(ap, const uint16_t**) = td->td_transferfunction[2];
} else {
- *va_arg(ap, const uint16**) = NULL;
- *va_arg(ap, const uint16**) = NULL;
+ *va_arg(ap, const uint16_t**) = NULL;
+ *va_arg(ap, const uint16_t**) = NULL;
}
break;
case TIFFTAG_REFERENCEBLACKWHITE:
@@ -1151,9 +1151,9 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
if (fip->field_passcount) {
if (fip->field_readcount == TIFF_VARIABLE2)
- *va_arg(ap, uint32*) = (uint32)tv->count;
+ *va_arg(ap, uint32_t*) = (uint32_t)tv->count;
else /* Assume TIFF_VARIABLE */
- *va_arg(ap, uint16*) = (uint16)tv->count;
+ *va_arg(ap, uint16_t*) = (uint16_t)tv->count;
*va_arg(ap, const void **) = tv->value;
ret_val = 1;
} else if (fip->field_tag == TIFFTAG_DOTRANGE
@@ -1162,8 +1162,8 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
handled this way ... likely best if we move it into
the directory structure with an explicit field in
libtiff 4.1 and assign it a FIELD_ value */
- *va_arg(ap, uint16*) = ((uint16 *)tv->value)[0];
- *va_arg(ap, uint16*) = ((uint16 *)tv->value)[1];
+ *va_arg(ap, uint16_t*) = ((uint16_t *)tv->value)[0];
+ *va_arg(ap, uint16_t*) = ((uint16_t *)tv->value)[1];
ret_val = 1;
} else {
if (fip->field_type == TIFF_ASCII
@@ -1179,45 +1179,45 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
switch (fip->field_type) {
case TIFF_BYTE:
case TIFF_UNDEFINED:
- *va_arg(ap, uint8*) =
- *(uint8 *)val;
+ *va_arg(ap, uint8_t*) =
+ *(uint8_t *)val;
ret_val = 1;
break;
case TIFF_SBYTE:
- *va_arg(ap, int8*) =
- *(int8 *)val;
+ *va_arg(ap, int8_t*) =
+ *(int8_t *)val;
ret_val = 1;
break;
case TIFF_SHORT:
- *va_arg(ap, uint16*) =
- *(uint16 *)val;
+ *va_arg(ap, uint16_t*) =
+ *(uint16_t *)val;
ret_val = 1;
break;
case TIFF_SSHORT:
- *va_arg(ap, int16*) =
- *(int16 *)val;
+ *va_arg(ap, int16_t*) =
+ *(int16_t *)val;
ret_val = 1;
break;
case TIFF_LONG:
case TIFF_IFD:
- *va_arg(ap, uint32*) =
- *(uint32 *)val;
+ *va_arg(ap, uint32_t*) =
+ *(uint32_t *)val;
ret_val = 1;
break;
case TIFF_SLONG:
- *va_arg(ap, int32*) =
- *(int32 *)val;
+ *va_arg(ap, int32_t*) =
+ *(int32_t *)val;
ret_val = 1;
break;
case TIFF_LONG8:
case TIFF_IFD8:
- *va_arg(ap, uint64*) =
- *(uint64 *)val;
+ *va_arg(ap, uint64_t*) =
+ *(uint64_t *)val;
ret_val = 1;
break;
case TIFF_SLONG8:
- *va_arg(ap, int64*) =
- *(int64 *)val;
+ *va_arg(ap, int64_t*) =
+ *(int64_t *)val;
ret_val = 1;
break;
case TIFF_RATIONAL:
@@ -1267,7 +1267,7 @@ _TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
* internal directory structure.
*/
int
-TIFFGetField(TIFF* tif, uint32 tag, ...)
+TIFFGetField(TIFF* tif, uint32_t tag, ...)
{
int status;
va_list ap;
@@ -1285,7 +1285,7 @@ TIFFGetField(TIFF* tif, uint32 tag, ...)
* top of the library.
*/
int
-TIFFVGetField(TIFF* tif, uint32 tag, va_list ap)
+TIFFVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
return (fip && (isPseudoTag(tag) || TIFFFieldSet(tif, fip->field_bit)) ?
@@ -1368,8 +1368,8 @@ TIFFCreateDirectory(TIFF* tif)
tif->tif_diroff = 0;
tif->tif_nextdiroff = 0;
tif->tif_curoff = 0;
- tif->tif_row = (uint32) -1;
- tif->tif_curstrip = (uint32) -1;
+ tif->tif_row = (uint32_t) -1;
+ tif->tif_curstrip = (uint32_t) -1;
return 0;
}
@@ -1381,7 +1381,7 @@ TIFFCreateCustomDirectory(TIFF* tif, const TIFFFieldArray* infoarray)
/*
* Reset the field definitions to match the application provided list.
- * Hopefully TIFFDefaultDirectory() won't have done anything irreversable
+ * Hopefully TIFFDefaultDirectory() won't have done anything irreversible
* based on it's assumption this is an image directory.
*/
_TIFFSetupFields(tif, infoarray);
@@ -1389,8 +1389,8 @@ TIFFCreateCustomDirectory(TIFF* tif, const TIFFFieldArray* infoarray)
tif->tif_diroff = 0;
tif->tif_nextdiroff = 0;
tif->tif_curoff = 0;
- tif->tif_row = (uint32) -1;
- tif->tif_curstrip = (uint32) -1;
+ tif->tif_row = (uint32_t) -1;
+ tif->tif_curstrip = (uint32_t) -1;
return 0;
}
@@ -1432,7 +1432,7 @@ TIFFDefaultDirectory(TIFF* tif)
td->td_threshholding = THRESHHOLD_BILEVEL;
td->td_orientation = ORIENTATION_TOPLEFT;
td->td_samplesperpixel = 1;
- td->td_rowsperstrip = (uint32) -1;
+ td->td_rowsperstrip = (uint32_t) -1;
td->td_tilewidth = 0;
td->td_tilelength = 0;
td->td_tiledepth = 1;
@@ -1456,7 +1456,7 @@ TIFFDefaultDirectory(TIFF* tif)
* but do some prior cleanup first. (http://trac.osgeo.org/gdal/ticket/5054)
*/
if (tif->tif_nfieldscompat > 0) {
- uint32 i;
+ uint32_t i;
for (i = 0; i < tif->tif_nfieldscompat; i++) {
if (tif->tif_fieldscompat[i].allocated_size)
@@ -1490,38 +1490,38 @@ TIFFDefaultDirectory(TIFF* tif)
}
static int
-TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off)
+TIFFAdvanceDirectory(TIFF* tif, uint64_t* nextdir, uint64_t* off)
{
static const char module[] = "TIFFAdvanceDirectory";
if (isMapped(tif))
{
- uint64 poff=*nextdir;
+ uint64_t poff=*nextdir;
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
tmsize_t poffa,poffb,poffc,poffd;
- uint16 dircount;
- uint32 nextdir32;
+ uint16_t dircount;
+ uint32_t nextdir32;
poffa=(tmsize_t)poff;
- poffb=poffa+sizeof(uint16);
- if (((uint64)poffa!=poff)||(poffb<poffa)||(poffb<(tmsize_t)sizeof(uint16))||(poffb>tif->tif_size))
+ poffb=poffa+sizeof(uint16_t);
+ if (((uint64_t)poffa != poff) || (poffb < poffa) || (poffb < (tmsize_t)sizeof(uint16_t)) || (poffb > tif->tif_size))
{
TIFFErrorExt(tif->tif_clientdata,module,"Error fetching directory count");
*nextdir=0;
return(0);
}
- _TIFFmemcpy(&dircount,tif->tif_base+poffa,sizeof(uint16));
+ _TIFFmemcpy(&dircount,tif->tif_base+poffa,sizeof(uint16_t));
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(&dircount);
poffc=poffb+dircount*12;
- poffd=poffc+sizeof(uint32);
- if ((poffc<poffb)||(poffc<dircount*12)||(poffd<poffc)||(poffd<(tmsize_t)sizeof(uint32))||(poffd>tif->tif_size))
+ poffd=poffc+sizeof(uint32_t);
+ if ((poffc<poffb) || (poffc<dircount*12) || (poffd<poffc) || (poffd<(tmsize_t)sizeof(uint32_t)) || (poffd > tif->tif_size))
{
TIFFErrorExt(tif->tif_clientdata,module,"Error fetching directory link");
return(0);
}
if (off!=NULL)
- *off=(uint64)poffc;
- _TIFFmemcpy(&nextdir32,tif->tif_base+poffc,sizeof(uint32));
+ *off=(uint64_t)poffc;
+ _TIFFmemcpy(&nextdir32,tif->tif_base+poffc,sizeof(uint32_t));
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&nextdir32);
*nextdir=nextdir32;
@@ -1529,16 +1529,16 @@ TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off)
else
{
tmsize_t poffa,poffb,poffc,poffd;
- uint64 dircount64;
- uint16 dircount16;
+ uint64_t dircount64;
+ uint16_t dircount16;
poffa=(tmsize_t)poff;
- poffb=poffa+sizeof(uint64);
- if (((uint64)poffa!=poff)||(poffb<poffa)||(poffb<(tmsize_t)sizeof(uint64))||(poffb>tif->tif_size))
+ poffb=poffa+sizeof(uint64_t);
+ if (((uint64_t)poffa != poff) || (poffb < poffa) || (poffb < (tmsize_t)sizeof(uint64_t)) || (poffb > tif->tif_size))
{
TIFFErrorExt(tif->tif_clientdata,module,"Error fetching directory count");
return(0);
}
- _TIFFmemcpy(&dircount64,tif->tif_base+poffa,sizeof(uint64));
+ _TIFFmemcpy(&dircount64,tif->tif_base+poffa,sizeof(uint64_t));
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(&dircount64);
if (dircount64>0xFFFF)
@@ -1546,17 +1546,17 @@ TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off)
TIFFErrorExt(tif->tif_clientdata,module,"Sanity check on directory count failed");
return(0);
}
- dircount16=(uint16)dircount64;
+ dircount16=(uint16_t)dircount64;
poffc=poffb+dircount16*20;
- poffd=poffc+sizeof(uint64);
- if ((poffc<poffb)||(poffc<dircount16*20)||(poffd<poffc)||(poffd<(tmsize_t)sizeof(uint64))||(poffd>tif->tif_size))
+ poffd=poffc+sizeof(uint64_t);
+ if ((poffc<poffb) || (poffc<dircount16*20) || (poffd<poffc) || (poffd<(tmsize_t)sizeof(uint64_t)) || (poffd > tif->tif_size))
{
TIFFErrorExt(tif->tif_clientdata,module,"Error fetching directory link");
return(0);
}
if (off!=NULL)
- *off=(uint64)poffc;
- _TIFFmemcpy(nextdir,tif->tif_base+poffc,sizeof(uint64));
+ *off=(uint64_t)poffc;
+ _TIFFmemcpy(nextdir,tif->tif_base+poffc,sizeof(uint64_t));
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(nextdir);
}
@@ -1566,10 +1566,10 @@ TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off)
{
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint16 dircount;
- uint32 nextdir32;
+ uint16_t dircount;
+ uint32_t nextdir32;
if (!SeekOK(tif, *nextdir) ||
- !ReadOK(tif, &dircount, sizeof (uint16))) {
+ !ReadOK(tif, &dircount, sizeof (uint16_t))) {
TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory count",
tif->tif_name);
return (0);
@@ -1582,7 +1582,7 @@ TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off)
else
(void) TIFFSeekFile(tif,
dircount*12, SEEK_CUR);
- if (!ReadOK(tif, &nextdir32, sizeof (uint32))) {
+ if (!ReadOK(tif, &nextdir32, sizeof (uint32_t))) {
TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory link",
tif->tif_name);
return (0);
@@ -1593,10 +1593,10 @@ TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off)
}
else
{
- uint64 dircount64;
- uint16 dircount16;
+ uint64_t dircount64;
+ uint16_t dircount16;
if (!SeekOK(tif, *nextdir) ||
- !ReadOK(tif, &dircount64, sizeof (uint64))) {
+ !ReadOK(tif, &dircount64, sizeof (uint64_t))) {
TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory count",
tif->tif_name);
return (0);
@@ -1608,14 +1608,14 @@ TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off)
TIFFErrorExt(tif->tif_clientdata, module, "Error fetching directory count");
return(0);
}
- dircount16 = (uint16)dircount64;
+ dircount16 = (uint16_t)dircount64;
if (off != NULL)
*off = TIFFSeekFile(tif,
dircount16*20, SEEK_CUR);
else
(void) TIFFSeekFile(tif,
dircount16*20, SEEK_CUR);
- if (!ReadOK(tif, nextdir, sizeof (uint64))) {
+ if (!ReadOK(tif, nextdir, sizeof (uint64_t))) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: Error fetching directory link",
tif->tif_name);
@@ -1631,12 +1631,12 @@ TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off)
/*
* Count the number of directories in a file.
*/
-uint16
+uint16_t
TIFFNumberOfDirectories(TIFF* tif)
{
static const char module[] = "TIFFNumberOfDirectories";
- uint64 nextdir;
- uint16 n;
+ uint64_t nextdir;
+ uint16_t n;
if (!(tif->tif_flags&TIFF_BIGTIFF))
nextdir = tif->tif_header.classic.tiff_diroff;
else
@@ -1663,10 +1663,10 @@ TIFFNumberOfDirectories(TIFF* tif)
* NB: Directories are numbered starting at 0.
*/
int
-TIFFSetDirectory(TIFF* tif, uint16 dirn)
+TIFFSetDirectory(TIFF* tif, uint16_t dirn)
{
- uint64 nextdir;
- uint16 n;
+ uint64_t nextdir;
+ uint16_t n;
if (!(tif->tif_flags&TIFF_BIGTIFF))
nextdir = tif->tif_header.classic.tiff_diroff;
@@ -1697,7 +1697,7 @@ TIFFSetDirectory(TIFF* tif, uint16 dirn)
* the SubIFD tag (e.g. thumbnail images).
*/
int
-TIFFSetSubDirectory(TIFF* tif, uint64 diroff)
+TIFFSetSubDirectory(TIFF* tif, uint64_t diroff)
{
tif->tif_nextdiroff = diroff;
/*
@@ -1711,7 +1711,7 @@ TIFFSetSubDirectory(TIFF* tif, uint64 diroff)
/*
* Return file offset of the current directory.
*/
-uint64
+uint64_t
TIFFCurrentDirOffset(TIFF* tif)
{
return (tif->tif_diroff);
@@ -1731,12 +1731,12 @@ TIFFLastDirectory(TIFF* tif)
* Unlink the specified directory from the directory chain.
*/
int
-TIFFUnlinkDirectory(TIFF* tif, uint16 dirn)
+TIFFUnlinkDirectory(TIFF* tif, uint16_t dirn)
{
static const char module[] = "TIFFUnlinkDirectory";
- uint64 nextdir;
- uint64 off;
- uint16 n;
+ uint64_t nextdir;
+ uint64_t off;
+ uint16_t n;
if (tif->tif_mode == O_RDONLY) {
TIFFErrorExt(tif->tif_clientdata, module,
@@ -1760,7 +1760,7 @@ TIFFUnlinkDirectory(TIFF* tif, uint16 dirn)
}
for (n = dirn-1; n > 0; n--) {
if (nextdir == 0) {
- TIFFErrorExt(tif->tif_clientdata, module, "Directory %d does not exist", dirn);
+ TIFFErrorExt(tif->tif_clientdata, module, "Directory %"PRIu16" does not exist", dirn);
return (0);
}
if (!TIFFAdvanceDirectory(tif, &nextdir, &off))
@@ -1780,12 +1780,12 @@ TIFFUnlinkDirectory(TIFF* tif, uint16 dirn)
(void) TIFFSeekFile(tif, off, SEEK_SET);
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32 nextdir32;
- nextdir32=(uint32)nextdir;
- assert((uint64)nextdir32==nextdir);
+ uint32_t nextdir32;
+ nextdir32=(uint32_t)nextdir;
+ assert((uint64_t)nextdir32 == nextdir);
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong(&nextdir32);
- if (!WriteOK(tif, &nextdir32, sizeof (uint32))) {
+ if (!WriteOK(tif, &nextdir32, sizeof (uint32_t))) {
TIFFErrorExt(tif->tif_clientdata, module, "Error writing directory link");
return (0);
}
@@ -1794,7 +1794,7 @@ TIFFUnlinkDirectory(TIFF* tif, uint16 dirn)
{
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong8(&nextdir);
- if (!WriteOK(tif, &nextdir, sizeof (uint64))) {
+ if (!WriteOK(tif, &nextdir, sizeof (uint64_t))) {
TIFFErrorExt(tif->tif_clientdata, module, "Error writing directory link");
return (0);
}
@@ -1820,8 +1820,8 @@ TIFFUnlinkDirectory(TIFF* tif, uint16 dirn)
tif->tif_diroff = 0; /* force link on next write */
tif->tif_nextdiroff = 0; /* next write must be at end */
tif->tif_curoff = 0;
- tif->tif_row = (uint32) -1;
- tif->tif_curstrip = (uint32) -1;
+ tif->tif_row = (uint32_t) -1;
+ tif->tif_curstrip = (uint32_t) -1;
return (1);
}
diff --git a/tiff/libtiff/tif_dir.h b/tiff/libtiff/tif_dir.h
index f608dd71..1782b35d 100644
--- a/tiff/libtiff/tif_dir.h
+++ b/tiff/libtiff/tif_dir.h
@@ -50,15 +50,15 @@ typedef struct {
* it is left-justified in the offset field.
*/
typedef struct {
- uint16 tdir_tag; /* see below */
- uint16 tdir_type; /* data type; see below */
- uint64 tdir_count; /* number of items; length in spec */
+ uint16_t tdir_tag; /* see below */
+ uint16_t tdir_type; /* data type; see below */
+ uint64_t tdir_count; /* number of items; length in spec */
union {
- uint16 toff_short;
- uint32 toff_long;
- uint64 toff_long8;
+ uint16_t toff_short;
+ uint32_t toff_long;
+ uint64_t toff_long8;
} tdir_offset; /* either offset or the data itself if fits */
- uint8 tdir_ignore; /* flag status to ignore tag when parsing tags in tif_dirread.c */
+ uint8_t tdir_ignore; /* flag status to ignore tag when parsing tags in tif_dirread.c */
} TIFFDirEntry;
/*
@@ -69,50 +69,50 @@ typedef struct {
/* bit vector of fields that are set */
unsigned long td_fieldsset[FIELD_SETLONGS];
- uint32 td_imagewidth, td_imagelength, td_imagedepth;
- uint32 td_tilewidth, td_tilelength, td_tiledepth;
- uint32 td_subfiletype;
- uint16 td_bitspersample;
- uint16 td_sampleformat;
- uint16 td_compression;
- uint16 td_photometric;
- uint16 td_threshholding;
- uint16 td_fillorder;
- uint16 td_orientation;
- uint16 td_samplesperpixel;
- uint32 td_rowsperstrip;
- uint16 td_minsamplevalue, td_maxsamplevalue;
+ uint32_t td_imagewidth, td_imagelength, td_imagedepth;
+ uint32_t td_tilewidth, td_tilelength, td_tiledepth;
+ uint32_t td_subfiletype;
+ uint16_t td_bitspersample;
+ uint16_t td_sampleformat;
+ uint16_t td_compression;
+ uint16_t td_photometric;
+ uint16_t td_threshholding;
+ uint16_t td_fillorder;
+ uint16_t td_orientation;
+ uint16_t td_samplesperpixel;
+ uint32_t td_rowsperstrip;
+ uint16_t td_minsamplevalue, td_maxsamplevalue;
double* td_sminsamplevalue;
double* td_smaxsamplevalue;
float td_xresolution, td_yresolution;
- uint16 td_resolutionunit;
- uint16 td_planarconfig;
+ uint16_t td_resolutionunit;
+ uint16_t td_planarconfig;
float td_xposition, td_yposition;
- uint16 td_pagenumber[2];
- uint16* td_colormap[3];
- uint16 td_halftonehints[2];
- uint16 td_extrasamples;
- uint16* td_sampleinfo;
+ uint16_t td_pagenumber[2];
+ uint16_t* td_colormap[3];
+ uint16_t td_halftonehints[2];
+ uint16_t td_extrasamples;
+ uint16_t* td_sampleinfo;
/* even though the name is misleading, td_stripsperimage is the number
* of striles (=strips or tiles) per plane, and td_nstrips the total
* number of striles */
- uint32 td_stripsperimage;
- uint32 td_nstrips; /* size of offset & bytecount arrays */
- uint64* td_stripoffset_p; /* should be accessed with TIFFGetStrileOffset */
- uint64* td_stripbytecount_p; /* should be accessed with TIFFGetStrileByteCount */
- uint32 td_stripoffsetbyteallocsize; /* number of elements currently allocated for td_stripoffset/td_stripbytecount. Only used if TIFF_LAZYSTRILELOAD is set */
+ uint32_t td_stripsperimage;
+ uint32_t td_nstrips; /* size of offset & bytecount arrays */
+ uint64_t* td_stripoffset_p; /* should be accessed with TIFFGetStrileOffset */
+ uint64_t* td_stripbytecount_p; /* should be accessed with TIFFGetStrileByteCount */
+ uint32_t td_stripoffsetbyteallocsize; /* number of elements currently allocated for td_stripoffset/td_stripbytecount. Only used if TIFF_LAZYSTRILELOAD is set */
#ifdef STRIPBYTECOUNTSORTED_UNUSED
int td_stripbytecountsorted; /* is the bytecount array sorted ascending? */
#endif
TIFFDirEntry td_stripoffset_entry; /* for deferred loading */
TIFFDirEntry td_stripbytecount_entry; /* for deferred loading */
- uint16 td_nsubifd;
- uint64* td_subifd;
+ uint16_t td_nsubifd;
+ uint64_t* td_subifd;
/* YCbCr parameters */
- uint16 td_ycbcrsubsampling[2];
- uint16 td_ycbcrpositioning;
+ uint16_t td_ycbcrsubsampling[2];
+ uint16_t td_ycbcrpositioning;
/* Colorimetry parameters */
- uint16* td_transferfunction[3];
+ uint16_t* td_transferfunction[3];
float* td_refblackwhite;
/* CMYK parameters */
int td_inknameslen;
@@ -276,17 +276,17 @@ typedef enum {
struct _TIFFFieldArray {
TIFFFieldArrayType type; /* array type, will be used to determine if IFD is image and such */
- uint32 allocated_size; /* 0 if array is constant, other if modified by future definition extension support */
- uint32 count; /* number of elements in fields array */
+ uint32_t allocated_size; /* 0 if array is constant, other if modified by future definition extension support */
+ uint32_t count; /* number of elements in fields array */
TIFFField* fields; /* actual field info */
};
struct _TIFFField {
- uint32 field_tag; /* field's tag */
+ uint32_t field_tag; /* field's tag */
short field_readcount; /* read count/TIFF_VARIABLE/TIFF_SPP */
short field_writecount; /* write count/TIFF_VARIABLE */
TIFFDataType field_type; /* type of associated data */
- uint32 reserved; /* reserved for future extension */
+ uint32_t reserved; /* reserved for future extension */
TIFFSetGetFieldType set_field_type; /* type to be passed to TIFFSetField */
TIFFSetGetFieldType get_field_type; /* type to be passed to TIFFGetField */
unsigned short field_bit; /* bit in fieldsset bit vector */
@@ -296,9 +296,9 @@ struct _TIFFField {
TIFFFieldArray* field_subfields; /* if field points to child ifds, child ifd field definition array */
};
-extern int _TIFFMergeFields(TIFF*, const TIFFField[], uint32);
-extern const TIFFField* _TIFFFindOrRegisterField(TIFF *, uint32, TIFFDataType);
-extern TIFFField* _TIFFCreateAnonField(TIFF *, uint32, TIFFDataType);
+extern int _TIFFMergeFields(TIFF*, const TIFFField[], uint32_t);
+extern const TIFFField* _TIFFFindOrRegisterField(TIFF *, uint32_t, TIFFDataType);
+extern TIFFField* _TIFFCreateAnonField(TIFF *, uint32_t, TIFFDataType);
extern int _TIFFCheckFieldIsValidForCodec(TIFF *tif, ttag_t tag);
#if defined(__cplusplus)
diff --git a/tiff/libtiff/tif_dirinfo.c b/tiff/libtiff/tif_dirinfo.c
index 7217042c..8565dfbc 100644
--- a/tiff/libtiff/tif_dirinfo.c
+++ b/tiff/libtiff/tif_dirinfo.c
@@ -325,7 +325,7 @@ exifFields[] = {
* EXIF-GPS tags (Version 2.31, July 2016; nothing changed for version 2.32 May 2019)
*/
-static TIFFField
+static const TIFFField
gpsFields[] = {
/* For the GPS tag definitions in gpsFields[] the standard definition for Rationals is TIFF_SETGET_DOUBLE and TIFF_SETGET_C0_FLOAT.
*-- ATTENTION: After the upgrade with Rational2Double, the GPSTAG values can now be written and also read in double precision!
@@ -415,7 +415,7 @@ void
_TIFFSetupFields(TIFF* tif, const TIFFFieldArray* fieldarray)
{
if (tif->tif_fields && tif->tif_nfields > 0) {
- uint32 i;
+ uint32_t i;
for (i = 0; i < tif->tif_nfields; i++) {
TIFFField *fld = tif->tif_fields[i];
@@ -464,12 +464,12 @@ tagNameCompare(const void* a, const void* b)
}
int
-_TIFFMergeFields(TIFF* tif, const TIFFField info[], uint32 n)
+_TIFFMergeFields(TIFF* tif, const TIFFField info[], uint32_t n)
{
static const char module[] = "_TIFFMergeFields";
static const char reason[] = "for fields array";
/* TIFFField** tp; */
- uint32 i;
+ uint32_t i;
tif->tif_foundfield = NULL;
@@ -511,7 +511,7 @@ _TIFFMergeFields(TIFF* tif, const TIFFField info[], uint32 n)
void
_TIFFPrintFieldInfo(TIFF* tif, FILE* fd)
{
- uint32 i;
+ uint32_t i;
fprintf(fd, "%s: \n", tif->tif_name);
for (i = 0; i < tif->tif_nfields; i++) {
@@ -677,7 +677,7 @@ _TIFFSetGetFieldSize(TIFFSetGetFieldType setgettype)
const TIFFField*
-TIFFFindField(TIFF* tif, uint32 tag, TIFFDataType dt)
+TIFFFindField(TIFF* tif, uint32_t tag, TIFFDataType dt)
{
TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
TIFFField* pkey = &key;
@@ -729,7 +729,7 @@ _TIFFFindFieldByName(TIFF* tif, const char *field_name, TIFFDataType dt)
}
const TIFFField*
-TIFFFieldWithTag(TIFF* tif, uint32 tag)
+TIFFFieldWithTag(TIFF* tif, uint32_t tag)
{
const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
if (!fip) {
@@ -752,7 +752,7 @@ TIFFFieldWithName(TIFF* tif, const char *field_name)
return (fip);
}
-uint32
+uint32_t
TIFFFieldTag(const TIFFField* fip)
{
return fip->field_tag;
@@ -789,7 +789,7 @@ TIFFFieldWriteCount(const TIFFField* fip)
}
const TIFFField*
-_TIFFFindOrRegisterField(TIFF *tif, uint32 tag, TIFFDataType dt)
+_TIFFFindOrRegisterField(TIFF *tif, uint32_t tag, TIFFDataType dt)
{
const TIFFField *fld;
@@ -805,7 +805,7 @@ _TIFFFindOrRegisterField(TIFF *tif, uint32 tag, TIFFDataType dt)
}
TIFFField*
-_TIFFCreateAnonField(TIFF *tif, uint32 tag, TIFFDataType field_type)
+_TIFFCreateAnonField(TIFF *tif, uint32_t tag, TIFFDataType field_type)
{
TIFFField *fld;
(void) tif;
@@ -1059,13 +1059,13 @@ _TIFFSetGetType(TIFFDataType type, short count, unsigned char passcount)
}
int
-TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32 n)
+TIFFMergeFieldInfo(TIFF* tif, const TIFFFieldInfo info[], uint32_t n)
{
static const char module[] = "TIFFMergeFieldInfo";
static const char reason[] = "for fields array";
TIFFField *tp;
size_t nfields;
- uint32 i;
+ uint32_t i;
if (tif->tif_nfieldscompat > 0) {
tif->tif_fieldscompat = (TIFFFieldArray *)
diff --git a/tiff/libtiff/tif_dirread.c b/tiff/libtiff/tif_dirread.c
index ba127ca9..d84147a0 100644
--- a/tiff/libtiff/tif_dirread.c
+++ b/tiff/libtiff/tif_dirread.c
@@ -34,23 +34,19 @@
* TIFFReadDirectory, so as to eliminate current possibly repetitive lookup.
*/
+#include "tiffconf.h"
#include "tiffiop.h"
#include <float.h>
#include <stdlib.h>
-#define FAILED_FII ((uint32) -1)
-
-/*
- * Largest 64-bit signed integer value.
- */
-#define TIFF_INT64_MAX ((int64)(TIFF_UINT64_MAX >> 1))
+#define FAILED_FII ((uint32_t) -1)
#ifdef HAVE_IEEEFP
# define TIFFCvtIEEEFloatToNative(tif, n, fp)
# define TIFFCvtIEEEDoubleToNative(tif, n, dp)
#else
-extern void TIFFCvtIEEEFloatToNative(TIFF*, uint32, float*);
-extern void TIFFCvtIEEEDoubleToNative(TIFF*, uint32, double*);
+extern void TIFFCvtIEEEFloatToNative(TIFF*, uint32_t, float*);
+extern void TIFFCvtIEEEDoubleToNative(TIFF*, uint32_t, double*);
#endif
enum TIFFReadDirEntryErr {
@@ -64,126 +60,126 @@ enum TIFFReadDirEntryErr {
TIFFReadDirEntryErrAlloc = 7,
};
-static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF* tif, TIFFDirEntry* direntry, uint32* value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8(TIFF* tif, TIFFDirEntry* direntry, uint64* value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* direntry, uint8_t* value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* direntry, uint16_t* value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF* tif, TIFFDirEntry* direntry, uint32_t* value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8(TIFF* tif, TIFFDirEntry* direntry, uint64_t* value);
static enum TIFFReadDirEntryErr TIFFReadDirEntryFloat(TIFF* tif, TIFFDirEntry* direntry, float* value);
static enum TIFFReadDirEntryErr TIFFReadDirEntryDouble(TIFF* tif, TIFFDirEntry* direntry, double* value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* direntry, uint64* value);
-
-static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* direntry, uint32* count, uint32 desttypesize, void** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntry* direntry, uint8** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEntry* direntry, int8** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEntry* direntry, uint16** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEntry* direntry, int16** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntry* direntry, uint32** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEntry* direntry, int32** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8Array(TIFF* tif, TIFFDirEntry* direntry, uint64** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEntry* direntry, int64** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* direntry, uint64_t* value);
+
+static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* direntry, uint32_t* count, uint32_t desttypesize, void** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntry* direntry, uint8_t** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEntry* direntry, int8_t** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEntry* direntry, uint16_t** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEntry* direntry, int16_t** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntry* direntry, uint32_t** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEntry* direntry, int32_t** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8Array(TIFF* tif, TIFFDirEntry* direntry, uint64_t** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEntry* direntry, int64_t** value);
static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEntry* direntry, float** value);
static enum TIFFReadDirEntryErr TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF* tif, TIFFDirEntry* direntry, uint64** value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF* tif, TIFFDirEntry* direntry, uint64_t** value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleShort(TIFF* tif, TIFFDirEntry* direntry, uint16_t* value);
#if 0
static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleDouble(TIFF* tif, TIFFDirEntry* direntry, double* value);
#endif
-static void TIFFReadDirEntryCheckedByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value);
-static void TIFFReadDirEntryCheckedSbyte(TIFF* tif, TIFFDirEntry* direntry, int8* value);
-static void TIFFReadDirEntryCheckedShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value);
-static void TIFFReadDirEntryCheckedSshort(TIFF* tif, TIFFDirEntry* direntry, int16* value);
-static void TIFFReadDirEntryCheckedLong(TIFF* tif, TIFFDirEntry* direntry, uint32* value);
-static void TIFFReadDirEntryCheckedSlong(TIFF* tif, TIFFDirEntry* direntry, int32* value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedLong8(TIFF* tif, TIFFDirEntry* direntry, uint64* value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSlong8(TIFF* tif, TIFFDirEntry* direntry, int64* value);
+static void TIFFReadDirEntryCheckedByte(TIFF* tif, TIFFDirEntry* direntry, uint8_t* value);
+static void TIFFReadDirEntryCheckedSbyte(TIFF* tif, TIFFDirEntry* direntry, int8_t* value);
+static void TIFFReadDirEntryCheckedShort(TIFF* tif, TIFFDirEntry* direntry, uint16_t* value);
+static void TIFFReadDirEntryCheckedSshort(TIFF* tif, TIFFDirEntry* direntry, int16_t* value);
+static void TIFFReadDirEntryCheckedLong(TIFF* tif, TIFFDirEntry* direntry, uint32_t* value);
+static void TIFFReadDirEntryCheckedSlong(TIFF* tif, TIFFDirEntry* direntry, int32_t* value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedLong8(TIFF* tif, TIFFDirEntry* direntry, uint64_t* value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSlong8(TIFF* tif, TIFFDirEntry* direntry, int64_t* value);
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedRational(TIFF* tif, TIFFDirEntry* direntry, double* value);
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSrational(TIFF* tif, TIFFDirEntry* direntry, double* value);
static void TIFFReadDirEntryCheckedFloat(TIFF* tif, TIFFDirEntry* direntry, float* value);
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedDouble(TIFF* tif, TIFFDirEntry* direntry, double* value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSbyte(int8 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteShort(uint16 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSshort(int16 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong(uint32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong(int32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong8(uint64 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong8(int64 value);
-
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteByte(uint8 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteShort(uint16 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSshort(int16 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong(uint32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong(int32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong8(uint64 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong8(int64 value);
-
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSbyte(int8 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSshort(int16 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong(uint32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong(int32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong8(uint64 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong8(int64 value);
-
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortShort(uint16 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong(uint32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong(int32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong8(uint64 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong8(int64 value);
-
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSbyte(int8 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSshort(int16 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongLong8(uint64 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong8(int64 value);
-
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongLong(uint32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongLong8(uint64 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongSlong8(int64 value);
-
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Sbyte(int8 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Sshort(int16 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Slong(int32 value);
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Slong8(int64 value);
-
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlong8Long8(uint64 value);
-
-static enum TIFFReadDirEntryErr TIFFReadDirEntryData(TIFF* tif, uint64 offset, tmsize_t size, void* dest);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSbyte(int8_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteShort(uint16_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSshort(int16_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong(uint32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong(int32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong8(uint64_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong8(int64_t value);
+
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteByte(uint8_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteShort(uint16_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSshort(int16_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong(uint32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong(int32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong8(uint64_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong8(int64_t value);
+
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSbyte(int8_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSshort(int16_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong(uint32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong(int32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong8(uint64_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong8(int64_t value);
+
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortShort(uint16_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong(uint32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong(int32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong8(uint64_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong8(int64_t value);
+
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSbyte(int8_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSshort(int16_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongLong8(uint64_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong8(int64_t value);
+
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongLong(uint32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongLong8(uint64_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlongSlong8(int64_t value);
+
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Sbyte(int8_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Sshort(int16_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Slong(int32_t value);
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLong8Slong8(int64_t value);
+
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSlong8Long8(uint64_t value);
+
+static enum TIFFReadDirEntryErr TIFFReadDirEntryData(TIFF* tif, uint64_t offset, tmsize_t size, void* dest);
static void TIFFReadDirEntryOutputErr(TIFF* tif, enum TIFFReadDirEntryErr err, const char* module, const char* tagname, int recover);
-static void TIFFReadDirectoryCheckOrder(TIFF* tif, TIFFDirEntry* dir, uint16 dircount);
-static TIFFDirEntry* TIFFReadDirectoryFindEntry(TIFF* tif, TIFFDirEntry* dir, uint16 dircount, uint16 tagid);
-static void TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16 tagid, uint32* fii);
+static void TIFFReadDirectoryCheckOrder(TIFF* tif, TIFFDirEntry* dir, uint16_t dircount);
+static TIFFDirEntry* TIFFReadDirectoryFindEntry(TIFF* tif, TIFFDirEntry* dir, uint16_t dircount, uint16_t tagid);
+static void TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16_t tagid, uint32_t* fii);
-static int EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount);
+static int EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16_t dircount);
static void MissingRequired(TIFF*, const char*);
-static int TIFFCheckDirOffset(TIFF* tif, uint64 diroff);
-static int CheckDirCount(TIFF*, TIFFDirEntry*, uint32);
-static uint16 TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir, uint64* nextdiroff);
+static int TIFFCheckDirOffset(TIFF* tif, uint64_t diroff);
+static int CheckDirCount(TIFF*, TIFFDirEntry*, uint32_t);
+static uint16_t TIFFFetchDirectory(TIFF* tif, uint64_t diroff, TIFFDirEntry** pdir, uint64_t* nextdiroff);
static int TIFFFetchNormalTag(TIFF*, TIFFDirEntry*, int recover);
-static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp);
+static int TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32_t nstrips, uint64_t** lpp);
static int TIFFFetchSubjectDistance(TIFF*, TIFFDirEntry*);
static void ChopUpSingleUncompressedStrip(TIFF*);
static void TryChopUpUncompressedBigTiff(TIFF*);
-static uint64 TIFFReadUInt64(const uint8 *value);
-static int _TIFFGetMaxColorChannels(uint16 photometric);
+static uint64_t TIFFReadUInt64(const uint8_t *value);
+static int _TIFFGetMaxColorChannels(uint16_t photometric);
static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount );
typedef union _UInt64Aligned_t
{
double d;
- uint64 l;
- uint32 i[2];
- uint16 s[4];
- uint8 c[8];
+ uint64_t l;
+ uint32_t i[2];
+ uint16_t s[4];
+ uint8_t c[8];
} UInt64Aligned_t;
/*
- Unaligned safe copy of a uint64 value from an octet array.
+ Unaligned safe copy of a uint64_t value from an octet array.
*/
-static uint64 TIFFReadUInt64(const uint8 *value)
+static uint64_t TIFFReadUInt64(const uint8_t *value)
{
UInt64Aligned_t result;
@@ -199,7 +195,7 @@ static uint64 TIFFReadUInt64(const uint8 *value)
return result.l;
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* direntry, uint8_t* value)
{
enum TIFFReadDirEntryErr err;
if (direntry->tdir_count!=1)
@@ -212,76 +208,76 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* di
return(TIFFReadDirEntryErrOk);
case TIFF_SBYTE:
{
- int8 m;
+ int8_t m;
TIFFReadDirEntryCheckedSbyte(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeByteSbyte(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint8)m;
+ *value=(uint8_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SHORT:
{
- uint16 m;
+ uint16_t m;
TIFFReadDirEntryCheckedShort(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeByteShort(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint8)m;
+ *value=(uint8_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SSHORT:
{
- int16 m;
+ int16_t m;
TIFFReadDirEntryCheckedSshort(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeByteSshort(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint8)m;
+ *value=(uint8_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG:
{
- uint32 m;
+ uint32_t m;
TIFFReadDirEntryCheckedLong(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeByteLong(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint8)m;
+ *value=(uint8_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG:
{
- int32 m;
+ int32_t m;
TIFFReadDirEntryCheckedSlong(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeByteSlong(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint8)m;
+ *value=(uint8_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG8:
{
- uint64 m;
+ uint64_t m;
err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
err=TIFFReadDirEntryCheckRangeByteLong8(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint8)m;
+ *value=(uint8_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG8:
{
- int64 m;
+ int64_t m;
err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
err=TIFFReadDirEntryCheckRangeByteSlong8(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint8)m;
+ *value=(uint8_t)m;
return(TIFFReadDirEntryErrOk);
}
default:
@@ -289,7 +285,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByte(TIFF* tif, TIFFDirEntry* di
}
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* direntry, uint16_t* value)
{
enum TIFFReadDirEntryErr err;
if (direntry->tdir_count!=1)
@@ -298,19 +294,19 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* d
{
case TIFF_BYTE:
{
- uint8 m;
+ uint8_t m;
TIFFReadDirEntryCheckedByte(tif,direntry,&m);
- *value=(uint16)m;
+ *value=(uint16_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SBYTE:
{
- int8 m;
+ int8_t m;
TIFFReadDirEntryCheckedSbyte(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeShortSbyte(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint16)m;
+ *value=(uint16_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SHORT:
@@ -318,56 +314,56 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* d
return(TIFFReadDirEntryErrOk);
case TIFF_SSHORT:
{
- int16 m;
+ int16_t m;
TIFFReadDirEntryCheckedSshort(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeShortSshort(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint16)m;
+ *value=(uint16_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG:
{
- uint32 m;
+ uint32_t m;
TIFFReadDirEntryCheckedLong(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeShortLong(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint16)m;
+ *value=(uint16_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG:
{
- int32 m;
+ int32_t m;
TIFFReadDirEntryCheckedSlong(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeShortSlong(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint16)m;
+ *value=(uint16_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG8:
{
- uint64 m;
+ uint64_t m;
err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
err=TIFFReadDirEntryCheckRangeShortLong8(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint16)m;
+ *value=(uint16_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG8:
{
- int64 m;
+ int64_t m;
err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
err=TIFFReadDirEntryCheckRangeShortSlong8(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint16)m;
+ *value=(uint16_t)m;
return(TIFFReadDirEntryErrOk);
}
default:
@@ -375,7 +371,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryShort(TIFF* tif, TIFFDirEntry* d
}
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF* tif, TIFFDirEntry* direntry, uint32* value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF* tif, TIFFDirEntry* direntry, uint32_t* value)
{
enum TIFFReadDirEntryErr err;
if (direntry->tdir_count!=1)
@@ -384,36 +380,36 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF* tif, TIFFDirEntry* di
{
case TIFF_BYTE:
{
- uint8 m;
+ uint8_t m;
TIFFReadDirEntryCheckedByte(tif,direntry,&m);
- *value=(uint32)m;
+ *value=(uint32_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SBYTE:
{
- int8 m;
+ int8_t m;
TIFFReadDirEntryCheckedSbyte(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeLongSbyte(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint32)m;
+ *value=(uint32_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SHORT:
{
- uint16 m;
+ uint16_t m;
TIFFReadDirEntryCheckedShort(tif,direntry,&m);
- *value=(uint32)m;
+ *value=(uint32_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SSHORT:
{
- int16 m;
+ int16_t m;
TIFFReadDirEntryCheckedSshort(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeLongSshort(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint32)m;
+ *value=(uint32_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG:
@@ -421,36 +417,36 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF* tif, TIFFDirEntry* di
return(TIFFReadDirEntryErrOk);
case TIFF_SLONG:
{
- int32 m;
+ int32_t m;
TIFFReadDirEntryCheckedSlong(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeLongSlong(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint32)m;
+ *value=(uint32_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG8:
{
- uint64 m;
+ uint64_t m;
err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
err=TIFFReadDirEntryCheckRangeLongLong8(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint32)m;
+ *value=(uint32_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG8:
{
- int64 m;
+ int64_t m;
err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
err=TIFFReadDirEntryCheckRangeLongSlong8(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint32)m;
+ *value=(uint32_t)m;
return(TIFFReadDirEntryErrOk);
}
default:
@@ -458,7 +454,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLong(TIFF* tif, TIFFDirEntry* di
}
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8(TIFF* tif, TIFFDirEntry* direntry, uint64* value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8(TIFF* tif, TIFFDirEntry* direntry, uint64_t* value)
{
enum TIFFReadDirEntryErr err;
if (direntry->tdir_count!=1)
@@ -467,53 +463,53 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8(TIFF* tif, TIFFDirEntry* d
{
case TIFF_BYTE:
{
- uint8 m;
+ uint8_t m;
TIFFReadDirEntryCheckedByte(tif,direntry,&m);
- *value=(uint64)m;
+ *value=(uint64_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SBYTE:
{
- int8 m;
+ int8_t m;
TIFFReadDirEntryCheckedSbyte(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeLong8Sbyte(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint64)m;
+ *value=(uint64_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SHORT:
{
- uint16 m;
+ uint16_t m;
TIFFReadDirEntryCheckedShort(tif,direntry,&m);
- *value=(uint64)m;
+ *value=(uint64_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SSHORT:
{
- int16 m;
+ int16_t m;
TIFFReadDirEntryCheckedSshort(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeLong8Sshort(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint64)m;
+ *value=(uint64_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG:
{
- uint32 m;
+ uint32_t m;
TIFFReadDirEntryCheckedLong(tif,direntry,&m);
- *value=(uint64)m;
+ *value=(uint64_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG:
{
- int32 m;
+ int32_t m;
TIFFReadDirEntryCheckedSlong(tif,direntry,&m);
err=TIFFReadDirEntryCheckRangeLong8Slong(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint64)m;
+ *value=(uint64_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG8:
@@ -521,14 +517,14 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8(TIFF* tif, TIFFDirEntry* d
return(err);
case TIFF_SLONG8:
{
- int64 m;
+ int64_t m;
err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
err=TIFFReadDirEntryCheckRangeLong8Slong8(m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
- *value=(uint64)m;
+ *value=(uint64_t)m;
return(TIFFReadDirEntryErrOk);
}
default:
@@ -545,49 +541,49 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloat(TIFF* tif, TIFFDirEntry* d
{
case TIFF_BYTE:
{
- uint8 m;
+ uint8_t m;
TIFFReadDirEntryCheckedByte(tif,direntry,&m);
*value=(float)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SBYTE:
{
- int8 m;
+ int8_t m;
TIFFReadDirEntryCheckedSbyte(tif,direntry,&m);
*value=(float)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SHORT:
{
- uint16 m;
+ uint16_t m;
TIFFReadDirEntryCheckedShort(tif,direntry,&m);
*value=(float)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SSHORT:
{
- int16 m;
+ int16_t m;
TIFFReadDirEntryCheckedSshort(tif,direntry,&m);
*value=(float)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG:
{
- uint32 m;
+ uint32_t m;
TIFFReadDirEntryCheckedLong(tif,direntry,&m);
*value=(float)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG:
{
- int32 m;
+ int32_t m;
TIFFReadDirEntryCheckedSlong(tif,direntry,&m);
*value=(float)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG8:
{
- uint64 m;
+ uint64_t m;
err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
@@ -605,7 +601,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloat(TIFF* tif, TIFFDirEntry* d
}
case TIFF_SLONG8:
{
- int64 m;
+ int64_t m;
err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
@@ -658,49 +654,49 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryDouble(TIFF* tif, TIFFDirEntry*
{
case TIFF_BYTE:
{
- uint8 m;
+ uint8_t m;
TIFFReadDirEntryCheckedByte(tif,direntry,&m);
*value=(double)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SBYTE:
{
- int8 m;
+ int8_t m;
TIFFReadDirEntryCheckedSbyte(tif,direntry,&m);
*value=(double)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SHORT:
{
- uint16 m;
+ uint16_t m;
TIFFReadDirEntryCheckedShort(tif,direntry,&m);
*value=(double)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SSHORT:
{
- int16 m;
+ int16_t m;
TIFFReadDirEntryCheckedSshort(tif,direntry,&m);
*value=(double)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG:
{
- uint32 m;
+ uint32_t m;
TIFFReadDirEntryCheckedLong(tif,direntry,&m);
*value=(double)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG:
{
- int32 m;
+ int32_t m;
TIFFReadDirEntryCheckedSlong(tif,direntry,&m);
*value=(double)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG8:
{
- uint64 m;
+ uint64_t m;
err=TIFFReadDirEntryCheckedLong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
@@ -718,7 +714,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryDouble(TIFF* tif, TIFFDirEntry*
}
case TIFF_SLONG8:
{
- int64 m;
+ int64_t m;
err=TIFFReadDirEntryCheckedSlong8(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
return(err);
@@ -746,7 +742,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryDouble(TIFF* tif, TIFFDirEntry*
}
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* direntry, uint64* value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* direntry, uint64_t* value)
{
enum TIFFReadDirEntryErr err;
if (direntry->tdir_count!=1)
@@ -756,9 +752,9 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* di
case TIFF_LONG:
case TIFF_IFD:
{
- uint32 m;
+ uint32_t m;
TIFFReadDirEntryCheckedLong(tif,direntry,&m);
- *value=(uint64)m;
+ *value=(uint64_t)m;
return(TIFFReadDirEntryErrOk);
}
case TIFF_LONG8:
@@ -776,7 +772,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8(TIFF* tif, TIFFDirEntry* di
#define MAX_THRESHOLD (THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * INITIAL_THRESHOLD)
static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(
- TIFF* tif, uint64 offset, tmsize_t size, void** pdest)
+ TIFF* tif, uint64_t offset, tmsize_t size, void** pdest)
{
#if SIZEOF_SIZE_T == 8
tmsize_t threshold = INITIAL_THRESHOLD;
@@ -807,15 +803,15 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(
}
#endif
- new_dest = (uint8*) _TIFFrealloc(
+ new_dest = (uint8_t*) _TIFFrealloc(
*pdest, already_read + to_read);
if( new_dest == NULL )
{
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
"Failed to allocate memory for %s "
- "(%ld elements of %ld bytes each)",
+ "(%"TIFF_SSIZE_FORMAT" elements of %"TIFF_SSIZE_FORMAT" bytes each)",
"TIFFReadDirEntryArray",
- (long) 1, (long) (already_read + to_read));
+ (tmsize_t) 1, already_read + to_read);
return TIFFReadDirEntryErrAlloc;
}
*pdest = new_dest;
@@ -831,13 +827,13 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryDataAndRealloc(
}
static enum TIFFReadDirEntryErr TIFFReadDirEntryArrayWithLimit(
- TIFF* tif, TIFFDirEntry* direntry, uint32* count, uint32 desttypesize,
- void** value, uint64 maxcount)
+ TIFF* tif, TIFFDirEntry* direntry, uint32_t* count, uint32_t desttypesize,
+ void** value, uint64_t maxcount)
{
int typesize;
- uint32 datasize;
+ uint32_t datasize;
void* data;
- uint64 target_count64;
+ uint64_t target_count64;
int original_datasize_clamped;
typesize=TIFFDataWidth(direntry->tdir_type);
@@ -862,16 +858,16 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryArrayWithLimit(
* in either the current data type or the dest data type. This also
* avoids problems with overflow of tmsize_t on 32bit systems.
*/
- if ((uint64)(2147483647/typesize)<target_count64)
+ if ((uint64_t)(2147483647 / typesize) < target_count64)
return(TIFFReadDirEntryErrSizesan);
- if ((uint64)(2147483647/desttypesize)<target_count64)
+ if ((uint64_t)(2147483647 / desttypesize) < target_count64)
return(TIFFReadDirEntryErrSizesan);
- *count=(uint32)target_count64;
+ *count=(uint32_t)target_count64;
datasize=(*count)*typesize;
assert((tmsize_t)datasize>0);
- if( isMapped(tif) && datasize > (uint64)tif->tif_size )
+ if( isMapped(tif) && datasize > (uint64_t)tif->tif_size )
return TIFFReadDirEntryErrIo;
if( !isMapped(tif) &&
@@ -888,18 +884,20 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryArrayWithLimit(
}
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- if (original_datasize_clamped<=4)
+ /* Only the condition on original_datasize_clamped. The second
+ * one is implied, but Coverity Scan cannot see it. */
+ if (original_datasize_clamped<=4 && datasize <= 4 )
_TIFFmemcpy(data,&direntry->tdir_offset,datasize);
else
{
enum TIFFReadDirEntryErr err;
- uint32 offset = direntry->tdir_offset.toff_long;
+ uint32_t offset = direntry->tdir_offset.toff_long;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&offset);
if( isMapped(tif) )
- err=TIFFReadDirEntryData(tif,(uint64)offset,(tmsize_t)datasize,data);
+ err=TIFFReadDirEntryData(tif, (uint64_t)offset, (tmsize_t)datasize, data);
else
- err=TIFFReadDirEntryDataAndRealloc(tif,(uint64)offset,(tmsize_t)datasize,&data);
+ err=TIFFReadDirEntryDataAndRealloc(tif, (uint64_t)offset, (tmsize_t)datasize, &data);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(data);
@@ -909,18 +907,19 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryArrayWithLimit(
}
else
{
- if (original_datasize_clamped<=8)
+ /* See above comment for the Classic TIFF case */
+ if (original_datasize_clamped<=8 && datasize <= 8 )
_TIFFmemcpy(data,&direntry->tdir_offset,datasize);
else
{
enum TIFFReadDirEntryErr err;
- uint64 offset = direntry->tdir_offset.toff_long8;
+ uint64_t offset = direntry->tdir_offset.toff_long8;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(&offset);
if( isMapped(tif) )
- err=TIFFReadDirEntryData(tif,(uint64)offset,(tmsize_t)datasize,data);
+ err=TIFFReadDirEntryData(tif, (uint64_t)offset, (tmsize_t)datasize, data);
else
- err=TIFFReadDirEntryDataAndRealloc(tif,(uint64)offset,(tmsize_t)datasize,&data);
+ err=TIFFReadDirEntryDataAndRealloc(tif, (uint64_t)offset, (tmsize_t)datasize, &data);
if (err!=TIFFReadDirEntryErrOk)
{
_TIFFfree(data);
@@ -932,18 +931,18 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryArrayWithLimit(
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* direntry, uint32* count, uint32 desttypesize, void** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryArray(TIFF* tif, TIFFDirEntry* direntry, uint32_t* count, uint32_t desttypesize, void** value)
{
return TIFFReadDirEntryArrayWithLimit(tif, direntry, count,
- desttypesize, value, ~((uint64)0));
+ desttypesize, value, ~((uint64_t)0));
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntry* direntry, uint8** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntry* direntry, uint8_t** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
- uint8* data;
+ uint8_t* data;
switch (direntry->tdir_type)
{
case TIFF_ASCII:
@@ -971,13 +970,13 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntr
case TIFF_ASCII:
case TIFF_UNDEFINED:
case TIFF_BYTE:
- *value=(uint8*)origdata;
+ *value=(uint8_t*)origdata;
return(TIFFReadDirEntryErrOk);
case TIFF_SBYTE:
{
- int8* m;
- uint32 n;
- m=(int8*)origdata;
+ int8_t* m;
+ uint32_t n;
+ m=(int8_t*)origdata;
for (n=0; n<count; n++)
{
err=TIFFReadDirEntryCheckRangeByteSbyte(*m);
@@ -988,11 +987,11 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntr
}
m++;
}
- *value=(uint8*)origdata;
+ *value=(uint8_t*)origdata;
return(TIFFReadDirEntryErrOk);
}
}
- data=(uint8*)_TIFFmalloc(count);
+ data=(uint8_t*)_TIFFmalloc(count);
if (data==0)
{
_TIFFfree(origdata);
@@ -1002,10 +1001,10 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntr
{
case TIFF_SHORT:
{
- uint16* ma;
- uint8* mb;
- uint32 n;
- ma=(uint16*)origdata;
+ uint16_t* ma;
+ uint8_t* mb;
+ uint32_t n;
+ ma=(uint16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1014,34 +1013,34 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntr
err=TIFFReadDirEntryCheckRangeByteShort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint8)(*ma++);
+ *mb++=(uint8_t)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
- int16* ma;
- uint8* mb;
- uint32 n;
- ma=(int16*)origdata;
+ int16_t* ma;
+ uint8_t* mb;
+ uint32_t n;
+ ma=(int16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
+ TIFFSwabShort((uint16_t*)ma);
err=TIFFReadDirEntryCheckRangeByteSshort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint8)(*ma++);
+ *mb++=(uint8_t)(*ma++);
}
}
break;
case TIFF_LONG:
{
- uint32* ma;
- uint8* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t* ma;
+ uint8_t* mb;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1050,34 +1049,34 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntr
err=TIFFReadDirEntryCheckRangeByteLong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint8)(*ma++);
+ *mb++=(uint8_t)(*ma++);
}
}
break;
case TIFF_SLONG:
{
- int32* ma;
- uint8* mb;
- uint32 n;
- ma=(int32*)origdata;
+ int32_t* ma;
+ uint8_t* mb;
+ uint32_t n;
+ ma=(int32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)ma);
+ TIFFSwabLong((uint32_t*)ma);
err=TIFFReadDirEntryCheckRangeByteSlong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint8)(*ma++);
+ *mb++=(uint8_t)(*ma++);
}
}
break;
case TIFF_LONG8:
{
- uint64* ma;
- uint8* mb;
- uint32 n;
- ma=(uint64*)origdata;
+ uint64_t* ma;
+ uint8_t* mb;
+ uint32_t n;
+ ma=(uint64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1086,25 +1085,25 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntr
err=TIFFReadDirEntryCheckRangeByteLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint8)(*ma++);
+ *mb++=(uint8_t)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
- int64* ma;
- uint8* mb;
- uint32 n;
- ma=(int64*)origdata;
+ int64_t* ma;
+ uint8_t* mb;
+ uint32_t n;
+ ma=(int64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)ma);
+ TIFFSwabLong8((uint64_t*)ma);
err=TIFFReadDirEntryCheckRangeByteSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint8)(*ma++);
+ *mb++=(uint8_t)(*ma++);
}
}
break;
@@ -1119,12 +1118,12 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryByteArray(TIFF* tif, TIFFDirEntr
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEntry* direntry, int8** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEntry* direntry, int8_t** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
- int8* data;
+ int8_t* data;
switch (direntry->tdir_type)
{
case TIFF_UNDEFINED:
@@ -1151,9 +1150,9 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEnt
case TIFF_UNDEFINED:
case TIFF_BYTE:
{
- uint8* m;
- uint32 n;
- m=(uint8*)origdata;
+ uint8_t* m;
+ uint32_t n;
+ m=(uint8_t*)origdata;
for (n=0; n<count; n++)
{
err=TIFFReadDirEntryCheckRangeSbyteByte(*m);
@@ -1164,14 +1163,14 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEnt
}
m++;
}
- *value=(int8*)origdata;
+ *value=(int8_t*)origdata;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SBYTE:
- *value=(int8*)origdata;
+ *value=(int8_t*)origdata;
return(TIFFReadDirEntryErrOk);
}
- data=(int8*)_TIFFmalloc(count);
+ data=(int8_t*)_TIFFmalloc(count);
if (data==0)
{
_TIFFfree(origdata);
@@ -1181,10 +1180,10 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEnt
{
case TIFF_SHORT:
{
- uint16* ma;
- int8* mb;
- uint32 n;
- ma=(uint16*)origdata;
+ uint16_t* ma;
+ int8_t* mb;
+ uint32_t n;
+ ma=(uint16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1193,34 +1192,34 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEnt
err=TIFFReadDirEntryCheckRangeSbyteShort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int8)(*ma++);
+ *mb++=(int8_t)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
- int16* ma;
- int8* mb;
- uint32 n;
- ma=(int16*)origdata;
+ int16_t* ma;
+ int8_t* mb;
+ uint32_t n;
+ ma=(int16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
+ TIFFSwabShort((uint16_t*)ma);
err=TIFFReadDirEntryCheckRangeSbyteSshort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int8)(*ma++);
+ *mb++=(int8_t)(*ma++);
}
}
break;
case TIFF_LONG:
{
- uint32* ma;
- int8* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t* ma;
+ int8_t* mb;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1229,34 +1228,34 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEnt
err=TIFFReadDirEntryCheckRangeSbyteLong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int8)(*ma++);
+ *mb++=(int8_t)(*ma++);
}
}
break;
case TIFF_SLONG:
{
- int32* ma;
- int8* mb;
- uint32 n;
- ma=(int32*)origdata;
+ int32_t* ma;
+ int8_t* mb;
+ uint32_t n;
+ ma=(int32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)ma);
+ TIFFSwabLong((uint32_t*)ma);
err=TIFFReadDirEntryCheckRangeSbyteSlong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int8)(*ma++);
+ *mb++=(int8_t)(*ma++);
}
}
break;
case TIFF_LONG8:
{
- uint64* ma;
- int8* mb;
- uint32 n;
- ma=(uint64*)origdata;
+ uint64_t* ma;
+ int8_t* mb;
+ uint32_t n;
+ ma=(uint64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1265,25 +1264,25 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEnt
err=TIFFReadDirEntryCheckRangeSbyteLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int8)(*ma++);
+ *mb++=(int8_t)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
- int64* ma;
- int8* mb;
- uint32 n;
- ma=(int64*)origdata;
+ int64_t* ma;
+ int8_t* mb;
+ uint32_t n;
+ ma=(int64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)ma);
+ TIFFSwabLong8((uint64_t*)ma);
err=TIFFReadDirEntryCheckRangeSbyteSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int8)(*ma++);
+ *mb++=(int8_t)(*ma++);
}
}
break;
@@ -1298,12 +1297,12 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySbyteArray(TIFF* tif, TIFFDirEnt
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEntry* direntry, uint16** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEntry* direntry, uint16_t** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
- uint16* data;
+ uint16_t* data;
switch (direntry->tdir_type)
{
case TIFF_BYTE:
@@ -1327,19 +1326,19 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEnt
switch (direntry->tdir_type)
{
case TIFF_SHORT:
- *value=(uint16*)origdata;
+ *value=(uint16_t*)origdata;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfShort(*value,count);
return(TIFFReadDirEntryErrOk);
case TIFF_SSHORT:
{
- int16* m;
- uint32 n;
- m=(int16*)origdata;
+ int16_t* m;
+ uint32_t n;
+ m=(int16_t*)origdata;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)m);
+ TIFFSwabShort((uint16_t*)m);
err=TIFFReadDirEntryCheckRangeShortSshort(*m);
if (err!=TIFFReadDirEntryErrOk)
{
@@ -1348,11 +1347,11 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEnt
}
m++;
}
- *value=(uint16*)origdata;
+ *value=(uint16_t*)origdata;
return(TIFFReadDirEntryErrOk);
}
}
- data=(uint16*)_TIFFmalloc(count*2);
+ data=(uint16_t*)_TIFFmalloc(count * 2);
if (data==0)
{
_TIFFfree(origdata);
@@ -1362,37 +1361,37 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEnt
{
case TIFF_BYTE:
{
- uint8* ma;
- uint16* mb;
- uint32 n;
- ma=(uint8*)origdata;
+ uint8_t* ma;
+ uint16_t* mb;
+ uint32_t n;
+ ma=(uint8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
- *mb++=(uint16)(*ma++);
+ *mb++=(uint16_t)(*ma++);
}
break;
case TIFF_SBYTE:
{
- int8* ma;
- uint16* mb;
- uint32 n;
- ma=(int8*)origdata;
+ int8_t* ma;
+ uint16_t* mb;
+ uint32_t n;
+ ma=(int8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
err=TIFFReadDirEntryCheckRangeShortSbyte(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint16)(*ma++);
+ *mb++=(uint16_t)(*ma++);
}
}
break;
case TIFF_LONG:
{
- uint32* ma;
- uint16* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t* ma;
+ uint16_t* mb;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1401,34 +1400,34 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEnt
err=TIFFReadDirEntryCheckRangeShortLong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint16)(*ma++);
+ *mb++=(uint16_t)(*ma++);
}
}
break;
case TIFF_SLONG:
{
- int32* ma;
- uint16* mb;
- uint32 n;
- ma=(int32*)origdata;
+ int32_t* ma;
+ uint16_t* mb;
+ uint32_t n;
+ ma=(int32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)ma);
+ TIFFSwabLong((uint32_t*)ma);
err=TIFFReadDirEntryCheckRangeShortSlong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint16)(*ma++);
+ *mb++=(uint16_t)(*ma++);
}
}
break;
case TIFF_LONG8:
{
- uint64* ma;
- uint16* mb;
- uint32 n;
- ma=(uint64*)origdata;
+ uint64_t* ma;
+ uint16_t* mb;
+ uint32_t n;
+ ma=(uint64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1437,25 +1436,25 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEnt
err=TIFFReadDirEntryCheckRangeShortLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint16)(*ma++);
+ *mb++=(uint16_t)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
- int64* ma;
- uint16* mb;
- uint32 n;
- ma=(int64*)origdata;
+ int64_t* ma;
+ uint16_t* mb;
+ uint32_t n;
+ ma=(int64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)ma);
+ TIFFSwabLong8((uint64_t*)ma);
err=TIFFReadDirEntryCheckRangeShortSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint16)(*ma++);
+ *mb++=(uint16_t)(*ma++);
}
}
break;
@@ -1470,12 +1469,12 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryShortArray(TIFF* tif, TIFFDirEnt
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEntry* direntry, int16** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEntry* direntry, int16_t** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
- int16* data;
+ int16_t* data;
switch (direntry->tdir_type)
{
case TIFF_BYTE:
@@ -1500,9 +1499,9 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEn
{
case TIFF_SHORT:
{
- uint16* m;
- uint32 n;
- m=(uint16*)origdata;
+ uint16_t* m;
+ uint32_t n;
+ m=(uint16_t*)origdata;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
@@ -1515,16 +1514,16 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEn
}
m++;
}
- *value=(int16*)origdata;
+ *value=(int16_t*)origdata;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SSHORT:
- *value=(int16*)origdata;
+ *value=(int16_t*)origdata;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfShort((uint16*)(*value),count);
+ TIFFSwabArrayOfShort((uint16_t*)(*value), count);
return(TIFFReadDirEntryErrOk);
}
- data=(int16*)_TIFFmalloc(count*2);
+ data=(int16_t*)_TIFFmalloc(count * 2);
if (data==0)
{
_TIFFfree(origdata);
@@ -1534,32 +1533,32 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEn
{
case TIFF_BYTE:
{
- uint8* ma;
- int16* mb;
- uint32 n;
- ma=(uint8*)origdata;
+ uint8_t* ma;
+ int16_t* mb;
+ uint32_t n;
+ ma=(uint8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
- *mb++=(int16)(*ma++);
+ *mb++=(int16_t)(*ma++);
}
break;
case TIFF_SBYTE:
{
- int8* ma;
- int16* mb;
- uint32 n;
- ma=(int8*)origdata;
+ int8_t* ma;
+ int16_t* mb;
+ uint32_t n;
+ ma=(int8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
- *mb++=(int16)(*ma++);
+ *mb++=(int16_t)(*ma++);
}
break;
case TIFF_LONG:
{
- uint32* ma;
- int16* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t* ma;
+ int16_t* mb;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1568,34 +1567,34 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEn
err=TIFFReadDirEntryCheckRangeSshortLong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int16)(*ma++);
+ *mb++=(int16_t)(*ma++);
}
}
break;
case TIFF_SLONG:
{
- int32* ma;
- int16* mb;
- uint32 n;
- ma=(int32*)origdata;
+ int32_t* ma;
+ int16_t* mb;
+ uint32_t n;
+ ma=(int32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)ma);
+ TIFFSwabLong((uint32_t*)ma);
err=TIFFReadDirEntryCheckRangeSshortSlong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int16)(*ma++);
+ *mb++=(int16_t)(*ma++);
}
}
break;
case TIFF_LONG8:
{
- uint64* ma;
- int16* mb;
- uint32 n;
- ma=(uint64*)origdata;
+ uint64_t* ma;
+ int16_t* mb;
+ uint32_t n;
+ ma=(uint64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1604,25 +1603,25 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEn
err=TIFFReadDirEntryCheckRangeSshortLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int16)(*ma++);
+ *mb++=(int16_t)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
- int64* ma;
- int16* mb;
- uint32 n;
- ma=(int64*)origdata;
+ int64_t* ma;
+ int16_t* mb;
+ uint32_t n;
+ ma=(int64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)ma);
+ TIFFSwabLong8((uint64_t*)ma);
err=TIFFReadDirEntryCheckRangeSshortSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int16)(*ma++);
+ *mb++=(int16_t)(*ma++);
}
}
break;
@@ -1637,12 +1636,12 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySshortArray(TIFF* tif, TIFFDirEn
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntry* direntry, uint32** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntry* direntry, uint32_t** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
- uint32* data;
+ uint32_t* data;
switch (direntry->tdir_type)
{
case TIFF_BYTE:
@@ -1666,19 +1665,19 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntr
switch (direntry->tdir_type)
{
case TIFF_LONG:
- *value=(uint32*)origdata;
+ *value=(uint32_t*)origdata;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfLong(*value,count);
return(TIFFReadDirEntryErrOk);
case TIFF_SLONG:
{
- int32* m;
- uint32 n;
- m=(int32*)origdata;
+ int32_t* m;
+ uint32_t n;
+ m=(int32_t*)origdata;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)m);
+ TIFFSwabLong((uint32_t*)m);
err=TIFFReadDirEntryCheckRangeLongSlong(*m);
if (err!=TIFFReadDirEntryErrOk)
{
@@ -1687,11 +1686,11 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntr
}
m++;
}
- *value=(uint32*)origdata;
+ *value=(uint32_t*)origdata;
return(TIFFReadDirEntryErrOk);
}
}
- data=(uint32*)_TIFFmalloc(count*4);
+ data=(uint32_t*)_TIFFmalloc(count * 4);
if (data==0)
{
_TIFFfree(origdata);
@@ -1701,70 +1700,70 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntr
{
case TIFF_BYTE:
{
- uint8* ma;
- uint32* mb;
- uint32 n;
- ma=(uint8*)origdata;
+ uint8_t* ma;
+ uint32_t* mb;
+ uint32_t n;
+ ma=(uint8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
- *mb++=(uint32)(*ma++);
+ *mb++=(uint32_t)(*ma++);
}
break;
case TIFF_SBYTE:
{
- int8* ma;
- uint32* mb;
- uint32 n;
- ma=(int8*)origdata;
+ int8_t* ma;
+ uint32_t* mb;
+ uint32_t n;
+ ma=(int8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
err=TIFFReadDirEntryCheckRangeLongSbyte(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint32)(*ma++);
+ *mb++=(uint32_t)(*ma++);
}
}
break;
case TIFF_SHORT:
{
- uint16* ma;
- uint32* mb;
- uint32 n;
- ma=(uint16*)origdata;
+ uint16_t* ma;
+ uint32_t* mb;
+ uint32_t n;
+ ma=(uint16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(ma);
- *mb++=(uint32)(*ma++);
+ *mb++=(uint32_t)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
- int16* ma;
- uint32* mb;
- uint32 n;
- ma=(int16*)origdata;
+ int16_t* ma;
+ uint32_t* mb;
+ uint32_t n;
+ ma=(int16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
+ TIFFSwabShort((uint16_t*)ma);
err=TIFFReadDirEntryCheckRangeLongSshort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint32)(*ma++);
+ *mb++=(uint32_t)(*ma++);
}
}
break;
case TIFF_LONG8:
{
- uint64* ma;
- uint32* mb;
- uint32 n;
- ma=(uint64*)origdata;
+ uint64_t* ma;
+ uint32_t* mb;
+ uint32_t n;
+ ma=(uint64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1773,25 +1772,25 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntr
err=TIFFReadDirEntryCheckRangeLongLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint32)(*ma++);
+ *mb++=(uint32_t)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
- int64* ma;
- uint32* mb;
- uint32 n;
- ma=(int64*)origdata;
+ int64_t* ma;
+ uint32_t* mb;
+ uint32_t n;
+ ma=(int64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)ma);
+ TIFFSwabLong8((uint64_t*)ma);
err=TIFFReadDirEntryCheckRangeLongSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint32)(*ma++);
+ *mb++=(uint32_t)(*ma++);
}
}
break;
@@ -1806,12 +1805,12 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLongArray(TIFF* tif, TIFFDirEntr
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEntry* direntry, int32** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEntry* direntry, int32_t** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
- int32* data;
+ int32_t* data;
switch (direntry->tdir_type)
{
case TIFF_BYTE:
@@ -1836,13 +1835,13 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEnt
{
case TIFF_LONG:
{
- uint32* m;
- uint32 n;
- m=(uint32*)origdata;
+ uint32_t* m;
+ uint32_t n;
+ m=(uint32_t*)origdata;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)m);
+ TIFFSwabLong((uint32_t*)m);
err=TIFFReadDirEntryCheckRangeSlongLong(*m);
if (err!=TIFFReadDirEntryErrOk)
{
@@ -1851,16 +1850,16 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEnt
}
m++;
}
- *value=(int32*)origdata;
+ *value=(int32_t*)origdata;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG:
- *value=(int32*)origdata;
+ *value=(int32_t*)origdata;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong((uint32*)(*value),count);
+ TIFFSwabArrayOfLong((uint32_t*)(*value), count);
return(TIFFReadDirEntryErrOk);
}
- data=(int32*)_TIFFmalloc(count*4);
+ data=(int32_t*)_TIFFmalloc(count * 4);
if (data==0)
{
_TIFFfree(origdata);
@@ -1870,62 +1869,62 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEnt
{
case TIFF_BYTE:
{
- uint8* ma;
- int32* mb;
- uint32 n;
- ma=(uint8*)origdata;
+ uint8_t* ma;
+ int32_t* mb;
+ uint32_t n;
+ ma=(uint8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
- *mb++=(int32)(*ma++);
+ *mb++=(int32_t)(*ma++);
}
break;
case TIFF_SBYTE:
{
- int8* ma;
- int32* mb;
- uint32 n;
- ma=(int8*)origdata;
+ int8_t* ma;
+ int32_t* mb;
+ uint32_t n;
+ ma=(int8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
- *mb++=(int32)(*ma++);
+ *mb++=(int32_t)(*ma++);
}
break;
case TIFF_SHORT:
{
- uint16* ma;
- int32* mb;
- uint32 n;
- ma=(uint16*)origdata;
+ uint16_t* ma;
+ int32_t* mb;
+ uint32_t n;
+ ma=(uint16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(ma);
- *mb++=(int32)(*ma++);
+ *mb++=(int32_t)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
- int16* ma;
- int32* mb;
- uint32 n;
- ma=(int16*)origdata;
+ int16_t* ma;
+ int32_t* mb;
+ uint32_t n;
+ ma=(int16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
- *mb++=(int32)(*ma++);
+ TIFFSwabShort((uint16_t*)ma);
+ *mb++=(int32_t)(*ma++);
}
}
break;
case TIFF_LONG8:
{
- uint64* ma;
- int32* mb;
- uint32 n;
- ma=(uint64*)origdata;
+ uint64_t* ma;
+ int32_t* mb;
+ uint32_t n;
+ ma=(uint64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -1934,25 +1933,25 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEnt
err=TIFFReadDirEntryCheckRangeSlongLong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int32)(*ma++);
+ *mb++=(int32_t)(*ma++);
}
}
break;
case TIFF_SLONG8:
{
- int64* ma;
- int32* mb;
- uint32 n;
- ma=(int64*)origdata;
+ int64_t* ma;
+ int32_t* mb;
+ uint32_t n;
+ ma=(int64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)ma);
+ TIFFSwabLong8((uint64_t*)ma);
err=TIFFReadDirEntryCheckRangeSlongSlong8(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(int32)(*ma++);
+ *mb++=(int32_t)(*ma++);
}
}
break;
@@ -1968,12 +1967,12 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySlongArray(TIFF* tif, TIFFDirEnt
}
static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8ArrayWithLimit(
- TIFF* tif, TIFFDirEntry* direntry, uint64** value, uint64 maxcount)
+ TIFF* tif, TIFFDirEntry* direntry, uint64_t** value, uint64_t maxcount)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
- uint64* data;
+ uint64_t* data;
switch (direntry->tdir_type)
{
case TIFF_BYTE:
@@ -1997,19 +1996,19 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8ArrayWithLimit(
switch (direntry->tdir_type)
{
case TIFF_LONG8:
- *value=(uint64*)origdata;
+ *value=(uint64_t*)origdata;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfLong8(*value,count);
return(TIFFReadDirEntryErrOk);
case TIFF_SLONG8:
{
- int64* m;
- uint32 n;
- m=(int64*)origdata;
+ int64_t* m;
+ uint32_t n;
+ m=(int64_t*)origdata;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)m);
+ TIFFSwabLong8((uint64_t*)m);
err=TIFFReadDirEntryCheckRangeLong8Slong8(*m);
if (err!=TIFFReadDirEntryErrOk)
{
@@ -2018,11 +2017,11 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8ArrayWithLimit(
}
m++;
}
- *value=(uint64*)origdata;
+ *value=(uint64_t*)origdata;
return(TIFFReadDirEntryErrOk);
}
}
- data=(uint64*)_TIFFmalloc(count*8);
+ data=(uint64_t*)_TIFFmalloc(count * 8);
if (data==0)
{
_TIFFfree(origdata);
@@ -2032,94 +2031,94 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8ArrayWithLimit(
{
case TIFF_BYTE:
{
- uint8* ma;
- uint64* mb;
- uint32 n;
- ma=(uint8*)origdata;
+ uint8_t* ma;
+ uint64_t* mb;
+ uint32_t n;
+ ma=(uint8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
- *mb++=(uint64)(*ma++);
+ *mb++=(uint64_t)(*ma++);
}
break;
case TIFF_SBYTE:
{
- int8* ma;
- uint64* mb;
- uint32 n;
- ma=(int8*)origdata;
+ int8_t* ma;
+ uint64_t* mb;
+ uint32_t n;
+ ma=(int8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
err=TIFFReadDirEntryCheckRangeLong8Sbyte(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint64)(*ma++);
+ *mb++=(uint64_t)(*ma++);
}
}
break;
case TIFF_SHORT:
{
- uint16* ma;
- uint64* mb;
- uint32 n;
- ma=(uint16*)origdata;
+ uint16_t* ma;
+ uint64_t* mb;
+ uint32_t n;
+ ma=(uint16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(ma);
- *mb++=(uint64)(*ma++);
+ *mb++=(uint64_t)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
- int16* ma;
- uint64* mb;
- uint32 n;
- ma=(int16*)origdata;
+ int16_t* ma;
+ uint64_t* mb;
+ uint32_t n;
+ ma=(int16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
+ TIFFSwabShort((uint16_t*)ma);
err=TIFFReadDirEntryCheckRangeLong8Sshort(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint64)(*ma++);
+ *mb++=(uint64_t)(*ma++);
}
}
break;
case TIFF_LONG:
{
- uint32* ma;
- uint64* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t* ma;
+ uint64_t* mb;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(ma);
- *mb++=(uint64)(*ma++);
+ *mb++=(uint64_t)(*ma++);
}
}
break;
case TIFF_SLONG:
{
- int32* ma;
- uint64* mb;
- uint32 n;
- ma=(int32*)origdata;
+ int32_t* ma;
+ uint64_t* mb;
+ uint32_t n;
+ ma=(int32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)ma);
+ TIFFSwabLong((uint32_t*)ma);
err=TIFFReadDirEntryCheckRangeLong8Slong(*ma);
if (err!=TIFFReadDirEntryErrOk)
break;
- *mb++=(uint64)(*ma++);
+ *mb++=(uint64_t)(*ma++);
}
}
break;
@@ -2134,17 +2133,17 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8ArrayWithLimit(
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8Array(TIFF* tif, TIFFDirEntry* direntry, uint64** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryLong8Array(TIFF* tif, TIFFDirEntry* direntry, uint64_t** value)
{
- return TIFFReadDirEntryLong8ArrayWithLimit(tif, direntry, value, ~((uint64)0));
+ return TIFFReadDirEntryLong8ArrayWithLimit(tif, direntry, value, ~((uint64_t)0));
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEntry* direntry, int64** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEntry* direntry, int64_t** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
- int64* data;
+ int64_t* data;
switch (direntry->tdir_type)
{
case TIFF_BYTE:
@@ -2169,9 +2168,9 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEn
{
case TIFF_LONG8:
{
- uint64* m;
- uint32 n;
- m=(uint64*)origdata;
+ uint64_t* m;
+ uint32_t n;
+ m=(uint64_t*)origdata;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
@@ -2184,16 +2183,16 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEn
}
m++;
}
- *value=(int64*)origdata;
+ *value=(int64_t*)origdata;
return(TIFFReadDirEntryErrOk);
}
case TIFF_SLONG8:
- *value=(int64*)origdata;
+ *value=(int64_t*)origdata;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong8((uint64*)(*value),count);
+ TIFFSwabArrayOfLong8((uint64_t*)(*value), count);
return(TIFFReadDirEntryErrOk);
}
- data=(int64*)_TIFFmalloc(count*8);
+ data=(int64_t*)_TIFFmalloc(count * 8);
if (data==0)
{
_TIFFfree(origdata);
@@ -2203,83 +2202,83 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEn
{
case TIFF_BYTE:
{
- uint8* ma;
- int64* mb;
- uint32 n;
- ma=(uint8*)origdata;
+ uint8_t* ma;
+ int64_t* mb;
+ uint32_t n;
+ ma=(uint8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
- *mb++=(int64)(*ma++);
+ *mb++=(int64_t)(*ma++);
}
break;
case TIFF_SBYTE:
{
- int8* ma;
- int64* mb;
- uint32 n;
- ma=(int8*)origdata;
+ int8_t* ma;
+ int64_t* mb;
+ uint32_t n;
+ ma=(int8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
- *mb++=(int64)(*ma++);
+ *mb++=(int64_t)(*ma++);
}
break;
case TIFF_SHORT:
{
- uint16* ma;
- int64* mb;
- uint32 n;
- ma=(uint16*)origdata;
+ uint16_t* ma;
+ int64_t* mb;
+ uint32_t n;
+ ma=(uint16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(ma);
- *mb++=(int64)(*ma++);
+ *mb++=(int64_t)(*ma++);
}
}
break;
case TIFF_SSHORT:
{
- int16* ma;
- int64* mb;
- uint32 n;
- ma=(int16*)origdata;
+ int16_t* ma;
+ int64_t* mb;
+ uint32_t n;
+ ma=(int16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
- *mb++=(int64)(*ma++);
+ TIFFSwabShort((uint16_t*)ma);
+ *mb++=(int64_t)(*ma++);
}
}
break;
case TIFF_LONG:
{
- uint32* ma;
- int64* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t* ma;
+ int64_t* mb;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(ma);
- *mb++=(int64)(*ma++);
+ *mb++=(int64_t)(*ma++);
}
}
break;
case TIFF_SLONG:
{
- int32* ma;
- int64* mb;
- uint32 n;
- ma=(int32*)origdata;
+ int32_t* ma;
+ int64_t* mb;
+ uint32_t n;
+ ma=(int32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)ma);
- *mb++=(int64)(*ma++);
+ TIFFSwabLong((uint32_t*)ma);
+ *mb++=(int64_t)(*ma++);
}
}
break;
@@ -2292,7 +2291,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntrySlong8Array(TIFF* tif, TIFFDirEn
static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEntry* direntry, float** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
float* data;
switch (direntry->tdir_type)
@@ -2323,7 +2322,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
{
case TIFF_FLOAT:
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong((uint32*)origdata,count);
+ TIFFSwabArrayOfLong((uint32_t*)origdata, count);
TIFFCvtIEEEDoubleToNative(tif,count,(float*)origdata);
*value=(float*)origdata;
return(TIFFReadDirEntryErrOk);
@@ -2338,10 +2337,10 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
{
case TIFF_BYTE:
{
- uint8* ma;
+ uint8_t* ma;
float* mb;
- uint32 n;
- ma=(uint8*)origdata;
+ uint32_t n;
+ ma=(uint8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
*mb++=(float)(*ma++);
@@ -2349,10 +2348,10 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
break;
case TIFF_SBYTE:
{
- int8* ma;
+ int8_t* ma;
float* mb;
- uint32 n;
- ma=(int8*)origdata;
+ uint32_t n;
+ ma=(int8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
*mb++=(float)(*ma++);
@@ -2360,10 +2359,10 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
break;
case TIFF_SHORT:
{
- uint16* ma;
+ uint16_t* ma;
float* mb;
- uint32 n;
- ma=(uint16*)origdata;
+ uint32_t n;
+ ma=(uint16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -2375,25 +2374,25 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
break;
case TIFF_SSHORT:
{
- int16* ma;
+ int16_t* ma;
float* mb;
- uint32 n;
- ma=(int16*)origdata;
+ uint32_t n;
+ ma=(int16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
+ TIFFSwabShort((uint16_t*)ma);
*mb++=(float)(*ma++);
}
}
break;
case TIFF_LONG:
{
- uint32* ma;
+ uint32_t* ma;
float* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -2405,25 +2404,25 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
break;
case TIFF_SLONG:
{
- int32* ma;
+ int32_t* ma;
float* mb;
- uint32 n;
- ma=(int32*)origdata;
+ uint32_t n;
+ ma=(int32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)ma);
+ TIFFSwabLong((uint32_t*)ma);
*mb++=(float)(*ma++);
}
}
break;
case TIFF_LONG8:
{
- uint64* ma;
+ uint64_t* ma;
float* mb;
- uint32 n;
- ma=(uint64*)origdata;
+ uint32_t n;
+ ma=(uint64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -2444,27 +2443,27 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
break;
case TIFF_SLONG8:
{
- int64* ma;
+ int64_t* ma;
float* mb;
- uint32 n;
- ma=(int64*)origdata;
+ uint32_t n;
+ ma=(int64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)ma);
+ TIFFSwabLong8((uint64_t*)ma);
*mb++=(float)(*ma++);
}
}
break;
case TIFF_RATIONAL:
{
- uint32* ma;
- uint32 maa;
- uint32 mab;
+ uint32_t* ma;
+ uint32_t maa;
+ uint32_t mab;
float* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -2483,18 +2482,18 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
break;
case TIFF_SRATIONAL:
{
- uint32* ma;
- int32 maa;
- uint32 mab;
+ uint32_t* ma;
+ int32_t maa;
+ uint32_t mab;
float* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(ma);
- maa=*(int32*)ma;
+ maa=*(int32_t*)ma;
ma++;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(ma);
@@ -2510,9 +2509,9 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryFloatArray(TIFF* tif, TIFFDirEnt
{
double* ma;
float* mb;
- uint32 n;
+ uint32_t n;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong8((uint64*)origdata,count);
+ TIFFSwabArrayOfLong8((uint64_t*)origdata, count);
TIFFCvtIEEEDoubleToNative(tif,count,(double*)origdata);
ma=(double*)origdata;
mb=data;
@@ -2537,7 +2536,7 @@ static enum TIFFReadDirEntryErr
TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
double* data;
switch (direntry->tdir_type)
@@ -2568,7 +2567,7 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
{
case TIFF_DOUBLE:
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong8((uint64*)origdata,count);
+ TIFFSwabArrayOfLong8((uint64_t*)origdata, count);
TIFFCvtIEEEDoubleToNative(tif,count,(double*)origdata);
*value=(double*)origdata;
return(TIFFReadDirEntryErrOk);
@@ -2583,10 +2582,10 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
{
case TIFF_BYTE:
{
- uint8* ma;
+ uint8_t* ma;
double* mb;
- uint32 n;
- ma=(uint8*)origdata;
+ uint32_t n;
+ ma=(uint8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
*mb++=(double)(*ma++);
@@ -2594,10 +2593,10 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
break;
case TIFF_SBYTE:
{
- int8* ma;
+ int8_t* ma;
double* mb;
- uint32 n;
- ma=(int8*)origdata;
+ uint32_t n;
+ ma=(int8_t*)origdata;
mb=data;
for (n=0; n<count; n++)
*mb++=(double)(*ma++);
@@ -2605,10 +2604,10 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
break;
case TIFF_SHORT:
{
- uint16* ma;
+ uint16_t* ma;
double* mb;
- uint32 n;
- ma=(uint16*)origdata;
+ uint32_t n;
+ ma=(uint16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -2620,25 +2619,25 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
break;
case TIFF_SSHORT:
{
- int16* ma;
+ int16_t* ma;
double* mb;
- uint32 n;
- ma=(int16*)origdata;
+ uint32_t n;
+ ma=(int16_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
+ TIFFSwabShort((uint16_t*)ma);
*mb++=(double)(*ma++);
}
}
break;
case TIFF_LONG:
{
- uint32* ma;
+ uint32_t* ma;
double* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -2650,25 +2649,25 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
break;
case TIFF_SLONG:
{
- int32* ma;
+ int32_t* ma;
double* mb;
- uint32 n;
- ma=(int32*)origdata;
+ uint32_t n;
+ ma=(int32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)ma);
+ TIFFSwabLong((uint32_t*)ma);
*mb++=(double)(*ma++);
}
}
break;
case TIFF_LONG8:
{
- uint64* ma;
+ uint64_t* ma;
double* mb;
- uint32 n;
- ma=(uint64*)origdata;
+ uint32_t n;
+ ma=(uint64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -2689,27 +2688,27 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
break;
case TIFF_SLONG8:
{
- int64* ma;
+ int64_t* ma;
double* mb;
- uint32 n;
- ma=(int64*)origdata;
+ uint32_t n;
+ ma=(int64_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)ma);
+ TIFFSwabLong8((uint64_t*)ma);
*mb++=(double)(*ma++);
}
}
break;
case TIFF_RATIONAL:
{
- uint32* ma;
- uint32 maa;
- uint32 mab;
+ uint32_t* ma;
+ uint32_t maa;
+ uint32_t mab;
double* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
@@ -2728,18 +2727,18 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
break;
case TIFF_SRATIONAL:
{
- uint32* ma;
- int32 maa;
- uint32 mab;
+ uint32_t* ma;
+ int32_t maa;
+ uint32_t mab;
double* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(ma);
- maa=*(int32*)ma;
+ maa=*(int32_t*)ma;
ma++;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(ma);
@@ -2755,9 +2754,9 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
{
float* ma;
double* mb;
- uint32 n;
+ uint32_t n;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong((uint32*)origdata,count);
+ TIFFSwabArrayOfLong((uint32_t*)origdata, count);
TIFFCvtIEEEFloatToNative(tif,count,(float*)origdata);
ma=(float*)origdata;
mb=data;
@@ -2771,12 +2770,12 @@ TIFFReadDirEntryDoubleArray(TIFF* tif, TIFFDirEntry* direntry, double** value)
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF* tif, TIFFDirEntry* direntry, uint64** value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF* tif, TIFFDirEntry* direntry, uint64_t** value)
{
enum TIFFReadDirEntryErr err;
- uint32 count;
+ uint32_t count;
void* origdata;
- uint64* data;
+ uint64_t* data;
switch (direntry->tdir_type)
{
case TIFF_LONG:
@@ -2797,12 +2796,12 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF* tif, TIFFDirEntr
{
case TIFF_LONG8:
case TIFF_IFD8:
- *value=(uint64*)origdata;
+ *value=(uint64_t*)origdata;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfLong8(*value,count);
return(TIFFReadDirEntryErrOk);
}
- data=(uint64*)_TIFFmalloc(count*8);
+ data=(uint64_t*)_TIFFmalloc(count * 8);
if (data==0)
{
_TIFFfree(origdata);
@@ -2813,16 +2812,16 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF* tif, TIFFDirEntr
case TIFF_LONG:
case TIFF_IFD:
{
- uint32* ma;
- uint64* mb;
- uint32 n;
- ma=(uint32*)origdata;
+ uint32_t* ma;
+ uint64_t* mb;
+ uint32_t n;
+ ma=(uint32_t*)origdata;
mb=data;
for (n=0; n<count; n++)
{
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(ma);
- *mb++=(uint64)(*ma++);
+ *mb++=(uint64_t)(*ma++);
}
}
break;
@@ -2832,13 +2831,13 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryIfd8Array(TIFF* tif, TIFFDirEntr
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleShort(TIFF* tif, TIFFDirEntry* direntry, uint16_t* value)
{
enum TIFFReadDirEntryErr err;
- uint16* m;
- uint16* na;
- uint16 nb;
- if (direntry->tdir_count<(uint64)tif->tif_dir.td_samplesperpixel)
+ uint16_t* m;
+ uint16_t* na;
+ uint16_t nb;
+ if (direntry->tdir_count<(uint64_t)tif->tif_dir.td_samplesperpixel)
return(TIFFReadDirEntryErrCount);
err=TIFFReadDirEntryShortArray(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk || m == NULL)
@@ -2866,8 +2865,8 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleDouble(TIFF* tif, TIFFD
enum TIFFReadDirEntryErr err;
double* m;
double* na;
- uint16 nb;
- if (direntry->tdir_count<(uint64)tif->tif_dir.td_samplesperpixel)
+ uint16_t nb;
+ if (direntry->tdir_count<(uint64_t)tif->tif_dir.td_samplesperpixel)
return(TIFFReadDirEntryErrCount);
err=TIFFReadDirEntryDoubleArray(tif,direntry,&m);
if (err!=TIFFReadDirEntryErrOk)
@@ -2890,53 +2889,53 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryPersampleDouble(TIFF* tif, TIFFD
}
#endif
-static void TIFFReadDirEntryCheckedByte(TIFF* tif, TIFFDirEntry* direntry, uint8* value)
+static void TIFFReadDirEntryCheckedByte(TIFF* tif, TIFFDirEntry* direntry, uint8_t* value)
{
(void) tif;
- *value=*(uint8*)(&direntry->tdir_offset);
+ *value=*(uint8_t*)(&direntry->tdir_offset);
}
-static void TIFFReadDirEntryCheckedSbyte(TIFF* tif, TIFFDirEntry* direntry, int8* value)
+static void TIFFReadDirEntryCheckedSbyte(TIFF* tif, TIFFDirEntry* direntry, int8_t* value)
{
(void) tif;
- *value=*(int8*)(&direntry->tdir_offset);
+ *value=*(int8_t*)(&direntry->tdir_offset);
}
-static void TIFFReadDirEntryCheckedShort(TIFF* tif, TIFFDirEntry* direntry, uint16* value)
+static void TIFFReadDirEntryCheckedShort(TIFF* tif, TIFFDirEntry* direntry, uint16_t* value)
{
*value = direntry->tdir_offset.toff_short;
- /* *value=*(uint16*)(&direntry->tdir_offset); */
+ /* *value=*(uint16_t*)(&direntry->tdir_offset); */
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(value);
}
-static void TIFFReadDirEntryCheckedSshort(TIFF* tif, TIFFDirEntry* direntry, int16* value)
+static void TIFFReadDirEntryCheckedSshort(TIFF* tif, TIFFDirEntry* direntry, int16_t* value)
{
- *value=*(int16*)(&direntry->tdir_offset);
+ *value=*(int16_t*)(&direntry->tdir_offset);
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)value);
+ TIFFSwabShort((uint16_t*)value);
}
-static void TIFFReadDirEntryCheckedLong(TIFF* tif, TIFFDirEntry* direntry, uint32* value)
+static void TIFFReadDirEntryCheckedLong(TIFF* tif, TIFFDirEntry* direntry, uint32_t* value)
{
- *value=*(uint32*)(&direntry->tdir_offset);
+ *value=*(uint32_t*)(&direntry->tdir_offset);
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(value);
}
-static void TIFFReadDirEntryCheckedSlong(TIFF* tif, TIFFDirEntry* direntry, int32* value)
+static void TIFFReadDirEntryCheckedSlong(TIFF* tif, TIFFDirEntry* direntry, int32_t* value)
{
- *value=*(int32*)(&direntry->tdir_offset);
+ *value=*(int32_t*)(&direntry->tdir_offset);
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)value);
+ TIFFSwabLong((uint32_t*)value);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedLong8(TIFF* tif, TIFFDirEntry* direntry, uint64* value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedLong8(TIFF* tif, TIFFDirEntry* direntry, uint64_t* value)
{
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
enum TIFFReadDirEntryErr err;
- uint32 offset = direntry->tdir_offset.toff_long;
+ uint32_t offset = direntry->tdir_offset.toff_long;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&offset);
err=TIFFReadDirEntryData(tif,offset,8,value);
@@ -2950,12 +2949,12 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedLong8(TIFF* tif, TIFFDirE
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSlong8(TIFF* tif, TIFFDirEntry* direntry, int64* value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSlong8(TIFF* tif, TIFFDirEntry* direntry, int64_t* value)
{
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
enum TIFFReadDirEntryErr err;
- uint32 offset = direntry->tdir_offset.toff_long;
+ uint32_t offset = direntry->tdir_offset.toff_long;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&offset);
err=TIFFReadDirEntryData(tif,offset,8,value);
@@ -2963,9 +2962,9 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSlong8(TIFF* tif, TIFFDir
return(err);
}
else
- *value=*(int64*)(&direntry->tdir_offset);
+ *value=*(int64_t*)(&direntry->tdir_offset);
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)value);
+ TIFFSwabLong8((uint64_t*)value);
return(TIFFReadDirEntryErrOk);
}
@@ -2974,12 +2973,12 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedRational(TIFF* tif, TIFFD
UInt64Aligned_t m;
assert(sizeof(double)==8);
- assert(sizeof(uint64)==8);
- assert(sizeof(uint32)==4);
+ assert(sizeof(uint64_t) == 8);
+ assert(sizeof(uint32_t) == 4);
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
enum TIFFReadDirEntryErr err;
- uint32 offset = direntry->tdir_offset.toff_long;
+ uint32_t offset = direntry->tdir_offset.toff_long;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&offset);
err=TIFFReadDirEntryData(tif,offset,8,m.i);
@@ -3004,13 +3003,13 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSrational(TIFF* tif, TIFF
{
UInt64Aligned_t m;
assert(sizeof(double)==8);
- assert(sizeof(uint64)==8);
- assert(sizeof(int32)==4);
- assert(sizeof(uint32)==4);
+ assert(sizeof(uint64_t) == 8);
+ assert(sizeof(int32_t) == 4);
+ assert(sizeof(uint32_t) == 4);
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
enum TIFFReadDirEntryErr err;
- uint32 offset = direntry->tdir_offset.toff_long;
+ uint32_t offset = direntry->tdir_offset.toff_long;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&offset);
err=TIFFReadDirEntryData(tif,offset,8,m.i);
@@ -3024,10 +3023,10 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedSrational(TIFF* tif, TIFF
/* Not completely sure what we should do when m.i[1]==0, but some */
/* sanitizers do not like division by 0.0: */
/* http://bugzilla.maptools.org/show_bug.cgi?id=2644 */
- if ((int32)m.i[0]==0 || m.i[1]==0)
+ if ((int32_t)m.i[0] == 0 || m.i[1] == 0)
*value=0.0;
else
- *value=(double)((int32)m.i[0])/(double)m.i[1];
+ *value= (double)((int32_t)m.i[0]) / (double)m.i[1];
return(TIFFReadDirEntryErrOk);
}
@@ -3036,26 +3035,26 @@ static void TIFFReadDirEntryCheckedFloat(TIFF* tif, TIFFDirEntry* direntry, floa
union
{
float f;
- uint32 i;
+ uint32_t i;
} float_union;
assert(sizeof(float)==4);
- assert(sizeof(uint32)==4);
+ assert(sizeof(uint32_t) == 4);
assert(sizeof(float_union)==4);
- float_union.i=*(uint32*)(&direntry->tdir_offset);
+ float_union.i=*(uint32_t*)(&direntry->tdir_offset);
*value=float_union.f;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)value);
+ TIFFSwabLong((uint32_t*)value);
}
static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedDouble(TIFF* tif, TIFFDirEntry* direntry, double* value)
{
assert(sizeof(double)==8);
- assert(sizeof(uint64)==8);
+ assert(sizeof(uint64_t) == 8);
assert(sizeof(UInt64Aligned_t)==8);
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
enum TIFFReadDirEntryErr err;
- uint32 offset = direntry->tdir_offset.toff_long;
+ uint32_t offset = direntry->tdir_offset.toff_long;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&offset);
err=TIFFReadDirEntryData(tif,offset,8,value);
@@ -3069,11 +3068,11 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckedDouble(TIFF* tif, TIFFDir
*value=uint64_union.d;
}
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)value);
+ TIFFSwabLong8((uint64_t*)value);
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSbyte(int8 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSbyte(int8_t value)
{
if (value<0)
return(TIFFReadDirEntryErrRange);
@@ -3081,7 +3080,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSbyte(int8 value)
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteShort(uint16 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteShort(uint16_t value)
{
if (value>0xFF)
return(TIFFReadDirEntryErrRange);
@@ -3089,7 +3088,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteShort(uint16 value
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSshort(int16 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSshort(int16_t value)
{
if ((value<0)||(value>0xFF))
return(TIFFReadDirEntryErrRange);
@@ -3097,7 +3096,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSshort(int16 value
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong(uint32 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong(uint32_t value)
{
if (value>0xFF)
return(TIFFReadDirEntryErrRange);
@@ -3105,7 +3104,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong(uint32 value)
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong(int32 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong(int32_t value)
{
if ((value<0)||(value>0xFF))
return(TIFFReadDirEntryErrRange);
@@ -3113,7 +3112,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong(int32 value)
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong8(uint64 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong8(uint64_t value)
{
if (value>0xFF)
return(TIFFReadDirEntryErrRange);
@@ -3121,7 +3120,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteLong8(uint64 value
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong8(int64 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong8(int64_t value)
{
if ((value<0)||(value>0xFF))
return(TIFFReadDirEntryErrRange);
@@ -3129,7 +3128,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeByteSlong8(int64 value
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteByte(uint8 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteByte(uint8_t value)
{
if (value>0x7F)
return(TIFFReadDirEntryErrRange);
@@ -3137,7 +3136,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteByte(uint8 value)
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteShort(uint16 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteShort(uint16_t value)
{
if (value>0x7F)
return(TIFFReadDirEntryErrRange);
@@ -3145,7 +3144,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteShort(uint16 valu
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSshort(int16 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSshort(int16_t value)
{
if ((value<-0x80)||(value>0x7F))
return(TIFFReadDirEntryErrRange);
@@ -3153,7 +3152,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSshort(int16 valu
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong(uint32 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong(uint32_t value)
{
if (value>0x7F)
return(TIFFReadDirEntryErrRange);
@@ -3161,7 +3160,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong(uint32 value
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong(int32 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong(int32_t value)
{
if ((value<-0x80)||(value>0x7F))
return(TIFFReadDirEntryErrRange);
@@ -3169,7 +3168,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong(int32 value
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong8(uint64 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong8(uint64_t value)
{
if (value>0x7F)
return(TIFFReadDirEntryErrRange);
@@ -3177,7 +3176,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteLong8(uint64 valu
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong8(int64 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong8(int64_t value)
{
if ((value<-0x80)||(value>0x7F))
return(TIFFReadDirEntryErrRange);
@@ -3185,7 +3184,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSbyteSlong8(int64 valu
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSbyte(int8 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSbyte(int8_t value)
{
if (value<0)
return(TIFFReadDirEntryErrRange);
@@ -3193,7 +3192,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSbyte(int8 value)
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSshort(int16 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSshort(int16_t value)
{
if (value<0)
return(TIFFReadDirEntryErrRange);
@@ -3201,7 +3200,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSshort(int16 valu
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong(uint32 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong(uint32_t value)
{
if (value>0xFFFF)
return(TIFFReadDirEntryErrRange);
@@ -3209,7 +3208,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong(uint32 value
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong(int32 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong(int32_t value)
{
if ((value<0)||(value>0xFFFF))
return(TIFFReadDirEntryErrRange);
@@ -3217,7 +3216,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong(int32 value
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong8(uint64 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong8(uint64_t value)
{
if (value>0xFFFF)
return(TIFFReadDirEntryErrRange);
@@ -3225,7 +3224,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortLong8(uint64 valu
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong8(int64 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong8(int64_t value)
{
if ((value<0)||(value>0xFFFF))
return(TIFFReadDirEntryErrRange);
@@ -3233,7 +3232,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeShortSlong8(int64 valu
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortShort(uint16 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortShort(uint16_t value)
{
if (value>0x7FFF)
return(TIFFReadDirEntryErrRange);
@@ -3241,7 +3240,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortShort(uint16 val
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong(uint32 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong(uint32_t value)
{
if (value>0x7FFF)
return(TIFFReadDirEntryErrRange);
@@ -3249,7 +3248,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong(uint32 valu
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong(int32 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong(int32_t value)
{
if ((value<-0x8000)||(value>0x7FFF))
return(TIFFReadDirEntryErrRange);
@@ -3257,7 +3256,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong(int32 valu
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong8(uint64 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong8(uint64_t value)
{
if (value>0x7FFF)
return(TIFFReadDirEntryErrRange);
@@ -3265,7 +3264,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortLong8(uint64 val
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong8(int64 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong8(int64_t value)
{
if ((value<-0x8000)||(value>0x7FFF))
return(TIFFReadDirEntryErrRange);
@@ -3273,7 +3272,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeSshortSlong8(int64 val
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSbyte(int8 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSbyte(int8_t value)
{
if (value<0)
return(TIFFReadDirEntryErrRange);
@@ -3281,7 +3280,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSbyte(int8 value)
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSshort(int16 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSshort(int16_t value)
{
if (value<0)
return(TIFFReadDirEntryErrRange);
@@ -3289,7 +3288,7 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSshort(int16 value
return(TIFFReadDirEntryErrOk);
}
-static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32 value)
+static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32_t value)
{
if (value<0)
return(TIFFReadDirEntryErrRange);
@@ -3298,25 +3297,25 @@ static enum TIFFReadDirEntryErr TIFFReadDirEntryCheckRangeLongSlong(int32 value)
}
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeLongLong8(uint64 value)
+TIFFReadDirEntryCheckRangeLongLong8(uint64_t value)
{
- if (value > TIFF_UINT32_MAX)
+ if (value > UINT32_MAX)
return(TIFFReadDirEntryErrRange);
else
return(TIFFReadDirEntryErrOk);
}
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeLongSlong8(int64 value)
+TIFFReadDirEntryCheckRangeLongSlong8(int64_t value)
{
- if ((value < 0) || (value > (int64) TIFF_UINT32_MAX))
+ if ((value < 0) || (value > (int64_t) UINT32_MAX))
return(TIFFReadDirEntryErrRange);
else
return(TIFFReadDirEntryErrOk);
}
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeSlongLong(uint32 value)
+TIFFReadDirEntryCheckRangeSlongLong(uint32_t value)
{
if (value > 0x7FFFFFFFUL)
return(TIFFReadDirEntryErrRange);
@@ -3326,7 +3325,7 @@ TIFFReadDirEntryCheckRangeSlongLong(uint32 value)
/* Check that the 8-byte unsigned value can fit in a 4-byte unsigned range */
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeSlongLong8(uint64 value)
+TIFFReadDirEntryCheckRangeSlongLong8(uint64_t value)
{
if (value > 0x7FFFFFFF)
return(TIFFReadDirEntryErrRange);
@@ -3336,16 +3335,16 @@ TIFFReadDirEntryCheckRangeSlongLong8(uint64 value)
/* Check that the 8-byte signed value can fit in a 4-byte signed range */
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeSlongSlong8(int64 value)
+TIFFReadDirEntryCheckRangeSlongSlong8(int64_t value)
{
- if ((value < 0-((int64) 0x7FFFFFFF+1)) || (value > 0x7FFFFFFF))
+ if ((value < 0-((int64_t) 0x7FFFFFFF + 1)) || (value > 0x7FFFFFFF))
return(TIFFReadDirEntryErrRange);
else
return(TIFFReadDirEntryErrOk);
}
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeLong8Sbyte(int8 value)
+TIFFReadDirEntryCheckRangeLong8Sbyte(int8_t value)
{
if (value < 0)
return(TIFFReadDirEntryErrRange);
@@ -3354,7 +3353,7 @@ TIFFReadDirEntryCheckRangeLong8Sbyte(int8 value)
}
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeLong8Sshort(int16 value)
+TIFFReadDirEntryCheckRangeLong8Sshort(int16_t value)
{
if (value < 0)
return(TIFFReadDirEntryErrRange);
@@ -3363,7 +3362,7 @@ TIFFReadDirEntryCheckRangeLong8Sshort(int16 value)
}
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeLong8Slong(int32 value)
+TIFFReadDirEntryCheckRangeLong8Slong(int32_t value)
{
if (value < 0)
return(TIFFReadDirEntryErrRange);
@@ -3372,7 +3371,7 @@ TIFFReadDirEntryCheckRangeLong8Slong(int32 value)
}
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeLong8Slong8(int64 value)
+TIFFReadDirEntryCheckRangeLong8Slong8(int64_t value)
{
if (value < 0)
return(TIFFReadDirEntryErrRange);
@@ -3381,16 +3380,16 @@ TIFFReadDirEntryCheckRangeLong8Slong8(int64 value)
}
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryCheckRangeSlong8Long8(uint64 value)
+TIFFReadDirEntryCheckRangeSlong8Long8(uint64_t value)
{
- if (value > TIFF_INT64_MAX)
+ if (value > INT64_MAX)
return(TIFFReadDirEntryErrRange);
else
return(TIFFReadDirEntryErrOk);
}
static enum TIFFReadDirEntryErr
-TIFFReadDirEntryData(TIFF* tif, uint64 offset, tmsize_t size, void* dest)
+TIFFReadDirEntryData(TIFF* tif, uint64_t offset, tmsize_t size, void* dest)
{
assert(size>0);
if (!isMapped(tif)) {
@@ -3401,13 +3400,13 @@ TIFFReadDirEntryData(TIFF* tif, uint64 offset, tmsize_t size, void* dest)
} else {
size_t ma,mb;
ma=(size_t)offset;
- if( (uint64)ma!=offset ||
+ if((uint64_t)ma != offset ||
ma > (~(size_t)0) - (size_t)size )
{
return TIFFReadDirEntryErrIo;
}
mb=ma+size;
- if (mb > (uint64)tif->tif_size)
+ if (mb > (uint64_t)tif->tif_size)
return(TIFFReadDirEntryErrIo);
_TIFFmemcpy(dest,tif->tif_base+ma,size);
}
@@ -3506,7 +3505,7 @@ static void TIFFReadDirEntryOutputErr(TIFF* tif, enum TIFFReadDirEntryErr err, c
* type. 0 is returned if photometric type isn't supported or no default value
* is defined by the specification.
*/
-static int _TIFFGetMaxColorChannels( uint16 photometric )
+static int _TIFFGetMaxColorChannels(uint16_t photometric )
{
switch (photometric) {
case PHOTOMETRIC_PALETTE:
@@ -3545,9 +3544,9 @@ static int ByteCountLooksBad(TIFF* tif)
* until the whole image will be written and directory
* dumped out.
*/
- uint64 bytecount = TIFFGetStrileByteCount(tif, 0);
- uint64 offset = TIFFGetStrileOffset(tif, 0);
- uint64 filesize;
+ uint64_t bytecount = TIFFGetStrileByteCount(tif, 0);
+ uint64_t offset = TIFFGetStrileOffset(tif, 0);
+ uint64_t filesize;
if( offset == 0 )
return 0;
@@ -3560,9 +3559,9 @@ static int ByteCountLooksBad(TIFF* tif)
return 1;
if( tif->tif_mode == O_RDONLY )
{
- uint64 scanlinesize = TIFFScanlineSize64(tif);
+ uint64_t scanlinesize = TIFFScanlineSize64(tif);
if( tif->tif_dir.td_imagelength > 0 &&
- scanlinesize > TIFF_UINT64_MAX / tif->tif_dir.td_imagelength )
+ scanlinesize > UINT64_MAX / tif->tif_dir.td_imagelength )
{
return 1;
}
@@ -3582,11 +3581,11 @@ TIFFReadDirectory(TIFF* tif)
{
static const char module[] = "TIFFReadDirectory";
TIFFDirEntry* dir;
- uint16 dircount;
+ uint16_t dircount;
TIFFDirEntry* dp;
- uint16 di;
+ uint16_t di;
const TIFFField* fip;
- uint32 fii=FAILED_FII;
+ uint32_t fii=FAILED_FII;
toff_t nextdiroff;
int bitspersample_read = FALSE;
int color_channels;
@@ -3601,7 +3600,7 @@ TIFFReadDirectory(TIFF* tif)
if (!dircount)
{
TIFFErrorExt(tif->tif_clientdata,module,
- "Failed to read directory at offset " TIFF_UINT64_FORMAT,nextdiroff);
+ "Failed to read directory at offset %" PRIu64, nextdiroff);
return 0;
}
TIFFReadDirectoryCheckOrder(tif,dir,dircount);
@@ -3612,11 +3611,11 @@ TIFFReadDirectory(TIFF* tif)
*/
{
TIFFDirEntry* ma;
- uint16 mb;
+ uint16_t mb;
for (ma=dir, mb=0; mb<dircount; ma++, mb++)
{
TIFFDirEntry* na;
- uint16 nb;
+ uint16_t nb;
for (na=ma+1, nb=mb+1; nb<dircount; na++, nb++)
{
if (ma->tdir_tag == na->tdir_tag) {
@@ -3673,7 +3672,7 @@ TIFFReadDirectory(TIFF* tif)
* this, we accept the tag if one value is supplied with either
* count.
*/
- uint16 value;
+ uint16_t value;
enum TIFFReadDirEntryErr err;
err=TIFFReadDirEntryShort(tif,dp,&value);
if (err==TIFFReadDirEntryErrCount)
@@ -3703,7 +3702,7 @@ TIFFReadDirectory(TIFF* tif)
if (fii == FAILED_FII)
{
TIFFWarningExt(tif->tif_clientdata, module,
- "Unknown field with tag %d (0x%x) encountered",
+ "Unknown field with tag %"PRIu16" (0x%"PRIx16") encountered",
dp->tdir_tag,dp->tdir_tag);
/* the following knowingly leaks the
anonymous field structure */
@@ -3714,7 +3713,7 @@ TIFFReadDirectory(TIFF* tif)
1)) {
TIFFWarningExt(tif->tif_clientdata,
module,
- "Registering anonymous field with tag %d (0x%x) failed",
+ "Registering anonymous field with tag %"PRIu16" (0x%"PRIx16") failed",
dp->tdir_tag,
dp->tdir_tag);
dp->tdir_ignore = TRUE;
@@ -3863,7 +3862,7 @@ TIFFReadDirectory(TIFF* tif)
* too.
*/
{
- uint16 value;
+ uint16_t value;
enum TIFFReadDirEntryErr err;
err=TIFFReadDirEntryShort(tif,dp,&value);
if (err==TIFFReadDirEntryErrCount)
@@ -3886,9 +3885,9 @@ TIFFReadDirectory(TIFF* tif)
double *data = NULL;
enum TIFFReadDirEntryErr err;
- uint32 saved_flags;
+ uint32_t saved_flags;
int m;
- if (dp->tdir_count != (uint64)tif->tif_dir.td_samplesperpixel)
+ if (dp->tdir_count != (uint64_t)tif->tif_dir.td_samplesperpixel)
err = TIFFReadDirEntryErrCount;
else
err = TIFFReadDirEntryDoubleArray(tif, dp, &data);
@@ -3961,10 +3960,10 @@ TIFFReadDirectory(TIFF* tif)
case TIFFTAG_TRANSFERFUNCTION:
{
enum TIFFReadDirEntryErr err;
- uint32 countpersample;
- uint32 countrequired;
- uint32 incrementpersample;
- uint16* value=NULL;
+ uint32_t countpersample;
+ uint32_t countrequired;
+ uint32_t incrementpersample;
+ uint16_t* value=NULL;
/* It would be dangerous to instantiate those tag values */
/* since if td_bitspersample has not yet been read (due to */
/* unordered tags), it could be read afterwards with a */
@@ -3985,13 +3984,13 @@ TIFFReadDirectory(TIFF* tif)
{
fip = TIFFFieldWithTag(tif,dp->tdir_tag);
TIFFWarningExt(tif->tif_clientdata,module,
- "Ignoring %s because BitsPerSample=%d>24",
+ "Ignoring %s because BitsPerSample=%"PRIu16">24",
fip ? fip->field_name : "unknown tagname",
tif->tif_dir.td_bitspersample);
continue;
}
countpersample=(1U<<tif->tif_dir.td_bitspersample);
- if ((dp->tdir_tag==TIFFTAG_TRANSFERFUNCTION)&&(dp->tdir_count==(uint64)countpersample))
+ if ((dp->tdir_tag==TIFFTAG_TRANSFERFUNCTION)&&(dp->tdir_count==(uint64_t)countpersample))
{
countrequired=countpersample;
incrementpersample=0;
@@ -4001,7 +4000,7 @@ TIFFReadDirectory(TIFF* tif)
countrequired=3*countpersample;
incrementpersample=countpersample;
}
- if (dp->tdir_count!=(uint64)countrequired)
+ if (dp->tdir_count!=(uint64_t)countrequired)
err=TIFFReadDirEntryErrCount;
else
err=TIFFReadDirEntryShortArray(tif,dp,&value);
@@ -4020,8 +4019,8 @@ TIFFReadDirectory(TIFF* tif)
/* BEGIN REV 4.0 COMPATIBILITY */
case TIFFTAG_OSUBFILETYPE:
{
- uint16 valueo;
- uint32 value;
+ uint16_t valueo;
+ uint32_t value;
if (TIFFReadDirEntryShort(tif,dp,&valueo)==TIFFReadDirEntryErrOk)
{
switch (valueo)
@@ -4154,26 +4153,27 @@ TIFFReadDirectory(TIFF* tif)
*/
color_channels = _TIFFGetMaxColorChannels(tif->tif_dir.td_photometric);
if (color_channels && tif->tif_dir.td_samplesperpixel - tif->tif_dir.td_extrasamples > color_channels) {
- uint16 old_extrasamples;
- uint16 *new_sampleinfo;
+ uint16_t old_extrasamples;
+ uint16_t *new_sampleinfo;
TIFFWarningExt(tif->tif_clientdata,module, "Sum of Photometric type-related "
"color channels and ExtraSamples doesn't match SamplesPerPixel. "
"Defining non-color channels as ExtraSamples.");
old_extrasamples = tif->tif_dir.td_extrasamples;
- tif->tif_dir.td_extrasamples = (uint16) (tif->tif_dir.td_samplesperpixel - color_channels);
+ tif->tif_dir.td_extrasamples = (uint16_t) (tif->tif_dir.td_samplesperpixel - color_channels);
// sampleinfo should contain information relative to these new extra samples
- new_sampleinfo = (uint16*) _TIFFcalloc(tif->tif_dir.td_extrasamples, sizeof(uint16));
+ new_sampleinfo = (uint16_t*) _TIFFcalloc(tif->tif_dir.td_extrasamples, sizeof(uint16_t));
if (!new_sampleinfo) {
TIFFErrorExt(tif->tif_clientdata, module, "Failed to allocate memory for "
- "temporary new sampleinfo array (%d 16 bit elements)",
+ "temporary new sampleinfo array "
+ "(%"PRIu16" 16 bit elements)",
tif->tif_dir.td_extrasamples);
goto bad;
}
- memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, old_extrasamples * sizeof(uint16));
+ memcpy(new_sampleinfo, tif->tif_dir.td_sampleinfo, old_extrasamples * sizeof(uint16_t));
_TIFFsetShortArray(&tif->tif_dir.td_sampleinfo, new_sampleinfo, tif->tif_dir.td_extrasamples);
_TIFFfree(new_sampleinfo);
}
@@ -4211,7 +4211,7 @@ TIFFReadDirectory(TIFF* tif)
if ((tif->tif_dir.td_planarconfig == PLANARCONFIG_CONTIG &&
tif->tif_dir.td_nstrips > 1) ||
(tif->tif_dir.td_planarconfig == PLANARCONFIG_SEPARATE &&
- tif->tif_dir.td_nstrips != (uint32)tif->tif_dir.td_samplesperpixel)) {
+ tif->tif_dir.td_nstrips != (uint32_t)tif->tif_dir.td_samplesperpixel)) {
MissingRequired(tif, "StripByteCounts");
goto bad;
}
@@ -4268,7 +4268,7 @@ TIFFReadDirectory(TIFF* tif)
if (tif->tif_dir.td_bitspersample>=16)
tif->tif_dir.td_maxsamplevalue=0xFFFF;
else
- tif->tif_dir.td_maxsamplevalue = (uint16)((1L<<tif->tif_dir.td_bitspersample)-1);
+ tif->tif_dir.td_maxsamplevalue = (uint16_t)((1L << tif->tif_dir.td_bitspersample) - 1);
}
#ifdef STRIPBYTECOUNTSORTED_UNUSED
@@ -4278,7 +4278,7 @@ TIFFReadDirectory(TIFF* tif)
* function in tif_write.c.
*/
if (!(tif->tif_flags&TIFF_DEFERSTRILELOAD) && tif->tif_dir.td_nstrips > 1) {
- uint32 strip;
+ uint32_t strip;
tif->tif_dir.td_stripbytecountsorted = 1;
for (strip = 1; strip < tif->tif_dir.td_nstrips; strip++) {
@@ -4333,10 +4333,10 @@ TIFFReadDirectory(TIFF* tif)
/*
* Reinitialize i/o since we are starting on a new directory.
*/
- tif->tif_row = (uint32) -1;
- tif->tif_curstrip = (uint32) -1;
- tif->tif_col = (uint32) -1;
- tif->tif_curtile = (uint32) -1;
+ tif->tif_row = (uint32_t) -1;
+ tif->tif_curstrip = (uint32_t) -1;
+ tif->tif_col = (uint32_t) -1;
+ tif->tif_curtile = (uint32_t) -1;
tif->tif_tilesize = (tmsize_t) -1;
tif->tif_scanlinesize = TIFFScanlineSize(tif);
@@ -4368,11 +4368,11 @@ bad:
}
static void
-TIFFReadDirectoryCheckOrder(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
+TIFFReadDirectoryCheckOrder(TIFF* tif, TIFFDirEntry* dir, uint16_t dircount)
{
static const char module[] = "TIFFReadDirectoryCheckOrder";
- uint16 m;
- uint16 n;
+ uint16_t m;
+ uint16_t n;
TIFFDirEntry* o;
m=0;
for (n=0, o=dir; n<dircount; n++, o++)
@@ -4388,10 +4388,10 @@ TIFFReadDirectoryCheckOrder(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
}
static TIFFDirEntry*
-TIFFReadDirectoryFindEntry(TIFF* tif, TIFFDirEntry* dir, uint16 dircount, uint16 tagid)
+TIFFReadDirectoryFindEntry(TIFF* tif, TIFFDirEntry* dir, uint16_t dircount, uint16_t tagid)
{
TIFFDirEntry* m;
- uint16 n;
+ uint16_t n;
(void) tif;
for (m=dir, n=0; n<dircount; m++, n++)
{
@@ -4402,11 +4402,11 @@ TIFFReadDirectoryFindEntry(TIFF* tif, TIFFDirEntry* dir, uint16 dircount, uint16
}
static void
-TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16 tagid, uint32* fii)
+TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16_t tagid, uint32_t* fii)
{
- int32 ma,mb,mc;
+ int32_t ma,mb,mc;
ma=-1;
- mc=(int32)tif->tif_nfields;
+ mc=(int32_t)tif->tif_nfields;
while (1)
{
if (ma+1==mc)
@@ -4415,9 +4415,9 @@ TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16 tagid, uint32* fii)
return;
}
mb=(ma+mc)/2;
- if (tif->tif_fields[mb]->field_tag==(uint32)tagid)
+ if (tif->tif_fields[mb]->field_tag==(uint32_t)tagid)
break;
- if (tif->tif_fields[mb]->field_tag<(uint32)tagid)
+ if (tif->tif_fields[mb]->field_tag<(uint32_t)tagid)
ma=mb;
else
mc=mb;
@@ -4426,7 +4426,7 @@ TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16 tagid, uint32* fii)
{
if (mb==0)
break;
- if (tif->tif_fields[mb-1]->field_tag!=(uint32)tagid)
+ if (tif->tif_fields[mb-1]->field_tag!=(uint32_t)tagid)
break;
mb--;
}
@@ -4443,18 +4443,18 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
{
static const char module[] = "TIFFReadCustomDirectory";
TIFFDirEntry* dir;
- uint16 dircount;
+ uint16_t dircount;
TIFFDirEntry* dp;
- uint16 di;
+ uint16_t di;
const TIFFField* fip;
- uint32 fii;
+ uint32_t fii;
(*tif->tif_cleanup)(tif); /* cleanup any previous compression state */
_TIFFSetupFields(tif, infoarray);
dircount=TIFFFetchDirectory(tif,diroff,&dir,NULL);
if (!dircount)
{
TIFFErrorExt(tif->tif_clientdata,module,
- "Failed to read custom directory at offset " TIFF_UINT64_FORMAT,diroff);
+ "Failed to read custom directory at offset %" PRIu64,diroff);
return 0;
}
TIFFFreeDirectory(tif);
@@ -4466,14 +4466,14 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
if (fii == FAILED_FII)
{
TIFFWarningExt(tif->tif_clientdata, module,
- "Unknown field with tag %d (0x%x) encountered",
+ "Unknown field with tag %"PRIu16" (0x%"PRIx16") encountered",
dp->tdir_tag, dp->tdir_tag);
if (!_TIFFMergeFields(tif, _TIFFCreateAnonField(tif,
dp->tdir_tag,
(TIFFDataType) dp->tdir_type),
1)) {
TIFFWarningExt(tif->tif_clientdata, module,
- "Registering anonymous field with tag %d (0x%x) failed",
+ "Registering anonymous field with tag %"PRIu16" (0x%"PRIx16") failed",
dp->tdir_tag, dp->tdir_tag);
dp->tdir_ignore = TRUE;
} else {
@@ -4493,7 +4493,7 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
{
fii++;
if ((fii==tif->tif_nfields)||
- (tif->tif_fields[fii]->field_tag!=(uint32)dp->tdir_tag))
+ (tif->tif_fields[fii]->field_tag!=(uint32_t)dp->tdir_tag))
{
fii=0xFFFF;
break;
@@ -4503,7 +4503,7 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
if (fii==0xFFFF)
{
TIFFWarningExt(tif->tif_clientdata, module,
- "Wrong data type %d for \"%s\"; tag ignored",
+ "Wrong data type %"PRIu16" for \"%s\"; tag ignored",
dp->tdir_type,fip->field_name);
dp->tdir_ignore = TRUE;
}
@@ -4513,11 +4513,11 @@ TIFFReadCustomDirectory(TIFF* tif, toff_t diroff,
if ((fip->field_readcount!=TIFF_VARIABLE)&&
(fip->field_readcount!=TIFF_VARIABLE2))
{
- uint32 expected;
+ uint32_t expected;
if (fip->field_readcount==TIFF_SPP)
- expected=(uint32)tif->tif_dir.td_samplesperpixel;
+ expected=(uint32_t)tif->tif_dir.td_samplesperpixel;
else
- expected=(uint32)fip->field_readcount;
+ expected=(uint32_t)fip->field_readcount;
if (!CheckDirCount(tif,dp,expected))
dp->tdir_ignore = TRUE;
}
@@ -4565,13 +4565,13 @@ TIFFReadGPSDirectory(TIFF* tif, toff_t diroff)
}
static int
-EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
+EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16_t dircount)
{
static const char module[] = "EstimateStripByteCounts";
TIFFDirEntry *dp;
TIFFDirectory *td = &tif->tif_dir;
- uint32 strip;
+ uint32_t strip;
/* Do not try to load stripbytecount as we will compute it */
if( !_TIFFFillStrilesInternal( tif, 0 ) )
@@ -4579,16 +4579,16 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
if (td->td_stripbytecount_p)
_TIFFfree(td->td_stripbytecount_p);
- td->td_stripbytecount_p = (uint64*)
- _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64),
+ td->td_stripbytecount_p = (uint64_t*)
+ _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64_t),
"for \"StripByteCounts\" array");
if( td->td_stripbytecount_p == NULL )
return -1;
if (td->td_compression != COMPRESSION_NONE) {
- uint64 space;
- uint64 filesize;
- uint16 n;
+ uint64_t space;
+ uint64_t filesize;
+ uint16_t n;
filesize = TIFFGetFileSize(tif);
if (!(tif->tif_flags&TIFF_BIGTIFF))
space=sizeof(TIFFHeaderClassic)+2+dircount*12+4;
@@ -4597,18 +4597,18 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
/* calculate amount of space used by indirect values */
for (dp = dir, n = dircount; n > 0; n--, dp++)
{
- uint32 typewidth;
- uint64 datasize;
+ uint32_t typewidth;
+ uint64_t datasize;
typewidth = TIFFDataWidth((TIFFDataType) dp->tdir_type);
if (typewidth == 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Cannot determine size of unknown tag type %d",
+ "Cannot determine size of unknown tag type %"PRIu16,
dp->tdir_type);
return -1;
}
- if( dp->tdir_count > TIFF_UINT64_MAX / typewidth )
+ if( dp->tdir_count > UINT64_MAX / typewidth )
return -1;
- datasize=(uint64)typewidth*dp->tdir_count;
+ datasize= (uint64_t)typewidth * dp->tdir_count;
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
if (datasize<=4)
@@ -4619,7 +4619,7 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
if (datasize<=8)
datasize=0;
}
- if( space > TIFF_UINT64_MAX - datasize )
+ if( space > UINT64_MAX - datasize )
return -1;
space+=datasize;
}
@@ -4640,7 +4640,7 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
* of data in the strip and trim this number back accordingly.
*/
strip--;
- if (td->td_stripoffset_p[strip] > TIFF_UINT64_MAX - td->td_stripbytecount_p[strip])
+ if (td->td_stripoffset_p[strip] > UINT64_MAX - td->td_stripbytecount_p[strip])
return -1;
if (td->td_stripoffset_p[strip]+td->td_stripbytecount_p[strip] > filesize) {
if( td->td_stripoffset_p[strip] >= filesize ) {
@@ -4651,16 +4651,16 @@ EstimateStripByteCounts(TIFF* tif, TIFFDirEntry* dir, uint16 dircount)
}
}
} else if (isTiled(tif)) {
- uint64 bytespertile = TIFFTileSize64(tif);
+ uint64_t bytespertile = TIFFTileSize64(tif);
for (strip = 0; strip < td->td_nstrips; strip++)
td->td_stripbytecount_p[strip] = bytespertile;
} else {
- uint64 rowbytes = TIFFScanlineSize64(tif);
- uint32 rowsperstrip = td->td_imagelength/td->td_stripsperimage;
+ uint64_t rowbytes = TIFFScanlineSize64(tif);
+ uint32_t rowsperstrip = td->td_imagelength / td->td_stripsperimage;
for (strip = 0; strip < td->td_nstrips; strip++)
{
- if( rowbytes > 0 && rowsperstrip > TIFF_UINT64_MAX / rowbytes )
+ if( rowbytes > 0 && rowsperstrip > UINT64_MAX / rowbytes )
return -1;
td->td_stripbytecount_p[strip] = rowbytes * rowsperstrip;
}
@@ -4688,9 +4688,9 @@ MissingRequired(TIFF* tif, const char* tagname)
* seen directories and check every IFD offset against that list.
*/
static int
-TIFFCheckDirOffset(TIFF* tif, uint64 diroff)
+TIFFCheckDirOffset(TIFF* tif, uint64_t diroff)
{
- uint16 n;
+ uint16_t n;
if (diroff == 0) /* no more directories */
return 0;
@@ -4708,14 +4708,14 @@ TIFFCheckDirOffset(TIFF* tif, uint64 diroff)
tif->tif_dirnumber++;
if (tif->tif_dirlist == NULL || tif->tif_dirnumber > tif->tif_dirlistsize) {
- uint64* new_dirlist;
+ uint64_t* new_dirlist;
/*
* XXX: Reduce memory allocation granularity of the dirlist
* array.
*/
- new_dirlist = (uint64*)_TIFFCheckRealloc(tif, tif->tif_dirlist,
- tif->tif_dirnumber, 2 * sizeof(uint64), "for IFD list");
+ new_dirlist = (uint64_t*)_TIFFCheckRealloc(tif, tif->tif_dirlist,
+ tif->tif_dirnumber, 2 * sizeof(uint64_t), "for IFD list");
if (!new_dirlist)
return 0;
if( tif->tif_dirnumber >= 32768 )
@@ -4735,19 +4735,19 @@ TIFFCheckDirOffset(TIFF* tif, uint64 diroff)
* caller is expected to skip/ignore the tag if there is a mismatch.
*/
static int
-CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count)
+CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32_t count)
{
- if ((uint64)count > dir->tdir_count) {
+ if ((uint64_t)count > dir->tdir_count) {
const TIFFField* fip = TIFFFieldWithTag(tif, dir->tdir_tag);
TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
- "incorrect count for field \"%s\" (" TIFF_UINT64_FORMAT ", expecting %u); tag ignored",
+ "incorrect count for field \"%s\" (%" PRIu64 ", expecting %"PRIu32"); tag ignored",
fip ? fip->field_name : "unknown tagname",
dir->tdir_count, count);
return (0);
- } else if ((uint64)count < dir->tdir_count) {
+ } else if ((uint64_t)count < dir->tdir_count) {
const TIFFField* fip = TIFFFieldWithTag(tif, dir->tdir_tag);
TIFFWarningExt(tif->tif_clientdata, tif->tif_name,
- "incorrect count for field \"%s\" (" TIFF_UINT64_FORMAT ", expecting %u); tag trimmed",
+ "incorrect count for field \"%s\" (%" PRIu64 ", expecting %"PRIu32"); tag trimmed",
fip ? fip->field_name : "unknown tagname",
dir->tdir_count, count);
dir->tdir_count = count;
@@ -4761,19 +4761,19 @@ CheckDirCount(TIFF* tif, TIFFDirEntry* dir, uint32 count)
* nextdiroff variable has been specified, read it too. Function returns a
* number of fields in the directory or 0 if failed.
*/
-static uint16
-TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
- uint64 *nextdiroff)
+static uint16_t
+TIFFFetchDirectory(TIFF* tif, uint64_t diroff, TIFFDirEntry** pdir,
+ uint64_t *nextdiroff)
{
static const char module[] = "TIFFFetchDirectory";
void* origdir;
- uint16 dircount16;
- uint32 dirsize;
+ uint16_t dircount16;
+ uint32_t dirsize;
TIFFDirEntry* dir;
- uint8* ma;
+ uint8_t* ma;
TIFFDirEntry* mb;
- uint16 n;
+ uint16_t n;
assert(pdir);
@@ -4789,7 +4789,7 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
}
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- if (!ReadOK(tif, &dircount16, sizeof (uint16))) {
+ if (!ReadOK(tif, &dircount16, sizeof (uint16_t))) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: Can not read TIFF directory count",
tif->tif_name);
@@ -4805,8 +4805,8 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
}
dirsize = 12;
} else {
- uint64 dircount64;
- if (!ReadOK(tif, &dircount64, sizeof (uint64))) {
+ uint64_t dircount64;
+ if (!ReadOK(tif, &dircount64, sizeof (uint64_t))) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: Can not read TIFF directory count",
tif->tif_name);
@@ -4820,7 +4820,7 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
"Sanity check on directory count failed, this is probably not a valid IFD offset");
return 0;
}
- dircount16 = (uint16)dircount64;
+ dircount16 = (uint16_t)dircount64;
dirsize = 20;
}
origdir = _TIFFCheckMalloc(tif, dircount16,
@@ -4842,14 +4842,14 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
{
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32 nextdiroff32;
- if (!ReadOK(tif, &nextdiroff32, sizeof(uint32)))
+ uint32_t nextdiroff32;
+ if (!ReadOK(tif, &nextdiroff32, sizeof(uint32_t)))
nextdiroff32 = 0;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&nextdiroff32);
*nextdiroff=nextdiroff32;
} else {
- if (!ReadOK(tif, nextdiroff, sizeof(uint64)))
+ if (!ReadOK(tif, nextdiroff, sizeof(uint64_t)))
*nextdiroff = 0;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(nextdiroff);
@@ -4858,7 +4858,7 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
} else {
tmsize_t m;
tmsize_t off;
- if (tif->tif_diroff > (uint64)TIFF_INT64_MAX)
+ if (tif->tif_diroff > (uint64_t)INT64_MAX)
{
TIFFErrorExt(tif->tif_clientdata,module,"Can not read TIFF directory count");
return(0);
@@ -4870,22 +4870,22 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
* otherwise a very high offset may cause an OOB read and
* crash the client. Make two comparisons instead of
*
- * off + sizeof(uint16) > tif->tif_size
+ * off + sizeof(uint16_t) > tif->tif_size
*
* to avoid overflow.
*/
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- m=off+sizeof(uint16);
- if ((m<off)||(m<(tmsize_t)sizeof(uint16))||(m>tif->tif_size)) {
+ m=off+sizeof(uint16_t);
+ if ((m<off) || (m<(tmsize_t)sizeof(uint16_t)) || (m > tif->tif_size)) {
TIFFErrorExt(tif->tif_clientdata, module,
"Can not read TIFF directory count");
return 0;
} else {
_TIFFmemcpy(&dircount16, tif->tif_base + off,
- sizeof(uint16));
+ sizeof(uint16_t));
}
- off += sizeof (uint16);
+ off += sizeof (uint16_t);
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabShort(&dircount16);
if (dircount16>4096)
@@ -4898,17 +4898,17 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
}
else
{
- uint64 dircount64;
- m=off+sizeof(uint64);
- if ((m<off)||(m<(tmsize_t)sizeof(uint64))||(m>tif->tif_size)) {
+ uint64_t dircount64;
+ m=off+sizeof(uint64_t);
+ if ((m<off) || (m<(tmsize_t)sizeof(uint64_t)) || (m > tif->tif_size)) {
TIFFErrorExt(tif->tif_clientdata, module,
"Can not read TIFF directory count");
return 0;
} else {
_TIFFmemcpy(&dircount64, tif->tif_base + off,
- sizeof(uint64));
+ sizeof(uint64_t));
}
- off += sizeof (uint64);
+ off += sizeof (uint64_t);
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong8(&dircount64);
if (dircount64>4096)
@@ -4917,7 +4917,7 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
"Sanity check on directory count failed, this is probably not a valid IFD offset");
return 0;
}
- dircount16 = (uint16)dircount64;
+ dircount16 = (uint16_t)dircount64;
dirsize = 20;
}
if (dircount16 == 0 )
@@ -4945,25 +4945,25 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
off += dircount16 * dirsize;
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32 nextdiroff32;
- m=off+sizeof(uint32);
- if ((m<off)||(m<(tmsize_t)sizeof(uint32))||(m>tif->tif_size))
+ uint32_t nextdiroff32;
+ m=off+sizeof(uint32_t);
+ if ((m<off) || (m<(tmsize_t)sizeof(uint32_t)) || (m > tif->tif_size))
nextdiroff32 = 0;
else
_TIFFmemcpy(&nextdiroff32, tif->tif_base + off,
- sizeof (uint32));
+ sizeof (uint32_t));
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&nextdiroff32);
*nextdiroff = nextdiroff32;
}
else
{
- m=off+sizeof(uint64);
- if ((m<off)||(m<(tmsize_t)sizeof(uint64))||(m>tif->tif_size))
+ m=off+sizeof(uint64_t);
+ if ((m<off) || (m<(tmsize_t)sizeof(uint64_t)) || (m > tif->tif_size))
*nextdiroff = 0;
else
_TIFFmemcpy(nextdiroff, tif->tif_base + off,
- sizeof (uint64));
+ sizeof (uint64_t));
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8(nextdiroff);
}
@@ -4977,37 +4977,37 @@ TIFFFetchDirectory(TIFF* tif, uint64 diroff, TIFFDirEntry** pdir,
_TIFFfree(origdir);
return 0;
}
- ma=(uint8*)origdir;
+ ma=(uint8_t*)origdir;
mb=dir;
for (n=0; n<dircount16; n++)
{
mb->tdir_ignore = FALSE;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
- mb->tdir_tag=*(uint16*)ma;
- ma+=sizeof(uint16);
+ TIFFSwabShort((uint16_t*)ma);
+ mb->tdir_tag=*(uint16_t*)ma;
+ ma+=sizeof(uint16_t);
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)ma);
- mb->tdir_type=*(uint16*)ma;
- ma+=sizeof(uint16);
+ TIFFSwabShort((uint16_t*)ma);
+ mb->tdir_type=*(uint16_t*)ma;
+ ma+=sizeof(uint16_t);
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)ma);
- mb->tdir_count=(uint64)(*(uint32*)ma);
- ma+=sizeof(uint32);
+ TIFFSwabLong((uint32_t*)ma);
+ mb->tdir_count=(uint64_t)(*(uint32_t*)ma);
+ ma+=sizeof(uint32_t);
mb->tdir_offset.toff_long8=0;
- *(uint32*)(&mb->tdir_offset)=*(uint32*)ma;
- ma+=sizeof(uint32);
+ *(uint32_t*)(&mb->tdir_offset)=*(uint32_t*)ma;
+ ma+=sizeof(uint32_t);
}
else
{
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)ma);
+ TIFFSwabLong8((uint64_t*)ma);
mb->tdir_count=TIFFReadUInt64(ma);
- ma+=sizeof(uint64);
+ ma+=sizeof(uint64_t);
mb->tdir_offset.toff_long8=TIFFReadUInt64(ma);
- ma+=sizeof(uint64);
+ ma+=sizeof(uint64_t);
}
mb++;
}
@@ -5024,13 +5024,13 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
{
static const char module[] = "TIFFFetchNormalTag";
enum TIFFReadDirEntryErr err;
- uint32 fii;
+ uint32_t fii;
const TIFFField* fip = NULL;
TIFFReadDirectoryFindFieldInfo(tif,dp->tdir_tag,&fii);
if( fii == FAILED_FII )
{
TIFFErrorExt(tif->tif_clientdata, "TIFFFetchNormalTag",
- "No definition found for tag %d",
+ "No definition found for tag %"PRIu16,
dp->tdir_tag);
return 0;
}
@@ -5045,17 +5045,17 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_ASCII:
{
- uint8* data;
+ uint8_t* data;
assert(fip->field_passcount==0);
err=TIFFReadDirEntryByteArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
- uint32 mb = 0;
+ uint32_t mb = 0;
int n;
if (data != NULL)
{
- uint8* ma = data;
- while (mb<(uint32)dp->tdir_count)
+ uint8_t* ma = data;
+ while (mb<(uint32_t)dp->tdir_count)
{
if (*ma==0)
break;
@@ -5063,24 +5063,24 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
mb++;
}
}
- if (mb+1<(uint32)dp->tdir_count)
+ if (mb+1<(uint32_t)dp->tdir_count)
TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" contains null byte in value; value incorrectly truncated during reading due to implementation limitations",fip->field_name);
- else if (mb+1>(uint32)dp->tdir_count)
+ else if (mb+1>(uint32_t)dp->tdir_count)
{
- uint8* o;
+ uint8_t* o;
TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte",fip->field_name);
- if ((uint32)dp->tdir_count+1!=dp->tdir_count+1)
+ if ((uint32_t)dp->tdir_count + 1 != dp->tdir_count + 1)
o=NULL;
else
- o=_TIFFmalloc((uint32)dp->tdir_count+1);
+ o=_TIFFmalloc((uint32_t)dp->tdir_count + 1);
if (o==NULL)
{
if (data!=NULL)
_TIFFfree(data);
return(0);
}
- _TIFFmemcpy(o,data,(uint32)dp->tdir_count);
- o[(uint32)dp->tdir_count]=0;
+ _TIFFmemcpy(o,data,(uint32_t)dp->tdir_count);
+ o[(uint32_t)dp->tdir_count]=0;
if (data!=0)
_TIFFfree(data);
data=o;
@@ -5095,7 +5095,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_UINT8:
{
- uint8 data=0;
+ uint8_t data=0;
assert(fip->field_readcount==1);
assert(fip->field_passcount==0);
err=TIFFReadDirEntryByte(tif,dp,&data);
@@ -5108,7 +5108,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_UINT16:
{
- uint16 data;
+ uint16_t data;
assert(fip->field_readcount==1);
assert(fip->field_passcount==0);
err=TIFFReadDirEntryShort(tif,dp,&data);
@@ -5121,7 +5121,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_UINT32:
{
- uint32 data;
+ uint32_t data;
assert(fip->field_readcount==1);
assert(fip->field_passcount==0);
err=TIFFReadDirEntryLong(tif,dp,&data);
@@ -5134,7 +5134,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_UINT64:
{
- uint64 data;
+ uint64_t data;
assert(fip->field_readcount==1);
assert(fip->field_passcount==0);
err=TIFFReadDirEntryLong8(tif,dp,&data);
@@ -5173,7 +5173,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_IFD8:
{
- uint64 data;
+ uint64_t data;
assert(fip->field_readcount==1);
assert(fip->field_passcount==0);
err=TIFFReadDirEntryIfd8(tif,dp,&data);
@@ -5186,13 +5186,13 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_UINT16_PAIR:
{
- uint16* data;
+ uint16_t* data;
assert(fip->field_readcount==2);
assert(fip->field_passcount==0);
if (dp->tdir_count!=2) {
TIFFWarningExt(tif->tif_clientdata,module,
- "incorrect count for field \"%s\", expected 2, got %d",
- fip->field_name,(int)dp->tdir_count);
+ "incorrect count for field \"%s\", expected 2, got %"PRIu64,
+ fip->field_name, dp->tdir_count);
return(0);
}
err=TIFFReadDirEntryShortArray(tif,dp,&data);
@@ -5209,13 +5209,13 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C0_UINT8:
{
- uint8* data;
+ uint8_t* data;
assert(fip->field_readcount>=1);
assert(fip->field_passcount==0);
- if (dp->tdir_count!=(uint64)fip->field_readcount) {
+ if (dp->tdir_count!=(uint64_t)fip->field_readcount) {
TIFFWarningExt(tif->tif_clientdata,module,
- "incorrect count for field \"%s\", expected %d, got %d",
- fip->field_name,(int) fip->field_readcount, (int)dp->tdir_count);
+ "incorrect count for field \"%s\", expected %d, got %"PRIu64,
+ fip->field_name,(int) fip->field_readcount, dp->tdir_count);
return 0;
}
else
@@ -5235,10 +5235,10 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C0_UINT16:
{
- uint16* data;
+ uint16_t* data;
assert(fip->field_readcount>=1);
assert(fip->field_passcount==0);
- if (dp->tdir_count!=(uint64)fip->field_readcount)
+ if (dp->tdir_count!=(uint64_t)fip->field_readcount)
/* corrupt file */;
else
{
@@ -5257,10 +5257,10 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C0_UINT32:
{
- uint32* data;
+ uint32_t* data;
assert(fip->field_readcount>=1);
assert(fip->field_passcount==0);
- if (dp->tdir_count!=(uint64)fip->field_readcount)
+ if (dp->tdir_count!=(uint64_t)fip->field_readcount)
/* corrupt file */;
else
{
@@ -5282,7 +5282,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
float* data;
assert(fip->field_readcount>=1);
assert(fip->field_passcount==0);
- if (dp->tdir_count!=(uint64)fip->field_readcount)
+ if (dp->tdir_count!=(uint64_t)fip->field_readcount)
/* corrupt file */;
else
{
@@ -5305,7 +5305,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
double* data;
assert(fip->field_readcount>=1);
assert(fip->field_passcount==0);
- if (dp->tdir_count!=(uint64)fip->field_readcount)
+ if (dp->tdir_count!=(uint64_t)fip->field_readcount)
/* corrupt file */;
else
{
@@ -5324,7 +5324,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C16_ASCII:
{
- uint8* data;
+ uint8_t* data;
assert(fip->field_readcount==TIFF_VARIABLE);
assert(fip->field_passcount==1);
if (dp->tdir_count>0xFFFF)
@@ -5340,7 +5340,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
data[dp->tdir_count-1] = '\0';
}
- m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint16_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5351,7 +5351,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C16_UINT8:
{
- uint8* data;
+ uint8_t* data;
assert(fip->field_readcount==TIFF_VARIABLE);
assert(fip->field_passcount==1);
if (dp->tdir_count>0xFFFF)
@@ -5362,7 +5362,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint16_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5373,7 +5373,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C16_UINT16:
{
- uint16* data;
+ uint16_t* data;
assert(fip->field_readcount==TIFF_VARIABLE);
assert(fip->field_passcount==1);
if (dp->tdir_count>0xFFFF)
@@ -5384,7 +5384,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint16_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5395,7 +5395,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C16_UINT32:
{
- uint32* data;
+ uint32_t* data;
assert(fip->field_readcount==TIFF_VARIABLE);
assert(fip->field_passcount==1);
if (dp->tdir_count>0xFFFF)
@@ -5406,7 +5406,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint16_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5417,7 +5417,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C16_UINT64:
{
- uint64* data;
+ uint64_t* data;
assert(fip->field_readcount==TIFF_VARIABLE);
assert(fip->field_passcount==1);
if (dp->tdir_count>0xFFFF)
@@ -5428,7 +5428,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint16_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5450,7 +5450,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint16_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5472,7 +5472,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint16_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5483,7 +5483,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C16_IFD8:
{
- uint64* data;
+ uint64_t* data;
assert(fip->field_readcount==TIFF_VARIABLE);
assert(fip->field_passcount==1);
if (dp->tdir_count>0xFFFF)
@@ -5494,7 +5494,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint16)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint16_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5505,7 +5505,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_ASCII:
{
- uint8* data;
+ uint8_t* data;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntryByteArray(tif,dp,&data);
@@ -5517,7 +5517,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
TIFFWarningExt(tif->tif_clientdata,module,"ASCII value for tag \"%s\" does not end in null byte. Forcing it to be null",fip->field_name);
data[dp->tdir_count-1] = '\0';
}
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5527,14 +5527,14 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_UINT8:
{
- uint8* data;
+ uint8_t* data;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntryByteArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5544,14 +5544,14 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_SINT8:
{
- int8* data = NULL;
+ int8_t* data = NULL;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntrySbyteArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5561,14 +5561,14 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_UINT16:
{
- uint16* data;
+ uint16_t* data;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntryShortArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5578,14 +5578,14 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_SINT16:
{
- int16* data = NULL;
+ int16_t* data = NULL;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntrySshortArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5595,14 +5595,14 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_UINT32:
{
- uint32* data;
+ uint32_t* data;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntryLongArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5612,14 +5612,14 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_SINT32:
{
- int32* data = NULL;
+ int32_t* data = NULL;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntrySlongArray(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5629,14 +5629,14 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_UINT64:
{
- uint64* data;
+ uint64_t* data;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntryLong8Array(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5646,14 +5646,14 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_SINT64:
{
- int64* data = NULL;
+ int64_t* data = NULL;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntrySlong8Array(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5670,7 +5670,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5687,7 +5687,7 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5697,14 +5697,14 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
break;
case TIFF_SETGET_C32_IFD8:
{
- uint64* data;
+ uint64_t* data;
assert(fip->field_readcount==TIFF_VARIABLE2);
assert(fip->field_passcount==1);
err=TIFFReadDirEntryIfd8Array(tif,dp,&data);
if (err==TIFFReadDirEntryErrOk)
{
int m;
- m=TIFFSetField(tif,dp->tdir_tag,(uint32)(dp->tdir_count),data);
+ m=TIFFSetField(tif, dp->tdir_tag, (uint32_t)(dp->tdir_count), data);
if (data!=0)
_TIFFfree(data);
if (!m)
@@ -5729,11 +5729,11 @@ TIFFFetchNormalTag(TIFF* tif, TIFFDirEntry* dp, int recover)
* While this routine says "strips", in fact it's also used for tiles.
*/
static int
-TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp)
+TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32_t nstrips, uint64_t** lpp)
{
static const char module[] = "TIFFFetchStripThing";
enum TIFFReadDirEntryErr err;
- uint64* data;
+ uint64_t* data;
err=TIFFReadDirEntryLong8ArrayWithLimit(tif,dir,&data,nstrips);
if (err!=TIFFReadDirEntryErrOk)
{
@@ -5741,14 +5741,14 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp)
TIFFReadDirEntryOutputErr(tif,err,module,fip ? fip->field_name : "unknown tagname",0);
return(0);
}
- if (dir->tdir_count<(uint64)nstrips)
+ if (dir->tdir_count<(uint64_t)nstrips)
{
- uint64* resizeddata;
+ uint64_t* resizeddata;
const TIFFField* fip = TIFFFieldWithTag(tif,dir->tdir_tag);
const char* pszMax = getenv("LIBTIFF_STRILE_ARRAY_MAX_RESIZE_COUNT");
- uint32 max_nstrips = 1000000;
+ uint32_t max_nstrips = 1000000;
if( pszMax )
- max_nstrips = (uint32) atoi(pszMax);
+ max_nstrips = (uint32_t) atoi(pszMax);
TIFFReadDirEntryOutputErr(tif,TIFFReadDirEntryErrCount,
module,
fip ? fip->field_name : "unknown tagname",
@@ -5760,13 +5760,13 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir, uint32 nstrips, uint64** lpp)
return(0);
}
- resizeddata=(uint64*)_TIFFCheckMalloc(tif,nstrips,sizeof(uint64),"for strip array");
+ resizeddata=(uint64_t*)_TIFFCheckMalloc(tif, nstrips, sizeof(uint64_t), "for strip array");
if (resizeddata==0) {
_TIFFfree(data);
return(0);
}
- _TIFFmemcpy(resizeddata,data,(uint32)dir->tdir_count*sizeof(uint64));
- _TIFFmemset(resizeddata+(uint32)dir->tdir_count,0,(nstrips-(uint32)dir->tdir_count)*sizeof(uint64));
+ _TIFFmemcpy(resizeddata,data, (uint32_t)dir->tdir_count * sizeof(uint64_t));
+ _TIFFmemset(resizeddata+(uint32_t)dir->tdir_count, 0, (nstrips - (uint32_t)dir->tdir_count) * sizeof(uint64_t));
_TIFFfree(data);
data=resizeddata;
}
@@ -5785,8 +5785,8 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
UInt64Aligned_t m;
m.l=0;
assert(sizeof(double)==8);
- assert(sizeof(uint64)==8);
- assert(sizeof(uint32)==4);
+ assert(sizeof(uint64_t) == 8);
+ assert(sizeof(uint32_t) == 4);
if (dir->tdir_count!=1)
err=TIFFReadDirEntryErrCount;
else if (dir->tdir_type!=TIFF_RATIONAL)
@@ -5795,8 +5795,8 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
{
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32 offset;
- offset=*(uint32*)(&dir->tdir_offset);
+ uint32_t offset;
+ offset=*(uint32_t*)(&dir->tdir_offset);
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&offset);
err=TIFFReadDirEntryData(tif,offset,8,m.i);
@@ -5832,32 +5832,32 @@ TIFFFetchSubjectDistance(TIFF* tif, TIFFDirEntry* dir)
}
}
-static void allocChoppedUpStripArrays(TIFF* tif, uint32 nstrips,
- uint64 stripbytes, uint32 rowsperstrip)
+static void allocChoppedUpStripArrays(TIFF* tif, uint32_t nstrips,
+ uint64_t stripbytes, uint32_t rowsperstrip)
{
TIFFDirectory *td = &tif->tif_dir;
- uint64 bytecount;
- uint64 offset;
- uint64 last_offset;
- uint64 last_bytecount;
- uint32 i;
- uint64 *newcounts;
- uint64 *newoffsets;
+ uint64_t bytecount;
+ uint64_t offset;
+ uint64_t last_offset;
+ uint64_t last_bytecount;
+ uint32_t i;
+ uint64_t *newcounts;
+ uint64_t *newoffsets;
offset = TIFFGetStrileOffset(tif, 0);
last_offset = TIFFGetStrileOffset(tif, td->td_nstrips-1);
last_bytecount = TIFFGetStrileByteCount(tif, td->td_nstrips-1);
- if( last_offset > TIFF_UINT64_MAX - last_bytecount ||
+ if( last_offset > UINT64_MAX - last_bytecount ||
last_offset + last_bytecount < offset )
{
return;
}
bytecount = last_offset + last_bytecount - offset;
- newcounts = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
- "for chopped \"StripByteCounts\" array");
- newoffsets = (uint64*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64),
- "for chopped \"StripOffsets\" array");
+ newcounts = (uint64_t*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64_t),
+ "for chopped \"StripByteCounts\" array");
+ newoffsets = (uint64_t*) _TIFFCheckMalloc(tif, nstrips, sizeof (uint64_t),
+ "for chopped \"StripOffsets\" array");
if (newcounts == NULL || newoffsets == NULL) {
/*
* Unable to allocate new strip information, give up and use
@@ -5911,13 +5911,13 @@ static void
ChopUpSingleUncompressedStrip(TIFF* tif)
{
register TIFFDirectory *td = &tif->tif_dir;
- uint64 bytecount;
- uint64 offset;
- uint32 rowblock;
- uint64 rowblockbytes;
- uint64 stripbytes;
- uint32 nstrips;
- uint32 rowsperstrip;
+ uint64_t bytecount;
+ uint64_t offset;
+ uint32_t rowblock;
+ uint64_t rowblockbytes;
+ uint64_t stripbytes;
+ uint32_t nstrips;
+ uint32_t rowsperstrip;
bytecount = TIFFGetStrileByteCount(tif, 0);
/* On a newly created file, just re-opened to be filled, we */
@@ -5941,8 +5941,8 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
stripbytes = rowblockbytes;
rowsperstrip = rowblock;
} else if (rowblockbytes > 0 ) {
- uint32 rowblocksperstrip;
- rowblocksperstrip = (uint32) (STRIP_SIZE_DEFAULT / rowblockbytes);
+ uint32_t rowblocksperstrip;
+ rowblocksperstrip = (uint32_t) (STRIP_SIZE_DEFAULT / rowblockbytes);
rowsperstrip = rowblocksperstrip * rowblock;
stripbytes = rowblocksperstrip * rowblockbytes;
}
@@ -5981,14 +5981,14 @@ ChopUpSingleUncompressedStrip(TIFF* tif)
static void TryChopUpUncompressedBigTiff( TIFF* tif )
{
TIFFDirectory *td = &tif->tif_dir;
- uint32 rowblock;
- uint64 rowblockbytes;
- uint32 i;
- uint64 stripsize;
- uint32 rowblocksperstrip;
- uint32 rowsperstrip;
- uint64 stripbytes;
- uint32 nstrips;
+ uint32_t rowblock;
+ uint64_t rowblockbytes;
+ uint32_t i;
+ uint64_t stripsize;
+ uint32_t rowblocksperstrip;
+ uint32_t rowsperstrip;
+ uint64_t stripbytes;
+ uint32_t nstrips;
stripsize = TIFFStripSize64(tif);
@@ -6041,7 +6041,7 @@ static void TryChopUpUncompressedBigTiff( TIFF* tif )
}
/* Aim for 512 MB strips (that will still be manageable by 32 bit builds */
- rowblocksperstrip = (uint32) (512 * 1024 * 1024 / rowblockbytes);
+ rowblocksperstrip = (uint32_t) (512 * 1024 * 1024 / rowblockbytes);
if( rowblocksperstrip == 0 )
rowblocksperstrip = 1;
rowsperstrip = rowblocksperstrip * rowblock;
@@ -6057,9 +6057,9 @@ static void TryChopUpUncompressedBigTiff( TIFF* tif )
if( tif->tif_mode == O_RDONLY &&
nstrips > 1000000 )
{
- uint64 last_offset = TIFFGetStrileOffset(tif, td->td_nstrips-1);
- uint64 filesize = TIFFGetFileSize(tif);
- uint64 last_bytecount = TIFFGetStrileByteCount(tif, td->td_nstrips-1);
+ uint64_t last_offset = TIFFGetStrileOffset(tif, td->td_nstrips - 1);
+ uint64_t filesize = TIFFGetFileSize(tif);
+ uint64_t last_bytecount = TIFFGetStrileByteCount(tif, td->td_nstrips - 1);
if( last_offset > filesize ||
last_bytecount > filesize - last_offset )
{
@@ -6072,7 +6072,7 @@ static void TryChopUpUncompressedBigTiff( TIFF* tif )
TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
-static uint64 _TIFFUnsanitizedAddUInt64AndInt(uint64 a, int b)
+static uint64_t _TIFFUnsanitizedAddUInt64AndInt(uint64_t a, int b)
{
return a + b;
}
@@ -6082,8 +6082,8 @@ static uint64 _TIFFUnsanitizedAddUInt64AndInt(uint64 a, int b)
* 4096 byte page size.
*/
static
-int _TIFFPartialReadStripArray( TIFF* tif, TIFFDirEntry* dirent,
- int strile, uint64* panVals )
+int _TIFFPartialReadStripArray(TIFF* tif, TIFFDirEntry* dirent,
+ int strile, uint64_t* panVals )
{
static const char module[] = "_TIFFPartialReadStripArray";
#define IO_CACHE_PAGE_SIZE 4096
@@ -6091,37 +6091,37 @@ int _TIFFPartialReadStripArray( TIFF* tif, TIFFDirEntry* dirent,
size_t sizeofval;
const int bSwab = (tif->tif_flags & TIFF_SWAB) != 0;
int sizeofvalint;
- uint64 nBaseOffset;
- uint64 nOffset;
- uint64 nOffsetStartPage;
- uint64 nOffsetEndPage;
+ uint64_t nBaseOffset;
+ uint64_t nOffset;
+ uint64_t nOffsetStartPage;
+ uint64_t nOffsetEndPage;
tmsize_t nToRead;
tmsize_t nRead;
- uint64 nLastStripOffset;
+ uint64_t nLastStripOffset;
int iStartBefore;
int i;
- const uint32 arraySize = tif->tif_dir.td_stripoffsetbyteallocsize;
+ const uint32_t arraySize = tif->tif_dir.td_stripoffsetbyteallocsize;
unsigned char buffer[2 * IO_CACHE_PAGE_SIZE];
assert( dirent->tdir_count > 4 );
if( dirent->tdir_type == TIFF_SHORT )
{
- sizeofval = sizeof(uint16);
+ sizeofval = sizeof(uint16_t);
}
else if( dirent->tdir_type == TIFF_LONG )
{
- sizeofval = sizeof(uint32);
+ sizeofval = sizeof(uint32_t);
}
else if( dirent->tdir_type == TIFF_LONG8 )
{
- sizeofval = sizeof(uint64);
+ sizeofval = sizeof(uint64_t);
}
else if( dirent->tdir_type == TIFF_SLONG8 )
{
/* Non conformant but used by some images as in */
/* https://github.com/OSGeo/gdal/issues/2165 */
- sizeofval = sizeof(int64);
+ sizeofval = sizeof(int64_t);
}
else
{
@@ -6134,20 +6134,20 @@ int _TIFFPartialReadStripArray( TIFF* tif, TIFFDirEntry* dirent,
if( tif->tif_flags&TIFF_BIGTIFF )
{
- uint64 offset = dirent->tdir_offset.toff_long8;
+ uint64_t offset = dirent->tdir_offset.toff_long8;
if( bSwab )
TIFFSwabLong8(&offset);
nBaseOffset = offset;
}
else
{
- uint32 offset = dirent->tdir_offset.toff_long;
+ uint32_t offset = dirent->tdir_offset.toff_long;
if( bSwab )
TIFFSwabLong(&offset);
nBaseOffset = offset;
}
/* To avoid later unsigned integer overflows */
- if( nBaseOffset > (uint64)TIFF_INT64_MAX )
+ if( nBaseOffset > (uint64_t)INT64_MAX )
{
TIFFErrorExt(tif->tif_clientdata, module,
"Cannot read offset/size for strile %d", strile);
@@ -6191,13 +6191,13 @@ int _TIFFPartialReadStripArray( TIFF* tif, TIFFDirEntry* dirent,
if( strile + iStartBefore < 0 )
iStartBefore = -strile;
for( i = iStartBefore;
- (uint32)(strile + i) < arraySize &&
+ (uint32_t)(strile + i) < arraySize &&
_TIFFUnsanitizedAddUInt64AndInt(nOffset, (i + 1) * sizeofvalint) <= nOffsetEndPage;
++i )
{
if( dirent->tdir_type == TIFF_SHORT )
{
- uint16 val;
+ uint16_t val;
memcpy(&val,
buffer + (nOffset - nOffsetStartPage) + i * sizeofvalint,
sizeof(val));
@@ -6207,7 +6207,7 @@ int _TIFFPartialReadStripArray( TIFF* tif, TIFFDirEntry* dirent,
}
else if( dirent->tdir_type == TIFF_LONG )
{
- uint32 val;
+ uint32_t val;
memcpy(&val,
buffer + (nOffset - nOffsetStartPage) + i * sizeofvalint,
sizeof(val));
@@ -6217,7 +6217,7 @@ int _TIFFPartialReadStripArray( TIFF* tif, TIFFDirEntry* dirent,
}
else if( dirent->tdir_type == TIFF_LONG8 )
{
- uint64 val;
+ uint64_t val;
memcpy(&val,
buffer + (nOffset - nOffsetStartPage) + i * sizeofvalint,
sizeof(val));
@@ -6228,22 +6228,22 @@ int _TIFFPartialReadStripArray( TIFF* tif, TIFFDirEntry* dirent,
else /* if( dirent->tdir_type == TIFF_SLONG8 ) */
{
/* Non conformant data type */
- int64 val;
+ int64_t val;
memcpy(&val,
buffer + (nOffset - nOffsetStartPage) + i * sizeofvalint,
sizeof(val));
if( bSwab )
- TIFFSwabLong8((uint64*) &val);
- panVals[strile + i] = (uint64) val;
+ TIFFSwabLong8((uint64_t*) &val);
+ panVals[strile + i] = (uint64_t) val;
}
}
return 1;
}
static int _TIFFFetchStrileValue(TIFF* tif,
- uint32 strile,
+ uint32_t strile,
TIFFDirEntry* dirent,
- uint64** parray)
+ uint64_t** parray)
{
static const char module[] = "_TIFFFetchStrileValue";
TIFFDirectory *td = &tif->tif_dir;
@@ -6253,20 +6253,20 @@ static int _TIFFFetchStrileValue(TIFF* tif,
}
if( strile >= td->td_stripoffsetbyteallocsize )
{
- uint32 nStripArrayAllocBefore = td->td_stripoffsetbyteallocsize;
- uint32 nStripArrayAllocNew;
- uint64 nArraySize64;
+ uint32_t nStripArrayAllocBefore = td->td_stripoffsetbyteallocsize;
+ uint32_t nStripArrayAllocNew;
+ uint64_t nArraySize64;
size_t nArraySize;
- uint64* offsetArray;
- uint64* bytecountArray;
+ uint64_t* offsetArray;
+ uint64_t* bytecountArray;
if( strile > 1000000 )
{
- uint64 filesize = TIFFGetFileSize(tif);
+ uint64_t filesize = TIFFGetFileSize(tif);
/* Avoid excessive memory allocation attempt */
/* For such a big blockid we need at least a TIFF_LONG per strile */
/* for the offset array. */
- if( strile > filesize / sizeof(uint32) )
+ if( strile > filesize / sizeof(uint32_t) )
{
TIFFErrorExt(tif->tif_clientdata, module, "File too short");
return 0;
@@ -6288,7 +6288,7 @@ static int _TIFFFetchStrileValue(TIFF* tif,
nStripArrayAllocNew = TIFF_MIN(nStripArrayAllocNew, td->td_nstrips);
}
assert( strile < nStripArrayAllocNew );
- nArraySize64 = (uint64)sizeof(uint64) * nStripArrayAllocNew;
+ nArraySize64 = (uint64_t)sizeof(uint64_t) * nStripArrayAllocNew;
nArraySize = (size_t)(nArraySize64);
#if SIZEOF_SIZE_T == 4
if( nArraySize != nArraySize64 )
@@ -6298,9 +6298,9 @@ static int _TIFFFetchStrileValue(TIFF* tif,
return 0;
}
#endif
- offsetArray = (uint64*)(
+ offsetArray = (uint64_t*)(
_TIFFrealloc( td->td_stripoffset_p, nArraySize ) );
- bytecountArray = (uint64*)(
+ bytecountArray = (uint64_t*)(
_TIFFrealloc( td->td_stripbytecount_p, nArraySize ) );
if( offsetArray )
td->td_stripoffset_p = offsetArray;
@@ -6312,10 +6312,10 @@ static int _TIFFFetchStrileValue(TIFF* tif,
/* Initialize new entries to ~0 / -1 */
memset(td->td_stripoffset_p + nStripArrayAllocBefore,
0xFF,
- (td->td_stripoffsetbyteallocsize - nStripArrayAllocBefore) * sizeof(uint64) );
+ (td->td_stripoffsetbyteallocsize - nStripArrayAllocBefore) * sizeof(uint64_t) );
memset(td->td_stripbytecount_p + nStripArrayAllocBefore,
0xFF,
- (td->td_stripoffsetbyteallocsize - nStripArrayAllocBefore) * sizeof(uint64) );
+ (td->td_stripoffsetbyteallocsize - nStripArrayAllocBefore) * sizeof(uint64_t) );
}
else
{
@@ -6343,10 +6343,10 @@ static int _TIFFFetchStrileValue(TIFF* tif,
return 1;
}
-static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile,
- TIFFDirEntry* dirent,
- uint64** parray,
- int *pbErr)
+static uint64_t _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32_t strile,
+ TIFFDirEntry* dirent,
+ uint64_t** parray,
+ int *pbErr)
{
TIFFDirectory *td = &tif->tif_dir;
if( pbErr )
@@ -6387,13 +6387,13 @@ static uint64 _TIFFGetStrileOffsetOrByteCountValue(TIFF *tif, uint32 strile,
}
/* Return the value of the TileOffsets/StripOffsets array for the specified tile/strile */
-uint64 TIFFGetStrileOffset(TIFF *tif, uint32 strile)
+uint64_t TIFFGetStrileOffset(TIFF *tif, uint32_t strile)
{
return TIFFGetStrileOffsetWithErr(tif, strile, NULL);
}
/* Return the value of the TileOffsets/StripOffsets array for the specified tile/strile */
-uint64 TIFFGetStrileOffsetWithErr(TIFF *tif, uint32 strile, int *pbErr)
+uint64_t TIFFGetStrileOffsetWithErr(TIFF *tif, uint32_t strile, int *pbErr)
{
TIFFDirectory *td = &tif->tif_dir;
return _TIFFGetStrileOffsetOrByteCountValue(tif, strile,
@@ -6402,13 +6402,13 @@ uint64 TIFFGetStrileOffsetWithErr(TIFF *tif, uint32 strile, int *pbErr)
}
/* Return the value of the TileByteCounts/StripByteCounts array for the specified tile/strile */
-uint64 TIFFGetStrileByteCount(TIFF *tif, uint32 strile)
+uint64_t TIFFGetStrileByteCount(TIFF *tif, uint32_t strile)
{
return TIFFGetStrileByteCountWithErr(tif, strile, NULL);
}
/* Return the value of the TileByteCounts/StripByteCounts array for the specified tile/strile */
-uint64 TIFFGetStrileByteCountWithErr(TIFF *tif, uint32 strile, int *pbErr)
+uint64_t TIFFGetStrileByteCountWithErr(TIFF *tif, uint32_t strile, int *pbErr)
{
TIFFDirectory *td = &tif->tif_dir;
return _TIFFGetStrileOffsetOrByteCountValue(tif, strile,
@@ -6468,7 +6468,7 @@ static int _TIFFFillStrilesInternal( TIFF *tif, int loadStripByteCount )
#ifdef STRIPBYTECOUNTSORTED_UNUSED
if (tif->tif_dir.td_nstrips > 1 && return_value == 1 ) {
- uint32 strip;
+ uint32_t strip;
tif->tif_dir.td_stripbytecountsorted = 1;
for (strip = 1; strip < tif->tif_dir.td_nstrips; strip++) {
diff --git a/tiff/libtiff/tif_dirwrite.c b/tiff/libtiff/tif_dirwrite.c
index f481250e..12d67be6 100644
--- a/tiff/libtiff/tif_dirwrite.c
+++ b/tiff/libtiff/tif_dirwrite.c
@@ -35,152 +35,152 @@
#define TIFFCvtNativeToIEEEFloat(tif, n, fp)
#define TIFFCvtNativeToIEEEDouble(tif, n, dp)
#else
-extern void TIFFCvtNativeToIEEEFloat(TIFF* tif, uint32 n, float* fp);
-extern void TIFFCvtNativeToIEEEDouble(TIFF* tif, uint32 n, double* dp);
+extern void TIFFCvtNativeToIEEEFloat(TIFF* tif, uint32_t n, float* fp);
+extern void TIFFCvtNativeToIEEEDouble(TIFF* tif, uint32_t n, double* dp);
#endif
-static int TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff);
+static int TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64_t* pdiroff);
-static int TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value);
+static int TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value);
#if 0
-static int TIFFWriteDirectoryTagSampleformatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value);
+static int TIFFWriteDirectoryTagSampleformatPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value);
#endif
-static int TIFFWriteDirectoryTagAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, char* value);
-static int TIFFWriteDirectoryTagUndefinedArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value);
+static int TIFFWriteDirectoryTagAscii(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, char* value);
+static int TIFFWriteDirectoryTagUndefinedArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint8_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagByte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value);
+static int TIFFWriteDirectoryTagByte(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint8_t value);
#endif
-static int TIFFWriteDirectoryTagByteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value);
+static int TIFFWriteDirectoryTagByteArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint8_t* value);
#if 0
-static int TIFFWriteDirectoryTagBytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value);
+static int TIFFWriteDirectoryTagBytePerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint8_t value);
#endif
#ifdef notdef
-static int TIFFWriteDirectoryTagSbyte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value);
+static int TIFFWriteDirectoryTagSbyte(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int8_t value);
#endif
-static int TIFFWriteDirectoryTagSbyteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int8* value);
+static int TIFFWriteDirectoryTagSbyteArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int8_t* value);
#if 0
-static int TIFFWriteDirectoryTagSbytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value);
+static int TIFFWriteDirectoryTagSbytePerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int8_t value);
#endif
-static int TIFFWriteDirectoryTagShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value);
-static int TIFFWriteDirectoryTagShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint16* value);
-static int TIFFWriteDirectoryTagShortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value);
+static int TIFFWriteDirectoryTagShort(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint16_t value);
+static int TIFFWriteDirectoryTagShortArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint16_t* value);
+static int TIFFWriteDirectoryTagShortPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint16_t value);
#ifdef notdef
-static int TIFFWriteDirectoryTagSshort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value);
+static int TIFFWriteDirectoryTagSshort(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int16_t value);
#endif
-static int TIFFWriteDirectoryTagSshortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int16* value);
+static int TIFFWriteDirectoryTagSshortArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int16_t* value);
#if 0
-static int TIFFWriteDirectoryTagSshortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value);
+static int TIFFWriteDirectoryTagSshortPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int16_t value);
#endif
-static int TIFFWriteDirectoryTagLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value);
-static int TIFFWriteDirectoryTagLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value);
+static int TIFFWriteDirectoryTagLong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t value);
+static int TIFFWriteDirectoryTagLongArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint32_t* value);
#if 0
-static int TIFFWriteDirectoryTagLongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value);
+static int TIFFWriteDirectoryTagLongPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t value);
#endif
#ifdef notdef
-static int TIFFWriteDirectoryTagSlong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value);
+static int TIFFWriteDirectoryTagSlong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int32_t value);
#endif
-static int TIFFWriteDirectoryTagSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value);
+static int TIFFWriteDirectoryTagSlongArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int32_t* value);
#if 0
-static int TIFFWriteDirectoryTagSlongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value);
+static int TIFFWriteDirectoryTagSlongPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int32_t value);
#endif
#ifdef notdef
-static int TIFFWriteDirectoryTagLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint64 value);
+static int TIFFWriteDirectoryTagLong8(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint64_t value);
#endif
-static int TIFFWriteDirectoryTagLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value);
+static int TIFFWriteDirectoryTagLong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int64 value);
+static int TIFFWriteDirectoryTagSlong8(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int64_t value);
#endif
-static int TIFFWriteDirectoryTagSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int64* value);
-static int TIFFWriteDirectoryTagRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value);
-static int TIFFWriteDirectoryTagRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value);
-static int TIFFWriteDirectoryTagSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value);
+static int TIFFWriteDirectoryTagSlong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int64_t* value);
+static int TIFFWriteDirectoryTagRational(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value);
+static int TIFFWriteDirectoryTagRationalArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value);
+static int TIFFWriteDirectoryTagSrationalArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value);
+static int TIFFWriteDirectoryTagFloat(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, float value);
#endif
-static int TIFFWriteDirectoryTagFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value);
+static int TIFFWriteDirectoryTagFloatArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value);
#if 0
-static int TIFFWriteDirectoryTagFloatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value);
+static int TIFFWriteDirectoryTagFloatPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, float value);
#endif
#ifdef notdef
-static int TIFFWriteDirectoryTagDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value);
+static int TIFFWriteDirectoryTagDouble(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value);
#endif
-static int TIFFWriteDirectoryTagDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value);
+static int TIFFWriteDirectoryTagDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value);
#if 0
-static int TIFFWriteDirectoryTagDoublePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value);
+static int TIFFWriteDirectoryTagDoublePerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value);
#endif
-static int TIFFWriteDirectoryTagIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value);
+static int TIFFWriteDirectoryTagIfdArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint32_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value);
+static int TIFFWriteDirectoryTagIfd8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value);
#endif
-static int TIFFWriteDirectoryTagShortLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value);
-static int TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value);
-static int TIFFWriteDirectoryTagIfdIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value);
+static int TIFFWriteDirectoryTagShortLong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t value);
+static int TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value);
+static int TIFFWriteDirectoryTagIfdIfd8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagShortLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value);
+static int TIFFWriteDirectoryTagShortLongLong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value);
#endif
-static int TIFFWriteDirectoryTagColormap(TIFF* tif, uint32* ndir, TIFFDirEntry* dir);
-static int TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir);
-static int TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32* ndir, TIFFDirEntry* dir);
+static int TIFFWriteDirectoryTagColormap(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir);
+static int TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir);
+static int TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir);
-static int TIFFWriteDirectoryTagCheckedAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, char* value);
-static int TIFFWriteDirectoryTagCheckedUndefinedArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value);
+static int TIFFWriteDirectoryTagCheckedAscii(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, char* value);
+static int TIFFWriteDirectoryTagCheckedUndefinedArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint8_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagCheckedByte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value);
+static int TIFFWriteDirectoryTagCheckedByte(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint8_t value);
#endif
-static int TIFFWriteDirectoryTagCheckedByteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value);
+static int TIFFWriteDirectoryTagCheckedByteArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint8_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagCheckedSbyte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value);
+static int TIFFWriteDirectoryTagCheckedSbyte(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int8_t value);
#endif
-static int TIFFWriteDirectoryTagCheckedSbyteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int8* value);
-static int TIFFWriteDirectoryTagCheckedShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value);
-static int TIFFWriteDirectoryTagCheckedShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint16* value);
+static int TIFFWriteDirectoryTagCheckedSbyteArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int8_t* value);
+static int TIFFWriteDirectoryTagCheckedShort(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint16_t value);
+static int TIFFWriteDirectoryTagCheckedShortArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint16_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagCheckedSshort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value);
+static int TIFFWriteDirectoryTagCheckedSshort(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int16_t value);
#endif
-static int TIFFWriteDirectoryTagCheckedSshortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int16* value);
-static int TIFFWriteDirectoryTagCheckedLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value);
-static int TIFFWriteDirectoryTagCheckedLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value);
+static int TIFFWriteDirectoryTagCheckedSshortArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int16_t* value);
+static int TIFFWriteDirectoryTagCheckedLong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t value);
+static int TIFFWriteDirectoryTagCheckedLongArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint32_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagCheckedSlong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value);
+static int TIFFWriteDirectoryTagCheckedSlong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int32_t value);
#endif
-static int TIFFWriteDirectoryTagCheckedSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value);
+static int TIFFWriteDirectoryTagCheckedSlongArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int32_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagCheckedLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint64 value);
+static int TIFFWriteDirectoryTagCheckedLong8(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint64_t value);
#endif
-static int TIFFWriteDirectoryTagCheckedLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value);
+static int TIFFWriteDirectoryTagCheckedLong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagCheckedSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int64 value);
+static int TIFFWriteDirectoryTagCheckedSlong8(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int64_t value);
#endif
-static int TIFFWriteDirectoryTagCheckedSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int64* value);
-static int TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value);
-static int TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value);
-static int TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value);
+static int TIFFWriteDirectoryTagCheckedSlong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int64_t* value);
+static int TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value);
+static int TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value);
+static int TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value);
/*--: Rational2Double: New functions to support true double-precision for custom rational tag types. */
-static int TIFFWriteDirectoryTagRationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value);
-static int TIFFWriteDirectoryTagSrationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value);
-static int TIFFWriteDirectoryTagCheckedRationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value);
-static int TIFFWriteDirectoryTagCheckedSrationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value);
-static void DoubleToRational(double value, uint32 *num, uint32 *denom);
-static void DoubleToSrational(double value, int32 *num, int32 *denom);
+static int TIFFWriteDirectoryTagRationalDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value);
+static int TIFFWriteDirectoryTagSrationalDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value);
+static int TIFFWriteDirectoryTagCheckedRationalDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value);
+static int TIFFWriteDirectoryTagCheckedSrationalDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value);
+static void DoubleToRational(double value, uint32_t *num, uint32_t *denom);
+static void DoubleToSrational(double value, int32_t *num, int32_t *denom);
#if 0
static void DoubleToRational_direct(double value, unsigned long *num, unsigned long *denom);
static void DoubleToSrational_direct(double value, long *num, long *denom);
#endif
#ifdef notdef
-static int TIFFWriteDirectoryTagCheckedFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value);
+static int TIFFWriteDirectoryTagCheckedFloat(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, float value);
#endif
-static int TIFFWriteDirectoryTagCheckedFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value);
+static int TIFFWriteDirectoryTagCheckedFloatArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value);
#ifdef notdef
-static int TIFFWriteDirectoryTagCheckedDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value);
+static int TIFFWriteDirectoryTagCheckedDouble(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value);
#endif
-static int TIFFWriteDirectoryTagCheckedDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value);
-static int TIFFWriteDirectoryTagCheckedIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value);
-static int TIFFWriteDirectoryTagCheckedIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value);
+static int TIFFWriteDirectoryTagCheckedDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value);
+static int TIFFWriteDirectoryTagCheckedIfdArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint32_t* value);
+static int TIFFWriteDirectoryTagCheckedIfd8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value);
-static int TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 datatype, uint32 count, uint32 datalength, void* data);
+static int TIFFWriteDirectoryTagData(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint16_t datatype, uint32_t count, uint32_t datalength, void* data);
static int TIFFLinkDirectory(TIFF*);
@@ -260,7 +260,7 @@ TIFFCheckpointDirectory(TIFF* tif)
}
int
-TIFFWriteCustomDirectory(TIFF* tif, uint64* pdiroff)
+TIFFWriteCustomDirectory(TIFF* tif, uint64_t* pdiroff)
{
return TIFFWriteDirectorySec(tif,FALSE,FALSE,pdiroff);
}
@@ -302,11 +302,11 @@ TIFFRewriteDirectory( TIFF *tif )
}
else
{
- uint32 nextdir;
+ uint32_t nextdir;
nextdir = tif->tif_header.classic.tiff_diroff;
while(1) {
- uint16 dircount;
- uint32 nextnextdir;
+ uint16_t dircount;
+ uint32_t nextnextdir;
if (!SeekOK(tif, nextdir) ||
!ReadOK(tif, &dircount, 2)) {
@@ -327,7 +327,7 @@ TIFFRewriteDirectory( TIFF *tif )
TIFFSwabLong(&nextnextdir);
if (nextnextdir==tif->tif_diroff)
{
- uint32 m;
+ uint32_t m;
m=0;
(void) TIFFSeekFile(tif,
nextdir+2+dircount*12, SEEK_SET);
@@ -360,12 +360,12 @@ TIFFRewriteDirectory( TIFF *tif )
}
else
{
- uint64 nextdir;
+ uint64_t nextdir;
nextdir = tif->tif_header.big.tiff_diroff;
while(1) {
- uint64 dircount64;
- uint16 dircount;
- uint64 nextnextdir;
+ uint64_t dircount64;
+ uint16_t dircount;
+ uint64_t nextnextdir;
if (!SeekOK(tif, nextdir) ||
!ReadOK(tif, &dircount64, 8)) {
@@ -381,7 +381,7 @@ TIFFRewriteDirectory( TIFF *tif )
"Sanity check on tag count failed, likely corrupt TIFF");
return (0);
}
- dircount=(uint16)dircount64;
+ dircount=(uint16_t)dircount64;
(void) TIFFSeekFile(tif,
nextdir+8+dircount*20, SEEK_SET);
if (!ReadOK(tif, &nextnextdir, 8)) {
@@ -393,7 +393,7 @@ TIFFRewriteDirectory( TIFF *tif )
TIFFSwabLong8(&nextnextdir);
if (nextnextdir==tif->tif_diroff)
{
- uint64 m;
+ uint64_t m;
m=0;
(void) TIFFSeekFile(tif,
nextdir+8+dircount*20, SEEK_SET);
@@ -418,14 +418,14 @@ TIFFRewriteDirectory( TIFF *tif )
}
static int
-TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
+TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64_t* pdiroff)
{
static const char module[] = "TIFFWriteDirectorySec";
- uint32 ndir;
+ uint32_t ndir;
TIFFDirEntry* dir;
- uint32 dirsize;
+ uint32_t dirsize;
void* dirmem;
- uint32 m;
+ uint32_t m;
if (tif->tif_mode == O_RDONLY)
return (1);
@@ -630,8 +630,8 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
{
if (tif->tif_dir.td_extrasamples)
{
- uint16 na;
- uint16* nb;
+ uint16_t na;
+ uint16_t* nb;
TIFFGetFieldDefaulted(tif,TIFFTAG_EXTRASAMPLES,&na,&nb);
if (!TIFFWriteDirectoryTagShortArray(tif,&ndir,dir,TIFFTAG_EXTRASAMPLES,na,nb))
goto bad;
@@ -698,7 +698,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
goto bad;
}
{
- uint32 n;
+ uint32_t n;
for (n=0; n<tif->tif_nfields; n++) {
const TIFFField* o;
o = tif->tif_fields[n];
@@ -708,54 +708,54 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
{
case TIFF_SETGET_ASCII:
{
- uint32 pa;
+ uint32_t pa;
char* pb;
assert(o->field_type==TIFF_ASCII);
assert(o->field_readcount==TIFF_VARIABLE);
assert(o->field_passcount==0);
TIFFGetField(tif,o->field_tag,&pb);
- pa=(uint32)(strlen(pb));
- if (!TIFFWriteDirectoryTagAscii(tif,&ndir,dir,(uint16)o->field_tag,pa,pb))
+ pa=(uint32_t)(strlen(pb));
+ if (!TIFFWriteDirectoryTagAscii(tif, &ndir, dir, (uint16_t)o->field_tag, pa, pb))
goto bad;
}
break;
case TIFF_SETGET_UINT16:
{
- uint16 p;
+ uint16_t p;
assert(o->field_type==TIFF_SHORT);
assert(o->field_readcount==1);
assert(o->field_passcount==0);
TIFFGetField(tif,o->field_tag,&p);
- if (!TIFFWriteDirectoryTagShort(tif,&ndir,dir,(uint16)o->field_tag,p))
+ if (!TIFFWriteDirectoryTagShort(tif, &ndir, dir, (uint16_t)o->field_tag, p))
goto bad;
}
break;
case TIFF_SETGET_UINT32:
{
- uint32 p;
+ uint32_t p;
assert(o->field_type==TIFF_LONG);
assert(o->field_readcount==1);
assert(o->field_passcount==0);
TIFFGetField(tif,o->field_tag,&p);
- if (!TIFFWriteDirectoryTagLong(tif,&ndir,dir,(uint16)o->field_tag,p))
+ if (!TIFFWriteDirectoryTagLong(tif, &ndir, dir, (uint16_t)o->field_tag, p))
goto bad;
}
break;
case TIFF_SETGET_C32_UINT8:
{
- uint32 pa;
+ uint32_t pa;
void* pb;
assert(o->field_type==TIFF_UNDEFINED);
assert(o->field_readcount==TIFF_VARIABLE2);
assert(o->field_passcount==1);
TIFFGetField(tif,o->field_tag,&pa,&pb);
- if (!TIFFWriteDirectoryTagUndefinedArray(tif,&ndir,dir,(uint16)o->field_tag,pa,pb))
+ if (!TIFFWriteDirectoryTagUndefinedArray(tif, &ndir, dir, (uint16_t)o->field_tag, pa, pb))
goto bad;
}
break;
default:
TIFFErrorExt(tif->tif_clientdata,module,
- "Cannot write tag %d (%s)",
+ "Cannot write tag %"PRIu32" (%s)",
TIFFFieldTag(o),
o->field_name ? o->field_name : "unknown");
goto bad;
@@ -764,10 +764,10 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
}
}
}
- for (m=0; m<(uint32)(tif->tif_dir.td_customValueCount); m++)
+ for (m=0; m<(uint32_t)(tif->tif_dir.td_customValueCount); m++)
{
- uint16 tag = (uint16)tif->tif_dir.td_customValues[m].info->field_tag;
- uint32 count = tif->tif_dir.td_customValues[m].count;
+ uint16_t tag = (uint16_t)tif->tif_dir.td_customValues[m].info->field_tag;
+ uint32_t count = tif->tif_dir.td_customValues[m].count;
switch (tif->tif_dir.td_customValues[m].info->field_type)
{
case TIFF_ASCII:
@@ -892,8 +892,8 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
dirsize=8+ndir*20+8;
tif->tif_dataoff=tif->tif_diroff+dirsize;
if (!(tif->tif_flags&TIFF_BIGTIFF))
- tif->tif_dataoff=(uint32)tif->tif_dataoff;
- if ((tif->tif_dataoff<tif->tif_diroff)||(tif->tif_dataoff<(uint64)dirsize))
+ tif->tif_dataoff=(uint32_t)tif->tif_dataoff;
+ if ((tif->tif_dataoff<tif->tif_diroff)||(tif->tif_dataoff<(uint64_t)dirsize))
{
TIFFErrorExt(tif->tif_clientdata,module,"Maximum TIFF file size exceeded");
goto bad;
@@ -907,7 +907,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
{
if (TIFFFieldSet(tif,FIELD_SUBIFD)&&(tif->tif_subifdoff==0))
{
- uint32 na;
+ uint32_t na;
TIFFDirEntry* nb;
for (na=0, nb=dir; ; na++, nb++)
{
@@ -934,29 +934,29 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
}
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint8* n;
- uint32 nTmp;
+ uint8_t* n;
+ uint32_t nTmp;
TIFFDirEntry* o;
n=dirmem;
- *(uint16*)n=(uint16)ndir;
+ *(uint16_t*)n=(uint16_t)ndir;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)n);
+ TIFFSwabShort((uint16_t*)n);
n+=2;
o=dir;
for (m=0; m<ndir; m++)
{
- *(uint16*)n=o->tdir_tag;
+ *(uint16_t*)n=o->tdir_tag;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)n);
+ TIFFSwabShort((uint16_t*)n);
n+=2;
- *(uint16*)n=o->tdir_type;
+ *(uint16_t*)n=o->tdir_type;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)n);
+ TIFFSwabShort((uint16_t*)n);
n+=2;
- nTmp = (uint32)o->tdir_count;
+ nTmp = (uint32_t)o->tdir_count;
_TIFFmemcpy(n,&nTmp,4);
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)n);
+ TIFFSwabLong((uint32_t*)n);
n+=4;
/* This is correct. The data has been */
/* swabbed previously in TIFFWriteDirectoryTagData */
@@ -964,34 +964,34 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
n+=4;
o++;
}
- nTmp = (uint32)tif->tif_nextdiroff;
+ nTmp = (uint32_t)tif->tif_nextdiroff;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&nTmp);
_TIFFmemcpy(n,&nTmp,4);
}
else
{
- uint8* n;
+ uint8_t* n;
TIFFDirEntry* o;
n=dirmem;
- *(uint64*)n=ndir;
+ *(uint64_t*)n=ndir;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)n);
+ TIFFSwabLong8((uint64_t*)n);
n+=8;
o=dir;
for (m=0; m<ndir; m++)
{
- *(uint16*)n=o->tdir_tag;
+ *(uint16_t*)n=o->tdir_tag;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)n);
+ TIFFSwabShort((uint16_t*)n);
n+=2;
- *(uint16*)n=o->tdir_type;
+ *(uint16_t*)n=o->tdir_type;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)n);
+ TIFFSwabShort((uint16_t*)n);
n+=2;
_TIFFmemcpy(n,&o->tdir_count,8);
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)n);
+ TIFFSwabLong8((uint64_t*)n);
n+=8;
_TIFFmemcpy(n,&o->tdir_offset,8);
n+=8;
@@ -999,7 +999,7 @@ TIFFWriteDirectorySec(TIFF* tif, int isimage, int imagedone, uint64* pdiroff)
}
_TIFFmemcpy(n,&tif->tif_nextdiroff,8);
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)n);
+ TIFFSwabLong8((uint64_t*)n);
}
_TIFFfree(dir);
dir=NULL;
@@ -1035,66 +1035,66 @@ bad:
return(0);
}
-static int8 TIFFClampDoubleToInt8( double val )
+static int8_t TIFFClampDoubleToInt8(double val )
{
if( val > 127 )
return 127;
if( val < -128 || val != val )
return -128;
- return (int8)val;
+ return (int8_t)val;
}
-static int16 TIFFClampDoubleToInt16( double val )
+static int16_t TIFFClampDoubleToInt16(double val )
{
if( val > 32767 )
return 32767;
if( val < -32768 || val != val )
return -32768;
- return (int16)val;
+ return (int16_t)val;
}
-static int32 TIFFClampDoubleToInt32( double val )
+static int32_t TIFFClampDoubleToInt32(double val )
{
if( val > 0x7FFFFFFF )
return 0x7FFFFFFF;
if( val < -0x7FFFFFFF-1 || val != val )
return -0x7FFFFFFF-1;
- return (int32)val;
+ return (int32_t)val;
}
-static uint8 TIFFClampDoubleToUInt8( double val )
+static uint8_t TIFFClampDoubleToUInt8(double val )
{
if( val < 0 )
return 0;
if( val > 255 || val != val )
return 255;
- return (uint8)val;
+ return (uint8_t)val;
}
-static uint16 TIFFClampDoubleToUInt16( double val )
+static uint16_t TIFFClampDoubleToUInt16(double val )
{
if( val < 0 )
return 0;
if( val > 65535 || val != val )
return 65535;
- return (uint16)val;
+ return (uint16_t)val;
}
-static uint32 TIFFClampDoubleToUInt32( double val )
+static uint32_t TIFFClampDoubleToUInt32(double val )
{
if( val < 0 )
return 0;
if( val > 0xFFFFFFFFU || val != val )
return 0xFFFFFFFFU;
- return (uint32)val;
+ return (uint32_t)val;
}
static int
-TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
+TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value)
{
static const char module[] = "TIFFWriteDirectoryTagSampleformatArray";
void* conv;
- uint32 i;
+ uint32_t i;
int ok;
conv = _TIFFmalloc(count*sizeof(double));
if (conv == NULL)
@@ -1121,40 +1121,40 @@ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
if (tif->tif_dir.td_bitspersample<=8)
{
for (i = 0; i < count; ++i)
- ((int8*)conv)[i] = TIFFClampDoubleToInt8(value[i]);
- ok = TIFFWriteDirectoryTagSbyteArray(tif,ndir,dir,tag,count,(int8*)conv);
+ ((int8_t*)conv)[i] = TIFFClampDoubleToInt8(value[i]);
+ ok = TIFFWriteDirectoryTagSbyteArray(tif,ndir,dir,tag,count,(int8_t*)conv);
}
else if (tif->tif_dir.td_bitspersample<=16)
{
for (i = 0; i < count; ++i)
- ((int16*)conv)[i] = TIFFClampDoubleToInt16(value[i]);
- ok = TIFFWriteDirectoryTagSshortArray(tif,ndir,dir,tag,count,(int16*)conv);
+ ((int16_t*)conv)[i] = TIFFClampDoubleToInt16(value[i]);
+ ok = TIFFWriteDirectoryTagSshortArray(tif,ndir,dir,tag,count,(int16_t*)conv);
}
else
{
for (i = 0; i < count; ++i)
- ((int32*)conv)[i] = TIFFClampDoubleToInt32(value[i]);
- ok = TIFFWriteDirectoryTagSlongArray(tif,ndir,dir,tag,count,(int32*)conv);
+ ((int32_t*)conv)[i] = TIFFClampDoubleToInt32(value[i]);
+ ok = TIFFWriteDirectoryTagSlongArray(tif,ndir,dir,tag,count,(int32_t*)conv);
}
break;
case SAMPLEFORMAT_UINT:
if (tif->tif_dir.td_bitspersample<=8)
{
for (i = 0; i < count; ++i)
- ((uint8*)conv)[i] = TIFFClampDoubleToUInt8(value[i]);
- ok = TIFFWriteDirectoryTagByteArray(tif,ndir,dir,tag,count,(uint8*)conv);
+ ((uint8_t*)conv)[i] = TIFFClampDoubleToUInt8(value[i]);
+ ok = TIFFWriteDirectoryTagByteArray(tif,ndir,dir,tag,count,(uint8_t*)conv);
}
else if (tif->tif_dir.td_bitspersample<=16)
{
for (i = 0; i < count; ++i)
- ((uint16*)conv)[i] = TIFFClampDoubleToUInt16(value[i]);
- ok = TIFFWriteDirectoryTagShortArray(tif,ndir,dir,tag,count,(uint16*)conv);
+ ((uint16_t*)conv)[i] = TIFFClampDoubleToUInt16(value[i]);
+ ok = TIFFWriteDirectoryTagShortArray(tif,ndir,dir,tag,count,(uint16_t*)conv);
}
else
{
for (i = 0; i < count; ++i)
- ((uint32*)conv)[i] = TIFFClampDoubleToUInt32(value[i]);
- ok = TIFFWriteDirectoryTagLongArray(tif,ndir,dir,tag,count,(uint32*)conv);
+ ((uint32_t*)conv)[i] = TIFFClampDoubleToUInt32(value[i]);
+ ok = TIFFWriteDirectoryTagLongArray(tif,ndir,dir,tag,count,(uint32_t*)conv);
}
break;
default:
@@ -1167,7 +1167,7 @@ TIFFWriteDirectoryTagSampleformatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
#if 0
static int
-TIFFWriteDirectoryTagSampleformatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value)
+TIFFWriteDirectoryTagSampleformatPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value)
{
switch (tif->tif_dir.td_sampleformat)
{
@@ -1178,18 +1178,18 @@ TIFFWriteDirectoryTagSampleformatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry
return(TIFFWriteDirectoryTagDoublePerSample(tif,ndir,dir,tag,value));
case SAMPLEFORMAT_INT:
if (tif->tif_dir.td_bitspersample<=8)
- return(TIFFWriteDirectoryTagSbytePerSample(tif,ndir,dir,tag,(int8)value));
+ return(TIFFWriteDirectoryTagSbytePerSample(tif,ndir,dir,tag,(int8_t)value));
else if (tif->tif_dir.td_bitspersample<=16)
- return(TIFFWriteDirectoryTagSshortPerSample(tif,ndir,dir,tag,(int16)value));
+ return(TIFFWriteDirectoryTagSshortPerSample(tif,ndir,dir,tag,(int16_t)value));
else
- return(TIFFWriteDirectoryTagSlongPerSample(tif,ndir,dir,tag,(int32)value));
+ return(TIFFWriteDirectoryTagSlongPerSample(tif,ndir,dir,tag,(int32_t)value));
case SAMPLEFORMAT_UINT:
if (tif->tif_dir.td_bitspersample<=8)
- return(TIFFWriteDirectoryTagBytePerSample(tif,ndir,dir,tag,(uint8)value));
+ return(TIFFWriteDirectoryTagBytePerSample(tif,ndir,dir,tag,(uint8_t)value));
else if (tif->tif_dir.td_bitspersample<=16)
- return(TIFFWriteDirectoryTagShortPerSample(tif,ndir,dir,tag,(uint16)value));
+ return(TIFFWriteDirectoryTagShortPerSample(tif,ndir,dir,tag,(uint16_t)value));
else
- return(TIFFWriteDirectoryTagLongPerSample(tif,ndir,dir,tag,(uint32)value));
+ return(TIFFWriteDirectoryTagLongPerSample(tif,ndir,dir,tag,(uint32_t)value));
default:
return(1);
}
@@ -1197,7 +1197,7 @@ TIFFWriteDirectoryTagSampleformatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry
#endif
static int
-TIFFWriteDirectoryTagAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, char* value)
+TIFFWriteDirectoryTagAscii(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, char* value)
{
if (dir==NULL)
{
@@ -1208,7 +1208,7 @@ TIFFWriteDirectoryTagAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 ta
}
static int
-TIFFWriteDirectoryTagUndefinedArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value)
+TIFFWriteDirectoryTagUndefinedArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint8_t* value)
{
if (dir==NULL)
{
@@ -1220,7 +1220,7 @@ TIFFWriteDirectoryTagUndefinedArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
#ifdef notdef
static int
-TIFFWriteDirectoryTagByte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value)
+TIFFWriteDirectoryTagByte(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint8_t value)
{
if (dir==NULL)
{
@@ -1232,7 +1232,7 @@ TIFFWriteDirectoryTagByte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag
#endif
static int
-TIFFWriteDirectoryTagByteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value)
+TIFFWriteDirectoryTagByteArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint8_t* value)
{
if (dir==NULL)
{
@@ -1244,19 +1244,19 @@ TIFFWriteDirectoryTagByteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint1
#if 0
static int
-TIFFWriteDirectoryTagBytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value)
+TIFFWriteDirectoryTagBytePerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint8_t value)
{
static const char module[] = "TIFFWriteDirectoryTagBytePerSample";
- uint8* m;
- uint8* na;
- uint16 nb;
+ uint8_t* m;
+ uint8_t* na;
+ uint16_t nb;
int o;
if (dir==NULL)
{
(*ndir)++;
return(1);
}
- m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint8));
+ m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint8_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -1272,7 +1272,7 @@ TIFFWriteDirectoryTagBytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, u
#ifdef notdef
static int
-TIFFWriteDirectoryTagSbyte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value)
+TIFFWriteDirectoryTagSbyte(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int8_t value)
{
if (dir==NULL)
{
@@ -1284,7 +1284,7 @@ TIFFWriteDirectoryTagSbyte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 ta
#endif
static int
-TIFFWriteDirectoryTagSbyteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int8* value)
+TIFFWriteDirectoryTagSbyteArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int8_t* value)
{
if (dir==NULL)
{
@@ -1296,19 +1296,19 @@ TIFFWriteDirectoryTagSbyteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint
#if 0
static int
-TIFFWriteDirectoryTagSbytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value)
+TIFFWriteDirectoryTagSbytePerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int8_t value)
{
static const char module[] = "TIFFWriteDirectoryTagSbytePerSample";
- int8* m;
- int8* na;
- uint16 nb;
+ int8_t* m;
+ int8_t* na;
+ uint16_t nb;
int o;
if (dir==NULL)
{
(*ndir)++;
return(1);
}
- m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(int8));
+ m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(int8_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -1323,7 +1323,7 @@ TIFFWriteDirectoryTagSbytePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
#endif
static int
-TIFFWriteDirectoryTagShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value)
+TIFFWriteDirectoryTagShort(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint16_t value)
{
if (dir==NULL)
{
@@ -1334,7 +1334,7 @@ TIFFWriteDirectoryTagShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 ta
}
static int
-TIFFWriteDirectoryTagShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint16* value)
+TIFFWriteDirectoryTagShortArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint16_t* value)
{
if (dir==NULL)
{
@@ -1345,19 +1345,19 @@ TIFFWriteDirectoryTagShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint
}
static int
-TIFFWriteDirectoryTagShortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value)
+TIFFWriteDirectoryTagShortPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint16_t value)
{
static const char module[] = "TIFFWriteDirectoryTagShortPerSample";
- uint16* m;
- uint16* na;
- uint16 nb;
+ uint16_t* m;
+ uint16_t* na;
+ uint16_t nb;
int o;
if (dir==NULL)
{
(*ndir)++;
return(1);
}
- m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint16));
+ m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint16_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -1372,7 +1372,7 @@ TIFFWriteDirectoryTagShortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
#ifdef notdef
static int
-TIFFWriteDirectoryTagSshort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value)
+TIFFWriteDirectoryTagSshort(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int16_t value)
{
if (dir==NULL)
{
@@ -1384,7 +1384,7 @@ TIFFWriteDirectoryTagSshort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 t
#endif
static int
-TIFFWriteDirectoryTagSshortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int16* value)
+TIFFWriteDirectoryTagSshortArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int16_t* value)
{
if (dir==NULL)
{
@@ -1396,19 +1396,19 @@ TIFFWriteDirectoryTagSshortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uin
#if 0
static int
-TIFFWriteDirectoryTagSshortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value)
+TIFFWriteDirectoryTagSshortPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int16_t value)
{
static const char module[] = "TIFFWriteDirectoryTagSshortPerSample";
- int16* m;
- int16* na;
- uint16 nb;
+ int16_t* m;
+ int16_t* na;
+ uint16_t nb;
int o;
if (dir==NULL)
{
(*ndir)++;
return(1);
}
- m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(int16));
+ m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(int16_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -1423,7 +1423,7 @@ TIFFWriteDirectoryTagSshortPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
#endif
static int
-TIFFWriteDirectoryTagLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value)
+TIFFWriteDirectoryTagLong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t value)
{
if (dir==NULL)
{
@@ -1434,7 +1434,7 @@ TIFFWriteDirectoryTagLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag
}
static int
-TIFFWriteDirectoryTagLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value)
+TIFFWriteDirectoryTagLongArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint32_t* value)
{
if (dir==NULL)
{
@@ -1446,19 +1446,19 @@ TIFFWriteDirectoryTagLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint1
#if 0
static int
-TIFFWriteDirectoryTagLongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value)
+TIFFWriteDirectoryTagLongPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t value)
{
static const char module[] = "TIFFWriteDirectoryTagLongPerSample";
- uint32* m;
- uint32* na;
- uint16 nb;
+ uint32_t* m;
+ uint32_t* na;
+ uint16_t nb;
int o;
if (dir==NULL)
{
(*ndir)++;
return(1);
}
- m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint32));
+ m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(uint32_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -1474,7 +1474,7 @@ TIFFWriteDirectoryTagLongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, u
#ifdef notdef
static int
-TIFFWriteDirectoryTagSlong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value)
+TIFFWriteDirectoryTagSlong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int32_t value)
{
if (dir==NULL)
{
@@ -1486,7 +1486,7 @@ TIFFWriteDirectoryTagSlong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 ta
#endif
static int
-TIFFWriteDirectoryTagSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value)
+TIFFWriteDirectoryTagSlongArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int32_t* value)
{
if (dir==NULL)
{
@@ -1498,19 +1498,19 @@ TIFFWriteDirectoryTagSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint
#if 0
static int
-TIFFWriteDirectoryTagSlongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value)
+TIFFWriteDirectoryTagSlongPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int32_t value)
{
static const char module[] = "TIFFWriteDirectoryTagSlongPerSample";
- int32* m;
- int32* na;
- uint16 nb;
+ int32_t* m;
+ int32_t* na;
+ uint16_t nb;
int o;
if (dir==NULL)
{
(*ndir)++;
return(1);
}
- m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(int32));
+ m=_TIFFmalloc(tif->tif_dir.td_samplesperpixel*sizeof(int32_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -1526,7 +1526,7 @@ TIFFWriteDirectoryTagSlongPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
#ifdef notdef
static int
-TIFFWriteDirectoryTagLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint64 value)
+TIFFWriteDirectoryTagLong8(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint64_t value)
{
if (dir==NULL)
{
@@ -1538,7 +1538,7 @@ TIFFWriteDirectoryTagLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 ta
#endif
static int
-TIFFWriteDirectoryTagLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value)
+TIFFWriteDirectoryTagLong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value)
{
if (dir==NULL)
{
@@ -1550,7 +1550,7 @@ TIFFWriteDirectoryTagLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint
#ifdef notdef
static int
-TIFFWriteDirectoryTagSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int64 value)
+TIFFWriteDirectoryTagSlong8(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int64_t value)
{
if (dir==NULL)
{
@@ -1562,7 +1562,7 @@ TIFFWriteDirectoryTagSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 t
#endif
static int
-TIFFWriteDirectoryTagSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int64* value)
+TIFFWriteDirectoryTagSlong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int64_t* value)
{
if (dir==NULL)
{
@@ -1573,7 +1573,7 @@ TIFFWriteDirectoryTagSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uin
}
static int
-TIFFWriteDirectoryTagRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value)
+TIFFWriteDirectoryTagRational(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value)
{
if (dir==NULL)
{
@@ -1584,7 +1584,7 @@ TIFFWriteDirectoryTagRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16
}
static int
-TIFFWriteDirectoryTagRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value)
+TIFFWriteDirectoryTagRationalArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value)
{
if (dir==NULL)
{
@@ -1595,7 +1595,7 @@ TIFFWriteDirectoryTagRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, u
}
static int
-TIFFWriteDirectoryTagSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value)
+TIFFWriteDirectoryTagSrationalArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value)
{
if (dir==NULL)
{
@@ -1607,7 +1607,7 @@ TIFFWriteDirectoryTagSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
/*-- Rational2Double: additional write functions */
static int
-TIFFWriteDirectoryTagRationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
+TIFFWriteDirectoryTagRationalDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value)
{
if (dir==NULL)
{
@@ -1618,7 +1618,7 @@ TIFFWriteDirectoryTagRationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry*
}
static int
-TIFFWriteDirectoryTagSrationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
+TIFFWriteDirectoryTagSrationalDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value)
{
if (dir==NULL)
{
@@ -1629,7 +1629,7 @@ TIFFWriteDirectoryTagSrationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry*
}
#ifdef notdef
-static int TIFFWriteDirectoryTagFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value)
+static int TIFFWriteDirectoryTagFloat(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, float value)
{
if (dir==NULL)
{
@@ -1640,7 +1640,7 @@ static int TIFFWriteDirectoryTagFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir
}
#endif
-static int TIFFWriteDirectoryTagFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value)
+static int TIFFWriteDirectoryTagFloatArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value)
{
if (dir==NULL)
{
@@ -1651,12 +1651,12 @@ static int TIFFWriteDirectoryTagFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry
}
#if 0
-static int TIFFWriteDirectoryTagFloatPerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value)
+static int TIFFWriteDirectoryTagFloatPerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, float value)
{
static const char module[] = "TIFFWriteDirectoryTagFloatPerSample";
float* m;
float* na;
- uint16 nb;
+ uint16_t nb;
int o;
if (dir==NULL)
{
@@ -1678,7 +1678,7 @@ static int TIFFWriteDirectoryTagFloatPerSample(TIFF* tif, uint32* ndir, TIFFDirE
#endif
#ifdef notdef
-static int TIFFWriteDirectoryTagDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value)
+static int TIFFWriteDirectoryTagDouble(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value)
{
if (dir==NULL)
{
@@ -1689,7 +1689,7 @@ static int TIFFWriteDirectoryTagDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* di
}
#endif
-static int TIFFWriteDirectoryTagDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
+static int TIFFWriteDirectoryTagDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value)
{
if (dir==NULL)
{
@@ -1700,12 +1700,12 @@ static int TIFFWriteDirectoryTagDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntr
}
#if 0
-static int TIFFWriteDirectoryTagDoublePerSample(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value)
+static int TIFFWriteDirectoryTagDoublePerSample(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value)
{
static const char module[] = "TIFFWriteDirectoryTagDoublePerSample";
double* m;
double* na;
- uint16 nb;
+ uint16_t nb;
int o;
if (dir==NULL)
{
@@ -1727,7 +1727,7 @@ static int TIFFWriteDirectoryTagDoublePerSample(TIFF* tif, uint32* ndir, TIFFDir
#endif
static int
-TIFFWriteDirectoryTagIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value)
+TIFFWriteDirectoryTagIfdArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint32_t* value)
{
if (dir==NULL)
{
@@ -1739,7 +1739,7 @@ TIFFWriteDirectoryTagIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16
#ifdef notdef
static int
-TIFFWriteDirectoryTagIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value)
+TIFFWriteDirectoryTagIfd8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value)
{
if (dir==NULL)
{
@@ -1751,7 +1751,7 @@ TIFFWriteDirectoryTagIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint1
#endif
static int
-TIFFWriteDirectoryTagShortLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value)
+TIFFWriteDirectoryTagShortLong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t value)
{
if (dir==NULL)
{
@@ -1759,14 +1759,14 @@ TIFFWriteDirectoryTagShortLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint1
return(1);
}
if (value<=0xFFFF)
- return(TIFFWriteDirectoryTagCheckedShort(tif,ndir,dir,tag,(uint16)value));
+ return(TIFFWriteDirectoryTagCheckedShort(tif,ndir,dir,tag,(uint16_t)value));
else
return(TIFFWriteDirectoryTagCheckedLong(tif,ndir,dir,tag,value));
}
-static int _WriteAsType(TIFF* tif, uint64 strile_size, uint64 uncompressed_threshold)
+static int _WriteAsType(TIFF* tif, uint64_t strile_size, uint64_t uncompressed_threshold)
{
- const uint16 compression = tif->tif_dir.td_compression;
+ const uint16_t compression = tif->tif_dir.td_compression;
if ( compression == COMPRESSION_NONE )
{
return strile_size > uncompressed_threshold;
@@ -1787,12 +1787,12 @@ static int _WriteAsType(TIFF* tif, uint64 strile_size, uint64 uncompressed_thres
return 1;
}
-static int WriteAsLong8(TIFF* tif, uint64 strile_size)
+static int WriteAsLong8(TIFF* tif, uint64_t strile_size)
{
return _WriteAsType(tif, strile_size, 0xFFFFFFFFU);
}
-static int WriteAsLong4(TIFF* tif, uint64 strile_size)
+static int WriteAsLong4(TIFF* tif, uint64_t strile_size)
{
return _WriteAsType(tif, strile_size, 0xFFFFU);
}
@@ -1805,7 +1805,7 @@ static int WriteAsLong4(TIFF* tif, uint64 strile_size)
/************************************************************************/
static int
-TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value)
+TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value)
{
static const char module[] = "TIFFWriteDirectoryTagLongLong8Array";
int o;
@@ -1862,10 +1862,10 @@ TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
** and convert to long format.
*/
- uint32* p = _TIFFmalloc(count*sizeof(uint32));
- uint32* q;
- uint64* ma;
- uint32 mb;
+ uint32_t* p = _TIFFmalloc(count * sizeof(uint32_t));
+ uint32_t* q;
+ uint64_t* ma;
+ uint32_t mb;
if (p==NULL)
{
@@ -1882,7 +1882,7 @@ TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
_TIFFfree(p);
return(0);
}
- *q= (uint32)(*ma);
+ *q= (uint32_t)(*ma);
}
o=TIFFWriteDirectoryTagCheckedLongArray(tif,ndir,dir,tag,count,p);
@@ -1890,10 +1890,10 @@ TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
}
else
{
- uint16* p = _TIFFmalloc(count*sizeof(uint16));
- uint16* q;
- uint64* ma;
- uint32 mb;
+ uint16_t* p = _TIFFmalloc(count * sizeof(uint16_t));
+ uint16_t* q;
+ uint64_t* ma;
+ uint32_t mb;
if (p==NULL)
{
@@ -1911,7 +1911,7 @@ TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
_TIFFfree(p);
return(0);
}
- *q= (uint16)(*ma);
+ *q= (uint16_t)(*ma);
}
o=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,tag,count,p);
@@ -1928,13 +1928,13 @@ TIFFWriteDirectoryTagLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
/************************************************************************/
static int
-TIFFWriteDirectoryTagIfdIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value)
+TIFFWriteDirectoryTagIfdIfd8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value)
{
static const char module[] = "TIFFWriteDirectoryTagIfdIfd8Array";
- uint64* ma;
- uint32 mb;
- uint32* p;
- uint32* q;
+ uint64_t* ma;
+ uint32_t mb;
+ uint32_t* p;
+ uint32_t* q;
int o;
/* is this just a counting pass? */
@@ -1954,7 +1954,7 @@ TIFFWriteDirectoryTagIfdIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, ui
** and convert to long format.
*/
- p = _TIFFmalloc(count*sizeof(uint32));
+ p = _TIFFmalloc(count*sizeof(uint32_t));
if (p==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -1970,7 +1970,7 @@ TIFFWriteDirectoryTagIfdIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, ui
_TIFFfree(p);
return(0);
}
- *q= (uint32)(*ma);
+ *q= (uint32_t)(*ma);
}
o=TIFFWriteDirectoryTagCheckedIfdArray(tif,ndir,dir,tag,count,p);
@@ -1981,12 +1981,12 @@ TIFFWriteDirectoryTagIfdIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, ui
#ifdef notdef
static int
-TIFFWriteDirectoryTagShortLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value)
+TIFFWriteDirectoryTagShortLongLong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value)
{
static const char module[] = "TIFFWriteDirectoryTagShortLongLong8Array";
- uint64* ma;
- uint32 mb;
- uint8 n;
+ uint64_t* ma;
+ uint32_t mb;
+ uint8_t n;
int o;
if (dir==NULL)
{
@@ -2006,31 +2006,31 @@ TIFFWriteDirectoryTagShortLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry*
}
if (n==0)
{
- uint16* p;
- uint16* q;
- p=_TIFFmalloc(count*sizeof(uint16));
+ uint16_t* p;
+ uint16_t* q;
+ p=_TIFFmalloc(count*sizeof(uint16_t));
if (p==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
for (ma=value, mb=0, q=p; mb<count; ma++, mb++, q++)
- *q=(uint16)(*ma);
+ *q=(uint16_t)(*ma);
o=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,tag,count,p);
_TIFFfree(p);
}
else if (n==1)
{
- uint32* p;
- uint32* q;
- p=_TIFFmalloc(count*sizeof(uint32));
+ uint32_t* p;
+ uint32_t* q;
+ p=_TIFFmalloc(count*sizeof(uint32_t));
if (p==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
for (ma=value, mb=0, q=p; mb<count; ma++, mb++, q++)
- *q=(uint32)(*ma);
+ *q=(uint32_t)(*ma);
o=TIFFWriteDirectoryTagCheckedLongArray(tif,ndir,dir,tag,count,p);
_TIFFfree(p);
}
@@ -2043,11 +2043,11 @@ TIFFWriteDirectoryTagShortLongLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry*
}
#endif
static int
-TIFFWriteDirectoryTagColormap(TIFF* tif, uint32* ndir, TIFFDirEntry* dir)
+TIFFWriteDirectoryTagColormap(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir)
{
static const char module[] = "TIFFWriteDirectoryTagColormap";
- uint32 m;
- uint16* n;
+ uint32_t m;
+ uint16_t* n;
int o;
if (dir==NULL)
{
@@ -2055,27 +2055,27 @@ TIFFWriteDirectoryTagColormap(TIFF* tif, uint32* ndir, TIFFDirEntry* dir)
return(1);
}
m=(1<<tif->tif_dir.td_bitspersample);
- n=_TIFFmalloc(3*m*sizeof(uint16));
+ n=_TIFFmalloc(3*m*sizeof(uint16_t));
if (n==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
- _TIFFmemcpy(&n[0],tif->tif_dir.td_colormap[0],m*sizeof(uint16));
- _TIFFmemcpy(&n[m],tif->tif_dir.td_colormap[1],m*sizeof(uint16));
- _TIFFmemcpy(&n[2*m],tif->tif_dir.td_colormap[2],m*sizeof(uint16));
+ _TIFFmemcpy(&n[0],tif->tif_dir.td_colormap[0],m*sizeof(uint16_t));
+ _TIFFmemcpy(&n[m],tif->tif_dir.td_colormap[1],m*sizeof(uint16_t));
+ _TIFFmemcpy(&n[2*m],tif->tif_dir.td_colormap[2],m*sizeof(uint16_t));
o=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,TIFFTAG_COLORMAP,3*m,n);
_TIFFfree(n);
return(o);
}
static int
-TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir)
+TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir)
{
static const char module[] = "TIFFWriteDirectoryTagTransferfunction";
- uint32 m;
- uint16 n;
- uint16* o;
+ uint32_t m;
+ uint16_t n;
+ uint16_t* o;
int p;
if (dir==NULL)
{
@@ -2095,38 +2095,38 @@ TIFFWriteDirectoryTagTransferfunction(TIFF* tif, uint32* ndir, TIFFDirEntry* dir
if (n==3)
{
if (tif->tif_dir.td_transferfunction[2] == NULL ||
- !_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16)))
+ !_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16_t)))
n=2;
}
if (n==2)
{
if (tif->tif_dir.td_transferfunction[1] == NULL ||
- !_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16)))
+ !_TIFFmemcmp(tif->tif_dir.td_transferfunction[0],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16_t)))
n=1;
}
if (n==0)
n=1;
- o=_TIFFmalloc(n*m*sizeof(uint16));
+ o=_TIFFmalloc(n*m*sizeof(uint16_t));
if (o==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
- _TIFFmemcpy(&o[0],tif->tif_dir.td_transferfunction[0],m*sizeof(uint16));
+ _TIFFmemcpy(&o[0],tif->tif_dir.td_transferfunction[0],m*sizeof(uint16_t));
if (n>1)
- _TIFFmemcpy(&o[m],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16));
+ _TIFFmemcpy(&o[m],tif->tif_dir.td_transferfunction[1],m*sizeof(uint16_t));
if (n>2)
- _TIFFmemcpy(&o[2*m],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16));
+ _TIFFmemcpy(&o[2*m],tif->tif_dir.td_transferfunction[2],m*sizeof(uint16_t));
p=TIFFWriteDirectoryTagCheckedShortArray(tif,ndir,dir,TIFFTAG_TRANSFERFUNCTION,n*m,o);
_TIFFfree(o);
return(p);
}
static int
-TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32* ndir, TIFFDirEntry* dir)
+TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir)
{
static const char module[] = "TIFFWriteDirectoryTagSubifd";
- uint64 m;
+ uint64_t m;
int n;
if (tif->tif_dir.td_nsubifd==0)
return(1);
@@ -2138,11 +2138,11 @@ TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32* ndir, TIFFDirEntry* dir)
m=tif->tif_dataoff;
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32* o;
- uint64* pa;
- uint32* pb;
- uint16 p;
- o=_TIFFmalloc(tif->tif_dir.td_nsubifd*sizeof(uint32));
+ uint32_t* o;
+ uint64_t* pa;
+ uint32_t* pb;
+ uint16_t p;
+ o=_TIFFmalloc(tif->tif_dir.td_nsubifd*sizeof(uint32_t));
if (o==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -2161,7 +2161,7 @@ TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32* ndir, TIFFDirEntry* dir)
_TIFFfree(o);
return(0);
}
- *pb++=(uint32)(*pa++);
+ *pb++=(uint32_t)(*pa++);
}
n=TIFFWriteDirectoryTagCheckedIfdArray(tif,ndir,dir,TIFFTAG_SUBIFD,tif->tif_dir.td_nsubifd,o);
_TIFFfree(o);
@@ -2188,56 +2188,56 @@ TIFFWriteDirectoryTagSubifd(TIFF* tif, uint32* ndir, TIFFDirEntry* dir)
}
static int
-TIFFWriteDirectoryTagCheckedAscii(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, char* value)
+TIFFWriteDirectoryTagCheckedAscii(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, char* value)
{
assert(sizeof(char)==1);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_ASCII,count,count,value));
}
static int
-TIFFWriteDirectoryTagCheckedUndefinedArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value)
+TIFFWriteDirectoryTagCheckedUndefinedArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint8_t* value)
{
- assert(sizeof(uint8)==1);
+ assert(sizeof(uint8_t) == 1);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_UNDEFINED,count,count,value));
}
#ifdef notdef
static int
-TIFFWriteDirectoryTagCheckedByte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint8 value)
+TIFFWriteDirectoryTagCheckedByte(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint8_t value)
{
- assert(sizeof(uint8)==1);
+ assert(sizeof(uint8_t)==1);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_BYTE,1,1,&value));
}
#endif
static int
-TIFFWriteDirectoryTagCheckedByteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint8* value)
+TIFFWriteDirectoryTagCheckedByteArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint8_t* value)
{
- assert(sizeof(uint8)==1);
+ assert(sizeof(uint8_t) == 1);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_BYTE,count,count,value));
}
#ifdef notdef
static int
-TIFFWriteDirectoryTagCheckedSbyte(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int8 value)
+TIFFWriteDirectoryTagCheckedSbyte(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int8_t value)
{
- assert(sizeof(int8)==1);
+ assert(sizeof(int8_t)==1);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SBYTE,1,1,&value));
}
#endif
static int
-TIFFWriteDirectoryTagCheckedSbyteArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int8* value)
+TIFFWriteDirectoryTagCheckedSbyteArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int8_t* value)
{
- assert(sizeof(int8)==1);
+ assert(sizeof(int8_t) == 1);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SBYTE,count,count,value));
}
static int
-TIFFWriteDirectoryTagCheckedShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 value)
+TIFFWriteDirectoryTagCheckedShort(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint16_t value)
{
- uint16 m;
- assert(sizeof(uint16)==2);
+ uint16_t m;
+ assert(sizeof(uint16_t) == 2);
m=value;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort(&m);
@@ -2245,10 +2245,10 @@ TIFFWriteDirectoryTagCheckedShort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, ui
}
static int
-TIFFWriteDirectoryTagCheckedShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint16* value)
+TIFFWriteDirectoryTagCheckedShortArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint16_t* value)
{
assert(count<0x80000000);
- assert(sizeof(uint16)==2);
+ assert(sizeof(uint16_t) == 2);
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfShort(value,count);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SHORT,count,count*2,value));
@@ -2256,32 +2256,32 @@ TIFFWriteDirectoryTagCheckedShortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
#ifdef notdef
static int
-TIFFWriteDirectoryTagCheckedSshort(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int16 value)
+TIFFWriteDirectoryTagCheckedSshort(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int16_t value)
{
- int16 m;
- assert(sizeof(int16)==2);
+ int16_t m;
+ assert(sizeof(int16_t)==2);
m=value;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort((uint16*)(&m));
+ TIFFSwabShort((uint16_t*)(&m));
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SSHORT,1,2,&m));
}
#endif
static int
-TIFFWriteDirectoryTagCheckedSshortArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int16* value)
+TIFFWriteDirectoryTagCheckedSshortArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int16_t* value)
{
assert(count<0x80000000);
- assert(sizeof(int16)==2);
+ assert(sizeof(int16_t) == 2);
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfShort((uint16*)value,count);
+ TIFFSwabArrayOfShort((uint16_t*)value, count);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SSHORT,count,count*2,value));
}
static int
-TIFFWriteDirectoryTagCheckedLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 value)
+TIFFWriteDirectoryTagCheckedLong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t value)
{
- uint32 m;
- assert(sizeof(uint32)==4);
+ uint32_t m;
+ assert(sizeof(uint32_t) == 4);
m=value;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&m);
@@ -2289,10 +2289,10 @@ TIFFWriteDirectoryTagCheckedLong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uin
}
static int
-TIFFWriteDirectoryTagCheckedLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value)
+TIFFWriteDirectoryTagCheckedLongArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint32_t* value)
{
assert(count<0x40000000);
- assert(sizeof(uint32)==4);
+ assert(sizeof(uint32_t) == 4);
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfLong(value,count);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_LONG,count,count*4,value));
@@ -2300,33 +2300,33 @@ TIFFWriteDirectoryTagCheckedLongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir
#ifdef notdef
static int
-TIFFWriteDirectoryTagCheckedSlong(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int32 value)
+TIFFWriteDirectoryTagCheckedSlong(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int32_t value)
{
- int32 m;
- assert(sizeof(int32)==4);
+ int32_t m;
+ assert(sizeof(int32_t)==4);
m=value;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong((uint32*)(&m));
+ TIFFSwabLong((uint32_t*)(&m));
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG,1,4,&m));
}
#endif
static int
-TIFFWriteDirectoryTagCheckedSlongArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int32* value)
+TIFFWriteDirectoryTagCheckedSlongArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int32_t* value)
{
assert(count<0x40000000);
- assert(sizeof(int32)==4);
+ assert(sizeof(int32_t) == 4);
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong((uint32*)value,count);
+ TIFFSwabArrayOfLong((uint32_t*)value, count);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG,count,count*4,value));
}
#ifdef notdef
static int
-TIFFWriteDirectoryTagCheckedLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint64 value)
+TIFFWriteDirectoryTagCheckedLong8(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint64_t value)
{
- uint64 m;
- assert(sizeof(uint64)==8);
+ uint64_t m;
+ assert(sizeof(uint64_t)==8);
if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8","LONG8 not allowed for ClassicTIFF");
return(0);
@@ -2339,10 +2339,10 @@ TIFFWriteDirectoryTagCheckedLong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, ui
#endif
static int
-TIFFWriteDirectoryTagCheckedLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value)
+TIFFWriteDirectoryTagCheckedLong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value)
{
assert(count<0x20000000);
- assert(sizeof(uint64)==8);
+ assert(sizeof(uint64_t) == 8);
if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedLong8Array","LONG8 not allowed for ClassicTIFF");
return(0);
@@ -2354,41 +2354,41 @@ TIFFWriteDirectoryTagCheckedLong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* di
#ifdef notdef
static int
-TIFFWriteDirectoryTagCheckedSlong8(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, int64 value)
+TIFFWriteDirectoryTagCheckedSlong8(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, int64_t value)
{
- int64 m;
- assert(sizeof(int64)==8);
+ int64_t m;
+ assert(sizeof(int64_t)==8);
if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedSlong8","SLONG8 not allowed for ClassicTIFF");
return(0);
}
m=value;
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8((uint64*)(&m));
+ TIFFSwabLong8((uint64_t*)(&m));
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG8,1,8,&m));
}
#endif
static int
-TIFFWriteDirectoryTagCheckedSlong8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, int64* value)
+TIFFWriteDirectoryTagCheckedSlong8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, int64_t* value)
{
assert(count<0x20000000);
- assert(sizeof(int64)==8);
+ assert(sizeof(int64_t) == 8);
if( !(tif->tif_flags&TIFF_BIGTIFF) ) {
TIFFErrorExt(tif->tif_clientdata,"TIFFWriteDirectoryTagCheckedSlong8Array","SLONG8 not allowed for ClassicTIFF");
return(0);
}
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong8((uint64*)value,count);
+ TIFFSwabArrayOfLong8((uint64_t*)value, count);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SLONG8,count,count*8,value));
}
static int
-TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value)
+TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value)
{
static const char module[] = "TIFFWriteDirectoryTagCheckedRational";
- uint32 m[2];
- assert(sizeof(uint32)==4);
+ uint32_t m[2];
+ assert(sizeof(uint32_t) == 4);
if (value < 0)
{
TIFFErrorExt(tif->tif_clientdata, module, "Negative value is illegal");
@@ -2405,20 +2405,20 @@ TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
m[0]=0;
m[1]=1;
}
- else if (value <= 0xFFFFFFFFU && value==(double)(uint32)value)
+ else if (value <= 0xFFFFFFFFU && value==(double)(uint32_t)value)
{
- m[0]=(uint32)value;
+ m[0]=(uint32_t)value;
m[1]=1;
}
else if (value<1.0)
{
- m[0]=(uint32)(value*0xFFFFFFFF);
+ m[0]=(uint32_t)(value*0xFFFFFFFF);
m[1]=0xFFFFFFFF;
}
else
{
m[0]=0xFFFFFFFF;
- m[1]=(uint32)(0xFFFFFFFF/value);
+ m[1]=(uint32_t)(0xFFFFFFFF/value);
}
#else
/*--Rational2Double: New function also used for non-custom rational tags.
@@ -2438,16 +2438,16 @@ TIFFWriteDirectoryTagCheckedRational(TIFF* tif, uint32* ndir, TIFFDirEntry* dir,
}
static int
-TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value)
+TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value)
{
static const char module[] = "TIFFWriteDirectoryTagCheckedRationalArray";
- uint32* m;
+ uint32_t* m;
float* na;
- uint32* nb;
- uint32 nc;
+ uint32_t* nb;
+ uint32_t nc;
int o;
- assert(sizeof(uint32)==4);
- m=_TIFFmalloc(count*2*sizeof(uint32));
+ assert(sizeof(uint32_t) == 4);
+ m=_TIFFmalloc(count*2*sizeof(uint32_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -2462,20 +2462,20 @@ TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry*
nb[1]=1;
}
else if (*na >= 0 && *na <= (float)0xFFFFFFFFU &&
- *na==(float)(uint32)(*na))
+ *na==(float)(uint32_t)(*na))
{
- nb[0]=(uint32)(*na);
+ nb[0]=(uint32_t)(*na);
nb[1]=1;
}
else if (*na<1.0)
{
- nb[0]=(uint32)((double)(*na)*0xFFFFFFFF);
+ nb[0]=(uint32_t)((double)(*na)*0xFFFFFFFF);
nb[1]=0xFFFFFFFF;
}
else
{
nb[0]=0xFFFFFFFF;
- nb[1]=(uint32)((double)0xFFFFFFFF/(*na));
+ nb[1]=(uint32_t)((double)0xFFFFFFFF/(*na));
}
#else
/*-- Rational2Double: Also for float precision accuracy is sometimes enhanced --*/
@@ -2490,16 +2490,16 @@ TIFFWriteDirectoryTagCheckedRationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry*
}
static int
-TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value)
+TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value)
{
static const char module[] = "TIFFWriteDirectoryTagCheckedSrationalArray";
- int32* m;
+ int32_t* m;
float* na;
- int32* nb;
- uint32 nc;
+ int32_t* nb;
+ uint32_t nc;
int o;
- assert(sizeof(int32)==4);
- m=_TIFFmalloc(count*2*sizeof(int32));
+ assert(sizeof(int32_t) == 4);
+ m=_TIFFmalloc(count*2*sizeof(int32_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -2510,38 +2510,38 @@ TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry
#ifdef not_def
if (*na<0.0)
{
- if (*na==(int32)(*na))
+ if (*na==(int32_t)(*na))
{
- nb[0]=(int32)(*na);
+ nb[0]=(int32_t)(*na);
nb[1]=1;
}
else if (*na>-1.0)
{
- nb[0]=-(int32)((double)(-*na)*0x7FFFFFFF);
+ nb[0]=-(int32_t)((double)(-*na)*0x7FFFFFFF);
nb[1]=0x7FFFFFFF;
}
else
{
nb[0]=-0x7FFFFFFF;
- nb[1]=(int32)((double)0x7FFFFFFF/(-*na));
+ nb[1]=(int32_t)((double)0x7FFFFFFF/(-*na));
}
}
else
{
- if (*na==(int32)(*na))
+ if (*na==(int32_t)(*na))
{
- nb[0]=(int32)(*na);
+ nb[0]=(int32_t)(*na);
nb[1]=1;
}
else if (*na<1.0)
{
- nb[0]=(int32)((double)(*na)*0x7FFFFFFF);
+ nb[0]=(int32_t)((double)(*na)*0x7FFFFFFF);
nb[1]=0x7FFFFFFF;
}
else
{
nb[0]=0x7FFFFFFF;
- nb[1]=(int32)((double)0x7FFFFFFF/(*na));
+ nb[1]=(int32_t)((double)0x7FFFFFFF/(*na));
}
}
#else
@@ -2550,7 +2550,7 @@ TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry
#endif
}
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong((uint32*)m,count*2);
+ TIFFSwabArrayOfLong((uint32_t*)m, count * 2);
o=TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SRATIONAL,count,count*8,&m[0]);
_TIFFfree(m);
return(o);
@@ -2558,16 +2558,16 @@ TIFFWriteDirectoryTagCheckedSrationalArray(TIFF* tif, uint32* ndir, TIFFDirEntry
/*-- Rational2Double: additional write functions for double arrays */
static int
-TIFFWriteDirectoryTagCheckedRationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
+TIFFWriteDirectoryTagCheckedRationalDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value)
{
static const char module[] = "TIFFWriteDirectoryTagCheckedRationalDoubleArray";
- uint32* m;
+ uint32_t* m;
double* na;
- uint32* nb;
- uint32 nc;
+ uint32_t* nb;
+ uint32_t nc;
int o;
- assert(sizeof(uint32)==4);
- m=_TIFFmalloc(count*2*sizeof(uint32));
+ assert(sizeof(uint32_t) == 4);
+ m=_TIFFmalloc(count*2*sizeof(uint32_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -2585,16 +2585,16 @@ TIFFWriteDirectoryTagCheckedRationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDir
} /*-- TIFFWriteDirectoryTagCheckedRationalDoubleArray() ------- */
static int
-TIFFWriteDirectoryTagCheckedSrationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
+TIFFWriteDirectoryTagCheckedSrationalDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value)
{
static const char module[] = "TIFFWriteDirectoryTagCheckedSrationalDoubleArray";
- int32* m;
+ int32_t* m;
double* na;
- int32* nb;
- uint32 nc;
+ int32_t* nb;
+ uint32_t nc;
int o;
- assert(sizeof(int32)==4);
- m=_TIFFmalloc(count*2*sizeof(int32));
+ assert(sizeof(int32_t) == 4);
+ m=_TIFFmalloc(count*2*sizeof(int32_t));
if (m==NULL)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
@@ -2605,7 +2605,7 @@ TIFFWriteDirectoryTagCheckedSrationalDoubleArray(TIFF* tif, uint32* ndir, TIFFDi
DoubleToSrational(*na, &nb[0], &nb[1]);
}
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabArrayOfLong((uint32*)m,count*2);
+ TIFFSwabArrayOfLong((uint32_t*)m, count * 2);
o=TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_SRATIONAL,count,count*8,&m[0]);
_TIFFfree(m);
return(o);
@@ -2626,20 +2626,20 @@ void DoubleToRational_direct(double value, unsigned long *num, unsigned long *de
*num=0;
*denom=1;
}
- else if (value <= 0xFFFFFFFFU && (value==(double)(uint32)(value))) /* check for integer values */
+ else if (value <= 0xFFFFFFFFU && (value==(double)(uint32_t)(value))) /* check for integer values */
{
- *num=(uint32)(value);
+ *num=(uint32_t)(value);
*denom=1;
}
else if (value<1.0)
{
- *num = (uint32)((value) * (double)0xFFFFFFFFU);
+ *num = (uint32_t)((value) * (double)0xFFFFFFFFU);
*denom=0xFFFFFFFFU;
}
else
{
*num=0xFFFFFFFFU;
- *denom=(uint32)((double)0xFFFFFFFFU/(value));
+ *denom=(uint32_t)((double)0xFFFFFFFFU/(value));
}
} /*-- DoubleToRational_direct() -------------- */
#endif
@@ -2656,38 +2656,38 @@ void DoubleToSrational_direct(double value, long *num, long *denom)
*/
if (value<0.0)
{
- if (value==(int32)(value))
+ if (value==(int32_t)(value))
{
- *num=(int32)(value);
+ *num=(int32_t)(value);
*denom=1;
}
else if (value>-1.0)
{
- *num=-(int32)((-value) * (double)0x7FFFFFFF);
+ *num=-(int32_t)((-value) * (double)0x7FFFFFFF);
*denom=0x7FFFFFFF;
}
else
{
*num=-0x7FFFFFFF;
- *denom=(int32)((double)0x7FFFFFFF / (-value));
+ *denom=(int32_t)((double)0x7FFFFFFF / (-value));
}
}
else
{
- if (value==(int32)(value))
+ if (value==(int32_t)(value))
{
- *num=(int32)(value);
+ *num=(int32_t)(value);
*denom=1;
}
else if (value<1.0)
{
- *num=(int32)((value) *(double)0x7FFFFFFF);
+ *num=(int32_t)((value) *(double)0x7FFFFFFF);
*denom=0x7FFFFFFF;
}
else
{
*num=0x7FFFFFFF;
- *denom=(int32)((double)0x7FFFFFFF / (value));
+ *denom=(int32_t)((double)0x7FFFFFFF / (value));
}
}
} /*-- DoubleToSrational_direct() --------------*/
@@ -2710,16 +2710,16 @@ void DoubleToSrational_direct(double value, long *num, long *denom)
* using the Euclidean algorithm to find the greatest common divisor (GCD)
------------------------------------------------------------------------*/
static
-void ToRationalEuclideanGCD(double value, int blnUseSignedRange, int blnUseSmallRange, unsigned long long *ullNum, unsigned long long *ullDenom)
+void ToRationalEuclideanGCD(double value, int blnUseSignedRange, int blnUseSmallRange, uint64_t *ullNum, uint64_t *ullDenom)
{
/* Internally, the integer variables can be bigger than the external ones,
* as long as the result will fit into the external variable size.
*/
- unsigned long long val, numSum[3] = { 0, 1, 0 }, denomSum[3] = { 1, 0, 0 };
- unsigned long long aux, bigNum, bigDenom;
- unsigned long long returnLimit;
+ uint64_t numSum[3] = { 0, 1, 0 }, denomSum[3] = { 1, 0, 0 };
+ uint64_t aux, bigNum, bigDenom;
+ uint64_t returnLimit;
int i;
- unsigned long long nMax;
+ uint64_t nMax;
double fMax;
unsigned long maxDenom;
/*-- nMax and fMax defines the initial accuracy of the starting fractional,
@@ -2729,7 +2729,7 @@ void ToRationalEuclideanGCD(double value, int blnUseSignedRange, int blnUseSmall
* For long long nMax = ((9223372036854775807-1)/2); for long nMax = ((2147483647-1)/2);
*/
if (blnUseSmallRange) {
- nMax = (unsigned long long)((2147483647 - 1) / 2); /* for ULONG range */
+ nMax = (uint64_t)((2147483647 - 1) / 2); /* for ULONG range */
}
else {
nMax = ((9223372036854775807 - 1) / 2); /* for ULLONG range */
@@ -2750,11 +2750,11 @@ void ToRationalEuclideanGCD(double value, int blnUseSignedRange, int blnUseSmall
}
/*-- First generate a rational fraction (bigNum/bigDenom) which represents the value
- * as a rational number with the highest accuracy. Therefore, unsigned long long (uint64) is needed.
+ * as a rational number with the highest accuracy. Therefore, uint64_t (uint64_t) is needed.
* This rational fraction is then reduced using the Euclidean algorithm to find the greatest common divisor (GCD).
* bigNum = big numinator of value without fraction (or cut residual fraction)
* bigDenom = big denominator of value
- *-- Break-criteria so that uint64 cast to "bigNum" introduces no error and bigDenom has no overflow,
+ *-- Break-criteria so that uint64_t cast to "bigNum" introduces no error and bigDenom has no overflow,
* and stop with enlargement of fraction when the double-value of it reaches an integer number without fractional part.
*/
bigDenom = 1;
@@ -2762,19 +2762,17 @@ void ToRationalEuclideanGCD(double value, int blnUseSignedRange, int blnUseSmall
bigDenom <<= 1;
value *= 2;
}
- bigNum = (unsigned long long)value;
+ bigNum = (uint64_t)value;
/*-- Start Euclidean algorithm to find the greatest common divisor (GCD) -- */
#define MAX_ITERATIONS 64
for (i = 0; i < MAX_ITERATIONS; i++) {
+ uint64_t val;
/* if bigDenom is not zero, calculate integer part of fraction. */
if (bigDenom == 0) {
- val = 0;
break;
}
- else {
- val = bigNum / bigDenom;
- }
+ val = bigNum / bigDenom;
/* Set bigDenom to reminder of bigNum/bigDenom and bigNum to previous denominator bigDenom. */
aux = bigNum;
@@ -2819,11 +2817,11 @@ void ToRationalEuclideanGCD(double value, int blnUseSignedRange, int blnUseSmall
* using the Euclidean algorithm to find the greatest common divisor (GCD)
------------------------------------------------------------------------*/
static
-void DoubleToRational(double value, uint32 *num, uint32 *denom)
+void DoubleToRational(double value, uint32_t *num, uint32_t *denom)
{
/*---- UN-SIGNED RATIONAL ---- */
double dblDiff, dblDiff2;
- unsigned long long ullNum, ullDenom, ullNum2, ullDenom2;
+ uint64_t ullNum, ullDenom, ullNum2, ullDenom2;
/*-- Check for negative values. If so it is an error. */
/* Test written that way to catch NaN */
@@ -2840,8 +2838,8 @@ void DoubleToRational(double value, uint32 *num, uint32 *denom)
return;
}
/*-- Check for easy integer numbers -- */
- if (value == (uint32)(value)) {
- *num = (uint32)value;
+ if (value == (uint32_t)(value)) {
+ *num = (uint32_t)value;
*denom = 1;
return;
}
@@ -2860,11 +2858,7 @@ void DoubleToRational(double value, uint32 *num, uint32 *denom)
ToRationalEuclideanGCD(value, FALSE, TRUE, &ullNum2, &ullDenom2);
/*-- Double-Check, that returned values fit into ULONG :*/
if (ullNum > 0xFFFFFFFFUL || ullDenom > 0xFFFFFFFFUL || ullNum2 > 0xFFFFFFFFUL || ullDenom2 > 0xFFFFFFFFUL) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(0, "TIFFLib: DoubleToRational()", " Num or Denom exceeds ULONG: val=%14.6f, num=%I64u, denom=%I64u | num2=%I64u, denom2=%I64u", value, ullNum, ullDenom, ullNum2, ullDenom2);
-#else
- TIFFErrorExt(0, "TIFFLib: DoubleToRational()", " Num or Denom exceeds ULONG: val=%14.6f, num=%12llu, denom=%12llu | num2=%12llu, denom2=%12llu", value, ullNum, ullDenom, ullNum2, ullDenom2);
-#endif
+ TIFFErrorExt(0, "TIFFLib: DoubleToRational()", " Num or Denom exceeds ULONG: val=%14.6f, num=%12"PRIu64", denom=%12"PRIu64" | num2=%12"PRIu64", denom2=%12"PRIu64"", value, ullNum, ullDenom, ullNum2, ullDenom2);
assert(0);
}
@@ -2872,12 +2866,12 @@ void DoubleToRational(double value, uint32 *num, uint32 *denom)
dblDiff = fabs(value - ((double)ullNum / (double)ullDenom));
dblDiff2 = fabs(value - ((double)ullNum2 / (double)ullDenom2));
if (dblDiff < dblDiff2) {
- *num = (uint32)ullNum;
- *denom = (uint32)ullDenom;
+ *num = (uint32_t)ullNum;
+ *denom = (uint32_t)ullDenom;
}
else {
- *num = (uint32)ullNum2;
- *denom = (uint32)ullDenom2;
+ *num = (uint32_t)ullNum2;
+ *denom = (uint32_t)ullDenom2;
}
} /*-- DoubleToRational() -------------- */
@@ -2887,12 +2881,12 @@ void DoubleToRational(double value, uint32 *num, uint32 *denom)
* using the Euclidean algorithm to find the greatest common divisor (GCD)
------------------------------------------------------------------------*/
static
-void DoubleToSrational(double value, int32 *num, int32 *denom)
+void DoubleToSrational(double value, int32_t *num, int32_t *denom)
{
/*---- SIGNED RATIONAL ----*/
int neg = 1;
double dblDiff, dblDiff2;
- unsigned long long ullNum, ullDenom, ullNum2, ullDenom2;
+ uint64_t ullNum, ullDenom, ullNum2, ullDenom2;
/*-- Check for negative values and use then the positive one for internal calculations, but take the sign into account before returning. */
if (value < 0) { neg = -1; value = -value; }
@@ -2904,8 +2898,8 @@ void DoubleToSrational(double value, int32 *num, int32 *denom)
return;
}
/*-- Check for easy numbers -- */
- if (value == (int32)(value)) {
- *num = (int32)(neg * value);
+ if (value == (int32_t)(value)) {
+ *num = (int32_t)(neg * value);
*denom = 1;
return;
}
@@ -2925,11 +2919,7 @@ void DoubleToSrational(double value, int32 *num, int32 *denom)
ToRationalEuclideanGCD(value, TRUE, TRUE, &ullNum2, &ullDenom2);
/*-- Double-Check, that returned values fit into LONG :*/
if (ullNum > 0x7FFFFFFFL || ullDenom > 0x7FFFFFFFL || ullNum2 > 0x7FFFFFFFL || ullDenom2 > 0x7FFFFFFFL) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(0, "TIFFLib: DoubleToSrational()", " Num or Denom exceeds LONG: val=%14.6f, num=%I64u, denom=%I64u | num2=%I64u, denom2=%I64u", neg*value, ullNum, ullDenom, ullNum2, ullDenom2);
-#else
- TIFFErrorExt(0, "TIFFLib: DoubleToSrational()", " Num or Denom exceeds LONG: val=%14.6f, num=%12llu, denom=%12llu | num2=%12llu, denom2=%12llu", neg*value, ullNum, ullDenom, ullNum2, ullDenom2);
-#endif
+ TIFFErrorExt(0, "TIFFLib: DoubleToSrational()", " Num or Denom exceeds LONG: val=%14.6f, num=%12"PRIu64", denom=%12"PRIu64" | num2=%12"PRIu64", denom2=%12"PRIu64"", neg*value, ullNum, ullDenom, ullNum2, ullDenom2);
assert(0);
}
@@ -2937,12 +2927,12 @@ void DoubleToSrational(double value, int32 *num, int32 *denom)
dblDiff = fabs(value - ((double)ullNum / (double)ullDenom));
dblDiff2 = fabs(value - ((double)ullNum2 / (double)ullDenom2));
if (dblDiff < dblDiff2) {
- *num = (int32)(neg * (long)ullNum);
- *denom = (int32)ullDenom;
+ *num = (int32_t)(neg * (long)ullNum);
+ *denom = (int32_t)ullDenom;
}
else {
- *num = (int32)(neg * (long)ullNum2);
- *denom = (int32)ullDenom2;
+ *num = (int32_t)(neg * (long)ullNum2);
+ *denom = (int32_t)ullDenom2;
}
} /*-- DoubleToSrational() --------------*/
@@ -2952,7 +2942,7 @@ void DoubleToSrational(double value, int32 *num, int32 *denom)
#ifdef notdef
static int
-TIFFWriteDirectoryTagCheckedFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, float value)
+TIFFWriteDirectoryTagCheckedFloat(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, float value)
{
float m;
assert(sizeof(float)==4);
@@ -2965,7 +2955,7 @@ TIFFWriteDirectoryTagCheckedFloat(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, ui
#endif
static int
-TIFFWriteDirectoryTagCheckedFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, float* value)
+TIFFWriteDirectoryTagCheckedFloatArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, float* value)
{
assert(count<0x40000000);
assert(sizeof(float)==4);
@@ -2977,7 +2967,7 @@ TIFFWriteDirectoryTagCheckedFloatArray(TIFF* tif, uint32* ndir, TIFFDirEntry* di
#ifdef notdef
static int
-TIFFWriteDirectoryTagCheckedDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, double value)
+TIFFWriteDirectoryTagCheckedDouble(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, double value)
{
double m;
assert(sizeof(double)==8);
@@ -2990,7 +2980,7 @@ TIFFWriteDirectoryTagCheckedDouble(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, u
#endif
static int
-TIFFWriteDirectoryTagCheckedDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, double* value)
+TIFFWriteDirectoryTagCheckedDoubleArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, double* value)
{
assert(count<0x20000000);
assert(sizeof(double)==8);
@@ -3001,20 +2991,20 @@ TIFFWriteDirectoryTagCheckedDoubleArray(TIFF* tif, uint32* ndir, TIFFDirEntry* d
}
static int
-TIFFWriteDirectoryTagCheckedIfdArray(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint32* value)
+TIFFWriteDirectoryTagCheckedIfdArray(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint32_t* value)
{
assert(count<0x40000000);
- assert(sizeof(uint32)==4);
+ assert(sizeof(uint32_t) == 4);
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfLong(value,count);
return(TIFFWriteDirectoryTagData(tif,ndir,dir,tag,TIFF_IFD,count,count*4,value));
}
static int
-TIFFWriteDirectoryTagCheckedIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint32 count, uint64* value)
+TIFFWriteDirectoryTagCheckedIfd8Array(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint32_t count, uint64_t* value)
{
assert(count<0x20000000);
- assert(sizeof(uint64)==8);
+ assert(sizeof(uint64_t) == 8);
assert(tif->tif_flags&TIFF_BIGTIFF);
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabArrayOfLong8(value,count);
@@ -3022,10 +3012,10 @@ TIFFWriteDirectoryTagCheckedIfd8Array(TIFF* tif, uint32* ndir, TIFFDirEntry* dir
}
static int
-TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag, uint16 datatype, uint32 count, uint32 datalength, void* data)
+TIFFWriteDirectoryTagData(TIFF* tif, uint32_t* ndir, TIFFDirEntry* dir, uint16_t tag, uint16_t datatype, uint32_t count, uint32_t datalength, void* data)
{
static const char module[] = "TIFFWriteDirectoryTagData";
- uint32 m;
+ uint32_t m;
m=0;
while (m<(*ndir))
{
@@ -3036,7 +3026,7 @@ TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag
}
if (m<(*ndir))
{
- uint32 n;
+ uint32_t n;
for (n=*ndir; n>m; n--)
dir[n]=dir[n-1];
}
@@ -3053,11 +3043,11 @@ TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag
}
else
{
- uint64 na,nb;
+ uint64_t na,nb;
na=tif->tif_dataoff;
nb=na+datalength;
if (!(tif->tif_flags&TIFF_BIGTIFF))
- nb=(uint32)nb;
+ nb=(uint32_t)nb;
if ((nb<na)||(nb<datalength))
{
TIFFErrorExt(tif->tif_clientdata,module,"Maximum TIFF file size exceeded");
@@ -3079,8 +3069,8 @@ TIFFWriteDirectoryTagData(TIFF* tif, uint32* ndir, TIFFDirEntry* dir, uint16 tag
tif->tif_dataoff++;
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32 o;
- o=(uint32)na;
+ uint32_t o;
+ o=(uint32_t)na;
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong(&o);
_TIFFmemcpy(&dir[m].tdir_offset,&o,4);
@@ -3113,8 +3103,8 @@ TIFFLinkDirectory(TIFF* tif)
{
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32 m;
- m = (uint32)tif->tif_diroff;
+ uint32_t m;
+ m = (uint32_t)tif->tif_diroff;
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong(&m);
(void) TIFFSeekFile(tif, tif->tif_subifdoff, SEEK_SET);
@@ -3136,7 +3126,7 @@ TIFFLinkDirectory(TIFF* tif)
}
else
{
- uint64 m;
+ uint64_t m;
m = tif->tif_diroff;
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong8(&m);
@@ -3161,16 +3151,16 @@ TIFFLinkDirectory(TIFF* tif)
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32 m;
- uint32 nextdir;
- m = (uint32)(tif->tif_diroff);
+ uint32_t m;
+ uint32_t nextdir;
+ m = (uint32_t)(tif->tif_diroff);
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong(&m);
if (tif->tif_header.classic.tiff_diroff == 0) {
/*
* First directory, overwrite offset in header.
*/
- tif->tif_header.classic.tiff_diroff = (uint32) tif->tif_diroff;
+ tif->tif_header.classic.tiff_diroff = (uint32_t) tif->tif_diroff;
(void) TIFFSeekFile(tif,4, SEEK_SET);
if (!WriteOK(tif, &m, 4)) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
@@ -3184,8 +3174,8 @@ TIFFLinkDirectory(TIFF* tif)
*/
nextdir = tif->tif_header.classic.tiff_diroff;
while(1) {
- uint16 dircount;
- uint32 nextnextdir;
+ uint16_t dircount;
+ uint32_t nextnextdir;
if (!SeekOK(tif, nextdir) ||
!ReadOK(tif, &dircount, 2)) {
@@ -3220,8 +3210,8 @@ TIFFLinkDirectory(TIFF* tif)
}
else
{
- uint64 m;
- uint64 nextdir;
+ uint64_t m;
+ uint64_t nextdir;
m = tif->tif_diroff;
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong8(&m);
@@ -3243,9 +3233,9 @@ TIFFLinkDirectory(TIFF* tif)
*/
nextdir = tif->tif_header.big.tiff_diroff;
while(1) {
- uint64 dircount64;
- uint16 dircount;
- uint64 nextnextdir;
+ uint64_t dircount64;
+ uint16_t dircount;
+ uint64_t nextnextdir;
if (!SeekOK(tif, nextdir) ||
!ReadOK(tif, &dircount64, 8)) {
@@ -3261,7 +3251,7 @@ TIFFLinkDirectory(TIFF* tif)
"Sanity check on tag count failed, likely corrupt TIFF");
return (0);
}
- dircount=(uint16)dircount64;
+ dircount=(uint16_t)dircount64;
(void) TIFFSeekFile(tif,
nextdir+8+dircount*20, SEEK_SET);
if (!ReadOK(tif, &nextnextdir, 8)) {
@@ -3302,21 +3292,21 @@ TIFFLinkDirectory(TIFF* tif)
/************************************************************************/
int
-_TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
+_TIFFRewriteField(TIFF* tif, uint16_t tag, TIFFDataType in_datatype,
tmsize_t count, void* data)
{
static const char module[] = "TIFFResetField";
/* const TIFFField* fip = NULL; */
- uint16 dircount;
+ uint16_t dircount;
tmsize_t dirsize;
- uint8 direntry_raw[20];
- uint16 entry_tag = 0;
- uint16 entry_type = 0;
- uint64 entry_count = 0;
- uint64 entry_offset = 0;
+ uint8_t direntry_raw[20];
+ uint16_t entry_tag = 0;
+ uint16_t entry_type = 0;
+ uint64_t entry_count = 0;
+ uint64_t entry_offset = 0;
int value_in_entry = 0;
- uint64 read_offset;
- uint8 *buf_to_write = NULL;
+ uint64_t read_offset;
+ uint8_t *buf_to_write = NULL;
TIFFDataType datatype;
/* -------------------------------------------------------------------- */
@@ -3355,7 +3345,7 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- if (!ReadOK(tif, &dircount, sizeof (uint16))) {
+ if (!ReadOK(tif, &dircount, sizeof (uint16_t))) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: Can not read TIFF directory count",
tif->tif_name);
@@ -3366,8 +3356,8 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
dirsize = 12;
read_offset += 2;
} else {
- uint64 dircount64;
- if (!ReadOK(tif, &dircount64, sizeof (uint64))) {
+ uint64_t dircount64;
+ if (!ReadOK(tif, &dircount64, sizeof (uint64_t))) {
TIFFErrorExt(tif->tif_clientdata, module,
"%s: Can not read TIFF directory count",
tif->tif_name);
@@ -3375,7 +3365,7 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
}
if (tif->tif_flags & TIFF_SWAB)
TIFFSwabLong8(&dircount64);
- dircount = (uint16)dircount64;
+ dircount = (uint16_t)dircount64;
dirsize = 20;
read_offset += 8;
}
@@ -3392,7 +3382,7 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
return 0;
}
- memcpy( &entry_tag, direntry_raw + 0, sizeof(uint16) );
+ memcpy( &entry_tag, direntry_raw + 0, sizeof(uint16_t) );
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort( &entry_tag );
@@ -3405,7 +3395,7 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
if( entry_tag != tag )
{
TIFFErrorExt(tif->tif_clientdata, module,
- "%s: Could not find tag %d.",
+ "%s: Could not find tag %"PRIu16".",
tif->tif_name, tag );
return 0;
}
@@ -3413,31 +3403,31 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
/* -------------------------------------------------------------------- */
/* Extract the type, count and offset for this entry. */
/* -------------------------------------------------------------------- */
- memcpy( &entry_type, direntry_raw + 2, sizeof(uint16) );
+ memcpy( &entry_type, direntry_raw + 2, sizeof(uint16_t) );
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabShort( &entry_type );
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32 value;
+ uint32_t value;
- memcpy( &value, direntry_raw + 4, sizeof(uint32) );
+ memcpy( &value, direntry_raw + 4, sizeof(uint32_t) );
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong( &value );
entry_count = value;
- memcpy( &value, direntry_raw + 8, sizeof(uint32) );
+ memcpy( &value, direntry_raw + 8, sizeof(uint32_t) );
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong( &value );
entry_offset = value;
}
else
{
- memcpy( &entry_count, direntry_raw + 4, sizeof(uint64) );
+ memcpy( &entry_count, direntry_raw + 4, sizeof(uint64_t) );
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8( &entry_count );
- memcpy( &entry_offset, direntry_raw + 12, sizeof(uint64) );
+ memcpy( &entry_offset, direntry_raw + 12, sizeof(uint64_t) );
if (tif->tif_flags&TIFF_SWAB)
TIFFSwabLong8( &entry_offset );
}
@@ -3524,8 +3514,8 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
/* swabbing as needed. */
/* -------------------------------------------------------------------- */
buf_to_write =
- (uint8 *)_TIFFCheckMalloc(tif, count, TIFFDataWidth(datatype),
- "for field buffer.");
+ (uint8_t *)_TIFFCheckMalloc(tif, count, TIFFDataWidth(datatype),
+ "for field buffer.");
if (!buf_to_write)
return 0;
@@ -3537,9 +3527,9 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
for( i = 0; i < count; i++ )
{
- ((int32 *) buf_to_write)[i] =
- (int32) ((int64 *) data)[i];
- if( (int64) ((int32 *) buf_to_write)[i] != ((int64 *) data)[i] )
+ ((int32_t *) buf_to_write)[i] =
+ (int32_t) ((int64_t *) data)[i];
+ if((int64_t) ((int32_t *) buf_to_write)[i] != ((int64_t *) data)[i] )
{
_TIFFfree( buf_to_write );
TIFFErrorExt( tif->tif_clientdata, module,
@@ -3555,9 +3545,9 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
for( i = 0; i < count; i++ )
{
- ((uint32 *) buf_to_write)[i] =
- (uint32) ((uint64 *) data)[i];
- if( (uint64) ((uint32 *) buf_to_write)[i] != ((uint64 *) data)[i] )
+ ((uint32_t *) buf_to_write)[i] =
+ (uint32_t) ((uint64_t *) data)[i];
+ if((uint64_t) ((uint32_t *) buf_to_write)[i] != ((uint64_t *) data)[i] )
{
_TIFFfree( buf_to_write );
TIFFErrorExt( tif->tif_clientdata, module,
@@ -3572,9 +3562,9 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
for( i = 0; i < count; i++ )
{
- ((uint16 *) buf_to_write)[i] =
- (uint16) ((uint64 *) data)[i];
- if( (uint64) ((uint16 *) buf_to_write)[i] != ((uint64 *) data)[i] )
+ ((uint16_t *) buf_to_write)[i] =
+ (uint16_t) ((uint64_t *) data)[i];
+ if((uint64_t) ((uint16_t *) buf_to_write)[i] != ((uint64_t *) data)[i] )
{
_TIFFfree( buf_to_write );
TIFFErrorExt( tif->tif_clientdata, module,
@@ -3593,11 +3583,11 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
if( TIFFDataWidth(datatype) > 1 && (tif->tif_flags&TIFF_SWAB) )
{
if( TIFFDataWidth(datatype) == 2 )
- TIFFSwabArrayOfShort( (uint16 *) buf_to_write, count );
+ TIFFSwabArrayOfShort((uint16_t *) buf_to_write, count );
else if( TIFFDataWidth(datatype) == 4 )
- TIFFSwabArrayOfLong( (uint32 *) buf_to_write, count );
+ TIFFSwabArrayOfLong((uint32_t *) buf_to_write, count );
else if( TIFFDataWidth(datatype) == 8 )
- TIFFSwabArrayOfLong8( (uint64 *) buf_to_write, count );
+ TIFFSwabArrayOfLong8((uint64_t *) buf_to_write, count );
}
/* -------------------------------------------------------------------- */
@@ -3642,7 +3632,7 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
/* over the old values without altering the directory entry at */
/* all. */
/* -------------------------------------------------------------------- */
- if( entry_count == (uint64)count && entry_type == (uint16) datatype )
+ if( entry_count == (uint64_t)count && entry_type == (uint16_t) datatype )
{
if (!SeekOK(tif, entry_offset)) {
_TIFFfree( buf_to_write );
@@ -3688,34 +3678,34 @@ _TIFFRewriteField(TIFF* tif, uint16 tag, TIFFDataType in_datatype,
/* Adjust the directory entry. */
/* -------------------------------------------------------------------- */
entry_type = datatype;
- entry_count = (uint64)count;
- memcpy( direntry_raw + 2, &entry_type, sizeof(uint16) );
+ entry_count = (uint64_t)count;
+ memcpy( direntry_raw + 2, &entry_type, sizeof(uint16_t) );
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabShort( (uint16 *) (direntry_raw + 2) );
+ TIFFSwabShort( (uint16_t *) (direntry_raw + 2) );
if (!(tif->tif_flags&TIFF_BIGTIFF))
{
- uint32 value;
+ uint32_t value;
- value = (uint32) entry_count;
- memcpy( direntry_raw + 4, &value, sizeof(uint32) );
+ value = (uint32_t) entry_count;
+ memcpy( direntry_raw + 4, &value, sizeof(uint32_t) );
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong( (uint32 *) (direntry_raw + 4) );
+ TIFFSwabLong( (uint32_t *) (direntry_raw + 4) );
- value = (uint32) entry_offset;
- memcpy( direntry_raw + 8, &value, sizeof(uint32) );
+ value = (uint32_t) entry_offset;
+ memcpy( direntry_raw + 8, &value, sizeof(uint32_t) );
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong( (uint32 *) (direntry_raw + 8) );
+ TIFFSwabLong( (uint32_t *) (direntry_raw + 8) );
}
else
{
- memcpy( direntry_raw + 4, &entry_count, sizeof(uint64) );
+ memcpy( direntry_raw + 4, &entry_count, sizeof(uint64_t) );
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8( (uint64 *) (direntry_raw + 4) );
+ TIFFSwabLong8( (uint64_t *) (direntry_raw + 4) );
- memcpy( direntry_raw + 12, &entry_offset, sizeof(uint64) );
+ memcpy( direntry_raw + 12, &entry_offset, sizeof(uint64_t) );
if (tif->tif_flags&TIFF_SWAB)
- TIFFSwabLong8( (uint64 *) (direntry_raw + 12) );
+ TIFFSwabLong8( (uint64_t *) (direntry_raw + 12) );
}
/* -------------------------------------------------------------------- */
diff --git a/tiff/libtiff/tif_dumpmode.c b/tiff/libtiff/tif_dumpmode.c
index 4a0b07f5..f1d3c4ad 100644
--- a/tiff/libtiff/tif_dumpmode.c
+++ b/tiff/libtiff/tif_dumpmode.c
@@ -40,7 +40,7 @@ DumpFixupTags(TIFF* tif)
* Encode a hunk of pixels.
*/
static int
-DumpModeEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
+DumpModeEncode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s)
{
(void) s;
while (cc > 0) {
@@ -73,24 +73,16 @@ DumpModeEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s)
* Decode a hunk of pixels.
*/
static int
-DumpModeDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+DumpModeDecode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
static const char module[] = "DumpModeDecode";
(void) s;
if (tif->tif_rawcc < cc) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
-"Not enough data for scanline %lu, expected a request for at most %I64d bytes, got a request for %I64d bytes",
- (unsigned long) tif->tif_row,
- (signed __int64) tif->tif_rawcc,
- (signed __int64) cc);
-#else
- TIFFErrorExt(tif->tif_clientdata, module,
-"Not enough data for scanline %lu, expected a request for at most %lld bytes, got a request for %lld bytes",
- (unsigned long) tif->tif_row,
- (signed long long) tif->tif_rawcc,
- (signed long long) cc);
-#endif
+"Not enough data for scanline %"PRIu32", expected a request for at most %"TIFF_SSIZE_FORMAT" bytes, got a request for %"TIFF_SSIZE_FORMAT" bytes",
+ tif->tif_row,
+ tif->tif_rawcc,
+ cc);
return (0);
}
/*
@@ -108,7 +100,7 @@ DumpModeDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
* Seek forwards nrows in the current strip.
*/
static int
-DumpModeSeek(TIFF* tif, uint32 nrows)
+DumpModeSeek(TIFF* tif, uint32_t nrows)
{
tif->tif_rawcp += nrows * tif->tif_scanlinesize;
tif->tif_rawcc -= nrows * tif->tif_scanlinesize;
diff --git a/tiff/libtiff/tif_extension.c b/tiff/libtiff/tif_extension.c
index 87d3cfcb..9d46d3ea 100644
--- a/tiff/libtiff/tif_extension.c
+++ b/tiff/libtiff/tif_extension.c
@@ -39,13 +39,13 @@ int TIFFGetTagListCount( TIFF *tif )
return td->td_customValueCount;
}
-uint32 TIFFGetTagListEntry( TIFF *tif, int tag_index )
+uint32_t TIFFGetTagListEntry(TIFF *tif, int tag_index )
{
TIFFDirectory* td = &tif->tif_dir;
if( tag_index < 0 || tag_index >= td->td_customValueCount )
- return (uint32)(-1);
+ return (uint32_t)(-1);
else
return td->td_customValues[tag_index].info->field_tag;
}
diff --git a/tiff/libtiff/tif_fax3.c b/tiff/libtiff/tif_fax3.c
index 9ab5b26a..f68e83a2 100644
--- a/tiff/libtiff/tif_fax3.c
+++ b/tiff/libtiff/tif_fax3.c
@@ -49,12 +49,12 @@ typedef struct {
int rw_mode; /* O_RDONLY for decode, else encode */
int mode; /* operating mode */
tmsize_t rowbytes; /* bytes in a decoded scanline */
- uint32 rowpixels; /* pixels in a scanline */
+ uint32_t rowpixels; /* pixels in a scanline */
- uint16 cleanfaxdata; /* CleanFaxData tag */
- uint32 badfaxrun; /* BadFaxRun tag */
- uint32 badfaxlines; /* BadFaxLines tag */
- uint32 groupoptions; /* Group 3/4 options tag */
+ uint16_t cleanfaxdata; /* CleanFaxData tag */
+ uint32_t badfaxrun; /* BadFaxRun tag */
+ uint32_t badfaxlines; /* BadFaxLines tag */
+ uint32_t groupoptions; /* Group 3/4 options tag */
TIFFVGetMethod vgetparent; /* super-class method */
TIFFVSetMethod vsetparent; /* super-class method */
@@ -68,14 +68,14 @@ typedef struct {
/* Decoder state info */
const unsigned char* bitmap; /* bit reversal table */
- uint32 data; /* current i/o byte/word */
+ uint32_t data; /* current i/o byte/word */
int bit; /* current i/o bit in byte */
int EOLcnt; /* count of EOL codes recognized */
TIFFFaxFillFunc fill; /* fill routine */
- uint32* runs; /* b&w runs for current/previous row */
- uint32 nruns; /* size of the refruns / curruns arrays */
- uint32* refruns; /* runs for reference line */
- uint32* curruns; /* runs for current line */
+ uint32_t* runs; /* b&w runs for current/previous row */
+ uint32_t nruns; /* size of the refruns / curruns arrays */
+ uint32_t* refruns; /* runs for reference line */
+ uint32_t* curruns; /* runs for current line */
/* Encoder state info */
Ttag tag; /* encoding state */
@@ -104,20 +104,20 @@ typedef struct {
Fax3CodecState* sp = DecoderState(tif); \
int a0; /* reference element */ \
int lastx = sp->b.rowpixels; /* last element in row */ \
- uint32 BitAcc; /* bit accumulator */ \
+ uint32_t BitAcc; /* bit accumulator */ \
int BitsAvail; /* # valid bits in BitAcc */ \
int RunLength; /* length of current run */ \
unsigned char* cp; /* next byte of input data */ \
unsigned char* ep; /* end of input data */ \
- uint32* pa; /* place to stuff next run */ \
- uint32* thisrun; /* current row's run array */ \
+ uint32_t* pa; /* place to stuff next run */ \
+ uint32_t* thisrun; /* current row's run array */ \
int EOLcnt; /* # EOL codes recognized */ \
const unsigned char* bitmap = sp->bitmap; /* input data bit reverser */ \
const TIFFFaxTabEnt* TabEnt
#define DECLARE_STATE_2D(tif, sp, mod) \
DECLARE_STATE(tif, sp, mod); \
int b1; /* next change on prev line */ \
- uint32* pb /* next run in reference line */\
+ uint32_t* pb /* next run in reference line */\
/*
* Load any state that may be changed during decoding.
*/
@@ -135,15 +135,15 @@ typedef struct {
sp->bit = BitsAvail; \
sp->data = BitAcc; \
sp->EOLcnt = EOLcnt; \
- tif->tif_rawcc -= (tmsize_t)((uint8*) cp - tif->tif_rawcp); \
- tif->tif_rawcp = (uint8*) cp; \
+ tif->tif_rawcc -= (tmsize_t)((uint8_t*) cp - tif->tif_rawcp); \
+ tif->tif_rawcp = (uint8_t*) cp; \
} while (0)
/*
* Setup state for decoding a strip.
*/
static int
-Fax3PreDecode(TIFF* tif, uint16 s)
+Fax3PreDecode(TIFF* tif, uint16_t s)
{
Fax3CodecState* sp = DecoderState(tif);
@@ -164,7 +164,7 @@ Fax3PreDecode(TIFF* tif, uint16 s)
sp->curruns = sp->runs;
if (sp->refruns) { /* init reference line to white */
sp->refruns = sp->runs + sp->nruns;
- sp->refruns[0] = (uint32) sp->b.rowpixels;
+ sp->refruns[0] = (uint32_t) sp->b.rowpixels;
sp->refruns[1] = 0;
}
sp->line = 0;
@@ -178,9 +178,9 @@ Fax3PreDecode(TIFF* tif, uint16 s)
*/
static void
-Fax3Unexpected(const char* module, TIFF* tif, uint32 line, uint32 a0)
+Fax3Unexpected(const char* module, TIFF* tif, uint32_t line, uint32_t a0)
{
- TIFFErrorExt(tif->tif_clientdata, module, "Bad code word at line %u of %s %u (x %u)",
+ TIFFErrorExt(tif->tif_clientdata, module, "Bad code word at line %"PRIu32" of %s %"PRIu32" (x %"PRIu32")",
line, isTiled(tif) ? "tile" : "strip",
(isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
a0);
@@ -188,10 +188,10 @@ Fax3Unexpected(const char* module, TIFF* tif, uint32 line, uint32 a0)
#define unexpected(table, a0) Fax3Unexpected(module, tif, sp->line, a0)
static void
-Fax3Extension(const char* module, TIFF* tif, uint32 line, uint32 a0)
+Fax3Extension(const char* module, TIFF* tif, uint32_t line, uint32_t a0)
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Uncompressed data (not supported) at line %u of %s %u (x %u)",
+ "Uncompressed data (not supported) at line %"PRIu32" of %s %"PRIu32" (x %"PRIu32")",
line, isTiled(tif) ? "tile" : "strip",
(isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
a0);
@@ -199,9 +199,9 @@ Fax3Extension(const char* module, TIFF* tif, uint32 line, uint32 a0)
#define extension(a0) Fax3Extension(module, tif, sp->line, a0)
static void
-Fax3BadLength(const char* module, TIFF* tif, uint32 line, uint32 a0, uint32 lastx)
+Fax3BadLength(const char* module, TIFF* tif, uint32_t line, uint32_t a0, uint32_t lastx)
{
- TIFFWarningExt(tif->tif_clientdata, module, "%s at line %u of %s %u (got %u, expected %u)",
+ TIFFWarningExt(tif->tif_clientdata, module, "%s at line %"PRIu32" of %s %"PRIu32" (got %"PRIu32", expected %"PRIu32")",
a0 < lastx ? "Premature EOL" : "Line length mismatch",
line, isTiled(tif) ? "tile" : "strip",
(isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
@@ -210,9 +210,9 @@ Fax3BadLength(const char* module, TIFF* tif, uint32 line, uint32 a0, uint32 last
#define badlength(a0,lastx) Fax3BadLength(module, tif, sp->line, a0, lastx)
static void
-Fax3PrematureEOF(const char* module, TIFF* tif, uint32 line, uint32 a0)
+Fax3PrematureEOF(const char* module, TIFF* tif, uint32_t line, uint32_t a0)
{
- TIFFWarningExt(tif->tif_clientdata, module, "Premature EOF at line %u of %s %u (x %u)",
+ TIFFWarningExt(tif->tif_clientdata, module, "Premature EOF at line %"PRIu32" of %s %"PRIu32" (x %"PRIu32")",
line, isTiled(tif) ? "tile" : "strip",
(isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip),
a0);
@@ -229,7 +229,7 @@ Fax3PrematureEOF(const char* module, TIFF* tif, uint32 line, uint32 a0)
* @returns 1 for success, -1 in case of error
*/
static int
-Fax3Decode1D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
+Fax3Decode1D(TIFF* tif, uint8_t* buf, tmsize_t occ, uint16_t s)
{
DECLARE_STATE(tif, sp, "Fax3Decode1D");
(void) s;
@@ -245,8 +245,8 @@ Fax3Decode1D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
RunLength = 0;
pa = thisrun;
#ifdef FAX3_DEBUG
- printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail);
- printf("-------------------- %d\n", tif->tif_row);
+ printf("\nBitAcc=%08"PRIX32", BitsAvail = %d\n", BitAcc, BitsAvail);
+ printf("-------------------- %"PRIu32"\n", tif->tif_row);
fflush(stdout);
#endif
SYNC_EOL(EOF1D);
@@ -272,7 +272,7 @@ Fax3Decode1D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
* Decode the requested amount of G3 2D-encoded data.
*/
static int
-Fax3Decode2D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
+Fax3Decode2D(TIFF* tif, uint8_t* buf, tmsize_t occ, uint16_t s)
{
DECLARE_STATE_2D(tif, sp, "Fax3Decode2D");
int is1D; /* current line is 1d/2d-encoded */
@@ -288,7 +288,7 @@ Fax3Decode2D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
RunLength = 0;
pa = thisrun = sp->curruns;
#ifdef FAX3_DEBUG
- printf("\nBitAcc=%08X, BitsAvail = %d EOLcnt = %d",
+ printf("\nBitAcc=%08"PRIX32", BitsAvail = %d EOLcnt = %d",
BitAcc, BitsAvail, EOLcnt);
#endif
SYNC_EOL(EOF2D);
@@ -296,7 +296,7 @@ Fax3Decode2D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
is1D = GetBits(1); /* 1D/2D-encoding tag bit */
ClrBits(1);
#ifdef FAX3_DEBUG
- printf(" %s\n-------------------- %d\n",
+ printf(" %s\n-------------------- %"PRIu32"\n",
is1D ? "1D" : "2D", tif->tif_row);
fflush(stdout);
#endif
@@ -310,7 +310,7 @@ Fax3Decode2D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
if (pa < thisrun + sp->nruns) {
SETVALUE(0); /* imaginary change for reference */
}
- SWAP(uint32*, sp->curruns, sp->refruns);
+ SWAP(uint32_t*, sp->curruns, sp->refruns);
buf += sp->b.rowbytes;
occ -= sp->b.rowbytes;
sp->line++;
@@ -327,89 +327,38 @@ Fax3Decode2D(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
}
#undef SWAP
-/*
- * The ZERO & FILL macros must handle spans < 2*sizeof(long) bytes.
- * For machines with 64-bit longs this is <16 bytes; otherwise
- * this is <8 bytes. We optimize the code here to reflect the
- * machine characteristics.
- */
-#if SIZEOF_UNSIGNED_LONG == 8
-# define FILL(n, cp) \
- switch (n) { \
- case 15:(cp)[14] = 0xff; /*-fallthrough*/ \
- case 14:(cp)[13] = 0xff; /*-fallthrough*/ \
- case 13:(cp)[12] = 0xff; /*-fallthrough*/ \
- case 12:(cp)[11] = 0xff; /*-fallthrough*/ \
- case 11:(cp)[10] = 0xff; /*-fallthrough*/ \
- case 10: (cp)[9] = 0xff; /*-fallthrough*/ \
- case 9: (cp)[8] = 0xff; /*-fallthrough*/ \
- case 8: (cp)[7] = 0xff; /*-fallthrough*/ \
- case 7: (cp)[6] = 0xff; /*-fallthrough*/ \
- case 6: (cp)[5] = 0xff; /*-fallthrough*/ \
- case 5: (cp)[4] = 0xff; /*-fallthrough*/ \
- case 4: (cp)[3] = 0xff; /*-fallthrough*/ \
- case 3: (cp)[2] = 0xff; /*-fallthrough*/ \
- case 2: (cp)[1] = 0xff; /*-fallthrough*/ \
- case 1: (cp)[0] = 0xff; (cp) += (n); /*-fallthrough*/ \
- case 0: ; \
- }
-# define ZERO(n, cp) \
- switch (n) { \
- case 15:(cp)[14] = 0; /*-fallthrough*/ \
- case 14:(cp)[13] = 0; /*-fallthrough*/ \
- case 13:(cp)[12] = 0; /*-fallthrough*/ \
- case 12:(cp)[11] = 0; /*-fallthrough*/ \
- case 11:(cp)[10] = 0; /*-fallthrough*/ \
- case 10: (cp)[9] = 0; /*-fallthrough*/ \
- case 9: (cp)[8] = 0; /*-fallthrough*/ \
- case 8: (cp)[7] = 0; /*-fallthrough*/ \
- case 7: (cp)[6] = 0; /*-fallthrough*/ \
- case 6: (cp)[5] = 0; /*-fallthrough*/ \
- case 5: (cp)[4] = 0; /*-fallthrough*/ \
- case 4: (cp)[3] = 0; /*-fallthrough*/ \
- case 3: (cp)[2] = 0; /*-fallthrough*/ \
- case 2: (cp)[1] = 0; /*-fallthrough*/ \
- case 1: (cp)[0] = 0; (cp) += (n); /*-fallthrough*/ \
- case 0: ; \
+# define FILL(n, cp) \
+ { \
+ int32_t ifill;\
+ for (ifill = 0; ifill < (n); ++ifill) \
+ { \
+ (cp)[ifill] = 0xff; \
+ } \
+ (cp) += (n);\
}
-#else
-# define FILL(n, cp) \
- switch (n) { \
- case 7: (cp)[6] = 0xff; /*-fallthrough*/ \
- case 6: (cp)[5] = 0xff; /*-fallthrough*/ \
- case 5: (cp)[4] = 0xff; /*-fallthrough*/ \
- case 4: (cp)[3] = 0xff; /*-fallthrough*/ \
- case 3: (cp)[2] = 0xff; /*-fallthrough*/ \
- case 2: (cp)[1] = 0xff; /*-fallthrough*/ \
- case 1: (cp)[0] = 0xff; (cp) += (n); /*-fallthrough*/ \
- case 0: ; \
- }
-# define ZERO(n, cp) \
- switch (n) { \
- case 7: (cp)[6] = 0; /*-fallthrough*/ \
- case 6: (cp)[5] = 0; /*-fallthrough*/ \
- case 5: (cp)[4] = 0; /*-fallthrough*/ \
- case 4: (cp)[3] = 0; /*-fallthrough*/ \
- case 3: (cp)[2] = 0; /*-fallthrough*/ \
- case 2: (cp)[1] = 0; /*-fallthrough*/ \
- case 1: (cp)[0] = 0; (cp) += (n); /*-fallthrough*/ \
- case 0: ; \
- }
-#endif
+# define ZERO(n, cp) \
+ {\
+ int32_t izero; \
+ for (izero = 0; izero < (n); ++izero) \
+ { \
+ (cp)[izero] = 0; \
+ } \
+ (cp) += (n);\
+ }
/*
* Bit-fill a row according to the white/black
* runs generated during G3/G4 decoding.
*/
void
-_TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
+_TIFFFax3fillruns(unsigned char* buf, uint32_t* runs, uint32_t* erun, uint32_t lastx)
{
static const unsigned char _fillmasks[] =
{ 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff };
unsigned char* cp;
- uint32 x, bx, run;
- int32 n, nw;
- long* lp;
+ uint32_t x, bx, run;
+ int32_t n, nw;
+ int64_t* lp;
if ((erun-runs)&1)
*erun++ = 0;
@@ -417,7 +366,7 @@ _TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
for (; runs < erun; runs += 2) {
run = runs[0];
if (x+run > lastx || run > lastx )
- run = runs[0] = (uint32) (lastx - x);
+ run = runs[0] = (uint32_t) (lastx - x);
if (run) {
cp = buf + (x>>3);
bx = x&7;
@@ -427,15 +376,15 @@ _TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
run -= 8-bx;
}
if( (n = run >> 3) != 0 ) { /* multiple bytes to fill */
- if ((n/sizeof (long)) > 1) {
+ if ((n/sizeof (int64_t)) > 1) {
/*
- * Align to longword boundary and fill.
+ * Align to int64_tword boundary and fill.
*/
- for (; n && !isAligned(cp, long); n--)
+ for (; n && !isAligned(cp, int64_t); n--)
*cp++ = 0x00;
- lp = (long*) cp;
- nw = (int32)(n / sizeof (long));
- n -= nw * sizeof (long);
+ lp = (int64_t*) cp;
+ nw = (int32_t)(n / sizeof (int64_t));
+ n -= nw * sizeof (int64_t);
do {
*lp++ = 0L;
} while (--nw);
@@ -462,15 +411,15 @@ _TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
run -= 8-bx;
}
if( (n = run>>3) != 0 ) { /* multiple bytes to fill */
- if ((n/sizeof (long)) > 1) {
+ if ((n/sizeof (int64_t)) > 1) {
/*
- * Align to longword boundary and fill.
+ * Align to int64_t boundary and fill.
*/
- for (; n && !isAligned(cp, long); n--)
+ for (; n && !isAligned(cp, int64_t); n--)
*cp++ = 0xff;
- lp = (long*) cp;
- nw = (int32)(n / sizeof (long));
- n -= nw * sizeof (long);
+ lp = (int64_t*) cp;
+ nw = (int32_t)(n / sizeof (int64_t));
+ n -= nw * sizeof (int64_t);
do {
*lp++ = -1L;
} while (--nw);
@@ -515,7 +464,7 @@ Fax3SetupState(TIFF* tif)
int needsRefLine;
Fax3CodecState* dsp = (Fax3CodecState*) Fax3State(tif);
tmsize_t rowbytes;
- uint32 rowpixels;
+ uint32_t rowpixels;
if (td->td_bitspersample != 1) {
TIFFErrorExt(tif->tif_clientdata, module,
@@ -532,11 +481,11 @@ Fax3SetupState(TIFF* tif)
rowbytes = TIFFScanlineSize(tif);
rowpixels = td->td_imagewidth;
}
- if ((uint64)rowbytes < ((uint64)rowpixels + 7) / 8)
+ if ((int64_t)rowbytes < ((int64_t)rowpixels + 7) / 8)
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Inconsistent number of bytes per row : rowbytes=%lu rowpixels=%lu",
- (unsigned long)(rowbytes), (unsigned long)(rowpixels));
+ "Inconsistent number of bytes per row : rowbytes=%" PRId64 " rowpixels=%" PRIu32,
+ (int64_t) rowbytes, rowpixels);
return (0);
}
sp->rowbytes = rowbytes;
@@ -554,24 +503,24 @@ Fax3SetupState(TIFF* tif)
TIFFroundup and TIFFSafeMultiply return zero on integer overflow
*/
- dsp->runs=(uint32*) NULL;
+ dsp->runs=(uint32_t*) NULL;
dsp->nruns = TIFFroundup_32(rowpixels,32);
if (needsRefLine) {
- dsp->nruns = TIFFSafeMultiply(uint32,dsp->nruns,2);
+ dsp->nruns = TIFFSafeMultiply(uint32_t, dsp->nruns, 2);
}
- if ((dsp->nruns == 0) || (TIFFSafeMultiply(uint32,dsp->nruns,2) == 0)) {
+ if ((dsp->nruns == 0) || (TIFFSafeMultiply(uint32_t, dsp->nruns, 2) == 0)) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "Row pixels integer overflow (rowpixels %u)",
+ "Row pixels integer overflow (rowpixels %"PRIu32")",
rowpixels);
return (0);
}
- dsp->runs = (uint32*) _TIFFCheckMalloc(tif,
- TIFFSafeMultiply(uint32,dsp->nruns,2),
- sizeof (uint32),
- "for Group 3/4 run arrays");
+ dsp->runs = (uint32_t*) _TIFFCheckMalloc(tif,
+ TIFFSafeMultiply(uint32_t, dsp->nruns, 2),
+ sizeof (uint32_t),
+ "for Group 3/4 run arrays");
if (dsp->runs == NULL)
return (0);
- memset( dsp->runs, 0, TIFFSafeMultiply(uint32,dsp->nruns,2)*sizeof(uint32));
+ memset( dsp->runs, 0, TIFFSafeMultiply(uint32_t,dsp->nruns,2)*sizeof(uint32_t));
dsp->curruns = dsp->runs;
if (needsRefLine)
dsp->refruns = dsp->runs + dsp->nruns;
@@ -614,7 +563,7 @@ Fax3SetupState(TIFF* tif)
if( !TIFFFlushData1(tif) ) \
return 0; \
} \
- *(tif)->tif_rawcp++ = (uint8) (sp)->data; \
+ *(tif)->tif_rawcp++ = (uint8_t) (sp)->data; \
(tif)->tif_rawcc++; \
(sp)->data = 0, (sp)->bit = 8; \
}
@@ -623,7 +572,7 @@ Fax3SetupState(TIFF* tif)
if( !TIFFFlushData1(tif) ) \
return 0; \
} \
- *(tif)->tif_rawcp++ = (uint8) data; \
+ *(tif)->tif_rawcp++ = (uint8_t) data; \
(tif)->tif_rawcc++; \
data = 0, bit = 8; \
}
@@ -670,7 +619,7 @@ Fax3PutBits(TIFF* tif, unsigned int bits, unsigned int length)
#define DEBUG_COLOR(w) (tab == TIFFFaxWhiteCodes ? w "W" : w "B")
#define DEBUG_PRINT(what,len) { \
int t; \
- printf("%08X/%-2d: %s%5d\t", data, bit, DEBUG_COLOR(what), len); \
+ printf("%08"PRIX32"/%-2d: %s%5d\t", data, bit, DEBUG_COLOR(what), len); \
for (t = length-1; t >= 0; t--) \
putchar(code & (1<<t) ? '1' : '0'); \
putchar('\n'); \
@@ -684,7 +633,7 @@ Fax3PutBits(TIFF* tif, unsigned int bits, unsigned int length)
* terminating codes is supplied.
*/
static int
-putspan(TIFF* tif, int32 span, const tableentry* tab)
+putspan(TIFF* tif, int32_t span, const tableentry* tab)
{
Fax3CodecState* sp = EncoderState(tif);
unsigned int bit = sp->bit;
@@ -773,7 +722,7 @@ Fax3PutEOL(TIFF* tif)
* Reset encoding state at the start of a strip.
*/
static int
-Fax3PreEncode(TIFF* tif, uint16 s)
+Fax3PreEncode(TIFF* tif, uint16_t s)
{
Fax3CodecState* sp = EncoderState(tif);
@@ -849,25 +798,15 @@ static const unsigned char oneruns[256] = {
};
/*
- * On certain systems it pays to inline
- * the routines that find pixel spans.
- */
-#ifdef VAXC
-static int32 find0span(unsigned char*, int32, int32);
-static int32 find1span(unsigned char*, int32, int32);
-#pragma inline(find0span,find1span)
-#endif
-
-/*
* Find a span of ones or zeros using the supplied
* table. The ``base'' of the bit string is supplied
* along with the start+end bit indices.
*/
-inline static int32
-find0span(unsigned char* bp, int32 bs, int32 be)
+static inline int32_t
+find0span(unsigned char* bp, int32_t bs, int32_t be)
{
- int32 bits = be - bs;
- int32 n, span;
+ int32_t bits = be - bs;
+ int32_t n, span;
bp += bs>>3;
/*
@@ -885,22 +824,22 @@ find0span(unsigned char* bp, int32 bs, int32 be)
bp++;
} else
span = 0;
- if (bits >= (int32)(2 * 8 * sizeof(long))) {
- long* lp;
+ if (bits >= (int32_t)(2 * 8 * sizeof(int64_t))) {
+ int64_t* lp;
/*
- * Align to longword boundary and check longwords.
+ * Align to int64_t boundary and check int64_t words.
*/
- while (!isAligned(bp, long)) {
+ while (!isAligned(bp, int64_t)) {
if (*bp != 0x00)
return (span + zeroruns[*bp]);
span += 8;
bits -= 8;
bp++;
}
- lp = (long*) bp;
- while ((bits >= (int32)(8 * sizeof(long))) && (0 == *lp)) {
- span += 8*sizeof (long);
- bits -= 8*sizeof (long);
+ lp = (int64_t*) bp;
+ while ((bits >= (int32_t)(8 * sizeof(int64_t))) && (0 == *lp)) {
+ span += 8*sizeof (int64_t);
+ bits -= 8*sizeof (int64_t);
lp++;
}
bp = (unsigned char*) lp;
@@ -925,11 +864,11 @@ find0span(unsigned char* bp, int32 bs, int32 be)
return (span);
}
-inline static int32
-find1span(unsigned char* bp, int32 bs, int32 be)
+static inline int32_t
+find1span(unsigned char* bp, int32_t bs, int32_t be)
{
- int32 bits = be - bs;
- int32 n, span;
+ int32_t bits = be - bs;
+ int32_t n, span;
bp += bs>>3;
/*
@@ -947,22 +886,22 @@ find1span(unsigned char* bp, int32 bs, int32 be)
bp++;
} else
span = 0;
- if (bits >= (int32)(2 * 8 * sizeof(long))) {
- long* lp;
+ if (bits >= (int32_t)(2 * 8 * sizeof(int64_t))) {
+ int64_t* lp;
/*
- * Align to longword boundary and check longwords.
+ * Align to int64_t boundary and check int64_t words.
*/
- while (!isAligned(bp, long)) {
+ while (!isAligned(bp, int64_t)) {
if (*bp != 0xff)
return (span + oneruns[*bp]);
span += 8;
bits -= 8;
bp++;
}
- lp = (long*) bp;
- while ((bits >= (int32)(8 * sizeof(long))) && (~0 == *lp)) {
- span += 8*sizeof (long);
- bits -= 8*sizeof (long);
+ lp = (int64_t*) bp;
+ while ((bits >= (int32_t)(8 * sizeof(int64_t))) && (~((uint64_t)0) == (uint64_t)*lp)) {
+ span += 8*sizeof (int64_t);
+ bits -= 8*sizeof (int64_t);
lp++;
}
bp = (unsigned char*) lp;
@@ -1008,11 +947,11 @@ find1span(unsigned char* bp, int32 bs, int32 be)
* of pixels encoded with Huffman codes.
*/
static int
-Fax3Encode1DRow(TIFF* tif, unsigned char* bp, uint32 bits)
+Fax3Encode1DRow(TIFF* tif, unsigned char* bp, uint32_t bits)
{
Fax3CodecState* sp = EncoderState(tif);
- int32 span;
- uint32 bs = 0;
+ int32_t span;
+ uint32_t bs = 0;
for (;;) {
span = find0span(bp, bs, bits); /* white span */
@@ -1032,7 +971,7 @@ Fax3Encode1DRow(TIFF* tif, unsigned char* bp, uint32 bits)
if (sp->bit != 8) /* byte-align */
Fax3FlushBits(tif, sp);
if ((sp->b.mode&FAXMODE_WORDALIGN) &&
- !isAligned(tif->tif_rawcp, uint16))
+ !isAligned(tif->tif_rawcp, uint16_t))
Fax3FlushBits(tif, sp);
}
return (1);
@@ -1057,22 +996,22 @@ static const tableentry vcodes[7] = {
* documentation for the algorithm.
*/
static int
-Fax3Encode2DRow(TIFF* tif, unsigned char* bp, unsigned char* rp, uint32 bits)
+Fax3Encode2DRow(TIFF* tif, unsigned char* bp, unsigned char* rp, uint32_t bits)
{
#define PIXEL(buf,ix) ((((buf)[(ix)>>3]) >> (7-((ix)&7))) & 1)
- uint32 a0 = 0;
- uint32 a1 = (PIXEL(bp, 0) != 0 ? 0 : finddiff(bp, 0, bits, 0));
- uint32 b1 = (PIXEL(rp, 0) != 0 ? 0 : finddiff(rp, 0, bits, 0));
- uint32 a2, b2;
+ uint32_t a0 = 0;
+ uint32_t a1 = (PIXEL(bp, 0) != 0 ? 0 : finddiff(bp, 0, bits, 0));
+ uint32_t b1 = (PIXEL(rp, 0) != 0 ? 0 : finddiff(rp, 0, bits, 0));
+ uint32_t a2, b2;
for (;;) {
b2 = finddiff2(rp, b1, bits, PIXEL(rp,b1));
if (b2 >= a1) {
/* Naive computation triggers -fsanitize=undefined,unsigned-integer-overflow */
/* although it is correct unless the difference between both is < 31 bit */
- /* int32 d = b1 - a1; */
- int32 d = (b1 >= a1 && b1 - a1 <= 3U) ? (int32)(b1 - a1):
- (b1 < a1 && a1 - b1 <= 3U) ? -(int32)(a1 - b1) : 0x7FFFFFFF;
+ /* int32_t d = b1 - a1; */
+ int32_t d = (b1 >= a1 && b1 - a1 <= 3U) ? (int32_t)(b1 - a1) :
+ (b1 < a1 && a1 - b1 <= 3U) ? -(int32_t)(a1 - b1) : 0x7FFFFFFF;
if (!(-3 <= d && d <= 3)) { /* horizontal mode */
a2 = finddiff2(bp, a1, bits, PIXEL(bp,a1));
if( !putcode(tif, &horizcode) )
@@ -1113,7 +1052,7 @@ Fax3Encode2DRow(TIFF* tif, unsigned char* bp, unsigned char* rp, uint32 bits)
* Encode a buffer of pixels.
*/
static int
-Fax3Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+Fax3Encode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "Fax3Encode";
Fax3CodecState* sp = EncoderState(tif);
@@ -1233,7 +1172,7 @@ static const TIFFField fax4Fields[] = {
};
static int
-Fax3VSetField(TIFF* tif, uint32 tag, va_list ap)
+Fax3VSetField(TIFF* tif, uint32_t tag, va_list ap)
{
Fax3BaseState* sp = Fax3State(tif);
const TIFFField* fip;
@@ -1251,21 +1190,21 @@ Fax3VSetField(TIFF* tif, uint32 tag, va_list ap)
case TIFFTAG_GROUP3OPTIONS:
/* XXX: avoid reading options if compression mismatches. */
if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX3)
- sp->groupoptions = (uint32) va_arg(ap, uint32);
+ sp->groupoptions = (uint32_t) va_arg(ap, uint32_t);
break;
case TIFFTAG_GROUP4OPTIONS:
/* XXX: avoid reading options if compression mismatches. */
if (tif->tif_dir.td_compression == COMPRESSION_CCITTFAX4)
- sp->groupoptions = (uint32) va_arg(ap, uint32);
+ sp->groupoptions = (uint32_t) va_arg(ap, uint32_t);
break;
case TIFFTAG_BADFAXLINES:
- sp->badfaxlines = (uint32) va_arg(ap, uint32);
+ sp->badfaxlines = (uint32_t) va_arg(ap, uint32_t);
break;
case TIFFTAG_CLEANFAXDATA:
- sp->cleanfaxdata = (uint16) va_arg(ap, uint16_vap);
+ sp->cleanfaxdata = (uint16_t) va_arg(ap, uint16_vap);
break;
case TIFFTAG_CONSECUTIVEBADFAXLINES:
- sp->badfaxrun = (uint32) va_arg(ap, uint32);
+ sp->badfaxrun = (uint32_t) va_arg(ap, uint32_t);
break;
default:
return (*sp->vsetparent)(tif, tag, ap);
@@ -1281,7 +1220,7 @@ Fax3VSetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-Fax3VGetField(TIFF* tif, uint32 tag, va_list ap)
+Fax3VGetField(TIFF* tif, uint32_t tag, va_list ap)
{
Fax3BaseState* sp = Fax3State(tif);
@@ -1296,16 +1235,16 @@ Fax3VGetField(TIFF* tif, uint32 tag, va_list ap)
break;
case TIFFTAG_GROUP3OPTIONS:
case TIFFTAG_GROUP4OPTIONS:
- *va_arg(ap, uint32*) = sp->groupoptions;
+ *va_arg(ap, uint32_t*) = sp->groupoptions;
break;
case TIFFTAG_BADFAXLINES:
- *va_arg(ap, uint32*) = sp->badfaxlines;
+ *va_arg(ap, uint32_t*) = sp->badfaxlines;
break;
case TIFFTAG_CLEANFAXDATA:
- *va_arg(ap, uint16*) = sp->cleanfaxdata;
+ *va_arg(ap, uint16_t*) = sp->cleanfaxdata;
break;
case TIFFTAG_CONSECUTIVEBADFAXLINES:
- *va_arg(ap, uint32*) = sp->badfaxrun;
+ *va_arg(ap, uint32_t*) = sp->badfaxrun;
break;
default:
return (*sp->vgetparent)(tif, tag, ap);
@@ -1341,9 +1280,9 @@ Fax3PrintDir(TIFF* tif, FILE* fd, long flags)
if (sp->groupoptions & GROUP3OPT_UNCOMPRESSED)
fprintf(fd, "%suncompressed data", sep);
}
- fprintf(fd, " (%lu = 0x%lx)\n",
- (unsigned long) sp->groupoptions,
- (unsigned long) sp->groupoptions);
+ fprintf(fd, " (%" PRIu32 " = 0x%" PRIx32 ")\n",
+ sp->groupoptions,
+ sp->groupoptions);
}
if (TIFFFieldSet(tif,FIELD_CLEANFAXDATA)) {
fprintf(fd, " Fax Data:");
@@ -1358,15 +1297,15 @@ Fax3PrintDir(TIFF* tif, FILE* fd, long flags)
fprintf(fd, " uncorrected errors");
break;
}
- fprintf(fd, " (%u = 0x%x)\n",
+ fprintf(fd, " (%"PRIu16" = 0x%"PRIx16")\n",
sp->cleanfaxdata, sp->cleanfaxdata);
}
if (TIFFFieldSet(tif,FIELD_BADFAXLINES))
- fprintf(fd, " Bad Fax Lines: %lu\n",
- (unsigned long) sp->badfaxlines);
+ fprintf(fd, " Bad Fax Lines: %" PRIu32 "\n",
+ sp->badfaxlines);
if (TIFFFieldSet(tif,FIELD_BADFAXRUN))
- fprintf(fd, " Consecutive Bad Fax Lines: %lu\n",
- (unsigned long) sp->badfaxrun);
+ fprintf(fd, " Consecutive Bad Fax Lines: %" PRIu32 "\n",
+ sp->badfaxrun);
if (sp->printdir)
(*sp->printdir)(tif, fd, flags);
}
@@ -1389,7 +1328,7 @@ InitCCITTFax3(TIFF* tif)
/*
* Allocate state block so tag methods have storage to record values.
*/
- tif->tif_data = (uint8*)
+ tif->tif_data = (uint8_t*)
_TIFFmalloc(sizeof (Fax3CodecState));
if (tif->tif_data == NULL) {
@@ -1473,7 +1412,7 @@ TIFFInitCCITTFax3(TIFF* tif, int scheme)
* Decode the requested amount of G4-encoded data.
*/
static int
-Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
+Fax4Decode(TIFF* tif, uint8_t* buf, tmsize_t occ, uint16_t s)
{
DECLARE_STATE_2D(tif, sp, "Fax4Decode");
(void) s;
@@ -1490,7 +1429,7 @@ Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
pb = sp->refruns;
b1 = *pb++;
#ifdef FAX3_DEBUG
- printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail);
+ printf("\nBitAcc=%08"PRIX32", BitsAvail = %d\n", BitAcc, BitsAvail);
printf("-------------------- %d\n", tif->tif_row);
fflush(stdout);
#endif
@@ -1500,13 +1439,13 @@ Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
if (((lastx + 7) >> 3) > (int)occ) /* check for buffer overrun */
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Buffer overrun detected : %d bytes available, %d bits needed",
- (int)occ, lastx);
+ "Buffer overrun detected : %"TIFF_SSIZE_FORMAT" bytes available, %d bits needed",
+ occ, lastx);
return -1;
}
(*sp->fill)(buf, thisrun, pa, lastx);
SETVALUE(0); /* imaginary change for reference */
- SWAP(uint32*, sp->curruns, sp->refruns);
+ SWAP(uint32_t*, sp->curruns, sp->refruns);
buf += sp->b.rowbytes;
occ -= sp->b.rowbytes;
sp->line++;
@@ -1522,8 +1461,8 @@ Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
if (((lastx + 7) >> 3) > (int)occ) /* check for buffer overrun */
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Buffer overrun detected : %d bytes available, %d bits needed",
- (int)occ, lastx);
+ "Buffer overrun detected : %"TIFF_SSIZE_FORMAT" bytes available, %d bits needed",
+ occ, lastx);
return -1;
}
(*sp->fill)(buf, thisrun, pa, lastx);
@@ -1539,7 +1478,7 @@ Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
* Encode the requested amount of data.
*/
static int
-Fax4Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+Fax4Encode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "Fax4Encode";
Fax3CodecState *sp = EncoderState(tif);
@@ -1611,7 +1550,7 @@ TIFFInitCCITTFax4(TIFF* tif, int scheme)
* Decode the requested amount of RLE-encoded data.
*/
static int
-Fax3DecodeRLE(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
+Fax3DecodeRLE(TIFF* tif, uint8_t* buf, tmsize_t occ, uint16_t s)
{
DECLARE_STATE(tif, sp, "Fax3DecodeRLE");
int mode = sp->b.mode;
@@ -1628,8 +1567,8 @@ Fax3DecodeRLE(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
RunLength = 0;
pa = thisrun;
#ifdef FAX3_DEBUG
- printf("\nBitAcc=%08X, BitsAvail = %d\n", BitAcc, BitsAvail);
- printf("-------------------- %d\n", tif->tif_row);
+ printf("\nBitAcc=%08"PRIX32", BitsAvail = %d\n", BitAcc, BitsAvail);
+ printf("-------------------- %"PRIu32"\n", tif->tif_row);
fflush(stdout);
#endif
EXPAND1D(EOFRLE);
@@ -1643,7 +1582,7 @@ Fax3DecodeRLE(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
} else if (mode & FAXMODE_WORDALIGN) {
int n = BitsAvail - (BitsAvail &~ 15);
ClrBits(n);
- if (BitsAvail == 0 && !isAligned(cp, uint16))
+ if (BitsAvail == 0 && !isAligned(cp, uint16_t))
cp++;
}
buf += sp->b.rowbytes;
diff --git a/tiff/libtiff/tif_fax3.h b/tiff/libtiff/tif_fax3.h
index 701716cc..fdafe492 100644
--- a/tiff/libtiff/tif_fax3.h
+++ b/tiff/libtiff/tif_fax3.h
@@ -41,7 +41,7 @@
* The routine must have the type signature given below;
* for example:
*
- * fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
+ * fillruns(unsigned char* buf, uint32_t* runs, uint32_t* erun, uint32_t lastx)
*
* where buf is place to set the bits, runs is the array of b&w run
* lengths (white then black), erun is the last run in the array, and
@@ -50,7 +50,7 @@
* data in the run array as needed (e.g. to append zero runs to bring
* the count up to a nice multiple).
*/
-typedef void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
+typedef void (*TIFFFaxFillFunc)(unsigned char*, uint32_t*, uint32_t*, uint32_t);
/*
* The default run filler; made external for other decoders.
@@ -58,7 +58,7 @@ typedef void (*TIFFFaxFillFunc)(unsigned char*, uint32*, uint32*, uint32);
#if defined(__cplusplus)
extern "C" {
#endif
-extern void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
+extern void _TIFFFax3fillruns(unsigned char*, uint32_t*, uint32_t*, uint32_t);
#if defined(__cplusplus)
}
#endif
@@ -84,7 +84,7 @@ extern void _TIFFFax3fillruns(unsigned char*, uint32*, uint32*, uint32);
typedef struct { /* state table entry */
unsigned char State; /* see above */
unsigned char Width; /* width of code in bits */
- uint32 Param; /* unsigned 32-bit run length in bits (holds on 16 bit actually, but cannot be changed. See above warning) */
+ uint32_t Param; /* unsigned 32-bit run length in bits (holds on 16 bit actually, but cannot be changed. See above warning) */
} TIFFFaxTabEnt;
extern const TIFFFaxTabEnt TIFFFaxMainTable[];
@@ -141,7 +141,7 @@ extern const TIFFFaxTabEnt TIFFFaxBlackTable[];
goto eoflab; \
BitsAvail = (n); /* pad with zeros */ \
} else { \
- BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail; \
+ BitAcc |= ((uint32_t) bitmap[*cp++])<<BitsAvail; \
BitsAvail += 8; \
} \
} \
@@ -155,13 +155,13 @@ extern const TIFFFaxTabEnt TIFFFaxBlackTable[];
goto eoflab; \
BitsAvail = (n); /* pad with zeros */ \
} else { \
- BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail; \
+ BitAcc |= ((uint32_t) bitmap[*cp++])<<BitsAvail; \
if ((BitsAvail += 8) < (n)) { \
if (EndOfData()) { \
/* NB: we know BitsAvail is non-zero here */ \
BitsAvail = (n); /* pad with zeros */ \
} else { \
- BitAcc |= ((uint32) bitmap[*cp++])<<BitsAvail; \
+ BitAcc |= ((uint32_t) bitmap[*cp++])<<BitsAvail; \
BitsAvail += 8; \
} \
} \
diff --git a/tiff/libtiff/tif_getimage.c b/tiff/libtiff/tif_getimage.c
index 3460af74..a1b6570b 100644
--- a/tiff/libtiff/tif_getimage.c
+++ b/tiff/libtiff/tif_getimage.c
@@ -31,10 +31,10 @@
#include <stdio.h>
#include <limits.h>
-static int gtTileContig(TIFFRGBAImage*, uint32*, uint32, uint32);
-static int gtTileSeparate(TIFFRGBAImage*, uint32*, uint32, uint32);
-static int gtStripContig(TIFFRGBAImage*, uint32*, uint32, uint32);
-static int gtStripSeparate(TIFFRGBAImage*, uint32*, uint32, uint32);
+static int gtTileContig(TIFFRGBAImage*, uint32_t*, uint32_t, uint32_t);
+static int gtTileSeparate(TIFFRGBAImage*, uint32_t*, uint32_t, uint32_t);
+static int gtStripContig(TIFFRGBAImage*, uint32_t*, uint32_t, uint32_t);
+static int gtStripSeparate(TIFFRGBAImage*, uint32_t*, uint32_t, uint32_t);
static int PickContigCase(TIFFRGBAImage*);
static int PickSeparateCase(TIFFRGBAImage*);
@@ -75,7 +75,7 @@ int
TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
{
TIFFDirectory* td = &tif->tif_dir;
- uint16 photometric;
+ uint16_t photometric;
int colorchannels;
if (!tif->tif_decodestatus) {
@@ -90,7 +90,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
case 16:
break;
default:
- sprintf(emsg, "Sorry, can not handle images with %d-bit samples",
+ sprintf(emsg, "Sorry, can not handle images with %"PRIu16"-bit samples",
td->td_bitspersample);
return (0);
}
@@ -120,8 +120,8 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
&& td->td_samplesperpixel != 1
&& td->td_bitspersample < 8 ) {
sprintf(emsg,
- "Sorry, can not handle contiguous data with %s=%d, "
- "and %s=%d and Bits/Sample=%d",
+ "Sorry, can not handle contiguous data with %s=%"PRIu16", "
+ "and %s=%"PRIu16" and Bits/Sample=%"PRIu16"",
photoTag, photometric,
"Samples/pixel", td->td_samplesperpixel,
td->td_bitspersample);
@@ -150,7 +150,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
break;
case PHOTOMETRIC_SEPARATED:
{
- uint16 inkset;
+ uint16_t inkset;
TIFFGetFieldDefaulted(tif, TIFFTAG_INKSET, &inkset);
if (inkset != INKSET_CMYK) {
sprintf(emsg,
@@ -160,7 +160,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
}
if (td->td_samplesperpixel < 4) {
sprintf(emsg,
- "Sorry, can not handle separated image with %s=%d",
+ "Sorry, can not handle separated image with %s=%"PRIu16,
"Samples/pixel", td->td_samplesperpixel);
return 0;
}
@@ -181,13 +181,13 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
return (0);
}
if (td->td_planarconfig != PLANARCONFIG_CONTIG) {
- sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%d",
+ sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%"PRIu16,
"Planarconfiguration", td->td_planarconfig);
return (0);
}
if ( td->td_samplesperpixel != 3 || colorchannels != 3 ) {
sprintf(emsg,
- "Sorry, can not handle image with %s=%d, %s=%d",
+ "Sorry, can not handle image with %s=%"PRIu16", %s=%d",
"Samples/pixel", td->td_samplesperpixel,
"colorchannels", colorchannels);
return 0;
@@ -196,7 +196,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
case PHOTOMETRIC_CIELAB:
if ( td->td_samplesperpixel != 3 || colorchannels != 3 || td->td_bitspersample != 8 ) {
sprintf(emsg,
- "Sorry, can not handle image with %s=%d, %s=%d and %s=%d",
+ "Sorry, can not handle image with %s=%"PRIu16", %s=%d and %s=%"PRIu16,
"Samples/pixel", td->td_samplesperpixel,
"colorchannels", colorchannels,
"Bits/sample", td->td_bitspersample);
@@ -204,7 +204,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
}
break;
default:
- sprintf(emsg, "Sorry, can not handle image with %s=%d",
+ sprintf(emsg, "Sorry, can not handle image with %s=%"PRIu16,
photoTag, photometric);
return (0);
}
@@ -254,7 +254,7 @@ TIFFRGBAImageEnd(TIFFRGBAImage* img)
static int
isCCITTCompression(TIFF* tif)
{
- uint16 compress;
+ uint16_t compress;
TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress);
return (compress == COMPRESSION_CCITTFAX3 ||
compress == COMPRESSION_CCITTFAX4 ||
@@ -265,12 +265,12 @@ isCCITTCompression(TIFF* tif)
int
TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
{
- uint16* sampleinfo;
- uint16 extrasamples;
- uint16 planarconfig;
- uint16 compress;
+ uint16_t* sampleinfo;
+ uint16_t extrasamples;
+ uint16_t planarconfig;
+ uint16_t compress;
int colorchannels;
- uint16 *red_orig, *green_orig, *blue_orig;
+ uint16_t *red_orig, *green_orig, *blue_orig;
int n_color;
if( !TIFFRGBAImageOK(tif, emsg) )
@@ -302,7 +302,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
case 16:
break;
default:
- sprintf(emsg, "Sorry, can not handle images with %d-bit samples",
+ sprintf(emsg, "Sorry, can not handle images with %"PRIu16"-bit samples",
img->bitspersample);
goto fail_return;
}
@@ -366,9 +366,9 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
/* copy the colormaps so we can modify them */
n_color = (1U << img->bitspersample);
- img->redcmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
- img->greencmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
- img->bluecmap = (uint16 *) _TIFFmalloc(sizeof(uint16)*n_color);
+ img->redcmap = (uint16_t *) _TIFFmalloc(sizeof(uint16_t) * n_color);
+ img->greencmap = (uint16_t *) _TIFFmalloc(sizeof(uint16_t) * n_color);
+ img->bluecmap = (uint16_t *) _TIFFmalloc(sizeof(uint16_t) * n_color);
if( !img->redcmap || !img->greencmap || !img->bluecmap ) {
sprintf(emsg, "Out of memory for colormap copy");
goto fail_return;
@@ -385,8 +385,8 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
&& img->samplesperpixel != 1
&& img->bitspersample < 8 ) {
sprintf(emsg,
- "Sorry, can not handle contiguous data with %s=%d, "
- "and %s=%d and Bits/Sample=%d",
+ "Sorry, can not handle contiguous data with %s=%"PRIu16", "
+ "and %s=%"PRIu16" and Bits/Sample=%"PRIu16,
photoTag, img->photometric,
"Samples/pixel", img->samplesperpixel,
img->bitspersample);
@@ -428,15 +428,15 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
break;
case PHOTOMETRIC_SEPARATED:
{
- uint16 inkset;
+ uint16_t inkset;
TIFFGetFieldDefaulted(tif, TIFFTAG_INKSET, &inkset);
if (inkset != INKSET_CMYK) {
- sprintf(emsg, "Sorry, can not handle separated image with %s=%d",
+ sprintf(emsg, "Sorry, can not handle separated image with %s=%"PRIu16,
"InkSet", inkset);
goto fail_return;
}
if (img->samplesperpixel < 4) {
- sprintf(emsg, "Sorry, can not handle separated image with %s=%d",
+ sprintf(emsg, "Sorry, can not handle separated image with %s=%"PRIu16,
"Samples/pixel", img->samplesperpixel);
goto fail_return;
}
@@ -459,7 +459,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
goto fail_return;
}
if (planarconfig != PLANARCONFIG_CONTIG) {
- sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%d",
+ sprintf(emsg, "Sorry, can not handle LogLuv images with %s=%"PRIu16,
"Planarconfiguration", planarconfig);
return (0);
}
@@ -470,7 +470,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
case PHOTOMETRIC_CIELAB:
break;
default:
- sprintf(emsg, "Sorry, can not handle image with %s=%d",
+ sprintf(emsg, "Sorry, can not handle image with %s=%"PRIu16,
photoTag, img->photometric);
goto fail_return;
}
@@ -498,7 +498,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
}
int
-TIFFRGBAImageGet(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+TIFFRGBAImageGet(TIFFRGBAImage* img, uint32_t* raster, uint32_t w, uint32_t h)
{
if (img->get == NULL) {
TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No \"get\" routine setup");
@@ -518,15 +518,15 @@ TIFFRGBAImageGet(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
*/
int
TIFFReadRGBAImageOriented(TIFF* tif,
- uint32 rwidth, uint32 rheight, uint32* raster,
- int orientation, int stop)
+ uint32_t rwidth, uint32_t rheight, uint32_t* raster,
+ int orientation, int stop)
{
char emsg[1024] = "";
TIFFRGBAImage img;
int ok;
if (TIFFRGBAImageOK(tif, emsg) && TIFFRGBAImageBegin(&img, tif, stop, emsg)) {
- img.req_orientation = (uint16)orientation;
+ img.req_orientation = (uint16_t)orientation;
/* XXX verify rwidth and rheight against width and height */
ok = TIFFRGBAImageGet(&img, raster+(rheight-img.height)*rwidth,
rwidth, img.height);
@@ -544,7 +544,7 @@ TIFFReadRGBAImageOriented(TIFF* tif,
*/
int
TIFFReadRGBAImage(TIFF* tif,
- uint32 rwidth, uint32 rheight, uint32* raster, int stop)
+ uint32_t rwidth, uint32_t rheight, uint32_t* raster, int stop)
{
return TIFFReadRGBAImageOriented(tif, rwidth, rheight, raster,
ORIENTATION_BOTLEFT, stop);
@@ -618,21 +618,21 @@ setorientation(TIFFRGBAImage* img)
* SamplesPerPixel == 1
*/
static int
-gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+gtTileContig(TIFFRGBAImage* img, uint32_t* raster, uint32_t w, uint32_t h)
{
TIFF* tif = img->tif;
tileContigRoutine put = img->put.contig;
- uint32 col, row, y, rowstoread;
+ uint32_t col, row, y, rowstoread;
tmsize_t pos;
- uint32 tw, th;
+ uint32_t tw, th;
unsigned char* buf = NULL;
- int32 fromskew, toskew;
- uint32 nrow;
+ int32_t fromskew, toskew;
+ uint32_t nrow;
int ret = 1, flip;
- uint32 this_tw, tocol;
- int32 this_toskew, leftmost_toskew;
- int32 leftmost_fromskew;
- uint32 leftmost_tw;
+ uint32_t this_tw, tocol;
+ int32_t this_toskew, leftmost_toskew;
+ int32_t leftmost_fromskew;
+ uint32_t leftmost_tw;
tmsize_t bufsize;
bufsize = TIFFTileSize(tif);
@@ -651,7 +651,7 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
return (0);
}
y = h - 1;
- toskew = -(int32)(tw + w);
+ toskew = -(int32_t)(tw + w);
}
else {
if (tw > (INT_MAX + w)) {
@@ -659,7 +659,7 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
return (0);
}
y = 0;
- toskew = -(int32)(tw - w);
+ toskew = -(int32_t)(tw - w);
}
/*
@@ -708,19 +708,19 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
this_toskew = toskew;
}
- y += ((flip & FLIP_VERTICALLY) ? -(int32) nrow : (int32) nrow);
+ y += ((flip & FLIP_VERTICALLY) ? -(int32_t) nrow : (int32_t) nrow);
}
_TIFFfree(buf);
if (flip & FLIP_HORIZONTALLY) {
- uint32 line;
+ uint32_t line;
for (line = 0; line < h; line++) {
- uint32 *left = raster + (line * w);
- uint32 *right = left + w - 1;
+ uint32_t *left = raster + (line * w);
+ uint32_t *right = left + w - 1;
while ( left < right ) {
- uint32 temp = *left;
+ uint32_t temp = *left;
*left = *right;
*right = temp;
left++;
@@ -739,13 +739,13 @@ gtTileContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
* We assume that all such images are RGB.
*/
static int
-gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+gtTileSeparate(TIFFRGBAImage* img, uint32_t* raster, uint32_t w, uint32_t h)
{
TIFF* tif = img->tif;
tileSeparateRoutine put = img->put.separate;
- uint32 col, row, y, rowstoread;
+ uint32_t col, row, y, rowstoread;
tmsize_t pos;
- uint32 tw, th;
+ uint32_t tw, th;
unsigned char* buf = NULL;
unsigned char* p0 = NULL;
unsigned char* p1 = NULL;
@@ -753,15 +753,15 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
unsigned char* pa = NULL;
tmsize_t tilesize;
tmsize_t bufsize;
- int32 fromskew, toskew;
+ int32_t fromskew, toskew;
int alpha = img->alpha;
- uint32 nrow;
+ uint32_t nrow;
int ret = 1, flip;
- uint16 colorchannels;
- uint32 this_tw, tocol;
- int32 this_toskew, leftmost_toskew;
- int32 leftmost_fromskew;
- uint32 leftmost_tw;
+ uint16_t colorchannels;
+ uint32_t this_tw, tocol;
+ int32_t this_toskew, leftmost_toskew;
+ int32_t leftmost_fromskew;
+ uint32_t leftmost_tw;
tilesize = TIFFTileSize(tif);
bufsize = _TIFFMultiplySSize(tif, alpha?4:3,tilesize, "gtTileSeparate");
@@ -779,7 +779,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
return (0);
}
y = h - 1;
- toskew = -(int32)(tw + w);
+ toskew = -(int32_t)(tw + w);
}
else {
if (tw > (INT_MAX + w)) {
@@ -787,7 +787,7 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
return (0);
}
y = 0;
- toskew = -(int32)(tw - w);
+ toskew = -(int32_t)(tw - w);
}
switch( img->photometric )
@@ -897,18 +897,18 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
this_toskew = toskew;
}
- y += ((flip & FLIP_VERTICALLY) ?-(int32) nrow : (int32) nrow);
+ y += ((flip & FLIP_VERTICALLY) ? -(int32_t) nrow : (int32_t) nrow);
}
if (flip & FLIP_HORIZONTALLY) {
- uint32 line;
+ uint32_t line;
for (line = 0; line < h; line++) {
- uint32 *left = raster + (line * w);
- uint32 *right = left + w - 1;
+ uint32_t *left = raster + (line * w);
+ uint32_t *right = left + w - 1;
while ( left < right ) {
- uint32 temp = *left;
+ uint32_t temp = *left;
*left = *right;
*right = temp;
left++;
@@ -928,18 +928,18 @@ gtTileSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
* SamplesPerPixel == 1
*/
static int
-gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+gtStripContig(TIFFRGBAImage* img, uint32_t* raster, uint32_t w, uint32_t h)
{
TIFF* tif = img->tif;
tileContigRoutine put = img->put.contig;
- uint32 row, y, nrow, nrowsub, rowstoread;
+ uint32_t row, y, nrow, nrowsub, rowstoread;
tmsize_t pos;
unsigned char* buf = NULL;
- uint32 rowsperstrip;
- uint16 subsamplinghor,subsamplingver;
- uint32 imagewidth = img->width;
+ uint32_t rowsperstrip;
+ uint16_t subsamplinghor,subsamplingver;
+ uint32_t imagewidth = img->width;
tmsize_t scanline;
- int32 fromskew, toskew;
+ int32_t fromskew, toskew;
int ret = 1, flip;
tmsize_t maxstripsize;
@@ -958,10 +958,10 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
return (0);
}
y = h - 1;
- toskew = -(int32)(w + w);
+ toskew = -(int32_t)(w + w);
} else {
y = 0;
- toskew = -(int32)(w - w);
+ toskew = -(int32_t)(w - w);
}
TIFFGetFieldDefaulted(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
@@ -970,7 +970,7 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
fromskew = (w < imagewidth ? imagewidth - w : 0);
for (row = 0; row < h; row += nrow)
{
- uint32 temp;
+ uint32_t temp;
rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;
nrow = (row + rowstoread > h ? h - row : rowstoread);
nrowsub = nrow;
@@ -996,18 +996,18 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
pos = ((row + img->row_offset) % rowsperstrip) * scanline + \
((tmsize_t) img->col_offset * img->samplesperpixel);
(*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, buf + pos);
- y += ((flip & FLIP_VERTICALLY) ? -(int32) nrow : (int32) nrow);
+ y += ((flip & FLIP_VERTICALLY) ? -(int32_t) nrow : (int32_t) nrow);
}
if (flip & FLIP_HORIZONTALLY) {
- uint32 line;
+ uint32_t line;
for (line = 0; line < h; line++) {
- uint32 *left = raster + (line * w);
- uint32 *right = left + w - 1;
+ uint32_t *left = raster + (line * w);
+ uint32_t *right = left + w - 1;
while ( left < right ) {
- uint32 temp = *left;
+ uint32_t temp = *left;
*left = *right;
*right = temp;
left++;
@@ -1027,23 +1027,23 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
* We assume that all such images are RGB.
*/
static int
-gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
+gtStripSeparate(TIFFRGBAImage* img, uint32_t* raster, uint32_t w, uint32_t h)
{
TIFF* tif = img->tif;
tileSeparateRoutine put = img->put.separate;
unsigned char *buf = NULL;
unsigned char *p0 = NULL, *p1 = NULL, *p2 = NULL, *pa = NULL;
- uint32 row, y, nrow, rowstoread;
+ uint32_t row, y, nrow, rowstoread;
tmsize_t pos;
tmsize_t scanline;
- uint32 rowsperstrip, offset_row;
- uint32 imagewidth = img->width;
+ uint32_t rowsperstrip, offset_row;
+ uint32_t imagewidth = img->width;
tmsize_t stripsize;
tmsize_t bufsize;
- int32 fromskew, toskew;
+ int32_t fromskew, toskew;
int alpha = img->alpha;
int ret = 1, flip;
- uint16 colorchannels;
+ uint16_t colorchannels;
stripsize = TIFFStripSize(tif);
bufsize = _TIFFMultiplySSize(tif,alpha?4:3,stripsize, "gtStripSeparate");
@@ -1058,11 +1058,11 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
return (0);
}
y = h - 1;
- toskew = -(int32)(w + w);
+ toskew = -(int32_t)(w + w);
}
else {
y = 0;
- toskew = -(int32)(w - w);
+ toskew = -(int32_t)(w - w);
}
switch( img->photometric )
@@ -1083,7 +1083,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
fromskew = (w < imagewidth ? imagewidth - w : 0);
for (row = 0; row < h; row += nrow)
{
- uint32 temp;
+ uint32_t temp;
rowstoread = rowsperstrip - (row + img->row_offset) % rowsperstrip;
nrow = (row + rowstoread > h ? h - row : rowstoread);
offset_row = row + img->row_offset;
@@ -1155,18 +1155,18 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
((tmsize_t) img->col_offset * img->samplesperpixel);
(*put)(img, raster+y*w, 0, y, w, nrow, fromskew, toskew, p0 + pos, p1 + pos,
p2 + pos, (alpha?(pa+pos):NULL));
- y += ((flip & FLIP_VERTICALLY) ? -(int32) nrow : (int32) nrow);
+ y += ((flip & FLIP_VERTICALLY) ? -(int32_t) nrow : (int32_t) nrow);
}
if (flip & FLIP_HORIZONTALLY) {
- uint32 line;
+ uint32_t line;
for (line = 0; line < h; line++) {
- uint32 *left = raster + (line * w);
- uint32 *right = left + w - 1;
+ uint32_t *left = raster + (line * w);
+ uint32_t *right = left + w - 1;
while ( left < right ) {
- uint32 temp = *left;
+ uint32_t temp = *left;
*left = *right;
*right = temp;
left++;
@@ -1206,7 +1206,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
#define NOP
#define UNROLL8(w, op1, op2) { \
- uint32 _x; \
+ uint32_t _x; \
for (_x = w; _x >= 8; _x -= 8) { \
op1; \
REPEAT8(op2); \
@@ -1217,7 +1217,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
} \
}
#define UNROLL4(w, op1, op2) { \
- uint32 _x; \
+ uint32_t _x; \
for (_x = w; _x >= 4; _x -= 4) { \
op1; \
REPEAT4(op2); \
@@ -1228,7 +1228,7 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
} \
}
#define UNROLL2(w, op1, op2) { \
- uint32 _x; \
+ uint32_t _x; \
for (_x = w; _x >= 2; _x -= 2) { \
op1; \
REPEAT2(op2); \
@@ -1242,25 +1242,25 @@ gtStripSeparate(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h)
#define SKEW(r,g,b,skew) { r += skew; g += skew; b += skew; }
#define SKEW4(r,g,b,a,skew) { r += skew; g += skew; b += skew; a+= skew; }
-#define A1 (((uint32)0xffL)<<24)
+#define A1 (((uint32_t)0xffL)<<24)
#define PACK(r,g,b) \
- ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|A1)
+ ((uint32_t)(r)|((uint32_t)(g)<<8)|((uint32_t)(b)<<16)|A1)
#define PACK4(r,g,b,a) \
- ((uint32)(r)|((uint32)(g)<<8)|((uint32)(b)<<16)|((uint32)(a)<<24))
+ ((uint32_t)(r)|((uint32_t)(g)<<8)|((uint32_t)(b)<<16)|((uint32_t)(a)<<24))
#define W2B(v) (((v)>>8)&0xff)
/* TODO: PACKW should have be made redundant in favor of Bitdepth16To8 LUT */
#define PACKW(r,g,b) \
- ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|A1)
+ ((uint32_t)W2B(r)|((uint32_t)W2B(g)<<8)|((uint32_t)W2B(b)<<16)|A1)
#define PACKW4(r,g,b,a) \
- ((uint32)W2B(r)|((uint32)W2B(g)<<8)|((uint32)W2B(b)<<16)|((uint32)W2B(a)<<24))
+ ((uint32_t)W2B(r)|((uint32_t)W2B(g)<<8)|((uint32_t)W2B(b)<<16)|((uint32_t)W2B(a)<<24))
#define DECLAREContigPutFunc(name) \
static void name(\
TIFFRGBAImage* img, \
- uint32* cp, \
- uint32 x, uint32 y, \
- uint32 w, uint32 h, \
- int32 fromskew, int32 toskew, \
+ uint32_t* cp, \
+ uint32_t x, uint32_t y, \
+ uint32_t w, uint32_t h, \
+ int32_t fromskew, int32_t toskew, \
unsigned char* pp \
)
@@ -1269,7 +1269,7 @@ static void name(\
*/
DECLAREContigPutFunc(put8bitcmaptile)
{
- uint32** PALmap = img->PALmap;
+ uint32_t** PALmap = img->PALmap;
int samplesperpixel = img->samplesperpixel;
(void) y;
@@ -1289,12 +1289,12 @@ DECLAREContigPutFunc(put8bitcmaptile)
*/
DECLAREContigPutFunc(put4bitcmaptile)
{
- uint32** PALmap = img->PALmap;
+ uint32_t** PALmap = img->PALmap;
(void) x; (void) y;
fromskew /= 2;
for( ; h > 0; --h) {
- uint32* bw;
+ uint32_t* bw;
UNROLL2(w, bw = PALmap[*pp++], *cp++ = *bw++);
cp += toskew;
pp += fromskew;
@@ -1306,12 +1306,12 @@ DECLAREContigPutFunc(put4bitcmaptile)
*/
DECLAREContigPutFunc(put2bitcmaptile)
{
- uint32** PALmap = img->PALmap;
+ uint32_t** PALmap = img->PALmap;
(void) x; (void) y;
fromskew /= 4;
for( ; h > 0; --h) {
- uint32* bw;
+ uint32_t* bw;
UNROLL4(w, bw = PALmap[*pp++], *cp++ = *bw++);
cp += toskew;
pp += fromskew;
@@ -1323,12 +1323,12 @@ DECLAREContigPutFunc(put2bitcmaptile)
*/
DECLAREContigPutFunc(put1bitcmaptile)
{
- uint32** PALmap = img->PALmap;
+ uint32_t** PALmap = img->PALmap;
(void) x; (void) y;
fromskew /= 8;
for( ; h > 0; --h) {
- uint32* bw;
+ uint32_t* bw;
UNROLL8(w, bw = PALmap[*pp++], *cp++ = *bw++);
cp += toskew;
pp += fromskew;
@@ -1341,7 +1341,7 @@ DECLAREContigPutFunc(put1bitcmaptile)
DECLAREContigPutFunc(putgreytile)
{
int samplesperpixel = img->samplesperpixel;
- uint32** BWmap = img->BWmap;
+ uint32_t** BWmap = img->BWmap;
(void) y;
for( ; h > 0; --h) {
@@ -1361,13 +1361,13 @@ DECLAREContigPutFunc(putgreytile)
DECLAREContigPutFunc(putagreytile)
{
int samplesperpixel = img->samplesperpixel;
- uint32** BWmap = img->BWmap;
+ uint32_t** BWmap = img->BWmap;
(void) y;
for( ; h > 0; --h) {
for (x = w; x > 0; --x)
{
- *cp++ = BWmap[*pp][0] & ((uint32)*(pp+1) << 24 | ~A1);
+ *cp++ = BWmap[*pp][0] & ((uint32_t)*(pp + 1) << 24 | ~A1);
pp += samplesperpixel;
}
cp += toskew;
@@ -1381,11 +1381,11 @@ DECLAREContigPutFunc(putagreytile)
DECLAREContigPutFunc(put16bitbwtile)
{
int samplesperpixel = img->samplesperpixel;
- uint32** BWmap = img->BWmap;
+ uint32_t** BWmap = img->BWmap;
(void) y;
for( ; h > 0; --h) {
- uint16 *wp = (uint16 *) pp;
+ uint16_t *wp = (uint16_t *) pp;
for (x = w; x > 0; --x)
{
@@ -1405,12 +1405,12 @@ DECLAREContigPutFunc(put16bitbwtile)
*/
DECLAREContigPutFunc(put1bitbwtile)
{
- uint32** BWmap = img->BWmap;
+ uint32_t** BWmap = img->BWmap;
(void) x; (void) y;
fromskew /= 8;
for( ; h > 0; --h) {
- uint32* bw;
+ uint32_t* bw;
UNROLL8(w, bw = BWmap[*pp++], *cp++ = *bw++);
cp += toskew;
pp += fromskew;
@@ -1422,12 +1422,12 @@ DECLAREContigPutFunc(put1bitbwtile)
*/
DECLAREContigPutFunc(put2bitbwtile)
{
- uint32** BWmap = img->BWmap;
+ uint32_t** BWmap = img->BWmap;
(void) x; (void) y;
fromskew /= 4;
for( ; h > 0; --h) {
- uint32* bw;
+ uint32_t* bw;
UNROLL4(w, bw = BWmap[*pp++], *cp++ = *bw++);
cp += toskew;
pp += fromskew;
@@ -1439,12 +1439,12 @@ DECLAREContigPutFunc(put2bitbwtile)
*/
DECLAREContigPutFunc(put4bitbwtile)
{
- uint32** BWmap = img->BWmap;
+ uint32_t** BWmap = img->BWmap;
(void) x; (void) y;
fromskew /= 2;
for( ; h > 0; --h) {
- uint32* bw;
+ uint32_t* bw;
UNROLL2(w, bw = BWmap[*pp++], *cp++ = *bw++);
cp += toskew;
pp += fromskew;
@@ -1498,8 +1498,8 @@ DECLAREContigPutFunc(putRGBUAcontig8bittile)
(void) y;
fromskew *= samplesperpixel;
for( ; h > 0; --h) {
- uint32 r, g, b, a;
- uint8* m;
+ uint32_t r, g, b, a;
+ uint8_t* m;
for (x = w; x > 0; --x) {
a = pp[3];
m = img->UaToAa+((size_t) a<<8);
@@ -1520,7 +1520,7 @@ DECLAREContigPutFunc(putRGBUAcontig8bittile)
DECLAREContigPutFunc(putRGBcontig16bittile)
{
int samplesperpixel = img->samplesperpixel;
- uint16 *wp = (uint16 *)pp;
+ uint16_t *wp = (uint16_t *)pp;
(void) y;
fromskew *= samplesperpixel;
for( ; h > 0; --h) {
@@ -1542,7 +1542,7 @@ DECLAREContigPutFunc(putRGBcontig16bittile)
DECLAREContigPutFunc(putRGBAAcontig16bittile)
{
int samplesperpixel = img->samplesperpixel;
- uint16 *wp = (uint16 *)pp;
+ uint16_t *wp = (uint16_t *)pp;
(void) y;
fromskew *= samplesperpixel;
for( ; h > 0; --h) {
@@ -1565,12 +1565,12 @@ DECLAREContigPutFunc(putRGBAAcontig16bittile)
DECLAREContigPutFunc(putRGBUAcontig16bittile)
{
int samplesperpixel = img->samplesperpixel;
- uint16 *wp = (uint16 *)pp;
+ uint16_t *wp = (uint16_t *)pp;
(void) y;
fromskew *= samplesperpixel;
for( ; h > 0; --h) {
- uint32 r,g,b,a;
- uint8* m;
+ uint32_t r,g,b,a;
+ uint8_t* m;
for (x = w; x > 0; --x) {
a = img->Bitdepth16To8[wp[3]];
m = img->UaToAa+((size_t) a<<8);
@@ -1593,7 +1593,7 @@ DECLAREContigPutFunc(putRGBUAcontig16bittile)
DECLAREContigPutFunc(putRGBcontig8bitCMYKtile)
{
int samplesperpixel = img->samplesperpixel;
- uint16 r, g, b, k;
+ uint16_t r, g, b, k;
(void) x; (void) y;
fromskew *= samplesperpixel;
@@ -1619,7 +1619,7 @@ DECLAREContigPutFunc(putRGBcontig8bitCMYKMaptile)
{
int samplesperpixel = img->samplesperpixel;
TIFFRGBValue* Map = img->Map;
- uint16 r, g, b, k;
+ uint16_t r, g, b, k;
(void) y;
fromskew *= samplesperpixel;
@@ -1640,10 +1640,10 @@ DECLAREContigPutFunc(putRGBcontig8bitCMYKMaptile)
#define DECLARESepPutFunc(name) \
static void name(\
TIFFRGBAImage* img,\
- uint32* cp,\
- uint32 x, uint32 y, \
- uint32 w, uint32 h,\
- int32 fromskew, int32 toskew,\
+ uint32_t* cp,\
+ uint32_t x, uint32_t y, \
+ uint32_t w, uint32_t h,\
+ int32_t fromskew, int32_t toskew,\
unsigned char* r, unsigned char* g, unsigned char* b, unsigned char* a\
)
@@ -1680,7 +1680,7 @@ DECLARESepPutFunc(putCMYKseparate8bittile)
{
(void) img; (void) y;
for( ; h > 0; --h) {
- uint32 rv, gv, bv, kv;
+ uint32_t rv, gv, bv, kv;
for (x = w; x > 0; --x) {
kv = 255 - *a++;
rv = (kv*(255-*r++))/255;
@@ -1700,8 +1700,8 @@ DECLARESepPutFunc(putRGBUAseparate8bittile)
{
(void) img; (void) y;
for( ; h > 0; --h) {
- uint32 rv, gv, bv, av;
- uint8* m;
+ uint32_t rv, gv, bv, av;
+ uint8_t* m;
for (x = w; x > 0; --x) {
av = *a++;
m = img->UaToAa+((size_t) av<<8);
@@ -1720,9 +1720,9 @@ DECLARESepPutFunc(putRGBUAseparate8bittile)
*/
DECLARESepPutFunc(putRGBseparate16bittile)
{
- uint16 *wr = (uint16*) r;
- uint16 *wg = (uint16*) g;
- uint16 *wb = (uint16*) b;
+ uint16_t *wr = (uint16_t*) r;
+ uint16_t *wg = (uint16_t*) g;
+ uint16_t *wb = (uint16_t*) b;
(void) img; (void) y; (void) a;
for( ; h > 0; --h) {
for (x = 0; x < w; x++)
@@ -1739,10 +1739,10 @@ DECLARESepPutFunc(putRGBseparate16bittile)
*/
DECLARESepPutFunc(putRGBAAseparate16bittile)
{
- uint16 *wr = (uint16*) r;
- uint16 *wg = (uint16*) g;
- uint16 *wb = (uint16*) b;
- uint16 *wa = (uint16*) a;
+ uint16_t *wr = (uint16_t*) r;
+ uint16_t *wg = (uint16_t*) g;
+ uint16_t *wb = (uint16_t*) b;
+ uint16_t *wa = (uint16_t*) a;
(void) img; (void) y;
for( ; h > 0; --h) {
for (x = 0; x < w; x++)
@@ -1760,14 +1760,14 @@ DECLARESepPutFunc(putRGBAAseparate16bittile)
*/
DECLARESepPutFunc(putRGBUAseparate16bittile)
{
- uint16 *wr = (uint16*) r;
- uint16 *wg = (uint16*) g;
- uint16 *wb = (uint16*) b;
- uint16 *wa = (uint16*) a;
+ uint16_t *wr = (uint16_t*) r;
+ uint16_t *wg = (uint16_t*) g;
+ uint16_t *wb = (uint16_t*) b;
+ uint16_t *wa = (uint16_t*) a;
(void) img; (void) y;
for( ; h > 0; --h) {
- uint32 r2,g2,b2,a2;
- uint8* m;
+ uint32_t r2,g2,b2,a2;
+ uint8_t* m;
for (x = w; x > 0; --x) {
a2 = img->Bitdepth16To8[*wa++];
m = img->UaToAa+((size_t) a2<<8);
@@ -1787,7 +1787,7 @@ DECLARESepPutFunc(putRGBUAseparate16bittile)
DECLAREContigPutFunc(putcontig8bitCIELab)
{
float X, Y, Z;
- uint32 r, g, b;
+ uint32_t r, g, b;
(void) y;
fromskew *= 3;
for( ; h > 0; --h) {
@@ -1811,7 +1811,7 @@ DECLAREContigPutFunc(putcontig8bitCIELab)
*/
#define YCbCrtoRGB(dst, Y) { \
- uint32 r, g, b; \
+ uint32_t r, g, b; \
TIFFYCbCrtoRGB(img->ycbcr, (Y), Cb, Cr, &r, &g, &b); \
dst = PACK(r, g, b); \
}
@@ -1827,20 +1827,20 @@ DECLAREContigPutFunc(putcontig8bitCIELab)
#ifdef notdef
static void putcontig8bitYCbCrGenericTile(
TIFFRGBAImage* img,
- uint32* cp,
- uint32 x, uint32 y,
- uint32 w, uint32 h,
- int32 fromskew, int32 toskew,
+ uint32_t* cp,
+ uint32_t x, uint32_t y,
+ uint32_t w, uint32_t h,
+ int32_t fromskew, int32_t toskew,
unsigned char* pp,
int h_group,
int v_group )
{
- uint32* cp1 = cp+w+toskew;
- uint32* cp2 = cp1+w+toskew;
- uint32* cp3 = cp2+w+toskew;
- int32 incr = 3*w+4*toskew;
- int32 Cb, Cr;
+ uint32_t* cp1 = cp+w+toskew;
+ uint32_t* cp2 = cp1+w+toskew;
+ uint32_t* cp3 = cp2+w+toskew;
+ int32_t incr = 3*w+4*toskew;
+ int32_t Cb, Cr;
int group_size = v_group * h_group + 2;
(void) y;
@@ -1897,10 +1897,10 @@ static void putcontig8bitYCbCrGenericTile(
*/
DECLAREContigPutFunc(putcontig8bitYCbCr44tile)
{
- uint32* cp1 = cp+w+toskew;
- uint32* cp2 = cp1+w+toskew;
- uint32* cp3 = cp2+w+toskew;
- int32 incr = 3*w+4*toskew;
+ uint32_t* cp1 = cp + w + toskew;
+ uint32_t* cp2 = cp1 + w + toskew;
+ uint32_t* cp3 = cp2 + w + toskew;
+ int32_t incr = 3 * w + 4 * toskew;
(void) y;
/* adjust fromskew */
@@ -1909,8 +1909,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr44tile)
for (; h >= 4; h -= 4) {
x = w>>2;
do {
- int32 Cb = pp[16];
- int32 Cr = pp[17];
+ int32_t Cb = pp[16];
+ int32_t Cr = pp[17];
YCbCrtoRGB(cp [0], pp[ 0]);
YCbCrtoRGB(cp [1], pp[ 1]);
@@ -1944,8 +1944,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr44tile)
} else {
while (h > 0) {
for (x = w; x > 0;) {
- int32 Cb = pp[16];
- int32 Cr = pp[17];
+ int32_t Cb = pp[16];
+ int32_t Cr = pp[17];
switch (x) {
default:
switch (h) {
@@ -2003,8 +2003,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr44tile)
*/
DECLAREContigPutFunc(putcontig8bitYCbCr42tile)
{
- uint32* cp1 = cp+w+toskew;
- int32 incr = 2*toskew+w;
+ uint32_t* cp1 = cp + w + toskew;
+ int32_t incr = 2 * toskew + w;
(void) y;
fromskew = (fromskew / 4) * (4*2+2);
@@ -2012,8 +2012,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr42tile)
for (; h >= 2; h -= 2) {
x = w>>2;
do {
- int32 Cb = pp[8];
- int32 Cr = pp[9];
+ int32_t Cb = pp[8];
+ int32_t Cr = pp[9];
YCbCrtoRGB(cp [0], pp[0]);
YCbCrtoRGB(cp [1], pp[1]);
@@ -2035,8 +2035,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr42tile)
} else {
while (h > 0) {
for (x = w; x > 0;) {
- int32 Cb = pp[8];
- int32 Cr = pp[9];
+ int32_t Cb = pp[8];
+ int32_t Cr = pp[9];
switch (x) {
default:
switch (h) {
@@ -2089,8 +2089,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr41tile)
do {
x = w>>2;
while(x>0) {
- int32 Cb = pp[4];
- int32 Cr = pp[5];
+ int32_t Cb = pp[4];
+ int32_t Cr = pp[5];
YCbCrtoRGB(cp [0], pp[0]);
YCbCrtoRGB(cp [1], pp[1]);
@@ -2104,8 +2104,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr41tile)
if( (w&3) != 0 )
{
- int32 Cb = pp[4];
- int32 Cr = pp[5];
+ int32_t Cb = pp[4];
+ int32_t Cr = pp[5];
switch( (w&3) ) {
case 3: YCbCrtoRGB(cp [2], pp[2]); /*-fallthrough*/
@@ -2129,16 +2129,16 @@ DECLAREContigPutFunc(putcontig8bitYCbCr41tile)
*/
DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
{
- uint32* cp2;
- int32 incr = 2*toskew+w;
+ uint32_t* cp2;
+ int32_t incr = 2 * toskew + w;
(void) y;
fromskew = (fromskew / 2) * (2*2+2);
cp2 = cp+w+toskew;
while (h>=2) {
x = w;
while (x>=2) {
- uint32 Cb = pp[4];
- uint32 Cr = pp[5];
+ uint32_t Cb = pp[4];
+ uint32_t Cr = pp[5];
YCbCrtoRGB(cp[0], pp[0]);
YCbCrtoRGB(cp[1], pp[1]);
YCbCrtoRGB(cp2[0], pp[2]);
@@ -2149,8 +2149,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
x -= 2;
}
if (x==1) {
- uint32 Cb = pp[4];
- uint32 Cr = pp[5];
+ uint32_t Cb = pp[4];
+ uint32_t Cr = pp[5];
YCbCrtoRGB(cp[0], pp[0]);
YCbCrtoRGB(cp2[0], pp[2]);
cp ++ ;
@@ -2165,8 +2165,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
if (h==1) {
x = w;
while (x>=2) {
- uint32 Cb = pp[4];
- uint32 Cr = pp[5];
+ uint32_t Cb = pp[4];
+ uint32_t Cr = pp[5];
YCbCrtoRGB(cp[0], pp[0]);
YCbCrtoRGB(cp[1], pp[1]);
cp += 2;
@@ -2175,8 +2175,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr22tile)
x -= 2;
}
if (x==1) {
- uint32 Cb = pp[4];
- uint32 Cr = pp[5];
+ uint32_t Cb = pp[4];
+ uint32_t Cr = pp[5];
YCbCrtoRGB(cp[0], pp[0]);
}
}
@@ -2192,8 +2192,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr21tile)
do {
x = w>>1;
while(x>0) {
- int32 Cb = pp[2];
- int32 Cr = pp[3];
+ int32_t Cb = pp[2];
+ int32_t Cr = pp[3];
YCbCrtoRGB(cp[0], pp[0]);
YCbCrtoRGB(cp[1], pp[1]);
@@ -2205,8 +2205,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr21tile)
if( (w&1) != 0 )
{
- int32 Cb = pp[2];
- int32 Cr = pp[3];
+ int32_t Cb = pp[2];
+ int32_t Cr = pp[3];
YCbCrtoRGB(cp[0], pp[0]);
@@ -2224,16 +2224,16 @@ DECLAREContigPutFunc(putcontig8bitYCbCr21tile)
*/
DECLAREContigPutFunc(putcontig8bitYCbCr12tile)
{
- uint32* cp2;
- int32 incr = 2*toskew+w;
+ uint32_t* cp2;
+ int32_t incr = 2 * toskew + w;
(void) y;
fromskew = (fromskew / 1) * (1 * 2 + 2);
cp2 = cp+w+toskew;
while (h>=2) {
x = w;
do {
- uint32 Cb = pp[2];
- uint32 Cr = pp[3];
+ uint32_t Cb = pp[2];
+ uint32_t Cr = pp[3];
YCbCrtoRGB(cp[0], pp[0]);
YCbCrtoRGB(cp2[0], pp[1]);
cp ++;
@@ -2248,8 +2248,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr12tile)
if (h==1) {
x = w;
do {
- uint32 Cb = pp[2];
- uint32 Cr = pp[3];
+ uint32_t Cb = pp[2];
+ uint32_t Cr = pp[3];
YCbCrtoRGB(cp[0], pp[0]);
cp ++;
pp += 4;
@@ -2267,8 +2267,8 @@ DECLAREContigPutFunc(putcontig8bitYCbCr11tile)
do {
x = w; /* was x = w>>1; patched 2000/09/25 warmerda@home.com */
do {
- int32 Cb = pp[1];
- int32 Cr = pp[2];
+ int32_t Cb = pp[1];
+ int32_t Cr = pp[2];
YCbCrtoRGB(*cp++, pp[0]);
@@ -2290,7 +2290,7 @@ DECLARESepPutFunc(putseparate8bitYCbCr11tile)
for( ; h > 0; --h) {
x = w;
do {
- uint32 dr, dg, db;
+ uint32_t dr, dg, db;
TIFFYCbCrtoRGB(img->ycbcr,*r++,*g++,*b++,&dr,&dg,&db);
*cp++ = PACK(dr,dg,db);
} while (--x);
@@ -2317,7 +2317,7 @@ initYCbCrConversion(TIFFRGBAImage* img)
TIFFroundup_32(sizeof (TIFFYCbCrToRGB), sizeof (long))
+ 4*256*sizeof (TIFFRGBValue)
+ 2*256*sizeof (int)
- + 3*256*sizeof (int32)
+ + 3*256*sizeof (int32_t)
);
if (img->ycbcr == NULL) {
TIFFErrorExt(img->tif->tif_clientdata, module,
@@ -2412,18 +2412,18 @@ makebwmap(TIFFRGBAImage* img)
int bitspersample = img->bitspersample;
int nsamples = 8 / bitspersample;
int i;
- uint32* p;
+ uint32_t* p;
if( nsamples == 0 )
nsamples = 1;
- img->BWmap = (uint32**) _TIFFmalloc(
- 256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32)));
+ img->BWmap = (uint32_t**) _TIFFmalloc(
+ 256*sizeof (uint32_t *) + (256 * nsamples * sizeof(uint32_t)));
if (img->BWmap == NULL) {
TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No space for B&W mapping table");
return (0);
}
- p = (uint32*)(img->BWmap + 256);
+ p = (uint32_t*)(img->BWmap + 256);
for (i = 0; i < 256; i++) {
TIFFRGBValue c;
img->BWmap[i] = p;
@@ -2467,13 +2467,13 @@ makebwmap(TIFFRGBAImage* img)
static int
setupMap(TIFFRGBAImage* img)
{
- int32 x, range;
+ int32_t x, range;
- range = (int32)((1L<<img->bitspersample)-1);
+ range = (int32_t)((1L << img->bitspersample) - 1);
/* treat 16 bit the same as eight bit */
if( img->bitspersample == 16 )
- range = (int32) 255;
+ range = (int32_t) 255;
img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
if (img->Map == NULL) {
@@ -2507,9 +2507,9 @@ setupMap(TIFFRGBAImage* img)
static int
checkcmap(TIFFRGBAImage* img)
{
- uint16* r = img->redcmap;
- uint16* g = img->greencmap;
- uint16* b = img->bluecmap;
+ uint16_t* r = img->redcmap;
+ uint16_t* g = img->greencmap;
+ uint16_t* b = img->bluecmap;
long n = 1L<<img->bitspersample;
while (n-- > 0)
@@ -2521,13 +2521,13 @@ checkcmap(TIFFRGBAImage* img)
static void
cvtcmap(TIFFRGBAImage* img)
{
- uint16* r = img->redcmap;
- uint16* g = img->greencmap;
- uint16* b = img->bluecmap;
+ uint16_t* r = img->redcmap;
+ uint16_t* g = img->greencmap;
+ uint16_t* b = img->bluecmap;
long i;
for (i = (1L<<img->bitspersample)-1; i >= 0; i--) {
-#define CVT(x) ((uint16)((x)>>8))
+#define CVT(x) ((uint16_t)((x)>>8))
r[i] = CVT(r[i]);
g[i] = CVT(g[i]);
b[i] = CVT(b[i]);
@@ -2547,19 +2547,19 @@ makecmap(TIFFRGBAImage* img)
{
int bitspersample = img->bitspersample;
int nsamples = 8 / bitspersample;
- uint16* r = img->redcmap;
- uint16* g = img->greencmap;
- uint16* b = img->bluecmap;
- uint32 *p;
+ uint16_t* r = img->redcmap;
+ uint16_t* g = img->greencmap;
+ uint16_t* b = img->bluecmap;
+ uint32_t *p;
int i;
- img->PALmap = (uint32**) _TIFFmalloc(
- 256*sizeof (uint32 *)+(256*nsamples*sizeof(uint32)));
+ img->PALmap = (uint32_t**) _TIFFmalloc(
+ 256*sizeof (uint32_t *) + (256 * nsamples * sizeof(uint32_t)));
if (img->PALmap == NULL) {
TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif), "No space for Palette mapping table");
return (0);
}
- p = (uint32*)(img->PALmap + 256);
+ p = (uint32_t*)(img->PALmap + 256);
for (i = 0; i < 256; i++) {
TIFFRGBValue c;
img->PALmap[i] = p;
@@ -2746,8 +2746,8 @@ PickContigCase(TIFFRGBAImage* img)
* Joris: added support for the [1,2] case, nonetheless, to accommodate
* some OJPEG files
*/
- uint16 SubsamplingHor;
- uint16 SubsamplingVer;
+ uint16_t SubsamplingHor;
+ uint16_t SubsamplingVer;
TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &SubsamplingHor, &SubsamplingVer);
switch ((SubsamplingHor<<4)|SubsamplingVer) {
case 0x44:
@@ -2845,7 +2845,7 @@ PickSeparateCase(TIFFRGBAImage* img)
{
if (initYCbCrConversion(img)!=0)
{
- uint16 hs, vs;
+ uint16_t hs, vs;
TIFFGetFieldDefaulted(img->tif, TIFFTAG_YCBCRSUBSAMPLING, &hs, &vs);
switch ((hs<<4)|vs) {
case 0x11:
@@ -2864,8 +2864,8 @@ static int
BuildMapUaToAa(TIFFRGBAImage* img)
{
static const char module[]="BuildMapUaToAa";
- uint8* m;
- uint16 na,nv;
+ uint8_t* m;
+ uint16_t na,nv;
assert(img->UaToAa==NULL);
img->UaToAa=_TIFFmalloc(65536);
if (img->UaToAa==NULL)
@@ -2877,7 +2877,7 @@ BuildMapUaToAa(TIFFRGBAImage* img)
for (na=0; na<256; na++)
{
for (nv=0; nv<256; nv++)
- *m++=(uint8)((nv*na+127)/255);
+ *m++=(uint8_t)((nv * na + 127) / 255);
}
return(1);
}
@@ -2886,8 +2886,8 @@ static int
BuildMapBitdepth16To8(TIFFRGBAImage* img)
{
static const char module[]="BuildMapBitdepth16To8";
- uint8* m;
- uint32 n;
+ uint8_t* m;
+ uint32_t n;
assert(img->Bitdepth16To8==NULL);
img->Bitdepth16To8=_TIFFmalloc(65536);
if (img->Bitdepth16To8==NULL)
@@ -2897,7 +2897,7 @@ BuildMapBitdepth16To8(TIFFRGBAImage* img)
}
m=img->Bitdepth16To8;
for (n=0; n<65536; n++)
- *m++=(uint8)((n+128)/257);
+ *m++=(uint8_t)((n + 128) / 257);
return(1);
}
@@ -2911,20 +2911,20 @@ BuildMapBitdepth16To8(TIFFRGBAImage* img)
int
-TIFFReadRGBAStrip(TIFF* tif, uint32 row, uint32 * raster )
+TIFFReadRGBAStrip(TIFF* tif, uint32_t row, uint32_t * raster )
{
return TIFFReadRGBAStripExt(tif, row, raster, 0 );
}
int
-TIFFReadRGBAStripExt(TIFF* tif, uint32 row, uint32 * raster, int stop_on_error)
+TIFFReadRGBAStripExt(TIFF* tif, uint32_t row, uint32_t * raster, int stop_on_error)
{
char emsg[1024] = "";
TIFFRGBAImage img;
int ok;
- uint32 rowsperstrip, rows_to_read;
+ uint32_t rowsperstrip, rows_to_read;
if( TIFFIsTiled( tif ) )
{
@@ -2969,7 +2969,7 @@ TIFFReadRGBAStripExt(TIFF* tif, uint32 row, uint32 * raster, int stop_on_error)
*/
int
-TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
+TIFFReadRGBATile(TIFF* tif, uint32_t col, uint32_t row, uint32_t * raster)
{
return TIFFReadRGBATileExt(tif, col, row, raster, 0 );
@@ -2977,14 +2977,14 @@ TIFFReadRGBATile(TIFF* tif, uint32 col, uint32 row, uint32 * raster)
int
-TIFFReadRGBATileExt(TIFF* tif, uint32 col, uint32 row, uint32 * raster, int stop_on_error )
+TIFFReadRGBATileExt(TIFF* tif, uint32_t col, uint32_t row, uint32_t * raster, int stop_on_error )
{
char emsg[1024] = "";
TIFFRGBAImage img;
int ok;
- uint32 tile_xsize, tile_ysize;
- uint32 read_xsize, read_ysize;
- uint32 i_row;
+ uint32_t tile_xsize, tile_ysize;
+ uint32_t read_xsize, read_ysize;
+ uint32_t i_row;
/*
* Verify that our request is legal - on a tile file, and on a
@@ -3060,14 +3060,14 @@ TIFFReadRGBATileExt(TIFF* tif, uint32 col, uint32 row, uint32 * raster, int stop
for( i_row = 0; i_row < read_ysize; i_row++ ) {
memmove( raster + (tile_ysize - i_row - 1) * tile_xsize,
raster + (read_ysize - i_row - 1) * read_xsize,
- read_xsize * sizeof(uint32) );
+ read_xsize * sizeof(uint32_t) );
_TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize+read_xsize,
- 0, sizeof(uint32) * (tile_xsize - read_xsize) );
+ 0, sizeof(uint32_t) * (tile_xsize - read_xsize) );
}
for( i_row = read_ysize; i_row < tile_ysize; i_row++ ) {
_TIFFmemset( raster + (tile_ysize - i_row - 1) * tile_xsize,
- 0, sizeof(uint32) * tile_xsize );
+ 0, sizeof(uint32_t) * tile_xsize );
}
return (ok);
diff --git a/tiff/libtiff/tif_jbig.c b/tiff/libtiff/tif_jbig.c
index a3500e0b..74086338 100644
--- a/tiff/libtiff/tif_jbig.c
+++ b/tiff/libtiff/tif_jbig.c
@@ -46,7 +46,7 @@ static int JBIGSetupDecode(TIFF* tif)
return 1;
}
-static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
+static int JBIGDecode(TIFF* tif, uint8_t* buffer, tmsize_t size, uint16_t s)
{
struct jbg_dec_state decoder;
int decodeStatus = 0;
@@ -101,14 +101,14 @@ static int JBIGDecode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
if( (tmsize_t)decodedSize < size )
{
TIFFWarningExt(tif->tif_clientdata, "JBIG",
- "Only decoded %lu bytes, whereas %lu requested",
- decodedSize, (unsigned long)size);
+ "Only decoded %lu bytes, whereas %"TIFF_SSIZE_FORMAT" requested",
+ decodedSize, size);
}
else if( (tmsize_t)decodedSize > size )
{
TIFFErrorExt(tif->tif_clientdata, "JBIG",
- "Decoded %lu bytes, whereas %lu were requested",
- decodedSize, (unsigned long)size);
+ "Decoded %lu bytes, whereas %"TIFF_SSIZE_FORMAT" were requested",
+ decodedSize, size);
jbg_dec_free(&decoder);
return 0;
}
@@ -133,7 +133,7 @@ static int JBIGSetupEncode(TIFF* tif)
return 1;
}
-static int JBIGCopyEncodedData(TIFF* tif, unsigned char* pp, size_t cc, uint16 s)
+static int JBIGCopyEncodedData(TIFF* tif, unsigned char* pp, size_t cc, uint16_t s)
{
(void) s;
while (cc > 0)
@@ -173,7 +173,7 @@ static void JBIGOutputBie(unsigned char* buffer, size_t len, void* userData)
JBIGCopyEncodedData(tif, buffer, len, 0);
}
-static int JBIGEncode(TIFF* tif, uint8* buffer, tmsize_t size, uint16 s)
+static int JBIGEncode(TIFF* tif, uint8_t* buffer, tmsize_t size, uint16_t s)
{
TIFFDirectory* dir = &tif->tif_dir;
struct jbg_enc_state encoder;
diff --git a/tiff/libtiff/tif_jpeg.c b/tiff/libtiff/tif_jpeg.c
index d051471e..73265808 100644
--- a/tiff/libtiff/tif_jpeg.c
+++ b/tiff/libtiff/tif_jpeg.c
@@ -44,8 +44,8 @@
*/
#include <setjmp.h>
-int TIFFFillStrip(TIFF* tif, uint32 strip);
-int TIFFFillTile(TIFF* tif, uint32 tile);
+int TIFFFillStrip(TIFF* tif, uint32_t strip);
+int TIFFFillTile(TIFF* tif, uint32_t tile);
int TIFFReInitJPEG_12( TIFF *tif, int scheme, int is_encode );
int TIFFJPEGIsFullStripRequired_12(TIFF* tif);
@@ -161,9 +161,9 @@ typedef struct {
jpeg_source_mgr src; /* data source for decompression */
/* private state */
TIFF* tif; /* back link needed by some code */
- uint16 photometric; /* copy of PhotometricInterpretation */
- uint16 h_sampling; /* luminance sampling factors */
- uint16 v_sampling;
+ uint16_t photometric; /* copy of PhotometricInterpretation */
+ uint16_t h_sampling; /* luminance sampling factors */
+ uint16_t v_sampling;
tmsize_t bytesperline; /* decompressed bytes per scanline */
/* pointers to intermediate buffers when processing downsampled data */
JSAMPARRAY ds_buffer[MAX_COMPONENTS];
@@ -177,7 +177,7 @@ typedef struct {
TIFFTileMethod deftparent; /* super-class method */
/* pseudo-tag fields */
void* jpegtables; /* JPEGTables tag value, or NULL */
- uint32 jpegtables_length; /* number of bytes in same */
+ uint32_t jpegtables_length; /* number of bytes in same */
int jpegquality; /* Compression quality level */
int jpegcolormode; /* Auto RGB<=>YCbCr convert? */
int jpegtablesmode; /* What to put in JPEGTables */
@@ -188,12 +188,12 @@ typedef struct {
#define JState(tif) ((JPEGState*)(tif)->tif_data)
-static int JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s);
-static int JPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s);
-static int JPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s);
-static int JPEGEncodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s);
+static int JPEGDecode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s);
+static int JPEGDecodeRaw(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s);
+static int JPEGEncode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s);
+static int JPEGEncodeRaw(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s);
static int JPEGInitializeLibJPEG(TIFF * tif, int decode );
-static int DecodeRowError(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s);
+static int DecodeRowError(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s);
#define FIELD_JPEGTABLES (FIELD_CODEC+0)
@@ -489,7 +489,7 @@ std_term_destination(j_compress_ptr cinfo)
JPEGState* sp = (JPEGState*) cinfo;
TIFF* tif = sp->tif;
- tif->tif_rawcp = (uint8*) sp->dest.next_output_byte;
+ tif->tif_rawcp = (uint8_t*) sp->dest.next_output_byte;
tif->tif_rawcc =
tif->tif_rawdatasize - (tmsize_t) sp->dest.free_in_buffer;
/* NB: libtiff does the final buffer flush */
@@ -543,7 +543,7 @@ tables_term_destination(j_compress_ptr cinfo)
JPEGState* sp = (JPEGState*) cinfo;
/* set tables length to number of bytes actually emitted */
- sp->jpegtables_length -= (uint32) sp->dest.free_in_buffer;
+ sp->jpegtables_length -= (uint32_t) sp->dest.free_in_buffer;
}
static int
@@ -733,18 +733,18 @@ struct JPEGFixupTagsSubsamplingData
{
TIFF* tif;
void* buffer;
- uint32 buffersize;
- uint8* buffercurrentbyte;
- uint32 bufferbytesleft;
- uint64 fileoffset;
- uint64 filebytesleft;
- uint8 filepositioned;
+ uint32_t buffersize;
+ uint8_t* buffercurrentbyte;
+ uint32_t bufferbytesleft;
+ uint64_t fileoffset;
+ uint64_t filebytesleft;
+ uint8_t filepositioned;
};
static void JPEGFixupTagsSubsampling(TIFF* tif);
static int JPEGFixupTagsSubsamplingSec(struct JPEGFixupTagsSubsamplingData* data);
-static int JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result);
-static int JPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint16* result);
-static void JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 skiplength);
+static int JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8_t* result);
+static int JPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint16_t* result);
+static void JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16_t skiplength);
#endif
@@ -790,7 +790,7 @@ JPEGFixupTagsSubsampling(TIFF* tif)
*/
static const char module[] = "JPEGFixupTagsSubsampling";
struct JPEGFixupTagsSubsamplingData m;
- uint64 fileoffset = TIFFGetStrileOffset(tif, 0);
+ uint64_t fileoffset = TIFFGetStrileOffset(tif, 0);
if( fileoffset == 0 )
{
@@ -824,7 +824,7 @@ static int
JPEGFixupTagsSubsamplingSec(struct JPEGFixupTagsSubsamplingData* data)
{
static const char module[] = "JPEGFixupTagsSubsamplingSec";
- uint8 m;
+ uint8_t m;
while (1)
{
while (1)
@@ -869,7 +869,7 @@ JPEGFixupTagsSubsamplingSec(struct JPEGFixupTagsSubsamplingData* data)
case JPEG_MARKER_DRI:
/* this type of marker has data, but it has no use to us and should be skipped */
{
- uint16 n;
+ uint16_t n;
if (!JPEGFixupTagsSubsamplingReadWord(data,&n))
return(0);
if (n<2)
@@ -886,10 +886,10 @@ JPEGFixupTagsSubsamplingSec(struct JPEGFixupTagsSubsamplingData* data)
case JPEG_MARKER_SOF10: /* Progressive arithmetic: normally not allowed by TechNote, but that doesn't hurt supporting it */
/* this marker contains the subsampling factors we're scanning for */
{
- uint16 n;
- uint16 o;
- uint8 p;
- uint8 ph,pv;
+ uint16_t n;
+ uint16_t o;
+ uint8_t p;
+ uint8_t ph,pv;
if (!JPEGFixupTagsSubsamplingReadWord(data,&n))
return(0);
if (n!=8+data->tif->tif_dir.td_samplesperpixel*3)
@@ -922,10 +922,10 @@ JPEGFixupTagsSubsamplingSec(struct JPEGFixupTagsSubsamplingData* data)
if ((ph!=data->tif->tif_dir.td_ycbcrsubsampling[0])||(pv!=data->tif->tif_dir.td_ycbcrsubsampling[1]))
{
TIFFWarningExt(data->tif->tif_clientdata,module,
- "Auto-corrected former TIFF subsampling values [%d,%d] to match subsampling values inside JPEG compressed data [%d,%d]",
- (int)data->tif->tif_dir.td_ycbcrsubsampling[0],
- (int)data->tif->tif_dir.td_ycbcrsubsampling[1],
- (int)ph,(int)pv);
+ "Auto-corrected former TIFF subsampling values [%"PRIu16",%"PRIu16"] to match subsampling values inside JPEG compressed data [%"PRIu8",%"PRIu8"]",
+ data->tif->tif_dir.td_ycbcrsubsampling[0],
+ data->tif->tif_dir.td_ycbcrsubsampling[1],
+ ph, pv);
data->tif->tif_dir.td_ycbcrsubsampling[0]=ph;
data->tif->tif_dir.td_ycbcrsubsampling[1]=pv;
}
@@ -938,11 +938,11 @@ JPEGFixupTagsSubsamplingSec(struct JPEGFixupTagsSubsamplingData* data)
}
static int
-JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8* result)
+JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint8_t* result)
{
if (data->bufferbytesleft==0)
{
- uint32 m;
+ uint32_t m;
if (data->filebytesleft==0)
return(0);
if (!data->filepositioned)
@@ -954,8 +954,8 @@ JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint
data->filepositioned=1;
}
m=data->buffersize;
- if ((uint64)m>data->filebytesleft)
- m=(uint32)data->filebytesleft;
+ if ((uint64_t)m > data->filebytesleft)
+ m=(uint32_t)data->filebytesleft;
assert(m<0x80000000UL);
if (TIFFReadFile(data->tif,data->buffer,(tmsize_t)m)!=(tmsize_t)m)
return(0);
@@ -971,10 +971,10 @@ JPEGFixupTagsSubsamplingReadByte(struct JPEGFixupTagsSubsamplingData* data, uint
}
static int
-JPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint16* result)
+JPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint16_t* result)
{
- uint8 ma;
- uint8 mb;
+ uint8_t ma;
+ uint8_t mb;
if (!JPEGFixupTagsSubsamplingReadByte(data,&ma))
return(0);
if (!JPEGFixupTagsSubsamplingReadByte(data,&mb))
@@ -984,17 +984,17 @@ JPEGFixupTagsSubsamplingReadWord(struct JPEGFixupTagsSubsamplingData* data, uint
}
static void
-JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16 skiplength)
+JPEGFixupTagsSubsamplingSkip(struct JPEGFixupTagsSubsamplingData* data, uint16_t skiplength)
{
- if ((uint32)skiplength<=data->bufferbytesleft)
+ if ((uint32_t)skiplength <= data->bufferbytesleft)
{
data->buffercurrentbyte+=skiplength;
data->bufferbytesleft-=skiplength;
}
else
{
- uint16 m;
- m=(uint16)(skiplength-data->bufferbytesleft);
+ uint16_t m;
+ m=(uint16_t)(skiplength - data->bufferbytesleft);
if (m<=data->filebytesleft)
{
data->bufferbytesleft=0;
@@ -1098,12 +1098,12 @@ int TIFFJPEGIsFullStripRequired(TIFF* tif)
* Set up for decoding a strip or tile.
*/
/*ARGSUSED*/ static int
-JPEGPreDecode(TIFF* tif, uint16 s)
+JPEGPreDecode(TIFF* tif, uint16_t s)
{
JPEGState *sp = JState(tif);
TIFFDirectory *td = &tif->tif_dir;
static const char module[] = "JPEGPreDecode";
- uint32 segment_width, segment_height;
+ uint32_t segment_width, segment_height;
int downsampled_output;
int ci;
@@ -1128,7 +1128,7 @@ JPEGPreDecode(TIFF* tif, uint16 s)
if (TIFFjpeg_read_header(sp, TRUE) != JPEG_HEADER_OK)
return (0);
- tif->tif_rawcp = (uint8*) sp->src.next_input_byte;
+ tif->tif_rawcp = (uint8_t*) sp->src.next_input_byte;
tif->tif_rawcc = sp->src.bytes_in_buffer;
/*
@@ -1157,7 +1157,7 @@ JPEGPreDecode(TIFF* tif, uint16 s)
sp->cinfo.d.image_height < segment_height) {
TIFFWarningExt(tif->tif_clientdata, module,
"Improper JPEG strip/tile size, "
- "expected %dx%d, got %dx%d",
+ "expected %"PRIu32"x%"PRIu32", got %ux%u",
segment_width, segment_height,
sp->cinfo.d.image_width,
sp->cinfo.d.image_height);
@@ -1172,7 +1172,7 @@ JPEGPreDecode(TIFF* tif, uint16 s)
/* we can safely recover from that. */
TIFFWarningExt(tif->tif_clientdata, module,
"JPEG strip size exceeds expected dimensions,"
- " expected %dx%d, got %dx%d",
+ " expected %"PRIu32"x%"PRIu32", got %ux%u",
segment_width, segment_height,
sp->cinfo.d.image_width, sp->cinfo.d.image_height);
}
@@ -1186,7 +1186,7 @@ JPEGPreDecode(TIFF* tif, uint16 s)
*/
TIFFErrorExt(tif->tif_clientdata, module,
"JPEG strip/tile size exceeds expected dimensions,"
- " expected %dx%d, got %dx%d",
+ " expected %"PRIu32"x%"PRIu32", got %ux%u",
segment_width, segment_height,
sp->cinfo.d.image_width, sp->cinfo.d.image_height);
return (0);
@@ -1240,15 +1240,15 @@ JPEGPreDecode(TIFF* tif, uint16 s)
{
TIFFErrorExt(tif->tif_clientdata, module,
"Reading this image would require libjpeg to allocate "
- "at least %u bytes. "
- "This is disabled since above the %u threshold. "
+ "at least %"PRIu64" bytes. "
+ "This is disabled since above the %ld threshold. "
"You may override this restriction by defining the "
"LIBTIFF_ALLOW_LARGE_LIBJPEG_MEM_ALLOC environment variable, "
"or setting the JPEGMEM environment variable to a value greater "
- "or equal to '%uM'",
- (unsigned)(nRequiredMemory),
- (unsigned)(sp->cinfo.d.mem->max_memory_to_use),
- (unsigned)((nRequiredMemory + 1000000 - 1) / 1000000));
+ "or equal to '%"PRIu64"M'",
+ nRequiredMemory,
+ sp->cinfo.d.mem->max_memory_to_use,
+ (nRequiredMemory + 1000000u - 1u) / 1000000u);
return 0;
}
}
@@ -1259,7 +1259,7 @@ JPEGPreDecode(TIFF* tif, uint16 s)
sp->cinfo.d.comp_info[0].v_samp_factor != sp->v_sampling) {
TIFFErrorExt(tif->tif_clientdata, module,
"Improper JPEG sampling factors %d,%d\n"
- "Apparently should be %d,%d.",
+ "Apparently should be %"PRIu16",%"PRIu16".",
sp->cinfo.d.comp_info[0].h_samp_factor,
sp->cinfo.d.comp_info[0].v_samp_factor,
sp->h_sampling, sp->v_sampling);
@@ -1332,7 +1332,7 @@ JPEGPreDecode(TIFF* tif, uint16 s)
*/
#if !JPEG_LIB_MK1_OR_12BIT
static int
-JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+JPEGDecode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
JPEGState *sp = JState(tif);
tmsize_t nrows;
@@ -1377,7 +1377,7 @@ JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
}
/* Update information on consumed data */
- tif->tif_rawcp = (uint8*) sp->src.next_input_byte;
+ tif->tif_rawcp = (uint8_t*) sp->src.next_input_byte;
tif->tif_rawcc = sp->src.bytes_in_buffer;
/* Close down the decompressor if we've finished the strip or tile. */
@@ -1388,7 +1388,7 @@ JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
#if JPEG_LIB_MK1_OR_12BIT
/*ARGSUSED*/ static int
-JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+JPEGDecode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
JPEGState *sp = JState(tif);
tmsize_t nrows;
@@ -1483,7 +1483,7 @@ JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
}
/* Update information on consumed data */
- tif->tif_rawcp = (uint8*) sp->src.next_input_byte;
+ tif->tif_rawcp = (uint8_t*) sp->src.next_input_byte;
tif->tif_rawcc = sp->src.bytes_in_buffer;
/* Close down the decompressor if we've finished the strip or tile. */
@@ -1493,7 +1493,7 @@ JPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
#endif /* JPEG_LIB_MK1_OR_12BIT */
/*ARGSUSED*/ static int
-DecodeRowError(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+DecodeRowError(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
(void) buf;
@@ -1510,7 +1510,7 @@ DecodeRowError(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
* Returned data is downsampled per sampling factors.
*/
/*ARGSUSED*/ static int
-JPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+JPEGDecodeRaw(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
JPEGState *sp = JState(tif);
tmsize_t nrows;
@@ -1521,7 +1521,7 @@ JPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
/* For last strip, limit number of rows to its truncated height */
/* even if the codestream height is larger (which is not compliant, */
/* but that we tolerate) */
- if( (uint32)nrows > td->td_imagelength - tif->tif_row && !isTiled(tif) )
+ if((uint32_t)nrows > td->td_imagelength - tif->tif_row && !isTiled(tif) )
nrows = td->td_imagelength - tif->tif_row;
/* data is expected to be read in multiples of a scanline */
@@ -1793,7 +1793,7 @@ JPEGSetupEncode(TIFF* tif)
if( td->td_bitspersample > 16 )
{
TIFFErrorExt(tif->tif_clientdata, module,
- "BitsPerSample %d not allowed for JPEG",
+ "BitsPerSample %"PRIu16" not allowed for JPEG",
td->td_bitspersample);
return (0);
}
@@ -1823,8 +1823,8 @@ JPEGSetupEncode(TIFF* tif)
case PHOTOMETRIC_PALETTE: /* disallowed by Tech Note */
case PHOTOMETRIC_MASK:
TIFFErrorExt(tif->tif_clientdata, module,
- "PhotometricInterpretation %d not allowed for JPEG",
- (int) sp->photometric);
+ "PhotometricInterpretation %"PRIu16" not allowed for JPEG",
+ sp->photometric);
return (0);
default:
/* TIFF 6.0 forbids subsampling of all other color spaces */
@@ -1847,8 +1847,8 @@ JPEGSetupEncode(TIFF* tif)
if (td->td_bitspersample != BITS_IN_JSAMPLE )
#endif
{
- TIFFErrorExt(tif->tif_clientdata, module, "BitsPerSample %d not allowed for JPEG",
- (int) td->td_bitspersample);
+ TIFFErrorExt(tif->tif_clientdata, module, "BitsPerSample %"PRIu16" not allowed for JPEG",
+ td->td_bitspersample);
return (0);
}
sp->cinfo.c.data_precision = td->td_bitspersample;
@@ -1858,22 +1858,22 @@ JPEGSetupEncode(TIFF* tif)
if (isTiled(tif)) {
if ((td->td_tilelength % (sp->v_sampling * DCTSIZE)) != 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "JPEG tile height must be multiple of %d",
- sp->v_sampling * DCTSIZE);
+ "JPEG tile height must be multiple of %"PRIu32,
+ (uint32_t)(sp->v_sampling * DCTSIZE));
return (0);
}
if ((td->td_tilewidth % (sp->h_sampling * DCTSIZE)) != 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "JPEG tile width must be multiple of %d",
- sp->h_sampling * DCTSIZE);
+ "JPEG tile width must be multiple of %"PRIu32,
+ (uint32_t)(sp->h_sampling * DCTSIZE));
return (0);
}
} else {
if (td->td_rowsperstrip < td->td_imagelength &&
(td->td_rowsperstrip % (sp->v_sampling * DCTSIZE)) != 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "RowsPerStrip must be multiple of %d for JPEG",
- sp->v_sampling * DCTSIZE);
+ "RowsPerStrip must be multiple of %"PRIu32" for JPEG",
+ (uint32_t)(sp->v_sampling * DCTSIZE));
return (0);
}
}
@@ -1906,12 +1906,12 @@ JPEGSetupEncode(TIFF* tif)
* Set encoding state at the start of a strip or tile.
*/
static int
-JPEGPreEncode(TIFF* tif, uint16 s)
+JPEGPreEncode(TIFF* tif, uint16_t s)
{
JPEGState *sp = JState(tif);
TIFFDirectory *td = &tif->tif_dir;
static const char module[] = "JPEGPreEncode";
- uint32 segment_width, segment_height;
+ uint32_t segment_width, segment_height;
int downsampled_input;
assert(sp != NULL);
@@ -2043,7 +2043,7 @@ JPEGPreEncode(TIFF* tif, uint16 s)
* "Standard" case: incoming data is not downsampled.
*/
static int
-JPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+JPEGEncode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
JPEGState *sp = JState(tif);
tmsize_t nrows;
@@ -2121,7 +2121,7 @@ JPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
* Incoming data is expected to be downsampled per sampling factors.
*/
static int
-JPEGEncodeRaw(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+JPEGEncodeRaw(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
JPEGState *sp = JState(tif);
JSAMPLE* inptr;
@@ -2295,17 +2295,17 @@ JPEGResetUpsampled( TIFF* tif )
}
static int
-JPEGVSetField(TIFF* tif, uint32 tag, va_list ap)
+JPEGVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
JPEGState* sp = JState(tif);
const TIFFField* fip;
- uint32 v32;
+ uint32_t v32;
assert(sp != NULL);
switch (tag) {
case TIFFTAG_JPEGTABLES:
- v32 = (uint32) va_arg(ap, uint32);
+ v32 = (uint32_t) va_arg(ap, uint32_t);
if (v32 == 0) {
/* XXX */
return (0);
@@ -2350,7 +2350,7 @@ JPEGVSetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-JPEGVGetField(TIFF* tif, uint32 tag, va_list ap)
+JPEGVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
JPEGState* sp = JState(tif);
@@ -2358,7 +2358,7 @@ JPEGVGetField(TIFF* tif, uint32 tag, va_list ap)
switch (tag) {
case TIFFTAG_JPEGTABLES:
- *va_arg(ap, uint32*) = sp->jpegtables_length;
+ *va_arg(ap, uint32_t*) = sp->jpegtables_length;
*va_arg(ap, const void**) = sp->jpegtables;
break;
case TIFFTAG_JPEGQUALITY:
@@ -2386,15 +2386,15 @@ JPEGPrintDir(TIFF* tif, FILE* fd, long flags)
if( sp != NULL ) {
if (TIFFFieldSet(tif,FIELD_JPEGTABLES))
- fprintf(fd, " JPEG Tables: (%lu bytes)\n",
- (unsigned long) sp->jpegtables_length);
+ fprintf(fd, " JPEG Tables: (%"PRIu32" bytes)\n",
+ sp->jpegtables_length);
if (sp->printdir)
(*sp->printdir)(tif, fd, flags);
}
}
-static uint32
-JPEGDefaultStripSize(TIFF* tif, uint32 s)
+static uint32_t
+JPEGDefaultStripSize(TIFF* tif, uint32_t s)
{
JPEGState* sp = JState(tif);
TIFFDirectory *td = &tif->tif_dir;
@@ -2406,7 +2406,7 @@ JPEGDefaultStripSize(TIFF* tif, uint32 s)
}
static void
-JPEGDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)
+JPEGDefaultTileSize(TIFF* tif, uint32_t* tw, uint32_t* th)
{
JPEGState* sp = JState(tif);
TIFFDirectory *td = &tif->tif_dir;
@@ -2510,7 +2510,7 @@ TIFFInitJPEG(TIFF* tif, int scheme)
/*
* Allocate state block so tag methods have storage to record values.
*/
- tif->tif_data = (uint8*) _TIFFmalloc(sizeof (JPEGState));
+ tif->tif_data = (uint8_t*) _TIFFmalloc(sizeof (JPEGState));
if (tif->tif_data == NULL) {
TIFFErrorExt(tif->tif_clientdata,
diff --git a/tiff/libtiff/tif_lerc.c b/tiff/libtiff/tif_lerc.c
new file mode 100644
index 00000000..a4aeb4a1
--- /dev/null
+++ b/tiff/libtiff/tif_lerc.c
@@ -0,0 +1,1277 @@
+/*
+* Copyright (c) 2018, Even Rouault
+* Author: <even.rouault at spatialys.com>
+*
+* Permission to use, copy, modify, distribute, and sell this software and
+* its documentation for any purpose is hereby granted without fee, provided
+* that (i) the above copyright notices and this permission notice appear in
+* all copies of the software and related documentation, and (ii) the names of
+* Sam Leffler and Silicon Graphics may not be used in any advertising or
+* publicity relating to the software without the specific, prior written
+* permission of Sam Leffler and Silicon Graphics.
+*
+* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
+* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
+* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
+*
+* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
+* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
+* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
+* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+* OF THIS SOFTWARE.
+*/
+
+#include "tiffiop.h"
+#ifdef LERC_SUPPORT
+/*
+* TIFF Library.
+*
+* LERC Compression Support
+*
+*/
+
+#include "Lerc_c_api.h"
+#include "zlib.h"
+#ifdef ZSTD_SUPPORT
+#include "zstd.h"
+#endif
+
+#if LIBDEFLATE_SUPPORT
+#include "libdeflate.h"
+#endif
+#define LIBDEFLATE_MAX_COMPRESSION_LEVEL 12
+
+#include <assert.h>
+
+#define LSTATE_INIT_DECODE 0x01
+#define LSTATE_INIT_ENCODE 0x02
+
+#ifndef LERC_AT_LEAST_VERSION
+#define LERC_AT_LEAST_VERSION(maj,min,patch) 0
+#endif
+
+/*
+* State block for each open TIFF file using LERC compression/decompression.
+*/
+typedef struct {
+ double maxzerror; /* max z error */
+ int lerc_version;
+ int additional_compression;
+ int zstd_compress_level; /* zstd */
+ int zipquality; /* deflate */
+ int state; /* state flags */
+
+ uint32_t segment_width;
+ uint32_t segment_height;
+
+ unsigned int uncompressed_size;
+ unsigned int uncompressed_alloc;
+ uint8_t *uncompressed_buffer;
+ unsigned int uncompressed_offset;
+
+ unsigned int mask_size;
+ uint8_t *mask_buffer;
+
+ unsigned int compressed_size;
+ void *compressed_buffer;
+
+#if LIBDEFLATE_SUPPORT
+ struct libdeflate_decompressor* libdeflate_dec;
+ struct libdeflate_compressor* libdeflate_enc;
+#endif
+
+ TIFFVGetMethod vgetparent; /* super-class method */
+ TIFFVSetMethod vsetparent; /* super-class method */
+} LERCState;
+
+#define LState(tif) ((LERCState*) (tif)->tif_data)
+#define DecoderState(tif) LState(tif)
+#define EncoderState(tif) LState(tif)
+
+static int LERCEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s);
+static int LERCDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s);
+
+static int
+LERCFixupTags(TIFF* tif)
+{
+ (void) tif;
+ return 1;
+}
+
+static int
+LERCSetupDecode(TIFF* tif)
+{
+ LERCState* sp = DecoderState(tif);
+
+ assert(sp != NULL);
+
+ /* if we were last encoding, terminate this mode */
+ if (sp->state & LSTATE_INIT_ENCODE) {
+ sp->state = 0;
+ }
+
+ sp->state |= LSTATE_INIT_DECODE;
+ return 1;
+}
+
+static int GetLercDataType(TIFF* tif)
+{
+ TIFFDirectory *td = &tif->tif_dir;
+ static const char module[] = "GetLercDataType";
+
+ if( td->td_sampleformat == SAMPLEFORMAT_INT &&
+ td->td_bitspersample == 8 )
+ {
+ return 0;
+ }
+
+ if( td->td_sampleformat == SAMPLEFORMAT_UINT &&
+ td->td_bitspersample == 8 )
+ {
+ return 1;
+ }
+
+ if( td->td_sampleformat == SAMPLEFORMAT_INT &&
+ td->td_bitspersample == 16 )
+ {
+ return 2;
+ }
+
+ if( td->td_sampleformat == SAMPLEFORMAT_UINT &&
+ td->td_bitspersample == 16 )
+ {
+ return 3;
+ }
+
+ if( td->td_sampleformat == SAMPLEFORMAT_INT &&
+ td->td_bitspersample == 32 )
+ {
+ return 4;
+ }
+
+ if( td->td_sampleformat == SAMPLEFORMAT_UINT &&
+ td->td_bitspersample == 32 )
+ {
+ return 5;
+ }
+
+ if( td->td_sampleformat == SAMPLEFORMAT_IEEEFP &&
+ td->td_bitspersample == 32 )
+ {
+ return 6;
+ }
+
+ if( td->td_sampleformat == SAMPLEFORMAT_IEEEFP &&
+ td->td_bitspersample == 64 )
+ {
+ return 7;
+ }
+
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unsupported combination of SampleFormat and td_bitspersample");
+ return -1;
+}
+
+static int SetupUncompressedBuffer(TIFF* tif, LERCState* sp,
+ const char* module)
+{
+ TIFFDirectory *td = &tif->tif_dir;
+ uint64_t new_size_64;
+ uint64_t new_alloc_64;
+ unsigned int new_size;
+ unsigned int new_alloc;
+
+ sp->uncompressed_offset = 0;
+
+ if (isTiled(tif)) {
+ sp->segment_width = td->td_tilewidth;
+ sp->segment_height = td->td_tilelength;
+ } else {
+ sp->segment_width = td->td_imagewidth;
+ sp->segment_height = td->td_imagelength - tif->tif_row;
+ if (sp->segment_height > td->td_rowsperstrip)
+ sp->segment_height = td->td_rowsperstrip;
+ }
+
+ new_size_64 = (uint64_t)sp->segment_width * sp->segment_height *
+ (td->td_bitspersample / 8);
+ if( td->td_planarconfig == PLANARCONFIG_CONTIG )
+ {
+ new_size_64 *= td->td_samplesperpixel;
+ }
+
+ new_size = (unsigned int)new_size_64;
+ sp->uncompressed_size = new_size;
+
+ /* add some margin as we are going to use it also to store deflate/zstd compressed data */
+ new_alloc_64 = 100 + new_size_64 + new_size_64 / 3;
+#ifdef ZSTD_SUPPORT
+ {
+ size_t zstd_max = ZSTD_compressBound((size_t)new_size_64);
+ if( new_alloc_64 < zstd_max )
+ {
+ new_alloc_64 = zstd_max;
+ }
+ }
+#endif
+ new_alloc = (unsigned int)new_alloc_64;
+ if( new_alloc != new_alloc_64 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Too large uncompressed strip/tile");
+ _TIFFfree(sp->uncompressed_buffer);
+ sp->uncompressed_buffer = 0;
+ sp->uncompressed_alloc = 0;
+ return 0;
+ }
+
+ if( sp->uncompressed_alloc < new_alloc )
+ {
+ _TIFFfree(sp->uncompressed_buffer);
+ sp->uncompressed_buffer = _TIFFmalloc(new_alloc);
+ if( !sp->uncompressed_buffer )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot allocate buffer");
+ _TIFFfree(sp->uncompressed_buffer);
+ sp->uncompressed_buffer = 0;
+ sp->uncompressed_alloc = 0;
+ return 0;
+ }
+ sp->uncompressed_alloc = new_alloc;
+ }
+
+ if( (td->td_planarconfig == PLANARCONFIG_CONTIG &&
+ td->td_extrasamples > 0 &&
+ td->td_sampleinfo[td->td_extrasamples-1] == EXTRASAMPLE_UNASSALPHA &&
+ GetLercDataType(tif) == 1 ) ||
+ (td->td_sampleformat == SAMPLEFORMAT_IEEEFP &&
+ (td->td_planarconfig == PLANARCONFIG_SEPARATE ||
+ td->td_samplesperpixel == 1) &&
+ (td->td_bitspersample == 32 || td->td_bitspersample == 64 )) )
+ {
+ unsigned int mask_size = sp->segment_width * sp->segment_height;
+ if( sp->mask_size < mask_size )
+ {
+ void* mask_buffer = _TIFFrealloc(sp->mask_buffer, mask_size);
+ if( mask_buffer == NULL )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot allocate buffer");
+ sp->mask_size = 0;
+ _TIFFfree(sp->uncompressed_buffer);
+ sp->uncompressed_buffer = 0;
+ sp->uncompressed_alloc = 0;
+ return 0;
+ }
+ sp->mask_buffer = (uint8_t*)mask_buffer;
+ sp->mask_size = mask_size;
+ }
+ }
+
+ return 1;
+}
+
+/*
+* Setup state for decoding a strip.
+*/
+static int
+LERCPreDecode(TIFF* tif, uint16_t s)
+{
+ static const char module[] = "LERCPreDecode";
+ lerc_status lerc_ret;
+ TIFFDirectory *td = &tif->tif_dir;
+ LERCState* sp = DecoderState(tif);
+ int lerc_data_type;
+ unsigned int infoArray[8];
+ unsigned nomask_bands = td->td_samplesperpixel;
+ int ndims;
+ int use_mask = 0;
+ uint8_t* lerc_data = tif->tif_rawcp;
+ unsigned int lerc_data_size = (unsigned int)tif->tif_rawcc;
+
+ (void) s;
+ assert(sp != NULL);
+ if( sp->state != LSTATE_INIT_DECODE )
+ tif->tif_setupdecode(tif);
+
+ lerc_data_type = GetLercDataType(tif);
+ if( lerc_data_type < 0 )
+ return 0;
+
+ if( !SetupUncompressedBuffer(tif, sp, module) )
+ return 0;
+
+ if( sp->additional_compression != LERC_ADD_COMPRESSION_NONE )
+ {
+ if( sp->compressed_size < sp->uncompressed_alloc )
+ {
+ _TIFFfree(sp->compressed_buffer);
+ sp->compressed_buffer = _TIFFmalloc(sp->uncompressed_alloc);
+ if( !sp->compressed_buffer )
+ {
+ sp->compressed_size = 0;
+ return 0;
+ }
+ sp->compressed_size = sp->uncompressed_alloc;
+ }
+ }
+
+ if( sp->additional_compression == LERC_ADD_COMPRESSION_DEFLATE )
+ {
+#if LIBDEFLATE_SUPPORT
+ enum libdeflate_result res;
+ size_t lerc_data_sizet = 0;
+ if( sp->libdeflate_dec == NULL )
+ {
+ sp->libdeflate_dec = libdeflate_alloc_decompressor();
+ if( sp->libdeflate_dec == NULL )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot allocate decompressor");
+ return 0;
+ }
+ }
+
+ res = libdeflate_zlib_decompress(
+ sp->libdeflate_dec, tif->tif_rawcp, (size_t)tif->tif_rawcc,
+ sp->compressed_buffer, sp->compressed_size,
+ &lerc_data_sizet);
+ if( res != LIBDEFLATE_SUCCESS )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Decoding error at scanline %lu",
+ (unsigned long) tif->tif_row);
+ return 0;
+ }
+ assert( lerc_data_sizet == (unsigned int)lerc_data_sizet );
+ lerc_data = sp->compressed_buffer;
+ lerc_data_size = (unsigned int)lerc_data_sizet;
+#else
+ z_stream strm;
+ int zlib_ret;
+
+ memset(&strm, 0, sizeof(strm));
+ strm.zalloc = NULL;
+ strm.zfree = NULL;
+ strm.opaque = NULL;
+ zlib_ret = inflateInit(&strm);
+ if( zlib_ret != Z_OK )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "inflateInit() failed");
+ inflateEnd(&strm);
+ return 0;
+ }
+
+ strm.avail_in = (uInt)tif->tif_rawcc;
+ strm.next_in = tif->tif_rawcp;
+ strm.avail_out = sp->compressed_size;
+ strm.next_out = sp->compressed_buffer;
+ zlib_ret = inflate(&strm, Z_FINISH);
+ if( zlib_ret != Z_STREAM_END && zlib_ret != Z_OK )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "inflate() failed");
+ inflateEnd(&strm);
+ return 0;
+ }
+ lerc_data = sp->compressed_buffer;
+ lerc_data_size = sp->compressed_size - strm.avail_out;
+ inflateEnd(&strm);
+#endif
+ }
+ else if( sp->additional_compression == LERC_ADD_COMPRESSION_ZSTD )
+ {
+#ifdef ZSTD_SUPPORT
+ size_t zstd_ret;
+
+ zstd_ret = ZSTD_decompress(sp->compressed_buffer,
+ sp->compressed_size,
+ tif->tif_rawcp,
+ tif->tif_rawcc);
+ if( ZSTD_isError(zstd_ret) ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in ZSTD_decompress(): %s",
+ ZSTD_getErrorName(zstd_ret));
+ return 0;
+ }
+
+ lerc_data = sp->compressed_buffer;
+ lerc_data_size = (unsigned int)zstd_ret;
+#else
+ TIFFErrorExt(tif->tif_clientdata, module, "ZSTD support missing");
+ return 0;
+#endif
+ }
+ else if( sp->additional_compression != LERC_ADD_COMPRESSION_NONE )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unhandled additional compression");
+ return 0;
+ }
+
+ lerc_ret = lerc_getBlobInfo(
+ lerc_data,
+ lerc_data_size,
+ infoArray,
+ NULL,
+ 8,
+ 0);
+ if( lerc_ret != 0 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "lerc_getBlobInfo() failed");
+ return 0;
+ }
+
+ /* If the configuration is compatible of a LERC mask, and that the */
+ /* LERC info has dim == samplesperpixel - 1, then there is a LERC */
+ /* mask. */
+ if( td->td_planarconfig == PLANARCONFIG_CONTIG &&
+ td->td_extrasamples > 0 &&
+ td->td_sampleinfo[td->td_extrasamples-1] == EXTRASAMPLE_UNASSALPHA &&
+ GetLercDataType(tif) == 1 &&
+ infoArray[2] == td->td_samplesperpixel - 1U )
+ {
+ use_mask = 1;
+ nomask_bands --;
+ }
+ else if( td->td_sampleformat == SAMPLEFORMAT_IEEEFP &&
+ (td->td_planarconfig == PLANARCONFIG_SEPARATE ||
+ td->td_samplesperpixel == 1) &&
+ (td->td_bitspersample == 32 || td->td_bitspersample == 64) )
+ {
+ use_mask = 1;
+ }
+
+ ndims = td->td_planarconfig == PLANARCONFIG_CONTIG ?
+ nomask_bands : 1;
+
+ /* Info returned in infoArray is { version, dataType, nDim, nCols,
+ nRows, nBands, nValidPixels, blobSize } */
+ if( infoArray[0] != (unsigned)sp->lerc_version )
+ {
+ TIFFWarningExt(tif->tif_clientdata, module,
+ "Unexpected version number: %d. Expected: %d",
+ infoArray[0], sp->lerc_version);
+ }
+ if( infoArray[1] != (unsigned)lerc_data_type )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unexpected dataType: %d. Expected: %d",
+ infoArray[1], lerc_data_type);
+ return 0;
+ }
+ if( infoArray[2] != (unsigned)ndims )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unexpected nDim: %d. Expected: %d",
+ infoArray[2], ndims);
+ return 0;
+ }
+ if( infoArray[3] != sp->segment_width )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unexpected nCols: %d. Expected: %du",
+ infoArray[3], sp->segment_width);
+ return 0;
+ }
+ if( infoArray[4] != sp->segment_height )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unexpected nRows: %d. Expected: %u",
+ infoArray[4], sp->segment_height);
+ return 0;
+ }
+ if( infoArray[5] != 1 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unexpected nBands: %d. Expected: %d",
+ infoArray[5], 1);
+ return 0;
+ }
+ if( infoArray[7] != lerc_data_size )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unexpected blobSize: %d. Expected: %u",
+ infoArray[7],
+ lerc_data_size);
+ return 0;
+ }
+
+ lerc_ret = lerc_decode(
+ lerc_data,
+ lerc_data_size,
+#if LERC_AT_LEAST_VERSION(3,0,0)
+ use_mask ? 1 : 0,
+#endif
+ use_mask ? sp->mask_buffer : NULL,
+ ndims,
+ sp->segment_width,
+ sp->segment_height,
+ 1,
+ lerc_data_type,
+ sp->uncompressed_buffer);
+ if( lerc_ret != 0 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "lerc_decode() failed");
+ return 0;
+ }
+
+ /* Interleave alpha mask with other samples. */
+ if( use_mask && GetLercDataType(tif) == 1 )
+ {
+ unsigned src_stride =
+ (td->td_samplesperpixel - 1) * (td->td_bitspersample / 8);
+ unsigned dst_stride =
+ td->td_samplesperpixel * (td->td_bitspersample / 8);
+ unsigned i = sp->segment_width * sp->segment_height;
+ /* Operate from end to begin to be able to move in place */
+ while( i > 0 && i > nomask_bands )
+ {
+ i --;
+ sp->uncompressed_buffer[
+ i * dst_stride + td->td_samplesperpixel - 1] =
+ 255 * sp->mask_buffer[i];
+ memcpy( sp->uncompressed_buffer + i * dst_stride,
+ sp->uncompressed_buffer + i * src_stride,
+ src_stride );
+ }
+ /* First pixels must use memmove due to overlapping areas */
+ while( i > 0 )
+ {
+ i --;
+ sp->uncompressed_buffer[
+ i * dst_stride + td->td_samplesperpixel - 1] =
+ 255 * sp->mask_buffer[i];
+ memmove( sp->uncompressed_buffer + i * dst_stride,
+ sp->uncompressed_buffer + i * src_stride,
+ src_stride );
+ }
+ }
+ else if( use_mask && td->td_sampleformat == SAMPLEFORMAT_IEEEFP )
+ {
+ const unsigned nb_pixels = sp->segment_width * sp->segment_height;
+ unsigned i;
+#if HOST_BIGENDIAN
+ const unsigned char nan_bytes[] = { 0x7f, 0xc0, 0, 0 };
+#else
+ const unsigned char nan_bytes[] = { 0, 0, 0xc0, 0x7f };
+#endif
+ float nan_float32;
+ memcpy(&nan_float32, nan_bytes, 4);
+
+ if( td->td_bitspersample == 32 )
+ {
+ for( i = 0; i < nb_pixels; i++ )
+ {
+ if( sp->mask_buffer[i] == 0 )
+ ((float*)sp->uncompressed_buffer)[i] = nan_float32;
+ }
+ }
+ else
+ {
+ const double nan_float64 = nan_float32;
+ for( i = 0; i < nb_pixels; i++ )
+ {
+ if( sp->mask_buffer[i] == 0 )
+ ((double*)sp->uncompressed_buffer)[i] = nan_float64;
+ }
+ }
+ }
+
+ return 1;
+}
+
+/*
+* Decode a strip, tile or scanline.
+*/
+static int
+LERCDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
+{
+ static const char module[] = "LERCDecode";
+ LERCState* sp = DecoderState(tif);
+
+ (void) s;
+ assert(sp != NULL);
+ assert(sp->state == LSTATE_INIT_DECODE);
+
+ if( sp->uncompressed_buffer == 0 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Uncompressed buffer not allocated");
+ return 0;
+ }
+
+ if( (uint64_t)sp->uncompressed_offset +
+ (uint64_t)occ > sp->uncompressed_size )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Too many bytes read");
+ return 0;
+ }
+
+ memcpy(op,
+ sp->uncompressed_buffer + sp->uncompressed_offset,
+ occ);
+ sp->uncompressed_offset += (unsigned)occ;
+
+ return 1;
+}
+
+static int
+LERCSetupEncode(TIFF* tif)
+{
+ LERCState* sp = EncoderState(tif);
+
+ assert(sp != NULL);
+ if (sp->state & LSTATE_INIT_DECODE) {
+ sp->state = 0;
+ }
+
+ sp->state |= LSTATE_INIT_ENCODE;
+
+ return 1;
+}
+
+/*
+* Reset encoding state at the start of a strip.
+*/
+static int
+LERCPreEncode(TIFF* tif, uint16_t s)
+{
+ static const char module[] = "LERCPreEncode";
+ LERCState *sp = EncoderState(tif);
+ int lerc_data_type;
+
+ (void) s;
+ assert(sp != NULL);
+ if( sp->state != LSTATE_INIT_ENCODE )
+ tif->tif_setupencode(tif);
+
+ lerc_data_type = GetLercDataType(tif);
+ if( lerc_data_type < 0 )
+ return 0;
+
+ if( !SetupUncompressedBuffer(tif, sp, module) )
+ return 0;
+
+ return 1;
+}
+
+/*
+* Encode a chunk of pixels.
+*/
+static int
+LERCEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
+{
+ static const char module[] = "LERCEncode";
+ LERCState *sp = EncoderState(tif);
+
+ (void)s;
+ assert(sp != NULL);
+ assert(sp->state == LSTATE_INIT_ENCODE);
+
+ if( (uint64_t)sp->uncompressed_offset +
+ (uint64_t)cc > sp->uncompressed_size )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Too many bytes written");
+ return 0;
+ }
+
+ memcpy(sp->uncompressed_buffer + sp->uncompressed_offset,
+ bp, cc);
+ sp->uncompressed_offset += (unsigned)cc;
+
+ return 1;
+}
+
+/*
+* Finish off an encoded strip by flushing it.
+*/
+static int
+LERCPostEncode(TIFF* tif)
+{
+ lerc_status lerc_ret;
+ static const char module[] = "LERCPostEncode";
+ LERCState *sp = EncoderState(tif);
+ unsigned int numBytes = 0;
+ unsigned int numBytesWritten = 0;
+ TIFFDirectory *td = &tif->tif_dir;
+ int use_mask = 0;
+ unsigned dst_nbands = td->td_samplesperpixel;
+
+ if( sp->uncompressed_offset != sp->uncompressed_size )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unexpected number of bytes in the buffer");
+ return 0;
+ }
+
+ /* Extract alpha mask (if containing only 0 and 255 values, */
+ /* and compact array of regular bands */
+ if( td->td_planarconfig == PLANARCONFIG_CONTIG &&
+ td->td_extrasamples > 0 &&
+ td->td_sampleinfo[td->td_extrasamples-1] == EXTRASAMPLE_UNASSALPHA &&
+ GetLercDataType(tif) == 1 )
+ {
+ const unsigned dst_stride = (td->td_samplesperpixel - 1) *
+ (td->td_bitspersample / 8);
+ const unsigned src_stride = td->td_samplesperpixel *
+ (td->td_bitspersample / 8);
+ unsigned i = 0;
+ const unsigned nb_pixels = sp->segment_width * sp->segment_height;
+
+ use_mask = 1;
+ for( i = 0 ; i < nb_pixels; i++)
+ {
+ int v = sp->uncompressed_buffer[
+ i * src_stride + td->td_samplesperpixel - 1];
+ if( v != 0 && v != 255 )
+ {
+ use_mask = 0;
+ break;
+ }
+ }
+
+ if( use_mask )
+ {
+ dst_nbands --;
+ /* First pixels must use memmove due to overlapping areas */
+ for( i = 0 ;i < dst_nbands && i < nb_pixels; i++)
+ {
+ memmove( sp->uncompressed_buffer + i * dst_stride,
+ sp->uncompressed_buffer + i * src_stride,
+ dst_stride );
+ sp->mask_buffer[i] = sp->uncompressed_buffer[
+ i * src_stride + td->td_samplesperpixel - 1];
+ }
+ for(; i < nb_pixels; i++)
+ {
+ memcpy( sp->uncompressed_buffer + i * dst_stride,
+ sp->uncompressed_buffer + i * src_stride,
+ dst_stride );
+ sp->mask_buffer[i] = sp->uncompressed_buffer[
+ i * src_stride + td->td_samplesperpixel - 1];
+ }
+ }
+ }
+ else if( td->td_sampleformat == SAMPLEFORMAT_IEEEFP &&
+ (td->td_planarconfig == PLANARCONFIG_SEPARATE ||
+ dst_nbands == 1) &&
+ (td->td_bitspersample == 32 || td->td_bitspersample == 64 ) )
+ {
+ /* Check for NaN values */
+ unsigned i;
+ const unsigned nb_pixels = sp->segment_width * sp->segment_height;
+ if( td->td_bitspersample == 32 )
+ {
+ for( i = 0; i < nb_pixels; i++ )
+ {
+ const float val = ((float*)sp->uncompressed_buffer)[i];
+ if( val != val )
+ {
+ use_mask = 1;
+ break;
+ }
+ }
+ }
+ else
+ {
+ for( i = 0; i < nb_pixels; i++ )
+ {
+ const double val = ((double*)sp->uncompressed_buffer)[i];
+ if( val != val )
+ {
+ use_mask = 1;
+ break;
+ }
+ }
+ }
+
+ if( use_mask )
+ {
+ if( td->td_bitspersample == 32 )
+ {
+ for( i = 0; i < nb_pixels; i++ )
+ {
+ const float val = ((float*)sp->uncompressed_buffer)[i];
+ sp->mask_buffer[i] = ( val == val ) ? 255 : 0;
+ }
+ }
+ else
+ {
+ for( i = 0; i < nb_pixels; i++ )
+ {
+ const double val = ((double*)sp->uncompressed_buffer)[i];
+ sp->mask_buffer[i] = ( val == val ) ? 255 : 0;
+ }
+ }
+ }
+ }
+
+
+#if 0
+ lerc_ret = lerc_computeCompressedSize(
+ sp->uncompressed_buffer,
+ sp->lerc_version,
+ GetLercDataType(tif),
+ td->td_planarconfig == PLANARCONFIG_CONTIG ?
+ dst_nbands : 1,
+ sp->segment_width,
+ sp->segment_height,
+ 1,
+ use_mask ? sp->mask_buffer : NULL,
+ sp->maxzerror,
+ &numBytes);
+ if( lerc_ret != 0 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "lerc_computeCompressedSize() failed");
+ return 0;
+ }
+#else
+ numBytes = sp->uncompressed_alloc;
+#endif
+
+ if( sp->compressed_size < numBytes )
+ {
+ _TIFFfree(sp->compressed_buffer);
+ sp->compressed_buffer = _TIFFmalloc(numBytes);
+ if( !sp->compressed_buffer )
+ {
+ sp->compressed_size = 0;
+ return 0;
+ }
+ sp->compressed_size = numBytes;
+ }
+
+ lerc_ret = lerc_encodeForVersion(
+ sp->uncompressed_buffer,
+ sp->lerc_version,
+ GetLercDataType(tif),
+ td->td_planarconfig == PLANARCONFIG_CONTIG ?
+ dst_nbands : 1,
+ sp->segment_width,
+ sp->segment_height,
+ 1,
+#if LERC_AT_LEAST_VERSION(3,0,0)
+ use_mask ? 1 : 0,
+#endif
+ use_mask ? sp->mask_buffer : NULL,
+ sp->maxzerror,
+ sp->compressed_buffer,
+ sp->compressed_size,
+ &numBytesWritten);
+ if( lerc_ret != 0 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "lerc_encode() failed");
+ return 0;
+ }
+ assert( numBytesWritten < numBytes );
+
+ if( sp->additional_compression == LERC_ADD_COMPRESSION_DEFLATE )
+ {
+#if LIBDEFLATE_SUPPORT
+ if( sp->libdeflate_enc == NULL )
+ {
+ /* To get results as good as zlib, we ask for an extra */
+ /* level of compression */
+ sp->libdeflate_enc = libdeflate_alloc_compressor(
+ sp->zipquality == Z_DEFAULT_COMPRESSION ? 7 :
+ sp->zipquality >= 6 && sp->zipquality <= 9 ? sp->zipquality + 1 :
+ sp->zipquality);
+ if( sp->libdeflate_enc == NULL )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Cannot allocate compressor");
+ return 0;
+ }
+ }
+
+ /* Should not happen normally */
+ if( libdeflate_zlib_compress_bound(sp->libdeflate_enc, numBytesWritten) >
+ sp->uncompressed_alloc )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Output buffer for libdeflate too small");
+ return 0;
+ }
+
+ tif->tif_rawcc = libdeflate_zlib_compress(
+ sp->libdeflate_enc,
+ sp->compressed_buffer, numBytesWritten,
+ sp->uncompressed_buffer, sp->uncompressed_alloc);
+
+ if( tif->tif_rawcc == 0 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Encoder error at scanline %lu",
+ (unsigned long) tif->tif_row);
+ return 0;
+ }
+#else
+ z_stream strm;
+ int zlib_ret;
+ int cappedQuality = sp->zipquality;
+ if( cappedQuality > Z_BEST_COMPRESSION )
+ cappedQuality = Z_BEST_COMPRESSION;
+
+ memset(&strm, 0, sizeof(strm));
+ strm.zalloc = NULL;
+ strm.zfree = NULL;
+ strm.opaque = NULL;
+ zlib_ret = deflateInit(&strm, cappedQuality);
+ if( zlib_ret != Z_OK )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "deflateInit() failed");
+ return 0;
+ }
+
+ strm.avail_in = numBytesWritten;
+ strm.next_in = sp->compressed_buffer;
+ strm.avail_out = sp->uncompressed_alloc;
+ strm.next_out = sp->uncompressed_buffer;
+ zlib_ret = deflate(&strm, Z_FINISH);
+ if( zlib_ret == Z_STREAM_END )
+ {
+ tif->tif_rawcc = sp->uncompressed_alloc - strm.avail_out;
+ }
+ deflateEnd(&strm);
+ if( zlib_ret != Z_STREAM_END )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "deflate() failed");
+ return 0;
+ }
+#endif
+ {
+ int ret;
+ uint8_t* tif_rawdata_backup = tif->tif_rawdata;
+ tif->tif_rawdata = sp->uncompressed_buffer;
+ ret = TIFFFlushData1(tif);
+ tif->tif_rawdata = tif_rawdata_backup;
+ if( !ret )
+ {
+ return 0;
+ }
+ }
+ }
+ else if( sp->additional_compression == LERC_ADD_COMPRESSION_ZSTD )
+ {
+#ifdef ZSTD_SUPPORT
+ size_t zstd_ret = ZSTD_compress( sp->uncompressed_buffer,
+ sp->uncompressed_alloc,
+ sp->compressed_buffer,
+ numBytesWritten,
+ sp->zstd_compress_level );
+ if( ZSTD_isError(zstd_ret) ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Error in ZSTD_compress(): %s",
+ ZSTD_getErrorName(zstd_ret));
+ return 0;
+ }
+
+ {
+ int ret;
+ uint8_t* tif_rawdata_backup = tif->tif_rawdata;
+ tif->tif_rawdata = sp->uncompressed_buffer;
+ tif->tif_rawcc = zstd_ret;
+ ret = TIFFFlushData1(tif);
+ tif->tif_rawdata = tif_rawdata_backup;
+ if( !ret )
+ {
+ return 0;
+ }
+ }
+#else
+ TIFFErrorExt(tif->tif_clientdata, module, "ZSTD support missing");
+ return 0;
+#endif
+ }
+ else if( sp->additional_compression != LERC_ADD_COMPRESSION_NONE )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Unhandled additional compression");
+ return 0;
+ }
+ else
+ {
+ int ret;
+ uint8_t* tif_rawdata_backup = tif->tif_rawdata;
+ tif->tif_rawdata = sp->compressed_buffer;
+ tif->tif_rawcc = numBytesWritten;
+ ret = TIFFFlushData1(tif);
+ tif->tif_rawdata = tif_rawdata_backup;
+ if( !ret )
+ return 0;
+ }
+
+ return 1;
+}
+
+static void
+LERCCleanup(TIFF* tif)
+{
+ LERCState* sp = LState(tif);
+
+ assert(sp != 0);
+
+ tif->tif_tagmethods.vgetfield = sp->vgetparent;
+ tif->tif_tagmethods.vsetfield = sp->vsetparent;
+
+ _TIFFfree(sp->uncompressed_buffer);
+ _TIFFfree(sp->compressed_buffer);
+ _TIFFfree(sp->mask_buffer);
+
+#if LIBDEFLATE_SUPPORT
+ if( sp->libdeflate_dec )
+ libdeflate_free_decompressor(sp->libdeflate_dec);
+ if( sp->libdeflate_enc )
+ libdeflate_free_compressor(sp->libdeflate_enc);
+#endif
+
+ _TIFFfree(sp);
+ tif->tif_data = NULL;
+
+ _TIFFSetDefaultCompressionState(tif);
+}
+
+static const TIFFField LERCFields[] = {
+ { TIFFTAG_LERC_PARAMETERS, TIFF_VARIABLE2, TIFF_VARIABLE2,
+ TIFF_LONG, 0, TIFF_SETGET_C32_UINT32, TIFF_SETGET_UNDEFINED,
+ FIELD_CUSTOM, FALSE, TRUE, "LercParameters", NULL },
+ { TIFFTAG_LERC_MAXZERROR, 0, 0, TIFF_ANY, 0, TIFF_SETGET_DOUBLE,
+ TIFF_SETGET_UNDEFINED,
+ FIELD_PSEUDO, TRUE, FALSE, "LercMaximumError", NULL },
+ { TIFFTAG_LERC_VERSION, 0, 0, TIFF_ANY, 0, TIFF_SETGET_UINT32,
+ TIFF_SETGET_UNDEFINED,
+ FIELD_PSEUDO, FALSE, FALSE, "LercVersion", NULL },
+ { TIFFTAG_LERC_ADD_COMPRESSION, 0, 0, TIFF_ANY, 0, TIFF_SETGET_UINT32,
+ TIFF_SETGET_UNDEFINED,
+ FIELD_PSEUDO, FALSE, FALSE, "LercAdditionalCompression", NULL },
+ { TIFFTAG_ZSTD_LEVEL, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
+ TIFF_SETGET_UNDEFINED,
+ FIELD_PSEUDO, TRUE, FALSE, "ZSTD zstd_compress_level", NULL },
+ { TIFFTAG_ZIPQUALITY, 0, 0, TIFF_ANY, 0, TIFF_SETGET_INT,
+ TIFF_SETGET_UNDEFINED, FIELD_PSEUDO, TRUE, FALSE, "", NULL },
+};
+
+static int LERCVSetFieldBase(TIFF* tif, uint32_t tag, ...)
+{
+ LERCState* sp = LState(tif);
+ int ret;
+ va_list ap;
+ va_start(ap, tag);
+ ret = (*sp->vsetparent)(tif, tag, ap);
+ va_end(ap);
+ return ret;
+}
+
+static int
+LERCVSetField(TIFF* tif, uint32_t tag, va_list ap)
+{
+ static const char module[] = "LERCVSetField";
+ LERCState* sp = LState(tif);
+
+ switch (tag) {
+ case TIFFTAG_LERC_PARAMETERS:
+ {
+ uint32_t count = va_arg(ap, int);
+ int* params = va_arg(ap, int*);
+ if( count < 2 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Invalid count for LercParameters: %u", count);
+ return 0;
+ }
+ sp->lerc_version = params[0];
+ sp->additional_compression = params[1];
+ return LERCVSetFieldBase(tif, TIFFTAG_LERC_PARAMETERS,
+ count, params);
+ }
+ case TIFFTAG_LERC_MAXZERROR:
+ sp->maxzerror = va_arg(ap, double);
+ return 1;
+ case TIFFTAG_LERC_VERSION:
+ {
+ int params[2] = {0, 0};
+ int version = va_arg(ap, int);
+ if( version != LERC_VERSION_2_4 )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Invalid value for LercVersion: %d", version);
+ return 0;
+ }
+ sp->lerc_version = version;
+ params[0] = sp->lerc_version;
+ params[1] = sp->additional_compression;
+ return LERCVSetFieldBase(tif, TIFFTAG_LERC_PARAMETERS,
+ 2, params);
+ }
+ case TIFFTAG_LERC_ADD_COMPRESSION:
+ {
+ int params[2] = {0, 0};
+ int additional_compression = va_arg(ap, int);
+#ifndef ZSTD_SUPPORT
+ if( additional_compression == LERC_ADD_COMPRESSION_ZSTD )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "LERC_ZSTD requested, but ZSTD not available");
+ return 0;
+ }
+#endif
+ if( additional_compression != LERC_ADD_COMPRESSION_NONE &&
+ additional_compression != LERC_ADD_COMPRESSION_DEFLATE &&
+ additional_compression != LERC_ADD_COMPRESSION_ZSTD )
+ {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Invalid value for LercAdditionalCompression: %d",
+ additional_compression);
+ return 0;
+ }
+ sp->additional_compression = additional_compression;
+ params[0] = sp->lerc_version;
+ params[1] = sp->additional_compression;
+ return LERCVSetFieldBase(tif, TIFFTAG_LERC_PARAMETERS,
+ 2, params);
+ }
+#ifdef ZSTD_SUPPORT
+ case TIFFTAG_ZSTD_LEVEL:
+ {
+ sp->zstd_compress_level = (int) va_arg(ap, int);
+ if( sp->zstd_compress_level <= 0 ||
+ sp->zstd_compress_level > ZSTD_maxCLevel() )
+ {
+ TIFFWarningExt(tif->tif_clientdata, module,
+ "ZSTD_LEVEL should be between 1 and %d",
+ ZSTD_maxCLevel());
+ }
+ return 1;
+ }
+#endif
+ case TIFFTAG_ZIPQUALITY:
+ {
+ sp->zipquality = (int) va_arg(ap, int);
+ if( sp->zipquality < Z_DEFAULT_COMPRESSION ||
+ sp->zipquality > LIBDEFLATE_MAX_COMPRESSION_LEVEL ) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Invalid ZipQuality value. Should be in [-1,%d] range",
+ LIBDEFLATE_MAX_COMPRESSION_LEVEL);
+ return 0;
+ }
+
+#if LIBDEFLATE_SUPPORT
+ if( sp->libdeflate_enc )
+ {
+ libdeflate_free_compressor(sp->libdeflate_enc);
+ sp->libdeflate_enc = NULL;
+ }
+#endif
+
+ return (1);
+ }
+ default:
+ return (*sp->vsetparent)(tif, tag, ap);
+ }
+ /*NOTREACHED*/
+}
+
+static int
+LERCVGetField(TIFF* tif, uint32_t tag, va_list ap)
+{
+ LERCState* sp = LState(tif);
+
+ switch (tag) {
+ case TIFFTAG_LERC_MAXZERROR:
+ *va_arg(ap, double*) = sp->maxzerror;
+ break;
+ case TIFFTAG_LERC_VERSION:
+ *va_arg(ap, int*) = sp->lerc_version;
+ break;
+ case TIFFTAG_LERC_ADD_COMPRESSION:
+ *va_arg(ap, int*) = sp->additional_compression;
+ break;
+ case TIFFTAG_ZSTD_LEVEL:
+ *va_arg(ap, int*) = sp->zstd_compress_level;
+ break;
+ case TIFFTAG_ZIPQUALITY:
+ *va_arg(ap, int*) = sp->zipquality;
+ break;
+ default:
+ return (*sp->vgetparent)(tif, tag, ap);
+ }
+ return 1;
+}
+
+int TIFFInitLERC(TIFF* tif, int scheme)
+{
+ static const char module[] = "TIFFInitLERC";
+ LERCState* sp;
+
+ (void) scheme;
+ assert( scheme == COMPRESSION_LERC );
+
+ /*
+ * Merge codec-specific tag information.
+ */
+ if (!_TIFFMergeFields(tif, LERCFields, TIFFArrayCount(LERCFields))) {
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "Merging LERC codec-specific tags failed");
+ return 0;
+ }
+
+ /*
+ * Allocate state block so tag methods have storage to record values.
+ */
+ tif->tif_data = (uint8_t*) _TIFFcalloc(1, sizeof(LERCState));
+ if (tif->tif_data == NULL)
+ goto bad;
+ sp = LState(tif);
+
+ /*
+ * Override parent get/set field methods.
+ */
+ sp->vgetparent = tif->tif_tagmethods.vgetfield;
+ tif->tif_tagmethods.vgetfield = LERCVGetField; /* hook for codec tags */
+ sp->vsetparent = tif->tif_tagmethods.vsetfield;
+ tif->tif_tagmethods.vsetfield = LERCVSetField; /* hook for codec tags */
+
+ /*
+ * Install codec methods.
+ */
+ tif->tif_fixuptags = LERCFixupTags;
+ tif->tif_setupdecode = LERCSetupDecode;
+ tif->tif_predecode = LERCPreDecode;
+ tif->tif_decoderow = LERCDecode;
+ tif->tif_decodestrip = LERCDecode;
+ tif->tif_decodetile = LERCDecode;
+ tif->tif_setupencode = LERCSetupEncode;
+ tif->tif_preencode = LERCPreEncode;
+ tif->tif_postencode = LERCPostEncode;
+ tif->tif_encoderow = LERCEncode;
+ tif->tif_encodestrip = LERCEncode;
+ tif->tif_encodetile = LERCEncode;
+ tif->tif_cleanup = LERCCleanup;
+
+ /* Default values for codec-specific fields */
+ TIFFSetField(tif, TIFFTAG_LERC_VERSION, LERC_VERSION_2_4);
+ TIFFSetField(tif, TIFFTAG_LERC_ADD_COMPRESSION, LERC_ADD_COMPRESSION_NONE);
+ sp->maxzerror = 0.0;
+ sp->zstd_compress_level = 9; /* default comp. level */
+ sp->zipquality = Z_DEFAULT_COMPRESSION; /* default comp. level */
+ sp->state = 0;
+
+ return 1;
+bad:
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "No space for LERC state block");
+ return 0;
+}
+#endif /* LERC_SUPPORT */
diff --git a/tiff/libtiff/tif_luv.c b/tiff/libtiff/tif_luv.c
index 3bd02e88..13765eab 100644
--- a/tiff/libtiff/tif_luv.c
+++ b/tiff/libtiff/tif_luv.c
@@ -161,9 +161,9 @@ struct logLuvState {
int encode_meth; /* encoding method */
int pixel_size; /* bytes per pixel */
- uint8* tbuf; /* translation buffer */
+ uint8_t* tbuf; /* translation buffer */
tmsize_t tbuflen; /* buffer length */
- void (*tfunc)(LogLuvState*, uint8*, tmsize_t);
+ void (*tfunc)(LogLuvState*, uint8_t*, tmsize_t);
TIFFVSetMethod vgetparent; /* super-class method */
TIFFVSetMethod vsetparent; /* super-class method */
@@ -180,7 +180,7 @@ struct logLuvState {
* Decode a string of 16-bit gray pixels.
*/
static int
-LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+LogL16Decode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "LogL16Decode";
LogLuvState* sp = DecoderState(tif);
@@ -188,8 +188,8 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
tmsize_t i;
tmsize_t npixels;
unsigned char* bp;
- int16* tp;
- int16 b;
+ int16_t* tp;
+ int16_t b;
tmsize_t cc;
int rc;
@@ -200,14 +200,14 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
npixels = occ / sp->pixel_size;
if (sp->user_datafmt == SGILOGDATAFMT_16BIT)
- tp = (int16*) op;
+ tp = (int16_t*) op;
else {
if(sp->tbuflen < npixels) {
TIFFErrorExt(tif->tif_clientdata, module,
"Translation buffer too short");
return (0);
}
- tp = (int16*) sp->tbuf;
+ tp = (int16_t*) sp->tbuf;
}
_TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0]));
@@ -220,35 +220,28 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
if( cc < 2 )
break;
rc = *bp++ + (2-128);
- b = (int16)(*bp++ << shft);
+ b = (int16_t)(*bp++ << shft);
cc -= 2;
while (rc-- && i < npixels)
tp[i++] |= b;
} else { /* non-run */
rc = *bp++; /* nul is noop */
while (--cc && rc-- && i < npixels)
- tp[i++] |= (int16)*bp++ << shft;
+ tp[i++] |= (int16_t)*bp++ << shft;
}
}
if (i != npixels) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at row %lu (short %I64d pixels)",
- (unsigned long) tif->tif_row,
- (unsigned __int64) (npixels - i));
-#else
- TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at row %lu (short %llu pixels)",
- (unsigned long) tif->tif_row,
- (unsigned long long) (npixels - i));
-#endif
- tif->tif_rawcp = (uint8*) bp;
+ "Not enough data at row %"PRIu32" (short %"TIFF_SSIZE_FORMAT" pixels)",
+ tif->tif_row,
+ npixels - i);
+ tif->tif_rawcp = (uint8_t*) bp;
tif->tif_rawcc = cc;
return (0);
}
}
(*sp->tfunc)(sp, op, npixels);
- tif->tif_rawcp = (uint8*) bp;
+ tif->tif_rawcp = (uint8_t*) bp;
tif->tif_rawcc = cc;
return (1);
}
@@ -257,7 +250,7 @@ LogL16Decode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
* Decode a string of 24-bit pixels.
*/
static int
-LogLuvDecode24(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+LogLuvDecode24(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "LogLuvDecode24";
LogLuvState* sp = DecoderState(tif);
@@ -265,7 +258,7 @@ LogLuvDecode24(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
tmsize_t i;
tmsize_t npixels;
unsigned char* bp;
- uint32* tp;
+ uint32_t* tp;
(void)s;
assert(s == 0);
@@ -274,16 +267,16 @@ LogLuvDecode24(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
npixels = occ / sp->pixel_size;
if (sp->user_datafmt == SGILOGDATAFMT_RAW)
- tp = (uint32 *)op;
+ tp = (uint32_t *)op;
else {
if(sp->tbuflen < npixels) {
TIFFErrorExt(tif->tif_clientdata, module,
"Translation buffer too short");
return (0);
}
- tp = (uint32 *) sp->tbuf;
+ tp = (uint32_t *) sp->tbuf;
}
- /* copy to array of uint32 */
+ /* copy to array of uint32_t */
bp = (unsigned char*) tif->tif_rawcp;
cc = tif->tif_rawcc;
for (i = 0; i < npixels && cc >= 3; i++) {
@@ -291,20 +284,13 @@ LogLuvDecode24(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
bp += 3;
cc -= 3;
}
- tif->tif_rawcp = (uint8*) bp;
+ tif->tif_rawcp = (uint8_t*) bp;
tif->tif_rawcc = cc;
if (i != npixels) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at row %lu (short %I64d pixels)",
- (unsigned long) tif->tif_row,
- (unsigned __int64) (npixels - i));
-#else
TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at row %lu (short %llu pixels)",
- (unsigned long) tif->tif_row,
- (unsigned long long) (npixels - i));
-#endif
+ "Not enough data at row %"PRIu32" (short %"TIFF_SSIZE_FORMAT" pixels)",
+ tif->tif_row,
+ npixels - i);
return (0);
}
(*sp->tfunc)(sp, op, npixels);
@@ -315,7 +301,7 @@ LogLuvDecode24(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
* Decode a string of 32-bit pixels.
*/
static int
-LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+LogLuvDecode32(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "LogLuvDecode32";
LogLuvState* sp;
@@ -323,8 +309,8 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
tmsize_t i;
tmsize_t npixels;
unsigned char* bp;
- uint32* tp;
- uint32 b;
+ uint32_t* tp;
+ uint32_t b;
tmsize_t cc;
int rc;
@@ -336,14 +322,14 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
npixels = occ / sp->pixel_size;
if (sp->user_datafmt == SGILOGDATAFMT_RAW)
- tp = (uint32*) op;
+ tp = (uint32_t*) op;
else {
if(sp->tbuflen < npixels) {
TIFFErrorExt(tif->tif_clientdata, module,
"Translation buffer too short");
return (0);
}
- tp = (uint32*) sp->tbuf;
+ tp = (uint32_t*) sp->tbuf;
}
_TIFFmemset((void*) tp, 0, npixels*sizeof (tp[0]));
@@ -356,35 +342,28 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
if( cc < 2 )
break;
rc = *bp++ + (2-128);
- b = (uint32)*bp++ << shft;
+ b = (uint32_t)*bp++ << shft;
cc -= 2;
while (rc-- && i < npixels)
tp[i++] |= b;
} else { /* non-run */
rc = *bp++; /* nul is noop */
while (--cc && rc-- && i < npixels)
- tp[i++] |= (uint32)*bp++ << shft;
+ tp[i++] |= (uint32_t)*bp++ << shft;
}
}
if (i != npixels) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at row %lu (short %I64d pixels)",
- (unsigned long) tif->tif_row,
- (unsigned __int64) (npixels - i));
-#else
TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at row %lu (short %llu pixels)",
- (unsigned long) tif->tif_row,
- (unsigned long long) (npixels - i));
-#endif
- tif->tif_rawcp = (uint8*) bp;
+ "Not enough data at row %"PRIu32" (short %"TIFF_SSIZE_FORMAT" pixels)",
+ tif->tif_row,
+ npixels - i);
+ tif->tif_rawcp = (uint8_t*) bp;
tif->tif_rawcc = cc;
return (0);
}
}
(*sp->tfunc)(sp, op, npixels);
- tif->tif_rawcp = (uint8*) bp;
+ tif->tif_rawcp = (uint8_t*) bp;
tif->tif_rawcc = cc;
return (1);
}
@@ -395,7 +374,7 @@ LogLuvDecode32(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
* is row by row.
*/
static int
-LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+LogLuvDecodeStrip(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
tmsize_t rowlen = TIFFScanlineSize(tif);
@@ -416,7 +395,7 @@ LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
* is row by row.
*/
static int
-LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+LogLuvDecodeTile(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
tmsize_t rowlen = TIFFTileRowSize(tif);
@@ -435,7 +414,7 @@ LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
* Encode a row of 16-bit pixels.
*/
static int
-LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+LogL16Encode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "LogL16Encode";
LogLuvState* sp = EncoderState(tif);
@@ -443,9 +422,9 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
tmsize_t i;
tmsize_t j;
tmsize_t npixels;
- uint8* op;
- int16* tp;
- int16 b;
+ uint8_t* op;
+ int16_t* tp;
+ int16_t b;
tmsize_t occ;
int rc=0, mask;
tmsize_t beg;
@@ -456,9 +435,9 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
npixels = cc / sp->pixel_size;
if (sp->user_datafmt == SGILOGDATAFMT_16BIT)
- tp = (int16*) bp;
+ tp = (int16_t*) bp;
else {
- tp = (int16*) sp->tbuf;
+ tp = (int16_t*) sp->tbuf;
if(sp->tbuflen < npixels) {
TIFFErrorExt(tif->tif_clientdata, module,
"Translation buffer too short");
@@ -481,7 +460,7 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
}
mask = 0xff << shft; /* find next run */
for (beg = i; beg < npixels; beg += rc) {
- b = (int16) (tp[beg] & mask);
+ b = (int16_t) (tp[beg] & mask);
rc = 1;
while (rc < 127+2 && beg+rc < npixels &&
(tp[beg+rc] & mask) == b)
@@ -490,12 +469,12 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
break; /* long enough */
}
if (beg-i > 1 && beg-i < MINRUN) {
- b = (int16) (tp[i] & mask);/*check short run */
+ b = (int16_t) (tp[i] & mask);/*check short run */
j = i+1;
while ((tp[j++] & mask) == b)
if (j == beg) {
- *op++ = (uint8)(128-2+j-i);
- *op++ = (uint8)(b >> shft);
+ *op++ = (uint8_t)(128 - 2 + j - i);
+ *op++ = (uint8_t)(b >> shft);
occ -= 2;
i = beg;
break;
@@ -511,15 +490,15 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
op = tif->tif_rawcp;
occ = tif->tif_rawdatasize - tif->tif_rawcc;
}
- *op++ = (uint8) j; occ--;
+ *op++ = (uint8_t) j; occ--;
while (j--) {
- *op++ = (uint8) (tp[i++] >> shft & 0xff);
+ *op++ = (uint8_t) (tp[i++] >> shft & 0xff);
occ--;
}
}
if (rc >= MINRUN) { /* write out run */
- *op++ = (uint8) (128-2+rc);
- *op++ = (uint8) (tp[beg] >> shft & 0xff);
+ *op++ = (uint8_t) (128 - 2 + rc);
+ *op++ = (uint8_t) (tp[beg] >> shft & 0xff);
occ -= 2;
} else
rc = 0;
@@ -535,15 +514,15 @@ LogL16Encode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
* Encode a row of 24-bit pixels.
*/
static int
-LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+LogLuvEncode24(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "LogLuvEncode24";
LogLuvState* sp = EncoderState(tif);
tmsize_t i;
tmsize_t npixels;
tmsize_t occ;
- uint8* op;
- uint32* tp;
+ uint8_t* op;
+ uint32_t* tp;
(void)s;
assert(s == 0);
@@ -551,9 +530,9 @@ LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
npixels = cc / sp->pixel_size;
if (sp->user_datafmt == SGILOGDATAFMT_RAW)
- tp = (uint32*) bp;
+ tp = (uint32_t*) bp;
else {
- tp = (uint32*) sp->tbuf;
+ tp = (uint32_t*) sp->tbuf;
if(sp->tbuflen < npixels) {
TIFFErrorExt(tif->tif_clientdata, module,
"Translation buffer too short");
@@ -573,9 +552,9 @@ LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
op = tif->tif_rawcp;
occ = tif->tif_rawdatasize - tif->tif_rawcc;
}
- *op++ = (uint8)(*tp >> 16);
- *op++ = (uint8)(*tp >> 8 & 0xff);
- *op++ = (uint8)(*tp++ & 0xff);
+ *op++ = (uint8_t)(*tp >> 16);
+ *op++ = (uint8_t)(*tp >> 8 & 0xff);
+ *op++ = (uint8_t)(*tp++ & 0xff);
occ -= 3;
}
tif->tif_rawcp = op;
@@ -588,7 +567,7 @@ LogLuvEncode24(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
* Encode a row of 32-bit pixels.
*/
static int
-LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+LogLuvEncode32(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "LogLuvEncode32";
LogLuvState* sp = EncoderState(tif);
@@ -596,9 +575,9 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
tmsize_t i;
tmsize_t j;
tmsize_t npixels;
- uint8* op;
- uint32* tp;
- uint32 b;
+ uint8_t* op;
+ uint32_t* tp;
+ uint32_t b;
tmsize_t occ;
int rc=0, mask;
tmsize_t beg;
@@ -610,9 +589,9 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
npixels = cc / sp->pixel_size;
if (sp->user_datafmt == SGILOGDATAFMT_RAW)
- tp = (uint32*) bp;
+ tp = (uint32_t*) bp;
else {
- tp = (uint32*) sp->tbuf;
+ tp = (uint32_t*) sp->tbuf;
if(sp->tbuflen < npixels) {
TIFFErrorExt(tif->tif_clientdata, module,
"Translation buffer too short");
@@ -648,8 +627,8 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
j = i+1;
while ((tp[j++] & mask) == b)
if (j == beg) {
- *op++ = (uint8)(128-2+j-i);
- *op++ = (uint8)(b >> shft);
+ *op++ = (uint8_t)(128 - 2 + j - i);
+ *op++ = (uint8_t)(b >> shft);
occ -= 2;
i = beg;
break;
@@ -665,15 +644,15 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
op = tif->tif_rawcp;
occ = tif->tif_rawdatasize - tif->tif_rawcc;
}
- *op++ = (uint8) j; occ--;
+ *op++ = (uint8_t) j; occ--;
while (j--) {
- *op++ = (uint8)(tp[i++] >> shft & 0xff);
+ *op++ = (uint8_t)(tp[i++] >> shft & 0xff);
occ--;
}
}
if (rc >= MINRUN) { /* write out run */
- *op++ = (uint8) (128-2+rc);
- *op++ = (uint8)(tp[beg] >> shft & 0xff);
+ *op++ = (uint8_t) (128 - 2 + rc);
+ *op++ = (uint8_t)(tp[beg] >> shft & 0xff);
occ -= 2;
} else
rc = 0;
@@ -690,7 +669,7 @@ LogLuvEncode32(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
* avoid encoding runs across row boundaries.
*/
static int
-LogLuvEncodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+LogLuvEncodeStrip(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
tmsize_t rowlen = TIFFScanlineSize(tif);
@@ -710,7 +689,7 @@ LogLuvEncodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
* avoid encoding runs across row boundaries.
*/
static int
-LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+LogLuvEncodeTile(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
tmsize_t rowlen = TIFFTileRowSize(tif);
@@ -790,9 +769,9 @@ LogL16fromY(double Y, int em) /* get 16-bit LogL from Y */
}
static void
-L16toY(LogLuvState* sp, uint8* op, tmsize_t n)
+L16toY(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- int16* l16 = (int16*) sp->tbuf;
+ int16_t* l16 = (int16_t*) sp->tbuf;
float* yp = (float*) op;
while (n-- > 0)
@@ -800,32 +779,32 @@ L16toY(LogLuvState* sp, uint8* op, tmsize_t n)
}
static void
-L16toGry(LogLuvState* sp, uint8* op, tmsize_t n)
+L16toGry(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- int16* l16 = (int16*) sp->tbuf;
- uint8* gp = (uint8*) op;
+ int16_t* l16 = (int16_t*) sp->tbuf;
+ uint8_t* gp = (uint8_t*) op;
while (n-- > 0) {
double Y = LogL16toY(*l16++);
- *gp++ = (uint8) ((Y <= 0.) ? 0 : (Y >= 1.) ? 255 : (int)(256.*sqrt(Y)));
+ *gp++ = (uint8_t) ((Y <= 0.) ? 0 : (Y >= 1.) ? 255 : (int)(256. * sqrt(Y)));
}
}
static void
-L16fromY(LogLuvState* sp, uint8* op, tmsize_t n)
+L16fromY(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- int16* l16 = (int16*) sp->tbuf;
+ int16_t* l16 = (int16_t*) sp->tbuf;
float* yp = (float*) op;
while (n-- > 0)
- *l16++ = (int16) (LogL16fromY(*yp++, sp->encode_meth));
+ *l16++ = (int16_t) (LogL16fromY(*yp++, sp->encode_meth));
}
#if !LOGLUV_PUBLIC
static
#endif
void
-XYZtoRGB24(float xyz[3], uint8 rgb[3])
+XYZtoRGB24(float xyz[3], uint8_t rgb[3])
{
double r, g, b;
/* assume CCIR-709 primaries */
@@ -834,9 +813,9 @@ XYZtoRGB24(float xyz[3], uint8 rgb[3])
b = 0.061*xyz[0] + -0.224*xyz[1] + 1.163*xyz[2];
/* assume 2.0 gamma for speed */
/* could use integer sqrt approx., but this is probably faster */
- rgb[0] = (uint8)((r<=0.) ? 0 : (r >= 1.) ? 255 : (int)(256.*sqrt(r)));
- rgb[1] = (uint8)((g<=0.) ? 0 : (g >= 1.) ? 255 : (int)(256.*sqrt(g)));
- rgb[2] = (uint8)((b<=0.) ? 0 : (b >= 1.) ? 255 : (int)(256.*sqrt(b)));
+ rgb[0] = (uint8_t)((r <= 0.) ? 0 : (r >= 1.) ? 255 : (int)(256. * sqrt(r)));
+ rgb[1] = (uint8_t)((g <= 0.) ? 0 : (g >= 1.) ? 255 : (int)(256. * sqrt(g)));
+ rgb[2] = (uint8_t)((b <= 0.) ? 0 : (b >= 1.) ? 255 : (int)(256. * sqrt(b)));
}
#if !LOGLUV_PUBLIC
@@ -979,7 +958,7 @@ uv_decode(double *up, double *vp, int c) /* decode (u',v') index */
static
#endif
void
-LogLuv24toXYZ(uint32 p, float XYZ[3])
+LogLuv24toXYZ(uint32_t p, float XYZ[3])
{
int Ce;
double L, u, v, s, x, y;
@@ -1006,7 +985,7 @@ LogLuv24toXYZ(uint32 p, float XYZ[3])
#if !LOGLUV_PUBLIC
static
#endif
-uint32
+uint32_t
LogLuv24fromXYZ(float XYZ[3], int em)
{
int Le, Ce;
@@ -1030,9 +1009,9 @@ LogLuv24fromXYZ(float XYZ[3], int em)
}
static void
-Luv24toXYZ(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv24toXYZ(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
float* xyz = (float*) op;
while (n-- > 0) {
@@ -1043,30 +1022,30 @@ Luv24toXYZ(LogLuvState* sp, uint8* op, tmsize_t n)
}
static void
-Luv24toLuv48(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv24toLuv48(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
- int16* luv3 = (int16*) op;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
+ int16_t* luv3 = (int16_t*) op;
while (n-- > 0) {
double u, v;
- *luv3++ = (int16)((*luv >> 12 & 0xffd) + 13314);
+ *luv3++ = (int16_t)((*luv >> 12 & 0xffd) + 13314);
if (uv_decode(&u, &v, *luv&0x3fff) < 0) {
u = U_NEU;
v = V_NEU;
}
- *luv3++ = (int16)(u * (1L<<15));
- *luv3++ = (int16)(v * (1L<<15));
+ *luv3++ = (int16_t)(u * (1L << 15));
+ *luv3++ = (int16_t)(v * (1L << 15));
luv++;
}
}
static void
-Luv24toRGB(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv24toRGB(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
- uint8* rgb = (uint8*) op;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
+ uint8_t* rgb = (uint8_t*) op;
while (n-- > 0) {
float xyz[3];
@@ -1078,9 +1057,9 @@ Luv24toRGB(LogLuvState* sp, uint8* op, tmsize_t n)
}
static void
-Luv24fromXYZ(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv24fromXYZ(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
float* xyz = (float*) op;
while (n-- > 0) {
@@ -1090,10 +1069,10 @@ Luv24fromXYZ(LogLuvState* sp, uint8* op, tmsize_t n)
}
static void
-Luv24fromLuv48(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv24fromLuv48(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
- int16* luv3 = (int16*) op;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
+ int16_t* luv3 = (int16_t*) op;
while (n-- > 0) {
int Le, Ce;
@@ -1111,7 +1090,7 @@ Luv24fromLuv48(LogLuvState* sp, uint8* op, tmsize_t n)
sp->encode_meth);
if (Ce < 0) /* never happens */
Ce = uv_encode(U_NEU, V_NEU, SGILOGENCODE_NODITHER);
- *luv++ = (uint32)Le << 14 | Ce;
+ *luv++ = (uint32_t)Le << 14 | Ce;
luv3 += 3;
}
}
@@ -1120,7 +1099,7 @@ Luv24fromLuv48(LogLuvState* sp, uint8* op, tmsize_t n)
static
#endif
void
-LogLuv32toXYZ(uint32 p, float XYZ[3])
+LogLuv32toXYZ(uint32_t p, float XYZ[3])
{
double L, u, v, s, x, y;
/* decode luminance */
@@ -1144,7 +1123,7 @@ LogLuv32toXYZ(uint32 p, float XYZ[3])
#if !LOGLUV_PUBLIC
static
#endif
-uint32
+uint32_t
LogLuv32fromXYZ(float XYZ[3], int em)
{
unsigned int Le, ue, ve;
@@ -1171,9 +1150,9 @@ LogLuv32fromXYZ(float XYZ[3], int em)
}
static void
-Luv32toXYZ(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv32toXYZ(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
float* xyz = (float*) op;
while (n-- > 0) {
@@ -1183,28 +1162,28 @@ Luv32toXYZ(LogLuvState* sp, uint8* op, tmsize_t n)
}
static void
-Luv32toLuv48(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv32toLuv48(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
- int16* luv3 = (int16*) op;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
+ int16_t* luv3 = (int16_t*) op;
while (n-- > 0) {
double u, v;
- *luv3++ = (int16)(*luv >> 16);
+ *luv3++ = (int16_t)(*luv >> 16);
u = 1./UVSCALE * ((*luv>>8 & 0xff) + .5);
v = 1./UVSCALE * ((*luv & 0xff) + .5);
- *luv3++ = (int16)(u * (1L<<15));
- *luv3++ = (int16)(v * (1L<<15));
+ *luv3++ = (int16_t)(u * (1L << 15));
+ *luv3++ = (int16_t)(v * (1L << 15));
luv++;
}
}
static void
-Luv32toRGB(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv32toRGB(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
- uint8* rgb = (uint8*) op;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
+ uint8_t* rgb = (uint8_t*) op;
while (n-- > 0) {
float xyz[3];
@@ -1216,9 +1195,9 @@ Luv32toRGB(LogLuvState* sp, uint8* op, tmsize_t n)
}
static void
-Luv32fromXYZ(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv32fromXYZ(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
float* xyz = (float*) op;
while (n-- > 0) {
@@ -1228,30 +1207,30 @@ Luv32fromXYZ(LogLuvState* sp, uint8* op, tmsize_t n)
}
static void
-Luv32fromLuv48(LogLuvState* sp, uint8* op, tmsize_t n)
+Luv32fromLuv48(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
- uint32* luv = (uint32*) sp->tbuf;
- int16* luv3 = (int16*) op;
+ uint32_t* luv = (uint32_t*) sp->tbuf;
+ int16_t* luv3 = (int16_t*) op;
if (sp->encode_meth == SGILOGENCODE_NODITHER) {
while (n-- > 0) {
- *luv++ = (uint32)luv3[0] << 16 |
- (luv3[1]*(uint32)(UVSCALE+.5) >> 7 & 0xff00) |
- (luv3[2]*(uint32)(UVSCALE+.5) >> 15 & 0xff);
+ *luv++ = (uint32_t)luv3[0] << 16 |
+ (luv3[1]*(uint32_t)(UVSCALE + .5) >> 7 & 0xff00) |
+ (luv3[2]*(uint32_t)(UVSCALE + .5) >> 15 & 0xff);
luv3 += 3;
}
return;
}
while (n-- > 0) {
- *luv++ = (uint32)luv3[0] << 16 |
- (tiff_itrunc(luv3[1]*(UVSCALE/(1<<15)), sp->encode_meth) << 8 & 0xff00) |
- (tiff_itrunc(luv3[2]*(UVSCALE/(1<<15)), sp->encode_meth) & 0xff);
+ *luv++ = (uint32_t)luv3[0] << 16 |
+ (tiff_itrunc(luv3[1]*(UVSCALE/(1<<15)), sp->encode_meth) << 8 & 0xff00) |
+ (tiff_itrunc(luv3[2]*(UVSCALE/(1<<15)), sp->encode_meth) & 0xff);
luv3 += 3;
}
}
static void
-_logLuvNop(LogLuvState* sp, uint8* op, tmsize_t n)
+_logLuvNop(LogLuvState* sp, uint8_t* op, tmsize_t n)
{
(void) sp; (void) op; (void) n;
}
@@ -1294,7 +1273,7 @@ LogL16InitState(TIFF* tif)
if( td->td_samplesperpixel != 1 )
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Sorry, can not handle LogL image with %s=%d",
+ "Sorry, can not handle LogL image with %s=%"PRIu16,
"Samples/pixel", td->td_samplesperpixel);
return 0;
}
@@ -1307,10 +1286,10 @@ LogL16InitState(TIFF* tif)
sp->pixel_size = sizeof (float);
break;
case SGILOGDATAFMT_16BIT:
- sp->pixel_size = sizeof (int16);
+ sp->pixel_size = sizeof (int16_t);
break;
case SGILOGDATAFMT_8BIT:
- sp->pixel_size = sizeof (uint8);
+ sp->pixel_size = sizeof (uint8_t);
break;
default:
TIFFErrorExt(tif->tif_clientdata, module,
@@ -1323,8 +1302,8 @@ LogL16InitState(TIFF* tif)
sp->tbuflen = multiply_ms(td->td_imagewidth, td->td_rowsperstrip);
else
sp->tbuflen = multiply_ms(td->td_imagewidth, td->td_imagelength);
- if (multiply_ms(sp->tbuflen, sizeof (int16)) == 0 ||
- (sp->tbuf = (uint8*) _TIFFmalloc(sp->tbuflen * sizeof (int16))) == NULL) {
+ if (multiply_ms(sp->tbuflen, sizeof (int16_t)) == 0 ||
+ (sp->tbuf = (uint8_t*) _TIFFmalloc(sp->tbuflen * sizeof (int16_t))) == NULL) {
TIFFErrorExt(tif->tif_clientdata, module, "No space for SGILog translation buffer");
return (0);
}
@@ -1406,13 +1385,13 @@ LogLuvInitState(TIFF* tif)
sp->pixel_size = 3*sizeof (float);
break;
case SGILOGDATAFMT_16BIT:
- sp->pixel_size = 3*sizeof (int16);
+ sp->pixel_size = 3*sizeof (int16_t);
break;
case SGILOGDATAFMT_RAW:
- sp->pixel_size = sizeof (uint32);
+ sp->pixel_size = sizeof (uint32_t);
break;
case SGILOGDATAFMT_8BIT:
- sp->pixel_size = 3*sizeof (uint8);
+ sp->pixel_size = 3*sizeof (uint8_t);
break;
default:
TIFFErrorExt(tif->tif_clientdata, module,
@@ -1425,8 +1404,8 @@ LogLuvInitState(TIFF* tif)
sp->tbuflen = multiply_ms(td->td_imagewidth, td->td_rowsperstrip);
else
sp->tbuflen = multiply_ms(td->td_imagewidth, td->td_imagelength);
- if (multiply_ms(sp->tbuflen, sizeof (uint32)) == 0 ||
- (sp->tbuf = (uint8*) _TIFFmalloc(sp->tbuflen * sizeof (uint32))) == NULL) {
+ if (multiply_ms(sp->tbuflen, sizeof (uint32_t)) == 0 ||
+ (sp->tbuf = (uint8_t*) _TIFFmalloc(sp->tbuflen * sizeof (uint32_t))) == NULL) {
TIFFErrorExt(tif->tif_clientdata, module, "No space for SGILog translation buffer");
return (0);
}
@@ -1495,7 +1474,7 @@ LogLuvSetupDecode(TIFF* tif)
return (1);
default:
TIFFErrorExt(tif->tif_clientdata, module,
- "Inappropriate photometric interpretation %d for SGILog compression; %s",
+ "Inappropriate photometric interpretation %"PRIu16" for SGILog compression; %s",
td->td_photometric, "must be either LogLUV or LogL");
break;
}
@@ -1559,7 +1538,7 @@ LogLuvSetupEncode(TIFF* tif)
break;
default:
TIFFErrorExt(tif->tif_clientdata, module,
- "Inappropriate photometric interpretation %d for SGILog compression; %s",
+ "Inappropriate photometric interpretation %"PRIu16" for SGILog compression; %s",
td->td_photometric, "must be either LogLUV or LogL");
return (0);
}
@@ -1617,7 +1596,7 @@ LogLuvCleanup(TIFF* tif)
}
static int
-LogLuvVSetField(TIFF* tif, uint32 tag, va_list ap)
+LogLuvVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
static const char module[] = "LogLuvVSetField";
LogLuvState* sp = DecoderState(tif);
@@ -1680,7 +1659,7 @@ LogLuvVSetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-LogLuvVGetField(TIFF* tif, uint32 tag, va_list ap)
+LogLuvVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
LogLuvState *sp = (LogLuvState *)tif->tif_data;
@@ -1719,7 +1698,7 @@ TIFFInitSGILog(TIFF* tif, int scheme)
/*
* Allocate state block so tag methods have storage to record values.
*/
- tif->tif_data = (uint8*) _TIFFmalloc(sizeof (LogLuvState));
+ tif->tif_data = (uint8_t*) _TIFFmalloc(sizeof (LogLuvState));
if (tif->tif_data == NULL)
goto bad;
sp = (LogLuvState*) tif->tif_data;
diff --git a/tiff/libtiff/tif_lzma.c b/tiff/libtiff/tif_lzma.c
index e150bd63..fc046475 100644
--- a/tiff/libtiff/tif_lzma.c
+++ b/tiff/libtiff/tif_lzma.c
@@ -61,8 +61,8 @@ typedef struct {
#define DecoderState(tif) LState(tif)
#define EncoderState(tif) LState(tif)
-static int LZMAEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
-static int LZMADecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);
+static int LZMAEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s);
+static int LZMADecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s);
static const char *
LZMAStrerror(lzma_ret ret)
@@ -125,7 +125,7 @@ LZMASetupDecode(TIFF* tif)
* Setup state for decoding a strip.
*/
static int
-LZMAPreDecode(TIFF* tif, uint16 s)
+LZMAPreDecode(TIFF* tif, uint16_t s)
{
static const char module[] = "LZMAPreDecode";
LZMAState* sp = DecoderState(tif);
@@ -160,7 +160,7 @@ LZMAPreDecode(TIFF* tif, uint16 s)
}
static int
-LZMADecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+LZMADecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "LZMADecode";
LZMAState* sp = DecoderState(tif);
@@ -206,19 +206,19 @@ LZMADecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
}
if (ret != LZMA_OK) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Decoding error at scanline %lu, %s",
- (unsigned long) tif->tif_row, LZMAStrerror(ret));
+ "Decoding error at scanline %"PRIu32", %s",
+ tif->tif_row, LZMAStrerror(ret));
break;
}
} while (sp->stream.avail_out > 0);
if (sp->stream.avail_out != 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at scanline %lu (short %lu bytes)",
- (unsigned long) tif->tif_row, (unsigned long) sp->stream.avail_out);
+ "Not enough data at scanline %"PRIu32" (short %"TIFF_SIZE_FORMAT" bytes)",
+ tif->tif_row, sp->stream.avail_out);
return 0;
}
- tif->tif_rawcp = (uint8 *)sp->stream.next_in; /* cast away const */
+ tif->tif_rawcp = (uint8_t *)sp->stream.next_in; /* cast away const */
tif->tif_rawcc = sp->stream.avail_in;
return 1;
@@ -243,7 +243,7 @@ LZMASetupEncode(TIFF* tif)
* Reset encoding state at the start of a strip.
*/
static int
-LZMAPreEncode(TIFF* tif, uint16 s)
+LZMAPreEncode(TIFF* tif, uint16_t s)
{
static const char module[] = "LZMAPreEncode";
LZMAState *sp = EncoderState(tif);
@@ -274,7 +274,7 @@ LZMAPreEncode(TIFF* tif, uint16 s)
* Encode a chunk of pixels.
*/
static int
-LZMAEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+LZMAEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "LZMAEncode";
LZMAState *sp = EncoderState(tif);
@@ -294,8 +294,8 @@ LZMAEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
lzma_ret ret = lzma_code(&sp->stream, LZMA_RUN);
if (ret != LZMA_OK) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Encoding error at scanline %lu, %s",
- (unsigned long) tif->tif_row, LZMAStrerror(ret));
+ "Encoding error at scanline %"PRIu32", %s",
+ tif->tif_row, LZMAStrerror(ret));
return 0;
}
if (sp->stream.avail_out == 0) {
@@ -367,7 +367,7 @@ LZMACleanup(TIFF* tif)
}
static int
-LZMAVSetField(TIFF* tif, uint32 tag, va_list ap)
+LZMAVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
static const char module[] = "LZMAVSetField";
LZMAState* sp = LState(tif);
@@ -394,7 +394,7 @@ LZMAVSetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-LZMAVGetField(TIFF* tif, uint32 tag, va_list ap)
+LZMAVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
LZMAState* sp = LState(tif);
@@ -435,7 +435,7 @@ TIFFInitLZMA(TIFF* tif, int scheme)
/*
* Allocate state block so tag methods have storage to record values.
*/
- tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZMAState));
+ tif->tif_data = (uint8_t*) _TIFFmalloc(sizeof(LZMAState));
if (tif->tif_data == NULL)
goto bad;
sp = LState(tif);
diff --git a/tiff/libtiff/tif_lzw.c b/tiff/libtiff/tif_lzw.c
index d92d0fd3..c06aec40 100644
--- a/tiff/libtiff/tif_lzw.c
+++ b/tiff/libtiff/tif_lzw.c
@@ -107,7 +107,7 @@ typedef struct {
/*
* Encoding-specific state.
*/
-typedef uint16 hcode_t; /* codes fit in 16 bits */
+typedef uint16_t hcode_t; /* codes fit in 16 bits */
typedef struct {
long hash;
hcode_t code;
@@ -123,7 +123,7 @@ typedef struct code_ent {
unsigned char firstchar; /* first token of string */
} code_t;
-typedef int (*decodeFunc)(TIFF*, uint8*, tmsize_t, uint16);
+typedef int (*decodeFunc)(TIFF*, uint8_t*, tmsize_t, uint16_t);
typedef struct {
LZWBaseState base;
@@ -132,7 +132,7 @@ typedef struct {
long dec_nbitsmask; /* lzw_nbits 1 bits, right adjusted */
long dec_restart; /* restart count */
#ifdef LZW_CHECKEOS
- uint64 dec_bitsleft; /* available bits in raw data */
+ uint64_t dec_bitsleft; /* available bits in raw data */
tmsize_t old_tif_rawcc; /* value of tif_rawcc at the end of the previous TIFLZWDecode() call */
#endif
decodeFunc dec_decode; /* regular or backwards compatible */
@@ -149,7 +149,7 @@ typedef struct {
long enc_ratio; /* current compression ratio */
long enc_incount; /* (input) data bytes encoded */
long enc_outcount; /* encoded (output) bytes */
- uint8* enc_rawlimit; /* bound on tif_rawdata buffer */
+ uint8_t* enc_rawlimit; /* bound on tif_rawdata buffer */
hash_t* enc_hashtab; /* kept separate for small machines */
} LZWCodecState;
@@ -157,9 +157,9 @@ typedef struct {
#define DecoderState(tif) ((LZWCodecState*) LZWState(tif))
#define EncoderState(tif) ((LZWCodecState*) LZWState(tif))
-static int LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s);
+static int LZWDecode(TIFF* tif, uint8_t* op0, tmsize_t occ0, uint16_t s);
#ifdef LZW_COMPAT
-static int LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s);
+static int LZWDecodeCompat(TIFF* tif, uint8_t* op0, tmsize_t occ0, uint16_t s);
#endif
static void cl_hash(LZWCodecState*);
@@ -173,9 +173,9 @@ static void cl_hash(LZWCodecState*);
* strip is suppose to be terminated with CODE_EOI.
*/
#define NextCode(_tif, _sp, _bp, _code, _get) { \
- if ((_sp)->dec_bitsleft < (uint64)nbits) { \
+ if ((_sp)->dec_bitsleft < (uint64_t)nbits) { \
TIFFWarningExt(_tif->tif_clientdata, module, \
- "LZWDecode: Strip %d not terminated with EOI code", \
+ "LZWDecode: Strip %"PRIu32" not terminated with EOI code", \
_tif->tif_curstrip); \
_code = CODE_EOI; \
} else { \
@@ -207,7 +207,7 @@ LZWSetupDecode(TIFF* tif)
* Allocate state block so tag methods have storage to record
* values.
*/
- tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZWCodecState));
+ tif->tif_data = (uint8_t*) _TIFFmalloc(sizeof(LZWCodecState));
if (tif->tif_data == NULL)
{
TIFFErrorExt(tif->tif_clientdata, module, "No space for LZW state block");
@@ -256,7 +256,7 @@ LZWSetupDecode(TIFF* tif)
* Setup state for decoding a strip.
*/
static int
-LZWPreDecode(TIFF* tif, uint16 s)
+LZWPreDecode(TIFF* tif, uint16_t s)
{
static const char module[] = "LZWPreDecode";
LZWCodecState *sp = DecoderState(tif);
@@ -352,12 +352,12 @@ static void
codeLoop(TIFF* tif, const char* module)
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Bogus encoding, loop in the code table; scanline %d",
+ "Bogus encoding, loop in the code table; scanline %"PRIu32,
tif->tif_row);
}
static int
-LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
+LZWDecode(TIFF* tif, uint8_t* op0, tmsize_t occ0, uint16_t s)
{
static const char module[] = "LZWDecode";
LZWCodecState *sp = DecoderState(tif);
@@ -426,7 +426,7 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
bp = (unsigned char *)tif->tif_rawcp;
#ifdef LZW_CHECKEOS
- sp->dec_bitsleft += (((uint64)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
+ sp->dec_bitsleft += (((uint64_t)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
#endif
nbits = sp->lzw_nbits;
nextdata = sp->lzw_nextdata;
@@ -454,7 +454,7 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
break;
if (code > CODE_CLEAR) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "LZWDecode: Corrupted LZW table at scanline %d",
+ "LZWDecode: Corrupted LZW table at scanline %"PRIu32,
tif->tif_row);
return (0);
}
@@ -471,7 +471,7 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
if (free_entp < &sp->dec_codetab[0] ||
free_entp >= &sp->dec_codetab[CSIZE]) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Corrupted LZW table at scanline %d",
+ "Corrupted LZW table at scanline %"PRIu32,
tif->tif_row);
return (0);
}
@@ -480,7 +480,7 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
if (free_entp->next < &sp->dec_codetab[0] ||
free_entp->next >= &sp->dec_codetab[CSIZE]) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Corrupted LZW table at scanline %d",
+ "Corrupted LZW table at scanline %"PRIu32,
tif->tif_row);
return (0);
}
@@ -503,7 +503,7 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
if(codep->length == 0) {
TIFFErrorExt(tif->tif_clientdata, module,
"Wrong length of decoded string: "
- "data probably corrupted at scanline %d",
+ "data probably corrupted at scanline %"PRIu32,
tif->tif_row);
return (0);
}
@@ -552,8 +552,8 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
}
}
- tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
- tif->tif_rawcp = (uint8*) bp;
+ tif->tif_rawcc -= (tmsize_t)((uint8_t*) bp - tif->tif_rawcp );
+ tif->tif_rawcp = (uint8_t*) bp;
#ifdef LZW_CHECKEOS
sp->old_tif_rawcc = tif->tif_rawcc;
#endif
@@ -566,15 +566,9 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
sp->dec_maxcodep = maxcodep;
if (occ > 0) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at scanline %d (short %I64d bytes)",
- tif->tif_row, (unsigned __int64) occ);
-#else
- TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at scanline %d (short %llu bytes)",
- tif->tif_row, (unsigned long long) occ);
-#endif
+ "Not enough data at scanline %"PRIu32" (short %ld bytes)",
+ tif->tif_row, occ);
return (0);
}
return (1);
@@ -597,7 +591,7 @@ LZWDecode(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
}
static int
-LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
+LZWDecodeCompat(TIFF* tif, uint8_t* op0, tmsize_t occ0, uint16_t s)
{
static const char module[] = "LZWDecodeCompat";
LZWCodecState *sp = DecoderState(tif);
@@ -660,7 +654,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
bp = (unsigned char *)tif->tif_rawcp;
#ifdef LZW_CHECKEOS
- sp->dec_bitsleft += (((uint64)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
+ sp->dec_bitsleft += (((uint64_t)tif->tif_rawcc - sp->old_tif_rawcc) << 3);
#endif
nbits = sp->lzw_nbits;
nextdata = sp->lzw_nextdata;
@@ -688,7 +682,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
break;
if (code > CODE_CLEAR) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "LZWDecode: Corrupted LZW table at scanline %d",
+ "LZWDecode: Corrupted LZW table at scanline %"PRIu32,
tif->tif_row);
return (0);
}
@@ -705,7 +699,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
if (free_entp < &sp->dec_codetab[0] ||
free_entp >= &sp->dec_codetab[CSIZE]) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Corrupted LZW table at scanline %d", tif->tif_row);
+ "Corrupted LZW table at scanline %"PRIu32, tif->tif_row);
return (0);
}
@@ -713,7 +707,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
if (free_entp->next < &sp->dec_codetab[0] ||
free_entp->next >= &sp->dec_codetab[CSIZE]) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Corrupted LZW table at scanline %d", tif->tif_row);
+ "Corrupted LZW table at scanline %"PRIu32, tif->tif_row);
return (0);
}
free_entp->firstchar = free_entp->next->firstchar;
@@ -735,7 +729,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
if(codep->length == 0) {
TIFFErrorExt(tif->tif_clientdata, module,
"Wrong length of decoded "
- "string: data probably corrupted at scanline %d",
+ "string: data probably corrupted at scanline %"PRIu32,
tif->tif_row);
return (0);
}
@@ -776,8 +770,8 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
}
}
- tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
- tif->tif_rawcp = (uint8*) bp;
+ tif->tif_rawcc -= (tmsize_t)((uint8_t*) bp - tif->tif_rawcp );
+ tif->tif_rawcp = (uint8_t*) bp;
#ifdef LZW_CHECKEOS
sp->old_tif_rawcc = tif->tif_rawcc;
#endif
@@ -790,15 +784,9 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
sp->dec_maxcodep = maxcodep;
if (occ > 0) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at scanline %d (short %I64d bytes)",
- tif->tif_row, (unsigned __int64) occ);
-#else
- TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at scanline %d (short %llu bytes)",
- tif->tif_row, (unsigned long long) occ);
-#endif
+ "Not enough data at scanline %"PRIu32" (short %ld bytes)",
+ tif->tif_row, occ);
return (0);
}
return (1);
@@ -829,7 +817,7 @@ LZWSetupEncode(TIFF* tif)
* Reset encoding state at the start of a strip.
*/
static int
-LZWPreEncode(TIFF* tif, uint16 s)
+LZWPreEncode(TIFF* tif, uint16_t s)
{
LZWCodecState *sp = EncoderState(tif);
@@ -896,7 +884,7 @@ LZWPreEncode(TIFF* tif, uint16 s)
* for the decoder.
*/
static int
-LZWEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+LZWEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
register LZWCodecState *sp = EncoderState(tif);
register long fcode;
@@ -908,8 +896,8 @@ LZWEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
unsigned long nextdata;
long nextbits;
int free_ent, maxcode, nbits;
- uint8* op;
- uint8* limit;
+ uint8_t* op;
+ uint8_t* limit;
(void) s;
if (sp == NULL)
@@ -1067,7 +1055,7 @@ static int
LZWPostEncode(TIFF* tif)
{
register LZWCodecState *sp = EncoderState(tif);
- uint8* op = tif->tif_rawcp;
+ uint8_t* op = tif->tif_rawcp;
long nextbits = sp->lzw_nextbits;
unsigned long nextdata = sp->lzw_nextdata;
long outcount = sp->enc_outcount;
@@ -1163,7 +1151,7 @@ TIFFInitLZW(TIFF* tif, int scheme)
/*
* Allocate state block so tag methods have storage to record values.
*/
- tif->tif_data = (uint8*) _TIFFmalloc(sizeof (LZWCodecState));
+ tif->tif_data = (uint8_t*) _TIFFmalloc(sizeof (LZWCodecState));
if (tif->tif_data == NULL)
goto bad;
DecoderState(tif)->dec_codetab = NULL;
diff --git a/tiff/libtiff/tif_next.c b/tiff/libtiff/tif_next.c
index 0ba61aed..695fc5d4 100644
--- a/tiff/libtiff/tif_next.c
+++ b/tiff/libtiff/tif_next.c
@@ -44,12 +44,12 @@
#define WHITE ((1<<2)-1)
static int
-NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
+NeXTDecode(TIFF* tif, uint8_t* buf, tmsize_t occ, uint16_t s)
{
static const char module[] = "NeXTDecode";
unsigned char *bp, *op;
tmsize_t cc;
- uint8* row;
+ uint8_t* row;
tmsize_t scanline, n;
(void) s;
@@ -101,9 +101,9 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
break;
}
default: {
- uint32 npixels = 0, grey;
+ uint32_t npixels = 0, grey;
tmsize_t op_offset = 0;
- uint32 imagewidth = tif->tif_dir.td_imagewidth;
+ uint32_t imagewidth = tif->tif_dir.td_imagewidth;
if( isTiled(tif) )
imagewidth = tif->tif_dir.td_tilewidth;
@@ -115,7 +115,7 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
*/
op = row;
for (;;) {
- grey = (uint32)((n>>6) & 0x3);
+ grey = (uint32_t)((n >> 6) & 0x3);
n &= 0x3f;
/*
* Ensure the run does not exceed the scanline
@@ -127,8 +127,8 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
if (npixels >= imagewidth)
break;
if (op_offset >= scanline ) {
- TIFFErrorExt(tif->tif_clientdata, module, "Invalid data for scanline %ld",
- (long) tif->tif_row);
+ TIFFErrorExt(tif->tif_clientdata, module, "Invalid data for scanline %"PRIu32,
+ tif->tif_row);
return (0);
}
if (cc == 0)
@@ -140,17 +140,17 @@ NeXTDecode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
}
}
}
- tif->tif_rawcp = (uint8*) bp;
+ tif->tif_rawcp = (uint8_t*) bp;
tif->tif_rawcc = cc;
return (1);
bad:
- TIFFErrorExt(tif->tif_clientdata, module, "Not enough data for scanline %ld",
- (long) tif->tif_row);
+ TIFFErrorExt(tif->tif_clientdata, module, "Not enough data for scanline %"PRIu32,
+ tif->tif_row);
return (0);
}
static int
-NeXTPreDecode(TIFF* tif, uint16 s)
+NeXTPreDecode(TIFF* tif, uint16_t s)
{
static const char module[] = "NeXTPreDecode";
TIFFDirectory *td = &tif->tif_dir;
@@ -158,7 +158,7 @@ NeXTPreDecode(TIFF* tif, uint16 s)
if( td->td_bitspersample != 2 )
{
- TIFFErrorExt(tif->tif_clientdata, module, "Unsupported BitsPerSample = %d",
+ TIFFErrorExt(tif->tif_clientdata, module, "Unsupported BitsPerSample = %"PRIu16,
td->td_bitspersample);
return (0);
}
diff --git a/tiff/libtiff/tif_ojpeg.c b/tiff/libtiff/tif_ojpeg.c
index d9000764..102f9940 100644
--- a/tiff/libtiff/tif_ojpeg.c
+++ b/tiff/libtiff/tif_ojpeg.c
@@ -141,7 +141,7 @@
* enough so as to not result in significant call overhead. It should be at least a few
* bytes to accommodate some structures (this is verified in asserts), but it would not be
* sensible to make it this small anyway, and it should be at most 64K since it is indexed
- * with uint16. We recommend 2K.
+ * with uint16_t. We recommend 2K.
* EGYPTIANWALK: You could also define EGYPTIANWALK here, but it is not used anywhere and has
* absolutely no effect. That is why most people insist the EGYPTIANWALK is a bit silly.
*/
@@ -258,118 +258,118 @@ typedef struct {
TIFFVGetMethod vgetparent;
TIFFVSetMethod vsetparent;
TIFFPrintMethod printdir;
- uint64 file_size;
- uint32 image_width;
- uint32 image_length;
- uint32 strile_width;
- uint32 strile_length;
- uint32 strile_length_total;
- uint8 samples_per_pixel;
- uint8 plane_sample_offset;
- uint8 samples_per_pixel_per_plane;
- uint64 jpeg_interchange_format;
- uint64 jpeg_interchange_format_length;
- uint8 jpeg_proc;
- uint8 subsamplingcorrect;
- uint8 subsamplingcorrect_done;
- uint8 subsampling_tag;
- uint8 subsampling_hor;
- uint8 subsampling_ver;
- uint8 subsampling_force_desubsampling_inside_decompression;
- uint8 qtable_offset_count;
- uint8 dctable_offset_count;
- uint8 actable_offset_count;
- uint64 qtable_offset[3];
- uint64 dctable_offset[3];
- uint64 actable_offset[3];
- uint8* qtable[4];
- uint8* dctable[4];
- uint8* actable[4];
- uint16 restart_interval;
- uint8 restart_index;
- uint8 sof_log;
- uint8 sof_marker_id;
- uint32 sof_x;
- uint32 sof_y;
- uint8 sof_c[3];
- uint8 sof_hv[3];
- uint8 sof_tq[3];
- uint8 sos_cs[3];
- uint8 sos_tda[3];
+ uint64_t file_size;
+ uint32_t image_width;
+ uint32_t image_length;
+ uint32_t strile_width;
+ uint32_t strile_length;
+ uint32_t strile_length_total;
+ uint8_t samples_per_pixel;
+ uint8_t plane_sample_offset;
+ uint8_t samples_per_pixel_per_plane;
+ uint64_t jpeg_interchange_format;
+ uint64_t jpeg_interchange_format_length;
+ uint8_t jpeg_proc;
+ uint8_t subsamplingcorrect;
+ uint8_t subsamplingcorrect_done;
+ uint8_t subsampling_tag;
+ uint8_t subsampling_hor;
+ uint8_t subsampling_ver;
+ uint8_t subsampling_force_desubsampling_inside_decompression;
+ uint8_t qtable_offset_count;
+ uint8_t dctable_offset_count;
+ uint8_t actable_offset_count;
+ uint64_t qtable_offset[3];
+ uint64_t dctable_offset[3];
+ uint64_t actable_offset[3];
+ uint8_t* qtable[4];
+ uint8_t* dctable[4];
+ uint8_t* actable[4];
+ uint16_t restart_interval;
+ uint8_t restart_index;
+ uint8_t sof_log;
+ uint8_t sof_marker_id;
+ uint32_t sof_x;
+ uint32_t sof_y;
+ uint8_t sof_c[3];
+ uint8_t sof_hv[3];
+ uint8_t sof_tq[3];
+ uint8_t sos_cs[3];
+ uint8_t sos_tda[3];
struct {
- uint8 log;
+ uint8_t log;
OJPEGStateInBufferSource in_buffer_source;
- uint32 in_buffer_next_strile;
- uint64 in_buffer_file_pos;
- uint64 in_buffer_file_togo;
+ uint32_t in_buffer_next_strile;
+ uint64_t in_buffer_file_pos;
+ uint64_t in_buffer_file_togo;
} sos_end[3];
- uint8 readheader_done;
- uint8 writeheader_done;
- uint16 write_cursample;
- uint32 write_curstrile;
- uint8 libjpeg_session_active;
- uint8 libjpeg_jpeg_query_style;
+ uint8_t readheader_done;
+ uint8_t writeheader_done;
+ uint16_t write_cursample;
+ uint32_t write_curstrile;
+ uint8_t libjpeg_session_active;
+ uint8_t libjpeg_jpeg_query_style;
jpeg_error_mgr libjpeg_jpeg_error_mgr;
jpeg_decompress_struct libjpeg_jpeg_decompress_struct;
jpeg_source_mgr libjpeg_jpeg_source_mgr;
- uint8 subsampling_convert_log;
- uint32 subsampling_convert_ylinelen;
- uint32 subsampling_convert_ylines;
- uint32 subsampling_convert_clinelen;
- uint32 subsampling_convert_clines;
- uint32 subsampling_convert_ybuflen;
- uint32 subsampling_convert_cbuflen;
- uint32 subsampling_convert_ycbcrbuflen;
- uint8* subsampling_convert_ycbcrbuf;
- uint8* subsampling_convert_ybuf;
- uint8* subsampling_convert_cbbuf;
- uint8* subsampling_convert_crbuf;
- uint32 subsampling_convert_ycbcrimagelen;
- uint8** subsampling_convert_ycbcrimage;
- uint32 subsampling_convert_clinelenout;
- uint32 subsampling_convert_state;
- uint32 bytes_per_line; /* if the codec outputs subsampled data, a 'line' in bytes_per_line */
- uint32 lines_per_strile; /* and lines_per_strile means subsampling_ver desubsampled rows */
+ uint8_t subsampling_convert_log;
+ uint32_t subsampling_convert_ylinelen;
+ uint32_t subsampling_convert_ylines;
+ uint32_t subsampling_convert_clinelen;
+ uint32_t subsampling_convert_clines;
+ uint32_t subsampling_convert_ybuflen;
+ uint32_t subsampling_convert_cbuflen;
+ uint32_t subsampling_convert_ycbcrbuflen;
+ uint8_t* subsampling_convert_ycbcrbuf;
+ uint8_t* subsampling_convert_ybuf;
+ uint8_t* subsampling_convert_cbbuf;
+ uint8_t* subsampling_convert_crbuf;
+ uint32_t subsampling_convert_ycbcrimagelen;
+ uint8_t** subsampling_convert_ycbcrimage;
+ uint32_t subsampling_convert_clinelenout;
+ uint32_t subsampling_convert_state;
+ uint32_t bytes_per_line; /* if the codec outputs subsampled data, a 'line' in bytes_per_line */
+ uint32_t lines_per_strile; /* and lines_per_strile means subsampling_ver desubsampled rows */
OJPEGStateInBufferSource in_buffer_source;
- uint32 in_buffer_next_strile;
- uint32 in_buffer_strile_count;
- uint64 in_buffer_file_pos;
- uint8 in_buffer_file_pos_log;
- uint64 in_buffer_file_togo;
- uint16 in_buffer_togo;
- uint8* in_buffer_cur;
- uint8 in_buffer[OJPEG_BUFFER];
+ uint32_t in_buffer_next_strile;
+ uint32_t in_buffer_strile_count;
+ uint64_t in_buffer_file_pos;
+ uint8_t in_buffer_file_pos_log;
+ uint64_t in_buffer_file_togo;
+ uint16_t in_buffer_togo;
+ uint8_t* in_buffer_cur;
+ uint8_t in_buffer[OJPEG_BUFFER];
OJPEGStateOutState out_state;
- uint8 out_buffer[OJPEG_BUFFER];
- uint8* skip_buffer;
+ uint8_t out_buffer[OJPEG_BUFFER];
+ uint8_t* skip_buffer;
#ifdef GS_TIFF_BUILD
jpeg_cust_mem_data jmem;
jpeg_cust_mem_data *jmem_parent;
#endif
} OJPEGState;
-static int OJPEGVGetField(TIFF* tif, uint32 tag, va_list ap);
-static int OJPEGVSetField(TIFF* tif, uint32 tag, va_list ap);
+static int OJPEGVGetField(TIFF* tif, uint32_t tag, va_list ap);
+static int OJPEGVSetField(TIFF* tif, uint32_t tag, va_list ap);
static void OJPEGPrintDir(TIFF* tif, FILE* fd, long flags);
static int OJPEGFixupTags(TIFF* tif);
static int OJPEGSetupDecode(TIFF* tif);
-static int OJPEGPreDecode(TIFF* tif, uint16 s);
+static int OJPEGPreDecode(TIFF* tif, uint16_t s);
static int OJPEGPreDecodeSkipRaw(TIFF* tif);
static int OJPEGPreDecodeSkipScanlines(TIFF* tif);
-static int OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s);
-static int OJPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc);
-static int OJPEGDecodeScanlines(TIFF* tif, uint8* buf, tmsize_t cc);
-static void OJPEGPostDecode(TIFF* tif, uint8* buf, tmsize_t cc);
+static int OJPEGDecode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s);
+static int OJPEGDecodeRaw(TIFF* tif, uint8_t* buf, tmsize_t cc);
+static int OJPEGDecodeScanlines(TIFF* tif, uint8_t* buf, tmsize_t cc);
+static void OJPEGPostDecode(TIFF* tif, uint8_t* buf, tmsize_t cc);
static int OJPEGSetupEncode(TIFF* tif);
-static int OJPEGPreEncode(TIFF* tif, uint16 s);
-static int OJPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s);
+static int OJPEGPreEncode(TIFF* tif, uint16_t s);
+static int OJPEGEncode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s);
static int OJPEGPostEncode(TIFF* tif);
static void OJPEGCleanup(TIFF* tif);
static void OJPEGSubsamplingCorrect(TIFF* tif);
static int OJPEGReadHeaderInfo(TIFF* tif);
-static int OJPEGReadSecondarySos(TIFF* tif, uint16 s);
+static int OJPEGReadSecondarySos(TIFF* tif, uint16_t s);
static int OJPEGWriteHeaderInfo(TIFF* tif);
static void OJPEGLibjpegSessionAbort(TIFF* tif);
@@ -377,45 +377,45 @@ static int OJPEGReadHeaderInfoSec(TIFF* tif);
static int OJPEGReadHeaderInfoSecStreamDri(TIFF* tif);
static int OJPEGReadHeaderInfoSecStreamDqt(TIFF* tif);
static int OJPEGReadHeaderInfoSecStreamDht(TIFF* tif);
-static int OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8 marker_id);
+static int OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8_t marker_id);
static int OJPEGReadHeaderInfoSecStreamSos(TIFF* tif);
static int OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif);
static int OJPEGReadHeaderInfoSecTablesDcTable(TIFF* tif);
static int OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif);
static int OJPEGReadBufferFill(OJPEGState* sp);
-static int OJPEGReadByte(OJPEGState* sp, uint8* byte);
-static int OJPEGReadBytePeek(OJPEGState* sp, uint8* byte);
+static int OJPEGReadByte(OJPEGState* sp, uint8_t* byte);
+static int OJPEGReadBytePeek(OJPEGState* sp, uint8_t* byte);
static void OJPEGReadByteAdvance(OJPEGState* sp);
-static int OJPEGReadWord(OJPEGState* sp, uint16* word);
-static int OJPEGReadBlock(OJPEGState* sp, uint16 len, void* mem);
-static void OJPEGReadSkip(OJPEGState* sp, uint16 len);
-
-static int OJPEGWriteStream(TIFF* tif, void** mem, uint32* len);
-static void OJPEGWriteStreamSoi(TIFF* tif, void** mem, uint32* len);
-static void OJPEGWriteStreamQTable(TIFF* tif, uint8 table_index, void** mem, uint32* len);
-static void OJPEGWriteStreamDcTable(TIFF* tif, uint8 table_index, void** mem, uint32* len);
-static void OJPEGWriteStreamAcTable(TIFF* tif, uint8 table_index, void** mem, uint32* len);
-static void OJPEGWriteStreamDri(TIFF* tif, void** mem, uint32* len);
-static void OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32* len);
-static void OJPEGWriteStreamSos(TIFF* tif, void** mem, uint32* len);
-static int OJPEGWriteStreamCompressed(TIFF* tif, void** mem, uint32* len);
-static void OJPEGWriteStreamRst(TIFF* tif, void** mem, uint32* len);
-static void OJPEGWriteStreamEoi(TIFF* tif, void** mem, uint32* len);
+static int OJPEGReadWord(OJPEGState* sp, uint16_t* word);
+static int OJPEGReadBlock(OJPEGState* sp, uint16_t len, void* mem);
+static void OJPEGReadSkip(OJPEGState* sp, uint16_t len);
+
+static int OJPEGWriteStream(TIFF* tif, void** mem, uint32_t* len);
+static void OJPEGWriteStreamSoi(TIFF* tif, void** mem, uint32_t* len);
+static void OJPEGWriteStreamQTable(TIFF* tif, uint8_t table_index, void** mem, uint32_t* len);
+static void OJPEGWriteStreamDcTable(TIFF* tif, uint8_t table_index, void** mem, uint32_t* len);
+static void OJPEGWriteStreamAcTable(TIFF* tif, uint8_t table_index, void** mem, uint32_t* len);
+static void OJPEGWriteStreamDri(TIFF* tif, void** mem, uint32_t* len);
+static void OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32_t* len);
+static void OJPEGWriteStreamSos(TIFF* tif, void** mem, uint32_t* len);
+static int OJPEGWriteStreamCompressed(TIFF* tif, void** mem, uint32_t* len);
+static void OJPEGWriteStreamRst(TIFF* tif, void** mem, uint32_t* len);
+static void OJPEGWriteStreamEoi(TIFF* tif, void** mem, uint32_t* len);
#ifdef LIBJPEG_ENCAP_EXTERNAL
extern int jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo);
-extern int jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8 require_image);
+extern int jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8_t require_image);
extern int jpeg_start_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo);
-extern int jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32 max_lines);
-extern int jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32 max_lines);
+extern int jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32_t max_lines);
+extern int jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32_t max_lines);
extern void jpeg_encap_unwind(TIFF* tif);
#else
static int jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* j);
-static int jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8 require_image);
+static int jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8_t require_image);
static int jpeg_start_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo);
-static int jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32 max_lines);
-static int jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32 max_lines);
+static int jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32_t max_lines);
+static int jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32_t max_lines);
static void jpeg_encap_unwind(TIFF* tif);
#endif
@@ -473,7 +473,7 @@ TIFFInitOJPEG(TIFF* tif, int scheme)
tif->tif_encodestrip=OJPEGEncode;
tif->tif_encodetile=OJPEGEncode;
tif->tif_cleanup=OJPEGCleanup;
- tif->tif_data=(uint8*)sp;
+ tif->tif_data=(uint8_t*)sp;
/* tif tag methods */
sp->vgetparent=tif->tif_tagmethods.vgetfield;
tif->tif_tagmethods.vgetfield=OJPEGVGetField;
@@ -492,40 +492,40 @@ TIFFInitOJPEG(TIFF* tif, int scheme)
}
static int
-OJPEGVGetField(TIFF* tif, uint32 tag, va_list ap)
+OJPEGVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
switch(tag)
{
case TIFFTAG_JPEGIFOFFSET:
- *va_arg(ap,uint64*)=(uint64)sp->jpeg_interchange_format;
+ *va_arg(ap, uint64_t*)=(uint64_t)sp->jpeg_interchange_format;
break;
case TIFFTAG_JPEGIFBYTECOUNT:
- *va_arg(ap,uint64*)=(uint64)sp->jpeg_interchange_format_length;
+ *va_arg(ap, uint64_t*)=(uint64_t)sp->jpeg_interchange_format_length;
break;
case TIFFTAG_YCBCRSUBSAMPLING:
if (sp->subsamplingcorrect_done==0)
OJPEGSubsamplingCorrect(tif);
- *va_arg(ap,uint16*)=(uint16)sp->subsampling_hor;
- *va_arg(ap,uint16*)=(uint16)sp->subsampling_ver;
+ *va_arg(ap, uint16_t*)=(uint16_t)sp->subsampling_hor;
+ *va_arg(ap, uint16_t*)=(uint16_t)sp->subsampling_ver;
break;
case TIFFTAG_JPEGQTABLES:
- *va_arg(ap,uint32*)=(uint32)sp->qtable_offset_count;
+ *va_arg(ap, uint32_t*)=(uint32_t)sp->qtable_offset_count;
*va_arg(ap,const void**)=(const void*)sp->qtable_offset;
break;
case TIFFTAG_JPEGDCTABLES:
- *va_arg(ap,uint32*)=(uint32)sp->dctable_offset_count;
+ *va_arg(ap, uint32_t*)=(uint32_t)sp->dctable_offset_count;
*va_arg(ap,const void**)=(const void*)sp->dctable_offset;
break;
case TIFFTAG_JPEGACTABLES:
- *va_arg(ap,uint32*)=(uint32)sp->actable_offset_count;
+ *va_arg(ap, uint32_t*)=(uint32_t)sp->actable_offset_count;
*va_arg(ap,const void**)=(const void*)sp->actable_offset;
break;
case TIFFTAG_JPEGPROC:
- *va_arg(ap,uint16*)=(uint16)sp->jpeg_proc;
+ *va_arg(ap, uint16_t*)=(uint16_t)sp->jpeg_proc;
break;
case TIFFTAG_JPEGRESTARTINTERVAL:
- *va_arg(ap,uint16*)=sp->restart_interval;
+ *va_arg(ap, uint16_t*)=sp->restart_interval;
break;
default:
return (*sp->vgetparent)(tif,tag,ap);
@@ -534,32 +534,32 @@ OJPEGVGetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-OJPEGVSetField(TIFF* tif, uint32 tag, va_list ap)
+OJPEGVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
static const char module[]="OJPEGVSetField";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint32 ma;
- uint64* mb;
- uint32 n;
+ uint32_t ma;
+ uint64_t* mb;
+ uint32_t n;
const TIFFField* fip;
switch(tag)
{
case TIFFTAG_JPEGIFOFFSET:
- sp->jpeg_interchange_format=(uint64)va_arg(ap,uint64);
+ sp->jpeg_interchange_format=(uint64_t)va_arg(ap, uint64_t);
break;
case TIFFTAG_JPEGIFBYTECOUNT:
- sp->jpeg_interchange_format_length=(uint64)va_arg(ap,uint64);
+ sp->jpeg_interchange_format_length=(uint64_t)va_arg(ap, uint64_t);
break;
case TIFFTAG_YCBCRSUBSAMPLING:
sp->subsampling_tag=1;
- sp->subsampling_hor=(uint8)va_arg(ap,uint16_vap);
- sp->subsampling_ver=(uint8)va_arg(ap,uint16_vap);
+ sp->subsampling_hor=(uint8_t)va_arg(ap, uint16_vap);
+ sp->subsampling_ver=(uint8_t)va_arg(ap, uint16_vap);
tif->tif_dir.td_ycbcrsubsampling[0]=sp->subsampling_hor;
tif->tif_dir.td_ycbcrsubsampling[1]=sp->subsampling_ver;
break;
case TIFFTAG_JPEGQTABLES:
- ma=(uint32)va_arg(ap,uint32);
+ ma=(uint32_t)va_arg(ap, uint32_t);
if (ma!=0)
{
if (ma>3)
@@ -567,14 +567,14 @@ OJPEGVSetField(TIFF* tif, uint32 tag, va_list ap)
TIFFErrorExt(tif->tif_clientdata,module,"JpegQTables tag has incorrect count");
return(0);
}
- sp->qtable_offset_count=(uint8)ma;
- mb=(uint64*)va_arg(ap,uint64*);
+ sp->qtable_offset_count=(uint8_t)ma;
+ mb=(uint64_t*)va_arg(ap, uint64_t*);
for (n=0; n<ma; n++)
sp->qtable_offset[n]=mb[n];
}
break;
case TIFFTAG_JPEGDCTABLES:
- ma=(uint32)va_arg(ap,uint32);
+ ma=(uint32_t)va_arg(ap, uint32_t);
if (ma!=0)
{
if (ma>3)
@@ -582,14 +582,14 @@ OJPEGVSetField(TIFF* tif, uint32 tag, va_list ap)
TIFFErrorExt(tif->tif_clientdata,module,"JpegDcTables tag has incorrect count");
return(0);
}
- sp->dctable_offset_count=(uint8)ma;
- mb=(uint64*)va_arg(ap,uint64*);
+ sp->dctable_offset_count=(uint8_t)ma;
+ mb=(uint64_t*)va_arg(ap, uint64_t*);
for (n=0; n<ma; n++)
sp->dctable_offset[n]=mb[n];
}
break;
case TIFFTAG_JPEGACTABLES:
- ma=(uint32)va_arg(ap,uint32);
+ ma=(uint32_t)va_arg(ap, uint32_t);
if (ma!=0)
{
if (ma>3)
@@ -597,17 +597,17 @@ OJPEGVSetField(TIFF* tif, uint32 tag, va_list ap)
TIFFErrorExt(tif->tif_clientdata,module,"JpegAcTables tag has incorrect count");
return(0);
}
- sp->actable_offset_count=(uint8)ma;
- mb=(uint64*)va_arg(ap,uint64*);
+ sp->actable_offset_count=(uint8_t)ma;
+ mb=(uint64_t*)va_arg(ap, uint64_t*);
for (n=0; n<ma; n++)
sp->actable_offset[n]=mb[n];
}
break;
case TIFFTAG_JPEGPROC:
- sp->jpeg_proc=(uint8)va_arg(ap,uint16_vap);
+ sp->jpeg_proc=(uint8_t)va_arg(ap, uint16_vap);
break;
case TIFFTAG_JPEGRESTARTINTERVAL:
- sp->restart_interval=(uint16)va_arg(ap,uint16_vap);
+ sp->restart_interval=(uint16_t)va_arg(ap, uint16_vap);
break;
default:
return (*sp->vsetparent)(tif,tag,ap);
@@ -624,38 +624,38 @@ static void
OJPEGPrintDir(TIFF* tif, FILE* fd, long flags)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8 m;
+ uint8_t m;
(void)flags;
assert(sp!=NULL);
if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGINTERCHANGEFORMAT))
- fprintf(fd," JpegInterchangeFormat: " TIFF_UINT64_FORMAT "\n",(TIFF_UINT64_T)sp->jpeg_interchange_format);
+ fprintf(fd," JpegInterchangeFormat: %" PRIu64 "\n",(uint64_t)sp->jpeg_interchange_format);
if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGINTERCHANGEFORMATLENGTH))
- fprintf(fd," JpegInterchangeFormatLength: " TIFF_UINT64_FORMAT "\n",(TIFF_UINT64_T)sp->jpeg_interchange_format_length);
+ fprintf(fd," JpegInterchangeFormatLength: %" PRIu64 "\n",(uint64_t)sp->jpeg_interchange_format_length);
if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGQTABLES))
{
fprintf(fd," JpegQTables:");
for (m=0; m<sp->qtable_offset_count; m++)
- fprintf(fd," " TIFF_UINT64_FORMAT,(TIFF_UINT64_T)sp->qtable_offset[m]);
+ fprintf(fd," %" PRIu64,(uint64_t)sp->qtable_offset[m]);
fprintf(fd,"\n");
}
if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGDCTABLES))
{
fprintf(fd," JpegDcTables:");
for (m=0; m<sp->dctable_offset_count; m++)
- fprintf(fd," " TIFF_UINT64_FORMAT,(TIFF_UINT64_T)sp->dctable_offset[m]);
+ fprintf(fd," %" PRIu64,(uint64_t)sp->dctable_offset[m]);
fprintf(fd,"\n");
}
if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGACTABLES))
{
fprintf(fd," JpegAcTables:");
for (m=0; m<sp->actable_offset_count; m++)
- fprintf(fd," " TIFF_UINT64_FORMAT,(TIFF_UINT64_T)sp->actable_offset[m]);
+ fprintf(fd," %" PRIu64,(uint64_t)sp->actable_offset[m]);
fprintf(fd,"\n");
}
if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGPROC))
- fprintf(fd," JpegProc: %u\n",(unsigned int)sp->jpeg_proc);
+ fprintf(fd," JpegProc: %"PRIu8"\n", sp->jpeg_proc);
if (TIFFFieldSet(tif,FIELD_OJPEG_JPEGRESTARTINTERVAL))
- fprintf(fd," JpegRestartInterval: %u\n",(unsigned int)sp->restart_interval);
+ fprintf(fd," JpegRestartInterval: %"PRIu16"\n", sp->restart_interval);
if (sp->printdir)
(*sp->printdir)(tif, fd, flags);
}
@@ -676,10 +676,10 @@ OJPEGSetupDecode(TIFF* tif)
}
static int
-OJPEGPreDecode(TIFF* tif, uint16 s)
+OJPEGPreDecode(TIFF* tif, uint16_t s)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint32 m;
+ uint32_t m;
if (sp->subsamplingcorrect_done==0)
OJPEGSubsamplingCorrect(tif);
if (sp->readheader_done==0)
@@ -704,7 +704,7 @@ OJPEGPreDecode(TIFF* tif, uint16 s)
}
if (sp->writeheader_done==0)
{
- sp->plane_sample_offset=(uint8)s;
+ sp->plane_sample_offset=(uint8_t)s;
sp->write_cursample=s;
sp->write_curstrile=s*tif->tif_dir.td_stripsperimage;
if ((sp->in_buffer_file_pos_log==0) ||
@@ -743,7 +743,7 @@ static int
OJPEGPreDecodeSkipRaw(TIFF* tif)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint32 m;
+ uint32_t m;
m=sp->lines_per_strile;
if (sp->subsampling_convert_state!=0)
{
@@ -778,7 +778,7 @@ OJPEGPreDecodeSkipScanlines(TIFF* tif)
{
static const char module[]="OJPEGPreDecodeSkipScanlines";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint32 m;
+ uint32_t m;
if (sp->skip_buffer==NULL)
{
sp->skip_buffer=_TIFFmalloc(sp->bytes_per_line);
@@ -797,7 +797,7 @@ OJPEGPreDecodeSkipScanlines(TIFF* tif)
}
static int
-OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+OJPEGDecode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
static const char module[]="OJPEGDecode";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
@@ -825,19 +825,19 @@ OJPEGDecode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
}
static int
-OJPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc)
+OJPEGDecodeRaw(TIFF* tif, uint8_t* buf, tmsize_t cc)
{
static const char module[]="OJPEGDecodeRaw";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8* m;
+ uint8_t* m;
tmsize_t n;
- uint8* oy;
- uint8* ocb;
- uint8* ocr;
- uint8* p;
- uint32 q;
- uint8* r;
- uint8 sx,sy;
+ uint8_t* oy;
+ uint8_t* ocb;
+ uint8_t* ocr;
+ uint8_t* p;
+ uint32_t q;
+ uint8_t* r;
+ uint8_t sx,sy;
if (cc%sp->bytes_per_line!=0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Fractional scanline not read");
@@ -883,11 +883,11 @@ OJPEGDecodeRaw(TIFF* tif, uint8* buf, tmsize_t cc)
}
static int
-OJPEGDecodeScanlines(TIFF* tif, uint8* buf, tmsize_t cc)
+OJPEGDecodeScanlines(TIFF* tif, uint8_t* buf, tmsize_t cc)
{
static const char module[]="OJPEGDecodeScanlines";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8* m;
+ uint8_t* m;
tmsize_t n;
if (cc%sp->bytes_per_line!=0)
{
@@ -908,7 +908,7 @@ OJPEGDecodeScanlines(TIFF* tif, uint8* buf, tmsize_t cc)
}
static void
-OJPEGPostDecode(TIFF* tif, uint8* buf, tmsize_t cc)
+OJPEGPostDecode(TIFF* tif, uint8_t* buf, tmsize_t cc)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
(void)buf;
@@ -931,7 +931,7 @@ OJPEGSetupEncode(TIFF* tif)
}
static int
-OJPEGPreEncode(TIFF* tif, uint16 s)
+OJPEGPreEncode(TIFF* tif, uint16_t s)
{
static const char module[]="OJPEGPreEncode";
(void)s;
@@ -940,7 +940,7 @@ OJPEGPreEncode(TIFF* tif, uint16 s)
}
static int
-OJPEGEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+OJPEGEncode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
static const char module[]="OJPEGEncode";
(void)buf;
@@ -1010,8 +1010,8 @@ OJPEGSubsamplingCorrect(TIFF* tif)
{
static const char module[]="OJPEGSubsamplingCorrect";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8 mh;
- uint8 mv;
+ uint8_t mh;
+ uint8_t mv;
assert(sp->subsamplingcorrect_done==0);
if ((tif->tif_dir.td_samplesperpixel!=3) || ((tif->tif_dir.td_photometric!=PHOTOMETRIC_YCBCR) &&
@@ -1039,21 +1039,21 @@ OJPEGSubsamplingCorrect(TIFF* tif)
if (((sp->subsampling_hor!=mh) || (sp->subsampling_ver!=mv)) && (sp->subsampling_force_desubsampling_inside_decompression==0))
{
if (sp->subsampling_tag==0)
- TIFFWarningExt(tif->tif_clientdata,module,"Subsampling tag is not set, yet subsampling inside JPEG data [%d,%d] does not match default values [2,2]; assuming subsampling inside JPEG data is correct",sp->subsampling_hor,sp->subsampling_ver);
+ TIFFWarningExt(tif->tif_clientdata,module,"Subsampling tag is not set, yet subsampling inside JPEG data [%"PRIu8",%"PRIu8"] does not match default values [2,2]; assuming subsampling inside JPEG data is correct",sp->subsampling_hor,sp->subsampling_ver);
else
- TIFFWarningExt(tif->tif_clientdata,module,"Subsampling inside JPEG data [%d,%d] does not match subsampling tag values [%d,%d]; assuming subsampling inside JPEG data is correct",sp->subsampling_hor,sp->subsampling_ver,mh,mv);
+ TIFFWarningExt(tif->tif_clientdata,module,"Subsampling inside JPEG data [%"PRIu8",%"PRIu8"] does not match subsampling tag values [%"PRIu8",%"PRIu8"]; assuming subsampling inside JPEG data is correct",sp->subsampling_hor,sp->subsampling_ver,mh,mv);
}
if (sp->subsampling_force_desubsampling_inside_decompression!=0)
{
if (sp->subsampling_tag==0)
TIFFWarningExt(tif->tif_clientdata,module,"Subsampling tag is not set, yet subsampling inside JPEG data does not match default values [2,2] (nor any other values allowed in TIFF); assuming subsampling inside JPEG data is correct and desubsampling inside JPEG decompression");
else
- TIFFWarningExt(tif->tif_clientdata,module,"Subsampling inside JPEG data does not match subsampling tag values [%d,%d] (nor any other values allowed in TIFF); assuming subsampling inside JPEG data is correct and desubsampling inside JPEG decompression",mh,mv);
+ TIFFWarningExt(tif->tif_clientdata,module,"Subsampling inside JPEG data does not match subsampling tag values [%"PRIu8",%"PRIu8"] (nor any other values allowed in TIFF); assuming subsampling inside JPEG data is correct and desubsampling inside JPEG decompression",mh,mv);
}
if (sp->subsampling_force_desubsampling_inside_decompression==0)
{
if (sp->subsampling_hor<sp->subsampling_ver)
- TIFFWarningExt(tif->tif_clientdata,module,"Subsampling values [%d,%d] are not allowed in TIFF",sp->subsampling_hor,sp->subsampling_ver);
+ TIFFWarningExt(tif->tif_clientdata,module,"Subsampling values [%"PRIu8",%"PRIu8"] are not allowed in TIFF",sp->subsampling_hor,sp->subsampling_ver);
}
}
sp->subsamplingcorrect_done=1;
@@ -1077,7 +1077,7 @@ OJPEGReadHeaderInfo(TIFF* tif)
{
sp->strile_width=sp->image_width;
sp->strile_length=tif->tif_dir.td_rowsperstrip;
- if( sp->strile_length == (uint32)-1 )
+ if( sp->strile_length == (uint32_t)-1 )
sp->strile_length = sp->image_length;
sp->strile_length_total=sp->image_length;
}
@@ -1093,7 +1093,7 @@ OJPEGReadHeaderInfo(TIFF* tif)
{
if (tif->tif_dir.td_samplesperpixel!=3)
{
- TIFFErrorExt(tif->tif_clientdata,module,"SamplesPerPixel %d not supported for this compression scheme",sp->samples_per_pixel);
+ TIFFErrorExt(tif->tif_clientdata,module,"SamplesPerPixel %"PRIu8" not supported for this compression scheme",sp->samples_per_pixel);
return(0);
}
sp->samples_per_pixel=3;
@@ -1116,7 +1116,7 @@ OJPEGReadHeaderInfo(TIFF* tif)
TIFFErrorExt(tif->tif_clientdata,module,"Incompatible vertical subsampling and image strip/tile length");
return(0);
}
- sp->restart_interval=(uint16)(((sp->strile_width+sp->subsampling_hor*8-1)/(sp->subsampling_hor*8))*(sp->strile_length/(sp->subsampling_ver*8)));
+ sp->restart_interval=(uint16_t)(((sp->strile_width + sp->subsampling_hor * 8 - 1) / (sp->subsampling_hor * 8)) * (sp->strile_length / (sp->subsampling_ver * 8)));
}
if (OJPEGReadHeaderInfoSec(tif)==0)
return(0);
@@ -1130,15 +1130,15 @@ OJPEGReadHeaderInfo(TIFF* tif)
}
static int
-OJPEGReadSecondarySos(TIFF* tif, uint16 s)
+OJPEGReadSecondarySos(TIFF* tif, uint16_t s)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8 m;
+ uint8_t m;
assert(s>0);
assert(s<3);
assert(sp->sos_end[0].log!=0);
assert(sp->sos_end[s].log==0);
- sp->plane_sample_offset=(uint8)(s-1);
+ sp->plane_sample_offset=(uint8_t)(s - 1);
while(sp->sos_end[sp->plane_sample_offset].log==0)
sp->plane_sample_offset--;
sp->in_buffer_source=sp->sos_end[sp->plane_sample_offset].in_buffer_source;
@@ -1269,8 +1269,8 @@ OJPEGWriteHeaderInfo(TIFF* tif)
{
static const char module[]="OJPEGWriteHeaderInfo";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8** m;
- uint32 n;
+ uint8_t** m;
+ uint32_t n;
/* if a previous attempt failed, don't try again */
if (sp->libjpeg_session_active != 0)
return 0;
@@ -1337,16 +1337,16 @@ OJPEGWriteHeaderInfo(TIFF* tif)
sp->subsampling_convert_cbbuf=sp->subsampling_convert_ybuf+sp->subsampling_convert_ybuflen;
sp->subsampling_convert_crbuf=sp->subsampling_convert_cbbuf+sp->subsampling_convert_cbuflen;
sp->subsampling_convert_ycbcrimagelen=3+sp->subsampling_convert_ylines+2*sp->subsampling_convert_clines;
- sp->subsampling_convert_ycbcrimage=_TIFFmalloc(sp->subsampling_convert_ycbcrimagelen*sizeof(uint8*));
+ sp->subsampling_convert_ycbcrimage=_TIFFmalloc(sp->subsampling_convert_ycbcrimagelen*sizeof(uint8_t*));
if (sp->subsampling_convert_ycbcrimage==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
m=sp->subsampling_convert_ycbcrimage;
- *m++=(uint8*)(sp->subsampling_convert_ycbcrimage+3);
- *m++=(uint8*)(sp->subsampling_convert_ycbcrimage+3+sp->subsampling_convert_ylines);
- *m++=(uint8*)(sp->subsampling_convert_ycbcrimage+3+sp->subsampling_convert_ylines+sp->subsampling_convert_clines);
+ *m++=(uint8_t*)(sp->subsampling_convert_ycbcrimage + 3);
+ *m++=(uint8_t*)(sp->subsampling_convert_ycbcrimage + 3 + sp->subsampling_convert_ylines);
+ *m++=(uint8_t*)(sp->subsampling_convert_ycbcrimage + 3 + sp->subsampling_convert_ylines + sp->subsampling_convert_clines);
for (n=0; n<sp->subsampling_convert_ylines; n++)
*m++=sp->subsampling_convert_ybuf+n*sp->subsampling_convert_ylinelen;
for (n=0; n<sp->subsampling_convert_clines; n++)
@@ -1373,8 +1373,8 @@ OJPEGWriteHeaderInfo(TIFF* tif)
return(0);
if(sp->libjpeg_jpeg_decompress_struct.image_width != sp->strile_width ) {
TIFFErrorExt(tif->tif_clientdata,module,
- "jpeg_start_decompress() returned image_width = %d, "
- "expected %d",
+ "jpeg_start_decompress() returned image_width = %u, "
+ "expected %"PRIu32,
sp->libjpeg_jpeg_decompress_struct.image_width,
sp->strile_width);
return 0;
@@ -1383,7 +1383,7 @@ OJPEGWriteHeaderInfo(TIFF* tif)
sp->libjpeg_jpeg_decompress_struct.max_v_samp_factor != sp->subsampling_ver) {
TIFFErrorExt(tif->tif_clientdata,module,
"jpeg_start_decompress() returned max_h_samp_factor = %d "
- "and max_v_samp_factor = %d, expected %d and %d",
+ "and max_v_samp_factor = %d, expected %"PRIu8" and %"PRIu8,
sp->libjpeg_jpeg_decompress_struct.max_h_samp_factor,
sp->libjpeg_jpeg_decompress_struct.max_v_samp_factor,
sp->subsampling_hor,
@@ -1409,9 +1409,9 @@ OJPEGReadHeaderInfoSec(TIFF* tif)
{
static const char module[]="OJPEGReadHeaderInfoSec";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8 m;
- uint16 n;
- uint8 o;
+ uint8_t m;
+ uint16_t n;
+ uint8_t o;
if (sp->file_size==0)
sp->file_size=TIFFGetFileSize(tif);
if (sp->jpeg_interchange_format!=0)
@@ -1424,7 +1424,7 @@ OJPEGReadHeaderInfoSec(TIFF* tif)
else
{
if ((sp->jpeg_interchange_format_length==0) ||
- (sp->jpeg_interchange_format > TIFF_UINT64_MAX - sp->jpeg_interchange_format_length) ||
+ (sp->jpeg_interchange_format > UINT64_MAX - sp->jpeg_interchange_format_length) ||
(sp->jpeg_interchange_format+sp->jpeg_interchange_format_length>sp->file_size))
sp->jpeg_interchange_format_length=sp->file_size-sp->jpeg_interchange_format;
}
@@ -1508,7 +1508,7 @@ OJPEGReadHeaderInfoSec(TIFF* tif)
return(0);
break;
default:
- TIFFErrorExt(tif->tif_clientdata,module,"Unknown marker type %d in JPEG data",m);
+ TIFFErrorExt(tif->tif_clientdata,module,"Unknown marker type %"PRIu8" in JPEG data", m);
return(0);
}
} while(m!=JPEG_MARKER_SOS);
@@ -1544,7 +1544,7 @@ OJPEGReadHeaderInfoSecStreamDri(TIFF* tif)
occurred so far */
static const char module[]="OJPEGReadHeaderInfoSecStreamDri";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint16 m;
+ uint16_t m;
if (OJPEGReadWord(sp,&m)==0)
return(0);
if (m!=4)
@@ -1564,10 +1564,10 @@ OJPEGReadHeaderInfoSecStreamDqt(TIFF* tif)
/* this is a table marker, and it is to be saved as a whole for exact pushing on the jpeg stream later on */
static const char module[]="OJPEGReadHeaderInfoSecStreamDqt";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint16 m;
- uint32 na;
- uint8* nb;
- uint8 o;
+ uint16_t m;
+ uint32_t na;
+ uint8_t* nb;
+ uint8_t o;
if (OJPEGReadWord(sp,&m)==0)
return(0);
if (m<=2)
@@ -1588,23 +1588,23 @@ OJPEGReadHeaderInfoSecStreamDqt(TIFF* tif)
TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DQT marker in JPEG data");
return(0);
}
- na=sizeof(uint32)+69;
+ na= sizeof(uint32_t) + 69;
nb=_TIFFmalloc(na);
if (nb==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
- *(uint32*)nb=na;
- nb[sizeof(uint32)]=255;
- nb[sizeof(uint32)+1]=JPEG_MARKER_DQT;
- nb[sizeof(uint32)+2]=0;
- nb[sizeof(uint32)+3]=67;
- if (OJPEGReadBlock(sp,65,&nb[sizeof(uint32)+4])==0) {
+ *(uint32_t*)nb=na;
+ nb[sizeof(uint32_t)]=255;
+ nb[sizeof(uint32_t) + 1]=JPEG_MARKER_DQT;
+ nb[sizeof(uint32_t) + 2]=0;
+ nb[sizeof(uint32_t) + 3]=67;
+ if (OJPEGReadBlock(sp,65,&nb[sizeof(uint32_t) + 4]) == 0) {
_TIFFfree(nb);
return(0);
}
- o=nb[sizeof(uint32)+4]&15;
+ o= nb[sizeof(uint32_t) + 4] & 15;
if (3<o)
{
TIFFErrorExt(tif->tif_clientdata,module,"Corrupt DQT marker in JPEG data");
@@ -1627,10 +1627,10 @@ OJPEGReadHeaderInfoSecStreamDht(TIFF* tif)
/* TODO: the following assumes there is only one table in this marker... but i'm not quite sure that assumption is guaranteed correct */
static const char module[]="OJPEGReadHeaderInfoSecStreamDht";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint16 m;
- uint32 na;
- uint8* nb;
- uint8 o;
+ uint16_t m;
+ uint32_t na;
+ uint8_t* nb;
+ uint8_t o;
if (OJPEGReadWord(sp,&m)==0)
return(0);
if (m<=2)
@@ -1645,23 +1645,23 @@ OJPEGReadHeaderInfoSecStreamDht(TIFF* tif)
}
else
{
- na=sizeof(uint32)+2+m;
+ na= sizeof(uint32_t) + 2 + m;
nb=_TIFFmalloc(na);
if (nb==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
- *(uint32*)nb=na;
- nb[sizeof(uint32)]=255;
- nb[sizeof(uint32)+1]=JPEG_MARKER_DHT;
- nb[sizeof(uint32)+2]=(m>>8);
- nb[sizeof(uint32)+3]=(m&255);
- if (OJPEGReadBlock(sp,m-2,&nb[sizeof(uint32)+4])==0) {
+ *(uint32_t*)nb=na;
+ nb[sizeof(uint32_t)]=255;
+ nb[sizeof(uint32_t) + 1]=JPEG_MARKER_DHT;
+ nb[sizeof(uint32_t) + 2]=(m >> 8);
+ nb[sizeof(uint32_t) + 3]=(m & 255);
+ if (OJPEGReadBlock(sp,m-2,&nb[sizeof(uint32_t) + 4]) == 0) {
_TIFFfree(nb);
return(0);
}
- o=nb[sizeof(uint32)+4];
+ o=nb[sizeof(uint32_t) + 4];
if ((o&240)==0)
{
if (3<o)
@@ -1698,16 +1698,16 @@ OJPEGReadHeaderInfoSecStreamDht(TIFF* tif)
}
static int
-OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8 marker_id)
+OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8_t marker_id)
{
/* this marker needs to be checked, and part of its data needs to be saved for regeneration later on */
static const char module[]="OJPEGReadHeaderInfoSecStreamSof";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint16 m;
- uint16 n;
- uint8 o;
- uint16 p;
- uint16 q;
+ uint16_t m;
+ uint16_t n;
+ uint8_t o;
+ uint16_t p;
+ uint16_t q;
if (sp->sof_log!=0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Corrupt JPEG data");
@@ -1757,7 +1757,7 @@ OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8 marker_id)
/* Y: Number of lines */
if (OJPEGReadWord(sp,&p)==0)
return(0);
- if (((uint32)p<sp->image_length) && ((uint32)p<sp->strile_length_total))
+ if (((uint32_t)p < sp->image_length) && ((uint32_t)p < sp->strile_length_total))
{
TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data indicates unexpected height");
return(0);
@@ -1766,12 +1766,12 @@ OJPEGReadHeaderInfoSecStreamSof(TIFF* tif, uint8 marker_id)
/* X: Number of samples per line */
if (OJPEGReadWord(sp,&p)==0)
return(0);
- if (((uint32)p<sp->image_width) && ((uint32)p<sp->strile_width))
+ if (((uint32_t)p < sp->image_width) && ((uint32_t)p < sp->strile_width))
{
TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data indicates unexpected width");
return(0);
}
- if ((uint32)p>sp->strile_width)
+ if ((uint32_t)p > sp->strile_width)
{
TIFFErrorExt(tif->tif_clientdata,module,"JPEG compressed data image width exceeds expected image width");
return(0);
@@ -1855,9 +1855,9 @@ OJPEGReadHeaderInfoSecStreamSos(TIFF* tif)
/* this marker needs to be checked, and part of its data needs to be saved for regeneration later on */
static const char module[]="OJPEGReadHeaderInfoSecStreamSos";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint16 m;
- uint8 n;
- uint8 o;
+ uint16_t m;
+ uint8_t n;
+ uint8_t o;
assert(sp->subsamplingcorrect==0);
if (sp->sof_log==0)
{
@@ -1902,11 +1902,11 @@ OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
{
static const char module[]="OJPEGReadHeaderInfoSecTablesQTable";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8 m;
- uint8 n;
- uint32 oa;
- uint8* ob;
- uint32 p;
+ uint8_t m;
+ uint8_t n;
+ uint32_t oa;
+ uint8_t* ob;
+ uint32_t p;
if (sp->qtable_offset[0]==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables");
@@ -1925,21 +1925,21 @@ OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
return(0);
}
}
- oa=sizeof(uint32)+69;
+ oa= sizeof(uint32_t) + 69;
ob=_TIFFmalloc(oa);
if (ob==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
- *(uint32*)ob=oa;
- ob[sizeof(uint32)]=255;
- ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
- ob[sizeof(uint32)+2]=0;
- ob[sizeof(uint32)+3]=67;
- ob[sizeof(uint32)+4]=m;
+ *(uint32_t*)ob=oa;
+ ob[sizeof(uint32_t)]=255;
+ ob[sizeof(uint32_t) + 1]=JPEG_MARKER_DQT;
+ ob[sizeof(uint32_t) + 2]=0;
+ ob[sizeof(uint32_t) + 3]=67;
+ ob[sizeof(uint32_t) + 4]=m;
TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET);
- p=(uint32)TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
+ p=(uint32_t)TIFFReadFile(tif, &ob[sizeof(uint32_t) + 5], 64);
if (p!=64)
{
_TIFFfree(ob);
@@ -1961,13 +1961,13 @@ OJPEGReadHeaderInfoSecTablesDcTable(TIFF* tif)
{
static const char module[]="OJPEGReadHeaderInfoSecTablesDcTable";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8 m;
- uint8 n;
- uint8 o[16];
- uint32 p;
- uint32 q;
- uint32 ra;
- uint8* rb;
+ uint8_t m;
+ uint8_t n;
+ uint8_t o[16];
+ uint32_t p;
+ uint32_t q;
+ uint32_t ra;
+ uint8_t* rb;
if (sp->dctable_offset[0]==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables");
@@ -1987,28 +1987,28 @@ OJPEGReadHeaderInfoSecTablesDcTable(TIFF* tif)
}
}
TIFFSeekFile(tif,sp->dctable_offset[m],SEEK_SET);
- p=(uint32)TIFFReadFile(tif,o,16);
+ p=(uint32_t)TIFFReadFile(tif, o, 16);
if (p!=16)
return(0);
q=0;
for (n=0; n<16; n++)
q+=o[n];
- ra=sizeof(uint32)+21+q;
+ ra= sizeof(uint32_t) + 21 + q;
rb=_TIFFmalloc(ra);
if (rb==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
- *(uint32*)rb=ra;
- rb[sizeof(uint32)]=255;
- rb[sizeof(uint32)+1]=JPEG_MARKER_DHT;
- rb[sizeof(uint32)+2]=(uint8)((19+q)>>8);
- rb[sizeof(uint32)+3]=((19+q)&255);
- rb[sizeof(uint32)+4]=m;
+ *(uint32_t*)rb=ra;
+ rb[sizeof(uint32_t)]=255;
+ rb[sizeof(uint32_t) + 1]=JPEG_MARKER_DHT;
+ rb[sizeof(uint32_t) + 2]=(uint8_t)((19 + q) >> 8);
+ rb[sizeof(uint32_t) + 3]=((19 + q) & 255);
+ rb[sizeof(uint32_t) + 4]=m;
for (n=0; n<16; n++)
- rb[sizeof(uint32)+5+n]=o[n];
- p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
+ rb[sizeof(uint32_t) + 5 + n]=o[n];
+ p=(uint32_t)TIFFReadFile(tif, &(rb[sizeof(uint32_t) + 21]), q);
if (p!=q)
{
_TIFFfree(rb);
@@ -2030,13 +2030,13 @@ OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif)
{
static const char module[]="OJPEGReadHeaderInfoSecTablesAcTable";
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8 m;
- uint8 n;
- uint8 o[16];
- uint32 p;
- uint32 q;
- uint32 ra;
- uint8* rb;
+ uint8_t m;
+ uint8_t n;
+ uint8_t o[16];
+ uint32_t p;
+ uint32_t q;
+ uint32_t ra;
+ uint8_t* rb;
if (sp->actable_offset[0]==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables");
@@ -2056,28 +2056,28 @@ OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif)
}
}
TIFFSeekFile(tif,sp->actable_offset[m],SEEK_SET);
- p=(uint32)TIFFReadFile(tif,o,16);
+ p=(uint32_t)TIFFReadFile(tif, o, 16);
if (p!=16)
return(0);
q=0;
for (n=0; n<16; n++)
q+=o[n];
- ra=sizeof(uint32)+21+q;
+ ra= sizeof(uint32_t) + 21 + q;
rb=_TIFFmalloc(ra);
if (rb==0)
{
TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");
return(0);
}
- *(uint32*)rb=ra;
- rb[sizeof(uint32)]=255;
- rb[sizeof(uint32)+1]=JPEG_MARKER_DHT;
- rb[sizeof(uint32)+2]=(uint8)((19+q)>>8);
- rb[sizeof(uint32)+3]=((19+q)&255);
- rb[sizeof(uint32)+4]=(16|m);
+ *(uint32_t*)rb=ra;
+ rb[sizeof(uint32_t)]=255;
+ rb[sizeof(uint32_t) + 1]=JPEG_MARKER_DHT;
+ rb[sizeof(uint32_t) + 2]=(uint8_t)((19 + q) >> 8);
+ rb[sizeof(uint32_t) + 3]=((19 + q) & 255);
+ rb[sizeof(uint32_t) + 4]=(16 | m);
for (n=0; n<16; n++)
- rb[sizeof(uint32)+5+n]=o[n];
- p=(uint32)TIFFReadFile(tif,&(rb[sizeof(uint32)+21]),q);
+ rb[sizeof(uint32_t) + 5 + n]=o[n];
+ p=(uint32_t)TIFFReadFile(tif, &(rb[sizeof(uint32_t) + 21]), q);
if (p!=q)
{
_TIFFfree(rb);
@@ -2097,7 +2097,7 @@ OJPEGReadHeaderInfoSecTablesAcTable(TIFF* tif)
static int
OJPEGReadBufferFill(OJPEGState* sp)
{
- uint16 m;
+ uint16_t m;
tmsize_t n;
/* TODO: double-check: when subsamplingcorrect is set, no call to TIFFErrorExt or TIFFWarningExt should be made
* in any other case, seek or read errors should be passed through */
@@ -2111,16 +2111,16 @@ OJPEGReadBufferFill(OJPEGState* sp)
sp->in_buffer_file_pos_log=1;
}
m=OJPEG_BUFFER;
- if ((uint64)m>sp->in_buffer_file_togo)
- m=(uint16)sp->in_buffer_file_togo;
+ if ((uint64_t)m > sp->in_buffer_file_togo)
+ m=(uint16_t)sp->in_buffer_file_togo;
n=TIFFReadFile(sp->tif,sp->in_buffer,(tmsize_t)m);
if (n==0)
return(0);
assert(n>0);
assert(n<=OJPEG_BUFFER);
assert(n<65536);
- assert((uint64)n<=sp->in_buffer_file_togo);
- m=(uint16)n;
+ assert((uint64_t)n <= sp->in_buffer_file_togo);
+ m=(uint16_t)n;
sp->in_buffer_togo=m;
sp->in_buffer_cur=sp->in_buffer;
sp->in_buffer_file_togo-=m;
@@ -2152,7 +2152,7 @@ OJPEGReadBufferFill(OJPEGState* sp)
return 0;
if (sp->in_buffer_file_pos!=0)
{
- uint64 bytecount = TIFFGetStrileByteCountWithErr(sp->tif, sp->in_buffer_next_strile, &err);
+ uint64_t bytecount = TIFFGetStrileByteCountWithErr(sp->tif, sp->in_buffer_next_strile, &err);
if( err )
return 0;
if (sp->in_buffer_file_pos>=sp->file_size)
@@ -2164,7 +2164,7 @@ OJPEGReadBufferFill(OJPEGState* sp)
sp->in_buffer_file_togo=bytecount;
if (sp->in_buffer_file_togo==0)
sp->in_buffer_file_pos=0;
- else if (sp->in_buffer_file_pos > TIFF_UINT64_MAX - sp->in_buffer_file_togo ||
+ else if (sp->in_buffer_file_pos > UINT64_MAX - sp->in_buffer_file_togo ||
sp->in_buffer_file_pos+sp->in_buffer_file_togo>sp->file_size)
sp->in_buffer_file_togo=sp->file_size-sp->in_buffer_file_pos;
}
@@ -2180,7 +2180,7 @@ OJPEGReadBufferFill(OJPEGState* sp)
}
static int
-OJPEGReadByte(OJPEGState* sp, uint8* byte)
+OJPEGReadByte(OJPEGState* sp, uint8_t* byte)
{
if (sp->in_buffer_togo==0)
{
@@ -2195,7 +2195,7 @@ OJPEGReadByte(OJPEGState* sp, uint8* byte)
}
static int
-OJPEGReadBytePeek(OJPEGState* sp, uint8* byte)
+OJPEGReadBytePeek(OJPEGState* sp, uint8_t* byte)
{
if (sp->in_buffer_togo==0)
{
@@ -2216,9 +2216,9 @@ OJPEGReadByteAdvance(OJPEGState* sp)
}
static int
-OJPEGReadWord(OJPEGState* sp, uint16* word)
+OJPEGReadWord(OJPEGState* sp, uint16_t* word)
{
- uint8 m;
+ uint8_t m;
if (OJPEGReadByte(sp,&m)==0)
return(0);
*word=(m<<8);
@@ -2229,11 +2229,11 @@ OJPEGReadWord(OJPEGState* sp, uint16* word)
}
static int
-OJPEGReadBlock(OJPEGState* sp, uint16 len, void* mem)
+OJPEGReadBlock(OJPEGState* sp, uint16_t len, void* mem)
{
- uint16 mlen;
- uint8* mmem;
- uint16 n;
+ uint16_t mlen;
+ uint8_t* mmem;
+ uint16_t n;
assert(len>0);
mlen=len;
mmem=mem;
@@ -2258,10 +2258,10 @@ OJPEGReadBlock(OJPEGState* sp, uint16 len, void* mem)
}
static void
-OJPEGReadSkip(OJPEGState* sp, uint16 len)
+OJPEGReadSkip(OJPEGState* sp, uint16_t len)
{
- uint16 m;
- uint16 n;
+ uint16_t m;
+ uint16_t n;
m=len;
n=m;
if (n>sp->in_buffer_togo)
@@ -2273,8 +2273,8 @@ OJPEGReadSkip(OJPEGState* sp, uint16 len)
{
assert(sp->in_buffer_togo==0);
n=m;
- if ((uint64)n>sp->in_buffer_file_togo)
- n=(uint16)sp->in_buffer_file_togo;
+ if ((uint64_t)n > sp->in_buffer_file_togo)
+ n=(uint16_t)sp->in_buffer_file_togo;
sp->in_buffer_file_pos+=n;
sp->in_buffer_file_togo-=n;
sp->in_buffer_file_pos_log=0;
@@ -2288,7 +2288,7 @@ OJPEGReadSkip(OJPEGState* sp, uint16 len)
}
static int
-OJPEGWriteStream(TIFF* tif, void** mem, uint32* len)
+OJPEGWriteStream(TIFF* tif, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
*len=0;
@@ -2361,7 +2361,7 @@ OJPEGWriteStream(TIFF* tif, void** mem, uint32* len)
}
static void
-OJPEGWriteStreamSoi(TIFF* tif, void** mem, uint32* len)
+OJPEGWriteStreamSoi(TIFF* tif, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
assert(OJPEG_BUFFER>=2);
@@ -2373,43 +2373,43 @@ OJPEGWriteStreamSoi(TIFF* tif, void** mem, uint32* len)
}
static void
-OJPEGWriteStreamQTable(TIFF* tif, uint8 table_index, void** mem, uint32* len)
+OJPEGWriteStreamQTable(TIFF* tif, uint8_t table_index, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
if (sp->qtable[table_index]!=0)
{
- *mem=(void*)(sp->qtable[table_index]+sizeof(uint32));
- *len=*((uint32*)sp->qtable[table_index])-sizeof(uint32);
+ *mem=(void*)(sp->qtable[table_index]+sizeof(uint32_t));
+ *len= *((uint32_t*)sp->qtable[table_index]) - sizeof(uint32_t);
}
sp->out_state++;
}
static void
-OJPEGWriteStreamDcTable(TIFF* tif, uint8 table_index, void** mem, uint32* len)
+OJPEGWriteStreamDcTable(TIFF* tif, uint8_t table_index, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
if (sp->dctable[table_index]!=0)
{
- *mem=(void*)(sp->dctable[table_index]+sizeof(uint32));
- *len=*((uint32*)sp->dctable[table_index])-sizeof(uint32);
+ *mem=(void*)(sp->dctable[table_index]+sizeof(uint32_t));
+ *len= *((uint32_t*)sp->dctable[table_index]) - sizeof(uint32_t);
}
sp->out_state++;
}
static void
-OJPEGWriteStreamAcTable(TIFF* tif, uint8 table_index, void** mem, uint32* len)
+OJPEGWriteStreamAcTable(TIFF* tif, uint8_t table_index, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
if (sp->actable[table_index]!=0)
{
- *mem=(void*)(sp->actable[table_index]+sizeof(uint32));
- *len=*((uint32*)sp->actable[table_index])-sizeof(uint32);
+ *mem=(void*)(sp->actable[table_index]+sizeof(uint32_t));
+ *len= *((uint32_t*)sp->actable[table_index]) - sizeof(uint32_t);
}
sp->out_state++;
}
static void
-OJPEGWriteStreamDri(TIFF* tif, void** mem, uint32* len)
+OJPEGWriteStreamDri(TIFF* tif, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
assert(OJPEG_BUFFER>=6);
@@ -2428,10 +2428,10 @@ OJPEGWriteStreamDri(TIFF* tif, void** mem, uint32* len)
}
static void
-OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32* len)
+OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8 m;
+ uint8_t m;
assert(OJPEG_BUFFER>=2+8+sp->samples_per_pixel_per_plane*3);
assert(255>=8+sp->samples_per_pixel_per_plane*3);
sp->out_buffer[0]=255;
@@ -2442,10 +2442,10 @@ OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32* len)
/* P */
sp->out_buffer[4]=8;
/* Y */
- sp->out_buffer[5]=(uint8)(sp->sof_y>>8);
+ sp->out_buffer[5]=(uint8_t)(sp->sof_y >> 8);
sp->out_buffer[6]=(sp->sof_y&255);
/* X */
- sp->out_buffer[7]=(uint8)(sp->sof_x>>8);
+ sp->out_buffer[7]=(uint8_t)(sp->sof_x >> 8);
sp->out_buffer[8]=(sp->sof_x&255);
/* Nf */
sp->out_buffer[9]=sp->samples_per_pixel_per_plane;
@@ -2464,10 +2464,10 @@ OJPEGWriteStreamSof(TIFF* tif, void** mem, uint32* len)
}
static void
-OJPEGWriteStreamSos(TIFF* tif, void** mem, uint32* len)
+OJPEGWriteStreamSos(TIFF* tif, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
- uint8 m;
+ uint8_t m;
assert(OJPEG_BUFFER>=2+6+sp->samples_per_pixel_per_plane*2);
assert(255>=6+sp->samples_per_pixel_per_plane*2);
sp->out_buffer[0]=255;
@@ -2496,7 +2496,7 @@ OJPEGWriteStreamSos(TIFF* tif, void** mem, uint32* len)
}
static int
-OJPEGWriteStreamCompressed(TIFF* tif, void** mem, uint32* len)
+OJPEGWriteStreamCompressed(TIFF* tif, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
if (sp->in_buffer_togo==0)
@@ -2529,7 +2529,7 @@ OJPEGWriteStreamCompressed(TIFF* tif, void** mem, uint32* len)
}
static void
-OJPEGWriteStreamRst(TIFF* tif, void** mem, uint32* len)
+OJPEGWriteStreamRst(TIFF* tif, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
assert(OJPEG_BUFFER>=2);
@@ -2544,7 +2544,7 @@ OJPEGWriteStreamRst(TIFF* tif, void** mem, uint32* len)
}
static void
-OJPEGWriteStreamEoi(TIFF* tif, void** mem, uint32* len)
+OJPEGWriteStreamEoi(TIFF* tif, void** mem, uint32_t* len)
{
OJPEGState* sp=(OJPEGState*)tif->tif_data;
assert(OJPEG_BUFFER>=2);
@@ -2569,7 +2569,7 @@ jpeg_create_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo)
#ifndef LIBJPEG_ENCAP_EXTERNAL
static int
-jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8 require_image)
+jpeg_read_header_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, uint8_t require_image)
{
if( SETJMP(sp->exit_jmpbuf) )
return 0;
@@ -2595,7 +2595,7 @@ jpeg_start_decompress_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo)
#ifndef LIBJPEG_ENCAP_EXTERNAL
static int
-jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32 max_lines)
+jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* scanlines, uint32_t max_lines)
{
if( SETJMP(sp->exit_jmpbuf) )
return 0;
@@ -2608,7 +2608,7 @@ jpeg_read_scanlines_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* s
#ifndef LIBJPEG_ENCAP_EXTERNAL
static int
-jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32 max_lines)
+jpeg_read_raw_data_encap(OJPEGState* sp, jpeg_decompress_struct* cinfo, void* data, uint32_t max_lines)
{
if( SETJMP(sp->exit_jmpbuf) )
return 0;
@@ -2659,7 +2659,7 @@ OJPEGLibjpegJpegSourceMgrFillInputBuffer(jpeg_decompress_struct* cinfo)
TIFF *tif = TIFF_FROM_CINFO(cinfo);
OJPEGState* sp=(OJPEGState*)tif->tif_data;
void* mem=0;
- uint32 len=0U;
+ uint32_t len=0U;
if (OJPEGWriteStream(tif,&mem,&len)==0)
{
TIFFErrorExt(tif->tif_clientdata,"LibJpeg","Premature end of JPEG data");
diff --git a/tiff/libtiff/tif_open.c b/tiff/libtiff/tif_open.c
index 0534773a..eec5469d 100644
--- a/tiff/libtiff/tif_open.c
+++ b/tiff/libtiff/tif_open.c
@@ -88,19 +88,19 @@ TIFFClientOpen(
/* The following are configuration checks. They should be redundant, but should not
* compile to any actual code in an optimised release build anyway. If any of them
* fail, (makefile-based or other) configuration is not correct */
- assert(sizeof(uint8)==1);
- assert(sizeof(int8)==1);
- assert(sizeof(uint16)==2);
- assert(sizeof(int16)==2);
- assert(sizeof(uint32)==4);
- assert(sizeof(int32)==4);
- assert(sizeof(uint64)==8);
- assert(sizeof(int64)==8);
+ assert(sizeof(uint8_t) == 1);
+ assert(sizeof(int8_t) == 1);
+ assert(sizeof(uint16_t) == 2);
+ assert(sizeof(int16_t) == 2);
+ assert(sizeof(uint32_t) == 4);
+ assert(sizeof(int32_t) == 4);
+ assert(sizeof(uint64_t) == 8);
+ assert(sizeof(int64_t) == 8);
assert(sizeof(tmsize_t)==sizeof(void*));
{
union{
- uint8 a8[2];
- uint16 a16;
+ uint8_t a8[2];
+ uint16_t a16;
} n;
n.a8[0]=1;
n.a8[1]=0;
@@ -124,10 +124,10 @@ TIFFClientOpen(
tif->tif_name = (char *)tif + sizeof (TIFF);
strcpy(tif->tif_name, name);
tif->tif_mode = m &~ (O_CREAT|O_TRUNC);
- tif->tif_curdir = (uint16) -1; /* non-existent directory */
+ tif->tif_curdir = (uint16_t) -1; /* non-existent directory */
tif->tif_curoff = 0;
- tif->tif_curstrip = (uint32) -1; /* invalid strip */
- tif->tif_row = (uint32) -1; /* read/write pre-increment */
+ tif->tif_curstrip = (uint32_t) -1; /* invalid strip */
+ tif->tif_row = (uint32_t) -1; /* read/write pre-increment */
tif->tif_clientdata = clientdata;
if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) {
TIFFErrorExt(clientdata, module,
@@ -373,11 +373,11 @@ TIFFClientOpen(
#endif
) {
TIFFErrorExt(tif->tif_clientdata, name,
- "Not a TIFF or MDI file, bad magic number %d (0x%x)",
+ "Not a TIFF or MDI file, bad magic number %"PRIu16" (0x%"PRIx16")",
#else
) {
TIFFErrorExt(tif->tif_clientdata, name,
- "Not a TIFF file, bad magic number %d (0x%x)",
+ "Not a TIFF file, bad magic number %"PRIu16" (0x%"PRIx16")",
#endif
tif->tif_header.common.tiff_magic,
tif->tif_header.common.tiff_magic);
@@ -397,7 +397,7 @@ TIFFClientOpen(
if ((tif->tif_header.common.tiff_version != TIFF_VERSION_CLASSIC)&&
(tif->tif_header.common.tiff_version != TIFF_VERSION_BIG)) {
TIFFErrorExt(tif->tif_clientdata, name,
- "Not a TIFF file, bad version number %d (0x%x)",
+ "Not a TIFF file, bad version number %"PRIu16" (0x%"PRIx16")",
tif->tif_header.common.tiff_version,
tif->tif_header.common.tiff_version);
goto bad;
@@ -410,7 +410,7 @@ TIFFClientOpen(
}
else
{
- if (!ReadOK(tif, ((uint8*)(&tif->tif_header) + sizeof(TIFFHeaderClassic)), (sizeof(TIFFHeaderBig)-sizeof(TIFFHeaderClassic))))
+ if (!ReadOK(tif, ((uint8_t*)(&tif->tif_header) + sizeof(TIFFHeaderClassic)), (sizeof(TIFFHeaderBig) - sizeof(TIFFHeaderClassic))))
{
TIFFErrorExt(tif->tif_clientdata, name,
"Cannot read TIFF header");
@@ -424,7 +424,7 @@ TIFFClientOpen(
if (tif->tif_header.big.tiff_offsetsize != 8)
{
TIFFErrorExt(tif->tif_clientdata, name,
- "Not a TIFF file, bad BigTIFF offsetsize %d (0x%x)",
+ "Not a TIFF file, bad BigTIFF offsetsize %"PRIu16" (0x%"PRIx16")",
tif->tif_header.big.tiff_offsetsize,
tif->tif_header.big.tiff_offsetsize);
goto bad;
@@ -432,7 +432,7 @@ TIFFClientOpen(
if (tif->tif_header.big.tiff_unused != 0)
{
TIFFErrorExt(tif->tif_clientdata, name,
- "Not a TIFF file, bad BigTIFF unused %d (0x%x)",
+ "Not a TIFF file, bad BigTIFF unused %"PRIu16" (0x%"PRIx16")",
tif->tif_header.big.tiff_unused,
tif->tif_header.big.tiff_unused);
goto bad;
@@ -600,7 +600,7 @@ TIFFIsTiled(TIFF* tif)
/*
* Return current row being read/written.
*/
-uint32
+uint32_t
TIFFCurrentRow(TIFF* tif)
{
return (tif->tif_row);
@@ -609,7 +609,7 @@ TIFFCurrentRow(TIFF* tif)
/*
* Return index of the current directory.
*/
-uint16
+uint16_t
TIFFCurrentDirectory(TIFF* tif)
{
return (tif->tif_curdir);
@@ -618,7 +618,7 @@ TIFFCurrentDirectory(TIFF* tif)
/*
* Return current strip.
*/
-uint32
+uint32_t
TIFFCurrentStrip(TIFF* tif)
{
return (tif->tif_curstrip);
@@ -627,7 +627,7 @@ TIFFCurrentStrip(TIFF* tif)
/*
* Return current tile.
*/
-uint32
+uint32_t
TIFFCurrentTile(TIFF* tif)
{
return (tif->tif_curtile);
diff --git a/tiff/libtiff/tif_packbits.c b/tiff/libtiff/tif_packbits.c
index a8f29e87..76569ad7 100644
--- a/tiff/libtiff/tif_packbits.c
+++ b/tiff/libtiff/tif_packbits.c
@@ -32,11 +32,11 @@
#include <stdio.h>
static int
-PackBitsPreEncode(TIFF* tif, uint16 s)
+PackBitsPreEncode(TIFF* tif, uint16_t s)
{
(void) s;
- tif->tif_data = (uint8*)_TIFFmalloc(sizeof(tmsize_t));
+ tif->tif_data = (uint8_t*)_TIFFmalloc(sizeof(tmsize_t));
if (tif->tif_data == NULL)
return (0);
/*
@@ -61,12 +61,12 @@ PackBitsPostEncode(TIFF* tif)
* Encode a run of pixels.
*/
static int
-PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
+PackBitsEncode(TIFF* tif, uint8_t* buf, tmsize_t cc, uint16_t s)
{
unsigned char* bp = (unsigned char*) buf;
- uint8* op;
- uint8* ep;
- uint8* lastliteral;
+ uint8_t* op;
+ uint8_t* ep;
+ uint8_t* lastliteral;
long n, slop;
int b;
enum { BASE, LITERAL, RUN, LITERAL_RUN } state;
@@ -114,17 +114,17 @@ PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
if (n > 1) {
state = RUN;
if (n > 128) {
- *op++ = (uint8) -127;
- *op++ = (uint8) b;
+ *op++ = (uint8_t) -127;
+ *op++ = (uint8_t) b;
n -= 128;
goto again;
}
- *op++ = (uint8)(-(n-1));
- *op++ = (uint8) b;
+ *op++ = (uint8_t)(-(n - 1));
+ *op++ = (uint8_t) b;
} else {
lastliteral = op;
*op++ = 0;
- *op++ = (uint8) b;
+ *op++ = (uint8_t) b;
state = LITERAL;
}
break;
@@ -132,33 +132,33 @@ PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
if (n > 1) {
state = LITERAL_RUN;
if (n > 128) {
- *op++ = (uint8) -127;
- *op++ = (uint8) b;
+ *op++ = (uint8_t) -127;
+ *op++ = (uint8_t) b;
n -= 128;
goto again;
}
- *op++ = (uint8)(-(n-1)); /* encode run */
- *op++ = (uint8) b;
+ *op++ = (uint8_t)(-(n - 1)); /* encode run */
+ *op++ = (uint8_t) b;
} else { /* extend literal */
if (++(*lastliteral) == 127)
state = BASE;
- *op++ = (uint8) b;
+ *op++ = (uint8_t) b;
}
break;
case RUN: /* last object was run */
if (n > 1) {
if (n > 128) {
- *op++ = (uint8) -127;
- *op++ = (uint8) b;
+ *op++ = (uint8_t) -127;
+ *op++ = (uint8_t) b;
n -= 128;
goto again;
}
- *op++ = (uint8)(-(n-1));
- *op++ = (uint8) b;
+ *op++ = (uint8_t)(-(n - 1));
+ *op++ = (uint8_t) b;
} else {
lastliteral = op;
*op++ = 0;
- *op++ = (uint8) b;
+ *op++ = (uint8_t) b;
state = LITERAL;
}
break;
@@ -169,7 +169,7 @@ PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
* case we convert literal-run-literal
* to a single literal.
*/
- if (n == 1 && op[-2] == (uint8) -1 &&
+ if (n == 1 && op[-2] == (uint8_t) -1 &&
*lastliteral < 126) {
state = (((*lastliteral) += 2) == 127 ?
BASE : LITERAL);
@@ -192,7 +192,7 @@ PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s)
* when it was encoded by strips.
*/
static int
-PackBitsEncodeChunk(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+PackBitsEncodeChunk(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
tmsize_t rowsize = *(tmsize_t*)tif->tif_data;
@@ -211,7 +211,7 @@ PackBitsEncodeChunk(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
}
static int
-PackBitsDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+PackBitsDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "PackBitsDecode";
char *bp;
@@ -238,8 +238,8 @@ PackBitsDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
if( occ < (tmsize_t)n )
{
TIFFWarningExt(tif->tif_clientdata, module,
- "Discarding %lu bytes to avoid buffer overrun",
- (unsigned long) ((tmsize_t)n - occ));
+ "Discarding %"TIFF_SSIZE_FORMAT" bytes to avoid buffer overrun",
+ (tmsize_t)n - occ);
n = (long)occ;
}
if( cc == 0 )
@@ -252,13 +252,13 @@ PackBitsDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
b = *bp++;
cc--;
while (n-- > 0)
- *op++ = (uint8) b;
+ *op++ = (uint8_t) b;
} else { /* copy next n+1 bytes literally */
if (occ < (tmsize_t)(n + 1))
{
TIFFWarningExt(tif->tif_clientdata, module,
- "Discarding %lu bytes to avoid buffer overrun",
- (unsigned long) ((tmsize_t)n - occ + 1));
+ "Discarding %"TIFF_SSIZE_FORMAT" bytes to avoid buffer overrun",
+ (tmsize_t)n - occ + 1);
n = (long)occ - 1;
}
if (cc < (tmsize_t) (n+1))
@@ -272,12 +272,12 @@ PackBitsDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
bp += n; cc -= n;
}
}
- tif->tif_rawcp = (uint8*) bp;
+ tif->tif_rawcp = (uint8_t*) bp;
tif->tif_rawcc = cc;
if (occ > 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data for scanline %lu",
- (unsigned long) tif->tif_row);
+ "Not enough data for scanline %"PRIu32,
+ tif->tif_row);
return (0);
}
return (1);
diff --git a/tiff/libtiff/tif_pixarlog.c b/tiff/libtiff/tif_pixarlog.c
index f2912015..87c67097 100644
--- a/tiff/libtiff/tif_pixarlog.c
+++ b/tiff/libtiff/tif_pixarlog.c
@@ -109,8 +109,8 @@ static float LogK1, LogK2;
#define REPEAT(n, op) { int i; i=n; do { i--; op; } while (i>0); }
static void
-horizontalAccumulateF(uint16 *wp, int n, int stride, float *op,
- float *ToLinearF)
+horizontalAccumulateF(uint16_t *wp, int n, int stride, float *op,
+ float *ToLinearF)
{
register unsigned int cr, cg, cb, ca, mask;
register float t0, t1, t2, t3;
@@ -172,14 +172,14 @@ horizontalAccumulateF(uint16 *wp, int n, int stride, float *op,
}
static void
-horizontalAccumulate12(uint16 *wp, int n, int stride, int16 *op,
- float *ToLinearF)
+horizontalAccumulate12(uint16_t *wp, int n, int stride, int16_t *op,
+ float *ToLinearF)
{
register unsigned int cr, cg, cb, ca, mask;
register float t0, t1, t2, t3;
#define SCALE12 2048.0F
-#define CLAMP12(t) (((t) < 3071) ? (uint16) (t) : 3071)
+#define CLAMP12(t) (((t) < 3071) ? (uint16_t) (t) : 3071)
if (n >= stride) {
mask = CODE_MASK;
@@ -240,8 +240,8 @@ horizontalAccumulate12(uint16 *wp, int n, int stride, int16 *op,
}
static void
-horizontalAccumulate16(uint16 *wp, int n, int stride, uint16 *op,
- uint16 *ToLinear16)
+horizontalAccumulate16(uint16_t *wp, int n, int stride, uint16_t *op,
+ uint16_t *ToLinear16)
{
register unsigned int cr, cg, cb, ca, mask;
@@ -292,7 +292,7 @@ horizontalAccumulate16(uint16 *wp, int n, int stride, uint16 *op,
* differencing undone.
*/
static void
-horizontalAccumulate11(uint16 *wp, int n, int stride, uint16 *op)
+horizontalAccumulate11(uint16_t *wp, int n, int stride, uint16_t *op)
{
register unsigned int cr, cg, cb, ca, mask;
@@ -306,9 +306,9 @@ horizontalAccumulate11(uint16 *wp, int n, int stride, uint16 *op)
wp += 3;
op += 3;
n -= 3;
- op[0] = (uint16)((cr += wp[0]) & mask);
- op[1] = (uint16)((cg += wp[1]) & mask);
- op[2] = (uint16)((cb += wp[2]) & mask);
+ op[0] = (uint16_t)((cr += wp[0]) & mask);
+ op[1] = (uint16_t)((cg += wp[1]) & mask);
+ op[2] = (uint16_t)((cb += wp[2]) & mask);
}
} else if (stride == 4) {
op[0] = wp[0]; op[1] = wp[1];
@@ -319,10 +319,10 @@ horizontalAccumulate11(uint16 *wp, int n, int stride, uint16 *op)
wp += 4;
op += 4;
n -= 4;
- op[0] = (uint16)((cr += wp[0]) & mask);
- op[1] = (uint16)((cg += wp[1]) & mask);
- op[2] = (uint16)((cb += wp[2]) & mask);
- op[3] = (uint16)((ca += wp[3]) & mask);
+ op[0] = (uint16_t)((cr += wp[0]) & mask);
+ op[1] = (uint16_t)((cg += wp[1]) & mask);
+ op[2] = (uint16_t)((cb += wp[2]) & mask);
+ op[3] = (uint16_t)((ca += wp[3]) & mask);
}
} else {
REPEAT(stride, *op = *wp&mask; wp++; op++)
@@ -337,8 +337,8 @@ horizontalAccumulate11(uint16 *wp, int n, int stride, uint16 *op)
}
static void
-horizontalAccumulate8(uint16 *wp, int n, int stride, unsigned char *op,
- unsigned char *ToLinear8)
+horizontalAccumulate8(uint16_t *wp, int n, int stride, unsigned char *op,
+ unsigned char *ToLinear8)
{
register unsigned int cr, cg, cb, ca, mask;
@@ -386,8 +386,8 @@ horizontalAccumulate8(uint16 *wp, int n, int stride, unsigned char *op,
static void
-horizontalAccumulate8abgr(uint16 *wp, int n, int stride, unsigned char *op,
- unsigned char *ToLinear8)
+horizontalAccumulate8abgr(uint16_t *wp, int n, int stride, unsigned char *op,
+ unsigned char *ToLinear8)
{
register unsigned int cr, cg, cb, ca, mask;
register unsigned char t0, t1, t2, t3;
@@ -458,8 +458,8 @@ typedef struct {
TIFFPredictorState predict;
z_stream stream;
tmsize_t tbuf_size; /* only set/used on reading for now */
- uint16 *tbuf;
- uint16 stride;
+ uint16_t *tbuf;
+ uint16_t stride;
int state;
int user_datafmt;
int quality;
@@ -469,11 +469,11 @@ typedef struct {
TIFFVSetMethod vsetparent; /* super-class method */
float *ToLinearF;
- uint16 *ToLinear16;
+ uint16_t *ToLinear16;
unsigned char *ToLinear8;
- uint16 *FromLT2;
- uint16 *From14; /* Really for 16-bit data, but we shift down 2 */
- uint16 *From8;
+ uint16_t *FromLT2;
+ uint16_t *From14; /* Really for 16-bit data, but we shift down 2 */
+ uint16_t *From8;
} PixarLogState;
@@ -496,11 +496,11 @@ PixarLogMakeTables(PixarLogState *sp)
int i, j;
double b, c, linstep, v;
float *ToLinearF;
- uint16 *ToLinear16;
+ uint16_t *ToLinear16;
unsigned char *ToLinear8;
- uint16 *FromLT2;
- uint16 *From14; /* Really for 16-bit data, but we shift down 2 */
- uint16 *From8;
+ uint16_t *FromLT2;
+ uint16_t *From14; /* Really for 16-bit data, but we shift down 2 */
+ uint16_t *From8;
c = log(RATIO);
nlin = (int)(1./c); /* nlin must be an integer */
@@ -511,11 +511,11 @@ PixarLogMakeTables(PixarLogState *sp)
LogK1 = (float)(1./c); /* if (v >= 2) token = k1*log(v*k2) */
LogK2 = (float)(1./b);
lt2size = (int)(2./linstep) + 1;
- FromLT2 = (uint16 *)_TIFFmalloc(lt2size*sizeof(uint16));
- From14 = (uint16 *)_TIFFmalloc(16384*sizeof(uint16));
- From8 = (uint16 *)_TIFFmalloc(256*sizeof(uint16));
+ FromLT2 = (uint16_t *)_TIFFmalloc(lt2size * sizeof(uint16_t));
+ From14 = (uint16_t *)_TIFFmalloc(16384 * sizeof(uint16_t));
+ From8 = (uint16_t *)_TIFFmalloc(256 * sizeof(uint16_t));
ToLinearF = (float *)_TIFFmalloc(TSIZEP1 * sizeof(float));
- ToLinear16 = (uint16 *)_TIFFmalloc(TSIZEP1 * sizeof(uint16));
+ ToLinear16 = (uint16_t *)_TIFFmalloc(TSIZEP1 * sizeof(uint16_t));
ToLinear8 = (unsigned char *)_TIFFmalloc(TSIZEP1 * sizeof(unsigned char));
if (FromLT2 == NULL || From14 == NULL || From8 == NULL ||
ToLinearF == NULL || ToLinear16 == NULL || ToLinear8 == NULL) {
@@ -548,7 +548,7 @@ PixarLogMakeTables(PixarLogState *sp)
for (i = 0; i < TSIZEP1; i++) {
v = ToLinearF[i]*65535.0 + 0.5;
- ToLinear16[i] = (v > 65535.0) ? 65535 : (uint16)v;
+ ToLinear16[i] = (v > 65535.0) ? 65535 : (uint16_t)v;
v = ToLinearF[i]*255.0 + 0.5;
ToLinear8[i] = (v > 255.0) ? 255 : (unsigned char)v;
}
@@ -557,7 +557,7 @@ PixarLogMakeTables(PixarLogState *sp)
for (i = 0; i < lt2size; i++) {
if ((i*linstep)*(i*linstep) > ToLinearF[j]*ToLinearF[j+1])
j++;
- FromLT2[i] = (uint16)j;
+ FromLT2[i] = (uint16_t)j;
}
/*
@@ -569,14 +569,14 @@ PixarLogMakeTables(PixarLogState *sp)
for (i = 0; i < 16384; i++) {
while ((i/16383.)*(i/16383.) > ToLinearF[j]*ToLinearF[j+1])
j++;
- From14[i] = (uint16)j;
+ From14[i] = (uint16_t)j;
}
j = 0;
for (i = 0; i < 256; i++) {
while ((i/255.)*(i/255.) > ToLinearF[j]*ToLinearF[j+1])
j++;
- From8[i] = (uint16)j;
+ From8[i] = (uint16_t)j;
}
Fltsize = (float)(lt2size/2);
@@ -594,8 +594,8 @@ PixarLogMakeTables(PixarLogState *sp)
#define DecoderState(tif) ((PixarLogState*) (tif)->tif_data)
#define EncoderState(tif) ((PixarLogState*) (tif)->tif_data)
-static int PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
-static int PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);
+static int PixarLogEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s);
+static int PixarLogDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s);
#define PIXARLOGDATAFMT_UNKNOWN -1
@@ -667,7 +667,7 @@ PixarLogSetupDecode(TIFF* tif)
TIFFDirectory *td = &tif->tif_dir;
PixarLogState* sp = DecoderState(tif);
tmsize_t tbuf_size;
- uint32 strip_height;
+ uint32_t strip_height;
assert(sp != NULL);
@@ -690,12 +690,12 @@ PixarLogSetupDecode(TIFF* tif)
sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ?
td->td_samplesperpixel : 1);
tbuf_size = multiply_ms(multiply_ms(multiply_ms(sp->stride, td->td_imagewidth),
- strip_height), sizeof(uint16));
+ strip_height), sizeof(uint16_t));
/* add one more stride in case input ends mid-stride */
- tbuf_size = add_ms(tbuf_size, sizeof(uint16) * sp->stride);
+ tbuf_size = add_ms(tbuf_size, sizeof(uint16_t) * sp->stride);
if (tbuf_size == 0)
return (0); /* TODO: this is an error return without error report through TIFFErrorExt */
- sp->tbuf = (uint16 *) _TIFFmalloc(tbuf_size);
+ sp->tbuf = (uint16_t *) _TIFFmalloc(tbuf_size);
if (sp->tbuf == NULL)
return (0);
sp->tbuf_size = tbuf_size;
@@ -706,7 +706,7 @@ PixarLogSetupDecode(TIFF* tif)
sp->tbuf = NULL;
sp->tbuf_size = 0;
TIFFErrorExt(tif->tif_clientdata, module,
- "PixarLog compression can't handle bits depth/data format combination (depth: %d)",
+ "PixarLog compression can't handle bits depth/data format combination (depth: %"PRIu16")",
td->td_bitspersample);
return (0);
}
@@ -727,7 +727,7 @@ PixarLogSetupDecode(TIFF* tif)
* Setup state for decoding a strip.
*/
static int
-PixarLogPreDecode(TIFF* tif, uint16 s)
+PixarLogPreDecode(TIFF* tif, uint16_t s)
{
static const char module[] = "PixarLogPreDecode";
PixarLogState* sp = DecoderState(tif);
@@ -749,7 +749,7 @@ PixarLogPreDecode(TIFF* tif, uint16 s)
}
static int
-PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+PixarLogDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "PixarLogDecode";
TIFFDirectory *td = &tif->tif_dir;
@@ -757,7 +757,7 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
tmsize_t i;
tmsize_t nsamples;
int llen;
- uint16 *up;
+ uint16_t *up;
switch (sp->user_datafmt) {
case PIXARLOGDATAFMT_FLOAT:
@@ -766,7 +766,7 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
case PIXARLOGDATAFMT_16BIT:
case PIXARLOGDATAFMT_12BITPICIO:
case PIXARLOGDATAFMT_11BITLOG:
- nsamples = occ / sizeof(uint16); /* XXX uint16 == 16 bits */
+ nsamples = occ / sizeof(uint16_t); /* XXX uint16_t == 16 bits */
break;
case PIXARLOGDATAFMT_8BIT:
case PIXARLOGDATAFMT_8BITABGR:
@@ -774,7 +774,7 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
break;
default:
TIFFErrorExt(tif->tif_clientdata, module,
- "%d bit input not supported in PixarLog",
+ "%"PRIu16" bit input not supported in PixarLog",
td->td_bitspersample);
return 0;
}
@@ -792,8 +792,8 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
we need to simplify this code to reflect a ZLib that is likely updated
to deal with 8byte memory sizes, though this code will respond
appropriately even before we simplify it */
- sp->stream.avail_out = (uInt) (nsamples * sizeof(uint16));
- if (sp->stream.avail_out != nsamples * sizeof(uint16))
+ sp->stream.avail_out = (uInt) (nsamples * sizeof(uint16_t));
+ if (sp->stream.avail_out != nsamples * sizeof(uint16_t))
{
TIFFErrorExt(tif->tif_clientdata, module, "ZLib cannot deal with buffers this size");
return (0);
@@ -811,8 +811,8 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
}
if (state == Z_DATA_ERROR) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Decoding error at scanline %lu, %s",
- (unsigned long) tif->tif_row, sp->stream.msg ? sp->stream.msg : "(null)");
+ "Decoding error at scanline %"PRIu32", %s",
+ tif->tif_row, sp->stream.msg ? sp->stream.msg : "(null)");
return (0);
}
if (state != Z_OK) {
@@ -825,8 +825,8 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
/* hopefully, we got all the bytes we needed */
if (sp->stream.avail_out != 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at scanline %lu (short " TIFF_UINT64_FORMAT " bytes)",
- (unsigned long) tif->tif_row, (TIFF_UINT64_T) sp->stream.avail_out);
+ "Not enough data at scanline %"PRIu32" (short %u bytes)",
+ tif->tif_row, sp->stream.avail_out);
return (0);
}
@@ -845,8 +845,8 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
*/
if (nsamples % llen) {
TIFFWarningExt(tif->tif_clientdata, module,
- "stride %lu is not a multiple of sample count, "
- "%lu, data truncated.", (unsigned long) llen, (unsigned long) nsamples);
+ "stride %d is not a multiple of sample count, "
+ "%"TIFF_SSIZE_FORMAT", data truncated.", llen, nsamples);
nsamples -= nsamples % llen;
}
@@ -859,18 +859,18 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
break;
case PIXARLOGDATAFMT_16BIT:
horizontalAccumulate16(up, llen, sp->stride,
- (uint16 *)op, sp->ToLinear16);
- op += llen * sizeof(uint16);
+ (uint16_t *)op, sp->ToLinear16);
+ op += llen * sizeof(uint16_t);
break;
case PIXARLOGDATAFMT_12BITPICIO:
horizontalAccumulate12(up, llen, sp->stride,
- (int16 *)op, sp->ToLinearF);
- op += llen * sizeof(int16);
+ (int16_t *)op, sp->ToLinearF);
+ op += llen * sizeof(int16_t);
break;
case PIXARLOGDATAFMT_11BITLOG:
horizontalAccumulate11(up, llen, sp->stride,
- (uint16 *)op);
- op += llen * sizeof(uint16);
+ (uint16_t *)op);
+ op += llen * sizeof(uint16_t);
break;
case PIXARLOGDATAFMT_8BIT:
horizontalAccumulate8(up, llen, sp->stride,
@@ -884,7 +884,7 @@ PixarLogDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
break;
default:
TIFFErrorExt(tif->tif_clientdata, module,
- "Unsupported bits/sample: %d",
+ "Unsupported bits/sample: %"PRIu16,
td->td_bitspersample);
return (0);
}
@@ -908,16 +908,16 @@ PixarLogSetupEncode(TIFF* tif)
sp->stride = (td->td_planarconfig == PLANARCONFIG_CONTIG ?
td->td_samplesperpixel : 1);
tbuf_size = multiply_ms(multiply_ms(multiply_ms(sp->stride, td->td_imagewidth),
- td->td_rowsperstrip), sizeof(uint16));
+ td->td_rowsperstrip), sizeof(uint16_t));
if (tbuf_size == 0)
return (0); /* TODO: this is an error return without error report through TIFFErrorExt */
- sp->tbuf = (uint16 *) _TIFFmalloc(tbuf_size);
+ sp->tbuf = (uint16_t *) _TIFFmalloc(tbuf_size);
if (sp->tbuf == NULL)
return (0);
if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN)
sp->user_datafmt = PixarLogGuessDataFmt(td);
if (sp->user_datafmt == PIXARLOGDATAFMT_UNKNOWN) {
- TIFFErrorExt(tif->tif_clientdata, module, "PixarLog compression can't handle %d bit linear encodings", td->td_bitspersample);
+ TIFFErrorExt(tif->tif_clientdata, module, "PixarLog compression can't handle %"PRIu16" bit linear encodings", td->td_bitspersample);
return (0);
}
@@ -934,7 +934,7 @@ PixarLogSetupEncode(TIFF* tif)
* Reset encoding state at the start of a strip.
*/
static int
-PixarLogPreEncode(TIFF* tif, uint16 s)
+PixarLogPreEncode(TIFF* tif, uint16_t s)
{
static const char module[] = "PixarLogPreEncode";
PixarLogState *sp = EncoderState(tif);
@@ -956,9 +956,9 @@ PixarLogPreEncode(TIFF* tif, uint16 s)
}
static void
-horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2)
+horizontalDifferenceF(float *ip, int n, int stride, uint16_t *wp, uint16_t *FromLT2)
{
- int32 r1, g1, b1, a1, r2, g2, b2, a2, mask;
+ int32_t r1, g1, b1, a1, r2, g2, b2, a2, mask;
float fltsize = Fltsize;
#define CLAMP(v) ( (v<(float)0.) ? 0 \
@@ -969,39 +969,39 @@ horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2)
mask = CODE_MASK;
if (n >= stride) {
if (stride == 3) {
- r2 = wp[0] = (uint16) CLAMP(ip[0]);
- g2 = wp[1] = (uint16) CLAMP(ip[1]);
- b2 = wp[2] = (uint16) CLAMP(ip[2]);
+ r2 = wp[0] = (uint16_t) CLAMP(ip[0]);
+ g2 = wp[1] = (uint16_t) CLAMP(ip[1]);
+ b2 = wp[2] = (uint16_t) CLAMP(ip[2]);
n -= 3;
while (n > 0) {
n -= 3;
wp += 3;
ip += 3;
- r1 = (int32) CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1;
- g1 = (int32) CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1;
- b1 = (int32) CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1;
+ r1 = (int32_t) CLAMP(ip[0]); wp[0] = (uint16_t)((r1 - r2) & mask); r2 = r1;
+ g1 = (int32_t) CLAMP(ip[1]); wp[1] = (uint16_t)((g1 - g2) & mask); g2 = g1;
+ b1 = (int32_t) CLAMP(ip[2]); wp[2] = (uint16_t)((b1 - b2) & mask); b2 = b1;
}
} else if (stride == 4) {
- r2 = wp[0] = (uint16) CLAMP(ip[0]);
- g2 = wp[1] = (uint16) CLAMP(ip[1]);
- b2 = wp[2] = (uint16) CLAMP(ip[2]);
- a2 = wp[3] = (uint16) CLAMP(ip[3]);
+ r2 = wp[0] = (uint16_t) CLAMP(ip[0]);
+ g2 = wp[1] = (uint16_t) CLAMP(ip[1]);
+ b2 = wp[2] = (uint16_t) CLAMP(ip[2]);
+ a2 = wp[3] = (uint16_t) CLAMP(ip[3]);
n -= 4;
while (n > 0) {
n -= 4;
wp += 4;
ip += 4;
- r1 = (int32) CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1;
- g1 = (int32) CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1;
- b1 = (int32) CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1;
- a1 = (int32) CLAMP(ip[3]); wp[3] = (uint16)((a1-a2) & mask); a2 = a1;
+ r1 = (int32_t) CLAMP(ip[0]); wp[0] = (uint16_t)((r1 - r2) & mask); r2 = r1;
+ g1 = (int32_t) CLAMP(ip[1]); wp[1] = (uint16_t)((g1 - g2) & mask); g2 = g1;
+ b1 = (int32_t) CLAMP(ip[2]); wp[2] = (uint16_t)((b1 - b2) & mask); b2 = b1;
+ a1 = (int32_t) CLAMP(ip[3]); wp[3] = (uint16_t)((a1 - a2) & mask); a2 = a1;
}
} else {
- REPEAT(stride, wp[0] = (uint16) CLAMP(ip[0]); wp++; ip++)
+ REPEAT(stride, wp[0] = (uint16_t) CLAMP(ip[0]); wp++; ip++)
n -= stride;
while (n > 0) {
REPEAT(stride,
- wp[0] = (uint16)(((int32)CLAMP(ip[0])-(int32)CLAMP(ip[-stride])) & mask);
+ wp[0] = (uint16_t)(((int32_t)CLAMP(ip[0]) - (int32_t)CLAMP(ip[-stride])) & mask);
wp++; ip++)
n -= stride;
}
@@ -1010,8 +1010,8 @@ horizontalDifferenceF(float *ip, int n, int stride, uint16 *wp, uint16 *FromLT2)
}
static void
-horizontalDifference16(unsigned short *ip, int n, int stride,
- unsigned short *wp, uint16 *From14)
+horizontalDifference16(unsigned short *ip, int n, int stride,
+ unsigned short *wp, uint16_t *From14)
{
register int r1, g1, b1, a1, r2, g2, b2, a2, mask;
@@ -1029,9 +1029,9 @@ horizontalDifference16(unsigned short *ip, int n, int stride,
n -= 3;
wp += 3;
ip += 3;
- r1 = CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1;
- g1 = CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1;
- b1 = CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1;
+ r1 = CLAMP(ip[0]); wp[0] = (uint16_t)((r1 - r2) & mask); r2 = r1;
+ g1 = CLAMP(ip[1]); wp[1] = (uint16_t)((g1 - g2) & mask); g2 = g1;
+ b1 = CLAMP(ip[2]); wp[2] = (uint16_t)((b1 - b2) & mask); b2 = b1;
}
} else if (stride == 4) {
r2 = wp[0] = CLAMP(ip[0]); g2 = wp[1] = CLAMP(ip[1]);
@@ -1041,17 +1041,17 @@ horizontalDifference16(unsigned short *ip, int n, int stride,
n -= 4;
wp += 4;
ip += 4;
- r1 = CLAMP(ip[0]); wp[0] = (uint16)((r1-r2) & mask); r2 = r1;
- g1 = CLAMP(ip[1]); wp[1] = (uint16)((g1-g2) & mask); g2 = g1;
- b1 = CLAMP(ip[2]); wp[2] = (uint16)((b1-b2) & mask); b2 = b1;
- a1 = CLAMP(ip[3]); wp[3] = (uint16)((a1-a2) & mask); a2 = a1;
+ r1 = CLAMP(ip[0]); wp[0] = (uint16_t)((r1 - r2) & mask); r2 = r1;
+ g1 = CLAMP(ip[1]); wp[1] = (uint16_t)((g1 - g2) & mask); g2 = g1;
+ b1 = CLAMP(ip[2]); wp[2] = (uint16_t)((b1 - b2) & mask); b2 = b1;
+ a1 = CLAMP(ip[3]); wp[3] = (uint16_t)((a1 - a2) & mask); a2 = a1;
}
} else {
REPEAT(stride, wp[0] = CLAMP(ip[0]); wp++; ip++)
n -= stride;
while (n > 0) {
REPEAT(stride,
- wp[0] = (uint16)((CLAMP(ip[0])-CLAMP(ip[-stride])) & mask);
+ wp[0] = (uint16_t)((CLAMP(ip[0]) - CLAMP(ip[-stride])) & mask);
wp++; ip++)
n -= stride;
}
@@ -1061,8 +1061,8 @@ horizontalDifference16(unsigned short *ip, int n, int stride,
static void
-horizontalDifference8(unsigned char *ip, int n, int stride,
- unsigned short *wp, uint16 *From8)
+horizontalDifference8(unsigned char *ip, int n, int stride,
+ unsigned short *wp, uint16_t *From8)
{
register int r1, g1, b1, a1, r2, g2, b2, a2, mask;
@@ -1077,9 +1077,9 @@ horizontalDifference8(unsigned char *ip, int n, int stride,
n -= 3;
while (n > 0) {
n -= 3;
- r1 = CLAMP(ip[3]); wp[3] = (uint16)((r1-r2) & mask); r2 = r1;
- g1 = CLAMP(ip[4]); wp[4] = (uint16)((g1-g2) & mask); g2 = g1;
- b1 = CLAMP(ip[5]); wp[5] = (uint16)((b1-b2) & mask); b2 = b1;
+ r1 = CLAMP(ip[3]); wp[3] = (uint16_t)((r1 - r2) & mask); r2 = r1;
+ g1 = CLAMP(ip[4]); wp[4] = (uint16_t)((g1 - g2) & mask); g2 = g1;
+ b1 = CLAMP(ip[5]); wp[5] = (uint16_t)((b1 - b2) & mask); b2 = b1;
wp += 3;
ip += 3;
}
@@ -1089,10 +1089,10 @@ horizontalDifference8(unsigned char *ip, int n, int stride,
n -= 4;
while (n > 0) {
n -= 4;
- r1 = CLAMP(ip[4]); wp[4] = (uint16)((r1-r2) & mask); r2 = r1;
- g1 = CLAMP(ip[5]); wp[5] = (uint16)((g1-g2) & mask); g2 = g1;
- b1 = CLAMP(ip[6]); wp[6] = (uint16)((b1-b2) & mask); b2 = b1;
- a1 = CLAMP(ip[7]); wp[7] = (uint16)((a1-a2) & mask); a2 = a1;
+ r1 = CLAMP(ip[4]); wp[4] = (uint16_t)((r1 - r2) & mask); r2 = r1;
+ g1 = CLAMP(ip[5]); wp[5] = (uint16_t)((g1 - g2) & mask); g2 = g1;
+ b1 = CLAMP(ip[6]); wp[6] = (uint16_t)((b1 - b2) & mask); b2 = b1;
+ a1 = CLAMP(ip[7]); wp[7] = (uint16_t)((a1 - a2) & mask); a2 = a1;
wp += 4;
ip += 4;
}
@@ -1101,7 +1101,7 @@ horizontalDifference8(unsigned char *ip, int n, int stride,
n -= stride;
while (n > 0) {
REPEAT(stride,
- wp[0] = (uint16)((CLAMP(ip[0])-CLAMP(ip[-stride])) & mask);
+ wp[0] = (uint16_t)((CLAMP(ip[0]) - CLAMP(ip[-stride])) & mask);
wp++; ip++)
n -= stride;
}
@@ -1113,7 +1113,7 @@ horizontalDifference8(unsigned char *ip, int n, int stride,
* Encode a chunk of pixels.
*/
static int
-PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+PixarLogEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "PixarLogEncode";
TIFFDirectory *td = &tif->tif_dir;
@@ -1132,7 +1132,7 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
case PIXARLOGDATAFMT_16BIT:
case PIXARLOGDATAFMT_12BITPICIO:
case PIXARLOGDATAFMT_11BITLOG:
- n = cc / sizeof(uint16); /* XXX uint16 == 16 bits */
+ n = cc / sizeof(uint16_t); /* XXX uint16_t == 16 bits */
break;
case PIXARLOGDATAFMT_8BIT:
case PIXARLOGDATAFMT_8BITABGR:
@@ -1140,13 +1140,13 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
break;
default:
TIFFErrorExt(tif->tif_clientdata, module,
- "%d bit input not supported in PixarLog",
+ "%"PRIu16" bit input not supported in PixarLog",
td->td_bitspersample);
return 0;
}
llen = sp->stride * td->td_imagewidth;
- /* Check against the number of elements (of size uint16) of sp->tbuf */
+ /* Check against the number of elements (of size uint16_t) of sp->tbuf */
if( n > ((tmsize_t)td->td_rowsperstrip * llen) )
{
TIFFErrorExt(tif->tif_clientdata, module,
@@ -1162,9 +1162,9 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
bp += llen * sizeof(float);
break;
case PIXARLOGDATAFMT_16BIT:
- horizontalDifference16((uint16 *)bp, llen,
- sp->stride, up, sp->From14);
- bp += llen * sizeof(uint16);
+ horizontalDifference16((uint16_t *)bp, llen,
+ sp->stride, up, sp->From14);
+ bp += llen * sizeof(uint16_t);
break;
case PIXARLOGDATAFMT_8BIT:
horizontalDifference8((unsigned char *)bp, llen,
@@ -1173,7 +1173,7 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
break;
default:
TIFFErrorExt(tif->tif_clientdata, module,
- "%d bit input not supported in PixarLog",
+ "%"PRIu16" bit input not supported in PixarLog",
td->td_bitspersample);
return 0;
}
@@ -1184,8 +1184,8 @@ PixarLogEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
we need to simplify this code to reflect a ZLib that is likely updated
to deal with 8byte memory sizes, though this code will respond
appropriately even before we simplify it */
- sp->stream.avail_in = (uInt) (n * sizeof(uint16));
- if ((sp->stream.avail_in / sizeof(uint16)) != (uInt) n)
+ sp->stream.avail_in = (uInt) (n * sizeof(uint16_t));
+ if ((sp->stream.avail_in / sizeof(uint16_t)) != (uInt) n)
{
TIFFErrorExt(tif->tif_clientdata, module,
"ZLib cannot deal with buffers this size");
@@ -1309,7 +1309,7 @@ PixarLogCleanup(TIFF* tif)
}
static int
-PixarLogVSetField(TIFF* tif, uint32 tag, va_list ap)
+PixarLogVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
static const char module[] = "PixarLogVSetField";
PixarLogState *sp = (PixarLogState *)tif->tif_data;
@@ -1371,7 +1371,7 @@ PixarLogVSetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-PixarLogVGetField(TIFF* tif, uint32 tag, va_list ap)
+PixarLogVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
PixarLogState *sp = (PixarLogState *)tif->tif_data;
@@ -1416,7 +1416,7 @@ TIFFInitPixarLog(TIFF* tif, int scheme)
/*
* Allocate state block so tag methods have storage to record values.
*/
- tif->tif_data = (uint8*) _TIFFmalloc(sizeof (PixarLogState));
+ tif->tif_data = (uint8_t*) _TIFFmalloc(sizeof (PixarLogState));
if (tif->tif_data == NULL)
goto bad;
sp = (PixarLogState*) tif->tif_data;
diff --git a/tiff/libtiff/tif_predict.c b/tiff/libtiff/tif_predict.c
index c0233974..4aa4af69 100644
--- a/tiff/libtiff/tif_predict.c
+++ b/tiff/libtiff/tif_predict.c
@@ -32,22 +32,22 @@
#define PredictorState(tif) ((TIFFPredictorState*) (tif)->tif_data)
-static int horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int horAcc32(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int swabHorAcc16(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int swabHorAcc32(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int swabHorDiff16(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int swabHorDiff32(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc);
-static int PredictorDecodeRow(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s);
-static int PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s);
-static int PredictorEncodeRow(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
-static int PredictorEncodeTile(TIFF* tif, uint8* bp0, tmsize_t cc0, uint16 s);
+static int horAcc8(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int horAcc16(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int horAcc32(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int swabHorAcc16(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int swabHorAcc32(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int horDiff8(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int horDiff16(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int horDiff32(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int swabHorDiff16(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int swabHorDiff32(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int fpAcc(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int fpDiff(TIFF* tif, uint8_t* cp0, tmsize_t cc);
+static int PredictorDecodeRow(TIFF* tif, uint8_t* op0, tmsize_t occ0, uint16_t s);
+static int PredictorDecodeTile(TIFF* tif, uint8_t* op0, tmsize_t occ0, uint16_t s);
+static int PredictorEncodeRow(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s);
+static int PredictorEncodeTile(TIFF* tif, uint8_t* bp0, tmsize_t cc0, uint16_t s);
static int
PredictorSetup(TIFF* tif)
@@ -66,7 +66,7 @@ PredictorSetup(TIFF* tif)
&& td->td_bitspersample != 16
&& td->td_bitspersample != 32) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Horizontal differencing \"Predictor\" not supported with %d-bit samples",
+ "Horizontal differencing \"Predictor\" not supported with %"PRIu16"-bit samples",
td->td_bitspersample);
return 0;
}
@@ -74,7 +74,7 @@ PredictorSetup(TIFF* tif)
case PREDICTOR_FLOATINGPOINT:
if (td->td_sampleformat != SAMPLEFORMAT_IEEEFP) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Floating point \"Predictor\" not supported with %d data format",
+ "Floating point \"Predictor\" not supported with %"PRIu16" data format",
td->td_sampleformat);
return 0;
}
@@ -83,7 +83,7 @@ PredictorSetup(TIFF* tif)
&& td->td_bitspersample != 32
&& td->td_bitspersample != 64) { /* Should 64 be allowed? */
TIFFErrorExt(tif->tif_clientdata, module,
- "Floating point \"Predictor\" not supported with %d-bit samples",
+ "Floating point \"Predictor\" not supported with %"PRIu16"-bit samples",
td->td_bitspersample);
return 0;
}
@@ -277,7 +277,7 @@ PredictorSetupEncode(TIFF* tif)
TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
static int
-horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc)
+horAcc8(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
@@ -334,9 +334,9 @@ horAcc8(TIFF* tif, uint8* cp0, tmsize_t cc)
}
static int
-swabHorAcc16(TIFF* tif, uint8* cp0, tmsize_t cc)
+swabHorAcc16(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
- uint16* wp = (uint16*) cp0;
+ uint16_t* wp = (uint16_t*) cp0;
tmsize_t wc = cc / 2;
TIFFSwabArrayOfShort(wp, wc);
@@ -345,10 +345,10 @@ swabHorAcc16(TIFF* tif, uint8* cp0, tmsize_t cc)
TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
static int
-horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc)
+horAcc16(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
- uint16* wp = (uint16*) cp0;
+ uint16_t* wp = (uint16_t*) cp0;
tmsize_t wc = cc / 2;
if((cc%(2*stride))!=0)
@@ -361,7 +361,7 @@ horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc)
if (wc > stride) {
wc -= stride;
do {
- REPEAT4(stride, wp[stride] = (uint16)(((unsigned int)wp[stride] + (unsigned int)wp[0]) & 0xffff); wp++)
+ REPEAT4(stride, wp[stride] = (uint16_t)(((unsigned int)wp[stride] + (unsigned int)wp[0]) & 0xffff); wp++)
wc -= stride;
} while (wc > 0);
}
@@ -369,9 +369,9 @@ horAcc16(TIFF* tif, uint8* cp0, tmsize_t cc)
}
static int
-swabHorAcc32(TIFF* tif, uint8* cp0, tmsize_t cc)
+swabHorAcc32(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
- uint32* wp = (uint32*) cp0;
+ uint32_t* wp = (uint32_t*) cp0;
tmsize_t wc = cc / 4;
TIFFSwabArrayOfLong(wp, wc);
@@ -380,10 +380,10 @@ swabHorAcc32(TIFF* tif, uint8* cp0, tmsize_t cc)
TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
static int
-horAcc32(TIFF* tif, uint8* cp0, tmsize_t cc)
+horAcc32(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
- uint32* wp = (uint32*) cp0;
+ uint32_t* wp = (uint32_t*) cp0;
tmsize_t wc = cc / 4;
if((cc%(4*stride))!=0)
@@ -407,14 +407,14 @@ horAcc32(TIFF* tif, uint8* cp0, tmsize_t cc)
* Floating point predictor accumulation routine.
*/
static int
-fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc)
+fpAcc(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
- uint32 bps = tif->tif_dir.td_bitspersample / 8;
+ uint32_t bps = tif->tif_dir.td_bitspersample / 8;
tmsize_t wc = cc / bps;
tmsize_t count = cc;
- uint8 *cp = (uint8 *) cp0;
- uint8 *tmp;
+ uint8_t *cp = (uint8_t *) cp0;
+ uint8_t *tmp;
if(cc%(bps*stride)!=0)
{
@@ -423,7 +423,7 @@ fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc)
return 0;
}
- tmp = (uint8 *)_TIFFmalloc(cc);
+ tmp = (uint8_t *)_TIFFmalloc(cc);
if (!tmp)
return 0;
@@ -434,9 +434,9 @@ fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc)
}
_TIFFmemcpy(tmp, cp0, cc);
- cp = (uint8 *) cp0;
+ cp = (uint8_t *) cp0;
for (count = 0; count < wc; count++) {
- uint32 byte;
+ uint32_t byte;
for (byte = 0; byte < bps; byte++) {
#if WORDS_BIGENDIAN
cp[bps * count + byte] = tmp[byte * wc + count];
@@ -454,7 +454,7 @@ fpAcc(TIFF* tif, uint8* cp0, tmsize_t cc)
* Decode a scanline and apply the predictor routine.
*/
static int
-PredictorDecodeRow(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
+PredictorDecodeRow(TIFF* tif, uint8_t* op0, tmsize_t occ0, uint16_t s)
{
TIFFPredictorState *sp = PredictorState(tif);
@@ -476,7 +476,7 @@ PredictorDecodeRow(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
* strip/tile dimensions.
*/
static int
-PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
+PredictorDecodeTile(TIFF* tif, uint8_t* op0, tmsize_t occ0, uint16_t s)
{
TIFFPredictorState *sp = PredictorState(tif);
@@ -506,7 +506,7 @@ PredictorDecodeTile(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
static int
-horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc)
+horDiff8(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
TIFFPredictorState* sp = PredictorState(tif);
tmsize_t stride = sp->stride;
@@ -560,11 +560,11 @@ horDiff8(TIFF* tif, uint8* cp0, tmsize_t cc)
TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
static int
-horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
+horDiff16(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
TIFFPredictorState* sp = PredictorState(tif);
tmsize_t stride = sp->stride;
- uint16 *wp = (uint16*) cp0;
+ uint16_t *wp = (uint16_t*) cp0;
tmsize_t wc = cc/2;
if((cc%(2*stride))!=0)
@@ -578,7 +578,7 @@ horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
wc -= stride;
wp += wc - 1;
do {
- REPEAT4(stride, wp[stride] = (uint16)(((unsigned int)wp[stride] - (unsigned int)wp[0]) & 0xffff); wp--)
+ REPEAT4(stride, wp[stride] = (uint16_t)(((unsigned int)wp[stride] - (unsigned int)wp[0]) & 0xffff); wp--)
wc -= stride;
} while (wc > 0);
}
@@ -586,9 +586,9 @@ horDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
}
static int
-swabHorDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
+swabHorDiff16(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
- uint16* wp = (uint16*) cp0;
+ uint16_t* wp = (uint16_t*) cp0;
tmsize_t wc = cc / 2;
if( !horDiff16(tif, cp0, cc) )
@@ -600,11 +600,11 @@ swabHorDiff16(TIFF* tif, uint8* cp0, tmsize_t cc)
TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
static int
-horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
+horDiff32(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
TIFFPredictorState* sp = PredictorState(tif);
tmsize_t stride = sp->stride;
- uint32 *wp = (uint32*) cp0;
+ uint32_t *wp = (uint32_t*) cp0;
tmsize_t wc = cc/4;
if((cc%(4*stride))!=0)
@@ -626,9 +626,9 @@ horDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
}
static int
-swabHorDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
+swabHorDiff32(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
- uint32* wp = (uint32*) cp0;
+ uint32_t* wp = (uint32_t*) cp0;
tmsize_t wc = cc / 4;
if( !horDiff32(tif, cp0, cc) )
@@ -643,14 +643,14 @@ swabHorDiff32(TIFF* tif, uint8* cp0, tmsize_t cc)
*/
TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
static int
-fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
+fpDiff(TIFF* tif, uint8_t* cp0, tmsize_t cc)
{
tmsize_t stride = PredictorState(tif)->stride;
- uint32 bps = tif->tif_dir.td_bitspersample / 8;
+ uint32_t bps = tif->tif_dir.td_bitspersample / 8;
tmsize_t wc = cc / bps;
tmsize_t count;
- uint8 *cp = (uint8 *) cp0;
- uint8 *tmp;
+ uint8_t *cp = (uint8_t *) cp0;
+ uint8_t *tmp;
if((cc%(bps*stride))!=0)
{
@@ -659,13 +659,13 @@ fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
return 0;
}
- tmp = (uint8 *)_TIFFmalloc(cc);
+ tmp = (uint8_t *)_TIFFmalloc(cc);
if (!tmp)
return 0;
_TIFFmemcpy(tmp, cp0, cc);
for (count = 0; count < wc; count++) {
- uint32 byte;
+ uint32_t byte;
for (byte = 0; byte < bps; byte++) {
#if WORDS_BIGENDIAN
cp[byte * wc + count] = tmp[bps * count + byte];
@@ -677,7 +677,7 @@ fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
}
_TIFFfree(tmp);
- cp = (uint8 *) cp0;
+ cp = (uint8_t *) cp0;
cp += cc - stride - 1;
for (count = cc; count > stride; count -= stride)
REPEAT4(stride, cp[stride] = (unsigned char)((cp[stride] - cp[0])&0xff); cp--)
@@ -685,7 +685,7 @@ fpDiff(TIFF* tif, uint8* cp0, tmsize_t cc)
}
static int
-PredictorEncodeRow(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+PredictorEncodeRow(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
TIFFPredictorState *sp = PredictorState(tif);
@@ -700,11 +700,11 @@ PredictorEncodeRow(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
}
static int
-PredictorEncodeTile(TIFF* tif, uint8* bp0, tmsize_t cc0, uint16 s)
+PredictorEncodeTile(TIFF* tif, uint8_t* bp0, tmsize_t cc0, uint16_t s)
{
static const char module[] = "PredictorEncodeTile";
TIFFPredictorState *sp = PredictorState(tif);
- uint8 *working_copy;
+ uint8_t *working_copy;
tmsize_t cc = cc0, rowsize;
unsigned char* bp;
int result_code;
@@ -717,12 +717,12 @@ PredictorEncodeTile(TIFF* tif, uint8* bp0, tmsize_t cc0, uint16 s)
* Do predictor manipulation in a working buffer to avoid altering
* the callers buffer. http://trac.osgeo.org/gdal/ticket/1965
*/
- working_copy = (uint8*) _TIFFmalloc(cc0);
+ working_copy = (uint8_t*) _TIFFmalloc(cc0);
if( working_copy == NULL )
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Out of memory allocating " TIFF_SSIZE_FORMAT " byte temp buffer.",
- cc0 );
+ "Out of memory allocating %" PRId64 " byte temp buffer.",
+ (int64_t) cc0 );
return 0;
}
memcpy( working_copy, bp0, cc0 );
@@ -756,7 +756,7 @@ static const TIFFField predictFields[] = {
};
static int
-PredictorVSetField(TIFF* tif, uint32 tag, va_list ap)
+PredictorVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
TIFFPredictorState *sp = PredictorState(tif);
@@ -765,7 +765,7 @@ PredictorVSetField(TIFF* tif, uint32 tag, va_list ap)
switch (tag) {
case TIFFTAG_PREDICTOR:
- sp->predictor = (uint16) va_arg(ap, uint16_vap);
+ sp->predictor = (uint16_t) va_arg(ap, uint16_vap);
TIFFSetFieldBit(tif, FIELD_PREDICTOR);
break;
default:
@@ -776,7 +776,7 @@ PredictorVSetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-PredictorVGetField(TIFF* tif, uint32 tag, va_list ap)
+PredictorVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
TIFFPredictorState *sp = PredictorState(tif);
@@ -785,7 +785,7 @@ PredictorVGetField(TIFF* tif, uint32 tag, va_list ap)
switch (tag) {
case TIFFTAG_PREDICTOR:
- *va_arg(ap, uint16*) = (uint16)sp->predictor;
+ *va_arg(ap, uint16_t*) = (uint16_t)sp->predictor;
break;
default:
return (*sp->vgetparent)(tif, tag, ap);
diff --git a/tiff/libtiff/tif_predict.h b/tiff/libtiff/tif_predict.h
index a326b9b8..597faa16 100644
--- a/tiff/libtiff/tif_predict.h
+++ b/tiff/libtiff/tif_predict.h
@@ -32,7 +32,7 @@
* ``Library-private'' Support for the Predictor Tag
*/
-typedef int (*TIFFEncodeDecodeMethod)(TIFF* tif, uint8* buf, tmsize_t size);
+typedef int (*TIFFEncodeDecodeMethod)(TIFF* tif, uint8_t* buf, tmsize_t size);
/*
* Codecs that want to support the Predictor tag must place
diff --git a/tiff/libtiff/tif_print.c b/tiff/libtiff/tif_print.c
index a0737941..347dbdaf 100644
--- a/tiff/libtiff/tif_print.c
+++ b/tiff/libtiff/tif_print.c
@@ -65,62 +65,43 @@ static const char * const orientNames[] = {
static void
_TIFFPrintField(FILE* fd, const TIFFField *fip,
- uint32 value_count, void *raw_data)
+ uint32_t value_count, void *raw_data)
{
- uint32 j;
+ uint32_t j;
fprintf(fd, " %s: ", fip->field_name);
for(j = 0; j < value_count; j++) {
if(fip->field_type == TIFF_BYTE)
- fprintf(fd, "%u", ((uint8 *) raw_data)[j]);
+ fprintf(fd, "%"PRIu8, ((uint8_t *) raw_data)[j]);
else if(fip->field_type == TIFF_UNDEFINED)
- fprintf(fd, "0x%x",
- (unsigned int) ((unsigned char *) raw_data)[j]);
+ fprintf(fd, "0x%"PRIx8, ((uint8_t *) raw_data)[j]);
else if(fip->field_type == TIFF_SBYTE)
- fprintf(fd, "%d", ((int8 *) raw_data)[j]);
+ fprintf(fd, "%"PRId8, ((int8_t *) raw_data)[j]);
else if(fip->field_type == TIFF_SHORT)
- fprintf(fd, "%u", ((uint16 *) raw_data)[j]);
+ fprintf(fd, "%"PRIu16, ((uint16_t *) raw_data)[j]);
else if(fip->field_type == TIFF_SSHORT)
- fprintf(fd, "%d", ((int16 *) raw_data)[j]);
+ fprintf(fd, "%"PRId16, ((int16_t *) raw_data)[j]);
else if(fip->field_type == TIFF_LONG)
- fprintf(fd, "%lu",
- (unsigned long)((uint32 *) raw_data)[j]);
+ fprintf(fd, "%"PRIu32, ((uint32_t *) raw_data)[j]);
else if(fip->field_type == TIFF_SLONG)
- fprintf(fd, "%ld", (long)((int32 *) raw_data)[j]);
+ fprintf(fd, "%"PRId32, ((int32_t *) raw_data)[j]);
else if(fip->field_type == TIFF_IFD)
- fprintf(fd, "0x%lx",
- (unsigned long)((uint32 *) raw_data)[j]);
+ fprintf(fd, "0x%"PRIx32, ((uint32_t *) raw_data)[j]);
else if(fip->field_type == TIFF_RATIONAL
|| fip->field_type == TIFF_SRATIONAL
|| fip->field_type == TIFF_FLOAT)
fprintf(fd, "%f", ((float *) raw_data)[j]);
else if(fip->field_type == TIFF_LONG8)
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- fprintf(fd, "%I64u",
- (unsigned __int64)((uint64 *) raw_data)[j]);
-#else
- fprintf(fd, "%llu",
- (unsigned long long)((uint64 *) raw_data)[j]);
-#endif
+ fprintf(fd, "%"PRIu64, ((uint64_t *) raw_data)[j]);
else if(fip->field_type == TIFF_SLONG8)
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- fprintf(fd, "%I64d", (__int64)((int64 *) raw_data)[j]);
-#else
- fprintf(fd, "%lld", (long long)((int64 *) raw_data)[j]);
-#endif
+ fprintf(fd, "%"PRId64, ((int64_t *) raw_data)[j]);
else if(fip->field_type == TIFF_IFD8)
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- fprintf(fd, "0x%I64x",
- (unsigned __int64)((uint64 *) raw_data)[j]);
-#else
- fprintf(fd, "0x%llx",
- (unsigned long long)((uint64 *) raw_data)[j]);
-#endif
+ fprintf(fd, "0x%"PRIx64, ((uint64_t *) raw_data)[j]);
else if(fip->field_type == TIFF_FLOAT)
fprintf(fd, "%f", ((float *)raw_data)[j]);
else if(fip->field_type == TIFF_DOUBLE)
- fprintf(fd, "%f", ((double *) raw_data)[j]);
+ fprintf(fd, "%lf", ((double *) raw_data)[j]);
else if(fip->field_type == TIFF_ASCII) {
fprintf(fd, "%s", (char *) raw_data);
break;
@@ -138,8 +119,8 @@ _TIFFPrintField(FILE* fd, const TIFFField *fip,
}
static int
-_TIFFPrettyPrintField(TIFF* tif, const TIFFField *fip, FILE* fd, uint32 tag,
- uint32 value_count, void *raw_data)
+_TIFFPrettyPrintField(TIFF* tif, const TIFFField *fip, FILE* fd, uint32_t tag,
+ uint32_t value_count, void *raw_data)
{
(void) tif;
@@ -153,14 +134,14 @@ _TIFFPrettyPrintField(TIFF* tif, const TIFFField *fip, FILE* fd, uint32 tag,
case TIFFTAG_INKSET:
if (value_count == 2 && fip->field_type == TIFF_SHORT) {
fprintf(fd, " Ink Set: ");
- switch (*((uint16*)raw_data)) {
+ switch (*((uint16_t*)raw_data)) {
case INKSET_CMYK:
fprintf(fd, "CMYK\n");
break;
default:
- fprintf(fd, "%u (0x%x)\n",
- *((uint16*)raw_data),
- *((uint16*)raw_data));
+ fprintf(fd, "%"PRIu16" (0x%"PRIx16")\n",
+ *((uint16_t*)raw_data),
+ *((uint16_t*)raw_data));
break;
}
return 1;
@@ -169,8 +150,8 @@ _TIFFPrettyPrintField(TIFF* tif, const TIFFField *fip, FILE* fd, uint32 tag,
case TIFFTAG_DOTRANGE:
if (value_count == 2 && fip->field_type == TIFF_SHORT) {
- fprintf(fd, " Dot Range: %u-%u\n",
- ((uint16*)raw_data)[0], ((uint16*)raw_data)[1]);
+ fprintf(fd, " Dot Range: %"PRIu16"-%"PRIu16"\n",
+ ((uint16_t*)raw_data)[0], ((uint16_t*)raw_data)[1]);
return 1;
}
return 0;
@@ -185,7 +166,7 @@ _TIFFPrettyPrintField(TIFF* tif, const TIFFField *fip, FILE* fd, uint32 tag,
case TIFFTAG_XMLPACKET:
{
- uint32 i;
+ uint32_t i;
fprintf(fd, " XMLPacket (XMP Metadata):\n" );
for(i = 0; i < value_count; i++)
@@ -199,18 +180,18 @@ _TIFFPrettyPrintField(TIFF* tif, const TIFFField *fip, FILE* fd, uint32 tag,
* defined as array of LONG values.
*/
fprintf(fd,
- " RichTIFFIPTC Data: <present>, %lu bytes\n",
- (unsigned long) value_count * 4);
+ " RichTIFFIPTC Data: <present>, %"PRIu32" bytes\n",
+ value_count * 4u);
return 1;
case TIFFTAG_PHOTOSHOP:
- fprintf(fd, " Photoshop Data: <present>, %lu bytes\n",
- (unsigned long) value_count);
+ fprintf(fd, " Photoshop Data: <present>, %"PRIu32" bytes\n",
+ value_count);
return 1;
case TIFFTAG_ICCPROFILE:
- fprintf(fd, " ICC Profile: <present>, %lu bytes\n",
- (unsigned long) value_count);
+ fprintf(fd, " ICC Profile: <present>, %"PRIu32" bytes\n",
+ value_count);
return 1;
case TIFFTAG_STONITS:
@@ -237,15 +218,9 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
char *sep;
long l, n;
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- fprintf(fd, "TIFF Directory at offset 0x%I64x (%I64u)\n",
- (unsigned __int64) tif->tif_diroff,
- (unsigned __int64) tif->tif_diroff);
-#else
- fprintf(fd, "TIFF Directory at offset 0x%llx (%llu)\n",
- (unsigned long long) tif->tif_diroff,
- (unsigned long long) tif->tif_diroff);
-#endif
+ fprintf(fd, "TIFF Directory at offset 0x%"PRIu64" (%"PRIx64")\n",
+ tif->tif_diroff,
+ tif->tif_diroff);
if (TIFFFieldSet(tif,FIELD_SUBFILETYPE)) {
fprintf(fd, " Subfile Type:");
sep = " ";
@@ -259,23 +234,23 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
}
if (td->td_subfiletype & FILETYPE_MASK)
fprintf(fd, "%stransparency mask", sep);
- fprintf(fd, " (%lu = 0x%lx)\n",
- (unsigned long) td->td_subfiletype, (long) td->td_subfiletype);
+ fprintf(fd, " (%"PRIu32" = 0x%"PRIx32")\n",
+ td->td_subfiletype, td->td_subfiletype);
}
if (TIFFFieldSet(tif,FIELD_IMAGEDIMENSIONS)) {
- fprintf(fd, " Image Width: %lu Image Length: %lu",
- (unsigned long) td->td_imagewidth, (unsigned long) td->td_imagelength);
+ fprintf(fd, " Image Width: %"PRIu32" Image Length: %"PRIu32,
+ td->td_imagewidth, td->td_imagelength);
if (TIFFFieldSet(tif,FIELD_IMAGEDEPTH))
- fprintf(fd, " Image Depth: %lu",
- (unsigned long) td->td_imagedepth);
+ fprintf(fd, " Image Depth: %"PRIu32,
+ td->td_imagedepth);
fprintf(fd, "\n");
}
if (TIFFFieldSet(tif,FIELD_TILEDIMENSIONS)) {
- fprintf(fd, " Tile Width: %lu Tile Length: %lu",
- (unsigned long) td->td_tilewidth, (unsigned long) td->td_tilelength);
+ fprintf(fd, " Tile Width: %"PRIu32" Tile Length: %"PRIu32,
+ td->td_tilewidth, td->td_tilelength);
if (TIFFFieldSet(tif,FIELD_TILEDEPTH))
- fprintf(fd, " Tile Depth: %lu",
- (unsigned long) td->td_tiledepth);
+ fprintf(fd, " Tile Depth: %"PRIu32,
+ td->td_tiledepth);
fprintf(fd, "\n");
}
if (TIFFFieldSet(tif,FIELD_RESOLUTION)) {
@@ -293,7 +268,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, " pixels/cm");
break;
default:
- fprintf(fd, " (unit %u = 0x%x)",
+ fprintf(fd, " (unit %"PRIu16" = 0x%"PRIx16")",
td->td_resolutionunit,
td->td_resolutionunit);
break;
@@ -305,7 +280,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, " Position: %g, %g\n",
td->td_xposition, td->td_yposition);
if (TIFFFieldSet(tif,FIELD_BITSPERSAMPLE))
- fprintf(fd, " Bits/Sample: %u\n", td->td_bitspersample);
+ fprintf(fd, " Bits/Sample: %"PRIu16"\n", td->td_bitspersample);
if (TIFFFieldSet(tif,FIELD_SAMPLEFORMAT)) {
fprintf(fd, " Sample Format: ");
switch (td->td_sampleformat) {
@@ -328,7 +303,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "complex IEEE floating point\n");
break;
default:
- fprintf(fd, "%u (0x%x)\n",
+ fprintf(fd, "%"PRIu16" (0x%"PRIx16")\n",
td->td_sampleformat, td->td_sampleformat);
break;
}
@@ -339,7 +314,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
if (c)
fprintf(fd, "%s\n", c->name);
else
- fprintf(fd, "%u (0x%x)\n",
+ fprintf(fd, "%"PRIu16" (0x%"PRIx16")\n",
td->td_compression, td->td_compression);
}
if (TIFFFieldSet(tif,FIELD_PHOTOMETRIC)) {
@@ -355,15 +330,15 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "CIE Log2(L) (u',v')\n");
break;
default:
- fprintf(fd, "%u (0x%x)\n",
+ fprintf(fd, "%"PRIu16" (0x%"PRIx16")\n",
td->td_photometric, td->td_photometric);
break;
}
}
}
if (TIFFFieldSet(tif,FIELD_EXTRASAMPLES) && td->td_extrasamples) {
- uint16 i;
- fprintf(fd, " Extra Samples: %u<", td->td_extrasamples);
+ uint16_t i;
+ fprintf(fd, " Extra Samples: %"PRIu16"<", td->td_extrasamples);
sep = "";
for (i = 0; i < td->td_extrasamples; i++) {
switch (td->td_sampleinfo[i]) {
@@ -377,7 +352,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "%sunassoc-alpha", sep);
break;
default:
- fprintf(fd, "%s%u (0x%x)", sep,
+ fprintf(fd, "%s%"PRIu16" (0x%"PRIx16")", sep,
td->td_sampleinfo[i], td->td_sampleinfo[i]);
break;
}
@@ -387,7 +362,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
}
if (TIFFFieldSet(tif,FIELD_INKNAMES)) {
char* cp;
- uint16 i;
+ uint16_t i;
fprintf(fd, " Ink Names: ");
i = td->td_samplesperpixel;
sep = "";
@@ -415,7 +390,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "error diffused\n");
break;
default:
- fprintf(fd, "%u (0x%x)\n",
+ fprintf(fd, "%"PRIu16" (0x%"PRIx16")\n",
td->td_threshholding, td->td_threshholding);
break;
}
@@ -430,14 +405,14 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "lsb-to-msb\n");
break;
default:
- fprintf(fd, "%u (0x%x)\n",
+ fprintf(fd, "%"PRIu16" (0x%"PRIx16")\n",
td->td_fillorder, td->td_fillorder);
break;
}
}
if (TIFFFieldSet(tif,FIELD_YCBCRSUBSAMPLING))
{
- fprintf(fd, " YCbCr Subsampling: %u, %u\n",
+ fprintf(fd, " YCbCr Subsampling: %"PRIu16", %"PRIu16"\n",
td->td_ycbcrsubsampling[0], td->td_ycbcrsubsampling[1] );
}
if (TIFFFieldSet(tif,FIELD_YCBCRPOSITIONING)) {
@@ -450,35 +425,35 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "cosited\n");
break;
default:
- fprintf(fd, "%u (0x%x)\n",
+ fprintf(fd, "%"PRIu16" (0x%"PRIx16")\n",
td->td_ycbcrpositioning, td->td_ycbcrpositioning);
break;
}
}
if (TIFFFieldSet(tif,FIELD_HALFTONEHINTS))
- fprintf(fd, " Halftone Hints: light %u dark %u\n",
+ fprintf(fd, " Halftone Hints: light %"PRIu16" dark %"PRIu16"\n",
td->td_halftonehints[0], td->td_halftonehints[1]);
if (TIFFFieldSet(tif,FIELD_ORIENTATION)) {
fprintf(fd, " Orientation: ");
if (td->td_orientation < NORIENTNAMES)
fprintf(fd, "%s\n", orientNames[td->td_orientation]);
else
- fprintf(fd, "%u (0x%x)\n",
+ fprintf(fd, "%"PRIu16" (0x%"PRIx16")\n",
td->td_orientation, td->td_orientation);
}
if (TIFFFieldSet(tif,FIELD_SAMPLESPERPIXEL))
- fprintf(fd, " Samples/Pixel: %u\n", td->td_samplesperpixel);
+ fprintf(fd, " Samples/Pixel: %"PRIx16"\n", td->td_samplesperpixel);
if (TIFFFieldSet(tif,FIELD_ROWSPERSTRIP)) {
fprintf(fd, " Rows/Strip: ");
- if (td->td_rowsperstrip == (uint32) -1)
+ if (td->td_rowsperstrip == (uint32_t) -1)
fprintf(fd, "(infinite)\n");
else
- fprintf(fd, "%lu\n", (unsigned long) td->td_rowsperstrip);
+ fprintf(fd, "%"PRIu32"\n", td->td_rowsperstrip);
}
if (TIFFFieldSet(tif,FIELD_MINSAMPLEVALUE))
- fprintf(fd, " Min Sample Value: %u\n", td->td_minsamplevalue);
+ fprintf(fd, " Min Sample Value: %"PRIu16"\n", td->td_minsamplevalue);
if (TIFFFieldSet(tif,FIELD_MAXSAMPLEVALUE))
- fprintf(fd, " Max Sample Value: %u\n", td->td_maxsamplevalue);
+ fprintf(fd, " Max Sample Value: %"PRIu16"\n", td->td_maxsamplevalue);
if (TIFFFieldSet(tif,FIELD_SMINSAMPLEVALUE)) {
int i;
int count = (tif->tif_flags & TIFF_PERSAMPLE) ? td->td_samplesperpixel : 1;
@@ -505,13 +480,13 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "separate image planes\n");
break;
default:
- fprintf(fd, "%u (0x%x)\n",
+ fprintf(fd, "%"PRIu16" (0x%"PRIx16")\n",
td->td_planarconfig, td->td_planarconfig);
break;
}
}
if (TIFFFieldSet(tif,FIELD_PAGENUMBER))
- fprintf(fd, " Page Number: %u-%u\n",
+ fprintf(fd, " Page Number: %"PRIu16"-%"PRIu16"\n",
td->td_pagenumber[0], td->td_pagenumber[1]);
if (TIFFFieldSet(tif,FIELD_COLORMAP)) {
fprintf(fd, " Color Map: ");
@@ -519,7 +494,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "\n");
n = 1L<<td->td_bitspersample;
for (l = 0; l < n; l++)
- fprintf(fd, " %5ld: %5u %5u %5u\n",
+ fprintf(fd, " %5ld: %5"PRIu16" %5"PRIu16" %5"PRIu16"\n",
l,
td->td_colormap[0][l],
td->td_colormap[1][l],
@@ -541,11 +516,11 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "\n");
n = 1L<<td->td_bitspersample;
for (l = 0; l < n; l++) {
- uint16 i;
- fprintf(fd, " %2ld: %5u",
+ uint16_t i;
+ fprintf(fd, " %2ld: %5"PRIu16,
l, td->td_transferfunction[0][l]);
for (i = 1; i < td->td_samplesperpixel - td->td_extrasamples && i < 3; i++)
- fprintf(fd, " %5u",
+ fprintf(fd, " %5"PRIu16,
td->td_transferfunction[i][l]);
fputc('\n', fd);
}
@@ -553,16 +528,11 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
fprintf(fd, "(present)\n");
}
if (TIFFFieldSet(tif, FIELD_SUBIFD) && (td->td_subifd)) {
- uint16 i;
+ uint16_t i;
fprintf(fd, " SubIFD Offsets:");
for (i = 0; i < td->td_nsubifd; i++)
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- fprintf(fd, " %5I64u",
- (unsigned __int64) td->td_subifd[i]);
-#else
- fprintf(fd, " %5llu",
- (unsigned long long) td->td_subifd[i]);
-#endif
+ fprintf(fd, " %5"PRIu64,
+ td->td_subifd[i]);
fputc('\n', fd);
}
@@ -575,9 +545,9 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
count = (short) TIFFGetTagListCount(tif);
for(i = 0; i < count; i++) {
- uint32 tag = TIFFGetTagListEntry(tif, i);
+ uint32_t tag = TIFFGetTagListEntry(tif, i);
const TIFFField *fip;
- uint32 value_count;
+ uint32_t value_count;
int mem_alloc = 0;
void *raw_data;
@@ -590,7 +560,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
if(TIFFGetField(tif, tag, &value_count, &raw_data) != 1)
continue;
} else if (fip->field_readcount == TIFF_VARIABLE ) {
- uint16 small_value_count;
+ uint16_t small_value_count;
if(TIFFGetField(tif, tag, &small_value_count, &raw_data) != 1)
continue;
value_count = small_value_count;
@@ -613,7 +583,7 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
handled this way ... likely best if we move it into
the directory structure with an explicit field in
libtiff 4.1 and assign it a FIELD_ value */
- static uint16 dotrange[2];
+ static uint16_t dotrange[2];
raw_data = dotrange;
TIFFGetField(tif, tag, dotrange+0, dotrange+1);
} else if (fip->field_type == TIFF_ASCII
@@ -654,23 +624,16 @@ TIFFPrintDirectory(TIFF* tif, FILE* fd, long flags)
if ((flags & TIFFPRINT_STRIPS) &&
TIFFFieldSet(tif,FIELD_STRIPOFFSETS)) {
- uint32 s;
+ uint32_t s;
- fprintf(fd, " %lu %s:\n",
- (unsigned long) td->td_nstrips,
+ fprintf(fd, " %"PRIu32" %s:\n",
+ td->td_nstrips,
isTiled(tif) ? "Tiles" : "Strips");
for (s = 0; s < td->td_nstrips; s++)
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- fprintf(fd, " %3lu: [%8I64u, %8I64u]\n",
- (unsigned long) s,
- (unsigned __int64) TIFFGetStrileOffset(tif, s),
- (unsigned __int64) TIFFGetStrileByteCount(tif, s));
-#else
- fprintf(fd, " %3lu: [%8llu, %8llu]\n",
- (unsigned long) s,
- (unsigned long long) TIFFGetStrileOffset(tif, s),
- (unsigned long long) TIFFGetStrileByteCount(tif, s));
-#endif
+ fprintf(fd, " %3"PRIu32": [%8"PRIu64", %8"PRIu64"]\n",
+ s,
+ TIFFGetStrileOffset(tif, s),
+ TIFFGetStrileByteCount(tif, s));
}
}
diff --git a/tiff/libtiff/tif_read.c b/tiff/libtiff/tif_read.c
index c4c868b1..a4c60b4f 100644
--- a/tiff/libtiff/tif_read.c
+++ b/tiff/libtiff/tif_read.c
@@ -29,31 +29,31 @@
#include "tiffiop.h"
#include <stdio.h>
-int TIFFFillStrip(TIFF* tif, uint32 strip);
-int TIFFFillTile(TIFF* tif, uint32 tile);
-static int TIFFStartStrip(TIFF* tif, uint32 strip);
-static int TIFFStartTile(TIFF* tif, uint32 tile);
+int TIFFFillStrip(TIFF* tif, uint32_t strip);
+int TIFFFillTile(TIFF* tif, uint32_t tile);
+static int TIFFStartStrip(TIFF* tif, uint32_t strip);
+static int TIFFStartTile(TIFF* tif, uint32_t tile);
static int TIFFCheckRead(TIFF*, int);
static tmsize_t
-TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,const char* module);
+TIFFReadRawStrip1(TIFF* tif, uint32_t strip, void* buf, tmsize_t size, const char* module);
static tmsize_t
-TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* module);
+TIFFReadRawTile1(TIFF* tif, uint32_t tile, void* buf, tmsize_t size, const char* module);
-#define NOSTRIP ((uint32)(-1)) /* undefined state */
-#define NOTILE ((uint32)(-1)) /* undefined state */
+#define NOSTRIP ((uint32_t)(-1)) /* undefined state */
+#define NOTILE ((uint32_t)(-1)) /* undefined state */
#define INITIAL_THRESHOLD (1024 * 1024)
#define THRESHOLD_MULTIPLIER 10
#define MAX_THRESHOLD (THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * THRESHOLD_MULTIPLIER * INITIAL_THRESHOLD)
-#define TIFF_INT64_MAX ((((int64)0x7FFFFFFF) << 32) | 0xFFFFFFFF)
+#define TIFF_INT64_MAX ((((int64_t)0x7FFFFFFF) << 32) | 0xFFFFFFFF)
/* Read 'size' bytes in tif_rawdata buffer starting at offset 'rawdata_offset'
* Returns 1 in case of success, 0 otherwise. */
-static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
- tmsize_t rawdata_offset,
- int is_strip, uint32 strip_or_tile,
- const char* module )
+static int TIFFReadAndRealloc(TIFF* tif, tmsize_t size,
+ tmsize_t rawdata_offset,
+ int is_strip, uint32_t strip_or_tile,
+ const char* module )
{
#if SIZEOF_SIZE_T == 8
tmsize_t threshold = INITIAL_THRESHOLD;
@@ -66,8 +66,8 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
/* file size */
if( size > 1000 * 1000 * 1000 )
{
- uint64 filesize = TIFFGetFileSize(tif);
- if( (uint64)size >= filesize )
+ uint64_t filesize = TIFFGetFileSize(tif);
+ if((uint64_t)size >= filesize )
{
TIFFErrorExt(tif->tif_clientdata, module,
"Chunk size requested is larger than file size.");
@@ -95,22 +95,22 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
}
#endif
if (already_read + to_read + rawdata_offset > tif->tif_rawdatasize) {
- uint8* new_rawdata;
+ uint8_t* new_rawdata;
assert((tif->tif_flags & TIFF_MYBUFFER) != 0);
tif->tif_rawdatasize = (tmsize_t)TIFFroundup_64(
- (uint64)already_read + to_read + rawdata_offset, 1024);
+ (uint64_t)already_read + to_read + rawdata_offset, 1024);
if (tif->tif_rawdatasize==0) {
TIFFErrorExt(tif->tif_clientdata, module,
"Invalid buffer size");
return 0;
}
- new_rawdata = (uint8*) _TIFFrealloc(
+ new_rawdata = (uint8_t*) _TIFFrealloc(
tif->tif_rawdata, tif->tif_rawdatasize);
if( new_rawdata == 0 )
{
TIFFErrorExt(tif->tif_clientdata, module,
- "No space for data buffer at scanline %lu",
- (unsigned long) tif->tif_row);
+ "No space for data buffer at scanline %"PRIu32,
+ tif->tif_row);
_TIFFfree(tif->tif_rawdata);
tif->tif_rawdata = 0;
tif->tif_rawdatasize = 0;
@@ -130,49 +130,26 @@ static int TIFFReadAndRealloc( TIFF* tif, tmsize_t size,
if (bytes_read != to_read) {
memset( tif->tif_rawdata + rawdata_offset + already_read, 0,
tif->tif_rawdatasize - rawdata_offset - already_read );
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
if( is_strip )
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at scanline %lu; got %I64u bytes, "
- "expected %I64u",
- (unsigned long) tif->tif_row,
- (unsigned __int64) already_read,
- (unsigned __int64) size);
+ "Read error at scanline %"PRIu32"; got %"TIFF_SSIZE_FORMAT" bytes, "
+ "expected %"TIFF_SSIZE_FORMAT,
+ tif->tif_row,
+ already_read,
+ size);
}
else
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at row %lu, col %lu, tile %lu; "
- "got %I64u bytes, expected %I64u",
- (unsigned long) tif->tif_row,
- (unsigned long) tif->tif_col,
- (unsigned long) strip_or_tile,
- (unsigned __int64) already_read,
- (unsigned __int64) size);
+ "Read error at row %"PRIu32", col %"PRIu32", tile %"PRIu32"; "
+ "got %"TIFF_SSIZE_FORMAT" bytes, expected %"TIFF_SSIZE_FORMAT"",
+ tif->tif_row,
+ tif->tif_col,
+ strip_or_tile,
+ already_read,
+ size);
}
-#else
- if( is_strip )
- {
- TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at scanline %lu; got %llu bytes, "
- "expected %llu",
- (unsigned long) tif->tif_row,
- (unsigned long long) already_read,
- (unsigned long long) size);
- }
- else
- {
- TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at row %lu, col %lu, tile %lu; "
- "got %llu bytes, expected %llu",
- (unsigned long) tif->tif_row,
- (unsigned long) tif->tif_col,
- (unsigned long) strip_or_tile,
- (unsigned long long) already_read,
- (unsigned long long) size);
- }
-#endif
return 0;
}
}
@@ -186,7 +163,7 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
static const char module[] = "TIFFFillStripPartial";
register TIFFDirectory *td = &tif->tif_dir;
tmsize_t unused_data;
- uint64 read_offset;
+ uint64_t read_offset;
tmsize_t to_read;
tmsize_t read_ahead_mod;
/* tmsize_t bytecountm; */
@@ -211,8 +188,8 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
tif->tif_curstrip = NOSTRIP;
if ((tif->tif_flags & TIFF_MYBUFFER) == 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Data buffer too small to hold part of strip %lu",
- (unsigned long) strip);
+ "Data buffer too small to hold part of strip %d",
+ strip);
return (0);
}
}
@@ -246,8 +223,8 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
if (!SeekOK(tif, read_offset)) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Seek error at scanline %lu, strip %lu",
- (unsigned long) tif->tif_row, (unsigned long) strip);
+ "Seek error at scanline %"PRIu32", strip %d",
+ tif->tif_row, strip);
return 0;
}
@@ -258,8 +235,8 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
to_read = read_ahead_mod - unused_data;
else
to_read = tif->tif_rawdatasize - unused_data;
- if( (uint64) to_read > TIFFGetStrileByteCount(tif, strip)
- - tif->tif_rawdataoff - tif->tif_rawdataloaded )
+ if((uint64_t) to_read > TIFFGetStrileByteCount(tif, strip)
+ - tif->tif_rawdataoff - tif->tif_rawdataloaded )
{
to_read = (tmsize_t) TIFFGetStrileByteCount(tif, strip)
- tif->tif_rawdataoff - tif->tif_rawdataloaded;
@@ -300,7 +277,7 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
/* For JPEG, if there are multiple scans (can generally be known */
/* with the read_ahead used), we need to read the whole strip */
if( tif->tif_dir.td_compression==COMPRESSION_JPEG &&
- (uint64)tif->tif_rawcc < TIFFGetStrileByteCount(tif, strip) )
+ (uint64_t)tif->tif_rawcc < TIFFGetStrileByteCount(tif, strip) )
{
if( TIFFJPEGIsFullStripRequired(tif) )
{
@@ -326,10 +303,10 @@ TIFFFillStripPartial( TIFF *tif, int strip, tmsize_t read_ahead, int restart )
* strips.
*/
static int
-TIFFSeek(TIFF* tif, uint32 row, uint16 sample )
+TIFFSeek(TIFF* tif, uint32_t row, uint16_t sample )
{
register TIFFDirectory *td = &tif->tif_dir;
- uint32 strip;
+ uint32_t strip;
int whole_strip;
tmsize_t read_ahead = 0;
@@ -338,19 +315,19 @@ TIFFSeek(TIFF* tif, uint32 row, uint16 sample )
*/
if (row >= td->td_imagelength) { /* out of range */
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "%lu: Row out of range, max %lu",
- (unsigned long) row,
- (unsigned long) td->td_imagelength);
+ "%"PRIu32": Row out of range, max %"PRIu32"",
+ row,
+ td->td_imagelength);
return (0);
}
if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
if (sample >= td->td_samplesperpixel) {
TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
- "%lu: Sample out of range, max %lu",
- (unsigned long) sample, (unsigned long) td->td_samplesperpixel);
+ "%"PRIu16": Sample out of range, max %"PRIu16"",
+ sample, td->td_samplesperpixel);
return (0);
}
- strip = (uint32)sample*td->td_stripsperimage + row/td->td_rowsperstrip;
+ strip = (uint32_t)sample * td->td_stripsperimage + row / td->td_rowsperstrip;
} else
strip = row / td->td_rowsperstrip;
@@ -412,7 +389,7 @@ TIFFSeek(TIFF* tif, uint32 row, uint16 sample )
else if( !whole_strip )
{
if( ((tif->tif_rawdata + tif->tif_rawdataloaded) - tif->tif_rawcp) < read_ahead
- && (uint64) tif->tif_rawdataoff+tif->tif_rawdataloaded < TIFFGetStrileByteCount(tif, strip) )
+ && (uint64_t) tif->tif_rawdataoff + tif->tif_rawdataloaded < TIFFGetStrileByteCount(tif, strip) )
{
if( !TIFFFillStripPartial(tif,strip,read_ahead,0) )
return 0;
@@ -457,7 +434,7 @@ TIFFSeek(TIFF* tif, uint32 row, uint16 sample )
}
int
-TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
+TIFFReadScanline(TIFF* tif, void* buf, uint32_t row, uint16_t sample)
{
int e;
@@ -468,13 +445,13 @@ TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
* Decompress desired row into user buffer.
*/
e = (*tif->tif_decoderow)
- (tif, (uint8*) buf, tif->tif_scanlinesize, sample);
+ (tif, (uint8_t*) buf, tif->tif_scanlinesize, sample);
/* we are now poised at the beginning of the next row */
tif->tif_row = row + 1;
if (e)
- (*tif->tif_postdecode)(tif, (uint8*) buf,
+ (*tif->tif_postdecode)(tif, (uint8_t*) buf,
tif->tif_scanlinesize);
}
return (e > 0 ? 1 : -1);
@@ -485,22 +462,22 @@ TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
* rows in the strip (check for truncated last strip on any
* of the separations).
*/
-static tmsize_t TIFFReadEncodedStripGetStripSize(TIFF* tif, uint32 strip, uint16* pplane)
+static tmsize_t TIFFReadEncodedStripGetStripSize(TIFF* tif, uint32_t strip, uint16_t* pplane)
{
static const char module[] = "TIFFReadEncodedStrip";
TIFFDirectory *td = &tif->tif_dir;
- uint32 rowsperstrip;
- uint32 stripsperplane;
- uint32 stripinplane;
- uint32 rows;
+ uint32_t rowsperstrip;
+ uint32_t stripsperplane;
+ uint32_t stripinplane;
+ uint32_t rows;
tmsize_t stripsize;
if (!TIFFCheckRead(tif,0))
return((tmsize_t)(-1));
if (strip>=td->td_nstrips)
{
TIFFErrorExt(tif->tif_clientdata,module,
- "%lu: Strip out of range, max %lu",(unsigned long)strip,
- (unsigned long)td->td_nstrips);
+ "%"PRIu32": Strip out of range, max %"PRIu32, strip,
+ td->td_nstrips);
return((tmsize_t)(-1));
}
@@ -509,7 +486,7 @@ static tmsize_t TIFFReadEncodedStripGetStripSize(TIFF* tif, uint32 strip, uint16
rowsperstrip=td->td_imagelength;
stripsperplane= TIFFhowmany_32_maxuint_compat(td->td_imagelength, rowsperstrip);
stripinplane=(strip%stripsperplane);
- if( pplane ) *pplane=(uint16)(strip/stripsperplane);
+ if( pplane ) *pplane=(uint16_t)(strip / stripsperplane);
rows=td->td_imagelength-stripinplane*rowsperstrip;
if (rows>rowsperstrip)
rows=rowsperstrip;
@@ -524,12 +501,12 @@ static tmsize_t TIFFReadEncodedStripGetStripSize(TIFF* tif, uint32 strip, uint16
* amount into the user-supplied buffer.
*/
tmsize_t
-TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
+TIFFReadEncodedStrip(TIFF* tif, uint32_t strip, void* buf, tmsize_t size)
{
static const char module[] = "TIFFReadEncodedStrip";
TIFFDirectory *td = &tif->tif_dir;
tmsize_t stripsize;
- uint16 plane;
+ uint16_t plane;
stripsize=TIFFReadEncodedStripGetStripSize(tif, strip, &plane);
if (stripsize==((tmsize_t)(-1)))
@@ -569,12 +546,12 @@ TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
* * calls regular TIFFReadEncodedStrip() if *buf != NULL
*/
tmsize_t
-_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
+_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32_t strip,
void **buf, tmsize_t bufsizetoalloc,
tmsize_t size_to_read)
{
tmsize_t this_stripsize;
- uint16 plane;
+ uint16_t plane;
if( *buf != NULL )
{
@@ -606,8 +583,8 @@ _TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
}
static tmsize_t
-TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
- const char* module)
+TIFFReadRawStrip1(TIFF* tif, uint32_t strip, void* buf, tmsize_t size,
+ const char* module)
{
assert((tif->tif_flags&TIFF_NOREADRAW)==0);
if (!isMapped(tif)) {
@@ -615,32 +592,24 @@ TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
if (!SeekOK(tif, TIFFGetStrileOffset(tif, strip))) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Seek error at scanline %lu, strip %lu",
- (unsigned long) tif->tif_row, (unsigned long) strip);
+ "Seek error at scanline %"PRIu32", strip %"PRIu32,
+ tif->tif_row, strip);
return ((tmsize_t)(-1));
}
cc = TIFFReadFile(tif, buf, size);
if (cc != size) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at scanline %lu; got %I64u bytes, expected %I64u",
- (unsigned long) tif->tif_row,
- (unsigned __int64) cc,
- (unsigned __int64) size);
-#else
- TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at scanline %lu; got %llu bytes, expected %llu",
- (unsigned long) tif->tif_row,
- (unsigned long long) cc,
- (unsigned long long) size);
-#endif
+ "Read error at scanline %"PRIu32"; got %"TIFF_SSIZE_FORMAT" bytes, expected %"TIFF_SSIZE_FORMAT,
+ tif->tif_row,
+ cc,
+ size);
return ((tmsize_t)(-1));
}
} else {
tmsize_t ma = 0;
tmsize_t n;
- if ((TIFFGetStrileOffset(tif, strip) > (uint64)TIFF_TMSIZE_T_MAX)||
- ((ma=(tmsize_t)TIFFGetStrileOffset(tif, strip))>tif->tif_size))
+ if ((TIFFGetStrileOffset(tif, strip) > (uint64_t)TIFF_TMSIZE_T_MAX) ||
+ ((ma=(tmsize_t)TIFFGetStrileOffset(tif, strip))>tif->tif_size))
{
n=0;
}
@@ -657,21 +626,12 @@ TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
n=size;
}
if (n!=size) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at scanline %lu, strip %lu; got %I64u bytes, expected %I64u",
- (unsigned long) tif->tif_row,
- (unsigned long) strip,
- (unsigned __int64) n,
- (unsigned __int64) size);
-#else
TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at scanline %lu, strip %lu; got %llu bytes, expected %llu",
- (unsigned long) tif->tif_row,
- (unsigned long) strip,
- (unsigned long long) n,
- (unsigned long long) size);
-#endif
+ "Read error at scanline %"PRIu32", strip %"PRIu32"; got %"TIFF_SSIZE_FORMAT" bytes, expected %"TIFF_SSIZE_FORMAT,
+ tif->tif_row,
+ strip,
+ n,
+ size);
return ((tmsize_t)(-1));
}
_TIFFmemcpy(buf, tif->tif_base + ma,
@@ -681,7 +641,7 @@ TIFFReadRawStrip1(TIFF* tif, uint32 strip, void* buf, tmsize_t size,
}
static tmsize_t
-TIFFReadRawStripOrTile2(TIFF* tif, uint32 strip_or_tile, int is_strip,
+TIFFReadRawStripOrTile2(TIFF* tif, uint32_t strip_or_tile, int is_strip,
tmsize_t size, const char* module)
{
assert( !isMapped(tif) );
@@ -691,17 +651,17 @@ TIFFReadRawStripOrTile2(TIFF* tif, uint32 strip_or_tile, int is_strip,
if( is_strip )
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Seek error at scanline %lu, strip %lu",
- (unsigned long) tif->tif_row,
- (unsigned long) strip_or_tile);
+ "Seek error at scanline %"PRIu32", strip %"PRIu32,
+ tif->tif_row,
+ strip_or_tile);
}
else
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Seek error at row %lu, col %lu, tile %lu",
- (unsigned long) tif->tif_row,
- (unsigned long) tif->tif_col,
- (unsigned long) strip_or_tile);
+ "Seek error at row %"PRIu32", col %"PRIu32", tile %"PRIu32,
+ tif->tif_row,
+ tif->tif_col,
+ strip_or_tile);
}
return ((tmsize_t)(-1));
}
@@ -719,20 +679,20 @@ TIFFReadRawStripOrTile2(TIFF* tif, uint32 strip_or_tile, int is_strip,
* Read a strip of data from the file.
*/
tmsize_t
-TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
+TIFFReadRawStrip(TIFF* tif, uint32_t strip, void* buf, tmsize_t size)
{
static const char module[] = "TIFFReadRawStrip";
TIFFDirectory *td = &tif->tif_dir;
- uint64 bytecount64;
+ uint64_t bytecount64;
tmsize_t bytecountm;
if (!TIFFCheckRead(tif, 0))
return ((tmsize_t)(-1));
if (strip >= td->td_nstrips) {
TIFFErrorExt(tif->tif_clientdata, module,
- "%lu: Strip out of range, max %lu",
- (unsigned long) strip,
- (unsigned long) td->td_nstrips);
+ "%"PRIu32": Strip out of range, max %"PRIu32,
+ strip,
+ td->td_nstrips);
return ((tmsize_t)(-1));
}
if (tif->tif_flags&TIFF_NOREADRAW)
@@ -742,7 +702,7 @@ TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
return ((tmsize_t)(-1));
}
bytecount64 = TIFFGetStrileByteCount(tif, strip);
- if (size != (tmsize_t)(-1) && (uint64)size <= bytecount64)
+ if (size != (tmsize_t)(-1) && (uint64_t)size <= bytecount64)
bytecountm = size;
else
bytecountm = _TIFFCastUInt64ToSSize(tif, bytecount64, module);
@@ -753,7 +713,7 @@ TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size)
}
TIFF_NOSANITIZE_UNSIGNED_INT_OVERFLOW
-static uint64 NoSanitizeSubUInt64(uint64 a, uint64 b)
+static uint64_t NoSanitizeSubUInt64(uint64_t a, uint64_t b)
{
return a - b;
}
@@ -763,26 +723,19 @@ static uint64 NoSanitizeSubUInt64(uint64 a, uint64 b)
* expanded, as necessary, to hold the strip's data.
*/
int
-TIFFFillStrip(TIFF* tif, uint32 strip)
+TIFFFillStrip(TIFF* tif, uint32_t strip)
{
static const char module[] = "TIFFFillStrip";
TIFFDirectory *td = &tif->tif_dir;
if ((tif->tif_flags&TIFF_NOREADRAW)==0)
{
- uint64 bytecount = TIFFGetStrileByteCount(tif, strip);
- if( bytecount == 0 || bytecount > (uint64)TIFF_INT64_MAX ) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(tif->tif_clientdata, module,
- "Invalid strip byte count %I64u, strip %lu",
- (unsigned __int64) bytecount,
- (unsigned long) strip);
-#else
+ uint64_t bytecount = TIFFGetStrileByteCount(tif, strip);
+ if( bytecount == 0 || bytecount > (uint64_t)TIFF_INT64_MAX ) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Invalid strip byte count %llu, strip %lu",
- (unsigned long long) bytecount,
- (unsigned long) strip);
-#endif
+ "Invalid strip byte count %"PRIu64", strip %"PRIu32,
+ bytecount,
+ strip);
return (0);
}
@@ -795,24 +748,16 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
/* Hopefully they are safe enough for all codecs */
tmsize_t stripsize = TIFFStripSize(tif);
if( stripsize != 0 &&
- (bytecount - 4096) / 10 > (uint64)stripsize )
+ (bytecount - 4096) / 10 > (uint64_t)stripsize )
{
- uint64 newbytecount = (uint64)stripsize * 10 + 4096;
- if( newbytecount == 0 || newbytecount > (uint64)TIFF_INT64_MAX )
+ uint64_t newbytecount = (uint64_t)stripsize * 10 + 4096;
+ if( newbytecount == 0 || newbytecount > (uint64_t)TIFF_INT64_MAX )
{
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFWarningExt(tif->tif_clientdata, module,
- "Too large strip byte count %I64u, strip %lu. Limiting to %I64u",
- (unsigned __int64) bytecount,
- (unsigned long) strip,
- (unsigned __int64) newbytecount);
-#else
TIFFErrorExt(tif->tif_clientdata, module,
- "Too large strip byte count %llu, strip %lu. Limiting to %llu",
- (unsigned long long) bytecount,
- (unsigned long) strip,
- (unsigned long long) newbytecount);
-#endif
+ "Too large strip byte count %"PRIu64", strip %"PRIu32". Limiting to %"PRIu64,
+ bytecount,
+ strip,
+ newbytecount);
bytecount = newbytecount;
}
}
@@ -828,30 +773,20 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
* comparison (which can overflow) we do the following
* two comparisons:
*/
- if (bytecount > (uint64)tif->tif_size ||
- TIFFGetStrileOffset(tif, strip) > (uint64)tif->tif_size - bytecount) {
+ if (bytecount > (uint64_t)tif->tif_size ||
+ TIFFGetStrileOffset(tif, strip) > (uint64_t)tif->tif_size - bytecount) {
/*
* This error message might seem strange, but
* it's what would happen if a read were done
* instead.
*/
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(tif->tif_clientdata, module,
-
- "Read error on strip %lu; "
- "got %I64u bytes, expected %I64u",
- (unsigned long) strip,
- (unsigned __int64) NoSanitizeSubUInt64(tif->tif_size, TIFFGetStrileOffset(tif, strip)),
- (unsigned __int64) bytecount);
-#else
TIFFErrorExt(tif->tif_clientdata, module,
- "Read error on strip %lu; "
- "got %llu bytes, expected %llu",
- (unsigned long) strip,
- (unsigned long long) NoSanitizeSubUInt64(tif->tif_size, TIFFGetStrileOffset(tif, strip)),
- (unsigned long long) bytecount);
-#endif
+ "Read error on strip %"PRIu32"; "
+ "got %"PRIu64" bytes, expected %"PRIu64,
+ strip,
+ NoSanitizeSubUInt64(tif->tif_size, TIFFGetStrileOffset(tif, strip)),
+ bytecount);
tif->tif_curstrip = NOSTRIP;
return (0);
}
@@ -897,7 +832,7 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
*/
tmsize_t bytecountm;
bytecountm=(tmsize_t)bytecount;
- if ((uint64)bytecountm!=bytecount)
+ if ((uint64_t)bytecountm != bytecount)
{
TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
return(0);
@@ -906,8 +841,8 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
tif->tif_curstrip = NOSTRIP;
if ((tif->tif_flags & TIFF_MYBUFFER) == 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Data buffer too small to hold strip %lu",
- (unsigned long) strip);
+ "Data buffer too small to hold strip %"PRIu32,
+ strip);
return (0);
}
}
@@ -962,7 +897,7 @@ TIFFFillStrip(TIFF* tif, uint32 strip)
* tile is selected by the (x,y,z,s) coordinates.
*/
tmsize_t
-TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
+TIFFReadTile(TIFF* tif, void* buf, uint32_t x, uint32_t y, uint32_t z, uint16_t s)
{
if (!TIFFCheckRead(tif, 1) || !TIFFCheckTile(tif, x, y, z, s))
return ((tmsize_t)(-1));
@@ -975,7 +910,7 @@ TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
* amount into the user-supplied buffer.
*/
tmsize_t
-TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
+TIFFReadEncodedTile(TIFF* tif, uint32_t tile, void* buf, tmsize_t size)
{
static const char module[] = "TIFFReadEncodedTile";
TIFFDirectory *td = &tif->tif_dir;
@@ -985,8 +920,8 @@ TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
return ((tmsize_t)(-1));
if (tile >= td->td_nstrips) {
TIFFErrorExt(tif->tif_clientdata, module,
- "%lu: Tile out of range, max %lu",
- (unsigned long) tile, (unsigned long) td->td_nstrips);
+ "%"PRIu32": Tile out of range, max %"PRIu32,
+ tile, td->td_nstrips);
return ((tmsize_t)(-1));
}
@@ -1012,8 +947,8 @@ TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
else if (size > tilesize)
size = tilesize;
if (TIFFFillTile(tif, tile) && (*tif->tif_decodetile)(tif,
- (uint8*) buf, size, (uint16)(tile/td->td_stripsperimage))) {
- (*tif->tif_postdecode)(tif, (uint8*) buf, size);
+ (uint8_t*) buf, size, (uint16_t)(tile / td->td_stripsperimage))) {
+ (*tif->tif_postdecode)(tif, (uint8_t*) buf, size);
return (size);
} else
return ((tmsize_t)(-1));
@@ -1028,7 +963,7 @@ TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
tmsize_t
_TIFFReadTileAndAllocBuffer(TIFF* tif,
void **buf, tmsize_t bufsizetoalloc,
- uint32 x, uint32 y, uint32 z, uint16 s)
+ uint32_t x, uint32_t y, uint32_t z, uint16_t s)
{
if (!TIFFCheckRead(tif, 1) || !TIFFCheckTile(tif, x, y, z, s))
return ((tmsize_t)(-1));
@@ -1045,9 +980,9 @@ _TIFFReadTileAndAllocBuffer(TIFF* tif,
* * calls regular TIFFReadEncodedTile() if *buf != NULL
*/
tmsize_t
-_TIFFReadEncodedTileAndAllocBuffer(TIFF* tif, uint32 tile,
- void **buf, tmsize_t bufsizetoalloc,
- tmsize_t size_to_read)
+_TIFFReadEncodedTileAndAllocBuffer(TIFF* tif, uint32_t tile,
+ void **buf, tmsize_t bufsizetoalloc,
+ tmsize_t size_to_read)
{
static const char module[] = "_TIFFReadEncodedTileAndAllocBuffer";
TIFFDirectory *td = &tif->tif_dir;
@@ -1062,8 +997,8 @@ _TIFFReadEncodedTileAndAllocBuffer(TIFF* tif, uint32 tile,
return ((tmsize_t)(-1));
if (tile >= td->td_nstrips) {
TIFFErrorExt(tif->tif_clientdata, module,
- "%lu: Tile out of range, max %lu",
- (unsigned long) tile, (unsigned long) td->td_nstrips);
+ "%"PRIu32": Tile out of range, max %"PRIu32,
+ tile, td->td_nstrips);
return ((tmsize_t)(-1));
}
@@ -1083,15 +1018,15 @@ _TIFFReadEncodedTileAndAllocBuffer(TIFF* tif, uint32 tile,
else if (size_to_read > tilesize)
size_to_read = tilesize;
if( (*tif->tif_decodetile)(tif,
- (uint8*) *buf, size_to_read, (uint16)(tile/td->td_stripsperimage))) {
- (*tif->tif_postdecode)(tif, (uint8*) *buf, size_to_read);
+ (uint8_t*) *buf, size_to_read, (uint16_t)(tile / td->td_stripsperimage))) {
+ (*tif->tif_postdecode)(tif, (uint8_t*) *buf, size_to_read);
return (size_to_read);
} else
return ((tmsize_t)(-1));
}
static tmsize_t
-TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* module)
+TIFFReadRawTile1(TIFF* tif, uint32_t tile, void* buf, tmsize_t size, const char* module)
{
assert((tif->tif_flags&TIFF_NOREADRAW)==0);
if (!isMapped(tif)) {
@@ -1099,29 +1034,20 @@ TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* m
if (!SeekOK(tif, TIFFGetStrileOffset(tif, tile))) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Seek error at row %lu, col %lu, tile %lu",
- (unsigned long) tif->tif_row,
- (unsigned long) tif->tif_col,
- (unsigned long) tile);
+ "Seek error at row %"PRIu32", col %"PRIu32", tile %"PRIu32,
+ tif->tif_row,
+ tif->tif_col,
+ tile);
return ((tmsize_t)(-1));
}
cc = TIFFReadFile(tif, buf, size);
if (cc != size) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at row %lu, col %lu; got %I64u bytes, expected %I64u",
- (unsigned long) tif->tif_row,
- (unsigned long) tif->tif_col,
- (unsigned __int64) cc,
- (unsigned __int64) size);
-#else
TIFFErrorExt(tif->tif_clientdata, module,
- "Read error at row %lu, col %lu; got %llu bytes, expected %llu",
- (unsigned long) tif->tif_row,
- (unsigned long) tif->tif_col,
- (unsigned long long) cc,
- (unsigned long long) size);
-#endif
+ "Read error at row %"PRIu32", col %"PRIu32"; got %"TIFF_SSIZE_FORMAT" bytes, expected %"TIFF_SSIZE_FORMAT,
+ tif->tif_row,
+ tif->tif_col,
+ cc,
+ size);
return ((tmsize_t)(-1));
}
} else {
@@ -1129,30 +1055,20 @@ TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* m
tmsize_t n;
ma=(tmsize_t)TIFFGetStrileOffset(tif, tile);
mb=ma+size;
- if ((TIFFGetStrileOffset(tif, tile) > (uint64)TIFF_TMSIZE_T_MAX)||(ma>tif->tif_size))
+ if ((TIFFGetStrileOffset(tif, tile) > (uint64_t)TIFF_TMSIZE_T_MAX) || (ma > tif->tif_size))
n=0;
else if ((mb<ma)||(mb<size)||(mb>tif->tif_size))
n=tif->tif_size-ma;
else
n=size;
if (n!=size) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFErrorExt(tif->tif_clientdata, module,
-"Read error at row %lu, col %lu, tile %lu; got %I64u bytes, expected %I64u",
- (unsigned long) tif->tif_row,
- (unsigned long) tif->tif_col,
- (unsigned long) tile,
- (unsigned __int64) n,
- (unsigned __int64) size);
-#else
TIFFErrorExt(tif->tif_clientdata, module,
-"Read error at row %lu, col %lu, tile %lu; got %llu bytes, expected %llu",
- (unsigned long) tif->tif_row,
- (unsigned long) tif->tif_col,
- (unsigned long) tile,
- (unsigned long long) n,
- (unsigned long long) size);
-#endif
+"Read error at row %"PRIu32", col %"PRIu32", tile %"PRIu32"; got %"TIFF_SSIZE_FORMAT" bytes, expected %"TIFF_SSIZE_FORMAT,
+ tif->tif_row,
+ tif->tif_col,
+ tile,
+ n,
+ size);
return ((tmsize_t)(-1));
}
_TIFFmemcpy(buf, tif->tif_base + ma, size);
@@ -1164,19 +1080,19 @@ TIFFReadRawTile1(TIFF* tif, uint32 tile, void* buf, tmsize_t size, const char* m
* Read a tile of data from the file.
*/
tmsize_t
-TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
+TIFFReadRawTile(TIFF* tif, uint32_t tile, void* buf, tmsize_t size)
{
static const char module[] = "TIFFReadRawTile";
TIFFDirectory *td = &tif->tif_dir;
- uint64 bytecount64;
+ uint64_t bytecount64;
tmsize_t bytecountm;
if (!TIFFCheckRead(tif, 1))
return ((tmsize_t)(-1));
if (tile >= td->td_nstrips) {
TIFFErrorExt(tif->tif_clientdata, module,
- "%lu: Tile out of range, max %lu",
- (unsigned long) tile, (unsigned long) td->td_nstrips);
+ "%"PRIu32": Tile out of range, max %"PRIu32,
+ tile, td->td_nstrips);
return ((tmsize_t)(-1));
}
if (tif->tif_flags&TIFF_NOREADRAW)
@@ -1186,7 +1102,7 @@ TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
return ((tmsize_t)(-1));
}
bytecount64 = TIFFGetStrileByteCount(tif, tile);
- if (size != (tmsize_t)(-1) && (uint64)size <= bytecount64)
+ if (size != (tmsize_t)(-1) && (uint64_t)size <= bytecount64)
bytecountm = size;
else
bytecountm = _TIFFCastUInt64ToSSize(tif, bytecount64, module);
@@ -1201,26 +1117,19 @@ TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size)
* expanded, as necessary, to hold the tile's data.
*/
int
-TIFFFillTile(TIFF* tif, uint32 tile)
+TIFFFillTile(TIFF* tif, uint32_t tile)
{
static const char module[] = "TIFFFillTile";
TIFFDirectory *td = &tif->tif_dir;
if ((tif->tif_flags&TIFF_NOREADRAW)==0)
{
- uint64 bytecount = TIFFGetStrileByteCount(tif, tile);
- if( bytecount == 0 || bytecount > (uint64)TIFF_INT64_MAX ) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
+ uint64_t bytecount = TIFFGetStrileByteCount(tif, tile);
+ if( bytecount == 0 || bytecount > (uint64_t)TIFF_INT64_MAX ) {
TIFFErrorExt(tif->tif_clientdata, module,
- "%I64u: Invalid tile byte count, tile %lu",
- (unsigned __int64) bytecount,
- (unsigned long) tile);
-#else
- TIFFErrorExt(tif->tif_clientdata, module,
- "%llu: Invalid tile byte count, tile %lu",
- (unsigned long long) bytecount,
- (unsigned long) tile);
-#endif
+ "%"PRIu64": Invalid tile byte count, tile %"PRIu32,
+ bytecount,
+ tile);
return (0);
}
@@ -1233,24 +1142,16 @@ TIFFFillTile(TIFF* tif, uint32 tile)
/* Hopefully they are safe enough for all codecs */
tmsize_t stripsize = TIFFTileSize(tif);
if( stripsize != 0 &&
- (bytecount - 4096) / 10 > (uint64)stripsize )
+ (bytecount - 4096) / 10 > (uint64_t)stripsize )
{
- uint64 newbytecount = (uint64)stripsize * 10 + 4096;
- if( newbytecount == 0 || newbytecount > (uint64)TIFF_INT64_MAX )
+ uint64_t newbytecount = (uint64_t)stripsize * 10 + 4096;
+ if( newbytecount == 0 || newbytecount > (uint64_t)TIFF_INT64_MAX )
{
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- TIFFWarningExt(tif->tif_clientdata, module,
- "Too large tile byte count %I64u, tile %lu. Limiting to %I64u",
- (unsigned __int64) bytecount,
- (unsigned long) tile,
- (unsigned __int64) newbytecount);
-#else
TIFFErrorExt(tif->tif_clientdata, module,
- "Too large tile byte count %llu, tile %lu. Limiting to %llu",
- (unsigned long long) bytecount,
- (unsigned long) tile,
- (unsigned long long) newbytecount);
-#endif
+ "Too large tile byte count %"PRIu64", tile %"PRIu32". Limiting to %"PRIu64,
+ bytecount,
+ tile,
+ newbytecount);
bytecount = newbytecount;
}
}
@@ -1266,8 +1167,8 @@ TIFFFillTile(TIFF* tif, uint32 tile)
* comparison (which can overflow) we do the following
* two comparisons:
*/
- if (bytecount > (uint64)tif->tif_size ||
- TIFFGetStrileOffset(tif, tile) > (uint64)tif->tif_size - bytecount) {
+ if (bytecount > (uint64_t)tif->tif_size ||
+ TIFFGetStrileOffset(tif, tile) > (uint64_t)tif->tif_size - bytecount) {
tif->tif_curtile = NOTILE;
return (0);
}
@@ -1308,7 +1209,7 @@ TIFFFillTile(TIFF* tif, uint32 tile)
*/
tmsize_t bytecountm;
bytecountm=(tmsize_t)bytecount;
- if ((uint64)bytecountm!=bytecount)
+ if ((uint64_t)bytecountm != bytecount)
{
TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
return(0);
@@ -1317,8 +1218,8 @@ TIFFFillTile(TIFF* tif, uint32 tile)
tif->tif_curtile = NOTILE;
if ((tif->tif_flags & TIFF_MYBUFFER) == 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Data buffer too small to hold tile %lu",
- (unsigned long) tile);
+ "Data buffer too small to hold tile %"PRIu32,
+ tile);
return (0);
}
}
@@ -1390,10 +1291,10 @@ TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size)
}
if (bp) {
tif->tif_rawdatasize = size;
- tif->tif_rawdata = (uint8*) bp;
+ tif->tif_rawdata = (uint8_t*) bp;
tif->tif_flags &= ~TIFF_MYBUFFER;
} else {
- tif->tif_rawdatasize = (tmsize_t)TIFFroundup_64((uint64)size, 1024);
+ tif->tif_rawdatasize = (tmsize_t)TIFFroundup_64((uint64_t)size, 1024);
if (tif->tif_rawdatasize==0) {
TIFFErrorExt(tif->tif_clientdata, module,
"Invalid buffer size");
@@ -1401,13 +1302,13 @@ TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size)
}
/* Initialize to zero to avoid uninitialized buffers in case of */
/* short reads (http://bugzilla.maptools.org/show_bug.cgi?id=2651) */
- tif->tif_rawdata = (uint8*) _TIFFcalloc(1, tif->tif_rawdatasize);
+ tif->tif_rawdata = (uint8_t*) _TIFFcalloc(1, tif->tif_rawdatasize);
tif->tif_flags |= TIFF_MYBUFFER;
}
if (tif->tif_rawdata == NULL) {
TIFFErrorExt(tif->tif_clientdata, module,
- "No space for data buffer at scanline %lu",
- (unsigned long) tif->tif_row);
+ "No space for data buffer at scanline %"PRIu32,
+ tif->tif_row);
tif->tif_rawdatasize = 0;
return (0);
}
@@ -1419,7 +1320,7 @@ TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size)
* strip has just been read in.
*/
static int
-TIFFStartStrip(TIFF* tif, uint32 strip)
+TIFFStartStrip(TIFF* tif, uint32_t strip)
{
TIFFDirectory *td = &tif->tif_dir;
@@ -1446,7 +1347,7 @@ TIFFStartStrip(TIFF* tif, uint32 strip)
tif->tif_rawcc = (tmsize_t)TIFFGetStrileByteCount(tif, strip);
}
if ((*tif->tif_predecode)(tif,
- (uint16)(strip / td->td_stripsperimage)) == 0 ) {
+ (uint16_t)(strip / td->td_stripsperimage)) == 0 ) {
/* Needed for example for scanline access, if tif_predecode */
/* fails, and we try to read the same strip again. Without invalidating */
/* tif_curstrip, we'd call tif_decoderow() on a possibly invalid */
@@ -1462,11 +1363,11 @@ TIFFStartStrip(TIFF* tif, uint32 strip)
* tile has just been read in.
*/
static int
-TIFFStartTile(TIFF* tif, uint32 tile)
+TIFFStartTile(TIFF* tif, uint32_t tile)
{
static const char module[] = "TIFFStartTile";
TIFFDirectory *td = &tif->tif_dir;
- uint32 howmany32;
+ uint32_t howmany32;
if ((tif->tif_flags & TIFF_CODERSETUP) == 0) {
if (!(*tif->tif_setupdecode)(tif))
@@ -1501,7 +1402,7 @@ TIFFStartTile(TIFF* tif, uint32 tile)
tif->tif_rawcc = (tmsize_t)TIFFGetStrileByteCount(tif, tile);
}
return ((*tif->tif_predecode)(tif,
- (uint16)(tile/td->td_stripsperimage)));
+ (uint16_t)(tile / td->td_stripsperimage)));
}
static int
@@ -1529,14 +1430,14 @@ TIFFCheckRead(TIFF* tif, int tiles)
* inbuf content must be writable (if bit reversal is needed)
* Returns 1 in case of success, 0 otherwise.
*/
-int TIFFReadFromUserBuffer(TIFF* tif, uint32 strile,
+int TIFFReadFromUserBuffer(TIFF* tif, uint32_t strile,
void* inbuf, tmsize_t insize,
void* outbuf, tmsize_t outsize)
{
static const char module[] = "TIFFReadFromUserBuffer";
TIFFDirectory *td = &tif->tif_dir;
int ret = 1;
- uint32 old_tif_flags = tif->tif_flags;
+ uint32_t old_tif_flags = tif->tif_flags;
tmsize_t old_rawdatasize = tif->tif_rawdatasize;
void* old_rawdata = tif->tif_rawdata;
@@ -1567,29 +1468,29 @@ int TIFFReadFromUserBuffer(TIFF* tif, uint32 strile,
if( TIFFIsTiled(tif) )
{
if( !TIFFStartTile(tif, strile) ||
- !(*tif->tif_decodetile)(tif, (uint8*) outbuf, outsize,
- (uint16)(strile/td->td_stripsperimage)) )
+ !(*tif->tif_decodetile)(tif, (uint8_t*) outbuf, outsize,
+ (uint16_t)(strile / td->td_stripsperimage)) )
{
ret = 0;
}
}
else
{
- uint32 rowsperstrip=td->td_rowsperstrip;
- uint32 stripsperplane;
+ uint32_t rowsperstrip=td->td_rowsperstrip;
+ uint32_t stripsperplane;
if (rowsperstrip>td->td_imagelength)
rowsperstrip=td->td_imagelength;
stripsperplane= TIFFhowmany_32_maxuint_compat(td->td_imagelength, rowsperstrip);
if( !TIFFStartStrip(tif, strile) ||
- !(*tif->tif_decodestrip)(tif, (uint8*) outbuf, outsize,
- (uint16)(strile/stripsperplane)) )
+ !(*tif->tif_decodestrip)(tif, (uint8_t*) outbuf, outsize,
+ (uint16_t)(strile / stripsperplane)) )
{
ret = 0;
}
}
if( ret )
{
- (*tif->tif_postdecode)(tif, (uint8*) outbuf, outsize);
+ (*tif->tif_postdecode)(tif, (uint8_t*) outbuf, outsize);
}
if (!isFillOrder(tif, td->td_fillorder) &&
@@ -1608,37 +1509,37 @@ int TIFFReadFromUserBuffer(TIFF* tif, uint32 strile,
}
void
-_TIFFNoPostDecode(TIFF* tif, uint8* buf, tmsize_t cc)
+_TIFFNoPostDecode(TIFF* tif, uint8_t* buf, tmsize_t cc)
{
(void) tif; (void) buf; (void) cc;
}
void
-_TIFFSwab16BitData(TIFF* tif, uint8* buf, tmsize_t cc)
+_TIFFSwab16BitData(TIFF* tif, uint8_t* buf, tmsize_t cc)
{
(void) tif;
assert((cc & 1) == 0);
- TIFFSwabArrayOfShort((uint16*) buf, cc/2);
+ TIFFSwabArrayOfShort((uint16_t*) buf, cc / 2);
}
void
-_TIFFSwab24BitData(TIFF* tif, uint8* buf, tmsize_t cc)
+_TIFFSwab24BitData(TIFF* tif, uint8_t* buf, tmsize_t cc)
{
(void) tif;
assert((cc % 3) == 0);
- TIFFSwabArrayOfTriples((uint8*) buf, cc/3);
+ TIFFSwabArrayOfTriples((uint8_t*) buf, cc / 3);
}
void
-_TIFFSwab32BitData(TIFF* tif, uint8* buf, tmsize_t cc)
+_TIFFSwab32BitData(TIFF* tif, uint8_t* buf, tmsize_t cc)
{
(void) tif;
assert((cc & 3) == 0);
- TIFFSwabArrayOfLong((uint32*) buf, cc/4);
+ TIFFSwabArrayOfLong((uint32_t*) buf, cc / 4);
}
void
-_TIFFSwab64BitData(TIFF* tif, uint8* buf, tmsize_t cc)
+_TIFFSwab64BitData(TIFF* tif, uint8_t* buf, tmsize_t cc)
{
(void) tif;
assert((cc & 7) == 0);
diff --git a/tiff/libtiff/tif_stream.cxx b/tiff/libtiff/tif_stream.cxx
index 7f640a9c..ea224169 100644
--- a/tiff/libtiff/tif_stream.cxx
+++ b/tiff/libtiff/tif_stream.cxx
@@ -28,9 +28,7 @@
#include "tiffiop.h"
#include <iostream>
-#ifndef __VMS
using namespace std;
-#endif
/*
ISO C++ uses a 'std::streamsize' type to define counts. This makes
@@ -82,10 +80,10 @@ extern "C" {
static tmsize_t _tiffisReadProc(thandle_t fd, void* buf, tmsize_t size);
static tmsize_t _tiffosWriteProc(thandle_t fd, void* buf, tmsize_t size);
static tmsize_t _tiffisWriteProc(thandle_t, void*, tmsize_t);
- static uint64 _tiffosSeekProc(thandle_t fd, uint64 off, int whence);
- static uint64 _tiffisSeekProc(thandle_t fd, uint64 off, int whence);
- static uint64 _tiffosSizeProc(thandle_t fd);
- static uint64 _tiffisSizeProc(thandle_t fd);
+ static uint64_t _tiffosSeekProc(thandle_t fd, uint64_t off, int whence);
+ static uint64_t _tiffisSeekProc(thandle_t fd, uint64_t off, int whence);
+ static uint64_t _tiffosSizeProc(thandle_t fd);
+ static uint64_t _tiffisSizeProc(thandle_t fd);
static int _tiffosCloseProc(thandle_t fd);
static int _tiffisCloseProc(thandle_t fd);
static int _tiffDummyMapProc(thandle_t , void** base, toff_t* size );
@@ -148,26 +146,26 @@ _tiffisWriteProc(thandle_t, void*, tmsize_t)
return 0;
}
-static uint64
-_tiffosSeekProc(thandle_t fd, uint64 off, int whence)
+static uint64_t
+_tiffosSeekProc(thandle_t fd, uint64_t off, int whence)
{
tiffos_data *data = reinterpret_cast<tiffos_data *>(fd);
ostream *os = data->stream;
// if the stream has already failed, don't do anything
if( os->fail() )
- return static_cast<uint64>(-1);
+ return static_cast<uint64_t>(-1);
switch(whence) {
case SEEK_SET:
{
// Compute 64-bit offset
- uint64 new_offset = static_cast<uint64>(data->start_pos) + off;
+ uint64_t new_offset = static_cast<uint64_t>(data->start_pos) + off;
// Verify that value does not overflow
ios::off_type offset = static_cast<ios::off_type>(new_offset);
- if (static_cast<uint64>(offset) != new_offset)
- return static_cast<uint64>(-1);
+ if (static_cast<uint64_t>(offset) != new_offset)
+ return static_cast<uint64_t>(-1);
os->seekp(offset, ios::beg);
break;
@@ -176,8 +174,8 @@ _tiffosSeekProc(thandle_t fd, uint64 off, int whence)
{
// Verify that value does not overflow
ios::off_type offset = static_cast<ios::off_type>(off);
- if (static_cast<uint64>(offset) != off)
- return static_cast<uint64>(-1);
+ if (static_cast<uint64_t>(offset) != off)
+ return static_cast<uint64_t>(-1);
os->seekp(offset, ios::cur);
break;
@@ -186,8 +184,8 @@ _tiffosSeekProc(thandle_t fd, uint64 off, int whence)
{
// Verify that value does not overflow
ios::off_type offset = static_cast<ios::off_type>(off);
- if (static_cast<uint64>(offset) != off)
- return static_cast<uint64>(-1);
+ if (static_cast<uint64_t>(offset) != off)
+ return static_cast<uint64_t>(-1);
os->seekp(offset, ios::end);
break;
@@ -199,11 +197,7 @@ _tiffosSeekProc(thandle_t fd, uint64 off, int whence)
// ostrstream/ostringstream does. In that situation, add intermediate
// '\0' characters.
if( os->fail() ) {
-#ifdef __VMS
- int old_state;
-#else
ios::iostate old_state;
-#endif
ios::pos_type origin;
old_state = os->rdstate();
@@ -226,28 +220,28 @@ _tiffosSeekProc(thandle_t fd, uint64 off, int whence)
os->clear(old_state);
// only do something if desired seek position is valid
- if( (static_cast<uint64>(origin) + off) > static_cast<uint64>(data->start_pos) ) {
- uint64 num_fill;
+ if((static_cast<uint64_t>(origin) + off) > static_cast<uint64_t>(data->start_pos) ) {
+ uint64_t num_fill;
// clear the fail bit
os->clear(os->rdstate() & ~ios::failbit);
// extend the stream to the expected size
os->seekp(0, ios::end);
- num_fill = (static_cast<uint64>(origin)) + off - os->tellp();
- for( uint64 i = 0; i < num_fill; i++ )
+ num_fill = (static_cast<uint64_t>(origin)) + off - os->tellp();
+ for(uint64_t i = 0; i < num_fill; i++ )
os->put('\0');
// retry the seek
- os->seekp(static_cast<ios::off_type>(static_cast<uint64>(origin) + off), ios::beg);
+ os->seekp(static_cast<ios::off_type>(static_cast<uint64_t>(origin) + off), ios::beg);
}
}
- return static_cast<uint64>(os->tellp());
+ return static_cast<uint64_t>(os->tellp());
}
-static uint64
-_tiffisSeekProc(thandle_t fd, uint64 off, int whence)
+static uint64_t
+_tiffisSeekProc(thandle_t fd, uint64_t off, int whence)
{
tiffis_data *data = reinterpret_cast<tiffis_data *>(fd);
@@ -255,12 +249,12 @@ _tiffisSeekProc(thandle_t fd, uint64 off, int whence)
case SEEK_SET:
{
// Compute 64-bit offset
- uint64 new_offset = static_cast<uint64>(data->start_pos) + off;
+ uint64_t new_offset = static_cast<uint64_t>(data->start_pos) + off;
// Verify that value does not overflow
ios::off_type offset = static_cast<ios::off_type>(new_offset);
- if (static_cast<uint64>(offset) != new_offset)
- return static_cast<uint64>(-1);
+ if (static_cast<uint64_t>(offset) != new_offset)
+ return static_cast<uint64_t>(-1);
data->stream->seekg(offset, ios::beg);
break;
@@ -269,8 +263,8 @@ _tiffisSeekProc(thandle_t fd, uint64 off, int whence)
{
// Verify that value does not overflow
ios::off_type offset = static_cast<ios::off_type>(off);
- if (static_cast<uint64>(offset) != off)
- return static_cast<uint64>(-1);
+ if (static_cast<uint64_t>(offset) != off)
+ return static_cast<uint64_t>(-1);
data->stream->seekg(offset, ios::cur);
break;
@@ -279,18 +273,18 @@ _tiffisSeekProc(thandle_t fd, uint64 off, int whence)
{
// Verify that value does not overflow
ios::off_type offset = static_cast<ios::off_type>(off);
- if (static_cast<uint64>(offset) != off)
- return static_cast<uint64>(-1);
+ if (static_cast<uint64_t>(offset) != off)
+ return static_cast<uint64_t>(-1);
data->stream->seekg(offset, ios::end);
break;
}
}
- return (uint64) (data->stream->tellg() - data->start_pos);
+ return (uint64_t) (data->stream->tellg() - data->start_pos);
}
-static uint64
+static uint64_t
_tiffosSizeProc(thandle_t fd)
{
tiffos_data *data = reinterpret_cast<tiffos_data *>(fd);
@@ -302,10 +296,10 @@ _tiffosSizeProc(thandle_t fd)
len = os->tellp();
os->seekp(pos);
- return (uint64) len;
+ return (uint64_t) len;
}
-static uint64
+static uint64_t
_tiffisSizeProc(thandle_t fd)
{
tiffis_data *data = reinterpret_cast<tiffis_data *>(fd);
@@ -316,7 +310,7 @@ _tiffisSizeProc(thandle_t fd)
len = data->stream->tellg();
data->stream->seekg(pos);
- return (uint64) len;
+ return (uint64_t) len;
}
static int
diff --git a/tiff/libtiff/tif_strip.c b/tiff/libtiff/tif_strip.c
index c08c60a7..d7b27526 100644
--- a/tiff/libtiff/tif_strip.c
+++ b/tiff/libtiff/tif_strip.c
@@ -32,12 +32,12 @@
/*
* Compute which strip a (row,sample) value is in.
*/
-uint32
-TIFFComputeStrip(TIFF* tif, uint32 row, uint16 sample)
+uint32_t
+TIFFComputeStrip(TIFF* tif, uint32_t row, uint16_t sample)
{
static const char module[] = "TIFFComputeStrip";
TIFFDirectory *td = &tif->tif_dir;
- uint32 strip;
+ uint32_t strip;
strip = row / td->td_rowsperstrip;
if (td->td_planarconfig == PLANARCONFIG_SEPARATE) {
@@ -47,7 +47,7 @@ TIFFComputeStrip(TIFF* tif, uint32 row, uint16 sample)
(unsigned long) sample, (unsigned long) td->td_samplesperpixel);
return (0);
}
- strip += (uint32)sample*td->td_stripsperimage;
+ strip += (uint32_t)sample * td->td_stripsperimage;
}
return (strip);
}
@@ -55,16 +55,16 @@ TIFFComputeStrip(TIFF* tif, uint32 row, uint16 sample)
/*
* Compute how many strips are in an image.
*/
-uint32
+uint32_t
TIFFNumberOfStrips(TIFF* tif)
{
TIFFDirectory *td = &tif->tif_dir;
- uint32 nstrips;
+ uint32_t nstrips;
- nstrips = (td->td_rowsperstrip == (uint32) -1 ? 1 :
- TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
+ nstrips = (td->td_rowsperstrip == (uint32_t) -1 ? 1 :
+ TIFFhowmany_32(td->td_imagelength, td->td_rowsperstrip));
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
- nstrips = _TIFFMultiply32(tif, nstrips, (uint32)td->td_samplesperpixel,
+ nstrips = _TIFFMultiply32(tif, nstrips, (uint32_t)td->td_samplesperpixel,
"TIFFNumberOfStrips");
return (nstrips);
}
@@ -72,12 +72,12 @@ TIFFNumberOfStrips(TIFF* tif)
/*
* Compute the # bytes in a variable height, row-aligned strip.
*/
-uint64
-TIFFVStripSize64(TIFF* tif, uint32 nrows)
+uint64_t
+TIFFVStripSize64(TIFF* tif, uint32_t nrows)
{
static const char module[] = "TIFFVStripSize64";
TIFFDirectory *td = &tif->tif_dir;
- if (nrows==(uint32)(-1))
+ if (nrows==(uint32_t)(-1))
nrows=td->td_imagelength;
if ((td->td_planarconfig==PLANARCONFIG_CONTIG)&&
(td->td_photometric == PHOTOMETRIC_YCBCR)&&
@@ -91,12 +91,12 @@ TIFFVStripSize64(TIFF* tif, uint32 nrows)
* horizontal/vertical subsampling area include
* YCbCr data for the extended image.
*/
- uint16 ycbcrsubsampling[2];
- uint16 samplingblock_samples;
- uint32 samplingblocks_hor;
- uint32 samplingblocks_ver;
- uint64 samplingrow_samples;
- uint64 samplingrow_size;
+ uint16_t ycbcrsubsampling[2];
+ uint16_t samplingblock_samples;
+ uint32_t samplingblocks_hor;
+ uint32_t samplingblocks_ver;
+ uint64_t samplingrow_samples;
+ uint64_t samplingrow_size;
if(td->td_samplesperpixel!=3)
{
TIFFErrorExt(tif->tif_clientdata,module,
@@ -125,10 +125,10 @@ TIFFVStripSize64(TIFF* tif, uint32 nrows)
return(_TIFFMultiply64(tif,nrows,TIFFScanlineSize64(tif),module));
}
tmsize_t
-TIFFVStripSize(TIFF* tif, uint32 nrows)
+TIFFVStripSize(TIFF* tif, uint32_t nrows)
{
static const char module[] = "TIFFVStripSize";
- uint64 m;
+ uint64_t m;
m=TIFFVStripSize64(tif,nrows);
return _TIFFCastUInt64ToSSize(tif, m, module);
}
@@ -136,43 +136,36 @@ TIFFVStripSize(TIFF* tif, uint32 nrows)
/*
* Compute the # bytes in a raw strip.
*/
-uint64
-TIFFRawStripSize64(TIFF* tif, uint32 strip)
+uint64_t
+TIFFRawStripSize64(TIFF* tif, uint32_t strip)
{
static const char module[] = "TIFFRawStripSize64";
- uint64 bytecount = TIFFGetStrileByteCount(tif, strip);
+ uint64_t bytecount = TIFFGetStrileByteCount(tif, strip);
if (bytecount == 0)
{
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
- "%I64u: Invalid strip byte count, strip %lu",
- (unsigned __int64) bytecount,
+ "%"PRIu64": Invalid strip byte count, strip %lu",
+ (uint64_t) bytecount,
(unsigned long) strip);
-#else
- TIFFErrorExt(tif->tif_clientdata, module,
- "%llu: Invalid strip byte count, strip %lu",
- (unsigned long long) bytecount,
- (unsigned long) strip);
-#endif
- bytecount = (uint64) -1;
+ bytecount = (uint64_t) -1;
}
return bytecount;
}
tmsize_t
-TIFFRawStripSize(TIFF* tif, uint32 strip)
+TIFFRawStripSize(TIFF* tif, uint32_t strip)
{
static const char module[] = "TIFFRawStripSize";
- uint64 m;
+ uint64_t m;
tmsize_t n;
m=TIFFRawStripSize64(tif,strip);
- if (m==(uint64)(-1))
+ if (m==(uint64_t)(-1))
n=(tmsize_t)(-1);
else
{
n=(tmsize_t)m;
- if ((uint64)n!=m)
+ if ((uint64_t)n != m)
{
TIFFErrorExt(tif->tif_clientdata,module,"Integer overflow");
n=0;
@@ -189,11 +182,11 @@ TIFFRawStripSize(TIFF* tif, uint32 strip)
* truncated to reflect the actual space required
* to hold the strip.
*/
-uint64
+uint64_t
TIFFStripSize64(TIFF* tif)
{
TIFFDirectory* td = &tif->tif_dir;
- uint32 rps = td->td_rowsperstrip;
+ uint32_t rps = td->td_rowsperstrip;
if (rps > td->td_imagelength)
rps = td->td_imagelength;
return (TIFFVStripSize64(tif, rps));
@@ -202,7 +195,7 @@ tmsize_t
TIFFStripSize(TIFF* tif)
{
static const char module[] = "TIFFStripSize";
- uint64 m;
+ uint64_t m;
m=TIFFStripSize64(tif);
return _TIFFCastUInt64ToSSize(tif, m, module);
}
@@ -213,32 +206,32 @@ TIFFStripSize(TIFF* tif)
* request is <1 then we choose a strip size according
* to certain heuristics.
*/
-uint32
-TIFFDefaultStripSize(TIFF* tif, uint32 request)
+uint32_t
+TIFFDefaultStripSize(TIFF* tif, uint32_t request)
{
return (*tif->tif_defstripsize)(tif, request);
}
-uint32
-_TIFFDefaultStripSize(TIFF* tif, uint32 s)
+uint32_t
+_TIFFDefaultStripSize(TIFF* tif, uint32_t s)
{
- if ((int32) s < 1) {
+ if ((int32_t) s < 1) {
/*
* If RowsPerStrip is unspecified, try to break the
* image up into strips that are approximately
* STRIP_SIZE_DEFAULT bytes long.
*/
- uint64 scanlinesize;
- uint64 rows;
+ uint64_t scanlinesize;
+ uint64_t rows;
scanlinesize=TIFFScanlineSize64(tif);
if (scanlinesize==0)
scanlinesize=1;
- rows=(uint64)STRIP_SIZE_DEFAULT/scanlinesize;
+ rows= (uint64_t)STRIP_SIZE_DEFAULT / scanlinesize;
if (rows==0)
rows=1;
else if (rows>0xFFFFFFFF)
rows=0xFFFFFFFF;
- s=(uint32)rows;
+ s=(uint32_t)rows;
}
return (s);
}
@@ -253,23 +246,23 @@ _TIFFDefaultStripSize(TIFF* tif, uint32 s)
* subsampling lines divided by vertical subsampling. It should thus make
* sense when multiplied by a multiple of vertical subsampling.
*/
-uint64
+uint64_t
TIFFScanlineSize64(TIFF* tif)
{
static const char module[] = "TIFFScanlineSize64";
TIFFDirectory *td = &tif->tif_dir;
- uint64 scanline_size;
+ uint64_t scanline_size;
if (td->td_planarconfig==PLANARCONFIG_CONTIG)
{
if ((td->td_photometric==PHOTOMETRIC_YCBCR)&&
(td->td_samplesperpixel==3)&&
(!isUpSampled(tif)))
{
- uint16 ycbcrsubsampling[2];
- uint16 samplingblock_samples;
- uint32 samplingblocks_hor;
- uint64 samplingrow_samples;
- uint64 samplingrow_size;
+ uint16_t ycbcrsubsampling[2];
+ uint16_t samplingblock_samples;
+ uint32_t samplingblocks_hor;
+ uint64_t samplingrow_samples;
+ uint64_t samplingrow_size;
if(td->td_samplesperpixel!=3)
{
TIFFErrorExt(tif->tif_clientdata,module,
@@ -294,7 +287,7 @@ TIFFScanlineSize64(TIFF* tif)
}
else
{
- uint64 scanline_samples;
+ uint64_t scanline_samples;
scanline_samples=_TIFFMultiply64(tif,td->td_imagewidth,td->td_samplesperpixel,module);
scanline_size=TIFFhowmany_64(_TIFFMultiply64(tif,scanline_samples,td->td_bitspersample,module),8);
}
@@ -314,7 +307,7 @@ tmsize_t
TIFFScanlineSize(TIFF* tif)
{
static const char module[] = "TIFFScanlineSize";
- uint64 m;
+ uint64_t m;
m=TIFFScanlineSize64(tif);
return _TIFFCastUInt64ToSSize(tif, m, module);
}
@@ -325,12 +318,12 @@ TIFFScanlineSize(TIFF* tif)
* I/O size returned by TIFFScanlineSize which may be less
* if data is store as separate planes).
*/
-uint64
+uint64_t
TIFFRasterScanlineSize64(TIFF* tif)
{
static const char module[] = "TIFFRasterScanlineSize64";
TIFFDirectory *td = &tif->tif_dir;
- uint64 scanline;
+ uint64_t scanline;
scanline = _TIFFMultiply64(tif, td->td_bitspersample, td->td_imagewidth, module);
if (td->td_planarconfig == PLANARCONFIG_CONTIG) {
@@ -344,7 +337,7 @@ tmsize_t
TIFFRasterScanlineSize(TIFF* tif)
{
static const char module[] = "TIFFRasterScanlineSize";
- uint64 m;
+ uint64_t m;
m=TIFFRasterScanlineSize64(tif);
return _TIFFCastUInt64ToSSize(tif, m, module);
}
diff --git a/tiff/libtiff/tif_swab.c b/tiff/libtiff/tif_swab.c
index b174ba69..3d4bb6ca 100644
--- a/tiff/libtiff/tif_swab.c
+++ b/tiff/libtiff/tif_swab.c
@@ -31,22 +31,22 @@
#if defined(DISABLE_CHECK_TIFFSWABMACROS) || !defined(TIFFSwabShort)
void
-TIFFSwabShort(uint16* wp)
+TIFFSwabShort(uint16_t* wp)
{
register unsigned char* cp = (unsigned char*) wp;
unsigned char t;
- assert(sizeof(uint16)==2);
+ assert(sizeof(uint16_t) == 2);
t = cp[1]; cp[1] = cp[0]; cp[0] = t;
}
#endif
#if defined(DISABLE_CHECK_TIFFSWABMACROS) || !defined(TIFFSwabLong)
void
-TIFFSwabLong(uint32* lp)
+TIFFSwabLong(uint32_t* lp)
{
register unsigned char* cp = (unsigned char*) lp;
unsigned char t;
- assert(sizeof(uint32)==4);
+ assert(sizeof(uint32_t) == 4);
t = cp[3]; cp[3] = cp[0]; cp[0] = t;
t = cp[2]; cp[2] = cp[1]; cp[1] = t;
}
@@ -54,11 +54,11 @@ TIFFSwabLong(uint32* lp)
#if defined(DISABLE_CHECK_TIFFSWABMACROS) || !defined(TIFFSwabLong8)
void
-TIFFSwabLong8(uint64* lp)
+TIFFSwabLong8(uint64_t* lp)
{
register unsigned char* cp = (unsigned char*) lp;
unsigned char t;
- assert(sizeof(uint64)==8);
+ assert(sizeof(uint64_t) == 8);
t = cp[7]; cp[7] = cp[0]; cp[0] = t;
t = cp[6]; cp[6] = cp[1]; cp[1] = t;
t = cp[5]; cp[5] = cp[2]; cp[2] = t;
@@ -68,11 +68,11 @@ TIFFSwabLong8(uint64* lp)
#if defined(DISABLE_CHECK_TIFFSWABMACROS) || !defined(TIFFSwabArrayOfShort)
void
-TIFFSwabArrayOfShort(register uint16* wp, tmsize_t n)
+TIFFSwabArrayOfShort(register uint16_t* wp, tmsize_t n)
{
register unsigned char* cp;
register unsigned char t;
- assert(sizeof(uint16)==2);
+ assert(sizeof(uint16_t) == 2);
/* XXX unroll loop some */
while (n-- > 0) {
cp = (unsigned char*) wp;
@@ -84,7 +84,7 @@ TIFFSwabArrayOfShort(register uint16* wp, tmsize_t n)
#if defined(DISABLE_CHECK_TIFFSWABMACROS) || !defined(TIFFSwabArrayOfTriples)
void
-TIFFSwabArrayOfTriples(register uint8* tp, tmsize_t n)
+TIFFSwabArrayOfTriples(register uint8_t* tp, tmsize_t n)
{
unsigned char* cp;
unsigned char t;
@@ -100,11 +100,11 @@ TIFFSwabArrayOfTriples(register uint8* tp, tmsize_t n)
#if defined(DISABLE_CHECK_TIFFSWABMACROS) || !defined(TIFFSwabArrayOfLong)
void
-TIFFSwabArrayOfLong(register uint32* lp, tmsize_t n)
+TIFFSwabArrayOfLong(register uint32_t* lp, tmsize_t n)
{
register unsigned char *cp;
register unsigned char t;
- assert(sizeof(uint32)==4);
+ assert(sizeof(uint32_t) == 4);
/* XXX unroll loop some */
while (n-- > 0) {
cp = (unsigned char *)lp;
@@ -117,11 +117,11 @@ TIFFSwabArrayOfLong(register uint32* lp, tmsize_t n)
#if defined(DISABLE_CHECK_TIFFSWABMACROS) || !defined(TIFFSwabArrayOfLong8)
void
-TIFFSwabArrayOfLong8(register uint64* lp, tmsize_t n)
+TIFFSwabArrayOfLong8(register uint64_t* lp, tmsize_t n)
{
register unsigned char *cp;
register unsigned char t;
- assert(sizeof(uint64)==8);
+ assert(sizeof(uint64_t) == 8);
/* XXX unroll loop some */
while (n-- > 0) {
cp = (unsigned char *)lp;
@@ -281,7 +281,7 @@ TIFFGetBitRevTable(int reversed)
}
void
-TIFFReverseBits(uint8* cp, tmsize_t n)
+TIFFReverseBits(uint8_t* cp, tmsize_t n)
{
for (; n > 8; n -= 8) {
cp[0] = TIFFBitRevTable[cp[0]];
diff --git a/tiff/libtiff/tif_thunder.c b/tiff/libtiff/tif_thunder.c
index b56e3c35..3e703d8b 100644
--- a/tiff/libtiff/tif_thunder.c
+++ b/tiff/libtiff/tif_thunder.c
@@ -61,7 +61,7 @@ static const int threebitdeltas[8] = { 0, 1, 2, 3, 0, -3, -2, -1 };
if (npixels++ & 1) \
*op++ |= lastpixel; \
else \
- op[0] = (uint8) (lastpixel << 4); \
+ op[0] = (uint8_t) (lastpixel << 4); \
} \
}
@@ -83,7 +83,7 @@ ThunderSetupDecode(TIFF* tif)
}
static int
-ThunderDecode(TIFF* tif, uint8* op, tmsize_t maxpixels)
+ThunderDecode(TIFF* tif, uint8_t* op, tmsize_t maxpixels)
{
static const char module[] = "ThunderDecode";
register unsigned char *bp;
@@ -112,10 +112,10 @@ ThunderDecode(TIFF* tif, uint8* op, tmsize_t maxpixels)
} else
lastpixel |= lastpixel << 4;
npixels += n;
- if (npixels > maxpixels)
- n -= npixels - maxpixels;
- for (; n > 0; n -= 2)
- *op++ = (uint8) lastpixel;
+ if (npixels < maxpixels) {
+ for (; n > 0; n -= 2)
+ *op++ = (uint8_t) lastpixel;
+ }
if (n == -1)
*--op &= 0xf0;
lastpixel &= 0xf;
@@ -139,24 +139,15 @@ ThunderDecode(TIFF* tif, uint8* op, tmsize_t maxpixels)
break;
}
}
- tif->tif_rawcp = (uint8*) bp;
+ tif->tif_rawcp = (uint8_t*) bp;
tif->tif_rawcc = cc;
if (npixels != maxpixels) {
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
TIFFErrorExt(tif->tif_clientdata, module,
- "%s data at scanline %lu (%I64u != %I64u)",
+ "%s data at scanline %lu (%"PRIu64" != %"PRIu64")",
npixels < maxpixels ? "Not enough" : "Too much",
(unsigned long) tif->tif_row,
- (unsigned __int64) npixels,
- (unsigned __int64) maxpixels);
-#else
- TIFFErrorExt(tif->tif_clientdata, module,
- "%s data at scanline %lu (%llu != %llu)",
- npixels < maxpixels ? "Not enough" : "Too much",
- (unsigned long) tif->tif_row,
- (unsigned long long) npixels,
- (unsigned long long) maxpixels);
-#endif
+ (uint64_t) npixels,
+ (uint64_t) maxpixels);
return (0);
}
@@ -164,10 +155,10 @@ ThunderDecode(TIFF* tif, uint8* op, tmsize_t maxpixels)
}
static int
-ThunderDecodeRow(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s)
+ThunderDecodeRow(TIFF* tif, uint8_t* buf, tmsize_t occ, uint16_t s)
{
static const char module[] = "ThunderDecodeRow";
- uint8* row = buf;
+ uint8_t* row = buf;
(void) s;
if (occ % tif->tif_scanlinesize)
diff --git a/tiff/libtiff/tif_tile.c b/tiff/libtiff/tif_tile.c
index 661cc771..058be9f7 100644
--- a/tiff/libtiff/tif_tile.c
+++ b/tiff/libtiff/tif_tile.c
@@ -32,27 +32,27 @@
/*
* Compute which tile an (x,y,z,s) value is in.
*/
-uint32
-TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s)
+uint32_t
+TIFFComputeTile(TIFF* tif, uint32_t x, uint32_t y, uint32_t z, uint16_t s)
{
TIFFDirectory *td = &tif->tif_dir;
- uint32 dx = td->td_tilewidth;
- uint32 dy = td->td_tilelength;
- uint32 dz = td->td_tiledepth;
- uint32 tile = 1;
+ uint32_t dx = td->td_tilewidth;
+ uint32_t dy = td->td_tilelength;
+ uint32_t dz = td->td_tiledepth;
+ uint32_t tile = 1;
if (td->td_imagedepth == 1)
z = 0;
- if (dx == (uint32) -1)
+ if (dx == (uint32_t) -1)
dx = td->td_imagewidth;
- if (dy == (uint32) -1)
+ if (dy == (uint32_t) -1)
dy = td->td_imagelength;
- if (dz == (uint32) -1)
+ if (dz == (uint32_t) -1)
dz = td->td_imagedepth;
if (dx != 0 && dy != 0 && dz != 0) {
- uint32 xpt = TIFFhowmany_32(td->td_imagewidth, dx);
- uint32 ypt = TIFFhowmany_32(td->td_imagelength, dy);
- uint32 zpt = TIFFhowmany_32(td->td_imagedepth, dz);
+ uint32_t xpt = TIFFhowmany_32(td->td_imagewidth, dx);
+ uint32_t ypt = TIFFhowmany_32(td->td_imagelength, dy);
+ uint32_t zpt = TIFFhowmany_32(td->td_imagedepth, dz);
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
tile = (xpt*ypt*zpt)*s +
@@ -70,7 +70,7 @@ TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s)
* against the image bounds.
*/
int
-TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s)
+TIFFCheckTile(TIFF* tif, uint32_t x, uint32_t y, uint32_t z, uint16_t s)
{
TIFFDirectory *td = &tif->tif_dir;
@@ -109,20 +109,20 @@ TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s)
/*
* Compute how many tiles are in an image.
*/
-uint32
+uint32_t
TIFFNumberOfTiles(TIFF* tif)
{
TIFFDirectory *td = &tif->tif_dir;
- uint32 dx = td->td_tilewidth;
- uint32 dy = td->td_tilelength;
- uint32 dz = td->td_tiledepth;
- uint32 ntiles;
+ uint32_t dx = td->td_tilewidth;
+ uint32_t dy = td->td_tilelength;
+ uint32_t dz = td->td_tiledepth;
+ uint32_t ntiles;
- if (dx == (uint32) -1)
+ if (dx == (uint32_t) -1)
dx = td->td_imagewidth;
- if (dy == (uint32) -1)
+ if (dy == (uint32_t) -1)
dy = td->td_imagelength;
- if (dz == (uint32) -1)
+ if (dz == (uint32_t) -1)
dz = td->td_imagedepth;
ntiles = (dx == 0 || dy == 0 || dz == 0) ? 0 :
_TIFFMultiply32(tif, _TIFFMultiply32(tif, TIFFhowmany_32(td->td_imagewidth, dx),
@@ -138,13 +138,13 @@ TIFFNumberOfTiles(TIFF* tif)
/*
* Compute the # bytes in each row of a tile.
*/
-uint64
+uint64_t
TIFFTileRowSize64(TIFF* tif)
{
static const char module[] = "TIFFTileRowSize64";
TIFFDirectory *td = &tif->tif_dir;
- uint64 rowsize;
- uint64 tilerowsize;
+ uint64_t rowsize;
+ uint64_t tilerowsize;
if (td->td_tilelength == 0)
{
@@ -180,7 +180,7 @@ tmsize_t
TIFFTileRowSize(TIFF* tif)
{
static const char module[] = "TIFFTileRowSize";
- uint64 m;
+ uint64_t m;
m=TIFFTileRowSize64(tif);
return _TIFFCastUInt64ToSSize(tif, m, module);
}
@@ -188,8 +188,8 @@ TIFFTileRowSize(TIFF* tif)
/*
* Compute the # bytes in a variable length, row-aligned tile.
*/
-uint64
-TIFFVTileSize64(TIFF* tif, uint32 nrows)
+uint64_t
+TIFFVTileSize64(TIFF* tif, uint32_t nrows)
{
static const char module[] = "TIFFVTileSize64";
TIFFDirectory *td = &tif->tif_dir;
@@ -209,12 +209,12 @@ TIFFVTileSize64(TIFF* tif, uint32 nrows)
* horizontal/vertical subsampling area include
* YCbCr data for the extended image.
*/
- uint16 ycbcrsubsampling[2];
- uint16 samplingblock_samples;
- uint32 samplingblocks_hor;
- uint32 samplingblocks_ver;
- uint64 samplingrow_samples;
- uint64 samplingrow_size;
+ uint16_t ycbcrsubsampling[2];
+ uint16_t samplingblock_samples;
+ uint32_t samplingblocks_hor;
+ uint32_t samplingblocks_ver;
+ uint64_t samplingrow_samples;
+ uint64_t samplingrow_size;
TIFFGetFieldDefaulted(tif,TIFFTAG_YCBCRSUBSAMPLING,ycbcrsubsampling+0,
ycbcrsubsampling+1);
if ((ycbcrsubsampling[0] != 1 && ycbcrsubsampling[0] != 2 && ycbcrsubsampling[0] != 4)
@@ -237,10 +237,10 @@ TIFFVTileSize64(TIFF* tif, uint32 nrows)
return(_TIFFMultiply64(tif,nrows,TIFFTileRowSize64(tif),module));
}
tmsize_t
-TIFFVTileSize(TIFF* tif, uint32 nrows)
+TIFFVTileSize(TIFF* tif, uint32_t nrows)
{
static const char module[] = "TIFFVTileSize";
- uint64 m;
+ uint64_t m;
m=TIFFVTileSize64(tif,nrows);
return _TIFFCastUInt64ToSSize(tif, m, module);
}
@@ -248,7 +248,7 @@ TIFFVTileSize(TIFF* tif, uint32 nrows)
/*
* Compute the # bytes in a row-aligned tile.
*/
-uint64
+uint64_t
TIFFTileSize64(TIFF* tif)
{
return (TIFFVTileSize64(tif, tif->tif_dir.td_tilelength));
@@ -257,7 +257,7 @@ tmsize_t
TIFFTileSize(TIFF* tif)
{
static const char module[] = "TIFFTileSize";
- uint64 m;
+ uint64_t m;
m=TIFFTileSize64(tif);
return _TIFFCastUInt64ToSSize(tif, m, module);
}
@@ -269,18 +269,18 @@ TIFFTileSize(TIFF* tif)
* to certain heuristics.
*/
void
-TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)
+TIFFDefaultTileSize(TIFF* tif, uint32_t* tw, uint32_t* th)
{
(*tif->tif_deftilesize)(tif, tw, th);
}
void
-_TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th)
+_TIFFDefaultTileSize(TIFF* tif, uint32_t* tw, uint32_t* th)
{
(void) tif;
- if (*(int32*) tw < 1)
+ if (*(int32_t*) tw < 1)
*tw = 256;
- if (*(int32*) th < 1)
+ if (*(int32_t*) th < 1)
*th = 256;
/* roundup to a multiple of 16 per the spec */
if (*tw & 0xf)
diff --git a/tiff/libtiff/tif_unix.c b/tiff/libtiff/tif_unix.c
index bea1ef78..cb543542 100644
--- a/tiff/libtiff/tif_unix.c
+++ b/tiff/libtiff/tif_unix.c
@@ -120,18 +120,18 @@ _tiffWriteProc(thandle_t fd, void* buf, tmsize_t size)
/* return ((tmsize_t) write(fdh.fd, buf, bytes_total)); */
}
-static uint64
-_tiffSeekProc(thandle_t fd, uint64 off, int whence)
+static uint64_t
+_tiffSeekProc(thandle_t fd, uint64_t off, int whence)
{
fd_as_handle_union_t fdh;
_TIFF_off_t off_io = (_TIFF_off_t) off;
- if ((uint64) off_io != off)
+ if ((uint64_t) off_io != off)
{
errno=EINVAL;
- return (uint64) -1; /* this is really gross */
+ return (uint64_t) -1; /* this is really gross */
}
fdh.h = fd;
- return((uint64)_TIFF_lseek_f(fdh.fd,off_io,whence));
+ return((uint64_t)_TIFF_lseek_f(fdh.fd, off_io, whence));
}
static int
@@ -142,7 +142,7 @@ _tiffCloseProc(thandle_t fd)
return(close(fdh.fd));
}
-static uint64
+static uint64_t
_tiffSizeProc(thandle_t fd)
{
_TIFF_stat_s sb;
@@ -151,7 +151,7 @@ _tiffSizeProc(thandle_t fd)
if (_TIFF_fstat_f(fdh.fd,&sb)<0)
return(0);
else
- return((uint64)sb.st_size);
+ return((uint64_t)sb.st_size);
}
#ifdef HAVE_MMAP
@@ -160,9 +160,9 @@ _tiffSizeProc(thandle_t fd)
static int
_tiffMapProc(thandle_t fd, void** pbase, toff_t* psize)
{
- uint64 size64 = _tiffSizeProc(fd);
+ uint64_t size64 = _tiffSizeProc(fd);
tmsize_t sizem = (tmsize_t)size64;
- if (size64 && (uint64)sizem==size64) {
+ if (size64 && (uint64_t)sizem == size64) {
fd_as_handle_union_t fdh;
fdh.h = fd;
*pbase = (void*)
diff --git a/tiff/libtiff/tif_webp.c b/tiff/libtiff/tif_webp.c
index a00478f6..d5b99d35 100644
--- a/tiff/libtiff/tif_webp.c
+++ b/tiff/libtiff/tif_webp.c
@@ -43,13 +43,13 @@
* file using WEBP compression/decompression.
*/
typedef struct {
- uint16 nSamples; /* number of samples per pixel */
+ uint16_t nSamples; /* number of samples per pixel */
int lossless; /* lossy/lossless compression */
int quality_level; /* compression level */
WebPPicture sPicture; /* WebP Picture */
WebPConfig sEncoderConfig; /* WebP encoder config */
- uint8* pBuffer; /* buffer to hold raw data on encoding */
+ uint8_t* pBuffer; /* buffer to hold raw data on encoding */
unsigned int buffer_offset; /* current offset into the buffer */
unsigned int buffer_size;
@@ -67,8 +67,8 @@ typedef struct {
#define DecoderState(tif) LState(tif)
#define EncoderState(tif) LState(tif)
-static int TWebPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
-static int TWebPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);
+static int TWebPEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s);
+static int TWebPDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s);
static
int TWebPDatasetWriter(const uint8_t* data, size_t data_size,
@@ -79,7 +79,7 @@ int TWebPDatasetWriter(const uint8_t* data, size_t data_size,
if ( (tif->tif_rawcc + (tmsize_t)data_size) > tif->tif_rawdatasize ) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Buffer too small by " TIFF_SIZE_FORMAT " bytes.",
+ "Buffer too small by %"TIFF_SIZE_FORMAT" bytes.",
(size_t) (tif->tif_rawcc + data_size - tif->tif_rawdatasize));
return 0;
} else {
@@ -94,7 +94,7 @@ int TWebPDatasetWriter(const uint8_t* data, size_t data_size,
* Encode a chunk of pixels.
*/
static int
-TWebPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+TWebPEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "TWebPEncode";
WebPState *sp = EncoderState(tif);
@@ -103,8 +103,8 @@ TWebPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
assert(sp != NULL);
assert(sp->state == LSTATE_INIT_ENCODE);
- if( (uint64)sp->buffer_offset +
- (uint64)cc > sp->buffer_size )
+ if((uint64_t)sp->buffer_offset +
+ (uint64_t)cc > sp->buffer_size )
{
TIFFErrorExt(tif->tif_clientdata, module,
"Too many bytes to be written");
@@ -120,7 +120,7 @@ TWebPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
}
static int
-TWebPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+TWebPDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "WebPDecode";
VP8StatusCode status = VP8_STATUS_OK;
@@ -159,7 +159,7 @@ TWebPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
buf = WebPIDecGetRGB(sp->psDecoder, &current_y, NULL, NULL, &stride);
if ((buf != NULL) &&
- (occ <= stride * (current_y - sp->last_y))) {
+ (occ <= (tmsize_t)stride * (current_y - sp->last_y))) {
memcpy(op,
buf + (sp->last_y * stride),
occ);
@@ -196,8 +196,8 @@ static int
TWebPSetupDecode(TIFF* tif)
{
static const char module[] = "WebPSetupDecode";
- uint16 nBitsPerSample = tif->tif_dir.td_bitspersample;
- uint16 sampleFormat = tif->tif_dir.td_sampleformat;
+ uint16_t nBitsPerSample = tif->tif_dir.td_bitspersample;
+ uint16_t sampleFormat = tif->tif_dir.td_sampleformat;
WebPState* sp = DecoderState(tif);
assert(sp != NULL);
@@ -248,10 +248,10 @@ TWebPSetupDecode(TIFF* tif)
* Setup state for decoding a strip.
*/
static int
-TWebPPreDecode(TIFF* tif, uint16 s)
+TWebPPreDecode(TIFF* tif, uint16_t s)
{
static const char module[] = "TWebPPreDecode";
- uint32 segment_width, segment_height;
+ uint32_t segment_width, segment_height;
WebPState* sp = DecoderState(tif);
TIFFDirectory* td = &tif->tif_dir;
(void) s;
@@ -313,8 +313,8 @@ static int
TWebPSetupEncode(TIFF* tif)
{
static const char module[] = "WebPSetupEncode";
- uint16 nBitsPerSample = tif->tif_dir.td_bitspersample;
- uint16 sampleFormat = tif->tif_dir.td_sampleformat;
+ uint16_t nBitsPerSample = tif->tif_dir.td_bitspersample;
+ uint16_t sampleFormat = tif->tif_dir.td_sampleformat;
WebPState* sp = EncoderState(tif);
assert(sp != NULL);
@@ -390,10 +390,10 @@ TWebPSetupEncode(TIFF* tif)
* Reset encoding state at the start of a strip.
*/
static int
-TWebPPreEncode(TIFF* tif, uint16 s)
+TWebPPreEncode(TIFF* tif, uint16_t s)
{
static const char module[] = "TWebPPreEncode";
- uint32 segment_width, segment_height;
+ uint32_t segment_width, segment_height;
WebPState *sp = EncoderState(tif);
TIFFDirectory* td = &tif->tif_dir;
@@ -567,7 +567,7 @@ TWebPCleanup(TIFF* tif)
}
static int
-TWebPVSetField(TIFF* tif, uint32 tag, va_list ap)
+TWebPVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
static const char module[] = "WebPVSetField";
WebPState* sp = LState(tif);
@@ -601,7 +601,7 @@ TWebPVSetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-TWebPVGetField(TIFF* tif, uint32 tag, va_list ap)
+TWebPVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
WebPState* sp = LState(tif);
@@ -649,7 +649,7 @@ TIFFInitWebP(TIFF* tif, int scheme)
/*
* Allocate state block so tag methods have storage to record values.
*/
- tif->tif_data = (uint8*) _TIFFmalloc(sizeof(WebPState));
+ tif->tif_data = (uint8_t*) _TIFFmalloc(sizeof(WebPState));
if (tif->tif_data == NULL)
goto bad;
sp = LState(tif);
diff --git a/tiff/libtiff/tif_win32.c b/tiff/libtiff/tif_win32.c
index 89645693..c6ca1519 100644
--- a/tiff/libtiff/tif_win32.c
+++ b/tiff/libtiff/tif_win32.c
@@ -65,18 +65,18 @@ _tiffReadProc(thandle_t fd, void* buf, tmsize_t size)
/* tmsize_t is 64bit on 64bit systems, but the WinAPI ReadFile takes
* 32bit sizes, so we loop through the data in suitable 32bit sized
* chunks */
- uint8* ma;
- uint64 mb;
+ uint8_t* ma;
+ uint64_t mb;
DWORD n;
DWORD o;
tmsize_t p;
- ma=(uint8*)buf;
+ ma=(uint8_t*)buf;
mb=size;
p=0;
while (mb>0)
{
n=0x80000000UL;
- if ((uint64)n>mb)
+ if ((uint64_t)n>mb)
n=(DWORD)mb;
if (!ReadFile(fd,(LPVOID)ma,n,&o,NULL))
return(0);
@@ -95,18 +95,18 @@ _tiffWriteProc(thandle_t fd, void* buf, tmsize_t size)
/* tmsize_t is 64bit on 64bit systems, but the WinAPI WriteFile takes
* 32bit sizes, so we loop through the data in suitable 32bit sized
* chunks */
- uint8* ma;
- uint64 mb;
+ uint8_t* ma;
+ uint64_t mb;
DWORD n;
DWORD o;
tmsize_t p;
- ma=(uint8*)buf;
+ ma=(uint8_t*)buf;
mb=size;
p=0;
while (mb>0)
{
n=0x80000000UL;
- if ((uint64)n>mb)
+ if ((uint64_t)n>mb)
n=(DWORD)mb;
if (!WriteFile(fd,(LPVOID)ma,n,&o,NULL))
return(0);
@@ -119,8 +119,8 @@ _tiffWriteProc(thandle_t fd, void* buf, tmsize_t size)
return(p);
}
-static uint64
-_tiffSeekProc(thandle_t fd, uint64 off, int whence)
+static uint64_t
+_tiffSeekProc(thandle_t fd, uint64_t off, int whence)
{
LARGE_INTEGER offli;
DWORD dwMoveMethod;
@@ -152,7 +152,7 @@ _tiffCloseProc(thandle_t fd)
return (CloseHandle(fd) ? 0 : -1);
}
-static uint64
+static uint64_t
_tiffSizeProc(thandle_t fd)
{
LARGE_INTEGER m;
@@ -185,13 +185,13 @@ _tiffDummyMapProc(thandle_t fd, void** pbase, toff_t* psize)
static int
_tiffMapProc(thandle_t fd, void** pbase, toff_t* psize)
{
- uint64 size;
+ uint64_t size;
tmsize_t sizem;
HANDLE hMapFile;
size = _tiffSizeProc(fd);
sizem = (tmsize_t)size;
- if (!size || (uint64)sizem!=size)
+ if (!size || (uint64_t)sizem!=size)
return (0);
/* By passing in 0 for the maximum file size, it specifies that we
@@ -404,10 +404,6 @@ _TIFFmemcmp(const void* p1, const void* p2, tmsize_t c)
#ifndef _WIN32_WCE
-#if (_MSC_VER < 1500)
-# define vsnprintf _vsnprintf
-#endif
-
static void
Win32WarningHandler(const char* module, const char* fmt, va_list ap)
{
diff --git a/tiff/libtiff/tif_write.c b/tiff/libtiff/tif_write.c
index 3af69ab4..b5ef21d0 100644
--- a/tiff/libtiff/tif_write.c
+++ b/tiff/libtiff/tif_write.c
@@ -40,16 +40,16 @@
((((tif)->tif_flags & TIFF_BUFFERSETUP) && tif->tif_rawdata) || \
TIFFWriteBufferSetup((tif), NULL, (tmsize_t) -1))
-static int TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module);
-static int TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc);
+static int TIFFGrowStrips(TIFF* tif, uint32_t delta, const char* module);
+static int TIFFAppendToStrip(TIFF* tif, uint32_t strip, uint8_t* data, tmsize_t cc);
int
-TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
+TIFFWriteScanline(TIFF* tif, void* buf, uint32_t row, uint16_t sample)
{
static const char module[] = "TIFFWriteScanline";
register TIFFDirectory *td;
int status, imagegrew = 0;
- uint32 strip;
+ uint32_t strip;
if (!WRITECHECKSTRIPS(tif, module))
return (-1);
@@ -166,9 +166,9 @@ TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
}
/* swab if needed - note that source buffer will be altered */
- tif->tif_postdecode( tif, (uint8*) buf, tif->tif_scanlinesize );
+ tif->tif_postdecode(tif, (uint8_t*) buf, tif->tif_scanlinesize );
- status = (*tif->tif_encoderow)(tif, (uint8*) buf,
+ status = (*tif->tif_encoderow)(tif, (uint8_t*) buf,
tif->tif_scanlinesize, sample);
/* we are now poised at the beginning of the next row */
@@ -180,14 +180,14 @@ TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample)
/* more bytes available in the output buffer than the previous byte count, */
/* so that TIFFAppendToStrip() will detect the overflow when it is called the first */
/* time if the new compressed tile is bigger than the older one. (GDAL #4771) */
-static int _TIFFReserveLargeEnoughWriteBuffer(TIFF* tif, uint32 strip_or_tile)
+static int _TIFFReserveLargeEnoughWriteBuffer(TIFF* tif, uint32_t strip_or_tile)
{
TIFFDirectory *td = &tif->tif_dir;
if( td->td_stripbytecount_p[strip_or_tile] > 0 )
{
/* The +1 is to ensure at least one extra bytes */
/* The +4 is because the LZW encoder flushes 4 bytes before the limit */
- uint64 safe_buffer_size = (uint64)(td->td_stripbytecount_p[strip_or_tile] + 1 + 4);
+ uint64_t safe_buffer_size = (uint64_t)(td->td_stripbytecount_p[strip_or_tile] + 1 + 4);
if( tif->tif_rawdatasize <= (tmsize_t)safe_buffer_size )
{
if( !(TIFFWriteBufferSetup(tif, NULL,
@@ -209,11 +209,11 @@ static int _TIFFReserveLargeEnoughWriteBuffer(TIFF* tif, uint32 strip_or_tile)
* NB: Image length must be setup before writing.
*/
tmsize_t
-TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
+TIFFWriteEncodedStrip(TIFF* tif, uint32_t strip, void* data, tmsize_t cc)
{
static const char module[] = "TIFFWriteEncodedStrip";
TIFFDirectory *td = &tif->tif_dir;
- uint16 sample;
+ uint16_t sample;
if (!WRITECHECKSTRIPS(tif, module))
return ((tmsize_t) -1);
@@ -273,26 +273,26 @@ TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
if( td->td_compression == COMPRESSION_NONE )
{
/* swab if needed - note that source buffer will be altered */
- tif->tif_postdecode( tif, (uint8*) data, cc );
+ tif->tif_postdecode(tif, (uint8_t*) data, cc );
if (!isFillOrder(tif, td->td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
- TIFFReverseBits((uint8*) data, cc);
+ TIFFReverseBits((uint8_t*) data, cc);
if (cc > 0 &&
- !TIFFAppendToStrip(tif, strip, (uint8*) data, cc))
+ !TIFFAppendToStrip(tif, strip, (uint8_t*) data, cc))
return ((tmsize_t) -1);
return (cc);
}
- sample = (uint16)(strip / td->td_stripsperimage);
+ sample = (uint16_t)(strip / td->td_stripsperimage);
if (!(*tif->tif_preencode)(tif, sample))
return ((tmsize_t) -1);
/* swab if needed - note that source buffer will be altered */
- tif->tif_postdecode( tif, (uint8*) data, cc );
+ tif->tif_postdecode(tif, (uint8_t*) data, cc );
- if (!(*tif->tif_encodestrip)(tif, (uint8*) data, cc, sample))
+ if (!(*tif->tif_encodestrip)(tif, (uint8_t*) data, cc, sample))
return ((tmsize_t) -1);
if (!(*tif->tif_postencode)(tif))
return ((tmsize_t) -1);
@@ -313,7 +313,7 @@ TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
* NB: Image length must be setup before writing.
*/
tmsize_t
-TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
+TIFFWriteRawStrip(TIFF* tif, uint32_t strip, void* data, tmsize_t cc)
{
static const char module[] = "TIFFWriteRawStrip";
TIFFDirectory *td = &tif->tif_dir;
@@ -352,7 +352,7 @@ TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
return ((tmsize_t) -1);
}
tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip;
- return (TIFFAppendToStrip(tif, strip, (uint8*) data, cc) ?
+ return (TIFFAppendToStrip(tif, strip, (uint8_t*) data, cc) ?
cc : (tmsize_t) -1);
}
@@ -361,7 +361,7 @@ TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc)
* tile is selected by the (x,y,z,s) coordinates.
*/
tmsize_t
-TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
+TIFFWriteTile(TIFF* tif, void* buf, uint32_t x, uint32_t y, uint32_t z, uint16_t s)
{
if (!TIFFCheckTile(tif, x, y, z, s))
return ((tmsize_t)(-1));
@@ -388,12 +388,12 @@ TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s)
* the image on each write (as TIFFWriteScanline does).
*/
tmsize_t
-TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
+TIFFWriteEncodedTile(TIFF* tif, uint32_t tile, void* data, tmsize_t cc)
{
static const char module[] = "TIFFWriteEncodedTile";
TIFFDirectory *td;
- uint16 sample;
- uint32 howmany32;
+ uint16_t sample;
+ uint32_t howmany32;
if (!WRITECHECKTILES(tif, module))
return ((tmsize_t)(-1));
@@ -457,31 +457,31 @@ TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
if( td->td_compression == COMPRESSION_NONE )
{
/* swab if needed - note that source buffer will be altered */
- tif->tif_postdecode( tif, (uint8*) data, cc );
+ tif->tif_postdecode(tif, (uint8_t*) data, cc );
if (!isFillOrder(tif, td->td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
- TIFFReverseBits((uint8*) data, cc);
+ TIFFReverseBits((uint8_t*) data, cc);
if (cc > 0 &&
- !TIFFAppendToStrip(tif, tile, (uint8*) data, cc))
+ !TIFFAppendToStrip(tif, tile, (uint8_t*) data, cc))
return ((tmsize_t) -1);
return (cc);
}
- sample = (uint16)(tile/td->td_stripsperimage);
+ sample = (uint16_t)(tile / td->td_stripsperimage);
if (!(*tif->tif_preencode)(tif, sample))
return ((tmsize_t)(-1));
/* swab if needed - note that source buffer will be altered */
- tif->tif_postdecode( tif, (uint8*) data, cc );
+ tif->tif_postdecode(tif, (uint8_t*) data, cc );
- if (!(*tif->tif_encodetile)(tif, (uint8*) data, cc, sample))
+ if (!(*tif->tif_encodetile)(tif, (uint8_t*) data, cc, sample))
return ((tmsize_t) -1);
if (!(*tif->tif_postencode)(tif))
return ((tmsize_t)(-1));
if (!isFillOrder(tif, td->td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
- TIFFReverseBits((uint8*)tif->tif_rawdata, tif->tif_rawcc);
+ TIFFReverseBits((uint8_t*)tif->tif_rawdata, tif->tif_rawcc);
if (tif->tif_rawcc > 0 && !TIFFAppendToStrip(tif, tile,
tif->tif_rawdata, tif->tif_rawcc))
return ((tmsize_t)(-1));
@@ -500,7 +500,7 @@ TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
* the image on each write (as TIFFWriteScanline does).
*/
tmsize_t
-TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
+TIFFWriteRawTile(TIFF* tif, uint32_t tile, void* data, tmsize_t cc)
{
static const char module[] = "TIFFWriteRawTile";
@@ -512,7 +512,7 @@ TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc)
(unsigned long) tif->tif_dir.td_nstrips);
return ((tmsize_t)(-1));
}
- return (TIFFAppendToStrip(tif, tile, (uint8*) data, cc) ?
+ return (TIFFAppendToStrip(tif, tile, (uint8_t*) data, cc) ?
cc : (tmsize_t)(-1));
}
@@ -542,11 +542,11 @@ TIFFSetupStrips(TIFF* tif)
}
if (td->td_planarconfig == PLANARCONFIG_SEPARATE)
td->td_stripsperimage /= td->td_samplesperpixel;
- td->td_stripoffset_p = (uint64 *)
- _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64),
+ td->td_stripoffset_p = (uint64_t *)
+ _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64_t),
"for \"StripOffsets\" array");
- td->td_stripbytecount_p = (uint64 *)
- _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64),
+ td->td_stripbytecount_p = (uint64_t *)
+ _TIFFCheckMalloc(tif, td->td_nstrips, sizeof (uint64_t),
"for \"StripByteCounts\" array");
if (td->td_stripoffset_p == NULL || td->td_stripbytecount_p == NULL)
return (0);
@@ -554,8 +554,8 @@ TIFFSetupStrips(TIFF* tif)
* Place data at the end-of-file
* (by setting offsets to zero).
*/
- _TIFFmemset(td->td_stripoffset_p, 0, td->td_nstrips*sizeof (uint64));
- _TIFFmemset(td->td_stripbytecount_p, 0, td->td_nstrips*sizeof (uint64));
+ _TIFFmemset(td->td_stripoffset_p, 0, td->td_nstrips*sizeof (uint64_t));
+ _TIFFmemset(td->td_stripbytecount_p, 0, td->td_nstrips*sizeof (uint64_t));
TIFFSetFieldBit(tif, FIELD_STRIPOFFSETS);
TIFFSetFieldBit(tif, FIELD_STRIPBYTECOUNTS);
return (1);
@@ -688,7 +688,7 @@ TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size)
tif->tif_flags |= TIFF_MYBUFFER;
} else
tif->tif_flags &= ~TIFF_MYBUFFER;
- tif->tif_rawdata = (uint8*) bp;
+ tif->tif_rawdata = (uint8_t*) bp;
tif->tif_rawdatasize = size;
tif->tif_rawcc = 0;
tif->tif_rawcp = tif->tif_rawdata;
@@ -700,17 +700,17 @@ TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size)
* Grow the strip data structures by delta strips.
*/
static int
-TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module)
+TIFFGrowStrips(TIFF* tif, uint32_t delta, const char* module)
{
TIFFDirectory *td = &tif->tif_dir;
- uint64* new_stripoffset;
- uint64* new_stripbytecount;
+ uint64_t* new_stripoffset;
+ uint64_t* new_stripbytecount;
assert(td->td_planarconfig == PLANARCONFIG_CONTIG);
- new_stripoffset = (uint64*)_TIFFrealloc(td->td_stripoffset_p,
- (td->td_nstrips + delta) * sizeof (uint64));
- new_stripbytecount = (uint64*)_TIFFrealloc(td->td_stripbytecount_p,
- (td->td_nstrips + delta) * sizeof (uint64));
+ new_stripoffset = (uint64_t*)_TIFFrealloc(td->td_stripoffset_p,
+ (td->td_nstrips + delta) * sizeof (uint64_t));
+ new_stripbytecount = (uint64_t*)_TIFFrealloc(td->td_stripbytecount_p,
+ (td->td_nstrips + delta) * sizeof (uint64_t));
if (new_stripoffset == NULL || new_stripbytecount == NULL) {
if (new_stripoffset)
_TIFFfree(new_stripoffset);
@@ -723,9 +723,9 @@ TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module)
td->td_stripoffset_p = new_stripoffset;
td->td_stripbytecount_p = new_stripbytecount;
_TIFFmemset(td->td_stripoffset_p + td->td_nstrips,
- 0, delta*sizeof (uint64));
+ 0, delta*sizeof (uint64_t));
_TIFFmemset(td->td_stripbytecount_p + td->td_nstrips,
- 0, delta*sizeof (uint64));
+ 0, delta*sizeof (uint64_t));
td->td_nstrips += delta;
tif->tif_flags |= TIFF_DIRTYDIRECT;
@@ -736,19 +736,19 @@ TIFFGrowStrips(TIFF* tif, uint32 delta, const char* module)
* Append the data to the specified strip.
*/
static int
-TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc)
+TIFFAppendToStrip(TIFF* tif, uint32_t strip, uint8_t* data, tmsize_t cc)
{
static const char module[] = "TIFFAppendToStrip";
TIFFDirectory *td = &tif->tif_dir;
- uint64 m;
- int64 old_byte_count = -1;
+ uint64_t m;
+ int64_t old_byte_count = -1;
if (td->td_stripoffset_p[strip] == 0 || tif->tif_curoff == 0) {
assert(td->td_nstrips > 0);
if( td->td_stripbytecount_p[strip] != 0
&& td->td_stripoffset_p[strip] != 0
- && td->td_stripbytecount_p[strip] >= (uint64) cc )
+ && td->td_stripbytecount_p[strip] >= (uint64_t) cc )
{
/*
* There is already tile data on disk, and the new tile
@@ -785,8 +785,8 @@ TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc)
m = tif->tif_curoff+cc;
if (!(tif->tif_flags&TIFF_BIGTIFF))
- m = (uint32)m;
- if ((m<tif->tif_curoff)||(m<(uint64)cc))
+ m = (uint32_t)m;
+ if ((m<tif->tif_curoff)||(m<(uint64_t)cc))
{
TIFFErrorExt(tif->tif_clientdata, module, "Maximum TIFF file size exceeded");
return (0);
@@ -799,7 +799,7 @@ TIFFAppendToStrip(TIFF* tif, uint32 strip, uint8* data, tmsize_t cc)
tif->tif_curoff = m;
td->td_stripbytecount_p[strip] += cc;
- if( (int64) td->td_stripbytecount_p[strip] != old_byte_count )
+ if((int64_t) td->td_stripbytecount_p[strip] != old_byte_count )
tif->tif_flags |= TIFF_DIRTYSTRIP;
return (1);
@@ -816,7 +816,7 @@ TIFFFlushData1(TIFF* tif)
if (tif->tif_rawcc > 0 && tif->tif_flags & TIFF_BUF4WRITE ) {
if (!isFillOrder(tif, tif->tif_dir.td_fillorder) &&
(tif->tif_flags & TIFF_NOBITREV) == 0)
- TIFFReverseBits((uint8*)tif->tif_rawdata,
+ TIFFReverseBits((uint8_t*)tif->tif_rawdata,
tif->tif_rawcc);
if (!TIFFAppendToStrip(tif,
isTiled(tif) ? tif->tif_curtile : tif->tif_curstrip,
diff --git a/tiff/libtiff/tif_zip.c b/tiff/libtiff/tif_zip.c
index e71c312c..be35e49b 100644
--- a/tiff/libtiff/tif_zip.c
+++ b/tiff/libtiff/tif_zip.c
@@ -85,8 +85,8 @@ typedef struct {
#define DecoderState(tif) ZState(tif)
#define EncoderState(tif) ZState(tif)
-static int ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
-static int ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);
+static int ZIPEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s);
+static int ZIPDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s);
static int
ZIPFixupTags(TIFF* tif)
@@ -126,7 +126,7 @@ ZIPSetupDecode(TIFF* tif)
* Setup state for decoding a strip.
*/
static int
-ZIPPreDecode(TIFF* tif, uint16 s)
+ZIPPreDecode(TIFF* tif, uint16_t s)
{
ZIPState* sp = DecoderState(tif);
@@ -144,12 +144,12 @@ ZIPPreDecode(TIFF* tif, uint16 s)
we need to simplify this code to reflect a ZLib that is likely updated
to deal with 8byte memory sizes, though this code will respond
appropriately even before we simplify it */
- sp->stream.avail_in = (uint64)tif->tif_rawcc < 0xFFFFFFFFU ? (uInt) tif->tif_rawcc : 0xFFFFFFFFU;
+ sp->stream.avail_in = (uint64_t)tif->tif_rawcc < 0xFFFFFFFFU ? (uInt) tif->tif_rawcc : 0xFFFFFFFFU;
return (inflateReset(&sp->stream) == Z_OK);
}
static int
-ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+ZIPDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "ZIPDecode";
ZIPState* sp = DecoderState(tif);
@@ -174,20 +174,20 @@ ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
/* Check if we are in the situation where we can use libdeflate */
if (isTiled(tif)) {
- if( TIFFTileSize64(tif) != (uint64)occ )
+ if( TIFFTileSize64(tif) != (uint64_t)occ )
break;
} else {
- uint32 strip_height = td->td_imagelength - tif->tif_row;
+ uint32_t strip_height = td->td_imagelength - tif->tif_row;
if (strip_height > td->td_rowsperstrip)
strip_height = td->td_rowsperstrip;
- if( TIFFVStripSize64(tif, strip_height) != (uint64)occ )
+ if( TIFFVStripSize64(tif, strip_height) != (uint64_t)occ )
break;
}
/* Check for overflow */
- if( (size_t)tif->tif_rawcc != (uint64)tif->tif_rawcc )
+ if( (size_t)tif->tif_rawcc != (uint64_t)tif->tif_rawcc )
break;
- if( (size_t)occ != (uint64)occ )
+ if( (size_t)occ != (uint64_t)occ )
break;
/* Go for decompression using libdeflate */
@@ -238,8 +238,8 @@ ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
appropriately even before we simplify it */
do {
int state;
- uInt avail_in_before = (uint64)tif->tif_rawcc <= 0xFFFFFFFFU ? (uInt)tif->tif_rawcc : 0xFFFFFFFFU;
- uInt avail_out_before = (uint64)occ < 0xFFFFFFFFU ? (uInt) occ : 0xFFFFFFFFU;
+ uInt avail_in_before = (uint64_t)tif->tif_rawcc <= 0xFFFFFFFFU ? (uInt)tif->tif_rawcc : 0xFFFFFFFFU;
+ uInt avail_out_before = (uint64_t)occ < 0xFFFFFFFFU ? (uInt) occ : 0xFFFFFFFFU;
sp->stream.avail_in = avail_in_before;
sp->stream.avail_out = avail_out_before;
state = inflate(&sp->stream, Z_PARTIAL_FLUSH);
@@ -261,8 +261,8 @@ ZIPDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
} while (occ > 0);
if (occ != 0) {
TIFFErrorExt(tif->tif_clientdata, module,
- "Not enough data at scanline %lu (short " TIFF_UINT64_FORMAT " bytes)",
- (unsigned long) tif->tif_row, (TIFF_UINT64_T) occ);
+ "Not enough data at scanline %lu (short %" PRIu64 " bytes)",
+ (unsigned long) tif->tif_row, (uint64_t) occ);
return (0);
}
@@ -301,7 +301,7 @@ ZIPSetupEncode(TIFF* tif)
* Reset encoding state at the start of a strip.
*/
static int
-ZIPPreEncode(TIFF* tif, uint16 s)
+ZIPPreEncode(TIFF* tif, uint16_t s)
{
ZIPState *sp = EncoderState(tif);
@@ -318,7 +318,7 @@ ZIPPreEncode(TIFF* tif, uint16 s)
we need to simplify this code to reflect a ZLib that is likely updated
to deal with 8byte memory sizes, though this code will respond
appropriately even before we simplify it */
- sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
+ sp->stream.avail_out = (uint64_t)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
return (deflateReset(&sp->stream) == Z_OK);
}
@@ -326,7 +326,7 @@ ZIPPreEncode(TIFF* tif, uint16 s)
* Encode a chunk of pixels.
*/
static int
-ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+ZIPEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "ZIPEncode";
ZIPState *sp = EncoderState(tif);
@@ -356,20 +356,20 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
/* Check if we are in the situation where we can use libdeflate */
if (isTiled(tif)) {
- if( TIFFTileSize64(tif) != (uint64)cc )
+ if( TIFFTileSize64(tif) != (uint64_t)cc )
break;
} else {
- uint32 strip_height = td->td_imagelength - tif->tif_row;
+ uint32_t strip_height = td->td_imagelength - tif->tif_row;
if (strip_height > td->td_rowsperstrip)
strip_height = td->td_rowsperstrip;
- if( TIFFVStripSize64(tif, strip_height) != (uint64)cc )
+ if( TIFFVStripSize64(tif, strip_height) != (uint64_t)cc )
break;
}
/* Check for overflow */
- if( (size_t)tif->tif_rawdatasize != (uint64)tif->tif_rawdatasize )
+ if( (size_t)tif->tif_rawdatasize != (uint64_t)tif->tif_rawdatasize )
break;
- if( (size_t)cc != (uint64)cc )
+ if( (size_t)cc != (uint64_t)cc )
break;
/* Go for compression using libdeflate */
@@ -430,7 +430,7 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
to deal with 8byte memory sizes, though this code will respond
appropriately even before we simplify it */
do {
- uInt avail_in_before = (uint64)cc <= 0xFFFFFFFFU ? (uInt)cc : 0xFFFFFFFFU;
+ uInt avail_in_before = (uint64_t)cc <= 0xFFFFFFFFU ? (uInt)cc : 0xFFFFFFFFU;
sp->stream.avail_in = avail_in_before;
if (deflate(&sp->stream, Z_NO_FLUSH) != Z_OK) {
TIFFErrorExt(tif->tif_clientdata, module,
@@ -443,7 +443,7 @@ ZIPEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
if (!TIFFFlushData1(tif))
return 0;
sp->stream.next_out = tif->tif_rawdata;
- sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
+ sp->stream.avail_out = (uint64_t)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
}
cc -= (avail_in_before - sp->stream.avail_in);
} while (cc > 0);
@@ -478,7 +478,7 @@ ZIPPostEncode(TIFF* tif)
if (!TIFFFlushData1(tif))
return 0;
sp->stream.next_out = tif->tif_rawdata;
- sp->stream.avail_out = (uint64)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
+ sp->stream.avail_out = (uint64_t)tif->tif_rawdatasize <= 0xFFFFFFFFU ? (uInt)tif->tif_rawdatasize : 0xFFFFFFFFU;
}
break;
default:
@@ -524,7 +524,7 @@ ZIPCleanup(TIFF* tif)
}
static int
-ZIPVSetField(TIFF* tif, uint32 tag, va_list ap)
+ZIPVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
static const char module[] = "ZIPVSetField";
ZIPState* sp = ZState(tif);
@@ -588,7 +588,7 @@ ZIPVSetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-ZIPVGetField(TIFF* tif, uint32 tag, va_list ap)
+ZIPVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
ZIPState* sp = ZState(tif);
@@ -636,7 +636,7 @@ TIFFInitZIP(TIFF* tif, int scheme)
/*
* Allocate state block so tag methods have storage to record values.
*/
- tif->tif_data = (uint8*) _TIFFcalloc(sizeof (ZIPState), 1);
+ tif->tif_data = (uint8_t*) _TIFFcalloc(sizeof (ZIPState), 1);
if (tif->tif_data == NULL)
goto bad;
sp = ZState(tif);
diff --git a/tiff/libtiff/tif_zstd.c b/tiff/libtiff/tif_zstd.c
index 66135e03..14ac0811 100644
--- a/tiff/libtiff/tif_zstd.c
+++ b/tiff/libtiff/tif_zstd.c
@@ -57,8 +57,8 @@ typedef struct {
#define DecoderState(tif) LState(tif)
#define EncoderState(tif) LState(tif)
-static int ZSTDEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s);
-static int ZSTDDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s);
+static int ZSTDEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s);
+static int ZSTDDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s);
static int
ZSTDFixupTags(TIFF* tif)
@@ -89,7 +89,7 @@ ZSTDSetupDecode(TIFF* tif)
* Setup state for decoding a strip.
*/
static int
-ZSTDPreDecode(TIFF* tif, uint16 s)
+ZSTDPreDecode(TIFF* tif, uint16_t s)
{
static const char module[] = "ZSTDPreDecode";
ZSTDState* sp = DecoderState(tif);
@@ -125,7 +125,7 @@ ZSTDPreDecode(TIFF* tif, uint16 s)
}
static int
-ZSTDDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s)
+ZSTDDecode(TIFF* tif, uint8_t* op, tmsize_t occ, uint16_t s)
{
static const char module[] = "ZSTDDecode";
ZSTDState* sp = DecoderState(tif);
@@ -192,7 +192,7 @@ ZSTDSetupEncode(TIFF* tif)
* Reset encoding state at the start of a strip.
*/
static int
-ZSTDPreEncode(TIFF* tif, uint16 s)
+ZSTDPreEncode(TIFF* tif, uint16_t s)
{
static const char module[] = "ZSTDPreEncode";
ZSTDState *sp = EncoderState(tif);
@@ -233,7 +233,7 @@ ZSTDPreEncode(TIFF* tif, uint16 s)
* Encode a chunk of pixels.
*/
static int
-ZSTDEncode(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
+ZSTDEncode(TIFF* tif, uint8_t* bp, tmsize_t cc, uint16_t s)
{
static const char module[] = "ZSTDEncode";
ZSTDState *sp = EncoderState(tif);
@@ -326,7 +326,7 @@ ZSTDCleanup(TIFF* tif)
}
static int
-ZSTDVSetField(TIFF* tif, uint32 tag, va_list ap)
+ZSTDVSetField(TIFF* tif, uint32_t tag, va_list ap)
{
static const char module[] = "ZSTDVSetField";
ZSTDState* sp = LState(tif);
@@ -349,7 +349,7 @@ ZSTDVSetField(TIFF* tif, uint32 tag, va_list ap)
}
static int
-ZSTDVGetField(TIFF* tif, uint32 tag, va_list ap)
+ZSTDVGetField(TIFF* tif, uint32_t tag, va_list ap)
{
ZSTDState* sp = LState(tif);
@@ -375,6 +375,7 @@ TIFFInitZSTD(TIFF* tif, int scheme)
static const char module[] = "TIFFInitZSTD";
ZSTDState* sp;
+ (void) scheme;
assert( scheme == COMPRESSION_ZSTD );
/*
@@ -389,7 +390,7 @@ TIFFInitZSTD(TIFF* tif, int scheme)
/*
* Allocate state block so tag methods have storage to record values.
*/
- tif->tif_data = (uint8*) _TIFFmalloc(sizeof(ZSTDState));
+ tif->tif_data = (uint8_t*) _TIFFmalloc(sizeof(ZSTDState));
if (tif->tif_data == NULL)
goto bad;
sp = LState(tif);
diff --git a/tiff/libtiff/tiff.h b/tiff/libtiff/tiff.h
index 2d4a4767..bd79270c 100644
--- a/tiff/libtiff/tiff.h
+++ b/tiff/libtiff/tiff.h
@@ -56,24 +56,37 @@
/*
* Intrinsic data types required by the file format:
*
- * 8-bit quantities int8/uint8
- * 16-bit quantities int16/uint16
- * 32-bit quantities int32/uint32
- * 64-bit quantities int64/uint64
+ * 8-bit quantities int8_t/uint_8_t
+ * 16-bit quantities int16_t/uint_16_t
+ * 32-bit quantities int32_t/uint_32_t
+ * 64-bit quantities int64_t/uint_64_t
* strings unsigned char*
*/
+#ifdef __GNUC__
+#define TIFF_GCC_DEPRECATED __attribute__((deprecated))
+#else
+#define TIFF_GCC_DEPRECATED
+#endif
+#ifdef _MSC_VER
+#define TIFF_MSC_DEPRECATED __declspec(deprecated("libtiff type deprecated; please use corresponding C99 stdint.h type"))
+#else
+#define TIFF_MSC_DEPRECATED
+#endif
-typedef TIFF_INT8_T int8;
-typedef TIFF_UINT8_T uint8;
+#ifndef TIFF_DISABLE_DEPRECATED
+typedef TIFF_MSC_DEPRECATED int8_t int8 TIFF_GCC_DEPRECATED;
+typedef TIFF_MSC_DEPRECATED uint8_t uint8 TIFF_GCC_DEPRECATED;
-typedef TIFF_INT16_T int16;
-typedef TIFF_UINT16_T uint16;
+typedef TIFF_MSC_DEPRECATED int16_t int16 TIFF_GCC_DEPRECATED;
+typedef TIFF_MSC_DEPRECATED uint16_t uint16 TIFF_GCC_DEPRECATED;
-typedef TIFF_INT32_T int32;
-typedef TIFF_UINT32_T uint32;
+typedef TIFF_MSC_DEPRECATED int32_t int32 TIFF_GCC_DEPRECATED;
+typedef TIFF_MSC_DEPRECATED uint32_t uint32 TIFF_GCC_DEPRECATED;
+
+typedef TIFF_MSC_DEPRECATED int64_t int64 TIFF_GCC_DEPRECATED;
+typedef TIFF_MSC_DEPRECATED uint64_t uint64 TIFF_GCC_DEPRECATED;
+#endif /* TIFF_DISABLE_DEPRECATED */
-typedef TIFF_INT64_T int64;
-typedef TIFF_UINT64_T uint64;
/*
* Some types as promoted in a variable argument list
@@ -89,20 +102,20 @@ typedef int uint16_vap;
* TIFF header.
*/
typedef struct {
- uint16 tiff_magic; /* magic number (defines byte order) */
- uint16 tiff_version; /* TIFF version number */
+ uint16_t tiff_magic; /* magic number (defines byte order) */
+ uint16_t tiff_version; /* TIFF version number */
} TIFFHeaderCommon;
typedef struct {
- uint16 tiff_magic; /* magic number (defines byte order) */
- uint16 tiff_version; /* TIFF version number */
- uint32 tiff_diroff; /* byte offset to first directory */
+ uint16_t tiff_magic; /* magic number (defines byte order) */
+ uint16_t tiff_version; /* TIFF version number */
+ uint32_t tiff_diroff; /* byte offset to first directory */
} TIFFHeaderClassic;
typedef struct {
- uint16 tiff_magic; /* magic number (defines byte order) */
- uint16 tiff_version; /* TIFF version number */
- uint16 tiff_offsetsize; /* size of offsets, should be 8 */
- uint16 tiff_unused; /* unused word, should be 0 */
- uint64 tiff_diroff; /* byte offset to first directory */
+ uint16_t tiff_magic; /* magic number (defines byte order) */
+ uint16_t tiff_version; /* TIFF version number */
+ uint16_t tiff_offsetsize; /* size of offsets, should be 8 */
+ uint16_t tiff_unused; /* unused word, should be 0 */
+ uint64_t tiff_diroff; /* byte offset to first directory */
} TIFFHeaderBig;
@@ -197,6 +210,7 @@ typedef enum {
#define COMPRESSION_LZMA 34925 /* LZMA2 */
#define COMPRESSION_ZSTD 50000 /* ZSTD: WARNING not registered in Adobe-maintained registry */
#define COMPRESSION_WEBP 50001 /* WEBP: WARNING not registered in Adobe-maintained registry */
+#define COMPRESSION_JXL 50002 /* JPEGXL: WARNING not registered in Adobe-maintained registry */
#define TIFFTAG_PHOTOMETRIC 262 /* photometric interpretation */
#define PHOTOMETRIC_MINISWHITE 0 /* min value is white */
#define PHOTOMETRIC_MINISBLACK 1 /* min value is black */
@@ -465,7 +479,7 @@ typedef enum {
#define TIFFTAG_JBIGOPTIONS 34750 /* JBIG options */
#define TIFFTAG_GPSIFD 34853 /* Pointer to GPS private directory */
/* tags 34908-34914 are private tags registered to SGI */
-#define TIFFTAG_FAXRECVPARAMS 34908 /* encoded Class 2 ses. parms */
+#define TIFFTAG_FAXRECVPARAMS 34908 /* encoded Class 2 ses. params */
#define TIFFTAG_FAXSUBADDRESS 34909 /* received SubAddr string */
#define TIFFTAG_FAXRECVTIME 34910 /* receive time (secs) */
#define TIFFTAG_FAXDCS 34911 /* encoded fax ses. params, Table 2/T.30 */
diff --git a/tiff/libtiff/tiffconf.h.cmake.in b/tiff/libtiff/tiffconf.h.cmake.in
index 9b4b0328..66ab3541 100644
--- a/tiff/libtiff/tiffconf.h.cmake.in
+++ b/tiff/libtiff/tiffconf.h.cmake.in
@@ -7,6 +7,12 @@
#ifndef _TIFFCONF_
#define _TIFFCONF_
+
+#include <stddef.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+
/* Signed 16-bit type */
#define TIFF_INT16_T @TIFF_INT16_T@
@@ -31,18 +37,12 @@
/* Unsigned 8-bit type */
#define TIFF_UINT8_T @TIFF_UINT8_T@
-/* Unsigned size type */
-#define TIFF_SIZE_T @TIFF_SIZE_T@
-
/* Signed size type */
#define TIFF_SSIZE_T @TIFF_SSIZE_T@
-/* Pointer difference type */
-#define TIFF_PTRDIFF_T @TIFF_PTRDIFF_T@
-
/* Compatibility stuff. */
-/* Define as 0 or 1 according to the floating point format suported by the
+/* Define as 0 or 1 according to the floating point format supported by the
machine */
#cmakedefine HAVE_IEEEFP 1
@@ -62,6 +62,9 @@
/* Support JBIG compression (requires JBIG-KIT library) */
#cmakedefine JBIG_SUPPORT
+/* Support LERC compression */
+#cmakedefine LERC_SUPPORT 1
+
/* Support LogLuv high dynamic range encoding */
#cmakedefine LOGLUV_SUPPORT 1
@@ -91,7 +94,7 @@
#cmakedefine LIBDEFLATE_SUPPORT 1
/* Support strip chopping (whether or not to convert single-strip uncompressed
- images to mutiple strips of ~8Kb to reduce memory usage) */
+ images to multiple strips of ~8Kb to reduce memory usage) */
#cmakedefine STRIPCHOP_DEFAULT 1
/* Enable SubIFD tag (330) support */
diff --git a/tiff/libtiff/tiffconf.h.in b/tiff/libtiff/tiffconf.h.in
index 9bd6a2de..6703eb0e 100644
--- a/tiff/libtiff/tiffconf.h.in
+++ b/tiff/libtiff/tiffconf.h.in
@@ -7,6 +7,12 @@
#ifndef _TIFFCONF_
#define _TIFFCONF_
+
+#include <stddef.h>
+#include <stdint.h>
+#include <inttypes.h>
+
+
/* Signed 16-bit type */
#undef TIFF_INT16_T
@@ -34,12 +40,9 @@
/* Signed size type */
#undef TIFF_SSIZE_T
-/* Pointer difference type */
-#undef TIFF_PTRDIFF_T
-
/* Compatibility stuff. */
-/* Define as 0 or 1 according to the floating point format suported by the
+/* Define as 0 or 1 according to the floating point format supported by the
machine */
#undef HAVE_IEEEFP
@@ -59,6 +62,9 @@
/* Support JBIG compression (requires JBIG-KIT library) */
#undef JBIG_SUPPORT
+/* Support LERC compression */
+#undef LERC_SUPPORT
+
/* Support LogLuv high dynamic range encoding */
#undef LOGLUV_SUPPORT
@@ -88,7 +94,7 @@
#undef LIBDEFLATE_SUPPORT
/* Support strip chopping (whether or not to convert single-strip uncompressed
- images to mutiple strips of ~8Kb to reduce memory usage) */
+ images to multiple strips of ~8Kb to reduce memory usage) */
#undef STRIPCHOP_DEFAULT
/* Enable SubIFD tag (330) support */
diff --git a/tiff/libtiff/tiffconf.vc.h b/tiff/libtiff/tiffconf.vc.h
index fb37a755..94f637bf 100644
--- a/tiff/libtiff/tiffconf.vc.h
+++ b/tiff/libtiff/tiffconf.vc.h
@@ -142,6 +142,84 @@
#define PHOTOSHOP_SUPPORT
#define IPTC_SUPPORT
+
+typedef char int8_t;
+typedef unsigned char uint8_t;
+typedef short int16_t;
+typedef unsigned short uint16_t;
+typedef int int32_t;
+typedef unsigned int uint32_t;
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+
+#ifndef UINT32_MAX
+#define UINT32_MAX 0xFFFFFFFF
+#endif
+
+#ifndef UINT64_MAX
+#define UINT64_MAX 0xFFFFFFFFFFFFFFFF
+#endif
+
+#ifndef INT64_MAX
+#define INT64_MAX 0x7FFFFFFFFFFFFFFF
+#endif
+
+#ifndef SIZE_MAX
+#if _WIN64
+#define SIZE_MAX UINT64_MAX
+#else
+#define SIZE_MAX UINT32_MAX
+#endif
+#endif
+
+#ifndef PRIu8
+#define PRIu8 "u"
+#endif
+
+#ifndef PRId8
+#define PRId8 "d"
+#endif
+
+#ifndef PRIx8
+#define PRIx8 "x"
+#endif
+
+#ifndef PRIu16
+#define PRIu16 "u"
+#endif
+
+#ifndef PRId16
+#define PRId16 "d"
+#endif
+
+#ifndef PRIx16
+#define PRIx16 "x"
+#endif
+
+#ifndef PRIu32
+#define PRIu32 "u"
+#endif
+
+#ifndef PRId32
+#define PRId32 "d"
+#endif
+
+#ifndef PRIx32
+#define PRIx32 "x"
+#endif
+
+#ifndef PRIu64
+#define PRIu64 "llu"
+#endif
+
+#ifndef PRId64
+#define PRId64 "lld"
+#endif
+
+#ifndef PRIx64
+#define PRIx64 "llx"
+#endif
+
#endif /* _TIFFCONF_ */
/*
* Local Variables:
diff --git a/tiff/libtiff/tiffconf.wince.h b/tiff/libtiff/tiffconf.wince.h
deleted file mode 100644
index 013b0960..00000000
--- a/tiff/libtiff/tiffconf.wince.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Windows CE platform tiffconf.wince.h
- * Created by Mateusz Loskot (mateusz@loskot.net)
- *
- * NOTE: Requires WCELIBCEX library with wceex_* functions,
- * It's an extension to C library on Windows CE platform.
- * For example, HAVE_STDIO_H definition indicates there are
- * following files available:
- * stdio.h - from Windows CE / Windows Mobile SDK
- * wce_stdio.h - from WCELIBCEX library
- */
-
-
-/*
- Configuration defines for installed libtiff.
- This file maintained for backward compatibility. Do not use definitions
- from this file in your programs.
-*/
-
-#ifndef _WIN32_WCE
-# error This version of tif_config.h header is dedicated for Windows CE platform!
-#endif
-
-
-#ifndef _TIFFCONF_
-#define _TIFFCONF_
-
-/* The size of a `int', as computed by sizeof. */
-#define SIZEOF_INT 4
-
-/* Compatibility stuff. */
-
-/* Define as 0 or 1 according to the floating point format suported by the
- machine */
-#define HAVE_IEEEFP 1
-
-/* Set the native cpu bit order (FILLORDER_LSB2MSB or FILLORDER_MSB2LSB) */
-#define HOST_FILLORDER FILLORDER_LSB2MSB
-
-/* Native cpu byte order: 1 if big-endian (Motorola) or 0 if little-endian
- (Intel) */
-#define HOST_BIGENDIAN 0
-
-/* Support CCITT Group 3 & 4 algorithms */
-#define CCITT_SUPPORT 1
-
-/* Support JPEG compression (requires IJG JPEG library) */
-/* #undef JPEG_SUPPORT */
-
-/* Support LogLuv high dynamic range encoding */
-#define LOGLUV_SUPPORT 1
-
-/* Support LZW algorithm */
-#define LZW_SUPPORT 1
-
-/* Support NeXT 2-bit RLE algorithm */
-#define NEXT_SUPPORT 1
-
-/* Support Old JPEG compresson (read contrib/ojpeg/README first! Compilation
- fails with unpatched IJG JPEG library) */
-/* #undef OJPEG_SUPPORT */
-
-/* Support Macintosh PackBits algorithm */
-#define PACKBITS_SUPPORT 1
-
-/* Support Pixar log-format algorithm (requires Zlib) */
-/* #undef PIXARLOG_SUPPORT */
-
-/* Support ThunderScan 4-bit RLE algorithm */
-#define THUNDER_SUPPORT 1
-
-/* Support Deflate compression */
-/* #undef ZIP_SUPPORT */
-
-/* Support strip chopping (whether or not to convert single-strip uncompressed
- images to mutiple strips of ~8Kb to reduce memory usage) */
-#define STRIPCHOP_DEFAULT TIFF_STRIPCHOP
-
-/* Enable SubIFD tag (330) support */
-#define SUBIFD_SUPPORT 1
-
-/* Treat extra sample as alpha (default enabled). The RGBA interface will
- treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many
- packages produce RGBA files but don't mark the alpha properly. */
-#define DEFAULT_EXTRASAMPLE_AS_ALPHA 1
-
-/* Pick up YCbCr subsampling info from the JPEG data stream to support files
- lacking the tag (default enabled). */
-#define CHECK_JPEG_YCBCR_SUBSAMPLING 1
-
-/*
- * Feature support definitions.
- * XXX: These macros are obsoleted. Don't use them in your apps!
- * Macros stays here for backward compatibility and should be always defined.
- */
-#define COLORIMETRY_SUPPORT
-#define YCBCR_SUPPORT
-#define CMYK_SUPPORT
-#define ICC_SUPPORT
-#define PHOTOSHOP_SUPPORT
-#define IPTC_SUPPORT
-
-#endif /* _TIFFCONF_ */
-/*
- * Local Variables:
- * mode: c
- * c-basic-offset: 8
- * fill-column: 78
- * End:
- */
diff --git a/tiff/libtiff/tiffio.h b/tiff/libtiff/tiffio.h
index a4512434..ba6b853b 100644
--- a/tiff/libtiff/tiffio.h
+++ b/tiff/libtiff/tiffio.h
@@ -60,16 +60,18 @@ typedef struct tiff TIFF;
*/
/*
* this is the machine addressing size type, only it's signed, so make it
- * int32 on 32bit machines, int64 on 64bit machines
+ * int32_t on 32bit machines, int64_t on 64bit machines
*/
typedef TIFF_SSIZE_T tmsize_t;
-typedef uint64 toff_t; /* file offset */
+#define TIFF_TMSIZE_T_MAX (tmsize_t)(SIZE_MAX >> 1)
+
+typedef uint64_t toff_t; /* file offset */
/* the following are deprecated and should be replaced by their defining
counterparts */
-typedef uint32 ttag_t; /* directory tag */
-typedef uint16 tdir_t; /* directory index */
-typedef uint16 tsample_t; /* sample number */
-typedef uint32 tstrile_t; /* strip or tile number */
+typedef uint32_t ttag_t; /* directory tag */
+typedef uint16_t tdir_t; /* directory index */
+typedef uint16_t tsample_t; /* sample number */
+typedef uint32_t tstrile_t; /* strip or tile number */
typedef tstrile_t tstrip_t; /* strip number */
typedef tstrile_t ttile_t; /* tile number */
typedef tmsize_t tsize_t; /* i/o size in bytes */
@@ -140,9 +142,9 @@ typedef struct {
float d_YCR; /* Light o/p for reference white */
float d_YCG;
float d_YCB;
- uint32 d_Vrwr; /* Pixel values for ref. white */
- uint32 d_Vrwg;
- uint32 d_Vrwb;
+ uint32_t d_Vrwr; /* Pixel values for ref. white */
+ uint32_t d_Vrwg;
+ uint32_t d_Vrwb;
float d_Y0R; /* Residual light for black pixel */
float d_Y0G;
float d_Y0B;
@@ -155,9 +157,9 @@ typedef struct { /* YCbCr->RGB support */
TIFFRGBValue* clamptab; /* range clamping table */
int* Cr_r_tab;
int* Cb_b_tab;
- int32* Cr_g_tab;
- int32* Cb_g_tab;
- int32* Y_tab;
+ int32_t* Cr_g_tab;
+ int32_t* Cb_g_tab;
+ int32_t* Y_tab;
} TIFFYCbCrToRGB;
typedef struct { /* CIE Lab 1976->RGB support */
@@ -186,11 +188,11 @@ typedef struct _TIFFRGBAImage TIFFRGBAImage;
* and draw the unpacked raster on the display.
*/
typedef void (*tileContigRoutine)
- (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
- unsigned char*);
+ (TIFFRGBAImage*, uint32_t*, uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t,
+ unsigned char*);
typedef void (*tileSeparateRoutine)
- (TIFFRGBAImage*, uint32*, uint32, uint32, uint32, uint32, int32, int32,
- unsigned char*, unsigned char*, unsigned char*, unsigned char*);
+ (TIFFRGBAImage*, uint32_t*, uint32_t, uint32_t, uint32_t, uint32_t, int32_t, int32_t,
+ unsigned char*, unsigned char*, unsigned char*, unsigned char*);
/*
* RGBA-reader state.
*/
@@ -199,18 +201,18 @@ struct _TIFFRGBAImage {
int stoponerr; /* stop on read error */
int isContig; /* data is packed/separate */
int alpha; /* type of alpha data present */
- uint32 width; /* image width */
- uint32 height; /* image height */
- uint16 bitspersample; /* image bits/sample */
- uint16 samplesperpixel; /* image samples/pixel */
- uint16 orientation; /* image orientation */
- uint16 req_orientation; /* requested orientation */
- uint16 photometric; /* image photometric interp */
- uint16* redcmap; /* colormap palette */
- uint16* greencmap;
- uint16* bluecmap;
+ uint32_t width; /* image width */
+ uint32_t height; /* image height */
+ uint16_t bitspersample; /* image bits/sample */
+ uint16_t samplesperpixel; /* image samples/pixel */
+ uint16_t orientation; /* image orientation */
+ uint16_t req_orientation; /* requested orientation */
+ uint16_t photometric; /* image photometric interp */
+ uint16_t* redcmap; /* colormap palette */
+ uint16_t* greencmap;
+ uint16_t* bluecmap;
/* get image data routine */
- int (*get)(TIFFRGBAImage*, uint32*, uint32, uint32);
+ int (*get)(TIFFRGBAImage*, uint32_t*, uint32_t, uint32_t);
/* put decoded strip/tile */
union {
void (*any)(TIFFRGBAImage*);
@@ -218,13 +220,13 @@ struct _TIFFRGBAImage {
tileSeparateRoutine separate;
} put;
TIFFRGBValue* Map; /* sample mapping array */
- uint32** BWmap; /* black&white map */
- uint32** PALmap; /* palette image map */
+ uint32_t** BWmap; /* black&white map */
+ uint32_t** PALmap; /* palette image map */
TIFFYCbCrToRGB* ycbcr; /* YCbCr conversion state */
TIFFCIELabToRGB* cielab; /* CIE L*a*b conversion state */
- uint8* UaToAa; /* Unassociated alpha to associated alpha conversion LUT */
- uint8* Bitdepth16To8; /* LUT for conversion from 16bit to 8bit values */
+ uint8_t* UaToAa; /* Unassociated alpha to associated alpha conversion LUT */
+ uint8_t* Bitdepth16To8; /* LUT for conversion from 16bit to 8bit values */
int row_offset;
int col_offset;
@@ -249,7 +251,7 @@ struct _TIFFRGBAImage {
typedef int (*TIFFInitMethod)(TIFF*, int);
typedef struct {
char* name;
- uint16 scheme;
+ uint16_t scheme;
TIFFInitMethod init;
} TIFFCodec;
@@ -282,10 +284,10 @@ typedef void (*TIFFExtendProc)(TIFF*);
extern const char* TIFFGetVersion(void);
-extern const TIFFCodec* TIFFFindCODEC(uint16);
-extern TIFFCodec* TIFFRegisterCODEC(uint16, const char*, TIFFInitMethod);
+extern const TIFFCodec* TIFFFindCODEC(uint16_t);
+extern TIFFCodec* TIFFRegisterCODEC(uint16_t, const char*, TIFFInitMethod);
extern void TIFFUnRegisterCODEC(TIFFCodec*);
-extern int TIFFIsCODECConfigured(uint16);
+extern int TIFFIsCODECConfigured(uint16_t);
extern TIFFCodec* TIFFGetConfiguredCODECs(void);
/*
@@ -304,31 +306,31 @@ extern void _TIFFfree(void* p);
** Stuff, related to tag handling and creating custom tags.
*/
extern int TIFFGetTagListCount( TIFF * );
-extern uint32 TIFFGetTagListEntry( TIFF *, int tag_index );
+extern uint32_t TIFFGetTagListEntry(TIFF *, int tag_index );
#define TIFF_ANY TIFF_NOTYPE /* for field descriptor searching */
#define TIFF_VARIABLE -1 /* marker for variable length tags */
#define TIFF_SPP -2 /* marker for SamplesPerPixel tags */
-#define TIFF_VARIABLE2 -3 /* marker for uint32 var-length tags */
+#define TIFF_VARIABLE2 -3 /* marker for uint32_t var-length tags */
#define FIELD_CUSTOM 65
typedef struct _TIFFField TIFFField;
typedef struct _TIFFFieldArray TIFFFieldArray;
-extern const TIFFField* TIFFFindField(TIFF *, uint32, TIFFDataType);
-extern const TIFFField* TIFFFieldWithTag(TIFF*, uint32);
+extern const TIFFField* TIFFFindField(TIFF *, uint32_t, TIFFDataType);
+extern const TIFFField* TIFFFieldWithTag(TIFF*, uint32_t);
extern const TIFFField* TIFFFieldWithName(TIFF*, const char *);
-extern uint32 TIFFFieldTag(const TIFFField*);
+extern uint32_t TIFFFieldTag(const TIFFField*);
extern const char* TIFFFieldName(const TIFFField*);
extern TIFFDataType TIFFFieldDataType(const TIFFField*);
extern int TIFFFieldPassCount(const TIFFField*);
extern int TIFFFieldReadCount(const TIFFField*);
extern int TIFFFieldWriteCount(const TIFFField*);
-typedef int (*TIFFVSetMethod)(TIFF*, uint32, va_list);
-typedef int (*TIFFVGetMethod)(TIFF*, uint32, va_list);
+typedef int (*TIFFVSetMethod)(TIFF*, uint32_t, va_list);
+typedef int (*TIFFVGetMethod)(TIFF*, uint32_t, va_list);
typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);
typedef struct {
@@ -345,32 +347,32 @@ extern void TIFFCleanup(TIFF* tif);
extern void TIFFClose(TIFF* tif);
extern int TIFFFlush(TIFF* tif);
extern int TIFFFlushData(TIFF* tif);
-extern int TIFFGetField(TIFF* tif, uint32 tag, ...);
-extern int TIFFVGetField(TIFF* tif, uint32 tag, va_list ap);
-extern int TIFFGetFieldDefaulted(TIFF* tif, uint32 tag, ...);
-extern int TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap);
+extern int TIFFGetField(TIFF* tif, uint32_t tag, ...);
+extern int TIFFVGetField(TIFF* tif, uint32_t tag, va_list ap);
+extern int TIFFGetFieldDefaulted(TIFF* tif, uint32_t tag, ...);
+extern int TIFFVGetFieldDefaulted(TIFF* tif, uint32_t tag, va_list ap);
extern int TIFFReadDirectory(TIFF* tif);
extern int TIFFReadCustomDirectory(TIFF* tif, toff_t diroff, const TIFFFieldArray* infoarray);
extern int TIFFReadEXIFDirectory(TIFF* tif, toff_t diroff);
extern int TIFFReadGPSDirectory(TIFF* tif, toff_t diroff);
-extern uint64 TIFFScanlineSize64(TIFF* tif);
+extern uint64_t TIFFScanlineSize64(TIFF* tif);
extern tmsize_t TIFFScanlineSize(TIFF* tif);
-extern uint64 TIFFRasterScanlineSize64(TIFF* tif);
+extern uint64_t TIFFRasterScanlineSize64(TIFF* tif);
extern tmsize_t TIFFRasterScanlineSize(TIFF* tif);
-extern uint64 TIFFStripSize64(TIFF* tif);
+extern uint64_t TIFFStripSize64(TIFF* tif);
extern tmsize_t TIFFStripSize(TIFF* tif);
-extern uint64 TIFFRawStripSize64(TIFF* tif, uint32 strip);
-extern tmsize_t TIFFRawStripSize(TIFF* tif, uint32 strip);
-extern uint64 TIFFVStripSize64(TIFF* tif, uint32 nrows);
-extern tmsize_t TIFFVStripSize(TIFF* tif, uint32 nrows);
-extern uint64 TIFFTileRowSize64(TIFF* tif);
+extern uint64_t TIFFRawStripSize64(TIFF* tif, uint32_t strip);
+extern tmsize_t TIFFRawStripSize(TIFF* tif, uint32_t strip);
+extern uint64_t TIFFVStripSize64(TIFF* tif, uint32_t nrows);
+extern tmsize_t TIFFVStripSize(TIFF* tif, uint32_t nrows);
+extern uint64_t TIFFTileRowSize64(TIFF* tif);
extern tmsize_t TIFFTileRowSize(TIFF* tif);
-extern uint64 TIFFTileSize64(TIFF* tif);
+extern uint64_t TIFFTileSize64(TIFF* tif);
extern tmsize_t TIFFTileSize(TIFF* tif);
-extern uint64 TIFFVTileSize64(TIFF* tif, uint32 nrows);
-extern tmsize_t TIFFVTileSize(TIFF* tif, uint32 nrows);
-extern uint32 TIFFDefaultStripSize(TIFF* tif, uint32 request);
-extern void TIFFDefaultTileSize(TIFF*, uint32*, uint32*);
+extern uint64_t TIFFVTileSize64(TIFF* tif, uint32_t nrows);
+extern tmsize_t TIFFVTileSize(TIFF* tif, uint32_t nrows);
+extern uint32_t TIFFDefaultStripSize(TIFF* tif, uint32_t request);
+extern void TIFFDefaultTileSize(TIFF*, uint32_t*, uint32_t*);
extern int TIFFFileno(TIFF*);
extern int TIFFSetFileno(TIFF*, int);
extern thandle_t TIFFClientdata(TIFF*);
@@ -389,12 +391,12 @@ extern TIFFCloseProc TIFFGetCloseProc(TIFF*);
extern TIFFSizeProc TIFFGetSizeProc(TIFF*);
extern TIFFMapFileProc TIFFGetMapFileProc(TIFF*);
extern TIFFUnmapFileProc TIFFGetUnmapFileProc(TIFF*);
-extern uint32 TIFFCurrentRow(TIFF*);
-extern uint16 TIFFCurrentDirectory(TIFF*);
-extern uint16 TIFFNumberOfDirectories(TIFF*);
-extern uint64 TIFFCurrentDirOffset(TIFF*);
-extern uint32 TIFFCurrentStrip(TIFF*);
-extern uint32 TIFFCurrentTile(TIFF* tif);
+extern uint32_t TIFFCurrentRow(TIFF*);
+extern uint16_t TIFFCurrentDirectory(TIFF*);
+extern uint16_t TIFFNumberOfDirectories(TIFF*);
+extern uint64_t TIFFCurrentDirOffset(TIFF*);
+extern uint32_t TIFFCurrentStrip(TIFF*);
+extern uint32_t TIFFCurrentTile(TIFF* tif);
extern int TIFFReadBufferSetup(TIFF* tif, void* bp, tmsize_t size);
extern int TIFFWriteBufferSetup(TIFF* tif, void* bp, tmsize_t size);
extern int TIFFSetupStrips(TIFF *);
@@ -405,14 +407,14 @@ extern int TIFFCreateCustomDirectory(TIFF*,const TIFFFieldArray*);
extern int TIFFCreateEXIFDirectory(TIFF*);
extern int TIFFCreateGPSDirectory(TIFF*);
extern int TIFFLastDirectory(TIFF*);
-extern int TIFFSetDirectory(TIFF*, uint16);
-extern int TIFFSetSubDirectory(TIFF*, uint64);
-extern int TIFFUnlinkDirectory(TIFF*, uint16);
-extern int TIFFSetField(TIFF*, uint32, ...);
-extern int TIFFVSetField(TIFF*, uint32, va_list);
-extern int TIFFUnsetField(TIFF*, uint32);
+extern int TIFFSetDirectory(TIFF*, uint16_t);
+extern int TIFFSetSubDirectory(TIFF*, uint64_t);
+extern int TIFFUnlinkDirectory(TIFF*, uint16_t);
+extern int TIFFSetField(TIFF*, uint32_t, ...);
+extern int TIFFVSetField(TIFF*, uint32_t, va_list);
+extern int TIFFUnsetField(TIFF*, uint32_t);
extern int TIFFWriteDirectory(TIFF *);
-extern int TIFFWriteCustomDirectory(TIFF *, uint64 *);
+extern int TIFFWriteCustomDirectory(TIFF *, uint64_t *);
extern int TIFFCheckpointDirectory(TIFF *);
extern int TIFFRewriteDirectory(TIFF *);
extern int TIFFDeferStrileArrayWriting(TIFF *);
@@ -423,26 +425,26 @@ extern void TIFFSetJpegMemFunction(TIFF *, void *(*fn)(thandle_t));
#if defined(c_plusplus) || defined(__cplusplus)
extern void TIFFPrintDirectory(TIFF*, FILE*, long = 0);
-extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);
-extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample = 0);
-extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int = 0);
-extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*,
+extern int TIFFReadScanline(TIFF* tif, void* buf, uint32_t row, uint16_t sample = 0);
+extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32_t row, uint16_t sample = 0);
+extern int TIFFReadRGBAImage(TIFF*, uint32_t, uint32_t, uint32_t*, int = 0);
+extern int TIFFReadRGBAImageOriented(TIFF*, uint32_t, uint32_t, uint32_t*,
int = ORIENTATION_BOTLEFT, int = 0);
#else
extern void TIFFPrintDirectory(TIFF*, FILE*, long);
-extern int TIFFReadScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);
-extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32 row, uint16 sample);
-extern int TIFFReadRGBAImage(TIFF*, uint32, uint32, uint32*, int);
-extern int TIFFReadRGBAImageOriented(TIFF*, uint32, uint32, uint32*, int, int);
+extern int TIFFReadScanline(TIFF* tif, void* buf, uint32_t row, uint16_t sample);
+extern int TIFFWriteScanline(TIFF* tif, void* buf, uint32_t row, uint16_t sample);
+extern int TIFFReadRGBAImage(TIFF*, uint32_t, uint32_t, uint32_t*, int);
+extern int TIFFReadRGBAImageOriented(TIFF*, uint32_t, uint32_t, uint32_t*, int, int);
#endif
-extern int TIFFReadRGBAStrip(TIFF*, uint32, uint32 * );
-extern int TIFFReadRGBATile(TIFF*, uint32, uint32, uint32 * );
-extern int TIFFReadRGBAStripExt(TIFF*, uint32, uint32 *, int stop_on_error );
-extern int TIFFReadRGBATileExt(TIFF*, uint32, uint32, uint32 *, int stop_on_error );
+extern int TIFFReadRGBAStrip(TIFF*, uint32_t, uint32_t * );
+extern int TIFFReadRGBATile(TIFF*, uint32_t, uint32_t, uint32_t * );
+extern int TIFFReadRGBAStripExt(TIFF*, uint32_t, uint32_t *, int stop_on_error );
+extern int TIFFReadRGBATileExt(TIFF*, uint32_t, uint32_t, uint32_t *, int stop_on_error );
extern int TIFFRGBAImageOK(TIFF*, char [1024]);
extern int TIFFRGBAImageBegin(TIFFRGBAImage*, TIFF*, int, char [1024]);
-extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32*, uint32, uint32);
+extern int TIFFRGBAImageGet(TIFFRGBAImage*, uint32_t*, uint32_t, uint32_t);
extern void TIFFRGBAImageEnd(TIFFRGBAImage*);
extern TIFF* TIFFOpen(const char*, const char*);
# ifdef __WIN32__
@@ -466,44 +468,44 @@ extern TIFFErrorHandlerExt TIFFSetErrorHandlerExt(TIFFErrorHandlerExt);
extern TIFFErrorHandler TIFFSetWarningHandler(TIFFErrorHandler);
extern TIFFErrorHandlerExt TIFFSetWarningHandlerExt(TIFFErrorHandlerExt);
extern TIFFExtendProc TIFFSetTagExtender(TIFFExtendProc);
-extern uint32 TIFFComputeTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);
-extern int TIFFCheckTile(TIFF* tif, uint32 x, uint32 y, uint32 z, uint16 s);
-extern uint32 TIFFNumberOfTiles(TIFF*);
-extern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);
-extern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32 x, uint32 y, uint32 z, uint16 s);
-extern uint32 TIFFComputeStrip(TIFF*, uint32, uint16);
-extern uint32 TIFFNumberOfStrips(TIFF*);
-extern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);
-extern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32 strip, void* buf, tmsize_t size);
-extern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);
-extern tmsize_t TIFFReadRawTile(TIFF* tif, uint32 tile, void* buf, tmsize_t size);
-extern int TIFFReadFromUserBuffer(TIFF* tif, uint32 strile,
+extern uint32_t TIFFComputeTile(TIFF* tif, uint32_t x, uint32_t y, uint32_t z, uint16_t s);
+extern int TIFFCheckTile(TIFF* tif, uint32_t x, uint32_t y, uint32_t z, uint16_t s);
+extern uint32_t TIFFNumberOfTiles(TIFF*);
+extern tmsize_t TIFFReadTile(TIFF* tif, void* buf, uint32_t x, uint32_t y, uint32_t z, uint16_t s);
+extern tmsize_t TIFFWriteTile(TIFF* tif, void* buf, uint32_t x, uint32_t y, uint32_t z, uint16_t s);
+extern uint32_t TIFFComputeStrip(TIFF*, uint32_t, uint16_t);
+extern uint32_t TIFFNumberOfStrips(TIFF*);
+extern tmsize_t TIFFReadEncodedStrip(TIFF* tif, uint32_t strip, void* buf, tmsize_t size);
+extern tmsize_t TIFFReadRawStrip(TIFF* tif, uint32_t strip, void* buf, tmsize_t size);
+extern tmsize_t TIFFReadEncodedTile(TIFF* tif, uint32_t tile, void* buf, tmsize_t size);
+extern tmsize_t TIFFReadRawTile(TIFF* tif, uint32_t tile, void* buf, tmsize_t size);
+extern int TIFFReadFromUserBuffer(TIFF* tif, uint32_t strile,
void* inbuf, tmsize_t insize,
void* outbuf, tmsize_t outsize);
-extern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);
-extern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc);
-extern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);
-extern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32 tile, void* data, tmsize_t cc);
+extern tmsize_t TIFFWriteEncodedStrip(TIFF* tif, uint32_t strip, void* data, tmsize_t cc);
+extern tmsize_t TIFFWriteRawStrip(TIFF* tif, uint32_t strip, void* data, tmsize_t cc);
+extern tmsize_t TIFFWriteEncodedTile(TIFF* tif, uint32_t tile, void* data, tmsize_t cc);
+extern tmsize_t TIFFWriteRawTile(TIFF* tif, uint32_t tile, void* data, tmsize_t cc);
extern int TIFFDataWidth(TIFFDataType); /* table of tag datatype widths */
extern void TIFFSetWriteOffset(TIFF* tif, toff_t off);
-extern void TIFFSwabShort(uint16*);
-extern void TIFFSwabLong(uint32*);
-extern void TIFFSwabLong8(uint64*);
+extern void TIFFSwabShort(uint16_t*);
+extern void TIFFSwabLong(uint32_t*);
+extern void TIFFSwabLong8(uint64_t*);
extern void TIFFSwabFloat(float*);
extern void TIFFSwabDouble(double*);
-extern void TIFFSwabArrayOfShort(uint16* wp, tmsize_t n);
-extern void TIFFSwabArrayOfTriples(uint8* tp, tmsize_t n);
-extern void TIFFSwabArrayOfLong(uint32* lp, tmsize_t n);
-extern void TIFFSwabArrayOfLong8(uint64* lp, tmsize_t n);
+extern void TIFFSwabArrayOfShort(uint16_t* wp, tmsize_t n);
+extern void TIFFSwabArrayOfTriples(uint8_t* tp, tmsize_t n);
+extern void TIFFSwabArrayOfLong(uint32_t* lp, tmsize_t n);
+extern void TIFFSwabArrayOfLong8(uint64_t* lp, tmsize_t n);
extern void TIFFSwabArrayOfFloat(float* fp, tmsize_t n);
extern void TIFFSwabArrayOfDouble(double* dp, tmsize_t n);
-extern void TIFFReverseBits(uint8* cp, tmsize_t n);
+extern void TIFFReverseBits(uint8_t* cp, tmsize_t n);
extern const unsigned char* TIFFGetBitRevTable(int);
-extern uint64 TIFFGetStrileOffset(TIFF *tif, uint32 strile);
-extern uint64 TIFFGetStrileByteCount(TIFF *tif, uint32 strile);
-extern uint64 TIFFGetStrileOffsetWithErr(TIFF *tif, uint32 strile, int *pbErr);
-extern uint64 TIFFGetStrileByteCountWithErr(TIFF *tif, uint32 strile, int *pbErr);
+extern uint64_t TIFFGetStrileOffset(TIFF *tif, uint32_t strile);
+extern uint64_t TIFFGetStrileByteCount(TIFF *tif, uint32_t strile);
+extern uint64_t TIFFGetStrileOffsetWithErr(TIFF *tif, uint32_t strile, int *pbErr);
+extern uint64_t TIFFGetStrileByteCountWithErr(TIFF *tif, uint32_t strile, int *pbErr);
#ifdef LOGLUV_PUBLIC
#define U_NEU 0.210526316
@@ -511,34 +513,34 @@ extern uint64 TIFFGetStrileByteCountWithErr(TIFF *tif, uint32 strile, int *pbErr
#define UVSCALE 410.
extern double LogL16toY(int);
extern double LogL10toY(int);
-extern void XYZtoRGB24(float*, uint8*);
+extern void XYZtoRGB24(float*, uint8_t*);
extern int uv_decode(double*, double*, int);
-extern void LogLuv24toXYZ(uint32, float*);
-extern void LogLuv32toXYZ(uint32, float*);
+extern void LogLuv24toXYZ(uint32_t, float*);
+extern void LogLuv32toXYZ(uint32_t, float*);
#if defined(c_plusplus) || defined(__cplusplus)
extern int LogL16fromY(double, int = SGILOGENCODE_NODITHER);
extern int LogL10fromY(double, int = SGILOGENCODE_NODITHER);
extern int uv_encode(double, double, int = SGILOGENCODE_NODITHER);
-extern uint32 LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);
-extern uint32 LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);
+extern uint32_t LogLuv24fromXYZ(float*, int = SGILOGENCODE_NODITHER);
+extern uint32_t LogLuv32fromXYZ(float*, int = SGILOGENCODE_NODITHER);
#else
extern int LogL16fromY(double, int);
extern int LogL10fromY(double, int);
extern int uv_encode(double, double, int);
-extern uint32 LogLuv24fromXYZ(float*, int);
-extern uint32 LogLuv32fromXYZ(float*, int);
+extern uint32_t LogLuv24fromXYZ(float*, int);
+extern uint32_t LogLuv32fromXYZ(float*, int);
#endif
#endif /* LOGLUV_PUBLIC */
extern int TIFFCIELabToRGBInit(TIFFCIELabToRGB*, const TIFFDisplay *, float*);
-extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32, int32, int32,
- float *, float *, float *);
+extern void TIFFCIELabToXYZ(TIFFCIELabToRGB *, uint32_t, int32_t, int32_t,
+ float *, float *, float *);
extern void TIFFXYZToRGB(TIFFCIELabToRGB *, float, float, float,
- uint32 *, uint32 *, uint32 *);
+ uint32_t *, uint32_t *, uint32_t *);
extern int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB*, float*, float*);
-extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32, int32, int32,
- uint32 *, uint32 *, uint32 *);
+extern void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *, uint32_t, int32_t, int32_t,
+ uint32_t *, uint32_t *, uint32_t *);
/****************************************************************************
* O B S O L E T E D I N T E R F A C E S
@@ -557,7 +559,7 @@ typedef struct {
char *field_name; /* ASCII name */
} TIFFFieldInfo;
-extern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32);
+extern int TIFFMergeFieldInfo(TIFF*, const TIFFFieldInfo[], uint32_t);
#if defined(c_plusplus) || defined(__cplusplus)
}
diff --git a/tiff/libtiff/tiffiop.h b/tiff/libtiff/tiffiop.h
index b22acb3c..907c05f4 100644
--- a/tiff/libtiff/tiffiop.h
+++ b/tiff/libtiff/tiffiop.h
@@ -38,9 +38,7 @@
# include <sys/types.h>
#endif
-#ifdef HAVE_STRING_H
-# include <string.h>
-#endif
+#include <string.h>
#ifdef HAVE_ASSERT_H
# include <assert.h>
@@ -48,19 +46,6 @@
# define assert(x)
#endif
-#ifdef HAVE_SEARCH_H
-# include <search.h>
-#else
-extern void *lfind(const void *, const void *, size_t *, size_t,
- int (*)(const void *, const void *));
-#endif
-
-#if !defined(HAVE_SNPRINTF) && !defined(HAVE__SNPRINTF)
-#undef snprintf
-#define snprintf _TIFF_snprintf_f
-extern int snprintf(char* str, size_t size, const char* format, ...);
-#endif
-
#include "tiffio.h"
#include "tif_dir.h"
@@ -77,19 +62,6 @@ extern int snprintf(char* str, size_t size, const char* format, ...);
#define FALSE 0
#endif
-#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
-#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
-
-/*
- * Largest 32-bit unsigned integer value.
- */
-#define TIFF_UINT32_MAX 0xFFFFFFFFU
-
-/*
- * Largest 64-bit unsigned integer value.
- */
-#define TIFF_UINT64_MAX (((uint64)(TIFF_UINT32_MAX)) << 32 | TIFF_UINT32_MAX)
-
typedef struct client_info {
struct client_info *next;
void *data;
@@ -105,18 +77,18 @@ typedef tidataval_t* tidata_t; /* reference to internal image data */
typedef void (*TIFFVoidMethod)(TIFF*);
typedef int (*TIFFBoolMethod)(TIFF*);
-typedef int (*TIFFPreMethod)(TIFF*, uint16);
-typedef int (*TIFFCodeMethod)(TIFF* tif, uint8* buf, tmsize_t size, uint16 sample);
-typedef int (*TIFFSeekMethod)(TIFF*, uint32);
-typedef void (*TIFFPostMethod)(TIFF* tif, uint8* buf, tmsize_t size);
-typedef uint32 (*TIFFStripMethod)(TIFF*, uint32);
-typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*);
+typedef int (*TIFFPreMethod)(TIFF*, uint16_t);
+typedef int (*TIFFCodeMethod)(TIFF* tif, uint8_t* buf, tmsize_t size, uint16_t sample);
+typedef int (*TIFFSeekMethod)(TIFF*, uint32_t);
+typedef void (*TIFFPostMethod)(TIFF* tif, uint8_t* buf, tmsize_t size);
+typedef uint32_t (*TIFFStripMethod)(TIFF*, uint32_t);
+typedef void (*TIFFTileMethod)(TIFF*, uint32_t*, uint32_t*);
struct tiff {
char* tif_name; /* name of open file */
int tif_fd; /* open file descriptor */
int tif_mode; /* open mode (O_*) */
- uint32 tif_flags;
+ uint32_t tif_flags;
#define TIFF_FILLORDER 0x00003U /* natural bit fill order for machine */
#define TIFF_DIRTYHEADER 0x00004U /* header must be written on close */
#define TIFF_DIRTYDIRECT 0x00008U /* current directory must be written */
@@ -143,11 +115,11 @@ struct tiff {
#define TIFF_DEFERSTRILELOAD 0x1000000U /* defer strip/tile offset/bytecount array loading. */
#define TIFF_LAZYSTRILELOAD 0x2000000U /* lazy/ondemand loading of strip/tile offset/bytecount values. Only used if TIFF_DEFERSTRILELOAD is set and in read-only mode */
#define TIFF_CHOPPEDUPARRAYS 0x4000000U /* set when allocChoppedUpStripArrays() has modified strip array */
- uint64 tif_diroff; /* file offset of current directory */
- uint64 tif_nextdiroff; /* file offset of following directory */
- uint64* tif_dirlist; /* list of offsets to already seen directories to prevent IFD looping */
- uint16 tif_dirlistsize; /* number of entries in offset list */
- uint16 tif_dirnumber; /* number of already seen directories */
+ uint64_t tif_diroff; /* file offset of current directory */
+ uint64_t tif_nextdiroff; /* file offset of following directory */
+ uint64_t* tif_dirlist; /* list of offsets to already seen directories to prevent IFD looping */
+ uint16_t tif_dirlistsize; /* number of entries in offset list */
+ uint16_t tif_dirnumber; /* number of already seen directories */
TIFFDirectory tif_dir; /* internal rep of current directory */
TIFFDirectory tif_customdir; /* custom IFDs are separated from the main ones */
union {
@@ -155,18 +127,18 @@ struct tiff {
TIFFHeaderClassic classic;
TIFFHeaderBig big;
} tif_header;
- uint16 tif_header_size; /* file's header block and its length */
- uint32 tif_row; /* current scanline */
- uint16 tif_curdir; /* current directory (index) */
- uint32 tif_curstrip; /* current strip for read/write */
- uint64 tif_curoff; /* current offset for read/write */
- uint64 tif_dataoff; /* current offset for writing dir */
+ uint16_t tif_header_size; /* file's header block and its length */
+ uint32_t tif_row; /* current scanline */
+ uint16_t tif_curdir; /* current directory (index) */
+ uint32_t tif_curstrip; /* current strip for read/write */
+ uint64_t tif_curoff; /* current offset for read/write */
+ uint64_t tif_dataoff; /* current offset for writing dir */
/* SubIFD support */
- uint16 tif_nsubifd; /* remaining subifds to write */
- uint64 tif_subifdoff; /* offset for patching SubIFD link */
+ uint16_t tif_nsubifd; /* remaining subifds to write */
+ uint64_t tif_subifdoff; /* offset for patching SubIFD link */
/* tiling support */
- uint32 tif_col; /* current column (offset by row too) */
- uint32 tif_curtile; /* current tile for read/write */
+ uint32_t tif_col; /* current column (offset by row too) */
+ uint32_t tif_curtile; /* current tile for read/write */
tmsize_t tif_tilesize; /* # of bytes in a tile */
/* compression scheme hooks */
int tif_decodestatus;
@@ -188,18 +160,18 @@ struct tiff {
TIFFVoidMethod tif_cleanup; /* cleanup state routine */
TIFFStripMethod tif_defstripsize; /* calculate/constrain strip size */
TIFFTileMethod tif_deftilesize; /* calculate/constrain tile size */
- uint8* tif_data; /* compression scheme private data */
+ uint8_t* tif_data; /* compression scheme private data */
/* input/output buffering */
tmsize_t tif_scanlinesize; /* # of bytes in a scanline */
tmsize_t tif_scanlineskew; /* scanline skew for reading strips */
- uint8* tif_rawdata; /* raw data buffer */
+ uint8_t* tif_rawdata; /* raw data buffer */
tmsize_t tif_rawdatasize; /* # of bytes in raw data buffer */
tmsize_t tif_rawdataoff; /* rawdata offset within strip */
tmsize_t tif_rawdataloaded;/* amount of data in rawdata */
- uint8* tif_rawcp; /* current spot in raw buffer */
+ uint8_t* tif_rawcp; /* current spot in raw buffer */
tmsize_t tif_rawcc; /* bytes unread from raw buffer */
/* memory-mapped file support */
- uint8* tif_base; /* base of mapped file */
+ uint8_t* tif_base; /* base of mapped file */
tmsize_t tif_size; /* size of mapped file region (bytes, thus tmsize_t) */
TIFFMapFileProc tif_mapproc; /* map file method */
TIFFUnmapFileProc tif_unmapproc; /* unmap file method */
@@ -261,18 +233,18 @@ struct tiff {
(TIFFWriteFile((tif),(buf),(size))==(size))
#endif
-/* NB: the uint32 casts are to silence certain ANSI-C compilers */
-#define TIFFhowmany_32(x, y) (((uint32)x < (0xffffffff - (uint32)(y-1))) ? \
- ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y))) : \
+/* NB: the uint32_t casts are to silence certain ANSI-C compilers */
+#define TIFFhowmany_32(x, y) (((uint32_t)x < (0xffffffff - (uint32_t)(y-1))) ? \
+ ((((uint32_t)(x))+(((uint32_t)(y))-1))/((uint32_t)(y))) : \
0U)
/* Variant of TIFFhowmany_32() that doesn't return 0 if x close to MAXUINT. */
/* Caution: TIFFhowmany_32_maxuint_compat(x,y)*y might overflow */
#define TIFFhowmany_32_maxuint_compat(x, y) \
- (((uint32)(x) / (uint32)(y)) + ((((uint32)(x) % (uint32)(y)) != 0) ? 1 : 0))
-#define TIFFhowmany8_32(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
+ (((uint32_t)(x) / (uint32_t)(y)) + ((((uint32_t)(x) % (uint32_t)(y)) != 0) ? 1 : 0))
+#define TIFFhowmany8_32(x) (((x)&0x07)?((uint32_t)(x)>>3)+1:(uint32_t)(x)>>3)
#define TIFFroundup_32(x, y) (TIFFhowmany_32(x,y)*(y))
-#define TIFFhowmany_64(x, y) ((((uint64)(x))+(((uint64)(y))-1))/((uint64)(y)))
-#define TIFFhowmany8_64(x) (((x)&0x07)?((uint64)(x)>>3)+1:(uint64)(x)>>3)
+#define TIFFhowmany_64(x, y) ((((uint64_t)(x))+(((uint64_t)(y))-1))/((uint64_t)(y)))
+#define TIFFhowmany8_64(x) (((x)&0x07)?((uint64_t)(x)>>3)+1:(uint64_t)(x)>>3)
#define TIFFroundup_64(x, y) (TIFFhowmany_64(x,y)*(y))
/* Safe multiply which returns zero if there is an *unsigned* integer overflow. This macro is not safe for *signed* integer types */
@@ -345,38 +317,38 @@ typedef size_t TIFFIOSize_t;
extern "C" {
#endif
extern int _TIFFgetMode(const char* mode, const char* module);
-extern int _TIFFNoRowEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
-extern int _TIFFNoStripEncode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
-extern int _TIFFNoTileEncode(TIFF*, uint8* pp, tmsize_t cc, uint16 s);
-extern int _TIFFNoRowDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
-extern int _TIFFNoStripDecode(TIFF* tif, uint8* pp, tmsize_t cc, uint16 s);
-extern int _TIFFNoTileDecode(TIFF*, uint8* pp, tmsize_t cc, uint16 s);
-extern void _TIFFNoPostDecode(TIFF* tif, uint8* buf, tmsize_t cc);
-extern int _TIFFNoPreCode(TIFF* tif, uint16 s);
-extern int _TIFFNoSeek(TIFF* tif, uint32 off);
-extern void _TIFFSwab16BitData(TIFF* tif, uint8* buf, tmsize_t cc);
-extern void _TIFFSwab24BitData(TIFF* tif, uint8* buf, tmsize_t cc);
-extern void _TIFFSwab32BitData(TIFF* tif, uint8* buf, tmsize_t cc);
-extern void _TIFFSwab64BitData(TIFF* tif, uint8* buf, tmsize_t cc);
+extern int _TIFFNoRowEncode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s);
+extern int _TIFFNoStripEncode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s);
+extern int _TIFFNoTileEncode(TIFF*, uint8_t* pp, tmsize_t cc, uint16_t s);
+extern int _TIFFNoRowDecode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s);
+extern int _TIFFNoStripDecode(TIFF* tif, uint8_t* pp, tmsize_t cc, uint16_t s);
+extern int _TIFFNoTileDecode(TIFF*, uint8_t* pp, tmsize_t cc, uint16_t s);
+extern void _TIFFNoPostDecode(TIFF* tif, uint8_t* buf, tmsize_t cc);
+extern int _TIFFNoPreCode(TIFF* tif, uint16_t s);
+extern int _TIFFNoSeek(TIFF* tif, uint32_t off);
+extern void _TIFFSwab16BitData(TIFF* tif, uint8_t* buf, tmsize_t cc);
+extern void _TIFFSwab24BitData(TIFF* tif, uint8_t* buf, tmsize_t cc);
+extern void _TIFFSwab32BitData(TIFF* tif, uint8_t* buf, tmsize_t cc);
+extern void _TIFFSwab64BitData(TIFF* tif, uint8_t* buf, tmsize_t cc);
extern int TIFFFlushData1(TIFF* tif);
extern int TIFFDefaultDirectory(TIFF* tif);
extern void _TIFFSetDefaultCompressionState(TIFF* tif);
-extern int _TIFFRewriteField(TIFF *, uint16, TIFFDataType, tmsize_t, void *);
+extern int _TIFFRewriteField(TIFF *, uint16_t, TIFFDataType, tmsize_t, void *);
extern int TIFFSetCompressionScheme(TIFF* tif, int scheme);
extern int TIFFSetDefaultCompressionState(TIFF* tif);
-extern uint32 _TIFFDefaultStripSize(TIFF* tif, uint32 s);
-extern void _TIFFDefaultTileSize(TIFF* tif, uint32* tw, uint32* th);
+extern uint32_t _TIFFDefaultStripSize(TIFF* tif, uint32_t s);
+extern void _TIFFDefaultTileSize(TIFF* tif, uint32_t* tw, uint32_t* th);
extern int _TIFFDataSize(TIFFDataType type);
/*--: Rational2Double: Return size of TIFFSetGetFieldType in bytes. */
extern int _TIFFSetGetFieldSize(TIFFSetGetFieldType setgettype);
-extern void _TIFFsetByteArray(void**, void*, uint32);
+extern void _TIFFsetByteArray(void**, void*, uint32_t);
extern void _TIFFsetString(char**, char*);
-extern void _TIFFsetShortArray(uint16**, uint16*, uint32);
-extern void _TIFFsetLongArray(uint32**, uint32*, uint32);
-extern void _TIFFsetFloatArray(float**, float*, uint32);
-extern void _TIFFsetDoubleArray(double**, double*, uint32);
+extern void _TIFFsetShortArray(uint16_t**, uint16_t*, uint32_t);
+extern void _TIFFsetLongArray(uint32_t**, uint32_t*, uint32_t);
+extern void _TIFFsetFloatArray(float**, float*, uint32_t);
+extern void _TIFFsetDoubleArray(double**, double*, uint32_t);
extern void _TIFFprintAscii(FILE*, const char*);
extern void _TIFFprintAsciiTag(FILE*, const char*, const char*);
@@ -386,30 +358,30 @@ extern TIFFErrorHandler _TIFFerrorHandler;
extern TIFFErrorHandlerExt _TIFFwarningHandlerExt;
extern TIFFErrorHandlerExt _TIFFerrorHandlerExt;
-extern uint32 _TIFFMultiply32(TIFF*, uint32, uint32, const char*);
-extern uint64 _TIFFMultiply64(TIFF*, uint64, uint64, const char*);
+extern uint32_t _TIFFMultiply32(TIFF*, uint32_t, uint32_t, const char*);
+extern uint64_t _TIFFMultiply64(TIFF*, uint64_t, uint64_t, const char*);
extern tmsize_t _TIFFMultiplySSize(TIFF*, tmsize_t, tmsize_t, const char*);
-extern tmsize_t _TIFFCastUInt64ToSSize(TIFF*, uint64, const char*);
+extern tmsize_t _TIFFCastUInt64ToSSize(TIFF*, uint64_t, const char*);
extern void* _TIFFCheckMalloc(TIFF*, tmsize_t, tmsize_t, const char*);
extern void* _TIFFCheckRealloc(TIFF*, void*, tmsize_t, tmsize_t, const char*);
-extern double _TIFFUInt64ToDouble(uint64);
-extern float _TIFFUInt64ToFloat(uint64);
+extern double _TIFFUInt64ToDouble(uint64_t);
+extern float _TIFFUInt64ToFloat(uint64_t);
extern float _TIFFClampDoubleToFloat(double);
extern tmsize_t
-_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32 strip,
+_TIFFReadEncodedStripAndAllocBuffer(TIFF* tif, uint32_t strip,
void **buf, tmsize_t bufsizetoalloc,
tmsize_t size_to_read);
extern tmsize_t
-_TIFFReadEncodedTileAndAllocBuffer(TIFF* tif, uint32 tile,
- void **buf, tmsize_t bufsizetoalloc,
- tmsize_t size_to_read);
+_TIFFReadEncodedTileAndAllocBuffer(TIFF* tif, uint32_t tile,
+ void **buf, tmsize_t bufsizetoalloc,
+ tmsize_t size_to_read);
extern tmsize_t
_TIFFReadTileAndAllocBuffer(TIFF* tif,
void **buf, tmsize_t bufsizetoalloc,
- uint32 x, uint32 y, uint32 z, uint16 s);
+ uint32_t x, uint32_t y, uint32_t z, uint16_t s);
extern int _TIFFSeekOK(TIFF* tif, toff_t off);
extern int TIFFInitDumpMode(TIFF*, int);
@@ -448,6 +420,9 @@ extern int TIFFInitPixarLog(TIFF*, int);
#ifdef LOGLUV_SUPPORT
extern int TIFFInitSGILog(TIFF*, int);
#endif
+#ifdef LERC_SUPPORT
+extern int TIFFInitLERC(TIFF* tif, int);
+#endif
#ifdef LZMA_SUPPORT
extern int TIFFInitLZMA(TIFF*, int);
#endif
@@ -457,11 +432,7 @@ extern int TIFFInitZSTD(TIFF*, int);
#ifdef WEBP_SUPPORT
extern int TIFFInitWebP(TIFF*, int);
#endif
-#ifdef VMS
extern const TIFFCodec _TIFFBuiltinCODECS[];
-#else
-extern TIFFCodec _TIFFBuiltinCODECS[];
-#endif
#if defined(__cplusplus)
}
diff --git a/tiff/libtiff/tiffvers.h b/tiff/libtiff/tiffvers.h
index 0cce798b..dbe55961 100644
--- a/tiff/libtiff/tiffvers.h
+++ b/tiff/libtiff/tiffvers.h
@@ -1,4 +1,4 @@
-#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.2.0\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
+#define TIFFLIB_VERSION_STR "LIBTIFF, Version 4.3.0\nCopyright (c) 1988-1996 Sam Leffler\nCopyright (c) 1991-1996 Silicon Graphics, Inc."
/*
* This define can be used in code that requires
* compilation-related definitions specific to a
@@ -6,4 +6,4 @@
* version checking should be done based on the
* string returned by TIFFGetVersion.
*/
-#define TIFFLIB_VERSION 20201219
+#define TIFFLIB_VERSION 20210416
diff --git a/tiff/m4/libtool.m4 b/tiff/m4/libtool.m4
index a3bc337b..a6d21ae5 100644
--- a/tiff/m4/libtool.m4
+++ b/tiff/m4/libtool.m4
@@ -728,7 +728,6 @@ _LT_CONFIG_SAVE_COMMANDS([
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services.
@@ -1042,8 +1041,8 @@ int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
@@ -1493,7 +1492,7 @@ need_locks=$enable_libtool_lock
m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar}
-: ${AR_FLAGS=cru}
+: ${AR_FLAGS=cr}
_LT_DECL([], [AR], [1], [The archiver])
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
@@ -2887,6 +2886,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
dynamic_linker='GNU/Linux ld.so'
;;
+netbsdelf*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='NetBSD ld.elf_so'
+ ;;
+
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -3546,7 +3557,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
lt_cv_deplibs_check_method=pass_all
;;
-netbsd*)
+netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
else
@@ -4052,7 +4063,8 @@ _LT_EOF
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
@@ -4424,7 +4436,7 @@ m4_if([$1], [CXX], [
;;
esac
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
;;
*qnx* | *nto*)
# QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4692,6 +4704,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
+ # flang / f18. f95 an alias for gfortran or flang on Debian
+ flang* | f18* | f95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
@@ -4936,6 +4954,9 @@ m4_if([$1], [CXX], [
;;
esac
;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
@@ -4998,6 +5019,9 @@ dnl Note also adjust exclude_expsyms for C++ above.
openbsd* | bitrig*)
with_gnu_ld=no
;;
+ linux* | k*bsd*-gnu | gnu*)
+ _LT_TAGVAR(link_all_deplibs, $1)=no
+ ;;
esac
_LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5252,7 +5276,7 @@ _LT_EOF
fi
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
@@ -5773,6 +5797,7 @@ _LT_EOF
if test yes = "$lt_cv_irix_exported_symbol"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
+ _LT_TAGVAR(link_all_deplibs, $1)=no
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
@@ -5794,7 +5819,7 @@ _LT_EOF
esac
;;
- netbsd*)
+ netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
else
@@ -6420,7 +6445,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
else
GXX=no
@@ -6795,7 +6820,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -6860,7 +6885,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
@@ -7199,7 +7224,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
else
# FIXME: insert proper C++ library support
@@ -7283,7 +7308,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
@@ -7294,7 +7319,7 @@ if test yes != "$_lt_caught_CXX_error"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
diff --git a/tiff/man/CMakeLists.txt b/tiff/man/CMakeLists.txt
index be5e2949..ea2998d1 100644
--- a/tiff/man/CMakeLists.txt
+++ b/tiff/man/CMakeLists.txt
@@ -93,5 +93,3 @@ install(FILES ${man1_MANS}
DESTINATION "${CMAKE_INSTALL_FULL_MANDIR}/man1")
install(FILES ${man3_MANS}
DESTINATION "${CMAKE_INSTALL_FULL_MANDIR}/man3")
-
-extra_dist(${man1_MANS} ${man3_MANS})
diff --git a/tiff/man/Makefile.in b/tiff/man/Makefile.in
index 4568bfe7..0ca917e1 100644
--- a/tiff/man/Makefile.in
+++ b/tiff/man/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -122,8 +122,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
@@ -320,6 +322,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/tiff/man/TIFFDataWidth.3tiff b/tiff/man/TIFFDataWidth.3tiff
index efcd39d7..d69cd115 100644
--- a/tiff/man/TIFFDataWidth.3tiff
+++ b/tiff/man/TIFFDataWidth.3tiff
@@ -65,7 +65,7 @@ Currently following data types are supported:
.br
.IR TIFFDataWidth
returns a number of bytes occupied by the item of given type. 0 returned when
-uknown data type supplied.
+unknown data type supplied.
.SH "SEE ALSO"
.BR libtiff (3TIFF),
.PP
diff --git a/tiff/man/TIFFFieldPassCount.3tiff b/tiff/man/TIFFFieldPassCount.3tiff
index ff14c520..45018573 100644
--- a/tiff/man/TIFFFieldPassCount.3tiff
+++ b/tiff/man/TIFFFieldPassCount.3tiff
@@ -48,13 +48,13 @@ or
When a
.I count
is required, it will be of type
-.BR uint32
+.BR uint32_t
when
.BR TIFFFieldReadCount
reports
.BR TIFF_VARIABLE2 ,
and of type
-.BR uint16
+.BR uint16_t
otherwise. (This distinction is critical for use of
.BR TIFFGetField ,
but normally not so for use of
diff --git a/tiff/man/TIFFFieldReadCount.3tiff b/tiff/man/TIFFFieldReadCount.3tiff
index b6a4546c..80bcc6b3 100644
--- a/tiff/man/TIFFFieldReadCount.3tiff
+++ b/tiff/man/TIFFFieldReadCount.3tiff
@@ -38,7 +38,7 @@ but there are some special values:
.br
.BR TIFF_VARIABLE
indicates that a variable number of values is possible; then, a
-.BR uint16
+.BR uint16_t
.I count
argument and a pointer
.I data
@@ -51,7 +51,7 @@ is the same as
except that the
.I count
argument must have type
-.BR uint32 .
+.BR uint32_t .
.br
.BR TIFF_SPP
indicates that the number of arguments is equal to the image's
diff --git a/tiff/man/TIFFFieldTag.3tiff b/tiff/man/TIFFFieldTag.3tiff
index 3d1e83d0..2fe41841 100644
--- a/tiff/man/TIFFFieldTag.3tiff
+++ b/tiff/man/TIFFFieldTag.3tiff
@@ -27,7 +27,7 @@ TIFFFieldTag \- Get TIFF field tag value from field information
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "uint32 TIFFFieldTag(const TIFFField* " fip ")"
+.BI "uint32_t TIFFFieldTag(const TIFFField* " fip ")"
.SH DESCRIPTION
.BR TIFFFieldTag
returns the numeric tag value for a TIFF field.
diff --git a/tiff/man/TIFFFieldWriteCount.3tiff b/tiff/man/TIFFFieldWriteCount.3tiff
index f80290fe..bfc7222c 100644
--- a/tiff/man/TIFFFieldWriteCount.3tiff
+++ b/tiff/man/TIFFFieldWriteCount.3tiff
@@ -38,7 +38,7 @@ but there are some special values:
.br
.BR TIFF_VARIABLE
indicates that a variable number of values is possible; then, a
-.BR uint16
+.BR uint16_t
.I count
argument and a pointer
.I data
@@ -51,7 +51,7 @@ is the same as
except that the
.I count
argument must have type
-.BR uint32 .
+.BR uint32_t .
(On most modern machines, this makes no practical difference, and the
.I count
argument can simply be an
diff --git a/tiff/man/TIFFGetField.3tiff b/tiff/man/TIFFGetField.3tiff
index 431f4ae9..dc158578 100644
--- a/tiff/man/TIFFGetField.3tiff
+++ b/tiff/man/TIFFGetField.3tiff
@@ -103,78 +103,78 @@ meaning of each tag and their possible values.
\fITag Name\fP \fICount\fP \fITypes\fP \fINotes\fP
.sp 5p
TIFFTAG_ARTIST 1 const char**
-TIFFTAG_BADFAXLINES 1 uint32*
-TIFFTAG_BITSPERSAMPLE 1 uint16*
-TIFFTAG_CLEANFAXDATA 1 uint16*
-TIFFTAG_COLORMAP 3 const uint16** 1<<BitsPerSample arrays
-TIFFTAG_COMPRESSION 1 uint16*
-TIFFTAG_CONSECUTIVEBADFAXLINES 1 uint32*
+TIFFTAG_BADFAXLINES 1 uint32_t*
+TIFFTAG_BITSPERSAMPLE 1 uint16_t*
+TIFFTAG_CLEANFAXDATA 1 uint16_t*
+TIFFTAG_COLORMAP 3 const uint16_t** 1<<BitsPerSample arrays
+TIFFTAG_COMPRESSION 1 uint16_t*
+TIFFTAG_CONSECUTIVEBADFAXLINES 1 uint32_t*
TIFFTAG_COPYRIGHT 1 const char**
-TIFFTAG_DATATYPE 1 uint16*
+TIFFTAG_DATATYPE 1 uint16_t*
TIFFTAG_DATETIME 1 const char**
TIFFTAG_DOCUMENTNAME 1 const char**
-TIFFTAG_DOTRANGE 2 uint16*
-TIFFTAG_EXTRASAMPLES 2 uint16*,const uint16** count & types array
+TIFFTAG_DOTRANGE 2 uint16_t*
+TIFFTAG_EXTRASAMPLES 2 uint16_t*,const uint16_t** count & types array
TIFFTAG_FAXFILLFUNC 1 TIFFFaxFillFunc* G3/G4 compression pseudo-tag
TIFFTAG_FAXMODE 1 int* G3/G4 compression pseudo-tag
-TIFFTAG_FILLORDER 1 uint16*
-TIFFTAG_GROUP3OPTIONS 1 uint32*
-TIFFTAG_GROUP4OPTIONS 1 uint32*
-TIFFTAG_HALFTONEHINTS 2 uint16*
+TIFFTAG_FILLORDER 1 uint16_t*
+TIFFTAG_GROUP3OPTIONS 1 uint32_t*
+TIFFTAG_GROUP4OPTIONS 1 uint32_t*
+TIFFTAG_HALFTONEHINTS 2 uint16_t*
TIFFTAG_HOSTCOMPUTER 1 const char**
-TIFFTAG_ICCPROFILE 2 const uint32*,const void** count, profile data
-TIFFTAG_IMAGEDEPTH 1 uint32*
+TIFFTAG_ICCPROFILE 2 const uint32_t*,const void** count, profile data
+TIFFTAG_IMAGEDEPTH 1 uint32_t*
TIFFTAG_IMAGEDESCRIPTION 1 const char**
-TIFFTAG_IMAGELENGTH 1 uint32*
-TIFFTAG_IMAGEWIDTH 1 uint32*
+TIFFTAG_IMAGELENGTH 1 uint32_t*
+TIFFTAG_IMAGEWIDTH 1 uint32_t*
TIFFTAG_INKNAMES 1 const char**
-TIFFTAG_INKSET 1 uint16*
+TIFFTAG_INKSET 1 uint16_t*
TIFFTAG_JPEGCOLORMODE 1 int* JPEG pseudo-tag
TIFFTAG_JPEGQUALITY 1 int* JPEG pseudo-tag
-TIFFTAG_JPEGTABLES 2 uint32*,const void** count & tables
+TIFFTAG_JPEGTABLES 2 uint32_t*,const void** count & tables
TIFFTAG_JPEGTABLESMODE 1 int* JPEG pseudo-tag
TIFFTAG_MAKE 1 const char**
-TIFFTAG_MATTEING 1 uint16*
-TIFFTAG_MAXSAMPLEVALUE 1 uint16*
-TIFFTAG_MINSAMPLEVALUE 1 uint16*
+TIFFTAG_MATTEING 1 uint16_t*
+TIFFTAG_MAXSAMPLEVALUE 1 uint16_t*
+TIFFTAG_MINSAMPLEVALUE 1 uint16_t*
TIFFTAG_MODEL 1 const char**
-TIFFTAG_ORIENTATION 1 uint16*
+TIFFTAG_ORIENTATION 1 uint16_t*
TIFFTAG_PAGENAME 1 const char**
-TIFFTAG_PAGENUMBER 2 uint16*
-TIFFTAG_PHOTOMETRIC 1 uint16*
-TIFFTAG_PHOTOSHOP 2 uint32*,const void** count, data
-TIFFTAG_PLANARCONFIG 1 uint16*
-TIFFTAG_PREDICTOR 1 uint16*
+TIFFTAG_PAGENUMBER 2 uint16_t*
+TIFFTAG_PHOTOMETRIC 1 uint16_t*
+TIFFTAG_PHOTOSHOP 2 uint32_t*,const void** count, data
+TIFFTAG_PLANARCONFIG 1 uint16_t*
+TIFFTAG_PREDICTOR 1 uint16_t*
TIFFTAG_PRIMARYCHROMATICITIES 1 const float** 6-entry array
TIFFTAG_REFERENCEBLACKWHITE 1 const float** 6-entry array
-TIFFTAG_RESOLUTIONUNIT 1 uint16*
-TIFFTAG_RICHTIFFIPTC 2 uint32*,const void** count, data
-TIFFTAG_ROWSPERSTRIP 1 uint32*
-TIFFTAG_SAMPLEFORMAT 1 uint16*
-TIFFTAG_SAMPLESPERPIXEL 1 uint16*
+TIFFTAG_RESOLUTIONUNIT 1 uint16_t*
+TIFFTAG_RICHTIFFIPTC 2 uint32_t*,const void** count, data
+TIFFTAG_ROWSPERSTRIP 1 uint32_t*
+TIFFTAG_SAMPLEFORMAT 1 uint16_t*
+TIFFTAG_SAMPLESPERPIXEL 1 uint16_t*
TIFFTAG_SMAXSAMPLEVALUE 1 double*
TIFFTAG_SMINSAMPLEVALUE 1 double*
TIFFTAG_SOFTWARE 1 const char**
TIFFTAG_STONITS 1 const double**
-TIFFTAG_STRIPBYTECOUNTS 1 const uint64**
-TIFFTAG_STRIPOFFSETS 1 const uint64**
-TIFFTAG_SUBFILETYPE 1 uint32*
-TIFFTAG_SUBIFD 2 uint16*,const uint64** count & offsets array
+TIFFTAG_STRIPBYTECOUNTS 1 const uint64_t**
+TIFFTAG_STRIPOFFSETS 1 const uint64_t**
+TIFFTAG_SUBFILETYPE 1 uint32_t*
+TIFFTAG_SUBIFD 2 uint16_t*,const uint64_t** count & offsets array
TIFFTAG_TARGETPRINTER 1 const char**
-TIFFTAG_THRESHHOLDING 1 uint16*
-TIFFTAG_TILEBYTECOUNTS 1 const uint64**
-TIFFTAG_TILEDEPTH 1 uint32*
-TIFFTAG_TILELENGTH 1 uint32*
-TIFFTAG_TILEOFFSETS 1 const uint64**
-TIFFTAG_TILEWIDTH 1 uint32*
-TIFFTAG_TRANSFERFUNCTION 1 or 3\(dg const uint16**1<<BitsPerSample entry arrays
+TIFFTAG_THRESHHOLDING 1 uint16_t*
+TIFFTAG_TILEBYTECOUNTS 1 const uint64_t**
+TIFFTAG_TILEDEPTH 1 uint32_t*
+TIFFTAG_TILELENGTH 1 uint32_t*
+TIFFTAG_TILEOFFSETS 1 const uint64_t**
+TIFFTAG_TILEWIDTH 1 uint32_t*
+TIFFTAG_TRANSFERFUNCTION 1 or 3\(dg const uint16_t**1<<BitsPerSample entry arrays
TIFFTAG_WHITEPOINT 1 const float** 2-entry array
-TIFFTAG_XMLPACKET 2 uint32*,const void** count, data
+TIFFTAG_XMLPACKET 2 uint32_t*,const void** count, data
TIFFTAG_XPOSITION 1 float*
TIFFTAG_XRESOLUTION 1 float*
TIFFTAG_YCBCRCOEFFICIENTS 1 const float** 3-entry array
-TIFFTAG_YCBCRPOSITIONING 1 uint16*
-TIFFTAG_YCBCRSUBSAMPLING 2 uint16*
+TIFFTAG_YCBCRPOSITIONING 1 uint16_t*
+TIFFTAG_YCBCRSUBSAMPLING 2 uint16_t*
TIFFTAG_YPOSITION 1 float*
TIFFTAG_YRESOLUTION 1 float*\(dd
.fi
@@ -196,11 +196,11 @@ and ASCII string from the tag 36867 you can use the following code:
.PP
.RS
.nf
-uint32 count;
+uint32_t count;
void *data;
TIFFGetField(tiff, 33424, &count, &data);
-printf("Tag %d: %d, count %d\n", 33424, *(uint32 *)data, count);
+printf("Tag %d: %d, count %d\n", 33424, *(uint32_t *)data, count);
TIFFGetField(tiff, 36867, &count, &data);
printf("Tag %d: %s, count %d\n", 36867, (char *)data, count);
.fi
diff --git a/tiff/man/TIFFRGBAImage.3tiff b/tiff/man/TIFFRGBAImage.3tiff
index fe6064fc..2c5f79c4 100644
--- a/tiff/man/TIFFRGBAImage.3tiff
+++ b/tiff/man/TIFFRGBAImage.3tiff
@@ -36,7 +36,7 @@ TIFFRGBAImageOK, TIFFRGBAImageBegin, TIFFRGBAImageGet, TIFFRGBAImageEnd
.br
.BI "int TIFFRGBAImageBegin(TIFFRGBAImage *" img ", TIFF* " tif ", int " stopOnError ", char " emsg[1024] ")"
.br
-.BI "int TIFFRGBAImageGet(TIFFRGBAImage *" img ", uint32* " raster ", uint32 " width " , uint32 " height ")"
+.BI "int TIFFRGBAImageGet(TIFFRGBAImage *" img ", uint32_t* " raster ", uint32_t " width " , uint32_t " height ")"
.br
.BI "void TIFFRGBAImageEnd(TIFFRGBAImage *" img ")"
.br
@@ -162,9 +162,9 @@ the raster is being filled:
.nf
.ft C
static void
-putContigAndDraw(TIFFRGBAImage* img, uint32* raster,
- uint32 x, uint32 y, uint32 w, uint32 h,
- int32 fromskew, int32 toskew,
+putContigAndDraw(TIFFRGBAImage* img, uint32_t* raster,
+ uint32_t x, uint32_t y, uint32_t w, uint32_t h,
+ int32_t fromskew, int32_t toskew,
unsigned char* cp)
{
(*putContig)(img, raster, x, y, w, h, fromskew, toskew, cp);
diff --git a/tiff/man/TIFFReadEncodedStrip.3tiff b/tiff/man/TIFFReadEncodedStrip.3tiff
index 05ddefb9..8d1ad6c5 100644
--- a/tiff/man/TIFFReadEncodedStrip.3tiff
+++ b/tiff/man/TIFFReadEncodedStrip.3tiff
@@ -30,7 +30,7 @@ file
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "tmsize_t TIFFReadEncodedStrip(TIFF *" tif ", uint32 " strip ", void *" buf ", tmsize_t " size ")"
+.BI "tmsize_t TIFFReadEncodedStrip(TIFF *" tif ", uint32_t " strip ", void *" buf ", tmsize_t " size ")"
.SH DESCRIPTION
Read the specified strip of data and place up to
.I size
diff --git a/tiff/man/TIFFReadRGBAImage.3tiff b/tiff/man/TIFFReadRGBAImage.3tiff
index 920fc370..a17f71ed 100644
--- a/tiff/man/TIFFReadRGBAImage.3tiff
+++ b/tiff/man/TIFFReadRGBAImage.3tiff
@@ -37,9 +37,9 @@ into a fixed-format raster
.br
.B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)"
.sp
-.BI "int TIFFReadRGBAImage(TIFF *" tif ", uint32 " width ", uint32 " height ", uint32 *" raster ", int " stopOnError ")"
+.BI "int TIFFReadRGBAImage(TIFF *" tif ", uint32_t " width ", uint32_t " height ", uint32_t *" raster ", int " stopOnError ")"
.br
-.BI "int TIFFReadRGBAImageOriented(TIFF *" tif ", uint32 " width ", uint32 " height ", uint32 *" raster ", int " orientation ", int " stopOnError ")"
+.BI "int TIFFReadRGBAImageOriented(TIFF *" tif ", uint32_t " width ", uint32_t " height ", uint32_t *" raster ", int " orientation ", int " stopOnError ")"
.br
.SH DESCRIPTION
.IR TIFFReadRGBAImage
@@ -109,7 +109,7 @@ transparently.
Raster pixels are returned uncorrected by any colorimetry information
present in the directory.
.PP
-The paramater
+The parameter
.I stopOnError
specifies how to act if an error is encountered while reading
the image.
diff --git a/tiff/man/TIFFReadRGBAStrip.3tiff b/tiff/man/TIFFReadRGBAStrip.3tiff
index 31604124..803a99af 100644
--- a/tiff/man/TIFFReadRGBAStrip.3tiff
+++ b/tiff/man/TIFFReadRGBAStrip.3tiff
@@ -36,7 +36,7 @@ TIFFReadRGBAStrip \- read and decode an image strip into a fixed-format raster
.br
.B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)"
.sp
-.BI "int TIFFReadRGBAStrip(TIFF *" tif ", uint32 " row ", uint32 *" raster ")"
+.BI "int TIFFReadRGBAStrip(TIFF *" tif ", uint32_t " row ", uint32_t *" raster ")"
.SH DESCRIPTION
.IR TIFFReadRGBAStrip
reads a single strip of a strip-based image into memory, storing the result in
diff --git a/tiff/man/TIFFReadRGBATile.3tiff b/tiff/man/TIFFReadRGBATile.3tiff
index 5b9b4bf2..4ee59180 100644
--- a/tiff/man/TIFFReadRGBATile.3tiff
+++ b/tiff/man/TIFFReadRGBATile.3tiff
@@ -36,7 +36,7 @@ TIFFReadRGBATile \- read and decode an image tile into a fixed-format raster
.br
.B "#define TIFFGetA(abgr) (((abgr) >> 24) & 0xff)"
.sp
-.BI "int TIFFReadRGBATile(TIFF *" tif ", uint32 " x ", uint32 " y ", uint32 *" raster ")"
+.BI "int TIFFReadRGBATile(TIFF *" tif ", uint32_t " x ", uint32_t " y ", uint32_t *" raster ")"
.SH DESCRIPTION
.IR TIFFReadRGBATile
reads a single tile of a tile-based image into memory, storing the result in
diff --git a/tiff/man/TIFFReadScanline.3tiff b/tiff/man/TIFFReadScanline.3tiff
index ca4b8368..9a61fc85 100644
--- a/tiff/man/TIFFReadScanline.3tiff
+++ b/tiff/man/TIFFReadScanline.3tiff
@@ -30,7 +30,7 @@ file
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "int TIFFReadScanline(TIFF *" tif ", tdata_t " buf ", uint32 " row ", tsample_t " sample ")"
+.BI "int TIFFReadScanline(TIFF *" tif ", tdata_t " buf ", uint32_t " row ", tsample_t " sample ")"
.SH DESCRIPTION
Read the data for the specified row into the (user supplied) data buffer
.IR buf .
diff --git a/tiff/man/TIFFReadTile.3tiff b/tiff/man/TIFFReadTile.3tiff
index cf0f21dc..5bfbbd36 100644
--- a/tiff/man/TIFFReadTile.3tiff
+++ b/tiff/man/TIFFReadTile.3tiff
@@ -30,7 +30,7 @@ file
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "tsize_t TIFFReadTile(TIFF *" tif ", tdata_t " buf ", uint32 " x ", uint32 " y ", uint32 " z ", tsample_t " sample ")"
+.BI "tsize_t TIFFReadTile(TIFF *" tif ", tdata_t " buf ", uint32_t " x ", uint32_t " y ", uint32_t " z ", tsample_t " sample ")"
.SH DESCRIPTION
Return the data for the tile
.I containing
diff --git a/tiff/man/TIFFSetDirectory.3tiff b/tiff/man/TIFFSetDirectory.3tiff
index 734c0155..d5b49908 100644
--- a/tiff/man/TIFFSetDirectory.3tiff
+++ b/tiff/man/TIFFSetDirectory.3tiff
@@ -32,7 +32,7 @@ file
.sp
.BI "int TIFFSetDirectory(TIFF *" tif ", tdir_t " dirnum ")"
.br
-.BI "int TIFFSetSubDirectory(TIFF *" tif ", uint64 " diroff ")"
+.BI "int TIFFSetSubDirectory(TIFF *" tif ", uint64_t " diroff ")"
.SH DESCRIPTION
.I TIFFSetDirectory
changes the current directory and reads its contents with
diff --git a/tiff/man/TIFFSetField.3tiff b/tiff/man/TIFFSetField.3tiff
index df2a5ea2..f614e075 100644
--- a/tiff/man/TIFFSetField.3tiff
+++ b/tiff/man/TIFFSetField.3tiff
@@ -85,11 +85,11 @@ The data types are:
is null-terminated string and corresponds to the
.SM ASCII
data type;
-.I uint16
+.I uint16_t
is an unsigned 16-bit value;
-.I uint32
+.I uint32_t
is an unsigned 32-bit value;
-.I uint16*
+.I uint16_t*
is an array of unsigned 16-bit values.
.I void*
is an array of data values of unspecified type.
@@ -103,73 +103,73 @@ specification for information on the meaning of each tag.
\fITag Name\fP \fICount\fP \fITypes\fP \fINotes\fP
.sp 5p
TIFFTAG_ARTIST 1 char*
-TIFFTAG_BADFAXLINES 1 uint32
-TIFFTAG_BITSPERSAMPLE 1 uint16 \(dg
-TIFFTAG_CLEANFAXDATA 1 uint16
-TIFFTAG_COLORMAP 3 uint16* 1<<BitsPerSample arrays
-TIFFTAG_COMPRESSION 1 uint16 \(dg
-TIFFTAG_CONSECUTIVEBADFAXLINES 1 uint32
+TIFFTAG_BADFAXLINES 1 uint32_t
+TIFFTAG_BITSPERSAMPLE 1 uint16_t \(dg
+TIFFTAG_CLEANFAXDATA 1 uint16_t
+TIFFTAG_COLORMAP 3 uint16_t* 1<<BitsPerSample arrays
+TIFFTAG_COMPRESSION 1 uint16_t \(dg
+TIFFTAG_CONSECUTIVEBADFAXLINES 1 uint32_t
TIFFTAG_COPYRIGHT 1 char*
TIFFTAG_DATETIME 1 char*
TIFFTAG_DOCUMENTNAME 1 char*
-TIFFTAG_DOTRANGE 2 uint16
-TIFFTAG_EXTRASAMPLES 2 uint16,uint16* \(dg count & types array
+TIFFTAG_DOTRANGE 2 uint16_t
+TIFFTAG_EXTRASAMPLES 2 uint16_t,uint16_t* \(dg count & types array
TIFFTAG_FAXFILLFUNC 1 TIFFFaxFillFunc G3/G4 compression pseudo-tag
TIFFTAG_FAXMODE 1 int \(dg G3/G4 compression pseudo-tag
-TIFFTAG_FILLORDER 1 uint16 \(dg
-TIFFTAG_GROUP3OPTIONS 1 uint32 \(dg
-TIFFTAG_GROUP4OPTIONS 1 uint32 \(dg
-TIFFTAG_HALFTONEHINTS 2 uint16
+TIFFTAG_FILLORDER 1 uint16_t \(dg
+TIFFTAG_GROUP3OPTIONS 1 uint32_t \(dg
+TIFFTAG_GROUP4OPTIONS 1 uint32_t \(dg
+TIFFTAG_HALFTONEHINTS 2 uint16_t
TIFFTAG_HOSTCOMPUTER 1 char*
-TIFFTAG_ICCPROFILE 2 uint32,void* count, profile data
-TIFFTAG_IMAGEDEPTH 1 uint32 \(dg
+TIFFTAG_ICCPROFILE 2 uint32_t,void* count, profile data
+TIFFTAG_IMAGEDEPTH 1 uint32_t \(dg
TIFFTAG_IMAGEDESCRIPTION 1 char*
-TIFFTAG_IMAGELENGTH 1 uint32
-TIFFTAG_IMAGEWIDTH 1 uint32 \(dg
-TIFFTAG_INKNAMES 2 uint16, char*
-TIFFTAG_INKSET 1 uint16 \(dg
+TIFFTAG_IMAGELENGTH 1 uint32_t
+TIFFTAG_IMAGEWIDTH 1 uint32_t \(dg
+TIFFTAG_INKNAMES 2 uint16_t, char*
+TIFFTAG_INKSET 1 uint16_t \(dg
TIFFTAG_JPEGCOLORMODE 1 int \(dg JPEG pseudo-tag
TIFFTAG_JPEGQUALITY 1 int JPEG pseudo-tag
-TIFFTAG_JPEGTABLES 2 uint32*,void* \(dg count & tables
+TIFFTAG_JPEGTABLES 2 uint32_t*,void* \(dg count & tables
TIFFTAG_JPEGTABLESMODE 1 int \(dg JPEG pseudo-tag
TIFFTAG_MAKE 1 char*
-TIFFTAG_MATTEING 1 uint16 \(dg
-TIFFTAG_MAXSAMPLEVALUE 1 uint16
-TIFFTAG_MINSAMPLEVALUE 1 uint16
+TIFFTAG_MATTEING 1 uint16_t \(dg
+TIFFTAG_MAXSAMPLEVALUE 1 uint16_t
+TIFFTAG_MINSAMPLEVALUE 1 uint16_t
TIFFTAG_MODEL 1 char*
-TIFFTAG_ORIENTATION 1 uint16
+TIFFTAG_ORIENTATION 1 uint16_t
TIFFTAG_PAGENAME 1 char*
-TIFFTAG_PAGENUMBER 2 uint16
-TIFFTAG_PHOTOMETRIC 1 uint16
-TIFFTAG_PHOTOSHOP ? uint32,void* count, data
-TIFFTAG_PLANARCONFIG 1 uint16 \(dg
-TIFFTAG_PREDICTOR 1 uint16 \(dg
+TIFFTAG_PAGENUMBER 2 uint16_t
+TIFFTAG_PHOTOMETRIC 1 uint16_t
+TIFFTAG_PHOTOSHOP ? uint32_t,void* count, data
+TIFFTAG_PLANARCONFIG 1 uint16_t \(dg
+TIFFTAG_PREDICTOR 1 uint16_t \(dg
TIFFTAG_PRIMARYCHROMATICITIES 1 float* 6-entry array
TIFFTAG_REFERENCEBLACKWHITE 1 float* \(dg 6-entry array
-TIFFTAG_RESOLUTIONUNIT 1 uint16
-TIFFTAG_RICHTIFFIPTC 2 uint32,void* count, data
-TIFFTAG_ROWSPERSTRIP 1 uint32 \(dg must be > 0
-TIFFTAG_SAMPLEFORMAT 1 uint16 \(dg
-TIFFTAG_SAMPLESPERPIXEL 1 uint16 \(dg value must be <= 4
+TIFFTAG_RESOLUTIONUNIT 1 uint16_t
+TIFFTAG_RICHTIFFIPTC 2 uint32_t,void* count, data
+TIFFTAG_ROWSPERSTRIP 1 uint32_t \(dg must be > 0
+TIFFTAG_SAMPLEFORMAT 1 uint16_t \(dg
+TIFFTAG_SAMPLESPERPIXEL 1 uint16_t \(dg value must be <= 4
TIFFTAG_SMAXSAMPLEVALUE 1 double
TIFFTAG_SMINSAMPLEVALUE 1 double
TIFFTAG_SOFTWARE 1 char*
TIFFTAG_STONITS 1 double \(dg
-TIFFTAG_SUBFILETYPE 1 uint32
-TIFFTAG_SUBIFD 2 uint16,uint64* count & offsets array
+TIFFTAG_SUBFILETYPE 1 uint32_t
+TIFFTAG_SUBIFD 2 uint16_t,uint64_t* count & offsets array
TIFFTAG_TARGETPRINTER 1 char*
-TIFFTAG_THRESHHOLDING 1 uint16
-TIFFTAG_TILEDEPTH 1 uint32 \(dg
-TIFFTAG_TILELENGTH 1 uint32 \(dg must be a multiple of 8
-TIFFTAG_TILEWIDTH 1 uint32 \(dg must be a multiple of 8
-TIFFTAG_TRANSFERFUNCTION 1 or 3\(dd uint16* 1<<BitsPerSample entry arrays
+TIFFTAG_THRESHHOLDING 1 uint16_t
+TIFFTAG_TILEDEPTH 1 uint32_t \(dg
+TIFFTAG_TILELENGTH 1 uint32_t \(dg must be a multiple of 8
+TIFFTAG_TILEWIDTH 1 uint32_t \(dg must be a multiple of 8
+TIFFTAG_TRANSFERFUNCTION 1 or 3\(dd uint16_t* 1<<BitsPerSample entry arrays
TIFFTAG_WHITEPOINT 1 float* 2-entry array
-TIFFTAG_XMLPACKET 2 uint32,void* count, data
+TIFFTAG_XMLPACKET 2 uint32_t,void* count, data
TIFFTAG_XPOSITION 1 float
TIFFTAG_XRESOLUTION 1 float
TIFFTAG_YCBCRCOEFFICIENTS 1 float* \(dg 3-entry array
-TIFFTAG_YCBCRPOSITIONING 1 uint16 \(dg
-TIFFTAG_YCBCRSAMPLING 2 uint16 \(dg
+TIFFTAG_YCBCRPOSITIONING 1 uint16_t \(dg
+TIFFTAG_YCBCRSAMPLING 2 uint16_t \(dg
TIFFTAG_YPOSITION 1 float
TIFFTAG_YRESOLUTION 1 float
.fi
diff --git a/tiff/man/TIFFWriteScanline.3tiff b/tiff/man/TIFFWriteScanline.3tiff
index a51cec52..bf6e6a8d 100644
--- a/tiff/man/TIFFWriteScanline.3tiff
+++ b/tiff/man/TIFFWriteScanline.3tiff
@@ -30,7 +30,7 @@ file
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "int TIFFWriteScanline(TIFF *" tif ", tdata_t " buf ", uint32 " row ", tsample_t " sample ")"
+.BI "int TIFFWriteScanline(TIFF *" tif ", tdata_t " buf ", uint32_t " row ", tsample_t " sample ")"
.SH DESCRIPTION
Write data to a file at the specified row. The
.I sample
diff --git a/tiff/man/TIFFWriteTile.3tiff b/tiff/man/TIFFWriteTile.3tiff
index a6700258..7e86ae00 100644
--- a/tiff/man/TIFFWriteTile.3tiff
+++ b/tiff/man/TIFFWriteTile.3tiff
@@ -30,7 +30,7 @@ file
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "tsize_t TIFFWriteTile(TIFF *" tif ", tdata_t " buf ", uint32 " x ", uint32 " y ", uint32 " z ", tsample_t " sample ")"
+.BI "tsize_t TIFFWriteTile(TIFF *" tif ", tdata_t " buf ", uint32_t " x ", uint32_t " y ", uint32_t " z ", tsample_t " sample ")"
.SH DESCRIPTION
Write the data for the tile
.I containing
diff --git a/tiff/man/TIFFcodec.3tiff b/tiff/man/TIFFcodec.3tiff
index aa3a8c63..1fb41816 100644
--- a/tiff/man/TIFFcodec.3tiff
+++ b/tiff/man/TIFFcodec.3tiff
@@ -29,13 +29,13 @@ TIFFFindCODEC, TIFFRegisterCODEC, TIFFUnRegisterCODEC, TIFFIsCODECConfigured
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "const TIFFCodec* TIFFFindCODEC(uint16 " scheme ");"
+.BI "const TIFFCodec* TIFFFindCODEC(uint16_t " scheme ");"
.br
-.BI "TIFFCodec* TIFFRegisterCODEC(uint16 " scheme ", const char *" method ", TIFFInitMethod " init ");"
+.BI "TIFFCodec* TIFFRegisterCODEC(uint16_t " scheme ", const char *" method ", TIFFInitMethod " init ");"
.br
.BI "void TIFFUnRegisterCODEC(TIFFCodec *" codec ");"
.br
-.BI "int TIFFIsCODECConfigured(uint16 " scheme ");"
+.BI "int TIFFIsCODECConfigured(uint16_t " scheme ");"
.SH DESCRIPTION
.I libtiff
supports a variety of compression schemes implemented by software
diff --git a/tiff/man/TIFFcolor.3tiff b/tiff/man/TIFFcolor.3tiff
index 1d2bb2b8..d1e74a7c 100644
--- a/tiff/man/TIFFcolor.3tiff
+++ b/tiff/man/TIFFcolor.3tiff
@@ -30,13 +30,13 @@ TIFFXYZToRGB \- color conversion routines.
.sp
.BI "int TIFFYCbCrToRGBInit(TIFFYCbCrToRGB *" ycbcr ", float *" luma ", float *"refBlackWhite" );"
.br
-.BI "void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *" ycbcr ", uint32 " Y ", int32 " Cb ", int32 " Cr ", uint32 *" R ", uint32 *" G ", uint32 *" B " );"
+.BI "void TIFFYCbCrtoRGB(TIFFYCbCrToRGB *" ycbcr ", uint32_t " Y ", int32_t " Cb ", int32_t " Cr ", uint32_t *" R ", uint32_t *" G ", uint32_t *" B " );"
.sp
.BI "int TIFFCIELabToRGBInit(TIFFCIELabToRGB *" cielab ", const TIFFDisplay *" display ", float *" refWhite ");"
.br
-.BI "void TIFFCIELabToXYZ(TIFFCIELabToRGB *" cielab ", uint32 " L ", int32 " a ", int32 " b ", float *" X ", float *" Y ", float *" Z ");"
+.BI "void TIFFCIELabToXYZ(TIFFCIELabToRGB *" cielab ", uint32_t " L ", int32_t " a ", int32_t " b ", float *" X ", float *" Y ", float *" Z ");"
.br
-.BI "void TIFFXYZToRGB(TIFFCIELabToRGB *" cielab ", float " X ", float " Y ", float " Z" , uint32 *" R ", uint32 *" G ", uint32 *" B ");"
+.BI "void TIFFXYZToRGB(TIFFCIELabToRGB *" cielab ", float " X ", float " Y ", float " Z" , uint32_t *" R ", uint32_t *" G ", uint32_t *" B ");"
.SH DESCRIPTION
TIFF supports several color spaces for images stored in that format. There is
usually a problem of application to handle the data properly and convert
@@ -65,9 +65,9 @@ typedef struct { /* YCbCr->RGB support */
TIFFRGBValue* clamptab; /* range clamping table */
int* Cr_r_tab;
int* Cb_b_tab;
- int32* Cr_g_tab;
- int32* Cb_g_tab;
- int32* Y_tab;
+ int32_t* Cr_g_tab;
+ int32_t* Cb_g_tab;
+ int32_t* Y_tab;
} TIFFYCbCrToRGB;
.fi
.RE
@@ -89,14 +89,14 @@ should helps to understand the the technique:
.RS
.nf
float *luma, *refBlackWhite;
-uint16 hs, vs;
+uint16_t hs, vs;
/* Initialize structures */
ycbcr = (TIFFYCbCrToRGB*)
_TIFFmalloc(TIFFroundup(sizeof(TIFFYCbCrToRGB), sizeof(long))
+ 4*256*sizeof(TIFFRGBValue)
+ 2*256*sizeof(int)
- + 3*256*sizeof(int32));
+ + 3*256*sizeof(int32_t));
if (ycbcr == NULL) {
TIFFError("YCbCr->RGB",
"No space for YCbCr->RGB conversion state");
@@ -109,9 +109,9 @@ if (TIFFYCbCrToRGBInit(ycbcr, luma, refBlackWhite) < 0)
exit(0);
/* Start conversion */
-uint32 r, g, b;
-uint32 Y;
-int32 Cb, Cr;
+uint32_t r, g, b;
+uint32_t Y;
+int32_t Cb, Cr;
for each pixel in image
TIFFYCbCrtoRGB(img->ycbcr, Y, Cb, Cr, &r, &g, &b);
@@ -158,9 +158,9 @@ typedef struct {
float d_YCR; /* Light o/p for reference white */
float d_YCG;
float d_YCB;
- uint32 d_Vrwr; /* Pixel values for ref. white */
- uint32 d_Vrwg;
- uint32 d_Vrwb;
+ uint32_t d_Vrwr; /* Pixel values for ref. white */
+ uint32_t d_Vrwg;
+ uint32_t d_Vrwb;
float d_Y0R; /* Residual light for black pixel */
float d_Y0G;
float d_Y0B;
@@ -245,9 +245,9 @@ if (TIFFCIELabToRGBInit(cielab, &display_sRGB, refWhite) < 0) {
}
/* Now we can start to convert */
-uint32 r, g, b;
-uint32 L;
-int32 a, b;
+uint32_t r, g, b;
+uint32_t L;
+int32_t a, b;
float X, Y, Z;
for each pixel in image
diff --git a/tiff/man/TIFFquery.3tiff b/tiff/man/TIFFquery.3tiff
index 4d95f5f4..1e56a0ec 100644
--- a/tiff/man/TIFFquery.3tiff
+++ b/tiff/man/TIFFquery.3tiff
@@ -41,7 +41,7 @@ TIFFGetVersion
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "uint32 TIFFCurrentRow(TIFF* " tif ")"
+.BI "uint32_t TIFFCurrentRow(TIFF* " tif ")"
.br
.BI "tstrip_t TIFFCurrentStrip(TIFF* " tif ")"
.br
diff --git a/tiff/man/TIFFstrip.3tiff b/tiff/man/TIFFstrip.3tiff
index ce3f718c..f8b765ad 100644
--- a/tiff/man/TIFFstrip.3tiff
+++ b/tiff/man/TIFFstrip.3tiff
@@ -29,15 +29,15 @@ TIFFComputeStrip, TIFFNumberOfStrips \- strip-related utility routines
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "uint32 TIFFDefaultStripSize(TIFF *" tif ", uint32 " estimate ")"
+.BI "uint32_t TIFFDefaultStripSize(TIFF *" tif ", uint32_t " estimate ")"
.br
.BI "tmsize_t TIFFStripSize(TIFF *" tif ")"
.br
-.BI "tmsize_t TIFFVStripSize(TIFF *" tif ", uint32 " nrows ")"
+.BI "tmsize_t TIFFVStripSize(TIFF *" tif ", uint32_t " nrows ")"
.br
-.BI "tmsize_t TIFFRawStripSize(TIFF *" tif ", uint32 " strip ")"
+.BI "tmsize_t TIFFRawStripSize(TIFF *" tif ", uint32_t " strip ")"
.br
-.BI "tstrip_t TIFFComputeStrip(TIFF *" tif ", uint32 " row ", tsample_t " sample ")"
+.BI "tstrip_t TIFFComputeStrip(TIFF *" tif ", uint32_t " row ", tsample_t " sample ")"
.br
.BI "tstrip_t TIFFNumberOfStrips(TIFF *" tif ")"
.SH DESCRIPTION
diff --git a/tiff/man/TIFFswab.3tiff b/tiff/man/TIFFswab.3tiff
index 3d7a47bc..44325223 100644
--- a/tiff/man/TIFFswab.3tiff
+++ b/tiff/man/TIFFswab.3tiff
@@ -33,13 +33,13 @@ TIFFSwabArrayOfShort, TIFFSwabArrayOfLong \- byte- and bit-swapping routines
.br
.BI "void TIFFReverseBits(u_char *" data ", unsigned long " nbytes ")"
.br
-.BI "void TIFFSwabShort(uint16 *" data ")"
+.BI "void TIFFSwabShort(uint16_t *" data ")"
.br
-.BI "void TIFFSwabLong(uint32 *" data ")"
+.BI "void TIFFSwabLong(uint32_t *" data ")"
.br
-.BI "void TIFFSwabArrayOfShort(uint16 *" data ", unsigned long " nshorts ")"
+.BI "void TIFFSwabArrayOfShort(uint16_t *" data ", unsigned long " nshorts ")"
.br
-.BI "void TIFFSwabArrayOfLong(uint32 *" data ", unsigned long " nlongs ")"
+.BI "void TIFFSwabArrayOfLong(uint32_t *" data ", unsigned long " nlongs ")"
.SH DESCRIPTION
The following routines are used by the library to swap
16- and 32-bit data and to reverse the order of bits in bytes.
diff --git a/tiff/man/TIFFtile.3tiff b/tiff/man/TIFFtile.3tiff
index 10310a06..7928e406 100644
--- a/tiff/man/TIFFtile.3tiff
+++ b/tiff/man/TIFFtile.3tiff
@@ -30,17 +30,17 @@ routines
.SH SYNOPSIS
.B "#include <tiffio.h>"
.sp
-.BI "void TIFFDefaultTileSize(TIFF *" tif ", uint32 *" tw ", uint32 *" th ")"
+.BI "void TIFFDefaultTileSize(TIFF *" tif ", uint32_t *" tw ", uint32_t *" th ")"
.br
.BI "tsize_t TIFFTileSize(TIFF *" tif ")"
.br
.BI "tsize_t TIFFTileRowSize(TIFF *" tif ")"
.br
-.BI "tsize_t TIFFVTileSize(TIFF *" tif ", uint32 " nrows ")"
+.BI "tsize_t TIFFVTileSize(TIFF *" tif ", uint32_t " nrows ")"
.br
-.BI "ttile_t TIFFComputeTile(TIFF *" tif ", uint32 " x ", uint32 " y ", uint32 " z ", tsample_t " sample ")"
+.BI "ttile_t TIFFComputeTile(TIFF *" tif ", uint32_t " x ", uint32_t " y ", uint32_t " z ", tsample_t " sample ")"
.br
-.BI "int TIFFCheckTile(TIFF *" tif ", uint32 " x ", uint32 " y ", uint32 " z ", tsample_t " sample ")"
+.BI "int TIFFCheckTile(TIFF *" tif ", uint32_t " x ", uint32_t " y ", uint32_t " z ", tsample_t " sample ")"
.br
.BI "ttile_t TIFFNumberOfTiles(TIFF *" tif ")"
.br
diff --git a/tiff/man/libtiff.3tiff b/tiff/man/libtiff.3tiff
index 8e9ff35b..1f646789 100644
--- a/tiff/man/libtiff.3tiff
+++ b/tiff/man/libtiff.3tiff
@@ -93,20 +93,20 @@ The following typedefs are exposed to users either through function
definitions or through parameters passed through the varargs interfaces.
.in +.5i
.sp 5p
-.ta +\w'typedef unsigned <\fIthing\fP> uint32; 'u
+.ta +\w'typedef unsigned <\fIthing\fP> uint32_t; 'u
.nf
-typedef unsigned short uint16; 16-bit unsigned integer
-typedef unsigned <\fIthing\fP> uint32; 32-bit unsigned integer
+typedef unsigned short uint16_t; 16-bit unsigned integer
+typedef unsigned <\fIthing\fP> uint32_t; 32-bit unsigned integer
.sp 5p
typedef unsigned int ttag_t; directory tag
-typedef uint16 tdir_t; directory index
-typedef uint16 tsample_t; sample number
-typedef uint32 tstrip_t; strip number
-typedef uint32 ttile_t; tile number
-typedef int32 tsize_t; i/o size in bytes
+typedef uint16_t tdir_t; directory index
+typedef uint16_t tsample_t; sample number
+typedef uint32_t tstrip_t; strip number
+typedef uint32_t ttile_t; tile number
+typedef int32_t tsize_t; i/o size in bytes
typedef void* tdata_t; image data ref
typedef void* thandle_t; client data handle
-typedef int32 toff_t; file offset
+typedef int32_t toff_t; file offset
.fi
.sp 5p
.in -.5i
@@ -134,7 +134,7 @@ a varargs interface and
.SM "ANSI C"
restricts the type of the parameter before an ellipsis to be a promoted type.
.I toff_t
-is defined as int32 because TIFF file offsets are (unsigned) 32-bit
+is defined as int32_t because TIFF file offsets are (unsigned) 32-bit
quantities. A signed value is used because some interfaces return \-1 on
error. Finally, note that user-specified data references are passed as opaque
handles and only cast at the lowest layers where their type is presumed.
diff --git a/tiff/man/tiffcrop.1 b/tiff/man/tiffcrop.1
index d7a4c4d7..d133f652 100644
--- a/tiff/man/tiffcrop.1
+++ b/tiff/man/tiffcrop.1
@@ -133,7 +133,7 @@ or
may be used to specify all odd or even numbered images counting from one.
Note that internally, TIFF images are numbered from zero rather than one
but since this convention is not obvious to most users, tiffcrop used 1
-to specifiy the first image in a multipage file. The word
+to specify the first image in a multipage file. The word
.B last
may be used in place of a number in the sequence to indicate the
final image in the file without knowing how many images there are.
@@ -144,8 +144,8 @@ to process the 1st, 5th through 7th, and final image in the file.
.TP
.B \-E top|bottom|left|right
Specify the top, bottom, left, or right edge as the reference from
-which to calcuate the width and length of crop regions or sequence
-of postions for zones. When used with the \-e option for exporting
+which to calculate the width and length of crop regions or sequence
+of positions for zones. When used with the \-e option for exporting
zones or regions, the reference edge determines how composite images
are arranged. Using \-E left or right causes successive zones or
regions to be merged horizontally whereas using \-E top or bottom
@@ -549,11 +549,11 @@ additional ones may be added in the future. It will handle tiled images with
bit depths that are not a multiple of eight that tiffcp may refuse to read.
.PP
.I Tiffcrop
-was designed to handle large files containing many moderate sized images
-with memory usage that is independent of the number of images in the file.
+was designed to handle large files containing many moderate sized images
+with memory usage that is independent of the number of images in the file.
In order to support compression modes that are not based on individual
scanlines, e.g. JPEG, it now reads images by strip or tile rather than by
-indvidual scanlines. In addition to the memory required by the input and
+individual scanlines. In addition to the memory required by the input and
output buffers associated with
.I LibTIFF
one or more buffers at least as large as the largest image to be read are
diff --git a/tiff/man/tiffsplit.1 b/tiff/man/tiffsplit.1
index fe309f42..6b0b5121 100644
--- a/tiff/man/tiffsplit.1
+++ b/tiff/man/tiffsplit.1
@@ -57,6 +57,18 @@ the default prefix of
is used.
.SH OPTIONS
None.
+.SH EXIT STATUS
+.I tiffsplit
+exits with one of the following values:
+.PD 0
+.TP
+.B 0
+Success
+.TP
+.B 1
+An error occurred either reading the input or writing results.
+.RE
+.PD
.SH BUGS
Only a select set of ``known tags'' is copied when splitting.
.SH "SEE ALSO"
diff --git a/tiff/nmake.opt b/tiff/nmake.opt
deleted file mode 100644
index d9bf15f1..00000000
--- a/tiff/nmake.opt
+++ /dev/null
@@ -1,220 +0,0 @@
-#
-# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee, provided
-# that (i) the above copyright notices and this permission notice appear in
-# all copies of the software and related documentation, and (ii) the names of
-# Sam Leffler and Silicon Graphics may not be used in any advertising or
-# publicity relating to the software without the specific, prior written
-# permission of Sam Leffler and Silicon Graphics.
-#
-# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-#
-# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-
-# Compile time parameters for MS Visual C++ compiler.
-# You may edit this file to specify building options.
-
-# Options:
-# DEBUG - set to disable optimizations and link with debug runtimes
-#
-# Usage examples (see details below):
-# nmake -f makefile.vc
-# nmake -f makefile.vc DEBUG=1
-# nmake -f makefile.vc clean
-#
-#
-###### Edit the following lines to choose a feature set you need. #######
-#
-
-#
-# Comment out the following lines to disable internal codecs.
-#
-# Support for CCITT Group 3 & 4 algorithms
-CCITT_SUPPORT = 1
-# Support for Macintosh PackBits algorithm
-PACKBITS_SUPPORT = 1
-# Support for LZW algorithm
-LZW_SUPPORT = 1
-# Support for ThunderScan 4-bit RLE algorithm
-THUNDER_SUPPORT = 1
-# Support for NeXT 2-bit RLE algorithm
-NEXT_SUPPORT = 1
-# Support for LogLuv high dynamic range encoding
-LOGLUV_SUPPORT = 1
-
-#
-# Uncomment and edit following lines to enable JPEG support.
-#
-#JPEG_SUPPORT = 1
-#JPEGDIR = d:/projects/jpeg-6b
-#JPEG_INCLUDE = -I$(JPEGDIR)
-#JPEG_LIB = $(JPEGDIR)/Release/jpeg.lib
-
-#
-# Uncomment and edit following lines to enable ZIP support
-# (required for Deflate compression and Pixar log-format)
-#
-#ZIP_SUPPORT = 1
-#ZLIBDIR = d:/projects/zlib-1.2.1
-#ZLIB_INCLUDE = -I$(ZLIBDIR)
-#ZLIB_LIB = $(ZLIBDIR)/zlib.lib
-
-#
-# Uncomment and edit following lines to enable ISO JBIG support
-#
-#JBIG_SUPPORT = 1
-#JBIGDIR = d:/projects/jbigkit
-#JBIG_INCLUDE = -I$(JBIGDIR)/libjbig
-#JBIG_LIB = $(JBIGDIR)/libjbig/jbig.lib
-
-#
-# Uncomment following line to enable Pixar log-format algorithm
-# (Zlib required).
-#
-#PIXARLOG_SUPPORT = 1
-
-#
-# Comment out the following lines to disable strip chopping
-# (whether or not to convert single-strip uncompressed images to mutiple
-# strips of specified size to reduce memory usage). Default strip size
-# is 8192 bytes, it can be configured via the STRIP_SIZE_DEFAULT parameter
-#
-STRIPCHOP_SUPPORT = 1
-STRIP_SIZE_DEFAULT = 8192
-
-#
-# Comment out the following lines to disable treating the fourth sample with
-# no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA
-# files but don't mark the alpha properly.
-#
-EXTRASAMPLE_AS_ALPHA_SUPPORT = 1
-
-#
-# Comment out the following lines to disable picking up YCbCr subsampling
-# info from the JPEG data stream to support files lacking the tag.
-# See Bug 168 in Bugzilla, and JPEGFixupTestSubsampling() for details.
-#
-CHECK_JPEG_YCBCR_SUBSAMPLING = 1
-
-#
-####################### Compiler related options. #######################
-#
-
-
-# Indicate if the compiler provides strtoll/strtoull (default 1)
-# Users of MSVC++ 14.0 ("Visual Studio 2015") and later should set this to 1
-HAVE_STRTOLL = 1
-
-#
-# Pick debug or optimized build flags. We default to an optimized build
-# with no debugging information.
-# NOTE: /EHsc option required if you want to build the C++ stream API
-#
-!IFDEF DEBUG
-OPTFLAGS = /MDd /EHsc /W3 /D_CRT_SECURE_NO_DEPRECATE
-!ELSE
-OPTFLAGS = /Ox /MD /EHsc /W3 /D_CRT_SECURE_NO_DEPRECATE
-!ENDIF
-#OPTFLAGS = /Zi
-
-#
-# Uncomment following line to enable using Windows Common RunTime Library
-# instead of Windows specific system calls. See notes on top of tif_unix.c
-# module for details.
-#
-USE_WIN_CRT_LIB = 1
-
-# Compiler specific options. You may probably want to adjust compilation
-# parameters in CFLAGS variable. Refer to your compiler documentation
-# for the option reference.
-#
-MAKE = nmake /nologo
-CC = cl /nologo
-CXX = cl /nologo
-AR = lib /nologo
-LD = link /nologo
-
-CFLAGS = $(OPTFLAGS) $(INCL) $(EXTRAFLAGS)
-CXXFLAGS = $(OPTFLAGS) $(INCL) $(EXTRAFLAGS)
-EXTRAFLAGS = -DHAVE_CONFIG_H
-LIBS =
-
-# Name of the output shared library
-DLLNAME = libtiff.dll
-
-#
-########### There is nothing to edit below this line normally. ###########
-#
-
-# Set the native cpu bit order
-EXTRAFLAGS = -DFILLODER_LSB2MSB $(EXTRAFLAGS)
-
-# Codec stuff
-!IFDEF CCITT_SUPPORT
-EXTRAFLAGS = -DCCITT_SUPPORT $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF PACKBITS_SUPPORT
-EXTRAFLAGS = -DPACKBITS_SUPPORT $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF LZW_SUPPORT
-EXTRAFLAGS = -DLZW_SUPPORT $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF THUNDER_SUPPORT
-EXTRAFLAGS = -DTHUNDER_SUPPORT $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF NEXT_SUPPORT
-EXTRAFLAGS = -DNEXT_SUPPORT $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF LOGLUV_SUPPORT
-EXTRAFLAGS = -DLOGLUV_SUPPORT $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF JPEG_SUPPORT
-LIBS = $(LIBS) $(JPEG_LIB)
-EXTRAFLAGS = -DJPEG_SUPPORT -DOJPEG_SUPPORT $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF ZIP_SUPPORT
-LIBS = $(LIBS) $(ZLIB_LIB)
-EXTRAFLAGS = -DZIP_SUPPORT $(EXTRAFLAGS)
-!IFDEF PIXARLOG_SUPPORT
-EXTRAFLAGS = -DPIXARLOG_SUPPORT $(EXTRAFLAGS)
-!ENDIF
-!ENDIF
-
-!IFDEF JBIG_SUPPORT
-LIBS = $(LIBS) $(JBIG_LIB)
-EXTRAFLAGS = -DJBIG_SUPPORT $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF STRIPCHOP_SUPPORT
-EXTRAFLAGS = -DSTRIPCHOP_DEFAULT=TIFF_STRIPCHOP -DSTRIP_SIZE_DEFAULT=$(STRIP_SIZE_DEFAULT) $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF EXTRASAMPLE_AS_ALPHA_SUPPORT
-EXTRAFLAGS = -DDEFAULT_EXTRASAMPLE_AS_ALPHA $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF CHECK_JPEG_YCBCR_SUBSAMPLING
-EXTRAFLAGS = -DCHECK_JPEG_YCBCR_SUBSAMPLING $(EXTRAFLAGS)
-!ENDIF
-
-!IFDEF USE_WIN_CRT_LIB
-EXTRAFLAGS = -DAVOID_WIN32_FILEIO $(EXTRAFLAGS)
-!ELSE
-EXTRAFLAGS = -DUSE_WIN32_FILEIO $(EXTRAFLAGS)
-!ENDIF
diff --git a/tiff/port/CMakeLists.txt b/tiff/port/CMakeLists.txt
index b7eb3a29..21db9773 100644..100755
--- a/tiff/port/CMakeLists.txt
+++ b/tiff/port/CMakeLists.txt
@@ -22,47 +22,30 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-set(port_HEADERS libport.h)
-set(port_SOURCES dummy.c)
-set(port_optional_SOURCES
- getopt.c
- lfind.c
- strcasecmp.c
- strtol.c
- strtoll.c
- strtoul.c
- strtoull.c)
+# Generate headers
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libport_config.h.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/libport_config.h
+ @ONLY)
-set(port_USED_FILES ${port_SOURCES} ${port_HEADERS})
+set(port_HEADERS libport.h)
+# Only build if any needed features are missing
if(NOT HAVE_GETOPT)
- list(APPEND port_USED_FILES getopt.c)
-endif()
-if(NOT HAVE_LFIND)
- list(APPEND port_USED_FILES lfind.c)
-endif()
-if(MSVC AND NOT HAVE_SNPRINTF)
- list(APPEND port_USED_FILES snprintf.c)
-endif()
-if(NOT HAVE_STRCASECMP)
- list(APPEND port_USED_FILES strcasecmp.c)
-endif()
-if(NOT HAVE_STRTOL)
- list(APPEND port_USED_FILES strtol.c)
-endif()
-if(NOT HAVE_STRTOLL)
- list(APPEND port_USED_FILES strtoll.c)
-endif()
-if(NOT HAVE_STRTOUL)
- list(APPEND port_USED_FILES strtoul.c)
-endif()
-if(NOT HAVE_STRTOULL)
- list(APPEND port_USED_FILES strtoull.c)
-endif()
+ add_library(port STATIC)
-add_library(port STATIC ${port_USED_FILES})
+ # Add getopt if missing
+ if(NOT HAVE_GETOPT)
+ target_sources(port PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/getopt.c)
+ endif()
-foreach(file ${port_USED_FILES})
- list(APPEND tiff_port_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
-endforeach()
-set(tiff_port_SOURCES ${tiff_port_SOURCES} PARENT_SCOPE)
+ target_include_directories(port PUBLIC
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR})
+else()
+ # Dummy interface library
+ add_library(port INTERFACE)
+ target_include_directories(port INTERFACE
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR})
+endif()
diff --git a/tiff/port/Makefile.am b/tiff/port/Makefile.am
index 250479fe..088a2f7b 100644
--- a/tiff/port/Makefile.am
+++ b/tiff/port/Makefile.am
@@ -25,11 +25,8 @@
EXTRA_DIST = \
CMakeLists.txt \
- Makefile.vc \
libport.h \
- snprintf.c \
- _strtol.h \
- _strtoul.h
+ libport_config.h.cmake.in
noinst_LTLIBRARIES = libport.la
libport_la_SOURCES = dummy.c libport.h
diff --git a/tiff/port/Makefile.in b/tiff/port/Makefile.in
index ba9d98f8..d5a7c155 100644
--- a/tiff/port/Makefile.in
+++ b/tiff/port/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -123,8 +123,9 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
@@ -147,14 +148,10 @@ AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libtiff
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__maybe_remake_depfiles = depfiles
-am__depfiles_remade = $(DEPDIR)/getopt.Plo $(DEPDIR)/lfind.Plo \
- $(DEPDIR)/snprintf.Plo $(DEPDIR)/strcasecmp.Plo \
- $(DEPDIR)/strtol.Plo $(DEPDIR)/strtoll.Plo \
- $(DEPDIR)/strtoul.Plo $(DEPDIR)/strtoull.Plo \
- ./$(DEPDIR)/dummy.Plo
+am__depfiles_remade = $(DEPDIR)/getopt.Plo ./$(DEPDIR)/dummy.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -181,7 +178,8 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)libport_config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
@@ -200,9 +198,8 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
- getopt.c lfind.c snprintf.c strcasecmp.c strtol.c strtoll.c \
- strtoul.c strtoull.c
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/libport_config.h.in \
+ $(top_srcdir)/config/depcomp getopt.c
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
@@ -343,6 +340,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -354,16 +352,14 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
CMakeLists.txt \
- Makefile.vc \
libport.h \
- snprintf.c \
- _strtol.h \
- _strtoul.h
+ libport_config.h.cmake.in
noinst_LTLIBRARIES = libport.la
libport_la_SOURCES = dummy.c libport.h
libport_la_LIBADD = @LTLIBOBJS@
-all: all-am
+all: libport_config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
@@ -397,6 +393,17 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
+libport_config.h: stamp-h4
+ @test -f $@ || rm -f stamp-h4
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h4
+
+stamp-h4: $(srcdir)/libport_config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h4
+ cd $(top_builddir) && $(SHELL) ./config.status port/libport_config.h
+
+distclean-hdr:
+ -rm -f libport_config.h stamp-h4
+
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
@list='$(noinst_LTLIBRARIES)'; \
@@ -418,13 +425,6 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/lfind.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/snprintf.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtol.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoll.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoul.Plo@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strtoull.Plo@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Plo@am__quote@ # am--include-marker
$(am__depfiles_remade):
@@ -547,7 +547,7 @@ distdir-am: $(DISTFILES)
done
check-am: all-am
check: check-am
-all-am: Makefile $(LTLIBRARIES)
+all-am: Makefile $(LTLIBRARIES) libport_config.h
installdirs:
install: install-am
install-exec: install-exec-am
@@ -586,17 +586,10 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
distclean: distclean-am
-rm -f $(DEPDIR)/getopt.Plo
- -rm -f $(DEPDIR)/lfind.Plo
- -rm -f $(DEPDIR)/snprintf.Plo
- -rm -f $(DEPDIR)/strcasecmp.Plo
- -rm -f $(DEPDIR)/strtol.Plo
- -rm -f $(DEPDIR)/strtoll.Plo
- -rm -f $(DEPDIR)/strtoul.Plo
- -rm -f $(DEPDIR)/strtoull.Plo
-rm -f ./$(DEPDIR)/dummy.Plo
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
+ distclean-hdr distclean-tags
dvi: dvi-am
@@ -640,13 +633,6 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(DEPDIR)/getopt.Plo
- -rm -f $(DEPDIR)/lfind.Plo
- -rm -f $(DEPDIR)/snprintf.Plo
- -rm -f $(DEPDIR)/strcasecmp.Plo
- -rm -f $(DEPDIR)/strtol.Plo
- -rm -f $(DEPDIR)/strtoll.Plo
- -rm -f $(DEPDIR)/strtoul.Plo
- -rm -f $(DEPDIR)/strtoull.Plo
-rm -f ./$(DEPDIR)/dummy.Plo
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -666,21 +652,21 @@ ps-am:
uninstall-am:
-.MAKE: install-am install-strip
+.MAKE: all install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-generic clean-libtool clean-noinstLTLIBRARIES \
cscopelist-am ctags ctags-am distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
- tags tags-am uninstall uninstall-am
+ distclean-generic distclean-hdr distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
diff --git a/tiff/port/Makefile.vc b/tiff/port/Makefile.vc
deleted file mode 100644
index e4471af5..00000000
--- a/tiff/port/Makefile.vc
+++ /dev/null
@@ -1,83 +0,0 @@
-#
-# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee, provided
-# that (i) the above copyright notices and this permission notice appear in
-# all copies of the software and related documentation, and (ii) the names of
-# Sam Leffler and Silicon Graphics may not be used in any advertising or
-# publicity relating to the software without the specific, prior written
-# permission of Sam Leffler and Silicon Graphics.
-#
-# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-#
-# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
-# Makefile for MS Visual C and Watcom C compilers.
-#
-# To build:
-# C:\libtiff\port> nmake /f makefile.vc
-
-!INCLUDE ..\nmake.opt
-
-HAVE_STRTOL = 1
-HAVE_STRTOUL = 1
-
-# strtoul()/strtoull() are provided together
-!IF $(HAVE_STRTOLL)
-HAVE_STRTOULL = 1
-!ELSE
-HAVE_STRTOULL = 0
-!endif
-
-!IF $(HAVE_STRTOL)
-STRTOL_OBJ =
-!ELSE
-STRTOL_OBJ = strtol.obj
-!ENDIF
-
-!IF $(HAVE_STRTOUL)
-STRTOUL_OBJ =
-!ELSE
-STRTOUL_OBJ = strtoul.obj
-!ENDIF
-
-!IF $(HAVE_STRTOLL)
-STRTOLL_OBJ =
-!ELSE
-STRTOLL_OBJ = strtoll.obj
-!ENDIF
-
-!IF $(HAVE_STRTOULL)
-STRTOULL_OBJ =
-!ELSE
-STRTOULL_OBJ = strtoull.obj
-!ENDIF
-
-INCL = -I..\libtiff
-
-OBJ = \
- snprintf.obj \
- strcasecmp.obj \
- $(STRTOL_OBJ) \
- $(STRTOUL_OBJ) \
- $(STRTOLL_OBJ) \
- $(STRTOULL_OBJ) \
- getopt.obj
-
-all: libport.lib
-
-libport.lib: $(OBJ)
- $(AR) /out:libport.lib $(OBJ)
-
-clean:
- -del *.obj
- -del *.lib
-
diff --git a/tiff/port/_strtol.h b/tiff/port/_strtol.h
deleted file mode 100644
index 73a10063..00000000
--- a/tiff/port/_strtol.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* $NetBSD: _strtol.h,v 1.11 2017/07/06 21:08:44 joerg Exp $ */
-
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Original version ID:
- * NetBSD: src/lib/libc/locale/_wcstol.h,v 1.2 2003/08/07 16:43:03 agc Exp
- */
-
-#include <assert.h>
-
-/*
- * function template for strtol, strtoll and strtoimax.
- *
- * parameters:
- * _FUNCNAME : function name
- * __INT : return type
- * __INT_MIN : lower limit of the return type
- * __INT_MAX : upper limit of the return type
- */
-__INT
-_FUNCNAME(const char *nptr, char **endptr, int base)
-{
- const char *s;
- __INT acc, cutoff;
- unsigned char c;
- int i, neg, any, cutlim;
-
- assert(nptr != NULL);
- /* endptr may be NULL */
-
- /* check base value */
- if (base && (base < 2 || base > 36)) {
- errno = EINVAL;
- if (endptr != NULL)
- /* LINTED interface specification */
- *endptr = (char *)(nptr);
- return 0;
- }
-
- /*
- * Skip white space and pick up leading +/- sign if any.
- * If base is 0, allow 0x for hex and 0 for octal, else
- * assume decimal; if base is already 16, allow 0x.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X') &&
- ((s[1] >= '0' && s[1] <= '9') ||
- (s[1] >= 'a' && s[1] <= 'f') ||
- (s[1] >= 'A' && s[1] <= 'F'))) {
- c = s[1];
- s += 2;
- base = 16;
- } else if (base == 0)
- base = (c == '0' ? 8 : 10);
-
- /*
- * Compute the cutoff value between legal numbers and illegal
- * numbers. That is the largest legal value, divided by the
- * base. An input number that is greater than this value, if
- * followed by a legal input character, is too big. One that
- * is equal to this value may be valid or not; the limit
- * between valid and invalid numbers is then based on the last
- * digit. For instance, if the range for longs is
- * [-2147483648..2147483647] and the input base is 10,
- * cutoff will be set to 214748364 and cutlim to either
- * 7 (neg==0) or 8 (neg==1), meaning that if we have accumulated
- * a value > 214748364, or equal but the next digit is > 7 (or 8),
- * the number is too big, and we will return a range error.
- *
- * Set any if any `digits' consumed; make it negative to indicate
- * overflow.
- */
- cutoff = (__INT)(neg ? __INT_MIN : __INT_MAX);
- cutlim = (int)(cutoff % base);
- cutoff /= base;
- if (neg) {
- if (cutlim > 0) {
- cutlim -= base;
- cutoff += 1;
- }
- cutlim = -cutlim;
- }
- for (acc = 0, any = 0;; c = *s++) {
- if (c >= '0' && c <= '9')
- i = c - '0';
- else if (c >= 'a' && c <= 'z')
- i = (c - 'a') + 10;
- else if (c >= 'A' && c <= 'Z')
- i = (c - 'A') + 10;
- else
- break;
- if (i >= base)
- break;
- if (any < 0)
- continue;
- if (neg) {
- if (acc < cutoff || (acc == cutoff && i > cutlim)) {
- acc = __INT_MIN;
- any = -1;
- errno = ERANGE;
- } else {
- any = 1;
- acc *= base;
- acc -= i;
- }
- } else {
- if (acc > cutoff || (acc == cutoff && i > cutlim)) {
- acc = __INT_MAX;
- any = -1;
- errno = ERANGE;
- } else {
- any = 1;
- acc *= base;
- acc += i;
- }
- }
- }
- if (endptr != NULL)
- /* LINTED interface specification */
- *endptr = (char *)(any ? s - 1 : nptr);
- return(acc);
-}
diff --git a/tiff/port/_strtoul.h b/tiff/port/_strtoul.h
deleted file mode 100644
index 5cb62168..00000000
--- a/tiff/port/_strtoul.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* $NetBSD: _strtoul.h,v 1.11 2017/07/06 21:08:44 joerg Exp $ */
-
-/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Original version ID:
- * NetBSD: src/lib/libc/locale/_wcstoul.h,v 1.2 2003/08/07 16:43:03 agc Exp
- */
-
-#include <assert.h>
-
-/*
- * function template for strtoul, strtoull and strtoumax.
- *
- * parameters:
- * _FUNCNAME : function name
- * __UINT : return type
- * __UINT_MAX : upper limit of the return type
- */
-__UINT
-_FUNCNAME(const char *nptr, char **endptr, int base)
-{
- const char *s;
- __UINT acc, cutoff;
- unsigned char c;
- int i, neg, any, cutlim;
-
- assert(nptr != NULL);
- /* endptr may be NULL */
-
- /* check base value */
- if (base && (base < 2 || base > 36)) {
- errno = EINVAL;
- if (endptr != NULL)
- /* LINTED interface specification */
- *endptr = (char *)(nptr);
- return 0;
- }
-
- /*
- * Skip white space and pick up leading +/- sign if any.
- * If base is 0, allow 0x for hex and 0 for octal, else
- * assume decimal; if base is already 16, allow 0x.
- */
- s = nptr;
- do {
- c = *s++;
- } while (isspace(c));
- if (c == '-') {
- neg = 1;
- c = *s++;
- } else {
- neg = 0;
- if (c == '+')
- c = *s++;
- }
- if ((base == 0 || base == 16) &&
- c == '0' && (*s == 'x' || *s == 'X') &&
- ((s[1] >= '0' && s[1] <= '9') ||
- (s[1] >= 'a' && s[1] <= 'f') ||
- (s[1] >= 'A' && s[1] <= 'F'))) {
- c = s[1];
- s += 2;
- base = 16;
- } else if (base == 0)
- base = (c == '0' ? 8 : 10);
-
- /*
- * See strtol for comments as to the logic used.
- */
- cutoff = ((__UINT)__UINT_MAX / (__UINT)base);
- cutlim = (int)((__UINT)__UINT_MAX % (__UINT)base);
- for (acc = 0, any = 0;; c = *s++) {
- if (c >= '0' && c <= '9')
- i = c - '0';
- else if (c >= 'a' && c <= 'z')
- i = (c - 'a') + 10;
- else if (c >= 'A' && c <= 'Z')
- i = (c - 'A') + 10;
- else
- break;
- if (i >= base)
- break;
- if (any < 0)
- continue;
- if (acc > cutoff || (acc == cutoff && i > cutlim)) {
- acc = __UINT_MAX;
- any = -1;
- errno = ERANGE;
- } else {
- any = 1;
- acc *= (__UINT)base;
- acc += i;
- }
- }
- if (neg && any > 0)
- acc = -acc;
- if (endptr != NULL)
- /* LINTED interface specification */
- *endptr = (char *)(any ? s - 1 : nptr);
- return(acc);
-}
diff --git a/tiff/port/lfind.c b/tiff/port/lfind.c
deleted file mode 100644
index 00ab6495..00000000
--- a/tiff/port/lfind.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Roger L. Snyder.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if 0
-static char sccsid[] = "@(#)lsearch.c 8.1 (Berkeley) 6/4/93";
-__RCSID("$NetBSD: lsearch.c,v 1.2 2005/07/06 15:47:15 drochner Exp $");
-#endif
-
-#ifdef _WIN32_WCE
-# include <wce_types.h>
-#else
-# include <sys/types.h>
-#endif
-
-#ifndef NULL
-# define NULL 0
-#endif
-
-void *
-lfind(const void *key, const void *base, size_t *nmemb, size_t size,
- int(*compar)(const void *, const void *))
-{
- char *element, *end;
-
- end = (char *)base + *nmemb * size;
- for (element = (char *)base; element < end; element += size)
- if (!compar(element, key)) /* key found */
- return element;
-
- return NULL;
-}
diff --git a/tiff/port/libport.h b/tiff/port/libport.h
index 9f2dace1..cd8acf98 100644
--- a/tiff/port/libport.h
+++ b/tiff/port/libport.h
@@ -24,9 +24,13 @@
#ifndef _LIBPORT_
#define _LIBPORT_
-#if defined(HAVE_CONFIG_H)
-# include <tif_config.h>
-#endif
+#include <libport_config.h>
+
+#if HAVE_GETOPT
+# if HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+#else
int getopt(int argc, char * const argv[], const char *optstring);
extern char *optarg;
@@ -34,38 +38,6 @@ extern int opterr;
extern int optind;
extern int optopt;
-int strcasecmp(const char *s1, const char *s2);
-
-#ifndef HAVE_GETOPT
-# define HAVE_GETOPT 1
-#endif
-
-#if !defined(HAVE_STRTOL)
-long strtol(const char *nptr, char **endptr, int base);
-#endif
-#if !defined(HAVE_STRTOLL)
-long long strtoll(const char *nptr, char **endptr, int base);
-#endif
-#if !defined(HAVE_STRTOUL)
-unsigned long strtoul(const char *nptr, char **endptr, int base);
-#endif
-#if !defined(HAVE_STRTOULL)
-unsigned long long strtoull(const char *nptr, char **endptr, int base);
-#endif
-
-#if 0
-void *
-lfind(const void *key, const void *base, size_t *nmemb, size_t size,
- int(*compar)(const void *, const void *));
-#endif
-
-#if !defined(HAVE_SNPRINTF)
-#undef vsnprintf
-#define vsnprintf _TIFF_vsnprintf_f
-
-#undef snprintf
-#define snprintf _TIFF_snprintf_f
-int snprintf(char* str, size_t size, const char* format, ...);
#endif
#endif /* ndef _LIBPORT_ */
diff --git a/tiff/port/libport_config.h.cmake.in b/tiff/port/libport_config.h.cmake.in
new file mode 100644
index 00000000..7446f872
--- /dev/null
+++ b/tiff/port/libport_config.h.cmake.in
@@ -0,0 +1,13 @@
+/* libtiff/libport_config.h.cmake.in. Not generated, but originated from autoheader. */
+/* This file must be kept up-to-date with needed substitutions from port/libport_config.h.in. */
+
+#ifndef _LIBPORT_CONFIG_H_
+#define _LIBPORT_CONFIG_H_
+
+/* Define to 1 if you have the `getopt' function. */
+#cmakedefine HAVE_GETOPT 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H 1
+
+#endif /* _LIBPORT_CONFIG_H_ */
diff --git a/tiff/port/libport_config.h.in b/tiff/port/libport_config.h.in
new file mode 100644
index 00000000..b904f619
--- /dev/null
+++ b/tiff/port/libport_config.h.in
@@ -0,0 +1,12 @@
+/* libtiff/libport_config.h.in. Not generated, but originated from autoheader. */
+
+#ifndef _LIBPORT_CONFIG_H_
+#define _LIBPORT_CONFIG_H_
+
+/* Define to 1 if you have the `getopt' function. */
+#undef HAVE_GETOPT
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+#endif /* _LIBPORT_CONFIG_H_ */
diff --git a/tiff/port/snprintf.c b/tiff/port/snprintf.c
deleted file mode 100644
index 3542ab75..00000000
--- a/tiff/port/snprintf.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Workaround for lack of snprintf(3) in Visual Studio. See
- * http://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010/8712996#8712996
- * It's a trivial wrapper around the builtin _vsnprintf_s and
- * _vscprintf functions.
- */
-
-#ifdef _MSC_VER
-
-#include <stdio.h>
-#include <stdarg.h>
-#include "libport.h"
-
-int _TIFF_vsnprintf_f(char* str, size_t size, const char* format, va_list ap)
-{
- int count = -1;
-
- if (size != 0)
-#if _MSC_VER <= 1310
- count = _vsnprintf(str, size, format, ap);
-#else
- count = _vsnprintf_s(str, size, _TRUNCATE, format, ap);
-#endif
- if (count == -1)
- count = _vscprintf(format, ap);
-
- return count;
-}
-
-int _TIFF_snprintf_f(char* str, size_t size, const char* format, ...)
-{
- int count;
- va_list ap;
-
- va_start(ap, format);
- count = vsnprintf(str, size, format, ap);
- va_end(ap);
-
- return count;
-}
-
-#endif // _MSC_VER
diff --git a/tiff/port/strcasecmp.c b/tiff/port/strcasecmp.c
deleted file mode 100644
index 65e2b411..00000000
--- a/tiff/port/strcasecmp.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 1987, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if 0
-static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93";
-__RCSID("$NetBSD: strcasecmp.c,v 1.16 2003/08/07 16:43:49 agc Exp $");
-#endif
-
-#include <ctype.h>
-#include <string.h>
-#include "libport.h"
-
-int
-strcasecmp(const char *s1, const char *s2)
-{
- const unsigned char *us1 = (const unsigned char *)s1,
- *us2 = (const unsigned char *)s2;
-
- while (tolower((int) *us1) == tolower((int) *us2++))
- if (*us1++ == '\0')
- return (0);
- return (tolower((int) *us1) - tolower((int) *--us2));
-}
diff --git a/tiff/port/strtol.c b/tiff/port/strtol.c
deleted file mode 100644
index a355dde9..00000000
--- a/tiff/port/strtol.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* $NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $ */
-
-/*-
- * Copyright (c) 2005 The DragonFly Project. All rights reserved.
- * Copyright (c) 2003 Citrus Project,
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if 0
-__RCSID("$NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $");
-#endif
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#define _FUNCNAME strtol
-#define __INT long
-#define __INT_MIN LONG_MIN
-#define __INT_MAX LONG_MAX
-
-#include "_strtol.h"
diff --git a/tiff/port/strtoll.c b/tiff/port/strtoll.c
deleted file mode 100644
index 4784b098..00000000
--- a/tiff/port/strtoll.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $ */
-
-/*-
- * Copyright (c) 2005 The DragonFly Project. All rights reserved.
- * Copyright (c) 2003 Citrus Project,
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if 0
-__RCSID("$NetBSD: strtol.c,v 1.18 2008/08/20 12:42:26 joerg Exp $");
-#endif
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#define _FUNCNAME strtoll
-#define __INT long long
-#define __INT_MIN LLONG_MIN
-#define __INT_MAX LLONG_MAX
-
-#include "_strtol.h"
diff --git a/tiff/port/strtoul.c b/tiff/port/strtoul.c
deleted file mode 100644
index dbd44f16..00000000
--- a/tiff/port/strtoul.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */
-
-/*-
- * Copyright (c) 2005 The DragonFly Project. All rights reserved.
- * Copyright (c) 2003 Citrus Project,
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if 0
-__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $");
-#endif
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#define _FUNCNAME strtoul
-#define __UINT unsigned long int
-#define __UINT_MAX ULONG_MAX
-
-#include "_strtoul.h"
diff --git a/tiff/port/strtoull.c b/tiff/port/strtoull.c
deleted file mode 100644
index 91e4ddfb..00000000
--- a/tiff/port/strtoull.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* $NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $ */
-
-/*-
- * Copyright (c) 2005 The DragonFly Project. All rights reserved.
- * Copyright (c) 2003 Citrus Project,
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if 0
-__RCSID("$NetBSD: strtoul.c,v 1.3 2008/08/20 19:58:34 oster Exp $");
-#endif
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <limits.h>
-#include <stdlib.h>
-
-#define _FUNCNAME strtoull
-#define __UINT unsigned long long int
-#define __UINT_MAX ULLONG_MAX
-
-#include "_strtoul.h"
diff --git a/tiff/test/CMakeLists.txt b/tiff/test/CMakeLists.txt
index bffb8bf7..0a445c94 100644
--- a/tiff/test/CMakeLists.txt
+++ b/tiff/test/CMakeLists.txt
@@ -22,11 +22,6 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-include_directories(${PROJECT_SOURCE_DIR}/libtiff
- ${PROJECT_BINARY_DIR}/libtiff
- ${CMAKE_CURRENT_BINARY_DIR}
- ${TIFF_INCLUDES})
-
# Test scripts (not used by CMake)
set(TESTSCRIPTS
bmp2tiff_palette.sh
@@ -168,58 +163,65 @@ set(IMAGES_EXTRA_DIST
${PNMIMAGES}
${TIFFIMAGES})
-extra_dist(
- ${TESTSCRIPTS}
- ${IMAGES_EXTRA_DIST}
- common.sh)
-
set(noinst_HEADERS tifftest.h)
-add_executable(ascii_tag ascii_tag.c)
-target_link_libraries(ascii_tag tiff port)
+add_executable(ascii_tag)
+target_sources(ascii_tag PRIVATE ascii_tag.c)
+target_link_libraries(ascii_tag PRIVATE tiff port)
-add_executable(long_tag long_tag.c check_tag.c)
-target_link_libraries(long_tag tiff port)
+add_executable(long_tag)
+target_sources(long_tag PRIVATE long_tag.c check_tag.c)
+target_link_libraries(long_tag PRIVATE tiff port)
-add_executable(short_tag short_tag.c check_tag.c)
-target_link_libraries(short_tag tiff port)
+add_executable(short_tag)
+target_sources(short_tag PRIVATE short_tag.c check_tag.c)
+target_link_libraries(short_tag PRIVATE tiff port)
-add_executable(strip_rw strip_rw.c strip.c test_arrays.c test_arrays.h)
-target_link_libraries(strip_rw tiff port)
+add_executable(strip_rw)
+target_sources(strip_rw PRIVATE strip_rw.c strip.c test_arrays.c test_arrays.h)
+target_link_libraries(strip_rw PRIVATE tiff port)
-add_executable(rewrite rewrite_tag.c)
-target_link_libraries(rewrite tiff port)
+add_executable(rewrite)
+target_sources(rewrite PRIVATE rewrite_tag.c)
+target_link_libraries(rewrite PRIVATE tiff port)
if(JPEG_SUPPORT)
- add_executable(raw_decode raw_decode.c)
- target_link_libraries(raw_decode tiff port)
+ add_executable(raw_decode)
+ target_sources(raw_decode PRIVATE raw_decode.c)
+ target_link_libraries(raw_decode PRIVATE tiff port JPEG::JPEG)
endif()
-add_executable(custom_dir custom_dir.c)
-target_link_libraries(custom_dir tiff port)
+add_executable(custom_dir)
+target_sources(custom_dir PRIVATE custom_dir.c)
+target_link_libraries(custom_dir PRIVATE tiff port)
if(NOT BUILD_SHARED_LIBS)
-add_executable(rational_precision2double rational_precision2double.c)
-target_link_libraries(rational_precision2double tiff port)
+add_executable(rational_precision2double)
+target_sources(rational_precision2double PRIVATE rational_precision2double.c)
+target_link_libraries(rational_precision2double PRIVATE tiff port)
add_test(NAME "rational_precision2double"
COMMAND "rational_precision2double")
endif()
if(NOT BUILD_SHARED_LIBS)
-add_executable(custom_dir_EXIF_231 custom_dir_EXIF_231.c)
-target_link_libraries(custom_dir_EXIF_231 tiff port)
+add_executable(custom_dir_EXIF_231)
+target_sources(custom_dir_EXIF_231 PRIVATE custom_dir_EXIF_231.c)
+target_link_libraries(custom_dir_EXIF_231 PRIVATE tiff port)
add_test(NAME "custom_dir_EXIF_231"
COMMAND "custom_dir_EXIF_231")
endif()
-add_executable(defer_strile_loading defer_strile_loading.c)
-target_link_libraries(defer_strile_loading tiff port)
+add_executable(defer_strile_loading)
+target_sources(defer_strile_loading PRIVATE defer_strile_loading.c)
+target_link_libraries(defer_strile_loading PRIVATE tiff port)
-add_executable(defer_strile_writing defer_strile_writing.c)
-target_link_libraries(defer_strile_writing tiff port)
+add_executable(defer_strile_writing)
+target_sources(defer_strile_writing PRIVATE defer_strile_writing.c)
+target_link_libraries(defer_strile_writing PRIVATE tiff port)
-add_executable(testtypes testtypes.c)
-target_link_libraries(testtypes tiff port)
+add_executable(testtypes)
+target_sources(testtypes PRIVATE testtypes.c)
+target_link_libraries(testtypes PRIVATE tiff port)
if(WEBP_SUPPORT AND EMSCRIPTEN)
# Emscripten is pretty finnicky about linker flags.
diff --git a/tiff/test/Makefile.in b/tiff/test/Makefile.in
index 15b7b826..0c2ceb4e 100644
--- a/tiff/test/Makefile.in
+++ b/tiff/test/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -132,8 +132,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
@HAVE_JPEG_TRUE@am__EXEEXT_1 = raw_decode$(EXEEXT)
@@ -192,7 +194,7 @@ AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libtiff -I$(top_builddir)/port
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/ascii_tag.Po \
@@ -661,6 +663,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
diff --git a/tiff/test/ascii_tag.c b/tiff/test/ascii_tag.c
index 9a56d31d..944dd57c 100644
--- a/tiff/test/ascii_tag.c
+++ b/tiff/test/ascii_tag.c
@@ -108,8 +108,8 @@ main()
for (i = 0; i < NTAGS; i++) {
if (!TIFFSetField(tif, ascii_tags[i].tag,
ascii_tags[i].value)) {
- fprintf(stderr, "Can't set tag %lu.\n",
- (unsigned long)ascii_tags[i].tag);
+ fprintf(stderr, "Can't set tag %"PRIu32".\n",
+ ascii_tags[i].tag);
goto failure;
}
}
@@ -144,8 +144,8 @@ main()
for (i = 0; i < NTAGS; i++) {
if (!TIFFGetField(tif, ascii_tags[i].tag, &value)
|| strcmp(value, ascii_tags[i].value)) {
- fprintf(stderr, "Can't get tag %lu.\n",
- (unsigned long)ascii_tags[i].tag);
+ fprintf(stderr, "Can't get tag %"PRIu32".\n",
+ ascii_tags[i].tag);
goto failure;
}
}
diff --git a/tiff/test/check_tag.c b/tiff/test/check_tag.c
index 5750d683..63554866 100644
--- a/tiff/test/check_tag.c
+++ b/tiff/test/check_tag.c
@@ -30,18 +30,18 @@
#include "tiffio.h"
int
-CheckShortField(TIFF *tif, const ttag_t field, const uint16 value)
+CheckShortField(TIFF *tif, const ttag_t field, const uint16_t value)
{
- uint16 tmp = 123;
+ uint16_t tmp = 123;
if (!TIFFGetField(tif, field, &tmp)) {
- fprintf (stderr, "Problem fetching tag %lu.\n",
- (unsigned long) field);
+ fprintf (stderr, "Problem fetching tag %"PRIu32".\n",
+ field);
return -1;
}
if (tmp != value) {
- fprintf (stderr, "Wrong SHORT value fetched for tag %lu.\n",
- (unsigned long) field);
+ fprintf (stderr, "Wrong SHORT value fetched for tag %"PRIu32".\n",
+ field);
return -1;
}
@@ -49,18 +49,18 @@ CheckShortField(TIFF *tif, const ttag_t field, const uint16 value)
}
int
-CheckShortPairedField(TIFF *tif, const ttag_t field, const uint16 *values)
+CheckShortPairedField(TIFF *tif, const ttag_t field, const uint16_t *values)
{
- uint16 tmp[2] = { 123, 456 };
+ uint16_t tmp[2] = {123, 456 };
if (!TIFFGetField(tif, field, tmp, tmp + 1)) {
- fprintf (stderr, "Problem fetching tag %lu.\n",
- (unsigned long) field);
+ fprintf (stderr, "Problem fetching tag %"PRIu32".\n",
+ field);
return -1;
}
if (tmp[0] != values[0] || tmp[1] != values[1]) {
- fprintf (stderr, "Wrong SHORT PAIR fetched for tag %lu.\n",
- (unsigned long) field);
+ fprintf (stderr, "Wrong SHORT PAIR fetched for tag %"PRIu32".\n",
+ field);
return -1;
}
@@ -68,18 +68,18 @@ CheckShortPairedField(TIFF *tif, const ttag_t field, const uint16 *values)
}
int
-CheckLongField(TIFF *tif, const ttag_t field, const uint32 value)
+CheckLongField(TIFF *tif, const ttag_t field, const uint32_t value)
{
- uint32 tmp = 123;
+ uint32_t tmp = 123;
if (!TIFFGetField(tif, field, &tmp)) {
- fprintf (stderr, "Problem fetching tag %lu.\n",
- (unsigned long) field);
+ fprintf (stderr, "Problem fetching tag %"PRIu32".\n",
+ field);
return -1;
}
if (tmp != value) {
- fprintf (stderr, "Wrong LONG value fetched for tag %lu.\n",
- (unsigned long) field);
+ fprintf (stderr, "Wrong LONG value fetched for tag %"PRIu32".\n",
+ field);
return -1;
}
diff --git a/tiff/test/custom_dir.c b/tiff/test/custom_dir.c
index 3b3ad279..42290ae8 100644
--- a/tiff/test/custom_dir.c
+++ b/tiff/test/custom_dir.c
@@ -42,12 +42,12 @@
static const char filename[] = "custom_dir.tif";
#define SPP 3 /* Samples per pixel */
-const uint16 width = 1;
-const uint16 length = 1;
-const uint16 bps = 8;
-const uint16 photometric = PHOTOMETRIC_RGB;
-const uint16 rows_per_strip = 1;
-const uint16 planarconfig = PLANARCONFIG_CONTIG;
+const uint16_t width = 1;
+const uint16_t length = 1;
+const uint16_t bps = 8;
+const uint16_t photometric = PHOTOMETRIC_RGB;
+const uint16_t rows_per_strip = 1;
+const uint16_t planarconfig = PLANARCONFIG_CONTIG;
static TIFFField
customFields[] = {
@@ -62,11 +62,11 @@ main()
{
TIFF *tif;
unsigned char buf[SPP] = { 0, 127, 255 };
- uint64 dir_offset = 0, dir_offset2 = 0;
- uint64 read_dir_offset = 0, read_dir_offset2 = 0;
- uint64 *dir_offset2_ptr = NULL;
+ uint64_t dir_offset = 0, dir_offset2 = 0;
+ uint64_t read_dir_offset = 0, read_dir_offset2 = 0;
+ uint64_t *dir_offset2_ptr = NULL;
char *ascii_value;
- uint16 count16 = 0;
+ uint16_t count16 = 0;
/* We write the main directory as a simple image. */
diff --git a/tiff/test/custom_dir_EXIF_231.c b/tiff/test/custom_dir_EXIF_231.c
index 4c70e48f..892c442b 100644
--- a/tiff/test/custom_dir_EXIF_231.c
+++ b/tiff/test/custom_dir_EXIF_231.c
@@ -1,4 +1,3 @@
-
/*
* Copyright (c) 2012, Frank Warmerdam <warmerdam@pobox.com>
*
@@ -40,7 +39,7 @@
/*------------
- * This version writes the GPS and EXIF tags correctly, without additonal main-IFD and parameters!
+ * This version writes the GPS and EXIF tags correctly, without additional main-IFD and parameters!
* In contrary, custom_dir.c does write additional main-IFD and parameters to file.
-------------*/
@@ -67,6 +66,7 @@
#include "tif_config.h"
#include <stdio.h>
+#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <errno.h>
@@ -88,12 +88,12 @@ static const char filename[] = "custom_dir_EXIF_231.tif";
static const char filenameBigTiff[] = "custom_dir_EXIF_231_Big.tif";
#define SPP 3 /* Samples per pixel */
-const uint16 width = 1;
-const uint16 length = 1;
-const uint16 bps = 8;
-const uint16 photometric = PHOTOMETRIC_RGB;
-const uint16 rows_per_strip = 1;
-const uint16 planarconfig = PLANARCONFIG_CONTIG;
+const uint16_t width = 1;
+const uint16_t length = 1;
+const uint16_t bps = 8;
+const uint16_t photometric = PHOTOMETRIC_RGB;
+const uint16_t rows_per_strip = 1;
+const uint16_t planarconfig = PLANARCONFIG_CONTIG;
int
@@ -150,9 +150,9 @@ int
write_test_tiff(TIFF *tif, const char *filenameRead)
{
unsigned char buf[SPP] = { 0, 127, 255 };
- uint64 dir_offset = 0;
- uint64 dir_offset_GPS = 0, dir_offset_EXIF = 0;
- uint64 read_dir_offset = 0;
+ uint64_t dir_offset = 0;
+ uint64_t dir_offset_GPS = 0, dir_offset_EXIF = 0;
+ uint64_t read_dir_offset = 0;
/*-- Additional variables --*/
int retCode, retCode2;
unsigned char exifVersion[4] = {'0','2','3','1'}; /* EXIF 2.31 version is 4 characters of a string! */
@@ -161,7 +161,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
float auxFloat = 0.0f;
double auxDouble = 0.0;
char auxChar = 0;
- uint32 auxUint32 = 0;
+ uint32_t auxUint32 = 0;
short auxShort=0;
long auxLong = 0;
void *pVoid;
@@ -200,7 +200,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
float auxFloatArrayN2[3] = { -1.0f / 7.0f, -61.23456789012345f, -62.3f };
/* -- Variables for reading -- */
- uint16 count16 = 0;
+ uint16_t count16 = 0;
union {
long Long;
short Short1;
@@ -332,7 +332,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
goto failure;
}
- /*- Varable Array: TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT */
+ /*- Variable Array: TIFF_RATIONAL, 0, TIFF_SETGET_C16_FLOAT */
if (!TIFFSetField(tif, TIFFTAG_BLACKLEVEL, 3, auxFloatArrayN1)) {
fprintf(stderr, "Can't set TIFFTAG_BLACKLEVEL tag.\n");
goto failure;
@@ -597,6 +597,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
nTags = tFieldArray->count;
for (i=0; i<nTags; i++) {
+ bool deferredSetField = false;
tTag = tFieldArray->fields[i].field_tag;
tType = tFieldArray->fields[i].field_type; /* e.g. TIFF_RATIONAL */
tWriteCount = tFieldArray->fields[i].field_writecount;
@@ -659,7 +660,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
/* _Cxx_ just defines the size of the count parameter for the array as C0=char, C16=short or C32=long */
/*-- Check, if it is a single parameter, a fixed array or a variable array */
if (tWriteCount == 1) {
- fprintf (stderr, "WriteCount for .set_field_type %d should be -1 or greather than 1! %s\n", tSetFieldType, tFieldArray->fields[i].field_name);
+ fprintf (stderr, "WriteCount for .set_field_type %d should be -1 or greater than 1! %s\n", tSetFieldType, tFieldArray->fields[i].field_name);
} else {
/*-- Either fix or variable array --*/
/* For arrays, distinguishing between float or double is essential, even for writing */
@@ -690,46 +691,55 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
case TIFF_SETGET_C32_SINT8:
/* For arrays, distinguishing between float or double is essential, even for writing */
pVoid = &auxCharArrayW[i];
+ deferredSetField = true;
+ break;
case TIFF_SETGET_C0_UINT16:
case TIFF_SETGET_C0_SINT16:
case TIFF_SETGET_C16_UINT16:
case TIFF_SETGET_C16_SINT16:
case TIFF_SETGET_C32_UINT16:
case TIFF_SETGET_C32_SINT16:
- if (pVoid == NULL) pVoid = &auxShortArrayW[i];
+ pVoid = &auxShortArrayW[i];
+ deferredSetField = true;
+ break;
case TIFF_SETGET_C0_UINT32:
case TIFF_SETGET_C0_SINT32:
case TIFF_SETGET_C16_UINT32:
case TIFF_SETGET_C16_SINT32:
case TIFF_SETGET_C32_UINT32:
case TIFF_SETGET_C32_SINT32:
- if (pVoid == NULL) pVoid = &auxLongArrayW[i];
- /* _Cxx_ just defines the size of the count parameter for the array as C0=char, C16=short or C32=long */
- /*-- Check, if it is a single parameter, a fixed array or a variable array */
- if (tWriteCount == 1) {
- fprintf (stderr, "WriteCount for .set_field_type %d should be -1 or greather than 1! %s\n", tSetFieldType, tFieldArray->fields[i].field_name);
+ pVoid = &auxLongArrayW[i];
+ deferredSetField = true;
+ break;
+ default:
+ fprintf (stderr, "SetFieldType %d not defined within writing switch for %s.\n", tSetFieldType, tFieldName);
+ }; /*-- switch() --*/
+
+ if (deferredSetField) {
+ /* _Cxx_ just defines the size of the count parameter for the array as C0=char, C16=short or C32=long */
+ /*-- Check, if it is a single parameter, a fixed array or a variable array */
+ if (tWriteCount == 1) {
+ fprintf(stderr, "WriteCount for .set_field_type %d should be -1 or greater than 1! %s\n",
+ tSetFieldType, tFieldArray->fields[i].field_name);
+ } else {
+ /*-- Either fix or variable array --*/
+ /* Now decide between fixed or variable array */
+ if (tWriteCount > 1) {
+ /* fixed array with needed arraysize defined in .field_writecount */
+ if (!TIFFSetField(tif, tTag, pVoid)) {
+ fprintf(stderr, "Can't write %s\n", tFieldArray->fields[i].field_name);
+ goto failure;
+ }
} else {
- /*-- Either fix or variable array --*/
- /* Now decide between fixed or variable array */
- if (tWriteCount > 1) {
- /* fixed array with needed arraysize defined in .field_writecount */
- if (!TIFFSetField( tif, tTag, pVoid)) {
- fprintf (stderr, "Can't write %s\n", tFieldArray->fields[i].field_name);
- goto failure;
- }
- } else {
- /* special treatment of variable array */
- /* for test, use always arraysize of VARIABLE_ARRAY_SIZE */
- if (!TIFFSetField( tif, tTag, VARIABLE_ARRAY_SIZE, pVoid)) {
- fprintf (stderr, "Can't write %s\n", tFieldArray->fields[i].field_name);
- goto failure;
- }
+ /* special treatment of variable array */
+ /* for test, use always arraysize of VARIABLE_ARRAY_SIZE */
+ if (!TIFFSetField(tif, tTag, VARIABLE_ARRAY_SIZE, pVoid)) {
+ fprintf(stderr, "Can't write %s\n", tFieldArray->fields[i].field_name);
+ goto failure;
}
}
- break;
- default:
- fprintf (stderr, "SetFieldType %d not defined within writing switch for %s.\n", tSetFieldType, tFieldName);
- }; /*-- switch() --*/
+ }
+ }
} /*-- for() --*/
/*================= EXIF: END Writing arbitrary data to the EXIF fields END END END ==============*/
#endif /*-- WRITE_ALL_EXIF_TAGS --*/
@@ -784,12 +794,12 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
retCode = TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &auxUint32 );
if (!retCode) { fprintf(stderr, "Can't read %s\n", "TIFFTAG_IMAGEWIDTH"); }
if (auxUint32 != width) {
- fprintf (stderr, "Read value of IMAGEWIDTH %d differs from set value %d\n", auxUint32, width);
+ fprintf (stderr, "Read value of IMAGEWIDTH %"PRIu32" differs from set value %"PRIu16"\n", auxUint32, width);
}
retCode = TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &auxUint32 );
if (!retCode) { fprintf(stderr, "Can't read %s\n", "TIFFTAG_IMAGELENGTH"); }
if (auxUint32 != width) {
- fprintf (stderr, "Read value of TIFFTAG_IMAGELENGTH %d differs from set value %d\n", auxUint32, length);
+ fprintf (stderr, "Read value of TIFFTAG_IMAGELENGTH %"PRIu32" differs from set value %"PRIu16"\n", auxUint32, length);
}
#ifdef ADDITIONAL_TAGS
@@ -956,7 +966,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
/* New interface allows also double precision for TIFF_RATIONAL */
auxDouble = auxDblUnion.dbl;
} else {
- /* Old interface reads TIFF_RATIONAL defined as TIFF_SETGET_DOUBLE alwasy as FLOAT */
+ /* Old interface reads TIFF_RATIONAL defined as TIFF_SETGET_DOUBLE always as FLOAT */
auxDouble = (double)auxDblUnion.flt1;
}
/* compare read values with written ones */
@@ -999,7 +1009,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
/* New interface allows also double precision for TIFF_RATIONAL */
auxDouble = auxDblUnion.dbl;
} else {
- /* Old interface reads TIFF_RATIONAL defined as TIFF_SETGET_DOUBLE alwasy as FLOAT */
+ /* Old interface reads TIFF_RATIONAL defined as TIFF_SETGET_DOUBLE always as FLOAT */
auxDouble = (double)auxDblUnion.flt1;
}
/* compare read values with written ones */
@@ -1027,7 +1037,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
/* New interface allows also double precision for TIFF_RATIONAL */
auxDouble = auxDblUnion.dbl;
} else {
- /* Old interface reads TIFF_RATIONAL defined as TIFF_SETGET_DOUBLE alwasy as FLOAT */
+ /* Old interface reads TIFF_RATIONAL defined as TIFF_SETGET_DOUBLE always as FLOAT */
auxDouble = (double)auxDblUnion.flt1;
}
/* compare read values with written ones */
@@ -1078,6 +1088,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
}
for (i=0; i<nTags; i++) {
+ bool deferredSetField = false;
tTag = tFieldArray->fields[i].field_tag;
tType = tFieldArray->fields[i].field_type; /* e.g. TIFF_RATIONAL */
tWriteCount = tFieldArray->fields[i].field_writecount;
@@ -1096,7 +1107,8 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
break;
}
/* Save string from temporary buffer and compare with written string. */
- strncpy(auxCharArray, pAscii, sizeof(auxCharArray));
+ strncpy(auxCharArray, pAscii, sizeof(auxCharArray) - 1u);
+ auxCharArray[sizeof(auxCharArray) - 1u] = '\0';
if (tWriteCount > 0) auxLong = tWriteCount-1; else auxLong = (long)strlen(auxCharArray);
retCode2 = strncmp(auxCharArray, auxTextArrayW[i], auxLong);
if (retCode2 != 0) {
@@ -1188,7 +1200,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
auxDouble = auxDblUnion.dbl;
}
else {
- /* Old interface reads TIFF_RATIONAL defined as TIFF_SETGET_DOUBLE alwasy as FLOAT */
+ /* Old interface reads TIFF_RATIONAL defined as TIFF_SETGET_DOUBLE always as FLOAT */
auxDouble = (double)auxDblUnion.flt1;
}
}
@@ -1216,7 +1228,7 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
/* _Cxx_ just defines the size of the count parameter for the array as C0=char, C16=short or C32=long */
/*-- Check, if it is a single parameter, a fixed array or a variable array */
if (tWriteCount == 1) {
- fprintf (stderr, "Reading: WriteCount for .set_field_type %d should be -1 or greather than 1! %s\n", tSetFieldType, tFieldArray->fields[i].field_name);
+ fprintf (stderr, "Reading: WriteCount for .set_field_type %d should be -1 or greater than 1! %s\n", tSetFieldType, tFieldArray->fields[i].field_name);
} else {
/*-- Either fix or variable array --*/
/* For arrays, distinguishing between float or double is essential. */
@@ -1277,99 +1289,113 @@ write_test_tiff(TIFF *tif, const char *filenameRead)
case TIFF_SETGET_C32_SINT8:
/* For arrays, distinguishing between float or double is essential, even for writing */
pVoid = &auxCharArrayW[i];
- case TIFF_SETGET_C0_UINT16:
+ deferredSetField = true;
+ break;
+ case TIFF_SETGET_C0_UINT16:
case TIFF_SETGET_C0_SINT16:
case TIFF_SETGET_C16_UINT16:
case TIFF_SETGET_C16_SINT16:
case TIFF_SETGET_C32_UINT16:
case TIFF_SETGET_C32_SINT16:
- if (pVoid == NULL) pVoid = &auxShortArrayW[i];
+ pVoid = &auxShortArrayW[i];
+ deferredSetField = true;
+break;
case TIFF_SETGET_C0_UINT32:
case TIFF_SETGET_C0_SINT32:
case TIFF_SETGET_C16_UINT32:
case TIFF_SETGET_C16_SINT32:
case TIFF_SETGET_C32_UINT32:
case TIFF_SETGET_C32_SINT32:
- if (pVoid == NULL) pVoid = &auxLongArrayW[i];
- /* _Cxx_ just defines the size of the count parameter for the array as C0=char, C16=short or C32=long */
- /*-- Check, if it is a single parameter, a fixed array or a variable array */
- if (tWriteCount == 1) {
- fprintf (stderr, "WriteCount for .set_field_type %d should be -1 or greather than 1! %s\n", tSetFieldType, tFieldArray->fields[i].field_name);
+ pVoid = &auxLongArrayW[i];
+ deferredSetField = true;
+ break;
+ default:
+ fprintf (stderr, "SetFieldType %d not defined within writing switch for %s.\n", tSetFieldType, tFieldName);
+ GOTOFAILURE
+ }; /*-- switch() --*/
+
+ if(deferredSetField) {
+ /* _Cxx_ just defines the size of the count parameter for the array as C0=char, C16=short or C32=long */
+ /*-- Check, if it is a single parameter, a fixed array or a variable array */
+ if (tWriteCount == 1) {
+ fprintf(stderr, "WriteCount for .set_field_type %d should be -1 or greater than 1! %s\n",
+ tSetFieldType, tFieldArray->fields[i].field_name);
+ } else {
+ /*-- Either fix or variable array --*/
+ /* Now decide between fixed or variable array */
+ if (tWriteCount > 1) {
+ /* fixed array with needed arraysize defined in .field_writecount */
+ if (!TIFFGetField(tif, tTag, &pVoidArray)) {
+ fprintf(stderr, "Can't read %s\n", tFieldArray->fields[i].field_name);
+ GOTOFAILURE_ALL_EXIF
+ break;
+ }
+ /* set tWriteCount to number of read samples for next steps */
+ auxLong = tWriteCount;
} else {
- /*-- Either fix or variable array --*/
- /* Now decide between fixed or variable array */
- if (tWriteCount > 1) {
- /* fixed array with needed arraysize defined in .field_writecount */
- if (!TIFFGetField( tif, tTag, &pVoidArray)) {
- fprintf (stderr, "Can't read %s\n", tFieldArray->fields[i].field_name);
- GOTOFAILURE_ALL_EXIF
- break;
- }
- /* set tWriteCount to number of read samples for next steps */
- auxLong = tWriteCount;
- } else {
- /* special treatment of variable array */
- /* for test, use always arraysize of VARIABLE_ARRAY_SIZE */
- if (!TIFFGetField( tif, tTag, &unionLong, &pVoidArray)) {
- fprintf (stderr, "Can't read %s\n", tFieldArray->fields[i].field_name);
- GOTOFAILURE_ALL_EXIF
- break;
- }
- /* set tWriteCount to number of read samples for next steps */
- auxLong = unionLong.Short1;
+ /* special treatment of variable array */
+ /* for test, use always arraysize of VARIABLE_ARRAY_SIZE */
+ if (!TIFFGetField(tif, tTag, &unionLong, &pVoidArray)) {
+ fprintf(stderr, "Can't read %s\n", tFieldArray->fields[i].field_name);
+ GOTOFAILURE_ALL_EXIF
+ break;
}
- /* Save values from temporary array */
- if (tSetFieldType == TIFF_SETGET_C0_UINT8 || tSetFieldType == TIFF_SETGET_C0_SINT8 ||
- tSetFieldType == TIFF_SETGET_C16_UINT8 || tSetFieldType == TIFF_SETGET_C16_SINT8 ||
- tSetFieldType == TIFF_SETGET_C32_UINT8 || tSetFieldType == TIFF_SETGET_C32_SINT8 ) {
- memcpy(&auxCharArray, pVoidArray,(auxLong * sizeof(auxCharArray[0])));
- /* Compare and check values */
- for (j=0; j<auxLong; j++) {
- if (tTag == EXIFTAG_EXIFVERSION) {
- /*-- Use exifVersion[] instead of auxCharArrayW[] for differently set EXIFVERSION tag */
- if (auxCharArray[j] != exifVersion[j]) {
- fprintf(stderr, "Read value %d of %s #%d %d differs from set value %d\n", i, tFieldName, j, auxCharArray[j], auxCharArrayW[i + j]);
- GOTOFAILURE_ALL_EXIF
- }
- } else {
- if (auxCharArray[j] != auxCharArrayW[i + j]) {
- fprintf(stderr, "Read value %d of %s #%d %d differs from set value %d\n", i, tFieldName, j, auxCharArray[j], auxCharArrayW[i + j]);
- GOTOFAILURE_ALL_EXIF
- }
- }
- }
- } else if (tSetFieldType == TIFF_SETGET_C0_UINT16 || tSetFieldType == TIFF_SETGET_C0_SINT16 ||
- tSetFieldType == TIFF_SETGET_C16_UINT16 || tSetFieldType == TIFF_SETGET_C16_SINT16 ||
- tSetFieldType == TIFF_SETGET_C32_UINT16 || tSetFieldType == TIFF_SETGET_C32_SINT16 ) {
- memcpy(&auxShortArray, pVoidArray,(auxLong * sizeof(auxShortArray[0])));
- /* Compare and check values */
- for (j=0; j<auxLong; j++) {
- if (auxShortArray[j] != auxShortArrayW[i+j]) {
- fprintf (stderr, "Read value %d of %s #%d %d differs from set value %d\n", i, tFieldName, j, auxShortArray[j], auxShortArrayW[i+j]);
+ /* set tWriteCount to number of read samples for next steps */
+ auxLong = unionLong.Short1;
+ }
+ /* Save values from temporary array */
+ if (tSetFieldType == TIFF_SETGET_C0_UINT8 || tSetFieldType == TIFF_SETGET_C0_SINT8 ||
+ tSetFieldType == TIFF_SETGET_C16_UINT8 || tSetFieldType == TIFF_SETGET_C16_SINT8 ||
+ tSetFieldType == TIFF_SETGET_C32_UINT8 || tSetFieldType == TIFF_SETGET_C32_SINT8) {
+ memcpy(&auxCharArray, pVoidArray, (auxLong * sizeof(auxCharArray[0])));
+ /* Compare and check values */
+ for (j = 0; j < auxLong; j++) {
+ if (tTag == EXIFTAG_EXIFVERSION) {
+ /*-- Use exifVersion[] instead of auxCharArrayW[] for differently set EXIFVERSION tag */
+ if (auxCharArray[j] != exifVersion[j]) {
+ fprintf(stderr, "Read value %d of %s #%d %d differs from set value %d\n", i, tFieldName,
+ j, auxCharArray[j], auxCharArrayW[i + j]);
GOTOFAILURE_ALL_EXIF
}
- }
- } else if (tSetFieldType == TIFF_SETGET_C0_UINT32 || tSetFieldType == TIFF_SETGET_C0_SINT32 ||
- tSetFieldType == TIFF_SETGET_C16_UINT32 || tSetFieldType == TIFF_SETGET_C16_SINT32 ||
- tSetFieldType == TIFF_SETGET_C32_UINT32 || tSetFieldType == TIFF_SETGET_C32_SINT32 ) {
- memcpy(&auxLongArray, pVoidArray,(auxLong * sizeof(auxLongArray[0])));
- /* Compare and check values */
- for (j=0; j<auxLong; j++) {
- if (auxLongArray[j] != auxLongArrayW[i+j]) {
- fprintf (stderr, "Read value %d of %s #%d %ld differs from set value %ld\n", i, tFieldName, j, auxLongArray[j], auxLongArrayW[i+j]);
+ } else {
+ if (auxCharArray[j] != auxCharArrayW[i + j]) {
+ fprintf(stderr, "Read value %d of %s #%d %d differs from set value %d\n", i, tFieldName,
+ j, auxCharArray[j], auxCharArrayW[i + j]);
GOTOFAILURE_ALL_EXIF
}
}
- } else {
- fprintf (stderr, "SetFieldType %d not defined within switch case reading for UINT for %s.\n", tSetFieldType, tFieldName);
- GOTOFAILURE
}
+ } else if (tSetFieldType == TIFF_SETGET_C0_UINT16 || tSetFieldType == TIFF_SETGET_C0_SINT16 ||
+ tSetFieldType == TIFF_SETGET_C16_UINT16 || tSetFieldType == TIFF_SETGET_C16_SINT16 ||
+ tSetFieldType == TIFF_SETGET_C32_UINT16 || tSetFieldType == TIFF_SETGET_C32_SINT16) {
+ memcpy(&auxShortArray, pVoidArray, (auxLong * sizeof(auxShortArray[0])));
+ /* Compare and check values */
+ for (j = 0; j < auxLong; j++) {
+ if (auxShortArray[j] != auxShortArrayW[i + j]) {
+ fprintf(stderr, "Read value %d of %s #%d %d differs from set value %d\n", i, tFieldName, j,
+ auxShortArray[j], auxShortArrayW[i + j]);
+ GOTOFAILURE_ALL_EXIF
+ }
+ }
+ } else if (tSetFieldType == TIFF_SETGET_C0_UINT32 || tSetFieldType == TIFF_SETGET_C0_SINT32 ||
+ tSetFieldType == TIFF_SETGET_C16_UINT32 || tSetFieldType == TIFF_SETGET_C16_SINT32 ||
+ tSetFieldType == TIFF_SETGET_C32_UINT32 || tSetFieldType == TIFF_SETGET_C32_SINT32) {
+ memcpy(&auxLongArray, pVoidArray, (auxLong * sizeof(auxLongArray[0])));
+ /* Compare and check values */
+ for (j = 0; j < auxLong; j++) {
+ if (auxLongArray[j] != auxLongArrayW[i + j]) {
+ fprintf(stderr, "Read value %d of %s #%d %ld differs from set value %ld\n", i, tFieldName,
+ j, auxLongArray[j], auxLongArrayW[i + j]);
+ GOTOFAILURE_ALL_EXIF
+ }
+ }
+ } else {
+ fprintf(stderr, "SetFieldType %d not defined within switch case reading for UINT for %s.\n",
+ tSetFieldType, tFieldName);
+ GOTOFAILURE
}
- break;
- default:
- fprintf (stderr, "SetFieldType %d not defined within writing switch for %s.\n", tSetFieldType, tFieldName);
- GOTOFAILURE
- }; /*-- switch() --*/
+ }
+ }
} /*-- for() --*/
/*================= EXIF: END Reading arbitrary data to the EXIF fields END END END ==============*/
#endif /*-- READ_ALL_EXIF_TAGS --*/
diff --git a/tiff/test/defer_strile_writing.c b/tiff/test/defer_strile_writing.c
index 4e358567..b918a228 100644
--- a/tiff/test/defer_strile_writing.c
+++ b/tiff/test/defer_strile_writing.c
@@ -131,7 +131,7 @@ int test(const char* mode, int tiled, int height)
ret = TIFFForceStrileArrayWriting(tif);
assert(ret);
- /* Now write data on frist directory */
+ /* Now write data on first directory */
ret = TIFFSetDirectory( tif, 0 );
assert(ret);
diff --git a/tiff/test/long_tag.c b/tiff/test/long_tag.c
index 4bfdf805..79f0235c 100644
--- a/tiff/test/long_tag.c
+++ b/tiff/test/long_tag.c
@@ -37,22 +37,22 @@
#include "tiffio.h"
-extern int CheckLongField(TIFF *, ttag_t, uint32);
+extern int CheckLongField(TIFF *, ttag_t, uint32_t);
const char *filename = "long_test.tiff";
static struct Tags {
ttag_t tag;
short count;
- uint32 value;
+ uint32_t value;
} long_tags[] = {
{ TIFFTAG_SUBFILETYPE, 1, FILETYPE_REDUCEDIMAGE|FILETYPE_PAGE|FILETYPE_MASK }
};
#define NTAGS (sizeof (long_tags) / sizeof (long_tags[0]))
-const uint32 width = 1;
-const uint32 length = 1;
-const uint32 rows_per_strip = 1;
+const uint32_t width = 1;
+const uint32_t length = 1;
+const uint32_t rows_per_strip = 1;
int
main(int argc, char **argv)
diff --git a/tiff/test/rational_precision2double.c b/tiff/test/rational_precision2double.c
index e33cc97d..4e5c0bbf 100644
--- a/tiff/test/rational_precision2double.c
+++ b/tiff/test/rational_precision2double.c
@@ -72,12 +72,12 @@
int write_test_tiff(TIFF *tif, const char *filenameRead, int blnAllCustomTags);
#define SPP 3 /* Samples per pixel */
-const uint16 width = 1;
-const uint16 length = 1;
-const uint16 bps = 8;
-const uint16 photometric = PHOTOMETRIC_RGB;
-const uint16 rows_per_strip = 1;
-const uint16 planarconfig = PLANARCONFIG_CONTIG;
+const uint16_t width = 1;
+const uint16_t length = 1;
+const uint16_t bps = 8;
+const uint16_t photometric = PHOTOMETRIC_RGB;
+const uint16_t rows_per_strip = 1;
+const uint16_t planarconfig = PLANARCONFIG_CONTIG;
/*-- Additional custom TIFF tags for testing of Rational2Double precision --*/
#define TIFFTAG_RATIONAL_DOUBLE 60000
@@ -148,11 +148,11 @@ It merges in our new fields and then calls the next extender if there is one in
static void
_XTIFFDefaultDirectory(TIFF *tif)
{
- uint32 n, nadded;
+ uint32_t n, nadded;
/* Install the extended Tag field info */
n = N(tifFieldInfo);
- //_TIFFMergeFields(tif, const TIFFField info[], uint32 n);
+ //_TIFFMergeFields(tif, const TIFFField info[], uint32_t n);
nadded = _TIFFMergeFields(tif, tifFieldInfo, n);
(void)nadded;
@@ -261,8 +261,8 @@ write_test_tiff(TIFF* tif, const char* filenameRead, int blnAllCustomTags) {
int retCode;
float auxFloat = 0.0f;
double auxDouble = 0.0;
- uint16 auxUint16 = 0;
- uint32 auxUint32 = 0;
+ uint16_t auxUint16 = 0;
+ uint32_t auxUint32 = 0;
long auxLong = 0;
void* pVoid;
int blnIsRational2Double;
@@ -292,7 +292,7 @@ write_test_tiff(TIFF* tif, const char* filenameRead, int blnAllCustomTags) {
float auxFloatArrayResolutions[4] = {5.456789f, 6.666666f, 0.0033f, 5.0f / 213.0f};
/* -- Variables for reading -- */
- uint16 count16 = 0;
+ uint16_t count16 = 0;
union {
long Long;
short Short1;
diff --git a/tiff/test/raw_decode.c b/tiff/test/raw_decode.c
index a2fca03a..b8d12aa6 100644
--- a/tiff/test/raw_decode.c
+++ b/tiff/test/raw_decode.c
@@ -59,7 +59,7 @@
"JPEGLib: JPEG parameter struct mismatch: library thinks size is 432,
caller expects 464"
- For such users we wil fix the problem here. See install.doc file from
+ For such users we will fix the problem here. See install.doc file from
the JPEG library distribution for details.
*/
@@ -120,24 +120,24 @@ static int check_rgb_pixel( int pixel,
return 1;
}
-static int check_rgba_pixel( int pixel,
- int min_red, int max_red,
- int min_green, int max_green,
- int min_blue, int max_blue,
- int min_alpha, int max_alpha,
- uint32 *buffer ) {
+static int check_rgba_pixel(int pixel,
+ int min_red, int max_red,
+ int min_green, int max_green,
+ int min_blue, int max_blue,
+ int min_alpha, int max_alpha,
+ uint32_t *buffer ) {
/* RGBA images are upside down - adjust for normal ordering */
int adjusted_pixel = pixel % 128 + (127 - (pixel/128)) * 128;
- uint32 rgba = buffer[adjusted_pixel];
-
- if( TIFFGetR(rgba) >= (uint32) min_red &&
- TIFFGetR(rgba) <= (uint32) max_red &&
- TIFFGetG(rgba) >= (uint32) min_green &&
- TIFFGetG(rgba) <= (uint32) max_green &&
- TIFFGetB(rgba) >= (uint32) min_blue &&
- TIFFGetB(rgba) <= (uint32) max_blue &&
- TIFFGetA(rgba) >= (uint32) min_alpha &&
- TIFFGetA(rgba) <= (uint32) max_alpha ) {
+ uint32_t rgba = buffer[adjusted_pixel];
+
+ if( TIFFGetR(rgba) >= (uint32_t) min_red &&
+ TIFFGetR(rgba) <= (uint32_t) max_red &&
+ TIFFGetG(rgba) >= (uint32_t) min_green &&
+ TIFFGetG(rgba) <= (uint32_t) max_green &&
+ TIFFGetB(rgba) >= (uint32_t) min_blue &&
+ TIFFGetB(rgba) <= (uint32_t) max_blue &&
+ TIFFGetA(rgba) >= (uint32_t) min_alpha &&
+ TIFFGetA(rgba) <= (uint32_t) max_alpha ) {
return 0;
}
@@ -160,7 +160,7 @@ main(int argc, char **argv)
unsigned short h, v;
int status;
unsigned char *buffer;
- uint32 *rgba_buffer;
+ uint32_t *rgba_buffer;
tsize_t sz, szout;
unsigned int pixel_status = 0;
@@ -261,8 +261,8 @@ main(int argc, char **argv)
*/
tif = TIFFOpen(srcfile,"r");
- sz = 128 * 128 * sizeof(uint32);
- rgba_buffer = (uint32 *) malloc(sz);
+ sz = 128 * 128 * sizeof(uint32_t);
+ rgba_buffer = (uint32_t *) malloc(sz);
if (!TIFFReadRGBATile( tif, 1*128, 2*128, rgba_buffer )) {
fprintf( stderr, "TIFFReadRGBATile() returned failure code.\n" );
@@ -271,7 +271,7 @@ main(int argc, char **argv)
/*
* Currently TIFFReadRGBATile() just uses JPEGCOLORMODE_RGB so this
- * trivally matches the last results. Eventually we should actually
+ * trivially matches the last results. Eventually we should actually
* accomplish it from the YCbCr subsampled buffer ourselves in which
* case the results may be subtly different but similar.
*/
diff --git a/tiff/test/rewrite_tag.c b/tiff/test/rewrite_tag.c
index 1708b024..2c988e3b 100644
--- a/tiff/test/rewrite_tag.c
+++ b/tiff/test/rewrite_tag.c
@@ -39,8 +39,8 @@
#include "tiffio.h"
#include "tiffiop.h"
-const uint32 length = 40;
-const uint32 rows_per_strip = 1;
+const uint32_t length = 40;
+const uint32_t rows_per_strip = 1;
int test_packbits()
@@ -49,7 +49,7 @@ int test_packbits()
int i;
unsigned char buf[10] = {0,0,0,0,0,0,0,0,0,0};
- uint32 width = 10;
+ uint32_t width = 10;
int length = 20;
const char *filename = "test_packbits.tif";
@@ -137,16 +137,16 @@ int test_packbits()
/************************************************************************/
/* rewrite_test() */
/************************************************************************/
-int rewrite_test( const char *filename, uint32 width, int length, int bigtiff,
- uint64 base_value )
+int rewrite_test(const char *filename, uint32_t width, int length, int bigtiff,
+ uint64_t base_value )
{
TIFF *tif;
int i;
unsigned char *buf;
- uint64 *rowoffset, *rowbytes;
- uint64 *upd_rowoffset;
- uint64 *upd_bytecount;
+ uint64_t *rowoffset, *rowbytes;
+ uint64_t *upd_rowoffset = NULL;
+ uint64_t *upd_bytecount = NULL;
buf = calloc(1, width);
assert(buf);
@@ -223,7 +223,7 @@ int rewrite_test( const char *filename, uint32 width, int length, int bigtiff,
goto failure;
}
- upd_rowoffset = (uint64 *) _TIFFmalloc(sizeof(uint64) * length);
+ upd_rowoffset = (uint64_t *) _TIFFmalloc(sizeof(uint64_t) * length);
for( i = 0; i < length; i++ )
upd_rowoffset[i] = base_value + i*width;
@@ -235,8 +235,9 @@ int rewrite_test( const char *filename, uint32 width, int length, int bigtiff,
}
_TIFFfree( upd_rowoffset );
+ upd_rowoffset = NULL;
- upd_bytecount = (uint64 *) _TIFFmalloc(sizeof(uint64) * length);
+ upd_bytecount = (uint64_t *) _TIFFmalloc(sizeof(uint64_t) * length);
for( i = 0; i < length; i++ )
upd_bytecount[i] = 100 + i*width;
@@ -248,6 +249,7 @@ int rewrite_test( const char *filename, uint32 width, int length, int bigtiff,
}
_TIFFfree( upd_bytecount );
+ upd_bytecount = NULL;
TIFFClose(tif);
@@ -268,7 +270,7 @@ int rewrite_test( const char *filename, uint32 width, int length, int bigtiff,
for( i = 0; i < length; i++ )
{
- uint64 expect = base_value + i*width;
+ uint64_t expect = base_value + i * width;
if( rowoffset[i] != expect )
{
@@ -291,7 +293,7 @@ int rewrite_test( const char *filename, uint32 width, int length, int bigtiff,
for( i = 0; i < length; i++ )
{
- uint64 expect = 100 + i*width;
+ uint64_t expect = 100 + i * width;
if( rowbytes[i] != expect )
{
@@ -317,6 +319,14 @@ int rewrite_test( const char *filename, uint32 width, int length, int bigtiff,
/* Something goes wrong; close file and return unsuccessful status. */
TIFFClose(tif);
free(buf);
+ if( upd_rowoffset != NULL )
+ {
+ _TIFFfree( upd_rowoffset );
+ }
+ if ( upd_bytecount != NULL )
+ {
+ _TIFFfree( upd_bytecount );
+ }
/* unlink(filename); */
return 1;
diff --git a/tiff/test/short_tag.c b/tiff/test/short_tag.c
index 75e7f5d5..89197b02 100644
--- a/tiff/test/short_tag.c
+++ b/tiff/test/short_tag.c
@@ -41,16 +41,16 @@
static const char filename[] = "short_test.tiff";
#define SPP 3 /* Samples per pixel */
-const uint16 width = 1;
-const uint16 length = 1;
-const uint16 bps = 8;
-const uint16 photometric = PHOTOMETRIC_RGB;
-const uint16 rows_per_strip = 1;
-const uint16 planarconfig = PLANARCONFIG_CONTIG;
+const uint16_t width = 1;
+const uint16_t length = 1;
+const uint16_t bps = 8;
+const uint16_t photometric = PHOTOMETRIC_RGB;
+const uint16_t rows_per_strip = 1;
+const uint16_t planarconfig = PLANARCONFIG_CONTIG;
static const struct {
const ttag_t tag;
- const uint16 value;
+ const uint16_t value;
} short_single_tags[] = {
{ TIFFTAG_COMPRESSION, COMPRESSION_NONE },
{ TIFFTAG_FILLORDER, FILLORDER_MSB2LSB },
@@ -66,7 +66,7 @@ static const struct {
static const struct {
const ttag_t tag;
- const uint16 values[2];
+ const uint16_t values[2];
} short_paired_tags[] = {
{ TIFFTAG_PAGENUMBER, {1, 1} },
{ TIFFTAG_HALFTONEHINTS, {0, 255} },
@@ -121,8 +121,8 @@ main()
for (i = 0; i < NSINGLETAGS; i++) {
if (!TIFFSetField(tif, short_single_tags[i].tag,
short_single_tags[i].value)) {
- fprintf(stderr, "Can't set tag %lu.\n",
- (unsigned long)short_single_tags[i].tag);
+ fprintf(stderr, "Can't set tag %"PRIu32".\n",
+ short_single_tags[i].tag);
goto failure;
}
}
@@ -131,8 +131,8 @@ main()
if (!TIFFSetField(tif, short_paired_tags[i].tag,
short_paired_tags[i].values[0],
short_paired_tags[i].values[1])) {
- fprintf(stderr, "Can't set tag %lu.\n",
- (unsigned long)short_paired_tags[i].tag);
+ fprintf(stderr, "Can't set tag %"PRIu32".\n",
+ short_paired_tags[i].tag);
goto failure;
}
}
diff --git a/tiff/test/strip.c b/tiff/test/strip.c
index f2cb7735..004a66a2 100644
--- a/tiff/test/strip.c
+++ b/tiff/test/strip.c
@@ -57,8 +57,8 @@ write_strips(TIFF *tif, const tdata_t array, const tsize_t size)
if (TIFFWriteEncodedStrip(tif, strip, (char *)array + offset,
bufsize) != bufsize) {
- fprintf (stderr, "Can't write strip %lu.\n",
- (unsigned long)strip);
+ fprintf (stderr, "Can't write strip %"PRIu32".\n",
+ strip);
return -1;
}
}
@@ -97,13 +97,13 @@ read_strips(TIFF *tif, const tdata_t array, const tsize_t size)
bufsize = stripsize;
if (TIFFReadEncodedStrip(tif, strip, buf, -1) != bufsize) {
- fprintf (stderr, "Can't read strip %lu.\n",
- (unsigned long)strip);
+ fprintf (stderr, "Can't read strip %"PRIu32".\n",
+ strip);
return -1;
}
if (memcmp(buf, (char *)array + offset, bufsize) != 0) {
- fprintf (stderr, "Wrong data read for strip %lu.\n",
- (unsigned long)strip);
+ fprintf (stderr, "Wrong data read for strip %"PRIu32".\n",
+ strip);
_TIFFfree(buf);
return -1;
}
@@ -115,11 +115,11 @@ read_strips(TIFF *tif, const tdata_t array, const tsize_t size)
}
int
-create_image_striped(const char *name, uint32 width, uint32 length,
- uint32 rowsperstrip, uint16 compression,
- uint16 spp, uint16 bps, uint16 photometric,
- uint16 sampleformat, uint16 planarconfig,
- const tdata_t array, const tsize_t size)
+create_image_striped(const char *name, uint32_t width, uint32_t length,
+ uint32_t rowsperstrip, uint16_t compression,
+ uint16_t spp, uint16_t bps, uint16_t photometric,
+ uint16_t sampleformat, uint16_t planarconfig,
+ const tdata_t array, const tsize_t size)
{
TIFF *tif;
@@ -169,25 +169,25 @@ failure:
TIFFClose(tif);
openfailure:
fprintf (stderr, "Can't create test TIFF file %s:\n"
-" ImageWidth=%ld, ImageLength=%ld, RowsPerStrip=%ld, Compression=%d,\n"
-" BitsPerSample=%d, SamplesPerPixel=%d, SampleFormat=%d,\n"
-" PlanarConfiguration=%d, PhotometricInterpretation=%d.\n",
- name, (long) width, (long) length, (long) rowsperstrip,
+" ImageWidth=%"PRIu32", ImageLength=%"PRIu32", RowsPerStrip=%"PRIu32", Compression=%"PRIu16",\n"
+" BitsPerSample=%"PRIu16", SamplesPerPixel=%"PRIu16", SampleFormat=%"PRIu16",\n"
+" PlanarConfiguration=%"PRIu16", PhotometricInterpretation=%"PRIu16".\n",
+ name, width, length, rowsperstrip,
compression, bps, spp, sampleformat, planarconfig,
photometric);
return -1;
}
int
-read_image_striped(const char *name, uint32 width, uint32 length,
- uint32 rowsperstrip, uint16 compression,
- uint16 spp, uint16 bps, uint16 photometric,
- uint16 sampleformat, uint16 planarconfig,
- const tdata_t array, const tsize_t size)
+read_image_striped(const char *name, uint32_t width, uint32_t length,
+ uint32_t rowsperstrip, uint16_t compression,
+ uint16_t spp, uint16_t bps, uint16_t photometric,
+ uint16_t sampleformat, uint16_t planarconfig,
+ const tdata_t array, const tsize_t size)
{
TIFF *tif;
- uint16 value_u16;
- uint32 value_u32;
+ uint16_t value_u16;
+ uint32_t value_u32;
/* Test whether we can read written values. */
tif = TIFFOpen(name, "r");
@@ -247,10 +247,10 @@ failure:
TIFFClose(tif);
openfailure:
fprintf (stderr, "Can't read test TIFF file %s:\n"
-" ImageWidth=%ld, ImageLength=%ld, RowsPerStrip=%ld, Compression=%d,\n"
-" BitsPerSample=%d, SamplesPerPixel=%d, SampleFormat=%d,\n"
-" PlanarConfiguration=%d, PhotometricInterpretation=%d.\n",
- name, (long) width, (long) length, (long) rowsperstrip,
+" ImageWidth=%"PRIu32", ImageLength=%"PRIu32", RowsPerStrip=%"PRIu32", Compression=%"PRIu16",\n"
+" BitsPerSample=%"PRIu16", SamplesPerPixel=%"PRIu16", SampleFormat=%"PRIu16",\n"
+" PlanarConfiguration=%"PRIu16", PhotometricInterpretation=%"PRIu16".\n",
+ name, width, length, rowsperstrip,
compression, bps, spp, sampleformat, planarconfig,
photometric);
return -1;
@@ -259,7 +259,7 @@ openfailure:
int
write_scanlines(TIFF *tif, const tdata_t array, const tsize_t size)
{
- uint32 length, row;
+ uint32_t length, row;
tsize_t scanlinesize, offset;
(void) size;
@@ -277,7 +277,7 @@ write_scanlines(TIFF *tif, const tdata_t array, const tsize_t size)
for (offset = 0, row = 0; row < length; offset+=scanlinesize, row++) {
if (TIFFWriteScanline(tif, (char *)array + offset, row, 0) == -1) {
fprintf (stderr,
- "Can't write image data at row %lu.\n", (long) row);
+ "Can't write image data at row %"PRIu32".\n", row);
return -1;
}
}
diff --git a/tiff/test/strip_rw.c b/tiff/test/strip_rw.c
index bcf7d735..866329b1 100644
--- a/tiff/test/strip_rw.c
+++ b/tiff/test/strip_rw.c
@@ -39,22 +39,22 @@
#include "test_arrays.h"
extern int
-create_image_striped(const char *, uint32, uint32, uint32, uint16, uint16,
- uint16, uint16, uint16, uint16, const tdata_t,
- const tsize_t);
+create_image_striped(const char *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t,
+ uint16_t, uint16_t, uint16_t, uint16_t, const tdata_t,
+ const tsize_t);
extern int
-read_image_striped(const char *, uint32, uint32, uint32, uint16, uint16,
- uint16, uint16, uint16, uint16, const tdata_t,
- const tsize_t);
+read_image_striped(const char *, uint32_t, uint32_t, uint32_t, uint16_t, uint16_t,
+ uint16_t, uint16_t, uint16_t, uint16_t, const tdata_t,
+ const tsize_t);
const char *filename = "strip_test.tiff";
int
main(int argc, char **argv)
{
- uint32 rowsperstrip;
- uint16 compression;
- uint16 spp, bps, photometric, sampleformat, planarconfig;
+ uint32_t rowsperstrip;
+ uint16_t compression;
+ uint16_t spp, bps, photometric, sampleformat, planarconfig;
(void) argc;
(void) argv;
diff --git a/tiff/test/testtypes.c b/tiff/test/testtypes.c
index a36d21e5..0405b94f 100644
--- a/tiff/test/testtypes.c
+++ b/tiff/test/testtypes.c
@@ -42,16 +42,15 @@
int
main()
{
- CHECK_TYPE(TIFF_INT8_T, 1)
- CHECK_TYPE(TIFF_INT16_T, 2)
- CHECK_TYPE(TIFF_INT32_T, 4)
- CHECK_TYPE(TIFF_INT64_T, 8)
- CHECK_TYPE(TIFF_UINT8_T, 1)
- CHECK_TYPE(TIFF_UINT16_T, 2)
- CHECK_TYPE(TIFF_UINT32_T, 4)
- CHECK_TYPE(TIFF_UINT64_T, 8)
- CHECK_TYPE(TIFF_SIZE_T, sizeof(size_t))
- CHECK_TYPE(TIFF_SSIZE_T, sizeof(size_t))
+ CHECK_TYPE(int8_t, 1)
+ CHECK_TYPE(int16_t, 2)
+ CHECK_TYPE(int32_t, 4)
+ CHECK_TYPE(int64_t, 8)
+ CHECK_TYPE(uint8_t, 1)
+ CHECK_TYPE(uint16_t, 2)
+ CHECK_TYPE(uint32_t, 4)
+ CHECK_TYPE(uint64_t, 8)
+ CHECK_TYPE(tmsize_t , sizeof(size_t))
return 0;
}
diff --git a/tiff/test/tifftest.h b/tiff/test/tifftest.h
index 391b0f64..694f66cc 100644
--- a/tiff/test/tifftest.h
+++ b/tiff/test/tifftest.h
@@ -32,9 +32,9 @@
#include "tiffio.h"
-int CheckShortField(TIFF *, const ttag_t, const uint16);
-int CheckShortPairedField(TIFF *, const ttag_t, const uint16*);
-int CheckLongField(TIFF *, const ttag_t, const uint32);
+int CheckShortField(TIFF *, const ttag_t, const uint16_t);
+int CheckShortPairedField(TIFF *, const ttag_t, const uint16_t*);
+int CheckLongField(TIFF *, const ttag_t, const uint32_t);
#endif /* _TIFFTEST_ */
diff --git a/tiff/tools/CMakeLists.txt b/tiff/tools/CMakeLists.txt
index ff2a1ddc..66b8e0bb 100644..100755
--- a/tiff/tools/CMakeLists.txt
+++ b/tiff/tools/CMakeLists.txt
@@ -22,73 +22,88 @@
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
-extra_dist(Makefile.vc)
+add_executable(fax2ps)
+target_sources(fax2ps PRIVATE fax2ps.c)
+target_link_libraries(fax2ps PRIVATE tiff port)
-include_directories(${PROJECT_SOURCE_DIR}/libtiff
- ${PROJECT_BINARY_DIR}/libtiff
- ${PROJECT_SOURCE_DIR}/port
- ${CMAKE_CURRENT_BINARY_DIR})
+add_executable(fax2tiff)
+target_sources(fax2tiff PRIVATE fax2tiff.c)
+target_link_libraries(fax2tiff PRIVATE tiff port)
-add_executable(fax2ps fax2ps.c)
-target_link_libraries(fax2ps tiff port)
+add_executable(pal2rgb)
+target_sources(pal2rgb PRIVATE pal2rgb.c)
+target_link_libraries(pal2rgb PRIVATE tiff port)
-add_executable(fax2tiff fax2tiff.c)
-target_link_libraries(fax2tiff tiff port)
+add_executable(ppm2tiff)
+target_sources(ppm2tiff PRIVATE ppm2tiff.c)
+target_link_libraries(ppm2tiff PRIVATE tiff port)
-add_executable(pal2rgb pal2rgb.c)
-target_link_libraries(pal2rgb tiff port)
+add_executable(raw2tiff)
+target_sources(raw2tiff PRIVATE raw2tiff.c)
+target_link_libraries(raw2tiff PRIVATE tiff port CMath::CMath)
-add_executable(ppm2tiff ppm2tiff.c)
-target_link_libraries(ppm2tiff tiff port)
+add_executable(rgb2ycbcr)
+target_sources(rgb2ycbcr PRIVATE rgb2ycbcr.c)
+target_link_libraries(rgb2ycbcr PRIVATE tiff port)
-add_executable(raw2tiff raw2tiff.c)
-target_link_libraries(raw2tiff tiff port)
+add_executable(thumbnail)
+target_sources(thumbnail PRIVATE thumbnail.c)
+target_link_libraries(thumbnail PRIVATE tiff port CMath::CMath)
-add_executable(rgb2ycbcr rgb2ycbcr.c)
-target_link_libraries(rgb2ycbcr tiff port)
+add_executable(tiff2bw)
+target_sources(tiff2bw PRIVATE tiff2bw.c)
+target_link_libraries(tiff2bw PRIVATE tiff port)
-add_executable(thumbnail thumbnail.c)
-target_link_libraries(thumbnail tiff port)
+add_executable(tiff2pdf)
+target_sources(tiff2pdf PRIVATE tiff2pdf.c)
+target_link_libraries(tiff2pdf PRIVATE tiff port)
-add_executable(tiff2bw tiff2bw.c)
-target_link_libraries(tiff2bw tiff port)
+add_executable(tiff2ps)
+target_sources(tiff2ps PRIVATE tiff2ps.c)
+target_link_libraries(tiff2ps PRIVATE tiff port CMath::CMath)
-add_executable(tiff2pdf tiff2pdf.c)
-target_link_libraries(tiff2pdf tiff port)
+add_executable(tiff2rgba)
+target_sources(tiff2rgba PRIVATE tiff2rgba.c)
+target_link_libraries(tiff2rgba PRIVATE tiff port)
-add_executable(tiff2ps tiff2ps.c)
-target_link_libraries(tiff2ps tiff port)
+add_executable(tiffcmp)
+target_sources(tiffcmp PRIVATE tiffcmp.c)
+target_link_libraries(tiffcmp PRIVATE tiff port)
-add_executable(tiff2rgba tiff2rgba.c)
-target_link_libraries(tiff2rgba tiff port)
+add_executable(tiffcp)
+target_sources(tiffcp PRIVATE tiffcp.c)
+target_link_libraries(tiffcp PRIVATE tiff port)
-add_executable(tiffcmp tiffcmp.c)
-target_link_libraries(tiffcmp tiff port)
+add_executable(tiffcrop)
+target_sources(tiffcrop PRIVATE tiffcrop.c)
+target_link_libraries(tiffcrop PRIVATE tiff port CMath::CMath)
-add_executable(tiffcp tiffcp.c)
-target_link_libraries(tiffcp tiff port)
+add_executable(tiffdither)
+target_sources(tiffdither PRIVATE tiffdither.c)
+target_link_libraries(tiffdither PRIVATE tiff port)
-add_executable(tiffcrop tiffcrop.c)
-target_link_libraries(tiffcrop tiff port)
+add_executable(tiffdump)
+target_sources(tiffdump PRIVATE tiffdump.c)
+target_link_libraries(tiffdump PRIVATE tiff port)
-add_executable(tiffdither tiffdither.c)
-target_link_libraries(tiffdither tiff port)
+add_executable(tiffinfo)
+target_sources(tiffinfo PRIVATE tiffinfo.c)
+target_link_libraries(tiffinfo PRIVATE tiff port)
-add_executable(tiffdump tiffdump.c)
-target_link_libraries(tiffdump tiff port)
+add_executable(tiffmedian)
+target_sources(tiffmedian PRIVATE tiffmedian.c)
+target_link_libraries(tiffmedian PRIVATE tiff port)
-add_executable(tiffinfo tiffinfo.c)
-target_link_libraries(tiffinfo tiff port)
+add_executable(tiffset)
+target_sources(tiffset PRIVATE tiffset.c)
+target_link_libraries(tiffset PRIVATE tiff port)
-add_executable(tiffmedian tiffmedian.c)
-target_link_libraries(tiffmedian tiff port)
-
-add_executable(tiffset tiffset.c)
-target_link_libraries(tiffset tiff port)
-
-add_executable(tiffsplit tiffsplit.c)
-target_link_libraries(tiffsplit tiff port)
+add_executable(tiffsplit)
+target_sources(tiffsplit PRIVATE tiffsplit.c)
+target_link_libraries(tiffsplit PRIVATE tiff port)
+# rgb2ycbcr and thumbnail are intended to *NOT* be installed. They are for
+# testing purposes only.
install(TARGETS fax2ps
fax2tiff
pal2rgb
@@ -110,15 +125,10 @@ install(TARGETS fax2ps
RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
if(HAVE_OPENGL)
- if(OPENGL_INCLUDE_DIR)
- include_directories(${OPENGL_INCLUDE_DIR})
- endif()
- if(GLUT_INCLUDE_DIR)
- include_directories(${GLUT_INCLUDE_DIR})
- endif()
-
- add_executable(tiffgt tiffgt.c)
- target_link_libraries(tiffgt tiff port ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES})
+ add_executable(tiffgt)
+ target_sources(tiffgt PRIVATE tiffgt.c)
+ target_link_libraries(tiffgt PRIVATE tiff port)
+ target_link_libraries(tiffgt PRIVATE OpenGL::GL GLUT::GLUT)
install(TARGETS tiffgt
RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}")
diff --git a/tiff/tools/Makefile.am b/tiff/tools/Makefile.am
index 3054bee3..c8142b05 100644
--- a/tiff/tools/Makefile.am
+++ b/tiff/tools/Makefile.am
@@ -27,8 +27,7 @@ LIBPORT = $(top_builddir)/port/libport.la
LIBTIFF = $(top_builddir)/libtiff/libtiff.la
EXTRA_DIST = \
- CMakeLists.txt \
- Makefile.vc
+ CMakeLists.txt
bin_PROGRAMS = \
fax2ps \
@@ -128,7 +127,7 @@ tiffgt_SOURCES = tiffgt.c
tiffgt_CFLAGS = $(CFLAGS) $(GLUT_CFLAGS) $(AM_CFLAGS)
tiffgt_LDADD = $(LIBTIFF) $(LIBPORT) $(X_LIBS) $(GLUT_LIBS)
-AM_CPPFLAGS = -I$(top_srcdir)/libtiff
+AM_CPPFLAGS = -I$(top_srcdir)/libtiff -I$(top_srcdir)/port
echo:
(echo $(CFLAGS))
diff --git a/tiff/tools/Makefile.in b/tiff/tools/Makefile.in
index 8b1a2460..fc1bff84 100644
--- a/tiff/tools/Makefile.in
+++ b/tiff/tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.16.2 from Makefile.am.
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2020 Free Software Foundation, Inc.
+# Copyright (C) 1994-2018 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -133,8 +133,10 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/libtiff/tif_config.h \
- $(top_builddir)/libtiff/tiffconf.h
+CONFIG_HEADER = $(top_builddir)/config.h \
+ $(top_builddir)/libtiff/tif_config.h \
+ $(top_builddir)/libtiff/tiffconf.h \
+ $(top_builddir)/port/libport_config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
@HAVE_OPENGL_TRUE@am__EXEEXT_1 = tiffgt$(EXEEXT)
@@ -224,7 +226,7 @@ AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/libtiff
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/libtiff -I$(top_builddir)/port
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__maybe_remake_depfiles = depfiles
am__depfiles_remade = ./$(DEPDIR)/fax2ps.Po ./$(DEPDIR)/fax2tiff.Po \
@@ -437,6 +439,7 @@ pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -449,8 +452,7 @@ top_srcdir = @top_srcdir@
LIBPORT = $(top_builddir)/port/libport.la
LIBTIFF = $(top_builddir)/libtiff/libtiff.la
EXTRA_DIST = \
- CMakeLists.txt \
- Makefile.vc
+ CMakeLists.txt
@HAVE_RPATH_TRUE@AM_LDFLAGS = $(LIBDIR)
fax2ps_SOURCES = fax2ps.c
@@ -496,7 +498,7 @@ tiffsplit_LDADD = $(LIBTIFF) $(LIBPORT)
tiffgt_SOURCES = tiffgt.c
tiffgt_CFLAGS = $(CFLAGS) $(GLUT_CFLAGS) $(AM_CFLAGS)
tiffgt_LDADD = $(LIBTIFF) $(LIBPORT) $(X_LIBS) $(GLUT_LIBS)
-AM_CPPFLAGS = -I$(top_srcdir)/libtiff
+AM_CPPFLAGS = -I$(top_srcdir)/libtiff -I$(top_srcdir)/port
all: all-am
.SUFFIXES:
diff --git a/tiff/tools/Makefile.vc b/tiff/tools/Makefile.vc
deleted file mode 100644
index 453db43e..00000000
--- a/tiff/tools/Makefile.vc
+++ /dev/null
@@ -1,51 +0,0 @@
-#
-# Copyright (C) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
-#
-# Permission to use, copy, modify, distribute, and sell this software and
-# its documentation for any purpose is hereby granted without fee, provided
-# that (i) the above copyright notices and this permission notice appear in
-# all copies of the software and related documentation, and (ii) the names of
-# Sam Leffler and Silicon Graphics may not be used in any advertising or
-# publicity relating to the software without the specific, prior written
-# permission of Sam Leffler and Silicon Graphics.
-#
-# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
-# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
-#
-# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
-# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
-# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
-# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
-# OF THIS SOFTWARE.
-#
-# Makefile for MS Visual C and Watcom C compilers.
-#
-# To build:
-# C:\libtiff\tools> nmake /f makefile.vc
-
-!INCLUDE ..\nmake.opt
-
-TARGETS = tiffinfo.exe tiffdump.exe fax2tiff.exe \
- fax2ps.exe pal2rgb.exe ppm2tiff.exe \
- rgb2ycbcr.exe thumbnail.exe raw2tiff.exe \
- tiff2bw.exe tiff2rgba.exe tiff2pdf.exe tiff2ps.exe \
- tiffcmp.exe tiffcp.exe tiffcrop.exe tiffdither.exe \
- tiffmedian.exe tiffset.exe tiffsplit.exe
-
-INCL = -I..\libtiff -I..\port -DNEED_LIBPORT
-LIBS = $(LIBS) ..\port\libport.lib ..\libtiff\libtiff.lib
-
-default: $(TARGETS)
-
-.c.exe:
- $(CC) $(CFLAGS) $*.c $(EXTRA_OBJ) $(LIBS)
-
-tiffgt.exe:
- $(CC) $(CFLAGS) tiffgt.c $(EXTRA_OBJ) $(LIBS)
-
-clean:
- -del *.exe
- -del *.exe.manifest
- -del *.obj
diff --git a/tiff/tools/fax2ps.c b/tiff/tools/fax2ps.c
index f59f4921..625574c6 100644
--- a/tiff/tools/fax2ps.c
+++ b/tiff/tools/fax2ps.c
@@ -22,6 +22,7 @@
* OF THIS SOFTWARE.
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdlib.h>
#include <stdio.h>
@@ -41,10 +42,6 @@
# include <io.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffiop.h"
#include "tiffio.h"
@@ -75,7 +72,7 @@ int maxline = 512; /* max output line of PostScript */
* March 13-15, 1995.
*/
static void
-printruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
+printruns(unsigned char* buf, uint32_t* runs, uint32_t* erun, uint32_t lastx)
{
static struct {
char white, black;
@@ -89,9 +86,9 @@ printruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
static char* svalue =
" !\"#$&'*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abc";
int colormode = 1; /* 0 for white, 1 for black */
- uint32 runlength = 0;
+ uint32_t runlength = 0;
int n = maxline;
- uint32 x = 0;
+ uint32_t x = 0;
int l;
(void) buf;
@@ -129,7 +126,7 @@ printruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx)
l++;
}
while (runlength > 0 && runlength <= 6) {
- uint32 bitsleft = 6;
+ uint32_t bitsleft = 6;
int t = 0;
while (bitsleft) {
if (runlength <= bitsleft) {
@@ -201,10 +198,10 @@ emitFont(FILE* fd)
}
void
-printTIF(TIFF* tif, uint16 pageNumber)
+printTIF(TIFF* tif, uint16_t pageNumber)
{
- uint32 w, h;
- uint16 unit, compression;
+ uint32_t w, h;
+ uint16_t unit, compression;
float xres, yres, scale = 1.0;
tstrip_t s, ns;
time_t creation_time;
@@ -278,10 +275,10 @@ printTIF(TIFF* tif, uint16 pageNumber)
TIFFGetField(tif, TIFFTAG_PAGENUMBER, &pn, &ptotal)
int
-findPage(TIFF* tif, uint16 pageNumber)
+findPage(TIFF* tif, uint16_t pageNumber)
{
- uint16 pn = (uint16) -1;
- uint16 ptotal = (uint16) -1;
+ uint16_t pn = (uint16_t) -1;
+ uint16_t ptotal = (uint16_t) -1;
if (GetPageNumber(tif)) {
while (pn != (pageNumber-1) && TIFFReadDirectory(tif) && GetPageNumber(tif))
;
@@ -291,10 +288,10 @@ findPage(TIFF* tif, uint16 pageNumber)
}
void
-fax2ps(TIFF* tif, uint16 npages, uint16* pages, char* filename)
+fax2ps(TIFF* tif, uint16_t npages, uint16_t* pages, char* filename)
{
if (npages > 0) {
- uint16 pn, ptotal;
+ uint16_t pn, ptotal;
int i;
if (!GetPageNumber(tif))
@@ -307,7 +304,7 @@ fax2ps(TIFF* tif, uint16 npages, uint16* pages, char* filename)
fprintf(stderr, "%s: No page number %d\n", filename, pages[i]);
}
} else {
- uint16 pageNumber = 0;
+ uint16_t pageNumber = 0;
do
printTIF(tif, pageNumber++);
while (TIFFReadDirectory(tif));
@@ -333,7 +330,7 @@ main(int argc, char** argv)
extern int optind;
extern char* optarg;
#endif
- uint16 *pages = NULL, npages = 0, pageNumber;
+ uint16_t *pages = NULL, npages = 0, pageNumber;
int c, dowarnings = 0; /* if 1, enable library warnings */
TIFF* tif;
@@ -349,11 +346,11 @@ main(int argc, char** argv)
pageWidth = (float)atof(optarg);
break;
case 'p': /* print specific page */
- pageNumber = (uint16)atoi(optarg);
+ pageNumber = (uint16_t)atoi(optarg);
if (pages)
- pages = (uint16*) realloc(pages, (npages+1)*sizeof(uint16));
+ pages = (uint16_t*) realloc(pages, (npages + 1) * sizeof(uint16_t));
else
- pages = (uint16*) malloc(sizeof(uint16));
+ pages = (uint16_t*) malloc(sizeof(uint16_t));
if( pages == NULL )
{
fprintf(stderr, "Out of memory\n");
@@ -375,11 +372,12 @@ main(int argc, char** argv)
break;
case 'h':
usage(EXIT_SUCCESS);
+ break;
case '?':
usage(EXIT_FAILURE);
}
if (npages > 0)
- qsort(pages, npages, sizeof(uint16), pcompar);
+ qsort(pages, npages, sizeof(uint16_t), pcompar);
if (!dowarnings)
TIFFSetWarningHandler(0);
if (optind < argc) {
@@ -433,29 +431,27 @@ main(int argc, char** argv)
return (EXIT_SUCCESS);
}
-const char* stuff[] = {
-"usage: fax2ps [options] [input.tif ...]",
-"where options are:",
-" -w suppress warning messages",
-" -l chars set maximum output line length for generated PostScript",
-" -p page# select page to print (can use multiple times)",
-" -x xres set default horizontal resolution of input data (dpi)",
-" -y yres set default vertical resolution of input data (lpi)",
-" -S scale output to page size",
-" -W width set output page width (inches), default is 8.5",
-" -H height set output page height (inches), default is 11",
-NULL
-};
+static const char usage_info[] =
+"Convert a TIFF facsimile to compressed PostScript\n\n"
+"usage: fax2ps [options] [input.tif ...]\n"
+"where options are:\n"
+" -w suppress warning messages\n"
+" -l chars set maximum output line length for generated PostScript\n"
+" -p page# select page to print (can use multiple times)\n"
+" -x xres set default horizontal resolution of input data (dpi)\n"
+" -y yres set default vertical resolution of input data (lpi)\n"
+" -S scale output to page size\n"
+" -W width set output page width (inches), default is 8.5\n"
+" -H height set output page height (inches), default is 11\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
diff --git a/tiff/tools/fax2tiff.c b/tiff/tools/fax2tiff.c
index eecb41e3..59ed02c0 100644
--- a/tiff/tools/fax2tiff.c
+++ b/tiff/tools/fax2tiff.c
@@ -26,6 +26,7 @@
* Convert a CCITT Group 3 or 4 FAX file to TIFF Group 3 or 4 format.
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h> /* should have atof & getopt */
@@ -42,10 +43,6 @@
# include <io.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffiop.h"
#ifndef EXIT_SUCCESS
@@ -55,17 +52,17 @@
# define EXIT_FAILURE 1
#endif
-#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
+#define TIFFhowmany8(x) (((x)&0x07)?((uint32_t)(x)>>3)+1:(uint32_t)(x)>>3)
TIFF *faxTIFF;
char *rowbuf;
char *refbuf;
-uint32 xsize = 1728;
+uint32_t xsize = 1728;
int verbose;
int stretch;
-uint16 badfaxrun;
-uint32 badfaxlines;
+uint16_t badfaxrun;
+uint32_t badfaxlines;
int copyFaxFile(TIFF* tifin, TIFF* tifout);
static void usage(int code);
@@ -91,12 +88,12 @@ main(int argc, char* argv[])
int compression_out = COMPRESSION_CCITTFAX3;
int fillorder_in = FILLORDER_LSB2MSB;
int fillorder_out = FILLORDER_LSB2MSB;
- uint32 group3options_in = 0; /* 1d-encoded */
- uint32 group3options_out = 0; /* 1d-encoded */
- uint32 group4options_in = 0; /* compressed */
- uint32 group4options_out = 0; /* compressed */
- uint32 defrowsperstrip = (uint32) 0;
- uint32 rowsperstrip;
+ uint32_t group3options_in = 0; /* 1d-encoded */
+ uint32_t group3options_out = 0; /* 1d-encoded */
+ uint32_t group4options_in = 0; /* compressed */
+ uint32_t group4options_out = 0; /* compressed */
+ uint32_t defrowsperstrip = (uint32_t) 0;
+ uint32_t rowsperstrip;
int photometric_in = PHOTOMETRIC_MINISWHITE;
int photometric_out = PHOTOMETRIC_MINISWHITE;
int mode = FAXMODE_CLASSF;
@@ -151,7 +148,7 @@ main(int argc, char* argv[])
resY = (float) atof(optarg);
break;
case 'X': /* input width */
- xsize = (uint32) atoi(optarg);
+ xsize = (uint32_t) atoi(optarg);
break;
/* output-related options */
@@ -218,6 +215,7 @@ main(int argc, char* argv[])
break;
case 'h':
usage(EXIT_SUCCESS);
+ break;
case '?':
usage(EXIT_FAILURE);
/*NOTREACHED*/
@@ -297,7 +295,7 @@ main(int argc, char* argv[])
group3options_out);
TIFFSetField(out, TIFFTAG_FAXMODE, mode);
rowsperstrip =
- (defrowsperstrip)?defrowsperstrip:(uint32)-1L;
+ (defrowsperstrip)?defrowsperstrip:(uint32_t)-1L;
break;
/* g4 */
@@ -306,7 +304,7 @@ main(int argc, char* argv[])
group4options_out);
TIFFSetField(out, TIFFTAG_FAXMODE, mode);
rowsperstrip =
- (defrowsperstrip)?defrowsperstrip:(uint32)-1L;
+ (defrowsperstrip)?defrowsperstrip:(uint32_t)-1L;
break;
default:
@@ -338,9 +336,9 @@ main(int argc, char* argv[])
if (verbose) {
fprintf(stderr, "%s:\n", argv[optind]);
fprintf(stderr, "%d rows in input\n", rows);
- fprintf(stderr, "%ld total bad rows\n",
- (long) badfaxlines);
- fprintf(stderr, "%d max consecutive bad rows\n", badfaxrun);
+ fprintf(stderr, "%"PRIu32" total bad rows\n",
+ badfaxlines);
+ fprintf(stderr, "%"PRIu16" max consecutive bad rows\n", badfaxrun);
}
if (compression_out == COMPRESSION_CCITTFAX3 &&
mode == FAXMODE_CLASSF) {
@@ -360,9 +358,9 @@ main(int argc, char* argv[])
int
copyFaxFile(TIFF* tifin, TIFF* tifout)
{
- uint32 row;
- uint32 linesize = TIFFhowmany8(xsize);
- uint16 badrun;
+ uint32_t row;
+ uint32_t linesize = TIFFhowmany8(xsize);
+ uint16_t badrun;
int ok;
tifin->tif_rawdatasize = (tmsize_t)TIFFGetFileSize(tifin);
@@ -408,15 +406,15 @@ copyFaxFile(TIFF* tifin, TIFF* tifout)
tifin->tif_row++;
if (TIFFWriteScanline(tifout, rowbuf, row, 0) < 0) {
- fprintf(stderr, "%s: Write error at row %ld.\n",
- tifout->tif_name, (long) row);
+ fprintf(stderr, "%s: Write error at row %"PRIu32".\n",
+ tifout->tif_name, row);
break;
}
row++;
if (stretch) {
if (TIFFWriteScanline(tifout, rowbuf, row, 0) < 0) {
- fprintf(stderr, "%s: Write error at row %ld.\n",
- tifout->tif_name, (long) row);
+ fprintf(stderr, "%s: Write error at row %"PRIu32".\n",
+ tifout->tif_name, row);
break;
}
row++;
@@ -428,51 +426,53 @@ copyFaxFile(TIFF* tifin, TIFF* tifout)
return (row);
}
-const char* stuff[] = {
-"usage: fax2tiff [options] input.raw...",
-"where options are:",
-" -3 input data is G3-encoded [default]",
-" -4 input data is G4-encoded",
-" -U input data is uncompressed (G3 or G4)",
-" -1 input data is 1D-encoded (G3 only) [default]",
-" -2 input data is 2D-encoded (G3 only)",
-" -P input is not EOL-aligned (G3 only) [default]",
-" -A input is EOL-aligned (G3 only)",
-" -M input data has MSB2LSB bit order",
-" -L input data has LSB2MSB bit order [default]",
-" -B input data has min 0 means black",
-" -W input data has min 0 means white [default]",
-" -R # input data has # resolution (lines/inch) [default is 196]",
-" -X # input data has # width [default is 1728]",
-"",
-" -o out.tif write output to out.tif",
-" -7 generate G3-encoded output [default]",
-" -8 generate G4-encoded output",
-" -u generate uncompressed output (G3 or G4)",
-" -5 generate 1D-encoded output (G3 only)",
-" -6 generate 2D-encoded output (G3 only) [default]",
-" -p generate not EOL-aligned output (G3 only)",
-" -a generate EOL-aligned output (G3 only) [default]",
-" -c generate \"classic\" TIFF format",
-" -f generate TIFF Class F (TIFF/F) format [default]",
-" -m output fill order is MSB2LSB",
-" -l output fill order is LSB2MSB [default]",
-" -r # make each strip have no more than # rows",
-" -s stretch image by duplicating scanlines",
-" -v print information about conversion work",
-" -z generate LZW compressed output",
-NULL
-};
+static const char usage_info[] =
+"Create a TIFF Class F fax file from raw fax data\n\n"
+"usage: fax2tiff [options] input.raw...\n"
+"where options are:\n"
+" -3 input data is G3-encoded [default]\n"
+" -4 input data is G4-encoded\n"
+" -U input data is uncompressed (G3 or G4)\n"
+" -1 input data is 1D-encoded (G3 only) [default]\n"
+" -2 input data is 2D-encoded (G3 only)\n"
+" -P input is not EOL-aligned (G3 only) [default]\n"
+" -A input is EOL-aligned (G3 only)\n"
+" -M input data has MSB2LSB bit order\n"
+" -L input data has LSB2MSB bit order [default]\n"
+" -B input data has min 0 means black\n"
+" -W input data has min 0 means white [default]\n"
+" -R # input data has # resolution (lines/inch) [default is 196]\n"
+" -X # input data has # width [default is 1728]\n"
+"\n"
+" -o out.tif write output to out.tif\n"
+#ifdef CCITT_SUPPORT
+" -7 generate G3-encoded output [default]\n"
+" -8 generate G4-encoded output\n"
+" -u generate uncompressed output (G3 or G4)\n"
+" -5 generate 1D-encoded output (G3 only)\n"
+" -6 generate 2D-encoded output (G3 only) [default]\n"
+" -p generate not EOL-aligned output (G3 only)\n"
+" -a generate EOL-aligned output (G3 only) [default]\n"
+#endif
+" -c generate \"classic\" TIFF format\n"
+" -f generate TIFF Class F (TIFF/F) format [default]\n"
+" -m output fill order is MSB2LSB\n"
+" -l output fill order is LSB2MSB [default]\n"
+" -r # make each strip have no more than # rows\n"
+" -s stretch image by duplicating scanlines\n"
+" -v print information about conversion work\n"
+#ifdef LZW_SUPPORT
+" -z generate LZW compressed output\n"
+#endif
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
diff --git a/tiff/tools/pal2rgb.c b/tiff/tools/pal2rgb.c
index bf95cb37..287b31f8 100644
--- a/tiff/tools/pal2rgb.c
+++ b/tiff/tools/pal2rgb.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <string.h>
@@ -33,10 +34,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffio.h"
#ifndef EXIT_SUCCESS
@@ -53,7 +50,7 @@ static void usage(int code);
static void cpTags(TIFF* in, TIFF* out);
static int
-checkcmap(int n, uint16* r, uint16* g, uint16* b)
+checkcmap(int n, uint16_t* r, uint16_t* g, uint16_t* b)
{
while (n-- > 0)
if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256)
@@ -67,8 +64,8 @@ checkcmap(int n, uint16* r, uint16* g, uint16* b)
#define CopyField3(tag, v1, v2, v3) \
if (TIFFGetField(in, tag, &v1, &v2, &v3)) TIFFSetField(out, tag, v1, v2, v3)
-static uint16 compression = (uint16) -1;
-static uint16 predictor = 0;
+static uint16_t compression = (uint16_t) -1;
+static uint16_t predictor = 0;
static int quality = 75; /* JPEG quality */
static int jpegcolormode = JPEGCOLORMODE_RGB;
static int processCompressOptions(char*);
@@ -76,13 +73,13 @@ static int processCompressOptions(char*);
int
main(int argc, char* argv[])
{
- uint16 bitspersample, shortv;
- uint32 imagewidth, imagelength;
- uint16 config = PLANARCONFIG_CONTIG;
- uint32 rowsperstrip = (uint32) -1;
- uint16 photometric = PHOTOMETRIC_RGB;
- uint16 *rmap, *gmap, *bmap;
- uint32 row;
+ uint16_t bitspersample, shortv;
+ uint32_t imagewidth, imagelength;
+ uint16_t config = PLANARCONFIG_CONTIG;
+ uint32_t rowsperstrip = (uint32_t) -1;
+ uint16_t photometric = PHOTOMETRIC_RGB;
+ uint16_t *rmap, *gmap, *bmap;
+ uint32_t row;
int cmap = -1;
TIFF *in, *out;
int c;
@@ -114,6 +111,7 @@ main(int argc, char* argv[])
break;
case 'h':
usage(EXIT_SUCCESS);
+ break;
case '?':
usage(EXIT_FAILURE);
/*NOTREACHED*/
@@ -153,7 +151,7 @@ main(int argc, char* argv[])
cpTags(in, out);
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &imagewidth);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &imagelength);
- if (compression != (uint16)-1)
+ if (compression != (uint16_t)-1)
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
else
TIFFGetField(in, TIFFTAG_COMPRESSION, &compression);
@@ -195,7 +193,7 @@ main(int argc, char* argv[])
}
{ unsigned char *ibuf, *obuf;
register unsigned char* pp;
- register uint32 x;
+ register uint32_t x;
tmsize_t tss_in = TIFFScanlineSize(in);
tmsize_t tss_out = TIFFScanlineSize(out);
if (tss_out / tss_in < 3) {
@@ -301,27 +299,27 @@ processCompressOptions(char* opt)
if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4)
static void
-cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
+cpTag(TIFF* in, TIFF* out, uint16_t tag, uint16_t count, TIFFDataType type)
{
switch (type) {
case TIFF_SHORT:
if (count == 1) {
- uint16 shortv;
+ uint16_t shortv;
CopyField(tag, shortv);
} else if (count == 2) {
- uint16 shortv1, shortv2;
+ uint16_t shortv1, shortv2;
CopyField2(tag, shortv1, shortv2);
} else if (count == 4) {
- uint16 *tr, *tg, *tb, *ta;
+ uint16_t *tr, *tg, *tb, *ta;
CopyField4(tag, tr, tg, tb, ta);
- } else if (count == (uint16) -1) {
- uint16 shortv1;
- uint16* shortav;
+ } else if (count == (uint16_t) -1) {
+ uint16_t shortv1;
+ uint16_t* shortav;
CopyField2(tag, shortv1, shortav);
}
break;
case TIFF_LONG:
- { uint32 longv;
+ { uint32_t longv;
CopyField(tag, longv);
}
break;
@@ -329,7 +327,7 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
float floatv;
CopyField(tag, floatv);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
float* floatav;
CopyField(tag, floatav);
}
@@ -343,7 +341,7 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
double doublev;
CopyField(tag, doublev);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
double* doubleav;
CopyField(tag, doubleav);
}
@@ -360,9 +358,9 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
#undef CopyField2
#undef CopyField
-static struct cpTag {
- uint16 tag;
- uint16 count;
+static const struct cpTag {
+ uint16_t tag;
+ uint16_t count;
TIFFDataType type;
} tags[] = {
{ TIFFTAG_IMAGEWIDTH, 1, TIFF_LONG },
@@ -384,49 +382,49 @@ static struct cpTag {
{ TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL },
{ TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL },
{ TIFFTAG_PAGENAME, 1, TIFF_ASCII },
- { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_GROUP4OPTIONS, 1, TIFF_LONG },
- { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
- { TIFFTAG_PAGENUMBER, 2, TIFF_SHORT },
- { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
- { TIFFTAG_DATETIME, 1, TIFF_ASCII },
- { TIFFTAG_ARTIST, 1, TIFF_ASCII },
- { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
- { TIFFTAG_WHITEPOINT, 2, TIFF_RATIONAL },
- { TIFFTAG_PRIMARYCHROMATICITIES, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
- { TIFFTAG_BADFAXLINES, 1, TIFF_LONG },
- { TIFFTAG_CLEANFAXDATA, 1, TIFF_SHORT },
- { TIFFTAG_CONSECUTIVEBADFAXLINES, 1, TIFF_LONG },
- { TIFFTAG_INKSET, 1, TIFF_SHORT },
+ { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_GROUP4OPTIONS, 1, TIFF_LONG },
+ { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
+ { TIFFTAG_PAGENUMBER, 2, TIFF_SHORT },
+ { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
+ { TIFFTAG_DATETIME, 1, TIFF_ASCII },
+ { TIFFTAG_ARTIST, 1, TIFF_ASCII },
+ { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
+ { TIFFTAG_WHITEPOINT, 2, TIFF_RATIONAL },
+ { TIFFTAG_PRIMARYCHROMATICITIES, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
+ { TIFFTAG_BADFAXLINES, 1, TIFF_LONG },
+ { TIFFTAG_CLEANFAXDATA, 1, TIFF_SHORT },
+ { TIFFTAG_CONSECUTIVEBADFAXLINES, 1, TIFF_LONG },
+ { TIFFTAG_INKSET, 1, TIFF_SHORT },
/*{ TIFFTAG_INKNAMES, 1, TIFF_ASCII },*/ /* Needs much more complicated logic. See tiffcp */
- { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
- { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
- { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
- { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
- { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
- { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL },
+ { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
+ { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
+ { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
+ { TIFFTAG_YCBCRCOEFFICIENTS, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
+ { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
+ { TIFFTAG_REFERENCEBLACKWHITE, (uint16_t) -1, TIFF_RATIONAL },
};
#define NTAGS (sizeof (tags) / sizeof (tags[0]))
static void
cpTags(TIFF* in, TIFF* out)
{
- struct cpTag *p;
+ const struct cpTag *p;
for (p = tags; p < &tags[NTAGS]; p++)
{
if( p->tag == TIFFTAG_GROUP3OPTIONS )
{
- uint16 compression;
+ uint16_t compression;
if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
compression != COMPRESSION_CCITTFAX3 )
continue;
}
if( p->tag == TIFFTAG_GROUP4OPTIONS )
{
- uint16 compression;
+ uint16_t compression;
if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
compression != COMPRESSION_CCITTFAX4 )
continue;
@@ -436,35 +434,42 @@ cpTags(TIFF* in, TIFF* out)
}
#undef NTAGS
-const char* stuff[] = {
-"usage: pal2rgb [options] input.tif output.tif",
-"where options are:",
-" -p contig pack samples contiguously (e.g. RGBRGB...)",
-" -p separate store samples separately (e.g. RRR...GGG...BBB...)",
-" -r # make each strip have no more than # rows",
-" -C 8 assume 8-bit colormap values (instead of 16-bit)",
-" -C 16 assume 16-bit colormap values",
-"",
-" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts] compress output with deflate encoding",
-" -c packbits compress output with packbits encoding",
-" -c none use no compression algorithm on output",
-"",
-"LZW and deflate options:",
-" # set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-NULL
-};
+static const char usage_info[] =
+"Convert a palette color TIFF image to a full color image\n\n"
+"usage: pal2rgb [options] input.tif output.tif\n"
+"where options are:\n"
+" -p contig pack samples contiguously (e.g. RGBRGB...)\n"
+" -p separate store samples separately (e.g. RRR...GGG...BBB...)\n"
+" -r # make each strip have no more than # rows\n"
+" -C 8 assume 8-bit colormap values (instead of 16-bit)\n"
+" -C 16 assume 16-bit colormap values\n"
+"\n"
+#ifdef LZW_SUPPORT
+" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding\n"
+/* " LZW options:\n" */
+" # set predictor value\n"
+" For example, -c lzw:2 to get LZW-encoded data with horizontal differencing\n"
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip[:opts] compress output with deflate encoding\n"
+/* " Deflate (ZIP) options:\n" */
+" # set predictor value\n"
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits compress output with packbits encoding\n"
+#endif
+#if defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(PACKBITS_SUPPORT)
+" -c none use no compression algorithm on output\n"
+#endif
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
diff --git a/tiff/tools/ppm2tiff.c b/tiff/tools/ppm2tiff.c
index c6332439..d0eaee85 100644
--- a/tiff/tools/ppm2tiff.c
+++ b/tiff/tools/ppm2tiff.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -41,16 +42,8 @@
# include <io.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffio.h"
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
@@ -61,17 +54,17 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
#define streq(a,b) (strcmp(a,b) == 0)
#define strneq(a,b,n) (strncmp(a,b,n) == 0)
-static uint16 compression = COMPRESSION_PACKBITS;
-static uint16 predictor = 0;
+static uint16_t compression = COMPRESSION_PACKBITS;
+static uint16_t predictor = 0;
static int quality = 75; /* JPEG quality */
static int jpegcolormode = JPEGCOLORMODE_RGB;
-static uint32 g3opts;
+static uint32_t g3opts;
static void usage(int code);
static int processCompressOptions(char*);
static void
-pack_none (unsigned char *buf, unsigned int smpls, uint16 bps)
+pack_none (unsigned char *buf, unsigned int smpls, uint16_t bps)
{
(void)buf;
(void)smpls;
@@ -80,7 +73,7 @@ pack_none (unsigned char *buf, unsigned int smpls, uint16 bps)
}
static void
-pack_swab (unsigned char *buf, unsigned int smpls, uint16 bps)
+pack_swab (unsigned char *buf, unsigned int smpls, uint16_t bps)
{
unsigned int s;
unsigned char h;
@@ -99,13 +92,13 @@ pack_swab (unsigned char *buf, unsigned int smpls, uint16 bps)
}
static void
-pack_bytes (unsigned char *buf, unsigned int smpls, uint16 bps)
+pack_bytes (unsigned char *buf, unsigned int smpls, uint16_t bps)
{
unsigned int s;
unsigned int in;
unsigned int out;
int bits;
- uint16 t;
+ uint16_t t;
in = 0;
out = 0;
@@ -115,7 +108,7 @@ pack_bytes (unsigned char *buf, unsigned int smpls, uint16 bps)
for (s = 0; smpls > s; s++) {
t <<= bps;
- t |= (uint16) buf [in++];
+ t |= (uint16_t) buf [in++];
bits += bps;
@@ -129,13 +122,13 @@ pack_bytes (unsigned char *buf, unsigned int smpls, uint16 bps)
}
static void
-pack_words (unsigned char *buf, unsigned int smpls, uint16 bps)
+pack_words (unsigned char *buf, unsigned int smpls, uint16_t bps)
{
unsigned int s;
unsigned int in;
unsigned int out;
int bits;
- uint32 t;
+ uint32_t t;
in = 0;
out = 0;
@@ -145,8 +138,8 @@ pack_words (unsigned char *buf, unsigned int smpls, uint16 bps)
for (s = 0; smpls > s; s++) {
t <<= bps;
- t |= (uint32) buf [in++] << 8;
- t |= (uint32) buf [in++] << 0;
+ t |= (uint32_t) buf [in++] << 8;
+ t |= (uint32_t) buf [in++] << 0;
bits += bps;
@@ -173,9 +166,6 @@ BadPPM(char* file)
}
-#define TIFF_SIZE_T_MAX ((size_t) ~ ((size_t)0))
-#define TIFF_TMSIZE_T_MAX (tmsize_t)(TIFF_SIZE_T_MAX >> 1)
-
static tmsize_t
multiply_ms(tmsize_t m1, tmsize_t m2)
{
@@ -187,15 +177,15 @@ multiply_ms(tmsize_t m1, tmsize_t m2)
int
main(int argc, char* argv[])
{
- uint16 photometric = 0;
- uint32 rowsperstrip = (uint32) -1;
+ uint16_t photometric = 0;
+ uint32_t rowsperstrip = (uint32_t) -1;
double resolution = -1;
unsigned char *buf = NULL;
tmsize_t linebytes = 0;
int pbm;
- uint16 spp = 1;
- uint16 bpp = 8;
- void (*pack_func) (unsigned char *buf, unsigned int smpls, uint16 bps);
+ uint16_t spp = 1;
+ uint16_t bpp = 8;
+ void (*pack_func) (unsigned char *buf, unsigned int smpls, uint16_t bps);
TIFF *out;
FILE *in;
unsigned int w, h, prec, row;
@@ -225,6 +215,7 @@ main(int argc, char* argv[])
break;
case 'h':
usage(EXIT_SUCCESS);
+ break;
case '?':
usage(EXIT_FAILURE);
/*NOTREACHED*/
@@ -349,8 +340,8 @@ main(int argc, char* argv[])
out = TIFFOpen(argv[optind], "w");
if (out == NULL)
return (EXIT_FAILURE);
- TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) w);
- TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32) h);
+ TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32_t) w);
+ TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32_t) h);
TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, spp);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, bpp);
@@ -379,7 +370,7 @@ main(int argc, char* argv[])
} else {
linebytes = multiply_ms(2 * spp, w);
}
- if (rowsperstrip == (uint32) -1) {
+ if (rowsperstrip == (uint32_t) -1) {
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, h);
} else {
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
@@ -412,8 +403,8 @@ main(int argc, char* argv[])
}
for (row = 0; row < h; row++) {
if (fread(buf, linebytes, 1, in) != 1) {
- fprintf(stderr, "%s: scanline %lu: Read error.\n",
- infile, (unsigned long) row);
+ fprintf(stderr, "%s: scanline %u: Read error.\n",
+ infile, row);
break;
}
pack_func (buf, w * spp, bpp);
@@ -489,38 +480,49 @@ processCompressOptions(char* opt)
return (1);
}
-const char* stuff[] = {
-"usage: ppm2tiff [options] input.ppm output.tif",
-"where options are:",
-" -r # make each strip have no more than # rows",
-" -R # set x&y resolution (dpi)",
-"",
-" -c jpeg[:opts] compress output with JPEG encoding",
-" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts] compress output with deflate encoding",
-" -c packbits compress output with packbits encoding (the default)",
-" -c g3[:opts] compress output with CCITT Group 3 encoding",
-" -c g4 compress output with CCITT Group 4 encoding",
-" -c none use no compression algorithm on output",
-"",
-"JPEG options:",
-" # set compression quality level (0-100, default 75)",
-" r output color image as RGB rather than YCbCr",
-"LZW and deflate options:",
-" # set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-NULL
-};
+static const char usage_info[] =
+"Create a TIFF file from PPM, PGM and PBM image files\n\n"
+"usage: ppm2tiff [options] input.ppm output.tif\n"
+"where options are:\n"
+" -r # make each strip have no more than # rows\n"
+" -R # set x&y resolution (dpi)\n"
+"\n"
+#ifdef JPEG_SUPPORT
+" -c jpeg[:opts] compress output with JPEG encoding\n"
+/* "JPEG options:\n" */
+" # set compression quality level (0-100, default 75)\n"
+" r output color image as RGB rather than YCbCr\n"
+#endif
+#ifdef LZW_SUPPORT
+" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding\n"
+/* " LZW options:\n" */
+" # set predictor value\n"
+" For example, -c lzw:2 for LZW-encoded data with horizontal differencing\n"
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip[:opts] compress output with deflate encoding\n"
+/* " Deflate (ZIP) options:\n" */
+" # set predictor value\n"
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits compress output with packbits encoding (the default)\n"
+#endif
+#ifdef CCITT_SUPPORT
+" -c g3[:opts] compress output with CCITT Group 3 encoding\n"
+" -c g4 compress output with CCITT Group 4 encoding\n"
+#endif
+#if defined(JPEG_SUPPORT) || defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(PACKBITS_SUPPORT) || defined(CCITT_SUPPORT)
+" -c none use no compression algorithm on output\n"
+#endif
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
diff --git a/tiff/tools/raw2tiff.c b/tiff/tools/raw2tiff.c
index 8bbdc045..dfee715f 100644
--- a/tiff/tools/raw2tiff.c
+++ b/tiff/tools/raw2tiff.c
@@ -27,6 +27,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -52,10 +53,6 @@
# include <io.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffiop.h"
#include "tiffio.h"
@@ -66,10 +63,6 @@
#define EXIT_FAILURE 1
#endif
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
#ifndef O_BINARY
# define O_BINARY 0
#endif
@@ -79,37 +72,37 @@ typedef enum {
BAND
} InterleavingType;
-static uint16 compression = (uint16) -1;
+static uint16_t compression = (uint16_t) -1;
static int jpegcolormode = JPEGCOLORMODE_RGB;
static int quality = 75; /* JPEG quality */
-static uint16 predictor = 0;
+static uint16_t predictor = 0;
-static void swapBytesInScanline(void *, uint32, TIFFDataType);
-static int guessSize(int, TIFFDataType, _TIFF_off_t, uint32, int,
- uint32 *, uint32 *);
-static double correlation(void *, void *, uint32, TIFFDataType);
+static void swapBytesInScanline(void *, uint32_t, TIFFDataType);
+static int guessSize(int, TIFFDataType, _TIFF_off_t, uint32_t, int,
+ uint32_t *, uint32_t *);
+static double correlation(void *, void *, uint32_t, TIFFDataType);
static void usage(int);
static int processCompressOptions(char*);
int
main(int argc, char* argv[])
{
- uint32 width = 0, length = 0, linebytes, bufsize;
- uint32 nbands = 1; /* number of bands in input image*/
+ uint32_t width = 0, length = 0, linebytes, bufsize;
+ uint32_t nbands = 1; /* number of bands in input image*/
_TIFF_off_t hdr_size = 0; /* size of the header to skip */
TIFFDataType dtype = TIFF_BYTE;
- int16 depth = 1; /* bytes per pixel in input image */
+ int16_t depth = 1; /* bytes per pixel in input image */
int swab = 0; /* byte swapping flag */
InterleavingType interleaving = 0; /* interleaving type flag */
- uint32 rowsperstrip = (uint32) -1;
- uint16 photometric = PHOTOMETRIC_MINISBLACK;
- uint16 config = PLANARCONFIG_CONTIG;
- uint16 fillorder = FILLORDER_LSB2MSB;
+ uint32_t rowsperstrip = (uint32_t) -1;
+ uint16_t photometric = PHOTOMETRIC_MINISBLACK;
+ uint16_t config = PLANARCONFIG_CONTIG;
+ uint16_t fillorder = FILLORDER_LSB2MSB;
int fd;
char *outfilename = NULL;
TIFF *out;
- uint32 row, col, band;
+ uint32_t row, col, band;
int c;
unsigned char *buf = NULL, *buf1 = NULL;
#if !HAVE_DECL_OPTARG
@@ -254,7 +247,7 @@ main(int argc, char* argv[])
TIFFSetField(out, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_VOID);
break;
}
- if (compression == (uint16) -1)
+ if (compression == (uint16_t) -1)
compression = COMPRESSION_PACKBITS;
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
switch (compression) {
@@ -299,16 +292,14 @@ main(int argc, char* argv[])
hdr_size + (length*band+row)*linebytes,
SEEK_SET) == (_TIFF_off_t)-1) {
fprintf(stderr,
- "%s: %s: scanline %lu: seek error.\n",
- argv[0], argv[optind],
- (unsigned long) row);
+ "%s: %s: scanline %"PRIu32": seek error.\n",
+ argv[0], argv[optind], row);
break;
}
if (read(fd, buf, linebytes) < 0) {
fprintf(stderr,
- "%s: %s: scanline %lu: Read error.\n",
- argv[0], argv[optind],
- (unsigned long) row);
+ "%s: %s: scanline %"PRIu32": Read error.\n",
+ argv[0], argv[optind], row);
break;
}
if (swab) /* Swap bytes if needed */
@@ -322,9 +313,8 @@ main(int argc, char* argv[])
default:
if (read(fd, buf1, bufsize) < 0) {
fprintf(stderr,
- "%s: %s: scanline %lu: Read error.\n",
- argv[0], argv[optind],
- (unsigned long) row);
+ "%s: %s: scanline %"PRIu32": Read error.\n",
+ argv[0], argv[optind], row);
break;
}
if (swab) /* Swap bytes if needed */
@@ -333,8 +323,8 @@ main(int argc, char* argv[])
}
if (TIFFWriteScanline(out, buf1, row, 0) < 0) {
- fprintf(stderr, "%s: %s: scanline %lu: Write error.\n",
- argv[0], outfilename, (unsigned long) row);
+ fprintf(stderr, "%s: %s: scanline %"PRIu32": Write error.\n",
+ argv[0], outfilename, row);
break;
}
}
@@ -347,17 +337,17 @@ main(int argc, char* argv[])
}
static void
-swapBytesInScanline(void *buf, uint32 width, TIFFDataType dtype)
+swapBytesInScanline(void *buf, uint32_t width, TIFFDataType dtype)
{
switch (dtype) {
case TIFF_SHORT:
case TIFF_SSHORT:
- TIFFSwabArrayOfShort((uint16*)buf,
+ TIFFSwabArrayOfShort((uint16_t*)buf,
(unsigned long)width);
break;
case TIFF_LONG:
case TIFF_SLONG:
- TIFFSwabArrayOfLong((uint32*)buf,
+ TIFFSwabArrayOfLong((uint32_t*)buf,
(unsigned long)width);
break;
/* case TIFF_FLOAT: */ /* FIXME */
@@ -371,14 +361,14 @@ swapBytesInScanline(void *buf, uint32 width, TIFFDataType dtype)
}
static int
-guessSize(int fd, TIFFDataType dtype, _TIFF_off_t hdr_size, uint32 nbands,
- int swab, uint32 *width, uint32 *length)
+guessSize(int fd, TIFFDataType dtype, _TIFF_off_t hdr_size, uint32_t nbands,
+ int swab, uint32_t *width, uint32_t *length)
{
const float longt = 40.0; /* maximum possible height/width ratio */
char *buf1, *buf2;
_TIFF_stat_s filestat;
- uint32 w, h, scanlinesize, imagesize;
- uint32 depth = TIFFDataWidth(dtype);
+ uint32_t w, h, scanlinesize, imagesize;
+ uint32_t depth = TIFFDataWidth(dtype);
double cor_coef = 0, tmp;
if (_TIFF_fstat_f(fd, &filestat) == -1) {
@@ -398,8 +388,8 @@ guessSize(int fd, TIFFDataType dtype, _TIFF_off_t hdr_size, uint32 nbands,
*length = imagesize / *width;
- fprintf(stderr, "Height is guessed as %lu.\n",
- (unsigned long)*length);
+ fprintf(stderr, "Height is guessed as %"PRIu32".\n",
+ *length);
return 1;
} else if (*width == 0 && *length != 0) {
@@ -407,14 +397,14 @@ guessSize(int fd, TIFFDataType dtype, _TIFF_off_t hdr_size, uint32 nbands,
*width = imagesize / *length;
- fprintf(stderr, "Width is guessed as %lu.\n",
- (unsigned long)*width);
+ fprintf(stderr, "Width is guessed as %"PRIu32".\n",
+ *width);
return 1;
} else if (*width == 0 && *length == 0) {
unsigned int fail = 0;
fprintf(stderr, "Image width and height are not specified.\n");
- w = (uint32) sqrt(imagesize / longt);
+ w = (uint32_t) sqrt(imagesize / longt);
if( w == 0 )
{
fprintf(stderr, "Too small image size.\n");
@@ -480,8 +470,8 @@ guessSize(int fd, TIFFDataType dtype, _TIFF_off_t hdr_size, uint32 nbands,
}
fprintf(stderr,
- "Width is guessed as %lu, height is guessed as %lu.\n",
- (unsigned long)*width, (unsigned long)*length);
+ "Width is guessed as %"PRIu32", height is guessed as %"PRIu32".\n",
+ *width, *length);
return 1;
} else {
@@ -496,10 +486,10 @@ guessSize(int fd, TIFFDataType dtype, _TIFF_off_t hdr_size, uint32 nbands,
/* Calculate correlation coefficient between two numeric vectors */
static double
-correlation(void *buf1, void *buf2, uint32 n_elem, TIFFDataType dtype)
+correlation(void *buf1, void *buf2, uint32_t n_elem, TIFFDataType dtype)
{
double X, Y, M1 = 0.0, M2 = 0.0, D1 = 0.0, D2 = 0.0, K = 0.0;
- uint32 i;
+ uint32_t i;
switch (dtype) {
case TIFF_BYTE:
@@ -523,8 +513,8 @@ correlation(void *buf1, void *buf2, uint32 n_elem, TIFFDataType dtype)
break;
case TIFF_SHORT:
for (i = 0; i < n_elem; i++) {
- X = ((uint16 *)buf1)[i];
- Y = ((uint16 *)buf2)[i];
+ X = ((uint16_t *)buf1)[i];
+ Y = ((uint16_t *)buf2)[i];
M1 += X, M2 += Y;
D1 += X * X, D2 += Y * Y;
K += X * Y;
@@ -532,8 +522,8 @@ correlation(void *buf1, void *buf2, uint32 n_elem, TIFFDataType dtype)
break;
case TIFF_SSHORT:
for (i = 0; i < n_elem; i++) {
- X = ((int16 *)buf1)[i];
- Y = ((int16 *)buf2)[i];
+ X = ((int16_t *)buf1)[i];
+ Y = ((int16_t *)buf2)[i];
M1 += X, M2 += Y;
D1 += X * X, D2 += Y * Y;
K += X * Y;
@@ -541,8 +531,8 @@ correlation(void *buf1, void *buf2, uint32 n_elem, TIFFDataType dtype)
break;
case TIFF_LONG:
for (i = 0; i < n_elem; i++) {
- X = ((uint32 *)buf1)[i];
- Y = ((uint32 *)buf2)[i];
+ X = ((uint32_t *)buf1)[i];
+ Y = ((uint32_t *)buf2)[i];
M1 += X, M2 += Y;
D1 += X * X, D2 += Y * Y;
K += X * Y;
@@ -550,8 +540,8 @@ correlation(void *buf1, void *buf2, uint32 n_elem, TIFFDataType dtype)
break;
case TIFF_SLONG:
for (i = 0; i < n_elem; i++) {
- X = ((int32 *)buf1)[i];
- Y = ((int32 *)buf2)[i];
+ X = ((int32_t *)buf1)[i];
+ Y = ((int32_t *)buf2)[i];
M1 += X, M2 += Y;
D1 += X * X, D2 += Y * Y;
K += X * Y;
@@ -624,75 +614,83 @@ processCompressOptions(char* opt)
return (1);
}
-static const char* stuff[] = {
-"raw2tiff --- tool for converting raw byte sequences in TIFF images",
-"usage: raw2tiff [options] input.raw output.tif",
-"where options are:",
-" -L input data has LSB2MSB bit order (default)",
-" -M input data has MSB2LSB bit order",
-" -r # make each strip have no more than # rows",
-" -H # size of input image file header in bytes (0 by default)",
-" -w # width of input image in pixels",
-" -l # length of input image in lines",
-" -b # number of bands in input image (1 by default)",
-"",
-" -d data_type type of samples in input image",
-"where data_type may be:",
-" byte 8-bit unsigned integer (default)",
-" short 16-bit unsigned integer",
-" long 32-bit unsigned integer",
-" sbyte 8-bit signed integer",
-" sshort 16-bit signed integer",
-" slong 32-bit signed integer",
-" float 32-bit IEEE floating point",
-" double 64-bit IEEE floating point",
-"",
-" -p photo photometric interpretation (color space) of the input image",
-"where photo may be:",
-" miniswhite white color represented with 0 value",
-" minisblack black color represented with 0 value (default)",
-" rgb image has RGB color model",
-" cmyk image has CMYK (separated) color model",
-" ycbcr image has YCbCr color model",
-" cielab image has CIE L*a*b color model",
-" icclab image has ICC L*a*b color model",
-" itulab image has ITU L*a*b color model",
-"",
-" -s swap bytes fetched from input file",
-"",
-" -i config type of samples interleaving in input image",
-"where config may be:",
-" pixel pixel interleaved data (default)",
-" band band interleaved data",
-"",
-" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts] compress output with deflate encoding",
-" -c jpeg[:opts] compress output with JPEG encoding",
-" -c packbits compress output with packbits encoding",
-" -c none use no compression algorithm on output",
-"",
-"JPEG options:",
-" # set compression quality level (0-100, default 75)",
-" r output color image as RGB rather than YCbCr",
-"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality",
-"",
-"LZW and deflate options:",
-" # set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-" -o out.tif write output to out.tif",
-" -h this help message",
-NULL
-};
+static const char usage_info[] =
+"Create a TIFF file from raw data\n\n"
+"usage: raw2tiff [options] input.raw output.tif\n"
+"where options are:\n"
+" -L input data has LSB2MSB bit order (default)\n"
+" -M input data has MSB2LSB bit order\n"
+" -r # make each strip have no more than # rows\n"
+" -H # size of input image file header in bytes (0 by default)\n"
+" -w # width of input image in pixels\n"
+" -l # length of input image in lines\n"
+" -b # number of bands in input image (1 by default)\n"
+"\n"
+" -d data_type type of samples in input image\n"
+"where data_type may be:\n"
+" byte 8-bit unsigned integer (default)\n"
+" short 16-bit unsigned integer\n"
+" long 32-bit unsigned integer\n"
+" sbyte 8-bit signed integer\n"
+" sshort 16-bit signed integer\n"
+" slong 32-bit signed integer\n"
+" float 32-bit IEEE floating point\n"
+" double 64-bit IEEE floating point\n"
+"\n"
+" -p photo photometric interpretation (color space) of the input image\n"
+"where photo may be:\n"
+" miniswhite white color represented with 0 value\n"
+" minisblack black color represented with 0 value (default)\n"
+" rgb image has RGB color model\n"
+" cmyk image has CMYK (separated) color model\n"
+" ycbcr image has YCbCr color model\n"
+" cielab image has CIE L*a*b color model\n"
+" icclab image has ICC L*a*b color model\n"
+" itulab image has ITU L*a*b color model\n"
+"\n"
+" -s swap bytes fetched from input file\n"
+"\n"
+" -i config type of samples interleaving in input image\n"
+"where config may be:\n"
+" pixel pixel interleaved data (default)\n"
+" band band interleaved data\n"
+"\n"
+#ifdef LZW_SUPPORT
+" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding\n"
+/* " LZW options:\n" */
+" # set predictor value\n"
+" For example, -c lzw:2 for LZW-encoded data with horizontal differencing\n"
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip[:opts] compress output with deflate encoding\n"
+/* " Deflate (ZIP) options:\n" */
+" # set predictor value\n"
+#endif
+#ifdef JPEG_SUPPORT
+" -c jpeg[:opts] compress output with JPEG encoding\n"
+/* " JPEG options:\n" */
+" # set compression quality level (0-100, default 75)\n"
+" r output color image as RGB rather than YCbCr\n"
+" For example, -c jpeg:r:50 for JPEG-encoded RGB data with 50% comp. quality\n"
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits compress output with packbits encoding\n"
+#endif
+#if defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(JPEG_SUPPORT) || defined(PACKBITS_SUPPORT)
+" -c none use no compression algorithm on output\n"
+#endif
+"\n"
+" -o out.tif write output to out.tif\n"
+" -h this help message\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
diff --git a/tiff/tools/rgb2ycbcr.c b/tiff/tools/rgb2ycbcr.c
index 482cc5b4..d2a93c2d 100644
--- a/tiff/tools/rgb2ycbcr.c
+++ b/tiff/tools/rgb2ycbcr.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <string.h>
@@ -32,10 +33,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffiop.h"
#include "tiffio.h"
@@ -53,17 +50,17 @@
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
#endif
-#define roundup(x, y) (howmany(x,y)*((uint32)(y)))
+#define roundup(x, y) (howmany(x,y)*((uint32_t)(y)))
#define LumaRed ycbcrCoeffs[0]
#define LumaGreen ycbcrCoeffs[1]
#define LumaBlue ycbcrCoeffs[2]
-uint16 compression = COMPRESSION_PACKBITS;
-uint32 rowsperstrip = (uint32) -1;
+uint16_t compression = COMPRESSION_PACKBITS;
+uint32_t rowsperstrip = (uint32_t) -1;
-uint16 horizSubSampling = 2; /* YCbCr horizontal subsampling */
-uint16 vertSubSampling = 2; /* YCbCr vertical subsampling */
+uint16_t horizSubSampling = 2; /* YCbCr horizontal subsampling */
+uint16_t vertSubSampling = 2; /* YCbCr vertical subsampling */
float ycbcrCoeffs[3] = { .299F, .587F, .114F };
/* default coding range is CCIR Rec 601-1 with no headroom/footroom */
float refBlackWhite[6] = { 0.F, 255.F, 128.F, 255.F, 128.F, 255.F };
@@ -182,17 +179,17 @@ setupLumaTables(void)
}
static void
-cvtClump(unsigned char* op, uint32* raster, uint32 ch, uint32 cw, uint32 w)
+cvtClump(unsigned char* op, uint32_t* raster, uint32_t ch, uint32_t cw, uint32_t w)
{
float Y, Cb = 0, Cr = 0;
- uint32 j, k;
+ uint32_t j, k;
/*
* Convert ch-by-cw block of RGB
* to YCbCr and sample accordingly.
*/
for (k = 0; k < ch; k++) {
for (j = 0; j < cw; j++) {
- uint32 RGB = (raster - k*w)[j];
+ uint32_t RGB = (raster - k * w)[j];
Y = lumaRed[TIFFGetR(RGB)] +
lumaGreen[TIFFGetG(RGB)] +
lumaBlue[TIFFGetB(RGB)];
@@ -224,11 +221,11 @@ cvtClump(unsigned char* op, uint32* raster, uint32 ch, uint32 cw, uint32 w)
* sample to generate the output data.
*/
static void
-cvtStrip(unsigned char* op, uint32* raster, uint32 nrows, uint32 width)
+cvtStrip(unsigned char* op, uint32_t* raster, uint32_t nrows, uint32_t width)
{
- uint32 x;
+ uint32_t x;
int clumpSize = vertSubSampling * horizSubSampling + 2;
- uint32 *tp;
+ uint32_t *tp;
for (; nrows >= vertSubSampling; nrows -= vertSubSampling) {
tp = raster;
@@ -257,23 +254,23 @@ cvtStrip(unsigned char* op, uint32* raster, uint32 nrows, uint32 width)
}
static int
-cvtRaster(TIFF* tif, uint32* raster, uint32 width, uint32 height)
+cvtRaster(TIFF* tif, uint32_t* raster, uint32_t width, uint32_t height)
{
- uint32 y;
+ uint32_t y;
tstrip_t strip = 0;
tsize_t cc, acc;
unsigned char* buf;
- uint32 rwidth = roundup(width, horizSubSampling);
- uint32 rheight = roundup(height, vertSubSampling);
- uint32 nrows = (rowsperstrip > rheight ? rheight : rowsperstrip);
- uint32 rnrows = roundup(nrows,vertSubSampling);
+ uint32_t rwidth = roundup(width, horizSubSampling);
+ uint32_t rheight = roundup(height, vertSubSampling);
+ uint32_t nrows = (rowsperstrip > rheight ? rheight : rowsperstrip);
+ uint32_t rnrows = roundup(nrows, vertSubSampling);
cc = rnrows*rwidth +
2*((rnrows*rwidth) / (horizSubSampling*vertSubSampling));
buf = (unsigned char*)_TIFFmalloc(cc);
// FIXME unchecked malloc
- for (y = height; (int32) y > 0; y -= nrows) {
- uint32 nr = (y > nrows ? nrows : y);
+ for (y = height; (int32_t) y > 0; y -= nrows) {
+ uint32_t nr = (y > nrows ? nrows : y);
cvtStrip(buf, raster + (y-1)*width, nr, width);
nr = roundup(nr, vertSubSampling);
acc = nr*rwidth +
@@ -290,12 +287,12 @@ cvtRaster(TIFF* tif, uint32* raster, uint32 width, uint32 height)
static int
tiffcvt(TIFF* in, TIFF* out)
{
- uint32 width, height; /* image width & height */
- uint32* raster; /* retrieve RGBA image */
- uint16 shortv;
+ uint32_t width, height; /* image width & height */
+ uint32_t* raster; /* retrieve RGBA image */
+ uint16_t shortv;
float floatv;
char *stringv;
- uint32 longv;
+ uint32_t longv;
int result;
size_t pixel_count;
@@ -307,18 +304,18 @@ tiffcvt(TIFF* in, TIFF* out)
if (!width || !height || pixel_count / width != height) {
TIFFError(TIFFFileName(in),
"Malformed input file; "
- "can't allocate buffer for raster of %lux%lu size",
- (unsigned long)width, (unsigned long)height);
+ "can't allocate buffer for raster of %"PRIu32"x%"PRIu32" size",
+ width, height);
return 0;
}
- raster = (uint32*)_TIFFCheckMalloc(in, pixel_count, sizeof(uint32),
- "raster buffer");
+ raster = (uint32_t*)_TIFFCheckMalloc(in, pixel_count, sizeof(uint32_t),
+ "raster buffer");
if (raster == 0) {
TIFFError(TIFFFileName(in),
- "Failed to allocate buffer (%lu elements of %lu each)",
- (unsigned long)pixel_count,
- (unsigned long)sizeof(uint32));
+ "Failed to allocate buffer (%"TIFF_SIZE_FORMAT" elements of %"TIFF_SIZE_FORMAT" each)",
+ pixel_count,
+ sizeof(uint32_t));
return (0);
}
@@ -364,19 +361,34 @@ tiffcvt(TIFF* in, TIFF* out)
return result;
}
-const char* stuff[] = {
- "usage: rgb2ycbcr [-c comp] [-r rows] [-h N] [-v N] input... output\n",
- "where comp is one of the following compression algorithms:\n",
- " jpeg\t\tJPEG encoding\n",
- " lzw\t\tLempel-Ziv & Welch encoding\n",
- " zip\t\tdeflate encoding\n",
- " packbits\tPackBits encoding (default)\n",
- " none\t\tno compression\n",
- "and the other options are:\n",
- " -r\trows/strip\n",
- " -h\thorizontal sampling factor (1,2,4)\n",
- " -v\tvertical sampling factor (1,2,4)\n",
- NULL
+const char* usage_info[] = {
+/* Help information format modified for the sake of consistency with the other tiff tools */
+/* "usage: rgb2ycbcr [-c comp] [-r rows] [-h N] [-v N] input... output\n", */
+/* "where comp is one of the following compression algorithms:\n", */
+"Convert RGB color, greyscale, or bi-level TIFF images to YCbCr images\n\n"
+"usage: rgb2ycbcr [options] input output",
+"where options are:",
+#ifdef JPEG_SUPPORT
+" -c jpeg JPEG encoding",
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip Zip/Deflate encoding",
+#endif
+#ifdef LZW_SUPPORT
+" -c lzw Lempel-Ziv & Welch encoding",
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits PackBits encoding (default)",
+#endif
+#if defined(JPEG_SUPPORT) || defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(PACKBITS_SUPPORT)
+" -c none no compression",
+#endif
+"",
+/* "and the other options are:\n", */
+" -r rows/strip",
+" -h horizontal sampling factor (1,2,4)",
+" -v vertical sampling factor (1,2,4)",
+NULL
};
static void
@@ -386,8 +398,8 @@ usage(int code)
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ for (i = 0; usage_info[i] != NULL; i++)
+ fprintf(out, "%s\n", usage_info[i]);
exit(code);
}
diff --git a/tiff/tools/thumbnail.c b/tiff/tools/thumbnail.c
index edb69983..274705d3 100644
--- a/tiff/tools/thumbnail.c
+++ b/tiff/tools/thumbnail.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -33,10 +34,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffio.h"
#ifndef EXIT_SUCCESS
@@ -46,14 +43,10 @@
#define EXIT_FAILURE 1
#endif
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
#define streq(a,b) (strcmp(a,b) == 0)
#ifndef TIFFhowmany8
-# define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
+# define TIFFhowmany8(x) (((x)&0x07)?((uint32_t)(x)>>3)+1:(uint32_t)(x)>>3)
#endif
typedef enum {
@@ -66,10 +59,10 @@ typedef enum {
LINEAR
} Contrast;
-static uint32 tnw = 216; /* thumbnail width */
-static uint32 tnh = 274; /* thumbnail height */
+static uint32_t tnw = 216; /* thumbnail width */
+static uint32_t tnh = 274; /* thumbnail height */
static Contrast contrast = LINEAR; /* current contrast */
-static uint8* thumbnail;
+static uint8_t* thumbnail;
static int cpIFD(TIFF*, TIFF*);
static int generateThumbnail(TIFF*, TIFF*);
@@ -114,7 +107,7 @@ main(int argc, char* argv[])
if( in == NULL )
return 2;
- thumbnail = (uint8*) _TIFFmalloc(tnw * tnh);
+ thumbnail = (uint8_t*) _TIFFmalloc(tnw * tnh);
if (!thumbnail) {
TIFFError(TIFFFileName(in),
"Can't allocate space for thumbnail buffer.");
@@ -148,37 +141,37 @@ bad:
if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4)
static void
-cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
+cpTag(TIFF* in, TIFF* out, uint16_t tag, uint16_t count, TIFFDataType type)
{
switch (type) {
case TIFF_SHORT:
if (count == 1) {
- uint16 shortv;
+ uint16_t shortv;
CopyField(tag, shortv);
} else if (count == 2) {
- uint16 shortv1, shortv2;
+ uint16_t shortv1, shortv2;
CopyField2(tag, shortv1, shortv2);
} else if (count == 4) {
- uint16 *tr, *tg, *tb, *ta;
+ uint16_t *tr, *tg, *tb, *ta;
CopyField4(tag, tr, tg, tb, ta);
- } else if (count == (uint16) -1) {
- uint16 shortv1;
- uint16* shortav;
+ } else if (count == (uint16_t) -1) {
+ uint16_t shortv1;
+ uint16_t* shortav;
CopyField2(tag, shortv1, shortav);
}
break;
case TIFF_LONG:
- { uint32 longv;
+ { uint32_t longv;
CopyField(tag, longv);
}
break;
case TIFF_LONG8:
- { uint64 longv8;
+ { uint64_t longv8;
CopyField(tag, longv8);
}
break;
case TIFF_SLONG8:
- { int64 longv8;
+ { int64_t longv8;
CopyField(tag, longv8);
}
break;
@@ -186,7 +179,7 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
float floatv;
CopyField(tag, floatv);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
float* floatav;
CopyField(tag, floatav);
}
@@ -200,7 +193,7 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
double doublev;
CopyField(tag, doublev);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
double* doubleav;
CopyField(tag, doubleav);
}
@@ -221,9 +214,9 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
#undef CopyField2
#undef CopyField
-static struct cpTag {
- uint16 tag;
- uint16 count;
+static const struct cpTag {
+ uint16_t tag;
+ uint16_t count;
TIFFDataType type;
} tags[] = {
{ TIFFTAG_IMAGEWIDTH, 1, TIFF_LONG },
@@ -248,38 +241,38 @@ static struct cpTag {
{ TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL },
{ TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL },
{ TIFFTAG_PAGENAME, 1, TIFF_ASCII },
- { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_GROUP4OPTIONS, 1, TIFF_LONG },
- { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
- { TIFFTAG_PAGENUMBER, 2, TIFF_SHORT },
- { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
- { TIFFTAG_DATETIME, 1, TIFF_ASCII },
- { TIFFTAG_ARTIST, 1, TIFF_ASCII },
- { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
- { TIFFTAG_WHITEPOINT, 2, TIFF_RATIONAL },
- { TIFFTAG_PRIMARYCHROMATICITIES, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
- { TIFFTAG_BADFAXLINES, 1, TIFF_LONG },
- { TIFFTAG_CLEANFAXDATA, 1, TIFF_SHORT },
- { TIFFTAG_CONSECUTIVEBADFAXLINES, 1, TIFF_LONG },
- { TIFFTAG_INKSET, 1, TIFF_SHORT },
+ { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_GROUP4OPTIONS, 1, TIFF_LONG },
+ { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
+ { TIFFTAG_PAGENUMBER, 2, TIFF_SHORT },
+ { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
+ { TIFFTAG_DATETIME, 1, TIFF_ASCII },
+ { TIFFTAG_ARTIST, 1, TIFF_ASCII },
+ { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
+ { TIFFTAG_WHITEPOINT, 2, TIFF_RATIONAL },
+ { TIFFTAG_PRIMARYCHROMATICITIES, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
+ { TIFFTAG_BADFAXLINES, 1, TIFF_LONG },
+ { TIFFTAG_CLEANFAXDATA, 1, TIFF_SHORT },
+ { TIFFTAG_CONSECUTIVEBADFAXLINES, 1, TIFF_LONG },
+ { TIFFTAG_INKSET, 1, TIFF_SHORT },
/*{ TIFFTAG_INKNAMES, 1, TIFF_ASCII },*/ /* Needs much more complicated logic. See tiffcp */
- { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
- { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
- { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
- { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
- { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
- { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_EXTRASAMPLES, (uint16) -1, TIFF_SHORT },
+ { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
+ { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
+ { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
+ { TIFFTAG_YCBCRCOEFFICIENTS, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
+ { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
+ { TIFFTAG_REFERENCEBLACKWHITE, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_EXTRASAMPLES, (uint16_t) -1, TIFF_SHORT },
};
#define NTAGS (sizeof (tags) / sizeof (tags[0]))
static void
cpTags(TIFF* in, TIFF* out)
{
- struct cpTag *p;
+ const struct cpTag *p;
for (p = tags; p < &tags[NTAGS]; p++)
{
/* Horrible: but TIFFGetField() expects 2 arguments to be passed */
@@ -287,14 +280,14 @@ cpTags(TIFF* in, TIFF* out)
/* isn't used */
if( p->tag == TIFFTAG_GROUP3OPTIONS )
{
- uint16 compression;
+ uint16_t compression;
if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
compression != COMPRESSION_CCITTFAX3 )
continue;
}
if( p->tag == TIFFTAG_GROUP4OPTIONS )
{
- uint16 compression;
+ uint16_t compression;
if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
compression != COMPRESSION_CCITTFAX4 )
continue;
@@ -312,11 +305,11 @@ cpStrips(TIFF* in, TIFF* out)
if (buf) {
tstrip_t s, ns = TIFFNumberOfStrips(in);
- uint64 *bytecounts;
+ uint64_t *bytecounts;
TIFFGetField(in, TIFFTAG_STRIPBYTECOUNTS, &bytecounts);
for (s = 0; s < ns; s++) {
- if (bytecounts[s] > (uint64) bufsize) {
+ if (bytecounts[s] > (uint64_t) bufsize) {
buf = (unsigned char *)_TIFFrealloc(buf, (tmsize_t)bytecounts[s]);
if (!buf)
goto bad;
@@ -346,11 +339,11 @@ cpTiles(TIFF* in, TIFF* out)
if (buf) {
ttile_t t, nt = TIFFNumberOfTiles(in);
- uint64 *bytecounts;
+ uint64_t *bytecounts;
TIFFGetField(in, TIFFTAG_TILEBYTECOUNTS, &bytecounts);
for (t = 0; t < nt; t++) {
- if (bytecounts[t] > (uint64) bufsize) {
+ if (bytecounts[t] > (uint64_t) bufsize) {
buf = (unsigned char *)_TIFFrealloc(buf, (tmsize_t)bytecounts[t]);
if (!buf)
goto bad;
@@ -386,16 +379,16 @@ cpIFD(TIFF* in, TIFF* out)
return (1);
}
-static uint16 photometric; /* current photometric of raster */
-static uint16 filterWidth; /* filter width in pixels */
-static uint32 stepSrcWidth; /* src image stepping width */
-static uint32 stepDstWidth; /* dest stepping width */
-static uint8* src0; /* horizontal bit stepping (start) */
-static uint8* src1; /* horizontal bit stepping (middle) */
-static uint8* src2; /* horizontal bit stepping (end) */
-static uint32* rowoff; /* row offset for stepping */
-static uint8 cmap[256]; /* colormap indexes */
-static uint8 bits[256]; /* count of bits set */
+static uint16_t photometric; /* current photometric of raster */
+static uint16_t filterWidth; /* filter width in pixels */
+static uint32_t stepSrcWidth; /* src image stepping width */
+static uint32_t stepDstWidth; /* dest stepping width */
+static uint8_t* src0; /* horizontal bit stepping (start) */
+static uint8_t* src1; /* horizontal bit stepping (middle) */
+static uint8_t* src2; /* horizontal bit stepping (end) */
+static uint32_t* rowoff; /* row offset for stepping */
+static uint8_t cmap[256]; /* colormap indexes */
+static uint8_t bits[256]; /* count of bits set */
static void
setupBitsTables()
@@ -423,10 +416,10 @@ static int clamp(float v, int low, int high)
#endif
static void
-expFill(float pct[], uint32 p, uint32 n)
+expFill(float pct[], uint32_t p, uint32_t n)
{
- uint32 i;
- uint32 c = (p * n) / 100;
+ uint32_t i;
+ uint32_t c = (p * n) / 100;
for (i = 1; i < c; i++)
pct[i] = (float) (1-exp(i/((double)(n-1)))/ M_E);
for (; i < n; i++)
@@ -437,7 +430,7 @@ static void
setupCmap()
{
float pct[256]; /* known to be large enough */
- uint32 i;
+ uint32_t i;
pct[0] = 1; /* force white */
switch (contrast) {
case EXP50: expFill(pct, 50, 256); break;
@@ -466,10 +459,10 @@ setupCmap()
static void
initScale()
{
- src0 = (uint8*) _TIFFmalloc(sizeof (uint8) * tnw);
- src1 = (uint8*) _TIFFmalloc(sizeof (uint8) * tnw);
- src2 = (uint8*) _TIFFmalloc(sizeof (uint8) * tnw);
- rowoff = (uint32*) _TIFFmalloc(sizeof (uint32) * tnw);
+ src0 = (uint8_t*) _TIFFmalloc(sizeof (uint8_t) * tnw);
+ src1 = (uint8_t*) _TIFFmalloc(sizeof (uint8_t) * tnw);
+ src2 = (uint8_t*) _TIFFmalloc(sizeof (uint8_t) * tnw);
+ rowoff = (uint32_t*) _TIFFmalloc(sizeof (uint32_t) * tnw);
filterWidth = 0;
stepDstWidth = stepSrcWidth = 0;
setupBitsTables();
@@ -480,18 +473,18 @@ initScale()
* according to the widths of the src and dst images.
*/
static void
-setupStepTables(uint32 sw)
+setupStepTables(uint32_t sw)
{
if (stepSrcWidth != sw || stepDstWidth != tnw) {
int step = sw;
int limit = tnw;
int err = 0;
- uint32 sx = 0;
- uint32 x;
+ uint32_t sx = 0;
+ uint32_t x;
int fw;
- uint8 b;
+ uint8_t b;
for (x = 0; x < tnw; x++) {
- uint32 sx0 = sx;
+ uint32_t sx0 = sx;
err += step;
while (err >= limit) {
err -= limit;
@@ -514,19 +507,19 @@ setupStepTables(uint32 sw)
}
static void
-setrow(uint8* row, uint32 nrows, const uint8* rows[])
+setrow(uint8_t* row, uint32_t nrows, const uint8_t* rows[])
{
- uint32 x;
- uint32 area = nrows * filterWidth;
+ uint32_t x;
+ uint32_t area = nrows * filterWidth;
for (x = 0; x < tnw; x++) {
- uint32 mask0 = src0[x];
- uint32 fw = src1[x];
- uint32 mask1 = src1[x];
- uint32 off = rowoff[x];
- uint32 acc = 0;
- uint32 y, i;
+ uint32_t mask0 = src0[x];
+ uint32_t fw = src1[x];
+ uint32_t mask1 = src1[x];
+ uint32_t off = rowoff[x];
+ uint32_t acc = 0;
+ uint32_t y, i;
for (y = 0; y < nrows; y++) {
- const uint8* src = rows[y] + off;
+ const uint8_t* src = rows[y] + off;
acc += bits[*src++ & mask0];
switch (fw) {
default:
@@ -556,18 +549,18 @@ setrow(uint8* row, uint32 nrows, const uint8* rows[])
* with a user-selectable contrast curve.
*/
static void
-setImage1(const uint8* br, uint32 rw, uint32 rh)
+setImage1(const uint8_t* br, uint32_t rw, uint32_t rh)
{
int step = rh;
int limit = tnh;
int err = 0;
int bpr = TIFFhowmany8(rw);
int sy = 0;
- uint8* row = thumbnail;
- uint32 dy;
+ uint8_t* row = thumbnail;
+ uint32_t dy;
for (dy = 0; dy < tnh; dy++) {
- const uint8* rows[256];
- uint32 nrows = 1;
+ const uint8_t* rows[256];
+ uint32_t nrows = 1;
fprintf(stderr, "bpr=%d, sy=%d, bpr*sy=%d\n", bpr, sy, bpr*sy);
rows[0] = br + bpr*sy;
err += step;
@@ -589,9 +582,9 @@ setImage1(const uint8* br, uint32 rw, uint32 rh)
}
static void
-setImage(const uint8* br, uint32 rw, uint32 rh)
+setImage(const uint8_t* br, uint32_t rw, uint32_t rh)
{
- filterWidth = (uint16) ceil((double) rw / (double) tnw);
+ filterWidth = (uint16_t) ceil((double) rw / (double) tnw);
setupStepTables(rw);
setImage1(br, rw, rh);
}
@@ -601,8 +594,8 @@ generateThumbnail(TIFF* in, TIFF* out)
{
unsigned char* raster;
unsigned char* rp;
- uint32 sw, sh, rps;
- uint16 bps, spp;
+ uint32_t sw, sh, rps;
+ uint16_t bps, spp;
tsize_t rowsize, rastersize;
tstrip_t s, ns = TIFFNumberOfStrips(in);
toff_t diroff[1];
@@ -639,25 +632,26 @@ generateThumbnail(TIFF* in, TIFF* out)
_TIFFfree(raster);
TIFFSetField(out, TIFFTAG_SUBFILETYPE, FILETYPE_REDUCEDIMAGE);
- TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) tnw);
- TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32) tnh);
- TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, (uint16) 8);
- TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, (uint16) 1);
+ TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32_t) tnw);
+ TIFFSetField(out, TIFFTAG_IMAGELENGTH, (uint32_t) tnh);
+ TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, (uint16_t) 8);
+ TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, (uint16_t) 1);
TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_PACKBITS);
TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE);
TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
- cpTag(in, out, TIFFTAG_SOFTWARE, (uint16) -1, TIFF_ASCII);
- cpTag(in, out, TIFFTAG_IMAGEDESCRIPTION, (uint16) -1, TIFF_ASCII);
- cpTag(in, out, TIFFTAG_DATETIME, (uint16) -1, TIFF_ASCII);
- cpTag(in, out, TIFFTAG_HOSTCOMPUTER, (uint16) -1, TIFF_ASCII);
+ cpTag(in, out, TIFFTAG_SOFTWARE, (uint16_t) -1, TIFF_ASCII);
+ cpTag(in, out, TIFFTAG_IMAGEDESCRIPTION, (uint16_t) -1, TIFF_ASCII);
+ cpTag(in, out, TIFFTAG_DATETIME, (uint16_t) -1, TIFF_ASCII);
+ cpTag(in, out, TIFFTAG_HOSTCOMPUTER, (uint16_t) -1, TIFF_ASCII);
diroff[0] = 0UL;
TIFFSetField(out, TIFFTAG_SUBIFD, 1, diroff);
return (TIFFWriteEncodedStrip(out, 0, thumbnail, tnw*tnh) != -1 &&
TIFFWriteDirectory(out) != -1);
}
-const char* stuff[] = {
+const char* usage_info[] = {
+"Create a TIFF file with thumbnail images\n\n"
"usage: thumbnail [options] input.tif output.tif",
"where options are:",
" -h # specify thumbnail image height (default is 274)",
@@ -680,8 +674,8 @@ usage(int code)
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ for (i = 0; usage_info[i] != NULL; i++)
+ fprintf(out, "%s\n", usage_info[i]);
exit(code);
}
diff --git a/tiff/tools/tiff2bw.c b/tiff/tools/tiff2bw.c
index 654bd324..75811e6a 100644
--- a/tiff/tools/tiff2bw.c
+++ b/tiff/tools/tiff2bw.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -33,10 +34,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffio.h"
#include "tiffiop.h"
@@ -57,7 +54,7 @@ static void usage(int code);
static int processCompressOptions(char*);
static void
-compresscontig(unsigned char* out, unsigned char* rgb, uint32 n)
+compresscontig(unsigned char* out, unsigned char* rgb, uint32_t n)
{
register int v, red = RED, green = GREEN, blue = BLUE;
@@ -71,9 +68,9 @@ compresscontig(unsigned char* out, unsigned char* rgb, uint32 n)
static void
compresssep(unsigned char* out,
- unsigned char* r, unsigned char* g, unsigned char* b, uint32 n)
+ unsigned char* r, unsigned char* g, unsigned char* b, uint32_t n)
{
- register uint32 red = RED, green = GREEN, blue = BLUE;
+ register uint32_t red = RED, green = GREEN, blue = BLUE;
while (n-- > 0)
*out++ = (unsigned char)
@@ -81,7 +78,7 @@ compresssep(unsigned char* out,
}
static int
-checkcmap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b)
+checkcmap(TIFF* tif, int n, uint16_t* r, uint16_t* g, uint16_t* b)
{
while (n-- > 0)
if (*r++ >= 256 || *g++ >= 256 || *b++ >= 256)
@@ -91,7 +88,7 @@ checkcmap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b)
}
static void
-compresspalette(unsigned char* out, unsigned char* data, uint32 n, uint16* rmap, uint16* gmap, uint16* bmap)
+compresspalette(unsigned char* out, unsigned char* data, uint32_t n, uint16_t* rmap, uint16_t* gmap, uint16_t* bmap)
{
register int v, red = RED, green = GREEN, blue = BLUE;
@@ -104,8 +101,8 @@ compresspalette(unsigned char* out, unsigned char* data, uint32 n, uint16* rmap,
}
}
-static uint16 compression = (uint16) -1;
-static uint16 predictor = 0;
+static uint16_t compression = (uint16_t) -1;
+static uint16_t predictor = 0;
static int jpegcolormode = JPEGCOLORMODE_RGB;
static int quality = 75; /* JPEG quality */
@@ -114,18 +111,18 @@ static void cpTags(TIFF* in, TIFF* out);
int
main(int argc, char* argv[])
{
- uint32 rowsperstrip = (uint32) -1;
+ uint32_t rowsperstrip = (uint32_t) -1;
TIFF *in, *out;
- uint32 w, h;
- uint16 samplesperpixel;
- uint16 bitspersample;
- uint16 config;
- uint16 photometric;
- uint16* red;
- uint16* green;
- uint16* blue;
+ uint32_t w, h;
+ uint16_t samplesperpixel;
+ uint16_t bitspersample;
+ uint16_t config;
+ uint16_t photometric;
+ uint16_t* red;
+ uint16_t* green;
+ uint16_t* blue;
tsize_t rowsize;
- register uint32 row;
+ register uint32_t row;
register tsample_t s;
unsigned char *inbuf, *outbuf;
char thing[1024];
@@ -160,9 +157,12 @@ main(int argc, char* argv[])
break;
case 'h':
usage(EXIT_SUCCESS);
+ /*NOTREACHED*/
+ break;
case '?':
usage(EXIT_FAILURE);
/*NOTREACHED*/
+ break;
}
if (argc - optind < 2)
usage(EXIT_FAILURE);
@@ -209,7 +209,7 @@ main(int argc, char* argv[])
TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 1);
TIFFSetField(out, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
cpTags(in, out);
- if (compression != (uint16) -1) {
+ if (compression != (uint16_t) -1) {
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
switch (compression) {
case COMPRESSION_JPEG:
@@ -376,27 +376,27 @@ processCompressOptions(char* opt)
if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4)
static void
-cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
+cpTag(TIFF* in, TIFF* out, uint16_t tag, uint16_t count, TIFFDataType type)
{
switch (type) {
case TIFF_SHORT:
if (count == 1) {
- uint16 shortv;
+ uint16_t shortv;
CopyField(tag, shortv);
} else if (count == 2) {
- uint16 shortv1, shortv2;
+ uint16_t shortv1, shortv2;
CopyField2(tag, shortv1, shortv2);
} else if (count == 4) {
- uint16 *tr, *tg, *tb, *ta;
+ uint16_t *tr, *tg, *tb, *ta;
CopyField4(tag, tr, tg, tb, ta);
- } else if (count == (uint16) -1) {
- uint16 shortv1;
- uint16* shortav;
+ } else if (count == (uint16_t) -1) {
+ uint16_t shortv1;
+ uint16_t* shortav;
CopyField2(tag, shortv1, shortav);
}
break;
case TIFF_LONG:
- { uint32 longv;
+ { uint32_t longv;
CopyField(tag, longv);
}
break;
@@ -404,7 +404,7 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
float floatv;
CopyField(tag, floatv);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
float* floatav;
CopyField(tag, floatav);
}
@@ -418,7 +418,7 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
double doublev;
CopyField(tag, doublev);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
double* doubleav;
CopyField(tag, doubleav);
}
@@ -435,9 +435,9 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
#undef CopyField2
#undef CopyField
-static struct cpTag {
- uint16 tag;
- uint16 count;
+static const struct cpTag {
+ uint16_t tag;
+ uint16_t count;
TIFFDataType type;
} tags[] = {
{ TIFFTAG_SUBFILETYPE, 1, TIFF_LONG },
@@ -449,49 +449,49 @@ static struct cpTag {
{ TIFFTAG_MINSAMPLEVALUE, 1, TIFF_SHORT },
{ TIFFTAG_MAXSAMPLEVALUE, 1, TIFF_SHORT },
{ TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL },
- { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL },
- { TIFFTAG_PAGENAME, 1, TIFF_ASCII },
- { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
- { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
- { TIFFTAG_DATETIME, 1, TIFF_ASCII },
- { TIFFTAG_ARTIST, 1, TIFF_ASCII },
- { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
- { TIFFTAG_WHITEPOINT, 2, TIFF_RATIONAL },
- { TIFFTAG_PRIMARYCHROMATICITIES,(uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
- { TIFFTAG_INKSET, 1, TIFF_SHORT },
- { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
- { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
- { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
- { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
- { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
- { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_EXTRASAMPLES, (uint16) -1, TIFF_SHORT },
- { TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE },
- { TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE },
- { TIFFTAG_STONITS, 1, TIFF_DOUBLE },
+ { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL },
+ { TIFFTAG_PAGENAME, 1, TIFF_ASCII },
+ { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
+ { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
+ { TIFFTAG_DATETIME, 1, TIFF_ASCII },
+ { TIFFTAG_ARTIST, 1, TIFF_ASCII },
+ { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
+ { TIFFTAG_WHITEPOINT, 2, TIFF_RATIONAL },
+ { TIFFTAG_PRIMARYCHROMATICITIES,(uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
+ { TIFFTAG_INKSET, 1, TIFF_SHORT },
+ { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
+ { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
+ { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
+ { TIFFTAG_YCBCRCOEFFICIENTS, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
+ { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
+ { TIFFTAG_REFERENCEBLACKWHITE, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_EXTRASAMPLES, (uint16_t) -1, TIFF_SHORT },
+ { TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE },
+ { TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE },
+ { TIFFTAG_STONITS, 1, TIFF_DOUBLE },
};
#define NTAGS (sizeof (tags) / sizeof (tags[0]))
static void
cpTags(TIFF* in, TIFF* out)
{
- struct cpTag *p;
+ const struct cpTag *p;
for (p = tags; p < &tags[NTAGS]; p++)
{
if( p->tag == TIFFTAG_GROUP3OPTIONS )
{
- uint16 compression;
+ uint16_t compression;
if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
compression != COMPRESSION_CCITTFAX3 )
continue;
}
if( p->tag == TIFFTAG_GROUP4OPTIONS )
{
- uint16 compression;
+ uint16_t compression;
if( !TIFFGetField(in, TIFFTAG_COMPRESSION, &compression) ||
compression != COMPRESSION_CCITTFAX4 )
continue;
@@ -501,37 +501,47 @@ cpTags(TIFF* in, TIFF* out)
}
#undef NTAGS
-const char* stuff[] = {
-"usage: tiff2bw [options] input.tif output.tif",
-"where options are:",
-" -R % use #% from red channel",
-" -G % use #% from green channel",
-" -B % use #% from blue channel",
-"",
-" -r # make each strip have no more than # rows",
-"",
-" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts] compress output with deflate encoding",
-" -c packbits compress output with packbits encoding",
-" -c g3[:opts] compress output with CCITT Group 3 encoding",
-" -c g4 compress output with CCITT Group 4 encoding",
-" -c none use no compression algorithm on output",
-"",
-"LZW and deflate options:",
-" # set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-NULL
-};
+static const char usage_info[] =
+"Convert a color TIFF image to greyscale\n\n"
+"usage: tiff2bw [options] input.tif output.tif\n"
+"where options are:\n"
+" -R % use #% from red channel\n"
+" -G % use #% from green channel\n"
+" -B % use #% from blue channel\n"
+"\n"
+" -r # make each strip have no more than # rows\n"
+"\n"
+#ifdef LZW_SUPPORT
+" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding\n"
+/* " LZW options:\n" */
+" # set predictor value\n"
+" For example, -c lzw:2 for LZW-encoded data with horizontal differencing\n"
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip[:opts] compress output with deflate encoding\n"
+/* " Deflate (ZIP) options:\n" */
+" # set predictor value\n"
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits compress output with packbits encoding\n"
+#endif
+#ifdef CCITT_SUPPORT
+" -c g3[:opts] compress output with CCITT Group 3 encoding\n"
+" -c g4 compress output with CCITT Group 4 encoding\n"
+#endif
+#if defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(PACKBITS_SUPPORT) || defined(CCITT_SUPPORT)
+" -c none use no compression algorithm on output\n"
+#endif
+"\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
diff --git a/tiff/tools/tiff2pdf.c b/tiff/tools/tiff2pdf.c
index acaef0d6..63751f11 100644
--- a/tiff/tools/tiff2pdf.c
+++ b/tiff/tools/tiff2pdf.c
@@ -24,8 +24,6 @@
* OF THIS SOFTWARE.
*/
-#include "tif_config.h"
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -46,16 +44,10 @@
# include <io.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffiop.h"
#include "tiffio.h"
-
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
+#include "tif_config.h"
+#include "libport.h"
#ifndef EXIT_SUCCESS
# define EXIT_SUCCESS 0
@@ -128,9 +120,9 @@ typedef enum{
/* This struct defines a logical page of a TIFF. */
typedef struct {
tdir_t page_directory;
- uint32 page_number;
+ uint32_t page_number;
ttile_t page_tilecount;
- uint32 page_extra;
+ uint32_t page_extra;
} T2P_PAGE;
/* This struct defines a PDF rectangle's coordinates. */
@@ -150,12 +142,12 @@ typedef struct {
/* This struct defines information about the tiles on a PDF page. */
typedef struct {
ttile_t tiles_tilecount;
- uint32 tiles_tilewidth;
- uint32 tiles_tilelength;
- uint32 tiles_tilecountx;
- uint32 tiles_tilecounty;
- uint32 tiles_edgetilewidth;
- uint32 tiles_edgetilelength;
+ uint32_t tiles_tilewidth;
+ uint32_t tiles_tilelength;
+ uint32_t tiles_tilecountx;
+ uint32_t tiles_tilecounty;
+ uint32_t tiles_edgetilewidth;
+ uint32_t tiles_edgetilelength;
T2P_TILE* tiles_tiles;
} T2P_TILES;
@@ -165,24 +157,24 @@ typedef struct {
T2P_PAGE* tiff_pages;
T2P_TILES* tiff_tiles;
tdir_t tiff_pagecount;
- uint16 tiff_compression;
- uint16 tiff_photometric;
- uint16 tiff_fillorder;
- uint16 tiff_bitspersample;
- uint16 tiff_samplesperpixel;
- uint16 tiff_planar;
- uint32 tiff_width;
- uint32 tiff_length;
+ uint16_t tiff_compression;
+ uint16_t tiff_photometric;
+ uint16_t tiff_fillorder;
+ uint16_t tiff_bitspersample;
+ uint16_t tiff_samplesperpixel;
+ uint16_t tiff_planar;
+ uint32_t tiff_width;
+ uint32_t tiff_length;
float tiff_xres;
float tiff_yres;
- uint16 tiff_orientation;
+ uint16_t tiff_orientation;
toff_t tiff_dataoffset;
tsize_t tiff_datasize;
tsize_t tiff_maxdatasize;
- uint16 tiff_resunit;
- uint16 pdf_centimeters;
- uint16 pdf_overrideres;
- uint16 pdf_overridepagesize;
+ uint16_t tiff_resunit;
+ uint16_t pdf_centimeters;
+ uint16_t pdf_overrideres;
+ uint16_t pdf_overridepagesize;
float pdf_defaultxres;
float pdf_defaultyres;
float pdf_xres;
@@ -196,14 +188,14 @@ typedef struct {
int pdf_image_fillpage; /* 0 (default: no scaling, 1:scale imagesize to pagesize */
T2P_BOX pdf_mediabox;
T2P_BOX pdf_imagebox;
- uint16 pdf_majorversion;
- uint16 pdf_minorversion;
- uint32 pdf_catalog;
- uint32 pdf_pages;
- uint32 pdf_info;
- uint32 pdf_palettecs;
- uint16 pdf_fitwindow;
- uint32 pdf_startxref;
+ uint16_t pdf_majorversion;
+ uint16_t pdf_minorversion;
+ uint32_t pdf_catalog;
+ uint32_t pdf_pages;
+ uint32_t pdf_info;
+ uint32_t pdf_palettecs;
+ uint16_t pdf_fitwindow;
+ uint32_t pdf_startxref;
#define TIFF2PDF_FILEID_SIZE 33
char pdf_fileid[TIFF2PDF_FILEID_SIZE];
#define TIFF2PDF_DATETIME_SIZE 17
@@ -224,35 +216,35 @@ typedef struct {
char pdf_keywords[TIFF2PDF_KEYWORDS_SIZE];
int pdf_keywords_set;
t2p_cs_t pdf_colorspace;
- uint16 pdf_colorspace_invert;
- uint16 pdf_switchdecode;
- uint16 pdf_palettesize;
+ uint16_t pdf_colorspace_invert;
+ uint16_t pdf_switchdecode;
+ uint16_t pdf_palettesize;
unsigned char* pdf_palette;
int pdf_labrange[4];
t2p_compress_t pdf_defaultcompression;
- uint16 pdf_defaultcompressionquality;
+ uint16_t pdf_defaultcompressionquality;
t2p_compress_t pdf_compression;
- uint16 pdf_compressionquality; /* for deflate : 100 * zipquality + predictor */
- uint16 pdf_nopassthrough;
+ uint16_t pdf_compressionquality; /* for deflate : 100 * zipquality + predictor */
+ uint16_t pdf_nopassthrough;
t2p_transcode_t pdf_transcode;
t2p_sample_t pdf_sample;
- uint32* pdf_xrefoffsets;
- uint32 pdf_xrefcount;
+ uint32_t* pdf_xrefoffsets;
+ uint32_t pdf_xrefcount;
tdir_t pdf_page;
#ifdef OJPEG_SUPPORT
tdata_t pdf_ojpegdata;
- uint32 pdf_ojpegdatalength;
- uint32 pdf_ojpegiflength;
+ uint32_t pdf_ojpegdatalength;
+ uint32_t pdf_ojpegiflength;
#endif
float tiff_whitechromaticities[2];
float tiff_primarychromaticities[6];
float tiff_referenceblackwhite[2];
- uint16* tiff_transferfunction[3];
+ uint16_t* tiff_transferfunction[3];
int pdf_image_interpolate; /* 0 (default) : do not interpolate,
1 : interpolate */
- uint16 tiff_transferfunctioncount;
- uint32 pdf_icccs;
- uint32 tiff_iccprofilelength;
+ uint16_t tiff_transferfunctioncount;
+ uint32_t pdf_icccs;
+ uint32_t tiff_iccprofilelength;
tdata_t tiff_iccprofile;
/* fields for custom read/write procedures */
@@ -263,7 +255,7 @@ typedef struct {
/* These functions are called by main. */
-static void tiff2pdf_usage(int);
+static void usage_info(int);
int tiff2pdf_match_paper_size(float*, float*, char*);
/* These functions are used to generate a PDF from a TIFF. */
@@ -296,25 +288,25 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P*, TIFF*, TIFF*, ttile_t);
int t2p_process_ojpeg_tables(T2P*, TIFF*);
#endif
#ifdef JPEG_SUPPORT
-int t2p_process_jpeg_strip(unsigned char*, tsize_t*, unsigned char*, tsize_t, tsize_t*, tstrip_t, uint32);
+int t2p_process_jpeg_strip(unsigned char*, tsize_t*, unsigned char*, tsize_t, tsize_t*, tstrip_t, uint32_t);
#endif
-void t2p_tile_collapse_left(tdata_t, tsize_t, uint32, uint32, uint32);
+void t2p_tile_collapse_left(tdata_t, tsize_t, uint32_t, uint32_t, uint32_t);
void t2p_write_advance_directory(T2P*, TIFF*);
tsize_t t2p_sample_planar_separate_to_contig(T2P*, unsigned char*, unsigned char*, tsize_t);
tsize_t t2p_sample_realize_palette(T2P*, unsigned char*);
-tsize_t t2p_sample_abgr_to_rgb(tdata_t, uint32);
-tsize_t t2p_sample_rgba_to_rgb(tdata_t, uint32);
-tsize_t t2p_sample_rgbaa_to_rgb(tdata_t, uint32);
-tsize_t t2p_sample_lab_signed_to_unsigned(tdata_t, uint32);
+tsize_t t2p_sample_abgr_to_rgb(tdata_t, uint32_t);
+tsize_t t2p_sample_rgba_to_rgb(tdata_t, uint32_t);
+tsize_t t2p_sample_rgbaa_to_rgb(tdata_t, uint32_t);
+tsize_t t2p_sample_lab_signed_to_unsigned(tdata_t, uint32_t);
tsize_t t2p_write_pdf_header(T2P*, TIFF*);
-tsize_t t2p_write_pdf_obj_start(uint32, TIFF*);
+tsize_t t2p_write_pdf_obj_start(uint32_t, TIFF*);
tsize_t t2p_write_pdf_obj_end(TIFF*);
tsize_t t2p_write_pdf_name(const unsigned char*, TIFF*);
tsize_t t2p_write_pdf_string(const char*, TIFF*);
tsize_t t2p_write_pdf_stream(tdata_t, tsize_t, TIFF*);
tsize_t t2p_write_pdf_stream_start(TIFF*);
tsize_t t2p_write_pdf_stream_end(TIFF*);
-tsize_t t2p_write_pdf_stream_dict(tsize_t, uint32, TIFF*);
+tsize_t t2p_write_pdf_stream_dict(tsize_t, uint32_t, TIFF*);
tsize_t t2p_write_pdf_stream_dict_start(TIFF*);
tsize_t t2p_write_pdf_stream_dict_end(TIFF*);
tsize_t t2p_write_pdf_stream_length(tsize_t, TIFF*);
@@ -323,16 +315,16 @@ tsize_t t2p_write_pdf_info(T2P*, TIFF*, TIFF*);
void t2p_pdf_currenttime(T2P*);
void t2p_pdf_tifftime(T2P*, TIFF*);
tsize_t t2p_write_pdf_pages(T2P*, TIFF*);
-tsize_t t2p_write_pdf_page(uint32, T2P*, TIFF*);
+tsize_t t2p_write_pdf_page(uint32_t, T2P*, TIFF*);
void t2p_compose_pdf_page(T2P*);
-void t2p_compose_pdf_page_orient(T2P_BOX*, uint16);
-void t2p_compose_pdf_page_orient_flip(T2P_BOX*, uint16);
+void t2p_compose_pdf_page_orient(T2P_BOX*, uint16_t);
+void t2p_compose_pdf_page_orient_flip(T2P_BOX*, uint16_t);
tsize_t t2p_write_pdf_page_content(T2P*, TIFF*);
tsize_t t2p_write_pdf_xobject_stream_dict(ttile_t, T2P*, TIFF*);
tsize_t t2p_write_pdf_xobject_cs(T2P*, TIFF*);
tsize_t t2p_write_pdf_transfer(T2P*, TIFF*);
-tsize_t t2p_write_pdf_transfer_dict(T2P*, TIFF*, uint16);
-tsize_t t2p_write_pdf_transfer_stream(T2P*, TIFF*, uint16);
+tsize_t t2p_write_pdf_transfer_dict(T2P*, TIFF*, uint16_t);
+tsize_t t2p_write_pdf_transfer_stream(T2P*, TIFF*, uint16_t);
tsize_t t2p_write_pdf_xobject_calcs(T2P*, TIFF*);
tsize_t t2p_write_pdf_xobject_icccs(T2P*, TIFF*);
tsize_t t2p_write_pdf_xobject_icccs_dict(T2P*, TIFF*);
@@ -390,7 +382,7 @@ t2pWriteFile(TIFF *tif, tdata_t data, tmsize_t size)
return -1;
}
-static uint64
+static uint64_t
t2pSeekFile(TIFF *tif, toff_t offset, int whence)
{
thandle_t client = TIFFClientdata(tif);
@@ -419,8 +411,8 @@ t2p_writeproc(thandle_t handle, tdata_t data, tmsize_t size)
return size;
}
-static uint64
-t2p_seekproc(thandle_t handle, uint64 offset, int whence)
+static uint64_t
+t2p_seekproc(thandle_t handle, uint64_t offset, int whence)
{
T2P *t2p = (T2P*) handle;
if (t2p->outputdisable <= 0 && t2p->outputfile)
@@ -435,7 +427,7 @@ t2p_closeproc(thandle_t handle)
return fclose(t2p->outputfile);
}
-static uint64
+static uint64_t
t2p_sizeproc(thandle_t handle)
{
(void) handle;
@@ -456,10 +448,10 @@ t2p_unmapproc(thandle_t handle, void *data, toff_t offset)
}
#if defined(OJPEG_SUPPORT) || defined(JPEG_SUPPORT)
-static uint64
-checkAdd64(uint64 summand1, uint64 summand2, T2P* t2p)
+static uint64_t
+checkAdd64(uint64_t summand1, uint64_t summand2, T2P* t2p)
{
- uint64 bytes = summand1 + summand2;
+ uint64_t bytes = summand1 + summand2;
if (bytes < summand1) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
@@ -471,10 +463,10 @@ checkAdd64(uint64 summand1, uint64 summand2, T2P* t2p)
}
#endif /* defined(OJPEG_SUPPORT) || defined(JPEG_SUPPORT) */
-static uint64
-checkMultiply64(uint64 first, uint64 second, T2P* t2p)
+static uint64_t
+checkMultiply64(uint64_t first, uint64_t second, T2P* t2p)
{
- uint64 bytes = first * second;
+ uint64_t bytes = first * second;
if (second && bytes / second != first) {
TIFFError(TIFF2PDF_MODULE, "Integer overflow");
@@ -557,8 +549,12 @@ checkMultiply64(uint64 first, uint64 second, T2P* t2p)
options:
-o: output to file name
+#ifdef JPEG_SUPPORT
-j: compress with JPEG (requires libjpeg configured with libtiff)
- -z: compress with Zip/Deflate (requires zlib configured with libtiff)
+#endif
+#ifdef ZIP_SUPPORT
+printf (-z: compress with Zip/Deflate (requires zlib configured with libtiff));
+#endif
-q: compression quality
-n: no compressed data passthrough
-d: do not compress (decompress)
@@ -755,10 +751,10 @@ int main(int argc, char** argv){
t2p->pdf_image_interpolate = 1;
break;
case 'h':
- tiff2pdf_usage(EXIT_SUCCESS);
+ usage_info(EXIT_SUCCESS);
goto success;
case '?':
- tiff2pdf_usage(EXIT_FAILURE);
+ usage_info(EXIT_FAILURE);
goto fail;
}
}
@@ -776,14 +772,14 @@ int main(int argc, char** argv){
}
} else {
TIFFError(TIFF2PDF_MODULE, "No input file specified");
- tiff2pdf_usage(EXIT_FAILURE);
+ usage_info(EXIT_FAILURE);
goto fail;
}
if(argc > optind) {
TIFFError(TIFF2PDF_MODULE,
"No support for multiple input files");
- tiff2pdf_usage(EXIT_FAILURE);
+ usage_info(EXIT_FAILURE);
goto fail;
}
@@ -845,48 +841,47 @@ success:
}
-static void tiff2pdf_usage(int code) {
- static const char* lines[]={
- "usage: tiff2pdf [options] input.tiff",
- "options:",
- " -o: output to file name",
+static void usage_info(int code) {
+ static const char lines[]=
+ "Convert a TIFF image to a PDF document\n\n"
+ "usage: tiff2pdf [options] input.tiff\n"
+ "where options are:\n"
+ " -o: output to file name\n"
#ifdef JPEG_SUPPORT
- " -j: compress with JPEG",
+ " -j: compress with JPEG\n"
#endif
#ifdef ZIP_SUPPORT
- " -z: compress with Zip/Deflate",
+ " -z: compress with Zip/Deflate\n"
#endif
- " -q: compression quality",
- " -n: no compressed data passthrough",
- " -d: do not compress (decompress)",
- " -i: invert colors",
- " -u: set distance unit, 'i' for inch, 'm' for centimeter",
- " -x: set x resolution default in dots per unit",
- " -y: set y resolution default in dots per unit",
- " -w: width in units",
- " -l: length in units",
- " -r: 'd' for resolution default, 'o' for resolution override",
- " -p: paper size, eg \"letter\", \"legal\", \"A4\"",
- " -F: make the tiff fill the PDF page",
- " -f: set PDF \"Fit Window\" user preference",
- " -e: date, overrides image or current date/time default, YYYYMMDDHHMMSS",
- " -c: sets document creator, overrides image software default",
- " -a: sets document author, overrides image artist default",
- " -t: sets document title, overrides image document name default",
- " -s: sets document subject, overrides image image description default",
- " -k: sets document keywords",
- " -b: set PDF \"Interpolate\" user preference",
- " -m: set memory allocation limit (in MiB). set to 0 to disable limit",
- " -h: usage",
- NULL
- };
- int i=0;
+#if defined(JPEG_SUPPORT) || defined(ZIP_SUPPORT)
+ " -q: compression quality\n"
+ " -n: no compressed data passthrough\n"
+ " -d: do not compress (decompress)\n"
+#endif
+ " -i: invert colors\n"
+ " -u: set distance unit, 'i' for inch, 'm' for centimeter\n"
+ " -x: set x resolution default in dots per unit\n"
+ " -y: set y resolution default in dots per unit\n"
+ " -w: width in units\n"
+ " -l: length in units\n"
+ " -r: 'd' for resolution default, 'o' for resolution override\n"
+ " -p: paper size, eg \"letter\", \"legal\", \"A4\"\n"
+ " -F: make the tiff fill the PDF page\n"
+ " -f: set PDF \"Fit Window\" user preference\n"
+ " -e: date, overrides image or current date/time default, YYYYMMDDHHMMSS\n"
+ " -c: sets document creator, overrides image software default\n"
+ " -a: sets document author, overrides image artist default\n"
+ " -t: sets document title, overrides image document name default\n"
+ " -s: sets document subject, overrides image image description default\n"
+ " -k: sets document keywords\n"
+ " -b: set PDF \"Interpolate\" user preference\n"
+ " -m: set memory allocation limit (in MiB). set to 0 to disable limit\n"
+ " -h: usage\n"
+ ;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i=0;lines[i]!=NULL;i++){
- fprintf(out, "%s\n", lines[i]);
- }
+ fprintf(out, "%s", lines);
return;
}
@@ -961,8 +956,8 @@ T2P* t2p_init()
if(t2p==NULL){
TIFFError(
TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_init",
- (unsigned long) sizeof(T2P));
+ "Can't allocate %"TIFF_SIZE_FORMAT" bytes of memory for t2p_init",
+ sizeof(T2P));
return( (T2P*) NULL );
}
_TIFFmemset(t2p, 0x00, sizeof(T2P));
@@ -1021,6 +1016,7 @@ void t2p_free(T2P* t2p)
*/
void t2p_validate(T2P* t2p){
+ (void) t2p;
#ifdef JPEG_SUPPORT
if(t2p->pdf_defaultcompression==T2P_COMPRESS_JPEG){
@@ -1032,7 +1028,7 @@ void t2p_validate(T2P* t2p){
#endif
#ifdef ZIP_SUPPORT
if(t2p->pdf_defaultcompression==T2P_COMPRESS_ZIP){
- uint16 m=t2p->pdf_defaultcompressionquality%100;
+ uint16_t m= t2p->pdf_defaultcompressionquality % 100;
if(t2p->pdf_defaultcompressionquality/100 > 9 ||
(m>1 && m<10) || m>15){
t2p->pdf_defaultcompressionquality=0;
@@ -1042,14 +1038,13 @@ void t2p_validate(T2P* t2p){
t2p->pdf_defaultcompressionquality*=100;
TIFFError(
TIFF2PDF_MODULE,
- "PNG Group predictor differencing not implemented, assuming compression quality %u",
+ "PNG Group predictor differencing not implemented, assuming compression quality %"PRIu16,
t2p->pdf_defaultcompressionquality);
}
t2p->pdf_defaultcompressionquality%=100;
if(t2p->pdf_minorversion<2){t2p->pdf_minorversion=2;}
}
#endif
- (void)0;
return;
}
@@ -1066,11 +1061,11 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
tdir_t directorycount=0;
tdir_t i=0;
- uint16 pagen=0;
- uint16 paged=0;
- uint16 xuint16=0;
- uint16 tiff_transferfunctioncount=0;
- uint16* tiff_transferfunction[3];
+ uint16_t pagen=0;
+ uint16_t paged=0;
+ uint16_t xuint16=0;
+ uint16_t tiff_transferfunctioncount=0;
+ uint16_t* tiff_transferfunction[3];
directorycount=TIFFNumberOfDirectories(input);
if(directorycount > TIFF_DIR_MAX) {
@@ -1085,8 +1080,8 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
if(t2p->tiff_pages==NULL){
TIFFError(
TIFF2PDF_MODULE,
- "Can't allocate " TIFF_SIZE_FORMAT " bytes of memory for tiff_pages array, %s",
- (TIFF_SIZE_T) directorycount * sizeof(T2P_PAGE),
+ "Can't allocate %"TIFF_SIZE_FORMAT" bytes of memory for tiff_pages array, %s",
+ sizeof(T2P_PAGE) * directorycount,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
@@ -1096,20 +1091,20 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
if(t2p->tiff_tiles==NULL){
TIFFError(
TIFF2PDF_MODULE,
- "Can't allocate " TIFF_SIZE_FORMAT " bytes of memory for tiff_tiles array, %s",
- (TIFF_SIZE_T) directorycount * sizeof(T2P_TILES),
+ "Can't allocate %"TIFF_SIZE_FORMAT" bytes of memory for tiff_tiles array, %s",
+ sizeof(T2P_TILES) * directorycount,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
}
_TIFFmemset( t2p->tiff_tiles, 0x00, directorycount * sizeof(T2P_TILES));
for(i=0;i<directorycount;i++){
- uint32 subfiletype = 0;
+ uint32_t subfiletype = 0;
if(!TIFFSetDirectory(input, i)){
TIFFError(
TIFF2PDF_MODULE,
- "Can't set directory %u of input file %s",
+ "Can't set directory %"PRIu16" of input file %s",
i,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1183,8 +1178,8 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
&(tiff_transferfunction[1]),
&(tiff_transferfunction[2]))) {
- if((tiff_transferfunction[1] != (uint16*) NULL) &&
- (tiff_transferfunction[2] != (uint16*) NULL)
+ if((tiff_transferfunction[1] != (uint16_t*) NULL) &&
+ (tiff_transferfunction[2] != (uint16_t*) NULL)
) {
tiff_transferfunctioncount=3;
} else {
@@ -1198,7 +1193,7 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
if (tiff_transferfunctioncount != t2p->tiff_transferfunctioncount){
TIFFError(
TIFF2PDF_MODULE,
- "Different transfer function on page %d",
+ "Different transfer function on page %"PRIu16,
i);
t2p->t2p_error = T2P_ERR_ERROR;
return;
@@ -1269,8 +1264,8 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
if( t2p->tiff_tiles[i].tiles_tiles == NULL){
TIFFError(
TIFF2PDF_MODULE,
- "Can't allocate " TIFF_SIZE_FORMAT " bytes of memory for t2p_read_tiff_init, %s",
- (TIFF_SIZE_T) t2p->tiff_tiles[i].tiles_tilecount * sizeof(T2P_TILE),
+ "Can't allocate %"TIFF_SIZE_FORMAT" bytes of memory for t2p_read_tiff_init, %s",
+ sizeof(T2P_TILE) * t2p->tiff_tiles[i].tiles_tilecount,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return;
@@ -1290,9 +1285,9 @@ void t2p_read_tiff_init(T2P* t2p, TIFF* input){
int t2p_cmp_t2p_page(const void* e1, const void* e2){
int d;
- d = (int32)(((T2P_PAGE*)e1)->page_number) - (int32)(((T2P_PAGE*)e2)->page_number);
+ d = (int32_t)(((T2P_PAGE*)e1)->page_number) - (int32_t)(((T2P_PAGE*)e2)->page_number);
if(d == 0){
- d = (int32)(((T2P_PAGE*)e1)->page_directory) - (int32)(((T2P_PAGE*)e2)->page_directory);
+ d = (int32_t)(((T2P_PAGE*)e1)->page_directory) - (int32_t)(((T2P_PAGE*)e2)->page_directory);
}
return d;
}
@@ -1312,12 +1307,12 @@ int t2p_cmp_t2p_page(const void* e1, const void* e2){
void t2p_read_tiff_data(T2P* t2p, TIFF* input){
int i=0;
- uint16* r = NULL;
- uint16* g = NULL;
- uint16* b = NULL;
- uint16* a = NULL;
- uint16 xuint16;
- uint16* xuint16p;
+ uint16_t* r = NULL;
+ uint16_t* g = NULL;
+ uint16_t* b = NULL;
+ uint16_t* a = NULL;
+ uint16_t xuint16;
+ uint16_t* xuint16p;
float* xfloatp;
t2p->pdf_transcode = T2P_TRANSCODE_ENCODE;
@@ -1359,7 +1354,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if( TIFFIsCODECConfigured(t2p->tiff_compression) == 0){
TIFFError(
TIFF2PDF_MODULE,
- "No support for %s with compression type %u: not configured",
+ "No support for %s with compression type %"PRIu16": not configured",
TIFFFileName(input),
t2p->tiff_compression
);
@@ -1385,7 +1380,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
default:
TIFFError(
TIFF2PDF_MODULE,
- "No support for %s with %u bits per sample",
+ "No support for %s with %"PRIu16" bits per sample",
TIFFFileName(input),
t2p->tiff_bitspersample);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1396,7 +1391,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if(t2p->tiff_samplesperpixel>4){
TIFFError(
TIFF2PDF_MODULE,
- "No support for %s with %u samples per pixel",
+ "No support for %s with %"PRIu16" samples per pixel",
TIFFFileName(input),
t2p->tiff_samplesperpixel);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1419,7 +1414,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
default:
TIFFError(
TIFF2PDF_MODULE,
- "No support for %s with sample format %u",
+ "No support for %s with sample format %"PRIu16,
TIFFFileName(input),
xuint16);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1476,7 +1471,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
{
TIFFError(
TIFF2PDF_MODULE,
- "No support for BitsPerSample=%d for RGBA",
+ "No support for BitsPerSample=%"PRIu16" for RGBA",
t2p->tiff_bitspersample);
t2p->t2p_error = T2P_ERR_ERROR;
return;
@@ -1489,7 +1484,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
{
TIFFError(
TIFF2PDF_MODULE,
- "No support for BitsPerSample=%d for RGBA",
+ "No support for BitsPerSample=%"PRIu16" for RGBA",
t2p->tiff_bitspersample);
t2p->t2p_error = T2P_ERR_ERROR;
return;
@@ -1513,7 +1508,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
} else {
TIFFError(
TIFF2PDF_MODULE,
- "No support for RGB image %s with %u samples per pixel",
+ "No support for RGB image %s with %"PRIu16" samples per pixel",
TIFFFileName(input),
t2p->tiff_samplesperpixel);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1522,7 +1517,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
} else {
TIFFError(
TIFF2PDF_MODULE,
- "No support for RGB image %s with %u samples per pixel",
+ "No support for RGB image %s with %"PRIu16" samples per pixel",
TIFFFileName(input),
t2p->tiff_samplesperpixel);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1564,7 +1559,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if(t2p->pdf_palette==NULL){
TIFFError(
TIFF2PDF_MODULE,
- "Can't allocate %u bytes of memory for t2p_read_tiff_image, %s",
+ "Can't allocate %"PRIu16" bytes of memory for t2p_read_tiff_image, %s",
t2p->pdf_palettesize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1598,7 +1593,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
} else {
TIFFError(
TIFF2PDF_MODULE,
- "No support for %s because it has %u samples per pixel",
+ "No support for %s because it has %"PRIu16" samples per pixel",
TIFFFileName(input),
t2p->tiff_samplesperpixel);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1640,7 +1635,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if(t2p->pdf_palette==NULL){
TIFFError(
TIFF2PDF_MODULE,
- "Can't allocate %u bytes of memory for t2p_read_tiff_image, %s",
+ "Can't allocate %"PRIu16" bytes of memory for t2p_read_tiff_image, %s",
t2p->pdf_palettesize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1672,7 +1667,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if( t2p->tiff_samplesperpixel != 3){
TIFFError(
TIFF2PDF_MODULE,
- "Unsupported samplesperpixel = %d for CIELAB",
+ "Unsupported samplesperpixel = %"PRIu16" for CIELAB",
t2p->tiff_samplesperpixel);
t2p->t2p_error = T2P_ERR_ERROR;
return;
@@ -1680,7 +1675,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if( t2p->tiff_bitspersample != 8){
TIFFError(
TIFF2PDF_MODULE,
- "Invalid bitspersample = %d for CIELAB",
+ "Invalid bitspersample = %"PRIu16" for CIELAB",
t2p->tiff_bitspersample);
t2p->t2p_error = T2P_ERR_ERROR;
return;
@@ -1703,7 +1698,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if( t2p->tiff_samplesperpixel != 3){
TIFFError(
TIFF2PDF_MODULE,
- "Unsupported samplesperpixel = %d for ITULAB",
+ "Unsupported samplesperpixel = %"PRIu16" for ITULAB",
t2p->tiff_samplesperpixel);
t2p->t2p_error = T2P_ERR_ERROR;
return;
@@ -1711,7 +1706,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if( t2p->tiff_bitspersample != 8){
TIFFError(
TIFF2PDF_MODULE,
- "Invalid bitspersample = %d for ITULAB",
+ "Invalid bitspersample = %"PRIu16" for ITULAB",
t2p->tiff_bitspersample);
t2p->t2p_error = T2P_ERR_ERROR;
return;
@@ -1734,7 +1729,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
default:
TIFFError(
TIFF2PDF_MODULE,
- "No support for %s with photometric interpretation %u",
+ "No support for %s with photometric interpretation %"PRIu16,
TIFFFileName(input),
t2p->tiff_photometric);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1756,7 +1751,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if(t2p->tiff_bitspersample!=8){
TIFFError(
TIFF2PDF_MODULE,
- "No support for %s with separated planar configuration and %u bits per sample",
+ "No support for %s with separated planar configuration and %"PRIu16" bits per sample",
TIFFFileName(input),
t2p->tiff_bitspersample);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1766,7 +1761,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
default:
TIFFError(
TIFF2PDF_MODULE,
- "No support for %s with planar configuration %u",
+ "No support for %s with planar configuration %"PRIu16,
TIFFFileName(input),
t2p->tiff_planar);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -1778,7 +1773,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
&(t2p->tiff_orientation));
if(t2p->tiff_orientation>8){
TIFFWarning(TIFF2PDF_MODULE,
- "Image %s has orientation %u, assuming 0",
+ "Image %s has orientation %"PRIu16", assuming 0",
TIFFFileName(input), t2p->tiff_orientation);
t2p->tiff_orientation=0;
}
@@ -1824,7 +1819,7 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
if(t2p->tiff_compression== COMPRESSION_ADOBE_DEFLATE
|| t2p->tiff_compression==COMPRESSION_DEFLATE){
if(TIFFIsTiled(input) || (TIFFNumberOfStrips(input)==1) ){
- uint16 predictor;
+ uint16_t predictor;
t2p->pdf_transcode = T2P_TRANSCODE_RAW;
t2p->pdf_compression=T2P_COMPRESS_ZIP;
TIFFGetField(input, TIFFTAG_PREDICTOR, &predictor);
@@ -1899,8 +1894,8 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
&(t2p->tiff_transferfunction[0]),
&(t2p->tiff_transferfunction[1]),
&(t2p->tiff_transferfunction[2]))) {
- if((t2p->tiff_transferfunction[1] != (uint16*) NULL) &&
- (t2p->tiff_transferfunction[2] != (uint16*) NULL)
+ if((t2p->tiff_transferfunction[1] != (uint16_t*) NULL) &&
+ (t2p->tiff_transferfunction[2] != (uint16_t*) NULL)
) {
t2p->tiff_transferfunctioncount=3;
} else {
@@ -1960,41 +1955,44 @@ void t2p_read_tiff_data(T2P* t2p, TIFF* input){
return;
}
-/*
+/**
+ * checks for overflow
+ */
+static void t2p_set_tiff_datasize(T2P* t2p, uint64_t k) {
+ if (k != (uint64_t)(tmsize_t)k || (tmsize_t)k < 0) {
+ TIFFError(TIFF2PDF_MODULE, "Integer overflow");
+ t2p->t2p_error = T2P_ERR_ERROR;
+ return;
+ }
+ t2p->tiff_datasize = (tmsize_t)k;
+}
+
+/**
This function returns the necessary size of a data buffer to contain the raw or
uncompressed image data from the input TIFF for a page.
*/
-
void t2p_read_tiff_size(T2P* t2p, TIFF* input){
- uint64* sbc=NULL;
-#if defined(JPEG_SUPPORT) || defined (OJPEG_SUPPORT)
+ uint64_t* sbc=NULL;
+#if defined(JPEG_SUPPORT) || defined(OJPEG_SUPPORT)
unsigned char* jpt=NULL;
tstrip_t i=0;
tstrip_t stripcount=0;
#endif
- uint64 k = 0;
+ uint64_t k = 0;
if(t2p->pdf_transcode == T2P_TRANSCODE_RAW){
-#ifdef CCITT_SUPPORT
- if(t2p->pdf_compression == T2P_COMPRESS_G4 ){
- TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
- if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {
- TIFFError(TIFF2PDF_MODULE, "Integer overflow");
- t2p->t2p_error = T2P_ERR_ERROR;
- }
- t2p->tiff_datasize=(tmsize_t)sbc[0];
- return;
- }
+#if defined(CCITT_SUPPORT) || defined(ZIP_SUPPORT)
+#if defined(CCITT_SUPPORT) && defined(ZIP_SUPPORT)
+ if(t2p->pdf_compression == T2P_COMPRESS_G4 || t2p->pdf_compression == T2P_COMPRESS_ZIP)
+#elif defined(CCITT_SUPPORT)
+ if(t2p->pdf_compression == T2P_COMPRESS_G4)
+#else
+ if(t2p->pdf_compression == T2P_COMPRESS_ZIP)
#endif
-#ifdef ZIP_SUPPORT
- if(t2p->pdf_compression == T2P_COMPRESS_ZIP){
+ {
TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc);
- if (sbc[0] != (uint64)(tmsize_t)sbc[0]) {
- TIFFError(TIFF2PDF_MODULE, "Integer overflow");
- t2p->t2p_error = T2P_ERR_ERROR;
- }
- t2p->tiff_datasize=(tmsize_t)sbc[0];
+ t2p_set_tiff_datasize(t2p, sbc[0]);
return;
}
#endif
@@ -2014,7 +2012,7 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){
if(TIFFGetField(input, TIFFTAG_JPEGIFOFFSET, &(t2p->tiff_dataoffset))){
if(t2p->tiff_dataoffset != 0){
if(TIFFGetField(input, TIFFTAG_JPEGIFBYTECOUNT, &(t2p->tiff_datasize))!=0){
- if((uint64)t2p->tiff_datasize < k) {
+ if((uint64_t)t2p->tiff_datasize < k) {
TIFFWarning(TIFF2PDF_MODULE,
"Input file %s has short JPEG interchange file byte count",
TIFFFileName(input));
@@ -2023,11 +2021,7 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){
k = checkAdd64(k, 6, t2p);
k = checkAdd64(k, stripcount, t2p);
k = checkAdd64(k, stripcount, t2p);
- t2p->tiff_datasize = (tsize_t) k;
- if ((uint64) t2p->tiff_datasize != k) {
- TIFFError(TIFF2PDF_MODULE, "Integer overflow");
- t2p->t2p_error = T2P_ERR_ERROR;
- }
+ t2p_set_tiff_datasize(t2p, k);
return;
}
return;
@@ -2043,17 +2037,13 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){
k = checkAdd64(k, stripcount, t2p);
k = checkAdd64(k, stripcount, t2p);
k = checkAdd64(k, 2048, t2p);
- t2p->tiff_datasize = (tsize_t) k;
- if ((uint64) t2p->tiff_datasize != k) {
- TIFFError(TIFF2PDF_MODULE, "Integer overflow");
- t2p->t2p_error = T2P_ERR_ERROR;
- }
+ t2p_set_tiff_datasize(t2p, k);
return;
}
#endif
#ifdef JPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_JPEG) {
- uint32 count = 0;
+ uint32_t count = 0;
if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt) != 0 ){
if(count > 4){
k += count;
@@ -2077,11 +2067,7 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){
}
k = checkAdd64(k, 2, t2p); /* use EOI of last strip */
k = checkAdd64(k, 6, t2p); /* for DRI marker of first strip */
- t2p->tiff_datasize = (tsize_t) k;
- if ((uint64) t2p->tiff_datasize != k) {
- TIFFError(TIFF2PDF_MODULE, "Integer overflow");
- t2p->t2p_error = T2P_ERR_ERROR;
- }
+ t2p_set_tiff_datasize(t2p, k);
return;
}
#endif
@@ -2104,11 +2090,7 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){
t2p->t2p_error = T2P_ERR_ERROR;
}
- t2p->tiff_datasize = (tsize_t) k;
- if ((uint64) t2p->tiff_datasize != k) {
- TIFFError(TIFF2PDF_MODULE, "Integer overflow");
- t2p->t2p_error = T2P_ERR_ERROR;
- }
+ t2p_set_tiff_datasize(t2p, k);
return;
}
@@ -2120,12 +2102,12 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){
void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
- uint64* tbc = NULL;
- uint16 edge=0;
+ uint64_t* tbc = NULL;
+ uint16_t edge=0;
#ifdef JPEG_SUPPORT
unsigned char* jpt;
#endif
- uint64 k;
+ uint64_t k;
edge |= t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
edge |= t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile);
@@ -2152,7 +2134,7 @@ void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
#endif
#ifdef JPEG_SUPPORT
if(t2p->tiff_compression==COMPRESSION_JPEG) {
- uint32 count = 0;
+ uint32_t count = 0;
if(TIFFGetField(input, TIFFTAG_JPEGTABLES, &count, &jpt)!=0){
if(count > 4){
k = checkAdd64(k, count, t2p);
@@ -2161,11 +2143,7 @@ void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
}
}
#endif
- t2p->tiff_datasize = (tsize_t) k;
- if ((uint64) t2p->tiff_datasize != k) {
- TIFFError(TIFF2PDF_MODULE, "Integer overflow");
- t2p->t2p_error = T2P_ERR_ERROR;
- }
+ t2p_set_tiff_datasize(t2p, k);
return;
}
}
@@ -2178,11 +2156,7 @@ void t2p_read_tiff_size_tile(T2P* t2p, TIFF* input, ttile_t tile){
t2p->t2p_error = T2P_ERR_ERROR;
}
- t2p->tiff_datasize = (tsize_t) k;
- if ((uint64) t2p->tiff_datasize != k) {
- TIFFError(TIFF2PDF_MODULE, "Integer overflow");
- t2p->t2p_error = T2P_ERR_ERROR;
- }
+ t2p_set_tiff_datasize(t2p, k);
return;
}
@@ -2263,18 +2237,18 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
tsize_t sepstripsize=0;
#ifdef OJPEG_SUPPORT
toff_t inputoffset=0;
- uint16 h_samp=1;
- uint16 v_samp=1;
- uint16 ri=1;
- uint32 rows=0;
+ uint16_t h_samp=1;
+ uint16_t v_samp=1;
+ uint16_t ri=1;
+ uint32_t rows=0;
#endif /* ifdef OJPEG_SUPPORT */
#ifdef JPEG_SUPPORT
unsigned char* jpt;
float* xfloatp;
- uint64* sbc;
+ uint64_t* sbc;
unsigned char* stripbuffer;
tsize_t striplength=0;
- uint32 max_striplength=0;
+ uint32_t max_striplength=0;
#endif /* ifdef JPEG_SUPPORT */
/* Fail if prior error (in particular, can't trust tiff_datasize) */
@@ -2288,9 +2262,9 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
_TIFFmalloc(t2p->tiff_datasize);
if (buffer == NULL) {
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for "
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for "
"t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2323,8 +2297,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
_TIFFmalloc(t2p->tiff_datasize);
if(buffer == NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2355,8 +2329,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
_TIFFmalloc(t2p->tiff_datasize);
if(buffer == NULL) {
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2431,8 +2405,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
_TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2482,13 +2456,13 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
#endif /* ifdef OJPEG_SUPPORT */
#ifdef JPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_JPEG) {
- uint32 count = 0;
+ uint32_t count = 0;
buffer = (unsigned char*)
_TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2509,7 +2483,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
_TIFFmalloc(max_striplength);
if(stripbuffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %u bytes of memory for t2p_readwrite_pdf_image, %s",
+ "Can't allocate %"PRId32" bytes of memory for t2p_readwrite_pdf_image, %s",
max_striplength,
TIFFFileName(input));
_TIFFfree(buffer);
@@ -2557,8 +2531,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2574,7 +2548,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
TIFFmin(stripsize, t2p->tiff_datasize - bufferoffset));
if(read==-1){
TIFFError(TIFF2PDF_MODULE,
- "Error on decoding strip %u of %s",
+ "Error on decoding strip %"PRIu32" of %s",
i,
TIFFFileName(input));
_TIFFfree(buffer);
@@ -2595,8 +2569,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2605,8 +2579,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
samplebuffer = (unsigned char*) _TIFFmalloc(stripsize);
if(samplebuffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
_TIFFfree(buffer);
@@ -2622,7 +2596,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
TIFFmin(sepstripsize, stripsize - samplebufferoffset));
if(read==-1){
TIFFError(TIFF2PDF_MODULE,
- "Error on decoding strip %u of %s",
+ "Error on decoding strip %"PRIu32" of %s",
i + j*stripcount,
TIFFFileName(input));
_TIFFfree(buffer);
@@ -2645,8 +2619,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2662,7 +2636,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
TIFFmin(stripsize, t2p->tiff_datasize - bufferoffset));
if(read==-1){
TIFFError(TIFF2PDF_MODULE,
- "Error on decoding strip %u of %s",
+ "Error on decoding strip %"PRIu32" of %s",
i,
TIFFFileName(input));
_TIFFfree(samplebuffer);
@@ -2680,8 +2654,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
t2p->tiff_datasize * t2p->tiff_samplesperpixel);
if(samplebuffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
_TIFFfree(buffer);
@@ -2711,8 +2685,8 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
t2p->tiff_width*t2p->tiff_length*4);
if(samplebuffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for t2p_readwrite_pdf_image, %s",
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
_TIFFfree(buffer);
@@ -2724,7 +2698,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
input,
t2p->tiff_width,
t2p->tiff_length,
- (uint32*)buffer,
+ (uint32_t*)buffer,
ORIENTATION_TOPLEFT,
0)){
TIFFError(TIFF2PDF_MODULE,
@@ -2770,7 +2744,7 @@ dataready:
#ifdef JPEG_SUPPORT
case T2P_COMPRESS_JPEG:
if(t2p->tiff_photometric==PHOTOMETRIC_YCBCR) {
- uint16 hor = 0, ver = 0;
+ uint16_t hor = 0, ver = 0;
if (TIFFGetField(input, TIFFTAG_YCBCRSUBSAMPLING, &hor, &ver) !=0 ) {
if(hor != 0 && ver != 0){
TIFFSetField(output, TIFFTAG_YCBCRSUBSAMPLING, hor, ver);
@@ -2872,14 +2846,14 @@ dataready:
tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_t tile){
- uint16 edge=0;
+ uint16_t edge=0;
tsize_t written=0;
unsigned char* buffer=NULL;
tsize_t bufferoffset=0;
unsigned char* samplebuffer=NULL;
tsize_t samplebufferoffset=0;
tsize_t read=0;
- uint16 i=0;
+ uint16_t i=0;
ttile_t tilecount=0;
/* tsize_t tilesize=0; */
ttile_t septilecount=0;
@@ -2887,7 +2861,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
#ifdef JPEG_SUPPORT
unsigned char* jpt;
float* xfloatp;
- uint32 xuint32=0;
+ uint32_t xuint32=0;
#endif
/* Fail if prior error (in particular, can't trust tiff_datasize) */
@@ -2908,9 +2882,9 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory "
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory "
"for t2p_readwrite_pdf_image_tile, %s",
- (unsigned long) t2p->tiff_datasize,
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2936,9 +2910,9 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory "
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory "
"for t2p_readwrite_pdf_image_tile, %s",
- (unsigned long) t2p->tiff_datasize,
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -2973,9 +2947,9 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
buffer=(unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory "
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory "
"for t2p_readwrite_pdf_image, %s",
- (unsigned long) t2p->tiff_datasize,
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -3017,13 +2991,13 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
#ifdef JPEG_SUPPORT
if(t2p->tiff_compression == COMPRESSION_JPEG){
unsigned char table_end[2];
- uint32 count = 0;
+ uint32_t count = 0;
buffer= (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate " TIFF_SIZE_FORMAT " bytes of memory "
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory "
"for t2p_readwrite_pdf_image_tile, %s",
- (TIFF_SIZE_T) t2p->tiff_datasize,
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -3070,9 +3044,9 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory for "
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory for "
"t2p_readwrite_pdf_image_tile, %s",
- (unsigned long) t2p->tiff_datasize,
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -3086,7 +3060,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
t2p->tiff_datasize);
if(read==-1){
TIFFError(TIFF2PDF_MODULE,
- "Error on decoding tile %u of %s",
+ "Error on decoding tile %"PRIu32" of %s",
tile,
TIFFFileName(input));
_TIFFfree(buffer);
@@ -3104,9 +3078,9 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory "
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory "
"for t2p_readwrite_pdf_image_tile, %s",
- (unsigned long) t2p->tiff_datasize,
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -3115,9 +3089,9 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
samplebuffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(samplebuffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory "
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory "
"for t2p_readwrite_pdf_image_tile, %s",
- (unsigned long) t2p->tiff_datasize,
+ t2p->tiff_datasize,
TIFFFileName(input));
_TIFFfree(buffer);
t2p->t2p_error = T2P_ERR_ERROR;
@@ -3133,7 +3107,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
septilesize);
if(read==-1){
TIFFError(TIFF2PDF_MODULE,
- "Error on decoding tile %u of %s",
+ "Error on decoding tile %"PRIu32" of %s",
tile + i*tilecount,
TIFFFileName(input));
_TIFFfree(samplebuffer);
@@ -3156,9 +3130,9 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
buffer = (unsigned char*) _TIFFmalloc(t2p->tiff_datasize);
if(buffer==NULL){
TIFFError(TIFF2PDF_MODULE,
- "Can't allocate %lu bytes of memory "
+ "Can't allocate %"TIFF_SSIZE_FORMAT" bytes of memory "
"for t2p_readwrite_pdf_image_tile, %s",
- (unsigned long) t2p->tiff_datasize,
+ t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -3171,7 +3145,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
t2p->tiff_datasize);
if(read==-1){
TIFFError(TIFF2PDF_MODULE,
- "Error on decoding tile %u of %s",
+ "Error on decoding tile %"PRIu32" of %s",
tile,
TIFFFileName(input));
_TIFFfree(buffer);
@@ -3212,7 +3186,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
}
if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile) != 0){
- if ((uint64)t2p->tiff_datasize < (uint64)TIFFTileRowSize(input) * (uint64)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength) {
+ if ((uint64_t)t2p->tiff_datasize < (uint64_t)TIFFTileRowSize(input) * (uint64_t)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength) {
/* we don't know how to handle PLANARCONFIG_CONTIG, PHOTOMETRIC_YCBCR with 3 samples per pixel */
TIFFWarning(
TIFF2PDF_MODULE,
@@ -3277,7 +3251,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
#ifdef JPEG_SUPPORT
case T2P_COMPRESS_JPEG:
if (t2p->tiff_photometric==PHOTOMETRIC_YCBCR) {
- uint16 hor = 0, ver = 0;
+ uint16_t hor = 0, ver = 0;
if (TIFFGetField(input, TIFFTAG_YCBCRSUBSAMPLING, &hor, &ver)!=0) {
if (hor != 0 && ver != 0) {
TIFFSetField(output, TIFFTAG_YCBCRSUBSAMPLING, hor, ver);
@@ -3331,8 +3305,8 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
if (TIFFStripSize(output) > t2p->tiff_datasize) {
TIFFError(TIFF2PDF_MODULE,
- "Size mismatch input %ld, output %ld",
- t2p->tiff_datasize, TIFFStripSize(output));
+ "Size mismatch input %" PRId64 ", output %" PRId64,
+ (int64_t) t2p->tiff_datasize, (int64_t) TIFFStripSize(output));
_TIFFfree(buffer);
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -3360,26 +3334,26 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
#ifdef OJPEG_SUPPORT
int t2p_process_ojpeg_tables(T2P* t2p, TIFF* input){
- uint16 proc=0;
+ uint16_t proc=0;
void* q;
- uint32 q_length=0;
+ uint32_t q_length=0;
void* dc;
- uint32 dc_length=0;
+ uint32_t dc_length=0;
void* ac;
- uint32 ac_length=0;
- uint16* lp;
- uint16* pt;
- uint16 h_samp=1;
- uint16 v_samp=1;
+ uint32_t ac_length=0;
+ uint16_t* lp;
+ uint16_t* pt;
+ uint16_t h_samp=1;
+ uint16_t v_samp=1;
unsigned char* ojpegdata;
- uint16 table_count;
- uint32 offset_table;
- uint32 offset_ms_l;
- uint32 code_count;
- uint32 i=0;
- uint32 dest=0;
- uint16 ri=0;
- uint32 rows=0;
+ uint16_t table_count;
+ uint32_t offset_table;
+ uint32_t offset_ms_l;
+ uint32_t code_count;
+ uint32_t i=0;
+ uint32_t dest=0;
+ uint16_t ri=0;
+ uint32_t rows=0;
if(!TIFFGetField(input, TIFFTAG_JPEGPROC, &proc)){
TIFFError(TIFF2PDF_MODULE,
@@ -3452,7 +3426,7 @@ int t2p_process_ojpeg_tables(T2P* t2p, TIFF* input){
if(t2p->pdf_ojpegdata == NULL){
TIFFError(TIFF2PDF_MODULE,
"Can't allocate %u bytes of memory for t2p_process_ojpeg_tables, %s",
- 2048,
+ 2048u,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
@@ -3605,21 +3579,21 @@ int t2p_process_ojpeg_tables(T2P* t2p, TIFF* input){
#ifdef JPEG_SUPPORT
int t2p_process_jpeg_strip(
- unsigned char* strip,
- tsize_t* striplength,
- unsigned char* buffer,
- tsize_t buffersize,
- tsize_t* bufferoffset,
- tstrip_t no,
- uint32 height){
+ unsigned char* strip,
+ tsize_t* striplength,
+ unsigned char* buffer,
+ tsize_t buffersize,
+ tsize_t* bufferoffset,
+ tstrip_t no,
+ uint32_t height){
tsize_t i=0;
while (i < *striplength) {
tsize_t datalen;
- uint16 ri;
- uint16 v_samp;
- uint16 h_samp;
+ uint16_t ri;
+ uint16_t v_samp;
+ uint16_t h_samp;
int j;
int ncomp;
@@ -3667,7 +3641,7 @@ int t2p_process_jpeg_strip(
if( *bufferoffset + 11 + 3*(ncomp-1) >= buffersize )
return(0);
for(j=0;j<ncomp;j++){
- uint16 samp = buffer[*bufferoffset+11+(3*j)];
+ uint16_t samp = buffer[*bufferoffset + 11 + (3 * j)];
if( (samp>>4) > h_samp)
h_samp = (samp>>4);
if( (samp & 0x0f) > v_samp)
@@ -3675,12 +3649,12 @@ int t2p_process_jpeg_strip(
}
v_samp*=8;
h_samp*=8;
- ri=((( ((uint16)(buffer[*bufferoffset+5])<<8) |
- (uint16)(buffer[*bufferoffset+6]) )+v_samp-1)/
- v_samp);
- ri*=((( ((uint16)(buffer[*bufferoffset+7])<<8) |
- (uint16)(buffer[*bufferoffset+8]) )+h_samp-1)/
- h_samp);
+ ri=(((((uint16_t)(buffer[*bufferoffset + 5]) << 8) |
+ (uint16_t)(buffer[*bufferoffset + 6]) ) + v_samp - 1) /
+ v_samp);
+ ri*=(((((uint16_t)(buffer[*bufferoffset + 7]) << 8) |
+ (uint16_t)(buffer[*bufferoffset + 8]) ) + h_samp - 1) /
+ h_samp);
buffer[*bufferoffset+5]=
(unsigned char) ((height>>8) & 0xff);
buffer[*bufferoffset+6]=
@@ -3739,13 +3713,13 @@ int t2p_process_jpeg_strip(
tilelength buffer of samples.
*/
void t2p_tile_collapse_left(
- tdata_t buffer,
- tsize_t scanwidth,
- uint32 tilewidth,
- uint32 edgetilewidth,
- uint32 tilelength){
+ tdata_t buffer,
+ tsize_t scanwidth,
+ uint32_t tilewidth,
+ uint32_t edgetilewidth,
+ uint32_t tilelength){
- uint32 i;
+ uint32_t i;
tsize_t edgescanwidth=0;
edgescanwidth = (scanwidth * edgetilewidth + (tilewidth - 1))/ tilewidth;
@@ -3804,12 +3778,12 @@ tsize_t t2p_sample_planar_separate_to_contig(
tsize_t t2p_sample_realize_palette(T2P* t2p, unsigned char* buffer){
- uint32 sample_count=0;
- uint16 component_count=0;
- uint32 palette_offset=0;
- uint32 sample_offset=0;
- uint32 i=0;
- uint32 j=0;
+ uint32_t sample_count=0;
+ uint16_t component_count=0;
+ uint32_t palette_offset=0;
+ uint32_t sample_offset=0;
+ uint32_t i=0;
+ uint32_t j=0;
size_t data_size;
sample_count=t2p->tiff_width*t2p->tiff_length;
component_count=t2p->tiff_samplesperpixel;
@@ -3844,13 +3818,13 @@ tsize_t t2p_sample_realize_palette(T2P* t2p, unsigned char* buffer){
into RGB interleaved data, discarding A.
*/
-tsize_t t2p_sample_abgr_to_rgb(tdata_t data, uint32 samplecount)
+tsize_t t2p_sample_abgr_to_rgb(tdata_t data, uint32_t samplecount)
{
- uint32 i=0;
- uint32 sample=0;
+ uint32_t i=0;
+ uint32_t sample=0;
for(i=0;i<samplecount;i++){
- sample=((uint32*)data)[i];
+ sample=((uint32_t*)data)[i];
((char*)data)[i*3]= (char) (sample & 0xff);
((char*)data)[i*3+1]= (char) ((sample>>8) & 0xff);
((char*)data)[i*3+2]= (char) ((sample>>16) & 0xff);
@@ -3865,18 +3839,18 @@ tsize_t t2p_sample_abgr_to_rgb(tdata_t data, uint32 samplecount)
*/
tsize_t
-t2p_sample_rgbaa_to_rgb(tdata_t data, uint32 samplecount)
+t2p_sample_rgbaa_to_rgb(tdata_t data, uint32_t samplecount)
{
- uint32 i;
+ uint32_t i;
/* For the 3 first samples, there is overlap between source and
* destination, so use memmove().
* See http://bugzilla.maptools.org/show_bug.cgi?id=2577
*/
for(i = 0; i < 3 && i < samplecount; i++)
- memmove((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
+ memmove((uint8_t*)data + i * 3, (uint8_t*)data + i * 4, 3);
for(; i < samplecount; i++)
- memcpy((uint8*)data + i * 3, (uint8*)data + i * 4, 3);
+ memcpy((uint8_t*)data + i * 3, (uint8_t*)data + i * 4, 3);
return(i * 3);
}
@@ -3887,18 +3861,18 @@ t2p_sample_rgbaa_to_rgb(tdata_t data, uint32 samplecount)
*/
tsize_t
-t2p_sample_rgba_to_rgb(tdata_t data, uint32 samplecount)
+t2p_sample_rgba_to_rgb(tdata_t data, uint32_t samplecount)
{
- uint32 i = 0;
- uint32 sample = 0;
- uint8 alpha = 0;
+ uint32_t i = 0;
+ uint32_t sample = 0;
+ uint8_t alpha = 0;
for (i = 0; i < samplecount; i++) {
- sample=((uint32*)data)[i];
- alpha=(uint8)((255 - ((sample >> 24) & 0xff)));
- ((uint8 *)data)[i * 3] = (uint8) ((sample >> 16) & 0xff) + alpha;
- ((uint8 *)data)[i * 3 + 1] = (uint8) ((sample >> 8) & 0xff) + alpha;
- ((uint8 *)data)[i * 3 + 2] = (uint8) (sample & 0xff) + alpha;
+ sample=((uint32_t*)data)[i];
+ alpha=(uint8_t)((255 - ((sample >> 24) & 0xff)));
+ ((uint8_t *)data)[i * 3] = (uint8_t) ((sample >> 16) & 0xff) + alpha;
+ ((uint8_t *)data)[i * 3 + 1] = (uint8_t) ((sample >> 8) & 0xff) + alpha;
+ ((uint8_t *)data)[i * 3 + 2] = (uint8_t) (sample & 0xff) + alpha;
}
return (i * 3);
@@ -3909,9 +3883,9 @@ t2p_sample_rgba_to_rgb(tdata_t data, uint32 samplecount)
to unsigned.
*/
-tsize_t t2p_sample_lab_signed_to_unsigned(tdata_t buffer, uint32 samplecount){
+tsize_t t2p_sample_lab_signed_to_unsigned(tdata_t buffer, uint32_t samplecount){
- uint32 i=0;
+ uint32_t i=0;
for(i=0;i<samplecount;i++){
if( (((unsigned char*)buffer)[(i*3)+1] & 0x80) !=0){
@@ -3941,9 +3915,9 @@ tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
char buffer[16];
int buflen=0;
- buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%u.%u ",
- t2p->pdf_majorversion&0xff,
- t2p->pdf_minorversion&0xff);
+ buflen = snprintf(buffer, sizeof(buffer), "%%PDF-%"PRIu16".%"PRIu16" ",
+ (uint16_t) (t2p->pdf_majorversion&0xff),
+ (uint16_t) (t2p->pdf_minorversion&0xff));
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t)"\n%\342\343\317\323\n", 7);
@@ -3955,13 +3929,13 @@ tsize_t t2p_write_pdf_header(T2P* t2p, TIFF* output){
This function writes the beginning of a PDF object to output.
*/
-tsize_t t2p_write_pdf_obj_start(uint32 number, TIFF* output){
+tsize_t t2p_write_pdf_obj_start(uint32_t number, TIFF* output){
tsize_t written=0;
char buffer[32];
int buflen=0;
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, number);
check_snprintf_ret((T2P*)NULL, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen );
written += t2pWriteFile(output, (tdata_t) " 0 obj\n", 7);
@@ -3989,9 +3963,9 @@ tsize_t t2p_write_pdf_obj_end(TIFF* output){
tsize_t t2p_write_pdf_name(const unsigned char* name, TIFF* output){
tsize_t written=0;
- uint32 i=0;
+ uint32_t i=0;
char buffer[64];
- uint16 nextchar=0;
+ uint16_t nextchar=0;
size_t namelen=0;
namelen = strlen((char *)name);
@@ -4087,7 +4061,7 @@ tsize_t t2p_write_pdf_name(const unsigned char* name, TIFF* output){
tsize_t t2p_write_pdf_string(const char* pdfstr, TIFF* output)
{
tsize_t written = 0;
- uint32 i = 0;
+ uint32_t i = 0;
char buffer[64];
size_t len = 0;
@@ -4177,7 +4151,7 @@ tsize_t t2p_write_pdf_stream_end(TIFF* output){
This function writes a stream dictionary for a PDF stream to output.
*/
-tsize_t t2p_write_pdf_stream_dict(tsize_t len, uint32 number, TIFF* output){
+tsize_t t2p_write_pdf_stream_dict(tsize_t len, uint32_t number, TIFF* output){
tsize_t written=0;
char buffer[32];
@@ -4187,7 +4161,7 @@ tsize_t t2p_write_pdf_stream_dict(tsize_t len, uint32 number, TIFF* output){
if(len!=0){
written += t2p_write_pdf_stream_length(len, output);
} else {
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)number);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, number);
check_snprintf_ret((T2P*)NULL, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
@@ -4232,7 +4206,7 @@ tsize_t t2p_write_pdf_stream_length(tsize_t len, TIFF* output){
char buffer[32];
int buflen=0;
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)len);
+ buflen=snprintf(buffer, sizeof(buffer), "%"TIFF_SSIZE_FORMAT, len);
check_snprintf_ret((T2P*)NULL, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "\n", 1);
@@ -4253,7 +4227,7 @@ tsize_t t2p_write_pdf_catalog(T2P* t2p, TIFF* output)
written += t2pWriteFile(output,
(tdata_t)"<< \n/Type /Catalog \n/Pages ",
27);
- buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
+ buflen = snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->pdf_pages);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer,
TIFFmin((size_t)buflen, sizeof(buffer) - 1));
@@ -4442,7 +4416,7 @@ tsize_t t2p_write_pdf_pages(T2P* t2p, TIFF* output)
}
}
written += t2pWriteFile(output, (tdata_t) "] \n/Count ", 10);
- buflen=snprintf(buffer, sizeof(buffer), "%d", t2p->tiff_pagecount);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu16, t2p->tiff_pagecount);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " \n>> \n", 6);
@@ -4454,7 +4428,7 @@ tsize_t t2p_write_pdf_pages(T2P* t2p, TIFF* output)
This function writes a PDF Page structure to output.
*/
-tsize_t t2p_write_pdf_page(uint32 object, T2P* t2p, TIFF* output){
+tsize_t t2p_write_pdf_page(uint32_t object, T2P* t2p, TIFF* output){
unsigned int i=0;
tsize_t written=0;
@@ -4462,7 +4436,7 @@ tsize_t t2p_write_pdf_page(uint32 object, T2P* t2p, TIFF* output){
int buflen=0;
written += t2pWriteFile(output, (tdata_t) "<<\n/Type /Page \n/Parent ", 24);
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_pages);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->pdf_pages);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
@@ -4484,7 +4458,7 @@ tsize_t t2p_write_pdf_page(uint32 object, T2P* t2p, TIFF* output){
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "] \n", 3);
written += t2pWriteFile(output, (tdata_t) "/Contents ", 10);
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(object + 1));
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, object + 1u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R \n", 6);
@@ -4493,16 +4467,16 @@ tsize_t t2p_write_pdf_page(uint32 object, T2P* t2p, TIFF* output){
written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12);
for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount;i++){
written += t2pWriteFile(output, (tdata_t) "/Im", 3);
- buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
+ buflen = snprintf(buffer, sizeof(buffer), "%"PRIu16, (uint16_t)(t2p->pdf_page+1u));
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "_", 1);
- buflen = snprintf(buffer, sizeof(buffer), "%u", i+1);
+ buflen = snprintf(buffer, sizeof(buffer), "%u", i+1u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " ", 1);
- buflen = snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra));
+ buflen = snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ object+3u+(2u*i)+t2p->tiff_pages[t2p->pdf_page].page_extra);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
@@ -4514,12 +4488,12 @@ tsize_t t2p_write_pdf_page(uint32 object, T2P* t2p, TIFF* output){
} else {
written += t2pWriteFile(output, (tdata_t) "/XObject <<\n", 12);
written += t2pWriteFile(output, (tdata_t) "/Im", 3);
- buflen = snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
+ buflen = snprintf(buffer, sizeof(buffer), "%"PRIu16, (uint16_t)(t2p->pdf_page+1u));
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " ", 1);
- buflen = snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)(object+3+(2*i)+t2p->tiff_pages[t2p->pdf_page].page_extra));
+ buflen = snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ object+3u+(2u*i)+t2p->tiff_pages[t2p->pdf_page].page_extra);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
@@ -4528,8 +4502,8 @@ tsize_t t2p_write_pdf_page(uint32 object, T2P* t2p, TIFF* output){
if(t2p->tiff_transferfunctioncount != 0) {
written += t2pWriteFile(output, (tdata_t) "/ExtGState <<", 13);
t2pWriteFile(output, (tdata_t) "/GS1 ", 5);
- buflen = snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)(object + 3));
+ buflen = snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ object + 3u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
@@ -4557,14 +4531,14 @@ tsize_t t2p_write_pdf_page(uint32 object, T2P* t2p, TIFF* output){
void t2p_compose_pdf_page(T2P* t2p){
- uint32 i=0;
- uint32 i2=0;
+ uint32_t i=0;
+ uint32_t i2=0;
T2P_TILE* tiles=NULL;
T2P_BOX* boxp=NULL;
- uint32 tilecountx=0;
- uint32 tilecounty=0;
- uint32 tilewidth=0;
- uint32 tilelength=0;
+ uint32_t tilecountx=0;
+ uint32_t tilecounty=0;
+ uint32_t tilewidth=0;
+ uint32_t tilelength=0;
int istiled=0;
float f=0;
float width_ratio=0;
@@ -4763,7 +4737,7 @@ void t2p_compose_pdf_page(T2P* t2p){
return;
}
-void t2p_compose_pdf_page_orient(T2P_BOX* boxp, uint16 orientation){
+void t2p_compose_pdf_page_orient(T2P_BOX* boxp, uint16_t orientation){
float m1[9];
float f=0.0;
@@ -4838,7 +4812,7 @@ void t2p_compose_pdf_page_orient(T2P_BOX* boxp, uint16 orientation){
return;
}
-void t2p_compose_pdf_page_orient_flip(T2P_BOX* boxp, uint16 orientation){
+void t2p_compose_pdf_page_orient_flip(T2P_BOX* boxp, uint16_t orientation){
float m1[9];
float f=0.0;
@@ -4912,7 +4886,7 @@ tsize_t t2p_write_pdf_page_content_stream(T2P* t2p, TIFF* output){
for(i=0;i<t2p->tiff_tiles[t2p->pdf_page].tiles_tilecount; i++){
box=t2p->tiff_tiles[t2p->pdf_page].tiles_tiles[i].tile_box;
buflen=snprintf(buffer, sizeof(buffer),
- "q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d_%ld Do Q\n",
+ "q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%"PRIu16"_%"PRIu32" Do Q\n",
t2p->tiff_transferfunctioncount?"/GS1 gs ":"",
box.mat[0],
box.mat[1],
@@ -4920,15 +4894,15 @@ tsize_t t2p_write_pdf_page_content_stream(T2P* t2p, TIFF* output){
box.mat[4],
box.mat[6],
box.mat[7],
- t2p->pdf_page + 1,
- (long)(i + 1));
+ (uint16_t)(t2p->pdf_page + 1u),
+ i + 1u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2p_write_pdf_stream(buffer, buflen, output);
}
} else {
box=t2p->pdf_imagebox;
buflen=snprintf(buffer, sizeof(buffer),
- "q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%d Do Q\n",
+ "q %s %.4f %.4f %.4f %.4f %.4f %.4f cm /Im%"PRIu16" Do Q\n",
t2p->tiff_transferfunctioncount?"/GS1 gs ":"",
box.mat[0],
box.mat[1],
@@ -4936,7 +4910,7 @@ tsize_t t2p_write_pdf_page_content_stream(T2P* t2p, TIFF* output){
box.mat[4],
box.mat[6],
box.mat[7],
- t2p->pdf_page+1);
+ (uint16_t)(t2p->pdf_page+1u));
check_snprintf_ret(t2p, buflen, buffer);
written += t2p_write_pdf_stream(buffer, buflen, output);
}
@@ -4960,45 +4934,45 @@ tsize_t t2p_write_pdf_xobject_stream_dict(ttile_t tile,
written += t2pWriteFile(output,
(tdata_t) "/Type /XObject \n/Subtype /Image \n/Name /Im",
42);
- buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_page+1);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu16, (uint16_t)(t2p->pdf_page+1u));
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
if(tile != 0){
written += t2pWriteFile(output, (tdata_t) "_", 1);
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)tile);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, tile);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
}
written += t2pWriteFile(output, (tdata_t) "\n/Width ", 8);
if(tile==0){
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_width);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->tiff_width);
} else {
if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
} else {
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
}
}
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "\n/Height ", 9);
if(tile==0){
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->tiff_length);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->tiff_length);
} else {
if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)!=0){
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
} else {
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
}
}
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "\n/BitsPerComponent ", 19);
- buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu16, t2p->tiff_bitspersample);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "\n/ColorSpace ", 13);
@@ -5053,11 +5027,11 @@ tsize_t t2p_write_pdf_xobject_cs(T2P* t2p, TIFF* output){
t2p->pdf_colorspace ^= T2P_CS_PALETTE;
written += t2p_write_pdf_xobject_cs(t2p, output);
t2p->pdf_colorspace |= T2P_CS_PALETTE;
- buflen=snprintf(buffer, sizeof(buffer), "%u", (0x0001 << t2p->tiff_bitspersample)-1 );
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, (uint32_t)(0x1u << t2p->tiff_bitspersample)-1u );
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " ", 1);
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_palettecs );
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->pdf_palettecs );
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R ]\n", 7);
@@ -5116,25 +5090,25 @@ tsize_t t2p_write_pdf_transfer(T2P* t2p, TIFF* output){
written += t2pWriteFile(output, (tdata_t) "<< /Type /ExtGState \n/TR ", 25);
if(t2p->tiff_transferfunctioncount == 1){
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)(t2p->pdf_xrefcount + 1));
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->pdf_xrefcount + 1u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
} else {
written += t2pWriteFile(output, (tdata_t) "[ ", 2);
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)(t2p->pdf_xrefcount + 1));
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->pdf_xrefcount + 1u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)(t2p->pdf_xrefcount + 2));
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->pdf_xrefcount + 2u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)(t2p->pdf_xrefcount + 3));
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->pdf_xrefcount + 3u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R ", 5);
@@ -5146,7 +5120,7 @@ tsize_t t2p_write_pdf_transfer(T2P* t2p, TIFF* output){
return(written);
}
-tsize_t t2p_write_pdf_transfer_dict(T2P* t2p, TIFF* output, uint16 i){
+tsize_t t2p_write_pdf_transfer_dict(T2P* t2p, TIFF* output, uint16_t i){
tsize_t written=0;
char buffer[32];
@@ -5156,7 +5130,7 @@ tsize_t t2p_write_pdf_transfer_dict(T2P* t2p, TIFF* output, uint16 i){
written += t2pWriteFile(output, (tdata_t) "/FunctionType 0 \n", 17);
written += t2pWriteFile(output, (tdata_t) "/Domain [0.0 1.0] \n", 19);
written += t2pWriteFile(output, (tdata_t) "/Range [0.0 1.0] \n", 18);
- buflen=snprintf(buffer, sizeof(buffer), "/Size [%u] \n", (1<<t2p->tiff_bitspersample));
+ buflen=snprintf(buffer, sizeof(buffer), "/Size [%"PRIu16"] \n", (uint16_t)(1u<<t2p->tiff_bitspersample));
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "/BitsPerSample 16 \n", 19);
@@ -5165,7 +5139,7 @@ tsize_t t2p_write_pdf_transfer_dict(T2P* t2p, TIFF* output, uint16 i){
return(written);
}
-tsize_t t2p_write_pdf_transfer_stream(T2P* t2p, TIFF* output, uint16 i){
+tsize_t t2p_write_pdf_transfer_stream(T2P* t2p, TIFF* output, uint16_t i){
tsize_t written=0;
@@ -5283,7 +5257,7 @@ tsize_t t2p_write_pdf_xobject_icccs(T2P* t2p, TIFF* output){
int buflen=0;
written += t2pWriteFile(output, (tdata_t) "[/ICCBased ", 11);
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_icccs);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->pdf_icccs);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R] \n", 7);
@@ -5298,7 +5272,7 @@ tsize_t t2p_write_pdf_xobject_icccs_dict(T2P* t2p, TIFF* output){
int buflen=0;
written += t2pWriteFile(output, (tdata_t) "/N ", 3);
- buflen=snprintf(buffer, sizeof(buffer), "%u \n", t2p->tiff_samplesperpixel);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu16" \n", t2p->tiff_samplesperpixel);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "/Alternate ", 11);
@@ -5379,39 +5353,39 @@ tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t tile, T2P* t2p, TIFF* output
written += t2pWriteFile(output, (tdata_t) "<< /K -1 ", 9);
if(tile==0){
written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_width);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_width);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_length);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_length);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
} else {
if(t2p_tile_is_right_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){
written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_tilewidth);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
} else {
written += t2pWriteFile(output, (tdata_t) "/Columns ", 9);
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilewidth);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
}
if(t2p_tile_is_bottom_edge(t2p->tiff_tiles[t2p->pdf_page], tile-1)==0){
written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_tilelength);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
} else {
written += t2pWriteFile(output, (tdata_t) " /Rows ", 7);
- buflen=snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_tiles[t2p->pdf_page].tiles_edgetilelength);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
}
@@ -5438,20 +5412,20 @@ tsize_t t2p_write_pdf_xobject_stream_filter(ttile_t tile, T2P* t2p, TIFF* output
if(t2p->pdf_compressionquality%100){
written += t2pWriteFile(output, (tdata_t) "/DecodeParms ", 13);
written += t2pWriteFile(output, (tdata_t) "<< /Predictor ", 14);
- buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->pdf_compressionquality%100);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu16, (uint16_t)(t2p->pdf_compressionquality % 100u));
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " /Columns ", 10);
- buflen = snprintf(buffer, sizeof(buffer), "%lu",
- (unsigned long)t2p->tiff_width);
+ buflen = snprintf(buffer, sizeof(buffer), "%"PRIu32,
+ t2p->tiff_width);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " /Colors ", 9);
- buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_samplesperpixel);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu16, t2p->tiff_samplesperpixel);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " /BitsPerComponent ", 19);
- buflen=snprintf(buffer, sizeof(buffer), "%u", t2p->tiff_bitspersample);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu16, t2p->tiff_bitspersample);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) ">>\n", 3);
@@ -5474,10 +5448,10 @@ tsize_t t2p_write_pdf_xreftable(T2P* t2p, TIFF* output){
tsize_t written=0;
char buffer[64];
int buflen=0;
- uint32 i=0;
+ uint32_t i=0;
written += t2pWriteFile(output, (tdata_t) "xref\n0 ", 7);
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount + 1));
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->pdf_xrefcount + 1u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " \n0000000000 65535 f \n", 22);
@@ -5506,15 +5480,15 @@ tsize_t t2p_write_pdf_trailer(T2P* t2p, TIFF* output)
snprintf(t2p->pdf_fileid + i, 9, "%.8X", rand());
written += t2pWriteFile(output, (tdata_t) "trailer\n<<\n/Size ", 17);
- buflen = snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)(t2p->pdf_xrefcount+1));
+ buflen = snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->pdf_xrefcount+1u);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "\n/Root ", 7);
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_catalog);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->pdf_catalog);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R \n/Info ", 12);
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_info);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->pdf_info);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) " 0 R \n/ID[<", 11);
@@ -5524,7 +5498,7 @@ tsize_t t2p_write_pdf_trailer(T2P* t2p, TIFF* output)
written += t2pWriteFile(output, (tdata_t) t2p->pdf_fileid,
sizeof(t2p->pdf_fileid) - 1);
written += t2pWriteFile(output, (tdata_t) ">]\n>>\nstartxref\n", 16);
- buflen=snprintf(buffer, sizeof(buffer), "%lu", (unsigned long)t2p->pdf_startxref);
+ buflen=snprintf(buffer, sizeof(buffer), "%"PRIu32, t2p->pdf_startxref);
check_snprintf_ret(t2p, buflen, buffer);
written += t2pWriteFile(output, (tdata_t) buffer, buflen);
written += t2pWriteFile(output, (tdata_t) "\n%%EOF\n", 7);
@@ -5577,16 +5551,16 @@ tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
tsize_t written=0;
ttile_t i2=0;
tsize_t streamlen=0;
- uint16 i=0;
+ uint16_t i=0;
t2p_read_tiff_init(t2p, input);
if(t2p->t2p_error!=T2P_ERR_OK){return(0);}
- t2p->pdf_xrefoffsets= (uint32*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t,t2p->pdf_xrefcount,sizeof(uint32)) );
+ t2p->pdf_xrefoffsets= (uint32_t*) _TIFFmalloc(TIFFSafeMultiply(tmsize_t, t2p->pdf_xrefcount, sizeof(uint32_t)) );
if(t2p->pdf_xrefoffsets==NULL){
TIFFError(
TIFF2PDF_MODULE,
- "Can't allocate %u bytes of memory for t2p_write_pdf",
- (unsigned int) (t2p->pdf_xrefcount * sizeof(uint32)) );
+ "Can't allocate %"TIFF_SIZE_FORMAT" bytes of memory for t2p_write_pdf",
+ sizeof(uint32_t) * t2p->pdf_xrefcount);
t2p->t2p_error = T2P_ERR_ERROR;
return(written);
}
@@ -5694,8 +5668,8 @@ tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
t2p_read_tiff_size_tile(t2p, input, i2);
if (t2p->tiff_maxdatasize && (t2p->tiff_datasize > t2p->tiff_maxdatasize)) {
TIFFError(TIFF2PDF_MODULE,
- "Allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ". Use -m option to change limit",
- (uint64)t2p->tiff_datasize, (uint64)t2p->tiff_maxdatasize);
+ "Allocation of %" PRIu64 " bytes is forbidden. Limit is %" PRIu64 ". Use -m option to change limit",
+ (uint64_t)t2p->tiff_datasize, (uint64_t)t2p->tiff_maxdatasize);
t2p->t2p_error = T2P_ERR_ERROR;
return (0);
}
@@ -5724,8 +5698,8 @@ tsize_t t2p_write_pdf(T2P* t2p, TIFF* input, TIFF* output){
t2p_read_tiff_size(t2p, input);
if (t2p->tiff_maxdatasize && (t2p->tiff_datasize > t2p->tiff_maxdatasize)) {
TIFFError(TIFF2PDF_MODULE,
- "Allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ". Use -m option to change limit",
- (uint64)t2p->tiff_datasize, (uint64)t2p->tiff_maxdatasize);
+ "Allocation of %" PRIu64 " bytes is forbidden. Limit is %" PRIu64 ". Use -m option to change limit",
+ (uint64_t)t2p->tiff_datasize, (uint64_t)t2p->tiff_maxdatasize);
t2p->t2p_error = T2P_ERR_ERROR;
return (0);
}
diff --git a/tiff/tools/tiff2ps.c b/tiff/tools/tiff2ps.c
index 4ed5eba2..a598ede7 100644
--- a/tiff/tools/tiff2ps.c
+++ b/tiff/tools/tiff2ps.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h> /* for atof */
@@ -34,10 +35,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffio.h"
#ifndef EXIT_SUCCESS
@@ -64,7 +61,7 @@
* warning messages for incompatible command line options.
* Add new command line options to specify PageOrientation
* Document Structuring Comment for landscape or portrait
- * and code to determine the values from ouput width and height
+ * and code to determine the values from output width and height
* if not specified on the command line.
* Add new command line option to specify document creator
* as an alterntive to the string "tiff2ps" following model
@@ -85,7 +82,7 @@
*
* Identified incompatible options and returned errors, eg
* -i for imagemask operator is only available for Level2 or
- * Level3 Postscript in the current implmentation since there
+ * Level3 Postscript in the current implementation since there
* is a difference in the way the operands are called for Level1
* and there is no function to provide the Level1 version.
* -H was not handled properly if -h and/or -w were specified.
@@ -96,7 +93,7 @@
* Conversion of TIFF to Postscript with optional rotations
* of 90, 180, 270, or auto degrees counterclockwise
* Conversion of TIFF to Postscript with entire image scaled
- * to maximum of values spedified with -h or -w while
+ * to maximum of values specified with -h or -w while
* maintaining aspect ratio. Same rotations apply.
* Conversion of TIFF to Postscript with clipping of output
* viewport to height specified with -H, producing multiple
@@ -173,9 +170,6 @@
#define EXP_ASCII85ENCODER
-/*
- * NB: this code assumes uint32 works with printf's %l[ud].
- */
#ifndef TRUE
#define TRUE 1
#define FALSE 0
@@ -206,7 +200,7 @@ char *title = NULL; /* optional document title string */
char *creator = NULL; /* optional document creator string */
char pageOrientation[12]; /* set optional PageOrientation DSC to Landscape or Portrait */
int useImagemask = FALSE; /* Use imagemask instead of image operator */
-uint16 res_unit = 0; /* Resolution units: 2 - inches, 3 - cm */
+uint16_t res_unit = 0; /* Resolution units: 2 - inches, 3 - cm */
/*
* ASCII85 Encoding Support.
@@ -216,14 +210,14 @@ int ascii85count;
int ascii85breaklen;
int TIFF2PS(FILE*, TIFF*, double, double, double, double, int);
-void PSpage(FILE*, TIFF*, uint32, uint32);
-void PSColorContigPreamble(FILE*, uint32, uint32, int);
-void PSColorSeparatePreamble(FILE*, uint32, uint32, int);
-void PSDataColorContig(FILE*, TIFF*, uint32, uint32, int);
-void PSDataColorSeparate(FILE*, TIFF*, uint32, uint32, int);
-void PSDataPalette(FILE*, TIFF*, uint32, uint32);
-void PSDataBW(FILE*, TIFF*, uint32, uint32);
-void PSRawDataBW(FILE*, TIFF*, uint32, uint32);
+void PSpage(FILE*, TIFF*, uint32_t, uint32_t);
+void PSColorContigPreamble(FILE*, uint32_t, uint32_t, int);
+void PSColorSeparatePreamble(FILE*, uint32_t, uint32_t, int);
+void PSDataColorContig(FILE*, TIFF*, uint32_t, uint32_t, int);
+void PSDataColorSeparate(FILE*, TIFF*, uint32_t, uint32_t, int);
+void PSDataPalette(FILE*, TIFF*, uint32_t, uint32_t);
+void PSDataBW(FILE*, TIFF*, uint32_t, uint32_t);
+void PSRawDataBW(FILE*, TIFF*, uint32_t, uint32_t);
void Ascii85Init(void);
void Ascii85Put(unsigned char code, FILE* fd);
void Ascii85Flush(FILE* fd);
@@ -242,7 +236,7 @@ int exportMaskedImage(FILE *, double, double, double, double, int, int,
double, double, double, int, int);
#if defined( EXP_ASCII85ENCODER)
-tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw_p, tsize_t raw_l );
+tsize_t Ascii85EncodeBlock(uint8_t * ascii85_p, unsigned f_eod, const uint8_t * raw_p, tsize_t raw_l );
#endif
static void usage(int);
@@ -253,8 +247,8 @@ static void usage(int);
static void* limitMalloc(tmsize_t s)
{
if (maxMalloc && (s > maxMalloc)) {
- fprintf(stderr, "MemoryLimitError: allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ".\n",
- (uint64)s, (uint64)maxMalloc);
+ fprintf(stderr, "MemoryLimitError: allocation of %" TIFF_SSIZE_FORMAT " bytes is forbidden. Limit is %" TIFF_SSIZE_FORMAT ".\n",
+ s, maxMalloc);
fprintf(stderr, " use -M option to change limit.\n");
return NULL;
}
@@ -270,7 +264,7 @@ main(int argc, char* argv[])
double leftmargin = 0;
double pageWidth = 0;
double pageHeight = 0;
- uint32 diroff = 0;
+ uint32_t diroff = 0;
#if !HAVE_DECL_OPTARG
extern char *optarg;
extern int optind;
@@ -336,7 +330,7 @@ main(int argc, char* argv[])
case '6':
case '7':
case '8':
- case '9': diroff = (uint32) strtoul(optarg, NULL, 0);
+ case '9': diroff = (uint32_t) strtoul(optarg, NULL, 0);
break;
default: TIFFError ("-o", "Offset must be a numeric value.");
exit (EXIT_FAILURE);
@@ -438,7 +432,7 @@ main(int argc, char* argv[])
{
if ((level2 == FALSE) && (level3 == FALSE))
{
- TIFFError ("-m "," imagemask operator requres Postscript Level2 or Level3");
+ TIFFError ("-m "," imagemask operator requires Postscript Level2 or Level3");
exit (EXIT_FAILURE);
}
}
@@ -522,12 +516,12 @@ main(int argc, char* argv[])
return (EXIT_SUCCESS);
}
-static uint16 samplesperpixel;
-static uint16 bitspersample;
-static uint16 planarconfiguration;
-static uint16 photometric;
-static uint16 compression;
-static uint16 extrasamples;
+static uint16_t samplesperpixel;
+static uint16_t bitspersample;
+static uint16_t planarconfiguration;
+static uint16_t photometric;
+static uint16_t compression;
+static uint16_t extrasamples;
static int alpha;
static int
@@ -552,7 +546,7 @@ checkImage(TIFF* tif)
case PHOTOMETRIC_RGB:
if (alpha && bitspersample != 8) {
TIFFError(filename,
- "Can not handle %d-bit/sample RGB image with alpha",
+ "Can not handle %"PRIu16"-bit/sample RGB image with alpha",
bitspersample);
return (0);
}
@@ -583,7 +577,7 @@ checkImage(TIFF* tif)
/* fall through... */
default:
TIFFError(filename,
- "Can not handle image with PhotometricInterpretation=%d",
+ "Can not handle image with PhotometricInterpretation=%"PRIu16,
photometric);
return (0);
}
@@ -593,7 +587,7 @@ checkImage(TIFF* tif)
case 16:
break;
default:
- TIFFError(filename, "Can not handle %d-bit/sample image",
+ TIFFError(filename, "Can not handle %"PRIu16"-bit/sample image",
bitspersample);
return (0);
}
@@ -605,7 +599,7 @@ checkImage(TIFF* tif)
#define PS_UNIT_SIZE 72.0F
#define PSUNITS(npix,res) ((npix) * (PS_UNIT_SIZE / (res)))
-static char RGBcolorimage[] = "\
+static const char RGBcolorimage[] = "\
/bwproc {\n\
rgbproc\n\
dup length 3 idiv string 0 3 0\n\
@@ -635,10 +629,10 @@ static char RGBcolorimage[] = "\
* It is claimed to be part of some future revision of the EPS spec.
*/
static void
-PhotoshopBanner(FILE* fd, uint32 w, uint32 h, int bs, int nc, char* startline)
+PhotoshopBanner(FILE* fd, uint32_t w, uint32_t h, int bs, int nc, const char* startline)
{
- fprintf(fd, "%%ImageData: %ld %ld %d %d 0 %d 2 \"",
- (long) w, (long) h, bitspersample, nc, bs);
+ fprintf(fd, "%%ImageData: %"PRIu32" %"PRIu32" %"PRIu16" %d 0 %d 2 \"",
+ w, h, bitspersample, nc, bs);
fprintf(fd, startline, nc);
fprintf(fd, "\"\n");
}
@@ -651,7 +645,7 @@ PhotoshopBanner(FILE* fd, uint32 w, uint32 h, int bs, int nc, char* startline)
* pprh : image height in PS units (72 dpi)
*/
static void
-setupPageState(TIFF* tif, uint32* pw, uint32* ph, double* pprw, double* pprh)
+setupPageState(TIFF* tif, uint32_t* pw, uint32_t* ph, double* pprw, double* pprh)
{
float xres = 0.0F, yres = 0.0F;
@@ -702,7 +696,7 @@ setupPageState(TIFF* tif, uint32* pw, uint32* ph, double* pprw, double* pprh)
static int
isCCITTCompression(TIFF* tif)
{
- uint16 compress;
+ uint16_t compress;
TIFFGetField(tif, TIFFTAG_COMPRESSION, &compress);
return (compress == COMPRESSION_CCITTFAX3 ||
compress == COMPRESSION_CCITTFAX4 ||
@@ -712,8 +706,8 @@ isCCITTCompression(TIFF* tif)
static tsize_t tf_bytesperrow;
static tsize_t ps_bytesperrow;
-static uint32 tf_rowsperstrip;
-static uint32 tf_numberstrips;
+static uint32_t tf_rowsperstrip;
+static uint32_t tf_numberstrips;
static char *hex = "0123456789abcdef";
/*
@@ -1130,7 +1124,7 @@ int psPageSize (FILE * fd, int rotation, double pgwidth, double pgheight,
fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation);
else
fprintf (fd, "%%%%PageOrientation: %s\n", (new_width > new_height) ? "Landscape" : "Portrait");
- fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)new_width, (long)new_height);
+ fprintf (fd, "%%%%PageBoundingBox: 0 0 %"PRId32" %"PRId32"\n", (int32_t)new_width, (int32_t)new_height);
fprintf (fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n",
new_width, new_height);
}
@@ -1142,7 +1136,7 @@ int psPageSize (FILE * fd, int rotation, double pgwidth, double pgheight,
fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation);
else
fprintf (fd, "%%%%PageOrientation: %s\n", (pswidth > psheight) ? "Landscape" : "Portrait");
- fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)pswidth, (long)psheight);
+ fprintf (fd, "%%%%PageBoundingBox: 0 0 %"PRId32" %"PRId32"\n", (int32_t)pswidth, (int32_t)psheight);
fprintf(fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n",
pswidth, psheight);
}
@@ -1152,7 +1146,7 @@ int psPageSize (FILE * fd, int rotation, double pgwidth, double pgheight,
fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation);
else
fprintf (fd, "%%%%PageOrientation: %s\n", (reqwidth > reqheight) ? "Landscape" : "Portrait");
- fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)reqwidth, (long)reqheight);
+ fprintf (fd, "%%%%PageBoundingBox: 0 0 %"PRId32" %"PRId32"\n", (int32_t)reqwidth, (int32_t)reqheight);
fprintf(fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n",
reqwidth, reqheight);
}
@@ -1174,7 +1168,7 @@ int psPageSize (FILE * fd, int rotation, double pgwidth, double pgheight,
fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation);
else
fprintf (fd, "%%%%PageOrientation: %s\n", (new_width > new_height) ? "Landscape" : "Portrait");
- fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)new_width, (long)new_height);
+ fprintf (fd, "%%%%PageBoundingBox: 0 0 %"PRId32" %"PRId32"\n", (int32_t)new_width, (int32_t)new_height);
fprintf (fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n",
new_width, new_height);
}
@@ -1186,7 +1180,7 @@ int psPageSize (FILE * fd, int rotation, double pgwidth, double pgheight,
fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation);
else
fprintf (fd, "%%%%PageOrientation: %s\n", (psheight > pswidth) ? "Landscape" : "Portrait");
- fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)psheight, (long)pswidth);
+ fprintf (fd, "%%%%PageBoundingBox: 0 0 %"PRId32" %"PRId32"\n", (int32_t)psheight, (int32_t)pswidth);
fprintf(fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n",
psheight, pswidth);
}
@@ -1196,7 +1190,7 @@ int psPageSize (FILE * fd, int rotation, double pgwidth, double pgheight,
fprintf (fd, "%%%%PageOrientation: %s\n", pageOrientation);
else
fprintf (fd, "%%%%PageOrientation: %s\n", (reqwidth > reqheight) ? "Landscape" : "Portrait");
- fprintf (fd, "%%%%PageBoundingBox: 0 0 %ld %ld\n", (long)reqwidth, (long)reqheight);
+ fprintf (fd, "%%%%PageBoundingBox: 0 0 %"PRId32" %"PRId32"\n", (int32_t)reqwidth, (int32_t)reqheight);
fprintf(fd, "1 dict begin /PageSize [ %f %f ] def currentdict end setpagedevice\n",
reqwidth, reqheight);
}
@@ -1312,19 +1306,19 @@ int psStart(FILE *fd, int npages, int auto_rotate, int *rotation, double *scale,
if (((maxsource == pswidth) && (maxtarget != reqwidth)) ||
((maxsource == psheight) && (maxtarget != reqheight)))
- { /* optimal orientaion does not match input orientation */
+ { /* optimal orientation does not match input orientation */
*rotation = 90;
xscale = (reqwidth - left_offset)/psheight;
yscale = (reqheight - bottom_offset)/pswidth;
}
- else /* optimal orientaion matches input orientation */
+ else /* optimal orientation matches input orientation */
{
xscale = (reqwidth - left_offset)/pswidth;
yscale = (reqheight - bottom_offset)/psheight;
}
*scale = (xscale < yscale) ? xscale : yscale;
- /* Do not scale image beyound original size */
+ /* Do not scale image beyond original size */
if (*scale > 1.0)
*scale = 1.0;
@@ -1515,15 +1509,15 @@ int get_viewport (double pgwidth, double pgheight, double pswidth, double psheig
int TIFF2PS(FILE* fd, TIFF* tif, double pgwidth, double pgheight, double lm, double bm, int center)
{
- uint32 pixwidth = 0, pixheight = 0; /* Image width and height in pixels */
+ uint32_t pixwidth = 0, pixheight = 0; /* Image width and height in pixels */
double ox = 0.0, oy = 0.0; /* Offset from current Postscript origin */
double pswidth, psheight; /* Original raw image width and height in points */
double view_width, view_height; /* Viewport width and height in points */
double scale = 1.0;
double left_offset = lm * PS_UNIT_SIZE;
double bottom_offset = bm * PS_UNIT_SIZE;
- uint32 subfiletype;
- uint16* sampleinfo;
+ uint32_t subfiletype;
+ uint16_t* sampleinfo;
static int npages = 0;
if (!TIFFGetField(tif, TIFFTAG_XPOSITION, &ox))
@@ -1594,7 +1588,7 @@ int TIFF2PS(FILE* fd, TIFF* tif, double pgwidth, double pgheight, double lm, dou
{
if (pgwidth != 0 || pgheight != 0)
{
- /* User did not specify a maxium page height or width using -H or -W flag
+ /* User did not specify a maximum page height or width using -H or -W flag
* but did use -h or -w flag to scale to a specific size page.
*/
npages++;
@@ -1653,7 +1647,7 @@ int TIFF2PS(FILE* fd, TIFF* tif, double pgwidth, double pgheight, double lm, dou
return(npages);
}
-static char DuplexPreamble[] = "\
+static const char DuplexPreamble[] = "\
%%BeginFeature: *Duplex True\n\
systemdict begin\n\
/languagelevel where { pop languagelevel } { 1 } ifelse\n\
@@ -1664,7 +1658,7 @@ end\n\
%%EndFeature\n\
";
-static char TumblePreamble[] = "\
+static const char TumblePreamble[] = "\
%%BeginFeature: *Tumble True\n\
systemdict begin\n\
/languagelevel where { pop languagelevel } { 1 } ifelse\n\
@@ -1675,7 +1669,7 @@ end\n\
%%EndFeature\n\
";
-static char AvoidDeadZonePreamble[] = "\
+static const char AvoidDeadZonePreamble[] = "\
gsave newpath clippath pathbbox grestore\n\
4 2 roll 2 copy translate\n\
exch 3 1 roll sub 3 1 roll sub exch\n\
@@ -1699,9 +1693,9 @@ PSHead(FILE *fd, double pagewidth, double pageheight, double xoff, double yoff)
/* NB: should use PageBoundingBox for each page instead of BoundingBox *
* PageBoundingBox DSC added in PSPageSize function, R Nolde 09-01-2010
*/
- fprintf(fd, "%%%%Origin: %ld %ld\n", (long) xoff, (long) yoff);
- fprintf(fd, "%%%%BoundingBox: 0 0 %ld %ld\n",
- (long) ceil(pagewidth), (long) ceil(pageheight));
+ fprintf(fd, "%%%%Origin: %"PRId32" %"PRId32"\n", (int32_t) xoff, (int32_t) yoff);
+ fprintf(fd, "%%%%BoundingBox: 0 0 %"PRId32" %"PRId32"\n",
+ (int32_t) ceil(pagewidth), (int32_t) ceil(pageheight));
fprintf(fd, "%%%%LanguageLevel: %d\n", (level3 ? 3 : (level2 ? 2 : 1)));
if (generateEPSF == TRUE)
@@ -1732,7 +1726,7 @@ PSTail(FILE *fd, int npages)
}
static int
-checkcmap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b)
+checkcmap(TIFF* tif, int n, uint16_t* r, uint16_t* g, uint16_t* b)
{
(void) tif;
while (n-- > 0)
@@ -1745,7 +1739,7 @@ checkcmap(TIFF* tif, int n, uint16* r, uint16* g, uint16* b)
static void
PS_Lvl2colorspace(FILE* fd, TIFF* tif)
{
- uint16 *rmap, *gmap, *bmap;
+ uint16_t *rmap, *gmap, *bmap;
int i, num_colors;
const char * colorspace_p;
@@ -1765,7 +1759,7 @@ PS_Lvl2colorspace(FILE* fd, TIFF* tif)
/*
* Set up PostScript Level 2 colorspace according to
- * section 4.8 in the PostScript refenence manual.
+ * section 4.8 in the PostScript reference manual.
*/
fputs("% PostScript Level 2 only.\n", fd);
if (photometric != PHOTOMETRIC_PALETTE) {
@@ -1811,7 +1805,7 @@ PS_Lvl2colorspace(FILE* fd, TIFF* tif)
Ascii85Put((unsigned char)bmap[i], fd);
} else {
fputs((i % 8) ? " " : "\n ", fd);
- fprintf(fd, "%02x%02x%02x",
+ fprintf(fd, "%02"PRIx16"%02"PRIx16"%02"PRIx16"",
rmap[i], gmap[i], bmap[i]);
}
}
@@ -1823,21 +1817,21 @@ PS_Lvl2colorspace(FILE* fd, TIFF* tif)
}
static int
-PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
+PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32_t w, uint32_t h)
{
int use_rawdata;
- uint32 tile_width, tile_height;
- uint16 predictor, minsamplevalue, maxsamplevalue;
- uint32 repeat_count;
+ uint32_t tile_width, tile_height;
+ uint16_t predictor, minsamplevalue, maxsamplevalue;
+ uint32_t repeat_count;
char im_h[64], im_x[64], im_y[64];
- char * imageOp = "image";
+ const char * imageOp = "image";
if ( useImagemask && (bitspersample == 1) )
imageOp = "imagemask";
(void)strcpy(im_x, "0");
- (void)snprintf(im_y, sizeof(im_y), "%lu", (long) h);
- (void)snprintf(im_h, sizeof(im_h), "%lu", (long) h);
+ (void)snprintf(im_y, sizeof(im_y), "%"PRIu32, h);
+ (void)snprintf(im_h, sizeof(im_h), "%"PRIu32, h);
tile_width = w;
tile_height = h;
if (TIFFIsTiled(tif)) {
@@ -1858,7 +1852,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
if (tile_height < h) {
fputs("/im_y 0 def\n", fd);
- (void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h);
+ (void)snprintf(im_y, sizeof(im_y), "%"PRIu32" im_y sub", h);
}
} else {
repeat_count = tf_numberstrips;
@@ -1867,10 +1861,9 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
tile_height = h;
if (repeat_count > 1) {
fputs("/im_y 0 def\n", fd);
- fprintf(fd, "/im_h %lu def\n",
- (unsigned long) tile_height);
+ fprintf(fd, "/im_h %"PRIu32" def\n", tile_height);
(void)strcpy(im_h, "im_h");
- (void)snprintf(im_y, sizeof(im_y), "%lu im_y sub", (unsigned long) h);
+ (void)snprintf(im_y, sizeof(im_y), "%"PRIu32" im_y sub", h);
}
}
@@ -1880,7 +1873,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
fputs("{ % exec\n", fd);
if (repeat_count > 1)
- fprintf(fd, "%u { %% repeat\n", repeat_count);
+ fprintf(fd, "%"PRIu32" { %% repeat\n", repeat_count);
/*
* Output filter options and image dictionary.
@@ -1890,7 +1883,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
fd);
fputs(" <<\n", fd);
fputs(" /ImageType 1\n", fd);
- fprintf(fd, " /Width %lu\n", (unsigned long) tile_width);
+ fprintf(fd, " /Width %"PRIu32"\n", tile_width);
/*
* Workaround for some software that may crash when last strip
* of image contains fewer number of scanlines than specified
@@ -1902,15 +1895,15 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
* one-stripped image).
*/
if (TIFFIsTiled(tif) || tf_numberstrips == 1)
- fprintf(fd, " /Height %lu\n", (unsigned long) tile_height);
+ fprintf(fd, " /Height %"PRIu32"\n", tile_height);
else
fprintf(fd, " /Height im_h\n");
if (planarconfiguration == PLANARCONFIG_SEPARATE && samplesperpixel > 1)
fputs(" /MultipleDataSources true\n", fd);
- fprintf(fd, " /ImageMatrix [ %lu 0 0 %ld %s %s ]\n",
- (unsigned long) w, - (long)h, im_x, im_y);
- fprintf(fd, " /BitsPerComponent %d\n", bitspersample);
+ fprintf(fd, " /ImageMatrix [ %"PRIu32" 0 0 %"PRId32" %s %s ]\n",
+ w, - (int32_t)h, im_x, im_y);
+ fprintf(fd, " /BitsPerComponent %"PRIu16"\n", bitspersample);
fprintf(fd, " /Interpolate %s\n", interpolate ? "true" : "false");
switch (samplesperpixel - extrasamples) {
@@ -1927,7 +1920,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
case COMPRESSION_CCITTFAX4:
/*
* Manage inverting with /Blackis1 flag
- * since there migth be uncompressed parts
+ * since there might be uncompressed parts
*/
fputs(" /Decode [0 1]\n", fd);
break;
@@ -1944,7 +1937,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
&minsamplevalue);
TIFFGetFieldDefaulted(tif, TIFFTAG_MAXSAMPLEVALUE,
&maxsamplevalue);
- fprintf(fd, " /Decode [%u %u]\n",
+ fprintf(fd, " /Decode [%"PRIu16" %"PRIu16"]\n",
minsamplevalue, maxsamplevalue);
break;
default:
@@ -1996,7 +1989,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
case COMPRESSION_CCITTFAX4: /* 4: CCITT Group 4 fax encoding */
fputs("\n\t<<\n", fd);
if (compression == COMPRESSION_CCITTFAX3) {
- uint32 g3_options;
+ uint32_t g3_options;
fputs("\t /EndOfLine true\n", fd);
fputs("\t /EndOfBlock false\n", fd);
@@ -2011,7 +2004,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
fputs("\t /EncodedByteAlign true\n", fd);
}
if (compression == COMPRESSION_CCITTFAX4) {
- uint32 g4_options;
+ uint32_t g4_options;
fputs("\t /K -1\n", fd);
TIFFGetFieldDefaulted(tif, TIFFTAG_GROUP4OPTIONS,
@@ -2020,8 +2013,8 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
fputs("\t /Uncompressed true\n", fd);
}
if (!(tile_width == w && w == 1728U))
- fprintf(fd, "\t /Columns %lu\n",
- (unsigned long) tile_width);
+ fprintf(fd, "\t /Columns %"PRIu32"\n",
+ tile_width);
fprintf(fd, "\t /Rows %s\n", im_h);
if (compression == COMPRESSION_CCITTRLE ||
compression == COMPRESSION_CCITTRLEW) {
@@ -2036,11 +2029,11 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
TIFFGetFieldDefaulted(tif, TIFFTAG_PREDICTOR, &predictor);
if (predictor == 2) {
fputs("\n\t<<\n", fd);
- fprintf(fd, "\t /Predictor %u\n", predictor);
- fprintf(fd, "\t /Columns %lu\n",
- (unsigned long) tile_width);
- fprintf(fd, "\t /Colors %u\n", samplesperpixel);
- fprintf(fd, "\t /BitsPerComponent %u\n",
+ fprintf(fd, "\t /Predictor %"PRIu16"\n", predictor);
+ fprintf(fd, "\t /Columns %"PRIu32"\n",
+ tile_width);
+ fprintf(fd, "\t /Colors %"PRIu16"\n", samplesperpixel);
+ fprintf(fd, "\t /BitsPerComponent %"PRIu16"\n",
bitspersample);
fputs("\t>>", fd);
}
@@ -2053,11 +2046,11 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
if (predictor > 1) {
fprintf(fd, "\t %% PostScript Level 3 only.");
fputs("\n\t<<\n", fd);
- fprintf(fd, "\t /Predictor %u\n", predictor);
- fprintf(fd, "\t /Columns %lu\n",
- (unsigned long) tile_width);
- fprintf(fd, "\t /Colors %u\n", samplesperpixel);
- fprintf(fd, "\t /BitsPerComponent %u\n",
+ fprintf(fd, "\t /Predictor %"PRIu16"\n", predictor);
+ fprintf(fd, "\t /Columns %"PRIu32"\n",
+ tile_width);
+ fprintf(fd, "\t /Colors %"PRIu16"\n", samplesperpixel);
+ fprintf(fd, "\t /BitsPerComponent %"PRIu16"\n",
bitspersample);
fputs("\t>>", fd);
}
@@ -2101,7 +2094,7 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
if (planarconfiguration == PLANARCONFIG_SEPARATE &&
samplesperpixel > 1) {
- uint16 i;
+ uint16_t i;
/*
* NOTE: This code does not work yet...
@@ -2116,28 +2109,28 @@ PS_Lvl2ImageDict(FILE* fd, TIFF* tif, uint32 w, uint32 h)
fputs(" im_stream status { im_stream flushfile } if\n", fd);
if (repeat_count > 1) {
if (tile_width < w) {
- fprintf(fd, " /im_x im_x %lu add def\n",
- (unsigned long) tile_width);
+ fprintf(fd, " /im_x im_x %"PRIu32" add def\n",
+ tile_width);
if (tile_height < h) {
- fprintf(fd, " im_x %lu ge {\n",
- (unsigned long) w);
+ fprintf(fd, " im_x %"PRIu32" ge {\n",
+ w);
fputs(" /im_x 0 def\n", fd);
- fprintf(fd, " /im_y im_y %lu add def\n",
- (unsigned long) tile_height);
+ fprintf(fd, " /im_y im_y %"PRIu32" add def\n",
+ tile_height);
fputs(" } if\n", fd);
}
}
if (tile_height < h) {
if (tile_width >= w) {
- fprintf(fd, " /im_y im_y %lu add def\n",
- (unsigned long) tile_height);
+ fprintf(fd, " /im_y im_y %"PRIu32" add def\n",
+ tile_height);
if (!TIFFIsTiled(tif)) {
- fprintf(fd, " /im_h %lu im_y sub",
- (unsigned long) h);
- fprintf(fd, " dup %lu gt { pop",
- (unsigned long) tile_height);
- fprintf(fd, " %lu } if def\n",
- (unsigned long) tile_height);
+ fprintf(fd, " /im_h %"PRIu32" im_y sub",
+ h);
+ fprintf(fd, " dup %"PRIu32" gt { pop",
+ tile_height);
+ fprintf(fd, " %"PRIu32" } if def\n",
+ tile_height);
}
}
}
@@ -2174,18 +2167,18 @@ PS_FlipBytes(unsigned char* buf, tsize_t count)
#define MAXLINE 36
int
-PS_Lvl2page(FILE* fd, TIFF* tif, uint32 w, uint32 h)
+PS_Lvl2page(FILE* fd, TIFF* tif, uint32_t w, uint32_t h)
{
- uint16 fillorder;
+ uint16_t fillorder;
int use_rawdata, tiled_image, breaklen = MAXLINE;
- uint32 chunk_no, num_chunks;
- uint64 *bc;
+ uint32_t chunk_no, num_chunks;
+ uint64_t *bc;
unsigned char *buf_data, *cp;
tsize_t chunk_size, byte_count;
#if defined( EXP_ASCII85ENCODER )
tsize_t ascii85_l; /* Length, in bytes, of ascii85_p[] data */
- uint8 * ascii85_p = 0; /* Holds ASCII85 encoded data */
+ uint8_t * ascii85_p = 0; /* Holds ASCII85 encoded data */
#endif
PS_Lvl2colorspace(fd, tif);
@@ -2219,8 +2212,8 @@ PS_Lvl2page(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
buf_data = (unsigned char *)limitMalloc(chunk_size);
if (!buf_data) {
- TIFFError(filename, "Can't alloc %lu bytes for %s.",
- (unsigned long) chunk_size, tiled_image ? "tiles" : "strips");
+ TIFFError(filename, "Can't alloc %"TIFF_SSIZE_FORMAT" bytes for %s.",
+ chunk_size, tiled_image ? "tiles" : "strips");
return(FALSE);
}
@@ -2272,7 +2265,7 @@ PS_Lvl2page(FILE* fd, TIFF* tif, uint32 w, uint32 h)
chunk_size);
}
if (byte_count < 0) {
- TIFFError(filename, "Can't read %s %d.",
+ TIFFError(filename, "Can't read %s %"PRIu32".",
tiled_image ? "tile" : "strip", chunk_no);
if (ascii85)
Ascii85Put('\0', fd);
@@ -2363,7 +2356,7 @@ PS_Lvl2page(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
void
-PSpage(FILE* fd, TIFF* tif, uint32 w, uint32 h)
+PSpage(FILE* fd, TIFF* tif, uint32_t w, uint32_t h)
{
char * imageOp = "image";
@@ -2397,12 +2390,12 @@ PSpage(FILE* fd, TIFF* tif, uint32 w, uint32 h)
case PHOTOMETRIC_PALETTE:
fprintf(fd, "%s", RGBcolorimage);
PhotoshopBanner(fd, w, h, 1, 3, "false 3 colorimage");
- fprintf(fd, "/scanLine %ld string def\n",
- (long) ps_bytesperrow * 3L);
- fprintf(fd, "%lu %lu 8\n",
- (unsigned long) w, (unsigned long) h);
- fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n",
- (unsigned long) w, (unsigned long) h, (unsigned long) h);
+ fprintf(fd, "/scanLine %"TIFF_SSIZE_FORMAT" string def\n",
+ ps_bytesperrow * 3);
+ fprintf(fd, "%"PRIu32" %"PRIu32" 8\n",
+ w, h);
+ fprintf(fd, "[%"PRIu32" 0 0 -%"PRIu32" 0 %"PRIu32"]\n",
+ w, h, h);
fprintf(fd, "{currentfile scanLine readhexstring pop} bind\n");
fprintf(fd, "false 3 colorimage\n");
PSDataPalette(fd, tif, w, h);
@@ -2410,12 +2403,12 @@ PSpage(FILE* fd, TIFF* tif, uint32 w, uint32 h)
case PHOTOMETRIC_MINISBLACK:
case PHOTOMETRIC_MINISWHITE:
PhotoshopBanner(fd, w, h, 1, 1, imageOp);
- fprintf(fd, "/scanLine %ld string def\n",
- (long) ps_bytesperrow);
- fprintf(fd, "%lu %lu %d\n",
- (unsigned long) w, (unsigned long) h, bitspersample);
- fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n",
- (unsigned long) w, (unsigned long) h, (unsigned long) h);
+ fprintf(fd, "/scanLine %"TIFF_SSIZE_FORMAT" string def\n",
+ ps_bytesperrow);
+ fprintf(fd, "%"PRIu32" %"PRIu32" %"PRIu16"\n",
+ w, h, bitspersample);
+ fprintf(fd, "[%"PRIu32" 0 0 -%"PRIu32" 0 %"PRIu32"]\n",
+ w, h, h);
fprintf(fd,
"{currentfile scanLine readhexstring pop} bind\n");
fprintf(fd, "%s\n", imageOp);
@@ -2426,32 +2419,32 @@ PSpage(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
void
-PSColorContigPreamble(FILE* fd, uint32 w, uint32 h, int nc)
+PSColorContigPreamble(FILE* fd, uint32_t w, uint32_t h, int nc)
{
ps_bytesperrow = nc * (tf_bytesperrow / samplesperpixel);
PhotoshopBanner(fd, w, h, 1, nc, "false %d colorimage");
- fprintf(fd, "/line %ld string def\n", (long) ps_bytesperrow);
- fprintf(fd, "%lu %lu %d\n",
- (unsigned long) w, (unsigned long) h, bitspersample);
- fprintf(fd, "[%lu 0 0 -%lu 0 %lu]\n",
- (unsigned long) w, (unsigned long) h, (unsigned long) h);
+ fprintf(fd, "/line %"TIFF_SSIZE_FORMAT" string def\n", ps_bytesperrow);
+ fprintf(fd, "%"PRIu32" %"PRIu32" %"PRIu16"\n",
+ w, h, bitspersample);
+ fprintf(fd, "[%"PRIu32" 0 0 -%"PRIu32" 0 %"PRIu32"]\n",
+ w, h, h);
fprintf(fd, "{currentfile line readhexstring pop} bind\n");
fprintf(fd, "false %d colorimage\n", nc);
}
void
-PSColorSeparatePreamble(FILE* fd, uint32 w, uint32 h, int nc)
+PSColorSeparatePreamble(FILE* fd, uint32_t w, uint32_t h, int nc)
{
int i;
PhotoshopBanner(fd, w, h, ps_bytesperrow, nc, "true %d colorimage");
for (i = 0; i < nc; i++)
- fprintf(fd, "/line%d %ld string def\n",
- i, (long) ps_bytesperrow);
- fprintf(fd, "%lu %lu %d\n",
- (unsigned long) w, (unsigned long) h, bitspersample);
- fprintf(fd, "[%lu 0 0 -%lu 0 %lu] \n",
- (unsigned long) w, (unsigned long) h, (unsigned long) h);
+ fprintf(fd, "/line%d %"TIFF_SSIZE_FORMAT" string def\n",
+ i, ps_bytesperrow);
+ fprintf(fd, "%"PRIu32" %"PRIu32" %"PRIu16"\n",
+ w, h, bitspersample);
+ fprintf(fd, "[%"PRIu32" 0 0 -%"PRIu32" 0 %"PRIu32"] \n",
+ w, h, h);
for (i = 0; i < nc; i++)
fprintf(fd, "{currentfile line%d readhexstring pop}bind\n", i);
fprintf(fd, "true %d colorimage\n", nc);
@@ -2462,12 +2455,18 @@ PSColorSeparatePreamble(FILE* fd, uint32 w, uint32 h, int nc)
putc('\n', fd); \
(len) = MAXLINE-(howmany); \
}
-#define PUTHEX(c,fd) putc(hex[((c)>>4)&0xf],fd); putc(hex[(c)&0xf],fd)
+
+static inline void
+puthex(unsigned int c, FILE *fd)
+{
+ putc(hex[((c)>>4)&0xf],fd);
+ putc(hex[(c)&0xf],fd);
+}
void
-PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
+PSDataColorContig(FILE* fd, TIFF* tif, uint32_t w, uint32_t h, int nc)
{
- uint32 row;
+ uint32_t row;
int breaklen = MAXLINE, es = samplesperpixel - nc;
tsize_t cc;
unsigned char *tf_buf;
@@ -2476,7 +2475,7 @@ PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
(void) w;
if( es < 0 )
{
- TIFFError(filename, "Inconsistent value of es: %d (samplesperpixel=%u, nc=%d)", es, samplesperpixel, nc);
+ TIFFError(filename, "Inconsistent value of es: %d (samplesperpixel=%"PRIu16", nc=%d)", es, samplesperpixel, nc);
return;
}
tf_buf = (unsigned char *) limitMalloc(tf_bytesperrow);
@@ -2509,12 +2508,11 @@ PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
* where Cback = 1.
*/
adjust = 255 - cp[nc];
- switch (nc) {
- case 4: c = *cp++ + adjust; PUTHEX(c,fd);
- case 3: c = *cp++ + adjust; PUTHEX(c,fd);
- case 2: c = *cp++ + adjust; PUTHEX(c,fd);
- case 1: c = *cp++ + adjust; PUTHEX(c,fd);
- }
+ for (int i = 0; i < nc; ++i)
+ {
+ c = *cp++ + adjust;
+ puthex(c,fd);
+ }
cp += es;
}
} else {
@@ -2523,12 +2521,11 @@ PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
*/
for (cc = 0; (cc + nc) <= tf_bytesperrow; cc += samplesperpixel) {
DOBREAK(breaklen, nc, fd);
- switch (nc) {
- case 4: c = *cp++; PUTHEX(c,fd);
- case 3: c = *cp++; PUTHEX(c,fd);
- case 2: c = *cp++; PUTHEX(c,fd);
- case 1: c = *cp++; PUTHEX(c,fd);
- }
+ for (int i = 0; i < nc; ++i)
+ {
+ c = *cp++;
+ puthex(c,fd);
+ }
cp += es;
}
}
@@ -2537,9 +2534,9 @@ PSDataColorContig(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
}
void
-PSDataColorSeparate(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
+PSDataColorSeparate(FILE* fd, TIFF* tif, uint32_t w, uint32_t h, int nc)
{
- uint32 row;
+ uint32_t row;
int breaklen = MAXLINE;
tsize_t cc;
tsample_t s, maxs;
@@ -2556,25 +2553,26 @@ PSDataColorSeparate(FILE* fd, TIFF* tif, uint32 w, uint32 h, int nc)
for (row = 0; row < h; row++) {
for (s = 0; s < maxs; s++) {
if (TIFFReadScanline(tif, tf_buf, row, s) < 0)
- break;
+ goto end_loop;
for (cp = tf_buf, cc = 0; cc < tf_bytesperrow; cc++) {
DOBREAK(breaklen, 1, fd);
c = *cp++;
- PUTHEX(c,fd);
+ puthex(c,fd);
}
}
}
+end_loop:
_TIFFfree((char *) tf_buf);
}
#define PUTRGBHEX(c,fd) \
- PUTHEX(rmap[c],fd); PUTHEX(gmap[c],fd); PUTHEX(bmap[c],fd)
+ puthex(rmap[c],fd); puthex(gmap[c],fd); puthex(bmap[c],fd)
void
-PSDataPalette(FILE* fd, TIFF* tif, uint32 w, uint32 h)
+PSDataPalette(FILE* fd, TIFF* tif, uint32_t w, uint32_t h)
{
- uint16 *rmap, *gmap, *bmap;
- uint32 row;
+ uint16_t *rmap, *gmap, *bmap;
+ uint32_t row;
int breaklen = MAXLINE, nc;
tsize_t cc;
unsigned char *tf_buf;
@@ -2589,7 +2587,7 @@ PSDataPalette(FILE* fd, TIFF* tif, uint32 w, uint32 h)
case 8: case 4: case 2: case 1:
break;
default:
- TIFFError(filename, "Depth %d not supported", bitspersample);
+ TIFFError(filename, "Depth %"PRIu16" not supported", bitspersample);
return;
}
nc = 3 * (8 / bitspersample);
@@ -2610,7 +2608,7 @@ PSDataPalette(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
for (row = 0; row < h; row++) {
if (TIFFReadScanline(tif, tf_buf, row, 0) < 0)
- break;
+ goto end_loop;
for (cp = tf_buf, cc = 0; cc < tf_bytesperrow; cc++) {
DOBREAK(breaklen, nc, fd);
switch (bitspersample) {
@@ -2640,11 +2638,12 @@ PSDataPalette(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
}
}
+end_loop:
_TIFFfree((char *) tf_buf);
}
void
-PSDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
+PSDataBW(FILE* fd, TIFF* tif, uint32_t w, uint32_t h)
{
int breaklen = MAXLINE;
unsigned char* tf_buf;
@@ -2654,7 +2653,7 @@ PSDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
#if defined( EXP_ASCII85ENCODER )
tsize_t ascii85_l; /* Length, in bytes, of ascii85_p[] data */
- uint8 *ascii85_p = 0; /* Holds ASCII85 encoded data */
+ uint8_t *ascii85_p = 0; /* Holds ASCII85 encoded data */
#endif
(void) w; (void) h;
@@ -2744,14 +2743,14 @@ PSDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
* where Cback = 1.
*/
adjust = 255 - cp[1];
- c = *cp++ + adjust; PUTHEX(c,fd);
+ c = *cp++ + adjust; puthex(c,fd);
cp++, cc--;
}
} else {
while (cc-- > 0) {
c = *cp++;
DOBREAK(breaklen, 1, fd);
- PUTHEX(c, fd);
+ puthex(c, fd);
}
}
}
@@ -2774,20 +2773,20 @@ PSDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
}
void
-PSRawDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
+PSRawDataBW(FILE* fd, TIFF* tif, uint32_t w, uint32_t h)
{
- uint64 *bc;
- uint32 bufsize;
+ uint64_t *bc;
+ uint32_t bufsize;
int breaklen = MAXLINE;
tmsize_t cc;
- uint16 fillorder;
+ uint16_t fillorder;
unsigned char *tf_buf;
unsigned char *cp, c;
tstrip_t s;
#if defined( EXP_ASCII85ENCODER )
tsize_t ascii85_l; /* Length, in bytes, of ascii85_p[] data */
- uint8 * ascii85_p = 0; /* Holds ASCII85 encoded data */
+ uint8_t * ascii85_p = 0; /* Holds ASCII85 encoded data */
#endif
(void) w; (void) h;
@@ -2798,11 +2797,11 @@ PSRawDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
* Find largest strip:
*/
- bufsize = (uint32) bc[0];
+ bufsize = (uint32_t) bc[0];
for ( s = 0; ++s < tf_numberstrips; ) {
if ( bc[s] > bufsize )
- bufsize = (uint32) bc[s];
+ bufsize = (uint32_t) bc[s];
}
tf_buf = (unsigned char*) limitMalloc(bufsize);
@@ -2845,7 +2844,7 @@ PSRawDataBW(FILE* fd, TIFF* tif, uint32 w, uint32 h)
for (cp = tf_buf; cc > 0; cc--) {
DOBREAK(breaklen, 1, fd);
c = *cp++;
- PUTHEX(c, fd);
+ puthex(c, fd);
}
fputs(">\n", fd);
breaklen = MAXLINE;
@@ -2882,12 +2881,12 @@ static char*
Ascii85Encode(unsigned char* raw)
{
static char encoded[6];
- uint32 word;
+ uint32_t word;
word = (((raw[0]<<8)+raw[1])<<16) + (raw[2]<<8) + raw[3];
if (word != 0L) {
- uint32 q;
- uint16 w1;
+ uint32_t q;
+ uint16_t w1;
q = word / (85L*85*85*85); /* actually only a byte */
encoded[0] = (char) (q + '!');
@@ -2898,7 +2897,7 @@ Ascii85Encode(unsigned char* raw)
word -= q * (85L*85*85); q = word / (85*85);
encoded[2] = (char) (q + '!');
- w1 = (uint16) (word - q*(85L*85));
+ w1 = (uint16_t) (word - q * (85L * 85));
encoded[3] = (char) ((w1 / 85) + '!');
encoded[4] = (char) ((w1 % 85) + '!');
encoded[5] = '\0';
@@ -2984,13 +2983,13 @@ Ascii85Flush(FILE* fd)
*
*****************************************************************************/
-tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw_p, tsize_t raw_l )
+tsize_t Ascii85EncodeBlock(uint8_t * ascii85_p, unsigned f_eod, const uint8_t * raw_p, tsize_t raw_l )
{
char ascii85[5]; /* Encoded 5 tuple */
tsize_t ascii85_l; /* Number of bytes written to ascii85_p[] */
int rc; /* Return code */
- uint32 val32; /* Unencoded 4 tuple */
+ uint32_t val32; /* Unencoded 4 tuple */
ascii85_l = 0; /* Nothing written yet */
@@ -3000,10 +2999,10 @@ tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw
for ( ; raw_l > 3; raw_l -= 4 )
{
- val32 = (uint32)*(++raw_p) << 24;
- val32 += (uint32)*(++raw_p) << 16;
- val32 += (uint32)*(++raw_p) << 8;
- val32 += (uint32)*(++raw_p);
+ val32 = (uint32_t)*(++raw_p) << 24;
+ val32 += (uint32_t)*(++raw_p) << 16;
+ val32 += (uint32_t)*(++raw_p) << 8;
+ val32 += (uint32_t)*(++raw_p);
if ( val32 == 0 ) /* Special case */
{
@@ -3048,7 +3047,7 @@ tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw
tsize_t len; /* Output this many bytes */
len = raw_l + 1;
- val32 = (uint32)*++raw_p << 24; /* Prime the pump */
+ val32 = (uint32_t)*++raw_p << 24; /* Prime the pump */
if ( --raw_l > 0 ) val32 += *(++raw_p) << 16;
if ( --raw_l > 0 ) val32 += *(++raw_p) << 8;
@@ -3087,52 +3086,50 @@ tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw
#endif /* EXP_ASCII85ENCODER */
-const char* stuff[] = {
-"usage: tiff2ps [options] input.tif ...",
-"where options are:",
-" -1 generate PostScript Level 1 (default)",
-" -2 generate PostScript Level 2",
-" -3 generate PostScript Level 3",
-" -8 disable use of ASCII85 encoding with PostScript Level 2/3",
-" -a convert all directories in file (default is first), Not EPS",
-" -b # set the bottom margin to # inches",
-" -c center image (-b and -l still add to this)",
-" -C name set postscript document creator name",
-" -d # set initial directory to # counting from zero",
-" -D enable duplex printing (two pages per sheet of paper)",
-" -e generate Encapsulated PostScript (EPS) (implies -z)",
-" -h # set printed page height to # inches (no default)",
-" -w # set printed page width to # inches (no default)",
-" -H # split image if height is more than # inches",
-" -W # split image if width is more than # inches",
-" -L # overLap split images by # inches",
-" -i # enable/disable (Nz/0) pixel interpolation (default: enable)",
-" -l # set the left margin to # inches",
-" -m use \"imagemask\" operator instead of \"image\"",
-" -M size set the memory allocation limit in MiB. 0 to disable limit",
-" -o # convert directory at file offset # bytes",
-" -O file write PostScript to file instead of standard output",
-" -p generate regular (non-encapsulated) PostScript",
-" -P L or P set optional PageOrientation DSC comment to Landscape or Portrait",
-" -r # or auto rotate by 90, 180, 270 degrees or auto",
-" -s generate PostScript for a single image",
-" -t name set postscript document title. Otherwise the filename is used",
-" -T print pages for top edge binding",
-" -x override resolution units as centimeters",
-" -y override resolution units as inches",
-" -z enable printing in the deadzone (only for PostScript Level 2/3)",
-NULL
-};
+static const char usage_info[] =
+"Convert a TIFF image to PostScript\n\n"
+"usage: tiff2ps [options] input.tif ...\n"
+"where options are:\n"
+" -1 generate PostScript Level 1 (default)\n"
+" -2 generate PostScript Level 2\n"
+" -3 generate PostScript Level 3\n"
+" -8 disable use of ASCII85 encoding with PostScript Level 2/3\n"
+" -a convert all directories in file (default is first), Not EPS\n"
+" -b # set the bottom margin to # inches\n"
+" -c center image (-b and -l still add to this)\n"
+" -C name set postscript document creator name\n"
+" -d # set initial directory to # counting from zero\n"
+" -D enable duplex printing (two pages per sheet of paper)\n"
+" -e generate Encapsulated PostScript (EPS) (implies -z)\n"
+" -h # set printed page height to # inches (no default)\n"
+" -w # set printed page width to # inches (no default)\n"
+" -H # split image if height is more than # inches\n"
+" -W # split image if width is more than # inches\n"
+" -L # overLap split images by # inches\n"
+" -i # enable/disable (Nz/0) pixel interpolation (default: enable)\n"
+" -l # set the left margin to # inches\n"
+" -m use \"imagemask\" operator instead of \"image\"\n"
+" -M size set the memory allocation limit in MiB. 0 to disable limit\n"
+" -o # convert directory at file offset # bytes\n"
+" -O file write PostScript to file instead of standard output\n"
+" -p generate regular (non-encapsulated) PostScript\n"
+" -P L or P set optional PageOrientation DSC comment to Landscape or Portrait\n"
+" -r # or auto rotate by 90, 180, 270 degrees or auto\n"
+" -s generate PostScript for a single image\n"
+" -t name set postscript document title. Otherwise the filename is used\n"
+" -T print pages for top edge binding\n"
+" -x override resolution units as centimeters\n"
+" -y override resolution units as inches\n"
+" -z enable printing in the deadzone (only for PostScript Level 2/3)\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
diff --git a/tiff/tools/tiff2rgba.c b/tiff/tools/tiff2rgba.c
index 764395f6..7077f946 100644
--- a/tiff/tools/tiff2rgba.c
+++ b/tiff/tools/tiff2rgba.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <string.h>
@@ -32,10 +33,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffiop.h"
#include "tiffio.h"
@@ -53,13 +50,13 @@
#ifndef howmany
#define howmany(x, y) (((x)+((y)-1))/(y))
#endif
-#define roundup(x, y) (howmany(x,y)*((uint32)(y)))
+#define roundup(x, y) (howmany(x,y)*((uint32_t)(y)))
-uint16 compression = COMPRESSION_PACKBITS;
-uint32 rowsperstrip = (uint32) -1;
-int process_by_block = 0; /* default is whole image at once */
-int no_alpha = 0;
-int bigtiff_output = 0;
+static uint16_t compression = COMPRESSION_PACKBITS;
+static uint32_t rowsperstrip = (uint32_t) -1;
+static int process_by_block = 0; /* default is whole image at once */
+static int no_alpha = 0;
+static int bigtiff_output = 0;
#define DEFAULT_MAX_MALLOC (256 * 1024 * 1024)
/* malloc size limit (in bytes)
* disabled when set to 0 */
@@ -122,9 +119,11 @@ main(int argc, char* argv[])
case 'h':
usage(EXIT_SUCCESS);
/*NOTREACHED*/
+ break;
case '?':
usage(EXIT_FAILURE);
/*NOTREACHED*/
+ break;
}
if (argc - optind < 2)
@@ -156,13 +155,13 @@ static int
cvt_by_tile( TIFF *in, TIFF *out )
{
- uint32* raster; /* retrieve RGBA image */
- uint32 width, height; /* image width & height */
- uint32 tile_width, tile_height;
- uint32 row, col;
- uint32 *wrk_line;
+ uint32_t* raster; /* retrieve RGBA image */
+ uint32_t width, height; /* image width & height */
+ uint32_t tile_width, tile_height;
+ uint32_t row, col;
+ uint32_t *wrk_line;
int ok = 1;
- uint32 rastersize, wrk_linesize;
+ uint32_t rastersize, wrk_linesize;
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
@@ -179,13 +178,13 @@ cvt_by_tile( TIFF *in, TIFF *out )
/*
* Allocate tile buffer
*/
- rastersize = tile_width * tile_height * sizeof (uint32);
- if (tile_width != (rastersize / tile_height) / sizeof( uint32))
+ rastersize = tile_width * tile_height * sizeof (uint32_t);
+ if (tile_width != (rastersize / tile_height) / sizeof( uint32_t))
{
TIFFError(TIFFFileName(in), "Integer overflow when calculating raster buffer");
exit(EXIT_FAILURE);
}
- raster = (uint32*)_TIFFmalloc(rastersize);
+ raster = (uint32_t*)_TIFFmalloc(rastersize);
if (raster == 0) {
TIFFError(TIFFFileName(in), "No space for raster buffer");
return (0);
@@ -195,13 +194,13 @@ cvt_by_tile( TIFF *in, TIFF *out )
* Allocate a scanline buffer for swapping during the vertical
* mirroring pass.
*/
- wrk_linesize = tile_width * sizeof (uint32);
- if (tile_width != wrk_linesize / sizeof (uint32))
+ wrk_linesize = tile_width * sizeof (uint32_t);
+ if (tile_width != wrk_linesize / sizeof (uint32_t))
{
TIFFError(TIFFFileName(in), "Integer overflow when calculating wrk_line buffer");
exit(EXIT_FAILURE);
}
- wrk_line = (uint32*)_TIFFmalloc(wrk_linesize);
+ wrk_line = (uint32_t*)_TIFFmalloc(wrk_linesize);
if (!wrk_line) {
TIFFError(TIFFFileName(in), "No space for raster scanline buffer");
ok = 0;
@@ -214,7 +213,7 @@ cvt_by_tile( TIFF *in, TIFF *out )
{
for( col = 0; ok && col < width; col += tile_width )
{
- uint32 i_row;
+ uint32_t i_row;
/* Read the tile into an RGBA array */
if (!TIFFReadRGBATile(in, col, row, raster)) {
@@ -237,7 +236,7 @@ cvt_by_tile( TIFF *in, TIFF *out )
*/
for( i_row = 0; i_row < tile_height / 2; i_row++ )
{
- uint32 *top_line, *bottom_line;
+ uint32_t *top_line, *bottom_line;
top_line = raster + tile_width * i_row;
bottom_line = raster + tile_width * (tile_height-i_row-1);
@@ -272,12 +271,12 @@ static int
cvt_by_strip( TIFF *in, TIFF *out )
{
- uint32* raster; /* retrieve RGBA image */
- uint32 width, height; /* image width & height */
- uint32 row;
- uint32 *wrk_line;
+ uint32_t* raster; /* retrieve RGBA image */
+ uint32_t width, height; /* image width & height */
+ uint32_t row;
+ uint32_t *wrk_line;
int ok = 1;
- uint32 rastersize, wrk_linesize;
+ uint32_t rastersize, wrk_linesize;
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
@@ -292,13 +291,13 @@ cvt_by_strip( TIFF *in, TIFF *out )
/*
* Allocate strip buffer
*/
- rastersize = width * rowsperstrip * sizeof (uint32);
- if (width != (rastersize / rowsperstrip) / sizeof( uint32))
+ rastersize = width * rowsperstrip * sizeof (uint32_t);
+ if (width != (rastersize / rowsperstrip) / sizeof( uint32_t))
{
TIFFError(TIFFFileName(in), "Integer overflow when calculating raster buffer");
exit(EXIT_FAILURE);
}
- raster = (uint32*)_TIFFmalloc(rastersize);
+ raster = (uint32_t*)_TIFFmalloc(rastersize);
if (raster == 0) {
TIFFError(TIFFFileName(in), "No space for raster buffer");
return (0);
@@ -308,13 +307,13 @@ cvt_by_strip( TIFF *in, TIFF *out )
* Allocate a scanline buffer for swapping during the vertical
* mirroring pass.
*/
- wrk_linesize = width * sizeof (uint32);
- if (width != wrk_linesize / sizeof (uint32))
+ wrk_linesize = width * sizeof (uint32_t);
+ if (width != wrk_linesize / sizeof (uint32_t))
{
TIFFError(TIFFFileName(in), "Integer overflow when calculating wrk_line buffer");
exit(EXIT_FAILURE);
}
- wrk_line = (uint32*)_TIFFmalloc(wrk_linesize);
+ wrk_line = (uint32_t*)_TIFFmalloc(wrk_linesize);
if (!wrk_line) {
TIFFError(TIFFFileName(in), "No space for raster scanline buffer");
ok = 0;
@@ -356,7 +355,7 @@ cvt_by_strip( TIFF *in, TIFF *out )
for( i_row = 0; i_row < rows_to_write / 2; i_row++ )
{
- uint32 *top_line, *bottom_line;
+ uint32_t *top_line, *bottom_line;
top_line = raster + width * i_row;
bottom_line = raster + width * (rows_to_write-i_row-1);
@@ -396,9 +395,9 @@ static int
cvt_whole_image( TIFF *in, TIFF *out )
{
- uint32* raster; /* retrieve RGBA image */
- uint32 width, height; /* image width & height */
- uint32 row;
+ uint32_t* raster; /* retrieve RGBA image */
+ uint32_t width, height; /* image width & height */
+ uint32_t row;
size_t pixel_count;
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
@@ -408,24 +407,24 @@ cvt_whole_image( TIFF *in, TIFF *out )
/* XXX: Check the integer overflow. */
if (!width || !height || pixel_count / width != height) {
TIFFError(TIFFFileName(in),
- "Malformed input file; can't allocate buffer for raster of %lux%lu size",
- (unsigned long)width, (unsigned long)height);
+ "Malformed input file; can't allocate buffer for raster of %"PRIu32"x%"PRIu32" size",
+ width, height);
return 0;
}
- if (maxMalloc != 0 && (tmsize_t)pixel_count * (tmsize_t)sizeof(uint32) > maxMalloc) {
+ if (maxMalloc != 0 && (tmsize_t)pixel_count * (tmsize_t)sizeof(uint32_t) > maxMalloc) {
TIFFError(TIFFFileName(in),
- "Raster size " TIFF_UINT64_FORMAT " over memory limit (" TIFF_UINT64_FORMAT "), try -b option.",
- (uint64)pixel_count * sizeof(uint32), (uint64)maxMalloc);
+ "Raster size %"TIFF_SIZE_FORMAT" over memory limit (%" TIFF_SSIZE_FORMAT "), try -b option.",
+ pixel_count * sizeof(uint32_t), maxMalloc);
return 0;
}
rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
- raster = (uint32*)_TIFFCheckMalloc(in, pixel_count, sizeof(uint32), "raster buffer");
+ raster = (uint32_t*)_TIFFCheckMalloc(in, pixel_count, sizeof(uint32_t), "raster buffer");
if (raster == 0) {
- TIFFError(TIFFFileName(in), "Failed to allocate buffer (%lu elements of %lu each)",
- (unsigned long)pixel_count, (unsigned long)sizeof(uint32));
+ TIFFError(TIFFFileName(in), "Failed to allocate buffer (%"TIFF_SIZE_FORMAT" elements of %"TIFF_SIZE_FORMAT" each)",
+ pixel_count, sizeof(uint32_t));
return (0);
}
@@ -505,12 +504,12 @@ cvt_whole_image( TIFF *in, TIFF *out )
static int
tiffcvt(TIFF* in, TIFF* out)
{
- uint32 width, height; /* image width & height */
- uint16 shortv;
+ uint32_t width, height; /* image width & height */
+ uint16_t shortv;
float floatv;
char *stringv;
- uint32 longv;
- uint16 v[1];
+ uint32_t longv;
+ uint16_t v[1];
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &height);
@@ -546,8 +545,8 @@ tiffcvt(TIFF* in, TIFF* out)
if (maxMalloc != 0 && TIFFStripSize(in) > maxMalloc)
{
TIFFError(TIFFFileName(in),
- "Strip Size " TIFF_UINT64_FORMAT " over memory limit (" TIFF_UINT64_FORMAT ")",
- (uint64)TIFFStripSize(in), (uint64)maxMalloc);
+ "Strip Size %" TIFF_SSIZE_FORMAT " over memory limit (%" TIFF_SSIZE_FORMAT ")",
+ TIFFStripSize(in), maxMalloc);
return 0;
}
if( process_by_block && TIFFIsTiled( in ) )
@@ -558,32 +557,44 @@ tiffcvt(TIFF* in, TIFF* out)
return( cvt_whole_image( in, out ) );
}
-static const char* stuff[] = {
- "usage: tiff2rgba [-c comp] [-r rows] [-b] [-n] [-8] [-M size] input... output",
- "where comp is one of the following compression algorithms:",
- " jpeg\t\tJPEG encoding",
- " zip\t\tZip/Deflate encoding",
- " lzw\t\tLempel-Ziv & Welch encoding",
- " packbits\tPackBits encoding",
- " none\t\tno compression",
- "and the other options are:",
- " -r\trows/strip",
- " -b (progress by block rather than as a whole image)",
- " -n don't emit alpha component.",
- " -8 write BigTIFF file instead of ClassicTIFF",
- " -M set the memory allocation limit in MiB. 0 to disable limit",
- NULL
-};
+static const char usage_info[] =
+/* Help information format modified for the sake of consistency with the other tiff tools */
+/* "usage: tiff2rgba [-c comp] [-r rows] [-b] [-n] [-8] [-M size] input... output" */
+/* "where comp is one of the following compression algorithms:" */
+"Convert a TIFF image to RGBA color space\n\n"
+"usage: tiff2rgba [options] input output\n"
+"where options are:\n"
+#ifdef JPEG_SUPPORT
+" -c jpeg JPEG encoding\n"
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip Zip/Deflate encoding\n"
+#endif
+#ifdef LZW_SUPPORT
+" -c lzw Lempel-Ziv & Welch encoding\n"
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits PackBits encoding\n"
+#endif
+#if defined(JPEG_SUPPORT) || defined(ZIP_SUPPORT) || defined(LZW_SUPPORT) || defined(PACKBITS_SUPPORT)
+" -c none no compression\n"
+#endif
+"\n"
+/* "and the other options are:\n" */
+" -r rows/strip\n"
+" -b (progress by block rather than as a whole image)\n"
+" -n don't emit alpha component.\n"
+" -8 write BigTIFF file instead of ClassicTIFF\n"
+" -M set the memory allocation limit in MiB. 0 to disable limit\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
diff --git a/tiff/tools/tiffcmp.c b/tiff/tools/tiffcmp.c
index 041d6a2d..2a35fe60 100644
--- a/tiff/tools/tiffcmp.c
+++ b/tiff/tools/tiffcmp.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -33,10 +34,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffio.h"
#ifndef EXIT_SUCCESS
@@ -46,27 +43,23 @@
#define EXIT_FAILURE 1
#endif
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
static int stopondiff = 1;
static int stoponfirsttag = 1;
-static uint16 bitspersample = 1;
-static uint16 samplesperpixel = 1;
-static uint16 sampleformat = SAMPLEFORMAT_UINT;
-static uint32 imagewidth;
-static uint32 imagelength;
+static uint16_t bitspersample = 1;
+static uint16_t samplesperpixel = 1;
+static uint16_t sampleformat = SAMPLEFORMAT_UINT;
+static uint32_t imagewidth;
+static uint32_t imagelength;
static void usage(int code);
static int tiffcmp(TIFF*, TIFF*);
static int cmptags(TIFF*, TIFF*);
-static int ContigCompare(int, uint32, unsigned char*, unsigned char*, tsize_t);
-static int SeparateCompare(int, int, uint32, unsigned char*, unsigned char*);
-static void PrintIntDiff(uint32, int, uint32, uint32, uint32);
-static void PrintFloatDiff(uint32, int, uint32, double, double);
+static int ContigCompare(int, uint32_t, unsigned char*, unsigned char*, tsize_t);
+static int SeparateCompare(int, int, uint32_t, unsigned char*, unsigned char*);
+static void PrintIntDiff(uint32_t, int, uint32_t, uint32_t, uint32_t);
+static void PrintFloatDiff(uint32_t, int, uint32_t, double, double);
-static void leof(const char*, uint32, int);
+static void leof(const char*, uint32_t, int);
/*
* exit with status :
@@ -97,9 +90,11 @@ main(int argc, char* argv[])
break;
case 'h':
usage(EXIT_SUCCESS);
+ break;
case '?':
usage(2);
/*NOTREACHED*/
+ break;
}
if (argc - optind < 2)
usage(2);
@@ -130,24 +125,22 @@ main(int argc, char* argv[])
return (0);
}
-static const char* stuff[] = {
-"usage: tiffcmp [options] file1 file2",
-"where options are:",
-" -l list each byte of image data that differs between the files",
-" -z # list specified number of bytes that differs between the files",
-" -t ignore any differences in directory tags",
-NULL
-};
+static const char usage_info[] =
+"Compare the tags and data in two TIFF files\n\n"
+"usage: tiffcmp [options] file1 file2\n"
+"where options are:\n"
+" -l list each byte of image data that differs between the files\n"
+" -z # list specified number of bytes that differs between the files\n"
+" -t ignore any differences in directory tags\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
@@ -166,9 +159,9 @@ static int CheckStringTag(TIFF*, TIFF*, int, char*);
static int
tiffcmp(TIFF* tif1, TIFF* tif2)
{
- uint16 config1, config2;
+ uint16_t config1, config2;
tsize_t size1;
- uint32 row;
+ uint32_t row;
tsample_t s;
unsigned char *buf1, *buf2;
@@ -274,7 +267,7 @@ bad1:
static int
cmptags(TIFF* tif1, TIFF* tif2)
{
- uint16 compression1, compression2;
+ uint16_t compression1, compression2;
CmpLongField(TIFFTAG_SUBFILETYPE, "SubFileType");
CmpLongField(TIFFTAG_IMAGEWIDTH, "ImageWidth");
CmpLongField(TIFFTAG_IMAGELENGTH, "ImageLength");
@@ -313,13 +306,13 @@ cmptags(TIFF* tif1, TIFF* tif2)
CmpShortField(TIFFTAG_GRAYRESPONSEUNIT, "GrayResponseUnit");
CmpShortField(TIFFTAG_COLORRESPONSEUNIT, "ColorResponseUnit");
#ifdef notdef
- { uint16 *graycurve;
+ { uint16_t *graycurve;
CmpField(TIFFTAG_GRAYRESPONSECURVE, graycurve);
}
- { uint16 *red, *green, *blue;
+ { uint16_t *red, *green, *blue;
CmpField3(TIFFTAG_COLORRESPONSECURVE, red, green, blue);
}
- { uint16 *red, *green, *blue;
+ { uint16_t *red, *green, *blue;
CmpField3(TIFFTAG_COLORMAP, red, green, blue);
}
#endif
@@ -339,11 +332,10 @@ cmptags(TIFF* tif1, TIFF* tif2)
}
static int
-ContigCompare(int sample, uint32 row,
- unsigned char* p1, unsigned char* p2, tsize_t size)
+ContigCompare(int sample, uint32_t row,
+ unsigned char* p1, unsigned char* p2, tsize_t size)
{
- uint32 pix;
- int ppb = 8 / bitspersample;
+ uint32_t pix;
int samples_to_test;
if (memcmp(p1, p2, size) == 0)
@@ -355,9 +347,10 @@ ContigCompare(int sample, uint32 row,
case 1: case 2: case 4: case 8:
{
unsigned char *pix1 = p1, *pix2 = p2;
+ unsigned bits = 0;
- for (pix = 0; pix < imagewidth; pix += ppb) {
- int s;
+ for (pix = 0; pix < imagewidth; pix++) {
+ int s;
for(s = 0; s < samples_to_test; s++) {
if (*pix1 != *pix2) {
@@ -367,15 +360,17 @@ ContigCompare(int sample, uint32 row,
PrintIntDiff(row, sample, pix, *pix1, *pix2);
}
- pix1++;
- pix2++;
+ bits += bitspersample;
+ pix1 += (bits / 8);
+ pix2 += (bits / 8);
+ bits &= 7;
}
}
break;
}
case 16:
{
- uint16 *pix1 = (uint16 *)p1, *pix2 = (uint16 *)p2;
+ uint16_t *pix1 = (uint16_t *)p1, *pix2 = (uint16_t *)p2;
for (pix = 0; pix < imagewidth; pix++) {
int s;
@@ -393,7 +388,7 @@ ContigCompare(int sample, uint32 row,
case 32:
if (sampleformat == SAMPLEFORMAT_UINT
|| sampleformat == SAMPLEFORMAT_INT) {
- uint32 *pix1 = (uint32 *)p1, *pix2 = (uint32 *)p2;
+ uint32_t *pix1 = (uint32_t *)p1, *pix2 = (uint32_t *)p2;
for (pix = 0; pix < imagewidth; pix++) {
int s;
@@ -425,13 +420,13 @@ ContigCompare(int sample, uint32 row,
}
}
} else {
- fprintf(stderr, "Sample format %d is not supported.\n",
+ fprintf(stderr, "Sample format %"PRIu16" is not supported.\n",
sampleformat);
return -1;
}
break;
default:
- fprintf(stderr, "Bit depth %d is not supported.\n", bitspersample);
+ fprintf(stderr, "Bit depth %"PRIu16" is not supported.\n", bitspersample);
return -1;
}
@@ -439,7 +434,7 @@ ContigCompare(int sample, uint32 row,
}
static void
-PrintIntDiff(uint32 row, int sample, uint32 pix, uint32 w1, uint32 w2)
+PrintIntDiff(uint32_t row, int sample, uint32_t pix, uint32_t w1, uint32_t w2)
{
if (sample < 0)
sample = 0;
@@ -448,22 +443,22 @@ PrintIntDiff(uint32 row, int sample, uint32 pix, uint32 w1, uint32 w2)
case 2:
case 4:
{
- int32 mask1, mask2, s;
+ int32_t mask1, mask2, s;
/* mask1 should have the n lowest bits set, where n == bitspersample */
- mask1 = ((int32)1 << bitspersample) - 1;
+ mask1 = ((int32_t)1 << bitspersample) - 1;
s = (8 - bitspersample);
mask2 = mask1 << s;
for (; mask2 && pix < imagewidth;
mask2 >>= bitspersample, s -= bitspersample, pix++) {
if ((w1 & mask2) ^ (w2 & mask2)) {
printf(
- "Scanline %lu, pixel %lu, sample %d: %01x %01x\n",
- (unsigned long) row,
- (unsigned long) pix,
+ "Scanline %"PRIu32", pixel %"PRIu32", sample %d: %01"PRIx32" %01"PRIx32"\n",
+ row,
+ pix,
sample,
- (unsigned int)((w1 >> s) & mask1),
- (unsigned int)((w2 >> s) & mask1));
+ (w1 >> s) & mask1,
+ (w2 >> s) & mask1);
if (--stopondiff == 0)
exit(1);
}
@@ -471,23 +466,23 @@ PrintIntDiff(uint32 row, int sample, uint32 pix, uint32 w1, uint32 w2)
break;
}
case 8:
- printf("Scanline %lu, pixel %lu, sample %d: %02x %02x\n",
- (unsigned long) row, (unsigned long) pix, sample,
- (unsigned int) w1, (unsigned int) w2);
+ printf("Scanline %"PRIu32", pixel %"PRIu32", sample %d: %02"PRIx32" %02"PRIx32"\n",
+ row, pix, sample,
+ w1, w2);
if (--stopondiff == 0)
exit(1);
break;
case 16:
- printf("Scanline %lu, pixel %lu, sample %d: %04x %04x\n",
- (unsigned long) row, (unsigned long) pix, sample,
- (unsigned int) w1, (unsigned int) w2);
+ printf("Scanline %"PRIu32", pixel %"PRIu32", sample %d: %04"PRIx32" %04"PRIx32"\n",
+ row, pix, sample,
+ w1, w2);
if (--stopondiff == 0)
exit(1);
break;
case 32:
- printf("Scanline %lu, pixel %lu, sample %d: %08x %08x\n",
- (unsigned long) row, (unsigned long) pix, sample,
- (unsigned int) w1, (unsigned int) w2);
+ printf("Scanline %"PRIu32", pixel %"PRIu32", sample %d: %08"PRIx32" %08"PRIx32"\n",
+ row, pix, sample,
+ w1, w2);
if (--stopondiff == 0)
exit(1);
break;
@@ -497,14 +492,14 @@ PrintIntDiff(uint32 row, int sample, uint32 pix, uint32 w1, uint32 w2)
}
static void
-PrintFloatDiff(uint32 row, int sample, uint32 pix, double w1, double w2)
+PrintFloatDiff(uint32_t row, int sample, uint32_t pix, double w1, double w2)
{
if (sample < 0)
sample = 0;
switch (bitspersample) {
case 32:
- printf("Scanline %lu, pixel %lu, sample %d: %g %g\n",
- (long) row, (long) pix, sample, w1, w2);
+ printf("Scanline %"PRIu32", pixel %"PRIu32", sample %d: %g %g\n",
+ row, pix, sample, w1, w2);
if (--stopondiff == 0)
exit(1);
break;
@@ -514,17 +509,17 @@ PrintFloatDiff(uint32 row, int sample, uint32 pix, double w1, double w2)
}
static int
-SeparateCompare(int reversed, int sample, uint32 row,
- unsigned char* cp1, unsigned char* p2)
+SeparateCompare(int reversed, int sample, uint32_t row,
+ unsigned char* cp1, unsigned char* p2)
{
- uint32 npixels = imagewidth;
+ uint32_t npixels = imagewidth;
int pixel;
cp1 += sample;
for (pixel = 0; npixels-- > 0; pixel++, cp1 += samplesperpixel, p2++) {
if (*cp1 != *p2) {
- printf("Scanline %lu, pixel %lu, sample %ld: ",
- (long) row, (long) pixel, (long) sample);
+ printf("Scanline %"PRIu32", pixel %"PRIu32", sample %d: ",
+ row, pixel, sample);
if (reversed)
printf("%02x %02x\n", *p2, *cp1);
else
@@ -567,14 +562,14 @@ checkTag(TIFF* tif1, TIFF* tif2, int tag, char* name, void* p1, void* p2)
static int
CheckShortTag(TIFF* tif1, TIFF* tif2, int tag, char* name)
{
- uint16 v1, v2;
- CHECK(v1 == v2, "%s: %u %u\n");
+ uint16_t v1, v2;
+ CHECK(v1 == v2, "%s: %"PRIu16" %"PRIu16"\n");
}
static int
CheckShort2Tag(TIFF* tif1, TIFF* tif2, int tag, char* name)
{
- uint16 v11, v12, v21, v22;
+ uint16_t v11, v12, v21, v22;
if (TIFFGetField(tif1, tag, &v11, &v12)) {
if (!TIFFGetField(tif2, tag, &v21, &v22)) {
@@ -584,7 +579,7 @@ CheckShort2Tag(TIFF* tif1, TIFF* tif2, int tag, char* name)
}
if (v11 == v21 && v12 == v22)
return (1);
- printf("%s: <%u,%u> <%u,%u>\n", name, v11, v12, v21, v22);
+ printf("%s: <%"PRIu16",%"PRIu16"> <%"PRIu16",%"PRIu16">\n", name, v11, v12, v21, v22);
} else if (TIFFGetField(tif2, tag, &v21, &v22))
printf("%s tag appears only in %s\n", name, TIFFFileName(tif2));
else
@@ -595,8 +590,8 @@ CheckShort2Tag(TIFF* tif1, TIFF* tif2, int tag, char* name)
static int
CheckShortArrayTag(TIFF* tif1, TIFF* tif2, int tag, char* name)
{
- uint16 n1, *a1;
- uint16 n2, *a2;
+ uint16_t n1, *a1;
+ uint16_t n2, *a2;
if (TIFFGetField(tif1, tag, &n1, &a1)) {
if (!TIFFGetField(tif2, tag, &n2, &a2)) {
@@ -606,21 +601,21 @@ CheckShortArrayTag(TIFF* tif1, TIFF* tif2, int tag, char* name)
}
if (n1 == n2) {
char* sep;
- uint16 i;
+ uint16_t i;
- if (memcmp(a1, a2, n1 * sizeof(uint16)) == 0)
+ if (memcmp(a1, a2, n1 * sizeof(uint16_t)) == 0)
return (1);
- printf("%s: value mismatch, <%u:", name, n1);
+ printf("%s: value mismatch, <%"PRIu16":", name, n1);
sep = "";
for (i = 0; i < n1; i++)
- printf("%s%u", sep, a1[i]), sep = ",";
- printf("> and <%u: ", n2);
+ printf("%s%"PRIu16, sep, a1[i]), sep = ",";
+ printf("> and <%"PRIu16": ", n2);
sep = "";
for (i = 0; i < n2; i++)
- printf("%s%u", sep, a2[i]), sep = ",";
+ printf("%s%"PRIu16, sep, a2[i]), sep = ",";
printf(">\n");
} else
- printf("%s: %u items in %s, %u items in %s", name,
+ printf("%s: %"PRIu16" items in %s, %"PRIu16" items in %s", name,
n1, TIFFFileName(tif1),
n2, TIFFFileName(tif2)
);
@@ -634,8 +629,8 @@ CheckShortArrayTag(TIFF* tif1, TIFF* tif2, int tag, char* name)
static int
CheckLongTag(TIFF* tif1, TIFF* tif2, int tag, char* name)
{
- uint32 v1, v2;
- CHECK(v1 == v2, "%s: %u %u\n");
+ uint32_t v1, v2;
+ CHECK(v1 == v2, "%s: %"PRIu32" %"PRIu32"\n");
}
static int
@@ -653,10 +648,10 @@ CheckStringTag(TIFF* tif1, TIFF* tif2, int tag, char* name)
}
static void
-leof(const char* name, uint32 row, int s)
+leof(const char* name, uint32_t row, int s)
{
- printf("%s: EOF at scanline %lu", name, (unsigned long)row);
+ printf("%s: EOF at scanline %"PRIu32, name, row);
if (s >= 0)
printf(", sample %d", s);
printf("\n");
diff --git a/tiff/tools/tiffcp.c b/tiff/tools/tiffcp.c
index e56b1c10..1f889516 100644
--- a/tiff/tools/tiffcp.c
+++ b/tiff/tools/tiffcp.c
@@ -37,6 +37,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -58,14 +59,6 @@
#define EXIT_FAILURE 1
#endif
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
-#if defined(VMS)
-# define unlink delete
-#endif
-
#define streq(a,b) (strcmp(a,b) == 0)
#define strneq(a,b,n) (strncmp(a,b,n) == 0)
@@ -79,23 +72,24 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
static tmsize_t maxMalloc = DEFAULT_MAX_MALLOC;
static int outtiled = -1;
-static uint32 tilewidth;
-static uint32 tilelength;
+static uint32_t tilewidth;
+static uint32_t tilelength;
-static uint16 config;
-static uint16 compression;
-static uint16 predictor;
+static uint16_t config;
+static uint16_t compression;
+static double max_z_error = 0.0;
+static uint16_t predictor;
static int preset;
-static uint16 fillorder;
-static uint16 orientation;
-static uint32 rowsperstrip;
-static uint32 g3opts;
+static uint16_t fillorder;
+static uint16_t orientation;
+static uint32_t rowsperstrip;
+static uint32_t g3opts;
static int ignore = FALSE; /* if true, ignore read errors */
-static uint32 defg3opts = (uint32) -1;
+static uint32_t defg3opts = (uint32_t) -1;
static int quality = 75; /* JPEG quality */
static int jpegcolormode = JPEGCOLORMODE_RGB;
-static uint16 defcompression = (uint16) -1;
-static uint16 defpredictor = (uint16) -1;
+static uint16_t defcompression = (uint16_t) -1;
+static uint16_t defpredictor = (uint16_t) -1;
static int defpreset = -1;
static int subcodec = -1;
@@ -114,8 +108,8 @@ static int pageInSeq = 0;
static void* limitMalloc(tmsize_t s)
{
if (maxMalloc && (s > maxMalloc)) {
- fprintf(stderr, "MemoryLimitError: allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ".\n",
- (uint64)s, (uint64)maxMalloc);
+ fprintf(stderr, "MemoryLimitError: allocation of %" TIFF_SSIZE_FORMAT " bytes is forbidden. Limit is %" TIFF_SSIZE_FORMAT ".\n",
+ s, maxMalloc);
fprintf(stderr, " use -m option to change limit.\n");
return NULL;
}
@@ -146,8 +140,8 @@ static int nextSrcImage (TIFF *tif, char **imageSpec)
}
}
if (TIFFSetDirectory (tif, nextImage)) return 1;
- fprintf (stderr, "%s%c%d not found!\n",
- TIFFFileName(tif), comma, (int) nextImage);
+ fprintf (stderr, "%s%c%"PRIu16" not found!\n",
+ TIFFFileName(tif), comma, nextImage);
}
return 0;
}
@@ -185,12 +179,12 @@ static TIFF* openSrcImage (char **imageSpec)
int
main(int argc, char* argv[])
{
- uint16 defconfig = (uint16) -1;
- uint16 deffillorder = 0;
- uint32 deftilewidth = (uint32) -1;
- uint32 deftilelength = (uint32) -1;
- uint32 defrowsperstrip = (uint32) 0;
- uint64 diroff = 0;
+ uint16_t defconfig = (uint16_t) -1;
+ uint16_t deffillorder = 0;
+ uint32_t deftilewidth = (uint32_t) -1;
+ uint32_t deftilelength = (uint32_t) -1;
+ uint32_t defrowsperstrip = (uint32_t) 0;
+ uint64_t diroff = 0;
TIFF* in;
TIFF* out;
char mode[10];
@@ -218,7 +212,7 @@ main(int argc, char* argv[])
exit (EXIT_FAILURE);
}
{
- uint16 samples = (uint16) -1;
+ uint16_t samples = (uint16_t) -1;
char **biasFn = &optarg;
bias = openSrcImage (biasFn);
if (!bias) exit (EXIT_FAILURE);
@@ -300,9 +294,11 @@ main(int argc, char* argv[])
case 'h':
usage(EXIT_SUCCESS);
/*NOTREACHED*/
+ break;
case '?':
usage(EXIT_FAILURE);
/*NOTREACHED*/
+ break;
}
if (argc - optind < 2)
usage(EXIT_FAILURE);
@@ -320,7 +316,7 @@ main(int argc, char* argv[])
}
if (diroff != 0 && !TIFFSetSubDirectory(in, diroff)) {
TIFFError(TIFFFileName(in),
- "Error, setting subdirectory at " TIFF_UINT64_FORMAT, diroff);
+ "Error, setting subdirectory at %" PRIu64, diroff);
(void) TIFFClose(in);
(void) TIFFClose(out);
return (EXIT_FAILURE);
@@ -371,10 +367,28 @@ processZIPOptions(char* cp)
}
static void
+processLERCOptions(char* cp)
+{
+ if ( (cp = strchr(cp, ':')) ) {
+ do {
+ cp++;
+ if (isdigit((int)*cp))
+ max_z_error = atof(cp);
+ else if (*cp == 's')
+ subcodec = atoi(++cp);
+ else if (*cp == 'p')
+ defpreset = atoi(++cp);
+ else
+ usage(EXIT_FAILURE);
+ } while( (cp = strchr(cp, ':')) );
+ }
+}
+
+static void
processG3Options(char* cp)
{
if( (cp = strchr(cp, ':')) ) {
- if (defg3opts == (uint32) -1)
+ if (defg3opts == (uint32_t) -1)
defg3opts = 0;
do {
cp++;
@@ -425,6 +439,9 @@ processCompressOptions(char* opt)
} else if (strneq(opt, "zip", 3)) {
processZIPOptions(opt);
defcompression = COMPRESSION_ADOBE_DEFLATE;
+ } else if (strneq(opt, "lerc", 4)) {
+ processLERCOptions(opt);
+ defcompression = COMPRESSION_LERC;
} else if (strneq(opt, "lzma", 4)) {
processZIPOptions(opt);
defcompression = COMPRESSION_LZMA;
@@ -443,83 +460,121 @@ processCompressOptions(char* opt)
return (1);
}
-static const char* stuff[] = {
-"usage: tiffcp [options] input... output",
-"where options are:",
-" -a append to output instead of overwriting",
-" -o offset set initial directory offset",
-" -p contig pack samples contiguously (e.g. RGBRGB...)",
-" -p separate store samples separately (e.g. RRR...GGG...BBB...)",
-" -s write output in strips",
-" -t write output in tiles",
-" -x force the merged tiff pages in sequence",
-" -8 write BigTIFF instead of default ClassicTIFF",
-" -B write big-endian instead of native byte order",
-" -L write little-endian instead of native byte order",
-" -M disable use of memory-mapped files",
-" -C disable strip chopping",
-" -i ignore read errors",
-" -b file[,#] bias (dark) monochrome image to be subtracted from all others",
-" -,=% use % rather than , to separate image #'s (per Note below)",
-" -m size set maximum memory allocation size (MiB). 0 to disable limit.",
-"",
-" -r # make each strip have no more than # rows",
-" -w # set output tile width (pixels)",
-" -l # set output tile length (pixels)",
-"",
-" -f lsb2msb force lsb-to-msb FillOrder for output",
-" -f msb2lsb force msb-to-lsb FillOrder for output",
-"",
-" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts] compress output with deflate encoding",
-" -c lzma[:opts] compress output with LZMA2 encoding",
-" -c zstd[:opts] compress output with ZSTD encoding",
-" -c webp[:opts] compress output with WEBP encoding",
-" -c jpeg[:opts] compress output with JPEG encoding",
-" -c jbig compress output with ISO JBIG encoding",
-" -c packbits compress output with packbits encoding",
-" -c g3[:opts] compress output with CCITT Group 3 encoding",
-" -c g4 compress output with CCITT Group 4 encoding",
-" -c sgilog compress output with SGILOG encoding",
-" -c none use no compression algorithm on output",
-"",
-"Group 3 options:",
-" 1d use default CCITT Group 3 1D-encoding",
-" 2d use optional CCITT Group 3 2D-encoding",
-" fill byte-align EOL codes",
-"For example, -c g3:2d:fill to get G3-2D-encoded data with byte-aligned EOLs",
-"",
-"JPEG options:",
-" # set compression quality level (0-100, default 75)",
-" r output color image as RGB rather than YCbCr",
-"For example, -c jpeg:r:50 to get JPEG-encoded RGB data with 50% comp. quality",
-"",
-"LZW, Deflate (ZIP), LZMA2, ZSTD and WEBP options:",
-" # set predictor value",
-" p# set compression level (preset)",
-#if LIBDEFLATE_SUPPORT
-" s# set subcodec (0=zlib, 1=libdeflate) (only for Deflate/ZIP)",
+static const char usage_info[] =
+"Copy, convert, or combine TIFF files\n\n"
+"usage: tiffcp [options] input... output\n"
+"where options are:\n"
+" -a append to output instead of overwriting\n"
+" -o offset set initial directory offset\n"
+" -p contig pack samples contiguously (e.g. RGBRGB...)\n"
+" -p separate store samples separately (e.g. RRR...GGG...BBB...)\n"
+" -s write output in strips\n"
+" -t write output in tiles\n"
+" -x force the merged tiff pages in sequence\n"
+" -8 write BigTIFF instead of default ClassicTIFF\n"
+" -B write big-endian instead of native byte order\n"
+" -L write little-endian instead of native byte order\n"
+" -M disable use of memory-mapped files\n"
+" -C disable strip chopping\n"
+" -i ignore read errors\n"
+" -b file[,#] bias (dark) monochrome image to be subtracted from all others\n"
+" -,=% use % rather than , to separate image #'s (per Note below)\n"
+" -m size set maximum memory allocation size (MiB). 0 to disable limit.\n"
+"\n"
+" -r # make each strip have no more than # rows\n"
+" -w # set output tile width (pixels)\n"
+" -l # set output tile length (pixels)\n"
+"\n"
+" -f lsb2msb force lsb-to-msb FillOrder for output\n"
+" -f msb2lsb force msb-to-lsb FillOrder for output\n"
+"\n"
+#ifdef LZW_SUPPORT
+" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding\n"
+/* " LZW options:" */
+" # set predictor value\n"
+" For example, -c lzw:2 for LZW-encoded data with horizontal differencing\n"
#endif
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing,",
-"-c zip:3:p9 for Deflate encoding with maximum compression level and floating",
-"point predictor.",
-"",
-"Note that input filenames may be of the form filename,x,y,z",
-"where x, y, and z specify image numbers in the filename to copy.",
-"example: tiffcp -c none -b esp.tif,1 esp.tif,0 test.tif",
-" subtract 2nd image in esp.tif from 1st yielding uncompressed result test.tif",
-NULL
-};
+#ifdef ZIP_SUPPORT
+" -c zip[:opts] compress output with deflate encoding\n"
+/* " Deflate (ZIP) options:", */
+" # set predictor value\n"
+" p# set compression level (preset)\n"
+" For example, -c zip:3:p9 for maximum compression level and floating\n"
+" point predictor.\n"
+#endif
+#if defined(ZIP_SUPPORT) && defined(LIBDEFLATE_SUPPORT)
+" s# set subcodec: 0=zlib, 1=libdeflate (default 1)\n"
+/* " (only for Deflate/ZIP)", */
+#endif
+#ifdef LERC_SUPPORT
+" -c lerc[:opts] compress output with LERC encoding\n"
+/* " LERC options:", */
+" # set max_z_error value\n"
+" s# set subcodec: 0=none, 1=deflate, 2=zstd (default 0)\n"
+" p# set compression level (preset)\n"
+" For example, -c lerc:0.5:s2:p22 for max_z_error 0.5,\n"
+" zstd additional copression with maximum compression level.\n"
+#endif
+#ifdef LZMA_SUPPORT
+" -c lzma[:opts] compress output with LZMA2 encoding\n"
+/* " LZMA options:", */
+" # set predictor value\n"
+" p# set compression level (preset)\n"
+#endif
+#ifdef ZSTD_SUPPORT
+" -c zstd[:opts] compress output with ZSTD encoding\n"
+/* " ZSTD options:", */
+" # set predictor value\n"
+" p# set compression level (preset)\n"
+#endif
+#ifdef WEBP_SUPPORT
+" -c webp[:opts] compress output with WEBP encoding\n"
+/* " WEBP options:", */
+" # set predictor value\n"
+" p# set compression level (preset)\n"
+#endif
+#ifdef JPEG_SUPPORT
+" -c jpeg[:opts] compress output with JPEG encoding\n"
+/* " JPEG options:", */
+" # set compression quality level (0-100, default 75)\n"
+" r output color image as RGB rather than YCbCr\n"
+" For example, -c jpeg:r:50 for JPEG-encoded RGB with 50% comp. quality\n"
+#endif
+#ifdef JBIG_SUPPORT
+" -c jbig compress output with ISO JBIG encoding\n"
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits compress output with packbits encoding\n"
+#endif
+#ifdef CCITT_SUPPORT
+" -c g3[:opts] compress output with CCITT Group 3 encoding\n"
+/* " CCITT Group 3 options:", */
+" 1d use default CCITT Group 3 1D-encoding\n"
+" 2d use optional CCITT Group 3 2D-encoding\n"
+" fill byte-align EOL codes\n"
+" For example, -c g3:2d:fill for G3-2D-encoded data with byte-aligned EOLs\n"
+" -c g4 compress output with CCITT Group 4 encoding\n"
+#endif
+#ifdef LOGLUV_SUPPORT
+" -c sgilog compress output with SGILOG encoding\n"
+#endif
+#if defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(LZMA_SUPPORT) || defined(ZSTD_SUPPORT) || defined(WEBP_SUPPORT) || defined(JPEG_SUPPORT) || defined(JBIG_SUPPORT) || defined(PACKBITS_SUPPORT) || defined(CCITT_SUPPORT) || defined(LOGLUV_SUPPORT) || defined(LERC_SUPPORT)
+" -c none use no compression algorithm on output\n"
+#endif
+"\n"
+"Note that input filenames may be of the form filename,x,y,z\n"
+"where x, y, and z specify image numbers in the filename to copy.\n"
+"example: tiffcp -b esp.tif,1 esp.tif,0 test.tif\n"
+" subtract 2nd image in esp.tif from 1st yielding result test.tif\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
@@ -533,27 +588,27 @@ usage(int code)
if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4)
static void
-cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
+cpTag(TIFF* in, TIFF* out, uint16_t tag, uint16_t count, TIFFDataType type)
{
switch (type) {
case TIFF_SHORT:
if (count == 1) {
- uint16 shortv;
+ uint16_t shortv;
CopyField(tag, shortv);
} else if (count == 2) {
- uint16 shortv1, shortv2;
+ uint16_t shortv1, shortv2;
CopyField2(tag, shortv1, shortv2);
} else if (count == 4) {
- uint16 *tr, *tg, *tb, *ta;
+ uint16_t *tr, *tg, *tb, *ta;
CopyField4(tag, tr, tg, tb, ta);
- } else if (count == (uint16) -1) {
- uint16 shortv1;
- uint16* shortav;
+ } else if (count == (uint16_t) -1) {
+ uint16_t shortv1;
+ uint16_t* shortav;
CopyField2(tag, shortv1, shortav);
}
break;
case TIFF_LONG:
- { uint32 longv;
+ { uint32_t longv;
CopyField(tag, longv);
}
break;
@@ -561,7 +616,7 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
float floatv;
CopyField(tag, floatv);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
float* floatav;
CopyField(tag, floatav);
}
@@ -575,21 +630,21 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
double doublev;
CopyField(tag, doublev);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
double* doubleav;
CopyField(tag, doubleav);
}
break;
default:
TIFFError(TIFFFileName(in),
- "Data type %d is not supported, tag %d skipped.",
+ "Data type %"PRIu16" is not supported, tag %d skipped.",
tag, type);
}
}
-static struct cpTag {
- uint16 tag;
- uint16 count;
+static const struct cpTag {
+ uint16_t tag;
+ uint16_t count;
TIFFDataType type;
} tags[] = {
{ TIFFTAG_SUBFILETYPE, 1, TIFF_LONG },
@@ -600,56 +655,56 @@ static struct cpTag {
{ TIFFTAG_MODEL, 1, TIFF_ASCII },
{ TIFFTAG_MINSAMPLEVALUE, 1, TIFF_SHORT },
{ TIFFTAG_MAXSAMPLEVALUE, 1, TIFF_SHORT },
- { TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL },
- { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL },
- { TIFFTAG_PAGENAME, 1, TIFF_ASCII },
- { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
- { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
- { TIFFTAG_DATETIME, 1, TIFF_ASCII },
- { TIFFTAG_ARTIST, 1, TIFF_ASCII },
- { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
- { TIFFTAG_WHITEPOINT, (uint16) -1, TIFF_RATIONAL },
- { TIFFTAG_PRIMARYCHROMATICITIES,(uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
- { TIFFTAG_INKSET, 1, TIFF_SHORT },
- { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
- { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
- { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
- { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
- { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
- { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_EXTRASAMPLES, (uint16) -1, TIFF_SHORT },
- { TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE },
- { TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE },
- { TIFFTAG_STONITS, 1, TIFF_DOUBLE },
+ { TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL },
+ { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL },
+ { TIFFTAG_PAGENAME, 1, TIFF_ASCII },
+ { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
+ { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
+ { TIFFTAG_DATETIME, 1, TIFF_ASCII },
+ { TIFFTAG_ARTIST, 1, TIFF_ASCII },
+ { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
+ { TIFFTAG_WHITEPOINT, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_PRIMARYCHROMATICITIES,(uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
+ { TIFFTAG_INKSET, 1, TIFF_SHORT },
+ { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
+ { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
+ { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
+ { TIFFTAG_YCBCRCOEFFICIENTS, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
+ { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
+ { TIFFTAG_REFERENCEBLACKWHITE, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_EXTRASAMPLES, (uint16_t) -1, TIFF_SHORT },
+ { TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE },
+ { TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE },
+ { TIFFTAG_STONITS, 1, TIFF_DOUBLE },
};
#define NTAGS (sizeof (tags) / sizeof (tags[0]))
#define CopyTag(tag, count, type) cpTag(in, out, tag, count, type)
typedef int (*copyFunc)
- (TIFF* in, TIFF* out, uint32 l, uint32 w, uint16 samplesperpixel);
-static copyFunc pickCopyFunc(TIFF*, TIFF*, uint16, uint16);
+ (TIFF* in, TIFF* out, uint32_t l, uint32_t w, uint16_t samplesperpixel);
+static copyFunc pickCopyFunc(TIFF*, TIFF*, uint16_t, uint16_t);
/* PODD */
static int
tiffcp(TIFF* in, TIFF* out)
{
- uint16 bitspersample = 1, samplesperpixel = 1;
- uint16 input_compression, input_photometric = PHOTOMETRIC_MINISBLACK;
+ uint16_t bitspersample = 1, samplesperpixel = 1;
+ uint16_t input_compression, input_photometric = PHOTOMETRIC_MINISBLACK;
copyFunc cf;
- uint32 width, length;
- struct cpTag* p;
+ uint32_t width, length;
+ const struct cpTag* p;
CopyField(TIFFTAG_IMAGEWIDTH, width);
CopyField(TIFFTAG_IMAGELENGTH, length);
CopyField(TIFFTAG_BITSPERSAMPLE, bitspersample);
CopyField(TIFFTAG_SAMPLESPERPIXEL, samplesperpixel);
- if (compression != (uint16)-1)
+ if (compression != (uint16_t)-1)
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
else
CopyField(TIFFTAG_COMPRESSION, compression);
@@ -660,7 +715,7 @@ tiffcp(TIFF* in, TIFF* out)
TIFFSetField(in, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB);
} else if (input_photometric == PHOTOMETRIC_YCBCR) {
/* Otherwise, can't handle subsampled input */
- uint16 subsamplinghor,subsamplingver;
+ uint16_t subsamplinghor,subsamplingver;
TIFFGetFieldDefaulted(in, TIFFTAG_YCBCRSUBSAMPLING,
&subsamplinghor, &subsamplingver);
@@ -732,9 +787,9 @@ tiffcp(TIFF* in, TIFF* out)
* input image or, if nothing is defined, use the
* library default.
*/
- if (tilewidth == (uint32) -1)
+ if (tilewidth == (uint32_t) -1)
TIFFGetField(in, TIFFTAG_TILEWIDTH, &tilewidth);
- if (tilelength == (uint32) -1)
+ if (tilelength == (uint32_t) -1)
TIFFGetField(in, TIFFTAG_TILELENGTH, &tilelength);
TIFFDefaultTileSize(out, &tilewidth, &tilelength);
TIFFSetField(out, TIFFTAG_TILEWIDTH, tilewidth);
@@ -745,20 +800,20 @@ tiffcp(TIFF* in, TIFF* out)
* value from the input image or, if nothing is defined,
* use the library default.
*/
- if (rowsperstrip == (uint32) 0) {
+ if (rowsperstrip == (uint32_t) 0) {
if (!TIFFGetField(in, TIFFTAG_ROWSPERSTRIP,
&rowsperstrip)) {
rowsperstrip =
TIFFDefaultStripSize(out, rowsperstrip);
}
- if (rowsperstrip > length && rowsperstrip != (uint32)-1)
+ if (rowsperstrip > length && rowsperstrip != (uint32_t)-1)
rowsperstrip = length;
}
- else if (rowsperstrip == (uint32) -1)
+ else if (rowsperstrip == (uint32_t) -1)
rowsperstrip = length;
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
}
- if (config != (uint16) -1)
+ if (config != (uint16_t) -1)
TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
else
CopyField(TIFFTAG_PLANARCONFIG, config);
@@ -777,12 +832,45 @@ tiffcp(TIFF* in, TIFF* out)
CopyTag(TIFFTAG_FAXSUBADDRESS, 1, TIFF_ASCII);
CopyTag(TIFFTAG_FAXDCS, 1, TIFF_ASCII);
break;
+ case COMPRESSION_LERC:
+ if( max_z_error > 0 )
+ {
+ if( TIFFSetField(out, TIFFTAG_LERC_MAXZERROR, max_z_error) != 1 )
+ {
+ return FALSE;
+ }
+ }
+ if( subcodec != -1 )
+ {
+ if( TIFFSetField(out, TIFFTAG_LERC_ADD_COMPRESSION, subcodec) != 1 )
+ {
+ return FALSE;
+ }
+ }
+ if( preset != -1 )
+ {
+ switch (subcodec) {
+ case LERC_ADD_COMPRESSION_DEFLATE:
+ if( TIFFSetField(out, TIFFTAG_ZIPQUALITY, preset) != 1 )
+ {
+ return FALSE;
+ }
+ break;
+ case LERC_ADD_COMPRESSION_ZSTD:
+ if( TIFFSetField( out, TIFFTAG_ZSTD_LEVEL, preset ) != 1 )
+ {
+ return FALSE;
+ }
+ break;
+ }
+ }
+ break;
case COMPRESSION_LZW:
case COMPRESSION_ADOBE_DEFLATE:
case COMPRESSION_DEFLATE:
case COMPRESSION_LZMA:
case COMPRESSION_ZSTD:
- if (predictor != (uint16)-1)
+ if (predictor != (uint16_t)-1)
TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
else
CopyField(TIFFTAG_PREDICTOR, predictor);
@@ -819,7 +907,7 @@ tiffcp(TIFF* in, TIFF* out)
case COMPRESSION_CCITTFAX3:
case COMPRESSION_CCITTFAX4:
if (compression == COMPRESSION_CCITTFAX3) {
- if (g3opts != (uint32) -1)
+ if (g3opts != (uint32_t) -1)
TIFFSetField(out, TIFFTAG_GROUP3OPTIONS,
g3opts);
else
@@ -835,13 +923,13 @@ tiffcp(TIFF* in, TIFF* out)
break;
}
{
- uint32 len32;
+ uint32_t len32;
void** data;
if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &len32, &data))
TIFFSetField(out, TIFFTAG_ICCPROFILE, len32, data);
}
{
- uint16 ninks;
+ uint16_t ninks;
const char* inknames;
if (TIFFGetField(in, TIFFTAG_NUMBEROFINKS, &ninks)) {
TIFFSetField(out, TIFFTAG_NUMBEROFINKS, ninks);
@@ -890,17 +978,17 @@ tiffcp(TIFF* in, TIFF* out)
*/
#define DECLAREcpFunc(x) \
static int x(TIFF* in, TIFF* out, \
- uint32 imagelength, uint32 imagewidth, tsample_t spp)
+ uint32_t imagelength, uint32_t imagewidth, tsample_t spp)
#define DECLAREreadFunc(x) \
static int x(TIFF* in, \
- uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
-typedef int (*readFunc)(TIFF*, uint8*, uint32, uint32, tsample_t);
+ uint8_t* buf, uint32_t imagelength, uint32_t imagewidth, tsample_t spp)
+typedef int (*readFunc)(TIFF*, uint8_t*, uint32_t, uint32_t, tsample_t);
#define DECLAREwriteFunc(x) \
static int x(TIFF* out, \
- uint8* buf, uint32 imagelength, uint32 imagewidth, tsample_t spp)
-typedef int (*writeFunc)(TIFF*, uint8*, uint32, uint32, tsample_t);
+ uint8_t* buf, uint32_t imagelength, uint32_t imagewidth, tsample_t spp)
+typedef int (*writeFunc)(TIFF*, uint8_t*, uint32_t, uint32_t, tsample_t);
/*
* Contig -> contig by scanline for rows/strip change.
@@ -909,7 +997,7 @@ DECLAREcpFunc(cpContig2ContigByRow)
{
tsize_t scanlinesize = TIFFScanlineSize(in);
tdata_t buf;
- uint32 row;
+ uint32_t row;
buf = limitMalloc(scanlinesize);
if (!buf)
@@ -919,14 +1007,14 @@ DECLAREcpFunc(cpContig2ContigByRow)
for (row = 0; row < imagelength; row++) {
if (TIFFReadScanline(in, buf, row, 0) < 0 && !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read scanline %lu",
- (unsigned long) row);
+ "Error, can't read scanline %"PRIu32,
+ row);
goto bad;
}
if (TIFFWriteScanline(out, buf, row, 0) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write scanline %lu",
- (unsigned long) row);
+ "Error, can't write scanline %"PRIu32,
+ row);
goto bad;
}
}
@@ -938,13 +1026,13 @@ bad:
}
-typedef void biasFn (void *image, void *bias, uint32 pixels);
+typedef void biasFn (void *image, void *bias, uint32_t pixels);
#define subtract(bits) \
-static void subtract##bits (void *i, void *b, uint32 pixels)\
+static void subtract##bits (void *i, void *b, uint32_t pixels)\
{\
- uint##bits *image = i;\
- uint##bits *bias = b;\
+ uint##bits##_t *image = i;\
+ uint##bits##_t *bias = b;\
while (pixels--) {\
*image = *image > *bias ? *image-*bias : 0;\
image++, bias++; \
@@ -974,39 +1062,39 @@ DECLAREcpFunc(cpBiasedContig2Contig)
tsize_t biasSize = TIFFScanlineSize(bias);
tsize_t bufSize = TIFFScanlineSize(in);
tdata_t buf, biasBuf;
- uint32 biasWidth = 0, biasLength = 0;
+ uint32_t biasWidth = 0, biasLength = 0;
TIFFGetField(bias, TIFFTAG_IMAGEWIDTH, &biasWidth);
TIFFGetField(bias, TIFFTAG_IMAGELENGTH, &biasLength);
if (biasSize == bufSize &&
imagelength == biasLength && imagewidth == biasWidth) {
- uint16 sampleBits = 0;
+ uint16_t sampleBits = 0;
biasFn *subtractLine;
TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &sampleBits);
subtractLine = lineSubtractFn (sampleBits);
if (subtractLine) {
- uint32 row;
+ uint32_t row;
buf = limitMalloc(bufSize);
biasBuf = limitMalloc(bufSize);
for (row = 0; row < imagelength; row++) {
if (TIFFReadScanline(in, buf, row, 0) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read scanline %lu",
- (unsigned long) row);
+ "Error, can't read scanline %"PRIu32,
+ row);
goto bad;
}
if (TIFFReadScanline(bias, biasBuf, row, 0) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read biased scanline %lu",
- (unsigned long) row);
+ "Error, can't read biased scanline %"PRIu32,
+ row);
goto bad;
}
subtractLine (buf, biasBuf, imagewidth);
if (TIFFWriteScanline(out, buf, row, 0) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write scanline %lu",
- (unsigned long) row);
+ "Error, can't write scanline %"PRIu32,
+ row);
goto bad;
}
}
@@ -1022,19 +1110,19 @@ bad:
return 0;
} else {
TIFFError(TIFFFileName(in),
- "No support for biasing %d bit pixels\n",
+ "No support for biasing %"PRIu16" bit pixels\n",
sampleBits);
return 0;
}
}
TIFFError(TIFFFileName(in),
- "Bias image %s,%d\nis not the same size as %s,%d\n",
+ "Bias image %s,%"PRIu16"\nis not the same size as %s,%"PRIu16"\n",
TIFFFileName(bias), TIFFCurrentDirectory(bias),
TIFFFileName(in), TIFFCurrentDirectory(in));
return 0;
} else {
TIFFError(TIFFFileName(in),
- "Can't bias %s,%d as it has >1 Sample/Pixel\n",
+ "Can't bias %s,%"PRIu16" as it has >1 Sample/Pixel\n",
TIFFFileName(in), TIFFCurrentDirectory(in));
return 0;
}
@@ -1053,7 +1141,7 @@ DECLAREcpFunc(cpDecodedStrips)
(void) imagewidth; (void) spp;
if (buf) {
tstrip_t s, ns = TIFFNumberOfStrips(in);
- uint32 row = 0;
+ uint32_t row = 0;
_TIFFmemset(buf, 0, stripsize);
for (s = 0; s < ns && row < imagelength; s++) {
tsize_t cc = (row + rowsperstrip > imagelength) ?
@@ -1061,14 +1149,14 @@ DECLAREcpFunc(cpDecodedStrips)
if (TIFFReadEncodedStrip(in, s, buf, cc) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read strip %lu",
- (unsigned long) s);
+ "Error, can't read strip %"PRIu32,
+ s);
goto bad;
}
if (TIFFWriteEncodedStrip(out, s, buf, cc) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write strip %lu",
- (unsigned long) s);
+ "Error, can't write strip %"PRIu32,
+ s);
goto bad;
}
row += rowsperstrip;
@@ -1077,8 +1165,8 @@ DECLAREcpFunc(cpDecodedStrips)
return 1;
} else {
TIFFError(TIFFFileName(in),
- "Error, can't allocate memory buffer of size %lu "
- "to read strips", (unsigned long) stripsize);
+ "Error, can't allocate memory buffer of size %"TIFF_SSIZE_FORMAT
+ " to read strips", stripsize);
return 0;
}
@@ -1094,7 +1182,7 @@ DECLAREcpFunc(cpSeparate2SeparateByRow)
{
tsize_t scanlinesize = TIFFScanlineSize(in);
tdata_t buf;
- uint32 row;
+ uint32_t row;
tsample_t s;
(void) imagewidth;
@@ -1106,14 +1194,14 @@ DECLAREcpFunc(cpSeparate2SeparateByRow)
for (row = 0; row < imagelength; row++) {
if (TIFFReadScanline(in, buf, row, s) < 0 && !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read scanline %lu",
- (unsigned long) row);
+ "Error, can't read scanline %"PRIu32,
+ row);
goto bad;
}
if (TIFFWriteScanline(out, buf, row, s) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write scanline %lu",
- (unsigned long) row);
+ "Error, can't write scanline %"PRIu32,
+ row);
goto bad;
}
}
@@ -1134,11 +1222,11 @@ DECLAREcpFunc(cpContig2SeparateByRow)
tsize_t scanlinesizeout = TIFFScanlineSize(out);
tdata_t inbuf;
tdata_t outbuf;
- register uint8 *inp, *outp;
- register uint32 n;
- uint32 row;
+ register uint8_t *inp, *outp;
+ register uint32_t n;
+ uint32_t row;
tsample_t s;
- uint16 bps = 0;
+ uint16_t bps = 0;
(void) TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps);
if( bps != 8 )
@@ -1161,20 +1249,20 @@ DECLAREcpFunc(cpContig2SeparateByRow)
if (TIFFReadScanline(in, inbuf, row, 0) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read scanline %lu",
- (unsigned long) row);
+ "Error, can't read scanline %"PRIu32,
+ row);
goto bad;
}
- inp = ((uint8*)inbuf) + s;
- outp = (uint8*)outbuf;
+ inp = ((uint8_t*)inbuf) + s;
+ outp = (uint8_t*)outbuf;
for (n = imagewidth; n-- > 0;) {
*outp++ = *inp;
inp += spp;
}
if (TIFFWriteScanline(out, outbuf, row, s) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write scanline %lu",
- (unsigned long) row);
+ "Error, can't write scanline %"PRIu32,
+ row);
goto bad;
}
}
@@ -1197,11 +1285,11 @@ DECLAREcpFunc(cpSeparate2ContigByRow)
tsize_t scanlinesizeout = TIFFScanlineSize(out);
tdata_t inbuf;
tdata_t outbuf;
- register uint8 *inp, *outp;
- register uint32 n;
- uint32 row;
+ register uint8_t *inp, *outp;
+ register uint32_t n;
+ uint32_t row;
tsample_t s;
- uint16 bps = 0;
+ uint16_t bps = 0;
(void) TIFFGetField(in, TIFFTAG_BITSPERSAMPLE, &bps);
if( bps != 8 )
@@ -1224,12 +1312,12 @@ DECLAREcpFunc(cpSeparate2ContigByRow)
if (TIFFReadScanline(in, inbuf, row, s) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read scanline %lu",
- (unsigned long) row);
+ "Error, can't read scanline %"PRIu32,
+ row);
goto bad;
}
- inp = (uint8*)inbuf;
- outp = ((uint8*)outbuf) + s;
+ inp = (uint8_t*)inbuf;
+ outp = ((uint8_t*)outbuf) + s;
for (n = imagewidth; n-- > 0;) {
*outp = *inp++;
outp += spp;
@@ -1237,8 +1325,8 @@ DECLAREcpFunc(cpSeparate2ContigByRow)
}
if (TIFFWriteScanline(out, outbuf, row, 0) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write scanline %lu",
- (unsigned long) row);
+ "Error, can't write scanline %"PRIu32,
+ row);
goto bad;
}
}
@@ -1252,11 +1340,11 @@ bad:
}
static void
-cpStripToTile(uint8* out, uint8* in,
- uint32 rows, uint32 cols, int outskew, int64 inskew)
+cpStripToTile(uint8_t* out, uint8_t* in,
+ uint32_t rows, uint32_t cols, int outskew, int64_t inskew)
{
while (rows-- > 0) {
- uint32 j = cols;
+ uint32_t j = cols;
while (j-- > 0)
*out++ = *in++;
out += outskew;
@@ -1265,12 +1353,12 @@ cpStripToTile(uint8* out, uint8* in,
}
static void
-cpContigBufToSeparateBuf(uint8* out, uint8* in,
- uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp,
- int bytes_per_sample )
+cpContigBufToSeparateBuf(uint8_t* out, uint8_t* in,
+ uint32_t rows, uint32_t cols, int outskew, int inskew, tsample_t spp,
+ int bytes_per_sample )
{
while (rows-- > 0) {
- uint32 j = cols;
+ uint32_t j = cols;
while (j-- > 0)
{
int n = bytes_per_sample;
@@ -1286,12 +1374,12 @@ cpContigBufToSeparateBuf(uint8* out, uint8* in,
}
static void
-cpSeparateBufToContigBuf(uint8* out, uint8* in,
- uint32 rows, uint32 cols, int outskew, int inskew, tsample_t spp,
- int bytes_per_sample)
+cpSeparateBufToContigBuf(uint8_t* out, uint8_t* in,
+ uint32_t rows, uint32_t cols, int outskew, int inskew, tsample_t spp,
+ int bytes_per_sample)
{
while (rows-- > 0) {
- uint32 j = cols;
+ uint32_t j = cols;
while (j-- > 0) {
int n = bytes_per_sample;
@@ -1307,7 +1395,7 @@ cpSeparateBufToContigBuf(uint8* out, uint8* in,
static int
cpImage(TIFF* in, TIFF* out, readFunc fin, writeFunc fout,
- uint32 imagelength, uint32 imagewidth, tsample_t spp)
+ uint32_t imagelength, uint32_t imagewidth, tsample_t spp)
{
int status = 0;
tdata_t buf = NULL;
@@ -1321,9 +1409,9 @@ cpImage(TIFF* in, TIFF* out, readFunc fin, writeFunc fout,
&& bytes / (tsize_t)imagelength == scanlinesize) {
buf = limitMalloc(bytes);
if (buf) {
- if ((*fin)(in, (uint8*)buf, imagelength,
- imagewidth, spp)) {
- status = (*fout)(out, (uint8*)buf,
+ if ((*fin)(in, (uint8_t*)buf, imagelength,
+ imagewidth, spp)) {
+ status = (*fout)(out, (uint8_t*)buf,
imagelength, imagewidth, spp);
}
_TIFFfree(buf);
@@ -1341,16 +1429,16 @@ cpImage(TIFF* in, TIFF* out, readFunc fin, writeFunc fout,
DECLAREreadFunc(readContigStripsIntoBuffer)
{
tsize_t scanlinesize = TIFFScanlineSize(in);
- uint8* bufp = buf;
- uint32 row;
+ uint8_t* bufp = buf;
+ uint32_t row;
(void) imagewidth; (void) spp;
for (row = 0; row < imagelength; row++) {
if (TIFFReadScanline(in, (tdata_t) bufp, row, 0) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read scanline %lu",
- (unsigned long) row);
+ "Error, can't read scanline %"PRIu32,
+ row);
return 0;
}
bufp += scanlinesize;
@@ -1373,21 +1461,21 @@ DECLAREreadFunc(readSeparateStripsIntoBuffer)
_TIFFmemset(scanline, 0, scanlinesize);
(void) imagewidth;
if (scanline) {
- uint8* bufp = (uint8*) buf;
- uint32 row;
+ uint8_t* bufp = (uint8_t*) buf;
+ uint32_t row;
tsample_t s;
for (row = 0; row < imagelength; row++) {
/* merge channels */
for (s = 0; s < spp; s++) {
- uint8* bp = bufp + s;
+ uint8_t* bp = bufp + s;
tsize_t n = scanlinesize;
- uint8* sbuf = scanline;
+ uint8_t* sbuf = scanline;
if (TIFFReadScanline(in, scanline, row, s) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read scanline %lu",
- (unsigned long) row);
+ "Error, can't read scanline %"PRIu32,
+ row);
status = 0;
goto done;
}
@@ -1408,12 +1496,12 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
int status = 1;
tsize_t tilesize = TIFFTileSize(in);
tdata_t tilebuf;
- uint32 imagew = TIFFScanlineSize(in);
- uint32 tilew = TIFFTileRowSize(in);
- int64 iskew = (int64)imagew - (int64)tilew;
- uint8* bufp = (uint8*) buf;
- uint32 tw, tl;
- uint32 row;
+ uint32_t imagew = TIFFScanlineSize(in);
+ uint32_t tilew = TIFFTileRowSize(in);
+ int64_t iskew = (int64_t)imagew - (int64_t)tilew;
+ uint8_t* bufp = (uint8_t*) buf;
+ uint32_t tw, tl;
+ uint32_t row;
(void) spp;
tilebuf = limitMalloc(tilesize);
@@ -1424,23 +1512,22 @@ DECLAREreadFunc(readContigTilesIntoBuffer)
(void) TIFFGetField(in, TIFFTAG_TILELENGTH, &tl);
for (row = 0; row < imagelength; row += tl) {
- uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
- uint32 colb = 0;
- uint32 col;
+ uint32_t nrow = (row + tl > imagelength) ? imagelength - row : tl;
+ uint32_t colb = 0;
+ uint32_t col;
for (col = 0; col < imagewidth && colb < imagew; col += tw) {
if (TIFFReadTile(in, tilebuf, col, row, 0, 0) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read tile at %lu %lu",
- (unsigned long) col,
- (unsigned long) row);
+ "Error, can't read tile at %"PRIu32" %"PRIu32,
+ col, row);
status = 0;
goto done;
}
if (colb > iskew) {
- uint32 width = imagew - colb;
- uint32 oskew = tilew - width;
+ uint32_t width = imagew - colb;
+ uint32_t oskew = tilew - width;
cpStripToTile(bufp + colb,
tilebuf, nrow, width,
oskew + iskew, oskew );
@@ -1460,15 +1547,15 @@ done:
DECLAREreadFunc(readSeparateTilesIntoBuffer)
{
int status = 1;
- uint32 imagew = TIFFRasterScanlineSize(in);
- uint32 tilew = TIFFTileRowSize(in);
+ uint32_t imagew = TIFFRasterScanlineSize(in);
+ uint32_t tilew = TIFFTileRowSize(in);
int iskew;
tsize_t tilesize = TIFFTileSize(in);
tdata_t tilebuf;
- uint8* bufp = (uint8*) buf;
- uint32 tw, tl;
- uint32 row;
- uint16 bps = 0, bytes_per_sample;
+ uint8_t* bufp = (uint8_t*) buf;
+ uint32_t tw, tl;
+ uint32_t row;
+ uint16_t bps = 0, bytes_per_sample;
if (tilew && spp > (INT_MAX / tilew))
{
@@ -1498,9 +1585,9 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
bytes_per_sample = bps/8;
for (row = 0; row < imagelength; row += tl) {
- uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
- uint32 colb = 0;
- uint32 col;
+ uint32_t nrow = (row + tl > imagelength) ? imagelength - row : tl;
+ uint32_t colb = 0;
+ uint32_t col;
for (col = 0; col < imagewidth; col += tw) {
tsample_t s;
@@ -1509,11 +1596,9 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
if (TIFFReadTile(in, tilebuf, col, row, 0, s) < 0
&& !ignore) {
TIFFError(TIFFFileName(in),
- "Error, can't read tile at %lu %lu, "
- "sample %lu",
- (unsigned long) col,
- (unsigned long) row,
- (unsigned long) s);
+ "Error, can't read tile at %"PRIu32" %"PRIu32", "
+ "sample %"PRIu16,
+ col, row, s);
status = 0;
goto done;
}
@@ -1522,7 +1607,7 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
* visible portion and skewing factors.
*/
if (colb + tilew*spp > imagew) {
- uint32 width = imagew - colb;
+ uint32_t width = imagew - colb;
int oskew = tilew*spp - width;
cpSeparateBufToContigBuf(
bufp+colb+s*bytes_per_sample,
@@ -1549,18 +1634,18 @@ done:
DECLAREwriteFunc(writeBufferToContigStrips)
{
- uint32 row, rowsperstrip;
+ uint32_t row, rowsperstrip;
tstrip_t strip = 0;
(void) imagewidth; (void) spp;
(void) TIFFGetFieldDefaulted(out, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
for (row = 0; row < imagelength; row += rowsperstrip) {
- uint32 nrows = (row+rowsperstrip > imagelength) ?
+ uint32_t nrows = (row + rowsperstrip > imagelength) ?
imagelength-row : rowsperstrip;
tsize_t stripsize = TIFFVStripSize(out, nrows);
if (TIFFWriteEncodedStrip(out, strip++, buf, stripsize) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write strip %u", strip - 1);
+ "Error, can't write strip %"PRIu32, strip - 1u);
return 0;
}
buf += stripsize;
@@ -1570,8 +1655,8 @@ DECLAREwriteFunc(writeBufferToContigStrips)
DECLAREwriteFunc(writeBufferToSeparateStrips)
{
- uint32 rowsize = imagewidth * spp;
- uint32 rowsperstrip;
+ uint32_t rowsize = imagewidth * spp;
+ uint32_t rowsperstrip;
tsize_t stripsize = TIFFStripSize(out);
tdata_t obuf;
tstrip_t strip = 0;
@@ -1583,19 +1668,19 @@ DECLAREwriteFunc(writeBufferToSeparateStrips)
_TIFFmemset(obuf, 0, stripsize);
(void) TIFFGetFieldDefaulted(out, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
for (s = 0; s < spp; s++) {
- uint32 row;
+ uint32_t row;
for (row = 0; row < imagelength; row += rowsperstrip) {
- uint32 nrows = (row+rowsperstrip > imagelength) ?
+ uint32_t nrows = (row + rowsperstrip > imagelength) ?
imagelength-row : rowsperstrip;
tsize_t stripsize = TIFFVStripSize(out, nrows);
cpContigBufToSeparateBuf(
- obuf, (uint8*) buf + row*rowsize + s,
+ obuf, (uint8_t*) buf + row * rowsize + s,
nrows, imagewidth, 0, 0, spp, 1);
if (TIFFWriteEncodedStrip(out, strip++, obuf, stripsize) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write strip %u",
- strip - 1);
+ "Error, can't write strip %"PRIu32,
+ strip - 1u);
_TIFFfree(obuf);
return 0;
}
@@ -1608,14 +1693,14 @@ DECLAREwriteFunc(writeBufferToSeparateStrips)
DECLAREwriteFunc(writeBufferToContigTiles)
{
- uint32 imagew = TIFFScanlineSize(out);
- uint32 tilew = TIFFTileRowSize(out);
+ uint32_t imagew = TIFFScanlineSize(out);
+ uint32_t tilew = TIFFTileRowSize(out);
int iskew = imagew - tilew;
tsize_t tilesize = TIFFTileSize(out);
tdata_t obuf;
- uint8* bufp = (uint8*) buf;
- uint32 tl, tw;
- uint32 row;
+ uint8_t* bufp = (uint8_t*) buf;
+ uint32_t tl, tw;
+ uint32_t row;
(void) spp;
@@ -1626,9 +1711,9 @@ DECLAREwriteFunc(writeBufferToContigTiles)
(void) TIFFGetField(out, TIFFTAG_TILELENGTH, &tl);
(void) TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw);
for (row = 0; row < imagelength; row += tilelength) {
- uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
- uint32 colb = 0;
- uint32 col;
+ uint32_t nrow = (row + tl > imagelength) ? imagelength - row : tl;
+ uint32_t colb = 0;
+ uint32_t col;
for (col = 0; col < imagewidth && colb < imagew; col += tw) {
/*
@@ -1636,7 +1721,7 @@ DECLAREwriteFunc(writeBufferToContigTiles)
* visible portion and skewing factors.
*/
if (colb + tilew > imagew) {
- uint32 width = imagew - colb;
+ uint32_t width = imagew - colb;
int oskew = tilew - width;
cpStripToTile(obuf, bufp + colb, nrow, width,
oskew, oskew + iskew);
@@ -1645,9 +1730,8 @@ DECLAREwriteFunc(writeBufferToContigTiles)
0, iskew);
if (TIFFWriteTile(out, obuf, col, row, 0, 0) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write tile at %lu %lu",
- (unsigned long) col,
- (unsigned long) row);
+ "Error, can't write tile at %"PRIu32" %"PRIu32,
+ col, row);
_TIFFfree(obuf);
return 0;
}
@@ -1661,16 +1745,16 @@ DECLAREwriteFunc(writeBufferToContigTiles)
DECLAREwriteFunc(writeBufferToSeparateTiles)
{
- uint32 imagew = TIFFScanlineSize(out);
+ uint32_t imagew = TIFFScanlineSize(out);
tsize_t tilew = TIFFTileRowSize(out);
- uint32 iimagew = TIFFRasterScanlineSize(out);
+ uint32_t iimagew = TIFFRasterScanlineSize(out);
int iskew = iimagew - tilew*spp;
tsize_t tilesize = TIFFTileSize(out);
tdata_t obuf;
- uint8* bufp = (uint8*) buf;
- uint32 tl, tw;
- uint32 row;
- uint16 bps = 0, bytes_per_sample;
+ uint8_t* bufp = (uint8_t*) buf;
+ uint32_t tl, tw;
+ uint32_t row;
+ uint16_t bps = 0, bytes_per_sample;
obuf = limitMalloc(TIFFTileSize(out));
if (obuf == NULL)
@@ -1694,9 +1778,9 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
bytes_per_sample = bps/8;
for (row = 0; row < imagelength; row += tl) {
- uint32 nrow = (row+tl > imagelength) ? imagelength-row : tl;
- uint32 colb = 0;
- uint32 col;
+ uint32_t nrow = (row + tl > imagelength) ? imagelength - row : tl;
+ uint32_t colb = 0;
+ uint32_t col;
for (col = 0; col < imagewidth; col += tw) {
tsample_t s;
@@ -1706,7 +1790,7 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
* visible portion and skewing factors.
*/
if (colb + tilew > imagew) {
- uint32 width = (imagew - colb);
+ uint32_t width = (imagew - colb);
int oskew = tilew - width;
cpContigBufToSeparateBuf(obuf,
@@ -1722,11 +1806,9 @@ DECLAREwriteFunc(writeBufferToSeparateTiles)
bytes_per_sample);
if (TIFFWriteTile(out, obuf, col, row, 0, s) < 0) {
TIFFError(TIFFFileName(out),
- "Error, can't write tile at %lu %lu "
- "sample %lu",
- (unsigned long) col,
- (unsigned long) row,
- (unsigned long) s);
+ "Error, can't write tile at %"PRIu32" %"PRIu32
+ " sample %"PRIu16,
+ col, row, s);
_TIFFfree(obuf);
return 0;
}
@@ -1875,10 +1957,10 @@ DECLAREcpFunc(cpSeparateTiles2SeparateStrips)
* Select the appropriate copy function to use.
*/
static copyFunc
-pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel)
+pickCopyFunc(TIFF* in, TIFF* out, uint16_t bitspersample, uint16_t samplesperpixel)
{
- uint16 shortv;
- uint32 w, l, tw, tl;
+ uint16_t shortv;
+ uint32_t w, l, tw, tl;
int bychunk;
(void) TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &shortv);
@@ -1891,7 +1973,7 @@ pickCopyFunc(TIFF* in, TIFF* out, uint16 bitspersample, uint16 samplesperpixel)
TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField(in, TIFFTAG_IMAGELENGTH, &l);
if (!(TIFFIsTiled(out) || TIFFIsTiled(in))) {
- uint32 irps = (uint32) -1L;
+ uint32_t irps = (uint32_t) -1L;
TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &irps);
/* if biased, force decoded copying to allow image subtraction */
bychunk = !bias && (rowsperstrip == irps);
diff --git a/tiff/tools/tiffcrop.c b/tiff/tools/tiffcrop.c
index d20b585a..b85c2ce7 100644
--- a/tiff/tools/tiffcrop.c
+++ b/tiff/tools/tiffcrop.c
@@ -102,17 +102,19 @@
* includes annotations for image parameters and scanline info. Level
* selects which functions dump data, with higher numbers selecting
* lower level, scanline level routines. Debug reports a limited set
- * of messages to monitor progess without enabling dump logs.
+ * of messages to monitor progress without enabling dump logs.
*/
static char tiffcrop_version_id[] = "2.4";
static char tiffcrop_rev_date[] = "12-13-2010";
#include "tif_config.h"
+#include "libport.h"
#include "tiffiop.h"
#include <stdio.h>
#include <stdlib.h>
+#include <stdint.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
@@ -124,10 +126,6 @@ static char tiffcrop_rev_date[] = "12-13-2010";
# include <unistd.h>
#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif
@@ -135,32 +133,18 @@ static char tiffcrop_rev_date[] = "12-13-2010";
#define EXIT_FAILURE 1
#endif
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffio.h"
-#if defined(VMS)
-# define unlink delete
-#endif
-
#ifndef PATH_MAX
#define PATH_MAX 1024
#endif
-#define TIFF_UINT32_MAX 0xFFFFFFFFU
-
#define TRUE 1
#define FALSE 0
#ifndef TIFFhowmany
-#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
-#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
+#define TIFFhowmany(x, y) ((((uint32_t)(x))+(((uint32_t)(y))-1))/((uint32_t)(y)))
+#define TIFFhowmany8(x) (((x)&0x07)?((uint32_t)(x)>>3)+1:(uint32_t)(x)>>3)
#endif
/*
@@ -221,16 +205,16 @@ extern int getopt(int argc, char * const argv[], const char *optstring);
/* Offsets into buffer for margins and fixed width and length segments */
struct offset {
- uint32 tmargin;
- uint32 lmargin;
- uint32 bmargin;
- uint32 rmargin;
- uint32 crop_width;
- uint32 crop_length;
- uint32 startx;
- uint32 endx;
- uint32 starty;
- uint32 endy;
+ uint32_t tmargin;
+ uint32_t lmargin;
+ uint32_t bmargin;
+ uint32_t rmargin;
+ uint32_t crop_width;
+ uint32_t crop_length;
+ uint32_t startx;
+ uint32_t endx;
+ uint32_t starty;
+ uint32_t endy;
};
/* Description of a zone within the image. Position 1 of 3 zones would be
@@ -240,7 +224,7 @@ struct offset {
*/
struct buffinfo {
- uint32 size; /* size of this buffer */
+ uint32_t size; /* size of this buffer */
unsigned char *buffer; /* address of the allocated buffer */
};
@@ -250,13 +234,13 @@ struct zone {
};
struct pageseg {
- uint32 x1; /* index of left edge */
- uint32 x2; /* index of right edge */
- uint32 y1; /* index of top edge */
- uint32 y2; /* index of bottom edge */
+ uint32_t x1; /* index of left edge */
+ uint32_t x2; /* index of right edge */
+ uint32_t y1; /* index of top edge */
+ uint32_t y2; /* index of bottom edge */
int position; /* ordinal of segment to be extracted */
int total; /* total equal sized divisions of crop area */
- uint32 buffsize; /* size of buffer needed to hold the cropped zone */
+ uint32_t buffsize; /* size of buffer needed to hold the cropped zone */
};
struct coordpairs {
@@ -267,13 +251,13 @@ struct coordpairs {
};
struct region {
- uint32 x1; /* pixel offset of left edge */
- uint32 x2; /* pixel offset of right edge */
- uint32 y1; /* pixel offset of top edge */
- uint32 y2; /* picel offset of bottom edge */
- uint32 width; /* width in pixels */
- uint32 length; /* length in pixels */
- uint32 buffsize; /* size of buffer needed to hold the cropped region */
+ uint32_t x1; /* pixel offset of left edge */
+ uint32_t x2; /* pixel offset of right edge */
+ uint32_t y1; /* pixel offset of top edge */
+ uint32_t y2; /* picel offset of bottom edge */
+ uint32_t width; /* width in pixels */
+ uint32_t length; /* length in pixels */
+ uint32_t buffsize; /* size of buffer needed to hold the cropped region */
unsigned char *buffptr; /* address of start of the region */
};
@@ -287,27 +271,27 @@ struct crop_mask {
double margins[4]; /* Top, left, bottom, right margins */
float xres; /* Horizontal resolution read from image*/
float yres; /* Vertical resolution read from image */
- uint32 combined_width; /* Width of combined cropped zones */
- uint32 combined_length; /* Length of combined cropped zones */
- uint32 bufftotal; /* Size of buffer needed to hold all the cropped region */
- uint16 img_mode; /* Composite or separate images created from zones or regions */
- uint16 exp_mode; /* Export input images or selections to one or more files */
- uint16 crop_mode; /* Crop options to be applied */
- uint16 res_unit; /* Resolution unit for margins and selections */
- uint16 edge_ref; /* Reference edge for sections extraction and combination */
- uint16 rotation; /* Clockwise rotation of the extracted region or image */
- uint16 mirror; /* Mirror extracted region or image horizontally or vertically */
- uint16 invert; /* Invert the color map of image or region */
- uint16 photometric; /* Status of photometric interpretation for inverted image */
- uint16 selections; /* Number of regions or zones selected */
- uint16 regions; /* Number of regions delimited by corner coordinates */
+ uint32_t combined_width; /* Width of combined cropped zones */
+ uint32_t combined_length; /* Length of combined cropped zones */
+ uint32_t bufftotal; /* Size of buffer needed to hold all the cropped region */
+ uint16_t img_mode; /* Composite or separate images created from zones or regions */
+ uint16_t exp_mode; /* Export input images or selections to one or more files */
+ uint16_t crop_mode; /* Crop options to be applied */
+ uint16_t res_unit; /* Resolution unit for margins and selections */
+ uint16_t edge_ref; /* Reference edge for sections extraction and combination */
+ uint16_t rotation; /* Clockwise rotation of the extracted region or image */
+ uint16_t mirror; /* Mirror extracted region or image horizontally or vertically */
+ uint16_t invert; /* Invert the color map of image or region */
+ uint16_t photometric; /* Status of photometric interpretation for inverted image */
+ uint16_t selections; /* Number of regions or zones selected */
+ uint16_t regions; /* Number of regions delimited by corner coordinates */
struct region regionlist[MAX_REGIONS]; /* Regions within page or master crop region */
- uint16 zones; /* Number of zones delimited by Ordinal:Total requested */
+ uint16_t zones; /* Number of zones delimited by Ordinal:Total requested */
struct zone zonelist[MAX_REGIONS]; /* Zones indices to define a region */
struct coordpairs corners[MAX_REGIONS]; /* Coordinates of upper left and lower right corner */
};
-#define MAX_PAPERNAMES 49
+#define MAX_PAPERNAMES (sizeof(PaperTable)/sizeof(PaperTable[0])) /* was 49 */
#define MAX_PAPERNAME_LENGTH 15
#define DEFAULT_RESUNIT RESUNIT_INCH
#define DEFAULT_PAGE_HEIGHT 14.0
@@ -340,7 +324,7 @@ struct paperdef {
/* European page sizes corrected from update sent by
* thomas . jarosch @ intra2net . com on 5/7/2010
* Paper Size Width Length Aspect Ratio */
-const struct paperdef PaperTable[MAX_PAPERNAMES] = {
+static const struct paperdef PaperTable[/*MAX_PAPERNAMES*/] = {
{"default", 8.500, 14.000, 0.607},
{"pa4", 8.264, 11.000, 0.751},
{"letter", 8.500, 11.000, 0.773},
@@ -396,16 +380,16 @@ const struct paperdef PaperTable[MAX_PAPERNAMES] = {
struct image_data {
float xres;
float yres;
- uint32 width;
- uint32 length;
- uint16 res_unit;
- uint16 bps;
- uint16 spp;
- uint16 planar;
- uint16 photometric;
- uint16 orientation;
- uint16 compression;
- uint16 adjustments;
+ uint32_t width;
+ uint32_t length;
+ uint16_t res_unit;
+ uint16_t bps;
+ uint16_t spp;
+ uint16_t planar;
+ uint16_t photometric;
+ uint16_t orientation;
+ uint16_t compression;
+ uint16_t adjustments;
};
/* Structure to define the output image modifiers */
@@ -417,8 +401,8 @@ struct pagedef {
double vmargin; /* margins to subtract from height of sections */
double hres; /* horizontal resolution for output */
double vres; /* vertical resolution for output */
- uint32 mode; /* bitmask of modifiers to page format */
- uint16 res_unit; /* resolution unit for output image */
+ uint32_t mode; /* bitmask of modifiers to page format */
+ uint16_t res_unit; /* resolution unit for output image */
unsigned int rows; /* number of section rows */
unsigned int cols; /* number of section cols */
unsigned int orient; /* portrait, landscape, seascape, auto */
@@ -437,36 +421,36 @@ struct dump_opts {
/* globals */
static int outtiled = -1;
-static uint32 tilewidth = 0;
-static uint32 tilelength = 0;
-
-static uint16 config = 0;
-static uint16 compression = 0;
-static uint16 predictor = 0;
-static uint16 fillorder = 0;
-static uint32 rowsperstrip = 0;
-static uint32 g3opts = 0;
+static uint32_t tilewidth = 0;
+static uint32_t tilelength = 0;
+
+static uint16_t config = 0;
+static uint16_t compression = 0;
+static uint16_t predictor = 0;
+static uint16_t fillorder = 0;
+static uint32_t rowsperstrip = 0;
+static uint32_t g3opts = 0;
static int ignore = FALSE; /* if true, ignore read errors */
-static uint32 defg3opts = (uint32) -1;
+static uint32_t defg3opts = (uint32_t) -1;
static int quality = 100; /* JPEG quality */
/* static int jpegcolormode = -1; was JPEGCOLORMODE_RGB; */
static int jpegcolormode = JPEGCOLORMODE_RGB;
-static uint16 defcompression = (uint16) -1;
-static uint16 defpredictor = (uint16) -1;
+static uint16_t defcompression = (uint16_t) -1;
+static uint16_t defpredictor = (uint16_t) -1;
static int pageNum = 0;
static int little_endian = 1;
/* Functions adapted from tiffcp with additions or significant modifications */
-static int readContigStripsIntoBuffer (TIFF*, uint8*);
-static int readSeparateStripsIntoBuffer (TIFF*, uint8*, uint32, uint32, tsample_t, struct dump_opts *);
-static int readContigTilesIntoBuffer (TIFF*, uint8*, uint32, uint32, uint32, uint32, tsample_t, uint16);
-static int readSeparateTilesIntoBuffer (TIFF*, uint8*, uint32, uint32, uint32, uint32, tsample_t, uint16);
-static int writeBufferToContigStrips (TIFF*, uint8*, uint32);
-static int writeBufferToContigTiles (TIFF*, uint8*, uint32, uint32, tsample_t, struct dump_opts *);
-static int writeBufferToSeparateStrips (TIFF*, uint8*, uint32, uint32, tsample_t, struct dump_opts *);
-static int writeBufferToSeparateTiles (TIFF*, uint8*, uint32, uint32, tsample_t, struct dump_opts *);
-static int extractContigSamplesToBuffer (uint8 *, uint8 *, uint32, uint32, tsample_t,
- uint16, uint16, struct dump_opts *);
+static int readContigStripsIntoBuffer (TIFF*, uint8_t*);
+static int readSeparateStripsIntoBuffer (TIFF*, uint8_t*, uint32_t, uint32_t, tsample_t, struct dump_opts *);
+static int readContigTilesIntoBuffer (TIFF*, uint8_t*, uint32_t, uint32_t, uint32_t, uint32_t, tsample_t, uint16_t);
+static int readSeparateTilesIntoBuffer (TIFF*, uint8_t*, uint32_t, uint32_t, uint32_t, uint32_t, tsample_t, uint16_t);
+static int writeBufferToContigStrips (TIFF*, uint8_t*, uint32_t);
+static int writeBufferToContigTiles (TIFF*, uint8_t*, uint32_t, uint32_t, tsample_t, struct dump_opts *);
+static int writeBufferToSeparateStrips (TIFF*, uint8_t*, uint32_t, uint32_t, tsample_t, struct dump_opts *);
+static int writeBufferToSeparateTiles (TIFF*, uint8_t*, uint32_t, uint32_t, tsample_t, struct dump_opts *);
+static int extractContigSamplesToBuffer (uint8_t *, uint8_t *, uint32_t, uint32_t, tsample_t,
+ uint16_t, uint16_t, struct dump_opts *);
static int processCompressOptions(char*);
static void usage(int code);
@@ -477,10 +461,10 @@ static void initPageSetup (struct pagedef *, struct pageseg *, struct buffinfo [
static void initDumpOptions(struct dump_opts *);
/* Command line and file naming functions */
-void process_command_opts (int, char *[], char *, char *, uint32 *,
- uint16 *, uint16 *, uint32 *, uint32 *, uint32 *,
- struct crop_mask *, struct pagedef *,
- struct dump_opts *,
+void process_command_opts (int, char *[], char *, char *, uint32_t *,
+ uint16_t *, uint16_t *, uint32_t *, uint32_t *, uint32_t *,
+ struct crop_mask *, struct pagedef *,
+ struct dump_opts *,
unsigned int *, unsigned int *);
static int update_output_file (TIFF **, char *, int, char *, unsigned int *);
@@ -502,12 +486,12 @@ static int writeSelections(TIFF *, TIFF **, struct crop_mask *, struct image_da
char *, char *, unsigned int*, unsigned int);
/* Section functions */
-static int createImageSection(uint32, unsigned char **);
+static int createImageSection(uint32_t, unsigned char **);
static int extractImageSection(struct image_data *, struct pageseg *,
unsigned char *, unsigned char *);
static int writeSingleSection(TIFF *, TIFF *, struct image_data *,
- struct dump_opts *, uint32, uint32,
- double, double, unsigned char *);
+ struct dump_opts *, uint32_t, uint32_t,
+ double, double, unsigned char *);
static int writeImageSections(TIFF *, TIFF *, struct image_data *,
struct pagedef *, struct pageseg *,
struct dump_opts *, unsigned char *,
@@ -517,108 +501,108 @@ static int createCroppedImage(struct image_data *, struct crop_mask *,
unsigned char **, unsigned char **);
static int writeCroppedImage(TIFF *, TIFF *, struct image_data *image,
struct dump_opts * dump,
- uint32, uint32, unsigned char *, int, int);
+ uint32_t, uint32_t, unsigned char *, int, int);
/* Image manipulation functions */
-static int rotateContigSamples8bits(uint16, uint16, uint16, uint32,
- uint32, uint32, uint8 *, uint8 *);
-static int rotateContigSamples16bits(uint16, uint16, uint16, uint32,
- uint32, uint32, uint8 *, uint8 *);
-static int rotateContigSamples24bits(uint16, uint16, uint16, uint32,
- uint32, uint32, uint8 *, uint8 *);
-static int rotateContigSamples32bits(uint16, uint16, uint16, uint32,
- uint32, uint32, uint8 *, uint8 *);
-static int rotateImage(uint16, struct image_data *, uint32 *, uint32 *,
- unsigned char **);
-static int mirrorImage(uint16, uint16, uint16, uint32, uint32,
- unsigned char *);
-static int invertImage(uint16, uint16, uint16, uint32, uint32,
- unsigned char *);
+static int rotateContigSamples8bits(uint16_t, uint16_t, uint16_t, uint32_t,
+ uint32_t, uint32_t, uint8_t *, uint8_t *);
+static int rotateContigSamples16bits(uint16_t, uint16_t, uint16_t, uint32_t,
+ uint32_t, uint32_t, uint8_t *, uint8_t *);
+static int rotateContigSamples24bits(uint16_t, uint16_t, uint16_t, uint32_t,
+ uint32_t, uint32_t, uint8_t *, uint8_t *);
+static int rotateContigSamples32bits(uint16_t, uint16_t, uint16_t, uint32_t,
+ uint32_t, uint32_t, uint8_t *, uint8_t *);
+static int rotateImage(uint16_t, struct image_data *, uint32_t *, uint32_t *,
+ unsigned char **);
+static int mirrorImage(uint16_t, uint16_t, uint16_t, uint32_t, uint32_t,
+ unsigned char *);
+static int invertImage(uint16_t, uint16_t, uint16_t, uint32_t, uint32_t,
+ unsigned char *);
/* Functions to reverse the sequence of samples in a scanline */
-static int reverseSamples8bits (uint16, uint16, uint32, uint8 *, uint8 *);
-static int reverseSamples16bits (uint16, uint16, uint32, uint8 *, uint8 *);
-static int reverseSamples24bits (uint16, uint16, uint32, uint8 *, uint8 *);
-static int reverseSamples32bits (uint16, uint16, uint32, uint8 *, uint8 *);
-static int reverseSamplesBytes (uint16, uint16, uint32, uint8 *, uint8 *);
+static int reverseSamples8bits (uint16_t, uint16_t, uint32_t, uint8_t *, uint8_t *);
+static int reverseSamples16bits (uint16_t, uint16_t, uint32_t, uint8_t *, uint8_t *);
+static int reverseSamples24bits (uint16_t, uint16_t, uint32_t, uint8_t *, uint8_t *);
+static int reverseSamples32bits (uint16_t, uint16_t, uint32_t, uint8_t *, uint8_t *);
+static int reverseSamplesBytes (uint16_t, uint16_t, uint32_t, uint8_t *, uint8_t *);
/* Functions for manipulating individual samples in an image */
static int extractSeparateRegion(struct image_data *, struct crop_mask *,
unsigned char *, unsigned char *, int);
static int extractCompositeRegions(struct image_data *, struct crop_mask *,
unsigned char *, unsigned char *);
-static int extractContigSamples8bits (uint8 *, uint8 *, uint32,
- tsample_t, uint16, uint16,
- tsample_t, uint32, uint32);
-static int extractContigSamples16bits (uint8 *, uint8 *, uint32,
- tsample_t, uint16, uint16,
- tsample_t, uint32, uint32);
-static int extractContigSamples24bits (uint8 *, uint8 *, uint32,
- tsample_t, uint16, uint16,
- tsample_t, uint32, uint32);
-static int extractContigSamples32bits (uint8 *, uint8 *, uint32,
- tsample_t, uint16, uint16,
- tsample_t, uint32, uint32);
-static int extractContigSamplesBytes (uint8 *, uint8 *, uint32,
- tsample_t, uint16, uint16,
- tsample_t, uint32, uint32);
-static int extractContigSamplesShifted8bits (uint8 *, uint8 *, uint32,
- tsample_t, uint16, uint16,
- tsample_t, uint32, uint32,
+static int extractContigSamples8bits (uint8_t *, uint8_t *, uint32_t,
+ tsample_t, uint16_t, uint16_t,
+ tsample_t, uint32_t, uint32_t);
+static int extractContigSamples16bits (uint8_t *, uint8_t *, uint32_t,
+ tsample_t, uint16_t, uint16_t,
+ tsample_t, uint32_t, uint32_t);
+static int extractContigSamples24bits (uint8_t *, uint8_t *, uint32_t,
+ tsample_t, uint16_t, uint16_t,
+ tsample_t, uint32_t, uint32_t);
+static int extractContigSamples32bits (uint8_t *, uint8_t *, uint32_t,
+ tsample_t, uint16_t, uint16_t,
+ tsample_t, uint32_t, uint32_t);
+static int extractContigSamplesBytes (uint8_t *, uint8_t *, uint32_t,
+ tsample_t, uint16_t, uint16_t,
+ tsample_t, uint32_t, uint32_t);
+static int extractContigSamplesShifted8bits (uint8_t *, uint8_t *, uint32_t,
+ tsample_t, uint16_t, uint16_t,
+ tsample_t, uint32_t, uint32_t,
int);
-static int extractContigSamplesShifted16bits (uint8 *, uint8 *, uint32,
- tsample_t, uint16, uint16,
- tsample_t, uint32, uint32,
+static int extractContigSamplesShifted16bits (uint8_t *, uint8_t *, uint32_t,
+ tsample_t, uint16_t, uint16_t,
+ tsample_t, uint32_t, uint32_t,
int);
-static int extractContigSamplesShifted24bits (uint8 *, uint8 *, uint32,
- tsample_t, uint16, uint16,
- tsample_t, uint32, uint32,
+static int extractContigSamplesShifted24bits (uint8_t *, uint8_t *, uint32_t,
+ tsample_t, uint16_t, uint16_t,
+ tsample_t, uint32_t, uint32_t,
int);
-static int extractContigSamplesShifted32bits (uint8 *, uint8 *, uint32,
- tsample_t, uint16, uint16,
- tsample_t, uint32, uint32,
+static int extractContigSamplesShifted32bits (uint8_t *, uint8_t *, uint32_t,
+ tsample_t, uint16_t, uint16_t,
+ tsample_t, uint32_t, uint32_t,
int);
-static int extractContigSamplesToTileBuffer(uint8 *, uint8 *, uint32, uint32,
- uint32, uint32, tsample_t, uint16,
- uint16, uint16, struct dump_opts *);
+static int extractContigSamplesToTileBuffer(uint8_t *, uint8_t *, uint32_t, uint32_t,
+ uint32_t, uint32_t, tsample_t, uint16_t,
+ uint16_t, uint16_t, struct dump_opts *);
/* Functions to combine separate planes into interleaved planes */
-static int combineSeparateSamples8bits (uint8 *[], uint8 *, uint32, uint32,
- uint16, uint16, FILE *, int, int);
-static int combineSeparateSamples16bits (uint8 *[], uint8 *, uint32, uint32,
- uint16, uint16, FILE *, int, int);
-static int combineSeparateSamples24bits (uint8 *[], uint8 *, uint32, uint32,
- uint16, uint16, FILE *, int, int);
-static int combineSeparateSamples32bits (uint8 *[], uint8 *, uint32, uint32,
- uint16, uint16, FILE *, int, int);
+static int combineSeparateSamples8bits (uint8_t *[], uint8_t *, uint32_t, uint32_t,
+ uint16_t, uint16_t, FILE *, int, int);
+static int combineSeparateSamples16bits (uint8_t *[], uint8_t *, uint32_t, uint32_t,
+ uint16_t, uint16_t, FILE *, int, int);
+static int combineSeparateSamples24bits (uint8_t *[], uint8_t *, uint32_t, uint32_t,
+ uint16_t, uint16_t, FILE *, int, int);
+static int combineSeparateSamples32bits (uint8_t *[], uint8_t *, uint32_t, uint32_t,
+ uint16_t, uint16_t, FILE *, int, int);
static int combineSeparateSamplesBytes (unsigned char *[], unsigned char *,
- uint32, uint32, tsample_t, uint16,
+ uint32_t, uint32_t, tsample_t, uint16_t,
FILE *, int, int);
-static int combineSeparateTileSamples8bits (uint8 *[], uint8 *, uint32, uint32,
- uint32, uint32, uint16, uint16,
+static int combineSeparateTileSamples8bits (uint8_t *[], uint8_t *, uint32_t, uint32_t,
+ uint32_t, uint32_t, uint16_t, uint16_t,
FILE *, int, int);
-static int combineSeparateTileSamples16bits (uint8 *[], uint8 *, uint32, uint32,
- uint32, uint32, uint16, uint16,
+static int combineSeparateTileSamples16bits (uint8_t *[], uint8_t *, uint32_t, uint32_t,
+ uint32_t, uint32_t, uint16_t, uint16_t,
FILE *, int, int);
-static int combineSeparateTileSamples24bits (uint8 *[], uint8 *, uint32, uint32,
- uint32, uint32, uint16, uint16,
+static int combineSeparateTileSamples24bits (uint8_t *[], uint8_t *, uint32_t, uint32_t,
+ uint32_t, uint32_t, uint16_t, uint16_t,
FILE *, int, int);
-static int combineSeparateTileSamples32bits (uint8 *[], uint8 *, uint32, uint32,
- uint32, uint32, uint16, uint16,
+static int combineSeparateTileSamples32bits (uint8_t *[], uint8_t *, uint32_t, uint32_t,
+ uint32_t, uint32_t, uint16_t, uint16_t,
FILE *, int, int);
static int combineSeparateTileSamplesBytes (unsigned char *[], unsigned char *,
- uint32, uint32, uint32, uint32,
- tsample_t, uint16, FILE *, int, int);
+ uint32_t, uint32_t, uint32_t, uint32_t,
+ tsample_t, uint16_t, FILE *, int, int);
/* Dump functions for debugging */
static void dump_info (FILE *, int, char *, char *, ...);
-static int dump_data (FILE *, int, char *, unsigned char *, uint32);
+static int dump_data (FILE *, int, char *, unsigned char *, uint32_t);
static int dump_byte (FILE *, int, char *, unsigned char);
-static int dump_short (FILE *, int, char *, uint16);
-static int dump_long (FILE *, int, char *, uint32);
-static int dump_wide (FILE *, int, char *, uint64);
-static int dump_buffer (FILE *, int, uint32, uint32, uint32, unsigned char *);
+static int dump_short (FILE *, int, char *, uint16_t);
+static int dump_long (FILE *, int, char *, uint32_t);
+static int dump_wide (FILE *, int, char *, uint64_t);
+static int dump_buffer (FILE *, int, uint32_t, uint32_t, uint32_t, unsigned char *);
/* End function declarations */
/* Functions derived in whole or in part from tiffcp */
@@ -636,8 +620,8 @@ static tmsize_t maxMalloc = DEFAULT_MAX_MALLOC;
static void* limitMalloc(tmsize_t s)
{
if (maxMalloc && (s > maxMalloc)) {
- fprintf(stderr, "MemoryLimitError: allocation of " TIFF_UINT64_FORMAT " bytes is forbidden. Limit is " TIFF_UINT64_FORMAT ".\n",
- (uint64)s, (uint64)maxMalloc);
+ fprintf(stderr, "MemoryLimitError: allocation of %" PRIu64 " bytes is forbidden. Limit is %" PRIu64 ".\n",
+ (uint64_t)s, (uint64_t)maxMalloc);
fprintf(stderr, " use -k option to change limit.\n"); return NULL;
}
return _TIFFmalloc(s);
@@ -645,165 +629,176 @@ static void* limitMalloc(tmsize_t s)
-static const char* usage_info[] = {
-"usage: tiffcrop [options] source1 ... sourceN destination",
-"where options are:",
-" -h Print this syntax listing",
-" -v Print tiffcrop version identifier and last revision date",
-" ",
-" -a Append to output instead of overwriting",
-" -d offset Set initial directory offset, counting first image as one, not zero",
-" -p contig Pack samples contiguously (e.g. RGBRGB...)",
-" -p separate Store samples separately (e.g. RRR...GGG...BBB...)",
-" -s Write output in strips",
-" -t Write output in tiles",
-" -i Ignore read errors",
-" -k size set the memory allocation limit in MiB. 0 to disable limit",
-" ",
-" -r # Make each strip have no more than # rows",
-" -w # Set output tile width (pixels)",
-" -l # Set output tile length (pixels)",
-" ",
-" -f lsb2msb Force lsb-to-msb FillOrder for output",
-" -f msb2lsb Force msb-to-lsb FillOrder for output",
-"",
-" -c lzw[:opts] Compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts] Compress output with deflate encoding",
-" -c jpeg[:opts] Compress output with JPEG encoding",
-" -c packbits Compress output with packbits encoding",
-" -c g3[:opts] Compress output with CCITT Group 3 encoding",
-" -c g4 Compress output with CCITT Group 4 encoding",
-" -c none Use no compression algorithm on output",
-" ",
-"Group 3 options:",
-" 1d Use default CCITT Group 3 1D-encoding",
-" 2d Use optional CCITT Group 3 2D-encoding",
-" fill Byte-align EOL codes",
-"For example, -c g3:2d:fill to get G3-2D-encoded data with byte-aligned EOLs",
-" ",
-"JPEG options:",
-" # Set compression quality level (0-100, default 100)",
-" raw Output color image as raw YCbCr",
-" rgb Output color image as RGB",
-"For example, -c jpeg:rgb:50 to get JPEG-encoded RGB data with 50% comp. quality",
-" ",
-"LZW and deflate options:",
-" # Set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-" ",
-"Page and selection options:",
-" -N odd|even|#,#-#,#|last sequences and ranges of images within file to process",
-" The words odd or even may be used to specify all odd or even numbered images.",
-" The word last may be used in place of a number in the sequence to indicate.",
-" The final image in the file without knowing how many images there are.",
-" Numbers are counted from one even though TIFF IFDs are counted from zero.",
-" ",
-" -E t|l|r|b edge to use as origin for width and length of crop region",
-" -U units [in, cm, px ] inches, centimeters or pixels",
-" ",
-" -m #,#,#,# margins from edges for selection: top, left, bottom, right separated by commas",
-" -X # horizontal dimension of region to extract expressed in current units",
-" -Y # vertical dimension of region to extract expressed in current units",
-" -Z #:#,#:# zones of the image designated as position X of Y,",
-" eg 1:3 would be first of three equal portions measured from reference edge",
-" -z x1,y1,x2,y2:...:xN,yN,xN+1,yN+1",
-" regions of the image designated by upper left and lower right coordinates",
-"",
-"Export grouping options:",
-" -e c|d|i|m|s export mode for images and selections from input images.",
-" When exporting a composite image from multiple zones or regions",
-" (combined and image modes), the selections must have equal sizes",
-" for the axis perpendicular to the edge specified with -E.",
-" c|combined All images and selections are written to a single file (default).",
-" with multiple selections from one image combined into a single image.",
-" d|divided All images and selections are written to a single file",
-" with each selection from one image written to a new image.",
-" i|image Each input image is written to a new file (numeric filename sequence)",
-" with multiple selections from the image combined into one image.",
-" m|multiple Each input image is written to a new file (numeric filename sequence)",
-" with each selection from the image written to a new image.",
-" s|separated Individual selections from each image are written to separate files.",
-"",
-"Output options:",
-" -H # Set horizontal resolution of output images to #",
-" -V # Set vertical resolution of output images to #",
-" -J # Set horizontal margin of output page to # expressed in current units",
-" when sectioning image into columns x rows using the -S cols:rows option",
-" -K # Set verticalal margin of output page to # expressed in current units",
-" when sectioning image into columns x rows using the -S cols:rows option",
-" ",
-" -O orient orientation for output image, portrait, landscape, auto",
-" -P page page size for output image segments, eg letter, legal, tabloid, etc",
-" use #.#x#.# to specify a custom page size in the currently defined units",
-" where #.# represents the width and length",
-" -S cols:rows Divide the image into equal sized segments using cols across and rows down.",
-" ",
-" -F hor|vert|both",
-" flip (mirror) image or region horizontally, vertically, or both",
-" -R # [90,180,or 270] degrees clockwise rotation of image or extracted region",
-" -I [black|white|data|both]",
-" invert color space, eg dark to light for bilevel and grayscale images",
-" If argument is white or black, set the PHOTOMETRIC_INTERPRETATION ",
-" tag to MinIsBlack or MinIsWhite without altering the image data",
-" If the argument is data or both, the image data are modified:",
-" both inverts the data and the PHOTOMETRIC_INTERPRETATION tag,",
-" data inverts the data but not the PHOTOMETRIC_INTERPRETATION tag",
-" ",
-"-D opt1:value1,opt2:value2,opt3:value3:opt4:value4",
-" Debug/dump program progress and/or data to non-TIFF files.",
-" Options include the following and must be joined as a comma",
-" separate list. The use of this option is generally limited to",
-" program debugging and development of future options.",
-" ",
-" debug:N Display limited program progress indicators where larger N",
-" increase the level of detail. Note: Tiffcrop may be compiled with",
-" -DDEVELMODE to enable additional very low level debug reporting.",
-"",
-" Format:txt|raw Format any logged data as ASCII text or raw binary ",
-" values. ASCII text dumps include strings of ones and zeroes",
-" representing the binary values in the image data plus identifying headers.",
-" ",
-" level:N Specify the level of detail presented in the dump files.",
-" This can vary from dumps of the entire input or output image data to dumps",
-" of data processed by specific functions. Current range of levels is 1 to 3.",
-" ",
-" input:full-path-to-directory/input-dumpname",
-" ",
-" output:full-path-to-directory/output-dumpnaem",
-" ",
-" When dump files are being written, each image will be written to a separate",
-" file with the name built by adding a numeric sequence value to the dumpname",
-" and an extension of .txt for ASCII dumps or .bin for binary dumps.",
-" ",
-" The four debug/dump options are independent, though it makes little sense to",
-" specify a dump file without specifying a detail level.",
-" ",
-NULL
-};
+static const char usage_info[] =
+"Copy, crop, convert, extract, and/or process TIFF files\n\n"
+"usage: tiffcrop [options] source1 ... sourceN destination\n"
+"where options are:\n"
+" -h Print this syntax listing\n"
+" -v Print tiffcrop version identifier and last revision date\n"
+" \n"
+" -a Append to output instead of overwriting\n"
+" -d offset Set initial directory offset, counting first image as one, not zero\n"
+" -p contig Pack samples contiguously (e.g. RGBRGB...)\n"
+" -p separate Store samples separately (e.g. RRR...GGG...BBB...)\n"
+" -s Write output in strips\n"
+" -t Write output in tiles\n"
+" -i Ignore read errors\n"
+" -k size set the memory allocation limit in MiB. 0 to disable limit\n"
+" \n"
+" -r # Make each strip have no more than # rows\n"
+" -w # Set output tile width (pixels)\n"
+" -l # Set output tile length (pixels)\n"
+" \n"
+" -f lsb2msb Force lsb-to-msb FillOrder for output\n"
+" -f msb2lsb Force msb-to-lsb FillOrder for output\n"
+"\n"
+#ifdef LZW_SUPPORT
+" -c lzw[:opts] Compress output with Lempel-Ziv & Welch encoding\n"
+/* " LZW options:\n" */
+" # Set predictor value\n"
+" For example, -c lzw:2 for LZW-encoded data with horizontal differencing\n"
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip[:opts] Compress output with deflate encoding\n"
+/* " Deflate (ZIP) options:\n" */
+" # Set predictor value\n"
+#endif
+#ifdef JPEG_SUPPORT
+" -c jpeg[:opts] Compress output with JPEG encoding\n"
+/* " JPEG options:\n" */
+" # Set compression quality level (0-100, default 100)\n"
+" raw Output color image as raw YCbCr (default)\n"
+" rgb Output color image as RGB\n"
+" For example, -c jpeg:rgb:50 for JPEG-encoded RGB with 50% comp. quality\n"
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits Compress output with packbits encoding\n"
+#endif
+#ifdef CCITT_SUPPORT
+" -c g3[:opts] Compress output with CCITT Group 3 encoding\n"
+/* " CCITT Group 3 options:\n" */
+" 1d Use default CCITT Group 3 1D-encoding\n"
+" 2d Use optional CCITT Group 3 2D-encoding\n"
+" fill Byte-align EOL codes\n"
+" For example, -c g3:2d:fill for G3-2D-encoded data with byte-aligned EOLs\n"
+" -c g4 Compress output with CCITT Group 4 encoding\n"
+#endif
+#if defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(JPEG_SUPPORT) || defined(PACKBITS_SUPPORT) || defined(CCITT_SUPPORT)
+" -c none Use no compression algorithm on output\n"
+#endif
+"\n"
+"Page and selection options:\n"
+" -N odd|even|#,#-#,#|last sequences and ranges of images within file to process\n"
+" The words odd or even may be used to specify all odd or even numbered images.\n"
+" The word last may be used in place of a number in the sequence to indicate.\n"
+" The final image in the file without knowing how many images there are.\n"
+" Numbers are counted from one even though TIFF IFDs are counted from zero.\n"
+"\n"
+" -E t|l|r|b edge to use as origin for width and length of crop region\n"
+" -U units [in, cm, px ] inches, centimeters or pixels\n"
+" \n"
+" -m #,#,#,# margins from edges for selection: top, left, bottom, right separated by commas\n"
+" -X # horizontal dimension of region to extract expressed in current units\n"
+" -Y # vertical dimension of region to extract expressed in current units\n"
+" -Z #:#,#:# zones of the image designated as position X of Y,\n"
+" eg 1:3 would be first of three equal portions measured from reference edge\n"
+" -z x1,y1,x2,y2:...:xN,yN,xN+1,yN+1\n"
+" regions of the image designated by upper left and lower right coordinates\n"
+"\n"
+"Export grouping options:\n"
+" -e c|d|i|m|s export mode for images and selections from input images.\n"
+" When exporting a composite image from multiple zones or regions\n"
+" (combined and image modes), the selections must have equal sizes\n"
+" for the axis perpendicular to the edge specified with -E.\n"
+" c|combined All images and selections are written to a single file (default).\n"
+" with multiple selections from one image combined into a single image.\n"
+" d|divided All images and selections are written to a single file\n"
+" with each selection from one image written to a new image.\n"
+" i|image Each input image is written to a new file (numeric filename sequence)\n"
+" with multiple selections from the image combined into one image.\n"
+" m|multiple Each input image is written to a new file (numeric filename sequence)\n"
+" with each selection from the image written to a new image.\n"
+" s|separated Individual selections from each image are written to separate files.\n"
+"\n"
+"Output options:\n"
+" -H # Set horizontal resolution of output images to #\n"
+" -V # Set vertical resolution of output images to #\n"
+" -J # Set horizontal margin of output page to # expressed in current units\n"
+" when sectioning image into columns x rows using the -S cols:rows option\n"
+" -K # Set verticalal margin of output page to # expressed in current units\n"
+" when sectioning image into columns x rows using the -S cols:rows option\n"
+" \n"
+" -O orient orientation for output image, portrait, landscape, auto\n"
+" -P page page size for output image segments, eg letter, legal, tabloid, etc\n"
+" use #.#x#.# to specify a custom page size in the currently defined units\n"
+" where #.# represents the width and length\n"
+" -S cols:rows Divide the image into equal sized segments using cols across and rows down.\n"
+"\n"
+" -F hor|vert|both\n"
+" flip (mirror) image or region horizontally, vertically, or both\n"
+" -R # [90,180,or 270] degrees clockwise rotation of image or extracted region\n"
+" -I [black|white|data|both]\n"
+" invert color space, eg dark to light for bilevel and grayscale images\n"
+" If argument is white or black, set the PHOTOMETRIC_INTERPRETATION \n"
+" tag to MinIsBlack or MinIsWhite without altering the image data\n"
+" If the argument is data or both, the image data are modified:\n"
+" both inverts the data and the PHOTOMETRIC_INTERPRETATION tag,\n"
+" data inverts the data but not the PHOTOMETRIC_INTERPRETATION tag\n"
+"\n"
+"-D opt1:value1,opt2:value2,opt3:value3:opt4:value4\n"
+" Debug/dump program progress and/or data to non-TIFF files.\n"
+" Options include the following and must be joined as a comma\n"
+" separate list. The use of this option is generally limited to\n"
+" program debugging and development of future options.\n"
+"\n"
+" debug:N Display limited program progress indicators where larger N\n"
+" increase the level of detail. Note: Tiffcrop may be compiled with\n"
+" -DDEVELMODE to enable additional very low level debug reporting.\n"
+"\n"
+" Format:txt|raw Format any logged data as ASCII text or raw binary \n"
+" values. ASCII text dumps include strings of ones and zeroes\n"
+" representing the binary values in the image data plus identifying headers.\n"
+"\n"
+" level:N Specify the level of detail presented in the dump files.\n"
+" This can vary from dumps of the entire input or output image data to dumps\n"
+" of data processed by specific functions. Current range of levels is 1 to 3.\n"
+"\n"
+" input:full-path-to-directory/input-dumpname\n"
+"\n"
+" output:full-path-to-directory/output-dumpnaem\n"
+"\n"
+" When dump files are being written, each image will be written to a separate\n"
+" file with the name built by adding a numeric sequence value to the dumpname\n"
+" and an extension of .txt for ASCII dumps or .bin for binary dumps.\n"
+"\n"
+" The four debug/dump options are independent, though it makes little sense to\n"
+" specify a dump file without specifying a detail level.\n"
+"\n"
+;
/* This function could be modified to pass starting sample offset
* and number of samples as args to select fewer than spp
* from input image. These would then be passed to individual
* extractContigSampleXX routines.
*/
-static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
- uint32 imagelength,
- uint32 imagewidth,
- uint32 tw, uint32 tl,
- tsample_t spp, uint16 bps)
+static int readContigTilesIntoBuffer (TIFF* in, uint8_t* buf,
+ uint32_t imagelength,
+ uint32_t imagewidth,
+ uint32_t tw, uint32_t tl,
+ tsample_t spp, uint16_t bps)
{
int status = 1;
tsample_t sample = 0;
tsample_t count = spp;
- uint32 row, col, trow;
- uint32 nrow, ncol;
- uint32 dst_rowsize, shift_width;
- uint32 bytes_per_sample, bytes_per_pixel;
- uint32 trailing_bits, prev_trailing_bits;
- uint32 tile_rowsize = TIFFTileRowSize(in);
- uint32 src_offset, dst_offset;
- uint32 row_offset, col_offset;
- uint8 *bufp = (uint8*) buf;
+ uint32_t row, col, trow;
+ uint32_t nrow, ncol;
+ uint32_t dst_rowsize, shift_width;
+ uint32_t bytes_per_sample, bytes_per_pixel;
+ uint32_t trailing_bits, prev_trailing_bits;
+ uint32_t tile_rowsize = TIFFTileRowSize(in);
+ uint32_t src_offset, dst_offset;
+ uint32_t row_offset, col_offset;
+ uint8_t *bufp = (uint8_t*) buf;
unsigned char *src = NULL;
unsigned char *dst = NULL;
tsize_t tbytes = 0, tile_buffsize = 0;
@@ -834,7 +829,7 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
{
#ifdef DEBUG2
TIFFError("readContigTilesIntoBuffer",
- "Tilesize %lu is too small, using alternate calculation %u",
+ "Tilesize %"PRId64" is too small, using alternate calculation %"PRIu64,
tilesize, tl * tile_rowsize);
#endif
tile_buffsize = tl * tile_rowsize;
@@ -868,9 +863,8 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
if (tbytes < tilesize && !ignore)
{
TIFFError(TIFFFileName(in),
- "Error, can't read tile at row %lu col %lu, Read %lu bytes of %lu",
- (unsigned long) col, (unsigned long) row, (unsigned long)tbytes,
- (unsigned long)tilesize);
+ "Error, can't read tile at row %"PRIu32" col %"PRIu32", Read %"TIFF_SSIZE_FORMAT" bytes of %"TIFF_SSIZE_FORMAT,
+ col, row, tbytes, tilesize);
status = 0;
_TIFFfree(tilebuf);
return status;
@@ -919,8 +913,8 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
spp, bps, count, 0, ncol))
{
TIFFError("readContigTilesIntoBuffer",
- "Unable to extract row %d from tile %lu",
- row, (unsigned long)TIFFCurrentTile(in));
+ "Unable to extract row %"PRIu32" from tile %"PRIu32,
+ row, TIFFCurrentTile(in));
return 1;
}
break;
@@ -933,8 +927,8 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
prev_trailing_bits))
{
TIFFError("readContigTilesIntoBuffer",
- "Unable to extract row %d from tile %lu",
- row, (unsigned long)TIFFCurrentTile(in));
+ "Unable to extract row %"PRIu32" from tile %"PRIu32,
+ row, TIFFCurrentTile(in));
return 1;
}
break;
@@ -947,8 +941,8 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
prev_trailing_bits))
{
TIFFError("readContigTilesIntoBuffer",
- "Unable to extract row %d from tile %lu",
- row, (unsigned long)TIFFCurrentTile(in));
+ "Unable to extract row %"PRIu32" from tile %"PRIu32,
+ row, TIFFCurrentTile(in));
return 1;
}
break;
@@ -959,8 +953,8 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
prev_trailing_bits))
{
TIFFError("readContigTilesIntoBuffer",
- "Unable to extract row %d from tile %lu",
- row, (unsigned long)TIFFCurrentTile(in));
+ "Unable to extract row %"PRIu32" from tile %"PRIu32,
+ row, TIFFCurrentTile(in));
return 1;
}
break;
@@ -973,12 +967,12 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
prev_trailing_bits))
{
TIFFError("readContigTilesIntoBuffer",
- "Unable to extract row %d from tile %lu",
- row, (unsigned long)TIFFCurrentTile(in));
+ "Unable to extract row %"PRIu32" from tile %"PRIu32,
+ row, TIFFCurrentTile(in));
return 1;
}
break;
- default: TIFFError("readContigTilesIntoBuffer", "Unsupported bit depth %d", bps);
+ default: TIFFError("readContigTilesIntoBuffer", "Unsupported bit depth %"PRIu16, bps);
return 1;
}
}
@@ -993,20 +987,20 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf,
return status;
}
-static int readSeparateTilesIntoBuffer (TIFF* in, uint8 *obuf,
- uint32 imagelength, uint32 imagewidth,
- uint32 tw, uint32 tl,
- uint16 spp, uint16 bps)
+static int readSeparateTilesIntoBuffer (TIFF* in, uint8_t *obuf,
+ uint32_t imagelength, uint32_t imagewidth,
+ uint32_t tw, uint32_t tl,
+ uint16_t spp, uint16_t bps)
{
int i, status = 1, sample;
int shift_width, bytes_per_pixel;
- uint16 bytes_per_sample;
- uint32 row, col; /* Current row and col of image */
- uint32 nrow, ncol; /* Number of rows and cols in current tile */
- uint32 row_offset, col_offset; /* Output buffer offsets */
+ uint16_t bytes_per_sample;
+ uint32_t row, col; /* Current row and col of image */
+ uint32_t nrow, ncol; /* Number of rows and cols in current tile */
+ uint32_t row_offset, col_offset; /* Output buffer offsets */
tsize_t tbytes = 0, tilesize = TIFFTileSize(in);
tsample_t s;
- uint8* bufp = (uint8*)obuf;
+ uint8_t* bufp = (uint8_t*)obuf;
unsigned char *srcbuffs[MAX_SAMPLES];
unsigned char *tbuff = NULL;
@@ -1040,10 +1034,9 @@ static int readSeparateTilesIntoBuffer (TIFF* in, uint8 *obuf,
if (tbytes < 0 && !ignore)
{
TIFFError(TIFFFileName(in),
- "Error, can't read tile for row %lu col %lu, "
- "sample %lu",
- (unsigned long) col, (unsigned long) row,
- (unsigned long) s);
+ "Error, can't read tile for row %"PRIu32" col %"PRIu32", "
+ "sample %"PRIu16,
+ col, row, s);
status = 0;
for (sample = 0; (sample < spp) && (sample < MAX_SAMPLES); sample++)
{
@@ -1122,7 +1115,7 @@ static int readSeparateTilesIntoBuffer (TIFF* in, uint8 *obuf,
break;
}
break;
- default: TIFFError ("readSeparateTilesIntoBuffer", "Unsupported bit depth: %d", bps);
+ default: TIFFError ("readSeparateTilesIntoBuffer", "Unsupported bit depth: %"PRIu16, bps);
status = 0;
break;
}
@@ -1140,9 +1133,9 @@ static int readSeparateTilesIntoBuffer (TIFF* in, uint8 *obuf,
return status;
}
-static int writeBufferToContigStrips(TIFF* out, uint8* buf, uint32 imagelength)
+static int writeBufferToContigStrips(TIFF* out, uint8_t* buf, uint32_t imagelength)
{
- uint32 row, nrows, rowsperstrip;
+ uint32_t row, nrows, rowsperstrip;
tstrip_t strip = 0;
tsize_t stripsize;
@@ -1154,7 +1147,7 @@ static int writeBufferToContigStrips(TIFF* out, uint8* buf, uint32 imagelength)
stripsize = TIFFVStripSize(out, nrows);
if (TIFFWriteEncodedStrip(out, strip++, buf, stripsize) < 0)
{
- TIFFError(TIFFFileName(out), "Error, can't write strip %u", strip - 1);
+ TIFFError(TIFFFileName(out), "Error, can't write strip %"PRIu32, strip - 1);
return 1;
}
buf += stripsize;
@@ -1172,14 +1165,14 @@ static int writeBufferToContigStrips(TIFF* out, uint8* buf, uint32 imagelength)
* before any strips or tiles of a different plane are stored.
*/
static int
-writeBufferToSeparateStrips (TIFF* out, uint8* buf,
- uint32 length, uint32 width, uint16 spp,
- struct dump_opts *dump)
+writeBufferToSeparateStrips (TIFF* out, uint8_t* buf,
+ uint32_t length, uint32_t width, uint16_t spp,
+ struct dump_opts *dump)
{
- uint8 *src;
- uint16 bps;
- uint32 row, nrows, rowsize, rowsperstrip;
- uint32 bytes_per_sample;
+ uint8_t *src;
+ uint16_t bps;
+ uint32_t row, nrows, rowsize, rowsperstrip;
+ uint32_t bytes_per_sample;
tsample_t s;
tstrip_t strip = 0;
tsize_t stripsize = TIFFStripSize(out);
@@ -1191,20 +1184,20 @@ writeBufferToSeparateStrips (TIFF* out, uint8* buf,
(void) TIFFGetFieldDefaulted(out, TIFFTAG_BITSPERSAMPLE, &bps);
bytes_per_sample = (bps + 7) / 8;
if( width == 0 ||
- (uint32)bps * (uint32)spp > TIFF_UINT32_MAX / width ||
- bps * spp * width > TIFF_UINT32_MAX - 7U )
+ (uint32_t)bps * (uint32_t)spp > UINT32_MAX / width ||
+ bps * spp * width > UINT32_MAX - 7U )
{
TIFFError(TIFFFileName(out),
- "Error, uint32 overflow when computing (bps * spp * width) + 7");
+ "Error, uint32_t overflow when computing (bps * spp * width) + 7");
return 1;
}
rowsize = ((bps * spp * width) + 7U) / 8; /* source has interleaved samples */
if( bytes_per_sample == 0 ||
- rowsperstrip > TIFF_UINT32_MAX / bytes_per_sample ||
- rowsperstrip * bytes_per_sample > TIFF_UINT32_MAX / (width + 1) )
+ rowsperstrip > UINT32_MAX / bytes_per_sample ||
+ rowsperstrip * bytes_per_sample > UINT32_MAX / (width + 1) )
{
TIFFError(TIFFFileName(out),
- "Error, uint32 overflow when computing rowsperstrip * "
+ "Error, uint32_t overflow when computing rowsperstrip * "
"bytes_per_sample * (width + 1)");
return 1;
}
@@ -1239,7 +1232,7 @@ writeBufferToSeparateStrips (TIFF* out, uint8* buf,
if (TIFFWriteEncodedStrip(out, strip++, obuf, stripsize) < 0)
{
- TIFFError(TIFFFileName(out), "Error, can't write strip %u", strip - 1);
+ TIFFError(TIFFFileName(out), "Error, can't write strip %"PRIu32, strip - 1);
_TIFFfree(obuf);
return 1;
}
@@ -1253,16 +1246,16 @@ writeBufferToSeparateStrips (TIFF* out, uint8* buf,
/* Extract all planes from contiguous buffer into a single tile buffer
* to be written out as a tile.
*/
-static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
- uint32 imagewidth, tsample_t spp,
- struct dump_opts* dump)
+static int writeBufferToContigTiles (TIFF* out, uint8_t* buf, uint32_t imagelength,
+ uint32_t imagewidth, tsample_t spp,
+ struct dump_opts* dump)
{
- uint16 bps;
- uint32 tl, tw;
- uint32 row, col, nrow, ncol;
- uint32 src_rowsize, col_offset;
- uint32 tile_rowsize = TIFFTileRowSize(out);
- uint8* bufp = (uint8*) buf;
+ uint16_t bps;
+ uint32_t tl, tw;
+ uint32_t row, col, nrow, ncol;
+ uint32_t src_rowsize, col_offset;
+ uint32_t tile_rowsize = TIFFTileRowSize(out);
+ uint8_t* bufp = (uint8_t*) buf;
tsize_t tile_buffsize = 0;
tsize_t tilesize = TIFFTileSize(out);
unsigned char *tilebuf = NULL;
@@ -1283,7 +1276,7 @@ static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
{
#ifdef DEBUG2
TIFFError("writeBufferToContigTiles",
- "Tilesize %lu is too small, using alternate calculation %u",
+ "Tilesize %"PRId64" is too small, using alternate calculation %"PRIu32,
tilesize, tl * tile_rowsize);
#endif
tile_buffsize = tl * tile_rowsize;
@@ -1295,11 +1288,11 @@ static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
}
if( imagewidth == 0 ||
- (uint32)bps * (uint32)spp > TIFF_UINT32_MAX / imagewidth ||
- bps * spp * imagewidth > TIFF_UINT32_MAX - 7U )
+ (uint32_t)bps * (uint32_t)spp > UINT32_MAX / imagewidth ||
+ bps * spp * imagewidth > UINT32_MAX - 7U )
{
TIFFError(TIFFFileName(out),
- "Error, uint32 overflow when computing (imagewidth * bps * spp) + 7");
+ "Error, uint32_t overflow when computing (imagewidth * bps * spp) + 7");
return 1;
}
src_rowsize = ((imagewidth * spp * bps) + 7U) / 8;
@@ -1324,8 +1317,8 @@ static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
tw, 0, spp, spp, bps, dump) > 0)
{
TIFFError("writeBufferToContigTiles",
- "Unable to extract data to tile for row %lu, col %lu",
- (unsigned long) row, (unsigned long)col);
+ "Unable to extract data to tile for row %"PRIu32", col %"PRIu32,
+ row, col);
_TIFFfree(tilebuf);
return 1;
}
@@ -1333,8 +1326,8 @@ static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
if (TIFFWriteTile(out, tilebuf, col, row, 0, 0) < 0)
{
TIFFError("writeBufferToContigTiles",
- "Cannot write tile at %lu %lu",
- (unsigned long) col, (unsigned long) row);
+ "Cannot write tile at %"PRIu32" %"PRIu32,
+ col, row);
_TIFFfree(tilebuf);
return 1;
}
@@ -1348,17 +1341,17 @@ static int writeBufferToContigTiles (TIFF* out, uint8* buf, uint32 imagelength,
/* Extract each plane from contiguous buffer into a single tile buffer
* to be written out as a tile.
*/
-static int writeBufferToSeparateTiles (TIFF* out, uint8* buf, uint32 imagelength,
- uint32 imagewidth, tsample_t spp,
+static int writeBufferToSeparateTiles (TIFF* out, uint8_t* buf, uint32_t imagelength,
+ uint32_t imagewidth, tsample_t spp,
struct dump_opts * dump)
{
tdata_t obuf = limitMalloc(TIFFTileSize(out));
- uint32 tl, tw;
- uint32 row, col, nrow, ncol;
- uint32 src_rowsize, col_offset;
- uint16 bps;
+ uint32_t tl, tw;
+ uint32_t row, col, nrow, ncol;
+ uint32_t src_rowsize, col_offset;
+ uint16_t bps;
tsample_t s;
- uint8* bufp = (uint8*) buf;
+ uint8_t* bufp = (uint8_t*) buf;
if (obuf == NULL)
return 1;
@@ -1366,14 +1359,17 @@ static int writeBufferToSeparateTiles (TIFF* out, uint8* buf, uint32 imagelength
if( !TIFFGetField(out, TIFFTAG_TILELENGTH, &tl) ||
!TIFFGetField(out, TIFFTAG_TILEWIDTH, &tw) ||
!TIFFGetField(out, TIFFTAG_BITSPERSAMPLE, &bps) )
+ {
+ _TIFFfree(obuf);
return 1;
+ }
if( imagewidth == 0 ||
- (uint32)bps * (uint32)spp > TIFF_UINT32_MAX / imagewidth ||
- bps * spp * imagewidth > TIFF_UINT32_MAX - 7 )
+ (uint32_t)bps * (uint32_t)spp > UINT32_MAX / imagewidth ||
+ bps * spp * imagewidth > UINT32_MAX - 7 )
{
TIFFError(TIFFFileName(out),
- "Error, uint32 overflow when computing (imagewidth * bps * spp) + 7");
+ "Error, uint32_t overflow when computing (imagewidth * bps * spp) + 7");
_TIFFfree(obuf);
return 1;
}
@@ -1399,8 +1395,8 @@ static int writeBufferToSeparateTiles (TIFF* out, uint8* buf, uint32 imagelength
tw, s, 1, spp, bps, dump) > 0)
{
TIFFError("writeBufferToSeparateTiles",
- "Unable to extract data to tile for row %lu, col %lu sample %d",
- (unsigned long) row, (unsigned long)col, (int)s);
+ "Unable to extract data to tile for row %"PRIu32", col %"PRIu32" sample %"PRIu16,
+ row, col, s);
_TIFFfree(obuf);
return 1;
}
@@ -1408,9 +1404,8 @@ static int writeBufferToSeparateTiles (TIFF* out, uint8* buf, uint32 imagelength
if (TIFFWriteTile(out, obuf, col, row, 0, s) < 0)
{
TIFFError("writeBufferToseparateTiles",
- "Cannot write tile at %lu %lu sample %lu",
- (unsigned long) col, (unsigned long) row,
- (unsigned long) s);
+ "Cannot write tile at %"PRIu32" %"PRIu32" sample %"PRIu16,
+ col, row, s);
_TIFFfree(obuf);
return 1;
}
@@ -1426,7 +1421,7 @@ static void
processG3Options(char* cp)
{
if( (cp = strchr(cp, ':')) ) {
- if (defg3opts == (uint32) -1)
+ if (defg3opts == (uint32_t) -1)
defg3opts = 0;
do {
cp++;
@@ -1504,15 +1499,13 @@ processCompressOptions(char* opt)
static void
usage(int code)
- {
- int i;
- FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
+{
+ FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
- fprintf(out, "\n%s\n", TIFFGetVersion());
- for (i = 0; usage_info[i] != NULL; i++)
- fprintf(out, "%s\n", usage_info[i]);
- exit(code);
- }
+ fprintf(out, "\n%s\n\n", TIFFGetVersion());
+ fprintf(out, "%s", usage_info);
+ exit(code);
+}
#define CopyField(tag, v) \
if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v)
@@ -1524,27 +1517,27 @@ usage(int code)
if (TIFFGetField(in, tag, &v1, &v2, &v3, &v4)) TIFFSetField(out, tag, v1, v2, v3, v4)
static void
-cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
+cpTag(TIFF* in, TIFF* out, uint16_t tag, uint16_t count, TIFFDataType type)
{
switch (type) {
case TIFF_SHORT:
if (count == 1) {
- uint16 shortv;
+ uint16_t shortv;
CopyField(tag, shortv);
} else if (count == 2) {
- uint16 shortv1, shortv2;
+ uint16_t shortv1, shortv2;
CopyField2(tag, shortv1, shortv2);
} else if (count == 4) {
- uint16 *tr, *tg, *tb, *ta;
+ uint16_t *tr, *tg, *tb, *ta;
CopyField4(tag, tr, tg, tb, ta);
- } else if (count == (uint16) -1) {
- uint16 shortv1;
- uint16* shortav;
+ } else if (count == (uint16_t) -1) {
+ uint16_t shortv1;
+ uint16_t* shortav;
CopyField2(tag, shortv1, shortav);
}
break;
case TIFF_LONG:
- { uint32 longv;
+ { uint32_t longv;
CopyField(tag, longv);
}
break;
@@ -1552,7 +1545,7 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
float floatv;
CopyField(tag, floatv);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
float* floatav;
CopyField(tag, floatav);
}
@@ -1566,21 +1559,21 @@ cpTag(TIFF* in, TIFF* out, uint16 tag, uint16 count, TIFFDataType type)
if (count == 1) {
double doublev;
CopyField(tag, doublev);
- } else if (count == (uint16) -1) {
+ } else if (count == (uint16_t) -1) {
double* doubleav;
CopyField(tag, doubleav);
}
break;
default:
TIFFError(TIFFFileName(in),
- "Data type %d is not supported, tag %d skipped",
+ "Data type %"PRIu16" is not supported, tag %d skipped",
tag, type);
}
}
-static struct cpTag {
- uint16 tag;
- uint16 count;
+static const struct cpTag {
+ uint16_t tag;
+ uint16_t count;
TIFFDataType type;
} tags[] = {
{ TIFFTAG_SUBFILETYPE, 1, TIFF_LONG },
@@ -1591,41 +1584,41 @@ static struct cpTag {
{ TIFFTAG_MODEL, 1, TIFF_ASCII },
{ TIFFTAG_MINSAMPLEVALUE, 1, TIFF_SHORT },
{ TIFFTAG_MAXSAMPLEVALUE, 1, TIFF_SHORT },
- { TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL },
- { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL },
- { TIFFTAG_PAGENAME, 1, TIFF_ASCII },
- { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
- { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
- { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
- { TIFFTAG_DATETIME, 1, TIFF_ASCII },
- { TIFFTAG_ARTIST, 1, TIFF_ASCII },
- { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
- { TIFFTAG_WHITEPOINT, (uint16) -1, TIFF_RATIONAL },
- { TIFFTAG_PRIMARYCHROMATICITIES,(uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
- { TIFFTAG_INKSET, 1, TIFF_SHORT },
- { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
- { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
- { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
- { TIFFTAG_YCBCRCOEFFICIENTS, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
- { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
- { TIFFTAG_REFERENCEBLACKWHITE, (uint16) -1,TIFF_RATIONAL },
- { TIFFTAG_EXTRASAMPLES, (uint16) -1, TIFF_SHORT },
- { TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE },
- { TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE },
- { TIFFTAG_STONITS, 1, TIFF_DOUBLE },
+ { TIFFTAG_XRESOLUTION, 1, TIFF_RATIONAL },
+ { TIFFTAG_YRESOLUTION, 1, TIFF_RATIONAL },
+ { TIFFTAG_PAGENAME, 1, TIFF_ASCII },
+ { TIFFTAG_XPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_YPOSITION, 1, TIFF_RATIONAL },
+ { TIFFTAG_RESOLUTIONUNIT, 1, TIFF_SHORT },
+ { TIFFTAG_SOFTWARE, 1, TIFF_ASCII },
+ { TIFFTAG_DATETIME, 1, TIFF_ASCII },
+ { TIFFTAG_ARTIST, 1, TIFF_ASCII },
+ { TIFFTAG_HOSTCOMPUTER, 1, TIFF_ASCII },
+ { TIFFTAG_WHITEPOINT, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_PRIMARYCHROMATICITIES,(uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_HALFTONEHINTS, 2, TIFF_SHORT },
+ { TIFFTAG_INKSET, 1, TIFF_SHORT },
+ { TIFFTAG_DOTRANGE, 2, TIFF_SHORT },
+ { TIFFTAG_TARGETPRINTER, 1, TIFF_ASCII },
+ { TIFFTAG_SAMPLEFORMAT, 1, TIFF_SHORT },
+ { TIFFTAG_YCBCRCOEFFICIENTS, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_YCBCRSUBSAMPLING, 2, TIFF_SHORT },
+ { TIFFTAG_YCBCRPOSITIONING, 1, TIFF_SHORT },
+ { TIFFTAG_REFERENCEBLACKWHITE, (uint16_t) -1, TIFF_RATIONAL },
+ { TIFFTAG_EXTRASAMPLES, (uint16_t) -1, TIFF_SHORT },
+ { TIFFTAG_SMINSAMPLEVALUE, 1, TIFF_DOUBLE },
+ { TIFFTAG_SMAXSAMPLEVALUE, 1, TIFF_DOUBLE },
+ { TIFFTAG_STONITS, 1, TIFF_DOUBLE },
};
#define NTAGS (sizeof (tags) / sizeof (tags[0]))
#define CopyTag(tag, count, type) cpTag(in, out, tag, count, type)
/* Functions written by Richard Nolde, with exceptions noted. */
-void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32 *dirnum,
- uint16 *defconfig, uint16 *deffillorder, uint32 *deftilewidth,
- uint32 *deftilelength, uint32 *defrowsperstrip,
- struct crop_mask *crop_data, struct pagedef *page,
+void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32_t *dirnum,
+ uint16_t *defconfig, uint16_t *deffillorder, uint32_t *deftilewidth,
+ uint32_t *deftilelength, uint32_t *defrowsperstrip,
+ struct crop_mask *crop_data, struct pagedef *page,
struct dump_opts *dump,
unsigned int *imagelist, unsigned int *image_count )
{
@@ -1750,7 +1743,7 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
&crop_data->corners[i].X1, &crop_data->corners[i].Y1,
&crop_data->corners[i].X2, &crop_data->corners[i].Y2) != 4)
{
- TIFFError ("Unable to parse coordinates for region", "%d %s", i, optarg);
+ TIFFError ("Unable to parse coordinates for region", "%u %s", i, optarg);
TIFFError ("For valid options type", "tiffcrop -h");
exit (EXIT_FAILURE);
}
@@ -1925,11 +1918,11 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
TIFFError ("For valid options type", "tiffcrop -h");
exit (EXIT_FAILURE);
break;
- case 'J': /* horizontal margin for sectioned ouput pages */
+ case 'J': /* horizontal margin for sectioned output pages */
page->hmargin = atof(optarg);
page->mode |= PAGE_MODE_MARGINS;
break;
- case 'K': /* vertical margin for sectioned ouput pages*/
+ case 'K': /* vertical margin for sectioned output pages*/
page->vmargin = atof(optarg);
page->mode |= PAGE_MODE_MARGINS;
break;
@@ -2036,11 +2029,11 @@ void process_command_opts (int argc, char *argv[], char *mp, char *mode, uint32
crop_data->crop_mode |= CROP_ROTATE;
switch (strtoul(optarg, NULL, 0))
{
- case 90: crop_data->rotation = (uint16)90;
+ case 90: crop_data->rotation = (uint16_t)90;
break;
- case 180: crop_data->rotation = (uint16)180;
+ case 180: crop_data->rotation = (uint16_t)180;
break;
- case 270: crop_data->rotation = (uint16)270;
+ case 270: crop_data->rotation = (uint16_t)270;
break;
default: TIFFError ("Rotation must be 90, 180, or 270 degrees clockwise", "%s", optarg);
TIFFError ("For valid options type", "tiffcrop -h");
@@ -2211,12 +2204,12 @@ main(int argc, char* argv[])
#if !HAVE_DECL_OPTARG
extern int optind;
#endif
- uint16 defconfig = (uint16) -1;
- uint16 deffillorder = 0;
- uint32 deftilewidth = (uint32) 0;
- uint32 deftilelength = (uint32) 0;
- uint32 defrowsperstrip = (uint32) 0;
- uint32 dirnum = 0;
+ uint16_t defconfig = (uint16_t) -1;
+ uint16_t deffillorder = 0;
+ uint32_t deftilewidth = (uint32_t) 0;
+ uint32_t deftilelength = (uint32_t) 0;
+ uint32_t defrowsperstrip = (uint32_t) 0;
+ uint32_t dirnum = 0;
TIFF *in = NULL;
TIFF *out = NULL;
@@ -2306,8 +2299,8 @@ main(int argc, char* argv[])
if (dirnum > (total_images))
{
TIFFError (TIFFFileName(in),
- "Invalid image number %d, File contains only %d images",
- (int)dirnum + 1, total_images);
+ "Invalid image number %"PRIu32", File contains only %"PRIu32" images",
+ dirnum + 1u, total_images);
if (out != NULL)
(void) TIFFClose(out);
return (1);
@@ -2315,7 +2308,7 @@ main(int argc, char* argv[])
if (dirnum != 0 && !TIFFSetDirectory(in, (tdir_t)dirnum))
{
- TIFFError(TIFFFileName(in),"Error, setting subdirectory at %d", dirnum);
+ TIFFError(TIFFFileName(in),"Error, setting subdirectory at %"PRIu32, dirnum);
if (out != NULL)
(void) TIFFClose(out);
return (1);
@@ -2353,7 +2346,7 @@ main(int argc, char* argv[])
TIFFError ("Unable to open dump file for writing", "%s", temp_filename);
exit (EXIT_FAILURE);
}
- dump_info(dump.infile, dump.format, "Reading image","%d from %s",
+ dump_info(dump.infile, dump.format, "Reading image","%u from %s",
dump_images, TIFFFileName(in));
}
length = strlen(dump.outfilename);
@@ -2372,7 +2365,7 @@ main(int argc, char* argv[])
TIFFError ("Unable to open dump file for writing", "%s", temp_filename);
exit (EXIT_FAILURE);
}
- dump_info(dump.outfile, dump.format, "Writing image","%d from %s",
+ dump_info(dump.outfile, dump.format, "Writing image","%u from %s",
dump_images, TIFFFileName(in));
}
}
@@ -2516,10 +2509,10 @@ main(int argc, char* argv[])
/* Debugging functions */
-static int dump_data (FILE *dumpfile, int format, char *dump_tag, unsigned char *data, uint32 count)
+static int dump_data (FILE *dumpfile, int format, char *dump_tag, unsigned char *data, uint32_t count)
{
int j, k;
- uint32 i;
+ uint32_t i;
char dump_array[10];
unsigned char bitset;
@@ -2591,7 +2584,7 @@ static int dump_byte (FILE *dumpfile, int format, char *dump_tag, unsigned char
return (0);
}
-static int dump_short (FILE *dumpfile, int format, char *dump_tag, uint16 data)
+static int dump_short (FILE *dumpfile, int format, char *dump_tag, uint16_t data)
{
int j, k;
char dump_array[20];
@@ -2628,7 +2621,7 @@ static int dump_short (FILE *dumpfile, int format, char *dump_tag, uint16 data)
return (0);
}
-static int dump_long (FILE *dumpfile, int format, char *dump_tag, uint32 data)
+static int dump_long (FILE *dumpfile, int format, char *dump_tag, uint32_t data)
{
int j, k;
char dump_array[40];
@@ -2645,7 +2638,7 @@ static int dump_long (FILE *dumpfile, int format, char *dump_tag, uint32 data)
fprintf (dumpfile," %s ", dump_tag);
for (j = 0, k = 31; k >= 0; j++, k--)
{
- bitset = data & (((uint32)1 << k)) ? 1 : 0;
+ bitset = data & (((uint32_t)1 << k)) ? 1 : 0;
sprintf(&dump_array[j], (bitset) ? "1" : "0");
if ((k % 8) == 0)
sprintf(&dump_array[++j], " ");
@@ -2664,7 +2657,7 @@ static int dump_long (FILE *dumpfile, int format, char *dump_tag, uint32 data)
return (0);
}
-static int dump_wide (FILE *dumpfile, int format, char *dump_tag, uint64 data)
+static int dump_wide (FILE *dumpfile, int format, char *dump_tag, uint64_t data)
{
int j, k;
char dump_array[80];
@@ -2681,7 +2674,7 @@ static int dump_wide (FILE *dumpfile, int format, char *dump_tag, uint64 data)
fprintf (dumpfile," %s ", dump_tag);
for (j = 0, k = 63; k >= 0; j++, k--)
{
- bitset = data & (((uint64)1 << k)) ? 1 : 0;
+ bitset = data & (((uint64_t)1 << k)) ? 1 : 0;
sprintf(&dump_array[j], (bitset) ? "1" : "0");
if ((k % 8) == 0)
sprintf(&dump_array[++j], " ");
@@ -2714,11 +2707,11 @@ static void dump_info(FILE *dumpfile, int format, char *prefix, char *msg, ...)
}
}
-static int dump_buffer (FILE* dumpfile, int format, uint32 rows, uint32 width,
- uint32 row, unsigned char *buff)
+static int dump_buffer (FILE* dumpfile, int format, uint32_t rows, uint32_t width,
+ uint32_t row, unsigned char *buff)
{
int j, k;
- uint32 i;
+ uint32_t i;
unsigned char * dump_ptr;
if (dumpfile == NULL)
@@ -2732,8 +2725,8 @@ static int dump_buffer (FILE* dumpfile, int format, uint32 rows, uint32 width,
dump_ptr = buff + (i * width);
if (format == DUMP_TEXT)
dump_info (dumpfile, format, "",
- "Row %4d, %d bytes at offset %d",
- row + i + 1, width, row * width);
+ "Row %4"PRIu32", %"PRIu32" bytes at offset %"PRIu32,
+ row + i + 1u, width, row * width);
for (j = 0, k = width; k >= 10; j += 10, k -= 10, dump_ptr += 10)
dump_data (dumpfile, format, "", dump_ptr, 10);
@@ -2750,15 +2743,15 @@ static int dump_buffer (FILE* dumpfile, int format, uint32 rows, uint32 width,
*/
static int
-extractContigSamplesBytes (uint8 *in, uint8 *out, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
- tsample_t count, uint32 start, uint32 end)
+extractContigSamplesBytes (uint8_t *in, uint8_t *out, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
+ tsample_t count, uint32_t start, uint32_t end)
{
int i, bytes_per_sample, sindex;
- uint32 col, dst_rowsize, bit_offset;
- uint32 src_byte /*, src_bit */;
- uint8 *src = in;
- uint8 *dst = out;
+ uint32_t col, dst_rowsize, bit_offset;
+ uint32_t src_byte /*, src_bit */;
+ uint8_t *src = in;
+ uint8_t *dst = out;
if ((src == NULL) || (dst == NULL))
{
@@ -2769,13 +2762,13 @@ extractContigSamplesBytes (uint8 *in, uint8 *out, uint32 cols,
if ((start > end) || (start > cols))
{
TIFFError ("extractContigSamplesBytes",
- "Invalid start column value %d ignored", start);
+ "Invalid start column value %"PRIu32" ignored", start);
start = 0;
}
if ((end == 0) || (end > cols))
{
TIFFError ("extractContigSamplesBytes",
- "Invalid end column value %d ignored", end);
+ "Invalid end column value %"PRIu32" ignored", end);
end = cols;
}
@@ -2816,16 +2809,16 @@ extractContigSamplesBytes (uint8 *in, uint8 *out, uint32 cols,
} /* end extractContigSamplesBytes */
static int
-extractContigSamples8bits (uint8 *in, uint8 *out, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
- tsample_t count, uint32 start, uint32 end)
+extractContigSamples8bits (uint8_t *in, uint8_t *out, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
+ tsample_t count, uint32_t start, uint32_t end)
{
int ready_bits = 0, sindex = 0;
- uint32 col, src_byte, src_bit, bit_offset;
- uint8 maskbits = 0, matchbits = 0;
- uint8 buff1 = 0, buff2 = 0;
- uint8 *src = in;
- uint8 *dst = out;
+ uint32_t col, src_byte, src_bit, bit_offset;
+ uint8_t maskbits = 0, matchbits = 0;
+ uint8_t buff1 = 0, buff2 = 0;
+ uint8_t *src = in;
+ uint8_t *dst = out;
if ((src == NULL) || (dst == NULL))
{
@@ -2836,18 +2829,18 @@ extractContigSamples8bits (uint8 *in, uint8 *out, uint32 cols,
if ((start > end) || (start > cols))
{
TIFFError ("extractContigSamples8bits",
- "Invalid start column value %d ignored", start);
+ "Invalid start column value %"PRIu32" ignored", start);
start = 0;
}
if ((end == 0) || (end > cols))
{
TIFFError ("extractContigSamples8bits",
- "Invalid end column value %d ignored", end);
+ "Invalid end column value %"PRIu32" ignored", end);
end = cols;
}
ready_bits = 0;
- maskbits = (uint8)-1 >> ( 8 - bps);
+ maskbits = (uint8_t)-1 >> (8 - bps);
buff1 = buff2 = 0;
for (col = start; col < end; col++)
{ /* Compute src byte(s) and bits within byte(s) */
@@ -2893,17 +2886,17 @@ extractContigSamples8bits (uint8 *in, uint8 *out, uint32 cols,
} /* end extractContigSamples8bits */
static int
-extractContigSamples16bits (uint8 *in, uint8 *out, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
- tsample_t count, uint32 start, uint32 end)
+extractContigSamples16bits (uint8_t *in, uint8_t *out, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
+ tsample_t count, uint32_t start, uint32_t end)
{
int ready_bits = 0, sindex = 0;
- uint32 col, src_byte, src_bit, bit_offset;
- uint16 maskbits = 0, matchbits = 0;
- uint16 buff1 = 0, buff2 = 0;
- uint8 bytebuff = 0;
- uint8 *src = in;
- uint8 *dst = out;
+ uint32_t col, src_byte, src_bit, bit_offset;
+ uint16_t maskbits = 0, matchbits = 0;
+ uint16_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff = 0;
+ uint8_t *src = in;
+ uint8_t *dst = out;
if ((src == NULL) || (dst == NULL))
{
@@ -2914,18 +2907,18 @@ extractContigSamples16bits (uint8 *in, uint8 *out, uint32 cols,
if ((start > end) || (start > cols))
{
TIFFError ("extractContigSamples16bits",
- "Invalid start column value %d ignored", start);
+ "Invalid start column value %"PRIu32" ignored", start);
start = 0;
}
if ((end == 0) || (end > cols))
{
TIFFError ("extractContigSamples16bits",
- "Invalid end column value %d ignored", end);
+ "Invalid end column value %"PRIu32" ignored", end);
end = cols;
}
ready_bits = 0;
- maskbits = (uint16)-1 >> (16 - bps);
+ maskbits = (uint16_t)-1 >> (16 - bps);
for (col = start; col < end; col++)
{ /* Compute src byte(s) and bits within byte(s) */
@@ -2982,17 +2975,17 @@ extractContigSamples16bits (uint8 *in, uint8 *out, uint32 cols,
static int
-extractContigSamples24bits (uint8 *in, uint8 *out, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
- tsample_t count, uint32 start, uint32 end)
+extractContigSamples24bits (uint8_t *in, uint8_t *out, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
+ tsample_t count, uint32_t start, uint32_t end)
{
int ready_bits = 0, sindex = 0;
- uint32 col, src_byte, src_bit, bit_offset;
- uint32 maskbits = 0, matchbits = 0;
- uint32 buff1 = 0, buff2 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0;
- uint8 *src = in;
- uint8 *dst = out;
+ uint32_t col, src_byte, src_bit, bit_offset;
+ uint32_t maskbits = 0, matchbits = 0;
+ uint32_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0;
+ uint8_t *src = in;
+ uint8_t *dst = out;
if ((in == NULL) || (out == NULL))
{
@@ -3003,18 +2996,18 @@ extractContigSamples24bits (uint8 *in, uint8 *out, uint32 cols,
if ((start > end) || (start > cols))
{
TIFFError ("extractContigSamples24bits",
- "Invalid start column value %d ignored", start);
+ "Invalid start column value %"PRIu32" ignored", start);
start = 0;
}
if ((end == 0) || (end > cols))
{
TIFFError ("extractContigSamples24bits",
- "Invalid end column value %d ignored", end);
+ "Invalid end column value %"PRIu32" ignored", end);
end = cols;
}
ready_bits = 0;
- maskbits = (uint32)-1 >> ( 32 - bps);
+ maskbits = (uint32_t)-1 >> (32 - bps);
for (col = start; col < end; col++)
{
/* Compute src byte(s) and bits within byte(s) */
@@ -3091,18 +3084,18 @@ extractContigSamples24bits (uint8 *in, uint8 *out, uint32 cols,
} /* end extractContigSamples24bits */
static int
-extractContigSamples32bits (uint8 *in, uint8 *out, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
- tsample_t count, uint32 start, uint32 end)
+extractContigSamples32bits (uint8_t *in, uint8_t *out, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
+ tsample_t count, uint32_t start, uint32_t end)
{
int ready_bits = 0, sindex = 0 /*, shift_width = 0 */;
- uint32 col, src_byte, src_bit, bit_offset;
- uint32 longbuff1 = 0, longbuff2 = 0;
- uint64 maskbits = 0, matchbits = 0;
- uint64 buff1 = 0, buff2 = 0, buff3 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
- uint8 *src = in;
- uint8 *dst = out;
+ uint32_t col, src_byte, src_bit, bit_offset;
+ uint32_t longbuff1 = 0, longbuff2 = 0;
+ uint64_t maskbits = 0, matchbits = 0;
+ uint64_t buff1 = 0, buff2 = 0, buff3 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
+ uint8_t *src = in;
+ uint8_t *dst = out;
if ((in == NULL) || (out == NULL))
{
@@ -3114,19 +3107,19 @@ extractContigSamples32bits (uint8 *in, uint8 *out, uint32 cols,
if ((start > end) || (start > cols))
{
TIFFError ("extractContigSamples32bits",
- "Invalid start column value %d ignored", start);
+ "Invalid start column value %"PRIu32" ignored", start);
start = 0;
}
if ((end == 0) || (end > cols))
{
TIFFError ("extractContigSamples32bits",
- "Invalid end column value %d ignored", end);
+ "Invalid end column value %"PRIu32" ignored", end);
end = cols;
}
/* shift_width = ((bps + 7) / 8) + 1; */
ready_bits = 0;
- maskbits = (uint64)-1 >> ( 64 - bps);
+ maskbits = (uint64_t)-1 >> (64 - bps);
for (col = start; col < end; col++)
{
/* Compute src byte(s) and bits within byte(s) */
@@ -3157,7 +3150,7 @@ extractContigSamples32bits (uint8 *in, uint8 *out, uint32 cols,
longbuff2 = longbuff1;
}
- buff3 = ((uint64)longbuff1 << 32) | longbuff2;
+ buff3 = ((uint64_t)longbuff1 << 32) | longbuff2;
buff1 = (buff3 & matchbits) << (src_bit);
/* If we have a full buffer's worth, write it out */
@@ -3196,17 +3189,17 @@ extractContigSamples32bits (uint8 *in, uint8 *out, uint32 cols,
} /* end extractContigSamples32bits */
static int
-extractContigSamplesShifted8bits (uint8 *in, uint8 *out, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
- tsample_t count, uint32 start, uint32 end,
- int shift)
+extractContigSamplesShifted8bits (uint8_t *in, uint8_t *out, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
+ tsample_t count, uint32_t start, uint32_t end,
+ int shift)
{
int ready_bits = 0, sindex = 0;
- uint32 col, src_byte, src_bit, bit_offset;
- uint8 maskbits = 0, matchbits = 0;
- uint8 buff1 = 0, buff2 = 0;
- uint8 *src = in;
- uint8 *dst = out;
+ uint32_t col, src_byte, src_bit, bit_offset;
+ uint8_t maskbits = 0, matchbits = 0;
+ uint8_t buff1 = 0, buff2 = 0;
+ uint8_t *src = in;
+ uint8_t *dst = out;
if ((src == NULL) || (dst == NULL))
{
@@ -3217,18 +3210,18 @@ extractContigSamplesShifted8bits (uint8 *in, uint8 *out, uint32 cols,
if ((start > end) || (start > cols))
{
TIFFError ("extractContigSamplesShifted8bits",
- "Invalid start column value %d ignored", start);
+ "Invalid start column value %"PRIu32" ignored", start);
start = 0;
}
if ((end == 0) || (end > cols))
{
TIFFError ("extractContigSamplesShifted8bits",
- "Invalid end column value %d ignored", end);
+ "Invalid end column value %"PRIu32" ignored", end);
end = cols;
}
ready_bits = shift;
- maskbits = (uint8)-1 >> ( 8 - bps);
+ maskbits = (uint8_t)-1 >> (8 - bps);
buff1 = buff2 = 0;
for (col = start; col < end; col++)
{ /* Compute src byte(s) and bits within byte(s) */
@@ -3250,7 +3243,7 @@ extractContigSamplesShifted8bits (uint8 *in, uint8 *out, uint32 cols,
matchbits = maskbits << (8 - src_bit - bps);
buff1 = ((*src) & matchbits) << (src_bit);
if ((col == start) && (sindex == sample))
- buff2 = *src & ((uint8)-1) << (shift);
+ buff2 = *src & ((uint8_t)-1) << (shift);
/* If we have a full buffer's worth, write it out */
if (ready_bits >= 8)
@@ -3276,18 +3269,18 @@ extractContigSamplesShifted8bits (uint8 *in, uint8 *out, uint32 cols,
} /* end extractContigSamplesShifted8bits */
static int
-extractContigSamplesShifted16bits (uint8 *in, uint8 *out, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
- tsample_t count, uint32 start, uint32 end,
- int shift)
+extractContigSamplesShifted16bits (uint8_t *in, uint8_t *out, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
+ tsample_t count, uint32_t start, uint32_t end,
+ int shift)
{
int ready_bits = 0, sindex = 0;
- uint32 col, src_byte, src_bit, bit_offset;
- uint16 maskbits = 0, matchbits = 0;
- uint16 buff1 = 0, buff2 = 0;
- uint8 bytebuff = 0;
- uint8 *src = in;
- uint8 *dst = out;
+ uint32_t col, src_byte, src_bit, bit_offset;
+ uint16_t maskbits = 0, matchbits = 0;
+ uint16_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff = 0;
+ uint8_t *src = in;
+ uint8_t *dst = out;
if ((src == NULL) || (dst == NULL))
{
@@ -3298,18 +3291,18 @@ extractContigSamplesShifted16bits (uint8 *in, uint8 *out, uint32 cols,
if ((start > end) || (start > cols))
{
TIFFError ("extractContigSamplesShifted16bits",
- "Invalid start column value %d ignored", start);
+ "Invalid start column value %"PRIu32" ignored", start);
start = 0;
}
if ((end == 0) || (end > cols))
{
TIFFError ("extractContigSamplesShifted16bits",
- "Invalid end column value %d ignored", end);
+ "Invalid end column value %"PRIu32" ignored", end);
end = cols;
}
ready_bits = shift;
- maskbits = (uint16)-1 >> (16 - bps);
+ maskbits = (uint16_t)-1 >> (16 - bps);
for (col = start; col < end; col++)
{ /* Compute src byte(s) and bits within byte(s) */
bit_offset = col * bps * spp;
@@ -3334,7 +3327,7 @@ extractContigSamplesShifted16bits (uint8 *in, uint8 *out, uint32 cols,
buff1 = (src[1] << 8) | src[0];
if ((col == start) && (sindex == sample))
- buff2 = buff1 & ((uint16)-1) << (8 - shift);
+ buff2 = buff1 & ((uint16_t)-1) << (8 - shift);
buff1 = (buff1 & matchbits) << (src_bit);
@@ -3366,18 +3359,18 @@ extractContigSamplesShifted16bits (uint8 *in, uint8 *out, uint32 cols,
static int
-extractContigSamplesShifted24bits (uint8 *in, uint8 *out, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
- tsample_t count, uint32 start, uint32 end,
- int shift)
+extractContigSamplesShifted24bits (uint8_t *in, uint8_t *out, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
+ tsample_t count, uint32_t start, uint32_t end,
+ int shift)
{
int ready_bits = 0, sindex = 0;
- uint32 col, src_byte, src_bit, bit_offset;
- uint32 maskbits = 0, matchbits = 0;
- uint32 buff1 = 0, buff2 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0;
- uint8 *src = in;
- uint8 *dst = out;
+ uint32_t col, src_byte, src_bit, bit_offset;
+ uint32_t maskbits = 0, matchbits = 0;
+ uint32_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0;
+ uint8_t *src = in;
+ uint8_t *dst = out;
if ((in == NULL) || (out == NULL))
{
@@ -3388,18 +3381,18 @@ extractContigSamplesShifted24bits (uint8 *in, uint8 *out, uint32 cols,
if ((start > end) || (start > cols))
{
TIFFError ("extractContigSamplesShifted24bits",
- "Invalid start column value %d ignored", start);
+ "Invalid start column value %"PRIu32" ignored", start);
start = 0;
}
if ((end == 0) || (end > cols))
{
TIFFError ("extractContigSamplesShifted24bits",
- "Invalid end column value %d ignored", end);
+ "Invalid end column value %"PRIu32" ignored", end);
end = cols;
}
ready_bits = shift;
- maskbits = (uint32)-1 >> ( 32 - bps);
+ maskbits = (uint32_t)-1 >> (32 - bps);
for (col = start; col < end; col++)
{
/* Compute src byte(s) and bits within byte(s) */
@@ -3425,7 +3418,7 @@ extractContigSamplesShifted24bits (uint8 *in, uint8 *out, uint32 cols,
buff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0];
if ((col == start) && (sindex == sample))
- buff2 = buff1 & ((uint32)-1) << (16 - shift);
+ buff2 = buff1 & ((uint32_t)-1) << (16 - shift);
buff1 = (buff1 & matchbits) << (src_bit);
@@ -3464,19 +3457,19 @@ extractContigSamplesShifted24bits (uint8 *in, uint8 *out, uint32 cols,
} /* end extractContigSamplesShifted24bits */
static int
-extractContigSamplesShifted32bits (uint8 *in, uint8 *out, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
- tsample_t count, uint32 start, uint32 end,
- int shift)
+extractContigSamplesShifted32bits (uint8_t *in, uint8_t *out, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
+ tsample_t count, uint32_t start, uint32_t end,
+ int shift)
{
int ready_bits = 0, sindex = 0 /*, shift_width = 0 */;
- uint32 col, src_byte, src_bit, bit_offset;
- uint32 longbuff1 = 0, longbuff2 = 0;
- uint64 maskbits = 0, matchbits = 0;
- uint64 buff1 = 0, buff2 = 0, buff3 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
- uint8 *src = in;
- uint8 *dst = out;
+ uint32_t col, src_byte, src_bit, bit_offset;
+ uint32_t longbuff1 = 0, longbuff2 = 0;
+ uint64_t maskbits = 0, matchbits = 0;
+ uint64_t buff1 = 0, buff2 = 0, buff3 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
+ uint8_t *src = in;
+ uint8_t *dst = out;
if ((in == NULL) || (out == NULL))
{
@@ -3488,19 +3481,19 @@ extractContigSamplesShifted32bits (uint8 *in, uint8 *out, uint32 cols,
if ((start > end) || (start > cols))
{
TIFFError ("extractContigSamplesShifted32bits",
- "Invalid start column value %d ignored", start);
+ "Invalid start column value %"PRIu32" ignored", start);
start = 0;
}
if ((end == 0) || (end > cols))
{
TIFFError ("extractContigSamplesShifted32bits",
- "Invalid end column value %d ignored", end);
+ "Invalid end column value %"PRIu32" ignored", end);
end = cols;
}
/* shift_width = ((bps + 7) / 8) + 1; */
ready_bits = shift;
- maskbits = (uint64)-1 >> ( 64 - bps);
+ maskbits = (uint64_t)-1 >> (64 - bps);
for (col = start; col < end; col++)
{
/* Compute src byte(s) and bits within byte(s) */
@@ -3531,9 +3524,9 @@ extractContigSamplesShifted32bits (uint8 *in, uint8 *out, uint32 cols,
longbuff2 = longbuff1;
}
- buff3 = ((uint64)longbuff1 << 32) | longbuff2;
+ buff3 = ((uint64_t)longbuff1 << 32) | longbuff2;
if ((col == start) && (sindex == sample))
- buff2 = buff3 & ((uint64)-1) << (32 - shift);
+ buff2 = buff3 & ((uint64_t)-1) << (32 - shift);
buff1 = (buff3 & matchbits) << (src_bit);
@@ -3572,15 +3565,15 @@ extractContigSamplesShifted32bits (uint8 *in, uint8 *out, uint32 cols,
} /* end extractContigSamplesShifted32bits */
static int
-extractContigSamplesToBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols,
- tsample_t sample, uint16 spp, uint16 bps,
+extractContigSamplesToBuffer(uint8_t *out, uint8_t *in, uint32_t rows, uint32_t cols,
+ tsample_t sample, uint16_t spp, uint16_t bps,
struct dump_opts *dump)
{
int shift_width, bytes_per_sample, bytes_per_pixel;
- uint32 src_rowsize, src_offset, row, first_col = 0;
- uint32 dst_rowsize, dst_offset;
+ uint32_t src_rowsize, src_offset, row, first_col = 0;
+ uint32_t dst_rowsize, dst_offset;
tsample_t count = 1;
- uint8 *src, *dst;
+ uint8_t *src, *dst;
bytes_per_sample = (bps + 7) / 8;
bytes_per_pixel = ((bps * spp) + 7) / 8;
@@ -3599,7 +3592,7 @@ extractContigSamplesToBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols,
if ((dump->outfile != NULL) && (dump->level == 4))
{
dump_info (dump->outfile, dump->format, "extractContigSamplesToBuffer",
- "Sample %d, %d rows", sample + 1, rows + 1);
+ "Sample %"PRIu32", %"PRIu32" rows", sample + 1u, rows + 1u);
}
for (row = 0; row < rows; row++)
{
@@ -3637,7 +3630,7 @@ extractContigSamplesToBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols,
spp, bps, count, first_col, cols))
return (1);
break;
- default: TIFFError ("extractContigSamplesToBuffer", "Unsupported bit depth: %d", bps);
+ default: TIFFError ("extractContigSamplesToBuffer", "Unsupported bit depth: %"PRIu16, bps);
return (1);
}
if ((dump->outfile != NULL) && (dump->level == 4))
@@ -3648,14 +3641,14 @@ extractContigSamplesToBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols,
} /* end extractContigSamplesToBuffer */
static int
-extractContigSamplesToTileBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols,
- uint32 imagewidth, uint32 tilewidth, tsample_t sample,
- uint16 count, uint16 spp, uint16 bps, struct dump_opts *dump)
+extractContigSamplesToTileBuffer(uint8_t *out, uint8_t *in, uint32_t rows, uint32_t cols,
+ uint32_t imagewidth, uint32_t tilewidth, tsample_t sample,
+ uint16_t count, uint16_t spp, uint16_t bps, struct dump_opts *dump)
{
int shift_width, bytes_per_sample, bytes_per_pixel;
- uint32 src_rowsize, src_offset, row;
- uint32 dst_rowsize, dst_offset;
- uint8 *src, *dst;
+ uint32_t src_rowsize, src_offset, row;
+ uint32_t dst_rowsize, dst_offset;
+ uint8_t *src, *dst;
bytes_per_sample = (bps + 7) / 8;
bytes_per_pixel = ((bps * spp) + 7) / 8;
@@ -3672,7 +3665,7 @@ extractContigSamplesToTileBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols
if ((dump->outfile != NULL) && (dump->level == 4))
{
dump_info (dump->outfile, dump->format, "extractContigSamplesToTileBuffer",
- "Sample %d, %d rows", sample + 1, rows + 1);
+ "Sample %"PRIu32", %"PRIu32" rows", sample + 1u, rows + 1u);
}
src_rowsize = ((bps * spp * imagewidth) + 7) / 8;
@@ -3714,7 +3707,7 @@ extractContigSamplesToTileBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols
spp, bps, count, 0, cols))
return (1);
break;
- default: TIFFError ("extractContigSamplesToTileBuffer", "Unsupported bit depth: %d", bps);
+ default: TIFFError ("extractContigSamplesToTileBuffer", "Unsupported bit depth: %"PRIu16, bps);
return (1);
}
if ((dump->outfile != NULL) && (dump->level == 4))
@@ -3724,14 +3717,14 @@ extractContigSamplesToTileBuffer(uint8 *out, uint8 *in, uint32 rows, uint32 cols
return (0);
} /* end extractContigSamplesToTileBuffer */
-static int readContigStripsIntoBuffer (TIFF* in, uint8* buf)
+static int readContigStripsIntoBuffer (TIFF* in, uint8_t* buf)
{
- uint8* bufp = buf;
- int32 bytes_read = 0;
- uint32 strip, nstrips = TIFFNumberOfStrips(in);
- uint32 stripsize = TIFFStripSize(in);
- uint32 rows = 0;
- uint32 rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps);
+ uint8_t* bufp = buf;
+ int32_t bytes_read = 0;
+ uint32_t strip, nstrips = TIFFNumberOfStrips(in);
+ uint32_t stripsize = TIFFStripSize(in);
+ uint32_t rows = 0;
+ uint32_t rps = TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rps);
tsize_t scanline_size = TIFFScanlineSize(in);
if (scanline_size == 0) {
@@ -3742,14 +3735,13 @@ static int readContigStripsIntoBuffer (TIFF* in, uint8* buf)
for (strip = 0; strip < nstrips; strip++) {
bytes_read = TIFFReadEncodedStrip (in, strip, bufp, -1);
rows = bytes_read / scanline_size;
- if ((strip < (nstrips - 1)) && (bytes_read != (int32)stripsize))
- TIFFError("", "Strip %d: read %lu bytes, strip size %lu",
- (int)strip + 1, (unsigned long) bytes_read,
- (unsigned long)stripsize);
+ if ((strip < (nstrips - 1)) && (bytes_read != (int32_t)stripsize))
+ TIFFError("", "Strip %"PRIu32": read %"PRId32" bytes, strip size %"PRIu32,
+ strip + 1, bytes_read, stripsize);
if (bytes_read < 0 && !ignore) {
- TIFFError("", "Error reading strip %lu after %lu rows",
- (unsigned long) strip, (unsigned long)rows);
+ TIFFError("", "Error reading strip %"PRIu32" after %"PRIu32" rows",
+ strip, rows);
return 0;
}
bufp += stripsize;
@@ -3760,11 +3752,11 @@ static int readContigStripsIntoBuffer (TIFF* in, uint8* buf)
static int
combineSeparateSamplesBytes (unsigned char *srcbuffs[], unsigned char *out,
- uint32 cols, uint32 rows, uint16 spp, uint16 bps,
+ uint32_t cols, uint32_t rows, uint16_t spp, uint16_t bps,
FILE *dumpfile, int format, int level)
{
int i, bytes_per_sample;
- uint32 row, col, col_offset, src_rowsize, dst_rowsize, row_offset;
+ uint32_t row, col, col_offset, src_rowsize, dst_rowsize, row_offset;
unsigned char *src;
unsigned char *dst;
tsample_t s;
@@ -3787,7 +3779,7 @@ combineSeparateSamplesBytes (unsigned char *srcbuffs[], unsigned char *out,
{
for (s = 0; s < spp; s++)
{
- dump_info (dumpfile, format, "combineSeparateSamplesBytes","Input data, Sample %d", s);
+ dump_info (dumpfile, format, "combineSeparateSamplesBytes","Input data, Sample %"PRIu16, s);
dump_buffer(dumpfile, format, 1, cols, row, srcbuffs[s] + (row * src_rowsize));
}
}
@@ -3817,17 +3809,17 @@ combineSeparateSamplesBytes (unsigned char *srcbuffs[], unsigned char *out,
} /* end combineSeparateSamplesBytes */
static int
-combineSeparateSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
- uint32 rows, uint16 spp, uint16 bps,
- FILE *dumpfile, int format, int level)
+combineSeparateSamples8bits (uint8_t *in[], uint8_t *out, uint32_t cols,
+ uint32_t rows, uint16_t spp, uint16_t bps,
+ FILE *dumpfile, int format, int level)
{
int ready_bits = 0;
/* int bytes_per_sample = 0; */
- uint32 src_rowsize, dst_rowsize, src_offset;
- uint32 bit_offset;
- uint32 row, col, src_byte = 0, src_bit = 0;
- uint8 maskbits = 0, matchbits = 0;
- uint8 buff1 = 0, buff2 = 0;
+ uint32_t src_rowsize, dst_rowsize, src_offset;
+ uint32_t bit_offset;
+ uint32_t row, col, src_byte = 0, src_bit = 0;
+ uint8_t maskbits = 0, matchbits = 0;
+ uint8_t buff1 = 0, buff2 = 0;
tsample_t s;
unsigned char *src = in[0];
unsigned char *dst = out;
@@ -3842,7 +3834,7 @@ combineSeparateSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
/* bytes_per_sample = (bps + 7) / 8; */
src_rowsize = ((bps * cols) + 7) / 8;
dst_rowsize = ((bps * cols * spp) + 7) / 8;
- maskbits = (uint8)-1 >> ( 8 - bps);
+ maskbits = (uint8_t)-1 >> (8 - bps);
for (row = 0; row < rows; row++)
{
@@ -3882,8 +3874,8 @@ combineSeparateSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
if ((dumpfile != NULL) && (level == 3))
{
dump_info (dumpfile, format, "",
- "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d",
- row + 1, col + 1, s, src_byte, src_bit, dst - out);
+ "Row %3"PRIu32", Col %3"PRIu32", Samples %"PRIu16", Src byte offset %3"PRIu32" bit offset %2"PRIu32" Dst offset %3td",
+ row + 1u, col + 1u, s, src_byte, src_bit, dst - out);
dump_byte (dumpfile, format, "Match bits", matchbits);
dump_byte (dumpfile, format, "Src bits", *src);
dump_byte (dumpfile, format, "Buff1 bits", buff1);
@@ -3900,8 +3892,8 @@ combineSeparateSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
if ((dumpfile != NULL) && (level == 3))
{
dump_info (dumpfile, format, "",
- "Row %3d, Col %3d, Src byte offset %3d bit offset %2d Dst offset %3d",
- row + 1, col + 1, src_byte, src_bit, dst - out);
+ "Row %3"PRIu32", Col %3"PRIu32", Src byte offset %3"PRIu32" bit offset %2"PRIu32" Dst offset %3td",
+ row + 1u, col + 1u, src_byte, src_bit, dst - out);
dump_byte (dumpfile, format, "Final bits", buff1);
}
}
@@ -3917,17 +3909,17 @@ combineSeparateSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
} /* end combineSeparateSamples8bits */
static int
-combineSeparateSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
- uint32 rows, uint16 spp, uint16 bps,
- FILE *dumpfile, int format, int level)
+combineSeparateSamples16bits (uint8_t *in[], uint8_t *out, uint32_t cols,
+ uint32_t rows, uint16_t spp, uint16_t bps,
+ FILE *dumpfile, int format, int level)
{
int ready_bits = 0 /*, bytes_per_sample = 0 */;
- uint32 src_rowsize, dst_rowsize;
- uint32 bit_offset, src_offset;
- uint32 row, col, src_byte = 0, src_bit = 0;
- uint16 maskbits = 0, matchbits = 0;
- uint16 buff1 = 0, buff2 = 0;
- uint8 bytebuff = 0;
+ uint32_t src_rowsize, dst_rowsize;
+ uint32_t bit_offset, src_offset;
+ uint32_t row, col, src_byte = 0, src_bit = 0;
+ uint16_t maskbits = 0, matchbits = 0;
+ uint16_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff = 0;
tsample_t s;
unsigned char *src = in[0];
unsigned char *dst = out;
@@ -3942,7 +3934,7 @@ combineSeparateSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
/* bytes_per_sample = (bps + 7) / 8; */
src_rowsize = ((bps * cols) + 7) / 8;
dst_rowsize = ((bps * cols * spp) + 7) / 8;
- maskbits = (uint16)-1 >> (16 - bps);
+ maskbits = (uint16_t)-1 >> (16 - bps);
for (row = 0; row < rows; row++)
{
@@ -3989,8 +3981,8 @@ combineSeparateSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
if ((dumpfile != NULL) && (level == 3))
{
dump_info (dumpfile, format, "",
- "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d",
- row + 1, col + 1, s, src_byte, src_bit, dst - out);
+ "Row %3"PRIu32", Col %3"PRIu32", Samples %"PRIu16", Src byte offset %3"PRIu32" bit offset %2"PRIu32" Dst offset %3td",
+ row + 1u, col + 1u, s, src_byte, src_bit, dst - out);
dump_short (dumpfile, format, "Match bits", matchbits);
dump_data (dumpfile, format, "Src bits", src, 2);
@@ -4027,17 +4019,17 @@ combineSeparateSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
} /* end combineSeparateSamples16bits */
static int
-combineSeparateSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
- uint32 rows, uint16 spp, uint16 bps,
- FILE *dumpfile, int format, int level)
+combineSeparateSamples24bits (uint8_t *in[], uint8_t *out, uint32_t cols,
+ uint32_t rows, uint16_t spp, uint16_t bps,
+ FILE *dumpfile, int format, int level)
{
int ready_bits = 0 /*, bytes_per_sample = 0 */;
- uint32 src_rowsize, dst_rowsize;
- uint32 bit_offset, src_offset;
- uint32 row, col, src_byte = 0, src_bit = 0;
- uint32 maskbits = 0, matchbits = 0;
- uint32 buff1 = 0, buff2 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0;
+ uint32_t src_rowsize, dst_rowsize;
+ uint32_t bit_offset, src_offset;
+ uint32_t row, col, src_byte = 0, src_bit = 0;
+ uint32_t maskbits = 0, matchbits = 0;
+ uint32_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0;
tsample_t s;
unsigned char *src = in[0];
unsigned char *dst = out;
@@ -4052,7 +4044,7 @@ combineSeparateSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
/* bytes_per_sample = (bps + 7) / 8; */
src_rowsize = ((bps * cols) + 7) / 8;
dst_rowsize = ((bps * cols * spp) + 7) / 8;
- maskbits = (uint32)-1 >> ( 32 - bps);
+ maskbits = (uint32_t)-1 >> (32 - bps);
for (row = 0; row < rows; row++)
{
@@ -4072,9 +4064,9 @@ combineSeparateSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
{
src = in[s] + src_offset + src_byte;
if (little_endian)
- buff1 = ((uint32)src[0] << 24) | ((uint32)src[1] << 16) | ((uint32)src[2] << 8) | (uint32)src[3];
+ buff1 = ((uint32_t)src[0] << 24) | ((uint32_t)src[1] << 16) | ((uint32_t)src[2] << 8) | (uint32_t)src[3];
else
- buff1 = ((uint32)src[3] << 24) | ((uint32)src[2] << 16) | ((uint32)src[1] << 8) | (uint32)src[0];
+ buff1 = ((uint32_t)src[3] << 24) | ((uint32_t)src[2] << 16) | ((uint32_t)src[1] << 8) | (uint32_t)src[0];
buff1 = (buff1 & matchbits) << (src_bit);
/* If we have a full buffer's worth, write it out */
@@ -4101,8 +4093,8 @@ combineSeparateSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
if ((dumpfile != NULL) && (level == 3))
{
dump_info (dumpfile, format, "",
- "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d",
- row + 1, col + 1, s, src_byte, src_bit, dst - out);
+ "Row %3"PRIu32", Col %3"PRIu32", Samples %"PRIu16", Src byte offset %3"PRIu32" bit offset %2"PRIu32" Dst offset %3td",
+ row + 1u, col + 1u, s, src_byte, src_bit, dst - out);
dump_long (dumpfile, format, "Match bits ", matchbits);
dump_data (dumpfile, format, "Src bits ", src, 4);
dump_long (dumpfile, format, "Buff1 bits ", buff1);
@@ -4151,18 +4143,18 @@ combineSeparateSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
} /* end combineSeparateSamples24bits */
static int
-combineSeparateSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
- uint32 rows, uint16 spp, uint16 bps,
- FILE *dumpfile, int format, int level)
+combineSeparateSamples32bits (uint8_t *in[], uint8_t *out, uint32_t cols,
+ uint32_t rows, uint16_t spp, uint16_t bps,
+ FILE *dumpfile, int format, int level)
{
int ready_bits = 0 /*, bytes_per_sample = 0, shift_width = 0 */;
- uint32 src_rowsize, dst_rowsize, bit_offset, src_offset;
- uint32 src_byte = 0, src_bit = 0;
- uint32 row, col;
- uint32 longbuff1 = 0, longbuff2 = 0;
- uint64 maskbits = 0, matchbits = 0;
- uint64 buff1 = 0, buff2 = 0, buff3 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
+ uint32_t src_rowsize, dst_rowsize, bit_offset, src_offset;
+ uint32_t src_byte = 0, src_bit = 0;
+ uint32_t row, col;
+ uint32_t longbuff1 = 0, longbuff2 = 0;
+ uint64_t maskbits = 0, matchbits = 0;
+ uint64_t buff1 = 0, buff2 = 0, buff3 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
tsample_t s;
unsigned char *src = in[0];
unsigned char *dst = out;
@@ -4177,7 +4169,7 @@ combineSeparateSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
/* bytes_per_sample = (bps + 7) / 8; */
src_rowsize = ((bps * cols) + 7) / 8;
dst_rowsize = ((bps * cols * spp) + 7) / 8;
- maskbits = (uint64)-1 >> ( 64 - bps);
+ maskbits = (uint64_t)-1 >> (64 - bps);
/* shift_width = ((bps + 7) / 8) + 1; */
for (row = 0; row < rows; row++)
@@ -4207,7 +4199,7 @@ combineSeparateSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
longbuff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0];
longbuff2 = longbuff1;
}
- buff3 = ((uint64)longbuff1 << 32) | longbuff2;
+ buff3 = ((uint64_t)longbuff1 << 32) | longbuff2;
buff1 = (buff3 & matchbits) << (src_bit);
/* If we have a full buffer's worth, write it out */
@@ -4238,8 +4230,8 @@ combineSeparateSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
if ((dumpfile != NULL) && (level == 3))
{
dump_info (dumpfile, format, "",
- "Row %3d, Col %3d, Sample %d, Src byte offset %3d bit offset %2d Dst offset %3d",
- row + 1, col + 1, s, src_byte, src_bit, dst - out);
+ "Row %3"PRIu32", Col %3"PRIu32", Sample %"PRIu16", Src byte offset %3"PRIu32" bit offset %2"PRIu32" Dst offset %3td",
+ row + 1u, col + 1u, s, src_byte, src_bit, dst - out);
dump_wide (dumpfile, format, "Match bits ", matchbits);
dump_data (dumpfile, format, "Src bits ", src, 8);
dump_wide (dumpfile, format, "Buff1 bits ", buff1);
@@ -4283,12 +4275,12 @@ combineSeparateSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
static int
combineSeparateTileSamplesBytes (unsigned char *srcbuffs[], unsigned char *out,
- uint32 cols, uint32 rows, uint32 imagewidth,
- uint32 tw, uint16 spp, uint16 bps,
+ uint32_t cols, uint32_t rows, uint32_t imagewidth,
+ uint32_t tw, uint16_t spp, uint16_t bps,
FILE *dumpfile, int format, int level)
{
int i, bytes_per_sample;
- uint32 row, col, col_offset, src_rowsize, dst_rowsize, src_offset;
+ uint32_t row, col, col_offset, src_rowsize, dst_rowsize, src_offset;
unsigned char *src;
unsigned char *dst;
tsample_t s;
@@ -4310,7 +4302,7 @@ combineSeparateTileSamplesBytes (unsigned char *srcbuffs[], unsigned char *out,
{
for (s = 0; s < spp; s++)
{
- dump_info (dumpfile, format, "combineSeparateTileSamplesBytes","Input data, Sample %d", s);
+ dump_info (dumpfile, format, "combineSeparateTileSamplesBytes","Input data, Sample %"PRIu16, s);
dump_buffer(dumpfile, format, 1, cols, row, srcbuffs[s] + (row * src_rowsize));
}
}
@@ -4343,17 +4335,17 @@ combineSeparateTileSamplesBytes (unsigned char *srcbuffs[], unsigned char *out,
} /* end combineSeparateTileSamplesBytes */
static int
-combineSeparateTileSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
- uint32 rows, uint32 imagewidth,
- uint32 tw, uint16 spp, uint16 bps,
- FILE *dumpfile, int format, int level)
+combineSeparateTileSamples8bits (uint8_t *in[], uint8_t *out, uint32_t cols,
+ uint32_t rows, uint32_t imagewidth,
+ uint32_t tw, uint16_t spp, uint16_t bps,
+ FILE *dumpfile, int format, int level)
{
int ready_bits = 0;
- uint32 src_rowsize, dst_rowsize, src_offset;
- uint32 bit_offset;
- uint32 row, col, src_byte = 0, src_bit = 0;
- uint8 maskbits = 0, matchbits = 0;
- uint8 buff1 = 0, buff2 = 0;
+ uint32_t src_rowsize, dst_rowsize, src_offset;
+ uint32_t bit_offset;
+ uint32_t row, col, src_byte = 0, src_bit = 0;
+ uint8_t maskbits = 0, matchbits = 0;
+ uint8_t buff1 = 0, buff2 = 0;
tsample_t s;
unsigned char *src = in[0];
unsigned char *dst = out;
@@ -4367,7 +4359,7 @@ combineSeparateTileSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
src_rowsize = ((bps * tw) + 7) / 8;
dst_rowsize = ((imagewidth * bps * spp) + 7) / 8;
- maskbits = (uint8)-1 >> ( 8 - bps);
+ maskbits = (uint8_t)-1 >> (8 - bps);
for (row = 0; row < rows; row++)
{
@@ -4407,8 +4399,8 @@ combineSeparateTileSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
if ((dumpfile != NULL) && (level == 3))
{
dump_info (dumpfile, format, "",
- "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d",
- row + 1, col + 1, s, src_byte, src_bit, dst - out);
+ "Row %3"PRIu32", Col %3"PRIu32", Samples %"PRIu16", Src byte offset %3"PRIu32" bit offset %2"PRIu32" Dst offset %3td",
+ row + 1u, col + 1u, s, src_byte, src_bit, dst - out);
dump_byte (dumpfile, format, "Match bits", matchbits);
dump_byte (dumpfile, format, "Src bits", *src);
dump_byte (dumpfile, format, "Buff1 bits", buff1);
@@ -4442,18 +4434,18 @@ combineSeparateTileSamples8bits (uint8 *in[], uint8 *out, uint32 cols,
} /* end combineSeparateTileSamples8bits */
static int
-combineSeparateTileSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
- uint32 rows, uint32 imagewidth,
- uint32 tw, uint16 spp, uint16 bps,
- FILE *dumpfile, int format, int level)
+combineSeparateTileSamples16bits (uint8_t *in[], uint8_t *out, uint32_t cols,
+ uint32_t rows, uint32_t imagewidth,
+ uint32_t tw, uint16_t spp, uint16_t bps,
+ FILE *dumpfile, int format, int level)
{
int ready_bits = 0;
- uint32 src_rowsize, dst_rowsize;
- uint32 bit_offset, src_offset;
- uint32 row, col, src_byte = 0, src_bit = 0;
- uint16 maskbits = 0, matchbits = 0;
- uint16 buff1 = 0, buff2 = 0;
- uint8 bytebuff = 0;
+ uint32_t src_rowsize, dst_rowsize;
+ uint32_t bit_offset, src_offset;
+ uint32_t row, col, src_byte = 0, src_bit = 0;
+ uint16_t maskbits = 0, matchbits = 0;
+ uint16_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff = 0;
tsample_t s;
unsigned char *src = in[0];
unsigned char *dst = out;
@@ -4467,7 +4459,7 @@ combineSeparateTileSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
src_rowsize = ((bps * tw) + 7) / 8;
dst_rowsize = ((imagewidth * bps * spp) + 7) / 8;
- maskbits = (uint16)-1 >> (16 - bps);
+ maskbits = (uint16_t)-1 >> (16 - bps);
for (row = 0; row < rows; row++)
{
@@ -4513,8 +4505,8 @@ combineSeparateTileSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
if ((dumpfile != NULL) && (level == 3))
{
dump_info (dumpfile, format, "",
- "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d",
- row + 1, col + 1, s, src_byte, src_bit, dst - out);
+ "Row %3"PRIu32", Col %3"PRIu32", Samples %"PRIu16", Src byte offset %3"PRIu32" bit offset %2"PRIu32" Dst offset %3td",
+ row + 1u, col + 1u, s, src_byte, src_bit, dst - out);
dump_short (dumpfile, format, "Match bits", matchbits);
dump_data (dumpfile, format, "Src bits", src, 2);
@@ -4551,18 +4543,18 @@ combineSeparateTileSamples16bits (uint8 *in[], uint8 *out, uint32 cols,
} /* end combineSeparateTileSamples16bits */
static int
-combineSeparateTileSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
- uint32 rows, uint32 imagewidth,
- uint32 tw, uint16 spp, uint16 bps,
- FILE *dumpfile, int format, int level)
+combineSeparateTileSamples24bits (uint8_t *in[], uint8_t *out, uint32_t cols,
+ uint32_t rows, uint32_t imagewidth,
+ uint32_t tw, uint16_t spp, uint16_t bps,
+ FILE *dumpfile, int format, int level)
{
int ready_bits = 0;
- uint32 src_rowsize, dst_rowsize;
- uint32 bit_offset, src_offset;
- uint32 row, col, src_byte = 0, src_bit = 0;
- uint32 maskbits = 0, matchbits = 0;
- uint32 buff1 = 0, buff2 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0;
+ uint32_t src_rowsize, dst_rowsize;
+ uint32_t bit_offset, src_offset;
+ uint32_t row, col, src_byte = 0, src_bit = 0;
+ uint32_t maskbits = 0, matchbits = 0;
+ uint32_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0;
tsample_t s;
unsigned char *src = in[0];
unsigned char *dst = out;
@@ -4576,7 +4568,7 @@ combineSeparateTileSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
src_rowsize = ((bps * tw) + 7) / 8;
dst_rowsize = ((imagewidth * bps * spp) + 7) / 8;
- maskbits = (uint32)-1 >> ( 32 - bps);
+ maskbits = (uint32_t)-1 >> (32 - bps);
for (row = 0; row < rows; row++)
{
@@ -4625,8 +4617,8 @@ combineSeparateTileSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
if ((dumpfile != NULL) && (level == 3))
{
dump_info (dumpfile, format, "",
- "Row %3d, Col %3d, Samples %d, Src byte offset %3d bit offset %2d Dst offset %3d",
- row + 1, col + 1, s, src_byte, src_bit, dst - out);
+ "Row %3"PRIu32", Col %3"PRIu32", Samples %"PRIu16", Src byte offset %3"PRIu32" bit offset %2"PRIu32" Dst offset %3td",
+ row + 1u, col + 1u, s, src_byte, src_bit, dst - out);
dump_long (dumpfile, format, "Match bits ", matchbits);
dump_data (dumpfile, format, "Src bits ", src, 4);
dump_long (dumpfile, format, "Buff1 bits ", buff1);
@@ -4675,19 +4667,19 @@ combineSeparateTileSamples24bits (uint8 *in[], uint8 *out, uint32 cols,
} /* end combineSeparateTileSamples24bits */
static int
-combineSeparateTileSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
- uint32 rows, uint32 imagewidth,
- uint32 tw, uint16 spp, uint16 bps,
- FILE *dumpfile, int format, int level)
+combineSeparateTileSamples32bits (uint8_t *in[], uint8_t *out, uint32_t cols,
+ uint32_t rows, uint32_t imagewidth,
+ uint32_t tw, uint16_t spp, uint16_t bps,
+ FILE *dumpfile, int format, int level)
{
int ready_bits = 0 /*, shift_width = 0 */;
- uint32 src_rowsize, dst_rowsize, bit_offset, src_offset;
- uint32 src_byte = 0, src_bit = 0;
- uint32 row, col;
- uint32 longbuff1 = 0, longbuff2 = 0;
- uint64 maskbits = 0, matchbits = 0;
- uint64 buff1 = 0, buff2 = 0, buff3 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
+ uint32_t src_rowsize, dst_rowsize, bit_offset, src_offset;
+ uint32_t src_byte = 0, src_bit = 0;
+ uint32_t row, col;
+ uint32_t longbuff1 = 0, longbuff2 = 0;
+ uint64_t maskbits = 0, matchbits = 0;
+ uint64_t buff1 = 0, buff2 = 0, buff3 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
tsample_t s;
unsigned char *src = in[0];
unsigned char *dst = out;
@@ -4701,7 +4693,7 @@ combineSeparateTileSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
src_rowsize = ((bps * tw) + 7) / 8;
dst_rowsize = ((imagewidth * bps * spp) + 7) / 8;
- maskbits = (uint64)-1 >> ( 64 - bps);
+ maskbits = (uint64_t)-1 >> (64 - bps);
/* shift_width = ((bps + 7) / 8) + 1; */
for (row = 0; row < rows; row++)
@@ -4732,7 +4724,7 @@ combineSeparateTileSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
longbuff2 = longbuff1;
}
- buff3 = ((uint64)longbuff1 << 32) | longbuff2;
+ buff3 = ((uint64_t)longbuff1 << 32) | longbuff2;
buff1 = (buff3 & matchbits) << (src_bit);
/* If we have a full buffer's worth, write it out */
@@ -4763,8 +4755,8 @@ combineSeparateTileSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
if ((dumpfile != NULL) && (level == 3))
{
dump_info (dumpfile, format, "",
- "Row %3d, Col %3d, Sample %d, Src byte offset %3d bit offset %2d Dst offset %3d",
- row + 1, col + 1, s, src_byte, src_bit, dst - out);
+ "Row %3"PRIu32", Col %3"PRIu32", Sample %"PRIu16", Src byte offset %3"PRIu32" bit offset %2"PRIu32" Dst offset %3td",
+ row + 1u, col + 1u, s, src_byte, src_bit, dst - out);
dump_wide (dumpfile, format, "Match bits ", matchbits);
dump_data (dumpfile, format, "Src bits ", src, 8);
dump_wide (dumpfile, format, "Buff1 bits ", buff1);
@@ -4807,18 +4799,18 @@ combineSeparateTileSamples32bits (uint8 *in[], uint8 *out, uint32 cols,
} /* end combineSeparateTileSamples32bits */
-static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
- uint32 width, uint16 spp,
+static int readSeparateStripsIntoBuffer (TIFF *in, uint8_t *obuf, uint32_t length,
+ uint32_t width, uint16_t spp,
struct dump_opts *dump)
{
int i, bytes_per_sample, bytes_per_pixel, shift_width, result = 1;
- uint32 j;
- int32 bytes_read = 0;
- uint16 bps = 0, planar;
- uint32 nstrips;
- uint32 strips_per_sample;
- uint32 src_rowsize, dst_rowsize, rows_processed, rps;
- uint32 rows_this_strip = 0;
+ uint32_t j;
+ int32_t bytes_read = 0;
+ uint16_t bps = 0, planar;
+ uint32_t nstrips;
+ uint32_t strips_per_sample;
+ uint32_t src_rowsize, dst_rowsize, rows_processed, rps;
+ uint32_t rows_this_strip = 0;
tsample_t s;
tstrip_t strip;
tsize_t scanlinesize = TIFFScanlineSize(in);
@@ -4854,10 +4846,10 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
if ((dump->infile != NULL) && (dump->level == 3))
{
dump_info (dump->infile, dump->format, "",
- "Image width %d, length %d, Scanline size, %4d bytes",
+ "Image width %"PRIu32", length %"PRIu32", Scanline size, %4"PRId64" bytes",
width, length, scanlinesize);
dump_info (dump->infile, dump->format, "",
- "Bits per sample %d, Samples per pixel %d, Shift width %d",
+ "Bits per sample %"PRIu16", Samples per pixel %"PRIu16", Shift width %d",
bps, spp, shift_width);
}
@@ -4883,7 +4875,7 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
if (!buff)
{
TIFFError ("readSeparateStripsIntoBuffer",
- "Unable to allocate strip read buffer for sample %d", s);
+ "Unable to allocate strip read buffer for sample %"PRIu16, s);
for (i = 0; i < s; i++)
_TIFFfree (srcbuffs[i]);
return 0;
@@ -4906,13 +4898,13 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
if (bytes_read < 0 && !ignore)
{
TIFFError(TIFFFileName(in),
- "Error, can't read strip %lu for sample %d",
- (unsigned long) strip, s + 1);
+ "Error, can't read strip %"PRIu32" for sample %"PRIu32,
+ strip, s + 1u);
result = 0;
break;
}
#ifdef DEVELMODE
- TIFFError("", "Strip %2d, read %5d bytes for %4d scanlines, shift width %d",
+ TIFFError("", "Strip %2"PRIu32", read %5"PRId32" bytes for %4"PRIu32" scanlines, shift width %d",
strip, bytes_read, rows_this_strip, shift_width);
#endif
}
@@ -4970,7 +4962,7 @@ static int readSeparateStripsIntoBuffer (TIFF *in, uint8 *obuf, uint32 length,
break;
}
break;
- default: TIFFError ("readSeparateStripsIntoBuffer", "Unsupported bit depth: %d", bps);
+ default: TIFFError ("readSeparateStripsIntoBuffer", "Unsupported bit depth: %"PRIu16, bps);
result = 0;
break;
}
@@ -5002,7 +4994,7 @@ static int
get_page_geometry (char *name, struct pagedef *page)
{
char *ptr;
- int n;
+ unsigned int n;
for (ptr = name; *ptr; ptr++)
*ptr = (char)tolower((int)*ptr);
@@ -5044,11 +5036,11 @@ initPageSetup (struct pagedef *page, struct pageseg *pagelist,
for (i = 0; i < MAX_SECTIONS; i++)
{
- pagelist[i].x1 = (uint32)0;
- pagelist[i].x2 = (uint32)0;
- pagelist[i].y1 = (uint32)0;
- pagelist[i].y2 = (uint32)0;
- pagelist[i].buffsize = (uint32)0;
+ pagelist[i].x1 = (uint32_t)0;
+ pagelist[i].x2 = (uint32_t)0;
+ pagelist[i].y1 = (uint32_t)0;
+ pagelist[i].y2 = (uint32_t)0;
+ pagelist[i].buffsize = (uint32_t)0;
pagelist[i].position = 0;
pagelist[i].total = 0;
}
@@ -5089,15 +5081,15 @@ initCropMasks (struct crop_mask *cps)
cps->length = 0;
for (i = 0; i < 4; i++)
cps->margins[i] = 0.0;
- cps->bufftotal = (uint32)0;
- cps->combined_width = (uint32)0;
- cps->combined_length = (uint32)0;
- cps->rotation = (uint16)0;
+ cps->bufftotal = (uint32_t)0;
+ cps->combined_width = (uint32_t)0;
+ cps->combined_length = (uint32_t)0;
+ cps->rotation = (uint16_t)0;
cps->photometric = INVERT_DATA_AND_TAG;
- cps->mirror = (uint16)0;
- cps->invert = (uint16)0;
- cps->zones = (uint32)0;
- cps->regions = (uint32)0;
+ cps->mirror = (uint16_t)0;
+ cps->invert = (uint16_t)0;
+ cps->zones = (uint32_t)0;
+ cps->regions = (uint32_t)0;
for (i = 0; i < MAX_REGIONS; i++)
{
cps->corners[i].X1 = 0.0;
@@ -5140,12 +5132,12 @@ computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image,
float xres, yres;
/* Values for these offsets are in pixels from start of image, not bytes,
* and are indexed from zero to width - 1 or length - 1 */
- uint32 tmargin, bmargin, lmargin, rmargin;
- uint32 startx, endx; /* offsets of first and last columns to extract */
- uint32 starty, endy; /* offsets of first and last row to extract */
- uint32 width, length, crop_width, crop_length;
- uint32 i, max_width, max_length, zwidth, zlength, buffsize;
- uint32 x1, x2, y1, y2;
+ uint32_t tmargin, bmargin, lmargin, rmargin;
+ uint32_t startx, endx; /* offsets of first and last columns to extract */
+ uint32_t starty, endy; /* offsets of first and last row to extract */
+ uint32_t width, length, crop_width, crop_length;
+ uint32_t i, max_width, max_length, zwidth, zlength, buffsize;
+ uint32_t x1, x2, y1, y2;
if (image->res_unit != RESUNIT_INCH && image->res_unit != RESUNIT_CENTIMETER)
{
@@ -5190,38 +5182,38 @@ computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image,
{
if ((crop->res_unit == RESUNIT_INCH) || (crop->res_unit == RESUNIT_CENTIMETER))
{
- x1 = (uint32) (crop->corners[i].X1 * scale * xres);
- x2 = (uint32) (crop->corners[i].X2 * scale * xres);
- y1 = (uint32) (crop->corners[i].Y1 * scale * yres);
- y2 = (uint32) (crop->corners[i].Y2 * scale * yres);
+ x1 = (uint32_t) (crop->corners[i].X1 * scale * xres);
+ x2 = (uint32_t) (crop->corners[i].X2 * scale * xres);
+ y1 = (uint32_t) (crop->corners[i].Y1 * scale * yres);
+ y2 = (uint32_t) (crop->corners[i].Y2 * scale * yres);
}
else
{
- x1 = (uint32) (crop->corners[i].X1);
- x2 = (uint32) (crop->corners[i].X2);
- y1 = (uint32) (crop->corners[i].Y1);
- y2 = (uint32) (crop->corners[i].Y2);
+ x1 = (uint32_t) (crop->corners[i].X1);
+ x2 = (uint32_t) (crop->corners[i].X2);
+ y1 = (uint32_t) (crop->corners[i].Y1);
+ y2 = (uint32_t) (crop->corners[i].Y2);
}
if (x1 < 1)
crop->regionlist[i].x1 = 0;
else
- crop->regionlist[i].x1 = (uint32) (x1 - 1);
+ crop->regionlist[i].x1 = (uint32_t) (x1 - 1);
if (x2 > image->width - 1)
crop->regionlist[i].x2 = image->width - 1;
else
- crop->regionlist[i].x2 = (uint32) (x2 - 1);
+ crop->regionlist[i].x2 = (uint32_t) (x2 - 1);
zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1;
if (y1 < 1)
crop->regionlist[i].y1 = 0;
else
- crop->regionlist[i].y1 = (uint32) (y1 - 1);
+ crop->regionlist[i].y1 = (uint32_t) (y1 - 1);
if (y2 > image->length - 1)
crop->regionlist[i].y2 = image->length - 1;
else
- crop->regionlist[i].y2 = (uint32) (y2 - 1);
+ crop->regionlist[i].y2 = (uint32_t) (y2 - 1);
zlength = crop->regionlist[i].y2 - crop->regionlist[i].y1 + 1;
@@ -5230,7 +5222,7 @@ computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image,
if (zlength > max_length)
max_length = zlength;
- buffsize = (uint32)
+ buffsize = (uint32_t)
(((zwidth * image->bps * image->spp + 7 ) / 8) * (zlength + 1));
crop->regionlist[i].buffsize = buffsize;
@@ -5263,64 +5255,64 @@ computeInputPixelOffsets(struct crop_mask *crop, struct image_data *image,
{
if (crop->res_unit != RESUNIT_INCH && crop->res_unit != RESUNIT_CENTIMETER)
{ /* User has specified pixels as reference unit */
- tmargin = (uint32)(crop->margins[0]);
- lmargin = (uint32)(crop->margins[1]);
- bmargin = (uint32)(crop->margins[2]);
- rmargin = (uint32)(crop->margins[3]);
+ tmargin = (uint32_t)(crop->margins[0]);
+ lmargin = (uint32_t)(crop->margins[1]);
+ bmargin = (uint32_t)(crop->margins[2]);
+ rmargin = (uint32_t)(crop->margins[3]);
}
else
{ /* inches or centimeters specified */
- tmargin = (uint32)(crop->margins[0] * scale * yres);
- lmargin = (uint32)(crop->margins[1] * scale * xres);
- bmargin = (uint32)(crop->margins[2] * scale * yres);
- rmargin = (uint32)(crop->margins[3] * scale * xres);
+ tmargin = (uint32_t)(crop->margins[0] * scale * yres);
+ lmargin = (uint32_t)(crop->margins[1] * scale * xres);
+ bmargin = (uint32_t)(crop->margins[2] * scale * yres);
+ rmargin = (uint32_t)(crop->margins[3] * scale * xres);
}
if ((lmargin + rmargin) > image->width)
{
TIFFError("computeInputPixelOffsets", "Combined left and right margins exceed image width");
- lmargin = (uint32) 0;
- rmargin = (uint32) 0;
+ lmargin = (uint32_t) 0;
+ rmargin = (uint32_t) 0;
return (-1);
}
if ((tmargin + bmargin) > image->length)
{
TIFFError("computeInputPixelOffsets", "Combined top and bottom margins exceed image length");
- tmargin = (uint32) 0;
- bmargin = (uint32) 0;
+ tmargin = (uint32_t) 0;
+ bmargin = (uint32_t) 0;
return (-1);
}
}
else
{ /* no margins requested */
- tmargin = (uint32) 0;
- lmargin = (uint32) 0;
- bmargin = (uint32) 0;
- rmargin = (uint32) 0;
+ tmargin = (uint32_t) 0;
+ lmargin = (uint32_t) 0;
+ bmargin = (uint32_t) 0;
+ rmargin = (uint32_t) 0;
}
/* Width, height, and margins are expressed as pixel offsets into image */
if (crop->res_unit != RESUNIT_INCH && crop->res_unit != RESUNIT_CENTIMETER)
{
if (crop->crop_mode & CROP_WIDTH)
- width = (uint32)crop->width;
+ width = (uint32_t)crop->width;
else
width = image->width - lmargin - rmargin;
if (crop->crop_mode & CROP_LENGTH)
- length = (uint32)crop->length;
+ length = (uint32_t)crop->length;
else
length = image->length - tmargin - bmargin;
}
else
{
if (crop->crop_mode & CROP_WIDTH)
- width = (uint32)(crop->width * scale * image->xres);
+ width = (uint32_t)(crop->width * scale * image->xres);
else
width = image->width - lmargin - rmargin;
if (crop->crop_mode & CROP_LENGTH)
- length = (uint32)(crop->length * scale * image->yres);
+ length = (uint32_t)(crop->length * scale * image->yres);
else
length = image->length - tmargin - bmargin;
}
@@ -5424,15 +5416,15 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
{
struct offset offsets;
int i;
- int32 test;
- uint32 seg, total, need_buff = 0;
- uint32 buffsize;
- uint32 zwidth, zlength;
+ int32_t test;
+ uint32_t seg, total, need_buff = 0;
+ uint32_t buffsize;
+ uint32_t zwidth, zlength;
memset(&offsets, '\0', sizeof(struct offset));
crop->bufftotal = 0;
- crop->combined_width = (uint32)0;
- crop->combined_length = (uint32)0;
+ crop->combined_width = (uint32_t)0;
+ crop->combined_length = (uint32_t)0;
crop->selections = 0;
/* Compute pixel offsets if margins or fixed width or length specified */
@@ -5469,9 +5461,9 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
if (dump->outfile != NULL)
{
- dump_info (dump->outfile, dump->format, "", "Margins: Top: %d Left: %d Bottom: %d Right: %d",
+ dump_info (dump->outfile, dump->format, "", "Margins: Top: %"PRIu32" Left: %"PRIu32" Bottom: %"PRIu32" Right: %"PRIu32,
offsets.tmargin, offsets.lmargin, offsets.bmargin, offsets.rmargin);
- dump_info (dump->outfile, dump->format, "", "Crop region within margins: Adjusted Width: %6d Length: %6d",
+ dump_info (dump->outfile, dump->format, "", "Crop region within margins: Adjusted Width: %6"PRIu32" Length: %6"PRIu32,
offsets.crop_width, offsets.crop_length);
}
@@ -5511,14 +5503,14 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
crop->regionlist[i].y2 = offsets.endy;
crop->regionlist[i].x1 = offsets.startx +
- (uint32)(offsets.crop_width * 1.0 * (seg - 1) / total);
- test = (int32)offsets.startx +
- (int32)(offsets.crop_width * 1.0 * seg / total);
+ (uint32_t)(offsets.crop_width * 1.0 * (seg - 1) / total);
+ test = (int32_t)offsets.startx +
+ (int32_t)(offsets.crop_width * 1.0 * seg / total);
if (test < 1 )
crop->regionlist[i].x2 = 0;
else
{
- if (test > (int32)(image->width - 1))
+ if (test > (int32_t)(image->width - 1))
crop->regionlist[i].x2 = image->width - 1;
else
crop->regionlist[i].x2 = test - 1;
@@ -5526,18 +5518,18 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1;
/* This is passed to extractCropZone or extractCompositeZones */
- crop->combined_length = (uint32)zlength;
+ crop->combined_length = (uint32_t)zlength;
if (crop->exp_mode == COMPOSITE_IMAGES)
- crop->combined_width += (uint32)zwidth;
+ crop->combined_width += (uint32_t)zwidth;
else
- crop->combined_width = (uint32)zwidth;
+ crop->combined_width = (uint32_t)zwidth;
break;
case EDGE_BOTTOM: /* width from left, zones from bottom to top */
zwidth = offsets.crop_width;
crop->regionlist[i].x1 = offsets.startx;
crop->regionlist[i].x2 = offsets.endx;
- test = offsets.endy - (uint32)(offsets.crop_length * 1.0 * seg / total);
+ test = offsets.endy - (uint32_t)(offsets.crop_length * 1.0 * seg / total);
if (test < 1 )
crop->regionlist[i].y1 = 0;
else
@@ -5548,7 +5540,7 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
crop->regionlist[i].y2 = 0;
else
{
- if (test > (int32)(image->length - 1))
+ if (test > (int32_t)(image->length - 1))
crop->regionlist[i].y2 = image->length - 1;
else
crop->regionlist[i].y2 = test;
@@ -5557,10 +5549,10 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
/* This is passed to extractCropZone or extractCompositeZones */
if (crop->exp_mode == COMPOSITE_IMAGES)
- crop->combined_length += (uint32)zlength;
+ crop->combined_length += (uint32_t)zlength;
else
- crop->combined_length = (uint32)zlength;
- crop->combined_width = (uint32)zwidth;
+ crop->combined_length = (uint32_t)zlength;
+ crop->combined_width = (uint32_t)zwidth;
break;
case EDGE_RIGHT: /* zones from right to left, length from top */
zlength = offsets.crop_length;
@@ -5568,14 +5560,14 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
crop->regionlist[i].y2 = offsets.endy;
crop->regionlist[i].x1 = offsets.startx +
- (uint32)(offsets.crop_width * (total - seg) * 1.0 / total);
+ (uint32_t)(offsets.crop_width * (total - seg) * 1.0 / total);
test = offsets.startx +
(offsets.crop_width * (total - seg + 1) * 1.0 / total);
if (test < 1 )
crop->regionlist[i].x2 = 0;
else
{
- if (test > (int32)(image->width - 1))
+ if (test > (int32_t)(image->width - 1))
crop->regionlist[i].x2 = image->width - 1;
else
crop->regionlist[i].x2 = test - 1;
@@ -5583,11 +5575,11 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
zwidth = crop->regionlist[i].x2 - crop->regionlist[i].x1 + 1;
/* This is passed to extractCropZone or extractCompositeZones */
- crop->combined_length = (uint32)zlength;
+ crop->combined_length = (uint32_t)zlength;
if (crop->exp_mode == COMPOSITE_IMAGES)
- crop->combined_width += (uint32)zwidth;
+ crop->combined_width += (uint32_t)zwidth;
else
- crop->combined_width = (uint32)zwidth;
+ crop->combined_width = (uint32_t)zwidth;
break;
case EDGE_TOP: /* width from left, zones from top to bottom */
default:
@@ -5595,13 +5587,13 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
crop->regionlist[i].x1 = offsets.startx;
crop->regionlist[i].x2 = offsets.endx;
- crop->regionlist[i].y1 = offsets.starty + (uint32)(offsets.crop_length * 1.0 * (seg - 1) / total);
- test = offsets.starty + (uint32)(offsets.crop_length * 1.0 * seg / total);
+ crop->regionlist[i].y1 = offsets.starty + (uint32_t)(offsets.crop_length * 1.0 * (seg - 1) / total);
+ test = offsets.starty + (uint32_t)(offsets.crop_length * 1.0 * seg / total);
if (test < 1 )
crop->regionlist[i].y2 = 0;
else
{
- if (test > (int32)(image->length - 1))
+ if (test > (int32_t)(image->length - 1))
crop->regionlist[i].y2 = image->length - 1;
else
crop->regionlist[i].y2 = test - 1;
@@ -5610,26 +5602,26 @@ getCropOffsets(struct image_data *image, struct crop_mask *crop, struct dump_opt
/* This is passed to extractCropZone or extractCompositeZones */
if (crop->exp_mode == COMPOSITE_IMAGES)
- crop->combined_length += (uint32)zlength;
+ crop->combined_length += (uint32_t)zlength;
else
- crop->combined_length = (uint32)zlength;
- crop->combined_width = (uint32)zwidth;
+ crop->combined_length = (uint32_t)zlength;
+ crop->combined_width = (uint32_t)zwidth;
break;
} /* end switch statement */
- buffsize = (uint32)
+ buffsize = (uint32_t)
((((zwidth * image->bps * image->spp) + 7 ) / 8) * (zlength + 1));
- crop->regionlist[i].width = (uint32) zwidth;
- crop->regionlist[i].length = (uint32) zlength;
+ crop->regionlist[i].width = (uint32_t) zwidth;
+ crop->regionlist[i].length = (uint32_t) zlength;
crop->regionlist[i].buffsize = buffsize;
crop->bufftotal += buffsize;
if (dump->outfile != NULL)
- dump_info (dump->outfile, dump->format, "", "Zone %d, width: %4d, length: %4d, x1: %4d x2: %4d y1: %4d y2: %4d",
- i + 1, (uint32)zwidth, (uint32)zlength,
- crop->regionlist[i].x1, crop->regionlist[i].x2,
- crop->regionlist[i].y1, crop->regionlist[i].y2);
+ dump_info (dump->outfile, dump->format, "", "Zone %d, width: %4"PRIu32", length: %4"PRIu32", x1: %4"PRIu32" x2: %4"PRIu32" y1: %4"PRIu32" y2: %4"PRIu32,
+ i + 1, zwidth, zlength,
+ crop->regionlist[i].x1, crop->regionlist[i].x2,
+ crop->regionlist[i].y1, crop->regionlist[i].y2);
}
return (0);
@@ -5643,13 +5635,13 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
{
double scale;
double pwidth, plength; /* Output page width and length in user units*/
- uint32 iwidth, ilength; /* Input image width and length in pixels*/
- uint32 owidth, olength; /* Output image width and length in pixels*/
- uint32 orows, ocols; /* rows and cols for output */
- uint32 hmargin, vmargin; /* Horizontal and vertical margins */
- uint32 x1, x2, y1, y2, line_bytes;
+ uint32_t iwidth, ilength; /* Input image width and length in pixels*/
+ uint32_t owidth, olength; /* Output image width and length in pixels*/
+ uint32_t orows, ocols; /* rows and cols for output */
+ uint32_t hmargin, vmargin; /* Horizontal and vertical margins */
+ uint32_t x1, x2, y1, y2, line_bytes;
/* unsigned int orientation; */
- uint32 i, j, k;
+ uint32_t i, j, k;
scale = 1.0;
if (page->res_unit == RESUNIT_NONE)
@@ -5710,7 +5702,7 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
"Hmargin: %3.2f, Vmargin: %3.2f",
page->name, page->vres, page->hres,
page->hmargin, page->vmargin);
- TIFFError("", "Res_unit: %d, Scale: %3.2f, Page width: %3.2f, length: %3.2f",
+ TIFFError("", "Res_unit: %"PRIu16", Scale: %3.2f, Page width: %3.2f, length: %3.2f",
page->res_unit, scale, pwidth, plength);
}
@@ -5719,27 +5711,27 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
{
if (page->res_unit == RESUNIT_INCH || page->res_unit == RESUNIT_CENTIMETER)
{ /* inches or centimeters specified */
- hmargin = (uint32)(page->hmargin * scale * page->hres * ((image->bps + 7)/ 8));
- vmargin = (uint32)(page->vmargin * scale * page->vres * ((image->bps + 7)/ 8));
+ hmargin = (uint32_t)(page->hmargin * scale * page->hres * ((image->bps + 7) / 8));
+ vmargin = (uint32_t)(page->vmargin * scale * page->vres * ((image->bps + 7) / 8));
}
else
{ /* Otherwise user has specified pixels as reference unit */
- hmargin = (uint32)(page->hmargin * scale * ((image->bps + 7)/ 8));
- vmargin = (uint32)(page->vmargin * scale * ((image->bps + 7)/ 8));
+ hmargin = (uint32_t)(page->hmargin * scale * ((image->bps + 7) / 8));
+ vmargin = (uint32_t)(page->vmargin * scale * ((image->bps + 7) / 8));
}
if ((hmargin * 2.0) > (pwidth * page->hres))
{
TIFFError("computeOutputPixelOffsets",
"Combined left and right margins exceed page width");
- hmargin = (uint32) 0;
+ hmargin = (uint32_t) 0;
return (-1);
}
if ((vmargin * 2.0) > (plength * page->vres))
{
TIFFError("computeOutputPixelOffsets",
"Combined top and bottom margins exceed page length");
- vmargin = (uint32) 0;
+ vmargin = (uint32_t) 0;
return (-1);
}
}
@@ -5763,13 +5755,13 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
{
if (page->mode & PAGE_MODE_PAPERSIZE )
{
- owidth = (uint32)((pwidth * page->hres) - (hmargin * 2));
- olength = (uint32)((plength * page->vres) - (vmargin * 2));
+ owidth = (uint32_t)((pwidth * page->hres) - (hmargin * 2));
+ olength = (uint32_t)((plength * page->vres) - (vmargin * 2));
}
else
{
- owidth = (uint32)(iwidth - (hmargin * 2 * page->hres));
- olength = (uint32)(ilength - (vmargin * 2 * page->vres));
+ owidth = (uint32_t)(iwidth - (hmargin * 2 * page->hres));
+ olength = (uint32_t)(ilength - (vmargin * 2 * page->vres));
}
}
@@ -5844,14 +5836,14 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
/* build the list of offsets for each output section */
for (k = 0, i = 0 && k <= MAX_SECTIONS; i < orows; i++)
{
- y1 = (uint32)(olength * i);
- y2 = (uint32)(olength * (i + 1) - 1);
+ y1 = (uint32_t)(olength * i);
+ y2 = (uint32_t)(olength * (i + 1) - 1);
if (y2 >= ilength)
y2 = ilength - 1;
for (j = 0; j < ocols; j++, k++)
{
- x1 = (uint32)(owidth * j);
- x2 = (uint32)(owidth * (j + 1) - 1);
+ x1 = (uint32_t)(owidth * j);
+ x2 = (uint32_t)(owidth * (j + 1) - 1);
if (x2 >= iwidth)
x2 = iwidth - 1;
sections[k].x1 = x1;
@@ -5869,29 +5861,29 @@ computeOutputPixelOffsets (struct crop_mask *crop, struct image_data *image,
static int
loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned char **read_ptr)
{
- uint32 i;
+ uint32_t i;
float xres = 0.0, yres = 0.0;
- uint32 nstrips = 0, ntiles = 0;
- uint16 planar = 0;
- uint16 bps = 0, spp = 0, res_unit = 0;
- uint16 orientation = 0;
- uint16 input_compression = 0, input_photometric = 0;
- uint16 subsampling_horiz, subsampling_vert;
- uint32 width = 0, length = 0;
- uint32 stsize = 0, tlsize = 0, buffsize = 0, scanlinesize = 0;
- uint32 tw = 0, tl = 0; /* Tile width and length */
- uint32 tile_rowsize = 0;
+ uint32_t nstrips = 0, ntiles = 0;
+ uint16_t planar = 0;
+ uint16_t bps = 0, spp = 0, res_unit = 0;
+ uint16_t orientation = 0;
+ uint16_t input_compression = 0, input_photometric = 0;
+ uint16_t subsampling_horiz, subsampling_vert;
+ uint32_t width = 0, length = 0;
+ uint32_t stsize = 0, tlsize = 0, buffsize = 0, scanlinesize = 0;
+ uint32_t tw = 0, tl = 0; /* Tile width and length */
+ uint32_t tile_rowsize = 0;
unsigned char *read_buff = NULL;
unsigned char *new_buff = NULL;
int readunit = 0;
- static uint32 prev_readsize = 0;
+ static uint32_t prev_readsize = 0;
TIFFGetFieldDefaulted(in, TIFFTAG_BITSPERSAMPLE, &bps);
TIFFGetFieldDefaulted(in, TIFFTAG_SAMPLESPERPIXEL, &spp);
TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &planar);
TIFFGetFieldDefaulted(in, TIFFTAG_ORIENTATION, &orientation);
if (! TIFFGetFieldDefaulted(in, TIFFTAG_PHOTOMETRIC, &input_photometric))
- TIFFError("loadImage","Image lacks Photometric interpreation tag");
+ TIFFError("loadImage","Image lacks Photometric interpretation tag");
if (! TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &width))
TIFFError("loadimage","Image lacks image width tag");
if(! TIFFGetField(in, TIFFTAG_IMAGELENGTH, &length))
@@ -6066,7 +6058,7 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
if ((bps == 0) || (spp == 0))
{
- TIFFError("loadImage", "Invalid samples per pixel (%d) or bits per sample (%d)",
+ TIFFError("loadImage", "Invalid samples per pixel (%"PRIu16") or bits per sample (%"PRIu16")",
spp, bps);
return (-1);
}
@@ -6092,7 +6084,7 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
exit(EXIT_FAILURE);
}
- if (buffsize < (uint32)(ntiles * tl * tile_rowsize))
+ if (buffsize < (uint32_t)(ntiles * tl * tile_rowsize))
{
buffsize = ntiles * tl * tile_rowsize;
if (ntiles != (buffsize / tl / tile_rowsize))
@@ -6103,19 +6095,19 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
#ifdef DEBUG2
TIFFError("loadImage",
- "Tilesize %u is too small, using ntiles * tilelength * tilerowsize %lu",
- tlsize, (unsigned long)buffsize);
+ "Tilesize %"PRIu32" is too small, using ntiles * tilelength * tilerowsize %"PRIu32,
+ tlsize, buffsize);
#endif
}
if (dump->infile != NULL)
dump_info (dump->infile, dump->format, "",
- "Tilesize: %u, Number of Tiles: %u, Tile row size: %u",
+ "Tilesize: %"PRIu32", Number of Tiles: %"PRIu32", Tile row size: %"PRIu32,
tlsize, ntiles, tile_rowsize);
}
else
{
- uint32 buffsize_check;
+ uint32_t buffsize_check;
readunit = STRIP;
TIFFGetFieldDefaulted(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
stsize = TIFFStripSize(in);
@@ -6138,19 +6130,19 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
TIFFError("loadImage", "Integer overflow detected.");
exit(EXIT_FAILURE);
}
- if (buffsize < (uint32) (((length * width * spp * bps) + 7) / 8))
+ if (buffsize < (uint32_t) (((length * width * spp * bps) + 7) / 8))
{
buffsize = ((length * width * spp * bps) + 7) / 8;
#ifdef DEBUG2
TIFFError("loadImage",
- "Stripsize %u is too small, using imagelength * width * spp * bps / 8 = %lu",
+ "Stripsize %"PRIu32" is too small, using imagelength * width * spp * bps / 8 = %"PRIu32,
stsize, (unsigned long)buffsize);
#endif
}
if (dump->infile != NULL)
dump_info (dump->infile, dump->format, "",
- "Stripsize: %u, Number of Strips: %u, Rows per Strip: %u, Scanline size: %u",
+ "Stripsize: %"PRIu32", Number of Strips: %"PRIu32", Rows per Strip: %"PRIu32", Scanline size: %"PRIu32,
stsize, nstrips, rowsperstrip, scanlinesize);
}
@@ -6169,7 +6161,7 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
if (subsampling_horiz != 1 || subsampling_vert != 1)
{
TIFFError("loadImage",
- "Can't copy/convert subsampled image with subsampling %d horiz %d vert",
+ "Can't copy/convert subsampled image with subsampling %"PRIu16" horiz %"PRIu16" vert",
subsampling_horiz, subsampling_vert);
return (-1);
}
@@ -6269,10 +6261,10 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
if ((dump->infile != NULL) && (dump->level == 2))
{
dump_info (dump->infile, dump->format, "loadImage",
- "Image width %d, length %d, Raw image data, %4d bytes",
+ "Image width %"PRIu32", length %"PRIu32", Raw image data, %4"PRIu32" bytes",
width, length, buffsize);
dump_info (dump->infile, dump->format, "",
- "Bits per sample %d, Samples per pixel %d", bps, spp);
+ "Bits per sample %"PRIu16", Samples per pixel %"PRIu16, bps, spp);
for (i = 0; i < length; i++)
dump_buffer(dump->infile, dump->format, 1, scanlinesize,
@@ -6283,7 +6275,7 @@ loadImage(TIFF* in, struct image_data *image, struct dump_opts *dump, unsigned c
static int correct_orientation(struct image_data *image, unsigned char **work_buff_ptr)
{
- uint16 mirror, rotation;
+ uint16_t mirror, rotation;
unsigned char *work_buff;
work_buff = *work_buff_ptr;
@@ -6295,7 +6287,7 @@ static int correct_orientation(struct image_data *image, unsigned char **work_b
if ((image->adjustments & MIRROR_HORIZ) || (image->adjustments & MIRROR_VERT))
{
- mirror = (uint16)(image->adjustments & MIRROR_BOTH);
+ mirror = (uint16_t)(image->adjustments & MIRROR_BOTH);
if (mirrorImage(image->spp, image->bps, mirror,
image->width, image->length, work_buff))
{
@@ -6307,17 +6299,17 @@ static int correct_orientation(struct image_data *image, unsigned char **work_b
if (image->adjustments & ROTATE_ANY)
{
if (image->adjustments & ROTATECW_90)
- rotation = (uint16) 90;
+ rotation = (uint16_t) 90;
else
if (image->adjustments & ROTATECW_180)
- rotation = (uint16) 180;
+ rotation = (uint16_t) 180;
else
if (image->adjustments & ROTATECW_270)
- rotation = (uint16) 270;
+ rotation = (uint16_t) 270;
else
{
- TIFFError ("correct_orientation", "Invalid rotation value: %d",
- image->adjustments & ROTATE_ANY);
+ TIFFError ("correct_orientation", "Invalid rotation value: %"PRIu16,
+ (uint16_t) (image->adjustments & ROTATE_ANY));
return (-1);
}
@@ -6339,13 +6331,13 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
unsigned char *read_buff, unsigned char *crop_buff)
{
int shift_width, bytes_per_sample, bytes_per_pixel;
- uint32 i, trailing_bits, prev_trailing_bits;
- uint32 row, first_row, last_row, first_col, last_col;
- uint32 src_rowsize, dst_rowsize, src_offset, dst_offset;
- uint32 crop_width, crop_length, img_width /*, img_length */;
- uint32 prev_length, prev_width, composite_width;
- uint16 bps, spp;
- uint8 *src, *dst;
+ uint32_t i, trailing_bits, prev_trailing_bits;
+ uint32_t row, first_row, last_row, first_col, last_col;
+ uint32_t src_rowsize, dst_rowsize, src_offset, dst_offset;
+ uint32_t crop_width, crop_length, img_width /*, img_length */;
+ uint32_t prev_length, prev_width, composite_width;
+ uint16_t bps, spp;
+ uint8_t *src, *dst;
tsample_t count, sample = 0; /* Update to extract one or more samples */
img_width = image->width;
@@ -6422,7 +6414,7 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
last_col + 1))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6434,7 +6426,7 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6446,7 +6438,7 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6456,7 +6448,7 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6468,11 +6460,11 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
- default: TIFFError("extractCompositeRegions", "Unsupported bit depth %d", bps);
+ default: TIFFError("extractCompositeRegions", "Unsupported bit depth %"PRIu16, bps);
return (1);
}
}
@@ -6504,7 +6496,7 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
first_col, last_col + 1))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6516,7 +6508,7 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6528,7 +6520,7 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6538,7 +6530,7 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6550,11 +6542,11 @@ extractCompositeRegions(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractCompositeRegions",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
- default: TIFFError("extractCompositeRegions", "Unsupported bit depth %d", bps);
+ default: TIFFError("extractCompositeRegions", "Unsupported bit depth %"PRIu16, bps);
return (1);
}
}
@@ -6588,13 +6580,13 @@ extractSeparateRegion(struct image_data *image, struct crop_mask *crop,
int region)
{
int shift_width, prev_trailing_bits = 0;
- uint32 bytes_per_sample, bytes_per_pixel;
- uint32 src_rowsize, dst_rowsize;
- uint32 row, first_row, last_row, first_col, last_col;
- uint32 src_offset, dst_offset;
- uint32 crop_width, crop_length, img_width /*, img_length */;
- uint16 bps, spp;
- uint8 *src, *dst;
+ uint32_t bytes_per_sample, bytes_per_pixel;
+ uint32_t src_rowsize, dst_rowsize;
+ uint32_t row, first_row, last_row, first_col, last_col;
+ uint32_t src_offset, dst_offset;
+ uint32_t crop_width, crop_length, img_width /*, img_length */;
+ uint16_t bps, spp;
+ uint8_t *src, *dst;
tsample_t count, sample = 0; /* Update to extract more or more samples */
img_width = image->width;
@@ -6647,7 +6639,7 @@ extractSeparateRegion(struct image_data *image, struct crop_mask *crop,
last_col + 1))
{
TIFFError("extractSeparateRegion",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6659,7 +6651,7 @@ extractSeparateRegion(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractSeparateRegion",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6671,7 +6663,7 @@ extractSeparateRegion(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractSeparateRegion",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6681,7 +6673,7 @@ extractSeparateRegion(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractSeparateRegion",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
@@ -6693,11 +6685,11 @@ extractSeparateRegion(struct image_data *image, struct crop_mask *crop,
prev_trailing_bits))
{
TIFFError("extractSeparateRegion",
- "Unable to extract row %d", row);
+ "Unable to extract row %"PRIu32, row);
return (1);
}
break;
- default: TIFFError("extractSeparateRegion", "Unsupported bit depth %d", bps);
+ default: TIFFError("extractSeparateRegion", "Unsupported bit depth %"PRIu16, bps);
return (1);
}
}
@@ -6714,19 +6706,19 @@ extractImageSection(struct image_data *image, struct pageseg *section,
/* unsigned char *src, *dst; */
#endif
- uint32 img_width, img_rowsize;
+ uint32_t img_width, img_rowsize;
#ifdef DEVELMODE
- uint32 img_length;
+ uint32_t img_length;
#endif
- uint32 j, shift1, shift2, trailing_bits;
- uint32 row, first_row, last_row, first_col, last_col;
- uint32 src_offset, dst_offset, row_offset, col_offset;
- uint32 offset1, offset2, full_bytes;
- uint32 sect_width;
+ uint32_t j, shift1, shift2, trailing_bits;
+ uint32_t row, first_row, last_row, first_col, last_col;
+ uint32_t src_offset, dst_offset, row_offset, col_offset;
+ uint32_t offset1, offset2, full_bytes;
+ uint32_t sect_width;
#ifdef DEVELMODE
- uint32 sect_length;
+ uint32_t sect_length;
#endif
- uint16 bps, spp;
+ uint16_t bps, spp;
#ifdef DEVELMODE
int k;
@@ -6774,11 +6766,11 @@ extractImageSection(struct image_data *image, struct pageseg *section,
trailing_bits = (sect_width * bps) % 8;
#ifdef DEVELMODE
- TIFFError ("", "First row: %d, last row: %d, First col: %d, last col: %d\n",
+ TIFFError ("", "First row: %"PRIu32", last row: %"PRIu32", First col: %"PRIu32", last col: %"PRIu32"\n",
first_row, last_row, first_col, last_col);
- TIFFError ("", "Image width: %d, Image length: %d, bps: %d, spp: %d\n",
+ TIFFError ("", "Image width: %"PRIu32", Image length: %"PRIu32", bps: %"PRIu16", spp: %"PRIu16"\n",
img_width, img_length, bps, spp);
- TIFFError ("", "Sect width: %d, Sect length: %d, full bytes: %d trailing bits %d\n",
+ TIFFError ("", "Sect width: %"PRIu32", Sect length: %"PRIu32", full bytes: %"PRIu32" trailing bits %"PRIu32"\n",
sect_width, sect_length, full_bytes, trailing_bits);
#endif
@@ -6792,7 +6784,7 @@ extractImageSection(struct image_data *image, struct pageseg *section,
src_offset = row_offset + col_offset;
#ifdef DEVELMODE
- TIFFError ("", "Src offset: %8d, Dst offset: %8d", src_offset, dst_offset);
+ TIFFError ("", "Src offset: %8"PRIu32", Dst offset: %8"PRIu32, src_offset, dst_offset);
#endif
_TIFFmemcpy (sect_buff + dst_offset, src_buff + src_offset, full_bytes);
dst_offset += full_bytes;
@@ -6823,7 +6815,7 @@ extractImageSection(struct image_data *image, struct pageseg *section,
sprintf(&bitarray[j], (bitset) ? "1" : "0");
}
bitarray[18] = '\0';
- TIFFError ("", "Row: %3d Offset1: %d, Shift1: %d, Offset2: %d, Shift2: %d\n",
+ TIFFError ("", "Row: %3d Offset1: %"PRIu32", Shift1: %"PRIu32", Offset2: %"PRIu32", Shift2: %"PRIu32"\n",
row, offset1, shift1, offset2, shift2);
#endif
@@ -6833,7 +6825,7 @@ extractImageSection(struct image_data *image, struct pageseg *section,
_TIFFmemcpy (sect_buff + dst_offset, src_buff + offset1, full_bytes);
#ifdef DEVELMODE
- TIFFError ("", " Aligned data src offset1: %8d, Dst offset: %8d\n", offset1, dst_offset);
+ TIFFError ("", " Aligned data src offset1: %8"PRIu32", Dst offset: %8"PRIu32"\n", offset1, dst_offset);
sprintf(&bitarray[18], "\n");
sprintf(&bitarray[19], "\t");
for (j = 20, k = 7; j < 28; j++, k--)
@@ -6851,7 +6843,7 @@ extractImageSection(struct image_data *image, struct pageseg *section,
bytebuff2 = src_buff[offset2] & ((unsigned char)255 << (7 - shift2));
sect_buff[dst_offset] = bytebuff2;
#ifdef DEVELMODE
- TIFFError ("", " Trailing bits src offset: %8d, Dst offset: %8d\n",
+ TIFFError ("", " Trailing bits src offset: %8"PRIu32", Dst offset: %8"PRIu32"\n",
offset2, dst_offset);
for (j = 30, k = 7; j < 38; j++, k--)
{
@@ -6867,7 +6859,7 @@ extractImageSection(struct image_data *image, struct pageseg *section,
else /* each destination byte will have to be built from two source bytes*/
{
#ifdef DEVELMODE
- TIFFError ("", " Unalligned data src offset: %8d, Dst offset: %8d\n", offset1 , dst_offset);
+ TIFFError ("", " Unalligned data src offset: %8"PRIu32", Dst offset: %8"PRIu32"\n", offset1 , dst_offset);
#endif
for (j = 0; j <= full_bytes; j++)
{
@@ -6891,7 +6883,7 @@ extractImageSection(struct image_data *image, struct pageseg *section,
if (trailing_bits != 0)
{
#ifdef DEVELMODE
- TIFFError ("", " Trailing bits src offset: %8d, Dst offset: %8d\n", offset1 + full_bytes, dst_offset);
+ TIFFError ("", " Trailing bits src offset: %8"PRIu32", Dst offset: %8"PRIu32"\n", offset1 + full_bytes, dst_offset);
#endif
if (shift2 > shift1)
{
@@ -7051,7 +7043,7 @@ writeImageSections(TIFF *in, TIFF *out, struct image_data *image,
unsigned char **sect_buff_ptr)
{
double hres, vres;
- uint32 i, k, width, length, sectsize;
+ uint32_t i, k, width, length, sectsize;
unsigned char *sect_buff = *sect_buff_ptr;
hres = page->hres;
@@ -7061,7 +7053,7 @@ writeImageSections(TIFF *in, TIFF *out, struct image_data *image,
if ((k < 1) || (k > MAX_SECTIONS))
{
TIFFError("writeImageSections",
- "%d Rows and Columns exceed maximum sections\nIncrease resolution or reduce sections", k);
+ "%"PRIu32" Rows and Columns exceed maximum sections\nIncrease resolution or reduce sections", k);
return (-1);
}
@@ -7069,7 +7061,7 @@ writeImageSections(TIFF *in, TIFF *out, struct image_data *image,
{
width = sections[i].x2 - sections[i].x1 + 1;
length = sections[i].y2 - sections[i].y1 + 1;
- sectsize = (uint32)
+ sectsize = (uint32_t)
ceil((width * image->bps + 7) / (double)8) * image->spp * length;
/* allocate a buffer if we don't have one already */
if (createImageSection(sectsize, sect_buff_ptr))
@@ -7104,14 +7096,14 @@ writeImageSections(TIFF *in, TIFF *out, struct image_data *image,
*/
static int
writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
- struct dump_opts *dump, uint32 width, uint32 length,
+ struct dump_opts *dump, uint32_t width, uint32_t length,
double hres, double vres,
unsigned char *sect_buff)
{
- uint16 bps, spp;
- uint16 input_compression, input_photometric;
- uint16 input_planar;
- struct cpTag* p;
+ uint16_t bps, spp;
+ uint16_t input_compression, input_photometric;
+ uint16_t input_planar;
+ const struct cpTag* p;
/* Calling this seems to reset the compression mode on the TIFF *in file.
TIFFGetField(in, TIFFTAG_JPEGCOLORMODE, &input_jpeg_colormode);
@@ -7135,8 +7127,8 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
* if the user has specified a command line option for
* a compression option. Should be passed around in one
* of the parameters instead of as a global. If no user
- * option specified it will still be (uint16) -1. */
- if (compression != (uint16)-1)
+ * option specified it will still be (uint16_t) -1. */
+ if (compression != (uint16_t)-1)
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
else
{ /* OJPEG is no longer supported for writing so upgrade to JPEG */
@@ -7220,9 +7212,9 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
* input image or, if nothing is defined, use the
* library default.
*/
- if (tilewidth == (uint32) 0)
+ if (tilewidth == (uint32_t) 0)
TIFFGetField(in, TIFFTAG_TILEWIDTH, &tilewidth);
- if (tilelength == (uint32) 0)
+ if (tilelength == (uint32_t) 0)
TIFFGetField(in, TIFFTAG_TILELENGTH, &tilelength);
if (tilewidth == 0 || tilelength == 0)
@@ -7236,7 +7228,7 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
* value from the input image or, if nothing is defined,
* use the library default.
*/
- if (rowsperstrip == (uint32) 0)
+ if (rowsperstrip == (uint32_t) 0)
{
if (!TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip))
rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
@@ -7247,13 +7239,13 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
}
}
else
- if (rowsperstrip == (uint32) -1)
+ if (rowsperstrip == (uint32_t) -1)
rowsperstrip = length;
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
}
TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &input_planar);
- if (config != (uint16) -1)
+ if (config != (uint16_t) -1)
TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
else
CopyField(TIFFTAG_PLANARCONFIG, config);
@@ -7282,7 +7274,7 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
case COMPRESSION_LZW:
case COMPRESSION_ADOBE_DEFLATE:
case COMPRESSION_DEFLATE:
- if (predictor != (uint16)-1)
+ if (predictor != (uint16_t)-1)
TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
else
CopyField(TIFFTAG_PREDICTOR, predictor);
@@ -7290,7 +7282,7 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
case COMPRESSION_CCITTFAX3:
case COMPRESSION_CCITTFAX4:
if (compression == COMPRESSION_CCITTFAX3) {
- if (g3opts != (uint32) -1)
+ if (g3opts != (uint32_t) -1)
TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, g3opts);
else
CopyField(TIFFTAG_GROUP3OPTIONS, g3opts);
@@ -7305,12 +7297,12 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
CopyTag(TIFFTAG_FAXSUBADDRESS, 1, TIFF_ASCII);
break;
}
- { uint32 len32;
+ { uint32_t len32;
void** data;
if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &len32, &data))
TIFFSetField(out, TIFFTAG_ICCPROFILE, len32, data);
}
- { uint16 ninks;
+ { uint16_t ninks;
const char* inknames;
if (TIFFGetField(in, TIFFTAG_NUMBEROFINKS, &ninks)) {
TIFFSetField(out, TIFFTAG_NUMBEROFINKS, ninks);
@@ -7374,11 +7366,11 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image,
/* Create a buffer to write one section at a time */
static int
-createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr)
+createImageSection(uint32_t sectsize, unsigned char **sect_buff_ptr)
{
unsigned char *sect_buff = NULL;
unsigned char *new_buff = NULL;
- static uint32 prev_sectsize = 0;
+ static uint32_t prev_sectsize = 0;
sect_buff = *sect_buff_ptr;
@@ -7423,7 +7415,7 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
unsigned char **read_buff_ptr, struct buffinfo seg_buffs[])
{
int i;
- uint32 width, length, total_width, total_length;
+ uint32_t width, length, total_width, total_length;
tsize_t cropsize;
unsigned char *crop_buff = NULL;
unsigned char *read_buff = NULL;
@@ -7523,7 +7515,7 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
&crop->combined_length, &crop_buff))
{
TIFFError("processCropSelections",
- "Failed to rotate composite regions by %d degrees", crop->rotation);
+ "Failed to rotate composite regions by %"PRIu32" degrees", crop->rotation);
return (-1);
}
seg_buffs[0].buffer = crop_buff;
@@ -7629,7 +7621,7 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
&crop->regionlist[i].length, &crop_buff))
{
TIFFError("processCropSelections",
- "Failed to rotate crop region by %d degrees", crop->rotation);
+ "Failed to rotate crop region by %"PRIu16" degrees", crop->rotation);
return (-1);
}
total_width += crop->regionlist[i].width;
@@ -7647,7 +7639,7 @@ processCropSelections(struct image_data *image, struct crop_mask *crop,
/* Copy the crop section of the data from the current image into a buffer
* and adjust the IFD values to reflect the new size. If no cropping is
- * required, use the origial read buffer as the crop buffer.
+ * required, use the original read buffer as the crop buffer.
*
* There is quite a bit of redundancy between this routine and the more
* specialized processCropSelections, but this provides
@@ -7757,7 +7749,7 @@ createCroppedImage(struct image_data *image, struct crop_mask *crop,
&crop->combined_length, crop_buff_ptr))
{
TIFFError("createCroppedImage",
- "Failed to rotate image or cropped selection by %d degrees", crop->rotation);
+ "Failed to rotate image or cropped selection by %"PRIu16" degrees", crop->rotation);
return (-1);
}
}
@@ -7781,14 +7773,14 @@ createCroppedImage(struct image_data *image, struct crop_mask *crop,
* then passed in as an argument.
*/
static int
-writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
- struct dump_opts *dump, uint32 width, uint32 length,
+writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
+ struct dump_opts *dump, uint32_t width, uint32_t length,
unsigned char *crop_buff, int pagenum, int total_pages)
{
- uint16 bps, spp;
- uint16 input_compression, input_photometric;
- uint16 input_planar;
- struct cpTag* p;
+ uint16_t bps, spp;
+ uint16_t input_compression, input_photometric;
+ uint16_t input_planar;
+ const struct cpTag* p;
input_compression = image->compression;
input_photometric = image->photometric;
@@ -7806,7 +7798,7 @@ writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
((input_compression == COMPRESSION_JPEG) ? "New Jpeg" : "Non Jpeg"));
#endif
- if (compression != (uint16)-1)
+ if (compression != (uint16_t)-1)
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
else
{
@@ -7895,9 +7887,9 @@ writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
* input image or, if nothing is defined, use the
* library default.
*/
- if (tilewidth == (uint32) 0)
+ if (tilewidth == (uint32_t) 0)
TIFFGetField(in, TIFFTAG_TILEWIDTH, &tilewidth);
- if (tilelength == (uint32) 0)
+ if (tilelength == (uint32_t) 0)
TIFFGetField(in, TIFFTAG_TILELENGTH, &tilelength);
if (tilewidth == 0 || tilelength == 0)
@@ -7910,7 +7902,7 @@ writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
* value from the input image or, if nothing is defined,
* use the library default.
*/
- if (rowsperstrip == (uint32) 0)
+ if (rowsperstrip == (uint32_t) 0)
{
if (!TIFFGetField(in, TIFFTAG_ROWSPERSTRIP, &rowsperstrip))
rowsperstrip = TIFFDefaultStripSize(out, rowsperstrip);
@@ -7921,13 +7913,13 @@ writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
}
}
else
- if (rowsperstrip == (uint32) -1)
+ if (rowsperstrip == (uint32_t) -1)
rowsperstrip = length;
TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, rowsperstrip);
}
TIFFGetFieldDefaulted(in, TIFFTAG_PLANARCONFIG, &input_planar);
- if (config != (uint16) -1)
+ if (config != (uint16_t) -1)
TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
else
CopyField(TIFFTAG_PLANARCONFIG, config);
@@ -7953,7 +7945,7 @@ writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
case COMPRESSION_LZW:
case COMPRESSION_ADOBE_DEFLATE:
case COMPRESSION_DEFLATE:
- if (predictor != (uint16)-1)
+ if (predictor != (uint16_t)-1)
TIFFSetField(out, TIFFTAG_PREDICTOR, predictor);
else
CopyField(TIFFTAG_PREDICTOR, predictor);
@@ -7967,7 +7959,7 @@ writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
return (-1);
}
if (compression == COMPRESSION_CCITTFAX3) {
- if (g3opts != (uint32) -1)
+ if (g3opts != (uint32_t) -1)
TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, g3opts);
else
CopyField(TIFFTAG_GROUP3OPTIONS, g3opts);
@@ -7985,12 +7977,12 @@ writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
break;
default: break;
}
- { uint32 len32;
+ { uint32_t len32;
void** data;
if (TIFFGetField(in, TIFFTAG_ICCPROFILE, &len32, &data))
TIFFSetField(out, TIFFTAG_ICCPROFILE, len32, data);
}
- { uint16 ninks;
+ { uint16_t ninks;
const char* inknames;
if (TIFFGetField(in, TIFFTAG_NUMBEROFINKS, &ninks)) {
TIFFSetField(out, TIFFTAG_NUMBEROFINKS, ninks);
@@ -8057,15 +8049,15 @@ writeCroppedImage(TIFF *in, TIFF *out, struct image_data *image,
} /* end writeCroppedImage */
static int
-rotateContigSamples8bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
- uint32 length, uint32 col, uint8 *src, uint8 *dst)
+rotateContigSamples8bits(uint16_t rotation, uint16_t spp, uint16_t bps, uint32_t width,
+ uint32_t length, uint32_t col, uint8_t *src, uint8_t *dst)
{
int ready_bits = 0;
- uint32 src_byte = 0, src_bit = 0;
- uint32 row, rowsize = 0, bit_offset = 0;
- uint8 matchbits = 0, maskbits = 0;
- uint8 buff1 = 0, buff2 = 0;
- uint8 *next;
+ uint32_t src_byte = 0, src_bit = 0;
+ uint32_t row, rowsize = 0, bit_offset = 0;
+ uint8_t matchbits = 0, maskbits = 0;
+ uint8_t buff1 = 0, buff2 = 0;
+ uint8_t *next;
tsample_t sample;
if ((src == NULL) || (dst == NULL))
@@ -8076,7 +8068,7 @@ rotateContigSamples8bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
rowsize = ((bps * spp * width) + 7) / 8;
ready_bits = 0;
- maskbits = (uint8)-1 >> ( 8 - bps);
+ maskbits = (uint8_t)-1 >> (8 - bps);
buff1 = buff2 = 0;
for (row = 0; row < length ; row++)
@@ -8101,7 +8093,7 @@ rotateContigSamples8bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
break;
case 270: next = src + src_byte + (row * rowsize);
break;
- default: TIFFError("rotateContigSamples8bits", "Invalid rotation %d", rotation);
+ default: TIFFError("rotateContigSamples8bits", "Invalid rotation %"PRIu16, rotation);
return (1);
}
matchbits = maskbits << (8 - src_bit - bps);
@@ -8133,16 +8125,16 @@ rotateContigSamples8bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
static int
-rotateContigSamples16bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
- uint32 length, uint32 col, uint8 *src, uint8 *dst)
+rotateContigSamples16bits(uint16_t rotation, uint16_t spp, uint16_t bps, uint32_t width,
+ uint32_t length, uint32_t col, uint8_t *src, uint8_t *dst)
{
int ready_bits = 0;
- uint32 row, rowsize, bit_offset;
- uint32 src_byte = 0, src_bit = 0;
- uint16 matchbits = 0, maskbits = 0;
- uint16 buff1 = 0, buff2 = 0;
- uint8 bytebuff = 0;
- uint8 *next;
+ uint32_t row, rowsize, bit_offset;
+ uint32_t src_byte = 0, src_bit = 0;
+ uint16_t matchbits = 0, maskbits = 0;
+ uint16_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff = 0;
+ uint8_t *next;
tsample_t sample;
if ((src == NULL) || (dst == NULL))
@@ -8153,7 +8145,7 @@ rotateContigSamples16bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
rowsize = ((bps * spp * width) + 7) / 8;
ready_bits = 0;
- maskbits = (uint16)-1 >> (16 - bps);
+ maskbits = (uint16_t)-1 >> (16 - bps);
buff1 = buff2 = 0;
for (row = 0; row < length; row++)
{
@@ -8177,7 +8169,7 @@ rotateContigSamples16bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
break;
case 270: next = src + src_byte + (row * rowsize);
break;
- default: TIFFError("rotateContigSamples8bits", "Invalid rotation %d", rotation);
+ default: TIFFError("rotateContigSamples8bits", "Invalid rotation %"PRIu16, rotation);
return (1);
}
matchbits = maskbits << (16 - src_bit - bps);
@@ -8216,16 +8208,16 @@ rotateContigSamples16bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
} /* end rotateContigSamples16bits */
static int
-rotateContigSamples24bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
- uint32 length, uint32 col, uint8 *src, uint8 *dst)
+rotateContigSamples24bits(uint16_t rotation, uint16_t spp, uint16_t bps, uint32_t width,
+ uint32_t length, uint32_t col, uint8_t *src, uint8_t *dst)
{
int ready_bits = 0;
- uint32 row, rowsize, bit_offset;
- uint32 src_byte = 0, src_bit = 0;
- uint32 matchbits = 0, maskbits = 0;
- uint32 buff1 = 0, buff2 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0;
- uint8 *next;
+ uint32_t row, rowsize, bit_offset;
+ uint32_t src_byte = 0, src_bit = 0;
+ uint32_t matchbits = 0, maskbits = 0;
+ uint32_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0;
+ uint8_t *next;
tsample_t sample;
@@ -8237,7 +8229,7 @@ rotateContigSamples24bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
rowsize = ((bps * spp * width) + 7) / 8;
ready_bits = 0;
- maskbits = (uint32)-1 >> (32 - bps);
+ maskbits = (uint32_t)-1 >> (32 - bps);
buff1 = buff2 = 0;
for (row = 0; row < length; row++)
{
@@ -8261,7 +8253,7 @@ rotateContigSamples24bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
break;
case 270: next = src + src_byte + (row * rowsize);
break;
- default: TIFFError("rotateContigSamples8bits", "Invalid rotation %d", rotation);
+ default: TIFFError("rotateContigSamples8bits", "Invalid rotation %"PRIu16, rotation);
return (1);
}
matchbits = maskbits << (32 - src_bit - bps);
@@ -8307,18 +8299,18 @@ rotateContigSamples24bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
} /* end rotateContigSamples24bits */
static int
-rotateContigSamples32bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
- uint32 length, uint32 col, uint8 *src, uint8 *dst)
+rotateContigSamples32bits(uint16_t rotation, uint16_t spp, uint16_t bps, uint32_t width,
+ uint32_t length, uint32_t col, uint8_t *src, uint8_t *dst)
{
int ready_bits = 0 /*, shift_width = 0 */;
/* int bytes_per_sample, bytes_per_pixel; */
- uint32 row, rowsize, bit_offset;
- uint32 src_byte, src_bit;
- uint32 longbuff1 = 0, longbuff2 = 0;
- uint64 maskbits = 0, matchbits = 0;
- uint64 buff1 = 0, buff2 = 0, buff3 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
- uint8 *next;
+ uint32_t row, rowsize, bit_offset;
+ uint32_t src_byte, src_bit;
+ uint32_t longbuff1 = 0, longbuff2 = 0;
+ uint64_t maskbits = 0, matchbits = 0;
+ uint64_t buff1 = 0, buff2 = 0, buff3 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
+ uint8_t *next;
tsample_t sample;
@@ -8337,7 +8329,7 @@ rotateContigSamples32bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
rowsize = ((bps * spp * width) + 7) / 8;
ready_bits = 0;
- maskbits = (uint64)-1 >> (64 - bps);
+ maskbits = (uint64_t)-1 >> (64 - bps);
buff1 = buff2 = 0;
for (row = 0; row < length; row++)
{
@@ -8361,7 +8353,7 @@ rotateContigSamples32bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
break;
case 270: next = src + src_byte + (row * rowsize);
break;
- default: TIFFError("rotateContigSamples8bits", "Invalid rotation %d", rotation);
+ default: TIFFError("rotateContigSamples8bits", "Invalid rotation %"PRIu16, rotation);
return (1);
}
matchbits = maskbits << (64 - src_bit - bps);
@@ -8376,7 +8368,7 @@ rotateContigSamples32bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
longbuff2 = longbuff1;
}
- buff3 = ((uint64)longbuff1 << 32) | longbuff2;
+ buff3 = ((uint64_t)longbuff1 << 32) | longbuff2;
buff1 = (buff3 & matchbits) << (src_bit);
if (ready_bits < 32)
@@ -8416,18 +8408,18 @@ rotateContigSamples32bits(uint16 rotation, uint16 spp, uint16 bps, uint32 width,
/* Rotate an image by a multiple of 90 degrees clockwise */
static int
-rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,
- uint32 *img_length, unsigned char **ibuff_ptr)
+rotateImage(uint16_t rotation, struct image_data *image, uint32_t *img_width,
+ uint32_t *img_length, unsigned char **ibuff_ptr)
{
int shift_width;
- uint32 bytes_per_pixel, bytes_per_sample;
- uint32 row, rowsize, src_offset, dst_offset;
- uint32 i, col, width, length;
- uint32 colsize, buffsize, col_offset, pix_offset;
+ uint32_t bytes_per_pixel, bytes_per_sample;
+ uint32_t row, rowsize, src_offset, dst_offset;
+ uint32_t i, col, width, length;
+ uint32_t colsize, buffsize, col_offset, pix_offset;
unsigned char *ibuff;
unsigned char *src;
unsigned char *dst;
- uint16 spp, bps;
+ uint16_t spp, bps;
float res_temp;
unsigned char *rbuff = NULL;
@@ -8457,7 +8449,7 @@ rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,
case 90:
case 180:
case 270: break;
- default: TIFFError("rotateImage", "Invalid rotation angle %d", rotation);
+ default: TIFFError("rotateImage", "Invalid rotation angle %"PRIu16, rotation);
return (-1);
}
@@ -8527,7 +8519,7 @@ rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,
return (-1);
}
break;
- default: TIFFError("rotateImage","Unsupported bit depth %d", bps);
+ default: TIFFError("rotateImage","Unsupported bit depth %"PRIu16, bps);
_TIFFfree(rbuff);
return (-1);
}
@@ -8596,7 +8588,7 @@ rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,
return (-1);
}
break;
- default: TIFFError("rotateImage","Unsupported bit depth %d", bps);
+ default: TIFFError("rotateImage","Unsupported bit depth %"PRIu16, bps);
_TIFFfree(rbuff);
return (-1);
}
@@ -8673,7 +8665,7 @@ rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,
return (-1);
}
break;
- default: TIFFError("rotateImage","Unsupported bit depth %d", bps);
+ default: TIFFError("rotateImage","Unsupported bit depth %"PRIu16, bps);
_TIFFfree(rbuff);
return (-1);
}
@@ -8698,15 +8690,15 @@ rotateImage(uint16 rotation, struct image_data *image, uint32 *img_width,
} /* end rotateImage */
static int
-reverseSamples8bits (uint16 spp, uint16 bps, uint32 width,
- uint8 *ibuff, uint8 *obuff)
+reverseSamples8bits (uint16_t spp, uint16_t bps, uint32_t width,
+ uint8_t *ibuff, uint8_t *obuff)
{
int ready_bits = 0;
- uint32 col;
- uint32 src_byte, src_bit;
- uint32 bit_offset = 0;
- uint8 match_bits = 0, mask_bits = 0;
- uint8 buff1 = 0, buff2 = 0;
+ uint32_t col;
+ uint32_t src_byte, src_bit;
+ uint32_t bit_offset = 0;
+ uint8_t match_bits = 0, mask_bits = 0;
+ uint8_t buff1 = 0, buff2 = 0;
unsigned char *src;
unsigned char *dst;
tsample_t sample;
@@ -8718,7 +8710,7 @@ reverseSamples8bits (uint16 spp, uint16 bps, uint32 width,
}
ready_bits = 0;
- mask_bits = (uint8)-1 >> ( 8 - bps);
+ mask_bits = (uint8_t)-1 >> (8 - bps);
dst = obuff;
for (col = width; col > 0; col--)
{
@@ -8763,16 +8755,16 @@ reverseSamples8bits (uint16 spp, uint16 bps, uint32 width,
static int
-reverseSamples16bits (uint16 spp, uint16 bps, uint32 width,
- uint8 *ibuff, uint8 *obuff)
+reverseSamples16bits (uint16_t spp, uint16_t bps, uint32_t width,
+ uint8_t *ibuff, uint8_t *obuff)
{
int ready_bits = 0;
- uint32 col;
- uint32 src_byte = 0, high_bit = 0;
- uint32 bit_offset = 0;
- uint16 match_bits = 0, mask_bits = 0;
- uint16 buff1 = 0, buff2 = 0;
- uint8 bytebuff = 0;
+ uint32_t col;
+ uint32_t src_byte = 0, high_bit = 0;
+ uint32_t bit_offset = 0;
+ uint16_t match_bits = 0, mask_bits = 0;
+ uint16_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff = 0;
unsigned char *src;
unsigned char *dst;
tsample_t sample;
@@ -8784,7 +8776,7 @@ reverseSamples16bits (uint16 spp, uint16 bps, uint32 width,
}
ready_bits = 0;
- mask_bits = (uint16)-1 >> (16 - bps);
+ mask_bits = (uint16_t)-1 >> (16 - bps);
dst = obuff;
for (col = width; col > 0; col--)
{
@@ -8838,16 +8830,16 @@ reverseSamples16bits (uint16 spp, uint16 bps, uint32 width,
} /* end reverseSamples16bits */
static int
-reverseSamples24bits (uint16 spp, uint16 bps, uint32 width,
- uint8 *ibuff, uint8 *obuff)
+reverseSamples24bits (uint16_t spp, uint16_t bps, uint32_t width,
+ uint8_t *ibuff, uint8_t *obuff)
{
int ready_bits = 0;
- uint32 col;
- uint32 src_byte = 0, high_bit = 0;
- uint32 bit_offset = 0;
- uint32 match_bits = 0, mask_bits = 0;
- uint32 buff1 = 0, buff2 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0;
+ uint32_t col;
+ uint32_t src_byte = 0, high_bit = 0;
+ uint32_t bit_offset = 0;
+ uint32_t match_bits = 0, mask_bits = 0;
+ uint32_t buff1 = 0, buff2 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0;
unsigned char *src;
unsigned char *dst;
tsample_t sample;
@@ -8859,7 +8851,7 @@ reverseSamples24bits (uint16 spp, uint16 bps, uint32 width,
}
ready_bits = 0;
- mask_bits = (uint32)-1 >> (32 - bps);
+ mask_bits = (uint32_t)-1 >> (32 - bps);
dst = obuff;
for (col = width; col > 0; col--)
{
@@ -8922,18 +8914,18 @@ reverseSamples24bits (uint16 spp, uint16 bps, uint32 width,
static int
-reverseSamples32bits (uint16 spp, uint16 bps, uint32 width,
- uint8 *ibuff, uint8 *obuff)
+reverseSamples32bits (uint16_t spp, uint16_t bps, uint32_t width,
+ uint8_t *ibuff, uint8_t *obuff)
{
int ready_bits = 0 /*, shift_width = 0 */;
/* int bytes_per_sample, bytes_per_pixel; */
- uint32 bit_offset;
- uint32 src_byte = 0, high_bit = 0;
- uint32 col;
- uint32 longbuff1 = 0, longbuff2 = 0;
- uint64 mask_bits = 0, match_bits = 0;
- uint64 buff1 = 0, buff2 = 0, buff3 = 0;
- uint8 bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
+ uint32_t bit_offset;
+ uint32_t src_byte = 0, high_bit = 0;
+ uint32_t col;
+ uint32_t longbuff1 = 0, longbuff2 = 0;
+ uint64_t mask_bits = 0, match_bits = 0;
+ uint64_t buff1 = 0, buff2 = 0, buff3 = 0;
+ uint8_t bytebuff1 = 0, bytebuff2 = 0, bytebuff3 = 0, bytebuff4 = 0;
unsigned char *src;
unsigned char *dst;
tsample_t sample;
@@ -8945,7 +8937,7 @@ reverseSamples32bits (uint16 spp, uint16 bps, uint32 width,
}
ready_bits = 0;
- mask_bits = (uint64)-1 >> (64 - bps);
+ mask_bits = (uint64_t)-1 >> (64 - bps);
dst = obuff;
/* bytes_per_sample = (bps + 7) / 8; */
@@ -8984,7 +8976,7 @@ reverseSamples32bits (uint16 spp, uint16 bps, uint32 width,
longbuff1 = (src[3] << 24) | (src[2] << 16) | (src[1] << 8) | src[0];
longbuff2 = longbuff1;
}
- buff3 = ((uint64)longbuff1 << 32) | longbuff2;
+ buff3 = ((uint64_t)longbuff1 << 32) | longbuff2;
buff1 = (buff3 & match_bits) << (high_bit);
if (ready_bits < 32)
@@ -9022,12 +9014,12 @@ reverseSamples32bits (uint16 spp, uint16 bps, uint32 width,
} /* end reverseSamples32bits */
static int
-reverseSamplesBytes (uint16 spp, uint16 bps, uint32 width,
- uint8 *src, uint8 *dst)
+reverseSamplesBytes (uint16_t spp, uint16_t bps, uint32_t width,
+ uint8_t *src, uint8_t *dst)
{
int i;
- uint32 col, bytes_per_pixel, col_offset;
- uint8 bytebuff1;
+ uint32_t col, bytes_per_pixel, col_offset;
+ uint8_t bytebuff1;
unsigned char swapbuff[32];
if ((src == NULL) || (dst == NULL))
@@ -9067,7 +9059,7 @@ reverseSamplesBytes (uint16 spp, uint16 bps, uint32 width,
dst -= spp;
}
break;
- default: TIFFError("reverseSamplesBytes","Unsupported bit depth %d", bps);
+ default: TIFFError("reverseSamplesBytes","Unsupported bit depth %"PRIu16, bps);
return (1);
}
return (0);
@@ -9076,11 +9068,11 @@ reverseSamplesBytes (uint16 spp, uint16 bps, uint32 width,
/* Mirror an image horizontally or vertically */
static int
-mirrorImage(uint16 spp, uint16 bps, uint16 mirror, uint32 width, uint32 length, unsigned char *ibuff)
+mirrorImage(uint16_t spp, uint16_t bps, uint16_t mirror, uint32_t width, uint32_t length, unsigned char *ibuff)
{
int shift_width;
- uint32 bytes_per_pixel, bytes_per_sample;
- uint32 row, rowsize, row_offset;
+ uint32_t bytes_per_pixel, bytes_per_sample;
+ uint32_t row, rowsize, row_offset;
unsigned char *line_buff = NULL;
unsigned char *src;
unsigned char *dst;
@@ -9170,7 +9162,7 @@ mirrorImage(uint16 spp, uint16 bps, uint16 mirror, uint32 width, uint32 length,
}
_TIFFmemcpy (src, line_buff, rowsize);
break;
- default: TIFFError("mirrorImage","Unsupported bit depth %d", bps);
+ default: TIFFError("mirrorImage","Unsupported bit depth %"PRIu16, bps);
_TIFFfree(line_buff);
return (-1);
}
@@ -9180,7 +9172,7 @@ mirrorImage(uint16 spp, uint16 bps, uint16 mirror, uint32 width, uint32 length,
}
break;
- default: TIFFError ("mirrorImage", "Invalid mirror axis %d", mirror);
+ default: TIFFError ("mirrorImage", "Invalid mirror axis %"PRIu16, mirror);
return (-1);
break;
}
@@ -9190,12 +9182,12 @@ mirrorImage(uint16 spp, uint16 bps, uint16 mirror, uint32 width, uint32 length,
/* Invert the light and dark values for a bilevel or grayscale image */
static int
-invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 length, unsigned char *work_buff)
+invertImage(uint16_t photometric, uint16_t spp, uint16_t bps, uint32_t width, uint32_t length, unsigned char *work_buff)
{
- uint32 row, col;
+ uint32_t row, col;
unsigned char *src;
- uint16 *src_uint16;
- uint32 *src_uint32;
+ uint16_t *src_uint16;
+ uint32_t *src_uint32;
if (spp != 1)
{
@@ -9218,7 +9210,7 @@ invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 len
switch (bps)
{
- case 32: src_uint32 = (uint32 *)src;
+ case 32: src_uint32 = (uint32_t *)src;
for (row = 0; row < length; row++)
for (col = 0; col < width; col++)
{
@@ -9226,7 +9218,7 @@ invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 len
src_uint32++;
}
break;
- case 16: src_uint16 = (uint16 *)src;
+ case 16: src_uint16 = (uint16_t *)src;
for (row = 0; row < length; row++)
for (col = 0; col < width; col++)
{
@@ -9244,7 +9236,7 @@ invertImage(uint16 photometric, uint16 spp, uint16 bps, uint32 width, uint32 len
src++;
}
break;
- default: TIFFError("invertImage", "Unsupported bit depth %d", bps);
+ default: TIFFError("invertImage", "Unsupported bit depth %"PRIu16, bps);
return (-1);
}
diff --git a/tiff/tools/tiffdither.c b/tiff/tools/tiffdither.c
index a9d1b7c5..062fd608 100644
--- a/tiff/tools/tiffdither.c
+++ b/tiff/tools/tiffdither.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -32,10 +33,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffio.h"
#include "tiffiop.h"
@@ -52,8 +49,8 @@
#define CopyField(tag, v) \
if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v)
-uint32 imagewidth;
-uint32 imagelength;
+uint32_t imagewidth;
+uint32_t imagelength;
int threshold = 128;
static void usage(int code);
@@ -69,8 +66,8 @@ fsdither(TIFF* in, TIFF* out)
short *thisline, *nextline, *tmpptr;
register unsigned char *outptr;
register short *thisptr, *nextptr;
- register uint32 i, j;
- uint32 imax, jmax;
+ register uint32_t i, j;
+ uint32_t imax, jmax;
int lastline, lastpixel;
int bit;
tsize_t outlinesize;
@@ -156,9 +153,9 @@ fsdither(TIFF* in, TIFF* out)
return errcode;
}
-static uint16 compression = COMPRESSION_PACKBITS;
-static uint16 predictor = 0;
-static uint32 group3options = 0;
+static uint16_t compression = COMPRESSION_PACKBITS;
+static uint16_t predictor = 0;
+static uint32_t group3options = 0;
static void
processG3Options(char* cp)
@@ -209,11 +206,11 @@ int
main(int argc, char* argv[])
{
TIFF *in, *out;
- uint16 samplesperpixel, bitspersample = 1, shortv;
+ uint16_t samplesperpixel, bitspersample = 1, shortv;
float floatv;
char thing[1024];
- uint32 rowsperstrip = (uint32) -1;
- uint16 fillorder = 0;
+ uint32_t rowsperstrip = (uint32_t) -1;
+ uint16_t fillorder = 0;
int c;
#if !HAVE_DECL_OPTARG
extern int optind;
@@ -246,9 +243,12 @@ main(int argc, char* argv[])
break;
case 'h':
usage(EXIT_SUCCESS);
+ /*NOTREACHED*/
+ break;
case '?':
usage(EXIT_FAILURE);
/*NOTREACHED*/
+ break;
}
if (argc - optind < 2)
usage(EXIT_FAILURE);
@@ -305,41 +305,49 @@ main(int argc, char* argv[])
return (EXIT_SUCCESS);
}
-static const char* stuff[] = {
-"usage: tiffdither [options] input.tif output.tif",
-"where options are:",
-" -r # make each strip have no more than # rows",
-" -t # set the threshold value for dithering (default 128)",
-" -f lsb2msb force lsb-to-msb FillOrder for output",
-" -f msb2lsb force msb-to-lsb FillOrder for output",
-" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts] compress output with deflate encoding",
-" -c packbits compress output with packbits encoding",
-" -c g3[:opts] compress output with CCITT Group 3 encoding",
-" -c g4 compress output with CCITT Group 4 encoding",
-" -c none use no compression algorithm on output",
-"",
-"Group 3 options:",
-" 1d use default CCITT Group 3 1D-encoding",
-" 2d use optional CCITT Group 3 2D-encoding",
-" fill byte-align EOL codes",
-"For example, -c g3:2d:fill to get G3-2D-encoded data with byte-aligned EOLs",
-"",
-"LZW and deflate options:",
-" # set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-NULL
-};
+static const char usage_info[] =
+"Convert a greyscale image to bilevel using dithering\n\n"
+"usage: tiffdither [options] input.tif output.tif\n"
+"where options are:\n"
+" -r # make each strip have no more than # rows\n"
+" -t # set the threshold value for dithering (default 128)\n"
+" -f lsb2msb force lsb-to-msb FillOrder for output\n"
+" -f msb2lsb force msb-to-lsb FillOrder for output\n"
+"\n"
+#ifdef LZW_SUPPORT
+" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding\n"
+" # set predictor value\n"
+" For example, -c lzw:2 for LZW-encoded data with horizontal differencing\n"
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip[:opts] compress output with deflate encoding\n"
+" # set predictor value\n"
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits compress output with packbits encoding\n"
+#endif
+#ifdef CCITT_SUPPORT
+" -c g3[:opts] compress output with CCITT Group 3 encoding\n"
+" Group 3 options:\n"
+" 1d use default CCITT Group 3 1D-encoding\n"
+" 2d use optional CCITT Group 3 2D-encoding\n"
+" fill byte-align EOL codes\n"
+" For example, -c g3:2d:fill for G3-2D-encoded data with byte-aligned EOLs\n"
+" -c g4 compress output with CCITT Group 4 encoding\n"
+#endif
+#if defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(PACKBITS_SUPPORT) || defined(CCITT_SUPPORT)
+" -c none use no compression algorithm on output\n"
+#endif
+"\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
diff --git a/tiff/tools/tiffdump.c b/tiff/tools/tiffdump.c
index 00be9dd4..500fffb6 100644
--- a/tiff/tools/tiffdump.c
+++ b/tiff/tools/tiffdump.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -46,14 +47,6 @@
# include <io.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
#include "tiffio.h"
#ifndef EXIT_SUCCESS
@@ -73,35 +66,35 @@ static union
TIFFHeaderBig big;
TIFFHeaderCommon common;
} hdr;
-char* appname;
-char* curfile;
-int swabflag;
-int bigendian;
-int bigtiff;
-uint32 maxitems = 24; /* maximum indirect data items to print */
-
-const char* bytefmt = "%s%#02x"; /* BYTE */
-const char* sbytefmt = "%s%d"; /* SBYTE */
-const char* shortfmt = "%s%u"; /* SHORT */
-const char* sshortfmt = "%s%d"; /* SSHORT */
-const char* longfmt = "%s%lu"; /* LONG */
-const char* slongfmt = "%s%ld"; /* SLONG */
-const char* ifdfmt = "%s%#04lx"; /* IFD offset */
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
-const char* long8fmt = "%s%I64u"; /* LONG8 */
-const char* slong8fmt = "%s%I64d"; /* SLONG8 */
-const char* ifd8fmt = "%s%#08I64x"; /* IFD offset8*/
-#else
-const char* long8fmt = "%s%llu"; /* LONG8 */
-const char* slong8fmt = "%s%lld"; /* SLONG8 */
-const char* ifd8fmt = "%s%#08llx"; /* IFD offset8*/
-#endif
-const char* rationalfmt = "%s%g"; /* RATIONAL */
-const char* srationalfmt = "%s%g"; /* SRATIONAL */
-const char* floatfmt = "%s%g"; /* FLOAT */
-const char* doublefmt = "%s%g"; /* DOUBLE */
-
-static void dump(int, uint64);
+static char* appname;
+static char* curfile;
+static int swabflag;
+static int bigendian;
+static int bigtiff;
+static uint32_t maxitems = 24; /* maximum indirect data items to print */
+
+static const char bytefmt[] = "%s%#02" PRIx8; /* BYTE */
+static const char sbytefmt[] = "%s%" PRId8; /* SBYTE */
+static const char shortfmtd[] = "%s%" PRIu16; /* SHORT */
+static const char shortfmth[] = "%s%#" PRIx16;
+static const char sshortfmtd[] = "%s%" PRId16; /* SSHORT */
+static const char sshortfmth[] = "%s%#" PRIx16;
+static const char longfmtd[] = "%s%" PRIu32; /* LONG */
+static const char longfmth[] = "%s%#" PRIx32;
+static const char slongfmtd[] = "%s%" PRId32; /* SLONG */
+static const char slongfmth[] = "%s%#" PRIx32;
+static const char ifdfmt[] = "%s%#04" PRIx32; /* IFD offset */
+static const char long8fmt[] = "%s%" PRIu64; /* LONG8 */
+static const char slong8fmt[] = "%s%" PRId64; /* SLONG8 */
+static const char ifd8fmt[] = "%s%#08" PRIx64; /* IFD offset8 */
+static const char rationalfmt[] = "%s%g"; /* RATIONAL */
+static const char srationalfmt[] = "%s%g"; /* SRATIONAL */
+static const char floatfmt[] = "%s%g"; /* FLOAT */
+static const char doublefmt[] = "%s%g"; /* DOUBLE */
+
+unsigned int hex_mode;
+
+static void dump(int, uint64_t);
#if !HAVE_DECL_OPTARG
extern int optind;
@@ -111,6 +104,7 @@ extern char* optarg;
void
usage()
{
+ fprintf(stderr, "\nDisplay directory information from TIFF files\n\n");
fprintf(stderr, "usage: %s [-h] [-o offset] [-m maxitems] file.tif ...\n", appname);
exit(EXIT_FAILURE);
}
@@ -121,20 +115,18 @@ main(int argc, char* argv[])
int one = 1, fd;
int multiplefiles = (argc > 1);
int c;
- uint64 diroff = 0;
+ uint64_t diroff = 0;
+ hex_mode=0;
bigendian = (*(char *)&one == 0);
appname = argv[0];
while ((c = getopt(argc, argv, "m:o:h")) != -1) {
switch (c) {
- case 'h': /* print values in hex */
- shortfmt = "%s%#x";
- sshortfmt = "%s%#x";
- longfmt = "%s%#lx";
- slongfmt = "%s%#lx";
+ case 'h': /* print values in hex */
+ hex_mode=1;
break;
case 'o':
- diroff = (uint64) strtoul(optarg, NULL, 0);
+ diroff = (uint64_t) strtoul(optarg, NULL, 0);
break;
case 'm':
maxitems = strtoul(optarg, NULL, 0);
@@ -164,16 +156,16 @@ main(int argc, char* argv[])
#define ord(e) ((int)e)
-static uint64 ReadDirectory(int, unsigned, uint64);
+static uint64_t ReadDirectory(int, unsigned, uint64_t);
static void ReadError(char*);
static void Error(const char*, ...);
static void Fatal(const char*, ...);
static void
-dump(int fd, uint64 diroff)
+dump(int fd, uint64_t diroff)
{
unsigned i, j;
- uint64* visited_diroff = NULL;
+ uint64_t* visited_diroff = NULL;
unsigned int count_visited_dir = 0;
_TIFF_lseek_f(fd, (_TIFF_off_t) 0, 0);
@@ -246,7 +238,7 @@ dump(int fd, uint64 diroff)
{
size_t alloc_size;
alloc_size=TIFFSafeMultiply(tmsize_t,(count_visited_dir + 1),
- sizeof(uint64));
+ sizeof(uint64_t));
if (alloc_size == 0)
{
if (visited_diroff)
@@ -255,7 +247,7 @@ dump(int fd, uint64 diroff)
}
else
{
- visited_diroff = (uint64*) realloc(visited_diroff,alloc_size);
+ visited_diroff = (uint64_t*) realloc(visited_diroff, alloc_size);
}
}
if( !visited_diroff )
@@ -293,24 +285,24 @@ static const int datawidth[] = {
8, /* 18 = TIFF_IFD8 */
};
#define NWIDTHS (sizeof (datawidth) / sizeof (datawidth[0]))
-static void PrintTag(FILE*, uint16);
-static void PrintType(FILE*, uint16);
-static void PrintData(FILE*, uint16, uint32, unsigned char*);
+static void PrintTag(FILE*, uint16_t);
+static void PrintType(FILE*, uint16_t);
+static void PrintData(FILE*, uint16_t, uint32_t, unsigned char*);
/*
* Read the next TIFF directory from a file
* and convert it to the internal format.
* We read directories sequentially.
*/
-static uint64
-ReadDirectory(int fd, unsigned int ix, uint64 off)
+static uint64_t
+ReadDirectory(int fd, unsigned int ix, uint64_t off)
{
- uint16 dircount;
- uint32 direntrysize;
+ uint16_t dircount;
+ uint32_t direntrysize;
void* dirmem = NULL;
- uint64 nextdiroff = 0;
- uint32 n;
- uint8* dp;
+ uint64_t nextdiroff = 0;
+ uint32_t n;
+ uint8_t* dp;
if (off == 0) /* no more directories */
goto done;
@@ -319,7 +311,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
goto done;
}
if (!bigtiff) {
- if (read(fd, (char*) &dircount, sizeof (uint16)) != sizeof (uint16)) {
+ if (read(fd, (char*) &dircount, sizeof (uint16_t)) != sizeof (uint16_t)) {
ReadError("directory count");
goto done;
}
@@ -327,8 +319,8 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
TIFFSwabShort(&dircount);
direntrysize = 12;
} else {
- uint64 dircount64 = 0;
- if (read(fd, (char*) &dircount64, sizeof (uint64)) != sizeof (uint64)) {
+ uint64_t dircount64 = 0;
+ if (read(fd, (char*) &dircount64, sizeof (uint64_t)) != sizeof (uint64_t)) {
ReadError("directory count");
goto done;
}
@@ -338,7 +330,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
Error("Sanity check on directory count failed");
goto done;
}
- dircount = (uint16)dircount64;
+ dircount = (uint16_t)dircount64;
direntrysize = 20;
}
dirmem = _TIFFmalloc(TIFFSafeMultiply(tmsize_t,dircount,direntrysize));
@@ -350,57 +342,45 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
if (n != dircount*direntrysize) {
n /= direntrysize;
Error(
-#if defined(__WIN32__) && defined(_MSC_VER)
- "Could only read %lu of %u entries in directory at offset %#I64x",
- (unsigned long)n, dircount, (unsigned __int64) off);
-#else
- "Could only read %lu of %u entries in directory at offset %#llx",
- (unsigned long)n, dircount, (unsigned long long) off);
-#endif
+ "Could only read %" PRIu32 " of %" PRIu16 " entries in directory at offset %#" PRIu64,
+ n, dircount, off);
dircount = n;
nextdiroff = 0;
} else {
if (!bigtiff) {
- uint32 nextdiroff32;
- if (read(fd, (char*) &nextdiroff32, sizeof (uint32)) != sizeof (uint32))
+ uint32_t nextdiroff32;
+ if (read(fd, (char*) &nextdiroff32, sizeof (uint32_t)) != sizeof (uint32_t))
nextdiroff32 = 0;
if (swabflag)
TIFFSwabLong(&nextdiroff32);
nextdiroff = nextdiroff32;
} else {
- if (read(fd, (char*) &nextdiroff, sizeof (uint64)) != sizeof (uint64))
+ if (read(fd, (char*) &nextdiroff, sizeof (uint64_t)) != sizeof (uint64_t))
nextdiroff = 0;
if (swabflag)
TIFFSwabLong8(&nextdiroff);
}
}
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- printf("Directory %u: offset %I64u (%#I64x) next %I64u (%#I64x)\n", ix,
- (unsigned __int64)off, (unsigned __int64)off,
- (unsigned __int64)nextdiroff, (unsigned __int64)nextdiroff);
-#else
- printf("Directory %u: offset %llu (%#llx) next %llu (%#llx)\n", ix,
- (unsigned long long)off, (unsigned long long)off,
- (unsigned long long)nextdiroff, (unsigned long long)nextdiroff);
-#endif
- for (dp = (uint8*)dirmem, n = dircount; n > 0; n--) {
- uint16 tag;
- uint16 type;
- uint16 typewidth;
- uint64 count;
- uint64 datasize;
+ printf("Directory %u: offset %" PRIu64 " (%#" PRIx64 ") next %" PRIu64 " (%#" PRIx64 ")\n",
+ ix, off, off, nextdiroff, nextdiroff);
+ for (dp = (uint8_t*)dirmem, n = dircount; n > 0; n--) {
+ uint16_t tag;
+ uint16_t type;
+ uint16_t typewidth;
+ uint64_t count;
+ uint64_t datasize;
int datafits;
void* datamem;
- uint64 dataoffset;
+ uint64_t dataoffset;
int datatruncated;
int datasizeoverflow;
- tag = *(uint16*)dp;
+ tag = *(uint16_t*)dp;
if (swabflag)
TIFFSwabShort(&tag);
- dp += sizeof(uint16);
- type = *(uint16*)dp;
- dp += sizeof(uint16);
+ dp += sizeof(uint16_t);
+ type = *(uint16_t*)dp;
+ dp += sizeof(uint16_t);
if (swabflag)
TIFFSwabShort(&type);
PrintTag(stdout, tag);
@@ -409,25 +389,21 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
putchar(' ');
if (!bigtiff)
{
- uint32 count32;
- count32 = *(uint32*)dp;
+ uint32_t count32;
+ count32 = *(uint32_t*)dp;
if (swabflag)
TIFFSwabLong(&count32);
- dp += sizeof(uint32);
+ dp += sizeof(uint32_t);
count = count32;
}
else
{
- memcpy(&count, dp, sizeof(uint64));
+ memcpy(&count, dp, sizeof(uint64_t));
if (swabflag)
TIFFSwabLong8(&count);
- dp += sizeof(uint64);
+ dp += sizeof(uint64_t);
}
-#if defined(__WIN32__) && (defined(_MSC_VER) || defined(__MINGW32__))
- printf("%I64u<", (unsigned __int64)count);
-#else
- printf("%llu<", (unsigned long long)count);
-#endif
+ printf("%" PRIu64 "<", count);
if (type >= NWIDTHS)
typewidth = 0;
else
@@ -442,15 +418,15 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
{
if (datasizeoverflow || datasize>4)
{
- uint32 dataoffset32;
+ uint32_t dataoffset32;
datafits = 0;
datamem = NULL;
- dataoffset32 = *(uint32*)dp;
+ dataoffset32 = *(uint32_t*)dp;
if (swabflag)
TIFFSwabLong(&dataoffset32);
dataoffset = dataoffset32;
}
- dp += sizeof(uint32);
+ dp += sizeof(uint32_t);
}
else
{
@@ -458,11 +434,11 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
{
datafits = 0;
datamem = NULL;
- memcpy(&dataoffset, dp, sizeof(uint64));
+ memcpy(&dataoffset, dp, sizeof(uint64_t));
if (swabflag)
TIFFSwabLong8(&dataoffset);
}
- dp += sizeof(uint64);
+ dp += sizeof(uint64_t);
}
if (datasizeoverflow || datasize>0x10000)
{
@@ -488,7 +464,7 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
_TIFFfree(datamem);
datamem = NULL;
}
- else if (read(fd, datamem, (size_t)datasize) != (TIFF_SSIZE_T)datasize)
+ else if (read(fd, datamem, (size_t)datasize) != (tmsize_t)datasize)
{
Error(
"Read error accessing tag %u value", tag);
@@ -511,27 +487,27 @@ ReadDirectory(int fd, unsigned int ix, uint64 off)
break;
case TIFF_SHORT:
case TIFF_SSHORT:
- TIFFSwabArrayOfShort((uint16*)datamem,(tmsize_t)count);
+ TIFFSwabArrayOfShort((uint16_t*)datamem, (tmsize_t)count);
break;
case TIFF_LONG:
case TIFF_SLONG:
case TIFF_FLOAT:
case TIFF_IFD:
- TIFFSwabArrayOfLong((uint32*)datamem,(tmsize_t)count);
+ TIFFSwabArrayOfLong((uint32_t*)datamem, (tmsize_t)count);
break;
case TIFF_RATIONAL:
case TIFF_SRATIONAL:
- TIFFSwabArrayOfLong((uint32*)datamem,(tmsize_t)count*2);
+ TIFFSwabArrayOfLong((uint32_t*)datamem, (tmsize_t)count * 2);
break;
case TIFF_DOUBLE:
case TIFF_LONG8:
case TIFF_SLONG8:
case TIFF_IFD8:
- TIFFSwabArrayOfLong8((uint64*)datamem,(tmsize_t)count);
+ TIFFSwabArrayOfLong8((uint64_t*)datamem, (tmsize_t)count);
break;
}
}
- PrintData(stdout,type,(uint32)count,datamem);
+ PrintData(stdout, type, (uint32_t)count, datamem);
if (datatruncated)
printf(" ...");
if (!datafits)
@@ -549,7 +525,7 @@ done:
}
static const struct tagname {
- uint16 tag;
+ uint16_t tag;
const char* name;
} tagnames[] = {
{ TIFFTAG_SUBFILETYPE, "SubFileType" },
@@ -647,7 +623,7 @@ static const struct tagname {
#define NTAGS (sizeof (tagnames) / sizeof (tagnames[0]))
static void
-PrintTag(FILE* fd, uint16 tag)
+PrintTag(FILE* fd, uint16_t tag)
{
const struct tagname *tp;
@@ -660,7 +636,7 @@ PrintTag(FILE* fd, uint16 tag)
}
static void
-PrintType(FILE* fd, uint16 type)
+PrintType(FILE* fd, uint16_t type)
{
static const char *typenames[] = {
"0",
@@ -695,7 +671,7 @@ PrintType(FILE* fd, uint16 type)
#include <ctype.h>
static void
-PrintASCII(FILE* fd, uint32 cc, const unsigned char* cp)
+PrintASCII(FILE* fd, uint32_t cc, const unsigned char* cp)
{
for (; cc > 0; cc--, cp++) {
const char* tp;
@@ -717,7 +693,7 @@ PrintASCII(FILE* fd, uint32 cc, const unsigned char* cp)
}
static void
-PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data)
+PrintData(FILE* fd, uint16_t type, uint32_t count, unsigned char* data)
{
char* sep = "";
@@ -738,36 +714,36 @@ PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data)
PrintASCII(fd, count, data);
break;
case TIFF_SHORT: {
- uint16 *wp = (uint16*)data;
+ uint16_t *wp = (uint16_t*)data;
while (count-- > 0)
- fprintf(fd, shortfmt, sep, *wp++), sep = " ";
+ fprintf(fd, hex_mode ? shortfmth : shortfmtd, sep, *wp++), sep = " ";
break;
}
case TIFF_SSHORT: {
- int16 *wp = (int16*)data;
+ int16_t *wp = (int16_t*)data;
while (count-- > 0)
- fprintf(fd, sshortfmt, sep, *wp++), sep = " ";
+ fprintf(fd, hex_mode ? sshortfmth : sshortfmtd, sep, *wp++), sep = " ";
break;
}
case TIFF_LONG: {
- uint32 *lp = (uint32*)data;
+ uint32_t *lp = (uint32_t*)data;
while (count-- > 0) {
- fprintf(fd, longfmt, sep, (unsigned long) *lp++);
+ fprintf(fd, hex_mode ? longfmth : longfmtd, sep, *lp++);
sep = " ";
}
break;
}
case TIFF_SLONG: {
- int32 *lp = (int32*)data;
+ int32_t *lp = (int32_t*)data;
while (count-- > 0)
- fprintf(fd, slongfmt, sep, (long) *lp++), sep = " ";
+ fprintf(fd, hex_mode ? slongfmth : slongfmtd, sep, *lp++), sep = " ";
break;
}
case TIFF_LONG8: {
- uint64 *llp = (uint64*)data;
+ uint64_t *llp = (uint64_t*)data;
while (count-- > 0) {
- uint64 val;
- memcpy(&val, llp, sizeof(uint64));
+ uint64_t val;
+ memcpy(&val, llp, sizeof(uint64_t));
llp ++;
fprintf(fd, long8fmt, sep, val);
sep = " ";
@@ -775,10 +751,10 @@ PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data)
break;
}
case TIFF_SLONG8: {
- int64 *llp = (int64*)data;
+ int64_t *llp = (int64_t*)data;
while (count-- > 0) {
- int64 val;
- memcpy(&val, llp, sizeof(int64));
+ int64_t val;
+ memcpy(&val, llp, sizeof(int64_t));
llp ++;
fprintf(fd, slong8fmt, sep, val);
sep = " ";
@@ -786,12 +762,11 @@ PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data)
break;
}
case TIFF_RATIONAL: {
- uint32 *lp = (uint32*)data;
+ uint32_t *lp = (uint32_t*)data;
while (count-- > 0) {
if (lp[1] == 0)
- fprintf(fd, "%sNan (%lu/%lu)", sep,
- (unsigned long) lp[0],
- (unsigned long) lp[1]);
+ fprintf(fd, "%sNan (%"PRIu32"/%"PRIu32")", sep,
+ lp[0], lp[1]);
else
fprintf(fd, rationalfmt, sep,
(double)lp[0] / (double)lp[1]);
@@ -801,11 +776,11 @@ PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data)
break;
}
case TIFF_SRATIONAL: {
- int32 *lp = (int32*)data;
+ int32_t *lp = (int32_t*)data;
while (count-- > 0) {
if (lp[1] == 0)
- fprintf(fd, "%sNan (%ld/%ld)", sep,
- (long) lp[0], (long) lp[1]);
+ fprintf(fd, "%sNan (%"PRId32"/%"PRId32")", sep,
+ lp[0], lp[1]);
else
fprintf(fd, srationalfmt, sep,
(double)lp[0] / (double)lp[1]);
@@ -827,21 +802,18 @@ PrintData(FILE* fd, uint16 type, uint32 count, unsigned char* data)
break;
}
case TIFF_IFD: {
- uint32 *lp = (uint32*)data;
+ uint32_t *lp = (uint32_t*)data;
while (count-- > 0) {
- fprintf(fd, ifdfmt, sep, (unsigned long) *lp++);
+ fprintf(fd, ifdfmt, sep, *lp++);
sep = " ";
}
break;
}
case TIFF_IFD8: {
- uint64 *llp = (uint64*)data;
+ uint64_t *llp = (uint64_t*)data;
while (count-- > 0) {
-#if defined(__WIN32__) && defined(_MSC_VER)
- fprintf(fd, ifd8fmt, sep, (unsigned __int64) *llp++);
-#else
- fprintf(fd, ifd8fmt, sep, (unsigned long long) *llp++);
-#endif
+ fprintf(fd, ifd8fmt, sep, *llp++);
+ sep = " ";
sep = " ";
}
break;
diff --git a/tiff/tools/tiffgt.c b/tiff/tools/tiffgt.c
index f3cca8c9..f9e1e087 100644
--- a/tiff/tools/tiffgt.c
+++ b/tiff/tools/tiffgt.c
@@ -24,6 +24,8 @@
*/
#include "tif_config.h"
+#include "libport.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -55,20 +57,16 @@
#define EXIT_FAILURE 1
#endif
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
-static uint32 width = 0, height = 0; /* window width & height */
-static uint32* raster = NULL; /* displayable image */
+static uint32_t width = 0, height = 0; /* window width & height */
+static uint32_t* raster = NULL; /* displayable image */
static TIFFRGBAImage img;
static int order0 = 0, order;
-static uint16 photo0 = (uint16) -1, photo;
+static uint16_t photo0 = (uint16_t) -1, photo;
static int stoponerr = 0; /* stop on read error */
static int verbose = 0;
#define TITLE_LENGTH 1024
static char title[TITLE_LENGTH]; /* window title line */
-static uint32 xmax, ymax;
+static uint32_t xmax, ymax;
static char** filelist = NULL;
static int fileindex;
static int filenum;
@@ -81,7 +79,7 @@ static int prevImage(void);
static int nextImage(void);
static void setWindowSize(void);
static void usage(int);
-static uint16 photoArg(const char*);
+static uint16_t photoArg(const char*);
static void raster_draw(void);
static void raster_reshape(int, int);
static void raster_keys(unsigned char, int, int);
@@ -105,7 +103,7 @@ main(int argc, char* argv[])
{
int c;
int dirnum = -1;
- uint32 diroff = 0;
+ uint32_t diroff = 0;
oerror = TIFFSetErrorHandler(NULL);
owarning = TIFFSetWarningHandler(NULL);
@@ -223,11 +221,11 @@ cleanup_and_exit(int code)
static int
initImage(void)
{
- uint32 w, h;
+ uint32_t w, h;
if (order)
TIFFSetField(tif, TIFFTAG_FILLORDER, order);
- if (photo != (uint16) -1)
+ if (photo != (uint16_t) -1)
TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photo);
if (!TIFFRGBAImageBegin(&img, tif, stoponerr, title)) {
TIFFError(filelist[fileindex], "%s", title);
@@ -251,12 +249,12 @@ initImage(void)
}
if (w != width || h != height) {
- uint32 rastersize =
+ uint32_t rastersize =
_TIFFMultiply32(tif, img.width, img.height, "allocating raster buffer");
if (raster != NULL)
_TIFFfree(raster), raster = NULL;
- raster = (uint32*) _TIFFCheckMalloc(tif, rastersize, sizeof (uint32),
- "allocating raster buffer");
+ raster = (uint32_t*) _TIFFCheckMalloc(tif, rastersize, sizeof (uint32_t),
+ "allocating raster buffer");
if (raster == NULL) {
width = height = 0;
TIFFError(filelist[fileindex], "No space for raster buffer");
@@ -461,7 +459,7 @@ usage(int code)
exit(code);
}
-static uint16
+static uint16_t
photoArg(const char* arg)
{
if (strcmp(arg, "miniswhite") == 0)
@@ -485,7 +483,7 @@ photoArg(const char* arg)
else if (strcmp(arg, "logluv") == 0)
return (PHOTOMETRIC_LOGLUV);
else
- return ((uint16) -1);
+ return ((uint16_t) -1);
}
/* vim: set ts=8 sts=8 sw=8 noet: */
diff --git a/tiff/tools/tiffinfo.c b/tiff/tools/tiffinfo.c
index 2271c9d1..6921a0c5 100644
--- a/tiff/tools/tiffinfo.c
+++ b/tiff/tools/tiffinfo.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -36,10 +37,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffiop.h"
#ifndef EXIT_SUCCESS
@@ -58,7 +55,7 @@ static int readdata = 0; /* read data in file */
static int stoponerr = 1; /* stop on first read error */
static void usage(int);
-static void tiffinfo(TIFF*, uint16, long, int);
+static void tiffinfo(TIFF*, uint16_t, long, int);
static void
PrivateErrorHandler(const char* module, const char* fmt, va_list ap)
@@ -72,14 +69,14 @@ int
main(int argc, char* argv[])
{
int dirnum = -1, multiplefiles, c;
- uint16 order = 0;
+ uint16_t order = 0;
TIFF* tif;
#if !HAVE_DECL_OPTARG
extern int optind;
extern char* optarg;
#endif
long flags = 0;
- uint64 diroff = 0;
+ uint64_t diroff = 0;
int chopstrips = 0; /* disable strip chopping */
while ((c = getopt(argc, argv, "f:o:cdDSjilmrsvwz0123456789h")) != -1)
@@ -131,10 +128,12 @@ main(int argc, char* argv[])
break;
case 'h':
usage(EXIT_SUCCESS);
- /*NOTREACHED*/
+ /*NOTREACHED*/
+ break;
case '?':
usage(EXIT_FAILURE);
/*NOTREACHED*/
+ break;
}
if (optind >= argc)
usage(EXIT_FAILURE);
@@ -172,43 +171,41 @@ main(int argc, char* argv[])
return (status);
}
-static const char* stuff[] = {
-"usage: tiffinfo [options] input...",
-"where options are:",
-" -D read data",
-" -i ignore read errors",
-" -c display data for grey/color response curve or colormap",
-" -d display raw/decoded image data",
-" -f lsb2msb force lsb-to-msb FillOrder for input",
-" -f msb2lsb force msb-to-lsb FillOrder for input",
-" -j show JPEG tables",
-" -o offset set initial directory offset",
-" -r read/display raw image data instead of decoded data",
-" -s display strip offsets and byte counts",
-" -w display raw data in words rather than bytes",
-" -z enable strip chopping",
-" -# set initial directory (first directory is # 0)",
-NULL
-};
+static const char usage_info[] =
+"Display information about TIFF files\n\n"
+"usage: tiffinfo [options] input...\n"
+"where options are:\n"
+" -D read data\n"
+" -i ignore read errors\n"
+" -c display data for grey/color response curve or colormap\n"
+" -d display raw/decoded image data\n"
+" -f lsb2msb force lsb-to-msb FillOrder for input\n"
+" -f msb2lsb force msb-to-lsb FillOrder for input\n"
+" -j show JPEG tables\n"
+" -o offset set initial directory offset\n"
+" -r read/display raw image data instead of decoded data\n"
+" -s display strip offsets and byte counts\n"
+" -w display raw data in words rather than bytes\n"
+" -z enable strip chopping\n"
+" -# set initial directory (first directory is # 0)\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
static void
-ShowStrip(tstrip_t strip, unsigned char* pp, uint32 nrow, tsize_t scanline)
+ShowStrip(tstrip_t strip, unsigned char* pp, uint32_t nrow, tsize_t scanline)
{
register tsize_t cc;
- printf("Strip %lu:\n", (unsigned long) strip);
+ printf("Strip %"PRIu32":\n", strip);
while (nrow-- > 0) {
for (cc = 0; cc < scanline; cc++) {
printf(" %02x", *pp++);
@@ -227,13 +224,13 @@ TIFFReadContigStripData(TIFF* tif)
buf = (unsigned char *)_TIFFmalloc(TIFFStripSize(tif));
if (buf) {
- uint32 row, h=0;
- uint32 rowsperstrip = (uint32)-1;
+ uint32_t row, h=0;
+ uint32_t rowsperstrip = (uint32_t)-1;
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
TIFFGetField(tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip);
for (row = 0; row < h; row += rowsperstrip) {
- uint32 nrow = (row+rowsperstrip > h ?
+ uint32_t nrow = (row + rowsperstrip > h ?
h-row : rowsperstrip);
tstrip_t strip = TIFFComputeStrip(tif, row, 0);
if (TIFFReadEncodedStrip(tif, strip, buf, nrow*scanline) < 0) {
@@ -254,8 +251,8 @@ TIFFReadSeparateStripData(TIFF* tif)
buf = (unsigned char *)_TIFFmalloc(TIFFStripSize(tif));
if (buf) {
- uint32 row, h=0;
- uint32 rowsperstrip = (uint32)-1;
+ uint32_t row, h=0;
+ uint32_t rowsperstrip = (uint32_t)-1;
tsample_t s, samplesperpixel=0;
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
@@ -263,7 +260,7 @@ TIFFReadSeparateStripData(TIFF* tif)
TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
for (row = 0; row < h; row += rowsperstrip) {
for (s = 0; s < samplesperpixel; s++) {
- uint32 nrow = (row+rowsperstrip > h ?
+ uint32_t nrow = (row + rowsperstrip > h ?
h-row : rowsperstrip);
tstrip_t strip = TIFFComputeStrip(tif, row, s);
if (TIFFReadEncodedStrip(tif, strip, buf, nrow*scanline) < 0) {
@@ -278,17 +275,17 @@ TIFFReadSeparateStripData(TIFF* tif)
}
static void
-ShowTile(uint32 row, uint32 col, tsample_t sample,
- unsigned char* pp, uint32 nrow, tsize_t rowsize)
+ShowTile(uint32_t row, uint32_t col, tsample_t sample,
+ unsigned char* pp, uint32_t nrow, tsize_t rowsize)
{
- uint32 cc;
+ uint32_t cc;
- printf("Tile (%lu,%lu", (unsigned long) row, (unsigned long) col);
+ printf("Tile (%" PRIu32 ",%" PRIu32 "", row, col);
if (sample != (tsample_t) -1)
- printf(",%u", sample);
+ printf(",%" PRIu16, sample);
printf("):\n");
while (nrow-- > 0) {
- for (cc = 0; cc < (uint32) rowsize; cc++) {
+ for (cc = 0; cc < (uint32_t) rowsize; cc++) {
printf(" %02x", *pp++);
if (((cc+1) % 24) == 0)
putchar('\n');
@@ -306,8 +303,8 @@ TIFFReadContigTileData(TIFF* tif)
buf = (unsigned char *)_TIFFmalloc(tilesize);
if (buf) {
- uint32 tw=0, th=0, w=0, h=0;
- uint32 row, col;
+ uint32_t tw=0, th=0, w=0, h=0;
+ uint32_t row, col;
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
@@ -341,8 +338,8 @@ TIFFReadSeparateTileData(TIFF* tif)
buf = (unsigned char *)_TIFFmalloc(tilesize);
if (buf) {
- uint32 tw=0, th=0, w=0, h=0;
- uint32 row, col;
+ uint32_t tw=0, th=0, w=0, h=0;
+ uint32_t row, col;
tsample_t s, samplesperpixel=0;
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);
@@ -374,7 +371,7 @@ TIFFReadSeparateTileData(TIFF* tif)
void
TIFFReadData(TIFF* tif)
{
- uint16 config = PLANARCONFIG_CONTIG;
+ uint16_t config = PLANARCONFIG_CONTIG;
TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &config);
if (TIFFIsTiled(tif)) {
@@ -391,9 +388,9 @@ TIFFReadData(TIFF* tif)
}
static void
-ShowRawBytes(unsigned char* pp, uint32 n)
+ShowRawBytes(unsigned char* pp, uint32_t n)
{
- uint32 i;
+ uint32_t i;
for (i = 0; i < n; i++) {
printf(" %02x", *pp++);
@@ -404,12 +401,12 @@ ShowRawBytes(unsigned char* pp, uint32 n)
}
static void
-ShowRawWords(uint16* pp, uint32 n)
+ShowRawWords(uint16_t* pp, uint32_t n)
{
- uint32 i;
+ uint32_t i;
for (i = 0; i < n; i++) {
- printf(" %04x", *pp++);
+ printf(" %04" PRIx16, *pp++);
if (((i+1) % 15) == 0)
printf("\n ");
}
@@ -421,42 +418,42 @@ TIFFReadRawDataStriped(TIFF* tif, int bitrev)
{
tstrip_t nstrips = TIFFNumberOfStrips(tif);
const char* what = "Strip";
- uint64* stripbc=NULL;
+ uint64_t* stripbc=NULL;
TIFFGetField(tif, TIFFTAG_STRIPBYTECOUNTS, &stripbc);
if (stripbc != NULL && nstrips > 0) {
- uint32 bufsize = (uint32) stripbc[0];
+ uint32_t bufsize = (uint32_t) stripbc[0];
tdata_t buf = _TIFFmalloc(bufsize);
tstrip_t s;
for (s = 0; s < nstrips; s++) {
if (stripbc[s] > bufsize) {
buf = _TIFFrealloc(buf, (tmsize_t)stripbc[s]);
- bufsize = (uint32) stripbc[s];
+ bufsize = (uint32_t) stripbc[s];
}
if (buf == NULL) {
fprintf(stderr,
- "Cannot allocate buffer to read strip %lu\n",
- (unsigned long) s);
+ "Cannot allocate buffer to read strip %"PRIu32"\n",
+ s);
break;
}
if (TIFFReadRawStrip(tif, s, buf, (tmsize_t) stripbc[s]) < 0) {
- fprintf(stderr, "Error reading strip %lu\n",
- (unsigned long) s);
+ fprintf(stderr, "Error reading strip %"PRIu32"\n",
+ s);
if (stoponerr)
break;
} else if (showdata) {
if (bitrev) {
TIFFReverseBits(buf, (tmsize_t)stripbc[s]);
- printf("%s %lu: (bit reversed)\n ",
- what, (unsigned long) s);
+ printf("%s %"PRIu32": (bit reversed)\n ",
+ what, s);
} else
- printf("%s %lu:\n ", what,
- (unsigned long) s);
+ printf("%s %"PRIu32":\n ", what,
+ s);
if (showwords)
- ShowRawWords((uint16*) buf, (uint32) stripbc[s]>>1);
+ ShowRawWords((uint16_t*) buf, (uint32_t) stripbc[s] >> 1);
else
- ShowRawBytes((unsigned char*) buf, (uint32) stripbc[s]);
+ ShowRawBytes((unsigned char*) buf, (uint32_t) stripbc[s]);
}
}
if (buf != NULL)
@@ -468,14 +465,14 @@ static void
TIFFReadRawDataTiled(TIFF* tif, int bitrev)
{
const char* what = "Tile";
- uint32 ntiles = TIFFNumberOfTiles(tif);
- uint64 *tilebc;
+ uint32_t ntiles = TIFFNumberOfTiles(tif);
+ uint64_t *tilebc;
TIFFGetField(tif, TIFFTAG_TILEBYTECOUNTS, &tilebc);
if (tilebc != NULL && ntiles > 0) {
- uint64 bufsize = 0;
+ uint64_t bufsize = 0;
tdata_t buf = NULL;
- uint32 t;
+ uint32_t t;
for (t = 0; t < ntiles; t++) {
if (buf == NULL || tilebc[t] > bufsize) {
@@ -484,28 +481,28 @@ TIFFReadRawDataTiled(TIFF* tif, int bitrev)
}
if (buf == NULL) {
fprintf(stderr,
- "Cannot allocate buffer to read tile %lu\n",
- (unsigned long) t);
+ "Cannot allocate buffer to read tile %"PRIu32"\n",
+ t);
break;
}
if (TIFFReadRawTile(tif, t, buf, (tmsize_t)tilebc[t]) < 0) {
- fprintf(stderr, "Error reading tile %lu\n",
- (unsigned long) t);
+ fprintf(stderr, "Error reading tile %"PRIu32"\n",
+ t);
if (stoponerr)
break;
} else if (showdata) {
if (bitrev) {
TIFFReverseBits(buf, (tmsize_t)tilebc[t]);
- printf("%s %lu: (bit reversed)\n ",
- what, (unsigned long) t);
+ printf("%s %"PRIu32": (bit reversed)\n ",
+ what, t);
} else {
- printf("%s %lu:\n ", what,
- (unsigned long) t);
+ printf("%s %"PRIu32":\n ", what,
+ t);
}
if (showwords) {
- ShowRawWords((uint16*) buf, (uint32)(tilebc[t]>>1));
+ ShowRawWords((uint16_t*) buf, (uint32_t)(tilebc[t] >> 1));
} else {
- ShowRawBytes((unsigned char*) buf, (uint32) tilebc[t]);
+ ShowRawBytes((unsigned char*) buf, (uint32_t) tilebc[t]);
}
}
}
@@ -525,14 +522,14 @@ TIFFReadRawData(TIFF* tif, int bitrev)
}
static void
-tiffinfo(TIFF* tif, uint16 order, long flags, int is_image)
+tiffinfo(TIFF* tif, uint16_t order, long flags, int is_image)
{
TIFFPrintDirectory(tif, stdout, flags);
if (!readdata || !is_image)
return;
if (rawdata) {
if (order) {
- uint16 o;
+ uint16_t o;
TIFFGetFieldDefaulted(tif,
TIFFTAG_FILLORDER, &o);
TIFFReadRawData(tif, o != order);
diff --git a/tiff/tools/tiffmedian.c b/tiff/tools/tiffmedian.c
index 6654cd6f..93a1741c 100644
--- a/tiff/tools/tiffmedian.c
+++ b/tiff/tools/tiffmedian.c
@@ -39,6 +39,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -48,10 +49,6 @@
# include <unistd.h>
#endif
-#ifdef NEED_LIBPORT
-# include "libport.h"
-#endif
-
#include "tiffio.h"
#ifndef EXIT_SUCCESS
@@ -82,7 +79,7 @@ typedef struct colorbox {
int rmin, rmax;
int gmin, gmax;
int bmin, bmax;
- uint32 total;
+ uint32_t total;
} Colorbox;
typedef struct {
@@ -90,20 +87,20 @@ typedef struct {
int entries[MAX_CMAP_SIZE][2];
} C_cell;
-uint16 rm[MAX_CMAP_SIZE], gm[MAX_CMAP_SIZE], bm[MAX_CMAP_SIZE];
-int num_colors;
-uint32 histogram[B_LEN][B_LEN][B_LEN];
-Colorbox *freeboxes;
-Colorbox *usedboxes;
-C_cell **ColorCells;
-TIFF *in, *out;
-uint32 rowsperstrip = (uint32) -1;
-uint16 compression = (uint16) -1;
-uint16 bitspersample = 1;
-uint16 samplesperpixel;
-uint32 imagewidth;
-uint32 imagelength;
-uint16 predictor = 0;
+static uint16_t rm[MAX_CMAP_SIZE], gm[MAX_CMAP_SIZE], bm[MAX_CMAP_SIZE];
+static int num_colors;
+static uint32_t histogram[B_LEN][B_LEN][B_LEN];
+static Colorbox *freeboxes;
+static Colorbox *usedboxes;
+static C_cell **ColorCells;
+static TIFF *in, *out;
+static uint32_t rowsperstrip = (uint32_t) -1;
+static uint16_t compression = (uint16_t) -1;
+static uint16_t bitspersample = 1;
+static uint16_t samplesperpixel;
+static uint32_t imagewidth;
+static uint32_t imagelength;
+static uint16_t predictor = 0;
static void get_histogram(TIFF*, Colorbox*);
static void splitbox(Colorbox*);
@@ -123,10 +120,10 @@ int
main(int argc, char* argv[])
{
int i, dither = 0;
- uint16 shortv, config, photometric;
+ uint16_t shortv, config, photometric;
Colorbox *box_list, *ptr;
float floatv;
- uint32 longv;
+ uint32_t longv;
int c;
#if !HAVE_DECL_OPTARG
extern int optind;
@@ -158,9 +155,11 @@ main(int argc, char* argv[])
case 'h':
usage(EXIT_SUCCESS);
/*NOTREACHED*/
+ break;
case '?':
usage(EXIT_FAILURE);
/*NOTREACHED*/
+ break;
}
if (argc - optind != 2)
usage(EXIT_FAILURE);
@@ -260,7 +259,7 @@ main(int argc, char* argv[])
CopyField(TIFFTAG_SUBFILETYPE, longv);
CopyField(TIFFTAG_IMAGEWIDTH, longv);
TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, (short)COLOR_DEPTH);
- if (compression != (uint16)-1) {
+ if (compression != (uint16_t)-1) {
TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
switch (compression) {
case COMPRESSION_LZW:
@@ -325,32 +324,41 @@ processCompressOptions(char* opt)
return (1);
}
-char* stuff[] = {
-"usage: tiffmedian [options] input.tif output.tif",
-"where options are:",
-" -r # make each strip have no more than # rows",
-" -C # create a colormap with # entries",
-" -f use Floyd-Steinberg dithering",
-" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding",
-" -c zip[:opts] compress output with deflate encoding",
-" -c packbits compress output with packbits encoding",
-" -c none use no compression algorithm on output",
-"",
-"LZW and deflate options:",
-" # set predictor value",
-"For example, -c lzw:2 to get LZW-encoded data with horizontal differencing",
-NULL
-};
+static const char usage_info[] =
+"Apply the median cut algorithm to an RGB TIFF file\n\n"
+"usage: tiffmedian [options] input.tif output.tif\n"
+"where options are:\n"
+" -r # make each strip have no more than # rows\n"
+" -C # create a colormap with # entries\n"
+" -f use Floyd-Steinberg dithering\n"
+"\n"
+#ifdef LZW_SUPPORT
+" -c lzw[:opts] compress output with Lempel-Ziv & Welch encoding\n"
+/* " LZW options:" */
+" # set predictor value\n"
+" For example, -c lzw:2 to get LZW-encoded data with horizontal differencing\n"
+#endif
+#ifdef ZIP_SUPPORT
+" -c zip[:opts] compress output with deflate encoding\n"
+/* " Deflate (ZIP) options:" */
+" # set predictor value\n"
+#endif
+#ifdef PACKBITS_SUPPORT
+" -c packbits compress output with packbits encoding\n"
+#endif
+#if defined(LZW_SUPPORT) || defined(ZIP_SUPPORT) || defined(PACKBITS_SUPPORT)
+" -c none use no compression algorithm on output\n"
+#endif
+"\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; stuff[i] != NULL; i++)
- fprintf(out, "%s\n", stuff[i]);
+ fprintf(out, "%s", usage_info);
exit(code);
}
@@ -359,7 +367,7 @@ get_histogram(TIFF* in, Colorbox* box)
{
register unsigned char *inptr;
register int red, green, blue;
- register uint32 j, i;
+ register uint32_t j, i;
unsigned char *inputline;
inputline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
@@ -371,7 +379,7 @@ get_histogram(TIFF* in, Colorbox* box)
box->rmax = box->gmax = box->bmax = -1;
box->total = imagewidth * imagelength;
- { register uint32 *ptr = &histogram[0][0][0];
+ { register uint32_t *ptr = &histogram[0][0][0];
for (i = B_LEN*B_LEN*B_LEN; i-- > 0;)
*ptr++ = 0;
}
@@ -411,7 +419,7 @@ static Colorbox *
largest_box(void)
{
register Colorbox *p, *b;
- register uint32 size;
+ register uint32_t size;
b = NULL;
size = 0;
@@ -425,13 +433,13 @@ largest_box(void)
static void
splitbox(Colorbox* ptr)
{
- uint32 hist2[B_LEN];
+ uint32_t hist2[B_LEN];
int first=0, last=0;
register Colorbox *new;
- register uint32 *iptr, *histp;
+ register uint32_t *iptr, *histp;
register int i, j;
register int ir,ig,ib;
- register uint32 sum, sum1, sum2;
+ register uint32_t sum, sum1, sum2;
enum { RED, GREEN, BLUE } axis;
/*
@@ -547,7 +555,7 @@ splitbox(Colorbox* ptr)
static void
shrinkbox(Colorbox* box)
{
- register uint32 *histp;
+ register uint32_t *histp;
register int ir, ig, ib;
if (box->rmax > box->rmin) {
@@ -720,7 +728,7 @@ create_colorcell(int red, int green, int blue)
static void
map_colortable(void)
{
- register uint32 *histp = &histogram[0][0][0];
+ register uint32_t *histp = &histogram[0][0][0];
register C_cell *cell;
register int j, tmp, d2, dist;
int ir, ig, ib, i;
@@ -769,7 +777,7 @@ quant(TIFF* in, TIFF* out)
{
unsigned char *outline, *inputline;
register unsigned char *outptr, *inptr;
- register uint32 i, j;
+ register uint32_t i, j;
register int red, green, blue;
inputline = (unsigned char *)_TIFFmalloc(TIFFScanlineSize(in));
@@ -824,8 +832,8 @@ quant_fsdither(TIFF* in, TIFF* out)
short *thisline, *nextline;
register unsigned char *outptr;
register short *thisptr, *nextptr;
- register uint32 i, j;
- uint32 imax, jmax;
+ register uint32_t i, j;
+ uint32_t imax, jmax;
int lastline, lastpixel;
imax = imagelength - 1;
diff --git a/tiff/tools/tiffset.c b/tiff/tools/tiffset.c
index 75cf45c0..8c9e23c5 100644
--- a/tiff/tools/tiffset.c
+++ b/tiff/tools/tiffset.c
@@ -46,27 +46,25 @@
#define EXIT_FAILURE 1
#endif
-static const char* usageMsg[] = {
-"usage: tiffset [options] filename",
-"where options are:",
-" -s <tagname> [count] <value>... set the tag value",
-" -u <tagname> to unset the tag",
-" -d <dirno> set the directory",
-" -sd <diroff> set the subdirectory",
-" -sf <tagname> <filename> read the tag value from file (for ASCII tags only)",
-" -h this help screen",
-NULL
-};
+static const char usageMsg[] =
+"Set the value of a TIFF header to a specified value\n\n"
+"usage: tiffset [options] filename\n"
+"where options are:\n"
+" -s <tagname> [count] <value>... set the tag value\n"
+" -u <tagname> to unset the tag\n"
+" -d <dirno> set the directory\n"
+" -sd <diroff> set the subdirectory\n"
+" -sf <tagname> <filename> read the tag value from file (for ASCII tags only)\n"
+" -h this help screen\n"
+;
static void
usage(int code)
{
- int i;
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
fprintf(out, "%s\n\n", TIFFGetVersion());
- for (i = 0; usageMsg[i]; i++)
- fprintf(out, "%s\n", usageMsg[i]);
+ fprintf(out, "%s", usageMsg);
exit(code);
}
@@ -221,37 +219,37 @@ main(int argc, char* argv[])
switch (TIFFFieldDataType(fip)) {
case TIFF_BYTE:
for (i = 0; i < wc; i++)
- ((uint8 *)array)[i] = atoi(argv[arg_index+i]);
+ ((uint8_t *)array)[i] = atoi(argv[arg_index + i]);
break;
case TIFF_SHORT:
for (i = 0; i < wc; i++)
- ((uint16 *)array)[i] = atoi(argv[arg_index+i]);
+ ((uint16_t *)array)[i] = atoi(argv[arg_index + i]);
break;
case TIFF_SBYTE:
for (i = 0; i < wc; i++)
- ((int8 *)array)[i] = atoi(argv[arg_index+i]);
+ ((int8_t *)array)[i] = atoi(argv[arg_index + i]);
break;
case TIFF_SSHORT:
for (i = 0; i < wc; i++)
- ((int16 *)array)[i] = atoi(argv[arg_index+i]);
+ ((int16_t *)array)[i] = atoi(argv[arg_index + i]);
break;
case TIFF_LONG:
for (i = 0; i < wc; i++)
- ((uint32 *)array)[i] = atol(argv[arg_index+i]);
+ ((uint32_t *)array)[i] = atol(argv[arg_index + i]);
break;
case TIFF_SLONG:
case TIFF_IFD:
for (i = 0; i < wc; i++)
- ((int32 *)array)[i] = atol(argv[arg_index+i]);
+ ((int32_t *)array)[i] = atol(argv[arg_index + i]);
break;
case TIFF_LONG8:
for (i = 0; i < wc; i++)
- ((uint64 *)array)[i] = strtoll(argv[arg_index+i], (char **)NULL, 10);
+ ((uint64_t *)array)[i] = strtoll(argv[arg_index + i], (char **)NULL, 10);
break;
case TIFF_SLONG8:
case TIFF_IFD8:
for (i = 0; i < wc; i++)
- ((int64 *)array)[i] = strtoll(argv[arg_index+i], (char **)NULL, 10);
+ ((int64_t *)array)[i] = strtoll(argv[arg_index + i], (char **)NULL, 10);
break;
case TIFF_DOUBLE:
for (i = 0; i < wc; i++)
@@ -276,10 +274,10 @@ main(int argc, char* argv[])
|| TIFFFieldTag(fip) == TIFFTAG_DOTRANGE) {
if (TIFFFieldDataType(fip) == TIFF_BYTE) {
ret = TIFFSetField(tiff, TIFFFieldTag(fip),
- ((uint8 *)array)[0], ((uint8 *)array)[1]);
+ ((uint8_t *)array)[0], ((uint8_t *)array)[1]);
} else if (TIFFFieldDataType(fip) == TIFF_SHORT) {
ret = TIFFSetField(tiff, TIFFFieldTag(fip),
- ((uint16 *)array)[0], ((uint16 *)array)[1]);
+ ((uint16_t *)array)[0], ((uint16_t *)array)[1]);
}
} else {
ret = TIFFSetField(tiff, TIFFFieldTag(fip),
@@ -367,7 +365,7 @@ main(int argc, char* argv[])
fclose( fp );
if(TIFFFieldPassCount( fip )) {
- ret = TIFFSetField( tiff, TIFFFieldTag(fip), (uint16)len, text );
+ ret = TIFFSetField(tiff, TIFFFieldTag(fip), (uint16_t)len, text );
} else {
ret = TIFFSetField( tiff, TIFFFieldTag(fip), text );
}
diff --git a/tiff/tools/tiffsplit.c b/tiff/tools/tiffsplit.c
index 43b6fdc1..296d6bf9 100644
--- a/tiff/tools/tiffsplit.c
+++ b/tiff/tools/tiffsplit.c
@@ -23,6 +23,7 @@
*/
#include "tif_config.h"
+#include "libport.h"
#include <stdio.h>
#include <stdlib.h>
@@ -37,10 +38,6 @@
#define EXIT_FAILURE 1
#endif
-#ifndef HAVE_GETOPT
-extern int getopt(int argc, char * const argv[], const char *optstring);
-#endif
-
#define CopyField(tag, v) \
if (TIFFGetField(in, tag, &v)) TIFFSetField(out, tag, v)
#define CopyField2(tag, v1, v2) \
@@ -64,40 +61,46 @@ main(int argc, char* argv[])
{
TIFF *in, *out;
- if (argc < 2) {
- fprintf(stderr, "%s\n\n", TIFFGetVersion());
- fprintf(stderr, "usage: tiffsplit input.tif [prefix]\n");
+ if (argc < 2 || argc > 3) {
+ fprintf(stderr, "%s\n\n", TIFFGetVersion());
+ fprintf(stderr, "Split a multi-image TIFF into single-image TIFF files\n\n");
+ fprintf(stderr, "usage: tiffsplit input.tif [prefix]\n");
return (EXIT_FAILURE);
}
if (argc > 2) {
strncpy(fname, argv[2], sizeof(fname));
fname[sizeof(fname) - 1] = '\0';
}
+
in = TIFFOpen(argv[1], "r");
- if (in != NULL) {
- do {
- size_t path_len;
- char *path;
-
- newfilename();
+ if (in == NULL) {
+ return EXIT_FAILURE;
+ }
- path_len = strlen(fname) + sizeof(TIFF_SUFFIX);
- path = (char *) _TIFFmalloc(path_len);
- strncpy(path, fname, path_len);
- path[path_len - 1] = '\0';
- strncat(path, TIFF_SUFFIX, path_len - strlen(path) - 1);
- out = TIFFOpen(path, TIFFIsBigEndian(in)?"wb":"wl");
- _TIFFfree(path);
+ do {
+ size_t path_len;
+ char *path;
- if (out == NULL)
- return (EXIT_FAILURE);
- if (!tiffcp(in, out))
- return (EXIT_FAILURE);
- TIFFClose(out);
- } while (TIFFReadDirectory(in));
- (void) TIFFClose(in);
- }
- return (EXIT_SUCCESS);
+ newfilename();
+
+ path_len = strlen(fname) + sizeof(TIFF_SUFFIX);
+ path = (char *) _TIFFmalloc(path_len);
+ strncpy(path, fname, path_len);
+ path[path_len - 1] = '\0';
+ strncat(path, TIFF_SUFFIX, path_len - strlen(path) - 1);
+ out = TIFFOpen(path, TIFFIsBigEndian(in)?"wb":"wl");
+ _TIFFfree(path);
+
+ if (out == NULL)
+ return (EXIT_FAILURE);
+ if (!tiffcp(in, out))
+ return (EXIT_FAILURE);
+ TIFFClose(out);
+ } while (TIFFReadDirectory(in));
+
+ (void) TIFFClose(in);
+
+ return (EXIT_SUCCESS);
}
static void
@@ -162,11 +165,11 @@ newfilename(void)
static int
tiffcp(TIFF* in, TIFF* out)
{
- uint16 bitspersample, samplesperpixel, compression, shortv, *shortav;
- uint32 w, l;
+ uint16_t bitspersample, samplesperpixel, compression, shortv, *shortav;
+ uint32_t w, l;
float floatv;
char *stringv;
- uint32 longv;
+ uint32_t longv;
CopyField(TIFFTAG_SUBFILETYPE, longv);
CopyField(TIFFTAG_TILEWIDTH, w);
@@ -177,7 +180,7 @@ tiffcp(TIFF* in, TIFF* out)
CopyField(TIFFTAG_SAMPLESPERPIXEL, samplesperpixel);
CopyField(TIFFTAG_COMPRESSION, compression);
if (compression == COMPRESSION_JPEG) {
- uint32 count = 0;
+ uint32_t count = 0;
void *table = NULL;
if (TIFFGetField(in, TIFFTAG_JPEGTABLES, &count, &table)
&& count > 0 && table) {
@@ -204,10 +207,10 @@ tiffcp(TIFF* in, TIFF* out)
CopyField(TIFFTAG_TILEDEPTH, longv);
CopyField(TIFFTAG_SAMPLEFORMAT, shortv);
CopyField2(TIFFTAG_EXTRASAMPLES, shortv, shortav);
- { uint16 *red, *green, *blue;
+ { uint16_t *red, *green, *blue;
CopyField3(TIFFTAG_COLORMAP, red, green, blue);
}
- { uint16 shortv2;
+ { uint16_t shortv2;
CopyField2(TIFFTAG_PAGENUMBER, shortv, shortv2);
}
CopyField(TIFFTAG_ARTIST, stringv);
@@ -240,7 +243,7 @@ cpStrips(TIFF* in, TIFF* out)
if (buf) {
tstrip_t s, ns = TIFFNumberOfStrips(in);
- uint64 *bytecounts;
+ uint64_t *bytecounts;
if (!TIFFGetField(in, TIFFTAG_STRIPBYTECOUNTS, &bytecounts)) {
fprintf(stderr, "tiffsplit: strip byte counts are missing\n");
@@ -248,7 +251,7 @@ cpStrips(TIFF* in, TIFF* out)
return (0);
}
for (s = 0; s < ns; s++) {
- if (bytecounts[s] > (uint64)bufsize) {
+ if (bytecounts[s] > (uint64_t)bufsize) {
buf = (unsigned char *)_TIFFrealloc(buf, (tmsize_t)bytecounts[s]);
if (!buf)
return (0);
@@ -274,7 +277,7 @@ cpTiles(TIFF* in, TIFF* out)
if (buf) {
ttile_t t, nt = TIFFNumberOfTiles(in);
- uint64 *bytecounts;
+ uint64_t *bytecounts;
if (!TIFFGetField(in, TIFFTAG_TILEBYTECOUNTS, &bytecounts)) {
fprintf(stderr, "tiffsplit: tile byte counts are missing\n");
@@ -282,7 +285,7 @@ cpTiles(TIFF* in, TIFF* out)
return (0);
}
for (t = 0; t < nt; t++) {
- if (bytecounts[t] > (uint64) bufsize) {
+ if (bytecounts[t] > (uint64_t) bufsize) {
buf = (unsigned char *)_TIFFrealloc(buf, (tmsize_t)bytecounts[t]);
if (!buf)
return (0);
diff --git a/toolbin/genfontmap.ps b/toolbin/genfontmap.ps
index cf9ed12d..913af2b9 100644
--- a/toolbin/genfontmap.ps
+++ b/toolbin/genfontmap.ps
@@ -58,8 +58,10 @@ QUIET not {
% Create an array so we can sort it
+mark
Fontmap { [ 3 1 roll ] } forall
-count array astore
+.nativeFontmap { [ 3 1 roll ] } forall
+counttomark array astore exch pop
% sort the array
{ 0 get 100 string cvs exch 0 get 100 string cvs gt } .sort
@@ -75,6 +77,6 @@ count array astore
flush
(\ngenfontmap completed OK. ) =error
-Fontmap length Initial_count sub 10 string cvs =error
+Fontmap length .nativeFontmap length add Initial_count sub 10 string cvs =error
( new fonts added.\n\n) =error
quit
diff --git a/toolbin/localcluster/clusterpush.pl b/toolbin/localcluster/clusterpush.pl
index 7d998e7e..aaaa9cb2 100755
--- a/toolbin/localcluster/clusterpush.pl
+++ b/toolbin/localcluster/clusterpush.pl
@@ -30,6 +30,7 @@ my %products=('abort' =>1,
'extract'=>1,
'extractmu'=>1,
'muwasm'=>1,
+ 'mucsharp'=>1,
'extractgs'=>1);
my $rsync_L = "";
@@ -249,6 +250,7 @@ $cmd .= " --max-size=30000000".
" --exclude debug --exclude release --exclude generated --exclude sanitize". # we cannot just exclude build, since tiff/build/Makefile.in, etc. is needed
" --exclude tiff-config".
" --exclude 'shared-*'".
+" --exclude user.make".
# Exclude files generated by scripts/mupdfwrap.py:
" --exclude mupdfwrap_ref".
diff --git a/windows/ghostscript.vcxproj b/windows/ghostscript.vcxproj
index 2597594d..b1adde65 100644
--- a/windows/ghostscript.vcxproj
+++ b/windows/ghostscript.vcxproj
@@ -1622,6 +1622,7 @@
<ClCompile Include="..\expat\tests\runtestspp.cpp" />
<ClCompile Include="..\extract\src\alloc.c" />
<ClCompile Include="..\extract\src\astring.c" />
+ <ClCompile Include="..\extract\src\boxer.c" />
<ClCompile Include="..\extract\src\buffer-test.c" />
<ClCompile Include="..\extract\src\buffer.c" />
<ClCompile Include="..\extract\src\docx.c" />
@@ -1635,6 +1636,7 @@
<ClCompile Include="..\extract\src\memento.c" />
<ClCompile Include="..\extract\src\misc-test.c" />
<ClCompile Include="..\extract\src\outf.c" />
+ <ClCompile Include="..\extract\src\rect.c" />
<ClCompile Include="..\extract\src\sys.c" />
<ClCompile Include="..\extract\src\text.c" />
<ClCompile Include="..\extract\src\xml.c" />
@@ -3808,4 +3810,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/windows/ghostscript.vcxproj.filters b/windows/ghostscript.vcxproj.filters
index 2679dcee..0985029a 100644
--- a/windows/ghostscript.vcxproj.filters
+++ b/windows/ghostscript.vcxproj.filters
@@ -6599,6 +6599,9 @@
<ClCompile Include="..\extract\src\astring.c">
<Filter>extract</Filter>
</ClCompile>
+ <ClCompile Include="..\extract\src\boxer.c">
+ <Filter>extract</Filter>
+ </ClCompile>
<ClCompile Include="..\extract\src\buffer.c">
<Filter>extract</Filter>
</ClCompile>
@@ -6638,6 +6641,9 @@
<ClCompile Include="..\extract\src\outf.c">
<Filter>extract</Filter>
</ClCompile>
+ <ClCompile Include="..\extract\src\rect.c">
+ <Filter>extract</Filter>
+ </ClCompile>
<ClCompile Include="..\extract\src\sys.c">
<Filter>extract</Filter>
</ClCompile>
diff --git a/zlib/contrib/amd64/amd64-match.S b/zlib/contrib/amd64/amd64-match.S
deleted file mode 100644
index 81d4a1c9..00000000
--- a/zlib/contrib/amd64/amd64-match.S
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * match.S -- optimized version of longest_match()
- * based on the similar work by Gilles Vollant, and Brian Raiter, written 1998
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the BSD License. Use by owners of Che Guevarra
- * parafernalia is prohibited, where possible, and highly discouraged
- * elsewhere.
- */
-
-#ifndef NO_UNDERLINE
-# define match_init _match_init
-# define longest_match _longest_match
-#endif
-
-#define scanend ebx
-#define scanendw bx
-#define chainlenwmask edx /* high word: current chain len low word: s->wmask */
-#define curmatch rsi
-#define curmatchd esi
-#define windowbestlen r8
-#define scanalign r9
-#define scanalignd r9d
-#define window r10
-#define bestlen r11
-#define bestlend r11d
-#define scanstart r12d
-#define scanstartw r12w
-#define scan r13
-#define nicematch r14d
-#define limit r15
-#define limitd r15d
-#define prev rcx
-
-/*
- * The 258 is a "magic number, not a parameter -- changing it
- * breaks the hell loose
- */
-#define MAX_MATCH (258)
-#define MIN_MATCH (3)
-#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
-#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
-
-/* stack frame offsets */
-#define LocalVarsSize (112)
-#define _chainlenwmask ( 8-LocalVarsSize)(%rsp)
-#define _windowbestlen (16-LocalVarsSize)(%rsp)
-#define save_r14 (24-LocalVarsSize)(%rsp)
-#define save_rsi (32-LocalVarsSize)(%rsp)
-#define save_rbx (40-LocalVarsSize)(%rsp)
-#define save_r12 (56-LocalVarsSize)(%rsp)
-#define save_r13 (64-LocalVarsSize)(%rsp)
-#define save_r15 (80-LocalVarsSize)(%rsp)
-
-
-.globl match_init, longest_match
-
-/*
- * On AMD64 the first argument of a function (in our case -- the pointer to
- * deflate_state structure) is passed in %rdi, hence our offsets below are
- * all off of that.
- */
-
-/* you can check the structure offset by running
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "deflate.h"
-
-void print_depl()
-{
-deflate_state ds;
-deflate_state *s=&ds;
-printf("size pointer=%u\n",(int)sizeof(void*));
-
-printf("#define dsWSize (%3u)(%%rdi)\n",(int)(((char*)&(s->w_size))-((char*)s)));
-printf("#define dsWMask (%3u)(%%rdi)\n",(int)(((char*)&(s->w_mask))-((char*)s)));
-printf("#define dsWindow (%3u)(%%rdi)\n",(int)(((char*)&(s->window))-((char*)s)));
-printf("#define dsPrev (%3u)(%%rdi)\n",(int)(((char*)&(s->prev))-((char*)s)));
-printf("#define dsMatchLen (%3u)(%%rdi)\n",(int)(((char*)&(s->match_length))-((char*)s)));
-printf("#define dsPrevMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_match))-((char*)s)));
-printf("#define dsStrStart (%3u)(%%rdi)\n",(int)(((char*)&(s->strstart))-((char*)s)));
-printf("#define dsMatchStart (%3u)(%%rdi)\n",(int)(((char*)&(s->match_start))-((char*)s)));
-printf("#define dsLookahead (%3u)(%%rdi)\n",(int)(((char*)&(s->lookahead))-((char*)s)));
-printf("#define dsPrevLen (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_length))-((char*)s)));
-printf("#define dsMaxChainLen (%3u)(%%rdi)\n",(int)(((char*)&(s->max_chain_length))-((char*)s)));
-printf("#define dsGoodMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->good_match))-((char*)s)));
-printf("#define dsNiceMatch (%3u)(%%rdi)\n",(int)(((char*)&(s->nice_match))-((char*)s)));
-}
-
-*/
-
-
-/*
- to compile for XCode 3.2 on MacOSX x86_64
- - run "gcc -g -c -DXCODE_MAC_X64_STRUCTURE amd64-match.S"
- */
-
-
-#ifndef CURRENT_LINX_XCODE_MAC_X64_STRUCTURE
-#define dsWSize ( 68)(%rdi)
-#define dsWMask ( 76)(%rdi)
-#define dsWindow ( 80)(%rdi)
-#define dsPrev ( 96)(%rdi)
-#define dsMatchLen (144)(%rdi)
-#define dsPrevMatch (148)(%rdi)
-#define dsStrStart (156)(%rdi)
-#define dsMatchStart (160)(%rdi)
-#define dsLookahead (164)(%rdi)
-#define dsPrevLen (168)(%rdi)
-#define dsMaxChainLen (172)(%rdi)
-#define dsGoodMatch (188)(%rdi)
-#define dsNiceMatch (192)(%rdi)
-
-#else
-
-#ifndef STRUCT_OFFSET
-# define STRUCT_OFFSET (0)
-#endif
-
-
-#define dsWSize ( 56 + STRUCT_OFFSET)(%rdi)
-#define dsWMask ( 64 + STRUCT_OFFSET)(%rdi)
-#define dsWindow ( 72 + STRUCT_OFFSET)(%rdi)
-#define dsPrev ( 88 + STRUCT_OFFSET)(%rdi)
-#define dsMatchLen (136 + STRUCT_OFFSET)(%rdi)
-#define dsPrevMatch (140 + STRUCT_OFFSET)(%rdi)
-#define dsStrStart (148 + STRUCT_OFFSET)(%rdi)
-#define dsMatchStart (152 + STRUCT_OFFSET)(%rdi)
-#define dsLookahead (156 + STRUCT_OFFSET)(%rdi)
-#define dsPrevLen (160 + STRUCT_OFFSET)(%rdi)
-#define dsMaxChainLen (164 + STRUCT_OFFSET)(%rdi)
-#define dsGoodMatch (180 + STRUCT_OFFSET)(%rdi)
-#define dsNiceMatch (184 + STRUCT_OFFSET)(%rdi)
-
-#endif
-
-
-
-
-.text
-
-/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
-
-longest_match:
-/*
- * Retrieve the function arguments. %curmatch will hold cur_match
- * throughout the entire function (passed via rsi on amd64).
- * rdi will hold the pointer to the deflate_state (first arg on amd64)
- */
- mov %rsi, save_rsi
- mov %rbx, save_rbx
- mov %r12, save_r12
- mov %r13, save_r13
- mov %r14, save_r14
- mov %r15, save_r15
-
-/* uInt wmask = s->w_mask; */
-/* unsigned chain_length = s->max_chain_length; */
-/* if (s->prev_length >= s->good_match) { */
-/* chain_length >>= 2; */
-/* } */
-
- movl dsPrevLen, %eax
- movl dsGoodMatch, %ebx
- cmpl %ebx, %eax
- movl dsWMask, %eax
- movl dsMaxChainLen, %chainlenwmask
- jl LastMatchGood
- shrl $2, %chainlenwmask
-LastMatchGood:
-
-/* chainlen is decremented once beforehand so that the function can */
-/* use the sign flag instead of the zero flag for the exit test. */
-/* It is then shifted into the high word, to make room for the wmask */
-/* value, which it will always accompany. */
-
- decl %chainlenwmask
- shll $16, %chainlenwmask
- orl %eax, %chainlenwmask
-
-/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
-
- movl dsNiceMatch, %eax
- movl dsLookahead, %ebx
- cmpl %eax, %ebx
- jl LookaheadLess
- movl %eax, %ebx
-LookaheadLess: movl %ebx, %nicematch
-
-/* register Bytef *scan = s->window + s->strstart; */
-
- mov dsWindow, %window
- movl dsStrStart, %limitd
- lea (%limit, %window), %scan
-
-/* Determine how many bytes the scan ptr is off from being */
-/* dword-aligned. */
-
- mov %scan, %scanalign
- negl %scanalignd
- andl $3, %scanalignd
-
-/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
-/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
-
- movl dsWSize, %eax
- subl $MIN_LOOKAHEAD, %eax
- xorl %ecx, %ecx
- subl %eax, %limitd
- cmovng %ecx, %limitd
-
-/* int best_len = s->prev_length; */
-
- movl dsPrevLen, %bestlend
-
-/* Store the sum of s->window + best_len in %windowbestlen locally, and in memory. */
-
- lea (%window, %bestlen), %windowbestlen
- mov %windowbestlen, _windowbestlen
-
-/* register ush scan_start = *(ushf*)scan; */
-/* register ush scan_end = *(ushf*)(scan+best_len-1); */
-/* Posf *prev = s->prev; */
-
- movzwl (%scan), %scanstart
- movzwl -1(%scan, %bestlen), %scanend
- mov dsPrev, %prev
-
-/* Jump into the main loop. */
-
- movl %chainlenwmask, _chainlenwmask
- jmp LoopEntry
-
-.balign 16
-
-/* do {
- * match = s->window + cur_match;
- * if (*(ushf*)(match+best_len-1) != scan_end ||
- * *(ushf*)match != scan_start) continue;
- * [...]
- * } while ((cur_match = prev[cur_match & wmask]) > limit
- * && --chain_length != 0);
- *
- * Here is the inner loop of the function. The function will spend the
- * majority of its time in this loop, and majority of that time will
- * be spent in the first ten instructions.
- */
-LookupLoop:
- andl %chainlenwmask, %curmatchd
- movzwl (%prev, %curmatch, 2), %curmatchd
- cmpl %limitd, %curmatchd
- jbe LeaveNow
- subl $0x00010000, %chainlenwmask
- js LeaveNow
-LoopEntry: cmpw -1(%windowbestlen, %curmatch), %scanendw
- jne LookupLoop
- cmpw %scanstartw, (%window, %curmatch)
- jne LookupLoop
-
-/* Store the current value of chainlen. */
- movl %chainlenwmask, _chainlenwmask
-
-/* %scan is the string under scrutiny, and %prev to the string we */
-/* are hoping to match it up with. In actuality, %esi and %edi are */
-/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
-/* initialized to -(MAX_MATCH_8 - scanalign). */
-
- mov $(-MAX_MATCH_8), %rdx
- lea (%curmatch, %window), %windowbestlen
- lea MAX_MATCH_8(%windowbestlen, %scanalign), %windowbestlen
- lea MAX_MATCH_8(%scan, %scanalign), %prev
-
-/* the prefetching below makes very little difference... */
- prefetcht1 (%windowbestlen, %rdx)
- prefetcht1 (%prev, %rdx)
-
-/*
- * Test the strings for equality, 8 bytes at a time. At the end,
- * adjust %rdx so that it is offset to the exact byte that mismatched.
- *
- * It should be confessed that this loop usually does not represent
- * much of the total running time. Replacing it with a more
- * straightforward "rep cmpsb" would not drastically degrade
- * performance -- unrolling it, for example, makes no difference.
- */
-
-#undef USE_SSE /* works, but is 6-7% slower, than non-SSE... */
-
-LoopCmps:
-#ifdef USE_SSE
- /* Preload the SSE registers */
- movdqu (%windowbestlen, %rdx), %xmm1
- movdqu (%prev, %rdx), %xmm2
- pcmpeqb %xmm2, %xmm1
- movdqu 16(%windowbestlen, %rdx), %xmm3
- movdqu 16(%prev, %rdx), %xmm4
- pcmpeqb %xmm4, %xmm3
- movdqu 32(%windowbestlen, %rdx), %xmm5
- movdqu 32(%prev, %rdx), %xmm6
- pcmpeqb %xmm6, %xmm5
- movdqu 48(%windowbestlen, %rdx), %xmm7
- movdqu 48(%prev, %rdx), %xmm8
- pcmpeqb %xmm8, %xmm7
-
- /* Check the comparisions' results */
- pmovmskb %xmm1, %rax
- notw %ax
- bsfw %ax, %ax
- jnz LeaveLoopCmps
-
- /* this is the only iteration of the loop with a possibility of having
- incremented rdx by 0x108 (each loop iteration add 16*4 = 0x40
- and (0x40*4)+8=0x108 */
- add $8, %rdx
- jz LenMaximum
- add $8, %rdx
-
-
- pmovmskb %xmm3, %rax
- notw %ax
- bsfw %ax, %ax
- jnz LeaveLoopCmps
-
-
- add $16, %rdx
-
-
- pmovmskb %xmm5, %rax
- notw %ax
- bsfw %ax, %ax
- jnz LeaveLoopCmps
-
- add $16, %rdx
-
-
- pmovmskb %xmm7, %rax
- notw %ax
- bsfw %ax, %ax
- jnz LeaveLoopCmps
-
- add $16, %rdx
-
- jmp LoopCmps
-LeaveLoopCmps: add %rax, %rdx
-#else
- mov (%windowbestlen, %rdx), %rax
- xor (%prev, %rdx), %rax
- jnz LeaveLoopCmps
-
- mov 8(%windowbestlen, %rdx), %rax
- xor 8(%prev, %rdx), %rax
- jnz LeaveLoopCmps8
-
- mov 16(%windowbestlen, %rdx), %rax
- xor 16(%prev, %rdx), %rax
- jnz LeaveLoopCmps16
-
- add $24, %rdx
- jnz LoopCmps
- jmp LenMaximum
-# if 0
-/*
- * This three-liner is tantalizingly simple, but bsf is a slow instruction,
- * and the complicated alternative down below is quite a bit faster. Sad...
- */
-
-LeaveLoopCmps: bsf %rax, %rax /* find the first non-zero bit */
- shrl $3, %eax /* divide by 8 to get the byte */
- add %rax, %rdx
-# else
-LeaveLoopCmps16:
- add $8, %rdx
-LeaveLoopCmps8:
- add $8, %rdx
-LeaveLoopCmps: testl $0xFFFFFFFF, %eax /* Check the first 4 bytes */
- jnz Check16
- add $4, %rdx
- shr $32, %rax
-Check16: testw $0xFFFF, %ax
- jnz LenLower
- add $2, %rdx
- shrl $16, %eax
-LenLower: subb $1, %al
- adc $0, %rdx
-# endif
-#endif
-
-/* Calculate the length of the match. If it is longer than MAX_MATCH, */
-/* then automatically accept it as the best possible match and leave. */
-
- lea (%prev, %rdx), %rax
- sub %scan, %rax
- cmpl $MAX_MATCH, %eax
- jge LenMaximum
-
-/* If the length of the match is not longer than the best match we */
-/* have so far, then forget it and return to the lookup loop. */
-
- cmpl %bestlend, %eax
- jg LongerMatch
- mov _windowbestlen, %windowbestlen
- mov dsPrev, %prev
- movl _chainlenwmask, %edx
- jmp LookupLoop
-
-/* s->match_start = cur_match; */
-/* best_len = len; */
-/* if (len >= nice_match) break; */
-/* scan_end = *(ushf*)(scan+best_len-1); */
-
-LongerMatch:
- movl %eax, %bestlend
- movl %curmatchd, dsMatchStart
- cmpl %nicematch, %eax
- jge LeaveNow
-
- lea (%window, %bestlen), %windowbestlen
- mov %windowbestlen, _windowbestlen
-
- movzwl -1(%scan, %rax), %scanend
- mov dsPrev, %prev
- movl _chainlenwmask, %chainlenwmask
- jmp LookupLoop
-
-/* Accept the current string, with the maximum possible length. */
-
-LenMaximum:
- movl $MAX_MATCH, %bestlend
- movl %curmatchd, dsMatchStart
-
-/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
-/* return s->lookahead; */
-
-LeaveNow:
- movl dsLookahead, %eax
- cmpl %eax, %bestlend
- cmovngl %bestlend, %eax
-LookaheadRet:
-
-/* Restore the registers and return from whence we came. */
-
- mov save_rsi, %rsi
- mov save_rbx, %rbx
- mov save_r12, %r12
- mov save_r13, %r13
- mov save_r14, %r14
- mov save_r15, %r15
-
- ret
-
-match_init: ret
diff --git a/zlib/contrib/asm686/README.686 b/zlib/contrib/asm686/README.686
deleted file mode 100644
index a0bf3bea..00000000
--- a/zlib/contrib/asm686/README.686
+++ /dev/null
@@ -1,51 +0,0 @@
-This is a patched version of zlib, modified to use
-Pentium-Pro-optimized assembly code in the deflation algorithm. The
-files changed/added by this patch are:
-
-README.686
-match.S
-
-The speedup that this patch provides varies, depending on whether the
-compiler used to build the original version of zlib falls afoul of the
-PPro's speed traps. My own tests show a speedup of around 10-20% at
-the default compression level, and 20-30% using -9, against a version
-compiled using gcc 2.7.2.3. Your mileage may vary.
-
-Note that this code has been tailored for the PPro/PII in particular,
-and will not perform particuarly well on a Pentium.
-
-If you are using an assembler other than GNU as, you will have to
-translate match.S to use your assembler's syntax. (Have fun.)
-
-Brian Raiter
-breadbox@muppetlabs.com
-April, 1998
-
-
-Added for zlib 1.1.3:
-
-The patches come from
-http://www.muppetlabs.com/~breadbox/software/assembly.html
-
-To compile zlib with this asm file, copy match.S to the zlib directory
-then do:
-
-CFLAGS="-O3 -DASMV" ./configure
-make OBJA=match.o
-
-
-Update:
-
-I've been ignoring these assembly routines for years, believing that
-gcc's generated code had caught up with it sometime around gcc 2.95
-and the major rearchitecting of the Pentium 4. However, I recently
-learned that, despite what I believed, this code still has some life
-in it. On the Pentium 4 and AMD64 chips, it continues to run about 8%
-faster than the code produced by gcc 4.1.
-
-In acknowledgement of its continuing usefulness, I've altered the
-license to match that of the rest of zlib. Share and Enjoy!
-
-Brian Raiter
-breadbox@muppetlabs.com
-April, 2007
diff --git a/zlib/contrib/asm686/match.S b/zlib/contrib/asm686/match.S
deleted file mode 100644
index fa421092..00000000
--- a/zlib/contrib/asm686/match.S
+++ /dev/null
@@ -1,357 +0,0 @@
-/* match.S -- x86 assembly version of the zlib longest_match() function.
- * Optimized for the Intel 686 chips (PPro and later).
- *
- * Copyright (C) 1998, 2007 Brian Raiter <breadbox@muppetlabs.com>
- *
- * This software is provided 'as-is', without any express or implied
- * warranty. In no event will the author be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- * claim that you wrote the original software. If you use this software
- * in a product, an acknowledgment in the product documentation would be
- * appreciated but is not required.
- * 2. Altered source versions must be plainly marked as such, and must not be
- * misrepresented as being the original software.
- * 3. This notice may not be removed or altered from any source distribution.
- */
-
-#ifndef NO_UNDERLINE
-#define match_init _match_init
-#define longest_match _longest_match
-#endif
-
-#define MAX_MATCH (258)
-#define MIN_MATCH (3)
-#define MIN_LOOKAHEAD (MAX_MATCH + MIN_MATCH + 1)
-#define MAX_MATCH_8 ((MAX_MATCH + 7) & ~7)
-
-/* stack frame offsets */
-
-#define chainlenwmask 0 /* high word: current chain len */
- /* low word: s->wmask */
-#define window 4 /* local copy of s->window */
-#define windowbestlen 8 /* s->window + bestlen */
-#define scanstart 16 /* first two bytes of string */
-#define scanend 12 /* last two bytes of string */
-#define scanalign 20 /* dword-misalignment of string */
-#define nicematch 24 /* a good enough match size */
-#define bestlen 28 /* size of best match so far */
-#define scan 32 /* ptr to string wanting match */
-
-#define LocalVarsSize (36)
-/* saved ebx 36 */
-/* saved edi 40 */
-/* saved esi 44 */
-/* saved ebp 48 */
-/* return address 52 */
-#define deflatestate 56 /* the function arguments */
-#define curmatch 60
-
-/* All the +zlib1222add offsets are due to the addition of fields
- * in zlib in the deflate_state structure since the asm code was first written
- * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
- * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
- * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
- */
-
-#define zlib1222add (8)
-
-#define dsWSize (36+zlib1222add)
-#define dsWMask (44+zlib1222add)
-#define dsWindow (48+zlib1222add)
-#define dsPrev (56+zlib1222add)
-#define dsMatchLen (88+zlib1222add)
-#define dsPrevMatch (92+zlib1222add)
-#define dsStrStart (100+zlib1222add)
-#define dsMatchStart (104+zlib1222add)
-#define dsLookahead (108+zlib1222add)
-#define dsPrevLen (112+zlib1222add)
-#define dsMaxChainLen (116+zlib1222add)
-#define dsGoodMatch (132+zlib1222add)
-#define dsNiceMatch (136+zlib1222add)
-
-
-.file "match.S"
-
-.globl match_init, longest_match
-
-.text
-
-/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
-.cfi_sections .debug_frame
-
-longest_match:
-
-.cfi_startproc
-/* Save registers that the compiler may be using, and adjust %esp to */
-/* make room for our stack frame. */
-
- pushl %ebp
- .cfi_def_cfa_offset 8
- .cfi_offset ebp, -8
- pushl %edi
- .cfi_def_cfa_offset 12
- pushl %esi
- .cfi_def_cfa_offset 16
- pushl %ebx
- .cfi_def_cfa_offset 20
- subl $LocalVarsSize, %esp
- .cfi_def_cfa_offset LocalVarsSize+20
-
-/* Retrieve the function arguments. %ecx will hold cur_match */
-/* throughout the entire function. %edx will hold the pointer to the */
-/* deflate_state structure during the function's setup (before */
-/* entering the main loop). */
-
- movl deflatestate(%esp), %edx
- movl curmatch(%esp), %ecx
-
-/* uInt wmask = s->w_mask; */
-/* unsigned chain_length = s->max_chain_length; */
-/* if (s->prev_length >= s->good_match) { */
-/* chain_length >>= 2; */
-/* } */
-
- movl dsPrevLen(%edx), %eax
- movl dsGoodMatch(%edx), %ebx
- cmpl %ebx, %eax
- movl dsWMask(%edx), %eax
- movl dsMaxChainLen(%edx), %ebx
- jl LastMatchGood
- shrl $2, %ebx
-LastMatchGood:
-
-/* chainlen is decremented once beforehand so that the function can */
-/* use the sign flag instead of the zero flag for the exit test. */
-/* It is then shifted into the high word, to make room for the wmask */
-/* value, which it will always accompany. */
-
- decl %ebx
- shll $16, %ebx
- orl %eax, %ebx
- movl %ebx, chainlenwmask(%esp)
-
-/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; */
-
- movl dsNiceMatch(%edx), %eax
- movl dsLookahead(%edx), %ebx
- cmpl %eax, %ebx
- jl LookaheadLess
- movl %eax, %ebx
-LookaheadLess: movl %ebx, nicematch(%esp)
-
-/* register Bytef *scan = s->window + s->strstart; */
-
- movl dsWindow(%edx), %esi
- movl %esi, window(%esp)
- movl dsStrStart(%edx), %ebp
- lea (%esi,%ebp), %edi
- movl %edi, scan(%esp)
-
-/* Determine how many bytes the scan ptr is off from being */
-/* dword-aligned. */
-
- movl %edi, %eax
- negl %eax
- andl $3, %eax
- movl %eax, scanalign(%esp)
-
-/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ? */
-/* s->strstart - (IPos)MAX_DIST(s) : NIL; */
-
- movl dsWSize(%edx), %eax
- subl $MIN_LOOKAHEAD, %eax
- subl %eax, %ebp
- jg LimitPositive
- xorl %ebp, %ebp
-LimitPositive:
-
-/* int best_len = s->prev_length; */
-
- movl dsPrevLen(%edx), %eax
- movl %eax, bestlen(%esp)
-
-/* Store the sum of s->window + best_len in %esi locally, and in %esi. */
-
- addl %eax, %esi
- movl %esi, windowbestlen(%esp)
-
-/* register ush scan_start = *(ushf*)scan; */
-/* register ush scan_end = *(ushf*)(scan+best_len-1); */
-/* Posf *prev = s->prev; */
-
- movzwl (%edi), %ebx
- movl %ebx, scanstart(%esp)
- movzwl -1(%edi,%eax), %ebx
- movl %ebx, scanend(%esp)
- movl dsPrev(%edx), %edi
-
-/* Jump into the main loop. */
-
- movl chainlenwmask(%esp), %edx
- jmp LoopEntry
-
-.balign 16
-
-/* do {
- * match = s->window + cur_match;
- * if (*(ushf*)(match+best_len-1) != scan_end ||
- * *(ushf*)match != scan_start) continue;
- * [...]
- * } while ((cur_match = prev[cur_match & wmask]) > limit
- * && --chain_length != 0);
- *
- * Here is the inner loop of the function. The function will spend the
- * majority of its time in this loop, and majority of that time will
- * be spent in the first ten instructions.
- *
- * Within this loop:
- * %ebx = scanend
- * %ecx = curmatch
- * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
- * %esi = windowbestlen - i.e., (window + bestlen)
- * %edi = prev
- * %ebp = limit
- */
-LookupLoop:
- andl %edx, %ecx
- movzwl (%edi,%ecx,2), %ecx
- cmpl %ebp, %ecx
- jbe LeaveNow
- subl $0x00010000, %edx
- js LeaveNow
-LoopEntry: movzwl -1(%esi,%ecx), %eax
- cmpl %ebx, %eax
- jnz LookupLoop
- movl window(%esp), %eax
- movzwl (%eax,%ecx), %eax
- cmpl scanstart(%esp), %eax
- jnz LookupLoop
-
-/* Store the current value of chainlen. */
-
- movl %edx, chainlenwmask(%esp)
-
-/* Point %edi to the string under scrutiny, and %esi to the string we */
-/* are hoping to match it up with. In actuality, %esi and %edi are */
-/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is */
-/* initialized to -(MAX_MATCH_8 - scanalign). */
-
- movl window(%esp), %esi
- movl scan(%esp), %edi
- addl %ecx, %esi
- movl scanalign(%esp), %eax
- movl $(-MAX_MATCH_8), %edx
- lea MAX_MATCH_8(%edi,%eax), %edi
- lea MAX_MATCH_8(%esi,%eax), %esi
-
-/* Test the strings for equality, 8 bytes at a time. At the end,
- * adjust %edx so that it is offset to the exact byte that mismatched.
- *
- * We already know at this point that the first three bytes of the
- * strings match each other, and they can be safely passed over before
- * starting the compare loop. So what this code does is skip over 0-3
- * bytes, as much as necessary in order to dword-align the %edi
- * pointer. (%esi will still be misaligned three times out of four.)
- *
- * It should be confessed that this loop usually does not represent
- * much of the total running time. Replacing it with a more
- * straightforward "rep cmpsb" would not drastically degrade
- * performance.
- */
-LoopCmps:
- movl (%esi,%edx), %eax
- xorl (%edi,%edx), %eax
- jnz LeaveLoopCmps
- movl 4(%esi,%edx), %eax
- xorl 4(%edi,%edx), %eax
- jnz LeaveLoopCmps4
- addl $8, %edx
- jnz LoopCmps
- jmp LenMaximum
-LeaveLoopCmps4: addl $4, %edx
-LeaveLoopCmps: testl $0x0000FFFF, %eax
- jnz LenLower
- addl $2, %edx
- shrl $16, %eax
-LenLower: subb $1, %al
- adcl $0, %edx
-
-/* Calculate the length of the match. If it is longer than MAX_MATCH, */
-/* then automatically accept it as the best possible match and leave. */
-
- lea (%edi,%edx), %eax
- movl scan(%esp), %edi
- subl %edi, %eax
- cmpl $MAX_MATCH, %eax
- jge LenMaximum
-
-/* If the length of the match is not longer than the best match we */
-/* have so far, then forget it and return to the lookup loop. */
-
- movl deflatestate(%esp), %edx
- movl bestlen(%esp), %ebx
- cmpl %ebx, %eax
- jg LongerMatch
- movl windowbestlen(%esp), %esi
- movl dsPrev(%edx), %edi
- movl scanend(%esp), %ebx
- movl chainlenwmask(%esp), %edx
- jmp LookupLoop
-
-/* s->match_start = cur_match; */
-/* best_len = len; */
-/* if (len >= nice_match) break; */
-/* scan_end = *(ushf*)(scan+best_len-1); */
-
-LongerMatch: movl nicematch(%esp), %ebx
- movl %eax, bestlen(%esp)
- movl %ecx, dsMatchStart(%edx)
- cmpl %ebx, %eax
- jge LeaveNow
- movl window(%esp), %esi
- addl %eax, %esi
- movl %esi, windowbestlen(%esp)
- movzwl -1(%edi,%eax), %ebx
- movl dsPrev(%edx), %edi
- movl %ebx, scanend(%esp)
- movl chainlenwmask(%esp), %edx
- jmp LookupLoop
-
-/* Accept the current string, with the maximum possible length. */
-
-LenMaximum: movl deflatestate(%esp), %edx
- movl $MAX_MATCH, bestlen(%esp)
- movl %ecx, dsMatchStart(%edx)
-
-/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len; */
-/* return s->lookahead; */
-
-LeaveNow:
- movl deflatestate(%esp), %edx
- movl bestlen(%esp), %ebx
- movl dsLookahead(%edx), %eax
- cmpl %eax, %ebx
- jg LookaheadRet
- movl %ebx, %eax
-LookaheadRet:
-
-/* Restore the stack and return from whence we came. */
-
- addl $LocalVarsSize, %esp
- .cfi_def_cfa_offset 20
- popl %ebx
- .cfi_def_cfa_offset 16
- popl %esi
- .cfi_def_cfa_offset 12
- popl %edi
- .cfi_def_cfa_offset 8
- popl %ebp
- .cfi_def_cfa_offset 4
-.cfi_endproc
-match_init: ret
diff --git a/zlib/contrib/inflate86/inffas86.c b/zlib/contrib/inflate86/inffas86.c
deleted file mode 100644
index 7292f67b..00000000
--- a/zlib/contrib/inflate86/inffas86.c
+++ /dev/null
@@ -1,1157 +0,0 @@
-/* inffas86.c is a hand tuned assembler version of
- *
- * inffast.c -- fast decoding
- * Copyright (C) 1995-2003 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Copyright (C) 2003 Chris Anderson <christop@charm.net>
- * Please use the copyright conditions above.
- *
- * Dec-29-2003 -- I added AMD64 inflate asm support. This version is also
- * slightly quicker on x86 systems because, instead of using rep movsb to copy
- * data, it uses rep movsw, which moves data in 2-byte chunks instead of single
- * bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates
- * from http://fedora.linux.duke.edu/fc1_x86_64
- * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with
- * 1GB ram. The 64-bit version is about 4% faster than the 32-bit version,
- * when decompressing mozilla-source-1.3.tar.gz.
- *
- * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
- * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at
- * the moment. I have successfully compiled and tested this code with gcc2.96,
- * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S
- * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
- * enabled. I will attempt to merge the MMX code into this version. Newer
- * versions of this and inffast.S can be found at
- * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-/* Mark Adler's comments from inffast.c: */
-
-/*
- Decode literal, length, and distance codes and write out the resulting
- literal and match bytes until either not enough input or output is
- available, an end-of-block is encountered, or a data error is encountered.
- When large enough input and output buffers are supplied to inflate(), for
- example, a 16K input buffer and a 64K output buffer, more than 95% of the
- inflate execution time is spent in this routine.
-
- Entry assumptions:
-
- state->mode == LEN
- strm->avail_in >= 6
- strm->avail_out >= 258
- start >= strm->avail_out
- state->bits < 8
-
- On return, state->mode is one of:
-
- LEN -- ran out of enough output space or enough available input
- TYPE -- reached end of block code, inflate() to interpret next block
- BAD -- error in block data
-
- Notes:
-
- - The maximum input bits used by a length/distance pair is 15 bits for the
- length code, 5 bits for the length extra, 15 bits for the distance code,
- and 13 bits for the distance extra. This totals 48 bits, or six bytes.
- Therefore if strm->avail_in >= 6, then there is enough input to avoid
- checking for available input while decoding.
-
- - The maximum bytes that a single length/distance pair can output is 258
- bytes, which is the maximum length that can be coded. inflate_fast()
- requires strm->avail_out >= 258 for each loop to avoid checking for
- output space.
- */
-void inflate_fast(strm, start)
-z_streamp strm;
-unsigned start; /* inflate()'s starting value for strm->avail_out */
-{
- struct inflate_state FAR *state;
- struct inffast_ar {
-/* 64 32 x86 x86_64 */
-/* ar offset register */
-/* 0 0 */ void *esp; /* esp save */
-/* 8 4 */ void *ebp; /* ebp save */
-/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */
-/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */
-/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */
-/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */
-/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */
-/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */
-/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */
-/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */
-/* 80 40 */ unsigned long hold; /* edx rdx local strm->hold */
-/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */
-/* 92 48 */ unsigned wsize; /* window size */
-/* 96 52 */ unsigned write; /* window write index */
-/*100 56 */ unsigned lmask; /* r12 mask for lcode */
-/*104 60 */ unsigned dmask; /* r13 mask for dcode */
-/*108 64 */ unsigned len; /* r14 match length */
-/*112 68 */ unsigned dist; /* r15 match distance */
-/*116 72 */ unsigned status; /* set when state chng*/
- } ar;
-
-#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )
-#define PAD_AVAIL_IN 6
-#define PAD_AVAIL_OUT 258
-#else
-#define PAD_AVAIL_IN 5
-#define PAD_AVAIL_OUT 257
-#endif
-
- /* copy state to local variables */
- state = (struct inflate_state FAR *)strm->state;
- ar.in = strm->next_in;
- ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN);
- ar.out = strm->next_out;
- ar.beg = ar.out - (start - strm->avail_out);
- ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
- ar.wsize = state->wsize;
- ar.write = state->wnext;
- ar.window = state->window;
- ar.hold = state->hold;
- ar.bits = state->bits;
- ar.lcode = state->lencode;
- ar.dcode = state->distcode;
- ar.lmask = (1U << state->lenbits) - 1;
- ar.dmask = (1U << state->distbits) - 1;
-
- /* decode literals and length/distances until end-of-block or not enough
- input data or output space */
-
- /* align in on 1/2 hold size boundary */
- while (((unsigned long)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) {
- ar.hold += (unsigned long)*ar.in++ << ar.bits;
- ar.bits += 8;
- }
-
-#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )
- __asm__ __volatile__ (
-" leaq %0, %%rax\n"
-" movq %%rbp, 8(%%rax)\n" /* save regs rbp and rsp */
-" movq %%rsp, (%%rax)\n"
-" movq %%rax, %%rsp\n" /* make rsp point to &ar */
-" movq 16(%%rsp), %%rsi\n" /* rsi = in */
-" movq 32(%%rsp), %%rdi\n" /* rdi = out */
-" movq 24(%%rsp), %%r9\n" /* r9 = last */
-" movq 48(%%rsp), %%r10\n" /* r10 = end */
-" movq 64(%%rsp), %%rbp\n" /* rbp = lcode */
-" movq 72(%%rsp), %%r11\n" /* r11 = dcode */
-" movq 80(%%rsp), %%rdx\n" /* rdx = hold */
-" movl 88(%%rsp), %%ebx\n" /* ebx = bits */
-" movl 100(%%rsp), %%r12d\n" /* r12d = lmask */
-" movl 104(%%rsp), %%r13d\n" /* r13d = dmask */
- /* r14d = len */
- /* r15d = dist */
-" cld\n"
-" cmpq %%rdi, %%r10\n"
-" je .L_one_time\n" /* if only one decode left */
-" cmpq %%rsi, %%r9\n"
-" je .L_one_time\n"
-" jmp .L_do_loop\n"
-
-".L_one_time:\n"
-" movq %%r12, %%r8\n" /* r8 = lmask */
-" cmpb $32, %%bl\n"
-" ja .L_get_length_code_one_time\n"
-
-" lodsl\n" /* eax = *(uint *)in++ */
-" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
-" addb $32, %%bl\n" /* bits += 32 */
-" shlq %%cl, %%rax\n"
-" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */
-" jmp .L_get_length_code_one_time\n"
-
-".align 32,0x90\n"
-".L_while_test:\n"
-" cmpq %%rdi, %%r10\n"
-" jbe .L_break_loop\n"
-" cmpq %%rsi, %%r9\n"
-" jbe .L_break_loop\n"
-
-".L_do_loop:\n"
-" movq %%r12, %%r8\n" /* r8 = lmask */
-" cmpb $32, %%bl\n"
-" ja .L_get_length_code\n" /* if (32 < bits) */
-
-" lodsl\n" /* eax = *(uint *)in++ */
-" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
-" addb $32, %%bl\n" /* bits += 32 */
-" shlq %%cl, %%rax\n"
-" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */
-
-".L_get_length_code:\n"
-" andq %%rdx, %%r8\n" /* r8 &= hold */
-" movl (%%rbp,%%r8,4), %%eax\n" /* eax = lcode[hold & lmask] */
-
-" movb %%ah, %%cl\n" /* cl = this.bits */
-" subb %%ah, %%bl\n" /* bits -= this.bits */
-" shrq %%cl, %%rdx\n" /* hold >>= this.bits */
-
-" testb %%al, %%al\n"
-" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */
-
-" movq %%r12, %%r8\n" /* r8 = lmask */
-" shrl $16, %%eax\n" /* output this.val char */
-" stosb\n"
-
-".L_get_length_code_one_time:\n"
-" andq %%rdx, %%r8\n" /* r8 &= hold */
-" movl (%%rbp,%%r8,4), %%eax\n" /* eax = lcode[hold & lmask] */
-
-".L_dolen:\n"
-" movb %%ah, %%cl\n" /* cl = this.bits */
-" subb %%ah, %%bl\n" /* bits -= this.bits */
-" shrq %%cl, %%rdx\n" /* hold >>= this.bits */
-
-" testb %%al, %%al\n"
-" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */
-
-" shrl $16, %%eax\n" /* output this.val char */
-" stosb\n"
-" jmp .L_while_test\n"
-
-".align 32,0x90\n"
-".L_test_for_length_base:\n"
-" movl %%eax, %%r14d\n" /* len = this */
-" shrl $16, %%r14d\n" /* len = this.val */
-" movb %%al, %%cl\n"
-
-" testb $16, %%al\n"
-" jz .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */
-" andb $15, %%cl\n" /* op &= 15 */
-" jz .L_decode_distance\n" /* if (!op) */
-
-".L_add_bits_to_len:\n"
-" subb %%cl, %%bl\n"
-" xorl %%eax, %%eax\n"
-" incl %%eax\n"
-" shll %%cl, %%eax\n"
-" decl %%eax\n"
-" andl %%edx, %%eax\n" /* eax &= hold */
-" shrq %%cl, %%rdx\n"
-" addl %%eax, %%r14d\n" /* len += hold & mask[op] */
-
-".L_decode_distance:\n"
-" movq %%r13, %%r8\n" /* r8 = dmask */
-" cmpb $32, %%bl\n"
-" ja .L_get_distance_code\n" /* if (32 < bits) */
-
-" lodsl\n" /* eax = *(uint *)in++ */
-" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
-" addb $32, %%bl\n" /* bits += 32 */
-" shlq %%cl, %%rax\n"
-" orq %%rax, %%rdx\n" /* hold |= *((uint *)in)++ << bits */
-
-".L_get_distance_code:\n"
-" andq %%rdx, %%r8\n" /* r8 &= hold */
-" movl (%%r11,%%r8,4), %%eax\n" /* eax = dcode[hold & dmask] */
-
-".L_dodist:\n"
-" movl %%eax, %%r15d\n" /* dist = this */
-" shrl $16, %%r15d\n" /* dist = this.val */
-" movb %%ah, %%cl\n"
-" subb %%ah, %%bl\n" /* bits -= this.bits */
-" shrq %%cl, %%rdx\n" /* hold >>= this.bits */
-" movb %%al, %%cl\n" /* cl = this.op */
-
-" testb $16, %%al\n" /* if ((op & 16) == 0) */
-" jz .L_test_for_second_level_dist\n"
-" andb $15, %%cl\n" /* op &= 15 */
-" jz .L_check_dist_one\n"
-
-".L_add_bits_to_dist:\n"
-" subb %%cl, %%bl\n"
-" xorl %%eax, %%eax\n"
-" incl %%eax\n"
-" shll %%cl, %%eax\n"
-" decl %%eax\n" /* (1 << op) - 1 */
-" andl %%edx, %%eax\n" /* eax &= hold */
-" shrq %%cl, %%rdx\n"
-" addl %%eax, %%r15d\n" /* dist += hold & ((1 << op) - 1) */
-
-".L_check_window:\n"
-" movq %%rsi, %%r8\n" /* save in so from can use it's reg */
-" movq %%rdi, %%rax\n"
-" subq 40(%%rsp), %%rax\n" /* nbytes = out - beg */
-
-" cmpl %%r15d, %%eax\n"
-" jb .L_clip_window\n" /* if (dist > nbytes) 4.2% */
-
-" movl %%r14d, %%ecx\n" /* ecx = len */
-" movq %%rdi, %%rsi\n"
-" subq %%r15, %%rsi\n" /* from = out - dist */
-
-" sarl %%ecx\n"
-" jnc .L_copy_two\n" /* if len % 2 == 0 */
-
-" rep movsw\n"
-" movb (%%rsi), %%al\n"
-" movb %%al, (%%rdi)\n"
-" incq %%rdi\n"
-
-" movq %%r8, %%rsi\n" /* move in back to %rsi, toss from */
-" jmp .L_while_test\n"
-
-".L_copy_two:\n"
-" rep movsw\n"
-" movq %%r8, %%rsi\n" /* move in back to %rsi, toss from */
-" jmp .L_while_test\n"
-
-".align 32,0x90\n"
-".L_check_dist_one:\n"
-" cmpl $1, %%r15d\n" /* if dist 1, is a memset */
-" jne .L_check_window\n"
-" cmpq %%rdi, 40(%%rsp)\n" /* if out == beg, outside window */
-" je .L_check_window\n"
-
-" movl %%r14d, %%ecx\n" /* ecx = len */
-" movb -1(%%rdi), %%al\n"
-" movb %%al, %%ah\n"
-
-" sarl %%ecx\n"
-" jnc .L_set_two\n"
-" movb %%al, (%%rdi)\n"
-" incq %%rdi\n"
-
-".L_set_two:\n"
-" rep stosw\n"
-" jmp .L_while_test\n"
-
-".align 32,0x90\n"
-".L_test_for_second_level_length:\n"
-" testb $64, %%al\n"
-" jnz .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */
-
-" xorl %%eax, %%eax\n"
-" incl %%eax\n"
-" shll %%cl, %%eax\n"
-" decl %%eax\n"
-" andl %%edx, %%eax\n" /* eax &= hold */
-" addl %%r14d, %%eax\n" /* eax += len */
-" movl (%%rbp,%%rax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/
-" jmp .L_dolen\n"
-
-".align 32,0x90\n"
-".L_test_for_second_level_dist:\n"
-" testb $64, %%al\n"
-" jnz .L_invalid_distance_code\n" /* if ((op & 64) != 0) */
-
-" xorl %%eax, %%eax\n"
-" incl %%eax\n"
-" shll %%cl, %%eax\n"
-" decl %%eax\n"
-" andl %%edx, %%eax\n" /* eax &= hold */
-" addl %%r15d, %%eax\n" /* eax += dist */
-" movl (%%r11,%%rax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/
-" jmp .L_dodist\n"
-
-".align 32,0x90\n"
-".L_clip_window:\n"
-" movl %%eax, %%ecx\n" /* ecx = nbytes */
-" movl 92(%%rsp), %%eax\n" /* eax = wsize, prepare for dist cmp */
-" negl %%ecx\n" /* nbytes = -nbytes */
-
-" cmpl %%r15d, %%eax\n"
-" jb .L_invalid_distance_too_far\n" /* if (dist > wsize) */
-
-" addl %%r15d, %%ecx\n" /* nbytes = dist - nbytes */
-" cmpl $0, 96(%%rsp)\n"
-" jne .L_wrap_around_window\n" /* if (write != 0) */
-
-" movq 56(%%rsp), %%rsi\n" /* from = window */
-" subl %%ecx, %%eax\n" /* eax -= nbytes */
-" addq %%rax, %%rsi\n" /* from += wsize - nbytes */
-
-" movl %%r14d, %%eax\n" /* eax = len */
-" cmpl %%ecx, %%r14d\n"
-" jbe .L_do_copy\n" /* if (nbytes >= len) */
-
-" subl %%ecx, %%eax\n" /* eax -= nbytes */
-" rep movsb\n"
-" movq %%rdi, %%rsi\n"
-" subq %%r15, %%rsi\n" /* from = &out[ -dist ] */
-" jmp .L_do_copy\n"
-
-".align 32,0x90\n"
-".L_wrap_around_window:\n"
-" movl 96(%%rsp), %%eax\n" /* eax = write */
-" cmpl %%eax, %%ecx\n"
-" jbe .L_contiguous_in_window\n" /* if (write >= nbytes) */
-
-" movl 92(%%rsp), %%esi\n" /* from = wsize */
-" addq 56(%%rsp), %%rsi\n" /* from += window */
-" addq %%rax, %%rsi\n" /* from += write */
-" subq %%rcx, %%rsi\n" /* from -= nbytes */
-" subl %%eax, %%ecx\n" /* nbytes -= write */
-
-" movl %%r14d, %%eax\n" /* eax = len */
-" cmpl %%ecx, %%eax\n"
-" jbe .L_do_copy\n" /* if (nbytes >= len) */
-
-" subl %%ecx, %%eax\n" /* len -= nbytes */
-" rep movsb\n"
-" movq 56(%%rsp), %%rsi\n" /* from = window */
-" movl 96(%%rsp), %%ecx\n" /* nbytes = write */
-" cmpl %%ecx, %%eax\n"
-" jbe .L_do_copy\n" /* if (nbytes >= len) */
-
-" subl %%ecx, %%eax\n" /* len -= nbytes */
-" rep movsb\n"
-" movq %%rdi, %%rsi\n"
-" subq %%r15, %%rsi\n" /* from = out - dist */
-" jmp .L_do_copy\n"
-
-".align 32,0x90\n"
-".L_contiguous_in_window:\n"
-" movq 56(%%rsp), %%rsi\n" /* rsi = window */
-" addq %%rax, %%rsi\n"
-" subq %%rcx, %%rsi\n" /* from += write - nbytes */
-
-" movl %%r14d, %%eax\n" /* eax = len */
-" cmpl %%ecx, %%eax\n"
-" jbe .L_do_copy\n" /* if (nbytes >= len) */
-
-" subl %%ecx, %%eax\n" /* len -= nbytes */
-" rep movsb\n"
-" movq %%rdi, %%rsi\n"
-" subq %%r15, %%rsi\n" /* from = out - dist */
-" jmp .L_do_copy\n" /* if (nbytes >= len) */
-
-".align 32,0x90\n"
-".L_do_copy:\n"
-" movl %%eax, %%ecx\n" /* ecx = len */
-" rep movsb\n"
-
-" movq %%r8, %%rsi\n" /* move in back to %esi, toss from */
-" jmp .L_while_test\n"
-
-".L_test_for_end_of_block:\n"
-" testb $32, %%al\n"
-" jz .L_invalid_literal_length_code\n"
-" movl $1, 116(%%rsp)\n"
-" jmp .L_break_loop_with_status\n"
-
-".L_invalid_literal_length_code:\n"
-" movl $2, 116(%%rsp)\n"
-" jmp .L_break_loop_with_status\n"
-
-".L_invalid_distance_code:\n"
-" movl $3, 116(%%rsp)\n"
-" jmp .L_break_loop_with_status\n"
-
-".L_invalid_distance_too_far:\n"
-" movl $4, 116(%%rsp)\n"
-" jmp .L_break_loop_with_status\n"
-
-".L_break_loop:\n"
-" movl $0, 116(%%rsp)\n"
-
-".L_break_loop_with_status:\n"
-/* put in, out, bits, and hold back into ar and pop esp */
-" movq %%rsi, 16(%%rsp)\n" /* in */
-" movq %%rdi, 32(%%rsp)\n" /* out */
-" movl %%ebx, 88(%%rsp)\n" /* bits */
-" movq %%rdx, 80(%%rsp)\n" /* hold */
-" movq (%%rsp), %%rax\n" /* restore rbp and rsp */
-" movq 8(%%rsp), %%rbp\n"
-" movq %%rax, %%rsp\n"
- :
- : "m" (ar)
- : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
- "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
- );
-#elif ( defined( __GNUC__ ) || defined( __ICC ) ) && defined( __i386 )
- __asm__ __volatile__ (
-" leal %0, %%eax\n"
-" movl %%esp, (%%eax)\n" /* save esp, ebp */
-" movl %%ebp, 4(%%eax)\n"
-" movl %%eax, %%esp\n"
-" movl 8(%%esp), %%esi\n" /* esi = in */
-" movl 16(%%esp), %%edi\n" /* edi = out */
-" movl 40(%%esp), %%edx\n" /* edx = hold */
-" movl 44(%%esp), %%ebx\n" /* ebx = bits */
-" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
-
-" cld\n"
-" jmp .L_do_loop\n"
-
-".align 32,0x90\n"
-".L_while_test:\n"
-" cmpl %%edi, 24(%%esp)\n" /* out < end */
-" jbe .L_break_loop\n"
-" cmpl %%esi, 12(%%esp)\n" /* in < last */
-" jbe .L_break_loop\n"
-
-".L_do_loop:\n"
-" cmpb $15, %%bl\n"
-" ja .L_get_length_code\n" /* if (15 < bits) */
-
-" xorl %%eax, %%eax\n"
-" lodsw\n" /* al = *(ushort *)in++ */
-" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
-" addb $16, %%bl\n" /* bits += 16 */
-" shll %%cl, %%eax\n"
-" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */
-
-".L_get_length_code:\n"
-" movl 56(%%esp), %%eax\n" /* eax = lmask */
-" andl %%edx, %%eax\n" /* eax &= hold */
-" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[hold & lmask] */
-
-".L_dolen:\n"
-" movb %%ah, %%cl\n" /* cl = this.bits */
-" subb %%ah, %%bl\n" /* bits -= this.bits */
-" shrl %%cl, %%edx\n" /* hold >>= this.bits */
-
-" testb %%al, %%al\n"
-" jnz .L_test_for_length_base\n" /* if (op != 0) 45.7% */
-
-" shrl $16, %%eax\n" /* output this.val char */
-" stosb\n"
-" jmp .L_while_test\n"
-
-".align 32,0x90\n"
-".L_test_for_length_base:\n"
-" movl %%eax, %%ecx\n" /* len = this */
-" shrl $16, %%ecx\n" /* len = this.val */
-" movl %%ecx, 64(%%esp)\n" /* save len */
-" movb %%al, %%cl\n"
-
-" testb $16, %%al\n"
-" jz .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */
-" andb $15, %%cl\n" /* op &= 15 */
-" jz .L_decode_distance\n" /* if (!op) */
-" cmpb %%cl, %%bl\n"
-" jae .L_add_bits_to_len\n" /* if (op <= bits) */
-
-" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */
-" xorl %%eax, %%eax\n"
-" lodsw\n" /* al = *(ushort *)in++ */
-" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
-" addb $16, %%bl\n" /* bits += 16 */
-" shll %%cl, %%eax\n"
-" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */
-" movb %%ch, %%cl\n" /* move op back to ecx */
-
-".L_add_bits_to_len:\n"
-" subb %%cl, %%bl\n"
-" xorl %%eax, %%eax\n"
-" incl %%eax\n"
-" shll %%cl, %%eax\n"
-" decl %%eax\n"
-" andl %%edx, %%eax\n" /* eax &= hold */
-" shrl %%cl, %%edx\n"
-" addl %%eax, 64(%%esp)\n" /* len += hold & mask[op] */
-
-".L_decode_distance:\n"
-" cmpb $15, %%bl\n"
-" ja .L_get_distance_code\n" /* if (15 < bits) */
-
-" xorl %%eax, %%eax\n"
-" lodsw\n" /* al = *(ushort *)in++ */
-" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
-" addb $16, %%bl\n" /* bits += 16 */
-" shll %%cl, %%eax\n"
-" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */
-
-".L_get_distance_code:\n"
-" movl 60(%%esp), %%eax\n" /* eax = dmask */
-" movl 36(%%esp), %%ecx\n" /* ecx = dcode */
-" andl %%edx, %%eax\n" /* eax &= hold */
-" movl (%%ecx,%%eax,4), %%eax\n"/* eax = dcode[hold & dmask] */
-
-".L_dodist:\n"
-" movl %%eax, %%ebp\n" /* dist = this */
-" shrl $16, %%ebp\n" /* dist = this.val */
-" movb %%ah, %%cl\n"
-" subb %%ah, %%bl\n" /* bits -= this.bits */
-" shrl %%cl, %%edx\n" /* hold >>= this.bits */
-" movb %%al, %%cl\n" /* cl = this.op */
-
-" testb $16, %%al\n" /* if ((op & 16) == 0) */
-" jz .L_test_for_second_level_dist\n"
-" andb $15, %%cl\n" /* op &= 15 */
-" jz .L_check_dist_one\n"
-" cmpb %%cl, %%bl\n"
-" jae .L_add_bits_to_dist\n" /* if (op <= bits) 97.6% */
-
-" movb %%cl, %%ch\n" /* stash op in ch, freeing cl */
-" xorl %%eax, %%eax\n"
-" lodsw\n" /* al = *(ushort *)in++ */
-" movb %%bl, %%cl\n" /* cl = bits, needs it for shifting */
-" addb $16, %%bl\n" /* bits += 16 */
-" shll %%cl, %%eax\n"
-" orl %%eax, %%edx\n" /* hold |= *((ushort *)in)++ << bits */
-" movb %%ch, %%cl\n" /* move op back to ecx */
-
-".L_add_bits_to_dist:\n"
-" subb %%cl, %%bl\n"
-" xorl %%eax, %%eax\n"
-" incl %%eax\n"
-" shll %%cl, %%eax\n"
-" decl %%eax\n" /* (1 << op) - 1 */
-" andl %%edx, %%eax\n" /* eax &= hold */
-" shrl %%cl, %%edx\n"
-" addl %%eax, %%ebp\n" /* dist += hold & ((1 << op) - 1) */
-
-".L_check_window:\n"
-" movl %%esi, 8(%%esp)\n" /* save in so from can use it's reg */
-" movl %%edi, %%eax\n"
-" subl 20(%%esp), %%eax\n" /* nbytes = out - beg */
-
-" cmpl %%ebp, %%eax\n"
-" jb .L_clip_window\n" /* if (dist > nbytes) 4.2% */
-
-" movl 64(%%esp), %%ecx\n" /* ecx = len */
-" movl %%edi, %%esi\n"
-" subl %%ebp, %%esi\n" /* from = out - dist */
-
-" sarl %%ecx\n"
-" jnc .L_copy_two\n" /* if len % 2 == 0 */
-
-" rep movsw\n"
-" movb (%%esi), %%al\n"
-" movb %%al, (%%edi)\n"
-" incl %%edi\n"
-
-" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */
-" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
-" jmp .L_while_test\n"
-
-".L_copy_two:\n"
-" rep movsw\n"
-" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */
-" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
-" jmp .L_while_test\n"
-
-".align 32,0x90\n"
-".L_check_dist_one:\n"
-" cmpl $1, %%ebp\n" /* if dist 1, is a memset */
-" jne .L_check_window\n"
-" cmpl %%edi, 20(%%esp)\n"
-" je .L_check_window\n" /* out == beg, if outside window */
-
-" movl 64(%%esp), %%ecx\n" /* ecx = len */
-" movb -1(%%edi), %%al\n"
-" movb %%al, %%ah\n"
-
-" sarl %%ecx\n"
-" jnc .L_set_two\n"
-" movb %%al, (%%edi)\n"
-" incl %%edi\n"
-
-".L_set_two:\n"
-" rep stosw\n"
-" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
-" jmp .L_while_test\n"
-
-".align 32,0x90\n"
-".L_test_for_second_level_length:\n"
-" testb $64, %%al\n"
-" jnz .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */
-
-" xorl %%eax, %%eax\n"
-" incl %%eax\n"
-" shll %%cl, %%eax\n"
-" decl %%eax\n"
-" andl %%edx, %%eax\n" /* eax &= hold */
-" addl 64(%%esp), %%eax\n" /* eax += len */
-" movl (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/
-" jmp .L_dolen\n"
-
-".align 32,0x90\n"
-".L_test_for_second_level_dist:\n"
-" testb $64, %%al\n"
-" jnz .L_invalid_distance_code\n" /* if ((op & 64) != 0) */
-
-" xorl %%eax, %%eax\n"
-" incl %%eax\n"
-" shll %%cl, %%eax\n"
-" decl %%eax\n"
-" andl %%edx, %%eax\n" /* eax &= hold */
-" addl %%ebp, %%eax\n" /* eax += dist */
-" movl 36(%%esp), %%ecx\n" /* ecx = dcode */
-" movl (%%ecx,%%eax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/
-" jmp .L_dodist\n"
-
-".align 32,0x90\n"
-".L_clip_window:\n"
-" movl %%eax, %%ecx\n"
-" movl 48(%%esp), %%eax\n" /* eax = wsize */
-" negl %%ecx\n" /* nbytes = -nbytes */
-" movl 28(%%esp), %%esi\n" /* from = window */
-
-" cmpl %%ebp, %%eax\n"
-" jb .L_invalid_distance_too_far\n" /* if (dist > wsize) */
-
-" addl %%ebp, %%ecx\n" /* nbytes = dist - nbytes */
-" cmpl $0, 52(%%esp)\n"
-" jne .L_wrap_around_window\n" /* if (write != 0) */
-
-" subl %%ecx, %%eax\n"
-" addl %%eax, %%esi\n" /* from += wsize - nbytes */
-
-" movl 64(%%esp), %%eax\n" /* eax = len */
-" cmpl %%ecx, %%eax\n"
-" jbe .L_do_copy\n" /* if (nbytes >= len) */
-
-" subl %%ecx, %%eax\n" /* len -= nbytes */
-" rep movsb\n"
-" movl %%edi, %%esi\n"
-" subl %%ebp, %%esi\n" /* from = out - dist */
-" jmp .L_do_copy\n"
-
-".align 32,0x90\n"
-".L_wrap_around_window:\n"
-" movl 52(%%esp), %%eax\n" /* eax = write */
-" cmpl %%eax, %%ecx\n"
-" jbe .L_contiguous_in_window\n" /* if (write >= nbytes) */
-
-" addl 48(%%esp), %%esi\n" /* from += wsize */
-" addl %%eax, %%esi\n" /* from += write */
-" subl %%ecx, %%esi\n" /* from -= nbytes */
-" subl %%eax, %%ecx\n" /* nbytes -= write */
-
-" movl 64(%%esp), %%eax\n" /* eax = len */
-" cmpl %%ecx, %%eax\n"
-" jbe .L_do_copy\n" /* if (nbytes >= len) */
-
-" subl %%ecx, %%eax\n" /* len -= nbytes */
-" rep movsb\n"
-" movl 28(%%esp), %%esi\n" /* from = window */
-" movl 52(%%esp), %%ecx\n" /* nbytes = write */
-" cmpl %%ecx, %%eax\n"
-" jbe .L_do_copy\n" /* if (nbytes >= len) */
-
-" subl %%ecx, %%eax\n" /* len -= nbytes */
-" rep movsb\n"
-" movl %%edi, %%esi\n"
-" subl %%ebp, %%esi\n" /* from = out - dist */
-" jmp .L_do_copy\n"
-
-".align 32,0x90\n"
-".L_contiguous_in_window:\n"
-" addl %%eax, %%esi\n"
-" subl %%ecx, %%esi\n" /* from += write - nbytes */
-
-" movl 64(%%esp), %%eax\n" /* eax = len */
-" cmpl %%ecx, %%eax\n"
-" jbe .L_do_copy\n" /* if (nbytes >= len) */
-
-" subl %%ecx, %%eax\n" /* len -= nbytes */
-" rep movsb\n"
-" movl %%edi, %%esi\n"
-" subl %%ebp, %%esi\n" /* from = out - dist */
-" jmp .L_do_copy\n" /* if (nbytes >= len) */
-
-".align 32,0x90\n"
-".L_do_copy:\n"
-" movl %%eax, %%ecx\n"
-" rep movsb\n"
-
-" movl 8(%%esp), %%esi\n" /* move in back to %esi, toss from */
-" movl 32(%%esp), %%ebp\n" /* ebp = lcode */
-" jmp .L_while_test\n"
-
-".L_test_for_end_of_block:\n"
-" testb $32, %%al\n"
-" jz .L_invalid_literal_length_code\n"
-" movl $1, 72(%%esp)\n"
-" jmp .L_break_loop_with_status\n"
-
-".L_invalid_literal_length_code:\n"
-" movl $2, 72(%%esp)\n"
-" jmp .L_break_loop_with_status\n"
-
-".L_invalid_distance_code:\n"
-" movl $3, 72(%%esp)\n"
-" jmp .L_break_loop_with_status\n"
-
-".L_invalid_distance_too_far:\n"
-" movl 8(%%esp), %%esi\n"
-" movl $4, 72(%%esp)\n"
-" jmp .L_break_loop_with_status\n"
-
-".L_break_loop:\n"
-" movl $0, 72(%%esp)\n"
-
-".L_break_loop_with_status:\n"
-/* put in, out, bits, and hold back into ar and pop esp */
-" movl %%esi, 8(%%esp)\n" /* save in */
-" movl %%edi, 16(%%esp)\n" /* save out */
-" movl %%ebx, 44(%%esp)\n" /* save bits */
-" movl %%edx, 40(%%esp)\n" /* save hold */
-" movl 4(%%esp), %%ebp\n" /* restore esp, ebp */
-" movl (%%esp), %%esp\n"
- :
- : "m" (ar)
- : "memory", "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi"
- );
-#elif defined( _MSC_VER ) && ! defined( _M_AMD64 )
- __asm {
- lea eax, ar
- mov [eax], esp /* save esp, ebp */
- mov [eax+4], ebp
- mov esp, eax
- mov esi, [esp+8] /* esi = in */
- mov edi, [esp+16] /* edi = out */
- mov edx, [esp+40] /* edx = hold */
- mov ebx, [esp+44] /* ebx = bits */
- mov ebp, [esp+32] /* ebp = lcode */
-
- cld
- jmp L_do_loop
-
-ALIGN 4
-L_while_test:
- cmp [esp+24], edi
- jbe L_break_loop
- cmp [esp+12], esi
- jbe L_break_loop
-
-L_do_loop:
- cmp bl, 15
- ja L_get_length_code /* if (15 < bits) */
-
- xor eax, eax
- lodsw /* al = *(ushort *)in++ */
- mov cl, bl /* cl = bits, needs it for shifting */
- add bl, 16 /* bits += 16 */
- shl eax, cl
- or edx, eax /* hold |= *((ushort *)in)++ << bits */
-
-L_get_length_code:
- mov eax, [esp+56] /* eax = lmask */
- and eax, edx /* eax &= hold */
- mov eax, [ebp+eax*4] /* eax = lcode[hold & lmask] */
-
-L_dolen:
- mov cl, ah /* cl = this.bits */
- sub bl, ah /* bits -= this.bits */
- shr edx, cl /* hold >>= this.bits */
-
- test al, al
- jnz L_test_for_length_base /* if (op != 0) 45.7% */
-
- shr eax, 16 /* output this.val char */
- stosb
- jmp L_while_test
-
-ALIGN 4
-L_test_for_length_base:
- mov ecx, eax /* len = this */
- shr ecx, 16 /* len = this.val */
- mov [esp+64], ecx /* save len */
- mov cl, al
-
- test al, 16
- jz L_test_for_second_level_length /* if ((op & 16) == 0) 8% */
- and cl, 15 /* op &= 15 */
- jz L_decode_distance /* if (!op) */
- cmp bl, cl
- jae L_add_bits_to_len /* if (op <= bits) */
-
- mov ch, cl /* stash op in ch, freeing cl */
- xor eax, eax
- lodsw /* al = *(ushort *)in++ */
- mov cl, bl /* cl = bits, needs it for shifting */
- add bl, 16 /* bits += 16 */
- shl eax, cl
- or edx, eax /* hold |= *((ushort *)in)++ << bits */
- mov cl, ch /* move op back to ecx */
-
-L_add_bits_to_len:
- sub bl, cl
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx /* eax &= hold */
- shr edx, cl
- add [esp+64], eax /* len += hold & mask[op] */
-
-L_decode_distance:
- cmp bl, 15
- ja L_get_distance_code /* if (15 < bits) */
-
- xor eax, eax
- lodsw /* al = *(ushort *)in++ */
- mov cl, bl /* cl = bits, needs it for shifting */
- add bl, 16 /* bits += 16 */
- shl eax, cl
- or edx, eax /* hold |= *((ushort *)in)++ << bits */
-
-L_get_distance_code:
- mov eax, [esp+60] /* eax = dmask */
- mov ecx, [esp+36] /* ecx = dcode */
- and eax, edx /* eax &= hold */
- mov eax, [ecx+eax*4]/* eax = dcode[hold & dmask] */
-
-L_dodist:
- mov ebp, eax /* dist = this */
- shr ebp, 16 /* dist = this.val */
- mov cl, ah
- sub bl, ah /* bits -= this.bits */
- shr edx, cl /* hold >>= this.bits */
- mov cl, al /* cl = this.op */
-
- test al, 16 /* if ((op & 16) == 0) */
- jz L_test_for_second_level_dist
- and cl, 15 /* op &= 15 */
- jz L_check_dist_one
- cmp bl, cl
- jae L_add_bits_to_dist /* if (op <= bits) 97.6% */
-
- mov ch, cl /* stash op in ch, freeing cl */
- xor eax, eax
- lodsw /* al = *(ushort *)in++ */
- mov cl, bl /* cl = bits, needs it for shifting */
- add bl, 16 /* bits += 16 */
- shl eax, cl
- or edx, eax /* hold |= *((ushort *)in)++ << bits */
- mov cl, ch /* move op back to ecx */
-
-L_add_bits_to_dist:
- sub bl, cl
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax /* (1 << op) - 1 */
- and eax, edx /* eax &= hold */
- shr edx, cl
- add ebp, eax /* dist += hold & ((1 << op) - 1) */
-
-L_check_window:
- mov [esp+8], esi /* save in so from can use it's reg */
- mov eax, edi
- sub eax, [esp+20] /* nbytes = out - beg */
-
- cmp eax, ebp
- jb L_clip_window /* if (dist > nbytes) 4.2% */
-
- mov ecx, [esp+64] /* ecx = len */
- mov esi, edi
- sub esi, ebp /* from = out - dist */
-
- sar ecx, 1
- jnc L_copy_two
-
- rep movsw
- mov al, [esi]
- mov [edi], al
- inc edi
-
- mov esi, [esp+8] /* move in back to %esi, toss from */
- mov ebp, [esp+32] /* ebp = lcode */
- jmp L_while_test
-
-L_copy_two:
- rep movsw
- mov esi, [esp+8] /* move in back to %esi, toss from */
- mov ebp, [esp+32] /* ebp = lcode */
- jmp L_while_test
-
-ALIGN 4
-L_check_dist_one:
- cmp ebp, 1 /* if dist 1, is a memset */
- jne L_check_window
- cmp [esp+20], edi
- je L_check_window /* out == beg, if outside window */
-
- mov ecx, [esp+64] /* ecx = len */
- mov al, [edi-1]
- mov ah, al
-
- sar ecx, 1
- jnc L_set_two
- mov [edi], al /* memset out with from[-1] */
- inc edi
-
-L_set_two:
- rep stosw
- mov ebp, [esp+32] /* ebp = lcode */
- jmp L_while_test
-
-ALIGN 4
-L_test_for_second_level_length:
- test al, 64
- jnz L_test_for_end_of_block /* if ((op & 64) != 0) */
-
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx /* eax &= hold */
- add eax, [esp+64] /* eax += len */
- mov eax, [ebp+eax*4] /* eax = lcode[val+(hold&mask[op])]*/
- jmp L_dolen
-
-ALIGN 4
-L_test_for_second_level_dist:
- test al, 64
- jnz L_invalid_distance_code /* if ((op & 64) != 0) */
-
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx /* eax &= hold */
- add eax, ebp /* eax += dist */
- mov ecx, [esp+36] /* ecx = dcode */
- mov eax, [ecx+eax*4] /* eax = dcode[val+(hold&mask[op])]*/
- jmp L_dodist
-
-ALIGN 4
-L_clip_window:
- mov ecx, eax
- mov eax, [esp+48] /* eax = wsize */
- neg ecx /* nbytes = -nbytes */
- mov esi, [esp+28] /* from = window */
-
- cmp eax, ebp
- jb L_invalid_distance_too_far /* if (dist > wsize) */
-
- add ecx, ebp /* nbytes = dist - nbytes */
- cmp dword ptr [esp+52], 0
- jne L_wrap_around_window /* if (write != 0) */
-
- sub eax, ecx
- add esi, eax /* from += wsize - nbytes */
-
- mov eax, [esp+64] /* eax = len */
- cmp eax, ecx
- jbe L_do_copy /* if (nbytes >= len) */
-
- sub eax, ecx /* len -= nbytes */
- rep movsb
- mov esi, edi
- sub esi, ebp /* from = out - dist */
- jmp L_do_copy
-
-ALIGN 4
-L_wrap_around_window:
- mov eax, [esp+52] /* eax = write */
- cmp ecx, eax
- jbe L_contiguous_in_window /* if (write >= nbytes) */
-
- add esi, [esp+48] /* from += wsize */
- add esi, eax /* from += write */
- sub esi, ecx /* from -= nbytes */
- sub ecx, eax /* nbytes -= write */
-
- mov eax, [esp+64] /* eax = len */
- cmp eax, ecx
- jbe L_do_copy /* if (nbytes >= len) */
-
- sub eax, ecx /* len -= nbytes */
- rep movsb
- mov esi, [esp+28] /* from = window */
- mov ecx, [esp+52] /* nbytes = write */
- cmp eax, ecx
- jbe L_do_copy /* if (nbytes >= len) */
-
- sub eax, ecx /* len -= nbytes */
- rep movsb
- mov esi, edi
- sub esi, ebp /* from = out - dist */
- jmp L_do_copy
-
-ALIGN 4
-L_contiguous_in_window:
- add esi, eax
- sub esi, ecx /* from += write - nbytes */
-
- mov eax, [esp+64] /* eax = len */
- cmp eax, ecx
- jbe L_do_copy /* if (nbytes >= len) */
-
- sub eax, ecx /* len -= nbytes */
- rep movsb
- mov esi, edi
- sub esi, ebp /* from = out - dist */
- jmp L_do_copy
-
-ALIGN 4
-L_do_copy:
- mov ecx, eax
- rep movsb
-
- mov esi, [esp+8] /* move in back to %esi, toss from */
- mov ebp, [esp+32] /* ebp = lcode */
- jmp L_while_test
-
-L_test_for_end_of_block:
- test al, 32
- jz L_invalid_literal_length_code
- mov dword ptr [esp+72], 1
- jmp L_break_loop_with_status
-
-L_invalid_literal_length_code:
- mov dword ptr [esp+72], 2
- jmp L_break_loop_with_status
-
-L_invalid_distance_code:
- mov dword ptr [esp+72], 3
- jmp L_break_loop_with_status
-
-L_invalid_distance_too_far:
- mov esi, [esp+4]
- mov dword ptr [esp+72], 4
- jmp L_break_loop_with_status
-
-L_break_loop:
- mov dword ptr [esp+72], 0
-
-L_break_loop_with_status:
-/* put in, out, bits, and hold back into ar and pop esp */
- mov [esp+8], esi /* save in */
- mov [esp+16], edi /* save out */
- mov [esp+44], ebx /* save bits */
- mov [esp+40], edx /* save hold */
- mov ebp, [esp+4] /* restore esp, ebp */
- mov esp, [esp]
- }
-#else
-#error "x86 architecture not defined"
-#endif
-
- if (ar.status > 1) {
- if (ar.status == 2)
- strm->msg = "invalid literal/length code";
- else if (ar.status == 3)
- strm->msg = "invalid distance code";
- else
- strm->msg = "invalid distance too far back";
- state->mode = BAD;
- }
- else if ( ar.status == 1 ) {
- state->mode = TYPE;
- }
-
- /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
- ar.len = ar.bits >> 3;
- ar.in -= ar.len;
- ar.bits -= ar.len << 3;
- ar.hold &= (1U << ar.bits) - 1;
-
- /* update state and return */
- strm->next_in = ar.in;
- strm->next_out = ar.out;
- strm->avail_in = (unsigned)(ar.in < ar.last ?
- PAD_AVAIL_IN + (ar.last - ar.in) :
- PAD_AVAIL_IN - (ar.in - ar.last));
- strm->avail_out = (unsigned)(ar.out < ar.end ?
- PAD_AVAIL_OUT + (ar.end - ar.out) :
- PAD_AVAIL_OUT - (ar.out - ar.end));
- state->hold = ar.hold;
- state->bits = ar.bits;
- return;
-}
-
diff --git a/zlib/contrib/inflate86/inffast.S b/zlib/contrib/inflate86/inffast.S
deleted file mode 100644
index 2245a290..00000000
--- a/zlib/contrib/inflate86/inffast.S
+++ /dev/null
@@ -1,1368 +0,0 @@
-/*
- * inffast.S is a hand tuned assembler version of:
- *
- * inffast.c -- fast decoding
- * Copyright (C) 1995-2003 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Copyright (C) 2003 Chris Anderson <christop@charm.net>
- * Please use the copyright conditions above.
- *
- * This version (Jan-23-2003) of inflate_fast was coded and tested under
- * GNU/Linux on a pentium 3, using the gcc-3.2 compiler distribution. On that
- * machine, I found that gzip style archives decompressed about 20% faster than
- * the gcc-3.2 -O3 -fomit-frame-pointer compiled version. Your results will
- * depend on how large of a buffer is used for z_stream.next_in & next_out
- * (8K-32K worked best for my 256K cpu cache) and how much overhead there is in
- * stream processing I/O and crc32/addler32. In my case, this routine used
- * 70% of the cpu time and crc32 used 20%.
- *
- * I am confident that this version will work in the general case, but I have
- * not tested a wide variety of datasets or a wide variety of platforms.
- *
- * Jan-24-2003 -- Added -DUSE_MMX define for slightly faster inflating.
- * It should be a runtime flag instead of compile time flag...
- *
- * Jan-26-2003 -- Added runtime check for MMX support with cpuid instruction.
- * With -DUSE_MMX, only MMX code is compiled. With -DNO_MMX, only non-MMX code
- * is compiled. Without either option, runtime detection is enabled. Runtime
- * detection should work on all modern cpus and the recomended algorithm (flip
- * ID bit on eflags and then use the cpuid instruction) is used in many
- * multimedia applications. Tested under win2k with gcc-2.95 and gas-2.12
- * distributed with cygwin3. Compiling with gcc-2.95 -c inffast.S -o
- * inffast.obj generates a COFF object which can then be linked with MSVC++
- * compiled code. Tested under FreeBSD 4.7 with gcc-2.95.
- *
- * Jan-28-2003 -- Tested Athlon XP... MMX mode is slower than no MMX (and
- * slower than compiler generated code). Adjusted cpuid check to use the MMX
- * code only for Pentiums < P4 until I have more data on the P4. Speed
- * improvment is only about 15% on the Athlon when compared with code generated
- * with MSVC++. Not sure yet, but I think the P4 will also be slower using the
- * MMX mode because many of it's x86 ALU instructions execute in .5 cycles and
- * have less latency than MMX ops. Added code to buffer the last 11 bytes of
- * the input stream since the MMX code grabs bits in chunks of 32, which
- * differs from the inffast.c algorithm. I don't think there would have been
- * read overruns where a page boundary was crossed (a segfault), but there
- * could have been overruns when next_in ends on unaligned memory (unintialized
- * memory read).
- *
- * Mar-13-2003 -- P4 MMX is slightly slower than P4 NO_MMX. I created a C
- * version of the non-MMX code so that it doesn't depend on zstrm and zstate
- * structure offsets which are hard coded in this file. This was last tested
- * with zlib-1.2.0 which is currently in beta testing, newer versions of this
- * and inffas86.c can be found at http://www.eetbeetee.com/zlib/ and
- * http://www.charm.net/~christop/zlib/
- */
-
-
-/*
- * if you have underscore linking problems (_inflate_fast undefined), try
- * using -DGAS_COFF
- */
-#if ! defined( GAS_COFF ) && ! defined( GAS_ELF )
-
-#if defined( WIN32 ) || defined( __CYGWIN__ )
-#define GAS_COFF /* windows object format */
-#else
-#define GAS_ELF
-#endif
-
-#endif /* ! GAS_COFF && ! GAS_ELF */
-
-
-#if defined( GAS_COFF )
-
-/* coff externals have underscores */
-#define inflate_fast _inflate_fast
-#define inflate_fast_use_mmx _inflate_fast_use_mmx
-
-#endif /* GAS_COFF */
-
-
-.file "inffast.S"
-
-.globl inflate_fast
-
-.text
-.align 4,0
-.L_invalid_literal_length_code_msg:
-.string "invalid literal/length code"
-
-.align 4,0
-.L_invalid_distance_code_msg:
-.string "invalid distance code"
-
-.align 4,0
-.L_invalid_distance_too_far_msg:
-.string "invalid distance too far back"
-
-#if ! defined( NO_MMX )
-.align 4,0
-.L_mask: /* mask[N] = ( 1 << N ) - 1 */
-.long 0
-.long 1
-.long 3
-.long 7
-.long 15
-.long 31
-.long 63
-.long 127
-.long 255
-.long 511
-.long 1023
-.long 2047
-.long 4095
-.long 8191
-.long 16383
-.long 32767
-.long 65535
-.long 131071
-.long 262143
-.long 524287
-.long 1048575
-.long 2097151
-.long 4194303
-.long 8388607
-.long 16777215
-.long 33554431
-.long 67108863
-.long 134217727
-.long 268435455
-.long 536870911
-.long 1073741823
-.long 2147483647
-.long 4294967295
-#endif /* NO_MMX */
-
-.text
-
-/*
- * struct z_stream offsets, in zlib.h
- */
-#define next_in_strm 0 /* strm->next_in */
-#define avail_in_strm 4 /* strm->avail_in */
-#define next_out_strm 12 /* strm->next_out */
-#define avail_out_strm 16 /* strm->avail_out */
-#define msg_strm 24 /* strm->msg */
-#define state_strm 28 /* strm->state */
-
-/*
- * struct inflate_state offsets, in inflate.h
- */
-#define mode_state 0 /* state->mode */
-#define wsize_state 32 /* state->wsize */
-#define write_state 40 /* state->write */
-#define window_state 44 /* state->window */
-#define hold_state 48 /* state->hold */
-#define bits_state 52 /* state->bits */
-#define lencode_state 68 /* state->lencode */
-#define distcode_state 72 /* state->distcode */
-#define lenbits_state 76 /* state->lenbits */
-#define distbits_state 80 /* state->distbits */
-
-/*
- * inflate_fast's activation record
- */
-#define local_var_size 64 /* how much local space for vars */
-#define strm_sp 88 /* first arg: z_stream * (local_var_size + 24) */
-#define start_sp 92 /* second arg: unsigned int (local_var_size + 28) */
-
-/*
- * offsets for local vars on stack
- */
-#define out 60 /* unsigned char* */
-#define window 56 /* unsigned char* */
-#define wsize 52 /* unsigned int */
-#define write 48 /* unsigned int */
-#define in 44 /* unsigned char* */
-#define beg 40 /* unsigned char* */
-#define buf 28 /* char[ 12 ] */
-#define len 24 /* unsigned int */
-#define last 20 /* unsigned char* */
-#define end 16 /* unsigned char* */
-#define dcode 12 /* code* */
-#define lcode 8 /* code* */
-#define dmask 4 /* unsigned int */
-#define lmask 0 /* unsigned int */
-
-/*
- * typedef enum inflate_mode consts, in inflate.h
- */
-#define INFLATE_MODE_TYPE 11 /* state->mode flags enum-ed in inflate.h */
-#define INFLATE_MODE_BAD 26
-
-
-#if ! defined( USE_MMX ) && ! defined( NO_MMX )
-
-#define RUN_TIME_MMX
-
-#define CHECK_MMX 1
-#define DO_USE_MMX 2
-#define DONT_USE_MMX 3
-
-.globl inflate_fast_use_mmx
-
-.data
-
-.align 4,0
-inflate_fast_use_mmx: /* integer flag for run time control 1=check,2=mmx,3=no */
-.long CHECK_MMX
-
-#if defined( GAS_ELF )
-/* elf info */
-.type inflate_fast_use_mmx,@object
-.size inflate_fast_use_mmx,4
-#endif
-
-#endif /* RUN_TIME_MMX */
-
-#if defined( GAS_COFF )
-/* coff info: scl 2 = extern, type 32 = function */
-.def inflate_fast; .scl 2; .type 32; .endef
-#endif
-
-.text
-
-.align 32,0x90
-inflate_fast:
- pushl %edi
- pushl %esi
- pushl %ebp
- pushl %ebx
- pushf /* save eflags (strm_sp, state_sp assumes this is 32 bits) */
- subl $local_var_size, %esp
- cld
-
-#define strm_r %esi
-#define state_r %edi
-
- movl strm_sp(%esp), strm_r
- movl state_strm(strm_r), state_r
-
- /* in = strm->next_in;
- * out = strm->next_out;
- * last = in + strm->avail_in - 11;
- * beg = out - (start - strm->avail_out);
- * end = out + (strm->avail_out - 257);
- */
- movl avail_in_strm(strm_r), %edx
- movl next_in_strm(strm_r), %eax
-
- addl %eax, %edx /* avail_in += next_in */
- subl $11, %edx /* avail_in -= 11 */
-
- movl %eax, in(%esp)
- movl %edx, last(%esp)
-
- movl start_sp(%esp), %ebp
- movl avail_out_strm(strm_r), %ecx
- movl next_out_strm(strm_r), %ebx
-
- subl %ecx, %ebp /* start -= avail_out */
- negl %ebp /* start = -start */
- addl %ebx, %ebp /* start += next_out */
-
- subl $257, %ecx /* avail_out -= 257 */
- addl %ebx, %ecx /* avail_out += out */
-
- movl %ebx, out(%esp)
- movl %ebp, beg(%esp)
- movl %ecx, end(%esp)
-
- /* wsize = state->wsize;
- * write = state->write;
- * window = state->window;
- * hold = state->hold;
- * bits = state->bits;
- * lcode = state->lencode;
- * dcode = state->distcode;
- * lmask = ( 1 << state->lenbits ) - 1;
- * dmask = ( 1 << state->distbits ) - 1;
- */
-
- movl lencode_state(state_r), %eax
- movl distcode_state(state_r), %ecx
-
- movl %eax, lcode(%esp)
- movl %ecx, dcode(%esp)
-
- movl $1, %eax
- movl lenbits_state(state_r), %ecx
- shll %cl, %eax
- decl %eax
- movl %eax, lmask(%esp)
-
- movl $1, %eax
- movl distbits_state(state_r), %ecx
- shll %cl, %eax
- decl %eax
- movl %eax, dmask(%esp)
-
- movl wsize_state(state_r), %eax
- movl write_state(state_r), %ecx
- movl window_state(state_r), %edx
-
- movl %eax, wsize(%esp)
- movl %ecx, write(%esp)
- movl %edx, window(%esp)
-
- movl hold_state(state_r), %ebp
- movl bits_state(state_r), %ebx
-
-#undef strm_r
-#undef state_r
-
-#define in_r %esi
-#define from_r %esi
-#define out_r %edi
-
- movl in(%esp), in_r
- movl last(%esp), %ecx
- cmpl in_r, %ecx
- ja .L_align_long /* if in < last */
-
- addl $11, %ecx /* ecx = &in[ avail_in ] */
- subl in_r, %ecx /* ecx = avail_in */
- movl $12, %eax
- subl %ecx, %eax /* eax = 12 - avail_in */
- leal buf(%esp), %edi
- rep movsb /* memcpy( buf, in, avail_in ) */
- movl %eax, %ecx
- xorl %eax, %eax
- rep stosb /* memset( &buf[ avail_in ], 0, 12 - avail_in ) */
- leal buf(%esp), in_r /* in = buf */
- movl in_r, last(%esp) /* last = in, do just one iteration */
- jmp .L_is_aligned
-
- /* align in_r on long boundary */
-.L_align_long:
- testl $3, in_r
- jz .L_is_aligned
- xorl %eax, %eax
- movb (in_r), %al
- incl in_r
- movl %ebx, %ecx
- addl $8, %ebx
- shll %cl, %eax
- orl %eax, %ebp
- jmp .L_align_long
-
-.L_is_aligned:
- movl out(%esp), out_r
-
-#if defined( NO_MMX )
- jmp .L_do_loop
-#endif
-
-#if defined( USE_MMX )
- jmp .L_init_mmx
-#endif
-
-/*** Runtime MMX check ***/
-
-#if defined( RUN_TIME_MMX )
-.L_check_mmx:
- cmpl $DO_USE_MMX, inflate_fast_use_mmx
- je .L_init_mmx
- ja .L_do_loop /* > 2 */
-
- pushl %eax
- pushl %ebx
- pushl %ecx
- pushl %edx
- pushf
- movl (%esp), %eax /* copy eflags to eax */
- xorl $0x200000, (%esp) /* try toggling ID bit of eflags (bit 21)
- * to see if cpu supports cpuid...
- * ID bit method not supported by NexGen but
- * bios may load a cpuid instruction and
- * cpuid may be disabled on Cyrix 5-6x86 */
- popf
- pushf
- popl %edx /* copy new eflags to edx */
- xorl %eax, %edx /* test if ID bit is flipped */
- jz .L_dont_use_mmx /* not flipped if zero */
- xorl %eax, %eax
- cpuid
- cmpl $0x756e6547, %ebx /* check for GenuineIntel in ebx,ecx,edx */
- jne .L_dont_use_mmx
- cmpl $0x6c65746e, %ecx
- jne .L_dont_use_mmx
- cmpl $0x49656e69, %edx
- jne .L_dont_use_mmx
- movl $1, %eax
- cpuid /* get cpu features */
- shrl $8, %eax
- andl $15, %eax
- cmpl $6, %eax /* check for Pentium family, is 0xf for P4 */
- jne .L_dont_use_mmx
- testl $0x800000, %edx /* test if MMX feature is set (bit 23) */
- jnz .L_use_mmx
- jmp .L_dont_use_mmx
-.L_use_mmx:
- movl $DO_USE_MMX, inflate_fast_use_mmx
- jmp .L_check_mmx_pop
-.L_dont_use_mmx:
- movl $DONT_USE_MMX, inflate_fast_use_mmx
-.L_check_mmx_pop:
- popl %edx
- popl %ecx
- popl %ebx
- popl %eax
- jmp .L_check_mmx
-#endif
-
-
-/*** Non-MMX code ***/
-
-#if defined ( NO_MMX ) || defined( RUN_TIME_MMX )
-
-#define hold_r %ebp
-#define bits_r %bl
-#define bitslong_r %ebx
-
-.align 32,0x90
-.L_while_test:
- /* while (in < last && out < end)
- */
- cmpl out_r, end(%esp)
- jbe .L_break_loop /* if (out >= end) */
-
- cmpl in_r, last(%esp)
- jbe .L_break_loop
-
-.L_do_loop:
- /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out
- *
- * do {
- * if (bits < 15) {
- * hold |= *((unsigned short *)in)++ << bits;
- * bits += 16
- * }
- * this = lcode[hold & lmask]
- */
- cmpb $15, bits_r
- ja .L_get_length_code /* if (15 < bits) */
-
- xorl %eax, %eax
- lodsw /* al = *(ushort *)in++ */
- movb bits_r, %cl /* cl = bits, needs it for shifting */
- addb $16, bits_r /* bits += 16 */
- shll %cl, %eax
- orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */
-
-.L_get_length_code:
- movl lmask(%esp), %edx /* edx = lmask */
- movl lcode(%esp), %ecx /* ecx = lcode */
- andl hold_r, %edx /* edx &= hold */
- movl (%ecx,%edx,4), %eax /* eax = lcode[hold & lmask] */
-
-.L_dolen:
- /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out
- *
- * dolen:
- * bits -= this.bits;
- * hold >>= this.bits
- */
- movb %ah, %cl /* cl = this.bits */
- subb %ah, bits_r /* bits -= this.bits */
- shrl %cl, hold_r /* hold >>= this.bits */
-
- /* check if op is a literal
- * if (op == 0) {
- * PUP(out) = this.val;
- * }
- */
- testb %al, %al
- jnz .L_test_for_length_base /* if (op != 0) 45.7% */
-
- shrl $16, %eax /* output this.val char */
- stosb
- jmp .L_while_test
-
-.L_test_for_length_base:
- /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = len
- *
- * else if (op & 16) {
- * len = this.val
- * op &= 15
- * if (op) {
- * if (op > bits) {
- * hold |= *((unsigned short *)in)++ << bits;
- * bits += 16
- * }
- * len += hold & mask[op];
- * bits -= op;
- * hold >>= op;
- * }
- */
-#define len_r %edx
- movl %eax, len_r /* len = this */
- shrl $16, len_r /* len = this.val */
- movb %al, %cl
-
- testb $16, %al
- jz .L_test_for_second_level_length /* if ((op & 16) == 0) 8% */
- andb $15, %cl /* op &= 15 */
- jz .L_save_len /* if (!op) */
- cmpb %cl, bits_r
- jae .L_add_bits_to_len /* if (op <= bits) */
-
- movb %cl, %ch /* stash op in ch, freeing cl */
- xorl %eax, %eax
- lodsw /* al = *(ushort *)in++ */
- movb bits_r, %cl /* cl = bits, needs it for shifting */
- addb $16, bits_r /* bits += 16 */
- shll %cl, %eax
- orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */
- movb %ch, %cl /* move op back to ecx */
-
-.L_add_bits_to_len:
- movl $1, %eax
- shll %cl, %eax
- decl %eax
- subb %cl, bits_r
- andl hold_r, %eax /* eax &= hold */
- shrl %cl, hold_r
- addl %eax, len_r /* len += hold & mask[op] */
-
-.L_save_len:
- movl len_r, len(%esp) /* save len */
-#undef len_r
-
-.L_decode_distance:
- /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = dist
- *
- * if (bits < 15) {
- * hold |= *((unsigned short *)in)++ << bits;
- * bits += 16
- * }
- * this = dcode[hold & dmask];
- * dodist:
- * bits -= this.bits;
- * hold >>= this.bits;
- * op = this.op;
- */
-
- cmpb $15, bits_r
- ja .L_get_distance_code /* if (15 < bits) */
-
- xorl %eax, %eax
- lodsw /* al = *(ushort *)in++ */
- movb bits_r, %cl /* cl = bits, needs it for shifting */
- addb $16, bits_r /* bits += 16 */
- shll %cl, %eax
- orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */
-
-.L_get_distance_code:
- movl dmask(%esp), %edx /* edx = dmask */
- movl dcode(%esp), %ecx /* ecx = dcode */
- andl hold_r, %edx /* edx &= hold */
- movl (%ecx,%edx,4), %eax /* eax = dcode[hold & dmask] */
-
-#define dist_r %edx
-.L_dodist:
- movl %eax, dist_r /* dist = this */
- shrl $16, dist_r /* dist = this.val */
- movb %ah, %cl
- subb %ah, bits_r /* bits -= this.bits */
- shrl %cl, hold_r /* hold >>= this.bits */
-
- /* if (op & 16) {
- * dist = this.val
- * op &= 15
- * if (op > bits) {
- * hold |= *((unsigned short *)in)++ << bits;
- * bits += 16
- * }
- * dist += hold & mask[op];
- * bits -= op;
- * hold >>= op;
- */
- movb %al, %cl /* cl = this.op */
-
- testb $16, %al /* if ((op & 16) == 0) */
- jz .L_test_for_second_level_dist
- andb $15, %cl /* op &= 15 */
- jz .L_check_dist_one
- cmpb %cl, bits_r
- jae .L_add_bits_to_dist /* if (op <= bits) 97.6% */
-
- movb %cl, %ch /* stash op in ch, freeing cl */
- xorl %eax, %eax
- lodsw /* al = *(ushort *)in++ */
- movb bits_r, %cl /* cl = bits, needs it for shifting */
- addb $16, bits_r /* bits += 16 */
- shll %cl, %eax
- orl %eax, hold_r /* hold |= *((ushort *)in)++ << bits */
- movb %ch, %cl /* move op back to ecx */
-
-.L_add_bits_to_dist:
- movl $1, %eax
- shll %cl, %eax
- decl %eax /* (1 << op) - 1 */
- subb %cl, bits_r
- andl hold_r, %eax /* eax &= hold */
- shrl %cl, hold_r
- addl %eax, dist_r /* dist += hold & ((1 << op) - 1) */
- jmp .L_check_window
-
-.L_check_window:
- /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
- * %ecx = nbytes
- *
- * nbytes = out - beg;
- * if (dist <= nbytes) {
- * from = out - dist;
- * do {
- * PUP(out) = PUP(from);
- * } while (--len > 0) {
- * }
- */
-
- movl in_r, in(%esp) /* save in so from can use it's reg */
- movl out_r, %eax
- subl beg(%esp), %eax /* nbytes = out - beg */
-
- cmpl dist_r, %eax
- jb .L_clip_window /* if (dist > nbytes) 4.2% */
-
- movl len(%esp), %ecx
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
-
- subl $3, %ecx
- movb (from_r), %al
- movb %al, (out_r)
- movb 1(from_r), %al
- movb 2(from_r), %dl
- addl $3, from_r
- movb %al, 1(out_r)
- movb %dl, 2(out_r)
- addl $3, out_r
- rep movsb
-
- movl in(%esp), in_r /* move in back to %esi, toss from */
- jmp .L_while_test
-
-.align 16,0x90
-.L_check_dist_one:
- cmpl $1, dist_r
- jne .L_check_window
- cmpl out_r, beg(%esp)
- je .L_check_window
-
- decl out_r
- movl len(%esp), %ecx
- movb (out_r), %al
- subl $3, %ecx
-
- movb %al, 1(out_r)
- movb %al, 2(out_r)
- movb %al, 3(out_r)
- addl $4, out_r
- rep stosb
-
- jmp .L_while_test
-
-.align 16,0x90
-.L_test_for_second_level_length:
- /* else if ((op & 64) == 0) {
- * this = lcode[this.val + (hold & mask[op])];
- * }
- */
- testb $64, %al
- jnz .L_test_for_end_of_block /* if ((op & 64) != 0) */
-
- movl $1, %eax
- shll %cl, %eax
- decl %eax
- andl hold_r, %eax /* eax &= hold */
- addl %edx, %eax /* eax += this.val */
- movl lcode(%esp), %edx /* edx = lcode */
- movl (%edx,%eax,4), %eax /* eax = lcode[val + (hold&mask[op])] */
- jmp .L_dolen
-
-.align 16,0x90
-.L_test_for_second_level_dist:
- /* else if ((op & 64) == 0) {
- * this = dcode[this.val + (hold & mask[op])];
- * }
- */
- testb $64, %al
- jnz .L_invalid_distance_code /* if ((op & 64) != 0) */
-
- movl $1, %eax
- shll %cl, %eax
- decl %eax
- andl hold_r, %eax /* eax &= hold */
- addl %edx, %eax /* eax += this.val */
- movl dcode(%esp), %edx /* edx = dcode */
- movl (%edx,%eax,4), %eax /* eax = dcode[val + (hold&mask[op])] */
- jmp .L_dodist
-
-.align 16,0x90
-.L_clip_window:
- /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
- * %ecx = nbytes
- *
- * else {
- * if (dist > wsize) {
- * invalid distance
- * }
- * from = window;
- * nbytes = dist - nbytes;
- * if (write == 0) {
- * from += wsize - nbytes;
- */
-#define nbytes_r %ecx
- movl %eax, nbytes_r
- movl wsize(%esp), %eax /* prepare for dist compare */
- negl nbytes_r /* nbytes = -nbytes */
- movl window(%esp), from_r /* from = window */
-
- cmpl dist_r, %eax
- jb .L_invalid_distance_too_far /* if (dist > wsize) */
-
- addl dist_r, nbytes_r /* nbytes = dist - nbytes */
- cmpl $0, write(%esp)
- jne .L_wrap_around_window /* if (write != 0) */
-
- subl nbytes_r, %eax
- addl %eax, from_r /* from += wsize - nbytes */
-
- /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
- * %ecx = nbytes, %eax = len
- *
- * if (nbytes < len) {
- * len -= nbytes;
- * do {
- * PUP(out) = PUP(from);
- * } while (--nbytes);
- * from = out - dist;
- * }
- * }
- */
-#define len_r %eax
- movl len(%esp), len_r
- cmpl nbytes_r, len_r
- jbe .L_do_copy1 /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
- jmp .L_do_copy1
-
- cmpl nbytes_r, len_r
- jbe .L_do_copy1 /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
- jmp .L_do_copy1
-
-.L_wrap_around_window:
- /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
- * %ecx = nbytes, %eax = write, %eax = len
- *
- * else if (write < nbytes) {
- * from += wsize + write - nbytes;
- * nbytes -= write;
- * if (nbytes < len) {
- * len -= nbytes;
- * do {
- * PUP(out) = PUP(from);
- * } while (--nbytes);
- * from = window;
- * nbytes = write;
- * if (nbytes < len) {
- * len -= nbytes;
- * do {
- * PUP(out) = PUP(from);
- * } while(--nbytes);
- * from = out - dist;
- * }
- * }
- * }
- */
-#define write_r %eax
- movl write(%esp), write_r
- cmpl write_r, nbytes_r
- jbe .L_contiguous_in_window /* if (write >= nbytes) */
-
- addl wsize(%esp), from_r
- addl write_r, from_r
- subl nbytes_r, from_r /* from += wsize + write - nbytes */
- subl write_r, nbytes_r /* nbytes -= write */
-#undef write_r
-
- movl len(%esp), len_r
- cmpl nbytes_r, len_r
- jbe .L_do_copy1 /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl window(%esp), from_r /* from = window */
- movl write(%esp), nbytes_r /* nbytes = write */
- cmpl nbytes_r, len_r
- jbe .L_do_copy1 /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
- jmp .L_do_copy1
-
-.L_contiguous_in_window:
- /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
- * %ecx = nbytes, %eax = write, %eax = len
- *
- * else {
- * from += write - nbytes;
- * if (nbytes < len) {
- * len -= nbytes;
- * do {
- * PUP(out) = PUP(from);
- * } while (--nbytes);
- * from = out - dist;
- * }
- * }
- */
-#define write_r %eax
- addl write_r, from_r
- subl nbytes_r, from_r /* from += write - nbytes */
-#undef write_r
-
- movl len(%esp), len_r
- cmpl nbytes_r, len_r
- jbe .L_do_copy1 /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
-
-.L_do_copy1:
- /* regs: %esi = from, %esi = in, %ebp = hold, %bl = bits, %edi = out
- * %eax = len
- *
- * while (len > 0) {
- * PUP(out) = PUP(from);
- * len--;
- * }
- * }
- * } while (in < last && out < end);
- */
-#undef nbytes_r
-#define in_r %esi
- movl len_r, %ecx
- rep movsb
-
- movl in(%esp), in_r /* move in back to %esi, toss from */
- jmp .L_while_test
-
-#undef len_r
-#undef dist_r
-
-#endif /* NO_MMX || RUN_TIME_MMX */
-
-
-/*** MMX code ***/
-
-#if defined( USE_MMX ) || defined( RUN_TIME_MMX )
-
-.align 32,0x90
-.L_init_mmx:
- emms
-
-#undef bits_r
-#undef bitslong_r
-#define bitslong_r %ebp
-#define hold_mm %mm0
- movd %ebp, hold_mm
- movl %ebx, bitslong_r
-
-#define used_mm %mm1
-#define dmask2_mm %mm2
-#define lmask2_mm %mm3
-#define lmask_mm %mm4
-#define dmask_mm %mm5
-#define tmp_mm %mm6
-
- movd lmask(%esp), lmask_mm
- movq lmask_mm, lmask2_mm
- movd dmask(%esp), dmask_mm
- movq dmask_mm, dmask2_mm
- pxor used_mm, used_mm
- movl lcode(%esp), %ebx /* ebx = lcode */
- jmp .L_do_loop_mmx
-
-.align 32,0x90
-.L_while_test_mmx:
- /* while (in < last && out < end)
- */
- cmpl out_r, end(%esp)
- jbe .L_break_loop /* if (out >= end) */
-
- cmpl in_r, last(%esp)
- jbe .L_break_loop
-
-.L_do_loop_mmx:
- psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
-
- cmpl $32, bitslong_r
- ja .L_get_length_code_mmx /* if (32 < bits) */
-
- movd bitslong_r, tmp_mm
- movd (in_r), %mm7
- addl $4, in_r
- psllq tmp_mm, %mm7
- addl $32, bitslong_r
- por %mm7, hold_mm /* hold_mm |= *((uint *)in)++ << bits */
-
-.L_get_length_code_mmx:
- pand hold_mm, lmask_mm
- movd lmask_mm, %eax
- movq lmask2_mm, lmask_mm
- movl (%ebx,%eax,4), %eax /* eax = lcode[hold & lmask] */
-
-.L_dolen_mmx:
- movzbl %ah, %ecx /* ecx = this.bits */
- movd %ecx, used_mm
- subl %ecx, bitslong_r /* bits -= this.bits */
-
- testb %al, %al
- jnz .L_test_for_length_base_mmx /* if (op != 0) 45.7% */
-
- shrl $16, %eax /* output this.val char */
- stosb
- jmp .L_while_test_mmx
-
-.L_test_for_length_base_mmx:
-#define len_r %edx
- movl %eax, len_r /* len = this */
- shrl $16, len_r /* len = this.val */
-
- testb $16, %al
- jz .L_test_for_second_level_length_mmx /* if ((op & 16) == 0) 8% */
- andl $15, %eax /* op &= 15 */
- jz .L_decode_distance_mmx /* if (!op) */
-
- psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
- movd %eax, used_mm
- movd hold_mm, %ecx
- subl %eax, bitslong_r
- andl .L_mask(,%eax,4), %ecx
- addl %ecx, len_r /* len += hold & mask[op] */
-
-.L_decode_distance_mmx:
- psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
-
- cmpl $32, bitslong_r
- ja .L_get_dist_code_mmx /* if (32 < bits) */
-
- movd bitslong_r, tmp_mm
- movd (in_r), %mm7
- addl $4, in_r
- psllq tmp_mm, %mm7
- addl $32, bitslong_r
- por %mm7, hold_mm /* hold_mm |= *((uint *)in)++ << bits */
-
-.L_get_dist_code_mmx:
- movl dcode(%esp), %ebx /* ebx = dcode */
- pand hold_mm, dmask_mm
- movd dmask_mm, %eax
- movq dmask2_mm, dmask_mm
- movl (%ebx,%eax,4), %eax /* eax = dcode[hold & lmask] */
-
-.L_dodist_mmx:
-#define dist_r %ebx
- movzbl %ah, %ecx /* ecx = this.bits */
- movl %eax, dist_r
- shrl $16, dist_r /* dist = this.val */
- subl %ecx, bitslong_r /* bits -= this.bits */
- movd %ecx, used_mm
-
- testb $16, %al /* if ((op & 16) == 0) */
- jz .L_test_for_second_level_dist_mmx
- andl $15, %eax /* op &= 15 */
- jz .L_check_dist_one_mmx
-
-.L_add_bits_to_dist_mmx:
- psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
- movd %eax, used_mm /* save bit length of current op */
- movd hold_mm, %ecx /* get the next bits on input stream */
- subl %eax, bitslong_r /* bits -= op bits */
- andl .L_mask(,%eax,4), %ecx /* ecx = hold & mask[op] */
- addl %ecx, dist_r /* dist += hold & mask[op] */
-
-.L_check_window_mmx:
- movl in_r, in(%esp) /* save in so from can use it's reg */
- movl out_r, %eax
- subl beg(%esp), %eax /* nbytes = out - beg */
-
- cmpl dist_r, %eax
- jb .L_clip_window_mmx /* if (dist > nbytes) 4.2% */
-
- movl len_r, %ecx
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
-
- subl $3, %ecx
- movb (from_r), %al
- movb %al, (out_r)
- movb 1(from_r), %al
- movb 2(from_r), %dl
- addl $3, from_r
- movb %al, 1(out_r)
- movb %dl, 2(out_r)
- addl $3, out_r
- rep movsb
-
- movl in(%esp), in_r /* move in back to %esi, toss from */
- movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */
- jmp .L_while_test_mmx
-
-.align 16,0x90
-.L_check_dist_one_mmx:
- cmpl $1, dist_r
- jne .L_check_window_mmx
- cmpl out_r, beg(%esp)
- je .L_check_window_mmx
-
- decl out_r
- movl len_r, %ecx
- movb (out_r), %al
- subl $3, %ecx
-
- movb %al, 1(out_r)
- movb %al, 2(out_r)
- movb %al, 3(out_r)
- addl $4, out_r
- rep stosb
-
- movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */
- jmp .L_while_test_mmx
-
-.align 16,0x90
-.L_test_for_second_level_length_mmx:
- testb $64, %al
- jnz .L_test_for_end_of_block /* if ((op & 64) != 0) */
-
- andl $15, %eax
- psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
- movd hold_mm, %ecx
- andl .L_mask(,%eax,4), %ecx
- addl len_r, %ecx
- movl (%ebx,%ecx,4), %eax /* eax = lcode[hold & lmask] */
- jmp .L_dolen_mmx
-
-.align 16,0x90
-.L_test_for_second_level_dist_mmx:
- testb $64, %al
- jnz .L_invalid_distance_code /* if ((op & 64) != 0) */
-
- andl $15, %eax
- psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
- movd hold_mm, %ecx
- andl .L_mask(,%eax,4), %ecx
- movl dcode(%esp), %eax /* ecx = dcode */
- addl dist_r, %ecx
- movl (%eax,%ecx,4), %eax /* eax = lcode[hold & lmask] */
- jmp .L_dodist_mmx
-
-.align 16,0x90
-.L_clip_window_mmx:
-#define nbytes_r %ecx
- movl %eax, nbytes_r
- movl wsize(%esp), %eax /* prepare for dist compare */
- negl nbytes_r /* nbytes = -nbytes */
- movl window(%esp), from_r /* from = window */
-
- cmpl dist_r, %eax
- jb .L_invalid_distance_too_far /* if (dist > wsize) */
-
- addl dist_r, nbytes_r /* nbytes = dist - nbytes */
- cmpl $0, write(%esp)
- jne .L_wrap_around_window_mmx /* if (write != 0) */
-
- subl nbytes_r, %eax
- addl %eax, from_r /* from += wsize - nbytes */
-
- cmpl nbytes_r, len_r
- jbe .L_do_copy1_mmx /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
- jmp .L_do_copy1_mmx
-
- cmpl nbytes_r, len_r
- jbe .L_do_copy1_mmx /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
- jmp .L_do_copy1_mmx
-
-.L_wrap_around_window_mmx:
-#define write_r %eax
- movl write(%esp), write_r
- cmpl write_r, nbytes_r
- jbe .L_contiguous_in_window_mmx /* if (write >= nbytes) */
-
- addl wsize(%esp), from_r
- addl write_r, from_r
- subl nbytes_r, from_r /* from += wsize + write - nbytes */
- subl write_r, nbytes_r /* nbytes -= write */
-#undef write_r
-
- cmpl nbytes_r, len_r
- jbe .L_do_copy1_mmx /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl window(%esp), from_r /* from = window */
- movl write(%esp), nbytes_r /* nbytes = write */
- cmpl nbytes_r, len_r
- jbe .L_do_copy1_mmx /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
- jmp .L_do_copy1_mmx
-
-.L_contiguous_in_window_mmx:
-#define write_r %eax
- addl write_r, from_r
- subl nbytes_r, from_r /* from += write - nbytes */
-#undef write_r
-
- cmpl nbytes_r, len_r
- jbe .L_do_copy1_mmx /* if (nbytes >= len) */
-
- subl nbytes_r, len_r /* len -= nbytes */
- rep movsb
- movl out_r, from_r
- subl dist_r, from_r /* from = out - dist */
-
-.L_do_copy1_mmx:
-#undef nbytes_r
-#define in_r %esi
- movl len_r, %ecx
- rep movsb
-
- movl in(%esp), in_r /* move in back to %esi, toss from */
- movl lcode(%esp), %ebx /* move lcode back to %ebx, toss dist */
- jmp .L_while_test_mmx
-
-#undef hold_r
-#undef bitslong_r
-
-#endif /* USE_MMX || RUN_TIME_MMX */
-
-
-/*** USE_MMX, NO_MMX, and RUNTIME_MMX from here on ***/
-
-.L_invalid_distance_code:
- /* else {
- * strm->msg = "invalid distance code";
- * state->mode = BAD;
- * }
- */
- movl $.L_invalid_distance_code_msg, %ecx
- movl $INFLATE_MODE_BAD, %edx
- jmp .L_update_stream_state
-
-.L_test_for_end_of_block:
- /* else if (op & 32) {
- * state->mode = TYPE;
- * break;
- * }
- */
- testb $32, %al
- jz .L_invalid_literal_length_code /* if ((op & 32) == 0) */
-
- movl $0, %ecx
- movl $INFLATE_MODE_TYPE, %edx
- jmp .L_update_stream_state
-
-.L_invalid_literal_length_code:
- /* else {
- * strm->msg = "invalid literal/length code";
- * state->mode = BAD;
- * }
- */
- movl $.L_invalid_literal_length_code_msg, %ecx
- movl $INFLATE_MODE_BAD, %edx
- jmp .L_update_stream_state
-
-.L_invalid_distance_too_far:
- /* strm->msg = "invalid distance too far back";
- * state->mode = BAD;
- */
- movl in(%esp), in_r /* from_r has in's reg, put in back */
- movl $.L_invalid_distance_too_far_msg, %ecx
- movl $INFLATE_MODE_BAD, %edx
- jmp .L_update_stream_state
-
-.L_update_stream_state:
- /* set strm->msg = %ecx, strm->state->mode = %edx */
- movl strm_sp(%esp), %eax
- testl %ecx, %ecx /* if (msg != NULL) */
- jz .L_skip_msg
- movl %ecx, msg_strm(%eax) /* strm->msg = msg */
-.L_skip_msg:
- movl state_strm(%eax), %eax /* state = strm->state */
- movl %edx, mode_state(%eax) /* state->mode = edx (BAD | TYPE) */
- jmp .L_break_loop
-
-.align 32,0x90
-.L_break_loop:
-
-/*
- * Regs:
- *
- * bits = %ebp when mmx, and in %ebx when non-mmx
- * hold = %hold_mm when mmx, and in %ebp when non-mmx
- * in = %esi
- * out = %edi
- */
-
-#if defined( USE_MMX ) || defined( RUN_TIME_MMX )
-
-#if defined( RUN_TIME_MMX )
-
- cmpl $DO_USE_MMX, inflate_fast_use_mmx
- jne .L_update_next_in
-
-#endif /* RUN_TIME_MMX */
-
- movl %ebp, %ebx
-
-.L_update_next_in:
-
-#endif
-
-#define strm_r %eax
-#define state_r %edx
-
- /* len = bits >> 3;
- * in -= len;
- * bits -= len << 3;
- * hold &= (1U << bits) - 1;
- * state->hold = hold;
- * state->bits = bits;
- * strm->next_in = in;
- * strm->next_out = out;
- */
- movl strm_sp(%esp), strm_r
- movl %ebx, %ecx
- movl state_strm(strm_r), state_r
- shrl $3, %ecx
- subl %ecx, in_r
- shll $3, %ecx
- subl %ecx, %ebx
- movl out_r, next_out_strm(strm_r)
- movl %ebx, bits_state(state_r)
- movl %ebx, %ecx
-
- leal buf(%esp), %ebx
- cmpl %ebx, last(%esp)
- jne .L_buf_not_used /* if buf != last */
-
- subl %ebx, in_r /* in -= buf */
- movl next_in_strm(strm_r), %ebx
- movl %ebx, last(%esp) /* last = strm->next_in */
- addl %ebx, in_r /* in += strm->next_in */
- movl avail_in_strm(strm_r), %ebx
- subl $11, %ebx
- addl %ebx, last(%esp) /* last = &strm->next_in[ avail_in - 11 ] */
-
-.L_buf_not_used:
- movl in_r, next_in_strm(strm_r)
-
- movl $1, %ebx
- shll %cl, %ebx
- decl %ebx
-
-#if defined( USE_MMX ) || defined( RUN_TIME_MMX )
-
-#if defined( RUN_TIME_MMX )
-
- cmpl $DO_USE_MMX, inflate_fast_use_mmx
- jne .L_update_hold
-
-#endif /* RUN_TIME_MMX */
-
- psrlq used_mm, hold_mm /* hold_mm >>= last bit length */
- movd hold_mm, %ebp
-
- emms
-
-.L_update_hold:
-
-#endif /* USE_MMX || RUN_TIME_MMX */
-
- andl %ebx, %ebp
- movl %ebp, hold_state(state_r)
-
-#define last_r %ebx
-
- /* strm->avail_in = in < last ? 11 + (last - in) : 11 - (in - last) */
- movl last(%esp), last_r
- cmpl in_r, last_r
- jbe .L_last_is_smaller /* if (in >= last) */
-
- subl in_r, last_r /* last -= in */
- addl $11, last_r /* last += 11 */
- movl last_r, avail_in_strm(strm_r)
- jmp .L_fixup_out
-.L_last_is_smaller:
- subl last_r, in_r /* in -= last */
- negl in_r /* in = -in */
- addl $11, in_r /* in += 11 */
- movl in_r, avail_in_strm(strm_r)
-
-#undef last_r
-#define end_r %ebx
-
-.L_fixup_out:
- /* strm->avail_out = out < end ? 257 + (end - out) : 257 - (out - end)*/
- movl end(%esp), end_r
- cmpl out_r, end_r
- jbe .L_end_is_smaller /* if (out >= end) */
-
- subl out_r, end_r /* end -= out */
- addl $257, end_r /* end += 257 */
- movl end_r, avail_out_strm(strm_r)
- jmp .L_done
-.L_end_is_smaller:
- subl end_r, out_r /* out -= end */
- negl out_r /* out = -out */
- addl $257, out_r /* out += 257 */
- movl out_r, avail_out_strm(strm_r)
-
-#undef end_r
-#undef strm_r
-#undef state_r
-
-.L_done:
- addl $local_var_size, %esp
- popf
- popl %ebx
- popl %ebp
- popl %esi
- popl %edi
- ret
-
-#if defined( GAS_ELF )
-/* elf info */
-.type inflate_fast,@function
-.size inflate_fast,.-inflate_fast
-#endif
diff --git a/zlib/contrib/masmx64/bld_ml64.bat b/zlib/contrib/masmx64/bld_ml64.bat
deleted file mode 100644
index f74bcef5..00000000
--- a/zlib/contrib/masmx64/bld_ml64.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
-ml64.exe /Flgvmat64 /c /Zi gvmat64.asm
diff --git a/zlib/contrib/masmx64/gvmat64.asm b/zlib/contrib/masmx64/gvmat64.asm
deleted file mode 100644
index c1817f1b..00000000
--- a/zlib/contrib/masmx64/gvmat64.asm
+++ /dev/null
@@ -1,553 +0,0 @@
-;uInt longest_match_x64(
-; deflate_state *s,
-; IPos cur_match); /* current match */
-
-; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86_64
-; (AMD64 on Athlon 64, Opteron, Phenom
-; and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7)
-; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
-;
-; File written by Gilles Vollant, by converting to assembly the longest_match
-; from Jean-loup Gailly in deflate.c of zLib and infoZip zip.
-;
-; and by taking inspiration on asm686 with masm, optimised assembly code
-; from Brian Raiter, written 1998
-;
-; This software is provided 'as-is', without any express or implied
-; warranty. In no event will the authors be held liable for any damages
-; arising from the use of this software.
-;
-; Permission is granted to anyone to use this software for any purpose,
-; including commercial applications, and to alter it and redistribute it
-; freely, subject to the following restrictions:
-;
-; 1. The origin of this software must not be misrepresented; you must not
-; claim that you wrote the original software. If you use this software
-; in a product, an acknowledgment in the product documentation would be
-; appreciated but is not required.
-; 2. Altered source versions must be plainly marked as such, and must not be
-; misrepresented as being the original software
-; 3. This notice may not be removed or altered from any source distribution.
-;
-;
-;
-; http://www.zlib.net
-; http://www.winimage.com/zLibDll
-; http://www.muppetlabs.com/~breadbox/software/assembly.html
-;
-; to compile this file for infozip Zip, I use option:
-; ml64.exe /Flgvmat64 /c /Zi /DINFOZIP gvmat64.asm
-;
-; to compile this file for zLib, I use option:
-; ml64.exe /Flgvmat64 /c /Zi gvmat64.asm
-; Be carrefull to adapt zlib1222add below to your version of zLib
-; (if you use a version of zLib before 1.0.4 or after 1.2.2.2, change
-; value of zlib1222add later)
-;
-; This file compile with Microsoft Macro Assembler (x64) for AMD64
-;
-; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
-;
-; (you can get Windows WDK with ml64 for AMD64 from
-; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
-;
-
-
-;uInt longest_match(s, cur_match)
-; deflate_state *s;
-; IPos cur_match; /* current match */
-.code
-longest_match PROC
-
-
-;LocalVarsSize equ 88
- LocalVarsSize equ 72
-
-; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12
-; free register : r14,r15
-; register can be saved : rsp
-
- chainlenwmask equ rsp + 8 - LocalVarsSize ; high word: current chain len
- ; low word: s->wmask
-;window equ rsp + xx - LocalVarsSize ; local copy of s->window ; stored in r10
-;windowbestlen equ rsp + xx - LocalVarsSize ; s->window + bestlen , use r10+r11
-;scanstart equ rsp + xx - LocalVarsSize ; first two bytes of string ; stored in r12w
-;scanend equ rsp + xx - LocalVarsSize ; last two bytes of string use ebx
-;scanalign equ rsp + xx - LocalVarsSize ; dword-misalignment of string r13
-;bestlen equ rsp + xx - LocalVarsSize ; size of best match so far -> r11d
-;scan equ rsp + xx - LocalVarsSize ; ptr to string wanting match -> r9
-IFDEF INFOZIP
-ELSE
- nicematch equ (rsp + 16 - LocalVarsSize) ; a good enough match size
-ENDIF
-
-save_rdi equ rsp + 24 - LocalVarsSize
-save_rsi equ rsp + 32 - LocalVarsSize
-save_rbx equ rsp + 40 - LocalVarsSize
-save_rbp equ rsp + 48 - LocalVarsSize
-save_r12 equ rsp + 56 - LocalVarsSize
-save_r13 equ rsp + 64 - LocalVarsSize
-;save_r14 equ rsp + 72 - LocalVarsSize
-;save_r15 equ rsp + 80 - LocalVarsSize
-
-
-; summary of register usage
-; scanend ebx
-; scanendw bx
-; chainlenwmask edx
-; curmatch rsi
-; curmatchd esi
-; windowbestlen r8
-; scanalign r9
-; scanalignd r9d
-; window r10
-; bestlen r11
-; bestlend r11d
-; scanstart r12d
-; scanstartw r12w
-; scan r13
-; nicematch r14d
-; limit r15
-; limitd r15d
-; prev rcx
-
-; all the +4 offsets are due to the addition of pending_buf_size (in zlib
-; in the deflate_state structure since the asm code was first written
-; (if you compile with zlib 1.0.4 or older, remove the +4).
-; Note : these value are good with a 8 bytes boundary pack structure
-
-
- MAX_MATCH equ 258
- MIN_MATCH equ 3
- MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1)
-
-
-;;; Offsets for fields in the deflate_state structure. These numbers
-;;; are calculated from the definition of deflate_state, with the
-;;; assumption that the compiler will dword-align the fields. (Thus,
-;;; changing the definition of deflate_state could easily cause this
-;;; program to crash horribly, without so much as a warning at
-;;; compile time. Sigh.)
-
-; all the +zlib1222add offsets are due to the addition of fields
-; in zlib in the deflate_state structure since the asm code was first written
-; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
-; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
-; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
-
-
-IFDEF INFOZIP
-
-_DATA SEGMENT
-COMM window_size:DWORD
-; WMask ; 7fff
-COMM window:BYTE:010040H
-COMM prev:WORD:08000H
-; MatchLen : unused
-; PrevMatch : unused
-COMM strstart:DWORD
-COMM match_start:DWORD
-; Lookahead : ignore
-COMM prev_length:DWORD ; PrevLen
-COMM max_chain_length:DWORD
-COMM good_match:DWORD
-COMM nice_match:DWORD
-prev_ad equ OFFSET prev
-window_ad equ OFFSET window
-nicematch equ nice_match
-_DATA ENDS
-WMask equ 07fffh
-
-ELSE
-
- IFNDEF zlib1222add
- zlib1222add equ 8
- ENDIF
-dsWSize equ 56+zlib1222add+(zlib1222add/2)
-dsWMask equ 64+zlib1222add+(zlib1222add/2)
-dsWindow equ 72+zlib1222add
-dsPrev equ 88+zlib1222add
-dsMatchLen equ 128+zlib1222add
-dsPrevMatch equ 132+zlib1222add
-dsStrStart equ 140+zlib1222add
-dsMatchStart equ 144+zlib1222add
-dsLookahead equ 148+zlib1222add
-dsPrevLen equ 152+zlib1222add
-dsMaxChainLen equ 156+zlib1222add
-dsGoodMatch equ 172+zlib1222add
-dsNiceMatch equ 176+zlib1222add
-
-window_size equ [ rcx + dsWSize]
-WMask equ [ rcx + dsWMask]
-window_ad equ [ rcx + dsWindow]
-prev_ad equ [ rcx + dsPrev]
-strstart equ [ rcx + dsStrStart]
-match_start equ [ rcx + dsMatchStart]
-Lookahead equ [ rcx + dsLookahead] ; 0ffffffffh on infozip
-prev_length equ [ rcx + dsPrevLen]
-max_chain_length equ [ rcx + dsMaxChainLen]
-good_match equ [ rcx + dsGoodMatch]
-nice_match equ [ rcx + dsNiceMatch]
-ENDIF
-
-; parameter 1 in r8(deflate state s), param 2 in rdx (cur match)
-
-; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
-; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
-;
-; All registers must be preserved across the call, except for
-; rax, rcx, rdx, r8, r9, r10, and r11, which are scratch.
-
-
-
-;;; Save registers that the compiler may be using, and adjust esp to
-;;; make room for our stack frame.
-
-
-;;; Retrieve the function arguments. r8d will hold cur_match
-;;; throughout the entire function. edx will hold the pointer to the
-;;; deflate_state structure during the function's setup (before
-;;; entering the main loop.
-
-; parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match)
-
-; this clear high 32 bits of r8, which can be garbage in both r8 and rdx
-
- mov [save_rdi],rdi
- mov [save_rsi],rsi
- mov [save_rbx],rbx
- mov [save_rbp],rbp
-IFDEF INFOZIP
- mov r8d,ecx
-ELSE
- mov r8d,edx
-ENDIF
- mov [save_r12],r12
- mov [save_r13],r13
-; mov [save_r14],r14
-; mov [save_r15],r15
-
-
-;;; uInt wmask = s->w_mask;
-;;; unsigned chain_length = s->max_chain_length;
-;;; if (s->prev_length >= s->good_match) {
-;;; chain_length >>= 2;
-;;; }
-
- mov edi, prev_length
- mov esi, good_match
- mov eax, WMask
- mov ebx, max_chain_length
- cmp edi, esi
- jl LastMatchGood
- shr ebx, 2
-LastMatchGood:
-
-;;; chainlen is decremented once beforehand so that the function can
-;;; use the sign flag instead of the zero flag for the exit test.
-;;; It is then shifted into the high word, to make room for the wmask
-;;; value, which it will always accompany.
-
- dec ebx
- shl ebx, 16
- or ebx, eax
-
-;;; on zlib only
-;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-
-IFDEF INFOZIP
- mov [chainlenwmask], ebx
-; on infozip nice_match = [nice_match]
-ELSE
- mov eax, nice_match
- mov [chainlenwmask], ebx
- mov r10d, Lookahead
- cmp r10d, eax
- cmovnl r10d, eax
- mov [nicematch],r10d
-ENDIF
-
-;;; register Bytef *scan = s->window + s->strstart;
- mov r10, window_ad
- mov ebp, strstart
- lea r13, [r10 + rbp]
-
-;;; Determine how many bytes the scan ptr is off from being
-;;; dword-aligned.
-
- mov r9,r13
- neg r13
- and r13,3
-
-;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
-;;; s->strstart - (IPos)MAX_DIST(s) : NIL;
-IFDEF INFOZIP
- mov eax,07efah ; MAX_DIST = (WSIZE-MIN_LOOKAHEAD) (0x8000-(3+8+1))
-ELSE
- mov eax, window_size
- sub eax, MIN_LOOKAHEAD
-ENDIF
- xor edi,edi
- sub ebp, eax
-
- mov r11d, prev_length
-
- cmovng ebp,edi
-
-;;; int best_len = s->prev_length;
-
-
-;;; Store the sum of s->window + best_len in esi locally, and in esi.
-
- lea rsi,[r10+r11]
-
-;;; register ush scan_start = *(ushf*)scan;
-;;; register ush scan_end = *(ushf*)(scan+best_len-1);
-;;; Posf *prev = s->prev;
-
- movzx r12d,word ptr [r9]
- movzx ebx, word ptr [r9 + r11 - 1]
-
- mov rdi, prev_ad
-
-;;; Jump into the main loop.
-
- mov edx, [chainlenwmask]
-
- cmp bx,word ptr [rsi + r8 - 1]
- jz LookupLoopIsZero
-
-LookupLoop1:
- and r8d, edx
-
- movzx r8d, word ptr [rdi + r8*2]
- cmp r8d, ebp
- jbe LeaveNow
- sub edx, 00010000h
- js LeaveNow
-
-LoopEntry1:
- cmp bx,word ptr [rsi + r8 - 1]
- jz LookupLoopIsZero
-
-LookupLoop2:
- and r8d, edx
-
- movzx r8d, word ptr [rdi + r8*2]
- cmp r8d, ebp
- jbe LeaveNow
- sub edx, 00010000h
- js LeaveNow
-
-LoopEntry2:
- cmp bx,word ptr [rsi + r8 - 1]
- jz LookupLoopIsZero
-
-LookupLoop4:
- and r8d, edx
-
- movzx r8d, word ptr [rdi + r8*2]
- cmp r8d, ebp
- jbe LeaveNow
- sub edx, 00010000h
- js LeaveNow
-
-LoopEntry4:
-
- cmp bx,word ptr [rsi + r8 - 1]
- jnz LookupLoop1
- jmp LookupLoopIsZero
-
-
-;;; do {
-;;; match = s->window + cur_match;
-;;; if (*(ushf*)(match+best_len-1) != scan_end ||
-;;; *(ushf*)match != scan_start) continue;
-;;; [...]
-;;; } while ((cur_match = prev[cur_match & wmask]) > limit
-;;; && --chain_length != 0);
-;;;
-;;; Here is the inner loop of the function. The function will spend the
-;;; majority of its time in this loop, and majority of that time will
-;;; be spent in the first ten instructions.
-;;;
-;;; Within this loop:
-;;; ebx = scanend
-;;; r8d = curmatch
-;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
-;;; esi = windowbestlen - i.e., (window + bestlen)
-;;; edi = prev
-;;; ebp = limit
-
-LookupLoop:
- and r8d, edx
-
- movzx r8d, word ptr [rdi + r8*2]
- cmp r8d, ebp
- jbe LeaveNow
- sub edx, 00010000h
- js LeaveNow
-
-LoopEntry:
-
- cmp bx,word ptr [rsi + r8 - 1]
- jnz LookupLoop1
-LookupLoopIsZero:
- cmp r12w, word ptr [r10 + r8]
- jnz LookupLoop1
-
-
-;;; Store the current value of chainlen.
- mov [chainlenwmask], edx
-
-;;; Point edi to the string under scrutiny, and esi to the string we
-;;; are hoping to match it up with. In actuality, esi and edi are
-;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
-;;; initialized to -(MAX_MATCH_8 - scanalign).
-
- lea rsi,[r8+r10]
- mov rdx, 0fffffffffffffef8h; -(MAX_MATCH_8)
- lea rsi, [rsi + r13 + 0108h] ;MAX_MATCH_8]
- lea rdi, [r9 + r13 + 0108h] ;MAX_MATCH_8]
-
- prefetcht1 [rsi+rdx]
- prefetcht1 [rdi+rdx]
-
-
-;;; Test the strings for equality, 8 bytes at a time. At the end,
-;;; adjust rdx so that it is offset to the exact byte that mismatched.
-;;;
-;;; We already know at this point that the first three bytes of the
-;;; strings match each other, and they can be safely passed over before
-;;; starting the compare loop. So what this code does is skip over 0-3
-;;; bytes, as much as necessary in order to dword-align the edi
-;;; pointer. (rsi will still be misaligned three times out of four.)
-;;;
-;;; It should be confessed that this loop usually does not represent
-;;; much of the total running time. Replacing it with a more
-;;; straightforward "rep cmpsb" would not drastically degrade
-;;; performance.
-
-
-LoopCmps:
- mov rax, [rsi + rdx]
- xor rax, [rdi + rdx]
- jnz LeaveLoopCmps
-
- mov rax, [rsi + rdx + 8]
- xor rax, [rdi + rdx + 8]
- jnz LeaveLoopCmps8
-
-
- mov rax, [rsi + rdx + 8+8]
- xor rax, [rdi + rdx + 8+8]
- jnz LeaveLoopCmps16
-
- add rdx,8+8+8
-
- jnz short LoopCmps
- jmp short LenMaximum
-LeaveLoopCmps16: add rdx,8
-LeaveLoopCmps8: add rdx,8
-LeaveLoopCmps:
-
- test eax, 0000FFFFh
- jnz LenLower
-
- test eax,0ffffffffh
-
- jnz LenLower32
-
- add rdx,4
- shr rax,32
- or ax,ax
- jnz LenLower
-
-LenLower32:
- shr eax,16
- add rdx,2
-LenLower: sub al, 1
- adc rdx, 0
-;;; Calculate the length of the match. If it is longer than MAX_MATCH,
-;;; then automatically accept it as the best possible match and leave.
-
- lea rax, [rdi + rdx]
- sub rax, r9
- cmp eax, MAX_MATCH
- jge LenMaximum
-
-;;; If the length of the match is not longer than the best match we
-;;; have so far, then forget it and return to the lookup loop.
-;///////////////////////////////////
-
- cmp eax, r11d
- jg LongerMatch
-
- lea rsi,[r10+r11]
-
- mov rdi, prev_ad
- mov edx, [chainlenwmask]
- jmp LookupLoop
-
-;;; s->match_start = cur_match;
-;;; best_len = len;
-;;; if (len >= nice_match) break;
-;;; scan_end = *(ushf*)(scan+best_len-1);
-
-LongerMatch:
- mov r11d, eax
- mov match_start, r8d
- cmp eax, [nicematch]
- jge LeaveNow
-
- lea rsi,[r10+rax]
-
- movzx ebx, word ptr [r9 + rax - 1]
- mov rdi, prev_ad
- mov edx, [chainlenwmask]
- jmp LookupLoop
-
-;;; Accept the current string, with the maximum possible length.
-
-LenMaximum:
- mov r11d,MAX_MATCH
- mov match_start, r8d
-
-;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
-;;; return s->lookahead;
-
-LeaveNow:
-IFDEF INFOZIP
- mov eax,r11d
-ELSE
- mov eax, Lookahead
- cmp r11d, eax
- cmovng eax, r11d
-ENDIF
-
-;;; Restore the stack and return from whence we came.
-
-
- mov rsi,[save_rsi]
- mov rdi,[save_rdi]
- mov rbx,[save_rbx]
- mov rbp,[save_rbp]
- mov r12,[save_r12]
- mov r13,[save_r13]
-; mov r14,[save_r14]
-; mov r15,[save_r15]
-
-
- ret 0
-; please don't remove this string !
-; Your can freely use gvmat64 in any free or commercial app
-; but it is far better don't remove the string in the binary!
- db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0
-longest_match ENDP
-
-match_init PROC
- ret 0
-match_init ENDP
-
-
-END
diff --git a/zlib/contrib/masmx64/inffas8664.c b/zlib/contrib/masmx64/inffas8664.c
deleted file mode 100644
index aa861a33..00000000
--- a/zlib/contrib/masmx64/inffas8664.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/* inffas8664.c is a hand tuned assembler version of inffast.c - fast decoding
- * version for AMD64 on Windows using Microsoft C compiler
- *
- * Copyright (C) 1995-2003 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Copyright (C) 2003 Chris Anderson <christop@charm.net>
- * Please use the copyright conditions above.
- *
- * 2005 - Adaptation to Microsoft C Compiler for AMD64 by Gilles Vollant
- *
- * inffas8664.c call function inffas8664fnc in inffasx64.asm
- * inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
- *
- * Dec-29-2003 -- I added AMD64 inflate asm support. This version is also
- * slightly quicker on x86 systems because, instead of using rep movsb to copy
- * data, it uses rep movsw, which moves data in 2-byte chunks instead of single
- * bytes. I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates
- * from http://fedora.linux.duke.edu/fc1_x86_64
- * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with
- * 1GB ram. The 64-bit version is about 4% faster than the 32-bit version,
- * when decompressing mozilla-source-1.3.tar.gz.
- *
- * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
- * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at
- * the moment. I have successfully compiled and tested this code with gcc2.96,
- * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S
- * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
- * enabled. I will attempt to merge the MMX code into this version. Newer
- * versions of this and inffast.S can be found at
- * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
- *
- */
-
-#include <stdio.h>
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-/* Mark Adler's comments from inffast.c: */
-
-/*
- Decode literal, length, and distance codes and write out the resulting
- literal and match bytes until either not enough input or output is
- available, an end-of-block is encountered, or a data error is encountered.
- When large enough input and output buffers are supplied to inflate(), for
- example, a 16K input buffer and a 64K output buffer, more than 95% of the
- inflate execution time is spent in this routine.
-
- Entry assumptions:
-
- state->mode == LEN
- strm->avail_in >= 6
- strm->avail_out >= 258
- start >= strm->avail_out
- state->bits < 8
-
- On return, state->mode is one of:
-
- LEN -- ran out of enough output space or enough available input
- TYPE -- reached end of block code, inflate() to interpret next block
- BAD -- error in block data
-
- Notes:
-
- - The maximum input bits used by a length/distance pair is 15 bits for the
- length code, 5 bits for the length extra, 15 bits for the distance code,
- and 13 bits for the distance extra. This totals 48 bits, or six bytes.
- Therefore if strm->avail_in >= 6, then there is enough input to avoid
- checking for available input while decoding.
-
- - The maximum bytes that a single length/distance pair can output is 258
- bytes, which is the maximum length that can be coded. inflate_fast()
- requires strm->avail_out >= 258 for each loop to avoid checking for
- output space.
- */
-
-
-
- typedef struct inffast_ar {
-/* 64 32 x86 x86_64 */
-/* ar offset register */
-/* 0 0 */ void *esp; /* esp save */
-/* 8 4 */ void *ebp; /* ebp save */
-/* 16 8 */ unsigned char FAR *in; /* esi rsi local strm->next_in */
-/* 24 12 */ unsigned char FAR *last; /* r9 while in < last */
-/* 32 16 */ unsigned char FAR *out; /* edi rdi local strm->next_out */
-/* 40 20 */ unsigned char FAR *beg; /* inflate()'s init next_out */
-/* 48 24 */ unsigned char FAR *end; /* r10 while out < end */
-/* 56 28 */ unsigned char FAR *window;/* size of window, wsize!=0 */
-/* 64 32 */ code const FAR *lcode; /* ebp rbp local strm->lencode */
-/* 72 36 */ code const FAR *dcode; /* r11 local strm->distcode */
-/* 80 40 */ size_t /*unsigned long */hold; /* edx rdx local strm->hold */
-/* 88 44 */ unsigned bits; /* ebx rbx local strm->bits */
-/* 92 48 */ unsigned wsize; /* window size */
-/* 96 52 */ unsigned write; /* window write index */
-/*100 56 */ unsigned lmask; /* r12 mask for lcode */
-/*104 60 */ unsigned dmask; /* r13 mask for dcode */
-/*108 64 */ unsigned len; /* r14 match length */
-/*112 68 */ unsigned dist; /* r15 match distance */
-/*116 72 */ unsigned status; /* set when state chng*/
- } type_ar;
-#ifdef ASMINF
-
-void inflate_fast(strm, start)
-z_streamp strm;
-unsigned start; /* inflate()'s starting value for strm->avail_out */
-{
- struct inflate_state FAR *state;
- type_ar ar;
- void inffas8664fnc(struct inffast_ar * par);
-
-
-
-#if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64))
-#define PAD_AVAIL_IN 6
-#define PAD_AVAIL_OUT 258
-#else
-#define PAD_AVAIL_IN 5
-#define PAD_AVAIL_OUT 257
-#endif
-
- /* copy state to local variables */
- state = (struct inflate_state FAR *)strm->state;
-
- ar.in = strm->next_in;
- ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN);
- ar.out = strm->next_out;
- ar.beg = ar.out - (start - strm->avail_out);
- ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
- ar.wsize = state->wsize;
- ar.write = state->wnext;
- ar.window = state->window;
- ar.hold = state->hold;
- ar.bits = state->bits;
- ar.lcode = state->lencode;
- ar.dcode = state->distcode;
- ar.lmask = (1U << state->lenbits) - 1;
- ar.dmask = (1U << state->distbits) - 1;
-
- /* decode literals and length/distances until end-of-block or not enough
- input data or output space */
-
- /* align in on 1/2 hold size boundary */
- while (((size_t)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) {
- ar.hold += (unsigned long)*ar.in++ << ar.bits;
- ar.bits += 8;
- }
-
- inffas8664fnc(&ar);
-
- if (ar.status > 1) {
- if (ar.status == 2)
- strm->msg = "invalid literal/length code";
- else if (ar.status == 3)
- strm->msg = "invalid distance code";
- else
- strm->msg = "invalid distance too far back";
- state->mode = BAD;
- }
- else if ( ar.status == 1 ) {
- state->mode = TYPE;
- }
-
- /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
- ar.len = ar.bits >> 3;
- ar.in -= ar.len;
- ar.bits -= ar.len << 3;
- ar.hold &= (1U << ar.bits) - 1;
-
- /* update state and return */
- strm->next_in = ar.in;
- strm->next_out = ar.out;
- strm->avail_in = (unsigned)(ar.in < ar.last ?
- PAD_AVAIL_IN + (ar.last - ar.in) :
- PAD_AVAIL_IN - (ar.in - ar.last));
- strm->avail_out = (unsigned)(ar.out < ar.end ?
- PAD_AVAIL_OUT + (ar.end - ar.out) :
- PAD_AVAIL_OUT - (ar.out - ar.end));
- state->hold = (unsigned long)ar.hold;
- state->bits = ar.bits;
- return;
-}
-
-#endif
diff --git a/zlib/contrib/masmx64/inffasx64.asm b/zlib/contrib/masmx64/inffasx64.asm
deleted file mode 100644
index 41ec8239..00000000
--- a/zlib/contrib/masmx64/inffasx64.asm
+++ /dev/null
@@ -1,396 +0,0 @@
-; inffasx64.asm is a hand tuned assembler version of inffast.c - fast decoding
-; version for AMD64 on Windows using Microsoft C compiler
-;
-; inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
-; inffasx64.asm is called by inffas8664.c, which contain more info.
-
-
-; to compile this file, I use option
-; ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
-; with Microsoft Macro Assembler (x64) for AMD64
-;
-
-; This file compile with Microsoft Macro Assembler (x64) for AMD64
-;
-; ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
-;
-; (you can get Windows WDK with ml64 for AMD64 from
-; http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
-;
-
-
-.code
-inffas8664fnc PROC
-
-; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
-; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
-;
-; All registers must be preserved across the call, except for
-; rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch.
-
-
- mov [rsp-8],rsi
- mov [rsp-16],rdi
- mov [rsp-24],r12
- mov [rsp-32],r13
- mov [rsp-40],r14
- mov [rsp-48],r15
- mov [rsp-56],rbx
-
- mov rax,rcx
-
- mov [rax+8], rbp ; /* save regs rbp and rsp */
- mov [rax], rsp
-
- mov rsp, rax ; /* make rsp point to &ar */
-
- mov rsi, [rsp+16] ; /* rsi = in */
- mov rdi, [rsp+32] ; /* rdi = out */
- mov r9, [rsp+24] ; /* r9 = last */
- mov r10, [rsp+48] ; /* r10 = end */
- mov rbp, [rsp+64] ; /* rbp = lcode */
- mov r11, [rsp+72] ; /* r11 = dcode */
- mov rdx, [rsp+80] ; /* rdx = hold */
- mov ebx, [rsp+88] ; /* ebx = bits */
- mov r12d, [rsp+100] ; /* r12d = lmask */
- mov r13d, [rsp+104] ; /* r13d = dmask */
- ; /* r14d = len */
- ; /* r15d = dist */
-
-
- cld
- cmp r10, rdi
- je L_one_time ; /* if only one decode left */
- cmp r9, rsi
-
- jne L_do_loop
-
-
-L_one_time:
- mov r8, r12 ; /* r8 = lmask */
- cmp bl, 32
- ja L_get_length_code_one_time
-
- lodsd ; /* eax = *(uint *)in++ */
- mov cl, bl ; /* cl = bits, needs it for shifting */
- add bl, 32 ; /* bits += 32 */
- shl rax, cl
- or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
- jmp L_get_length_code_one_time
-
-ALIGN 4
-L_while_test:
- cmp r10, rdi
- jbe L_break_loop
- cmp r9, rsi
- jbe L_break_loop
-
-L_do_loop:
- mov r8, r12 ; /* r8 = lmask */
- cmp bl, 32
- ja L_get_length_code ; /* if (32 < bits) */
-
- lodsd ; /* eax = *(uint *)in++ */
- mov cl, bl ; /* cl = bits, needs it for shifting */
- add bl, 32 ; /* bits += 32 */
- shl rax, cl
- or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
-
-L_get_length_code:
- and r8, rdx ; /* r8 &= hold */
- mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */
-
- mov cl, ah ; /* cl = this.bits */
- sub bl, ah ; /* bits -= this.bits */
- shr rdx, cl ; /* hold >>= this.bits */
-
- test al, al
- jnz L_test_for_length_base ; /* if (op != 0) 45.7% */
-
- mov r8, r12 ; /* r8 = lmask */
- shr eax, 16 ; /* output this.val char */
- stosb
-
-L_get_length_code_one_time:
- and r8, rdx ; /* r8 &= hold */
- mov eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */
-
-L_dolen:
- mov cl, ah ; /* cl = this.bits */
- sub bl, ah ; /* bits -= this.bits */
- shr rdx, cl ; /* hold >>= this.bits */
-
- test al, al
- jnz L_test_for_length_base ; /* if (op != 0) 45.7% */
-
- shr eax, 16 ; /* output this.val char */
- stosb
- jmp L_while_test
-
-ALIGN 4
-L_test_for_length_base:
- mov r14d, eax ; /* len = this */
- shr r14d, 16 ; /* len = this.val */
- mov cl, al
-
- test al, 16
- jz L_test_for_second_level_length ; /* if ((op & 16) == 0) 8% */
- and cl, 15 ; /* op &= 15 */
- jz L_decode_distance ; /* if (!op) */
-
-L_add_bits_to_len:
- sub bl, cl
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx ; /* eax &= hold */
- shr rdx, cl
- add r14d, eax ; /* len += hold & mask[op] */
-
-L_decode_distance:
- mov r8, r13 ; /* r8 = dmask */
- cmp bl, 32
- ja L_get_distance_code ; /* if (32 < bits) */
-
- lodsd ; /* eax = *(uint *)in++ */
- mov cl, bl ; /* cl = bits, needs it for shifting */
- add bl, 32 ; /* bits += 32 */
- shl rax, cl
- or rdx, rax ; /* hold |= *((uint *)in)++ << bits */
-
-L_get_distance_code:
- and r8, rdx ; /* r8 &= hold */
- mov eax, [r11+r8*4] ; /* eax = dcode[hold & dmask] */
-
-L_dodist:
- mov r15d, eax ; /* dist = this */
- shr r15d, 16 ; /* dist = this.val */
- mov cl, ah
- sub bl, ah ; /* bits -= this.bits */
- shr rdx, cl ; /* hold >>= this.bits */
- mov cl, al ; /* cl = this.op */
-
- test al, 16 ; /* if ((op & 16) == 0) */
- jz L_test_for_second_level_dist
- and cl, 15 ; /* op &= 15 */
- jz L_check_dist_one
-
-L_add_bits_to_dist:
- sub bl, cl
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax ; /* (1 << op) - 1 */
- and eax, edx ; /* eax &= hold */
- shr rdx, cl
- add r15d, eax ; /* dist += hold & ((1 << op) - 1) */
-
-L_check_window:
- mov r8, rsi ; /* save in so from can use it's reg */
- mov rax, rdi
- sub rax, [rsp+40] ; /* nbytes = out - beg */
-
- cmp eax, r15d
- jb L_clip_window ; /* if (dist > nbytes) 4.2% */
-
- mov ecx, r14d ; /* ecx = len */
- mov rsi, rdi
- sub rsi, r15 ; /* from = out - dist */
-
- sar ecx, 1
- jnc L_copy_two ; /* if len % 2 == 0 */
-
- rep movsw
- mov al, [rsi]
- mov [rdi], al
- inc rdi
-
- mov rsi, r8 ; /* move in back to %rsi, toss from */
- jmp L_while_test
-
-L_copy_two:
- rep movsw
- mov rsi, r8 ; /* move in back to %rsi, toss from */
- jmp L_while_test
-
-ALIGN 4
-L_check_dist_one:
- cmp r15d, 1 ; /* if dist 1, is a memset */
- jne L_check_window
- cmp [rsp+40], rdi ; /* if out == beg, outside window */
- je L_check_window
-
- mov ecx, r14d ; /* ecx = len */
- mov al, [rdi-1]
- mov ah, al
-
- sar ecx, 1
- jnc L_set_two
- mov [rdi], al
- inc rdi
-
-L_set_two:
- rep stosw
- jmp L_while_test
-
-ALIGN 4
-L_test_for_second_level_length:
- test al, 64
- jnz L_test_for_end_of_block ; /* if ((op & 64) != 0) */
-
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx ; /* eax &= hold */
- add eax, r14d ; /* eax += len */
- mov eax, [rbp+rax*4] ; /* eax = lcode[val+(hold&mask[op])]*/
- jmp L_dolen
-
-ALIGN 4
-L_test_for_second_level_dist:
- test al, 64
- jnz L_invalid_distance_code ; /* if ((op & 64) != 0) */
-
- xor eax, eax
- inc eax
- shl eax, cl
- dec eax
- and eax, edx ; /* eax &= hold */
- add eax, r15d ; /* eax += dist */
- mov eax, [r11+rax*4] ; /* eax = dcode[val+(hold&mask[op])]*/
- jmp L_dodist
-
-ALIGN 4
-L_clip_window:
- mov ecx, eax ; /* ecx = nbytes */
- mov eax, [rsp+92] ; /* eax = wsize, prepare for dist cmp */
- neg ecx ; /* nbytes = -nbytes */
-
- cmp eax, r15d
- jb L_invalid_distance_too_far ; /* if (dist > wsize) */
-
- add ecx, r15d ; /* nbytes = dist - nbytes */
- cmp dword ptr [rsp+96], 0
- jne L_wrap_around_window ; /* if (write != 0) */
-
- mov rsi, [rsp+56] ; /* from = window */
- sub eax, ecx ; /* eax -= nbytes */
- add rsi, rax ; /* from += wsize - nbytes */
-
- mov eax, r14d ; /* eax = len */
- cmp r14d, ecx
- jbe L_do_copy ; /* if (nbytes >= len) */
-
- sub eax, ecx ; /* eax -= nbytes */
- rep movsb
- mov rsi, rdi
- sub rsi, r15 ; /* from = &out[ -dist ] */
- jmp L_do_copy
-
-ALIGN 4
-L_wrap_around_window:
- mov eax, [rsp+96] ; /* eax = write */
- cmp ecx, eax
- jbe L_contiguous_in_window ; /* if (write >= nbytes) */
-
- mov esi, [rsp+92] ; /* from = wsize */
- add rsi, [rsp+56] ; /* from += window */
- add rsi, rax ; /* from += write */
- sub rsi, rcx ; /* from -= nbytes */
- sub ecx, eax ; /* nbytes -= write */
-
- mov eax, r14d ; /* eax = len */
- cmp eax, ecx
- jbe L_do_copy ; /* if (nbytes >= len) */
-
- sub eax, ecx ; /* len -= nbytes */
- rep movsb
- mov rsi, [rsp+56] ; /* from = window */
- mov ecx, [rsp+96] ; /* nbytes = write */
- cmp eax, ecx
- jbe L_do_copy ; /* if (nbytes >= len) */
-
- sub eax, ecx ; /* len -= nbytes */
- rep movsb
- mov rsi, rdi
- sub rsi, r15 ; /* from = out - dist */
- jmp L_do_copy
-
-ALIGN 4
-L_contiguous_in_window:
- mov rsi, [rsp+56] ; /* rsi = window */
- add rsi, rax
- sub rsi, rcx ; /* from += write - nbytes */
-
- mov eax, r14d ; /* eax = len */
- cmp eax, ecx
- jbe L_do_copy ; /* if (nbytes >= len) */
-
- sub eax, ecx ; /* len -= nbytes */
- rep movsb
- mov rsi, rdi
- sub rsi, r15 ; /* from = out - dist */
- jmp L_do_copy ; /* if (nbytes >= len) */
-
-ALIGN 4
-L_do_copy:
- mov ecx, eax ; /* ecx = len */
- rep movsb
-
- mov rsi, r8 ; /* move in back to %esi, toss from */
- jmp L_while_test
-
-L_test_for_end_of_block:
- test al, 32
- jz L_invalid_literal_length_code
- mov dword ptr [rsp+116], 1
- jmp L_break_loop_with_status
-
-L_invalid_literal_length_code:
- mov dword ptr [rsp+116], 2
- jmp L_break_loop_with_status
-
-L_invalid_distance_code:
- mov dword ptr [rsp+116], 3
- jmp L_break_loop_with_status
-
-L_invalid_distance_too_far:
- mov dword ptr [rsp+116], 4
- jmp L_break_loop_with_status
-
-L_break_loop:
- mov dword ptr [rsp+116], 0
-
-L_break_loop_with_status:
-; /* put in, out, bits, and hold back into ar and pop esp */
- mov [rsp+16], rsi ; /* in */
- mov [rsp+32], rdi ; /* out */
- mov [rsp+88], ebx ; /* bits */
- mov [rsp+80], rdx ; /* hold */
-
- mov rax, [rsp] ; /* restore rbp and rsp */
- mov rbp, [rsp+8]
- mov rsp, rax
-
-
-
- mov rsi,[rsp-8]
- mov rdi,[rsp-16]
- mov r12,[rsp-24]
- mov r13,[rsp-32]
- mov r14,[rsp-40]
- mov r15,[rsp-48]
- mov rbx,[rsp-56]
-
- ret 0
-; :
-; : "m" (ar)
-; : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
-; "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
-; );
-
-inffas8664fnc ENDP
-;_TEXT ENDS
-END
diff --git a/zlib/contrib/masmx64/readme.txt b/zlib/contrib/masmx64/readme.txt
deleted file mode 100644
index 652571c7..00000000
--- a/zlib/contrib/masmx64/readme.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Summary
--------
-This directory contains ASM implementations of the functions
-longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t),
-for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits.
-
-gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits
- assembly optimized version from Jean-loup Gailly original longest_match function
-
-inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing
- original function from Mark Adler
-
-Use instructions
-----------------
-Assemble the .asm files using MASM and put the object files into the zlib source
-directory. You can also get object files here:
-
- http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
-
-define ASMV and ASMINF in your project. Include inffas8664.c in your source tree,
-and inffasx64.obj and gvmat64.obj as object to link.
-
-
-Build instructions
-------------------
-run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe)
-
-ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK
-
-You can get Windows 2003 server DDK with ml64 and cl for AMD64 from
- http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price)
diff --git a/zlib/contrib/masmx86/bld_ml32.bat b/zlib/contrib/masmx86/bld_ml32.bat
deleted file mode 100644
index fcf5755e..00000000
--- a/zlib/contrib/masmx86/bld_ml32.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-ml /coff /Zi /c /Flmatch686.lst match686.asm
-ml /coff /Zi /c /Flinffas32.lst inffas32.asm
diff --git a/zlib/contrib/masmx86/inffas32.asm b/zlib/contrib/masmx86/inffas32.asm
deleted file mode 100644
index cb37a81e..00000000
--- a/zlib/contrib/masmx86/inffas32.asm
+++ /dev/null
@@ -1,1080 +0,0 @@
-;/* inffas32.asm is a hand tuned assembler version of inffast.c -- fast decoding
-; *
-; * inffas32.asm is derivated from inffas86.c, with translation of assembly code
-; *
-; * Copyright (C) 1995-2003 Mark Adler
-; * For conditions of distribution and use, see copyright notice in zlib.h
-; *
-; * Copyright (C) 2003 Chris Anderson <christop@charm.net>
-; * Please use the copyright conditions above.
-; *
-; * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
-; * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at
-; * the moment. I have successfully compiled and tested this code with gcc2.96,
-; * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S
-; * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
-; * enabled. I will attempt to merge the MMX code into this version. Newer
-; * versions of this and inffast.S can be found at
-; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
-; *
-; * 2005 : modification by Gilles Vollant
-; */
-; For Visual C++ 4.x and higher and ML 6.x and higher
-; ml.exe is in directory \MASM611C of Win95 DDK
-; ml.exe is also distributed in http://www.masm32.com/masmdl.htm
-; and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/
-;
-;
-; compile with command line option
-; ml /coff /Zi /c /Flinffas32.lst inffas32.asm
-
-; if you define NO_GZIP (see inflate.h), compile with
-; ml /coff /Zi /c /Flinffas32.lst /DNO_GUNZIP inffas32.asm
-
-
-; zlib122sup is 0 fort zlib 1.2.2.1 and lower
-; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head
-; in inflate_state in inflate.h)
-zlib1222sup equ 8
-
-
-IFDEF GUNZIP
- INFLATE_MODE_TYPE equ 11
- INFLATE_MODE_BAD equ 26
-ELSE
- IFNDEF NO_GUNZIP
- INFLATE_MODE_TYPE equ 11
- INFLATE_MODE_BAD equ 26
- ELSE
- INFLATE_MODE_TYPE equ 3
- INFLATE_MODE_BAD equ 17
- ENDIF
-ENDIF
-
-
-; 75 "inffast.S"
-;FILE "inffast.S"
-
-;;;GLOBAL _inflate_fast
-
-;;;SECTION .text
-
-
-
- .586p
- .mmx
-
- name inflate_fast_x86
- .MODEL FLAT
-
-_DATA segment
-inflate_fast_use_mmx:
- dd 1
-
-
-_TEXT segment
-
-
-
-ALIGN 4
- db 'Fast decoding Code from Chris Anderson'
- db 0
-
-ALIGN 4
-invalid_literal_length_code_msg:
- db 'invalid literal/length code'
- db 0
-
-ALIGN 4
-invalid_distance_code_msg:
- db 'invalid distance code'
- db 0
-
-ALIGN 4
-invalid_distance_too_far_msg:
- db 'invalid distance too far back'
- db 0
-
-
-ALIGN 4
-inflate_fast_mask:
-dd 0
-dd 1
-dd 3
-dd 7
-dd 15
-dd 31
-dd 63
-dd 127
-dd 255
-dd 511
-dd 1023
-dd 2047
-dd 4095
-dd 8191
-dd 16383
-dd 32767
-dd 65535
-dd 131071
-dd 262143
-dd 524287
-dd 1048575
-dd 2097151
-dd 4194303
-dd 8388607
-dd 16777215
-dd 33554431
-dd 67108863
-dd 134217727
-dd 268435455
-dd 536870911
-dd 1073741823
-dd 2147483647
-dd 4294967295
-
-
-mode_state equ 0 ;/* state->mode */
-wsize_state equ (32+zlib1222sup) ;/* state->wsize */
-write_state equ (36+4+zlib1222sup) ;/* state->write */
-window_state equ (40+4+zlib1222sup) ;/* state->window */
-hold_state equ (44+4+zlib1222sup) ;/* state->hold */
-bits_state equ (48+4+zlib1222sup) ;/* state->bits */
-lencode_state equ (64+4+zlib1222sup) ;/* state->lencode */
-distcode_state equ (68+4+zlib1222sup) ;/* state->distcode */
-lenbits_state equ (72+4+zlib1222sup) ;/* state->lenbits */
-distbits_state equ (76+4+zlib1222sup) ;/* state->distbits */
-
-
-;;SECTION .text
-; 205 "inffast.S"
-;GLOBAL inflate_fast_use_mmx
-
-;SECTION .data
-
-
-; GLOBAL inflate_fast_use_mmx:object
-;.size inflate_fast_use_mmx, 4
-; 226 "inffast.S"
-;SECTION .text
-
-ALIGN 4
-_inflate_fast proc near
-.FPO (16, 4, 0, 0, 1, 0)
- push edi
- push esi
- push ebp
- push ebx
- pushfd
- sub esp,64
- cld
-
-
-
-
- mov esi, [esp+88]
- mov edi, [esi+28]
-
-
-
-
-
-
-
- mov edx, [esi+4]
- mov eax, [esi+0]
-
- add edx,eax
- sub edx,11
-
- mov [esp+44],eax
- mov [esp+20],edx
-
- mov ebp, [esp+92]
- mov ecx, [esi+16]
- mov ebx, [esi+12]
-
- sub ebp,ecx
- neg ebp
- add ebp,ebx
-
- sub ecx,257
- add ecx,ebx
-
- mov [esp+60],ebx
- mov [esp+40],ebp
- mov [esp+16],ecx
-; 285 "inffast.S"
- mov eax, [edi+lencode_state]
- mov ecx, [edi+distcode_state]
-
- mov [esp+8],eax
- mov [esp+12],ecx
-
- mov eax,1
- mov ecx, [edi+lenbits_state]
- shl eax,cl
- dec eax
- mov [esp+0],eax
-
- mov eax,1
- mov ecx, [edi+distbits_state]
- shl eax,cl
- dec eax
- mov [esp+4],eax
-
- mov eax, [edi+wsize_state]
- mov ecx, [edi+write_state]
- mov edx, [edi+window_state]
-
- mov [esp+52],eax
- mov [esp+48],ecx
- mov [esp+56],edx
-
- mov ebp, [edi+hold_state]
- mov ebx, [edi+bits_state]
-; 321 "inffast.S"
- mov esi, [esp+44]
- mov ecx, [esp+20]
- cmp ecx,esi
- ja L_align_long
-
- add ecx,11
- sub ecx,esi
- mov eax,12
- sub eax,ecx
- lea edi, [esp+28]
- rep movsb
- mov ecx,eax
- xor eax,eax
- rep stosb
- lea esi, [esp+28]
- mov [esp+20],esi
- jmp L_is_aligned
-
-
-L_align_long:
- test esi,3
- jz L_is_aligned
- xor eax,eax
- mov al, [esi]
- inc esi
- mov ecx,ebx
- add ebx,8
- shl eax,cl
- or ebp,eax
- jmp L_align_long
-
-L_is_aligned:
- mov edi, [esp+60]
-; 366 "inffast.S"
-L_check_mmx:
- cmp dword ptr [inflate_fast_use_mmx],2
- je L_init_mmx
- ja L_do_loop
-
- push eax
- push ebx
- push ecx
- push edx
- pushfd
- mov eax, [esp]
- xor dword ptr [esp],0200000h
-
-
-
-
- popfd
- pushfd
- pop edx
- xor edx,eax
- jz L_dont_use_mmx
- xor eax,eax
- cpuid
- cmp ebx,0756e6547h
- jne L_dont_use_mmx
- cmp ecx,06c65746eh
- jne L_dont_use_mmx
- cmp edx,049656e69h
- jne L_dont_use_mmx
- mov eax,1
- cpuid
- shr eax,8
- and eax,15
- cmp eax,6
- jne L_dont_use_mmx
- test edx,0800000h
- jnz L_use_mmx
- jmp L_dont_use_mmx
-L_use_mmx:
- mov dword ptr [inflate_fast_use_mmx],2
- jmp L_check_mmx_pop
-L_dont_use_mmx:
- mov dword ptr [inflate_fast_use_mmx],3
-L_check_mmx_pop:
- pop edx
- pop ecx
- pop ebx
- pop eax
- jmp L_check_mmx
-; 426 "inffast.S"
-ALIGN 4
-L_do_loop:
-; 437 "inffast.S"
- cmp bl,15
- ja L_get_length_code
-
- xor eax,eax
- lodsw
- mov cl,bl
- add bl,16
- shl eax,cl
- or ebp,eax
-
-L_get_length_code:
- mov edx, [esp+0]
- mov ecx, [esp+8]
- and edx,ebp
- mov eax, [ecx+edx*4]
-
-L_dolen:
-
-
-
-
-
-
- mov cl,ah
- sub bl,ah
- shr ebp,cl
-
-
-
-
-
-
- test al,al
- jnz L_test_for_length_base
-
- shr eax,16
- stosb
-
-L_while_test:
-
-
- cmp [esp+16],edi
- jbe L_break_loop
-
- cmp [esp+20],esi
- ja L_do_loop
- jmp L_break_loop
-
-L_test_for_length_base:
-; 502 "inffast.S"
- mov edx,eax
- shr edx,16
- mov cl,al
-
- test al,16
- jz L_test_for_second_level_length
- and cl,15
- jz L_save_len
- cmp bl,cl
- jae L_add_bits_to_len
-
- mov ch,cl
- xor eax,eax
- lodsw
- mov cl,bl
- add bl,16
- shl eax,cl
- or ebp,eax
- mov cl,ch
-
-L_add_bits_to_len:
- mov eax,1
- shl eax,cl
- dec eax
- sub bl,cl
- and eax,ebp
- shr ebp,cl
- add edx,eax
-
-L_save_len:
- mov [esp+24],edx
-
-
-L_decode_distance:
-; 549 "inffast.S"
- cmp bl,15
- ja L_get_distance_code
-
- xor eax,eax
- lodsw
- mov cl,bl
- add bl,16
- shl eax,cl
- or ebp,eax
-
-L_get_distance_code:
- mov edx, [esp+4]
- mov ecx, [esp+12]
- and edx,ebp
- mov eax, [ecx+edx*4]
-
-
-L_dodist:
- mov edx,eax
- shr edx,16
- mov cl,ah
- sub bl,ah
- shr ebp,cl
-; 584 "inffast.S"
- mov cl,al
-
- test al,16
- jz L_test_for_second_level_dist
- and cl,15
- jz L_check_dist_one
- cmp bl,cl
- jae L_add_bits_to_dist
-
- mov ch,cl
- xor eax,eax
- lodsw
- mov cl,bl
- add bl,16
- shl eax,cl
- or ebp,eax
- mov cl,ch
-
-L_add_bits_to_dist:
- mov eax,1
- shl eax,cl
- dec eax
- sub bl,cl
- and eax,ebp
- shr ebp,cl
- add edx,eax
- jmp L_check_window
-
-L_check_window:
-; 625 "inffast.S"
- mov [esp+44],esi
- mov eax,edi
- sub eax, [esp+40]
-
- cmp eax,edx
- jb L_clip_window
-
- mov ecx, [esp+24]
- mov esi,edi
- sub esi,edx
-
- sub ecx,3
- mov al, [esi]
- mov [edi],al
- mov al, [esi+1]
- mov dl, [esi+2]
- add esi,3
- mov [edi+1],al
- mov [edi+2],dl
- add edi,3
- rep movsb
-
- mov esi, [esp+44]
- jmp L_while_test
-
-ALIGN 4
-L_check_dist_one:
- cmp edx,1
- jne L_check_window
- cmp [esp+40],edi
- je L_check_window
-
- dec edi
- mov ecx, [esp+24]
- mov al, [edi]
- sub ecx,3
-
- mov [edi+1],al
- mov [edi+2],al
- mov [edi+3],al
- add edi,4
- rep stosb
-
- jmp L_while_test
-
-ALIGN 4
-L_test_for_second_level_length:
-
-
-
-
- test al,64
- jnz L_test_for_end_of_block
-
- mov eax,1
- shl eax,cl
- dec eax
- and eax,ebp
- add eax,edx
- mov edx, [esp+8]
- mov eax, [edx+eax*4]
- jmp L_dolen
-
-ALIGN 4
-L_test_for_second_level_dist:
-
-
-
-
- test al,64
- jnz L_invalid_distance_code
-
- mov eax,1
- shl eax,cl
- dec eax
- and eax,ebp
- add eax,edx
- mov edx, [esp+12]
- mov eax, [edx+eax*4]
- jmp L_dodist
-
-ALIGN 4
-L_clip_window:
-; 721 "inffast.S"
- mov ecx,eax
- mov eax, [esp+52]
- neg ecx
- mov esi, [esp+56]
-
- cmp eax,edx
- jb L_invalid_distance_too_far
-
- add ecx,edx
- cmp dword ptr [esp+48],0
- jne L_wrap_around_window
-
- sub eax,ecx
- add esi,eax
-; 749 "inffast.S"
- mov eax, [esp+24]
- cmp eax,ecx
- jbe L_do_copy1
-
- sub eax,ecx
- rep movsb
- mov esi,edi
- sub esi,edx
- jmp L_do_copy1
-
- cmp eax,ecx
- jbe L_do_copy1
-
- sub eax,ecx
- rep movsb
- mov esi,edi
- sub esi,edx
- jmp L_do_copy1
-
-L_wrap_around_window:
-; 793 "inffast.S"
- mov eax, [esp+48]
- cmp ecx,eax
- jbe L_contiguous_in_window
-
- add esi, [esp+52]
- add esi,eax
- sub esi,ecx
- sub ecx,eax
-
-
- mov eax, [esp+24]
- cmp eax,ecx
- jbe L_do_copy1
-
- sub eax,ecx
- rep movsb
- mov esi, [esp+56]
- mov ecx, [esp+48]
- cmp eax,ecx
- jbe L_do_copy1
-
- sub eax,ecx
- rep movsb
- mov esi,edi
- sub esi,edx
- jmp L_do_copy1
-
-L_contiguous_in_window:
-; 836 "inffast.S"
- add esi,eax
- sub esi,ecx
-
-
- mov eax, [esp+24]
- cmp eax,ecx
- jbe L_do_copy1
-
- sub eax,ecx
- rep movsb
- mov esi,edi
- sub esi,edx
-
-L_do_copy1:
-; 862 "inffast.S"
- mov ecx,eax
- rep movsb
-
- mov esi, [esp+44]
- jmp L_while_test
-; 878 "inffast.S"
-ALIGN 4
-L_init_mmx:
- emms
-
-
-
-
-
- movd mm0,ebp
- mov ebp,ebx
-; 896 "inffast.S"
- movd mm4,dword ptr [esp+0]
- movq mm3,mm4
- movd mm5,dword ptr [esp+4]
- movq mm2,mm5
- pxor mm1,mm1
- mov ebx, [esp+8]
- jmp L_do_loop_mmx
-
-ALIGN 4
-L_do_loop_mmx:
- psrlq mm0,mm1
-
- cmp ebp,32
- ja L_get_length_code_mmx
-
- movd mm6,ebp
- movd mm7,dword ptr [esi]
- add esi,4
- psllq mm7,mm6
- add ebp,32
- por mm0,mm7
-
-L_get_length_code_mmx:
- pand mm4,mm0
- movd eax,mm4
- movq mm4,mm3
- mov eax, [ebx+eax*4]
-
-L_dolen_mmx:
- movzx ecx,ah
- movd mm1,ecx
- sub ebp,ecx
-
- test al,al
- jnz L_test_for_length_base_mmx
-
- shr eax,16
- stosb
-
-L_while_test_mmx:
-
-
- cmp [esp+16],edi
- jbe L_break_loop
-
- cmp [esp+20],esi
- ja L_do_loop_mmx
- jmp L_break_loop
-
-L_test_for_length_base_mmx:
-
- mov edx,eax
- shr edx,16
-
- test al,16
- jz L_test_for_second_level_length_mmx
- and eax,15
- jz L_decode_distance_mmx
-
- psrlq mm0,mm1
- movd mm1,eax
- movd ecx,mm0
- sub ebp,eax
- and ecx, [inflate_fast_mask+eax*4]
- add edx,ecx
-
-L_decode_distance_mmx:
- psrlq mm0,mm1
-
- cmp ebp,32
- ja L_get_dist_code_mmx
-
- movd mm6,ebp
- movd mm7,dword ptr [esi]
- add esi,4
- psllq mm7,mm6
- add ebp,32
- por mm0,mm7
-
-L_get_dist_code_mmx:
- mov ebx, [esp+12]
- pand mm5,mm0
- movd eax,mm5
- movq mm5,mm2
- mov eax, [ebx+eax*4]
-
-L_dodist_mmx:
-
- movzx ecx,ah
- mov ebx,eax
- shr ebx,16
- sub ebp,ecx
- movd mm1,ecx
-
- test al,16
- jz L_test_for_second_level_dist_mmx
- and eax,15
- jz L_check_dist_one_mmx
-
-L_add_bits_to_dist_mmx:
- psrlq mm0,mm1
- movd mm1,eax
- movd ecx,mm0
- sub ebp,eax
- and ecx, [inflate_fast_mask+eax*4]
- add ebx,ecx
-
-L_check_window_mmx:
- mov [esp+44],esi
- mov eax,edi
- sub eax, [esp+40]
-
- cmp eax,ebx
- jb L_clip_window_mmx
-
- mov ecx,edx
- mov esi,edi
- sub esi,ebx
-
- sub ecx,3
- mov al, [esi]
- mov [edi],al
- mov al, [esi+1]
- mov dl, [esi+2]
- add esi,3
- mov [edi+1],al
- mov [edi+2],dl
- add edi,3
- rep movsb
-
- mov esi, [esp+44]
- mov ebx, [esp+8]
- jmp L_while_test_mmx
-
-ALIGN 4
-L_check_dist_one_mmx:
- cmp ebx,1
- jne L_check_window_mmx
- cmp [esp+40],edi
- je L_check_window_mmx
-
- dec edi
- mov ecx,edx
- mov al, [edi]
- sub ecx,3
-
- mov [edi+1],al
- mov [edi+2],al
- mov [edi+3],al
- add edi,4
- rep stosb
-
- mov ebx, [esp+8]
- jmp L_while_test_mmx
-
-ALIGN 4
-L_test_for_second_level_length_mmx:
- test al,64
- jnz L_test_for_end_of_block
-
- and eax,15
- psrlq mm0,mm1
- movd ecx,mm0
- and ecx, [inflate_fast_mask+eax*4]
- add ecx,edx
- mov eax, [ebx+ecx*4]
- jmp L_dolen_mmx
-
-ALIGN 4
-L_test_for_second_level_dist_mmx:
- test al,64
- jnz L_invalid_distance_code
-
- and eax,15
- psrlq mm0,mm1
- movd ecx,mm0
- and ecx, [inflate_fast_mask+eax*4]
- mov eax, [esp+12]
- add ecx,ebx
- mov eax, [eax+ecx*4]
- jmp L_dodist_mmx
-
-ALIGN 4
-L_clip_window_mmx:
-
- mov ecx,eax
- mov eax, [esp+52]
- neg ecx
- mov esi, [esp+56]
-
- cmp eax,ebx
- jb L_invalid_distance_too_far
-
- add ecx,ebx
- cmp dword ptr [esp+48],0
- jne L_wrap_around_window_mmx
-
- sub eax,ecx
- add esi,eax
-
- cmp edx,ecx
- jbe L_do_copy1_mmx
-
- sub edx,ecx
- rep movsb
- mov esi,edi
- sub esi,ebx
- jmp L_do_copy1_mmx
-
- cmp edx,ecx
- jbe L_do_copy1_mmx
-
- sub edx,ecx
- rep movsb
- mov esi,edi
- sub esi,ebx
- jmp L_do_copy1_mmx
-
-L_wrap_around_window_mmx:
-
- mov eax, [esp+48]
- cmp ecx,eax
- jbe L_contiguous_in_window_mmx
-
- add esi, [esp+52]
- add esi,eax
- sub esi,ecx
- sub ecx,eax
-
-
- cmp edx,ecx
- jbe L_do_copy1_mmx
-
- sub edx,ecx
- rep movsb
- mov esi, [esp+56]
- mov ecx, [esp+48]
- cmp edx,ecx
- jbe L_do_copy1_mmx
-
- sub edx,ecx
- rep movsb
- mov esi,edi
- sub esi,ebx
- jmp L_do_copy1_mmx
-
-L_contiguous_in_window_mmx:
-
- add esi,eax
- sub esi,ecx
-
-
- cmp edx,ecx
- jbe L_do_copy1_mmx
-
- sub edx,ecx
- rep movsb
- mov esi,edi
- sub esi,ebx
-
-L_do_copy1_mmx:
-
-
- mov ecx,edx
- rep movsb
-
- mov esi, [esp+44]
- mov ebx, [esp+8]
- jmp L_while_test_mmx
-; 1174 "inffast.S"
-L_invalid_distance_code:
-
-
-
-
-
- mov ecx, invalid_distance_code_msg
- mov edx,INFLATE_MODE_BAD
- jmp L_update_stream_state
-
-L_test_for_end_of_block:
-
-
-
-
-
- test al,32
- jz L_invalid_literal_length_code
-
- mov ecx,0
- mov edx,INFLATE_MODE_TYPE
- jmp L_update_stream_state
-
-L_invalid_literal_length_code:
-
-
-
-
-
- mov ecx, invalid_literal_length_code_msg
- mov edx,INFLATE_MODE_BAD
- jmp L_update_stream_state
-
-L_invalid_distance_too_far:
-
-
-
- mov esi, [esp+44]
- mov ecx, invalid_distance_too_far_msg
- mov edx,INFLATE_MODE_BAD
- jmp L_update_stream_state
-
-L_update_stream_state:
-
- mov eax, [esp+88]
- test ecx,ecx
- jz L_skip_msg
- mov [eax+24],ecx
-L_skip_msg:
- mov eax, [eax+28]
- mov [eax+mode_state],edx
- jmp L_break_loop
-
-ALIGN 4
-L_break_loop:
-; 1243 "inffast.S"
- cmp dword ptr [inflate_fast_use_mmx],2
- jne L_update_next_in
-
-
-
- mov ebx,ebp
-
-L_update_next_in:
-; 1266 "inffast.S"
- mov eax, [esp+88]
- mov ecx,ebx
- mov edx, [eax+28]
- shr ecx,3
- sub esi,ecx
- shl ecx,3
- sub ebx,ecx
- mov [eax+12],edi
- mov [edx+bits_state],ebx
- mov ecx,ebx
-
- lea ebx, [esp+28]
- cmp [esp+20],ebx
- jne L_buf_not_used
-
- sub esi,ebx
- mov ebx, [eax+0]
- mov [esp+20],ebx
- add esi,ebx
- mov ebx, [eax+4]
- sub ebx,11
- add [esp+20],ebx
-
-L_buf_not_used:
- mov [eax+0],esi
-
- mov ebx,1
- shl ebx,cl
- dec ebx
-
-
-
-
-
- cmp dword ptr [inflate_fast_use_mmx],2
- jne L_update_hold
-
-
-
- psrlq mm0,mm1
- movd ebp,mm0
-
- emms
-
-L_update_hold:
-
-
-
- and ebp,ebx
- mov [edx+hold_state],ebp
-
-
-
-
- mov ebx, [esp+20]
- cmp ebx,esi
- jbe L_last_is_smaller
-
- sub ebx,esi
- add ebx,11
- mov [eax+4],ebx
- jmp L_fixup_out
-L_last_is_smaller:
- sub esi,ebx
- neg esi
- add esi,11
- mov [eax+4],esi
-
-
-
-
-L_fixup_out:
-
- mov ebx, [esp+16]
- cmp ebx,edi
- jbe L_end_is_smaller
-
- sub ebx,edi
- add ebx,257
- mov [eax+16],ebx
- jmp L_done
-L_end_is_smaller:
- sub edi,ebx
- neg edi
- add edi,257
- mov [eax+16],edi
-
-
-
-
-
-L_done:
- add esp,64
- popfd
- pop ebx
- pop ebp
- pop esi
- pop edi
- ret
-_inflate_fast endp
-
-_TEXT ends
-end
diff --git a/zlib/contrib/masmx86/match686.asm b/zlib/contrib/masmx86/match686.asm
deleted file mode 100644
index 69e0eed0..00000000
--- a/zlib/contrib/masmx86/match686.asm
+++ /dev/null
@@ -1,479 +0,0 @@
-; match686.asm -- Asm portion of the optimized longest_match for 32 bits x86
-; Copyright (C) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
-; File written by Gilles Vollant, by converting match686.S from Brian Raiter
-; for MASM. This is as assembly version of longest_match
-; from Jean-loup Gailly in deflate.c
-;
-; http://www.zlib.net
-; http://www.winimage.com/zLibDll
-; http://www.muppetlabs.com/~breadbox/software/assembly.html
-;
-; For Visual C++ 4.x and higher and ML 6.x and higher
-; ml.exe is distributed in
-; http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
-;
-; this file contain two implementation of longest_match
-;
-; this longest_match was written by Brian raiter (1998), optimized for Pentium Pro
-; (and the faster known version of match_init on modern Core 2 Duo and AMD Phenom)
-;
-; for using an assembly version of longest_match, you need define ASMV in project
-;
-; compile the asm file running
-; ml /coff /Zi /c /Flmatch686.lst match686.asm
-; and do not include match686.obj in your project
-;
-; note: contrib of zLib 1.2.3 and earlier contained both a deprecated version for
-; Pentium (prior Pentium Pro) and this version for Pentium Pro and modern processor
-; with autoselect (with cpu detection code)
-; if you want support the old pentium optimization, you can still use these version
-;
-; this file is not optimized for old pentium, but it compatible with all x86 32 bits
-; processor (starting 80386)
-;
-;
-; see below : zlib1222add must be adjuster if you use a zlib version < 1.2.2.2
-
-;uInt longest_match(s, cur_match)
-; deflate_state *s;
-; IPos cur_match; /* current match */
-
- NbStack equ 76
- cur_match equ dword ptr[esp+NbStack-0]
- str_s equ dword ptr[esp+NbStack-4]
-; 5 dword on top (ret,ebp,esi,edi,ebx)
- adrret equ dword ptr[esp+NbStack-8]
- pushebp equ dword ptr[esp+NbStack-12]
- pushedi equ dword ptr[esp+NbStack-16]
- pushesi equ dword ptr[esp+NbStack-20]
- pushebx equ dword ptr[esp+NbStack-24]
-
- chain_length equ dword ptr [esp+NbStack-28]
- limit equ dword ptr [esp+NbStack-32]
- best_len equ dword ptr [esp+NbStack-36]
- window equ dword ptr [esp+NbStack-40]
- prev equ dword ptr [esp+NbStack-44]
- scan_start equ word ptr [esp+NbStack-48]
- wmask equ dword ptr [esp+NbStack-52]
- match_start_ptr equ dword ptr [esp+NbStack-56]
- nice_match equ dword ptr [esp+NbStack-60]
- scan equ dword ptr [esp+NbStack-64]
-
- windowlen equ dword ptr [esp+NbStack-68]
- match_start equ dword ptr [esp+NbStack-72]
- strend equ dword ptr [esp+NbStack-76]
- NbStackAdd equ (NbStack-24)
-
- .386p
-
- name gvmatch
- .MODEL FLAT
-
-
-
-; all the +zlib1222add offsets are due to the addition of fields
-; in zlib in the deflate_state structure since the asm code was first written
-; (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
-; (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
-; if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
-
- zlib1222add equ 8
-
-; Note : these value are good with a 8 bytes boundary pack structure
- dep_chain_length equ 74h+zlib1222add
- dep_window equ 30h+zlib1222add
- dep_strstart equ 64h+zlib1222add
- dep_prev_length equ 70h+zlib1222add
- dep_nice_match equ 88h+zlib1222add
- dep_w_size equ 24h+zlib1222add
- dep_prev equ 38h+zlib1222add
- dep_w_mask equ 2ch+zlib1222add
- dep_good_match equ 84h+zlib1222add
- dep_match_start equ 68h+zlib1222add
- dep_lookahead equ 6ch+zlib1222add
-
-
-_TEXT segment
-
-IFDEF NOUNDERLINE
- public longest_match
- public match_init
-ELSE
- public _longest_match
- public _match_init
-ENDIF
-
- MAX_MATCH equ 258
- MIN_MATCH equ 3
- MIN_LOOKAHEAD equ (MAX_MATCH+MIN_MATCH+1)
-
-
-
-MAX_MATCH equ 258
-MIN_MATCH equ 3
-MIN_LOOKAHEAD equ (MAX_MATCH + MIN_MATCH + 1)
-MAX_MATCH_8_ equ ((MAX_MATCH + 7) AND 0FFF0h)
-
-
-;;; stack frame offsets
-
-chainlenwmask equ esp + 0 ; high word: current chain len
- ; low word: s->wmask
-window equ esp + 4 ; local copy of s->window
-windowbestlen equ esp + 8 ; s->window + bestlen
-scanstart equ esp + 16 ; first two bytes of string
-scanend equ esp + 12 ; last two bytes of string
-scanalign equ esp + 20 ; dword-misalignment of string
-nicematch equ esp + 24 ; a good enough match size
-bestlen equ esp + 28 ; size of best match so far
-scan equ esp + 32 ; ptr to string wanting match
-
-LocalVarsSize equ 36
-; saved ebx byte esp + 36
-; saved edi byte esp + 40
-; saved esi byte esp + 44
-; saved ebp byte esp + 48
-; return address byte esp + 52
-deflatestate equ esp + 56 ; the function arguments
-curmatch equ esp + 60
-
-;;; Offsets for fields in the deflate_state structure. These numbers
-;;; are calculated from the definition of deflate_state, with the
-;;; assumption that the compiler will dword-align the fields. (Thus,
-;;; changing the definition of deflate_state could easily cause this
-;;; program to crash horribly, without so much as a warning at
-;;; compile time. Sigh.)
-
-dsWSize equ 36+zlib1222add
-dsWMask equ 44+zlib1222add
-dsWindow equ 48+zlib1222add
-dsPrev equ 56+zlib1222add
-dsMatchLen equ 88+zlib1222add
-dsPrevMatch equ 92+zlib1222add
-dsStrStart equ 100+zlib1222add
-dsMatchStart equ 104+zlib1222add
-dsLookahead equ 108+zlib1222add
-dsPrevLen equ 112+zlib1222add
-dsMaxChainLen equ 116+zlib1222add
-dsGoodMatch equ 132+zlib1222add
-dsNiceMatch equ 136+zlib1222add
-
-
-;;; match686.asm -- Pentium-Pro-optimized version of longest_match()
-;;; Written for zlib 1.1.2
-;;; Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
-;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html
-;;;
-;;
-;; This software is provided 'as-is', without any express or implied
-;; warranty. In no event will the authors be held liable for any damages
-;; arising from the use of this software.
-;;
-;; Permission is granted to anyone to use this software for any purpose,
-;; including commercial applications, and to alter it and redistribute it
-;; freely, subject to the following restrictions:
-;;
-;; 1. The origin of this software must not be misrepresented; you must not
-;; claim that you wrote the original software. If you use this software
-;; in a product, an acknowledgment in the product documentation would be
-;; appreciated but is not required.
-;; 2. Altered source versions must be plainly marked as such, and must not be
-;; misrepresented as being the original software
-;; 3. This notice may not be removed or altered from any source distribution.
-;;
-
-;GLOBAL _longest_match, _match_init
-
-
-;SECTION .text
-
-;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch)
-
-;_longest_match:
- IFDEF NOUNDERLINE
- longest_match proc near
- ELSE
- _longest_match proc near
- ENDIF
-.FPO (9, 4, 0, 0, 1, 0)
-
-;;; Save registers that the compiler may be using, and adjust esp to
-;;; make room for our stack frame.
-
- push ebp
- push edi
- push esi
- push ebx
- sub esp, LocalVarsSize
-
-;;; Retrieve the function arguments. ecx will hold cur_match
-;;; throughout the entire function. edx will hold the pointer to the
-;;; deflate_state structure during the function's setup (before
-;;; entering the main loop.
-
- mov edx, [deflatestate]
- mov ecx, [curmatch]
-
-;;; uInt wmask = s->w_mask;
-;;; unsigned chain_length = s->max_chain_length;
-;;; if (s->prev_length >= s->good_match) {
-;;; chain_length >>= 2;
-;;; }
-
- mov eax, [edx + dsPrevLen]
- mov ebx, [edx + dsGoodMatch]
- cmp eax, ebx
- mov eax, [edx + dsWMask]
- mov ebx, [edx + dsMaxChainLen]
- jl LastMatchGood
- shr ebx, 2
-LastMatchGood:
-
-;;; chainlen is decremented once beforehand so that the function can
-;;; use the sign flag instead of the zero flag for the exit test.
-;;; It is then shifted into the high word, to make room for the wmask
-;;; value, which it will always accompany.
-
- dec ebx
- shl ebx, 16
- or ebx, eax
- mov [chainlenwmask], ebx
-
-;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-
- mov eax, [edx + dsNiceMatch]
- mov ebx, [edx + dsLookahead]
- cmp ebx, eax
- jl LookaheadLess
- mov ebx, eax
-LookaheadLess: mov [nicematch], ebx
-
-;;; register Bytef *scan = s->window + s->strstart;
-
- mov esi, [edx + dsWindow]
- mov [window], esi
- mov ebp, [edx + dsStrStart]
- lea edi, [esi + ebp]
- mov [scan], edi
-
-;;; Determine how many bytes the scan ptr is off from being
-;;; dword-aligned.
-
- mov eax, edi
- neg eax
- and eax, 3
- mov [scanalign], eax
-
-;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
-;;; s->strstart - (IPos)MAX_DIST(s) : NIL;
-
- mov eax, [edx + dsWSize]
- sub eax, MIN_LOOKAHEAD
- sub ebp, eax
- jg LimitPositive
- xor ebp, ebp
-LimitPositive:
-
-;;; int best_len = s->prev_length;
-
- mov eax, [edx + dsPrevLen]
- mov [bestlen], eax
-
-;;; Store the sum of s->window + best_len in esi locally, and in esi.
-
- add esi, eax
- mov [windowbestlen], esi
-
-;;; register ush scan_start = *(ushf*)scan;
-;;; register ush scan_end = *(ushf*)(scan+best_len-1);
-;;; Posf *prev = s->prev;
-
- movzx ebx, word ptr [edi]
- mov [scanstart], ebx
- movzx ebx, word ptr [edi + eax - 1]
- mov [scanend], ebx
- mov edi, [edx + dsPrev]
-
-;;; Jump into the main loop.
-
- mov edx, [chainlenwmask]
- jmp short LoopEntry
-
-align 4
-
-;;; do {
-;;; match = s->window + cur_match;
-;;; if (*(ushf*)(match+best_len-1) != scan_end ||
-;;; *(ushf*)match != scan_start) continue;
-;;; [...]
-;;; } while ((cur_match = prev[cur_match & wmask]) > limit
-;;; && --chain_length != 0);
-;;;
-;;; Here is the inner loop of the function. The function will spend the
-;;; majority of its time in this loop, and majority of that time will
-;;; be spent in the first ten instructions.
-;;;
-;;; Within this loop:
-;;; ebx = scanend
-;;; ecx = curmatch
-;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
-;;; esi = windowbestlen - i.e., (window + bestlen)
-;;; edi = prev
-;;; ebp = limit
-
-LookupLoop:
- and ecx, edx
- movzx ecx, word ptr [edi + ecx*2]
- cmp ecx, ebp
- jbe LeaveNow
- sub edx, 00010000h
- js LeaveNow
-LoopEntry: movzx eax, word ptr [esi + ecx - 1]
- cmp eax, ebx
- jnz LookupLoop
- mov eax, [window]
- movzx eax, word ptr [eax + ecx]
- cmp eax, [scanstart]
- jnz LookupLoop
-
-;;; Store the current value of chainlen.
-
- mov [chainlenwmask], edx
-
-;;; Point edi to the string under scrutiny, and esi to the string we
-;;; are hoping to match it up with. In actuality, esi and edi are
-;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
-;;; initialized to -(MAX_MATCH_8 - scanalign).
-
- mov esi, [window]
- mov edi, [scan]
- add esi, ecx
- mov eax, [scanalign]
- mov edx, 0fffffef8h; -(MAX_MATCH_8)
- lea edi, [edi + eax + 0108h] ;MAX_MATCH_8]
- lea esi, [esi + eax + 0108h] ;MAX_MATCH_8]
-
-;;; Test the strings for equality, 8 bytes at a time. At the end,
-;;; adjust edx so that it is offset to the exact byte that mismatched.
-;;;
-;;; We already know at this point that the first three bytes of the
-;;; strings match each other, and they can be safely passed over before
-;;; starting the compare loop. So what this code does is skip over 0-3
-;;; bytes, as much as necessary in order to dword-align the edi
-;;; pointer. (esi will still be misaligned three times out of four.)
-;;;
-;;; It should be confessed that this loop usually does not represent
-;;; much of the total running time. Replacing it with a more
-;;; straightforward "rep cmpsb" would not drastically degrade
-;;; performance.
-
-LoopCmps:
- mov eax, [esi + edx]
- xor eax, [edi + edx]
- jnz LeaveLoopCmps
- mov eax, [esi + edx + 4]
- xor eax, [edi + edx + 4]
- jnz LeaveLoopCmps4
- add edx, 8
- jnz LoopCmps
- jmp short LenMaximum
-LeaveLoopCmps4: add edx, 4
-LeaveLoopCmps: test eax, 0000FFFFh
- jnz LenLower
- add edx, 2
- shr eax, 16
-LenLower: sub al, 1
- adc edx, 0
-
-;;; Calculate the length of the match. If it is longer than MAX_MATCH,
-;;; then automatically accept it as the best possible match and leave.
-
- lea eax, [edi + edx]
- mov edi, [scan]
- sub eax, edi
- cmp eax, MAX_MATCH
- jge LenMaximum
-
-;;; If the length of the match is not longer than the best match we
-;;; have so far, then forget it and return to the lookup loop.
-
- mov edx, [deflatestate]
- mov ebx, [bestlen]
- cmp eax, ebx
- jg LongerMatch
- mov esi, [windowbestlen]
- mov edi, [edx + dsPrev]
- mov ebx, [scanend]
- mov edx, [chainlenwmask]
- jmp LookupLoop
-
-;;; s->match_start = cur_match;
-;;; best_len = len;
-;;; if (len >= nice_match) break;
-;;; scan_end = *(ushf*)(scan+best_len-1);
-
-LongerMatch: mov ebx, [nicematch]
- mov [bestlen], eax
- mov [edx + dsMatchStart], ecx
- cmp eax, ebx
- jge LeaveNow
- mov esi, [window]
- add esi, eax
- mov [windowbestlen], esi
- movzx ebx, word ptr [edi + eax - 1]
- mov edi, [edx + dsPrev]
- mov [scanend], ebx
- mov edx, [chainlenwmask]
- jmp LookupLoop
-
-;;; Accept the current string, with the maximum possible length.
-
-LenMaximum: mov edx, [deflatestate]
- mov dword ptr [bestlen], MAX_MATCH
- mov [edx + dsMatchStart], ecx
-
-;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
-;;; return s->lookahead;
-
-LeaveNow:
- mov edx, [deflatestate]
- mov ebx, [bestlen]
- mov eax, [edx + dsLookahead]
- cmp ebx, eax
- jg LookaheadRet
- mov eax, ebx
-LookaheadRet:
-
-;;; Restore the stack and return from whence we came.
-
- add esp, LocalVarsSize
- pop ebx
- pop esi
- pop edi
- pop ebp
-
- ret
-; please don't remove this string !
-; Your can freely use match686 in any free or commercial app if you don't remove the string in the binary!
- db 0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998",0dh,0ah
-
-
- IFDEF NOUNDERLINE
- longest_match endp
- ELSE
- _longest_match endp
- ENDIF
-
- IFDEF NOUNDERLINE
- match_init proc near
- ret
- match_init endp
- ELSE
- _match_init proc near
- ret
- _match_init endp
- ENDIF
-
-
-_TEXT ends
-end
diff --git a/zlib/contrib/masmx86/readme.txt b/zlib/contrib/masmx86/readme.txt
deleted file mode 100644
index 3f888867..00000000
--- a/zlib/contrib/masmx86/readme.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-
-Summary
--------
-This directory contains ASM implementations of the functions
-longest_match() and inflate_fast().
-
-
-Use instructions
-----------------
-Assemble using MASM, and copy the object files into the zlib source
-directory, then run the appropriate makefile, as suggested below. You can
-donwload MASM from here:
-
- http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
-
-You can also get objects files here:
-
- http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
-
-Build instructions
-------------------
-* With Microsoft C and MASM:
-nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj"
-
-* With Borland C and TASM:
-make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj"
-
diff --git a/zlib/doc/crc-doc.1.0.pdf b/zlib/doc/crc-doc.1.0.pdf
new file mode 100644
index 00000000..d6942ecc
--- /dev/null
+++ b/zlib/doc/crc-doc.1.0.pdf
Binary files differ
diff --git a/zlib/examples/gznorm.c b/zlib/examples/gznorm.c
new file mode 100644
index 00000000..68e0a0f2
--- /dev/null
+++ b/zlib/examples/gznorm.c
@@ -0,0 +1,470 @@
+/* gznorm.c -- normalize a gzip stream
+ * Copyright (C) 2018 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ * Version 1.0 7 Oct 2018 Mark Adler */
+
+// gznorm takes a gzip stream, potentially containing multiple members, and
+// converts it to a gzip stream with a single member. In addition the gzip
+// header is normalized, removing the file name and time stamp, and setting the
+// other header contents (XFL, OS) to fixed values. gznorm does not recompress
+// the data, so it is fast, but no advantage is gained from the history that
+// could be available across member boundaries.
+
+#include <stdio.h> // fread, fwrite, putc, fflush, ferror, fprintf,
+ // vsnprintf, stdout, stderr, NULL, FILE
+#include <stdlib.h> // malloc, free
+#include <string.h> // strerror
+#include <errno.h> // errno
+#include <stdarg.h> // va_list, va_start, va_end
+#include "zlib.h" // inflateInit2, inflate, inflateReset, inflateEnd,
+ // z_stream, z_off_t, crc32_combine, Z_NULL, Z_BLOCK,
+ // Z_OK, Z_STREAM_END, Z_BUF_ERROR, Z_DATA_ERROR,
+ // Z_MEM_ERROR
+
+#if defined(MSDOS) || defined(OS2) || defined(WIN32) || defined(__CYGWIN__)
+# include <fcntl.h>
+# include <io.h>
+# define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
+#else
+# define SET_BINARY_MODE(file)
+#endif
+
+#define local static
+
+// printf to an allocated string. Return the string, or NULL if the printf or
+// allocation fails.
+local char *aprintf(char *fmt, ...) {
+ // Get the length of the result of the printf.
+ va_list args;
+ va_start(args, fmt);
+ int len = vsnprintf(NULL, 0, fmt, args);
+ va_end(args);
+ if (len < 0)
+ return NULL;
+
+ // Allocate the required space and printf to it.
+ char *str = malloc(len + 1);
+ if (str == NULL)
+ return NULL;
+ va_start(args, fmt);
+ vsnprintf(str, len + 1, fmt, args);
+ va_end(args);
+ return str;
+}
+
+// Return with an error, putting an allocated error message in *err. Doing an
+// inflateEnd() on an already ended state, or one with state set to Z_NULL, is
+// permitted.
+#define BYE(...) \
+ do { \
+ inflateEnd(&strm); \
+ *err = aprintf(__VA_ARGS__); \
+ return 1; \
+ } while (0)
+
+// Chunk size for buffered reads and for decompression. Twice this many bytes
+// will be allocated on the stack by gzip_normalize(). Must fit in an unsigned.
+#define CHUNK 16384
+
+// Read a gzip stream from in and write an equivalent normalized gzip stream to
+// out. If given no input, an empty gzip stream will be written. If successful,
+// 0 is returned, and *err is set to NULL. On error, 1 is returned, where the
+// details of the error are returned in *err, a pointer to an allocated string.
+//
+// The input may be a stream with multiple gzip members, which is converted to
+// a single gzip member on the output. Each gzip member is decompressed at the
+// level of deflate blocks. This enables clearing the last-block bit, shifting
+// the compressed data to concatenate to the previous member's compressed data,
+// which can end at an arbitrary bit boundary, and identifying stored blocks in
+// order to resynchronize those to byte boundaries. The deflate compressed data
+// is terminated with a 10-bit empty fixed block. If any members on the input
+// end with a 10-bit empty fixed block, then that block is excised from the
+// stream. This avoids appending empty fixed blocks for every normalization,
+// and assures that gzip_normalize applied a second time will not change the
+// input. The pad bits after stored block headers and after the final deflate
+// block are all forced to zeros.
+local int gzip_normalize(FILE *in, FILE *out, char **err) {
+ // initialize the inflate engine to process a gzip member
+ z_stream strm;
+ strm.zalloc = Z_NULL;
+ strm.zfree = Z_NULL;
+ strm.opaque = Z_NULL;
+ strm.avail_in = 0;
+ strm.next_in = Z_NULL;
+ if (inflateInit2(&strm, 15 + 16) != Z_OK)
+ BYE("out of memory");
+
+ // State while processing the input gzip stream.
+ enum { // BETWEEN -> HEAD -> BLOCK -> TAIL -> BETWEEN -> ...
+ BETWEEN, // between gzip members (must end in this state)
+ HEAD, // reading a gzip header
+ BLOCK, // reading deflate blocks
+ TAIL // reading a gzip trailer
+ } state = BETWEEN; // current component being processed
+ unsigned long crc = 0; // accumulated CRC of uncompressed data
+ unsigned long len = 0; // accumulated length of uncompressed data
+ unsigned long buf = 0; // deflate stream bit buffer of num bits
+ int num = 0; // number of bits in buf (at bottom)
+
+ // Write a canonical gzip header (no mod time, file name, comment, extra
+ // block, or extra flags, and OS is marked as unknown).
+ fwrite("\x1f\x8b\x08\0\0\0\0\0\0\xff", 1, 10, out);
+
+ // Process the gzip stream from in until reaching the end of the input,
+ // encountering invalid input, or experiencing an i/o error.
+ int more; // true if not at the end of the input
+ do {
+ // State inside this loop.
+ unsigned char *put; // next input buffer location to process
+ int prev; // number of bits from previous block in
+ // the bit buffer, or -1 if not at the
+ // start of a block
+ unsigned long long memb; // uncompressed length of member
+ size_t tail; // number of trailer bytes read (0..8)
+ unsigned long part; // accumulated trailer component
+
+ // Get the next chunk of input from in.
+ unsigned char dat[CHUNK];
+ strm.avail_in = fread(dat, 1, CHUNK, in);
+ if (strm.avail_in == 0)
+ break;
+ more = strm.avail_in == CHUNK;
+ strm.next_in = put = dat;
+
+ // Run that chunk of input through the inflate engine to exhaustion.
+ do {
+ // At this point it is assured that strm.avail_in > 0.
+
+ // Inflate until the end of a gzip component (header, deflate
+ // block, trailer) is reached, or until all of the chunk is
+ // consumed. The resulting decompressed data is discarded, though
+ // the total size of the decompressed data in each member is
+ // tracked, for the calculation of the total CRC.
+ do {
+ // inflate and handle any errors
+ unsigned char scrap[CHUNK];
+ strm.avail_out = CHUNK;
+ strm.next_out = scrap;
+ int ret = inflate(&strm, Z_BLOCK);
+ if (ret == Z_MEM_ERROR)
+ BYE("out of memory");
+ if (ret == Z_DATA_ERROR)
+ BYE("input invalid: %s", strm.msg);
+ if (ret != Z_OK && ret != Z_BUF_ERROR && ret != Z_STREAM_END)
+ BYE("internal error");
+
+ // Update the number of uncompressed bytes generated in this
+ // member. The actual count (not modulo 2^32) is required to
+ // correctly compute the total CRC.
+ unsigned got = CHUNK - strm.avail_out;
+ memb += got;
+ if (memb < got)
+ BYE("overflow error");
+
+ // Continue to process this chunk until it is consumed, or
+ // until the end of a component (header, deflate block, or
+ // trailer) is reached.
+ } while (strm.avail_out == 0 && (strm.data_type & 0x80) == 0);
+
+ // Since strm.avail_in was > 0 for the inflate call, some input was
+ // just consumed. It is therefore assured that put < strm.next_in.
+
+ // Disposition the consumed component or part of a component.
+ switch (state) {
+ case BETWEEN:
+ state = HEAD;
+ // Fall through to HEAD when some or all of the header is
+ // processed.
+
+ case HEAD:
+ // Discard the header.
+ if (strm.data_type & 0x80) {
+ // End of header reached -- deflate blocks follow.
+ put = strm.next_in;
+ prev = num;
+ memb = 0;
+ state = BLOCK;
+ }
+ break;
+
+ case BLOCK:
+ // Copy the deflate stream to the output, but with the
+ // last-block-bit cleared. Re-synchronize stored block
+ // headers to the output byte boundaries. The bytes at
+ // put..strm.next_in-1 is the compressed data that has been
+ // processed and is ready to be copied to the output.
+
+ // At this point, it is assured that new compressed data is
+ // available, i.e., put < strm.next_in. If prev is -1, then
+ // that compressed data starts in the middle of a deflate
+ // block. If prev is not -1, then the bits in the bit
+ // buffer, possibly combined with the bits in *put, contain
+ // the three-bit header of the new deflate block. In that
+ // case, prev is the number of bits from the previous block
+ // that remain in the bit buffer. Since num is the number
+ // of bits in the bit buffer, we have that num - prev is
+ // the number of bits from the new block currently in the
+ // bit buffer.
+
+ // If strm.data_type & 0xc0 is 0x80, then the last byte of
+ // the available compressed data includes the last bits of
+ // the end of a deflate block. In that case, that last byte
+ // also has strm.data_type & 0x1f bits of the next deflate
+ // block, in the range 0..7. If strm.data_type & 0xc0 is
+ // 0xc0, then the last byte of the compressed data is the
+ // end of the deflate stream, followed by strm.data_type &
+ // 0x1f pad bits, also in the range 0..7.
+
+ // Set bits to the number of bits not yet consumed from the
+ // last byte. If we are at the end of the block, bits is
+ // either the number of bits in the last byte belonging to
+ // the next block, or the number of pad bits after the
+ // final block. In either of those cases, bits is in the
+ // range 0..7.
+ ; // (required due to C syntax oddity)
+ int bits = strm.data_type & 0x1f;
+
+ if (prev != -1) {
+ // We are at the start of a new block. Clear the last
+ // block bit, and check for special cases. If it is a
+ // stored block, then emit the header and pad to the
+ // next byte boundary. If it is a final, empty fixed
+ // block, then excise it.
+
+ // Some or all of the three header bits for this block
+ // may already be in the bit buffer. Load any remaining
+ // header bits into the bit buffer.
+ if (num - prev < 3) {
+ buf += (unsigned long)*put++ << num;
+ num += 8;
+ }
+
+ // Set last to have a 1 in the position of the last
+ // block bit in the bit buffer.
+ unsigned long last = (unsigned long)1 << prev;
+
+ if (((buf >> prev) & 7) == 3) {
+ // This is a final fixed block. Load at least ten
+ // bits from this block, including the header, into
+ // the bit buffer. We already have at least three,
+ // so at most one more byte needs to be loaded.
+ if (num - prev < 10) {
+ if (put == strm.next_in)
+ // Need to go get and process more input.
+ // We'll end up back here to finish this.
+ break;
+ buf += (unsigned long)*put++ << num;
+ num += 8;
+ }
+ if (((buf >> prev) & 0x3ff) == 3) {
+ // That final fixed block is empty. Delete it
+ // to avoid adding an empty block every time a
+ // gzip stream is normalized.
+ num = prev;
+ buf &= last - 1; // zero the pad bits
+ }
+ }
+ else if (((buf >> prev) & 6) == 0) {
+ // This is a stored block. Flush to the next
+ // byte boundary after the three-bit header.
+ num = (prev + 10) & ~7;
+ buf &= last - 1; // zero the pad bits
+ }
+
+ // Clear the last block bit.
+ buf &= ~last;
+
+ // Write out complete bytes in the bit buffer.
+ while (num >= 8) {
+ putc(buf, out);
+ buf >>= 8;
+ num -= 8;
+ }
+
+ // If no more bytes left to process, then we have
+ // consumed the byte that had bits from the next block.
+ if (put == strm.next_in)
+ bits = 0;
+ }
+
+ // We are done handling the deflate block header. Now copy
+ // all or almost all of the remaining compressed data that
+ // has been processed so far. Don't copy one byte at the
+ // end if it contains bits from the next deflate block or
+ // pad bits at the end of a deflate block.
+
+ // mix is 1 if we are at the end of a deflate block, and if
+ // some of the bits in the last byte follow this block. mix
+ // is 0 if we are in the middle of a deflate block, if the
+ // deflate block ended on a byte boundary, or if all of the
+ // compressed data processed so far has been consumed.
+ int mix = (strm.data_type & 0x80) && bits;
+
+ // Copy all of the processed compressed data to the output,
+ // except for the last byte if it contains bits from the
+ // next deflate block or pad bits at the end of the deflate
+ // stream. Copy the data after shifting in num bits from
+ // buf in front of it, leaving num bits from the end of the
+ // compressed data in buf when done.
+ unsigned char *end = strm.next_in - mix;
+ if (put < end) {
+ if (num)
+ // Insert num bits from buf before the data being
+ // copied.
+ do {
+ buf += (unsigned)(*put++) << num;
+ putc(buf, out);
+ buf >>= 8;
+ } while (put < end);
+ else {
+ // No shifting needed -- write directly.
+ fwrite(put, 1, end - put, out);
+ put = end;
+ }
+ }
+
+ // Process the last processed byte if it wasn't written.
+ if (mix) {
+ // Load the last byte into the bit buffer.
+ buf += (unsigned)(*put++) << num;
+ num += 8;
+
+ if (strm.data_type & 0x40) {
+ // We are at the end of the deflate stream and
+ // there are bits pad bits. Discard the pad bits
+ // and write a byte to the output, if available.
+ // Leave the num bits left over in buf to prepend
+ // to the next deflate stream.
+ num -= bits;
+ if (num >= 8) {
+ putc(buf, out);
+ num -= 8;
+ buf >>= 8;
+ }
+
+ // Force the pad bits in the bit buffer to zeros.
+ buf &= ((unsigned long)1 << num) - 1;
+
+ // Don't need to set prev here since going to TAIL.
+ }
+ else
+ // At the end of an internal deflate block. Leave
+ // the last byte in the bit buffer to examine on
+ // the next entry to BLOCK, when more bits from the
+ // next block will be available.
+ prev = num - bits; // number of bits in buffer
+ // from current block
+ }
+
+ // Don't have a byte left over, so we are in the middle of
+ // a deflate block, or the deflate block ended on a byte
+ // boundary. Set prev appropriately for the next entry into
+ // BLOCK.
+ else if (strm.data_type & 0x80)
+ // The block ended on a byte boundary, so no header
+ // bits are in the bit buffer.
+ prev = num;
+ else
+ // In the middle of a deflate block, so no header here.
+ prev = -1;
+
+ // Check for the end of the deflate stream.
+ if ((strm.data_type & 0xc0) == 0xc0) {
+ // That ends the deflate stream on the input side, the
+ // pad bits were discarded, and any remaining bits from
+ // the last block in the stream are saved in the bit
+ // buffer to prepend to the next stream. Process the
+ // gzip trailer next.
+ tail = 0;
+ part = 0;
+ state = TAIL;
+ }
+ break;
+
+ case TAIL:
+ // Accumulate available trailer bytes to update the total
+ // CRC and the total uncompressed length.
+ do {
+ part = (part >> 8) + ((unsigned long)(*put++) << 24);
+ tail++;
+ if (tail == 4) {
+ // Update the total CRC.
+ z_off_t len2 = memb;
+ if (len2 < 0 || (unsigned long long)len2 != memb)
+ BYE("overflow error");
+ crc = crc ? crc32_combine(crc, part, len2) : part;
+ part = 0;
+ }
+ else if (tail == 8) {
+ // Update the total uncompressed length. (It's ok
+ // if this sum is done modulo 2^32.)
+ len += part;
+
+ // At the end of a member. Set up to inflate an
+ // immediately following gzip member. (If we made
+ // it this far, then the trailer was valid.)
+ if (inflateReset(&strm) != Z_OK)
+ BYE("internal error");
+ state = BETWEEN;
+ break;
+ }
+ } while (put < strm.next_in);
+ break;
+ }
+
+ // Process the input buffer until completely consumed.
+ } while (strm.avail_in > 0);
+
+ // Process input until end of file, invalid input, or i/o error.
+ } while (more);
+
+ // Done with the inflate engine.
+ inflateEnd(&strm);
+
+ // Verify the validity of the input.
+ if (state != BETWEEN)
+ BYE("input invalid: incomplete gzip stream");
+
+ // Write the remaining deflate stream bits, followed by a terminating
+ // deflate fixed block.
+ buf += (unsigned long)3 << num;
+ putc(buf, out);
+ putc(buf >> 8, out);
+ if (num > 6)
+ putc(0, out);
+
+ // Write the gzip trailer, which is the CRC and the uncompressed length
+ // modulo 2^32, both in little-endian order.
+ putc(crc, out);
+ putc(crc >> 8, out);
+ putc(crc >> 16, out);
+ putc(crc >> 24, out);
+ putc(len, out);
+ putc(len >> 8, out);
+ putc(len >> 16, out);
+ putc(len >> 24, out);
+ fflush(out);
+
+ // Check for any i/o errors.
+ if (ferror(in) || ferror(out))
+ BYE("i/o error: %s", strerror(errno));
+
+ // All good!
+ *err = NULL;
+ return 0;
+}
+
+// Normalize the gzip stream on stdin, writing the result to stdout.
+int main(void) {
+ // Avoid end-of-line conversions on evil operating systems.
+ SET_BINARY_MODE(stdin);
+ SET_BINARY_MODE(stdout);
+
+ // Normalize from stdin to stdout, returning 1 on error, 0 if ok.
+ char *err;
+ int ret = gzip_normalize(stdin, stdout, &err);
+ if (ret)
+ fprintf(stderr, "gznorm error: %s\n", err);
+ free(err);
+ return ret;
+}
diff --git a/zlib/examples/zran.h b/zlib/examples/zran.h
new file mode 100644
index 00000000..2314125d
--- /dev/null
+++ b/zlib/examples/zran.h
@@ -0,0 +1,40 @@
+/* zran.h -- example of zlib/gzip stream indexing and random access
+ * Copyright (C) 2005, 2012, 2018 Mark Adler
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ * Version 1.2 14 Oct 2018 Mark Adler */
+
+#include <stdio.h>
+#include "zlib.h"
+
+/* Access point list. */
+struct deflate_index {
+ int have; /* number of list entries */
+ int gzip; /* 1 if the index is of a gzip file, 0 if it is of a
+ zlib stream */
+ off_t length; /* total length of uncompressed data */
+ void *list; /* allocated list of entries */
+};
+
+/* Make one entire pass through a zlib or gzip compressed stream and build an
+ index, with access points about every span bytes of uncompressed output.
+ gzip files with multiple members are indexed in their entirety. span should
+ be chosen to balance the speed of random access against the memory
+ requirements of the list, about 32K bytes per access point. The return value
+ is the number of access points on success (>= 1), Z_MEM_ERROR for out of
+ memory, Z_DATA_ERROR for an error in the input file, or Z_ERRNO for a file
+ read error. On success, *built points to the resulting index. */
+int deflate_index_build(FILE *in, off_t span, struct deflate_index **built);
+
+/* Deallocate an index built by deflate_index_build() */
+void deflate_index_free(struct deflate_index *index);
+
+/* Use the index to read len bytes from offset into buf. Return bytes read or
+ negative for error (Z_DATA_ERROR or Z_MEM_ERROR). If data is requested past
+ the end of the uncompressed data, then deflate_index_extract() will return a
+ value less than len, indicating how much was actually read into buf. This
+ function should not return a data error unless the file was modified since
+ the index was generated, since deflate_index_build() validated all of the
+ input. deflate_index_extract() will return Z_ERRNO if there is an error on
+ reading or seeking the input file. */
+int deflate_index_extract(FILE *in, struct deflate_index *index, off_t offset,
+ unsigned char *buf, int len);